From: Cris Di Sclafani Date: Fri, 7 Aug 2020 10:46:10 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.5.0 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22https:/fonts.googleapis.com/%22my-avatar.png//%22%7B%7Blicense.fax?a=commitdiff_plain;h=9c3fc623cb61cf0a7d87bf2d84dac28f0f928680;p=motion2.git Built motion from commit (unavailable).|2.5.0 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 8eeac38..1eb5dfa 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.5.0", "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-08-07T08:20:32.757Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); +define({ "name": "xCALLY Motion API", "version": "2.5.0", "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-08-07T10:39:19.939Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 7d158cd..93edfc8 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.5.0", "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-08-07T08:20:32.757Z", "url": "http://apidocjs.com", "version": "0.19.0" } } +{ "name": "xCALLY Motion API", "version": "2.5.0", "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-08-07T10:39:19.939Z", "url": "http://apidocjs.com", "version": "0.19.0" } } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 61aa5b1..70cbc5b 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 _0x0051=['VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize'];(function(_0x25d542,_0x462ad9){var _0x377a7e=function(_0x5bd8ee){while(--_0x5bd8ee){_0x25d542['push'](_0x25d542['shift']());}};_0x377a7e(++_0x462ad9);}(_0x0051,0x117));var _0x1005=function(_0x3a2147,_0x536e69){_0x3a2147=_0x3a2147-0x0;var _0x158499=_0x0051[_0x3a2147];return _0x158499;};'use strict';var Sequelize=require(_0x1005('0x0'));module['exports']={'name':{'type':Sequelize[_0x1005('0x1')],'get':function(_0x4cea35){return this[_0x1005('0x2')](_0x1005('0x3'));}},'action':{'type':Sequelize[_0x1005('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1005('0x5'),_0x1005('0x6'),_0x1005('0x7'),'jscripty','urlForward',_0x1005('0x8'),'bot',_0x1005('0x9')]],'msg':_0x1005('0xa')}},'comment':_0x1005('0xa')},'data1':{'type':Sequelize[_0x1005('0x4')](0x1000),'comment':_0x1005('0xb')},'data2':{'type':Sequelize[_0x1005('0x4')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x1005('0x4')](0x1000),'comment':_0x1005('0xc')},'data4':{'type':Sequelize[_0x1005('0x4')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x1005('0x4')]},'data7':{'type':Sequelize[_0x1005('0xd')]}}; \ No newline at end of file +var _0x8357=['sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','bot','STRING','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT'];(function(_0x477ab3,_0x297dc5){var _0x100884=function(_0x520a92){while(--_0x520a92){_0x477ab3['push'](_0x477ab3['shift']());}};_0x100884(++_0x297dc5);}(_0x8357,0x152));var _0x7835=function(_0x294667,_0x240fb9){_0x294667=_0x294667-0x0;var _0x528394=_0x8357[_0x294667];return _0x528394;};'use strict';var Sequelize=require(_0x7835('0x0'));module[_0x7835('0x1')]={'name':{'type':Sequelize[_0x7835('0x2')],'get':function(_0x45c08d){return this[_0x7835('0x3')](_0x7835('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x7835('0x5'),_0x7835('0x6'),'motionbar',_0x7835('0x7'),'urlForward','browser',_0x7835('0x8'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x7835('0x9')](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[_0x7835('0x9')](0x1000),'comment':_0x7835('0xa')},'data3':{'type':Sequelize[_0x7835('0x9')](0x1000),'comment':_0x7835('0xb')},'data4':{'type':Sequelize[_0x7835('0x9')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x7835('0xc')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 5883238..4562fed 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 _0xaa36=['zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','destroy','end','error','stack','name','update','body','Action','find','then','catch','params','html-pdf','eml-format','rimraf'];(function(_0x1a9daa,_0x2a0558){var _0x377ad2=function(_0x3ff35b){while(--_0x3ff35b){_0x1a9daa['push'](_0x1a9daa['shift']());}};_0x377ad2(++_0x2a0558);}(_0xaa36,0x81));var _0x6aa3=function(_0x101d18,_0x4638ab){_0x101d18=_0x101d18-0x0;var _0x1a4511=_0xaa36[_0x101d18];return _0x1a4511;};'use strict';var pdf=require(_0x6aa3('0x0'));var emlformat=require(_0x6aa3('0x1'));var rimraf=require(_0x6aa3('0x2'));var zipdir=require(_0x6aa3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6aa3('0x4'));var moment=require('moment');var BPromise=require(_0x6aa3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6aa3('0x6'));var sox=require(_0x6aa3('0x7'));var csv=require(_0x6aa3('0x8'));var ejs=require(_0x6aa3('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6aa3('0xa'));var crypto=require(_0x6aa3('0xb'));var jsforce=require(_0x6aa3('0xc'));var deskjs=require(_0x6aa3('0xd'));var toCsv=require(_0x6aa3('0x8'));var querystring=require(_0x6aa3('0xe'));var Papa=require(_0x6aa3('0xf'));var Redis=require(_0x6aa3('0x10'));var authService=require(_0x6aa3('0x11'));var qs=require(_0x6aa3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6aa3('0x13'));var logger=require(_0x6aa3('0x14'))(_0x6aa3('0x15'));var utils=require(_0x6aa3('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf3cb14,_0xf7a405){_0xf7a405=_0xf7a405||0xcc;return function(_0x564425){if(_0x564425){return _0xf3cb14[_0x6aa3('0x17')](_0xf7a405);}return _0xf3cb14[_0x6aa3('0x18')](_0xf7a405)['end']();};}function respondWithResult(_0x3d32a8,_0x1ecbd0){_0x1ecbd0=_0x1ecbd0||0xc8;return function(_0x199ee2){if(_0x199ee2){return _0x3d32a8[_0x6aa3('0x18')](_0x1ecbd0)[_0x6aa3('0x19')](_0x199ee2);}};}function respondWithFilteredResult(_0x4e4cd2,_0x2c8515){return function(_0x42aab8){if(_0x42aab8){var _0x3c7a3b=_0x42aab8[_0x6aa3('0x1a')],_0x16ee6c=_0x2c8515['offset'],_0x1ff858=_0x2c8515[_0x6aa3('0x1b')]+_0x2c8515[_0x6aa3('0x1c')],_0x1db096;if(_0x1ff858>=_0x3c7a3b){_0x1ff858=_0x3c7a3b;_0x1db096=0xc8;}else{_0x1db096=0xce;}_0x4e4cd2['status'](_0x1db096);return _0x4e4cd2['set'](_0x6aa3('0x1d'),_0x16ee6c+'-'+_0x1ff858+'/'+_0x3c7a3b)['json'](_0x42aab8);}return null;};}function patchUpdates(_0x2f41d3){return function(_0x244203){try{jsonpatch[_0x6aa3('0x1e')](_0x244203,_0x2f41d3,!![]);}catch(_0x17029e){return BPromise[_0x6aa3('0x1f')](_0x17029e);}return _0x244203['save']();};}function saveUpdates(_0x3e366d,_0x5696df){return function(_0x26c1af){if(_0x26c1af){return _0x26c1af['update'](_0x3e366d)['then'](function(_0x54db98){return _0x54db98;});}return null;};}function removeEntity(_0x49da8a,_0x3d4970){return function(_0x575a50){if(_0x575a50){return _0x575a50[_0x6aa3('0x20')]()['then'](function(){_0x49da8a[_0x6aa3('0x18')](0xcc)[_0x6aa3('0x21')]();});}};}function handleEntityNotFound(_0x1d5dae,_0x82344a){return function(_0x444612){if(!_0x444612){_0x1d5dae[_0x6aa3('0x17')](0x194);}return _0x444612;};}function handleError(_0x6a46e5,_0x40e57b){_0x40e57b=_0x40e57b||0x1f4;return function(_0x4c2534){logger[_0x6aa3('0x22')](_0x4c2534[_0x6aa3('0x23')]);if(_0x4c2534[_0x6aa3('0x24')]){delete _0x4c2534['name'];}_0x6a46e5['status'](_0x40e57b)['send'](_0x4c2534);};}exports[_0x6aa3('0x25')]=function(_0xf3de4a,_0x1e27d7){if(_0xf3de4a[_0x6aa3('0x26')]['id']){delete _0xf3de4a[_0x6aa3('0x26')]['id'];}return db[_0x6aa3('0x27')][_0x6aa3('0x28')]({'where':{'id':_0xf3de4a['params']['id']}})[_0x6aa3('0x29')](handleEntityNotFound(_0x1e27d7,null))[_0x6aa3('0x29')](saveUpdates(_0xf3de4a[_0x6aa3('0x26')],null))[_0x6aa3('0x29')](respondWithResult(_0x1e27d7,null))[_0x6aa3('0x2a')](handleError(_0x1e27d7,null));};exports[_0x6aa3('0x20')]=function(_0x15b1a2,_0x14d780){return db[_0x6aa3('0x27')][_0x6aa3('0x28')]({'where':{'id':_0x15b1a2[_0x6aa3('0x2b')]['id']}})[_0x6aa3('0x29')](handleEntityNotFound(_0x14d780,null))[_0x6aa3('0x29')](removeEntity(_0x14d780,null))[_0x6aa3('0x2a')](handleError(_0x14d780,null));}; \ No newline at end of file +var _0x2fe4=['find','params','then','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','error','send','body','Action'];(function(_0x11cdca,_0xcb2bb7){var _0x2a483c=function(_0x271f77){while(--_0x271f77){_0x11cdca['push'](_0x11cdca['shift']());}};_0x2a483c(++_0xcb2bb7);}(_0x2fe4,0x131));var _0x42fe=function(_0x1a5529,_0x196832){_0x1a5529=_0x1a5529-0x0;var _0x5af82f=_0x2fe4[_0x1a5529];return _0x5af82f;};'use strict';var pdf=require(_0x42fe('0x0'));var emlformat=require(_0x42fe('0x1'));var rimraf=require(_0x42fe('0x2'));var zipdir=require(_0x42fe('0x3'));var jsonpatch=require(_0x42fe('0x4'));var rp=require('request-promise');var moment=require(_0x42fe('0x5'));var BPromise=require(_0x42fe('0x6'));var Mustache=require('mustache');var util=require(_0x42fe('0x7'));var path=require(_0x42fe('0x8'));var sox=require(_0x42fe('0x9'));var csv=require(_0x42fe('0xa'));var ejs=require(_0x42fe('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x42fe('0xc'));var deskjs=require(_0x42fe('0xd'));var toCsv=require(_0x42fe('0xa'));var querystring=require(_0x42fe('0xe'));var Papa=require('papaparse');var Redis=require(_0x42fe('0xf'));var authService=require(_0x42fe('0x10'));var qs=require(_0x42fe('0x11'));var as=require(_0x42fe('0x12'));var hardwareService=require(_0x42fe('0x13'));var logger=require(_0x42fe('0x14'))(_0x42fe('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x42fe('0x16'))['db'];function respondWithStatusCode(_0x10218a,_0x15e9ab){_0x15e9ab=_0x15e9ab||0xcc;return function(_0x43eabd){if(_0x43eabd){return _0x10218a[_0x42fe('0x17')](_0x15e9ab);}return _0x10218a[_0x42fe('0x18')](_0x15e9ab)[_0x42fe('0x19')]();};}function respondWithResult(_0x2c7757,_0x45b4e6){_0x45b4e6=_0x45b4e6||0xc8;return function(_0x5f5a5f){if(_0x5f5a5f){return _0x2c7757[_0x42fe('0x18')](_0x45b4e6)[_0x42fe('0x1a')](_0x5f5a5f);}};}function respondWithFilteredResult(_0x41c9fe,_0x5e45f0){return function(_0x512970){if(_0x512970){var _0x2606ab=_0x512970[_0x42fe('0x1b')],_0x104126=_0x5e45f0[_0x42fe('0x1c')],_0x2bbf8b=_0x5e45f0[_0x42fe('0x1c')]+_0x5e45f0['limit'],_0x240741;if(_0x2bbf8b>=_0x2606ab){_0x2bbf8b=_0x2606ab;_0x240741=0xc8;}else{_0x240741=0xce;}_0x41c9fe[_0x42fe('0x18')](_0x240741);return _0x41c9fe[_0x42fe('0x1d')](_0x42fe('0x1e'),_0x104126+'-'+_0x2bbf8b+'/'+_0x2606ab)[_0x42fe('0x1a')](_0x512970);}return null;};}function patchUpdates(_0xd720ed){return function(_0x2b658f){try{jsonpatch[_0x42fe('0x1f')](_0x2b658f,_0xd720ed,!![]);}catch(_0x53ec88){return BPromise[_0x42fe('0x20')](_0x53ec88);}return _0x2b658f['save']();};}function saveUpdates(_0x3552fd,_0x2f86f8){return function(_0x3636b7){if(_0x3636b7){return _0x3636b7[_0x42fe('0x21')](_0x3552fd)['then'](function(_0x2758bf){return _0x2758bf;});}return null;};}function removeEntity(_0x47f14f,_0x365e04){return function(_0x194955){if(_0x194955){return _0x194955[_0x42fe('0x22')]()['then'](function(){_0x47f14f[_0x42fe('0x18')](0xcc)[_0x42fe('0x19')]();});}};}function handleEntityNotFound(_0xeca895,_0xdfe6a7){return function(_0x37dcb5){if(!_0x37dcb5){_0xeca895[_0x42fe('0x17')](0x194);}return _0x37dcb5;};}function handleError(_0x219bc0,_0x481e97){_0x481e97=_0x481e97||0x1f4;return function(_0x24c5f6){logger[_0x42fe('0x23')](_0x24c5f6['stack']);if(_0x24c5f6['name']){delete _0x24c5f6['name'];}_0x219bc0[_0x42fe('0x18')](_0x481e97)[_0x42fe('0x24')](_0x24c5f6);};}exports['update']=function(_0x416e03,_0x1f96b7){if(_0x416e03[_0x42fe('0x25')]['id']){delete _0x416e03[_0x42fe('0x25')]['id'];}return db[_0x42fe('0x26')][_0x42fe('0x27')]({'where':{'id':_0x416e03[_0x42fe('0x28')]['id']}})['then'](handleEntityNotFound(_0x1f96b7,null))[_0x42fe('0x29')](saveUpdates(_0x416e03[_0x42fe('0x25')],null))[_0x42fe('0x29')](respondWithResult(_0x1f96b7,null))[_0x42fe('0x2a')](handleError(_0x1f96b7,null));};exports['destroy']=function(_0x24c8a4,_0x2c4b4b){return db[_0x42fe('0x26')][_0x42fe('0x27')]({'where':{'id':_0x24c8a4[_0x42fe('0x28')]['id']}})[_0x42fe('0x29')](handleEntityNotFound(_0x2c4b4b,null))[_0x42fe('0x29')](removeEntity(_0x2c4b4b,null))[_0x42fe('0x2a')](handleError(_0x2c4b4b,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index a143af9..f850939 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 _0x3bc5=['Action','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x5addf7,_0x50785e){var _0xb0746a=function(_0x2ee32b){while(--_0x2ee32b){_0x5addf7['push'](_0x5addf7['shift']());}};_0xb0746a(++_0x50785e);}(_0x3bc5,0xcd));var _0x53bc=function(_0x2dcd3a,_0x205603){_0x2dcd3a=_0x2dcd3a-0x0;var _0x5a2fa6=_0x3bc5[_0x2dcd3a];return _0x5a2fa6;};'use strict';var _=require(_0x53bc('0x0'));var util=require(_0x53bc('0x1'));var logger=require(_0x53bc('0x2'))(_0x53bc('0x3'));var moment=require(_0x53bc('0x4'));var BPromise=require(_0x53bc('0x5'));var rp=require(_0x53bc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53bc('0x7'));var config=require(_0x53bc('0x8'));var attributes=require('./action.attributes');module[_0x53bc('0x9')]=function(_0x177968,_0x572142){return _0x177968[_0x53bc('0xa')](_0x53bc('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd17a=['request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5e79ca,_0x2e34a4){var _0x1873c6=function(_0x4c1496){while(--_0x4c1496){_0x5e79ca['push'](_0x5e79ca['shift']());}};_0x1873c6(++_0x2e34a4);}(_0xd17a,0xcb));var _0xad17=function(_0xdb27ce,_0x21e4f6){_0xdb27ce=_0xdb27ce-0x0;var _0x2a9fcb=_0xd17a[_0xdb27ce];return _0x2a9fcb;};'use strict';var _=require(_0xad17('0x0'));var util=require(_0xad17('0x1'));var logger=require(_0xad17('0x2'))('api');var moment=require(_0xad17('0x3'));var BPromise=require(_0xad17('0x4'));var rp=require(_0xad17('0x5'));var fs=require('fs');var path=require(_0xad17('0x6'));var rimraf=require('rimraf');var config=require(_0xad17('0x7'));var attributes=require(_0xad17('0x8'));module[_0xad17('0x9')]=function(_0x260bb0,_0x14834b){return _0x260bb0[_0xad17('0xa')](_0xad17('0xb'),attributes,{'tableName':_0xad17('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 04df68c..ef6cfee 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 _0xe706=['http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1280c7,_0x368178){var _0x1d5b66=function(_0x52bd6b){while(--_0x52bd6b){_0x1280c7['push'](_0x1280c7['shift']());}};_0x1d5b66(++_0x368178);}(_0xe706,0xa3));var _0x6e70=function(_0x1f14a8,_0x11de2f){_0x1f14a8=_0x1f14a8-0x0;var _0x4f5581=_0xe706[_0x1f14a8];return _0x4f5581;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('Action,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('Action,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s'];(function(_0x4975d7,_0x1b03f7){var _0x4d6d5b=function(_0x59c521){while(--_0x59c521){_0x4975d7['push'](_0x4975d7['shift']());}};_0x4d6d5b(++_0x1b03f7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xcb91[_0x125ff8];return _0x2d9ef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('Action,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index dbb0f0f..e31c85c 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 _0xd5ef=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','exports'];(function(_0x83bda7,_0xec2817){var _0x204137=function(_0x46bc2c){while(--_0x46bc2c){_0x83bda7['push'](_0x83bda7['shift']());}};_0x204137(++_0xec2817);}(_0xd5ef,0x1c0));var _0xfd5e=function(_0x5c7a6f,_0x2e0f25){_0x5c7a6f=_0x5c7a6f-0x0;var _0x51b56a=_0xd5ef[_0x5c7a6f];return _0x51b56a;};'use strict';var multer=require(_0xfd5e('0x0'));var util=require(_0xfd5e('0x1'));var path=require(_0xfd5e('0x2'));var timeout=require(_0xfd5e('0x3'));var express=require('express');var router=express[_0xfd5e('0x4')]();var auth=require(_0xfd5e('0x5'));var interaction=require(_0xfd5e('0x6'));var config=require(_0xfd5e('0x7'));var controller=require(_0xfd5e('0x8'));router[_0xfd5e('0x9')](_0xfd5e('0xa'),auth['isAuthenticated'](),controller[_0xfd5e('0xb')]);router[_0xfd5e('0xc')](_0xfd5e('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xfd5e('0xd')]=router; \ No newline at end of file +var _0xcb76=['../../config/environment','./action.controller','put','update','delete','/:id','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xdc7173,_0x381f4e){var _0xf21379=function(_0x16fa98){while(--_0x16fa98){_0xdc7173['push'](_0xdc7173['shift']());}};_0xf21379(++_0x381f4e);}(_0xcb76,0x15d));var _0x6cb7=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xcb76[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0x6cb7('0x0'));var util=require(_0x6cb7('0x1'));var path=require(_0x6cb7('0x2'));var timeout=require(_0x6cb7('0x3'));var express=require(_0x6cb7('0x4'));var router=express[_0x6cb7('0x5')]();var auth=require(_0x6cb7('0x6'));var interaction=require(_0x6cb7('0x7'));var config=require(_0x6cb7('0x8'));var controller=require(_0x6cb7('0x9'));router[_0x6cb7('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6cb7('0xb')]);router[_0x6cb7('0xc')](_0x6cb7('0xd'),auth[_0x6cb7('0xe')](),controller[_0x6cb7('0xf')]);module[_0x6cb7('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index b82ebfb..47eab0a 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 _0x1c74=['sequelize','exports','STRING','TEXT'];(function(_0x42f067,_0x5812f5){var _0x425b80=function(_0xfc3e04){while(--_0xfc3e04){_0x42f067['push'](_0x42f067['shift']());}};_0x425b80(++_0x5812f5);}(_0x1c74,0x16c));var _0x41c7=function(_0x2fa977,_0x398065){_0x2fa977=_0x2fa977-0x0;var _0x2f5782=_0x1c74[_0x2fa977];return _0x2f5782;};'use strict';var Sequelize=require(_0x41c7('0x0'));module[_0x41c7('0x1')]={'name':{'type':Sequelize[_0x41c7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x41c7('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x41c7('0x3')]},'joins':{'type':Sequelize[_0x41c7('0x3')]}}; \ No newline at end of file +var _0xf60b=['exports','STRING','TEXT','sequelize'];(function(_0x2eb07d,_0x42b119){var _0x331e78=function(_0x3b12eb){while(--_0x3b12eb){_0x2eb07d['push'](_0x2eb07d['shift']());}};_0x331e78(++_0x42b119);}(_0xf60b,0x1ab));var _0xbf60=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xf60b[_0xac151d];return _0x111dba;};'use strict';var Sequelize=require(_0xbf60('0x0'));module[_0xbf60('0x1')]={'name':{'type':Sequelize[_0xbf60('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbf60('0x2')]},'parent':{'type':Sequelize[_0xbf60('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xbf60('0x3')]},'joins':{'type':Sequelize[_0xbf60('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 8accd3f..4d4cd00 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 _0xb0af=['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)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','Sequelize','ValidationErrorItem','findAll','keyBy','from','MetricId','metric','field','replace','function','format','groupBy','orderBy','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','Limited\x20Query:','toString','sequelize','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','Please\x20insert\x20at\x20least\x20one\x20field','select','alias','clone','debug','QueryTypes','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','../../components/export/','output','../../files/reports','countTable','COUNT(*)','run','runReport','ROUND(%s)','IS\x20NOT\x20NULL','value','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join'];(function(_0x279c7e,_0x19bdd5){var _0x5f1223=function(_0x3fc45a){while(--_0x3fc45a){_0x279c7e['push'](_0x279c7e['shift']());}};_0x5f1223(++_0x19bdd5);}(_0xb0af,0xed));var _0xfb0a=function(_0x299b3a,_0x33a487){_0x299b3a=_0x299b3a-0x0;var _0x2533c7=_0xb0af[_0x299b3a];return _0x2533c7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfb0a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfb0a('0x1'));var jsonpatch=require(_0xfb0a('0x2'));var rp=require(_0xfb0a('0x3'));var moment=require('moment');var BPromise=require(_0xfb0a('0x4'));var Mustache=require(_0xfb0a('0x5'));var util=require(_0xfb0a('0x6'));var path=require('path');var sox=require(_0xfb0a('0x7'));var csv=require('to-csv');var ejs=require(_0xfb0a('0x8'));var fs=require('fs');var _=require(_0xfb0a('0x9'));var squel=require(_0xfb0a('0xa'));var crypto=require(_0xfb0a('0xb'));var jsforce=require(_0xfb0a('0xc'));var deskjs=require(_0xfb0a('0xd'));var toCsv=require(_0xfb0a('0xe'));var querystring=require(_0xfb0a('0xf'));var Papa=require(_0xfb0a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfb0a('0x11'));var as=require(_0xfb0a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xfb0a('0x13'))['db'];function respondWithStatusCode(_0xb3d072,_0x20a6c5){_0x20a6c5=_0x20a6c5||0xcc;return function(_0x285d7f){if(_0x285d7f){return _0xb3d072[_0xfb0a('0x14')](_0x20a6c5);}return _0xb3d072[_0xfb0a('0x15')](_0x20a6c5)[_0xfb0a('0x16')]();};}function respondWithResult(_0x553c4c,_0x3e8f78){_0x3e8f78=_0x3e8f78||0xc8;return function(_0x4a72cd){if(_0x4a72cd){return _0x553c4c['status'](_0x3e8f78)[_0xfb0a('0x17')](_0x4a72cd);}};}function respondWithFilteredResult(_0x41642c,_0x4e331a){return function(_0x1a3407){if(_0x1a3407){var _0xd81e78=_0x1a3407[_0xfb0a('0x18')],_0x5606d4=_0x4e331a[_0xfb0a('0x19')],_0x53fa11=_0x4e331a['offset']+_0x4e331a[_0xfb0a('0x1a')],_0x5a7e17;if(_0x53fa11>=_0xd81e78){_0x53fa11=_0xd81e78;_0x5a7e17=0xc8;}else{_0x5a7e17=0xce;}_0x41642c['status'](_0x5a7e17);return _0x41642c[_0xfb0a('0x1b')](_0xfb0a('0x1c'),_0x5606d4+'-'+_0x53fa11+'/'+_0xd81e78)[_0xfb0a('0x17')](_0x1a3407);}return null;};}function patchUpdates(_0x4165bb){return function(_0x5e9229){try{jsonpatch[_0xfb0a('0x1d')](_0x5e9229,_0x4165bb,!![]);}catch(_0x1f0fc7){return BPromise[_0xfb0a('0x1e')](_0x1f0fc7);}return _0x5e9229[_0xfb0a('0x1f')]();};}function saveUpdates(_0x206411,_0x40f351){return function(_0x5739b1){if(_0x5739b1){return _0x5739b1[_0xfb0a('0x20')](_0x206411)[_0xfb0a('0x21')](function(_0x2c9e98){return _0x2c9e98;});}return null;};}function removeEntity(_0x43dd21,_0x4316d2){return function(_0x1328cb){if(_0x1328cb){return _0x1328cb['destroy']()[_0xfb0a('0x21')](function(){var _0x1c051e=_0x1328cb['get']({'plain':!![]});var _0x4c90f6=_0xfb0a('0x22');return db[_0xfb0a('0x23')]['destroy']({'where':{'type':_0x4c90f6,'resourceId':_0x1c051e['id']}})['then'](function(){return _0x1328cb;});})['then'](function(){_0x43dd21[_0xfb0a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40bd06,_0x2de861){return function(_0xd8db24){if(!_0xd8db24){_0x40bd06[_0xfb0a('0x14')](0x194);}return _0xd8db24;};}function handleError(_0x54948c,_0x1b762c){_0x1b762c=_0x1b762c||0x1f4;return function(_0xe3a970){logger[_0xfb0a('0x24')](_0xe3a970[_0xfb0a('0x25')]);if(_0xe3a970[_0xfb0a('0x26')]){delete _0xe3a970[_0xfb0a('0x26')];}_0x54948c[_0xfb0a('0x15')](_0x1b762c)[_0xfb0a('0x27')](_0xe3a970);};}exports[_0xfb0a('0x28')]=function(_0x2fc67a,_0x54ef1a){var _0x21c3ee={},_0x229fce={},_0x47b783={'count':0x0,'rows':[]};var _0xf3a3cf=_['map'](db[_0xfb0a('0x29')][_0xfb0a('0x2a')],function(_0x3186e2){return{'name':_0x3186e2[_0xfb0a('0x2b')],'type':_0x3186e2['type'][_0xfb0a('0x2c')]};});_0x229fce[_0xfb0a('0x2d')]=_[_0xfb0a('0x2e')](_0xf3a3cf,'name');_0x229fce[_0xfb0a('0x2f')]=_[_0xfb0a('0x30')](_0x2fc67a[_0xfb0a('0x2f')]);_0x229fce['filters']=_[_0xfb0a('0x31')](_0x229fce['model'],_0x229fce[_0xfb0a('0x2f')]);_0x21c3ee[_0xfb0a('0x32')]=_[_0xfb0a('0x31')](_0x229fce[_0xfb0a('0x2d')],qs['fields'](_0x2fc67a['query']['fields']));_0x21c3ee[_0xfb0a('0x32')]=_0x21c3ee['attributes']['length']?_0x21c3ee['attributes']:_0x229fce[_0xfb0a('0x2d')];if(!_0x2fc67a[_0xfb0a('0x2f')][_0xfb0a('0x33')](_0xfb0a('0x34'))){_0x21c3ee['limit']=qs[_0xfb0a('0x1a')](_0x2fc67a[_0xfb0a('0x2f')]['limit']);_0x21c3ee['offset']=qs[_0xfb0a('0x19')](_0x2fc67a[_0xfb0a('0x2f')]['offset']);}_0x21c3ee[_0xfb0a('0x35')]=qs[_0xfb0a('0x36')](_0x2fc67a[_0xfb0a('0x2f')][_0xfb0a('0x36')]);_0x21c3ee[_0xfb0a('0x37')]=qs['filters'](_[_0xfb0a('0x38')](_0x2fc67a['query'],_0x229fce[_0xfb0a('0x39')]));if(_0x2fc67a[_0xfb0a('0x2f')][_0xfb0a('0x3a')]){_0x21c3ee[_0xfb0a('0x37')]=_[_0xfb0a('0x3b')](_0x21c3ee[_0xfb0a('0x37')],{'$or':_[_0xfb0a('0x2e')](_0xf3a3cf,function(_0x600b68){if(_0x600b68[_0xfb0a('0x3c')]!==_0xfb0a('0x3d')){var _0xab4c49={};_0xab4c49[_0x600b68[_0xfb0a('0x26')]]={'$like':'%'+_0x2fc67a[_0xfb0a('0x2f')]['filter']+'%'};return _0xab4c49;}})});}_0x21c3ee=_[_0xfb0a('0x3b')]({},_0x21c3ee,_0x2fc67a[_0xfb0a('0x3e')]);var _0x5b18f7={'where':_0x21c3ee[_0xfb0a('0x37')]};return db[_0xfb0a('0x29')][_0xfb0a('0x18')](_0x5b18f7)[_0xfb0a('0x21')](function(_0x300336){_0x47b783[_0xfb0a('0x18')]=_0x300336;if(_0x2fc67a[_0xfb0a('0x2f')][_0xfb0a('0x3f')]){_0x21c3ee['include']=[{'all':!![]}];}return db[_0xfb0a('0x29')]['findAll'](_0x21c3ee);})['then'](function(_0x43acea){_0x47b783[_0xfb0a('0x40')]=_0x43acea;return _0x47b783;})[_0xfb0a('0x21')](respondWithFilteredResult(_0x54ef1a,_0x21c3ee))[_0xfb0a('0x41')](handleError(_0x54ef1a,null));};exports[_0xfb0a('0x42')]=function(_0xeaa726,_0x4ba980){var _0x48966f={'raw':![],'where':{'id':_0xeaa726[_0xfb0a('0x43')]['id']}},_0x248c89={};_0x248c89['model']=_[_0xfb0a('0x30')](db[_0xfb0a('0x29')][_0xfb0a('0x2a')]);_0x248c89[_0xfb0a('0x2f')]=_['keys'](_0xeaa726['query']);_0x248c89[_0xfb0a('0x39')]=_[_0xfb0a('0x31')](_0x248c89['model'],_0x248c89[_0xfb0a('0x2f')]);_0x48966f[_0xfb0a('0x32')]=_['intersection'](_0x248c89[_0xfb0a('0x2d')],qs[_0xfb0a('0x44')](_0xeaa726['query'][_0xfb0a('0x44')]));_0x48966f[_0xfb0a('0x32')]=_0x48966f[_0xfb0a('0x32')][_0xfb0a('0x45')]?_0x48966f['attributes']:_0x248c89[_0xfb0a('0x2d')];if(_0xeaa726[_0xfb0a('0x2f')]['includeAll']){_0x48966f['include']=[{'all':!![]}];}_0x48966f=_[_0xfb0a('0x3b')]({},_0x48966f,_0xeaa726['options']);return db[_0xfb0a('0x29')][_0xfb0a('0x46')](_0x48966f)[_0xfb0a('0x21')](handleEntityNotFound(_0x4ba980,null))['then'](respondWithResult(_0x4ba980,null))[_0xfb0a('0x41')](handleError(_0x4ba980,null));};exports[_0xfb0a('0x47')]=function(_0x3353c0,_0xa32054){return db[_0xfb0a('0x29')]['create'](_0x3353c0[_0xfb0a('0x48')],{})[_0xfb0a('0x21')](function(_0x51ef36){var _0x56559d=_0x3353c0[_0xfb0a('0x49')]['get']({'plain':!![]});if(!_0x56559d)throw new Error(_0xfb0a('0x4a'));if(_0x56559d[_0xfb0a('0x4b')]==='user'){var _0x3e1617=_0x51ef36[_0xfb0a('0x4c')]({'plain':!![]});var _0x3e2c8e=_0xfb0a('0x4d');return db[_0xfb0a('0x4e')]['find']({'where':{'name':_0x3e2c8e,'userProfileId':_0x56559d[_0xfb0a('0x4f')]},'raw':!![]})[_0xfb0a('0x21')](function(_0x443d7d){if(_0x443d7d&&_0x443d7d[_0xfb0a('0x50')]===0x0){return db['UserProfileResource'][_0xfb0a('0x47')]({'name':_0x3e1617[_0xfb0a('0x26')],'resourceId':_0x3e1617['id'],'type':'CustomReports','sectionId':_0x443d7d['id']},{})['then'](function(){return _0x51ef36;});}else{return _0x51ef36;}})[_0xfb0a('0x41')](function(_0x562a2b){logger[_0xfb0a('0x24')](_0xfb0a('0x51'),_0x562a2b);throw _0x562a2b;});}return _0x51ef36;})[_0xfb0a('0x21')](respondWithResult(_0xa32054,0xc9))[_0xfb0a('0x41')](handleError(_0xa32054,null));};exports[_0xfb0a('0x20')]=function(_0x45be48,_0x3e4b48){if(_0x45be48['body']['id']){delete _0x45be48[_0xfb0a('0x48')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x45be48['params']['id']}})[_0xfb0a('0x21')](handleEntityNotFound(_0x3e4b48,null))[_0xfb0a('0x21')](saveUpdates(_0x45be48[_0xfb0a('0x48')],null))['then'](respondWithResult(_0x3e4b48,null))['catch'](handleError(_0x3e4b48,null));};exports[_0xfb0a('0x52')]=function(_0x2b72bf,_0x343c9e){return db[_0xfb0a('0x29')][_0xfb0a('0x46')]({'where':{'id':_0x2b72bf[_0xfb0a('0x43')]['id']}})[_0xfb0a('0x21')](handleEntityNotFound(_0x343c9e,null))[_0xfb0a('0x21')](removeEntity(_0x343c9e,null))[_0xfb0a('0x41')](handleError(_0x343c9e,null));};exports[_0xfb0a('0x53')]=function(_0x1988a4,_0x266140){var _0x20b39f=0xa;var _0x194c5e=[_0xfb0a('0x54'),_0xfb0a('0x55'),_0xfb0a('0x56'),_0xfb0a('0x57')];var _0x5644f1={'SUM':_0xfb0a('0x58'),'COUNT':_0xfb0a('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xfb0a('0x5a'),'AVG':_0xfb0a('0x5b'),'GROUP_CONCAT':_0xfb0a('0x5c'),'GROUP_CONCAT ASC':_0xfb0a('0x5d'),'GROUP_CONCAT DESC':_0xfb0a('0x5e')};var _0x57deac={'SEC_TO_TIME':_0xfb0a('0x5f'),'DATE':_0xfb0a('0x60'),'HOUR':_0xfb0a('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5e9cea=function(_0x3c53e1){return!_[_0xfb0a('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xfb0a('0x63'),_0xfb0a('0x64')],_0x3c53e1);};var _0x2e1bfc=function(_0x375ebf){if(!_0x375ebf||!_0x375ebf['rules'][_0xfb0a('0x45')]){return'';}for(var _0x16195a='(',_0x1452ff=0x0;_0x1452ff<_0x375ebf[_0xfb0a('0x65')][_0xfb0a('0x45')];_0x1452ff+=0x1){_0x1452ff>0x0&&(_0x16195a+='\x20'+_0x375ebf[_0xfb0a('0x66')]+'\x20');_0x16195a+=_0x375ebf[_0xfb0a('0x65')][_0x1452ff][_0xfb0a('0x67')]?_0x2e1bfc(_0x375ebf[_0xfb0a('0x65')][_0x1452ff][_0xfb0a('0x67')]):_0x375ebf[_0xfb0a('0x65')][_0x1452ff]['field']+'\x20'+_0x375ebf['rules'][_0x1452ff][_0xfb0a('0x68')]+(_0x5e9cea(_0x375ebf[_0xfb0a('0x65')][_0x1452ff][_0xfb0a('0x68')])?'\x20'+_0x375ebf[_0xfb0a('0x65')][_0x1452ff]['value']:'');}return _0x16195a+')';};var _0x557e97={'where':{'id':_0x1988a4[_0xfb0a('0x43')]['id']}},_0x1abcb3,_0x4e9ccf,_0x3038aa,_0x5c745e,_0x43d633;_0x557e97=_['merge']({},_0x557e97,_0x1988a4[_0xfb0a('0x3e')]);return db[_0xfb0a('0x29')][_0xfb0a('0x46')](_0x557e97)[_0xfb0a('0x21')](function(_0x496fb6){if(_0x496fb6){_0x1abcb3=_0x496fb6;return _0x496fb6[_0xfb0a('0x69')]();}return null;})[_0xfb0a('0x21')](function(_0x357cee){if(_0x357cee){if(!_0x357cee[_0xfb0a('0x45')]){throw new db[(_0xfb0a('0x6a'))][(_0xfb0a('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4e9ccf=_0x357cee;return db['AnalyticMetric'][_0xfb0a('0x6c')]({'raw':!![]});}return null;})[_0xfb0a('0x21')](function(_0x4705cb){if(_0x4705cb){_0x3038aa=_[_0xfb0a('0x6d')](_0x4705cb,'id');var _0x5d2599;var _0x3905f9=squel['select']();_0x3905f9[_0xfb0a('0x6e')](_0x1abcb3['table']);for(var _0x517b84=0x0;_0x517b84<_0x4e9ccf[_0xfb0a('0x45')];_0x517b84+=0x1){_0x5d2599=_0x4e9ccf[_0x517b84]['MetricId']?_0x3038aa[_0x4e9ccf[_0x517b84][_0xfb0a('0x6f')]][_0xfb0a('0x70')]:_0x4e9ccf[_0x517b84][_0xfb0a('0x71')];_0x5d2599=_0x4e9ccf[_0x517b84]['function']?_[_0xfb0a('0x72')](_0x5644f1[_0x4e9ccf[_0x517b84][_0xfb0a('0x73')]],'%s',_0x5d2599):_0x5d2599;_0x5d2599=_0x4e9ccf[_0x517b84][_0xfb0a('0x74')]?_[_0xfb0a('0x72')](_0x57deac[_0x4e9ccf[_0x517b84][_0xfb0a('0x74')]],'%s',_0x5d2599):_0x5d2599;if(_0x4e9ccf[_0x517b84][_0xfb0a('0x75')]){_0x3905f9[_0xfb0a('0x67')](_0x5d2599);}_0x4e9ccf[_0x517b84][_0xfb0a('0x76')]&&_0x3905f9['order'](_0x5d2599,_0x4e9ccf[_0x517b84]['orderBy']==='DESC'?![]:!![]);_0x3905f9[_0xfb0a('0x71')](_0x5d2599,_0x4e9ccf[_0x517b84]['alias']||_0x5d2599);}if(_0x1abcb3[_0xfb0a('0x77')]){_0x1abcb3['joins']=JSON[_0xfb0a('0x78')](_0x1abcb3[_0xfb0a('0x77')]);for(var _0x3eafc8=0x0;_0x3eafc8<_0x1abcb3[_0xfb0a('0x77')][_0xfb0a('0x45')];_0x3eafc8+=0x1){if(_0x1abcb3[_0xfb0a('0x77')][_0x3eafc8][_0xfb0a('0x3c')]&&_[_0xfb0a('0x62')](_0x194c5e,_0x1abcb3['joins'][_0x3eafc8][_0xfb0a('0x3c')])&&_0x1abcb3[_0xfb0a('0x77')][_0x3eafc8][_0xfb0a('0x79')]&&_0x1abcb3['joins'][_0x3eafc8][_0xfb0a('0x7a')]&&_0x1abcb3['joins'][_0x3eafc8]['foreignKey']){_0x3905f9[_0x1abcb3[_0xfb0a('0x77')][_0x3eafc8][_0xfb0a('0x3c')]](_0x1abcb3[_0xfb0a('0x77')][_0x3eafc8][_0xfb0a('0x7a')],null,util[_0xfb0a('0x74')](_0xfb0a('0x7b'),_0x1abcb3[_0xfb0a('0x7c')],_0x1abcb3['joins'][_0x3eafc8]['parentKey'],_0x1abcb3[_0xfb0a('0x77')][_0x3eafc8][_0xfb0a('0x7a')],_0x1abcb3[_0xfb0a('0x77')][_0x3eafc8][_0xfb0a('0x7d')]));}}}if(_0x1abcb3[_0xfb0a('0x7e')]){_0x1abcb3[_0xfb0a('0x7e')]=JSON[_0xfb0a('0x78')](_0x1abcb3[_0xfb0a('0x7e')]);_0x3905f9['where'](_0x2e1bfc(_0x1abcb3['conditions'][_0xfb0a('0x67')]));}_0x43d633=_0x3905f9['clone']();_0x3905f9[_0xfb0a('0x1a')](_0x20b39f);_0x3905f9['offset'](0x0);logger['debug'](_0xfb0a('0x7f'),_0x3905f9[_0xfb0a('0x80')]());return db['sequelize'][_0xfb0a('0x2f')](_0x3905f9[_0xfb0a('0x80')](),{'type':db[_0xfb0a('0x81')]['QueryTypes'][_0xfb0a('0x82')]});}})[_0xfb0a('0x21')](respondWithResult(_0x266140,null))['catch'](handleError(_0x266140,null));};function runReport(_0x3864a1,_0x30fa42,_0x524204){var _0x8ab617=_0x30fa42[_0xfb0a('0x26')];var _0x4dc134=0xa;var _0x268f30=['join',_0xfb0a('0x55'),_0xfb0a('0x56'),_0xfb0a('0x57')];var _0x3c87a5={'SUM':_0xfb0a('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfb0a('0x83'),'MAX':_0xfb0a('0x84'),'MIN':_0xfb0a('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfb0a('0x5c'),'GROUP_CONCAT ASC':_0xfb0a('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x11b632={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfb0a('0x60'),'HOUR':_0xfb0a('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2123e0=function(_0x21adb9){return!_[_0xfb0a('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xfb0a('0x63'),'IS\x20NOT\x20EMPTY'],_0x21adb9);};var _0x3c9843=function(_0x1c95e4){if(!_0x1c95e4||!_0x1c95e4[_0xfb0a('0x65')]['length']){return'';}for(var _0x312697='(',_0x2ff033=0x0;_0x2ff033<_0x1c95e4[_0xfb0a('0x65')]['length'];_0x2ff033+=0x1){_0x2ff033>0x0&&(_0x312697+='\x20'+_0x1c95e4[_0xfb0a('0x66')]+'\x20');_0x312697+=_0x1c95e4['rules'][_0x2ff033][_0xfb0a('0x67')]?_0x3c9843(_0x1c95e4[_0xfb0a('0x65')][_0x2ff033][_0xfb0a('0x67')]):_0x1c95e4[_0xfb0a('0x65')][_0x2ff033][_0xfb0a('0x71')]+'\x20'+_0x1c95e4[_0xfb0a('0x65')][_0x2ff033][_0xfb0a('0x68')]+(_0x2123e0(_0x1c95e4[_0xfb0a('0x65')][_0x2ff033][_0xfb0a('0x68')])?'\x20'+_0x1c95e4['rules'][_0x2ff033]['value']:'');}return _0x312697+')';};var _0x15fc2b={'where':{'id':_0x3864a1['id']}},_0x5eaf87,_0x1ca6c9,_0x5e35c6,_0x20fff6,_0x2e1c99;_0x15fc2b=_[_0xfb0a('0x3b')]({},_0x15fc2b,_0x524204);return db['AnalyticCustomReport'][_0xfb0a('0x46')](_0x15fc2b)[_0xfb0a('0x21')](function(_0x22a70d){if(_0x22a70d){_0x5eaf87=_0x22a70d;return _0x22a70d['getFields']();}return null;})[_0xfb0a('0x21')](function(_0x16c5c6){if(_0x16c5c6){if(!_0x16c5c6[_0xfb0a('0x45')]){throw new db[(_0xfb0a('0x6a'))]['ValidationErrorItem'](_0xfb0a('0x85'),0x193);}_0x1ca6c9=_0x16c5c6;return db['AnalyticMetric'][_0xfb0a('0x6c')]({'raw':!![]});}return null;})[_0xfb0a('0x21')](function(_0x406693){if(_0x406693){_0x5e35c6=_[_0xfb0a('0x6d')](_0x406693,'id');var _0xcc5d5;var _0x481740=squel[_0xfb0a('0x86')]();_0x481740[_0xfb0a('0x6e')](_0x5eaf87[_0xfb0a('0x7c')]);for(var _0x21b4d3=0x0;_0x21b4d3<_0x1ca6c9[_0xfb0a('0x45')];_0x21b4d3+=0x1){_0xcc5d5=_0x1ca6c9[_0x21b4d3][_0xfb0a('0x6f')]?_0x5e35c6[_0x1ca6c9[_0x21b4d3][_0xfb0a('0x6f')]][_0xfb0a('0x70')]:_0x1ca6c9[_0x21b4d3]['field'];_0xcc5d5=_0x1ca6c9[_0x21b4d3][_0xfb0a('0x73')]?_['replace'](_0x3c87a5[_0x1ca6c9[_0x21b4d3]['function']],'%s',_0xcc5d5):_0xcc5d5;_0xcc5d5=_0x1ca6c9[_0x21b4d3][_0xfb0a('0x74')]?_[_0xfb0a('0x72')](_0x11b632[_0x1ca6c9[_0x21b4d3]['format']],'%s',_0xcc5d5):_0xcc5d5;if(_0x1ca6c9[_0x21b4d3]['groupBy']){_0x481740[_0xfb0a('0x67')](_0xcc5d5);}_0x1ca6c9[_0x21b4d3][_0xfb0a('0x76')]&&_0x481740['order'](_0xcc5d5,_0x1ca6c9[_0x21b4d3][_0xfb0a('0x76')]==='DESC'?![]:!![]);_0x481740['field'](_0xcc5d5,_0x1ca6c9[_0x21b4d3][_0xfb0a('0x87')]||_0xcc5d5);}if(_0x5eaf87[_0xfb0a('0x77')]){_0x5eaf87[_0xfb0a('0x77')]=JSON['parse'](_0x5eaf87['joins']);for(var _0x54af9d=0x0;_0x54af9d<_0x5eaf87[_0xfb0a('0x77')]['length'];_0x54af9d+=0x1){if(_0x5eaf87[_0xfb0a('0x77')][_0x54af9d][_0xfb0a('0x3c')]&&_[_0xfb0a('0x62')](_0x268f30,_0x5eaf87[_0xfb0a('0x77')][_0x54af9d][_0xfb0a('0x3c')])&&_0x5eaf87['joins'][_0x54af9d][_0xfb0a('0x79')]&&_0x5eaf87[_0xfb0a('0x77')][_0x54af9d][_0xfb0a('0x7a')]&&_0x5eaf87[_0xfb0a('0x77')][_0x54af9d]['foreignKey']){_0x481740[_0x5eaf87[_0xfb0a('0x77')][_0x54af9d][_0xfb0a('0x3c')]](_0x5eaf87[_0xfb0a('0x77')][_0x54af9d][_0xfb0a('0x7a')],null,util[_0xfb0a('0x74')]('%s.%s\x20=\x20%s.%s',_0x5eaf87[_0xfb0a('0x7c')],_0x5eaf87['joins'][_0x54af9d][_0xfb0a('0x79')],_0x5eaf87[_0xfb0a('0x77')][_0x54af9d]['foreignTable'],_0x5eaf87[_0xfb0a('0x77')][_0x54af9d][_0xfb0a('0x7d')]));}}}if(_0x5eaf87[_0xfb0a('0x7e')]){_0x5eaf87['conditions']=JSON['parse'](_0x5eaf87[_0xfb0a('0x7e')]);_0x481740[_0xfb0a('0x37')](_0x3c9843(_0x5eaf87[_0xfb0a('0x7e')]['group']));}_0x2e1c99=_0x481740[_0xfb0a('0x88')]();_0x481740['limit'](_0x4dc134);_0x481740[_0xfb0a('0x19')](0x0);logger[_0xfb0a('0x89')](_0xfb0a('0x7f'),_0x481740['toString']());return db[_0xfb0a('0x81')][_0xfb0a('0x2f')](_0x481740[_0xfb0a('0x80')](),{'type':db[_0xfb0a('0x81')][_0xfb0a('0x8a')][_0xfb0a('0x82')]});}})[_0xfb0a('0x21')](function(_0x1a299c){if(!_0x1a299c[_0xfb0a('0x45')]){throw new db[(_0xfb0a('0x6a'))][(_0xfb0a('0x6b'))]('No\x20available\x20data',0xcc);}if(_0x30fa42['output']===_0xfb0a('0x8b')){return null;}var _0x1cd06e=_[_0xfb0a('0x3b')](_0x30fa42,{'name':_0x30fa42[_0xfb0a('0x8c')]||_0x30fa42[_0xfb0a('0x26')]||_0x5eaf87[_0xfb0a('0x26')],'basename':_0x8ab617,'savename':util[_0xfb0a('0x74')](_0xfb0a('0x8d'),_0x30fa42[_0xfb0a('0x26')]||_0x5eaf87[_0xfb0a('0x26')],require(_0xfb0a('0x8e'))[_0xfb0a('0x8f')](0x4),_0x30fa42['output']||_0xfb0a('0x90')),'reportId':_0x5eaf87['id'],'reportType':'custom'});return db[_0xfb0a('0x91')]['create'](_0x1cd06e,{'raw':!![]});})[_0xfb0a('0x21')](function(_0x26b2e4){if(_0x5eaf87[_0xfb0a('0x7c')]===_0xfb0a('0x92')){_0x2e1c99[_0xfb0a('0x37')](_0x5eaf87[_0xfb0a('0x7c')]+_0xfb0a('0x93'),_0x30fa42[_0xfb0a('0x94')],_0x30fa42[_0xfb0a('0x95')]);}else{_0x2e1c99[_0xfb0a('0x37')](_0x5eaf87[_0xfb0a('0x7c')]+_0xfb0a('0x96'),_0x30fa42[_0xfb0a('0x94')],_0x30fa42[_0xfb0a('0x95')]);}if(_0x26b2e4){logger['info']('Run\x20Query:',_0x2e1c99['toString']());require('child_process')['fork'](path[_0xfb0a('0x54')](__dirname,_0xfb0a('0x97'),_0x26b2e4[_0xfb0a('0x98')]),[_0x26b2e4['id'],_0x2e1c99[_0xfb0a('0x80')](),path[_0xfb0a('0x54')](__dirname,_0xfb0a('0x99'),_0x26b2e4['savename']),_0x8ab617]);return _0x26b2e4;}else{var _0x287cb0=squel[_0xfb0a('0x86')]();_0x287cb0[_0xfb0a('0x6e')]('('+_0x2e1c99[_0xfb0a('0x80')]()+')',_0xfb0a('0x9a'));_0x287cb0[_0xfb0a('0x71')](_0xfb0a('0x9b'),'count');_0x2e1c99[_0xfb0a('0x1a')](_0x30fa42[_0xfb0a('0x1a')]||_0x4dc134);_0x2e1c99[_0xfb0a('0x19')](_0x30fa42[_0xfb0a('0x19')]||0x0);return db[_0xfb0a('0x81')][_0xfb0a('0x2f')](_0x287cb0[_0xfb0a('0x80')](),{'type':db[_0xfb0a('0x81')]['QueryTypes'][_0xfb0a('0x82')]})['then'](function(_0xa7472d){if(!_0xa7472d[_0xfb0a('0x45')]){_0x20fff6=0x0;}else{_0x20fff6=_0xa7472d[0x0][_0xfb0a('0x18')]||0x0;}return db[_0xfb0a('0x81')][_0xfb0a('0x2f')](_0x2e1c99[_0xfb0a('0x80')](),{'type':db[_0xfb0a('0x81')]['QueryTypes'][_0xfb0a('0x82')]});})['then'](function(_0x187aaa){return{'rows':_0x187aaa||[],'count':_0x20fff6};});}});}exports[_0xfb0a('0x9c')]=function(_0x537eac,_0x46e08d){return runReport(_0x537eac[_0xfb0a('0x43')],_0x537eac[_0xfb0a('0x2f')],_0x537eac['options'])[_0xfb0a('0x21')](respondWithResult(_0x46e08d,null))['catch'](handleError(_0x46e08d,null));};exports[_0xfb0a('0x9d')]=runReport;exports[_0xfb0a('0x2f')]=function(_0x34d431,_0xa643fa){var _0x4f25ff=0xa;var _0x5a40a0=[_0xfb0a('0x54'),_0xfb0a('0x55'),_0xfb0a('0x56'),_0xfb0a('0x57')];var _0x379716={'SUM':_0xfb0a('0x58'),'COUNT':_0xfb0a('0x59'),'COUNT DISTINCT':_0xfb0a('0x83'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xfb0a('0x5b'),'GROUP_CONCAT':_0xfb0a('0x5c'),'GROUP_CONCAT ASC':_0xfb0a('0x5d'),'GROUP_CONCAT DESC':_0xfb0a('0x5e')};var _0x4b8713={'SEC_TO_TIME':_0xfb0a('0x5f'),'DATE':_0xfb0a('0x60'),'HOUR':'HOUR(%s)','ROUND':_0xfb0a('0x9e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5dc3f6=function(_0x2e6d24){return!_[_0xfb0a('0x62')](['IS\x20NULL',_0xfb0a('0x9f'),_0xfb0a('0x63'),_0xfb0a('0x64')],_0x2e6d24);};var _0x20edb3=function(_0x4cf9ee){if(!_0x4cf9ee||!_0x4cf9ee[_0xfb0a('0x65')][_0xfb0a('0x45')]){return'';}for(var _0x420e24='(',_0x4c897d=0x0;_0x4c897d<_0x4cf9ee['rules'][_0xfb0a('0x45')];_0x4c897d+=0x1){_0x4c897d>0x0&&(_0x420e24+='\x20'+_0x4cf9ee['operator']+'\x20');_0x420e24+=_0x4cf9ee[_0xfb0a('0x65')][_0x4c897d]['group']?_0x20edb3(_0x4cf9ee[_0xfb0a('0x65')][_0x4c897d][_0xfb0a('0x67')]):_0x4cf9ee[_0xfb0a('0x65')][_0x4c897d]['field']+'\x20'+_0x4cf9ee[_0xfb0a('0x65')][_0x4c897d][_0xfb0a('0x68')]+(_0x5dc3f6(_0x4cf9ee[_0xfb0a('0x65')][_0x4c897d][_0xfb0a('0x68')])?'\x20'+_0x4cf9ee[_0xfb0a('0x65')][_0x4c897d][_0xfb0a('0xa0')]:'');}return _0x420e24+')';};var _0x1ec497={'where':{'id':_0x34d431[_0xfb0a('0x43')]['id']}},_0x192634,_0x130a6b,_0x503eae,_0x1316f5,_0x2ebac6;_0x1ec497=_['merge']({},_0x1ec497,_0x34d431['options']);return db[_0xfb0a('0x29')][_0xfb0a('0x46')](_0x1ec497)[_0xfb0a('0x21')](function(_0x75555d){if(_0x75555d){_0x192634=_0x75555d;return _0x75555d[_0xfb0a('0x69')]();}return null;})[_0xfb0a('0x21')](function(_0x274158){if(_0x274158){if(!_0x274158['length']){throw new db[(_0xfb0a('0x6a'))]['ValidationErrorItem'](_0xfb0a('0x85'),0x193);}_0x130a6b=_0x274158;return db['AnalyticMetric'][_0xfb0a('0x6c')]({'raw':!![]});}return null;})[_0xfb0a('0x21')](function(_0x2e9fd0){if(_0x2e9fd0){_0x503eae=_[_0xfb0a('0x6d')](_0x2e9fd0,'id');var _0x27ec6c;var _0x2ada2a=squel[_0xfb0a('0x86')]();_0x2ada2a['from'](_0x192634[_0xfb0a('0x7c')]);for(var _0x16c6ee=0x0;_0x16c6ee<_0x130a6b[_0xfb0a('0x45')];_0x16c6ee+=0x1){_0x27ec6c=_0x130a6b[_0x16c6ee][_0xfb0a('0x6f')]?_0x503eae[_0x130a6b[_0x16c6ee][_0xfb0a('0x6f')]][_0xfb0a('0x70')]:_0x130a6b[_0x16c6ee][_0xfb0a('0x71')];_0x27ec6c=_0x130a6b[_0x16c6ee][_0xfb0a('0x73')]?_[_0xfb0a('0x72')](_0x379716[_0x130a6b[_0x16c6ee]['function']],'%s',_0x27ec6c):_0x27ec6c;_0x27ec6c=_0x130a6b[_0x16c6ee][_0xfb0a('0x74')]?_[_0xfb0a('0x72')](_0x4b8713[_0x130a6b[_0x16c6ee][_0xfb0a('0x74')]],'%s',_0x27ec6c):_0x27ec6c;if(_0x130a6b[_0x16c6ee][_0xfb0a('0x75')]){_0x2ada2a[_0xfb0a('0x67')](_0x27ec6c);}_0x130a6b[_0x16c6ee]['orderBy']&&_0x2ada2a[_0xfb0a('0x35')](_0x27ec6c,_0x130a6b[_0x16c6ee][_0xfb0a('0x76')]==='DESC'?![]:!![]);_0x2ada2a[_0xfb0a('0x71')](_0x27ec6c,_0x130a6b[_0x16c6ee][_0xfb0a('0x87')]||_0x27ec6c);}if(_0x192634['joins']){_0x192634[_0xfb0a('0x77')]=JSON[_0xfb0a('0x78')](_0x192634[_0xfb0a('0x77')]);for(var _0x1061de=0x0;_0x1061de<_0x192634[_0xfb0a('0x77')][_0xfb0a('0x45')];_0x1061de+=0x1){if(_0x192634['joins'][_0x1061de]['type']&&_[_0xfb0a('0x62')](_0x5a40a0,_0x192634[_0xfb0a('0x77')][_0x1061de][_0xfb0a('0x3c')])&&_0x192634[_0xfb0a('0x77')][_0x1061de][_0xfb0a('0x79')]&&_0x192634[_0xfb0a('0x77')][_0x1061de][_0xfb0a('0x7a')]&&_0x192634[_0xfb0a('0x77')][_0x1061de][_0xfb0a('0x7d')]){_0x2ada2a[_0x192634[_0xfb0a('0x77')][_0x1061de]['type']](_0x192634['joins'][_0x1061de]['foreignTable'],null,util['format'](_0xfb0a('0x7b'),_0x192634[_0xfb0a('0x7c')],_0x192634[_0xfb0a('0x77')][_0x1061de]['parentKey'],_0x192634[_0xfb0a('0x77')][_0x1061de][_0xfb0a('0x7a')],_0x192634['joins'][_0x1061de][_0xfb0a('0x7d')]));}}}if(_0x192634[_0xfb0a('0x7e')]){_0x192634[_0xfb0a('0x7e')]=JSON[_0xfb0a('0x78')](_0x192634['conditions']);_0x2ada2a[_0xfb0a('0x37')](_0x20edb3(_0x192634[_0xfb0a('0x7e')][_0xfb0a('0x67')]));}_0x2ebac6=_0x2ada2a[_0xfb0a('0x88')]();_0x2ada2a[_0xfb0a('0x1a')](_0x4f25ff);_0x2ada2a[_0xfb0a('0x19')](0x0);logger[_0xfb0a('0x89')]('Limited\x20Query:',_0x2ada2a['toString']());return db['sequelize'][_0xfb0a('0x2f')](_0x2ada2a[_0xfb0a('0x80')](),{'type':db['sequelize'][_0xfb0a('0x8a')]['SELECT']});}})[_0xfb0a('0x21')](function(){return{'sql':_0x2ebac6[_0xfb0a('0x80')]()};})[_0xfb0a('0x21')](respondWithResult(_0xa643fa,null))[_0xfb0a('0x41')](handleError(_0xa643fa,null));}; \ No newline at end of file +var _0x9451=['api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','update','then','get','CustomReports','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','options','AnalyticCustomReport','includeAll','rows','show','params','include','merge','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','ROUND(%s)','IS\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','findAll','groupBy','No\x20available\x20data','web','%s-%s.%s','randomstring','generate','output','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','runReport','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3ff4a3,_0xa5bfa6){var _0x38676f=function(_0x3ab2b1){while(--_0x3ab2b1){_0x3ff4a3['push'](_0x3ff4a3['shift']());}};_0x38676f(++_0xa5bfa6);}(_0x9451,0x1da));var _0x1945=function(_0x5da68b,_0x16711d){_0x5da68b=_0x5da68b-0x0;var _0x5e7393=_0x9451[_0x5da68b];return _0x5e7393;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1945('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1945('0x1'));var moment=require(_0x1945('0x2'));var BPromise=require(_0x1945('0x3'));var Mustache=require('mustache');var util=require(_0x1945('0x4'));var path=require(_0x1945('0x5'));var sox=require(_0x1945('0x6'));var csv=require('to-csv');var ejs=require(_0x1945('0x7'));var fs=require('fs');var _=require(_0x1945('0x8'));var squel=require(_0x1945('0x9'));var crypto=require(_0x1945('0xa'));var jsforce=require(_0x1945('0xb'));var deskjs=require(_0x1945('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1945('0xd'));var authService=require(_0x1945('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1945('0xf'));var hardwareService=require(_0x1945('0x10'));var logger=require(_0x1945('0x11'))(_0x1945('0x12'));var utils=require('../../config/utils');var config=require(_0x1945('0x13'));var db=require(_0x1945('0x14'))['db'];function respondWithStatusCode(_0x23ff31,_0x14ad63){_0x14ad63=_0x14ad63||0xcc;return function(_0x13ed91){if(_0x13ed91){return _0x23ff31[_0x1945('0x15')](_0x14ad63);}return _0x23ff31[_0x1945('0x16')](_0x14ad63)[_0x1945('0x17')]();};}function respondWithResult(_0x188703,_0x195476){_0x195476=_0x195476||0xc8;return function(_0x3765da){if(_0x3765da){return _0x188703['status'](_0x195476)['json'](_0x3765da);}};}function respondWithFilteredResult(_0x4c4ba8,_0x60008){return function(_0x55eaae){if(_0x55eaae){var _0xdb92e2=_0x55eaae[_0x1945('0x18')],_0xc628b1=_0x60008[_0x1945('0x19')],_0x520b41=_0x60008[_0x1945('0x19')]+_0x60008[_0x1945('0x1a')],_0x5d944c;if(_0x520b41>=_0xdb92e2){_0x520b41=_0xdb92e2;_0x5d944c=0xc8;}else{_0x5d944c=0xce;}_0x4c4ba8[_0x1945('0x16')](_0x5d944c);return _0x4c4ba8[_0x1945('0x1b')](_0x1945('0x1c'),_0xc628b1+'-'+_0x520b41+'/'+_0xdb92e2)[_0x1945('0x1d')](_0x55eaae);}return null;};}function patchUpdates(_0x3f576e){return function(_0x485401){try{jsonpatch['apply'](_0x485401,_0x3f576e,!![]);}catch(_0x184ffe){return BPromise[_0x1945('0x1e')](_0x184ffe);}return _0x485401['save']();};}function saveUpdates(_0x17f297,_0x314c82){return function(_0x1b8d6c){if(_0x1b8d6c){return _0x1b8d6c[_0x1945('0x1f')](_0x17f297)[_0x1945('0x20')](function(_0x1b645b){return _0x1b645b;});}return null;};}function removeEntity(_0x549c56,_0x3d8ba1){return function(_0x340609){if(_0x340609){return _0x340609['destroy']()[_0x1945('0x20')](function(){var _0x2a9b69=_0x340609[_0x1945('0x21')]({'plain':!![]});var _0x1d19ac=_0x1945('0x22');return db['UserProfileResource'][_0x1945('0x23')]({'where':{'type':_0x1d19ac,'resourceId':_0x2a9b69['id']}})[_0x1945('0x20')](function(){return _0x340609;});})['then'](function(){_0x549c56[_0x1945('0x16')](0xcc)[_0x1945('0x17')]();});}};}function handleEntityNotFound(_0xbaedfe,_0x99d83e){return function(_0x3dbb19){if(!_0x3dbb19){_0xbaedfe[_0x1945('0x15')](0x194);}return _0x3dbb19;};}function handleError(_0x43a374,_0x186c5c){_0x186c5c=_0x186c5c||0x1f4;return function(_0x5bd6a0){logger[_0x1945('0x24')](_0x5bd6a0[_0x1945('0x25')]);if(_0x5bd6a0[_0x1945('0x26')]){delete _0x5bd6a0['name'];}_0x43a374[_0x1945('0x16')](_0x186c5c)[_0x1945('0x27')](_0x5bd6a0);};}exports[_0x1945('0x28')]=function(_0x103e34,_0x56b463){var _0xa7d9c0={},_0x2e8f4f={},_0x35f681={'count':0x0,'rows':[]};var _0x334ad5=_[_0x1945('0x29')](db['AnalyticCustomReport'][_0x1945('0x2a')],function(_0xbd2315){return{'name':_0xbd2315[_0x1945('0x2b')],'type':_0xbd2315[_0x1945('0x2c')][_0x1945('0x2d')]};});_0x2e8f4f['model']=_[_0x1945('0x29')](_0x334ad5,_0x1945('0x26'));_0x2e8f4f['query']=_[_0x1945('0x2e')](_0x103e34[_0x1945('0x2f')]);_0x2e8f4f[_0x1945('0x30')]=_[_0x1945('0x31')](_0x2e8f4f[_0x1945('0x32')],_0x2e8f4f[_0x1945('0x2f')]);_0xa7d9c0['attributes']=_['intersection'](_0x2e8f4f[_0x1945('0x32')],qs[_0x1945('0x33')](_0x103e34[_0x1945('0x2f')][_0x1945('0x33')]));_0xa7d9c0[_0x1945('0x34')]=_0xa7d9c0[_0x1945('0x34')][_0x1945('0x35')]?_0xa7d9c0['attributes']:_0x2e8f4f[_0x1945('0x32')];if(!_0x103e34[_0x1945('0x2f')]['hasOwnProperty']('nolimit')){_0xa7d9c0[_0x1945('0x1a')]=qs['limit'](_0x103e34[_0x1945('0x2f')][_0x1945('0x1a')]);_0xa7d9c0[_0x1945('0x19')]=qs['offset'](_0x103e34[_0x1945('0x2f')]['offset']);}_0xa7d9c0[_0x1945('0x36')]=qs['sort'](_0x103e34['query'][_0x1945('0x37')]);_0xa7d9c0[_0x1945('0x38')]=qs[_0x1945('0x30')](_[_0x1945('0x39')](_0x103e34[_0x1945('0x2f')],_0x2e8f4f[_0x1945('0x30')]));if(_0x103e34['query'][_0x1945('0x3a')]){_0xa7d9c0['where']=_['merge'](_0xa7d9c0[_0x1945('0x38')],{'$or':_[_0x1945('0x29')](_0x334ad5,function(_0x5e0c07){if(_0x5e0c07[_0x1945('0x2c')]!==_0x1945('0x3b')){var _0x598d44={};_0x598d44[_0x5e0c07[_0x1945('0x26')]]={'$like':'%'+_0x103e34[_0x1945('0x2f')][_0x1945('0x3a')]+'%'};return _0x598d44;}})});}_0xa7d9c0=_['merge']({},_0xa7d9c0,_0x103e34[_0x1945('0x3c')]);var _0x13565a={'where':_0xa7d9c0[_0x1945('0x38')]};return db[_0x1945('0x3d')][_0x1945('0x18')](_0x13565a)[_0x1945('0x20')](function(_0x6d3cd2){_0x35f681[_0x1945('0x18')]=_0x6d3cd2;if(_0x103e34['query'][_0x1945('0x3e')]){_0xa7d9c0['include']=[{'all':!![]}];}return db[_0x1945('0x3d')]['findAll'](_0xa7d9c0);})[_0x1945('0x20')](function(_0x1cae31){_0x35f681[_0x1945('0x3f')]=_0x1cae31;return _0x35f681;})[_0x1945('0x20')](respondWithFilteredResult(_0x56b463,_0xa7d9c0))['catch'](handleError(_0x56b463,null));};exports[_0x1945('0x40')]=function(_0x3a69eb,_0x111006){var _0x157a43={'raw':![],'where':{'id':_0x3a69eb[_0x1945('0x41')]['id']}},_0x1d621b={};_0x1d621b[_0x1945('0x32')]=_[_0x1945('0x2e')](db['AnalyticCustomReport'][_0x1945('0x2a')]);_0x1d621b[_0x1945('0x2f')]=_[_0x1945('0x2e')](_0x3a69eb['query']);_0x1d621b['filters']=_[_0x1945('0x31')](_0x1d621b[_0x1945('0x32')],_0x1d621b['query']);_0x157a43[_0x1945('0x34')]=_['intersection'](_0x1d621b[_0x1945('0x32')],qs['fields'](_0x3a69eb[_0x1945('0x2f')][_0x1945('0x33')]));_0x157a43[_0x1945('0x34')]=_0x157a43[_0x1945('0x34')][_0x1945('0x35')]?_0x157a43['attributes']:_0x1d621b['model'];if(_0x3a69eb[_0x1945('0x2f')][_0x1945('0x3e')]){_0x157a43[_0x1945('0x42')]=[{'all':!![]}];}_0x157a43=_[_0x1945('0x43')]({},_0x157a43,_0x3a69eb[_0x1945('0x3c')]);return db[_0x1945('0x3d')][_0x1945('0x44')](_0x157a43)['then'](handleEntityNotFound(_0x111006,null))[_0x1945('0x20')](respondWithResult(_0x111006,null))['catch'](handleError(_0x111006,null));};exports[_0x1945('0x45')]=function(_0x2a76cc,_0xea474c){return db[_0x1945('0x3d')]['create'](_0x2a76cc[_0x1945('0x46')],{})[_0x1945('0x20')](function(_0x467fd2){var _0x26f8d7=_0x2a76cc[_0x1945('0x47')][_0x1945('0x21')]({'plain':!![]});if(!_0x26f8d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26f8d7[_0x1945('0x48')]===_0x1945('0x47')){var _0x4bed6e=_0x467fd2['get']({'plain':!![]});var _0x3ee556=_0x1945('0x49');return db[_0x1945('0x4a')]['find']({'where':{'name':_0x3ee556,'userProfileId':_0x26f8d7[_0x1945('0x4b')]},'raw':!![]})['then'](function(_0x1cf2da){if(_0x1cf2da&&_0x1cf2da[_0x1945('0x4c')]===0x0){return db[_0x1945('0x4d')][_0x1945('0x45')]({'name':_0x4bed6e[_0x1945('0x26')],'resourceId':_0x4bed6e['id'],'type':'CustomReports','sectionId':_0x1cf2da['id']},{})['then'](function(){return _0x467fd2;});}else{return _0x467fd2;}})[_0x1945('0x4e')](function(_0x423b8e){logger[_0x1945('0x24')](_0x1945('0x4f'),_0x423b8e);throw _0x423b8e;});}return _0x467fd2;})[_0x1945('0x20')](respondWithResult(_0xea474c,0xc9))[_0x1945('0x4e')](handleError(_0xea474c,null));};exports[_0x1945('0x1f')]=function(_0x477f84,_0x35d62c){if(_0x477f84[_0x1945('0x46')]['id']){delete _0x477f84[_0x1945('0x46')]['id'];}return db[_0x1945('0x3d')][_0x1945('0x44')]({'where':{'id':_0x477f84[_0x1945('0x41')]['id']}})[_0x1945('0x20')](handleEntityNotFound(_0x35d62c,null))[_0x1945('0x20')](saveUpdates(_0x477f84[_0x1945('0x46')],null))[_0x1945('0x20')](respondWithResult(_0x35d62c,null))['catch'](handleError(_0x35d62c,null));};exports[_0x1945('0x23')]=function(_0x1ae118,_0x4e716d){return db[_0x1945('0x3d')][_0x1945('0x44')]({'where':{'id':_0x1ae118[_0x1945('0x41')]['id']}})[_0x1945('0x20')](handleEntityNotFound(_0x4e716d,null))[_0x1945('0x20')](removeEntity(_0x4e716d,null))[_0x1945('0x4e')](handleError(_0x4e716d,null));};exports[_0x1945('0x50')]=function(_0x3fd2bd,_0x885354){var _0x501bd7=0xa;var _0xa03e2b=[_0x1945('0x51'),'left_join',_0x1945('0x52'),_0x1945('0x53')];var _0x13bfe8={'SUM':_0x1945('0x54'),'COUNT':_0x1945('0x55'),'COUNT DISTINCT':_0x1945('0x56'),'MAX':_0x1945('0x57'),'MIN':_0x1945('0x58'),'AVG':_0x1945('0x59'),'GROUP_CONCAT':_0x1945('0x5a'),'GROUP_CONCAT ASC':_0x1945('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x543e08={'SEC_TO_TIME':_0x1945('0x5c'),'DATE':_0x1945('0x5d'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1945('0x5e')};var _0x438bba=function(_0x1d84f7){return!_['includes'](['IS\x20NULL',_0x1945('0x5f'),_0x1945('0x60'),_0x1945('0x61')],_0x1d84f7);};var _0x9e2ecc=function(_0x6c2533){if(!_0x6c2533||!_0x6c2533[_0x1945('0x62')][_0x1945('0x35')]){return'';}for(var _0x286c21='(',_0x36b6b5=0x0;_0x36b6b5<_0x6c2533[_0x1945('0x62')][_0x1945('0x35')];_0x36b6b5+=0x1){_0x36b6b5>0x0&&(_0x286c21+='\x20'+_0x6c2533[_0x1945('0x63')]+'\x20');_0x286c21+=_0x6c2533['rules'][_0x36b6b5][_0x1945('0x64')]?_0x9e2ecc(_0x6c2533[_0x1945('0x62')][_0x36b6b5][_0x1945('0x64')]):_0x6c2533[_0x1945('0x62')][_0x36b6b5][_0x1945('0x65')]+'\x20'+_0x6c2533[_0x1945('0x62')][_0x36b6b5][_0x1945('0x66')]+(_0x438bba(_0x6c2533['rules'][_0x36b6b5]['condition'])?'\x20'+_0x6c2533[_0x1945('0x62')][_0x36b6b5][_0x1945('0x67')]:'');}return _0x286c21+')';};var _0x21cfb9={'where':{'id':_0x3fd2bd[_0x1945('0x41')]['id']}},_0x17d42f,_0x12963e,_0x335d75,_0x445210,_0x1ffafc;_0x21cfb9=_[_0x1945('0x43')]({},_0x21cfb9,_0x3fd2bd[_0x1945('0x3c')]);return db['AnalyticCustomReport'][_0x1945('0x44')](_0x21cfb9)[_0x1945('0x20')](function(_0xc01db3){if(_0xc01db3){_0x17d42f=_0xc01db3;return _0xc01db3[_0x1945('0x68')]();}return null;})[_0x1945('0x20')](function(_0x3fcc6e){if(_0x3fcc6e){if(!_0x3fcc6e[_0x1945('0x35')]){throw new db[(_0x1945('0x69'))][(_0x1945('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x12963e=_0x3fcc6e;return db[_0x1945('0x6b')]['findAll']({'raw':!![]});}return null;})[_0x1945('0x20')](function(_0x9d541b){if(_0x9d541b){_0x335d75=_[_0x1945('0x6c')](_0x9d541b,'id');var _0x519182;var _0x4850c5=squel[_0x1945('0x6d')]();_0x4850c5[_0x1945('0x6e')](_0x17d42f[_0x1945('0x6f')]);for(var _0x3fb8dd=0x0;_0x3fb8dd<_0x12963e[_0x1945('0x35')];_0x3fb8dd+=0x1){_0x519182=_0x12963e[_0x3fb8dd][_0x1945('0x70')]?_0x335d75[_0x12963e[_0x3fb8dd][_0x1945('0x70')]][_0x1945('0x71')]:_0x12963e[_0x3fb8dd][_0x1945('0x65')];_0x519182=_0x12963e[_0x3fb8dd][_0x1945('0x72')]?_[_0x1945('0x73')](_0x13bfe8[_0x12963e[_0x3fb8dd][_0x1945('0x72')]],'%s',_0x519182):_0x519182;_0x519182=_0x12963e[_0x3fb8dd][_0x1945('0x74')]?_[_0x1945('0x73')](_0x543e08[_0x12963e[_0x3fb8dd][_0x1945('0x74')]],'%s',_0x519182):_0x519182;if(_0x12963e[_0x3fb8dd]['groupBy']){_0x4850c5[_0x1945('0x64')](_0x519182);}_0x12963e[_0x3fb8dd]['orderBy']&&_0x4850c5[_0x1945('0x36')](_0x519182,_0x12963e[_0x3fb8dd][_0x1945('0x75')]===_0x1945('0x76')?![]:!![]);_0x4850c5['field'](_0x519182,_0x12963e[_0x3fb8dd][_0x1945('0x77')]||_0x519182);}if(_0x17d42f[_0x1945('0x78')]){_0x17d42f[_0x1945('0x78')]=JSON[_0x1945('0x79')](_0x17d42f['joins']);for(var _0x5f301b=0x0;_0x5f301b<_0x17d42f[_0x1945('0x78')][_0x1945('0x35')];_0x5f301b+=0x1){if(_0x17d42f[_0x1945('0x78')][_0x5f301b][_0x1945('0x2c')]&&_[_0x1945('0x7a')](_0xa03e2b,_0x17d42f[_0x1945('0x78')][_0x5f301b][_0x1945('0x2c')])&&_0x17d42f[_0x1945('0x78')][_0x5f301b][_0x1945('0x7b')]&&_0x17d42f[_0x1945('0x78')][_0x5f301b][_0x1945('0x7c')]&&_0x17d42f[_0x1945('0x78')][_0x5f301b][_0x1945('0x7d')]){_0x4850c5[_0x17d42f['joins'][_0x5f301b][_0x1945('0x2c')]](_0x17d42f['joins'][_0x5f301b][_0x1945('0x7c')],null,util[_0x1945('0x74')](_0x1945('0x7e'),_0x17d42f['table'],_0x17d42f[_0x1945('0x78')][_0x5f301b][_0x1945('0x7b')],_0x17d42f[_0x1945('0x78')][_0x5f301b][_0x1945('0x7c')],_0x17d42f[_0x1945('0x78')][_0x5f301b][_0x1945('0x7d')]));}}}if(_0x17d42f['conditions']){_0x17d42f[_0x1945('0x7f')]=JSON['parse'](_0x17d42f[_0x1945('0x7f')]);_0x4850c5[_0x1945('0x38')](_0x9e2ecc(_0x17d42f[_0x1945('0x7f')][_0x1945('0x64')]));}_0x1ffafc=_0x4850c5[_0x1945('0x80')]();_0x4850c5[_0x1945('0x1a')](_0x501bd7);_0x4850c5[_0x1945('0x19')](0x0);logger[_0x1945('0x81')](_0x1945('0x82'),_0x4850c5[_0x1945('0x83')]());return db[_0x1945('0x84')]['query'](_0x4850c5[_0x1945('0x83')](),{'type':db[_0x1945('0x84')][_0x1945('0x85')][_0x1945('0x86')]});}})['then'](respondWithResult(_0x885354,null))[_0x1945('0x4e')](handleError(_0x885354,null));};function runReport(_0x570e8c,_0x26a429,_0x5c93a1){var _0xdb5429=_0x26a429[_0x1945('0x26')];var _0x2464de=0xa;var _0x17d5a5=[_0x1945('0x51'),_0x1945('0x87'),_0x1945('0x52'),_0x1945('0x53')];var _0xd8df45={'SUM':_0x1945('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1945('0x57'),'MIN':_0x1945('0x58'),'AVG':_0x1945('0x59'),'GROUP_CONCAT':_0x1945('0x5a'),'GROUP_CONCAT ASC':_0x1945('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x425440={'SEC_TO_TIME':_0x1945('0x5c'),'DATE':_0x1945('0x5d'),'HOUR':_0x1945('0x88'),'ROUND':_0x1945('0x89'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1a61da=function(_0x54ce8f){return!_[_0x1945('0x7a')]([_0x1945('0x8a'),_0x1945('0x5f'),_0x1945('0x60'),_0x1945('0x61')],_0x54ce8f);};var _0x493410=function(_0x3a4284){if(!_0x3a4284||!_0x3a4284[_0x1945('0x62')][_0x1945('0x35')]){return'';}for(var _0x342b16='(',_0x3bb493=0x0;_0x3bb493<_0x3a4284[_0x1945('0x62')][_0x1945('0x35')];_0x3bb493+=0x1){_0x3bb493>0x0&&(_0x342b16+='\x20'+_0x3a4284[_0x1945('0x63')]+'\x20');_0x342b16+=_0x3a4284[_0x1945('0x62')][_0x3bb493]['group']?_0x493410(_0x3a4284[_0x1945('0x62')][_0x3bb493][_0x1945('0x64')]):_0x3a4284[_0x1945('0x62')][_0x3bb493][_0x1945('0x65')]+'\x20'+_0x3a4284[_0x1945('0x62')][_0x3bb493][_0x1945('0x66')]+(_0x1a61da(_0x3a4284[_0x1945('0x62')][_0x3bb493]['condition'])?'\x20'+_0x3a4284[_0x1945('0x62')][_0x3bb493][_0x1945('0x67')]:'');}return _0x342b16+')';};var _0x41918a={'where':{'id':_0x570e8c['id']}},_0x54be70,_0x4f0382,_0x1d08a3,_0x4dc46c,_0x586bba;_0x41918a=_[_0x1945('0x43')]({},_0x41918a,_0x5c93a1);return db[_0x1945('0x3d')][_0x1945('0x44')](_0x41918a)[_0x1945('0x20')](function(_0x41a84a){if(_0x41a84a){_0x54be70=_0x41a84a;return _0x41a84a['getFields']();}return null;})[_0x1945('0x20')](function(_0x16d94a){if(_0x16d94a){if(!_0x16d94a[_0x1945('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0x1945('0x8b'),0x193);}_0x4f0382=_0x16d94a;return db[_0x1945('0x6b')][_0x1945('0x8c')]({'raw':!![]});}return null;})[_0x1945('0x20')](function(_0x3ff55f){if(_0x3ff55f){_0x1d08a3=_[_0x1945('0x6c')](_0x3ff55f,'id');var _0x2b6a28;var _0x1f7656=squel[_0x1945('0x6d')]();_0x1f7656['from'](_0x54be70[_0x1945('0x6f')]);for(var _0x44060b=0x0;_0x44060b<_0x4f0382[_0x1945('0x35')];_0x44060b+=0x1){_0x2b6a28=_0x4f0382[_0x44060b][_0x1945('0x70')]?_0x1d08a3[_0x4f0382[_0x44060b][_0x1945('0x70')]]['metric']:_0x4f0382[_0x44060b]['field'];_0x2b6a28=_0x4f0382[_0x44060b]['function']?_[_0x1945('0x73')](_0xd8df45[_0x4f0382[_0x44060b][_0x1945('0x72')]],'%s',_0x2b6a28):_0x2b6a28;_0x2b6a28=_0x4f0382[_0x44060b][_0x1945('0x74')]?_[_0x1945('0x73')](_0x425440[_0x4f0382[_0x44060b]['format']],'%s',_0x2b6a28):_0x2b6a28;if(_0x4f0382[_0x44060b][_0x1945('0x8d')]){_0x1f7656[_0x1945('0x64')](_0x2b6a28);}_0x4f0382[_0x44060b][_0x1945('0x75')]&&_0x1f7656[_0x1945('0x36')](_0x2b6a28,_0x4f0382[_0x44060b][_0x1945('0x75')]===_0x1945('0x76')?![]:!![]);_0x1f7656[_0x1945('0x65')](_0x2b6a28,_0x4f0382[_0x44060b][_0x1945('0x77')]||_0x2b6a28);}if(_0x54be70['joins']){_0x54be70[_0x1945('0x78')]=JSON['parse'](_0x54be70[_0x1945('0x78')]);for(var _0x1e35db=0x0;_0x1e35db<_0x54be70[_0x1945('0x78')][_0x1945('0x35')];_0x1e35db+=0x1){if(_0x54be70[_0x1945('0x78')][_0x1e35db][_0x1945('0x2c')]&&_['includes'](_0x17d5a5,_0x54be70['joins'][_0x1e35db][_0x1945('0x2c')])&&_0x54be70[_0x1945('0x78')][_0x1e35db]['parentKey']&&_0x54be70[_0x1945('0x78')][_0x1e35db]['foreignTable']&&_0x54be70[_0x1945('0x78')][_0x1e35db]['foreignKey']){_0x1f7656[_0x54be70[_0x1945('0x78')][_0x1e35db][_0x1945('0x2c')]](_0x54be70[_0x1945('0x78')][_0x1e35db][_0x1945('0x7c')],null,util[_0x1945('0x74')](_0x1945('0x7e'),_0x54be70[_0x1945('0x6f')],_0x54be70[_0x1945('0x78')][_0x1e35db]['parentKey'],_0x54be70[_0x1945('0x78')][_0x1e35db][_0x1945('0x7c')],_0x54be70['joins'][_0x1e35db][_0x1945('0x7d')]));}}}if(_0x54be70['conditions']){_0x54be70[_0x1945('0x7f')]=JSON[_0x1945('0x79')](_0x54be70[_0x1945('0x7f')]);_0x1f7656[_0x1945('0x38')](_0x493410(_0x54be70[_0x1945('0x7f')]['group']));}_0x586bba=_0x1f7656[_0x1945('0x80')]();_0x1f7656['limit'](_0x2464de);_0x1f7656[_0x1945('0x19')](0x0);logger[_0x1945('0x81')](_0x1945('0x82'),_0x1f7656[_0x1945('0x83')]());return db['sequelize'][_0x1945('0x2f')](_0x1f7656[_0x1945('0x83')](),{'type':db[_0x1945('0x84')]['QueryTypes'][_0x1945('0x86')]});}})['then'](function(_0x33e774){if(!_0x33e774['length']){throw new db['Sequelize'][(_0x1945('0x6a'))](_0x1945('0x8e'),0xcc);}if(_0x26a429['output']===_0x1945('0x8f')){return null;}var _0x24b94e=_[_0x1945('0x43')](_0x26a429,{'name':_0x26a429['fullPath']||_0x26a429[_0x1945('0x26')]||_0x54be70['name'],'basename':_0xdb5429,'savename':util[_0x1945('0x74')](_0x1945('0x90'),_0x26a429[_0x1945('0x26')]||_0x54be70[_0x1945('0x26')],require(_0x1945('0x91'))[_0x1945('0x92')](0x4),_0x26a429[_0x1945('0x93')]||_0x1945('0x94')),'reportId':_0x54be70['id'],'reportType':_0x1945('0x95')});return db['AnalyticExtractedReport']['create'](_0x24b94e,{'raw':!![]});})[_0x1945('0x20')](function(_0x27d3db){if(_0x54be70['table']===_0x1945('0x96')){_0x586bba[_0x1945('0x38')](_0x54be70[_0x1945('0x6f')]+_0x1945('0x97'),_0x26a429[_0x1945('0x98')],_0x26a429['endDate']);}else{_0x586bba[_0x1945('0x38')](_0x54be70[_0x1945('0x6f')]+_0x1945('0x99'),_0x26a429[_0x1945('0x98')],_0x26a429[_0x1945('0x9a')]);}if(_0x27d3db){logger[_0x1945('0x9b')](_0x1945('0x9c'),_0x586bba[_0x1945('0x83')]());require(_0x1945('0x9d'))[_0x1945('0x9e')](path[_0x1945('0x51')](__dirname,_0x1945('0x9f'),_0x27d3db[_0x1945('0x93')]),[_0x27d3db['id'],_0x586bba['toString'](),path[_0x1945('0x51')](__dirname,_0x1945('0xa0'),_0x27d3db[_0x1945('0xa1')]),_0xdb5429]);return _0x27d3db;}else{var _0x55f0db=squel[_0x1945('0x6d')]();_0x55f0db[_0x1945('0x6e')]('('+_0x586bba[_0x1945('0x83')]()+')',_0x1945('0xa2'));_0x55f0db[_0x1945('0x65')]('COUNT(*)',_0x1945('0x18'));_0x586bba[_0x1945('0x1a')](_0x26a429[_0x1945('0x1a')]||_0x2464de);_0x586bba[_0x1945('0x19')](_0x26a429[_0x1945('0x19')]||0x0);return db['sequelize'][_0x1945('0x2f')](_0x55f0db[_0x1945('0x83')](),{'type':db[_0x1945('0x84')]['QueryTypes'][_0x1945('0x86')]})[_0x1945('0x20')](function(_0x18f763){if(!_0x18f763[_0x1945('0x35')]){_0x4dc46c=0x0;}else{_0x4dc46c=_0x18f763[0x0]['count']||0x0;}return db[_0x1945('0x84')][_0x1945('0x2f')](_0x586bba[_0x1945('0x83')](),{'type':db[_0x1945('0x84')][_0x1945('0x85')]['SELECT']});})[_0x1945('0x20')](function(_0x228937){return{'rows':_0x228937||[],'count':_0x4dc46c};});}});}exports['run']=function(_0x2da157,_0x42a0bf){return runReport(_0x2da157[_0x1945('0x41')],_0x2da157[_0x1945('0x2f')],_0x2da157[_0x1945('0x3c')])['then'](respondWithResult(_0x42a0bf,null))[_0x1945('0x4e')](handleError(_0x42a0bf,null));};exports[_0x1945('0xa3')]=runReport;exports['query']=function(_0x7d1d82,_0x53ea05){var _0x4817cb=0xa;var _0x5a8941=['join',_0x1945('0x87'),'right_join',_0x1945('0x53')];var _0x5c29bb={'SUM':'SUM(%s)','COUNT':_0x1945('0x55'),'COUNT DISTINCT':_0x1945('0x56'),'MAX':_0x1945('0x57'),'MIN':_0x1945('0x58'),'AVG':_0x1945('0x59'),'GROUP_CONCAT':_0x1945('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5aa8bc={'SEC_TO_TIME':_0x1945('0x5c'),'DATE':_0x1945('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0x1945('0x89'),'UNIX_TIMESTAMP':_0x1945('0x5e')};var _0x3c34a0=function(_0x489a02){return!_[_0x1945('0x7a')](['IS\x20NULL',_0x1945('0x5f'),_0x1945('0x60'),_0x1945('0x61')],_0x489a02);};var _0x35fdbb=function(_0x16a740){if(!_0x16a740||!_0x16a740['rules'][_0x1945('0x35')]){return'';}for(var _0x502eaa='(',_0x94023d=0x0;_0x94023d<_0x16a740[_0x1945('0x62')][_0x1945('0x35')];_0x94023d+=0x1){_0x94023d>0x0&&(_0x502eaa+='\x20'+_0x16a740[_0x1945('0x63')]+'\x20');_0x502eaa+=_0x16a740[_0x1945('0x62')][_0x94023d]['group']?_0x35fdbb(_0x16a740[_0x1945('0x62')][_0x94023d][_0x1945('0x64')]):_0x16a740['rules'][_0x94023d][_0x1945('0x65')]+'\x20'+_0x16a740[_0x1945('0x62')][_0x94023d][_0x1945('0x66')]+(_0x3c34a0(_0x16a740[_0x1945('0x62')][_0x94023d][_0x1945('0x66')])?'\x20'+_0x16a740[_0x1945('0x62')][_0x94023d][_0x1945('0x67')]:'');}return _0x502eaa+')';};var _0x4f6000={'where':{'id':_0x7d1d82[_0x1945('0x41')]['id']}},_0x211ad0,_0x475bcd,_0x5584e8,_0x5a292d,_0x4a79ba;_0x4f6000=_['merge']({},_0x4f6000,_0x7d1d82[_0x1945('0x3c')]);return db[_0x1945('0x3d')][_0x1945('0x44')](_0x4f6000)[_0x1945('0x20')](function(_0x16aaf7){if(_0x16aaf7){_0x211ad0=_0x16aaf7;return _0x16aaf7[_0x1945('0x68')]();}return null;})['then'](function(_0x1907d0){if(_0x1907d0){if(!_0x1907d0[_0x1945('0x35')]){throw new db[(_0x1945('0x69'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x475bcd=_0x1907d0;return db[_0x1945('0x6b')][_0x1945('0x8c')]({'raw':!![]});}return null;})[_0x1945('0x20')](function(_0x4e8558){if(_0x4e8558){_0x5584e8=_[_0x1945('0x6c')](_0x4e8558,'id');var _0x533c2c;var _0x3d18dc=squel[_0x1945('0x6d')]();_0x3d18dc['from'](_0x211ad0[_0x1945('0x6f')]);for(var _0x440f29=0x0;_0x440f29<_0x475bcd['length'];_0x440f29+=0x1){_0x533c2c=_0x475bcd[_0x440f29][_0x1945('0x70')]?_0x5584e8[_0x475bcd[_0x440f29][_0x1945('0x70')]]['metric']:_0x475bcd[_0x440f29]['field'];_0x533c2c=_0x475bcd[_0x440f29]['function']?_['replace'](_0x5c29bb[_0x475bcd[_0x440f29]['function']],'%s',_0x533c2c):_0x533c2c;_0x533c2c=_0x475bcd[_0x440f29][_0x1945('0x74')]?_[_0x1945('0x73')](_0x5aa8bc[_0x475bcd[_0x440f29]['format']],'%s',_0x533c2c):_0x533c2c;if(_0x475bcd[_0x440f29]['groupBy']){_0x3d18dc['group'](_0x533c2c);}_0x475bcd[_0x440f29][_0x1945('0x75')]&&_0x3d18dc[_0x1945('0x36')](_0x533c2c,_0x475bcd[_0x440f29][_0x1945('0x75')]===_0x1945('0x76')?![]:!![]);_0x3d18dc['field'](_0x533c2c,_0x475bcd[_0x440f29]['alias']||_0x533c2c);}if(_0x211ad0[_0x1945('0x78')]){_0x211ad0[_0x1945('0x78')]=JSON['parse'](_0x211ad0['joins']);for(var _0x41f4b6=0x0;_0x41f4b6<_0x211ad0[_0x1945('0x78')]['length'];_0x41f4b6+=0x1){if(_0x211ad0[_0x1945('0x78')][_0x41f4b6][_0x1945('0x2c')]&&_[_0x1945('0x7a')](_0x5a8941,_0x211ad0[_0x1945('0x78')][_0x41f4b6]['type'])&&_0x211ad0[_0x1945('0x78')][_0x41f4b6][_0x1945('0x7b')]&&_0x211ad0[_0x1945('0x78')][_0x41f4b6][_0x1945('0x7c')]&&_0x211ad0[_0x1945('0x78')][_0x41f4b6][_0x1945('0x7d')]){_0x3d18dc[_0x211ad0[_0x1945('0x78')][_0x41f4b6][_0x1945('0x2c')]](_0x211ad0[_0x1945('0x78')][_0x41f4b6][_0x1945('0x7c')],null,util['format'](_0x1945('0x7e'),_0x211ad0[_0x1945('0x6f')],_0x211ad0[_0x1945('0x78')][_0x41f4b6][_0x1945('0x7b')],_0x211ad0[_0x1945('0x78')][_0x41f4b6][_0x1945('0x7c')],_0x211ad0[_0x1945('0x78')][_0x41f4b6]['foreignKey']));}}}if(_0x211ad0[_0x1945('0x7f')]){_0x211ad0[_0x1945('0x7f')]=JSON[_0x1945('0x79')](_0x211ad0[_0x1945('0x7f')]);_0x3d18dc[_0x1945('0x38')](_0x35fdbb(_0x211ad0[_0x1945('0x7f')]['group']));}_0x4a79ba=_0x3d18dc[_0x1945('0x80')]();_0x3d18dc[_0x1945('0x1a')](_0x4817cb);_0x3d18dc[_0x1945('0x19')](0x0);logger['debug'](_0x1945('0x82'),_0x3d18dc[_0x1945('0x83')]());return db[_0x1945('0x84')][_0x1945('0x2f')](_0x3d18dc[_0x1945('0x83')](),{'type':db[_0x1945('0x84')][_0x1945('0x85')][_0x1945('0x86')]});}})[_0x1945('0x20')](function(){return{'sql':_0x4a79ba[_0x1945('0x83')]()};})[_0x1945('0x20')](respondWithResult(_0x53ea05,null))[_0x1945('0x4e')](handleError(_0x53ea05,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 2278026..e4ea033 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 _0xccc8=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x5b3d5d,_0x1ac0e0){var _0x14a50d=function(_0x5255e2){while(--_0x5255e2){_0x5b3d5d['push'](_0x5b3d5d['shift']());}};_0x14a50d(++_0x1ac0e0);}(_0xccc8,0x66));var _0x8ccc=function(_0x2242a1,_0x38f44d){_0x2242a1=_0x2242a1-0x0;var _0x2c298b=_0xccc8[_0x2242a1];return _0x2c298b;};'use strict';var _=require(_0x8ccc('0x0'));var util=require('util');var logger=require(_0x8ccc('0x1'))(_0x8ccc('0x2'));var moment=require(_0x8ccc('0x3'));var BPromise=require(_0x8ccc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ccc('0x5'));var rimraf=require('rimraf');var config=require(_0x8ccc('0x6'));var attributes=require(_0x8ccc('0x7'));module[_0x8ccc('0x8')]=function(_0x305340,_0x4f8de5){return _0x305340[_0x8ccc('0x9')](_0x8ccc('0xa'),attributes,{'tableName':_0x8ccc('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa32=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x17b3a0,_0x24e743){var _0x3bb234=function(_0x589579){while(--_0x589579){_0x17b3a0['push'](_0x17b3a0['shift']());}};_0x3bb234(++_0x24e743);}(_0xfa32,0x1dd));var _0x2fa3=function(_0x474de1,_0x5a5427){_0x474de1=_0x474de1-0x0;var _0xa4d9a5=_0xfa32[_0x474de1];return _0xa4d9a5;};'use strict';var _=require(_0x2fa3('0x0'));var util=require(_0x2fa3('0x1'));var logger=require(_0x2fa3('0x2'))(_0x2fa3('0x3'));var moment=require(_0x2fa3('0x4'));var BPromise=require(_0x2fa3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fa3('0x6'));var rimraf=require(_0x2fa3('0x7'));var config=require(_0x2fa3('0x8'));var attributes=require(_0x2fa3('0x9'));module[_0x2fa3('0xa')]=function(_0x3f95c0,_0x267448){return _0x3f95c0[_0x2fa3('0xb')](_0x2fa3('0xc'),attributes,{'tableName':_0x2fa3('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 309e379..4ab5d40 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 _0xc669=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x411e71,_0xf9652){var _0x226ae3=function(_0x1339f6){while(--_0x1339f6){_0x411e71['push'](_0x411e71['shift']());}};_0x226ae3(++_0xf9652);}(_0xc669,0xcf));var _0x9c66=function(_0x19c9ea,_0x3db176){_0x19c9ea=_0x19c9ea-0x0;var _0x6952d6=_0xc669[_0x19c9ea];return _0x6952d6;};'use strict';var _=require('lodash');var util=require(_0x9c66('0x0'));var moment=require(_0x9c66('0x1'));var BPromise=require(_0x9c66('0x2'));var rs=require(_0x9c66('0x3'));var fs=require('fs');var Redis=require(_0x9c66('0x4'));var db=require(_0x9c66('0x5'))['db'];var utils=require(_0x9c66('0x6'));var logger=require(_0x9c66('0x7'))(_0x9c66('0x8'));var config=require(_0x9c66('0x9'));var jayson=require(_0x9c66('0xa'));var client=jayson[_0x9c66('0xb')][_0x9c66('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14db5c,_0x13cbcb,_0x421af7){return new BPromise(function(_0x3ba867,_0x4fefd0){return client['request'](_0x14db5c,_0x421af7)[_0x9c66('0xd')](function(_0x1501d0){logger[_0x9c66('0xe')](_0x9c66('0xf'),_0x13cbcb,_0x9c66('0x10'));logger[_0x9c66('0x11')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x13cbcb,_0x9c66('0x10'),JSON[_0x9c66('0x12')](_0x1501d0));if(_0x1501d0[_0x9c66('0x13')]){if(_0x1501d0[_0x9c66('0x13')]['code']===0x1f4){logger[_0x9c66('0x13')](_0x9c66('0xf'),_0x13cbcb,_0x1501d0[_0x9c66('0x13')][_0x9c66('0x14')]);return _0x4fefd0(_0x1501d0[_0x9c66('0x13')][_0x9c66('0x14')]);}logger['error'](_0x9c66('0xf'),_0x13cbcb,_0x1501d0[_0x9c66('0x13')]['message']);return _0x3ba867(_0x1501d0['error'][_0x9c66('0x14')]);}else{logger[_0x9c66('0xe')](_0x9c66('0xf'),_0x13cbcb,'request\x20sent');_0x3ba867(_0x1501d0[_0x9c66('0x15')][_0x9c66('0x14')]);}})[_0x9c66('0x16')](function(_0x2ff967){logger[_0x9c66('0x13')](_0x9c66('0xf'),_0x13cbcb,_0x2ff967);_0x4fefd0(_0x2ff967);});});} \ No newline at end of file +var _0x28b0=['info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x24f343,_0xa3042){var _0x38230a=function(_0x10c563){while(--_0x10c563){_0x24f343['push'](_0x24f343['shift']());}};_0x38230a(++_0xa3042);}(_0x28b0,0x6d));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x028b('0x0'));var moment=require('moment');var BPromise=require(_0x028b('0x1'));var rs=require(_0x028b('0x2'));var fs=require('fs');var Redis=require(_0x028b('0x3'));var db=require(_0x028b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x028b('0x5'))(_0x028b('0x6'));var config=require(_0x028b('0x7'));var jayson=require(_0x028b('0x8'));var client=jayson[_0x028b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b4e39,_0x21f861,_0x2062bd){return new BPromise(function(_0x5192d8,_0x495d40){return client['request'](_0x3b4e39,_0x2062bd)[_0x028b('0xa')](function(_0x49cbf1){logger[_0x028b('0xb')](_0x028b('0xc'),_0x21f861,_0x028b('0xd'));logger[_0x028b('0xe')](_0x028b('0xf'),_0x21f861,_0x028b('0xd'),JSON['stringify'](_0x49cbf1));if(_0x49cbf1['error']){if(_0x49cbf1[_0x028b('0x10')]['code']===0x1f4){logger[_0x028b('0x10')](_0x028b('0xc'),_0x21f861,_0x49cbf1[_0x028b('0x10')][_0x028b('0x11')]);return _0x495d40(_0x49cbf1[_0x028b('0x10')][_0x028b('0x11')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x21f861,_0x49cbf1[_0x028b('0x10')][_0x028b('0x11')]);return _0x5192d8(_0x49cbf1[_0x028b('0x10')][_0x028b('0x11')]);}else{logger['info'](_0x028b('0xc'),_0x21f861,'request\x20sent');_0x5192d8(_0x49cbf1[_0x028b('0x12')][_0x028b('0x11')]);}})[_0x028b('0x13')](function(_0x4c1f47){logger[_0x028b('0x10')](_0x028b('0xc'),_0x21f861,_0x4c1f47);_0x495d40(_0x4c1f47);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index fa90314..5b1a142 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 _0x40d9=['path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','put','update','delete','exports','multer','util'];(function(_0x111334,_0xebe0fe){var _0x5e98b1=function(_0xbfba6e){while(--_0xbfba6e){_0x111334['push'](_0x111334['shift']());}};_0x5e98b1(++_0xebe0fe);}(_0x40d9,0xc4));var _0x940d=function(_0x40c699,_0x40f2b0){_0x40c699=_0x40c699-0x0;var _0xf5b5b1=_0x40d9[_0x40c699];return _0xf5b5b1;};'use strict';var multer=require(_0x940d('0x0'));var util=require(_0x940d('0x1'));var path=require(_0x940d('0x2'));var timeout=require('connect-timeout');var express=require(_0x940d('0x3'));var router=express[_0x940d('0x4')]();var auth=require(_0x940d('0x5'));var interaction=require(_0x940d('0x6'));var config=require('../../config/environment');var controller=require(_0x940d('0x7'));router[_0x940d('0x8')]('/',auth[_0x940d('0x9')](),controller['index']);router[_0x940d('0x8')](_0x940d('0xa'),auth['isAuthenticated'](),controller[_0x940d('0xb')]);router[_0x940d('0x8')](_0x940d('0xc'),auth['isAuthenticated'](),controller[_0x940d('0xd')]);router[_0x940d('0x8')](_0x940d('0xe'),auth[_0x940d('0x9')](),controller['run']);router[_0x940d('0x8')](_0x940d('0xf'),auth['isAuthenticated'](),controller[_0x940d('0x10')]);router[_0x940d('0x11')]('/',auth[_0x940d('0x9')](),controller['create']);router[_0x940d('0x12')]('/:id',auth[_0x940d('0x9')](),controller[_0x940d('0x13')]);router[_0x940d('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x940d('0x15')]=router; \ No newline at end of file +var _0xd2a1=['/:id','isAuthenticated','show','/:id/preview','/:id/run','/:id/query','post','put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index'];(function(_0x3e8ebe,_0x248687){var _0xe0eb02=function(_0x9d1023){while(--_0x9d1023){_0x3e8ebe['push'](_0x3e8ebe['shift']());}};_0xe0eb02(++_0x248687);}(_0xd2a1,0x131));var _0x1d2a=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0xd2a1[_0x1ca890];return _0x3f8e01;};'use strict';var multer=require(_0x1d2a('0x0'));var util=require('util');var path=require(_0x1d2a('0x1'));var timeout=require(_0x1d2a('0x2'));var express=require(_0x1d2a('0x3'));var router=express['Router']();var auth=require(_0x1d2a('0x4'));var interaction=require(_0x1d2a('0x5'));var config=require(_0x1d2a('0x6'));var controller=require(_0x1d2a('0x7'));router[_0x1d2a('0x8')]('/',auth['isAuthenticated'](),controller[_0x1d2a('0x9')]);router['get'](_0x1d2a('0xa'),auth[_0x1d2a('0xb')](),controller[_0x1d2a('0xc')]);router['get'](_0x1d2a('0xd'),auth[_0x1d2a('0xb')](),controller['preview']);router[_0x1d2a('0x8')](_0x1d2a('0xe'),auth[_0x1d2a('0xb')](),controller['run']);router[_0x1d2a('0x8')](_0x1d2a('0xf'),auth[_0x1d2a('0xb')](),controller['query']);router[_0x1d2a('0x10')]('/',auth[_0x1d2a('0xb')](),controller['create']);router[_0x1d2a('0x11')](_0x1d2a('0xa'),auth['isAuthenticated'](),controller[_0x1d2a('0x12')]);router[_0x1d2a('0x13')](_0x1d2a('0xa'),auth[_0x1d2a('0xb')](),controller['destroy']);module[_0x1d2a('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index edc72d7..0524de2 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 _0x7b92=['exports','STRING','TEXT'];(function(_0x50c406,_0x432edb){var _0x549855=function(_0x56a5e7){while(--_0x56a5e7){_0x50c406['push'](_0x50c406['shift']());}};_0x549855(++_0x432edb);}(_0x7b92,0xff));var _0x27b9=function(_0x3815c2,_0x1f54e3){_0x3815c2=_0x3815c2-0x0;var _0x271f88=_0x7b92[_0x3815c2];return _0x271f88;};'use strict';var Sequelize=require('sequelize');module[_0x27b9('0x0')]={'name':{'type':Sequelize[_0x27b9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x27b9('0x1')]},'parent':{'type':Sequelize[_0x27b9('0x1')]},'table':{'type':Sequelize[_0x27b9('0x1')]},'conditions':{'type':Sequelize[_0x27b9('0x2')]},'joins':{'type':Sequelize[_0x27b9('0x2')]}}; \ No newline at end of file +var _0x1f30=['STRING','TEXT','sequelize'];(function(_0x5c0a22,_0x3e0eb3){var _0x292d8e=function(_0x28c9e6){while(--_0x28c9e6){_0x5c0a22['push'](_0x5c0a22['shift']());}};_0x292d8e(++_0x3e0eb3);}(_0x1f30,0x191));var _0x01f3=function(_0x3c67d0,_0x432a92){_0x3c67d0=_0x3c67d0-0x0;var _0x12719c=_0x1f30[_0x3c67d0];return _0x12719c;};'use strict';var Sequelize=require(_0x01f3('0x0'));module['exports']={'name':{'type':Sequelize[_0x01f3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x01f3('0x1')]},'parent':{'type':Sequelize[_0x01f3('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x01f3('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index e969118..bd44d35 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 _0x2ea0=['UserProfileResource','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','IS\x20NOT\x20NULL','No\x20available\x20data','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','countTable','run','runReport','IS\x20NULL','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get'];(function(_0x44b816,_0x2af972){var _0xdfaa68=function(_0x2a2cde){while(--_0x2a2cde){_0x44b816['push'](_0x44b816['shift']());}};_0xdfaa68(++_0x2af972);}(_0x2ea0,0x80));var _0x02ea=function(_0x2d5934,_0x1acc4f){_0x2d5934=_0x2d5934-0x0;var _0x5807c8=_0x2ea0[_0x2d5934];return _0x5807c8;};'use strict';var pdf=require(_0x02ea('0x0'));var emlformat=require(_0x02ea('0x1'));var rimraf=require(_0x02ea('0x2'));var zipdir=require(_0x02ea('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x02ea('0x4'));var moment=require(_0x02ea('0x5'));var BPromise=require(_0x02ea('0x6'));var Mustache=require(_0x02ea('0x7'));var util=require(_0x02ea('0x8'));var path=require(_0x02ea('0x9'));var sox=require(_0x02ea('0xa'));var csv=require(_0x02ea('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x02ea('0xc'));var squel=require(_0x02ea('0xd'));var crypto=require(_0x02ea('0xe'));var jsforce=require(_0x02ea('0xf'));var deskjs=require(_0x02ea('0x10'));var toCsv=require(_0x02ea('0xb'));var querystring=require(_0x02ea('0x11'));var Papa=require(_0x02ea('0x12'));var Redis=require('ioredis');var authService=require(_0x02ea('0x13'));var qs=require(_0x02ea('0x14'));var as=require(_0x02ea('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x02ea('0x16'))(_0x02ea('0x17'));var utils=require(_0x02ea('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26a2bc,_0x3cbfbb){_0x3cbfbb=_0x3cbfbb||0xcc;return function(_0x342d28){if(_0x342d28){return _0x26a2bc[_0x02ea('0x19')](_0x3cbfbb);}return _0x26a2bc[_0x02ea('0x1a')](_0x3cbfbb)[_0x02ea('0x1b')]();};}function respondWithResult(_0x212494,_0x3775b2){_0x3775b2=_0x3775b2||0xc8;return function(_0x1fff8c){if(_0x1fff8c){return _0x212494[_0x02ea('0x1a')](_0x3775b2)[_0x02ea('0x1c')](_0x1fff8c);}};}function respondWithFilteredResult(_0x2a51e0,_0x57ae86){return function(_0x3834b6){if(_0x3834b6){var _0x49b0bd=_0x3834b6[_0x02ea('0x1d')],_0x565dc2=_0x57ae86[_0x02ea('0x1e')],_0x599adc=_0x57ae86[_0x02ea('0x1e')]+_0x57ae86[_0x02ea('0x1f')],_0x54395d;if(_0x599adc>=_0x49b0bd){_0x599adc=_0x49b0bd;_0x54395d=0xc8;}else{_0x54395d=0xce;}_0x2a51e0[_0x02ea('0x1a')](_0x54395d);return _0x2a51e0[_0x02ea('0x20')](_0x02ea('0x21'),_0x565dc2+'-'+_0x599adc+'/'+_0x49b0bd)[_0x02ea('0x1c')](_0x3834b6);}return null;};}function patchUpdates(_0x157c57){return function(_0x45ac51){try{jsonpatch[_0x02ea('0x22')](_0x45ac51,_0x157c57,!![]);}catch(_0x48b9af){return BPromise[_0x02ea('0x23')](_0x48b9af);}return _0x45ac51['save']();};}function saveUpdates(_0x5a4fec,_0x4ad781){return function(_0x1dfccb){if(_0x1dfccb){return _0x1dfccb[_0x02ea('0x24')](_0x5a4fec)[_0x02ea('0x25')](function(_0x4146fc){return _0x4146fc;});}return null;};}function removeEntity(_0x5b994b,_0x516cd6){return function(_0x2a958a){if(_0x2a958a){return _0x2a958a['destroy']()['then'](function(){var _0x18cca7=_0x2a958a[_0x02ea('0x26')]({'plain':!![]});var _0x5ae1fc='DefaultReports';return db[_0x02ea('0x27')]['destroy']({'where':{'type':_0x5ae1fc,'resourceId':_0x18cca7['id']}})[_0x02ea('0x25')](function(){return _0x2a958a;});})[_0x02ea('0x25')](function(){_0x5b994b[_0x02ea('0x1a')](0xcc)[_0x02ea('0x1b')]();});}};}function handleEntityNotFound(_0x40842a,_0x3ec3f5){return function(_0x2727dd){if(!_0x2727dd){_0x40842a[_0x02ea('0x19')](0x194);}return _0x2727dd;};}function handleError(_0xefaa65,_0x375303){_0x375303=_0x375303||0x1f4;return function(_0xa38be3){logger[_0x02ea('0x28')](_0xa38be3[_0x02ea('0x29')]);if(_0xa38be3[_0x02ea('0x2a')]){delete _0xa38be3[_0x02ea('0x2a')];}_0xefaa65[_0x02ea('0x1a')](_0x375303)[_0x02ea('0x2b')](_0xa38be3);};}exports[_0x02ea('0x2c')]=function(_0x23fc1c,_0x42fe6f){var _0x2360be={},_0x2f9245={},_0x1e51ba={'count':0x0,'rows':[]};var _0x11d8c9=_[_0x02ea('0x2d')](db[_0x02ea('0x2e')][_0x02ea('0x2f')],function(_0x30bd33){return{'name':_0x30bd33[_0x02ea('0x30')],'type':_0x30bd33[_0x02ea('0x31')]['key']};});_0x2f9245['model']=_['map'](_0x11d8c9,'name');_0x2f9245[_0x02ea('0x32')]=_[_0x02ea('0x33')](_0x23fc1c[_0x02ea('0x32')]);_0x2f9245[_0x02ea('0x34')]=_[_0x02ea('0x35')](_0x2f9245[_0x02ea('0x36')],_0x2f9245[_0x02ea('0x32')]);_0x2360be['attributes']=_[_0x02ea('0x35')](_0x2f9245[_0x02ea('0x36')],qs[_0x02ea('0x37')](_0x23fc1c[_0x02ea('0x32')][_0x02ea('0x37')]));_0x2360be[_0x02ea('0x38')]=_0x2360be[_0x02ea('0x38')][_0x02ea('0x39')]?_0x2360be[_0x02ea('0x38')]:_0x2f9245[_0x02ea('0x36')];if(!_0x23fc1c[_0x02ea('0x32')]['hasOwnProperty'](_0x02ea('0x3a'))){_0x2360be[_0x02ea('0x1f')]=qs[_0x02ea('0x1f')](_0x23fc1c[_0x02ea('0x32')][_0x02ea('0x1f')]);_0x2360be[_0x02ea('0x1e')]=qs[_0x02ea('0x1e')](_0x23fc1c[_0x02ea('0x32')][_0x02ea('0x1e')]);}_0x2360be[_0x02ea('0x3b')]=qs['sort'](_0x23fc1c['query'][_0x02ea('0x3c')]);_0x2360be[_0x02ea('0x3d')]=qs[_0x02ea('0x34')](_['pick'](_0x23fc1c[_0x02ea('0x32')],_0x2f9245[_0x02ea('0x34')]));if(_0x23fc1c['query'][_0x02ea('0x3e')]){_0x2360be[_0x02ea('0x3d')]=_['merge'](_0x2360be[_0x02ea('0x3d')],{'$or':_[_0x02ea('0x2d')](_0x11d8c9,function(_0xa3257e){if(_0xa3257e['type']!==_0x02ea('0x3f')){var _0x268d0f={};_0x268d0f[_0xa3257e['name']]={'$like':'%'+_0x23fc1c[_0x02ea('0x32')][_0x02ea('0x3e')]+'%'};return _0x268d0f;}})});}_0x2360be=_[_0x02ea('0x40')]({},_0x2360be,_0x23fc1c[_0x02ea('0x41')]);var _0x158251={'where':_0x2360be[_0x02ea('0x3d')]};return db[_0x02ea('0x2e')][_0x02ea('0x1d')](_0x158251)[_0x02ea('0x25')](function(_0x3f6ec4){_0x1e51ba['count']=_0x3f6ec4;if(_0x23fc1c[_0x02ea('0x32')][_0x02ea('0x42')]){_0x2360be[_0x02ea('0x43')]=[{'all':!![]}];}return db[_0x02ea('0x2e')][_0x02ea('0x44')](_0x2360be);})[_0x02ea('0x25')](function(_0x48bf6b){_0x1e51ba[_0x02ea('0x45')]=_0x48bf6b;return _0x1e51ba;})['then'](respondWithFilteredResult(_0x42fe6f,_0x2360be))[_0x02ea('0x46')](handleError(_0x42fe6f,null));};exports[_0x02ea('0x47')]=function(_0x5f2bc8,_0x36d246){var _0x487f54={'raw':!![],'where':{'id':_0x5f2bc8[_0x02ea('0x48')]['id']}},_0x1096fd={};_0x1096fd[_0x02ea('0x36')]=_[_0x02ea('0x33')](db[_0x02ea('0x2e')][_0x02ea('0x2f')]);_0x1096fd[_0x02ea('0x32')]=_[_0x02ea('0x33')](_0x5f2bc8[_0x02ea('0x32')]);_0x1096fd['filters']=_[_0x02ea('0x35')](_0x1096fd['model'],_0x1096fd['query']);_0x487f54['attributes']=_[_0x02ea('0x35')](_0x1096fd[_0x02ea('0x36')],qs[_0x02ea('0x37')](_0x5f2bc8[_0x02ea('0x32')][_0x02ea('0x37')]));_0x487f54[_0x02ea('0x38')]=_0x487f54[_0x02ea('0x38')]['length']?_0x487f54[_0x02ea('0x38')]:_0x1096fd[_0x02ea('0x36')];if(_0x5f2bc8['query'][_0x02ea('0x42')]){_0x487f54[_0x02ea('0x43')]=[{'all':!![]}];}_0x487f54=_[_0x02ea('0x40')]({},_0x487f54,_0x5f2bc8[_0x02ea('0x41')]);return db[_0x02ea('0x2e')][_0x02ea('0x49')](_0x487f54)[_0x02ea('0x25')](handleEntityNotFound(_0x36d246,null))[_0x02ea('0x25')](respondWithResult(_0x36d246,null))[_0x02ea('0x46')](handleError(_0x36d246,null));};exports[_0x02ea('0x4a')]=function(_0x13c5f4,_0x15bd29){return db['AnalyticDefaultReport'][_0x02ea('0x4a')](_0x13c5f4[_0x02ea('0x4b')],{})[_0x02ea('0x25')](function(_0x5710f4){var _0x38d743=_0x13c5f4[_0x02ea('0x4c')][_0x02ea('0x26')]({'plain':!![]});if(!_0x38d743)throw new Error(_0x02ea('0x4d'));if(_0x38d743[_0x02ea('0x4e')]==='user'){var _0x1a45a8=_0x5710f4['get']({'plain':!![]});var _0x16022b='Reports';return db[_0x02ea('0x4f')]['find']({'where':{'name':_0x16022b,'userProfileId':_0x38d743[_0x02ea('0x50')]},'raw':!![]})['then'](function(_0x15da79){if(_0x15da79&&_0x15da79['autoAssociation']===0x0){return db[_0x02ea('0x27')][_0x02ea('0x4a')]({'name':_0x1a45a8[_0x02ea('0x2a')],'resourceId':_0x1a45a8['id'],'type':_0x02ea('0x51'),'sectionId':_0x15da79['id']},{})[_0x02ea('0x25')](function(){return _0x5710f4;});}else{return _0x5710f4;}})[_0x02ea('0x46')](function(_0x23928d){logger[_0x02ea('0x28')](_0x02ea('0x52'),_0x23928d);throw _0x23928d;});}return _0x5710f4;})[_0x02ea('0x25')](respondWithResult(_0x15bd29,0xc9))[_0x02ea('0x46')](handleError(_0x15bd29,null));};exports[_0x02ea('0x24')]=function(_0x3df0e4,_0x58f6c2){if(_0x3df0e4[_0x02ea('0x4b')]['id']){delete _0x3df0e4[_0x02ea('0x4b')]['id'];}return db[_0x02ea('0x2e')][_0x02ea('0x49')]({'where':{'id':_0x3df0e4[_0x02ea('0x48')]['id']}})['then'](handleEntityNotFound(_0x58f6c2,null))['then'](saveUpdates(_0x3df0e4[_0x02ea('0x4b')],null))['then'](respondWithResult(_0x58f6c2,null))[_0x02ea('0x46')](handleError(_0x58f6c2,null));};exports[_0x02ea('0x53')]=function(_0x560a4e,_0x3ac6b3){return db['AnalyticDefaultReport'][_0x02ea('0x49')]({'where':{'id':_0x560a4e['params']['id']}})[_0x02ea('0x25')](handleEntityNotFound(_0x3ac6b3,null))[_0x02ea('0x25')](removeEntity(_0x3ac6b3,null))['catch'](handleError(_0x3ac6b3,null));};exports[_0x02ea('0x54')]=function(_0x3b1139,_0x28ed80){var _0x4668e6=0xa;var _0x445e97=[_0x02ea('0x55'),'left_join',_0x02ea('0x56'),_0x02ea('0x57')];var _0xc82da={'SUM':_0x02ea('0x58'),'COUNT':_0x02ea('0x59'),'COUNT DISTINCT':_0x02ea('0x5a'),'MAX':_0x02ea('0x5b'),'MIN':_0x02ea('0x5c'),'AVG':_0x02ea('0x5d'),'GROUP_CONCAT':_0x02ea('0x5e'),'GROUP_CONCAT ASC':_0x02ea('0x5f'),'GROUP_CONCAT DESC':_0x02ea('0x60')};var _0x892dbe={'SEC_TO_TIME':_0x02ea('0x61'),'DATE':_0x02ea('0x62'),'HOUR':_0x02ea('0x63'),'ROUND':_0x02ea('0x64'),'UNIX_TIMESTAMP':_0x02ea('0x65')};var _0x5b8298=function(_0x38399b){return!_[_0x02ea('0x66')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x02ea('0x67'),_0x02ea('0x68')],_0x38399b);};var _0x12d876=function(_0x3fb0ee){if(!_0x3fb0ee||!_0x3fb0ee[_0x02ea('0x69')]['length']){return'';}for(var _0x43fbca='(',_0x6bbc53=0x0;_0x6bbc53<_0x3fb0ee[_0x02ea('0x69')][_0x02ea('0x39')];_0x6bbc53+=0x1){_0x6bbc53>0x0&&(_0x43fbca+='\x20'+_0x3fb0ee[_0x02ea('0x6a')]+'\x20');_0x43fbca+=_0x3fb0ee[_0x02ea('0x69')][_0x6bbc53][_0x02ea('0x6b')]?_0x12d876(_0x3fb0ee['rules'][_0x6bbc53]['group']):_0x3fb0ee['rules'][_0x6bbc53][_0x02ea('0x6c')]+'\x20'+_0x3fb0ee['rules'][_0x6bbc53][_0x02ea('0x6d')]+(_0x5b8298(_0x3fb0ee[_0x02ea('0x69')][_0x6bbc53][_0x02ea('0x6d')])?'\x20'+_0x3fb0ee[_0x02ea('0x69')][_0x6bbc53][_0x02ea('0x6e')]:'');}return _0x43fbca+')';};var _0x1e3141={'where':{'id':_0x3b1139[_0x02ea('0x48')]['id']}},_0x147e98,_0x3f078e,_0x20da18,_0x297f2b,_0x362588;_0x1e3141=_['merge']({},_0x1e3141,_0x3b1139['options']);return db[_0x02ea('0x2e')][_0x02ea('0x49')](_0x1e3141)['then'](function(_0x227248){if(_0x227248){_0x147e98=_0x227248;return _0x227248[_0x02ea('0x6f')]();}return null;})[_0x02ea('0x25')](function(_0xa3a2c9){if(_0xa3a2c9){if(!_0xa3a2c9[_0x02ea('0x39')]){throw new db[(_0x02ea('0x70'))][(_0x02ea('0x71'))](_0x02ea('0x72'),0x193);}_0x3f078e=_0xa3a2c9;return db[_0x02ea('0x73')][_0x02ea('0x44')]({'raw':!![]});}return null;})[_0x02ea('0x25')](function(_0x3b1f4e){if(_0x3b1f4e){_0x20da18=_[_0x02ea('0x74')](_0x3b1f4e,'id');var _0x2ed871;var _0x260fd1=squel[_0x02ea('0x75')]();_0x260fd1[_0x02ea('0x76')](_0x147e98[_0x02ea('0x77')]);for(var _0x364caf=0x0;_0x364caf<_0x3f078e['length'];_0x364caf+=0x1){_0x2ed871=_0x3f078e[_0x364caf]['MetricId']?_0x20da18[_0x3f078e[_0x364caf][_0x02ea('0x78')]][_0x02ea('0x79')]:_0x3f078e[_0x364caf][_0x02ea('0x6c')];_0x2ed871=_0x3f078e[_0x364caf][_0x02ea('0x7a')]?_[_0x02ea('0x7b')](_0xc82da[_0x3f078e[_0x364caf][_0x02ea('0x7a')]],'%s',_0x2ed871):_0x2ed871;_0x2ed871=_0x3f078e[_0x364caf]['format']?_['replace'](_0x892dbe[_0x3f078e[_0x364caf]['format']],'%s',_0x2ed871):_0x2ed871;if(_0x3f078e[_0x364caf][_0x02ea('0x7c')]){_0x260fd1['group'](_0x2ed871);}_0x3f078e[_0x364caf]['orderBy']&&_0x260fd1[_0x02ea('0x3b')](_0x2ed871,_0x3f078e[_0x364caf][_0x02ea('0x7d')]===_0x02ea('0x7e')?![]:!![]);_0x260fd1['field'](_0x2ed871,_0x3f078e[_0x364caf][_0x02ea('0x7f')]||_0x2ed871);}if(_0x147e98[_0x02ea('0x80')]){_0x147e98[_0x02ea('0x80')]=JSON[_0x02ea('0x81')](_0x147e98['joins']);for(var _0x2e4253=0x0;_0x2e4253<_0x147e98[_0x02ea('0x80')][_0x02ea('0x39')];_0x2e4253+=0x1){if(_0x147e98[_0x02ea('0x80')][_0x2e4253][_0x02ea('0x31')]&&_['includes'](_0x445e97,_0x147e98[_0x02ea('0x80')][_0x2e4253]['type'])&&_0x147e98['joins'][_0x2e4253]['parentKey']&&_0x147e98[_0x02ea('0x80')][_0x2e4253][_0x02ea('0x82')]&&_0x147e98[_0x02ea('0x80')][_0x2e4253][_0x02ea('0x83')]){_0x260fd1[_0x147e98[_0x02ea('0x80')][_0x2e4253][_0x02ea('0x31')]](_0x147e98[_0x02ea('0x80')][_0x2e4253][_0x02ea('0x82')],null,util[_0x02ea('0x84')](_0x02ea('0x85'),_0x147e98[_0x02ea('0x77')],_0x147e98[_0x02ea('0x80')][_0x2e4253][_0x02ea('0x86')],_0x147e98[_0x02ea('0x80')][_0x2e4253][_0x02ea('0x82')],_0x147e98['joins'][_0x2e4253][_0x02ea('0x83')]));}}}if(_0x147e98[_0x02ea('0x87')]){_0x147e98[_0x02ea('0x87')]=JSON[_0x02ea('0x81')](_0x147e98[_0x02ea('0x87')]);_0x260fd1[_0x02ea('0x3d')](_0x12d876(_0x147e98[_0x02ea('0x87')][_0x02ea('0x6b')]));}_0x362588=_0x260fd1[_0x02ea('0x88')]();_0x260fd1[_0x02ea('0x1f')](_0x4668e6);_0x260fd1[_0x02ea('0x1e')](0x0);logger[_0x02ea('0x89')](_0x02ea('0x8a'),_0x260fd1[_0x02ea('0x8b')]());return db[_0x02ea('0x8c')][_0x02ea('0x32')](_0x260fd1[_0x02ea('0x8b')](),{'type':db[_0x02ea('0x8c')][_0x02ea('0x8d')][_0x02ea('0x8e')]});}})[_0x02ea('0x25')](respondWithResult(_0x28ed80,null))[_0x02ea('0x46')](handleError(_0x28ed80,null));};function runReport(_0x10f76d,_0x14162b,_0x5e962e){var _0x3a0542=_0x14162b['name'];var _0x117976=0xa;var _0x254da3=[_0x02ea('0x55'),_0x02ea('0x8f'),_0x02ea('0x56'),_0x02ea('0x57')];var _0x7f9c94={'SUM':_0x02ea('0x58'),'COUNT':_0x02ea('0x59'),'COUNT DISTINCT':_0x02ea('0x5a'),'MAX':_0x02ea('0x5b'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x02ea('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3ba734={'SEC_TO_TIME':_0x02ea('0x61'),'DATE':_0x02ea('0x62'),'HOUR':_0x02ea('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x02ea('0x65')};var _0x5a49bd=function(_0x333c96){return!_['includes'](['IS\x20NULL',_0x02ea('0x90'),_0x02ea('0x67'),'IS\x20NOT\x20EMPTY'],_0x333c96);};var _0x29882c=function(_0x2938ee){if(!_0x2938ee||!_0x2938ee[_0x02ea('0x69')][_0x02ea('0x39')]){return'';}for(var _0x36dd98='(',_0x231828=0x0;_0x231828<_0x2938ee['rules'][_0x02ea('0x39')];_0x231828+=0x1){_0x231828>0x0&&(_0x36dd98+='\x20'+_0x2938ee[_0x02ea('0x6a')]+'\x20');_0x36dd98+=_0x2938ee['rules'][_0x231828][_0x02ea('0x6b')]?_0x29882c(_0x2938ee[_0x02ea('0x69')][_0x231828]['group']):_0x2938ee[_0x02ea('0x69')][_0x231828][_0x02ea('0x6c')]+'\x20'+_0x2938ee[_0x02ea('0x69')][_0x231828][_0x02ea('0x6d')]+(_0x5a49bd(_0x2938ee[_0x02ea('0x69')][_0x231828][_0x02ea('0x6d')])?'\x20'+_0x2938ee[_0x02ea('0x69')][_0x231828][_0x02ea('0x6e')]:'');}return _0x36dd98+')';};var _0x531fa0={'where':{'id':_0x10f76d['id']}},_0x3e15bb,_0x196def,_0x3fa77d,_0x560c38,_0x1a5d9a;_0x531fa0=_[_0x02ea('0x40')]({},_0x531fa0,_0x5e962e);return db['AnalyticDefaultReport'][_0x02ea('0x49')](_0x531fa0)[_0x02ea('0x25')](function(_0x3ea294){if(_0x3ea294){_0x3e15bb=_0x3ea294;return _0x3ea294[_0x02ea('0x6f')]();}return null;})[_0x02ea('0x25')](function(_0x14c45f){if(_0x14c45f){if(!_0x14c45f[_0x02ea('0x39')]){throw new db[(_0x02ea('0x70'))][(_0x02ea('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x196def=_0x14c45f;return db[_0x02ea('0x73')][_0x02ea('0x44')]({'raw':!![]});}return null;})[_0x02ea('0x25')](function(_0x3b6a0a){if(_0x3b6a0a){_0x3fa77d=_[_0x02ea('0x74')](_0x3b6a0a,'id');var _0x4a56e1;var _0x1205ca=squel['select']();_0x1205ca['from'](_0x3e15bb[_0x02ea('0x77')]);for(var _0x1a38cc=0x0;_0x1a38cc<_0x196def[_0x02ea('0x39')];_0x1a38cc+=0x1){_0x4a56e1=_0x196def[_0x1a38cc]['MetricId']?_0x3fa77d[_0x196def[_0x1a38cc][_0x02ea('0x78')]][_0x02ea('0x79')]:_0x196def[_0x1a38cc][_0x02ea('0x6c')];_0x4a56e1=_0x196def[_0x1a38cc]['function']?_[_0x02ea('0x7b')](_0x7f9c94[_0x196def[_0x1a38cc][_0x02ea('0x7a')]],'%s',_0x4a56e1):_0x4a56e1;_0x4a56e1=_0x196def[_0x1a38cc][_0x02ea('0x84')]?_[_0x02ea('0x7b')](_0x3ba734[_0x196def[_0x1a38cc][_0x02ea('0x84')]],'%s',_0x4a56e1):_0x4a56e1;if(_0x196def[_0x1a38cc][_0x02ea('0x7c')]){_0x1205ca[_0x02ea('0x6b')](_0x4a56e1);}_0x196def[_0x1a38cc][_0x02ea('0x7d')]&&_0x1205ca[_0x02ea('0x3b')](_0x4a56e1,_0x196def[_0x1a38cc][_0x02ea('0x7d')]==='DESC'?![]:!![]);_0x1205ca[_0x02ea('0x6c')](_0x4a56e1,_0x196def[_0x1a38cc][_0x02ea('0x7f')]||_0x4a56e1);}if(_0x3e15bb[_0x02ea('0x80')]){_0x3e15bb[_0x02ea('0x80')]=JSON[_0x02ea('0x81')](_0x3e15bb[_0x02ea('0x80')]);for(var _0x4547d7=0x0;_0x4547d7<_0x3e15bb[_0x02ea('0x80')][_0x02ea('0x39')];_0x4547d7+=0x1){if(_0x3e15bb[_0x02ea('0x80')][_0x4547d7][_0x02ea('0x31')]&&_['includes'](_0x254da3,_0x3e15bb[_0x02ea('0x80')][_0x4547d7][_0x02ea('0x31')])&&_0x3e15bb['joins'][_0x4547d7][_0x02ea('0x86')]&&_0x3e15bb['joins'][_0x4547d7][_0x02ea('0x82')]&&_0x3e15bb['joins'][_0x4547d7]['foreignKey']){_0x1205ca[_0x3e15bb[_0x02ea('0x80')][_0x4547d7][_0x02ea('0x31')]](_0x3e15bb[_0x02ea('0x80')][_0x4547d7][_0x02ea('0x82')],null,util[_0x02ea('0x84')](_0x02ea('0x85'),_0x3e15bb['table'],_0x3e15bb[_0x02ea('0x80')][_0x4547d7][_0x02ea('0x86')],_0x3e15bb[_0x02ea('0x80')][_0x4547d7][_0x02ea('0x82')],_0x3e15bb[_0x02ea('0x80')][_0x4547d7][_0x02ea('0x83')]));}}}if(_0x3e15bb[_0x02ea('0x87')]){_0x3e15bb['conditions']=JSON['parse'](_0x3e15bb[_0x02ea('0x87')]);_0x1205ca[_0x02ea('0x3d')](_0x29882c(_0x3e15bb[_0x02ea('0x87')][_0x02ea('0x6b')]));}_0x1a5d9a=_0x1205ca[_0x02ea('0x88')]();_0x1205ca[_0x02ea('0x1f')](_0x117976);_0x1205ca[_0x02ea('0x1e')](0x0);logger[_0x02ea('0x89')]('Limited\x20Query:',_0x1205ca[_0x02ea('0x8b')]());return db[_0x02ea('0x8c')]['query'](_0x1205ca[_0x02ea('0x8b')](),{'type':db['sequelize'][_0x02ea('0x8d')][_0x02ea('0x8e')]});}})['then'](function(_0x529036){if(!_0x529036[_0x02ea('0x39')]){throw new db[(_0x02ea('0x70'))][(_0x02ea('0x71'))](_0x02ea('0x91'),0xcc);}if(_0x14162b[_0x02ea('0x92')]==='web'){return null;}var _0x14a80a=_[_0x02ea('0x40')](_0x14162b,{'name':_0x14162b[_0x02ea('0x93')]||_0x14162b[_0x02ea('0x2a')]||_0x3e15bb[_0x02ea('0x2a')],'basename':_0x3a0542,'savename':util['format'](_0x02ea('0x94'),_0x14162b['name']||_0x3e15bb[_0x02ea('0x2a')],require(_0x02ea('0x95'))[_0x02ea('0x96')](0x4),_0x14162b['output']||_0x02ea('0x97')),'reportId':_0x3e15bb['id'],'reportType':_0x02ea('0x98')});return db[_0x02ea('0x99')][_0x02ea('0x4a')](_0x14a80a,{'raw':!![]});})[_0x02ea('0x25')](function(_0x2d7e2d){if(_0x3e15bb['table']==='cdr'){_0x1a5d9a['where'](_0x3e15bb[_0x02ea('0x77')]+_0x02ea('0x9a'),_0x14162b[_0x02ea('0x9b')],_0x14162b[_0x02ea('0x9c')]);}else{_0x1a5d9a['where'](_0x3e15bb[_0x02ea('0x77')]+_0x02ea('0x9d'),_0x14162b['startDate'],_0x14162b[_0x02ea('0x9c')]);}if(_0x2d7e2d){logger[_0x02ea('0x9e')](_0x02ea('0x9f'),_0x1a5d9a[_0x02ea('0x8b')]());require('child_process')[_0x02ea('0xa0')](path[_0x02ea('0x55')](__dirname,_0x02ea('0xa1'),_0x2d7e2d[_0x02ea('0x92')]),[_0x2d7e2d['id'],_0x1a5d9a[_0x02ea('0x8b')](),path[_0x02ea('0x55')](__dirname,_0x02ea('0xa2'),_0x2d7e2d['savename']),_0x3a0542]);return _0x2d7e2d;}else{var _0x34b0a9=squel[_0x02ea('0x75')]();_0x34b0a9[_0x02ea('0x76')]('('+_0x1a5d9a[_0x02ea('0x8b')]()+')',_0x02ea('0xa3'));_0x34b0a9[_0x02ea('0x6c')]('COUNT(*)',_0x02ea('0x1d'));_0x1a5d9a[_0x02ea('0x1f')](_0x14162b[_0x02ea('0x1f')]||_0x117976);_0x1a5d9a['offset'](_0x14162b[_0x02ea('0x1e')]||0x0);return db[_0x02ea('0x8c')]['query'](_0x34b0a9['toString'](),{'type':db['sequelize'][_0x02ea('0x8d')][_0x02ea('0x8e')]})[_0x02ea('0x25')](function(_0x334aaa){if(!_0x334aaa[_0x02ea('0x39')]){_0x560c38=0x0;}else{_0x560c38=_0x334aaa[0x0][_0x02ea('0x1d')]||0x0;}return db[_0x02ea('0x8c')][_0x02ea('0x32')](_0x1a5d9a['toString'](),{'type':db[_0x02ea('0x8c')]['QueryTypes'][_0x02ea('0x8e')]});})[_0x02ea('0x25')](function(_0x9e1618){return{'rows':_0x9e1618||[],'count':_0x560c38};});}});}exports[_0x02ea('0xa4')]=function(_0x462ddd,_0x3726b5){return runReport(_0x462ddd['params'],_0x462ddd[_0x02ea('0x32')],_0x462ddd[_0x02ea('0x41')])[_0x02ea('0x25')](respondWithResult(_0x3726b5,null))['catch'](handleError(_0x3726b5,null));};exports[_0x02ea('0xa5')]=runReport;exports[_0x02ea('0x32')]=function(_0x2004fb,_0x21c6be){var _0x1ac751=0xa;var _0x4b2f44=[_0x02ea('0x55'),_0x02ea('0x8f'),_0x02ea('0x56'),'cross_join'];var _0x50c125={'SUM':_0x02ea('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x02ea('0x5a'),'MAX':_0x02ea('0x5b'),'MIN':_0x02ea('0x5c'),'AVG':_0x02ea('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x02ea('0x5f'),'GROUP_CONCAT DESC':_0x02ea('0x60')};var _0x266ae4={'SEC_TO_TIME':_0x02ea('0x61'),'DATE':_0x02ea('0x62'),'HOUR':_0x02ea('0x63'),'ROUND':_0x02ea('0x64'),'UNIX_TIMESTAMP':_0x02ea('0x65')};var _0x22741c=function(_0x1d345a){return!_['includes']([_0x02ea('0xa6'),'IS\x20NOT\x20NULL',_0x02ea('0x67'),'IS\x20NOT\x20EMPTY'],_0x1d345a);};var _0x3fa556=function(_0x1050e1){if(!_0x1050e1||!_0x1050e1[_0x02ea('0x69')][_0x02ea('0x39')]){return'';}for(var _0x2d2e75='(',_0xa85b3a=0x0;_0xa85b3a<_0x1050e1[_0x02ea('0x69')][_0x02ea('0x39')];_0xa85b3a+=0x1){_0xa85b3a>0x0&&(_0x2d2e75+='\x20'+_0x1050e1[_0x02ea('0x6a')]+'\x20');_0x2d2e75+=_0x1050e1[_0x02ea('0x69')][_0xa85b3a][_0x02ea('0x6b')]?_0x3fa556(_0x1050e1[_0x02ea('0x69')][_0xa85b3a][_0x02ea('0x6b')]):_0x1050e1['rules'][_0xa85b3a]['field']+'\x20'+_0x1050e1['rules'][_0xa85b3a][_0x02ea('0x6d')]+(_0x22741c(_0x1050e1[_0x02ea('0x69')][_0xa85b3a]['condition'])?'\x20'+_0x1050e1[_0x02ea('0x69')][_0xa85b3a][_0x02ea('0x6e')]:'');}return _0x2d2e75+')';};var _0x4f6380={'where':{'id':_0x2004fb[_0x02ea('0x48')]['id']}},_0x55f92c,_0x31ea3b,_0x3b5a76,_0x5ea625,_0x153b65;_0x4f6380=_[_0x02ea('0x40')]({},_0x4f6380,_0x2004fb['options']);return db[_0x02ea('0x2e')][_0x02ea('0x49')](_0x4f6380)[_0x02ea('0x25')](function(_0x3e72d4){if(_0x3e72d4){_0x55f92c=_0x3e72d4;return _0x3e72d4[_0x02ea('0x6f')]();}return null;})[_0x02ea('0x25')](function(_0x16d6a7){if(_0x16d6a7){if(!_0x16d6a7['length']){throw new db['Sequelize'][(_0x02ea('0x71'))](_0x02ea('0x72'),0x193);}_0x31ea3b=_0x16d6a7;return db[_0x02ea('0x73')]['findAll']({'raw':!![]});}return null;})[_0x02ea('0x25')](function(_0x308349){if(_0x308349){_0x3b5a76=_[_0x02ea('0x74')](_0x308349,'id');var _0x205900;var _0x5ba395=squel['select']();_0x5ba395[_0x02ea('0x76')](_0x55f92c[_0x02ea('0x77')]);for(var _0x396c5c=0x0;_0x396c5c<_0x31ea3b['length'];_0x396c5c+=0x1){_0x205900=_0x31ea3b[_0x396c5c][_0x02ea('0x78')]?_0x3b5a76[_0x31ea3b[_0x396c5c]['MetricId']][_0x02ea('0x79')]:_0x31ea3b[_0x396c5c][_0x02ea('0x6c')];_0x205900=_0x31ea3b[_0x396c5c][_0x02ea('0x7a')]?_[_0x02ea('0x7b')](_0x50c125[_0x31ea3b[_0x396c5c][_0x02ea('0x7a')]],'%s',_0x205900):_0x205900;_0x205900=_0x31ea3b[_0x396c5c][_0x02ea('0x84')]?_['replace'](_0x266ae4[_0x31ea3b[_0x396c5c][_0x02ea('0x84')]],'%s',_0x205900):_0x205900;if(_0x31ea3b[_0x396c5c]['groupBy']){_0x5ba395[_0x02ea('0x6b')](_0x205900);}_0x31ea3b[_0x396c5c][_0x02ea('0x7d')]&&_0x5ba395[_0x02ea('0x3b')](_0x205900,_0x31ea3b[_0x396c5c]['orderBy']===_0x02ea('0x7e')?![]:!![]);_0x5ba395['field'](_0x205900,_0x31ea3b[_0x396c5c][_0x02ea('0x7f')]||_0x205900);}if(_0x55f92c[_0x02ea('0x80')]){_0x55f92c[_0x02ea('0x80')]=JSON[_0x02ea('0x81')](_0x55f92c[_0x02ea('0x80')]);for(var _0x26ba00=0x0;_0x26ba00<_0x55f92c[_0x02ea('0x80')][_0x02ea('0x39')];_0x26ba00+=0x1){if(_0x55f92c['joins'][_0x26ba00][_0x02ea('0x31')]&&_[_0x02ea('0x66')](_0x4b2f44,_0x55f92c[_0x02ea('0x80')][_0x26ba00]['type'])&&_0x55f92c['joins'][_0x26ba00][_0x02ea('0x86')]&&_0x55f92c[_0x02ea('0x80')][_0x26ba00][_0x02ea('0x82')]&&_0x55f92c['joins'][_0x26ba00][_0x02ea('0x83')]){_0x5ba395[_0x55f92c['joins'][_0x26ba00][_0x02ea('0x31')]](_0x55f92c['joins'][_0x26ba00][_0x02ea('0x82')],null,util['format'](_0x02ea('0x85'),_0x55f92c[_0x02ea('0x77')],_0x55f92c['joins'][_0x26ba00][_0x02ea('0x86')],_0x55f92c[_0x02ea('0x80')][_0x26ba00]['foreignTable'],_0x55f92c[_0x02ea('0x80')][_0x26ba00][_0x02ea('0x83')]));}}}if(_0x55f92c[_0x02ea('0x87')]){_0x55f92c['conditions']=JSON[_0x02ea('0x81')](_0x55f92c[_0x02ea('0x87')]);_0x5ba395[_0x02ea('0x3d')](_0x3fa556(_0x55f92c['conditions']['group']));}_0x153b65=_0x5ba395['clone']();_0x5ba395[_0x02ea('0x1f')](_0x1ac751);_0x5ba395[_0x02ea('0x1e')](0x0);logger['debug'](_0x02ea('0x8a'),_0x5ba395[_0x02ea('0x8b')]());return db[_0x02ea('0x8c')][_0x02ea('0x32')](_0x5ba395[_0x02ea('0x8b')](),{'type':db[_0x02ea('0x8c')][_0x02ea('0x8d')][_0x02ea('0x8e')]});}})['then'](function(){return{'sql':_0x153b65[_0x02ea('0x8b')]()};})[_0x02ea('0x25')](respondWithResult(_0x21c6be,null))['catch'](handleError(_0x21c6be,null));}; \ No newline at end of file +var _0x6687=['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)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','replace','function','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','join','SUM(%s)','COUNT(DISTINCT\x20%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','merge','getFields','ValidationErrorItem','metric','order','%s.%s\x20=\x20%s.%s','clone','SELECT','No\x20available\x20data','output','web','%s-%s.%s','randomstring','generate','csv','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','MAX(%s)','ROUND(%s)','condition','html-pdf','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','DefaultReports','UserProfileResource','destroy','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','create','body','user','get','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','COUNT(%s)'];(function(_0x3ad133,_0x377068){var _0x33b86a=function(_0xda36c2){while(--_0xda36c2){_0x3ad133['push'](_0x3ad133['shift']());}};_0x33b86a(++_0x377068);}(_0x6687,0x18f));var _0x7668=function(_0xfd93ef,_0x1c787a){_0xfd93ef=_0xfd93ef-0x0;var _0x48bccb=_0x6687[_0xfd93ef];return _0x48bccb;};'use strict';var pdf=require(_0x7668('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7668('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7668('0x2'));var rp=require(_0x7668('0x3'));var moment=require(_0x7668('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7668('0x5'));var path=require(_0x7668('0x6'));var sox=require(_0x7668('0x7'));var csv=require(_0x7668('0x8'));var ejs=require(_0x7668('0x9'));var fs=require('fs');var _=require(_0x7668('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7668('0xb'));var deskjs=require(_0x7668('0xc'));var toCsv=require(_0x7668('0x8'));var querystring=require('querystring');var Papa=require(_0x7668('0xd'));var Redis=require(_0x7668('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7668('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7668('0x10'))(_0x7668('0x11'));var utils=require(_0x7668('0x12'));var config=require(_0x7668('0x13'));var db=require(_0x7668('0x14'))['db'];function respondWithStatusCode(_0x4cbec4,_0x502dc6){_0x502dc6=_0x502dc6||0xcc;return function(_0x12c333){if(_0x12c333){return _0x4cbec4[_0x7668('0x15')](_0x502dc6);}return _0x4cbec4['status'](_0x502dc6)[_0x7668('0x16')]();};}function respondWithResult(_0x3d9e56,_0x25fb3d){_0x25fb3d=_0x25fb3d||0xc8;return function(_0x13c7f7){if(_0x13c7f7){return _0x3d9e56[_0x7668('0x17')](_0x25fb3d)[_0x7668('0x18')](_0x13c7f7);}};}function respondWithFilteredResult(_0x49065f,_0x5da1f9){return function(_0x4e24a6){if(_0x4e24a6){var _0x1a2e90=_0x4e24a6[_0x7668('0x19')],_0x58d697=_0x5da1f9['offset'],_0x5e7514=_0x5da1f9[_0x7668('0x1a')]+_0x5da1f9[_0x7668('0x1b')],_0x422b5d;if(_0x5e7514>=_0x1a2e90){_0x5e7514=_0x1a2e90;_0x422b5d=0xc8;}else{_0x422b5d=0xce;}_0x49065f[_0x7668('0x17')](_0x422b5d);return _0x49065f[_0x7668('0x1c')](_0x7668('0x1d'),_0x58d697+'-'+_0x5e7514+'/'+_0x1a2e90)['json'](_0x4e24a6);}return null;};}function patchUpdates(_0x31b265){return function(_0x7a8e9d){try{jsonpatch[_0x7668('0x1e')](_0x7a8e9d,_0x31b265,!![]);}catch(_0x32f8da){return BPromise['reject'](_0x32f8da);}return _0x7a8e9d[_0x7668('0x1f')]();};}function saveUpdates(_0x58ebcf,_0x27941f){return function(_0x239dd0){if(_0x239dd0){return _0x239dd0[_0x7668('0x20')](_0x58ebcf)[_0x7668('0x21')](function(_0x751793){return _0x751793;});}return null;};}function removeEntity(_0x12fafd,_0x24b8ca){return function(_0x175f51){if(_0x175f51){return _0x175f51['destroy']()['then'](function(){var _0x5e0ed8=_0x175f51['get']({'plain':!![]});var _0x5e4242=_0x7668('0x22');return db[_0x7668('0x23')][_0x7668('0x24')]({'where':{'type':_0x5e4242,'resourceId':_0x5e0ed8['id']}})['then'](function(){return _0x175f51;});})[_0x7668('0x21')](function(){_0x12fafd[_0x7668('0x17')](0xcc)[_0x7668('0x16')]();});}};}function handleEntityNotFound(_0x3f3037,_0x5afe0f){return function(_0x55d360){if(!_0x55d360){_0x3f3037['sendStatus'](0x194);}return _0x55d360;};}function handleError(_0x1c59b0,_0x509586){_0x509586=_0x509586||0x1f4;return function(_0x3b5104){logger[_0x7668('0x25')](_0x3b5104[_0x7668('0x26')]);if(_0x3b5104[_0x7668('0x27')]){delete _0x3b5104['name'];}_0x1c59b0[_0x7668('0x17')](_0x509586)[_0x7668('0x28')](_0x3b5104);};}exports['index']=function(_0x4b6913,_0x5ceada){var _0x13a802={},_0x13b4c0={},_0xfa9737={'count':0x0,'rows':[]};var _0x479400=_[_0x7668('0x29')](db[_0x7668('0x2a')][_0x7668('0x2b')],function(_0x55ae22){return{'name':_0x55ae22[_0x7668('0x2c')],'type':_0x55ae22[_0x7668('0x2d')][_0x7668('0x2e')]};});_0x13b4c0[_0x7668('0x2f')]=_[_0x7668('0x29')](_0x479400,_0x7668('0x27'));_0x13b4c0[_0x7668('0x30')]=_[_0x7668('0x31')](_0x4b6913[_0x7668('0x30')]);_0x13b4c0[_0x7668('0x32')]=_[_0x7668('0x33')](_0x13b4c0[_0x7668('0x2f')],_0x13b4c0[_0x7668('0x30')]);_0x13a802['attributes']=_['intersection'](_0x13b4c0['model'],qs[_0x7668('0x34')](_0x4b6913[_0x7668('0x30')][_0x7668('0x34')]));_0x13a802[_0x7668('0x35')]=_0x13a802[_0x7668('0x35')]['length']?_0x13a802['attributes']:_0x13b4c0['model'];if(!_0x4b6913[_0x7668('0x30')]['hasOwnProperty'](_0x7668('0x36'))){_0x13a802[_0x7668('0x1b')]=qs['limit'](_0x4b6913[_0x7668('0x30')][_0x7668('0x1b')]);_0x13a802['offset']=qs[_0x7668('0x1a')](_0x4b6913['query'][_0x7668('0x1a')]);}_0x13a802['order']=qs[_0x7668('0x37')](_0x4b6913[_0x7668('0x30')]['sort']);_0x13a802[_0x7668('0x38')]=qs[_0x7668('0x32')](_[_0x7668('0x39')](_0x4b6913[_0x7668('0x30')],_0x13b4c0[_0x7668('0x32')]));if(_0x4b6913[_0x7668('0x30')][_0x7668('0x3a')]){_0x13a802['where']=_['merge'](_0x13a802[_0x7668('0x38')],{'$or':_[_0x7668('0x29')](_0x479400,function(_0x1b656c){if(_0x1b656c[_0x7668('0x2d')]!==_0x7668('0x3b')){var _0x2c489b={};_0x2c489b[_0x1b656c[_0x7668('0x27')]]={'$like':'%'+_0x4b6913[_0x7668('0x30')]['filter']+'%'};return _0x2c489b;}})});}_0x13a802=_['merge']({},_0x13a802,_0x4b6913[_0x7668('0x3c')]);var _0x4cbd7d={'where':_0x13a802[_0x7668('0x38')]};return db[_0x7668('0x2a')]['count'](_0x4cbd7d)['then'](function(_0x46388a){_0xfa9737[_0x7668('0x19')]=_0x46388a;if(_0x4b6913['query'][_0x7668('0x3d')]){_0x13a802['include']=[{'all':!![]}];}return db[_0x7668('0x2a')][_0x7668('0x3e')](_0x13a802);})[_0x7668('0x21')](function(_0xcea53d){_0xfa9737[_0x7668('0x3f')]=_0xcea53d;return _0xfa9737;})[_0x7668('0x21')](respondWithFilteredResult(_0x5ceada,_0x13a802))[_0x7668('0x40')](handleError(_0x5ceada,null));};exports['show']=function(_0x5f4430,_0x3b86de){var _0x1fcc2c={'raw':!![],'where':{'id':_0x5f4430[_0x7668('0x41')]['id']}},_0x377de6={};_0x377de6[_0x7668('0x2f')]=_['keys'](db[_0x7668('0x2a')][_0x7668('0x2b')]);_0x377de6[_0x7668('0x30')]=_['keys'](_0x5f4430[_0x7668('0x30')]);_0x377de6[_0x7668('0x32')]=_[_0x7668('0x33')](_0x377de6[_0x7668('0x2f')],_0x377de6[_0x7668('0x30')]);_0x1fcc2c['attributes']=_[_0x7668('0x33')](_0x377de6[_0x7668('0x2f')],qs[_0x7668('0x34')](_0x5f4430[_0x7668('0x30')][_0x7668('0x34')]));_0x1fcc2c[_0x7668('0x35')]=_0x1fcc2c['attributes'][_0x7668('0x42')]?_0x1fcc2c[_0x7668('0x35')]:_0x377de6[_0x7668('0x2f')];if(_0x5f4430['query'][_0x7668('0x3d')]){_0x1fcc2c[_0x7668('0x43')]=[{'all':!![]}];}_0x1fcc2c=_['merge']({},_0x1fcc2c,_0x5f4430[_0x7668('0x3c')]);return db[_0x7668('0x2a')]['find'](_0x1fcc2c)['then'](handleEntityNotFound(_0x3b86de,null))[_0x7668('0x21')](respondWithResult(_0x3b86de,null))[_0x7668('0x40')](handleError(_0x3b86de,null));};exports[_0x7668('0x44')]=function(_0x1377f1,_0x261168){return db[_0x7668('0x2a')][_0x7668('0x44')](_0x1377f1[_0x7668('0x45')],{})[_0x7668('0x21')](function(_0x551564){var _0x598561=_0x1377f1[_0x7668('0x46')][_0x7668('0x47')]({'plain':!![]});if(!_0x598561)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x598561[_0x7668('0x48')]===_0x7668('0x46')){var _0x34b43e=_0x551564[_0x7668('0x47')]({'plain':!![]});var _0x4bdf87=_0x7668('0x49');return db[_0x7668('0x4a')][_0x7668('0x4b')]({'where':{'name':_0x4bdf87,'userProfileId':_0x598561[_0x7668('0x4c')]},'raw':!![]})['then'](function(_0x48b95c){if(_0x48b95c&&_0x48b95c[_0x7668('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x34b43e['name'],'resourceId':_0x34b43e['id'],'type':_0x7668('0x22'),'sectionId':_0x48b95c['id']},{})[_0x7668('0x21')](function(){return _0x551564;});}else{return _0x551564;}})[_0x7668('0x40')](function(_0x2cd2db){logger[_0x7668('0x25')](_0x7668('0x4e'),_0x2cd2db);throw _0x2cd2db;});}return _0x551564;})[_0x7668('0x21')](respondWithResult(_0x261168,0xc9))[_0x7668('0x40')](handleError(_0x261168,null));};exports[_0x7668('0x20')]=function(_0x2999fc,_0x191b28){if(_0x2999fc[_0x7668('0x45')]['id']){delete _0x2999fc[_0x7668('0x45')]['id'];}return db[_0x7668('0x2a')][_0x7668('0x4b')]({'where':{'id':_0x2999fc[_0x7668('0x41')]['id']}})[_0x7668('0x21')](handleEntityNotFound(_0x191b28,null))['then'](saveUpdates(_0x2999fc[_0x7668('0x45')],null))[_0x7668('0x21')](respondWithResult(_0x191b28,null))[_0x7668('0x40')](handleError(_0x191b28,null));};exports[_0x7668('0x24')]=function(_0x3b7c67,_0x1a2c0f){return db[_0x7668('0x2a')][_0x7668('0x4b')]({'where':{'id':_0x3b7c67[_0x7668('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a2c0f,null))[_0x7668('0x21')](removeEntity(_0x1a2c0f,null))[_0x7668('0x40')](handleError(_0x1a2c0f,null));};exports[_0x7668('0x4f')]=function(_0x3f7950,_0x45dcdb){var _0x53d84c=0xa;var _0x3a2ba8=['join',_0x7668('0x50'),_0x7668('0x51'),_0x7668('0x52')];var _0x6c344c={'SUM':'SUM(%s)','COUNT':_0x7668('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x7668('0x54'),'AVG':_0x7668('0x55'),'GROUP_CONCAT':_0x7668('0x56'),'GROUP_CONCAT ASC':_0x7668('0x57'),'GROUP_CONCAT DESC':_0x7668('0x58')};var _0x12527b={'SEC_TO_TIME':_0x7668('0x59'),'DATE':_0x7668('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x35039a=function(_0x4dfc58){return!_[_0x7668('0x5b')]([_0x7668('0x5c'),_0x7668('0x5d'),_0x7668('0x5e'),'IS\x20NOT\x20EMPTY'],_0x4dfc58);};var _0x20064d=function(_0x33fcd0){if(!_0x33fcd0||!_0x33fcd0[_0x7668('0x5f')]['length']){return'';}for(var _0x73f6fa='(',_0x500680=0x0;_0x500680<_0x33fcd0[_0x7668('0x5f')][_0x7668('0x42')];_0x500680+=0x1){_0x500680>0x0&&(_0x73f6fa+='\x20'+_0x33fcd0[_0x7668('0x60')]+'\x20');_0x73f6fa+=_0x33fcd0[_0x7668('0x5f')][_0x500680][_0x7668('0x61')]?_0x20064d(_0x33fcd0[_0x7668('0x5f')][_0x500680][_0x7668('0x61')]):_0x33fcd0[_0x7668('0x5f')][_0x500680]['field']+'\x20'+_0x33fcd0[_0x7668('0x5f')][_0x500680]['condition']+(_0x35039a(_0x33fcd0[_0x7668('0x5f')][_0x500680]['condition'])?'\x20'+_0x33fcd0['rules'][_0x500680][_0x7668('0x62')]:'');}return _0x73f6fa+')';};var _0xe3acd0={'where':{'id':_0x3f7950['params']['id']}},_0x25dbac,_0x3905b0,_0x204a35,_0x181965,_0x157efb;_0xe3acd0=_['merge']({},_0xe3acd0,_0x3f7950['options']);return db[_0x7668('0x2a')][_0x7668('0x4b')](_0xe3acd0)[_0x7668('0x21')](function(_0x4e4617){if(_0x4e4617){_0x25dbac=_0x4e4617;return _0x4e4617['getFields']();}return null;})[_0x7668('0x21')](function(_0x51e2f4){if(_0x51e2f4){if(!_0x51e2f4[_0x7668('0x42')]){throw new db[(_0x7668('0x63'))]['ValidationErrorItem'](_0x7668('0x64'),0x193);}_0x3905b0=_0x51e2f4;return db[_0x7668('0x65')][_0x7668('0x3e')]({'raw':!![]});}return null;})['then'](function(_0x5db6ed){if(_0x5db6ed){_0x204a35=_[_0x7668('0x66')](_0x5db6ed,'id');var _0x15f129;var _0xd96e98=squel[_0x7668('0x67')]();_0xd96e98[_0x7668('0x68')](_0x25dbac[_0x7668('0x69')]);for(var _0x28f400=0x0;_0x28f400<_0x3905b0[_0x7668('0x42')];_0x28f400+=0x1){_0x15f129=_0x3905b0[_0x28f400]['MetricId']?_0x204a35[_0x3905b0[_0x28f400][_0x7668('0x6a')]]['metric']:_0x3905b0[_0x28f400][_0x7668('0x6b')];_0x15f129=_0x3905b0[_0x28f400]['function']?_[_0x7668('0x6c')](_0x6c344c[_0x3905b0[_0x28f400][_0x7668('0x6d')]],'%s',_0x15f129):_0x15f129;_0x15f129=_0x3905b0[_0x28f400]['format']?_[_0x7668('0x6c')](_0x12527b[_0x3905b0[_0x28f400]['format']],'%s',_0x15f129):_0x15f129;if(_0x3905b0[_0x28f400][_0x7668('0x6e')]){_0xd96e98['group'](_0x15f129);}_0x3905b0[_0x28f400]['orderBy']&&_0xd96e98['order'](_0x15f129,_0x3905b0[_0x28f400][_0x7668('0x6f')]===_0x7668('0x70')?![]:!![]);_0xd96e98['field'](_0x15f129,_0x3905b0[_0x28f400][_0x7668('0x71')]||_0x15f129);}if(_0x25dbac[_0x7668('0x72')]){_0x25dbac['joins']=JSON[_0x7668('0x73')](_0x25dbac[_0x7668('0x72')]);for(var _0x4b40f7=0x0;_0x4b40f7<_0x25dbac[_0x7668('0x72')][_0x7668('0x42')];_0x4b40f7+=0x1){if(_0x25dbac[_0x7668('0x72')][_0x4b40f7]['type']&&_[_0x7668('0x5b')](_0x3a2ba8,_0x25dbac['joins'][_0x4b40f7][_0x7668('0x2d')])&&_0x25dbac[_0x7668('0x72')][_0x4b40f7][_0x7668('0x74')]&&_0x25dbac[_0x7668('0x72')][_0x4b40f7][_0x7668('0x75')]&&_0x25dbac[_0x7668('0x72')][_0x4b40f7][_0x7668('0x76')]){_0xd96e98[_0x25dbac[_0x7668('0x72')][_0x4b40f7][_0x7668('0x2d')]](_0x25dbac['joins'][_0x4b40f7][_0x7668('0x75')],null,util[_0x7668('0x77')]('%s.%s\x20=\x20%s.%s',_0x25dbac[_0x7668('0x69')],_0x25dbac['joins'][_0x4b40f7][_0x7668('0x74')],_0x25dbac[_0x7668('0x72')][_0x4b40f7][_0x7668('0x75')],_0x25dbac[_0x7668('0x72')][_0x4b40f7][_0x7668('0x76')]));}}}if(_0x25dbac[_0x7668('0x78')]){_0x25dbac['conditions']=JSON[_0x7668('0x73')](_0x25dbac[_0x7668('0x78')]);_0xd96e98[_0x7668('0x38')](_0x20064d(_0x25dbac[_0x7668('0x78')]['group']));}_0x157efb=_0xd96e98['clone']();_0xd96e98['limit'](_0x53d84c);_0xd96e98[_0x7668('0x1a')](0x0);logger[_0x7668('0x79')](_0x7668('0x7a'),_0xd96e98[_0x7668('0x7b')]());return db[_0x7668('0x7c')]['query'](_0xd96e98[_0x7668('0x7b')](),{'type':db[_0x7668('0x7c')][_0x7668('0x7d')]['SELECT']});}})[_0x7668('0x21')](respondWithResult(_0x45dcdb,null))[_0x7668('0x40')](handleError(_0x45dcdb,null));};function runReport(_0x55dd5c,_0xcea9ca,_0x42cba0){var _0x2a5ca8=_0xcea9ca['name'];var _0x191241=0xa;var _0x3494cc=[_0x7668('0x7e'),_0x7668('0x50'),_0x7668('0x51'),'cross_join'];var _0x334a1c={'SUM':_0x7668('0x7f'),'COUNT':_0x7668('0x53'),'COUNT DISTINCT':_0x7668('0x80'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7668('0x57'),'GROUP_CONCAT DESC':_0x7668('0x58')};var _0x281390={'SEC_TO_TIME':_0x7668('0x59'),'DATE':'DATE(%s)','HOUR':_0x7668('0x81'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7668('0x82')};var _0x149bca=function(_0x5da0e1){return!_[_0x7668('0x5b')]([_0x7668('0x5c'),_0x7668('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x5da0e1);};var _0x58f0c5=function(_0x114913){if(!_0x114913||!_0x114913[_0x7668('0x5f')][_0x7668('0x42')]){return'';}for(var _0x2fa8c6='(',_0x6cd1a0=0x0;_0x6cd1a0<_0x114913[_0x7668('0x5f')]['length'];_0x6cd1a0+=0x1){_0x6cd1a0>0x0&&(_0x2fa8c6+='\x20'+_0x114913[_0x7668('0x60')]+'\x20');_0x2fa8c6+=_0x114913[_0x7668('0x5f')][_0x6cd1a0]['group']?_0x58f0c5(_0x114913['rules'][_0x6cd1a0][_0x7668('0x61')]):_0x114913[_0x7668('0x5f')][_0x6cd1a0][_0x7668('0x6b')]+'\x20'+_0x114913[_0x7668('0x5f')][_0x6cd1a0]['condition']+(_0x149bca(_0x114913[_0x7668('0x5f')][_0x6cd1a0]['condition'])?'\x20'+_0x114913['rules'][_0x6cd1a0]['value']:'');}return _0x2fa8c6+')';};var _0x533f93={'where':{'id':_0x55dd5c['id']}},_0x1ee6e4,_0x3d4bd6,_0x44c367,_0x228748,_0x548329;_0x533f93=_[_0x7668('0x83')]({},_0x533f93,_0x42cba0);return db[_0x7668('0x2a')]['find'](_0x533f93)[_0x7668('0x21')](function(_0x348724){if(_0x348724){_0x1ee6e4=_0x348724;return _0x348724[_0x7668('0x84')]();}return null;})[_0x7668('0x21')](function(_0xb4d7c8){if(_0xb4d7c8){if(!_0xb4d7c8[_0x7668('0x42')]){throw new db[(_0x7668('0x63'))][(_0x7668('0x85'))](_0x7668('0x64'),0x193);}_0x3d4bd6=_0xb4d7c8;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x7668('0x21')](function(_0x58797d){if(_0x58797d){_0x44c367=_['keyBy'](_0x58797d,'id');var _0x251bb6;var _0xd0e524=squel['select']();_0xd0e524[_0x7668('0x68')](_0x1ee6e4[_0x7668('0x69')]);for(var _0x52b78b=0x0;_0x52b78b<_0x3d4bd6[_0x7668('0x42')];_0x52b78b+=0x1){_0x251bb6=_0x3d4bd6[_0x52b78b]['MetricId']?_0x44c367[_0x3d4bd6[_0x52b78b][_0x7668('0x6a')]][_0x7668('0x86')]:_0x3d4bd6[_0x52b78b]['field'];_0x251bb6=_0x3d4bd6[_0x52b78b][_0x7668('0x6d')]?_[_0x7668('0x6c')](_0x334a1c[_0x3d4bd6[_0x52b78b][_0x7668('0x6d')]],'%s',_0x251bb6):_0x251bb6;_0x251bb6=_0x3d4bd6[_0x52b78b]['format']?_['replace'](_0x281390[_0x3d4bd6[_0x52b78b][_0x7668('0x77')]],'%s',_0x251bb6):_0x251bb6;if(_0x3d4bd6[_0x52b78b][_0x7668('0x6e')]){_0xd0e524[_0x7668('0x61')](_0x251bb6);}_0x3d4bd6[_0x52b78b][_0x7668('0x6f')]&&_0xd0e524[_0x7668('0x87')](_0x251bb6,_0x3d4bd6[_0x52b78b][_0x7668('0x6f')]===_0x7668('0x70')?![]:!![]);_0xd0e524[_0x7668('0x6b')](_0x251bb6,_0x3d4bd6[_0x52b78b][_0x7668('0x71')]||_0x251bb6);}if(_0x1ee6e4['joins']){_0x1ee6e4['joins']=JSON['parse'](_0x1ee6e4[_0x7668('0x72')]);for(var _0x27a199=0x0;_0x27a199<_0x1ee6e4[_0x7668('0x72')]['length'];_0x27a199+=0x1){if(_0x1ee6e4[_0x7668('0x72')][_0x27a199][_0x7668('0x2d')]&&_[_0x7668('0x5b')](_0x3494cc,_0x1ee6e4[_0x7668('0x72')][_0x27a199][_0x7668('0x2d')])&&_0x1ee6e4['joins'][_0x27a199][_0x7668('0x74')]&&_0x1ee6e4[_0x7668('0x72')][_0x27a199][_0x7668('0x75')]&&_0x1ee6e4[_0x7668('0x72')][_0x27a199]['foreignKey']){_0xd0e524[_0x1ee6e4['joins'][_0x27a199][_0x7668('0x2d')]](_0x1ee6e4['joins'][_0x27a199][_0x7668('0x75')],null,util['format'](_0x7668('0x88'),_0x1ee6e4[_0x7668('0x69')],_0x1ee6e4['joins'][_0x27a199][_0x7668('0x74')],_0x1ee6e4[_0x7668('0x72')][_0x27a199][_0x7668('0x75')],_0x1ee6e4[_0x7668('0x72')][_0x27a199][_0x7668('0x76')]));}}}if(_0x1ee6e4[_0x7668('0x78')]){_0x1ee6e4[_0x7668('0x78')]=JSON['parse'](_0x1ee6e4[_0x7668('0x78')]);_0xd0e524['where'](_0x58f0c5(_0x1ee6e4[_0x7668('0x78')][_0x7668('0x61')]));}_0x548329=_0xd0e524[_0x7668('0x89')]();_0xd0e524[_0x7668('0x1b')](_0x191241);_0xd0e524[_0x7668('0x1a')](0x0);logger['debug'](_0x7668('0x7a'),_0xd0e524[_0x7668('0x7b')]());return db['sequelize'][_0x7668('0x30')](_0xd0e524['toString'](),{'type':db['sequelize']['QueryTypes'][_0x7668('0x8a')]});}})[_0x7668('0x21')](function(_0x5ae069){if(!_0x5ae069[_0x7668('0x42')]){throw new db[(_0x7668('0x63'))][(_0x7668('0x85'))](_0x7668('0x8b'),0xcc);}if(_0xcea9ca[_0x7668('0x8c')]===_0x7668('0x8d')){return null;}var _0x4d6acb=_['merge'](_0xcea9ca,{'name':_0xcea9ca['fullPath']||_0xcea9ca[_0x7668('0x27')]||_0x1ee6e4['name'],'basename':_0x2a5ca8,'savename':util[_0x7668('0x77')](_0x7668('0x8e'),_0xcea9ca[_0x7668('0x27')]||_0x1ee6e4[_0x7668('0x27')],require(_0x7668('0x8f'))[_0x7668('0x90')](0x4),_0xcea9ca['output']||_0x7668('0x91')),'reportId':_0x1ee6e4['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x7668('0x44')](_0x4d6acb,{'raw':!![]});})[_0x7668('0x21')](function(_0x3b780c){if(_0x1ee6e4['table']==='cdr'){_0x548329['where'](_0x1ee6e4[_0x7668('0x69')]+_0x7668('0x92'),_0xcea9ca[_0x7668('0x93')],_0xcea9ca[_0x7668('0x94')]);}else{_0x548329['where'](_0x1ee6e4[_0x7668('0x69')]+_0x7668('0x95'),_0xcea9ca['startDate'],_0xcea9ca[_0x7668('0x94')]);}if(_0x3b780c){logger['info'](_0x7668('0x96'),_0x548329[_0x7668('0x7b')]());require(_0x7668('0x97'))[_0x7668('0x98')](path[_0x7668('0x7e')](__dirname,_0x7668('0x99'),_0x3b780c['output']),[_0x3b780c['id'],_0x548329[_0x7668('0x7b')](),path['join'](__dirname,_0x7668('0x9a'),_0x3b780c[_0x7668('0x9b')]),_0x2a5ca8]);return _0x3b780c;}else{var _0x34c518=squel[_0x7668('0x67')]();_0x34c518[_0x7668('0x68')]('('+_0x548329[_0x7668('0x7b')]()+')',_0x7668('0x9c'));_0x34c518[_0x7668('0x6b')](_0x7668('0x9d'),_0x7668('0x19'));_0x548329[_0x7668('0x1b')](_0xcea9ca['limit']||_0x191241);_0x548329[_0x7668('0x1a')](_0xcea9ca[_0x7668('0x1a')]||0x0);return db[_0x7668('0x7c')]['query'](_0x34c518['toString'](),{'type':db[_0x7668('0x7c')][_0x7668('0x7d')][_0x7668('0x8a')]})[_0x7668('0x21')](function(_0x1c0947){if(!_0x1c0947[_0x7668('0x42')]){_0x228748=0x0;}else{_0x228748=_0x1c0947[0x0][_0x7668('0x19')]||0x0;}return db[_0x7668('0x7c')][_0x7668('0x30')](_0x548329[_0x7668('0x7b')](),{'type':db[_0x7668('0x7c')][_0x7668('0x7d')][_0x7668('0x8a')]});})[_0x7668('0x21')](function(_0x45a36c){return{'rows':_0x45a36c||[],'count':_0x228748};});}});}exports['run']=function(_0x4ec08d,_0x539770){return runReport(_0x4ec08d[_0x7668('0x41')],_0x4ec08d[_0x7668('0x30')],_0x4ec08d[_0x7668('0x3c')])[_0x7668('0x21')](respondWithResult(_0x539770,null))['catch'](handleError(_0x539770,null));};exports['runReport']=runReport;exports[_0x7668('0x30')]=function(_0x5bb8b5,_0x56029d){var _0x36dc6e=0xa;var _0x1f11a0=[_0x7668('0x7e'),_0x7668('0x50'),_0x7668('0x51'),_0x7668('0x52')];var _0xd417c1={'SUM':_0x7668('0x7f'),'COUNT':_0x7668('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7668('0x9e'),'MIN':_0x7668('0x54'),'AVG':_0x7668('0x55'),'GROUP_CONCAT':_0x7668('0x56'),'GROUP_CONCAT ASC':_0x7668('0x57'),'GROUP_CONCAT DESC':_0x7668('0x58')};var _0x1fcfed={'SEC_TO_TIME':_0x7668('0x59'),'DATE':_0x7668('0x5a'),'HOUR':_0x7668('0x81'),'ROUND':_0x7668('0x9f'),'UNIX_TIMESTAMP':_0x7668('0x82')};var _0x266cb3=function(_0x5657b1){return!_[_0x7668('0x5b')](['IS\x20NULL',_0x7668('0x5d'),_0x7668('0x5e'),'IS\x20NOT\x20EMPTY'],_0x5657b1);};var _0x2a5034=function(_0x3db6d5){if(!_0x3db6d5||!_0x3db6d5['rules'][_0x7668('0x42')]){return'';}for(var _0x51fa22='(',_0x1dffc0=0x0;_0x1dffc0<_0x3db6d5[_0x7668('0x5f')]['length'];_0x1dffc0+=0x1){_0x1dffc0>0x0&&(_0x51fa22+='\x20'+_0x3db6d5[_0x7668('0x60')]+'\x20');_0x51fa22+=_0x3db6d5[_0x7668('0x5f')][_0x1dffc0][_0x7668('0x61')]?_0x2a5034(_0x3db6d5[_0x7668('0x5f')][_0x1dffc0][_0x7668('0x61')]):_0x3db6d5[_0x7668('0x5f')][_0x1dffc0][_0x7668('0x6b')]+'\x20'+_0x3db6d5['rules'][_0x1dffc0][_0x7668('0xa0')]+(_0x266cb3(_0x3db6d5[_0x7668('0x5f')][_0x1dffc0]['condition'])?'\x20'+_0x3db6d5[_0x7668('0x5f')][_0x1dffc0][_0x7668('0x62')]:'');}return _0x51fa22+')';};var _0x2d8b72={'where':{'id':_0x5bb8b5['params']['id']}},_0x4ec194,_0x31b34e,_0xfcec8b,_0x3c60f6,_0x1a75c0;_0x2d8b72=_[_0x7668('0x83')]({},_0x2d8b72,_0x5bb8b5[_0x7668('0x3c')]);return db['AnalyticDefaultReport'][_0x7668('0x4b')](_0x2d8b72)[_0x7668('0x21')](function(_0x58376f){if(_0x58376f){_0x4ec194=_0x58376f;return _0x58376f['getFields']();}return null;})['then'](function(_0x3e348c){if(_0x3e348c){if(!_0x3e348c[_0x7668('0x42')]){throw new db[(_0x7668('0x63'))][(_0x7668('0x85'))](_0x7668('0x64'),0x193);}_0x31b34e=_0x3e348c;return db[_0x7668('0x65')]['findAll']({'raw':!![]});}return null;})[_0x7668('0x21')](function(_0x27c0cc){if(_0x27c0cc){_0xfcec8b=_['keyBy'](_0x27c0cc,'id');var _0x36d0f1;var _0x5b0406=squel[_0x7668('0x67')]();_0x5b0406[_0x7668('0x68')](_0x4ec194[_0x7668('0x69')]);for(var _0x1bfc1f=0x0;_0x1bfc1f<_0x31b34e[_0x7668('0x42')];_0x1bfc1f+=0x1){_0x36d0f1=_0x31b34e[_0x1bfc1f][_0x7668('0x6a')]?_0xfcec8b[_0x31b34e[_0x1bfc1f][_0x7668('0x6a')]]['metric']:_0x31b34e[_0x1bfc1f]['field'];_0x36d0f1=_0x31b34e[_0x1bfc1f]['function']?_['replace'](_0xd417c1[_0x31b34e[_0x1bfc1f][_0x7668('0x6d')]],'%s',_0x36d0f1):_0x36d0f1;_0x36d0f1=_0x31b34e[_0x1bfc1f][_0x7668('0x77')]?_[_0x7668('0x6c')](_0x1fcfed[_0x31b34e[_0x1bfc1f][_0x7668('0x77')]],'%s',_0x36d0f1):_0x36d0f1;if(_0x31b34e[_0x1bfc1f]['groupBy']){_0x5b0406[_0x7668('0x61')](_0x36d0f1);}_0x31b34e[_0x1bfc1f][_0x7668('0x6f')]&&_0x5b0406[_0x7668('0x87')](_0x36d0f1,_0x31b34e[_0x1bfc1f][_0x7668('0x6f')]===_0x7668('0x70')?![]:!![]);_0x5b0406[_0x7668('0x6b')](_0x36d0f1,_0x31b34e[_0x1bfc1f][_0x7668('0x71')]||_0x36d0f1);}if(_0x4ec194[_0x7668('0x72')]){_0x4ec194['joins']=JSON[_0x7668('0x73')](_0x4ec194[_0x7668('0x72')]);for(var _0x63d730=0x0;_0x63d730<_0x4ec194['joins'][_0x7668('0x42')];_0x63d730+=0x1){if(_0x4ec194[_0x7668('0x72')][_0x63d730][_0x7668('0x2d')]&&_[_0x7668('0x5b')](_0x1f11a0,_0x4ec194[_0x7668('0x72')][_0x63d730][_0x7668('0x2d')])&&_0x4ec194[_0x7668('0x72')][_0x63d730][_0x7668('0x74')]&&_0x4ec194[_0x7668('0x72')][_0x63d730][_0x7668('0x75')]&&_0x4ec194[_0x7668('0x72')][_0x63d730][_0x7668('0x76')]){_0x5b0406[_0x4ec194['joins'][_0x63d730][_0x7668('0x2d')]](_0x4ec194['joins'][_0x63d730][_0x7668('0x75')],null,util[_0x7668('0x77')](_0x7668('0x88'),_0x4ec194['table'],_0x4ec194['joins'][_0x63d730]['parentKey'],_0x4ec194[_0x7668('0x72')][_0x63d730][_0x7668('0x75')],_0x4ec194[_0x7668('0x72')][_0x63d730][_0x7668('0x76')]));}}}if(_0x4ec194[_0x7668('0x78')]){_0x4ec194[_0x7668('0x78')]=JSON['parse'](_0x4ec194[_0x7668('0x78')]);_0x5b0406[_0x7668('0x38')](_0x2a5034(_0x4ec194[_0x7668('0x78')][_0x7668('0x61')]));}_0x1a75c0=_0x5b0406['clone']();_0x5b0406[_0x7668('0x1b')](_0x36dc6e);_0x5b0406[_0x7668('0x1a')](0x0);logger[_0x7668('0x79')](_0x7668('0x7a'),_0x5b0406[_0x7668('0x7b')]());return db[_0x7668('0x7c')]['query'](_0x5b0406['toString'](),{'type':db[_0x7668('0x7c')][_0x7668('0x7d')]['SELECT']});}})[_0x7668('0x21')](function(){return{'sql':_0x1a75c0[_0x7668('0x7b')]()};})[_0x7668('0x21')](respondWithResult(_0x56029d,null))[_0x7668('0x40')](handleError(_0x56029d,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 1c43147..6d59469 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 _0x4d5d=['./analyticDefaultReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3339a9,_0x23a3da){var _0x4ab9d5=function(_0x2aebca){while(--_0x2aebca){_0x3339a9['push'](_0x3339a9['shift']());}};_0x4ab9d5(++_0x23a3da);}(_0x4d5d,0x111));var _0xd4d5=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0x4d5d[_0x52e0ee];return _0x32534c;};'use strict';var _=require(_0xd4d5('0x0'));var util=require(_0xd4d5('0x1'));var logger=require(_0xd4d5('0x2'))(_0xd4d5('0x3'));var moment=require(_0xd4d5('0x4'));var BPromise=require('bluebird');var rp=require(_0xd4d5('0x5'));var fs=require('fs');var path=require(_0xd4d5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd4d5('0x7'));module[_0xd4d5('0x8')]=function(_0x39c809,_0x2f36f0){return _0x39c809[_0xd4d5('0x9')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1016=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xdc1559,_0x539c37){var _0x5dbc86=function(_0xc0cfd){while(--_0xc0cfd){_0xdc1559['push'](_0xdc1559['shift']());}};_0x5dbc86(++_0x539c37);}(_0x1016,0x124));var _0x6101=function(_0x3c472a,_0xbe009d){_0x3c472a=_0x3c472a-0x0;var _0x25f0c2=_0x1016[_0x3c472a];return _0x25f0c2;};'use strict';var _=require(_0x6101('0x0'));var util=require(_0x6101('0x1'));var logger=require(_0x6101('0x2'))('api');var moment=require(_0x6101('0x3'));var BPromise=require(_0x6101('0x4'));var rp=require(_0x6101('0x5'));var fs=require('fs');var path=require(_0x6101('0x6'));var rimraf=require(_0x6101('0x7'));var config=require(_0x6101('0x8'));var attributes=require(_0x6101('0x9'));module[_0x6101('0xa')]=function(_0x49bf64,_0x3bd613){return _0x49bf64[_0x6101('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0x6101('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 0211483..951ec70 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 _0x81d5=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x128ced,_0x37e607){var _0xea5d14=function(_0x432fc4){while(--_0x432fc4){_0x128ced['push'](_0x128ced['shift']());}};_0xea5d14(++_0x37e607);}(_0x81d5,0x1ab));var _0x581d=function(_0x55c424,_0x1df0ff){_0x55c424=_0x55c424-0x0;var _0xed3f48=_0x81d5[_0x55c424];return _0xed3f48;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var moment=require('moment');var BPromise=require(_0x581d('0x2'));var rs=require(_0x581d('0x3'));var fs=require('fs');var Redis=require(_0x581d('0x4'));var db=require(_0x581d('0x5'))['db'];var utils=require(_0x581d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x581d('0x7'));var jayson=require(_0x581d('0x8'));var client=jayson[_0x581d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16067b,_0x2f32bf,_0x43124c){return new BPromise(function(_0x497368,_0xf1a3b6){return client['request'](_0x16067b,_0x43124c)['then'](function(_0x5d8fa3){logger[_0x581d('0xa')](_0x581d('0xb'),_0x2f32bf,_0x581d('0xc'));logger[_0x581d('0xd')](_0x581d('0xe'),_0x2f32bf,'request\x20sent',JSON[_0x581d('0xf')](_0x5d8fa3));if(_0x5d8fa3[_0x581d('0x10')]){if(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x11')]===0x1f4){logger[_0x581d('0x10')](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);return _0xf1a3b6(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);}logger['error'](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')]['message']);return _0x497368(_0x5d8fa3['error']['message']);}else{logger['info'](_0x581d('0xb'),_0x2f32bf,'request\x20sent');_0x497368(_0x5d8fa3[_0x581d('0x13')][_0x581d('0x12')]);}})['catch'](function(_0x1890d0){logger['error'](_0x581d('0xb'),_0x2f32bf,_0x1890d0);_0xf1a3b6(_0x1890d0);});});} \ No newline at end of file +var _0x81d5=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x566667,_0x3f99c2){var _0x277136=function(_0x129ea0){while(--_0x129ea0){_0x566667['push'](_0x566667['shift']());}};_0x277136(++_0x3f99c2);}(_0x81d5,0x1ab));var _0x581d=function(_0x4241a9,_0x4403d3){_0x4241a9=_0x4241a9-0x0;var _0x1f2f77=_0x81d5[_0x4241a9];return _0x1f2f77;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var moment=require('moment');var BPromise=require(_0x581d('0x2'));var rs=require(_0x581d('0x3'));var fs=require('fs');var Redis=require(_0x581d('0x4'));var db=require(_0x581d('0x5'))['db'];var utils=require(_0x581d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x581d('0x7'));var jayson=require(_0x581d('0x8'));var client=jayson[_0x581d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16067b,_0x2f32bf,_0x43124c){return new BPromise(function(_0x497368,_0xf1a3b6){return client['request'](_0x16067b,_0x43124c)['then'](function(_0x5d8fa3){logger[_0x581d('0xa')](_0x581d('0xb'),_0x2f32bf,_0x581d('0xc'));logger[_0x581d('0xd')](_0x581d('0xe'),_0x2f32bf,'request\x20sent',JSON[_0x581d('0xf')](_0x5d8fa3));if(_0x5d8fa3[_0x581d('0x10')]){if(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x11')]===0x1f4){logger[_0x581d('0x10')](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);return _0xf1a3b6(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);}logger['error'](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')]['message']);return _0x497368(_0x5d8fa3['error']['message']);}else{logger['info'](_0x581d('0xb'),_0x2f32bf,'request\x20sent');_0x497368(_0x5d8fa3[_0x581d('0x13')][_0x581d('0x12')]);}})['catch'](function(_0x1890d0){logger['error'](_0x581d('0xb'),_0x2f32bf,_0x1890d0);_0xf1a3b6(_0x1890d0);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index b30e044..77f7edf 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 _0xb790=['put','delete','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','/:id','isAuthenticated','show','get','/:id/run','run','/:id/query','post','create'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xb790,0x1de));var _0x0b79=function(_0x538a20,_0x5c14d6){_0x538a20=_0x538a20-0x0;var _0xec72f5=_0xb790[_0x538a20];return _0xec72f5;};'use strict';var multer=require(_0x0b79('0x0'));var util=require('util');var path=require(_0x0b79('0x1'));var timeout=require('connect-timeout');var express=require(_0x0b79('0x2'));var router=express[_0x0b79('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0b79('0x4'));var config=require(_0x0b79('0x5'));var controller=require(_0x0b79('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0b79('0x7'),auth[_0x0b79('0x8')](),controller[_0x0b79('0x9')]);router[_0x0b79('0xa')]('/:id/preview',auth[_0x0b79('0x8')](),controller['preview']);router[_0x0b79('0xa')](_0x0b79('0xb'),auth[_0x0b79('0x8')](),controller[_0x0b79('0xc')]);router['get'](_0x0b79('0xd'),auth['isAuthenticated'](),controller['query']);router[_0x0b79('0xe')]('/',auth[_0x0b79('0x8')](),controller[_0x0b79('0xf')]);router[_0x0b79('0x10')](_0x0b79('0x7'),auth[_0x0b79('0x8')](),controller['update']);router[_0x0b79('0x11')](_0x0b79('0x7'),auth[_0x0b79('0x8')](),controller['destroy']);module[_0x0b79('0x12')]=router; \ No newline at end of file +var _0x865e=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','index','get','/:id','isAuthenticated','preview','/:id/run','/:id/query','query','create','put','update','delete','exports','multer'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x865e,0x7d));var _0xe865=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x865e[_0x87b0ff];return _0x3bc0b2;};'use strict';var multer=require(_0xe865('0x0'));var util=require(_0xe865('0x1'));var path=require(_0xe865('0x2'));var timeout=require(_0xe865('0x3'));var express=require('express');var router=express[_0xe865('0x4')]();var auth=require(_0xe865('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe865('0x6'));var controller=require(_0xe865('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe865('0x8')]);router[_0xe865('0x9')](_0xe865('0xa'),auth[_0xe865('0xb')](),controller['show']);router[_0xe865('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xe865('0xc')]);router[_0xe865('0x9')](_0xe865('0xd'),auth['isAuthenticated'](),controller['run']);router['get'](_0xe865('0xe'),auth[_0xe865('0xb')](),controller[_0xe865('0xf')]);router['post']('/',auth[_0xe865('0xb')](),controller[_0xe865('0x10')]);router[_0xe865('0x11')](_0xe865('0xa'),auth[_0xe865('0xb')](),controller[_0xe865('0x12')]);router[_0xe865('0x13')](_0xe865('0xa'),auth[_0xe865('0xb')](),controller['destroy']);module[_0xe865('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 fe5bd7d..42eff2d 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 _0x1ad1=['STRING','csv','pdf','xlsx','DATE','ENUM','manual','scheduled','INTEGER','sequelize','moment','exports'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x1ad1,0x14d));var _0x11ad=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x1ad1[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x11ad('0x0'));var moment=require(_0x11ad('0x1'));module[_0x11ad('0x2')]={'name':{'type':Sequelize[_0x11ad('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x11ad('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x11ad('0x4'),_0x11ad('0x5'),_0x11ad('0x6')),'allowNull':![],'defaultValue':_0x11ad('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x11ad('0x7')]},'endDate':{'type':Sequelize[_0x11ad('0x7')]},'status':{'type':Sequelize[_0x11ad('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x11ad('0x8')](_0x11ad('0x9'),_0x11ad('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x11ad('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x11ad('0x3')]}}; \ No newline at end of file +var _0x2e95=['Loading','manual','INTEGER','UNSIGNED','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x49157b,_0x5d8601){var _0x3ea5d4=function(_0x4c2905){while(--_0x4c2905){_0x49157b['push'](_0x49157b['shift']());}};_0x3ea5d4(++_0x5d8601);}(_0x2e95,0x19b));var _0x52e9=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x2e95[_0xa9a245];return _0x2d0eaa;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x52e9('0x0')]={'name':{'type':Sequelize[_0x52e9('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x52e9('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x52e9('0x2')](_0x52e9('0x3'),_0x52e9('0x4'),_0x52e9('0x5')),'allowNull':![],'defaultValue':_0x52e9('0x3')},'savename':{'type':Sequelize[_0x52e9('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x52e9('0x6')]},'endDate':{'type':Sequelize[_0x52e9('0x6')]},'status':{'type':Sequelize[_0x52e9('0x1')],'defaultValue':_0x52e9('0x7')},'type':{'type':Sequelize[_0x52e9('0x2')](_0x52e9('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x52e9('0x8')},'reportId':{'type':Sequelize[_0x52e9('0x9')](0xb)[_0x52e9('0xa')]},'reportType':{'type':Sequelize[_0x52e9('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 7821f05..9fd7b8a 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 _0x2779=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','squel','crypto','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','keys','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x567796,_0x460632){var _0x499a02=function(_0x17b9aa){while(--_0x17b9aa){_0x567796['push'](_0x567796['shift']());}};_0x499a02(++_0x460632);}(_0x2779,0xc8));var _0x9277=function(_0x564a7e,_0x488e43){_0x564a7e=_0x564a7e-0x0;var _0x397e08=_0x2779[_0x564a7e];return _0x397e08;};'use strict';var pdf=require(_0x9277('0x0'));var emlformat=require(_0x9277('0x1'));var rimraf=require(_0x9277('0x2'));var zipdir=require(_0x9277('0x3'));var jsonpatch=require(_0x9277('0x4'));var rp=require(_0x9277('0x5'));var moment=require(_0x9277('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x9277('0x7'));var util=require(_0x9277('0x8'));var path=require(_0x9277('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9277('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9277('0xb'));var crypto=require(_0x9277('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9277('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9277('0xe'));var as=require(_0x9277('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9277('0x10'))('api');var utils=require(_0x9277('0x11'));var config=require(_0x9277('0x12'));var db=require(_0x9277('0x13'))['db'];function respondWithStatusCode(_0x26926d,_0x42cc1b){_0x42cc1b=_0x42cc1b||0xcc;return function(_0xc20e63){if(_0xc20e63){return _0x26926d[_0x9277('0x14')](_0x42cc1b);}return _0x26926d[_0x9277('0x15')](_0x42cc1b)[_0x9277('0x16')]();};}function respondWithResult(_0x27f09d,_0x57b547){_0x57b547=_0x57b547||0xc8;return function(_0x5bd710){if(_0x5bd710){return _0x27f09d['status'](_0x57b547)[_0x9277('0x17')](_0x5bd710);}};}function respondWithFilteredResult(_0x206d7c,_0x5125f6){return function(_0x835d83){if(_0x835d83){var _0x4bb8e1=_0x835d83[_0x9277('0x18')],_0x46beac=_0x5125f6[_0x9277('0x19')],_0x9ac89e=_0x5125f6[_0x9277('0x19')]+_0x5125f6[_0x9277('0x1a')],_0x586758;if(_0x9ac89e>=_0x4bb8e1){_0x9ac89e=_0x4bb8e1;_0x586758=0xc8;}else{_0x586758=0xce;}_0x206d7c[_0x9277('0x15')](_0x586758);return _0x206d7c[_0x9277('0x1b')](_0x9277('0x1c'),_0x46beac+'-'+_0x9ac89e+'/'+_0x4bb8e1)['json'](_0x835d83);}return null;};}function patchUpdates(_0x66e2d){return function(_0x51acd7){try{jsonpatch[_0x9277('0x1d')](_0x51acd7,_0x66e2d,!![]);}catch(_0x35e5a7){return BPromise[_0x9277('0x1e')](_0x35e5a7);}return _0x51acd7['save']();};}function saveUpdates(_0x558769,_0x5d3c0a){return function(_0x4b221a){if(_0x4b221a){return _0x4b221a[_0x9277('0x1f')](_0x558769)[_0x9277('0x20')](function(_0x4f2b5c){return _0x4f2b5c;});}return null;};}function removeEntity(_0x2047e0,_0x5139d5){return function(_0x94eb6d){if(_0x94eb6d){return _0x94eb6d[_0x9277('0x21')]()['then'](function(){var _0x1455a1=_0x94eb6d[_0x9277('0x22')]({'plain':!![]});var _0x459cef=_0x9277('0x23');return db[_0x9277('0x24')][_0x9277('0x21')]({'where':{'type':_0x459cef,'resourceId':_0x1455a1['id']}})['then'](function(){return _0x94eb6d;});})[_0x9277('0x20')](function(){_0x2047e0[_0x9277('0x15')](0xcc)[_0x9277('0x16')]();});}};}function handleEntityNotFound(_0x1f43f6,_0x36c79f){return function(_0xcffa20){if(!_0xcffa20){_0x1f43f6[_0x9277('0x14')](0x194);}return _0xcffa20;};}function handleError(_0x1622f2,_0x3e0ea5){_0x3e0ea5=_0x3e0ea5||0x1f4;return function(_0x5b6b25){logger[_0x9277('0x25')](_0x5b6b25[_0x9277('0x26')]);if(_0x5b6b25[_0x9277('0x27')]){delete _0x5b6b25[_0x9277('0x27')];}_0x1622f2[_0x9277('0x15')](_0x3e0ea5)[_0x9277('0x28')](_0x5b6b25);};}exports['index']=function(_0x1a92af,_0x5c384d){var _0x147009={},_0xb9428a={},_0x2a0ae4={'count':0x0,'rows':[]};var _0x1a8d7e=_[_0x9277('0x29')](db[_0x9277('0x2a')][_0x9277('0x2b')],function(_0x4de4de){return{'name':_0x4de4de[_0x9277('0x2c')],'type':_0x4de4de[_0x9277('0x2d')][_0x9277('0x2e')]};});_0xb9428a[_0x9277('0x2f')]=_['map'](_0x1a8d7e,'name');_0xb9428a[_0x9277('0x30')]=_['keys'](_0x1a92af['query']);_0xb9428a[_0x9277('0x31')]=_[_0x9277('0x32')](_0xb9428a[_0x9277('0x2f')],_0xb9428a[_0x9277('0x30')]);_0x147009[_0x9277('0x33')]=_[_0x9277('0x32')](_0xb9428a[_0x9277('0x2f')],qs['fields'](_0x1a92af[_0x9277('0x30')][_0x9277('0x34')]));_0x147009[_0x9277('0x33')]=_0x147009[_0x9277('0x33')]['length']?_0x147009[_0x9277('0x33')]:_0xb9428a[_0x9277('0x2f')];if(!_0x1a92af['query']['hasOwnProperty'](_0x9277('0x35'))){_0x147009[_0x9277('0x1a')]=qs[_0x9277('0x1a')](_0x1a92af[_0x9277('0x30')][_0x9277('0x1a')]);_0x147009[_0x9277('0x19')]=qs[_0x9277('0x19')](_0x1a92af[_0x9277('0x30')][_0x9277('0x19')]);}_0x147009['order']=qs[_0x9277('0x36')](_0x1a92af[_0x9277('0x30')][_0x9277('0x36')]);_0x147009[_0x9277('0x37')]=qs[_0x9277('0x31')](_[_0x9277('0x38')](_0x1a92af[_0x9277('0x30')],_0xb9428a[_0x9277('0x31')]));if(_0x1a92af['query'][_0x9277('0x39')]){_0x147009[_0x9277('0x37')]=_[_0x9277('0x3a')](_0x147009['where'],{'$or':_[_0x9277('0x29')](_0x1a8d7e,function(_0x39385c){if(_0x39385c[_0x9277('0x2d')]!==_0x9277('0x3b')){var _0x1a3bfb={};_0x1a3bfb[_0x39385c[_0x9277('0x27')]]={'$like':'%'+_0x1a92af[_0x9277('0x30')][_0x9277('0x39')]+'%'};return _0x1a3bfb;}})});}_0x147009=_[_0x9277('0x3a')]({},_0x147009,_0x1a92af[_0x9277('0x3c')]);var _0x5270b5={'where':_0x147009[_0x9277('0x37')]};return db['AnalyticExtractedReport'][_0x9277('0x18')](_0x5270b5)[_0x9277('0x20')](function(_0x1cd35a){_0x2a0ae4[_0x9277('0x18')]=_0x1cd35a;if(_0x1a92af[_0x9277('0x30')]['includeAll']){_0x147009[_0x9277('0x3d')]=[{'all':!![]}];}return db[_0x9277('0x2a')]['findAll'](_0x147009);})[_0x9277('0x20')](function(_0x926e20){_0x2a0ae4[_0x9277('0x3e')]=_0x926e20;return _0x2a0ae4;})[_0x9277('0x20')](respondWithFilteredResult(_0x5c384d,_0x147009))[_0x9277('0x3f')](handleError(_0x5c384d,null));};exports[_0x9277('0x40')]=function(_0x17577b,_0x2763ac){var _0x4f33ef={'raw':!![],'where':{'id':_0x17577b['params']['id']}},_0x31521a={};_0x31521a[_0x9277('0x2f')]=_[_0x9277('0x41')](db[_0x9277('0x2a')][_0x9277('0x2b')]);_0x31521a[_0x9277('0x30')]=_['keys'](_0x17577b[_0x9277('0x30')]);_0x31521a[_0x9277('0x31')]=_[_0x9277('0x32')](_0x31521a[_0x9277('0x2f')],_0x31521a[_0x9277('0x30')]);_0x4f33ef[_0x9277('0x33')]=_[_0x9277('0x32')](_0x31521a[_0x9277('0x2f')],qs[_0x9277('0x34')](_0x17577b[_0x9277('0x30')][_0x9277('0x34')]));_0x4f33ef[_0x9277('0x33')]=_0x4f33ef[_0x9277('0x33')][_0x9277('0x42')]?_0x4f33ef[_0x9277('0x33')]:_0x31521a['model'];if(_0x17577b['query'][_0x9277('0x43')]){_0x4f33ef['include']=[{'all':!![]}];}_0x4f33ef=_[_0x9277('0x3a')]({},_0x4f33ef,_0x17577b[_0x9277('0x3c')]);return db[_0x9277('0x2a')][_0x9277('0x44')](_0x4f33ef)[_0x9277('0x20')](handleEntityNotFound(_0x2763ac,null))[_0x9277('0x20')](respondWithResult(_0x2763ac,null))[_0x9277('0x3f')](handleError(_0x2763ac,null));};exports[_0x9277('0x45')]=function(_0x480b73,_0x56ae17){return db[_0x9277('0x2a')][_0x9277('0x45')](_0x480b73[_0x9277('0x46')],{})[_0x9277('0x20')](function(_0x4c1ee2){var _0x289a1d=_0x480b73[_0x9277('0x47')]['get']({'plain':!![]});if(!_0x289a1d)throw new Error(_0x9277('0x48'));if(_0x289a1d[_0x9277('0x49')]===_0x9277('0x47')){var _0xdb19fb=_0x4c1ee2[_0x9277('0x22')]({'plain':!![]});var _0x360ebf='ExtractedReports';return db[_0x9277('0x4a')][_0x9277('0x44')]({'where':{'name':_0x360ebf,'userProfileId':_0x289a1d[_0x9277('0x4b')]},'raw':!![]})['then'](function(_0x2d6568){if(_0x2d6568&&_0x2d6568[_0x9277('0x4c')]===0x0){return db['UserProfileResource'][_0x9277('0x45')]({'name':_0xdb19fb[_0x9277('0x27')],'resourceId':_0xdb19fb['id'],'type':_0x2d6568[_0x9277('0x27')],'sectionId':_0x2d6568['id']},{})[_0x9277('0x20')](function(){return _0x4c1ee2;});}else{return _0x4c1ee2;}})[_0x9277('0x3f')](function(_0x13aa6e){logger[_0x9277('0x25')](_0x9277('0x4d'),_0x13aa6e);throw _0x13aa6e;});}return _0x4c1ee2;})[_0x9277('0x20')](respondWithResult(_0x56ae17,0xc9))[_0x9277('0x3f')](handleError(_0x56ae17,null));};exports[_0x9277('0x1f')]=function(_0x8fbffd,_0x10ed0c){if(_0x8fbffd[_0x9277('0x46')]['id']){delete _0x8fbffd[_0x9277('0x46')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x8fbffd[_0x9277('0x4e')]['id']}})[_0x9277('0x20')](handleEntityNotFound(_0x10ed0c,null))['then'](saveUpdates(_0x8fbffd[_0x9277('0x46')],null))[_0x9277('0x20')](respondWithResult(_0x10ed0c,null))[_0x9277('0x3f')](handleError(_0x10ed0c,null));};exports['destroy']=function(_0x15b952,_0x48d6fe){return db[_0x9277('0x2a')][_0x9277('0x44')]({'where':{'id':_0x15b952[_0x9277('0x4e')]['id']}})[_0x9277('0x20')](handleEntityNotFound(_0x48d6fe,null))['then'](removeEntity(_0x48d6fe,null))[_0x9277('0x3f')](handleError(_0x48d6fe,null));};exports[_0x9277('0x4f')]=function(_0x5b64c6,_0x511294,_0x4192df){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x5b64c6[_0x9277('0x4e')]['id']},'attributes':[_0x9277('0x27'),_0x9277('0x50'),'savename',_0x9277('0x51')],'raw':!![]})[_0x9277('0x20')](handleEntityNotFound(_0x511294,null))[_0x9277('0x20')](function(_0x5eb091){if(_0x5eb091){if(!fs[_0x9277('0x52')](path[_0x9277('0x53')](config[_0x9277('0x54')],_0x9277('0x55'),_0x5eb091[_0x9277('0x56')]))){throw new db['Sequelize'][(_0x9277('0x57'))](_0x9277('0x58'));}if(_0x5b64c6[_0x9277('0x30')][_0x9277('0x59')]){return _0x511294['sendStatus'](0xc8);}return _0x511294[_0x9277('0x4f')](path['join'](config['root'],_0x9277('0x55'),_0x5eb091[_0x9277('0x56')]),util[_0x9277('0x5a')]('%s.%s',_0x5eb091[_0x9277('0x50')]||_0x5eb091[_0x9277('0x27')],_0x5eb091['output'][_0x9277('0x5b')]()));}})[_0x9277('0x3f')](handleError(_0x511294,null));}; \ No newline at end of file +var _0x7578=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','params','basename','savename','join','root','server/files/reports','ValidationError','exists','format','%s.%s','output','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','ExtractedReports','destroy','error','stack','name','send','index','AnalyticExtractedReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x5bb453,_0x4d75c0){var _0x3fa3e8=function(_0x79ae7b){while(--_0x79ae7b){_0x5bb453['push'](_0x5bb453['shift']());}};_0x3fa3e8(++_0x4d75c0);}(_0x7578,0xcb));var _0x8757=function(_0x1b8729,_0x5c57d7){_0x1b8729=_0x1b8729-0x0;var _0x27750b=_0x7578[_0x1b8729];return _0x27750b;};'use strict';var pdf=require(_0x8757('0x0'));var emlformat=require(_0x8757('0x1'));var rimraf=require(_0x8757('0x2'));var zipdir=require(_0x8757('0x3'));var jsonpatch=require(_0x8757('0x4'));var rp=require(_0x8757('0x5'));var moment=require('moment');var BPromise=require(_0x8757('0x6'));var Mustache=require(_0x8757('0x7'));var util=require(_0x8757('0x8'));var path=require(_0x8757('0x9'));var sox=require('sox');var csv=require(_0x8757('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8757('0xb'));var squel=require(_0x8757('0xc'));var crypto=require('crypto');var jsforce=require(_0x8757('0xd'));var deskjs=require(_0x8757('0xe'));var toCsv=require(_0x8757('0xa'));var querystring=require(_0x8757('0xf'));var Papa=require(_0x8757('0x10'));var Redis=require(_0x8757('0x11'));var authService=require(_0x8757('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8757('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8757('0x14'));var config=require(_0x8757('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2584e0,_0x471b53){_0x471b53=_0x471b53||0xcc;return function(_0x252735){if(_0x252735){return _0x2584e0[_0x8757('0x16')](_0x471b53);}return _0x2584e0[_0x8757('0x17')](_0x471b53)[_0x8757('0x18')]();};}function respondWithResult(_0xd1ef69,_0x4f9730){_0x4f9730=_0x4f9730||0xc8;return function(_0x495177){if(_0x495177){return _0xd1ef69[_0x8757('0x17')](_0x4f9730)[_0x8757('0x19')](_0x495177);}};}function respondWithFilteredResult(_0x6de36b,_0x39c9a5){return function(_0x3ca76f){if(_0x3ca76f){var _0x549c32=_0x3ca76f[_0x8757('0x1a')],_0x51ac36=_0x39c9a5[_0x8757('0x1b')],_0x40f5f6=_0x39c9a5[_0x8757('0x1b')]+_0x39c9a5[_0x8757('0x1c')],_0xfda4ce;if(_0x40f5f6>=_0x549c32){_0x40f5f6=_0x549c32;_0xfda4ce=0xc8;}else{_0xfda4ce=0xce;}_0x6de36b['status'](_0xfda4ce);return _0x6de36b[_0x8757('0x1d')](_0x8757('0x1e'),_0x51ac36+'-'+_0x40f5f6+'/'+_0x549c32)[_0x8757('0x19')](_0x3ca76f);}return null;};}function patchUpdates(_0xa42f00){return function(_0x830703){try{jsonpatch['apply'](_0x830703,_0xa42f00,!![]);}catch(_0x7d395a){return BPromise[_0x8757('0x1f')](_0x7d395a);}return _0x830703[_0x8757('0x20')]();};}function saveUpdates(_0x469fe3,_0x5db4a3){return function(_0x1e5073){if(_0x1e5073){return _0x1e5073[_0x8757('0x21')](_0x469fe3)[_0x8757('0x22')](function(_0x3250c9){return _0x3250c9;});}return null;};}function removeEntity(_0x40d2b5,_0x1002fa){return function(_0x522050){if(_0x522050){return _0x522050['destroy']()[_0x8757('0x22')](function(){var _0x6f69bf=_0x522050[_0x8757('0x23')]({'plain':!![]});var _0x1a5df5=_0x8757('0x24');return db['UserProfileResource'][_0x8757('0x25')]({'where':{'type':_0x1a5df5,'resourceId':_0x6f69bf['id']}})[_0x8757('0x22')](function(){return _0x522050;});})[_0x8757('0x22')](function(){_0x40d2b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x330b58,_0x5118c0){return function(_0x1cc7c5){if(!_0x1cc7c5){_0x330b58[_0x8757('0x16')](0x194);}return _0x1cc7c5;};}function handleError(_0x542034,_0x4a759f){_0x4a759f=_0x4a759f||0x1f4;return function(_0x2a388c){logger[_0x8757('0x26')](_0x2a388c[_0x8757('0x27')]);if(_0x2a388c[_0x8757('0x28')]){delete _0x2a388c[_0x8757('0x28')];}_0x542034['status'](_0x4a759f)[_0x8757('0x29')](_0x2a388c);};}exports[_0x8757('0x2a')]=function(_0x28f893,_0x1f2b2f){var _0x5d37c6={},_0x4aa34c={},_0x1e488e={'count':0x0,'rows':[]};var _0x2819b4=_['map'](db[_0x8757('0x2b')]['rawAttributes'],function(_0xbb036f){return{'name':_0xbb036f[_0x8757('0x2c')],'type':_0xbb036f['type'][_0x8757('0x2d')]};});_0x4aa34c[_0x8757('0x2e')]=_[_0x8757('0x2f')](_0x2819b4,_0x8757('0x28'));_0x4aa34c[_0x8757('0x30')]=_[_0x8757('0x31')](_0x28f893[_0x8757('0x30')]);_0x4aa34c[_0x8757('0x32')]=_[_0x8757('0x33')](_0x4aa34c['model'],_0x4aa34c[_0x8757('0x30')]);_0x5d37c6[_0x8757('0x34')]=_[_0x8757('0x33')](_0x4aa34c[_0x8757('0x2e')],qs[_0x8757('0x35')](_0x28f893[_0x8757('0x30')][_0x8757('0x35')]));_0x5d37c6[_0x8757('0x34')]=_0x5d37c6[_0x8757('0x34')]['length']?_0x5d37c6[_0x8757('0x34')]:_0x4aa34c['model'];if(!_0x28f893['query'][_0x8757('0x36')](_0x8757('0x37'))){_0x5d37c6[_0x8757('0x1c')]=qs[_0x8757('0x1c')](_0x28f893[_0x8757('0x30')]['limit']);_0x5d37c6[_0x8757('0x1b')]=qs[_0x8757('0x1b')](_0x28f893[_0x8757('0x30')]['offset']);}_0x5d37c6[_0x8757('0x38')]=qs[_0x8757('0x39')](_0x28f893['query'][_0x8757('0x39')]);_0x5d37c6[_0x8757('0x3a')]=qs[_0x8757('0x32')](_[_0x8757('0x3b')](_0x28f893[_0x8757('0x30')],_0x4aa34c[_0x8757('0x32')]));if(_0x28f893['query'][_0x8757('0x3c')]){_0x5d37c6[_0x8757('0x3a')]=_[_0x8757('0x3d')](_0x5d37c6['where'],{'$or':_['map'](_0x2819b4,function(_0x5049b4){if(_0x5049b4['type']!==_0x8757('0x3e')){var _0x12c71b={};_0x12c71b[_0x5049b4[_0x8757('0x28')]]={'$like':'%'+_0x28f893['query'][_0x8757('0x3c')]+'%'};return _0x12c71b;}})});}_0x5d37c6=_['merge']({},_0x5d37c6,_0x28f893[_0x8757('0x3f')]);var _0xfb8086={'where':_0x5d37c6[_0x8757('0x3a')]};return db[_0x8757('0x2b')]['count'](_0xfb8086)[_0x8757('0x22')](function(_0x1ed624){_0x1e488e['count']=_0x1ed624;if(_0x28f893[_0x8757('0x30')][_0x8757('0x40')]){_0x5d37c6['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8757('0x41')](_0x5d37c6);})[_0x8757('0x22')](function(_0x2129a2){_0x1e488e[_0x8757('0x42')]=_0x2129a2;return _0x1e488e;})[_0x8757('0x22')](respondWithFilteredResult(_0x1f2b2f,_0x5d37c6))[_0x8757('0x43')](handleError(_0x1f2b2f,null));};exports['show']=function(_0x19b44b,_0x444aa6){var _0x47c36b={'raw':!![],'where':{'id':_0x19b44b['params']['id']}},_0x1c7f53={};_0x1c7f53[_0x8757('0x2e')]=_[_0x8757('0x31')](db[_0x8757('0x2b')]['rawAttributes']);_0x1c7f53[_0x8757('0x30')]=_[_0x8757('0x31')](_0x19b44b[_0x8757('0x30')]);_0x1c7f53[_0x8757('0x32')]=_[_0x8757('0x33')](_0x1c7f53[_0x8757('0x2e')],_0x1c7f53[_0x8757('0x30')]);_0x47c36b[_0x8757('0x34')]=_['intersection'](_0x1c7f53[_0x8757('0x2e')],qs['fields'](_0x19b44b[_0x8757('0x30')][_0x8757('0x35')]));_0x47c36b['attributes']=_0x47c36b[_0x8757('0x34')]['length']?_0x47c36b['attributes']:_0x1c7f53[_0x8757('0x2e')];if(_0x19b44b[_0x8757('0x30')][_0x8757('0x40')]){_0x47c36b[_0x8757('0x44')]=[{'all':!![]}];}_0x47c36b=_[_0x8757('0x3d')]({},_0x47c36b,_0x19b44b['options']);return db[_0x8757('0x2b')][_0x8757('0x45')](_0x47c36b)[_0x8757('0x22')](handleEntityNotFound(_0x444aa6,null))[_0x8757('0x22')](respondWithResult(_0x444aa6,null))['catch'](handleError(_0x444aa6,null));};exports[_0x8757('0x46')]=function(_0x430d9c,_0x30d0ff){return db[_0x8757('0x2b')][_0x8757('0x46')](_0x430d9c[_0x8757('0x47')],{})[_0x8757('0x22')](function(_0x488445){var _0x55a715=_0x430d9c[_0x8757('0x48')][_0x8757('0x23')]({'plain':!![]});if(!_0x55a715)throw new Error(_0x8757('0x49'));if(_0x55a715[_0x8757('0x4a')]===_0x8757('0x48')){var _0x409ad5=_0x488445[_0x8757('0x23')]({'plain':!![]});var _0x433dc4=_0x8757('0x24');return db[_0x8757('0x4b')][_0x8757('0x45')]({'where':{'name':_0x433dc4,'userProfileId':_0x55a715[_0x8757('0x4c')]},'raw':!![]})[_0x8757('0x22')](function(_0x6a755){if(_0x6a755&&_0x6a755[_0x8757('0x4d')]===0x0){return db[_0x8757('0x4e')]['create']({'name':_0x409ad5[_0x8757('0x28')],'resourceId':_0x409ad5['id'],'type':_0x6a755[_0x8757('0x28')],'sectionId':_0x6a755['id']},{})[_0x8757('0x22')](function(){return _0x488445;});}else{return _0x488445;}})['catch'](function(_0x47d4b5){logger['error'](_0x8757('0x4f'),_0x47d4b5);throw _0x47d4b5;});}return _0x488445;})[_0x8757('0x22')](respondWithResult(_0x30d0ff,0xc9))[_0x8757('0x43')](handleError(_0x30d0ff,null));};exports['update']=function(_0x56593b,_0x229f7c){if(_0x56593b[_0x8757('0x47')]['id']){delete _0x56593b[_0x8757('0x47')]['id'];}return db[_0x8757('0x2b')][_0x8757('0x45')]({'where':{'id':_0x56593b['params']['id']}})['then'](handleEntityNotFound(_0x229f7c,null))[_0x8757('0x22')](saveUpdates(_0x56593b[_0x8757('0x47')],null))[_0x8757('0x22')](respondWithResult(_0x229f7c,null))[_0x8757('0x43')](handleError(_0x229f7c,null));};exports[_0x8757('0x25')]=function(_0x75652a,_0x54b924){return db[_0x8757('0x2b')][_0x8757('0x45')]({'where':{'id':_0x75652a['params']['id']}})['then'](handleEntityNotFound(_0x54b924,null))['then'](removeEntity(_0x54b924,null))['catch'](handleError(_0x54b924,null));};exports[_0x8757('0x50')]=function(_0x78aa13,_0x441dd1,_0x41ff9){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x78aa13[_0x8757('0x51')]['id']},'attributes':[_0x8757('0x28'),_0x8757('0x52'),_0x8757('0x53'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x441dd1,null))[_0x8757('0x22')](function(_0x9aa1b9){if(_0x9aa1b9){if(!fs['existsSync'](path[_0x8757('0x54')](config[_0x8757('0x55')],_0x8757('0x56'),_0x9aa1b9['savename']))){throw new db['Sequelize'][(_0x8757('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x78aa13[_0x8757('0x30')][_0x8757('0x58')]){return _0x441dd1[_0x8757('0x16')](0xc8);}return _0x441dd1[_0x8757('0x50')](path[_0x8757('0x54')](config[_0x8757('0x55')],_0x8757('0x56'),_0x9aa1b9[_0x8757('0x53')]),util[_0x8757('0x59')](_0x8757('0x5a'),_0x9aa1b9[_0x8757('0x52')]||_0x9aa1b9[_0x8757('0x28')],_0x9aa1b9[_0x8757('0x5b')][_0x8757('0x5c')]()));}})[_0x8757('0x43')](handleError(_0x441dd1,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index a97b72a..cba0cab 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 _0x3889=['request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','moment','bluebird'];(function(_0x2dc96f,_0x459058){var _0xd012da=function(_0x38d032){while(--_0x38d032){_0x2dc96f['push'](_0x2dc96f['shift']());}};_0xd012da(++_0x459058);}(_0x3889,0x10f));var _0x9388=function(_0xb3f077,_0xc46f13){_0xb3f077=_0xb3f077-0x0;var _0x5c6b40=_0x3889[_0xb3f077];return _0x5c6b40;};'use strict';var _=require(_0x9388('0x0'));var util=require('util');var logger=require(_0x9388('0x1'))('api');var moment=require(_0x9388('0x2'));var BPromise=require(_0x9388('0x3'));var rp=require(_0x9388('0x4'));var fs=require('fs');var path=require(_0x9388('0x5'));var rimraf=require(_0x9388('0x6'));var config=require('../../config/environment');var attributes=require(_0x9388('0x7'));module[_0x9388('0x8')]=function(_0x1460e9,_0x591dbd){return _0x1460e9['define'](_0x9388('0x9'),attributes,{'tableName':_0x9388('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b11=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','../../config/logger'];(function(_0x34f545,_0x2bd2ee){var _0x1ff6b8=function(_0x582e3b){while(--_0x582e3b){_0x34f545['push'](_0x34f545['shift']());}};_0x1ff6b8(++_0x2bd2ee);}(_0x3b11,0x14f));var _0x13b1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3b11[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x13b1('0x0'));var util=require(_0x13b1('0x1'));var logger=require(_0x13b1('0x2'))(_0x13b1('0x3'));var moment=require(_0x13b1('0x4'));var BPromise=require('bluebird');var rp=require(_0x13b1('0x5'));var fs=require('fs');var path=require(_0x13b1('0x6'));var rimraf=require(_0x13b1('0x7'));var config=require(_0x13b1('0x8'));var attributes=require(_0x13b1('0x9'));module[_0x13b1('0xa')]=function(_0x194419,_0x465857){return _0x194419[_0x13b1('0xb')](_0x13b1('0xc'),attributes,{'tableName':'analytics_extracted_reports','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 76df45c..ce7b1e0 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 _0x8a85=['AnalyticExtractedReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x2c2d44,_0x297518){var _0x3a41e7=function(_0x5920e8){while(--_0x5920e8){_0x2c2d44['push'](_0x2c2d44['shift']());}};_0x3a41e7(++_0x297518);}(_0x8a85,0xcf));var _0x58a8=function(_0x225bc8,_0x2ad5f0){_0x225bc8=_0x225bc8-0x0;var _0x2ff1e3=_0x8a85[_0x225bc8];return _0x2ff1e3;};'use strict';var _=require(_0x58a8('0x0'));var util=require(_0x58a8('0x1'));var moment=require(_0x58a8('0x2'));var BPromise=require(_0x58a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58a8('0x4'))['db'];var utils=require(_0x58a8('0x5'));var logger=require(_0x58a8('0x6'))(_0x58a8('0x7'));var config=require('../../config/environment');var jayson=require(_0x58a8('0x8'));var client=jayson[_0x58a8('0x9')][_0x58a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fa3c2,_0x25981a,_0x5b7537){return new BPromise(function(_0x440196,_0x58d8b5){return client[_0x58a8('0xb')](_0x3fa3c2,_0x5b7537)[_0x58a8('0xc')](function(_0x15431c){logger['info'](_0x58a8('0xd'),_0x25981a,'request\x20sent');logger[_0x58a8('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x25981a,_0x58a8('0xf'),JSON[_0x58a8('0x10')](_0x15431c));if(_0x15431c['error']){if(_0x15431c[_0x58a8('0x11')]['code']===0x1f4){logger[_0x58a8('0x11')](_0x58a8('0xd'),_0x25981a,_0x15431c[_0x58a8('0x11')]['message']);return _0x58d8b5(_0x15431c[_0x58a8('0x11')][_0x58a8('0x12')]);}logger[_0x58a8('0x11')](_0x58a8('0xd'),_0x25981a,_0x15431c[_0x58a8('0x11')]['message']);return _0x440196(_0x15431c[_0x58a8('0x11')][_0x58a8('0x12')]);}else{logger[_0x58a8('0x13')](_0x58a8('0xd'),_0x25981a,_0x58a8('0xf'));_0x440196(_0x15431c[_0x58a8('0x14')][_0x58a8('0x12')]);}})[_0x58a8('0x15')](function(_0x3fb0a2){logger[_0x58a8('0x11')](_0x58a8('0xd'),_0x25981a,_0x3fb0a2);_0x58d8b5(_0x3fb0a2);});});} \ No newline at end of file +var _0x80b3=['rpc','../../config/environment','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0x80b3,0xeb));var _0x380b=function(_0x447a05,_0x2c7bfe){_0x447a05=_0x447a05-0x0;var _0x55727b=_0x80b3[_0x447a05];return _0x55727b;};'use strict';var _=require(_0x380b('0x0'));var util=require(_0x380b('0x1'));var moment=require(_0x380b('0x2'));var BPromise=require('bluebird');var rs=require(_0x380b('0x3'));var fs=require('fs');var Redis=require(_0x380b('0x4'));var db=require(_0x380b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x380b('0x6'))(_0x380b('0x7'));var config=require(_0x380b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x380b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x722115,_0x479fdc,_0x1ddc0f){return new BPromise(function(_0x379eac,_0x560e1e){return client[_0x380b('0xa')](_0x722115,_0x1ddc0f)[_0x380b('0xb')](function(_0x5909d5){logger[_0x380b('0xc')](_0x380b('0xd'),_0x479fdc,_0x380b('0xe'));logger['debug'](_0x380b('0xf'),_0x479fdc,_0x380b('0xe'),JSON[_0x380b('0x10')](_0x5909d5));if(_0x5909d5[_0x380b('0x11')]){if(_0x5909d5[_0x380b('0x11')][_0x380b('0x12')]===0x1f4){logger[_0x380b('0x11')](_0x380b('0xd'),_0x479fdc,_0x5909d5[_0x380b('0x11')][_0x380b('0x13')]);return _0x560e1e(_0x5909d5[_0x380b('0x11')][_0x380b('0x13')]);}logger['error'](_0x380b('0xd'),_0x479fdc,_0x5909d5['error'][_0x380b('0x13')]);return _0x379eac(_0x5909d5[_0x380b('0x11')][_0x380b('0x13')]);}else{logger[_0x380b('0xc')](_0x380b('0xd'),_0x479fdc,_0x380b('0xe'));_0x379eac(_0x5909d5[_0x380b('0x14')][_0x380b('0x13')]);}})[_0x380b('0x15')](function(_0xfb7146){logger['error'](_0x380b('0xd'),_0x479fdc,_0xfb7146);_0x560e1e(_0xfb7146);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index d861380..990b27e 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 _0x1f15=['destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','isAuthenticated','/:id/download','download','post','create','put','/:id','delete'];(function(_0x2d5411,_0x1a439f){var _0x4f13d7=function(_0x2523c4){while(--_0x2523c4){_0x2d5411['push'](_0x2d5411['shift']());}};_0x4f13d7(++_0x1a439f);}(_0x1f15,0xe6));var _0x51f1=function(_0x54a6d7,_0x599ea8){_0x54a6d7=_0x54a6d7-0x0;var _0x6da2b8=_0x1f15[_0x54a6d7];return _0x6da2b8;};'use strict';var multer=require(_0x51f1('0x0'));var util=require(_0x51f1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x51f1('0x2'));var router=express['Router']();var auth=require(_0x51f1('0x3'));var interaction=require(_0x51f1('0x4'));var config=require(_0x51f1('0x5'));var controller=require(_0x51f1('0x6'));router[_0x51f1('0x7')]('/',auth['isAuthenticated'](),controller[_0x51f1('0x8')]);router[_0x51f1('0x7')]('/:id',auth[_0x51f1('0x9')](),controller['show']);router[_0x51f1('0x7')](_0x51f1('0xa'),auth[_0x51f1('0x9')](),controller[_0x51f1('0xb')]);router[_0x51f1('0xc')]('/',auth['isAuthenticated'](),controller[_0x51f1('0xd')]);router[_0x51f1('0xe')](_0x51f1('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x51f1('0x10')](_0x51f1('0xf'),auth[_0x51f1('0x9')](),controller[_0x51f1('0x11')]);module[_0x51f1('0x12')]=router; \ No newline at end of file +var _0x5bb7=['show','/:id/download','download','post','create','put','update','destroy','multer','path','connect-timeout','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id'];(function(_0x464a12,_0x222e43){var _0x22342d=function(_0x2dbfe9){while(--_0x2dbfe9){_0x464a12['push'](_0x464a12['shift']());}};_0x22342d(++_0x222e43);}(_0x5bb7,0x104));var _0x75bb=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x5bb7[_0x1fc122];return _0xa2cb13;};'use strict';var multer=require(_0x75bb('0x0'));var util=require('util');var path=require(_0x75bb('0x1'));var timeout=require(_0x75bb('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x75bb('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x75bb('0x4'));var controller=require(_0x75bb('0x5'));router[_0x75bb('0x6')]('/',auth[_0x75bb('0x7')](),controller[_0x75bb('0x8')]);router[_0x75bb('0x6')](_0x75bb('0x9'),auth['isAuthenticated'](),controller[_0x75bb('0xa')]);router[_0x75bb('0x6')](_0x75bb('0xb'),auth[_0x75bb('0x7')](),controller[_0x75bb('0xc')]);router[_0x75bb('0xd')]('/',auth[_0x75bb('0x7')](),controller[_0x75bb('0xe')]);router[_0x75bb('0xf')]('/:id',auth[_0x75bb('0x7')](),controller[_0x75bb('0x10')]);router['delete'](_0x75bb('0x9'),auth[_0x75bb('0x7')](),controller[_0x75bb('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 0fc3332..1dc1e15 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(_0x5a1b1a,_0x5d9c67){var _0x43f8cd=function(_0x416704){while(--_0x416704){_0x5a1b1a['push'](_0x5a1b1a['shift']());}};_0x43f8cd(++_0x5d9c67);}(_0x1261,0x144));var _0x1126=function(_0x447ce1,_0x11cf0b){_0x447ce1=_0x447ce1-0x0;var _0x4c1e7a=_0x1261[_0x447ce1];return _0x4c1e7a;};'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 _0x7a54=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x37705d,_0x227651){var _0x164028=function(_0x266b8b){while(--_0x266b8b){_0x37705d['push'](_0x37705d['shift']());}};_0x164028(++_0x227651);}(_0x7a54,0x106));var _0x47a5=function(_0x4c79d4,_0x2a8eb8){_0x4c79d4=_0x4c79d4-0x0;var _0x4af30b=_0x7a54[_0x4c79d4];return _0x4af30b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'field':{'type':Sequelize[_0x47a5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x47a5('0x3')]},'format':{'type':Sequelize[_0x47a5('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x47a5('0x3')]},'custom':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 76ae038..d51e18c 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 _0xcb22=['stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','create','bulkCreate','body','update','find','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','apply','reject','then','destroy','error'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0xcb22,0xc8));var _0x2cb2=function(_0x5d0140,_0xe77bbb){_0x5d0140=_0x5d0140-0x0;var _0x503aab=_0xcb22[_0x5d0140];return _0x503aab;};'use strict';var pdf=require(_0x2cb2('0x0'));var emlformat=require(_0x2cb2('0x1'));var rimraf=require(_0x2cb2('0x2'));var zipdir=require(_0x2cb2('0x3'));var jsonpatch=require(_0x2cb2('0x4'));var rp=require(_0x2cb2('0x5'));var moment=require(_0x2cb2('0x6'));var BPromise=require(_0x2cb2('0x7'));var Mustache=require(_0x2cb2('0x8'));var util=require(_0x2cb2('0x9'));var path=require(_0x2cb2('0xa'));var sox=require('sox');var csv=require(_0x2cb2('0xb'));var ejs=require(_0x2cb2('0xc'));var fs=require('fs');var _=require(_0x2cb2('0xd'));var squel=require(_0x2cb2('0xe'));var crypto=require(_0x2cb2('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2cb2('0x10'));var toCsv=require(_0x2cb2('0xb'));var querystring=require('querystring');var Papa=require(_0x2cb2('0x11'));var Redis=require(_0x2cb2('0x12'));var authService=require(_0x2cb2('0x13'));var qs=require(_0x2cb2('0x14'));var as=require(_0x2cb2('0x15'));var hardwareService=require(_0x2cb2('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x2cb2('0x17'));var config=require(_0x2cb2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c8728,_0x9311fa){_0x9311fa=_0x9311fa||0xcc;return function(_0x50253a){if(_0x50253a){return _0x4c8728[_0x2cb2('0x19')](_0x9311fa);}return _0x4c8728['status'](_0x9311fa)[_0x2cb2('0x1a')]();};}function respondWithResult(_0x22cb3d,_0x529c51){_0x529c51=_0x529c51||0xc8;return function(_0x3b423a){if(_0x3b423a){return _0x22cb3d[_0x2cb2('0x1b')](_0x529c51)[_0x2cb2('0x1c')](_0x3b423a);}};}function respondWithFilteredResult(_0x52fee2,_0xeed9cf){return function(_0x62121){if(_0x62121){var _0x58d9b4=_0x62121[_0x2cb2('0x1d')],_0x181ef1=_0xeed9cf[_0x2cb2('0x1e')],_0x4aa895=_0xeed9cf[_0x2cb2('0x1e')]+_0xeed9cf[_0x2cb2('0x1f')],_0xac72c4;if(_0x4aa895>=_0x58d9b4){_0x4aa895=_0x58d9b4;_0xac72c4=0xc8;}else{_0xac72c4=0xce;}_0x52fee2[_0x2cb2('0x1b')](_0xac72c4);return _0x52fee2['set']('Content-Range',_0x181ef1+'-'+_0x4aa895+'/'+_0x58d9b4)['json'](_0x62121);}return null;};}function patchUpdates(_0x488ae5){return function(_0x15708b){try{jsonpatch[_0x2cb2('0x20')](_0x15708b,_0x488ae5,!![]);}catch(_0x2674d3){return BPromise[_0x2cb2('0x21')](_0x2674d3);}return _0x15708b['save']();};}function saveUpdates(_0x1300d7,_0x10bd4a){return function(_0x195de5){if(_0x195de5){return _0x195de5['update'](_0x1300d7)[_0x2cb2('0x22')](function(_0x42a222){return _0x42a222;});}return null;};}function removeEntity(_0x3203fb,_0x2c1831){return function(_0x161cdf){if(_0x161cdf){return _0x161cdf[_0x2cb2('0x23')]()['then'](function(){_0x3203fb[_0x2cb2('0x1b')](0xcc)[_0x2cb2('0x1a')]();});}};}function handleEntityNotFound(_0x2ebb59,_0x3f43bd){return function(_0x1365f8){if(!_0x1365f8){_0x2ebb59[_0x2cb2('0x19')](0x194);}return _0x1365f8;};}function handleError(_0x2a3599,_0x1e19be){_0x1e19be=_0x1e19be||0x1f4;return function(_0x512dc2){logger[_0x2cb2('0x24')](_0x512dc2[_0x2cb2('0x25')]);if(_0x512dc2[_0x2cb2('0x26')]){delete _0x512dc2[_0x2cb2('0x26')];}_0x2a3599[_0x2cb2('0x1b')](_0x1e19be)[_0x2cb2('0x27')](_0x512dc2);};}exports[_0x2cb2('0x28')]=function(_0x4673dd,_0x779ae3){var _0x4e4eff={},_0x46db09={},_0x4f5192={'count':0x0,'rows':[]};var _0x279bd2=_[_0x2cb2('0x29')](db[_0x2cb2('0x2a')][_0x2cb2('0x2b')],function(_0x1dd178){return{'name':_0x1dd178[_0x2cb2('0x2c')],'type':_0x1dd178[_0x2cb2('0x2d')][_0x2cb2('0x2e')]};});_0x46db09[_0x2cb2('0x2f')]=_['map'](_0x279bd2,'name');_0x46db09[_0x2cb2('0x30')]=_['keys'](_0x4673dd[_0x2cb2('0x30')]);_0x46db09['filters']=_['intersection'](_0x46db09[_0x2cb2('0x2f')],_0x46db09[_0x2cb2('0x30')]);_0x4e4eff[_0x2cb2('0x31')]=_[_0x2cb2('0x32')](_0x46db09[_0x2cb2('0x2f')],qs[_0x2cb2('0x33')](_0x4673dd[_0x2cb2('0x30')][_0x2cb2('0x33')]));_0x4e4eff[_0x2cb2('0x31')]=_0x4e4eff['attributes'][_0x2cb2('0x34')]?_0x4e4eff[_0x2cb2('0x31')]:_0x46db09['model'];if(!_0x4673dd[_0x2cb2('0x30')][_0x2cb2('0x35')](_0x2cb2('0x36'))){_0x4e4eff['limit']=qs['limit'](_0x4673dd[_0x2cb2('0x30')][_0x2cb2('0x1f')]);_0x4e4eff[_0x2cb2('0x1e')]=qs['offset'](_0x4673dd[_0x2cb2('0x30')][_0x2cb2('0x1e')]);}_0x4e4eff['order']=qs['sort'](_0x4673dd[_0x2cb2('0x30')][_0x2cb2('0x37')]);_0x4e4eff[_0x2cb2('0x38')]=qs['filters'](_['pick'](_0x4673dd[_0x2cb2('0x30')],_0x46db09[_0x2cb2('0x39')]));if(_0x4673dd[_0x2cb2('0x30')][_0x2cb2('0x3a')]){_0x4e4eff[_0x2cb2('0x38')]=_['merge'](_0x4e4eff[_0x2cb2('0x38')],{'$or':_[_0x2cb2('0x29')](_0x279bd2,function(_0x10083e){if(_0x10083e['type']!=='VIRTUAL'){var _0x2c6012={};_0x2c6012[_0x10083e[_0x2cb2('0x26')]]={'$like':'%'+_0x4673dd[_0x2cb2('0x30')][_0x2cb2('0x3a')]+'%'};return _0x2c6012;}})});}_0x4e4eff=_[_0x2cb2('0x3b')]({},_0x4e4eff,_0x4673dd[_0x2cb2('0x3c')]);var _0x56baa2={'where':_0x4e4eff[_0x2cb2('0x38')]};return db[_0x2cb2('0x2a')][_0x2cb2('0x1d')](_0x56baa2)[_0x2cb2('0x22')](function(_0x1002c3){_0x4f5192[_0x2cb2('0x1d')]=_0x1002c3;if(_0x4673dd[_0x2cb2('0x30')][_0x2cb2('0x3d')]){_0x4e4eff[_0x2cb2('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x2cb2('0x3f')](_0x4e4eff);})['then'](function(_0x1b45d0){_0x4f5192['rows']=_0x1b45d0;return _0x4f5192;})[_0x2cb2('0x22')](respondWithFilteredResult(_0x779ae3,_0x4e4eff))[_0x2cb2('0x40')](handleError(_0x779ae3,null));};exports[_0x2cb2('0x41')]=function(_0x4f66cc,_0x2e4135){var _0x39a6ff={'raw':![],'where':{'id':_0x4f66cc[_0x2cb2('0x42')]['id']}},_0x113957={};_0x113957[_0x2cb2('0x2f')]=_[_0x2cb2('0x43')](db[_0x2cb2('0x2a')][_0x2cb2('0x2b')]);_0x113957[_0x2cb2('0x30')]=_['keys'](_0x4f66cc[_0x2cb2('0x30')]);_0x113957[_0x2cb2('0x39')]=_['intersection'](_0x113957['model'],_0x113957[_0x2cb2('0x30')]);_0x39a6ff[_0x2cb2('0x31')]=_['intersection'](_0x113957[_0x2cb2('0x2f')],qs[_0x2cb2('0x33')](_0x4f66cc['query']['fields']));_0x39a6ff[_0x2cb2('0x31')]=_0x39a6ff[_0x2cb2('0x31')]['length']?_0x39a6ff[_0x2cb2('0x31')]:_0x113957[_0x2cb2('0x2f')];if(_0x4f66cc['query']['includeAll']){_0x39a6ff['include']=[{'all':!![]}];}_0x39a6ff=_['merge']({},_0x39a6ff,_0x4f66cc[_0x2cb2('0x3c')]);return db[_0x2cb2('0x2a')]['find'](_0x39a6ff)[_0x2cb2('0x22')](handleEntityNotFound(_0x2e4135,null))[_0x2cb2('0x22')](respondWithResult(_0x2e4135,null))[_0x2cb2('0x40')](handleError(_0x2e4135,null));};exports[_0x2cb2('0x44')]=function(_0x38f0f3,_0x49f83f){return db[_0x2cb2('0x2a')]['create'](_0x38f0f3['body'],{})['then'](respondWithResult(_0x49f83f,0xc9))['catch'](handleError(_0x49f83f,null));};exports[_0x2cb2('0x45')]=function(_0x118a7a,_0x71d263){return db[_0x2cb2('0x2a')]['bulkCreate'](_0x118a7a[_0x2cb2('0x46')],{'raw':![],'individualHooks':!![]})[_0x2cb2('0x22')](respondWithResult(_0x71d263,0xc9))[_0x2cb2('0x40')](handleError(_0x71d263,null));};exports[_0x2cb2('0x47')]=function(_0x485cca,_0x41ec95){if(_0x485cca[_0x2cb2('0x46')]['id']){delete _0x485cca['body']['id'];}return db['AnalyticFieldReport'][_0x2cb2('0x48')]({'where':{'id':_0x485cca[_0x2cb2('0x42')]['id']}})[_0x2cb2('0x22')](handleEntityNotFound(_0x41ec95,null))[_0x2cb2('0x22')](saveUpdates(_0x485cca['body'],null))['then'](respondWithResult(_0x41ec95,null))[_0x2cb2('0x40')](handleError(_0x41ec95,null));};exports[_0x2cb2('0x23')]=function(_0x3ae8ab,_0x252f6a){return db[_0x2cb2('0x2a')][_0x2cb2('0x48')]({'where':{'id':_0x3ae8ab[_0x2cb2('0x42')]['id']}})[_0x2cb2('0x22')](handleEntityNotFound(_0x252f6a,null))[_0x2cb2('0x22')](removeEntity(_0x252f6a,null))[_0x2cb2('0x40')](handleError(_0x252f6a,null));};exports[_0x2cb2('0x49')]=function(_0x1fd5e7,_0x2f9ec2){return db['AnalyticFieldReport'][_0x2cb2('0x23')]({'where':{'id':_0x1fd5e7['query'][_0x2cb2('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x2cb2('0x22')](respondWithResult(_0x2f9ec2,0xcc))[_0x2cb2('0x40')](handleError(_0x2f9ec2,null));};exports['addFields']=function(_0x21ea63,_0x36d3b6,_0xe95663){return db[_0x2cb2('0x4b')][_0x2cb2('0x4c')]({'where':{'id':_0x21ea63[_0x2cb2('0x42')]['id']}})[_0x2cb2('0x22')](handleEntityNotFound(_0x36d3b6,null))['then'](function(_0x346315){if(_0x346315){return db[_0x2cb2('0x4d')]['transaction'](function(_0xec11ba){return db[_0x2cb2('0x2a')]['destroy']({'where':{'CustomReportId':_0x21ea63[_0x2cb2('0x42')]['id']},'transaction':_0xec11ba})[_0x2cb2('0x22')](function(_0xdfb7ef){var _0xf2df2b=_[_0x2cb2('0x29')](_0x21ea63[_0x2cb2('0x46')],function(_0xb5f165){delete _0xb5f165['id'];_0xb5f165[_0x2cb2('0x4e')]=_0x21ea63[_0x2cb2('0x42')]['id'];return _0xb5f165;});return db['AnalyticFieldReport'][_0x2cb2('0x45')](_0xf2df2b,{'transaction':_0xec11ba});});})[_0x2cb2('0x22')](function(){return db[_0x2cb2('0x2a')][_0x2cb2('0x3f')]({'where':{'CustomReportId':_0x21ea63[_0x2cb2('0x42')]['id']}});});}})['then'](respondWithResult(_0x36d3b6,null))['catch'](handleError(_0x36d3b6,null));}; \ No newline at end of file +var _0xdcdb=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','bulkCreate','params','bulkDestroy','ids','AnalyticCustomReport','transaction','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','then','destroy','end','error','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter'];(function(_0x46effc,_0x4886f5){var _0x5a985f=function(_0x1af692){while(--_0x1af692){_0x46effc['push'](_0x46effc['shift']());}};_0x5a985f(++_0x4886f5);}(_0xdcdb,0x64));var _0xbdcd=function(_0x22dd90,_0x538096){_0x22dd90=_0x22dd90-0x0;var _0x15361f=_0xdcdb[_0x22dd90];return _0x15361f;};'use strict';var pdf=require(_0xbdcd('0x0'));var emlformat=require(_0xbdcd('0x1'));var rimraf=require(_0xbdcd('0x2'));var zipdir=require(_0xbdcd('0x3'));var jsonpatch=require(_0xbdcd('0x4'));var rp=require(_0xbdcd('0x5'));var moment=require(_0xbdcd('0x6'));var BPromise=require(_0xbdcd('0x7'));var Mustache=require(_0xbdcd('0x8'));var util=require(_0xbdcd('0x9'));var path=require(_0xbdcd('0xa'));var sox=require(_0xbdcd('0xb'));var csv=require(_0xbdcd('0xc'));var ejs=require(_0xbdcd('0xd'));var fs=require('fs');var _=require(_0xbdcd('0xe'));var squel=require(_0xbdcd('0xf'));var crypto=require(_0xbdcd('0x10'));var jsforce=require(_0xbdcd('0x11'));var deskjs=require(_0xbdcd('0x12'));var toCsv=require(_0xbdcd('0xc'));var querystring=require('querystring');var Papa=require(_0xbdcd('0x13'));var Redis=require(_0xbdcd('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xbdcd('0x15'));var as=require(_0xbdcd('0x16'));var hardwareService=require(_0xbdcd('0x17'));var logger=require(_0xbdcd('0x18'))(_0xbdcd('0x19'));var utils=require(_0xbdcd('0x1a'));var config=require(_0xbdcd('0x1b'));var db=require(_0xbdcd('0x1c'))['db'];function respondWithStatusCode(_0x4f55f3,_0x353c5f){_0x353c5f=_0x353c5f||0xcc;return function(_0x5860cb){if(_0x5860cb){return _0x4f55f3[_0xbdcd('0x1d')](_0x353c5f);}return _0x4f55f3['status'](_0x353c5f)['end']();};}function respondWithResult(_0x19447f,_0x5412fb){_0x5412fb=_0x5412fb||0xc8;return function(_0x408017){if(_0x408017){return _0x19447f[_0xbdcd('0x1e')](_0x5412fb)['json'](_0x408017);}};}function respondWithFilteredResult(_0x2a17d1,_0x294a4e){return function(_0x75f924){if(_0x75f924){var _0x147261=_0x75f924[_0xbdcd('0x1f')],_0x500fb9=_0x294a4e[_0xbdcd('0x20')],_0x29a41f=_0x294a4e[_0xbdcd('0x20')]+_0x294a4e[_0xbdcd('0x21')],_0x1160d9;if(_0x29a41f>=_0x147261){_0x29a41f=_0x147261;_0x1160d9=0xc8;}else{_0x1160d9=0xce;}_0x2a17d1[_0xbdcd('0x1e')](_0x1160d9);return _0x2a17d1[_0xbdcd('0x22')](_0xbdcd('0x23'),_0x500fb9+'-'+_0x29a41f+'/'+_0x147261)[_0xbdcd('0x24')](_0x75f924);}return null;};}function patchUpdates(_0x4f5c5c){return function(_0x5d86c1){try{jsonpatch['apply'](_0x5d86c1,_0x4f5c5c,!![]);}catch(_0x4135bc){return BPromise[_0xbdcd('0x25')](_0x4135bc);}return _0x5d86c1[_0xbdcd('0x26')]();};}function saveUpdates(_0x3a96c0,_0x2835b4){return function(_0x2111c9){if(_0x2111c9){return _0x2111c9['update'](_0x3a96c0)[_0xbdcd('0x27')](function(_0x30bb5e){return _0x30bb5e;});}return null;};}function removeEntity(_0x2f095e,_0x779716){return function(_0x143e03){if(_0x143e03){return _0x143e03[_0xbdcd('0x28')]()[_0xbdcd('0x27')](function(){_0x2f095e[_0xbdcd('0x1e')](0xcc)[_0xbdcd('0x29')]();});}};}function handleEntityNotFound(_0x4c67da,_0x868c1){return function(_0x3dc2c2){if(!_0x3dc2c2){_0x4c67da[_0xbdcd('0x1d')](0x194);}return _0x3dc2c2;};}function handleError(_0x1be8e6,_0x1a2911){_0x1a2911=_0x1a2911||0x1f4;return function(_0x2f3fb8){logger[_0xbdcd('0x2a')](_0x2f3fb8['stack']);if(_0x2f3fb8['name']){delete _0x2f3fb8['name'];}_0x1be8e6['status'](_0x1a2911)['send'](_0x2f3fb8);};}exports[_0xbdcd('0x2b')]=function(_0x3bd413,_0x5949ef){var _0x358751={},_0x92a778={},_0x38a31f={'count':0x0,'rows':[]};var _0x580473=_[_0xbdcd('0x2c')](db[_0xbdcd('0x2d')][_0xbdcd('0x2e')],function(_0x4a9f02){return{'name':_0x4a9f02[_0xbdcd('0x2f')],'type':_0x4a9f02[_0xbdcd('0x30')]['key']};});_0x92a778[_0xbdcd('0x31')]=_[_0xbdcd('0x2c')](_0x580473,_0xbdcd('0x32'));_0x92a778[_0xbdcd('0x33')]=_[_0xbdcd('0x34')](_0x3bd413[_0xbdcd('0x33')]);_0x92a778[_0xbdcd('0x35')]=_[_0xbdcd('0x36')](_0x92a778['model'],_0x92a778[_0xbdcd('0x33')]);_0x358751[_0xbdcd('0x37')]=_['intersection'](_0x92a778[_0xbdcd('0x31')],qs['fields'](_0x3bd413['query'][_0xbdcd('0x38')]));_0x358751[_0xbdcd('0x37')]=_0x358751[_0xbdcd('0x37')][_0xbdcd('0x39')]?_0x358751['attributes']:_0x92a778[_0xbdcd('0x31')];if(!_0x3bd413[_0xbdcd('0x33')]['hasOwnProperty'](_0xbdcd('0x3a'))){_0x358751[_0xbdcd('0x21')]=qs['limit'](_0x3bd413[_0xbdcd('0x33')][_0xbdcd('0x21')]);_0x358751[_0xbdcd('0x20')]=qs[_0xbdcd('0x20')](_0x3bd413[_0xbdcd('0x33')][_0xbdcd('0x20')]);}_0x358751[_0xbdcd('0x3b')]=qs[_0xbdcd('0x3c')](_0x3bd413[_0xbdcd('0x33')][_0xbdcd('0x3c')]);_0x358751[_0xbdcd('0x3d')]=qs[_0xbdcd('0x35')](_[_0xbdcd('0x3e')](_0x3bd413['query'],_0x92a778[_0xbdcd('0x35')]));if(_0x3bd413[_0xbdcd('0x33')][_0xbdcd('0x3f')]){_0x358751[_0xbdcd('0x3d')]=_[_0xbdcd('0x40')](_0x358751['where'],{'$or':_[_0xbdcd('0x2c')](_0x580473,function(_0x11fca5){if(_0x11fca5[_0xbdcd('0x30')]!==_0xbdcd('0x41')){var _0x36997e={};_0x36997e[_0x11fca5[_0xbdcd('0x32')]]={'$like':'%'+_0x3bd413[_0xbdcd('0x33')][_0xbdcd('0x3f')]+'%'};return _0x36997e;}})});}_0x358751=_['merge']({},_0x358751,_0x3bd413[_0xbdcd('0x42')]);var _0x1fe32c={'where':_0x358751[_0xbdcd('0x3d')]};return db[_0xbdcd('0x2d')][_0xbdcd('0x1f')](_0x1fe32c)[_0xbdcd('0x27')](function(_0x30721f){_0x38a31f[_0xbdcd('0x1f')]=_0x30721f;if(_0x3bd413['query'][_0xbdcd('0x43')]){_0x358751[_0xbdcd('0x44')]=[{'all':!![]}];}return db[_0xbdcd('0x2d')][_0xbdcd('0x45')](_0x358751);})[_0xbdcd('0x27')](function(_0x2bb918){_0x38a31f[_0xbdcd('0x46')]=_0x2bb918;return _0x38a31f;})['then'](respondWithFilteredResult(_0x5949ef,_0x358751))[_0xbdcd('0x47')](handleError(_0x5949ef,null));};exports[_0xbdcd('0x48')]=function(_0x14d67a,_0x10ab68){var _0x22998e={'raw':![],'where':{'id':_0x14d67a['params']['id']}},_0x585793={};_0x585793[_0xbdcd('0x31')]=_[_0xbdcd('0x34')](db[_0xbdcd('0x2d')][_0xbdcd('0x2e')]);_0x585793['query']=_[_0xbdcd('0x34')](_0x14d67a[_0xbdcd('0x33')]);_0x585793[_0xbdcd('0x35')]=_['intersection'](_0x585793[_0xbdcd('0x31')],_0x585793['query']);_0x22998e[_0xbdcd('0x37')]=_[_0xbdcd('0x36')](_0x585793[_0xbdcd('0x31')],qs[_0xbdcd('0x38')](_0x14d67a[_0xbdcd('0x33')][_0xbdcd('0x38')]));_0x22998e['attributes']=_0x22998e[_0xbdcd('0x37')][_0xbdcd('0x39')]?_0x22998e[_0xbdcd('0x37')]:_0x585793[_0xbdcd('0x31')];if(_0x14d67a[_0xbdcd('0x33')][_0xbdcd('0x43')]){_0x22998e[_0xbdcd('0x44')]=[{'all':!![]}];}_0x22998e=_[_0xbdcd('0x40')]({},_0x22998e,_0x14d67a['options']);return db[_0xbdcd('0x2d')][_0xbdcd('0x49')](_0x22998e)[_0xbdcd('0x27')](handleEntityNotFound(_0x10ab68,null))[_0xbdcd('0x27')](respondWithResult(_0x10ab68,null))[_0xbdcd('0x47')](handleError(_0x10ab68,null));};exports[_0xbdcd('0x4a')]=function(_0x581bb6,_0x4b80de){return db[_0xbdcd('0x2d')]['create'](_0x581bb6[_0xbdcd('0x4b')],{})[_0xbdcd('0x27')](respondWithResult(_0x4b80de,0xc9))[_0xbdcd('0x47')](handleError(_0x4b80de,null));};exports[_0xbdcd('0x4c')]=function(_0x10a354,_0x9b1170){return db[_0xbdcd('0x2d')][_0xbdcd('0x4c')](_0x10a354[_0xbdcd('0x4b')],{'raw':![],'individualHooks':!![]})[_0xbdcd('0x27')](respondWithResult(_0x9b1170,0xc9))[_0xbdcd('0x47')](handleError(_0x9b1170,null));};exports['update']=function(_0x31941a,_0x3bd0f5){if(_0x31941a[_0xbdcd('0x4b')]['id']){delete _0x31941a[_0xbdcd('0x4b')]['id'];}return db[_0xbdcd('0x2d')][_0xbdcd('0x49')]({'where':{'id':_0x31941a[_0xbdcd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3bd0f5,null))[_0xbdcd('0x27')](saveUpdates(_0x31941a[_0xbdcd('0x4b')],null))['then'](respondWithResult(_0x3bd0f5,null))[_0xbdcd('0x47')](handleError(_0x3bd0f5,null));};exports[_0xbdcd('0x28')]=function(_0xcc52ba,_0x169805){return db[_0xbdcd('0x2d')]['find']({'where':{'id':_0xcc52ba['params']['id']}})[_0xbdcd('0x27')](handleEntityNotFound(_0x169805,null))[_0xbdcd('0x27')](removeEntity(_0x169805,null))[_0xbdcd('0x47')](handleError(_0x169805,null));};exports[_0xbdcd('0x4e')]=function(_0x21dd58,_0x5df1b6){return db[_0xbdcd('0x2d')][_0xbdcd('0x28')]({'where':{'id':_0x21dd58[_0xbdcd('0x33')][_0xbdcd('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0xbdcd('0x27')](respondWithResult(_0x5df1b6,0xcc))[_0xbdcd('0x47')](handleError(_0x5df1b6,null));};exports['addFields']=function(_0x3bc32b,_0x311afd,_0x7ca95e){return db[_0xbdcd('0x50')]['findOne']({'where':{'id':_0x3bc32b['params']['id']}})[_0xbdcd('0x27')](handleEntityNotFound(_0x311afd,null))[_0xbdcd('0x27')](function(_0x160dd1){if(_0x160dd1){return db['sequelize'][_0xbdcd('0x51')](function(_0x58b964){return db[_0xbdcd('0x2d')][_0xbdcd('0x28')]({'where':{'CustomReportId':_0x3bc32b[_0xbdcd('0x4d')]['id']},'transaction':_0x58b964})[_0xbdcd('0x27')](function(_0x4ef0ab){var _0x132a47=_['map'](_0x3bc32b[_0xbdcd('0x4b')],function(_0x217e76){delete _0x217e76['id'];_0x217e76['CustomReportId']=_0x3bc32b[_0xbdcd('0x4d')]['id'];return _0x217e76;});return db['AnalyticFieldReport'][_0xbdcd('0x4c')](_0x132a47,{'transaction':_0x58b964});});})[_0xbdcd('0x27')](function(){return db['AnalyticFieldReport'][_0xbdcd('0x45')]({'where':{'CustomReportId':_0x3bc32b[_0xbdcd('0x4d')]['id']}});});}})[_0xbdcd('0x27')](respondWithResult(_0x311afd,null))['catch'](handleError(_0x311afd,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 1e8f4b0..9981f91 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 _0xc2bb=['../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x1ce546,_0x1b34e3){var _0x271648=function(_0x27458d){while(--_0x27458d){_0x1ce546['push'](_0x1ce546['shift']());}};_0x271648(++_0x1b34e3);}(_0xc2bb,0x131));var _0xbc2b=function(_0xaa99fe,_0x358171){_0xaa99fe=_0xaa99fe-0x0;var _0x4bdc46=_0xc2bb[_0xaa99fe];return _0x4bdc46;};'use strict';var _=require(_0xbc2b('0x0'));var util=require(_0xbc2b('0x1'));var logger=require('../../config/logger')(_0xbc2b('0x2'));var moment=require(_0xbc2b('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc2b('0x4'));var fs=require('fs');var path=require(_0xbc2b('0x5'));var rimraf=require(_0xbc2b('0x6'));var config=require(_0xbc2b('0x7'));var attributes=require(_0xbc2b('0x8'));module['exports']=function(_0x13e7f2,_0x419079){return _0x13e7f2[_0xbc2b('0x9')](_0xbc2b('0xa'),attributes,{'tableName':_0xbc2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ea9=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4c1dcf,_0x56b757){var _0x153529=function(_0x43e02b){while(--_0x43e02b){_0x4c1dcf['push'](_0x4c1dcf['shift']());}};_0x153529(++_0x56b757);}(_0x7ea9,0xf8));var _0x97ea=function(_0x1a0782,_0x113ac1){_0x1a0782=_0x1a0782-0x0;var _0x32189b=_0x7ea9[_0x1a0782];return _0x32189b;};'use strict';var _=require(_0x97ea('0x0'));var util=require(_0x97ea('0x1'));var logger=require(_0x97ea('0x2'))('api');var moment=require(_0x97ea('0x3'));var BPromise=require(_0x97ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97ea('0x5'));var config=require(_0x97ea('0x6'));var attributes=require(_0x97ea('0x7'));module[_0x97ea('0x8')]=function(_0x37935b,_0x6234f9){return _0x37935b['define'](_0x97ea('0x9'),attributes,{'tableName':_0x97ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 753dd03..c259ed4 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 _0xb4c3=['../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb4c3,0x12c));var _0x3b4c=function(_0x252180,_0x2b16ed){_0x252180=_0x252180-0x0;var _0x29395d=_0xb4c3[_0x252180];return _0x29395d;};'use strict';var _=require(_0x3b4c('0x0'));var util=require(_0x3b4c('0x1'));var moment=require(_0x3b4c('0x2'));var BPromise=require(_0x3b4c('0x3'));var rs=require(_0x3b4c('0x4'));var fs=require('fs');var Redis=require(_0x3b4c('0x5'));var db=require(_0x3b4c('0x6'))['db'];var utils=require(_0x3b4c('0x7'));var logger=require(_0x3b4c('0x8'))(_0x3b4c('0x9'));var config=require('../../config/environment');var jayson=require(_0x3b4c('0xa'));var client=jayson[_0x3b4c('0xb')][_0x3b4c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50271b,_0x1c8409,_0x26ee89){return new BPromise(function(_0x35069a,_0xb0ab01){return client[_0x3b4c('0xd')](_0x50271b,_0x26ee89)[_0x3b4c('0xe')](function(_0x321eda){logger['info'](_0x3b4c('0xf'),_0x1c8409,_0x3b4c('0x10'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1c8409,'request\x20sent',JSON[_0x3b4c('0x11')](_0x321eda));if(_0x321eda[_0x3b4c('0x12')]){if(_0x321eda[_0x3b4c('0x12')][_0x3b4c('0x13')]===0x1f4){logger[_0x3b4c('0x12')](_0x3b4c('0xf'),_0x1c8409,_0x321eda[_0x3b4c('0x12')][_0x3b4c('0x14')]);return _0xb0ab01(_0x321eda[_0x3b4c('0x12')]['message']);}logger[_0x3b4c('0x12')](_0x3b4c('0xf'),_0x1c8409,_0x321eda['error']['message']);return _0x35069a(_0x321eda['error'][_0x3b4c('0x14')]);}else{logger[_0x3b4c('0x15')](_0x3b4c('0xf'),_0x1c8409,_0x3b4c('0x10'));_0x35069a(_0x321eda['result'][_0x3b4c('0x14')]);}})['catch'](function(_0x35454a){logger[_0x3b4c('0x12')](_0x3b4c('0xf'),_0x1c8409,_0x35454a);_0xb0ab01(_0x35454a);});});} \ No newline at end of file +var _0x06d8=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x3c7b04,_0x2e8b50){var _0x4be4f7=function(_0x3278b5){while(--_0x3278b5){_0x3c7b04['push'](_0x3c7b04['shift']());}};_0x4be4f7(++_0x2e8b50);}(_0x06d8,0x12f));var _0x806d=function(_0x4c2bac,_0x5750d4){_0x4c2bac=_0x4c2bac-0x0;var _0x3bc1dc=_0x06d8[_0x4c2bac];return _0x3bc1dc;};'use strict';var _=require('lodash');var util=require(_0x806d('0x0'));var moment=require(_0x806d('0x1'));var BPromise=require(_0x806d('0x2'));var rs=require(_0x806d('0x3'));var fs=require('fs');var Redis=require(_0x806d('0x4'));var db=require(_0x806d('0x5'))['db'];var utils=require(_0x806d('0x6'));var logger=require('../../config/logger')(_0x806d('0x7'));var config=require(_0x806d('0x8'));var jayson=require(_0x806d('0x9'));var client=jayson[_0x806d('0xa')][_0x806d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16a646,_0x547407,_0x1e7417){return new BPromise(function(_0x5bee4f,_0x829575){return client[_0x806d('0xc')](_0x16a646,_0x1e7417)[_0x806d('0xd')](function(_0x319b1b){logger[_0x806d('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x547407,'request\x20sent');logger[_0x806d('0xf')](_0x806d('0x10'),_0x547407,_0x806d('0x11'),JSON[_0x806d('0x12')](_0x319b1b));if(_0x319b1b[_0x806d('0x13')]){if(_0x319b1b[_0x806d('0x13')][_0x806d('0x14')]===0x1f4){logger[_0x806d('0x13')](_0x806d('0x15'),_0x547407,_0x319b1b[_0x806d('0x13')]['message']);return _0x829575(_0x319b1b['error'][_0x806d('0x16')]);}logger['error'](_0x806d('0x15'),_0x547407,_0x319b1b['error']['message']);return _0x5bee4f(_0x319b1b[_0x806d('0x13')][_0x806d('0x16')]);}else{logger['info'](_0x806d('0x15'),_0x547407,_0x806d('0x11'));_0x5bee4f(_0x319b1b[_0x806d('0x17')][_0x806d('0x16')]);}})[_0x806d('0x18')](function(_0x305bcc){logger['error'](_0x806d('0x15'),_0x547407,_0x305bcc);_0x829575(_0x305bcc);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index da29422..ec4b65e 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 _0x814b=['../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','post','create','/create_many','bulkCreate','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x557a6,_0x224183){var _0x1928eb=function(_0x823e1c){while(--_0x823e1c){_0x557a6['push'](_0x557a6['shift']());}};_0x1928eb(++_0x224183);}(_0x814b,0x1a2));var _0xb814=function(_0x457c96,_0x13785c){_0x457c96=_0x457c96-0x0;var _0x4e5ebc=_0x814b[_0x457c96];return _0x4e5ebc;};'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')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0xd')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xd')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0xd')](_0xb814('0x11'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['put'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router[_0xb814('0x14')](_0xb814('0x15'),auth[_0xb814('0xa')](),controller[_0xb814('0x16')]);router[_0xb814('0x14')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x17')]);module[_0xb814('0x18')]=router; \ No newline at end of file +var _0x55ca=['/:id/create_many','addFields','put','update','delete','bulkDestroy','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','bulkCreate'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x55ca,0x126));var _0xa55c=function(_0x36d2e4,_0x49819a){_0x36d2e4=_0x36d2e4-0x0;var _0x3c32ae=_0x55ca[_0x36d2e4];return _0x3c32ae;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var auth=require(_0xa55c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa55c('0x4'));var controller=require(_0xa55c('0x5'));router[_0xa55c('0x6')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x8')]);router[_0xa55c('0x6')](_0xa55c('0x9'),auth['isAuthenticated'](),controller[_0xa55c('0xa')]);router[_0xa55c('0xb')]('/',auth['isAuthenticated'](),controller[_0xa55c('0xc')]);router[_0xa55c('0xb')]('/create_many',auth['isAuthenticated'](),controller[_0xa55c('0xd')]);router[_0xa55c('0xb')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x10')](_0xa55c('0x9'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')]('/destroy_many',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x14')]);module[_0xa55c('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 457f24c..7929fe9 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 _0x69d3=['STRING','TEXT','sequelize','exports'];(function(_0xd7e166,_0x256b3b){var _0x1e5e42=function(_0xfff3fb){while(--_0xfff3fb){_0xd7e166['push'](_0xd7e166['shift']());}};_0x1e5e42(++_0x256b3b);}(_0x69d3,0xda));var _0x369d=function(_0x52828d,_0x1fe8d5){_0x52828d=_0x52828d-0x0;var _0x1c5cdb=_0x69d3[_0x52828d];return _0x1c5cdb;};'use strict';var Sequelize=require(_0x369d('0x0'));module[_0x369d('0x1')]={'name':{'type':Sequelize[_0x369d('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x369d('0x2')]},'metric':{'type':Sequelize[_0x369d('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf7a3=['TEXT','STRING','name'];(function(_0x12acdc,_0x43a85b){var _0x908df4=function(_0x799d11){while(--_0x799d11){_0x12acdc['push'](_0x12acdc['shift']());}};_0x908df4(++_0x43a85b);}(_0xf7a3,0xac));var _0x3f7a=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xf7a3[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3f7a('0x0')],'allowNull':![],'unique':_0x3f7a('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x3f7a('0x2')]},'description':{'type':Sequelize[_0x3f7a('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 1919274..3f10974 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 _0xcd9c=['fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','count','include','findAll','show','params','keys','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then','get','Metrics','destroy','end','error','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection'];(function(_0x151b2a,_0x2b88b8){var _0x5c2c04=function(_0x1786d0){while(--_0x1786d0){_0x151b2a['push'](_0x151b2a['shift']());}};_0x5c2c04(++_0x2b88b8);}(_0xcd9c,0x6f));var _0xccd9=function(_0x53bdc3,_0x2dcd82){_0x53bdc3=_0x53bdc3-0x0;var _0x25e71a=_0xcd9c[_0x53bdc3];return _0x25e71a;};'use strict';var pdf=require(_0xccd9('0x0'));var emlformat=require(_0xccd9('0x1'));var rimraf=require(_0xccd9('0x2'));var zipdir=require(_0xccd9('0x3'));var jsonpatch=require(_0xccd9('0x4'));var rp=require(_0xccd9('0x5'));var moment=require(_0xccd9('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xccd9('0x7'));var util=require(_0xccd9('0x8'));var path=require(_0xccd9('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xccd9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xccd9('0xb'));var crypto=require(_0xccd9('0xc'));var jsforce=require(_0xccd9('0xd'));var deskjs=require(_0xccd9('0xe'));var toCsv=require(_0xccd9('0xf'));var querystring=require('querystring');var Papa=require(_0xccd9('0x10'));var Redis=require(_0xccd9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xccd9('0x12'));var hardwareService=require(_0xccd9('0x13'));var logger=require(_0xccd9('0x14'))('api');var utils=require(_0xccd9('0x15'));var config=require(_0xccd9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e2b04,_0x4fde0f){_0x4fde0f=_0x4fde0f||0xcc;return function(_0x2bdf61){if(_0x2bdf61){return _0x4e2b04[_0xccd9('0x17')](_0x4fde0f);}return _0x4e2b04[_0xccd9('0x18')](_0x4fde0f)['end']();};}function respondWithResult(_0x42c7a8,_0x52f0f6){_0x52f0f6=_0x52f0f6||0xc8;return function(_0x531eff){if(_0x531eff){return _0x42c7a8[_0xccd9('0x18')](_0x52f0f6)[_0xccd9('0x19')](_0x531eff);}};}function respondWithFilteredResult(_0x96cd01,_0x312d43){return function(_0x3e350f){if(_0x3e350f){var _0x46692a=_0x3e350f['count'],_0x42ed66=_0x312d43[_0xccd9('0x1a')],_0x1b0331=_0x312d43['offset']+_0x312d43[_0xccd9('0x1b')],_0x3452d8;if(_0x1b0331>=_0x46692a){_0x1b0331=_0x46692a;_0x3452d8=0xc8;}else{_0x3452d8=0xce;}_0x96cd01[_0xccd9('0x18')](_0x3452d8);return _0x96cd01[_0xccd9('0x1c')]('Content-Range',_0x42ed66+'-'+_0x1b0331+'/'+_0x46692a)[_0xccd9('0x19')](_0x3e350f);}return null;};}function patchUpdates(_0x4592b1){return function(_0x42bb18){try{jsonpatch[_0xccd9('0x1d')](_0x42bb18,_0x4592b1,!![]);}catch(_0x222ffb){return BPromise[_0xccd9('0x1e')](_0x222ffb);}return _0x42bb18[_0xccd9('0x1f')]();};}function saveUpdates(_0x5e85f8,_0x27c8c6){return function(_0x195e5d){if(_0x195e5d){return _0x195e5d[_0xccd9('0x20')](_0x5e85f8)['then'](function(_0x24d515){return _0x24d515;});}return null;};}function removeEntity(_0x4bd878,_0x9b12bc){return function(_0x1104c5){if(_0x1104c5){return _0x1104c5['destroy']()[_0xccd9('0x21')](function(){var _0x37bb4c=_0x1104c5[_0xccd9('0x22')]({'plain':!![]});var _0x2a3e8c=_0xccd9('0x23');return db['UserProfileResource'][_0xccd9('0x24')]({'where':{'type':_0x2a3e8c,'resourceId':_0x37bb4c['id']}})[_0xccd9('0x21')](function(){return _0x1104c5;});})[_0xccd9('0x21')](function(){_0x4bd878[_0xccd9('0x18')](0xcc)[_0xccd9('0x25')]();});}};}function handleEntityNotFound(_0x52c182,_0x138039){return function(_0x45ccfe){if(!_0x45ccfe){_0x52c182[_0xccd9('0x17')](0x194);}return _0x45ccfe;};}function handleError(_0x1506ce,_0x326827){_0x326827=_0x326827||0x1f4;return function(_0x1bb8b0){logger[_0xccd9('0x26')](_0x1bb8b0[_0xccd9('0x27')]);if(_0x1bb8b0[_0xccd9('0x28')]){delete _0x1bb8b0[_0xccd9('0x28')];}_0x1506ce['status'](_0x326827)['send'](_0x1bb8b0);};}exports[_0xccd9('0x29')]=function(_0x5b7093,_0x261736){var _0x4f7d4a={},_0x1feac5={},_0x5c8634={'count':0x0,'rows':[]};var _0x3ed2c0=_[_0xccd9('0x2a')](db[_0xccd9('0x2b')][_0xccd9('0x2c')],function(_0x3aa784){return{'name':_0x3aa784[_0xccd9('0x2d')],'type':_0x3aa784[_0xccd9('0x2e')]['key']};});_0x1feac5[_0xccd9('0x2f')]=_[_0xccd9('0x2a')](_0x3ed2c0,_0xccd9('0x28'));_0x1feac5[_0xccd9('0x30')]=_['keys'](_0x5b7093[_0xccd9('0x30')]);_0x1feac5[_0xccd9('0x31')]=_[_0xccd9('0x32')](_0x1feac5[_0xccd9('0x2f')],_0x1feac5[_0xccd9('0x30')]);_0x4f7d4a['attributes']=_[_0xccd9('0x32')](_0x1feac5[_0xccd9('0x2f')],qs[_0xccd9('0x33')](_0x5b7093[_0xccd9('0x30')][_0xccd9('0x33')]));_0x4f7d4a[_0xccd9('0x34')]=_0x4f7d4a[_0xccd9('0x34')]['length']?_0x4f7d4a[_0xccd9('0x34')]:_0x1feac5[_0xccd9('0x2f')];if(!_0x5b7093[_0xccd9('0x30')][_0xccd9('0x35')](_0xccd9('0x36'))){_0x4f7d4a[_0xccd9('0x1b')]=qs['limit'](_0x5b7093['query']['limit']);_0x4f7d4a[_0xccd9('0x1a')]=qs['offset'](_0x5b7093[_0xccd9('0x30')][_0xccd9('0x1a')]);}_0x4f7d4a[_0xccd9('0x37')]=qs[_0xccd9('0x38')](_0x5b7093[_0xccd9('0x30')][_0xccd9('0x38')]);_0x4f7d4a['where']=qs[_0xccd9('0x31')](_['pick'](_0x5b7093[_0xccd9('0x30')],_0x1feac5[_0xccd9('0x31')]));if(_0x5b7093[_0xccd9('0x30')]['filter']){_0x4f7d4a[_0xccd9('0x39')]=_[_0xccd9('0x3a')](_0x4f7d4a[_0xccd9('0x39')],{'$or':_[_0xccd9('0x2a')](_0x3ed2c0,function(_0x5e8af5){if(_0x5e8af5[_0xccd9('0x2e')]!==_0xccd9('0x3b')){var _0x43f701={};_0x43f701[_0x5e8af5[_0xccd9('0x28')]]={'$like':'%'+_0x5b7093[_0xccd9('0x30')][_0xccd9('0x3c')]+'%'};return _0x43f701;}})});}_0x4f7d4a=_[_0xccd9('0x3a')]({},_0x4f7d4a,_0x5b7093[_0xccd9('0x3d')]);var _0x2d6788={'where':_0x4f7d4a[_0xccd9('0x39')]};return db[_0xccd9('0x2b')]['count'](_0x2d6788)[_0xccd9('0x21')](function(_0xc1fb1d){_0x5c8634[_0xccd9('0x3e')]=_0xc1fb1d;if(_0x5b7093[_0xccd9('0x30')]['includeAll']){_0x4f7d4a[_0xccd9('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0xccd9('0x40')](_0x4f7d4a);})['then'](function(_0x323922){_0x5c8634['rows']=_0x323922;return _0x5c8634;})['then'](respondWithFilteredResult(_0x261736,_0x4f7d4a))['catch'](handleError(_0x261736,null));};exports[_0xccd9('0x41')]=function(_0x4353c0,_0x1fab86){var _0x285fd3={'raw':!![],'where':{'id':_0x4353c0[_0xccd9('0x42')]['id']}},_0x238d43={};_0x238d43[_0xccd9('0x2f')]=_[_0xccd9('0x43')](db[_0xccd9('0x2b')][_0xccd9('0x2c')]);_0x238d43[_0xccd9('0x30')]=_[_0xccd9('0x43')](_0x4353c0[_0xccd9('0x30')]);_0x238d43[_0xccd9('0x31')]=_[_0xccd9('0x32')](_0x238d43[_0xccd9('0x2f')],_0x238d43[_0xccd9('0x30')]);_0x285fd3[_0xccd9('0x34')]=_['intersection'](_0x238d43[_0xccd9('0x2f')],qs[_0xccd9('0x33')](_0x4353c0[_0xccd9('0x30')][_0xccd9('0x33')]));_0x285fd3['attributes']=_0x285fd3[_0xccd9('0x34')][_0xccd9('0x44')]?_0x285fd3[_0xccd9('0x34')]:_0x238d43[_0xccd9('0x2f')];if(_0x4353c0['query'][_0xccd9('0x45')]){_0x285fd3[_0xccd9('0x3f')]=[{'all':!![]}];}_0x285fd3=_['merge']({},_0x285fd3,_0x4353c0[_0xccd9('0x3d')]);return db[_0xccd9('0x2b')][_0xccd9('0x46')](_0x285fd3)[_0xccd9('0x21')](handleEntityNotFound(_0x1fab86,null))[_0xccd9('0x21')](respondWithResult(_0x1fab86,null))['catch'](handleError(_0x1fab86,null));};exports['create']=function(_0x3fea99,_0x54e8dc){return db[_0xccd9('0x2b')][_0xccd9('0x47')](_0x3fea99['body'],{})[_0xccd9('0x21')](function(_0x1cfb86){var _0x1a5411=_0x3fea99[_0xccd9('0x48')][_0xccd9('0x22')]({'plain':!![]});if(!_0x1a5411)throw new Error(_0xccd9('0x49'));if(_0x1a5411[_0xccd9('0x4a')]===_0xccd9('0x48')){var _0x3db6b9=_0x1cfb86[_0xccd9('0x22')]({'plain':!![]});var _0x52832d=_0xccd9('0x23');return db[_0xccd9('0x4b')]['find']({'where':{'name':_0x52832d,'userProfileId':_0x1a5411['userProfileId']},'raw':!![]})[_0xccd9('0x21')](function(_0x48384d){if(_0x48384d&&_0x48384d[_0xccd9('0x4c')]===0x0){return db[_0xccd9('0x4d')][_0xccd9('0x47')]({'name':_0x3db6b9[_0xccd9('0x28')],'resourceId':_0x3db6b9['id'],'type':_0x48384d[_0xccd9('0x28')],'sectionId':_0x48384d['id']},{})[_0xccd9('0x21')](function(){return _0x1cfb86;});}else{return _0x1cfb86;}})[_0xccd9('0x4e')](function(_0x1e84c8){logger['error'](_0xccd9('0x4f'),_0x1e84c8);throw _0x1e84c8;});}return _0x1cfb86;})['then'](respondWithResult(_0x54e8dc,0xc9))[_0xccd9('0x4e')](handleError(_0x54e8dc,null));};exports[_0xccd9('0x20')]=function(_0x594e72,_0x587af0){if(_0x594e72['body']['id']){delete _0x594e72['body']['id'];}return db[_0xccd9('0x2b')]['find']({'where':{'id':_0x594e72[_0xccd9('0x42')]['id']}})['then'](handleEntityNotFound(_0x587af0,null))[_0xccd9('0x21')](saveUpdates(_0x594e72[_0xccd9('0x50')],null))['then'](respondWithResult(_0x587af0,null))[_0xccd9('0x4e')](handleError(_0x587af0,null));};exports['destroy']=function(_0x1530f6,_0x4173a6){return db[_0xccd9('0x2b')][_0xccd9('0x46')]({'where':{'id':_0x1530f6[_0xccd9('0x42')]['id']}})[_0xccd9('0x21')](handleEntityNotFound(_0x4173a6,null))[_0xccd9('0x21')](removeEntity(_0x4173a6,null))[_0xccd9('0x4e')](handleError(_0x4173a6,null));}; \ No newline at end of file +var _0xbdf4=['attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','AnalyticMetric','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','UserProfileSection','userProfileId','autoAssociation','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xbdf4,0x16b));var _0x4bdf=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xbdf4[_0x44bcb0];return _0xfaf881;};'use strict';var pdf=require(_0x4bdf('0x0'));var emlformat=require(_0x4bdf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4bdf('0x2'));var jsonpatch=require(_0x4bdf('0x3'));var rp=require(_0x4bdf('0x4'));var moment=require(_0x4bdf('0x5'));var BPromise=require(_0x4bdf('0x6'));var Mustache=require(_0x4bdf('0x7'));var util=require(_0x4bdf('0x8'));var path=require(_0x4bdf('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4bdf('0xa'));var fs=require('fs');var _=require(_0x4bdf('0xb'));var squel=require(_0x4bdf('0xc'));var crypto=require('crypto');var jsforce=require(_0x4bdf('0xd'));var deskjs=require(_0x4bdf('0xe'));var toCsv=require(_0x4bdf('0xf'));var querystring=require('querystring');var Papa=require(_0x4bdf('0x10'));var Redis=require(_0x4bdf('0x11'));var authService=require(_0x4bdf('0x12'));var qs=require(_0x4bdf('0x13'));var as=require(_0x4bdf('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4bdf('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4bdf('0x16'));var db=require(_0x4bdf('0x17'))['db'];function respondWithStatusCode(_0xc9bfa1,_0x3f3592){_0x3f3592=_0x3f3592||0xcc;return function(_0x427f87){if(_0x427f87){return _0xc9bfa1[_0x4bdf('0x18')](_0x3f3592);}return _0xc9bfa1[_0x4bdf('0x19')](_0x3f3592)[_0x4bdf('0x1a')]();};}function respondWithResult(_0x5d5196,_0x5e7dbd){_0x5e7dbd=_0x5e7dbd||0xc8;return function(_0x4e2212){if(_0x4e2212){return _0x5d5196[_0x4bdf('0x19')](_0x5e7dbd)[_0x4bdf('0x1b')](_0x4e2212);}};}function respondWithFilteredResult(_0x46b3ea,_0x1d87e9){return function(_0x493c29){if(_0x493c29){var _0x272563=_0x493c29[_0x4bdf('0x1c')],_0x1155cf=_0x1d87e9[_0x4bdf('0x1d')],_0x40056d=_0x1d87e9[_0x4bdf('0x1d')]+_0x1d87e9['limit'],_0x11974d;if(_0x40056d>=_0x272563){_0x40056d=_0x272563;_0x11974d=0xc8;}else{_0x11974d=0xce;}_0x46b3ea[_0x4bdf('0x19')](_0x11974d);return _0x46b3ea[_0x4bdf('0x1e')](_0x4bdf('0x1f'),_0x1155cf+'-'+_0x40056d+'/'+_0x272563)[_0x4bdf('0x1b')](_0x493c29);}return null;};}function patchUpdates(_0x267128){return function(_0x1e0e15){try{jsonpatch[_0x4bdf('0x20')](_0x1e0e15,_0x267128,!![]);}catch(_0x4a89f0){return BPromise[_0x4bdf('0x21')](_0x4a89f0);}return _0x1e0e15[_0x4bdf('0x22')]();};}function saveUpdates(_0xfcf0c6,_0x431ab4){return function(_0x26de03){if(_0x26de03){return _0x26de03[_0x4bdf('0x23')](_0xfcf0c6)[_0x4bdf('0x24')](function(_0x1fbb8f){return _0x1fbb8f;});}return null;};}function removeEntity(_0xb6d188,_0x1dff4e){return function(_0x8fc99e){if(_0x8fc99e){return _0x8fc99e[_0x4bdf('0x25')]()[_0x4bdf('0x24')](function(){var _0x5b5fc4=_0x8fc99e[_0x4bdf('0x26')]({'plain':!![]});var _0x39ad7d='Metrics';return db[_0x4bdf('0x27')][_0x4bdf('0x25')]({'where':{'type':_0x39ad7d,'resourceId':_0x5b5fc4['id']}})['then'](function(){return _0x8fc99e;});})[_0x4bdf('0x24')](function(){_0xb6d188[_0x4bdf('0x19')](0xcc)[_0x4bdf('0x1a')]();});}};}function handleEntityNotFound(_0x5f284d,_0x324b39){return function(_0xb6fdc4){if(!_0xb6fdc4){_0x5f284d['sendStatus'](0x194);}return _0xb6fdc4;};}function handleError(_0x1a76ce,_0x4d9014){_0x4d9014=_0x4d9014||0x1f4;return function(_0x983ee2){logger[_0x4bdf('0x28')](_0x983ee2[_0x4bdf('0x29')]);if(_0x983ee2['name']){delete _0x983ee2[_0x4bdf('0x2a')];}_0x1a76ce[_0x4bdf('0x19')](_0x4d9014)['send'](_0x983ee2);};}exports['index']=function(_0x30afd2,_0x33f0b2){var _0x1a35ef={},_0x20dfc6={},_0x42970a={'count':0x0,'rows':[]};var _0x281248=_[_0x4bdf('0x2b')](db['AnalyticMetric'][_0x4bdf('0x2c')],function(_0x19d5f8){return{'name':_0x19d5f8['fieldName'],'type':_0x19d5f8[_0x4bdf('0x2d')][_0x4bdf('0x2e')]};});_0x20dfc6[_0x4bdf('0x2f')]=_[_0x4bdf('0x2b')](_0x281248,_0x4bdf('0x2a'));_0x20dfc6[_0x4bdf('0x30')]=_[_0x4bdf('0x31')](_0x30afd2['query']);_0x20dfc6[_0x4bdf('0x32')]=_[_0x4bdf('0x33')](_0x20dfc6[_0x4bdf('0x2f')],_0x20dfc6[_0x4bdf('0x30')]);_0x1a35ef[_0x4bdf('0x34')]=_[_0x4bdf('0x33')](_0x20dfc6[_0x4bdf('0x2f')],qs['fields'](_0x30afd2[_0x4bdf('0x30')][_0x4bdf('0x35')]));_0x1a35ef[_0x4bdf('0x34')]=_0x1a35ef['attributes'][_0x4bdf('0x36')]?_0x1a35ef[_0x4bdf('0x34')]:_0x20dfc6[_0x4bdf('0x2f')];if(!_0x30afd2[_0x4bdf('0x30')][_0x4bdf('0x37')]('nolimit')){_0x1a35ef[_0x4bdf('0x38')]=qs['limit'](_0x30afd2['query'][_0x4bdf('0x38')]);_0x1a35ef[_0x4bdf('0x1d')]=qs[_0x4bdf('0x1d')](_0x30afd2[_0x4bdf('0x30')][_0x4bdf('0x1d')]);}_0x1a35ef[_0x4bdf('0x39')]=qs[_0x4bdf('0x3a')](_0x30afd2[_0x4bdf('0x30')][_0x4bdf('0x3a')]);_0x1a35ef[_0x4bdf('0x3b')]=qs[_0x4bdf('0x32')](_[_0x4bdf('0x3c')](_0x30afd2[_0x4bdf('0x30')],_0x20dfc6[_0x4bdf('0x32')]));if(_0x30afd2[_0x4bdf('0x30')][_0x4bdf('0x3d')]){_0x1a35ef[_0x4bdf('0x3b')]=_['merge'](_0x1a35ef[_0x4bdf('0x3b')],{'$or':_[_0x4bdf('0x2b')](_0x281248,function(_0x399582){if(_0x399582[_0x4bdf('0x2d')]!==_0x4bdf('0x3e')){var _0x4f081e={};_0x4f081e[_0x399582['name']]={'$like':'%'+_0x30afd2[_0x4bdf('0x30')][_0x4bdf('0x3d')]+'%'};return _0x4f081e;}})});}_0x1a35ef=_[_0x4bdf('0x3f')]({},_0x1a35ef,_0x30afd2[_0x4bdf('0x40')]);var _0x42f49b={'where':_0x1a35ef['where']};return db[_0x4bdf('0x41')][_0x4bdf('0x1c')](_0x42f49b)[_0x4bdf('0x24')](function(_0x8f933f){_0x42970a['count']=_0x8f933f;if(_0x30afd2[_0x4bdf('0x30')][_0x4bdf('0x42')]){_0x1a35ef['include']=[{'all':!![]}];}return db[_0x4bdf('0x41')][_0x4bdf('0x43')](_0x1a35ef);})[_0x4bdf('0x24')](function(_0x1ab9db){_0x42970a[_0x4bdf('0x44')]=_0x1ab9db;return _0x42970a;})[_0x4bdf('0x24')](respondWithFilteredResult(_0x33f0b2,_0x1a35ef))[_0x4bdf('0x45')](handleError(_0x33f0b2,null));};exports[_0x4bdf('0x46')]=function(_0x22091f,_0x594ced){var _0x5a5677={'raw':!![],'where':{'id':_0x22091f[_0x4bdf('0x47')]['id']}},_0x29f2a3={};_0x29f2a3[_0x4bdf('0x2f')]=_[_0x4bdf('0x31')](db[_0x4bdf('0x41')][_0x4bdf('0x2c')]);_0x29f2a3[_0x4bdf('0x30')]=_[_0x4bdf('0x31')](_0x22091f[_0x4bdf('0x30')]);_0x29f2a3[_0x4bdf('0x32')]=_[_0x4bdf('0x33')](_0x29f2a3[_0x4bdf('0x2f')],_0x29f2a3[_0x4bdf('0x30')]);_0x5a5677[_0x4bdf('0x34')]=_[_0x4bdf('0x33')](_0x29f2a3['model'],qs[_0x4bdf('0x35')](_0x22091f[_0x4bdf('0x30')][_0x4bdf('0x35')]));_0x5a5677[_0x4bdf('0x34')]=_0x5a5677[_0x4bdf('0x34')][_0x4bdf('0x36')]?_0x5a5677['attributes']:_0x29f2a3['model'];if(_0x22091f[_0x4bdf('0x30')][_0x4bdf('0x42')]){_0x5a5677[_0x4bdf('0x48')]=[{'all':!![]}];}_0x5a5677=_[_0x4bdf('0x3f')]({},_0x5a5677,_0x22091f['options']);return db[_0x4bdf('0x41')][_0x4bdf('0x49')](_0x5a5677)['then'](handleEntityNotFound(_0x594ced,null))[_0x4bdf('0x24')](respondWithResult(_0x594ced,null))[_0x4bdf('0x45')](handleError(_0x594ced,null));};exports[_0x4bdf('0x4a')]=function(_0x37fb5a,_0x575b79){return db['AnalyticMetric'][_0x4bdf('0x4a')](_0x37fb5a[_0x4bdf('0x4b')],{})[_0x4bdf('0x24')](function(_0x5b41c5){var _0x2d3bc9=_0x37fb5a[_0x4bdf('0x4c')]['get']({'plain':!![]});if(!_0x2d3bc9)throw new Error(_0x4bdf('0x4d'));if(_0x2d3bc9[_0x4bdf('0x4e')]===_0x4bdf('0x4c')){var _0x191d39=_0x5b41c5['get']({'plain':!![]});var _0x8eead6=_0x4bdf('0x4f');return db[_0x4bdf('0x50')][_0x4bdf('0x49')]({'where':{'name':_0x8eead6,'userProfileId':_0x2d3bc9[_0x4bdf('0x51')]},'raw':!![]})[_0x4bdf('0x24')](function(_0x4221a5){if(_0x4221a5&&_0x4221a5[_0x4bdf('0x52')]===0x0){return db[_0x4bdf('0x27')][_0x4bdf('0x4a')]({'name':_0x191d39['name'],'resourceId':_0x191d39['id'],'type':_0x4221a5[_0x4bdf('0x2a')],'sectionId':_0x4221a5['id']},{})['then'](function(){return _0x5b41c5;});}else{return _0x5b41c5;}})[_0x4bdf('0x45')](function(_0x5dce1b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dce1b);throw _0x5dce1b;});}return _0x5b41c5;})[_0x4bdf('0x24')](respondWithResult(_0x575b79,0xc9))[_0x4bdf('0x45')](handleError(_0x575b79,null));};exports[_0x4bdf('0x23')]=function(_0x25ef9e,_0x5c97ee){if(_0x25ef9e[_0x4bdf('0x4b')]['id']){delete _0x25ef9e[_0x4bdf('0x4b')]['id'];}return db[_0x4bdf('0x41')][_0x4bdf('0x49')]({'where':{'id':_0x25ef9e['params']['id']}})[_0x4bdf('0x24')](handleEntityNotFound(_0x5c97ee,null))[_0x4bdf('0x24')](saveUpdates(_0x25ef9e[_0x4bdf('0x4b')],null))[_0x4bdf('0x24')](respondWithResult(_0x5c97ee,null))[_0x4bdf('0x45')](handleError(_0x5c97ee,null));};exports['destroy']=function(_0x124936,_0x305b56){return db[_0x4bdf('0x41')][_0x4bdf('0x49')]({'where':{'id':_0x124936[_0x4bdf('0x47')]['id']}})[_0x4bdf('0x24')](handleEntityNotFound(_0x305b56,null))[_0x4bdf('0x24')](removeEntity(_0x305b56,null))[_0x4bdf('0x45')](handleError(_0x305b56,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index e55f79a..24bbe87 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 _0xd074=['bluebird','rimraf','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0xd074,0xb9));var _0x4d07=function(_0x336264,_0x32e1d9){_0x336264=_0x336264-0x0;var _0x53cf91=_0xd074[_0x336264];return _0x53cf91;};'use strict';var _=require(_0x4d07('0x0'));var util=require(_0x4d07('0x1'));var logger=require(_0x4d07('0x2'))(_0x4d07('0x3'));var moment=require(_0x4d07('0x4'));var BPromise=require(_0x4d07('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4d07('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x1b2daf,_0x4281ad){return _0x1b2daf[_0x4d07('0x7')](_0x4d07('0x8'),attributes,{'tableName':_0x4d07('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bc1=['moment','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x2bc1,0xa1));var _0x12bc=function(_0x71e7d,_0x239c71){_0x71e7d=_0x71e7d-0x0;var _0x255a56=_0x2bc1[_0x71e7d];return _0x255a56;};'use strict';var _=require(_0x12bc('0x0'));var util=require(_0x12bc('0x1'));var logger=require(_0x12bc('0x2'))(_0x12bc('0x3'));var moment=require(_0x12bc('0x4'));var BPromise=require('bluebird');var rp=require(_0x12bc('0x5'));var fs=require('fs');var path=require(_0x12bc('0x6'));var rimraf=require(_0x12bc('0x7'));var config=require('../../config/environment');var attributes=require(_0x12bc('0x8'));module[_0x12bc('0x9')]=function(_0x27540f,_0x25d0ba){return _0x27540f[_0x12bc('0xa')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','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 1815bcd..21f9a6a 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 _0x49c4=['debug','request\x20sent','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','info'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x49c4,0x75));var _0x449c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x49c4[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x449c('0x0'));var util=require('util');var moment=require(_0x449c('0x1'));var BPromise=require(_0x449c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x449c('0x3'));var db=require(_0x449c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x449c('0x5'))(_0x449c('0x6'));var config=require('../../config/environment');var jayson=require(_0x449c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ea265,_0x35d806,_0xbd32cd){return new BPromise(function(_0x584431,_0x39cb82){return client['request'](_0x4ea265,_0xbd32cd)['then'](function(_0x1c83e5){logger[_0x449c('0x8')]('AnalyticMetric,\x20%s,\x20%s',_0x35d806,'request\x20sent');logger[_0x449c('0x9')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x35d806,_0x449c('0xa'),JSON[_0x449c('0xb')](_0x1c83e5));if(_0x1c83e5[_0x449c('0xc')]){if(_0x1c83e5[_0x449c('0xc')][_0x449c('0xd')]===0x1f4){logger[_0x449c('0xc')](_0x449c('0xe'),_0x35d806,_0x1c83e5[_0x449c('0xc')][_0x449c('0xf')]);return _0x39cb82(_0x1c83e5[_0x449c('0xc')][_0x449c('0xf')]);}logger[_0x449c('0xc')](_0x449c('0xe'),_0x35d806,_0x1c83e5[_0x449c('0xc')][_0x449c('0xf')]);return _0x584431(_0x1c83e5['error'][_0x449c('0xf')]);}else{logger[_0x449c('0x8')](_0x449c('0xe'),_0x35d806,_0x449c('0xa'));_0x584431(_0x1c83e5[_0x449c('0x10')][_0x449c('0xf')]);}})[_0x449c('0x11')](function(_0x9f0007){logger['error'](_0x449c('0xe'),_0x35d806,_0x9f0007);_0x39cb82(_0x9f0007);});});} \ No newline at end of file +var _0xc737=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','AnalyticMetric,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x450d87,_0x2ae298){var _0x204e75=function(_0x4f4f7d){while(--_0x4f4f7d){_0x450d87['push'](_0x450d87['shift']());}};_0x204e75(++_0x2ae298);}(_0xc737,0xaf));var _0x7c73=function(_0x130561,_0x118dab){_0x130561=_0x130561-0x0;var _0x4e9659=_0xc737[_0x130561];return _0x4e9659;};'use strict';var _=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var moment=require('moment');var BPromise=require(_0x7c73('0x2'));var rs=require(_0x7c73('0x3'));var fs=require('fs');var Redis=require(_0x7c73('0x4'));var db=require(_0x7c73('0x5'))['db'];var utils=require(_0x7c73('0x6'));var logger=require(_0x7c73('0x7'))(_0x7c73('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c73('0x9'));var client=jayson[_0x7c73('0xa')][_0x7c73('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28f722,_0x15052f,_0x50ce7c){return new BPromise(function(_0x25802e,_0x43e1d6){return client['request'](_0x28f722,_0x50ce7c)['then'](function(_0x144c25){logger[_0x7c73('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x15052f,_0x7c73('0xd'));logger[_0x7c73('0xe')](_0x7c73('0xf'),_0x15052f,_0x7c73('0xd'),JSON[_0x7c73('0x10')](_0x144c25));if(_0x144c25['error']){if(_0x144c25['error']['code']===0x1f4){logger['error'](_0x7c73('0x11'),_0x15052f,_0x144c25[_0x7c73('0x12')][_0x7c73('0x13')]);return _0x43e1d6(_0x144c25[_0x7c73('0x12')][_0x7c73('0x13')]);}logger[_0x7c73('0x12')](_0x7c73('0x11'),_0x15052f,_0x144c25[_0x7c73('0x12')][_0x7c73('0x13')]);return _0x25802e(_0x144c25[_0x7c73('0x12')][_0x7c73('0x13')]);}else{logger[_0x7c73('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x15052f,_0x7c73('0xd'));_0x25802e(_0x144c25[_0x7c73('0x14')][_0x7c73('0x13')]);}})[_0x7c73('0x15')](function(_0x18fe3e){logger[_0x7c73('0x12')](_0x7c73('0x11'),_0x15052f,_0x18fe3e);_0x43e1d6(_0x18fe3e);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index ff52ab2..4893395 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 _0xc4aa=['connect-timeout','express','Router','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path'];(function(_0x4a7756,_0x97b450){var _0x26b489=function(_0x1147e9){while(--_0x1147e9){_0x4a7756['push'](_0x4a7756['shift']());}};_0x26b489(++_0x97b450);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac4a('0x6'));router[_0xac4a('0x7')]('/',auth[_0xac4a('0x8')](),controller[_0xac4a('0x9')]);router[_0xac4a('0x7')](_0xac4a('0xa'),auth[_0xac4a('0x8')](),controller[_0xac4a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xac4a('0xc')]);router[_0xac4a('0xd')](_0xac4a('0xa'),auth['isAuthenticated'](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')](_0xac4a('0xa'),auth['isAuthenticated'](),controller[_0xac4a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7880=['Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x1b96ee,_0x32ffef){var _0x1aef42=function(_0x62d6e0){while(--_0x62d6e0){_0x1b96ee['push'](_0x1b96ee['shift']());}};_0x1aef42(++_0x32ffef);}(_0x7880,0x1f4));var _0x0788=function(_0x4b8968,_0x5c9b44){_0x4b8968=_0x4b8968-0x0;var _0x3a0ab7=_0x7880[_0x4b8968];return _0x3a0ab7;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var auth=require(_0x0788('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0788('0x6'));var controller=require(_0x0788('0x7'));router[_0x0788('0x8')]('/',auth[_0x0788('0x9')](),controller[_0x0788('0xa')]);router[_0x0788('0x8')](_0x0788('0xb'),auth[_0x0788('0x9')](),controller[_0x0788('0xc')]);router[_0x0788('0xd')]('/',auth['isAuthenticated'](),controller[_0x0788('0xe')]);router['put'](_0x0788('0xb'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router[_0x0788('0x10')](_0x0788('0xb'),auth[_0x0788('0x9')](),controller[_0x0788('0x11')]);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 5f72af6..a38fae8 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 _0x99ea=['TEXT'];(function(_0x58a1ef,_0x4938cd){var _0x384e65=function(_0x61be1e){while(--_0x61be1e){_0x58a1ef['push'](_0x58a1ef['shift']());}};_0x384e65(++_0x4938cd);}(_0x99ea,0x112));var _0xa99e=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0x99ea[_0x272638];return _0x19d027;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0xa99e('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x6d9a=['sequelize'];(function(_0x2632d6,_0xc2cf90){var _0x2643f8=function(_0x39a1e6){while(--_0x39a1e6){_0x2632d6['push'](_0x2632d6['shift']());}};_0x2643f8(++_0xc2cf90);}(_0x6d9a,0x15a));var _0xa6d9=function(_0x389b04,_0x3b0ae7){_0x389b04=_0x389b04-0x0;var _0x27319c=_0x6d9a[_0x389b04];return _0x27319c;};'use strict';var Sequelize=require(_0xa6d9('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index a64ba30..bd898ae 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 _0x36ee=['nolimit','order','sort','pick','where','merge','type','filter','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','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','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticTreeReport','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x2eeaaf,_0xe3874a){var _0x59014a=function(_0x4cec58){while(--_0x4cec58){_0x2eeaaf['push'](_0x2eeaaf['shift']());}};_0x59014a(++_0xe3874a);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe36e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe36e('0x1'));var rp=require(_0xe36e('0x2'));var moment=require(_0xe36e('0x3'));var BPromise=require(_0xe36e('0x4'));var Mustache=require(_0xe36e('0x5'));var util=require(_0xe36e('0x6'));var path=require(_0xe36e('0x7'));var sox=require(_0xe36e('0x8'));var csv=require(_0xe36e('0x9'));var ejs=require(_0xe36e('0xa'));var fs=require('fs');var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x9'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var db=require(_0xe36e('0x17'))['db'];function respondWithStatusCode(_0x265473,_0x4fbdb2){_0x4fbdb2=_0x4fbdb2||0xcc;return function(_0x32981d){if(_0x32981d){return _0x265473[_0xe36e('0x18')](_0x4fbdb2);}return _0x265473[_0xe36e('0x19')](_0x4fbdb2)[_0xe36e('0x1a')]();};}function respondWithResult(_0x5c3f3c,_0x3e264a){_0x3e264a=_0x3e264a||0xc8;return function(_0x521afa){if(_0x521afa){return _0x5c3f3c['status'](_0x3e264a)[_0xe36e('0x1b')](_0x521afa);}};}function respondWithFilteredResult(_0x300f21,_0x26fb37){return function(_0x278135){if(_0x278135){var _0xd6828e=_0x278135[_0xe36e('0x1c')],_0x924cd5=_0x26fb37[_0xe36e('0x1d')],_0x2096f6=_0x26fb37['offset']+_0x26fb37[_0xe36e('0x1e')],_0x39bae8;if(_0x2096f6>=_0xd6828e){_0x2096f6=_0xd6828e;_0x39bae8=0xc8;}else{_0x39bae8=0xce;}_0x300f21[_0xe36e('0x19')](_0x39bae8);return _0x300f21['set'](_0xe36e('0x1f'),_0x924cd5+'-'+_0x2096f6+'/'+_0xd6828e)['json'](_0x278135);}return null;};}function patchUpdates(_0x471400){return function(_0x303784){try{jsonpatch['apply'](_0x303784,_0x471400,!![]);}catch(_0x472825){return BPromise[_0xe36e('0x20')](_0x472825);}return _0x303784[_0xe36e('0x21')]();};}function saveUpdates(_0x597331,_0x21e95e){return function(_0x21bcf9){if(_0x21bcf9){return _0x21bcf9[_0xe36e('0x22')](_0x597331)[_0xe36e('0x23')](function(_0x2c4e30){return _0x2c4e30;});}return null;};}function removeEntity(_0x360b95,_0x4f438a){return function(_0xd71137){if(_0xd71137){return _0xd71137[_0xe36e('0x24')]()[_0xe36e('0x23')](function(){_0x360b95[_0xe36e('0x19')](0xcc)[_0xe36e('0x1a')]();});}};}function handleEntityNotFound(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(!_0x4749a8){_0x53e13a[_0xe36e('0x18')](0x194);}return _0x4749a8;};}function handleError(_0xb0cd85,_0xb32195){_0xb32195=_0xb32195||0x1f4;return function(_0x31c12c){logger[_0xe36e('0x25')](_0x31c12c[_0xe36e('0x26')]);if(_0x31c12c['name']){delete _0x31c12c[_0xe36e('0x27')];}_0xb0cd85[_0xe36e('0x19')](_0xb32195)[_0xe36e('0x28')](_0x31c12c);};}exports[_0xe36e('0x29')]=function(_0x5e58d8,_0x2d757c){var _0x5a3133={},_0xf7b02e={},_0x5993de={'count':0x0,'rows':[]};var _0x19f001=_['map'](db[_0xe36e('0x2a')]['rawAttributes'],function(_0x3b1045){return{'name':_0x3b1045['fieldName'],'type':_0x3b1045['type']['key']};});_0xf7b02e['model']=_[_0xe36e('0x2b')](_0x19f001,_0xe36e('0x27'));_0xf7b02e['query']=_['keys'](_0x5e58d8[_0xe36e('0x2c')]);_0xf7b02e[_0xe36e('0x2d')]=_[_0xe36e('0x2e')](_0xf7b02e[_0xe36e('0x2f')],_0xf7b02e[_0xe36e('0x2c')]);_0x5a3133[_0xe36e('0x30')]=_['intersection'](_0xf7b02e[_0xe36e('0x2f')],qs[_0xe36e('0x31')](_0x5e58d8['query'][_0xe36e('0x31')]));_0x5a3133[_0xe36e('0x30')]=_0x5a3133[_0xe36e('0x30')][_0xe36e('0x32')]?_0x5a3133[_0xe36e('0x30')]:_0xf7b02e[_0xe36e('0x2f')];if(!_0x5e58d8[_0xe36e('0x2c')][_0xe36e('0x33')](_0xe36e('0x34'))){_0x5a3133[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x5e58d8['query'][_0xe36e('0x1e')]);_0x5a3133['offset']=qs['offset'](_0x5e58d8[_0xe36e('0x2c')]['offset']);}_0x5a3133[_0xe36e('0x35')]=qs[_0xe36e('0x36')](_0x5e58d8[_0xe36e('0x2c')][_0xe36e('0x36')]);_0x5a3133['where']=qs['filters'](_[_0xe36e('0x37')](_0x5e58d8[_0xe36e('0x2c')],_0xf7b02e[_0xe36e('0x2d')]));if(_0x5e58d8[_0xe36e('0x2c')]['filter']){_0x5a3133[_0xe36e('0x38')]=_[_0xe36e('0x39')](_0x5a3133[_0xe36e('0x38')],{'$or':_['map'](_0x19f001,function(_0x2c58d1){if(_0x2c58d1[_0xe36e('0x3a')]!=='VIRTUAL'){var _0x40cbe5={};_0x40cbe5[_0x2c58d1[_0xe36e('0x27')]]={'$like':'%'+_0x5e58d8[_0xe36e('0x2c')][_0xe36e('0x3b')]+'%'};return _0x40cbe5;}})});}_0x5a3133=_[_0xe36e('0x39')]({},_0x5a3133,_0x5e58d8[_0xe36e('0x3c')]);var _0x130edb={'where':_0x5a3133[_0xe36e('0x38')]};return db[_0xe36e('0x2a')][_0xe36e('0x1c')](_0x130edb)[_0xe36e('0x23')](function(_0x39dd9b){_0x5993de[_0xe36e('0x1c')]=_0x39dd9b;if(_0x5e58d8['query'][_0xe36e('0x3d')]){_0x5a3133[_0xe36e('0x3e')]=[{'all':!![]}];}return db[_0xe36e('0x2a')][_0xe36e('0x3f')](_0x5a3133);})[_0xe36e('0x23')](function(_0x4d133b){_0x5993de['rows']=_0x4d133b;return _0x5993de;})[_0xe36e('0x23')](respondWithFilteredResult(_0x2d757c,_0x5a3133))[_0xe36e('0x40')](handleError(_0x2d757c,null));};exports[_0xe36e('0x41')]=function(_0x537e1a,_0x27caff){var _0x34a1ba={'raw':!![],'where':{'id':_0x537e1a[_0xe36e('0x42')]['id']}},_0xff4f63={};_0xff4f63['model']=_[_0xe36e('0x43')](db[_0xe36e('0x2a')]['rawAttributes']);_0xff4f63[_0xe36e('0x2c')]=_['keys'](_0x537e1a[_0xe36e('0x2c')]);_0xff4f63[_0xe36e('0x2d')]=_[_0xe36e('0x2e')](_0xff4f63[_0xe36e('0x2f')],_0xff4f63[_0xe36e('0x2c')]);_0x34a1ba['attributes']=_[_0xe36e('0x2e')](_0xff4f63[_0xe36e('0x2f')],qs[_0xe36e('0x31')](_0x537e1a[_0xe36e('0x2c')][_0xe36e('0x31')]));_0x34a1ba[_0xe36e('0x30')]=_0x34a1ba['attributes'][_0xe36e('0x32')]?_0x34a1ba[_0xe36e('0x30')]:_0xff4f63[_0xe36e('0x2f')];if(_0x537e1a[_0xe36e('0x2c')][_0xe36e('0x3d')]){_0x34a1ba['include']=[{'all':!![]}];}_0x34a1ba=_[_0xe36e('0x39')]({},_0x34a1ba,_0x537e1a[_0xe36e('0x3c')]);return db[_0xe36e('0x2a')][_0xe36e('0x44')](_0x34a1ba)[_0xe36e('0x23')](handleEntityNotFound(_0x27caff,null))[_0xe36e('0x23')](respondWithResult(_0x27caff,null))[_0xe36e('0x40')](handleError(_0x27caff,null));};exports[_0xe36e('0x45')]=function(_0x43c2d4,_0x52e744){return db['AnalyticTreeReport'][_0xe36e('0x45')](_0x43c2d4['body'],{})[_0xe36e('0x23')](respondWithResult(_0x52e744,0xc9))[_0xe36e('0x40')](handleError(_0x52e744,null));};exports[_0xe36e('0x22')]=function(_0x25aa09,_0x51641c){if(_0x25aa09[_0xe36e('0x46')]['id']){delete _0x25aa09[_0xe36e('0x46')]['id'];}return db['AnalyticTreeReport'][_0xe36e('0x44')]({'where':{'id':_0x25aa09[_0xe36e('0x42')]['id']}})[_0xe36e('0x23')](handleEntityNotFound(_0x51641c,null))[_0xe36e('0x23')](saveUpdates(_0x25aa09[_0xe36e('0x46')],null))[_0xe36e('0x23')](respondWithResult(_0x51641c,null))[_0xe36e('0x40')](handleError(_0x51641c,null));};exports[_0xe36e('0x24')]=function(_0x17555e,_0x3a99aa){return db[_0xe36e('0x2a')][_0xe36e('0x44')]({'where':{'id':_0x17555e[_0xe36e('0x42')]['id']}})[_0xe36e('0x23')](handleEntityNotFound(_0x3a99aa,null))[_0xe36e('0x23')](removeEntity(_0x3a99aa,null))['catch'](handleError(_0x3a99aa,null));}; \ No newline at end of file +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','AnalyticTreeReport','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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5c00,0x17e));var _0x05c0=function(_0xeb6f8d,_0x1138f1){_0xeb6f8d=_0xeb6f8d-0x0;var _0x41f045=_0x5c00[_0xeb6f8d];return _0x41f045;};'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['AnalyticTreeReport']['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['AnalyticTreeReport']['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['AnalyticTreeReport'][_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['AnalyticTreeReport'][_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['AnalyticTreeReport'][_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 diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 4999e94..2ec0708 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 _0xd5c8=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xd5c8,0x166));var _0x8d5c=function(_0x5ee73b,_0x282c4c){_0x5ee73b=_0x5ee73b-0x0;var _0x22948a=_0xd5c8[_0x5ee73b];return _0x22948a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8d5c('0x0'))(_0x8d5c('0x1'));var moment=require(_0x8d5c('0x2'));var BPromise=require(_0x8d5c('0x3'));var rp=require(_0x8d5c('0x4'));var fs=require('fs');var path=require(_0x8d5c('0x5'));var rimraf=require(_0x8d5c('0x6'));var config=require(_0x8d5c('0x7'));var attributes=require(_0x8d5c('0x8'));module['exports']=function(_0xd72ba3,_0x5d3fff){return _0xd72ba3['define'](_0x8d5c('0x9'),attributes,{'tableName':_0x8d5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f66=['request-promise','path','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','util','api','moment','bluebird'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var fs=require('fs');var path=require(_0x65f6('0x5'));var rimraf=require('rimraf');var config=require(_0x65f6('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'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 933a369..62d5c23 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 _0x58ea=['code','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','stringify','error'];(function(_0x389dd7,_0x5d3992){var _0x1ac061=function(_0x46c9aa){while(--_0x46c9aa){_0x389dd7['push'](_0x389dd7['shift']());}};_0x1ac061(++_0x5d3992);}(_0x58ea,0x75));var _0xa58e=function(_0x11e40a,_0x26197d){_0x11e40a=_0x11e40a-0x0;var _0x2e8185=_0x58ea[_0x11e40a];return _0x2e8185;};'use strict';var _=require(_0xa58e('0x0'));var util=require('util');var moment=require(_0xa58e('0x1'));var BPromise=require(_0xa58e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa58e('0x3'))['db'];var utils=require(_0xa58e('0x4'));var logger=require('../../config/logger')(_0xa58e('0x5'));var config=require(_0xa58e('0x6'));var jayson=require(_0xa58e('0x7'));var client=jayson[_0xa58e('0x8')][_0xa58e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45df5a,_0x5888f5,_0xa6a7cc){return new BPromise(function(_0xa70be8,_0x18942a){return client[_0xa58e('0xa')](_0x45df5a,_0xa6a7cc)[_0xa58e('0xb')](function(_0x2dfd1e){logger[_0xa58e('0xc')](_0xa58e('0xd'),_0x5888f5,'request\x20sent');logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x5888f5,'request\x20sent',JSON[_0xa58e('0xe')](_0x2dfd1e));if(_0x2dfd1e[_0xa58e('0xf')]){if(_0x2dfd1e[_0xa58e('0xf')][_0xa58e('0x10')]===0x1f4){logger[_0xa58e('0xf')](_0xa58e('0xd'),_0x5888f5,_0x2dfd1e['error'][_0xa58e('0x11')]);return _0x18942a(_0x2dfd1e[_0xa58e('0xf')][_0xa58e('0x11')]);}logger[_0xa58e('0xf')](_0xa58e('0xd'),_0x5888f5,_0x2dfd1e[_0xa58e('0xf')][_0xa58e('0x11')]);return _0xa70be8(_0x2dfd1e[_0xa58e('0xf')][_0xa58e('0x11')]);}else{logger[_0xa58e('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x5888f5,'request\x20sent');_0xa70be8(_0x2dfd1e['result'][_0xa58e('0x11')]);}})[_0xa58e('0x12')](function(_0x587403){logger[_0xa58e('0xf')](_0xa58e('0xd'),_0x5888f5,_0x587403);_0x18942a(_0x587403);});});} \ No newline at end of file +var _0x1869=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4c8b62,_0x372804){var _0x59288a=function(_0x102aef){while(--_0x102aef){_0x4c8b62['push'](_0x4c8b62['shift']());}};_0x59288a(++_0x372804);}(_0x1869,0x68));var _0x9186=function(_0x1fbc06,_0x4cfe7a){_0x1fbc06=_0x1fbc06-0x0;var _0x143c60=_0x1869[_0x1fbc06];return _0x143c60;};'use strict';var _=require(_0x9186('0x0'));var util=require(_0x9186('0x1'));var moment=require(_0x9186('0x2'));var BPromise=require(_0x9186('0x3'));var rs=require(_0x9186('0x4'));var fs=require('fs');var Redis=require(_0x9186('0x5'));var db=require(_0x9186('0x6'))['db'];var utils=require(_0x9186('0x7'));var logger=require(_0x9186('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9186('0x9'));var client=jayson[_0x9186('0xa')][_0x9186('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23cd91,_0x12a9cd,_0x2815ca){return new BPromise(function(_0xb858f9,_0x593a75){return client[_0x9186('0xc')](_0x23cd91,_0x2815ca)['then'](function(_0x241d4f){logger['info'](_0x9186('0xd'),_0x12a9cd,_0x9186('0xe'));logger['debug'](_0x9186('0xf'),_0x12a9cd,_0x9186('0xe'),JSON[_0x9186('0x10')](_0x241d4f));if(_0x241d4f['error']){if(_0x241d4f[_0x9186('0x11')]['code']===0x1f4){logger[_0x9186('0x11')](_0x9186('0xd'),_0x12a9cd,_0x241d4f[_0x9186('0x11')][_0x9186('0x12')]);return _0x593a75(_0x241d4f['error'][_0x9186('0x12')]);}logger[_0x9186('0x11')](_0x9186('0xd'),_0x12a9cd,_0x241d4f[_0x9186('0x11')]['message']);return _0xb858f9(_0x241d4f[_0x9186('0x11')][_0x9186('0x12')]);}else{logger[_0x9186('0x13')](_0x9186('0xd'),_0x12a9cd,_0x9186('0xe'));_0xb858f9(_0x241d4f[_0x9186('0x14')][_0x9186('0x12')]);}})[_0x9186('0x15')](function(_0x1bab93){logger[_0x9186('0x11')](_0x9186('0xd'),_0x12a9cd,_0x1bab93);_0x593a75(_0x1bab93);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 775e772..5522834 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 _0x4622=['isAuthenticated','index','show','post','create','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./analyticTreeReport.controller','get'];(function(_0x47275d,_0x593938){var _0x1e3176=function(_0x329fab){while(--_0x329fab){_0x47275d['push'](_0x47275d['shift']());}};_0x1e3176(++_0x593938);}(_0x4622,0x158));var _0x2462=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0x4622[_0x13c70c];return _0x50f0f2;};'use strict';var multer=require(_0x2462('0x0'));var util=require(_0x2462('0x1'));var path=require(_0x2462('0x2'));var timeout=require(_0x2462('0x3'));var express=require('express');var router=express[_0x2462('0x4')]();var auth=require(_0x2462('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2462('0x6'));router[_0x2462('0x7')]('/',auth[_0x2462('0x8')](),controller[_0x2462('0x9')]);router[_0x2462('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x2462('0xa')]);router[_0x2462('0xb')]('/',auth[_0x2462('0x8')](),controller[_0x2462('0xc')]);router['put'](_0x2462('0xd'),auth[_0x2462('0x8')](),controller['update']);router['delete'](_0x2462('0xd'),auth[_0x2462('0x8')](),controller[_0x2462('0xe')]);module[_0x2462('0xf')]=router; \ No newline at end of file +var _0xf362=['exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x233a4c,_0x3ef6e1){var _0x51d977=function(_0x5f27f7){while(--_0x5f27f7){_0x233a4c['push'](_0x233a4c['shift']());}};_0x51d977(++_0x3ef6e1);}(_0xf362,0x89));var _0x2f36=function(_0x33b2ad,_0x20d161){_0x33b2ad=_0x33b2ad-0x0;var _0x3d333f=_0xf362[_0x33b2ad];return _0x3d333f;};'use strict';var multer=require(_0x2f36('0x0'));var util=require(_0x2f36('0x1'));var path=require('path');var timeout=require(_0x2f36('0x2'));var express=require('express');var router=express[_0x2f36('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2f36('0x4'));var config=require(_0x2f36('0x5'));var controller=require(_0x2f36('0x6'));router[_0x2f36('0x7')]('/',auth[_0x2f36('0x8')](),controller[_0x2f36('0x9')]);router[_0x2f36('0x7')]('/:id',auth[_0x2f36('0x8')](),controller[_0x2f36('0xa')]);router[_0x2f36('0xb')]('/',auth[_0x2f36('0x8')](),controller[_0x2f36('0xc')]);router[_0x2f36('0xd')](_0x2f36('0xe'),auth[_0x2f36('0x8')](),controller[_0x2f36('0xf')]);router['delete'](_0x2f36('0xe'),auth[_0x2f36('0x8')](),controller['destroy']);module[_0x2f36('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index e60a4e5..5b99342 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 _0x6c21=['sequelize','STRING'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x6c21,0x130));var _0x16c2=function(_0x4477f6,_0x786920){_0x4477f6=_0x4477f6-0x0;var _0x2de580=_0x6c21[_0x4477f6];return _0x2de580;};'use strict';var Sequelize=require(_0x16c2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x16c2('0x1')]},'type':{'type':Sequelize[_0x16c2('0x1')]}}; \ No newline at end of file +var _0xab24=['STRING','sequelize','exports'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xab24,0x1db));var _0x4ab2=function(_0x2ba459,_0x130fa8){_0x2ba459=_0x2ba459-0x0;var _0x26eb9f=_0xab24[_0x2ba459];return _0x26eb9f;};'use strict';var Sequelize=require(_0x4ab2('0x0'));module[_0x4ab2('0x1')]={'name':{'type':Sequelize[_0x4ab2('0x2')]},'basename':{'type':Sequelize[_0x4ab2('0x2')]},'type':{'type':Sequelize[_0x4ab2('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index cd87595..b796454 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 _0xca48=['name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','show','params','keys','options','find','catch','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','join','server/files/attachments/','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xca48,0x18e));var _0x8ca4=function(_0x332c1b,_0x28d711){_0x332c1b=_0x332c1b-0x0;var _0x21b49b=_0xca48[_0x332c1b];return _0x21b49b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8ca4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8ca4('0x1'));var rp=require(_0x8ca4('0x2'));var moment=require(_0x8ca4('0x3'));var BPromise=require(_0x8ca4('0x4'));var Mustache=require(_0x8ca4('0x5'));var util=require('util');var path=require(_0x8ca4('0x6'));var sox=require(_0x8ca4('0x7'));var csv=require('to-csv');var ejs=require(_0x8ca4('0x8'));var fs=require('fs');var _=require(_0x8ca4('0x9'));var squel=require(_0x8ca4('0xa'));var crypto=require('crypto');var jsforce=require(_0x8ca4('0xb'));var deskjs=require(_0x8ca4('0xc'));var toCsv=require(_0x8ca4('0xd'));var querystring=require(_0x8ca4('0xe'));var Papa=require(_0x8ca4('0xf'));var Redis=require(_0x8ca4('0x10'));var authService=require(_0x8ca4('0x11'));var qs=require(_0x8ca4('0x12'));var as=require(_0x8ca4('0x13'));var hardwareService=require(_0x8ca4('0x14'));var logger=require('../../config/logger')(_0x8ca4('0x15'));var utils=require(_0x8ca4('0x16'));var config=require(_0x8ca4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1006f5,_0x3c5ea9){_0x3c5ea9=_0x3c5ea9||0xcc;return function(_0x155d14){if(_0x155d14){return _0x1006f5['sendStatus'](_0x3c5ea9);}return _0x1006f5[_0x8ca4('0x18')](_0x3c5ea9)[_0x8ca4('0x19')]();};}function respondWithResult(_0x4f47c4,_0x301d33){_0x301d33=_0x301d33||0xc8;return function(_0x465f52){if(_0x465f52){return _0x4f47c4[_0x8ca4('0x18')](_0x301d33)[_0x8ca4('0x1a')](_0x465f52);}};}function respondWithFilteredResult(_0x223356,_0x39b90d){return function(_0x3a8932){if(_0x3a8932){var _0x5ab01b=_0x3a8932[_0x8ca4('0x1b')],_0x252d22=_0x39b90d[_0x8ca4('0x1c')],_0x1fa89c=_0x39b90d[_0x8ca4('0x1c')]+_0x39b90d[_0x8ca4('0x1d')],_0x514fa6;if(_0x1fa89c>=_0x5ab01b){_0x1fa89c=_0x5ab01b;_0x514fa6=0xc8;}else{_0x514fa6=0xce;}_0x223356['status'](_0x514fa6);return _0x223356[_0x8ca4('0x1e')](_0x8ca4('0x1f'),_0x252d22+'-'+_0x1fa89c+'/'+_0x5ab01b)['json'](_0x3a8932);}return null;};}function patchUpdates(_0x475395){return function(_0x988019){try{jsonpatch[_0x8ca4('0x20')](_0x988019,_0x475395,!![]);}catch(_0x2936d2){return BPromise[_0x8ca4('0x21')](_0x2936d2);}return _0x988019[_0x8ca4('0x22')]();};}function saveUpdates(_0xad651e,_0x528cec){return function(_0x32c779){if(_0x32c779){return _0x32c779[_0x8ca4('0x23')](_0xad651e)['then'](function(_0x32b3c0){return _0x32b3c0;});}return null;};}function removeEntity(_0x37e635,_0x48870c){return function(_0x29533c){if(_0x29533c){return _0x29533c[_0x8ca4('0x24')]()['then'](function(){_0x37e635[_0x8ca4('0x18')](0xcc)[_0x8ca4('0x19')]();});}};}function handleEntityNotFound(_0x5ce38d,_0x50b01e){return function(_0x4adc2d){if(!_0x4adc2d){_0x5ce38d['sendStatus'](0x194);}return _0x4adc2d;};}function handleError(_0x5c9d6e,_0x9d2f8a){_0x9d2f8a=_0x9d2f8a||0x1f4;return function(_0x56d4b9){logger['error'](_0x56d4b9['stack']);if(_0x56d4b9[_0x8ca4('0x25')]){delete _0x56d4b9[_0x8ca4('0x25')];}_0x5c9d6e[_0x8ca4('0x18')](_0x9d2f8a)[_0x8ca4('0x26')](_0x56d4b9);};}exports[_0x8ca4('0x27')]=function(_0x302d18,_0x5a89ba){var _0x3d67c0={},_0x275aea={},_0x2a1554={'count':0x0,'rows':[]};var _0x43804f=_[_0x8ca4('0x28')](db[_0x8ca4('0x29')][_0x8ca4('0x2a')],function(_0x44e241){return{'name':_0x44e241[_0x8ca4('0x2b')],'type':_0x44e241[_0x8ca4('0x2c')][_0x8ca4('0x2d')]};});_0x275aea['model']=_[_0x8ca4('0x28')](_0x43804f,'name');_0x275aea[_0x8ca4('0x2e')]=_['keys'](_0x302d18[_0x8ca4('0x2e')]);_0x275aea['filters']=_[_0x8ca4('0x2f')](_0x275aea[_0x8ca4('0x30')],_0x275aea['query']);_0x3d67c0[_0x8ca4('0x31')]=_[_0x8ca4('0x2f')](_0x275aea['model'],qs[_0x8ca4('0x32')](_0x302d18[_0x8ca4('0x2e')][_0x8ca4('0x32')]));_0x3d67c0['attributes']=_0x3d67c0[_0x8ca4('0x31')][_0x8ca4('0x33')]?_0x3d67c0['attributes']:_0x275aea[_0x8ca4('0x30')];if(!_0x302d18['query'][_0x8ca4('0x34')]('nolimit')){_0x3d67c0[_0x8ca4('0x1d')]=qs['limit'](_0x302d18[_0x8ca4('0x2e')][_0x8ca4('0x1d')]);_0x3d67c0[_0x8ca4('0x1c')]=qs[_0x8ca4('0x1c')](_0x302d18[_0x8ca4('0x2e')][_0x8ca4('0x1c')]);}_0x3d67c0[_0x8ca4('0x35')]=qs[_0x8ca4('0x36')](_0x302d18[_0x8ca4('0x2e')][_0x8ca4('0x36')]);_0x3d67c0['where']=qs[_0x8ca4('0x37')](_['pick'](_0x302d18[_0x8ca4('0x2e')],_0x275aea[_0x8ca4('0x37')]));if(_0x302d18[_0x8ca4('0x2e')][_0x8ca4('0x38')]){_0x3d67c0[_0x8ca4('0x39')]=_[_0x8ca4('0x3a')](_0x3d67c0[_0x8ca4('0x39')],{'$or':_[_0x8ca4('0x28')](_0x43804f,function(_0xfd4f91){if(_0xfd4f91[_0x8ca4('0x2c')]!==_0x8ca4('0x3b')){var _0x82ae24={};_0x82ae24[_0xfd4f91['name']]={'$like':'%'+_0x302d18['query'][_0x8ca4('0x38')]+'%'};return _0x82ae24;}})});}_0x3d67c0=_['merge']({},_0x3d67c0,_0x302d18['options']);var _0x440945={'where':_0x3d67c0[_0x8ca4('0x39')]};return db[_0x8ca4('0x29')][_0x8ca4('0x1b')](_0x440945)[_0x8ca4('0x3c')](function(_0x158148){_0x2a1554[_0x8ca4('0x1b')]=_0x158148;if(_0x302d18[_0x8ca4('0x2e')][_0x8ca4('0x3d')]){_0x3d67c0[_0x8ca4('0x3e')]=[{'all':!![]}];}return db[_0x8ca4('0x29')][_0x8ca4('0x3f')](_0x3d67c0);})['then'](function(_0x33ef66){_0x2a1554[_0x8ca4('0x40')]=_0x33ef66;return _0x2a1554;})[_0x8ca4('0x3c')](respondWithFilteredResult(_0x5a89ba,_0x3d67c0))['catch'](handleError(_0x5a89ba,null));};exports[_0x8ca4('0x41')]=function(_0x2bb081,_0x261872){var _0x12cced={'raw':!![],'where':{'id':_0x2bb081[_0x8ca4('0x42')]['id']}},_0x5a6100={};_0x5a6100[_0x8ca4('0x30')]=_['keys'](db[_0x8ca4('0x29')][_0x8ca4('0x2a')]);_0x5a6100[_0x8ca4('0x2e')]=_[_0x8ca4('0x43')](_0x2bb081[_0x8ca4('0x2e')]);_0x5a6100[_0x8ca4('0x37')]=_[_0x8ca4('0x2f')](_0x5a6100['model'],_0x5a6100[_0x8ca4('0x2e')]);_0x12cced[_0x8ca4('0x31')]=_['intersection'](_0x5a6100[_0x8ca4('0x30')],qs['fields'](_0x2bb081[_0x8ca4('0x2e')][_0x8ca4('0x32')]));_0x12cced[_0x8ca4('0x31')]=_0x12cced['attributes']['length']?_0x12cced[_0x8ca4('0x31')]:_0x5a6100[_0x8ca4('0x30')];if(_0x2bb081[_0x8ca4('0x2e')]['includeAll']){_0x12cced[_0x8ca4('0x3e')]=[{'all':!![]}];}_0x12cced=_[_0x8ca4('0x3a')]({},_0x12cced,_0x2bb081[_0x8ca4('0x44')]);return db[_0x8ca4('0x29')][_0x8ca4('0x45')](_0x12cced)[_0x8ca4('0x3c')](handleEntityNotFound(_0x261872,null))['then'](respondWithResult(_0x261872,null))[_0x8ca4('0x46')](handleError(_0x261872,null));};exports[_0x8ca4('0x47')]=function(_0x739f86,_0x52aa42){var _0x9e6f9b={'where':{'id':_0x739f86[_0x8ca4('0x42')]['id']}},_0x11fe49={};_0x11fe49['model']=_[_0x8ca4('0x43')](db[_0x8ca4('0x29')][_0x8ca4('0x2a')]);_0x9e6f9b[_0x8ca4('0x31')]=_[_0x8ca4('0x2f')](_0x11fe49[_0x8ca4('0x30')],qs[_0x8ca4('0x32')](_0x739f86[_0x8ca4('0x2e')][_0x8ca4('0x32')]));_0x9e6f9b['attributes']=_0x9e6f9b['attributes'][_0x8ca4('0x33')]?_0x9e6f9b[_0x8ca4('0x31')]:_0x11fe49[_0x8ca4('0x30')];if(_0x739f86[_0x8ca4('0x2e')][_0x8ca4('0x3d')]){_0x9e6f9b[_0x8ca4('0x3e')]=[{'all':!![]}];}_0x9e6f9b=_[_0x8ca4('0x3a')]({},_0x9e6f9b,_0x739f86['options']);return db[_0x8ca4('0x29')][_0x8ca4('0x45')](_0x9e6f9b)[_0x8ca4('0x3c')](handleEntityNotFound(_0x52aa42,null))[_0x8ca4('0x3c')](function(_0x25fbe6){if(_0x25fbe6){var _0x2747bb=_0x25fbe6[_0x8ca4('0x48')]({'plain':!![]});_0x2747bb=qs[_0x8ca4('0x49')](_0x2747bb,['id',_0x8ca4('0x4a'),_0x8ca4('0x4b')]);_0x739f86[_0x8ca4('0x4c')]=_[_0x8ca4('0x49')](_0x739f86[_0x8ca4('0x4c')],['id',_0x8ca4('0x4a'),_0x8ca4('0x4b')]);return db[_0x8ca4('0x29')]['create'](_[_0x8ca4('0x3a')](_0x2747bb,_0x739f86[_0x8ca4('0x4c')]),{'include':_0x739f86[_0x8ca4('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x8ca4('0x3c')](respondWithResult(_0x52aa42,0xc9))[_0x8ca4('0x46')](handleError(_0x52aa42,null));};exports[_0x8ca4('0x23')]=function(_0xf550cb,_0x52aab8){if(_0xf550cb[_0x8ca4('0x4c')]['id']){delete _0xf550cb[_0x8ca4('0x4c')]['id'];}return db[_0x8ca4('0x29')][_0x8ca4('0x45')]({'where':{'id':_0xf550cb[_0x8ca4('0x42')]['id']}})['then'](handleEntityNotFound(_0x52aab8,null))[_0x8ca4('0x3c')](saveUpdates(_0xf550cb['body'],null))[_0x8ca4('0x3c')](respondWithResult(_0x52aab8,null))[_0x8ca4('0x46')](handleError(_0x52aab8,null));};exports[_0x8ca4('0x24')]=function(_0x529e63,_0x5edf37){return db[_0x8ca4('0x29')][_0x8ca4('0x45')]({'where':{'id':_0x529e63[_0x8ca4('0x42')]['id']}})[_0x8ca4('0x3c')](handleEntityNotFound(_0x5edf37,null))[_0x8ca4('0x3c')](removeEntity(_0x5edf37,null))['catch'](handleError(_0x5edf37,null));};exports[_0x8ca4('0x4d')]=function(_0x30e547,_0x3ab224,_0x354ae6){_0x30e547[_0x8ca4('0x4c')][_0x8ca4('0x25')]=_0x30e547[_0x8ca4('0x4e')][_0x8ca4('0x4f')];_0x30e547[_0x8ca4('0x4c')][_0x8ca4('0x50')]=_0x30e547[_0x8ca4('0x4e')][_0x8ca4('0x51')];_0x30e547[_0x8ca4('0x4c')]['type']=_0x30e547[_0x8ca4('0x4e')][_0x8ca4('0x52')];return db[_0x8ca4('0x29')]['create'](_0x30e547[_0x8ca4('0x4c')])[_0x8ca4('0x3c')](respondWithResult(_0x3ab224,0xc9))[_0x8ca4('0x46')](handleError(_0x3ab224,null));};exports[_0x8ca4('0x53')]=function(_0x1e6800,_0x4cac29,_0x1c229a){return db[_0x8ca4('0x29')][_0x8ca4('0x54')]({'where':{'id':_0x1e6800[_0x8ca4('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4cac29,null))[_0x8ca4('0x3c')](function(_0x22b4bc){if(_0x22b4bc){return _0x4cac29['download'](path[_0x8ca4('0x55')](config['root'],_0x8ca4('0x56'),_0x22b4bc[_0x8ca4('0x50')]));}})[_0x8ca4('0x46')](handleError(_0x4cac29,null));}; \ No newline at end of file +var _0xfb69=['sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','clone','keys','find','get','createdAt','updatedAt','body','omit','create','file','basename','filename','mimetype','download','join','server/files/attachments/','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','Attachment','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x44b362,_0x1b5fd9){var _0x38b45c=function(_0x163919){while(--_0x163919){_0x44b362['push'](_0x44b362['shift']());}};_0x38b45c(++_0x1b5fd9);}(_0xfb69,0x1c2));var _0x9fb6=function(_0x48ac83,_0x2ae540){_0x48ac83=_0x48ac83-0x0;var _0x3c450f=_0xfb69[_0x48ac83];return _0x3c450f;};'use strict';var pdf=require(_0x9fb6('0x0'));var emlformat=require(_0x9fb6('0x1'));var rimraf=require(_0x9fb6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9fb6('0x3'));var moment=require('moment');var BPromise=require(_0x9fb6('0x4'));var Mustache=require(_0x9fb6('0x5'));var util=require('util');var path=require(_0x9fb6('0x6'));var sox=require(_0x9fb6('0x7'));var csv=require(_0x9fb6('0x8'));var ejs=require(_0x9fb6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9fb6('0xa'));var crypto=require(_0x9fb6('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9fb6('0x8'));var querystring=require('querystring');var Papa=require(_0x9fb6('0xc'));var Redis=require('ioredis');var authService=require(_0x9fb6('0xd'));var qs=require(_0x9fb6('0xe'));var as=require(_0x9fb6('0xf'));var hardwareService=require(_0x9fb6('0x10'));var logger=require(_0x9fb6('0x11'))(_0x9fb6('0x12'));var utils=require(_0x9fb6('0x13'));var config=require(_0x9fb6('0x14'));var db=require(_0x9fb6('0x15'))['db'];function respondWithStatusCode(_0x18f877,_0x12de61){_0x12de61=_0x12de61||0xcc;return function(_0x3432ef){if(_0x3432ef){return _0x18f877[_0x9fb6('0x16')](_0x12de61);}return _0x18f877[_0x9fb6('0x17')](_0x12de61)[_0x9fb6('0x18')]();};}function respondWithResult(_0x126f0f,_0x102395){_0x102395=_0x102395||0xc8;return function(_0x23df52){if(_0x23df52){return _0x126f0f[_0x9fb6('0x17')](_0x102395)['json'](_0x23df52);}};}function respondWithFilteredResult(_0x7b39d2,_0xedcb4a){return function(_0x468270){if(_0x468270){var _0x5eb3ca=_0x468270[_0x9fb6('0x19')],_0xfcac0=_0xedcb4a[_0x9fb6('0x1a')],_0x5ee9ee=_0xedcb4a[_0x9fb6('0x1a')]+_0xedcb4a['limit'],_0x358538;if(_0x5ee9ee>=_0x5eb3ca){_0x5ee9ee=_0x5eb3ca;_0x358538=0xc8;}else{_0x358538=0xce;}_0x7b39d2[_0x9fb6('0x17')](_0x358538);return _0x7b39d2['set'](_0x9fb6('0x1b'),_0xfcac0+'-'+_0x5ee9ee+'/'+_0x5eb3ca)[_0x9fb6('0x1c')](_0x468270);}return null;};}function patchUpdates(_0x293f00){return function(_0x41f74f){try{jsonpatch[_0x9fb6('0x1d')](_0x41f74f,_0x293f00,!![]);}catch(_0x4de3ad){return BPromise[_0x9fb6('0x1e')](_0x4de3ad);}return _0x41f74f[_0x9fb6('0x1f')]();};}function saveUpdates(_0x5bc414,_0x2bb9a5){return function(_0x53f1a6){if(_0x53f1a6){return _0x53f1a6[_0x9fb6('0x20')](_0x5bc414)[_0x9fb6('0x21')](function(_0x51c8e6){return _0x51c8e6;});}return null;};}function removeEntity(_0x3f0ecb,_0x249242){return function(_0x302026){if(_0x302026){return _0x302026[_0x9fb6('0x22')]()[_0x9fb6('0x21')](function(){_0x3f0ecb[_0x9fb6('0x17')](0xcc)[_0x9fb6('0x18')]();});}};}function handleEntityNotFound(_0x12d091,_0x4c260f){return function(_0x27eeb3){if(!_0x27eeb3){_0x12d091[_0x9fb6('0x16')](0x194);}return _0x27eeb3;};}function handleError(_0xdeb02,_0x32cd6f){_0x32cd6f=_0x32cd6f||0x1f4;return function(_0x3f74f5){logger[_0x9fb6('0x23')](_0x3f74f5['stack']);if(_0x3f74f5[_0x9fb6('0x24')]){delete _0x3f74f5[_0x9fb6('0x24')];}_0xdeb02['status'](_0x32cd6f)['send'](_0x3f74f5);};}exports[_0x9fb6('0x25')]=function(_0x21570c,_0x1940d7){var _0x2ae2fe={},_0x7f1aad={},_0x5c2c5f={'count':0x0,'rows':[]};var _0x41f178=_[_0x9fb6('0x26')](db[_0x9fb6('0x27')][_0x9fb6('0x28')],function(_0x4f09ff){return{'name':_0x4f09ff['fieldName'],'type':_0x4f09ff[_0x9fb6('0x29')][_0x9fb6('0x2a')]};});_0x7f1aad[_0x9fb6('0x2b')]=_['map'](_0x41f178,_0x9fb6('0x24'));_0x7f1aad[_0x9fb6('0x2c')]=_['keys'](_0x21570c['query']);_0x7f1aad[_0x9fb6('0x2d')]=_[_0x9fb6('0x2e')](_0x7f1aad[_0x9fb6('0x2b')],_0x7f1aad['query']);_0x2ae2fe[_0x9fb6('0x2f')]=_['intersection'](_0x7f1aad[_0x9fb6('0x2b')],qs[_0x9fb6('0x30')](_0x21570c[_0x9fb6('0x2c')][_0x9fb6('0x30')]));_0x2ae2fe[_0x9fb6('0x2f')]=_0x2ae2fe[_0x9fb6('0x2f')][_0x9fb6('0x31')]?_0x2ae2fe[_0x9fb6('0x2f')]:_0x7f1aad[_0x9fb6('0x2b')];if(!_0x21570c[_0x9fb6('0x2c')][_0x9fb6('0x32')](_0x9fb6('0x33'))){_0x2ae2fe[_0x9fb6('0x34')]=qs[_0x9fb6('0x34')](_0x21570c[_0x9fb6('0x2c')][_0x9fb6('0x34')]);_0x2ae2fe[_0x9fb6('0x1a')]=qs[_0x9fb6('0x1a')](_0x21570c[_0x9fb6('0x2c')][_0x9fb6('0x1a')]);}_0x2ae2fe[_0x9fb6('0x35')]=qs[_0x9fb6('0x36')](_0x21570c[_0x9fb6('0x2c')]['sort']);_0x2ae2fe['where']=qs[_0x9fb6('0x2d')](_[_0x9fb6('0x37')](_0x21570c[_0x9fb6('0x2c')],_0x7f1aad[_0x9fb6('0x2d')]));if(_0x21570c[_0x9fb6('0x2c')][_0x9fb6('0x38')]){_0x2ae2fe[_0x9fb6('0x39')]=_[_0x9fb6('0x3a')](_0x2ae2fe[_0x9fb6('0x39')],{'$or':_['map'](_0x41f178,function(_0x385fdb){if(_0x385fdb[_0x9fb6('0x29')]!==_0x9fb6('0x3b')){var _0x4be48e={};_0x4be48e[_0x385fdb[_0x9fb6('0x24')]]={'$like':'%'+_0x21570c[_0x9fb6('0x2c')][_0x9fb6('0x38')]+'%'};return _0x4be48e;}})});}_0x2ae2fe=_['merge']({},_0x2ae2fe,_0x21570c[_0x9fb6('0x3c')]);var _0x21843a={'where':_0x2ae2fe[_0x9fb6('0x39')]};return db[_0x9fb6('0x27')][_0x9fb6('0x19')](_0x21843a)[_0x9fb6('0x21')](function(_0x2e5503){_0x5c2c5f[_0x9fb6('0x19')]=_0x2e5503;if(_0x21570c['query'][_0x9fb6('0x3d')]){_0x2ae2fe[_0x9fb6('0x3e')]=[{'all':!![]}];}return db[_0x9fb6('0x27')][_0x9fb6('0x3f')](_0x2ae2fe);})[_0x9fb6('0x21')](function(_0xf79771){_0x5c2c5f[_0x9fb6('0x40')]=_0xf79771;return _0x5c2c5f;})['then'](respondWithFilteredResult(_0x1940d7,_0x2ae2fe))[_0x9fb6('0x41')](handleError(_0x1940d7,null));};exports[_0x9fb6('0x42')]=function(_0x28dc42,_0x4bb803){var _0x29772f={'raw':!![],'where':{'id':_0x28dc42[_0x9fb6('0x43')]['id']}},_0x334595={};_0x334595[_0x9fb6('0x2b')]=_['keys'](db[_0x9fb6('0x27')]['rawAttributes']);_0x334595['query']=_['keys'](_0x28dc42[_0x9fb6('0x2c')]);_0x334595['filters']=_[_0x9fb6('0x2e')](_0x334595['model'],_0x334595[_0x9fb6('0x2c')]);_0x29772f[_0x9fb6('0x2f')]=_['intersection'](_0x334595[_0x9fb6('0x2b')],qs[_0x9fb6('0x30')](_0x28dc42[_0x9fb6('0x2c')][_0x9fb6('0x30')]));_0x29772f[_0x9fb6('0x2f')]=_0x29772f[_0x9fb6('0x2f')][_0x9fb6('0x31')]?_0x29772f[_0x9fb6('0x2f')]:_0x334595[_0x9fb6('0x2b')];if(_0x28dc42[_0x9fb6('0x2c')]['includeAll']){_0x29772f[_0x9fb6('0x3e')]=[{'all':!![]}];}_0x29772f=_[_0x9fb6('0x3a')]({},_0x29772f,_0x28dc42[_0x9fb6('0x3c')]);return db[_0x9fb6('0x27')]['find'](_0x29772f)[_0x9fb6('0x21')](handleEntityNotFound(_0x4bb803,null))[_0x9fb6('0x21')](respondWithResult(_0x4bb803,null))[_0x9fb6('0x41')](handleError(_0x4bb803,null));};exports[_0x9fb6('0x44')]=function(_0x4cebc2,_0x2973ed){var _0x384f38={'where':{'id':_0x4cebc2[_0x9fb6('0x43')]['id']}},_0x2e37a8={};_0x2e37a8[_0x9fb6('0x2b')]=_[_0x9fb6('0x45')](db[_0x9fb6('0x27')][_0x9fb6('0x28')]);_0x384f38['attributes']=_['intersection'](_0x2e37a8[_0x9fb6('0x2b')],qs[_0x9fb6('0x30')](_0x4cebc2['query'][_0x9fb6('0x30')]));_0x384f38[_0x9fb6('0x2f')]=_0x384f38[_0x9fb6('0x2f')][_0x9fb6('0x31')]?_0x384f38['attributes']:_0x2e37a8[_0x9fb6('0x2b')];if(_0x4cebc2['query'][_0x9fb6('0x3d')]){_0x384f38[_0x9fb6('0x3e')]=[{'all':!![]}];}_0x384f38=_[_0x9fb6('0x3a')]({},_0x384f38,_0x4cebc2['options']);return db[_0x9fb6('0x27')][_0x9fb6('0x46')](_0x384f38)[_0x9fb6('0x21')](handleEntityNotFound(_0x2973ed,null))['then'](function(_0x4f7461){if(_0x4f7461){var _0x2f6c94=_0x4f7461[_0x9fb6('0x47')]({'plain':!![]});_0x2f6c94=qs['omit'](_0x2f6c94,['id',_0x9fb6('0x48'),_0x9fb6('0x49')]);_0x4cebc2[_0x9fb6('0x4a')]=_[_0x9fb6('0x4b')](_0x4cebc2[_0x9fb6('0x4a')],['id',_0x9fb6('0x48'),_0x9fb6('0x49')]);return db[_0x9fb6('0x27')][_0x9fb6('0x4c')](_[_0x9fb6('0x3a')](_0x2f6c94,_0x4cebc2[_0x9fb6('0x4a')]),{'include':_0x4cebc2[_0x9fb6('0x2c')][_0x9fb6('0x3d')]?[{'all':!![]}]:undefined});}})[_0x9fb6('0x21')](respondWithResult(_0x2973ed,0xc9))['catch'](handleError(_0x2973ed,null));};exports[_0x9fb6('0x20')]=function(_0x359328,_0x3b1ac2){if(_0x359328[_0x9fb6('0x4a')]['id']){delete _0x359328['body']['id'];}return db['Attachment'][_0x9fb6('0x46')]({'where':{'id':_0x359328[_0x9fb6('0x43')]['id']}})[_0x9fb6('0x21')](handleEntityNotFound(_0x3b1ac2,null))[_0x9fb6('0x21')](saveUpdates(_0x359328[_0x9fb6('0x4a')],null))[_0x9fb6('0x21')](respondWithResult(_0x3b1ac2,null))['catch'](handleError(_0x3b1ac2,null));};exports[_0x9fb6('0x22')]=function(_0x2d32a1,_0x3493c4){return db[_0x9fb6('0x27')][_0x9fb6('0x46')]({'where':{'id':_0x2d32a1[_0x9fb6('0x43')]['id']}})['then'](handleEntityNotFound(_0x3493c4,null))[_0x9fb6('0x21')](removeEntity(_0x3493c4,null))[_0x9fb6('0x41')](handleError(_0x3493c4,null));};exports[_0x9fb6('0x4c')]=function(_0xb2c36,_0x48d0e4,_0x59218a){_0xb2c36['body']['name']=_0xb2c36[_0x9fb6('0x4d')]['originalname'];_0xb2c36[_0x9fb6('0x4a')][_0x9fb6('0x4e')]=_0xb2c36[_0x9fb6('0x4d')][_0x9fb6('0x4f')];_0xb2c36[_0x9fb6('0x4a')]['type']=_0xb2c36[_0x9fb6('0x4d')][_0x9fb6('0x50')];return db[_0x9fb6('0x27')][_0x9fb6('0x4c')](_0xb2c36[_0x9fb6('0x4a')])[_0x9fb6('0x21')](respondWithResult(_0x48d0e4,0xc9))[_0x9fb6('0x41')](handleError(_0x48d0e4,null));};exports[_0x9fb6('0x51')]=function(_0x4a7434,_0xb312fc,_0x53cbe1){return db[_0x9fb6('0x27')]['findOne']({'where':{'id':_0x4a7434['params']['id']},'raw':!![]})[_0x9fb6('0x21')](handleEntityNotFound(_0xb312fc,null))[_0x9fb6('0x21')](function(_0x5186e0){if(_0x5186e0){return _0xb312fc[_0x9fb6('0x51')](path[_0x9fb6('0x52')](config['root'],_0x9fb6('0x53'),_0x5186e0[_0x9fb6('0x4e')]));}})[_0x9fb6('0x41')](handleError(_0xb312fc,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 080707d..d50451d 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 _0x57c3=['path','rimraf','../../config/environment','exports','define','Attachment','attachments','lodash','util','../../config/logger','request-promise'];(function(_0x22c52f,_0x555480){var _0x17630b=function(_0x222cfe){while(--_0x222cfe){_0x22c52f['push'](_0x22c52f['shift']());}};_0x17630b(++_0x555480);}(_0x57c3,0xc2));var _0x357c=function(_0x288712,_0x14bfd9){_0x288712=_0x288712-0x0;var _0x3f5314=_0x57c3[_0x288712];return _0x3f5314;};'use strict';var _=require(_0x357c('0x0'));var util=require(_0x357c('0x1'));var logger=require(_0x357c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x357c('0x3'));var fs=require('fs');var path=require(_0x357c('0x4'));var rimraf=require(_0x357c('0x5'));var config=require(_0x357c('0x6'));var attributes=require('./attachment.attributes');module[_0x357c('0x7')]=function(_0x4ef0ce,_0x26c35d){return _0x4ef0ce[_0x357c('0x8')](_0x357c('0x9'),attributes,{'tableName':_0x357c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7708=['../../config/environment','exports','define','Attachment','attachments','lodash','util','api','rimraf'];(function(_0x57062d,_0x2f2c1f){var _0x2ccfa6=function(_0x5b3b3f){while(--_0x5b3b3f){_0x57062d['push'](_0x57062d['shift']());}};_0x2ccfa6(++_0x2f2c1f);}(_0x7708,0x188));var _0x8770=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0x7708[_0x2f1114];return _0x2fe856;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./attachment.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'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 fbecbdf..fc655a5 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 _0x9c66=['Attachment,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','CreateAttachment','Attachment','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','request','then'];(function(_0x591a13,_0x14f0f1){var _0x2d481c=function(_0x75c6d8){while(--_0x75c6d8){_0x591a13['push'](_0x591a13['shift']());}};_0x2d481c(++_0x14f0f1);}(_0x9c66,0x176));var _0x69c6=function(_0x5817e6,_0x44a2d0){_0x5817e6=_0x5817e6-0x0;var _0x51916a=_0x9c66[_0x5817e6];return _0x51916a;};'use strict';var _=require(_0x69c6('0x0'));var util=require(_0x69c6('0x1'));var moment=require(_0x69c6('0x2'));var BPromise=require(_0x69c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69c6('0x4'));var db=require(_0x69c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x69c6('0x6'))(_0x69c6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3509b5,_0x16857d,_0x36e670){return new BPromise(function(_0x1c2a20,_0x2d9715){return client[_0x69c6('0x8')](_0x3509b5,_0x36e670)[_0x69c6('0x9')](function(_0x1a4c78){logger['info'](_0x69c6('0xa'),_0x16857d,'request\x20sent');logger[_0x69c6('0xb')]('Attachment,\x20%s,\x20%s,\x20%s',_0x16857d,_0x69c6('0xc'),JSON['stringify'](_0x1a4c78));if(_0x1a4c78['error']){if(_0x1a4c78[_0x69c6('0xd')][_0x69c6('0xe')]===0x1f4){logger[_0x69c6('0xd')](_0x69c6('0xa'),_0x16857d,_0x1a4c78[_0x69c6('0xd')]['message']);return _0x2d9715(_0x1a4c78[_0x69c6('0xd')]['message']);}logger[_0x69c6('0xd')]('Attachment,\x20%s,\x20%s',_0x16857d,_0x1a4c78['error'][_0x69c6('0xf')]);return _0x1c2a20(_0x1a4c78['error'][_0x69c6('0xf')]);}else{logger[_0x69c6('0x10')]('Attachment,\x20%s,\x20%s',_0x16857d,_0x69c6('0xc'));_0x1c2a20(_0x1a4c78['result'][_0x69c6('0xf')]);}})['catch'](function(_0x1bdb73){logger[_0x69c6('0xd')](_0x69c6('0xa'),_0x16857d,_0x1bdb73);_0x2d9715(_0x1bdb73);});});}exports[_0x69c6('0x11')]=function(_0xa54ab6){var _0x2015d4=this;return new Promise(function(_0x434283,_0xd7a840){return db[_0x69c6('0x12')][_0x69c6('0x13')](_0xa54ab6[_0x69c6('0x14')],{'raw':_0xa54ab6[_0x69c6('0x15')]?_0xa54ab6[_0x69c6('0x15')][_0x69c6('0x16')]===undefined?!![]:![]:!![]})[_0x69c6('0x9')](function(_0x1852a4){logger['info'](_0x69c6('0x11'),_0xa54ab6);logger[_0x69c6('0xb')](_0x69c6('0x11'),_0xa54ab6,JSON[_0x69c6('0x17')](_0x1852a4));_0x434283(_0x1852a4);})['catch'](function(_0x33922c){logger[_0x69c6('0xd')](_0x69c6('0x11'),_0x33922c['message'],_0xa54ab6);_0xd7a840(_0x2015d4[_0x69c6('0xd')](0x1f4,_0x33922c[_0x69c6('0xf')]));});});}; \ No newline at end of file +var _0x4a77=['error','message','result','catch','CreateAttachment','create','options','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x46cd89,_0x4a23e4){var _0xb080e8=function(_0x32fc3e){while(--_0x32fc3e){_0x46cd89['push'](_0x46cd89['shift']());}};_0xb080e8(++_0x4a23e4);}(_0x4a77,0x18e));var _0x74a7=function(_0x1d1d23,_0x4bae2b){_0x1d1d23=_0x1d1d23-0x0;var _0x20ade9=_0x4a77[_0x1d1d23];return _0x20ade9;};'use strict';var _=require(_0x74a7('0x0'));var util=require('util');var moment=require(_0x74a7('0x1'));var BPromise=require(_0x74a7('0x2'));var rs=require(_0x74a7('0x3'));var fs=require('fs');var Redis=require(_0x74a7('0x4'));var db=require(_0x74a7('0x5'))['db'];var utils=require(_0x74a7('0x6'));var logger=require(_0x74a7('0x7'))('rpc');var config=require(_0x74a7('0x8'));var jayson=require(_0x74a7('0x9'));var client=jayson[_0x74a7('0xa')][_0x74a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4067b2,_0x36faa4,_0x10ab1d){return new BPromise(function(_0x2cc8f6,_0x46c850){return client['request'](_0x4067b2,_0x10ab1d)[_0x74a7('0xc')](function(_0x42944c){logger[_0x74a7('0xd')](_0x74a7('0xe'),_0x36faa4,_0x74a7('0xf'));logger[_0x74a7('0x10')](_0x74a7('0x11'),_0x36faa4,_0x74a7('0xf'),JSON['stringify'](_0x42944c));if(_0x42944c[_0x74a7('0x12')]){if(_0x42944c[_0x74a7('0x12')]['code']===0x1f4){logger[_0x74a7('0x12')](_0x74a7('0xe'),_0x36faa4,_0x42944c[_0x74a7('0x12')][_0x74a7('0x13')]);return _0x46c850(_0x42944c[_0x74a7('0x12')][_0x74a7('0x13')]);}logger[_0x74a7('0x12')]('Attachment,\x20%s,\x20%s',_0x36faa4,_0x42944c[_0x74a7('0x12')]['message']);return _0x2cc8f6(_0x42944c[_0x74a7('0x12')][_0x74a7('0x13')]);}else{logger[_0x74a7('0xd')]('Attachment,\x20%s,\x20%s',_0x36faa4,_0x74a7('0xf'));_0x2cc8f6(_0x42944c[_0x74a7('0x14')][_0x74a7('0x13')]);}})[_0x74a7('0x15')](function(_0x496907){logger[_0x74a7('0x12')]('Attachment,\x20%s,\x20%s',_0x36faa4,_0x496907);_0x46c850(_0x496907);});});}exports[_0x74a7('0x16')]=function(_0x4c3902){var _0xccf952=this;return new Promise(function(_0xd2e9be,_0x326943){return db['Attachment'][_0x74a7('0x17')](_0x4c3902['body'],{'raw':_0x4c3902[_0x74a7('0x18')]?_0x4c3902['options']['raw']===undefined?!![]:![]:!![]})[_0x74a7('0xc')](function(_0x53d3c8){logger[_0x74a7('0xd')]('CreateAttachment',_0x4c3902);logger[_0x74a7('0x10')](_0x74a7('0x16'),_0x4c3902,JSON[_0x74a7('0x19')](_0x53d3c8));_0xd2e9be(_0x53d3c8);})['catch'](function(_0x43b8e1){logger[_0x74a7('0x12')](_0x74a7('0x16'),_0x43b8e1[_0x74a7('0x13')],_0x4c3902);_0x326943(_0xccf952[_0x74a7('0x12')](0x1f4,_0x43b8e1[_0x74a7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 863240f..4531dbb 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 _0x42c3=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','download','post','/:id/clone','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','create','put','update','destroy','exports','multer','util','path','express'];(function(_0x3cdb66,_0xc5202c){var _0xa2f64f=function(_0xbaf9eb){while(--_0xbaf9eb){_0x3cdb66['push'](_0x3cdb66['shift']());}};_0xa2f64f(++_0xc5202c);}(_0x42c3,0x1bc));var _0x342c=function(_0x9f865f,_0x44a5fc){_0x9f865f=_0x9f865f-0x0;var _0x5be420=_0x42c3[_0x9f865f];return _0x5be420;};'use strict';var multer=require(_0x342c('0x0'));var util=require(_0x342c('0x1'));var path=require(_0x342c('0x2'));var timeout=require('connect-timeout');var express=require(_0x342c('0x3'));var router=express[_0x342c('0x4')]();var auth=require(_0x342c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x342c('0x6'));var controller=require('./attachment.controller');router[_0x342c('0x7')]('/',auth[_0x342c('0x8')](),controller['index']);router['get'](_0x342c('0x9'),auth[_0x342c('0x8')](),controller[_0x342c('0xa')]);router[_0x342c('0x7')]('/:id/download',auth[_0x342c('0x8')](),controller[_0x342c('0xb')]);router[_0x342c('0xc')](_0x342c('0xd'),auth[_0x342c('0x8')](),controller['clone']);var upload=multer({'storage':multer[_0x342c('0xe')]({'destination':function(_0x3efae0,_0x7a5743,_0x5ca425){_0x5ca425(null,path['join'](config['root'],_0x342c('0xf')));},'filename':function(_0x165777,_0x264bf0,_0x90ae77){_0x90ae77(null,util[_0x342c('0x10')](_0x342c('0x11'),Date[_0x342c('0x12')](),_0x264bf0[_0x342c('0x13')][_0x342c('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x342c('0xc')]('/',upload[_0x342c('0x15')](_0x342c('0x16')),controller[_0x342c('0x17')]);router[_0x342c('0x18')](_0x342c('0x9'),auth[_0x342c('0x8')](),controller[_0x342c('0x19')]);router['delete'](_0x342c('0x9'),auth['isAuthenticated'](),controller[_0x342c('0x1a')]);module[_0x342c('0x1b')]=router; \ No newline at end of file +var _0x0447=['../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','/:id/clone','clone','diskStorage','join','format','%s-%s','replace','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x328cc8,_0x4f5e10){var _0x45e89f=function(_0x5a6503){while(--_0x5a6503){_0x328cc8['push'](_0x328cc8['shift']());}};_0x45e89f(++_0x4f5e10);}(_0x0447,0x8b));var _0x7044=function(_0x1bc798,_0x2ab7c9){_0x1bc798=_0x1bc798-0x0;var _0x3308ca=_0x0447[_0x1bc798];return _0x3308ca;};'use strict';var multer=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var path=require(_0x7044('0x2'));var timeout=require(_0x7044('0x3'));var express=require(_0x7044('0x4'));var router=express['Router']();var auth=require(_0x7044('0x5'));var interaction=require(_0x7044('0x6'));var config=require(_0x7044('0x7'));var controller=require(_0x7044('0x8'));router[_0x7044('0x9')]('/',auth[_0x7044('0xa')](),controller[_0x7044('0xb')]);router[_0x7044('0x9')](_0x7044('0xc'),auth['isAuthenticated'](),controller[_0x7044('0xd')]);router[_0x7044('0x9')](_0x7044('0xe'),auth[_0x7044('0xa')](),controller['download']);router[_0x7044('0xf')](_0x7044('0x10'),auth['isAuthenticated'](),controller[_0x7044('0x11')]);var upload=multer({'storage':multer[_0x7044('0x12')]({'destination':function(_0x87a156,_0xf38c20,_0x4f83c7){_0x4f83c7(null,path[_0x7044('0x13')](config['root'],'server/files/attachments/'));},'filename':function(_0x53f150,_0xe26cea,_0x41b118){_0x41b118(null,util[_0x7044('0x14')](_0x7044('0x15'),Date['now'](),_0xe26cea['originalname'][_0x7044('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7044('0xf')]('/',upload['single']('file'),controller[_0x7044('0x17')]);router[_0x7044('0x18')](_0x7044('0xc'),auth[_0x7044('0xa')](),controller[_0x7044('0x19')]);router[_0x7044('0x1a')]('/:id',auth[_0x7044('0xa')](),controller[_0x7044('0x1b')]);module[_0x7044('0x1c')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index d406171..90e221e 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 _0x62a8=['blockDuration','then','User','find','emails','value','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','lodash','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','email','callback','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts'];(function(_0x2cf875,_0x33949e){var _0x24d43d=function(_0x437325){while(--_0x437325){_0x2cf875['push'](_0x2cf875['shift']());}};_0x24d43d(++_0x33949e);}(_0x62a8,0x1e4));var _0x862a=function(_0x5e8b0c,_0x1c76d4){_0x5e8b0c=_0x5e8b0c-0x0;var _0x595162=_0x62a8[_0x5e8b0c];return _0x595162;};'use strict';var _=require(_0x862a('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0x862a('0x1')];var moment=require(_0x862a('0x2'));var db=require(_0x862a('0x3'))['db'];var config=require(_0x862a('0x4'));var signToken=require(_0x862a('0x5'))[_0x862a('0x6')];var utils=require(_0x862a('0x7'));exports[_0x862a('0x8')]=passport[_0x862a('0x9')](_0x862a('0xa'),{'failureRedirect':_0x862a('0xb'),'scope':['profile',_0x862a('0xc')],'session':![]});exports[_0x862a('0xd')]=passport[_0x862a('0x9')](_0x862a('0xa'),{'failureRedirect':_0x862a('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x862a('0xa')]?config[_0x862a('0xa')][_0x862a('0xe')]:'id','clientSecret':config[_0x862a('0xa')]?config[_0x862a('0xa')]['clientSecret']:_0x862a('0xf'),'callbackURL':config['google']?config[_0x862a('0xa')][_0x862a('0x10')]:''},function(_0x1fb498,_0x3789e5,_0x2f8fb5,_0x1122bd){var _0x4e18e6,_0xf23878;return db[_0x862a('0x11')][_0x862a('0x12')]({'where':{'id':0x1},'attributes':[_0x862a('0x13'),_0x862a('0x14')],'raw':!![]})[_0x862a('0x15')](function(_0x1187c1){_0x4e18e6=_0x1187c1;return db[_0x862a('0x16')][_0x862a('0x17')]({'where':{'email':_['map'](_0x2f8fb5[_0x862a('0x18')],_0x862a('0x19')),'role':{'$or':[_0x862a('0x1a'),_0x862a('0x1b'),'agent']}}});})['then'](function(_0x1c6447){_0xf23878=_0x1c6447;if(_0xf23878){if(_0xf23878[_0x862a('0x1c')]){return _0x1122bd(_0x862a('0x1d'));}else if(_0x4e18e6[_0x862a('0x14')]>0x0){if(_0xf23878[_0x862a('0x1e')]){if(moment(_0xf23878[_0x862a('0x1f')])['add'](_0x4e18e6[_0x862a('0x14')],_0x862a('0x20'))>moment()){return _0x1122bd(_0x862a('0x1d'));}else{return utils[_0x862a('0x21')](_0xf23878,0x0,![],null)[_0x862a('0x15')](function(){return utils[_0x862a('0x22')](_0xf23878);})[_0x862a('0x15')](function(){return _0x1122bd(null,_0xf23878);});}}else{return utils[_0x862a('0x22')](_0xf23878)['then'](function(){return _0x1122bd(null,_0xf23878);});}}else{return utils[_0x862a('0x22')](_0xf23878)[_0x862a('0x15')](function(){return _0x1122bd(null,_0xf23878);});}}return _0x1122bd('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x862a('0x23')](function(_0x2a137d){_0x1122bd(_0x2a137d);});})); \ No newline at end of file +var _0xf1af=['findOne','blockDuration','then','User','find','map','emails','value','admin','user','agent','disabled','blocked','blockedAt','minutes','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login','google','profile','callback','authenticate','/login','use','clientID','clientSecret','secret','Setting'];(function(_0x16b99d,_0x19e643){var _0x17a994=function(_0x591737){while(--_0x591737){_0x16b99d['push'](_0x16b99d['shift']());}};_0x17a994(++_0x19e643);}(_0xf1af,0x7d));var _0xff1a=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xf1af[_0x28d18d];return _0x470640;};'use strict';var _=require(_0xff1a('0x0'));var passport=require(_0xff1a('0x1'));var GoogleStrategy=require(_0xff1a('0x2'))[_0xff1a('0x3')];var moment=require('moment');var db=require(_0xff1a('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0xff1a('0x5'))[_0xff1a('0x6')];var utils=require(_0xff1a('0x7'));exports[_0xff1a('0x8')]=passport['authenticate'](_0xff1a('0x9'),{'failureRedirect':'/login','scope':[_0xff1a('0xa'),'email'],'session':![]});exports[_0xff1a('0xb')]=passport[_0xff1a('0xc')](_0xff1a('0x9'),{'failureRedirect':_0xff1a('0xd'),'session':![]});passport[_0xff1a('0xe')](new GoogleStrategy({'clientID':config[_0xff1a('0x9')]?config['google'][_0xff1a('0xf')]:'id','clientSecret':config[_0xff1a('0x9')]?config['google'][_0xff1a('0x10')]:_0xff1a('0x11'),'callbackURL':config[_0xff1a('0x9')]?config[_0xff1a('0x9')]['callbackURL']:''},function(_0x400177,_0x1f5a84,_0x427b64,_0x3ecf5f){var _0x15353a,_0x3e57e9;return db[_0xff1a('0x12')][_0xff1a('0x13')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xff1a('0x14')],'raw':!![]})[_0xff1a('0x15')](function(_0x1e4b56){_0x15353a=_0x1e4b56;return db[_0xff1a('0x16')][_0xff1a('0x17')]({'where':{'email':_[_0xff1a('0x18')](_0x427b64[_0xff1a('0x19')],_0xff1a('0x1a')),'role':{'$or':[_0xff1a('0x1b'),_0xff1a('0x1c'),_0xff1a('0x1d')]}}});})[_0xff1a('0x15')](function(_0x19f5dc){_0x3e57e9=_0x19f5dc;if(_0x3e57e9){if(_0x3e57e9[_0xff1a('0x1e')]){return _0x3ecf5f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x15353a[_0xff1a('0x14')]>0x0){if(_0x3e57e9[_0xff1a('0x1f')]){if(moment(_0x3e57e9[_0xff1a('0x20')])['add'](_0x15353a[_0xff1a('0x14')],_0xff1a('0x21'))>moment()){return _0x3ecf5f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x3e57e9,0x0,![],null)[_0xff1a('0x15')](function(){return utils[_0xff1a('0x22')](_0x3e57e9);})[_0xff1a('0x15')](function(){return _0x3ecf5f(null,_0x3e57e9);});}}else{return utils[_0xff1a('0x22')](_0x3e57e9)[_0xff1a('0x15')](function(){return _0x3ecf5f(null,_0x3e57e9);});}}else{return utils['getLicense'](_0x3e57e9)[_0xff1a('0x15')](function(){return _0x3ecf5f(null,_0x3e57e9);});}}return _0x3ecf5f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xff1a('0x23')](function(_0x1c1e47){_0x3ecf5f(_0x1c1e47);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 32c750a..e980a11 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 _0x2dae=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','setTokenCookie','exports','express','Router','./authGoogle.controller'];(function(_0x1b83da,_0x2e4f11){var _0x25f061=function(_0x4b907f){while(--_0x4b907f){_0x1b83da['push'](_0x1b83da['shift']());}};_0x25f061(++_0x2e4f11);}(_0x2dae,0xc3));var _0xe2da=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0x2dae[_0x2d994d];return _0xd54be4;};'use strict';var express=require(_0xe2da('0x0'));var passport=require('passport');var router=express[_0xe2da('0x1')]();var controller=require(_0xe2da('0x2'));var userController=require(_0xe2da('0x3'));var authService=require(_0xe2da('0x4'));router[_0xe2da('0x5')]('/',controller['login']);router[_0xe2da('0x5')](_0xe2da('0x6'),controller[_0xe2da('0x7')],authService[_0xe2da('0x8')],userController['login'],authService[_0xe2da('0x9')]);module[_0xe2da('0xa')]=router; \ No newline at end of file +var _0x0dba=['callback','isMiddleware','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x1aed01,_0x3b59f3){var _0x34ccb8=function(_0x1420db){while(--_0x1420db){_0x1aed01['push'](_0x1aed01['shift']());}};_0x34ccb8(++_0x3b59f3);}(_0x0dba,0x136));var _0xa0db=function(_0x38d7b9,_0x85d2f2){_0x38d7b9=_0x38d7b9-0x0;var _0x3e685c=_0x0dba[_0x38d7b9];return _0x3e685c;};'use strict';var express=require(_0xa0db('0x0'));var passport=require(_0xa0db('0x1'));var router=express[_0xa0db('0x2')]();var controller=require(_0xa0db('0x3'));var userController=require(_0xa0db('0x4'));var authService=require(_0xa0db('0x5'));router[_0xa0db('0x6')]('/',controller[_0xa0db('0x7')]);router[_0xa0db('0x6')](_0xa0db('0x8'),controller[_0xa0db('0x9')],authService[_0xa0db('0xa')],userController['login'],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 7fd5951..0a0b05a 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 _0x760c=['/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','Password\x20reset!','use','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','allowedLoginAttempts','then','findOne','name','password','salt','role','disabled','blockedAt','admin','user','agent','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','blockDuration','clearBlockUser','minutes','getLicense','catch','blocked','MailAccount','find','email','Smtp','service','host','secure','authentication','pass','merge','request','SendMail','error','format','message','stringify','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://'];(function(_0x3a3b5c,_0x38e9e8){var _0x42da90=function(_0x3e619f){while(--_0x3e619f){_0x3a3b5c['push'](_0x3a3b5c['shift']());}};_0x42da90(++_0x38e9e8);}(_0x760c,0x1a4));var _0xc760=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x760c[_0x122ef9];return _0x42fba0;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0xc760('0x0'))[_0xc760('0x1')];var jayson=require(_0xc760('0x2'));var _=require(_0xc760('0x3'));var rs=require(_0xc760('0x4'));var moment=require(_0xc760('0x5'));var db=require(_0xc760('0x6'))['db'];var authService=require(_0xc760('0x7'));var utils=require(_0xc760('0x8'));var client=jayson[_0xc760('0x9')][_0xc760('0xa')]({'port':0x232b});function localAuthenticate(_0xe96839,_0x3e7901,_0x41529e,_0x2070f5){var _0x5c14f7,_0x56907d;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xc760('0xb'),'blockDuration'],'raw':!![]})[_0xc760('0xc')](function(_0x41ba26){_0x5c14f7=_0x41ba26;return _0xe96839[_0xc760('0xd')]({'attributes':['id',_0xc760('0xe'),_0xc760('0xf'),_0xc760('0x10'),_0xc760('0x11'),_0xc760('0x12'),'blocked',_0xc760('0x13'),'loginAttempts'],'where':{'name':_0x3e7901,'role':{'$or':[_0xc760('0x14'),_0xc760('0x15'),_0xc760('0x16')]}}});})[_0xc760('0xc')](function(_0x89466d){if(!_0x89466d||_0x89466d&&_0x89466d[_0xc760('0xe')]!==_0x3e7901){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x56907d=_0x89466d;return _0x56907d;}})[_0xc760('0xc')](function(){_0x56907d['authenticate'](_0x41529e,function(_0x1233fa,_0x538993){var _0x363b11=_0x56907d[_0xc760('0x17')]+0x1;if(_0x1233fa){return _0x2070f5(_0x1233fa);}else if(!_0x538993){if(_0x56907d['disabled']){return _0x2070f5(null,![],{'message':_0xc760('0x18')});}else if(_0x5c14f7['allowedLoginAttempts']>0x0){if(_0x56907d['blocked']){if(_0x5c14f7['blockDuration']>0x0){if(moment(_0x56907d[_0xc760('0x13')])[_0xc760('0x19')](_0x5c14f7[_0xc760('0x1a')],'minutes')>moment()){return _0x2070f5(null,![],{'message':_0xc760('0x18')});}else{return utils[_0xc760('0x1b')](_0x56907d,_0x363b11,![],null)['then'](function(){return _0x2070f5(null,![],{'message':_0xc760('0x18')});});}}else{return _0x2070f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x363b11>=_0x5c14f7[_0xc760('0xb')]){return utils['clearBlockUser'](_0x56907d,0x0,!![],moment())[_0xc760('0xc')](function(){return _0x2070f5(null,![],{'message':_0xc760('0x18')});});}else{return utils['clearBlockUser'](_0x56907d,_0x363b11,![],null)[_0xc760('0xc')](function(){return _0x2070f5(null,![],{'message':_0xc760('0x18')});});}}}else{return _0x2070f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x56907d['disabled']){return _0x2070f5(null,![],{'message':_0xc760('0x18')});}else if(_0x5c14f7[_0xc760('0xb')]>0x0){if(_0x56907d['blocked']){if(_0x5c14f7['blockDuration']>0x0){if(moment(_0x56907d['blockedAt'])[_0xc760('0x19')](_0x5c14f7[_0xc760('0x1a')],_0xc760('0x1c'))>moment()){return _0x2070f5(null,![],{'message':_0xc760('0x18')});}else{return utils['clearBlockUser'](_0x56907d,0x0,![],null)[_0xc760('0xc')](function(){return utils[_0xc760('0x1d')](_0x56907d);})[_0xc760('0xc')](function(){return _0x2070f5(null,_0x56907d);});}}else{return _0x2070f5(null,![],{'message':_0xc760('0x18')});}}else{return utils[_0xc760('0x1b')](_0x56907d,0x0,![],null)[_0xc760('0xc')](function(){return utils[_0xc760('0x1d')](_0x56907d);})[_0xc760('0xc')](function(){return _0x2070f5(null,_0x56907d);})[_0xc760('0x1e')](function(_0x46ee53){return _0x2070f5(null,![],_0x46ee53);});}}else{if(_0x56907d[_0xc760('0x1f')]){return _0x2070f5(null,![],{'message':_0xc760('0x18')});}else{return utils[_0xc760('0x1d')](_0x56907d)['then'](function(){return _0x2070f5(null,_0x56907d);});}}}});})[_0xc760('0x1e')](function(_0x4d9889){return _0x2070f5(null,![],_0x4d9889);});}function sendServiceMail(_0x647404){return db[_0xc760('0x20')][_0xc760('0x21')]({'where':{'service':!![]},'attributes':['id',_0xc760('0xe'),_0xc760('0x22')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xc760('0xc')](function(_0x178fea){if(!_0x178fea){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5f51c6={'tls':{'rejectUnauthorized':![]}};if(_0x178fea[_0xc760('0x23')]['service']){_0x5f51c6[_0xc760('0x24')]=_0x178fea[_0xc760('0x23')][_0xc760('0x24')];}else{_0x5f51c6[_0xc760('0x25')]=_0x178fea[_0xc760('0x23')][_0xc760('0x25')];_0x5f51c6['port']=_0x178fea[_0xc760('0x23')]['port'];_0x5f51c6[_0xc760('0x26')]=_0x178fea[_0xc760('0x23')][_0xc760('0x26')];}if(_0x178fea[_0xc760('0x23')][_0xc760('0x27')]){_0x5f51c6['auth']={'user':_0x178fea[_0xc760('0x23')][_0xc760('0x15')],'pass':_0x178fea[_0xc760('0x23')][_0xc760('0x28')]};}var _0x3bef49={'account':_0x5f51c6,'message':_[_0xc760('0x29')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x178fea['name'],_0x178fea[_0xc760('0x22')]||_0x178fea[_0xc760('0x23')][_0xc760('0x15')])},_0x647404)};return client[_0xc760('0x2a')](_0xc760('0x2b'),_0x3bef49);})[_0xc760('0xc')](function(_0x8ba6d6){if(_0x8ba6d6[_0xc760('0x2c')]){throw new Error(util[_0xc760('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x8ba6d6['error'][_0xc760('0x2e')]||JSON[_0xc760('0x2f')](_0x8ba6d6[_0xc760('0x2c')])));}return!![];});}function handleError(_0x41b454,_0x3cbef5,_0x3078f1){return _0x41b454['status'](_0x3cbef5||0x1f4)[_0xc760('0x30')]({'message':_0x3078f1?_0x3078f1[_0xc760('0x2e')]||_0x3078f1:''});}function checkPasswordPattern(_0x204170,_0x1ec92f,_0x5d0472){if(_0x5d0472){var _0xbf678f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbf678f[_0xc760('0x31')](_0x1ec92f)){return _0x204170;}else{throw new Error(_0xc760('0x32'));}}else{return _0x204170;}}exports['login']=function(_0xf578b2,_0x376797,_0x1cd2b7){passport[_0xc760('0x33')](_0xc760('0x34'),function(_0x4a7cba,_0x285185,_0x64c555){var _0x4b559a=_0x4a7cba||_0x64c555;if(_0x4b559a){return handleError(_0x376797,0x191,_0x4b559a);}if(!_0x285185){return handleError(_0x376797,0x194,{'message':_0xc760('0x35')});}else{var _0x4b481d={'payload':{'id':_0x285185['id'],'role':_0x285185[_0xc760('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xc760('0x36')](_0x4b481d)[_0xc760('0xc')](function(_0x1ea897){_0x376797[_0xc760('0x37')]({'id':_0x285185['id'],'token':_0x1ea897,'statusCall':'','isAlreadyLogged':_0x285185['online']});});}})(_0xf578b2,_0x376797,_0x1cd2b7);};exports[_0xc760('0x38')]=function(_0x4139c1,_0x1d7159,_0x542ae5){if(!_0x4139c1[_0xc760('0x39')][_0xc760('0x22')]){return handleError(_0x1d7159,0x1f4,{'message':_0xc760('0x3a')});}var _0x3740e9=rs['generate']();_0x4139c1[_0xc760('0x39')][_0xc760('0x22')]=_0x4139c1['body'][_0xc760('0x22')][_0xc760('0x3b')]()[_0xc760('0x3c')]();var _0x2774c4;return db[_0xc760('0x3d')][_0xc760('0xd')]({'where':{'id':0x1},'attributes':[_0xc760('0xb'),_0xc760('0x1a')],'raw':!![]})[_0xc760('0xc')](function(_0x3fe411){_0x2774c4=_0x3fe411;return db[_0xc760('0x3e')][_0xc760('0x21')]({'where':{'email':_0x4139c1[_0xc760('0x39')][_0xc760('0x22')]}});})[_0xc760('0xc')](function(_0x4dd710){if(!_0x4dd710){throw new Error(_0xc760('0x3f'));}if(_0x4dd710['disabled']){throw new Error(_0xc760('0x40'));}if(_0x4dd710[_0xc760('0x1f')]){if(moment(_0x4dd710[_0xc760('0x13')])[_0xc760('0x19')](_0x2774c4['blockDuration'],_0xc760('0x1c'))>moment()){throw new Error(_0xc760('0x41'));}else{_0x4dd710[_0xc760('0x1f')]=![];_0x4dd710[_0xc760('0x13')]=null;}}_0x4dd710[_0xc760('0x42')]=_0x3740e9;_0x4dd710[_0xc760('0x43')]=Date['now']()+0x36ee80;return _0x4dd710[_0xc760('0x44')]();})[_0xc760('0xc')](function(){return sendServiceMail({'to':_0x4139c1[_0xc760('0x39')]['email'],'subject':_0xc760('0x45'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xc760('0x46')+_0xc760('0x47')+_0x4139c1['headers']['host']+_0xc760('0x48')+_0x3740e9+'\x0a\x0a'+_0xc760('0x49')});})[_0xc760('0xc')](function(){_0x1d7159[_0xc760('0x4a')](0xc8)['send']({'message':_0xc760('0x4b')});})[_0xc760('0x1e')](function(_0x517245){return handleError(_0x1d7159,0x1f4,_0x517245);});};exports['reset']=function(_0x442376,_0x2e7571,_0xcd6759){var _0x13ed1b;return db[_0xc760('0x3e')][_0xc760('0x21')]({'where':{'resetPasswordToken':_0x442376[_0xc760('0x4c')][_0xc760('0x4d')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xc760('0xc')](function(_0x34ddef){_0x13ed1b=_0x34ddef;if(!_0x13ed1b){throw new Error(_0xc760('0x4e'));}return db[_0xc760('0x3d')][_0xc760('0xd')]({'attributes':['id',_0xc760('0x4f')]});})[_0xc760('0xc')](function(_0x339b66){return checkPasswordPattern(_0x339b66,_0x442376['body'][_0xc760('0xf')],_0x339b66[_0xc760('0x4f')]);})[_0xc760('0xc')](function(){_0x13ed1b[_0xc760('0xf')]=_0x442376[_0xc760('0x39')][_0xc760('0xf')];_0x13ed1b['resetPasswordToken']=null;_0x13ed1b[_0xc760('0x43')]=null;return _0x13ed1b['save']();})[_0xc760('0xc')](function(){_0x2e7571[_0xc760('0x4a')](0xc8)[_0xc760('0x30')]({'message':_0xc760('0x50')});})[_0xc760('0x1e')](function(_0x53a22b){return handleError(_0x2e7571,0x1f4,_0x53a22b);});};passport[_0xc760('0x51')](new LocalStrategy({'usernameField':'name','passwordField':_0xc760('0xf')},function(_0x11c4e4,_0x5b2dad,_0xb3020b){return localAuthenticate(db[_0xc760('0x3e')],_0x11c4e4,_0x5b2dad,_0xb3020b);})); \ No newline at end of file +var _0x2cbd=['salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add','minutes','clearBlockUser','getLicense','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','message','stringify','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','email','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','use','util','passport','passport-local','Strategy','randomstring','../../mysqldb','../../components/auth/service','client','Setting','findOne','allowedLoginAttempts','then','name','password'];(function(_0x52d3f0,_0x5af9a5){var _0x1d80ee=function(_0x38dd86){while(--_0x38dd86){_0x52d3f0['push'](_0x52d3f0['shift']());}};_0x1d80ee(++_0x5af9a5);}(_0x2cbd,0x1ea));var _0xd2cb=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0x2cbd[_0xfb42e6];return _0x27265b;};'use strict';var util=require(_0xd2cb('0x0'));var passport=require(_0xd2cb('0x1'));var LocalStrategy=require(_0xd2cb('0x2'))[_0xd2cb('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xd2cb('0x4'));var moment=require('moment');var db=require(_0xd2cb('0x5'))['db'];var authService=require(_0xd2cb('0x6'));var utils=require('../../config/utils');var client=jayson[_0xd2cb('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x4ac26f,_0x4f9aac,_0x16ba61,_0x1402d7){var _0x15f8f6,_0x3b253e;return db[_0xd2cb('0x8')][_0xd2cb('0x9')]({'where':{'id':0x1},'attributes':[_0xd2cb('0xa'),'blockDuration'],'raw':!![]})[_0xd2cb('0xb')](function(_0x467637){_0x15f8f6=_0x467637;return _0x4ac26f['findOne']({'attributes':['id',_0xd2cb('0xc'),_0xd2cb('0xd'),_0xd2cb('0xe'),_0xd2cb('0xf'),_0xd2cb('0x10'),_0xd2cb('0x11'),_0xd2cb('0x12'),_0xd2cb('0x13')],'where':{'name':_0x4f9aac,'role':{'$or':[_0xd2cb('0x14'),_0xd2cb('0x15'),'agent']}}});})['then'](function(_0x254ad5){if(!_0x254ad5||_0x254ad5&&_0x254ad5['name']!==_0x4f9aac){throw new Error(_0xd2cb('0x16'));}else{_0x3b253e=_0x254ad5;return _0x3b253e;}})[_0xd2cb('0xb')](function(){_0x3b253e['authenticate'](_0x16ba61,function(_0x5e0042,_0x5b1421){var _0x290366=_0x3b253e[_0xd2cb('0x13')]+0x1;if(_0x5e0042){return _0x1402d7(_0x5e0042);}else if(!_0x5b1421){if(_0x3b253e[_0xd2cb('0x10')]){return _0x1402d7(null,![],{'message':_0xd2cb('0x16')});}else if(_0x15f8f6[_0xd2cb('0xa')]>0x0){if(_0x3b253e['blocked']){if(_0x15f8f6[_0xd2cb('0x17')]>0x0){if(moment(_0x3b253e[_0xd2cb('0x12')])[_0xd2cb('0x18')](_0x15f8f6[_0xd2cb('0x17')],_0xd2cb('0x19'))>moment()){return _0x1402d7(null,![],{'message':_0xd2cb('0x16')});}else{return utils[_0xd2cb('0x1a')](_0x3b253e,_0x290366,![],null)[_0xd2cb('0xb')](function(){return _0x1402d7(null,![],{'message':_0xd2cb('0x16')});});}}else{return _0x1402d7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x290366>=_0x15f8f6[_0xd2cb('0xa')]){return utils[_0xd2cb('0x1a')](_0x3b253e,0x0,!![],moment())[_0xd2cb('0xb')](function(){return _0x1402d7(null,![],{'message':_0xd2cb('0x16')});});}else{return utils[_0xd2cb('0x1a')](_0x3b253e,_0x290366,![],null)[_0xd2cb('0xb')](function(){return _0x1402d7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1402d7(null,![],{'message':_0xd2cb('0x16')});}}else{if(_0x3b253e[_0xd2cb('0x10')]){return _0x1402d7(null,![],{'message':_0xd2cb('0x16')});}else if(_0x15f8f6[_0xd2cb('0xa')]>0x0){if(_0x3b253e['blocked']){if(_0x15f8f6[_0xd2cb('0x17')]>0x0){if(moment(_0x3b253e[_0xd2cb('0x12')])[_0xd2cb('0x18')](_0x15f8f6[_0xd2cb('0x17')],_0xd2cb('0x19'))>moment()){return _0x1402d7(null,![],{'message':_0xd2cb('0x16')});}else{return utils[_0xd2cb('0x1a')](_0x3b253e,0x0,![],null)['then'](function(){return utils['getLicense'](_0x3b253e);})[_0xd2cb('0xb')](function(){return _0x1402d7(null,_0x3b253e);});}}else{return _0x1402d7(null,![],{'message':_0xd2cb('0x16')});}}else{return utils[_0xd2cb('0x1a')](_0x3b253e,0x0,![],null)[_0xd2cb('0xb')](function(){return utils[_0xd2cb('0x1b')](_0x3b253e);})[_0xd2cb('0xb')](function(){return _0x1402d7(null,_0x3b253e);})['catch'](function(_0x41d17b){return _0x1402d7(null,![],_0x41d17b);});}}else{if(_0x3b253e[_0xd2cb('0x11')]){return _0x1402d7(null,![],{'message':_0xd2cb('0x16')});}else{return utils[_0xd2cb('0x1b')](_0x3b253e)[_0xd2cb('0xb')](function(){return _0x1402d7(null,_0x3b253e);});}}}});})['catch'](function(_0x60d3e2){return _0x1402d7(null,![],_0x60d3e2);});}function sendServiceMail(_0x1e1994){return db[_0xd2cb('0x1c')][_0xd2cb('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xd2cb('0xc'),'email'],'include':[{'model':db[_0xd2cb('0x1e')],'as':_0xd2cb('0x1f')}]})[_0xd2cb('0xb')](function(_0x1373dd){if(!_0x1373dd){throw new Error(_0xd2cb('0x20'));}var _0x59628a={'tls':{'rejectUnauthorized':![]}};if(_0x1373dd['Smtp'][_0xd2cb('0x21')]){_0x59628a[_0xd2cb('0x21')]=_0x1373dd[_0xd2cb('0x1f')]['service'];}else{_0x59628a[_0xd2cb('0x22')]=_0x1373dd[_0xd2cb('0x1f')]['host'];_0x59628a[_0xd2cb('0x23')]=_0x1373dd[_0xd2cb('0x1f')][_0xd2cb('0x23')];_0x59628a[_0xd2cb('0x24')]=_0x1373dd[_0xd2cb('0x1f')][_0xd2cb('0x24')];}if(_0x1373dd[_0xd2cb('0x1f')][_0xd2cb('0x25')]){_0x59628a['auth']={'user':_0x1373dd[_0xd2cb('0x1f')]['user'],'pass':_0x1373dd[_0xd2cb('0x1f')][_0xd2cb('0x26')]};}var _0xcff14c={'account':_0x59628a,'message':_[_0xd2cb('0x27')]({'from':util[_0xd2cb('0x28')](_0xd2cb('0x29'),_0x1373dd[_0xd2cb('0xc')],_0x1373dd['email']||_0x1373dd[_0xd2cb('0x1f')][_0xd2cb('0x15')])},_0x1e1994)};return client['request'](_0xd2cb('0x2a'),_0xcff14c);})[_0xd2cb('0xb')](function(_0x3f8c94){if(_0x3f8c94[_0xd2cb('0x2b')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3f8c94[_0xd2cb('0x2b')][_0xd2cb('0x2c')]||JSON[_0xd2cb('0x2d')](_0x3f8c94['error'])));}return!![];});}function handleError(_0x1819fc,_0x3bb279,_0x470588){return _0x1819fc['status'](_0x3bb279||0x1f4)[_0xd2cb('0x2e')]({'message':_0x470588?_0x470588['message']||_0x470588:''});}function checkPasswordPattern(_0x4338b7,_0x6bd622,_0xa6401f){if(_0xa6401f){var _0x2cddd9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2cddd9[_0xd2cb('0x2f')](_0x6bd622)){return _0x4338b7;}else{throw new Error(_0xd2cb('0x30'));}}else{return _0x4338b7;}}exports[_0xd2cb('0x31')]=function(_0x4451b3,_0x5d2bce,_0x18369a){passport['authenticate'](_0xd2cb('0x32'),function(_0x14ecbd,_0x9e9c9,_0x39964d){var _0x13b020=_0x14ecbd||_0x39964d;if(_0x13b020){return handleError(_0x5d2bce,0x191,_0x13b020);}if(!_0x9e9c9){return handleError(_0x5d2bce,0x194,{'message':_0xd2cb('0x33')});}else{var _0x53017c={'payload':{'id':_0x9e9c9['id'],'role':_0x9e9c9['role']},'options':{'expiresIn':0x15180}};return authService[_0xd2cb('0x34')](_0x53017c)[_0xd2cb('0xb')](function(_0x4fa2bd){_0x5d2bce[_0xd2cb('0x35')]({'id':_0x9e9c9['id'],'token':_0x4fa2bd,'statusCall':'','isAlreadyLogged':_0x9e9c9[_0xd2cb('0x36')]});});}})(_0x4451b3,_0x5d2bce,_0x18369a);};exports[_0xd2cb('0x37')]=function(_0x30f281,_0x5b3ca3,_0x3a96fe){if(!_0x30f281[_0xd2cb('0x38')]['email']){return handleError(_0x5b3ca3,0x1f4,{'message':_0xd2cb('0x39')});}var _0x5788ad=rs['generate']();_0x30f281[_0xd2cb('0x38')][_0xd2cb('0x3a')]=_0x30f281['body'][_0xd2cb('0x3a')][_0xd2cb('0x3b')]()[_0xd2cb('0x3c')]();var _0x3bbb18;return db[_0xd2cb('0x8')][_0xd2cb('0x9')]({'where':{'id':0x1},'attributes':[_0xd2cb('0xa'),_0xd2cb('0x17')],'raw':!![]})[_0xd2cb('0xb')](function(_0x5d6442){_0x3bbb18=_0x5d6442;return db['User'][_0xd2cb('0x1d')]({'where':{'email':_0x30f281['body'][_0xd2cb('0x3a')]}});})[_0xd2cb('0xb')](function(_0x3a4862){if(!_0x3a4862){throw new Error(_0xd2cb('0x3d'));}if(_0x3a4862[_0xd2cb('0x10')]){throw new Error(_0xd2cb('0x3e'));}if(_0x3a4862[_0xd2cb('0x11')]){if(moment(_0x3a4862[_0xd2cb('0x12')])[_0xd2cb('0x18')](_0x3bbb18[_0xd2cb('0x17')],_0xd2cb('0x19'))>moment()){throw new Error(_0xd2cb('0x3f'));}else{_0x3a4862['blocked']=![];_0x3a4862[_0xd2cb('0x12')]=null;}}_0x3a4862[_0xd2cb('0x40')]=_0x5788ad;_0x3a4862[_0xd2cb('0x41')]=Date[_0xd2cb('0x42')]()+0x36ee80;return _0x3a4862[_0xd2cb('0x43')]();})[_0xd2cb('0xb')](function(){return sendServiceMail({'to':_0x30f281[_0xd2cb('0x38')][_0xd2cb('0x3a')],'subject':_0xd2cb('0x44'),'text':_0xd2cb('0x45')+_0xd2cb('0x46')+_0xd2cb('0x47')+_0x30f281[_0xd2cb('0x48')][_0xd2cb('0x22')]+_0xd2cb('0x49')+_0x5788ad+'\x0a\x0a'+_0xd2cb('0x4a')});})[_0xd2cb('0xb')](function(){_0x5b3ca3[_0xd2cb('0x4b')](0xc8)[_0xd2cb('0x2e')]({'message':_0xd2cb('0x4c')});})['catch'](function(_0x2c5d6c){return handleError(_0x5b3ca3,0x1f4,_0x2c5d6c);});};exports[_0xd2cb('0x4d')]=function(_0xc28eaa,_0x260cd5,_0x3f3035){var _0x144bdb;return db[_0xd2cb('0x4e')]['find']({'where':{'resetPasswordToken':_0xc28eaa[_0xd2cb('0x4f')][_0xd2cb('0x50')],'resetPasswordExpires':{'$gt':Date[_0xd2cb('0x42')]()}}})[_0xd2cb('0xb')](function(_0x4ba26a){_0x144bdb=_0x4ba26a;if(!_0x144bdb){throw new Error(_0xd2cb('0x51'));}return db['Setting'][_0xd2cb('0x9')]({'attributes':['id',_0xd2cb('0x52')]});})[_0xd2cb('0xb')](function(_0x462ce6){return checkPasswordPattern(_0x462ce6,_0xc28eaa[_0xd2cb('0x38')]['password'],_0x462ce6[_0xd2cb('0x52')]);})['then'](function(){_0x144bdb[_0xd2cb('0xd')]=_0xc28eaa[_0xd2cb('0x38')][_0xd2cb('0xd')];_0x144bdb[_0xd2cb('0x40')]=null;_0x144bdb['resetPasswordExpires']=null;return _0x144bdb[_0xd2cb('0x43')]();})[_0xd2cb('0xb')](function(){_0x260cd5[_0xd2cb('0x4b')](0xc8)['send']({'message':'Password\x20reset!'});})['catch'](function(_0x1a9467){return handleError(_0x260cd5,0x1f4,_0x1a9467);});};passport[_0xd2cb('0x53')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x2cd973,_0x595dc1,_0x1998e2){return localAuthenticate(db[_0xd2cb('0x4e')],_0x2cd973,_0x595dc1,_0x1998e2);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 6b033f0..4cf9b0d 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 _0xa020=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','exports','express','Router'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa020,0x166));var _0x0a02=function(_0x3dca43,_0x2ca075){_0x3dca43=_0x3dca43-0x0;var _0x327bbf=_0xa020[_0x3dca43];return _0x327bbf;};'use strict';var express=require(_0x0a02('0x0'));var router=express[_0x0a02('0x1')]();var controller=require(_0x0a02('0x2'));router[_0x0a02('0x3')]('/',controller[_0x0a02('0x4')]);router[_0x0a02('0x3')](_0x0a02('0x5'),controller[_0x0a02('0x6')]);router[_0x0a02('0x3')](_0x0a02('0x7'),controller['reset']);module[_0x0a02('0x8')]=router; \ No newline at end of file +var _0xd631=['forgot','/reset/:token','reset','express','Router','login','post','/forgot'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd631,0x183));var _0x1d63=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0xd631[_0x318840];return _0x223da4;};'use strict';var express=require(_0x1d63('0x0'));var router=express[_0x1d63('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x1d63('0x2')]);router[_0x1d63('0x3')](_0x1d63('0x4'),controller[_0x1d63('0x5')]);router[_0x1d63('0x3')](_0x1d63('0x6'),controller[_0x1d63('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 2af05f9..7b798bf 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 _0x3020=['STRING','INTEGER'];(function(_0x99c2dd,_0x1d32eb){var _0x173349=function(_0x211a30){while(--_0x211a30){_0x99c2dd['push'](_0x99c2dd['shift']());}};_0x173349(++_0x1d32eb);}(_0x3020,0xec));var _0x0302=function(_0x4b4629,_0x36bdb1){_0x4b4629=_0x4b4629-0x0;var _0x5afa89=_0x3020[_0x4b4629];return _0x5afa89;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0302('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x0302('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0302('0x1')],'defaultValue':0xa}}; \ No newline at end of file +var _0xe699=['STRING','INTEGER','exports'];(function(_0x295b1a,_0x1e31a){var _0x2bb42b=function(_0xc27b30){while(--_0xc27b30){_0x295b1a['push'](_0x295b1a['shift']());}};_0x2bb42b(++_0x1e31a);}(_0xe699,0x8c));var _0x9e69=function(_0x44fb9b,_0x19760f){_0x44fb9b=_0x44fb9b-0x0;var _0x3e592b=_0xe699[_0x44fb9b];return _0x3e592b;};'use strict';var Sequelize=require('sequelize');module[_0x9e69('0x0')]={'name':{'type':Sequelize[_0x9e69('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x9e69('0x1')]},'description':{'type':Sequelize[_0x9e69('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9e69('0x2')],'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 ffdd378..3aecbf5 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 _0xdc8d=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','count','includeAll','include','catch','show','params','merge','find','create','body','Condition','addConditions','ids','getConditions','findOne','nolimit','addActions','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce'];(function(_0x4692b8,_0x84a0fd){var _0x2726e4=function(_0x2e2156){while(--_0x2e2156){_0x4692b8['push'](_0x4692b8['shift']());}};_0x2726e4(++_0x84a0fd);}(_0xdc8d,0xe9));var _0xddc8=function(_0x1e3a31,_0x4e90b3){_0x1e3a31=_0x1e3a31-0x0;var _0x1a49ff=_0xdc8d[_0x1e3a31];return _0x1a49ff;};'use strict';var pdf=require(_0xddc8('0x0'));var emlformat=require(_0xddc8('0x1'));var rimraf=require(_0xddc8('0x2'));var zipdir=require(_0xddc8('0x3'));var jsonpatch=require(_0xddc8('0x4'));var rp=require(_0xddc8('0x5'));var moment=require(_0xddc8('0x6'));var BPromise=require(_0xddc8('0x7'));var Mustache=require(_0xddc8('0x8'));var util=require(_0xddc8('0x9'));var path=require(_0xddc8('0xa'));var sox=require('sox');var csv=require(_0xddc8('0xb'));var ejs=require(_0xddc8('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xddc8('0xd'));var crypto=require(_0xddc8('0xe'));var jsforce=require(_0xddc8('0xf'));var deskjs=require(_0xddc8('0x10'));var toCsv=require(_0xddc8('0xb'));var querystring=require('querystring');var Papa=require(_0xddc8('0x11'));var Redis=require(_0xddc8('0x12'));var authService=require(_0xddc8('0x13'));var qs=require(_0xddc8('0x14'));var as=require(_0xddc8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xddc8('0x16'));var db=require(_0xddc8('0x17'))['db'];function respondWithStatusCode(_0x393887,_0x3a2a76){_0x3a2a76=_0x3a2a76||0xcc;return function(_0x3b6257){if(_0x3b6257){return _0x393887[_0xddc8('0x18')](_0x3a2a76);}return _0x393887[_0xddc8('0x19')](_0x3a2a76)[_0xddc8('0x1a')]();};}function respondWithResult(_0x469510,_0x473684){_0x473684=_0x473684||0xc8;return function(_0x2eb93c){if(_0x2eb93c){return _0x469510[_0xddc8('0x19')](_0x473684)['json'](_0x2eb93c);}};}function respondWithFilteredResult(_0x1802e1,_0x1c72ee){return function(_0x143244){if(_0x143244){var _0x19bce3=_0x143244['count'],_0x382930=_0x1c72ee[_0xddc8('0x1b')],_0x52d1e3=_0x1c72ee[_0xddc8('0x1b')]+_0x1c72ee[_0xddc8('0x1c')],_0x4f9fe8;if(_0x52d1e3>=_0x19bce3){_0x52d1e3=_0x19bce3;_0x4f9fe8=0xc8;}else{_0x4f9fe8=0xce;}_0x1802e1[_0xddc8('0x19')](_0x4f9fe8);return _0x1802e1[_0xddc8('0x1d')](_0xddc8('0x1e'),_0x382930+'-'+_0x52d1e3+'/'+_0x19bce3)[_0xddc8('0x1f')](_0x143244);}return null;};}function patchUpdates(_0x3ef842){return function(_0x14c45f){try{jsonpatch[_0xddc8('0x20')](_0x14c45f,_0x3ef842,!![]);}catch(_0x522d82){return BPromise[_0xddc8('0x21')](_0x522d82);}return _0x14c45f[_0xddc8('0x22')]();};}function saveUpdates(_0x3cc970,_0x5481d1){return function(_0x1cc215){if(_0x1cc215){return _0x1cc215[_0xddc8('0x23')](_0x3cc970)[_0xddc8('0x24')](function(_0x4a4ac4){return _0x4a4ac4;});}return null;};}function removeEntity(_0x475c58,_0xff833){return function(_0x418729){if(_0x418729){return _0x418729[_0xddc8('0x25')]()[_0xddc8('0x24')](function(){_0x475c58[_0xddc8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3caccf,_0x4548ee){return function(_0x4d587e){if(!_0x4d587e){_0x3caccf['sendStatus'](0x194);}return _0x4d587e;};}function handleError(_0x199cc5,_0x189c31){_0x189c31=_0x189c31||0x1f4;return function(_0x1da657){logger[_0xddc8('0x26')](_0x1da657['stack']);if(_0x1da657[_0xddc8('0x27')]){delete _0x1da657[_0xddc8('0x27')];}_0x199cc5['status'](_0x189c31)[_0xddc8('0x28')](_0x1da657);};}exports[_0xddc8('0x29')]=function(_0x18c9f2,_0x769f08){var _0x4c551c={},_0x4ab8cc={},_0x431b35={'count':0x0,'rows':[]};var _0x333b37=_[_0xddc8('0x2a')](db[_0xddc8('0x2b')][_0xddc8('0x2c')],function(_0x4b398b){return{'name':_0x4b398b[_0xddc8('0x2d')],'type':_0x4b398b[_0xddc8('0x2e')][_0xddc8('0x2f')]};});_0x4ab8cc[_0xddc8('0x30')]=_[_0xddc8('0x2a')](_0x333b37,'name');_0x4ab8cc[_0xddc8('0x31')]=_[_0xddc8('0x32')](_0x18c9f2['query']);_0x4ab8cc[_0xddc8('0x33')]=_[_0xddc8('0x34')](_0x4ab8cc['model'],_0x4ab8cc['query']);_0x4c551c[_0xddc8('0x35')]=_[_0xddc8('0x34')](_0x4ab8cc[_0xddc8('0x30')],qs[_0xddc8('0x36')](_0x18c9f2[_0xddc8('0x31')][_0xddc8('0x36')]));_0x4c551c[_0xddc8('0x35')]=_0x4c551c['attributes'][_0xddc8('0x37')]?_0x4c551c[_0xddc8('0x35')]:_0x4ab8cc[_0xddc8('0x30')];if(!_0x18c9f2[_0xddc8('0x31')][_0xddc8('0x38')]('nolimit')){_0x4c551c[_0xddc8('0x1c')]=qs['limit'](_0x18c9f2[_0xddc8('0x31')][_0xddc8('0x1c')]);_0x4c551c[_0xddc8('0x1b')]=qs[_0xddc8('0x1b')](_0x18c9f2[_0xddc8('0x31')]['offset']);}_0x4c551c[_0xddc8('0x39')]=qs['sort'](_0x18c9f2[_0xddc8('0x31')][_0xddc8('0x3a')]);_0x4c551c['where']=qs[_0xddc8('0x33')](_[_0xddc8('0x3b')](_0x18c9f2[_0xddc8('0x31')],_0x4ab8cc[_0xddc8('0x33')]));if(_0x18c9f2['query'][_0xddc8('0x3c')]){_0x4c551c['where']=_['merge'](_0x4c551c[_0xddc8('0x3d')],{'$or':_['map'](_0x333b37,function(_0x19ab96){if(_0x19ab96['type']!==_0xddc8('0x3e')){var _0x286a8f={};_0x286a8f[_0x19ab96[_0xddc8('0x27')]]={'$like':'%'+_0x18c9f2['query'][_0xddc8('0x3c')]+'%'};return _0x286a8f;}})});}_0x4c551c=_['merge']({},_0x4c551c,_0x18c9f2[_0xddc8('0x3f')]);var _0x4ee92b={'where':_0x4c551c['where']};return db[_0xddc8('0x2b')][_0xddc8('0x40')](_0x4ee92b)[_0xddc8('0x24')](function(_0x17ddc6){_0x431b35[_0xddc8('0x40')]=_0x17ddc6;if(_0x18c9f2['query'][_0xddc8('0x41')]){_0x4c551c[_0xddc8('0x42')]=[{'all':!![]}];}return db[_0xddc8('0x2b')]['findAll'](_0x4c551c);})['then'](function(_0x4afc57){_0x431b35['rows']=_0x4afc57;return _0x431b35;})['then'](respondWithFilteredResult(_0x769f08,_0x4c551c))[_0xddc8('0x43')](handleError(_0x769f08,null));};exports[_0xddc8('0x44')]=function(_0x309b32,_0x53f461){var _0x523e36={'raw':![],'where':{'id':_0x309b32[_0xddc8('0x45')]['id']}},_0x590a14={};_0x590a14[_0xddc8('0x30')]=_[_0xddc8('0x32')](db[_0xddc8('0x2b')]['rawAttributes']);_0x590a14[_0xddc8('0x31')]=_[_0xddc8('0x32')](_0x309b32[_0xddc8('0x31')]);_0x590a14[_0xddc8('0x33')]=_[_0xddc8('0x34')](_0x590a14[_0xddc8('0x30')],_0x590a14[_0xddc8('0x31')]);_0x523e36[_0xddc8('0x35')]=_[_0xddc8('0x34')](_0x590a14['model'],qs[_0xddc8('0x36')](_0x309b32[_0xddc8('0x31')][_0xddc8('0x36')]));_0x523e36['attributes']=_0x523e36[_0xddc8('0x35')][_0xddc8('0x37')]?_0x523e36['attributes']:_0x590a14['model'];if(_0x309b32[_0xddc8('0x31')][_0xddc8('0x41')]){_0x523e36[_0xddc8('0x42')]=[{'all':!![]}];}_0x523e36=_[_0xddc8('0x46')]({},_0x523e36,_0x309b32[_0xddc8('0x3f')]);return db['Automation'][_0xddc8('0x47')](_0x523e36)[_0xddc8('0x24')](handleEntityNotFound(_0x53f461,null))[_0xddc8('0x24')](respondWithResult(_0x53f461,null))[_0xddc8('0x43')](handleError(_0x53f461,null));};exports[_0xddc8('0x48')]=function(_0x863cb7,_0x3a1f62){return db[_0xddc8('0x2b')][_0xddc8('0x48')](_0x863cb7[_0xddc8('0x49')],{})[_0xddc8('0x24')](respondWithResult(_0x3a1f62,0xc9))[_0xddc8('0x43')](handleError(_0x3a1f62,null));};exports[_0xddc8('0x23')]=function(_0x292eb2,_0x463073){if(_0x292eb2[_0xddc8('0x49')]['id']){delete _0x292eb2[_0xddc8('0x49')]['id'];}return db['Automation'][_0xddc8('0x47')]({'where':{'id':_0x292eb2[_0xddc8('0x45')]['id']}})[_0xddc8('0x24')](handleEntityNotFound(_0x463073,null))[_0xddc8('0x24')](saveUpdates(_0x292eb2[_0xddc8('0x49')],null))['then'](respondWithResult(_0x463073,null))[_0xddc8('0x43')](handleError(_0x463073,null));};exports[_0xddc8('0x25')]=function(_0x1a32bc,_0x35aff5){return db[_0xddc8('0x2b')][_0xddc8('0x47')]({'where':{'id':_0x1a32bc['params']['id']}})['then'](handleEntityNotFound(_0x35aff5,null))[_0xddc8('0x24')](removeEntity(_0x35aff5,null))['catch'](handleError(_0x35aff5,null));};exports['addConditions']=function(_0x3fe785,_0x45d963,_0x4fdb7a){return db[_0xddc8('0x4a')][_0xddc8('0x47')]({'where':{'id':_0x3fe785[_0xddc8('0x45')]['id']}})['then'](handleEntityNotFound(_0x45d963,null))[_0xddc8('0x24')](function(_0xace7d7){if(_0xace7d7){return _0xace7d7[_0xddc8('0x4b')](_0x3fe785['body'][_0xddc8('0x4c')],_['omit'](_0x3fe785[_0xddc8('0x49')],[_0xddc8('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x45d963,null))['catch'](handleError(_0x45d963,null));};exports[_0xddc8('0x4d')]=function(_0x54e053,_0x10bb10,_0x148250){var _0x483dff={};var _0x508d0a={};var _0x53c3fb;var _0x329b08;return db['Automation'][_0xddc8('0x4e')]({'where':{'id':_0x54e053[_0xddc8('0x45')]['id']}})['then'](handleEntityNotFound(_0x10bb10,null))['then'](function(_0x2bc30d){if(_0x2bc30d){_0x53c3fb=_0x2bc30d;_0x508d0a['model']=_[_0xddc8('0x32')](db[_0xddc8('0x4a')][_0xddc8('0x2c')]);_0x508d0a[_0xddc8('0x31')]=_['keys'](_0x54e053['query']);_0x508d0a[_0xddc8('0x33')]=_[_0xddc8('0x34')](_0x508d0a[_0xddc8('0x30')],_0x508d0a[_0xddc8('0x31')]);_0x483dff[_0xddc8('0x35')]=_['intersection'](_0x508d0a['model'],qs[_0xddc8('0x36')](_0x54e053[_0xddc8('0x31')][_0xddc8('0x36')]));_0x483dff[_0xddc8('0x35')]=_0x483dff[_0xddc8('0x35')][_0xddc8('0x37')]?_0x483dff[_0xddc8('0x35')]:_0x508d0a[_0xddc8('0x30')];_0x483dff['order']=qs['sort'](_0x54e053['query']['sort']);_0x483dff[_0xddc8('0x3d')]=qs[_0xddc8('0x33')](_['pick'](_0x54e053['query'],_0x508d0a[_0xddc8('0x33')]));if(_0x54e053[_0xddc8('0x31')]['filter']){_0x483dff[_0xddc8('0x3d')]=_['merge'](_0x483dff[_0xddc8('0x3d')],{'$or':_[_0xddc8('0x2a')](_0x483dff[_0xddc8('0x35')],function(_0x42381e){var _0x1abf66={};_0x1abf66[_0x42381e]={'$like':'%'+_0x54e053[_0xddc8('0x31')][_0xddc8('0x3c')]+'%'};return _0x1abf66;})});}_0x483dff=_[_0xddc8('0x46')]({},_0x483dff,_0x54e053['options']);return _0x53c3fb['getConditions'](_0x483dff);}})[_0xddc8('0x24')](function(_0x4d0832){if(_0x4d0832){_0x329b08=_0x4d0832['length'];if(!_0x54e053[_0xddc8('0x31')][_0xddc8('0x38')](_0xddc8('0x4f'))){_0x483dff[_0xddc8('0x1c')]=qs[_0xddc8('0x1c')](_0x54e053[_0xddc8('0x31')][_0xddc8('0x1c')]);_0x483dff[_0xddc8('0x1b')]=qs[_0xddc8('0x1b')](_0x54e053[_0xddc8('0x31')][_0xddc8('0x1b')]);}return _0x53c3fb[_0xddc8('0x4d')](_0x483dff);}})[_0xddc8('0x24')](function(_0x500497){if(_0x500497){return _0x500497?{'count':_0x329b08,'rows':_0x500497}:null;}})[_0xddc8('0x24')](respondWithResult(_0x10bb10,null))[_0xddc8('0x43')](handleError(_0x10bb10,null));};exports[_0xddc8('0x50')]=function(_0x4e43aa,_0x2279ad,_0x54e923){return db[_0xddc8('0x51')][_0xddc8('0x47')]({'where':{'id':_0x4e43aa[_0xddc8('0x45')]['id']}})[_0xddc8('0x24')](handleEntityNotFound(_0x2279ad,null))[_0xddc8('0x24')](function(_0x58286c){if(_0x58286c){return _0x58286c[_0xddc8('0x50')](_0x4e43aa[_0xddc8('0x49')]['ids'],_['omit'](_0x4e43aa[_0xddc8('0x49')],[_0xddc8('0x4c'),'id'])||{});}})[_0xddc8('0x24')](respondWithResult(_0x2279ad,null))[_0xddc8('0x43')](handleError(_0x2279ad,null));};exports[_0xddc8('0x52')]=function(_0x5c8ab5,_0x1e0623,_0x3f7466){var _0x28e9b9={};var _0x1c1672={};var _0x38b4bf;var _0x85847;return db['Automation'][_0xddc8('0x4e')]({'where':{'id':_0x5c8ab5['params']['id']}})[_0xddc8('0x24')](handleEntityNotFound(_0x1e0623,null))[_0xddc8('0x24')](function(_0x1d8bdf){if(_0x1d8bdf){_0x38b4bf=_0x1d8bdf;_0x1c1672[_0xddc8('0x30')]=_['keys'](db[_0xddc8('0x51')][_0xddc8('0x2c')]);_0x1c1672[_0xddc8('0x31')]=_[_0xddc8('0x32')](_0x5c8ab5['query']);_0x1c1672['filters']=_[_0xddc8('0x34')](_0x1c1672['model'],_0x1c1672['query']);_0x28e9b9[_0xddc8('0x35')]=_[_0xddc8('0x34')](_0x1c1672[_0xddc8('0x30')],qs[_0xddc8('0x36')](_0x5c8ab5[_0xddc8('0x31')][_0xddc8('0x36')]));_0x28e9b9[_0xddc8('0x35')]=_0x28e9b9[_0xddc8('0x35')][_0xddc8('0x37')]?_0x28e9b9[_0xddc8('0x35')]:_0x1c1672['model'];_0x28e9b9['order']=qs[_0xddc8('0x3a')](_0x5c8ab5[_0xddc8('0x31')][_0xddc8('0x3a')]);_0x28e9b9[_0xddc8('0x3d')]=qs[_0xddc8('0x33')](_[_0xddc8('0x3b')](_0x5c8ab5[_0xddc8('0x31')],_0x1c1672['filters']));if(_0x5c8ab5[_0xddc8('0x31')]['filter']){_0x28e9b9[_0xddc8('0x3d')]=_[_0xddc8('0x46')](_0x28e9b9[_0xddc8('0x3d')],{'$or':_['map'](_0x28e9b9[_0xddc8('0x35')],function(_0x4401e0){var _0x530a55={};_0x530a55[_0x4401e0]={'$like':'%'+_0x5c8ab5[_0xddc8('0x31')][_0xddc8('0x3c')]+'%'};return _0x530a55;})});}_0x28e9b9=_[_0xddc8('0x46')]({},_0x28e9b9,_0x5c8ab5[_0xddc8('0x3f')]);return _0x38b4bf[_0xddc8('0x52')](_0x28e9b9);}})['then'](function(_0x334cc3){if(_0x334cc3){_0x85847=_0x334cc3[_0xddc8('0x37')];if(!_0x5c8ab5['query']['hasOwnProperty'](_0xddc8('0x4f'))){_0x28e9b9[_0xddc8('0x1c')]=qs[_0xddc8('0x1c')](_0x5c8ab5['query']['limit']);_0x28e9b9[_0xddc8('0x1b')]=qs['offset'](_0x5c8ab5[_0xddc8('0x31')]['offset']);}return _0x38b4bf[_0xddc8('0x52')](_0x28e9b9);}})[_0xddc8('0x24')](function(_0x3bd76a){if(_0x3bd76a){return _0x3bd76a?{'count':_0x85847,'rows':_0x3bd76a}:null;}})[_0xddc8('0x24')](respondWithResult(_0x1e0623,null))['catch'](handleError(_0x1e0623,null));}; \ No newline at end of file +var _0x6eef=['save','update','then','error','name','send','map','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','Automation','include','findAll','rows','catch','show','params','includeAll','body','find','destroy','addConditions','Condition','omit','ids','getConditions','nolimit','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject'];(function(_0x466bfa,_0x25ea55){var _0x37e0b1=function(_0x2a8f2b){while(--_0x2a8f2b){_0x466bfa['push'](_0x466bfa['shift']());}};_0x37e0b1(++_0x25ea55);}(_0x6eef,0x1bb));var _0xf6ee=function(_0x1b745b,_0x3e2d40){_0x1b745b=_0x1b745b-0x0;var _0x120a9d=_0x6eef[_0x1b745b];return _0x120a9d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf6ee('0x0'));var rimraf=require(_0xf6ee('0x1'));var zipdir=require(_0xf6ee('0x2'));var jsonpatch=require(_0xf6ee('0x3'));var rp=require(_0xf6ee('0x4'));var moment=require(_0xf6ee('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf6ee('0x6'));var sox=require(_0xf6ee('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf6ee('0x8'));var squel=require(_0xf6ee('0x9'));var crypto=require(_0xf6ee('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf6ee('0xb'));var toCsv=require(_0xf6ee('0xc'));var querystring=require(_0xf6ee('0xd'));var Papa=require(_0xf6ee('0xe'));var Redis=require(_0xf6ee('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf6ee('0x10'));var hardwareService=require(_0xf6ee('0x11'));var logger=require(_0xf6ee('0x12'))(_0xf6ee('0x13'));var utils=require('../../config/utils');var config=require(_0xf6ee('0x14'));var db=require(_0xf6ee('0x15'))['db'];function respondWithStatusCode(_0x1d3468,_0x457f67){_0x457f67=_0x457f67||0xcc;return function(_0xd3a1a7){if(_0xd3a1a7){return _0x1d3468[_0xf6ee('0x16')](_0x457f67);}return _0x1d3468[_0xf6ee('0x17')](_0x457f67)[_0xf6ee('0x18')]();};}function respondWithResult(_0x3f04e7,_0x170d3e){_0x170d3e=_0x170d3e||0xc8;return function(_0x44e1a3){if(_0x44e1a3){return _0x3f04e7[_0xf6ee('0x17')](_0x170d3e)[_0xf6ee('0x19')](_0x44e1a3);}};}function respondWithFilteredResult(_0x4991fa,_0x24f77d){return function(_0x24890a){if(_0x24890a){var _0x1fb4bb=_0x24890a[_0xf6ee('0x1a')],_0x4578dd=_0x24f77d[_0xf6ee('0x1b')],_0x8386ca=_0x24f77d['offset']+_0x24f77d['limit'],_0x565de3;if(_0x8386ca>=_0x1fb4bb){_0x8386ca=_0x1fb4bb;_0x565de3=0xc8;}else{_0x565de3=0xce;}_0x4991fa[_0xf6ee('0x17')](_0x565de3);return _0x4991fa['set'](_0xf6ee('0x1c'),_0x4578dd+'-'+_0x8386ca+'/'+_0x1fb4bb)[_0xf6ee('0x19')](_0x24890a);}return null;};}function patchUpdates(_0xc63f3){return function(_0x25f0fd){try{jsonpatch[_0xf6ee('0x1d')](_0x25f0fd,_0xc63f3,!![]);}catch(_0x1dc46c){return BPromise[_0xf6ee('0x1e')](_0x1dc46c);}return _0x25f0fd[_0xf6ee('0x1f')]();};}function saveUpdates(_0x3577d6,_0x48b7fa){return function(_0x157726){if(_0x157726){return _0x157726[_0xf6ee('0x20')](_0x3577d6)[_0xf6ee('0x21')](function(_0x19871d){return _0x19871d;});}return null;};}function removeEntity(_0x296994,_0x57ab09){return function(_0x356d99){if(_0x356d99){return _0x356d99['destroy']()['then'](function(){_0x296994[_0xf6ee('0x17')](0xcc)[_0xf6ee('0x18')]();});}};}function handleEntityNotFound(_0xe427e,_0x1079d3){return function(_0x1c0874){if(!_0x1c0874){_0xe427e[_0xf6ee('0x16')](0x194);}return _0x1c0874;};}function handleError(_0x4a58a5,_0x2f90c6){_0x2f90c6=_0x2f90c6||0x1f4;return function(_0x208cc0){logger[_0xf6ee('0x22')](_0x208cc0['stack']);if(_0x208cc0[_0xf6ee('0x23')]){delete _0x208cc0[_0xf6ee('0x23')];}_0x4a58a5['status'](_0x2f90c6)[_0xf6ee('0x24')](_0x208cc0);};}exports['index']=function(_0x1faaa3,_0x531547){var _0x4ec38b={},_0x16e2c4={},_0x382a40={'count':0x0,'rows':[]};var _0x3238eb=_[_0xf6ee('0x25')](db['Automation'][_0xf6ee('0x26')],function(_0x2fa66a){return{'name':_0x2fa66a[_0xf6ee('0x27')],'type':_0x2fa66a[_0xf6ee('0x28')]['key']};});_0x16e2c4[_0xf6ee('0x29')]=_[_0xf6ee('0x25')](_0x3238eb,'name');_0x16e2c4['query']=_[_0xf6ee('0x2a')](_0x1faaa3[_0xf6ee('0x2b')]);_0x16e2c4['filters']=_[_0xf6ee('0x2c')](_0x16e2c4['model'],_0x16e2c4[_0xf6ee('0x2b')]);_0x4ec38b[_0xf6ee('0x2d')]=_[_0xf6ee('0x2c')](_0x16e2c4['model'],qs[_0xf6ee('0x2e')](_0x1faaa3[_0xf6ee('0x2b')][_0xf6ee('0x2e')]));_0x4ec38b[_0xf6ee('0x2d')]=_0x4ec38b[_0xf6ee('0x2d')][_0xf6ee('0x2f')]?_0x4ec38b[_0xf6ee('0x2d')]:_0x16e2c4[_0xf6ee('0x29')];if(!_0x1faaa3[_0xf6ee('0x2b')][_0xf6ee('0x30')]('nolimit')){_0x4ec38b[_0xf6ee('0x31')]=qs[_0xf6ee('0x31')](_0x1faaa3[_0xf6ee('0x2b')]['limit']);_0x4ec38b['offset']=qs[_0xf6ee('0x1b')](_0x1faaa3[_0xf6ee('0x2b')][_0xf6ee('0x1b')]);}_0x4ec38b[_0xf6ee('0x32')]=qs[_0xf6ee('0x33')](_0x1faaa3[_0xf6ee('0x2b')]['sort']);_0x4ec38b['where']=qs[_0xf6ee('0x34')](_[_0xf6ee('0x35')](_0x1faaa3[_0xf6ee('0x2b')],_0x16e2c4['filters']));if(_0x1faaa3[_0xf6ee('0x2b')][_0xf6ee('0x36')]){_0x4ec38b[_0xf6ee('0x37')]=_['merge'](_0x4ec38b[_0xf6ee('0x37')],{'$or':_[_0xf6ee('0x25')](_0x3238eb,function(_0x59ef85){if(_0x59ef85[_0xf6ee('0x28')]!==_0xf6ee('0x38')){var _0x4b083f={};_0x4b083f[_0x59ef85['name']]={'$like':'%'+_0x1faaa3['query'][_0xf6ee('0x36')]+'%'};return _0x4b083f;}})});}_0x4ec38b=_[_0xf6ee('0x39')]({},_0x4ec38b,_0x1faaa3[_0xf6ee('0x3a')]);var _0x5ea698={'where':_0x4ec38b[_0xf6ee('0x37')]};return db[_0xf6ee('0x3b')]['count'](_0x5ea698)[_0xf6ee('0x21')](function(_0x36b0dc){_0x382a40[_0xf6ee('0x1a')]=_0x36b0dc;if(_0x1faaa3[_0xf6ee('0x2b')]['includeAll']){_0x4ec38b[_0xf6ee('0x3c')]=[{'all':!![]}];}return db['Automation'][_0xf6ee('0x3d')](_0x4ec38b);})[_0xf6ee('0x21')](function(_0x4f53db){_0x382a40[_0xf6ee('0x3e')]=_0x4f53db;return _0x382a40;})[_0xf6ee('0x21')](respondWithFilteredResult(_0x531547,_0x4ec38b))[_0xf6ee('0x3f')](handleError(_0x531547,null));};exports[_0xf6ee('0x40')]=function(_0x227be5,_0x5395b4){var _0x57d543={'raw':![],'where':{'id':_0x227be5[_0xf6ee('0x41')]['id']}},_0x5e30eb={};_0x5e30eb[_0xf6ee('0x29')]=_[_0xf6ee('0x2a')](db[_0xf6ee('0x3b')][_0xf6ee('0x26')]);_0x5e30eb[_0xf6ee('0x2b')]=_[_0xf6ee('0x2a')](_0x227be5[_0xf6ee('0x2b')]);_0x5e30eb['filters']=_[_0xf6ee('0x2c')](_0x5e30eb[_0xf6ee('0x29')],_0x5e30eb[_0xf6ee('0x2b')]);_0x57d543[_0xf6ee('0x2d')]=_['intersection'](_0x5e30eb[_0xf6ee('0x29')],qs[_0xf6ee('0x2e')](_0x227be5[_0xf6ee('0x2b')][_0xf6ee('0x2e')]));_0x57d543[_0xf6ee('0x2d')]=_0x57d543[_0xf6ee('0x2d')][_0xf6ee('0x2f')]?_0x57d543[_0xf6ee('0x2d')]:_0x5e30eb[_0xf6ee('0x29')];if(_0x227be5[_0xf6ee('0x2b')][_0xf6ee('0x42')]){_0x57d543['include']=[{'all':!![]}];}_0x57d543=_[_0xf6ee('0x39')]({},_0x57d543,_0x227be5[_0xf6ee('0x3a')]);return db[_0xf6ee('0x3b')]['find'](_0x57d543)[_0xf6ee('0x21')](handleEntityNotFound(_0x5395b4,null))['then'](respondWithResult(_0x5395b4,null))[_0xf6ee('0x3f')](handleError(_0x5395b4,null));};exports['create']=function(_0x4b624d,_0x4f57f9){return db[_0xf6ee('0x3b')]['create'](_0x4b624d[_0xf6ee('0x43')],{})[_0xf6ee('0x21')](respondWithResult(_0x4f57f9,0xc9))[_0xf6ee('0x3f')](handleError(_0x4f57f9,null));};exports['update']=function(_0x4a7d1b,_0x2c3845){if(_0x4a7d1b[_0xf6ee('0x43')]['id']){delete _0x4a7d1b[_0xf6ee('0x43')]['id'];}return db[_0xf6ee('0x3b')][_0xf6ee('0x44')]({'where':{'id':_0x4a7d1b[_0xf6ee('0x41')]['id']}})[_0xf6ee('0x21')](handleEntityNotFound(_0x2c3845,null))[_0xf6ee('0x21')](saveUpdates(_0x4a7d1b[_0xf6ee('0x43')],null))[_0xf6ee('0x21')](respondWithResult(_0x2c3845,null))[_0xf6ee('0x3f')](handleError(_0x2c3845,null));};exports[_0xf6ee('0x45')]=function(_0xe5864c,_0x28c25a){return db[_0xf6ee('0x3b')][_0xf6ee('0x44')]({'where':{'id':_0xe5864c['params']['id']}})[_0xf6ee('0x21')](handleEntityNotFound(_0x28c25a,null))[_0xf6ee('0x21')](removeEntity(_0x28c25a,null))[_0xf6ee('0x3f')](handleError(_0x28c25a,null));};exports[_0xf6ee('0x46')]=function(_0x20c8df,_0x125401,_0xa4fe4c){return db[_0xf6ee('0x47')][_0xf6ee('0x44')]({'where':{'id':_0x20c8df['params']['id']}})[_0xf6ee('0x21')](handleEntityNotFound(_0x125401,null))[_0xf6ee('0x21')](function(_0x2eadae){if(_0x2eadae){return _0x2eadae['addConditions'](_0x20c8df[_0xf6ee('0x43')]['ids'],_[_0xf6ee('0x48')](_0x20c8df[_0xf6ee('0x43')],[_0xf6ee('0x49'),'id'])||{});}})[_0xf6ee('0x21')](respondWithResult(_0x125401,null))[_0xf6ee('0x3f')](handleError(_0x125401,null));};exports[_0xf6ee('0x4a')]=function(_0x3a4172,_0x3bdaeb,_0x5f5d13){var _0x54ab0d={};var _0x293e3f={};var _0x1766c4;var _0x5e937f;return db[_0xf6ee('0x3b')]['findOne']({'where':{'id':_0x3a4172[_0xf6ee('0x41')]['id']}})[_0xf6ee('0x21')](handleEntityNotFound(_0x3bdaeb,null))[_0xf6ee('0x21')](function(_0x2a63d9){if(_0x2a63d9){_0x1766c4=_0x2a63d9;_0x293e3f[_0xf6ee('0x29')]=_[_0xf6ee('0x2a')](db[_0xf6ee('0x47')][_0xf6ee('0x26')]);_0x293e3f[_0xf6ee('0x2b')]=_[_0xf6ee('0x2a')](_0x3a4172[_0xf6ee('0x2b')]);_0x293e3f[_0xf6ee('0x34')]=_[_0xf6ee('0x2c')](_0x293e3f[_0xf6ee('0x29')],_0x293e3f[_0xf6ee('0x2b')]);_0x54ab0d[_0xf6ee('0x2d')]=_[_0xf6ee('0x2c')](_0x293e3f[_0xf6ee('0x29')],qs[_0xf6ee('0x2e')](_0x3a4172[_0xf6ee('0x2b')][_0xf6ee('0x2e')]));_0x54ab0d[_0xf6ee('0x2d')]=_0x54ab0d[_0xf6ee('0x2d')][_0xf6ee('0x2f')]?_0x54ab0d[_0xf6ee('0x2d')]:_0x293e3f['model'];_0x54ab0d[_0xf6ee('0x32')]=qs[_0xf6ee('0x33')](_0x3a4172[_0xf6ee('0x2b')][_0xf6ee('0x33')]);_0x54ab0d['where']=qs[_0xf6ee('0x34')](_[_0xf6ee('0x35')](_0x3a4172[_0xf6ee('0x2b')],_0x293e3f[_0xf6ee('0x34')]));if(_0x3a4172[_0xf6ee('0x2b')]['filter']){_0x54ab0d['where']=_[_0xf6ee('0x39')](_0x54ab0d[_0xf6ee('0x37')],{'$or':_[_0xf6ee('0x25')](_0x54ab0d[_0xf6ee('0x2d')],function(_0x506e01){var _0x3e3db9={};_0x3e3db9[_0x506e01]={'$like':'%'+_0x3a4172[_0xf6ee('0x2b')][_0xf6ee('0x36')]+'%'};return _0x3e3db9;})});}_0x54ab0d=_[_0xf6ee('0x39')]({},_0x54ab0d,_0x3a4172['options']);return _0x1766c4[_0xf6ee('0x4a')](_0x54ab0d);}})['then'](function(_0x4d58e2){if(_0x4d58e2){_0x5e937f=_0x4d58e2[_0xf6ee('0x2f')];if(!_0x3a4172[_0xf6ee('0x2b')][_0xf6ee('0x30')](_0xf6ee('0x4b'))){_0x54ab0d[_0xf6ee('0x31')]=qs['limit'](_0x3a4172[_0xf6ee('0x2b')][_0xf6ee('0x31')]);_0x54ab0d[_0xf6ee('0x1b')]=qs[_0xf6ee('0x1b')](_0x3a4172[_0xf6ee('0x2b')][_0xf6ee('0x1b')]);}return _0x1766c4[_0xf6ee('0x4a')](_0x54ab0d);}})[_0xf6ee('0x21')](function(_0x4fa8ac){if(_0x4fa8ac){return _0x4fa8ac?{'count':_0x5e937f,'rows':_0x4fa8ac}:null;}})[_0xf6ee('0x21')](respondWithResult(_0x3bdaeb,null))[_0xf6ee('0x3f')](handleError(_0x3bdaeb,null));};exports[_0xf6ee('0x4c')]=function(_0x192df1,_0x49449e,_0x3d2723){return db['Action'][_0xf6ee('0x44')]({'where':{'id':_0x192df1[_0xf6ee('0x41')]['id']}})[_0xf6ee('0x21')](handleEntityNotFound(_0x49449e,null))['then'](function(_0x2ae5f6){if(_0x2ae5f6){return _0x2ae5f6['addActions'](_0x192df1[_0xf6ee('0x43')]['ids'],_[_0xf6ee('0x48')](_0x192df1[_0xf6ee('0x43')],[_0xf6ee('0x49'),'id'])||{});}})[_0xf6ee('0x21')](respondWithResult(_0x49449e,null))[_0xf6ee('0x3f')](handleError(_0x49449e,null));};exports[_0xf6ee('0x4d')]=function(_0x49f66f,_0x1bfe57,_0x37b887){var _0x19c1eb={};var _0x11f8d2={};var _0x58c9e4;var _0x583a26;return db[_0xf6ee('0x3b')]['findOne']({'where':{'id':_0x49f66f[_0xf6ee('0x41')]['id']}})[_0xf6ee('0x21')](handleEntityNotFound(_0x1bfe57,null))[_0xf6ee('0x21')](function(_0x315f4e){if(_0x315f4e){_0x58c9e4=_0x315f4e;_0x11f8d2[_0xf6ee('0x29')]=_[_0xf6ee('0x2a')](db[_0xf6ee('0x4e')][_0xf6ee('0x26')]);_0x11f8d2['query']=_[_0xf6ee('0x2a')](_0x49f66f[_0xf6ee('0x2b')]);_0x11f8d2[_0xf6ee('0x34')]=_[_0xf6ee('0x2c')](_0x11f8d2['model'],_0x11f8d2['query']);_0x19c1eb['attributes']=_[_0xf6ee('0x2c')](_0x11f8d2[_0xf6ee('0x29')],qs['fields'](_0x49f66f[_0xf6ee('0x2b')][_0xf6ee('0x2e')]));_0x19c1eb[_0xf6ee('0x2d')]=_0x19c1eb[_0xf6ee('0x2d')]['length']?_0x19c1eb[_0xf6ee('0x2d')]:_0x11f8d2[_0xf6ee('0x29')];_0x19c1eb['order']=qs['sort'](_0x49f66f['query'][_0xf6ee('0x33')]);_0x19c1eb[_0xf6ee('0x37')]=qs[_0xf6ee('0x34')](_[_0xf6ee('0x35')](_0x49f66f[_0xf6ee('0x2b')],_0x11f8d2[_0xf6ee('0x34')]));if(_0x49f66f['query'][_0xf6ee('0x36')]){_0x19c1eb[_0xf6ee('0x37')]=_['merge'](_0x19c1eb[_0xf6ee('0x37')],{'$or':_[_0xf6ee('0x25')](_0x19c1eb[_0xf6ee('0x2d')],function(_0x492769){var _0x450c74={};_0x450c74[_0x492769]={'$like':'%'+_0x49f66f[_0xf6ee('0x2b')][_0xf6ee('0x36')]+'%'};return _0x450c74;})});}_0x19c1eb=_[_0xf6ee('0x39')]({},_0x19c1eb,_0x49f66f['options']);return _0x58c9e4[_0xf6ee('0x4d')](_0x19c1eb);}})['then'](function(_0x2b137a){if(_0x2b137a){_0x583a26=_0x2b137a[_0xf6ee('0x2f')];if(!_0x49f66f['query'][_0xf6ee('0x30')](_0xf6ee('0x4b'))){_0x19c1eb[_0xf6ee('0x31')]=qs[_0xf6ee('0x31')](_0x49f66f[_0xf6ee('0x2b')][_0xf6ee('0x31')]);_0x19c1eb['offset']=qs[_0xf6ee('0x1b')](_0x49f66f[_0xf6ee('0x2b')][_0xf6ee('0x1b')]);}return _0x58c9e4[_0xf6ee('0x4d')](_0x19c1eb);}})['then'](function(_0x23aa7b){if(_0x23aa7b){return _0x23aa7b?{'count':_0x583a26,'rows':_0x23aa7b}:null;}})[_0xf6ee('0x21')](respondWithResult(_0x1bfe57,null))[_0xf6ee('0x3f')](handleError(_0x1bfe57,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 41cf8f1..1969abc 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 _0xce03=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util','../../config/logger','api'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xce03,0x114));var _0x3ce0=function(_0x4818c7,_0x17a6ce){_0x4818c7=_0x4818c7-0x0;var _0x5c11a7=_0xce03[_0x4818c7];return _0x5c11a7;};'use strict';var _=require(_0x3ce0('0x0'));var util=require(_0x3ce0('0x1'));var logger=require(_0x3ce0('0x2'))(_0x3ce0('0x3'));var moment=require(_0x3ce0('0x4'));var BPromise=require(_0x3ce0('0x5'));var rp=require(_0x3ce0('0x6'));var fs=require('fs');var path=require(_0x3ce0('0x7'));var rimraf=require(_0x3ce0('0x8'));var config=require(_0x3ce0('0x9'));var attributes=require(_0x3ce0('0xa'));module[_0x3ce0('0xb')]=function(_0x3662af,_0x1818b1){return _0x3662af[_0x3ce0('0xc')]('Automation',attributes,{'tableName':_0x3ce0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9007=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation','lodash','util','../../config/logger','moment','bluebird'];(function(_0x23a2b5,_0x5d85d3){var _0x5591aa=function(_0x396395){while(--_0x396395){_0x23a2b5['push'](_0x23a2b5['shift']());}};_0x5591aa(++_0x5d85d3);}(_0x9007,0x1db));var _0x7900=function(_0x1f7839,_0x2a26e6){_0x1f7839=_0x1f7839-0x0;var _0x36b42e=_0x9007[_0x1f7839];return _0x36b42e;};'use strict';var _=require(_0x7900('0x0'));var util=require(_0x7900('0x1'));var logger=require(_0x7900('0x2'))('api');var moment=require(_0x7900('0x3'));var BPromise=require(_0x7900('0x4'));var rp=require(_0x7900('0x5'));var fs=require('fs');var path=require(_0x7900('0x6'));var rimraf=require(_0x7900('0x7'));var config=require(_0x7900('0x8'));var attributes=require(_0x7900('0x9'));module[_0x7900('0xa')]=function(_0x4e908b,_0x13c1d2){return _0x4e908b['define'](_0x7900('0xb'),attributes,{'tableName':'tools_automations','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 8cc04e9..1247962 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 _0x67c1=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','Automation,\x20%s,\x20%s'];(function(_0x49739d,_0x388796){var _0x5a4f98=function(_0x45b17d){while(--_0x45b17d){_0x49739d['push'](_0x49739d['shift']());}};_0x5a4f98(++_0x388796);}(_0x67c1,0xc6));var _0x167c=function(_0x9d2458,_0x34f8a7){_0x9d2458=_0x9d2458-0x0;var _0x45926e=_0x67c1[_0x9d2458];return _0x45926e;};'use strict';var _=require(_0x167c('0x0'));var util=require(_0x167c('0x1'));var moment=require(_0x167c('0x2'));var BPromise=require(_0x167c('0x3'));var rs=require(_0x167c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x167c('0x5'))['db'];var utils=require(_0x167c('0x6'));var logger=require(_0x167c('0x7'))(_0x167c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x167c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cb577,_0x2dd9b0,_0x4ab5cf){return new BPromise(function(_0x1270ca,_0x14a14d){return client['request'](_0x4cb577,_0x4ab5cf)[_0x167c('0xa')](function(_0x5f52d8){logger['info'](_0x167c('0xb'),_0x2dd9b0,_0x167c('0xc'));logger[_0x167c('0xd')](_0x167c('0xe'),_0x2dd9b0,'request\x20sent',JSON[_0x167c('0xf')](_0x5f52d8));if(_0x5f52d8[_0x167c('0x10')]){if(_0x5f52d8[_0x167c('0x10')][_0x167c('0x11')]===0x1f4){logger[_0x167c('0x10')](_0x167c('0xb'),_0x2dd9b0,_0x5f52d8[_0x167c('0x10')][_0x167c('0x12')]);return _0x14a14d(_0x5f52d8['error'][_0x167c('0x12')]);}logger[_0x167c('0x10')]('Automation,\x20%s,\x20%s',_0x2dd9b0,_0x5f52d8[_0x167c('0x10')][_0x167c('0x12')]);return _0x1270ca(_0x5f52d8[_0x167c('0x10')][_0x167c('0x12')]);}else{logger[_0x167c('0x13')](_0x167c('0xb'),_0x2dd9b0,_0x167c('0xc'));_0x1270ca(_0x5f52d8['result'][_0x167c('0x12')]);}})[_0x167c('0x14')](function(_0x486c98){logger[_0x167c('0x10')](_0x167c('0xb'),_0x2dd9b0,_0x486c98);_0x14a14d(_0x486c98);});});} \ No newline at end of file +var _0xaac4=['code','Automation,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaac4,0x72));var _0x4aac=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0xaac4[_0x5534fe];return _0x3d1dc2;};'use strict';var _=require(_0x4aac('0x0'));var util=require(_0x4aac('0x1'));var moment=require(_0x4aac('0x2'));var BPromise=require('bluebird');var rs=require(_0x4aac('0x3'));var fs=require('fs');var Redis=require(_0x4aac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4aac('0x5'));var logger=require(_0x4aac('0x6'))('rpc');var config=require(_0x4aac('0x7'));var jayson=require(_0x4aac('0x8'));var client=jayson[_0x4aac('0x9')][_0x4aac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x202fd8,_0x5416ec,_0x264f41){return new BPromise(function(_0x215b79,_0x199337){return client[_0x4aac('0xb')](_0x202fd8,_0x264f41)[_0x4aac('0xc')](function(_0x4bd217){logger[_0x4aac('0xd')]('Automation,\x20%s,\x20%s',_0x5416ec,'request\x20sent');logger['debug'](_0x4aac('0xe'),_0x5416ec,_0x4aac('0xf'),JSON[_0x4aac('0x10')](_0x4bd217));if(_0x4bd217[_0x4aac('0x11')]){if(_0x4bd217[_0x4aac('0x11')][_0x4aac('0x12')]===0x1f4){logger[_0x4aac('0x11')](_0x4aac('0x13'),_0x5416ec,_0x4bd217[_0x4aac('0x11')][_0x4aac('0x14')]);return _0x199337(_0x4bd217[_0x4aac('0x11')]['message']);}logger['error']('Automation,\x20%s,\x20%s',_0x5416ec,_0x4bd217[_0x4aac('0x11')][_0x4aac('0x14')]);return _0x215b79(_0x4bd217[_0x4aac('0x11')][_0x4aac('0x14')]);}else{logger['info'](_0x4aac('0x13'),_0x5416ec,'request\x20sent');_0x215b79(_0x4bd217[_0x4aac('0x15')][_0x4aac('0x14')]);}})['catch'](function(_0x5a6bbb){logger[_0x4aac('0x11')]('Automation,\x20%s,\x20%s',_0x5416ec,_0x5a6bbb);_0x199337(_0x5a6bbb);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index b75d2bb..e7e8e83 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 _0x93f3=['put','update','delete','destroy','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/conditions','/:id/actions','getActions','post','addActions'];(function(_0x4a6bed,_0x17dc5e){var _0x368013=function(_0x432976){while(--_0x432976){_0x4a6bed['push'](_0x4a6bed['shift']());}};_0x368013(++_0x17dc5e);}(_0x93f3,0x112));var _0x393f=function(_0x5d7635,_0x2237a7){_0x5d7635=_0x5d7635-0x0;var _0x51a345=_0x93f3[_0x5d7635];return _0x51a345;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x393f('0x0')]();var auth=require(_0x393f('0x1'));var interaction=require(_0x393f('0x2'));var config=require(_0x393f('0x3'));var controller=require('./automation.controller');router['get']('/',auth[_0x393f('0x4')](),controller[_0x393f('0x5')]);router['get'](_0x393f('0x6'),auth[_0x393f('0x4')](),controller[_0x393f('0x7')]);router[_0x393f('0x8')](_0x393f('0x9'),auth[_0x393f('0x4')](),controller['getConditions']);router['get'](_0x393f('0xa'),auth[_0x393f('0x4')](),controller[_0x393f('0xb')]);router[_0x393f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x393f('0xc')](_0x393f('0x9'),auth[_0x393f('0x4')](),controller['addConditions']);router[_0x393f('0xc')]('/:id/actions',auth[_0x393f('0x4')](),controller[_0x393f('0xd')]);router[_0x393f('0xe')](_0x393f('0x6'),auth[_0x393f('0x4')](),controller[_0x393f('0xf')]);router[_0x393f('0x10')](_0x393f('0x6'),auth[_0x393f('0x4')](),controller[_0x393f('0x11')]);module['exports']=router; \ No newline at end of file +var _0xee04=['path','connect-timeout','express','Router','../../components/auth/service','get','index','isAuthenticated','show','getConditions','/:id/conditions','addConditions','post','/:id/actions','put','/:id','update','delete','exports','multer','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xee04,0x124));var _0x4ee0=function(_0x5928e0,_0x282778){_0x5928e0=_0x5928e0-0x0;var _0x5eb4fc=_0xee04[_0x5928e0];return _0x5eb4fc;};'use strict';var multer=require(_0x4ee0('0x0'));var util=require(_0x4ee0('0x1'));var path=require(_0x4ee0('0x2'));var timeout=require(_0x4ee0('0x3'));var express=require(_0x4ee0('0x4'));var router=express[_0x4ee0('0x5')]();var auth=require(_0x4ee0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x4ee0('0x7')]('/',auth['isAuthenticated'](),controller[_0x4ee0('0x8')]);router['get']('/:id',auth[_0x4ee0('0x9')](),controller[_0x4ee0('0xa')]);router['get']('/:id/conditions',auth[_0x4ee0('0x9')](),controller[_0x4ee0('0xb')]);router[_0x4ee0('0x7')]('/:id/actions',auth[_0x4ee0('0x9')](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x4ee0('0xc'),auth[_0x4ee0('0x9')](),controller[_0x4ee0('0xd')]);router[_0x4ee0('0xe')](_0x4ee0('0xf'),auth[_0x4ee0('0x9')](),controller['addActions']);router[_0x4ee0('0x10')](_0x4ee0('0x11'),auth['isAuthenticated'](),controller[_0x4ee0('0x12')]);router[_0x4ee0('0x13')](_0x4ee0('0x11'),auth[_0x4ee0('0x9')](),controller['destroy']);module[_0x4ee0('0x14')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index a130671..8f35501 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 _0x007f=['Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ivr','BOOLEAN','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x65ca71,_0x126845){var _0x5cb16e=function(_0xe1143b){while(--_0xe1143b){_0x65ca71['push'](_0x65ca71['shift']());}};_0x5cb16e(++_0x126845);}(_0x007f,0x1a6));var _0xf007=function(_0x12dc45,_0x388e68){_0x12dc45=_0x12dc45-0x0;var _0x3691e4=_0x007f[_0x12dc45];return _0x3691e4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf007('0x0')],'unique':_0xf007('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xf007('0x2')),'allowNull':![],'defaultValue':_0xf007('0x2')},'description':{'type':Sequelize[_0xf007('0x0')]},'active':{'type':Sequelize[_0xf007('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xf007('0x4')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf007('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xf007('0x4')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf007('0x5')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf007('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf007('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf007('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf007('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0xf007('0x4')](0x3)[_0xf007('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xf007('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf007('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf007('0x4')](0x3)[_0xf007('0x6')],'defaultValue':0x3,'comment':_0xf007('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf007('0x4')](0x5)[_0xf007('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf007('0xb')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf007('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xf007('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf007('0x0')],'defaultValue':_0xf007('0xc')},'dialCheckDuplicateType':{'type':Sequelize[_0xf007('0xd')]('always','never',_0xf007('0xe')),'defaultValue':_0xf007('0xf')},'dialAMDActive':{'type':Sequelize[_0xf007('0x3')],'defaultValue':0x0,'comment':_0xf007('0x10')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf007('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf007('0x11')},'dialAMDGreeting':{'type':Sequelize[_0xf007('0x4')](0x9)[_0xf007('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf007('0x4')](0x9)[_0xf007('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf007('0x4')](0x9)[_0xf007('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xf007('0x4')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf007('0x4')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf007('0x12')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf007('0x4')](0x9)[_0xf007('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf007('0x13')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf007('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf007('0x4')](0x9)[_0xf007('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf007('0x14')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf007('0xd')](_0xf007('0x15'),_0xf007('0x16')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xf007('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf007('0x4')](0x3)[_0xf007('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf007('0x17')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xf007('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf007('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf007('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf007('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf007('0x4')](0x5)[_0xf007('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xf007('0x4')](0x3)[_0xf007('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf007('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf007('0x1a')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf007('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf007('0x1b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf007('0x4')](0x5)[_0xf007('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf007('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf007('0x1c')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf007('0x4')](0x5)[_0xf007('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf007('0x1d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf007('0x4')](0x3)[_0xf007('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf007('0x1e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf007('0x4')](0x5)[_0xf007('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf007('0x1f')}}; \ No newline at end of file +var _0xd781=['DESC','Cut\x20Digit\x20(min:1,\x20max:15)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','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','ASC'];(function(_0x2f8e08,_0x5787cd){var _0x56fbb4=function(_0x9bb57e){while(--_0x9bb57e){_0x2f8e08['push'](_0x2f8e08['shift']());}};_0x56fbb4(++_0x5787cd);}(_0xd781,0xd4));var _0x1d78=function(_0x7ebb12,_0x161c4a){_0x7ebb12=_0x7ebb12-0x0;var _0x189edd=_0xd781[_0x7ebb12];return _0x189edd;};'use strict';var Sequelize=require(_0x1d78('0x0'));module[_0x1d78('0x1')]={'name':{'type':Sequelize[_0x1d78('0x2')],'unique':_0x1d78('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1d78('0x4')](_0x1d78('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x1d78('0x2')]},'active':{'type':Sequelize[_0x1d78('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1d78('0x7')](0x4)[_0x1d78('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1d78('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1d78('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1d78('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d78('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1d78('0x7')](0x3)[_0x1d78('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d78('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1d78('0x7')](0x5)[_0x1d78('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d78('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x1d78('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x1d78('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1d78('0x7')](0x3)[_0x1d78('0x8')],'defaultValue':0x3,'comment':_0x1d78('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1d78('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d78('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1d78('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1d78('0xe')},'dialTimezone':{'type':Sequelize[_0x1d78('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1d78('0x2')],'defaultValue':_0x1d78('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1d78('0x10'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1d78('0x6')],'defaultValue':0x0,'comment':_0x1d78('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1d78('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x1d78('0x7')](0x9)[_0x1d78('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1d78('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1d78('0x7')](0x9)[_0x1d78('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1d78('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1d78('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1d78('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x1d78('0x7')](0x9)[_0x1d78('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1d78('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1d78('0x7')](0x9)[_0x1d78('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1d78('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1d78('0x7')](0x9)[_0x1d78('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1d78('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1d78('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1d78('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x1d78('0x4')]('DESC',_0x1d78('0x19')),'defaultValue':_0x1d78('0x1a')},'dialPrefix':{'type':Sequelize[_0x1d78('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1d78('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1d78('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1d78('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1d78('0x7')](0x3)[_0x1d78('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1d78('0x7')](0x5)[_0x1d78('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1d78('0x7')](0x3)[_0x1d78('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x1d78('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d78('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1d78('0x7')](0x3)[_0x1d78('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d78('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1d78('0x7')](0x5)[_0x1d78('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d78('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x1d78('0x7')](0x3)[_0x1d78('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d78('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1d78('0x7')](0x5)[_0x1d78('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d78('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1d78('0x7')](0x3)[_0x1d78('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d78('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1d78('0x7')](0x5)[_0x1d78('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index ebd862b..27e8dac 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 _0x34e8=['select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','cm_contacts','sequelize','removeBlackLists','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','IvrCampaigns','destroy','sendStatus','error','stack','name','map','Campaign','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','getHoppers','findOne','CmHopper','nolimit','CampaignId','getHopperHistories','CmHopperHistory','hasOwnProperty','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','updatedAt','field','NOW()','ContactId','CmListId','toString','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)'];(function(_0x128610,_0x1bc0c8){var _0x2409e0=function(_0x5172dc){while(--_0x5172dc){_0x128610['push'](_0x128610['shift']());}};_0x2409e0(++_0x1bc0c8);}(_0x34e8,0x12c));var _0x834e=function(_0x53b2e9,_0x56527d){_0x53b2e9=_0x53b2e9-0x0;var _0x4465c4=_0x34e8[_0x53b2e9];return _0x4465c4;};'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['Campaign'][_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('0x4a')]=function(_0x30568e,_0x40ff5a){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x30568e[_0x834e('0x4b')],{})[_0x834e('0x28')](function(_0x1419eb){var _0x390c45=_0x30568e[_0x834e('0x4c')][_0x834e('0x4d')]({'plain':!![]});if(!_0x390c45)throw new Error(_0x834e('0x4e'));if(_0x390c45[_0x834e('0x4f')]===_0x834e('0x4c')){var _0x1a3855=_0x1419eb[_0x834e('0x4d')]({'plain':!![]});var _0x32b8f7=_0x834e('0x29');return db[_0x834e('0x50')]['find']({'where':{'name':_0x32b8f7,'userProfileId':_0x390c45[_0x834e('0x51')]},'raw':!![]})[_0x834e('0x28')](function(_0x4e73e0){if(_0x4e73e0&&_0x4e73e0[_0x834e('0x52')]===0x0){return db[_0x834e('0x53')]['create']({'name':_0x1a3855[_0x834e('0x2e')],'resourceId':_0x1a3855['id'],'type':_0x4e73e0[_0x834e('0x2e')],'sectionId':_0x4e73e0['id']},{})[_0x834e('0x28')](function(){return _0x1419eb;});}else{return _0x1419eb;}})[_0x834e('0x46')](function(_0x4288e4){logger[_0x834e('0x2c')](_0x834e('0x54'),_0x4288e4);throw _0x4288e4;});}return _0x1419eb;})['then'](respondWithResult(_0x40ff5a,0xc9))[_0x834e('0x46')](handleError(_0x40ff5a,null));};exports[_0x834e('0x55')]=function(_0x3e0550,_0x363675){var _0x86ad2b={'where':{'id':_0x3e0550[_0x834e('0x56')]['id']}},_0x396bbe={};_0x396bbe[_0x834e('0x35')]=_['keys'](db[_0x834e('0x30')]['rawAttributes']);_0x86ad2b[_0x834e('0x3a')]=_['intersection'](_0x396bbe[_0x834e('0x35')],qs['fields'](_0x3e0550['query'][_0x834e('0x3b')]));_0x86ad2b[_0x834e('0x3a')]=_0x86ad2b['attributes']['length']?_0x86ad2b[_0x834e('0x3a')]:_0x396bbe[_0x834e('0x35')];if(_0x3e0550[_0x834e('0x37')][_0x834e('0x48')]){_0x86ad2b[_0x834e('0x44')]=[{'all':!![]}];}_0x86ad2b=_[_0x834e('0x42')]({},_0x86ad2b,_0x3e0550[_0x834e('0x43')]);return db[_0x834e('0x30')]['find'](_0x86ad2b)[_0x834e('0x28')](handleEntityNotFound(_0x363675,null))[_0x834e('0x28')](function(_0x5d5ac2){if(_0x5d5ac2){var _0x281342=_0x5d5ac2['get']({'plain':!![]});_0x281342=qs[_0x834e('0x57')](_0x281342,['id',_0x834e('0x58'),'updatedAt']);_0x3e0550[_0x834e('0x4b')]=_[_0x834e('0x57')](_0x3e0550[_0x834e('0x4b')],['id',_0x834e('0x58'),'updatedAt']);return db[_0x834e('0x30')][_0x834e('0x4a')](_[_0x834e('0x42')](_0x281342,_0x3e0550['body']),{'include':_0x3e0550[_0x834e('0x37')][_0x834e('0x48')]?[{'all':!![]}]:undefined})[_0x834e('0x28')](function(_0x1a0cd0){var _0x3183c5=_0x3e0550[_0x834e('0x4c')][_0x834e('0x4d')]({'plain':!![]});if(!_0x3183c5)throw new Error(_0x834e('0x4e'));if(_0x3183c5[_0x834e('0x4f')]===_0x834e('0x4c')){var _0x1e4310=_0x1a0cd0[_0x834e('0x4d')]({'plain':!![]});var _0x1b7045=_0x834e('0x29');return db[_0x834e('0x50')][_0x834e('0x49')]({'where':{'name':_0x1b7045,'userProfileId':_0x3183c5[_0x834e('0x51')]},'raw':!![]})[_0x834e('0x28')](function(_0x193a15){if(_0x193a15&&_0x193a15[_0x834e('0x52')]===0x0){return db[_0x834e('0x53')][_0x834e('0x4a')]({'name':_0x1e4310['name'],'resourceId':_0x1e4310['id'],'type':_0x193a15[_0x834e('0x2e')],'sectionId':_0x193a15['id']},{})[_0x834e('0x28')](function(){return _0x1a0cd0;});}else{return _0x1a0cd0;}})[_0x834e('0x46')](function(_0x36cc14){logger['error'](_0x834e('0x54'),_0x36cc14);throw _0x36cc14;});}return _0x1a0cd0;});}})['then'](respondWithResult(_0x363675,0xc9))['catch'](handleError(_0x363675,null));};exports[_0x834e('0x27')]=function(_0x2b1ec7,_0x1644dd){if(_0x2b1ec7[_0x834e('0x4b')]['id']){delete _0x2b1ec7[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x2b1ec7[_0x834e('0x56')]['id']}})['then'](handleEntityNotFound(_0x1644dd,null))[_0x834e('0x28')](saveUpdates(_0x2b1ec7['body'],null))[_0x834e('0x28')](respondWithResult(_0x1644dd,null))[_0x834e('0x46')](handleError(_0x1644dd,null));};exports['destroy']=function(_0x4c5886,_0x4a4def){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x4c5886[_0x834e('0x56')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x4a4def,null))['then'](removeEntity(_0x4a4def,null))[_0x834e('0x46')](handleError(_0x4a4def,null));};exports[_0x834e('0x59')]=function(_0x2df64f,_0x228a60,_0x3181af){var _0x28b5c9={'raw':!![],'where':{}};var _0x87818b={};var _0x413d5e={'count':0x0,'rows':[]};return db[_0x834e('0x30')][_0x834e('0x5a')]({'where':{'id':_0x2df64f['params']['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x228a60,null))[_0x834e('0x28')](function(_0x42fc96){if(_0x42fc96){_0x87818b[_0x834e('0x35')]=_['keys'](db[_0x834e('0x5b')]['rawAttributes']);_0x87818b['query']=_['keys'](_0x2df64f[_0x834e('0x37')]);_0x87818b[_0x834e('0x38')]=_['intersection'](_0x87818b[_0x834e('0x35')],_0x87818b[_0x834e('0x37')]);_0x28b5c9['attributes']=_[_0x834e('0x39')](_0x87818b[_0x834e('0x35')],qs['fields'](_0x2df64f['query'][_0x834e('0x3b')]));_0x28b5c9[_0x834e('0x3a')]=_0x28b5c9[_0x834e('0x3a')][_0x834e('0x3c')]?_0x28b5c9[_0x834e('0x3a')]:_0x87818b['model'];if(!_0x2df64f[_0x834e('0x37')]['hasOwnProperty'](_0x834e('0x5c'))){_0x28b5c9[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x2df64f['query'][_0x834e('0x22')]);_0x28b5c9[_0x834e('0x21')]=qs['offset'](_0x2df64f[_0x834e('0x37')][_0x834e('0x21')]);}_0x28b5c9[_0x834e('0x3d')]=qs['sort'](_0x2df64f[_0x834e('0x37')][_0x834e('0x3e')]);_0x28b5c9[_0x834e('0x41')]=qs[_0x834e('0x38')](_[_0x834e('0x3f')](_0x2df64f[_0x834e('0x37')],_0x87818b[_0x834e('0x38')]));_0x28b5c9[_0x834e('0x41')][_0x834e('0x5d')]=_0x42fc96['id'];if(_0x2df64f[_0x834e('0x37')]['filter']){_0x28b5c9['where']=_['merge'](_0x28b5c9[_0x834e('0x41')],{'$or':_[_0x834e('0x2f')](_0x28b5c9[_0x834e('0x3a')],function(_0x37fa2c){var _0x2faa0d={};_0x2faa0d[_0x37fa2c]={'$like':'%'+_0x2df64f['query']['filter']+'%'};return _0x2faa0d;})});}_0x28b5c9=_[_0x834e('0x42')]({},_0x28b5c9,_0x2df64f[_0x834e('0x43')]);return db[_0x834e('0x5b')][_0x834e('0x20')]({'where':_0x28b5c9[_0x834e('0x41')]})['then'](function(_0x2df0d5){_0x413d5e[_0x834e('0x20')]=_0x2df0d5;if(_0x2df64f[_0x834e('0x37')]['includeAll']){_0x28b5c9[_0x834e('0x44')]=[{'all':!![]}];}return db[_0x834e('0x5b')][_0x834e('0x45')](_0x28b5c9);})[_0x834e('0x28')](function(_0x23bc1e){_0x413d5e['rows']=_0x23bc1e;return _0x413d5e;});}})['then'](respondWithFilteredResult(_0x228a60,_0x28b5c9))[_0x834e('0x46')](handleError(_0x228a60,null));};exports[_0x834e('0x5e')]=function(_0x59b4a1,_0xb57b1b,_0x509427){var _0x40c401={'raw':!![],'where':{}};var _0x3fa2fe={};var _0x451a8e={'count':0x0,'rows':[]};return db['Campaign'][_0x834e('0x5a')]({'where':{'id':_0x59b4a1['params']['id']}})['then'](handleEntityNotFound(_0xb57b1b,null))['then'](function(_0x6735e6){if(_0x6735e6){_0x3fa2fe[_0x834e('0x35')]=_[_0x834e('0x36')](db[_0x834e('0x5f')][_0x834e('0x31')]);_0x3fa2fe[_0x834e('0x37')]=_[_0x834e('0x36')](_0x59b4a1[_0x834e('0x37')]);_0x3fa2fe[_0x834e('0x38')]=_['intersection'](_0x3fa2fe[_0x834e('0x35')],_0x3fa2fe['query']);_0x40c401[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x3fa2fe[_0x834e('0x35')],qs[_0x834e('0x3b')](_0x59b4a1[_0x834e('0x37')][_0x834e('0x3b')]));_0x40c401['attributes']=_0x40c401['attributes'][_0x834e('0x3c')]?_0x40c401[_0x834e('0x3a')]:_0x3fa2fe['model'];if(!_0x59b4a1[_0x834e('0x37')][_0x834e('0x60')](_0x834e('0x5c'))){_0x40c401[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x59b4a1['query'][_0x834e('0x22')]);_0x40c401[_0x834e('0x21')]=qs['offset'](_0x59b4a1['query']['offset']);}_0x40c401[_0x834e('0x3d')]=qs[_0x834e('0x3e')](_0x59b4a1['query'][_0x834e('0x3e')]);_0x40c401[_0x834e('0x41')]=qs['filters'](_[_0x834e('0x3f')](_0x59b4a1['query'],_0x3fa2fe['filters']));_0x40c401[_0x834e('0x41')][_0x834e('0x5d')]=_0x6735e6['id'];if(_0x59b4a1[_0x834e('0x37')][_0x834e('0x40')]){_0x40c401['where']=_[_0x834e('0x42')](_0x40c401[_0x834e('0x41')],{'$or':_[_0x834e('0x2f')](_0x40c401[_0x834e('0x3a')],function(_0x46aabf){var _0x27603d={};_0x27603d[_0x46aabf]={'$like':'%'+_0x59b4a1[_0x834e('0x37')][_0x834e('0x40')]+'%'};return _0x27603d;})});}_0x40c401=_[_0x834e('0x42')]({},_0x40c401,_0x59b4a1[_0x834e('0x43')]);return db[_0x834e('0x5f')][_0x834e('0x20')]({'where':_0x40c401[_0x834e('0x41')]})[_0x834e('0x28')](function(_0x37ae42){_0x451a8e[_0x834e('0x20')]=_0x37ae42;if(_0x59b4a1[_0x834e('0x37')][_0x834e('0x48')]){_0x40c401[_0x834e('0x44')]=[{'all':!![]}];}return db[_0x834e('0x5f')][_0x834e('0x45')](_0x40c401);})[_0x834e('0x28')](function(_0x483815){_0x451a8e[_0x834e('0x61')]=_0x483815;return _0x451a8e;});}})[_0x834e('0x28')](respondWithFilteredResult(_0xb57b1b,_0x40c401))[_0x834e('0x46')](handleError(_0xb57b1b,null));};exports[_0x834e('0x62')]=function(_0x14b603,_0x3bcdcd,_0x3ad2c5){var _0x4047a8={'raw':!![],'where':{}};var _0x11ca03={};var _0x4d226b={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x14b603[_0x834e('0x56')]['id']}})['then'](handleEntityNotFound(_0x3bcdcd,null))[_0x834e('0x28')](function(_0xf2b35){if(_0xf2b35){_0x11ca03[_0x834e('0x35')]=_['keys'](db[_0x834e('0x63')][_0x834e('0x31')]);_0x11ca03[_0x834e('0x37')]=_[_0x834e('0x36')](_0x14b603[_0x834e('0x37')]);_0x11ca03[_0x834e('0x38')]=_['intersection'](_0x11ca03[_0x834e('0x35')],_0x11ca03[_0x834e('0x37')]);_0x4047a8[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x11ca03[_0x834e('0x35')],qs['fields'](_0x14b603['query']['fields']));_0x4047a8['attributes']=_0x4047a8[_0x834e('0x3a')][_0x834e('0x3c')]?_0x4047a8['attributes']:_0x11ca03[_0x834e('0x35')];if(!_0x14b603[_0x834e('0x37')]['hasOwnProperty'](_0x834e('0x5c'))){_0x4047a8[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x14b603[_0x834e('0x37')][_0x834e('0x22')]);_0x4047a8[_0x834e('0x21')]=qs['offset'](_0x14b603['query'][_0x834e('0x21')]);}_0x4047a8[_0x834e('0x3d')]=qs[_0x834e('0x3e')](_0x14b603['query'][_0x834e('0x3e')]);_0x4047a8[_0x834e('0x41')]=qs['filters'](_[_0x834e('0x3f')](_0x14b603[_0x834e('0x37')],_0x11ca03[_0x834e('0x38')]));_0x4047a8[_0x834e('0x41')]['CampaignId']=_0xf2b35['id'];if(_0x14b603[_0x834e('0x37')]['filter']){_0x4047a8['where']=_[_0x834e('0x42')](_0x4047a8[_0x834e('0x41')],{'$or':_[_0x834e('0x2f')](_0x4047a8[_0x834e('0x3a')],function(_0x2426f2){var _0x1e850a={};_0x1e850a[_0x2426f2]={'$like':'%'+_0x14b603['query']['filter']+'%'};return _0x1e850a;})});}_0x4047a8=_[_0x834e('0x42')]({},_0x4047a8,_0x14b603[_0x834e('0x43')]);return db[_0x834e('0x63')][_0x834e('0x20')]({'where':_0x4047a8[_0x834e('0x41')]})[_0x834e('0x28')](function(_0x3e4fe2){_0x4d226b['count']=_0x3e4fe2;if(_0x14b603[_0x834e('0x37')][_0x834e('0x48')]){_0x4047a8['include']=[{'all':!![]}];}return db[_0x834e('0x63')][_0x834e('0x45')](_0x4047a8);})[_0x834e('0x28')](function(_0x2a3ca4){_0x4d226b[_0x834e('0x61')]=_0x2a3ca4;return _0x4d226b;});}})[_0x834e('0x28')](respondWithFilteredResult(_0x3bcdcd,_0x4047a8))[_0x834e('0x46')](handleError(_0x3bcdcd,null));};exports[_0x834e('0x64')]=function(_0x14e794,_0x19d1ce,_0x496709){var _0x152372={'raw':!![],'where':{}};var _0x17e922={};var _0x1306d9={'count':0x0,'rows':[]};return db['Campaign'][_0x834e('0x5a')]({'where':{'id':_0x14e794[_0x834e('0x56')]['id']}})['then'](handleEntityNotFound(_0x19d1ce,null))[_0x834e('0x28')](function(_0x4bd836){if(_0x4bd836){_0x17e922[_0x834e('0x35')]=_['keys'](db[_0x834e('0x65')]['rawAttributes']);_0x17e922[_0x834e('0x37')]=_[_0x834e('0x36')](_0x14e794[_0x834e('0x37')]);_0x17e922[_0x834e('0x38')]=_['intersection'](_0x17e922[_0x834e('0x35')],_0x17e922[_0x834e('0x37')]);_0x152372[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x17e922[_0x834e('0x35')],qs[_0x834e('0x3b')](_0x14e794[_0x834e('0x37')][_0x834e('0x3b')]));_0x152372[_0x834e('0x3a')]=_0x152372[_0x834e('0x3a')][_0x834e('0x3c')]?_0x152372[_0x834e('0x3a')]:_0x17e922[_0x834e('0x35')];if(!_0x14e794[_0x834e('0x37')][_0x834e('0x60')](_0x834e('0x5c'))){_0x152372[_0x834e('0x22')]=qs['limit'](_0x14e794['query'][_0x834e('0x22')]);_0x152372[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x14e794[_0x834e('0x37')][_0x834e('0x21')]);}_0x152372[_0x834e('0x3d')]=qs[_0x834e('0x3e')](_0x14e794[_0x834e('0x37')][_0x834e('0x3e')]);_0x152372[_0x834e('0x41')]=qs[_0x834e('0x38')](_[_0x834e('0x3f')](_0x14e794['query'],_0x17e922[_0x834e('0x38')]));_0x152372['where'][_0x834e('0x5d')]=_0x4bd836['id'];if(_0x14e794[_0x834e('0x37')][_0x834e('0x40')]){_0x152372['where']=_[_0x834e('0x42')](_0x152372[_0x834e('0x41')],{'$or':_['map'](_0x152372['attributes'],function(_0x62ea1){var _0x3b7b1a={};_0x3b7b1a[_0x62ea1]={'$like':'%'+_0x14e794['query'][_0x834e('0x40')]+'%'};return _0x3b7b1a;})});}_0x152372=_[_0x834e('0x42')]({},_0x152372,_0x14e794[_0x834e('0x43')]);return db[_0x834e('0x65')][_0x834e('0x20')]({'where':_0x152372['where']})['then'](function(_0x453e58){_0x1306d9['count']=_0x453e58;if(_0x14e794['query']['includeAll']){_0x152372[_0x834e('0x44')]=[{'all':!![]}];}return db[_0x834e('0x65')]['findAll'](_0x152372);})[_0x834e('0x28')](function(_0x66cbdc){_0x1306d9[_0x834e('0x61')]=_0x66cbdc;return _0x1306d9;});}})[_0x834e('0x28')](respondWithFilteredResult(_0x19d1ce,_0x152372))['catch'](handleError(_0x19d1ce,null));};exports[_0x834e('0x66')]=function(_0x288eb1,_0x117196,_0x5633f4){var _0x3d8af7={};var _0x5f3b7d={};var _0x15e6e4;var _0x4af2a2;return db[_0x834e('0x30')][_0x834e('0x5a')]({'where':{'id':_0x288eb1['params']['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x117196,null))[_0x834e('0x28')](function(_0x41e7a8){if(_0x41e7a8){_0x15e6e4=_0x41e7a8;_0x5f3b7d[_0x834e('0x35')]=_[_0x834e('0x36')](db[_0x834e('0x67')]['rawAttributes']);_0x5f3b7d[_0x834e('0x37')]=_[_0x834e('0x36')](_0x288eb1[_0x834e('0x37')]);_0x5f3b7d[_0x834e('0x38')]=_[_0x834e('0x39')](_0x5f3b7d[_0x834e('0x35')],_0x5f3b7d['query']);_0x3d8af7[_0x834e('0x3a')]=_['intersection'](_0x5f3b7d['model'],qs[_0x834e('0x3b')](_0x288eb1['query']['fields']));_0x3d8af7[_0x834e('0x3a')]=_0x3d8af7[_0x834e('0x3a')][_0x834e('0x3c')]?_0x3d8af7[_0x834e('0x3a')]:_0x5f3b7d[_0x834e('0x35')];_0x3d8af7[_0x834e('0x3d')]=qs[_0x834e('0x3e')](_0x288eb1[_0x834e('0x37')][_0x834e('0x3e')]);_0x3d8af7[_0x834e('0x41')]=qs[_0x834e('0x38')](_[_0x834e('0x3f')](_0x288eb1[_0x834e('0x37')],_0x5f3b7d[_0x834e('0x38')]));if(_0x288eb1['query'][_0x834e('0x40')]){_0x3d8af7['where']=_[_0x834e('0x42')](_0x3d8af7[_0x834e('0x41')],{'$or':_[_0x834e('0x2f')](_0x3d8af7[_0x834e('0x3a')],function(_0x5ab11f){var _0x5f558a={};_0x5f558a[_0x5ab11f]={'$like':'%'+_0x288eb1[_0x834e('0x37')][_0x834e('0x40')]+'%'};return _0x5f558a;})});}_0x3d8af7=_['merge']({},_0x3d8af7,_0x288eb1[_0x834e('0x43')]);return _0x15e6e4[_0x834e('0x66')](_0x3d8af7);}})['then'](function(_0x231970){if(_0x231970){_0x4af2a2=_0x231970[_0x834e('0x3c')];if(!_0x288eb1[_0x834e('0x37')][_0x834e('0x60')]('nolimit')){_0x3d8af7['limit']=qs['limit'](_0x288eb1['query'][_0x834e('0x22')]);_0x3d8af7[_0x834e('0x21')]=qs['offset'](_0x288eb1[_0x834e('0x37')]['offset']);}return _0x15e6e4[_0x834e('0x66')](_0x3d8af7);}})[_0x834e('0x28')](function(_0x343a59){if(_0x343a59){return _0x343a59?{'count':_0x4af2a2,'rows':_0x343a59}:null;}})[_0x834e('0x28')](respondWithResult(_0x117196,null))[_0x834e('0x46')](handleError(_0x117196,null));};exports[_0x834e('0x68')]=function(_0x3c775f,_0x4fc61d,_0x12a0f3){var _0x20d52f,_0x59ac23;return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x3c775f['params']['id']}})['then'](handleEntityNotFound(_0x4fc61d,null))['then'](function(_0x3edbbb){if(_0x3edbbb){_0x59ac23=_0x3edbbb;return _0x3edbbb[_0x834e('0x68')](_0x3c775f[_0x834e('0x4b')]['ids'],_[_0x834e('0x57')](_0x3c775f[_0x834e('0x4b')],[_0x834e('0x69'),'id'])||{});}return null;})[_0x834e('0x6a')](function(_0x4b4f7c){var _0xad7b72;_0x20d52f=_0x4b4f7c||[];var _0x19cb0b=[];if(_0x4b4f7c){for(var _0x13af70=0x0;_0x13af70<_0x4b4f7c[_0x834e('0x3c')];_0x13af70+=0x1){var _0x102640=_0x4b4f7c[_0x13af70]['get']({'plain':!![]});_0x59ac23['dialCheckDuplicateType']=_0x3c775f[_0x834e('0x4b')][_0x834e('0x6b')]?_0x3c775f[_0x834e('0x4b')][_0x834e('0x6b')]:_0x59ac23[_0x834e('0x6b')];switch(_0x59ac23[_0x834e('0x6b')]){case _0x834e('0x6c'):_0xad7b72=squel[_0x834e('0x6d')]()[_0x834e('0x6e')](_0x834e('0x6f'))[_0x834e('0x70')]([_0x834e('0x71'),_0x834e('0x72'),'ContactId',_0x834e('0x73'),_0x834e('0x5d'),_0x834e('0x58'),_0x834e('0x74')],squel['select']()['field']('phone',_0x834e('0x71'))[_0x834e('0x75')](_0x834e('0x76'),_0x834e('0x72'))[_0x834e('0x75')]('id',_0x834e('0x77'))[_0x834e('0x75')](_0x102640[_0x834e('0x78')]['toString'](),'ListId')['field'](_0x3c775f['params']['id'][_0x834e('0x79')](),_0x834e('0x5d'))[_0x834e('0x75')](_0x834e('0x76'),_0x834e('0x58'))[_0x834e('0x75')](_0x834e('0x76'),_0x834e('0x74'))[_0x834e('0x7a')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x834e('0x7b'),_0x102640[_0x834e('0x78')][_0x834e('0x79')]())[_0x834e('0x41')](_0x834e('0x7c'))[_0x834e('0x41')](_0x834e('0x7d'),squel[_0x834e('0x7e')]()[_0x834e('0x75')](_0x834e('0x7f'))[_0x834e('0x7a')](_0x834e('0x80'))[_0x834e('0x41')](_0x834e('0x81'),_0x3c775f[_0x834e('0x56')]['id'][_0x834e('0x79')]()))['where'](_0x834e('0x7d'),squel['select']()[_0x834e('0x75')](_0x834e('0x82'))[_0x834e('0x7a')]('cm_hopper')[_0x834e('0x41')](_0x834e('0x81'),_0x3c775f['params']['id']['toString']())))[_0x834e('0x79')]();break;case _0x834e('0x83'):_0xad7b72=squel[_0x834e('0x6d')]()[_0x834e('0x6e')](_0x834e('0x6f'))[_0x834e('0x70')]([_0x834e('0x71'),_0x834e('0x72'),'ContactId',_0x834e('0x73'),_0x834e('0x5d'),_0x834e('0x58'),_0x834e('0x74')],squel[_0x834e('0x7e')]()[_0x834e('0x75')](_0x834e('0x71'),'phone')[_0x834e('0x75')]('NOW()','scheduledAt')[_0x834e('0x75')]('id',_0x834e('0x77'))['field'](_0x102640[_0x834e('0x78')][_0x834e('0x79')](),'ListId')[_0x834e('0x75')](_0x3c775f[_0x834e('0x56')]['id']['toString'](),'CampaignId')[_0x834e('0x75')](_0x834e('0x76'),'createdAt')['field'](_0x834e('0x76'),_0x834e('0x74'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x834e('0x41')]('ListId\x20=\x20?',_0x102640[_0x834e('0x78')]['toString']())[_0x834e('0x41')](_0x834e('0x7c'))[_0x834e('0x41')](_0x834e('0x7d'),squel['select']()[_0x834e('0x75')](_0x834e('0x82'))[_0x834e('0x7a')](_0x834e('0x6f'))[_0x834e('0x41')](_0x834e('0x81'),_0x3c775f[_0x834e('0x56')]['id'][_0x834e('0x79')]())))[_0x834e('0x79')]();break;default:_0xad7b72=squel[_0x834e('0x6d')]()['into'](_0x834e('0x6f'))['fromQuery']([_0x834e('0x71'),_0x834e('0x72'),_0x834e('0x77'),_0x834e('0x73'),_0x834e('0x5d'),'createdAt',_0x834e('0x74')],squel['select']()['field'](_0x834e('0x71'),_0x834e('0x71'))[_0x834e('0x75')]('NOW()',_0x834e('0x72'))[_0x834e('0x75')]('id',_0x834e('0x77'))[_0x834e('0x75')](_0x102640[_0x834e('0x78')][_0x834e('0x79')](),_0x834e('0x73'))[_0x834e('0x75')](_0x3c775f[_0x834e('0x56')]['id'][_0x834e('0x79')](),_0x834e('0x5d'))['field'](_0x834e('0x76'),_0x834e('0x58'))[_0x834e('0x75')](_0x834e('0x76'),_0x834e('0x74'))[_0x834e('0x7a')]('cm_contacts')[_0x834e('0x41')](_0x834e('0x84'))[_0x834e('0x41')](_0x834e('0x7b'),_0x102640[_0x834e('0x78')][_0x834e('0x79')]())[_0x834e('0x41')](_0x834e('0x7c')))[_0x834e('0x79')]();}_0x19cb0b[_0x834e('0x85')](db['sequelize']['query'](_0xad7b72));}return BPromise[_0x834e('0x86')](_0x19cb0b);}})['then'](function(){return _0x20d52f;})[_0x834e('0x28')](respondWithResult(_0x4fc61d,null))[_0x834e('0x46')](handleError(_0x4fc61d,null));};exports[_0x834e('0x87')]=function(_0x198f0e,_0x1daa58,_0x1d53c6){return db['Campaign'][_0x834e('0x49')]({'where':{'id':_0x198f0e['params']['id']}})['then'](handleEntityNotFound(_0x1daa58,null))['then'](function(_0x137fdd){if(_0x137fdd){return _0x137fdd[_0x834e('0x87')](_0x198f0e['query']['ids']);}})['then'](function(_0x2515f6){if(_0x2515f6){return db[_0x834e('0x5b')][_0x834e('0x2a')]({'where':{'ListId':_0x198f0e['query'][_0x834e('0x69')],'CampaignId':_0x198f0e[_0x834e('0x56')]['id']}})[_0x834e('0x28')](function(){return _0x2515f6;});}})[_0x834e('0x28')](respondWithStatusCode(_0x1daa58,null))[_0x834e('0x46')](handleError(_0x1daa58,null));};exports[_0x834e('0x88')]=function(_0x4e3ba4,_0x4cae7a,_0x5c7fe3){var _0x545bcd={'raw':!![],'where':{}};var _0x354d58={};var _0xf82ca8={'count':0x0,'rows':[]};return db[_0x834e('0x30')][_0x834e('0x5a')]({'where':{'id':_0x4e3ba4[_0x834e('0x56')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x4cae7a,null))[_0x834e('0x28')](function(_0x23ddb4){if(_0x23ddb4){_0x354d58[_0x834e('0x35')]=_[_0x834e('0x36')](db[_0x834e('0x67')][_0x834e('0x31')]);_0x354d58[_0x834e('0x37')]=_[_0x834e('0x36')](_0x4e3ba4[_0x834e('0x37')]);_0x354d58['filters']=_['intersection'](_0x354d58[_0x834e('0x35')],_0x354d58[_0x834e('0x37')]);_0x545bcd[_0x834e('0x3a')]=_['intersection'](_0x354d58[_0x834e('0x35')],qs[_0x834e('0x3b')](_0x4e3ba4[_0x834e('0x37')][_0x834e('0x3b')]));_0x545bcd[_0x834e('0x3a')]=_0x545bcd[_0x834e('0x3a')][_0x834e('0x3c')]?_0x545bcd[_0x834e('0x3a')]:_0x354d58[_0x834e('0x35')];if(!_0x4e3ba4['query'][_0x834e('0x60')](_0x834e('0x5c'))){_0x545bcd[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4e3ba4['query'][_0x834e('0x22')]);_0x545bcd[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x4e3ba4[_0x834e('0x37')][_0x834e('0x21')]);}_0x545bcd[_0x834e('0x3d')]=qs[_0x834e('0x3e')](_0x4e3ba4[_0x834e('0x37')][_0x834e('0x3e')]);_0x545bcd['where']=qs[_0x834e('0x38')](_['pick'](_0x4e3ba4[_0x834e('0x37')],_0x354d58['filters']));_0x545bcd[_0x834e('0x41')][_0x834e('0x5d')]=_0x23ddb4['id'];if(_0x4e3ba4[_0x834e('0x37')][_0x834e('0x40')]){_0x545bcd[_0x834e('0x41')]=_['merge'](_0x545bcd[_0x834e('0x41')],{'$or':_[_0x834e('0x2f')](_0x545bcd['attributes'],function(_0x5b891e){var _0x10df58={};_0x10df58[_0x5b891e]={'$like':'%'+_0x4e3ba4['query']['filter']+'%'};return _0x10df58;})});}_0x545bcd=_['merge']({},_0x545bcd,_0x4e3ba4[_0x834e('0x43')]);return db[_0x834e('0x67')][_0x834e('0x20')]({'where':_0x545bcd[_0x834e('0x41')]})[_0x834e('0x28')](function(_0x1e62da){_0xf82ca8[_0x834e('0x20')]=_0x1e62da;if(_0x4e3ba4['query'][_0x834e('0x48')]){_0x545bcd[_0x834e('0x44')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x545bcd);})[_0x834e('0x28')](function(_0x17e62c){_0xf82ca8['rows']=_0x17e62c;return _0xf82ca8;});}})['then'](respondWithFilteredResult(_0x4cae7a,_0x545bcd))[_0x834e('0x46')](handleError(_0x4cae7a,null));};exports[_0x834e('0x89')]=function(_0x42305c,_0x599664,_0x31d242){var _0x3a7ce7,_0x2148e3;return db['Campaign'][_0x834e('0x49')]({'where':{'id':_0x42305c['params']['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x599664,null))[_0x834e('0x28')](function(_0x3a1328){if(_0x3a1328){_0x2148e3=_0x3a1328;return _0x3a1328[_0x834e('0x89')](_0x42305c[_0x834e('0x4b')]['ids'],_[_0x834e('0x57')](_0x42305c[_0x834e('0x4b')],[_0x834e('0x69'),'id'])||{});}return null;})[_0x834e('0x6a')](function(_0x474d24){var _0x4a84b3;_0x3a7ce7=_0x474d24||[];var _0x5bf6d2=[];if(_0x474d24){for(var _0x2ca127=0x0;_0x2ca127<_0x474d24[_0x834e('0x3c')];_0x2ca127+=0x1){var _0x13d670=_0x474d24[_0x2ca127]['get']({'plain':!![]});_0x4a84b3=squel[_0x834e('0x6d')]()[_0x834e('0x6e')](_0x834e('0x8a'))[_0x834e('0x70')](['phone',_0x834e('0x77'),_0x834e('0x73'),'CampaignId',_0x834e('0x58'),_0x834e('0x74')],squel[_0x834e('0x7e')]()[_0x834e('0x75')]('phone',_0x834e('0x71'))['field']('id',_0x834e('0x77'))[_0x834e('0x75')](_0x13d670[_0x834e('0x78')][_0x834e('0x79')](),_0x834e('0x73'))[_0x834e('0x75')](_0x42305c['params']['id']['toString'](),_0x834e('0x5d'))[_0x834e('0x75')]('NOW()',_0x834e('0x58'))['field'](_0x834e('0x76'),_0x834e('0x74'))[_0x834e('0x7a')](_0x834e('0x8b'))[_0x834e('0x41')](_0x834e('0x84'))[_0x834e('0x41')]('ListId\x20=\x20?',_0x13d670[_0x834e('0x78')][_0x834e('0x79')]())[_0x834e('0x41')](_0x834e('0x7c')))[_0x834e('0x79')]();_0x5bf6d2['push'](db[_0x834e('0x8c')][_0x834e('0x37')](_0x4a84b3));}return BPromise[_0x834e('0x86')](_0x5bf6d2);}})['then'](function(){return _0x3a7ce7;})['then'](respondWithResult(_0x599664,null))['catch'](handleError(_0x599664,null));};exports[_0x834e('0x8d')]=function(_0x2cad75,_0x431bd3,_0xd6f2cc){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x2cad75[_0x834e('0x56')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x431bd3,null))[_0x834e('0x28')](function(_0x3a1e77){if(_0x3a1e77){return _0x3a1e77[_0x834e('0x8d')](_0x2cad75['query'][_0x834e('0x69')]);}})[_0x834e('0x28')](function(_0x2a3807){if(_0x2a3807){return db[_0x834e('0x65')][_0x834e('0x2a')]({'where':{'ListId':_0x2cad75[_0x834e('0x37')][_0x834e('0x69')],'CampaignId':_0x2cad75[_0x834e('0x56')]['id']}})['then'](function(){return _0x2a3807;});}})[_0x834e('0x28')](respondWithStatusCode(_0x431bd3,null))[_0x834e('0x46')](handleError(_0x431bd3,null));}; \ No newline at end of file +var _0x22fb=['cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','sequelize','all','addBlackLists','push','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','destroy','then','get','error','stack','name','map','Campaign','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','includeAll','include','findAll','catch','params','keys','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','IvrCampaigns','UserProfileResource','findOne','CmHopper','nolimit','pick','CampaignId','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into'];(function(_0x596a91,_0x2ae66a){var _0x2281bb=function(_0x1d6178){while(--_0x1d6178){_0x596a91['push'](_0x596a91['shift']());}};_0x2281bb(++_0x2ae66a);}(_0x22fb,0x192));var _0xb22f=function(_0x5eb7aa,_0x4f7b30){_0x5eb7aa=_0x5eb7aa-0x0;var _0xca8012=_0x22fb[_0x5eb7aa];return _0xca8012;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb22f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb22f('0x1'));var rp=require(_0xb22f('0x2'));var moment=require(_0xb22f('0x3'));var BPromise=require(_0xb22f('0x4'));var Mustache=require(_0xb22f('0x5'));var util=require('util');var path=require(_0xb22f('0x6'));var sox=require(_0xb22f('0x7'));var csv=require(_0xb22f('0x8'));var ejs=require(_0xb22f('0x9'));var fs=require('fs');var _=require(_0xb22f('0xa'));var squel=require(_0xb22f('0xb'));var crypto=require('crypto');var jsforce=require(_0xb22f('0xc'));var deskjs=require(_0xb22f('0xd'));var toCsv=require(_0xb22f('0x8'));var querystring=require(_0xb22f('0xe'));var Papa=require(_0xb22f('0xf'));var Redis=require(_0xb22f('0x10'));var authService=require(_0xb22f('0x11'));var qs=require(_0xb22f('0x12'));var as=require(_0xb22f('0x13'));var hardwareService=require(_0xb22f('0x14'));var logger=require(_0xb22f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb22f('0x16'))['db'];function respondWithStatusCode(_0x4923d3,_0x4bb02a){_0x4bb02a=_0x4bb02a||0xcc;return function(_0x5bf0b9){if(_0x5bf0b9){return _0x4923d3[_0xb22f('0x17')](_0x4bb02a);}return _0x4923d3[_0xb22f('0x18')](_0x4bb02a)[_0xb22f('0x19')]();};}function respondWithResult(_0x2f046d,_0x390c53){_0x390c53=_0x390c53||0xc8;return function(_0x32d796){if(_0x32d796){return _0x2f046d['status'](_0x390c53)[_0xb22f('0x1a')](_0x32d796);}};}function respondWithFilteredResult(_0x5f1590,_0x36e2a8){return function(_0x4f9108){if(_0x4f9108){var _0x2187fc=_0x4f9108[_0xb22f('0x1b')],_0x514a8f=_0x36e2a8['offset'],_0x160417=_0x36e2a8[_0xb22f('0x1c')]+_0x36e2a8['limit'],_0xc36af4;if(_0x160417>=_0x2187fc){_0x160417=_0x2187fc;_0xc36af4=0xc8;}else{_0xc36af4=0xce;}_0x5f1590[_0xb22f('0x18')](_0xc36af4);return _0x5f1590[_0xb22f('0x1d')](_0xb22f('0x1e'),_0x514a8f+'-'+_0x160417+'/'+_0x2187fc)[_0xb22f('0x1a')](_0x4f9108);}return null;};}function patchUpdates(_0x139bb6){return function(_0x2d52e4){try{jsonpatch['apply'](_0x2d52e4,_0x139bb6,!![]);}catch(_0x72994){return BPromise['reject'](_0x72994);}return _0x2d52e4[_0xb22f('0x1f')]();};}function saveUpdates(_0x3878d8,_0x316f11){return function(_0x2239b8){if(_0x2239b8){return _0x2239b8[_0xb22f('0x20')](_0x3878d8)['then'](function(_0x47d5cf){return _0x47d5cf;});}return null;};}function removeEntity(_0x3da442,_0x19e480){return function(_0xf34e0d){if(_0xf34e0d){return _0xf34e0d[_0xb22f('0x21')]()[_0xb22f('0x22')](function(){var _0xcb9a74=_0xf34e0d[_0xb22f('0x23')]({'plain':!![]});var _0x286465='IvrCampaigns';return db['UserProfileResource'][_0xb22f('0x21')]({'where':{'type':_0x286465,'resourceId':_0xcb9a74['id']}})[_0xb22f('0x22')](function(){return _0xf34e0d;});})['then'](function(){_0x3da442[_0xb22f('0x18')](0xcc)[_0xb22f('0x19')]();});}};}function handleEntityNotFound(_0x4f2986,_0x4687f2){return function(_0x2918be){if(!_0x2918be){_0x4f2986['sendStatus'](0x194);}return _0x2918be;};}function handleError(_0x3e471f,_0x2c4a9e){_0x2c4a9e=_0x2c4a9e||0x1f4;return function(_0xcddbca){logger[_0xb22f('0x24')](_0xcddbca[_0xb22f('0x25')]);if(_0xcddbca[_0xb22f('0x26')]){delete _0xcddbca[_0xb22f('0x26')];}_0x3e471f[_0xb22f('0x18')](_0x2c4a9e)['send'](_0xcddbca);};}exports['index']=function(_0x5d86a1,_0x2f6b97){var _0x557d96={},_0x327200={},_0xc7f33b={'count':0x0,'rows':[]};var _0xf268f4=_[_0xb22f('0x27')](db[_0xb22f('0x28')]['rawAttributes'],function(_0x519034){return{'name':_0x519034[_0xb22f('0x29')],'type':_0x519034[_0xb22f('0x2a')][_0xb22f('0x2b')]};});_0x327200[_0xb22f('0x2c')]=_['map'](_0xf268f4,_0xb22f('0x26'));_0x327200[_0xb22f('0x2d')]=_['keys'](_0x5d86a1[_0xb22f('0x2d')]);_0x327200[_0xb22f('0x2e')]=_[_0xb22f('0x2f')](_0x327200[_0xb22f('0x2c')],_0x327200[_0xb22f('0x2d')]);_0x557d96['attributes']=_['intersection'](_0x327200[_0xb22f('0x2c')],qs[_0xb22f('0x30')](_0x5d86a1[_0xb22f('0x2d')][_0xb22f('0x30')]));_0x557d96[_0xb22f('0x31')]=_0x557d96[_0xb22f('0x31')][_0xb22f('0x32')]?_0x557d96[_0xb22f('0x31')]:_0x327200[_0xb22f('0x2c')];if(!_0x5d86a1['query'][_0xb22f('0x33')]('nolimit')){_0x557d96['limit']=qs[_0xb22f('0x34')](_0x5d86a1[_0xb22f('0x2d')][_0xb22f('0x34')]);_0x557d96[_0xb22f('0x1c')]=qs[_0xb22f('0x1c')](_0x5d86a1[_0xb22f('0x2d')][_0xb22f('0x1c')]);}_0x557d96[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x5d86a1[_0xb22f('0x2d')][_0xb22f('0x36')]);_0x557d96[_0xb22f('0x37')]=qs[_0xb22f('0x2e')](_['pick'](_0x5d86a1['query'],_0x327200[_0xb22f('0x2e')]));if(_0x5d86a1[_0xb22f('0x2d')][_0xb22f('0x38')]){_0x557d96['where']=_[_0xb22f('0x39')](_0x557d96[_0xb22f('0x37')],{'$or':_['map'](_0xf268f4,function(_0x4bf34d){if(_0x4bf34d[_0xb22f('0x2a')]!=='VIRTUAL'){var _0x234d17={};_0x234d17[_0x4bf34d['name']]={'$like':'%'+_0x5d86a1[_0xb22f('0x2d')][_0xb22f('0x38')]+'%'};return _0x234d17;}})});}_0x557d96=_[_0xb22f('0x39')]({},_0x557d96,_0x5d86a1['options']);var _0x2cf9f4={'where':_0x557d96[_0xb22f('0x37')]};return db[_0xb22f('0x28')]['count'](_0x2cf9f4)[_0xb22f('0x22')](function(_0x195985){_0xc7f33b[_0xb22f('0x1b')]=_0x195985;if(_0x5d86a1[_0xb22f('0x2d')][_0xb22f('0x3a')]){_0x557d96[_0xb22f('0x3b')]=[{'all':!![]}];}return db[_0xb22f('0x28')][_0xb22f('0x3c')](_0x557d96);})[_0xb22f('0x22')](function(_0x42e834){_0xc7f33b['rows']=_0x42e834;return _0xc7f33b;})[_0xb22f('0x22')](respondWithFilteredResult(_0x2f6b97,_0x557d96))[_0xb22f('0x3d')](handleError(_0x2f6b97,null));};exports['show']=function(_0x3e4c4a,_0x4be0de){var _0x58ba40={'raw':![],'where':{'id':_0x3e4c4a[_0xb22f('0x3e')]['id']}},_0x2ccbba={};_0x2ccbba[_0xb22f('0x2c')]=_[_0xb22f('0x3f')](db['Campaign'][_0xb22f('0x40')]);_0x2ccbba['query']=_[_0xb22f('0x3f')](_0x3e4c4a[_0xb22f('0x2d')]);_0x2ccbba[_0xb22f('0x2e')]=_[_0xb22f('0x2f')](_0x2ccbba[_0xb22f('0x2c')],_0x2ccbba[_0xb22f('0x2d')]);_0x58ba40['attributes']=_[_0xb22f('0x2f')](_0x2ccbba['model'],qs[_0xb22f('0x30')](_0x3e4c4a[_0xb22f('0x2d')]['fields']));_0x58ba40[_0xb22f('0x31')]=_0x58ba40[_0xb22f('0x31')]['length']?_0x58ba40['attributes']:_0x2ccbba[_0xb22f('0x2c')];if(_0x3e4c4a['query'][_0xb22f('0x3a')]){_0x58ba40[_0xb22f('0x3b')]=[{'all':!![]}];}_0x58ba40=_[_0xb22f('0x39')]({},_0x58ba40,_0x3e4c4a[_0xb22f('0x41')]);return db['Campaign'][_0xb22f('0x42')](_0x58ba40)[_0xb22f('0x22')](handleEntityNotFound(_0x4be0de,null))['then'](respondWithResult(_0x4be0de,null))[_0xb22f('0x3d')](handleError(_0x4be0de,null));};exports[_0xb22f('0x43')]=function(_0x411723,_0x291e0c){return db[_0xb22f('0x28')]['create'](_0x411723[_0xb22f('0x44')],{})['then'](function(_0x52141e){var _0x3fb0ac=_0x411723[_0xb22f('0x45')][_0xb22f('0x23')]({'plain':!![]});if(!_0x3fb0ac)throw new Error(_0xb22f('0x46'));if(_0x3fb0ac[_0xb22f('0x47')]==='user'){var _0x275ca5=_0x52141e['get']({'plain':!![]});var _0x2d9683='IvrCampaigns';return db[_0xb22f('0x48')][_0xb22f('0x42')]({'where':{'name':_0x2d9683,'userProfileId':_0x3fb0ac[_0xb22f('0x49')]},'raw':!![]})['then'](function(_0x299156){if(_0x299156&&_0x299156[_0xb22f('0x4a')]===0x0){return db['UserProfileResource'][_0xb22f('0x43')]({'name':_0x275ca5[_0xb22f('0x26')],'resourceId':_0x275ca5['id'],'type':_0x299156['name'],'sectionId':_0x299156['id']},{})['then'](function(){return _0x52141e;});}else{return _0x52141e;}})[_0xb22f('0x3d')](function(_0x1a847d){logger['error'](_0xb22f('0x4b'),_0x1a847d);throw _0x1a847d;});}return _0x52141e;})[_0xb22f('0x22')](respondWithResult(_0x291e0c,0xc9))['catch'](handleError(_0x291e0c,null));};exports['clone']=function(_0x36684a,_0x3759ef){var _0x4c18d3={'where':{'id':_0x36684a[_0xb22f('0x3e')]['id']}},_0x13ac40={};_0x13ac40[_0xb22f('0x2c')]=_[_0xb22f('0x3f')](db['Campaign'][_0xb22f('0x40')]);_0x4c18d3[_0xb22f('0x31')]=_['intersection'](_0x13ac40['model'],qs[_0xb22f('0x30')](_0x36684a[_0xb22f('0x2d')][_0xb22f('0x30')]));_0x4c18d3[_0xb22f('0x31')]=_0x4c18d3['attributes'][_0xb22f('0x32')]?_0x4c18d3[_0xb22f('0x31')]:_0x13ac40['model'];if(_0x36684a[_0xb22f('0x2d')][_0xb22f('0x3a')]){_0x4c18d3[_0xb22f('0x3b')]=[{'all':!![]}];}_0x4c18d3=_[_0xb22f('0x39')]({},_0x4c18d3,_0x36684a[_0xb22f('0x41')]);return db[_0xb22f('0x28')][_0xb22f('0x42')](_0x4c18d3)['then'](handleEntityNotFound(_0x3759ef,null))[_0xb22f('0x22')](function(_0x14637f){if(_0x14637f){var _0x34e2d4=_0x14637f[_0xb22f('0x23')]({'plain':!![]});_0x34e2d4=qs[_0xb22f('0x4c')](_0x34e2d4,['id','createdAt','updatedAt']);_0x36684a[_0xb22f('0x44')]=_[_0xb22f('0x4c')](_0x36684a[_0xb22f('0x44')],['id','createdAt',_0xb22f('0x4d')]);return db[_0xb22f('0x28')][_0xb22f('0x43')](_[_0xb22f('0x39')](_0x34e2d4,_0x36684a[_0xb22f('0x44')]),{'include':_0x36684a[_0xb22f('0x2d')][_0xb22f('0x3a')]?[{'all':!![]}]:undefined})[_0xb22f('0x22')](function(_0x5bbdf6){var _0x552624=_0x36684a[_0xb22f('0x45')][_0xb22f('0x23')]({'plain':!![]});if(!_0x552624)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x552624['role']===_0xb22f('0x45')){var _0x137761=_0x5bbdf6['get']({'plain':!![]});var _0x5796ea=_0xb22f('0x4e');return db['UserProfileSection'][_0xb22f('0x42')]({'where':{'name':_0x5796ea,'userProfileId':_0x552624[_0xb22f('0x49')]},'raw':!![]})[_0xb22f('0x22')](function(_0x50e874){if(_0x50e874&&_0x50e874['autoAssociation']===0x0){return db[_0xb22f('0x4f')]['create']({'name':_0x137761[_0xb22f('0x26')],'resourceId':_0x137761['id'],'type':_0x50e874[_0xb22f('0x26')],'sectionId':_0x50e874['id']},{})[_0xb22f('0x22')](function(){return _0x5bbdf6;});}else{return _0x5bbdf6;}})['catch'](function(_0x55fdf1){logger[_0xb22f('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55fdf1);throw _0x55fdf1;});}return _0x5bbdf6;});}})[_0xb22f('0x22')](respondWithResult(_0x3759ef,0xc9))[_0xb22f('0x3d')](handleError(_0x3759ef,null));};exports[_0xb22f('0x20')]=function(_0x4d5074,_0x4464bd){if(_0x4d5074['body']['id']){delete _0x4d5074[_0xb22f('0x44')]['id'];}return db[_0xb22f('0x28')][_0xb22f('0x42')]({'where':{'id':_0x4d5074[_0xb22f('0x3e')]['id']}})[_0xb22f('0x22')](handleEntityNotFound(_0x4464bd,null))[_0xb22f('0x22')](saveUpdates(_0x4d5074[_0xb22f('0x44')],null))[_0xb22f('0x22')](respondWithResult(_0x4464bd,null))[_0xb22f('0x3d')](handleError(_0x4464bd,null));};exports['destroy']=function(_0x631832,_0x1487e7){return db[_0xb22f('0x28')]['find']({'where':{'id':_0x631832[_0xb22f('0x3e')]['id']}})[_0xb22f('0x22')](handleEntityNotFound(_0x1487e7,null))[_0xb22f('0x22')](removeEntity(_0x1487e7,null))[_0xb22f('0x3d')](handleError(_0x1487e7,null));};exports['getHoppers']=function(_0x4c79d6,_0x169215,_0x5e4fc0){var _0x51ef42={'raw':!![],'where':{}};var _0x43d850={};var _0x3a8183={'count':0x0,'rows':[]};return db[_0xb22f('0x28')][_0xb22f('0x50')]({'where':{'id':_0x4c79d6[_0xb22f('0x3e')]['id']}})[_0xb22f('0x22')](handleEntityNotFound(_0x169215,null))[_0xb22f('0x22')](function(_0x3a0746){if(_0x3a0746){_0x43d850[_0xb22f('0x2c')]=_[_0xb22f('0x3f')](db[_0xb22f('0x51')][_0xb22f('0x40')]);_0x43d850['query']=_[_0xb22f('0x3f')](_0x4c79d6[_0xb22f('0x2d')]);_0x43d850[_0xb22f('0x2e')]=_[_0xb22f('0x2f')](_0x43d850[_0xb22f('0x2c')],_0x43d850[_0xb22f('0x2d')]);_0x51ef42[_0xb22f('0x31')]=_[_0xb22f('0x2f')](_0x43d850[_0xb22f('0x2c')],qs[_0xb22f('0x30')](_0x4c79d6[_0xb22f('0x2d')][_0xb22f('0x30')]));_0x51ef42['attributes']=_0x51ef42['attributes']['length']?_0x51ef42[_0xb22f('0x31')]:_0x43d850[_0xb22f('0x2c')];if(!_0x4c79d6['query'][_0xb22f('0x33')](_0xb22f('0x52'))){_0x51ef42['limit']=qs[_0xb22f('0x34')](_0x4c79d6[_0xb22f('0x2d')][_0xb22f('0x34')]);_0x51ef42[_0xb22f('0x1c')]=qs[_0xb22f('0x1c')](_0x4c79d6['query']['offset']);}_0x51ef42['order']=qs[_0xb22f('0x36')](_0x4c79d6[_0xb22f('0x2d')][_0xb22f('0x36')]);_0x51ef42['where']=qs[_0xb22f('0x2e')](_[_0xb22f('0x53')](_0x4c79d6['query'],_0x43d850[_0xb22f('0x2e')]));_0x51ef42[_0xb22f('0x37')][_0xb22f('0x54')]=_0x3a0746['id'];if(_0x4c79d6[_0xb22f('0x2d')][_0xb22f('0x38')]){_0x51ef42[_0xb22f('0x37')]=_[_0xb22f('0x39')](_0x51ef42[_0xb22f('0x37')],{'$or':_[_0xb22f('0x27')](_0x51ef42[_0xb22f('0x31')],function(_0x4bed6e){var _0x47055d={};_0x47055d[_0x4bed6e]={'$like':'%'+_0x4c79d6[_0xb22f('0x2d')][_0xb22f('0x38')]+'%'};return _0x47055d;})});}_0x51ef42=_[_0xb22f('0x39')]({},_0x51ef42,_0x4c79d6[_0xb22f('0x41')]);return db[_0xb22f('0x51')][_0xb22f('0x1b')]({'where':_0x51ef42['where']})[_0xb22f('0x22')](function(_0x42d790){_0x3a8183[_0xb22f('0x1b')]=_0x42d790;if(_0x4c79d6[_0xb22f('0x2d')][_0xb22f('0x3a')]){_0x51ef42[_0xb22f('0x3b')]=[{'all':!![]}];}return db['CmHopper'][_0xb22f('0x3c')](_0x51ef42);})[_0xb22f('0x22')](function(_0x5edfc7){_0x3a8183[_0xb22f('0x55')]=_0x5edfc7;return _0x3a8183;});}})['then'](respondWithFilteredResult(_0x169215,_0x51ef42))['catch'](handleError(_0x169215,null));};exports['getHopperHistories']=function(_0x317c49,_0x5e5f4f,_0x27c739){var _0x4e7756={'raw':!![],'where':{}};var _0x4a7dc8={};var _0x348981={'count':0x0,'rows':[]};return db[_0xb22f('0x28')]['findOne']({'where':{'id':_0x317c49['params']['id']}})[_0xb22f('0x22')](handleEntityNotFound(_0x5e5f4f,null))[_0xb22f('0x22')](function(_0x5534ec){if(_0x5534ec){_0x4a7dc8[_0xb22f('0x2c')]=_['keys'](db['CmHopperHistory'][_0xb22f('0x40')]);_0x4a7dc8[_0xb22f('0x2d')]=_[_0xb22f('0x3f')](_0x317c49['query']);_0x4a7dc8['filters']=_['intersection'](_0x4a7dc8[_0xb22f('0x2c')],_0x4a7dc8[_0xb22f('0x2d')]);_0x4e7756[_0xb22f('0x31')]=_[_0xb22f('0x2f')](_0x4a7dc8['model'],qs[_0xb22f('0x30')](_0x317c49[_0xb22f('0x2d')][_0xb22f('0x30')]));_0x4e7756[_0xb22f('0x31')]=_0x4e7756[_0xb22f('0x31')]['length']?_0x4e7756[_0xb22f('0x31')]:_0x4a7dc8['model'];if(!_0x317c49['query'][_0xb22f('0x33')](_0xb22f('0x52'))){_0x4e7756[_0xb22f('0x34')]=qs['limit'](_0x317c49[_0xb22f('0x2d')][_0xb22f('0x34')]);_0x4e7756[_0xb22f('0x1c')]=qs[_0xb22f('0x1c')](_0x317c49[_0xb22f('0x2d')][_0xb22f('0x1c')]);}_0x4e7756[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x317c49[_0xb22f('0x2d')][_0xb22f('0x36')]);_0x4e7756[_0xb22f('0x37')]=qs['filters'](_['pick'](_0x317c49[_0xb22f('0x2d')],_0x4a7dc8[_0xb22f('0x2e')]));_0x4e7756['where'][_0xb22f('0x54')]=_0x5534ec['id'];if(_0x317c49[_0xb22f('0x2d')][_0xb22f('0x38')]){_0x4e7756[_0xb22f('0x37')]=_[_0xb22f('0x39')](_0x4e7756[_0xb22f('0x37')],{'$or':_[_0xb22f('0x27')](_0x4e7756[_0xb22f('0x31')],function(_0x506eba){var _0x4aea79={};_0x4aea79[_0x506eba]={'$like':'%'+_0x317c49[_0xb22f('0x2d')][_0xb22f('0x38')]+'%'};return _0x4aea79;})});}_0x4e7756=_['merge']({},_0x4e7756,_0x317c49[_0xb22f('0x41')]);return db[_0xb22f('0x56')][_0xb22f('0x1b')]({'where':_0x4e7756['where']})[_0xb22f('0x22')](function(_0x5deddf){_0x348981[_0xb22f('0x1b')]=_0x5deddf;if(_0x317c49[_0xb22f('0x2d')][_0xb22f('0x3a')]){_0x4e7756[_0xb22f('0x3b')]=[{'all':!![]}];}return db[_0xb22f('0x56')][_0xb22f('0x3c')](_0x4e7756);})[_0xb22f('0x22')](function(_0xaffc3){_0x348981[_0xb22f('0x55')]=_0xaffc3;return _0x348981;});}})['then'](respondWithFilteredResult(_0x5e5f4f,_0x4e7756))[_0xb22f('0x3d')](handleError(_0x5e5f4f,null));};exports[_0xb22f('0x57')]=function(_0x2007ca,_0x58e63c,_0x457132){var _0x5b122e={'raw':!![],'where':{}};var _0x5e4cec={};var _0x4a5ab1={'count':0x0,'rows':[]};return db[_0xb22f('0x28')][_0xb22f('0x50')]({'where':{'id':_0x2007ca[_0xb22f('0x3e')]['id']}})[_0xb22f('0x22')](handleEntityNotFound(_0x58e63c,null))[_0xb22f('0x22')](function(_0x18208a){if(_0x18208a){_0x5e4cec[_0xb22f('0x2c')]=_['keys'](db[_0xb22f('0x58')][_0xb22f('0x40')]);_0x5e4cec[_0xb22f('0x2d')]=_[_0xb22f('0x3f')](_0x2007ca[_0xb22f('0x2d')]);_0x5e4cec[_0xb22f('0x2e')]=_[_0xb22f('0x2f')](_0x5e4cec[_0xb22f('0x2c')],_0x5e4cec['query']);_0x5b122e[_0xb22f('0x31')]=_[_0xb22f('0x2f')](_0x5e4cec[_0xb22f('0x2c')],qs[_0xb22f('0x30')](_0x2007ca[_0xb22f('0x2d')][_0xb22f('0x30')]));_0x5b122e[_0xb22f('0x31')]=_0x5b122e[_0xb22f('0x31')][_0xb22f('0x32')]?_0x5b122e[_0xb22f('0x31')]:_0x5e4cec[_0xb22f('0x2c')];if(!_0x2007ca['query'][_0xb22f('0x33')]('nolimit')){_0x5b122e[_0xb22f('0x34')]=qs[_0xb22f('0x34')](_0x2007ca['query']['limit']);_0x5b122e[_0xb22f('0x1c')]=qs[_0xb22f('0x1c')](_0x2007ca[_0xb22f('0x2d')][_0xb22f('0x1c')]);}_0x5b122e[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x2007ca['query'][_0xb22f('0x36')]);_0x5b122e['where']=qs[_0xb22f('0x2e')](_['pick'](_0x2007ca['query'],_0x5e4cec[_0xb22f('0x2e')]));_0x5b122e['where'][_0xb22f('0x54')]=_0x18208a['id'];if(_0x2007ca[_0xb22f('0x2d')][_0xb22f('0x38')]){_0x5b122e['where']=_[_0xb22f('0x39')](_0x5b122e[_0xb22f('0x37')],{'$or':_[_0xb22f('0x27')](_0x5b122e[_0xb22f('0x31')],function(_0x540013){var _0x3f9f4a={};_0x3f9f4a[_0x540013]={'$like':'%'+_0x2007ca[_0xb22f('0x2d')]['filter']+'%'};return _0x3f9f4a;})});}_0x5b122e=_['merge']({},_0x5b122e,_0x2007ca[_0xb22f('0x41')]);return db[_0xb22f('0x58')]['count']({'where':_0x5b122e['where']})[_0xb22f('0x22')](function(_0x2c5799){_0x4a5ab1[_0xb22f('0x1b')]=_0x2c5799;if(_0x2007ca[_0xb22f('0x2d')]['includeAll']){_0x5b122e[_0xb22f('0x3b')]=[{'all':!![]}];}return db[_0xb22f('0x58')][_0xb22f('0x3c')](_0x5b122e);})[_0xb22f('0x22')](function(_0x4c8219){_0x4a5ab1[_0xb22f('0x55')]=_0x4c8219;return _0x4a5ab1;});}})['then'](respondWithFilteredResult(_0x58e63c,_0x5b122e))[_0xb22f('0x3d')](handleError(_0x58e63c,null));};exports['getHopperBlacks']=function(_0x5ce15b,_0x1b1953,_0x4a1e18){var _0x1f1e62={'raw':!![],'where':{}};var _0x29f553={};var _0xe3a900={'count':0x0,'rows':[]};return db[_0xb22f('0x28')]['findOne']({'where':{'id':_0x5ce15b[_0xb22f('0x3e')]['id']}})[_0xb22f('0x22')](handleEntityNotFound(_0x1b1953,null))[_0xb22f('0x22')](function(_0x137947){if(_0x137947){_0x29f553[_0xb22f('0x2c')]=_[_0xb22f('0x3f')](db[_0xb22f('0x59')]['rawAttributes']);_0x29f553['query']=_[_0xb22f('0x3f')](_0x5ce15b['query']);_0x29f553[_0xb22f('0x2e')]=_[_0xb22f('0x2f')](_0x29f553[_0xb22f('0x2c')],_0x29f553[_0xb22f('0x2d')]);_0x1f1e62[_0xb22f('0x31')]=_[_0xb22f('0x2f')](_0x29f553['model'],qs[_0xb22f('0x30')](_0x5ce15b[_0xb22f('0x2d')][_0xb22f('0x30')]));_0x1f1e62['attributes']=_0x1f1e62['attributes'][_0xb22f('0x32')]?_0x1f1e62['attributes']:_0x29f553['model'];if(!_0x5ce15b[_0xb22f('0x2d')][_0xb22f('0x33')](_0xb22f('0x52'))){_0x1f1e62['limit']=qs['limit'](_0x5ce15b[_0xb22f('0x2d')][_0xb22f('0x34')]);_0x1f1e62['offset']=qs['offset'](_0x5ce15b['query'][_0xb22f('0x1c')]);}_0x1f1e62[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x5ce15b[_0xb22f('0x2d')]['sort']);_0x1f1e62[_0xb22f('0x37')]=qs['filters'](_[_0xb22f('0x53')](_0x5ce15b[_0xb22f('0x2d')],_0x29f553[_0xb22f('0x2e')]));_0x1f1e62[_0xb22f('0x37')][_0xb22f('0x54')]=_0x137947['id'];if(_0x5ce15b['query']['filter']){_0x1f1e62[_0xb22f('0x37')]=_[_0xb22f('0x39')](_0x1f1e62[_0xb22f('0x37')],{'$or':_[_0xb22f('0x27')](_0x1f1e62['attributes'],function(_0x3f3bbb){var _0x30f6d4={};_0x30f6d4[_0x3f3bbb]={'$like':'%'+_0x5ce15b[_0xb22f('0x2d')][_0xb22f('0x38')]+'%'};return _0x30f6d4;})});}_0x1f1e62=_[_0xb22f('0x39')]({},_0x1f1e62,_0x5ce15b['options']);return db['CmHopperBlack']['count']({'where':_0x1f1e62[_0xb22f('0x37')]})[_0xb22f('0x22')](function(_0x199cfd){_0xe3a900['count']=_0x199cfd;if(_0x5ce15b[_0xb22f('0x2d')][_0xb22f('0x3a')]){_0x1f1e62[_0xb22f('0x3b')]=[{'all':!![]}];}return db[_0xb22f('0x59')][_0xb22f('0x3c')](_0x1f1e62);})[_0xb22f('0x22')](function(_0x41e957){_0xe3a900['rows']=_0x41e957;return _0xe3a900;});}})['then'](respondWithFilteredResult(_0x1b1953,_0x1f1e62))['catch'](handleError(_0x1b1953,null));};exports[_0xb22f('0x5a')]=function(_0x27749d,_0x540552,_0x602c26){var _0x402c9c={};var _0x77ec4={};var _0x3d9475;var _0x4b3963;return db[_0xb22f('0x28')][_0xb22f('0x50')]({'where':{'id':_0x27749d['params']['id']}})[_0xb22f('0x22')](handleEntityNotFound(_0x540552,null))[_0xb22f('0x22')](function(_0x38f1b6){if(_0x38f1b6){_0x3d9475=_0x38f1b6;_0x77ec4[_0xb22f('0x2c')]=_[_0xb22f('0x3f')](db[_0xb22f('0x5b')][_0xb22f('0x40')]);_0x77ec4['query']=_[_0xb22f('0x3f')](_0x27749d['query']);_0x77ec4[_0xb22f('0x2e')]=_[_0xb22f('0x2f')](_0x77ec4[_0xb22f('0x2c')],_0x77ec4[_0xb22f('0x2d')]);_0x402c9c[_0xb22f('0x31')]=_[_0xb22f('0x2f')](_0x77ec4[_0xb22f('0x2c')],qs[_0xb22f('0x30')](_0x27749d['query'][_0xb22f('0x30')]));_0x402c9c[_0xb22f('0x31')]=_0x402c9c[_0xb22f('0x31')][_0xb22f('0x32')]?_0x402c9c['attributes']:_0x77ec4[_0xb22f('0x2c')];_0x402c9c[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x27749d[_0xb22f('0x2d')][_0xb22f('0x36')]);_0x402c9c[_0xb22f('0x37')]=qs['filters'](_['pick'](_0x27749d[_0xb22f('0x2d')],_0x77ec4[_0xb22f('0x2e')]));if(_0x27749d[_0xb22f('0x2d')]['filter']){_0x402c9c['where']=_[_0xb22f('0x39')](_0x402c9c[_0xb22f('0x37')],{'$or':_[_0xb22f('0x27')](_0x402c9c['attributes'],function(_0x5aa68f){var _0x17daa7={};_0x17daa7[_0x5aa68f]={'$like':'%'+_0x27749d[_0xb22f('0x2d')][_0xb22f('0x38')]+'%'};return _0x17daa7;})});}_0x402c9c=_[_0xb22f('0x39')]({},_0x402c9c,_0x27749d[_0xb22f('0x41')]);return _0x3d9475['getLists'](_0x402c9c);}})['then'](function(_0x2d5848){if(_0x2d5848){_0x4b3963=_0x2d5848[_0xb22f('0x32')];if(!_0x27749d[_0xb22f('0x2d')][_0xb22f('0x33')]('nolimit')){_0x402c9c[_0xb22f('0x34')]=qs[_0xb22f('0x34')](_0x27749d[_0xb22f('0x2d')][_0xb22f('0x34')]);_0x402c9c[_0xb22f('0x1c')]=qs['offset'](_0x27749d['query']['offset']);}return _0x3d9475[_0xb22f('0x5a')](_0x402c9c);}})[_0xb22f('0x22')](function(_0x39416e){if(_0x39416e){return _0x39416e?{'count':_0x4b3963,'rows':_0x39416e}:null;}})[_0xb22f('0x22')](respondWithResult(_0x540552,null))[_0xb22f('0x3d')](handleError(_0x540552,null));};exports[_0xb22f('0x5c')]=function(_0x2b521f,_0x583d54,_0x2f233c){var _0x1a6d37,_0x3e4ec0;return db[_0xb22f('0x28')][_0xb22f('0x42')]({'where':{'id':_0x2b521f['params']['id']}})[_0xb22f('0x22')](handleEntityNotFound(_0x583d54,null))['then'](function(_0x37a1bc){if(_0x37a1bc){_0x3e4ec0=_0x37a1bc;return _0x37a1bc[_0xb22f('0x5c')](_0x2b521f[_0xb22f('0x44')][_0xb22f('0x5d')],_[_0xb22f('0x4c')](_0x2b521f[_0xb22f('0x44')],['ids','id'])||{});}return null;})[_0xb22f('0x5e')](function(_0x532056){var _0x587118;_0x1a6d37=_0x532056||[];var _0x576d72=[];if(_0x532056){for(var _0x127ad6=0x0;_0x127ad6<_0x532056[_0xb22f('0x32')];_0x127ad6+=0x1){var _0x439da5=_0x532056[_0x127ad6][_0xb22f('0x23')]({'plain':!![]});_0x3e4ec0[_0xb22f('0x5f')]=_0x2b521f[_0xb22f('0x44')][_0xb22f('0x5f')]?_0x2b521f[_0xb22f('0x44')][_0xb22f('0x5f')]:_0x3e4ec0[_0xb22f('0x5f')];switch(_0x3e4ec0[_0xb22f('0x5f')]){case'always':_0x587118=squel[_0xb22f('0x60')]()[_0xb22f('0x61')](_0xb22f('0x62'))[_0xb22f('0x63')](['phone',_0xb22f('0x64'),_0xb22f('0x65'),_0xb22f('0x66'),_0xb22f('0x54'),_0xb22f('0x67'),_0xb22f('0x4d')],squel['select']()[_0xb22f('0x68')](_0xb22f('0x69'),_0xb22f('0x69'))[_0xb22f('0x68')](_0xb22f('0x6a'),_0xb22f('0x64'))[_0xb22f('0x68')]('id',_0xb22f('0x65'))[_0xb22f('0x68')](_0x439da5[_0xb22f('0x6b')][_0xb22f('0x6c')](),_0xb22f('0x66'))[_0xb22f('0x68')](_0x2b521f[_0xb22f('0x3e')]['id'][_0xb22f('0x6c')](),_0xb22f('0x54'))[_0xb22f('0x68')](_0xb22f('0x6a'),_0xb22f('0x67'))[_0xb22f('0x68')](_0xb22f('0x6a'),_0xb22f('0x4d'))[_0xb22f('0x6d')](_0xb22f('0x6e'))[_0xb22f('0x37')](_0xb22f('0x6f'))[_0xb22f('0x37')](_0xb22f('0x70'),_0x439da5[_0xb22f('0x6b')]['toString']())[_0xb22f('0x37')](_0xb22f('0x71'))[_0xb22f('0x37')](_0xb22f('0x72'),squel[_0xb22f('0x73')]()[_0xb22f('0x68')](_0xb22f('0x74'))[_0xb22f('0x6d')]('cm_hopper_final')[_0xb22f('0x37')](_0xb22f('0x75'),_0x2b521f['params']['id'][_0xb22f('0x6c')]()))[_0xb22f('0x37')](_0xb22f('0x72'),squel[_0xb22f('0x73')]()[_0xb22f('0x68')](_0xb22f('0x76'))[_0xb22f('0x6d')](_0xb22f('0x62'))[_0xb22f('0x37')](_0xb22f('0x75'),_0x2b521f[_0xb22f('0x3e')]['id'][_0xb22f('0x6c')]())))[_0xb22f('0x6c')]();break;case _0xb22f('0x77'):_0x587118=squel[_0xb22f('0x60')]()[_0xb22f('0x61')](_0xb22f('0x62'))[_0xb22f('0x63')](['phone','scheduledAt','ContactId',_0xb22f('0x66'),'CampaignId','createdAt',_0xb22f('0x4d')],squel['select']()[_0xb22f('0x68')]('phone','phone')[_0xb22f('0x68')](_0xb22f('0x6a'),'scheduledAt')[_0xb22f('0x68')]('id','ContactId')[_0xb22f('0x68')](_0x439da5[_0xb22f('0x6b')][_0xb22f('0x6c')](),_0xb22f('0x66'))['field'](_0x2b521f[_0xb22f('0x3e')]['id'][_0xb22f('0x6c')](),_0xb22f('0x54'))['field']('NOW()',_0xb22f('0x67'))[_0xb22f('0x68')](_0xb22f('0x6a'),_0xb22f('0x4d'))['from'](_0xb22f('0x6e'))[_0xb22f('0x37')](_0xb22f('0x6f'))[_0xb22f('0x37')](_0xb22f('0x70'),_0x439da5['CmListId'][_0xb22f('0x6c')]())[_0xb22f('0x37')](_0xb22f('0x71'))[_0xb22f('0x37')](_0xb22f('0x72'),squel[_0xb22f('0x73')]()[_0xb22f('0x68')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xb22f('0x37')](_0xb22f('0x75'),_0x2b521f[_0xb22f('0x3e')]['id'][_0xb22f('0x6c')]())))[_0xb22f('0x6c')]();break;default:_0x587118=squel['insert']()[_0xb22f('0x61')](_0xb22f('0x62'))[_0xb22f('0x63')](['phone',_0xb22f('0x64'),_0xb22f('0x65'),_0xb22f('0x66'),_0xb22f('0x54'),_0xb22f('0x67'),_0xb22f('0x4d')],squel[_0xb22f('0x73')]()[_0xb22f('0x68')]('phone',_0xb22f('0x69'))[_0xb22f('0x68')]('NOW()',_0xb22f('0x64'))[_0xb22f('0x68')]('id',_0xb22f('0x65'))[_0xb22f('0x68')](_0x439da5[_0xb22f('0x6b')]['toString'](),_0xb22f('0x66'))[_0xb22f('0x68')](_0x2b521f['params']['id']['toString'](),_0xb22f('0x54'))[_0xb22f('0x68')](_0xb22f('0x6a'),_0xb22f('0x67'))[_0xb22f('0x68')]('NOW()',_0xb22f('0x4d'))[_0xb22f('0x6d')](_0xb22f('0x6e'))['where'](_0xb22f('0x6f'))[_0xb22f('0x37')](_0xb22f('0x70'),_0x439da5['CmListId'][_0xb22f('0x6c')]())[_0xb22f('0x37')](_0xb22f('0x71')))['toString']();}_0x576d72['push'](db[_0xb22f('0x78')][_0xb22f('0x2d')](_0x587118));}return BPromise[_0xb22f('0x79')](_0x576d72);}})['then'](function(){return _0x1a6d37;})[_0xb22f('0x22')](respondWithResult(_0x583d54,null))[_0xb22f('0x3d')](handleError(_0x583d54,null));};exports['removeLists']=function(_0x4fcb90,_0x51fba6,_0x294d03){return db['Campaign']['find']({'where':{'id':_0x4fcb90[_0xb22f('0x3e')]['id']}})[_0xb22f('0x22')](handleEntityNotFound(_0x51fba6,null))[_0xb22f('0x22')](function(_0x4faf29){if(_0x4faf29){return _0x4faf29['removeLists'](_0x4fcb90['query'][_0xb22f('0x5d')]);}})[_0xb22f('0x22')](function(_0x21dcb6){if(_0x21dcb6){return db[_0xb22f('0x51')]['destroy']({'where':{'ListId':_0x4fcb90[_0xb22f('0x2d')][_0xb22f('0x5d')],'CampaignId':_0x4fcb90[_0xb22f('0x3e')]['id']}})['then'](function(){return _0x21dcb6;});}})[_0xb22f('0x22')](respondWithStatusCode(_0x51fba6,null))[_0xb22f('0x3d')](handleError(_0x51fba6,null));};exports['getBlackLists']=function(_0x3558da,_0x37c7a5,_0x2fb6cd){var _0x34bb6f={'raw':!![],'where':{}};var _0x17acff={};var _0x260fb0={'count':0x0,'rows':[]};return db[_0xb22f('0x28')][_0xb22f('0x50')]({'where':{'id':_0x3558da[_0xb22f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x37c7a5,null))[_0xb22f('0x22')](function(_0x257010){if(_0x257010){_0x17acff[_0xb22f('0x2c')]=_[_0xb22f('0x3f')](db[_0xb22f('0x5b')][_0xb22f('0x40')]);_0x17acff[_0xb22f('0x2d')]=_[_0xb22f('0x3f')](_0x3558da[_0xb22f('0x2d')]);_0x17acff[_0xb22f('0x2e')]=_['intersection'](_0x17acff[_0xb22f('0x2c')],_0x17acff[_0xb22f('0x2d')]);_0x34bb6f[_0xb22f('0x31')]=_[_0xb22f('0x2f')](_0x17acff[_0xb22f('0x2c')],qs[_0xb22f('0x30')](_0x3558da[_0xb22f('0x2d')]['fields']));_0x34bb6f[_0xb22f('0x31')]=_0x34bb6f['attributes']['length']?_0x34bb6f[_0xb22f('0x31')]:_0x17acff[_0xb22f('0x2c')];if(!_0x3558da[_0xb22f('0x2d')][_0xb22f('0x33')](_0xb22f('0x52'))){_0x34bb6f[_0xb22f('0x34')]=qs[_0xb22f('0x34')](_0x3558da[_0xb22f('0x2d')][_0xb22f('0x34')]);_0x34bb6f[_0xb22f('0x1c')]=qs['offset'](_0x3558da[_0xb22f('0x2d')][_0xb22f('0x1c')]);}_0x34bb6f[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x3558da[_0xb22f('0x2d')][_0xb22f('0x36')]);_0x34bb6f[_0xb22f('0x37')]=qs[_0xb22f('0x2e')](_[_0xb22f('0x53')](_0x3558da[_0xb22f('0x2d')],_0x17acff[_0xb22f('0x2e')]));_0x34bb6f['where'][_0xb22f('0x54')]=_0x257010['id'];if(_0x3558da['query'][_0xb22f('0x38')]){_0x34bb6f[_0xb22f('0x37')]=_[_0xb22f('0x39')](_0x34bb6f['where'],{'$or':_['map'](_0x34bb6f[_0xb22f('0x31')],function(_0x2bae51){var _0x1cc6e3={};_0x1cc6e3[_0x2bae51]={'$like':'%'+_0x3558da[_0xb22f('0x2d')][_0xb22f('0x38')]+'%'};return _0x1cc6e3;})});}_0x34bb6f=_['merge']({},_0x34bb6f,_0x3558da['options']);return db[_0xb22f('0x5b')][_0xb22f('0x1b')]({'where':_0x34bb6f[_0xb22f('0x37')]})[_0xb22f('0x22')](function(_0x196eae){_0x260fb0[_0xb22f('0x1b')]=_0x196eae;if(_0x3558da[_0xb22f('0x2d')][_0xb22f('0x3a')]){_0x34bb6f[_0xb22f('0x3b')]=[{'all':!![]}];}return db[_0xb22f('0x5b')][_0xb22f('0x3c')](_0x34bb6f);})['then'](function(_0x413fc9){_0x260fb0[_0xb22f('0x55')]=_0x413fc9;return _0x260fb0;});}})[_0xb22f('0x22')](respondWithFilteredResult(_0x37c7a5,_0x34bb6f))[_0xb22f('0x3d')](handleError(_0x37c7a5,null));};exports[_0xb22f('0x7a')]=function(_0x566225,_0x307e55,_0x56a362){var _0xb64233,_0x5308a0;return db[_0xb22f('0x28')][_0xb22f('0x42')]({'where':{'id':_0x566225['params']['id']}})['then'](handleEntityNotFound(_0x307e55,null))['then'](function(_0x15cb82){if(_0x15cb82){_0x5308a0=_0x15cb82;return _0x15cb82['addBlackLists'](_0x566225['body'][_0xb22f('0x5d')],_[_0xb22f('0x4c')](_0x566225['body'],[_0xb22f('0x5d'),'id'])||{});}return null;})[_0xb22f('0x5e')](function(_0x45b259){var _0x1c526b;_0xb64233=_0x45b259||[];var _0xb114c4=[];if(_0x45b259){for(var _0x1a061c=0x0;_0x1a061c<_0x45b259[_0xb22f('0x32')];_0x1a061c+=0x1){var _0x4bc5f8=_0x45b259[_0x1a061c][_0xb22f('0x23')]({'plain':!![]});_0x1c526b=squel['insert']()[_0xb22f('0x61')]('cm_hopper_black')[_0xb22f('0x63')]([_0xb22f('0x69'),'ContactId',_0xb22f('0x66'),'CampaignId',_0xb22f('0x67'),_0xb22f('0x4d')],squel[_0xb22f('0x73')]()[_0xb22f('0x68')](_0xb22f('0x69'),_0xb22f('0x69'))[_0xb22f('0x68')]('id',_0xb22f('0x65'))[_0xb22f('0x68')](_0x4bc5f8[_0xb22f('0x6b')][_0xb22f('0x6c')](),_0xb22f('0x66'))[_0xb22f('0x68')](_0x566225['params']['id'][_0xb22f('0x6c')](),_0xb22f('0x54'))['field'](_0xb22f('0x6a'),_0xb22f('0x67'))[_0xb22f('0x68')]('NOW()',_0xb22f('0x4d'))[_0xb22f('0x6d')](_0xb22f('0x6e'))[_0xb22f('0x37')]('deletedAt\x20IS\x20NULL')[_0xb22f('0x37')](_0xb22f('0x70'),_0x4bc5f8[_0xb22f('0x6b')][_0xb22f('0x6c')]())[_0xb22f('0x37')]('phone\x20IS\x20NOT\x20NULL'))[_0xb22f('0x6c')]();_0xb114c4[_0xb22f('0x7b')](db[_0xb22f('0x78')][_0xb22f('0x2d')](_0x1c526b));}return BPromise[_0xb22f('0x79')](_0xb114c4);}})[_0xb22f('0x22')](function(){return _0xb64233;})[_0xb22f('0x22')](respondWithResult(_0x307e55,null))['catch'](handleError(_0x307e55,null));};exports[_0xb22f('0x7c')]=function(_0x470772,_0x4c3175,_0x30d337){return db[_0xb22f('0x28')][_0xb22f('0x42')]({'where':{'id':_0x470772[_0xb22f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4c3175,null))['then'](function(_0x28eb08){if(_0x28eb08){return _0x28eb08[_0xb22f('0x7c')](_0x470772[_0xb22f('0x2d')]['ids']);}})[_0xb22f('0x22')](function(_0x261877){if(_0x261877){return db[_0xb22f('0x59')][_0xb22f('0x21')]({'where':{'ListId':_0x470772[_0xb22f('0x2d')][_0xb22f('0x5d')],'CampaignId':_0x470772[_0xb22f('0x3e')]['id']}})[_0xb22f('0x22')](function(){return _0x261877;});}})[_0xb22f('0x22')](respondWithStatusCode(_0x4c3175,null))['catch'](handleError(_0x4c3175,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 69d2313..18ad0cb 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 _0x39cb=['rimraf','../../config/environment','./campaign.attributes','define','Campaign','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x39cb,0xe1));var _0xb39c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x39cb[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb39c('0x0'))('api');var moment=require(_0xb39c('0x1'));var BPromise=require(_0xb39c('0x2'));var rp=require(_0xb39c('0x3'));var fs=require('fs');var path=require(_0xb39c('0x4'));var rimraf=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var attributes=require(_0xb39c('0x7'));module['exports']=function(_0x5689c3,_0x4409a1){return _0x5689c3[_0xb39c('0x8')](_0xb39c('0x9'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x268d=['Campaign','campaigns','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x56970c,_0x9ce0f1){var _0x5b764c=function(_0x118339){while(--_0x118339){_0x56970c['push'](_0x56970c['shift']());}};_0x5b764c(++_0x9ce0f1);}(_0x268d,0x195));var _0xd268=function(_0x53f944,_0x4aad32){_0x53f944=_0x53f944-0x0;var _0x303d90=_0x268d[_0x53f944];return _0x303d90;};'use strict';var _=require(_0xd268('0x0'));var util=require(_0xd268('0x1'));var logger=require('../../config/logger')(_0xd268('0x2'));var moment=require(_0xd268('0x3'));var BPromise=require(_0xd268('0x4'));var rp=require(_0xd268('0x5'));var fs=require('fs');var path=require(_0xd268('0x6'));var rimraf=require(_0xd268('0x7'));var config=require(_0xd268('0x8'));var attributes=require('./campaign.attributes');module[_0xd268('0x9')]=function(_0x1e87c1,_0x9b8533){return _0x1e87c1[_0xd268('0xa')](_0xd268('0xb'),attributes,{'tableName':_0xd268('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 57e5ee0..703d1cc 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 _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(_0x2a1140,_0x103c82){var _0x3a595b=function(_0x8936a9){while(--_0x8936a9){_0x2a1140['push'](_0x2a1140['shift']());}};_0x3a595b(++_0x103c82);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 +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(_0x166758,_0x26f2ec){var _0x190126=function(_0x23b78a){while(--_0x23b78a){_0x166758['push'](_0x166758['shift']());}};_0x190126(++_0x26f2ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 5715d6d..04fa3fe 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 _0xfe74=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path'];(function(_0x3aec1e,_0x3be4a2){var _0x4df3d7=function(_0x4c92c6){while(--_0x4c92c6){_0x3aec1e['push'](_0x3aec1e['shift']());}};_0x4df3d7(++_0x3be4a2);}(_0xfe74,0xac));var _0x4fe7=function(_0x9ebea9,_0x46999e){_0x9ebea9=_0x9ebea9-0x0;var _0x3569eb=_0xfe74[_0x9ebea9];return _0x3569eb;};'use strict';var multer=require(_0x4fe7('0x0'));var util=require(_0x4fe7('0x1'));var path=require(_0x4fe7('0x2'));var timeout=require(_0x4fe7('0x3'));var express=require(_0x4fe7('0x4'));var router=express[_0x4fe7('0x5')]();var auth=require(_0x4fe7('0x6'));var interaction=require(_0x4fe7('0x7'));var config=require(_0x4fe7('0x8'));var controller=require('./campaign.controller');router[_0x4fe7('0x9')]('/',auth[_0x4fe7('0xa')](),controller[_0x4fe7('0xb')]);router['get'](_0x4fe7('0xc'),auth['isAuthenticated'](),controller[_0x4fe7('0xd')]);router[_0x4fe7('0x9')](_0x4fe7('0xe'),auth[_0x4fe7('0xa')](),controller[_0x4fe7('0xf')]);router[_0x4fe7('0x9')](_0x4fe7('0x10'),auth['isAuthenticated'](),controller[_0x4fe7('0x11')]);router[_0x4fe7('0x9')]('/:id/hopper_finals',auth[_0x4fe7('0xa')](),controller[_0x4fe7('0x12')]);router[_0x4fe7('0x9')]('/:id/hopper_black',auth[_0x4fe7('0xa')](),controller[_0x4fe7('0x13')]);router[_0x4fe7('0x9')](_0x4fe7('0x14'),auth[_0x4fe7('0xa')](),controller[_0x4fe7('0x15')]);router['get'](_0x4fe7('0x16'),auth[_0x4fe7('0xa')](),controller['getBlackLists']);router[_0x4fe7('0x17')]('/',auth[_0x4fe7('0xa')](),controller[_0x4fe7('0x18')]);router[_0x4fe7('0x17')](_0x4fe7('0x19'),auth[_0x4fe7('0xa')](),controller[_0x4fe7('0x1a')]);router[_0x4fe7('0x17')](_0x4fe7('0x14'),auth[_0x4fe7('0xa')](),controller[_0x4fe7('0x1b')]);router['post'](_0x4fe7('0x16'),auth[_0x4fe7('0xa')](),controller['addBlackLists']);router[_0x4fe7('0x1c')](_0x4fe7('0xc'),auth[_0x4fe7('0xa')](),controller[_0x4fe7('0x1d')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4fe7('0x1e')]);router[_0x4fe7('0x1f')](_0x4fe7('0x14'),auth[_0x4fe7('0xa')](),controller[_0x4fe7('0x20')]);router[_0x4fe7('0x1f')](_0x4fe7('0x16'),auth['isAuthenticated'](),controller[_0x4fe7('0x21')]);module[_0x4fe7('0x22')]=router; \ No newline at end of file +var _0xf99c=['/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','update','delete','destroy','removeLists','multer','util','path','connect-timeout','Router','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index'];(function(_0x5c1f07,_0x35d59e){var _0x22c4d3=function(_0x5ceac3){while(--_0x5ceac3){_0x5c1f07['push'](_0x5c1f07['shift']());}};_0x22c4d3(++_0x35d59e);}(_0xf99c,0x1b6));var _0xcf99=function(_0x28829b,_0x4bf06a){_0x28829b=_0x28829b-0x0;var _0x29eb77=_0xf99c[_0x28829b];return _0x29eb77;};'use strict';var multer=require(_0xcf99('0x0'));var util=require(_0xcf99('0x1'));var path=require(_0xcf99('0x2'));var timeout=require(_0xcf99('0x3'));var express=require('express');var router=express[_0xcf99('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xcf99('0x5'));var config=require('../../config/environment');var controller=require(_0xcf99('0x6'));router[_0xcf99('0x7')]('/',auth[_0xcf99('0x8')](),controller[_0xcf99('0x9')]);router[_0xcf99('0x7')](_0xcf99('0xa'),auth[_0xcf99('0x8')](),controller[_0xcf99('0xb')]);router[_0xcf99('0x7')](_0xcf99('0xc'),auth[_0xcf99('0x8')](),controller[_0xcf99('0xd')]);router[_0xcf99('0x7')](_0xcf99('0xe'),auth[_0xcf99('0x8')](),controller[_0xcf99('0xf')]);router[_0xcf99('0x7')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xcf99('0x10')]);router[_0xcf99('0x7')](_0xcf99('0x11'),auth[_0xcf99('0x8')](),controller[_0xcf99('0x12')]);router[_0xcf99('0x7')](_0xcf99('0x13'),auth[_0xcf99('0x8')](),controller['getLists']);router[_0xcf99('0x7')](_0xcf99('0x14'),auth[_0xcf99('0x8')](),controller[_0xcf99('0x15')]);router[_0xcf99('0x16')]('/',auth[_0xcf99('0x8')](),controller[_0xcf99('0x17')]);router[_0xcf99('0x16')](_0xcf99('0x18'),auth[_0xcf99('0x8')](),controller[_0xcf99('0x19')]);router[_0xcf99('0x16')](_0xcf99('0x13'),auth['isAuthenticated'](),controller[_0xcf99('0x1a')]);router[_0xcf99('0x16')](_0xcf99('0x14'),auth[_0xcf99('0x8')](),controller['addBlackLists']);router[_0xcf99('0x1b')](_0xcf99('0xa'),auth[_0xcf99('0x8')](),controller[_0xcf99('0x1c')]);router[_0xcf99('0x1d')](_0xcf99('0xa'),auth[_0xcf99('0x8')](),controller[_0xcf99('0x1e')]);router[_0xcf99('0x1d')](_0xcf99('0x13'),auth[_0xcf99('0x8')](),controller[_0xcf99('0x1f')]);router[_0xcf99('0x1d')](_0xcf99('0x14'),auth['isAuthenticated'](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index c6f2200..1bcdf1e 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 _0xdae6=['TEXT','STRING','getDataValue','sequelize','exports'];(function(_0x15e0d2,_0x8333c){var _0x45bb73=function(_0x52cb41){while(--_0x52cb41){_0x15e0d2['push'](_0x15e0d2['shift']());}};_0x45bb73(++_0x8333c);}(_0xdae6,0x1bb));var _0x6dae=function(_0x1fb097,_0x19f541){_0x1fb097=_0x1fb097-0x0;var _0x294e82=_0xdae6[_0x1fb097];return _0x294e82;};'use strict';var Sequelize=require(_0x6dae('0x0'));module[_0x6dae('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6dae('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6dae('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x6dae('0x4')]('key');}}}; \ No newline at end of file +var _0x8f42=['STRING','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x11ba32,_0x5a7ba6){var _0x296558=function(_0x53d575){while(--_0x53d575){_0x11ba32['push'](_0x11ba32['shift']());}};_0x296558(++_0x5a7ba6);}(_0x8f42,0x8e));var _0x28f4=function(_0x53fa23,_0x5c6cb6){_0x53fa23=_0x53fa23-0x0;var _0x31b974=_0x8f42[_0x53fa23];return _0x31b974;};'use strict';var Sequelize=require(_0x28f4('0x0'));module[_0x28f4('0x1')]={'key':{'type':Sequelize[_0x28f4('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x28f4('0x3')],'get':function(){return this[_0x28f4('0x4')](_0x28f4('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index fddaa89..4fcae74 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(_0xb5b14f,_0x331292){var _0x35ff24=function(_0x55c726){while(--_0x55c726){_0xb5b14f['push'](_0xb5b14f['shift']());}};_0x35ff24(++_0x331292);}(_0x34e8,0x12c));var _0x834e=function(_0x1ad4a6,_0x30a581){_0x1ad4a6=_0x1ad4a6-0x0;var _0x31e217=_0x34e8[_0x1ad4a6];return _0x31e217;};'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 _0x9957=['limit','set','Content-Range','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','CannedAnswer','count','include','catch','show','params','keys','length','includeAll','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','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'];(function(_0x4eb02e,_0x2011ce){var _0x582c29=function(_0x41b4b5){while(--_0x41b4b5){_0x4eb02e['push'](_0x4eb02e['shift']());}};_0x582c29(++_0x2011ce);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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(){var _0x32a09a=_0x460924[_0x7995('0x26')]({'plain':!![]});var _0x204507=_0x7995('0x27');return db[_0x7995('0x28')][_0x7995('0x25')]({'where':{'type':_0x204507,'resourceId':_0x32a09a['id']}})[_0x7995('0x24')](function(){return _0x460924;});})[_0x7995('0x24')](function(){_0x350fd9['status'](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1a')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x29')]);if(_0x47625f[_0x7995('0x2a')]){delete _0x47625f[_0x7995('0x2a')];}_0x2a307e[_0x7995('0x1b')](_0x56691a)[_0x7995('0x2b')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['CannedAnswer'][_0x7995('0x2c')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2d')],'type':_0xe6b0b3[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x3250e0[_0x7995('0x30')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x31')]=_['keys'](_0x9b2a15[_0x7995('0x31')]);_0x3250e0[_0x7995('0x32')]=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],_0x3250e0[_0x7995('0x31')]);_0x456a28['attributes']=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x34')]=_0x456a28[_0x7995('0x34')]['length']?_0x456a28[_0x7995('0x34')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x31')][_0x7995('0x35')](_0x7995('0x36'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x31')]['limit']);_0x456a28['offset']=qs[_0x7995('0x1e')](_0x9b2a15[_0x7995('0x31')]['offset']);}_0x456a28[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x9b2a15[_0x7995('0x31')][_0x7995('0x38')]);_0x456a28[_0x7995('0x39')]=qs['filters'](_[_0x7995('0x3a')](_0x9b2a15[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]));if(_0x9b2a15[_0x7995('0x31')]['filter']){_0x456a28[_0x7995('0x39')]=_[_0x7995('0x3b')](_0x456a28[_0x7995('0x39')],{'$or':_[_0x7995('0x3c')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2e')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2a')]]={'$like':'%'+_0x9b2a15[_0x7995('0x31')][_0x7995('0x3d')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3b')]({},_0x456a28,_0x9b2a15[_0x7995('0x3e')]);var _0x14d638={'where':_0x456a28[_0x7995('0x39')]};return db[_0x7995('0x3f')][_0x7995('0x40')](_0x14d638)[_0x7995('0x24')](function(_0x270d52){_0x4253e5[_0x7995('0x40')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x3f')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x42')](handleError(_0x514445,null));};exports[_0x7995('0x43')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':!![],'where':{'id':_0x35c8ff[_0x7995('0x44')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x3f')][_0x7995('0x2c')]);_0x5e85b9[_0x7995('0x31')]=_[_0x7995('0x45')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x33')](_0x5e85b9[_0x7995('0x30')],_0x5e85b9[_0x7995('0x31')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x30')],qs['fields'](_0x35c8ff[_0x7995('0x31')]['fields']));_0x46ac4f[_0x7995('0x34')]=_0x46ac4f['attributes'][_0x7995('0x46')]?_0x46ac4f[_0x7995('0x34')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x31')][_0x7995('0x47')]){_0x46ac4f[_0x7995('0x41')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3b')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x3f')][_0x7995('0x48')](_0x46ac4f)[_0x7995('0x24')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x42')](handleError(_0x576b96,null));};exports[_0x7995('0x49')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x4a')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x4a')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x42')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3f')]['find']({'where':{'id':_0xddf537[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x4b')]=function(_0x1fe77e,_0x12d4b8){var _0x47d1d8={'key':_0x1fe77e['body']['key']};if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')]){_0x47d1d8['MailAccountId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')];}else if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4d')]){_0x47d1d8[_0x7995('0x4d')]=_0x1fe77e['body'][_0x7995('0x4d')];}else if(_0x1fe77e['body'][_0x7995('0x4e')]){_0x47d1d8[_0x7995('0x4e')]=_0x1fe77e[_0x7995('0x4a')]['OpenchannelAccountId'];}else if(_0x1fe77e['body']['ChatWebsiteId']){_0x47d1d8['ChatWebsiteId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4f')];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':_0x47d1d8})[_0x7995('0x24')](function(_0x357e60){if(_0x357e60){throw new db[(_0x7995('0x50'))][(_0x7995('0x51'))](_0x7995('0x52'));}return db[_0x7995('0x3f')][_0x7995('0x4b')](_0x1fe77e[_0x7995('0x4a')]);})[_0x7995('0x24')](function(_0x35bea3){var _0x1ea1dc=_0x1fe77e[_0x7995('0x53')][_0x7995('0x26')]({'plain':!![]});if(!_0x1ea1dc)throw new Error(_0x7995('0x54'));if(_0x1ea1dc[_0x7995('0x55')]==='user'){var _0x56a374=_0x35bea3[_0x7995('0x26')]({'plain':!![]});return db[_0x7995('0x56')][_0x7995('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x1ea1dc['userProfileId']},'raw':!![]})[_0x7995('0x24')](function(_0x197b52){if(_0x197b52&&_0x197b52[_0x7995('0x57')]===0x0){return db[_0x7995('0x28')]['create']({'name':_0x56a374[_0x7995('0x2a')],'resourceId':_0x56a374['id'],'type':_0x197b52[_0x7995('0x2a')],'sectionId':_0x197b52['id']},{})[_0x7995('0x24')](function(){return _0x35bea3;});}else{return _0x35bea3;}})[_0x7995('0x42')](function(_0x502d43){logger['error'](_0x7995('0x58'),_0x502d43);throw _0x502d43;});}return _0x35bea3;})[_0x7995('0x24')](respondWithResult(_0x12d4b8,0xc9))[_0x7995('0x42')](handleError(_0x12d4b8,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 187d93d..5de8aab 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 _0x7b40=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5d5632,_0x37486c){var _0x240e78=function(_0x46d105){while(--_0x46d105){_0x5d5632['push'](_0x5d5632['shift']());}};_0x240e78(++_0x37486c);}(_0x7b40,0x7c));var _0x07b4=function(_0x23a545,_0x4900ea){_0x23a545=_0x23a545-0x0;var _0x38e2d9=_0x7b40[_0x23a545];return _0x38e2d9;};'use strict';var _=require(_0x07b4('0x0'));var util=require(_0x07b4('0x1'));var logger=require(_0x07b4('0x2'))(_0x07b4('0x3'));var moment=require(_0x07b4('0x4'));var BPromise=require(_0x07b4('0x5'));var rp=require(_0x07b4('0x6'));var fs=require('fs');var path=require(_0x07b4('0x7'));var rimraf=require(_0x07b4('0x8'));var config=require('../../config/environment');var attributes=require(_0x07b4('0x9'));module['exports']=function(_0x2e7f47,_0xd45f4d){return _0x2e7f47[_0x07b4('0xa')]('CannedAnswer',attributes,{'tableName':_0x07b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x07b4('0xc'),'collate':_0x07b4('0xd')});}; \ No newline at end of file +var _0x9879=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','util','../../config/logger'];(function(_0x39c46e,_0x156daf){var _0x583479=function(_0x27ecfd){while(--_0x27ecfd){_0x39c46e['push'](_0x39c46e['shift']());}};_0x583479(++_0x156daf);}(_0x9879,0x98));var _0x9987=function(_0xcea21f,_0x5a0da2){_0xcea21f=_0xcea21f-0x0;var _0xa1f43c=_0x9879[_0xcea21f];return _0xa1f43c;};'use strict';var _=require('lodash');var util=require(_0x9987('0x0'));var logger=require(_0x9987('0x1'))(_0x9987('0x2'));var moment=require(_0x9987('0x3'));var BPromise=require(_0x9987('0x4'));var rp=require(_0x9987('0x5'));var fs=require('fs');var path=require(_0x9987('0x6'));var rimraf=require(_0x9987('0x7'));var config=require(_0x9987('0x8'));var attributes=require(_0x9987('0x9'));module[_0x9987('0xa')]=function(_0x473510,_0x15193d){return _0x473510[_0x9987('0xb')](_0x9987('0xc'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9987('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 1284e02..901aa52 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 _0x52c7=['error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x127481,_0x54e2ed){var _0x4d4a7b=function(_0x61647a){while(--_0x61647a){_0x127481['push'](_0x127481['shift']());}};_0x4d4a7b(++_0x54e2ed);}(_0x52c7,0x1bd));var _0x752c=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x52c7[_0x342baa];return _0x1208f3;};'use strict';var _=require('lodash');var util=require(_0x752c('0x0'));var moment=require(_0x752c('0x1'));var BPromise=require(_0x752c('0x2'));var rs=require(_0x752c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x752c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x752c('0x5'))('rpc');var config=require(_0x752c('0x6'));var jayson=require(_0x752c('0x7'));var client=jayson[_0x752c('0x8')][_0x752c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x190783,_0x36df71,_0x4e209f){return new BPromise(function(_0x1e4121,_0x5bb99a){return client[_0x752c('0xa')](_0x190783,_0x4e209f)[_0x752c('0xb')](function(_0x43a15e){logger['info'](_0x752c('0xc'),_0x36df71,_0x752c('0xd'));logger[_0x752c('0xe')](_0x752c('0xf'),_0x36df71,_0x752c('0xd'),JSON[_0x752c('0x10')](_0x43a15e));if(_0x43a15e[_0x752c('0x11')]){if(_0x43a15e[_0x752c('0x11')][_0x752c('0x12')]===0x1f4){logger[_0x752c('0x11')](_0x752c('0xc'),_0x36df71,_0x43a15e[_0x752c('0x11')][_0x752c('0x13')]);return _0x5bb99a(_0x43a15e[_0x752c('0x11')][_0x752c('0x13')]);}logger[_0x752c('0x11')](_0x752c('0xc'),_0x36df71,_0x43a15e[_0x752c('0x11')][_0x752c('0x13')]);return _0x1e4121(_0x43a15e['error']['message']);}else{logger['info'](_0x752c('0xc'),_0x36df71,_0x752c('0xd'));_0x1e4121(_0x43a15e[_0x752c('0x14')]['message']);}})[_0x752c('0x15')](function(_0x1fe7a4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x36df71,_0x1fe7a4);_0x5bb99a(_0x1fe7a4);});});} \ No newline at end of file +var _0x9996=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CannedAnswer,\x20%s,\x20%s','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird'];(function(_0x1e2ac3,_0x27318b){var _0x519396=function(_0xcaa24a){while(--_0xcaa24a){_0x1e2ac3['push'](_0x1e2ac3['shift']());}};_0x519396(++_0x27318b);}(_0x9996,0x1f4));var _0x6999=function(_0x5cd6c9,_0x2e3005){_0x5cd6c9=_0x5cd6c9-0x0;var _0x51bba8=_0x9996[_0x5cd6c9];return _0x51bba8;};'use strict';var _=require(_0x6999('0x0'));var util=require(_0x6999('0x1'));var moment=require(_0x6999('0x2'));var BPromise=require(_0x6999('0x3'));var rs=require(_0x6999('0x4'));var fs=require('fs');var Redis=require(_0x6999('0x5'));var db=require(_0x6999('0x6'))['db'];var utils=require(_0x6999('0x7'));var logger=require(_0x6999('0x8'))(_0x6999('0x9'));var config=require(_0x6999('0xa'));var jayson=require(_0x6999('0xb'));var client=jayson[_0x6999('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xed4c8,_0x48da09,_0x566cf3){return new BPromise(function(_0x3a7b16,_0x3804f6){return client[_0x6999('0xd')](_0xed4c8,_0x566cf3)[_0x6999('0xe')](function(_0x2b2b69){logger[_0x6999('0xf')](_0x6999('0x10'),_0x48da09,'request\x20sent');logger['debug'](_0x6999('0x11'),_0x48da09,'request\x20sent',JSON[_0x6999('0x12')](_0x2b2b69));if(_0x2b2b69[_0x6999('0x13')]){if(_0x2b2b69['error'][_0x6999('0x14')]===0x1f4){logger[_0x6999('0x13')](_0x6999('0x10'),_0x48da09,_0x2b2b69['error'][_0x6999('0x15')]);return _0x3804f6(_0x2b2b69[_0x6999('0x13')][_0x6999('0x15')]);}logger[_0x6999('0x13')]('CannedAnswer,\x20%s,\x20%s',_0x48da09,_0x2b2b69[_0x6999('0x13')]['message']);return _0x3a7b16(_0x2b2b69[_0x6999('0x13')][_0x6999('0x15')]);}else{logger['info'](_0x6999('0x10'),_0x48da09,_0x6999('0x16'));_0x3a7b16(_0x2b2b69['result'][_0x6999('0x15')]);}})[_0x6999('0x17')](function(_0x4dbccd){logger['error'](_0x6999('0x10'),_0x48da09,_0x4dbccd);_0x3804f6(_0x4dbccd);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 828cbe9..dfd4599 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 _0x0538=['isAuthenticated','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','get','/:id'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0538,0x1d8));var _0x8053=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x0538[_0x46401e];return _0x447cba;};'use strict';var multer=require(_0x8053('0x0'));var util=require(_0x8053('0x1'));var path=require('path');var timeout=require(_0x8053('0x2'));var express=require(_0x8053('0x3'));var router=express[_0x8053('0x4')]();var auth=require(_0x8053('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0x8053('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8053('0x6')](_0x8053('0x7'),auth[_0x8053('0x8')](),controller[_0x8053('0x9')]);router['post']('/',auth[_0x8053('0x8')](),controller[_0x8053('0xa')]);router['put'](_0x8053('0x7'),auth[_0x8053('0x8')](),controller[_0x8053('0xb')]);router[_0x8053('0xc')](_0x8053('0x7'),auth[_0x8053('0x8')](),controller[_0x8053('0xd')]);module[_0x8053('0xe')]=router; \ No newline at end of file +var _0xa4bd=['isAuthenticated','index','show','post','put','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0xf61985,_0x4326b1){var _0x524cdf=function(_0x137cc5){while(--_0x137cc5){_0xf61985['push'](_0xf61985['shift']());}};_0x524cdf(++_0x4326b1);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x5a1f5a,_0x39d6a6){_0x5a1f5a=_0x5a1f5a-0x0;var _0xc37a59=_0xa4bd[_0x5a1f5a];return _0xc37a59;};'use strict';var multer=require(_0xda4b('0x0'));var util=require(_0xda4b('0x1'));var path=require(_0xda4b('0x2'));var timeout=require('connect-timeout');var express=require(_0xda4b('0x3'));var router=express[_0xda4b('0x4')]();var auth=require(_0xda4b('0x5'));var interaction=require(_0xda4b('0x6'));var config=require(_0xda4b('0x7'));var controller=require(_0xda4b('0x8'));router[_0xda4b('0x9')]('/',auth[_0xda4b('0xa')](),controller[_0xda4b('0xb')]);router[_0xda4b('0x9')]('/:id',auth[_0xda4b('0xa')](),controller[_0xda4b('0xc')]);router[_0xda4b('0xd')]('/',auth[_0xda4b('0xa')](),controller['create']);router[_0xda4b('0xe')](_0xda4b('0xf'),auth[_0xda4b('0xa')](),controller['update']);router[_0xda4b('0x10')]('/:id',auth[_0xda4b('0xa')](),controller[_0xda4b('0x11')]);module[_0xda4b('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 9a3369f..62c31ee 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 _0xb558=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x4e4061,_0x26503b){var _0x371dbd=function(_0x31a31f){while(--_0x31a31f){_0x4e4061['push'](_0x4e4061['shift']());}};_0x371dbd(++_0x26503b);}(_0xb558,0x189));var _0x8b55=function(_0xfbf887,_0x4dc0a3){_0xfbf887=_0xfbf887-0x0;var _0x5786ce=_0xb558[_0xfbf887];return _0x5786ce;};'use strict';var Sequelize=require('sequelize');module[_0x8b55('0x0')]={'calldate':{'type':Sequelize[_0x8b55('0x1')],'allowNull':![],'defaultValue':_0x8b55('0x2')},'clid':{'type':Sequelize[_0x8b55('0x3')]},'src':{'type':Sequelize[_0x8b55('0x3')]},'dst':{'type':Sequelize[_0x8b55('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8b55('0x3')]},'dstchannel':{'type':Sequelize[_0x8b55('0x3')]},'lastapp':{'type':Sequelize[_0x8b55('0x3')]},'lastdata':{'type':Sequelize[_0x8b55('0x3')]},'duration':{'type':Sequelize[_0x8b55('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8b55('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8b55('0x3')]},'amaflags':{'type':Sequelize[_0x8b55('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8b55('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x8b55('0x3')]},'peeraccount':{'type':Sequelize[_0x8b55('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2f28=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2f28,0x131));var _0x82f2=function(_0x165cc2,_0x557d0c){_0x165cc2=_0x165cc2-0x0;var _0x359a7e=_0x2f28[_0x165cc2];return _0x359a7e;};'use strict';var Sequelize=require(_0x82f2('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x82f2('0x1')],'allowNull':![],'defaultValue':_0x82f2('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x82f2('0x3')]},'dst':{'type':Sequelize[_0x82f2('0x3')]},'dcontext':{'type':Sequelize[_0x82f2('0x3')]},'channel':{'type':Sequelize[_0x82f2('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x82f2('0x3')]},'lastdata':{'type':Sequelize[_0x82f2('0x3')]},'duration':{'type':Sequelize[_0x82f2('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x82f2('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x82f2('0x3')]},'amaflags':{'type':Sequelize[_0x82f2('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x82f2('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x82f2('0x3')]},'linkedid':{'type':Sequelize[_0x82f2('0x3')]},'sequence':{'type':Sequelize[_0x82f2('0x3')]},'peeraccount':{'type':Sequelize[_0x82f2('0x3')]},'type':{'type':Sequelize[_0x82f2('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 5f5b170..72bee0f 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 _0x25d5=['find','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','name','send','index','map','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','count','includeAll','findAll','catch','show','params','rawAttributes','fields','include','create','update','body'];(function(_0x15f8ad,_0x5275c3){var _0xc0238a=function(_0x5550c8){while(--_0x5550c8){_0x15f8ad['push'](_0x15f8ad['shift']());}};_0xc0238a(++_0x5275c3);}(_0x25d5,0x91));var _0x525d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x525d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x525d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x525d('0x2'));var rp=require(_0x525d('0x3'));var moment=require(_0x525d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x525d('0x5'));var util=require(_0x525d('0x6'));var path=require(_0x525d('0x7'));var sox=require(_0x525d('0x8'));var csv=require('to-csv');var ejs=require(_0x525d('0x9'));var fs=require('fs');var _=require(_0x525d('0xa'));var squel=require(_0x525d('0xb'));var crypto=require(_0x525d('0xc'));var jsforce=require(_0x525d('0xd'));var deskjs=require(_0x525d('0xe'));var toCsv=require(_0x525d('0xf'));var querystring=require(_0x525d('0x10'));var Papa=require(_0x525d('0x11'));var Redis=require('ioredis');var authService=require(_0x525d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x525d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x525d('0x14'));var config=require(_0x525d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x322380,_0x1cbd03){_0x1cbd03=_0x1cbd03||0xcc;return function(_0x451782){if(_0x451782){return _0x322380['sendStatus'](_0x1cbd03);}return _0x322380[_0x525d('0x16')](_0x1cbd03)[_0x525d('0x17')]();};}function respondWithResult(_0x3bac93,_0x2ce0d1){_0x2ce0d1=_0x2ce0d1||0xc8;return function(_0x5ccfbb){if(_0x5ccfbb){return _0x3bac93[_0x525d('0x16')](_0x2ce0d1)[_0x525d('0x18')](_0x5ccfbb);}};}function respondWithFilteredResult(_0x41e61b,_0x105cb3){return function(_0x39f756){if(_0x39f756){var _0x31ed21=_0x39f756['count'],_0x107dfb=_0x105cb3[_0x525d('0x19')],_0x471049=_0x105cb3[_0x525d('0x19')]+_0x105cb3[_0x525d('0x1a')],_0x50b4f3;if(_0x471049>=_0x31ed21){_0x471049=_0x31ed21;_0x50b4f3=0xc8;}else{_0x50b4f3=0xce;}_0x41e61b[_0x525d('0x16')](_0x50b4f3);return _0x41e61b[_0x525d('0x1b')](_0x525d('0x1c'),_0x107dfb+'-'+_0x471049+'/'+_0x31ed21)['json'](_0x39f756);}return null;};}function patchUpdates(_0x2d7ba4){return function(_0x3f3985){try{jsonpatch[_0x525d('0x1d')](_0x3f3985,_0x2d7ba4,!![]);}catch(_0x3d9a5b){return BPromise[_0x525d('0x1e')](_0x3d9a5b);}return _0x3f3985[_0x525d('0x1f')]();};}function saveUpdates(_0x576d45,_0x358f86){return function(_0x5d29b3){if(_0x5d29b3){return _0x5d29b3['update'](_0x576d45)['then'](function(_0x28e0e4){return _0x28e0e4;});}return null;};}function removeEntity(_0x5a18f8,_0x2aea6d){return function(_0x44d2ec){if(_0x44d2ec){return _0x44d2ec[_0x525d('0x20')]()[_0x525d('0x21')](function(){_0x5a18f8[_0x525d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x291cc3,_0x5327d0){return function(_0x59155e){if(!_0x59155e){_0x291cc3[_0x525d('0x22')](0x194);}return _0x59155e;};}function handleError(_0x3ec829,_0x5322ea){_0x5322ea=_0x5322ea||0x1f4;return function(_0x55a630){logger[_0x525d('0x23')](_0x55a630['stack']);if(_0x55a630[_0x525d('0x24')]){delete _0x55a630[_0x525d('0x24')];}_0x3ec829[_0x525d('0x16')](_0x5322ea)[_0x525d('0x25')](_0x55a630);};}exports[_0x525d('0x26')]=function(_0xcad2a9,_0xd1a50b){var _0x589e42={},_0x3a4886={},_0x5b13c2={'count':0x0,'rows':[]};var _0x1d70cb=_[_0x525d('0x27')](db['Cdr']['rawAttributes'],function(_0x86bc45){return{'name':_0x86bc45['fieldName'],'type':_0x86bc45[_0x525d('0x28')][_0x525d('0x29')]};});_0x3a4886[_0x525d('0x2a')]=_[_0x525d('0x27')](_0x1d70cb,'name');_0x3a4886['query']=_[_0x525d('0x2b')](_0xcad2a9[_0x525d('0x2c')]);_0x3a4886[_0x525d('0x2d')]=_[_0x525d('0x2e')](_0x3a4886[_0x525d('0x2a')],_0x3a4886[_0x525d('0x2c')]);_0x589e42[_0x525d('0x2f')]=_[_0x525d('0x2e')](_0x3a4886[_0x525d('0x2a')],qs['fields'](_0xcad2a9[_0x525d('0x2c')]['fields']));_0x589e42[_0x525d('0x2f')]=_0x589e42['attributes'][_0x525d('0x30')]?_0x589e42['attributes']:_0x3a4886[_0x525d('0x2a')];if(!_0xcad2a9[_0x525d('0x2c')][_0x525d('0x31')]('nolimit')){_0x589e42['limit']=qs[_0x525d('0x1a')](_0xcad2a9[_0x525d('0x2c')][_0x525d('0x1a')]);_0x589e42[_0x525d('0x19')]=qs[_0x525d('0x19')](_0xcad2a9[_0x525d('0x2c')]['offset']);}_0x589e42[_0x525d('0x32')]=qs[_0x525d('0x33')](_0xcad2a9[_0x525d('0x2c')][_0x525d('0x33')]);_0x589e42[_0x525d('0x34')]=qs[_0x525d('0x2d')](_[_0x525d('0x35')](_0xcad2a9[_0x525d('0x2c')],_0x3a4886[_0x525d('0x2d')]));if(_0xcad2a9[_0x525d('0x2c')]['filter']){_0x589e42[_0x525d('0x34')]=_[_0x525d('0x36')](_0x589e42[_0x525d('0x34')],{'$or':_[_0x525d('0x27')](_0x1d70cb,function(_0x13aaea){if(_0x13aaea[_0x525d('0x28')]!==_0x525d('0x37')){var _0x498283={};_0x498283[_0x13aaea[_0x525d('0x24')]]={'$like':'%'+_0xcad2a9[_0x525d('0x2c')][_0x525d('0x38')]+'%'};return _0x498283;}})});}_0x589e42=_[_0x525d('0x36')]({},_0x589e42,_0xcad2a9[_0x525d('0x39')]);var _0x229037={'where':_0x589e42[_0x525d('0x34')]};return db[_0x525d('0x3a')][_0x525d('0x3b')](_0x229037)[_0x525d('0x21')](function(_0xc6ff86){_0x5b13c2['count']=_0xc6ff86;if(_0xcad2a9[_0x525d('0x2c')][_0x525d('0x3c')]){_0x589e42['include']=[{'all':!![]}];}return db[_0x525d('0x3a')][_0x525d('0x3d')](_0x589e42);})[_0x525d('0x21')](function(_0x3cd005){_0x5b13c2['rows']=_0x3cd005;return _0x5b13c2;})['then'](respondWithFilteredResult(_0xd1a50b,_0x589e42))[_0x525d('0x3e')](handleError(_0xd1a50b,null));};exports[_0x525d('0x3f')]=function(_0x53abc0,_0xc63c1f){var _0x30aa3e={'raw':!![],'where':{'id':_0x53abc0[_0x525d('0x40')]['id']}},_0x3b96d4={};_0x3b96d4['model']=_[_0x525d('0x2b')](db[_0x525d('0x3a')][_0x525d('0x41')]);_0x3b96d4['query']=_['keys'](_0x53abc0['query']);_0x3b96d4['filters']=_[_0x525d('0x2e')](_0x3b96d4[_0x525d('0x2a')],_0x3b96d4[_0x525d('0x2c')]);_0x30aa3e[_0x525d('0x2f')]=_[_0x525d('0x2e')](_0x3b96d4[_0x525d('0x2a')],qs['fields'](_0x53abc0[_0x525d('0x2c')][_0x525d('0x42')]));_0x30aa3e[_0x525d('0x2f')]=_0x30aa3e[_0x525d('0x2f')][_0x525d('0x30')]?_0x30aa3e['attributes']:_0x3b96d4[_0x525d('0x2a')];if(_0x53abc0['query'][_0x525d('0x3c')]){_0x30aa3e[_0x525d('0x43')]=[{'all':!![]}];}_0x30aa3e=_[_0x525d('0x36')]({},_0x30aa3e,_0x53abc0['options']);return db[_0x525d('0x3a')]['find'](_0x30aa3e)[_0x525d('0x21')](handleEntityNotFound(_0xc63c1f,null))['then'](respondWithResult(_0xc63c1f,null))[_0x525d('0x3e')](handleError(_0xc63c1f,null));};exports[_0x525d('0x44')]=function(_0x2915ea,_0x151442){return db['Cdr']['create'](_0x2915ea['body'],{})[_0x525d('0x21')](respondWithResult(_0x151442,0xc9))[_0x525d('0x3e')](handleError(_0x151442,null));};exports[_0x525d('0x45')]=function(_0x78d409,_0x14fc09){if(_0x78d409[_0x525d('0x46')]['id']){delete _0x78d409[_0x525d('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x78d409[_0x525d('0x40')]['id']}})[_0x525d('0x21')](handleEntityNotFound(_0x14fc09,null))['then'](saveUpdates(_0x78d409['body'],null))[_0x525d('0x21')](respondWithResult(_0x14fc09,null))['catch'](handleError(_0x14fc09,null));};exports['destroy']=function(_0x2c4eb7,_0x833f89){return db[_0x525d('0x3a')][_0x525d('0x47')]({'where':{'id':_0x2c4eb7[_0x525d('0x40')]['id']}})[_0x525d('0x21')](handleEntityNotFound(_0x833f89,null))[_0x525d('0x21')](removeEntity(_0x833f89,null))[_0x525d('0x3e')](handleError(_0x833f89,null));};exports['describe']=function(_0x27ae1f,_0x38dbfe){return db[_0x525d('0x3a')]['describe']()[_0x525d('0x21')](respondWithResult(_0x38dbfe,null))[_0x525d('0x3e')](handleError(_0x38dbfe,null));}; \ No newline at end of file +var _0x67c1=['key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../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','name','index','map','Cdr','rawAttributes'];(function(_0x1c2d80,_0x582e83){var _0x497000=function(_0x16e6dc){while(--_0x16e6dc){_0x1c2d80['push'](_0x1c2d80['shift']());}};_0x497000(++_0x582e83);}(_0x67c1,0x14c));var _0x167c=function(_0x378240,_0x3adf55){_0x378240=_0x378240-0x0;var _0x1314d3=_0x67c1[_0x378240];return _0x1314d3;};'use strict';var pdf=require(_0x167c('0x0'));var emlformat=require(_0x167c('0x1'));var rimraf=require(_0x167c('0x2'));var zipdir=require(_0x167c('0x3'));var jsonpatch=require(_0x167c('0x4'));var rp=require('request-promise');var moment=require(_0x167c('0x5'));var BPromise=require(_0x167c('0x6'));var Mustache=require(_0x167c('0x7'));var util=require(_0x167c('0x8'));var path=require(_0x167c('0x9'));var sox=require(_0x167c('0xa'));var csv=require(_0x167c('0xb'));var ejs=require(_0x167c('0xc'));var fs=require('fs');var _=require(_0x167c('0xd'));var squel=require('squel');var crypto=require(_0x167c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x167c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x167c('0x10'));var Papa=require(_0x167c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x167c('0x12'));var logger=require(_0x167c('0x13'))(_0x167c('0x14'));var utils=require('../../config/utils');var config=require(_0x167c('0x15'));var db=require(_0x167c('0x16'))['db'];function respondWithStatusCode(_0x1daa8e,_0x16d56a){_0x16d56a=_0x16d56a||0xcc;return function(_0x14ff02){if(_0x14ff02){return _0x1daa8e[_0x167c('0x17')](_0x16d56a);}return _0x1daa8e[_0x167c('0x18')](_0x16d56a)[_0x167c('0x19')]();};}function respondWithResult(_0x28c7ee,_0x56899f){_0x56899f=_0x56899f||0xc8;return function(_0xfa23){if(_0xfa23){return _0x28c7ee['status'](_0x56899f)[_0x167c('0x1a')](_0xfa23);}};}function respondWithFilteredResult(_0x38d4b9,_0x372422){return function(_0x21d9e0){if(_0x21d9e0){var _0x1c1845=_0x21d9e0[_0x167c('0x1b')],_0x594ea3=_0x372422[_0x167c('0x1c')],_0x4e9d94=_0x372422[_0x167c('0x1c')]+_0x372422[_0x167c('0x1d')],_0x35d356;if(_0x4e9d94>=_0x1c1845){_0x4e9d94=_0x1c1845;_0x35d356=0xc8;}else{_0x35d356=0xce;}_0x38d4b9[_0x167c('0x18')](_0x35d356);return _0x38d4b9[_0x167c('0x1e')](_0x167c('0x1f'),_0x594ea3+'-'+_0x4e9d94+'/'+_0x1c1845)['json'](_0x21d9e0);}return null;};}function patchUpdates(_0xcd84a1){return function(_0x1bf103){try{jsonpatch[_0x167c('0x20')](_0x1bf103,_0xcd84a1,!![]);}catch(_0x33bf0a){return BPromise[_0x167c('0x21')](_0x33bf0a);}return _0x1bf103[_0x167c('0x22')]();};}function saveUpdates(_0x36826a,_0x2210c5){return function(_0x550ffd){if(_0x550ffd){return _0x550ffd['update'](_0x36826a)[_0x167c('0x23')](function(_0x5c6d9e){return _0x5c6d9e;});}return null;};}function removeEntity(_0x46ff3f,_0x5e278a){return function(_0x81d4f6){if(_0x81d4f6){return _0x81d4f6[_0x167c('0x24')]()[_0x167c('0x23')](function(){_0x46ff3f[_0x167c('0x18')](0xcc)[_0x167c('0x19')]();});}};}function handleEntityNotFound(_0x28ce17,_0x2b66cc){return function(_0xda296c){if(!_0xda296c){_0x28ce17[_0x167c('0x17')](0x194);}return _0xda296c;};}function handleError(_0x9ca5e,_0x2c4061){_0x2c4061=_0x2c4061||0x1f4;return function(_0x564331){logger[_0x167c('0x25')](_0x564331['stack']);if(_0x564331[_0x167c('0x26')]){delete _0x564331[_0x167c('0x26')];}_0x9ca5e[_0x167c('0x18')](_0x2c4061)['send'](_0x564331);};}exports[_0x167c('0x27')]=function(_0x46648c,_0x296cb6){var _0x24da98={},_0xb9d545={},_0x5c5ec7={'count':0x0,'rows':[]};var _0x2d52b2=_[_0x167c('0x28')](db[_0x167c('0x29')][_0x167c('0x2a')],function(_0x2b3977){return{'name':_0x2b3977['fieldName'],'type':_0x2b3977['type'][_0x167c('0x2b')]};});_0xb9d545[_0x167c('0x2c')]=_[_0x167c('0x28')](_0x2d52b2,_0x167c('0x26'));_0xb9d545[_0x167c('0x2d')]=_[_0x167c('0x2e')](_0x46648c[_0x167c('0x2d')]);_0xb9d545[_0x167c('0x2f')]=_['intersection'](_0xb9d545['model'],_0xb9d545[_0x167c('0x2d')]);_0x24da98[_0x167c('0x30')]=_[_0x167c('0x31')](_0xb9d545['model'],qs[_0x167c('0x32')](_0x46648c[_0x167c('0x2d')][_0x167c('0x32')]));_0x24da98[_0x167c('0x30')]=_0x24da98['attributes'][_0x167c('0x33')]?_0x24da98[_0x167c('0x30')]:_0xb9d545[_0x167c('0x2c')];if(!_0x46648c[_0x167c('0x2d')][_0x167c('0x34')](_0x167c('0x35'))){_0x24da98[_0x167c('0x1d')]=qs[_0x167c('0x1d')](_0x46648c[_0x167c('0x2d')][_0x167c('0x1d')]);_0x24da98['offset']=qs[_0x167c('0x1c')](_0x46648c['query'][_0x167c('0x1c')]);}_0x24da98[_0x167c('0x36')]=qs['sort'](_0x46648c[_0x167c('0x2d')][_0x167c('0x37')]);_0x24da98[_0x167c('0x38')]=qs[_0x167c('0x2f')](_[_0x167c('0x39')](_0x46648c[_0x167c('0x2d')],_0xb9d545[_0x167c('0x2f')]));if(_0x46648c[_0x167c('0x2d')][_0x167c('0x3a')]){_0x24da98[_0x167c('0x38')]=_[_0x167c('0x3b')](_0x24da98['where'],{'$or':_[_0x167c('0x28')](_0x2d52b2,function(_0x125826){if(_0x125826[_0x167c('0x3c')]!==_0x167c('0x3d')){var _0x52a14e={};_0x52a14e[_0x125826['name']]={'$like':'%'+_0x46648c[_0x167c('0x2d')]['filter']+'%'};return _0x52a14e;}})});}_0x24da98=_[_0x167c('0x3b')]({},_0x24da98,_0x46648c[_0x167c('0x3e')]);var _0xecca80={'where':_0x24da98[_0x167c('0x38')]};return db[_0x167c('0x29')][_0x167c('0x1b')](_0xecca80)[_0x167c('0x23')](function(_0x42c769){_0x5c5ec7[_0x167c('0x1b')]=_0x42c769;if(_0x46648c[_0x167c('0x2d')][_0x167c('0x3f')]){_0x24da98[_0x167c('0x40')]=[{'all':!![]}];}return db[_0x167c('0x29')][_0x167c('0x41')](_0x24da98);})[_0x167c('0x23')](function(_0x42dc1e){_0x5c5ec7[_0x167c('0x42')]=_0x42dc1e;return _0x5c5ec7;})['then'](respondWithFilteredResult(_0x296cb6,_0x24da98))[_0x167c('0x43')](handleError(_0x296cb6,null));};exports[_0x167c('0x44')]=function(_0x29e8da,_0x3f64fe){var _0x26cd02={'raw':!![],'where':{'id':_0x29e8da[_0x167c('0x45')]['id']}},_0x2d25a2={};_0x2d25a2[_0x167c('0x2c')]=_['keys'](db[_0x167c('0x29')][_0x167c('0x2a')]);_0x2d25a2['query']=_[_0x167c('0x2e')](_0x29e8da['query']);_0x2d25a2[_0x167c('0x2f')]=_[_0x167c('0x31')](_0x2d25a2[_0x167c('0x2c')],_0x2d25a2[_0x167c('0x2d')]);_0x26cd02['attributes']=_[_0x167c('0x31')](_0x2d25a2[_0x167c('0x2c')],qs['fields'](_0x29e8da[_0x167c('0x2d')][_0x167c('0x32')]));_0x26cd02[_0x167c('0x30')]=_0x26cd02[_0x167c('0x30')]['length']?_0x26cd02[_0x167c('0x30')]:_0x2d25a2[_0x167c('0x2c')];if(_0x29e8da[_0x167c('0x2d')][_0x167c('0x3f')]){_0x26cd02[_0x167c('0x40')]=[{'all':!![]}];}_0x26cd02=_[_0x167c('0x3b')]({},_0x26cd02,_0x29e8da[_0x167c('0x3e')]);return db[_0x167c('0x29')][_0x167c('0x46')](_0x26cd02)['then'](handleEntityNotFound(_0x3f64fe,null))[_0x167c('0x23')](respondWithResult(_0x3f64fe,null))[_0x167c('0x43')](handleError(_0x3f64fe,null));};exports[_0x167c('0x47')]=function(_0x2e53ec,_0x2c83c9){return db['Cdr'][_0x167c('0x47')](_0x2e53ec[_0x167c('0x48')],{})['then'](respondWithResult(_0x2c83c9,0xc9))[_0x167c('0x43')](handleError(_0x2c83c9,null));};exports[_0x167c('0x49')]=function(_0x36bfe3,_0xbbdad0){if(_0x36bfe3['body']['id']){delete _0x36bfe3[_0x167c('0x48')]['id'];}return db['Cdr'][_0x167c('0x46')]({'where':{'id':_0x36bfe3[_0x167c('0x45')]['id']}})[_0x167c('0x23')](handleEntityNotFound(_0xbbdad0,null))['then'](saveUpdates(_0x36bfe3[_0x167c('0x48')],null))[_0x167c('0x23')](respondWithResult(_0xbbdad0,null))[_0x167c('0x43')](handleError(_0xbbdad0,null));};exports[_0x167c('0x24')]=function(_0x1fff32,_0x106e8a){return db[_0x167c('0x29')][_0x167c('0x46')]({'where':{'id':_0x1fff32[_0x167c('0x45')]['id']}})[_0x167c('0x23')](handleEntityNotFound(_0x106e8a,null))[_0x167c('0x23')](removeEntity(_0x106e8a,null))[_0x167c('0x43')](handleError(_0x106e8a,null));};exports[_0x167c('0x4a')]=function(_0x4ab683,_0x22d628){return db[_0x167c('0x29')]['describe']()[_0x167c('0x23')](respondWithResult(_0x22d628,null))[_0x167c('0x43')](handleError(_0x22d628,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 9428c9f..497cbde 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 _0x90b1=['path','rimraf','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x494f3b,_0x2d8032){var _0x2bd495=function(_0x5792e5){while(--_0x5792e5){_0x494f3b['push'](_0x494f3b['shift']());}};_0x2bd495(++_0x2d8032);}(_0x90b1,0x1bb));var _0x190b=function(_0x5ec655,_0x1b7d41){_0x5ec655=_0x5ec655-0x0;var _0x144c58=_0x90b1[_0x5ec655];return _0x144c58;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./cdr.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xa')]},{'name':_0x190b('0xb'),'fields':['calldate']},{'name':_0x190b('0xc'),'fields':[_0x190b('0xc')]},{'name':_0x190b('0xd'),'fields':[_0x190b('0xd')]},{'name':_0x190b('0xe'),'fields':[_0x190b('0xe')]},{'name':_0x190b('0xf'),'fields':[_0x190b('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0xda19=['accountcode','disposition','dst','src','uniqueid','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr'];(function(_0xd077f6,_0x83bd3c){var _0x4a1c0f=function(_0x209652){while(--_0x209652){_0xd077f6['push'](_0xd077f6['shift']());}};_0x4a1c0f(++_0x83bd3c);}(_0xda19,0xd5));var _0x9da1=function(_0x53201f,_0x27d252){_0x53201f=_0x53201f-0x0;var _0x3dbae1=_0xda19[_0x53201f];return _0x3dbae1;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['accountcode']},{'name':'calldate','fields':['calldate']},{'name':_0x9da1('0xc'),'fields':['disposition']},{'name':_0x9da1('0xd'),'fields':[_0x9da1('0xd')]},{'name':_0x9da1('0xe'),'fields':[_0x9da1('0xe')]},{'name':_0x9da1('0xf'),'fields':[_0x9da1('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 5452287..6f26ad0 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 _0x9cd1=['Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','Cdr,\x20%s,\x20%s','debug'];(function(_0x6d2a05,_0x4423e8){var _0x1e66d5=function(_0x44f68a){while(--_0x44f68a){_0x6d2a05['push'](_0x6d2a05['shift']());}};_0x1e66d5(++_0x4423e8);}(_0x9cd1,0x120));var _0x19cd=function(_0x4c28ee,_0x415676){_0x4c28ee=_0x4c28ee-0x0;var _0x401e7a=_0x9cd1[_0x4c28ee];return _0x401e7a;};'use strict';var _=require(_0x19cd('0x0'));var util=require('util');var moment=require(_0x19cd('0x1'));var BPromise=require(_0x19cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19cd('0x3'))['db'];var utils=require(_0x19cd('0x4'));var logger=require(_0x19cd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x19cd('0x6'));var client=jayson[_0x19cd('0x7')][_0x19cd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1779ce,_0x135d50,_0x12ab0b){return new BPromise(function(_0x2e360a,_0x3d5eab){return client['request'](_0x1779ce,_0x12ab0b)[_0x19cd('0x9')](function(_0x2d06c1){logger['info'](_0x19cd('0xa'),_0x135d50,'request\x20sent');logger[_0x19cd('0xb')](_0x19cd('0xc'),_0x135d50,_0x19cd('0xd'),JSON['stringify'](_0x2d06c1));if(_0x2d06c1[_0x19cd('0xe')]){if(_0x2d06c1[_0x19cd('0xe')][_0x19cd('0xf')]===0x1f4){logger[_0x19cd('0xe')](_0x19cd('0xa'),_0x135d50,_0x2d06c1[_0x19cd('0xe')][_0x19cd('0x10')]);return _0x3d5eab(_0x2d06c1[_0x19cd('0xe')]['message']);}logger[_0x19cd('0xe')](_0x19cd('0xa'),_0x135d50,_0x2d06c1[_0x19cd('0xe')][_0x19cd('0x10')]);return _0x2e360a(_0x2d06c1['error']['message']);}else{logger[_0x19cd('0x11')](_0x19cd('0xa'),_0x135d50,_0x19cd('0xd'));_0x2e360a(_0x2d06c1[_0x19cd('0x12')]['message']);}})[_0x19cd('0x13')](function(_0xf32712){logger[_0x19cd('0xe')](_0x19cd('0xa'),_0x135d50,_0xf32712);_0x3d5eab(_0xf32712);});});} \ No newline at end of file +var _0xe9e7=['Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2a524a,_0x28c5cb){var _0x38a273=function(_0x2b7eed){while(--_0x2b7eed){_0x2a524a['push'](_0x2a524a['shift']());}};_0x38a273(++_0x28c5cb);}(_0xe9e7,0x142));var _0x7e9e=function(_0x2f23cf,_0x54795d){_0x2f23cf=_0x2f23cf-0x0;var _0x1ec8ed=_0xe9e7[_0x2f23cf];return _0x1ec8ed;};'use strict';var _=require(_0x7e9e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7e9e('0x1'));var rs=require(_0x7e9e('0x2'));var fs=require('fs');var Redis=require(_0x7e9e('0x3'));var db=require(_0x7e9e('0x4'))['db'];var utils=require(_0x7e9e('0x5'));var logger=require(_0x7e9e('0x6'))(_0x7e9e('0x7'));var config=require('../../config/environment');var jayson=require(_0x7e9e('0x8'));var client=jayson[_0x7e9e('0x9')][_0x7e9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f544b,_0x269ebc,_0x5eef0f){return new BPromise(function(_0x1df22f,_0x1c69e9){return client[_0x7e9e('0xb')](_0x3f544b,_0x5eef0f)[_0x7e9e('0xc')](function(_0x2b652d){logger[_0x7e9e('0xd')](_0x7e9e('0xe'),_0x269ebc,_0x7e9e('0xf'));logger[_0x7e9e('0x10')](_0x7e9e('0x11'),_0x269ebc,_0x7e9e('0xf'),JSON[_0x7e9e('0x12')](_0x2b652d));if(_0x2b652d[_0x7e9e('0x13')]){if(_0x2b652d[_0x7e9e('0x13')][_0x7e9e('0x14')]===0x1f4){logger[_0x7e9e('0x13')](_0x7e9e('0xe'),_0x269ebc,_0x2b652d[_0x7e9e('0x13')][_0x7e9e('0x15')]);return _0x1c69e9(_0x2b652d[_0x7e9e('0x13')][_0x7e9e('0x15')]);}logger[_0x7e9e('0x13')]('Cdr,\x20%s,\x20%s',_0x269ebc,_0x2b652d['error'][_0x7e9e('0x15')]);return _0x1df22f(_0x2b652d[_0x7e9e('0x13')][_0x7e9e('0x15')]);}else{logger['info'](_0x7e9e('0xe'),_0x269ebc,_0x7e9e('0xf'));_0x1df22f(_0x2b652d[_0x7e9e('0x16')][_0x7e9e('0x15')]);}})[_0x7e9e('0x17')](function(_0x1f8e9f){logger[_0x7e9e('0x13')](_0x7e9e('0xe'),_0x269ebc,_0x1f8e9f);_0x1c69e9(_0x1f8e9f);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index ca2b3ed..579b3ee 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 _0x76ad=['multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','exports'];(function(_0x4dedcc,_0x588c87){var _0x153767=function(_0x58ec1b){while(--_0x58ec1b){_0x4dedcc['push'](_0x4dedcc['shift']());}};_0x153767(++_0x588c87);}(_0x76ad,0xee));var _0xd76a=function(_0x1006d5,_0x31bf70){_0x1006d5=_0x1006d5-0x0;var _0x4513da=_0x76ad[_0x1006d5];return _0x4513da;};'use strict';var multer=require(_0xd76a('0x0'));var util=require(_0xd76a('0x1'));var path=require(_0xd76a('0x2'));var timeout=require(_0xd76a('0x3'));var express=require(_0xd76a('0x4'));var router=express[_0xd76a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd76a('0x6'));var controller=require('./cdr.controller');router[_0xd76a('0x7')]('/',auth[_0xd76a('0x8')](),controller[_0xd76a('0x9')]);router['get'](_0xd76a('0xa'),auth['isAuthenticated'](),controller[_0xd76a('0xb')]);router[_0xd76a('0x7')](_0xd76a('0xc'),auth[_0xd76a('0x8')](),controller['show']);router['post']('/',auth[_0xd76a('0x8')](),controller['create']);router['put'](_0xd76a('0xc'),auth[_0xd76a('0x8')](),controller['update']);router['delete'](_0xd76a('0xc'),auth[_0xd76a('0x8')](),controller['destroy']);module[_0xd76a('0xd')]=router; \ No newline at end of file +var _0xac7f=['./cdr.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','express','Router','../../config/environment'];(function(_0x57446e,_0x4740a8){var _0x400e52=function(_0x452863){while(--_0x452863){_0x57446e['push'](_0x57446e['shift']());}};_0x400e52(++_0x4740a8);}(_0xac7f,0x1f4));var _0xfac7=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xac7f[_0xd1d19a];return _0x52a79d;};'use strict';var multer=require(_0xfac7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfac7('0x1'));var router=express[_0xfac7('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfac7('0x3'));var controller=require(_0xfac7('0x4'));router['get']('/',auth[_0xfac7('0x5')](),controller['index']);router[_0xfac7('0x6')](_0xfac7('0x7'),auth[_0xfac7('0x5')](),controller[_0xfac7('0x8')]);router[_0xfac7('0x6')](_0xfac7('0x9'),auth['isAuthenticated'](),controller[_0xfac7('0xa')]);router[_0xfac7('0xb')]('/',auth[_0xfac7('0x5')](),controller[_0xfac7('0xc')]);router[_0xfac7('0xd')](_0xfac7('0x9'),auth[_0xfac7('0x5')](),controller[_0xfac7('0xe')]);router[_0xfac7('0xf')](_0xfac7('0x9'),auth[_0xfac7('0x5')](),controller[_0xfac7('0x10')]);module[_0xfac7('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index a567c90..6ada4f5 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 _0x9620=['STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x2c0172,_0xf1f22a){var _0x10b1b9=function(_0x57136e){while(--_0x57136e){_0x2c0172['push'](_0x2c0172['shift']());}};_0x10b1b9(++_0xf1f22a);}(_0x9620,0x102));var _0x0962=function(_0x346e35,_0xaac01a){_0x346e35=_0x346e35-0x0;var _0x1fccbd=_0x9620[_0x346e35];return _0x1fccbd;};'use strict';var Sequelize=require(_0x0962('0x0'));module[_0x0962('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0962('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0962('0x3')]()},'description':{'type':Sequelize[_0x0962('0x2')]},'interval':{'type':Sequelize[_0x0962('0x2')],'defaultValue':_0x0962('0x4')}}; \ No newline at end of file +var _0x6309=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x3a7399,_0x2d2307){var _0x440350=function(_0x485e94){while(--_0x485e94){_0x3a7399['push'](_0x3a7399['shift']());}};_0x440350(++_0x2d2307);}(_0x6309,0x1d4));var _0x9630=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x6309[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x9630('0x0'));module[_0x9630('0x1')]={'priority':{'type':Sequelize[_0x9630('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9630('0x3')],'allowNull':![],'defaultValue':_0x9630('0x4')},'appdata':{'type':Sequelize[_0x9630('0x5')]()},'description':{'type':Sequelize[_0x9630('0x3')]},'interval':{'type':Sequelize[_0x9630('0x3')],'defaultValue':_0x9630('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 8a63c35..4fe6b38 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 _0xca23=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','then','destroy','name','send','show','params','ChatApplication','rawAttributes','query','keys','filters','intersection','model','attributes','fields','includeAll','include','merge','find','catch','update','body','eml-format','rimraf'];(function(_0x40fdf5,_0x1a015f){var _0x11c787=function(_0x51b0fa){while(--_0x51b0fa){_0x40fdf5['push'](_0x40fdf5['shift']());}};_0x11c787(++_0x1a015f);}(_0xca23,0x154));var _0x3ca2=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xca23[_0x20ef64];return _0x3707d8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3ca2('0x0'));var rimraf=require(_0x3ca2('0x1'));var zipdir=require(_0x3ca2('0x2'));var jsonpatch=require(_0x3ca2('0x3'));var rp=require('request-promise');var moment=require(_0x3ca2('0x4'));var BPromise=require(_0x3ca2('0x5'));var Mustache=require(_0x3ca2('0x6'));var util=require(_0x3ca2('0x7'));var path=require(_0x3ca2('0x8'));var sox=require(_0x3ca2('0x9'));var csv=require(_0x3ca2('0xa'));var ejs=require(_0x3ca2('0xb'));var fs=require('fs');var _=require(_0x3ca2('0xc'));var squel=require(_0x3ca2('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3ca2('0xa'));var querystring=require(_0x3ca2('0xe'));var Papa=require(_0x3ca2('0xf'));var Redis=require(_0x3ca2('0x10'));var authService=require(_0x3ca2('0x11'));var qs=require(_0x3ca2('0x12'));var as=require(_0x3ca2('0x13'));var hardwareService=require(_0x3ca2('0x14'));var logger=require(_0x3ca2('0x15'))('api');var utils=require(_0x3ca2('0x16'));var config=require(_0x3ca2('0x17'));var db=require(_0x3ca2('0x18'))['db'];function respondWithStatusCode(_0x330ee7,_0x53a02a){_0x53a02a=_0x53a02a||0xcc;return function(_0x416001){if(_0x416001){return _0x330ee7[_0x3ca2('0x19')](_0x53a02a);}return _0x330ee7[_0x3ca2('0x1a')](_0x53a02a)[_0x3ca2('0x1b')]();};}function respondWithResult(_0x5d9287,_0x293ceb){_0x293ceb=_0x293ceb||0xc8;return function(_0x4f5490){if(_0x4f5490){return _0x5d9287[_0x3ca2('0x1a')](_0x293ceb)[_0x3ca2('0x1c')](_0x4f5490);}};}function respondWithFilteredResult(_0x2faa8f,_0x8e1b0e){return function(_0x1c5706){if(_0x1c5706){var _0x1d0098=_0x1c5706[_0x3ca2('0x1d')],_0x4dfa70=_0x8e1b0e[_0x3ca2('0x1e')],_0x5bb74a=_0x8e1b0e['offset']+_0x8e1b0e[_0x3ca2('0x1f')],_0x7c85c2;if(_0x5bb74a>=_0x1d0098){_0x5bb74a=_0x1d0098;_0x7c85c2=0xc8;}else{_0x7c85c2=0xce;}_0x2faa8f['status'](_0x7c85c2);return _0x2faa8f[_0x3ca2('0x20')]('Content-Range',_0x4dfa70+'-'+_0x5bb74a+'/'+_0x1d0098)[_0x3ca2('0x1c')](_0x1c5706);}return null;};}function patchUpdates(_0x35aa99){return function(_0x12889b){try{jsonpatch[_0x3ca2('0x21')](_0x12889b,_0x35aa99,!![]);}catch(_0x515086){return BPromise[_0x3ca2('0x22')](_0x515086);}return _0x12889b['save']();};}function saveUpdates(_0x3327c4,_0x2ec5fa){return function(_0x54bec8){if(_0x54bec8){return _0x54bec8['update'](_0x3327c4)[_0x3ca2('0x23')](function(_0x4ebfe1){return _0x4ebfe1;});}return null;};}function removeEntity(_0x2111bd,_0x1606f2){return function(_0x4b7e67){if(_0x4b7e67){return _0x4b7e67[_0x3ca2('0x24')]()[_0x3ca2('0x23')](function(){_0x2111bd[_0x3ca2('0x1a')](0xcc)[_0x3ca2('0x1b')]();});}};}function handleEntityNotFound(_0x1124ef,_0x29f9d9){return function(_0x4738d6){if(!_0x4738d6){_0x1124ef['sendStatus'](0x194);}return _0x4738d6;};}function handleError(_0x5f42f6,_0xcd52b1){_0xcd52b1=_0xcd52b1||0x1f4;return function(_0x340c3d){logger['error'](_0x340c3d['stack']);if(_0x340c3d[_0x3ca2('0x25')]){delete _0x340c3d[_0x3ca2('0x25')];}_0x5f42f6['status'](_0xcd52b1)[_0x3ca2('0x26')](_0x340c3d);};}exports[_0x3ca2('0x27')]=function(_0x32af47,_0x416002){var _0x2d2ef0={'raw':!![],'where':{'id':_0x32af47[_0x3ca2('0x28')]['id']}},_0x2b7efc={};_0x2b7efc['model']=_['keys'](db[_0x3ca2('0x29')][_0x3ca2('0x2a')]);_0x2b7efc[_0x3ca2('0x2b')]=_[_0x3ca2('0x2c')](_0x32af47[_0x3ca2('0x2b')]);_0x2b7efc[_0x3ca2('0x2d')]=_[_0x3ca2('0x2e')](_0x2b7efc[_0x3ca2('0x2f')],_0x2b7efc[_0x3ca2('0x2b')]);_0x2d2ef0[_0x3ca2('0x30')]=_['intersection'](_0x2b7efc[_0x3ca2('0x2f')],qs[_0x3ca2('0x31')](_0x32af47['query'][_0x3ca2('0x31')]));_0x2d2ef0['attributes']=_0x2d2ef0['attributes']['length']?_0x2d2ef0[_0x3ca2('0x30')]:_0x2b7efc[_0x3ca2('0x2f')];if(_0x32af47[_0x3ca2('0x2b')][_0x3ca2('0x32')]){_0x2d2ef0[_0x3ca2('0x33')]=[{'all':!![]}];}_0x2d2ef0=_[_0x3ca2('0x34')]({},_0x2d2ef0,_0x32af47['options']);return db[_0x3ca2('0x29')][_0x3ca2('0x35')](_0x2d2ef0)['then'](handleEntityNotFound(_0x416002,null))[_0x3ca2('0x23')](respondWithResult(_0x416002,null))[_0x3ca2('0x36')](handleError(_0x416002,null));};exports[_0x3ca2('0x37')]=function(_0x5bf6b0,_0x4dcb6a){if(_0x5bf6b0[_0x3ca2('0x38')]['id']){delete _0x5bf6b0[_0x3ca2('0x38')]['id'];}return db[_0x3ca2('0x29')]['find']({'where':{'id':_0x5bf6b0[_0x3ca2('0x28')]['id']}})[_0x3ca2('0x23')](handleEntityNotFound(_0x4dcb6a,null))['then'](saveUpdates(_0x5bf6b0[_0x3ca2('0x38')],null))[_0x3ca2('0x23')](respondWithResult(_0x4dcb6a,null))[_0x3ca2('0x36')](handleError(_0x4dcb6a,null));};exports['destroy']=function(_0x381aa0,_0x5d5222){return db['ChatApplication'][_0x3ca2('0x35')]({'where':{'id':_0x381aa0[_0x3ca2('0x28')]['id']}})[_0x3ca2('0x23')](handleEntityNotFound(_0x5d5222,null))[_0x3ca2('0x23')](removeEntity(_0x5d5222,null))[_0x3ca2('0x36')](handleError(_0x5d5222,null));}; \ No newline at end of file +var _0x7cdd=['body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','show','params','ChatApplication','rawAttributes','query','keys','intersection','attributes','model','fields','length','include','merge','find','catch'];(function(_0x570b29,_0x54070a){var _0x1a7aae=function(_0x2b94d6){while(--_0x2b94d6){_0x570b29['push'](_0x570b29['shift']());}};_0x1a7aae(++_0x54070a);}(_0x7cdd,0xb8));var _0xd7cd=function(_0x200c2a,_0x4965f8){_0x200c2a=_0x200c2a-0x0;var _0x1929f1=_0x7cdd[_0x200c2a];return _0x1929f1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd7cd('0x0'));var rimraf=require(_0xd7cd('0x1'));var zipdir=require(_0xd7cd('0x2'));var jsonpatch=require(_0xd7cd('0x3'));var rp=require(_0xd7cd('0x4'));var moment=require(_0xd7cd('0x5'));var BPromise=require(_0xd7cd('0x6'));var Mustache=require(_0xd7cd('0x7'));var util=require(_0xd7cd('0x8'));var path=require(_0xd7cd('0x9'));var sox=require('sox');var csv=require(_0xd7cd('0xa'));var ejs=require(_0xd7cd('0xb'));var fs=require('fs');var _=require(_0xd7cd('0xc'));var squel=require(_0xd7cd('0xd'));var crypto=require(_0xd7cd('0xe'));var jsforce=require(_0xd7cd('0xf'));var deskjs=require(_0xd7cd('0x10'));var toCsv=require(_0xd7cd('0xa'));var querystring=require(_0xd7cd('0x11'));var Papa=require(_0xd7cd('0x12'));var Redis=require(_0xd7cd('0x13'));var authService=require(_0xd7cd('0x14'));var qs=require(_0xd7cd('0x15'));var as=require(_0xd7cd('0x16'));var hardwareService=require(_0xd7cd('0x17'));var logger=require(_0xd7cd('0x18'))(_0xd7cd('0x19'));var utils=require(_0xd7cd('0x1a'));var config=require(_0xd7cd('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2266c2,_0x3c724d){_0x3c724d=_0x3c724d||0xcc;return function(_0x52f67a){if(_0x52f67a){return _0x2266c2[_0xd7cd('0x1c')](_0x3c724d);}return _0x2266c2[_0xd7cd('0x1d')](_0x3c724d)[_0xd7cd('0x1e')]();};}function respondWithResult(_0x6a895c,_0x22b0b7){_0x22b0b7=_0x22b0b7||0xc8;return function(_0x4a05cc){if(_0x4a05cc){return _0x6a895c[_0xd7cd('0x1d')](_0x22b0b7)[_0xd7cd('0x1f')](_0x4a05cc);}};}function respondWithFilteredResult(_0x33b2c4,_0x3268bc){return function(_0x503846){if(_0x503846){var _0xf2d0c5=_0x503846[_0xd7cd('0x20')],_0x488d48=_0x3268bc['offset'],_0x9682b3=_0x3268bc['offset']+_0x3268bc[_0xd7cd('0x21')],_0x236bfe;if(_0x9682b3>=_0xf2d0c5){_0x9682b3=_0xf2d0c5;_0x236bfe=0xc8;}else{_0x236bfe=0xce;}_0x33b2c4[_0xd7cd('0x1d')](_0x236bfe);return _0x33b2c4[_0xd7cd('0x22')](_0xd7cd('0x23'),_0x488d48+'-'+_0x9682b3+'/'+_0xf2d0c5)[_0xd7cd('0x1f')](_0x503846);}return null;};}function patchUpdates(_0x55ef9e){return function(_0xa3b802){try{jsonpatch[_0xd7cd('0x24')](_0xa3b802,_0x55ef9e,!![]);}catch(_0x15c2fb){return BPromise[_0xd7cd('0x25')](_0x15c2fb);}return _0xa3b802[_0xd7cd('0x26')]();};}function saveUpdates(_0x4207d5,_0x23a493){return function(_0x160f32){if(_0x160f32){return _0x160f32[_0xd7cd('0x27')](_0x4207d5)[_0xd7cd('0x28')](function(_0x18e50b){return _0x18e50b;});}return null;};}function removeEntity(_0x4425e0,_0x5ae56f){return function(_0x252432){if(_0x252432){return _0x252432[_0xd7cd('0x29')]()[_0xd7cd('0x28')](function(){_0x4425e0[_0xd7cd('0x1d')](0xcc)[_0xd7cd('0x1e')]();});}};}function handleEntityNotFound(_0x49923a,_0x1955c1){return function(_0x27d9b2){if(!_0x27d9b2){_0x49923a[_0xd7cd('0x1c')](0x194);}return _0x27d9b2;};}function handleError(_0x274e48,_0x293621){_0x293621=_0x293621||0x1f4;return function(_0x1b0692){logger[_0xd7cd('0x2a')](_0x1b0692[_0xd7cd('0x2b')]);if(_0x1b0692['name']){delete _0x1b0692[_0xd7cd('0x2c')];}_0x274e48[_0xd7cd('0x1d')](_0x293621)['send'](_0x1b0692);};}exports[_0xd7cd('0x2d')]=function(_0x2589d1,_0x100e05){var _0x1b72ae={'raw':!![],'where':{'id':_0x2589d1[_0xd7cd('0x2e')]['id']}},_0x2dc5d5={};_0x2dc5d5['model']=_['keys'](db[_0xd7cd('0x2f')][_0xd7cd('0x30')]);_0x2dc5d5[_0xd7cd('0x31')]=_[_0xd7cd('0x32')](_0x2589d1[_0xd7cd('0x31')]);_0x2dc5d5['filters']=_[_0xd7cd('0x33')](_0x2dc5d5['model'],_0x2dc5d5[_0xd7cd('0x31')]);_0x1b72ae[_0xd7cd('0x34')]=_[_0xd7cd('0x33')](_0x2dc5d5[_0xd7cd('0x35')],qs['fields'](_0x2589d1[_0xd7cd('0x31')][_0xd7cd('0x36')]));_0x1b72ae[_0xd7cd('0x34')]=_0x1b72ae[_0xd7cd('0x34')][_0xd7cd('0x37')]?_0x1b72ae[_0xd7cd('0x34')]:_0x2dc5d5[_0xd7cd('0x35')];if(_0x2589d1[_0xd7cd('0x31')]['includeAll']){_0x1b72ae[_0xd7cd('0x38')]=[{'all':!![]}];}_0x1b72ae=_[_0xd7cd('0x39')]({},_0x1b72ae,_0x2589d1['options']);return db['ChatApplication'][_0xd7cd('0x3a')](_0x1b72ae)[_0xd7cd('0x28')](handleEntityNotFound(_0x100e05,null))['then'](respondWithResult(_0x100e05,null))[_0xd7cd('0x3b')](handleError(_0x100e05,null));};exports[_0xd7cd('0x27')]=function(_0x54cfe1,_0x5b1112){if(_0x54cfe1[_0xd7cd('0x3c')]['id']){delete _0x54cfe1[_0xd7cd('0x3c')]['id'];}return db[_0xd7cd('0x2f')]['find']({'where':{'id':_0x54cfe1[_0xd7cd('0x2e')]['id']}})[_0xd7cd('0x28')](handleEntityNotFound(_0x5b1112,null))['then'](saveUpdates(_0x54cfe1[_0xd7cd('0x3c')],null))[_0xd7cd('0x28')](respondWithResult(_0x5b1112,null))[_0xd7cd('0x3b')](handleError(_0x5b1112,null));};exports[_0xd7cd('0x29')]=function(_0x41d15c,_0x29e21b){return db['ChatApplication']['find']({'where':{'id':_0x41d15c[_0xd7cd('0x2e')]['id']}})[_0xd7cd('0x28')](handleEntityNotFound(_0x29e21b,null))[_0xd7cd('0x28')](removeEntity(_0x29e21b,null))[_0xd7cd('0x3b')](handleError(_0x29e21b,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 6fcfc2c..84bce3d 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 a4abb9d..0cec962 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 _0xbaf7=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4f9589,_0x508341){var _0x461484=function(_0x292e1b){while(--_0x292e1b){_0x4f9589['push'](_0x4f9589['shift']());}};_0x461484(++_0x508341);}(_0xbaf7,0x1a0));var _0x7baf=function(_0x4f9147,_0x389729){_0x4f9147=_0x4f9147-0x0;var _0x2149c1=_0xbaf7[_0x4f9147];return _0x2149c1;};'use strict';var _=require(_0x7baf('0x0'));var util=require(_0x7baf('0x1'));var moment=require('moment');var BPromise=require(_0x7baf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7baf('0x3'))['db'];var utils=require(_0x7baf('0x4'));var logger=require(_0x7baf('0x5'))(_0x7baf('0x6'));var config=require('../../config/environment');var jayson=require(_0x7baf('0x7'));var client=jayson[_0x7baf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cbbc2,_0x21083e,_0x4c337e){return new BPromise(function(_0x4de087,_0x4927ca){return client[_0x7baf('0x9')](_0x2cbbc2,_0x4c337e)[_0x7baf('0xa')](function(_0x1f5104){logger[_0x7baf('0xb')](_0x7baf('0xc'),_0x21083e,_0x7baf('0xd'));logger[_0x7baf('0xe')](_0x7baf('0xf'),_0x21083e,_0x7baf('0xd'),JSON[_0x7baf('0x10')](_0x1f5104));if(_0x1f5104['error']){if(_0x1f5104[_0x7baf('0x11')][_0x7baf('0x12')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x21083e,_0x1f5104[_0x7baf('0x11')][_0x7baf('0x13')]);return _0x4927ca(_0x1f5104[_0x7baf('0x11')]['message']);}logger[_0x7baf('0x11')]('ChatApplication,\x20%s,\x20%s',_0x21083e,_0x1f5104['error'][_0x7baf('0x13')]);return _0x4de087(_0x1f5104[_0x7baf('0x11')][_0x7baf('0x13')]);}else{logger[_0x7baf('0xb')](_0x7baf('0xc'),_0x21083e,_0x7baf('0xd'));_0x4de087(_0x1f5104[_0x7baf('0x14')][_0x7baf('0x13')]);}})[_0x7baf('0x15')](function(_0xef805f){logger[_0x7baf('0x11')](_0x7baf('0xc'),_0x21083e,_0xef805f);_0x4927ca(_0xef805f);});});} \ No newline at end of file +var _0x5231=['client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3cf9e9,_0x3a47e3){var _0x2b9b9f=function(_0x50d1a9){while(--_0x50d1a9){_0x3cf9e9['push'](_0x3cf9e9['shift']());}};_0x2b9b9f(++_0x3a47e3);}(_0x5231,0x13a));var _0x1523=function(_0x534617,_0x41a7ba){_0x534617=_0x534617-0x0;var _0x516e6a=_0x5231[_0x534617];return _0x516e6a;};'use strict';var _=require('lodash');var util=require(_0x1523('0x0'));var moment=require(_0x1523('0x1'));var BPromise=require('bluebird');var rs=require(_0x1523('0x2'));var fs=require('fs');var Redis=require(_0x1523('0x3'));var db=require(_0x1523('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1523('0x5'))('rpc');var config=require(_0x1523('0x6'));var jayson=require(_0x1523('0x7'));var client=jayson[_0x1523('0x8')][_0x1523('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac1d2,_0xd0214e,_0x1ea8bf){return new BPromise(function(_0x2f9bfd,_0x368aaf){return client[_0x1523('0xa')](_0x5ac1d2,_0x1ea8bf)[_0x1523('0xb')](function(_0x29fd2f){logger['info'](_0x1523('0xc'),_0xd0214e,_0x1523('0xd'));logger[_0x1523('0xe')](_0x1523('0xf'),_0xd0214e,'request\x20sent',JSON[_0x1523('0x10')](_0x29fd2f));if(_0x29fd2f[_0x1523('0x11')]){if(_0x29fd2f[_0x1523('0x11')][_0x1523('0x12')]===0x1f4){logger[_0x1523('0x11')](_0x1523('0xc'),_0xd0214e,_0x29fd2f[_0x1523('0x11')][_0x1523('0x13')]);return _0x368aaf(_0x29fd2f[_0x1523('0x11')][_0x1523('0x13')]);}logger['error'](_0x1523('0xc'),_0xd0214e,_0x29fd2f[_0x1523('0x11')][_0x1523('0x13')]);return _0x2f9bfd(_0x29fd2f['error'][_0x1523('0x13')]);}else{logger[_0x1523('0x14')](_0x1523('0xc'),_0xd0214e,_0x1523('0xd'));_0x2f9bfd(_0x29fd2f[_0x1523('0x15')][_0x1523('0x13')]);}})[_0x1523('0x16')](function(_0x30b2f2){logger[_0x1523('0x11')]('ChatApplication,\x20%s,\x20%s',_0xd0214e,_0x30b2f2);_0x368aaf(_0x30b2f2);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 5a6e652..0b33bb7 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 _0x716e=['./chatApplication.controller','get','/:id','isAuthenticated','put','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x57ee8c,_0xe42849){var _0x3a2322=function(_0x5ea8b2){while(--_0x5ea8b2){_0x57ee8c['push'](_0x57ee8c['shift']());}};_0x3a2322(++_0xe42849);}(_0x716e,0x1e7));var _0xe716=function(_0x3b2d10,_0x31b559){_0x3b2d10=_0x3b2d10-0x0;var _0x31bbc4=_0x716e[_0x3b2d10];return _0x31bbc4;};'use strict';var multer=require(_0xe716('0x0'));var util=require(_0xe716('0x1'));var path=require(_0xe716('0x2'));var timeout=require(_0xe716('0x3'));var express=require('express');var router=express[_0xe716('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe716('0x5'));var config=require(_0xe716('0x6'));var controller=require(_0xe716('0x7'));router[_0xe716('0x8')](_0xe716('0x9'),auth[_0xe716('0xa')](),controller['show']);router[_0xe716('0xb')](_0xe716('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xe716('0xa')](),controller['destroy']);module[_0xe716('0xc')]=router; \ No newline at end of file +var _0x6412=['../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1d5f7b,_0x210b0f){var _0x5c73eb=function(_0x3f83bf){while(--_0x3f83bf){_0x1d5f7b['push'](_0x1d5f7b['shift']());}};_0x5c73eb(++_0x210b0f);}(_0x6412,0xad));var _0x2641=function(_0x15bbd4,_0x738cc0){_0x15bbd4=_0x15bbd4-0x0;var _0x3c6863=_0x6412[_0x15bbd4];return _0x3c6863;};'use strict';var multer=require(_0x2641('0x0'));var util=require(_0x2641('0x1'));var path=require(_0x2641('0x2'));var timeout=require(_0x2641('0x3'));var express=require(_0x2641('0x4'));var router=express[_0x2641('0x5')]();var auth=require(_0x2641('0x6'));var interaction=require(_0x2641('0x7'));var config=require('../../config/environment');var controller=require(_0x2641('0x8'));router[_0x2641('0x9')](_0x2641('0xa'),auth[_0x2641('0xb')](),controller[_0x2641('0xc')]);router[_0x2641('0xd')](_0x2641('0xa'),auth[_0x2641('0xb')](),controller[_0x2641('0xe')]);router[_0x2641('0xf')](_0x2641('0xa'),auth[_0x2641('0xb')](),controller[_0x2641('0x10')]);module[_0x2641('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 86138dd..5593650 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 _0x975b=['STRING','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x975b,0x88));var _0xb975=function(_0x1423c2,_0x17051d){_0x1423c2=_0x1423c2-0x0;var _0x2fcdcf=_0x975b[_0x1423c2];return _0x2fcdcf;};'use strict';var Sequelize=require(_0xb975('0x0'));module[_0xb975('0x1')]={'name':{'type':Sequelize[_0xb975('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb975('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xf430=['BOOLEAN','sequelize','STRING'];(function(_0x4fd572,_0x17e456){var _0x4cb8c8=function(_0x156ed6){while(--_0x156ed6){_0x4fd572['push'](_0x4fd572['shift']());}};_0x4cb8c8(++_0x17e456);}(_0xf430,0xb5));var _0x0f43=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0xf430[_0x1ad926];return _0x1b81dc;};'use strict';var Sequelize=require(_0x0f43('0x0'));module['exports']={'name':{'type':Sequelize[_0x0f43('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0f43('0x1')]},'write':{'type':Sequelize[_0x0f43('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index f9e1c17..ce7ba87 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 _0xf042=['includeAll','findAll','rows','show','params','length','include','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','nolimit','removeMembers','ChatGroupId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','destroy','send','index','map','ChatGroup','rawAttributes','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options'];(function(_0x4252d9,_0x207693){var _0x1b5a61=function(_0x2e31e9){while(--_0x2e31e9){_0x4252d9['push'](_0x4252d9['shift']());}};_0x1b5a61(++_0x207693);}(_0xf042,0x1bf));var _0x2f04=function(_0x32890d,_0x729c56){_0x32890d=_0x32890d-0x0;var _0x4126b2=_0xf042[_0x32890d];return _0x4126b2;};'use strict';var pdf=require(_0x2f04('0x0'));var emlformat=require(_0x2f04('0x1'));var rimraf=require(_0x2f04('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f04('0x3'));var rp=require('request-promise');var moment=require(_0x2f04('0x4'));var BPromise=require(_0x2f04('0x5'));var Mustache=require('mustache');var util=require(_0x2f04('0x6'));var path=require(_0x2f04('0x7'));var sox=require(_0x2f04('0x8'));var csv=require(_0x2f04('0x9'));var ejs=require(_0x2f04('0xa'));var fs=require('fs');var _=require(_0x2f04('0xb'));var squel=require('squel');var crypto=require(_0x2f04('0xc'));var jsforce=require(_0x2f04('0xd'));var deskjs=require(_0x2f04('0xe'));var toCsv=require(_0x2f04('0x9'));var querystring=require(_0x2f04('0xf'));var Papa=require(_0x2f04('0x10'));var Redis=require(_0x2f04('0x11'));var authService=require(_0x2f04('0x12'));var qs=require(_0x2f04('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f04('0x14'));var logger=require(_0x2f04('0x15'))('api');var utils=require(_0x2f04('0x16'));var config=require(_0x2f04('0x17'));var db=require(_0x2f04('0x18'))['db'];config[_0x2f04('0x19')]=_[_0x2f04('0x1a')](config[_0x2f04('0x19')],{'host':_0x2f04('0x1b'),'port':0x18eb});var socket=require(_0x2f04('0x1c'))(new Redis(config[_0x2f04('0x19')]));require('./chatGroup.socket')[_0x2f04('0x1d')](socket);var jayson=require(_0x2f04('0x1e'));var client=jayson[_0x2f04('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x4245b7,_0x4b2c64,_0x178a44){if(_0x178a44){var _0x2ee9da=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ee9da['test'](_0x4b2c64)){return _0x4245b7;}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 _0x4245b7;}}function respondWithRpcPromise(_0x3dab37,_0x104d77,_0x101c7e,_0x4e0090){return new BPromise(function(_0x50ea4e,_0x407f07){var _0x5b9c96=_0x4e0090||client;return _0x5b9c96[_0x2f04('0x20')](_0x3dab37,_0x101c7e)[_0x2f04('0x21')](function(_0x294d71){logger[_0x2f04('0x22')](_0x2f04('0x23'),_0x104d77,_0x2f04('0x24'));logger[_0x2f04('0x25')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x104d77,'request\x20sent',JSON[_0x2f04('0x26')](_0x294d71));if(_0x294d71['error']){if(_0x294d71[_0x2f04('0x27')]['code']===0x1f4){logger[_0x2f04('0x27')](_0x2f04('0x23'),_0x104d77,_0x294d71['error'][_0x2f04('0x28')]);return _0x407f07(_0x294d71[_0x2f04('0x27')][_0x2f04('0x28')]);}logger[_0x2f04('0x27')](_0x2f04('0x23'),_0x104d77,_0x294d71['error']['message']);return _0x50ea4e(_0x294d71[_0x2f04('0x27')][_0x2f04('0x28')]);}else{logger['info'](_0x2f04('0x23'),_0x104d77,_0x2f04('0x24'));_0x50ea4e(_0x294d71[_0x2f04('0x29')][_0x2f04('0x28')]);}})[_0x2f04('0x2a')](function(_0x272274){logger[_0x2f04('0x27')](_0x2f04('0x23'),_0x104d77,_0x272274);_0x407f07(_0x272274);});});}function respondWithStatusCode(_0x41b831,_0x1a4f5d){_0x1a4f5d=_0x1a4f5d||0xcc;return function(_0x336677){if(_0x336677){return _0x41b831[_0x2f04('0x2b')](_0x1a4f5d);}return _0x41b831[_0x2f04('0x2c')](_0x1a4f5d)[_0x2f04('0x2d')]();};}function respondWithResult(_0x3ac6b4,_0x41384b){_0x41384b=_0x41384b||0xc8;return function(_0x14d868){if(_0x14d868){return _0x3ac6b4[_0x2f04('0x2c')](_0x41384b)[_0x2f04('0x2e')](_0x14d868);}};}function respondWithFilteredResult(_0x2ed9a5,_0x182635){return function(_0x495266){if(_0x495266){var _0x149043=_0x495266[_0x2f04('0x2f')],_0x4435be=_0x182635[_0x2f04('0x30')],_0x187c99=_0x182635['offset']+_0x182635[_0x2f04('0x31')],_0x5eeb87;if(_0x187c99>=_0x149043){_0x187c99=_0x149043;_0x5eeb87=0xc8;}else{_0x5eeb87=0xce;}_0x2ed9a5['status'](_0x5eeb87);return _0x2ed9a5[_0x2f04('0x32')](_0x2f04('0x33'),_0x4435be+'-'+_0x187c99+'/'+_0x149043)[_0x2f04('0x2e')](_0x495266);}return null;};}function patchUpdates(_0x45841c){return function(_0x144bcf){try{jsonpatch[_0x2f04('0x34')](_0x144bcf,_0x45841c,!![]);}catch(_0x20b433){return BPromise['reject'](_0x20b433);}return _0x144bcf['save']();};}function saveUpdates(_0x748306,_0x1af4eb){return function(_0x1a4dd1){if(_0x1a4dd1){return _0x1a4dd1['update'](_0x748306)[_0x2f04('0x21')](function(_0x29e105){return _0x29e105;});}return null;};}function removeEntity(_0x207e70,_0x1e9b2d){return function(_0x2f6076){if(_0x2f6076){return _0x2f6076[_0x2f04('0x35')]()[_0x2f04('0x21')](function(){_0x207e70[_0x2f04('0x2c')](0xcc)[_0x2f04('0x2d')]();});}};}function handleEntityNotFound(_0xbf18d4,_0x388a66){return function(_0xec7f88){if(!_0xec7f88){_0xbf18d4[_0x2f04('0x2b')](0x194);}return _0xec7f88;};}function handleError(_0x15b298,_0x569e4c){_0x569e4c=_0x569e4c||0x1f4;return function(_0x337c5b){logger[_0x2f04('0x27')](_0x337c5b['stack']);if(_0x337c5b['name']){delete _0x337c5b['name'];}_0x15b298['status'](_0x569e4c)[_0x2f04('0x36')](_0x337c5b);};}exports[_0x2f04('0x37')]=function(_0x18b3f0,_0xf4e408){var _0x373c9d={},_0x27669f={},_0x462027={'count':0x0,'rows':[]};var _0x39dcba=_[_0x2f04('0x38')](db[_0x2f04('0x39')][_0x2f04('0x3a')],function(_0x3d9a01){return{'name':_0x3d9a01['fieldName'],'type':_0x3d9a01[_0x2f04('0x3b')][_0x2f04('0x3c')]};});_0x27669f[_0x2f04('0x3d')]=_['map'](_0x39dcba,_0x2f04('0x3e'));_0x27669f[_0x2f04('0x3f')]=_[_0x2f04('0x40')](_0x18b3f0[_0x2f04('0x3f')]);_0x27669f['filters']=_[_0x2f04('0x41')](_0x27669f[_0x2f04('0x3d')],_0x27669f['query']);_0x373c9d[_0x2f04('0x42')]=_[_0x2f04('0x41')](_0x27669f[_0x2f04('0x3d')],qs[_0x2f04('0x43')](_0x18b3f0[_0x2f04('0x3f')][_0x2f04('0x43')]));_0x373c9d[_0x2f04('0x42')]=_0x373c9d['attributes']['length']?_0x373c9d['attributes']:_0x27669f[_0x2f04('0x3d')];if(!_0x18b3f0[_0x2f04('0x3f')][_0x2f04('0x44')]('nolimit')){_0x373c9d[_0x2f04('0x31')]=qs[_0x2f04('0x31')](_0x18b3f0[_0x2f04('0x3f')][_0x2f04('0x31')]);_0x373c9d[_0x2f04('0x30')]=qs[_0x2f04('0x30')](_0x18b3f0['query']['offset']);}_0x373c9d[_0x2f04('0x45')]=qs['sort'](_0x18b3f0[_0x2f04('0x3f')][_0x2f04('0x46')]);_0x373c9d[_0x2f04('0x47')]=qs[_0x2f04('0x48')](_[_0x2f04('0x49')](_0x18b3f0[_0x2f04('0x3f')],_0x27669f['filters']));if(_0x18b3f0[_0x2f04('0x3f')][_0x2f04('0x4a')]){_0x373c9d[_0x2f04('0x47')]=_[_0x2f04('0x4b')](_0x373c9d[_0x2f04('0x47')],{'$or':_['map'](_0x39dcba,function(_0x5c2961){if(_0x5c2961[_0x2f04('0x3b')]!==_0x2f04('0x4c')){var _0x150bcb={};_0x150bcb[_0x5c2961[_0x2f04('0x3e')]]={'$like':'%'+_0x18b3f0[_0x2f04('0x3f')][_0x2f04('0x4a')]+'%'};return _0x150bcb;}})});}_0x373c9d=_[_0x2f04('0x4b')]({},_0x373c9d,_0x18b3f0[_0x2f04('0x4d')]);var _0x16802e={'where':_0x373c9d[_0x2f04('0x47')]};return db[_0x2f04('0x39')][_0x2f04('0x2f')](_0x16802e)[_0x2f04('0x21')](function(_0x219d17){_0x462027[_0x2f04('0x2f')]=_0x219d17;if(_0x18b3f0['query'][_0x2f04('0x4e')]){_0x373c9d['include']=[{'all':!![]}];}return db[_0x2f04('0x39')][_0x2f04('0x4f')](_0x373c9d);})[_0x2f04('0x21')](function(_0x400b75){_0x462027[_0x2f04('0x50')]=_0x400b75;return _0x462027;})['then'](respondWithFilteredResult(_0xf4e408,_0x373c9d))[_0x2f04('0x2a')](handleError(_0xf4e408,null));};exports[_0x2f04('0x51')]=function(_0x15030c,_0xea58fe){var _0x1a0031={'raw':!![],'where':{'id':_0x15030c[_0x2f04('0x52')]['id']}},_0x21819b={};_0x21819b[_0x2f04('0x3d')]=_[_0x2f04('0x40')](db['ChatGroup'][_0x2f04('0x3a')]);_0x21819b[_0x2f04('0x3f')]=_[_0x2f04('0x40')](_0x15030c['query']);_0x21819b[_0x2f04('0x48')]=_[_0x2f04('0x41')](_0x21819b[_0x2f04('0x3d')],_0x21819b[_0x2f04('0x3f')]);_0x1a0031[_0x2f04('0x42')]=_[_0x2f04('0x41')](_0x21819b[_0x2f04('0x3d')],qs[_0x2f04('0x43')](_0x15030c[_0x2f04('0x3f')][_0x2f04('0x43')]));_0x1a0031[_0x2f04('0x42')]=_0x1a0031['attributes'][_0x2f04('0x53')]?_0x1a0031[_0x2f04('0x42')]:_0x21819b[_0x2f04('0x3d')];if(_0x15030c[_0x2f04('0x3f')]['includeAll']){_0x1a0031[_0x2f04('0x54')]=[{'all':!![]}];}_0x1a0031=_[_0x2f04('0x4b')]({},_0x1a0031,_0x15030c[_0x2f04('0x4d')]);return db['ChatGroup'][_0x2f04('0x55')](_0x1a0031)[_0x2f04('0x21')](handleEntityNotFound(_0xea58fe,null))[_0x2f04('0x21')](respondWithResult(_0xea58fe,null))[_0x2f04('0x2a')](handleError(_0xea58fe,null));};exports['create']=function(_0x3b2036,_0x5e819b){return db['ChatGroup'][_0x2f04('0x56')](_0x3b2036[_0x2f04('0x57')],{})[_0x2f04('0x21')](respondWithResult(_0x5e819b,0xc9))[_0x2f04('0x2a')](handleError(_0x5e819b,null));};exports[_0x2f04('0x58')]=function(_0xe72945,_0x1f0103){if(_0xe72945['body']['id']){delete _0xe72945[_0x2f04('0x57')]['id'];}return db[_0x2f04('0x39')][_0x2f04('0x55')]({'where':{'id':_0xe72945['params']['id']}})[_0x2f04('0x21')](handleEntityNotFound(_0x1f0103,null))[_0x2f04('0x21')](saveUpdates(_0xe72945[_0x2f04('0x57')],null))[_0x2f04('0x21')](respondWithResult(_0x1f0103,null))[_0x2f04('0x2a')](handleError(_0x1f0103,null));};exports[_0x2f04('0x35')]=function(_0x295443,_0x73c742){return db[_0x2f04('0x39')][_0x2f04('0x55')]({'where':{'id':_0x295443[_0x2f04('0x52')]['id']}})[_0x2f04('0x21')](handleEntityNotFound(_0x73c742,null))[_0x2f04('0x21')](removeEntity(_0x73c742,null))[_0x2f04('0x2a')](handleError(_0x73c742,null));};exports['describe']=function(_0x514f2f,_0x42b495){return db[_0x2f04('0x39')][_0x2f04('0x59')]()[_0x2f04('0x21')](respondWithResult(_0x42b495,null))[_0x2f04('0x2a')](handleError(_0x42b495,null));};exports[_0x2f04('0x5a')]=function(_0x5a7089,_0x500b06,_0x1beb10){return db[_0x2f04('0x5b')][_0x2f04('0x2f')]({'where':{'ChatGroupId':_0x5a7089[_0x2f04('0x52')]['id'],'ToId':_0x5a7089[_0x2f04('0x5c')]['id'],'read':![]}})['then'](function(_0x4b6d95){return{'id':_[_0x2f04('0x5d')](_0x5a7089[_0x2f04('0x52')]['id']),'count':_0x4b6d95};})['then'](respondWithResult(_0x500b06,null))[_0x2f04('0x2a')](handleError(_0x500b06,null));};exports[_0x2f04('0x5e')]=function(_0x526a63,_0x2a8532,_0x4e8cb9){return db['ChatGroup'][_0x2f04('0x55')]({'where':{'id':_0x526a63[_0x2f04('0x52')]['id']}})[_0x2f04('0x21')](handleEntityNotFound(_0x2a8532,null))[_0x2f04('0x21')](function(_0x39fe74){if(_0x39fe74){return _0x39fe74[_0x2f04('0x5e')](_0x526a63['body'][_0x2f04('0x5f')],_[_0x2f04('0x60')](_0x526a63['body'],[_0x2f04('0x5f'),'id'])||{});}})[_0x2f04('0x21')](respondWithResult(_0x2a8532,null))['catch'](handleError(_0x2a8532,null));};exports[_0x2f04('0x61')]=function(_0x366b85,_0x15e5b2,_0x4e4314){var _0x3ce8ab={};var _0x4739c0={};var _0x8a4878;var _0x550915;return db['ChatGroup'][_0x2f04('0x62')]({'where':{'id':_0x366b85[_0x2f04('0x52')]['id']}})[_0x2f04('0x21')](handleEntityNotFound(_0x15e5b2,null))[_0x2f04('0x21')](function(_0x21a7e9){if(_0x21a7e9){_0x8a4878=_0x21a7e9;_0x4739c0['model']=_['keys'](db['User'][_0x2f04('0x3a')]);_0x4739c0['query']=_[_0x2f04('0x40')](_0x366b85['query']);_0x4739c0[_0x2f04('0x48')]=_['intersection'](_0x4739c0['model'],_0x4739c0['query']);_0x3ce8ab[_0x2f04('0x42')]=_[_0x2f04('0x41')](_0x4739c0[_0x2f04('0x3d')],qs[_0x2f04('0x43')](_0x366b85[_0x2f04('0x3f')][_0x2f04('0x43')]));_0x3ce8ab[_0x2f04('0x42')]=_0x3ce8ab[_0x2f04('0x42')][_0x2f04('0x53')]?_0x3ce8ab[_0x2f04('0x42')]:_0x4739c0[_0x2f04('0x3d')];_0x3ce8ab['order']=qs[_0x2f04('0x46')](_0x366b85['query'][_0x2f04('0x46')]);_0x3ce8ab[_0x2f04('0x47')]=qs[_0x2f04('0x48')](_[_0x2f04('0x49')](_0x366b85[_0x2f04('0x3f')],_0x4739c0[_0x2f04('0x48')]));if(_0x366b85[_0x2f04('0x3f')][_0x2f04('0x4a')]){_0x3ce8ab[_0x2f04('0x47')]=_['merge'](_0x3ce8ab[_0x2f04('0x47')],{'$or':_[_0x2f04('0x38')](_0x3ce8ab[_0x2f04('0x42')],function(_0x34649d){var _0xd0453d={};_0xd0453d[_0x34649d]={'$like':'%'+_0x366b85[_0x2f04('0x3f')][_0x2f04('0x4a')]+'%'};return _0xd0453d;})});}_0x3ce8ab=_[_0x2f04('0x4b')]({},_0x3ce8ab,_0x366b85[_0x2f04('0x4d')]);return _0x8a4878[_0x2f04('0x61')](_0x3ce8ab);}})[_0x2f04('0x21')](function(_0x54584d){if(_0x54584d){_0x550915=_0x54584d[_0x2f04('0x53')];if(!_0x366b85['query']['hasOwnProperty'](_0x2f04('0x63'))){_0x3ce8ab[_0x2f04('0x31')]=qs[_0x2f04('0x31')](_0x366b85[_0x2f04('0x3f')][_0x2f04('0x31')]);_0x3ce8ab[_0x2f04('0x30')]=qs['offset'](_0x366b85['query'][_0x2f04('0x30')]);}return _0x8a4878[_0x2f04('0x61')](_0x3ce8ab);}})[_0x2f04('0x21')](function(_0x4bc176){if(_0x4bc176){return _0x4bc176?{'count':_0x550915,'rows':_0x4bc176}:null;}})[_0x2f04('0x21')](respondWithResult(_0x15e5b2,null))['catch'](handleError(_0x15e5b2,null));};exports['removeMembers']=function(_0x4049c3,_0x2d3a52,_0x428963){return db[_0x2f04('0x39')][_0x2f04('0x55')]({'where':{'id':_0x4049c3[_0x2f04('0x52')]['id']}})[_0x2f04('0x21')](handleEntityNotFound(_0x2d3a52,null))[_0x2f04('0x21')](function(_0x61226b){if(_0x61226b){return _0x61226b[_0x2f04('0x64')](_0x4049c3['query'][_0x2f04('0x5f')]);}})['then'](respondWithStatusCode(_0x2d3a52,null))['catch'](handleError(_0x2d3a52,null));};exports['addMessage']=function(_0x28cb09,_0x555e5b,_0x3e6632){if(_0x28cb09[_0x2f04('0x57')]['id']){delete _0x28cb09[_0x2f04('0x57')]['id'];}return db[_0x2f04('0x39')]['find']({'where':{'id':_0x28cb09[_0x2f04('0x52')]['id']}})[_0x2f04('0x21')](handleEntityNotFound(_0x555e5b,null))[_0x2f04('0x21')](function(_0x39c428){if(_0x39c428){_0x28cb09['body'][_0x2f04('0x65')]=_0x39c428['id'];return db[_0x2f04('0x5b')][_0x2f04('0x56')](_0x28cb09['body']);}})[_0x2f04('0x21')](respondWithResult(_0x555e5b,null))['catch'](handleError(_0x555e5b,null));};exports['getMessages']=function(_0x252037,_0x19f4e9,_0x3cd780){var _0x2e3193={};var _0x27c8c3={};var _0x2cbb18;var _0x2f712c;return db[_0x2f04('0x39')][_0x2f04('0x62')]({'where':{'id':_0x252037[_0x2f04('0x52')]['id']}})[_0x2f04('0x21')](handleEntityNotFound(_0x19f4e9,null))[_0x2f04('0x21')](function(_0xbf5b08){if(_0xbf5b08){_0x2cbb18=_0xbf5b08;_0x27c8c3[_0x2f04('0x3d')]=_[_0x2f04('0x40')](db['ChatInternalMessage']['rawAttributes']);_0x27c8c3[_0x2f04('0x3f')]=_[_0x2f04('0x40')](_0x252037[_0x2f04('0x3f')]);_0x27c8c3[_0x2f04('0x48')]=_[_0x2f04('0x41')](_0x27c8c3[_0x2f04('0x3d')],_0x27c8c3[_0x2f04('0x3f')]);_0x2e3193[_0x2f04('0x42')]=_[_0x2f04('0x41')](_0x27c8c3[_0x2f04('0x3d')],qs[_0x2f04('0x43')](_0x252037[_0x2f04('0x3f')][_0x2f04('0x43')]));_0x2e3193[_0x2f04('0x42')]=_0x2e3193[_0x2f04('0x42')]['length']?_0x2e3193[_0x2f04('0x42')]:_0x27c8c3[_0x2f04('0x3d')];_0x2e3193[_0x2f04('0x45')]=qs[_0x2f04('0x46')](_0x252037[_0x2f04('0x3f')]['sort']);_0x2e3193[_0x2f04('0x47')]=qs[_0x2f04('0x48')](_[_0x2f04('0x49')](_0x252037['query'],_0x27c8c3[_0x2f04('0x48')]));if(_0x252037[_0x2f04('0x3f')][_0x2f04('0x4a')]){_0x2e3193[_0x2f04('0x47')]=_[_0x2f04('0x4b')](_0x2e3193[_0x2f04('0x47')],{'$or':_[_0x2f04('0x38')](_0x2e3193[_0x2f04('0x42')],function(_0x48395c){var _0x3a73ba={};_0x3a73ba[_0x48395c]={'$like':'%'+_0x252037['query']['filter']+'%'};return _0x3a73ba;})});}if(_0x252037[_0x2f04('0x3f')][_0x2f04('0x66')]){var _0xef4861=_0x252037[_0x2f04('0x3f')]['$gte'][_0x2f04('0x67')](',');var _0x2ce385={};_0x2ce385[_0xef4861[0x0]]={'$gte':moment(_0xef4861[0x1])['format'](_0x2f04('0x68'))};_0x2e3193[_0x2f04('0x47')]=_[_0x2f04('0x4b')](_0x2e3193[_0x2f04('0x47')],_0x2ce385);}_0x2e3193=_[_0x2f04('0x4b')]({},_0x2e3193,_0x252037[_0x2f04('0x4d')]);return _0x2cbb18['getMessages'](_0x2e3193);}})['then'](function(_0x4e9656){if(_0x4e9656){_0x2f712c=_0x4e9656[_0x2f04('0x53')];if(!_0x252037['query'][_0x2f04('0x44')](_0x2f04('0x63'))){_0x2e3193[_0x2f04('0x31')]=qs['limit'](_0x252037['query']['limit']);_0x2e3193[_0x2f04('0x30')]=qs[_0x2f04('0x30')](_0x252037['query'][_0x2f04('0x30')]);}return _0x2cbb18['getMessages'](_0x2e3193);}})['then'](function(_0x42b899){if(_0x42b899){return _0x42b899?{'count':_0x2f712c,'rows':_0x42b899}:null;}})[_0x2f04('0x21')](respondWithResult(_0x19f4e9,null))[_0x2f04('0x2a')](handleError(_0x19f4e9,null));}; \ No newline at end of file +var _0x82b2=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','client','http','test','Sequelize','ValidationError','request','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','info','result','sendStatus','status','end','count','offset','set','reject','save','update','then','destroy','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service'];(function(_0x5c2db,_0x3c9bff){var _0x45a350=function(_0x5aa807){while(--_0x5aa807){_0x5c2db['push'](_0x5c2db['shift']());}};_0x45a350(++_0x3c9bff);}(_0x82b2,0x132));var _0x282b=function(_0x118afa,_0x4bf0c1){_0x118afa=_0x118afa-0x0;var _0x167d76=_0x82b2[_0x118afa];return _0x167d76;};'use strict';var pdf=require(_0x282b('0x0'));var emlformat=require(_0x282b('0x1'));var rimraf=require(_0x282b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x282b('0x3'));var rp=require(_0x282b('0x4'));var moment=require(_0x282b('0x5'));var BPromise=require(_0x282b('0x6'));var Mustache=require('mustache');var util=require(_0x282b('0x7'));var path=require(_0x282b('0x8'));var sox=require(_0x282b('0x9'));var csv=require('to-csv');var ejs=require(_0x282b('0xa'));var fs=require('fs');var _=require(_0x282b('0xb'));var squel=require(_0x282b('0xc'));var crypto=require(_0x282b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x282b('0xe'));var toCsv=require(_0x282b('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x282b('0x10'));var authService=require(_0x282b('0x11'));var qs=require(_0x282b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x282b('0x13'));var logger=require(_0x282b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x282b('0x15'));var db=require(_0x282b('0x16'))['db'];config[_0x282b('0x17')]=_[_0x282b('0x18')](config[_0x282b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x282b('0x19'))(new Redis(config[_0x282b('0x17')]));require('./chatGroup.socket')[_0x282b('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x282b('0x1b')][_0x282b('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x30db76,_0x752c55,_0x50bdd9){if(_0x50bdd9){var _0x323a88=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x323a88[_0x282b('0x1d')](_0x752c55)){return _0x30db76;}else{throw new db[(_0x282b('0x1e'))][(_0x282b('0x1f'))]('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 _0x30db76;}}function respondWithRpcPromise(_0x3cc2f4,_0x2d7d63,_0x31af4f,_0x5374fe){return new BPromise(function(_0x3d6934,_0x56c2e1){var _0x52878d=_0x5374fe||client;return _0x52878d[_0x282b('0x20')](_0x3cc2f4,_0x31af4f)['then'](function(_0x1645a9){logger['info']('ChatGroup,\x20%s,\x20%s',_0x2d7d63,_0x282b('0x21'));logger['debug'](_0x282b('0x22'),_0x2d7d63,_0x282b('0x21'),JSON[_0x282b('0x23')](_0x1645a9));if(_0x1645a9[_0x282b('0x24')]){if(_0x1645a9['error'][_0x282b('0x25')]===0x1f4){logger[_0x282b('0x24')](_0x282b('0x26'),_0x2d7d63,_0x1645a9[_0x282b('0x24')][_0x282b('0x27')]);return _0x56c2e1(_0x1645a9[_0x282b('0x24')]['message']);}logger[_0x282b('0x24')](_0x282b('0x26'),_0x2d7d63,_0x1645a9[_0x282b('0x24')]['message']);return _0x3d6934(_0x1645a9[_0x282b('0x24')]['message']);}else{logger[_0x282b('0x28')](_0x282b('0x26'),_0x2d7d63,_0x282b('0x21'));_0x3d6934(_0x1645a9[_0x282b('0x29')][_0x282b('0x27')]);}})['catch'](function(_0x31fdb4){logger[_0x282b('0x24')](_0x282b('0x26'),_0x2d7d63,_0x31fdb4);_0x56c2e1(_0x31fdb4);});});}function respondWithStatusCode(_0x481d5c,_0x4fe2d7){_0x4fe2d7=_0x4fe2d7||0xcc;return function(_0x508a47){if(_0x508a47){return _0x481d5c[_0x282b('0x2a')](_0x4fe2d7);}return _0x481d5c[_0x282b('0x2b')](_0x4fe2d7)[_0x282b('0x2c')]();};}function respondWithResult(_0x4b0423,_0x2b26e0){_0x2b26e0=_0x2b26e0||0xc8;return function(_0xa68894){if(_0xa68894){return _0x4b0423[_0x282b('0x2b')](_0x2b26e0)['json'](_0xa68894);}};}function respondWithFilteredResult(_0x4d5468,_0x416c42){return function(_0x3bc5fa){if(_0x3bc5fa){var _0x2c6a44=_0x3bc5fa[_0x282b('0x2d')],_0x3c2820=_0x416c42[_0x282b('0x2e')],_0x291198=_0x416c42[_0x282b('0x2e')]+_0x416c42['limit'],_0x48bca8;if(_0x291198>=_0x2c6a44){_0x291198=_0x2c6a44;_0x48bca8=0xc8;}else{_0x48bca8=0xce;}_0x4d5468[_0x282b('0x2b')](_0x48bca8);return _0x4d5468[_0x282b('0x2f')]('Content-Range',_0x3c2820+'-'+_0x291198+'/'+_0x2c6a44)['json'](_0x3bc5fa);}return null;};}function patchUpdates(_0xbe882b){return function(_0xb33b85){try{jsonpatch['apply'](_0xb33b85,_0xbe882b,!![]);}catch(_0x2e0bb4){return BPromise[_0x282b('0x30')](_0x2e0bb4);}return _0xb33b85[_0x282b('0x31')]();};}function saveUpdates(_0x3274ff,_0x57df27){return function(_0x2098e7){if(_0x2098e7){return _0x2098e7[_0x282b('0x32')](_0x3274ff)[_0x282b('0x33')](function(_0x5198e0){return _0x5198e0;});}return null;};}function removeEntity(_0x28a088,_0x54388f){return function(_0x48ee49){if(_0x48ee49){return _0x48ee49[_0x282b('0x34')]()['then'](function(){_0x28a088[_0x282b('0x2b')](0xcc)[_0x282b('0x2c')]();});}};}function handleEntityNotFound(_0x2e018b,_0xba3f05){return function(_0x1c368d){if(!_0x1c368d){_0x2e018b['sendStatus'](0x194);}return _0x1c368d;};}function handleError(_0x46c895,_0x27115b){_0x27115b=_0x27115b||0x1f4;return function(_0x1a6f8e){logger[_0x282b('0x24')](_0x1a6f8e['stack']);if(_0x1a6f8e['name']){delete _0x1a6f8e[_0x282b('0x35')];}_0x46c895['status'](_0x27115b)[_0x282b('0x36')](_0x1a6f8e);};}exports[_0x282b('0x37')]=function(_0x322d3f,_0x48f53d){var _0xc5bfd1={},_0x52210d={},_0x42a697={'count':0x0,'rows':[]};var _0x122f04=_[_0x282b('0x38')](db[_0x282b('0x39')][_0x282b('0x3a')],function(_0x4ff27f){return{'name':_0x4ff27f[_0x282b('0x3b')],'type':_0x4ff27f[_0x282b('0x3c')][_0x282b('0x3d')]};});_0x52210d[_0x282b('0x3e')]=_[_0x282b('0x38')](_0x122f04,_0x282b('0x35'));_0x52210d[_0x282b('0x3f')]=_['keys'](_0x322d3f['query']);_0x52210d[_0x282b('0x40')]=_[_0x282b('0x41')](_0x52210d[_0x282b('0x3e')],_0x52210d['query']);_0xc5bfd1[_0x282b('0x42')]=_[_0x282b('0x41')](_0x52210d[_0x282b('0x3e')],qs[_0x282b('0x43')](_0x322d3f[_0x282b('0x3f')]['fields']));_0xc5bfd1['attributes']=_0xc5bfd1['attributes'][_0x282b('0x44')]?_0xc5bfd1['attributes']:_0x52210d[_0x282b('0x3e')];if(!_0x322d3f['query']['hasOwnProperty'](_0x282b('0x45'))){_0xc5bfd1['limit']=qs[_0x282b('0x46')](_0x322d3f['query']['limit']);_0xc5bfd1['offset']=qs[_0x282b('0x2e')](_0x322d3f[_0x282b('0x3f')]['offset']);}_0xc5bfd1[_0x282b('0x47')]=qs['sort'](_0x322d3f[_0x282b('0x3f')][_0x282b('0x48')]);_0xc5bfd1[_0x282b('0x49')]=qs[_0x282b('0x40')](_[_0x282b('0x4a')](_0x322d3f[_0x282b('0x3f')],_0x52210d[_0x282b('0x40')]));if(_0x322d3f['query'][_0x282b('0x4b')]){_0xc5bfd1[_0x282b('0x49')]=_[_0x282b('0x4c')](_0xc5bfd1[_0x282b('0x49')],{'$or':_['map'](_0x122f04,function(_0x55b3a8){if(_0x55b3a8[_0x282b('0x3c')]!==_0x282b('0x4d')){var _0x531962={};_0x531962[_0x55b3a8['name']]={'$like':'%'+_0x322d3f[_0x282b('0x3f')][_0x282b('0x4b')]+'%'};return _0x531962;}})});}_0xc5bfd1=_[_0x282b('0x4c')]({},_0xc5bfd1,_0x322d3f[_0x282b('0x4e')]);var _0x441d21={'where':_0xc5bfd1[_0x282b('0x49')]};return db[_0x282b('0x39')][_0x282b('0x2d')](_0x441d21)[_0x282b('0x33')](function(_0x5131d6){_0x42a697[_0x282b('0x2d')]=_0x5131d6;if(_0x322d3f['query'][_0x282b('0x4f')]){_0xc5bfd1[_0x282b('0x50')]=[{'all':!![]}];}return db[_0x282b('0x39')][_0x282b('0x51')](_0xc5bfd1);})[_0x282b('0x33')](function(_0x50b95a){_0x42a697[_0x282b('0x52')]=_0x50b95a;return _0x42a697;})[_0x282b('0x33')](respondWithFilteredResult(_0x48f53d,_0xc5bfd1))['catch'](handleError(_0x48f53d,null));};exports['show']=function(_0x17a943,_0x76a461){var _0x52a471={'raw':!![],'where':{'id':_0x17a943[_0x282b('0x53')]['id']}},_0x5ecb0d={};_0x5ecb0d[_0x282b('0x3e')]=_[_0x282b('0x54')](db[_0x282b('0x39')][_0x282b('0x3a')]);_0x5ecb0d['query']=_['keys'](_0x17a943['query']);_0x5ecb0d['filters']=_[_0x282b('0x41')](_0x5ecb0d[_0x282b('0x3e')],_0x5ecb0d[_0x282b('0x3f')]);_0x52a471[_0x282b('0x42')]=_[_0x282b('0x41')](_0x5ecb0d['model'],qs['fields'](_0x17a943[_0x282b('0x3f')][_0x282b('0x43')]));_0x52a471['attributes']=_0x52a471['attributes']['length']?_0x52a471[_0x282b('0x42')]:_0x5ecb0d[_0x282b('0x3e')];if(_0x17a943['query'][_0x282b('0x4f')]){_0x52a471[_0x282b('0x50')]=[{'all':!![]}];}_0x52a471=_[_0x282b('0x4c')]({},_0x52a471,_0x17a943[_0x282b('0x4e')]);return db[_0x282b('0x39')][_0x282b('0x55')](_0x52a471)[_0x282b('0x33')](handleEntityNotFound(_0x76a461,null))[_0x282b('0x33')](respondWithResult(_0x76a461,null))[_0x282b('0x56')](handleError(_0x76a461,null));};exports[_0x282b('0x57')]=function(_0x18fbe8,_0x1e3d7d){return db['ChatGroup'][_0x282b('0x57')](_0x18fbe8[_0x282b('0x58')],{})[_0x282b('0x33')](respondWithResult(_0x1e3d7d,0xc9))[_0x282b('0x56')](handleError(_0x1e3d7d,null));};exports['update']=function(_0x5dd017,_0x29a149){if(_0x5dd017[_0x282b('0x58')]['id']){delete _0x5dd017[_0x282b('0x58')]['id'];}return db['ChatGroup'][_0x282b('0x55')]({'where':{'id':_0x5dd017[_0x282b('0x53')]['id']}})[_0x282b('0x33')](handleEntityNotFound(_0x29a149,null))['then'](saveUpdates(_0x5dd017[_0x282b('0x58')],null))[_0x282b('0x33')](respondWithResult(_0x29a149,null))[_0x282b('0x56')](handleError(_0x29a149,null));};exports[_0x282b('0x34')]=function(_0x37ab16,_0x1f63fe){return db['ChatGroup'][_0x282b('0x55')]({'where':{'id':_0x37ab16[_0x282b('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f63fe,null))['then'](removeEntity(_0x1f63fe,null))['catch'](handleError(_0x1f63fe,null));};exports['describe']=function(_0xe7893f,_0x2fac69){return db[_0x282b('0x39')][_0x282b('0x59')]()['then'](respondWithResult(_0x2fac69,null))[_0x282b('0x56')](handleError(_0x2fac69,null));};exports[_0x282b('0x5a')]=function(_0x1d7c17,_0x4e6c0,_0x1e073c){return db[_0x282b('0x5b')][_0x282b('0x2d')]({'where':{'ChatGroupId':_0x1d7c17[_0x282b('0x53')]['id'],'ToId':_0x1d7c17[_0x282b('0x5c')]['id'],'read':![]}})[_0x282b('0x33')](function(_0x151a08){return{'id':_[_0x282b('0x5d')](_0x1d7c17['params']['id']),'count':_0x151a08};})['then'](respondWithResult(_0x4e6c0,null))[_0x282b('0x56')](handleError(_0x4e6c0,null));};exports[_0x282b('0x5e')]=function(_0x536166,_0x39d41e,_0x28354a){return db[_0x282b('0x39')][_0x282b('0x55')]({'where':{'id':_0x536166[_0x282b('0x53')]['id']}})[_0x282b('0x33')](handleEntityNotFound(_0x39d41e,null))[_0x282b('0x33')](function(_0x4bdbf3){if(_0x4bdbf3){return _0x4bdbf3[_0x282b('0x5e')](_0x536166[_0x282b('0x58')][_0x282b('0x5f')],_['omit'](_0x536166[_0x282b('0x58')],[_0x282b('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x39d41e,null))['catch'](handleError(_0x39d41e,null));};exports[_0x282b('0x60')]=function(_0x2aa85f,_0x3e38c4,_0x140f9e){var _0xaa9803={};var _0x56e7dc={};var _0x18fc66;var _0x310107;return db[_0x282b('0x39')][_0x282b('0x61')]({'where':{'id':_0x2aa85f['params']['id']}})[_0x282b('0x33')](handleEntityNotFound(_0x3e38c4,null))['then'](function(_0x4fa1d9){if(_0x4fa1d9){_0x18fc66=_0x4fa1d9;_0x56e7dc[_0x282b('0x3e')]=_['keys'](db[_0x282b('0x62')]['rawAttributes']);_0x56e7dc[_0x282b('0x3f')]=_[_0x282b('0x54')](_0x2aa85f[_0x282b('0x3f')]);_0x56e7dc['filters']=_[_0x282b('0x41')](_0x56e7dc[_0x282b('0x3e')],_0x56e7dc['query']);_0xaa9803[_0x282b('0x42')]=_[_0x282b('0x41')](_0x56e7dc[_0x282b('0x3e')],qs[_0x282b('0x43')](_0x2aa85f[_0x282b('0x3f')][_0x282b('0x43')]));_0xaa9803[_0x282b('0x42')]=_0xaa9803['attributes'][_0x282b('0x44')]?_0xaa9803['attributes']:_0x56e7dc[_0x282b('0x3e')];_0xaa9803[_0x282b('0x47')]=qs[_0x282b('0x48')](_0x2aa85f[_0x282b('0x3f')][_0x282b('0x48')]);_0xaa9803['where']=qs[_0x282b('0x40')](_[_0x282b('0x4a')](_0x2aa85f['query'],_0x56e7dc[_0x282b('0x40')]));if(_0x2aa85f[_0x282b('0x3f')][_0x282b('0x4b')]){_0xaa9803['where']=_['merge'](_0xaa9803[_0x282b('0x49')],{'$or':_[_0x282b('0x38')](_0xaa9803['attributes'],function(_0x2eb2a0){var _0x3ad0ab={};_0x3ad0ab[_0x2eb2a0]={'$like':'%'+_0x2aa85f['query'][_0x282b('0x4b')]+'%'};return _0x3ad0ab;})});}_0xaa9803=_['merge']({},_0xaa9803,_0x2aa85f[_0x282b('0x4e')]);return _0x18fc66[_0x282b('0x60')](_0xaa9803);}})[_0x282b('0x33')](function(_0x4a41fa){if(_0x4a41fa){_0x310107=_0x4a41fa['length'];if(!_0x2aa85f[_0x282b('0x3f')][_0x282b('0x63')](_0x282b('0x45'))){_0xaa9803[_0x282b('0x46')]=qs[_0x282b('0x46')](_0x2aa85f['query']['limit']);_0xaa9803[_0x282b('0x2e')]=qs[_0x282b('0x2e')](_0x2aa85f[_0x282b('0x3f')][_0x282b('0x2e')]);}return _0x18fc66['getMembers'](_0xaa9803);}})[_0x282b('0x33')](function(_0x53c956){if(_0x53c956){return _0x53c956?{'count':_0x310107,'rows':_0x53c956}:null;}})[_0x282b('0x33')](respondWithResult(_0x3e38c4,null))['catch'](handleError(_0x3e38c4,null));};exports[_0x282b('0x64')]=function(_0x2ae7fb,_0x31feab,_0x2a10e0){return db[_0x282b('0x39')][_0x282b('0x55')]({'where':{'id':_0x2ae7fb['params']['id']}})[_0x282b('0x33')](handleEntityNotFound(_0x31feab,null))[_0x282b('0x33')](function(_0x22e135){if(_0x22e135){return _0x22e135[_0x282b('0x64')](_0x2ae7fb[_0x282b('0x3f')][_0x282b('0x5f')]);}})[_0x282b('0x33')](respondWithStatusCode(_0x31feab,null))['catch'](handleError(_0x31feab,null));};exports[_0x282b('0x65')]=function(_0x3a8cba,_0x991f2d,_0x5ae268){if(_0x3a8cba['body']['id']){delete _0x3a8cba['body']['id'];}return db[_0x282b('0x39')][_0x282b('0x55')]({'where':{'id':_0x3a8cba[_0x282b('0x53')]['id']}})[_0x282b('0x33')](handleEntityNotFound(_0x991f2d,null))['then'](function(_0x37d0d1){if(_0x37d0d1){_0x3a8cba['body'][_0x282b('0x66')]=_0x37d0d1['id'];return db['ChatInternalMessage'][_0x282b('0x57')](_0x3a8cba[_0x282b('0x58')]);}})[_0x282b('0x33')](respondWithResult(_0x991f2d,null))['catch'](handleError(_0x991f2d,null));};exports[_0x282b('0x67')]=function(_0x4060a4,_0x53a085,_0x52c567){var _0x41cab6={};var _0x2e29e5={};var _0x14c402;var _0x5d990a;return db[_0x282b('0x39')][_0x282b('0x61')]({'where':{'id':_0x4060a4[_0x282b('0x53')]['id']}})['then'](handleEntityNotFound(_0x53a085,null))[_0x282b('0x33')](function(_0x2f6353){if(_0x2f6353){_0x14c402=_0x2f6353;_0x2e29e5[_0x282b('0x3e')]=_[_0x282b('0x54')](db[_0x282b('0x5b')][_0x282b('0x3a')]);_0x2e29e5[_0x282b('0x3f')]=_[_0x282b('0x54')](_0x4060a4[_0x282b('0x3f')]);_0x2e29e5['filters']=_[_0x282b('0x41')](_0x2e29e5[_0x282b('0x3e')],_0x2e29e5['query']);_0x41cab6[_0x282b('0x42')]=_[_0x282b('0x41')](_0x2e29e5[_0x282b('0x3e')],qs[_0x282b('0x43')](_0x4060a4[_0x282b('0x3f')][_0x282b('0x43')]));_0x41cab6[_0x282b('0x42')]=_0x41cab6[_0x282b('0x42')][_0x282b('0x44')]?_0x41cab6['attributes']:_0x2e29e5['model'];_0x41cab6[_0x282b('0x47')]=qs[_0x282b('0x48')](_0x4060a4[_0x282b('0x3f')]['sort']);_0x41cab6[_0x282b('0x49')]=qs[_0x282b('0x40')](_['pick'](_0x4060a4[_0x282b('0x3f')],_0x2e29e5['filters']));if(_0x4060a4[_0x282b('0x3f')][_0x282b('0x4b')]){_0x41cab6[_0x282b('0x49')]=_[_0x282b('0x4c')](_0x41cab6[_0x282b('0x49')],{'$or':_['map'](_0x41cab6[_0x282b('0x42')],function(_0x33d5fe){var _0x1a50e4={};_0x1a50e4[_0x33d5fe]={'$like':'%'+_0x4060a4[_0x282b('0x3f')][_0x282b('0x4b')]+'%'};return _0x1a50e4;})});}if(_0x4060a4[_0x282b('0x3f')][_0x282b('0x68')]){var _0x5bb810=_0x4060a4[_0x282b('0x3f')][_0x282b('0x68')][_0x282b('0x69')](',');var _0x10f3d2={};_0x10f3d2[_0x5bb810[0x0]]={'$gte':moment(_0x5bb810[0x1])[_0x282b('0x6a')](_0x282b('0x6b'))};_0x41cab6[_0x282b('0x49')]=_[_0x282b('0x4c')](_0x41cab6[_0x282b('0x49')],_0x10f3d2);}_0x41cab6=_[_0x282b('0x4c')]({},_0x41cab6,_0x4060a4[_0x282b('0x4e')]);return _0x14c402['getMessages'](_0x41cab6);}})[_0x282b('0x33')](function(_0x55f7c4){if(_0x55f7c4){_0x5d990a=_0x55f7c4['length'];if(!_0x4060a4[_0x282b('0x3f')][_0x282b('0x63')](_0x282b('0x45'))){_0x41cab6[_0x282b('0x46')]=qs[_0x282b('0x46')](_0x4060a4[_0x282b('0x3f')][_0x282b('0x46')]);_0x41cab6['offset']=qs[_0x282b('0x2e')](_0x4060a4[_0x282b('0x3f')][_0x282b('0x2e')]);}return _0x14c402[_0x282b('0x67')](_0x41cab6);}})[_0x282b('0x33')](function(_0x3f4fc8){if(_0x3f4fc8){return _0x3f4fc8?{'count':_0x5d990a,'rows':_0x3f4fc8}:null;}})['then'](respondWithResult(_0x53a085,null))[_0x282b('0x56')](handleError(_0x53a085,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 2c7694d..66e7ef7 100644 --- a/server/api/chatGroup/chatGroup.events.js +++ b/server/api/chatGroup/chatGroup.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0xadb5,0xad));var _0x5adb=function(_0x11cdec,_0x595f8d){_0x11cdec=_0x11cdec-0x0;var _0x2a4ff5=_0xadb5[_0x11cdec];return _0x2a4ff5;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0xadb5,0xad));var _0x5adb=function(_0x24f8f7,_0x243a1a){_0x24f8f7=_0x24f8f7-0x0;var _0x5b3183=_0xadb5[_0x24f8f7];return _0x5b3183;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 9594191..6aa3cd0 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 _0xf13b=['chat_groups','lodash','moment','bluebird','request-promise','path','./chatGroup.attributes','exports','define'];(function(_0x1634a2,_0x119611){var _0x58578d=function(_0x2321f3){while(--_0x2321f3){_0x1634a2['push'](_0x1634a2['shift']());}};_0x58578d(++_0x119611);}(_0xf13b,0x1f0));var _0xbf13=function(_0x1b54ae,_0x5ce3d7){_0x1b54ae=_0x1b54ae-0x0;var _0x925c35=_0xf13b[_0x1b54ae];return _0x925c35;};'use strict';var _=require(_0xbf13('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbf13('0x1'));var BPromise=require(_0xbf13('0x2'));var rp=require(_0xbf13('0x3'));var fs=require('fs');var path=require(_0xbf13('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbf13('0x5'));module[_0xbf13('0x6')]=function(_0x5f4b13,_0x325b03){return _0x5f4b13[_0xbf13('0x7')]('ChatGroup',attributes,{'tableName':_0xbf13('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d4e=['exports','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0d4e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe0d4('0x0'));var util=require(_0xe0d4('0x1'));var logger=require(_0xe0d4('0x2'))(_0xe0d4('0x3'));var moment=require(_0xe0d4('0x4'));var BPromise=require(_0xe0d4('0x5'));var rp=require(_0xe0d4('0x6'));var fs=require('fs');var path=require(_0xe0d4('0x7'));var rimraf=require(_0xe0d4('0x8'));var config=require('../../config/environment');var attributes=require(_0xe0d4('0x9'));module[_0xe0d4('0xa')]=function(_0x2cc782,_0x25bdbe){return _0x2cc782['define']('ChatGroup',attributes,{'tableName':_0xe0d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index ab68801..ee8ac93 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 _0x33c0=['stringify','error','code','message','info','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x54941f,_0x4bde75){var _0x3e359e=function(_0x5d619b){while(--_0x5d619b){_0x54941f['push'](_0x54941f['shift']());}};_0x3e359e(++_0x4bde75);}(_0x33c0,0x19d));var _0x033c=function(_0x4a76b2,_0x9830ea){_0x4a76b2=_0x4a76b2-0x0;var _0x4d834d=_0x33c0[_0x4a76b2];return _0x4d834d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x033c('0x0'));var rs=require(_0x033c('0x1'));var fs=require('fs');var Redis=require(_0x033c('0x2'));var db=require(_0x033c('0x3'))['db'];var utils=require(_0x033c('0x4'));var logger=require(_0x033c('0x5'))(_0x033c('0x6'));var config=require(_0x033c('0x7'));var jayson=require(_0x033c('0x8'));var client=jayson[_0x033c('0x9')][_0x033c('0xa')]({'port':0x232a});config[_0x033c('0xb')]=_[_0x033c('0xc')](config['redis'],{'host':_0x033c('0xd'),'port':0x18eb});var socket=require(_0x033c('0xe'))(new Redis(config[_0x033c('0xb')]));require(_0x033c('0xf'))[_0x033c('0x10')](socket);function respondWithRpcPromise(_0x4eac1b,_0x4f9c63,_0x3f9ca5){return new BPromise(function(_0x5b761a,_0x10cc57){return client[_0x033c('0x11')](_0x4eac1b,_0x3f9ca5)[_0x033c('0x12')](function(_0x190122){logger['info'](_0x033c('0x13'),_0x4f9c63,_0x033c('0x14'));logger['debug'](_0x033c('0x15'),_0x4f9c63,'request\x20sent',JSON[_0x033c('0x16')](_0x190122));if(_0x190122['error']){if(_0x190122[_0x033c('0x17')][_0x033c('0x18')]===0x1f4){logger[_0x033c('0x17')](_0x033c('0x13'),_0x4f9c63,_0x190122[_0x033c('0x17')][_0x033c('0x19')]);return _0x10cc57(_0x190122[_0x033c('0x17')][_0x033c('0x19')]);}logger[_0x033c('0x17')](_0x033c('0x13'),_0x4f9c63,_0x190122[_0x033c('0x17')][_0x033c('0x19')]);return _0x5b761a(_0x190122[_0x033c('0x17')][_0x033c('0x19')]);}else{logger[_0x033c('0x1a')]('ChatGroup,\x20%s,\x20%s',_0x4f9c63,_0x033c('0x14'));_0x5b761a(_0x190122[_0x033c('0x1b')][_0x033c('0x19')]);}})[_0x033c('0x1c')](function(_0x20de50){logger[_0x033c('0x17')](_0x033c('0x13'),_0x4f9c63,_0x20de50);_0x10cc57(_0x20de50);});});} \ No newline at end of file +var _0xf9db=['socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0xb810ca,_0x5cccfa){var _0x509874=function(_0x373280){while(--_0x373280){_0xb810ca['push'](_0xb810ca['shift']());}};_0x509874(++_0x5cccfa);}(_0xf9db,0xd0));var _0xbf9d=function(_0xbf8095,_0x2b3908){_0xbf8095=_0xbf8095-0x0;var _0x556f85=_0xf9db[_0xbf8095];return _0x556f85;};'use strict';var _=require('lodash');var util=require(_0xbf9d('0x0'));var moment=require(_0xbf9d('0x1'));var BPromise=require(_0xbf9d('0x2'));var rs=require(_0xbf9d('0x3'));var fs=require('fs');var Redis=require(_0xbf9d('0x4'));var db=require(_0xbf9d('0x5'))['db'];var utils=require(_0xbf9d('0x6'));var logger=require(_0xbf9d('0x7'))(_0xbf9d('0x8'));var config=require(_0xbf9d('0x9'));var jayson=require(_0xbf9d('0xa'));var client=jayson[_0xbf9d('0xb')][_0xbf9d('0xc')]({'port':0x232a});config[_0xbf9d('0xd')]=_[_0xbf9d('0xe')](config[_0xbf9d('0xd')],{'host':_0xbf9d('0xf'),'port':0x18eb});var socket=require(_0xbf9d('0x10'))(new Redis(config[_0xbf9d('0xd')]));require('./chatGroup.socket')[_0xbf9d('0x11')](socket);function respondWithRpcPromise(_0x18607e,_0x196dc3,_0x1b2a78){return new BPromise(function(_0x23a85e,_0x45c776){return client['request'](_0x18607e,_0x1b2a78)[_0xbf9d('0x12')](function(_0x28ebc7){logger[_0xbf9d('0x13')](_0xbf9d('0x14'),_0x196dc3,_0xbf9d('0x15'));logger[_0xbf9d('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x196dc3,'request\x20sent',JSON['stringify'](_0x28ebc7));if(_0x28ebc7[_0xbf9d('0x17')]){if(_0x28ebc7['error'][_0xbf9d('0x18')]===0x1f4){logger[_0xbf9d('0x17')](_0xbf9d('0x14'),_0x196dc3,_0x28ebc7[_0xbf9d('0x17')][_0xbf9d('0x19')]);return _0x45c776(_0x28ebc7['error'][_0xbf9d('0x19')]);}logger['error'](_0xbf9d('0x14'),_0x196dc3,_0x28ebc7[_0xbf9d('0x17')]['message']);return _0x23a85e(_0x28ebc7[_0xbf9d('0x17')][_0xbf9d('0x19')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x196dc3,_0xbf9d('0x15'));_0x23a85e(_0x28ebc7[_0xbf9d('0x1a')][_0xbf9d('0x19')]);}})[_0xbf9d('0x1b')](function(_0x3c7bad){logger[_0xbf9d('0x17')](_0xbf9d('0x14'),_0x196dc3,_0x3c7bad);_0x45c776(_0x3c7bad);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 1b58fa0..e9add1e 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 _0x710f=['save','remove','emit','removeListener','register','chatGroup:'];(function(_0x496d37,_0x3a9f36){var _0x3b1930=function(_0x13b752){while(--_0x13b752){_0x496d37['push'](_0x496d37['shift']());}};_0x3b1930(++_0x3a9f36);}(_0x710f,0x144));var _0xf710=function(_0x443e10,_0x4bb314){_0x443e10=_0x443e10-0x0;var _0x42f005=_0x710f[_0x443e10];return _0x42f005;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xf710('0x0'),_0xf710('0x1'),'update'];function createListener(_0x12a3da,_0x3fe253){return function(_0x449149){_0x3fe253[_0xf710('0x2')](_0x12a3da,_0x449149);};}function removeListener(_0x21fe2e,_0x2bc4cb){return function(){ChatGroupEvents[_0xf710('0x3')](_0x21fe2e,_0x2bc4cb);};}exports[_0xf710('0x4')]=function(_0x4032f0){for(var _0x5f27a7=0x0,_0x1dafab=events['length'];_0x5f27a7<_0x1dafab;_0x5f27a7++){var _0x559727=events[_0x5f27a7];var _0x46e9f6=createListener(_0xf710('0x5')+_0x559727,_0x4032f0);ChatGroupEvents['on'](_0x559727,_0x46e9f6);}}; \ No newline at end of file +var _0xb77e=['removeListener','length','chatGroup:','./chatGroup.events','save','remove','emit'];(function(_0x400b43,_0x55da4e){var _0x3c330f=function(_0x5bbd52){while(--_0x5bbd52){_0x400b43['push'](_0x400b43['shift']());}};_0x3c330f(++_0x55da4e);}(_0xb77e,0x1df));var _0xeb77=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xb77e[_0x6cf19c];return _0xce14f3;};'use strict';var ChatGroupEvents=require(_0xeb77('0x0'));var events=[_0xeb77('0x1'),_0xeb77('0x2'),'update'];function createListener(_0x6f2eb5,_0x46496a){return function(_0x2457eb){_0x46496a[_0xeb77('0x3')](_0x6f2eb5,_0x2457eb);};}function removeListener(_0x4738a2,_0x451432){return function(){ChatGroupEvents[_0xeb77('0x4')](_0x4738a2,_0x451432);};}exports['register']=function(_0x3c0f09){for(var _0x31c808=0x0,_0x4b89ac=events[_0xeb77('0x5')];_0x31c808<_0x4b89ac;_0x31c808++){var _0x149871=events[_0x31c808];var _0x38da2c=createListener(_0xeb77('0x6')+_0x149871,_0x3c0f09);ChatGroupEvents['on'](_0x149871,_0x38da2c);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 4c9d348..3c01b81 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 _0x9edd=['getMembers','getMessages','post','/:id/messages','addMessage','put','update','delete','destroy','removeMembers','exports','connect-timeout','express','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','describe','/:id','/:id/unread','getUnread','/:id/members'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x9edd,0x67));var _0xd9ed=function(_0x2ec37f,_0x10c76e){_0x2ec37f=_0x2ec37f-0x0;var _0xcd4d83=_0x9edd[_0x2ec37f];return _0xcd4d83;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd9ed('0x0'));var express=require(_0xd9ed('0x1'));var router=express['Router']();var auth=require(_0xd9ed('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ed('0x3'));var controller=require(_0xd9ed('0x4'));router[_0xd9ed('0x5')]('/',auth[_0xd9ed('0x6')](),controller['index']);router[_0xd9ed('0x5')]('/describe',auth['isAuthenticated'](),controller[_0xd9ed('0x7')]);router['get'](_0xd9ed('0x8'),auth[_0xd9ed('0x6')](),controller['show']);router[_0xd9ed('0x5')](_0xd9ed('0x9'),auth['isAuthenticated'](),controller[_0xd9ed('0xa')]);router[_0xd9ed('0x5')](_0xd9ed('0xb'),auth[_0xd9ed('0x6')](),controller[_0xd9ed('0xc')]);router[_0xd9ed('0x5')]('/:id/messages',auth[_0xd9ed('0x6')](),controller[_0xd9ed('0xd')]);router[_0xd9ed('0xe')]('/',auth[_0xd9ed('0x6')](),controller['create']);router['post'](_0xd9ed('0xb'),auth['isAuthenticated'](),controller['addMembers']);router['post'](_0xd9ed('0xf'),auth[_0xd9ed('0x6')](),controller[_0xd9ed('0x10')]);router[_0xd9ed('0x11')](_0xd9ed('0x8'),auth[_0xd9ed('0x6')](),controller[_0xd9ed('0x12')]);router[_0xd9ed('0x13')]('/:id',auth[_0xd9ed('0x6')](),controller[_0xd9ed('0x14')]);router['delete'](_0xd9ed('0xb'),auth['isAuthenticated'](),controller[_0xd9ed('0x15')]);module[_0xd9ed('0x16')]=router; \ No newline at end of file +var _0x6044=['destroy','removeMembers','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/:id','show','/:id/unread','getUnread','getMembers','post','create','/:id/members','/:id/messages','addMessage','update','delete'];(function(_0x53823a,_0x9dfbd3){var _0x51012a=function(_0x1ed0c7){while(--_0x1ed0c7){_0x53823a['push'](_0x53823a['shift']());}};_0x51012a(++_0x9dfbd3);}(_0x6044,0x1c5));var _0x4604=function(_0x8e36d0,_0x4627c0){_0x8e36d0=_0x8e36d0-0x0;var _0x1ad22c=_0x6044[_0x8e36d0];return _0x1ad22c;};'use strict';var multer=require('multer');var util=require(_0x4604('0x0'));var path=require('path');var timeout=require(_0x4604('0x1'));var express=require(_0x4604('0x2'));var router=express[_0x4604('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4604('0x4'));var config=require(_0x4604('0x5'));var controller=require(_0x4604('0x6'));router[_0x4604('0x7')]('/',auth[_0x4604('0x8')](),controller[_0x4604('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x4604('0x7')](_0x4604('0xa'),auth[_0x4604('0x8')](),controller[_0x4604('0xb')]);router[_0x4604('0x7')](_0x4604('0xc'),auth[_0x4604('0x8')](),controller[_0x4604('0xd')]);router[_0x4604('0x7')]('/:id/members',auth[_0x4604('0x8')](),controller[_0x4604('0xe')]);router[_0x4604('0x7')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x4604('0xf')]('/',auth[_0x4604('0x8')](),controller[_0x4604('0x10')]);router[_0x4604('0xf')](_0x4604('0x11'),auth[_0x4604('0x8')](),controller['addMembers']);router[_0x4604('0xf')](_0x4604('0x12'),auth['isAuthenticated'](),controller[_0x4604('0x13')]);router['put']('/:id',auth[_0x4604('0x8')](),controller[_0x4604('0x14')]);router[_0x4604('0x15')](_0x4604('0xa'),auth[_0x4604('0x8')](),controller[_0x4604('0x16')]);router[_0x4604('0x15')](_0x4604('0x11'),auth[_0x4604('0x8')](),controller[_0x4604('0x17')]);module[_0x4604('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 1a2823e..a673adb 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 _0xd608=['DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x4702a5,_0x207f12){var _0x10a5de=function(_0x4e65c2){while(--_0x4e65c2){_0x4702a5['push'](_0x4702a5['shift']());}};_0x10a5de(++_0x207f12);}(_0xd608,0xa7));var _0x8d60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd608[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x8d60('0x0'));module[_0x8d60('0x1')]={'closed':{'type':Sequelize[_0x8d60('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8d60('0x3')]},'ratingType':{'type':Sequelize[_0x8d60('0x4')](_0x8d60('0x5'),_0x8d60('0x6')),'defaultValue':_0x8d60('0x5')},'ratingMessage':{'type':Sequelize[_0x8d60('0x7')]},'pathTranscript':{'type':Sequelize[_0x8d60('0x7')]},'mailTranscript':{'type':Sequelize[_0x8d60('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8d60('0x8')]},'note':{'type':Sequelize[_0x8d60('0x8')]},'browserName':{'type':Sequelize[_0x8d60('0x8')]},'browserVersion':{'type':Sequelize[_0x8d60('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x8d60('0x8')]},'deviceVendor':{'type':Sequelize[_0x8d60('0x8')]},'deviceType':{'type':Sequelize[_0x8d60('0x8')]},'referer':{'type':Sequelize[_0x8d60('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x8d60('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x8d60('0x9')]},'lastMsgAt':{'type':Sequelize[_0x8d60('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8d60('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8d60('0x8')]},'customerPort':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcad6=['sequelize','exports','ENUM','star','thumb','TEXT','STRING','long','DATE','out'];(function(_0x50cfdf,_0xbfc861){var _0x449896=function(_0x106946){while(--_0x106946){_0x50cfdf['push'](_0x50cfdf['shift']());}};_0x449896(++_0xbfc861);}(_0xcad6,0x1b8));var _0x6cad=function(_0x3183c3,_0x424eb7){_0x3183c3=_0x3183c3-0x0;var _0x81552f=_0xcad6[_0x3183c3];return _0x81552f;};'use strict';var Sequelize=require(_0x6cad('0x0'));module[_0x6cad('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x6cad('0x2')](_0x6cad('0x3'),_0x6cad('0x4')),'defaultValue':_0x6cad('0x3')},'ratingMessage':{'type':Sequelize[_0x6cad('0x5')]},'pathTranscript':{'type':Sequelize[_0x6cad('0x5')]},'mailTranscript':{'type':Sequelize[_0x6cad('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6cad('0x6')]},'note':{'type':Sequelize[_0x6cad('0x6')]},'browserName':{'type':Sequelize[_0x6cad('0x6')]},'browserVersion':{'type':Sequelize[_0x6cad('0x6')]},'osName':{'type':Sequelize[_0x6cad('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x6cad('0x6')]},'deviceVendor':{'type':Sequelize[_0x6cad('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x6cad('0x5')]},'customerIp':{'type':Sequelize[_0x6cad('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x6cad('0x7'))},'read1stAt':{'type':Sequelize[_0x6cad('0x8')]},'lastMsgAt':{'type':Sequelize[_0x6cad('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x6cad('0x2')]('in',_0x6cad('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6cad('0x6')]},'customerPort':{'type':Sequelize[_0x6cad('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 4bda74c..f13bece 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 _0xc949=['format','transcript-%s.txt','now','pathTranscript','ChatWebsite','CmContact','agentAlias','System','%s%d','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','sendMail','ChatMessage','addMessage','omit','ids','getMessages','hasOwnProperty','filter','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','addTags','setTags','spread','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Messages','Account','Owner','mkdirSync','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
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','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\x0a\x20\x20\x20\x20\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%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\x0a\x20\x20\x20\x20\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{{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\x0a\x20\x20\x20\x20\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%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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','YYYY-MM-DD','Chat','N.A.','closedAt','browserName','referer','customerIp','customerPort','tail','basename','existsSync','createReadStream','createWriteStream','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','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','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','limit','reject','update','then','destroy','stack','name','send','Users','map','fullname','TagIds','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','journey','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','count','sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','includeAll','include','merge','options','create','params','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Sequelize','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','download','join','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/'];(function(_0x22bee0,_0x412ecb){var _0x2d295b=function(_0x59d4b5){while(--_0x59d4b5){_0x22bee0['push'](_0x22bee0['shift']());}};_0x2d295b(++_0x412ecb);}(_0xc949,0x181));var _0x9c94=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xc949[_0x297fd3];return _0x2af381;};'use strict';var pdf=require(_0x9c94('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9c94('0x1'));var zipdir=require(_0x9c94('0x2'));var jsonpatch=require(_0x9c94('0x3'));var rp=require(_0x9c94('0x4'));var moment=require('moment');var BPromise=require(_0x9c94('0x5'));var Mustache=require(_0x9c94('0x6'));var util=require('util');var path=require(_0x9c94('0x7'));var sox=require(_0x9c94('0x8'));var csv=require(_0x9c94('0x9'));var ejs=require(_0x9c94('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9c94('0xb'));var crypto=require(_0x9c94('0xc'));var jsforce=require(_0x9c94('0xd'));var deskjs=require(_0x9c94('0xe'));var toCsv=require(_0x9c94('0x9'));var querystring=require(_0x9c94('0xf'));var Papa=require(_0x9c94('0x10'));var Redis=require(_0x9c94('0x11'));var authService=require(_0x9c94('0x12'));var qs=require(_0x9c94('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c94('0x14'));var logger=require(_0x9c94('0x15'))(_0x9c94('0x16'));var utils=require(_0x9c94('0x17'));var config=require(_0x9c94('0x18'));var db=require(_0x9c94('0x19'))['db'];config[_0x9c94('0x1a')]=_[_0x9c94('0x1b')](config[_0x9c94('0x1a')],{'host':_0x9c94('0x1c'),'port':0x18eb});var socket=require(_0x9c94('0x1d'))(new Redis(config[_0x9c94('0x1a')]));require(_0x9c94('0x1e'))[_0x9c94('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9c94('0x20')]['http']({'port':0x232b});var client9004=jayson[_0x9c94('0x20')][_0x9c94('0x21')]({'port':0x232c});function checkPasswordPattern(_0x4f0013,_0xe52641,_0x4d6308){if(_0x4d6308){var _0x56e4e1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56e4e1[_0x9c94('0x22')](_0xe52641)){return _0x4f0013;}else{throw new db['Sequelize'][(_0x9c94('0x23'))](_0x9c94('0x24'));}}else{return _0x4f0013;}}function respondWithRpcPromise(_0x4d9266,_0x201e04,_0x367eed,_0x412804){return new BPromise(function(_0x3b825e,_0x16ef2c){var _0xfbcc7c=_0x412804||client;return _0xfbcc7c[_0x9c94('0x25')](_0x4d9266,_0x367eed)['then'](function(_0x2c9736){logger[_0x9c94('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x201e04,_0x9c94('0x27'));logger[_0x9c94('0x28')](_0x9c94('0x29'),_0x201e04,_0x9c94('0x27'),JSON[_0x9c94('0x2a')](_0x2c9736));if(_0x2c9736[_0x9c94('0x2b')]){if(_0x2c9736[_0x9c94('0x2b')][_0x9c94('0x2c')]===0x1f4){logger[_0x9c94('0x2b')](_0x9c94('0x2d'),_0x201e04,_0x2c9736[_0x9c94('0x2b')][_0x9c94('0x2e')]);return _0x16ef2c(_0x2c9736[_0x9c94('0x2b')][_0x9c94('0x2e')]);}logger['error'](_0x9c94('0x2d'),_0x201e04,_0x2c9736[_0x9c94('0x2b')]['message']);return _0x3b825e(_0x2c9736[_0x9c94('0x2b')][_0x9c94('0x2e')]);}else{logger[_0x9c94('0x26')](_0x9c94('0x2d'),_0x201e04,_0x9c94('0x27'));_0x3b825e(_0x2c9736['result'][_0x9c94('0x2e')]);}})[_0x9c94('0x2f')](function(_0x58ac08){logger[_0x9c94('0x2b')]('ChatInteraction,\x20%s,\x20%s',_0x201e04,_0x58ac08);_0x16ef2c(_0x58ac08);});});}function respondWithStatusCode(_0xa5df6f,_0x14d41b){_0x14d41b=_0x14d41b||0xcc;return function(_0x330bd4){if(_0x330bd4){return _0xa5df6f[_0x9c94('0x30')](_0x14d41b);}return _0xa5df6f[_0x9c94('0x31')](_0x14d41b)[_0x9c94('0x32')]();};}function respondWithResult(_0xf30dd1,_0x561fdc){_0x561fdc=_0x561fdc||0xc8;return function(_0x5a6b1c){if(_0x5a6b1c){return _0xf30dd1[_0x9c94('0x31')](_0x561fdc)[_0x9c94('0x33')](_0x5a6b1c);}};}function respondWithFilteredResult(_0x1f732b,_0x4d050f){return function(_0x25a6b9){if(_0x25a6b9){var _0x597072=_0x25a6b9['count'],_0x356ee8=_0x4d050f['offset'],_0x4592e5=_0x4d050f[_0x9c94('0x34')]+_0x4d050f[_0x9c94('0x35')],_0x1fd8ab;if(_0x4592e5>=_0x597072){_0x4592e5=_0x597072;_0x1fd8ab=0xc8;}else{_0x1fd8ab=0xce;}_0x1f732b[_0x9c94('0x31')](_0x1fd8ab);return _0x1f732b['set']('Content-Range',_0x356ee8+'-'+_0x4592e5+'/'+_0x597072)['json'](_0x25a6b9);}return null;};}function patchUpdates(_0x4aa5a9){return function(_0x229743){try{jsonpatch['apply'](_0x229743,_0x4aa5a9,!![]);}catch(_0x125bbf){return BPromise[_0x9c94('0x36')](_0x125bbf);}return _0x229743['save']();};}function saveUpdates(_0x5a9f71,_0x2465b5){return function(_0x6b1b1a){if(_0x6b1b1a){return _0x6b1b1a[_0x9c94('0x37')](_0x5a9f71)[_0x9c94('0x38')](function(_0x10a2d9){return _0x10a2d9;});}return null;};}function removeEntity(_0x24c397,_0x265668){return function(_0x6a164d){if(_0x6a164d){return _0x6a164d[_0x9c94('0x39')]()[_0x9c94('0x38')](function(){_0x24c397[_0x9c94('0x31')](0xcc)[_0x9c94('0x32')]();});}};}function handleEntityNotFound(_0x17cc51,_0x28e630){return function(_0x3060e8){if(!_0x3060e8){_0x17cc51[_0x9c94('0x30')](0x194);}return _0x3060e8;};}function handleError(_0x45042c,_0x177850){_0x177850=_0x177850||0x1f4;return function(_0x4eeeb1){logger[_0x9c94('0x2b')](_0x4eeeb1[_0x9c94('0x3a')]);if(_0x4eeeb1[_0x9c94('0x3b')]){delete _0x4eeeb1[_0x9c94('0x3b')];}_0x45042c[_0x9c94('0x31')](_0x177850)[_0x9c94('0x3c')](_0x4eeeb1);};}function getInteractionUsers(_0x13f94c,_0x5c748f){return new BPromise(function(_0x1db11b,_0x591011){try{if(_0x5c748f[_0x13f94c['id']]){_0x13f94c[_0x9c94('0x3d')]=_[_0x9c94('0x3e')](_0x5c748f[_0x13f94c['id']],function(_0x442d46){return{'id':_0x442d46['id'],'fullname':_0x442d46[_0x9c94('0x3f')]};});}}catch(_0x4b2c4e){_0x591011(_0x4b2c4e);}_0x1db11b(_0x13f94c);});}function getInteractionTags(_0x245278,_0x49ca05){return new BPromise(function(_0x29f77b,_0x356766){try{if(_0x245278[_0x9c94('0x40')]){_0x245278['Tags']=[];_0x245278[_0x9c94('0x40')]['split'](',')[_0x9c94('0x41')](function(_0x4e8bf0){_0x245278['Tags'][_0x9c94('0x42')](_0x49ca05[_0x4e8bf0]);});}delete _0x245278[_0x9c94('0x40')];}catch(_0x11c1c0){_0x356766(_0x11c1c0);}_0x29f77b(_0x245278);});}function updateChatInteraction(_0x4684d7,_0x54a931,_0x437910){return new BPromise(function(_0x693ede,_0x425778){return getInteractionUsers(_0x4684d7,_0x437910)[_0x9c94('0x38')](function(_0x57ab57){return getInteractionTags(_0x57ab57,_0x54a931);})[_0x9c94('0x38')](function(_0x365e7e){_0x693ede(_0x365e7e);})['catch'](function(_0x24e74c){_0x425778(_0x24e74c);});});}exports[_0x9c94('0x43')]=function(_0x2a5bd5,_0x5e6a90){var _0x4c42af={},_0x2731c7={},_0x10c5de={'count':0x0,'rows':[]};var _0x3ec2c2=_[_0x9c94('0x3e')](db[_0x9c94('0x44')][_0x9c94('0x45')],function(_0x1b6571){return{'name':_0x1b6571[_0x9c94('0x46')],'type':_0x1b6571[_0x9c94('0x47')][_0x9c94('0x48')]};});_0x2731c7[_0x9c94('0x49')]=_['map'](_0x3ec2c2,_0x9c94('0x3b'));_0x2731c7['query']=_[_0x9c94('0x4a')](_0x2a5bd5[_0x9c94('0x4b')]);_0x2731c7[_0x9c94('0x4c')]=_[_0x9c94('0x4d')](_0x2731c7[_0x9c94('0x49')],_0x2731c7[_0x9c94('0x4b')]);_0x4c42af[_0x9c94('0x4e')]=_['intersection'](_0x2731c7['model'],qs[_0x9c94('0x4f')](_0x2a5bd5[_0x9c94('0x4b')][_0x9c94('0x4f')]));_0x4c42af['attributes']=_0x4c42af[_0x9c94('0x4e')][_0x9c94('0x50')]?_0x4c42af['attributes']:_0x2731c7['model'];if(!_0x2a5bd5['query']['hasOwnProperty'](_0x9c94('0x51'))){_0x4c42af['limit']=qs['limit'](_0x2a5bd5[_0x9c94('0x4b')]['limit']);_0x4c42af[_0x9c94('0x34')]=qs[_0x9c94('0x34')](_0x2a5bd5[_0x9c94('0x4b')][_0x9c94('0x34')]);}_0x4c42af[_0x9c94('0x52')]=qs['sort'](_0x2a5bd5[_0x9c94('0x4b')][_0x9c94('0x53')]);_0x4c42af[_0x9c94('0x54')]=qs[_0x9c94('0x4c')](_[_0x9c94('0x55')](_0x2a5bd5[_0x9c94('0x4b')],_0x2731c7['filters']));var _0x44311e=[];var _0x4935c6=squel[_0x9c94('0x56')]()[_0x9c94('0x57')]('id')[_0x9c94('0x57')]('name')[_0x9c94('0x57')](_0x9c94('0x58'))['from'](_0x9c94('0x59'));var _0x58a683=squel[_0x9c94('0x56')]()[_0x9c94('0x57')]('u.id')['field'](_0x9c94('0x5a'))['field'](_0x9c94('0x5b'))[_0x9c94('0x5c')](_0x9c94('0x5d'),'ui')[_0x9c94('0x5e')]('users','u',_0x9c94('0x5f'));var _0xcb11cf=squel['select']()['from'](_0x9c94('0x60'),'i')[_0x9c94('0x5e')](_0x9c94('0x61'),'c',_0x9c94('0x62'))[_0x9c94('0x5e')](_0x9c94('0x63'),'o','o.id\x20=\x20i.UserId')[_0x9c94('0x5e')](_0x9c94('0x64'),'a',_0x9c94('0x65'))[_0x9c94('0x5e')](_0x9c94('0x66'),'me',_0x9c94('0x67'))['left_join'](_0x9c94('0x68'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x9c94('0x5e')](_0x9c94('0x59'),'t',_0x9c94('0x69'));var _0x5a3189=squel[_0x9c94('0x6a')]();var _0x5213ac=[];var _0x4cfd03=squel[_0x9c94('0x6a')]();var _0x3b88be;if(_0x2a5bd5['query'][_0x9c94('0x6b')]){_0x3b88be=as[_0x9c94('0x6c')](_0x2a5bd5[_0x9c94('0x4b')][_0x9c94('0x6b')]);var _0x1173f3=_0x3b88be[_0x9c94('0x6d')];for(var _0x44d90d=0x0;_0x44d90d<_0x3b88be[_0x9c94('0x6e')][_0x9c94('0x50')];_0x44d90d++){var _0x3403dd=_0x3b88be[_0x9c94('0x6e')][_0x44d90d];var _0x5ddcec='i';var _0x481a11=_[_0x9c94('0x6f')](_0x3ec2c2,[_0x9c94('0x3b'),_0x3403dd['field']]);if(!_0x481a11){switch(_0x3403dd[_0x9c94('0x57')]){case _0x9c94('0x70'):if(_0x3403dd[_0x9c94('0x71')]==0x1){_0xcb11cf[_0x9c94('0x72')]('`'+_0x3403dd[_0x9c94('0x57')]+_0x9c94('0x73'));}else{_0xcb11cf['having']('`'+_0x3403dd['field']+'`\x20>\x200');}break;case _0x9c94('0x74'):if(_0x3403dd['operator']==='$substring'){if(_0x3403dd[_0x9c94('0x71')][_0x9c94('0x75')]('\x20')[_0x9c94('0x50')]>0x1){_0x5a3189[_0x1173f3](_0x9c94('0x76'),qs[_0x9c94('0x77')](_0x3403dd[_0x9c94('0x71')]),null);}else{var _0x49e00e='%'+_0x3403dd[_0x9c94('0x71')]+'%';_0x5a3189[_0x1173f3]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x49e00e,_0x49e00e,_0x49e00e);}}else{_0x481a11=_[_0x9c94('0x6f')](_0x3ec2c2,[_0x9c94('0x3b'),'ContactId']);_0x3403dd[_0x9c94('0x57')]=_0x9c94('0x78');_0x57ba5d=as['buildExpression'](_0x5ddcec,_0x481a11[_0x9c94('0x47')],_0x3403dd);_0x5a3189[_0x1173f3](_0x57ba5d[_0x9c94('0x79')],_0x57ba5d[_0x9c94('0x71')][_0x9c94('0x7a')],_0x57ba5d['value'][_0x9c94('0x32')]);}break;case _0x9c94('0x7b'):var _0x5081c7=_0x3403dd['value'][_0x9c94('0x75')](',')[_0x9c94('0x3e')](function(_0x703779){return Number(_0x703779);});_0x5081c7['forEach'](function(_0x5801ef){_0x4cfd03['or'](_0x9c94('0x7c'),'%,'+_0x5801ef+',%');});_0x5213ac=_[_0x9c94('0x7d')](_0x5213ac,_0x5081c7);break;case _0x9c94('0x7e'):if(_0x3403dd['operator']===_0x9c94('0x7f')){_0x5a3189[_0x1173f3](_0x9c94('0x80'),'%'+_0x3403dd[_0x9c94('0x71')]+'%',null);}else{_0x481a11=_[_0x9c94('0x6f')](_0x3ec2c2,[_0x9c94('0x3b'),_0x9c94('0x81')]);_0x3403dd['field']=_0x9c94('0x81');_0x57ba5d=as[_0x9c94('0x82')](_0x5ddcec,_0x481a11[_0x9c94('0x47')],_0x3403dd);_0x5a3189[_0x1173f3](_0x57ba5d[_0x9c94('0x79')],_0x57ba5d[_0x9c94('0x71')][_0x9c94('0x7a')],_0x57ba5d[_0x9c94('0x71')][_0x9c94('0x32')]);}break;case _0x9c94('0x83'):_0x57ba5d=as[_0x9c94('0x82')]('me',null,_0x3403dd);_0x5a3189[_0x1173f3](_0x57ba5d[_0x9c94('0x79')],_0x57ba5d['value']['start'],_0x57ba5d[_0x9c94('0x71')]['end']);break;}}else{var _0x57ba5d=as['buildExpression'](_0x5ddcec,_0x481a11[_0x9c94('0x47')],_0x3403dd);_0x5a3189[_0x1173f3](_0x57ba5d[_0x9c94('0x79')],_0x57ba5d['value'][_0x9c94('0x7a')],_0x57ba5d[_0x9c94('0x71')][_0x9c94('0x32')]);}}}else{var _0x31e0bf=_(_0x2a5bd5[_0x9c94('0x4b')])['keys']()[_0x9c94('0x3e')](function(_0x4925b4){return _[_0x9c94('0x84')](_0x3ec2c2,[_0x9c94('0x3b'),_0x4925b4])?_0x4925b4:undefined;})[_0x9c94('0x85')]()[_0x9c94('0x71')]();if(!_[_0x9c94('0x86')](_0x31e0bf)){_0x31e0bf[_0x9c94('0x41')](function(_0x2a436f){if(_0x2a436f===_0x9c94('0x87')){_0xcb11cf[_0x9c94('0x54')](_0x9c94('0x88'),[][_0x9c94('0x89')](_0x2a5bd5['query'][_0x2a436f]));}else if(_0x2a436f===_0x9c94('0x8a')){var _0x21939c=JSON[_0x9c94('0x8b')](_0x2a5bd5['query'][_0x2a436f])[_0x9c94('0x8c')];var _0x2ff513=JSON[_0x9c94('0x8b')](_0x2a5bd5[_0x9c94('0x4b')][_0x2a436f])[_0x9c94('0x8d')];_0xcb11cf[_0x9c94('0x54')](_0x9c94('0x8e'),_0x21939c,_0x2ff513);}else{if(_0x2a5bd5['query'][_0x2a436f]===_0x9c94('0x8f')){_0xcb11cf[_0x9c94('0x54')]('i.'+_0x2a436f+_0x9c94('0x90'));}else{_0xcb11cf['where']('i.'+_0x2a436f+_0x9c94('0x91'),_0x2a5bd5[_0x9c94('0x4b')][_0x2a436f]);}}});}if(_0x2a5bd5[_0x9c94('0x4b')][_0x9c94('0x92')]){if(_0x2a5bd5['query'][_0x9c94('0x92')]==0x1){_0xcb11cf[_0x9c94('0x72')](_0x9c94('0x93'));}else{_0xcb11cf[_0x9c94('0x72')](_0x9c94('0x94'));}}if(_0x2a5bd5[_0x9c94('0x4b')]['tag']){_0x5213ac=_['isArray'](_0x2a5bd5[_0x9c94('0x4b')][_0x9c94('0x95')])?_0x2a5bd5[_0x9c94('0x4b')]['tag']:new Array(_0x2a5bd5[_0x9c94('0x4b')][_0x9c94('0x95')]);_0x5213ac[_0x9c94('0x41')](function(_0x5eb9d8){_0x4cfd03['or'](_0x9c94('0x7c'),'%,'+_0x5eb9d8+',%');});}if(_0x2a5bd5['query']['filter']){var _0x3738e6=_0x2a5bd5[_0x9c94('0x4b')]['filter'][_0x9c94('0x96')]('\x5c','\x5c\x5c')[_0x9c94('0x96')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x9c94('0x97')](_0x3738e6)){_0x5a3189['or'](_0x9c94('0x98'),_0x3738e6+'%');}else{_0x5a3189['or'](_0x9c94('0x99'),qs[_0x9c94('0x77')](_0x3738e6))['or'](_0x9c94('0x9a'),_0x3738e6+'%');}}}_0xcb11cf[_0x9c94('0x54')](_0x5a3189);_0xcb11cf[_0x9c94('0x9b')](_0x9c94('0x9c'));var _0xef2276={'type':db['Sequelize'][_0x9c94('0x9d')][_0x9c94('0x9e')],'raw':!![]};var _0x19f93d=_0xcb11cf[_0x9c94('0x9f')]();_0x19f93d[_0x9c94('0x57')]('i.id');_0x19f93d[_0x9c94('0x57')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9c94('0x70'));if(_0x4c42af[_0x9c94('0x52')]){_0x4c42af['order']['forEach'](function(_0xb07100){_0xcb11cf[_0x9c94('0x52')]('i.'+_0xb07100[0x0],_0xb07100[0x1]===_0x9c94('0xa0')?![]:!![]);});}if(!_['isEmpty'](_0x5213ac)){_0xcb11cf['having'](_0x4cfd03);_0x19f93d[_0x9c94('0x54')](_0x9c94('0xa1'),_0x5213ac);}BPromise[_0x9c94('0xa2')]()[_0x9c94('0x38')](function(){if(!_0x3b88be){if(_0x2a5bd5[_0x9c94('0x4b')][_0x9c94('0x87')]||_0x2a5bd5[_0x9c94('0x4b')][_0x9c94('0xa3')])return;_0x19f93d[_0x9c94('0x54')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xcb11cf['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}return _0x2a5bd5['user'][_0x9c94('0xa4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x30ae0c){if(_[_0x9c94('0x86')](_0x30ae0c)){_0x19f93d[_0x9c94('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');_0xcb11cf[_0x9c94('0x54')](_0x9c94('0xa5'));}else{_0x19f93d[_0x9c94('0x54')]('i.ChatWebsiteId\x20IN\x20?',_[_0x9c94('0x3e')](_0x30ae0c,'id'));_0xcb11cf[_0x9c94('0x54')](_0x9c94('0x88'),_[_0x9c94('0x3e')](_0x30ae0c,'id'));}});})[_0x9c94('0x38')](function(){db['sequelize'][_0x9c94('0x4b')](_0x19f93d[_0x9c94('0xa6')](),_0xef2276)[_0x9c94('0x38')](function(_0x3e34a2){_0x10c5de[_0x9c94('0xa7')]=_0x3e34a2[_0x9c94('0x50')];if(_0x10c5de[_0x9c94('0xa7')]===0x0)return[];return db[_0x9c94('0xa8')][_0x9c94('0x4b')](_0x4935c6[_0x9c94('0xa6')](),_0xef2276)['then'](function(_0x568255){_0x44311e=_['keyBy'](_0x568255,'id');_0xef2276=_['merge'](_0xef2276,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2a5bd5[_0x9c94('0x4b')][_0x9c94('0x4f')]){_0x4c42af[_0x9c94('0x4e')][_0x9c94('0x41')](function(_0x45f937){_0xcb11cf[_0x9c94('0x57')]('i.'+_0x45f937);});}else{_0xcb11cf['field'](_0x9c94('0xa9'),_0x9c94('0x70'));_0xcb11cf[_0x9c94('0x57')](_0x9c94('0xaa'),_0x9c94('0xab'));_0xcb11cf['field'](_0x9c94('0xac'),_0x9c94('0xad'));_0xcb11cf[_0x9c94('0x57')](_0x9c94('0xae'));_0xcb11cf[_0x9c94('0x57')]('c.firstName',_0x9c94('0xaf'));_0xcb11cf[_0x9c94('0x57')](_0x9c94('0xb0'),_0x9c94('0xb1'));_0xcb11cf[_0x9c94('0x57')](_0x9c94('0xb2'),_0x9c94('0xb3'));_0xcb11cf[_0x9c94('0x57')]('c.phone','Contact.phone');_0xcb11cf[_0x9c94('0x57')](_0x9c94('0xb4'),'Contact.mobile');_0xcb11cf['field'](_0x9c94('0xb5'),'Contact.fax');_0xcb11cf['field']('o.fullname',_0x9c94('0xb6'));_0xcb11cf['field'](_0x9c94('0xb7'),_0x9c94('0xb8'));_0xcb11cf[_0x9c94('0x57')](_0x9c94('0xb9'),_0x9c94('0x40'));}_0xcb11cf[_0x9c94('0x35')](_0x4c42af['limit']);_0xcb11cf[_0x9c94('0x34')](_0x4c42af[_0x9c94('0x34')]);return db[_0x9c94('0xa8')][_0x9c94('0x4b')](_0xcb11cf[_0x9c94('0xa6')](),_0xef2276);})[_0x9c94('0x38')](function(_0x53dc78){_0x58a683['where'](_0x9c94('0xba'),_[_0x9c94('0x3e')](_0x53dc78,'id'));return db[_0x9c94('0xa8')][_0x9c94('0x4b')](_0x58a683[_0x9c94('0xa6')](),_0xef2276)['then'](function(_0x46c9a2){var _0x4dfc3b=_['groupBy'](_0x46c9a2,_0x9c94('0xbb'));var _0x46eef7=[];_0x53dc78[_0x9c94('0x41')](function(_0xf4ce45){_0x46eef7[_0x9c94('0x42')](updateChatInteraction(_0xf4ce45,_0x44311e,_0x4dfc3b));});return BPromise[_0x9c94('0xbc')](_0x46eef7);});});})[_0x9c94('0x38')](function(_0x2c6d1b){_0x10c5de[_0x9c94('0xbd')]=_0x2c6d1b;return _0x10c5de;})[_0x9c94('0x38')](respondWithFilteredResult(_0x5e6a90,_0x4c42af));})[_0x9c94('0x2f')](handleError(_0x5e6a90,null));};exports[_0x9c94('0xbe')]=function(_0x398f36,_0x1dbd22){var _0x5e6605={'raw':![],'where':{'id':_0x398f36['params']['id']}},_0x4aba8c={};_0x4aba8c[_0x9c94('0x49')]=_[_0x9c94('0x4a')](db[_0x9c94('0x44')][_0x9c94('0x45')]);_0x4aba8c[_0x9c94('0x4b')]=_['keys'](_0x398f36[_0x9c94('0x4b')]);_0x4aba8c[_0x9c94('0x4c')]=_['intersection'](_0x4aba8c[_0x9c94('0x49')],_0x4aba8c[_0x9c94('0x4b')]);_0x5e6605[_0x9c94('0x4e')]=_['intersection'](_0x4aba8c['model'],qs[_0x9c94('0x4f')](_0x398f36[_0x9c94('0x4b')][_0x9c94('0x4f')]));_0x5e6605[_0x9c94('0x4e')]=_0x5e6605[_0x9c94('0x4e')][_0x9c94('0x50')]?_0x5e6605[_0x9c94('0x4e')]:_0x4aba8c['model'];if(_0x398f36[_0x9c94('0x4b')][_0x9c94('0xbf')]){_0x5e6605[_0x9c94('0xc0')]=[{'all':!![]}];}_0x5e6605=_[_0x9c94('0xc1')]({},_0x5e6605,_0x398f36[_0x9c94('0xc2')]);return db[_0x9c94('0x44')][_0x9c94('0x6f')](_0x5e6605)['then'](handleEntityNotFound(_0x1dbd22,null))['then'](respondWithResult(_0x1dbd22,null))[_0x9c94('0x2f')](handleError(_0x1dbd22,null));};exports[_0x9c94('0xc3')]=function(_0x36e32b,_0x3bc49f){return db[_0x9c94('0x44')][_0x9c94('0xc3')](_0x36e32b[_0x9c94('0x83')],{})[_0x9c94('0x38')](respondWithResult(_0x3bc49f,0xc9))[_0x9c94('0x2f')](handleError(_0x3bc49f,null));};exports[_0x9c94('0x37')]=function(_0x4d4723,_0x280c95){if(_0x4d4723[_0x9c94('0x83')]['id']){delete _0x4d4723[_0x9c94('0x83')]['id'];}return db[_0x9c94('0x44')]['find']({'where':{'id':_0x4d4723[_0x9c94('0xc4')]['id']}})[_0x9c94('0x38')](handleEntityNotFound(_0x280c95,null))[_0x9c94('0x38')](saveUpdates(_0x4d4723[_0x9c94('0x83')],null))[_0x9c94('0x38')](respondWithResult(_0x280c95,null))['catch'](handleError(_0x280c95,null));};exports[_0x9c94('0x39')]=function(_0x5afed1,_0x31344c){return db[_0x9c94('0x44')][_0x9c94('0x6f')]({'where':{'id':_0x5afed1[_0x9c94('0xc4')]['id']}})['then'](handleEntityNotFound(_0x31344c,null))[_0x9c94('0x38')](removeEntity(_0x31344c,null))[_0x9c94('0x2f')](handleError(_0x31344c,null));};exports['describe']=function(_0x1331b2,_0x1daa3b){return db[_0x9c94('0x44')]['describe']()[_0x9c94('0x38')](respondWithResult(_0x1daa3b,null))[_0x9c94('0x2f')](handleError(_0x1daa3b,null));};exports['customUpdate']=function(_0x2d8335,_0x5a6cd5){if(_0x2d8335['body']['id']){delete _0x2d8335[_0x9c94('0x83')]['id'];}return db['ChatInteraction'][_0x9c94('0x6f')]({'where':{'id':_0x2d8335[_0x9c94('0xc4')]['id']}})[_0x9c94('0x38')](handleEntityNotFound(_0x5a6cd5,null))[_0x9c94('0x38')](saveUpdates(_0x2d8335['body'],null))[_0x9c94('0x38')](respondWithResult(_0x5a6cd5,null))[_0x9c94('0x2f')](handleError(_0x5a6cd5,null));};exports[_0x9c94('0xc5')]=function(_0x19433c,_0x22ca08,_0x27fca0){if(_0x19433c['body']['id']){delete _0x19433c[_0x9c94('0x83')]['id'];}return db['ChatInteraction'][_0x9c94('0x6f')]({'where':{'id':_0x19433c[_0x9c94('0xc4')]['id']}})[_0x9c94('0x38')](function(_0x4c830d){if(!_0x4c830d){logger[_0x9c94('0x2b')](_0x9c94('0xc6'),'abandon',0x194,_0x9c94('0xc7'));_0x22ca08[_0x9c94('0x30')](0x194);}else{if(_0x4c830d[_0x9c94('0x81')]){throw new db[(_0x9c94('0xc8'))]['ValidationError'](_0x9c94('0xc9'));}}return _0x4c830d;})[_0x9c94('0x38')](function(_0x566c84){if(_0x566c84){return _0x566c84['update']({'closed':_0x19433c[_0x9c94('0x83')][_0x9c94('0xca')],'disposition':_0x19433c['body'][_0x9c94('0xcb')]})[_0x9c94('0x38')](function(_0x503ced){return _0x503ced;});}})[_0x9c94('0x38')](function(_0x1fe57c){return respondWithRpcPromise(_0x9c94('0xcc'),'abandon',_0x19433c[_0x9c94('0x83')],client9004);})[_0x9c94('0x38')](respondWithResult(_0x22ca08,null))[_0x9c94('0x2f')](handleError(_0x22ca08,null));};exports[_0x9c94('0xcd')]=function(_0x52493d,_0x3eec5d,_0x5a1972){_0x52493d[_0x9c94('0x83')][_0x9c94('0x3b')]=_0x52493d[_0x9c94('0xce')][_0x9c94('0xcf')];_0x52493d[_0x9c94('0x83')]['basename']=_0x52493d[_0x9c94('0xce')][_0x9c94('0xd0')];_0x52493d[_0x9c94('0x83')][_0x9c94('0x47')]=_0x52493d[_0x9c94('0xce')][_0x9c94('0xd1')];return db[_0x9c94('0xd2')]['create'](_0x52493d[_0x9c94('0x83')])[_0x9c94('0x38')](respondWithResult(_0x3eec5d,0xc9))['catch'](handleError(_0x3eec5d,null));};exports[_0x9c94('0xd3')]=function(_0x5e5c1e,_0x412483,_0x27bd90){return db['ChatInteraction'][_0x9c94('0xd4')]({'where':{'id':_0x5e5c1e[_0x9c94('0xc4')]['id']},'raw':!![]})[_0x9c94('0x38')](handleEntityNotFound(_0x412483,null))[_0x9c94('0x38')](function(_0x98cfdd){if(_0x98cfdd){if(_0x98cfdd[_0x9c94('0xca')]){return _0x412483[_0x9c94('0x31')](0x193)['json']({'status':0x193,'message':_0x9c94('0xd5')});}return db[_0x9c94('0xd2')][_0x9c94('0xd4')]({'where':{'id':_0x5e5c1e[_0x9c94('0x4b')]['attachId']},'raw':!![]})[_0x9c94('0x38')](handleEntityNotFound(_0x412483,null));}})['then'](function(_0x2098bd){if(_0x2098bd){return _0x412483[_0x9c94('0xd6')](path[_0x9c94('0xd7')](config[_0x9c94('0xd8')],_0x9c94('0xd9'),_0x2098bd['basename']));}})['catch'](handleError(_0x412483,null));};exports[_0x9c94('0xda')]=function(_0x2adf70,_0x1e5ca3){var _0xfdab09=null;var _0x16cd19=null;var _0x2b9f0b=null;var _0x1bff21=null;if(_0x2adf70[_0x9c94('0x83')]['id']){delete _0x2adf70[_0x9c94('0x83')]['id'];}if(_0x2adf70[_0x9c94('0x83')][_0x9c94('0xdb')]){_0x1bff21=path[_0x9c94('0xd7')](config[_0x9c94('0xd8')],_0x9c94('0xdc'),util[_0x9c94('0xdd')](_0x9c94('0xde'),Date[_0x9c94('0xdf')]()));_0x2adf70['body'][_0x9c94('0xe0')]=_0x1bff21;}return db[_0x9c94('0x44')][_0x9c94('0x6f')]({'where':{'id':_0x2adf70[_0x9c94('0xc4')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x9c94('0x7e')],'as':_0x9c94('0x7e')}]}]})[_0x9c94('0x38')](handleEntityNotFound(_0x1e5ca3,null))[_0x9c94('0x38')](saveUpdates(_0x2adf70[_0x9c94('0x83')],null))[_0x9c94('0x38')](function(_0x26687b){if(_0x26687b){_0xfdab09=_0x26687b;return db[_0x9c94('0xe1')][_0x9c94('0x6f')]({'where':{'id':_0xfdab09[_0x9c94('0x87')]}});}})[_0x9c94('0x38')](function(_0x1f901e){if(_0x1f901e){_0x2b9f0b=_0x1f901e;return db[_0x9c94('0xe2')]['find']({'where':{'id':_0xfdab09['ContactId']}});}})[_0x9c94('0x38')](function(_0x3f7003){if(_0x3f7003){_0x16cd19=_0x3f7003;if(_0x1bff21){var _0x47fc4a=null;for(var _0x24a1c6=0x1;_0x24a1c6<_0xfdab09['Messages'][_0x9c94('0x50')];++_0x24a1c6){_0x47fc4a=_0xfdab09['Messages'][_0x24a1c6];var _0x4808ab=_0x47fc4a[_0x9c94('0x81')]?util[_0x9c94('0xdd')]('%s%d',_0x2b9f0b[_0x9c94('0xe3')],_0x47fc4a['UserId']):_0x9c94('0xe4');var _0x30476=_0x2adf70[_0x9c94('0x83')]['customer']||util[_0x9c94('0xdd')](_0x9c94('0xe5'),'Visitor',_0x47fc4a['ContactId']);switch(_0x2b9f0b[_0x9c94('0xe6')]){case _0x9c94('0xe7'):_0x4808ab=_0x47fc4a[_0x9c94('0x81')]?util[_0x9c94('0xdd')](_0x9c94('0xe5'),_0x2b9f0b[_0x9c94('0xe3')],_0x47fc4a[_0x9c94('0x81')]):_0x9c94('0xe4');break;case _0x9c94('0xe8'):_0x4808ab=_0x47fc4a[_0x9c94('0x81')]?_0x47fc4a[_0x9c94('0x7e')][_0x9c94('0xe9')]||_0x47fc4a['User'][_0x9c94('0x3f')]:_0x9c94('0xe4');break;case'agent_fullname':_0x4808ab=_0x47fc4a[_0x9c94('0x81')]?_0x47fc4a['User'][_0x9c94('0x3f')]:_0x9c94('0xe4');break;default:_0x4808ab=_0x47fc4a[_0x9c94('0x81')]?util[_0x9c94('0xdd')]('%s%d',_0x2b9f0b[_0x9c94('0xe3')],_0x47fc4a[_0x9c94('0x81')]):'System';}var _0x3d527d=util['format'](_0x9c94('0xea'),moment(_0x47fc4a[_0x9c94('0x8a')])['format'](_0x9c94('0xeb')),_0x47fc4a[_0x9c94('0xec')]==='in'?_0x30476:_0x4808ab,_0x47fc4a['body']);if(!_0x47fc4a[_0x9c94('0xed')]){fs[_0x9c94('0xee')](_0x1bff21,_0x3d527d);}}return db[_0x9c94('0xef')][_0x9c94('0xd4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x9c94('0x38')](function(_0x142267){if(_0x142267&&_0x142267[_0x9c94('0xf0')]&&_0x2adf70[_0x9c94('0x83')]){var _0x534cef={'tls':{'rejectUnauthorized':![]}};if(_0x142267[_0x9c94('0xf0')]['service']){_0x534cef[_0x9c94('0xf1')]=_0x142267[_0x9c94('0xf0')][_0x9c94('0xf1')];}else{_0x534cef['host']=_0x142267[_0x9c94('0xf0')][_0x9c94('0xf2')];_0x534cef[_0x9c94('0xf3')]=_0x142267[_0x9c94('0xf0')][_0x9c94('0xf3')];_0x534cef[_0x9c94('0xf4')]=_0x142267[_0x9c94('0xf0')]['secure'];}if(_0x142267['Smtp'][_0x9c94('0xf5')]){_0x534cef[_0x9c94('0xf6')]={'user':_0x142267[_0x9c94('0xf0')][_0x9c94('0xf7')],'pass':_0x142267[_0x9c94('0xf0')][_0x9c94('0xf8')]};}return respondWithRpcPromise('SendMail',_0x9c94('0xf9'),{'account':_0x534cef,'message':{'from':util[_0x9c94('0xdd')]('\x22%s\x22\x20<%s>',_0x142267['name'],_0x142267['email']||_0x142267['Smtp'][_0x9c94('0xf7')]),'to':_0x2adf70[_0x9c94('0x83')][_0x9c94('0xdb')],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2adf70[_0x9c94('0x83')][_0x9c94('0xdb')]),'attachments':[{'path':_0x1bff21}]}})[_0x9c94('0x38')](function(){return _0xfdab09;})['catch'](function(_0x3fbcd9){console[_0x9c94('0x2b')](_0x3fbcd9);});}else{return _0xfdab09;}})['then'](respondWithStatusCode(_0x1e5ca3,0xc8))[_0x9c94('0x2f')](handleError(_0x1e5ca3,null));};exports['addMessage']=function(_0xbdf353,_0x2bd0ec,_0x1a8581){return db[_0x9c94('0xfa')][_0x9c94('0x6f')]({'where':{'id':_0xbdf353[_0x9c94('0xc4')]['id']}})[_0x9c94('0x38')](handleEntityNotFound(_0x2bd0ec,null))[_0x9c94('0x38')](function(_0x27a621){if(_0x27a621){return _0x27a621[_0x9c94('0xfb')](_0xbdf353[_0x9c94('0x83')]['ids'],_[_0x9c94('0xfc')](_0xbdf353[_0x9c94('0x83')],[_0x9c94('0xfd'),'id'])||{});}})['then'](respondWithResult(_0x2bd0ec,null))[_0x9c94('0x2f')](handleError(_0x2bd0ec,null));};exports[_0x9c94('0xfe')]=function(_0x5aa882,_0x228da2,_0x21b099){var _0x59107b={'raw':![],'where':{}};var _0x4e03a4={};var _0x3af7d0={'count':0x0,'rows':[]};return db[_0x9c94('0x44')][_0x9c94('0xd4')]({'where':{'id':_0x5aa882[_0x9c94('0xc4')]['id']}})[_0x9c94('0x38')](handleEntityNotFound(_0x228da2,null))[_0x9c94('0x38')](function(_0x41a72c){if(_0x41a72c){_0x4e03a4[_0x9c94('0x49')]=_['keys'](db[_0x9c94('0xfa')][_0x9c94('0x45')]);_0x4e03a4['query']=_[_0x9c94('0x4a')](_0x5aa882['query']);_0x4e03a4[_0x9c94('0x4c')]=_[_0x9c94('0x4d')](_0x4e03a4['model'],_0x4e03a4[_0x9c94('0x4b')]);_0x59107b[_0x9c94('0x4e')]=_[_0x9c94('0x4d')](_0x4e03a4[_0x9c94('0x49')],qs[_0x9c94('0x4f')](_0x5aa882[_0x9c94('0x4b')][_0x9c94('0x4f')]));_0x59107b[_0x9c94('0x4e')]=_0x59107b[_0x9c94('0x4e')][_0x9c94('0x50')]?_0x59107b[_0x9c94('0x4e')]:_0x4e03a4['model'];if(!_0x5aa882[_0x9c94('0x4b')][_0x9c94('0xff')]('nolimit')){_0x59107b[_0x9c94('0x35')]=qs[_0x9c94('0x35')](_0x5aa882['query'][_0x9c94('0x35')]);_0x59107b[_0x9c94('0x34')]=qs[_0x9c94('0x34')](_0x5aa882[_0x9c94('0x4b')][_0x9c94('0x34')]);}_0x59107b[_0x9c94('0x52')]=qs[_0x9c94('0x53')](_0x5aa882['query'][_0x9c94('0x53')]);_0x59107b[_0x9c94('0x54')]=qs[_0x9c94('0x4c')](_[_0x9c94('0x55')](_0x5aa882[_0x9c94('0x4b')],_0x4e03a4['filters']));_0x59107b[_0x9c94('0x54')][_0x9c94('0xbb')]=_0x41a72c['id'];if(_0x5aa882[_0x9c94('0x4b')][_0x9c94('0x100')]){_0x59107b[_0x9c94('0x54')]=_[_0x9c94('0xc1')](_0x59107b['where'],{'$or':_[_0x9c94('0x3e')](_0x59107b[_0x9c94('0x4e')],function(_0x30fd2f){var _0x42dcd5={};_0x42dcd5[_0x30fd2f]={'$like':'%'+_0x5aa882[_0x9c94('0x4b')][_0x9c94('0x100')]+'%'};return _0x42dcd5;})});}if(_0x5aa882[_0x9c94('0x4b')][_0x9c94('0x8c')]){var _0x581663=_0x5aa882[_0x9c94('0x4b')][_0x9c94('0x8c')]['split'](',');var _0x33b3f7={};_0x33b3f7[_0x581663[0x0]]={'$gte':moment(_0x581663[0x1])[_0x9c94('0xdd')](_0x9c94('0x101'))};_0x59107b[_0x9c94('0x54')]=_[_0x9c94('0xc1')](_0x59107b[_0x9c94('0x54')],_0x33b3f7);}_0x59107b=_[_0x9c94('0xc1')]({},_0x59107b,_0x5aa882[_0x9c94('0xc2')]);return db[_0x9c94('0xfa')][_0x9c94('0xa7')]({'where':_0x59107b['where']})[_0x9c94('0x38')](function(_0x364595){_0x3af7d0['count']=_0x364595;if(_0x5aa882[_0x9c94('0x4b')][_0x9c94('0xbf')]){_0x59107b['include']=[{'all':!![]}];}return db[_0x9c94('0xfa')]['findAll'](_0x59107b);})[_0x9c94('0x38')](function(_0x45e0e8){_0x3af7d0[_0x9c94('0xbd')]=_0x45e0e8;return _0x3af7d0;});}})[_0x9c94('0x38')](respondWithFilteredResult(_0x228da2,_0x59107b))[_0x9c94('0x2f')](handleError(_0x228da2,null));};exports[_0x9c94('0x102')]=function(_0x2092ea,_0xaf8576,_0x57ee14){var _0x2277bd={'where':{}},_0x5da1ca={},_0x22301c={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x2092ea['params']['id']}})[_0x9c94('0x38')](handleEntityNotFound(_0xaf8576,null))[_0x9c94('0x38')](function(_0x3ba016){if(_0x3ba016){_0x5da1ca[_0x9c94('0x49')]=_[_0x9c94('0x4a')](db['ChatMessage'][_0x9c94('0x45')]);_0x5da1ca[_0x9c94('0x4b')]=_[_0x9c94('0x4a')](_0x2092ea[_0x9c94('0x4b')]);_0x5da1ca[_0x9c94('0x4c')]=_[_0x9c94('0x4d')](_0x5da1ca[_0x9c94('0x49')],_0x5da1ca[_0x9c94('0x4b')]);_0x2277bd['attributes']=_['intersection'](_0x5da1ca['model'],qs[_0x9c94('0x4f')](_0x2092ea[_0x9c94('0x4b')]['fields']));_0x2277bd[_0x9c94('0x4e')]=_0x2277bd[_0x9c94('0x4e')][_0x9c94('0x50')]?_0x2277bd['attributes']:_0x5da1ca[_0x9c94('0x49')];if(!_0x2092ea[_0x9c94('0x4b')][_0x9c94('0xff')](_0x9c94('0x51'))){_0x2277bd[_0x9c94('0x35')]=qs[_0x9c94('0x35')](_0x2092ea[_0x9c94('0x4b')]['limit']);_0x2277bd[_0x9c94('0x34')]=qs[_0x9c94('0x34')](_0x2092ea['query'][_0x9c94('0x34')]);}_0x2277bd[_0x9c94('0x52')]=qs[_0x9c94('0x53')](_0x2092ea[_0x9c94('0x4b')][_0x9c94('0x53')]);_0x2277bd['where']=qs[_0x9c94('0x4c')](_['pick'](_0x2092ea[_0x9c94('0x4b')],_0x5da1ca[_0x9c94('0x4c')]));_0x2277bd[_0x9c94('0x54')][_0x9c94('0xbb')]=_0x3ba016['id'];if(_0x2092ea[_0x9c94('0x4b')][_0x9c94('0x100')]){_0x2277bd[_0x9c94('0x54')]=_[_0x9c94('0xc1')](_0x2277bd[_0x9c94('0x54')],{'$or':_[_0x9c94('0x3e')](_0x2277bd[_0x9c94('0x4e')],function(_0x42fec8){var _0x16541e={};_0x16541e[_0x42fec8]={'$like':'%'+_0x2092ea['query'][_0x9c94('0x100')]+'%'};return _0x16541e;})});}_0x2277bd['where'][_0x9c94('0xed')]=![];if(_0x2092ea[_0x9c94('0x4b')]['id']){_0x2277bd['where']['id']={'$gt':_0x2092ea['query']['id']};}_0x2277bd=_[_0x9c94('0xc1')]({},_0x2277bd,_0x2092ea[_0x9c94('0xc2')]);return db[_0x9c94('0xfa')][_0x9c94('0xa7')]({'where':_0x2277bd[_0x9c94('0x54')]})[_0x9c94('0x38')](function(_0x78747e){_0x22301c[_0x9c94('0xa7')]=_0x78747e;_0x2277bd[_0x9c94('0xc0')]=[];if(_0x2092ea[_0x9c94('0x4b')]['includeAgent']){_0x2277bd[_0x9c94('0xc0')][_0x9c94('0x42')]({'model':db[_0x9c94('0x7e')],'as':_0x9c94('0x7e'),'attributes':['id',_0x9c94('0x3f'),_0x9c94('0xe9')]});}if(_0x2092ea['query'][_0x9c94('0xbf')]){_0x2277bd[_0x9c94('0xc0')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x2277bd);})['then'](function(_0x7f04e7){_0x22301c[_0x9c94('0xbd')]=_0x7f04e7;return _0x22301c;});}})[_0x9c94('0x38')](respondWithFilteredResult(_0xaf8576,_0x2277bd))[_0x9c94('0x2f')](handleError(_0xaf8576,null));};exports[_0x9c94('0x103')]=function(_0x5c1aef,_0x43e5f7,_0x1e31d2){return db[_0x9c94('0x44')][_0x9c94('0x6f')]({'where':{'id':_0x5c1aef[_0x9c94('0xc4')]['id']}})['then'](handleEntityNotFound(_0x43e5f7,null))[_0x9c94('0x38')](function(_0x2c44ef){if(_0x2c44ef){return _0x2c44ef[_0x9c94('0x104')](_0x5c1aef['body'][_0x9c94('0xfd')],_[_0x9c94('0xfc')](_0x5c1aef[_0x9c94('0x83')],['ids','id'])||{})[_0x9c94('0x105')](function(){return db['Tag']['findAll']({'attributes':['id',_0x9c94('0x3b'),_0x9c94('0x58')],'where':{'id':_0x5c1aef[_0x9c94('0x83')][_0x9c94('0xfd')]}});})[_0x9c94('0x38')](function(_0x392381){socket['emit'](_0x9c94('0x106'),{'id':Number(_0x5c1aef['params']['id']),'tags':_0x392381||[]});return{'id':Number(_0x5c1aef['params']['id']),'tags':_0x392381||[]};});}})[_0x9c94('0x38')](respondWithResult(_0x43e5f7,null))[_0x9c94('0x2f')](handleError(_0x43e5f7,null));};exports[_0x9c94('0x107')]=function(_0x11fa4b,_0x55bcee,_0x404c1c){return db[_0x9c94('0x44')]['find']({'where':{'id':_0x11fa4b[_0x9c94('0xc4')]['id']}})[_0x9c94('0x38')](handleEntityNotFound(_0x55bcee,null))['then'](function(_0x1fa66d){if(_0x1fa66d){return _0x1fa66d[_0x9c94('0x107')](_0x11fa4b[_0x9c94('0x4b')][_0x9c94('0xfd')]);}})[_0x9c94('0x38')](respondWithStatusCode(_0x55bcee,null))['catch'](handleError(_0x55bcee,null));};exports['download']=function(_0x3c406a,_0x314c6e){var _0x5d34fa=moment()[_0x9c94('0x108')]()['toString']();var _0x1519b7=path[_0x9c94('0xd7')](config[_0x9c94('0xd8')],_0x9c94('0x109'),_0x9c94('0x10a'),_0x9c94('0x10b'));var _0x26d6b5=path[_0x9c94('0xd7')](config[_0x9c94('0xd8')],_0x9c94('0x109'),_0x9c94('0x10a'),_0x9c94('0x10c'));var _0x4461a7=path[_0x9c94('0xd7')](_0x1519b7,_0x5d34fa);var _0x5abb43=util[_0x9c94('0xdd')](_0x9c94('0x10d'),_0x3c406a[_0x9c94('0xc4')]['id'],_0x5d34fa);var _0x4cf11c=path[_0x9c94('0xd7')](_0x1519b7,_0x5abb43);var _0x14781b=[];_0x14781b[_0x9c94('0x42')]({'model':db['User'],'as':'User','attributes':['id',_0x9c94('0x3f')],'raw':!![]});_0x14781b[_0x9c94('0x42')]({'model':db[_0x9c94('0xe2')],'as':_0x9c94('0x74'),'attributes':['id',_0x9c94('0x10e'),_0x9c94('0x10f')],'raw':!![]});if(_0x3c406a[_0x9c94('0x4b')][_0x9c94('0x10c')]){_0x14781b['push']({'model':db[_0x9c94('0xd2')],'as':_0x9c94('0xd2'),'raw':!![]});}var _0x24c70c=[{'model':db[_0x9c94('0xfa')],'as':_0x9c94('0x110'),'attributes':['id',_0x9c94('0x83'),_0x9c94('0x8a'),_0x9c94('0xec'),'secret',_0x9c94('0x92')],'include':_0x14781b}];_0x24c70c[_0x9c94('0x42')]({'model':db[_0x9c94('0xe1')],'as':_0x9c94('0x111'),'attributes':['id',_0x9c94('0x3b')]});_0x24c70c[_0x9c94('0x42')]({'model':db[_0x9c94('0x7e')],'as':_0x9c94('0x112'),'attributes':['id',_0x9c94('0x3f')]});return db['ChatInteraction'][_0x9c94('0x6f')]({'where':{'id':_0x3c406a[_0x9c94('0xc4')]['id']},'include':_0x24c70c})[_0x9c94('0x38')](handleEntityNotFound(_0x314c6e,null))['then'](function(_0xfa9818){if(_0xfa9818){var _0x441e8b=_0xfa9818['get']({'plain':!![]});fs[_0x9c94('0x113')](_0x4461a7);var _0x1e7263={'format':'A4','border':'10px','header':{'height':_0x9c94('0x114'),'contents':{'first':_0x9c94('0x115')}},'footer':{'height':_0x9c94('0x116'),'contents':{'default':util[_0x9c94('0xdd')](_0x9c94('0x117'),util[_0x9c94('0xdd')](_0x9c94('0x118'),'Chat',_0x441e8b['id']),moment()[_0x9c94('0xdd')](_0x9c94('0x119'))[_0x9c94('0xa6')]())}}};var _0x6216f1={'channel':_0x9c94('0x11a'),'account':_0x441e8b[_0x9c94('0x111')][_0x9c94('0x3b')],'agent':_0x441e8b[_0x9c94('0x112')]?_0x441e8b['Owner'][_0x9c94('0x3f')]:_0x9c94('0x11b'),'createdAt':moment(_0x441e8b['createdAt'])[_0x9c94('0xdd')](_0x9c94('0x101'))['toString'](),'closedAt':_0x441e8b[_0x9c94('0xca')]?moment(_0x441e8b[_0x9c94('0x11c')])[_0x9c94('0xdd')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9c94('0xa6')]():'','disposition':_0x441e8b[_0x9c94('0xcb')],'chatInfo':{'browser':_0x441e8b[_0x9c94('0x11d')],'os':_0x441e8b['osName'],'referer':_0x441e8b[_0x9c94('0x11e')],'customerIp':_0x441e8b[_0x9c94('0x11f')],'customerPort':_0x441e8b['customerPort']?_0x441e8b[_0x9c94('0x120')]:_0x9c94('0x11b')},'messages':_(_0x441e8b[_0x9c94('0x110')])[_0x9c94('0x121')]()['filter']({'secret':![]})[_0x9c94('0x3e')](function(_0x1a5daf){if(_0x1a5daf[_0x9c94('0xd2')]){var _0x34b4f7=path[_0x9c94('0xd7')](_0x26d6b5,_0x1a5daf[_0x9c94('0xd2')][_0x9c94('0x122')]);if(fs[_0x9c94('0x123')](_0x34b4f7)){fs[_0x9c94('0x124')](_0x34b4f7)['pipe'](fs[_0x9c94('0x125')](path[_0x9c94('0xd7')](_0x4461a7,_0x1a5daf['Attachment'][_0x9c94('0x122')])));}}return{'date':moment(_0x1a5daf[_0x9c94('0x8a')])[_0x9c94('0xdd')](_0x9c94('0x101'))[_0x9c94('0xa6')](),'sender':_0x1a5daf['direction']===_0x9c94('0x126')?_0x1a5daf[_0x9c94('0x7e')]?_0x1a5daf[_0x9c94('0x7e')][_0x9c94('0x3f')]:'System':_0x1a5daf['Contact']['firstName']+(_0x1a5daf[_0x9c94('0x74')][_0x9c94('0x10f')]?'\x20'+_0x1a5daf[_0x9c94('0x74')][_0x9c94('0x10f')]:''),'body':_0x1a5daf['Attachment']?_0x1a5daf[_0x9c94('0xd2')][_0x9c94('0x122')]:_0x1a5daf[_0x9c94('0x83')],'direction':_0x1a5daf[_0x9c94('0xec')]==='out'?'A':'C','secret':_0x1a5daf['secret'],'read':_0x1a5daf[_0x9c94('0x92')],'attachment':_0x1a5daf[_0x9c94('0xd2')]};})[_0x9c94('0x71')]()};return ejs[_0x9c94('0x127')](path[_0x9c94('0xd7')](config[_0x9c94('0xd8')],'server',_0x9c94('0x128'),_0x9c94('0x129')),{'interaction':_0x6216f1})[_0x9c94('0x38')](function(_0x20db87){return new BPromise(function(_0x1a236f,_0x3c0176){pdf['create'](_0x20db87,_0x1e7263)[_0x9c94('0x12a')](path['join'](_0x4461a7,_0x9c94('0x12b')+_0x441e8b['id']+'-'+_0x5d34fa+_0x9c94('0x12c')),function(_0x20e54b,_0x2dfe7b){if(_0x20e54b)return _0x3c0176(_0x20e54b);_0x1a236f(_0x2dfe7b);});});})[_0x9c94('0x38')](function(){return new BPromise(function(_0x1adf72,_0x236652){zipdir(_0x4461a7,{'saveTo':_0x4cf11c},function(_0x3684ef,_0x310893){if(_0x3684ef)return _0x236652(_0x3684ef);return _0x1adf72(_0x310893);});})[_0x9c94('0x38')](function(){return new BPromise(function(_0x3b24b0,_0x3f9da6){rimraf(_0x4461a7,function(_0x492f43){if(_0x492f43)_0x3f9da6(_0x492f43);return _0x3b24b0();});});})[_0x9c94('0x38')](function(){return _0x314c6e[_0x9c94('0xd6')](_0x4cf11c,_0x5abb43,function(_0x2475a7){if(_0x2475a7){console[_0x9c94('0x12d')]('err',_0x2475a7);}else{fs[_0x9c94('0x12e')](_0x4cf11c);}});});});}else{return _0x314c6e[_0x9c94('0x30')](0xc8);}})[_0x9c94('0x2f')](handleError(_0x314c6e,null));}; \ No newline at end of file +var _0x7da7=['defaults','socket.io-emitter','register','jayson/promise','client','http','test','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','Users','map','TagIds','Tags','forEach','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','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','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','end','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','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','replace','isNumeric','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','all','params','include','ChatInteraction','create','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Sequelize','ValidationError','Interaction\x20already\x20assigned','closed','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','download','join','root','server/files/attachments/','close','format','transcript-%s.txt','now','ChatMessage','ChatWebsiteId','CmContact','Messages','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','includeAll','findAll','rows','nolimit','alias','setTags','spread','emit','chatInteractionTags:save','removeTags','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','ChatWebsite','Owner','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\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%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\x0a\x20\x20\x20\x20\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{{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\x0a\x20\x20\x20\x20\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%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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','osName','customerIp','customerPort','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis'];(function(_0x1601ce,_0x19e283){var _0x31e294=function(_0x5b4bba){while(--_0x5b4bba){_0x1601ce['push'](_0x1601ce['shift']());}};_0x31e294(++_0x19e283);}(_0x7da7,0x10d));var _0x77da=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0x7da7[_0x954b3a];return _0x3a313e;};'use strict';var pdf=require(_0x77da('0x0'));var emlformat=require(_0x77da('0x1'));var rimraf=require(_0x77da('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x77da('0x3'));var moment=require(_0x77da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77da('0x5'));var util=require(_0x77da('0x6'));var path=require('path');var sox=require(_0x77da('0x7'));var csv=require(_0x77da('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x8'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var db=require(_0x77da('0x15'))['db'];config[_0x77da('0x16')]=_[_0x77da('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x77da('0x18'))(new Redis(config[_0x77da('0x16')]));require('./chatInteraction.socket')[_0x77da('0x19')](socket);var jayson=require(_0x77da('0x1a'));var client=jayson[_0x77da('0x1b')][_0x77da('0x1c')]({'port':0x232b});var client9004=jayson['client'][_0x77da('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x4e130c,_0x29cd7b,_0x366443){if(_0x366443){var _0x1b0e17=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b0e17[_0x77da('0x1d')](_0x29cd7b)){return _0x4e130c;}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 _0x4e130c;}}function respondWithRpcPromise(_0x482b87,_0x103e46,_0x295bef,_0x289887){return new BPromise(function(_0x335dcb,_0x19a00c){var _0x12d2b1=_0x289887||client;return _0x12d2b1[_0x77da('0x1e')](_0x482b87,_0x295bef)[_0x77da('0x1f')](function(_0x544104){logger['info'](_0x77da('0x20'),_0x103e46,_0x77da('0x21'));logger['debug'](_0x77da('0x22'),_0x103e46,_0x77da('0x21'),JSON[_0x77da('0x23')](_0x544104));if(_0x544104['error']){if(_0x544104['error'][_0x77da('0x24')]===0x1f4){logger['error'](_0x77da('0x20'),_0x103e46,_0x544104[_0x77da('0x25')][_0x77da('0x26')]);return _0x19a00c(_0x544104[_0x77da('0x25')][_0x77da('0x26')]);}logger[_0x77da('0x25')](_0x77da('0x20'),_0x103e46,_0x544104['error']['message']);return _0x335dcb(_0x544104[_0x77da('0x25')][_0x77da('0x26')]);}else{logger[_0x77da('0x27')](_0x77da('0x20'),_0x103e46,'request\x20sent');_0x335dcb(_0x544104[_0x77da('0x28')][_0x77da('0x26')]);}})[_0x77da('0x29')](function(_0x36115b){logger[_0x77da('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x103e46,_0x36115b);_0x19a00c(_0x36115b);});});}function respondWithStatusCode(_0xce24b8,_0x3e090d){_0x3e090d=_0x3e090d||0xcc;return function(_0x1f2279){if(_0x1f2279){return _0xce24b8[_0x77da('0x2a')](_0x3e090d);}return _0xce24b8['status'](_0x3e090d)['end']();};}function respondWithResult(_0x4d395a,_0x2258e9){_0x2258e9=_0x2258e9||0xc8;return function(_0x30456a){if(_0x30456a){return _0x4d395a[_0x77da('0x2b')](_0x2258e9)[_0x77da('0x2c')](_0x30456a);}};}function respondWithFilteredResult(_0x34228f,_0x4eeb99){return function(_0x350b4e){if(_0x350b4e){var _0x26f5a0=_0x350b4e[_0x77da('0x2d')],_0x356bfb=_0x4eeb99['offset'],_0x1d381b=_0x4eeb99[_0x77da('0x2e')]+_0x4eeb99[_0x77da('0x2f')],_0x1e7853;if(_0x1d381b>=_0x26f5a0){_0x1d381b=_0x26f5a0;_0x1e7853=0xc8;}else{_0x1e7853=0xce;}_0x34228f[_0x77da('0x2b')](_0x1e7853);return _0x34228f[_0x77da('0x30')](_0x77da('0x31'),_0x356bfb+'-'+_0x1d381b+'/'+_0x26f5a0)[_0x77da('0x2c')](_0x350b4e);}return null;};}function patchUpdates(_0x3343b4){return function(_0x2c790d){try{jsonpatch['apply'](_0x2c790d,_0x3343b4,!![]);}catch(_0x5e8d1e){return BPromise[_0x77da('0x32')](_0x5e8d1e);}return _0x2c790d[_0x77da('0x33')]();};}function saveUpdates(_0x49cd8f,_0x473c7f){return function(_0x390399){if(_0x390399){return _0x390399[_0x77da('0x34')](_0x49cd8f)[_0x77da('0x1f')](function(_0x4232ac){return _0x4232ac;});}return null;};}function removeEntity(_0x161d8c,_0x20d1cc){return function(_0x5c4a03){if(_0x5c4a03){return _0x5c4a03[_0x77da('0x35')]()['then'](function(){_0x161d8c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17d236,_0x53543a){return function(_0x19bfd3){if(!_0x19bfd3){_0x17d236[_0x77da('0x2a')](0x194);}return _0x19bfd3;};}function handleError(_0xce9df2,_0x3cc78b){_0x3cc78b=_0x3cc78b||0x1f4;return function(_0x3c46d2){logger[_0x77da('0x25')](_0x3c46d2[_0x77da('0x36')]);if(_0x3c46d2['name']){delete _0x3c46d2[_0x77da('0x37')];}_0xce9df2[_0x77da('0x2b')](_0x3cc78b)[_0x77da('0x38')](_0x3c46d2);};}function getInteractionUsers(_0x32785f,_0x166534){return new BPromise(function(_0x188284,_0x48fccc){try{if(_0x166534[_0x32785f['id']]){_0x32785f[_0x77da('0x39')]=_[_0x77da('0x3a')](_0x166534[_0x32785f['id']],function(_0x2cd190){return{'id':_0x2cd190['id'],'fullname':_0x2cd190['fullname']};});}}catch(_0xc5f0b8){_0x48fccc(_0xc5f0b8);}_0x188284(_0x32785f);});}function getInteractionTags(_0x505ffb,_0x4e1e31){return new BPromise(function(_0x599e21,_0x59abca){try{if(_0x505ffb[_0x77da('0x3b')]){_0x505ffb[_0x77da('0x3c')]=[];_0x505ffb[_0x77da('0x3b')]['split'](',')[_0x77da('0x3d')](function(_0x5b7e63){_0x505ffb[_0x77da('0x3c')]['push'](_0x4e1e31[_0x5b7e63]);});}delete _0x505ffb[_0x77da('0x3b')];}catch(_0xa19b50){_0x59abca(_0xa19b50);}_0x599e21(_0x505ffb);});}function updateChatInteraction(_0x290667,_0x1612b7,_0x240bee){return new BPromise(function(_0x5ecf12,_0x759b86){return getInteractionUsers(_0x290667,_0x240bee)[_0x77da('0x1f')](function(_0x44717a){return getInteractionTags(_0x44717a,_0x1612b7);})[_0x77da('0x1f')](function(_0x32a9c4){_0x5ecf12(_0x32a9c4);})[_0x77da('0x29')](function(_0x4ea24c){_0x759b86(_0x4ea24c);});});}exports[_0x77da('0x3e')]=function(_0x2f0495,_0x21de41){var _0x2dfeca={},_0x7d11f9={},_0x25f65f={'count':0x0,'rows':[]};var _0x52488d=_[_0x77da('0x3a')](db['ChatInteraction'][_0x77da('0x3f')],function(_0x373fb2){return{'name':_0x373fb2[_0x77da('0x40')],'type':_0x373fb2['type'][_0x77da('0x41')]};});_0x7d11f9[_0x77da('0x42')]=_[_0x77da('0x3a')](_0x52488d,_0x77da('0x37'));_0x7d11f9[_0x77da('0x43')]=_[_0x77da('0x44')](_0x2f0495[_0x77da('0x43')]);_0x7d11f9[_0x77da('0x45')]=_[_0x77da('0x46')](_0x7d11f9['model'],_0x7d11f9[_0x77da('0x43')]);_0x2dfeca[_0x77da('0x47')]=_[_0x77da('0x46')](_0x7d11f9[_0x77da('0x42')],qs[_0x77da('0x48')](_0x2f0495[_0x77da('0x43')]['fields']));_0x2dfeca['attributes']=_0x2dfeca[_0x77da('0x47')][_0x77da('0x49')]?_0x2dfeca[_0x77da('0x47')]:_0x7d11f9[_0x77da('0x42')];if(!_0x2f0495[_0x77da('0x43')][_0x77da('0x4a')]('nolimit')){_0x2dfeca[_0x77da('0x2f')]=qs[_0x77da('0x2f')](_0x2f0495[_0x77da('0x43')][_0x77da('0x2f')]);_0x2dfeca['offset']=qs[_0x77da('0x2e')](_0x2f0495['query']['offset']);}_0x2dfeca[_0x77da('0x4b')]=qs[_0x77da('0x4c')](_0x2f0495[_0x77da('0x43')][_0x77da('0x4c')]);_0x2dfeca['where']=qs[_0x77da('0x45')](_[_0x77da('0x4d')](_0x2f0495['query'],_0x7d11f9[_0x77da('0x45')]));var _0x3c2d89=[];var _0x5c264e=squel[_0x77da('0x4e')]()[_0x77da('0x4f')]('id')[_0x77da('0x4f')](_0x77da('0x37'))[_0x77da('0x4f')](_0x77da('0x50'))[_0x77da('0x51')](_0x77da('0x52'));var _0x128ce3=squel[_0x77da('0x4e')]()['field'](_0x77da('0x53'))['field'](_0x77da('0x54'))[_0x77da('0x4f')](_0x77da('0x55'))[_0x77da('0x51')](_0x77da('0x56'),'ui')[_0x77da('0x57')](_0x77da('0x58'),'u','u.id\x20=\x20ui.UserId');var _0x17ed71=squel[_0x77da('0x4e')]()[_0x77da('0x51')](_0x77da('0x59'),'i')['left_join'](_0x77da('0x5a'),'c',_0x77da('0x5b'))[_0x77da('0x57')]('users','o','o.id\x20=\x20i.UserId')[_0x77da('0x57')](_0x77da('0x5c'),'a',_0x77da('0x5d'))[_0x77da('0x57')](_0x77da('0x5e'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join'](_0x77da('0x5f'),'it',_0x77da('0x60'))['left_join'](_0x77da('0x52'),'t',_0x77da('0x61'));var _0x1e0146=squel['expr']();var _0x1d665d=[];var _0x111260=squel['expr']();var _0x3ae855;if(_0x2f0495[_0x77da('0x43')][_0x77da('0x62')]){_0x3ae855=as[_0x77da('0x63')](_0x2f0495[_0x77da('0x43')][_0x77da('0x62')]);var _0x1dc4ab=_0x3ae855[_0x77da('0x64')];for(var _0x1ecb28=0x0;_0x1ecb28<_0x3ae855['conditions'][_0x77da('0x49')];_0x1ecb28++){var _0x11c240=_0x3ae855[_0x77da('0x65')][_0x1ecb28];var _0x2e92f4='i';var _0x329c6b=_[_0x77da('0x66')](_0x52488d,['name',_0x11c240[_0x77da('0x4f')]]);if(!_0x329c6b){switch(_0x11c240[_0x77da('0x4f')]){case _0x77da('0x67'):if(_0x11c240['value']==0x1){_0x17ed71[_0x77da('0x68')]('`'+_0x11c240[_0x77da('0x4f')]+_0x77da('0x69'));}else{_0x17ed71[_0x77da('0x68')]('`'+_0x11c240[_0x77da('0x4f')]+_0x77da('0x6a'));}break;case _0x77da('0x6b'):if(_0x11c240['operator']===_0x77da('0x6c')){if(_0x11c240['value'][_0x77da('0x6d')]('\x20')[_0x77da('0x49')]>0x1){_0x1e0146[_0x1dc4ab](_0x77da('0x6e'),qs['getFullTextValue'](_0x11c240[_0x77da('0x6f')]),null);}else{var _0x3c4453='%'+_0x11c240[_0x77da('0x6f')]+'%';_0x1e0146[_0x1dc4ab](_0x77da('0x70'),_0x3c4453,_0x3c4453,_0x3c4453);}}else{_0x329c6b=_['find'](_0x52488d,['name','ContactId']);_0x11c240[_0x77da('0x4f')]=_0x77da('0x71');_0x19b514=as[_0x77da('0x72')](_0x2e92f4,_0x329c6b[_0x77da('0x73')],_0x11c240);_0x1e0146[_0x1dc4ab](_0x19b514[_0x77da('0x74')],_0x19b514[_0x77da('0x6f')][_0x77da('0x75')],_0x19b514[_0x77da('0x6f')][_0x77da('0x76')]);}break;case _0x77da('0x77'):var _0x5afd7a=_0x11c240[_0x77da('0x6f')][_0x77da('0x6d')](',')['map'](function(_0x52ebdf){return Number(_0x52ebdf);});_0x5afd7a[_0x77da('0x3d')](function(_0x47ec1d){_0x111260['or'](_0x77da('0x78'),'%,'+_0x47ec1d+',%');});_0x1d665d=_[_0x77da('0x79')](_0x1d665d,_0x5afd7a);break;case _0x77da('0x7a'):if(_0x11c240['operator']===_0x77da('0x6c')){_0x1e0146[_0x1dc4ab](_0x77da('0x7b'),'%'+_0x11c240[_0x77da('0x6f')]+'%',null);}else{_0x329c6b=_[_0x77da('0x66')](_0x52488d,[_0x77da('0x37'),'UserId']);_0x11c240[_0x77da('0x4f')]=_0x77da('0x7c');_0x19b514=as['buildExpression'](_0x2e92f4,_0x329c6b[_0x77da('0x73')],_0x11c240);_0x1e0146[_0x1dc4ab](_0x19b514[_0x77da('0x74')],_0x19b514[_0x77da('0x6f')][_0x77da('0x75')],_0x19b514[_0x77da('0x6f')][_0x77da('0x76')]);}break;case _0x77da('0x7d'):_0x19b514=as['buildExpression']('me',null,_0x11c240);_0x1e0146[_0x1dc4ab](_0x19b514[_0x77da('0x74')],_0x19b514['value'][_0x77da('0x75')],_0x19b514[_0x77da('0x6f')][_0x77da('0x76')]);break;}}else{var _0x19b514=as[_0x77da('0x72')](_0x2e92f4,_0x329c6b[_0x77da('0x73')],_0x11c240);_0x1e0146[_0x1dc4ab](_0x19b514[_0x77da('0x74')],_0x19b514[_0x77da('0x6f')][_0x77da('0x75')],_0x19b514[_0x77da('0x6f')][_0x77da('0x76')]);}}}else{var _0x19065e=_(_0x2f0495['query'])[_0x77da('0x44')]()[_0x77da('0x3a')](function(_0xeb5121){return _[_0x77da('0x7e')](_0x52488d,['name',_0xeb5121])?_0xeb5121:undefined;})[_0x77da('0x7f')]()[_0x77da('0x6f')]();if(!_[_0x77da('0x80')](_0x19065e)){_0x19065e['forEach'](function(_0x132d14){if(_0x132d14==='ChatWebsiteId'){_0x17ed71['where'](_0x77da('0x81'),[][_0x77da('0x82')](_0x2f0495[_0x77da('0x43')][_0x132d14]));}else if(_0x132d14===_0x77da('0x83')){var _0x3cb69e=JSON[_0x77da('0x84')](_0x2f0495[_0x77da('0x43')][_0x132d14])[_0x77da('0x85')];var _0x470840=JSON['parse'](_0x2f0495[_0x77da('0x43')][_0x132d14])[_0x77da('0x86')];_0x17ed71[_0x77da('0x87')](_0x77da('0x88'),_0x3cb69e,_0x470840);}else{if(_0x2f0495[_0x77da('0x43')][_0x132d14]==='null'){_0x17ed71[_0x77da('0x87')]('i.'+_0x132d14+_0x77da('0x89'));}else{_0x17ed71[_0x77da('0x87')]('i.'+_0x132d14+_0x77da('0x8a'),_0x2f0495[_0x77da('0x43')][_0x132d14]);}}});}if(_0x2f0495[_0x77da('0x43')][_0x77da('0x8b')]){if(_0x2f0495[_0x77da('0x43')][_0x77da('0x8b')]==0x1){_0x17ed71[_0x77da('0x68')]('`unreadMessages`\x20=\x200');}else{_0x17ed71['having']('`unreadMessages`\x20>\x200');}}if(_0x2f0495[_0x77da('0x43')][_0x77da('0x8c')]){_0x1d665d=_[_0x77da('0x8d')](_0x2f0495['query']['tag'])?_0x2f0495[_0x77da('0x43')][_0x77da('0x8c')]:new Array(_0x2f0495[_0x77da('0x43')][_0x77da('0x8c')]);_0x1d665d[_0x77da('0x3d')](function(_0x44fa0d){_0x111260['or'](_0x77da('0x78'),'%,'+_0x44fa0d+',%');});}if(_0x2f0495[_0x77da('0x43')][_0x77da('0x8e')]){var _0x11152b=_0x2f0495[_0x77da('0x43')][_0x77da('0x8e')][_0x77da('0x8f')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x77da('0x90')](_0x11152b)){_0x1e0146['or']('i.id\x20LIKE\x20?',_0x11152b+'%');}else{_0x1e0146['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x77da('0x91')](_0x11152b))['or'](_0x77da('0x92'),_0x11152b+'%');}}}_0x17ed71[_0x77da('0x87')](_0x1e0146);_0x17ed71['group']('i.id');var _0x1c3a18={'type':db['Sequelize'][_0x77da('0x93')][_0x77da('0x94')],'raw':!![]};var _0x554c44=_0x17ed71[_0x77da('0x95')]();_0x554c44['field'](_0x77da('0x96'));_0x554c44[_0x77da('0x4f')](_0x77da('0x97'),_0x77da('0x67'));if(_0x2dfeca['order']){_0x2dfeca[_0x77da('0x4b')][_0x77da('0x3d')](function(_0x8454b3){_0x17ed71[_0x77da('0x4b')]('i.'+_0x8454b3[0x0],_0x8454b3[0x1]===_0x77da('0x98')?![]:!![]);});}if(!_[_0x77da('0x80')](_0x1d665d)){_0x17ed71[_0x77da('0x68')](_0x111260);_0x554c44['where']('t.id\x20IN\x20?',_0x1d665d);}BPromise[_0x77da('0x99')]()[_0x77da('0x1f')](function(){if(!_0x3ae855){if(_0x2f0495[_0x77da('0x43')]['ChatWebsiteId']||_0x2f0495['query']['journey'])return;_0x554c44['where'](_0x77da('0x9a'));_0x17ed71[_0x77da('0x87')](_0x77da('0x9a'));return;}return _0x2f0495['user'][_0x77da('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x39de26){if(_['isEmpty'](_0x39de26)){_0x554c44[_0x77da('0x87')]('i.ChatWebsiteId\x20IS\x20NULL');_0x17ed71[_0x77da('0x87')](_0x77da('0x9c'));}else{_0x554c44['where'](_0x77da('0x81'),_[_0x77da('0x3a')](_0x39de26,'id'));_0x17ed71[_0x77da('0x87')](_0x77da('0x81'),_[_0x77da('0x3a')](_0x39de26,'id'));}});})[_0x77da('0x1f')](function(){db[_0x77da('0x9d')][_0x77da('0x43')](_0x554c44[_0x77da('0x9e')](),_0x1c3a18)['then'](function(_0x4abfb8){_0x25f65f['count']=_0x4abfb8[_0x77da('0x49')];if(_0x25f65f[_0x77da('0x2d')]===0x0)return[];return db[_0x77da('0x9d')]['query'](_0x5c264e[_0x77da('0x9e')](),_0x1c3a18)['then'](function(_0x5e93b1){_0x3c2d89=_[_0x77da('0x9f')](_0x5e93b1,'id');_0x1c3a18=_[_0x77da('0xa0')](_0x1c3a18,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f0495['query'][_0x77da('0x48')]){_0x2dfeca[_0x77da('0x47')][_0x77da('0x3d')](function(_0x5d9750){_0x17ed71[_0x77da('0x4f')]('i.'+_0x5d9750);});}else{_0x17ed71['field'](_0x77da('0x97'),_0x77da('0x67'));_0x17ed71[_0x77da('0x4f')](_0x77da('0xa1'),_0x77da('0xa2'));_0x17ed71[_0x77da('0x4f')]('a.mandatoryDisposition',_0x77da('0xa3'));_0x17ed71[_0x77da('0x4f')](_0x77da('0xa4'));_0x17ed71[_0x77da('0x4f')]('c.firstName',_0x77da('0xa5'));_0x17ed71['field'](_0x77da('0xa6'),_0x77da('0xa7'));_0x17ed71[_0x77da('0x4f')](_0x77da('0xa8'),_0x77da('0xa9'));_0x17ed71[_0x77da('0x4f')](_0x77da('0xaa'),_0x77da('0xab'));_0x17ed71['field'](_0x77da('0xac'),_0x77da('0xad'));_0x17ed71[_0x77da('0x4f')](_0x77da('0xae'),_0x77da('0xaf'));_0x17ed71[_0x77da('0x4f')](_0x77da('0xb0'),_0x77da('0xb1'));_0x17ed71['field']('o.internal',_0x77da('0xb2'));_0x17ed71[_0x77da('0x4f')](_0x77da('0xb3'),'TagIds');}_0x17ed71[_0x77da('0x2f')](_0x2dfeca['limit']);_0x17ed71[_0x77da('0x2e')](_0x2dfeca[_0x77da('0x2e')]);return db[_0x77da('0x9d')]['query'](_0x17ed71['toString'](),_0x1c3a18);})[_0x77da('0x1f')](function(_0x48bd19){_0x128ce3['where'](_0x77da('0xb4'),_[_0x77da('0x3a')](_0x48bd19,'id'));return db[_0x77da('0x9d')][_0x77da('0x43')](_0x128ce3['toString'](),_0x1c3a18)[_0x77da('0x1f')](function(_0x4c5c42){var _0x490dd8=_['groupBy'](_0x4c5c42,_0x77da('0xb5'));var _0x3a4050=[];_0x48bd19[_0x77da('0x3d')](function(_0x36decd){_0x3a4050[_0x77da('0xb6')](updateChatInteraction(_0x36decd,_0x3c2d89,_0x490dd8));});return BPromise[_0x77da('0xb7')](_0x3a4050);});});})[_0x77da('0x1f')](function(_0x1176d1){_0x25f65f['rows']=_0x1176d1;return _0x25f65f;})[_0x77da('0x1f')](respondWithFilteredResult(_0x21de41,_0x2dfeca));})[_0x77da('0x29')](handleError(_0x21de41,null));};exports['show']=function(_0x24029c,_0x5177ba){var _0x3b6c44={'raw':![],'where':{'id':_0x24029c[_0x77da('0xb8')]['id']}},_0x2c1d7c={};_0x2c1d7c[_0x77da('0x42')]=_[_0x77da('0x44')](db['ChatInteraction'][_0x77da('0x3f')]);_0x2c1d7c[_0x77da('0x43')]=_['keys'](_0x24029c[_0x77da('0x43')]);_0x2c1d7c['filters']=_['intersection'](_0x2c1d7c[_0x77da('0x42')],_0x2c1d7c['query']);_0x3b6c44['attributes']=_[_0x77da('0x46')](_0x2c1d7c[_0x77da('0x42')],qs[_0x77da('0x48')](_0x24029c[_0x77da('0x43')]['fields']));_0x3b6c44[_0x77da('0x47')]=_0x3b6c44['attributes'][_0x77da('0x49')]?_0x3b6c44['attributes']:_0x2c1d7c['model'];if(_0x24029c[_0x77da('0x43')]['includeAll']){_0x3b6c44[_0x77da('0xb9')]=[{'all':!![]}];}_0x3b6c44=_[_0x77da('0xa0')]({},_0x3b6c44,_0x24029c['options']);return db[_0x77da('0xba')][_0x77da('0x66')](_0x3b6c44)[_0x77da('0x1f')](handleEntityNotFound(_0x5177ba,null))['then'](respondWithResult(_0x5177ba,null))[_0x77da('0x29')](handleError(_0x5177ba,null));};exports[_0x77da('0xbb')]=function(_0x41b6d7,_0x2a344f){return db['ChatInteraction'][_0x77da('0xbb')](_0x41b6d7['body'],{})[_0x77da('0x1f')](respondWithResult(_0x2a344f,0xc9))[_0x77da('0x29')](handleError(_0x2a344f,null));};exports[_0x77da('0x34')]=function(_0x14b8f7,_0x1a31f3){if(_0x14b8f7[_0x77da('0x7d')]['id']){delete _0x14b8f7[_0x77da('0x7d')]['id'];}return db[_0x77da('0xba')][_0x77da('0x66')]({'where':{'id':_0x14b8f7[_0x77da('0xb8')]['id']}})[_0x77da('0x1f')](handleEntityNotFound(_0x1a31f3,null))[_0x77da('0x1f')](saveUpdates(_0x14b8f7[_0x77da('0x7d')],null))['then'](respondWithResult(_0x1a31f3,null))[_0x77da('0x29')](handleError(_0x1a31f3,null));};exports['destroy']=function(_0x52f5fb,_0x1cd28d){return db['ChatInteraction'][_0x77da('0x66')]({'where':{'id':_0x52f5fb[_0x77da('0xb8')]['id']}})['then'](handleEntityNotFound(_0x1cd28d,null))[_0x77da('0x1f')](removeEntity(_0x1cd28d,null))[_0x77da('0x29')](handleError(_0x1cd28d,null));};exports[_0x77da('0xbc')]=function(_0x1ba53c,_0x2d2552){return db[_0x77da('0xba')][_0x77da('0xbc')]()[_0x77da('0x1f')](respondWithResult(_0x2d2552,null))[_0x77da('0x29')](handleError(_0x2d2552,null));};exports[_0x77da('0xbd')]=function(_0x41d7e2,_0x2267c4){if(_0x41d7e2[_0x77da('0x7d')]['id']){delete _0x41d7e2['body']['id'];}return db[_0x77da('0xba')][_0x77da('0x66')]({'where':{'id':_0x41d7e2['params']['id']}})['then'](handleEntityNotFound(_0x2267c4,null))[_0x77da('0x1f')](saveUpdates(_0x41d7e2['body'],null))[_0x77da('0x1f')](respondWithResult(_0x2267c4,null))['catch'](handleError(_0x2267c4,null));};exports[_0x77da('0xbe')]=function(_0x5a4dcd,_0x31a578,_0x2e887c){if(_0x5a4dcd[_0x77da('0x7d')]['id']){delete _0x5a4dcd['body']['id'];}return db['ChatInteraction'][_0x77da('0x66')]({'where':{'id':_0x5a4dcd[_0x77da('0xb8')]['id']}})['then'](function(_0xac3f80){if(!_0xac3f80){logger[_0x77da('0x25')](_0x77da('0xbf'),_0x77da('0xbe'),0x194,_0x77da('0xc0'));_0x31a578[_0x77da('0x2a')](0x194);}else{if(_0xac3f80[_0x77da('0x7c')]){throw new db[(_0x77da('0xc1'))][(_0x77da('0xc2'))](_0x77da('0xc3'));}}return _0xac3f80;})[_0x77da('0x1f')](function(_0x422eca){if(_0x422eca){return _0x422eca[_0x77da('0x34')]({'closed':_0x5a4dcd['body'][_0x77da('0xc4')],'disposition':_0x5a4dcd['body']['disposition']})[_0x77da('0x1f')](function(_0x221ba8){return _0x221ba8;});}})[_0x77da('0x1f')](function(_0x2e3d33){return respondWithRpcPromise('AbandonInteraction',_0x77da('0xbe'),_0x5a4dcd[_0x77da('0x7d')],client9004);})['then'](respondWithResult(_0x31a578,null))[_0x77da('0x29')](handleError(_0x31a578,null));};exports[_0x77da('0xc5')]=function(_0x32845f,_0x211853,_0x2fdd40){_0x32845f[_0x77da('0x7d')]['name']=_0x32845f[_0x77da('0xc6')]['originalname'];_0x32845f[_0x77da('0x7d')][_0x77da('0xc7')]=_0x32845f['file'][_0x77da('0xc8')];_0x32845f['body']['type']=_0x32845f[_0x77da('0xc6')][_0x77da('0xc9')];return db[_0x77da('0xca')]['create'](_0x32845f['body'])['then'](respondWithResult(_0x211853,0xc9))[_0x77da('0x29')](handleError(_0x211853,null));};exports[_0x77da('0xcb')]=function(_0x2b019e,_0x336009,_0x16f067){return db[_0x77da('0xba')][_0x77da('0xcc')]({'where':{'id':_0x2b019e['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x336009,null))[_0x77da('0x1f')](function(_0x177a00){if(_0x177a00){if(_0x177a00[_0x77da('0xc4')]){return _0x336009[_0x77da('0x2b')](0x193)[_0x77da('0x2c')]({'status':0x193,'message':_0x77da('0xcd')});}return db['Attachment'][_0x77da('0xcc')]({'where':{'id':_0x2b019e['query']['attachId']},'raw':!![]})[_0x77da('0x1f')](handleEntityNotFound(_0x336009,null));}})[_0x77da('0x1f')](function(_0x264984){if(_0x264984){return _0x336009[_0x77da('0xce')](path[_0x77da('0xcf')](config[_0x77da('0xd0')],_0x77da('0xd1'),_0x264984['basename']));}})[_0x77da('0x29')](handleError(_0x336009,null));};exports[_0x77da('0xd2')]=function(_0x319972,_0x1b3f24){var _0x3f5aa4=null;var _0x2298bc=null;var _0x525b7e=null;var _0x31116d=null;if(_0x319972[_0x77da('0x7d')]['id']){delete _0x319972[_0x77da('0x7d')]['id'];}if(_0x319972['body']['mailTranscript']){_0x31116d=path[_0x77da('0xcf')](config['root'],'server/files/chat/upload/',util[_0x77da('0xd3')](_0x77da('0xd4'),Date[_0x77da('0xd5')]()));_0x319972['body']['pathTranscript']=_0x31116d;}return db[_0x77da('0xba')]['find']({'where':{'id':_0x319972[_0x77da('0xb8')]['id']},'include':[{'model':db[_0x77da('0xd6')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0x77da('0x1f')](handleEntityNotFound(_0x1b3f24,null))[_0x77da('0x1f')](saveUpdates(_0x319972[_0x77da('0x7d')],null))[_0x77da('0x1f')](function(_0x37669b){if(_0x37669b){_0x3f5aa4=_0x37669b;return db['ChatWebsite'][_0x77da('0x66')]({'where':{'id':_0x3f5aa4[_0x77da('0xd7')]}});}})['then'](function(_0x4c5bfe){if(_0x4c5bfe){_0x525b7e=_0x4c5bfe;return db[_0x77da('0xd8')][_0x77da('0x66')]({'where':{'id':_0x3f5aa4[_0x77da('0x71')]}});}})['then'](function(_0x20b1fa){if(_0x20b1fa){_0x2298bc=_0x20b1fa;if(_0x31116d){var _0x4840c5=null;for(var _0xaf82f4=0x1;_0xaf82f4<_0x3f5aa4['Messages']['length'];++_0xaf82f4){_0x4840c5=_0x3f5aa4[_0x77da('0xd9')][_0xaf82f4];var _0x44b1f7=_0x4840c5[_0x77da('0x7c')]?util[_0x77da('0xd3')](_0x77da('0xda'),_0x525b7e[_0x77da('0xdb')],_0x4840c5[_0x77da('0x7c')]):'System';var _0x2d9b7b=_0x319972[_0x77da('0x7d')][_0x77da('0xdc')]||util['format'](_0x77da('0xda'),_0x77da('0xdd'),_0x4840c5[_0x77da('0x71')]);switch(_0x525b7e[_0x77da('0xde')]){case _0x77da('0xdf'):_0x44b1f7=_0x4840c5['UserId']?util[_0x77da('0xd3')](_0x77da('0xda'),_0x525b7e[_0x77da('0xdb')],_0x4840c5[_0x77da('0x7c')]):_0x77da('0xe0');break;case'agent_alias':_0x44b1f7=_0x4840c5[_0x77da('0x7c')]?_0x4840c5[_0x77da('0x7a')]['alias']||_0x4840c5[_0x77da('0x7a')][_0x77da('0xe1')]:_0x77da('0xe0');break;case _0x77da('0xe2'):_0x44b1f7=_0x4840c5[_0x77da('0x7c')]?_0x4840c5['User'][_0x77da('0xe1')]:_0x77da('0xe0');break;default:_0x44b1f7=_0x4840c5['UserId']?util[_0x77da('0xd3')](_0x77da('0xda'),_0x525b7e['agentAlias'],_0x4840c5['UserId']):'System';}var _0x1c2c42=util[_0x77da('0xd3')](_0x77da('0xe3'),moment(_0x4840c5[_0x77da('0x83')])['format'](_0x77da('0xe4')),_0x4840c5[_0x77da('0xe5')]==='in'?_0x2d9b7b:_0x44b1f7,_0x4840c5[_0x77da('0x7d')]);if(!_0x4840c5[_0x77da('0xe6')]){fs[_0x77da('0xe7')](_0x31116d,_0x1c2c42);}}return db[_0x77da('0xe8')][_0x77da('0xcc')]({'where':{'service':!![]},'include':[{'model':db[_0x77da('0xe9')],'as':_0x77da('0xea'),'raw':!![]}]});}}})[_0x77da('0x1f')](function(_0x56ebd3){if(_0x56ebd3&&_0x56ebd3[_0x77da('0xea')]&&_0x319972['body']){var _0x2854f3={'tls':{'rejectUnauthorized':![]}};if(_0x56ebd3[_0x77da('0xea')][_0x77da('0xeb')]){_0x2854f3[_0x77da('0xeb')]=_0x56ebd3[_0x77da('0xea')][_0x77da('0xeb')];}else{_0x2854f3['host']=_0x56ebd3[_0x77da('0xea')][_0x77da('0xec')];_0x2854f3['port']=_0x56ebd3[_0x77da('0xea')]['port'];_0x2854f3['secure']=_0x56ebd3[_0x77da('0xea')][_0x77da('0xed')];}if(_0x56ebd3[_0x77da('0xea')][_0x77da('0xee')]){_0x2854f3[_0x77da('0xef')]={'user':_0x56ebd3[_0x77da('0xea')]['user'],'pass':_0x56ebd3['Smtp'][_0x77da('0xf0')]};}return respondWithRpcPromise(_0x77da('0xf1'),'sendMail',{'account':_0x2854f3,'message':{'from':util['format'](_0x77da('0xf2'),_0x56ebd3[_0x77da('0x37')],_0x56ebd3['email']||_0x56ebd3['Smtp']['user']),'to':_0x319972['body'][_0x77da('0xf3')],'subject':_0x77da('0xf4'),'text':util[_0x77da('0xd3')](_0x77da('0xf5'),_0x319972[_0x77da('0x7d')][_0x77da('0xf3')]),'attachments':[{'path':_0x31116d}]}})[_0x77da('0x1f')](function(){return _0x3f5aa4;})['catch'](function(_0x362c36){console[_0x77da('0x25')](_0x362c36);});}else{return _0x3f5aa4;}})[_0x77da('0x1f')](respondWithStatusCode(_0x1b3f24,0xc8))[_0x77da('0x29')](handleError(_0x1b3f24,null));};exports[_0x77da('0xf6')]=function(_0x28e635,_0x40f21d,_0x7706a){return db[_0x77da('0xd6')][_0x77da('0x66')]({'where':{'id':_0x28e635[_0x77da('0xb8')]['id']}})[_0x77da('0x1f')](handleEntityNotFound(_0x40f21d,null))['then'](function(_0x11c893){if(_0x11c893){return _0x11c893[_0x77da('0xf6')](_0x28e635[_0x77da('0x7d')][_0x77da('0xf7')],_[_0x77da('0xf8')](_0x28e635[_0x77da('0x7d')],[_0x77da('0xf7'),'id'])||{});}})[_0x77da('0x1f')](respondWithResult(_0x40f21d,null))['catch'](handleError(_0x40f21d,null));};exports[_0x77da('0xf9')]=function(_0x55808a,_0x442836,_0x476590){var _0x46ccb0={'raw':![],'where':{}};var _0x237aa0={};var _0x5143cc={'count':0x0,'rows':[]};return db[_0x77da('0xba')][_0x77da('0xcc')]({'where':{'id':_0x55808a['params']['id']}})[_0x77da('0x1f')](handleEntityNotFound(_0x442836,null))[_0x77da('0x1f')](function(_0x24d278){if(_0x24d278){_0x237aa0[_0x77da('0x42')]=_[_0x77da('0x44')](db[_0x77da('0xd6')][_0x77da('0x3f')]);_0x237aa0[_0x77da('0x43')]=_[_0x77da('0x44')](_0x55808a[_0x77da('0x43')]);_0x237aa0[_0x77da('0x45')]=_['intersection'](_0x237aa0[_0x77da('0x42')],_0x237aa0['query']);_0x46ccb0[_0x77da('0x47')]=_['intersection'](_0x237aa0['model'],qs[_0x77da('0x48')](_0x55808a['query'][_0x77da('0x48')]));_0x46ccb0[_0x77da('0x47')]=_0x46ccb0['attributes'][_0x77da('0x49')]?_0x46ccb0['attributes']:_0x237aa0[_0x77da('0x42')];if(!_0x55808a['query']['hasOwnProperty']('nolimit')){_0x46ccb0['limit']=qs['limit'](_0x55808a[_0x77da('0x43')]['limit']);_0x46ccb0[_0x77da('0x2e')]=qs[_0x77da('0x2e')](_0x55808a[_0x77da('0x43')]['offset']);}_0x46ccb0[_0x77da('0x4b')]=qs['sort'](_0x55808a[_0x77da('0x43')]['sort']);_0x46ccb0[_0x77da('0x87')]=qs['filters'](_[_0x77da('0x4d')](_0x55808a['query'],_0x237aa0[_0x77da('0x45')]));_0x46ccb0[_0x77da('0x87')][_0x77da('0xb5')]=_0x24d278['id'];if(_0x55808a[_0x77da('0x43')][_0x77da('0x8e')]){_0x46ccb0[_0x77da('0x87')]=_[_0x77da('0xa0')](_0x46ccb0[_0x77da('0x87')],{'$or':_[_0x77da('0x3a')](_0x46ccb0[_0x77da('0x47')],function(_0x8aed7d){var _0x35b243={};_0x35b243[_0x8aed7d]={'$like':'%'+_0x55808a[_0x77da('0x43')][_0x77da('0x8e')]+'%'};return _0x35b243;})});}if(_0x55808a['query']['$gte']){var _0x6dff0e=_0x55808a[_0x77da('0x43')][_0x77da('0x85')][_0x77da('0x6d')](',');var _0x222ec2={};_0x222ec2[_0x6dff0e[0x0]]={'$gte':moment(_0x6dff0e[0x1])[_0x77da('0xd3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x46ccb0[_0x77da('0x87')]=_['merge'](_0x46ccb0[_0x77da('0x87')],_0x222ec2);}_0x46ccb0=_[_0x77da('0xa0')]({},_0x46ccb0,_0x55808a['options']);return db[_0x77da('0xd6')][_0x77da('0x2d')]({'where':_0x46ccb0[_0x77da('0x87')]})[_0x77da('0x1f')](function(_0x5a548e){_0x5143cc[_0x77da('0x2d')]=_0x5a548e;if(_0x55808a[_0x77da('0x43')][_0x77da('0xfa')]){_0x46ccb0[_0x77da('0xb9')]=[{'all':!![]}];}return db[_0x77da('0xd6')][_0x77da('0xfb')](_0x46ccb0);})[_0x77da('0x1f')](function(_0xbddfc9){_0x5143cc[_0x77da('0xfc')]=_0xbddfc9;return _0x5143cc;});}})[_0x77da('0x1f')](respondWithFilteredResult(_0x442836,_0x46ccb0))[_0x77da('0x29')](handleError(_0x442836,null));};exports['getMyMessages']=function(_0x16b763,_0x15b293,_0x352bad){var _0x508025={'where':{}},_0x24e34f={},_0x3d6ea8={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x77da('0xcc')]({'where':{'id':_0x16b763[_0x77da('0xb8')]['id']}})[_0x77da('0x1f')](handleEntityNotFound(_0x15b293,null))['then'](function(_0x57a0bd){if(_0x57a0bd){_0x24e34f['model']=_[_0x77da('0x44')](db[_0x77da('0xd6')][_0x77da('0x3f')]);_0x24e34f['query']=_[_0x77da('0x44')](_0x16b763['query']);_0x24e34f[_0x77da('0x45')]=_['intersection'](_0x24e34f[_0x77da('0x42')],_0x24e34f[_0x77da('0x43')]);_0x508025[_0x77da('0x47')]=_[_0x77da('0x46')](_0x24e34f[_0x77da('0x42')],qs[_0x77da('0x48')](_0x16b763['query'][_0x77da('0x48')]));_0x508025[_0x77da('0x47')]=_0x508025[_0x77da('0x47')][_0x77da('0x49')]?_0x508025[_0x77da('0x47')]:_0x24e34f['model'];if(!_0x16b763[_0x77da('0x43')][_0x77da('0x4a')](_0x77da('0xfd'))){_0x508025[_0x77da('0x2f')]=qs[_0x77da('0x2f')](_0x16b763[_0x77da('0x43')][_0x77da('0x2f')]);_0x508025[_0x77da('0x2e')]=qs['offset'](_0x16b763[_0x77da('0x43')][_0x77da('0x2e')]);}_0x508025[_0x77da('0x4b')]=qs[_0x77da('0x4c')](_0x16b763[_0x77da('0x43')][_0x77da('0x4c')]);_0x508025[_0x77da('0x87')]=qs['filters'](_['pick'](_0x16b763[_0x77da('0x43')],_0x24e34f[_0x77da('0x45')]));_0x508025['where'][_0x77da('0xb5')]=_0x57a0bd['id'];if(_0x16b763[_0x77da('0x43')][_0x77da('0x8e')]){_0x508025[_0x77da('0x87')]=_[_0x77da('0xa0')](_0x508025['where'],{'$or':_[_0x77da('0x3a')](_0x508025[_0x77da('0x47')],function(_0x195ddd){var _0x42a46e={};_0x42a46e[_0x195ddd]={'$like':'%'+_0x16b763[_0x77da('0x43')]['filter']+'%'};return _0x42a46e;})});}_0x508025[_0x77da('0x87')][_0x77da('0xe6')]=![];if(_0x16b763[_0x77da('0x43')]['id']){_0x508025[_0x77da('0x87')]['id']={'$gt':_0x16b763[_0x77da('0x43')]['id']};}_0x508025=_[_0x77da('0xa0')]({},_0x508025,_0x16b763['options']);return db[_0x77da('0xd6')][_0x77da('0x2d')]({'where':_0x508025['where']})[_0x77da('0x1f')](function(_0x33ab80){_0x3d6ea8[_0x77da('0x2d')]=_0x33ab80;_0x508025[_0x77da('0xb9')]=[];if(_0x16b763[_0x77da('0x43')]['includeAgent']){_0x508025[_0x77da('0xb9')]['push']({'model':db[_0x77da('0x7a')],'as':_0x77da('0x7a'),'attributes':['id','fullname',_0x77da('0xfe')]});}if(_0x16b763[_0x77da('0x43')][_0x77da('0xfa')]){_0x508025[_0x77da('0xb9')]=[{'all':!![]}];}return db[_0x77da('0xd6')][_0x77da('0xfb')](_0x508025);})[_0x77da('0x1f')](function(_0xdf1eda){_0x3d6ea8[_0x77da('0xfc')]=_0xdf1eda;return _0x3d6ea8;});}})[_0x77da('0x1f')](respondWithFilteredResult(_0x15b293,_0x508025))[_0x77da('0x29')](handleError(_0x15b293,null));};exports['addTags']=function(_0x508db1,_0x37950f,_0x11e8fc){return db['ChatInteraction'][_0x77da('0x66')]({'where':{'id':_0x508db1[_0x77da('0xb8')]['id']}})[_0x77da('0x1f')](handleEntityNotFound(_0x37950f,null))[_0x77da('0x1f')](function(_0x8d04f5){if(_0x8d04f5){return _0x8d04f5[_0x77da('0xff')](_0x508db1[_0x77da('0x7d')][_0x77da('0xf7')],_[_0x77da('0xf8')](_0x508db1[_0x77da('0x7d')],[_0x77da('0xf7'),'id'])||{})[_0x77da('0x100')](function(){return db['Tag']['findAll']({'attributes':['id',_0x77da('0x37'),_0x77da('0x50')],'where':{'id':_0x508db1[_0x77da('0x7d')][_0x77da('0xf7')]}});})[_0x77da('0x1f')](function(_0x21967b){socket[_0x77da('0x101')](_0x77da('0x102'),{'id':Number(_0x508db1[_0x77da('0xb8')]['id']),'tags':_0x21967b||[]});return{'id':Number(_0x508db1['params']['id']),'tags':_0x21967b||[]};});}})['then'](respondWithResult(_0x37950f,null))[_0x77da('0x29')](handleError(_0x37950f,null));};exports[_0x77da('0x103')]=function(_0x9a8a08,_0x356e50,_0x4465aa){return db['ChatInteraction']['find']({'where':{'id':_0x9a8a08[_0x77da('0xb8')]['id']}})[_0x77da('0x1f')](handleEntityNotFound(_0x356e50,null))[_0x77da('0x1f')](function(_0x4609aa){if(_0x4609aa){return _0x4609aa[_0x77da('0x103')](_0x9a8a08[_0x77da('0x43')][_0x77da('0xf7')]);}})[_0x77da('0x1f')](respondWithStatusCode(_0x356e50,null))[_0x77da('0x29')](handleError(_0x356e50,null));};exports['download']=function(_0x4e48d1,_0x4af714){var _0x5c0d28=moment()['unix']()[_0x77da('0x9e')]();var _0x177019=path[_0x77da('0xcf')](config[_0x77da('0xd0')],_0x77da('0x104'),_0x77da('0x105'),'tmp');var _0x996c29=path[_0x77da('0xcf')](config[_0x77da('0xd0')],'server',_0x77da('0x105'),_0x77da('0x106'));var _0x5b1635=path['join'](_0x177019,_0x5c0d28);var _0x3b489c=util[_0x77da('0xd3')](_0x77da('0x107'),_0x4e48d1[_0x77da('0xb8')]['id'],_0x5c0d28);var _0x3ab97d=path[_0x77da('0xcf')](_0x177019,_0x3b489c);var _0x4e105c=[];_0x4e105c[_0x77da('0xb6')]({'model':db['User'],'as':'User','attributes':['id',_0x77da('0xe1')],'raw':!![]});_0x4e105c[_0x77da('0xb6')]({'model':db[_0x77da('0xd8')],'as':_0x77da('0x6b'),'attributes':['id',_0x77da('0x108'),_0x77da('0x109')],'raw':!![]});if(_0x4e48d1[_0x77da('0x43')][_0x77da('0x106')]){_0x4e105c[_0x77da('0xb6')]({'model':db['Attachment'],'as':_0x77da('0xca'),'raw':!![]});}var _0x200a02=[{'model':db[_0x77da('0xd6')],'as':_0x77da('0xd9'),'attributes':['id',_0x77da('0x7d'),_0x77da('0x83'),_0x77da('0xe5'),'secret',_0x77da('0x8b')],'include':_0x4e105c}];_0x200a02[_0x77da('0xb6')]({'model':db[_0x77da('0x10a')],'as':'Account','attributes':['id',_0x77da('0x37')]});_0x200a02[_0x77da('0xb6')]({'model':db[_0x77da('0x7a')],'as':_0x77da('0x10b'),'attributes':['id','fullname']});return db[_0x77da('0xba')][_0x77da('0x66')]({'where':{'id':_0x4e48d1[_0x77da('0xb8')]['id']},'include':_0x200a02})[_0x77da('0x1f')](handleEntityNotFound(_0x4af714,null))[_0x77da('0x1f')](function(_0x4ac3f4){if(_0x4ac3f4){var _0x5b4905=_0x4ac3f4['get']({'plain':!![]});fs['mkdirSync'](_0x5b1635);var _0x354044={'format':'A4','border':_0x77da('0x10c'),'header':{'height':_0x77da('0x10d'),'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
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'}},'footer':{'height':'30px','contents':{'default':util['format'](_0x77da('0x10e'),util[_0x77da('0xd3')](_0x77da('0x10f'),_0x77da('0x110'),_0x5b4905['id']),moment()['format']('YYYY-MM-DD')[_0x77da('0x9e')]())}}};var _0x562100={'channel':_0x77da('0x110'),'account':_0x5b4905['Account'][_0x77da('0x37')],'agent':_0x5b4905[_0x77da('0x10b')]?_0x5b4905['Owner'][_0x77da('0xe1')]:_0x77da('0x111'),'createdAt':moment(_0x5b4905[_0x77da('0x83')])['format'](_0x77da('0x112'))[_0x77da('0x9e')](),'closedAt':_0x5b4905[_0x77da('0xc4')]?moment(_0x5b4905['closedAt'])[_0x77da('0xd3')](_0x77da('0x112'))[_0x77da('0x9e')]():'','disposition':_0x5b4905[_0x77da('0x113')],'chatInfo':{'browser':_0x5b4905[_0x77da('0x114')],'os':_0x5b4905[_0x77da('0x115')],'referer':_0x5b4905['referer'],'customerIp':_0x5b4905[_0x77da('0x116')],'customerPort':_0x5b4905[_0x77da('0x117')]?_0x5b4905[_0x77da('0x117')]:'N.A.'},'messages':_(_0x5b4905[_0x77da('0xd9')])['tail']()[_0x77da('0x8e')]({'secret':![]})[_0x77da('0x3a')](function(_0x3972fd){if(_0x3972fd[_0x77da('0xca')]){var _0x5307dd=path[_0x77da('0xcf')](_0x996c29,_0x3972fd[_0x77da('0xca')][_0x77da('0xc7')]);if(fs['existsSync'](_0x5307dd)){fs[_0x77da('0x118')](_0x5307dd)[_0x77da('0x119')](fs[_0x77da('0x11a')](path['join'](_0x5b1635,_0x3972fd['Attachment'][_0x77da('0xc7')])));}}return{'date':moment(_0x3972fd[_0x77da('0x83')])[_0x77da('0xd3')](_0x77da('0x112'))['toString'](),'sender':_0x3972fd[_0x77da('0xe5')]===_0x77da('0x11b')?_0x3972fd[_0x77da('0x7a')]?_0x3972fd[_0x77da('0x7a')]['fullname']:_0x77da('0xe0'):_0x3972fd[_0x77da('0x6b')][_0x77da('0x108')]+(_0x3972fd[_0x77da('0x6b')][_0x77da('0x109')]?'\x20'+_0x3972fd[_0x77da('0x6b')][_0x77da('0x109')]:''),'body':_0x3972fd[_0x77da('0xca')]?_0x3972fd['Attachment'][_0x77da('0xc7')]:_0x3972fd[_0x77da('0x7d')],'direction':_0x3972fd[_0x77da('0xe5')]===_0x77da('0x11b')?'A':'C','secret':_0x3972fd[_0x77da('0xe6')],'read':_0x3972fd['read'],'attachment':_0x3972fd[_0x77da('0xca')]};})[_0x77da('0x6f')]()};return ejs[_0x77da('0x11c')](path[_0x77da('0xcf')](config[_0x77da('0xd0')],'server',_0x77da('0x11d'),_0x77da('0x11e')),{'interaction':_0x562100})[_0x77da('0x1f')](function(_0x1c92b2){return new BPromise(function(_0x11d10b,_0x156e10){pdf[_0x77da('0xbb')](_0x1c92b2,_0x354044)[_0x77da('0x11f')](path[_0x77da('0xcf')](_0x5b1635,_0x77da('0x120')+_0x5b4905['id']+'-'+_0x5c0d28+_0x77da('0x121')),function(_0xa2db07,_0x42a9ca){if(_0xa2db07)return _0x156e10(_0xa2db07);_0x11d10b(_0x42a9ca);});});})['then'](function(){return new BPromise(function(_0x1506bb,_0x114b11){zipdir(_0x5b1635,{'saveTo':_0x3ab97d},function(_0x4c9246,_0x4e6325){if(_0x4c9246)return _0x114b11(_0x4c9246);return _0x1506bb(_0x4e6325);});})[_0x77da('0x1f')](function(){return new BPromise(function(_0x4775bd,_0x415747){rimraf(_0x5b1635,function(_0x1dcd67){if(_0x1dcd67)_0x415747(_0x1dcd67);return _0x4775bd();});});})[_0x77da('0x1f')](function(){return _0x4af714[_0x77da('0xce')](_0x3ab97d,_0x3b489c,function(_0x1c05e8){if(_0x1c05e8){console[_0x77da('0x122')](_0x77da('0x123'),_0x1c05e8);}else{fs['unlinkSync'](_0x3ab97d);}});});});}else{return _0x4af714[_0x77da('0x2a')](0xc8);}})['catch'](handleError(_0x4af714,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index cbb221c..6056492 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 _0xe55d=['map','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','Users'];(function(_0x2cb3eb,_0x4d83aa){var _0x2759ee=function(_0x4108a0){while(--_0x4108a0){_0x2cb3eb['push'](_0x2cb3eb['shift']());}};_0x2759ee(++_0x4d83aa);}(_0xe55d,0x126));var _0xde55=function(_0x1d56f0,_0x2f8ed7){_0x1d56f0=_0x1d56f0-0x0;var _0x546402=_0xe55d[_0x1d56f0];return _0x546402;};'use strict';var EventEmitter=require(_0xde55('0x0'));var ChatInteraction=require(_0xde55('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xde55('0x1'))['db'][_0xde55('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xde55('0x3')](0x0);var events={'afterCreate':_0xde55('0x4'),'afterUpdate':_0xde55('0x5'),'afterDestroy':_0xde55('0x6')};function emitEvent(_0x532d91){return function(_0x269409,_0x295f54,_0x3b2c0a){_0x269409['getUsers']({'attributes':['id'],'raw':!![]})[_0xde55('0x7')](function(_0x1468f2){_0x269409[_0xde55('0x8')](_0xde55('0x9'),_0x1468f2[_0xde55('0xa')](function(_0x40bad4){return{'id':_0x40bad4['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x269409['id'],'direction':'in','read':![]},'raw':!![]});})[_0xde55('0x7')](function(_0x170817){_0x269409['setDataValue']('unreadMessages',_0x170817[_0xde55('0xb')]);ChatInteractionEvents[_0xde55('0xc')](_0x532d91+':'+_0x269409['id'],_0x269409);ChatInteractionEvents['emit'](_0x532d91,_0x269409);_0x3b2c0a(null);})[_0xde55('0xd')](_0x3b2c0a(null));};}for(var e in events){if(events[_0xde55('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xde55('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0xdcde=['events','../../mysqldb','ChatMessage','setMaxListeners','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x55c3e8,_0x579784){var _0x251e1c=function(_0x482032){while(--_0x482032){_0x55c3e8['push'](_0x55c3e8['shift']());}};_0x251e1c(++_0x579784);}(_0xdcde,0x1d0));var _0xedcd=function(_0xbc6fc0,_0x135ebf){_0xbc6fc0=_0xbc6fc0-0x0;var _0x254b84=_0xdcde[_0xbc6fc0];return _0x254b84;};'use strict';var EventEmitter=require(_0xedcd('0x0'));var ChatInteraction=require(_0xedcd('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xedcd('0x1'))['db'][_0xedcd('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xedcd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc9e22d){return function(_0x314f23,_0xc47415,_0x58cda1){_0x314f23[_0xedcd('0x4')]({'attributes':['id'],'raw':!![]})[_0xedcd('0x5')](function(_0x106aaa){_0x314f23[_0xedcd('0x6')]('Users',_0x106aaa[_0xedcd('0x7')](function(_0x2ce75a){return{'id':_0x2ce75a['id']};}));return ChatMessage[_0xedcd('0x8')]({'where':{'ChatInteractionId':_0x314f23['id'],'direction':'in','read':![]},'raw':!![]});})[_0xedcd('0x5')](function(_0x94fdc8){_0x314f23[_0xedcd('0x6')](_0xedcd('0x9'),_0x94fdc8[_0xedcd('0xa')]);ChatInteractionEvents[_0xedcd('0xb')](_0xc9e22d+':'+_0x314f23['id'],_0x314f23);ChatInteractionEvents[_0xedcd('0xb')](_0xc9e22d,_0x314f23);_0x58cda1(null);})[_0xedcd('0xc')](_0x58cda1(null));};}for(var e in events){if(events[_0xedcd('0xd')](e)){var event=events[e];ChatInteraction[_0xedcd('0xe')](e,emitEvent(event));}}module[_0xedcd('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 9e90af9..1455df1 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 _0x4226=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment'];(function(_0x25bfee,_0x1a0f57){var _0x5ef0b8=function(_0x1506d5){while(--_0x1506d5){_0x25bfee['push'](_0x25bfee['shift']());}};_0x5ef0b8(++_0x1a0f57);}(_0x4226,0x12e));var _0x6422=function(_0x49c816,_0x198631){_0x49c816=_0x49c816-0x0;var _0x23bcac=_0x4226[_0x49c816];return _0x23bcac;};'use strict';var _=require(_0x6422('0x0'));var util=require('util');var logger=require(_0x6422('0x1'))(_0x6422('0x2'));var moment=require(_0x6422('0x3'));var BPromise=require(_0x6422('0x4'));var rp=require(_0x6422('0x5'));var fs=require('fs');var path=require(_0x6422('0x6'));var rimraf=require(_0x6422('0x7'));var config=require(_0x6422('0x8'));var attributes=require(_0x6422('0x9'));module[_0x6422('0xa')]=function(_0x34fd74,_0x42841c){return _0x34fd74[_0x6422('0xb')](_0x6422('0xc'),attributes,{'tableName':_0x6422('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x250f14,_0x411205,_0x715777){if(_0x250f14[_0x6422('0xe')]('closed')){_0x250f14[_0x6422('0xf')]=moment()[_0x6422('0x10')](_0x6422('0x11'));}_0x715777(null,_0x250f14);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0f7a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatInteraction.attributes','ChatInteraction','changed','closed','utf8mb4_unicode_ci'];(function(_0x2dbf71,_0x2d1284){var _0x744fbd=function(_0x21ead7){while(--_0x21ead7){_0x2dbf71['push'](_0x2dbf71['shift']());}};_0x744fbd(++_0x2d1284);}(_0x0f7a,0xfc));var _0xa0f7=function(_0xffd8b0,_0x12c51f){_0xffd8b0=_0xffd8b0-0x0;var _0x301ba0=_0x0f7a[_0xffd8b0];return _0x301ba0;};'use strict';var _=require(_0xa0f7('0x0'));var util=require(_0xa0f7('0x1'));var logger=require(_0xa0f7('0x2'))(_0xa0f7('0x3'));var moment=require(_0xa0f7('0x4'));var BPromise=require(_0xa0f7('0x5'));var rp=require(_0xa0f7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa0f7('0x7'));module['exports']=function(_0x4c8082,_0x503db0){return _0x4c8082['define'](_0xa0f7('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46b4a5,_0xf3c95a,_0x2319fc){if(_0x46b4a5[_0xa0f7('0x9')](_0xa0f7('0xa'))){_0x46b4a5['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2319fc(null,_0x46b4a5);}},'charset':'utf8mb4','collate':_0xa0f7('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 8dd4fdb..aa76f8b 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 _0x8be1=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','stringify','catch','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3c060e,_0xe7517){var _0x3888b4=function(_0x3c9d75){while(--_0x3c9d75){_0x3c060e['push'](_0x3c060e['shift']());}};_0x3888b4(++_0xe7517);}(_0x8be1,0x7c));var _0x18be=function(_0x3c3064,_0x43b9e9){_0x3c3064=_0x3c3064-0x0;var _0x49dafd=_0x8be1[_0x3c3064];return _0x49dafd;};'use strict';var _=require(_0x18be('0x0'));var util=require(_0x18be('0x1'));var moment=require(_0x18be('0x2'));var BPromise=require(_0x18be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x18be('0x4'));var logger=require(_0x18be('0x5'))(_0x18be('0x6'));var config=require(_0x18be('0x7'));var jayson=require(_0x18be('0x8'));var client=jayson[_0x18be('0x9')][_0x18be('0xa')]({'port':0x232a});config[_0x18be('0xb')]=_[_0x18be('0xc')](config[_0x18be('0xb')],{'host':_0x18be('0xd'),'port':0x18eb});var socket=require(_0x18be('0xe'))(new Redis(config['redis']));require(_0x18be('0xf'))[_0x18be('0x10')](socket);function respondWithRpcPromise(_0x28d202,_0x831195,_0x2c8b5c){return new BPromise(function(_0x43b868,_0xdb4246){return client[_0x18be('0x11')](_0x28d202,_0x2c8b5c)[_0x18be('0x12')](function(_0x47fdd8){logger[_0x18be('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x831195,_0x18be('0x14'));logger[_0x18be('0x15')](_0x18be('0x16'),_0x831195,_0x18be('0x14'),JSON['stringify'](_0x47fdd8));if(_0x47fdd8[_0x18be('0x17')]){if(_0x47fdd8['error'][_0x18be('0x18')]===0x1f4){logger[_0x18be('0x17')](_0x18be('0x19'),_0x831195,_0x47fdd8['error'][_0x18be('0x1a')]);return _0xdb4246(_0x47fdd8['error']['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x831195,_0x47fdd8[_0x18be('0x17')][_0x18be('0x1a')]);return _0x43b868(_0x47fdd8['error'][_0x18be('0x1a')]);}else{logger['info'](_0x18be('0x19'),_0x831195,_0x18be('0x14'));_0x43b868(_0x47fdd8[_0x18be('0x1b')][_0x18be('0x1a')]);}})['catch'](function(_0x4a4a7d){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x831195,_0x4a4a7d);_0xdb4246(_0x4a4a7d);});});}exports[_0x18be('0x1c')]=function(_0x6071bb){var _0xfb0db=this;return new Promise(function(_0x5e8231,_0x1598b0){return db[_0x18be('0x1d')][_0x18be('0x1e')](_0x6071bb[_0x18be('0x1f')],{'raw':_0x6071bb[_0x18be('0x20')]?_0x6071bb['options'][_0x18be('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6071bb[_0x18be('0x20')]?_0x6071bb[_0x18be('0x20')]['where']||null:null,'attributes':_0x6071bb[_0x18be('0x20')]?_0x6071bb[_0x18be('0x20')][_0x18be('0x22')]||null:null,'limit':_0x6071bb['options']?_0x6071bb[_0x18be('0x20')][_0x18be('0x23')]||null:null})[_0x18be('0x12')](function(_0x4d9eae){logger[_0x18be('0x13')]('UpdateChatInteraction',_0x6071bb);logger[_0x18be('0x15')](_0x18be('0x1c'),_0x6071bb,JSON[_0x18be('0x24')](_0x4d9eae));_0x5e8231(_0x4d9eae);})[_0x18be('0x25')](function(_0x2630a5){logger[_0x18be('0x17')]('UpdateChatInteraction',_0x2630a5['message'],_0x6071bb);_0x1598b0(_0xfb0db[_0x18be('0x17')](0x1f4,_0x2630a5[_0x18be('0x1a')]));});});};exports[_0x18be('0x26')]=function(_0x37e9f7){return new Promise(function(_0x592b65,_0x580b9e){return db['ChatInteraction'][_0x18be('0x27')]({'where':_0x37e9f7[_0x18be('0x20')]?_0x37e9f7['options']['where']||null:null})[_0x18be('0x12')](function(_0x4c8b40){if(_0x4c8b40){return _0x4c8b40['addTags'](_0x37e9f7[_0x18be('0x1f')][_0x18be('0x28')],_[_0x18be('0x29')](_0x37e9f7['body'],[_0x18be('0x28'),'id'])||{});}})[_0x18be('0x2a')](function(_0x4a89a1){logger[_0x18be('0x13')](_0x18be('0x2b'),_0x37e9f7);logger[_0x18be('0x15')]('AddTags',_0x37e9f7,JSON['stringify'](_0x4a89a1));_0x592b65(_0x4a89a1);})['catch'](function(_0x4d2d0c){logger[_0x18be('0x17')]('AddTags',_0x4d2d0c['message'],_0x37e9f7);_0x580b9e(_this[_0x18be('0x17')](0x1f4,_0x4d2d0c['message']));});});}; \ No newline at end of file +var _0x2d04=['message','result','catch','UpdateChatInteraction','options','raw','where','limit','then','stringify','AddTagsToChatInteraction','ChatInteraction','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x2d04,0x1a1));var _0x42d0=function(_0x10c6b9,_0x462e4f){_0x10c6b9=_0x10c6b9-0x0;var _0x1e5c55=_0x2d04[_0x10c6b9];return _0x1e5c55;};'use strict';var _=require(_0x42d0('0x0'));var util=require(_0x42d0('0x1'));var moment=require(_0x42d0('0x2'));var BPromise=require(_0x42d0('0x3'));var rs=require(_0x42d0('0x4'));var fs=require('fs');var Redis=require(_0x42d0('0x5'));var db=require(_0x42d0('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x42d0('0x7'));var config=require(_0x42d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x42d0('0x9')][_0x42d0('0xa')]({'port':0x232a});config[_0x42d0('0xb')]=_[_0x42d0('0xc')](config[_0x42d0('0xb')],{'host':_0x42d0('0xd'),'port':0x18eb});var socket=require(_0x42d0('0xe'))(new Redis(config[_0x42d0('0xb')]));require(_0x42d0('0xf'))['register'](socket);function respondWithRpcPromise(_0x2cfd26,_0x245056,_0x2b970a){return new BPromise(function(_0x258339,_0x1ea13c){return client['request'](_0x2cfd26,_0x2b970a)['then'](function(_0x2b11b9){logger[_0x42d0('0x10')](_0x42d0('0x11'),_0x245056,'request\x20sent');logger[_0x42d0('0x12')](_0x42d0('0x13'),_0x245056,_0x42d0('0x14'),JSON['stringify'](_0x2b11b9));if(_0x2b11b9[_0x42d0('0x15')]){if(_0x2b11b9['error'][_0x42d0('0x16')]===0x1f4){logger[_0x42d0('0x15')](_0x42d0('0x11'),_0x245056,_0x2b11b9[_0x42d0('0x15')][_0x42d0('0x17')]);return _0x1ea13c(_0x2b11b9[_0x42d0('0x15')][_0x42d0('0x17')]);}logger['error'](_0x42d0('0x11'),_0x245056,_0x2b11b9['error'][_0x42d0('0x17')]);return _0x258339(_0x2b11b9[_0x42d0('0x15')][_0x42d0('0x17')]);}else{logger[_0x42d0('0x10')](_0x42d0('0x11'),_0x245056,'request\x20sent');_0x258339(_0x2b11b9[_0x42d0('0x18')][_0x42d0('0x17')]);}})[_0x42d0('0x19')](function(_0x332fe5){logger[_0x42d0('0x15')](_0x42d0('0x11'),_0x245056,_0x332fe5);_0x1ea13c(_0x332fe5);});});}exports[_0x42d0('0x1a')]=function(_0x3b6d32){var _0x4ffbd6=this;return new Promise(function(_0x5a5d20,_0x28fb7e){return db['ChatInteraction']['update'](_0x3b6d32['body'],{'raw':_0x3b6d32[_0x42d0('0x1b')]?_0x3b6d32[_0x42d0('0x1b')][_0x42d0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b6d32[_0x42d0('0x1b')]?_0x3b6d32['options'][_0x42d0('0x1d')]||null:null,'attributes':_0x3b6d32[_0x42d0('0x1b')]?_0x3b6d32[_0x42d0('0x1b')]['attributes']||null:null,'limit':_0x3b6d32[_0x42d0('0x1b')]?_0x3b6d32[_0x42d0('0x1b')][_0x42d0('0x1e')]||null:null})[_0x42d0('0x1f')](function(_0x73c418){logger['info'](_0x42d0('0x1a'),_0x3b6d32);logger[_0x42d0('0x12')](_0x42d0('0x1a'),_0x3b6d32,JSON[_0x42d0('0x20')](_0x73c418));_0x5a5d20(_0x73c418);})['catch'](function(_0x39547a){logger['error'](_0x42d0('0x1a'),_0x39547a[_0x42d0('0x17')],_0x3b6d32);_0x28fb7e(_0x4ffbd6[_0x42d0('0x15')](0x1f4,_0x39547a[_0x42d0('0x17')]));});});};exports[_0x42d0('0x21')]=function(_0x3327ca){return new Promise(function(_0x3f6d3c,_0x490c62){return db[_0x42d0('0x22')]['find']({'where':_0x3327ca[_0x42d0('0x1b')]?_0x3327ca[_0x42d0('0x1b')]['where']||null:null})[_0x42d0('0x1f')](function(_0x764a8b){if(_0x764a8b){return _0x764a8b[_0x42d0('0x23')](_0x3327ca['body']['ids'],_['omit'](_0x3327ca[_0x42d0('0x24')],[_0x42d0('0x25'),'id'])||{});}})[_0x42d0('0x26')](function(_0x4c227f){logger[_0x42d0('0x10')]('AddTags',_0x3327ca);logger['debug'](_0x42d0('0x27'),_0x3327ca,JSON[_0x42d0('0x20')](_0x4c227f));_0x3f6d3c(_0x4c227f);})[_0x42d0('0x19')](function(_0x34a57a){logger['error'](_0x42d0('0x27'),_0x34a57a['message'],_0x3327ca);_0x490c62(_this[_0x42d0('0x15')](0x1f4,_0x34a57a[_0x42d0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index b41df94..15af6d3 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 _0x82b9=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x82b9,0x1cd));var _0x982b=function(_0x42a008,_0xaaa157){_0x42a008=_0x42a008-0x0;var _0x5762f4=_0x82b9[_0x42a008];return _0x5762f4;};'use strict';var ChatInteractionEvents=require(_0x982b('0x0'));var events=[_0x982b('0x1'),_0x982b('0x2'),_0x982b('0x3')];function createListener(_0x507b1c,_0x1da0ed){return function(_0x5018ea){_0x1da0ed[_0x982b('0x4')](_0x507b1c,_0x5018ea);};}function removeListener(_0x105f3b,_0x52adcf){return function(){ChatInteractionEvents[_0x982b('0x5')](_0x105f3b,_0x52adcf);};}exports['register']=function(_0x5d2e51){for(var _0x57f171=0x0,_0x4b78e3=events[_0x982b('0x6')];_0x57f171<_0x4b78e3;_0x57f171++){var _0x1d2478=events[_0x57f171];var _0x27ad5a=createListener(_0x982b('0x7')+_0x1d2478,_0x5d2e51);ChatInteractionEvents['on'](_0x1d2478,_0x27ad5a);}}; \ No newline at end of file +var _0x3871=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','length'];(function(_0x562faf,_0x102bcc){var _0x22c1f6=function(_0x2cd3b8){while(--_0x2cd3b8){_0x562faf['push'](_0x562faf['shift']());}};_0x22c1f6(++_0x102bcc);}(_0x3871,0x191));var _0x1387=function(_0x2c17ce,_0x402816){_0x2c17ce=_0x2c17ce-0x0;var _0x1d3e32=_0x3871[_0x2c17ce];return _0x1d3e32;};'use strict';var ChatInteractionEvents=require(_0x1387('0x0'));var events=[_0x1387('0x1'),_0x1387('0x2'),_0x1387('0x3')];function createListener(_0x186bdc,_0x4597a6){return function(_0x23c294){_0x4597a6[_0x1387('0x4')](_0x186bdc,_0x23c294);};}function removeListener(_0x31c13e,_0x49cc85){return function(){ChatInteractionEvents[_0x1387('0x5')](_0x31c13e,_0x49cc85);};}exports['register']=function(_0xb0e75f){for(var _0x522ae9=0x0,_0x18d2ff=events[_0x1387('0x6')];_0x522ae9<_0x18d2ff;_0x522ae9++){var _0x117f65=events[_0x522ae9];var _0x3f03af=createListener(_0x1387('0x7')+_0x117f65,_0xb0e75f);ChatInteractionEvents['on'](_0x117f65,_0x3f03af);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index f1789bd..634b266 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 _0x6ae7=['exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMyMessages','/:id/download','download','post','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','single','file','attachmentUpload','addMessage','/:id/tags','chatinteraction:addtags','addTags','chat','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','tracked','chatinteraction:destroy','destroy','removeTags'];(function(_0xcbc1f2,_0x4bb79a){var _0x27c4eb=function(_0x1834f5){while(--_0x1834f5){_0xcbc1f2['push'](_0xcbc1f2['shift']());}};_0x27c4eb(++_0x4bb79a);}(_0x6ae7,0x13f));var _0x76ae=function(_0x4d99c4,_0x4bb276){_0x4d99c4=_0x4d99c4-0x0;var _0x11d041=_0x6ae7[_0x4d99c4];return _0x11d041;};'use strict';var multer=require(_0x76ae('0x0'));var util=require(_0x76ae('0x1'));var path=require(_0x76ae('0x2'));var timeout=require('connect-timeout');var express=require(_0x76ae('0x3'));var router=express[_0x76ae('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x76ae('0x5'));var config=require(_0x76ae('0x6'));var controller=require(_0x76ae('0x7'));router[_0x76ae('0x8')]('/',auth['isAuthenticated'](),controller[_0x76ae('0x9')]);router[_0x76ae('0x8')](_0x76ae('0xa'),auth[_0x76ae('0xb')](),controller[_0x76ae('0xc')]);router[_0x76ae('0x8')](_0x76ae('0xd'),auth[_0x76ae('0xe')](),controller[_0x76ae('0xf')]);router[_0x76ae('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x76ae('0x10')]);router[_0x76ae('0x8')](_0x76ae('0x11'),auth[_0x76ae('0xb')](),controller['getMessages']);router[_0x76ae('0x8')]('/:id/my_messages',auth[_0x76ae('0xe')](),controller[_0x76ae('0x12')]);router[_0x76ae('0x8')](_0x76ae('0x13'),auth[_0x76ae('0xb')](),controller[_0x76ae('0x14')]);router[_0x76ae('0x15')]('/',auth[_0x76ae('0xb')](),controller[_0x76ae('0x16')]);var upload=multer({'storage':multer[_0x76ae('0x17')]({'destination':function(_0x388a9c,_0x232961,_0x4da218){_0x4da218(null,path[_0x76ae('0x18')](config[_0x76ae('0x19')],_0x76ae('0x1a')));},'filename':function(_0x49eb23,_0x3228ed,_0x471181){_0x471181(null,util[_0x76ae('0x1b')](_0x76ae('0x1c'),Date['now'](),_0x3228ed[_0x76ae('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x76ae('0x15')]('/:id/attachment_upload',upload[_0x76ae('0x1e')](_0x76ae('0x1f')),controller[_0x76ae('0x20')]);router[_0x76ae('0x15')](_0x76ae('0x11'),auth[_0x76ae('0xe')](),controller[_0x76ae('0x21')]);router['post'](_0x76ae('0x22'),auth[_0x76ae('0xb')](),interaction['tracked']('chat',_0x76ae('0x23')),controller[_0x76ae('0x24')]);router['put'](_0x76ae('0xd'),auth[_0x76ae('0xb')](),interaction['tracked'](_0x76ae('0x25'),_0x76ae('0x26')),controller[_0x76ae('0x27')]);router[_0x76ae('0x28')](_0x76ae('0x29'),controller[_0x76ae('0x2a')]);router['put'](_0x76ae('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x76ae('0x2c')]);router[_0x76ae('0x28')](_0x76ae('0x2d'),controller[_0x76ae('0x2e')]);router[_0x76ae('0x2f')](_0x76ae('0xd'),auth['isAuthenticated'](),interaction[_0x76ae('0x30')](_0x76ae('0x25'),_0x76ae('0x31')),controller[_0x76ae('0x32')]);router[_0x76ae('0x2f')](_0x76ae('0x22'),auth[_0x76ae('0xb')](),controller[_0x76ae('0x33')]);module[_0x76ae('0x34')]=router; \ No newline at end of file +var _0xf11f=['customUpdate','abandon','/:id/close','close','delete','destroy','removeTags','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','/:id/custom_update'];(function(_0x531fbf,_0x9b24af){var _0x4e9127=function(_0x38c5a0){while(--_0x38c5a0){_0x531fbf['push'](_0x531fbf['shift']());}};_0x4e9127(++_0x9b24af);}(_0xf11f,0x1b0));var _0xff11=function(_0x4450b1,_0x214ace){_0x4450b1=_0x4450b1-0x0;var _0x399b0b=_0xf11f[_0x4450b1];return _0x399b0b;};'use strict';var multer=require(_0xff11('0x0'));var util=require(_0xff11('0x1'));var path=require('path');var timeout=require(_0xff11('0x2'));var express=require('express');var router=express[_0xff11('0x3')]();var auth=require(_0xff11('0x4'));var interaction=require(_0xff11('0x5'));var config=require(_0xff11('0x6'));var controller=require('./chatInteraction.controller');router[_0xff11('0x7')]('/',auth[_0xff11('0x8')](),controller[_0xff11('0x9')]);router[_0xff11('0x7')](_0xff11('0xa'),auth['isAuthenticated'](),controller[_0xff11('0xb')]);router['get'](_0xff11('0xc'),auth[_0xff11('0xd')](),controller['show']);router[_0xff11('0x7')](_0xff11('0xe'),auth[_0xff11('0xd')](),controller['attachmentDownload']);router['get'](_0xff11('0xf'),auth[_0xff11('0x8')](),controller[_0xff11('0x10')]);router['get'](_0xff11('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xff11('0x12')]);router[_0xff11('0x7')](_0xff11('0x13'),auth[_0xff11('0x8')](),controller[_0xff11('0x14')]);router[_0xff11('0x15')]('/',auth[_0xff11('0x8')](),controller[_0xff11('0x16')]);var upload=multer({'storage':multer[_0xff11('0x17')]({'destination':function(_0x18f05d,_0x14ac89,_0x3da2d7){_0x3da2d7(null,path[_0xff11('0x18')](config[_0xff11('0x19')],_0xff11('0x1a')));},'filename':function(_0x582137,_0x41f676,_0x19d781){_0x19d781(null,util[_0xff11('0x1b')](_0xff11('0x1c'),Date[_0xff11('0x1d')](),_0x41f676[_0xff11('0x1e')][_0xff11('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xff11('0x15')](_0xff11('0x20'),upload[_0xff11('0x21')](_0xff11('0x22')),controller[_0xff11('0x23')]);router[_0xff11('0x15')](_0xff11('0xf'),auth[_0xff11('0xd')](),controller[_0xff11('0x24')]);router[_0xff11('0x15')](_0xff11('0x25'),auth[_0xff11('0x8')](),interaction['tracked'](_0xff11('0x26'),_0xff11('0x27')),controller[_0xff11('0x28')]);router[_0xff11('0x29')](_0xff11('0xc'),auth['isAuthenticated'](),interaction[_0xff11('0x2a')](_0xff11('0x26'),_0xff11('0x2b')),controller['update']);router[_0xff11('0x29')](_0xff11('0x2c'),controller[_0xff11('0x2d')]);router[_0xff11('0x29')]('/:id/abandon',auth[_0xff11('0xd')](),controller[_0xff11('0x2e')]);router[_0xff11('0x29')](_0xff11('0x2f'),controller[_0xff11('0x30')]);router[_0xff11('0x31')]('/:id',auth[_0xff11('0x8')](),interaction[_0xff11('0x2a')]('chat','chatinteraction:destroy'),controller[_0xff11('0x32')]);router['delete'](_0xff11('0x25'),auth['isAuthenticated'](),controller[_0xff11('0x33')]);module[_0xff11('0x34')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 2a74567..98e3632 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 _0x57ca=['exports','TEXT','BOOLEAN','INTEGER'];(function(_0x11496d,_0x196f5f){var _0x58fcb3=function(_0x4d10cd){while(--_0x4d10cd){_0x11496d['push'](_0x11496d['shift']());}};_0x58fcb3(++_0x196f5f);}(_0x57ca,0x108));var _0xa57c=function(_0x35f3ad,_0x304b42){_0x35f3ad=_0x35f3ad-0x0;var _0x6a8936=_0x57ca[_0x35f3ad];return _0x6a8936;};'use strict';var Sequelize=require('sequelize');module[_0xa57c('0x0')]={'body':{'type':Sequelize[_0xa57c('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa57c('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa57c('0x3')]}}; \ No newline at end of file +var _0x1967=['INTEGER','exports','TEXT','medium','BOOLEAN'];(function(_0x53d460,_0x23b719){var _0x1333cd=function(_0x38aabd){while(--_0x38aabd){_0x53d460['push'](_0x53d460['shift']());}};_0x1333cd(++_0x23b719);}(_0x1967,0x173));var _0x7196=function(_0x2de702,_0x505b5f){_0x2de702=_0x2de702-0x0;var _0x538578=_0x1967[_0x2de702];return _0x538578;};'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 diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 9303cdb..e82a071 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 _0x9f38=['eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','status','json','offset','limit','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','count','include','findAll','rows','catch','params','includeAll','create','body','find','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','role','userpic','online','lastLoginAt','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','-createdAt','all','html-pdf'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x9f38,0xd3));var _0x89f3=function(_0x572400,_0x542ef0){_0x572400=_0x572400-0x0;var _0x3b769a=_0x9f38[_0x572400];return _0x3b769a;};'use strict';var pdf=require(_0x89f3('0x0'));var emlformat=require(_0x89f3('0x1'));var rimraf=require(_0x89f3('0x2'));var zipdir=require(_0x89f3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x89f3('0x4'));var moment=require(_0x89f3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x89f3('0x6'));var util=require(_0x89f3('0x7'));var path=require(_0x89f3('0x8'));var sox=require(_0x89f3('0x9'));var csv=require(_0x89f3('0xa'));var ejs=require(_0x89f3('0xb'));var fs=require('fs');var _=require(_0x89f3('0xc'));var squel=require(_0x89f3('0xd'));var crypto=require('crypto');var jsforce=require(_0x89f3('0xe'));var deskjs=require(_0x89f3('0xf'));var toCsv=require(_0x89f3('0xa'));var querystring=require(_0x89f3('0x10'));var Papa=require('papaparse');var Redis=require(_0x89f3('0x11'));var authService=require(_0x89f3('0x12'));var qs=require(_0x89f3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89f3('0x14'));var logger=require(_0x89f3('0x15'))(_0x89f3('0x16'));var utils=require('../../config/utils');var config=require(_0x89f3('0x17'));var db=require(_0x89f3('0x18'))['db'];config[_0x89f3('0x19')]=_[_0x89f3('0x1a')](config['redis'],{'host':_0x89f3('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x89f3('0x1c'))[_0x89f3('0x1d')](socket);function respondWithStatusCode(_0x51d096,_0x5bc9b7){_0x5bc9b7=_0x5bc9b7||0xcc;return function(_0x2e6813){if(_0x2e6813){return _0x51d096['sendStatus'](_0x5bc9b7);}return _0x51d096[_0x89f3('0x1e')](_0x5bc9b7)['end']();};}function respondWithResult(_0x2a926b,_0x4bcd0d){_0x4bcd0d=_0x4bcd0d||0xc8;return function(_0x3058fb){if(_0x3058fb){return _0x2a926b[_0x89f3('0x1e')](_0x4bcd0d)[_0x89f3('0x1f')](_0x3058fb);}};}function respondWithFilteredResult(_0x59a8e6,_0x238767){return function(_0x175bc2){if(_0x175bc2){var _0x1b74d2=_0x175bc2['count'],_0x311223=_0x238767[_0x89f3('0x20')],_0x17412e=_0x238767[_0x89f3('0x20')]+_0x238767[_0x89f3('0x21')],_0x4868b6;if(_0x17412e>=_0x1b74d2){_0x17412e=_0x1b74d2;_0x4868b6=0xc8;}else{_0x4868b6=0xce;}_0x59a8e6['status'](_0x4868b6);return _0x59a8e6['set']('Content-Range',_0x311223+'-'+_0x17412e+'/'+_0x1b74d2)[_0x89f3('0x1f')](_0x175bc2);}return null;};}function patchUpdates(_0x720476){return function(_0x42024f){try{jsonpatch[_0x89f3('0x22')](_0x42024f,_0x720476,!![]);}catch(_0x1e3fb3){return BPromise[_0x89f3('0x23')](_0x1e3fb3);}return _0x42024f[_0x89f3('0x24')]();};}function saveUpdates(_0x40b1e2,_0x1c2566){return function(_0x1c6756){if(_0x1c6756){return _0x1c6756[_0x89f3('0x25')](_0x40b1e2)[_0x89f3('0x26')](function(_0x4d77d5){return _0x4d77d5;});}return null;};}function removeEntity(_0x17e27e,_0x3a37dd){return function(_0xbb809d){if(_0xbb809d){return _0xbb809d[_0x89f3('0x27')]()[_0x89f3('0x26')](function(){_0x17e27e[_0x89f3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a3537,_0x13d1dc){return function(_0x5da4ad){if(!_0x5da4ad){_0x1a3537[_0x89f3('0x28')](0x194);}return _0x5da4ad;};}function handleError(_0x5356c8,_0x79b27f){_0x79b27f=_0x79b27f||0x1f4;return function(_0x57305b){logger[_0x89f3('0x29')](_0x57305b[_0x89f3('0x2a')]);if(_0x57305b[_0x89f3('0x2b')]){delete _0x57305b[_0x89f3('0x2b')];}_0x5356c8[_0x89f3('0x1e')](_0x79b27f)[_0x89f3('0x2c')](_0x57305b);};}exports[_0x89f3('0x2d')]=function(_0x3210e3,_0x3b55b3){var _0x325d94={},_0x572f4a={},_0x226a4c={'count':0x0,'rows':[]};var _0x3232fb=_[_0x89f3('0x2e')](db[_0x89f3('0x2f')][_0x89f3('0x30')],function(_0x5e8c99){return{'name':_0x5e8c99[_0x89f3('0x31')],'type':_0x5e8c99[_0x89f3('0x32')]['key']};});_0x572f4a[_0x89f3('0x33')]=_[_0x89f3('0x2e')](_0x3232fb,_0x89f3('0x2b'));_0x572f4a['query']=_[_0x89f3('0x34')](_0x3210e3['query']);_0x572f4a[_0x89f3('0x35')]=_[_0x89f3('0x36')](_0x572f4a[_0x89f3('0x33')],_0x572f4a[_0x89f3('0x37')]);_0x325d94[_0x89f3('0x38')]=_['intersection'](_0x572f4a[_0x89f3('0x33')],qs[_0x89f3('0x39')](_0x3210e3['query'][_0x89f3('0x39')]));_0x325d94[_0x89f3('0x38')]=_0x325d94[_0x89f3('0x38')][_0x89f3('0x3a')]?_0x325d94[_0x89f3('0x38')]:_0x572f4a['model'];if(!_0x3210e3['query'][_0x89f3('0x3b')](_0x89f3('0x3c'))){_0x325d94[_0x89f3('0x21')]=qs[_0x89f3('0x21')](_0x3210e3[_0x89f3('0x37')][_0x89f3('0x21')]);_0x325d94[_0x89f3('0x20')]=qs['offset'](_0x3210e3['query'][_0x89f3('0x20')]);}_0x325d94[_0x89f3('0x3d')]=qs[_0x89f3('0x3e')](_0x3210e3['query'][_0x89f3('0x3e')]);_0x325d94[_0x89f3('0x3f')]=qs[_0x89f3('0x35')](_['pick'](_0x3210e3['query'],_0x572f4a['filters']));if(_0x3210e3['query']['filter']){_0x325d94[_0x89f3('0x3f')]=_[_0x89f3('0x40')](_0x325d94[_0x89f3('0x3f')],{'$or':_[_0x89f3('0x2e')](_0x3232fb,function(_0x2e25cb){if(_0x2e25cb[_0x89f3('0x32')]!=='VIRTUAL'){var _0x16a00f={};_0x16a00f[_0x2e25cb[_0x89f3('0x2b')]]={'$like':'%'+_0x3210e3[_0x89f3('0x37')][_0x89f3('0x41')]+'%'};return _0x16a00f;}})});}_0x325d94=_['merge']({},_0x325d94,_0x3210e3[_0x89f3('0x42')]);var _0xe2cb50={'where':_0x325d94['where']};return db[_0x89f3('0x2f')][_0x89f3('0x43')](_0xe2cb50)[_0x89f3('0x26')](function(_0xa74ddb){_0x226a4c['count']=_0xa74ddb;if(_0x3210e3[_0x89f3('0x37')]['includeAll']){_0x325d94[_0x89f3('0x44')]=[{'all':!![]}];}return db[_0x89f3('0x2f')][_0x89f3('0x45')](_0x325d94);})[_0x89f3('0x26')](function(_0x29ef72){_0x226a4c[_0x89f3('0x46')]=_0x29ef72;return _0x226a4c;})['then'](respondWithFilteredResult(_0x3b55b3,_0x325d94))[_0x89f3('0x47')](handleError(_0x3b55b3,null));};exports['show']=function(_0x3a67a8,_0x55c19f){var _0x41d5fb={'raw':!![],'where':{'id':_0x3a67a8[_0x89f3('0x48')]['id']}},_0x10c618={};_0x10c618['model']=_[_0x89f3('0x34')](db[_0x89f3('0x2f')][_0x89f3('0x30')]);_0x10c618['query']=_[_0x89f3('0x34')](_0x3a67a8['query']);_0x10c618[_0x89f3('0x35')]=_['intersection'](_0x10c618[_0x89f3('0x33')],_0x10c618[_0x89f3('0x37')]);_0x41d5fb[_0x89f3('0x38')]=_[_0x89f3('0x36')](_0x10c618[_0x89f3('0x33')],qs[_0x89f3('0x39')](_0x3a67a8['query'][_0x89f3('0x39')]));_0x41d5fb[_0x89f3('0x38')]=_0x41d5fb['attributes'][_0x89f3('0x3a')]?_0x41d5fb['attributes']:_0x10c618[_0x89f3('0x33')];if(_0x3a67a8[_0x89f3('0x37')][_0x89f3('0x49')]){_0x41d5fb[_0x89f3('0x44')]=[{'all':!![]}];}_0x41d5fb=_[_0x89f3('0x40')]({},_0x41d5fb,_0x3a67a8[_0x89f3('0x42')]);return db[_0x89f3('0x2f')]['find'](_0x41d5fb)[_0x89f3('0x26')](handleEntityNotFound(_0x55c19f,null))['then'](respondWithResult(_0x55c19f,null))['catch'](handleError(_0x55c19f,null));};exports[_0x89f3('0x4a')]=function(_0xe02db6,_0x191675){return db[_0x89f3('0x2f')]['create'](_0xe02db6[_0x89f3('0x4b')],{})[_0x89f3('0x26')](respondWithResult(_0x191675,0xc9))[_0x89f3('0x47')](handleError(_0x191675,null));};exports[_0x89f3('0x25')]=function(_0x213fb4,_0x3549cb){if(_0x213fb4[_0x89f3('0x4b')]['id']){delete _0x213fb4[_0x89f3('0x4b')]['id'];}return db[_0x89f3('0x2f')][_0x89f3('0x4c')]({'where':{'id':_0x213fb4[_0x89f3('0x48')]['id']}})[_0x89f3('0x26')](handleEntityNotFound(_0x3549cb,null))[_0x89f3('0x26')](saveUpdates(_0x213fb4[_0x89f3('0x4b')],null))[_0x89f3('0x26')](respondWithResult(_0x3549cb,null))[_0x89f3('0x47')](handleError(_0x3549cb,null));};exports[_0x89f3('0x27')]=function(_0x268931,_0x7852f6){return db[_0x89f3('0x2f')][_0x89f3('0x4c')]({'where':{'id':_0x268931[_0x89f3('0x48')]['id']}})[_0x89f3('0x26')](handleEntityNotFound(_0x7852f6,null))['then'](removeEntity(_0x7852f6,null))['catch'](handleError(_0x7852f6,null));};exports[_0x89f3('0x4d')]=function(_0x3191e0,_0x2bdb74){return db[_0x89f3('0x2f')]['describe']()[_0x89f3('0x26')](respondWithResult(_0x2bdb74,null))['catch'](handleError(_0x2bdb74,null));};function wrapUser(_0x14e430){return function(_0x1edf81){var _0x20d5b5=_0x14e430[_0x89f3('0x4e')]({'plain':!![]});_0x20d5b5['messages']=[];if(_0x1edf81){_0x20d5b5[_0x89f3('0x4f')]=_0x1edf81[_0x89f3('0x50')];_0x20d5b5[_0x89f3('0x51')]=_0x1edf81;}else{_0x20d5b5[_0x89f3('0x4f')]=moment(0x0)[_0x89f3('0x52')](_0x89f3('0x53'));_0x20d5b5[_0x89f3('0x51')]={};}return _0x20d5b5;};}exports[_0x89f3('0x54')]=function(_0x22fedd,_0x4a0f8f,_0x4911b8){var _0x2a3022=[];return db['User'][_0x89f3('0x45')]({'where':{'role':[_0x89f3('0x55'),_0x89f3('0x56'),_0x89f3('0x57')]},'attributes':['id','fullname',_0x89f3('0x2b'),_0x89f3('0x58'),_0x89f3('0x59'),'internal',_0x89f3('0x5a'),_0x89f3('0x5b'),'allowmessenger',_0x89f3('0x5c')],'order':qs[_0x89f3('0x3e')](_0x89f3('0x5d')),'include':[{'model':db['VoiceQueue'],'as':_0x89f3('0x5e'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x89f3('0x26')](function(_0x418e69){if(_0x418e69){var _0x13d9a0=_0x22fedd[_0x89f3('0x57')][_0x89f3('0x4e')]({'plain':!![]});if(!_0x13d9a0)throw new Error(_0x89f3('0x5f'));if(_0x13d9a0[_0x89f3('0x58')]===_0x89f3('0x57')){return db[_0x89f3('0x60')][_0x89f3('0x4c')]({'where':{'name':'Agents','userProfileId':_0x13d9a0[_0x89f3('0x61')]},'raw':!![]})[_0x89f3('0x26')](function(_0x109acd){if(_0x109acd){if(_0x109acd[_0x89f3('0x62')]===0x0){return db[_0x89f3('0x63')][_0x89f3('0x45')]({'where':{'sectionId':_0x109acd['id']},'raw':!![]})[_0x89f3('0x26')](function(_0x262b77){var _0x444602=[];if(_[_0x89f3('0x64')](_0x262b77)){_0x444602=_[_0x89f3('0x41')](_0x418e69,function(_0x4bea85){if(_0x4bea85['role']!==_0x89f3('0x55')){return _0x4bea85;}});return _0x444602;}else{for(var _0x730c5=0x0;_0x730c5<_0x418e69[_0x89f3('0x3a')];_0x730c5++){var _0x5ec70b=_0x418e69[_0x730c5];if(_0x5ec70b[_0x89f3('0x58')]===_0x89f3('0x55')){var _0x53e2b0=_['find'](_0x262b77,function(_0x2e2cef){return _0x2e2cef['resourceId']===_0x5ec70b['id'];});if(_0x53e2b0)_0x444602['push'](_0x5ec70b);}else{_0x444602[_0x89f3('0x65')](_0x5ec70b);}}return _0x444602;}});}else{return _0x418e69;}}else{var _0x364669=_[_0x89f3('0x41')](_0x418e69,function(_0x5e73ae){if(_0x5e73ae[_0x89f3('0x58')]!==_0x89f3('0x55')){return _0x5e73ae;}});return _0x364669;}});}else{return _0x418e69;}}})[_0x89f3('0x26')](function(_0x3c06a7){var _0x1fadb8=[];if(_0x3c06a7){_0x2a3022=_0x3c06a7;for(var _0x2d9383=0x0;_0x2d9383<_0x3c06a7[_0x89f3('0x3a')];_0x2d9383+=0x1){_0x2a3022[_0x2d9383]['messages']=[];_0x1fadb8['push'](db[_0x89f3('0x2f')][_0x89f3('0x4c')]({'where':{'FromId':[_0x22fedd[_0x89f3('0x57')]['id'],_0x3c06a7[_0x2d9383]['id']],'ToId':[_0x22fedd[_0x89f3('0x57')]['id'],_0x3c06a7[_0x2d9383]['id']],'ChatGroupId':null},'attributes':['id',_0x89f3('0x50'),_0x89f3('0x66'),_0x89f3('0x67'),'read',_0x89f3('0x4b')],'order':qs[_0x89f3('0x3e')](_0x89f3('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x89f3('0x26')](wrapUser(_0x3c06a7[_0x2d9383])));}return BPromise[_0x89f3('0x69')](_0x1fadb8);}return[];})[_0x89f3('0x26')](function(_0x5298ee){return{'rows':_0x5298ee,'count':_0x5298ee[_0x89f3('0x3a')]};})[_0x89f3('0x26')](respondWithResult(_0x4a0f8f,null))[_0x89f3('0x47')](handleError(_0x4a0f8f,null));}; \ No newline at end of file +var _0xf4f7=['redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','count','includeAll','findAll','rows','show','params','include','catch','create','body','find','destroy','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','push','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x7c6b50,_0x1f0390){var _0x43abb4=function(_0x5a8088){while(--_0x5a8088){_0x7c6b50['push'](_0x7c6b50['shift']());}};_0x43abb4(++_0x1f0390);}(_0xf4f7,0x129));var _0x7f4f=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xf4f7[_0xa6cc5c];return _0x44803d;};'use strict';var pdf=require(_0x7f4f('0x0'));var emlformat=require(_0x7f4f('0x1'));var rimraf=require(_0x7f4f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f4f('0x3'));var rp=require(_0x7f4f('0x4'));var moment=require(_0x7f4f('0x5'));var BPromise=require(_0x7f4f('0x6'));var Mustache=require(_0x7f4f('0x7'));var util=require('util');var path=require(_0x7f4f('0x8'));var sox=require(_0x7f4f('0x9'));var csv=require('to-csv');var ejs=require(_0x7f4f('0xa'));var fs=require('fs');var _=require(_0x7f4f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7f4f('0xc'));var deskjs=require(_0x7f4f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7f4f('0xe'));var Papa=require('papaparse');var Redis=require(_0x7f4f('0xf'));var authService=require(_0x7f4f('0x10'));var qs=require(_0x7f4f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f4f('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7f4f('0x13'));var db=require(_0x7f4f('0x14'))['db'];config[_0x7f4f('0x15')]=_[_0x7f4f('0x16')](config[_0x7f4f('0x15')],{'host':_0x7f4f('0x17'),'port':0x18eb});var socket=require(_0x7f4f('0x18'))(new Redis(config[_0x7f4f('0x15')]));require(_0x7f4f('0x19'))[_0x7f4f('0x1a')](socket);function respondWithStatusCode(_0x434d7a,_0x22eea1){_0x22eea1=_0x22eea1||0xcc;return function(_0x235e0b){if(_0x235e0b){return _0x434d7a[_0x7f4f('0x1b')](_0x22eea1);}return _0x434d7a[_0x7f4f('0x1c')](_0x22eea1)['end']();};}function respondWithResult(_0x39db66,_0x2e1961){_0x2e1961=_0x2e1961||0xc8;return function(_0x15a3d7){if(_0x15a3d7){return _0x39db66[_0x7f4f('0x1c')](_0x2e1961)[_0x7f4f('0x1d')](_0x15a3d7);}};}function respondWithFilteredResult(_0x466323,_0x962533){return function(_0x187b1f){if(_0x187b1f){var _0x2131c4=_0x187b1f['count'],_0x552c79=_0x962533[_0x7f4f('0x1e')],_0x35b488=_0x962533[_0x7f4f('0x1e')]+_0x962533[_0x7f4f('0x1f')],_0x70eb17;if(_0x35b488>=_0x2131c4){_0x35b488=_0x2131c4;_0x70eb17=0xc8;}else{_0x70eb17=0xce;}_0x466323['status'](_0x70eb17);return _0x466323[_0x7f4f('0x20')](_0x7f4f('0x21'),_0x552c79+'-'+_0x35b488+'/'+_0x2131c4)[_0x7f4f('0x1d')](_0x187b1f);}return null;};}function patchUpdates(_0xdacc6a){return function(_0x2f2edb){try{jsonpatch[_0x7f4f('0x22')](_0x2f2edb,_0xdacc6a,!![]);}catch(_0x5514c0){return BPromise[_0x7f4f('0x23')](_0x5514c0);}return _0x2f2edb[_0x7f4f('0x24')]();};}function saveUpdates(_0xfacda,_0x36deed){return function(_0x513f61){if(_0x513f61){return _0x513f61[_0x7f4f('0x25')](_0xfacda)['then'](function(_0x225a17){return _0x225a17;});}return null;};}function removeEntity(_0x15d32b,_0x5945c3){return function(_0x145e73){if(_0x145e73){return _0x145e73['destroy']()[_0x7f4f('0x26')](function(){_0x15d32b[_0x7f4f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ef308,_0x6cb742){return function(_0x5e77e4){if(!_0x5e77e4){_0x3ef308[_0x7f4f('0x1b')](0x194);}return _0x5e77e4;};}function handleError(_0xa06ee5,_0x303cf9){_0x303cf9=_0x303cf9||0x1f4;return function(_0xf98889){logger['error'](_0xf98889[_0x7f4f('0x27')]);if(_0xf98889[_0x7f4f('0x28')]){delete _0xf98889[_0x7f4f('0x28')];}_0xa06ee5[_0x7f4f('0x1c')](_0x303cf9)['send'](_0xf98889);};}exports['index']=function(_0x2d0c2a,_0x340dd1){var _0x8d0ab4={},_0x2aca8a={},_0x3d416d={'count':0x0,'rows':[]};var _0x3a760f=_[_0x7f4f('0x29')](db['ChatInternalMessage'][_0x7f4f('0x2a')],function(_0x2e5025){return{'name':_0x2e5025[_0x7f4f('0x2b')],'type':_0x2e5025[_0x7f4f('0x2c')]['key']};});_0x2aca8a[_0x7f4f('0x2d')]=_[_0x7f4f('0x29')](_0x3a760f,_0x7f4f('0x28'));_0x2aca8a[_0x7f4f('0x2e')]=_[_0x7f4f('0x2f')](_0x2d0c2a[_0x7f4f('0x2e')]);_0x2aca8a[_0x7f4f('0x30')]=_['intersection'](_0x2aca8a['model'],_0x2aca8a[_0x7f4f('0x2e')]);_0x8d0ab4[_0x7f4f('0x31')]=_[_0x7f4f('0x32')](_0x2aca8a[_0x7f4f('0x2d')],qs['fields'](_0x2d0c2a[_0x7f4f('0x2e')][_0x7f4f('0x33')]));_0x8d0ab4[_0x7f4f('0x31')]=_0x8d0ab4['attributes'][_0x7f4f('0x34')]?_0x8d0ab4[_0x7f4f('0x31')]:_0x2aca8a[_0x7f4f('0x2d')];if(!_0x2d0c2a['query']['hasOwnProperty']('nolimit')){_0x8d0ab4[_0x7f4f('0x1f')]=qs[_0x7f4f('0x1f')](_0x2d0c2a[_0x7f4f('0x2e')]['limit']);_0x8d0ab4[_0x7f4f('0x1e')]=qs[_0x7f4f('0x1e')](_0x2d0c2a[_0x7f4f('0x2e')][_0x7f4f('0x1e')]);}_0x8d0ab4['order']=qs[_0x7f4f('0x35')](_0x2d0c2a[_0x7f4f('0x2e')][_0x7f4f('0x35')]);_0x8d0ab4[_0x7f4f('0x36')]=qs[_0x7f4f('0x30')](_[_0x7f4f('0x37')](_0x2d0c2a[_0x7f4f('0x2e')],_0x2aca8a[_0x7f4f('0x30')]));if(_0x2d0c2a[_0x7f4f('0x2e')][_0x7f4f('0x38')]){_0x8d0ab4[_0x7f4f('0x36')]=_[_0x7f4f('0x39')](_0x8d0ab4[_0x7f4f('0x36')],{'$or':_['map'](_0x3a760f,function(_0x32474c){if(_0x32474c[_0x7f4f('0x2c')]!==_0x7f4f('0x3a')){var _0x2b6389={};_0x2b6389[_0x32474c[_0x7f4f('0x28')]]={'$like':'%'+_0x2d0c2a[_0x7f4f('0x2e')]['filter']+'%'};return _0x2b6389;}})});}_0x8d0ab4=_[_0x7f4f('0x39')]({},_0x8d0ab4,_0x2d0c2a[_0x7f4f('0x3b')]);var _0x29f7b9={'where':_0x8d0ab4[_0x7f4f('0x36')]};return db[_0x7f4f('0x3c')][_0x7f4f('0x3d')](_0x29f7b9)['then'](function(_0x4e2396){_0x3d416d[_0x7f4f('0x3d')]=_0x4e2396;if(_0x2d0c2a[_0x7f4f('0x2e')][_0x7f4f('0x3e')]){_0x8d0ab4['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7f4f('0x3f')](_0x8d0ab4);})[_0x7f4f('0x26')](function(_0x2b3f81){_0x3d416d[_0x7f4f('0x40')]=_0x2b3f81;return _0x3d416d;})[_0x7f4f('0x26')](respondWithFilteredResult(_0x340dd1,_0x8d0ab4))['catch'](handleError(_0x340dd1,null));};exports[_0x7f4f('0x41')]=function(_0x3f31af,_0x25c4dc){var _0x5d7854={'raw':!![],'where':{'id':_0x3f31af[_0x7f4f('0x42')]['id']}},_0x5492ea={};_0x5492ea[_0x7f4f('0x2d')]=_[_0x7f4f('0x2f')](db[_0x7f4f('0x3c')]['rawAttributes']);_0x5492ea[_0x7f4f('0x2e')]=_[_0x7f4f('0x2f')](_0x3f31af[_0x7f4f('0x2e')]);_0x5492ea[_0x7f4f('0x30')]=_[_0x7f4f('0x32')](_0x5492ea[_0x7f4f('0x2d')],_0x5492ea[_0x7f4f('0x2e')]);_0x5d7854[_0x7f4f('0x31')]=_['intersection'](_0x5492ea['model'],qs[_0x7f4f('0x33')](_0x3f31af[_0x7f4f('0x2e')][_0x7f4f('0x33')]));_0x5d7854[_0x7f4f('0x31')]=_0x5d7854['attributes'][_0x7f4f('0x34')]?_0x5d7854['attributes']:_0x5492ea[_0x7f4f('0x2d')];if(_0x3f31af[_0x7f4f('0x2e')][_0x7f4f('0x3e')]){_0x5d7854[_0x7f4f('0x43')]=[{'all':!![]}];}_0x5d7854=_['merge']({},_0x5d7854,_0x3f31af[_0x7f4f('0x3b')]);return db[_0x7f4f('0x3c')]['find'](_0x5d7854)[_0x7f4f('0x26')](handleEntityNotFound(_0x25c4dc,null))['then'](respondWithResult(_0x25c4dc,null))[_0x7f4f('0x44')](handleError(_0x25c4dc,null));};exports['create']=function(_0x51b9ee,_0x4cb495){return db['ChatInternalMessage'][_0x7f4f('0x45')](_0x51b9ee[_0x7f4f('0x46')],{})[_0x7f4f('0x26')](respondWithResult(_0x4cb495,0xc9))[_0x7f4f('0x44')](handleError(_0x4cb495,null));};exports['update']=function(_0x300ad1,_0x4d1556){if(_0x300ad1[_0x7f4f('0x46')]['id']){delete _0x300ad1[_0x7f4f('0x46')]['id'];}return db[_0x7f4f('0x3c')][_0x7f4f('0x47')]({'where':{'id':_0x300ad1[_0x7f4f('0x42')]['id']}})[_0x7f4f('0x26')](handleEntityNotFound(_0x4d1556,null))['then'](saveUpdates(_0x300ad1[_0x7f4f('0x46')],null))[_0x7f4f('0x26')](respondWithResult(_0x4d1556,null))[_0x7f4f('0x44')](handleError(_0x4d1556,null));};exports[_0x7f4f('0x48')]=function(_0x74c808,_0x15e690){return db['ChatInternalMessage'][_0x7f4f('0x47')]({'where':{'id':_0x74c808[_0x7f4f('0x42')]['id']}})['then'](handleEntityNotFound(_0x15e690,null))['then'](removeEntity(_0x15e690,null))[_0x7f4f('0x44')](handleError(_0x15e690,null));};exports[_0x7f4f('0x49')]=function(_0x4075c0,_0x35e9b0){return db[_0x7f4f('0x3c')][_0x7f4f('0x49')]()[_0x7f4f('0x26')](respondWithResult(_0x35e9b0,null))[_0x7f4f('0x44')](handleError(_0x35e9b0,null));};function wrapUser(_0x32f54a){return function(_0x56947b){var _0xffd59b=_0x32f54a[_0x7f4f('0x4a')]({'plain':!![]});_0xffd59b[_0x7f4f('0x4b')]=[];if(_0x56947b){_0xffd59b['lastMessageAt']=_0x56947b[_0x7f4f('0x4c')];_0xffd59b[_0x7f4f('0x4d')]=_0x56947b;}else{_0xffd59b[_0x7f4f('0x4e')]=moment(0x0)[_0x7f4f('0x4f')](_0x7f4f('0x50'));_0xffd59b[_0x7f4f('0x4d')]={};}return _0xffd59b;};}exports[_0x7f4f('0x51')]=function(_0x1f03f3,_0x32df4e,_0x5eb43f){var _0x4301f1=[];return db['User']['findAll']({'where':{'role':[_0x7f4f('0x52'),_0x7f4f('0x53'),'user']},'attributes':['id',_0x7f4f('0x54'),_0x7f4f('0x28'),_0x7f4f('0x55'),_0x7f4f('0x56'),_0x7f4f('0x57'),'online',_0x7f4f('0x58'),_0x7f4f('0x59'),_0x7f4f('0x5a')],'order':qs[_0x7f4f('0x35')](_0x7f4f('0x5b')),'include':[{'model':db[_0x7f4f('0x5c')],'as':_0x7f4f('0x5d'),'attributes':['id','name',_0x7f4f('0x2c')],'through':{'attributes':[]}}]})[_0x7f4f('0x26')](function(_0x2315de){if(_0x2315de){var _0x22926b=_0x1f03f3[_0x7f4f('0x5e')][_0x7f4f('0x4a')]({'plain':!![]});if(!_0x22926b)throw new Error(_0x7f4f('0x5f'));if(_0x22926b[_0x7f4f('0x55')]===_0x7f4f('0x5e')){return db[_0x7f4f('0x60')][_0x7f4f('0x47')]({'where':{'name':'Agents','userProfileId':_0x22926b[_0x7f4f('0x61')]},'raw':!![]})[_0x7f4f('0x26')](function(_0x3aa66e){if(_0x3aa66e){if(_0x3aa66e[_0x7f4f('0x62')]===0x0){return db[_0x7f4f('0x63')][_0x7f4f('0x3f')]({'where':{'sectionId':_0x3aa66e['id']},'raw':!![]})['then'](function(_0x4dd228){var _0x52a713=[];if(_['isEmpty'](_0x4dd228)){_0x52a713=_[_0x7f4f('0x38')](_0x2315de,function(_0x4c99b8){if(_0x4c99b8[_0x7f4f('0x55')]!=='agent'){return _0x4c99b8;}});return _0x52a713;}else{for(var _0x1a7b0a=0x0;_0x1a7b0a<_0x2315de[_0x7f4f('0x34')];_0x1a7b0a++){var _0x3f394c=_0x2315de[_0x1a7b0a];if(_0x3f394c['role']===_0x7f4f('0x52')){var _0x5ebc58=_['find'](_0x4dd228,function(_0x1aad13){return _0x1aad13['resourceId']===_0x3f394c['id'];});if(_0x5ebc58)_0x52a713[_0x7f4f('0x64')](_0x3f394c);}else{_0x52a713[_0x7f4f('0x64')](_0x3f394c);}}return _0x52a713;}});}else{return _0x2315de;}}else{var _0x39b731=_[_0x7f4f('0x38')](_0x2315de,function(_0x10f730){if(_0x10f730[_0x7f4f('0x55')]!==_0x7f4f('0x52')){return _0x10f730;}});return _0x39b731;}});}else{return _0x2315de;}}})['then'](function(_0x2a2bbd){var _0x2cd429=[];if(_0x2a2bbd){_0x4301f1=_0x2a2bbd;for(var _0x1f4887=0x0;_0x1f4887<_0x2a2bbd[_0x7f4f('0x34')];_0x1f4887+=0x1){_0x4301f1[_0x1f4887][_0x7f4f('0x4b')]=[];_0x2cd429[_0x7f4f('0x64')](db[_0x7f4f('0x3c')]['find']({'where':{'FromId':[_0x1f03f3[_0x7f4f('0x5e')]['id'],_0x2a2bbd[_0x1f4887]['id']],'ToId':[_0x1f03f3[_0x7f4f('0x5e')]['id'],_0x2a2bbd[_0x1f4887]['id']],'ChatGroupId':null},'attributes':['id',_0x7f4f('0x4c'),_0x7f4f('0x65'),_0x7f4f('0x66'),_0x7f4f('0x67'),'body'],'order':qs[_0x7f4f('0x35')](_0x7f4f('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7f4f('0x26')](wrapUser(_0x2a2bbd[_0x1f4887])));}return BPromise[_0x7f4f('0x69')](_0x2cd429);}return[];})[_0x7f4f('0x26')](function(_0x39e50a){return{'rows':_0x39e50a,'count':_0x39e50a[_0x7f4f('0x34')]};})[_0x7f4f('0x26')](respondWithResult(_0x32df4e,null))[_0x7f4f('0x44')](handleError(_0x32df4e,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 390e678..e0aee0b 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 _0xb8ca=['hook','events','../../mysqldb','ChatInternalMessage','save','update','emit','hasOwnProperty'];(function(_0x2c66bf,_0x20f0be){var _0x57b4b0=function(_0x4c922e){while(--_0x4c922e){_0x2c66bf['push'](_0x2c66bf['shift']());}};_0x57b4b0(++_0x20f0be);}(_0xb8ca,0x89));var _0xab8c=function(_0x50fa8b,_0x16e80e){_0x50fa8b=_0x50fa8b-0x0;var _0x299dab=_0xb8ca[_0x50fa8b];return _0x299dab;};'use strict';var EventEmitter=require(_0xab8c('0x0'));var ChatInternalMessage=require(_0xab8c('0x1'))['db'][_0xab8c('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xab8c('0x3'),'afterUpdate':_0xab8c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4bf8af){return function(_0x40c0b4,_0x293bde,_0x38f81f){ChatInternalMessageEvents[_0xab8c('0x5')](_0x4bf8af+':'+_0x40c0b4['id'],_0x40c0b4);ChatInternalMessageEvents[_0xab8c('0x5')](_0x4bf8af,_0x40c0b4);_0x38f81f(null);};}for(var e in events){if(events[_0xab8c('0x6')](e)){var event=events[e];ChatInternalMessage[_0xab8c('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x9330=['events','setMaxListeners','remove','emit','hook','exports'];(function(_0x1e35bd,_0x40ee90){var _0x2c379d=function(_0x347fa7){while(--_0x347fa7){_0x1e35bd['push'](_0x1e35bd['shift']());}};_0x2c379d(++_0x40ee90);}(_0x9330,0x14a));var _0x0933=function(_0x3c49fc,_0x1b8c90){_0x3c49fc=_0x3c49fc-0x0;var _0x56d37e=_0x9330[_0x3c49fc];return _0x56d37e;};'use strict';var EventEmitter=require(_0x0933('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0933('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0933('0x2')};function emitEvent(_0x18cf92){return function(_0x39ad54,_0x2964c7,_0x2462a4){ChatInternalMessageEvents[_0x0933('0x3')](_0x18cf92+':'+_0x39ad54['id'],_0x39ad54);ChatInternalMessageEvents[_0x0933('0x3')](_0x18cf92,_0x39ad54);_0x2462a4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x0933('0x4')](e,emitEvent(event));}}module[_0x0933('0x5')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 1869eaa..311d8e3 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(_0x139f09,_0x1d1e8c){var _0x4ff12d=function(_0x210234){while(--_0x210234){_0x139f09['push'](_0x139f09['shift']());}};_0x4ff12d(++_0x1d1e8c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xb7e7[_0x2f3848];return _0x102668;};'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 _0xbaf0=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x1c4a30,_0x317dd3){var _0x539e22=function(_0x4082e9){while(--_0x4082e9){_0x1c4a30['push'](_0x1c4a30['shift']());}};_0x539e22(++_0x317dd3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0baf('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index ff3b898..214b80a 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 _0x754c=['info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request'];(function(_0x4bbe83,_0x5296b1){var _0x38097c=function(_0x40daa7){while(--_0x40daa7){_0x4bbe83['push'](_0x4bbe83['shift']());}};_0x38097c(++_0x5296b1);}(_0x754c,0x177));var _0xc754=function(_0xfa1350,_0x3b2504){_0xfa1350=_0xfa1350-0x0;var _0x18c322=_0x754c[_0xfa1350];return _0x18c322;};'use strict';var _=require('lodash');var util=require(_0xc754('0x0'));var moment=require(_0xc754('0x1'));var BPromise=require('bluebird');var rs=require(_0xc754('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc754('0x3'));var logger=require(_0xc754('0x4'))(_0xc754('0x5'));var config=require(_0xc754('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc754('0x7')]['http']({'port':0x232a});config[_0xc754('0x8')]=_[_0xc754('0x9')](config['redis'],{'host':_0xc754('0xa'),'port':0x18eb});var socket=require(_0xc754('0xb'))(new Redis(config['redis']));require(_0xc754('0xc'))[_0xc754('0xd')](socket);function respondWithRpcPromise(_0x553052,_0x5be1bf,_0x21a05e){return new BPromise(function(_0x4a9fc0,_0x5dcfe9){return client[_0xc754('0xe')](_0x553052,_0x21a05e)['then'](function(_0x162108){logger[_0xc754('0xf')](_0xc754('0x10'),_0x5be1bf,_0xc754('0x11'));logger[_0xc754('0x12')](_0xc754('0x13'),_0x5be1bf,_0xc754('0x11'),JSON[_0xc754('0x14')](_0x162108));if(_0x162108['error']){if(_0x162108['error'][_0xc754('0x15')]===0x1f4){logger[_0xc754('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x5be1bf,_0x162108[_0xc754('0x16')]['message']);return _0x5dcfe9(_0x162108[_0xc754('0x16')][_0xc754('0x17')]);}logger[_0xc754('0x16')](_0xc754('0x10'),_0x5be1bf,_0x162108['error']['message']);return _0x4a9fc0(_0x162108[_0xc754('0x16')][_0xc754('0x17')]);}else{logger[_0xc754('0xf')](_0xc754('0x10'),_0x5be1bf,_0xc754('0x11'));_0x4a9fc0(_0x162108[_0xc754('0x18')][_0xc754('0x17')]);}})[_0xc754('0x19')](function(_0x2bf158){logger[_0xc754('0x16')](_0xc754('0x10'),_0x5be1bf,_0x2bf158);_0x5dcfe9(_0x2bf158);});});} \ No newline at end of file +var _0x1a68=['localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x1a68,0x128));var _0x81a6=function(_0x3bd176,_0x1e4d2e){_0x3bd176=_0x3bd176-0x0;var _0x3e2ce3=_0x1a68[_0x3bd176];return _0x3e2ce3;};'use strict';var _=require(_0x81a6('0x0'));var util=require(_0x81a6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x81a6('0x2'));var fs=require('fs');var Redis=require(_0x81a6('0x3'));var db=require(_0x81a6('0x4'))['db'];var utils=require(_0x81a6('0x5'));var logger=require('../../config/logger')(_0x81a6('0x6'));var config=require(_0x81a6('0x7'));var jayson=require(_0x81a6('0x8'));var client=jayson[_0x81a6('0x9')][_0x81a6('0xa')]({'port':0x232a});config[_0x81a6('0xb')]=_['defaults'](config['redis'],{'host':_0x81a6('0xc'),'port':0x18eb});var socket=require(_0x81a6('0xd'))(new Redis(config[_0x81a6('0xb')]));require(_0x81a6('0xe'))[_0x81a6('0xf')](socket);function respondWithRpcPromise(_0xd5a39a,_0x5cf0a0,_0x67b708){return new BPromise(function(_0x37c2a3,_0x239bc6){return client[_0x81a6('0x10')](_0xd5a39a,_0x67b708)[_0x81a6('0x11')](function(_0x2f664a){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x5cf0a0,_0x81a6('0x12'));logger[_0x81a6('0x13')](_0x81a6('0x14'),_0x5cf0a0,_0x81a6('0x12'),JSON['stringify'](_0x2f664a));if(_0x2f664a[_0x81a6('0x15')]){if(_0x2f664a['error'][_0x81a6('0x16')]===0x1f4){logger[_0x81a6('0x15')](_0x81a6('0x17'),_0x5cf0a0,_0x2f664a[_0x81a6('0x15')][_0x81a6('0x18')]);return _0x239bc6(_0x2f664a[_0x81a6('0x15')][_0x81a6('0x18')]);}logger['error'](_0x81a6('0x17'),_0x5cf0a0,_0x2f664a[_0x81a6('0x15')]['message']);return _0x37c2a3(_0x2f664a[_0x81a6('0x15')][_0x81a6('0x18')]);}else{logger[_0x81a6('0x19')](_0x81a6('0x17'),_0x5cf0a0,_0x81a6('0x12'));_0x37c2a3(_0x2f664a[_0x81a6('0x1a')][_0x81a6('0x18')]);}})[_0x81a6('0x1b')](function(_0x8eecf2){logger['error'](_0x81a6('0x17'),_0x5cf0a0,_0x8eecf2);_0x239bc6(_0x8eecf2);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index ae5d8a2..31a1c07 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 _0xc999=['remove','update','removeListener','chatInternalMessage:','save'];(function(_0x70946d,_0x43b1d5){var _0x460359=function(_0x409358){while(--_0x409358){_0x70946d['push'](_0x70946d['shift']());}};_0x460359(++_0x43b1d5);}(_0xc999,0x176));var _0x9c99=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0xc999[_0x191154];return _0x3dcd73;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x9c99('0x0'),_0x9c99('0x1'),_0x9c99('0x2')];function createListener(_0x4cf49d,_0x590362){return function(_0x5473fe){_0x590362['emit'](_0x4cf49d,_0x5473fe);};}function removeListener(_0x3cecf2,_0x47e037){return function(){ChatInternalMessageEvents[_0x9c99('0x3')](_0x3cecf2,_0x47e037);};}exports['register']=function(_0x35f5f4){for(var _0x1ce762=0x0,_0xe80252=events['length'];_0x1ce762<_0xe80252;_0x1ce762++){var _0xfa25e1=events[_0x1ce762];var _0x323317=createListener(_0x9c99('0x4')+_0xfa25e1,_0x35f5f4);ChatInternalMessageEvents['on'](_0xfa25e1,_0x323317);}}; \ No newline at end of file +var _0xcf95=['./chatInternalMessage.events','save','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0xcf95,0xa1));var _0x5cf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf95[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x5cf9('0x0'));var events=[_0x5cf9('0x1'),'remove','update'];function createListener(_0x548d0c,_0x431989){return function(_0xfeb22f){_0x431989[_0x5cf9('0x2')](_0x548d0c,_0xfeb22f);};}function removeListener(_0x102b24,_0x53e2a1){return function(){ChatInternalMessageEvents[_0x5cf9('0x3')](_0x102b24,_0x53e2a1);};}exports[_0x5cf9('0x4')]=function(_0x5b060f){for(var _0x498d14=0x0,_0x1c0c3a=events[_0x5cf9('0x5')];_0x498d14<_0x1c0c3a;_0x498d14++){var _0x51acd7=events[_0x498d14];var _0x26b0de=createListener(_0x5cf9('0x6')+_0x51acd7,_0x5b060f);ChatInternalMessageEvents['on'](_0x51acd7,_0x26b0de);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index e8c4b88..7d61347 100644 --- a/server/api/chatInternalMessage/index.js +++ b/server/api/chatInternalMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x193912,_0x29d1c9){var _0x3d03bb=function(_0x3c41fa){while(--_0x3c41fa){_0x193912['push'](_0x193912['shift']());}};_0x3d03bb(++_0x29d1c9);}(_0xe706,0xa3));var _0x6e70=function(_0x1f6193,_0x2de9ff){_0x1f6193=_0x1f6193-0x0;var _0x160297=_0xe706[_0x1f6193];return _0x160297;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x9')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x12')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['put']('/:id',controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);module[_0x6e70('0x17')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x135c6a,_0x43f134){var _0x5cd130=function(_0x1cf8ab){while(--_0x1cf8ab){_0x135c6a['push'](_0x135c6a['shift']());}};_0x5cd130(++_0x43f134);}(_0xb7e7,0x121));var _0x7b7e=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xb7e7[_0x468b0f];return _0x3e74d9;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 24dc144..c68af27 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 _0x40f5=['DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0xcdb162,_0x1c19c1){var _0xbe7a7c=function(_0x3ef40d){while(--_0x3ef40d){_0xcdb162['push'](_0xcdb162['shift']());}};_0xbe7a7c(++_0x1c19c1);}(_0x40f5,0x163));var _0x540f=function(_0x2b76c9,_0x46eaee){_0x2b76c9=_0x2b76c9-0x0;var _0x230b98=_0x40f5[_0x2b76c9];return _0x230b98;};'use strict';var Sequelize=require(_0x540f('0x0'));module[_0x540f('0x1')]={'body':{'type':Sequelize[_0x540f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x540f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x540f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x540f('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x540f('0x5')]}}; \ No newline at end of file +var _0x8bf1=['exports','TEXT','medium','BOOLEAN','out','sequelize'];(function(_0x40b578,_0xc5da1a){var _0x2c9cc1=function(_0x442b52){while(--_0x442b52){_0x40b578['push'](_0x40b578['shift']());}};_0x2c9cc1(++_0xc5da1a);}(_0x8bf1,0x1d9));var _0x18bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bf1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x18bf('0x0'));module[_0x18bf('0x1')]={'body':{'type':Sequelize[_0x18bf('0x2')](_0x18bf('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x18bf('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x18bf('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x18bf('0x5')),'defaultValue':_0x18bf('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index c29ccbb..4182fb3 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 _0x5e3e=['then','destroy','stack','name','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','include','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','ChatInteraction','isNil','read1stAt','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','manual','SIP/%s','channel','event','EventManager','parse','agent','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','RejectMessage','rejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','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','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update'];(function(_0x502388,_0x212ba7){var _0x417b84=function(_0xc7bb3e){while(--_0xc7bb3e){_0x502388['push'](_0x502388['shift']());}};_0x417b84(++_0x212ba7);}(_0x5e3e,0x148));var _0xe5e3=function(_0x4c245f,_0x2bb619){_0x4c245f=_0x4c245f-0x0;var _0x4a2b5a=_0x5e3e[_0x4c245f];return _0x4a2b5a;};'use strict';var pdf=require(_0xe5e3('0x0'));var emlformat=require(_0xe5e3('0x1'));var rimraf=require(_0xe5e3('0x2'));var zipdir=require(_0xe5e3('0x3'));var jsonpatch=require(_0xe5e3('0x4'));var rp=require(_0xe5e3('0x5'));var moment=require(_0xe5e3('0x6'));var BPromise=require(_0xe5e3('0x7'));var Mustache=require('mustache');var util=require(_0xe5e3('0x8'));var path=require(_0xe5e3('0x9'));var sox=require(_0xe5e3('0xa'));var csv=require(_0xe5e3('0xb'));var ejs=require(_0xe5e3('0xc'));var fs=require('fs');var _=require(_0xe5e3('0xd'));var squel=require(_0xe5e3('0xe'));var crypto=require(_0xe5e3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe5e3('0x10'));var toCsv=require(_0xe5e3('0xb'));var querystring=require(_0xe5e3('0x11'));var Papa=require(_0xe5e3('0x12'));var Redis=require('ioredis');var authService=require(_0xe5e3('0x13'));var qs=require(_0xe5e3('0x14'));var as=require(_0xe5e3('0x15'));var hardwareService=require(_0xe5e3('0x16'));var logger=require(_0xe5e3('0x17'))(_0xe5e3('0x18'));var utils=require(_0xe5e3('0x19'));var config=require('../../config/environment');var db=require(_0xe5e3('0x1a'))['db'];config[_0xe5e3('0x1b')]=_[_0xe5e3('0x1c')](config[_0xe5e3('0x1b')],{'host':_0xe5e3('0x1d'),'port':0x18eb});var socket=require(_0xe5e3('0x1e'))(new Redis(config[_0xe5e3('0x1b')]));require('./chatMessage.socket')[_0xe5e3('0x1f')](socket);var jayson=require(_0xe5e3('0x20'));var client=jayson[_0xe5e3('0x21')][_0xe5e3('0x22')]({'port':0x232c});var client9002=jayson[_0xe5e3('0x21')][_0xe5e3('0x22')]({'port':0x232a});function checkPasswordPattern(_0x15bd6a,_0x32f648,_0x559307){if(_0x559307){var _0x1c9541=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c9541[_0xe5e3('0x23')](_0x32f648)){return _0x15bd6a;}else{throw new db[(_0xe5e3('0x24'))][(_0xe5e3('0x25'))](_0xe5e3('0x26'));}}else{return _0x15bd6a;}}function respondWithRpcPromise(_0x29b5d9,_0x1466f8,_0x246b10,_0x26df70){return new BPromise(function(_0xdfcfeb,_0x99b755){var _0x5eb497=_0x26df70||client;return _0x5eb497[_0xe5e3('0x27')](_0x29b5d9,_0x246b10)['then'](function(_0x210e1f){logger[_0xe5e3('0x28')]('ChatMessage,\x20%s,\x20%s',_0x1466f8,_0xe5e3('0x29'));logger[_0xe5e3('0x2a')](_0xe5e3('0x2b'),_0x1466f8,'request\x20sent',JSON['stringify'](_0x210e1f));if(_0x210e1f[_0xe5e3('0x2c')]){if(_0x210e1f['error'][_0xe5e3('0x2d')]===0x1f4){logger[_0xe5e3('0x2c')]('ChatMessage,\x20%s,\x20%s',_0x1466f8,_0x210e1f[_0xe5e3('0x2c')]['message']);return _0x99b755(_0x210e1f[_0xe5e3('0x2c')]['message']);}logger[_0xe5e3('0x2c')]('ChatMessage,\x20%s,\x20%s',_0x1466f8,_0x210e1f[_0xe5e3('0x2c')][_0xe5e3('0x2e')]);return _0xdfcfeb(_0x210e1f['error'][_0xe5e3('0x2e')]);}else{logger[_0xe5e3('0x28')]('ChatMessage,\x20%s,\x20%s',_0x1466f8,_0xe5e3('0x29'));_0xdfcfeb(_0x210e1f['result'][_0xe5e3('0x2e')]);}})[_0xe5e3('0x2f')](function(_0x1beb6e){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1466f8,_0x1beb6e);_0x99b755(_0x1beb6e);});});}function respondWithStatusCode(_0x318117,_0x425dab){_0x425dab=_0x425dab||0xcc;return function(_0x511f37){if(_0x511f37){return _0x318117[_0xe5e3('0x30')](_0x425dab);}return _0x318117[_0xe5e3('0x31')](_0x425dab)[_0xe5e3('0x32')]();};}function respondWithResult(_0x5e5c22,_0x287001){_0x287001=_0x287001||0xc8;return function(_0x59610f){if(_0x59610f){return _0x5e5c22['status'](_0x287001)[_0xe5e3('0x33')](_0x59610f);}};}function respondWithFilteredResult(_0x19d123,_0x239953){return function(_0x1a7ad2){if(_0x1a7ad2){var _0x167a8f=_0x1a7ad2['count'],_0x80b4f7=_0x239953['offset'],_0x1a071b=_0x239953[_0xe5e3('0x34')]+_0x239953[_0xe5e3('0x35')],_0x310ee6;if(_0x1a071b>=_0x167a8f){_0x1a071b=_0x167a8f;_0x310ee6=0xc8;}else{_0x310ee6=0xce;}_0x19d123[_0xe5e3('0x31')](_0x310ee6);return _0x19d123[_0xe5e3('0x36')](_0xe5e3('0x37'),_0x80b4f7+'-'+_0x1a071b+'/'+_0x167a8f)[_0xe5e3('0x33')](_0x1a7ad2);}return null;};}function patchUpdates(_0x459e6f){return function(_0x3ddaed){try{jsonpatch[_0xe5e3('0x38')](_0x3ddaed,_0x459e6f,!![]);}catch(_0x5b6b17){return BPromise[_0xe5e3('0x39')](_0x5b6b17);}return _0x3ddaed['save']();};}function saveUpdates(_0x18e66c,_0x384fbf){return function(_0x5e7d17){if(_0x5e7d17){return _0x5e7d17[_0xe5e3('0x3a')](_0x18e66c)[_0xe5e3('0x3b')](function(_0x1ca1de){return _0x1ca1de;});}return null;};}function removeEntity(_0xb00c83,_0x55e405){return function(_0x5b6862){if(_0x5b6862){return _0x5b6862[_0xe5e3('0x3c')]()['then'](function(){_0xb00c83[_0xe5e3('0x31')](0xcc)[_0xe5e3('0x32')]();});}};}function handleEntityNotFound(_0x1d2247,_0x454b46){return function(_0x34aa41){if(!_0x34aa41){_0x1d2247['sendStatus'](0x194);}return _0x34aa41;};}function handleError(_0x2172b5,_0x2586cf){_0x2586cf=_0x2586cf||0x1f4;return function(_0x452fd0){logger['error'](_0x452fd0[_0xe5e3('0x3d')]);if(_0x452fd0[_0xe5e3('0x3e')]){delete _0x452fd0[_0xe5e3('0x3e')];}_0x2172b5[_0xe5e3('0x31')](_0x2586cf)['send'](_0x452fd0);};}exports['index']=function(_0x539d71,_0x1dbe78){var _0x5e32df={},_0x4d16b3={},_0x2c6aca={'count':0x0,'rows':[]};var _0x247a16=_[_0xe5e3('0x3f')](db[_0xe5e3('0x40')][_0xe5e3('0x41')],function(_0x5efb88){return{'name':_0x5efb88[_0xe5e3('0x42')],'type':_0x5efb88[_0xe5e3('0x43')][_0xe5e3('0x44')]};});_0x4d16b3['model']=_[_0xe5e3('0x3f')](_0x247a16,_0xe5e3('0x3e'));_0x4d16b3[_0xe5e3('0x45')]=_[_0xe5e3('0x46')](_0x539d71['query']);_0x4d16b3[_0xe5e3('0x47')]=_[_0xe5e3('0x48')](_0x4d16b3[_0xe5e3('0x49')],_0x4d16b3[_0xe5e3('0x45')]);_0x5e32df['attributes']=_[_0xe5e3('0x48')](_0x4d16b3['model'],qs['fields'](_0x539d71[_0xe5e3('0x45')][_0xe5e3('0x4a')]));_0x5e32df[_0xe5e3('0x4b')]=_0x5e32df[_0xe5e3('0x4b')][_0xe5e3('0x4c')]?_0x5e32df[_0xe5e3('0x4b')]:_0x4d16b3[_0xe5e3('0x49')];if(!_0x539d71[_0xe5e3('0x45')][_0xe5e3('0x4d')](_0xe5e3('0x4e'))){_0x5e32df['limit']=qs['limit'](_0x539d71[_0xe5e3('0x45')][_0xe5e3('0x35')]);_0x5e32df[_0xe5e3('0x34')]=qs[_0xe5e3('0x34')](_0x539d71['query']['offset']);}_0x5e32df['order']=qs[_0xe5e3('0x4f')](_0x539d71[_0xe5e3('0x45')][_0xe5e3('0x4f')]);_0x5e32df[_0xe5e3('0x50')]=qs[_0xe5e3('0x47')](_[_0xe5e3('0x51')](_0x539d71[_0xe5e3('0x45')],_0x4d16b3[_0xe5e3('0x47')]));if(_0x539d71['query'][_0xe5e3('0x52')]){_0x5e32df[_0xe5e3('0x50')]=_[_0xe5e3('0x53')](_0x5e32df[_0xe5e3('0x50')],{'$or':_[_0xe5e3('0x3f')](_0x247a16,function(_0x47ab04){if(_0x47ab04[_0xe5e3('0x43')]!==_0xe5e3('0x54')){var _0x4aa44c={};_0x4aa44c[_0x47ab04[_0xe5e3('0x3e')]]={'$like':'%'+_0x539d71[_0xe5e3('0x45')][_0xe5e3('0x52')]+'%'};return _0x4aa44c;}})});}_0x5e32df=_[_0xe5e3('0x53')]({},_0x5e32df,_0x539d71[_0xe5e3('0x55')]);var _0x413b4e={'where':_0x5e32df[_0xe5e3('0x50')]};return db[_0xe5e3('0x40')][_0xe5e3('0x56')](_0x413b4e)['then'](function(_0x535a63){_0x2c6aca['count']=_0x535a63;if(_0x539d71[_0xe5e3('0x45')][_0xe5e3('0x57')]){_0x5e32df['include']=[{'all':!![]}];}return db['ChatMessage'][_0xe5e3('0x58')](_0x5e32df);})['then'](function(_0x3005ff){_0x2c6aca[_0xe5e3('0x59')]=_0x3005ff;return _0x2c6aca;})[_0xe5e3('0x3b')](respondWithFilteredResult(_0x1dbe78,_0x5e32df))[_0xe5e3('0x2f')](handleError(_0x1dbe78,null));};exports[_0xe5e3('0x5a')]=function(_0x5620c8,_0x3bdb99){var _0x378fec={'raw':!![],'where':{'id':_0x5620c8[_0xe5e3('0x5b')]['id']}},_0x8009dc={};_0x8009dc[_0xe5e3('0x49')]=_[_0xe5e3('0x46')](db[_0xe5e3('0x40')]['rawAttributes']);_0x8009dc[_0xe5e3('0x45')]=_['keys'](_0x5620c8['query']);_0x8009dc[_0xe5e3('0x47')]=_[_0xe5e3('0x48')](_0x8009dc[_0xe5e3('0x49')],_0x8009dc[_0xe5e3('0x45')]);_0x378fec[_0xe5e3('0x4b')]=_[_0xe5e3('0x48')](_0x8009dc[_0xe5e3('0x49')],qs[_0xe5e3('0x4a')](_0x5620c8[_0xe5e3('0x45')][_0xe5e3('0x4a')]));_0x378fec[_0xe5e3('0x4b')]=_0x378fec[_0xe5e3('0x4b')][_0xe5e3('0x4c')]?_0x378fec[_0xe5e3('0x4b')]:_0x8009dc['model'];if(_0x5620c8[_0xe5e3('0x45')][_0xe5e3('0x57')]){_0x378fec[_0xe5e3('0x5c')]=[{'all':!![]}];}_0x378fec=_['merge']({},_0x378fec,_0x5620c8[_0xe5e3('0x55')]);return db[_0xe5e3('0x40')][_0xe5e3('0x5d')](_0x378fec)[_0xe5e3('0x3b')](handleEntityNotFound(_0x3bdb99,null))[_0xe5e3('0x3b')](respondWithResult(_0x3bdb99,null))[_0xe5e3('0x2f')](handleError(_0x3bdb99,null));};exports[_0xe5e3('0x5e')]=function(_0xbe12bc,_0xa65036){return db[_0xe5e3('0x40')][_0xe5e3('0x5e')](_0xbe12bc[_0xe5e3('0x5f')],{})[_0xe5e3('0x3b')](respondWithResult(_0xa65036,0xc9))[_0xe5e3('0x2f')](handleError(_0xa65036,null));};exports['update']=function(_0x15ee94,_0x4ba98f){if(_0x15ee94['body']['id']){delete _0x15ee94[_0xe5e3('0x5f')]['id'];}return db[_0xe5e3('0x40')]['find']({'where':{'id':_0x15ee94[_0xe5e3('0x5b')]['id']}})[_0xe5e3('0x3b')](handleEntityNotFound(_0x4ba98f,null))[_0xe5e3('0x3b')](saveUpdates(_0x15ee94['body'],null))[_0xe5e3('0x3b')](respondWithResult(_0x4ba98f,null))[_0xe5e3('0x2f')](handleError(_0x4ba98f,null));};exports[_0xe5e3('0x3c')]=function(_0x489e3f,_0x2d976b){return db[_0xe5e3('0x40')][_0xe5e3('0x5d')]({'where':{'id':_0x489e3f['params']['id']}})[_0xe5e3('0x3b')](handleEntityNotFound(_0x2d976b,null))[_0xe5e3('0x3b')](removeEntity(_0x2d976b,null))[_0xe5e3('0x2f')](handleError(_0x2d976b,null));};exports[_0xe5e3('0x60')]=function(_0x3b3bc0,_0xecf4ea){return db[_0xe5e3('0x40')][_0xe5e3('0x60')]()[_0xe5e3('0x3b')](respondWithResult(_0xecf4ea,null))['catch'](handleError(_0xecf4ea,null));};var interaction_log=require(_0xe5e3('0x17'))(_0xe5e3('0x61'));exports[_0xe5e3('0x62')]=function(_0x3bd5ec,_0x92ba87,_0x1a5318){var _0x6a621e={'channel':_0xe5e3('0x63')};if(_0x3bd5ec[_0xe5e3('0x5f')]['id']){delete _0x3bd5ec[_0xe5e3('0x5f')]['id'];}_0x3bd5ec['body'][_0xe5e3('0x64')]=!![];_0x3bd5ec[_0xe5e3('0x5f')][_0xe5e3('0x65')]=moment()[_0xe5e3('0x66')](_0xe5e3('0x67'));_0x3bd5ec['body'][_0xe5e3('0x68')]=_0x3bd5ec[_0xe5e3('0x5f')][_0xe5e3('0x68')]||_0x3bd5ec[_0xe5e3('0x69')]['id'];return db[_0xe5e3('0x40')][_0xe5e3('0x5d')]({'where':{'id':_0x3bd5ec['params']['id'],'UserId':null},'include':[{'model':db[_0xe5e3('0x6a')],'as':'Contact'}]})[_0xe5e3('0x3b')](handleEntityNotFound(_0x92ba87,null))[_0xe5e3('0x3b')](saveUpdates(_0x3bd5ec[_0xe5e3('0x5f')],null))[_0xe5e3('0x3b')](function(_0x1cc406){if(_0x1cc406){_0x6a621e[_0xe5e3('0x2e')]=_0x1cc406['get']({'plain':!![]});return db[_0xe5e3('0x6b')]['find']({'where':{'id':_0x1cc406['ChatInteractionId']}});}return null;})[_0xe5e3('0x3b')](handleEntityNotFound(_0x92ba87,null))['then'](function(_0x2f941b){if(_0x2f941b){return _0x2f941b[_0xe5e3('0x3a')]({'UserId':_0x3bd5ec[_0xe5e3('0x5f')][_0xe5e3('0x68')],'read1stAt':_[_0xe5e3('0x6c')](_0x2f941b[_0xe5e3('0x6d')])?moment()[_0xe5e3('0x66')](_0xe5e3('0x67')):undefined});}return null;})[_0xe5e3('0x3b')](function(_0x228777){if(_0x228777){_0x6a621e['interaction']=_0x228777[_0xe5e3('0x6e')]({'plain':!![]});interaction_log[_0xe5e3('0x28')](_0xe5e3('0x6f'),_0x3bd5ec[_0xe5e3('0x69')]['id'],_0x3bd5ec[_0xe5e3('0x69')]['name'],_0x3bd5ec[_0xe5e3('0x69')]['role'],_0x6a621e['interaction']['id'],_0x3bd5ec['body']?JSON['stringify'](_0x3bd5ec[_0xe5e3('0x5f')]):'null');return respondWithRpcPromise(_0xe5e3('0x70'),'acceptMessage',_0x6a621e);}return null;})['then'](function(_0x247671){if(_0x247671){if(_0x3bd5ec[_0xe5e3('0x5f')][_0xe5e3('0x71')]){_0x6a621e[_0xe5e3('0x2e')]['interface']=util[_0xe5e3('0x66')](_0xe5e3('0x72'),_0x3bd5ec['user'][_0xe5e3('0x3e')]);_0x6a621e[_0xe5e3('0x2e')][_0xe5e3('0x73')]=_0x6a621e[_0xe5e3('0x73')];_0x6a621e[_0xe5e3('0x2e')][_0xe5e3('0x74')]=_0xe5e3('0x62');return respondWithRpcPromise(_0xe5e3('0x75'),_0xe5e3('0x75'),{'event':'acceptmessage','message':_[_0xe5e3('0x53')](_0x6a621e[_0xe5e3('0x2e')],JSON[_0xe5e3('0x76')](_0x6a621e['interaction']['formData']))},client9002)['then'](function(){return _0x6a621e;});}return _0x6a621e;}return null;})[_0xe5e3('0x3b')](respondWithResult(_0x92ba87,null))['catch'](handleError(_0x92ba87,null));};var interaction_log=require(_0xe5e3('0x17'))('chat-interactions');exports['reject']=function(_0x538e8c,_0x5c2081,_0x405445){var _0x5eda84={'agent':{},'channel':_0xe5e3('0x63')};if(_0x538e8c[_0xe5e3('0x5f')]['id']){delete _0x538e8c[_0xe5e3('0x5f')]['id'];}_0x538e8c[_0xe5e3('0x5f')][_0xe5e3('0x68')]=_0x538e8c[_0xe5e3('0x5f')][_0xe5e3('0x68')]||_0x538e8c[_0xe5e3('0x69')]['id'];_0x5eda84[_0xe5e3('0x77')]['id']=_0x538e8c[_0xe5e3('0x5f')][_0xe5e3('0x68')];return db[_0xe5e3('0x40')][_0xe5e3('0x5d')]({'where':{'id':_0x538e8c[_0xe5e3('0x5b')]['id'],'UserId':null}})[_0xe5e3('0x3b')](handleEntityNotFound(_0x5c2081,null))['then'](function(_0x40ea5f){if(_0x40ea5f){_0x5eda84[_0xe5e3('0x2e')]=_0x40ea5f['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x40ea5f['ChatInteractionId']}});}return null;})[_0xe5e3('0x3b')](handleEntityNotFound(_0x5c2081,null))['then'](function(_0x5e401e){if(_0x5e401e){_0x5eda84[_0xe5e3('0x78')]=_0x5e401e[_0xe5e3('0x6e')]({'plain':!![]});interaction_log['info'](_0xe5e3('0x79'),_0x538e8c[_0xe5e3('0x69')]['id'],_0x538e8c[_0xe5e3('0x69')]['name'],_0x538e8c[_0xe5e3('0x69')][_0xe5e3('0x7a')],_0x5eda84[_0xe5e3('0x78')]['id'],_0x538e8c['body']?JSON[_0xe5e3('0x7b')](_0x538e8c[_0xe5e3('0x5f')]):_0xe5e3('0x7c'));return respondWithRpcPromise(_0xe5e3('0x7d'),_0xe5e3('0x7e'),_0x5eda84);}return null;})[_0xe5e3('0x3b')](function(_0x2fe5de){if(_0x2fe5de){_0x2fe5de['message'][_0xe5e3('0x7f')]=util['format'](_0xe5e3('0x72'),_0x538e8c[_0xe5e3('0x69')]['name']);_0x2fe5de['message'][_0xe5e3('0x73')]=_0x5eda84[_0xe5e3('0x73')];_0x2fe5de['message'][_0xe5e3('0x74')]=_0xe5e3('0x39');respondWithRpcPromise('EventManager',_0xe5e3('0x75'),{'event':_0xe5e3('0x80'),'message':_0x2fe5de[_0xe5e3('0x2e')]},client9002);return _0x5eda84;}return null;})[_0xe5e3('0x3b')](respondWithResult(_0x5c2081,null))[_0xe5e3('0x2f')](handleError(_0x5c2081,null));}; \ No newline at end of file +var _0x1030=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','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','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','info','catch','sendStatus','status','offset','set','Content-Range','json','apply','update','end','stack','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','nolimit','limit','order','sort','filter','where','VIRTUAL','merge','options','count','findAll','rows','show','params','keys','includeAll','find','create','body','destroy','describe','../../config/logger','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','reject','RejectMessage','interface','rejectmessage','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto'];(function(_0x5e9f73,_0x2ec54e){var _0x5e6185=function(_0x416d49){while(--_0x416d49){_0x5e9f73['push'](_0x5e9f73['shift']());}};_0x5e6185(++_0x2ec54e);}(_0x1030,0x15f));var _0x0103=function(_0x45d97d,_0x1d1008){_0x45d97d=_0x45d97d-0x0;var _0x2f9233=_0x1030[_0x45d97d];return _0x2f9233;};'use strict';var pdf=require(_0x0103('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0103('0x1'));var jsonpatch=require(_0x0103('0x2'));var rp=require(_0x0103('0x3'));var moment=require(_0x0103('0x4'));var BPromise=require(_0x0103('0x5'));var Mustache=require(_0x0103('0x6'));var util=require('util');var path=require(_0x0103('0x7'));var sox=require(_0x0103('0x8'));var csv=require(_0x0103('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0103('0xa'));var squel=require('squel');var crypto=require(_0x0103('0xb'));var jsforce=require(_0x0103('0xc'));var deskjs=require(_0x0103('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0103('0xe'));var Papa=require('papaparse');var Redis=require(_0x0103('0xf'));var authService=require(_0x0103('0x10'));var qs=require(_0x0103('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0103('0x12'));var db=require(_0x0103('0x13'))['db'];config[_0x0103('0x14')]=_['defaults'](config[_0x0103('0x14')],{'host':_0x0103('0x15'),'port':0x18eb});var socket=require(_0x0103('0x16'))(new Redis(config[_0x0103('0x14')]));require('./chatMessage.socket')[_0x0103('0x17')](socket);var jayson=require(_0x0103('0x18'));var client=jayson[_0x0103('0x19')][_0x0103('0x1a')]({'port':0x232c});var client9002=jayson[_0x0103('0x19')][_0x0103('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3d3ef6,_0x59887d,_0x5a0dcd){if(_0x5a0dcd){var _0x5ba2cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5ba2cc[_0x0103('0x1b')](_0x59887d)){return _0x3d3ef6;}else{throw new db[(_0x0103('0x1c'))][(_0x0103('0x1d'))](_0x0103('0x1e'));}}else{return _0x3d3ef6;}}function respondWithRpcPromise(_0x229cd2,_0x1ea73a,_0x153fce,_0xad74f0){return new BPromise(function(_0x452128,_0x34c71d){var _0x41e99d=_0xad74f0||client;return _0x41e99d['request'](_0x229cd2,_0x153fce)[_0x0103('0x1f')](function(_0x21a38e){logger['info']('ChatMessage,\x20%s,\x20%s',_0x1ea73a,_0x0103('0x20'));logger[_0x0103('0x21')](_0x0103('0x22'),_0x1ea73a,'request\x20sent',JSON[_0x0103('0x23')](_0x21a38e));if(_0x21a38e[_0x0103('0x24')]){if(_0x21a38e[_0x0103('0x24')][_0x0103('0x25')]===0x1f4){logger[_0x0103('0x24')]('ChatMessage,\x20%s,\x20%s',_0x1ea73a,_0x21a38e[_0x0103('0x24')][_0x0103('0x26')]);return _0x34c71d(_0x21a38e[_0x0103('0x24')][_0x0103('0x26')]);}logger['error'](_0x0103('0x27'),_0x1ea73a,_0x21a38e[_0x0103('0x24')][_0x0103('0x26')]);return _0x452128(_0x21a38e[_0x0103('0x24')]['message']);}else{logger[_0x0103('0x28')](_0x0103('0x27'),_0x1ea73a,'request\x20sent');_0x452128(_0x21a38e['result'][_0x0103('0x26')]);}})[_0x0103('0x29')](function(_0x4f99e0){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1ea73a,_0x4f99e0);_0x34c71d(_0x4f99e0);});});}function respondWithStatusCode(_0x1df590,_0x2c4680){_0x2c4680=_0x2c4680||0xcc;return function(_0x4b67a5){if(_0x4b67a5){return _0x1df590[_0x0103('0x2a')](_0x2c4680);}return _0x1df590[_0x0103('0x2b')](_0x2c4680)['end']();};}function respondWithResult(_0x8afe0f,_0x6d0e7c){_0x6d0e7c=_0x6d0e7c||0xc8;return function(_0x3ec1d4){if(_0x3ec1d4){return _0x8afe0f['status'](_0x6d0e7c)['json'](_0x3ec1d4);}};}function respondWithFilteredResult(_0x197604,_0x188ea5){return function(_0x31022b){if(_0x31022b){var _0x4f6c57=_0x31022b['count'],_0x36ed5d=_0x188ea5[_0x0103('0x2c')],_0xf03268=_0x188ea5[_0x0103('0x2c')]+_0x188ea5['limit'],_0x1bba77;if(_0xf03268>=_0x4f6c57){_0xf03268=_0x4f6c57;_0x1bba77=0xc8;}else{_0x1bba77=0xce;}_0x197604[_0x0103('0x2b')](_0x1bba77);return _0x197604[_0x0103('0x2d')](_0x0103('0x2e'),_0x36ed5d+'-'+_0xf03268+'/'+_0x4f6c57)[_0x0103('0x2f')](_0x31022b);}return null;};}function patchUpdates(_0x2458b7){return function(_0x539a74){try{jsonpatch[_0x0103('0x30')](_0x539a74,_0x2458b7,!![]);}catch(_0x296760){return BPromise['reject'](_0x296760);}return _0x539a74['save']();};}function saveUpdates(_0xdb1b64,_0x19c44a){return function(_0x59c06d){if(_0x59c06d){return _0x59c06d[_0x0103('0x31')](_0xdb1b64)[_0x0103('0x1f')](function(_0x3f1147){return _0x3f1147;});}return null;};}function removeEntity(_0x21b35e,_0x250cd7){return function(_0xc51f93){if(_0xc51f93){return _0xc51f93['destroy']()['then'](function(){_0x21b35e[_0x0103('0x2b')](0xcc)[_0x0103('0x32')]();});}};}function handleEntityNotFound(_0x202a23,_0x596950){return function(_0x5c1096){if(!_0x5c1096){_0x202a23[_0x0103('0x2a')](0x194);}return _0x5c1096;};}function handleError(_0x396ad0,_0x4a47f3){_0x4a47f3=_0x4a47f3||0x1f4;return function(_0x5c1bf9){logger[_0x0103('0x24')](_0x5c1bf9[_0x0103('0x33')]);if(_0x5c1bf9['name']){delete _0x5c1bf9['name'];}_0x396ad0[_0x0103('0x2b')](_0x4a47f3)[_0x0103('0x34')](_0x5c1bf9);};}exports['index']=function(_0x20b742,_0x5b1f2d){var _0x5d86fa={},_0x39e185={},_0x2c1b8c={'count':0x0,'rows':[]};var _0x312302=_[_0x0103('0x35')](db[_0x0103('0x36')][_0x0103('0x37')],function(_0x1620b){return{'name':_0x1620b[_0x0103('0x38')],'type':_0x1620b[_0x0103('0x39')][_0x0103('0x3a')]};});_0x39e185[_0x0103('0x3b')]=_[_0x0103('0x35')](_0x312302,_0x0103('0x3c'));_0x39e185[_0x0103('0x3d')]=_['keys'](_0x20b742['query']);_0x39e185[_0x0103('0x3e')]=_['intersection'](_0x39e185[_0x0103('0x3b')],_0x39e185[_0x0103('0x3d')]);_0x5d86fa['attributes']=_[_0x0103('0x3f')](_0x39e185[_0x0103('0x3b')],qs[_0x0103('0x40')](_0x20b742['query'][_0x0103('0x40')]));_0x5d86fa[_0x0103('0x41')]=_0x5d86fa[_0x0103('0x41')]['length']?_0x5d86fa[_0x0103('0x41')]:_0x39e185[_0x0103('0x3b')];if(!_0x20b742[_0x0103('0x3d')]['hasOwnProperty'](_0x0103('0x42'))){_0x5d86fa['limit']=qs[_0x0103('0x43')](_0x20b742[_0x0103('0x3d')][_0x0103('0x43')]);_0x5d86fa[_0x0103('0x2c')]=qs[_0x0103('0x2c')](_0x20b742['query']['offset']);}_0x5d86fa[_0x0103('0x44')]=qs[_0x0103('0x45')](_0x20b742[_0x0103('0x3d')]['sort']);_0x5d86fa['where']=qs[_0x0103('0x3e')](_['pick'](_0x20b742['query'],_0x39e185['filters']));if(_0x20b742[_0x0103('0x3d')][_0x0103('0x46')]){_0x5d86fa[_0x0103('0x47')]=_['merge'](_0x5d86fa[_0x0103('0x47')],{'$or':_['map'](_0x312302,function(_0x1e7d4f){if(_0x1e7d4f[_0x0103('0x39')]!==_0x0103('0x48')){var _0x262578={};_0x262578[_0x1e7d4f[_0x0103('0x3c')]]={'$like':'%'+_0x20b742[_0x0103('0x3d')][_0x0103('0x46')]+'%'};return _0x262578;}})});}_0x5d86fa=_[_0x0103('0x49')]({},_0x5d86fa,_0x20b742[_0x0103('0x4a')]);var _0x48e3b9={'where':_0x5d86fa['where']};return db[_0x0103('0x36')][_0x0103('0x4b')](_0x48e3b9)[_0x0103('0x1f')](function(_0xf39121){_0x2c1b8c[_0x0103('0x4b')]=_0xf39121;if(_0x20b742[_0x0103('0x3d')]['includeAll']){_0x5d86fa['include']=[{'all':!![]}];}return db[_0x0103('0x36')][_0x0103('0x4c')](_0x5d86fa);})['then'](function(_0x4331d3){_0x2c1b8c[_0x0103('0x4d')]=_0x4331d3;return _0x2c1b8c;})[_0x0103('0x1f')](respondWithFilteredResult(_0x5b1f2d,_0x5d86fa))[_0x0103('0x29')](handleError(_0x5b1f2d,null));};exports[_0x0103('0x4e')]=function(_0x42268d,_0xda1cd1){var _0x260426={'raw':!![],'where':{'id':_0x42268d[_0x0103('0x4f')]['id']}},_0x3e7b70={};_0x3e7b70[_0x0103('0x3b')]=_[_0x0103('0x50')](db[_0x0103('0x36')][_0x0103('0x37')]);_0x3e7b70['query']=_[_0x0103('0x50')](_0x42268d['query']);_0x3e7b70[_0x0103('0x3e')]=_['intersection'](_0x3e7b70[_0x0103('0x3b')],_0x3e7b70[_0x0103('0x3d')]);_0x260426[_0x0103('0x41')]=_['intersection'](_0x3e7b70[_0x0103('0x3b')],qs[_0x0103('0x40')](_0x42268d[_0x0103('0x3d')]['fields']));_0x260426[_0x0103('0x41')]=_0x260426['attributes']['length']?_0x260426['attributes']:_0x3e7b70[_0x0103('0x3b')];if(_0x42268d['query'][_0x0103('0x51')]){_0x260426['include']=[{'all':!![]}];}_0x260426=_[_0x0103('0x49')]({},_0x260426,_0x42268d[_0x0103('0x4a')]);return db[_0x0103('0x36')][_0x0103('0x52')](_0x260426)[_0x0103('0x1f')](handleEntityNotFound(_0xda1cd1,null))[_0x0103('0x1f')](respondWithResult(_0xda1cd1,null))[_0x0103('0x29')](handleError(_0xda1cd1,null));};exports[_0x0103('0x53')]=function(_0x53390c,_0x3eefb6){return db[_0x0103('0x36')][_0x0103('0x53')](_0x53390c[_0x0103('0x54')],{})[_0x0103('0x1f')](respondWithResult(_0x3eefb6,0xc9))[_0x0103('0x29')](handleError(_0x3eefb6,null));};exports['update']=function(_0x40d07d,_0x50105a){if(_0x40d07d[_0x0103('0x54')]['id']){delete _0x40d07d[_0x0103('0x54')]['id'];}return db[_0x0103('0x36')]['find']({'where':{'id':_0x40d07d[_0x0103('0x4f')]['id']}})[_0x0103('0x1f')](handleEntityNotFound(_0x50105a,null))[_0x0103('0x1f')](saveUpdates(_0x40d07d['body'],null))['then'](respondWithResult(_0x50105a,null))[_0x0103('0x29')](handleError(_0x50105a,null));};exports[_0x0103('0x55')]=function(_0x481a21,_0x1f0c5e){return db[_0x0103('0x36')]['find']({'where':{'id':_0x481a21[_0x0103('0x4f')]['id']}})[_0x0103('0x1f')](handleEntityNotFound(_0x1f0c5e,null))['then'](removeEntity(_0x1f0c5e,null))['catch'](handleError(_0x1f0c5e,null));};exports['describe']=function(_0x45cd20,_0x3dc4e7){return db[_0x0103('0x36')][_0x0103('0x56')]()[_0x0103('0x1f')](respondWithResult(_0x3dc4e7,null))[_0x0103('0x29')](handleError(_0x3dc4e7,null));};var interaction_log=require(_0x0103('0x57'))(_0x0103('0x58'));exports[_0x0103('0x59')]=function(_0xe60d50,_0x48c987,_0x363b83){var _0x92b4e0={'channel':_0x0103('0x5a')};if(_0xe60d50[_0x0103('0x54')]['id']){delete _0xe60d50[_0x0103('0x54')]['id'];}_0xe60d50[_0x0103('0x54')]['read']=!![];_0xe60d50[_0x0103('0x54')][_0x0103('0x5b')]=moment()[_0x0103('0x5c')](_0x0103('0x5d'));_0xe60d50['body']['UserId']=_0xe60d50[_0x0103('0x54')][_0x0103('0x5e')]||_0xe60d50[_0x0103('0x5f')]['id'];return db[_0x0103('0x36')][_0x0103('0x52')]({'where':{'id':_0xe60d50['params']['id'],'UserId':null},'include':[{'model':db[_0x0103('0x60')],'as':_0x0103('0x61')}]})['then'](handleEntityNotFound(_0x48c987,null))['then'](saveUpdates(_0xe60d50['body'],null))['then'](function(_0x27759b){if(_0x27759b){_0x92b4e0[_0x0103('0x26')]=_0x27759b[_0x0103('0x62')]({'plain':!![]});return db[_0x0103('0x63')]['find']({'where':{'id':_0x27759b[_0x0103('0x64')]}});}return null;})[_0x0103('0x1f')](handleEntityNotFound(_0x48c987,null))[_0x0103('0x1f')](function(_0x390738){if(_0x390738){return _0x390738['update']({'UserId':_0xe60d50[_0x0103('0x54')][_0x0103('0x5e')],'read1stAt':_[_0x0103('0x65')](_0x390738[_0x0103('0x66')])?moment()[_0x0103('0x5c')](_0x0103('0x5d')):undefined});}return null;})['then'](function(_0x1b048c){if(_0x1b048c){_0x92b4e0['interaction']=_0x1b048c[_0x0103('0x62')]({'plain':!![]});interaction_log[_0x0103('0x28')](_0x0103('0x67'),_0xe60d50['user']['id'],_0xe60d50['user'][_0x0103('0x3c')],_0xe60d50['user'][_0x0103('0x68')],_0x92b4e0[_0x0103('0x69')]['id'],_0xe60d50[_0x0103('0x54')]?JSON[_0x0103('0x23')](_0xe60d50[_0x0103('0x54')]):_0x0103('0x6a'));return respondWithRpcPromise(_0x0103('0x6b'),_0x0103('0x6c'),_0x92b4e0);}return null;})[_0x0103('0x1f')](function(_0x2d0b3a){if(_0x2d0b3a){if(_0xe60d50[_0x0103('0x54')][_0x0103('0x6d')]){_0x92b4e0[_0x0103('0x26')]['interface']=util[_0x0103('0x5c')](_0x0103('0x6e'),_0xe60d50['user'][_0x0103('0x3c')]);_0x92b4e0[_0x0103('0x26')][_0x0103('0x6f')]=_0x92b4e0['channel'];_0x92b4e0[_0x0103('0x26')][_0x0103('0x70')]=_0x0103('0x59');return respondWithRpcPromise(_0x0103('0x71'),'EventManager',{'event':_0x0103('0x72'),'message':_[_0x0103('0x49')](_0x92b4e0[_0x0103('0x26')],JSON[_0x0103('0x73')](_0x92b4e0['interaction'][_0x0103('0x74')]))},client9002)[_0x0103('0x1f')](function(){return _0x92b4e0;});}return _0x92b4e0;}return null;})[_0x0103('0x1f')](respondWithResult(_0x48c987,null))[_0x0103('0x29')](handleError(_0x48c987,null));};var interaction_log=require(_0x0103('0x57'))(_0x0103('0x58'));exports[_0x0103('0x75')]=function(_0x5eea71,_0x5235ad,_0x28ec8f){var _0x418277={'agent':{},'channel':'chat'};if(_0x5eea71['body']['id']){delete _0x5eea71['body']['id'];}_0x5eea71[_0x0103('0x54')][_0x0103('0x5e')]=_0x5eea71[_0x0103('0x54')][_0x0103('0x5e')]||_0x5eea71[_0x0103('0x5f')]['id'];_0x418277['agent']['id']=_0x5eea71[_0x0103('0x54')]['UserId'];return db[_0x0103('0x36')][_0x0103('0x52')]({'where':{'id':_0x5eea71[_0x0103('0x4f')]['id'],'UserId':null}})[_0x0103('0x1f')](handleEntityNotFound(_0x5235ad,null))[_0x0103('0x1f')](function(_0x5e94e6){if(_0x5e94e6){_0x418277[_0x0103('0x26')]=_0x5e94e6[_0x0103('0x62')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x5e94e6[_0x0103('0x64')]}});}return null;})[_0x0103('0x1f')](handleEntityNotFound(_0x5235ad,null))[_0x0103('0x1f')](function(_0x1e95d9){if(_0x1e95d9){_0x418277['interaction']=_0x1e95d9[_0x0103('0x62')]({'plain':!![]});interaction_log[_0x0103('0x28')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5eea71[_0x0103('0x5f')]['id'],_0x5eea71[_0x0103('0x5f')][_0x0103('0x3c')],_0x5eea71['user'][_0x0103('0x68')],_0x418277[_0x0103('0x69')]['id'],_0x5eea71[_0x0103('0x54')]?JSON['stringify'](_0x5eea71[_0x0103('0x54')]):'null');return respondWithRpcPromise(_0x0103('0x76'),'rejectMessage',_0x418277);}return null;})[_0x0103('0x1f')](function(_0xfc8ec){if(_0xfc8ec){_0xfc8ec[_0x0103('0x26')][_0x0103('0x77')]=util[_0x0103('0x5c')](_0x0103('0x6e'),_0x5eea71['user'][_0x0103('0x3c')]);_0xfc8ec['message']['channel']=_0x418277[_0x0103('0x6f')];_0xfc8ec['message'][_0x0103('0x70')]=_0x0103('0x75');respondWithRpcPromise(_0x0103('0x71'),_0x0103('0x71'),{'event':_0x0103('0x78'),'message':_0xfc8ec[_0x0103('0x26')]},client9002);return _0x418277;}return null;})[_0x0103('0x1f')](respondWithResult(_0x5235ad,null))['catch'](handleError(_0x5235ad,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index d7a8006..1b9d40a 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 _0x7df4=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x5be82e,_0xbfbf94){var _0x1e52c6=function(_0x1979ae){while(--_0x1979ae){_0x5be82e['push'](_0x5be82e['shift']());}};_0x1e52c6(++_0xbfbf94);}(_0x7df4,0x9a));var _0x47df=function(_0x36bb38,_0x267cfa){_0x36bb38=_0x36bb38-0x0;var _0x21b1b7=_0x7df4[_0x36bb38];return _0x21b1b7;};'use strict';var EventEmitter=require(_0x47df('0x0'));var ChatMessage=require(_0x47df('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x47df('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47df('0x3'),'afterDestroy':_0x47df('0x4')};function emitEvent(_0x1d7766){return function(_0x4a3a18,_0x24dc8f,_0x322a05){ChatMessageEvents[_0x47df('0x5')](_0x1d7766+':'+_0x4a3a18['id'],_0x4a3a18);ChatMessageEvents[_0x47df('0x5')](_0x1d7766,_0x4a3a18);_0x322a05(null);};}for(var e in events){if(events[_0x47df('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x1c94=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','ChatMessage'];(function(_0x1817be,_0x289f1e){var _0x29ed41=function(_0xaae74){while(--_0xaae74){_0x1817be['push'](_0x1817be['shift']());}};_0x29ed41(++_0x289f1e);}(_0x1c94,0x11e));var _0x41c9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1c94[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x41c9('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x41c9('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x41c9('0x2')](0x0);var events={'afterCreate':_0x41c9('0x3'),'afterUpdate':_0x41c9('0x4'),'afterDestroy':_0x41c9('0x5')};function emitEvent(_0x1ff423){return function(_0x2a9e26,_0x12b0f9,_0x4e82f8){ChatMessageEvents[_0x41c9('0x6')](_0x1ff423+':'+_0x2a9e26['id'],_0x2a9e26);ChatMessageEvents[_0x41c9('0x6')](_0x1ff423,_0x2a9e26);_0x4e82f8(null);};}for(var e in events){if(events[_0x41c9('0x7')](e)){var event=events[e];ChatMessage[_0x41c9('0x8')](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 9649708..1e24703 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 _0xd29d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xd29d,0x15b));var _0xdd29=function(_0x2d1773,_0x32c577){_0x2d1773=_0x2d1773-0x0;var _0x1a31dc=_0xd29d[_0x2d1773];return _0x1a31dc;};'use strict';var _=require(_0xdd29('0x0'));var util=require('util');var logger=require(_0xdd29('0x1'))(_0xdd29('0x2'));var moment=require(_0xdd29('0x3'));var BPromise=require(_0xdd29('0x4'));var rp=require(_0xdd29('0x5'));var fs=require('fs');var path=require(_0xdd29('0x6'));var rimraf=require(_0xdd29('0x7'));var config=require(_0xdd29('0x8'));var attributes=require(_0xdd29('0x9'));module[_0xdd29('0xa')]=function(_0x50cbf8,_0x452a1f){return _0x50cbf8[_0xdd29('0xb')]('ChatMessage',attributes,{'tableName':_0xdd29('0xc'),'paranoid':![],'indexes':[{'name':_0xdd29('0xd'),'fields':[_0xdd29('0xe')],'type':_0xdd29('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x14809f,_0x127e39,_0xdccd0b){var _0x2ffe49=_0x50cbf8[_0xdd29('0x10')];var _0x5ee813=_0x14809f[_0xdd29('0x11')]({'plain':!![]});if(_0x5ee813[_0xdd29('0x12')][_0xdd29('0x13')]()==='in'||_0x5ee813[_0xdd29('0x12')][_0xdd29('0x13')]()===_0xdd29('0x14')&&!_0x5ee813[_0xdd29('0x15')]&&!_[_0xdd29('0x16')](_0x5ee813[_0xdd29('0x17')])){_0x2ffe49['ChatInteraction']['findOne']({'where':{'id':_0x5ee813['ChatInteractionId']}})[_0xdd29('0x18')](function(_0xe26289){if(_0xe26289){_0xe26289[_0xdd29('0x19')]({'lastMsgAt':_0x5ee813['createdAt'],'lastMsgDirection':_0x5ee813[_0xdd29('0x12')]['toLowerCase']()});}})[_0xdd29('0x1a')](function(_0x3deb6c){console['error'](_0x3deb6c);});}_0xdccd0b();}},'charset':_0xdd29('0x1b'),'collate':_0xdd29('0x1c')});}; \ No newline at end of file +var _0x9b8c=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','models','get','direction','toLowerCase','out','secret','ChatInteractionId','then','update','createdAt','catch'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x9b8c,0x12e));var _0xc9b8=function(_0x13524d,_0x505b49){_0x13524d=_0x13524d-0x0;var _0x9918b4=_0x9b8c[_0x13524d];return _0x9918b4;};'use strict';var _=require(_0xc9b8('0x0'));var util=require(_0xc9b8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc9b8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc9b8('0x3'));var config=require(_0xc9b8('0x4'));var attributes=require(_0xc9b8('0x5'));module[_0xc9b8('0x6')]=function(_0x5937a3,_0x30e785){return _0x5937a3[_0xc9b8('0x7')](_0xc9b8('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3fff3d,_0x3a05a1,_0x4f73b6){var _0x41ad5b=_0x5937a3[_0xc9b8('0x9')];var _0x400783=_0x3fff3d[_0xc9b8('0xa')]({'plain':!![]});if(_0x400783[_0xc9b8('0xb')][_0xc9b8('0xc')]()==='in'||_0x400783['direction'][_0xc9b8('0xc')]()===_0xc9b8('0xd')&&!_0x400783[_0xc9b8('0xe')]&&!_['isNil'](_0x400783['UserId'])){_0x41ad5b['ChatInteraction']['findOne']({'where':{'id':_0x400783[_0xc9b8('0xf')]}})[_0xc9b8('0x10')](function(_0x3c16a8){if(_0x3c16a8){_0x3c16a8[_0xc9b8('0x11')]({'lastMsgAt':_0x400783[_0xc9b8('0x12')],'lastMsgDirection':_0x400783[_0xc9b8('0xb')]['toLowerCase']()});}})[_0xc9b8('0x13')](function(_0x49485e){console[_0xc9b8('0x14')](_0x49485e);});}_0x4f73b6();}},'charset':_0xc9b8('0x15'),'collate':_0xc9b8('0x16')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 2c9fa7b..6c75196 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 _0x981d=['./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','body','options','raw','CreateChatMessage','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x981d,0x89));var _0xd981=function(_0x3c99b5,_0xe76aa7){_0x3c99b5=_0x3c99b5-0x0;var _0xcfb0ac=_0x981d[_0x3c99b5];return _0xcfb0ac;};'use strict';var _=require(_0xd981('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd981('0x1'));var rs=require(_0xd981('0x2'));var fs=require('fs');var Redis=require(_0xd981('0x3'));var db=require(_0xd981('0x4'))['db'];var utils=require(_0xd981('0x5'));var logger=require(_0xd981('0x6'))(_0xd981('0x7'));var config=require(_0xd981('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd981('0x9')][_0xd981('0xa')]({'port':0x232a});config[_0xd981('0xb')]=_[_0xd981('0xc')](config[_0xd981('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd981('0xb')]));require(_0xd981('0xd'))[_0xd981('0xe')](socket);function respondWithRpcPromise(_0x5ae57f,_0xa039fa,_0xbbc44e){return new BPromise(function(_0x390341,_0x42119b){return client[_0xd981('0xf')](_0x5ae57f,_0xbbc44e)[_0xd981('0x10')](function(_0x1fa8ec){logger[_0xd981('0x11')](_0xd981('0x12'),_0xa039fa,_0xd981('0x13'));logger[_0xd981('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xa039fa,_0xd981('0x13'),JSON[_0xd981('0x15')](_0x1fa8ec));if(_0x1fa8ec[_0xd981('0x16')]){if(_0x1fa8ec[_0xd981('0x16')][_0xd981('0x17')]===0x1f4){logger[_0xd981('0x16')]('ChatMessage,\x20%s,\x20%s',_0xa039fa,_0x1fa8ec[_0xd981('0x16')]['message']);return _0x42119b(_0x1fa8ec[_0xd981('0x16')][_0xd981('0x18')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0xa039fa,_0x1fa8ec['error'][_0xd981('0x18')]);return _0x390341(_0x1fa8ec[_0xd981('0x16')][_0xd981('0x18')]);}else{logger[_0xd981('0x11')](_0xd981('0x12'),_0xa039fa,_0xd981('0x13'));_0x390341(_0x1fa8ec['result'][_0xd981('0x18')]);}})[_0xd981('0x19')](function(_0x5438e7){logger[_0xd981('0x16')](_0xd981('0x12'),_0xa039fa,_0x5438e7);_0x42119b(_0x5438e7);});});}exports['CreateChatMessage']=function(_0x4131ea){var _0x5842ef=this;return new Promise(function(_0x10269a,_0x29229d){return db['ChatMessage']['create'](_0x4131ea[_0xd981('0x1a')],{'raw':_0x4131ea[_0xd981('0x1b')]?_0x4131ea[_0xd981('0x1b')][_0xd981('0x1c')]===undefined?!![]:![]:!![]})[_0xd981('0x10')](function(_0x54e7b8){logger[_0xd981('0x11')](_0xd981('0x1d'),_0x4131ea);logger[_0xd981('0x14')](_0xd981('0x1d'),_0x4131ea,JSON[_0xd981('0x15')](_0x54e7b8));_0x10269a(_0x54e7b8);})[_0xd981('0x19')](function(_0x21b92f){logger[_0xd981('0x16')](_0xd981('0x1d'),_0x21b92f[_0xd981('0x18')],_0x4131ea);_0x29229d(_0x5842ef['error'](0x1f4,_0x21b92f[_0xd981('0x18')]));});});}; \ No newline at end of file +var _0xcc1e=['options','CreateChatMessage','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','socket.io-emitter','redis','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','ChatMessage','create'];(function(_0x1229c8,_0x1a7f0f){var _0x3ae885=function(_0x27b46d){while(--_0x27b46d){_0x1229c8['push'](_0x1229c8['shift']());}};_0x3ae885(++_0x1a7f0f);}(_0xcc1e,0xfc));var _0xecc1=function(_0x39d85b,_0x290fc8){_0x39d85b=_0x39d85b-0x0;var _0x3f111f=_0xcc1e[_0x39d85b];return _0x3f111f;};'use strict';var _=require(_0xecc1('0x0'));var util=require(_0xecc1('0x1'));var moment=require(_0xecc1('0x2'));var BPromise=require('bluebird');var rs=require(_0xecc1('0x3'));var fs=require('fs');var Redis=require(_0xecc1('0x4'));var db=require(_0xecc1('0x5'))['db'];var utils=require(_0xecc1('0x6'));var logger=require(_0xecc1('0x7'))(_0xecc1('0x8'));var config=require('../../config/environment');var jayson=require(_0xecc1('0x9'));var client=jayson[_0xecc1('0xa')]['http']({'port':0x232a});config['redis']=_[_0xecc1('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xecc1('0xc'))(new Redis(config[_0xecc1('0xd')]));require(_0xecc1('0xe'))[_0xecc1('0xf')](socket);function respondWithRpcPromise(_0x806d9b,_0x34af29,_0x24404d){return new BPromise(function(_0x3a650d,_0x7cc545){return client[_0xecc1('0x10')](_0x806d9b,_0x24404d)['then'](function(_0x3a5f37){logger[_0xecc1('0x11')](_0xecc1('0x12'),_0x34af29,_0xecc1('0x13'));logger[_0xecc1('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x34af29,_0xecc1('0x13'),JSON['stringify'](_0x3a5f37));if(_0x3a5f37[_0xecc1('0x15')]){if(_0x3a5f37[_0xecc1('0x15')][_0xecc1('0x16')]===0x1f4){logger['error'](_0xecc1('0x12'),_0x34af29,_0x3a5f37[_0xecc1('0x15')]['message']);return _0x7cc545(_0x3a5f37[_0xecc1('0x15')]['message']);}logger[_0xecc1('0x15')]('ChatMessage,\x20%s,\x20%s',_0x34af29,_0x3a5f37[_0xecc1('0x15')][_0xecc1('0x17')]);return _0x3a650d(_0x3a5f37[_0xecc1('0x15')][_0xecc1('0x17')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x34af29,_0xecc1('0x13'));_0x3a650d(_0x3a5f37[_0xecc1('0x18')][_0xecc1('0x17')]);}})['catch'](function(_0x2c7e6d){logger[_0xecc1('0x15')](_0xecc1('0x12'),_0x34af29,_0x2c7e6d);_0x7cc545(_0x2c7e6d);});});}exports['CreateChatMessage']=function(_0x36f7d8){var _0xc1363d=this;return new Promise(function(_0x338629,_0x1ef193){return db[_0xecc1('0x19')][_0xecc1('0x1a')](_0x36f7d8['body'],{'raw':_0x36f7d8[_0xecc1('0x1b')]?_0x36f7d8['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x19468a){logger[_0xecc1('0x11')](_0xecc1('0x1c'),_0x36f7d8);logger[_0xecc1('0x14')](_0xecc1('0x1c'),_0x36f7d8,JSON[_0xecc1('0x1d')](_0x19468a));_0x338629(_0x19468a);})[_0xecc1('0x1e')](function(_0x3fe218){logger[_0xecc1('0x15')](_0xecc1('0x1c'),_0x3fe218[_0xecc1('0x17')],_0x36f7d8);_0x1ef193(_0xc1363d[_0xecc1('0x15')](0x1f4,_0x3fe218[_0xecc1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index cec4636..311cc3f 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 _0xeda8=['chatMessage:','./chatMessage.events','save','update','emit','removeListener','register'];(function(_0x5ca52d,_0x3a4a22){var _0x89e54e=function(_0x54bdf4){while(--_0x54bdf4){_0x5ca52d['push'](_0x5ca52d['shift']());}};_0x89e54e(++_0x3a4a22);}(_0xeda8,0x104));var _0x8eda=function(_0x563e84,_0x1665dd){_0x563e84=_0x563e84-0x0;var _0x4460e0=_0xeda8[_0x563e84];return _0x4460e0;};'use strict';var ChatMessageEvents=require(_0x8eda('0x0'));var events=[_0x8eda('0x1'),'remove',_0x8eda('0x2')];function createListener(_0xd8b5d5,_0x2090a2){return function(_0xc01211){_0x2090a2[_0x8eda('0x3')](_0xd8b5d5,_0xc01211);};}function removeListener(_0x94b83f,_0x25b19a){return function(){ChatMessageEvents[_0x8eda('0x4')](_0x94b83f,_0x25b19a);};}exports[_0x8eda('0x5')]=function(_0x1f3556){for(var _0x349361=0x0,_0x32abe8=events['length'];_0x349361<_0x32abe8;_0x349361++){var _0x28b721=events[_0x349361];var _0x1b6a1d=createListener(_0x8eda('0x6')+_0x28b721,_0x1f3556);ChatMessageEvents['on'](_0x28b721,_0x1b6a1d);}}; \ No newline at end of file +var _0x4137=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x547a1d,_0x252337){var _0x4e522f=function(_0x76d516){while(--_0x76d516){_0x547a1d['push'](_0x547a1d['shift']());}};_0x4e522f(++_0x252337);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var ChatMessageEvents=require(_0x7413('0x0'));var events=[_0x7413('0x1'),_0x7413('0x2'),_0x7413('0x3')];function createListener(_0x392ebc,_0x410971){return function(_0x2e6df7){_0x410971[_0x7413('0x4')](_0x392ebc,_0x2e6df7);};}function removeListener(_0x258255,_0x3dc48a){return function(){ChatMessageEvents[_0x7413('0x5')](_0x258255,_0x3dc48a);};}exports[_0x7413('0x6')]=function(_0x4fbade){for(var _0xc808cd=0x0,_0x188d89=events[_0x7413('0x7')];_0xc808cd<_0x188d89;_0xc808cd++){var _0x15af0d=events[_0xc808cd];var _0x5f4cd0=createListener(_0x7413('0x8')+_0x15af0d,_0x4fbade);ChatMessageEvents['on'](_0x15af0d,_0x5f4cd0);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 9007c34..3de7244 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 _0x0fb4=['express','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout'];(function(_0x1fccc0,_0x3365ff){var _0x171193=function(_0x4e61f2){while(--_0x4e61f2){_0x1fccc0['push'](_0x1fccc0['shift']());}};_0x171193(++_0x3365ff);}(_0x0fb4,0x80));var _0x40fb=function(_0x92713a,_0x68f8b0){_0x92713a=_0x92713a-0x0;var _0x1893e1=_0x0fb4[_0x92713a];return _0x1893e1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x40fb('0x0'));var timeout=require(_0x40fb('0x1'));var express=require(_0x40fb('0x2'));var router=express['Router']();var auth=require(_0x40fb('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x40fb('0x4'));var controller=require(_0x40fb('0x5'));router[_0x40fb('0x6')]('/',auth[_0x40fb('0x7')](),controller[_0x40fb('0x8')]);router[_0x40fb('0x6')](_0x40fb('0x9'),auth[_0x40fb('0x7')](),controller[_0x40fb('0xa')]);router[_0x40fb('0x6')](_0x40fb('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x40fb('0xc')]('/',auth[_0x40fb('0x7')](),interaction[_0x40fb('0xd')](_0x40fb('0xe'),_0x40fb('0xf')),controller[_0x40fb('0x10')]);router[_0x40fb('0x11')](_0x40fb('0xb'),controller[_0x40fb('0x12')]);router['put'](_0x40fb('0x13'),auth[_0x40fb('0x7')](),controller[_0x40fb('0x14')]);router['put'](_0x40fb('0x15'),auth[_0x40fb('0x7')](),controller[_0x40fb('0x16')]);router[_0x40fb('0x17')](_0x40fb('0xb'),auth[_0x40fb('0x7')](),controller[_0x40fb('0x18')]);module[_0x40fb('0x19')]=router; \ No newline at end of file +var _0x0672=['/:id','isAuthenticated','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','describe'];(function(_0x58e3ad,_0x2b42d7){var _0x8764b9=function(_0x5eea10){while(--_0x5eea10){_0x58e3ad['push'](_0x58e3ad['shift']());}};_0x8764b9(++_0x2b42d7);}(_0x0672,0x107));var _0x2067=function(_0x141908,_0x4e61dc){_0x141908=_0x141908-0x0;var _0x37e9c9=_0x0672[_0x141908];return _0x37e9c9;};'use strict';var multer=require(_0x2067('0x0'));var util=require('util');var path=require(_0x2067('0x1'));var timeout=require('connect-timeout');var express=require(_0x2067('0x2'));var router=express[_0x2067('0x3')]();var auth=require(_0x2067('0x4'));var interaction=require(_0x2067('0x5'));var config=require(_0x2067('0x6'));var controller=require(_0x2067('0x7'));router[_0x2067('0x8')]('/',auth['isAuthenticated'](),controller[_0x2067('0x9')]);router['get'](_0x2067('0xa'),auth['isAuthenticated'](),controller[_0x2067('0xb')]);router[_0x2067('0x8')](_0x2067('0xc'),auth[_0x2067('0xd')](),controller[_0x2067('0xe')]);router[_0x2067('0xf')]('/',auth[_0x2067('0xd')](),interaction[_0x2067('0x10')](_0x2067('0x11'),_0x2067('0x12')),controller[_0x2067('0x13')]);router[_0x2067('0x14')](_0x2067('0xc'),controller[_0x2067('0x15')]);router[_0x2067('0x14')](_0x2067('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0x2067('0x14')]('/:id/reject',auth[_0x2067('0xd')](),controller['reject']);router['delete'](_0x2067('0xc'),auth['isAuthenticated'](),controller[_0x2067('0x17')]);module[_0x2067('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 3e3f3cd..091d34d 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 _0xa8b7=['exports','TEXT'];(function(_0x353d0d,_0x4df255){var _0x5a0603=function(_0x15a9eb){while(--_0x15a9eb){_0x353d0d['push'](_0x353d0d['shift']());}};_0x5a0603(++_0x4df255);}(_0xa8b7,0x1cc));var _0x7a8b=function(_0x51bb2e,_0x3277c9){_0x51bb2e=_0x51bb2e-0x0;var _0x418693=_0xa8b7[_0x51bb2e];return _0x418693;};'use strict';var Sequelize=require('sequelize');module[_0x7a8b('0x0')]={'body':{'type':Sequelize[_0x7a8b('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0xa7dc=['TEXT','medium','sequelize'];(function(_0x117c35,_0x4b5433){var _0x59d30d=function(_0x3d8f76){while(--_0x3d8f76){_0x117c35['push'](_0x117c35['shift']());}};_0x59d30d(++_0x4b5433);}(_0xa7dc,0xc2));var _0xca7d=function(_0x238906,_0x18110a){_0x238906=_0x238906-0x0;var _0x5860bd=_0xa7dc[_0x238906];return _0x5860bd;};'use strict';var Sequelize=require(_0xca7d('0x0'));module['exports']={'body':{'type':Sequelize[_0xca7d('0x1')](_0xca7d('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 162797d..9d466cb 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 _0x3354=['where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','save','update','then','destroy','end','error','stack','name','index','map','ChatOfflineMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x5e4c06,_0x55b60d){var _0x44346c=function(_0x175fdc){while(--_0x175fdc){_0x5e4c06['push'](_0x5e4c06['shift']());}};_0x44346c(++_0x55b60d);}(_0x3354,0xa3));var _0x4335=function(_0x3001ae,_0x198815){_0x3001ae=_0x3001ae-0x0;var _0x22024f=_0x3354[_0x3001ae];return _0x22024f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4335('0x0'));var rimraf=require(_0x4335('0x1'));var zipdir=require(_0x4335('0x2'));var jsonpatch=require(_0x4335('0x3'));var rp=require(_0x4335('0x4'));var moment=require('moment');var BPromise=require(_0x4335('0x5'));var Mustache=require(_0x4335('0x6'));var util=require(_0x4335('0x7'));var path=require(_0x4335('0x8'));var sox=require(_0x4335('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4335('0xa'));var squel=require(_0x4335('0xb'));var crypto=require(_0x4335('0xc'));var jsforce=require(_0x4335('0xd'));var deskjs=require(_0x4335('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4335('0xf'));var Papa=require('papaparse');var Redis=require(_0x4335('0x10'));var authService=require(_0x4335('0x11'));var qs=require(_0x4335('0x12'));var as=require(_0x4335('0x13'));var hardwareService=require(_0x4335('0x14'));var logger=require(_0x4335('0x15'))(_0x4335('0x16'));var utils=require(_0x4335('0x17'));var config=require(_0x4335('0x18'));var db=require(_0x4335('0x19'))['db'];function respondWithStatusCode(_0x562514,_0x54d8df){_0x54d8df=_0x54d8df||0xcc;return function(_0x41fbe4){if(_0x41fbe4){return _0x562514[_0x4335('0x1a')](_0x54d8df);}return _0x562514[_0x4335('0x1b')](_0x54d8df)['end']();};}function respondWithResult(_0x16e3e1,_0x2a75da){_0x2a75da=_0x2a75da||0xc8;return function(_0x80e801){if(_0x80e801){return _0x16e3e1[_0x4335('0x1b')](_0x2a75da)[_0x4335('0x1c')](_0x80e801);}};}function respondWithFilteredResult(_0x2dbf2f,_0x37c437){return function(_0x45cdce){if(_0x45cdce){var _0x18982e=_0x45cdce[_0x4335('0x1d')],_0x5b19dd=_0x37c437['offset'],_0x4dced5=_0x37c437[_0x4335('0x1e')]+_0x37c437[_0x4335('0x1f')],_0x16b16f;if(_0x4dced5>=_0x18982e){_0x4dced5=_0x18982e;_0x16b16f=0xc8;}else{_0x16b16f=0xce;}_0x2dbf2f[_0x4335('0x1b')](_0x16b16f);return _0x2dbf2f['set']('Content-Range',_0x5b19dd+'-'+_0x4dced5+'/'+_0x18982e)[_0x4335('0x1c')](_0x45cdce);}return null;};}function patchUpdates(_0x39ed47){return function(_0x11170c){try{jsonpatch[_0x4335('0x20')](_0x11170c,_0x39ed47,!![]);}catch(_0xad70d4){return BPromise['reject'](_0xad70d4);}return _0x11170c[_0x4335('0x21')]();};}function saveUpdates(_0x3048ff,_0xea124c){return function(_0x30c3ad){if(_0x30c3ad){return _0x30c3ad[_0x4335('0x22')](_0x3048ff)[_0x4335('0x23')](function(_0x31aaf1){return _0x31aaf1;});}return null;};}function removeEntity(_0x36c3d5,_0x410775){return function(_0x4e68ac){if(_0x4e68ac){return _0x4e68ac[_0x4335('0x24')]()['then'](function(){_0x36c3d5['status'](0xcc)[_0x4335('0x25')]();});}};}function handleEntityNotFound(_0x479e16,_0x1f5766){return function(_0x14f5f1){if(!_0x14f5f1){_0x479e16[_0x4335('0x1a')](0x194);}return _0x14f5f1;};}function handleError(_0x3ae155,_0x4abdaf){_0x4abdaf=_0x4abdaf||0x1f4;return function(_0x129206){logger[_0x4335('0x26')](_0x129206[_0x4335('0x27')]);if(_0x129206[_0x4335('0x28')]){delete _0x129206[_0x4335('0x28')];}_0x3ae155[_0x4335('0x1b')](_0x4abdaf)['send'](_0x129206);};}exports[_0x4335('0x29')]=function(_0x2cd396,_0x2f24be){var _0x1cdc40={},_0x5378ff={},_0x47a2b1={'count':0x0,'rows':[]};var _0x26ee0d=_[_0x4335('0x2a')](db[_0x4335('0x2b')][_0x4335('0x2c')],function(_0x30343e){return{'name':_0x30343e[_0x4335('0x2d')],'type':_0x30343e[_0x4335('0x2e')][_0x4335('0x2f')]};});_0x5378ff[_0x4335('0x30')]=_['map'](_0x26ee0d,_0x4335('0x28'));_0x5378ff[_0x4335('0x31')]=_[_0x4335('0x32')](_0x2cd396[_0x4335('0x31')]);_0x5378ff[_0x4335('0x33')]=_['intersection'](_0x5378ff['model'],_0x5378ff[_0x4335('0x31')]);_0x1cdc40['attributes']=_[_0x4335('0x34')](_0x5378ff[_0x4335('0x30')],qs[_0x4335('0x35')](_0x2cd396['query'][_0x4335('0x35')]));_0x1cdc40['attributes']=_0x1cdc40[_0x4335('0x36')]['length']?_0x1cdc40[_0x4335('0x36')]:_0x5378ff[_0x4335('0x30')];if(!_0x2cd396[_0x4335('0x31')][_0x4335('0x37')](_0x4335('0x38'))){_0x1cdc40[_0x4335('0x1f')]=qs['limit'](_0x2cd396[_0x4335('0x31')][_0x4335('0x1f')]);_0x1cdc40[_0x4335('0x1e')]=qs['offset'](_0x2cd396[_0x4335('0x31')][_0x4335('0x1e')]);}_0x1cdc40[_0x4335('0x39')]=qs[_0x4335('0x3a')](_0x2cd396[_0x4335('0x31')]['sort']);_0x1cdc40[_0x4335('0x3b')]=qs['filters'](_['pick'](_0x2cd396['query'],_0x5378ff[_0x4335('0x33')]));if(_0x2cd396[_0x4335('0x31')][_0x4335('0x3c')]){_0x1cdc40['where']=_[_0x4335('0x3d')](_0x1cdc40[_0x4335('0x3b')],{'$or':_[_0x4335('0x2a')](_0x26ee0d,function(_0x36e255){if(_0x36e255[_0x4335('0x2e')]!==_0x4335('0x3e')){var _0x2d12b5={};_0x2d12b5[_0x36e255[_0x4335('0x28')]]={'$like':'%'+_0x2cd396[_0x4335('0x31')][_0x4335('0x3c')]+'%'};return _0x2d12b5;}})});}_0x1cdc40=_['merge']({},_0x1cdc40,_0x2cd396[_0x4335('0x3f')]);var _0x14d703={'where':_0x1cdc40[_0x4335('0x3b')]};return db[_0x4335('0x2b')][_0x4335('0x1d')](_0x14d703)[_0x4335('0x23')](function(_0x231892){_0x47a2b1['count']=_0x231892;if(_0x2cd396[_0x4335('0x31')][_0x4335('0x40')]){_0x1cdc40['include']=[{'all':!![]}];}return db[_0x4335('0x2b')][_0x4335('0x41')](_0x1cdc40);})[_0x4335('0x23')](function(_0x3c8e88){_0x47a2b1['rows']=_0x3c8e88;return _0x47a2b1;})[_0x4335('0x23')](respondWithFilteredResult(_0x2f24be,_0x1cdc40))[_0x4335('0x42')](handleError(_0x2f24be,null));};exports[_0x4335('0x43')]=function(_0x4e7837,_0x257b5c){var _0x4697a6={'raw':!![],'where':{'id':_0x4e7837['params']['id']}},_0x4a6b20={};_0x4a6b20['model']=_['keys'](db['ChatOfflineMessage'][_0x4335('0x2c')]);_0x4a6b20[_0x4335('0x31')]=_['keys'](_0x4e7837[_0x4335('0x31')]);_0x4a6b20['filters']=_[_0x4335('0x34')](_0x4a6b20[_0x4335('0x30')],_0x4a6b20[_0x4335('0x31')]);_0x4697a6[_0x4335('0x36')]=_[_0x4335('0x34')](_0x4a6b20[_0x4335('0x30')],qs[_0x4335('0x35')](_0x4e7837[_0x4335('0x31')][_0x4335('0x35')]));_0x4697a6[_0x4335('0x36')]=_0x4697a6['attributes'][_0x4335('0x44')]?_0x4697a6[_0x4335('0x36')]:_0x4a6b20[_0x4335('0x30')];if(_0x4e7837[_0x4335('0x31')][_0x4335('0x40')]){_0x4697a6['include']=[{'all':!![]}];}_0x4697a6=_[_0x4335('0x3d')]({},_0x4697a6,_0x4e7837[_0x4335('0x3f')]);return db['ChatOfflineMessage'][_0x4335('0x45')](_0x4697a6)[_0x4335('0x23')](handleEntityNotFound(_0x257b5c,null))['then'](respondWithResult(_0x257b5c,null))[_0x4335('0x42')](handleError(_0x257b5c,null));};exports['create']=function(_0x11e938,_0x26ca1c){return db[_0x4335('0x2b')][_0x4335('0x46')](_0x11e938['body'],{})[_0x4335('0x23')](respondWithResult(_0x26ca1c,0xc9))[_0x4335('0x42')](handleError(_0x26ca1c,null));};exports[_0x4335('0x22')]=function(_0xad3b7e,_0x130474){if(_0xad3b7e[_0x4335('0x47')]['id']){delete _0xad3b7e['body']['id'];}return db[_0x4335('0x2b')][_0x4335('0x45')]({'where':{'id':_0xad3b7e['params']['id']}})['then'](handleEntityNotFound(_0x130474,null))[_0x4335('0x23')](saveUpdates(_0xad3b7e['body'],null))[_0x4335('0x23')](respondWithResult(_0x130474,null))[_0x4335('0x42')](handleError(_0x130474,null));};exports[_0x4335('0x24')]=function(_0x2513f8,_0x3890fd){return db['ChatOfflineMessage'][_0x4335('0x45')]({'where':{'id':_0x2513f8[_0x4335('0x48')]['id']}})[_0x4335('0x23')](handleEntityNotFound(_0x3890fd,null))[_0x4335('0x23')](removeEntity(_0x3890fd,null))[_0x4335('0x42')](handleError(_0x3890fd,null));};exports[_0x4335('0x49')]=function(_0x1db3b7,_0x5ded6b){return db[_0x4335('0x2b')][_0x4335('0x49')]()[_0x4335('0x23')](respondWithResult(_0x5ded6b,null))[_0x4335('0x42')](handleError(_0x5ded6b,null));}; \ No newline at end of file +var _0x24a0=['where','filter','merge','options','include','ChatOfflineMessage','findAll','rows','catch','params','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','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','reject','save','update','then','destroy','error','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x5578f3,_0x4fa154){var _0x448c87=function(_0xadd3fe){while(--_0xadd3fe){_0x5578f3['push'](_0x5578f3['shift']());}};_0x448c87(++_0x4fa154);}(_0x24a0,0xe1));var _0x024a=function(_0xad4f90,_0x1f83f0){_0xad4f90=_0xad4f90-0x0;var _0x2b1586=_0x24a0[_0xad4f90];return _0x2b1586;};'use strict';var pdf=require(_0x024a('0x0'));var emlformat=require(_0x024a('0x1'));var rimraf=require(_0x024a('0x2'));var zipdir=require(_0x024a('0x3'));var jsonpatch=require(_0x024a('0x4'));var rp=require(_0x024a('0x5'));var moment=require(_0x024a('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x024a('0x7'));var util=require(_0x024a('0x8'));var path=require(_0x024a('0x9'));var sox=require(_0x024a('0xa'));var csv=require(_0x024a('0xb'));var ejs=require(_0x024a('0xc'));var fs=require('fs');var _=require(_0x024a('0xd'));var squel=require('squel');var crypto=require(_0x024a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x024a('0xb'));var querystring=require('querystring');var Papa=require(_0x024a('0xf'));var Redis=require(_0x024a('0x10'));var authService=require(_0x024a('0x11'));var qs=require(_0x024a('0x12'));var as=require(_0x024a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x024a('0x14'))('api');var utils=require(_0x024a('0x15'));var config=require(_0x024a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1beac0,_0x19955c){_0x19955c=_0x19955c||0xcc;return function(_0x457833){if(_0x457833){return _0x1beac0[_0x024a('0x17')](_0x19955c);}return _0x1beac0[_0x024a('0x18')](_0x19955c)[_0x024a('0x19')]();};}function respondWithResult(_0x46b3ad,_0x137252){_0x137252=_0x137252||0xc8;return function(_0xb35ad6){if(_0xb35ad6){return _0x46b3ad['status'](_0x137252)['json'](_0xb35ad6);}};}function respondWithFilteredResult(_0x482bac,_0xa04545){return function(_0xe338dd){if(_0xe338dd){var _0x4288de=_0xe338dd[_0x024a('0x1a')],_0x2b2fa3=_0xa04545[_0x024a('0x1b')],_0x590ab6=_0xa04545[_0x024a('0x1b')]+_0xa04545[_0x024a('0x1c')],_0x21fb5c;if(_0x590ab6>=_0x4288de){_0x590ab6=_0x4288de;_0x21fb5c=0xc8;}else{_0x21fb5c=0xce;}_0x482bac[_0x024a('0x18')](_0x21fb5c);return _0x482bac[_0x024a('0x1d')](_0x024a('0x1e'),_0x2b2fa3+'-'+_0x590ab6+'/'+_0x4288de)['json'](_0xe338dd);}return null;};}function patchUpdates(_0x35e2ae){return function(_0xb757e8){try{jsonpatch['apply'](_0xb757e8,_0x35e2ae,!![]);}catch(_0x13246a){return BPromise[_0x024a('0x1f')](_0x13246a);}return _0xb757e8[_0x024a('0x20')]();};}function saveUpdates(_0x5079cc,_0x1cc833){return function(_0x114592){if(_0x114592){return _0x114592[_0x024a('0x21')](_0x5079cc)[_0x024a('0x22')](function(_0x550da9){return _0x550da9;});}return null;};}function removeEntity(_0x2f16f7,_0x7596c){return function(_0x29677d){if(_0x29677d){return _0x29677d[_0x024a('0x23')]()[_0x024a('0x22')](function(){_0x2f16f7[_0x024a('0x18')](0xcc)[_0x024a('0x19')]();});}};}function handleEntityNotFound(_0x590ad5,_0x28487e){return function(_0x349a3b){if(!_0x349a3b){_0x590ad5[_0x024a('0x17')](0x194);}return _0x349a3b;};}function handleError(_0x156c62,_0x2d2dff){_0x2d2dff=_0x2d2dff||0x1f4;return function(_0xf35c43){logger[_0x024a('0x24')](_0xf35c43['stack']);if(_0xf35c43[_0x024a('0x25')]){delete _0xf35c43[_0x024a('0x25')];}_0x156c62[_0x024a('0x18')](_0x2d2dff)[_0x024a('0x26')](_0xf35c43);};}exports['index']=function(_0x2c7662,_0x1284ed){var _0x4351c0={},_0x171d43={},_0x374f38={'count':0x0,'rows':[]};var _0x4fc070=_['map'](db['ChatOfflineMessage'][_0x024a('0x27')],function(_0x312a99){return{'name':_0x312a99[_0x024a('0x28')],'type':_0x312a99[_0x024a('0x29')][_0x024a('0x2a')]};});_0x171d43[_0x024a('0x2b')]=_[_0x024a('0x2c')](_0x4fc070,_0x024a('0x25'));_0x171d43[_0x024a('0x2d')]=_[_0x024a('0x2e')](_0x2c7662[_0x024a('0x2d')]);_0x171d43[_0x024a('0x2f')]=_[_0x024a('0x30')](_0x171d43['model'],_0x171d43[_0x024a('0x2d')]);_0x4351c0[_0x024a('0x31')]=_[_0x024a('0x30')](_0x171d43[_0x024a('0x2b')],qs[_0x024a('0x32')](_0x2c7662['query'][_0x024a('0x32')]));_0x4351c0[_0x024a('0x31')]=_0x4351c0[_0x024a('0x31')][_0x024a('0x33')]?_0x4351c0[_0x024a('0x31')]:_0x171d43[_0x024a('0x2b')];if(!_0x2c7662['query'][_0x024a('0x34')](_0x024a('0x35'))){_0x4351c0['limit']=qs[_0x024a('0x1c')](_0x2c7662[_0x024a('0x2d')]['limit']);_0x4351c0['offset']=qs[_0x024a('0x1b')](_0x2c7662[_0x024a('0x2d')]['offset']);}_0x4351c0[_0x024a('0x36')]=qs['sort'](_0x2c7662[_0x024a('0x2d')]['sort']);_0x4351c0[_0x024a('0x37')]=qs['filters'](_['pick'](_0x2c7662[_0x024a('0x2d')],_0x171d43[_0x024a('0x2f')]));if(_0x2c7662['query'][_0x024a('0x38')]){_0x4351c0[_0x024a('0x37')]=_['merge'](_0x4351c0[_0x024a('0x37')],{'$or':_[_0x024a('0x2c')](_0x4fc070,function(_0x3685f0){if(_0x3685f0[_0x024a('0x29')]!=='VIRTUAL'){var _0x2d47b1={};_0x2d47b1[_0x3685f0[_0x024a('0x25')]]={'$like':'%'+_0x2c7662[_0x024a('0x2d')]['filter']+'%'};return _0x2d47b1;}})});}_0x4351c0=_[_0x024a('0x39')]({},_0x4351c0,_0x2c7662[_0x024a('0x3a')]);var _0x1b4826={'where':_0x4351c0['where']};return db['ChatOfflineMessage']['count'](_0x1b4826)[_0x024a('0x22')](function(_0xfc876b){_0x374f38['count']=_0xfc876b;if(_0x2c7662['query']['includeAll']){_0x4351c0[_0x024a('0x3b')]=[{'all':!![]}];}return db[_0x024a('0x3c')][_0x024a('0x3d')](_0x4351c0);})['then'](function(_0x23db9b){_0x374f38[_0x024a('0x3e')]=_0x23db9b;return _0x374f38;})[_0x024a('0x22')](respondWithFilteredResult(_0x1284ed,_0x4351c0))[_0x024a('0x3f')](handleError(_0x1284ed,null));};exports['show']=function(_0xefb5f0,_0x40683c){var _0x26ab96={'raw':!![],'where':{'id':_0xefb5f0[_0x024a('0x40')]['id']}},_0x4db31b={};_0x4db31b[_0x024a('0x2b')]=_[_0x024a('0x2e')](db['ChatOfflineMessage'][_0x024a('0x27')]);_0x4db31b[_0x024a('0x2d')]=_['keys'](_0xefb5f0['query']);_0x4db31b['filters']=_[_0x024a('0x30')](_0x4db31b[_0x024a('0x2b')],_0x4db31b['query']);_0x26ab96['attributes']=_[_0x024a('0x30')](_0x4db31b[_0x024a('0x2b')],qs['fields'](_0xefb5f0[_0x024a('0x2d')][_0x024a('0x32')]));_0x26ab96[_0x024a('0x31')]=_0x26ab96[_0x024a('0x31')][_0x024a('0x33')]?_0x26ab96[_0x024a('0x31')]:_0x4db31b[_0x024a('0x2b')];if(_0xefb5f0[_0x024a('0x2d')][_0x024a('0x41')]){_0x26ab96['include']=[{'all':!![]}];}_0x26ab96=_[_0x024a('0x39')]({},_0x26ab96,_0xefb5f0[_0x024a('0x3a')]);return db[_0x024a('0x3c')][_0x024a('0x42')](_0x26ab96)[_0x024a('0x22')](handleEntityNotFound(_0x40683c,null))['then'](respondWithResult(_0x40683c,null))[_0x024a('0x3f')](handleError(_0x40683c,null));};exports[_0x024a('0x43')]=function(_0x31be15,_0x61b6e0){return db[_0x024a('0x3c')][_0x024a('0x43')](_0x31be15[_0x024a('0x44')],{})[_0x024a('0x22')](respondWithResult(_0x61b6e0,0xc9))[_0x024a('0x3f')](handleError(_0x61b6e0,null));};exports['update']=function(_0xf1c5fa,_0x57a3fd){if(_0xf1c5fa['body']['id']){delete _0xf1c5fa[_0x024a('0x44')]['id'];}return db['ChatOfflineMessage'][_0x024a('0x42')]({'where':{'id':_0xf1c5fa[_0x024a('0x40')]['id']}})[_0x024a('0x22')](handleEntityNotFound(_0x57a3fd,null))[_0x024a('0x22')](saveUpdates(_0xf1c5fa['body'],null))[_0x024a('0x22')](respondWithResult(_0x57a3fd,null))[_0x024a('0x3f')](handleError(_0x57a3fd,null));};exports['destroy']=function(_0x4260ff,_0x41d0f9){return db[_0x024a('0x3c')]['find']({'where':{'id':_0x4260ff['params']['id']}})[_0x024a('0x22')](handleEntityNotFound(_0x41d0f9,null))[_0x024a('0x22')](removeEntity(_0x41d0f9,null))[_0x024a('0x3f')](handleError(_0x41d0f9,null));};exports[_0x024a('0x45')]=function(_0x14e418,_0x2d5b9c){return db[_0x024a('0x3c')][_0x024a('0x45')]()[_0x024a('0x22')](respondWithResult(_0x2d5b9c,null))[_0x024a('0x3f')](handleError(_0x2d5b9c,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index dfeda3e..c056c25 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 _0xb903=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x60286b,_0x3247c1){var _0x5dff69=function(_0x4ecfcf){while(--_0x4ecfcf){_0x60286b['push'](_0x60286b['shift']());}};_0x5dff69(++_0x3247c1);}(_0xb903,0x185));var _0x3b90=function(_0x366459,_0x4778de){_0x366459=_0x366459-0x0;var _0x51dbb4=_0xb903[_0x366459];return _0x51dbb4;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('ChatOfflineMessage',attributes,{'tableName':_0x3b90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3b90('0xc'),'collate':_0x3b90('0xd')});}; \ No newline at end of file +var _0xe107=['../../config/logger','api','moment','request-promise','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash'];(function(_0x1799a4,_0x114955){var _0xccd50e=function(_0x29e461){while(--_0x29e461){_0x1799a4['push'](_0x1799a4['shift']());}};_0xccd50e(++_0x114955);}(_0xe107,0xb3));var _0x7e10=function(_0x234288,_0x544009){_0x234288=_0x234288-0x0;var _0x2d9476=_0xe107[_0x234288];return _0x2d9476;};'use strict';var _=require(_0x7e10('0x0'));var util=require('util');var logger=require(_0x7e10('0x1'))(_0x7e10('0x2'));var moment=require(_0x7e10('0x3'));var BPromise=require('bluebird');var rp=require(_0x7e10('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7e10('0x5'));var attributes=require(_0x7e10('0x6'));module[_0x7e10('0x7')]=function(_0x5be19f,_0x5f1edf){return _0x5be19f[_0x7e10('0x8')](_0x7e10('0x9'),attributes,{'tableName':_0x7e10('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e10('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 445c31b..e0b76dd 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 _0x2a26=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x6877b1,_0x18d6d0){var _0xdf9c64=function(_0x58e7ab){while(--_0x58e7ab){_0x6877b1['push'](_0x6877b1['shift']());}};_0xdf9c64(++_0x18d6d0);}(_0x2a26,0x113));var _0x62a2=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0x2a26[_0x43aee5];return _0x76d1d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x62a2('0x0'));var BPromise=require(_0x62a2('0x1'));var rs=require(_0x62a2('0x2'));var fs=require('fs');var Redis=require(_0x62a2('0x3'));var db=require(_0x62a2('0x4'))['db'];var utils=require(_0x62a2('0x5'));var logger=require('../../config/logger')(_0x62a2('0x6'));var config=require(_0x62a2('0x7'));var jayson=require(_0x62a2('0x8'));var client=jayson[_0x62a2('0x9')][_0x62a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bc1ff,_0x10bba1,_0x3040b1){return new BPromise(function(_0x1358a1,_0x123263){return client['request'](_0x4bc1ff,_0x3040b1)[_0x62a2('0xb')](function(_0x400b06){logger[_0x62a2('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x10bba1,_0x62a2('0xd'));logger['debug'](_0x62a2('0xe'),_0x10bba1,_0x62a2('0xd'),JSON[_0x62a2('0xf')](_0x400b06));if(_0x400b06[_0x62a2('0x10')]){if(_0x400b06[_0x62a2('0x10')]['code']===0x1f4){logger[_0x62a2('0x10')](_0x62a2('0x11'),_0x10bba1,_0x400b06[_0x62a2('0x10')][_0x62a2('0x12')]);return _0x123263(_0x400b06[_0x62a2('0x10')][_0x62a2('0x12')]);}logger[_0x62a2('0x10')](_0x62a2('0x11'),_0x10bba1,_0x400b06['error'][_0x62a2('0x12')]);return _0x1358a1(_0x400b06[_0x62a2('0x10')][_0x62a2('0x12')]);}else{logger[_0x62a2('0xc')](_0x62a2('0x11'),_0x10bba1,_0x62a2('0xd'));_0x1358a1(_0x400b06[_0x62a2('0x13')]['message']);}})['catch'](function(_0x5f5ad8){logger[_0x62a2('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x10bba1,_0x5f5ad8);_0x123263(_0x5f5ad8);});});} \ No newline at end of file +var _0x641b=['info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x2a5c57,_0x2bcdd2){var _0x366ba5=function(_0x363d5f){while(--_0x363d5f){_0x2a5c57['push'](_0x2a5c57['shift']());}};_0x366ba5(++_0x2bcdd2);}(_0x641b,0x182));var _0xb641=function(_0x13200c,_0x1e3195){_0x13200c=_0x13200c-0x0;var _0x48208f=_0x641b[_0x13200c];return _0x48208f;};'use strict';var _=require(_0xb641('0x0'));var util=require(_0xb641('0x1'));var moment=require(_0xb641('0x2'));var BPromise=require(_0xb641('0x3'));var rs=require(_0xb641('0x4'));var fs=require('fs');var Redis=require(_0xb641('0x5'));var db=require(_0xb641('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb641('0x7'))(_0xb641('0x8'));var config=require(_0xb641('0x9'));var jayson=require(_0xb641('0xa'));var client=jayson[_0xb641('0xb')][_0xb641('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d33c3,_0x35debb,_0x346d3a){return new BPromise(function(_0x3cb5a1,_0x10ccc4){return client['request'](_0x3d33c3,_0x346d3a)[_0xb641('0xd')](function(_0x372315){logger[_0xb641('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x35debb,_0xb641('0xf'));logger[_0xb641('0x10')](_0xb641('0x11'),_0x35debb,_0xb641('0xf'),JSON[_0xb641('0x12')](_0x372315));if(_0x372315[_0xb641('0x13')]){if(_0x372315['error'][_0xb641('0x14')]===0x1f4){logger['error'](_0xb641('0x15'),_0x35debb,_0x372315[_0xb641('0x13')][_0xb641('0x16')]);return _0x10ccc4(_0x372315[_0xb641('0x13')][_0xb641('0x16')]);}logger[_0xb641('0x13')](_0xb641('0x15'),_0x35debb,_0x372315[_0xb641('0x13')][_0xb641('0x16')]);return _0x3cb5a1(_0x372315[_0xb641('0x13')]['message']);}else{logger[_0xb641('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x35debb,_0xb641('0xf'));_0x3cb5a1(_0x372315[_0xb641('0x17')]['message']);}})[_0xb641('0x18')](function(_0x408417){logger[_0xb641('0x13')](_0xb641('0x15'),_0x35debb,_0x408417);_0x10ccc4(_0x408417);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 3c5c3c1..f6c9e50 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 _0x819a=['show','post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','describe','isAuthenticated'];(function(_0x27234f,_0x19ed19){var _0x28b9b2=function(_0x459ab0){while(--_0x459ab0){_0x27234f['push'](_0x27234f['shift']());}};_0x28b9b2(++_0x19ed19);}(_0x819a,0x1ad));var _0xa819=function(_0x49eb06,_0x47d2b6){_0x49eb06=_0x49eb06-0x0;var _0x4b8d67=_0x819a[_0x49eb06];return _0x4b8d67;};'use strict';var multer=require(_0xa819('0x0'));var util=require(_0xa819('0x1'));var path=require('path');var timeout=require(_0xa819('0x2'));var express=require(_0xa819('0x3'));var router=express[_0xa819('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa819('0x5'));var controller=require(_0xa819('0x6'));router[_0xa819('0x7')]('/',auth['isAuthenticated'](),controller[_0xa819('0x8')]);router[_0xa819('0x7')](_0xa819('0x9'),auth['isAuthenticated'](),controller[_0xa819('0xa')]);router[_0xa819('0x7')]('/:id',auth[_0xa819('0xb')](),controller[_0xa819('0xc')]);router[_0xa819('0xd')]('/',auth[_0xa819('0xb')](),controller[_0xa819('0xe')]);router[_0xa819('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa819('0x10')]);router[_0xa819('0x11')](_0xa819('0x12'),auth[_0xa819('0xb')](),controller[_0xa819('0x13')]);module[_0xa819('0x14')]=router; \ No newline at end of file +var _0xfcab=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x11c032,_0x4ca503){var _0x55919f=function(_0x97e42c){while(--_0x97e42c){_0x11c032['push'](_0x11c032['shift']());}};_0x55919f(++_0x4ca503);}(_0xfcab,0x175));var _0xbfca=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0xfcab[_0x25a0b9];return _0x30b9ab;};'use strict';var multer=require(_0xbfca('0x0'));var util=require('util');var path=require(_0xbfca('0x1'));var timeout=require(_0xbfca('0x2'));var express=require(_0xbfca('0x3'));var router=express[_0xbfca('0x4')]();var auth=require(_0xbfca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbfca('0x6'));var controller=require(_0xbfca('0x7'));router[_0xbfca('0x8')]('/',auth[_0xbfca('0x9')](),controller[_0xbfca('0xa')]);router[_0xbfca('0x8')](_0xbfca('0xb'),auth['isAuthenticated'](),controller[_0xbfca('0xc')]);router[_0xbfca('0x8')](_0xbfca('0xd'),auth[_0xbfca('0x9')](),controller[_0xbfca('0xe')]);router[_0xbfca('0xf')]('/',auth[_0xbfca('0x9')](),controller[_0xbfca('0x10')]);router[_0xbfca('0x11')](_0xbfca('0xd'),auth[_0xbfca('0x9')](),controller['update']);router[_0xbfca('0x12')](_0xbfca('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xbfca('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 224ccff..fbf3f8f 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 _0x7d3a=['ENUM','mouseOver','timeout','exports','STRING'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x7d3a,0x107));var _0xa7d3=function(_0x43244c,_0xa2a77f){_0x43244c=_0x43244c-0x0;var _0x34babb=_0x7d3a[_0x43244c];return _0x34babb;};'use strict';var Sequelize=require('sequelize');module[_0xa7d3('0x0')]={'name':{'type':Sequelize[_0xa7d3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa7d3('0x2')](_0xa7d3('0x3'),_0xa7d3('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xa7d3('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa4dd=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0xa4dd,0x1b1));var _0xda4d=function(_0x4df1f5,_0x39c6d2){_0x4df1f5=_0x4df1f5-0x0;var _0x56585b=_0xa4dd[_0x4df1f5];return _0x56585b;};'use strict';var Sequelize=require(_0xda4d('0x0'));module[_0xda4d('0x1')]={'name':{'type':Sequelize[_0xda4d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xda4d('0x3')](_0xda4d('0x4'),'timeout'),'defaultValue':_0xda4d('0x4')},'selector':{'type':Sequelize[_0xda4d('0x2')]},'timeout':{'type':Sequelize[_0xda4d('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 94d51a1..addf4aa 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 _0x70e0=['mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','options','catch','create','body','find','html-pdf','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x30024c,_0xfcc072){var _0x4f561c=function(_0x4a088c){while(--_0x4a088c){_0x30024c['push'](_0x30024c['shift']());}};_0x4f561c(++_0xfcc072);}(_0x70e0,0x17b));var _0x070e=function(_0x584321,_0x144259){_0x584321=_0x584321-0x0;var _0x3e26ef=_0x70e0[_0x584321];return _0x3e26ef;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={'raw':!![],'where':{'id':_0x1743cc[_0x070e('0x26')]['id']}},_0x374c54={};_0x374c54[_0x070e('0x27')]=_[_0x070e('0x28')](db[_0x070e('0x29')][_0x070e('0x2a')]);_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x28')](_0x1743cc['query']);_0x374c54[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],_0x374c54['query']);_0x497f58['attributes']=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],qs[_0x070e('0x2e')](_0x1743cc['query'][_0x070e('0x2e')]));_0x497f58[_0x070e('0x2f')]=_0x497f58[_0x070e('0x2f')][_0x070e('0x30')]?_0x497f58['attributes']:_0x374c54['model'];if(_0x1743cc['query']['includeAll']){_0x497f58[_0x070e('0x31')]=[{'all':!![]}];}_0x497f58=_['merge']({},_0x497f58,_0x1743cc[_0x070e('0x32')]);return db[_0x070e('0x29')]['find'](_0x497f58)['then'](handleEntityNotFound(_0x4763c6,null))[_0x070e('0x20')](respondWithResult(_0x4763c6,null))[_0x070e('0x33')](handleError(_0x4763c6,null));};exports['create']=function(_0x546a16,_0x41ade4){return db[_0x070e('0x29')][_0x070e('0x34')](_0x546a16[_0x070e('0x35')],{})[_0x070e('0x20')](respondWithResult(_0x41ade4,0xc9))['catch'](handleError(_0x41ade4,null));};exports['update']=function(_0x24d17d,_0x3011c4){if(_0x24d17d[_0x070e('0x35')]['id']){delete _0x24d17d[_0x070e('0x35')]['id'];}return db[_0x070e('0x29')]['find']({'where':{'id':_0x24d17d[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x3011c4,null))['then'](saveUpdates(_0x24d17d[_0x070e('0x35')],null))[_0x070e('0x20')](respondWithResult(_0x3011c4,null))['catch'](handleError(_0x3011c4,null));};exports['destroy']=function(_0x5ddbe9,_0x363bff){return db[_0x070e('0x29')][_0x070e('0x36')]({'where':{'id':_0x5ddbe9[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x363bff,null))['then'](removeEntity(_0x363bff,null))[_0x070e('0x33')](handleError(_0x363bff,null));}; \ No newline at end of file +var _0x9c44=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge','options','catch','create','ChatProactiveAction','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs'];(function(_0x55e2e7,_0x3d7ffb){var _0x2ca98a=function(_0x499090){while(--_0x499090){_0x55e2e7['push'](_0x55e2e7['shift']());}};_0x2ca98a(++_0x3d7ffb);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var as=require(_0x49c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x11'))(_0x49c4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49c4('0x13'))['db'];function respondWithStatusCode(_0x6d1b08,_0x5487cd){_0x5487cd=_0x5487cd||0xcc;return function(_0x7df3a9){if(_0x7df3a9){return _0x6d1b08[_0x49c4('0x14')](_0x5487cd);}return _0x6d1b08['status'](_0x5487cd)[_0x49c4('0x15')]();};}function respondWithResult(_0x280996,_0x21f15a){_0x21f15a=_0x21f15a||0xc8;return function(_0x2decee){if(_0x2decee){return _0x280996[_0x49c4('0x16')](_0x21f15a)[_0x49c4('0x17')](_0x2decee);}};}function respondWithFilteredResult(_0x75ea8,_0x3de397){return function(_0x58d177){if(_0x58d177){var _0x3acd06=_0x58d177[_0x49c4('0x18')],_0x141003=_0x3de397['offset'],_0x13a2db=_0x3de397[_0x49c4('0x19')]+_0x3de397[_0x49c4('0x1a')],_0x81e831;if(_0x13a2db>=_0x3acd06){_0x13a2db=_0x3acd06;_0x81e831=0xc8;}else{_0x81e831=0xce;}_0x75ea8['status'](_0x81e831);return _0x75ea8['set'](_0x49c4('0x1b'),_0x141003+'-'+_0x13a2db+'/'+_0x3acd06)[_0x49c4('0x17')](_0x58d177);}return null;};}function patchUpdates(_0x3addb2){return function(_0x59f29b){try{jsonpatch[_0x49c4('0x1c')](_0x59f29b,_0x3addb2,!![]);}catch(_0x50b151){return BPromise[_0x49c4('0x1d')](_0x50b151);}return _0x59f29b[_0x49c4('0x1e')]();};}function saveUpdates(_0xe31fcc,_0x291526){return function(_0x382040){if(_0x382040){return _0x382040[_0x49c4('0x1f')](_0xe31fcc)[_0x49c4('0x20')](function(_0x46e475){return _0x46e475;});}return null;};}function removeEntity(_0x2197d2,_0x578447){return function(_0x527126){if(_0x527126){return _0x527126['destroy']()[_0x49c4('0x20')](function(){_0x2197d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2263ae,_0x15581b){return function(_0x26c640){if(!_0x26c640){_0x2263ae[_0x49c4('0x14')](0x194);}return _0x26c640;};}function handleError(_0x4811c4,_0x5850f2){_0x5850f2=_0x5850f2||0x1f4;return function(_0x180276){logger[_0x49c4('0x21')](_0x180276['stack']);if(_0x180276[_0x49c4('0x22')]){delete _0x180276[_0x49c4('0x22')];}_0x4811c4[_0x49c4('0x16')](_0x5850f2)[_0x49c4('0x23')](_0x180276);};}exports['show']=function(_0x543ea2,_0x449960){var _0x53c199={'raw':!![],'where':{'id':_0x543ea2[_0x49c4('0x24')]['id']}},_0x3800b7={};_0x3800b7[_0x49c4('0x25')]=_[_0x49c4('0x26')](db['ChatProactiveAction'][_0x49c4('0x27')]);_0x3800b7[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0x543ea2[_0x49c4('0x28')]);_0x3800b7[_0x49c4('0x29')]=_[_0x49c4('0x2a')](_0x3800b7[_0x49c4('0x25')],_0x3800b7[_0x49c4('0x28')]);_0x53c199[_0x49c4('0x2b')]=_[_0x49c4('0x2a')](_0x3800b7[_0x49c4('0x25')],qs['fields'](_0x543ea2['query']['fields']));_0x53c199[_0x49c4('0x2b')]=_0x53c199[_0x49c4('0x2b')][_0x49c4('0x2c')]?_0x53c199[_0x49c4('0x2b')]:_0x3800b7[_0x49c4('0x25')];if(_0x543ea2['query'][_0x49c4('0x2d')]){_0x53c199[_0x49c4('0x2e')]=[{'all':!![]}];}_0x53c199=_[_0x49c4('0x2f')]({},_0x53c199,_0x543ea2[_0x49c4('0x30')]);return db['ChatProactiveAction']['find'](_0x53c199)[_0x49c4('0x20')](handleEntityNotFound(_0x449960,null))[_0x49c4('0x20')](respondWithResult(_0x449960,null))[_0x49c4('0x31')](handleError(_0x449960,null));};exports[_0x49c4('0x32')]=function(_0xd38540,_0x4a0c7a){return db[_0x49c4('0x33')][_0x49c4('0x32')](_0xd38540[_0x49c4('0x34')],{})['then'](respondWithResult(_0x4a0c7a,0xc9))['catch'](handleError(_0x4a0c7a,null));};exports[_0x49c4('0x1f')]=function(_0x1991e9,_0x3bec0a){if(_0x1991e9[_0x49c4('0x34')]['id']){delete _0x1991e9[_0x49c4('0x34')]['id'];}return db[_0x49c4('0x33')][_0x49c4('0x35')]({'where':{'id':_0x1991e9[_0x49c4('0x24')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x3bec0a,null))['then'](saveUpdates(_0x1991e9[_0x49c4('0x34')],null))['then'](respondWithResult(_0x3bec0a,null))[_0x49c4('0x31')](handleError(_0x3bec0a,null));};exports[_0x49c4('0x36')]=function(_0x2625a6,_0x1c2830){return db['ChatProactiveAction'][_0x49c4('0x35')]({'where':{'id':_0x2625a6[_0x49c4('0x24')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x1c2830,null))['then'](removeEntity(_0x1c2830,null))[_0x49c4('0x31')](handleError(_0x1c2830,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 38fa078..23a6b81 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 _0xc2b9=['bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','lodash','util','../../config/logger','api','moment'];(function(_0x488fd1,_0x47911e){var _0x2eda29=function(_0x5a84d7){while(--_0x5a84d7){_0x488fd1['push'](_0x488fd1['shift']());}};_0x2eda29(++_0x47911e);}(_0xc2b9,0x11b));var _0x9c2b=function(_0x5cce12,_0x1aab9b){_0x5cce12=_0x5cce12-0x0;var _0x1c6cfa=_0xc2b9[_0x5cce12];return _0x1c6cfa;};'use strict';var _=require(_0x9c2b('0x0'));var util=require(_0x9c2b('0x1'));var logger=require(_0x9c2b('0x2'))(_0x9c2b('0x3'));var moment=require(_0x9c2b('0x4'));var BPromise=require(_0x9c2b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c2b('0x6'));var rimraf=require(_0x9c2b('0x7'));var config=require(_0x9c2b('0x8'));var attributes=require(_0x9c2b('0x9'));module['exports']=function(_0x303447,_0x2c0f1b){return _0x303447[_0x9c2b('0xa')](_0x9c2b('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef96=['chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatProactiveAction.attributes','ChatProactiveAction'];(function(_0x140d8e,_0x5eb62d){var _0x47094e=function(_0x2c21e3){while(--_0x2c21e3){_0x140d8e['push'](_0x140d8e['shift']());}};_0x47094e(++_0x5eb62d);}(_0xef96,0x182));var _0x6ef9=function(_0x5b2ff8,_0x197f8f){_0x5b2ff8=_0x5b2ff8-0x0;var _0x502c11=_0xef96[_0x5b2ff8];return _0x502c11;};'use strict';var _=require(_0x6ef9('0x0'));var util=require(_0x6ef9('0x1'));var logger=require(_0x6ef9('0x2'))(_0x6ef9('0x3'));var moment=require(_0x6ef9('0x4'));var BPromise=require(_0x6ef9('0x5'));var rp=require(_0x6ef9('0x6'));var fs=require('fs');var path=require(_0x6ef9('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6ef9('0x8'));module['exports']=function(_0x54b0f9,_0x349597){return _0x54b0f9['define'](_0x6ef9('0x9'),attributes,{'tableName':_0x6ef9('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 d72d477..9e7cc22 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 _0x33e5=['then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x58b632,_0x275aaa){var _0x70488b=function(_0x1ae1bc){while(--_0x1ae1bc){_0x58b632['push'](_0x58b632['shift']());}};_0x70488b(++_0x275aaa);}(_0x33e5,0xfe));var _0x533e=function(_0x176fb8,_0x11ff49){_0x176fb8=_0x176fb8-0x0;var _0x4926fa=_0x33e5[_0x176fb8];return _0x4926fa;};'use strict';var _=require(_0x533e('0x0'));var util=require(_0x533e('0x1'));var moment=require(_0x533e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x533e('0x3'));var db=require(_0x533e('0x4'))['db'];var utils=require(_0x533e('0x5'));var logger=require(_0x533e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x533e('0x7'));var client=jayson[_0x533e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e9c8d,_0x4b7cf4,_0x5a17fb){return new BPromise(function(_0x23607a,_0x43643c){return client[_0x533e('0x9')](_0x4e9c8d,_0x5a17fb)[_0x533e('0xa')](function(_0x196341){logger[_0x533e('0xb')](_0x533e('0xc'),_0x4b7cf4,_0x533e('0xd'));logger[_0x533e('0xe')](_0x533e('0xf'),_0x4b7cf4,'request\x20sent',JSON[_0x533e('0x10')](_0x196341));if(_0x196341[_0x533e('0x11')]){if(_0x196341[_0x533e('0x11')][_0x533e('0x12')]===0x1f4){logger[_0x533e('0x11')](_0x533e('0xc'),_0x4b7cf4,_0x196341[_0x533e('0x11')][_0x533e('0x13')]);return _0x43643c(_0x196341[_0x533e('0x11')][_0x533e('0x13')]);}logger[_0x533e('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4b7cf4,_0x196341[_0x533e('0x11')][_0x533e('0x13')]);return _0x23607a(_0x196341[_0x533e('0x11')][_0x533e('0x13')]);}else{logger[_0x533e('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x4b7cf4,_0x533e('0xd'));_0x23607a(_0x196341[_0x533e('0x14')]['message']);}})[_0x533e('0x15')](function(_0xea624e){logger[_0x533e('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4b7cf4,_0xea624e);_0x43643c(_0xea624e);});});} \ No newline at end of file +var _0x2093=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x44f000,_0x4fcb9f){var _0xa7ffd1=function(_0xff7ddd){while(--_0xff7ddd){_0x44f000['push'](_0x44f000['shift']());}};_0xa7ffd1(++_0x4fcb9f);}(_0x2093,0xcd));var _0x3209=function(_0x3ea4ce,_0x6bf6f1){_0x3ea4ce=_0x3ea4ce-0x0;var _0x36cf6e=_0x2093[_0x3ea4ce];return _0x36cf6e;};'use strict';var _=require(_0x3209('0x0'));var util=require(_0x3209('0x1'));var moment=require(_0x3209('0x2'));var BPromise=require(_0x3209('0x3'));var rs=require(_0x3209('0x4'));var fs=require('fs');var Redis=require(_0x3209('0x5'));var db=require(_0x3209('0x6'))['db'];var utils=require(_0x3209('0x7'));var logger=require(_0x3209('0x8'))(_0x3209('0x9'));var config=require(_0x3209('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3209('0xb')][_0x3209('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x527e46,_0x354598,_0x3f24b4){return new BPromise(function(_0x5d6f23,_0x4ddb08){return client[_0x3209('0xd')](_0x527e46,_0x3f24b4)[_0x3209('0xe')](function(_0x2519b7){logger[_0x3209('0xf')](_0x3209('0x10'),_0x354598,_0x3209('0x11'));logger[_0x3209('0x12')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x354598,_0x3209('0x11'),JSON[_0x3209('0x13')](_0x2519b7));if(_0x2519b7[_0x3209('0x14')]){if(_0x2519b7['error'][_0x3209('0x15')]===0x1f4){logger['error'](_0x3209('0x10'),_0x354598,_0x2519b7['error']['message']);return _0x4ddb08(_0x2519b7['error'][_0x3209('0x16')]);}logger[_0x3209('0x14')](_0x3209('0x10'),_0x354598,_0x2519b7[_0x3209('0x14')]['message']);return _0x5d6f23(_0x2519b7[_0x3209('0x14')][_0x3209('0x16')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x354598,_0x3209('0x11'));_0x5d6f23(_0x2519b7[_0x3209('0x17')][_0x3209('0x16')]);}})[_0x3209('0x18')](function(_0xbb95d){logger[_0x3209('0x14')](_0x3209('0x10'),_0x354598,_0xbb95d);_0x4ddb08(_0xbb95d);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index ddb9f65..9ebb71a 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 _0x962e=['show','create','put','update','destroy','exports','path','express','get','/:id','isAuthenticated'];(function(_0x482179,_0x4cf10b){var _0x4bee57=function(_0x345236){while(--_0x345236){_0x482179['push'](_0x482179['shift']());}};_0x4bee57(++_0x4cf10b);}(_0x962e,0x187));var _0xe962=function(_0xafe951,_0x366ebd){_0xafe951=_0xafe951-0x0;var _0x3f287b=_0x962e[_0xafe951];return _0x3f287b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe962('0x0'));var timeout=require('connect-timeout');var express=require(_0xe962('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0xe962('0x2')](_0xe962('0x3'),auth[_0xe962('0x4')](),controller[_0xe962('0x5')]);router['post']('/',auth[_0xe962('0x4')](),controller[_0xe962('0x6')]);router[_0xe962('0x7')](_0xe962('0x3'),auth['isAuthenticated'](),controller[_0xe962('0x8')]);router['delete']('/:id',auth[_0xe962('0x4')](),controller[_0xe962('0x9')]);module[_0xe962('0xa')]=router; \ No newline at end of file +var _0x1335=['/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x531ea2,_0x103ccf){var _0x3a8118=function(_0x4f4640){while(--_0x4f4640){_0x531ea2['push'](_0x531ea2['shift']());}};_0x3a8118(++_0x103ccf);}(_0x1335,0x19c));var _0x5133=function(_0x294021,_0x48100e){_0x294021=_0x294021-0x0;var _0x5712fb=_0x1335[_0x294021];return _0x5712fb;};'use strict';var multer=require(_0x5133('0x0'));var util=require(_0x5133('0x1'));var path=require(_0x5133('0x2'));var timeout=require('connect-timeout');var express=require(_0x5133('0x3'));var router=express['Router']();var auth=require(_0x5133('0x4'));var interaction=require(_0x5133('0x5'));var config=require(_0x5133('0x6'));var controller=require(_0x5133('0x7'));router['get'](_0x5133('0x8'),auth[_0x5133('0x9')](),controller[_0x5133('0xa')]);router['post']('/',auth[_0x5133('0x9')](),controller['create']);router[_0x5133('0xb')](_0x5133('0x8'),auth[_0x5133('0x9')](),controller[_0x5133('0xc')]);router['delete'](_0x5133('0x8'),auth['isAuthenticated'](),controller[_0x5133('0xd')]);module[_0x5133('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 4960f65..a832158 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 _0x81e5=['beepall','roundrobin','exports','name','ENUM','rrmemory'];(function(_0x165cf8,_0x59f5e7){var _0x1155b2=function(_0x40b991){while(--_0x40b991){_0x165cf8['push'](_0x165cf8['shift']());}};_0x1155b2(++_0x59f5e7);}(_0x81e5,0xda));var _0x581e=function(_0xe00447,_0x508f7d){_0xe00447=_0xe00447-0x0;var _0x18663c=_0x81e5[_0xe00447];return _0x18663c;};'use strict';var Sequelize=require('sequelize');module[_0x581e('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x581e('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x581e('0x2')](_0x581e('0x3'),_0x581e('0x4'),_0x581e('0x5'))}}; \ No newline at end of file +var _0x6d87=['exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x10e544,_0x3826ad){var _0x35206c=function(_0x1eeb8e){while(--_0x1eeb8e){_0x10e544['push'](_0x10e544['shift']());}};_0x35206c(++_0x3826ad);}(_0x6d87,0xc5));var _0x76d8=function(_0x4ed711,_0x3670bc){_0x4ed711=_0x4ed711-0x0;var _0x42da0b=_0x6d87[_0x4ed711];return _0x42da0b;};'use strict';var Sequelize=require(_0x76d8('0x0'));module[_0x76d8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x76d8('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x76d8('0x3')]},'timeout':{'type':Sequelize[_0x76d8('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x76d8('0x5')](_0x76d8('0x6'),_0x76d8('0x7'),_0x76d8('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 8e0f451..adb8949 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 _0x04cc=['../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','reject','save','update','destroy','ChatQueues','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','where','merge','filter','include','findAll','rows','params','includeAll','options','find','create','body','user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','pick','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','transaction','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','sequelize','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x545da7,_0x40587d){var _0x32e15e=function(_0x3bacd8){while(--_0x3bacd8){_0x545da7['push'](_0x545da7['shift']());}};_0x32e15e(++_0x40587d);}(_0x04cc,0x11a));var _0xc04c=function(_0x4b5813,_0x5769de){_0x4b5813=_0x4b5813-0x0;var _0x423465=_0x04cc[_0x4b5813];return _0x423465;};'use strict';var pdf=require(_0xc04c('0x0'));var emlformat=require(_0xc04c('0x1'));var rimraf=require(_0xc04c('0x2'));var zipdir=require(_0xc04c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc04c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc04c('0x5'));var util=require(_0xc04c('0x6'));var path=require(_0xc04c('0x7'));var sox=require(_0xc04c('0x8'));var csv=require(_0xc04c('0x9'));var ejs=require(_0xc04c('0xa'));var fs=require('fs');var _=require(_0xc04c('0xb'));var squel=require('squel');var crypto=require(_0xc04c('0xc'));var jsforce=require(_0xc04c('0xd'));var deskjs=require(_0xc04c('0xe'));var toCsv=require(_0xc04c('0x9'));var querystring=require(_0xc04c('0xf'));var Papa=require(_0xc04c('0x10'));var Redis=require(_0xc04c('0x11'));var authService=require(_0xc04c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc04c('0x13'));var logger=require(_0xc04c('0x14'))(_0xc04c('0x15'));var utils=require(_0xc04c('0x16'));var config=require(_0xc04c('0x17'));var db=require(_0xc04c('0x18'))['db'];config[_0xc04c('0x19')]=_['defaults'](config['redis'],{'host':_0xc04c('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc04c('0x19')]));require(_0xc04c('0x1b'))[_0xc04c('0x1c')](socket);var jayson=require(_0xc04c('0x1d'));var client=jayson['client'][_0xc04c('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x43e70b,_0x1df6d9,_0x247582){if(_0x247582){var _0x4c1154=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4c1154['test'](_0x1df6d9)){return _0x43e70b;}else{throw new db['Sequelize'][(_0xc04c('0x1f'))](_0xc04c('0x20'));}}else{return _0x43e70b;}}function respondWithRpcPromise(_0x5b58b5,_0x82afdd,_0x501949,_0x170f47){return new BPromise(function(_0x3e4165,_0x59d405){var _0xd3f899=_0x170f47||client;return _0xd3f899[_0xc04c('0x21')](_0x5b58b5,_0x501949)[_0xc04c('0x22')](function(_0x1ad3e6){logger[_0xc04c('0x23')](_0xc04c('0x24'),_0x82afdd,_0xc04c('0x25'));logger[_0xc04c('0x26')](_0xc04c('0x27'),_0x82afdd,_0xc04c('0x25'),JSON[_0xc04c('0x28')](_0x1ad3e6));if(_0x1ad3e6['error']){if(_0x1ad3e6[_0xc04c('0x29')][_0xc04c('0x2a')]===0x1f4){logger[_0xc04c('0x29')](_0xc04c('0x24'),_0x82afdd,_0x1ad3e6[_0xc04c('0x29')][_0xc04c('0x2b')]);return _0x59d405(_0x1ad3e6[_0xc04c('0x29')][_0xc04c('0x2b')]);}logger[_0xc04c('0x29')](_0xc04c('0x24'),_0x82afdd,_0x1ad3e6['error'][_0xc04c('0x2b')]);return _0x3e4165(_0x1ad3e6['error'][_0xc04c('0x2b')]);}else{logger[_0xc04c('0x23')](_0xc04c('0x24'),_0x82afdd,_0xc04c('0x25'));_0x3e4165(_0x1ad3e6[_0xc04c('0x2c')]['message']);}})[_0xc04c('0x2d')](function(_0x158f28){logger[_0xc04c('0x29')](_0xc04c('0x24'),_0x82afdd,_0x158f28);_0x59d405(_0x158f28);});});}function respondWithStatusCode(_0x66f858,_0x4e6e43){_0x4e6e43=_0x4e6e43||0xcc;return function(_0xb0c1b9){if(_0xb0c1b9){return _0x66f858[_0xc04c('0x2e')](_0x4e6e43);}return _0x66f858[_0xc04c('0x2f')](_0x4e6e43)['end']();};}function respondWithResult(_0x1c3f29,_0x5f0706){_0x5f0706=_0x5f0706||0xc8;return function(_0x4082da){if(_0x4082da){return _0x1c3f29[_0xc04c('0x2f')](_0x5f0706)[_0xc04c('0x30')](_0x4082da);}};}function respondWithFilteredResult(_0x596b9b,_0x153001){return function(_0x56cd49){if(_0x56cd49){var _0x2048d5=_0x56cd49[_0xc04c('0x31')],_0xc356a2=_0x153001['offset'],_0x8830e8=_0x153001[_0xc04c('0x32')]+_0x153001['limit'],_0x348525;if(_0x8830e8>=_0x2048d5){_0x8830e8=_0x2048d5;_0x348525=0xc8;}else{_0x348525=0xce;}_0x596b9b[_0xc04c('0x2f')](_0x348525);return _0x596b9b['set']('Content-Range',_0xc356a2+'-'+_0x8830e8+'/'+_0x2048d5)['json'](_0x56cd49);}return null;};}function patchUpdates(_0x3647ae){return function(_0x2b4b82){try{jsonpatch['apply'](_0x2b4b82,_0x3647ae,!![]);}catch(_0x5228d5){return BPromise[_0xc04c('0x33')](_0x5228d5);}return _0x2b4b82[_0xc04c('0x34')]();};}function saveUpdates(_0x2387e6,_0x3ba0af){return function(_0x51113e){if(_0x51113e){return _0x51113e[_0xc04c('0x35')](_0x2387e6)[_0xc04c('0x22')](function(_0x1b06ff){return _0x1b06ff;});}return null;};}function removeEntity(_0x452a0b,_0x2a2460){return function(_0x8cb920){if(_0x8cb920){return _0x8cb920[_0xc04c('0x36')]()[_0xc04c('0x22')](function(){var _0xf2419b=_0x8cb920['get']({'plain':!![]});var _0x326330=_0xc04c('0x37');return db[_0xc04c('0x38')][_0xc04c('0x36')]({'where':{'type':_0x326330,'resourceId':_0xf2419b['id']}})[_0xc04c('0x22')](function(){return _0x8cb920;});})[_0xc04c('0x22')](function(){_0x452a0b['status'](0xcc)[_0xc04c('0x39')]();});}};}function handleEntityNotFound(_0x53a828,_0x4e7109){return function(_0x5e5b49){if(!_0x5e5b49){_0x53a828[_0xc04c('0x2e')](0x194);}return _0x5e5b49;};}function handleError(_0x203add,_0x38af5b){_0x38af5b=_0x38af5b||0x1f4;return function(_0x2f7a66){logger[_0xc04c('0x29')](_0x2f7a66[_0xc04c('0x3a')]);if(_0x2f7a66[_0xc04c('0x3b')]){delete _0x2f7a66[_0xc04c('0x3b')];}_0x203add['status'](_0x38af5b)[_0xc04c('0x3c')](_0x2f7a66);};}exports[_0xc04c('0x3d')]=function(_0x5e0b69,_0x36f3ae){var _0x2ff7b4={},_0x3ca0d2={},_0x6f597a={'count':0x0,'rows':[]};var _0x1239f0=_[_0xc04c('0x3e')](db[_0xc04c('0x3f')][_0xc04c('0x40')],function(_0x4e8bdb){return{'name':_0x4e8bdb[_0xc04c('0x41')],'type':_0x4e8bdb['type'][_0xc04c('0x42')]};});_0x3ca0d2[_0xc04c('0x43')]=_[_0xc04c('0x3e')](_0x1239f0,_0xc04c('0x3b'));_0x3ca0d2[_0xc04c('0x44')]=_[_0xc04c('0x45')](_0x5e0b69[_0xc04c('0x44')]);_0x3ca0d2['filters']=_[_0xc04c('0x46')](_0x3ca0d2[_0xc04c('0x43')],_0x3ca0d2[_0xc04c('0x44')]);_0x2ff7b4[_0xc04c('0x47')]=_[_0xc04c('0x46')](_0x3ca0d2[_0xc04c('0x43')],qs[_0xc04c('0x48')](_0x5e0b69[_0xc04c('0x44')][_0xc04c('0x48')]));_0x2ff7b4['attributes']=_0x2ff7b4[_0xc04c('0x47')][_0xc04c('0x49')]?_0x2ff7b4['attributes']:_0x3ca0d2[_0xc04c('0x43')];if(!_0x5e0b69[_0xc04c('0x44')][_0xc04c('0x4a')](_0xc04c('0x4b'))){_0x2ff7b4[_0xc04c('0x4c')]=qs[_0xc04c('0x4c')](_0x5e0b69[_0xc04c('0x44')]['limit']);_0x2ff7b4[_0xc04c('0x32')]=qs[_0xc04c('0x32')](_0x5e0b69['query'][_0xc04c('0x32')]);}_0x2ff7b4[_0xc04c('0x4d')]=qs[_0xc04c('0x4e')](_0x5e0b69[_0xc04c('0x44')]['sort']);_0x2ff7b4['where']=qs['filters'](_['pick'](_0x5e0b69['query'],_0x3ca0d2[_0xc04c('0x4f')]));if(_0x5e0b69[_0xc04c('0x44')]['filter']){_0x2ff7b4[_0xc04c('0x50')]=_[_0xc04c('0x51')](_0x2ff7b4[_0xc04c('0x50')],{'$or':_[_0xc04c('0x3e')](_0x1239f0,function(_0x3c028b){if(_0x3c028b['type']!=='VIRTUAL'){var _0x2fd5e5={};_0x2fd5e5[_0x3c028b[_0xc04c('0x3b')]]={'$like':'%'+_0x5e0b69[_0xc04c('0x44')][_0xc04c('0x52')]+'%'};return _0x2fd5e5;}})});}_0x2ff7b4=_[_0xc04c('0x51')]({},_0x2ff7b4,_0x5e0b69['options']);var _0x43661b={'where':_0x2ff7b4[_0xc04c('0x50')]};return db[_0xc04c('0x3f')][_0xc04c('0x31')](_0x43661b)[_0xc04c('0x22')](function(_0x5f4da0){_0x6f597a[_0xc04c('0x31')]=_0x5f4da0;if(_0x5e0b69['query']['includeAll']){_0x2ff7b4[_0xc04c('0x53')]=[{'all':!![]}];}return db['ChatQueue'][_0xc04c('0x54')](_0x2ff7b4);})['then'](function(_0x17cd21){_0x6f597a[_0xc04c('0x55')]=_0x17cd21;return _0x6f597a;})['then'](respondWithFilteredResult(_0x36f3ae,_0x2ff7b4))[_0xc04c('0x2d')](handleError(_0x36f3ae,null));};exports['show']=function(_0x3bb3e2,_0x1119b9){var _0x45e847={'raw':!![],'where':{'id':_0x3bb3e2[_0xc04c('0x56')]['id']}},_0x2cc72d={};_0x2cc72d[_0xc04c('0x43')]=_[_0xc04c('0x45')](db['ChatQueue'][_0xc04c('0x40')]);_0x2cc72d[_0xc04c('0x44')]=_[_0xc04c('0x45')](_0x3bb3e2[_0xc04c('0x44')]);_0x2cc72d[_0xc04c('0x4f')]=_[_0xc04c('0x46')](_0x2cc72d[_0xc04c('0x43')],_0x2cc72d[_0xc04c('0x44')]);_0x45e847[_0xc04c('0x47')]=_['intersection'](_0x2cc72d['model'],qs[_0xc04c('0x48')](_0x3bb3e2[_0xc04c('0x44')][_0xc04c('0x48')]));_0x45e847['attributes']=_0x45e847[_0xc04c('0x47')][_0xc04c('0x49')]?_0x45e847[_0xc04c('0x47')]:_0x2cc72d[_0xc04c('0x43')];if(_0x3bb3e2[_0xc04c('0x44')][_0xc04c('0x57')]){_0x45e847['include']=[{'all':!![]}];}_0x45e847=_[_0xc04c('0x51')]({},_0x45e847,_0x3bb3e2[_0xc04c('0x58')]);return db[_0xc04c('0x3f')][_0xc04c('0x59')](_0x45e847)[_0xc04c('0x22')](handleEntityNotFound(_0x1119b9,null))['then'](respondWithResult(_0x1119b9,null))['catch'](handleError(_0x1119b9,null));};exports[_0xc04c('0x5a')]=function(_0x433993,_0xb636e5){return db['ChatQueue'][_0xc04c('0x5a')](_0x433993[_0xc04c('0x5b')],{})[_0xc04c('0x22')](function(_0x4daffb){var _0x4f4f35=_0x433993[_0xc04c('0x5c')][_0xc04c('0x5d')]({'plain':!![]});if(!_0x4f4f35)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f4f35['role']===_0xc04c('0x5c')){var _0x2f050c=_0x4daffb[_0xc04c('0x5d')]({'plain':!![]});var _0xf123ca=_0xc04c('0x37');return db['UserProfileSection']['find']({'where':{'name':_0xf123ca,'userProfileId':_0x4f4f35[_0xc04c('0x5e')]},'raw':!![]})[_0xc04c('0x22')](function(_0xd93548){if(_0xd93548&&_0xd93548[_0xc04c('0x5f')]===0x0){return db[_0xc04c('0x38')][_0xc04c('0x5a')]({'name':_0x2f050c[_0xc04c('0x3b')],'resourceId':_0x2f050c['id'],'type':_0xd93548['name'],'sectionId':_0xd93548['id']},{})[_0xc04c('0x22')](function(){return _0x4daffb;});}else{return _0x4daffb;}})[_0xc04c('0x2d')](function(_0x51f3ba){logger[_0xc04c('0x29')](_0xc04c('0x60'),_0x51f3ba);throw _0x51f3ba;});}return _0x4daffb;})[_0xc04c('0x22')](respondWithResult(_0xb636e5,0xc9))[_0xc04c('0x2d')](handleError(_0xb636e5,null));};exports[_0xc04c('0x35')]=function(_0x26eabd,_0x426854){if(_0x26eabd[_0xc04c('0x5b')]['id']){delete _0x26eabd[_0xc04c('0x5b')]['id'];}return db[_0xc04c('0x3f')][_0xc04c('0x59')]({'where':{'id':_0x26eabd['params']['id']}})[_0xc04c('0x22')](handleEntityNotFound(_0x426854,null))[_0xc04c('0x22')](saveUpdates(_0x26eabd[_0xc04c('0x5b')],null))[_0xc04c('0x22')](respondWithResult(_0x426854,null))[_0xc04c('0x2d')](handleError(_0x426854,null));};exports[_0xc04c('0x36')]=function(_0x24f94a,_0x1d9ae2){return db['ChatQueue'][_0xc04c('0x59')]({'where':{'id':_0x24f94a[_0xc04c('0x56')]['id']}})['then'](handleEntityNotFound(_0x1d9ae2,null))[_0xc04c('0x22')](removeEntity(_0x1d9ae2,null))['catch'](handleError(_0x1d9ae2,null));};exports[_0xc04c('0x61')]=function(_0x39e3af,_0x4edf15){return db[_0xc04c('0x3f')][_0xc04c('0x61')]()['then'](respondWithResult(_0x4edf15,null))['catch'](handleError(_0x4edf15,null));};exports[_0xc04c('0x62')]=function(_0x574457,_0x5900dd,_0x14e82b){var _0x581d54={'raw':!![],'where':{}},_0x101efb={},_0x5a2aba;return db[_0xc04c('0x3f')][_0xc04c('0x63')]({'where':{'id':_0x574457['params']['id']}})[_0xc04c('0x22')](handleEntityNotFound(_0x5900dd,null))[_0xc04c('0x22')](function(_0x534b32){if(_0x534b32){_0x5a2aba=_0x534b32[_0xc04c('0x5d')]({'plain':!![]});_0x101efb[_0xc04c('0x43')]=_[_0xc04c('0x45')](db[_0xc04c('0x64')][_0xc04c('0x40')]);_0x101efb[_0xc04c('0x44')]=_[_0xc04c('0x45')](_0x574457[_0xc04c('0x44')]);_0x101efb['filters']=_[_0xc04c('0x46')](_0x101efb[_0xc04c('0x43')],_0x101efb[_0xc04c('0x44')]);_0x581d54[_0xc04c('0x47')]=_[_0xc04c('0x46')](_0x101efb['model'],qs[_0xc04c('0x48')](_0x574457['query'][_0xc04c('0x48')]));_0x581d54[_0xc04c('0x47')]=_0x581d54[_0xc04c('0x47')]['length']?_0x581d54[_0xc04c('0x47')]:_0x101efb[_0xc04c('0x43')];if(!_0x574457['query'][_0xc04c('0x4a')](_0xc04c('0x4b'))){_0x581d54[_0xc04c('0x4c')]=qs[_0xc04c('0x4c')](_0x574457[_0xc04c('0x44')][_0xc04c('0x4c')]);_0x581d54[_0xc04c('0x32')]=qs[_0xc04c('0x32')](_0x574457[_0xc04c('0x44')]['offset']);}_0x581d54['order']=qs[_0xc04c('0x4e')](_0x574457[_0xc04c('0x44')][_0xc04c('0x4e')]);_0x581d54[_0xc04c('0x50')]=qs['filters'](_[_0xc04c('0x65')](_0x574457['query'],_0x101efb[_0xc04c('0x4f')]));_0x581d54['where'][_0xc04c('0x66')]=_0x534b32['id'];if(_0x574457[_0xc04c('0x44')][_0xc04c('0x52')]){_0x581d54[_0xc04c('0x50')]=_[_0xc04c('0x51')](_0x581d54[_0xc04c('0x50')],{'$or':_['map'](_0x581d54['attributes'],function(_0x5d3864){var _0x10ec1a={};_0x10ec1a[_0x5d3864]={'$like':'%'+_0x574457[_0xc04c('0x44')]['filter']+'%'};return _0x10ec1a;})});}_0x581d54=_[_0xc04c('0x51')]({},_0x581d54,_0x574457[_0xc04c('0x58')]);return db[_0xc04c('0x64')][_0xc04c('0x54')](_0x581d54);}})[_0xc04c('0x22')](function(_0x4e5700){if(_0x4e5700){return db[_0xc04c('0x67')]['findAndCountAll']({'where':{'id':_[_0xc04c('0x3e')](_0x4e5700,_0xc04c('0x68')),'role':_0xc04c('0x69')},'attributes':['id',_0xc04c('0x3b'),_0xc04c('0x6a'),_0xc04c('0x6b'),_0xc04c('0x6c')]});}})['then'](function(_0x233b03){if(_0x233b03){return{'count':_0x233b03['count'],'rows':_[_0xc04c('0x3e')](_0x233b03[_0xc04c('0x55')],function(_0x4e6792){return{'membername':_0x4e6792['name'],'UserId':_0x4e6792['id'],'queue_name':_0x5a2aba[_0xc04c('0x3b')],'ChatQueueId':_0x5a2aba['id'],'interface':util[_0xc04c('0x6d')](_0xc04c('0x6e'),_0xc04c('0x6f'),_0x4e6792[_0xc04c('0x3b')]),'penalty':0x0,'paused':_0x4e6792[_0xc04c('0x6a')],'createdAt':_0x4e6792['createdAt'],'updatedAt':_0x4e6792['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc04c('0x22')](respondWithFilteredResult(_0x5900dd,_0x581d54))['catch'](handleError(_0x5900dd,null));};exports[_0xc04c('0x70')]=function(_0x40b241,_0x528fc2,_0x314d21){var _0x4d13d3={};var _0x447f93={};var _0x353303;var _0x27fd7d;return db[_0xc04c('0x3f')][_0xc04c('0x63')]({'where':{'id':_0x40b241['params']['id']}})[_0xc04c('0x22')](handleEntityNotFound(_0x528fc2,null))[_0xc04c('0x22')](function(_0x226b34){if(_0x226b34){_0x353303=_0x226b34;_0x447f93[_0xc04c('0x43')]=_[_0xc04c('0x45')](db[_0xc04c('0x71')][_0xc04c('0x40')]);_0x447f93[_0xc04c('0x44')]=_[_0xc04c('0x45')](_0x40b241[_0xc04c('0x44')]);_0x447f93[_0xc04c('0x4f')]=_['intersection'](_0x447f93['model'],_0x447f93['query']);_0x4d13d3[_0xc04c('0x47')]=_[_0xc04c('0x46')](_0x447f93[_0xc04c('0x43')],qs[_0xc04c('0x48')](_0x40b241[_0xc04c('0x44')][_0xc04c('0x48')]));_0x4d13d3[_0xc04c('0x47')]=_0x4d13d3[_0xc04c('0x47')]['length']?_0x4d13d3[_0xc04c('0x47')]:_0x447f93[_0xc04c('0x43')];_0x4d13d3[_0xc04c('0x4d')]=qs[_0xc04c('0x4e')](_0x40b241[_0xc04c('0x44')][_0xc04c('0x4e')]);_0x4d13d3[_0xc04c('0x50')]=qs[_0xc04c('0x4f')](_[_0xc04c('0x65')](_0x40b241[_0xc04c('0x44')],_0x447f93[_0xc04c('0x4f')]));if(_0x40b241[_0xc04c('0x44')][_0xc04c('0x52')]){_0x4d13d3[_0xc04c('0x50')]=_[_0xc04c('0x51')](_0x4d13d3[_0xc04c('0x50')],{'$or':_['map'](_0x4d13d3[_0xc04c('0x47')],function(_0x1734d9){var _0x598989={};_0x598989[_0x1734d9]={'$like':'%'+_0x40b241['query'][_0xc04c('0x52')]+'%'};return _0x598989;})});}_0x4d13d3=_[_0xc04c('0x51')]({},_0x4d13d3,_0x40b241[_0xc04c('0x58')]);return _0x353303[_0xc04c('0x70')](_0x4d13d3);}})['then'](function(_0x19c217){if(_0x19c217){_0x27fd7d=_0x19c217[_0xc04c('0x49')];if(!_0x40b241[_0xc04c('0x44')][_0xc04c('0x4a')]('nolimit')){_0x4d13d3[_0xc04c('0x4c')]=qs[_0xc04c('0x4c')](_0x40b241['query'][_0xc04c('0x4c')]);_0x4d13d3['offset']=qs[_0xc04c('0x32')](_0x40b241[_0xc04c('0x44')][_0xc04c('0x32')]);}return _0x353303[_0xc04c('0x70')](_0x4d13d3);}})[_0xc04c('0x22')](function(_0x45c66e){if(_0x45c66e){return _0x45c66e?{'count':_0x27fd7d,'rows':_0x45c66e}:null;}})[_0xc04c('0x22')](respondWithResult(_0x528fc2,null))[_0xc04c('0x2d')](handleError(_0x528fc2,null));};exports[_0xc04c('0x72')]=function(_0x42f03f,_0x32214d,_0x375918){var _0x358073=_0x42f03f[_0xc04c('0x5b')][_0xc04c('0x73')];return db[_0xc04c('0x71')][_0xc04c('0x54')]({'where':{'id':_0x358073},'attributes':['id'],'include':[{'model':db[_0xc04c('0x67')],'as':_0xc04c('0x74'),'attributes':['id',_0xc04c('0x3b'),_0xc04c('0x75'),'voicePause',_0xc04c('0x76')],'raw':!![]}]})[_0xc04c('0x22')](function(_0x553df6){if(_0x553df6){var _0x3e3994=_[_0xc04c('0x77')](_0x553df6,function(_0x46a6c6){var _0x37696d=_0x46a6c6[_0xc04c('0x5d')]({'plain':!![]});return _0x37696d['Agents'];});return db[_0xc04c('0x3f')]['find']({'where':{'id':_0x42f03f['params']['id']}})[_0xc04c('0x22')](function(_0x38de96){return db['sequelize'][_0xc04c('0x78')](function(_0x531065){return _0x38de96['addTeams'](_0x358073,{'transaction':_0x531065})[_0xc04c('0x22')](function(){return BPromise['each'](_0x3e3994,function(_0x2d2ff1){return db[_0xc04c('0x64')][_0xc04c('0x79')]({'where':{'UserId':_0x2d2ff1['id'],'ChatQueueId':_0x42f03f[_0xc04c('0x56')]['id']},'transaction':_0x531065});});})['then'](function(){_0x3e3994[_0xc04c('0x7a')](function(_0x5d7220){socket[_0xc04c('0x7b')]('userChatQueue:save',{'UserId':_0x5d7220['id'],'ChatQueueId':_0x38de96['id']});});});});});}})[_0xc04c('0x22')](respondWithStatusCode(_0x32214d,null))[_0xc04c('0x2d')](handleError(_0x32214d,null));};exports[_0xc04c('0x7c')]=function(_0x467c12,_0x47e54a,_0x1793d4){return db[_0xc04c('0x71')][_0xc04c('0x54')]({'where':{'id':_0x467c12[_0xc04c('0x44')][_0xc04c('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc04c('0x74'),'attributes':['id'],'raw':!![]}]})[_0xc04c('0x22')](handleEntityNotFound(_0x47e54a,null))[_0xc04c('0x22')](function(_0x3a10d1){var _0x1ab0c0=_['map'](_0x3a10d1,'id');var _0x22e19f=[];var _0xa3b5f9=[];var _0x2ec8ac=squel[_0xc04c('0x7d')]();_0x2ec8ac['field'](_0xc04c('0x7e'))[_0xc04c('0x7f')](_0xc04c('0x80'),'tq')[_0xc04c('0x81')](_0xc04c('0x82'),'ut',_0xc04c('0x83'))[_0xc04c('0x50')](_0xc04c('0x84'),_0x467c12[_0xc04c('0x56')]['id']);for(var _0x1336b1=0x0;_0x1336b1<_0x3a10d1[_0xc04c('0x49')];_0x1336b1+=0x1){let _0x416048=_0x3a10d1[_0x1336b1];for(var _0x2edf48=0x0;_0x2edf48<_0x416048[_0xc04c('0x74')][_0xc04c('0x49')];_0x2edf48+=0x1){let _0x3484c6=_0x416048[_0xc04c('0x74')][_0x2edf48];var _0x5b3f95=_0x2ec8ac['clone']();_0x5b3f95[_0xc04c('0x50')](_0xc04c('0x85'),_0x3484c6['id']);_0xa3b5f9['push'](db['sequelize']['query'](_0x5b3f95[_0xc04c('0x86')](),{'type':db['sequelize'][_0xc04c('0x87')]['SELECT']})[_0xc04c('0x22')](function(_0x464a1f){if(_0x464a1f[_0xc04c('0x49')]===0x1){return _0x3484c6['id'];}else{var _0x5e238d=_[_0xc04c('0x88')](_[_0xc04c('0x3e')](_0x464a1f,_0xc04c('0x89')),function(_0x54d86b){return _[_0xc04c('0x8a')](_0x1ab0c0,_0x54d86b);});if(_0x5e238d){return _0x3484c6['id'];}}}));}}return BPromise[_0xc04c('0x8b')](_0xa3b5f9)['then'](function(_0xb8c5ef){_0x22e19f=_(_0x22e19f)[_0xc04c('0x8c')](_0xb8c5ef)[_0xc04c('0x8d')]()[_0xc04c('0x8e')]();return db[_0xc04c('0x3f')][_0xc04c('0x59')]({'where':{'id':_0x467c12[_0xc04c('0x56')]['id']}})[_0xc04c('0x22')](function(_0xfa8c2c){return db[_0xc04c('0x8f')]['transaction'](function(_0x565fec){return _0xfa8c2c['removeTeams'](_0x467c12['query']['ids'],{'transaction':_0x565fec})[_0xc04c('0x22')](function(){if(!_[_0xc04c('0x90')](_0x22e19f)){return _0xfa8c2c[_0xc04c('0x91')](_0x22e19f,{'transaction':_0x565fec});}})[_0xc04c('0x22')](function(){_0x22e19f[_0xc04c('0x7a')](function(_0x32528a){socket[_0xc04c('0x7b')](_0xc04c('0x92'),{'UserId':_0x32528a,'ChatQueueId':_0xfa8c2c['id']});});});});});});})[_0xc04c('0x22')](respondWithStatusCode(_0x47e54a,null))[_0xc04c('0x2d')](handleError(_0x47e54a,null));};exports['addAgents']=function(_0x3ca666,_0x78e88e,_0x126418){return db[_0xc04c('0x3f')][_0xc04c('0x59')]({'where':{'id':_0x3ca666[_0xc04c('0x56')]['id']}})[_0xc04c('0x22')](handleEntityNotFound(_0x78e88e,null))[_0xc04c('0x22')](function(_0x341a6d){if(_0x341a6d){return _0x341a6d[_0xc04c('0x93')](_0x3ca666[_0xc04c('0x5b')][_0xc04c('0x73')],_[_0xc04c('0x94')](_0x3ca666[_0xc04c('0x5b')],[_0xc04c('0x73'),'id'])||{})[_0xc04c('0x95')](function(_0x1a3cdb){for(var _0x3e34f3=0x0;_0x3e34f3<_0x3ca666[_0xc04c('0x5b')][_0xc04c('0x73')][_0xc04c('0x49')];_0x3e34f3+=0x1){socket[_0xc04c('0x7b')](_0xc04c('0x96'),{'UserId':_0x3ca666[_0xc04c('0x5b')][_0xc04c('0x73')][_0x3e34f3],'ChatQueueId':_0x3ca666[_0xc04c('0x56')]['id']});}return _0x1a3cdb;});}})[_0xc04c('0x22')](respondWithResult(_0x78e88e,null))[_0xc04c('0x2d')](handleError(_0x78e88e,null));};exports[_0xc04c('0x91')]=function(_0x553972,_0x18b602,_0x36e981){return db[_0xc04c('0x3f')][_0xc04c('0x59')]({'where':{'id':_0x553972[_0xc04c('0x56')]['id']}})[_0xc04c('0x22')](handleEntityNotFound(_0x18b602,null))[_0xc04c('0x22')](function(_0x576ad2){if(_0x576ad2){return _0x576ad2[_0xc04c('0x91')](_0x553972[_0xc04c('0x44')]['ids'])[_0xc04c('0x22')](function(){if(_[_0xc04c('0x97')](_0x553972[_0xc04c('0x44')]['ids'])){for(var _0x1cb5a7=0x0;_0x1cb5a7<_0x553972[_0xc04c('0x44')][_0xc04c('0x73')][_0xc04c('0x49')];_0x1cb5a7+=0x1){socket[_0xc04c('0x7b')](_0xc04c('0x92'),{'UserId':Number(_0x553972[_0xc04c('0x44')][_0xc04c('0x73')][_0x1cb5a7]),'ChatQueueId':Number(_0x553972[_0xc04c('0x56')]['id'])});}}else{socket[_0xc04c('0x7b')](_0xc04c('0x92'),{'UserId':Number(_0x553972[_0xc04c('0x44')][_0xc04c('0x73')]),'ChatQueueId':Number(_0x553972[_0xc04c('0x56')]['id'])});}});}})[_0xc04c('0x22')](respondWithStatusCode(_0x18b602,null))[_0xc04c('0x2d')](handleError(_0x18b602,null));};exports[_0xc04c('0x98')]=function(_0x547a00,_0x221f4c,_0x314c96){var _0x4cd626={};var _0x2d70f4={};var _0x167c16;var _0x229eff;return db[_0xc04c('0x3f')]['findOne']({'where':{'id':_0x547a00[_0xc04c('0x56')]['id']}})[_0xc04c('0x22')](handleEntityNotFound(_0x221f4c,null))['then'](function(_0xc9a5d5){if(_0xc9a5d5){_0x167c16=_0xc9a5d5;_0x2d70f4['model']=_[_0xc04c('0x45')](db[_0xc04c('0x67')][_0xc04c('0x40')]);_0x2d70f4[_0xc04c('0x44')]=_[_0xc04c('0x45')](_0x547a00[_0xc04c('0x44')]);_0x2d70f4[_0xc04c('0x4f')]=_[_0xc04c('0x46')](_0x2d70f4[_0xc04c('0x43')],_0x2d70f4['query']);_0x4cd626['attributes']=_[_0xc04c('0x46')](_0x2d70f4[_0xc04c('0x43')],qs[_0xc04c('0x48')](_0x547a00[_0xc04c('0x44')][_0xc04c('0x48')]));_0x4cd626[_0xc04c('0x47')]=_0x4cd626[_0xc04c('0x47')][_0xc04c('0x49')]?_0x4cd626[_0xc04c('0x47')]:_0x2d70f4['model'];_0x4cd626['order']=qs['sort'](_0x547a00[_0xc04c('0x44')][_0xc04c('0x4e')]);_0x4cd626[_0xc04c('0x50')]=qs[_0xc04c('0x4f')](_[_0xc04c('0x65')](_0x547a00['query'],_0x2d70f4[_0xc04c('0x4f')]));if(_0x547a00[_0xc04c('0x44')][_0xc04c('0x52')]){_0x4cd626[_0xc04c('0x50')]=_[_0xc04c('0x51')](_0x4cd626['where'],{'$or':_[_0xc04c('0x3e')](_0x4cd626[_0xc04c('0x47')],function(_0x43e975){var _0x35928c={};_0x35928c[_0x43e975]={'$like':'%'+_0x547a00[_0xc04c('0x44')][_0xc04c('0x52')]+'%'};return _0x35928c;})});}_0x4cd626=_[_0xc04c('0x51')]({},_0x4cd626,_0x547a00['options']);return _0x167c16[_0xc04c('0x98')](_0x4cd626);}})[_0xc04c('0x22')](function(_0x374f00){if(_0x374f00){_0x229eff=_0x374f00['length'];if(!_0x547a00[_0xc04c('0x44')][_0xc04c('0x4a')](_0xc04c('0x4b'))){_0x4cd626[_0xc04c('0x4c')]=qs['limit'](_0x547a00[_0xc04c('0x44')]['limit']);_0x4cd626[_0xc04c('0x32')]=qs[_0xc04c('0x32')](_0x547a00[_0xc04c('0x44')]['offset']);}return _0x167c16[_0xc04c('0x98')](_0x4cd626);}})[_0xc04c('0x22')](function(_0xed0ec){if(_0xed0ec){return _0xed0ec?{'count':_0x229eff,'rows':_0xed0ec}:null;}})[_0xc04c('0x22')](respondWithResult(_0x221f4c,null))[_0xc04c('0x2d')](handleError(_0x221f4c,null));}; \ No newline at end of file +var _0x3e94=['apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','length','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','addTeams','Team','Agents','online','voicePause','interface','flatMap','transaction','findOrCreate','emit','userChatQueue:save','removeTeams','ids','select','field','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','spread','isArray','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','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','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','end','status','json','offset','limit','set'];(function(_0xe44494,_0x3b38c9){var _0x3198e2=function(_0x523193){while(--_0x523193){_0xe44494['push'](_0xe44494['shift']());}};_0x3198e2(++_0x3b38c9);}(_0x3e94,0x67));var _0x43e9=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3e94[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require(_0x43e9('0x0'));var emlformat=require(_0x43e9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x43e9('0x2'));var jsonpatch=require(_0x43e9('0x3'));var rp=require(_0x43e9('0x4'));var moment=require('moment');var BPromise=require(_0x43e9('0x5'));var Mustache=require(_0x43e9('0x6'));var util=require(_0x43e9('0x7'));var path=require('path');var sox=require(_0x43e9('0x8'));var csv=require('to-csv');var ejs=require(_0x43e9('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e9('0xa'));var crypto=require(_0x43e9('0xb'));var jsforce=require(_0x43e9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x43e9('0xd'));var querystring=require(_0x43e9('0xe'));var Papa=require(_0x43e9('0xf'));var Redis=require(_0x43e9('0x10'));var authService=require(_0x43e9('0x11'));var qs=require(_0x43e9('0x12'));var as=require(_0x43e9('0x13'));var hardwareService=require(_0x43e9('0x14'));var logger=require(_0x43e9('0x15'))('api');var utils=require(_0x43e9('0x16'));var config=require(_0x43e9('0x17'));var db=require(_0x43e9('0x18'))['db'];config['redis']=_[_0x43e9('0x19')](config[_0x43e9('0x1a')],{'host':_0x43e9('0x1b'),'port':0x18eb});var socket=require(_0x43e9('0x1c'))(new Redis(config[_0x43e9('0x1a')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0x43e9('0x1d'));var client=jayson['client'][_0x43e9('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x471cb8,_0x210ab2,_0x274175){if(_0x274175){var _0x3017bf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3017bf[_0x43e9('0x1f')](_0x210ab2)){return _0x471cb8;}else{throw new db[(_0x43e9('0x20'))][(_0x43e9('0x21'))](_0x43e9('0x22'));}}else{return _0x471cb8;}}function respondWithRpcPromise(_0x13ceac,_0x2636df,_0x21ceda,_0x310476){return new BPromise(function(_0x31614e,_0x527d97){var _0x4e9fef=_0x310476||client;return _0x4e9fef[_0x43e9('0x23')](_0x13ceac,_0x21ceda)[_0x43e9('0x24')](function(_0x663c43){logger[_0x43e9('0x25')](_0x43e9('0x26'),_0x2636df,'request\x20sent');logger[_0x43e9('0x27')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2636df,_0x43e9('0x28'),JSON[_0x43e9('0x29')](_0x663c43));if(_0x663c43[_0x43e9('0x2a')]){if(_0x663c43[_0x43e9('0x2a')][_0x43e9('0x2b')]===0x1f4){logger['error'](_0x43e9('0x26'),_0x2636df,_0x663c43[_0x43e9('0x2a')]['message']);return _0x527d97(_0x663c43[_0x43e9('0x2a')][_0x43e9('0x2c')]);}logger[_0x43e9('0x2a')](_0x43e9('0x26'),_0x2636df,_0x663c43['error'][_0x43e9('0x2c')]);return _0x31614e(_0x663c43['error'][_0x43e9('0x2c')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2636df,'request\x20sent');_0x31614e(_0x663c43['result'][_0x43e9('0x2c')]);}})['catch'](function(_0x20a270){logger[_0x43e9('0x2a')](_0x43e9('0x26'),_0x2636df,_0x20a270);_0x527d97(_0x20a270);});});}function respondWithStatusCode(_0x55a298,_0x50cf61){_0x50cf61=_0x50cf61||0xcc;return function(_0xf64426){if(_0xf64426){return _0x55a298['sendStatus'](_0x50cf61);}return _0x55a298['status'](_0x50cf61)[_0x43e9('0x2d')]();};}function respondWithResult(_0x506ff4,_0x502f88){_0x502f88=_0x502f88||0xc8;return function(_0x51b356){if(_0x51b356){return _0x506ff4[_0x43e9('0x2e')](_0x502f88)[_0x43e9('0x2f')](_0x51b356);}};}function respondWithFilteredResult(_0x5c7b19,_0x373101){return function(_0x4bbf3a){if(_0x4bbf3a){var _0x4191ff=_0x4bbf3a['count'],_0x5777a8=_0x373101[_0x43e9('0x30')],_0x24dfff=_0x373101[_0x43e9('0x30')]+_0x373101[_0x43e9('0x31')],_0x580bd0;if(_0x24dfff>=_0x4191ff){_0x24dfff=_0x4191ff;_0x580bd0=0xc8;}else{_0x580bd0=0xce;}_0x5c7b19[_0x43e9('0x2e')](_0x580bd0);return _0x5c7b19[_0x43e9('0x32')]('Content-Range',_0x5777a8+'-'+_0x24dfff+'/'+_0x4191ff)[_0x43e9('0x2f')](_0x4bbf3a);}return null;};}function patchUpdates(_0x4bdded){return function(_0x5c99e8){try{jsonpatch[_0x43e9('0x33')](_0x5c99e8,_0x4bdded,!![]);}catch(_0x3f9a1b){return BPromise[_0x43e9('0x34')](_0x3f9a1b);}return _0x5c99e8[_0x43e9('0x35')]();};}function saveUpdates(_0x5e88bb,_0x2642a2){return function(_0x2efff5){if(_0x2efff5){return _0x2efff5[_0x43e9('0x36')](_0x5e88bb)[_0x43e9('0x24')](function(_0x55ea93){return _0x55ea93;});}return null;};}function removeEntity(_0x23cb79,_0x3cf4c8){return function(_0x31822e){if(_0x31822e){return _0x31822e[_0x43e9('0x37')]()[_0x43e9('0x24')](function(){var _0x3599e5=_0x31822e[_0x43e9('0x38')]({'plain':!![]});var _0x4b8152=_0x43e9('0x39');return db[_0x43e9('0x3a')][_0x43e9('0x37')]({'where':{'type':_0x4b8152,'resourceId':_0x3599e5['id']}})[_0x43e9('0x24')](function(){return _0x31822e;});})[_0x43e9('0x24')](function(){_0x23cb79['status'](0xcc)[_0x43e9('0x2d')]();});}};}function handleEntityNotFound(_0x238998,_0x3e3d0f){return function(_0x4f2308){if(!_0x4f2308){_0x238998[_0x43e9('0x3b')](0x194);}return _0x4f2308;};}function handleError(_0x760c9b,_0x1ba37f){_0x1ba37f=_0x1ba37f||0x1f4;return function(_0x2be16e){logger[_0x43e9('0x2a')](_0x2be16e['stack']);if(_0x2be16e[_0x43e9('0x3c')]){delete _0x2be16e[_0x43e9('0x3c')];}_0x760c9b[_0x43e9('0x2e')](_0x1ba37f)[_0x43e9('0x3d')](_0x2be16e);};}exports[_0x43e9('0x3e')]=function(_0x428763,_0xd5a134){var _0x330820={},_0x3ca9d6={},_0x36ac6d={'count':0x0,'rows':[]};var _0x1b5463=_[_0x43e9('0x3f')](db[_0x43e9('0x40')][_0x43e9('0x41')],function(_0x59f3c1){return{'name':_0x59f3c1[_0x43e9('0x42')],'type':_0x59f3c1[_0x43e9('0x43')][_0x43e9('0x44')]};});_0x3ca9d6['model']=_[_0x43e9('0x3f')](_0x1b5463,_0x43e9('0x3c'));_0x3ca9d6[_0x43e9('0x45')]=_[_0x43e9('0x46')](_0x428763[_0x43e9('0x45')]);_0x3ca9d6[_0x43e9('0x47')]=_['intersection'](_0x3ca9d6[_0x43e9('0x48')],_0x3ca9d6[_0x43e9('0x45')]);_0x330820[_0x43e9('0x49')]=_[_0x43e9('0x4a')](_0x3ca9d6[_0x43e9('0x48')],qs[_0x43e9('0x4b')](_0x428763[_0x43e9('0x45')][_0x43e9('0x4b')]));_0x330820[_0x43e9('0x49')]=_0x330820[_0x43e9('0x49')]['length']?_0x330820['attributes']:_0x3ca9d6[_0x43e9('0x48')];if(!_0x428763[_0x43e9('0x45')][_0x43e9('0x4c')](_0x43e9('0x4d'))){_0x330820[_0x43e9('0x31')]=qs[_0x43e9('0x31')](_0x428763[_0x43e9('0x45')]['limit']);_0x330820[_0x43e9('0x30')]=qs['offset'](_0x428763[_0x43e9('0x45')][_0x43e9('0x30')]);}_0x330820[_0x43e9('0x4e')]=qs[_0x43e9('0x4f')](_0x428763[_0x43e9('0x45')][_0x43e9('0x4f')]);_0x330820[_0x43e9('0x50')]=qs[_0x43e9('0x47')](_[_0x43e9('0x51')](_0x428763['query'],_0x3ca9d6[_0x43e9('0x47')]));if(_0x428763[_0x43e9('0x45')][_0x43e9('0x52')]){_0x330820[_0x43e9('0x50')]=_[_0x43e9('0x53')](_0x330820[_0x43e9('0x50')],{'$or':_['map'](_0x1b5463,function(_0x41257d){if(_0x41257d[_0x43e9('0x43')]!=='VIRTUAL'){var _0x3e132d={};_0x3e132d[_0x41257d[_0x43e9('0x3c')]]={'$like':'%'+_0x428763[_0x43e9('0x45')][_0x43e9('0x52')]+'%'};return _0x3e132d;}})});}_0x330820=_[_0x43e9('0x53')]({},_0x330820,_0x428763[_0x43e9('0x54')]);var _0x1fc17a={'where':_0x330820[_0x43e9('0x50')]};return db[_0x43e9('0x40')]['count'](_0x1fc17a)['then'](function(_0x1fe320){_0x36ac6d[_0x43e9('0x55')]=_0x1fe320;if(_0x428763[_0x43e9('0x45')]['includeAll']){_0x330820[_0x43e9('0x56')]=[{'all':!![]}];}return db[_0x43e9('0x40')][_0x43e9('0x57')](_0x330820);})['then'](function(_0x5d8c11){_0x36ac6d[_0x43e9('0x58')]=_0x5d8c11;return _0x36ac6d;})[_0x43e9('0x24')](respondWithFilteredResult(_0xd5a134,_0x330820))[_0x43e9('0x59')](handleError(_0xd5a134,null));};exports[_0x43e9('0x5a')]=function(_0x5126c9,_0x10b8cd){var _0x197d8d={'raw':!![],'where':{'id':_0x5126c9[_0x43e9('0x5b')]['id']}},_0x4a42f6={};_0x4a42f6[_0x43e9('0x48')]=_['keys'](db[_0x43e9('0x40')][_0x43e9('0x41')]);_0x4a42f6['query']=_[_0x43e9('0x46')](_0x5126c9[_0x43e9('0x45')]);_0x4a42f6[_0x43e9('0x47')]=_[_0x43e9('0x4a')](_0x4a42f6['model'],_0x4a42f6[_0x43e9('0x45')]);_0x197d8d[_0x43e9('0x49')]=_[_0x43e9('0x4a')](_0x4a42f6[_0x43e9('0x48')],qs['fields'](_0x5126c9['query'][_0x43e9('0x4b')]));_0x197d8d['attributes']=_0x197d8d[_0x43e9('0x49')]['length']?_0x197d8d[_0x43e9('0x49')]:_0x4a42f6[_0x43e9('0x48')];if(_0x5126c9['query'][_0x43e9('0x5c')]){_0x197d8d[_0x43e9('0x56')]=[{'all':!![]}];}_0x197d8d=_[_0x43e9('0x53')]({},_0x197d8d,_0x5126c9[_0x43e9('0x54')]);return db['ChatQueue'][_0x43e9('0x5d')](_0x197d8d)['then'](handleEntityNotFound(_0x10b8cd,null))[_0x43e9('0x24')](respondWithResult(_0x10b8cd,null))[_0x43e9('0x59')](handleError(_0x10b8cd,null));};exports[_0x43e9('0x5e')]=function(_0x4e161a,_0x4ec88a){return db['ChatQueue'][_0x43e9('0x5e')](_0x4e161a[_0x43e9('0x5f')],{})['then'](function(_0x59a787){var _0xed51e4=_0x4e161a[_0x43e9('0x60')][_0x43e9('0x38')]({'plain':!![]});if(!_0xed51e4)throw new Error(_0x43e9('0x61'));if(_0xed51e4[_0x43e9('0x62')]===_0x43e9('0x60')){var _0x445b85=_0x59a787[_0x43e9('0x38')]({'plain':!![]});var _0xffe161=_0x43e9('0x39');return db['UserProfileSection'][_0x43e9('0x5d')]({'where':{'name':_0xffe161,'userProfileId':_0xed51e4[_0x43e9('0x63')]},'raw':!![]})[_0x43e9('0x24')](function(_0x550988){if(_0x550988&&_0x550988[_0x43e9('0x64')]===0x0){return db['UserProfileResource'][_0x43e9('0x5e')]({'name':_0x445b85[_0x43e9('0x3c')],'resourceId':_0x445b85['id'],'type':_0x550988[_0x43e9('0x3c')],'sectionId':_0x550988['id']},{})[_0x43e9('0x24')](function(){return _0x59a787;});}else{return _0x59a787;}})['catch'](function(_0x1a022a){logger[_0x43e9('0x2a')](_0x43e9('0x65'),_0x1a022a);throw _0x1a022a;});}return _0x59a787;})[_0x43e9('0x24')](respondWithResult(_0x4ec88a,0xc9))[_0x43e9('0x59')](handleError(_0x4ec88a,null));};exports[_0x43e9('0x36')]=function(_0x5703a5,_0x30eec3){if(_0x5703a5[_0x43e9('0x5f')]['id']){delete _0x5703a5[_0x43e9('0x5f')]['id'];}return db[_0x43e9('0x40')][_0x43e9('0x5d')]({'where':{'id':_0x5703a5[_0x43e9('0x5b')]['id']}})[_0x43e9('0x24')](handleEntityNotFound(_0x30eec3,null))['then'](saveUpdates(_0x5703a5[_0x43e9('0x5f')],null))['then'](respondWithResult(_0x30eec3,null))[_0x43e9('0x59')](handleError(_0x30eec3,null));};exports[_0x43e9('0x37')]=function(_0x4aaaac,_0x1ba3c0){return db['ChatQueue'][_0x43e9('0x5d')]({'where':{'id':_0x4aaaac['params']['id']}})['then'](handleEntityNotFound(_0x1ba3c0,null))[_0x43e9('0x24')](removeEntity(_0x1ba3c0,null))['catch'](handleError(_0x1ba3c0,null));};exports[_0x43e9('0x66')]=function(_0x82a7d7,_0x3b5d5f){return db[_0x43e9('0x40')]['describe']()[_0x43e9('0x24')](respondWithResult(_0x3b5d5f,null))[_0x43e9('0x59')](handleError(_0x3b5d5f,null));};exports[_0x43e9('0x67')]=function(_0x4fb0c7,_0x3dc355,_0xa69760){var _0x4755d8={'raw':!![],'where':{}},_0x3ec521={},_0x2d3ee2;return db['ChatQueue']['findOne']({'where':{'id':_0x4fb0c7[_0x43e9('0x5b')]['id']}})[_0x43e9('0x24')](handleEntityNotFound(_0x3dc355,null))[_0x43e9('0x24')](function(_0x154592){if(_0x154592){_0x2d3ee2=_0x154592['get']({'plain':!![]});_0x3ec521['model']=_['keys'](db[_0x43e9('0x68')]['rawAttributes']);_0x3ec521[_0x43e9('0x45')]=_['keys'](_0x4fb0c7[_0x43e9('0x45')]);_0x3ec521[_0x43e9('0x47')]=_[_0x43e9('0x4a')](_0x3ec521[_0x43e9('0x48')],_0x3ec521[_0x43e9('0x45')]);_0x4755d8[_0x43e9('0x49')]=_[_0x43e9('0x4a')](_0x3ec521[_0x43e9('0x48')],qs['fields'](_0x4fb0c7[_0x43e9('0x45')]['fields']));_0x4755d8[_0x43e9('0x49')]=_0x4755d8[_0x43e9('0x49')][_0x43e9('0x69')]?_0x4755d8[_0x43e9('0x49')]:_0x3ec521[_0x43e9('0x48')];if(!_0x4fb0c7[_0x43e9('0x45')]['hasOwnProperty']('nolimit')){_0x4755d8[_0x43e9('0x31')]=qs[_0x43e9('0x31')](_0x4fb0c7[_0x43e9('0x45')][_0x43e9('0x31')]);_0x4755d8[_0x43e9('0x30')]=qs[_0x43e9('0x30')](_0x4fb0c7[_0x43e9('0x45')][_0x43e9('0x30')]);}_0x4755d8[_0x43e9('0x4e')]=qs[_0x43e9('0x4f')](_0x4fb0c7[_0x43e9('0x45')][_0x43e9('0x4f')]);_0x4755d8['where']=qs[_0x43e9('0x47')](_[_0x43e9('0x51')](_0x4fb0c7[_0x43e9('0x45')],_0x3ec521[_0x43e9('0x47')]));_0x4755d8[_0x43e9('0x50')]['ChatQueueId']=_0x154592['id'];if(_0x4fb0c7[_0x43e9('0x45')]['filter']){_0x4755d8[_0x43e9('0x50')]=_[_0x43e9('0x53')](_0x4755d8[_0x43e9('0x50')],{'$or':_[_0x43e9('0x3f')](_0x4755d8[_0x43e9('0x49')],function(_0x590ba3){var _0x4bc3ab={};_0x4bc3ab[_0x590ba3]={'$like':'%'+_0x4fb0c7[_0x43e9('0x45')][_0x43e9('0x52')]+'%'};return _0x4bc3ab;})});}_0x4755d8=_[_0x43e9('0x53')]({},_0x4755d8,_0x4fb0c7['options']);return db[_0x43e9('0x68')][_0x43e9('0x57')](_0x4755d8);}})[_0x43e9('0x24')](function(_0x4b8e82){if(_0x4b8e82){return db[_0x43e9('0x6a')]['findAndCountAll']({'where':{'id':_[_0x43e9('0x3f')](_0x4b8e82,_0x43e9('0x6b')),'role':_0x43e9('0x6c')},'attributes':['id','name',_0x43e9('0x6d'),_0x43e9('0x6e'),_0x43e9('0x6f')]});}})[_0x43e9('0x24')](function(_0x5c2c78){if(_0x5c2c78){return{'count':_0x5c2c78[_0x43e9('0x55')],'rows':_[_0x43e9('0x3f')](_0x5c2c78[_0x43e9('0x58')],function(_0x404eb2){return{'membername':_0x404eb2['name'],'UserId':_0x404eb2['id'],'queue_name':_0x2d3ee2[_0x43e9('0x3c')],'ChatQueueId':_0x2d3ee2['id'],'interface':util[_0x43e9('0x70')](_0x43e9('0x71'),_0x43e9('0x72'),_0x404eb2[_0x43e9('0x3c')]),'penalty':0x0,'paused':_0x404eb2[_0x43e9('0x6d')],'createdAt':_0x404eb2[_0x43e9('0x6f')],'updatedAt':_0x404eb2[_0x43e9('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x43e9('0x24')](respondWithFilteredResult(_0x3dc355,_0x4755d8))[_0x43e9('0x59')](handleError(_0x3dc355,null));};exports['getTeams']=function(_0x2ea772,_0x2be3f9,_0x5e086a){var _0x5e610a={};var _0xfb0bea={};var _0x14f13c;var _0x5bcfec;return db['ChatQueue'][_0x43e9('0x73')]({'where':{'id':_0x2ea772[_0x43e9('0x5b')]['id']}})[_0x43e9('0x24')](handleEntityNotFound(_0x2be3f9,null))['then'](function(_0x8f0fb9){if(_0x8f0fb9){_0x14f13c=_0x8f0fb9;_0xfb0bea[_0x43e9('0x48')]=_[_0x43e9('0x46')](db['Team'][_0x43e9('0x41')]);_0xfb0bea[_0x43e9('0x45')]=_[_0x43e9('0x46')](_0x2ea772['query']);_0xfb0bea[_0x43e9('0x47')]=_['intersection'](_0xfb0bea[_0x43e9('0x48')],_0xfb0bea[_0x43e9('0x45')]);_0x5e610a[_0x43e9('0x49')]=_['intersection'](_0xfb0bea['model'],qs[_0x43e9('0x4b')](_0x2ea772[_0x43e9('0x45')]['fields']));_0x5e610a[_0x43e9('0x49')]=_0x5e610a[_0x43e9('0x49')]['length']?_0x5e610a['attributes']:_0xfb0bea[_0x43e9('0x48')];_0x5e610a[_0x43e9('0x4e')]=qs[_0x43e9('0x4f')](_0x2ea772['query'][_0x43e9('0x4f')]);_0x5e610a['where']=qs['filters'](_[_0x43e9('0x51')](_0x2ea772[_0x43e9('0x45')],_0xfb0bea[_0x43e9('0x47')]));if(_0x2ea772[_0x43e9('0x45')][_0x43e9('0x52')]){_0x5e610a[_0x43e9('0x50')]=_[_0x43e9('0x53')](_0x5e610a[_0x43e9('0x50')],{'$or':_[_0x43e9('0x3f')](_0x5e610a['attributes'],function(_0x5b33d6){var _0x42de3e={};_0x42de3e[_0x5b33d6]={'$like':'%'+_0x2ea772[_0x43e9('0x45')][_0x43e9('0x52')]+'%'};return _0x42de3e;})});}_0x5e610a=_[_0x43e9('0x53')]({},_0x5e610a,_0x2ea772[_0x43e9('0x54')]);return _0x14f13c['getTeams'](_0x5e610a);}})['then'](function(_0x20cd20){if(_0x20cd20){_0x5bcfec=_0x20cd20['length'];if(!_0x2ea772[_0x43e9('0x45')]['hasOwnProperty'](_0x43e9('0x4d'))){_0x5e610a['limit']=qs[_0x43e9('0x31')](_0x2ea772[_0x43e9('0x45')]['limit']);_0x5e610a['offset']=qs[_0x43e9('0x30')](_0x2ea772[_0x43e9('0x45')][_0x43e9('0x30')]);}return _0x14f13c['getTeams'](_0x5e610a);}})[_0x43e9('0x24')](function(_0x25cd40){if(_0x25cd40){return _0x25cd40?{'count':_0x5bcfec,'rows':_0x25cd40}:null;}})['then'](respondWithResult(_0x2be3f9,null))['catch'](handleError(_0x2be3f9,null));};exports[_0x43e9('0x74')]=function(_0x29a34d,_0x2991bd,_0x5e52c9){var _0xe1f5e2=_0x29a34d[_0x43e9('0x5f')]['ids'];return db[_0x43e9('0x75')]['findAll']({'where':{'id':_0xe1f5e2},'attributes':['id'],'include':[{'model':db['User'],'as':_0x43e9('0x76'),'attributes':['id',_0x43e9('0x3c'),_0x43e9('0x77'),_0x43e9('0x78'),_0x43e9('0x79')],'raw':!![]}]})['then'](function(_0x1dd126){if(_0x1dd126){var _0x7f99ab=_[_0x43e9('0x7a')](_0x1dd126,function(_0x312d80){var _0x5ae115=_0x312d80[_0x43e9('0x38')]({'plain':!![]});return _0x5ae115[_0x43e9('0x76')];});return db[_0x43e9('0x40')]['find']({'where':{'id':_0x29a34d[_0x43e9('0x5b')]['id']}})[_0x43e9('0x24')](function(_0x3c63b2){return db['sequelize'][_0x43e9('0x7b')](function(_0x33e752){return _0x3c63b2[_0x43e9('0x74')](_0xe1f5e2,{'transaction':_0x33e752})[_0x43e9('0x24')](function(){return BPromise['each'](_0x7f99ab,function(_0x3735b1){return db['UserChatQueue'][_0x43e9('0x7c')]({'where':{'UserId':_0x3735b1['id'],'ChatQueueId':_0x29a34d['params']['id']},'transaction':_0x33e752});});})[_0x43e9('0x24')](function(){_0x7f99ab['forEach'](function(_0x3aa100){socket[_0x43e9('0x7d')](_0x43e9('0x7e'),{'UserId':_0x3aa100['id'],'ChatQueueId':_0x3c63b2['id']});});});});});}})[_0x43e9('0x24')](respondWithStatusCode(_0x2991bd,null))['catch'](handleError(_0x2991bd,null));};exports[_0x43e9('0x7f')]=function(_0x2b4167,_0x300ea3,_0x13b191){return db[_0x43e9('0x75')][_0x43e9('0x57')]({'where':{'id':_0x2b4167[_0x43e9('0x45')][_0x43e9('0x80')]},'attributes':['id'],'include':[{'model':db[_0x43e9('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x43e9('0x24')](handleEntityNotFound(_0x300ea3,null))[_0x43e9('0x24')](function(_0x295e84){var _0x54f0dd=_[_0x43e9('0x3f')](_0x295e84,'id');var _0x206972=[];var _0x8a9efa=[];var _0x5a8e38=squel[_0x43e9('0x81')]();_0x5a8e38[_0x43e9('0x82')]('tq.TeamId')[_0x43e9('0x83')](_0x43e9('0x84'),'tq')['join'](_0x43e9('0x85'),'ut',_0x43e9('0x86'))[_0x43e9('0x50')]('ChatQueueId\x20=\x20?',_0x2b4167[_0x43e9('0x5b')]['id']);for(var _0x3a41ad=0x0;_0x3a41ad<_0x295e84['length'];_0x3a41ad+=0x1){let _0x4ab7ac=_0x295e84[_0x3a41ad];for(var _0x476288=0x0;_0x476288<_0x4ab7ac[_0x43e9('0x76')][_0x43e9('0x69')];_0x476288+=0x1){let _0x45904a=_0x4ab7ac[_0x43e9('0x76')][_0x476288];var _0x53f7bd=_0x5a8e38['clone']();_0x53f7bd[_0x43e9('0x50')](_0x43e9('0x87'),_0x45904a['id']);_0x8a9efa[_0x43e9('0x88')](db[_0x43e9('0x89')][_0x43e9('0x45')](_0x53f7bd[_0x43e9('0x8a')](),{'type':db['sequelize']['QueryTypes'][_0x43e9('0x8b')]})['then'](function(_0x5baa8e){if(_0x5baa8e[_0x43e9('0x69')]===0x1){return _0x45904a['id'];}else{var _0x56c0b1=_[_0x43e9('0x8c')](_[_0x43e9('0x3f')](_0x5baa8e,_0x43e9('0x8d')),function(_0x1600c5){return _[_0x43e9('0x8e')](_0x54f0dd,_0x1600c5);});if(_0x56c0b1){return _0x45904a['id'];}}}));}}return BPromise[_0x43e9('0x8f')](_0x8a9efa)[_0x43e9('0x24')](function(_0x356f10){_0x206972=_(_0x206972)[_0x43e9('0x90')](_0x356f10)['compact']()[_0x43e9('0x91')]();return db[_0x43e9('0x40')][_0x43e9('0x5d')]({'where':{'id':_0x2b4167['params']['id']}})[_0x43e9('0x24')](function(_0x5dcf59){return db[_0x43e9('0x89')][_0x43e9('0x7b')](function(_0xde993a){return _0x5dcf59[_0x43e9('0x7f')](_0x2b4167[_0x43e9('0x45')]['ids'],{'transaction':_0xde993a})[_0x43e9('0x24')](function(){if(!_[_0x43e9('0x92')](_0x206972)){return _0x5dcf59[_0x43e9('0x93')](_0x206972,{'transaction':_0xde993a});}})[_0x43e9('0x24')](function(){_0x206972[_0x43e9('0x94')](function(_0x2299fb){socket[_0x43e9('0x7d')](_0x43e9('0x95'),{'UserId':_0x2299fb,'ChatQueueId':_0x5dcf59['id']});});});});});});})[_0x43e9('0x24')](respondWithStatusCode(_0x300ea3,null))['catch'](handleError(_0x300ea3,null));};exports['addAgents']=function(_0x222882,_0x1684ff,_0x5a02b2){return db[_0x43e9('0x40')]['find']({'where':{'id':_0x222882['params']['id']}})[_0x43e9('0x24')](handleEntityNotFound(_0x1684ff,null))[_0x43e9('0x24')](function(_0x46940e){if(_0x46940e){return _0x46940e[_0x43e9('0x96')](_0x222882['body'][_0x43e9('0x80')],_['omit'](_0x222882['body'],['ids','id'])||{})[_0x43e9('0x97')](function(_0x5179de){for(var _0x3b5463=0x0;_0x3b5463<_0x222882[_0x43e9('0x5f')][_0x43e9('0x80')][_0x43e9('0x69')];_0x3b5463+=0x1){socket[_0x43e9('0x7d')](_0x43e9('0x7e'),{'UserId':_0x222882[_0x43e9('0x5f')][_0x43e9('0x80')][_0x3b5463],'ChatQueueId':_0x222882[_0x43e9('0x5b')]['id']});}return _0x5179de;});}})[_0x43e9('0x24')](respondWithResult(_0x1684ff,null))[_0x43e9('0x59')](handleError(_0x1684ff,null));};exports['removeAgents']=function(_0x3680ff,_0x10e167,_0x3f4854){return db['ChatQueue'][_0x43e9('0x5d')]({'where':{'id':_0x3680ff[_0x43e9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x10e167,null))[_0x43e9('0x24')](function(_0x22158e){if(_0x22158e){return _0x22158e[_0x43e9('0x93')](_0x3680ff['query'][_0x43e9('0x80')])[_0x43e9('0x24')](function(){if(_[_0x43e9('0x98')](_0x3680ff[_0x43e9('0x45')]['ids'])){for(var _0x466587=0x0;_0x466587<_0x3680ff[_0x43e9('0x45')][_0x43e9('0x80')][_0x43e9('0x69')];_0x466587+=0x1){socket['emit'](_0x43e9('0x95'),{'UserId':Number(_0x3680ff[_0x43e9('0x45')][_0x43e9('0x80')][_0x466587]),'ChatQueueId':Number(_0x3680ff['params']['id'])});}}else{socket[_0x43e9('0x7d')](_0x43e9('0x95'),{'UserId':Number(_0x3680ff[_0x43e9('0x45')][_0x43e9('0x80')]),'ChatQueueId':Number(_0x3680ff['params']['id'])});}});}})[_0x43e9('0x24')](respondWithStatusCode(_0x10e167,null))[_0x43e9('0x59')](handleError(_0x10e167,null));};exports[_0x43e9('0x99')]=function(_0x25d2d7,_0x5e0d62,_0x59a65a){var _0x5765fc={};var _0x3921b1={};var _0x27d1da;var _0x47cfe3;return db['ChatQueue'][_0x43e9('0x73')]({'where':{'id':_0x25d2d7[_0x43e9('0x5b')]['id']}})[_0x43e9('0x24')](handleEntityNotFound(_0x5e0d62,null))['then'](function(_0x9b16ae){if(_0x9b16ae){_0x27d1da=_0x9b16ae;_0x3921b1[_0x43e9('0x48')]=_[_0x43e9('0x46')](db[_0x43e9('0x6a')][_0x43e9('0x41')]);_0x3921b1[_0x43e9('0x45')]=_[_0x43e9('0x46')](_0x25d2d7[_0x43e9('0x45')]);_0x3921b1[_0x43e9('0x47')]=_['intersection'](_0x3921b1[_0x43e9('0x48')],_0x3921b1[_0x43e9('0x45')]);_0x5765fc[_0x43e9('0x49')]=_['intersection'](_0x3921b1[_0x43e9('0x48')],qs[_0x43e9('0x4b')](_0x25d2d7[_0x43e9('0x45')][_0x43e9('0x4b')]));_0x5765fc['attributes']=_0x5765fc[_0x43e9('0x49')][_0x43e9('0x69')]?_0x5765fc[_0x43e9('0x49')]:_0x3921b1[_0x43e9('0x48')];_0x5765fc[_0x43e9('0x4e')]=qs[_0x43e9('0x4f')](_0x25d2d7[_0x43e9('0x45')]['sort']);_0x5765fc['where']=qs['filters'](_['pick'](_0x25d2d7['query'],_0x3921b1[_0x43e9('0x47')]));if(_0x25d2d7[_0x43e9('0x45')][_0x43e9('0x52')]){_0x5765fc[_0x43e9('0x50')]=_[_0x43e9('0x53')](_0x5765fc[_0x43e9('0x50')],{'$or':_[_0x43e9('0x3f')](_0x5765fc[_0x43e9('0x49')],function(_0x4a4fdd){var _0x4bce83={};_0x4bce83[_0x4a4fdd]={'$like':'%'+_0x25d2d7['query'][_0x43e9('0x52')]+'%'};return _0x4bce83;})});}_0x5765fc=_['merge']({},_0x5765fc,_0x25d2d7[_0x43e9('0x54')]);return _0x27d1da['getAgents'](_0x5765fc);}})[_0x43e9('0x24')](function(_0xa3ac0){if(_0xa3ac0){_0x47cfe3=_0xa3ac0['length'];if(!_0x25d2d7[_0x43e9('0x45')]['hasOwnProperty']('nolimit')){_0x5765fc[_0x43e9('0x31')]=qs['limit'](_0x25d2d7[_0x43e9('0x45')][_0x43e9('0x31')]);_0x5765fc[_0x43e9('0x30')]=qs[_0x43e9('0x30')](_0x25d2d7[_0x43e9('0x45')][_0x43e9('0x30')]);}return _0x27d1da[_0x43e9('0x99')](_0x5765fc);}})[_0x43e9('0x24')](function(_0x38f5dd){if(_0x38f5dd){return _0x38f5dd?{'count':_0x47cfe3,'rows':_0x38f5dd}:null;}})[_0x43e9('0x24')](respondWithResult(_0x5e0d62,null))[_0x43e9('0x59')](handleError(_0x5e0d62,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 2afe126..6200cb0 100644 --- a/server/api/chatQueue/chatQueue.events.js +++ b/server/api/chatQueue/chatQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0xcc3531,_0x5eaaf0){var _0x3baac1=function(_0x28b4e9){while(--_0x28b4e9){_0xcc3531['push'](_0xcc3531['shift']());}};_0x3baac1(++_0x5eaaf0);}(_0x0b0e,0x187));var _0xe0b0=function(_0xc315de,_0x5dc877){_0xc315de=_0xc315de-0x0;var _0x11a627=_0x0b0e[_0xc315de];return _0x11a627;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatQueueEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatQueueEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatQueue[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x2769d9,_0xb61766){var _0x59553c=function(_0x2ee0ee){while(--_0x2ee0ee){_0x2769d9['push'](_0x2769d9['shift']());}};_0x59553c(++_0xb61766);}(_0x5f2f,0x73));var _0xf5f2=function(_0x57041d,_0x3c34ad){_0x57041d=_0x57041d-0x0;var _0x5c5372=_0x5f2f[_0x57041d];return _0x5c5372;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index f8b7d40..43de083 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 _0x2255=['../../config/environment','exports','ChatQueue','chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x53a7af,_0x1408a5){var _0x3cc7f6=function(_0x4bf101){while(--_0x4bf101){_0x53a7af['push'](_0x53a7af['shift']());}};_0x3cc7f6(++_0x1408a5);}(_0x2255,0x13c));var _0x5225=function(_0x979467,_0x355ece){_0x979467=_0x979467-0x0;var _0x1a93d4=_0x2255[_0x979467];return _0x1a93d4;};'use strict';var _=require(_0x5225('0x0'));var util=require('util');var logger=require(_0x5225('0x1'))(_0x5225('0x2'));var moment=require(_0x5225('0x3'));var BPromise=require(_0x5225('0x4'));var rp=require(_0x5225('0x5'));var fs=require('fs');var path=require(_0x5225('0x6'));var rimraf=require(_0x5225('0x7'));var config=require(_0x5225('0x8'));var attributes=require('./chatQueue.attributes');module[_0x5225('0x9')]=function(_0x55ac5f,_0x1a1060){return _0x55ac5f['define'](_0x5225('0xa'),attributes,{'tableName':_0x5225('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb604=['bluebird','./chatQueue.attributes','exports','define','chat_queues','../../config/logger','moment'];(function(_0x3e3850,_0x9e8430){var _0xf2cdac=function(_0x4329e5){while(--_0x4329e5){_0x3e3850['push'](_0x3e3850['shift']());}};_0xf2cdac(++_0x9e8430);}(_0xb604,0x1a2));var _0x4b60=function(_0x164ef5,_0xba6238){_0x164ef5=_0x164ef5-0x0;var _0x2d60c5=_0xb604[_0x164ef5];return _0x2d60c5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4b60('0x0'))('api');var moment=require(_0x4b60('0x1'));var BPromise=require(_0x4b60('0x2'));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(_0x4b60('0x3'));module[_0x4b60('0x4')]=function(_0x514cf2,_0xf1a69b){return _0x514cf2[_0x4b60('0x5')]('ChatQueue',attributes,{'tableName':_0x4b60('0x6'),'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 d2e3e60..2273e45 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 _0xcb49=['error','code','message','info','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetChatQueue','ShowChatQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','redis','localhost','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5d9449,_0x5382b7){var _0x583cf7=function(_0x30464f){while(--_0x30464f){_0x5d9449['push'](_0x5d9449['shift']());}};_0x583cf7(++_0x5382b7);}(_0xcb49,0x156));var _0x9cb4=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xcb49[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x9cb4('0x0'));var util=require('util');var moment=require(_0x9cb4('0x1'));var BPromise=require(_0x9cb4('0x2'));var rs=require(_0x9cb4('0x3'));var fs=require('fs');var Redis=require(_0x9cb4('0x4'));var db=require(_0x9cb4('0x5'))['db'];var utils=require(_0x9cb4('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9cb4('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x9cb4('0x8')]=_['defaults'](config[_0x9cb4('0x8')],{'host':_0x9cb4('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9cb4('0xa'))['register'](socket);function respondWithRpcPromise(_0x1ca33b,_0x3a0d67,_0x55fdbb){return new BPromise(function(_0x4b5440,_0x9d00fb){return client[_0x9cb4('0xb')](_0x1ca33b,_0x55fdbb)[_0x9cb4('0xc')](function(_0x240e5e){logger['info'](_0x9cb4('0xd'),_0x3a0d67,'request\x20sent');logger[_0x9cb4('0xe')](_0x9cb4('0xf'),_0x3a0d67,_0x9cb4('0x10'),JSON[_0x9cb4('0x11')](_0x240e5e));if(_0x240e5e[_0x9cb4('0x12')]){if(_0x240e5e['error'][_0x9cb4('0x13')]===0x1f4){logger[_0x9cb4('0x12')]('ChatQueue,\x20%s,\x20%s',_0x3a0d67,_0x240e5e[_0x9cb4('0x12')]['message']);return _0x9d00fb(_0x240e5e['error'][_0x9cb4('0x14')]);}logger[_0x9cb4('0x12')](_0x9cb4('0xd'),_0x3a0d67,_0x240e5e[_0x9cb4('0x12')]['message']);return _0x4b5440(_0x240e5e[_0x9cb4('0x12')][_0x9cb4('0x14')]);}else{logger[_0x9cb4('0x15')](_0x9cb4('0xd'),_0x3a0d67,'request\x20sent');_0x4b5440(_0x240e5e[_0x9cb4('0x16')][_0x9cb4('0x14')]);}})[_0x9cb4('0x17')](function(_0x554b9c){logger['error'](_0x9cb4('0xd'),_0x3a0d67,_0x554b9c);_0x9d00fb(_0x554b9c);});});}exports['GetChatQueue']=function(_0x198b1c){var _0x57d123=this;return new Promise(function(_0x16d639,_0x5b90d4){return db[_0x9cb4('0x18')][_0x9cb4('0x19')]({'raw':_0x198b1c[_0x9cb4('0x1a')]?_0x198b1c[_0x9cb4('0x1a')][_0x9cb4('0x1b')]===undefined?!![]:![]:!![],'where':_0x198b1c[_0x9cb4('0x1a')]?_0x198b1c['options'][_0x9cb4('0x1c')]||null:null,'attributes':_0x198b1c[_0x9cb4('0x1a')]?_0x198b1c[_0x9cb4('0x1a')][_0x9cb4('0x1d')]||null:null,'limit':_0x198b1c[_0x9cb4('0x1a')]?_0x198b1c[_0x9cb4('0x1a')][_0x9cb4('0x1e')]||null:null,'include':_0x198b1c[_0x9cb4('0x1a')]?_0x198b1c[_0x9cb4('0x1a')][_0x9cb4('0x1f')]?_['map'](_0x198b1c[_0x9cb4('0x1a')][_0x9cb4('0x1f')],function(_0x579b03){return{'model':db[_0x579b03[_0x9cb4('0x20')]],'as':_0x579b03['as'],'attributes':_0x579b03[_0x9cb4('0x1d')],'include':_0x579b03[_0x9cb4('0x1f')]?_['map'](_0x579b03[_0x9cb4('0x1f')],function(_0x2b7894){return{'model':db[_0x2b7894['model']],'as':_0x2b7894['as'],'attributes':_0x2b7894[_0x9cb4('0x1d')],'include':_0x2b7894[_0x9cb4('0x1f')]?_[_0x9cb4('0x21')](_0x2b7894[_0x9cb4('0x1f')],function(_0x286714){return{'model':db[_0x286714[_0x9cb4('0x20')]],'as':_0x286714['as'],'attributes':_0x286714[_0x9cb4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9cb4('0xc')](function(_0x518c9e){logger['info'](_0x9cb4('0x22'),_0x198b1c);logger[_0x9cb4('0xe')](_0x9cb4('0x22'),_0x198b1c,JSON['stringify'](_0x518c9e));_0x16d639(_0x518c9e);})[_0x9cb4('0x17')](function(_0x1f5671){logger[_0x9cb4('0x12')](_0x9cb4('0x22'),_0x1f5671[_0x9cb4('0x14')],_0x198b1c);_0x5b90d4(_0x57d123['error'](0x1f4,_0x1f5671['message']));});});};exports['ShowChatQueue']=function(_0x7997b){var _0x2c9615=this;return new Promise(function(_0x2eea5d,_0x522c91){return db[_0x9cb4('0x18')]['find']({'raw':_0x7997b['options']?_0x7997b[_0x9cb4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x7997b[_0x9cb4('0x1a')]?_0x7997b[_0x9cb4('0x1a')][_0x9cb4('0x1c')]||null:null,'attributes':_0x7997b[_0x9cb4('0x1a')]?_0x7997b[_0x9cb4('0x1a')][_0x9cb4('0x1d')]||null:null,'include':_0x7997b[_0x9cb4('0x1a')]?_0x7997b[_0x9cb4('0x1a')][_0x9cb4('0x1f')]?_[_0x9cb4('0x21')](_0x7997b[_0x9cb4('0x1a')][_0x9cb4('0x1f')],function(_0xd95489){return{'model':db[_0xd95489[_0x9cb4('0x20')]],'as':_0xd95489['as'],'attributes':_0xd95489[_0x9cb4('0x1d')],'include':_0xd95489['include']?_['map'](_0xd95489[_0x9cb4('0x1f')],function(_0xeafb5c){return{'model':db[_0xeafb5c['model']],'as':_0xeafb5c['as'],'attributes':_0xeafb5c[_0x9cb4('0x1d')],'include':_0xeafb5c[_0x9cb4('0x1f')]?_[_0x9cb4('0x21')](_0xeafb5c[_0x9cb4('0x1f')],function(_0x45effd){return{'model':db[_0x45effd[_0x9cb4('0x20')]],'as':_0x45effd['as'],'attributes':_0x45effd[_0x9cb4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9cb4('0xc')](function(_0x464bf4){logger[_0x9cb4('0x15')](_0x9cb4('0x23'),_0x7997b);logger['debug']('ShowChatQueue',_0x7997b,JSON[_0x9cb4('0x11')](_0x464bf4));_0x2eea5d(_0x464bf4);})[_0x9cb4('0x17')](function(_0x47c35d){logger['error'](_0x9cb4('0x23'),_0x47c35d[_0x9cb4('0x14')],_0x7997b);_0x522c91(_0x2c9615[_0x9cb4('0x12')](0x1f4,_0x47c35d['message']));});});}; \ No newline at end of file +var _0x0c8d=['error','code','ChatQueue,\x20%s,\x20%s','message','info','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','debug','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatQueue.socket','then','request\x20sent','stringify'];(function(_0x3770f4,_0x5daa68){var _0x1f1be6=function(_0x1920af){while(--_0x1920af){_0x3770f4['push'](_0x3770f4['shift']());}};_0x1f1be6(++_0x5daa68);}(_0x0c8d,0x79));var _0xd0c8=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x0c8d[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require('lodash');var util=require(_0xd0c8('0x0'));var moment=require(_0xd0c8('0x1'));var BPromise=require(_0xd0c8('0x2'));var rs=require(_0xd0c8('0x3'));var fs=require('fs');var Redis=require(_0xd0c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd0c8('0x5'));var jayson=require(_0xd0c8('0x6'));var client=jayson[_0xd0c8('0x7')]['http']({'port':0x232a});config[_0xd0c8('0x8')]=_['defaults'](config[_0xd0c8('0x8')],{'host':_0xd0c8('0x9'),'port':0x18eb});var socket=require(_0xd0c8('0xa'))(new Redis(config[_0xd0c8('0x8')]));require(_0xd0c8('0xb'))['register'](socket);function respondWithRpcPromise(_0x82ca40,_0x22df4d,_0x3b9aed){return new BPromise(function(_0x1a38b9,_0x557607){return client['request'](_0x82ca40,_0x3b9aed)[_0xd0c8('0xc')](function(_0x10f4ea){logger['info']('ChatQueue,\x20%s,\x20%s',_0x22df4d,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x22df4d,_0xd0c8('0xd'),JSON[_0xd0c8('0xe')](_0x10f4ea));if(_0x10f4ea['error']){if(_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x10')]===0x1f4){logger[_0xd0c8('0xf')](_0xd0c8('0x11'),_0x22df4d,_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x12')]);return _0x557607(_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x12')]);}logger[_0xd0c8('0xf')](_0xd0c8('0x11'),_0x22df4d,_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x12')]);return _0x1a38b9(_0x10f4ea['error'][_0xd0c8('0x12')]);}else{logger[_0xd0c8('0x13')](_0xd0c8('0x11'),_0x22df4d,'request\x20sent');_0x1a38b9(_0x10f4ea['result'][_0xd0c8('0x12')]);}})['catch'](function(_0x5e797c){logger[_0xd0c8('0xf')](_0xd0c8('0x11'),_0x22df4d,_0x5e797c);_0x557607(_0x5e797c);});});}exports['GetChatQueue']=function(_0x10c878){var _0x42ba67=this;return new Promise(function(_0x559ddd,_0x1a5a3d){return db[_0xd0c8('0x14')][_0xd0c8('0x15')]({'raw':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x17')]===undefined?!![]:![]:!![],'where':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x18')]||null:null,'attributes':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x19')]||null:null,'limit':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x1a')]||null:null,'include':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x1b')]?_[_0xd0c8('0x1c')](_0x10c878['options']['include'],function(_0xc109ee){return{'model':db[_0xc109ee[_0xd0c8('0x1d')]],'as':_0xc109ee['as'],'attributes':_0xc109ee[_0xd0c8('0x19')],'include':_0xc109ee[_0xd0c8('0x1b')]?_[_0xd0c8('0x1c')](_0xc109ee[_0xd0c8('0x1b')],function(_0x39ec6d){return{'model':db[_0x39ec6d[_0xd0c8('0x1d')]],'as':_0x39ec6d['as'],'attributes':_0x39ec6d[_0xd0c8('0x19')],'include':_0x39ec6d['include']?_[_0xd0c8('0x1c')](_0x39ec6d[_0xd0c8('0x1b')],function(_0x160032){return{'model':db[_0x160032['model']],'as':_0x160032['as'],'attributes':_0x160032['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22e125){logger['info'](_0xd0c8('0x1e'),_0x10c878);logger['debug'](_0xd0c8('0x1e'),_0x10c878,JSON[_0xd0c8('0xe')](_0x22e125));_0x559ddd(_0x22e125);})['catch'](function(_0x30336a){logger[_0xd0c8('0xf')](_0xd0c8('0x1e'),_0x30336a['message'],_0x10c878);_0x1a5a3d(_0x42ba67[_0xd0c8('0xf')](0x1f4,_0x30336a[_0xd0c8('0x12')]));});});};exports[_0xd0c8('0x1f')]=function(_0x21d7fb){var _0x87f472=this;return new Promise(function(_0x1f4b11,_0x3cf0f1){return db[_0xd0c8('0x14')][_0xd0c8('0x20')]({'raw':_0x21d7fb[_0xd0c8('0x16')]?_0x21d7fb['options']['raw']===undefined?!![]:![]:!![],'where':_0x21d7fb['options']?_0x21d7fb[_0xd0c8('0x16')]['where']||null:null,'attributes':_0x21d7fb[_0xd0c8('0x16')]?_0x21d7fb['options'][_0xd0c8('0x19')]||null:null,'include':_0x21d7fb[_0xd0c8('0x16')]?_0x21d7fb[_0xd0c8('0x16')][_0xd0c8('0x1b')]?_[_0xd0c8('0x1c')](_0x21d7fb[_0xd0c8('0x16')][_0xd0c8('0x1b')],function(_0x481cef){return{'model':db[_0x481cef[_0xd0c8('0x1d')]],'as':_0x481cef['as'],'attributes':_0x481cef[_0xd0c8('0x19')],'include':_0x481cef['include']?_[_0xd0c8('0x1c')](_0x481cef[_0xd0c8('0x1b')],function(_0x321fe7){return{'model':db[_0x321fe7[_0xd0c8('0x1d')]],'as':_0x321fe7['as'],'attributes':_0x321fe7[_0xd0c8('0x19')],'include':_0x321fe7[_0xd0c8('0x1b')]?_['map'](_0x321fe7[_0xd0c8('0x1b')],function(_0x17f58c){return{'model':db[_0x17f58c[_0xd0c8('0x1d')]],'as':_0x17f58c['as'],'attributes':_0x17f58c[_0xd0c8('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd0c8('0xc')](function(_0x3d533f){logger[_0xd0c8('0x13')]('ShowChatQueue',_0x21d7fb);logger[_0xd0c8('0x21')](_0xd0c8('0x1f'),_0x21d7fb,JSON[_0xd0c8('0xe')](_0x3d533f));_0x1f4b11(_0x3d533f);})['catch'](function(_0x265a4d){logger[_0xd0c8('0xf')](_0xd0c8('0x1f'),_0x265a4d[_0xd0c8('0x12')],_0x21d7fb);_0x3cf0f1(_0x87f472[_0xd0c8('0xf')](0x1f4,_0x265a4d[_0xd0c8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index c52a7bf..a79206c 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x448747,_0x52303a){var _0x34b9f4=function(_0x398dcb){while(--_0x398dcb){_0x448747['push'](_0x448747['shift']());}};_0x34b9f4(++_0x52303a);}(_0x5f2f,0x73));var _0xf5f2=function(_0xbfddf,_0x18f549){_0xbfddf=_0xbfddf-0x0;var _0x565f9b=_0x5f2f[_0xbfddf];return _0x565f9b;};'use strict';var ChatQueueEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatQueueEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatQueueEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x345aab,_0x18b7af){var _0x37d787=function(_0x262a09){while(--_0x262a09){_0x345aab['push'](_0x345aab['shift']());}};_0x37d787(++_0x18b7af);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2e3591,_0x24acba){_0x2e3591=_0x2e3591-0x0;var _0x1a451=_0x5f2f[_0x2e3591];return _0x1a451;};'use strict';var ChatQueueEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatQueueEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatQueueEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index d47f2c0..8ab0350 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 _0xf35c=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/:id','show','/:id/members','isAuthenticated','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router'];(function(_0x40bbf9,_0x29b344){var _0x5b32e7=function(_0x247473){while(--_0x247473){_0x40bbf9['push'](_0x40bbf9['shift']());}};_0x5b32e7(++_0x29b344);}(_0xf35c,0x1d6));var _0xcf35=function(_0x54194a,_0x597b66){_0x54194a=_0x54194a-0x0;var _0x253375=_0xf35c[_0x54194a];return _0x253375;};'use strict';var multer=require(_0xcf35('0x0'));var util=require(_0xcf35('0x1'));var path=require(_0xcf35('0x2'));var timeout=require(_0xcf35('0x3'));var express=require(_0xcf35('0x4'));var router=express[_0xcf35('0x5')]();var auth=require(_0xcf35('0x6'));var interaction=require(_0xcf35('0x7'));var config=require(_0xcf35('0x8'));var controller=require('./chatQueue.controller');router[_0xcf35('0x9')]('/',auth['isAuthenticated'](),controller[_0xcf35('0xa')]);router[_0xcf35('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xcf35('0xb')]);router[_0xcf35('0x9')](_0xcf35('0xc'),auth['isAuthenticated'](),controller[_0xcf35('0xd')]);router['get'](_0xcf35('0xe'),auth[_0xcf35('0xf')](),controller[_0xcf35('0x10')]);router[_0xcf35('0x9')](_0xcf35('0x11'),auth[_0xcf35('0xf')](),controller['getTeams']);router['get'](_0xcf35('0x12'),auth[_0xcf35('0xf')](),controller[_0xcf35('0x13')]);router[_0xcf35('0x14')]('/',auth[_0xcf35('0xf')](),controller[_0xcf35('0x15')]);router[_0xcf35('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0xcf35('0x16')]);router[_0xcf35('0x14')]('/:id/users',auth[_0xcf35('0xf')](),controller[_0xcf35('0x17')]);router['put'](_0xcf35('0xc'),auth[_0xcf35('0xf')](),controller[_0xcf35('0x18')]);router[_0xcf35('0x19')](_0xcf35('0xc'),auth[_0xcf35('0xf')](),controller['destroy']);router[_0xcf35('0x19')](_0xcf35('0x11'),auth[_0xcf35('0xf')](),controller[_0xcf35('0x1a')]);router['delete'](_0xcf35('0x12'),auth['isAuthenticated'](),controller[_0xcf35('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xa0cf=['isAuthenticated','index','/describe','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','/:id','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get'];(function(_0x49daa3,_0x26ad10){var _0x3c5754=function(_0x3c6e61){while(--_0x3c6e61){_0x49daa3['push'](_0x49daa3['shift']());}};_0x3c5754(++_0x26ad10);}(_0xa0cf,0x114));var _0xfa0c=function(_0x36f8c5,_0x173213){_0x36f8c5=_0x36f8c5-0x0;var _0x3dee1a=_0xa0cf[_0x36f8c5];return _0x3dee1a;};'use strict';var multer=require(_0xfa0c('0x0'));var util=require(_0xfa0c('0x1'));var path=require(_0xfa0c('0x2'));var timeout=require(_0xfa0c('0x3'));var express=require(_0xfa0c('0x4'));var router=express[_0xfa0c('0x5')]();var auth=require(_0xfa0c('0x6'));var interaction=require(_0xfa0c('0x7'));var config=require('../../config/environment');var controller=require(_0xfa0c('0x8'));router[_0xfa0c('0x9')]('/',auth[_0xfa0c('0xa')](),controller[_0xfa0c('0xb')]);router[_0xfa0c('0x9')](_0xfa0c('0xc'),auth[_0xfa0c('0xa')](),controller['describe']);router[_0xfa0c('0x9')]('/:id',auth[_0xfa0c('0xa')](),controller['show']);router[_0xfa0c('0x9')](_0xfa0c('0xd'),auth[_0xfa0c('0xa')](),controller['getMembers']);router['get'](_0xfa0c('0xe'),auth['isAuthenticated'](),controller[_0xfa0c('0xf')]);router[_0xfa0c('0x9')](_0xfa0c('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0xfa0c('0x11')]('/',auth[_0xfa0c('0xa')](),controller[_0xfa0c('0x12')]);router[_0xfa0c('0x11')](_0xfa0c('0xe'),auth['isAuthenticated'](),controller['addTeams']);router[_0xfa0c('0x11')](_0xfa0c('0x10'),auth[_0xfa0c('0xa')](),controller[_0xfa0c('0x13')]);router[_0xfa0c('0x14')](_0xfa0c('0x15'),auth[_0xfa0c('0xa')](),controller[_0xfa0c('0x16')]);router[_0xfa0c('0x17')](_0xfa0c('0x15'),auth['isAuthenticated'](),controller['destroy']);router[_0xfa0c('0x17')]('/:id/teams',auth[_0xfa0c('0xa')](),controller['removeTeams']);router['delete'](_0xfa0c('0x10'),auth[_0xfa0c('0xa')](),controller[_0xfa0c('0x18')]);module[_0xfa0c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index ed162be..4b19696 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 _0x6c31=['STRING','DATE'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x6c31,0x168));var _0x16c3=function(_0x526074,_0x5e5d09){_0x526074=_0x526074-0x0;var _0x83c6c8=_0x6c31[_0x526074];return _0x83c6c8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x16c3('0x0')]},'joinAt':{'type':Sequelize[_0x16c3('0x1')]},'leaveAt':{'type':Sequelize[_0x16c3('0x1')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x16c3('0x1')]},'reason':{'type':Sequelize[_0x16c3('0x0')]}}; \ No newline at end of file +var _0xadda=['moment','sequelize','exports','STRING','DATE'];(function(_0xdf6525,_0x57a0e6){var _0x4b90d5=function(_0x29df84){while(--_0x29df84){_0xdf6525['push'](_0xdf6525['shift']());}};_0x4b90d5(++_0x57a0e6);}(_0xadda,0xeb));var _0xaadd=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xadda[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require(_0xaadd('0x0'));var Sequelize=require(_0xaadd('0x1'));module[_0xaadd('0x2')]={'uniqueid':{'type':Sequelize[_0xaadd('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xaadd('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xaadd('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xaadd('0x4')]},'reason':{'type':Sequelize[_0xaadd('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 1b9509b..19917d4 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 _0x5f80=['includeAll','include','findAll','catch','rawAttributes','fields','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','update','then','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','options'];(function(_0x199dea,_0x2b837b){var _0x20a70a=function(_0x24af62){while(--_0x24af62){_0x199dea['push'](_0x199dea['shift']());}};_0x20a70a(++_0x2b837b);}(_0x5f80,0xe7));var _0x05f8=function(_0x1b944d,_0x14ac0f){_0x1b944d=_0x1b944d-0x0;var _0x1caddc=_0x5f80[_0x1b944d];return _0x1caddc;};'use strict';var pdf=require(_0x05f8('0x0'));var emlformat=require(_0x05f8('0x1'));var rimraf=require(_0x05f8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x05f8('0x3'));var moment=require(_0x05f8('0x4'));var BPromise=require(_0x05f8('0x5'));var Mustache=require(_0x05f8('0x6'));var util=require(_0x05f8('0x7'));var path=require(_0x05f8('0x8'));var sox=require(_0x05f8('0x9'));var csv=require(_0x05f8('0xa'));var ejs=require(_0x05f8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x05f8('0xc'));var crypto=require(_0x05f8('0xd'));var jsforce=require(_0x05f8('0xe'));var deskjs=require(_0x05f8('0xf'));var toCsv=require(_0x05f8('0xa'));var querystring=require(_0x05f8('0x10'));var Papa=require(_0x05f8('0x11'));var Redis=require('ioredis');var authService=require(_0x05f8('0x12'));var qs=require(_0x05f8('0x13'));var as=require(_0x05f8('0x14'));var hardwareService=require(_0x05f8('0x15'));var logger=require(_0x05f8('0x16'))(_0x05f8('0x17'));var utils=require('../../config/utils');var config=require(_0x05f8('0x18'));var db=require(_0x05f8('0x19'))['db'];function respondWithStatusCode(_0x34c534,_0x3f5f7d){_0x3f5f7d=_0x3f5f7d||0xcc;return function(_0xb2f26d){if(_0xb2f26d){return _0x34c534[_0x05f8('0x1a')](_0x3f5f7d);}return _0x34c534[_0x05f8('0x1b')](_0x3f5f7d)['end']();};}function respondWithResult(_0x125412,_0x2ead3a){_0x2ead3a=_0x2ead3a||0xc8;return function(_0x5786be){if(_0x5786be){return _0x125412[_0x05f8('0x1b')](_0x2ead3a)['json'](_0x5786be);}};}function respondWithFilteredResult(_0x4a09bd,_0x37709c){return function(_0x2891f6){if(_0x2891f6){var _0x344db0=_0x2891f6[_0x05f8('0x1c')],_0x2f5549=_0x37709c[_0x05f8('0x1d')],_0x56fc51=_0x37709c[_0x05f8('0x1d')]+_0x37709c[_0x05f8('0x1e')],_0x763305;if(_0x56fc51>=_0x344db0){_0x56fc51=_0x344db0;_0x763305=0xc8;}else{_0x763305=0xce;}_0x4a09bd['status'](_0x763305);return _0x4a09bd[_0x05f8('0x1f')]('Content-Range',_0x2f5549+'-'+_0x56fc51+'/'+_0x344db0)[_0x05f8('0x20')](_0x2891f6);}return null;};}function patchUpdates(_0x4f8439){return function(_0x5ebecd){try{jsonpatch[_0x05f8('0x21')](_0x5ebecd,_0x4f8439,!![]);}catch(_0x27812c){return BPromise[_0x05f8('0x22')](_0x27812c);}return _0x5ebecd[_0x05f8('0x23')]();};}function saveUpdates(_0x275ab4,_0x2cb2c1){return function(_0x5ed8f8){if(_0x5ed8f8){return _0x5ed8f8[_0x05f8('0x24')](_0x275ab4)['then'](function(_0x55c52c){return _0x55c52c;});}return null;};}function removeEntity(_0x227ce0,_0x3b248c){return function(_0xc81cc5){if(_0xc81cc5){return _0xc81cc5['destroy']()[_0x05f8('0x25')](function(){_0x227ce0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38d7c1,_0x59d21e){return function(_0xe4fa7c){if(!_0xe4fa7c){_0x38d7c1['sendStatus'](0x194);}return _0xe4fa7c;};}function handleError(_0x4f5a98,_0xd0abcc){_0xd0abcc=_0xd0abcc||0x1f4;return function(_0x5284bd){logger['error'](_0x5284bd[_0x05f8('0x26')]);if(_0x5284bd[_0x05f8('0x27')]){delete _0x5284bd['name'];}_0x4f5a98['status'](_0xd0abcc)[_0x05f8('0x28')](_0x5284bd);};}exports[_0x05f8('0x29')]=function(_0x46fcd9,_0x4b6536){var _0xde069c={},_0x5791ba={},_0x580bca={'count':0x0,'rows':[]};var _0x2c1735=_['map'](db[_0x05f8('0x2a')]['rawAttributes'],function(_0x5e160c){return{'name':_0x5e160c[_0x05f8('0x2b')],'type':_0x5e160c[_0x05f8('0x2c')][_0x05f8('0x2d')]};});_0x5791ba[_0x05f8('0x2e')]=_[_0x05f8('0x2f')](_0x2c1735,_0x05f8('0x27'));_0x5791ba['query']=_[_0x05f8('0x30')](_0x46fcd9[_0x05f8('0x31')]);_0x5791ba[_0x05f8('0x32')]=_[_0x05f8('0x33')](_0x5791ba[_0x05f8('0x2e')],_0x5791ba[_0x05f8('0x31')]);_0xde069c[_0x05f8('0x34')]=_[_0x05f8('0x33')](_0x5791ba[_0x05f8('0x2e')],qs['fields'](_0x46fcd9[_0x05f8('0x31')]['fields']));_0xde069c[_0x05f8('0x34')]=_0xde069c[_0x05f8('0x34')][_0x05f8('0x35')]?_0xde069c[_0x05f8('0x34')]:_0x5791ba['model'];if(!_0x46fcd9[_0x05f8('0x31')][_0x05f8('0x36')]('nolimit')){_0xde069c[_0x05f8('0x1e')]=qs[_0x05f8('0x1e')](_0x46fcd9['query'][_0x05f8('0x1e')]);_0xde069c['offset']=qs['offset'](_0x46fcd9['query']['offset']);}_0xde069c['order']=qs[_0x05f8('0x37')](_0x46fcd9[_0x05f8('0x31')][_0x05f8('0x37')]);_0xde069c[_0x05f8('0x38')]=qs[_0x05f8('0x32')](_['pick'](_0x46fcd9['query'],_0x5791ba['filters']));if(_0x46fcd9[_0x05f8('0x31')][_0x05f8('0x39')]){_0xde069c['where']=_['merge'](_0xde069c[_0x05f8('0x38')],{'$or':_[_0x05f8('0x2f')](_0x2c1735,function(_0x53c9f3){if(_0x53c9f3[_0x05f8('0x2c')]!==_0x05f8('0x3a')){var _0x6c8c5e={};_0x6c8c5e[_0x53c9f3[_0x05f8('0x27')]]={'$like':'%'+_0x46fcd9[_0x05f8('0x31')]['filter']+'%'};return _0x6c8c5e;}})});}_0xde069c=_[_0x05f8('0x3b')]({},_0xde069c,_0x46fcd9[_0x05f8('0x3c')]);var _0x4c6684={'where':_0xde069c['where']};return db[_0x05f8('0x2a')][_0x05f8('0x1c')](_0x4c6684)['then'](function(_0x36d6f0){_0x580bca[_0x05f8('0x1c')]=_0x36d6f0;if(_0x46fcd9[_0x05f8('0x31')][_0x05f8('0x3d')]){_0xde069c[_0x05f8('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x05f8('0x3f')](_0xde069c);})[_0x05f8('0x25')](function(_0x33022b){_0x580bca['rows']=_0x33022b;return _0x580bca;})[_0x05f8('0x25')](respondWithFilteredResult(_0x4b6536,_0xde069c))[_0x05f8('0x40')](handleError(_0x4b6536,null));};exports['show']=function(_0x35d79a,_0x28ddf5){var _0x3ae7c9={'raw':!![],'where':{'id':_0x35d79a['params']['id']}},_0xd12fb7={};_0xd12fb7['model']=_[_0x05f8('0x30')](db[_0x05f8('0x2a')][_0x05f8('0x41')]);_0xd12fb7[_0x05f8('0x31')]=_[_0x05f8('0x30')](_0x35d79a['query']);_0xd12fb7[_0x05f8('0x32')]=_[_0x05f8('0x33')](_0xd12fb7[_0x05f8('0x2e')],_0xd12fb7['query']);_0x3ae7c9[_0x05f8('0x34')]=_[_0x05f8('0x33')](_0xd12fb7[_0x05f8('0x2e')],qs['fields'](_0x35d79a['query'][_0x05f8('0x42')]));_0x3ae7c9[_0x05f8('0x34')]=_0x3ae7c9['attributes'][_0x05f8('0x35')]?_0x3ae7c9['attributes']:_0xd12fb7['model'];if(_0x35d79a[_0x05f8('0x31')]['includeAll']){_0x3ae7c9[_0x05f8('0x3e')]=[{'all':!![]}];}_0x3ae7c9=_[_0x05f8('0x3b')]({},_0x3ae7c9,_0x35d79a[_0x05f8('0x3c')]);return db[_0x05f8('0x2a')][_0x05f8('0x43')](_0x3ae7c9)[_0x05f8('0x25')](handleEntityNotFound(_0x28ddf5,null))[_0x05f8('0x25')](respondWithResult(_0x28ddf5,null))[_0x05f8('0x40')](handleError(_0x28ddf5,null));};exports[_0x05f8('0x44')]=function(_0xcd6ad8,_0x5c061d){return db[_0x05f8('0x2a')][_0x05f8('0x44')](_0xcd6ad8[_0x05f8('0x45')],{})[_0x05f8('0x25')](respondWithResult(_0x5c061d,0xc9))['catch'](handleError(_0x5c061d,null));};exports[_0x05f8('0x24')]=function(_0x5f155f,_0x36d94c){if(_0x5f155f[_0x05f8('0x45')]['id']){delete _0x5f155f[_0x05f8('0x45')]['id'];}return db[_0x05f8('0x2a')][_0x05f8('0x43')]({'where':{'id':_0x5f155f[_0x05f8('0x46')]['id']}})[_0x05f8('0x25')](handleEntityNotFound(_0x36d94c,null))[_0x05f8('0x25')](saveUpdates(_0x5f155f[_0x05f8('0x45')],null))[_0x05f8('0x25')](respondWithResult(_0x36d94c,null))[_0x05f8('0x40')](handleError(_0x36d94c,null));};exports[_0x05f8('0x47')]=function(_0x1ba292,_0x282783){return db[_0x05f8('0x2a')][_0x05f8('0x43')]({'where':{'id':_0x1ba292[_0x05f8('0x46')]['id']}})[_0x05f8('0x25')](handleEntityNotFound(_0x282783,null))[_0x05f8('0x25')](removeEntity(_0x282783,null))['catch'](handleError(_0x282783,null));};exports[_0x05f8('0x48')]=function(_0x11483f,_0x4b1307){return db[_0x05f8('0x2a')]['describe']()[_0x05f8('0x25')](respondWithResult(_0x4b1307,null))[_0x05f8('0x40')](handleError(_0x4b1307,null));}; \ No newline at end of file +var _0x9e7e=['describe','eml-format','rimraf','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','update','then','stack','name','send','map','ChatQueueReport','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','keys','find','create','body'];(function(_0xa5624b,_0x5be014){var _0x32c9be=function(_0x174978){while(--_0x174978){_0xa5624b['push'](_0xa5624b['shift']());}};_0x32c9be(++_0x5be014);}(_0x9e7e,0x8f));var _0xe9e7=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0x9e7e[_0x1a1b6e];return _0x571e2c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe9e7('0x0'));var rimraf=require(_0xe9e7('0x1'));var zipdir=require(_0xe9e7('0x2'));var jsonpatch=require(_0xe9e7('0x3'));var rp=require(_0xe9e7('0x4'));var moment=require(_0xe9e7('0x5'));var BPromise=require(_0xe9e7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe9e7('0x7'));var sox=require(_0xe9e7('0x8'));var csv=require(_0xe9e7('0x9'));var ejs=require(_0xe9e7('0xa'));var fs=require('fs');var _=require(_0xe9e7('0xb'));var squel=require(_0xe9e7('0xc'));var crypto=require(_0xe9e7('0xd'));var jsforce=require(_0xe9e7('0xe'));var deskjs=require(_0xe9e7('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe9e7('0x10'));var Redis=require(_0xe9e7('0x11'));var authService=require(_0xe9e7('0x12'));var qs=require(_0xe9e7('0x13'));var as=require(_0xe9e7('0x14'));var hardwareService=require(_0xe9e7('0x15'));var logger=require('../../config/logger')(_0xe9e7('0x16'));var utils=require(_0xe9e7('0x17'));var config=require(_0xe9e7('0x18'));var db=require(_0xe9e7('0x19'))['db'];function respondWithStatusCode(_0x4bd998,_0x57ff44){_0x57ff44=_0x57ff44||0xcc;return function(_0x49bbcc){if(_0x49bbcc){return _0x4bd998[_0xe9e7('0x1a')](_0x57ff44);}return _0x4bd998[_0xe9e7('0x1b')](_0x57ff44)[_0xe9e7('0x1c')]();};}function respondWithResult(_0x46a2aa,_0x183a1f){_0x183a1f=_0x183a1f||0xc8;return function(_0x7b9230){if(_0x7b9230){return _0x46a2aa['status'](_0x183a1f)[_0xe9e7('0x1d')](_0x7b9230);}};}function respondWithFilteredResult(_0x55912e,_0x5b2343){return function(_0x27289c){if(_0x27289c){var _0x1f8c0e=_0x27289c['count'],_0x2a3ed4=_0x5b2343[_0xe9e7('0x1e')],_0x3d5276=_0x5b2343['offset']+_0x5b2343[_0xe9e7('0x1f')],_0x34f890;if(_0x3d5276>=_0x1f8c0e){_0x3d5276=_0x1f8c0e;_0x34f890=0xc8;}else{_0x34f890=0xce;}_0x55912e[_0xe9e7('0x1b')](_0x34f890);return _0x55912e['set'](_0xe9e7('0x20'),_0x2a3ed4+'-'+_0x3d5276+'/'+_0x1f8c0e)['json'](_0x27289c);}return null;};}function patchUpdates(_0x36f5dc){return function(_0x43aea6){try{jsonpatch[_0xe9e7('0x21')](_0x43aea6,_0x36f5dc,!![]);}catch(_0x456311){return BPromise['reject'](_0x456311);}return _0x43aea6['save']();};}function saveUpdates(_0x3e240d,_0x106f63){return function(_0x3f886d){if(_0x3f886d){return _0x3f886d[_0xe9e7('0x22')](_0x3e240d)[_0xe9e7('0x23')](function(_0x348a67){return _0x348a67;});}return null;};}function removeEntity(_0x7e8a64,_0x55d4fa){return function(_0xa1b024){if(_0xa1b024){return _0xa1b024['destroy']()['then'](function(){_0x7e8a64['status'](0xcc)[_0xe9e7('0x1c')]();});}};}function handleEntityNotFound(_0x14ad03,_0xcc1010){return function(_0x1f041a){if(!_0x1f041a){_0x14ad03[_0xe9e7('0x1a')](0x194);}return _0x1f041a;};}function handleError(_0x3546ea,_0x547ff9){_0x547ff9=_0x547ff9||0x1f4;return function(_0x465103){logger['error'](_0x465103[_0xe9e7('0x24')]);if(_0x465103[_0xe9e7('0x25')]){delete _0x465103[_0xe9e7('0x25')];}_0x3546ea[_0xe9e7('0x1b')](_0x547ff9)[_0xe9e7('0x26')](_0x465103);};}exports['index']=function(_0x53424e,_0x280067){var _0x5a1a87={},_0x42ccf9={},_0x550225={'count':0x0,'rows':[]};var _0x56324a=_[_0xe9e7('0x27')](db[_0xe9e7('0x28')]['rawAttributes'],function(_0x1e9933){return{'name':_0x1e9933['fieldName'],'type':_0x1e9933[_0xe9e7('0x29')][_0xe9e7('0x2a')]};});_0x42ccf9[_0xe9e7('0x2b')]=_[_0xe9e7('0x27')](_0x56324a,'name');_0x42ccf9[_0xe9e7('0x2c')]=_['keys'](_0x53424e[_0xe9e7('0x2c')]);_0x42ccf9[_0xe9e7('0x2d')]=_['intersection'](_0x42ccf9[_0xe9e7('0x2b')],_0x42ccf9[_0xe9e7('0x2c')]);_0x5a1a87[_0xe9e7('0x2e')]=_[_0xe9e7('0x2f')](_0x42ccf9[_0xe9e7('0x2b')],qs[_0xe9e7('0x30')](_0x53424e['query'][_0xe9e7('0x30')]));_0x5a1a87[_0xe9e7('0x2e')]=_0x5a1a87['attributes'][_0xe9e7('0x31')]?_0x5a1a87[_0xe9e7('0x2e')]:_0x42ccf9[_0xe9e7('0x2b')];if(!_0x53424e['query'][_0xe9e7('0x32')](_0xe9e7('0x33'))){_0x5a1a87[_0xe9e7('0x1f')]=qs[_0xe9e7('0x1f')](_0x53424e['query'][_0xe9e7('0x1f')]);_0x5a1a87[_0xe9e7('0x1e')]=qs[_0xe9e7('0x1e')](_0x53424e[_0xe9e7('0x2c')][_0xe9e7('0x1e')]);}_0x5a1a87[_0xe9e7('0x34')]=qs[_0xe9e7('0x35')](_0x53424e[_0xe9e7('0x2c')][_0xe9e7('0x35')]);_0x5a1a87[_0xe9e7('0x36')]=qs[_0xe9e7('0x2d')](_['pick'](_0x53424e[_0xe9e7('0x2c')],_0x42ccf9[_0xe9e7('0x2d')]));if(_0x53424e[_0xe9e7('0x2c')][_0xe9e7('0x37')]){_0x5a1a87[_0xe9e7('0x36')]=_[_0xe9e7('0x38')](_0x5a1a87['where'],{'$or':_[_0xe9e7('0x27')](_0x56324a,function(_0x1daf4e){if(_0x1daf4e[_0xe9e7('0x29')]!==_0xe9e7('0x39')){var _0x148e71={};_0x148e71[_0x1daf4e[_0xe9e7('0x25')]]={'$like':'%'+_0x53424e[_0xe9e7('0x2c')][_0xe9e7('0x37')]+'%'};return _0x148e71;}})});}_0x5a1a87=_[_0xe9e7('0x38')]({},_0x5a1a87,_0x53424e[_0xe9e7('0x3a')]);var _0x49d34a={'where':_0x5a1a87[_0xe9e7('0x36')]};return db['ChatQueueReport']['count'](_0x49d34a)[_0xe9e7('0x23')](function(_0x4e0a8e){_0x550225[_0xe9e7('0x3b')]=_0x4e0a8e;if(_0x53424e['query'][_0xe9e7('0x3c')]){_0x5a1a87[_0xe9e7('0x3d')]=[{'all':!![]}];}return db[_0xe9e7('0x28')][_0xe9e7('0x3e')](_0x5a1a87);})['then'](function(_0x331daa){_0x550225['rows']=_0x331daa;return _0x550225;})['then'](respondWithFilteredResult(_0x280067,_0x5a1a87))[_0xe9e7('0x3f')](handleError(_0x280067,null));};exports[_0xe9e7('0x40')]=function(_0x543d6a,_0x212ed5){var _0x5e028f={'raw':!![],'where':{'id':_0x543d6a[_0xe9e7('0x41')]['id']}},_0x38fc27={};_0x38fc27[_0xe9e7('0x2b')]=_[_0xe9e7('0x42')](db['ChatQueueReport']['rawAttributes']);_0x38fc27[_0xe9e7('0x2c')]=_[_0xe9e7('0x42')](_0x543d6a[_0xe9e7('0x2c')]);_0x38fc27[_0xe9e7('0x2d')]=_[_0xe9e7('0x2f')](_0x38fc27[_0xe9e7('0x2b')],_0x38fc27[_0xe9e7('0x2c')]);_0x5e028f['attributes']=_[_0xe9e7('0x2f')](_0x38fc27[_0xe9e7('0x2b')],qs['fields'](_0x543d6a[_0xe9e7('0x2c')][_0xe9e7('0x30')]));_0x5e028f[_0xe9e7('0x2e')]=_0x5e028f[_0xe9e7('0x2e')][_0xe9e7('0x31')]?_0x5e028f[_0xe9e7('0x2e')]:_0x38fc27[_0xe9e7('0x2b')];if(_0x543d6a[_0xe9e7('0x2c')][_0xe9e7('0x3c')]){_0x5e028f[_0xe9e7('0x3d')]=[{'all':!![]}];}_0x5e028f=_[_0xe9e7('0x38')]({},_0x5e028f,_0x543d6a[_0xe9e7('0x3a')]);return db[_0xe9e7('0x28')][_0xe9e7('0x43')](_0x5e028f)[_0xe9e7('0x23')](handleEntityNotFound(_0x212ed5,null))['then'](respondWithResult(_0x212ed5,null))[_0xe9e7('0x3f')](handleError(_0x212ed5,null));};exports[_0xe9e7('0x44')]=function(_0x7aac93,_0x4a620e){return db[_0xe9e7('0x28')][_0xe9e7('0x44')](_0x7aac93[_0xe9e7('0x45')],{})[_0xe9e7('0x23')](respondWithResult(_0x4a620e,0xc9))[_0xe9e7('0x3f')](handleError(_0x4a620e,null));};exports[_0xe9e7('0x22')]=function(_0x25c1b9,_0x536448){if(_0x25c1b9['body']['id']){delete _0x25c1b9[_0xe9e7('0x45')]['id'];}return db['ChatQueueReport'][_0xe9e7('0x43')]({'where':{'id':_0x25c1b9[_0xe9e7('0x41')]['id']}})[_0xe9e7('0x23')](handleEntityNotFound(_0x536448,null))[_0xe9e7('0x23')](saveUpdates(_0x25c1b9[_0xe9e7('0x45')],null))[_0xe9e7('0x23')](respondWithResult(_0x536448,null))[_0xe9e7('0x3f')](handleError(_0x536448,null));};exports['destroy']=function(_0x17626b,_0xc758b8){return db[_0xe9e7('0x28')][_0xe9e7('0x43')]({'where':{'id':_0x17626b[_0xe9e7('0x41')]['id']}})[_0xe9e7('0x23')](handleEntityNotFound(_0xc758b8,null))[_0xe9e7('0x23')](removeEntity(_0xc758b8,null))[_0xe9e7('0x3f')](handleError(_0xc758b8,null));};exports[_0xe9e7('0x46')]=function(_0x30d25c,_0x156cec){return db[_0xe9e7('0x28')]['describe']()['then'](respondWithResult(_0x156cec,null))[_0xe9e7('0x3f')](handleError(_0x156cec,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 6db8942..78344d5 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 _0x388e=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_chat_queue','uniqueid'];(function(_0x30e358,_0x2b1d42){var _0x4559ef=function(_0x217ed7){while(--_0x217ed7){_0x30e358['push'](_0x30e358['shift']());}};_0x4559ef(++_0x2b1d42);}(_0x388e,0xc6));var _0xe388=function(_0x17760c,_0x3cb1bc){_0x17760c=_0x17760c-0x0;var _0x36b403=_0x388e[_0x17760c];return _0x36b403;};'use strict';var _=require(_0xe388('0x0'));var util=require(_0xe388('0x1'));var logger=require(_0xe388('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe388('0x3'));var rp=require(_0xe388('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe388('0x5'));var config=require(_0xe388('0x6'));var attributes=require('./chatQueueReport.attributes');module[_0xe388('0x7')]=function(_0x33b50c,_0xf52c24){return _0x33b50c[_0xe388('0x8')]('ChatQueueReport',attributes,{'tableName':_0xe388('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe388('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4539=['request-promise','path','rimraf','../../config/environment','exports','define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x4539,0x11a));var _0x9453=function(_0x32029a,_0x219ee5){_0x32029a=_0x32029a-0x0;var _0x327e24=_0x4539[_0x32029a];return _0x327e24;};'use strict';var _=require('lodash');var util=require(_0x9453('0x0'));var logger=require(_0x9453('0x1'))(_0x9453('0x2'));var moment=require(_0x9453('0x3'));var BPromise=require('bluebird');var rp=require(_0x9453('0x4'));var fs=require('fs');var path=require(_0x9453('0x5'));var rimraf=require(_0x9453('0x6'));var config=require(_0x9453('0x7'));var attributes=require('./chatQueueReport.attributes');module[_0x9453('0x8')]=function(_0x103516,_0xff0e0e){return _0x103516[_0x9453('0x9')](_0x9453('0xa'),attributes,{'tableName':_0x9453('0xb'),'paranoid':![],'indexes':[{'name':_0x9453('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 65d1aaa..c2e64ca 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 _0x9726=['error','code','ChatQueueReport,\x20%s,\x20%s','message','info','ChatQueueReport','body','options','raw','CreateChatQueueReport','catch','UpdateChatQueueReport','update','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x9726,0x1e0));var _0x6972=function(_0x216cbc,_0x4b0a9e){_0x216cbc=_0x216cbc-0x0;var _0x1a3eaf=_0x9726[_0x216cbc];return _0x1a3eaf;};'use strict';var _=require('lodash');var util=require(_0x6972('0x0'));var moment=require(_0x6972('0x1'));var BPromise=require('bluebird');var rs=require(_0x6972('0x2'));var fs=require('fs');var Redis=require(_0x6972('0x3'));var db=require(_0x6972('0x4'))['db'];var utils=require(_0x6972('0x5'));var logger=require(_0x6972('0x6'))(_0x6972('0x7'));var config=require('../../config/environment');var jayson=require(_0x6972('0x8'));var client=jayson[_0x6972('0x9')][_0x6972('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17389c,_0x31081c,_0x1c5a1b){return new BPromise(function(_0x538374,_0x2666e5){return client[_0x6972('0xb')](_0x17389c,_0x1c5a1b)[_0x6972('0xc')](function(_0x1066d5){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x31081c,_0x6972('0xd'));logger[_0x6972('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x31081c,_0x6972('0xd'),JSON[_0x6972('0xf')](_0x1066d5));if(_0x1066d5[_0x6972('0x10')]){if(_0x1066d5[_0x6972('0x10')][_0x6972('0x11')]===0x1f4){logger[_0x6972('0x10')](_0x6972('0x12'),_0x31081c,_0x1066d5['error'][_0x6972('0x13')]);return _0x2666e5(_0x1066d5[_0x6972('0x10')][_0x6972('0x13')]);}logger[_0x6972('0x10')](_0x6972('0x12'),_0x31081c,_0x1066d5[_0x6972('0x10')][_0x6972('0x13')]);return _0x538374(_0x1066d5['error'][_0x6972('0x13')]);}else{logger[_0x6972('0x14')](_0x6972('0x12'),_0x31081c,_0x6972('0xd'));_0x538374(_0x1066d5['result']['message']);}})['catch'](function(_0x1db17f){logger[_0x6972('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x31081c,_0x1db17f);_0x2666e5(_0x1db17f);});});}exports['CreateChatQueueReport']=function(_0x29aa7){var _0x5823ee=this;return new Promise(function(_0x1c7af2,_0x580902){return db[_0x6972('0x15')]['create'](_0x29aa7[_0x6972('0x16')],{'raw':_0x29aa7[_0x6972('0x17')]?_0x29aa7[_0x6972('0x17')][_0x6972('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0xb72d67){logger[_0x6972('0x14')](_0x6972('0x19'),_0x29aa7);logger[_0x6972('0xe')]('CreateChatQueueReport',_0x29aa7,JSON['stringify'](_0xb72d67));_0x1c7af2(_0xb72d67);})[_0x6972('0x1a')](function(_0x196f8d){logger[_0x6972('0x10')]('CreateChatQueueReport',_0x196f8d['message'],_0x29aa7);_0x580902(_0x5823ee[_0x6972('0x10')](0x1f4,_0x196f8d['message']));});});};exports[_0x6972('0x1b')]=function(_0x187c5f){var _0x56632a=this;return new Promise(function(_0x471821,_0x2b2670){return db[_0x6972('0x15')][_0x6972('0x1c')](_0x187c5f[_0x6972('0x16')],{'raw':_0x187c5f[_0x6972('0x17')]?_0x187c5f[_0x6972('0x17')][_0x6972('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x187c5f['options']?_0x187c5f['options']['where']||null:null,'attributes':_0x187c5f[_0x6972('0x17')]?_0x187c5f[_0x6972('0x17')][_0x6972('0x1d')]||null:null,'limit':_0x187c5f[_0x6972('0x17')]?_0x187c5f[_0x6972('0x17')][_0x6972('0x1e')]||null:null})[_0x6972('0xc')](function(_0x435ec6){logger['info'](_0x6972('0x1b'),_0x187c5f);logger[_0x6972('0xe')](_0x6972('0x1b'),_0x187c5f,JSON['stringify'](_0x435ec6));_0x471821(_0x435ec6);})[_0x6972('0x1a')](function(_0x12a3a2){logger['error'](_0x6972('0x1b'),_0x12a3a2['message'],_0x187c5f);_0x2b2670(_0x56632a[_0x6972('0x10')](0x1f4,_0x12a3a2['message']));});});}; \ No newline at end of file +var _0x7c41=['error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','limit','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0x7c41,0x125));var _0x17c4=function(_0x596ee8,_0x4bcf27){_0x596ee8=_0x596ee8-0x0;var _0x560e00=_0x7c41[_0x596ee8];return _0x560e00;};'use strict';var _=require(_0x17c4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x17c4('0x1'));var rs=require(_0x17c4('0x2'));var fs=require('fs');var Redis=require(_0x17c4('0x3'));var db=require(_0x17c4('0x4'))['db'];var utils=require(_0x17c4('0x5'));var logger=require('../../config/logger')(_0x17c4('0x6'));var config=require(_0x17c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x17c4('0x8')][_0x17c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c312f,_0x5eb7aa,_0xaf15f8){return new BPromise(function(_0x1f70bc,_0x3eaa91){return client[_0x17c4('0xa')](_0x3c312f,_0xaf15f8)[_0x17c4('0xb')](function(_0x560102){logger[_0x17c4('0xc')](_0x17c4('0xd'),_0x5eb7aa,_0x17c4('0xe'));logger['debug'](_0x17c4('0xf'),_0x5eb7aa,_0x17c4('0xe'),JSON[_0x17c4('0x10')](_0x560102));if(_0x560102[_0x17c4('0x11')]){if(_0x560102[_0x17c4('0x11')][_0x17c4('0x12')]===0x1f4){logger[_0x17c4('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x5eb7aa,_0x560102[_0x17c4('0x11')][_0x17c4('0x13')]);return _0x3eaa91(_0x560102['error'][_0x17c4('0x13')]);}logger[_0x17c4('0x11')](_0x17c4('0xd'),_0x5eb7aa,_0x560102['error']['message']);return _0x1f70bc(_0x560102[_0x17c4('0x11')]['message']);}else{logger[_0x17c4('0xc')](_0x17c4('0xd'),_0x5eb7aa,'request\x20sent');_0x1f70bc(_0x560102[_0x17c4('0x14')][_0x17c4('0x13')]);}})['catch'](function(_0x477e1d){logger[_0x17c4('0x11')](_0x17c4('0xd'),_0x5eb7aa,_0x477e1d);_0x3eaa91(_0x477e1d);});});}exports[_0x17c4('0x15')]=function(_0x165122){var _0x132533=this;return new Promise(function(_0x29973f,_0x155a6b){return db[_0x17c4('0x16')][_0x17c4('0x17')](_0x165122[_0x17c4('0x18')],{'raw':_0x165122[_0x17c4('0x19')]?_0x165122[_0x17c4('0x19')][_0x17c4('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x575a59){logger[_0x17c4('0xc')]('CreateChatQueueReport',_0x165122);logger['debug'](_0x17c4('0x15'),_0x165122,JSON[_0x17c4('0x10')](_0x575a59));_0x29973f(_0x575a59);})['catch'](function(_0x499826){logger['error'](_0x17c4('0x15'),_0x499826[_0x17c4('0x13')],_0x165122);_0x155a6b(_0x132533['error'](0x1f4,_0x499826[_0x17c4('0x13')]));});});};exports[_0x17c4('0x1b')]=function(_0x4e7e10){var _0x359dd7=this;return new Promise(function(_0x1468b6,_0x19238f){return db[_0x17c4('0x16')]['update'](_0x4e7e10[_0x17c4('0x18')],{'raw':_0x4e7e10[_0x17c4('0x19')]?_0x4e7e10[_0x17c4('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e7e10[_0x17c4('0x19')]?_0x4e7e10[_0x17c4('0x19')][_0x17c4('0x1c')]||null:null,'attributes':_0x4e7e10[_0x17c4('0x19')]?_0x4e7e10['options']['attributes']||null:null,'limit':_0x4e7e10[_0x17c4('0x19')]?_0x4e7e10[_0x17c4('0x19')][_0x17c4('0x1d')]||null:null})[_0x17c4('0xb')](function(_0x3d20c5){logger[_0x17c4('0xc')]('UpdateChatQueueReport',_0x4e7e10);logger[_0x17c4('0x1e')]('UpdateChatQueueReport',_0x4e7e10,JSON[_0x17c4('0x10')](_0x3d20c5));_0x1468b6(_0x3d20c5);})['catch'](function(_0x492b35){logger[_0x17c4('0x11')](_0x17c4('0x1b'),_0x492b35[_0x17c4('0x13')],_0x4e7e10);_0x19238f(_0x359dd7[_0x17c4('0x11')](0x1f4,_0x492b35['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 7ecd144..de9869b 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 _0x43fb=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','post','put'];(function(_0xea9cf,_0x454f5e){var _0x2a98f7=function(_0x46895d){while(--_0x46895d){_0xea9cf['push'](_0xea9cf['shift']());}};_0x2a98f7(++_0x454f5e);}(_0x43fb,0x1e7));var _0xb43f=function(_0x2810ce,_0x431ac9){_0x2810ce=_0x2810ce-0x0;var _0x296af0=_0x43fb[_0x2810ce];return _0x296af0;};'use strict';var multer=require(_0xb43f('0x0'));var util=require(_0xb43f('0x1'));var path=require(_0xb43f('0x2'));var timeout=require(_0xb43f('0x3'));var express=require(_0xb43f('0x4'));var router=express[_0xb43f('0x5')]();var auth=require(_0xb43f('0x6'));var interaction=require(_0xb43f('0x7'));var config=require(_0xb43f('0x8'));var controller=require('./chatQueueReport.controller');router[_0xb43f('0x9')]('/',auth['isAuthenticated'](),controller[_0xb43f('0xa')]);router['get']('/describe',auth[_0xb43f('0xb')](),controller[_0xb43f('0xc')]);router[_0xb43f('0x9')](_0xb43f('0xd'),auth['isAuthenticated'](),controller[_0xb43f('0xe')]);router[_0xb43f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb43f('0x10')](_0xb43f('0xd'),auth['isAuthenticated'](),controller[_0xb43f('0x11')]);router[_0xb43f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb43f('0x13')]);module[_0xb43f('0x14')]=router; \ No newline at end of file +var _0x5d8b=['post','put','delete','destroy','multer','util','connect-timeout','./chatQueueReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5d8b,0x1cb));var _0xb5d8=function(_0x2b8571,_0x3b2ee8){_0x2b8571=_0x2b8571-0x0;var _0x4d23a3=_0x5d8b[_0x2b8571];return _0x4d23a3;};'use strict';var multer=require(_0xb5d8('0x0'));var util=require(_0xb5d8('0x1'));var path=require('path');var timeout=require(_0xb5d8('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb5d8('0x3'));router[_0xb5d8('0x4')]('/',auth['isAuthenticated'](),controller[_0xb5d8('0x5')]);router[_0xb5d8('0x4')](_0xb5d8('0x6'),auth[_0xb5d8('0x7')](),controller['describe']);router['get'](_0xb5d8('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xb5d8('0x9')]('/',auth[_0xb5d8('0x7')](),controller['create']);router[_0xb5d8('0xa')](_0xb5d8('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xb5d8('0xb')](_0xb5d8('0x8'),auth['isAuthenticated'](),controller[_0xb5d8('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 9b26d30..ed8f395 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 _0x1d6d=['exports','ENUM','account','agent','queue','DATE','moment','sequelize'];(function(_0x5839d8,_0x4f0681){var _0x278665=function(_0x376ebe){while(--_0x376ebe){_0x5839d8['push'](_0x5839d8['shift']());}};_0x278665(++_0x4f0681);}(_0x1d6d,0x106));var _0xd1d6=function(_0x439333,_0x5631df){_0x439333=_0x439333-0x0;var _0x44a388=_0x1d6d[_0x439333];return _0x44a388;};'use strict';var moment=require(_0xd1d6('0x0'));var Sequelize=require(_0xd1d6('0x1'));module[_0xd1d6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd1d6('0x3')](_0xd1d6('0x4'),_0xd1d6('0x5'),_0xd1d6('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xd1d6('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xe781=['queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0xe781,0xae));var _0x1e78=function(_0x303bcd,_0x43bf48){_0x303bcd=_0x303bcd-0x0;var _0x3a20ac=_0xe781[_0x303bcd];return _0x3a20ac;};'use strict';var moment=require(_0x1e78('0x0'));var Sequelize=require(_0x1e78('0x1'));module[_0x1e78('0x2')]={'uniqueid':{'type':Sequelize[_0x1e78('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1e78('0x4')](_0x1e78('0x5'),'agent',_0x1e78('0x6')),'allowNull':![],'defaultValue':_0x1e78('0x6')},'transferredAt':{'type':Sequelize[_0x1e78('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x1e78('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index ff8a36c..3ae49c0 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 _0x3dca=['../../config/environment','sendStatus','end','status','json','count','offset','set','apply','reject','save','update','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','show','params','catch','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x1d7e15,_0x3f4bf4){var _0x5b015c=function(_0x4ea8c1){while(--_0x4ea8c1){_0x1d7e15['push'](_0x1d7e15['shift']());}};_0x5b015c(++_0x3f4bf4);}(_0x3dca,0x107));var _0xa3dc=function(_0x36de10,_0x9255f2){_0x36de10=_0x36de10-0x0;var _0x490ddd=_0x3dca[_0x36de10];return _0x490ddd;};'use strict';var pdf=require(_0xa3dc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa3dc('0x1'));var zipdir=require(_0xa3dc('0x2'));var jsonpatch=require(_0xa3dc('0x3'));var rp=require(_0xa3dc('0x4'));var moment=require(_0xa3dc('0x5'));var BPromise=require(_0xa3dc('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa3dc('0x7'));var sox=require(_0xa3dc('0x8'));var csv=require(_0xa3dc('0x9'));var ejs=require(_0xa3dc('0xa'));var fs=require('fs');var _=require(_0xa3dc('0xb'));var squel=require(_0xa3dc('0xc'));var crypto=require(_0xa3dc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa3dc('0xe'));var toCsv=require(_0xa3dc('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa3dc('0xf'));var authService=require(_0xa3dc('0x10'));var qs=require(_0xa3dc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3dc('0x12'));var logger=require(_0xa3dc('0x13'))('api');var utils=require(_0xa3dc('0x14'));var config=require(_0xa3dc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c2494,_0x2cdc97){_0x2cdc97=_0x2cdc97||0xcc;return function(_0x385bd2){if(_0x385bd2){return _0x1c2494[_0xa3dc('0x16')](_0x2cdc97);}return _0x1c2494['status'](_0x2cdc97)[_0xa3dc('0x17')]();};}function respondWithResult(_0x38be55,_0x1c1d2f){_0x1c1d2f=_0x1c1d2f||0xc8;return function(_0x17db17){if(_0x17db17){return _0x38be55[_0xa3dc('0x18')](_0x1c1d2f)[_0xa3dc('0x19')](_0x17db17);}};}function respondWithFilteredResult(_0x2b3ecd,_0xb7daea){return function(_0x91225e){if(_0x91225e){var _0x417f8e=_0x91225e[_0xa3dc('0x1a')],_0x36aa0d=_0xb7daea[_0xa3dc('0x1b')],_0x284019=_0xb7daea[_0xa3dc('0x1b')]+_0xb7daea['limit'],_0xbe4481;if(_0x284019>=_0x417f8e){_0x284019=_0x417f8e;_0xbe4481=0xc8;}else{_0xbe4481=0xce;}_0x2b3ecd[_0xa3dc('0x18')](_0xbe4481);return _0x2b3ecd[_0xa3dc('0x1c')]('Content-Range',_0x36aa0d+'-'+_0x284019+'/'+_0x417f8e)[_0xa3dc('0x19')](_0x91225e);}return null;};}function patchUpdates(_0x272ab5){return function(_0x9b8165){try{jsonpatch[_0xa3dc('0x1d')](_0x9b8165,_0x272ab5,!![]);}catch(_0x169779){return BPromise[_0xa3dc('0x1e')](_0x169779);}return _0x9b8165[_0xa3dc('0x1f')]();};}function saveUpdates(_0x183ec3,_0x5c5488){return function(_0xf152f0){if(_0xf152f0){return _0xf152f0[_0xa3dc('0x20')](_0x183ec3)['then'](function(_0x1c3fc5){return _0x1c3fc5;});}return null;};}function removeEntity(_0x41e78c,_0x5c5b95){return function(_0x4f610e){if(_0x4f610e){return _0x4f610e[_0xa3dc('0x21')]()['then'](function(){_0x41e78c[_0xa3dc('0x18')](0xcc)[_0xa3dc('0x17')]();});}};}function handleEntityNotFound(_0x39386c,_0x42d022){return function(_0x199de0){if(!_0x199de0){_0x39386c['sendStatus'](0x194);}return _0x199de0;};}function handleError(_0x4d83e6,_0x654e8b){_0x654e8b=_0x654e8b||0x1f4;return function(_0x13be32){logger[_0xa3dc('0x22')](_0x13be32['stack']);if(_0x13be32['name']){delete _0x13be32[_0xa3dc('0x23')];}_0x4d83e6['status'](_0x654e8b)[_0xa3dc('0x24')](_0x13be32);};}exports[_0xa3dc('0x25')]=function(_0x4d0e82,_0x5b4bf9){var _0x3d1bec={},_0x5916c8={},_0x296bb2={'count':0x0,'rows':[]};var _0x572c5c=_[_0xa3dc('0x26')](db[_0xa3dc('0x27')][_0xa3dc('0x28')],function(_0x3bf13c){return{'name':_0x3bf13c[_0xa3dc('0x29')],'type':_0x3bf13c[_0xa3dc('0x2a')][_0xa3dc('0x2b')]};});_0x5916c8[_0xa3dc('0x2c')]=_[_0xa3dc('0x26')](_0x572c5c,_0xa3dc('0x23'));_0x5916c8['query']=_['keys'](_0x4d0e82[_0xa3dc('0x2d')]);_0x5916c8['filters']=_[_0xa3dc('0x2e')](_0x5916c8[_0xa3dc('0x2c')],_0x5916c8[_0xa3dc('0x2d')]);_0x3d1bec[_0xa3dc('0x2f')]=_[_0xa3dc('0x2e')](_0x5916c8[_0xa3dc('0x2c')],qs[_0xa3dc('0x30')](_0x4d0e82['query'][_0xa3dc('0x30')]));_0x3d1bec[_0xa3dc('0x2f')]=_0x3d1bec[_0xa3dc('0x2f')][_0xa3dc('0x31')]?_0x3d1bec[_0xa3dc('0x2f')]:_0x5916c8['model'];if(!_0x4d0e82[_0xa3dc('0x2d')]['hasOwnProperty'](_0xa3dc('0x32'))){_0x3d1bec[_0xa3dc('0x33')]=qs[_0xa3dc('0x33')](_0x4d0e82['query'][_0xa3dc('0x33')]);_0x3d1bec['offset']=qs[_0xa3dc('0x1b')](_0x4d0e82[_0xa3dc('0x2d')][_0xa3dc('0x1b')]);}_0x3d1bec[_0xa3dc('0x34')]=qs[_0xa3dc('0x35')](_0x4d0e82[_0xa3dc('0x2d')][_0xa3dc('0x35')]);_0x3d1bec[_0xa3dc('0x36')]=qs[_0xa3dc('0x37')](_['pick'](_0x4d0e82[_0xa3dc('0x2d')],_0x5916c8[_0xa3dc('0x37')]));if(_0x4d0e82[_0xa3dc('0x2d')][_0xa3dc('0x38')]){_0x3d1bec[_0xa3dc('0x36')]=_[_0xa3dc('0x39')](_0x3d1bec['where'],{'$or':_[_0xa3dc('0x26')](_0x572c5c,function(_0x1e9306){if(_0x1e9306['type']!==_0xa3dc('0x3a')){var _0x5c613d={};_0x5c613d[_0x1e9306[_0xa3dc('0x23')]]={'$like':'%'+_0x4d0e82['query']['filter']+'%'};return _0x5c613d;}})});}_0x3d1bec=_[_0xa3dc('0x39')]({},_0x3d1bec,_0x4d0e82[_0xa3dc('0x3b')]);var _0x44afc9={'where':_0x3d1bec['where']};return db[_0xa3dc('0x27')][_0xa3dc('0x1a')](_0x44afc9)[_0xa3dc('0x3c')](function(_0xe7e797){_0x296bb2[_0xa3dc('0x1a')]=_0xe7e797;if(_0x4d0e82[_0xa3dc('0x2d')][_0xa3dc('0x3d')]){_0x3d1bec['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xa3dc('0x3e')](_0x3d1bec);})[_0xa3dc('0x3c')](function(_0x5c9f7f){_0x296bb2[_0xa3dc('0x3f')]=_0x5c9f7f;return _0x296bb2;})[_0xa3dc('0x3c')](respondWithFilteredResult(_0x5b4bf9,_0x3d1bec))['catch'](handleError(_0x5b4bf9,null));};exports[_0xa3dc('0x40')]=function(_0x2f2eef,_0x5d1eb7){var _0x13dc55={'raw':!![],'where':{'id':_0x2f2eef[_0xa3dc('0x41')]['id']}},_0x852e0f={};_0x852e0f[_0xa3dc('0x2c')]=_['keys'](db[_0xa3dc('0x27')][_0xa3dc('0x28')]);_0x852e0f[_0xa3dc('0x2d')]=_['keys'](_0x2f2eef['query']);_0x852e0f[_0xa3dc('0x37')]=_[_0xa3dc('0x2e')](_0x852e0f['model'],_0x852e0f[_0xa3dc('0x2d')]);_0x13dc55[_0xa3dc('0x2f')]=_[_0xa3dc('0x2e')](_0x852e0f[_0xa3dc('0x2c')],qs[_0xa3dc('0x30')](_0x2f2eef[_0xa3dc('0x2d')][_0xa3dc('0x30')]));_0x13dc55['attributes']=_0x13dc55['attributes'][_0xa3dc('0x31')]?_0x13dc55['attributes']:_0x852e0f[_0xa3dc('0x2c')];if(_0x2f2eef['query'][_0xa3dc('0x3d')]){_0x13dc55['include']=[{'all':!![]}];}_0x13dc55=_[_0xa3dc('0x39')]({},_0x13dc55,_0x2f2eef[_0xa3dc('0x3b')]);return db[_0xa3dc('0x27')]['find'](_0x13dc55)['then'](handleEntityNotFound(_0x5d1eb7,null))['then'](respondWithResult(_0x5d1eb7,null))[_0xa3dc('0x42')](handleError(_0x5d1eb7,null));};exports[_0xa3dc('0x43')]=function(_0x546a61,_0x3ceca9){return db[_0xa3dc('0x27')]['create'](_0x546a61['body'],{})['then'](respondWithResult(_0x3ceca9,0xc9))[_0xa3dc('0x42')](handleError(_0x3ceca9,null));};exports[_0xa3dc('0x20')]=function(_0x2a2759,_0x1aab55){if(_0x2a2759['body']['id']){delete _0x2a2759[_0xa3dc('0x44')]['id'];}return db[_0xa3dc('0x27')][_0xa3dc('0x45')]({'where':{'id':_0x2a2759[_0xa3dc('0x41')]['id']}})[_0xa3dc('0x3c')](handleEntityNotFound(_0x1aab55,null))[_0xa3dc('0x3c')](saveUpdates(_0x2a2759[_0xa3dc('0x44')],null))['then'](respondWithResult(_0x1aab55,null))[_0xa3dc('0x42')](handleError(_0x1aab55,null));};exports['destroy']=function(_0x2d073c,_0x4d896e){return db['ChatTransferReport'][_0xa3dc('0x45')]({'where':{'id':_0x2d073c[_0xa3dc('0x41')]['id']}})[_0xa3dc('0x3c')](handleEntityNotFound(_0x4d896e,null))['then'](removeEntity(_0x4d896e,null))[_0xa3dc('0x42')](handleError(_0x4d896e,null));};exports[_0xa3dc('0x46')]=function(_0x5a7690,_0xe87dc5){return db[_0xa3dc('0x27')][_0xa3dc('0x46')]()['then'](respondWithResult(_0xe87dc5,null))[_0xa3dc('0x42')](handleError(_0xe87dc5,null));}; \ No newline at end of file +var _0x15d6=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','filters','filter','merge','VIRTUAL','options','where','count','include','findAll','show','rawAttributes','length','find','create','body','catch','params','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x15d6,0x192));var _0x615d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x15d6[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x615d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x615d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x615d('0x2'));var moment=require('moment');var BPromise=require(_0x615d('0x3'));var Mustache=require(_0x615d('0x4'));var util=require(_0x615d('0x5'));var path=require(_0x615d('0x6'));var sox=require(_0x615d('0x7'));var csv=require(_0x615d('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x615d('0x9'));var crypto=require(_0x615d('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x615d('0x8'));var querystring=require(_0x615d('0xb'));var Papa=require(_0x615d('0xc'));var Redis=require(_0x615d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x615d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x615d('0xf'))(_0x615d('0x10'));var utils=require(_0x615d('0x11'));var config=require(_0x615d('0x12'));var db=require(_0x615d('0x13'))['db'];function respondWithStatusCode(_0x40ecb6,_0x102290){_0x102290=_0x102290||0xcc;return function(_0x297541){if(_0x297541){return _0x40ecb6[_0x615d('0x14')](_0x102290);}return _0x40ecb6[_0x615d('0x15')](_0x102290)[_0x615d('0x16')]();};}function respondWithResult(_0x40711e,_0x4260fb){_0x4260fb=_0x4260fb||0xc8;return function(_0x13e6fc){if(_0x13e6fc){return _0x40711e['status'](_0x4260fb)[_0x615d('0x17')](_0x13e6fc);}};}function respondWithFilteredResult(_0x48bc9b,_0x2e99af){return function(_0x11c93d){if(_0x11c93d){var _0x169141=_0x11c93d['count'],_0x1253e1=_0x2e99af['offset'],_0x1108e8=_0x2e99af[_0x615d('0x18')]+_0x2e99af['limit'],_0x56b30c;if(_0x1108e8>=_0x169141){_0x1108e8=_0x169141;_0x56b30c=0xc8;}else{_0x56b30c=0xce;}_0x48bc9b['status'](_0x56b30c);return _0x48bc9b['set'](_0x615d('0x19'),_0x1253e1+'-'+_0x1108e8+'/'+_0x169141)[_0x615d('0x17')](_0x11c93d);}return null;};}function patchUpdates(_0x55976d){return function(_0x3c29f8){try{jsonpatch[_0x615d('0x1a')](_0x3c29f8,_0x55976d,!![]);}catch(_0x4ad3a7){return BPromise[_0x615d('0x1b')](_0x4ad3a7);}return _0x3c29f8['save']();};}function saveUpdates(_0xa853c8,_0x3a2586){return function(_0x41c3db){if(_0x41c3db){return _0x41c3db[_0x615d('0x1c')](_0xa853c8)[_0x615d('0x1d')](function(_0x261c3d){return _0x261c3d;});}return null;};}function removeEntity(_0x25b008,_0x5963f8){return function(_0x35c5b2){if(_0x35c5b2){return _0x35c5b2[_0x615d('0x1e')]()[_0x615d('0x1d')](function(){_0x25b008['status'](0xcc)[_0x615d('0x16')]();});}};}function handleEntityNotFound(_0x3b1055,_0x574a9d){return function(_0x36b7db){if(!_0x36b7db){_0x3b1055[_0x615d('0x14')](0x194);}return _0x36b7db;};}function handleError(_0x3fc1ba,_0x57294a){_0x57294a=_0x57294a||0x1f4;return function(_0x11f017){logger[_0x615d('0x1f')](_0x11f017[_0x615d('0x20')]);if(_0x11f017[_0x615d('0x21')]){delete _0x11f017[_0x615d('0x21')];}_0x3fc1ba[_0x615d('0x15')](_0x57294a)[_0x615d('0x22')](_0x11f017);};}exports[_0x615d('0x23')]=function(_0xc3008b,_0x2359b6){var _0x2b8e36={},_0x4444f6={},_0x5da926={'count':0x0,'rows':[]};var _0x4b82d6=_[_0x615d('0x24')](db[_0x615d('0x25')]['rawAttributes'],function(_0x139641){return{'name':_0x139641[_0x615d('0x26')],'type':_0x139641[_0x615d('0x27')][_0x615d('0x28')]};});_0x4444f6[_0x615d('0x29')]=_[_0x615d('0x24')](_0x4b82d6,'name');_0x4444f6[_0x615d('0x2a')]=_[_0x615d('0x2b')](_0xc3008b[_0x615d('0x2a')]);_0x4444f6['filters']=_[_0x615d('0x2c')](_0x4444f6[_0x615d('0x29')],_0x4444f6[_0x615d('0x2a')]);_0x2b8e36['attributes']=_[_0x615d('0x2c')](_0x4444f6['model'],qs[_0x615d('0x2d')](_0xc3008b['query'][_0x615d('0x2d')]));_0x2b8e36[_0x615d('0x2e')]=_0x2b8e36[_0x615d('0x2e')]['length']?_0x2b8e36[_0x615d('0x2e')]:_0x4444f6[_0x615d('0x29')];if(!_0xc3008b['query'][_0x615d('0x2f')](_0x615d('0x30'))){_0x2b8e36[_0x615d('0x31')]=qs[_0x615d('0x31')](_0xc3008b['query'][_0x615d('0x31')]);_0x2b8e36['offset']=qs['offset'](_0xc3008b['query'][_0x615d('0x18')]);}_0x2b8e36[_0x615d('0x32')]=qs[_0x615d('0x33')](_0xc3008b[_0x615d('0x2a')][_0x615d('0x33')]);_0x2b8e36['where']=qs[_0x615d('0x34')](_['pick'](_0xc3008b['query'],_0x4444f6[_0x615d('0x34')]));if(_0xc3008b[_0x615d('0x2a')][_0x615d('0x35')]){_0x2b8e36['where']=_[_0x615d('0x36')](_0x2b8e36['where'],{'$or':_[_0x615d('0x24')](_0x4b82d6,function(_0x59952e){if(_0x59952e[_0x615d('0x27')]!==_0x615d('0x37')){var _0x575ef0={};_0x575ef0[_0x59952e[_0x615d('0x21')]]={'$like':'%'+_0xc3008b[_0x615d('0x2a')][_0x615d('0x35')]+'%'};return _0x575ef0;}})});}_0x2b8e36=_[_0x615d('0x36')]({},_0x2b8e36,_0xc3008b[_0x615d('0x38')]);var _0x1c80b5={'where':_0x2b8e36[_0x615d('0x39')]};return db[_0x615d('0x25')][_0x615d('0x3a')](_0x1c80b5)[_0x615d('0x1d')](function(_0xb17584){_0x5da926['count']=_0xb17584;if(_0xc3008b[_0x615d('0x2a')]['includeAll']){_0x2b8e36[_0x615d('0x3b')]=[{'all':!![]}];}return db[_0x615d('0x25')][_0x615d('0x3c')](_0x2b8e36);})[_0x615d('0x1d')](function(_0x3093aa){_0x5da926['rows']=_0x3093aa;return _0x5da926;})[_0x615d('0x1d')](respondWithFilteredResult(_0x2359b6,_0x2b8e36))['catch'](handleError(_0x2359b6,null));};exports[_0x615d('0x3d')]=function(_0x28c1f5,_0x142cb7){var _0x2ed2cf={'raw':!![],'where':{'id':_0x28c1f5['params']['id']}},_0x41818b={};_0x41818b[_0x615d('0x29')]=_[_0x615d('0x2b')](db[_0x615d('0x25')][_0x615d('0x3e')]);_0x41818b[_0x615d('0x2a')]=_[_0x615d('0x2b')](_0x28c1f5[_0x615d('0x2a')]);_0x41818b[_0x615d('0x34')]=_[_0x615d('0x2c')](_0x41818b['model'],_0x41818b[_0x615d('0x2a')]);_0x2ed2cf[_0x615d('0x2e')]=_[_0x615d('0x2c')](_0x41818b['model'],qs[_0x615d('0x2d')](_0x28c1f5[_0x615d('0x2a')][_0x615d('0x2d')]));_0x2ed2cf[_0x615d('0x2e')]=_0x2ed2cf['attributes'][_0x615d('0x3f')]?_0x2ed2cf[_0x615d('0x2e')]:_0x41818b[_0x615d('0x29')];if(_0x28c1f5[_0x615d('0x2a')]['includeAll']){_0x2ed2cf['include']=[{'all':!![]}];}_0x2ed2cf=_[_0x615d('0x36')]({},_0x2ed2cf,_0x28c1f5['options']);return db[_0x615d('0x25')][_0x615d('0x40')](_0x2ed2cf)[_0x615d('0x1d')](handleEntityNotFound(_0x142cb7,null))['then'](respondWithResult(_0x142cb7,null))['catch'](handleError(_0x142cb7,null));};exports[_0x615d('0x41')]=function(_0x558615,_0x17656f){return db['ChatTransferReport'][_0x615d('0x41')](_0x558615[_0x615d('0x42')],{})[_0x615d('0x1d')](respondWithResult(_0x17656f,0xc9))[_0x615d('0x43')](handleError(_0x17656f,null));};exports[_0x615d('0x1c')]=function(_0x56bff0,_0x7b5bcd){if(_0x56bff0['body']['id']){delete _0x56bff0['body']['id'];}return db[_0x615d('0x25')][_0x615d('0x40')]({'where':{'id':_0x56bff0[_0x615d('0x44')]['id']}})['then'](handleEntityNotFound(_0x7b5bcd,null))['then'](saveUpdates(_0x56bff0[_0x615d('0x42')],null))[_0x615d('0x1d')](respondWithResult(_0x7b5bcd,null))[_0x615d('0x43')](handleError(_0x7b5bcd,null));};exports[_0x615d('0x1e')]=function(_0x3041d2,_0x2cec39){return db[_0x615d('0x25')][_0x615d('0x40')]({'where':{'id':_0x3041d2[_0x615d('0x44')]['id']}})[_0x615d('0x1d')](handleEntityNotFound(_0x2cec39,null))[_0x615d('0x1d')](removeEntity(_0x2cec39,null))[_0x615d('0x43')](handleError(_0x2cec39,null));};exports['describe']=function(_0x205b7d,_0x59da71){return db[_0x615d('0x25')][_0x615d('0x45')]()['then'](respondWithResult(_0x59da71,null))[_0x615d('0x43')](handleError(_0x59da71,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 40deddc..457995e 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 _0x374c=['bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','api','moment'];(function(_0x462eab,_0x98f630){var _0x2d312c=function(_0x418c28){while(--_0x418c28){_0x462eab['push'](_0x462eab['shift']());}};_0x2d312c(++_0x98f630);}(_0x374c,0xc1));var _0xc374=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x374c[_0x45f951];return _0x24756c;};'use strict';var _=require('lodash');var util=require(_0xc374('0x0'));var logger=require('../../config/logger')(_0xc374('0x1'));var moment=require(_0xc374('0x2'));var BPromise=require(_0xc374('0x3'));var rp=require(_0xc374('0x4'));var fs=require('fs');var path=require(_0xc374('0x5'));var rimraf=require(_0xc374('0x6'));var config=require(_0xc374('0x7'));var attributes=require(_0xc374('0x8'));module[_0xc374('0x9')]=function(_0x301072,_0x29dd10){return _0x301072[_0xc374('0xa')](_0xc374('0xb'),attributes,{'tableName':_0xc374('0xc'),'paranoid':![],'indexes':[{'name':_0xc374('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb234=['../../config/logger','api','bluebird','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x36e19c,_0x11388b){var _0x5e39eb=function(_0x5c441a){while(--_0x5c441a){_0x36e19c['push'](_0x36e19c['shift']());}};_0x5e39eb(++_0x11388b);}(_0xb234,0x150));var _0x4b23=function(_0x296ed0,_0x5db8ed){_0x296ed0=_0x296ed0-0x0;var _0x4528ae=_0xb234[_0x296ed0];return _0x4528ae;};'use strict';var _=require(_0x4b23('0x0'));var util=require(_0x4b23('0x1'));var logger=require(_0x4b23('0x2'))(_0x4b23('0x3'));var moment=require('moment');var BPromise=require(_0x4b23('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b23('0x5'));var rimraf=require('rimraf');var config=require(_0x4b23('0x6'));var attributes=require(_0x4b23('0x7'));module[_0x4b23('0x8')]=function(_0x12c3dc,_0x4abd0d){return _0x12c3dc[_0x4b23('0x9')](_0x4b23('0xa'),attributes,{'tableName':_0x4b23('0xb'),'paranoid':![],'indexes':[{'name':_0x4b23('0xc'),'fields':[_0x4b23('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 86c6fe6..208ec98 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 _0x9211=['../../config/logger','jayson/promise','http','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x35c12c,_0x378ba0){var _0x2bab3a=function(_0x43eeb2){while(--_0x43eeb2){_0x35c12c['push'](_0x35c12c['shift']());}};_0x2bab3a(++_0x378ba0);}(_0x9211,0x72));var _0x1921=function(_0x3e2569,_0xb5c0d9){_0x3e2569=_0x3e2569-0x0;var _0x310f79=_0x9211[_0x3e2569];return _0x310f79;};'use strict';var _=require('lodash');var util=require(_0x1921('0x0'));var moment=require(_0x1921('0x1'));var BPromise=require(_0x1921('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1921('0x3'));var db=require(_0x1921('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1921('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1921('0x6'));var client=jayson['client'][_0x1921('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf6ad56,_0x36ad7d,_0x5034c0){return new BPromise(function(_0x860c90,_0x10d511){return client['request'](_0xf6ad56,_0x5034c0)['then'](function(_0x1e18c0){logger[_0x1921('0x8')]('ChatTransferReport,\x20%s,\x20%s',_0x36ad7d,_0x1921('0x9'));logger['debug'](_0x1921('0xa'),_0x36ad7d,_0x1921('0x9'),JSON[_0x1921('0xb')](_0x1e18c0));if(_0x1e18c0[_0x1921('0xc')]){if(_0x1e18c0[_0x1921('0xc')][_0x1921('0xd')]===0x1f4){logger['error'](_0x1921('0xe'),_0x36ad7d,_0x1e18c0[_0x1921('0xc')][_0x1921('0xf')]);return _0x10d511(_0x1e18c0[_0x1921('0xc')][_0x1921('0xf')]);}logger[_0x1921('0xc')](_0x1921('0xe'),_0x36ad7d,_0x1e18c0[_0x1921('0xc')][_0x1921('0xf')]);return _0x860c90(_0x1e18c0[_0x1921('0xc')][_0x1921('0xf')]);}else{logger['info'](_0x1921('0xe'),_0x36ad7d,_0x1921('0x9'));_0x860c90(_0x1e18c0['result'][_0x1921('0xf')]);}})[_0x1921('0x10')](function(_0x4d1204){logger[_0x1921('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x36ad7d,_0x4d1204);_0x10d511(_0x4d1204);});});} \ No newline at end of file +var _0x1904=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x1904,0x18a));var _0x4190=function(_0x990992,_0x4888f9){_0x990992=_0x990992-0x0;var _0x184a86=_0x1904[_0x990992];return _0x184a86;};'use strict';var _=require('lodash');var util=require(_0x4190('0x0'));var moment=require('moment');var BPromise=require(_0x4190('0x1'));var rs=require(_0x4190('0x2'));var fs=require('fs');var Redis=require(_0x4190('0x3'));var db=require(_0x4190('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4190('0x5'));var config=require(_0x4190('0x6'));var jayson=require(_0x4190('0x7'));var client=jayson[_0x4190('0x8')][_0x4190('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33e706,_0x29aab2,_0x3c62b3){return new BPromise(function(_0x24916d,_0x743790){return client[_0x4190('0xa')](_0x33e706,_0x3c62b3)[_0x4190('0xb')](function(_0x91d6ea){logger[_0x4190('0xc')](_0x4190('0xd'),_0x29aab2,'request\x20sent');logger[_0x4190('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x29aab2,_0x4190('0xf'),JSON['stringify'](_0x91d6ea));if(_0x91d6ea[_0x4190('0x10')]){if(_0x91d6ea[_0x4190('0x10')][_0x4190('0x11')]===0x1f4){logger[_0x4190('0x10')](_0x4190('0xd'),_0x29aab2,_0x91d6ea['error']['message']);return _0x743790(_0x91d6ea[_0x4190('0x10')][_0x4190('0x12')]);}logger[_0x4190('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x29aab2,_0x91d6ea['error'][_0x4190('0x12')]);return _0x24916d(_0x91d6ea[_0x4190('0x10')][_0x4190('0x12')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x29aab2,'request\x20sent');_0x24916d(_0x91d6ea[_0x4190('0x13')][_0x4190('0x12')]);}})[_0x4190('0x14')](function(_0xbc7e4){logger['error'](_0x4190('0xd'),_0x29aab2,_0xbc7e4);_0x743790(_0xbc7e4);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 5e8e092..a1c09a5 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(_0x1c6d51,_0x21a937){var _0x42781c=function(_0x3ab6ab){while(--_0x3ab6ab){_0x1c6d51['push'](_0x1c6d51['shift']());}};_0x42781c(++_0x21a937);}(_0x0b0e,0x187));var _0xe0b0=function(_0x47794f,_0x12c9b3){_0x47794f=_0x47794f-0x0;var _0x2ca51d=_0x0b0e[_0x47794f];return _0x2ca51d;};'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 _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(_0xf634b7,_0x447d13){var _0x515746=function(_0x58b0be){while(--_0x58b0be){_0xf634b7['push'](_0xf634b7['shift']());}};_0x515746(++_0x447d13);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3d430d,_0x4033f7){_0x3d430d=_0x3d430d-0x0;var _0x256271=_0x5f2f[_0x3d430d];return _0x256271;};'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('./chatTransferReport.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/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index be549f6..18ee5f3 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 _0xe2f2=['All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','star','thumb','TEXT','input','text','name','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0xe2f2,0x153));var _0x2e2f=function(_0xfb72ff,_0xe6df50){_0xfb72ff=_0xfb72ff-0x0;var _0x37f88c=_0xe2f2[_0xfb72ff];return _0x37f88c;};'use strict';var Sequelize=require(_0x2e2f('0x0'));var rs=require(_0x2e2f('0x1'));module[_0x2e2f('0x2')]={'name':{'type':Sequelize[_0x2e2f('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x2e2f('0x3')],'allowNull':![],'unique':_0x2e2f('0x4')},'description':{'type':Sequelize[_0x2e2f('0x3')]},'mapKey':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':_0x2e2f('0x5')},'mapKeyOffline':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2e2f('0x6')},'customerAlias':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2e2f('0x3')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2e2f('0x3')],'allowNull':![],'defaultValue':_0x2e2f('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2e2f('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2e2f('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2e2f('0xa')](_0x2e2f('0xb'),_0x2e2f('0xc')),'defaultValue':_0x2e2f('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x2e2f('0xd')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x2e2f('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x2e2f('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x2e2f('0x10')},'download_transcript':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2e2f('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x2e2f('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':_0x2e2f('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':_0x2e2f('0x13')},'noteTitle':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':_0x2e2f('0x14')},'placeholderMessage':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x2e2f('0xa')](_0x2e2f('0x15'),_0x2e2f('0x16')),'defaultValue':_0x2e2f('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x2e2f('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2e2f('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x2e2f('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x2e2f('0x19'),'required':!![]},'props':{'title':_0x2e2f('0x1a'),'helpText':''}},{'type':_0x2e2f('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x2e2f('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this[_0x2e2f('0x1b')](_0x2e2f('0x1c'))):{};},'set':function(_0x26261b){return this[_0x2e2f('0x1d')]('onlineForm',JSON[_0x2e2f('0x1e')](_0x26261b));}},'offlineForm':{'type':Sequelize[_0x2e2f('0x17')],'defaultValue':function(){return JSON[_0x2e2f('0x1e')]({'items':[{'type':_0x2e2f('0x18'),'props':{'title':_0x2e2f('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2e2f('0x5'),'type':_0x2e2f('0x5')},'variable':null},{'type':_0x2e2f('0x1f'),'config':{'placeholder':_0x2e2f('0x20')},'props':{'title':_0x2e2f('0x20'),'helpText':_0x2e2f('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x2e2f('0x22'))?JSON[_0x2e2f('0x23')](this[_0x2e2f('0x1b')](_0x2e2f('0x22'))):{};},'set':function(_0x398d2b){return this['setDataValue'](_0x2e2f('0x22'),JSON['stringify'](_0x398d2b));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x2e2f('0x24')]();}},'autoclose':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2e2f('0x3')]},'forwardOffline':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2e2f('0x3')]},'waitingTitle':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':_0x2e2f('0x25')},'waitingMessage':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':_0x2e2f('0x26')},'offlineMessageBody':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x2e2f('0x27')},'sendUnmanaged':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2e2f('0x17')]},'showAgentAvatar':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2e2f('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2e2f('0x28');}},'notificationSound':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':_0x2e2f('0x29')},'verticalAlignment':{'type':Sequelize[_0x2e2f('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':_0x2e2f('0x2a')},'defaultTitle':{'type':Sequelize[_0x2e2f('0x3')]},'customerAvatar':{'type':Sequelize[_0x2e2f('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2e2f('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e2f('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2e2f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2e2f('0x3')],'defaultValue':_0x2e2f('0x2c')},'systemAvatar':{'type':Sequelize[_0x2e2f('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x2e2f('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x2e2f('0x9')],'defaultValue':![],'comment':_0x2e2f('0x2e'),'set':function(_0x40edad){if(!_0x40edad)this[_0x2e2f('0x1d')]('mandatoryDispositionPauseId',null);this[_0x2e2f('0x1d')]('mandatoryDisposition',_0x40edad);}}}; \ No newline at end of file +var _0x81be=['#ffffff','BOOLEAN','rounded','squared','Chat','Send','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','ENUM','star','thumb','stringify','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','exports','STRING','address','email','Agent','#9f946a'];(function(_0x31492d,_0x58b627){var _0x105e84=function(_0x5dcf3c){while(--_0x5dcf3c){_0x31492d['push'](_0x31492d['shift']());}};_0x105e84(++_0x58b627);}(_0x81be,0x12e));var _0xe81b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x81be[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xe81b('0x0')]={'name':{'type':Sequelize[_0xe81b('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xe81b('0x1')],'allowNull':![],'unique':_0xe81b('0x2')},'description':{'type':Sequelize[_0xe81b('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0x3')},'key':{'type':Sequelize[_0xe81b('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0x4')},'customerAlias':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe81b('0x1')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe81b('0x1')],'allowNull':![],'defaultValue':_0xe81b('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe81b('0x1')],'allowNull':![],'defaultValue':_0xe81b('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xe81b('0x8'),_0xe81b('0x9')),'defaultValue':_0xe81b('0x8')},'header_online':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0xa')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xe81b('0xb')},'header_offline':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xe81b('0xc')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xe81b('0xe')]},'closingQuestion':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0x10')},'noteTitle':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0x11')},'closingMessage':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0xb')},'skipMessageButton':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xe81b('0x12')](_0xe81b('0x13'),_0xe81b('0x14')),'defaultValue':_0xe81b('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xe81b('0xc')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe81b('0xe')],'defaultValue':function(){return JSON[_0xe81b('0x15')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xe81b('0x16'),'type':_0xe81b('0x17'),'required':!![]},'props':{'title':_0xe81b('0x16'),'helpText':''}},{'type':'input','props':{'title':_0xe81b('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xe81b('0x3'),'type':_0xe81b('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe81b('0x18')](_0xe81b('0x19'))?JSON[_0xe81b('0x1a')](this[_0xe81b('0x18')]('onlineForm')):{};},'set':function(_0x21d82e){return this[_0xe81b('0x1b')](_0xe81b('0x19'),JSON[_0xe81b('0x15')](_0x21d82e));}},'offlineForm':{'type':Sequelize[_0xe81b('0xe')],'defaultValue':function(){return JSON[_0xe81b('0x15')]({'items':[{'type':'input','props':{'title':_0xe81b('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xe81b('0x3'),'type':_0xe81b('0x3')},'variable':null},{'type':_0xe81b('0x1c'),'config':{'placeholder':_0xe81b('0x1d')},'props':{'title':_0xe81b('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xe81b('0x18')](_0xe81b('0x1e'))?JSON[_0xe81b('0x1a')](this['getDataValue']('offlineForm')):{};},'set':function(_0x80a907){return this[_0xe81b('0x1b')]('offlineForm',JSON['stringify'](_0x80a907));}},'token':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':function(){return rs[_0xe81b('0x1f')]();}},'autoclose':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe81b('0x1')]},'waitingTitle':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0x20')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe81b('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xe81b('0x22')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe81b('0x23')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xe81b('0x24')},'sendUnmanaged':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe81b('0x1')]},'notificationTemplate':{'type':Sequelize[_0xe81b('0xe')],'defaultValue':function(){return _0xe81b('0x25');}},'notificationSound':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xe81b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0x26')},'verticalAlignment':{'type':Sequelize[_0xe81b('0xc')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0x27')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xe81b('0xc')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe81b('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe81b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe81b('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe81b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe81b('0x1')],'defaultValue':_0xe81b('0x29')},'systemAvatar':{'type':Sequelize[_0xe81b('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe81b('0xc')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe81b('0x2a'),'set':function(_0x25819f){if(!_0x25819f)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xe81b('0x1b')](_0xe81b('0x2b'),_0x25819f);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 79ae8f7..140310d 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 _0x72c0=['ChatApplication','Applications','account','list','List','applications','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','firstName','messageId','update','created','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','includes','CmList','defaults','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailServerOut','Smtp','service','host','port','secure','authentication','pass','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','addInteraction','omit','getInteractions','Owner','fullname','Tag','tag','Command','getSnippet','interval','timezone','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','getProactiveActions','getLicense','License','increment','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.js','remote','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','textColor','bulkCreate','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','localhost','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','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','destroy','get','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','include','find','create','body','user','role','ChatWebsites','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','hasOwnProperty','order','filter','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','custom','isNil','sitepic','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmContact','Contacts','DESC'];(function(_0x485757,_0x5867f5){var _0x411b93=function(_0x3a331c){while(--_0x3a331c){_0x485757['push'](_0x485757['shift']());}};_0x411b93(++_0x5867f5);}(_0x72c0,0x18f));var _0x072c=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x72c0[_0x2ec461];return _0x28603d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x072c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x072c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x072c('0x2'));var moment=require(_0x072c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x072c('0x4'));var path=require('path');var sox=require(_0x072c('0x5'));var csv=require(_0x072c('0x6'));var ejs=require(_0x072c('0x7'));var fs=require('fs');var _=require(_0x072c('0x8'));var squel=require(_0x072c('0x9'));var crypto=require(_0x072c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x072c('0xb'));var toCsv=require(_0x072c('0x6'));var querystring=require('querystring');var Papa=require(_0x072c('0xc'));var Redis=require(_0x072c('0xd'));var authService=require(_0x072c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x072c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x072c('0x10'))(_0x072c('0x11'));var utils=require('../../config/utils');var config=require(_0x072c('0x12'));var db=require('../../mysqldb')['db'];config[_0x072c('0x13')]=_['defaults'](config[_0x072c('0x13')],{'host':_0x072c('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x072c('0x13')]));require('./chatWebsite.socket')[_0x072c('0x15')](socket);var jayson=require(_0x072c('0x16'));var client=jayson[_0x072c('0x17')][_0x072c('0x18')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson['client'][_0x072c('0x18')]({'port':0x232b});function checkPasswordPattern(_0x4986f3,_0x3a1779,_0x52717c){if(_0x52717c){var _0x5a7340=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a7340['test'](_0x3a1779)){return _0x4986f3;}else{throw new db[(_0x072c('0x19'))][(_0x072c('0x1a'))](_0x072c('0x1b'));}}else{return _0x4986f3;}}function respondWithRpcPromise(_0x12885a,_0x3a0034,_0x252f14,_0x13cdd1){return new BPromise(function(_0x3ece1f,_0x48bcaa){var _0x3bf08a=_0x13cdd1||client;return _0x3bf08a[_0x072c('0x1c')](_0x12885a,_0x252f14)[_0x072c('0x1d')](function(_0x4c3b19){logger[_0x072c('0x1e')](_0x072c('0x1f'),_0x3a0034,_0x072c('0x20'));logger['debug'](_0x072c('0x21'),_0x3a0034,_0x072c('0x20'),JSON[_0x072c('0x22')](_0x4c3b19));if(_0x4c3b19[_0x072c('0x23')]){if(_0x4c3b19[_0x072c('0x23')][_0x072c('0x24')]===0x1f4){logger['error'](_0x072c('0x1f'),_0x3a0034,_0x4c3b19[_0x072c('0x23')][_0x072c('0x25')]);return _0x48bcaa(_0x4c3b19[_0x072c('0x23')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3a0034,_0x4c3b19[_0x072c('0x23')]['message']);return _0x3ece1f(_0x4c3b19[_0x072c('0x23')][_0x072c('0x25')]);}else{logger[_0x072c('0x1e')](_0x072c('0x1f'),_0x3a0034,_0x072c('0x20'));_0x3ece1f(_0x4c3b19['result'][_0x072c('0x25')]);}})['catch'](function(_0x500327){logger[_0x072c('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x3a0034,_0x500327);_0x48bcaa(_0x500327);});});}function respondWithStatusCode(_0x2f85e6,_0x2b4732){_0x2b4732=_0x2b4732||0xcc;return function(_0x159d2b){if(_0x159d2b){return _0x2f85e6[_0x072c('0x26')](_0x2b4732);}return _0x2f85e6[_0x072c('0x27')](_0x2b4732)['end']();};}function respondWithResult(_0x30954d,_0x4747e1){_0x4747e1=_0x4747e1||0xc8;return function(_0x15eef6){if(_0x15eef6){return _0x30954d[_0x072c('0x27')](_0x4747e1)[_0x072c('0x28')](_0x15eef6);}};}function respondWithFilteredResult(_0x4cdd04,_0x132d3f){return function(_0x1c7979){if(_0x1c7979){var _0x2010e0=_0x1c7979[_0x072c('0x29')],_0x361ad1=_0x132d3f['offset'],_0x2d040a=_0x132d3f[_0x072c('0x2a')]+_0x132d3f[_0x072c('0x2b')],_0x2b6c5b;if(_0x2d040a>=_0x2010e0){_0x2d040a=_0x2010e0;_0x2b6c5b=0xc8;}else{_0x2b6c5b=0xce;}_0x4cdd04[_0x072c('0x27')](_0x2b6c5b);return _0x4cdd04['set'](_0x072c('0x2c'),_0x361ad1+'-'+_0x2d040a+'/'+_0x2010e0)[_0x072c('0x28')](_0x1c7979);}return null;};}function patchUpdates(_0x1021de){return function(_0x2c75a6){try{jsonpatch[_0x072c('0x2d')](_0x2c75a6,_0x1021de,!![]);}catch(_0x5e5d1a){return BPromise[_0x072c('0x2e')](_0x5e5d1a);}return _0x2c75a6['save']();};}function saveUpdates(_0x5ea9cc,_0x3e1876){return function(_0x36aad7){if(_0x36aad7){return _0x36aad7['update'](_0x5ea9cc)['then'](function(_0x3e4940){return _0x3e4940;});}return null;};}function removeEntity(_0x4c6336,_0x425120){return function(_0x280968){if(_0x280968){return _0x280968[_0x072c('0x2f')]()['then'](function(){var _0x52d142=_0x280968[_0x072c('0x30')]({'plain':!![]});var _0x40961b='ChatWebsites';return db[_0x072c('0x31')][_0x072c('0x2f')]({'where':{'type':_0x40961b,'resourceId':_0x52d142['id']}})[_0x072c('0x1d')](function(){return _0x280968;});})[_0x072c('0x1d')](function(){_0x4c6336['status'](0xcc)[_0x072c('0x32')]();});}};}function handleEntityNotFound(_0x4a129e,_0x34b01e){return function(_0x3ef9a5){if(!_0x3ef9a5){_0x4a129e[_0x072c('0x26')](0x194);}return _0x3ef9a5;};}function handleError(_0x56dea8,_0x2cdc09){_0x2cdc09=_0x2cdc09||0x1f4;return function(_0x1e6189){logger[_0x072c('0x23')](_0x1e6189[_0x072c('0x33')]);if(_0x1e6189[_0x072c('0x34')]){delete _0x1e6189[_0x072c('0x34')];}_0x56dea8[_0x072c('0x27')](_0x2cdc09)[_0x072c('0x35')](_0x1e6189);};}exports[_0x072c('0x36')]=function(_0x4dd11d,_0x5ba7db){var _0x50ec4c={'include':[{'model':db[_0x072c('0x37')],'as':_0x072c('0x38')}]},_0x33201b={},_0x18ba8c={'count':0x0,'rows':[]};var _0x39ee3f=_['map'](db[_0x072c('0x39')][_0x072c('0x3a')],function(_0x358543){return{'name':_0x358543[_0x072c('0x3b')],'type':_0x358543[_0x072c('0x3c')][_0x072c('0x3d')]};});_0x33201b['model']=_[_0x072c('0x3e')](_0x39ee3f,_0x072c('0x34'));_0x33201b['query']=_[_0x072c('0x3f')](_0x4dd11d[_0x072c('0x40')]);_0x33201b[_0x072c('0x41')]=_[_0x072c('0x42')](_0x33201b[_0x072c('0x43')],_0x33201b[_0x072c('0x40')]);_0x50ec4c[_0x072c('0x44')]=_[_0x072c('0x42')](_0x33201b[_0x072c('0x43')],qs[_0x072c('0x45')](_0x4dd11d[_0x072c('0x40')][_0x072c('0x45')]));_0x50ec4c['attributes']=_0x50ec4c[_0x072c('0x44')][_0x072c('0x46')]?_0x50ec4c[_0x072c('0x44')]:_0x33201b[_0x072c('0x43')];if(!_0x4dd11d[_0x072c('0x40')]['hasOwnProperty'](_0x072c('0x47'))){_0x50ec4c[_0x072c('0x2b')]=qs[_0x072c('0x2b')](_0x4dd11d[_0x072c('0x40')][_0x072c('0x2b')]);_0x50ec4c[_0x072c('0x2a')]=qs[_0x072c('0x2a')](_0x4dd11d['query'][_0x072c('0x2a')]);}_0x50ec4c['order']=qs[_0x072c('0x48')](_0x4dd11d['query'][_0x072c('0x48')]);_0x50ec4c['where']=qs[_0x072c('0x41')](_[_0x072c('0x49')](_0x4dd11d[_0x072c('0x40')],_0x33201b[_0x072c('0x41')]));if(_0x4dd11d[_0x072c('0x40')]['filter']){_0x50ec4c[_0x072c('0x4a')]=_[_0x072c('0x4b')](_0x50ec4c[_0x072c('0x4a')],{'$or':_['map'](_0x39ee3f,function(_0x1ab4f1){if(_0x1ab4f1[_0x072c('0x3c')]!==_0x072c('0x4c')){var _0x28c2ff={};_0x28c2ff[_0x1ab4f1[_0x072c('0x34')]]={'$like':'%'+_0x4dd11d[_0x072c('0x40')]['filter']+'%'};return _0x28c2ff;}})});}_0x50ec4c=_[_0x072c('0x4b')]({},_0x50ec4c,_0x4dd11d['options']);var _0x44d046={'where':_0x50ec4c['where']};return db['ChatWebsite'][_0x072c('0x29')](_0x44d046)[_0x072c('0x1d')](function(_0x1614dd){_0x18ba8c['count']=_0x1614dd;if(_0x4dd11d['query'][_0x072c('0x4d')]){_0x50ec4c['include']=[{'all':!![]}];}return db[_0x072c('0x39')][_0x072c('0x4e')](_0x50ec4c);})[_0x072c('0x1d')](function(_0x3e6736){_0x18ba8c[_0x072c('0x4f')]=_0x3e6736;return _0x18ba8c;})[_0x072c('0x1d')](respondWithFilteredResult(_0x5ba7db,_0x50ec4c))[_0x072c('0x50')](handleError(_0x5ba7db,null));};exports[_0x072c('0x51')]=function(_0x542bb0,_0x27ad43){var _0x22b143={'raw':![],'where':{'id':_0x542bb0['params']['id']},'include':[{'model':db[_0x072c('0x37')],'as':_0x072c('0x38')}]},_0x12380d={};_0x12380d['model']=_['keys'](db['ChatWebsite']['rawAttributes']);_0x12380d[_0x072c('0x40')]=_['keys'](_0x542bb0[_0x072c('0x40')]);_0x12380d[_0x072c('0x41')]=_[_0x072c('0x42')](_0x12380d[_0x072c('0x43')],_0x12380d['query']);_0x22b143[_0x072c('0x44')]=_[_0x072c('0x42')](_0x12380d[_0x072c('0x43')],qs[_0x072c('0x45')](_0x542bb0[_0x072c('0x40')][_0x072c('0x45')]));_0x22b143[_0x072c('0x44')]=_0x22b143['attributes'][_0x072c('0x46')]?_0x22b143[_0x072c('0x44')]:_0x12380d[_0x072c('0x43')];if(_0x542bb0['query'][_0x072c('0x4d')]){_0x22b143[_0x072c('0x52')]=[{'all':!![]}];}_0x22b143=_[_0x072c('0x4b')]({},_0x22b143,_0x542bb0['options']);return db[_0x072c('0x39')][_0x072c('0x53')](_0x22b143)[_0x072c('0x1d')](handleEntityNotFound(_0x27ad43,null))[_0x072c('0x1d')](respondWithResult(_0x27ad43,null))[_0x072c('0x50')](handleError(_0x27ad43,null));};exports[_0x072c('0x54')]=function(_0x50d210,_0x5468db){return db[_0x072c('0x39')][_0x072c('0x54')](_0x50d210[_0x072c('0x55')],{})['then'](function(_0x22bbb9){var _0x35ee70=_0x50d210[_0x072c('0x56')][_0x072c('0x30')]({'plain':!![]});if(!_0x35ee70)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35ee70[_0x072c('0x57')]===_0x072c('0x56')){var _0x9ae905=_0x22bbb9[_0x072c('0x30')]({'plain':!![]});var _0x57da54=_0x072c('0x58');return db[_0x072c('0x59')]['find']({'where':{'name':_0x57da54,'userProfileId':_0x35ee70[_0x072c('0x5a')]},'raw':!![]})[_0x072c('0x1d')](function(_0x574316){if(_0x574316&&_0x574316['autoAssociation']===0x0){return db['UserProfileResource'][_0x072c('0x54')]({'name':_0x9ae905[_0x072c('0x34')],'resourceId':_0x9ae905['id'],'type':_0x574316['name'],'sectionId':_0x574316['id']},{})[_0x072c('0x1d')](function(){return _0x22bbb9;});}else{return _0x22bbb9;}})[_0x072c('0x50')](function(_0x26252c){logger[_0x072c('0x23')](_0x072c('0x5b'),_0x26252c);throw _0x26252c;});}return _0x22bbb9;})[_0x072c('0x1d')](respondWithResult(_0x5468db,0xc9))[_0x072c('0x50')](handleError(_0x5468db,null));};exports['update']=function(_0x1ea22a,_0x2e4c81){if(_0x1ea22a[_0x072c('0x55')]['id']){delete _0x1ea22a['body']['id'];}return db[_0x072c('0x39')]['find']({'where':{'id':_0x1ea22a['params']['id']},'include':[{'model':db[_0x072c('0x37')],'as':_0x072c('0x38')}]})['then'](handleEntityNotFound(_0x2e4c81,null))[_0x072c('0x1d')](saveUpdates(_0x1ea22a[_0x072c('0x55')],null))['then'](respondWithResult(_0x2e4c81,null))[_0x072c('0x50')](handleError(_0x2e4c81,null));};exports[_0x072c('0x2f')]=function(_0x449d19,_0x28f437){return db[_0x072c('0x39')]['find']({'where':{'id':_0x449d19[_0x072c('0x5c')]['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x28f437,null))[_0x072c('0x1d')](removeEntity(_0x28f437,null))[_0x072c('0x50')](handleError(_0x28f437,null));};exports['describe']=function(_0x3a4cee,_0x2393af){return db[_0x072c('0x39')][_0x072c('0x5d')]()[_0x072c('0x1d')](respondWithResult(_0x2393af,null))[_0x072c('0x50')](handleError(_0x2393af,null));};exports[_0x072c('0x5e')]=function(_0x44ac45,_0x5a895d,_0x15f64c){if(_0x44ac45[_0x072c('0x55')]['id']){delete _0x44ac45[_0x072c('0x55')]['id'];}return db[_0x072c('0x39')]['find']({'where':{'id':_0x44ac45[_0x072c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5a895d,null))[_0x072c('0x1d')](function(_0x4be983){if(_0x4be983){_0x44ac45[_0x072c('0x55')][_0x072c('0x5f')]=_0x4be983['id'];return db['Disposition'][_0x072c('0x54')](_0x44ac45['body']);}})['then'](respondWithResult(_0x5a895d,null))[_0x072c('0x50')](handleError(_0x5a895d,null));};exports[_0x072c('0x60')]=function(_0x120287,_0x522b3d,_0x4a778e){var _0x59e007={'raw':![],'where':{}};var _0x4c6243={};var _0x3d1c57={'count':0x0,'rows':[]};return db[_0x072c('0x39')][_0x072c('0x61')]({'where':{'id':_0x120287[_0x072c('0x5c')]['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x522b3d,null))[_0x072c('0x1d')](function(_0x8753bc){if(_0x8753bc){_0x4c6243[_0x072c('0x43')]=_[_0x072c('0x3f')](db[_0x072c('0x62')][_0x072c('0x3a')]);_0x4c6243[_0x072c('0x40')]=_[_0x072c('0x3f')](_0x120287[_0x072c('0x40')]);_0x4c6243[_0x072c('0x41')]=_[_0x072c('0x42')](_0x4c6243[_0x072c('0x43')],_0x4c6243[_0x072c('0x40')]);_0x59e007[_0x072c('0x44')]=_[_0x072c('0x42')](_0x4c6243[_0x072c('0x43')],qs[_0x072c('0x45')](_0x120287[_0x072c('0x40')][_0x072c('0x45')]));_0x59e007[_0x072c('0x44')]=_0x59e007[_0x072c('0x44')][_0x072c('0x46')]?_0x59e007['attributes']:_0x4c6243[_0x072c('0x43')];if(!_0x120287[_0x072c('0x40')][_0x072c('0x63')]('nolimit')){_0x59e007[_0x072c('0x2b')]=qs[_0x072c('0x2b')](_0x120287[_0x072c('0x40')][_0x072c('0x2b')]);_0x59e007['offset']=qs[_0x072c('0x2a')](_0x120287[_0x072c('0x40')][_0x072c('0x2a')]);}_0x59e007[_0x072c('0x64')]=qs[_0x072c('0x48')](_0x120287[_0x072c('0x40')][_0x072c('0x48')]);_0x59e007[_0x072c('0x4a')]=qs[_0x072c('0x41')](_[_0x072c('0x49')](_0x120287[_0x072c('0x40')],_0x4c6243[_0x072c('0x41')]));_0x59e007[_0x072c('0x4a')]['ChatWebsiteId']=_0x8753bc['id'];if(_0x120287[_0x072c('0x40')][_0x072c('0x65')]){_0x59e007['where']=_[_0x072c('0x4b')](_0x59e007[_0x072c('0x4a')],{'$or':_['map'](_0x59e007['attributes'],function(_0x2f5ee2){var _0x492a64={};_0x492a64[_0x2f5ee2]={'$like':'%'+_0x120287['query'][_0x072c('0x65')]+'%'};return _0x492a64;})});}_0x59e007=_[_0x072c('0x4b')]({},_0x59e007,_0x120287[_0x072c('0x66')]);return db['Disposition']['count']({'where':_0x59e007[_0x072c('0x4a')]})['then'](function(_0x8ed265){_0x3d1c57[_0x072c('0x29')]=_0x8ed265;if(_0x120287['query'][_0x072c('0x4d')]){_0x59e007[_0x072c('0x52')]=[{'all':!![]}];}return db[_0x072c('0x62')][_0x072c('0x4e')](_0x59e007);})[_0x072c('0x1d')](function(_0x16c718){_0x3d1c57[_0x072c('0x4f')]=_0x16c718;return _0x3d1c57;});}})[_0x072c('0x1d')](respondWithFilteredResult(_0x522b3d,_0x59e007))['catch'](handleError(_0x522b3d,null));};exports[_0x072c('0x67')]=function(_0x3874e0,_0x27378c,_0x3e32ca){return db[_0x072c('0x39')]['find']({'where':{'id':_0x3874e0[_0x072c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x27378c,null))['then'](function(_0x4f819b){if(_0x4f819b){return _0x4f819b[_0x072c('0x67')](_0x3874e0[_0x072c('0x40')][_0x072c('0x68')]);}})['then'](respondWithStatusCode(_0x27378c,null))[_0x072c('0x50')](handleError(_0x27378c,null));};exports[_0x072c('0x69')]=function(_0x4a7429,_0x1a563d,_0x1fee09){if(_0x4a7429[_0x072c('0x55')]['id']){delete _0x4a7429[_0x072c('0x55')]['id'];}return db[_0x072c('0x39')]['find']({'where':{'id':_0x4a7429['params']['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x1a563d,null))['then'](function(_0x3cc989){if(_0x3cc989){_0x4a7429[_0x072c('0x55')][_0x072c('0x5f')]=_0x3cc989['id'];return db[_0x072c('0x6a')][_0x072c('0x54')](_0x4a7429[_0x072c('0x55')]);}})['then'](respondWithResult(_0x1a563d,null))[_0x072c('0x50')](handleError(_0x1a563d,null));};exports[_0x072c('0x6b')]=function(_0x4702ab,_0x668ded,_0x16476e){var _0x41cd2c={'raw':![],'where':{}};var _0x546bb9={};var _0x59e0e3={'count':0x0,'rows':[]};return db[_0x072c('0x39')]['findOne']({'where':{'id':_0x4702ab['params']['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x668ded,null))['then'](function(_0x110274){if(_0x110274){_0x546bb9['model']=_['keys'](db['CannedAnswer']['rawAttributes']);_0x546bb9[_0x072c('0x40')]=_['keys'](_0x4702ab[_0x072c('0x40')]);_0x546bb9[_0x072c('0x41')]=_[_0x072c('0x42')](_0x546bb9['model'],_0x546bb9[_0x072c('0x40')]);_0x41cd2c[_0x072c('0x44')]=_[_0x072c('0x42')](_0x546bb9[_0x072c('0x43')],qs[_0x072c('0x45')](_0x4702ab[_0x072c('0x40')][_0x072c('0x45')]));_0x41cd2c[_0x072c('0x44')]=_0x41cd2c[_0x072c('0x44')][_0x072c('0x46')]?_0x41cd2c['attributes']:_0x546bb9[_0x072c('0x43')];if(!_0x4702ab[_0x072c('0x40')]['hasOwnProperty'](_0x072c('0x47'))){_0x41cd2c[_0x072c('0x2b')]=qs['limit'](_0x4702ab['query']['limit']);_0x41cd2c['offset']=qs[_0x072c('0x2a')](_0x4702ab['query'][_0x072c('0x2a')]);}_0x41cd2c['order']=qs['sort'](_0x4702ab[_0x072c('0x40')]['sort']);_0x41cd2c[_0x072c('0x4a')]=qs[_0x072c('0x41')](_[_0x072c('0x49')](_0x4702ab[_0x072c('0x40')],_0x546bb9[_0x072c('0x41')]));_0x41cd2c[_0x072c('0x4a')][_0x072c('0x5f')]=_0x110274['id'];if(_0x4702ab[_0x072c('0x40')]['filter']){_0x41cd2c['where']=_[_0x072c('0x4b')](_0x41cd2c['where'],{'$or':_['map'](_0x41cd2c['attributes'],function(_0x50d494){var _0x400118={};_0x400118[_0x50d494]={'$like':'%'+_0x4702ab['query'][_0x072c('0x65')]+'%'};return _0x400118;})});}_0x41cd2c=_['merge']({},_0x41cd2c,_0x4702ab[_0x072c('0x66')]);return db[_0x072c('0x6a')][_0x072c('0x29')]({'where':_0x41cd2c['where']})[_0x072c('0x1d')](function(_0x566721){_0x59e0e3[_0x072c('0x29')]=_0x566721;if(_0x4702ab[_0x072c('0x40')]['includeAll']){_0x41cd2c[_0x072c('0x52')]=[{'all':!![]}];}return db[_0x072c('0x6a')][_0x072c('0x4e')](_0x41cd2c);})[_0x072c('0x1d')](function(_0x3c7039){_0x59e0e3[_0x072c('0x4f')]=_0x3c7039;return _0x59e0e3;});}})['then'](respondWithFilteredResult(_0x668ded,_0x41cd2c))[_0x072c('0x50')](handleError(_0x668ded,null));};exports[_0x072c('0x6c')]=function(_0x4a327c,_0x252b53,_0x21f00b){return db[_0x072c('0x39')][_0x072c('0x53')]({'where':{'id':_0x4a327c[_0x072c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x252b53,null))[_0x072c('0x1d')](function(_0x36cbf8){if(_0x36cbf8){return _0x36cbf8[_0x072c('0x6c')](_0x4a327c[_0x072c('0x40')][_0x072c('0x68')]);}})['then'](respondWithStatusCode(_0x252b53,null))[_0x072c('0x50')](handleError(_0x252b53,null));};exports[_0x072c('0x6d')]=function(_0x4ca372,_0x2a9659,_0x5a7cf3){_0x4ca372['body']['sitepic']=_0x4ca372[_0x072c('0x6e')][_0x072c('0x6f')];return db[_0x072c('0x39')][_0x072c('0x53')]({'where':{'id':_0x4ca372[_0x072c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2a9659,null))['then'](saveUpdates(_0x4ca372[_0x072c('0x55')],null))['then'](respondWithResult(_0x2a9659,null))['catch'](handleError(_0x2a9659,null));};exports[_0x072c('0x70')]=function(_0x17b5de,_0x1963b3,_0x104687){_0x17b5de['body']['agentAvatar']=_0x17b5de[_0x072c('0x6e')]['filename'];return db[_0x072c('0x39')]['find']({'where':{'id':_0x17b5de[_0x072c('0x5c')]['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x1963b3,null))[_0x072c('0x1d')](saveUpdates(_0x17b5de[_0x072c('0x55')],null))[_0x072c('0x1d')](respondWithResult(_0x1963b3,null))[_0x072c('0x50')](handleError(_0x1963b3,null));};exports[_0x072c('0x71')]=function(_0x476537,_0x254ae6,_0x5446d4){_0x476537[_0x072c('0x55')][_0x072c('0x72')]=_0x476537[_0x072c('0x6e')][_0x072c('0x6f')];return db['ChatWebsite'][_0x072c('0x53')]({'where':{'id':_0x476537[_0x072c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x254ae6,null))[_0x072c('0x1d')](saveUpdates(_0x476537[_0x072c('0x55')],null))[_0x072c('0x1d')](respondWithResult(_0x254ae6,null))[_0x072c('0x50')](handleError(_0x254ae6,null));};exports[_0x072c('0x73')]=function(_0xf43140,_0x228719,_0x16b214){_0xf43140['body'][_0x072c('0x74')]=_0xf43140[_0x072c('0x6e')][_0x072c('0x6f')];return db[_0x072c('0x39')][_0x072c('0x53')]({'where':{'id':_0xf43140['params']['id']}})['then'](handleEntityNotFound(_0x228719,null))[_0x072c('0x1d')](saveUpdates(_0xf43140[_0x072c('0x55')],null))[_0x072c('0x1d')](respondWithResult(_0x228719,null))[_0x072c('0x50')](handleError(_0x228719,null));};exports[_0x072c('0x75')]=function(_0x17031b,_0x346111,_0x2db53e){var _0x25ba74=path[_0x072c('0x76')](config[_0x072c('0x77')],_0x072c('0x78'));var _0x1c45cd={'where':{'id':_0x17031b[_0x072c('0x5c')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x3541e2=![];return require(_0x072c('0x79'))['getLicense']()['then'](function(_0x5eab0e){if(_0x5eab0e){_0x3541e2=_0x5eab0e[_0x072c('0x7a')];}})['then'](function(){return db[_0x072c('0x39')][_0x072c('0x53')](_0x1c45cd);})['then'](handleEntityNotFound(_0x346111,null))[_0x072c('0x1d')](function(_0x5d291a){if(_0x5d291a){if(!_[_0x072c('0x7b')](_0x5d291a[_0x072c('0x7c')])){if(fs[_0x072c('0x7d')](path[_0x072c('0x76')](config[_0x072c('0x77')],_0x072c('0x7e'),_0x5d291a['sitepic']))&&_0x3541e2){_0x25ba74=path[_0x072c('0x76')](config['root'],_0x072c('0x7e'),_0x5d291a['sitepic']);}}return _0x346111[_0x072c('0x7f')](_0x25ba74);}})['catch'](handleError(_0x346111,null));};exports['getAvatar']=function(_0x21ce07,_0x645dba,_0x41dc7e){var _0x4975fe=path[_0x072c('0x76')](config[_0x072c('0x77')],_0x072c('0x80'));var _0x2ab781={'where':{'id':_0x21ce07[_0x072c('0x5c')]['id']},'attributes':['id',_0x072c('0x81')],'raw':!![]};return db[_0x072c('0x39')][_0x072c('0x53')](_0x2ab781)[_0x072c('0x1d')](handleEntityNotFound(_0x645dba,null))[_0x072c('0x1d')](function(_0x433332){if(_0x433332){if(!_['isNil'](_0x433332[_0x072c('0x81')])){if(fs['existsSync'](path[_0x072c('0x76')](config['root'],'server/files/images/avatars/',_0x433332[_0x072c('0x81')]))){_0x4975fe=path[_0x072c('0x76')](config['root'],_0x072c('0x82'),_0x433332[_0x072c('0x81')]);}}return _0x645dba['download'](_0x4975fe);}})[_0x072c('0x50')](handleError(_0x645dba,null));};exports[_0x072c('0x83')]=function(_0x584e3f,_0x2d4e52,_0x441102){var _0x317a84=path[_0x072c('0x76')](config[_0x072c('0x77')],'server/files/images/avatars/customer_avatar.png');var _0x5015d6={'where':{'id':_0x584e3f[_0x072c('0x5c')]['id']},'attributes':['id',_0x072c('0x72'),_0x072c('0x84')],'raw':!![]};return db['ChatWebsite'][_0x072c('0x53')](_0x5015d6)[_0x072c('0x1d')](handleEntityNotFound(_0x2d4e52,null))[_0x072c('0x1d')](function(_0x14b51f){if(_0x14b51f){if(!_['isNil'](_0x14b51f[_0x072c('0x72')])){if(fs[_0x072c('0x7d')](path[_0x072c('0x76')](config['root'],_0x072c('0x82'),_0x14b51f['customerAvatar']))&&_0x14b51f[_0x072c('0x84')]){_0x317a84=path[_0x072c('0x76')](config[_0x072c('0x77')],_0x072c('0x82'),_0x14b51f[_0x072c('0x72')]);}}return _0x2d4e52[_0x072c('0x7f')](_0x317a84);}})['catch'](handleError(_0x2d4e52,null));};exports[_0x072c('0x85')]=function(_0x132abb,_0x394b65,_0xbc4953){var _0x338a92=path[_0x072c('0x76')](config[_0x072c('0x77')],_0x072c('0x86'));var _0x46d7da={'where':{'id':_0x132abb['params']['id']},'attributes':['id',_0x072c('0x74')],'raw':!![]};return db[_0x072c('0x39')]['find'](_0x46d7da)[_0x072c('0x1d')](handleEntityNotFound(_0x394b65,null))[_0x072c('0x1d')](function(_0x168aa0){if(_0x168aa0){if(!_[_0x072c('0x7b')](_0x168aa0['systemAvatar'])){if(fs[_0x072c('0x7d')](path[_0x072c('0x76')](config[_0x072c('0x77')],_0x072c('0x82'),_0x168aa0[_0x072c('0x74')]))){_0x338a92=path[_0x072c('0x76')](config[_0x072c('0x77')],_0x072c('0x82'),_0x168aa0[_0x072c('0x74')]);}}return _0x394b65[_0x072c('0x7f')](_0x338a92);}})[_0x072c('0x50')](handleError(_0x394b65,null));};exports[_0x072c('0x87')]=function(_0x4b27c0,_0x48fa21,_0x2ba08f){var _0x27c295=require(_0x072c('0x88'));var _0x3405c8=new _0x27c295();var _0x579363=_0x3405c8[_0x072c('0x89')](_0x4b27c0[_0x072c('0x8a')][_0x072c('0x8b')])[_0x072c('0x8c')]();var _0x533053={'body':_0x4b27c0[_0x072c('0x55')],'channel':'chat'};var _0x5817fb=[];var _0x4295db=[];var _0x4fa36e={};var _0x356fe6=![];return db['CmContact']['describe']()['then'](function(_0x169983){if(!_0x169983){throw new db['Sequelize'][(_0x072c('0x1a'))](_0x072c('0x8d'));}_0x5817fb=_[_0x072c('0x8e')](_[_0x072c('0x3f')](_0x169983),[_0x072c('0x8f'),_0x072c('0x90')]);_0x4295db=_[_0x072c('0x8e')](_[_0x072c('0x3f')](_0x169983),['createdAt','updatedAt',_0x072c('0x91'),_0x072c('0x92')]);if(_0x4b27c0['body']['id']){delete _0x4b27c0[_0x072c('0x55')]['id'];}if(_[_0x072c('0x7b')](_0x4b27c0[_0x072c('0x55')]['from'])){throw new db['Sequelize'][(_0x072c('0x1a'))](_0x072c('0x93'));}if(_[_0x072c('0x7b')](_0x4b27c0['body'][_0x072c('0x55')])||_0x4b27c0[_0x072c('0x55')][_0x072c('0x55')]===''){throw new db['Sequelize']['ValidationError'](_0x072c('0x94'));}if(_[_0x072c('0x7b')](_0x4b27c0['body'][_0x072c('0x95')])){throw new db[(_0x072c('0x19'))]['ValidationError'](_0x072c('0x96')+_0x4295db);}if(!_['includes'](_0x4295db,_0x4b27c0[_0x072c('0x55')][_0x072c('0x95')])){throw new db['Sequelize'][(_0x072c('0x1a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4295db);}_0x4fa36e[_0x4b27c0[_0x072c('0x55')][_0x072c('0x95')]]=_0x4b27c0['body'][_0x072c('0x97')];})[_0x072c('0x1d')](function(){return db[_0x072c('0x39')][_0x072c('0x53')]({'where':{'id':_0x4b27c0['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x072c('0x98')],'as':_0x072c('0x99'),'where':_0x4fa36e,'limit':0x1,'order':[[_0x072c('0x90'),_0x072c('0x9a')]]}]},{'model':db[_0x072c('0x9b')],'as':_0x072c('0x9c')}]});})['then'](handleEntityNotFound(_0x48fa21,null))['then'](function(_0x106238){if(_0x106238&&_0x106238['List']){_0x533053[_0x072c('0x9d')]=_0x106238;_0x533053['applications']=_0x106238['Applications'];_0x533053[_0x072c('0x9e')]=_0x106238[_0x072c('0x9f')];_0x533053[_0x072c('0xa0')]=_[_0x072c('0xa1')](_0x533053[_0x072c('0xa0')],[_0x072c('0xa2')],[_0x072c('0xa3')]);if(_0x533053['account'][_0x072c('0x9c')]){delete _0x533053['account'][_0x072c('0x9c')];}if(_0x533053[_0x072c('0x9d')]['List']&&_0x533053[_0x072c('0x9d')]['List'][_0x072c('0x99')][_0x072c('0x46')]){return _0x533053[_0x072c('0x9d')][_0x072c('0x9f')]['Contacts'][0x0];}var _0xff4a88=_['defaults'](_0x4b27c0[_0x072c('0x55')],{'firstName':_0x4b27c0[_0x072c('0x55')][_0x072c('0x97')],'ListId':_0x106238[_0x072c('0x92')]});_0xff4a88[_0x4b27c0[_0x072c('0x55')][_0x072c('0x95')]]=_0x4b27c0[_0x072c('0x55')][_0x072c('0x97')];return db[_0x072c('0x98')][_0x072c('0x54')](_0xff4a88,{'fields':_0x5817fb,'raw':!![]});}})[_0x072c('0x1d')](handleEntityNotFound(_0x48fa21,null))[_0x072c('0x1d')](function(_0x10a79b){_0x533053[_0x072c('0xa4')]=_0x10a79b;var _0x19541a=_0x4b27c0[_0x072c('0x55')][_0x072c('0xa5')];if(_0x4b27c0[_0x072c('0x8a')]['cf-connecting-ip']){_0x19541a=_0x4b27c0[_0x072c('0x8a')][_0x072c('0xa6')];}else if(_0x4b27c0[_0x072c('0x8a')][_0x072c('0xa7')]){_0x19541a=_[_0x072c('0xa8')](_0x4b27c0[_0x072c('0x8a')][_0x072c('0xa7')][_0x072c('0xa9')](','));}if(_0x10a79b){var _0x58a422={'ContactId':_0x10a79b['id'],'ChatWebsiteId':_0x4b27c0[_0x072c('0x5c')]['id'],'from':(_0x10a79b['firstName']||'')+'\x20'+(_0x10a79b[_0x072c('0xaa')]||''),'customerIp':_0x19541a,'customerPort':_0x4b27c0[_0x072c('0x8a')]['x-real-port']?_0x4b27c0[_0x072c('0x8a')][_0x072c('0xab')]:null,'referer':_0x4b27c0[_0x072c('0x55')][_0x072c('0xac')],'browserName':_0x579363[_0x072c('0xad')][_0x072c('0x34')]&&_0x579363[_0x072c('0xad')]['version']?util[_0x072c('0xae')](_0x072c('0xaf'),_0x579363[_0x072c('0xad')][_0x072c('0x34')],_0x579363[_0x072c('0xad')]['version']):'unknown','browserVersion':_0x579363[_0x072c('0xad')][_0x072c('0xb0')]||_0x072c('0xb1'),'osName':util['format']('%s\x20%s',_0x579363['os']['name'],_0x579363['os'][_0x072c('0xb0')]),'osVersion':_0x579363['os']['version'],'deviceModel':_0x579363['device'][_0x072c('0x43')]&&_0x579363[_0x072c('0xb2')]['vendor']?util[_0x072c('0xae')]('%s\x20%s\x20%s',_0x579363[_0x072c('0xb2')]['model'],_0x579363[_0x072c('0xb2')][_0x072c('0xb3')],_0x579363[_0x072c('0xb2')][_0x072c('0x3c')]):null,'deviceVendor':_0x579363[_0x072c('0xb2')]['vendor'],'deviceType':_0x579363[_0x072c('0xb2')]['type'],'formData':JSON['stringify'](_0x4b27c0[_0x072c('0x55')])};var _0x3618cd={'ChatWebsiteId':_0x4b27c0[_0x072c('0x5c')]['id'],'closed':![]};if(_0x4b27c0[_0x072c('0x55')][_0x072c('0xb4')]){_0x3618cd[_0x072c('0xb4')]=_0x4b27c0[_0x072c('0x55')][_0x072c('0xb4')];return db[_0x072c('0xb5')][_0x072c('0x53')]({'where':_0x3618cd})[_0x072c('0x1d')](function(_0x4adb90){if(_0x4adb90){return[_0x4adb90,![]];}_0x58a422[_0x072c('0xb4')]=_0x4b27c0['body'][_0x072c('0xb4')];_0x58a422[_0x072c('0xb6')]=_0x4b27c0[_0x072c('0x55')][_0x072c('0xb6')];return db['ChatInteraction']['create'](_0x58a422)[_0x072c('0x1d')](function(_0x553195){return[_0x553195,!![]];});});}_0x3618cd['ContactId']=_0x10a79b['id'];if(_0x4b27c0[_0x072c('0x55')][_0x072c('0xb7')]&&_0x4b27c0[_0x072c('0x55')]['interaction']['id']){_0x3618cd['id']=_0x4b27c0[_0x072c('0x55')]['interaction']['id'];return db[_0x072c('0xb5')][_0x072c('0x53')]({'where':_0x3618cd})[_0x072c('0x1d')](function(_0x32f03e){if(_0x32f03e){return[_0x32f03e,![]];}return db[_0x072c('0xb5')]['create'](_0x58a422)[_0x072c('0x1d')](function(_0x3835b0){return[_0x3835b0,!![]];});});}return db[_0x072c('0xb5')][_0x072c('0x54')](_0x58a422)[_0x072c('0x1d')](function(_0x5860c5){return[_0x5860c5,!![]];});}})[_0x072c('0xb8')](function(_0x5231f3,_0x6350d1){if(_0x5231f3){_0x356fe6=_0x6350d1;if(!_0x6350d1){var _0xc45cf1={'from':(_0x533053['contact'][_0x072c('0xb9')]||'')+'\x20'+(_0x533053[_0x072c('0xa4')][_0x072c('0xaa')]||'')};if(_0x4b27c0[_0x072c('0x55')][_0x072c('0xb4')]&&_0x4b27c0['body']['messageId']&&_0x4b27c0[_0x072c('0x55')]['threadId']!=_0x4b27c0[_0x072c('0x55')][_0x072c('0xba')]){_0xc45cf1[_0x072c('0xb4')]=_0x4b27c0['body']['messageId'];}return _0x5231f3[_0x072c('0xbb')](_0xc45cf1);}else{return _0x5231f3;}}})[_0x072c('0x1d')](function(_0xb42b5d){_0x533053[_0x072c('0xb7')]=_0xb42b5d[_0x072c('0x30')]({'plain':!![]});_0x533053[_0x072c('0xb7')]['created']=_0x356fe6;if(_0x533053['interaction'][_0x072c('0xbc')]){if(_0x533053[_0x072c('0x9d')]['autoclose']){_0x533053[_0x072c('0xa0')][_0x072c('0xbd')]({'id':0x0,'priority':_0x533053[_0x072c('0xa0')]['length']+0x1,'app':_0x072c('0xbe'),'appdata':_0x072c('0xbf'),'interval':'*,*,*,*'});}}return db[_0x072c('0xc0')]['create']({'body':_0x4b27c0[_0x072c('0x55')]['body'],'ChatWebsiteId':_0x4b27c0[_0x072c('0x5c')]['id'],'ChatInteractionId':_0xb42b5d['id'],'direction':'in','ContactId':_0x533053[_0x072c('0xa4')]['id'],'AttachmentId':_0x4b27c0['body'][_0x072c('0xc1')]});})[_0x072c('0x1d')](function(_0x24eb7f){_0x533053[_0x072c('0x25')]=_0x24eb7f;if(_0x533053[_0x072c('0xb7')][_0x072c('0xc2')]){return db[_0x072c('0xc3')]['find']({'attributes':['id','name'],'where':{'id':_0x533053[_0x072c('0xb7')][_0x072c('0xc2')]}})['then'](function(_0xc8883e){if(_0xc8883e){_0x533053[_0x072c('0xa0')][_0x072c('0xc4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xc8883e[_0x072c('0x34')]+','+(_0x533053['account'][_0x072c('0xc5')]||0xa),'interval':'*,*,*,*'});_0x533053[_0x072c('0xc6')]=!![];}return respondWithRpcPromise(_0x072c('0xc7'),_0x072c('0xc8'),_0x533053);});}return respondWithRpcPromise('Start','startRouting',_0x533053);})['then'](function(_0xeee6ab){respondWithRpcPromise('EventManager',_0x072c('0xc9'),{'event':_0x072c('0x87'),'message':_0xeee6ab},client9002);return _0xeee6ab;})['then'](respondWithResult(_0x48fa21,null))[_0x072c('0x50')](handleError(_0x48fa21,null));};exports[_0x072c('0xca')]=function(_0x6e5940,_0x32ab41,_0x22ad75){var _0x61dd4b,_0x26e367,_0x821bc0;var _0x40ae0c=[];var _0x53b0fb=[];var _0x2afe41={};return db[_0x072c('0x98')][_0x072c('0x5d')]()[_0x072c('0x1d')](function(_0x38cb83){if(!_0x38cb83){throw new db[(_0x072c('0x19'))][(_0x072c('0x1a'))](_0x072c('0x8d'));}_0x53b0fb=_[_0x072c('0x8e')](_[_0x072c('0x3f')](_0x38cb83),[_0x072c('0x8f'),_0x072c('0x90')]);_0x40ae0c=_[_0x072c('0x8e')](_[_0x072c('0x3f')](_0x38cb83),[_0x072c('0x8f'),_0x072c('0x90'),_0x072c('0x91'),_0x072c('0x92')]);if(_0x6e5940['body']['id']){delete _0x6e5940[_0x072c('0x55')]['id'];}if(_[_0x072c('0x7b')](_0x6e5940[_0x072c('0x55')][_0x072c('0x97')])){throw _0x32ab41['status'](0x1f4)[_0x072c('0x35')](new db[(_0x072c('0x19'))]['ValidationError'](_0x072c('0x93')));}if(_[_0x072c('0x7b')](_0x6e5940['body'][_0x072c('0x55')])||_0x6e5940[_0x072c('0x55')][_0x072c('0x55')]===''){throw _0x32ab41['status'](0x1f4)[_0x072c('0x35')](new db[(_0x072c('0x19'))]['ValidationError'](_0x072c('0x94')));}if(_[_0x072c('0x7b')](_0x6e5940[_0x072c('0x55')][_0x072c('0xcb')])){throw _0x32ab41[_0x072c('0x27')](0x1f4)[_0x072c('0x35')](new db[(_0x072c('0x19'))][(_0x072c('0x1a'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x40ae0c));}if(!_[_0x072c('0xcc')](_0x40ae0c,_0x6e5940['body']['mapKeyOffline'])){throw _0x32ab41['status'](0x1f4)[_0x072c('0x35')](new db[(_0x072c('0x19'))][(_0x072c('0x1a'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x40ae0c));}_0x2afe41[_0x6e5940[_0x072c('0x55')]['mapKeyOffline']]=_0x6e5940[_0x072c('0x55')][_0x072c('0x97')];})[_0x072c('0x1d')](function(){return db[_0x072c('0x39')]['find']({'where':{'id':_0x6e5940[_0x072c('0x5c')]['id']},'include':[{'model':db[_0x072c('0xcd')],'as':_0x072c('0x9f')}]});})[_0x072c('0x1d')](handleEntityNotFound(_0x32ab41,null))[_0x072c('0x1d')](function(_0x354d98){if(_0x354d98&&_0x354d98[_0x072c('0x9f')]){_0x26e367=_0x354d98;var _0xe8df65=_[_0x072c('0xce')](_0x6e5940[_0x072c('0x55')],{'firstName':_0x6e5940[_0x072c('0x55')][_0x072c('0x97')],'phone':_0x6e5940[_0x072c('0x55')]['from'],'ListId':_0x354d98[_0x072c('0x92')]});_0xe8df65[_0x6e5940[_0x072c('0x55')][_0x072c('0xcb')]]=_0x6e5940['body'][_0x072c('0x97')];return db[_0x072c('0x98')]['findOrCreate']({'where':_0x2afe41,'defaults':_0xe8df65});}})[_0x072c('0xb8')](function(_0x1cda9d){if(_0x1cda9d){_0x821bc0=_0x1cda9d;var _0x22574c=fs['readFileSync'](path[_0x072c('0x76')](config[_0x072c('0x77')],_0x072c('0xcf')),_0x072c('0xd0'));var _0x21fea8=ejs[_0x072c('0xd1')](_0x22574c,{'body':_[_0x072c('0xd2')](_0x6e5940[_0x072c('0x55')][_0x072c('0x55')]),'bodyTitle':_0x26e367[_0x072c('0xd3')]});return db[_0x072c('0xd4')][_0x072c('0x54')]({'body':_0x21fea8,'ContactId':_0x1cda9d['id'],'ChatWebsiteId':_0x26e367['id']});}})[_0x072c('0x1d')](function(_0x3df921){if(_0x3df921){_0x61dd4b=_0x3df921;return db['MailAccount'][_0x072c('0x61')]({'where':{'service':!![]},'include':[{'model':db[_0x072c('0xd5')],'as':'Smtp','raw':!![]}]});}})[_0x072c('0x1d')](function(_0x110f75){if(_0x110f75&&_0x110f75[_0x072c('0xd6')]&&_0x26e367['forwardOfflineAddress']){var _0x4ec2f7={'tls':{'rejectUnauthorized':![]}};if(_0x110f75['Smtp'][_0x072c('0xd7')]){_0x4ec2f7[_0x072c('0xd7')]=_0x110f75[_0x072c('0xd6')][_0x072c('0xd7')];}else{_0x4ec2f7[_0x072c('0xd8')]=_0x110f75[_0x072c('0xd6')][_0x072c('0xd8')];_0x4ec2f7[_0x072c('0xd9')]=_0x110f75[_0x072c('0xd6')][_0x072c('0xd9')];_0x4ec2f7[_0x072c('0xda')]=_0x110f75[_0x072c('0xd6')][_0x072c('0xda')];}if(_0x110f75[_0x072c('0xd6')][_0x072c('0xdb')]){_0x4ec2f7['auth']={'user':_0x110f75[_0x072c('0xd6')][_0x072c('0x56')],'pass':_0x110f75[_0x072c('0xd6')][_0x072c('0xdc')]};}return respondWithRpcPromise('SendMail',_0x072c('0xdd'),{'account':_0x4ec2f7,'message':{'from':util['format'](_0x072c('0xde'),_0x110f75[_0x072c('0x34')],_0x110f75[_0x072c('0xdf')]||_0x110f75[_0x072c('0xd6')][_0x072c('0x56')]),'to':_0x26e367[_0x072c('0xe0')],'subject':_0x26e367[_0x072c('0xe1')],'text':_0x61dd4b[_0x072c('0x55')]}},client9003)[_0x072c('0x1d')](function(){return _0x61dd4b;})['catch'](function(_0x474783){console['error'](_0x474783);});}})[_0x072c('0x1d')](function(){if(_0x61dd4b){return _0x61dd4b;}})['then'](respondWithResult(_0x32ab41,null))[_0x072c('0x50')](handleError(_0x32ab41,null));};exports[_0x072c('0xe2')]=function(_0x5c659d,_0x488f87,_0x90205c){return db[_0x072c('0xb5')][_0x072c('0x53')]({'where':{'id':_0x5c659d[_0x072c('0x5c')]['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x488f87,null))[_0x072c('0x1d')](function(_0x578550){if(_0x578550){return _0x578550[_0x072c('0xe2')](_0x5c659d[_0x072c('0x55')][_0x072c('0x68')],_[_0x072c('0xe3')](_0x5c659d[_0x072c('0x55')],[_0x072c('0x68'),'id'])||{});}})[_0x072c('0x1d')](respondWithResult(_0x488f87,null))['catch'](handleError(_0x488f87,null));};exports[_0x072c('0xe4')]=function(_0xa2d22b,_0x1813cb,_0x56a503){var _0x41c694={'raw':![],'where':{}};var _0x2448f6={};var _0x4b906a={'count':0x0,'rows':[]};return db[_0x072c('0x39')][_0x072c('0x61')]({'where':{'id':_0xa2d22b[_0x072c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1813cb,null))['then'](function(_0x576977){if(_0x576977){_0x2448f6[_0x072c('0x43')]=_[_0x072c('0x3f')](db[_0x072c('0xb5')][_0x072c('0x3a')]);_0x2448f6['query']=_[_0x072c('0x3f')](_0xa2d22b[_0x072c('0x40')]);_0x2448f6['filters']=_[_0x072c('0x42')](_0x2448f6[_0x072c('0x43')],_0x2448f6[_0x072c('0x40')]);_0x41c694[_0x072c('0x44')]=_['intersection'](_0x2448f6['model'],qs[_0x072c('0x45')](_0xa2d22b[_0x072c('0x40')]['fields']));_0x41c694[_0x072c('0x44')]=_0x41c694[_0x072c('0x44')]['length']?_0x41c694[_0x072c('0x44')]:_0x2448f6[_0x072c('0x43')];if(!_0xa2d22b[_0x072c('0x40')][_0x072c('0x63')](_0x072c('0x47'))){_0x41c694[_0x072c('0x2b')]=qs[_0x072c('0x2b')](_0xa2d22b[_0x072c('0x40')][_0x072c('0x2b')]);_0x41c694['offset']=qs[_0x072c('0x2a')](_0xa2d22b[_0x072c('0x40')]['offset']);}_0x41c694[_0x072c('0x64')]=qs[_0x072c('0x48')](_0xa2d22b[_0x072c('0x40')][_0x072c('0x48')]);_0x41c694[_0x072c('0x4a')]=qs[_0x072c('0x41')](_['pick'](_0xa2d22b[_0x072c('0x40')],_0x2448f6[_0x072c('0x41')]));_0x41c694[_0x072c('0x4a')][_0x072c('0x5f')]=_0x576977['id'];if(_0xa2d22b[_0x072c('0x40')][_0x072c('0x65')]){_0x41c694['where']=_[_0x072c('0x4b')](_0x41c694['where'],{'$or':_[_0x072c('0x3e')](_0x41c694[_0x072c('0x44')],function(_0x40e4d7){var _0x13f194={};_0x13f194[_0x40e4d7]={'$like':'%'+_0xa2d22b[_0x072c('0x40')]['filter']+'%'};return _0x13f194;})});}_0x41c694=_[_0x072c('0x4b')]({},_0x41c694,_0xa2d22b[_0x072c('0x66')]);return db[_0x072c('0xb5')]['count']({'where':_0x41c694[_0x072c('0x4a')]})['then'](function(_0x463957){_0x4b906a[_0x072c('0x29')]=_0x463957;if(_0xa2d22b[_0x072c('0x40')][_0x072c('0x4d')]){_0x41c694[_0x072c('0x52')]=[{'model':db[_0x072c('0x98')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x072c('0xe5'),'attributes':['name',_0x072c('0xe6'),'internal'],'required':![]},{'model':db[_0x072c('0xe7')],'as':'Tags','attributes':['id',_0x072c('0x34'),'color'],'where':_0xa2d22b[_0x072c('0x40')]['tag']?{'id':_0xa2d22b[_0x072c('0x40')][_0x072c('0xe8')]}:undefined,'required':_0xa2d22b[_0x072c('0x40')][_0x072c('0xe8')]?!![]:![]}];}return db[_0x072c('0xb5')][_0x072c('0x4e')](_0x41c694);})['then'](function(_0x88d3c9){_0x4b906a[_0x072c('0x4f')]=_0x88d3c9;return _0x4b906a;});}})[_0x072c('0x1d')](respondWithFilteredResult(_0x1813cb,_0x41c694))[_0x072c('0x50')](handleError(_0x1813cb,null));};function iftimePromise(_0x111c27,_0x1562ce){return respondWithRpcPromise(_0x072c('0xe9'),_0x072c('0xea'),{'command':_0x1562ce['timezone']?util[_0x072c('0xae')]('iftime\x20%s,%s',_0x111c27[_0x072c('0xeb')],_0x1562ce[_0x072c('0xec')]):util['format'](_0x072c('0xed'),_0x111c27[_0x072c('0xeb')])},client9002)['then'](function(_0x39ba1e){var _0x18ae9c=_0x39ba1e&&_0x39ba1e['indexOf']('true')>=0x0?!![]:![];logger[_0x072c('0x1e')](_0x072c('0xee'),_0x1562ce['id'],_0x111c27['id'],_0x111c27['interval'],_0x18ae9c?_0x072c('0xef'):'OFFLINE',_0x1562ce[_0x072c('0xec')]?_0x1562ce['timezone']:_0x072c('0xf0'));return _0x18ae9c;})[_0x072c('0x50')](function(_0x52ef64){logger['error'](_0x072c('0xee'),_0x1562ce['id'],_0x111c27['id'],_0x111c27[_0x072c('0xeb')],util[_0x072c('0xf1')](_0x52ef64,{'showHidden':![],'depth':null}),_0x1562ce[_0x072c('0xec')]?_0x1562ce['timezone']:_0x072c('0xf0'));return![];});}exports[_0x072c('0xea')]=function(_0x467a94,_0x4bf845,_0x5c8c81){var _0x937e59=0x0;var _0x1fc5e4=0x0;var _0x373bbf=![];var _0x5d57e4;var _0x1fcb03;return db[_0x072c('0x39')][_0x072c('0x53')]({'where':{'id':_0x467a94['params']['id']},'include':[{'model':db[_0x072c('0xf2')],'as':_0x072c('0xf2'),'include':[{'model':db[_0x072c('0xf2')],'as':'Intervals','attributes':['id',_0x072c('0xeb')],'raw':!![]}]}]})[_0x072c('0x1d')](handleEntityNotFound(_0x4bf845,null))['then'](function(_0x45ee2a){if(_0x45ee2a){_0x5d57e4=_0x45ee2a;return _0x45ee2a[_0x072c('0xf3')]({'raw':!![]});}})[_0x072c('0x1d')](function(_0x158b1d){if(_0x5d57e4){if(_0x158b1d){_0x1fcb03=_0x158b1d;}}return require(_0x072c('0x79'))[_0x072c('0xf4')]();})['then'](function(_0x478479){if(_0x478479){_0x1fc5e4=_0x478479['virtual'];_0x373bbf=_0x478479['custom'];}})['then'](function(){return db[_0x072c('0xb5')][_0x072c('0x29')]({'where':{'closed':![]}});})[_0x072c('0x1d')](function(_0x5f02f8){_0x937e59=_0x5f02f8;if(_0x1fc5e4&&_0x5f02f8>_0x1fc5e4){return db[_0x072c('0xf5')]['findOne']({'where':{'id':0x1}})[_0x072c('0x1d')](function(_0x1fbb2b){if(_0x1fbb2b){_0x1fbb2b[_0x072c('0xf6')](_0x072c('0xf7'));}});}})[_0x072c('0x1d')](function(){if(_0x5d57e4['Interval']&&_0x5d57e4[_0x072c('0xf2')][_0x072c('0xf8')]){var _0x4504c1=[];for(var _0x47e4f0=0x0;_0x47e4f0<_0x5d57e4[_0x072c('0xf2')]['Intervals'][_0x072c('0x46')];_0x47e4f0++){var _0x387641=_0x5d57e4[_0x072c('0xf2')][_0x072c('0xf8')][_0x47e4f0][_0x072c('0x30')]({'plain':!![]});_0x4504c1[_0x072c('0xbd')](iftimePromise(_0x387641,_0x5d57e4));}return BPromise[_0x072c('0xf9')](_0x4504c1)[_0x072c('0x1d')](function(_0x112a3f){return _['some'](_0x112a3f);});}else{return!![];}})[_0x072c('0x1d')](function(_0x369902){var _0x2c1bf1=fs['readFileSync'](path[_0x072c('0x76')](config[_0x072c('0x77')],_0x072c('0xfa')),_0x072c('0xd0'));var _0xad0cfe={'remote':_0x5d57e4[_0x072c('0xfb')],'query':querystring[_0x072c('0x22')](_[_0x072c('0x4b')](_0x5d57e4['get']({'plain':!![]}),{'customerIp':_0x467a94[_0x072c('0x8a')]['x-forwarded-for']||_0x467a94[_0x072c('0x8a')][_0x072c('0xfc')]||_0x467a94['connection'][_0x072c('0xfd')]||_0x467a94['ip'],'referer':_0x467a94[_0x072c('0x8a')][_0x072c('0xac')],'openedInteractions':_0x937e59,'maxInteractions':_0x1fc5e4,'virtual':_0x373bbf['virtual'],'online':_0x369902,'custom':_0x373bbf}))[_0x072c('0xfe')](/'/g,'\x5c\x27')};_0x4bf845['send'](ejs[_0x072c('0xd1')](Mustache['render'](_0x2c1bf1,_0xad0cfe),{'proactiveActions':_0x1fcb03,'alignment':_0x5d57e4[_0x072c('0xff')],'verticalAlignment':_0x5d57e4[_0x072c('0x100')],'div_color':_0x5d57e4['color'],'text_color':_0x5d57e4[_0x072c('0x101')]}));})[_0x072c('0x50')](handleError(_0x4bf845,null));};exports['addApplications']=function(_0x4bb67b,_0x527f3c,_0x249cd6){return db[_0x072c('0x39')][_0x072c('0x61')]({'where':{'id':_0x4bb67b[_0x072c('0x5c')]['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x527f3c,null))[_0x072c('0x1d')](function(_0x233347){if(_0x233347){return db['sequelize']['transaction'](function(_0x4eca3d){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x4bb67b['params']['id']},'transaction':_0x4eca3d})[_0x072c('0x1d')](function(_0x5ee322){var _0x48ed7b=_['map'](_0x4bb67b['body'],function(_0x3228e0){_0x3228e0[_0x072c('0x5f')]=_0x4bb67b[_0x072c('0x5c')]['id'];return _0x3228e0;});return db[_0x072c('0x9b')][_0x072c('0x102')](_0x48ed7b,{'transaction':_0x4eca3d});});})['then'](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x4bb67b[_0x072c('0x5c')]['id']},'order':_0x072c('0xa2')});});}})[_0x072c('0x1d')](respondWithResult(_0x527f3c,null))[_0x072c('0x50')](handleError(_0x527f3c,null));};exports[_0x072c('0x103')]=function(_0x2669c6,_0x3bb9fe,_0x236477){var _0x594e43={};var _0x10aa5f={};var _0x13630a;var _0x2d9c36;return db['ChatWebsite'][_0x072c('0x61')]({'where':{'id':_0x2669c6[_0x072c('0x5c')]['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x3bb9fe,null))['then'](function(_0x118cd1){if(_0x118cd1){_0x13630a=_0x118cd1;_0x10aa5f['model']=_['keys'](db[_0x072c('0x9b')][_0x072c('0x3a')]);_0x10aa5f[_0x072c('0x40')]=_[_0x072c('0x3f')](_0x2669c6[_0x072c('0x40')]);_0x10aa5f[_0x072c('0x41')]=_[_0x072c('0x42')](_0x10aa5f[_0x072c('0x43')],_0x10aa5f[_0x072c('0x40')]);_0x594e43['attributes']=_[_0x072c('0x42')](_0x10aa5f[_0x072c('0x43')],qs[_0x072c('0x45')](_0x2669c6[_0x072c('0x40')][_0x072c('0x45')]));_0x594e43['attributes']=_0x594e43[_0x072c('0x44')]['length']?_0x594e43['attributes']:_0x10aa5f[_0x072c('0x43')];_0x594e43[_0x072c('0x64')]=qs[_0x072c('0x48')](_0x2669c6['query']['sort']);_0x594e43['where']=qs[_0x072c('0x41')](_[_0x072c('0x49')](_0x2669c6['query'],_0x10aa5f[_0x072c('0x41')]));if(_0x2669c6[_0x072c('0x40')][_0x072c('0x65')]){_0x594e43[_0x072c('0x4a')]=_[_0x072c('0x4b')](_0x594e43['where'],{'$or':_[_0x072c('0x3e')](_0x594e43[_0x072c('0x44')],function(_0x2e0197){var _0xfcd665={};_0xfcd665[_0x2e0197]={'$like':'%'+_0x2669c6['query']['filter']+'%'};return _0xfcd665;})});}_0x594e43=_['merge']({},_0x594e43,_0x2669c6[_0x072c('0x66')]);return _0x13630a[_0x072c('0x103')](_0x594e43);}})[_0x072c('0x1d')](function(_0x238f3f){if(_0x238f3f){_0x2d9c36=_0x238f3f['length'];if(!_0x2669c6[_0x072c('0x40')][_0x072c('0x63')](_0x072c('0x47'))){_0x594e43[_0x072c('0x2b')]=qs['limit'](_0x2669c6[_0x072c('0x40')][_0x072c('0x2b')]);_0x594e43[_0x072c('0x2a')]=qs['offset'](_0x2669c6[_0x072c('0x40')][_0x072c('0x2a')]);}return _0x13630a['getApplications'](_0x594e43);}})[_0x072c('0x1d')](function(_0x3a6189){if(_0x3a6189){return _0x3a6189?{'count':_0x2d9c36,'rows':_0x3a6189}:null;}})[_0x072c('0x1d')](respondWithResult(_0x3bb9fe,null))[_0x072c('0x50')](handleError(_0x3bb9fe,null));};exports['addProactiveActions']=function(_0x14205f,_0x28ade3,_0x4d41cb){return db[_0x072c('0x104')][_0x072c('0x53')]({'where':{'id':_0x14205f[_0x072c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x28ade3,null))[_0x072c('0x1d')](function(_0x206947){if(_0x206947){return _0x206947['addProactiveActions'](_0x14205f[_0x072c('0x55')][_0x072c('0x68')],_['omit'](_0x14205f['body'],[_0x072c('0x68'),'id'])||{});}})[_0x072c('0x1d')](respondWithResult(_0x28ade3,null))[_0x072c('0x50')](handleError(_0x28ade3,null));};exports[_0x072c('0xf3')]=function(_0x552729,_0x338ea9,_0x2ed7d2){var _0x2acc06={};var _0x47dd43={};var _0x7aa7e8;var _0x22f600;return db[_0x072c('0x39')][_0x072c('0x61')]({'where':{'id':_0x552729[_0x072c('0x5c')]['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x338ea9,null))[_0x072c('0x1d')](function(_0x4cbda9){if(_0x4cbda9){_0x7aa7e8=_0x4cbda9;_0x47dd43[_0x072c('0x43')]=_[_0x072c('0x3f')](db[_0x072c('0x105')][_0x072c('0x3a')]);_0x47dd43[_0x072c('0x40')]=_[_0x072c('0x3f')](_0x552729[_0x072c('0x40')]);_0x47dd43[_0x072c('0x41')]=_[_0x072c('0x42')](_0x47dd43[_0x072c('0x43')],_0x47dd43[_0x072c('0x40')]);_0x2acc06[_0x072c('0x44')]=_[_0x072c('0x42')](_0x47dd43[_0x072c('0x43')],qs[_0x072c('0x45')](_0x552729[_0x072c('0x40')][_0x072c('0x45')]));_0x2acc06[_0x072c('0x44')]=_0x2acc06[_0x072c('0x44')][_0x072c('0x46')]?_0x2acc06[_0x072c('0x44')]:_0x47dd43[_0x072c('0x43')];_0x2acc06['order']=qs[_0x072c('0x48')](_0x552729['query'][_0x072c('0x48')]);_0x2acc06[_0x072c('0x4a')]=qs[_0x072c('0x41')](_[_0x072c('0x49')](_0x552729['query'],_0x47dd43[_0x072c('0x41')]));if(_0x552729[_0x072c('0x40')][_0x072c('0x65')]){_0x2acc06['where']=_[_0x072c('0x4b')](_0x2acc06[_0x072c('0x4a')],{'$or':_[_0x072c('0x3e')](_0x2acc06[_0x072c('0x44')],function(_0x8fa71b){var _0x36e0b3={};_0x36e0b3[_0x8fa71b]={'$like':'%'+_0x552729[_0x072c('0x40')][_0x072c('0x65')]+'%'};return _0x36e0b3;})});}_0x2acc06=_['merge']({},_0x2acc06,_0x552729[_0x072c('0x66')]);return _0x7aa7e8[_0x072c('0xf3')](_0x2acc06);}})[_0x072c('0x1d')](function(_0x6ed28e){if(_0x6ed28e){_0x22f600=_0x6ed28e[_0x072c('0x46')];if(!_0x552729['query'][_0x072c('0x63')](_0x072c('0x47'))){_0x2acc06[_0x072c('0x2b')]=qs[_0x072c('0x2b')](_0x552729['query'][_0x072c('0x2b')]);_0x2acc06['offset']=qs['offset'](_0x552729['query']['offset']);}return _0x7aa7e8[_0x072c('0xf3')](_0x2acc06);}})['then'](function(_0x5e8047){if(_0x5e8047){return _0x5e8047?{'count':_0x22f600,'rows':_0x5e8047}:null;}})[_0x072c('0x1d')](respondWithResult(_0x338ea9,null))['catch'](handleError(_0x338ea9,null));};exports[_0x072c('0x106')]=function(_0xf8b94f,_0xa2dd11,_0xdc8009){var _0x50e550=_0xf8b94f[_0x072c('0x40')][_0x072c('0x107')]===_0x072c('0x108')?_0x072c('0x109'):_0x072c('0x10a');return db['ChatWebsite'][_0x072c('0x53')]({'attributes':['id',_0x50e550],'where':{'id':_0xf8b94f[_0x072c('0x5c')]['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0xa2dd11,null))[_0x072c('0x1d')](function(_0x499c3d){if(_0x499c3d){var _0x4daa79=_0x499c3d[_0x50e550];var _0x429197=_0x4daa79&&_0x4daa79[_0x072c('0x10b')]?_0x4daa79[_0x072c('0x10b')]:[];_0xa2dd11['send']({'fromKey':_[_0x072c('0x7b')](_0x4daa79[_0x072c('0x10c')])?undefined:_0x4daa79[_0x072c('0x10c')],'count':_0x429197[_0x072c('0x46')],'rows':_0x429197});}})[_0x072c('0x50')](handleError(_0xa2dd11,null));};exports[_0x072c('0x10d')]=function(_0x41b3e3,_0x1f0661,_0x26f04e){var _0x5c62c6={'raw':![],'where':{}};var _0x31a455={};var _0x58c38c={'count':0x0,'rows':[]};return db[_0x072c('0x39')][_0x072c('0x61')]({'where':{'id':_0x41b3e3['params']['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x1f0661,null))['then'](function(_0x1faa92){if(_0x1faa92){_0x31a455[_0x072c('0x43')]=_['keys'](db[_0x072c('0xd4')]['rawAttributes']);_0x31a455[_0x072c('0x40')]=_[_0x072c('0x3f')](_0x41b3e3[_0x072c('0x40')]);_0x31a455[_0x072c('0x41')]=_[_0x072c('0x42')](_0x31a455[_0x072c('0x43')],_0x31a455[_0x072c('0x40')]);_0x5c62c6[_0x072c('0x44')]=_[_0x072c('0x42')](_0x31a455[_0x072c('0x43')],qs[_0x072c('0x45')](_0x41b3e3[_0x072c('0x40')][_0x072c('0x45')]));_0x5c62c6[_0x072c('0x44')]=_0x5c62c6[_0x072c('0x44')][_0x072c('0x46')]?_0x5c62c6[_0x072c('0x44')]:_0x31a455['model'];if(!_0x41b3e3['query'][_0x072c('0x63')](_0x072c('0x47'))){_0x5c62c6[_0x072c('0x2b')]=qs[_0x072c('0x2b')](_0x41b3e3[_0x072c('0x40')][_0x072c('0x2b')]);_0x5c62c6[_0x072c('0x2a')]=qs[_0x072c('0x2a')](_0x41b3e3[_0x072c('0x40')][_0x072c('0x2a')]);}_0x5c62c6[_0x072c('0x64')]=qs[_0x072c('0x48')](_0x41b3e3['query'][_0x072c('0x48')]);_0x5c62c6[_0x072c('0x4a')]=qs[_0x072c('0x41')](_[_0x072c('0x49')](_0x41b3e3[_0x072c('0x40')],_0x31a455[_0x072c('0x41')]));_0x5c62c6['where']['ChatWebsiteId']=_0x1faa92['id'];if(_0x41b3e3[_0x072c('0x40')][_0x072c('0x65')]){_0x5c62c6[_0x072c('0x4a')]=_[_0x072c('0x4b')](_0x5c62c6['where'],{'$or':_['map'](_0x5c62c6[_0x072c('0x44')],function(_0x3df105){var _0x195761={};_0x195761[_0x3df105]={'$like':'%'+_0x41b3e3['query']['filter']+'%'};return _0x195761;})});}_0x5c62c6=_[_0x072c('0x4b')]({},_0x5c62c6,_0x41b3e3[_0x072c('0x66')]);return db[_0x072c('0xd4')][_0x072c('0x29')]({'where':_0x5c62c6['where']})[_0x072c('0x1d')](function(_0x59b00f){_0x58c38c['count']=_0x59b00f;if(_0x41b3e3[_0x072c('0x40')][_0x072c('0x4d')]){_0x5c62c6['include']=[{'all':!![]}];}else{_0x5c62c6[_0x072c('0x52')]=[{'model':db[_0x072c('0x98')],'as':_0x072c('0x10e'),'required':![]}];}return db['ChatOfflineMessage'][_0x072c('0x4e')](_0x5c62c6);})[_0x072c('0x1d')](function(_0x41541b){_0x58c38c['rows']=_0x41541b;return _0x58c38c;});}})[_0x072c('0x1d')](respondWithFilteredResult(_0x1f0661,_0x5c62c6))['catch'](handleError(_0x1f0661,null));};exports[_0x072c('0x10f')]=function(_0x1eccc7,_0x3d8717,_0x52b92b){return db[_0x072c('0x39')]['find']({'where':{'id':_0x1eccc7[_0x072c('0x5c')]['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x3d8717,null))['then'](function(_0x4e817c){if(_0x4e817c){return _0x4e817c['addAgents'](_0x1eccc7[_0x072c('0x55')][_0x072c('0x68')],_[_0x072c('0xe3')](_0x1eccc7[_0x072c('0x55')],[_0x072c('0x68'),'id'])||{})[_0x072c('0xb8')](function(_0x575a31){for(var _0x1504a4=0x0;_0x1504a4<_0x1eccc7[_0x072c('0x55')][_0x072c('0x68')]['length'];_0x1504a4+=0x1){socket['emit']('userChatWebsite:save',{'UserId':_0x1eccc7[_0x072c('0x55')][_0x072c('0x68')][_0x1504a4],'ChatWebsiteId':_0x1eccc7[_0x072c('0x5c')]['id']});}return _0x575a31;});}})[_0x072c('0x1d')](respondWithResult(_0x3d8717,null))['catch'](handleError(_0x3d8717,null));};exports[_0x072c('0x110')]=function(_0x27bddb,_0x39db6c,_0x48bb27){return db[_0x072c('0x39')][_0x072c('0x53')]({'where':{'id':_0x27bddb[_0x072c('0x5c')]['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x39db6c,null))[_0x072c('0x1d')](function(_0x707926){if(_0x707926){return _0x707926[_0x072c('0x110')](_0x27bddb[_0x072c('0x40')]['ids'])[_0x072c('0x1d')](function(){if(_[_0x072c('0x111')](_0x27bddb[_0x072c('0x40')]['ids'])){for(var _0x27bc78=0x0;_0x27bc78<_0x27bddb[_0x072c('0x40')]['ids'][_0x072c('0x46')];_0x27bc78+=0x1){socket[_0x072c('0x112')](_0x072c('0x113'),{'UserId':Number(_0x27bddb[_0x072c('0x40')]['ids'][_0x27bc78]),'ChatWebsiteId':Number(_0x27bddb[_0x072c('0x5c')]['id'])});}}else{socket[_0x072c('0x112')](_0x072c('0x113'),{'UserId':Number(_0x27bddb[_0x072c('0x40')][_0x072c('0x68')]),'ChatWebsiteId':Number(_0x27bddb[_0x072c('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x39db6c,null))['catch'](handleError(_0x39db6c,null));};exports['getAgents']=function(_0x2ce9c6,_0x4b33af,_0x27aa66){var _0x361283={};var _0x3b24bc={};var _0x4d3e1d;var _0x5ed193;return db[_0x072c('0x39')][_0x072c('0x61')]({'where':{'id':_0x2ce9c6[_0x072c('0x5c')]['id']}})[_0x072c('0x1d')](handleEntityNotFound(_0x4b33af,null))[_0x072c('0x1d')](function(_0x5bc8a4){if(_0x5bc8a4){_0x4d3e1d=_0x5bc8a4;_0x3b24bc[_0x072c('0x43')]=_[_0x072c('0x3f')](db[_0x072c('0xc3')][_0x072c('0x3a')]);_0x3b24bc['query']=_[_0x072c('0x3f')](_0x2ce9c6[_0x072c('0x40')]);_0x3b24bc[_0x072c('0x41')]=_[_0x072c('0x42')](_0x3b24bc[_0x072c('0x43')],_0x3b24bc[_0x072c('0x40')]);_0x361283[_0x072c('0x44')]=_[_0x072c('0x42')](_0x3b24bc['model'],qs[_0x072c('0x45')](_0x2ce9c6[_0x072c('0x40')][_0x072c('0x45')]));_0x361283[_0x072c('0x44')]=_0x361283[_0x072c('0x44')][_0x072c('0x46')]?_0x361283[_0x072c('0x44')]:_0x3b24bc[_0x072c('0x43')];_0x361283[_0x072c('0x64')]=qs[_0x072c('0x48')](_0x2ce9c6[_0x072c('0x40')]['sort']);_0x361283[_0x072c('0x4a')]=qs[_0x072c('0x41')](_[_0x072c('0x49')](_0x2ce9c6[_0x072c('0x40')],_0x3b24bc[_0x072c('0x41')]));if(_0x2ce9c6[_0x072c('0x40')]['filter']){_0x361283['where']=_[_0x072c('0x4b')](_0x361283[_0x072c('0x4a')],{'$or':_[_0x072c('0x3e')](_0x361283['attributes'],function(_0x56c2f8){var _0x52448b={};_0x52448b[_0x56c2f8]={'$like':'%'+_0x2ce9c6['query'][_0x072c('0x65')]+'%'};return _0x52448b;})});}_0x361283=_[_0x072c('0x4b')]({},_0x361283,_0x2ce9c6[_0x072c('0x66')]);return _0x4d3e1d[_0x072c('0x114')](_0x361283);}})['then'](function(_0x464596){if(_0x464596){_0x5ed193=_0x464596[_0x072c('0x46')];if(!_0x2ce9c6[_0x072c('0x40')]['hasOwnProperty']('nolimit')){_0x361283[_0x072c('0x2b')]=qs[_0x072c('0x2b')](_0x2ce9c6[_0x072c('0x40')][_0x072c('0x2b')]);_0x361283[_0x072c('0x2a')]=qs[_0x072c('0x2a')](_0x2ce9c6['query'][_0x072c('0x2a')]);}return _0x4d3e1d[_0x072c('0x114')](_0x361283);}})[_0x072c('0x1d')](function(_0x49438f){if(_0x49438f){return _0x49438f?{'count':_0x5ed193,'rows':_0x49438f}:null;}})[_0x072c('0x1d')](respondWithResult(_0x4b33af,null))['catch'](handleError(_0x4b33af,null));}; \ No newline at end of file +var _0x09a0=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','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~!@#$%^&-_=+[{]}.','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','ChatWebsites','UserProfileResource','name','send','index','Pause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','mandatoryDispositionPause','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','isNil','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','headers','user-agent','chat','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','account','applications','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','created','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','CompanyId','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','forwardOfflineAddress','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','getInteractions','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','License','chatLicenseExceeded','all','some','server/files/chat/iframe.js','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','textColor','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','omit','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2a2310,_0x2a05a7){var _0x4c6af7=function(_0x3d4a97){while(--_0x3d4a97){_0x2a2310['push'](_0x2a2310['shift']());}};_0x4c6af7(++_0x2a05a7);}(_0x09a0,0x10e));var _0x009a=function(_0xbb87b1,_0x5f00c7){_0xbb87b1=_0xbb87b1-0x0;var _0x4c3889=_0x09a0[_0xbb87b1];return _0x4c3889;};'use strict';var pdf=require(_0x009a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x009a('0x1'));var zipdir=require(_0x009a('0x2'));var jsonpatch=require(_0x009a('0x3'));var rp=require(_0x009a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x009a('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x009a('0x6'));var ejs=require(_0x009a('0x7'));var fs=require('fs');var _=require(_0x009a('0x8'));var squel=require(_0x009a('0x9'));var crypto=require(_0x009a('0xa'));var jsforce=require(_0x009a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x009a('0x6'));var querystring=require('querystring');var Papa=require(_0x009a('0xc'));var Redis=require('ioredis');var authService=require(_0x009a('0xd'));var qs=require(_0x009a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x009a('0xf'));var logger=require(_0x009a('0x10'))(_0x009a('0x11'));var utils=require(_0x009a('0x12'));var config=require(_0x009a('0x13'));var db=require(_0x009a('0x14'))['db'];config[_0x009a('0x15')]=_[_0x009a('0x16')](config[_0x009a('0x15')],{'host':_0x009a('0x17'),'port':0x18eb});var socket=require(_0x009a('0x18'))(new Redis(config[_0x009a('0x15')]));require(_0x009a('0x19'))[_0x009a('0x1a')](socket);var jayson=require(_0x009a('0x1b'));var client=jayson['client'][_0x009a('0x1c')]({'port':0x232c});var client9002=jayson[_0x009a('0x1d')][_0x009a('0x1c')]({'port':0x232a});var client9003=jayson['client'][_0x009a('0x1c')]({'port':0x232b});function checkPasswordPattern(_0x266755,_0x18f4f7,_0x44e524){if(_0x44e524){var _0x41d544=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41d544[_0x009a('0x1e')](_0x18f4f7)){return _0x266755;}else{throw new db[(_0x009a('0x1f'))][(_0x009a('0x20'))](_0x009a('0x21'));}}else{return _0x266755;}}function respondWithRpcPromise(_0x1095b2,_0x236430,_0x1ab81d,_0x41038f){return new BPromise(function(_0x4fa645,_0x57f18e){var _0x30f624=_0x41038f||client;return _0x30f624['request'](_0x1095b2,_0x1ab81d)[_0x009a('0x22')](function(_0x4adaa0){logger[_0x009a('0x23')](_0x009a('0x24'),_0x236430,_0x009a('0x25'));logger['debug'](_0x009a('0x26'),_0x236430,_0x009a('0x25'),JSON['stringify'](_0x4adaa0));if(_0x4adaa0[_0x009a('0x27')]){if(_0x4adaa0[_0x009a('0x27')]['code']===0x1f4){logger[_0x009a('0x27')](_0x009a('0x24'),_0x236430,_0x4adaa0[_0x009a('0x27')][_0x009a('0x28')]);return _0x57f18e(_0x4adaa0['error']['message']);}logger[_0x009a('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x236430,_0x4adaa0[_0x009a('0x27')][_0x009a('0x28')]);return _0x4fa645(_0x4adaa0[_0x009a('0x27')][_0x009a('0x28')]);}else{logger[_0x009a('0x23')](_0x009a('0x24'),_0x236430,'request\x20sent');_0x4fa645(_0x4adaa0['result'][_0x009a('0x28')]);}})['catch'](function(_0x1d310d){logger['error'](_0x009a('0x24'),_0x236430,_0x1d310d);_0x57f18e(_0x1d310d);});});}function respondWithStatusCode(_0x58747a,_0x438e1e){_0x438e1e=_0x438e1e||0xcc;return function(_0x26d4ba){if(_0x26d4ba){return _0x58747a[_0x009a('0x29')](_0x438e1e);}return _0x58747a[_0x009a('0x2a')](_0x438e1e)[_0x009a('0x2b')]();};}function respondWithResult(_0x27f768,_0x541ece){_0x541ece=_0x541ece||0xc8;return function(_0x3d7b13){if(_0x3d7b13){return _0x27f768[_0x009a('0x2a')](_0x541ece)[_0x009a('0x2c')](_0x3d7b13);}};}function respondWithFilteredResult(_0x12a61c,_0x67142a){return function(_0x2edc49){if(_0x2edc49){var _0x4a6e8e=_0x2edc49[_0x009a('0x2d')],_0x578bbf=_0x67142a[_0x009a('0x2e')],_0x951476=_0x67142a[_0x009a('0x2e')]+_0x67142a[_0x009a('0x2f')],_0xcd7537;if(_0x951476>=_0x4a6e8e){_0x951476=_0x4a6e8e;_0xcd7537=0xc8;}else{_0xcd7537=0xce;}_0x12a61c['status'](_0xcd7537);return _0x12a61c[_0x009a('0x30')](_0x009a('0x31'),_0x578bbf+'-'+_0x951476+'/'+_0x4a6e8e)[_0x009a('0x2c')](_0x2edc49);}return null;};}function patchUpdates(_0x20d945){return function(_0x3042ed){try{jsonpatch[_0x009a('0x32')](_0x3042ed,_0x20d945,!![]);}catch(_0x1cc7a7){return BPromise[_0x009a('0x33')](_0x1cc7a7);}return _0x3042ed[_0x009a('0x34')]();};}function saveUpdates(_0x3cc04e,_0x57dfcd){return function(_0x4b22d8){if(_0x4b22d8){return _0x4b22d8[_0x009a('0x35')](_0x3cc04e)['then'](function(_0x314b1f){return _0x314b1f;});}return null;};}function removeEntity(_0x5d2e2b,_0x3f2f7c){return function(_0x5e8e0b){if(_0x5e8e0b){return _0x5e8e0b[_0x009a('0x36')]()['then'](function(){var _0x30a333=_0x5e8e0b['get']({'plain':!![]});var _0x2fdfbb=_0x009a('0x37');return db[_0x009a('0x38')][_0x009a('0x36')]({'where':{'type':_0x2fdfbb,'resourceId':_0x30a333['id']}})[_0x009a('0x22')](function(){return _0x5e8e0b;});})[_0x009a('0x22')](function(){_0x5d2e2b['status'](0xcc)[_0x009a('0x2b')]();});}};}function handleEntityNotFound(_0x5e6f0d,_0x27a555){return function(_0x10b001){if(!_0x10b001){_0x5e6f0d[_0x009a('0x29')](0x194);}return _0x10b001;};}function handleError(_0x33d5d6,_0x531adc){_0x531adc=_0x531adc||0x1f4;return function(_0x419f8b){logger[_0x009a('0x27')](_0x419f8b['stack']);if(_0x419f8b['name']){delete _0x419f8b[_0x009a('0x39')];}_0x33d5d6['status'](_0x531adc)[_0x009a('0x3a')](_0x419f8b);};}exports[_0x009a('0x3b')]=function(_0x478788,_0x42e546){var _0x3efe67={'include':[{'model':db[_0x009a('0x3c')],'as':'mandatoryDispositionPause'}]},_0x5c139b={},_0x1acec8={'count':0x0,'rows':[]};var _0x4df397=_['map'](db[_0x009a('0x3d')][_0x009a('0x3e')],function(_0x2d27f){return{'name':_0x2d27f[_0x009a('0x3f')],'type':_0x2d27f[_0x009a('0x40')][_0x009a('0x41')]};});_0x5c139b[_0x009a('0x42')]=_[_0x009a('0x43')](_0x4df397,'name');_0x5c139b[_0x009a('0x44')]=_['keys'](_0x478788[_0x009a('0x44')]);_0x5c139b['filters']=_[_0x009a('0x45')](_0x5c139b[_0x009a('0x42')],_0x5c139b[_0x009a('0x44')]);_0x3efe67[_0x009a('0x46')]=_['intersection'](_0x5c139b['model'],qs[_0x009a('0x47')](_0x478788['query']['fields']));_0x3efe67[_0x009a('0x46')]=_0x3efe67[_0x009a('0x46')][_0x009a('0x48')]?_0x3efe67[_0x009a('0x46')]:_0x5c139b[_0x009a('0x42')];if(!_0x478788[_0x009a('0x44')][_0x009a('0x49')](_0x009a('0x4a'))){_0x3efe67[_0x009a('0x2f')]=qs[_0x009a('0x2f')](_0x478788[_0x009a('0x44')][_0x009a('0x2f')]);_0x3efe67[_0x009a('0x2e')]=qs[_0x009a('0x2e')](_0x478788[_0x009a('0x44')][_0x009a('0x2e')]);}_0x3efe67[_0x009a('0x4b')]=qs[_0x009a('0x4c')](_0x478788[_0x009a('0x44')]['sort']);_0x3efe67[_0x009a('0x4d')]=qs[_0x009a('0x4e')](_[_0x009a('0x4f')](_0x478788[_0x009a('0x44')],_0x5c139b[_0x009a('0x4e')]));if(_0x478788[_0x009a('0x44')][_0x009a('0x50')]){_0x3efe67[_0x009a('0x4d')]=_[_0x009a('0x51')](_0x3efe67['where'],{'$or':_['map'](_0x4df397,function(_0x4116d9){if(_0x4116d9[_0x009a('0x40')]!==_0x009a('0x52')){var _0x29be0e={};_0x29be0e[_0x4116d9[_0x009a('0x39')]]={'$like':'%'+_0x478788[_0x009a('0x44')][_0x009a('0x50')]+'%'};return _0x29be0e;}})});}_0x3efe67=_[_0x009a('0x51')]({},_0x3efe67,_0x478788[_0x009a('0x53')]);var _0xf7a0db={'where':_0x3efe67[_0x009a('0x4d')]};return db[_0x009a('0x3d')]['count'](_0xf7a0db)[_0x009a('0x22')](function(_0x3839a4){_0x1acec8[_0x009a('0x2d')]=_0x3839a4;if(_0x478788[_0x009a('0x44')][_0x009a('0x54')]){_0x3efe67[_0x009a('0x55')]=[{'all':!![]}];}return db[_0x009a('0x3d')][_0x009a('0x56')](_0x3efe67);})[_0x009a('0x22')](function(_0x13a1f5){_0x1acec8[_0x009a('0x57')]=_0x13a1f5;return _0x1acec8;})[_0x009a('0x22')](respondWithFilteredResult(_0x42e546,_0x3efe67))[_0x009a('0x58')](handleError(_0x42e546,null));};exports[_0x009a('0x59')]=function(_0x5cb459,_0x2496de){var _0x453600={'raw':![],'where':{'id':_0x5cb459['params']['id']},'include':[{'model':db[_0x009a('0x3c')],'as':_0x009a('0x5a')}]},_0x1b50dc={};_0x1b50dc[_0x009a('0x42')]=_['keys'](db[_0x009a('0x3d')][_0x009a('0x3e')]);_0x1b50dc[_0x009a('0x44')]=_[_0x009a('0x5b')](_0x5cb459[_0x009a('0x44')]);_0x1b50dc[_0x009a('0x4e')]=_[_0x009a('0x45')](_0x1b50dc[_0x009a('0x42')],_0x1b50dc[_0x009a('0x44')]);_0x453600[_0x009a('0x46')]=_[_0x009a('0x45')](_0x1b50dc[_0x009a('0x42')],qs[_0x009a('0x47')](_0x5cb459[_0x009a('0x44')][_0x009a('0x47')]));_0x453600[_0x009a('0x46')]=_0x453600[_0x009a('0x46')][_0x009a('0x48')]?_0x453600[_0x009a('0x46')]:_0x1b50dc[_0x009a('0x42')];if(_0x5cb459[_0x009a('0x44')][_0x009a('0x54')]){_0x453600[_0x009a('0x55')]=[{'all':!![]}];}_0x453600=_['merge']({},_0x453600,_0x5cb459['options']);return db['ChatWebsite'][_0x009a('0x5c')](_0x453600)[_0x009a('0x22')](handleEntityNotFound(_0x2496de,null))[_0x009a('0x22')](respondWithResult(_0x2496de,null))[_0x009a('0x58')](handleError(_0x2496de,null));};exports['create']=function(_0x4d8cf,_0x588420){return db['ChatWebsite'][_0x009a('0x5d')](_0x4d8cf['body'],{})[_0x009a('0x22')](function(_0x38c646){var _0x221583=_0x4d8cf[_0x009a('0x5e')][_0x009a('0x5f')]({'plain':!![]});if(!_0x221583)throw new Error(_0x009a('0x60'));if(_0x221583[_0x009a('0x61')]===_0x009a('0x5e')){var _0x2f1ad3=_0x38c646[_0x009a('0x5f')]({'plain':!![]});var _0x3a69fe=_0x009a('0x37');return db[_0x009a('0x62')][_0x009a('0x5c')]({'where':{'name':_0x3a69fe,'userProfileId':_0x221583['userProfileId']},'raw':!![]})['then'](function(_0x26505d){if(_0x26505d&&_0x26505d[_0x009a('0x63')]===0x0){return db[_0x009a('0x38')][_0x009a('0x5d')]({'name':_0x2f1ad3['name'],'resourceId':_0x2f1ad3['id'],'type':_0x26505d['name'],'sectionId':_0x26505d['id']},{})[_0x009a('0x22')](function(){return _0x38c646;});}else{return _0x38c646;}})['catch'](function(_0x300fd2){logger['error'](_0x009a('0x64'),_0x300fd2);throw _0x300fd2;});}return _0x38c646;})['then'](respondWithResult(_0x588420,0xc9))[_0x009a('0x58')](handleError(_0x588420,null));};exports['update']=function(_0x4b0d40,_0x1404c5){if(_0x4b0d40[_0x009a('0x65')]['id']){delete _0x4b0d40[_0x009a('0x65')]['id'];}return db['ChatWebsite'][_0x009a('0x5c')]({'where':{'id':_0x4b0d40[_0x009a('0x66')]['id']},'include':[{'model':db[_0x009a('0x3c')],'as':_0x009a('0x5a')}]})['then'](handleEntityNotFound(_0x1404c5,null))[_0x009a('0x22')](saveUpdates(_0x4b0d40[_0x009a('0x65')],null))[_0x009a('0x22')](respondWithResult(_0x1404c5,null))['catch'](handleError(_0x1404c5,null));};exports[_0x009a('0x36')]=function(_0x42e096,_0x5b47a8){return db[_0x009a('0x3d')][_0x009a('0x5c')]({'where':{'id':_0x42e096['params']['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x5b47a8,null))[_0x009a('0x22')](removeEntity(_0x5b47a8,null))[_0x009a('0x58')](handleError(_0x5b47a8,null));};exports[_0x009a('0x67')]=function(_0x22c655,_0x25ac66){return db[_0x009a('0x3d')][_0x009a('0x67')]()[_0x009a('0x22')](respondWithResult(_0x25ac66,null))[_0x009a('0x58')](handleError(_0x25ac66,null));};exports[_0x009a('0x68')]=function(_0x4a1745,_0x52b17f,_0x354622){if(_0x4a1745['body']['id']){delete _0x4a1745['body']['id'];}return db[_0x009a('0x3d')]['find']({'where':{'id':_0x4a1745[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x52b17f,null))['then'](function(_0x4bacea){if(_0x4bacea){_0x4a1745[_0x009a('0x65')][_0x009a('0x69')]=_0x4bacea['id'];return db[_0x009a('0x6a')][_0x009a('0x5d')](_0x4a1745[_0x009a('0x65')]);}})[_0x009a('0x22')](respondWithResult(_0x52b17f,null))['catch'](handleError(_0x52b17f,null));};exports[_0x009a('0x6b')]=function(_0x997218,_0x3f8fc1,_0x24ed04){var _0x15c807={'raw':![],'where':{}};var _0x2ff7d3={};var _0x1f2ff2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x009a('0x6c')]({'where':{'id':_0x997218[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x3f8fc1,null))['then'](function(_0x1f4c0c){if(_0x1f4c0c){_0x2ff7d3[_0x009a('0x42')]=_[_0x009a('0x5b')](db[_0x009a('0x6a')][_0x009a('0x3e')]);_0x2ff7d3[_0x009a('0x44')]=_[_0x009a('0x5b')](_0x997218[_0x009a('0x44')]);_0x2ff7d3['filters']=_[_0x009a('0x45')](_0x2ff7d3[_0x009a('0x42')],_0x2ff7d3[_0x009a('0x44')]);_0x15c807[_0x009a('0x46')]=_[_0x009a('0x45')](_0x2ff7d3[_0x009a('0x42')],qs[_0x009a('0x47')](_0x997218['query'][_0x009a('0x47')]));_0x15c807['attributes']=_0x15c807[_0x009a('0x46')][_0x009a('0x48')]?_0x15c807['attributes']:_0x2ff7d3['model'];if(!_0x997218[_0x009a('0x44')][_0x009a('0x49')](_0x009a('0x4a'))){_0x15c807[_0x009a('0x2f')]=qs['limit'](_0x997218['query'][_0x009a('0x2f')]);_0x15c807[_0x009a('0x2e')]=qs[_0x009a('0x2e')](_0x997218['query'][_0x009a('0x2e')]);}_0x15c807[_0x009a('0x4b')]=qs[_0x009a('0x4c')](_0x997218['query'][_0x009a('0x4c')]);_0x15c807['where']=qs[_0x009a('0x4e')](_['pick'](_0x997218[_0x009a('0x44')],_0x2ff7d3[_0x009a('0x4e')]));_0x15c807[_0x009a('0x4d')][_0x009a('0x69')]=_0x1f4c0c['id'];if(_0x997218['query'][_0x009a('0x50')]){_0x15c807[_0x009a('0x4d')]=_[_0x009a('0x51')](_0x15c807['where'],{'$or':_[_0x009a('0x43')](_0x15c807[_0x009a('0x46')],function(_0x840844){var _0x246e0d={};_0x246e0d[_0x840844]={'$like':'%'+_0x997218[_0x009a('0x44')]['filter']+'%'};return _0x246e0d;})});}_0x15c807=_['merge']({},_0x15c807,_0x997218[_0x009a('0x53')]);return db[_0x009a('0x6a')]['count']({'where':_0x15c807[_0x009a('0x4d')]})['then'](function(_0x131796){_0x1f2ff2[_0x009a('0x2d')]=_0x131796;if(_0x997218['query']['includeAll']){_0x15c807[_0x009a('0x55')]=[{'all':!![]}];}return db[_0x009a('0x6a')][_0x009a('0x56')](_0x15c807);})[_0x009a('0x22')](function(_0x453f3b){_0x1f2ff2[_0x009a('0x57')]=_0x453f3b;return _0x1f2ff2;});}})['then'](respondWithFilteredResult(_0x3f8fc1,_0x15c807))[_0x009a('0x58')](handleError(_0x3f8fc1,null));};exports['removeDispositions']=function(_0x23a9b4,_0x565dd9,_0x21413a){return db[_0x009a('0x3d')]['find']({'where':{'id':_0x23a9b4[_0x009a('0x66')]['id']}})['then'](handleEntityNotFound(_0x565dd9,null))[_0x009a('0x22')](function(_0x10bba5){if(_0x10bba5){return _0x10bba5[_0x009a('0x6d')](_0x23a9b4[_0x009a('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x565dd9,null))[_0x009a('0x58')](handleError(_0x565dd9,null));};exports[_0x009a('0x6e')]=function(_0x66ba52,_0x2ddc69,_0x3f2805){if(_0x66ba52[_0x009a('0x65')]['id']){delete _0x66ba52[_0x009a('0x65')]['id'];}return db[_0x009a('0x3d')][_0x009a('0x5c')]({'where':{'id':_0x66ba52['params']['id']}})['then'](handleEntityNotFound(_0x2ddc69,null))['then'](function(_0x375622){if(_0x375622){_0x66ba52['body'][_0x009a('0x69')]=_0x375622['id'];return db[_0x009a('0x6f')][_0x009a('0x5d')](_0x66ba52[_0x009a('0x65')]);}})[_0x009a('0x22')](respondWithResult(_0x2ddc69,null))[_0x009a('0x58')](handleError(_0x2ddc69,null));};exports[_0x009a('0x70')]=function(_0x643b50,_0x381a4c,_0x587e11){var _0x275abb={'raw':![],'where':{}};var _0x1ff256={};var _0x1c96cb={'count':0x0,'rows':[]};return db[_0x009a('0x3d')]['findOne']({'where':{'id':_0x643b50[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x381a4c,null))[_0x009a('0x22')](function(_0x161a5d){if(_0x161a5d){_0x1ff256[_0x009a('0x42')]=_['keys'](db['CannedAnswer'][_0x009a('0x3e')]);_0x1ff256[_0x009a('0x44')]=_[_0x009a('0x5b')](_0x643b50[_0x009a('0x44')]);_0x1ff256[_0x009a('0x4e')]=_[_0x009a('0x45')](_0x1ff256['model'],_0x1ff256[_0x009a('0x44')]);_0x275abb['attributes']=_[_0x009a('0x45')](_0x1ff256['model'],qs[_0x009a('0x47')](_0x643b50[_0x009a('0x44')][_0x009a('0x47')]));_0x275abb[_0x009a('0x46')]=_0x275abb[_0x009a('0x46')]['length']?_0x275abb['attributes']:_0x1ff256[_0x009a('0x42')];if(!_0x643b50[_0x009a('0x44')][_0x009a('0x49')](_0x009a('0x4a'))){_0x275abb[_0x009a('0x2f')]=qs['limit'](_0x643b50[_0x009a('0x44')][_0x009a('0x2f')]);_0x275abb[_0x009a('0x2e')]=qs[_0x009a('0x2e')](_0x643b50['query']['offset']);}_0x275abb[_0x009a('0x4b')]=qs['sort'](_0x643b50[_0x009a('0x44')]['sort']);_0x275abb[_0x009a('0x4d')]=qs[_0x009a('0x4e')](_[_0x009a('0x4f')](_0x643b50[_0x009a('0x44')],_0x1ff256['filters']));_0x275abb[_0x009a('0x4d')]['ChatWebsiteId']=_0x161a5d['id'];if(_0x643b50[_0x009a('0x44')][_0x009a('0x50')]){_0x275abb[_0x009a('0x4d')]=_['merge'](_0x275abb[_0x009a('0x4d')],{'$or':_['map'](_0x275abb['attributes'],function(_0x53bbd1){var _0x112236={};_0x112236[_0x53bbd1]={'$like':'%'+_0x643b50[_0x009a('0x44')]['filter']+'%'};return _0x112236;})});}_0x275abb=_['merge']({},_0x275abb,_0x643b50['options']);return db['CannedAnswer']['count']({'where':_0x275abb[_0x009a('0x4d')]})[_0x009a('0x22')](function(_0x40dbfe){_0x1c96cb['count']=_0x40dbfe;if(_0x643b50[_0x009a('0x44')][_0x009a('0x54')]){_0x275abb['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x275abb);})['then'](function(_0x242172){_0x1c96cb[_0x009a('0x57')]=_0x242172;return _0x1c96cb;});}})['then'](respondWithFilteredResult(_0x381a4c,_0x275abb))[_0x009a('0x58')](handleError(_0x381a4c,null));};exports[_0x009a('0x71')]=function(_0x3e3e65,_0x40bf9e,_0x31a6c9){return db[_0x009a('0x3d')][_0x009a('0x5c')]({'where':{'id':_0x3e3e65[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x40bf9e,null))[_0x009a('0x22')](function(_0x2f58a6){if(_0x2f58a6){return _0x2f58a6[_0x009a('0x71')](_0x3e3e65[_0x009a('0x44')][_0x009a('0x72')]);}})[_0x009a('0x22')](respondWithStatusCode(_0x40bf9e,null))[_0x009a('0x58')](handleError(_0x40bf9e,null));};exports[_0x009a('0x73')]=function(_0x251423,_0x253341,_0x46761a){_0x251423[_0x009a('0x65')][_0x009a('0x74')]=_0x251423[_0x009a('0x75')][_0x009a('0x76')];return db[_0x009a('0x3d')][_0x009a('0x5c')]({'where':{'id':_0x251423[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x253341,null))['then'](saveUpdates(_0x251423['body'],null))[_0x009a('0x22')](respondWithResult(_0x253341,null))[_0x009a('0x58')](handleError(_0x253341,null));};exports[_0x009a('0x77')]=function(_0x3034e1,_0x12e9e1,_0x2c1ec6){_0x3034e1[_0x009a('0x65')][_0x009a('0x78')]=_0x3034e1[_0x009a('0x75')][_0x009a('0x76')];return db[_0x009a('0x3d')][_0x009a('0x5c')]({'where':{'id':_0x3034e1[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x12e9e1,null))['then'](saveUpdates(_0x3034e1[_0x009a('0x65')],null))[_0x009a('0x22')](respondWithResult(_0x12e9e1,null))[_0x009a('0x58')](handleError(_0x12e9e1,null));};exports[_0x009a('0x79')]=function(_0x2b6b3d,_0x10a0f1,_0x1e658c){_0x2b6b3d['body'][_0x009a('0x7a')]=_0x2b6b3d['file'][_0x009a('0x76')];return db[_0x009a('0x3d')][_0x009a('0x5c')]({'where':{'id':_0x2b6b3d[_0x009a('0x66')]['id']}})['then'](handleEntityNotFound(_0x10a0f1,null))[_0x009a('0x22')](saveUpdates(_0x2b6b3d[_0x009a('0x65')],null))[_0x009a('0x22')](respondWithResult(_0x10a0f1,null))[_0x009a('0x58')](handleError(_0x10a0f1,null));};exports[_0x009a('0x7b')]=function(_0x24d9d8,_0x27380f,_0x2deaf2){_0x24d9d8[_0x009a('0x65')][_0x009a('0x7c')]=_0x24d9d8[_0x009a('0x75')][_0x009a('0x76')];return db['ChatWebsite']['find']({'where':{'id':_0x24d9d8['params']['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x27380f,null))[_0x009a('0x22')](saveUpdates(_0x24d9d8[_0x009a('0x65')],null))[_0x009a('0x22')](respondWithResult(_0x27380f,null))[_0x009a('0x58')](handleError(_0x27380f,null));};exports[_0x009a('0x7d')]=function(_0x53db78,_0x36b967,_0x114cf7){var _0x39b6f0=path[_0x009a('0x7e')](config[_0x009a('0x7f')],_0x009a('0x80'));var _0x78ccb5={'where':{'id':_0x53db78['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x3689cc=![];return require(_0x009a('0x81'))[_0x009a('0x82')]()[_0x009a('0x22')](function(_0xfe8281){if(_0xfe8281){_0x3689cc=_0xfe8281[_0x009a('0x83')];}})[_0x009a('0x22')](function(){return db['ChatWebsite'][_0x009a('0x5c')](_0x78ccb5);})['then'](handleEntityNotFound(_0x36b967,null))[_0x009a('0x22')](function(_0x1f7a16){if(_0x1f7a16){if(!_['isNil'](_0x1f7a16[_0x009a('0x74')])){if(fs[_0x009a('0x84')](path[_0x009a('0x7e')](config[_0x009a('0x7f')],_0x009a('0x85'),_0x1f7a16[_0x009a('0x74')]))&&_0x3689cc){_0x39b6f0=path[_0x009a('0x7e')](config[_0x009a('0x7f')],_0x009a('0x85'),_0x1f7a16[_0x009a('0x74')]);}}return _0x36b967[_0x009a('0x86')](_0x39b6f0);}})[_0x009a('0x58')](handleError(_0x36b967,null));};exports[_0x009a('0x87')]=function(_0x5b842c,_0xe21e50,_0x59051b){var _0x32edc4=path[_0x009a('0x7e')](config[_0x009a('0x7f')],'server/files/images/avatars/default_avatar.png');var _0x5b9166={'where':{'id':_0x5b842c[_0x009a('0x66')]['id']},'attributes':['id',_0x009a('0x78')],'raw':!![]};return db[_0x009a('0x3d')][_0x009a('0x5c')](_0x5b9166)[_0x009a('0x22')](handleEntityNotFound(_0xe21e50,null))[_0x009a('0x22')](function(_0x582111){if(_0x582111){if(!_[_0x009a('0x88')](_0x582111[_0x009a('0x78')])){if(fs[_0x009a('0x84')](path['join'](config[_0x009a('0x7f')],'server/files/images/avatars/',_0x582111[_0x009a('0x78')]))){_0x32edc4=path['join'](config['root'],_0x009a('0x89'),_0x582111[_0x009a('0x78')]);}}return _0xe21e50[_0x009a('0x86')](_0x32edc4);}})[_0x009a('0x58')](handleError(_0xe21e50,null));};exports[_0x009a('0x8a')]=function(_0x226751,_0x5f3c20,_0x4aab4f){var _0x52fc75=path['join'](config[_0x009a('0x7f')],_0x009a('0x8b'));var _0x24830f={'where':{'id':_0x226751['params']['id']},'attributes':['id',_0x009a('0x7a'),_0x009a('0x8c')],'raw':!![]};return db['ChatWebsite'][_0x009a('0x5c')](_0x24830f)[_0x009a('0x22')](handleEntityNotFound(_0x5f3c20,null))[_0x009a('0x22')](function(_0x21f791){if(_0x21f791){if(!_[_0x009a('0x88')](_0x21f791[_0x009a('0x7a')])){if(fs[_0x009a('0x84')](path['join'](config[_0x009a('0x7f')],'server/files/images/avatars/',_0x21f791[_0x009a('0x7a')]))&&_0x21f791[_0x009a('0x8c')]){_0x52fc75=path[_0x009a('0x7e')](config[_0x009a('0x7f')],_0x009a('0x89'),_0x21f791[_0x009a('0x7a')]);}}return _0x5f3c20[_0x009a('0x86')](_0x52fc75);}})[_0x009a('0x58')](handleError(_0x5f3c20,null));};exports[_0x009a('0x8d')]=function(_0x2b85e3,_0x489303,_0x12583a){var _0x345153=path[_0x009a('0x7e')](config[_0x009a('0x7f')],_0x009a('0x8e'));var _0xfe4e5e={'where':{'id':_0x2b85e3[_0x009a('0x66')]['id']},'attributes':['id',_0x009a('0x7c')],'raw':!![]};return db['ChatWebsite'][_0x009a('0x5c')](_0xfe4e5e)['then'](handleEntityNotFound(_0x489303,null))[_0x009a('0x22')](function(_0x5459a4){if(_0x5459a4){if(!_['isNil'](_0x5459a4[_0x009a('0x7c')])){if(fs[_0x009a('0x84')](path['join'](config[_0x009a('0x7f')],_0x009a('0x89'),_0x5459a4[_0x009a('0x7c')]))){_0x345153=path[_0x009a('0x7e')](config[_0x009a('0x7f')],_0x009a('0x89'),_0x5459a4[_0x009a('0x7c')]);}}return _0x489303[_0x009a('0x86')](_0x345153);}})[_0x009a('0x58')](handleError(_0x489303,null));};exports[_0x009a('0x8f')]=function(_0x24eae8,_0x458d32,_0x3227b5){var _0x14a89b=require(_0x009a('0x90'));var _0x431db7=new _0x14a89b();var _0x26550c=_0x431db7['setUA'](_0x24eae8[_0x009a('0x91')][_0x009a('0x92')])['getResult']();var _0x1dd572={'body':_0x24eae8[_0x009a('0x65')],'channel':_0x009a('0x93')};var _0x1d5164=[];var _0x4f9fa6=[];var _0x55cc1c={};var _0x2ec461=![];return db[_0x009a('0x94')][_0x009a('0x67')]()['then'](function(_0x9603e7){if(!_0x9603e7){throw new db[(_0x009a('0x1f'))][(_0x009a('0x20'))](_0x009a('0x95'));}_0x1d5164=_[_0x009a('0x96')](_[_0x009a('0x5b')](_0x9603e7),['createdAt','updatedAt']);_0x4f9fa6=_[_0x009a('0x96')](_[_0x009a('0x5b')](_0x9603e7),[_0x009a('0x97'),_0x009a('0x98'),'CompanyId',_0x009a('0x99')]);if(_0x24eae8['body']['id']){delete _0x24eae8[_0x009a('0x65')]['id'];}if(_['isNil'](_0x24eae8['body'][_0x009a('0x9a')])){throw new db[(_0x009a('0x1f'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x009a('0x88')](_0x24eae8[_0x009a('0x65')][_0x009a('0x65')])||_0x24eae8[_0x009a('0x65')][_0x009a('0x65')]===''){throw new db['Sequelize'][(_0x009a('0x20'))](_0x009a('0x9b'));}if(_[_0x009a('0x88')](_0x24eae8[_0x009a('0x65')][_0x009a('0x9c')])){throw new db[(_0x009a('0x1f'))]['ValidationError'](_0x009a('0x9d')+_0x4f9fa6);}if(!_[_0x009a('0x9e')](_0x4f9fa6,_0x24eae8[_0x009a('0x65')]['mapKey'])){throw new db[(_0x009a('0x1f'))]['ValidationError'](_0x009a('0x9f')+_0x4f9fa6);}_0x55cc1c[_0x24eae8['body']['mapKey']]=_0x24eae8[_0x009a('0x65')][_0x009a('0x9a')];})[_0x009a('0x22')](function(){return db[_0x009a('0x3d')][_0x009a('0x5c')]({'where':{'id':_0x24eae8['params']['id']},'include':[{'model':db[_0x009a('0xa0')],'as':_0x009a('0xa1'),'include':[{'model':db[_0x009a('0x94')],'as':_0x009a('0xa2'),'where':_0x55cc1c,'limit':0x1,'order':[['updatedAt',_0x009a('0xa3')]]}]},{'model':db[_0x009a('0xa4')],'as':'Applications'}]});})[_0x009a('0x22')](handleEntityNotFound(_0x458d32,null))['then'](function(_0x2260f1){if(_0x2260f1&&_0x2260f1[_0x009a('0xa1')]){_0x1dd572[_0x009a('0xa5')]=_0x2260f1;_0x1dd572['applications']=_0x2260f1['Applications'];_0x1dd572['list']=_0x2260f1[_0x009a('0xa1')];_0x1dd572[_0x009a('0xa6')]=_[_0x009a('0xa7')](_0x1dd572['applications'],[_0x009a('0xa8')],[_0x009a('0xa9')]);if(_0x1dd572['account']['Applications']){delete _0x1dd572[_0x009a('0xa5')]['Applications'];}if(_0x1dd572[_0x009a('0xa5')][_0x009a('0xa1')]&&_0x1dd572[_0x009a('0xa5')]['List'][_0x009a('0xa2')]['length']){return _0x1dd572[_0x009a('0xa5')][_0x009a('0xa1')][_0x009a('0xa2')][0x0];}var _0x571eba=_[_0x009a('0x16')](_0x24eae8[_0x009a('0x65')],{'firstName':_0x24eae8[_0x009a('0x65')]['from'],'ListId':_0x2260f1['ListId']});_0x571eba[_0x24eae8[_0x009a('0x65')]['mapKey']]=_0x24eae8[_0x009a('0x65')][_0x009a('0x9a')];return db['CmContact'][_0x009a('0x5d')](_0x571eba,{'fields':_0x1d5164,'raw':!![]});}})[_0x009a('0x22')](handleEntityNotFound(_0x458d32,null))[_0x009a('0x22')](function(_0x39992f){_0x1dd572[_0x009a('0xaa')]=_0x39992f;var _0x3d79ad=_0x24eae8[_0x009a('0x65')][_0x009a('0xab')];if(_0x24eae8['headers']['cf-connecting-ip']){_0x3d79ad=_0x24eae8[_0x009a('0x91')][_0x009a('0xac')];}else if(_0x24eae8['headers']['x-forwarded-for']){_0x3d79ad=_[_0x009a('0xad')](_0x24eae8[_0x009a('0x91')][_0x009a('0xae')][_0x009a('0xaf')](','));}if(_0x39992f){var _0x4ff220={'ContactId':_0x39992f['id'],'ChatWebsiteId':_0x24eae8[_0x009a('0x66')]['id'],'from':(_0x39992f[_0x009a('0xb0')]||'')+'\x20'+(_0x39992f[_0x009a('0xb1')]||''),'customerIp':_0x3d79ad,'customerPort':_0x24eae8[_0x009a('0x91')][_0x009a('0xb2')]?_0x24eae8[_0x009a('0x91')][_0x009a('0xb2')]:null,'referer':_0x24eae8[_0x009a('0x65')][_0x009a('0xb3')],'browserName':_0x26550c[_0x009a('0xb4')][_0x009a('0x39')]&&_0x26550c[_0x009a('0xb4')][_0x009a('0xb5')]?util['format'](_0x009a('0xb6'),_0x26550c[_0x009a('0xb4')][_0x009a('0x39')],_0x26550c[_0x009a('0xb4')][_0x009a('0xb5')]):'unknown','browserVersion':_0x26550c['browser'][_0x009a('0xb5')]||_0x009a('0xb7'),'osName':util[_0x009a('0xb8')]('%s\x20%s',_0x26550c['os'][_0x009a('0x39')],_0x26550c['os'][_0x009a('0xb5')]),'osVersion':_0x26550c['os'][_0x009a('0xb5')],'deviceModel':_0x26550c[_0x009a('0xb9')][_0x009a('0x42')]&&_0x26550c[_0x009a('0xb9')][_0x009a('0xba')]?util[_0x009a('0xb8')](_0x009a('0xbb'),_0x26550c[_0x009a('0xb9')][_0x009a('0x42')],_0x26550c['device'][_0x009a('0xba')],_0x26550c[_0x009a('0xb9')]['type']):null,'deviceVendor':_0x26550c[_0x009a('0xb9')]['vendor'],'deviceType':_0x26550c[_0x009a('0xb9')][_0x009a('0x40')],'formData':JSON[_0x009a('0xbc')](_0x24eae8['body'])};var _0x53aa8c={'ChatWebsiteId':_0x24eae8[_0x009a('0x66')]['id'],'closed':![]};if(_0x24eae8[_0x009a('0x65')][_0x009a('0xbd')]){_0x53aa8c['threadId']=_0x24eae8[_0x009a('0x65')]['threadId'];return db[_0x009a('0xbe')]['find']({'where':_0x53aa8c})[_0x009a('0x22')](function(_0x13e91c){if(_0x13e91c){return[_0x13e91c,![]];}_0x4ff220[_0x009a('0xbd')]=_0x24eae8[_0x009a('0x65')]['threadId'];_0x4ff220[_0x009a('0xbf')]=_0x24eae8[_0x009a('0x65')][_0x009a('0xbf')];return db[_0x009a('0xbe')][_0x009a('0x5d')](_0x4ff220)[_0x009a('0x22')](function(_0x16ff3e){return[_0x16ff3e,!![]];});});}_0x53aa8c[_0x009a('0xc0')]=_0x39992f['id'];if(_0x24eae8['body'][_0x009a('0xc1')]&&_0x24eae8[_0x009a('0x65')][_0x009a('0xc1')]['id']){_0x53aa8c['id']=_0x24eae8[_0x009a('0x65')][_0x009a('0xc1')]['id'];return db[_0x009a('0xbe')][_0x009a('0x5c')]({'where':_0x53aa8c})[_0x009a('0x22')](function(_0x578f1b){if(_0x578f1b){return[_0x578f1b,![]];}return db[_0x009a('0xbe')][_0x009a('0x5d')](_0x4ff220)[_0x009a('0x22')](function(_0x3d1ae6){return[_0x3d1ae6,!![]];});});}return db['ChatInteraction'][_0x009a('0x5d')](_0x4ff220)[_0x009a('0x22')](function(_0x455f1a){return[_0x455f1a,!![]];});}})[_0x009a('0xc2')](function(_0x16b3ee,_0x2c592d){if(_0x16b3ee){_0x2ec461=_0x2c592d;if(!_0x2c592d){var _0x5ee9b2={'from':(_0x1dd572[_0x009a('0xaa')][_0x009a('0xb0')]||'')+'\x20'+(_0x1dd572['contact'][_0x009a('0xb1')]||'')};if(_0x24eae8[_0x009a('0x65')][_0x009a('0xbd')]&&_0x24eae8['body']['messageId']&&_0x24eae8['body'][_0x009a('0xbd')]!=_0x24eae8[_0x009a('0x65')]['messageId']){_0x5ee9b2[_0x009a('0xbd')]=_0x24eae8[_0x009a('0x65')]['messageId'];}return _0x16b3ee[_0x009a('0x35')](_0x5ee9b2);}else{return _0x16b3ee;}}})[_0x009a('0x22')](function(_0x1240b6){_0x1dd572[_0x009a('0xc1')]=_0x1240b6['get']({'plain':!![]});_0x1dd572['interaction'][_0x009a('0xc3')]=_0x2ec461;if(_0x1dd572[_0x009a('0xc1')]['created']){if(_0x1dd572[_0x009a('0xa5')]['autoclose']){_0x1dd572[_0x009a('0xa6')][_0x009a('0xc4')]({'id':0x0,'priority':_0x1dd572[_0x009a('0xa6')]['length']+0x1,'app':_0x009a('0xc5'),'appdata':_0x009a('0xc6'),'interval':_0x009a('0xc7')});}}return db[_0x009a('0xc8')]['create']({'body':_0x24eae8[_0x009a('0x65')][_0x009a('0x65')],'ChatWebsiteId':_0x24eae8[_0x009a('0x66')]['id'],'ChatInteractionId':_0x1240b6['id'],'direction':'in','ContactId':_0x1dd572[_0x009a('0xaa')]['id'],'AttachmentId':_0x24eae8['body']['AttachmentId']});})[_0x009a('0x22')](function(_0x365359){_0x1dd572['message']=_0x365359;if(_0x1dd572['interaction'][_0x009a('0xc9')]){return db[_0x009a('0xca')][_0x009a('0x5c')]({'attributes':['id',_0x009a('0x39')],'where':{'id':_0x1dd572[_0x009a('0xc1')][_0x009a('0xc9')]}})[_0x009a('0x22')](function(_0x1bc570){if(_0x1bc570){_0x1dd572[_0x009a('0xa6')][_0x009a('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1bc570[_0x009a('0x39')]+','+(_0x1dd572[_0x009a('0xa5')][_0x009a('0xcc')]||0xa),'interval':_0x009a('0xc7')});_0x1dd572['forcedOwnership']=!![];}return respondWithRpcPromise(_0x009a('0xcd'),'startRouting',_0x1dd572);});}return respondWithRpcPromise(_0x009a('0xcd'),_0x009a('0xce'),_0x1dd572);})[_0x009a('0x22')](function(_0x4bc389){respondWithRpcPromise('EventManager',_0x009a('0xcf'),{'event':_0x009a('0x8f'),'message':_0x4bc389},client9002);return _0x4bc389;})['then'](respondWithResult(_0x458d32,null))[_0x009a('0x58')](handleError(_0x458d32,null));};exports[_0x009a('0xd0')]=function(_0x42bd95,_0x3393b9,_0x5e1956){var _0x482b1d,_0x2e666e,_0x9dc0ad;var _0x36abcd=[];var _0x2c3313=[];var _0x4f169e={};return db[_0x009a('0x94')][_0x009a('0x67')]()[_0x009a('0x22')](function(_0x3543fd){if(!_0x3543fd){throw new db[(_0x009a('0x1f'))][(_0x009a('0x20'))](_0x009a('0x95'));}_0x2c3313=_[_0x009a('0x96')](_[_0x009a('0x5b')](_0x3543fd),[_0x009a('0x97'),_0x009a('0x98')]);_0x36abcd=_[_0x009a('0x96')](_['keys'](_0x3543fd),[_0x009a('0x97'),'updatedAt',_0x009a('0xd1'),_0x009a('0x99')]);if(_0x42bd95[_0x009a('0x65')]['id']){delete _0x42bd95[_0x009a('0x65')]['id'];}if(_[_0x009a('0x88')](_0x42bd95[_0x009a('0x65')][_0x009a('0x9a')])){throw _0x3393b9[_0x009a('0x2a')](0x1f4)[_0x009a('0x3a')](new db[(_0x009a('0x1f'))][(_0x009a('0x20'))]('from\x20is\x20mandatory'));}if(_[_0x009a('0x88')](_0x42bd95['body'][_0x009a('0x65')])||_0x42bd95['body'][_0x009a('0x65')]===''){throw _0x3393b9[_0x009a('0x2a')](0x1f4)[_0x009a('0x3a')](new db[(_0x009a('0x1f'))]['ValidationError'](_0x009a('0x9b')));}if(_[_0x009a('0x88')](_0x42bd95['body']['mapKeyOffline'])){throw _0x3393b9[_0x009a('0x2a')](0x1f4)[_0x009a('0x3a')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x36abcd));}if(!_[_0x009a('0x9e')](_0x36abcd,_0x42bd95[_0x009a('0x65')][_0x009a('0xd2')])){throw _0x3393b9[_0x009a('0x2a')](0x1f4)[_0x009a('0x3a')](new db[(_0x009a('0x1f'))][(_0x009a('0x20'))](_0x009a('0xd3')+_0x36abcd));}_0x4f169e[_0x42bd95[_0x009a('0x65')][_0x009a('0xd2')]]=_0x42bd95['body'][_0x009a('0x9a')];})['then'](function(){return db[_0x009a('0x3d')]['find']({'where':{'id':_0x42bd95[_0x009a('0x66')]['id']},'include':[{'model':db['CmList'],'as':_0x009a('0xa1')}]});})[_0x009a('0x22')](handleEntityNotFound(_0x3393b9,null))['then'](function(_0x9f8799){if(_0x9f8799&&_0x9f8799[_0x009a('0xa1')]){_0x2e666e=_0x9f8799;var _0x419097=_['defaults'](_0x42bd95[_0x009a('0x65')],{'firstName':_0x42bd95['body']['from'],'phone':_0x42bd95[_0x009a('0x65')]['from'],'ListId':_0x9f8799[_0x009a('0x99')]});_0x419097[_0x42bd95[_0x009a('0x65')][_0x009a('0xd2')]]=_0x42bd95['body']['from'];return db['CmContact'][_0x009a('0xd4')]({'where':_0x4f169e,'defaults':_0x419097});}})[_0x009a('0xc2')](function(_0x33b8db){if(_0x33b8db){_0x9dc0ad=_0x33b8db;var _0x595466=fs[_0x009a('0xd5')](path[_0x009a('0x7e')](config[_0x009a('0x7f')],_0x009a('0xd6')),_0x009a('0xd7'));var _0x215cb4=ejs[_0x009a('0xd8')](_0x595466,{'body':_['toPairs'](_0x42bd95['body']['body']),'bodyTitle':_0x2e666e[_0x009a('0xd9')]});return db[_0x009a('0xda')][_0x009a('0x5d')]({'body':_0x215cb4,'ContactId':_0x33b8db['id'],'ChatWebsiteId':_0x2e666e['id']});}})[_0x009a('0x22')](function(_0x1491e7){if(_0x1491e7){_0x482b1d=_0x1491e7;return db[_0x009a('0xdb')][_0x009a('0x6c')]({'where':{'service':!![]},'include':[{'model':db[_0x009a('0xdc')],'as':'Smtp','raw':!![]}]});}})[_0x009a('0x22')](function(_0x6cb4e0){if(_0x6cb4e0&&_0x6cb4e0['Smtp']&&_0x2e666e[_0x009a('0xdd')]){var _0x18444f={'tls':{'rejectUnauthorized':![]}};if(_0x6cb4e0[_0x009a('0xde')][_0x009a('0xdf')]){_0x18444f['service']=_0x6cb4e0[_0x009a('0xde')][_0x009a('0xdf')];}else{_0x18444f[_0x009a('0xe0')]=_0x6cb4e0[_0x009a('0xde')][_0x009a('0xe0')];_0x18444f[_0x009a('0xe1')]=_0x6cb4e0[_0x009a('0xde')]['port'];_0x18444f[_0x009a('0xe2')]=_0x6cb4e0[_0x009a('0xde')][_0x009a('0xe2')];}if(_0x6cb4e0[_0x009a('0xde')][_0x009a('0xe3')]){_0x18444f[_0x009a('0xe4')]={'user':_0x6cb4e0[_0x009a('0xde')][_0x009a('0x5e')],'pass':_0x6cb4e0[_0x009a('0xde')][_0x009a('0xe5')]};}return respondWithRpcPromise('SendMail',_0x009a('0xe6'),{'account':_0x18444f,'message':{'from':util[_0x009a('0xb8')](_0x009a('0xe7'),_0x6cb4e0['name'],_0x6cb4e0[_0x009a('0xe8')]||_0x6cb4e0[_0x009a('0xde')][_0x009a('0x5e')]),'to':_0x2e666e[_0x009a('0xdd')],'subject':_0x2e666e[_0x009a('0xe9')],'text':_0x482b1d[_0x009a('0x65')]}},client9003)[_0x009a('0x22')](function(){return _0x482b1d;})['catch'](function(_0xd8b1e8){console[_0x009a('0x27')](_0xd8b1e8);});}})[_0x009a('0x22')](function(){if(_0x482b1d){return _0x482b1d;}})[_0x009a('0x22')](respondWithResult(_0x3393b9,null))[_0x009a('0x58')](handleError(_0x3393b9,null));};exports['addInteraction']=function(_0x1cf5b1,_0x50f69e,_0x116c49){return db[_0x009a('0xbe')][_0x009a('0x5c')]({'where':{'id':_0x1cf5b1[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x50f69e,null))[_0x009a('0x22')](function(_0x5d5c9c){if(_0x5d5c9c){return _0x5d5c9c[_0x009a('0xea')](_0x1cf5b1['body'][_0x009a('0x72')],_['omit'](_0x1cf5b1[_0x009a('0x65')],[_0x009a('0x72'),'id'])||{});}})[_0x009a('0x22')](respondWithResult(_0x50f69e,null))[_0x009a('0x58')](handleError(_0x50f69e,null));};exports[_0x009a('0xeb')]=function(_0x5369e4,_0x3f8d8c,_0xd08679){var _0x340cbd={'raw':![],'where':{}};var _0x23ab6c={};var _0x2cb119={'count':0x0,'rows':[]};return db[_0x009a('0x3d')][_0x009a('0x6c')]({'where':{'id':_0x5369e4[_0x009a('0x66')]['id']}})['then'](handleEntityNotFound(_0x3f8d8c,null))[_0x009a('0x22')](function(_0x13501c){if(_0x13501c){_0x23ab6c[_0x009a('0x42')]=_[_0x009a('0x5b')](db['ChatInteraction'][_0x009a('0x3e')]);_0x23ab6c[_0x009a('0x44')]=_[_0x009a('0x5b')](_0x5369e4[_0x009a('0x44')]);_0x23ab6c[_0x009a('0x4e')]=_[_0x009a('0x45')](_0x23ab6c[_0x009a('0x42')],_0x23ab6c['query']);_0x340cbd[_0x009a('0x46')]=_[_0x009a('0x45')](_0x23ab6c[_0x009a('0x42')],qs['fields'](_0x5369e4[_0x009a('0x44')][_0x009a('0x47')]));_0x340cbd[_0x009a('0x46')]=_0x340cbd[_0x009a('0x46')]['length']?_0x340cbd[_0x009a('0x46')]:_0x23ab6c[_0x009a('0x42')];if(!_0x5369e4[_0x009a('0x44')][_0x009a('0x49')](_0x009a('0x4a'))){_0x340cbd[_0x009a('0x2f')]=qs['limit'](_0x5369e4[_0x009a('0x44')][_0x009a('0x2f')]);_0x340cbd[_0x009a('0x2e')]=qs[_0x009a('0x2e')](_0x5369e4[_0x009a('0x44')][_0x009a('0x2e')]);}_0x340cbd[_0x009a('0x4b')]=qs[_0x009a('0x4c')](_0x5369e4['query'][_0x009a('0x4c')]);_0x340cbd['where']=qs[_0x009a('0x4e')](_['pick'](_0x5369e4['query'],_0x23ab6c['filters']));_0x340cbd[_0x009a('0x4d')][_0x009a('0x69')]=_0x13501c['id'];if(_0x5369e4[_0x009a('0x44')][_0x009a('0x50')]){_0x340cbd[_0x009a('0x4d')]=_[_0x009a('0x51')](_0x340cbd[_0x009a('0x4d')],{'$or':_[_0x009a('0x43')](_0x340cbd['attributes'],function(_0x41a6e0){var _0x5263fd={};_0x5263fd[_0x41a6e0]={'$like':'%'+_0x5369e4['query'][_0x009a('0x50')]+'%'};return _0x5263fd;})});}_0x340cbd=_[_0x009a('0x51')]({},_0x340cbd,_0x5369e4['options']);return db[_0x009a('0xbe')][_0x009a('0x2d')]({'where':_0x340cbd[_0x009a('0x4d')]})[_0x009a('0x22')](function(_0xcb379e){_0x2cb119[_0x009a('0x2d')]=_0xcb379e;if(_0x5369e4[_0x009a('0x44')][_0x009a('0x54')]){_0x340cbd['include']=[{'model':db[_0x009a('0x94')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x009a('0x39'),_0x009a('0xec'),'internal'],'required':![]},{'model':db[_0x009a('0xed')],'as':_0x009a('0xee'),'attributes':['id',_0x009a('0x39'),_0x009a('0xef')],'where':_0x5369e4[_0x009a('0x44')]['tag']?{'id':_0x5369e4[_0x009a('0x44')][_0x009a('0xf0')]}:undefined,'required':_0x5369e4['query'][_0x009a('0xf0')]?!![]:![]}];}return db[_0x009a('0xbe')][_0x009a('0x56')](_0x340cbd);})[_0x009a('0x22')](function(_0x5f015d){_0x2cb119[_0x009a('0x57')]=_0x5f015d;return _0x2cb119;});}})[_0x009a('0x22')](respondWithFilteredResult(_0x3f8d8c,_0x340cbd))[_0x009a('0x58')](handleError(_0x3f8d8c,null));};function iftimePromise(_0x379b9e,_0xdd3633){return respondWithRpcPromise(_0x009a('0xf1'),_0x009a('0xf2'),{'command':_0xdd3633[_0x009a('0xf3')]?util[_0x009a('0xb8')](_0x009a('0xf4'),_0x379b9e[_0x009a('0xf5')],_0xdd3633[_0x009a('0xf3')]):util[_0x009a('0xb8')](_0x009a('0xf6'),_0x379b9e['interval'])},client9002)[_0x009a('0x22')](function(_0x1d17ea){var _0x533e6b=_0x1d17ea&&_0x1d17ea[_0x009a('0xf7')](_0x009a('0xf8'))>=0x0?!![]:![];logger[_0x009a('0x23')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xdd3633['id'],_0x379b9e['id'],_0x379b9e[_0x009a('0xf5')],_0x533e6b?'ONLINE':_0x009a('0xf9'),_0xdd3633[_0x009a('0xf3')]?_0xdd3633['timezone']:_0x009a('0xfa'));return _0x533e6b;})[_0x009a('0x58')](function(_0x1b8415){logger[_0x009a('0x27')](_0x009a('0xfb'),_0xdd3633['id'],_0x379b9e['id'],_0x379b9e['interval'],util[_0x009a('0xfc')](_0x1b8415,{'showHidden':![],'depth':null}),_0xdd3633[_0x009a('0xf3')]?_0xdd3633[_0x009a('0xf3')]:'No\x20timezone');return![];});}exports[_0x009a('0xf2')]=function(_0x72c501,_0x14ebd4,_0x4d4153){var _0x5c3827=0x0;var _0xf4e32f=0x0;var _0x567a74=![];var _0x86c57b;var _0x3a8b21;return db['ChatWebsite'][_0x009a('0x5c')]({'where':{'id':_0x72c501[_0x009a('0x66')]['id']},'include':[{'model':db[_0x009a('0xfd')],'as':_0x009a('0xfd'),'include':[{'model':db[_0x009a('0xfd')],'as':_0x009a('0xfe'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x009a('0x22')](handleEntityNotFound(_0x14ebd4,null))[_0x009a('0x22')](function(_0x1032fa){if(_0x1032fa){_0x86c57b=_0x1032fa;return _0x1032fa[_0x009a('0xff')]({'raw':!![]});}})[_0x009a('0x22')](function(_0x3b42fa){if(_0x86c57b){if(_0x3b42fa){_0x3a8b21=_0x3b42fa;}}return require(_0x009a('0x81'))[_0x009a('0x82')]();})[_0x009a('0x22')](function(_0x3f96fc){if(_0x3f96fc){_0xf4e32f=_0x3f96fc['virtual'];_0x567a74=_0x3f96fc[_0x009a('0x83')];}})[_0x009a('0x22')](function(){return db[_0x009a('0xbe')]['count']({'where':{'closed':![]}});})[_0x009a('0x22')](function(_0x546364){_0x5c3827=_0x546364;if(_0xf4e32f&&_0x546364>_0xf4e32f){return db[_0x009a('0x100')][_0x009a('0x6c')]({'where':{'id':0x1}})[_0x009a('0x22')](function(_0x2a9e45){if(_0x2a9e45){_0x2a9e45['increment'](_0x009a('0x101'));}});}})[_0x009a('0x22')](function(){if(_0x86c57b['Interval']&&_0x86c57b[_0x009a('0xfd')][_0x009a('0xfe')]){var _0x31ee22=[];for(var _0xb61475=0x0;_0xb61475<_0x86c57b[_0x009a('0xfd')][_0x009a('0xfe')][_0x009a('0x48')];_0xb61475++){var _0x158088=_0x86c57b['Interval'][_0x009a('0xfe')][_0xb61475][_0x009a('0x5f')]({'plain':!![]});_0x31ee22[_0x009a('0xc4')](iftimePromise(_0x158088,_0x86c57b));}return BPromise[_0x009a('0x102')](_0x31ee22)[_0x009a('0x22')](function(_0x44956a){return _[_0x009a('0x103')](_0x44956a);});}else{return!![];}})['then'](function(_0x1ff989){var _0x22e459=fs[_0x009a('0xd5')](path['join'](config[_0x009a('0x7f')],_0x009a('0x104')),'utf8');var _0x3d2f6d={'remote':_0x86c57b['remote'],'query':querystring[_0x009a('0xbc')](_[_0x009a('0x51')](_0x86c57b[_0x009a('0x5f')]({'plain':!![]}),{'customerIp':_0x72c501[_0x009a('0x91')][_0x009a('0xae')]||_0x72c501['headers'][_0x009a('0x105')]||_0x72c501[_0x009a('0x106')][_0x009a('0x107')]||_0x72c501['ip'],'referer':_0x72c501[_0x009a('0x91')][_0x009a('0xb3')],'openedInteractions':_0x5c3827,'maxInteractions':_0xf4e32f,'virtual':_0x567a74[_0x009a('0x108')],'online':_0x1ff989,'custom':_0x567a74}))[_0x009a('0x109')](/'/g,'\x5c\x27')};_0x14ebd4[_0x009a('0x3a')](ejs[_0x009a('0xd8')](Mustache[_0x009a('0xd8')](_0x22e459,_0x3d2f6d),{'proactiveActions':_0x3a8b21,'alignment':_0x86c57b[_0x009a('0x10a')],'verticalAlignment':_0x86c57b[_0x009a('0x10b')],'div_color':_0x86c57b['color'],'text_color':_0x86c57b[_0x009a('0x10c')]}));})[_0x009a('0x58')](handleError(_0x14ebd4,null));};exports[_0x009a('0x10d')]=function(_0x56c6e6,_0xf9142a,_0x29e0e0){return db[_0x009a('0x3d')][_0x009a('0x6c')]({'where':{'id':_0x56c6e6[_0x009a('0x66')]['id']}})['then'](handleEntityNotFound(_0xf9142a,null))[_0x009a('0x22')](function(_0x3b7564){if(_0x3b7564){return db[_0x009a('0x10e')][_0x009a('0x10f')](function(_0x3efca9){return db[_0x009a('0xa4')][_0x009a('0x36')]({'where':{'ChatWebsiteId':_0x56c6e6[_0x009a('0x66')]['id']},'transaction':_0x3efca9})[_0x009a('0x22')](function(_0x62d526){var _0x511067=_[_0x009a('0x43')](_0x56c6e6[_0x009a('0x65')],function(_0x11f2fb){_0x11f2fb[_0x009a('0x69')]=_0x56c6e6[_0x009a('0x66')]['id'];return _0x11f2fb;});return db['ChatApplication'][_0x009a('0x110')](_0x511067,{'transaction':_0x3efca9});});})['then'](function(){return db[_0x009a('0xa4')][_0x009a('0x111')]({'where':{'ChatWebsiteId':_0x56c6e6['params']['id']},'order':_0x009a('0xa8')});});}})['then'](respondWithResult(_0xf9142a,null))[_0x009a('0x58')](handleError(_0xf9142a,null));};exports['getApplications']=function(_0x4e1b7b,_0x126e75,_0x32f80b){var _0x2459ce={};var _0x24e3cf={};var _0x3fa628;var _0x45bea7;return db['ChatWebsite']['findOne']({'where':{'id':_0x4e1b7b[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x126e75,null))['then'](function(_0x1a9683){if(_0x1a9683){_0x3fa628=_0x1a9683;_0x24e3cf[_0x009a('0x42')]=_[_0x009a('0x5b')](db[_0x009a('0xa4')]['rawAttributes']);_0x24e3cf[_0x009a('0x44')]=_[_0x009a('0x5b')](_0x4e1b7b[_0x009a('0x44')]);_0x24e3cf['filters']=_['intersection'](_0x24e3cf[_0x009a('0x42')],_0x24e3cf[_0x009a('0x44')]);_0x2459ce[_0x009a('0x46')]=_['intersection'](_0x24e3cf[_0x009a('0x42')],qs['fields'](_0x4e1b7b[_0x009a('0x44')][_0x009a('0x47')]));_0x2459ce[_0x009a('0x46')]=_0x2459ce['attributes']['length']?_0x2459ce[_0x009a('0x46')]:_0x24e3cf[_0x009a('0x42')];_0x2459ce['order']=qs['sort'](_0x4e1b7b[_0x009a('0x44')][_0x009a('0x4c')]);_0x2459ce[_0x009a('0x4d')]=qs[_0x009a('0x4e')](_[_0x009a('0x4f')](_0x4e1b7b[_0x009a('0x44')],_0x24e3cf[_0x009a('0x4e')]));if(_0x4e1b7b[_0x009a('0x44')][_0x009a('0x50')]){_0x2459ce[_0x009a('0x4d')]=_[_0x009a('0x51')](_0x2459ce['where'],{'$or':_['map'](_0x2459ce[_0x009a('0x46')],function(_0x9e37fc){var _0x4e510a={};_0x4e510a[_0x9e37fc]={'$like':'%'+_0x4e1b7b[_0x009a('0x44')]['filter']+'%'};return _0x4e510a;})});}_0x2459ce=_[_0x009a('0x51')]({},_0x2459ce,_0x4e1b7b[_0x009a('0x53')]);return _0x3fa628[_0x009a('0x112')](_0x2459ce);}})[_0x009a('0x22')](function(_0x2f9536){if(_0x2f9536){_0x45bea7=_0x2f9536[_0x009a('0x48')];if(!_0x4e1b7b['query'][_0x009a('0x49')]('nolimit')){_0x2459ce[_0x009a('0x2f')]=qs['limit'](_0x4e1b7b['query'][_0x009a('0x2f')]);_0x2459ce[_0x009a('0x2e')]=qs[_0x009a('0x2e')](_0x4e1b7b['query'][_0x009a('0x2e')]);}return _0x3fa628[_0x009a('0x112')](_0x2459ce);}})[_0x009a('0x22')](function(_0x5176bf){if(_0x5176bf){return _0x5176bf?{'count':_0x45bea7,'rows':_0x5176bf}:null;}})['then'](respondWithResult(_0x126e75,null))['catch'](handleError(_0x126e75,null));};exports['addProactiveActions']=function(_0x2ede90,_0x2e5f13,_0x4f0ccd){return db[_0x009a('0x113')][_0x009a('0x5c')]({'where':{'id':_0x2ede90[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x2e5f13,null))['then'](function(_0x8d3bb){if(_0x8d3bb){return _0x8d3bb['addProactiveActions'](_0x2ede90['body']['ids'],_[_0x009a('0x114')](_0x2ede90['body'],[_0x009a('0x72'),'id'])||{});}})['then'](respondWithResult(_0x2e5f13,null))[_0x009a('0x58')](handleError(_0x2e5f13,null));};exports[_0x009a('0xff')]=function(_0x562ee2,_0x3e1e3b,_0x289e07){var _0x4af020={};var _0x331178={};var _0x943ff;var _0x63ae43;return db['ChatWebsite'][_0x009a('0x6c')]({'where':{'id':_0x562ee2[_0x009a('0x66')]['id']}})['then'](handleEntityNotFound(_0x3e1e3b,null))[_0x009a('0x22')](function(_0x25b043){if(_0x25b043){_0x943ff=_0x25b043;_0x331178['model']=_[_0x009a('0x5b')](db[_0x009a('0x115')][_0x009a('0x3e')]);_0x331178[_0x009a('0x44')]=_[_0x009a('0x5b')](_0x562ee2[_0x009a('0x44')]);_0x331178[_0x009a('0x4e')]=_[_0x009a('0x45')](_0x331178[_0x009a('0x42')],_0x331178[_0x009a('0x44')]);_0x4af020[_0x009a('0x46')]=_[_0x009a('0x45')](_0x331178['model'],qs['fields'](_0x562ee2[_0x009a('0x44')][_0x009a('0x47')]));_0x4af020[_0x009a('0x46')]=_0x4af020[_0x009a('0x46')][_0x009a('0x48')]?_0x4af020['attributes']:_0x331178[_0x009a('0x42')];_0x4af020[_0x009a('0x4b')]=qs[_0x009a('0x4c')](_0x562ee2[_0x009a('0x44')][_0x009a('0x4c')]);_0x4af020[_0x009a('0x4d')]=qs[_0x009a('0x4e')](_['pick'](_0x562ee2['query'],_0x331178[_0x009a('0x4e')]));if(_0x562ee2[_0x009a('0x44')][_0x009a('0x50')]){_0x4af020[_0x009a('0x4d')]=_[_0x009a('0x51')](_0x4af020[_0x009a('0x4d')],{'$or':_[_0x009a('0x43')](_0x4af020[_0x009a('0x46')],function(_0x35becc){var _0x4280ed={};_0x4280ed[_0x35becc]={'$like':'%'+_0x562ee2[_0x009a('0x44')]['filter']+'%'};return _0x4280ed;})});}_0x4af020=_[_0x009a('0x51')]({},_0x4af020,_0x562ee2[_0x009a('0x53')]);return _0x943ff[_0x009a('0xff')](_0x4af020);}})[_0x009a('0x22')](function(_0x21bc3d){if(_0x21bc3d){_0x63ae43=_0x21bc3d[_0x009a('0x48')];if(!_0x562ee2[_0x009a('0x44')][_0x009a('0x49')](_0x009a('0x4a'))){_0x4af020[_0x009a('0x2f')]=qs[_0x009a('0x2f')](_0x562ee2['query']['limit']);_0x4af020['offset']=qs['offset'](_0x562ee2[_0x009a('0x44')][_0x009a('0x2e')]);}return _0x943ff[_0x009a('0xff')](_0x4af020);}})[_0x009a('0x22')](function(_0xc5551e){if(_0xc5551e){return _0xc5551e?{'count':_0x63ae43,'rows':_0xc5551e}:null;}})[_0x009a('0x22')](respondWithResult(_0x3e1e3b,null))['catch'](handleError(_0x3e1e3b,null));};exports[_0x009a('0x116')]=function(_0x8f6880,_0x4cae2a,_0x1cf7ae){var _0x37d7c8=_0x8f6880[_0x009a('0x44')][_0x009a('0x117')]==='false'?_0x009a('0x118'):'onlineForm';return db[_0x009a('0x3d')][_0x009a('0x5c')]({'attributes':['id',_0x37d7c8],'where':{'id':_0x8f6880[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x4cae2a,null))[_0x009a('0x22')](function(_0x33960d){if(_0x33960d){var _0x2c3f33=_0x33960d[_0x37d7c8];var _0x5e8afd=_0x2c3f33&&_0x2c3f33[_0x009a('0x119')]?_0x2c3f33[_0x009a('0x119')]:[];_0x4cae2a[_0x009a('0x3a')]({'fromKey':_['isNil'](_0x2c3f33[_0x009a('0x11a')])?undefined:_0x2c3f33[_0x009a('0x11a')],'count':_0x5e8afd['length'],'rows':_0x5e8afd});}})[_0x009a('0x58')](handleError(_0x4cae2a,null));};exports['getOfflineMessages']=function(_0x2b09f2,_0x353aab,_0x2f9d4a){var _0x329fea={'raw':![],'where':{}};var _0x2b5e20={};var _0x573db6={'count':0x0,'rows':[]};return db[_0x009a('0x3d')][_0x009a('0x6c')]({'where':{'id':_0x2b09f2[_0x009a('0x66')]['id']}})['then'](handleEntityNotFound(_0x353aab,null))[_0x009a('0x22')](function(_0xb29eda){if(_0xb29eda){_0x2b5e20[_0x009a('0x42')]=_[_0x009a('0x5b')](db[_0x009a('0xda')]['rawAttributes']);_0x2b5e20[_0x009a('0x44')]=_[_0x009a('0x5b')](_0x2b09f2['query']);_0x2b5e20[_0x009a('0x4e')]=_[_0x009a('0x45')](_0x2b5e20[_0x009a('0x42')],_0x2b5e20[_0x009a('0x44')]);_0x329fea['attributes']=_['intersection'](_0x2b5e20[_0x009a('0x42')],qs['fields'](_0x2b09f2[_0x009a('0x44')][_0x009a('0x47')]));_0x329fea[_0x009a('0x46')]=_0x329fea[_0x009a('0x46')][_0x009a('0x48')]?_0x329fea['attributes']:_0x2b5e20[_0x009a('0x42')];if(!_0x2b09f2[_0x009a('0x44')]['hasOwnProperty'](_0x009a('0x4a'))){_0x329fea[_0x009a('0x2f')]=qs[_0x009a('0x2f')](_0x2b09f2[_0x009a('0x44')]['limit']);_0x329fea[_0x009a('0x2e')]=qs[_0x009a('0x2e')](_0x2b09f2[_0x009a('0x44')][_0x009a('0x2e')]);}_0x329fea['order']=qs[_0x009a('0x4c')](_0x2b09f2[_0x009a('0x44')][_0x009a('0x4c')]);_0x329fea[_0x009a('0x4d')]=qs['filters'](_[_0x009a('0x4f')](_0x2b09f2[_0x009a('0x44')],_0x2b5e20[_0x009a('0x4e')]));_0x329fea[_0x009a('0x4d')][_0x009a('0x69')]=_0xb29eda['id'];if(_0x2b09f2[_0x009a('0x44')][_0x009a('0x50')]){_0x329fea[_0x009a('0x4d')]=_[_0x009a('0x51')](_0x329fea['where'],{'$or':_['map'](_0x329fea[_0x009a('0x46')],function(_0x37aaf0){var _0x4e4b6c={};_0x4e4b6c[_0x37aaf0]={'$like':'%'+_0x2b09f2['query'][_0x009a('0x50')]+'%'};return _0x4e4b6c;})});}_0x329fea=_[_0x009a('0x51')]({},_0x329fea,_0x2b09f2[_0x009a('0x53')]);return db[_0x009a('0xda')][_0x009a('0x2d')]({'where':_0x329fea[_0x009a('0x4d')]})[_0x009a('0x22')](function(_0x45d520){_0x573db6[_0x009a('0x2d')]=_0x45d520;if(_0x2b09f2[_0x009a('0x44')][_0x009a('0x54')]){_0x329fea[_0x009a('0x55')]=[{'all':!![]}];}else{_0x329fea[_0x009a('0x55')]=[{'model':db['CmContact'],'as':'Contact','required':![]}];}return db[_0x009a('0xda')][_0x009a('0x56')](_0x329fea);})[_0x009a('0x22')](function(_0x1ac7da){_0x573db6[_0x009a('0x57')]=_0x1ac7da;return _0x573db6;});}})[_0x009a('0x22')](respondWithFilteredResult(_0x353aab,_0x329fea))['catch'](handleError(_0x353aab,null));};exports[_0x009a('0x11b')]=function(_0x593a33,_0x36d288,_0x2f3348){return db[_0x009a('0x3d')][_0x009a('0x5c')]({'where':{'id':_0x593a33[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x36d288,null))[_0x009a('0x22')](function(_0x24bc78){if(_0x24bc78){return _0x24bc78['addAgents'](_0x593a33[_0x009a('0x65')][_0x009a('0x72')],_[_0x009a('0x114')](_0x593a33[_0x009a('0x65')],[_0x009a('0x72'),'id'])||{})['spread'](function(_0x2bcf25){for(var _0x11662a=0x0;_0x11662a<_0x593a33[_0x009a('0x65')][_0x009a('0x72')][_0x009a('0x48')];_0x11662a+=0x1){socket['emit'](_0x009a('0x11c'),{'UserId':_0x593a33[_0x009a('0x65')][_0x009a('0x72')][_0x11662a],'ChatWebsiteId':_0x593a33['params']['id']});}return _0x2bcf25;});}})[_0x009a('0x22')](respondWithResult(_0x36d288,null))[_0x009a('0x58')](handleError(_0x36d288,null));};exports[_0x009a('0x11d')]=function(_0x3cca0a,_0x210244,_0x248a6a){return db[_0x009a('0x3d')][_0x009a('0x5c')]({'where':{'id':_0x3cca0a[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x210244,null))['then'](function(_0x3bbe7d){if(_0x3bbe7d){return _0x3bbe7d[_0x009a('0x11d')](_0x3cca0a['query'][_0x009a('0x72')])[_0x009a('0x22')](function(){if(_[_0x009a('0x11e')](_0x3cca0a['query']['ids'])){for(var _0x4f9782=0x0;_0x4f9782<_0x3cca0a[_0x009a('0x44')]['ids']['length'];_0x4f9782+=0x1){socket['emit'](_0x009a('0x11f'),{'UserId':Number(_0x3cca0a[_0x009a('0x44')][_0x009a('0x72')][_0x4f9782]),'ChatWebsiteId':Number(_0x3cca0a[_0x009a('0x66')]['id'])});}}else{socket[_0x009a('0x120')](_0x009a('0x11f'),{'UserId':Number(_0x3cca0a[_0x009a('0x44')][_0x009a('0x72')]),'ChatWebsiteId':Number(_0x3cca0a[_0x009a('0x66')]['id'])});}});}})[_0x009a('0x22')](respondWithStatusCode(_0x210244,null))[_0x009a('0x58')](handleError(_0x210244,null));};exports[_0x009a('0x121')]=function(_0x1be596,_0x11e559,_0x308a0b){var _0x1738ba={};var _0x5cf97e={};var _0xee6027;var _0x29456e;return db[_0x009a('0x3d')][_0x009a('0x6c')]({'where':{'id':_0x1be596[_0x009a('0x66')]['id']}})[_0x009a('0x22')](handleEntityNotFound(_0x11e559,null))[_0x009a('0x22')](function(_0x3fd4d9){if(_0x3fd4d9){_0xee6027=_0x3fd4d9;_0x5cf97e[_0x009a('0x42')]=_[_0x009a('0x5b')](db[_0x009a('0xca')][_0x009a('0x3e')]);_0x5cf97e[_0x009a('0x44')]=_[_0x009a('0x5b')](_0x1be596['query']);_0x5cf97e[_0x009a('0x4e')]=_[_0x009a('0x45')](_0x5cf97e[_0x009a('0x42')],_0x5cf97e[_0x009a('0x44')]);_0x1738ba[_0x009a('0x46')]=_[_0x009a('0x45')](_0x5cf97e[_0x009a('0x42')],qs['fields'](_0x1be596[_0x009a('0x44')][_0x009a('0x47')]));_0x1738ba[_0x009a('0x46')]=_0x1738ba['attributes'][_0x009a('0x48')]?_0x1738ba[_0x009a('0x46')]:_0x5cf97e['model'];_0x1738ba[_0x009a('0x4b')]=qs[_0x009a('0x4c')](_0x1be596[_0x009a('0x44')]['sort']);_0x1738ba['where']=qs['filters'](_[_0x009a('0x4f')](_0x1be596[_0x009a('0x44')],_0x5cf97e['filters']));if(_0x1be596[_0x009a('0x44')]['filter']){_0x1738ba[_0x009a('0x4d')]=_[_0x009a('0x51')](_0x1738ba[_0x009a('0x4d')],{'$or':_[_0x009a('0x43')](_0x1738ba['attributes'],function(_0x5bfac4){var _0x381c73={};_0x381c73[_0x5bfac4]={'$like':'%'+_0x1be596[_0x009a('0x44')]['filter']+'%'};return _0x381c73;})});}_0x1738ba=_[_0x009a('0x51')]({},_0x1738ba,_0x1be596[_0x009a('0x53')]);return _0xee6027['getAgents'](_0x1738ba);}})[_0x009a('0x22')](function(_0x302a06){if(_0x302a06){_0x29456e=_0x302a06[_0x009a('0x48')];if(!_0x1be596[_0x009a('0x44')][_0x009a('0x49')](_0x009a('0x4a'))){_0x1738ba['limit']=qs[_0x009a('0x2f')](_0x1be596[_0x009a('0x44')]['limit']);_0x1738ba[_0x009a('0x2e')]=qs[_0x009a('0x2e')](_0x1be596['query'][_0x009a('0x2e')]);}return _0xee6027[_0x009a('0x121')](_0x1738ba);}})[_0x009a('0x22')](function(_0x51ea22){if(_0x51ea22){return _0x51ea22?{'count':_0x29456e,'rows':_0x51ea22}:null;}})[_0x009a('0x22')](respondWithResult(_0x11e559,null))[_0x009a('0x58')](handleError(_0x11e559,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index ca44243..da80253 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 _0x165d=['setMaxListeners','save','update','remove','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite'];(function(_0x214aa7,_0x57de97){var _0x2aef7a=function(_0x2225a1){while(--_0x2225a1){_0x214aa7['push'](_0x214aa7['shift']());}};_0x2aef7a(++_0x57de97);}(_0x165d,0x14a));var _0xd165=function(_0x57120c,_0x373ad3){_0x57120c=_0x57120c-0x0;var _0x6bc2f2=_0x165d[_0x57120c];return _0x6bc2f2;};'use strict';var EventEmitter=require(_0xd165('0x0'));var ChatWebsite=require(_0xd165('0x1'))['db'][_0xd165('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd165('0x3')](0x0);var events={'afterCreate':_0xd165('0x4'),'afterUpdate':_0xd165('0x5'),'afterDestroy':_0xd165('0x6')};function emitEvent(_0x5a4d7c){return function(_0x405ee0,_0x27993b,_0x51f787){ChatWebsiteEvents['emit'](_0x5a4d7c+':'+_0x405ee0['id'],_0x405ee0);ChatWebsiteEvents['emit'](_0x5a4d7c,_0x405ee0);_0x51f787(null);};}for(var e in events){if(events[_0xd165('0x7')](e)){var event=events[e];ChatWebsite[_0xd165('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x5270=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x11f418,_0x16283a){var _0x5d7f70=function(_0x24ba86){while(--_0x24ba86){_0x11f418['push'](_0x11f418['shift']());}};_0x5d7f70(++_0x16283a);}(_0x5270,0xab));var _0x0527=function(_0x29a945,_0x3a5c45){_0x29a945=_0x29a945-0x0;var _0x3d4f54=_0x5270[_0x29a945];return _0x3d4f54;};'use strict';var EventEmitter=require(_0x0527('0x0'));var ChatWebsite=require(_0x0527('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0527('0x2')](0x0);var events={'afterCreate':_0x0527('0x3'),'afterUpdate':_0x0527('0x4'),'afterDestroy':'remove'};function emitEvent(_0x237922){return function(_0x254089,_0x3dc04d,_0x1bace3){ChatWebsiteEvents['emit'](_0x237922+':'+_0x254089['id'],_0x254089);ChatWebsiteEvents[_0x0527('0x5')](_0x237922,_0x254089);_0x1bace3(null);};}for(var e in events){if(events[_0x0527('0x6')](e)){var event=events[e];ChatWebsite[_0x0527('0x7')](e,emitEvent(event));}}module[_0x0527('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 18b56a9..329f951 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 _0x57f8=['ChatWebsite','chat_websites','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x57f8,0x198));var _0x857f=function(_0x44bf54,_0x5be3d6){_0x44bf54=_0x44bf54-0x0;var _0x2c4a96=_0x57f8[_0x44bf54];return _0x2c4a96;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var logger=require(_0x857f('0x1'))(_0x857f('0x2'));var moment=require(_0x857f('0x3'));var BPromise=require(_0x857f('0x4'));var rp=require(_0x857f('0x5'));var fs=require('fs');var path=require(_0x857f('0x6'));var rimraf=require(_0x857f('0x7'));var config=require(_0x857f('0x8'));var attributes=require(_0x857f('0x9'));module[_0x857f('0xa')]=function(_0x369c40,_0x5d22e4){return _0x369c40[_0x857f('0xb')](_0x857f('0xc'),attributes,{'tableName':_0x857f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd139=['rimraf','../../config/environment','./chatWebsite.attributes','ChatWebsite','lodash','util','moment','bluebird','request-promise','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd139,0x14e));var _0x9d13=function(_0x37b20d,_0x181dba){_0x37b20d=_0x37b20d-0x0;var _0x1af5cc=_0xd139[_0x37b20d];return _0x1af5cc;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9d13('0x2'));var BPromise=require(_0x9d13('0x3'));var rp=require(_0x9d13('0x4'));var fs=require('fs');var path=require(_0x9d13('0x5'));var rimraf=require(_0x9d13('0x6'));var config=require(_0x9d13('0x7'));var attributes=require(_0x9d13('0x8'));module['exports']=function(_0x4c8e60,_0x2918eb){return _0x4c8e60['define'](_0x9d13('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 7835368..d142c94 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 _0x1261=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util'];(function(_0x5a55f0,_0x532646){var _0x50de20=function(_0x134b30){while(--_0x134b30){_0x5a55f0['push'](_0x5a55f0['shift']());}};_0x50de20(++_0x532646);}(_0x1261,0x144));var _0x1126=function(_0x3ce6d2,_0x90364d){_0x3ce6d2=_0x3ce6d2-0x0;var _0x4c1dd4=_0x1261[_0x3ce6d2];return _0x4c1dd4;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});} \ No newline at end of file +var _0x7a54=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x2b616b,_0x212cb5){_0x2b616b=_0x2b616b-0x0;var _0x259cef=_0x7a54[_0x2b616b];return _0x259cef;};'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('./chatWebsite.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')]('ChatWebsite,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e6b301b..8124586 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x3eca5a,_0x20d490){var _0x15470e=function(_0x219cc6){while(--_0x219cc6){_0x3eca5a['push'](_0x3eca5a['shift']());}};_0x15470e(++_0x20d490);}(_0x5f2f,0x73));var _0xf5f2=function(_0x454d24,_0x749d57){_0x454d24=_0x454d24-0x0;var _0x311b2c=_0x5f2f[_0x454d24];return _0x311b2c;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0xc6299d,_0x4e893e){var _0x278de4=function(_0xe71f61){while(--_0xe71f61){_0xc6299d['push'](_0xc6299d['shift']());}};_0x278de4(++_0x4e893e);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ce4bb,_0x4bc632){_0x2ce4bb=_0x2ce4bb-0x0;var _0x19356b=_0xb10b[_0x2ce4bb];return _0x19356b;};'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 fb01998..c1d7c23 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 _0xc4be=['post','addAnswer','join','root','server/files/images/logos/','%s-%s','originalname','single','file','addLogo','format','now','addAvatar','diskStorage','server/files/images/avatars/','addSystemAvatar','notify','/:id/offline','offline','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents'];(function(_0x4b2d65,_0x5bc414){var _0x2b6446=function(_0x3308e5){while(--_0x3308e5){_0x4b2d65['push'](_0x4b2d65['shift']());}};_0x2b6446(++_0x5bc414);}(_0xc4be,0x1ed));var _0xec4b=function(_0x352392,_0x29ddb0){_0x352392=_0x352392-0x0;var _0x56402d=_0xc4be[_0x352392];return _0x56402d;};'use strict';var multer=require(_0xec4b('0x0'));var util=require(_0xec4b('0x1'));var path=require('path');var timeout=require(_0xec4b('0x2'));var express=require(_0xec4b('0x3'));var router=express[_0xec4b('0x4')]();var auth=require(_0xec4b('0x5'));var interaction=require(_0xec4b('0x6'));var config=require(_0xec4b('0x7'));var controller=require('./chatWebsite.controller');router[_0xec4b('0x8')]('/',auth['isAuthenticated'](),controller[_0xec4b('0x9')]);router[_0xec4b('0x8')](_0xec4b('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xec4b('0xb'),auth[_0xec4b('0xc')](),controller['show']);router[_0xec4b('0x8')](_0xec4b('0xd'),auth[_0xec4b('0xc')](),controller[_0xec4b('0xe')]);router[_0xec4b('0x8')](_0xec4b('0xf'),auth[_0xec4b('0xc')](),controller[_0xec4b('0x10')]);router[_0xec4b('0x8')](_0xec4b('0x11'),controller['getLogo']);router[_0xec4b('0x8')](_0xec4b('0x12'),controller[_0xec4b('0x13')]);router['get'](_0xec4b('0x14'),controller[_0xec4b('0x15')]);router[_0xec4b('0x8')](_0xec4b('0x16'),controller[_0xec4b('0x17')]);router[_0xec4b('0x8')](_0xec4b('0x18'),auth['isAuthenticated'](),controller[_0xec4b('0x19')]);router['get']('/:id/snippet',controller[_0xec4b('0x1a')]);router[_0xec4b('0x8')](_0xec4b('0x1b'),auth[_0xec4b('0xc')](),controller[_0xec4b('0x1c')]);router[_0xec4b('0x8')]('/:id/proactive_actions',auth[_0xec4b('0xc')](),controller[_0xec4b('0x1d')]);router[_0xec4b('0x8')](_0xec4b('0x1e'),controller[_0xec4b('0x1f')]);router[_0xec4b('0x8')]('/:id/offline_messages',auth[_0xec4b('0xc')](),controller[_0xec4b('0x20')]);router[_0xec4b('0x8')](_0xec4b('0x21'),auth[_0xec4b('0xc')](),controller[_0xec4b('0x22')]);router[_0xec4b('0x23')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xec4b('0xd'),auth[_0xec4b('0xc')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0xec4b('0xc')](),controller[_0xec4b('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2efb1e,_0xc49686,_0x13f4b7){_0x13f4b7(null,path[_0xec4b('0x25')](config[_0xec4b('0x26')],_0xec4b('0x27')));},'filename':function(_0x4a565d,_0x2c91fb,_0x5066db){_0x5066db(null,util['format'](_0xec4b('0x28'),Date['now'](),_0x2c91fb[_0xec4b('0x29')]));}})});router[_0xec4b('0x23')](_0xec4b('0x11'),upload[_0xec4b('0x2a')](_0xec4b('0x2b')),controller[_0xec4b('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x13bcb6,_0x1bdc60,_0x54c016){_0x54c016(null,path[_0xec4b('0x25')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x1178d8,_0x5824e7,_0x12ef26){_0x12ef26(null,util[_0xec4b('0x2d')](_0xec4b('0x28'),Date[_0xec4b('0x2e')](),_0x5824e7['originalname']));}})});router['post'](_0xec4b('0x12'),upload[_0xec4b('0x2a')](_0xec4b('0x2b')),controller[_0xec4b('0x2f')]);var upload=multer({'storage':multer[_0xec4b('0x30')]({'destination':function(_0x1962d6,_0x2034d2,_0x4cf25e){_0x4cf25e(null,path[_0xec4b('0x25')](config[_0xec4b('0x26')],_0xec4b('0x31')));},'filename':function(_0xa6a695,_0x1b1190,_0x3f8286){_0x3f8286(null,util['format'](_0xec4b('0x28'),Date[_0xec4b('0x2e')](),_0x1b1190[_0xec4b('0x29')]));}})});router['post']('/:id/customer_avatar',upload['single']('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xec4b('0x30')]({'destination':function(_0x32fa51,_0x4ccd9d,_0xe3ab11){_0xe3ab11(null,path[_0xec4b('0x25')](config[_0xec4b('0x26')],_0xec4b('0x31')));},'filename':function(_0x172047,_0x1e6449,_0x1766d9){_0x1766d9(null,util[_0xec4b('0x2d')](_0xec4b('0x28'),Date[_0xec4b('0x2e')](),_0x1e6449[_0xec4b('0x29')]));}})});router[_0xec4b('0x23')]('/:id/system_avatar',upload[_0xec4b('0x2a')](_0xec4b('0x2b')),controller[_0xec4b('0x32')]);router[_0xec4b('0x23')]('/:id/notify',controller[_0xec4b('0x33')]);router[_0xec4b('0x23')](_0xec4b('0x34'),controller[_0xec4b('0x35')]);router['post'](_0xec4b('0x18'),auth[_0xec4b('0xc')](),controller['addInteraction']);router[_0xec4b('0x23')](_0xec4b('0x1b'),auth['isAuthenticated'](),controller[_0xec4b('0x36')]);router['post'](_0xec4b('0x37'),auth[_0xec4b('0xc')](),controller[_0xec4b('0x38')]);router[_0xec4b('0x23')](_0xec4b('0x21'),auth[_0xec4b('0xc')](),controller[_0xec4b('0x39')]);router[_0xec4b('0x3a')](_0xec4b('0xb'),auth[_0xec4b('0xc')](),controller[_0xec4b('0x3b')]);router[_0xec4b('0x3c')]('/:id',auth[_0xec4b('0xc')](),controller[_0xec4b('0x3d')]);router[_0xec4b('0x3c')](_0xec4b('0xd'),auth['isAuthenticated'](),controller[_0xec4b('0x3e')]);router[_0xec4b('0x3c')]('/:id/canned_answers',auth[_0xec4b('0xc')](),controller[_0xec4b('0x3f')]);router[_0xec4b('0x3c')](_0xec4b('0x21'),auth[_0xec4b('0xc')](),controller[_0xec4b('0x40')]);module[_0xec4b('0x41')]=router; \ No newline at end of file +var _0x1aed=['addDisposition','addAnswer','join','server/files/images/logos/','now','/:id/logo','single','file','diskStorage','server/files/images/avatars/','format','originalname','addAvatar','%s-%s','root','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create'];(function(_0x3f25d5,_0x31d352){var _0xd9b7c5=function(_0xfc38db){while(--_0xfc38db){_0x3f25d5['push'](_0x3f25d5['shift']());}};_0xd9b7c5(++_0x31d352);}(_0x1aed,0x121));var _0xd1ae=function(_0x1c4733,_0x5f038e){_0x1c4733=_0x1c4733-0x0;var _0x59f00c=_0x1aed[_0x1c4733];return _0x59f00c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd1ae('0x0'));var express=require(_0xd1ae('0x1'));var router=express[_0xd1ae('0x2')]();var auth=require(_0xd1ae('0x3'));var interaction=require(_0xd1ae('0x4'));var config=require(_0xd1ae('0x5'));var controller=require('./chatWebsite.controller');router[_0xd1ae('0x6')]('/',auth['isAuthenticated'](),controller[_0xd1ae('0x7')]);router[_0xd1ae('0x6')](_0xd1ae('0x8'),auth[_0xd1ae('0x9')](),controller['describe']);router['get'](_0xd1ae('0xa'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0xb')]);router[_0xd1ae('0x6')](_0xd1ae('0xc'),auth[_0xd1ae('0x9')](),controller['getDispositions']);router[_0xd1ae('0x6')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd1ae('0xd')]);router[_0xd1ae('0x6')]('/:id/logo',controller['getLogo']);router['get'](_0xd1ae('0xe'),controller[_0xd1ae('0xf')]);router['get'](_0xd1ae('0x10'),controller['getCustomerAvatar']);router[_0xd1ae('0x6')](_0xd1ae('0x11'),controller['getSystemAvatar']);router[_0xd1ae('0x6')](_0xd1ae('0x12'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x13')]);router['get'](_0xd1ae('0x14'),controller['getSnippet']);router[_0xd1ae('0x6')](_0xd1ae('0x15'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x16')]);router[_0xd1ae('0x6')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xd1ae('0x6')](_0xd1ae('0x17'),controller[_0xd1ae('0x18')]);router['get'](_0xd1ae('0x19'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x1a')]);router['get'](_0xd1ae('0x1b'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x1c')]);router[_0xd1ae('0x1d')]('/',auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x1e')]);router['post'](_0xd1ae('0xc'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x1f')]);router[_0xd1ae('0x1d')]('/:id/canned_answers',auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26150a,_0x530eca,_0x198ffb){_0x198ffb(null,path[_0xd1ae('0x21')](config['root'],_0xd1ae('0x22')));},'filename':function(_0x3f02fb,_0x25766b,_0x499fa7){_0x499fa7(null,util['format']('%s-%s',Date[_0xd1ae('0x23')](),_0x25766b['originalname']));}})});router[_0xd1ae('0x1d')](_0xd1ae('0x24'),upload[_0xd1ae('0x25')](_0xd1ae('0x26')),controller['addLogo']);var upload=multer({'storage':multer[_0xd1ae('0x27')]({'destination':function(_0x538eb5,_0xb142ee,_0x39646a){_0x39646a(null,path[_0xd1ae('0x21')](config['root'],_0xd1ae('0x28')));},'filename':function(_0x55ba0a,_0x58e393,_0x481121){_0x481121(null,util[_0xd1ae('0x29')]('%s-%s',Date[_0xd1ae('0x23')](),_0x58e393[_0xd1ae('0x2a')]));}})});router[_0xd1ae('0x1d')](_0xd1ae('0xe'),upload[_0xd1ae('0x25')](_0xd1ae('0x26')),controller[_0xd1ae('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd8860,_0x2fba9d,_0x2e5045){_0x2e5045(null,path[_0xd1ae('0x21')](config['root'],_0xd1ae('0x28')));},'filename':function(_0x35c80a,_0x2e015f,_0x4982a8){_0x4982a8(null,util[_0xd1ae('0x29')](_0xd1ae('0x2c'),Date[_0xd1ae('0x23')](),_0x2e015f[_0xd1ae('0x2a')]));}})});router[_0xd1ae('0x1d')](_0xd1ae('0x10'),upload[_0xd1ae('0x25')](_0xd1ae('0x26')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2ab018,_0x20c2d4,_0x3696a9){_0x3696a9(null,path['join'](config[_0xd1ae('0x2d')],_0xd1ae('0x28')));},'filename':function(_0xbbe5c,_0x1fc3bc,_0x588d68){_0x588d68(null,util[_0xd1ae('0x29')](_0xd1ae('0x2c'),Date[_0xd1ae('0x23')](),_0x1fc3bc[_0xd1ae('0x2a')]));}})});router[_0xd1ae('0x1d')](_0xd1ae('0x11'),upload[_0xd1ae('0x25')]('file'),controller[_0xd1ae('0x2e')]);router[_0xd1ae('0x1d')](_0xd1ae('0x2f'),controller[_0xd1ae('0x30')]);router[_0xd1ae('0x1d')](_0xd1ae('0x31'),controller[_0xd1ae('0x32')]);router[_0xd1ae('0x1d')]('/:id/interactions',auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x33')]);router['post']('/:id/applications',auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x34')]);router[_0xd1ae('0x1d')](_0xd1ae('0x35'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x36')]);router['post'](_0xd1ae('0x1b'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x37')]);router[_0xd1ae('0x38')](_0xd1ae('0xa'),auth['isAuthenticated'](),controller[_0xd1ae('0x39')]);router[_0xd1ae('0x3a')](_0xd1ae('0xa'),auth['isAuthenticated'](),controller[_0xd1ae('0x3b')]);router[_0xd1ae('0x3a')]('/:id/dispositions',auth[_0xd1ae('0x9')](),controller['removeDispositions']);router[_0xd1ae('0x3a')](_0xd1ae('0x3c'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x3d')]);router[_0xd1ae('0x3a')](_0xd1ae('0x1b'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x3e')]);module[_0xd1ae('0x3f')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index be0b387..4b71b23 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 _0x9d22=['STRING','sequelize','exports','name'];(function(_0x3f755f,_0x541a8c){var _0x2e4260=function(_0x2c5c6a){while(--_0x2c5c6a){_0x3f755f['push'](_0x3f755f['shift']());}};_0x2e4260(++_0x541a8c);}(_0x9d22,0xf9));var _0x29d2=function(_0x34ea22,_0x1270b3){_0x34ea22=_0x34ea22-0x0;var _0x1ca470=_0x9d22[_0x34ea22];return _0x1ca470;};'use strict';var Sequelize=require(_0x29d2('0x0'));module[_0x29d2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x29d2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x29d2('0x3')]},'companyId':{'type':Sequelize[_0x29d2('0x3')]},'website':{'type':Sequelize[_0x29d2('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x29d2('0x3')]},'type':{'type':Sequelize[_0x29d2('0x3')]},'street':{'type':Sequelize[_0x29d2('0x3')]},'postalCode':{'type':Sequelize[_0x29d2('0x3')]},'city':{'type':Sequelize[_0x29d2('0x3')]},'country':{'type':Sequelize[_0x29d2('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x29d2('0x3')]},'sCity':{'type':Sequelize[_0x29d2('0x3')]},'sCountry':{'type':Sequelize[_0x29d2('0x3')]},'description':{'type':Sequelize[_0x29d2('0x3')]}}; \ No newline at end of file +var _0x950a=['exports','STRING','name','sequelize'];(function(_0x4e808c,_0x3ebb84){var _0x1db4c6=function(_0x211bbf){while(--_0x211bbf){_0x4e808c['push'](_0x4e808c['shift']());}};_0x1db4c6(++_0x3ebb84);}(_0x950a,0xeb));var _0xa950=function(_0x1e4748,_0x3938a4){_0x1e4748=_0x1e4748-0x0;var _0x3ed610=_0x950a[_0x1e4748];return _0x3ed610;};'use strict';var Sequelize=require(_0xa950('0x0'));module[_0xa950('0x1')]={'name':{'type':Sequelize[_0xa950('0x2')],'unique':_0xa950('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xa950('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xa950('0x2')]},'type':{'type':Sequelize[_0xa950('0x2')]},'street':{'type':Sequelize[_0xa950('0x2')]},'postalCode':{'type':Sequelize[_0xa950('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa950('0x2')]},'email':{'type':Sequelize[_0xa950('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa950('0x2')]},'sStreet':{'type':Sequelize[_0xa950('0x2')]},'sPostalCode':{'type':Sequelize[_0xa950('0x2')]},'sCity':{'type':Sequelize[_0xa950('0x2')]},'sCountry':{'type':Sequelize['STRING']},'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 f93d57e..158f72c 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 _0xe8db=['name','send','index','describe','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','CmCompany','includeAll','include','findAll','catch','show','rawAttributes','fields','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','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','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','save','destroy','then','get','Companies','UserProfileResource'];(function(_0x4d304b,_0x13f519){var _0x5eeb9d=function(_0x406b65){while(--_0x406b65){_0x4d304b['push'](_0x4d304b['shift']());}};_0x5eeb9d(++_0x13f519);}(_0xe8db,0x12c));var _0xbe8d=function(_0x2b2b33,_0x56606f){_0x2b2b33=_0x2b2b33-0x0;var _0x229157=_0xe8db[_0x2b2b33];return _0x229157;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbe8d('0x0'));var rimraf=require(_0xbe8d('0x1'));var zipdir=require(_0xbe8d('0x2'));var jsonpatch=require(_0xbe8d('0x3'));var rp=require(_0xbe8d('0x4'));var moment=require(_0xbe8d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbe8d('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbe8d('0x7'));var ejs=require(_0xbe8d('0x8'));var fs=require('fs');var _=require(_0xbe8d('0x9'));var squel=require(_0xbe8d('0xa'));var crypto=require(_0xbe8d('0xb'));var jsforce=require(_0xbe8d('0xc'));var deskjs=require(_0xbe8d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbe8d('0xe'));var Papa=require(_0xbe8d('0xf'));var Redis=require('ioredis');var authService=require(_0xbe8d('0x10'));var qs=require(_0xbe8d('0x11'));var as=require(_0xbe8d('0x12'));var hardwareService=require(_0xbe8d('0x13'));var logger=require(_0xbe8d('0x14'))(_0xbe8d('0x15'));var utils=require(_0xbe8d('0x16'));var config=require(_0xbe8d('0x17'));var db=require(_0xbe8d('0x18'))['db'];function respondWithStatusCode(_0x18938c,_0x347b84){_0x347b84=_0x347b84||0xcc;return function(_0x29ca4f){if(_0x29ca4f){return _0x18938c[_0xbe8d('0x19')](_0x347b84);}return _0x18938c[_0xbe8d('0x1a')](_0x347b84)[_0xbe8d('0x1b')]();};}function respondWithResult(_0x3eec20,_0x565e43){_0x565e43=_0x565e43||0xc8;return function(_0x112080){if(_0x112080){return _0x3eec20['status'](_0x565e43)['json'](_0x112080);}};}function respondWithFilteredResult(_0x584d5b,_0x3060ca){return function(_0x46fa61){if(_0x46fa61){var _0x2ccee9=_0x46fa61[_0xbe8d('0x1c')],_0x265fd2=_0x3060ca['offset'],_0x216561=_0x3060ca[_0xbe8d('0x1d')]+_0x3060ca[_0xbe8d('0x1e')],_0x447df2;if(_0x216561>=_0x2ccee9){_0x216561=_0x2ccee9;_0x447df2=0xc8;}else{_0x447df2=0xce;}_0x584d5b[_0xbe8d('0x1a')](_0x447df2);return _0x584d5b[_0xbe8d('0x1f')]('Content-Range',_0x265fd2+'-'+_0x216561+'/'+_0x2ccee9)[_0xbe8d('0x20')](_0x46fa61);}return null;};}function patchUpdates(_0x2c88f0){return function(_0x102c95){try{jsonpatch[_0xbe8d('0x21')](_0x102c95,_0x2c88f0,!![]);}catch(_0x114f12){return BPromise['reject'](_0x114f12);}return _0x102c95[_0xbe8d('0x22')]();};}function saveUpdates(_0x1f8c00,_0x345901){return function(_0xd39e46){if(_0xd39e46){return _0xd39e46['update'](_0x1f8c00)['then'](function(_0x352f0e){return _0x352f0e;});}return null;};}function removeEntity(_0x265a1d,_0x45e56b){return function(_0x530b80){if(_0x530b80){return _0x530b80[_0xbe8d('0x23')]()[_0xbe8d('0x24')](function(){var _0x1d94b4=_0x530b80[_0xbe8d('0x25')]({'plain':!![]});var _0x4cfe49=_0xbe8d('0x26');return db[_0xbe8d('0x27')]['destroy']({'where':{'type':_0x4cfe49,'resourceId':_0x1d94b4['id']}})['then'](function(){return _0x530b80;});})[_0xbe8d('0x24')](function(){_0x265a1d[_0xbe8d('0x1a')](0xcc)[_0xbe8d('0x1b')]();});}};}function handleEntityNotFound(_0x1f6864,_0x233762){return function(_0x4abffe){if(!_0x4abffe){_0x1f6864[_0xbe8d('0x19')](0x194);}return _0x4abffe;};}function handleError(_0x2704d0,_0x22e179){_0x22e179=_0x22e179||0x1f4;return function(_0x3ce535){logger['error'](_0x3ce535['stack']);if(_0x3ce535[_0xbe8d('0x28')]){delete _0x3ce535['name'];}_0x2704d0['status'](_0x22e179)[_0xbe8d('0x29')](_0x3ce535);};}exports[_0xbe8d('0x2a')]=function(_0x74f3cc,_0x5a07b9){var _0x538a4e={},_0x34feb1={},_0xffb158={'count':0x0,'rows':[]};return db['CmCompany'][_0xbe8d('0x2b')]()['then'](function(_0x57c204){_0x34feb1[_0xbe8d('0x2c')]=_[_0xbe8d('0x2d')](_0x57c204);_0x34feb1[_0xbe8d('0x2e')]=_[_0xbe8d('0x2d')](_0x74f3cc[_0xbe8d('0x2e')]);_0x34feb1[_0xbe8d('0x2f')]=_[_0xbe8d('0x30')](_0x34feb1[_0xbe8d('0x2c')],_0x34feb1['query']);_0x538a4e[_0xbe8d('0x31')]=_[_0xbe8d('0x30')](_0x34feb1[_0xbe8d('0x2c')],qs['fields'](_0x74f3cc[_0xbe8d('0x2e')]['fields']));_0x538a4e['attributes']=_0x538a4e[_0xbe8d('0x31')]['length']?_0x538a4e[_0xbe8d('0x31')]:_0x34feb1[_0xbe8d('0x2c')];if(!_0x74f3cc[_0xbe8d('0x2e')][_0xbe8d('0x32')](_0xbe8d('0x33'))){_0x538a4e[_0xbe8d('0x1e')]=qs['limit'](_0x74f3cc['query']['limit']);_0x538a4e[_0xbe8d('0x1d')]=qs['offset'](_0x74f3cc[_0xbe8d('0x2e')][_0xbe8d('0x1d')]);}_0x538a4e[_0xbe8d('0x34')]=qs[_0xbe8d('0x35')](_0x74f3cc[_0xbe8d('0x2e')][_0xbe8d('0x35')]);_0x538a4e[_0xbe8d('0x36')]=qs[_0xbe8d('0x2f')](_[_0xbe8d('0x37')](_0x74f3cc[_0xbe8d('0x2e')],_0x34feb1[_0xbe8d('0x2f')]));if(_0x74f3cc[_0xbe8d('0x2e')][_0xbe8d('0x38')]){_0x538a4e[_0xbe8d('0x36')]=_[_0xbe8d('0x39')](_0x538a4e[_0xbe8d('0x36')],{'$or':_[_0xbe8d('0x3a')](_0x538a4e['attributes'],function(_0x4b0340){var _0x1a6723={};_0x1a6723[_0x4b0340]={'$like':'%'+_0x74f3cc[_0xbe8d('0x2e')][_0xbe8d('0x38')]+'%'};return _0x1a6723;})});}_0x538a4e=_[_0xbe8d('0x39')]({},_0x538a4e,_0x74f3cc[_0xbe8d('0x3b')]);var _0x42564c={'where':_0x538a4e[_0xbe8d('0x36')]};return db[_0xbe8d('0x3c')][_0xbe8d('0x1c')](_0x42564c)[_0xbe8d('0x24')](function(_0x3cf902){_0xffb158['count']=_0x3cf902;if(_0x74f3cc[_0xbe8d('0x2e')][_0xbe8d('0x3d')]){_0x538a4e[_0xbe8d('0x3e')]=[{'all':!![]}];}return db[_0xbe8d('0x3c')][_0xbe8d('0x3f')](_0x538a4e);})[_0xbe8d('0x24')](function(_0x320a62){_0xffb158['rows']=_0x320a62;return _0xffb158;})[_0xbe8d('0x24')](respondWithFilteredResult(_0x5a07b9,_0x538a4e))[_0xbe8d('0x40')](handleError(_0x5a07b9,null));})[_0xbe8d('0x40')](handleError(_0x5a07b9,null));};exports[_0xbe8d('0x41')]=function(_0x347fce,_0x189582){var _0x5991c3={'raw':![],'where':{'id':_0x347fce['params']['id']}},_0xfbda76={};_0xfbda76[_0xbe8d('0x2c')]=_['keys'](db[_0xbe8d('0x3c')][_0xbe8d('0x42')]);_0xfbda76[_0xbe8d('0x2e')]=_[_0xbe8d('0x2d')](_0x347fce['query']);_0xfbda76[_0xbe8d('0x2f')]=_['intersection'](_0xfbda76['model'],_0xfbda76['query']);_0x5991c3[_0xbe8d('0x31')]=_[_0xbe8d('0x30')](_0xfbda76['model'],qs['fields'](_0x347fce[_0xbe8d('0x2e')][_0xbe8d('0x43')]));_0x5991c3['attributes']=_0x5991c3[_0xbe8d('0x31')][_0xbe8d('0x44')]?_0x5991c3[_0xbe8d('0x31')]:_0xfbda76[_0xbe8d('0x2c')];if(_0x347fce['query'][_0xbe8d('0x3d')]){_0x5991c3[_0xbe8d('0x3e')]=[{'all':!![]}];}_0x5991c3=_[_0xbe8d('0x39')]({},_0x5991c3,_0x347fce[_0xbe8d('0x3b')]);return db[_0xbe8d('0x3c')][_0xbe8d('0x45')](_0x5991c3)[_0xbe8d('0x24')](handleEntityNotFound(_0x189582,null))['then'](respondWithResult(_0x189582,null))[_0xbe8d('0x40')](handleError(_0x189582,null));};exports[_0xbe8d('0x46')]=function(_0x4bcd4b,_0x4dc02d){return db[_0xbe8d('0x3c')]['create'](_0x4bcd4b['body'],{})[_0xbe8d('0x24')](function(_0x5a7936){var _0x567c9d=_0x4bcd4b[_0xbe8d('0x47')][_0xbe8d('0x25')]({'plain':!![]});if(!_0x567c9d)throw new Error(_0xbe8d('0x48'));if(_0x567c9d['role']===_0xbe8d('0x47')){var _0x594b11=_0x5a7936['get']({'plain':!![]});var _0x58a779=_0xbe8d('0x26');return db[_0xbe8d('0x49')][_0xbe8d('0x45')]({'where':{'name':_0x58a779,'userProfileId':_0x567c9d['userProfileId']},'raw':!![]})[_0xbe8d('0x24')](function(_0x50790d){if(_0x50790d&&_0x50790d[_0xbe8d('0x4a')]===0x0){return db['UserProfileResource'][_0xbe8d('0x46')]({'name':_0x594b11[_0xbe8d('0x28')],'resourceId':_0x594b11['id'],'type':_0x50790d[_0xbe8d('0x28')],'sectionId':_0x50790d['id']},{})[_0xbe8d('0x24')](function(){return _0x5a7936;});}else{return _0x5a7936;}})['catch'](function(_0x2c6324){logger['error'](_0xbe8d('0x4b'),_0x2c6324);throw _0x2c6324;});}return _0x5a7936;})[_0xbe8d('0x24')](respondWithResult(_0x4dc02d,0xc9))[_0xbe8d('0x40')](handleError(_0x4dc02d,null));};exports[_0xbe8d('0x4c')]=function(_0x3aa2bb,_0x278f31){if(_0x3aa2bb[_0xbe8d('0x4d')]['id']){delete _0x3aa2bb[_0xbe8d('0x4d')]['id'];}return db[_0xbe8d('0x3c')][_0xbe8d('0x45')]({'where':{'id':_0x3aa2bb[_0xbe8d('0x4e')]['id']}})[_0xbe8d('0x24')](handleEntityNotFound(_0x278f31,null))[_0xbe8d('0x24')](saveUpdates(_0x3aa2bb[_0xbe8d('0x4d')],null))[_0xbe8d('0x24')](respondWithResult(_0x278f31,null))[_0xbe8d('0x40')](handleError(_0x278f31,null));};exports[_0xbe8d('0x23')]=function(_0x4b5b39,_0x9966de){return db[_0xbe8d('0x3c')]['find']({'where':{'id':_0x4b5b39[_0xbe8d('0x4e')]['id']}})[_0xbe8d('0x24')](handleEntityNotFound(_0x9966de,null))[_0xbe8d('0x24')](removeEntity(_0x9966de,null))[_0xbe8d('0x40')](handleError(_0x9966de,null));};exports[_0xbe8d('0x2b')]=function(_0x2335f0,_0x5f0ec6){return db[_0xbe8d('0x3c')][_0xbe8d('0x2b')]()['then'](respondWithResult(_0x5f0ec6,null))[_0xbe8d('0x40')](handleError(_0x5f0ec6,null));};exports[_0xbe8d('0x4f')]=function(_0xc112f5,_0xb9dcc0,_0x2edda3){return db[_0xbe8d('0x50')][_0xbe8d('0x45')]({'where':{'id':_0xc112f5[_0xbe8d('0x4e')]['id']}})[_0xbe8d('0x24')](handleEntityNotFound(_0xb9dcc0,null))[_0xbe8d('0x24')](function(_0x449c7f){if(_0x449c7f){return _0x449c7f[_0xbe8d('0x4f')](_0xc112f5[_0xbe8d('0x4d')][_0xbe8d('0x51')],_[_0xbe8d('0x52')](_0xc112f5[_0xbe8d('0x4d')],[_0xbe8d('0x51'),'id'])||{});}})[_0xbe8d('0x24')](respondWithResult(_0xb9dcc0,null))['catch'](handleError(_0xb9dcc0,null));};exports[_0xbe8d('0x53')]=function(_0x566eec,_0x28364e,_0x258ef8){var _0x515f99={};var _0x25b1b3={};var _0x581dc;var _0x5c3a13;return db['CmCompany'][_0xbe8d('0x54')]({'where':{'id':_0x566eec[_0xbe8d('0x4e')]['id']}})[_0xbe8d('0x24')](handleEntityNotFound(_0x28364e,null))[_0xbe8d('0x24')](function(_0x3ff27e){if(_0x3ff27e){_0x581dc=_0x3ff27e;_0x25b1b3[_0xbe8d('0x2c')]=_[_0xbe8d('0x2d')](db[_0xbe8d('0x50')][_0xbe8d('0x42')]);_0x25b1b3[_0xbe8d('0x2e')]=_[_0xbe8d('0x2d')](_0x566eec[_0xbe8d('0x2e')]);_0x25b1b3['filters']=_[_0xbe8d('0x30')](_0x25b1b3[_0xbe8d('0x2c')],_0x25b1b3[_0xbe8d('0x2e')]);_0x515f99[_0xbe8d('0x31')]=_[_0xbe8d('0x30')](_0x25b1b3[_0xbe8d('0x2c')],qs[_0xbe8d('0x43')](_0x566eec[_0xbe8d('0x2e')][_0xbe8d('0x43')]));_0x515f99[_0xbe8d('0x31')]=_0x515f99[_0xbe8d('0x31')][_0xbe8d('0x44')]?_0x515f99[_0xbe8d('0x31')]:_0x25b1b3[_0xbe8d('0x2c')];_0x515f99['order']=qs['sort'](_0x566eec[_0xbe8d('0x2e')][_0xbe8d('0x35')]);_0x515f99[_0xbe8d('0x36')]=qs[_0xbe8d('0x2f')](_[_0xbe8d('0x37')](_0x566eec['query'],_0x25b1b3['filters']));if(_0x566eec[_0xbe8d('0x2e')][_0xbe8d('0x38')]){_0x515f99['where']=_['merge'](_0x515f99[_0xbe8d('0x36')],{'$or':_['map'](_0x515f99['attributes'],function(_0x5f17cf){var _0xe139cf={};_0xe139cf[_0x5f17cf]={'$like':'%'+_0x566eec[_0xbe8d('0x2e')][_0xbe8d('0x38')]+'%'};return _0xe139cf;})});}_0x515f99=_[_0xbe8d('0x39')]({},_0x515f99,_0x566eec[_0xbe8d('0x3b')]);return _0x581dc[_0xbe8d('0x53')](_0x515f99);}})[_0xbe8d('0x24')](function(_0x48eceb){if(_0x48eceb){_0x5c3a13=_0x48eceb[_0xbe8d('0x44')];if(!_0x566eec[_0xbe8d('0x2e')]['hasOwnProperty']('nolimit')){_0x515f99[_0xbe8d('0x1e')]=qs[_0xbe8d('0x1e')](_0x566eec[_0xbe8d('0x2e')][_0xbe8d('0x1e')]);_0x515f99[_0xbe8d('0x1d')]=qs['offset'](_0x566eec[_0xbe8d('0x2e')][_0xbe8d('0x1d')]);}return _0x581dc[_0xbe8d('0x53')](_0x515f99);}})[_0xbe8d('0x24')](function(_0x340e8c){if(_0x340e8c){return _0x340e8c?{'count':_0x5c3a13,'rows':_0x340e8c}:null;}})[_0xbe8d('0x24')](respondWithResult(_0x28364e,null))[_0xbe8d('0x40')](handleError(_0x28364e,null));}; \ No newline at end of file +var _0xb7e3=['limit','set','Content-Range','apply','reject','then','destroy','Companies','UserProfileResource','error','stack','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','update','params','CmContact','addContacts','ids','omit','getContacts','sort','map','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset'];(function(_0x556228,_0x21fbed){var _0x24d6a4=function(_0x322ff4){while(--_0x322ff4){_0x556228['push'](_0x556228['shift']());}};_0x24d6a4(++_0x21fbed);}(_0xb7e3,0x12e));var _0x3b7e=function(_0x3e1226,_0x4199d6){_0x3e1226=_0x3e1226-0x0;var _0x1ff634=_0xb7e3[_0x3e1226];return _0x1ff634;};'use strict';var pdf=require(_0x3b7e('0x0'));var emlformat=require(_0x3b7e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3b7e('0x2'));var jsonpatch=require(_0x3b7e('0x3'));var rp=require(_0x3b7e('0x4'));var moment=require(_0x3b7e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3b7e('0x6'));var util=require(_0x3b7e('0x7'));var path=require(_0x3b7e('0x8'));var sox=require(_0x3b7e('0x9'));var csv=require(_0x3b7e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3b7e('0xb'));var squel=require(_0x3b7e('0xc'));var crypto=require(_0x3b7e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3b7e('0xe'));var toCsv=require(_0x3b7e('0xa'));var querystring=require(_0x3b7e('0xf'));var Papa=require(_0x3b7e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3b7e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b7e('0x12'));var logger=require(_0x3b7e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3b7e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ad75e,_0x595c68){_0x595c68=_0x595c68||0xcc;return function(_0x23b6f4){if(_0x23b6f4){return _0x3ad75e[_0x3b7e('0x15')](_0x595c68);}return _0x3ad75e[_0x3b7e('0x16')](_0x595c68)[_0x3b7e('0x17')]();};}function respondWithResult(_0x322819,_0x233953){_0x233953=_0x233953||0xc8;return function(_0xe8227d){if(_0xe8227d){return _0x322819['status'](_0x233953)[_0x3b7e('0x18')](_0xe8227d);}};}function respondWithFilteredResult(_0x38f44c,_0x2e4aa9){return function(_0x2bb7c6){if(_0x2bb7c6){var _0x1ed97f=_0x2bb7c6['count'],_0x10d946=_0x2e4aa9[_0x3b7e('0x19')],_0x1aaac0=_0x2e4aa9[_0x3b7e('0x19')]+_0x2e4aa9[_0x3b7e('0x1a')],_0x53e184;if(_0x1aaac0>=_0x1ed97f){_0x1aaac0=_0x1ed97f;_0x53e184=0xc8;}else{_0x53e184=0xce;}_0x38f44c[_0x3b7e('0x16')](_0x53e184);return _0x38f44c[_0x3b7e('0x1b')](_0x3b7e('0x1c'),_0x10d946+'-'+_0x1aaac0+'/'+_0x1ed97f)[_0x3b7e('0x18')](_0x2bb7c6);}return null;};}function patchUpdates(_0x142d06){return function(_0x353410){try{jsonpatch[_0x3b7e('0x1d')](_0x353410,_0x142d06,!![]);}catch(_0x99977a){return BPromise[_0x3b7e('0x1e')](_0x99977a);}return _0x353410['save']();};}function saveUpdates(_0x2f6235,_0x242ae0){return function(_0x217ac){if(_0x217ac){return _0x217ac['update'](_0x2f6235)[_0x3b7e('0x1f')](function(_0x33fe05){return _0x33fe05;});}return null;};}function removeEntity(_0x1444c0,_0x18959c){return function(_0x458417){if(_0x458417){return _0x458417[_0x3b7e('0x20')]()['then'](function(){var _0x4324c4=_0x458417['get']({'plain':!![]});var _0x2db127=_0x3b7e('0x21');return db[_0x3b7e('0x22')][_0x3b7e('0x20')]({'where':{'type':_0x2db127,'resourceId':_0x4324c4['id']}})[_0x3b7e('0x1f')](function(){return _0x458417;});})[_0x3b7e('0x1f')](function(){_0x1444c0[_0x3b7e('0x16')](0xcc)[_0x3b7e('0x17')]();});}};}function handleEntityNotFound(_0x27d58c,_0x47ff08){return function(_0x35e0df){if(!_0x35e0df){_0x27d58c[_0x3b7e('0x15')](0x194);}return _0x35e0df;};}function handleError(_0x3bc2c7,_0x2f5e9f){_0x2f5e9f=_0x2f5e9f||0x1f4;return function(_0x36b393){logger[_0x3b7e('0x23')](_0x36b393[_0x3b7e('0x24')]);if(_0x36b393['name']){delete _0x36b393['name'];}_0x3bc2c7[_0x3b7e('0x16')](_0x2f5e9f)[_0x3b7e('0x25')](_0x36b393);};}exports[_0x3b7e('0x26')]=function(_0x39c8f1,_0x78b4cf){var _0x3dfe88={},_0x52fde2={},_0x249a42={'count':0x0,'rows':[]};return db[_0x3b7e('0x27')][_0x3b7e('0x28')]()[_0x3b7e('0x1f')](function(_0x3a3c0a){_0x52fde2['model']=_[_0x3b7e('0x29')](_0x3a3c0a);_0x52fde2['query']=_[_0x3b7e('0x29')](_0x39c8f1[_0x3b7e('0x2a')]);_0x52fde2[_0x3b7e('0x2b')]=_[_0x3b7e('0x2c')](_0x52fde2[_0x3b7e('0x2d')],_0x52fde2[_0x3b7e('0x2a')]);_0x3dfe88[_0x3b7e('0x2e')]=_['intersection'](_0x52fde2['model'],qs['fields'](_0x39c8f1['query'][_0x3b7e('0x2f')]));_0x3dfe88[_0x3b7e('0x2e')]=_0x3dfe88[_0x3b7e('0x2e')][_0x3b7e('0x30')]?_0x3dfe88[_0x3b7e('0x2e')]:_0x52fde2[_0x3b7e('0x2d')];if(!_0x39c8f1[_0x3b7e('0x2a')][_0x3b7e('0x31')](_0x3b7e('0x32'))){_0x3dfe88[_0x3b7e('0x1a')]=qs[_0x3b7e('0x1a')](_0x39c8f1[_0x3b7e('0x2a')][_0x3b7e('0x1a')]);_0x3dfe88['offset']=qs[_0x3b7e('0x19')](_0x39c8f1['query'][_0x3b7e('0x19')]);}_0x3dfe88[_0x3b7e('0x33')]=qs['sort'](_0x39c8f1[_0x3b7e('0x2a')]['sort']);_0x3dfe88[_0x3b7e('0x34')]=qs['filters'](_['pick'](_0x39c8f1[_0x3b7e('0x2a')],_0x52fde2[_0x3b7e('0x2b')]));if(_0x39c8f1[_0x3b7e('0x2a')]['filter']){_0x3dfe88[_0x3b7e('0x34')]=_['merge'](_0x3dfe88[_0x3b7e('0x34')],{'$or':_['map'](_0x3dfe88['attributes'],function(_0x2b2166){var _0x127ed9={};_0x127ed9[_0x2b2166]={'$like':'%'+_0x39c8f1[_0x3b7e('0x2a')][_0x3b7e('0x35')]+'%'};return _0x127ed9;})});}_0x3dfe88=_[_0x3b7e('0x36')]({},_0x3dfe88,_0x39c8f1[_0x3b7e('0x37')]);var _0x3ab8be={'where':_0x3dfe88['where']};return db[_0x3b7e('0x27')][_0x3b7e('0x38')](_0x3ab8be)[_0x3b7e('0x1f')](function(_0x35ba14){_0x249a42[_0x3b7e('0x38')]=_0x35ba14;if(_0x39c8f1[_0x3b7e('0x2a')][_0x3b7e('0x39')]){_0x3dfe88[_0x3b7e('0x3a')]=[{'all':!![]}];}return db[_0x3b7e('0x27')][_0x3b7e('0x3b')](_0x3dfe88);})[_0x3b7e('0x1f')](function(_0x888698){_0x249a42[_0x3b7e('0x3c')]=_0x888698;return _0x249a42;})[_0x3b7e('0x1f')](respondWithFilteredResult(_0x78b4cf,_0x3dfe88))[_0x3b7e('0x3d')](handleError(_0x78b4cf,null));})[_0x3b7e('0x3d')](handleError(_0x78b4cf,null));};exports[_0x3b7e('0x3e')]=function(_0x433402,_0x90249f){var _0x130be2={'raw':![],'where':{'id':_0x433402['params']['id']}},_0x591326={};_0x591326[_0x3b7e('0x2d')]=_[_0x3b7e('0x29')](db[_0x3b7e('0x27')]['rawAttributes']);_0x591326['query']=_['keys'](_0x433402[_0x3b7e('0x2a')]);_0x591326[_0x3b7e('0x2b')]=_[_0x3b7e('0x2c')](_0x591326[_0x3b7e('0x2d')],_0x591326[_0x3b7e('0x2a')]);_0x130be2[_0x3b7e('0x2e')]=_['intersection'](_0x591326['model'],qs['fields'](_0x433402[_0x3b7e('0x2a')][_0x3b7e('0x2f')]));_0x130be2['attributes']=_0x130be2[_0x3b7e('0x2e')][_0x3b7e('0x30')]?_0x130be2[_0x3b7e('0x2e')]:_0x591326['model'];if(_0x433402[_0x3b7e('0x2a')][_0x3b7e('0x39')]){_0x130be2[_0x3b7e('0x3a')]=[{'all':!![]}];}_0x130be2=_[_0x3b7e('0x36')]({},_0x130be2,_0x433402[_0x3b7e('0x37')]);return db[_0x3b7e('0x27')][_0x3b7e('0x3f')](_0x130be2)[_0x3b7e('0x1f')](handleEntityNotFound(_0x90249f,null))[_0x3b7e('0x1f')](respondWithResult(_0x90249f,null))[_0x3b7e('0x3d')](handleError(_0x90249f,null));};exports[_0x3b7e('0x40')]=function(_0x495902,_0x54ea1d){return db[_0x3b7e('0x27')][_0x3b7e('0x40')](_0x495902[_0x3b7e('0x41')],{})['then'](function(_0x10cc6d){var _0x4b5c53=_0x495902[_0x3b7e('0x42')][_0x3b7e('0x43')]({'plain':!![]});if(!_0x4b5c53)throw new Error(_0x3b7e('0x44'));if(_0x4b5c53[_0x3b7e('0x45')]==='user'){var _0x560150=_0x10cc6d[_0x3b7e('0x43')]({'plain':!![]});var _0xdc9be5=_0x3b7e('0x21');return db[_0x3b7e('0x46')]['find']({'where':{'name':_0xdc9be5,'userProfileId':_0x4b5c53[_0x3b7e('0x47')]},'raw':!![]})[_0x3b7e('0x1f')](function(_0x395f38){if(_0x395f38&&_0x395f38['autoAssociation']===0x0){return db[_0x3b7e('0x22')][_0x3b7e('0x40')]({'name':_0x560150[_0x3b7e('0x48')],'resourceId':_0x560150['id'],'type':_0x395f38[_0x3b7e('0x48')],'sectionId':_0x395f38['id']},{})['then'](function(){return _0x10cc6d;});}else{return _0x10cc6d;}})[_0x3b7e('0x3d')](function(_0x40a00b){logger[_0x3b7e('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40a00b);throw _0x40a00b;});}return _0x10cc6d;})[_0x3b7e('0x1f')](respondWithResult(_0x54ea1d,0xc9))['catch'](handleError(_0x54ea1d,null));};exports[_0x3b7e('0x49')]=function(_0x5c1a84,_0x26818f){if(_0x5c1a84[_0x3b7e('0x41')]['id']){delete _0x5c1a84['body']['id'];}return db[_0x3b7e('0x27')][_0x3b7e('0x3f')]({'where':{'id':_0x5c1a84['params']['id']}})[_0x3b7e('0x1f')](handleEntityNotFound(_0x26818f,null))[_0x3b7e('0x1f')](saveUpdates(_0x5c1a84[_0x3b7e('0x41')],null))[_0x3b7e('0x1f')](respondWithResult(_0x26818f,null))[_0x3b7e('0x3d')](handleError(_0x26818f,null));};exports[_0x3b7e('0x20')]=function(_0x1ed12b,_0x318b35){return db[_0x3b7e('0x27')][_0x3b7e('0x3f')]({'where':{'id':_0x1ed12b[_0x3b7e('0x4a')]['id']}})[_0x3b7e('0x1f')](handleEntityNotFound(_0x318b35,null))[_0x3b7e('0x1f')](removeEntity(_0x318b35,null))[_0x3b7e('0x3d')](handleError(_0x318b35,null));};exports[_0x3b7e('0x28')]=function(_0x17b988,_0x290300){return db[_0x3b7e('0x27')][_0x3b7e('0x28')]()[_0x3b7e('0x1f')](respondWithResult(_0x290300,null))[_0x3b7e('0x3d')](handleError(_0x290300,null));};exports['addContacts']=function(_0x9f2956,_0x1512df,_0x36d379){return db[_0x3b7e('0x4b')][_0x3b7e('0x3f')]({'where':{'id':_0x9f2956[_0x3b7e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1512df,null))[_0x3b7e('0x1f')](function(_0x158ee2){if(_0x158ee2){return _0x158ee2[_0x3b7e('0x4c')](_0x9f2956['body'][_0x3b7e('0x4d')],_[_0x3b7e('0x4e')](_0x9f2956[_0x3b7e('0x41')],['ids','id'])||{});}})[_0x3b7e('0x1f')](respondWithResult(_0x1512df,null))[_0x3b7e('0x3d')](handleError(_0x1512df,null));};exports[_0x3b7e('0x4f')]=function(_0x4fd5e8,_0x5996cb,_0x4e8428){var _0x397b4c={};var _0x1397a0={};var _0x235221;var _0x1cd466;return db[_0x3b7e('0x27')]['findOne']({'where':{'id':_0x4fd5e8[_0x3b7e('0x4a')]['id']}})[_0x3b7e('0x1f')](handleEntityNotFound(_0x5996cb,null))[_0x3b7e('0x1f')](function(_0x25d86a){if(_0x25d86a){_0x235221=_0x25d86a;_0x1397a0[_0x3b7e('0x2d')]=_[_0x3b7e('0x29')](db[_0x3b7e('0x4b')]['rawAttributes']);_0x1397a0[_0x3b7e('0x2a')]=_[_0x3b7e('0x29')](_0x4fd5e8['query']);_0x1397a0[_0x3b7e('0x2b')]=_[_0x3b7e('0x2c')](_0x1397a0[_0x3b7e('0x2d')],_0x1397a0['query']);_0x397b4c['attributes']=_[_0x3b7e('0x2c')](_0x1397a0[_0x3b7e('0x2d')],qs['fields'](_0x4fd5e8[_0x3b7e('0x2a')][_0x3b7e('0x2f')]));_0x397b4c['attributes']=_0x397b4c[_0x3b7e('0x2e')][_0x3b7e('0x30')]?_0x397b4c[_0x3b7e('0x2e')]:_0x1397a0[_0x3b7e('0x2d')];_0x397b4c[_0x3b7e('0x33')]=qs[_0x3b7e('0x50')](_0x4fd5e8[_0x3b7e('0x2a')][_0x3b7e('0x50')]);_0x397b4c[_0x3b7e('0x34')]=qs[_0x3b7e('0x2b')](_['pick'](_0x4fd5e8[_0x3b7e('0x2a')],_0x1397a0[_0x3b7e('0x2b')]));if(_0x4fd5e8[_0x3b7e('0x2a')]['filter']){_0x397b4c['where']=_['merge'](_0x397b4c['where'],{'$or':_[_0x3b7e('0x51')](_0x397b4c['attributes'],function(_0xa0fbae){var _0x8ff088={};_0x8ff088[_0xa0fbae]={'$like':'%'+_0x4fd5e8[_0x3b7e('0x2a')]['filter']+'%'};return _0x8ff088;})});}_0x397b4c=_[_0x3b7e('0x36')]({},_0x397b4c,_0x4fd5e8[_0x3b7e('0x37')]);return _0x235221['getContacts'](_0x397b4c);}})[_0x3b7e('0x1f')](function(_0x4dcd43){if(_0x4dcd43){_0x1cd466=_0x4dcd43[_0x3b7e('0x30')];if(!_0x4fd5e8[_0x3b7e('0x2a')][_0x3b7e('0x31')](_0x3b7e('0x32'))){_0x397b4c[_0x3b7e('0x1a')]=qs[_0x3b7e('0x1a')](_0x4fd5e8[_0x3b7e('0x2a')]['limit']);_0x397b4c[_0x3b7e('0x19')]=qs[_0x3b7e('0x19')](_0x4fd5e8[_0x3b7e('0x2a')]['offset']);}return _0x235221['getContacts'](_0x397b4c);}})['then'](function(_0xe9e993){if(_0xe9e993){return _0xe9e993?{'count':_0x1cd466,'rows':_0xe9e993}:null;}})[_0x3b7e('0x1f')](respondWithResult(_0x5996cb,null))['catch'](handleError(_0x5996cb,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 7e3c2a7..516d01e 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 _0x746f=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3c5052,_0x4f5516){var _0xb72071=function(_0x5629f5){while(--_0x5629f5){_0x3c5052['push'](_0x3c5052['shift']());}};_0xb72071(++_0x4f5516);}(_0x746f,0x9c));var _0xf746=function(_0x26b7bb,_0x42eac7){_0x26b7bb=_0x26b7bb-0x0;var _0x5a2ad0=_0x746f[_0x26b7bb];return _0x5a2ad0;};'use strict';var _=require(_0xf746('0x0'));var util=require(_0xf746('0x1'));var logger=require(_0xf746('0x2'))(_0xf746('0x3'));var moment=require(_0xf746('0x4'));var BPromise=require(_0xf746('0x5'));var rp=require(_0xf746('0x6'));var fs=require('fs');var path=require(_0xf746('0x7'));var rimraf=require(_0xf746('0x8'));var config=require(_0xf746('0x9'));var attributes=require(_0xf746('0xa'));module[_0xf746('0xb')]=function(_0x19d855,_0x2f0f3c){return _0x19d855[_0xf746('0xc')](_0xf746('0xd'),attributes,{'tableName':_0xf746('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ba7=['cm_companies','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0xc056fa,_0x134c92){var _0x35573d=function(_0x21ac05){while(--_0x21ac05){_0xc056fa['push'](_0xc056fa['shift']());}};_0x35573d(++_0x134c92);}(_0x0ba7,0x16d));var _0x70ba=function(_0x15a197,_0x6116f6){_0x15a197=_0x15a197-0x0;var _0x529ace=_0x0ba7[_0x15a197];return _0x529ace;};'use strict';var _=require(_0x70ba('0x0'));var util=require('util');var logger=require(_0x70ba('0x1'))(_0x70ba('0x2'));var moment=require(_0x70ba('0x3'));var BPromise=require(_0x70ba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x70ba('0x5'));var rimraf=require(_0x70ba('0x6'));var config=require(_0x70ba('0x7'));var attributes=require(_0x70ba('0x8'));module[_0x70ba('0x9')]=function(_0x3f9877,_0x17a00c){return _0x3f9877[_0x70ba('0xa')](_0x70ba('0xb'),attributes,{'tableName':_0x70ba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 1cb4117..9317e67 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 _0x02d7=['http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0xecbed8,_0x15c7a3){var _0x1842fa=function(_0xf34762){while(--_0xf34762){_0xecbed8['push'](_0xecbed8['shift']());}};_0x1842fa(++_0x15c7a3);}(_0x02d7,0x141));var _0x702d=function(_0x24e765,_0xa6e5cb){_0x24e765=_0x24e765-0x0;var _0x14f609=_0x02d7[_0x24e765];return _0x14f609;};'use strict';var _=require('lodash');var util=require(_0x702d('0x0'));var moment=require(_0x702d('0x1'));var BPromise=require(_0x702d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x702d('0x3'));var db=require(_0x702d('0x4'))['db'];var utils=require(_0x702d('0x5'));var logger=require(_0x702d('0x6'))('rpc');var config=require(_0x702d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x702d('0x8')][_0x702d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1948f0,_0x5c54b5,_0x79ad78){return new BPromise(function(_0x4f8f9e,_0x1aba39){return client[_0x702d('0xa')](_0x1948f0,_0x79ad78)['then'](function(_0x465a69){logger[_0x702d('0xb')](_0x702d('0xc'),_0x5c54b5,'request\x20sent');logger[_0x702d('0xd')](_0x702d('0xe'),_0x5c54b5,_0x702d('0xf'),JSON[_0x702d('0x10')](_0x465a69));if(_0x465a69[_0x702d('0x11')]){if(_0x465a69[_0x702d('0x11')][_0x702d('0x12')]===0x1f4){logger[_0x702d('0x11')](_0x702d('0xc'),_0x5c54b5,_0x465a69[_0x702d('0x11')][_0x702d('0x13')]);return _0x1aba39(_0x465a69[_0x702d('0x11')][_0x702d('0x13')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x5c54b5,_0x465a69[_0x702d('0x11')][_0x702d('0x13')]);return _0x4f8f9e(_0x465a69[_0x702d('0x11')]['message']);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x5c54b5,_0x702d('0xf'));_0x4f8f9e(_0x465a69[_0x702d('0x14')][_0x702d('0x13')]);}})[_0x702d('0x15')](function(_0xf662f2){logger['error'](_0x702d('0xc'),_0x5c54b5,_0xf662f2);_0x1aba39(_0xf662f2);});});} \ No newline at end of file +var _0xecad=['code','message','result','lodash','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error'];(function(_0x40a11d,_0xf118c8){var _0x3d370d=function(_0xce8f7b){while(--_0xce8f7b){_0x40a11d['push'](_0x40a11d['shift']());}};_0x3d370d(++_0xf118c8);}(_0xecad,0x75));var _0xdeca=function(_0x50d84b,_0x1d7ea7){_0x50d84b=_0x50d84b-0x0;var _0x6d4270=_0xecad[_0x50d84b];return _0x6d4270;};'use strict';var _=require(_0xdeca('0x0'));var util=require('util');var moment=require(_0xdeca('0x1'));var BPromise=require(_0xdeca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdeca('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdeca('0x4'));var config=require(_0xdeca('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xdeca('0x6')][_0xdeca('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x570c3a,_0x38c423,_0x286b87){return new BPromise(function(_0x1f0f69,_0x1d5484){return client[_0xdeca('0x8')](_0x570c3a,_0x286b87)[_0xdeca('0x9')](function(_0x3e2f05){logger[_0xdeca('0xa')](_0xdeca('0xb'),_0x38c423,_0xdeca('0xc'));logger[_0xdeca('0xd')](_0xdeca('0xe'),_0x38c423,_0xdeca('0xc'),JSON['stringify'](_0x3e2f05));if(_0x3e2f05[_0xdeca('0xf')]){if(_0x3e2f05[_0xdeca('0xf')][_0xdeca('0x10')]===0x1f4){logger[_0xdeca('0xf')](_0xdeca('0xb'),_0x38c423,_0x3e2f05[_0xdeca('0xf')]['message']);return _0x1d5484(_0x3e2f05['error'][_0xdeca('0x11')]);}logger[_0xdeca('0xf')](_0xdeca('0xb'),_0x38c423,_0x3e2f05[_0xdeca('0xf')][_0xdeca('0x11')]);return _0x1f0f69(_0x3e2f05[_0xdeca('0xf')]['message']);}else{logger[_0xdeca('0xa')](_0xdeca('0xb'),_0x38c423,'request\x20sent');_0x1f0f69(_0x3e2f05[_0xdeca('0x12')][_0xdeca('0x11')]);}})['catch'](function(_0x1b1e7e){logger[_0xdeca('0xf')]('CmCompany,\x20%s,\x20%s',_0x38c423,_0x1b1e7e);_0x1d5484(_0x1b1e7e);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 3c4d030..896c508 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 _0xd046=['create','post','/:id/contacts','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../config/environment','get','/describe','/:id','isAuthenticated'];(function(_0x340bf1,_0x28154e){var _0x5d6835=function(_0x2b688e){while(--_0x2b688e){_0x340bf1['push'](_0x340bf1['shift']());}};_0x5d6835(++_0x28154e);}(_0xd046,0x129));var _0x6d04=function(_0x1cd198,_0xd48332){_0x1cd198=_0x1cd198-0x0;var _0x244d9d=_0xd046[_0x1cd198];return _0x244d9d;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d04('0x4'));var controller=require('./cmCompany.controller');router[_0x6d04('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6d04('0x5')](_0x6d04('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x6d04('0x5')](_0x6d04('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x6d04('0x5')]('/:id/contacts',auth[_0x6d04('0x8')](),controller['getContacts']);router['post']('/',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router[_0x6d04('0xa')](_0x6d04('0xb'),auth[_0x6d04('0x8')](),controller['addContacts']);router[_0x6d04('0xc')](_0x6d04('0x7'),auth[_0x6d04('0x8')](),controller[_0x6d04('0xd')]);router[_0x6d04('0xe')](_0x6d04('0x7'),auth[_0x6d04('0x8')](),controller[_0x6d04('0xf')]);module[_0x6d04('0x10')]=router; \ No newline at end of file +var _0x82c4=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','delete','exports','multer','util'];(function(_0x4c3296,_0x262566){var _0x5260de=function(_0x2543c6){while(--_0x2543c6){_0x4c3296['push'](_0x4c3296['shift']());}};_0x5260de(++_0x262566);}(_0x82c4,0x1ca));var _0x482c=function(_0x855e25,_0x5cc86d){_0x855e25=_0x855e25-0x0;var _0x4c2b86=_0x82c4[_0x855e25];return _0x4c2b86;};'use strict';var multer=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var path=require(_0x482c('0x2'));var timeout=require(_0x482c('0x3'));var express=require(_0x482c('0x4'));var router=express[_0x482c('0x5')]();var auth=require(_0x482c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x482c('0x7'));var controller=require('./cmCompany.controller');router[_0x482c('0x8')]('/',auth['isAuthenticated'](),controller[_0x482c('0x9')]);router['get'](_0x482c('0xa'),auth[_0x482c('0xb')](),controller[_0x482c('0xc')]);router[_0x482c('0x8')](_0x482c('0xd'),auth['isAuthenticated'](),controller[_0x482c('0xe')]);router[_0x482c('0x8')](_0x482c('0xf'),auth[_0x482c('0xb')](),controller[_0x482c('0x10')]);router[_0x482c('0x11')]('/',auth['isAuthenticated'](),controller[_0x482c('0x12')]);router[_0x482c('0x11')](_0x482c('0xf'),auth['isAuthenticated'](),controller[_0x482c('0x13')]);router[_0x482c('0x14')](_0x482c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x482c('0x15')](_0x482c('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x482c('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 4fb22ad..f2029d0 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 _0xdf35=['UNSIGNED','NOW','exports','STRING','INTEGER'];(function(_0x2c4da5,_0x4b0a47){var _0x6c740c=function(_0x4ad41c){while(--_0x4ad41c){_0x2c4da5['push'](_0x2c4da5['shift']());}};_0x6c740c(++_0x4b0a47);}(_0xdf35,0xed));var _0x5df3=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xdf35[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x5df3('0x0')]={'firstName':{'type':Sequelize[_0x5df3('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5df3('0x1')]},'street':{'type':Sequelize[_0x5df3('0x1')]},'postalCode':{'type':Sequelize[_0x5df3('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x5df3('0x1')]},'dateOfBirth':{'type':Sequelize[_0x5df3('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x5df3('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5df3('0x1')]},'url':{'type':Sequelize[_0x5df3('0x1')]},'facebook':{'type':Sequelize[_0x5df3('0x1')]},'fb_data':{'type':Sequelize[_0x5df3('0x1')]},'twitter':{'type':Sequelize[_0x5df3('0x1')]},'skype':{'type':Sequelize[_0x5df3('0x1')]},'teams':{'type':Sequelize[_0x5df3('0x1')]},'viber':{'type':Sequelize[_0x5df3('0x1')]},'line':{'type':Sequelize[_0x5df3('0x1')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x5df3('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x5df3('0x2')](0x2)[_0x5df3('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x5df3('0x4')]}}; \ No newline at end of file +var _0x7b18=['STRING','TEXT','INTEGER','NOW','lodash','sequelize','exports'];(function(_0x1aa012,_0xab696d){var _0x3c1f56=function(_0x5ddcee){while(--_0x5ddcee){_0x1aa012['push'](_0x1aa012['shift']());}};_0x3c1f56(++_0xab696d);}(_0x7b18,0x7b));var _0x87b1=function(_0x5b6824,_0x50d028){_0x5b6824=_0x5b6824-0x0;var _0x2ffef1=_0x7b18[_0x5b6824];return _0x2ffef1;};'use strict';var _=require(_0x87b1('0x0'));var Sequelize=require(_0x87b1('0x1'));module[_0x87b1('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x87b1('0x3')]},'postalCode':{'type':Sequelize[_0x87b1('0x3')]},'city':{'type':Sequelize[_0x87b1('0x3')]},'country':{'type':Sequelize[_0x87b1('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x87b1('0x4')]},'phone':{'type':Sequelize[_0x87b1('0x3')]},'mobile':{'type':Sequelize[_0x87b1('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x87b1('0x3')]},'facebook':{'type':Sequelize[_0x87b1('0x3')]},'fb_data':{'type':Sequelize[_0x87b1('0x3')]},'twitter':{'type':Sequelize[_0x87b1('0x3')]},'skype':{'type':Sequelize[_0x87b1('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x87b1('0x3')]},'line':{'type':Sequelize[_0x87b1('0x3')]},'wechat':{'type':Sequelize[_0x87b1('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x87b1('0x5')]},'priority':{'type':Sequelize[_0x87b1('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x87b1('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 0e12b15..c29ae96 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 _0x6019=['send','describe','length','keys','startsWith','cf_','push','findOne','trimStart','all','type','model','query','filters','intersection','attributes','fields','sort','where','select','field','from','tools_tags','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','find','Tag','value','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','uc.UserId\x20=\x20?','dateOfBirth','fieldType','datetime','DATE','buildExpression','start','map','filter','isNil','forEach','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','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','resolve','conditions','User','user','getLists','isEmpty','c.ListId\x20IS\x20NULL','sequelize','toString','merge','CmContact','c.firstName','c.phone','c.fax','c.email','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','columnName','displayName','findAll','alias','hasOwnProperty','body','get','mergeWith','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','join','bulkCreate','each','duplicates','$or','findOrCreate','spread','params','CmCustomField','$and','omit','pickBy','format','cf_%d','table','setFields','id\x20=\x20?','text','values','phone','getTags','rawAttributes','pick','nolimit','setTags','ids','options','includeAll','getHopperHistories','ContactId','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','meta','import','agent','binding','child_process','fork','../../components/import/cm/csv2','message','start\x20child\x20process\x20correctly!','pid','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./cmContact.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','error','stack','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6019,0x1b2));var _0x9601=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6019[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x9601('0x0'));var emlformat=require(_0x9601('0x1'));var rimraf=require(_0x9601('0x2'));var zipdir=require(_0x9601('0x3'));var jsonpatch=require(_0x9601('0x4'));var rp=require('request-promise');var moment=require(_0x9601('0x5'));var BPromise=require(_0x9601('0x6'));var Mustache=require(_0x9601('0x7'));var util=require('util');var path=require(_0x9601('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9601('0x9'));var fs=require('fs');var _=require(_0x9601('0xa'));var squel=require(_0x9601('0xb'));var crypto=require(_0x9601('0xc'));var jsforce=require(_0x9601('0xd'));var deskjs=require(_0x9601('0xe'));var toCsv=require(_0x9601('0xf'));var querystring=require(_0x9601('0x10'));var Papa=require('papaparse');var Redis=require(_0x9601('0x11'));var authService=require(_0x9601('0x12'));var qs=require(_0x9601('0x13'));var as=require(_0x9601('0x14'));var hardwareService=require(_0x9601('0x15'));var logger=require(_0x9601('0x16'))(_0x9601('0x17'));var utils=require(_0x9601('0x18'));var config=require(_0x9601('0x19'));var db=require(_0x9601('0x1a'))['db'];config[_0x9601('0x1b')]=_['defaults'](config[_0x9601('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9601('0x1b')]));require(_0x9601('0x1c'))[_0x9601('0x1d')](socket);function respondWithStatusCode(_0x52021f,_0x165033){_0x165033=_0x165033||0xcc;return function(_0x41a511){if(_0x41a511){return _0x52021f[_0x9601('0x1e')](_0x165033);}return _0x52021f[_0x9601('0x1f')](_0x165033)[_0x9601('0x20')]();};}function respondWithResult(_0x4a0184,_0x5b4ad7){_0x5b4ad7=_0x5b4ad7||0xc8;return function(_0x586555){if(_0x586555){return _0x4a0184[_0x9601('0x1f')](_0x5b4ad7)[_0x9601('0x21')](_0x586555);}};}function respondWithFilteredResult(_0x10a79b,_0x55c3b2){return function(_0x303562){if(_0x303562){var _0x225922=_0x303562[_0x9601('0x22')],_0x2f32a3=_0x55c3b2[_0x9601('0x23')],_0x303387=_0x55c3b2[_0x9601('0x23')]+_0x55c3b2[_0x9601('0x24')],_0xe1ab84;if(_0x303387>=_0x225922){_0x303387=_0x225922;_0xe1ab84=0xc8;}else{_0xe1ab84=0xce;}_0x10a79b[_0x9601('0x1f')](_0xe1ab84);return _0x10a79b[_0x9601('0x25')]('Content-Range',_0x2f32a3+'-'+_0x303387+'/'+_0x225922)[_0x9601('0x21')](_0x303562);}return null;};}function patchUpdates(_0x16ce4e){return function(_0xa58124){try{jsonpatch[_0x9601('0x26')](_0xa58124,_0x16ce4e,!![]);}catch(_0x542a8d){return BPromise['reject'](_0x542a8d);}return _0xa58124[_0x9601('0x27')]();};}function saveUpdates(_0x4aa2f9,_0x412880){return function(_0x1dcf49){if(_0x1dcf49){return _0x1dcf49[_0x9601('0x28')](_0x4aa2f9)[_0x9601('0x29')](function(_0x1a228b){return _0x1a228b;});}return null;};}function removeEntity(_0xa8daba,_0x4bdc75){return function(_0x42443b){if(_0x42443b){return _0x42443b[_0x9601('0x2a')]()[_0x9601('0x29')](function(){_0xa8daba[_0x9601('0x1f')](0xcc)[_0x9601('0x20')]();});}};}function handleEntityNotFound(_0xacbcaf,_0x12d8a4){return function(_0x135d87){if(!_0x135d87){_0xacbcaf[_0x9601('0x1e')](0x194);}return _0x135d87;};}function handleError(_0x42c5c3,_0x9e506){_0x9e506=_0x9e506||0x1f4;return function(_0x54c2e4){logger[_0x9601('0x2b')](_0x54c2e4[_0x9601('0x2c')]);if(_0x54c2e4[_0x9601('0x2d')]){delete _0x54c2e4[_0x9601('0x2d')];}_0x42c5c3[_0x9601('0x1f')](_0x9e506)[_0x9601('0x2e')](_0x54c2e4);};}exports['index']=function(_0x142289,_0x46c2df){var _0x49cadc={},_0xd7d9fa={},_0x3281bd={'count':0x0,'rows':[]};return db['CmContact'][_0x9601('0x2f')]()[_0x9601('0x29')](function(_0xce333e){var _0x59be48=[];for(var _0x3293d7=0x0;_0x3293d70x1){_0x1811f5['or'](_0x9601('0x67'),qs[_0x9601('0x68')](_0x239bfd),null);}else{if(qs[_0x9601('0x69')](_0x239bfd)){_0x1811f5['or'](_0x9601('0x6a'),_0x239bfd+'%');_0x1811f5['or'](_0x9601('0x6b'),_0x239bfd+'%');_0x1811f5['or'](_0x9601('0x6c'),_0x239bfd+'%');_0x1811f5['or']('c.fax\x20LIKE\x20?',_0x239bfd+'%');}else if(qs[_0x9601('0x6d')](_0x239bfd)){_0x1811f5['or'](_0x9601('0x6e'),_0x239bfd+'%');}else{_0x1811f5['or']('c.firstName\x20LIKE\x20?','%'+_0x239bfd+'%');_0x1811f5['or'](_0x9601('0x6f'),'%'+_0x239bfd+'%');_0x1811f5['or']('c.email\x20LIKE\x20?','%'+_0x239bfd+'%');}}}}_0x515e2d[_0x9601('0x40')](_0x1811f5);_0x515e2d[_0x9601('0x70')](_0x9601('0x71'));var _0x2acaf5={'type':db[_0x9601('0x72')][_0x9601('0x73')][_0x9601('0x74')],'raw':!![]};var _0x5c0212=_0x515e2d[_0x9601('0x75')]()[_0x9601('0x42')](_0x9601('0x71'));if(_0x49cadc[_0x9601('0x76')]){_0x49cadc[_0x9601('0x76')][_0x9601('0x5d')](function(_0xcf0a52){_0x515e2d[_0x9601('0x76')]('c.'+_0xcf0a52[0x0],_0xcf0a52[0x1]===_0x9601('0x77')?![]:!![]);});}if(!_['isEmpty'](_0xb8d66c)){_0x515e2d[_0x9601('0x78')](_0x27901b);_0x5c0212[_0x9601('0x40')]('t.id\x20IN\x20?',_0xb8d66c);}BPromise[_0x9601('0x79')]()[_0x9601('0x29')](function(){if(_0x13e9c8&&!_['some'](_0x13e9c8[_0x9601('0x7a')],[_0x9601('0x42'),_0x9601('0x7b')])){return _0x142289[_0x9601('0x7c')][_0x9601('0x7d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5c596f){if(_[_0x9601('0x7e')](_0x5c596f)){_0x5c0212[_0x9601('0x40')](_0x9601('0x7f'));_0x515e2d[_0x9601('0x40')](_0x9601('0x7f'));}else{_0x5c0212[_0x9601('0x40')](_0x9601('0x5f'),_['map'](_0x5c596f,'id'));_0x515e2d[_0x9601('0x40')](_0x9601('0x5f'),_[_0x9601('0x5a')](_0x5c596f,'id'));}});}else{return;}})[_0x9601('0x29')](function(){db[_0x9601('0x80')][_0x9601('0x3a')](_0x5c0212[_0x9601('0x81')](),_0x2acaf5)[_0x9601('0x29')](function(_0x2a9d7b){_0x3281bd[_0x9601('0x22')]=_0x2a9d7b[_0x9601('0x30')];if(_0x3281bd[_0x9601('0x22')]===0x0)return[];return db[_0x9601('0x80')][_0x9601('0x3a')](_0x338074[_0x9601('0x81')](),_0x2acaf5);})['then'](function(_0x817c97){_0x1a33cb=_['keyBy'](_0x817c97,'id');_0x2acaf5=_[_0x9601('0x82')](_0x2acaf5,{'model':db[_0x9601('0x83')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x142289[_0x9601('0x3a')][_0x9601('0x3e')]){_0x49cadc['attributes']['forEach'](function(_0x3ae2f8){_0x515e2d['field']('c.'+_0x3ae2f8);});}else{_0x515e2d[_0x9601('0x42')](_0x9601('0x71'));_0x515e2d['field'](_0x9601('0x84'));_0x515e2d[_0x9601('0x42')]('c.lastName');_0x515e2d['field'](_0x9601('0x85'));_0x515e2d['field']('c.mobile');_0x515e2d['field'](_0x9601('0x86'));_0x515e2d[_0x9601('0x42')](_0x9601('0x87'));_0x515e2d[_0x9601('0x42')](_0x9601('0x88'));_0x515e2d[_0x9601('0x42')](_0x9601('0x89'));_0x515e2d['field'](_0x9601('0x8a'),_0x9601('0x8b'));}if(_0x49cadc[_0x9601('0x24')])_0x515e2d[_0x9601('0x24')](_0x49cadc[_0x9601('0x24')]);if(_0x49cadc[_0x9601('0x23')])_0x515e2d[_0x9601('0x23')](_0x49cadc['offset']);return db[_0x9601('0x80')][_0x9601('0x3a')](_0x515e2d[_0x9601('0x81')](),_0x2acaf5);})[_0x9601('0x29')](function(_0x2c0060){_0x2c0060[_0x9601('0x5d')](function(_0x1e66d2){if(_0x1e66d2[_0x9601('0x8b')]){_0x1e66d2[_0x9601('0x8c')]=[];_0x1e66d2[_0x9601('0x8b')]['split'](',')[_0x9601('0x5d')](function(_0x213453){_0x1e66d2['Tags'][_0x9601('0x34')](_0x1a33cb[_0x213453]);});}delete _0x1e66d2['TagIds'];});_0x3281bd[_0x9601('0x8d')]=_0x2c0060;return _0x3281bd;})[_0x9601('0x29')](respondWithFilteredResult(_0x46c2df,_0x49cadc));});})[_0x9601('0x8e')](handleError(_0x46c2df,null));};exports[_0x9601('0x2a')]=function(_0x32fa47,_0x4b39d5){return db['CmContact'][_0x9601('0x4d')]({'where':{'id':_0x32fa47['params']['id']}})[_0x9601('0x29')](handleEntityNotFound(_0x4b39d5,null))[_0x9601('0x29')](removeEntity(_0x4b39d5,null))[_0x9601('0x8e')](handleError(_0x4b39d5,null));};exports[_0x9601('0x2f')]=function(_0x54e329,_0x3cee5e){return db[_0x9601('0x83')]['describe']()[_0x9601('0x29')](function(_0x228ef3){delete _0x228ef3['tags'];for(var _0x4c96b5=0x0;_0x4c96b5=_0x13b6fd){_0x14bdec=_0x13b6fd;_0x2fda2e=0xc8;}else{_0x2fda2e=0xce;}_0x466481['status'](_0x2fda2e);return _0x466481[_0x14ec('0x22')](_0x14ec('0x23'),_0x59440c+'-'+_0x14bdec+'/'+_0x13b6fd)['json'](_0x3d3057);}return null;};}function patchUpdates(_0x175311){return function(_0x503b62){try{jsonpatch[_0x14ec('0x24')](_0x503b62,_0x175311,!![]);}catch(_0x474c72){return BPromise[_0x14ec('0x25')](_0x474c72);}return _0x503b62[_0x14ec('0x26')]();};}function saveUpdates(_0x3095cb,_0x3706f7){return function(_0x478a10){if(_0x478a10){return _0x478a10['update'](_0x3095cb)[_0x14ec('0x27')](function(_0x4a74d7){return _0x4a74d7;});}return null;};}function removeEntity(_0xfebcab,_0x177c87){return function(_0x5e79d0){if(_0x5e79d0){return _0x5e79d0[_0x14ec('0x28')]()[_0x14ec('0x27')](function(){_0xfebcab[_0x14ec('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25b6a1,_0x554814){return function(_0x12bcb7){if(!_0x12bcb7){_0x25b6a1[_0x14ec('0x1b')](0x194);}return _0x12bcb7;};}function handleError(_0x2cd8ba,_0x286e82){_0x286e82=_0x286e82||0x1f4;return function(_0x4e3e03){logger[_0x14ec('0x29')](_0x4e3e03[_0x14ec('0x2a')]);if(_0x4e3e03[_0x14ec('0x2b')]){delete _0x4e3e03[_0x14ec('0x2b')];}_0x2cd8ba[_0x14ec('0x1c')](_0x286e82)[_0x14ec('0x2c')](_0x4e3e03);};}exports[_0x14ec('0x2d')]=function(_0x4b9af2,_0x51d4e4){var _0x2bdcf2={},_0xe1225e={},_0x49f3bf={'count':0x0,'rows':[]};return db[_0x14ec('0x2e')][_0x14ec('0x2f')]()[_0x14ec('0x27')](function(_0x43c9e8){var _0x32641e=[];for(var _0x1b7a49=0x0;_0x1b7a490x1){_0x4b843c['or'](_0x14ec('0x6c'),qs[_0x14ec('0x6d')](_0x479ebb),null);}else{if(qs['isNumeric'](_0x479ebb)){_0x4b843c['or'](_0x14ec('0x6e'),_0x479ebb+'%');_0x4b843c['or']('c.phone\x20LIKE\x20?',_0x479ebb+'%');_0x4b843c['or'](_0x14ec('0x6f'),_0x479ebb+'%');_0x4b843c['or'](_0x14ec('0x70'),_0x479ebb+'%');}else if(qs['isEmail'](_0x479ebb)){_0x4b843c['or'](_0x14ec('0x71'),_0x479ebb+'%');}else{_0x4b843c['or'](_0x14ec('0x72'),'%'+_0x479ebb+'%');_0x4b843c['or'](_0x14ec('0x73'),'%'+_0x479ebb+'%');_0x4b843c['or'](_0x14ec('0x71'),'%'+_0x479ebb+'%');}}}}_0x2a9208[_0x14ec('0x44')](_0x4b843c);_0x2a9208[_0x14ec('0x74')](_0x14ec('0x75'));var _0x444605={'type':db[_0x14ec('0x76')][_0x14ec('0x77')][_0x14ec('0x78')],'raw':!![]};var _0x44501e=_0x2a9208[_0x14ec('0x79')]()[_0x14ec('0x46')](_0x14ec('0x75'));if(_0x2bdcf2[_0x14ec('0x7a')]){_0x2bdcf2['order']['forEach'](function(_0x332e1a){_0x2a9208[_0x14ec('0x7a')]('c.'+_0x332e1a[0x0],_0x332e1a[0x1]===_0x14ec('0x7b')?![]:!![]);});}if(!_[_0x14ec('0x64')](_0x523c4b)){_0x2a9208[_0x14ec('0x7c')](_0x1ec292);_0x44501e[_0x14ec('0x44')]('t.id\x20IN\x20?',_0x523c4b);}BPromise[_0x14ec('0x7d')]()['then'](function(){if(_0x1d60d3&&!_[_0x14ec('0x7e')](_0x1d60d3[_0x14ec('0x53')],[_0x14ec('0x46'),_0x14ec('0x5a')])){return _0x4b9af2['user'][_0x14ec('0x7f')]({'attributes':['id'],'raw':!![]})[_0x14ec('0x27')](function(_0x46e20f){if(_[_0x14ec('0x64')](_0x46e20f)){_0x44501e['where'](_0x14ec('0x80'));_0x2a9208['where'](_0x14ec('0x80'));}else{_0x44501e[_0x14ec('0x44')](_0x14ec('0x81'),_[_0x14ec('0x57')](_0x46e20f,'id'));_0x2a9208['where'](_0x14ec('0x81'),_['map'](_0x46e20f,'id'));}});}else{return;}})[_0x14ec('0x27')](function(){db[_0x14ec('0x82')]['query'](_0x44501e['toString'](),_0x444605)['then'](function(_0xda8053){_0x49f3bf[_0x14ec('0x1f')]=_0xda8053[_0x14ec('0x38')];if(_0x49f3bf[_0x14ec('0x1f')]===0x0)return[];return db[_0x14ec('0x82')][_0x14ec('0x3b')](_0x412489[_0x14ec('0x83')](),_0x444605);})[_0x14ec('0x27')](function(_0x5de23c){_0x52f51f=_[_0x14ec('0x84')](_0x5de23c,'id');_0x444605=_[_0x14ec('0x85')](_0x444605,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4b9af2[_0x14ec('0x3b')][_0x14ec('0x40')]){_0x2bdcf2['attributes'][_0x14ec('0x58')](function(_0x5c9afc){_0x2a9208['field']('c.'+_0x5c9afc);});}else{_0x2a9208[_0x14ec('0x46')](_0x14ec('0x75'));_0x2a9208[_0x14ec('0x46')]('c.firstName');_0x2a9208[_0x14ec('0x46')](_0x14ec('0x86'));_0x2a9208[_0x14ec('0x46')](_0x14ec('0x87'));_0x2a9208['field'](_0x14ec('0x88'));_0x2a9208[_0x14ec('0x46')](_0x14ec('0x89'));_0x2a9208[_0x14ec('0x46')]('c.email');_0x2a9208['field'](_0x14ec('0x8a'));_0x2a9208[_0x14ec('0x46')](_0x14ec('0x8b'));_0x2a9208['field'](_0x14ec('0x8c'),_0x14ec('0x8d'));}if(_0x2bdcf2[_0x14ec('0x21')])_0x2a9208[_0x14ec('0x21')](_0x2bdcf2[_0x14ec('0x21')]);if(_0x2bdcf2[_0x14ec('0x20')])_0x2a9208[_0x14ec('0x20')](_0x2bdcf2['offset']);return db['sequelize'][_0x14ec('0x3b')](_0x2a9208['toString'](),_0x444605);})[_0x14ec('0x27')](function(_0x5c10ed){_0x5c10ed['forEach'](function(_0x10f63b){if(_0x10f63b['TagIds']){_0x10f63b['Tags']=[];_0x10f63b[_0x14ec('0x8d')][_0x14ec('0x56')](',')[_0x14ec('0x58')](function(_0x50f153){_0x10f63b[_0x14ec('0x8e')][_0x14ec('0x33')](_0x52f51f[_0x50f153]);});}delete _0x10f63b['TagIds'];});_0x49f3bf[_0x14ec('0x8f')]=_0x5c10ed;return _0x49f3bf;})[_0x14ec('0x27')](respondWithFilteredResult(_0x51d4e4,_0x2bdcf2));});})[_0x14ec('0x90')](handleError(_0x51d4e4,null));};exports[_0x14ec('0x28')]=function(_0x1d2473,_0x13588f){return db['CmContact'][_0x14ec('0x54')]({'where':{'id':_0x1d2473[_0x14ec('0x91')]['id']}})[_0x14ec('0x27')](handleEntityNotFound(_0x13588f,null))['then'](removeEntity(_0x13588f,null))[_0x14ec('0x90')](handleError(_0x13588f,null));};exports[_0x14ec('0x2f')]=function(_0x3aff79,_0x3be1ea){return db['CmContact'][_0x14ec('0x2f')]()[_0x14ec('0x27')](function(_0x2dbe29){delete _0x2dbe29[_0x14ec('0x92')];for(var _0x459d3e=0x0;_0x459d3e{}\s\\|]/g,'-');_0x2aed27(null,util['format'](_0x4f49('0x1e'),path[_0x4f49('0x1f')](_0x416893[_0x4f49('0x1c')],path['extname'](_0x416893[_0x4f49('0x1c')])),Date[_0x4f49('0x20')](),path[_0x4f49('0x21')](_0x416893[_0x4f49('0x1c')])));}})});router[_0x4f49('0x16')](_0x4f49('0x22'),upload['single']('file'),controller[_0x4f49('0x23')]);var upload=multer({'storage':multer[_0x4f49('0x24')]({'destination':function(_0x4fedbb,_0x408552,_0x2c1519){_0x2c1519(null,path[_0x4f49('0x19')](config['root'],_0x4f49('0x1b')));},'filename':function(_0x2eed1c,_0x298785,_0x148153){_0x298785[_0x4f49('0x1c')]=_0x298785[_0x4f49('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x148153(null,util['format'](_0x4f49('0x1e'),path[_0x4f49('0x1f')](_0x298785[_0x4f49('0x1c')],path['extname'](_0x298785[_0x4f49('0x1c')])),Date[_0x4f49('0x20')](),path[_0x4f49('0x21')](_0x298785['originalname'])));}})});router['post'](_0x4f49('0x25'),upload[_0x4f49('0x26')](_0x4f49('0x27')),controller['upload']);router[_0x4f49('0x16')](_0x4f49('0x28'),auth[_0x4f49('0xa')](),controller[_0x4f49('0x29')]);router[_0x4f49('0x2a')](_0x4f49('0xd'),auth[_0x4f49('0xa')](),controller[_0x4f49('0x2b')]);router[_0x4f49('0x2c')](_0x4f49('0xd'),auth[_0x4f49('0xa')](),controller[_0x4f49('0x2d')]);module[_0x4f49('0x2e')]=router; \ No newline at end of file +var _0x032e=['isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','root','originalname','replace','format','basename','extname','now','uploadCsv','join','server/files/tmp','/upload','single','file','upload','/upload/:id','import','put','update','delete','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x032e,0x124));var _0xe032=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x032e[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe032('0x3'));var interaction=require(_0xe032('0x4'));var config=require(_0xe032('0x5'));var controller=require(_0xe032('0x6'));router[_0xe032('0x7')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0x9')]);router[_0xe032('0x7')](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0xb')]);router[_0xe032('0x7')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller[_0xe032('0xd')]);router[_0xe032('0x7')](_0xe032('0xe'),auth[_0xe032('0x8')](),controller['getTags']);router[_0xe032('0x7')](_0xe032('0xf'),auth[_0xe032('0x8')](),controller[_0xe032('0x10')]);router[_0xe032('0x7')](_0xe032('0x11'),auth[_0xe032('0x8')](),controller['getHopperHistories']);router[_0xe032('0x7')](_0xe032('0x12'),auth[_0xe032('0x8')](),controller[_0xe032('0x13')]);router['get'](_0xe032('0x14'),auth[_0xe032('0x8')](),controller[_0xe032('0x15')]);router[_0xe032('0x16')](_0xe032('0x17'),auth[_0xe032('0x8')](),controller[_0xe032('0x18')]);router['post']('/',auth[_0xe032('0x8')](),controller[_0xe032('0x19')]);router[_0xe032('0x16')](_0xe032('0x1a'),auth[_0xe032('0x8')](),controller[_0xe032('0x1b')]);router['post'](_0xe032('0xe'),auth[_0xe032('0x8')](),controller[_0xe032('0x1c')]);var upload=multer({'storage':multer[_0xe032('0x1d')]({'destination':function(_0x208c47,_0x5721ce,_0x4b644b){_0x4b644b(null,path['join'](config[_0xe032('0x1e')],'server/files/tmp'));},'filename':function(_0x46dc27,_0x4608e4,_0x3f0257){_0x4608e4[_0xe032('0x1f')]=_0x4608e4[_0xe032('0x1f')][_0xe032('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3f0257(null,util[_0xe032('0x21')]('%s-%s%s',path[_0xe032('0x22')](_0x4608e4[_0xe032('0x1f')],path[_0xe032('0x23')](_0x4608e4[_0xe032('0x1f')])),Date[_0xe032('0x24')](),path[_0xe032('0x23')](_0x4608e4[_0xe032('0x1f')])));}})});router[_0xe032('0x16')]('/csv',upload['single']('file'),controller[_0xe032('0x25')]);var upload=multer({'storage':multer[_0xe032('0x1d')]({'destination':function(_0x302559,_0x2a56e5,_0x2bfe8f){_0x2bfe8f(null,path[_0xe032('0x26')](config[_0xe032('0x1e')],_0xe032('0x27')));},'filename':function(_0x4dcbf1,_0x1ac20b,_0x5bb36a){_0x1ac20b[_0xe032('0x1f')]=_0x1ac20b[_0xe032('0x1f')][_0xe032('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5bb36a(null,util[_0xe032('0x21')]('%s-%s%s',path['basename'](_0x1ac20b[_0xe032('0x1f')],path[_0xe032('0x23')](_0x1ac20b[_0xe032('0x1f')])),Date[_0xe032('0x24')](),path['extname'](_0x1ac20b['originalname'])));}})});router['post'](_0xe032('0x28'),upload[_0xe032('0x29')](_0xe032('0x2a')),controller[_0xe032('0x2b')]);router['post'](_0xe032('0x2c'),auth[_0xe032('0x8')](),controller[_0xe032('0x2d')]);router[_0xe032('0x2e')](_0xe032('0xc'),auth['isAuthenticated'](),controller[_0xe032('0x2f')]);router[_0xe032('0x30')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller['destroy']);module[_0xe032('0x31')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index e5a8740..018d2d4 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 _0x3806=['sequelize','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','name','STRING','TEXT','long','select','values','isArray','BOOLEAN'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0x3806,0x78));var _0x6380=function(_0x8f0c3,_0x3cdb94){_0x8f0c3=_0x8f0c3-0x0;var _0x17c2ab=_0x3806[_0x8f0c3];return _0x17c2ab;};'use strict';var Sequelize=require(_0x6380('0x0'));var _=require(_0x6380('0x1'));module[_0x6380('0x2')]={'name':{'type':Sequelize[_0x6380('0x3')],'get':function(_0x4a084b){return this[_0x6380('0x4')](_0x6380('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x45e3b5){this[_0x6380('0x6')](_0x6380('0x5'),_0x45e3b5?_0x45e3b5:this[_0x6380('0x4')](_0x6380('0x7')));}},'type':{'type':Sequelize[_0x6380('0x8')],'allowNull':![]},'values':{'type':Sequelize[_0x6380('0x9')](_0x6380('0xa')),'get':function(){if(this[_0x6380('0x4')]('type')===_0x6380('0xb')){return JSON['parse'](this[_0x6380('0x4')](_0x6380('0xc')));}else{return this[_0x6380('0x4')]('values');}},'set':function(_0x38cb3f){if(Array[_0x6380('0xd')](_0x38cb3f)){this[_0x6380('0x6')](_0x6380('0xc'),JSON['stringify'](_0x38cb3f));}else{this[_0x6380('0x6')]('values',_0x38cb3f);}}},'required':{'type':Sequelize[_0x6380('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x88b9=['alias','STRING','long','select','parse','values','isArray','setDataValue','lodash','exports','VIRTUAL','getDataValue'];(function(_0x34b8d5,_0x17a3a0){var _0x2aabf9=function(_0x19ff97){while(--_0x19ff97){_0x34b8d5['push'](_0x34b8d5['shift']());}};_0x2aabf9(++_0x17a3a0);}(_0x88b9,0x14c));var _0x988b=function(_0x490e45,_0x218fb5){_0x490e45=_0x490e45-0x0;var _0x1ccc2f=_0x88b9[_0x490e45];return _0x1ccc2f;};'use strict';var Sequelize=require('sequelize');var _=require(_0x988b('0x0'));module[_0x988b('0x1')]={'name':{'type':Sequelize[_0x988b('0x2')],'get':function(_0x3fb2be){return this[_0x988b('0x3')](_0x988b('0x4'));}},'alias':{'type':Sequelize[_0x988b('0x5')],'allowNull':![],'set':function(_0x36a772){this['setDataValue'](_0x988b('0x4'),_0x36a772?_0x36a772:this['getDataValue']('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x988b('0x6')),'get':function(){if(this[_0x988b('0x3')]('type')===_0x988b('0x7')){return JSON[_0x988b('0x8')](this['getDataValue'](_0x988b('0x9')));}else{return this[_0x988b('0x3')]('values');}},'set':function(_0x1e4b06){if(Array[_0x988b('0xa')](_0x1e4b06)){this['setDataValue'](_0x988b('0x9'),JSON['stringify'](_0x1e4b06));}else{this[_0x988b('0xb')](_0x988b('0x9'),_0x1e4b06);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 1b479ba..8657343 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 _0xa0b2=['INTEGER','Sequelize','BOOLEAN','defaultValue','sequelize','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','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','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','find','body','create','transaction','TEXT','number'];(function(_0x3e3b04,_0x5ebfb9){var _0x25e933=function(_0x5190ec){while(--_0x5190ec){_0x3e3b04['push'](_0x3e3b04['shift']());}};_0x25e933(++_0x5ebfb9);}(_0xa0b2,0x10a));var _0x2a0b=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xa0b2[_0xaa1b3e];return _0x454d7d;};'use strict';var pdf=require(_0x2a0b('0x0'));var emlformat=require(_0x2a0b('0x1'));var rimraf=require(_0x2a0b('0x2'));var zipdir=require(_0x2a0b('0x3'));var jsonpatch=require(_0x2a0b('0x4'));var rp=require(_0x2a0b('0x5'));var moment=require('moment');var BPromise=require(_0x2a0b('0x6'));var Mustache=require(_0x2a0b('0x7'));var util=require(_0x2a0b('0x8'));var path=require(_0x2a0b('0x9'));var sox=require('sox');var csv=require(_0x2a0b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2a0b('0xb'));var squel=require('squel');var crypto=require(_0x2a0b('0xc'));var jsforce=require(_0x2a0b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a0b('0xa'));var querystring=require(_0x2a0b('0xe'));var Papa=require(_0x2a0b('0xf'));var Redis=require(_0x2a0b('0x10'));var authService=require(_0x2a0b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2a0b('0x12'));var hardwareService=require(_0x2a0b('0x13'));var logger=require(_0x2a0b('0x14'))(_0x2a0b('0x15'));var utils=require(_0x2a0b('0x16'));var config=require(_0x2a0b('0x17'));var db=require(_0x2a0b('0x18'))['db'];function respondWithStatusCode(_0x15a6c9,_0x5776d2){_0x5776d2=_0x5776d2||0xcc;return function(_0x557ea1){if(_0x557ea1){return _0x15a6c9[_0x2a0b('0x19')](_0x5776d2);}return _0x15a6c9[_0x2a0b('0x1a')](_0x5776d2)[_0x2a0b('0x1b')]();};}function respondWithResult(_0x4fa52b,_0x1588fa){_0x1588fa=_0x1588fa||0xc8;return function(_0x6e762){if(_0x6e762){return _0x4fa52b[_0x2a0b('0x1a')](_0x1588fa)[_0x2a0b('0x1c')](_0x6e762);}};}function respondWithFilteredResult(_0x119752,_0x423b98){return function(_0x2f4ac8){if(_0x2f4ac8){var _0x35bbbf=_0x2f4ac8['count'],_0x320ea8=_0x423b98['offset'],_0x835f96=_0x423b98[_0x2a0b('0x1d')]+_0x423b98[_0x2a0b('0x1e')],_0x4fcd9c;if(_0x835f96>=_0x35bbbf){_0x835f96=_0x35bbbf;_0x4fcd9c=0xc8;}else{_0x4fcd9c=0xce;}_0x119752[_0x2a0b('0x1a')](_0x4fcd9c);return _0x119752[_0x2a0b('0x1f')](_0x2a0b('0x20'),_0x320ea8+'-'+_0x835f96+'/'+_0x35bbbf)[_0x2a0b('0x1c')](_0x2f4ac8);}return null;};}function patchUpdates(_0xd88dba){return function(_0x596e3a){try{jsonpatch[_0x2a0b('0x21')](_0x596e3a,_0xd88dba,!![]);}catch(_0x52fcec){return BPromise[_0x2a0b('0x22')](_0x52fcec);}return _0x596e3a[_0x2a0b('0x23')]();};}function saveUpdates(_0x3eedc0,_0x33ba21){return function(_0x34b25d){if(_0x34b25d){return _0x34b25d[_0x2a0b('0x24')](_0x3eedc0)[_0x2a0b('0x25')](function(_0x3814f0){return _0x3814f0;});}return null;};}function removeEntity(_0x4cd9ce,_0x2d1927){return function(_0x54e7c9){if(_0x54e7c9){return _0x54e7c9[_0x2a0b('0x26')]()['then'](function(){_0x4cd9ce[_0x2a0b('0x1a')](0xcc)[_0x2a0b('0x1b')]();});}};}function handleEntityNotFound(_0x8b4fb2,_0x21f274){return function(_0x26a460){if(!_0x26a460){_0x8b4fb2[_0x2a0b('0x19')](0x194);}return _0x26a460;};}function handleError(_0x278a88,_0x57cf8d){_0x57cf8d=_0x57cf8d||0x1f4;return function(_0xc53a8){logger[_0x2a0b('0x27')](_0xc53a8['stack']);if(_0xc53a8['name']){delete _0xc53a8[_0x2a0b('0x28')];}_0x278a88[_0x2a0b('0x1a')](_0x57cf8d)[_0x2a0b('0x29')](_0xc53a8);};}exports[_0x2a0b('0x2a')]=function(_0x53b984,_0x1a57cf){var _0x194bdc={},_0x2112ef={},_0x2fbe4b={'count':0x0,'rows':[]};var _0x17f189=_[_0x2a0b('0x2b')](db[_0x2a0b('0x2c')][_0x2a0b('0x2d')],function(_0xe44b0){return{'name':_0xe44b0[_0x2a0b('0x2e')],'type':_0xe44b0['type'][_0x2a0b('0x2f')]};});_0x2112ef[_0x2a0b('0x30')]=_['differenceBy'](_[_0x2a0b('0x2b')](_0x17f189,'name'),[_0x2a0b('0x28')]);_0x2112ef[_0x2a0b('0x31')]=_[_0x2a0b('0x32')](_0x53b984[_0x2a0b('0x31')]);_0x2112ef[_0x2a0b('0x33')]=_[_0x2a0b('0x34')](_0x2112ef[_0x2a0b('0x30')],_0x2112ef[_0x2a0b('0x31')]);_0x194bdc[_0x2a0b('0x35')]=_['intersection'](_0x2112ef[_0x2a0b('0x30')],qs[_0x2a0b('0x36')](_0x53b984['query'][_0x2a0b('0x36')]));_0x194bdc[_0x2a0b('0x35')]=_0x194bdc[_0x2a0b('0x35')][_0x2a0b('0x37')]?_0x194bdc[_0x2a0b('0x35')]:_0x2112ef[_0x2a0b('0x30')];if(!_0x53b984[_0x2a0b('0x31')][_0x2a0b('0x38')](_0x2a0b('0x39'))){_0x194bdc[_0x2a0b('0x1e')]=qs[_0x2a0b('0x1e')](_0x53b984[_0x2a0b('0x31')][_0x2a0b('0x1e')]);_0x194bdc[_0x2a0b('0x1d')]=qs[_0x2a0b('0x1d')](_0x53b984['query'][_0x2a0b('0x1d')]);}_0x194bdc['order']=qs[_0x2a0b('0x3a')](_0x53b984[_0x2a0b('0x31')][_0x2a0b('0x3a')]);_0x194bdc[_0x2a0b('0x3b')]=qs[_0x2a0b('0x33')](_['pick'](_0x53b984[_0x2a0b('0x31')],_0x2112ef[_0x2a0b('0x33')]));if(_0x53b984[_0x2a0b('0x31')][_0x2a0b('0x3c')]){_0x194bdc['where']=_[_0x2a0b('0x3d')](_0x194bdc[_0x2a0b('0x3b')],{'$or':_[_0x2a0b('0x2b')](_0x17f189,function(_0x49320b){if(_0x49320b[_0x2a0b('0x3e')]!==_0x2a0b('0x3f')){var _0x4b382f={};_0x4b382f[_0x49320b[_0x2a0b('0x28')]]={'$like':'%'+_0x53b984[_0x2a0b('0x31')][_0x2a0b('0x3c')]+'%'};return _0x4b382f;}})});}_0x194bdc=_[_0x2a0b('0x3d')]({},_0x194bdc,_0x53b984[_0x2a0b('0x40')]);var _0x2648e7={'where':_0x194bdc[_0x2a0b('0x3b')]};return db[_0x2a0b('0x2c')]['count'](_0x2648e7)['then'](function(_0x553ded){_0x2fbe4b[_0x2a0b('0x41')]=_0x553ded;if(_0x53b984[_0x2a0b('0x31')][_0x2a0b('0x42')]){_0x194bdc[_0x2a0b('0x43')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x194bdc);})['then'](function(_0x43b647){_0x2fbe4b[_0x2a0b('0x44')]=_0x43b647;return _0x2fbe4b;})['then'](respondWithFilteredResult(_0x1a57cf,_0x194bdc))[_0x2a0b('0x45')](handleError(_0x1a57cf,null));};exports[_0x2a0b('0x46')]=function(_0x29f84b,_0x5343d2){var _0x5c1d11={'raw':!![],'where':{'id':_0x29f84b[_0x2a0b('0x47')]['id']}},_0x52eed8={};_0x52eed8[_0x2a0b('0x30')]=_[_0x2a0b('0x32')](db[_0x2a0b('0x2c')]['rawAttributes']);_0x52eed8[_0x2a0b('0x31')]=_[_0x2a0b('0x32')](_0x29f84b[_0x2a0b('0x31')]);_0x52eed8[_0x2a0b('0x33')]=_['intersection'](_0x52eed8[_0x2a0b('0x30')],_0x52eed8[_0x2a0b('0x31')]);_0x5c1d11[_0x2a0b('0x35')]=_[_0x2a0b('0x34')](_0x52eed8[_0x2a0b('0x30')],qs[_0x2a0b('0x36')](_0x29f84b['query'][_0x2a0b('0x36')]));_0x5c1d11['attributes']=_0x5c1d11[_0x2a0b('0x35')][_0x2a0b('0x37')]?_0x5c1d11[_0x2a0b('0x35')]:_0x52eed8[_0x2a0b('0x30')];if(_0x29f84b[_0x2a0b('0x31')][_0x2a0b('0x42')]){_0x5c1d11['include']=[{'all':!![]}];}_0x5c1d11=_['merge']({},_0x5c1d11,_0x29f84b[_0x2a0b('0x40')]);return db[_0x2a0b('0x2c')][_0x2a0b('0x48')](_0x5c1d11)[_0x2a0b('0x25')](handleEntityNotFound(_0x5343d2,null))[_0x2a0b('0x25')](respondWithResult(_0x5343d2,null))[_0x2a0b('0x45')](handleError(_0x5343d2,null));};exports[_0x2a0b('0x24')]=function(_0x1815e9,_0xe09f33){if(_0x1815e9[_0x2a0b('0x49')]['id']){delete _0x1815e9[_0x2a0b('0x49')]['id'];}return db[_0x2a0b('0x2c')][_0x2a0b('0x48')]({'where':{'id':_0x1815e9['params']['id']}})['then'](handleEntityNotFound(_0xe09f33,null))['then'](saveUpdates(_0x1815e9[_0x2a0b('0x49')],null))[_0x2a0b('0x25')](respondWithResult(_0xe09f33,null))['catch'](handleError(_0xe09f33,null));};exports[_0x2a0b('0x26')]=function(_0x386125,_0x11114a){return db[_0x2a0b('0x2c')][_0x2a0b('0x48')]({'where':{'id':_0x386125['params']['id']}})[_0x2a0b('0x25')](handleEntityNotFound(_0x11114a,null))[_0x2a0b('0x25')](removeEntity(_0x11114a,null))[_0x2a0b('0x45')](handleError(_0x11114a,null));};exports[_0x2a0b('0x4a')]=function(_0x16c882,_0x248455){var _0x4fb2b4;return db['sequelize'][_0x2a0b('0x4b')](function(_0x70ca6e){return db[_0x2a0b('0x2c')]['create'](_0x16c882[_0x2a0b('0x49')],{'transaction':_0x70ca6e})[_0x2a0b('0x25')](function(_0x44f08f){_0x4fb2b4=_0x44f08f;var _0x1dbcc5={'type':db['Sequelize'][_0x2a0b('0x4c')],'transaction':_0x70ca6e};switch(_0x16c882['body'][_0x2a0b('0x3e')]){case'text':_0x1dbcc5['type']=db['Sequelize'][_0x2a0b('0x4c')];break;case _0x2a0b('0x4d'):_0x1dbcc5['type']=db['Sequelize'][_0x2a0b('0x4e')];break;case'switch':_0x1dbcc5[_0x2a0b('0x3e')]=db[_0x2a0b('0x4f')][_0x2a0b('0x50')];_0x1dbcc5[_0x2a0b('0x51')]=![];break;default:}return db[_0x2a0b('0x52')]['queryInterface']['addColumn'](_0x2a0b('0x53'),util[_0x2a0b('0x54')](_0x2a0b('0x55'),_0x4fb2b4['id']),_0x1dbcc5);})['then'](function(){return _0x4fb2b4;});})['then'](respondWithResult(_0x248455,0xc9))[_0x2a0b('0x45')](handleError(_0x248455,null));}; \ No newline at end of file +var _0x0bbf=['reject','save','update','destroy','then','error','stack','name','send','map','CmCustomField','fieldName','type','key','differenceBy','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','find','body','create','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','count','offset','limit','Content-Range','apply'];(function(_0x32bd37,_0x3d739d){var _0x231759=function(_0x317743){while(--_0x317743){_0x32bd37['push'](_0x32bd37['shift']());}};_0x231759(++_0x3d739d);}(_0x0bbf,0x18d));var _0xf0bb=function(_0x4a5fa5,_0x51dadc){_0x4a5fa5=_0x4a5fa5-0x0;var _0x241266=_0x0bbf[_0x4a5fa5];return _0x241266;};'use strict';var pdf=require(_0xf0bb('0x0'));var emlformat=require(_0xf0bb('0x1'));var rimraf=require(_0xf0bb('0x2'));var zipdir=require(_0xf0bb('0x3'));var jsonpatch=require(_0xf0bb('0x4'));var rp=require('request-promise');var moment=require(_0xf0bb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf0bb('0x6'));var util=require(_0xf0bb('0x7'));var path=require(_0xf0bb('0x8'));var sox=require('sox');var csv=require(_0xf0bb('0x9'));var ejs=require(_0xf0bb('0xa'));var fs=require('fs');var _=require(_0xf0bb('0xb'));var squel=require(_0xf0bb('0xc'));var crypto=require('crypto');var jsforce=require(_0xf0bb('0xd'));var deskjs=require(_0xf0bb('0xe'));var toCsv=require(_0xf0bb('0x9'));var querystring=require(_0xf0bb('0xf'));var Papa=require(_0xf0bb('0x10'));var Redis=require(_0xf0bb('0x11'));var authService=require(_0xf0bb('0x12'));var qs=require(_0xf0bb('0x13'));var as=require(_0xf0bb('0x14'));var hardwareService=require(_0xf0bb('0x15'));var logger=require(_0xf0bb('0x16'))(_0xf0bb('0x17'));var utils=require('../../config/utils');var config=require(_0xf0bb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19f9cf,_0x5a14b9){_0x5a14b9=_0x5a14b9||0xcc;return function(_0x56fd63){if(_0x56fd63){return _0x19f9cf[_0xf0bb('0x19')](_0x5a14b9);}return _0x19f9cf['status'](_0x5a14b9)[_0xf0bb('0x1a')]();};}function respondWithResult(_0x47cbb6,_0x1f0138){_0x1f0138=_0x1f0138||0xc8;return function(_0xa767e7){if(_0xa767e7){return _0x47cbb6[_0xf0bb('0x1b')](_0x1f0138)['json'](_0xa767e7);}};}function respondWithFilteredResult(_0x191471,_0x5e97ba){return function(_0x45445e){if(_0x45445e){var _0x2f9edc=_0x45445e[_0xf0bb('0x1c')],_0x2ec7d2=_0x5e97ba[_0xf0bb('0x1d')],_0x57f1f8=_0x5e97ba[_0xf0bb('0x1d')]+_0x5e97ba[_0xf0bb('0x1e')],_0x342926;if(_0x57f1f8>=_0x2f9edc){_0x57f1f8=_0x2f9edc;_0x342926=0xc8;}else{_0x342926=0xce;}_0x191471[_0xf0bb('0x1b')](_0x342926);return _0x191471['set'](_0xf0bb('0x1f'),_0x2ec7d2+'-'+_0x57f1f8+'/'+_0x2f9edc)['json'](_0x45445e);}return null;};}function patchUpdates(_0x1e0e16){return function(_0x53c78b){try{jsonpatch[_0xf0bb('0x20')](_0x53c78b,_0x1e0e16,!![]);}catch(_0x270f55){return BPromise[_0xf0bb('0x21')](_0x270f55);}return _0x53c78b[_0xf0bb('0x22')]();};}function saveUpdates(_0x429656,_0x4651ae){return function(_0x548dd6){if(_0x548dd6){return _0x548dd6[_0xf0bb('0x23')](_0x429656)['then'](function(_0x59b644){return _0x59b644;});}return null;};}function removeEntity(_0x109876,_0x1b80c5){return function(_0x1be618){if(_0x1be618){return _0x1be618[_0xf0bb('0x24')]()[_0xf0bb('0x25')](function(){_0x109876[_0xf0bb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ebe5e,_0x497faa){return function(_0x38fb50){if(!_0x38fb50){_0x1ebe5e[_0xf0bb('0x19')](0x194);}return _0x38fb50;};}function handleError(_0x1a7b0a,_0x49f0b6){_0x49f0b6=_0x49f0b6||0x1f4;return function(_0x24845e){logger[_0xf0bb('0x26')](_0x24845e[_0xf0bb('0x27')]);if(_0x24845e[_0xf0bb('0x28')]){delete _0x24845e[_0xf0bb('0x28')];}_0x1a7b0a['status'](_0x49f0b6)[_0xf0bb('0x29')](_0x24845e);};}exports['index']=function(_0x5d56ef,_0x528747){var _0x264869={},_0x32c488={},_0x55fa24={'count':0x0,'rows':[]};var _0x44e34e=_[_0xf0bb('0x2a')](db[_0xf0bb('0x2b')]['rawAttributes'],function(_0x142b8c){return{'name':_0x142b8c[_0xf0bb('0x2c')],'type':_0x142b8c[_0xf0bb('0x2d')][_0xf0bb('0x2e')]};});_0x32c488['model']=_[_0xf0bb('0x2f')](_['map'](_0x44e34e,_0xf0bb('0x28')),[_0xf0bb('0x28')]);_0x32c488['query']=_[_0xf0bb('0x30')](_0x5d56ef[_0xf0bb('0x31')]);_0x32c488[_0xf0bb('0x32')]=_[_0xf0bb('0x33')](_0x32c488[_0xf0bb('0x34')],_0x32c488[_0xf0bb('0x31')]);_0x264869['attributes']=_[_0xf0bb('0x33')](_0x32c488[_0xf0bb('0x34')],qs[_0xf0bb('0x35')](_0x5d56ef[_0xf0bb('0x31')]['fields']));_0x264869[_0xf0bb('0x36')]=_0x264869[_0xf0bb('0x36')][_0xf0bb('0x37')]?_0x264869['attributes']:_0x32c488[_0xf0bb('0x34')];if(!_0x5d56ef[_0xf0bb('0x31')][_0xf0bb('0x38')](_0xf0bb('0x39'))){_0x264869[_0xf0bb('0x1e')]=qs[_0xf0bb('0x1e')](_0x5d56ef[_0xf0bb('0x31')][_0xf0bb('0x1e')]);_0x264869[_0xf0bb('0x1d')]=qs[_0xf0bb('0x1d')](_0x5d56ef[_0xf0bb('0x31')][_0xf0bb('0x1d')]);}_0x264869[_0xf0bb('0x3a')]=qs[_0xf0bb('0x3b')](_0x5d56ef['query'][_0xf0bb('0x3b')]);_0x264869[_0xf0bb('0x3c')]=qs[_0xf0bb('0x32')](_[_0xf0bb('0x3d')](_0x5d56ef[_0xf0bb('0x31')],_0x32c488[_0xf0bb('0x32')]));if(_0x5d56ef[_0xf0bb('0x31')]['filter']){_0x264869['where']=_[_0xf0bb('0x3e')](_0x264869[_0xf0bb('0x3c')],{'$or':_[_0xf0bb('0x2a')](_0x44e34e,function(_0x34e16d){if(_0x34e16d[_0xf0bb('0x2d')]!=='VIRTUAL'){var _0x3ba884={};_0x3ba884[_0x34e16d[_0xf0bb('0x28')]]={'$like':'%'+_0x5d56ef[_0xf0bb('0x31')][_0xf0bb('0x3f')]+'%'};return _0x3ba884;}})});}_0x264869=_[_0xf0bb('0x3e')]({},_0x264869,_0x5d56ef[_0xf0bb('0x40')]);var _0x4df5f3={'where':_0x264869[_0xf0bb('0x3c')]};return db[_0xf0bb('0x2b')]['count'](_0x4df5f3)['then'](function(_0x5632e8){_0x55fa24[_0xf0bb('0x1c')]=_0x5632e8;if(_0x5d56ef[_0xf0bb('0x31')][_0xf0bb('0x41')]){_0x264869[_0xf0bb('0x42')]=[{'all':!![]}];}return db[_0xf0bb('0x2b')][_0xf0bb('0x43')](_0x264869);})[_0xf0bb('0x25')](function(_0x228dd0){_0x55fa24['rows']=_0x228dd0;return _0x55fa24;})['then'](respondWithFilteredResult(_0x528747,_0x264869))[_0xf0bb('0x44')](handleError(_0x528747,null));};exports[_0xf0bb('0x45')]=function(_0x57d6b6,_0x18d93d){var _0x37d156={'raw':!![],'where':{'id':_0x57d6b6['params']['id']}},_0x45cb6b={};_0x45cb6b[_0xf0bb('0x34')]=_[_0xf0bb('0x30')](db[_0xf0bb('0x2b')]['rawAttributes']);_0x45cb6b[_0xf0bb('0x31')]=_[_0xf0bb('0x30')](_0x57d6b6[_0xf0bb('0x31')]);_0x45cb6b[_0xf0bb('0x32')]=_[_0xf0bb('0x33')](_0x45cb6b[_0xf0bb('0x34')],_0x45cb6b[_0xf0bb('0x31')]);_0x37d156[_0xf0bb('0x36')]=_[_0xf0bb('0x33')](_0x45cb6b[_0xf0bb('0x34')],qs[_0xf0bb('0x35')](_0x57d6b6[_0xf0bb('0x31')][_0xf0bb('0x35')]));_0x37d156[_0xf0bb('0x36')]=_0x37d156[_0xf0bb('0x36')][_0xf0bb('0x37')]?_0x37d156[_0xf0bb('0x36')]:_0x45cb6b[_0xf0bb('0x34')];if(_0x57d6b6[_0xf0bb('0x31')][_0xf0bb('0x41')]){_0x37d156[_0xf0bb('0x42')]=[{'all':!![]}];}_0x37d156=_[_0xf0bb('0x3e')]({},_0x37d156,_0x57d6b6[_0xf0bb('0x40')]);return db[_0xf0bb('0x2b')][_0xf0bb('0x46')](_0x37d156)['then'](handleEntityNotFound(_0x18d93d,null))[_0xf0bb('0x25')](respondWithResult(_0x18d93d,null))[_0xf0bb('0x44')](handleError(_0x18d93d,null));};exports[_0xf0bb('0x23')]=function(_0x1fa063,_0x5eee70){if(_0x1fa063[_0xf0bb('0x47')]['id']){delete _0x1fa063[_0xf0bb('0x47')]['id'];}return db[_0xf0bb('0x2b')][_0xf0bb('0x46')]({'where':{'id':_0x1fa063['params']['id']}})[_0xf0bb('0x25')](handleEntityNotFound(_0x5eee70,null))[_0xf0bb('0x25')](saveUpdates(_0x1fa063[_0xf0bb('0x47')],null))[_0xf0bb('0x25')](respondWithResult(_0x5eee70,null))[_0xf0bb('0x44')](handleError(_0x5eee70,null));};exports[_0xf0bb('0x24')]=function(_0x47e0ee,_0x58f0c8){return db['CmCustomField'][_0xf0bb('0x46')]({'where':{'id':_0x47e0ee['params']['id']}})[_0xf0bb('0x25')](handleEntityNotFound(_0x58f0c8,null))[_0xf0bb('0x25')](removeEntity(_0x58f0c8,null))[_0xf0bb('0x44')](handleError(_0x58f0c8,null));};exports[_0xf0bb('0x48')]=function(_0x457dc9,_0x2b5d92){var _0x371d1c;return db['sequelize'][_0xf0bb('0x49')](function(_0x1ef202){return db[_0xf0bb('0x2b')][_0xf0bb('0x48')](_0x457dc9[_0xf0bb('0x47')],{'transaction':_0x1ef202})['then'](function(_0x3b7c13){_0x371d1c=_0x3b7c13;var _0x2fcb29={'type':db[_0xf0bb('0x4a')][_0xf0bb('0x4b')],'transaction':_0x1ef202};switch(_0x457dc9[_0xf0bb('0x47')][_0xf0bb('0x2d')]){case _0xf0bb('0x4c'):_0x2fcb29['type']=db[_0xf0bb('0x4a')]['TEXT'];break;case _0xf0bb('0x4d'):_0x2fcb29[_0xf0bb('0x2d')]=db['Sequelize'][_0xf0bb('0x4e')];break;case _0xf0bb('0x4f'):_0x2fcb29['type']=db['Sequelize'][_0xf0bb('0x50')];_0x2fcb29[_0xf0bb('0x51')]=![];break;default:}return db[_0xf0bb('0x52')][_0xf0bb('0x53')][_0xf0bb('0x54')]('cm_contacts',util[_0xf0bb('0x55')]('cf_%d',_0x371d1c['id']),_0x2fcb29);})['then'](function(){return _0x371d1c;});})['then'](respondWithResult(_0x2b5d92,0xc9))[_0xf0bb('0x44')](handleError(_0x2b5d92,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 555f8b7..656e960 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 _0x5089=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields'];(function(_0x5b5c3a,_0x40eeb3){var _0x5c9af1=function(_0x3fa192){while(--_0x3fa192){_0x5b5c3a['push'](_0x5b5c3a['shift']());}};_0x5c9af1(++_0x40eeb3);}(_0x5089,0x8f));var _0x9508=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0x5089[_0x2f6f50];return _0x2cf365;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9508('0x0'))(_0x9508('0x1'));var moment=require(_0x9508('0x2'));var BPromise=require(_0x9508('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9508('0x4'));var rimraf=require(_0x9508('0x5'));var config=require(_0x9508('0x6'));var attributes=require(_0x9508('0x7'));module[_0x9508('0x8')]=function(_0x2c81a6,_0x2b57e9){return _0x2c81a6[_0x9508('0x9')]('CmCustomField',attributes,{'tableName':_0x9508('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefc3=['cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define','CmCustomField'];(function(_0x2044ba,_0x1ebab8){var _0x2fa276=function(_0x20f79c){while(--_0x20f79c){_0x2044ba['push'](_0x2044ba['shift']());}};_0x2fa276(++_0x1ebab8);}(_0xefc3,0xa9));var _0x3efc=function(_0x3a76b0,_0x25fc17){_0x3a76b0=_0x3a76b0-0x0;var _0x242312=_0xefc3[_0x3a76b0];return _0x242312;};'use strict';var _=require(_0x3efc('0x0'));var util=require(_0x3efc('0x1'));var logger=require(_0x3efc('0x2'))(_0x3efc('0x3'));var moment=require(_0x3efc('0x4'));var BPromise=require(_0x3efc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3efc('0x6'));var rimraf=require(_0x3efc('0x7'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x3efc('0x8')]=function(_0x3def2a,_0x5a6982){return _0x3def2a[_0x3efc('0x9')](_0x3efc('0xa'),attributes,{'tableName':_0x3efc('0xb'),'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 17b1de6..8679e6c 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 _0xe5b3=['request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmCustomField,\x20%s,\x20%s'];(function(_0x37870d,_0x356e02){var _0x1ae695=function(_0x508f6c){while(--_0x508f6c){_0x37870d['push'](_0x37870d['shift']());}};_0x1ae695(++_0x356e02);}(_0xe5b3,0x133));var _0x3e5b=function(_0x1329bd,_0x1d2c7c){_0x1329bd=_0x1329bd-0x0;var _0x485d69=_0xe5b3[_0x1329bd];return _0x485d69;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('CmCustomField,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('CmCustomField,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});} \ No newline at end of file +var _0x6f0d=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent'];(function(_0x30a32c,_0x574e7b){var _0x286057=function(_0x16253a){while(--_0x16253a){_0x30a32c['push'](_0x30a32c['shift']());}};_0x286057(++_0x574e7b);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x44689f,_0x1fb85f){_0x44689f=_0x44689f-0x0;var _0x5379fd=_0x6f0d[_0x44689f];return _0x5379fd;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('CmCustomField,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index b107c9b..0b81b38 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 _0x4af8=['get','index','isAuthenticated','show','create','put','delete','/:id','destroy','express','Router','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller'];(function(_0x146580,_0x4dccee){var _0x55a09b=function(_0x18ed30){while(--_0x18ed30){_0x146580['push'](_0x146580['shift']());}};_0x55a09b(++_0x4dccee);}(_0x4af8,0x1ad));var _0x84af=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x4af8[_0x4baae2];return _0x1a2285;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x84af('0x0'));var router=express[_0x84af('0x1')]();var auth=require(_0x84af('0x2'));var interaction=require(_0x84af('0x3'));var config=require('../../config/environment');var controller=require(_0x84af('0x4'));router[_0x84af('0x5')]('/',auth['isAuthenticated'](),controller[_0x84af('0x6')]);router[_0x84af('0x5')]('/:id',auth[_0x84af('0x7')](),controller[_0x84af('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x84af('0x9')]);router[_0x84af('0xa')]('/:id',auth[_0x84af('0x7')](),controller['update']);router[_0x84af('0xb')](_0x84af('0xc'),auth[_0x84af('0x7')](),controller[_0x84af('0xd')]);module['exports']=router; \ No newline at end of file +var _0x258e=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports'];(function(_0xcc2c66,_0x27cf7b){var _0x2197b2=function(_0xacbaeb){while(--_0xacbaeb){_0xcc2c66['push'](_0xcc2c66['shift']());}};_0x2197b2(++_0x27cf7b);}(_0x258e,0x168));var _0xe258=function(_0x23e684,_0x1716e3){_0x23e684=_0x23e684-0x0;var _0x4db831=_0x258e[_0x23e684];return _0x4db831;};'use strict';var multer=require('multer');var util=require(_0xe258('0x0'));var path=require(_0xe258('0x1'));var timeout=require(_0xe258('0x2'));var express=require(_0xe258('0x3'));var router=express['Router']();var auth=require(_0xe258('0x4'));var interaction=require(_0xe258('0x5'));var config=require(_0xe258('0x6'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0xe258('0x7')](),controller[_0xe258('0x8')]);router[_0xe258('0x9')](_0xe258('0xa'),auth[_0xe258('0x7')](),controller['show']);router[_0xe258('0xb')]('/',auth['isAuthenticated'](),controller[_0xe258('0xc')]);router[_0xe258('0xd')](_0xe258('0xa'),auth[_0xe258('0x7')](),controller[_0xe258('0xe')]);router[_0xe258('0xf')](_0xe258('0xa'),auth[_0xe258('0x7')](),controller[_0xe258('0x10')]);module[_0xe258('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 39fde47..ec5d706 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 _0x826a=['BOOLEAN','UNSIGNED','contactListQueue','sequelize','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x1fffa4,_0x12c36a){var _0x1b009d=function(_0x2f6ae2){while(--_0x2f6ae2){_0x1fffa4['push'](_0x1fffa4['shift']());}};_0x1b009d(++_0x12c36a);}(_0x826a,0x1aa));var _0xa826=function(_0x534900,_0x392380){_0x534900=_0x534900-0x0;var _0x49c3af=_0x826a[_0x534900];return _0x49c3af;};'use strict';var moment=require('moment');var Sequelize=require(_0xa826('0x0'));module['exports']={'phone':{'type':Sequelize[_0xa826('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa826('0x2')],'defaultValue':moment()[_0xa826('0x3')](_0xa826('0x4'))},'countbusyretry':{'type':Sequelize[_0xa826('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa826('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa826('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa826('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa826('0x2')]},'priority':{'type':Sequelize[_0xa826('0x5')](0x2)[_0xa826('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa826('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa826('0x5')],'unique':_0xa826('0x8')},'ListId':{'type':Sequelize[_0xa826('0x5')],'unique':_0xa826('0x8')},'UserId':{'type':Sequelize[_0xa826('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xa826('0x5')],'unique':_0xa826('0x8')},'CampaignId':{'type':Sequelize[_0xa826('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xa826('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa826('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa826('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2bd8=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','exports','STRING','BOOLEAN','DATE','format'];(function(_0x38f37e,_0x45aebc){var _0x10a423=function(_0x4f3ad6){while(--_0x4f3ad6){_0x38f37e['push'](_0x38f37e['shift']());}};_0x10a423(++_0x45aebc);}(_0x2bd8,0x130));var _0x82bd=function(_0x3e12c3,_0x48dd3f){_0x3e12c3=_0x3e12c3-0x0;var _0x2d6284=_0x2bd8[_0x3e12c3];return _0x2d6284;};'use strict';var moment=require(_0x82bd('0x0'));var Sequelize=require('sequelize');module[_0x82bd('0x1')]={'phone':{'type':Sequelize[_0x82bd('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x82bd('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x82bd('0x4')],'defaultValue':moment()[_0x82bd('0x5')](_0x82bd('0x6'))},'countbusyretry':{'type':Sequelize[_0x82bd('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x82bd('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x82bd('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x82bd('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x82bd('0x7')](0x2)[_0x82bd('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x82bd('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x82bd('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x82bd('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x82bd('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x82bd('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x82bd('0x7')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index c6a1c37..d6c8bb8 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 _0x323d=['user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','ContactId','lastName','isNil','calleridname','CmHopperFinal','CmContact','getVoiceQueues','outbound','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','priority','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','hopperIds','scheduledAt','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','List','Queue','getOpenContacts','preview','count','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','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','apply','save','update','then','destroy','stack','name','send','index','map','CmHopper','rawAttributes','type','key','query','keys','filters','intersection','concat','$and','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$contains','$contained','fields','attributes','length','model','hasOwnProperty','order','sort','pick','where','merge','filter','options','include','findAll','catch','show','find','create','body','params','describe','VoiceQueueId','VoiceQueue','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x323d,0x1d6));var _0xd323=function(_0x3d86f5,_0x257914){_0x3d86f5=_0x3d86f5-0x0;var _0x2d6881=_0x323d[_0x3d86f5];return _0x2d6881;};'use strict';var pdf=require(_0xd323('0x0'));var emlformat=require(_0xd323('0x1'));var rimraf=require(_0xd323('0x2'));var zipdir=require(_0xd323('0x3'));var jsonpatch=require(_0xd323('0x4'));var rp=require(_0xd323('0x5'));var moment=require(_0xd323('0x6'));var BPromise=require(_0xd323('0x7'));var Mustache=require(_0xd323('0x8'));var util=require(_0xd323('0x9'));var path=require(_0xd323('0xa'));var sox=require(_0xd323('0xb'));var csv=require(_0xd323('0xc'));var ejs=require(_0xd323('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd323('0xe'));var deskjs=require(_0xd323('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd323('0x10'));var Redis=require(_0xd323('0x11'));var authService=require(_0xd323('0x12'));var qs=require(_0xd323('0x13'));var as=require(_0xd323('0x14'));var hardwareService=require(_0xd323('0x15'));var logger=require(_0xd323('0x16'))(_0xd323('0x17'));var utils=require('../../config/utils');var config=require(_0xd323('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe0d455,_0x4ad065){_0x4ad065=_0x4ad065||0xcc;return function(_0x47ff01){if(_0x47ff01){return _0xe0d455[_0xd323('0x19')](_0x4ad065);}return _0xe0d455[_0xd323('0x1a')](_0x4ad065)[_0xd323('0x1b')]();};}function respondWithResult(_0x2ca562,_0x2bf208){_0x2bf208=_0x2bf208||0xc8;return function(_0x3d1e51){if(_0x3d1e51){return _0x2ca562[_0xd323('0x1a')](_0x2bf208)[_0xd323('0x1c')](_0x3d1e51);}};}function respondWithFilteredResult(_0x53cf80,_0x34700f){return function(_0x6845fa){if(_0x6845fa){var _0x3a8b7f=_0x6845fa['count'],_0x16560c=_0x34700f[_0xd323('0x1d')],_0x46584f=_0x34700f[_0xd323('0x1d')]+_0x34700f[_0xd323('0x1e')],_0x4de3ea;if(_0x46584f>=_0x3a8b7f){_0x46584f=_0x3a8b7f;_0x4de3ea=0xc8;}else{_0x4de3ea=0xce;}_0x53cf80[_0xd323('0x1a')](_0x4de3ea);return _0x53cf80['set']('Content-Range',_0x16560c+'-'+_0x46584f+'/'+_0x3a8b7f)['json'](_0x6845fa);}return null;};}function patchUpdates(_0x4683cc){return function(_0x482d93){try{jsonpatch[_0xd323('0x1f')](_0x482d93,_0x4683cc,!![]);}catch(_0x5a1a85){return BPromise['reject'](_0x5a1a85);}return _0x482d93[_0xd323('0x20')]();};}function saveUpdates(_0x1cb6e9,_0x45d472){return function(_0x5e55b1){if(_0x5e55b1){return _0x5e55b1[_0xd323('0x21')](_0x1cb6e9)[_0xd323('0x22')](function(_0x329623){return _0x329623;});}return null;};}function removeEntity(_0x23e966,_0x3a2d98){return function(_0x162754){if(_0x162754){return _0x162754[_0xd323('0x23')]()['then'](function(){_0x23e966[_0xd323('0x1a')](0xcc)[_0xd323('0x1b')]();});}};}function handleEntityNotFound(_0x3f1e2b,_0x38d746){return function(_0x5a51a2){if(!_0x5a51a2){_0x3f1e2b['sendStatus'](0x194);}return _0x5a51a2;};}function handleError(_0x342200,_0x1585f5){_0x1585f5=_0x1585f5||0x1f4;return function(_0x326b6b){logger['error'](_0x326b6b[_0xd323('0x24')]);if(_0x326b6b[_0xd323('0x25')]){delete _0x326b6b[_0xd323('0x25')];}_0x342200['status'](_0x1585f5)[_0xd323('0x26')](_0x326b6b);};}exports[_0xd323('0x27')]=function(_0x3d2d0b,_0x3e2d13){var _0xa48dc2={},_0x3d0b43={},_0x42d952={'count':0x0,'rows':[]};var _0x2f4a0b=_[_0xd323('0x28')](db[_0xd323('0x29')][_0xd323('0x2a')],function(_0xb951f7){return{'name':_0xb951f7['fieldName'],'type':_0xb951f7[_0xd323('0x2b')][_0xd323('0x2c')]};});_0x3d0b43['model']=_[_0xd323('0x28')](_0x2f4a0b,'name');_0x3d0b43[_0xd323('0x2d')]=_[_0xd323('0x2e')](_0x3d2d0b[_0xd323('0x2d')]);_0x3d0b43[_0xd323('0x2f')]=_[_0xd323('0x30')](_0x3d0b43['model'],_0x3d0b43['query']);_0x3d0b43[_0xd323('0x2f')]=_[_0xd323('0x31')](_0x3d0b43[_0xd323('0x2f')],[_0xd323('0x32'),'$or','$gt',_0xd323('0x33'),_0xd323('0x34'),_0xd323('0x35'),_0xd323('0x36'),_0xd323('0x37'),_0xd323('0x38'),_0xd323('0x39'),_0xd323('0x3a'),_0xd323('0x3b'),_0xd323('0x3c'),_0xd323('0x3d'),'$notLike',_0xd323('0x3e'),_0xd323('0x3f'),'$like','$overlap',_0xd323('0x40'),_0xd323('0x41'),'$any']);_0xa48dc2['attributes']=_[_0xd323('0x30')](_0x3d0b43['model'],qs[_0xd323('0x42')](_0x3d2d0b['query'][_0xd323('0x42')]));_0xa48dc2[_0xd323('0x43')]=_0xa48dc2[_0xd323('0x43')][_0xd323('0x44')]?_0xa48dc2[_0xd323('0x43')]:_0x3d0b43[_0xd323('0x45')];if(!_0x3d2d0b['query'][_0xd323('0x46')]('nolimit')){_0xa48dc2[_0xd323('0x1e')]=qs[_0xd323('0x1e')](_0x3d2d0b['query'][_0xd323('0x1e')]);_0xa48dc2[_0xd323('0x1d')]=qs[_0xd323('0x1d')](_0x3d2d0b[_0xd323('0x2d')][_0xd323('0x1d')]);}_0xa48dc2[_0xd323('0x47')]=qs[_0xd323('0x48')](_0x3d2d0b[_0xd323('0x2d')][_0xd323('0x48')]);_0xa48dc2['where']=qs[_0xd323('0x2f')](_[_0xd323('0x49')](_0x3d2d0b[_0xd323('0x2d')],_0x3d0b43[_0xd323('0x2f')]));if(_0x3d2d0b[_0xd323('0x2d')]['filter']){_0xa48dc2[_0xd323('0x4a')]=_[_0xd323('0x4b')](_0xa48dc2[_0xd323('0x4a')],{'$or':_[_0xd323('0x28')](_0x2f4a0b,function(_0x438235){if(_0x438235['type']!=='VIRTUAL'){var _0x41ea40={};_0x41ea40[_0x438235[_0xd323('0x25')]]={'$like':'%'+_0x3d2d0b[_0xd323('0x2d')][_0xd323('0x4c')]+'%'};return _0x41ea40;}})});}_0xa48dc2=_[_0xd323('0x4b')]({},_0xa48dc2,_0x3d2d0b[_0xd323('0x4d')]);var _0x27d5cb={'where':_0xa48dc2[_0xd323('0x4a')]};return db[_0xd323('0x29')]['count'](_0x27d5cb)['then'](function(_0x2c6f0d){_0x42d952['count']=_0x2c6f0d;if(_0x3d2d0b['query']['includeAll']){_0xa48dc2[_0xd323('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0xd323('0x4f')](_0xa48dc2);})[_0xd323('0x22')](function(_0x45833a){_0x42d952['rows']=_0x45833a;return _0x42d952;})[_0xd323('0x22')](respondWithFilteredResult(_0x3e2d13,_0xa48dc2))[_0xd323('0x50')](handleError(_0x3e2d13,null));};exports[_0xd323('0x51')]=function(_0x2beef7,_0x31a116){var _0xdb27e9={'raw':!![],'where':{'id':_0x2beef7['params']['id']}},_0x58b281={};_0x58b281[_0xd323('0x45')]=_[_0xd323('0x2e')](db[_0xd323('0x29')][_0xd323('0x2a')]);_0x58b281[_0xd323('0x2d')]=_[_0xd323('0x2e')](_0x2beef7[_0xd323('0x2d')]);_0x58b281[_0xd323('0x2f')]=_[_0xd323('0x30')](_0x58b281[_0xd323('0x45')],_0x58b281[_0xd323('0x2d')]);_0xdb27e9[_0xd323('0x43')]=_[_0xd323('0x30')](_0x58b281['model'],qs[_0xd323('0x42')](_0x2beef7[_0xd323('0x2d')]['fields']));_0xdb27e9[_0xd323('0x43')]=_0xdb27e9[_0xd323('0x43')][_0xd323('0x44')]?_0xdb27e9['attributes']:_0x58b281[_0xd323('0x45')];if(_0x2beef7[_0xd323('0x2d')]['includeAll']){_0xdb27e9[_0xd323('0x4e')]=[{'all':!![]}];}_0xdb27e9=_[_0xd323('0x4b')]({},_0xdb27e9,_0x2beef7[_0xd323('0x4d')]);return db[_0xd323('0x29')][_0xd323('0x52')](_0xdb27e9)[_0xd323('0x22')](handleEntityNotFound(_0x31a116,null))[_0xd323('0x22')](respondWithResult(_0x31a116,null))[_0xd323('0x50')](handleError(_0x31a116,null));};exports[_0xd323('0x53')]=function(_0x22612e,_0x230765){return db[_0xd323('0x29')][_0xd323('0x53')](_0x22612e[_0xd323('0x54')],{})[_0xd323('0x22')](respondWithResult(_0x230765,0xc9))[_0xd323('0x50')](handleError(_0x230765,null));};exports[_0xd323('0x21')]=function(_0x5d6699,_0x455ca2){if(_0x5d6699[_0xd323('0x54')]['id']){delete _0x5d6699['body']['id'];}return db[_0xd323('0x29')][_0xd323('0x52')]({'where':{'id':_0x5d6699[_0xd323('0x55')]['id']}})[_0xd323('0x22')](handleEntityNotFound(_0x455ca2,null))['then'](saveUpdates(_0x5d6699[_0xd323('0x54')],null))['then'](respondWithResult(_0x455ca2,null))[_0xd323('0x50')](handleError(_0x455ca2,null));};exports['describe']=function(_0x13f7f0,_0x36c1a8){return db['CmHopper'][_0xd323('0x56')]()['then'](respondWithResult(_0x36c1a8,null))[_0xd323('0x50')](handleError(_0x36c1a8,null));};exports['destroy']=function(_0x5145d1,_0x32db4b){var _0x3a8c44;return db[_0xd323('0x29')]['find']({'where':{'id':_0x5145d1[_0xd323('0x55')]['id']}})[_0xd323('0x22')](handleEntityNotFound(_0x32db4b,null))[_0xd323('0x22')](function(_0x115323){if(_0x115323){return _0x115323['destroy']()[_0xd323('0x22')](function(_0x11aa1a){return _0x11aa1a;});}})[_0xd323('0x22')](function(_0x3742ed){_0x3a8c44=_0x3742ed;if(_0x3742ed){if(_0x3742ed[_0xd323('0x57')]||_0x3742ed['CampaignId']){return db[_0x3742ed[_0xd323('0x57')]?_0xd323('0x58'):'Campaign']['find']({'where':{'id':_0x3742ed['VoiceQueueId']?_0x3742ed['VoiceQueueId']:_0x3742ed[_0xd323('0x59')]},'attributes':['id',_0xd323('0x25')],'raw':!![]});}}})['then'](function(_0xe7a2c5){var _0x4fb03f={};if(_0xe7a2c5){_['merge'](_0x4fb03f,_[_0xd323('0x5a')](_0x3a8c44[_0xd323('0x5b')],[_0xd323('0x5c'),_0xd323('0x5d'),'id']));_0x4fb03f[_0xd323('0x5e')]=0x15;_0x4fb03f[_0xd323('0x5f')]=_0xd323('0x60');_0x4fb03f[_0xd323('0x61')]=_0xe7a2c5['name'];_0x4fb03f['membername']=_0x5145d1[_0xd323('0x62')]['name'];_0x4fb03f[_0xd323('0x63')]=_0x5145d1[_0xd323('0x62')]['id'];_0x4fb03f[_0xd323('0x60')]=!![];_0x4fb03f['deletedat']=moment()[_0xd323('0x64')](_0xd323('0x65'));_0x4fb03f[_0xd323('0x66')]=_0x3a8c44[_0xd323('0x67')];_0x4fb03f[_0xd323('0x68')]=_0x3a8c44[_0xd323('0x57')]?'queue':_0xd323('0x69');return db['CmContact'][_0xd323('0x52')]({'where':{'id':_0x4fb03f[_0xd323('0x6a')]},'attributes':['firstName',_0xd323('0x6b')]})['then'](function(_0x5c1693){if(!_['isNil'](_0x32db4b)&&!_[_0xd323('0x6c')](_0x5c1693['firstName'])){_0x4fb03f[_0xd323('0x6d')]=_0x5c1693['firstName'];if(!_['isNil'](_0x5c1693[_0xd323('0x6b')])){_0x4fb03f[_0xd323('0x6d')]+='\x20'+_0x5c1693[_0xd323('0x6b')];}}})['finally'](function(){return db[_0xd323('0x6e')]['create'](_0x4fb03f);});}})[_0xd323('0x22')](function(){return _0x32db4b['status'](0xcc)[_0xd323('0x1b')]();})[_0xd323('0x50')](handleError(_0x32db4b,null));};exports['getPreview']=function(_0x446e06,_0x37025c,_0x47eeed){var _0x65d51d=[];return db[_0xd323('0x6f')][_0xd323('0x56')]()['then'](function(_0x556b84){_0x65d51d=_[_0xd323('0x2e')](_0x556b84);return _0x446e06[_0xd323('0x62')][_0xd323('0x70')]({'where':{'type':_0xd323('0x71'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xd323('0x72')],'raw':!![]});})[_0xd323('0x22')](function(_0x2749b6){if(_0x2749b6&&_0x2749b6['length']){return db['sequelize'][_0xd323('0x73')](function(_0x4cb635){var _0x55c429={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd323('0x64')](_0xd323('0x65'))},'VoiceQueueId':{'$in':_['map'](_0x2749b6,'id')},'$or':[{'UserId':null},{'UserId':_0x446e06[_0xd323('0x62')]['id']}]};var _0x4ef96a=[];if(_0x446e06[_0xd323('0x54')][_0xd323('0x74')]&&_0x446e06['body'][_0xd323('0x74')]===_0xd323('0x75')){if(!_[_0xd323('0x76')](_0x446e06[_0xd323('0x54')]['hopperIds'])){_0x55c429['id']={'$in':_0x446e06[_0xd323('0x54')]['hopperIds']};}_0x4ef96a=[[_0xd323('0x77'),_0xd323('0x78')],['scheduledAt',_0x2749b6[0x0][_0xd323('0x72')]===_0xd323('0x78')?_0xd323('0x79'):_0xd323('0x78')],db[_0xd323('0x7a')][_0xd323('0x7b')](_0xd323('0x7c')),['id','DESC']];}else{if(!_[_0xd323('0x76')](_0x446e06['body']['hopperIds'])){_0x55c429['id']={'$notIn':_0x446e06[_0xd323('0x54')][_0xd323('0x7d')]};}_0x4ef96a=[[_0xd323('0x77'),_0xd323('0x79')],[_0xd323('0x7e'),_0x2749b6[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0xd323('0x7b')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xd323('0x78')]];}return db[_0xd323('0x29')][_0xd323('0x7f')]({'attributes':['id',_0xd323('0x80')],'where':_0x55c429,'order':_0x4ef96a,'transaction':_0x4cb635,'lock':_0x4cb635[_0xd323('0x81')][_0xd323('0x82')],'include':[{'model':db[_0xd323('0x6f')],'as':_0xd323('0x83'),'attributes':_0x65d51d,'include':[{'model':db[_0xd323('0x84')],'as':'Company','attributes':['id',_0xd323('0x25')]}]},{'model':db['CmList'],'as':_0xd323('0x85'),'attributes':['id',_0xd323('0x25')]},{'model':db[_0xd323('0x58')],'as':_0xd323('0x86'),'attributes':['id',_0xd323('0x25'),'dialActive']}]})[_0xd323('0x22')](function(_0xdfee9d){if(_0xdfee9d){return _0xdfee9d[_0xd323('0x21')]({'UserId':_0x446e06[_0xd323('0x62')]['id']},{'transaction':_0x4cb635});}});});}})[_0xd323('0x22')](handleEntityNotFound(_0x37025c,null))[_0xd323('0x22')](respondWithResult(_0x37025c,null))[_0xd323('0x50')](handleError(_0x37025c,null));};exports[_0xd323('0x87')]=function(_0x822297,_0x351ee0,_0x199b78){return _0x822297['user'][_0xd323('0x70')]({'where':{'type':_0xd323('0x71'),'dialActive':!![],'dialMethod':_0xd323('0x88')},'attributes':['id'],'raw':!![]})['then'](function(_0x259e48){if(_0x259e48&&_0x259e48[_0xd323('0x44')]){return db[_0xd323('0x29')][_0xd323('0x89')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xd323('0x65'))},'VoiceQueueId':{'$in':_[_0xd323('0x28')](_0x259e48,'id')},'$or':[{'UserId':null},{'UserId':_0x822297[_0xd323('0x62')]['id']}]}});}return 0x0;})[_0xd323('0x22')](function(_0x26064a){if(!_['isNil'](_0x26064a)&&_[_0xd323('0x8a')](_0x26064a)){return _0x351ee0[_0xd323('0x1a')](0xc8)['json']({'contacts':_0x26064a});}else{logger[_0xd323('0x8b')](_0xd323('0x8c'),'getOpenContacts',0x194,_0xd323('0x8d'));_0x351ee0[_0xd323('0x19')](0x194);}})[_0xd323('0x50')](handleError(_0x351ee0,null));}; \ No newline at end of file +var _0xf526=['api','../../config/utils','../../config/environment','sendStatus','status','count','offset','set','json','apply','save','update','then','destroy','end','error','name','index','CmHopper','rawAttributes','fieldName','type','key','model','query','filters','intersection','$and','$or','$gte','$lte','$not','$between','$notBetween','$notIn','$notLike','$notILike','$like','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','map','VIRTUAL','options','includeAll','include','show','params','keys','find','catch','create','body','describe','VoiceQueueId','Campaign','merge','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','campaigntype','queue','ivr','lastName','isNil','firstName','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','direction','prev','isEmpty','hopperIds','scheduledAt','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmContact','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','isNumber','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','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x15063d,_0x290bec){var _0x53bbcd=function(_0x10863b){while(--_0x10863b){_0x15063d['push'](_0x15063d['shift']());}};_0x53bbcd(++_0x290bec);}(_0xf526,0x19b));var _0x6f52=function(_0x27d0d4,_0x39a79d){_0x27d0d4=_0x27d0d4-0x0;var _0x54427e=_0xf526[_0x27d0d4];return _0x54427e;};'use strict';var pdf=require(_0x6f52('0x0'));var emlformat=require(_0x6f52('0x1'));var rimraf=require(_0x6f52('0x2'));var zipdir=require(_0x6f52('0x3'));var jsonpatch=require(_0x6f52('0x4'));var rp=require(_0x6f52('0x5'));var moment=require(_0x6f52('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x6f52('0x7'));var util=require(_0x6f52('0x8'));var path=require('path');var sox=require(_0x6f52('0x9'));var csv=require('to-csv');var ejs=require(_0x6f52('0xa'));var fs=require('fs');var _=require(_0x6f52('0xb'));var squel=require(_0x6f52('0xc'));var crypto=require(_0x6f52('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f52('0xe'));var querystring=require(_0x6f52('0xf'));var Papa=require(_0x6f52('0x10'));var Redis=require(_0x6f52('0x11'));var authService=require(_0x6f52('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6f52('0x13'));var hardwareService=require(_0x6f52('0x14'));var logger=require('../../config/logger')(_0x6f52('0x15'));var utils=require(_0x6f52('0x16'));var config=require(_0x6f52('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x264201,_0x20909f){_0x20909f=_0x20909f||0xcc;return function(_0x2c0bfb){if(_0x2c0bfb){return _0x264201[_0x6f52('0x18')](_0x20909f);}return _0x264201[_0x6f52('0x19')](_0x20909f)['end']();};}function respondWithResult(_0x30dab0,_0x1dbaf2){_0x1dbaf2=_0x1dbaf2||0xc8;return function(_0x43abb2){if(_0x43abb2){return _0x30dab0['status'](_0x1dbaf2)['json'](_0x43abb2);}};}function respondWithFilteredResult(_0x3c56e5,_0x207020){return function(_0x2df808){if(_0x2df808){var _0x6385d2=_0x2df808[_0x6f52('0x1a')],_0x4cf1d0=_0x207020[_0x6f52('0x1b')],_0x7c4dbb=_0x207020[_0x6f52('0x1b')]+_0x207020['limit'],_0x2f4f4b;if(_0x7c4dbb>=_0x6385d2){_0x7c4dbb=_0x6385d2;_0x2f4f4b=0xc8;}else{_0x2f4f4b=0xce;}_0x3c56e5[_0x6f52('0x19')](_0x2f4f4b);return _0x3c56e5[_0x6f52('0x1c')]('Content-Range',_0x4cf1d0+'-'+_0x7c4dbb+'/'+_0x6385d2)[_0x6f52('0x1d')](_0x2df808);}return null;};}function patchUpdates(_0x1d2ab6){return function(_0x3c0856){try{jsonpatch[_0x6f52('0x1e')](_0x3c0856,_0x1d2ab6,!![]);}catch(_0x19da04){return BPromise['reject'](_0x19da04);}return _0x3c0856[_0x6f52('0x1f')]();};}function saveUpdates(_0x471515,_0x13cfa5){return function(_0x482b5d){if(_0x482b5d){return _0x482b5d[_0x6f52('0x20')](_0x471515)[_0x6f52('0x21')](function(_0x262a87){return _0x262a87;});}return null;};}function removeEntity(_0x2f285a,_0x2718cd){return function(_0x45da42){if(_0x45da42){return _0x45da42[_0x6f52('0x22')]()[_0x6f52('0x21')](function(){_0x2f285a[_0x6f52('0x19')](0xcc)[_0x6f52('0x23')]();});}};}function handleEntityNotFound(_0x23e902,_0x45d206){return function(_0x2525fc){if(!_0x2525fc){_0x23e902[_0x6f52('0x18')](0x194);}return _0x2525fc;};}function handleError(_0x1f8223,_0x318a1c){_0x318a1c=_0x318a1c||0x1f4;return function(_0x19bad2){logger[_0x6f52('0x24')](_0x19bad2['stack']);if(_0x19bad2['name']){delete _0x19bad2[_0x6f52('0x25')];}_0x1f8223['status'](_0x318a1c)['send'](_0x19bad2);};}exports[_0x6f52('0x26')]=function(_0x48659e,_0x3acefc){var _0x20fe99={},_0x5ef946={},_0xd04e0e={'count':0x0,'rows':[]};var _0x3e7b10=_['map'](db[_0x6f52('0x27')][_0x6f52('0x28')],function(_0x1a3390){return{'name':_0x1a3390[_0x6f52('0x29')],'type':_0x1a3390[_0x6f52('0x2a')][_0x6f52('0x2b')]};});_0x5ef946[_0x6f52('0x2c')]=_['map'](_0x3e7b10,_0x6f52('0x25'));_0x5ef946[_0x6f52('0x2d')]=_['keys'](_0x48659e[_0x6f52('0x2d')]);_0x5ef946[_0x6f52('0x2e')]=_[_0x6f52('0x2f')](_0x5ef946[_0x6f52('0x2c')],_0x5ef946[_0x6f52('0x2d')]);_0x5ef946[_0x6f52('0x2e')]=_['concat'](_0x5ef946[_0x6f52('0x2e')],[_0x6f52('0x30'),_0x6f52('0x31'),'$gt',_0x6f52('0x32'),'$lt',_0x6f52('0x33'),'$ne','$eq',_0x6f52('0x34'),_0x6f52('0x35'),_0x6f52('0x36'),'$in',_0x6f52('0x37'),'$like',_0x6f52('0x38'),'$iLike',_0x6f52('0x39'),_0x6f52('0x3a'),_0x6f52('0x3b'),_0x6f52('0x3c'),_0x6f52('0x3d'),_0x6f52('0x3e')]);_0x20fe99[_0x6f52('0x3f')]=_['intersection'](_0x5ef946[_0x6f52('0x2c')],qs[_0x6f52('0x40')](_0x48659e['query'][_0x6f52('0x40')]));_0x20fe99[_0x6f52('0x3f')]=_0x20fe99[_0x6f52('0x3f')][_0x6f52('0x41')]?_0x20fe99['attributes']:_0x5ef946[_0x6f52('0x2c')];if(!_0x48659e['query'][_0x6f52('0x42')](_0x6f52('0x43'))){_0x20fe99[_0x6f52('0x44')]=qs[_0x6f52('0x44')](_0x48659e[_0x6f52('0x2d')][_0x6f52('0x44')]);_0x20fe99['offset']=qs[_0x6f52('0x1b')](_0x48659e[_0x6f52('0x2d')]['offset']);}_0x20fe99['order']=qs[_0x6f52('0x45')](_0x48659e['query'][_0x6f52('0x45')]);_0x20fe99[_0x6f52('0x46')]=qs['filters'](_[_0x6f52('0x47')](_0x48659e['query'],_0x5ef946[_0x6f52('0x2e')]));if(_0x48659e[_0x6f52('0x2d')][_0x6f52('0x48')]){_0x20fe99[_0x6f52('0x46')]=_['merge'](_0x20fe99[_0x6f52('0x46')],{'$or':_[_0x6f52('0x49')](_0x3e7b10,function(_0x40e3e5){if(_0x40e3e5['type']!==_0x6f52('0x4a')){var _0x427688={};_0x427688[_0x40e3e5[_0x6f52('0x25')]]={'$like':'%'+_0x48659e['query'][_0x6f52('0x48')]+'%'};return _0x427688;}})});}_0x20fe99=_['merge']({},_0x20fe99,_0x48659e[_0x6f52('0x4b')]);var _0x342679={'where':_0x20fe99['where']};return db[_0x6f52('0x27')][_0x6f52('0x1a')](_0x342679)[_0x6f52('0x21')](function(_0x358904){_0xd04e0e[_0x6f52('0x1a')]=_0x358904;if(_0x48659e[_0x6f52('0x2d')][_0x6f52('0x4c')]){_0x20fe99[_0x6f52('0x4d')]=[{'all':!![]}];}return db[_0x6f52('0x27')]['findAll'](_0x20fe99);})[_0x6f52('0x21')](function(_0x1d830f){_0xd04e0e['rows']=_0x1d830f;return _0xd04e0e;})[_0x6f52('0x21')](respondWithFilteredResult(_0x3acefc,_0x20fe99))['catch'](handleError(_0x3acefc,null));};exports[_0x6f52('0x4e')]=function(_0x1cf095,_0x5f1f3a){var _0x27e903={'raw':!![],'where':{'id':_0x1cf095[_0x6f52('0x4f')]['id']}},_0x5bd86c={};_0x5bd86c[_0x6f52('0x2c')]=_['keys'](db[_0x6f52('0x27')][_0x6f52('0x28')]);_0x5bd86c['query']=_[_0x6f52('0x50')](_0x1cf095[_0x6f52('0x2d')]);_0x5bd86c[_0x6f52('0x2e')]=_[_0x6f52('0x2f')](_0x5bd86c[_0x6f52('0x2c')],_0x5bd86c['query']);_0x27e903[_0x6f52('0x3f')]=_[_0x6f52('0x2f')](_0x5bd86c['model'],qs['fields'](_0x1cf095[_0x6f52('0x2d')][_0x6f52('0x40')]));_0x27e903[_0x6f52('0x3f')]=_0x27e903[_0x6f52('0x3f')][_0x6f52('0x41')]?_0x27e903[_0x6f52('0x3f')]:_0x5bd86c[_0x6f52('0x2c')];if(_0x1cf095[_0x6f52('0x2d')][_0x6f52('0x4c')]){_0x27e903[_0x6f52('0x4d')]=[{'all':!![]}];}_0x27e903=_['merge']({},_0x27e903,_0x1cf095['options']);return db[_0x6f52('0x27')][_0x6f52('0x51')](_0x27e903)[_0x6f52('0x21')](handleEntityNotFound(_0x5f1f3a,null))[_0x6f52('0x21')](respondWithResult(_0x5f1f3a,null))[_0x6f52('0x52')](handleError(_0x5f1f3a,null));};exports[_0x6f52('0x53')]=function(_0x243205,_0x262d0d){return db[_0x6f52('0x27')]['create'](_0x243205[_0x6f52('0x54')],{})[_0x6f52('0x21')](respondWithResult(_0x262d0d,0xc9))[_0x6f52('0x52')](handleError(_0x262d0d,null));};exports[_0x6f52('0x20')]=function(_0xf9e701,_0x2f9ac3){if(_0xf9e701['body']['id']){delete _0xf9e701[_0x6f52('0x54')]['id'];}return db['CmHopper'][_0x6f52('0x51')]({'where':{'id':_0xf9e701[_0x6f52('0x4f')]['id']}})[_0x6f52('0x21')](handleEntityNotFound(_0x2f9ac3,null))[_0x6f52('0x21')](saveUpdates(_0xf9e701['body'],null))[_0x6f52('0x21')](respondWithResult(_0x2f9ac3,null))[_0x6f52('0x52')](handleError(_0x2f9ac3,null));};exports[_0x6f52('0x55')]=function(_0x55256f,_0x9f6fcd){return db[_0x6f52('0x27')][_0x6f52('0x55')]()[_0x6f52('0x21')](respondWithResult(_0x9f6fcd,null))[_0x6f52('0x52')](handleError(_0x9f6fcd,null));};exports[_0x6f52('0x22')]=function(_0xd92aa2,_0x812f1d){var _0x38fcd6;return db['CmHopper']['find']({'where':{'id':_0xd92aa2[_0x6f52('0x4f')]['id']}})[_0x6f52('0x21')](handleEntityNotFound(_0x812f1d,null))[_0x6f52('0x21')](function(_0x273a63){if(_0x273a63){return _0x273a63[_0x6f52('0x22')]()['then'](function(_0x1e4fad){return _0x1e4fad;});}})[_0x6f52('0x21')](function(_0x5610a){_0x38fcd6=_0x5610a;if(_0x5610a){if(_0x5610a[_0x6f52('0x56')]||_0x5610a['CampaignId']){return db[_0x5610a[_0x6f52('0x56')]?'VoiceQueue':_0x6f52('0x57')][_0x6f52('0x51')]({'where':{'id':_0x5610a[_0x6f52('0x56')]?_0x5610a[_0x6f52('0x56')]:_0x5610a['CampaignId']},'attributes':['id',_0x6f52('0x25')],'raw':!![]});}}})[_0x6f52('0x21')](function(_0x1ec19e){var _0x281be0={};if(_0x1ec19e){_[_0x6f52('0x58')](_0x281be0,_['omit'](_0x38fcd6[_0x6f52('0x59')],[_0x6f52('0x5a'),_0x6f52('0x5b'),'id']));_0x281be0[_0x6f52('0x5c')]=0x15;_0x281be0[_0x6f52('0x5d')]=_0x6f52('0x5e');_0x281be0[_0x6f52('0x5f')]=_0x1ec19e[_0x6f52('0x25')];_0x281be0[_0x6f52('0x60')]=_0xd92aa2[_0x6f52('0x61')][_0x6f52('0x25')];_0x281be0[_0x6f52('0x62')]=_0xd92aa2['user']['id'];_0x281be0[_0x6f52('0x5e')]=!![];_0x281be0[_0x6f52('0x63')]=moment()[_0x6f52('0x64')](_0x6f52('0x65'));_0x281be0['calleridnum']=_0x38fcd6['phone'];_0x281be0[_0x6f52('0x66')]=_0x38fcd6['VoiceQueueId']?_0x6f52('0x67'):_0x6f52('0x68');return db['CmContact'][_0x6f52('0x51')]({'where':{'id':_0x281be0['ContactId']},'attributes':['firstName',_0x6f52('0x69')]})['then'](function(_0x57452d){if(!_[_0x6f52('0x6a')](_0x812f1d)&&!_[_0x6f52('0x6a')](_0x57452d[_0x6f52('0x6b')])){_0x281be0['calleridname']=_0x57452d[_0x6f52('0x6b')];if(!_[_0x6f52('0x6a')](_0x57452d['lastName'])){_0x281be0['calleridname']+='\x20'+_0x57452d['lastName'];}}})[_0x6f52('0x6c')](function(){return db[_0x6f52('0x6d')][_0x6f52('0x53')](_0x281be0);});}})[_0x6f52('0x21')](function(){return _0x812f1d[_0x6f52('0x19')](0xcc)[_0x6f52('0x23')]();})[_0x6f52('0x52')](handleError(_0x812f1d,null));};exports[_0x6f52('0x6e')]=function(_0x448305,_0x206efd,_0x354e48){var _0x12b78d=[];return db['CmContact'][_0x6f52('0x55')]()[_0x6f52('0x21')](function(_0x38fed3){_0x12b78d=_[_0x6f52('0x50')](_0x38fed3);return _0x448305[_0x6f52('0x61')][_0x6f52('0x6f')]({'where':{'type':_0x6f52('0x70'),'dialActive':!![],'dialMethod':_0x6f52('0x71')},'attributes':['id',_0x6f52('0x72')],'raw':!![]});})[_0x6f52('0x21')](function(_0x1c63df){if(_0x1c63df&&_0x1c63df[_0x6f52('0x41')]){return db[_0x6f52('0x73')]['transaction'](function(_0x505ffc){var _0x26e6d3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6f52('0x64')](_0x6f52('0x65'))},'VoiceQueueId':{'$in':_[_0x6f52('0x49')](_0x1c63df,'id')},'$or':[{'UserId':null},{'UserId':_0x448305[_0x6f52('0x61')]['id']}]};var _0x19dc87=[];if(_0x448305['body'][_0x6f52('0x74')]&&_0x448305[_0x6f52('0x54')][_0x6f52('0x74')]===_0x6f52('0x75')){if(!_[_0x6f52('0x76')](_0x448305['body'][_0x6f52('0x77')])){_0x26e6d3['id']={'$in':_0x448305[_0x6f52('0x54')]['hopperIds']};}_0x19dc87=[['priority','ASC'],[_0x6f52('0x78'),_0x1c63df[0x0][_0x6f52('0x72')]===_0x6f52('0x79')?_0x6f52('0x7a'):'ASC'],db[_0x6f52('0x73')]['literal'](_0x6f52('0x7b')),['id','DESC']];}else{if(!_[_0x6f52('0x76')](_0x448305['body']['hopperIds'])){_0x26e6d3['id']={'$notIn':_0x448305['body']['hopperIds']};}_0x19dc87=[[_0x6f52('0x7c'),_0x6f52('0x7a')],[_0x6f52('0x78'),_0x1c63df[0x0][_0x6f52('0x72')]],db[_0x6f52('0x73')][_0x6f52('0x7d')](_0x6f52('0x7e')),['id','ASC']];}return db[_0x6f52('0x27')][_0x6f52('0x7f')]({'attributes':['id',_0x6f52('0x80')],'where':_0x26e6d3,'order':_0x19dc87,'transaction':_0x505ffc,'lock':_0x505ffc[_0x6f52('0x81')][_0x6f52('0x82')],'include':[{'model':db[_0x6f52('0x83')],'as':_0x6f52('0x84'),'attributes':_0x12b78d,'include':[{'model':db[_0x6f52('0x85')],'as':_0x6f52('0x86'),'attributes':['id',_0x6f52('0x25')]}]},{'model':db[_0x6f52('0x87')],'as':_0x6f52('0x88'),'attributes':['id',_0x6f52('0x25')]},{'model':db[_0x6f52('0x89')],'as':_0x6f52('0x8a'),'attributes':['id',_0x6f52('0x25'),_0x6f52('0x8b')]}]})[_0x6f52('0x21')](function(_0x72121f){if(_0x72121f){return _0x72121f['update']({'UserId':_0x448305[_0x6f52('0x61')]['id']},{'transaction':_0x505ffc});}});});}})['then'](handleEntityNotFound(_0x206efd,null))['then'](respondWithResult(_0x206efd,null))[_0x6f52('0x52')](handleError(_0x206efd,null));};exports[_0x6f52('0x8c')]=function(_0x1787f8,_0x151fe5,_0x2ccf22){return _0x1787f8[_0x6f52('0x61')][_0x6f52('0x6f')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x6f52('0x71')},'attributes':['id'],'raw':!![]})[_0x6f52('0x21')](function(_0x2cb717){if(_0x2cb717&&_0x2cb717['length']){return db[_0x6f52('0x27')][_0x6f52('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6f52('0x64')](_0x6f52('0x65'))},'VoiceQueueId':{'$in':_[_0x6f52('0x49')](_0x2cb717,'id')},'$or':[{'UserId':null},{'UserId':_0x1787f8[_0x6f52('0x61')]['id']}]}});}return 0x0;})[_0x6f52('0x21')](function(_0x3aa888){if(!_[_0x6f52('0x6a')](_0x3aa888)&&_[_0x6f52('0x8d')](_0x3aa888)){return _0x151fe5[_0x6f52('0x19')](0xc8)[_0x6f52('0x1d')]({'contacts':_0x3aa888});}else{logger[_0x6f52('0x24')](_0x6f52('0x8e'),_0x6f52('0x8c'),0x194,_0x6f52('0x8f'));_0x151fe5['sendStatus'](0x194);}})['catch'](handleError(_0x151fe5,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index cb33e8a..85b2e7a 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 _0x169f=['bluebird','request-promise','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','moment'];(function(_0x597411,_0x4f92dd){var _0x1261b=function(_0x26d322){while(--_0x26d322){_0x597411['push'](_0x597411['shift']());}};_0x1261b(++_0x4f92dd);}(_0x169f,0xed));var _0xf169=function(_0x10a9cc,_0x27aac6){_0x10a9cc=_0x10a9cc-0x0;var _0x5bf86d=_0x169f[_0x10a9cc];return _0x5bf86d;};'use strict';var _=require('lodash');var util=require(_0xf169('0x0'));var logger=require(_0xf169('0x1'))('api');var moment=require(_0xf169('0x2'));var BPromise=require(_0xf169('0x3'));var rp=require(_0xf169('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf169('0x5'));module['exports']=function(_0x32aaba,_0xf23435){return _0x32aaba[_0xf169('0x6')](_0xf169('0x7'),attributes,{'tableName':_0xf169('0x8'),'paranoid':![],'indexes':[{'name':_0xf169('0x9'),'fields':[_0xf169('0x9')]},{'name':_0xf169('0xa'),'fields':[_0xf169('0xa')]},{'name':_0xf169('0xb'),'fields':[_0xf169('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x52b9=['scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports','cm_hopper'];(function(_0x14d770,_0x41b389){var _0x4283a5=function(_0x1bc6e7){while(--_0x1bc6e7){_0x14d770['push'](_0x14d770['shift']());}};_0x4283a5(++_0x41b389);}(_0x52b9,0x14d));var _0x952b=function(_0x456546,_0x887210){_0x456546=_0x456546-0x0;var _0xa60a36=_0x52b9[_0x456546];return _0xa60a36;};'use strict';var _=require(_0x952b('0x0'));var util=require(_0x952b('0x1'));var logger=require(_0x952b('0x2'))(_0x952b('0x3'));var moment=require(_0x952b('0x4'));var BPromise=require(_0x952b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x952b('0x6'));var rimraf=require(_0x952b('0x7'));var config=require(_0x952b('0x8'));var attributes=require(_0x952b('0x9'));module[_0x952b('0xa')]=function(_0x555003,_0x4d67f8){return _0x555003['define']('CmHopper',attributes,{'tableName':_0x952b('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x952b('0xc')]},{'name':_0x952b('0xd'),'fields':[_0x952b('0xd')]},{'name':'priority','fields':[_0x952b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 91b6bb6..8b6dcc1 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 _0x7a54=['stringify','error','code','message','request\x20sent','result','catch','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','GetCmHopper','ShowCmHopper','find','CreateCmHopper','create','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','limit','order','LOCK','UPDATE','keys','User','Agent','name','voicePause','length','body','all','MoveContactManagedDialer','transaction','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','push','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmHopper,\x20%s,\x20%s','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a54,0x106));var _0x47a5=function(_0x27530f,_0x52d73f){_0x27530f=_0x27530f-0x0;var _0x30a3db=_0x7a54[_0x27530f];return _0x30a3db;};'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')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['GetCmHopper']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'limit':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['limit']||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x5247fd['options'][_0x47a5('0x1b')],function(_0x385687){return{'model':db[_0x385687['model']],'as':_0x385687['as'],'attributes':_0x385687[_0x47a5('0x1a')],'include':_0x385687[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x385687[_0x47a5('0x1b')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1b')]?_['map'](_0x3abd6a[_0x47a5('0x1b')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x1d')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x1dac65){logger[_0x47a5('0xb')](_0x47a5('0x1f'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1f'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1dac65));_0xaf70a6(_0x1dac65);})[_0x47a5('0x14')](function(_0x1127f8){logger[_0x47a5('0xf')](_0x47a5('0x1f'),_0x1127f8['message'],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x1127f8['message']));});});};exports[_0x47a5('0x20')]=function(_0x9ac908){var _0x16901f=this;return new Promise(function(_0x4d6b57,_0x256650){return db[_0x47a5('0x15')][_0x47a5('0x21')]({'raw':_0x9ac908[_0x47a5('0x17')]?_0x9ac908['options']['raw']===undefined?!![]:![]:!![],'where':_0x9ac908[_0x47a5('0x17')]?_0x9ac908[_0x47a5('0x17')]['where']||null:null,'attributes':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'include':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')]['include']?_[_0x47a5('0x1c')](_0x9ac908[_0x47a5('0x17')]['include'],function(_0x4843c0){return{'model':db[_0x4843c0[_0x47a5('0x1d')]],'as':_0x4843c0['as'],'attributes':_0x4843c0['attributes'],'include':_0x4843c0[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x4843c0[_0x47a5('0x1b')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x1d')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x1c')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x38c8d4){logger[_0x47a5('0xb')](_0x47a5('0x20'),_0x9ac908);logger[_0x47a5('0xd')](_0x47a5('0x20'),_0x9ac908,JSON[_0x47a5('0xe')](_0x38c8d4));_0x4d6b57(_0x38c8d4);})[_0x47a5('0x14')](function(_0x4caed5){logger[_0x47a5('0xf')](_0x47a5('0x20'),_0x4caed5['message'],_0x9ac908);_0x256650(_0x16901f[_0x47a5('0xf')](0x1f4,_0x4caed5[_0x47a5('0x11')]));});});};exports[_0x47a5('0x22')]=function(_0x49c4b5){var _0x101f70=this;return new Promise(function(_0x10f660,_0x596097){return db[_0x47a5('0x15')][_0x47a5('0x23')](_0x49c4b5['body'],{'raw':_0x49c4b5['options']?_0x49c4b5['options'][_0x47a5('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x9b5eaf){logger[_0x47a5('0xb')](_0x47a5('0x22'),_0x49c4b5);logger[_0x47a5('0xd')](_0x47a5('0x22'),_0x49c4b5,JSON[_0x47a5('0xe')](_0x9b5eaf));_0x10f660(_0x9b5eaf);})[_0x47a5('0x14')](function(_0x1f3d01){logger[_0x47a5('0xf')](_0x47a5('0x22'),_0x1f3d01[_0x47a5('0x11')],_0x49c4b5);_0x596097(_0x101f70[_0x47a5('0xf')](0x1f4,_0x1f3d01[_0x47a5('0x11')]));});});};exports['UpdateCmHopper']=function(_0x1fbece){var _0x1c36fa=this;return new Promise(function(_0x331474,_0x23bd8d){return db['CmHopper'][_0x47a5('0x24')](_0x1fbece['body'],{'raw':_0x1fbece['options']?_0x1fbece['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fbece[_0x47a5('0x17')]?_0x1fbece['options'][_0x47a5('0x19')]||null:null,'attributes':_0x1fbece[_0x47a5('0x17')]?_0x1fbece[_0x47a5('0x17')]['attributes']||null:null,'limit':_0x1fbece[_0x47a5('0x17')]?_0x1fbece[_0x47a5('0x17')]['limit']||null:null})['then'](function(_0xbe21d9){logger['info'](_0x47a5('0x25'),_0x1fbece);logger[_0x47a5('0xd')](_0x47a5('0x25'),_0x1fbece,JSON[_0x47a5('0xe')](_0xbe21d9));_0x331474(_0xbe21d9);})[_0x47a5('0x14')](function(_0xf0edbb){logger[_0x47a5('0xf')](_0x47a5('0x25'),_0xf0edbb[_0x47a5('0x11')],_0x1fbece);_0x23bd8d(_0x1c36fa[_0x47a5('0xf')](0x1f4,_0xf0edbb[_0x47a5('0x11')]));});});};exports[_0x47a5('0x26')]=function(_0xe28d76){var _0x3574d4=this;return new Promise(function(_0x4e5e7,_0x3a2b38){return db['CmHopper'][_0x47a5('0x27')]({'where':_0xe28d76[_0x47a5('0x17')]?_0xe28d76['options']['where']||null:null})[_0x47a5('0x1e')](function(_0x560e4e){logger[_0x47a5('0xb')](_0x47a5('0x26'),_0xe28d76);logger['debug']('DestroyCmHopper',_0xe28d76,JSON[_0x47a5('0xe')](_0x560e4e));_0x4e5e7(_0x560e4e);})['catch'](function(_0x2d147c){logger[_0x47a5('0xf')](_0x47a5('0x26'),_0x2d147c[_0x47a5('0x11')],_0xe28d76);_0x3a2b38(_0x3574d4[_0x47a5('0xf')](0x1f4,_0x2d147c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x28')]=function(_0x53e994){var _0x48a0ef=this;return new Promise(function(_0x2dd1db,_0x411230){return db[_0x47a5('0x29')][_0x47a5('0x2a')]()[_0x47a5('0x1e')](function(_0x2c0c86){return db[_0x47a5('0x2b')]['transaction'](function(_0x45cca5){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'where':_0x53e994['options']?_0x53e994[_0x47a5('0x17')]['where']||null:null,'attributes':_0x53e994[_0x47a5('0x17')]?_0x53e994[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'limit':_0x53e994[_0x47a5('0x17')]?_0x53e994['options'][_0x47a5('0x2c')]||null:null,'order':_0x53e994[_0x47a5('0x17')]?_0x53e994[_0x47a5('0x17')][_0x47a5('0x2d')]||null:null,'transaction':_0x45cca5,'lock':_0x45cca5[_0x47a5('0x2e')][_0x47a5('0x2f')],'include':[{'model':db[_0x47a5('0x29')],'as':'Contact','attributes':_[_0x47a5('0x30')](_0x2c0c86)},{'model':db[_0x47a5('0x31')],'as':_0x47a5('0x32'),'attributes':['id',_0x47a5('0x33'),_0x47a5('0x34')]}]})[_0x47a5('0x1e')](function(_0x572233){var _0x1ad6a9=[];for(var _0x245a15=0x0;_0x245a15<_0x572233[_0x47a5('0x35')];_0x245a15+=0x1){_0x1ad6a9['push'](_0x572233[_0x245a15][_0x47a5('0x24')](_0x53e994[_0x47a5('0x36')],{'transaction':_0x45cca5}));}return BPromise[_0x47a5('0x37')](_0x1ad6a9);});})['then'](function(_0x57641e){logger[_0x47a5('0xb')](_0x47a5('0x28'),_0x53e994);logger['debug']('GetContactDialer',_0x53e994,JSON[_0x47a5('0xe')](_0x57641e));_0x2dd1db(_0x57641e);})['catch'](function(_0x16bb8a){logger['error']('GetContactDialer',_0x16bb8a[_0x47a5('0x11')],_0x53e994);_0x411230(_0x48a0ef[_0x47a5('0xf')](0x1f4,_0x16bb8a['message']));});});});};exports[_0x47a5('0x38')]=function(_0x72fe){var _0x4b706a=this;return new Promise(function(_0x5b6127,_0x16b4fd){return db[_0x47a5('0x2b')][_0x47a5('0x39')](function(_0x2931e4){return db['CmHopperFinal'][_0x47a5('0x23')](_0x72fe[_0x47a5('0x36')],{'raw':_0x72fe[_0x47a5('0x17')]?_0x72fe['options'][_0x47a5('0x18')]===undefined?!![]:![]:!![],'transaction':_0x2931e4})['then'](function(){return db[_0x47a5('0x15')][_0x47a5('0x27')]({'where':_0x72fe[_0x47a5('0x17')]?_0x72fe[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'transaction':_0x2931e4});});})['then'](function(_0x144af9){logger['info']('MoveContactManagedDialer',_0x72fe);logger['debug']('MoveContactManagedDialer',_0x72fe,JSON[_0x47a5('0xe')](_0x144af9));_0x5b6127(_0x144af9);})[_0x47a5('0x14')](function(_0x1e2bb4){logger['error']('MoveContactManagedDialer',_0x1e2bb4[_0x47a5('0x11')],_0x72fe);_0x16b4fd(_0x4b706a[_0x47a5('0xf')](0x1f4,_0x1e2bb4[_0x47a5('0x11')]));});});};exports[_0x47a5('0x3a')]=function(_0xc45e25){var _0x4b5d0c=this;return new Promise(function(_0x3474b7,_0x519e9e){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0xc45e25['options']?_0xc45e25[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0xc45e25[_0x47a5('0x17')]?_0xc45e25[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'attributes':[[db[_0x47a5('0x2b')]['fn'](_0x47a5('0x3b'),db[_0x47a5('0x2b')]['fn']('IF',db['sequelize'][_0x47a5('0x3c')](_0x47a5('0x3d')+util[_0x47a5('0x3e')](_0x47a5('0x3f'),moment()[_0x47a5('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x47a5('0x40')))),_0x47a5('0x41')]]})[_0x47a5('0x1e')](function(_0x144aaa){logger[_0x47a5('0xb')](_0x47a5('0x3a'),_0xc45e25);logger[_0x47a5('0xd')](_0x47a5('0x3a'),_0xc45e25,JSON[_0x47a5('0xe')](_0x144aaa));_0x3474b7(_0x144aaa);})[_0x47a5('0x14')](function(_0x1d56f3){logger[_0x47a5('0xf')](_0x47a5('0x3a'),_0x1d56f3[_0x47a5('0x11')],_0xc45e25);_0x519e9e(_0x4b5d0c[_0x47a5('0xf')](0x1f4,_0x1d56f3['message']));});});};exports[_0x47a5('0x42')]=function(_0x284fb8){var _0x30504e=this;return new Promise(function(_0x4b42f3,_0x37ac59){return db[_0x47a5('0x29')][_0x47a5('0x2a')]()[_0x47a5('0x1e')](function(_0x5d9822){return db[_0x47a5('0x2b')]['transaction'](function(_0x2d5ee6){return db['CmHopper'][_0x47a5('0x16')]({'where':_0x284fb8['options']?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'attributes':_0x284fb8[_0x47a5('0x17')]?_0x284fb8['options']['attributes']||null:null,'limit':0x1,'order':_0x284fb8['options']?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x2d')]||null:null,'group':db[_0x47a5('0x15')][_0x47a5('0x43')],'transaction':_0x2d5ee6,'lock':_0x2d5ee6['LOCK'][_0x47a5('0x2f')],'include':_0x284fb8[_0x47a5('0x17')]?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x284fb8[_0x47a5('0x17')][_0x47a5('0x1b')],function(_0x39939a){return{'model':db[_0x39939a[_0x47a5('0x1d')]],'as':_0x39939a['as'],'attributes':_0x39939a[_0x47a5('0x1a')],'include':_0x39939a[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x39939a['include'],function(_0x1e3212){return{'model':db[_0x1e3212['model']],'as':_0x1e3212['as'],'attributes':_0x1e3212[_0x47a5('0x1a')],'include':_0x1e3212[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x1e3212[_0x47a5('0x1b')],function(_0x40e584){return{'model':db[_0x40e584[_0x47a5('0x1d')]],'as':_0x40e584['as'],'attributes':_0x40e584[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x11c1db){var _0x254049=[];for(var _0x1cfb37=0x0;_0x1cfb37<_0x11c1db[_0x47a5('0x35')];_0x1cfb37+=0x1){_0x254049[_0x47a5('0x44')](_0x11c1db[_0x1cfb37][_0x47a5('0x24')](_0x284fb8[_0x47a5('0x36')],{'transaction':_0x2d5ee6}));}return BPromise['all'](_0x254049);});})['then'](function(_0x5ccc89){logger['info'](_0x47a5('0x42'),_0x284fb8);logger[_0x47a5('0xd')]('GetContactRecallMe',_0x284fb8,JSON[_0x47a5('0xe')](_0x5ccc89));_0x4b42f3(_0x5ccc89);})[_0x47a5('0x14')](function(_0x1baa5a){logger[_0x47a5('0xf')](_0x47a5('0x42'),_0x1baa5a[_0x47a5('0x11')],_0x284fb8);_0x37ac59(_0x30504e[_0x47a5('0xf')](0x1f4,_0x1baa5a[_0x47a5('0x11')]));});});});}; \ No newline at end of file +var _0x7a54=['stringify','error','code','message','request\x20sent','result','catch','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','GetCmHopper','ShowCmHopper','find','CreateCmHopper','create','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','limit','order','LOCK','UPDATE','keys','User','Agent','name','voicePause','length','body','all','MoveContactManagedDialer','transaction','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','push','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmHopper,\x20%s,\x20%s','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a54,0x106));var _0x47a5=function(_0x32c351,_0x5778a4){_0x32c351=_0x32c351-0x0;var _0x3df8aa=_0x7a54[_0x32c351];return _0x3df8aa;};'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')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['GetCmHopper']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'limit':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['limit']||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x5247fd['options'][_0x47a5('0x1b')],function(_0x385687){return{'model':db[_0x385687['model']],'as':_0x385687['as'],'attributes':_0x385687[_0x47a5('0x1a')],'include':_0x385687[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x385687[_0x47a5('0x1b')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1b')]?_['map'](_0x3abd6a[_0x47a5('0x1b')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x1d')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x1dac65){logger[_0x47a5('0xb')](_0x47a5('0x1f'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1f'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1dac65));_0xaf70a6(_0x1dac65);})[_0x47a5('0x14')](function(_0x1127f8){logger[_0x47a5('0xf')](_0x47a5('0x1f'),_0x1127f8['message'],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x1127f8['message']));});});};exports[_0x47a5('0x20')]=function(_0x9ac908){var _0x16901f=this;return new Promise(function(_0x4d6b57,_0x256650){return db[_0x47a5('0x15')][_0x47a5('0x21')]({'raw':_0x9ac908[_0x47a5('0x17')]?_0x9ac908['options']['raw']===undefined?!![]:![]:!![],'where':_0x9ac908[_0x47a5('0x17')]?_0x9ac908[_0x47a5('0x17')]['where']||null:null,'attributes':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'include':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')]['include']?_[_0x47a5('0x1c')](_0x9ac908[_0x47a5('0x17')]['include'],function(_0x4843c0){return{'model':db[_0x4843c0[_0x47a5('0x1d')]],'as':_0x4843c0['as'],'attributes':_0x4843c0['attributes'],'include':_0x4843c0[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x4843c0[_0x47a5('0x1b')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x1d')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x1c')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x38c8d4){logger[_0x47a5('0xb')](_0x47a5('0x20'),_0x9ac908);logger[_0x47a5('0xd')](_0x47a5('0x20'),_0x9ac908,JSON[_0x47a5('0xe')](_0x38c8d4));_0x4d6b57(_0x38c8d4);})[_0x47a5('0x14')](function(_0x4caed5){logger[_0x47a5('0xf')](_0x47a5('0x20'),_0x4caed5['message'],_0x9ac908);_0x256650(_0x16901f[_0x47a5('0xf')](0x1f4,_0x4caed5[_0x47a5('0x11')]));});});};exports[_0x47a5('0x22')]=function(_0x49c4b5){var _0x101f70=this;return new Promise(function(_0x10f660,_0x596097){return db[_0x47a5('0x15')][_0x47a5('0x23')](_0x49c4b5['body'],{'raw':_0x49c4b5['options']?_0x49c4b5['options'][_0x47a5('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x9b5eaf){logger[_0x47a5('0xb')](_0x47a5('0x22'),_0x49c4b5);logger[_0x47a5('0xd')](_0x47a5('0x22'),_0x49c4b5,JSON[_0x47a5('0xe')](_0x9b5eaf));_0x10f660(_0x9b5eaf);})[_0x47a5('0x14')](function(_0x1f3d01){logger[_0x47a5('0xf')](_0x47a5('0x22'),_0x1f3d01[_0x47a5('0x11')],_0x49c4b5);_0x596097(_0x101f70[_0x47a5('0xf')](0x1f4,_0x1f3d01[_0x47a5('0x11')]));});});};exports['UpdateCmHopper']=function(_0x1fbece){var _0x1c36fa=this;return new Promise(function(_0x331474,_0x23bd8d){return db['CmHopper'][_0x47a5('0x24')](_0x1fbece['body'],{'raw':_0x1fbece['options']?_0x1fbece['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fbece[_0x47a5('0x17')]?_0x1fbece['options'][_0x47a5('0x19')]||null:null,'attributes':_0x1fbece[_0x47a5('0x17')]?_0x1fbece[_0x47a5('0x17')]['attributes']||null:null,'limit':_0x1fbece[_0x47a5('0x17')]?_0x1fbece[_0x47a5('0x17')]['limit']||null:null})['then'](function(_0xbe21d9){logger['info'](_0x47a5('0x25'),_0x1fbece);logger[_0x47a5('0xd')](_0x47a5('0x25'),_0x1fbece,JSON[_0x47a5('0xe')](_0xbe21d9));_0x331474(_0xbe21d9);})[_0x47a5('0x14')](function(_0xf0edbb){logger[_0x47a5('0xf')](_0x47a5('0x25'),_0xf0edbb[_0x47a5('0x11')],_0x1fbece);_0x23bd8d(_0x1c36fa[_0x47a5('0xf')](0x1f4,_0xf0edbb[_0x47a5('0x11')]));});});};exports[_0x47a5('0x26')]=function(_0xe28d76){var _0x3574d4=this;return new Promise(function(_0x4e5e7,_0x3a2b38){return db['CmHopper'][_0x47a5('0x27')]({'where':_0xe28d76[_0x47a5('0x17')]?_0xe28d76['options']['where']||null:null})[_0x47a5('0x1e')](function(_0x560e4e){logger[_0x47a5('0xb')](_0x47a5('0x26'),_0xe28d76);logger['debug']('DestroyCmHopper',_0xe28d76,JSON[_0x47a5('0xe')](_0x560e4e));_0x4e5e7(_0x560e4e);})['catch'](function(_0x2d147c){logger[_0x47a5('0xf')](_0x47a5('0x26'),_0x2d147c[_0x47a5('0x11')],_0xe28d76);_0x3a2b38(_0x3574d4[_0x47a5('0xf')](0x1f4,_0x2d147c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x28')]=function(_0x53e994){var _0x48a0ef=this;return new Promise(function(_0x2dd1db,_0x411230){return db[_0x47a5('0x29')][_0x47a5('0x2a')]()[_0x47a5('0x1e')](function(_0x2c0c86){return db[_0x47a5('0x2b')]['transaction'](function(_0x45cca5){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'where':_0x53e994['options']?_0x53e994[_0x47a5('0x17')]['where']||null:null,'attributes':_0x53e994[_0x47a5('0x17')]?_0x53e994[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'limit':_0x53e994[_0x47a5('0x17')]?_0x53e994['options'][_0x47a5('0x2c')]||null:null,'order':_0x53e994[_0x47a5('0x17')]?_0x53e994[_0x47a5('0x17')][_0x47a5('0x2d')]||null:null,'transaction':_0x45cca5,'lock':_0x45cca5[_0x47a5('0x2e')][_0x47a5('0x2f')],'include':[{'model':db[_0x47a5('0x29')],'as':'Contact','attributes':_[_0x47a5('0x30')](_0x2c0c86)},{'model':db[_0x47a5('0x31')],'as':_0x47a5('0x32'),'attributes':['id',_0x47a5('0x33'),_0x47a5('0x34')]}]})[_0x47a5('0x1e')](function(_0x572233){var _0x1ad6a9=[];for(var _0x245a15=0x0;_0x245a15<_0x572233[_0x47a5('0x35')];_0x245a15+=0x1){_0x1ad6a9['push'](_0x572233[_0x245a15][_0x47a5('0x24')](_0x53e994[_0x47a5('0x36')],{'transaction':_0x45cca5}));}return BPromise[_0x47a5('0x37')](_0x1ad6a9);});})['then'](function(_0x57641e){logger[_0x47a5('0xb')](_0x47a5('0x28'),_0x53e994);logger['debug']('GetContactDialer',_0x53e994,JSON[_0x47a5('0xe')](_0x57641e));_0x2dd1db(_0x57641e);})['catch'](function(_0x16bb8a){logger['error']('GetContactDialer',_0x16bb8a[_0x47a5('0x11')],_0x53e994);_0x411230(_0x48a0ef[_0x47a5('0xf')](0x1f4,_0x16bb8a['message']));});});});};exports[_0x47a5('0x38')]=function(_0x72fe){var _0x4b706a=this;return new Promise(function(_0x5b6127,_0x16b4fd){return db[_0x47a5('0x2b')][_0x47a5('0x39')](function(_0x2931e4){return db['CmHopperFinal'][_0x47a5('0x23')](_0x72fe[_0x47a5('0x36')],{'raw':_0x72fe[_0x47a5('0x17')]?_0x72fe['options'][_0x47a5('0x18')]===undefined?!![]:![]:!![],'transaction':_0x2931e4})['then'](function(){return db[_0x47a5('0x15')][_0x47a5('0x27')]({'where':_0x72fe[_0x47a5('0x17')]?_0x72fe[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'transaction':_0x2931e4});});})['then'](function(_0x144af9){logger['info']('MoveContactManagedDialer',_0x72fe);logger['debug']('MoveContactManagedDialer',_0x72fe,JSON[_0x47a5('0xe')](_0x144af9));_0x5b6127(_0x144af9);})[_0x47a5('0x14')](function(_0x1e2bb4){logger['error']('MoveContactManagedDialer',_0x1e2bb4[_0x47a5('0x11')],_0x72fe);_0x16b4fd(_0x4b706a[_0x47a5('0xf')](0x1f4,_0x1e2bb4[_0x47a5('0x11')]));});});};exports[_0x47a5('0x3a')]=function(_0xc45e25){var _0x4b5d0c=this;return new Promise(function(_0x3474b7,_0x519e9e){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0xc45e25['options']?_0xc45e25[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0xc45e25[_0x47a5('0x17')]?_0xc45e25[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'attributes':[[db[_0x47a5('0x2b')]['fn'](_0x47a5('0x3b'),db[_0x47a5('0x2b')]['fn']('IF',db['sequelize'][_0x47a5('0x3c')](_0x47a5('0x3d')+util[_0x47a5('0x3e')](_0x47a5('0x3f'),moment()[_0x47a5('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x47a5('0x40')))),_0x47a5('0x41')]]})[_0x47a5('0x1e')](function(_0x144aaa){logger[_0x47a5('0xb')](_0x47a5('0x3a'),_0xc45e25);logger[_0x47a5('0xd')](_0x47a5('0x3a'),_0xc45e25,JSON[_0x47a5('0xe')](_0x144aaa));_0x3474b7(_0x144aaa);})[_0x47a5('0x14')](function(_0x1d56f3){logger[_0x47a5('0xf')](_0x47a5('0x3a'),_0x1d56f3[_0x47a5('0x11')],_0xc45e25);_0x519e9e(_0x4b5d0c[_0x47a5('0xf')](0x1f4,_0x1d56f3['message']));});});};exports[_0x47a5('0x42')]=function(_0x284fb8){var _0x30504e=this;return new Promise(function(_0x4b42f3,_0x37ac59){return db[_0x47a5('0x29')][_0x47a5('0x2a')]()[_0x47a5('0x1e')](function(_0x5d9822){return db[_0x47a5('0x2b')]['transaction'](function(_0x2d5ee6){return db['CmHopper'][_0x47a5('0x16')]({'where':_0x284fb8['options']?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'attributes':_0x284fb8[_0x47a5('0x17')]?_0x284fb8['options']['attributes']||null:null,'limit':0x1,'order':_0x284fb8['options']?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x2d')]||null:null,'group':db[_0x47a5('0x15')][_0x47a5('0x43')],'transaction':_0x2d5ee6,'lock':_0x2d5ee6['LOCK'][_0x47a5('0x2f')],'include':_0x284fb8[_0x47a5('0x17')]?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x284fb8[_0x47a5('0x17')][_0x47a5('0x1b')],function(_0x39939a){return{'model':db[_0x39939a[_0x47a5('0x1d')]],'as':_0x39939a['as'],'attributes':_0x39939a[_0x47a5('0x1a')],'include':_0x39939a[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x39939a['include'],function(_0x1e3212){return{'model':db[_0x1e3212['model']],'as':_0x1e3212['as'],'attributes':_0x1e3212[_0x47a5('0x1a')],'include':_0x1e3212[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x1e3212[_0x47a5('0x1b')],function(_0x40e584){return{'model':db[_0x40e584[_0x47a5('0x1d')]],'as':_0x40e584['as'],'attributes':_0x40e584[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x11c1db){var _0x254049=[];for(var _0x1cfb37=0x0;_0x1cfb37<_0x11c1db[_0x47a5('0x35')];_0x1cfb37+=0x1){_0x254049[_0x47a5('0x44')](_0x11c1db[_0x1cfb37][_0x47a5('0x24')](_0x284fb8[_0x47a5('0x36')],{'transaction':_0x2d5ee6}));}return BPromise['all'](_0x254049);});})['then'](function(_0x5ccc89){logger['info'](_0x47a5('0x42'),_0x284fb8);logger[_0x47a5('0xd')]('GetContactRecallMe',_0x284fb8,JSON[_0x47a5('0xe')](_0x5ccc89));_0x4b42f3(_0x5ccc89);})[_0x47a5('0x14')](function(_0x1baa5a){logger[_0x47a5('0xf')](_0x47a5('0x42'),_0x1baa5a[_0x47a5('0x11')],_0x284fb8);_0x37ac59(_0x30504e[_0x47a5('0xf')](0x1f4,_0x1baa5a[_0x47a5('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 02ddba8..cb78e16 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 _0x4171=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','isAuthenticated','get','/describe','describe','/opencontacts','/:id','show','post','create','/preview','put','delete'];(function(_0x56812a,_0xa92780){var _0x22b18e=function(_0x2a0cd1){while(--_0x2a0cd1){_0x56812a['push'](_0x56812a['shift']());}};_0x22b18e(++_0xa92780);}(_0x4171,0x6a));var _0x1417=function(_0x54004e,_0x686659){_0x54004e=_0x54004e-0x0;var _0xe11d6e=_0x4171[_0x54004e];return _0xe11d6e;};'use strict';var multer=require('multer');var util=require(_0x1417('0x0'));var path=require(_0x1417('0x1'));var timeout=require(_0x1417('0x2'));var express=require(_0x1417('0x3'));var router=express[_0x1417('0x4')]();var auth=require(_0x1417('0x5'));var interaction=require(_0x1417('0x6'));var config=require('../../config/environment');var controller=require(_0x1417('0x7'));router['get']('/',auth[_0x1417('0x8')](),controller['index']);router[_0x1417('0x9')](_0x1417('0xa'),auth[_0x1417('0x8')](),controller[_0x1417('0xb')]);router['get'](_0x1417('0xc'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x1417('0xd'),auth[_0x1417('0x8')](),controller[_0x1417('0xe')]);router[_0x1417('0xf')]('/',auth[_0x1417('0x8')](),controller[_0x1417('0x10')]);router[_0x1417('0xf')](_0x1417('0x11'),auth['isAuthenticated'](),controller['getPreview']);router[_0x1417('0x12')](_0x1417('0xd'),auth[_0x1417('0x8')](),controller['update']);router[_0x1417('0x13')](_0x1417('0xd'),auth[_0x1417('0x8')](),controller['destroy']);module[_0x1417('0x14')]=router; \ No newline at end of file +var _0x5c3c=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/opencontacts','getOpenContacts','show','create','post','getPreview','/:id','update','destroy','exports','multer','util'];(function(_0x365113,_0x4b58e2){var _0x5f1450=function(_0x361422){while(--_0x361422){_0x365113['push'](_0x365113['shift']());}};_0x5f1450(++_0x4b58e2);}(_0x5c3c,0x132));var _0xc5c3=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x5c3c[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var path=require(_0xc5c3('0x2'));var timeout=require(_0xc5c3('0x3'));var express=require('express');var router=express[_0xc5c3('0x4')]();var auth=require(_0xc5c3('0x5'));var interaction=require(_0xc5c3('0x6'));var config=require(_0xc5c3('0x7'));var controller=require(_0xc5c3('0x8'));router[_0xc5c3('0x9')]('/',auth[_0xc5c3('0xa')](),controller[_0xc5c3('0xb')]);router[_0xc5c3('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc5c3('0x9')](_0xc5c3('0xc'),auth['isAuthenticated'](),controller[_0xc5c3('0xd')]);router[_0xc5c3('0x9')]('/:id',auth[_0xc5c3('0xa')](),controller[_0xc5c3('0xe')]);router['post']('/',auth[_0xc5c3('0xa')](),controller[_0xc5c3('0xf')]);router[_0xc5c3('0x10')]('/preview',auth[_0xc5c3('0xa')](),controller[_0xc5c3('0x11')]);router['put'](_0xc5c3('0x12'),auth[_0xc5c3('0xa')](),controller[_0xc5c3('0x13')]);router['delete'](_0xc5c3('0x12'),auth[_0xc5c3('0xa')](),controller[_0xc5c3('0x14')]);module[_0xc5c3('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 9efaea1..c2051dd 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 _0x3a33=['contactListQueue','STRING','INTEGER'];(function(_0x29a2ad,_0x2929dc){var _0x1df21d=function(_0xd74baf){while(--_0xd74baf){_0x29a2ad['push'](_0x29a2ad['shift']());}};_0x1df21d(++_0x2929dc);}(_0x3a33,0xdc));var _0x33a3=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x3a33[_0x311c35];return _0x5cc50c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x33a3('0x0')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x33a3('0x1')],'unique':_0x33a3('0x2')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x1492=['INTEGER','contactListQueue','moment','exports','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1492,0xac));var _0x2149=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x1492[_0x45e98e];return _0x374dba;};'use strict';var moment=require(_0x2149('0x0'));var Sequelize=require('sequelize');module[_0x2149('0x1')]={'phone':{'type':Sequelize[_0x2149('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x2149('0x3')],'unique':_0x2149('0x4')},'VoiceQueueId':{'type':Sequelize[_0x2149('0x3')],'unique':_0x2149('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index f6a2649..8321e60 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 _0xbdfb=['destroy','sendStatus','error','stack','name','send','map','CmHopperBlack','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','filters','length','find','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x4759bf,_0x23bd78){var _0x34948c=function(_0x4a163f){while(--_0x4a163f){_0x4759bf['push'](_0x4759bf['shift']());}};_0x34948c(++_0x23bd78);}(_0xbdfb,0x1ef));var _0xbbdf=function(_0x4ca536,_0x57c8de){_0x4ca536=_0x4ca536-0x0;var _0x3bd35f=_0xbdfb[_0x4ca536];return _0x3bd35f;};'use strict';var pdf=require(_0xbbdf('0x0'));var emlformat=require(_0xbbdf('0x1'));var rimraf=require(_0xbbdf('0x2'));var zipdir=require(_0xbbdf('0x3'));var jsonpatch=require(_0xbbdf('0x4'));var rp=require(_0xbbdf('0x5'));var moment=require(_0xbbdf('0x6'));var BPromise=require(_0xbbdf('0x7'));var Mustache=require(_0xbbdf('0x8'));var util=require(_0xbbdf('0x9'));var path=require('path');var sox=require(_0xbbdf('0xa'));var csv=require(_0xbbdf('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbbdf('0xc'));var squel=require(_0xbbdf('0xd'));var crypto=require('crypto');var jsforce=require(_0xbbdf('0xe'));var deskjs=require(_0xbbdf('0xf'));var toCsv=require(_0xbbdf('0xb'));var querystring=require(_0xbbdf('0x10'));var Papa=require('papaparse');var Redis=require(_0xbbdf('0x11'));var authService=require(_0xbbdf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbbdf('0x13'));var hardwareService=require(_0xbbdf('0x14'));var logger=require(_0xbbdf('0x15'))(_0xbbdf('0x16'));var utils=require('../../config/utils');var config=require(_0xbbdf('0x17'));var db=require(_0xbbdf('0x18'))['db'];function respondWithStatusCode(_0x21e27c,_0x54e89d){_0x54e89d=_0x54e89d||0xcc;return function(_0x58b953){if(_0x58b953){return _0x21e27c['sendStatus'](_0x54e89d);}return _0x21e27c['status'](_0x54e89d)[_0xbbdf('0x19')]();};}function respondWithResult(_0x2a00c6,_0x320eb6){_0x320eb6=_0x320eb6||0xc8;return function(_0x53b667){if(_0x53b667){return _0x2a00c6[_0xbbdf('0x1a')](_0x320eb6)[_0xbbdf('0x1b')](_0x53b667);}};}function respondWithFilteredResult(_0x27c4ff,_0x132743){return function(_0x34b12e){if(_0x34b12e){var _0x584939=_0x34b12e['count'],_0x41a6e2=_0x132743['offset'],_0x46968e=_0x132743[_0xbbdf('0x1c')]+_0x132743[_0xbbdf('0x1d')],_0x1f1a7f;if(_0x46968e>=_0x584939){_0x46968e=_0x584939;_0x1f1a7f=0xc8;}else{_0x1f1a7f=0xce;}_0x27c4ff[_0xbbdf('0x1a')](_0x1f1a7f);return _0x27c4ff[_0xbbdf('0x1e')](_0xbbdf('0x1f'),_0x41a6e2+'-'+_0x46968e+'/'+_0x584939)['json'](_0x34b12e);}return null;};}function patchUpdates(_0x4b8280){return function(_0x448a14){try{jsonpatch[_0xbbdf('0x20')](_0x448a14,_0x4b8280,!![]);}catch(_0x3c1629){return BPromise[_0xbbdf('0x21')](_0x3c1629);}return _0x448a14[_0xbbdf('0x22')]();};}function saveUpdates(_0x2c668b,_0x36bc9b){return function(_0x3e0929){if(_0x3e0929){return _0x3e0929[_0xbbdf('0x23')](_0x2c668b)[_0xbbdf('0x24')](function(_0x1069f9){return _0x1069f9;});}return null;};}function removeEntity(_0x31ed33,_0x568dc5){return function(_0x585199){if(_0x585199){return _0x585199[_0xbbdf('0x25')]()['then'](function(){_0x31ed33[_0xbbdf('0x1a')](0xcc)[_0xbbdf('0x19')]();});}};}function handleEntityNotFound(_0x3f9bbd,_0x5d03a5){return function(_0x440f2a){if(!_0x440f2a){_0x3f9bbd[_0xbbdf('0x26')](0x194);}return _0x440f2a;};}function handleError(_0xbe39d4,_0x3a52ff){_0x3a52ff=_0x3a52ff||0x1f4;return function(_0x496522){logger[_0xbbdf('0x27')](_0x496522[_0xbbdf('0x28')]);if(_0x496522[_0xbbdf('0x29')]){delete _0x496522['name'];}_0xbe39d4['status'](_0x3a52ff)[_0xbbdf('0x2a')](_0x496522);};}exports['index']=function(_0x493d45,_0x3ff60d){var _0x16f14d={},_0x1d8590={},_0x3afc58={'count':0x0,'rows':[]};var _0x28c283=_[_0xbbdf('0x2b')](db[_0xbbdf('0x2c')]['rawAttributes'],function(_0x2f5471){return{'name':_0x2f5471[_0xbbdf('0x2d')],'type':_0x2f5471[_0xbbdf('0x2e')][_0xbbdf('0x2f')]};});_0x1d8590[_0xbbdf('0x30')]=_[_0xbbdf('0x2b')](_0x28c283,_0xbbdf('0x29'));_0x1d8590['query']=_['keys'](_0x493d45[_0xbbdf('0x31')]);_0x1d8590['filters']=_[_0xbbdf('0x32')](_0x1d8590[_0xbbdf('0x30')],_0x1d8590[_0xbbdf('0x31')]);_0x16f14d[_0xbbdf('0x33')]=_[_0xbbdf('0x32')](_0x1d8590[_0xbbdf('0x30')],qs[_0xbbdf('0x34')](_0x493d45[_0xbbdf('0x31')][_0xbbdf('0x34')]));_0x16f14d[_0xbbdf('0x33')]=_0x16f14d[_0xbbdf('0x33')]['length']?_0x16f14d[_0xbbdf('0x33')]:_0x1d8590[_0xbbdf('0x30')];if(!_0x493d45[_0xbbdf('0x31')]['hasOwnProperty'](_0xbbdf('0x35'))){_0x16f14d[_0xbbdf('0x1d')]=qs[_0xbbdf('0x1d')](_0x493d45[_0xbbdf('0x31')][_0xbbdf('0x1d')]);_0x16f14d[_0xbbdf('0x1c')]=qs[_0xbbdf('0x1c')](_0x493d45['query'][_0xbbdf('0x1c')]);}_0x16f14d[_0xbbdf('0x36')]=qs[_0xbbdf('0x37')](_0x493d45[_0xbbdf('0x31')][_0xbbdf('0x37')]);_0x16f14d[_0xbbdf('0x38')]=qs['filters'](_[_0xbbdf('0x39')](_0x493d45[_0xbbdf('0x31')],_0x1d8590['filters']));if(_0x493d45['query'][_0xbbdf('0x3a')]){_0x16f14d[_0xbbdf('0x38')]=_[_0xbbdf('0x3b')](_0x16f14d[_0xbbdf('0x38')],{'$or':_['map'](_0x28c283,function(_0x2d6045){if(_0x2d6045[_0xbbdf('0x2e')]!==_0xbbdf('0x3c')){var _0x147654={};_0x147654[_0x2d6045['name']]={'$like':'%'+_0x493d45['query'][_0xbbdf('0x3a')]+'%'};return _0x147654;}})});}_0x16f14d=_[_0xbbdf('0x3b')]({},_0x16f14d,_0x493d45[_0xbbdf('0x3d')]);var _0x2acaa3={'where':_0x16f14d[_0xbbdf('0x38')]};return db['CmHopperBlack'][_0xbbdf('0x3e')](_0x2acaa3)[_0xbbdf('0x24')](function(_0x133dd4){_0x3afc58[_0xbbdf('0x3e')]=_0x133dd4;if(_0x493d45[_0xbbdf('0x31')][_0xbbdf('0x3f')]){_0x16f14d[_0xbbdf('0x40')]=[{'all':!![]}];}return db[_0xbbdf('0x2c')][_0xbbdf('0x41')](_0x16f14d);})[_0xbbdf('0x24')](function(_0x221fdf){_0x3afc58[_0xbbdf('0x42')]=_0x221fdf;return _0x3afc58;})[_0xbbdf('0x24')](respondWithFilteredResult(_0x3ff60d,_0x16f14d))[_0xbbdf('0x43')](handleError(_0x3ff60d,null));};exports['show']=function(_0x45633,_0x5affa7){var _0x2cdc25={'raw':!![],'where':{'id':_0x45633[_0xbbdf('0x44')]['id']}},_0x1a2de4={};_0x1a2de4[_0xbbdf('0x30')]=_[_0xbbdf('0x45')](db['CmHopperBlack'][_0xbbdf('0x46')]);_0x1a2de4[_0xbbdf('0x31')]=_[_0xbbdf('0x45')](_0x45633[_0xbbdf('0x31')]);_0x1a2de4[_0xbbdf('0x47')]=_[_0xbbdf('0x32')](_0x1a2de4['model'],_0x1a2de4[_0xbbdf('0x31')]);_0x2cdc25['attributes']=_[_0xbbdf('0x32')](_0x1a2de4['model'],qs[_0xbbdf('0x34')](_0x45633['query'][_0xbbdf('0x34')]));_0x2cdc25[_0xbbdf('0x33')]=_0x2cdc25[_0xbbdf('0x33')][_0xbbdf('0x48')]?_0x2cdc25[_0xbbdf('0x33')]:_0x1a2de4['model'];if(_0x45633[_0xbbdf('0x31')][_0xbbdf('0x3f')]){_0x2cdc25[_0xbbdf('0x40')]=[{'all':!![]}];}_0x2cdc25=_['merge']({},_0x2cdc25,_0x45633[_0xbbdf('0x3d')]);return db[_0xbbdf('0x2c')][_0xbbdf('0x49')](_0x2cdc25)[_0xbbdf('0x24')](handleEntityNotFound(_0x5affa7,null))[_0xbbdf('0x24')](respondWithResult(_0x5affa7,null))['catch'](handleError(_0x5affa7,null));};exports[_0xbbdf('0x23')]=function(_0x59fc7f,_0x3e1ce7){if(_0x59fc7f['body']['id']){delete _0x59fc7f['body']['id'];}return db[_0xbbdf('0x2c')][_0xbbdf('0x49')]({'where':{'id':_0x59fc7f[_0xbbdf('0x44')]['id']}})['then'](handleEntityNotFound(_0x3e1ce7,null))['then'](saveUpdates(_0x59fc7f[_0xbbdf('0x4a')],null))['then'](respondWithResult(_0x3e1ce7,null))['catch'](handleError(_0x3e1ce7,null));};exports[_0xbbdf('0x25')]=function(_0x3fb08c,_0x15f2bc){return db[_0xbbdf('0x2c')][_0xbbdf('0x49')]({'where':{'id':_0x3fb08c[_0xbbdf('0x44')]['id']}})[_0xbbdf('0x24')](handleEntityNotFound(_0x15f2bc,null))[_0xbbdf('0x24')](removeEntity(_0x15f2bc,null))['catch'](handleError(_0x15f2bc,null));};exports[_0xbbdf('0x4b')]=function(_0x1511d8,_0x21e6b1){return db[_0xbbdf('0x2c')][_0xbbdf('0x4b')]()['then'](respondWithResult(_0x21e6b1,null))[_0xbbdf('0x43')](handleError(_0x21e6b1,null));}; \ No newline at end of file +var _0x5523=['type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','limit','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','length','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes'];(function(_0x160986,_0x531e21){var _0xfb73aa=function(_0x110903){while(--_0x110903){_0x160986['push'](_0x160986['shift']());}};_0xfb73aa(++_0x531e21);}(_0x5523,0x137));var _0x3552=function(_0x36c196,_0x32ddd2){_0x36c196=_0x36c196-0x0;var _0x4ff710=_0x5523[_0x36c196];return _0x4ff710;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3552('0x0'));var zipdir=require(_0x3552('0x1'));var jsonpatch=require(_0x3552('0x2'));var rp=require(_0x3552('0x3'));var moment=require(_0x3552('0x4'));var BPromise=require(_0x3552('0x5'));var Mustache=require(_0x3552('0x6'));var util=require(_0x3552('0x7'));var path=require(_0x3552('0x8'));var sox=require(_0x3552('0x9'));var csv=require(_0x3552('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3552('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3552('0xc'));var toCsv=require(_0x3552('0xa'));var querystring=require(_0x3552('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3552('0xe'));var qs=require(_0x3552('0xf'));var as=require(_0x3552('0x10'));var hardwareService=require(_0x3552('0x11'));var logger=require(_0x3552('0x12'))(_0x3552('0x13'));var utils=require(_0x3552('0x14'));var config=require(_0x3552('0x15'));var db=require(_0x3552('0x16'))['db'];function respondWithStatusCode(_0x8fc5be,_0xae728b){_0xae728b=_0xae728b||0xcc;return function(_0x549df0){if(_0x549df0){return _0x8fc5be[_0x3552('0x17')](_0xae728b);}return _0x8fc5be[_0x3552('0x18')](_0xae728b)[_0x3552('0x19')]();};}function respondWithResult(_0x504b80,_0x538549){_0x538549=_0x538549||0xc8;return function(_0x123c8e){if(_0x123c8e){return _0x504b80[_0x3552('0x18')](_0x538549)[_0x3552('0x1a')](_0x123c8e);}};}function respondWithFilteredResult(_0x273e61,_0x50813d){return function(_0x3b9f0a){if(_0x3b9f0a){var _0x268d39=_0x3b9f0a[_0x3552('0x1b')],_0x31dd12=_0x50813d[_0x3552('0x1c')],_0x3da99c=_0x50813d[_0x3552('0x1c')]+_0x50813d['limit'],_0x4a8f95;if(_0x3da99c>=_0x268d39){_0x3da99c=_0x268d39;_0x4a8f95=0xc8;}else{_0x4a8f95=0xce;}_0x273e61[_0x3552('0x18')](_0x4a8f95);return _0x273e61[_0x3552('0x1d')]('Content-Range',_0x31dd12+'-'+_0x3da99c+'/'+_0x268d39)[_0x3552('0x1a')](_0x3b9f0a);}return null;};}function patchUpdates(_0xca6641){return function(_0x150877){try{jsonpatch[_0x3552('0x1e')](_0x150877,_0xca6641,!![]);}catch(_0x4d4a6d){return BPromise[_0x3552('0x1f')](_0x4d4a6d);}return _0x150877[_0x3552('0x20')]();};}function saveUpdates(_0x4d0db9,_0x26984c){return function(_0x443bab){if(_0x443bab){return _0x443bab[_0x3552('0x21')](_0x4d0db9)[_0x3552('0x22')](function(_0x97287d){return _0x97287d;});}return null;};}function removeEntity(_0x57cbe2,_0x2fe62c){return function(_0x4ea201){if(_0x4ea201){return _0x4ea201[_0x3552('0x23')]()['then'](function(){_0x57cbe2[_0x3552('0x18')](0xcc)[_0x3552('0x19')]();});}};}function handleEntityNotFound(_0x5355e4,_0x1f80b5){return function(_0x534c68){if(!_0x534c68){_0x5355e4[_0x3552('0x17')](0x194);}return _0x534c68;};}function handleError(_0x5c2272,_0x1972b7){_0x1972b7=_0x1972b7||0x1f4;return function(_0x555c2d){logger[_0x3552('0x24')](_0x555c2d[_0x3552('0x25')]);if(_0x555c2d[_0x3552('0x26')]){delete _0x555c2d[_0x3552('0x26')];}_0x5c2272[_0x3552('0x18')](_0x1972b7)[_0x3552('0x27')](_0x555c2d);};}exports[_0x3552('0x28')]=function(_0x2e8745,_0x5028e1){var _0x5d93f6={},_0x7d75aa={},_0x581e41={'count':0x0,'rows':[]};var _0x29dc07=_[_0x3552('0x29')](db[_0x3552('0x2a')][_0x3552('0x2b')],function(_0x440cff){return{'name':_0x440cff['fieldName'],'type':_0x440cff[_0x3552('0x2c')][_0x3552('0x2d')]};});_0x7d75aa[_0x3552('0x2e')]=_[_0x3552('0x29')](_0x29dc07,_0x3552('0x26'));_0x7d75aa['query']=_[_0x3552('0x2f')](_0x2e8745[_0x3552('0x30')]);_0x7d75aa['filters']=_[_0x3552('0x31')](_0x7d75aa['model'],_0x7d75aa['query']);_0x5d93f6[_0x3552('0x32')]=_[_0x3552('0x31')](_0x7d75aa[_0x3552('0x2e')],qs[_0x3552('0x33')](_0x2e8745[_0x3552('0x30')][_0x3552('0x33')]));_0x5d93f6[_0x3552('0x32')]=_0x5d93f6[_0x3552('0x32')]['length']?_0x5d93f6['attributes']:_0x7d75aa['model'];if(!_0x2e8745[_0x3552('0x30')][_0x3552('0x34')]('nolimit')){_0x5d93f6['limit']=qs[_0x3552('0x35')](_0x2e8745[_0x3552('0x30')][_0x3552('0x35')]);_0x5d93f6[_0x3552('0x1c')]=qs[_0x3552('0x1c')](_0x2e8745[_0x3552('0x30')][_0x3552('0x1c')]);}_0x5d93f6['order']=qs[_0x3552('0x36')](_0x2e8745[_0x3552('0x30')][_0x3552('0x36')]);_0x5d93f6[_0x3552('0x37')]=qs[_0x3552('0x38')](_['pick'](_0x2e8745[_0x3552('0x30')],_0x7d75aa['filters']));if(_0x2e8745[_0x3552('0x30')]['filter']){_0x5d93f6[_0x3552('0x37')]=_[_0x3552('0x39')](_0x5d93f6[_0x3552('0x37')],{'$or':_[_0x3552('0x29')](_0x29dc07,function(_0x21e812){if(_0x21e812[_0x3552('0x2c')]!==_0x3552('0x3a')){var _0x5b1ab1={};_0x5b1ab1[_0x21e812[_0x3552('0x26')]]={'$like':'%'+_0x2e8745[_0x3552('0x30')][_0x3552('0x3b')]+'%'};return _0x5b1ab1;}})});}_0x5d93f6=_[_0x3552('0x39')]({},_0x5d93f6,_0x2e8745['options']);var _0x34a126={'where':_0x5d93f6[_0x3552('0x37')]};return db[_0x3552('0x2a')][_0x3552('0x1b')](_0x34a126)[_0x3552('0x22')](function(_0x53511e){_0x581e41[_0x3552('0x1b')]=_0x53511e;if(_0x2e8745['query'][_0x3552('0x3c')]){_0x5d93f6[_0x3552('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x3552('0x3e')](_0x5d93f6);})[_0x3552('0x22')](function(_0x45e746){_0x581e41[_0x3552('0x3f')]=_0x45e746;return _0x581e41;})[_0x3552('0x22')](respondWithFilteredResult(_0x5028e1,_0x5d93f6))[_0x3552('0x40')](handleError(_0x5028e1,null));};exports[_0x3552('0x41')]=function(_0x380c5c,_0x2912b3){var _0x142da0={'raw':!![],'where':{'id':_0x380c5c[_0x3552('0x42')]['id']}},_0x34b7e6={};_0x34b7e6['model']=_[_0x3552('0x2f')](db[_0x3552('0x2a')][_0x3552('0x2b')]);_0x34b7e6[_0x3552('0x30')]=_[_0x3552('0x2f')](_0x380c5c[_0x3552('0x30')]);_0x34b7e6[_0x3552('0x38')]=_[_0x3552('0x31')](_0x34b7e6['model'],_0x34b7e6[_0x3552('0x30')]);_0x142da0[_0x3552('0x32')]=_[_0x3552('0x31')](_0x34b7e6[_0x3552('0x2e')],qs[_0x3552('0x33')](_0x380c5c[_0x3552('0x30')][_0x3552('0x33')]));_0x142da0['attributes']=_0x142da0[_0x3552('0x32')][_0x3552('0x43')]?_0x142da0[_0x3552('0x32')]:_0x34b7e6[_0x3552('0x2e')];if(_0x380c5c[_0x3552('0x30')][_0x3552('0x3c')]){_0x142da0[_0x3552('0x3d')]=[{'all':!![]}];}_0x142da0=_[_0x3552('0x39')]({},_0x142da0,_0x380c5c['options']);return db[_0x3552('0x2a')][_0x3552('0x44')](_0x142da0)[_0x3552('0x22')](handleEntityNotFound(_0x2912b3,null))[_0x3552('0x22')](respondWithResult(_0x2912b3,null))[_0x3552('0x40')](handleError(_0x2912b3,null));};exports[_0x3552('0x21')]=function(_0x43743c,_0x189fee){if(_0x43743c[_0x3552('0x45')]['id']){delete _0x43743c['body']['id'];}return db[_0x3552('0x2a')]['find']({'where':{'id':_0x43743c[_0x3552('0x42')]['id']}})[_0x3552('0x22')](handleEntityNotFound(_0x189fee,null))['then'](saveUpdates(_0x43743c['body'],null))[_0x3552('0x22')](respondWithResult(_0x189fee,null))[_0x3552('0x40')](handleError(_0x189fee,null));};exports['destroy']=function(_0x24c85b,_0xd38a86){return db[_0x3552('0x2a')][_0x3552('0x44')]({'where':{'id':_0x24c85b[_0x3552('0x42')]['id']}})['then'](handleEntityNotFound(_0xd38a86,null))[_0x3552('0x22')](removeEntity(_0xd38a86,null))[_0x3552('0x40')](handleError(_0xd38a86,null));};exports[_0x3552('0x46')]=function(_0x4eff7a,_0x2a3f99){return db[_0x3552('0x2a')][_0x3552('0x46')]()[_0x3552('0x22')](respondWithResult(_0x2a3f99,null))[_0x3552('0x40')](handleError(_0x2a3f99,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index ebd7623..6c2051e 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 _0x594d=['CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x2a5d5e,_0x1f0746){var _0x167f6f=function(_0x22f919){while(--_0x22f919){_0x2a5d5e['push'](_0x2a5d5e['shift']());}};_0x167f6f(++_0x1f0746);}(_0x594d,0x10c));var _0xd594=function(_0x3600e2,_0x6170be){_0x3600e2=_0x3600e2-0x0;var _0x2af5ff=_0x594d[_0x3600e2];return _0x2af5ff;};'use strict';var _=require(_0xd594('0x0'));var util=require(_0xd594('0x1'));var logger=require(_0xd594('0x2'))('api');var moment=require(_0xd594('0x3'));var BPromise=require(_0xd594('0x4'));var rp=require(_0xd594('0x5'));var fs=require('fs');var path=require(_0xd594('0x6'));var rimraf=require(_0xd594('0x7'));var config=require(_0xd594('0x8'));var attributes=require(_0xd594('0x9'));module[_0xd594('0xa')]=function(_0x31c13d,_0x205d85){return _0x31c13d[_0xd594('0xb')](_0xd594('0xc'),attributes,{'tableName':_0xd594('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14ba=['moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x33fd82,_0x43dbcc){var _0x323cca=function(_0x13313d){while(--_0x13313d){_0x33fd82['push'](_0x33fd82['shift']());}};_0x323cca(++_0x43dbcc);}(_0x14ba,0x8d));var _0xa14b=function(_0x4d6add,_0x32d1e6){_0x4d6add=_0x4d6add-0x0;var _0x24a9e5=_0x14ba[_0x4d6add];return _0x24a9e5;};'use strict';var _=require(_0xa14b('0x0'));var util=require(_0xa14b('0x1'));var logger=require(_0xa14b('0x2'))('api');var moment=require(_0xa14b('0x3'));var BPromise=require(_0xa14b('0x4'));var rp=require(_0xa14b('0x5'));var fs=require('fs');var path=require(_0xa14b('0x6'));var rimraf=require(_0xa14b('0x7'));var config=require('../../config/environment');var attributes=require(_0xa14b('0x8'));module[_0xa14b('0x9')]=function(_0xb3a1c,_0x4e6588){return _0xb3a1c['define'](_0xa14b('0xa'),attributes,{'tableName':_0xa14b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 68bf51e..a2324fe 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 _0xfe26=['stringify','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','attributes','include','map','model','UpdateCmHopperBlack','CmHopperBlack','body','limit','DestroyCmHopperBlack','destroy','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x213dae,_0x50de40){var _0xc33e1a=function(_0xf4ec60){while(--_0xf4ec60){_0x213dae['push'](_0x213dae['shift']());}};_0xc33e1a(++_0x50de40);}(_0xfe26,0x16b));var _0x6fe2=function(_0x5c8ca7,_0x4c15f6){_0x5c8ca7=_0x5c8ca7-0x0;var _0x1f0809=_0xfe26[_0x5c8ca7];return _0x1f0809;};'use strict';var _=require(_0x6fe2('0x0'));var util=require(_0x6fe2('0x1'));var moment=require(_0x6fe2('0x2'));var BPromise=require(_0x6fe2('0x3'));var rs=require(_0x6fe2('0x4'));var fs=require('fs');var Redis=require(_0x6fe2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6fe2('0x6'));var logger=require('../../config/logger')(_0x6fe2('0x7'));var config=require(_0x6fe2('0x8'));var jayson=require(_0x6fe2('0x9'));var client=jayson['client'][_0x6fe2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249231,_0x3b1edb,_0x38e399){return new BPromise(function(_0x396ae7,_0x1de3c3){return client[_0x6fe2('0xb')](_0x249231,_0x38e399)[_0x6fe2('0xc')](function(_0x49a68d){logger[_0x6fe2('0xd')](_0x6fe2('0xe'),_0x3b1edb,_0x6fe2('0xf'));logger[_0x6fe2('0x10')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x3b1edb,_0x6fe2('0xf'),JSON[_0x6fe2('0x11')](_0x49a68d));if(_0x49a68d[_0x6fe2('0x12')]){if(_0x49a68d[_0x6fe2('0x12')][_0x6fe2('0x13')]===0x1f4){logger[_0x6fe2('0x12')](_0x6fe2('0xe'),_0x3b1edb,_0x49a68d['error'][_0x6fe2('0x14')]);return _0x1de3c3(_0x49a68d['error']['message']);}logger[_0x6fe2('0x12')](_0x6fe2('0xe'),_0x3b1edb,_0x49a68d[_0x6fe2('0x12')][_0x6fe2('0x14')]);return _0x396ae7(_0x49a68d[_0x6fe2('0x12')][_0x6fe2('0x14')]);}else{logger[_0x6fe2('0xd')](_0x6fe2('0xe'),_0x3b1edb,_0x6fe2('0xf'));_0x396ae7(_0x49a68d[_0x6fe2('0x15')][_0x6fe2('0x14')]);}})[_0x6fe2('0x16')](function(_0x51f5f4){logger[_0x6fe2('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x3b1edb,_0x51f5f4);_0x1de3c3(_0x51f5f4);});});}exports[_0x6fe2('0x17')]=function(_0x459972){var _0x27e5df=this;return new Promise(function(_0x5e35d9,_0x5ed6ed){return db['CmHopperBlack'][_0x6fe2('0x18')]({'raw':_0x459972[_0x6fe2('0x19')]?_0x459972[_0x6fe2('0x19')][_0x6fe2('0x1a')]===undefined?!![]:![]:!![],'where':_0x459972[_0x6fe2('0x19')]?_0x459972[_0x6fe2('0x19')]['where']||null:null,'attributes':_0x459972[_0x6fe2('0x19')]?_0x459972[_0x6fe2('0x19')][_0x6fe2('0x1b')]||null:null,'limit':_0x459972[_0x6fe2('0x19')]?_0x459972['options']['limit']||null:null,'include':_0x459972[_0x6fe2('0x19')]?_0x459972['options'][_0x6fe2('0x1c')]?_['map'](_0x459972[_0x6fe2('0x19')]['include'],function(_0x3fdbfc){return{'model':db[_0x3fdbfc['model']],'as':_0x3fdbfc['as'],'attributes':_0x3fdbfc[_0x6fe2('0x1b')],'include':_0x3fdbfc[_0x6fe2('0x1c')]?_[_0x6fe2('0x1d')](_0x3fdbfc[_0x6fe2('0x1c')],function(_0x17ecd4){return{'model':db[_0x17ecd4['model']],'as':_0x17ecd4['as'],'attributes':_0x17ecd4[_0x6fe2('0x1b')],'include':_0x17ecd4[_0x6fe2('0x1c')]?_['map'](_0x17ecd4[_0x6fe2('0x1c')],function(_0x23cde5){return{'model':db[_0x23cde5[_0x6fe2('0x1e')]],'as':_0x23cde5['as'],'attributes':_0x23cde5[_0x6fe2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6fe2('0xc')](function(_0x10b5ac){logger['info'](_0x6fe2('0x17'),_0x459972);logger[_0x6fe2('0x10')](_0x6fe2('0x17'),_0x459972,JSON[_0x6fe2('0x11')](_0x10b5ac));_0x5e35d9(_0x10b5ac);})[_0x6fe2('0x16')](function(_0x2fab75){logger[_0x6fe2('0x12')](_0x6fe2('0x17'),_0x2fab75[_0x6fe2('0x14')],_0x459972);_0x5ed6ed(_0x27e5df['error'](0x1f4,_0x2fab75[_0x6fe2('0x14')]));});});};exports[_0x6fe2('0x1f')]=function(_0x133b48){var _0x197e91=this;return new Promise(function(_0x328ac7,_0x2d81d8){return db[_0x6fe2('0x20')]['update'](_0x133b48[_0x6fe2('0x21')],{'raw':_0x133b48['options']?_0x133b48['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x133b48[_0x6fe2('0x19')]?_0x133b48[_0x6fe2('0x19')]['where']||null:null,'attributes':_0x133b48[_0x6fe2('0x19')]?_0x133b48[_0x6fe2('0x19')]['attributes']||null:null,'limit':_0x133b48[_0x6fe2('0x19')]?_0x133b48['options'][_0x6fe2('0x22')]||null:null})[_0x6fe2('0xc')](function(_0xc117e5){logger[_0x6fe2('0xd')]('UpdateCmHopperBlack',_0x133b48);logger[_0x6fe2('0x10')](_0x6fe2('0x1f'),_0x133b48,JSON[_0x6fe2('0x11')](_0xc117e5));_0x328ac7(_0xc117e5);})[_0x6fe2('0x16')](function(_0x548b2b){logger['error'](_0x6fe2('0x1f'),_0x548b2b['message'],_0x133b48);_0x2d81d8(_0x197e91['error'](0x1f4,_0x548b2b[_0x6fe2('0x14')]));});});};exports[_0x6fe2('0x23')]=function(_0x28c997){var _0x47581b=this;return new Promise(function(_0x28422a,_0x35c188){return db['CmHopperBlack'][_0x6fe2('0x24')]({'where':_0x28c997['options']?_0x28c997[_0x6fe2('0x19')][_0x6fe2('0x25')]||null:null})[_0x6fe2('0xc')](function(_0x52c812){logger[_0x6fe2('0xd')](_0x6fe2('0x23'),_0x28c997);logger[_0x6fe2('0x10')](_0x6fe2('0x23'),_0x28c997,JSON['stringify'](_0x52c812));_0x28422a(_0x52c812);})[_0x6fe2('0x16')](function(_0x300e55){logger[_0x6fe2('0x12')]('DestroyCmHopperBlack',_0x300e55[_0x6fe2('0x14')],_0x28c997);_0x35c188(_0x47581b[_0x6fe2('0x12')](0x1f4,_0x300e55[_0x6fe2('0x14')]));});});}; \ No newline at end of file +var _0xe8dc=['map','debug','stringify','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','model'];(function(_0x580e8f,_0x31f656){var _0x6c6bcd=function(_0x1f7f7f){while(--_0x1f7f7f){_0x580e8f['push'](_0x580e8f['shift']());}};_0x6c6bcd(++_0x31f656);}(_0xe8dc,0x1d5));var _0xce8d=function(_0x426076,_0xfdf5d2){_0x426076=_0x426076-0x0;var _0x1e9565=_0xe8dc[_0x426076];return _0x1e9565;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xce8d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce8d('0x1'));var db=require(_0xce8d('0x2'))['db'];var utils=require(_0xce8d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xce8d('0x4'));var jayson=require(_0xce8d('0x5'));var client=jayson[_0xce8d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x227bfa,_0x148209,_0x12cfb4){return new BPromise(function(_0x521040,_0x2dc943){return client[_0xce8d('0x7')](_0x227bfa,_0x12cfb4)[_0xce8d('0x8')](function(_0x4b4c2a){logger['info'](_0xce8d('0x9'),_0x148209,_0xce8d('0xa'));logger['debug'](_0xce8d('0xb'),_0x148209,_0xce8d('0xa'),JSON['stringify'](_0x4b4c2a));if(_0x4b4c2a[_0xce8d('0xc')]){if(_0x4b4c2a['error']['code']===0x1f4){logger[_0xce8d('0xc')](_0xce8d('0x9'),_0x148209,_0x4b4c2a[_0xce8d('0xc')][_0xce8d('0xd')]);return _0x2dc943(_0x4b4c2a['error']['message']);}logger[_0xce8d('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x148209,_0x4b4c2a[_0xce8d('0xc')]['message']);return _0x521040(_0x4b4c2a[_0xce8d('0xc')]['message']);}else{logger[_0xce8d('0xe')](_0xce8d('0x9'),_0x148209,'request\x20sent');_0x521040(_0x4b4c2a[_0xce8d('0xf')][_0xce8d('0xd')]);}})[_0xce8d('0x10')](function(_0x23beac){logger['error'](_0xce8d('0x9'),_0x148209,_0x23beac);_0x2dc943(_0x23beac);});});}exports[_0xce8d('0x11')]=function(_0x2bdbf6){var _0x32e623=this;return new Promise(function(_0x31cbfe,_0x1c55fe){return db[_0xce8d('0x12')]['findAll']({'raw':_0x2bdbf6[_0xce8d('0x13')]?_0x2bdbf6[_0xce8d('0x13')][_0xce8d('0x14')]===undefined?!![]:![]:!![],'where':_0x2bdbf6[_0xce8d('0x13')]?_0x2bdbf6[_0xce8d('0x13')][_0xce8d('0x15')]||null:null,'attributes':_0x2bdbf6[_0xce8d('0x13')]?_0x2bdbf6[_0xce8d('0x13')][_0xce8d('0x16')]||null:null,'limit':_0x2bdbf6[_0xce8d('0x13')]?_0x2bdbf6[_0xce8d('0x13')][_0xce8d('0x17')]||null:null,'include':_0x2bdbf6[_0xce8d('0x13')]?_0x2bdbf6[_0xce8d('0x13')][_0xce8d('0x18')]?_['map'](_0x2bdbf6['options'][_0xce8d('0x18')],function(_0x2244e4){return{'model':db[_0x2244e4[_0xce8d('0x19')]],'as':_0x2244e4['as'],'attributes':_0x2244e4[_0xce8d('0x16')],'include':_0x2244e4['include']?_[_0xce8d('0x1a')](_0x2244e4[_0xce8d('0x18')],function(_0x5c5fb8){return{'model':db[_0x5c5fb8['model']],'as':_0x5c5fb8['as'],'attributes':_0x5c5fb8['attributes'],'include':_0x5c5fb8['include']?_[_0xce8d('0x1a')](_0x5c5fb8[_0xce8d('0x18')],function(_0x2b795c){return{'model':db[_0x2b795c['model']],'as':_0x2b795c['as'],'attributes':_0x2b795c[_0xce8d('0x16')]};}):[]};}):[]};}):[]:[]})[_0xce8d('0x8')](function(_0x2f0f36){logger[_0xce8d('0xe')](_0xce8d('0x11'),_0x2bdbf6);logger[_0xce8d('0x1b')](_0xce8d('0x11'),_0x2bdbf6,JSON[_0xce8d('0x1c')](_0x2f0f36));_0x31cbfe(_0x2f0f36);})[_0xce8d('0x10')](function(_0x7fb9fc){logger['error'](_0xce8d('0x11'),_0x7fb9fc['message'],_0x2bdbf6);_0x1c55fe(_0x32e623[_0xce8d('0xc')](0x1f4,_0x7fb9fc[_0xce8d('0xd')]));});});};exports[_0xce8d('0x1d')]=function(_0x179c2a){var _0x116fd0=this;return new Promise(function(_0x189134,_0x282cc0){return db[_0xce8d('0x12')][_0xce8d('0x1e')](_0x179c2a[_0xce8d('0x1f')],{'raw':_0x179c2a[_0xce8d('0x13')]?_0x179c2a[_0xce8d('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x179c2a[_0xce8d('0x13')]?_0x179c2a[_0xce8d('0x13')][_0xce8d('0x15')]||null:null,'attributes':_0x179c2a[_0xce8d('0x13')]?_0x179c2a[_0xce8d('0x13')][_0xce8d('0x16')]||null:null,'limit':_0x179c2a[_0xce8d('0x13')]?_0x179c2a[_0xce8d('0x13')][_0xce8d('0x17')]||null:null})['then'](function(_0x248988){logger['info'](_0xce8d('0x1d'),_0x179c2a);logger[_0xce8d('0x1b')](_0xce8d('0x1d'),_0x179c2a,JSON['stringify'](_0x248988));_0x189134(_0x248988);})[_0xce8d('0x10')](function(_0x3f6451){logger[_0xce8d('0xc')]('UpdateCmHopperBlack',_0x3f6451['message'],_0x179c2a);_0x282cc0(_0x116fd0['error'](0x1f4,_0x3f6451[_0xce8d('0xd')]));});});};exports[_0xce8d('0x20')]=function(_0x3ac43a){var _0x9bda4b=this;return new Promise(function(_0xe0dec9,_0x4d8a6b){return db[_0xce8d('0x12')]['destroy']({'where':_0x3ac43a[_0xce8d('0x13')]?_0x3ac43a[_0xce8d('0x13')][_0xce8d('0x15')]||null:null})[_0xce8d('0x8')](function(_0x81823c){logger[_0xce8d('0xe')](_0xce8d('0x20'),_0x3ac43a);logger['debug'](_0xce8d('0x20'),_0x3ac43a,JSON['stringify'](_0x81823c));_0xe0dec9(_0x81823c);})[_0xce8d('0x10')](function(_0x33f0bd){logger[_0xce8d('0xc')](_0xce8d('0x20'),_0x33f0bd['message'],_0x3ac43a);_0x4d8a6b(_0x9bda4b['error'](0x1f4,_0x33f0bd[_0xce8d('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 43c3a7b..b62c16f 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 _0x24ca=['describe','/:id','show','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe'];(function(_0x47fe16,_0x3f4938){var _0x6b37b9=function(_0x4cd752){while(--_0x4cd752){_0x47fe16['push'](_0x47fe16['shift']());}};_0x6b37b9(++_0x3f4938);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0x24ca[_0x2b0bc2];return _0x56e5b9;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var auth=require(_0xa24c('0x4'));var interaction=require(_0xa24c('0x5'));var config=require(_0xa24c('0x6'));var controller=require(_0xa24c('0x7'));router[_0xa24c('0x8')]('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xa')]);router[_0xa24c('0x8')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xc')]);router['get'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xe')]);router['put'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x11')]);module[_0xa24c('0x12')]=router; \ No newline at end of file +var _0xa8a8=['index','/describe','describe','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0x221637,_0x42a5e0){var _0x11bf9e=function(_0xbc416e){while(--_0xbc416e){_0x221637['push'](_0x221637['shift']());}};_0x11bf9e(++_0x42a5e0);}(_0xa8a8,0xec));var _0x8a8a=function(_0x3edaed,_0x1384e8){_0x3edaed=_0x3edaed-0x0;var _0x149fa8=_0xa8a8[_0x3edaed];return _0x149fa8;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var auth=require(_0x8a8a('0x5'));var interaction=require(_0x8a8a('0x6'));var config=require(_0x8a8a('0x7'));var controller=require(_0x8a8a('0x8'));router[_0x8a8a('0x9')]('/',auth[_0x8a8a('0xa')](),controller[_0x8a8a('0xb')]);router[_0x8a8a('0x9')](_0x8a8a('0xc'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0xd')]);router[_0x8a8a('0x9')](_0x8a8a('0xe'),auth[_0x8a8a('0xa')](),controller['show']);router['put'](_0x8a8a('0xe'),auth['isAuthenticated'](),controller[_0x8a8a('0xf')]);router[_0x8a8a('0x10')]('/:id',auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x11')]);module[_0x8a8a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 8a96998..e95e808 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 _0x8aae=['dispositionat','BOOLEAN','sequelize','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x8aae,0x120));var _0xe8aa=function(_0x30adb5,_0x5b68fb){_0x30adb5=_0x30adb5-0x0;var _0x1fbe5e=_0x8aae[_0x30adb5];return _0x1fbe5e;};'use strict';var Sequelize=require(_0xe8aa('0x0'));var moment=require('moment');module[_0xe8aa('0x1')]={'state':{'type':Sequelize[_0xe8aa('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe8aa('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xe8aa('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe8aa('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe8aa('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe8aa('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe8aa('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe8aa('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xe8aa('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xe8aa('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe8aa('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xe8aa('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe8aa('0x3')]},'reason':{'type':Sequelize[_0xe8aa('0x3')]},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x15bb91){var _0x499964=this[_0xe8aa('0x5')](_0xe8aa('0x6'));if(_0x499964&&_0x15bb91){this[_0xe8aa('0x7')](_0xe8aa('0x8'),moment(_0x15bb91)[_0xe8aa('0x9')](moment(_0x499964),_0xe8aa('0xa')));}return this[_0xe8aa('0x7')](_0xe8aa('0xb'),_0x15bb91);}},'amd':{'type':Sequelize[_0xe8aa('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe8aa('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe8aa('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe8aa('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe8aa('0x4')]},'recallme':{'type':Sequelize[_0xe8aa('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe8aa('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe8aa('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe8aa('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe8aa('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe8aa('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7a60=['setDataValue','followuptime','diff','dispositionat','BOOLEAN','INTEGER','DATE','STRING','getDataValue'];(function(_0xb93b1c,_0x3d4bfb){var _0x49d261=function(_0x2b7f1d){while(--_0x2b7f1d){_0xb93b1c['push'](_0xb93b1c['shift']());}};_0x49d261(++_0x3d4bfb);}(_0x7a60,0x1be));var _0x07a6=function(_0x1d3d87,_0x205c07){_0x1d3d87=_0x1d3d87-0x0;var _0x1519d9=_0x7a60[_0x1d3d87];return _0x1519d9;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x07a6('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x07a6('0x1')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x07a6('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x07a6('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x07a6('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x07a6('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x07a6('0x2')]},'originatecalleridname':{'type':Sequelize[_0x07a6('0x2')]},'calleridnum':{'type':Sequelize[_0x07a6('0x2')]},'calleridname':{'type':Sequelize[_0x07a6('0x2')]},'starttime':{'type':Sequelize[_0x07a6('0x1')]},'responsetime':{'type':Sequelize[_0x07a6('0x1')]},'answertime':{'type':Sequelize[_0x07a6('0x1')]},'droptime':{'type':Sequelize[_0x07a6('0x1')]},'endtime':{'type':Sequelize[_0x07a6('0x1')]},'ringtime':{'type':Sequelize[_0x07a6('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x07a6('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x07a6('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x07a6('0x2')]},'campaign':{'type':Sequelize[_0x07a6('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x07a6('0x2')]},'disposition':{'type':Sequelize[_0x07a6('0x2')]},'dispositionat':{'type':Sequelize[_0x07a6('0x1')],'set':function(_0x3f0860){var _0x4b6227=this[_0x07a6('0x3')]('endtime');if(_0x4b6227&&_0x3f0860){this[_0x07a6('0x4')](_0x07a6('0x5'),moment(_0x3f0860)[_0x07a6('0x6')](moment(_0x4b6227),'seconds'));}return this[_0x07a6('0x4')](_0x07a6('0x7'),_0x3f0860);}},'amd':{'type':Sequelize[_0x07a6('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x07a6('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x07a6('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x07a6('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x07a6('0x1')]},'callback':{'type':Sequelize[_0x07a6('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x07a6('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x07a6('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x07a6('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x07a6('0x1')]},'countnosuchnumberretry':{'type':Sequelize[_0x07a6('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x07a6('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 90aedb9..6d413f0 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 _0x29ea=['select','field','ANY_VALUE(calleridnum)','phone','NOW()','scheduledAt','ANY_VALUE(ListId)','ListId','createdAt','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','find','describe','body','uniqueid','catch','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','ContactId','VoiceQueueId','updatedAt'];(function(_0x36e018,_0x5f3991){var _0x49b479=function(_0x38a895){while(--_0x38a895){_0x36e018['push'](_0x36e018['shift']());}};_0x49b479(++_0x5f3991);}(_0x29ea,0x197));var _0xa29e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x29ea[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xa29e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa29e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa29e('0x2'));var rp=require(_0xa29e('0x3'));var moment=require(_0xa29e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa29e('0x5'));var util=require(_0xa29e('0x6'));var path=require(_0xa29e('0x7'));var sox=require('sox');var csv=require(_0xa29e('0x8'));var ejs=require(_0xa29e('0x9'));var fs=require('fs');var _=require(_0xa29e('0xa'));var squel=require(_0xa29e('0xb'));var crypto=require('crypto');var jsforce=require(_0xa29e('0xc'));var deskjs=require(_0xa29e('0xd'));var toCsv=require(_0xa29e('0x8'));var querystring=require(_0xa29e('0xe'));var Papa=require(_0xa29e('0xf'));var Redis=require(_0xa29e('0x10'));var authService=require(_0xa29e('0x11'));var qs=require(_0xa29e('0x12'));var as=require(_0xa29e('0x13'));var hardwareService=require(_0xa29e('0x14'));var logger=require(_0xa29e('0x15'))(_0xa29e('0x16'));var utils=require(_0xa29e('0x17'));var config=require(_0xa29e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfe0576,_0x41b115){_0x41b115=_0x41b115||0xcc;return function(_0x51cc80){if(_0x51cc80){return _0xfe0576[_0xa29e('0x19')](_0x41b115);}return _0xfe0576[_0xa29e('0x1a')](_0x41b115)[_0xa29e('0x1b')]();};}function respondWithResult(_0x4b355a,_0x489588){_0x489588=_0x489588||0xc8;return function(_0x12348a){if(_0x12348a){return _0x4b355a[_0xa29e('0x1a')](_0x489588)[_0xa29e('0x1c')](_0x12348a);}};}function respondWithFilteredResult(_0x2dc20f,_0x5e4fa8){return function(_0x16d5b7){if(_0x16d5b7){var _0x447b3e=_0x16d5b7['count'],_0x227f7b=_0x5e4fa8[_0xa29e('0x1d')],_0x59ec79=_0x5e4fa8[_0xa29e('0x1d')]+_0x5e4fa8[_0xa29e('0x1e')],_0x2cb60e;if(_0x59ec79>=_0x447b3e){_0x59ec79=_0x447b3e;_0x2cb60e=0xc8;}else{_0x2cb60e=0xce;}_0x2dc20f[_0xa29e('0x1a')](_0x2cb60e);return _0x2dc20f[_0xa29e('0x1f')](_0xa29e('0x20'),_0x227f7b+'-'+_0x59ec79+'/'+_0x447b3e)[_0xa29e('0x1c')](_0x16d5b7);}return null;};}function patchUpdates(_0x1cbb2a){return function(_0x8f5c8c){try{jsonpatch[_0xa29e('0x21')](_0x8f5c8c,_0x1cbb2a,!![]);}catch(_0x1054d0){return BPromise[_0xa29e('0x22')](_0x1054d0);}return _0x8f5c8c[_0xa29e('0x23')]();};}function saveUpdates(_0x1c1096,_0x5dbbef){return function(_0x25567b){if(_0x25567b){return _0x25567b[_0xa29e('0x24')](_0x1c1096)[_0xa29e('0x25')](function(_0x12392d){return _0x12392d;});}return null;};}function removeEntity(_0x5a8e26,_0x2bfd47){return function(_0x3aea67){if(_0x3aea67){return _0x3aea67['destroy']()['then'](function(){_0x5a8e26[_0xa29e('0x1a')](0xcc)[_0xa29e('0x1b')]();});}};}function handleEntityNotFound(_0x11cd48,_0x1c9ff6){return function(_0x3b2ff7){if(!_0x3b2ff7){_0x11cd48[_0xa29e('0x19')](0x194);}return _0x3b2ff7;};}function handleError(_0x55044f,_0x400fa9){_0x400fa9=_0x400fa9||0x1f4;return function(_0x379801){logger[_0xa29e('0x26')](_0x379801[_0xa29e('0x27')]);if(_0x379801[_0xa29e('0x28')]){delete _0x379801[_0xa29e('0x28')];}_0x55044f['status'](_0x400fa9)['send'](_0x379801);};}exports[_0xa29e('0x29')]=function(_0x223ea9,_0x2aa10f){var _0x50f0dc={},_0xf0523d={},_0x10d2f8={'count':0x0,'rows':[]};var _0x3fc91d=_[_0xa29e('0x2a')](db[_0xa29e('0x2b')][_0xa29e('0x2c')],function(_0x5db5d3){return{'name':_0x5db5d3[_0xa29e('0x2d')],'type':_0x5db5d3['type']['key']};});_0xf0523d[_0xa29e('0x2e')]=_['map'](_0x3fc91d,_0xa29e('0x28'));_0xf0523d['query']=_[_0xa29e('0x2f')](_0x223ea9[_0xa29e('0x30')]);_0xf0523d[_0xa29e('0x31')]=_['intersection'](_0xf0523d['model'],_0xf0523d[_0xa29e('0x30')]);_0x50f0dc[_0xa29e('0x32')]=_[_0xa29e('0x33')](_0xf0523d[_0xa29e('0x2e')],qs[_0xa29e('0x34')](_0x223ea9[_0xa29e('0x30')][_0xa29e('0x34')]));_0x50f0dc[_0xa29e('0x32')]=_0x50f0dc['attributes'][_0xa29e('0x35')]?_0x50f0dc['attributes']:_0xf0523d[_0xa29e('0x2e')];if(!_0x223ea9[_0xa29e('0x30')][_0xa29e('0x36')](_0xa29e('0x37'))){_0x50f0dc[_0xa29e('0x1e')]=qs[_0xa29e('0x1e')](_0x223ea9['query'][_0xa29e('0x1e')]);_0x50f0dc[_0xa29e('0x1d')]=qs['offset'](_0x223ea9['query'][_0xa29e('0x1d')]);}_0x50f0dc[_0xa29e('0x38')]=qs[_0xa29e('0x39')](_0x223ea9[_0xa29e('0x30')][_0xa29e('0x39')]);_0x50f0dc[_0xa29e('0x3a')]=qs[_0xa29e('0x31')](_['pick'](_0x223ea9['query'],_0xf0523d['filters']));if(_0x223ea9[_0xa29e('0x30')][_0xa29e('0x3b')]){_0x50f0dc[_0xa29e('0x3a')]=_['merge'](_0x50f0dc[_0xa29e('0x3a')],{'$or':_[_0xa29e('0x2a')](_0x3fc91d,function(_0x5a218a){if(_0x5a218a[_0xa29e('0x3c')]!==_0xa29e('0x3d')){var _0x4449c5={};_0x4449c5[_0x5a218a[_0xa29e('0x28')]]={'$like':'%'+_0x223ea9[_0xa29e('0x30')]['filter']+'%'};return _0x4449c5;}})});}_0x50f0dc=_[_0xa29e('0x3e')]({},_0x50f0dc,_0x223ea9[_0xa29e('0x3f')]);var _0x484c69={'where':_0x50f0dc[_0xa29e('0x3a')]};return db[_0xa29e('0x2b')][_0xa29e('0x40')](_0x484c69)['then'](function(_0x203336){_0x10d2f8[_0xa29e('0x40')]=_0x203336;if(_0x223ea9[_0xa29e('0x30')][_0xa29e('0x41')]){_0x50f0dc[_0xa29e('0x42')]=[{'all':!![]}];}return db[_0xa29e('0x2b')]['findAll'](_0x50f0dc);})[_0xa29e('0x25')](function(_0x30ce3b){_0x10d2f8[_0xa29e('0x43')]=_0x30ce3b;return _0x10d2f8;})[_0xa29e('0x25')](respondWithFilteredResult(_0x2aa10f,_0x50f0dc))['catch'](handleError(_0x2aa10f,null));};exports[_0xa29e('0x44')]=function(_0x36be36,_0x485f2f){var _0xaa34ac={'raw':!![],'where':{'id':_0x36be36[_0xa29e('0x45')]['id']}},_0x13e5ef={};_0x13e5ef['model']=_[_0xa29e('0x2f')](db['CmHopperFinal'][_0xa29e('0x2c')]);_0x13e5ef[_0xa29e('0x30')]=_[_0xa29e('0x2f')](_0x36be36['query']);_0x13e5ef[_0xa29e('0x31')]=_[_0xa29e('0x33')](_0x13e5ef[_0xa29e('0x2e')],_0x13e5ef[_0xa29e('0x30')]);_0xaa34ac[_0xa29e('0x32')]=_[_0xa29e('0x33')](_0x13e5ef[_0xa29e('0x2e')],qs[_0xa29e('0x34')](_0x36be36[_0xa29e('0x30')][_0xa29e('0x34')]));_0xaa34ac[_0xa29e('0x32')]=_0xaa34ac['attributes']['length']?_0xaa34ac[_0xa29e('0x32')]:_0x13e5ef[_0xa29e('0x2e')];if(_0x36be36[_0xa29e('0x30')][_0xa29e('0x41')]){_0xaa34ac['include']=[{'all':!![]}];}_0xaa34ac=_['merge']({},_0xaa34ac,_0x36be36[_0xa29e('0x3f')]);return db[_0xa29e('0x2b')][_0xa29e('0x46')](_0xaa34ac)[_0xa29e('0x25')](handleEntityNotFound(_0x485f2f,null))[_0xa29e('0x25')](respondWithResult(_0x485f2f,null))['catch'](handleError(_0x485f2f,null));};exports[_0xa29e('0x47')]=function(_0x1ec221,_0x27c78c){return db['CmHopperFinal'][_0xa29e('0x47')]()[_0xa29e('0x25')](respondWithResult(_0x27c78c,null))['catch'](handleError(_0x27c78c,null));};exports[_0xa29e('0x24')]=function(_0x398a11,_0x545d15){if(_0x398a11[_0xa29e('0x48')][_0xa29e('0x49')]){delete _0x398a11[_0xa29e('0x48')][_0xa29e('0x49')];}return db[_0xa29e('0x2b')][_0xa29e('0x46')]({'where':{'uniqueid':_0x398a11[_0xa29e('0x45')]['id']}})[_0xa29e('0x25')](handleEntityNotFound(_0x545d15,null))[_0xa29e('0x25')](saveUpdates(_0x398a11[_0xa29e('0x48')],null))['then'](respondWithResult(_0x545d15,null))[_0xa29e('0x4a')](handleError(_0x545d15,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x4cc648,_0x17bb24,_0x29892d){return db[_0xa29e('0x2b')][_0xa29e('0x4b')]({'raw':![],'where':{'VoiceQueueId':_0x4cc648[_0xa29e('0x45')]['id']},'attributes':[[db[_0xa29e('0x4c')]['fn'](_0xa29e('0x4d'),db[_0xa29e('0x4c')]['fn']('IF',db[_0xa29e('0x4c')][_0xa29e('0x4e')](_0xa29e('0x4f')))),_0xa29e('0x50')],[db[_0xa29e('0x4c')]['fn'](_0xa29e('0x4d'),db[_0xa29e('0x4c')]['fn']('IF',db[_0xa29e('0x4c')][_0xa29e('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0xa29e('0x51')],[db['sequelize']['fn'](_0xa29e('0x4d'),db[_0xa29e('0x4c')]['fn']('IF',db[_0xa29e('0x4c')][_0xa29e('0x4e')]('`state`\x20=\x205,\x201,\x20null'))),_0xa29e('0x52')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa29e('0x4c')]['literal'](_0xa29e('0x53')))),'congestionContacts'],[db[_0xa29e('0x4c')]['fn'](_0xa29e('0x4d'),db[_0xa29e('0x4c')]['fn']('IF',db['sequelize'][_0xa29e('0x4e')](_0xa29e('0x54')))),_0xa29e('0x55')],[db[_0xa29e('0x4c')]['fn'](_0xa29e('0x4d'),db[_0xa29e('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xa29e('0x56')],[db['sequelize']['fn'](_0xa29e('0x4d'),db[_0xa29e('0x4c')]['fn']('IF',db[_0xa29e('0x4c')][_0xa29e('0x4e')](_0xa29e('0x57')))),_0xa29e('0x58')],[db[_0xa29e('0x4c')]['fn'](_0xa29e('0x4d'),db[_0xa29e('0x4c')]['fn']('IF',db[_0xa29e('0x4c')][_0xa29e('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0xa29e('0x59')]]})[_0xa29e('0x25')](handleEntityNotFound(_0x17bb24,null))[_0xa29e('0x25')](respondWithResult(_0x17bb24,null))['catch'](handleError(_0x17bb24,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x42b8e0,_0x40db36,_0x14eeab){return db['CmHopperFinal'][_0xa29e('0x4b')]({'raw':![],'where':{'CampaignId':_0x42b8e0[_0xa29e('0x45')]['id']},'attributes':[[db[_0xa29e('0x4c')]['fn'](_0xa29e('0x4d'),db[_0xa29e('0x4c')]['fn']('IF',db['sequelize']['literal'](_0xa29e('0x4f')))),_0xa29e('0x50')],[db['sequelize']['fn']('COUNT',db[_0xa29e('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xa29e('0x51')],[db[_0xa29e('0x4c')]['fn'](_0xa29e('0x4d'),db['sequelize']['fn']('IF',db[_0xa29e('0x4c')][_0xa29e('0x4e')](_0xa29e('0x5a')))),_0xa29e('0x52')],[db[_0xa29e('0x4c')]['fn'](_0xa29e('0x4d'),db[_0xa29e('0x4c')]['fn']('IF',db[_0xa29e('0x4c')][_0xa29e('0x4e')](_0xa29e('0x53')))),_0xa29e('0x5b')],[db['sequelize']['fn'](_0xa29e('0x4d'),db['sequelize']['fn']('IF',db[_0xa29e('0x4c')]['literal'](_0xa29e('0x54')))),_0xa29e('0x55')],[db[_0xa29e('0x4c')]['fn'](_0xa29e('0x4d'),db[_0xa29e('0x4c')]['fn']('IF',db[_0xa29e('0x4c')][_0xa29e('0x4e')](_0xa29e('0x5c')))),_0xa29e('0x56')],[db[_0xa29e('0x4c')]['fn'](_0xa29e('0x4d'),db[_0xa29e('0x4c')]['fn']('IF',db[_0xa29e('0x4c')][_0xa29e('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0xa29e('0x58')],[db[_0xa29e('0x4c')]['fn']('COUNT',db[_0xa29e('0x4c')]['fn']('IF',db[_0xa29e('0x4c')][_0xa29e('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0xa29e('0x59')]]})[_0xa29e('0x25')](handleEntityNotFound(_0x40db36,null))['then'](respondWithResult(_0x40db36,null))[_0xa29e('0x4a')](handleError(_0x40db36,null));};exports[_0xa29e('0x5d')]=function(_0x1c95b1,_0x2761f6,_0x58fc2a){return db[_0xa29e('0x5e')][_0xa29e('0x46')]({'where':{'id':_0x1c95b1[_0xa29e('0x45')]['id']}})[_0xa29e('0x25')](handleEntityNotFound(_0x2761f6,null))[_0xa29e('0x25')](function(_0x3326a1){var _0x1782c9;if(_0x3326a1){_0x1782c9=squel[_0xa29e('0x5f')]()[_0xa29e('0x60')](_0xa29e('0x61'))['fromQuery'](['phone','scheduledAt',_0xa29e('0x62'),'ListId',_0xa29e('0x63'),'createdAt',_0xa29e('0x64')],squel[_0xa29e('0x65')]()[_0xa29e('0x66')](_0xa29e('0x67'),_0xa29e('0x68'))[_0xa29e('0x66')](_0xa29e('0x69'),_0xa29e('0x6a'))[_0xa29e('0x66')]('ANY_VALUE(ContactId)',_0xa29e('0x62'))['field'](_0xa29e('0x6b'),_0xa29e('0x6c'))['field']('ANY_VALUE(VoiceQueueId)',_0xa29e('0x63'))[_0xa29e('0x66')](_0xa29e('0x69'),_0xa29e('0x6d'))[_0xa29e('0x66')]('NOW()',_0xa29e('0x64'))[_0xa29e('0x6e')](_0xa29e('0x6f'))[_0xa29e('0x3a')]('VoiceQueueId\x20=\x20?',_0x1c95b1['params']['id'][_0xa29e('0x70')]())[_0xa29e('0x3a')](_0xa29e('0x71'),_0x1c95b1[_0xa29e('0x48')][_0xa29e('0x72')][_0xa29e('0x70')]())['where'](_0xa29e('0x73'))[_0xa29e('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa29e('0x65')]()['field']('phone')[_0xa29e('0x6e')](_0xa29e('0x61'))['where']('VoiceQueueId\x20=\x20?',_0x1c95b1['params']['id'][_0xa29e('0x70')]()))['where'](_0xa29e('0x74'),squel[_0xa29e('0x65')]()[_0xa29e('0x66')](_0xa29e('0x75'))[_0xa29e('0x6e')](_0xa29e('0x6f'))[_0xa29e('0x3a')](_0xa29e('0x76'),_0x1c95b1[_0xa29e('0x45')]['id'][_0xa29e('0x70')]())[_0xa29e('0x3a')](_0xa29e('0x77')))[_0xa29e('0x78')](_0xa29e('0x62')))['toString']();return db[_0xa29e('0x4c')][_0xa29e('0x30')](_0x1782c9);}return[];})[_0xa29e('0x25')](respondWithResult(_0x2761f6,null))['catch'](handleError(_0x2761f6,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x23527c,_0x1737b8,_0x37d77b){return db['Campaign']['find']({'where':{'id':_0x23527c[_0xa29e('0x45')]['id']}})[_0xa29e('0x25')](handleEntityNotFound(_0x1737b8,null))['then'](function(_0x1a2a20){var _0x3ddad4;if(_0x1a2a20){_0x3ddad4=squel[_0xa29e('0x5f')]()[_0xa29e('0x60')](_0xa29e('0x61'))['fromQuery']([_0xa29e('0x68'),'scheduledAt',_0xa29e('0x62'),_0xa29e('0x6c'),'CampaignId',_0xa29e('0x6d'),'updatedAt'],squel[_0xa29e('0x65')]()[_0xa29e('0x66')]('ANY_VALUE(calleridnum)',_0xa29e('0x68'))[_0xa29e('0x66')](_0xa29e('0x69'),'scheduledAt')[_0xa29e('0x66')]('ANY_VALUE(ContactId)','ContactId')[_0xa29e('0x66')]('ANY_VALUE(ListId)',_0xa29e('0x6c'))['field'](_0xa29e('0x79'),_0xa29e('0x7a'))[_0xa29e('0x66')](_0xa29e('0x69'),_0xa29e('0x6d'))[_0xa29e('0x66')](_0xa29e('0x69'),_0xa29e('0x64'))[_0xa29e('0x6e')]('cm_hopper_final')[_0xa29e('0x3a')](_0xa29e('0x7b'),_0x23527c['params']['id']['toString']())['where']('state\x20=\x20?',_0x23527c[_0xa29e('0x48')][_0xa29e('0x72')][_0xa29e('0x70')]())[_0xa29e('0x3a')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xa29e('0x3a')](_0xa29e('0x74'),squel['select']()[_0xa29e('0x66')](_0xa29e('0x68'))[_0xa29e('0x6e')](_0xa29e('0x61'))[_0xa29e('0x3a')](_0xa29e('0x7b'),_0x23527c['params']['id'][_0xa29e('0x70')]()))[_0xa29e('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa29e('0x65')]()['field'](_0xa29e('0x75'))[_0xa29e('0x6e')](_0xa29e('0x6f'))['where'](_0xa29e('0x7b'),_0x23527c[_0xa29e('0x45')]['id']['toString']())[_0xa29e('0x3a')]('state\x20=\x204'))[_0xa29e('0x78')](_0xa29e('0x62')))['toString']();return db['sequelize'][_0xa29e('0x30')](_0x3ddad4);}return[];})['then'](respondWithResult(_0x1737b8,null))['catch'](handleError(_0x1737b8,null));};exports[_0xa29e('0x7c')]=function(_0x3d8826,_0x4ff7b5,_0x4312d2){return db[_0xa29e('0x7d')][_0xa29e('0x7e')]({'where':{'VoiceQueueId':_0x3d8826[_0xa29e('0x48')]['VoiceQueueId'],'CampaignId':_0x3d8826[_0xa29e('0x48')][_0xa29e('0x7a')],'ContactId':_0x3d8826[_0xa29e('0x48')][_0xa29e('0x62')]}})[_0xa29e('0x25')](handleEntityNotFound(_0x4ff7b5,null))[_0xa29e('0x25')](function(_0x261095){if(_0x261095){return _0x261095;}return null;})[_0xa29e('0x25')](respondWithResult(_0x4ff7b5,null))[_0xa29e('0x4a')](handleError(_0x4ff7b5,null));}; \ No newline at end of file +var _0xf2a5=['NOW()','scheduledAt','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','select','calleridnum','cm_hopper_final','group','CampaignId','state\x20=\x204','checkContactHopper','CmHopper','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','CmHopperFinal','rawAttributes','type','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','params','length','find','describe','update','uniqueid','body','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)'];(function(_0x4dacfd,_0x30056d){var _0x2ae9b0=function(_0x2b075a){while(--_0x2b075a){_0x4dacfd['push'](_0x4dacfd['shift']());}};_0x2ae9b0(++_0x30056d);}(_0xf2a5,0x17f));var _0x5f2a=function(_0x58ec21,_0x1bba20){_0x58ec21=_0x58ec21-0x0;var _0x4f7e55=_0xf2a5[_0x58ec21];return _0x4f7e55;};'use strict';var pdf=require(_0x5f2a('0x0'));var emlformat=require(_0x5f2a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5f2a('0x2'));var jsonpatch=require(_0x5f2a('0x3'));var rp=require('request-promise');var moment=require(_0x5f2a('0x4'));var BPromise=require(_0x5f2a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5f2a('0x6'));var sox=require(_0x5f2a('0x7'));var csv=require(_0x5f2a('0x8'));var ejs=require(_0x5f2a('0x9'));var fs=require('fs');var _=require(_0x5f2a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5f2a('0xb'));var deskjs=require(_0x5f2a('0xc'));var toCsv=require(_0x5f2a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5f2a('0xd'));var qs=require(_0x5f2a('0xe'));var as=require(_0x5f2a('0xf'));var hardwareService=require(_0x5f2a('0x10'));var logger=require('../../config/logger')(_0x5f2a('0x11'));var utils=require(_0x5f2a('0x12'));var config=require(_0x5f2a('0x13'));var db=require(_0x5f2a('0x14'))['db'];function respondWithStatusCode(_0x4d0580,_0x235da4){_0x235da4=_0x235da4||0xcc;return function(_0x23e2fc){if(_0x23e2fc){return _0x4d0580['sendStatus'](_0x235da4);}return _0x4d0580[_0x5f2a('0x15')](_0x235da4)[_0x5f2a('0x16')]();};}function respondWithResult(_0x4454a6,_0x2798d4){_0x2798d4=_0x2798d4||0xc8;return function(_0x36cbdb){if(_0x36cbdb){return _0x4454a6[_0x5f2a('0x15')](_0x2798d4)[_0x5f2a('0x17')](_0x36cbdb);}};}function respondWithFilteredResult(_0x46fb2c,_0xa7bcc1){return function(_0x3ad3bc){if(_0x3ad3bc){var _0x52352f=_0x3ad3bc[_0x5f2a('0x18')],_0x428204=_0xa7bcc1[_0x5f2a('0x19')],_0x11398b=_0xa7bcc1[_0x5f2a('0x19')]+_0xa7bcc1[_0x5f2a('0x1a')],_0x25d2b5;if(_0x11398b>=_0x52352f){_0x11398b=_0x52352f;_0x25d2b5=0xc8;}else{_0x25d2b5=0xce;}_0x46fb2c[_0x5f2a('0x15')](_0x25d2b5);return _0x46fb2c[_0x5f2a('0x1b')](_0x5f2a('0x1c'),_0x428204+'-'+_0x11398b+'/'+_0x52352f)[_0x5f2a('0x17')](_0x3ad3bc);}return null;};}function patchUpdates(_0x46b3bd){return function(_0x114c98){try{jsonpatch[_0x5f2a('0x1d')](_0x114c98,_0x46b3bd,!![]);}catch(_0x2f6768){return BPromise[_0x5f2a('0x1e')](_0x2f6768);}return _0x114c98[_0x5f2a('0x1f')]();};}function saveUpdates(_0xeed823,_0x237769){return function(_0x213547){if(_0x213547){return _0x213547['update'](_0xeed823)[_0x5f2a('0x20')](function(_0x1e22c2){return _0x1e22c2;});}return null;};}function removeEntity(_0x344647,_0x659ed5){return function(_0xa9604f){if(_0xa9604f){return _0xa9604f['destroy']()[_0x5f2a('0x20')](function(){_0x344647[_0x5f2a('0x15')](0xcc)[_0x5f2a('0x16')]();});}};}function handleEntityNotFound(_0x4c64cb,_0x383374){return function(_0x3c2f71){if(!_0x3c2f71){_0x4c64cb[_0x5f2a('0x21')](0x194);}return _0x3c2f71;};}function handleError(_0x302a8f,_0x33ce70){_0x33ce70=_0x33ce70||0x1f4;return function(_0xddbf3a){logger[_0x5f2a('0x22')](_0xddbf3a[_0x5f2a('0x23')]);if(_0xddbf3a[_0x5f2a('0x24')]){delete _0xddbf3a[_0x5f2a('0x24')];}_0x302a8f[_0x5f2a('0x15')](_0x33ce70)[_0x5f2a('0x25')](_0xddbf3a);};}exports[_0x5f2a('0x26')]=function(_0x25e6b1,_0x58a1fc){var _0x5f3d46={},_0x4add98={},_0x2e2b2d={'count':0x0,'rows':[]};var _0x5b6049=_['map'](db[_0x5f2a('0x27')][_0x5f2a('0x28')],function(_0x3d26c3){return{'name':_0x3d26c3['fieldName'],'type':_0x3d26c3[_0x5f2a('0x29')]['key']};});_0x4add98['model']=_[_0x5f2a('0x2a')](_0x5b6049,_0x5f2a('0x24'));_0x4add98[_0x5f2a('0x2b')]=_[_0x5f2a('0x2c')](_0x25e6b1[_0x5f2a('0x2b')]);_0x4add98[_0x5f2a('0x2d')]=_[_0x5f2a('0x2e')](_0x4add98['model'],_0x4add98[_0x5f2a('0x2b')]);_0x5f3d46[_0x5f2a('0x2f')]=_['intersection'](_0x4add98[_0x5f2a('0x30')],qs[_0x5f2a('0x31')](_0x25e6b1[_0x5f2a('0x2b')][_0x5f2a('0x31')]));_0x5f3d46[_0x5f2a('0x2f')]=_0x5f3d46[_0x5f2a('0x2f')]['length']?_0x5f3d46[_0x5f2a('0x2f')]:_0x4add98[_0x5f2a('0x30')];if(!_0x25e6b1[_0x5f2a('0x2b')][_0x5f2a('0x32')](_0x5f2a('0x33'))){_0x5f3d46[_0x5f2a('0x1a')]=qs[_0x5f2a('0x1a')](_0x25e6b1[_0x5f2a('0x2b')][_0x5f2a('0x1a')]);_0x5f3d46[_0x5f2a('0x19')]=qs['offset'](_0x25e6b1[_0x5f2a('0x2b')][_0x5f2a('0x19')]);}_0x5f3d46['order']=qs[_0x5f2a('0x34')](_0x25e6b1['query']['sort']);_0x5f3d46[_0x5f2a('0x35')]=qs['filters'](_[_0x5f2a('0x36')](_0x25e6b1[_0x5f2a('0x2b')],_0x4add98[_0x5f2a('0x2d')]));if(_0x25e6b1[_0x5f2a('0x2b')][_0x5f2a('0x37')]){_0x5f3d46[_0x5f2a('0x35')]=_['merge'](_0x5f3d46[_0x5f2a('0x35')],{'$or':_[_0x5f2a('0x2a')](_0x5b6049,function(_0x2b1f48){if(_0x2b1f48[_0x5f2a('0x29')]!=='VIRTUAL'){var _0xa6d2bc={};_0xa6d2bc[_0x2b1f48['name']]={'$like':'%'+_0x25e6b1[_0x5f2a('0x2b')][_0x5f2a('0x37')]+'%'};return _0xa6d2bc;}})});}_0x5f3d46=_['merge']({},_0x5f3d46,_0x25e6b1[_0x5f2a('0x38')]);var _0x58a9d2={'where':_0x5f3d46[_0x5f2a('0x35')]};return db[_0x5f2a('0x27')][_0x5f2a('0x18')](_0x58a9d2)['then'](function(_0x1ca49e){_0x2e2b2d['count']=_0x1ca49e;if(_0x25e6b1[_0x5f2a('0x2b')][_0x5f2a('0x39')]){_0x5f3d46[_0x5f2a('0x3a')]=[{'all':!![]}];}return db[_0x5f2a('0x27')][_0x5f2a('0x3b')](_0x5f3d46);})[_0x5f2a('0x20')](function(_0x5093e){_0x2e2b2d[_0x5f2a('0x3c')]=_0x5093e;return _0x2e2b2d;})[_0x5f2a('0x20')](respondWithFilteredResult(_0x58a1fc,_0x5f3d46))[_0x5f2a('0x3d')](handleError(_0x58a1fc,null));};exports['show']=function(_0x56329e,_0x52ba81){var _0x2df030={'raw':!![],'where':{'id':_0x56329e[_0x5f2a('0x3e')]['id']}},_0xee8027={};_0xee8027[_0x5f2a('0x30')]=_[_0x5f2a('0x2c')](db[_0x5f2a('0x27')][_0x5f2a('0x28')]);_0xee8027['query']=_[_0x5f2a('0x2c')](_0x56329e[_0x5f2a('0x2b')]);_0xee8027[_0x5f2a('0x2d')]=_[_0x5f2a('0x2e')](_0xee8027['model'],_0xee8027['query']);_0x2df030[_0x5f2a('0x2f')]=_[_0x5f2a('0x2e')](_0xee8027[_0x5f2a('0x30')],qs[_0x5f2a('0x31')](_0x56329e[_0x5f2a('0x2b')][_0x5f2a('0x31')]));_0x2df030[_0x5f2a('0x2f')]=_0x2df030[_0x5f2a('0x2f')][_0x5f2a('0x3f')]?_0x2df030[_0x5f2a('0x2f')]:_0xee8027['model'];if(_0x56329e[_0x5f2a('0x2b')][_0x5f2a('0x39')]){_0x2df030['include']=[{'all':!![]}];}_0x2df030=_['merge']({},_0x2df030,_0x56329e[_0x5f2a('0x38')]);return db[_0x5f2a('0x27')][_0x5f2a('0x40')](_0x2df030)[_0x5f2a('0x20')](handleEntityNotFound(_0x52ba81,null))[_0x5f2a('0x20')](respondWithResult(_0x52ba81,null))[_0x5f2a('0x3d')](handleError(_0x52ba81,null));};exports[_0x5f2a('0x41')]=function(_0x5dedb8,_0xf36b9d){return db[_0x5f2a('0x27')][_0x5f2a('0x41')]()[_0x5f2a('0x20')](respondWithResult(_0xf36b9d,null))[_0x5f2a('0x3d')](handleError(_0xf36b9d,null));};exports[_0x5f2a('0x42')]=function(_0x1b186b,_0x4bfd82){if(_0x1b186b['body'][_0x5f2a('0x43')]){delete _0x1b186b[_0x5f2a('0x44')][_0x5f2a('0x43')];}return db[_0x5f2a('0x27')][_0x5f2a('0x40')]({'where':{'uniqueid':_0x1b186b['params']['id']}})['then'](handleEntityNotFound(_0x4bfd82,null))[_0x5f2a('0x20')](saveUpdates(_0x1b186b[_0x5f2a('0x44')],null))[_0x5f2a('0x20')](respondWithResult(_0x4bfd82,null))[_0x5f2a('0x3d')](handleError(_0x4bfd82,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x451bd5,_0x90aa5a,_0x2ca355){return db[_0x5f2a('0x27')][_0x5f2a('0x3b')]({'raw':![],'where':{'VoiceQueueId':_0x451bd5[_0x5f2a('0x3e')]['id']},'attributes':[[db['sequelize']['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db['sequelize'][_0x5f2a('0x47')](_0x5f2a('0x48')))),'noSuchContacts'],[db[_0x5f2a('0x46')]['fn']('COUNT',db[_0x5f2a('0x46')]['fn']('IF',db[_0x5f2a('0x46')][_0x5f2a('0x47')](_0x5f2a('0x49')))),_0x5f2a('0x4a')],[db[_0x5f2a('0x46')]['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db['sequelize'][_0x5f2a('0x47')](_0x5f2a('0x4b')))),_0x5f2a('0x4c')],[db[_0x5f2a('0x46')]['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db['sequelize'][_0x5f2a('0x47')](_0x5f2a('0x4d')))),'congestionContacts'],[db['sequelize']['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db[_0x5f2a('0x46')][_0x5f2a('0x47')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5f2a('0x4e')],[db[_0x5f2a('0x46')]['fn'](_0x5f2a('0x45'),db['sequelize']['fn']('IF',db[_0x5f2a('0x46')][_0x5f2a('0x47')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5f2a('0x4f')],[db[_0x5f2a('0x46')]['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db[_0x5f2a('0x46')][_0x5f2a('0x47')](_0x5f2a('0x50')))),_0x5f2a('0x51')],[db['sequelize']['fn'](_0x5f2a('0x45'),db['sequelize']['fn']('IF',db[_0x5f2a('0x46')][_0x5f2a('0x47')](_0x5f2a('0x52')))),'answeringMachine']]})[_0x5f2a('0x20')](handleEntityNotFound(_0x90aa5a,null))[_0x5f2a('0x20')](respondWithResult(_0x90aa5a,null))[_0x5f2a('0x3d')](handleError(_0x90aa5a,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x314e09,_0x52f6dd,_0x5eda0c){return db[_0x5f2a('0x27')][_0x5f2a('0x3b')]({'raw':![],'where':{'CampaignId':_0x314e09[_0x5f2a('0x3e')]['id']},'attributes':[[db[_0x5f2a('0x46')]['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db[_0x5f2a('0x46')][_0x5f2a('0x47')](_0x5f2a('0x48')))),_0x5f2a('0x53')],[db[_0x5f2a('0x46')]['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db[_0x5f2a('0x46')][_0x5f2a('0x47')](_0x5f2a('0x49')))),'noAnswerContacts'],[db[_0x5f2a('0x46')]['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db[_0x5f2a('0x46')]['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db['sequelize']['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db[_0x5f2a('0x46')][_0x5f2a('0x47')](_0x5f2a('0x4d')))),_0x5f2a('0x54')],[db[_0x5f2a('0x46')]['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db[_0x5f2a('0x46')][_0x5f2a('0x47')](_0x5f2a('0x55')))),'dropContacts'],[db[_0x5f2a('0x46')]['fn'](_0x5f2a('0x45'),db['sequelize']['fn']('IF',db['sequelize'][_0x5f2a('0x47')](_0x5f2a('0x56')))),_0x5f2a('0x4f')],[db[_0x5f2a('0x46')]['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db['sequelize'][_0x5f2a('0x47')](_0x5f2a('0x50')))),_0x5f2a('0x51')],[db[_0x5f2a('0x46')]['fn'](_0x5f2a('0x45'),db[_0x5f2a('0x46')]['fn']('IF',db[_0x5f2a('0x46')][_0x5f2a('0x47')](_0x5f2a('0x52')))),_0x5f2a('0x57')]]})[_0x5f2a('0x20')](handleEntityNotFound(_0x52f6dd,null))[_0x5f2a('0x20')](respondWithResult(_0x52f6dd,null))[_0x5f2a('0x3d')](handleError(_0x52f6dd,null));};exports[_0x5f2a('0x58')]=function(_0x14f962,_0x2ef3f6,_0x49e31f){return db[_0x5f2a('0x59')][_0x5f2a('0x40')]({'where':{'id':_0x14f962[_0x5f2a('0x3e')]['id']}})[_0x5f2a('0x20')](handleEntityNotFound(_0x2ef3f6,null))[_0x5f2a('0x20')](function(_0x54f81e){var _0x28349a;if(_0x54f81e){_0x28349a=squel[_0x5f2a('0x5a')]()[_0x5f2a('0x5b')](_0x5f2a('0x5c'))[_0x5f2a('0x5d')]([_0x5f2a('0x5e'),'scheduledAt','ContactId',_0x5f2a('0x5f'),_0x5f2a('0x60'),_0x5f2a('0x61'),_0x5f2a('0x62')],squel['select']()[_0x5f2a('0x63')](_0x5f2a('0x64'),_0x5f2a('0x5e'))['field'](_0x5f2a('0x65'),_0x5f2a('0x66'))[_0x5f2a('0x63')](_0x5f2a('0x67'),_0x5f2a('0x68'))[_0x5f2a('0x63')](_0x5f2a('0x69'),_0x5f2a('0x5f'))[_0x5f2a('0x63')](_0x5f2a('0x6a'),_0x5f2a('0x60'))['field'](_0x5f2a('0x65'),_0x5f2a('0x61'))[_0x5f2a('0x63')](_0x5f2a('0x65'),'updatedAt')[_0x5f2a('0x6b')]('cm_hopper_final')[_0x5f2a('0x35')]('VoiceQueueId\x20=\x20?',_0x14f962[_0x5f2a('0x3e')]['id'][_0x5f2a('0x6c')]())[_0x5f2a('0x35')]('state\x20=\x20?',_0x14f962['body'][_0x5f2a('0x6d')][_0x5f2a('0x6c')]())[_0x5f2a('0x35')](_0x5f2a('0x6e'))[_0x5f2a('0x35')](_0x5f2a('0x6f'),squel['select']()['field'](_0x5f2a('0x5e'))[_0x5f2a('0x6b')](_0x5f2a('0x5c'))[_0x5f2a('0x35')](_0x5f2a('0x70'),_0x14f962[_0x5f2a('0x3e')]['id'][_0x5f2a('0x6c')]()))[_0x5f2a('0x35')](_0x5f2a('0x6f'),squel[_0x5f2a('0x71')]()[_0x5f2a('0x63')](_0x5f2a('0x72'))['from'](_0x5f2a('0x73'))['where'](_0x5f2a('0x70'),_0x14f962[_0x5f2a('0x3e')]['id'][_0x5f2a('0x6c')]())['where']('state\x20=\x204'))[_0x5f2a('0x74')](_0x5f2a('0x68')))['toString']();return db[_0x5f2a('0x46')][_0x5f2a('0x2b')](_0x28349a);}return[];})['then'](respondWithResult(_0x2ef3f6,null))[_0x5f2a('0x3d')](handleError(_0x2ef3f6,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x2253f1,_0x1c965,_0xcaeaa3){return db['Campaign'][_0x5f2a('0x40')]({'where':{'id':_0x2253f1[_0x5f2a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1c965,null))['then'](function(_0x1b5837){var _0x58602e;if(_0x1b5837){_0x58602e=squel[_0x5f2a('0x5a')]()['into'](_0x5f2a('0x5c'))['fromQuery']([_0x5f2a('0x5e'),'scheduledAt',_0x5f2a('0x68'),'ListId',_0x5f2a('0x75'),_0x5f2a('0x61'),'updatedAt'],squel[_0x5f2a('0x71')]()['field'](_0x5f2a('0x64'),_0x5f2a('0x5e'))[_0x5f2a('0x63')](_0x5f2a('0x65'),_0x5f2a('0x66'))[_0x5f2a('0x63')]('ANY_VALUE(ContactId)',_0x5f2a('0x68'))['field']('ANY_VALUE(ListId)',_0x5f2a('0x5f'))[_0x5f2a('0x63')]('ANY_VALUE(CampaignId)',_0x5f2a('0x75'))[_0x5f2a('0x63')](_0x5f2a('0x65'),_0x5f2a('0x61'))['field'](_0x5f2a('0x65'),_0x5f2a('0x62'))[_0x5f2a('0x6b')](_0x5f2a('0x73'))[_0x5f2a('0x35')]('CampaignId\x20=\x20?',_0x2253f1[_0x5f2a('0x3e')]['id'][_0x5f2a('0x6c')]())['where']('state\x20=\x20?',_0x2253f1[_0x5f2a('0x44')][_0x5f2a('0x6d')][_0x5f2a('0x6c')]())['where'](_0x5f2a('0x6e'))[_0x5f2a('0x35')](_0x5f2a('0x6f'),squel['select']()['field'](_0x5f2a('0x5e'))['from'](_0x5f2a('0x5c'))[_0x5f2a('0x35')]('CampaignId\x20=\x20?',_0x2253f1['params']['id'][_0x5f2a('0x6c')]()))[_0x5f2a('0x35')](_0x5f2a('0x6f'),squel[_0x5f2a('0x71')]()['field'](_0x5f2a('0x72'))[_0x5f2a('0x6b')](_0x5f2a('0x73'))[_0x5f2a('0x35')]('CampaignId\x20=\x20?',_0x2253f1[_0x5f2a('0x3e')]['id'][_0x5f2a('0x6c')]())[_0x5f2a('0x35')](_0x5f2a('0x76')))['group'](_0x5f2a('0x68')))[_0x5f2a('0x6c')]();return db[_0x5f2a('0x46')]['query'](_0x58602e);}return[];})[_0x5f2a('0x20')](respondWithResult(_0x1c965,null))[_0x5f2a('0x3d')](handleError(_0x1c965,null));};exports[_0x5f2a('0x77')]=function(_0x450288,_0x57e9f0,_0x4c756c){return db[_0x5f2a('0x78')]['findOne']({'where':{'VoiceQueueId':_0x450288[_0x5f2a('0x44')][_0x5f2a('0x60')],'CampaignId':_0x450288[_0x5f2a('0x44')][_0x5f2a('0x75')],'ContactId':_0x450288[_0x5f2a('0x44')]['ContactId']}})[_0x5f2a('0x20')](handleEntityNotFound(_0x57e9f0,null))[_0x5f2a('0x20')](function(_0x72f196){if(_0x72f196){return _0x72f196;}return null;})[_0x5f2a('0x20')](respondWithResult(_0x57e9f0,null))[_0x5f2a('0x3d')](handleError(_0x57e9f0,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 1df311a..2b8c3b8 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 _0xd88b=['request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','moment'];(function(_0x7de071,_0x28a940){var _0xeeab19=function(_0x548358){while(--_0x548358){_0x7de071['push'](_0x7de071['shift']());}};_0xeeab19(++_0x28a940);}(_0xd88b,0xc0));var _0xbd88=function(_0x42cedc,_0x1c1a13){_0x42cedc=_0x42cedc-0x0;var _0x3fd57a=_0xd88b[_0x42cedc];return _0x3fd57a;};'use strict';var _=require(_0xbd88('0x0'));var util=require(_0xbd88('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbd88('0x2'));var BPromise=require('bluebird');var rp=require(_0xbd88('0x3'));var fs=require('fs');var path=require(_0xbd88('0x4'));var rimraf=require('rimraf');var config=require(_0xbd88('0x5'));var attributes=require(_0xbd88('0x6'));module[_0xbd88('0x7')]=function(_0x14e415,_0x2c41b1){return _0x14e415[_0xbd88('0x8')](_0xbd88('0x9'),attributes,{'tableName':_0xbd88('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xbd88('0xb')]},{'name':'uniqueid','fields':[_0xbd88('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc17e=['../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','moment','request-promise','path'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xc17e,0x7f));var _0xec17=function(_0x58aad3,_0x2a1647){_0x58aad3=_0x58aad3-0x0;var _0x2618d9=_0xc17e[_0x58aad3];return _0x2618d9;};'use strict';var _=require(_0xec17('0x0'));var util=require(_0xec17('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xec17('0x2'));var BPromise=require('bluebird');var rp=require(_0xec17('0x3'));var fs=require('fs');var path=require(_0xec17('0x4'));var rimraf=require('rimraf');var config=require(_0xec17('0x5'));var attributes=require(_0xec17('0x6'));module['exports']=function(_0x4e2af4,_0x2defef){return _0x4e2af4[_0xec17('0x7')](_0xec17('0x8'),attributes,{'tableName':_0xec17('0x9'),'paranoid':![],'indexes':[{'name':_0xec17('0xa'),'fields':[_0xec17('0xa')]},{'name':'uniqueid','fields':[_0xec17('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 3c042cf..e8f72a9 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 _0xab8d=['code','message','catch','CreateCmHopperFinal','body','options','raw','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1d6124,_0xc36076){var _0x2b7457=function(_0x5b510f){while(--_0x5b510f){_0x1d6124['push'](_0x1d6124['shift']());}};_0x2b7457(++_0xc36076);}(_0xab8d,0xbe));var _0xdab8=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xab8d[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xdab8('0x0'));var util=require(_0xdab8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdab8('0x2'));var fs=require('fs');var Redis=require(_0xdab8('0x3'));var db=require(_0xdab8('0x4'))['db'];var utils=require(_0xdab8('0x5'));var logger=require(_0xdab8('0x6'))(_0xdab8('0x7'));var config=require(_0xdab8('0x8'));var jayson=require(_0xdab8('0x9'));var client=jayson['client'][_0xdab8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48f7fa,_0x3040e2,_0x23a7aa){return new BPromise(function(_0x9099cd,_0x4a7a9f){return client['request'](_0x48f7fa,_0x23a7aa)['then'](function(_0xfa1fb7){logger[_0xdab8('0xb')](_0xdab8('0xc'),_0x3040e2,'request\x20sent');logger[_0xdab8('0xd')](_0xdab8('0xe'),_0x3040e2,_0xdab8('0xf'),JSON[_0xdab8('0x10')](_0xfa1fb7));if(_0xfa1fb7[_0xdab8('0x11')]){if(_0xfa1fb7[_0xdab8('0x11')][_0xdab8('0x12')]===0x1f4){logger['error'](_0xdab8('0xc'),_0x3040e2,_0xfa1fb7[_0xdab8('0x11')][_0xdab8('0x13')]);return _0x4a7a9f(_0xfa1fb7['error'][_0xdab8('0x13')]);}logger[_0xdab8('0x11')](_0xdab8('0xc'),_0x3040e2,_0xfa1fb7[_0xdab8('0x11')][_0xdab8('0x13')]);return _0x9099cd(_0xfa1fb7[_0xdab8('0x11')][_0xdab8('0x13')]);}else{logger[_0xdab8('0xb')](_0xdab8('0xc'),_0x3040e2,_0xdab8('0xf'));_0x9099cd(_0xfa1fb7['result'][_0xdab8('0x13')]);}})[_0xdab8('0x14')](function(_0x1dc3f7){logger[_0xdab8('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0x3040e2,_0x1dc3f7);_0x4a7a9f(_0x1dc3f7);});});}exports[_0xdab8('0x15')]=function(_0x2bc880){var _0x175ad7=this;return new Promise(function(_0x337cfb,_0x1bde1f){return db['CmHopperFinal']['create'](_0x2bc880[_0xdab8('0x16')],{'raw':_0x2bc880[_0xdab8('0x17')]?_0x2bc880[_0xdab8('0x17')][_0xdab8('0x18')]===undefined?!![]:![]:!![]})[_0xdab8('0x19')](function(_0x3a88d0){logger[_0xdab8('0xb')](_0xdab8('0x15'),_0x2bc880);logger[_0xdab8('0xd')](_0xdab8('0x15'),_0x2bc880,JSON[_0xdab8('0x10')](_0x3a88d0));_0x337cfb(_0x3a88d0);})[_0xdab8('0x14')](function(_0x5343f9){logger[_0xdab8('0x11')]('CreateCmHopperFinal',_0x5343f9[_0xdab8('0x13')],_0x2bc880);_0x1bde1f(_0x175ad7[_0xdab8('0x11')](0x1f4,_0x5343f9['message']));});});}; \ No newline at end of file +var _0xe01d=['http','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client'];(function(_0x1d08bc,_0x468085){var _0x2236b4=function(_0x58c9f4){while(--_0x58c9f4){_0x1d08bc['push'](_0x1d08bc['shift']());}};_0x2236b4(++_0x468085);}(_0xe01d,0x1c2));var _0xde01=function(_0x280966,_0x414a3a){_0x280966=_0x280966-0x0;var _0x5e6379=_0xe01d[_0x280966];return _0x5e6379;};'use strict';var _=require(_0xde01('0x0'));var util=require('util');var moment=require(_0xde01('0x1'));var BPromise=require(_0xde01('0x2'));var rs=require(_0xde01('0x3'));var fs=require('fs');var Redis=require(_0xde01('0x4'));var db=require(_0xde01('0x5'))['db'];var utils=require(_0xde01('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xde01('0x7'));var client=jayson[_0xde01('0x8')][_0xde01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfc08f3,_0x3f2872,_0x1cd33e){return new BPromise(function(_0x557d52,_0xa416aa){return client['request'](_0xfc08f3,_0x1cd33e)[_0xde01('0xa')](function(_0x5cacf6){logger[_0xde01('0xb')](_0xde01('0xc'),_0x3f2872,_0xde01('0xd'));logger[_0xde01('0xe')](_0xde01('0xf'),_0x3f2872,_0xde01('0xd'),JSON[_0xde01('0x10')](_0x5cacf6));if(_0x5cacf6[_0xde01('0x11')]){if(_0x5cacf6[_0xde01('0x11')]['code']===0x1f4){logger[_0xde01('0x11')](_0xde01('0xc'),_0x3f2872,_0x5cacf6[_0xde01('0x11')][_0xde01('0x12')]);return _0xa416aa(_0x5cacf6[_0xde01('0x11')][_0xde01('0x12')]);}logger['error'](_0xde01('0xc'),_0x3f2872,_0x5cacf6[_0xde01('0x11')][_0xde01('0x12')]);return _0x557d52(_0x5cacf6[_0xde01('0x11')][_0xde01('0x12')]);}else{logger[_0xde01('0xb')]('CmHopperFinal,\x20%s,\x20%s',_0x3f2872,_0xde01('0xd'));_0x557d52(_0x5cacf6[_0xde01('0x13')]['message']);}})[_0xde01('0x14')](function(_0x3578b2){logger[_0xde01('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0x3f2872,_0x3578b2);_0xa416aa(_0x3578b2);});});}exports[_0xde01('0x15')]=function(_0x2e5fe6){var _0x130c7b=this;return new Promise(function(_0x144ec9,_0x9b7ac8){return db[_0xde01('0x16')][_0xde01('0x17')](_0x2e5fe6[_0xde01('0x18')],{'raw':_0x2e5fe6[_0xde01('0x19')]?_0x2e5fe6[_0xde01('0x19')][_0xde01('0x1a')]===undefined?!![]:![]:!![]})[_0xde01('0xa')](function(_0x5672a8){logger[_0xde01('0xb')]('CreateCmHopperFinal',_0x2e5fe6);logger['debug']('CreateCmHopperFinal',_0x2e5fe6,JSON['stringify'](_0x5672a8));_0x144ec9(_0x5672a8);})[_0xde01('0x14')](function(_0xf5c0bd){logger['error'](_0xde01('0x15'),_0xf5c0bd[_0xde01('0x12')],_0x2e5fe6);_0x9b7ac8(_0x130c7b[_0xde01('0x11')](0x1f4,_0xf5c0bd[_0xde01('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 5e82357..06ea72e 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 _0x2456=['./cmHopperFinal.controller','isAuthenticated','index','/describe','get','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','exports','util','path','connect-timeout','express','../../config/environment'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0x2456,0x9c));var _0x6245=function(_0x47e3ba,_0x1ad1e5){_0x47e3ba=_0x47e3ba-0x0;var _0x12afa2=_0x2456[_0x47e3ba];return _0x12afa2;};'use strict';var multer=require('multer');var util=require(_0x6245('0x0'));var path=require(_0x6245('0x1'));var timeout=require(_0x6245('0x2'));var express=require(_0x6245('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6245('0x4'));var controller=require(_0x6245('0x5'));router['get']('/',auth[_0x6245('0x6')](),controller[_0x6245('0x7')]);router['get'](_0x6245('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x6245('0x9')](_0x6245('0xa'),auth['isAuthenticated'](),controller[_0x6245('0xb')]);router[_0x6245('0x9')](_0x6245('0xc'),auth[_0x6245('0x6')](),controller[_0x6245('0xd')]);router[_0x6245('0x9')](_0x6245('0xe'),auth[_0x6245('0x6')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x6245('0xf')](_0x6245('0x10'),auth[_0x6245('0x6')](),controller[_0x6245('0x11')]);router['post'](_0x6245('0x12'),auth['isAuthenticated'](),controller[_0x6245('0x13')]);router[_0x6245('0xf')]('/checkContactHopper',auth[_0x6245('0x6')](),controller[_0x6245('0x14')]);router['put'](_0x6245('0xa'),auth['isAuthenticated'](),controller[_0x6245('0x15')]);module[_0x6245('0x16')]=router; \ No newline at end of file +var _0x818f=['countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x3c30a0,_0x300766){var _0x2eed86=function(_0x154cce){while(--_0x154cce){_0x3c30a0['push'](_0x3c30a0['shift']());}};_0x2eed86(++_0x300766);}(_0x818f,0xe2));var _0xf818=function(_0x752cde,_0x24f1aa){_0x752cde=_0x752cde-0x0;var _0x505417=_0x818f[_0x752cde];return _0x505417;};'use strict';var multer=require('multer');var util=require(_0xf818('0x0'));var path=require(_0xf818('0x1'));var timeout=require(_0xf818('0x2'));var express=require(_0xf818('0x3'));var router=express['Router']();var auth=require(_0xf818('0x4'));var interaction=require(_0xf818('0x5'));var config=require(_0xf818('0x6'));var controller=require(_0xf818('0x7'));router[_0xf818('0x8')]('/',auth[_0xf818('0x9')](),controller['index']);router[_0xf818('0x8')](_0xf818('0xa'),auth[_0xf818('0x9')](),controller[_0xf818('0xb')]);router['get'](_0xf818('0xc'),auth['isAuthenticated'](),controller[_0xf818('0xd')]);router[_0xf818('0x8')]('/voice/queue/countAttributes/:id',auth[_0xf818('0x9')](),controller[_0xf818('0xe')]);router[_0xf818('0x8')]('/campaign/countAttributes/:id',auth[_0xf818('0x9')](),controller[_0xf818('0xf')]);router[_0xf818('0x10')](_0xf818('0x11'),auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xf818('0x10')](_0xf818('0x12'),auth['isAuthenticated'](),controller[_0xf818('0x13')]);router[_0xf818('0x10')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0xf818('0x14')]);router[_0xf818('0x15')](_0xf818('0xc'),auth[_0xf818('0x9')](),controller[_0xf818('0x16')]);module[_0xf818('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 1049737..9038301 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 _0x705d=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x4ceac1,_0xeaf409){var _0x2dd0c5=function(_0x182898){while(--_0x182898){_0x4ceac1['push'](_0x4ceac1['shift']());}};_0x2dd0c5(++_0xeaf409);}(_0x705d,0x11b));var _0xd705=function(_0x1c56d9,_0x320258){_0x1c56d9=_0x1c56d9-0x0;var _0x1f1b1e=_0x705d[_0x1c56d9];return _0x1f1b1e;};'use strict';var Sequelize=require('sequelize');module[_0xd705('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd705('0x1')]},'scheduledat':{'type':Sequelize[_0xd705('0x2')]},'countbusyretry':{'type':Sequelize[_0xd705('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd705('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xd705('0x1')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd705('0x1')]},'calleridname':{'type':Sequelize[_0xd705('0x1')]},'starttime':{'type':Sequelize[_0xd705('0x2')]},'responsetime':{'type':Sequelize[_0xd705('0x2')]},'answertime':{'type':Sequelize[_0xd705('0x2')]},'droptime':{'type':Sequelize[_0xd705('0x2')]},'endtime':{'type':Sequelize[_0xd705('0x2')]},'ringtime':{'type':Sequelize[_0xd705('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd705('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd705('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd705('0x1')]},'campaign':{'type':Sequelize[_0xd705('0x1')]},'campaigntype':{'type':Sequelize[_0xd705('0x1')]},'membername':{'type':Sequelize[_0xd705('0x1')]},'reason':{'type':Sequelize[_0xd705('0x1')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xd705('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd705('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd705('0x2')]},'recallme':{'type':Sequelize[_0xd705('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd705('0x2')]},'edited':{'type':Sequelize[_0xd705('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9efd=['INTEGER','DATE','STRING','BOOLEAN'];(function(_0x42022b,_0xeb3345){var _0x54b918=function(_0x3cd8a6){while(--_0x3cd8a6){_0x42022b['push'](_0x42022b['shift']());}};_0x54b918(++_0xeb3345);}(_0x9efd,0x19c));var _0xd9ef=function(_0x242196,_0xc85378){_0x242196=_0x242196-0x0;var _0xf1db0a=_0x9efd[_0x242196];return _0xf1db0a;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xd9ef('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xd9ef('0x1')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd9ef('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd9ef('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd9ef('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd9ef('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xd9ef('0x2')]},'originatecalleridname':{'type':Sequelize[_0xd9ef('0x2')]},'calleridnum':{'type':Sequelize[_0xd9ef('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd9ef('0x1')]},'responsetime':{'type':Sequelize[_0xd9ef('0x1')]},'answertime':{'type':Sequelize[_0xd9ef('0x1')]},'droptime':{'type':Sequelize[_0xd9ef('0x1')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd9ef('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd9ef('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd9ef('0x2')]},'campaign':{'type':Sequelize[_0xd9ef('0x2')]},'campaigntype':{'type':Sequelize[_0xd9ef('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xd9ef('0x2')]},'amd':{'type':Sequelize[_0xd9ef('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd9ef('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0xd9ef('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd9ef('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd9ef('0x1')]},'recallme':{'type':Sequelize[_0xd9ef('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd9ef('0x1')]},'edited':{'type':Sequelize[_0xd9ef('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xd9ef('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd9ef('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd9ef('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd9ef('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd9ef('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 4cb686f..0f21b77 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 _0x7c1e=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','filter','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','describe','uniqueid','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set'];(function(_0x5e77f8,_0x487207){var _0xc3d45e=function(_0xdfc5c6){while(--_0xdfc5c6){_0x5e77f8['push'](_0x5e77f8['shift']());}};_0xc3d45e(++_0x487207);}(_0x7c1e,0x150));var _0xe7c1=function(_0xce67f3,_0x28c9da){_0xce67f3=_0xce67f3-0x0;var _0x56f8a7=_0x7c1e[_0xce67f3];return _0x56f8a7;};'use strict';var pdf=require(_0xe7c1('0x0'));var emlformat=require(_0xe7c1('0x1'));var rimraf=require(_0xe7c1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe7c1('0x3'));var rp=require(_0xe7c1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe7c1('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe7c1('0x6'));var csv=require(_0xe7c1('0x7'));var ejs=require(_0xe7c1('0x8'));var fs=require('fs');var _=require(_0xe7c1('0x9'));var squel=require(_0xe7c1('0xa'));var crypto=require(_0xe7c1('0xb'));var jsforce=require(_0xe7c1('0xc'));var deskjs=require(_0xe7c1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe7c1('0xe'));var Redis=require('ioredis');var authService=require(_0xe7c1('0xf'));var qs=require(_0xe7c1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7c1('0x11'));var logger=require(_0xe7c1('0x12'))('api');var utils=require(_0xe7c1('0x13'));var config=require(_0xe7c1('0x14'));var db=require(_0xe7c1('0x15'))['db'];function respondWithStatusCode(_0x4b105b,_0x49cd89){_0x49cd89=_0x49cd89||0xcc;return function(_0x2ceed7){if(_0x2ceed7){return _0x4b105b['sendStatus'](_0x49cd89);}return _0x4b105b['status'](_0x49cd89)[_0xe7c1('0x16')]();};}function respondWithResult(_0x3a4b08,_0xa8f3dc){_0xa8f3dc=_0xa8f3dc||0xc8;return function(_0x340069){if(_0x340069){return _0x3a4b08[_0xe7c1('0x17')](_0xa8f3dc)[_0xe7c1('0x18')](_0x340069);}};}function respondWithFilteredResult(_0x38fb10,_0x3583ec){return function(_0x4fb427){if(_0x4fb427){var _0x508975=_0x4fb427[_0xe7c1('0x19')],_0x12c82d=_0x3583ec['offset'],_0x57a454=_0x3583ec[_0xe7c1('0x1a')]+_0x3583ec[_0xe7c1('0x1b')],_0x46baf3;if(_0x57a454>=_0x508975){_0x57a454=_0x508975;_0x46baf3=0xc8;}else{_0x46baf3=0xce;}_0x38fb10[_0xe7c1('0x17')](_0x46baf3);return _0x38fb10[_0xe7c1('0x1c')](_0xe7c1('0x1d'),_0x12c82d+'-'+_0x57a454+'/'+_0x508975)['json'](_0x4fb427);}return null;};}function patchUpdates(_0xc2e3ba){return function(_0x1a0808){try{jsonpatch[_0xe7c1('0x1e')](_0x1a0808,_0xc2e3ba,!![]);}catch(_0x482323){return BPromise[_0xe7c1('0x1f')](_0x482323);}return _0x1a0808[_0xe7c1('0x20')]();};}function saveUpdates(_0x5bfeb2,_0x544795){return function(_0x49120b){if(_0x49120b){return _0x49120b[_0xe7c1('0x21')](_0x5bfeb2)[_0xe7c1('0x22')](function(_0xc62f4c){return _0xc62f4c;});}return null;};}function removeEntity(_0x40e729,_0x30f5e9){return function(_0x4b4f12){if(_0x4b4f12){return _0x4b4f12[_0xe7c1('0x23')]()[_0xe7c1('0x22')](function(){_0x40e729[_0xe7c1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40edce,_0x282ea7){return function(_0x24c097){if(!_0x24c097){_0x40edce[_0xe7c1('0x24')](0x194);}return _0x24c097;};}function handleError(_0x4ce878,_0x529822){_0x529822=_0x529822||0x1f4;return function(_0x156743){logger[_0xe7c1('0x25')](_0x156743['stack']);if(_0x156743[_0xe7c1('0x26')]){delete _0x156743[_0xe7c1('0x26')];}_0x4ce878[_0xe7c1('0x17')](_0x529822)[_0xe7c1('0x27')](_0x156743);};}exports[_0xe7c1('0x28')]=function(_0x19fa6e,_0x3a189e){var _0x1dbb27={},_0x532c8f={},_0x52e959={'count':0x0,'rows':[]};var _0x581c0a=_[_0xe7c1('0x29')](db[_0xe7c1('0x2a')][_0xe7c1('0x2b')],function(_0x56faf6){return{'name':_0x56faf6['fieldName'],'type':_0x56faf6[_0xe7c1('0x2c')][_0xe7c1('0x2d')]};});_0x532c8f[_0xe7c1('0x2e')]=_['map'](_0x581c0a,_0xe7c1('0x26'));_0x532c8f['query']=_['keys'](_0x19fa6e[_0xe7c1('0x2f')]);_0x532c8f[_0xe7c1('0x30')]=_['intersection'](_0x532c8f['model'],_0x532c8f['query']);_0x1dbb27[_0xe7c1('0x31')]=_[_0xe7c1('0x32')](_0x532c8f[_0xe7c1('0x2e')],qs[_0xe7c1('0x33')](_0x19fa6e[_0xe7c1('0x2f')][_0xe7c1('0x33')]));_0x1dbb27[_0xe7c1('0x31')]=_0x1dbb27[_0xe7c1('0x31')][_0xe7c1('0x34')]?_0x1dbb27[_0xe7c1('0x31')]:_0x532c8f[_0xe7c1('0x2e')];if(!_0x19fa6e[_0xe7c1('0x2f')][_0xe7c1('0x35')]('nolimit')){_0x1dbb27['limit']=qs[_0xe7c1('0x1b')](_0x19fa6e['query'][_0xe7c1('0x1b')]);_0x1dbb27[_0xe7c1('0x1a')]=qs['offset'](_0x19fa6e[_0xe7c1('0x2f')][_0xe7c1('0x1a')]);}_0x1dbb27[_0xe7c1('0x36')]=qs[_0xe7c1('0x37')](_0x19fa6e[_0xe7c1('0x2f')][_0xe7c1('0x37')]);_0x1dbb27[_0xe7c1('0x38')]=qs[_0xe7c1('0x30')](_['pick'](_0x19fa6e[_0xe7c1('0x2f')],_0x532c8f[_0xe7c1('0x30')]));if(_0x19fa6e['query']['filter']){_0x1dbb27[_0xe7c1('0x38')]=_[_0xe7c1('0x39')](_0x1dbb27[_0xe7c1('0x38')],{'$or':_[_0xe7c1('0x29')](_0x581c0a,function(_0x123643){if(_0x123643[_0xe7c1('0x2c')]!=='VIRTUAL'){var _0x27410a={};_0x27410a[_0x123643['name']]={'$like':'%'+_0x19fa6e[_0xe7c1('0x2f')][_0xe7c1('0x3a')]+'%'};return _0x27410a;}})});}_0x1dbb27=_['merge']({},_0x1dbb27,_0x19fa6e['options']);var _0x2fb13b={'where':_0x1dbb27[_0xe7c1('0x38')]};return db[_0xe7c1('0x2a')]['count'](_0x2fb13b)[_0xe7c1('0x22')](function(_0x3b702d){_0x52e959['count']=_0x3b702d;if(_0x19fa6e[_0xe7c1('0x2f')][_0xe7c1('0x3b')]){_0x1dbb27[_0xe7c1('0x3c')]=[{'all':!![]}];}return db[_0xe7c1('0x2a')][_0xe7c1('0x3d')](_0x1dbb27);})[_0xe7c1('0x22')](function(_0x7b1165){_0x52e959[_0xe7c1('0x3e')]=_0x7b1165;return _0x52e959;})[_0xe7c1('0x22')](respondWithFilteredResult(_0x3a189e,_0x1dbb27))[_0xe7c1('0x3f')](handleError(_0x3a189e,null));};exports[_0xe7c1('0x40')]=function(_0x53eb6a,_0x2c44eb){var _0x77934a={'raw':!![],'where':{'id':_0x53eb6a['params']['id']}},_0xbd14ed={};_0xbd14ed[_0xe7c1('0x2e')]=_['keys'](db['CmHopperHistory'][_0xe7c1('0x2b')]);_0xbd14ed[_0xe7c1('0x2f')]=_[_0xe7c1('0x41')](_0x53eb6a[_0xe7c1('0x2f')]);_0xbd14ed['filters']=_[_0xe7c1('0x32')](_0xbd14ed[_0xe7c1('0x2e')],_0xbd14ed[_0xe7c1('0x2f')]);_0x77934a[_0xe7c1('0x31')]=_[_0xe7c1('0x32')](_0xbd14ed['model'],qs[_0xe7c1('0x33')](_0x53eb6a[_0xe7c1('0x2f')][_0xe7c1('0x33')]));_0x77934a[_0xe7c1('0x31')]=_0x77934a[_0xe7c1('0x31')][_0xe7c1('0x34')]?_0x77934a[_0xe7c1('0x31')]:_0xbd14ed[_0xe7c1('0x2e')];if(_0x53eb6a[_0xe7c1('0x2f')][_0xe7c1('0x3b')]){_0x77934a[_0xe7c1('0x3c')]=[{'all':!![]}];}_0x77934a=_[_0xe7c1('0x39')]({},_0x77934a,_0x53eb6a[_0xe7c1('0x42')]);return db[_0xe7c1('0x2a')][_0xe7c1('0x43')](_0x77934a)['then'](handleEntityNotFound(_0x2c44eb,null))[_0xe7c1('0x22')](respondWithResult(_0x2c44eb,null))[_0xe7c1('0x3f')](handleError(_0x2c44eb,null));};exports[_0xe7c1('0x44')]=function(_0x144493,_0x549826){return db[_0xe7c1('0x2a')][_0xe7c1('0x44')](_0x144493[_0xe7c1('0x45')],{})['then'](respondWithResult(_0x549826,0xc9))[_0xe7c1('0x3f')](handleError(_0x549826,null));};exports[_0xe7c1('0x46')]=function(_0x338cc3,_0x531260){return db[_0xe7c1('0x2a')][_0xe7c1('0x46')]()[_0xe7c1('0x22')](respondWithResult(_0x531260,null))[_0xe7c1('0x3f')](handleError(_0x531260,null));};exports[_0xe7c1('0x21')]=function(_0x3a6a5c,_0x12aad8){if(_0x3a6a5c[_0xe7c1('0x45')][_0xe7c1('0x47')]){delete _0x3a6a5c[_0xe7c1('0x45')]['uniqueid'];}return db[_0xe7c1('0x2a')][_0xe7c1('0x43')]({'where':{'uniqueid':_0x3a6a5c[_0xe7c1('0x48')]['id']}})['then'](handleEntityNotFound(_0x12aad8,null))[_0xe7c1('0x22')](saveUpdates(_0x3a6a5c[_0xe7c1('0x45')],null))[_0xe7c1('0x22')](respondWithResult(_0x12aad8,null))[_0xe7c1('0x3f')](handleError(_0x12aad8,null));}; \ No newline at end of file +var _0xd2e8=['rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','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','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','map','CmHopperHistory','fieldName','type','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','keys','intersection','length','includeAll','find','create','describe','body','uniqueid','html-pdf','eml-format'];(function(_0x469f97,_0x1d2bd0){var _0x557d30=function(_0xe4d2a5){while(--_0xe4d2a5){_0x469f97['push'](_0x469f97['shift']());}};_0x557d30(++_0x1d2bd0);}(_0xd2e8,0xdf));var _0x8d2e=function(_0x54381d,_0x247b2c){_0x54381d=_0x54381d-0x0;var _0x5308a7=_0xd2e8[_0x54381d];return _0x5308a7;};'use strict';var pdf=require(_0x8d2e('0x0'));var emlformat=require(_0x8d2e('0x1'));var rimraf=require(_0x8d2e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8d2e('0x3'));var rp=require(_0x8d2e('0x4'));var moment=require('moment');var BPromise=require(_0x8d2e('0x5'));var Mustache=require('mustache');var util=require(_0x8d2e('0x6'));var path=require('path');var sox=require(_0x8d2e('0x7'));var csv=require(_0x8d2e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8d2e('0x9'));var squel=require('squel');var crypto=require(_0x8d2e('0xa'));var jsforce=require(_0x8d2e('0xb'));var deskjs=require(_0x8d2e('0xc'));var toCsv=require(_0x8d2e('0x8'));var querystring=require(_0x8d2e('0xd'));var Papa=require(_0x8d2e('0xe'));var Redis=require(_0x8d2e('0xf'));var authService=require(_0x8d2e('0x10'));var qs=require(_0x8d2e('0x11'));var as=require(_0x8d2e('0x12'));var hardwareService=require(_0x8d2e('0x13'));var logger=require(_0x8d2e('0x14'))(_0x8d2e('0x15'));var utils=require(_0x8d2e('0x16'));var config=require(_0x8d2e('0x17'));var db=require(_0x8d2e('0x18'))['db'];function respondWithStatusCode(_0x5e278a,_0x155794){_0x155794=_0x155794||0xcc;return function(_0xfc0e8e){if(_0xfc0e8e){return _0x5e278a[_0x8d2e('0x19')](_0x155794);}return _0x5e278a[_0x8d2e('0x1a')](_0x155794)[_0x8d2e('0x1b')]();};}function respondWithResult(_0x164832,_0x4108df){_0x4108df=_0x4108df||0xc8;return function(_0x52ffe0){if(_0x52ffe0){return _0x164832[_0x8d2e('0x1a')](_0x4108df)['json'](_0x52ffe0);}};}function respondWithFilteredResult(_0x5b62b6,_0x25a7f5){return function(_0x25ce11){if(_0x25ce11){var _0x5ce9d9=_0x25ce11[_0x8d2e('0x1c')],_0x3587e0=_0x25a7f5[_0x8d2e('0x1d')],_0x126e54=_0x25a7f5[_0x8d2e('0x1d')]+_0x25a7f5[_0x8d2e('0x1e')],_0x136290;if(_0x126e54>=_0x5ce9d9){_0x126e54=_0x5ce9d9;_0x136290=0xc8;}else{_0x136290=0xce;}_0x5b62b6[_0x8d2e('0x1a')](_0x136290);return _0x5b62b6[_0x8d2e('0x1f')](_0x8d2e('0x20'),_0x3587e0+'-'+_0x126e54+'/'+_0x5ce9d9)[_0x8d2e('0x21')](_0x25ce11);}return null;};}function patchUpdates(_0x1b23df){return function(_0x112916){try{jsonpatch[_0x8d2e('0x22')](_0x112916,_0x1b23df,!![]);}catch(_0x13a902){return BPromise[_0x8d2e('0x23')](_0x13a902);}return _0x112916['save']();};}function saveUpdates(_0x4868cf,_0x2083b6){return function(_0x24a43d){if(_0x24a43d){return _0x24a43d['update'](_0x4868cf)[_0x8d2e('0x24')](function(_0x370da8){return _0x370da8;});}return null;};}function removeEntity(_0x31c87d,_0x27f983){return function(_0x1513d1){if(_0x1513d1){return _0x1513d1[_0x8d2e('0x25')]()[_0x8d2e('0x24')](function(){_0x31c87d[_0x8d2e('0x1a')](0xcc)[_0x8d2e('0x1b')]();});}};}function handleEntityNotFound(_0x3cac70,_0x5a78b4){return function(_0x168880){if(!_0x168880){_0x3cac70[_0x8d2e('0x19')](0x194);}return _0x168880;};}function handleError(_0x1c7675,_0x3d36df){_0x3d36df=_0x3d36df||0x1f4;return function(_0x44df8c){logger[_0x8d2e('0x26')](_0x44df8c[_0x8d2e('0x27')]);if(_0x44df8c[_0x8d2e('0x28')]){delete _0x44df8c[_0x8d2e('0x28')];}_0x1c7675[_0x8d2e('0x1a')](_0x3d36df)[_0x8d2e('0x29')](_0x44df8c);};}exports[_0x8d2e('0x2a')]=function(_0xfe7571,_0x31f821){var _0x276e6f={},_0x517aab={},_0x14d76d={'count':0x0,'rows':[]};var _0x1bd87e=_[_0x8d2e('0x2b')](db[_0x8d2e('0x2c')]['rawAttributes'],function(_0x4e9ce2){return{'name':_0x4e9ce2[_0x8d2e('0x2d')],'type':_0x4e9ce2[_0x8d2e('0x2e')]['key']};});_0x517aab[_0x8d2e('0x2f')]=_['map'](_0x1bd87e,_0x8d2e('0x28'));_0x517aab[_0x8d2e('0x30')]=_['keys'](_0xfe7571['query']);_0x517aab[_0x8d2e('0x31')]=_['intersection'](_0x517aab[_0x8d2e('0x2f')],_0x517aab['query']);_0x276e6f[_0x8d2e('0x32')]=_['intersection'](_0x517aab[_0x8d2e('0x2f')],qs[_0x8d2e('0x33')](_0xfe7571[_0x8d2e('0x30')][_0x8d2e('0x33')]));_0x276e6f[_0x8d2e('0x32')]=_0x276e6f[_0x8d2e('0x32')]['length']?_0x276e6f[_0x8d2e('0x32')]:_0x517aab[_0x8d2e('0x2f')];if(!_0xfe7571[_0x8d2e('0x30')][_0x8d2e('0x34')](_0x8d2e('0x35'))){_0x276e6f[_0x8d2e('0x1e')]=qs['limit'](_0xfe7571['query'][_0x8d2e('0x1e')]);_0x276e6f[_0x8d2e('0x1d')]=qs[_0x8d2e('0x1d')](_0xfe7571[_0x8d2e('0x30')][_0x8d2e('0x1d')]);}_0x276e6f[_0x8d2e('0x36')]=qs[_0x8d2e('0x37')](_0xfe7571['query'][_0x8d2e('0x37')]);_0x276e6f[_0x8d2e('0x38')]=qs[_0x8d2e('0x31')](_[_0x8d2e('0x39')](_0xfe7571[_0x8d2e('0x30')],_0x517aab[_0x8d2e('0x31')]));if(_0xfe7571['query'][_0x8d2e('0x3a')]){_0x276e6f[_0x8d2e('0x38')]=_[_0x8d2e('0x3b')](_0x276e6f[_0x8d2e('0x38')],{'$or':_[_0x8d2e('0x2b')](_0x1bd87e,function(_0x42c984){if(_0x42c984[_0x8d2e('0x2e')]!=='VIRTUAL'){var _0x4dc5d5={};_0x4dc5d5[_0x42c984[_0x8d2e('0x28')]]={'$like':'%'+_0xfe7571[_0x8d2e('0x30')][_0x8d2e('0x3a')]+'%'};return _0x4dc5d5;}})});}_0x276e6f=_[_0x8d2e('0x3b')]({},_0x276e6f,_0xfe7571[_0x8d2e('0x3c')]);var _0x52f72c={'where':_0x276e6f['where']};return db['CmHopperHistory'][_0x8d2e('0x1c')](_0x52f72c)[_0x8d2e('0x24')](function(_0x4ea0f1){_0x14d76d[_0x8d2e('0x1c')]=_0x4ea0f1;if(_0xfe7571[_0x8d2e('0x30')]['includeAll']){_0x276e6f[_0x8d2e('0x3d')]=[{'all':!![]}];}return db[_0x8d2e('0x2c')][_0x8d2e('0x3e')](_0x276e6f);})[_0x8d2e('0x24')](function(_0x768e92){_0x14d76d[_0x8d2e('0x3f')]=_0x768e92;return _0x14d76d;})[_0x8d2e('0x24')](respondWithFilteredResult(_0x31f821,_0x276e6f))[_0x8d2e('0x40')](handleError(_0x31f821,null));};exports[_0x8d2e('0x41')]=function(_0x94262,_0x2b5c4d){var _0x2c3aab={'raw':!![],'where':{'id':_0x94262['params']['id']}},_0x1e3391={};_0x1e3391[_0x8d2e('0x2f')]=_[_0x8d2e('0x42')](db[_0x8d2e('0x2c')]['rawAttributes']);_0x1e3391['query']=_[_0x8d2e('0x42')](_0x94262['query']);_0x1e3391['filters']=_[_0x8d2e('0x43')](_0x1e3391['model'],_0x1e3391[_0x8d2e('0x30')]);_0x2c3aab[_0x8d2e('0x32')]=_[_0x8d2e('0x43')](_0x1e3391[_0x8d2e('0x2f')],qs[_0x8d2e('0x33')](_0x94262[_0x8d2e('0x30')][_0x8d2e('0x33')]));_0x2c3aab[_0x8d2e('0x32')]=_0x2c3aab[_0x8d2e('0x32')][_0x8d2e('0x44')]?_0x2c3aab[_0x8d2e('0x32')]:_0x1e3391[_0x8d2e('0x2f')];if(_0x94262[_0x8d2e('0x30')][_0x8d2e('0x45')]){_0x2c3aab[_0x8d2e('0x3d')]=[{'all':!![]}];}_0x2c3aab=_[_0x8d2e('0x3b')]({},_0x2c3aab,_0x94262['options']);return db[_0x8d2e('0x2c')][_0x8d2e('0x46')](_0x2c3aab)[_0x8d2e('0x24')](handleEntityNotFound(_0x2b5c4d,null))[_0x8d2e('0x24')](respondWithResult(_0x2b5c4d,null))[_0x8d2e('0x40')](handleError(_0x2b5c4d,null));};exports[_0x8d2e('0x47')]=function(_0x24ee15,_0x335fe3){return db[_0x8d2e('0x2c')][_0x8d2e('0x47')](_0x24ee15['body'],{})[_0x8d2e('0x24')](respondWithResult(_0x335fe3,0xc9))[_0x8d2e('0x40')](handleError(_0x335fe3,null));};exports[_0x8d2e('0x48')]=function(_0xe6ccd2,_0x3c8099){return db[_0x8d2e('0x2c')]['describe']()[_0x8d2e('0x24')](respondWithResult(_0x3c8099,null))[_0x8d2e('0x40')](handleError(_0x3c8099,null));};exports['update']=function(_0x4e32c8,_0x3bb8df){if(_0x4e32c8[_0x8d2e('0x49')][_0x8d2e('0x4a')]){delete _0x4e32c8[_0x8d2e('0x49')][_0x8d2e('0x4a')];}return db[_0x8d2e('0x2c')][_0x8d2e('0x46')]({'where':{'uniqueid':_0x4e32c8['params']['id']}})[_0x8d2e('0x24')](handleEntityNotFound(_0x3bb8df,null))['then'](saveUpdates(_0x4e32c8['body'],null))['then'](respondWithResult(_0x3bb8df,null))[_0x8d2e('0x40')](handleError(_0x3bb8df,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 62521ba..c2c9fa1 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 _0x29c7=['moment','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api'];(function(_0x148240,_0x4a1a14){var _0x169eb1=function(_0xa9c8aa){while(--_0xa9c8aa){_0x148240['push'](_0x148240['shift']());}};_0x169eb1(++_0x4a1a14);}(_0x29c7,0x164));var _0x729c=function(_0x50a319,_0x3e3b1d){_0x50a319=_0x50a319-0x0;var _0x31de6f=_0x29c7[_0x50a319];return _0x31de6f;};'use strict';var _=require(_0x729c('0x0'));var util=require(_0x729c('0x1'));var logger=require(_0x729c('0x2'))(_0x729c('0x3'));var moment=require(_0x729c('0x4'));var BPromise=require('bluebird');var rp=require(_0x729c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x729c('0x6'));var config=require(_0x729c('0x7'));var attributes=require(_0x729c('0x8'));module[_0x729c('0x9')]=function(_0x1b6503,_0x2d3a51){return _0x1b6503[_0x729c('0xa')](_0x729c('0xb'),attributes,{'tableName':_0x729c('0xc'),'paranoid':![],'indexes':[{'name':_0x729c('0xd'),'fields':[_0x729c('0xd')]},{'name':_0x729c('0xe'),'fields':[_0x729c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe216=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define','CmHopperHistory','endtime','uniqueid','lodash'];(function(_0x27d851,_0x5d122d){var _0x494d13=function(_0x2ba78e){while(--_0x2ba78e){_0x27d851['push'](_0x27d851['shift']());}};_0x494d13(++_0x5d122d);}(_0xe216,0x77));var _0x6e21=function(_0x3da612,_0x332456){_0x3da612=_0x3da612-0x0;var _0x1a9d1d=_0xe216[_0x3da612];return _0x1a9d1d;};'use strict';var _=require(_0x6e21('0x0'));var util=require(_0x6e21('0x1'));var logger=require(_0x6e21('0x2'))(_0x6e21('0x3'));var moment=require('moment');var BPromise=require(_0x6e21('0x4'));var rp=require(_0x6e21('0x5'));var fs=require('fs');var path=require(_0x6e21('0x6'));var rimraf=require('rimraf');var config=require(_0x6e21('0x7'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x1f7de9,_0x5e9bab){return _0x1f7de9[_0x6e21('0x8')](_0x6e21('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x6e21('0xa'),'fields':['endtime']},{'name':_0x6e21('0xb'),'fields':[_0x6e21('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index c0b3dfd..5c96d42 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 _0x0abf=['`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','GetCampaignHopperHistory','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','debug','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay'];(function(_0x3c5493,_0x4cbd43){var _0x5133cc=function(_0x5337b0){while(--_0x5337b0){_0x3c5493['push'](_0x3c5493['shift']());}};_0x5133cc(++_0x4cbd43);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233afe,_0x57ff3b,_0x2c4628){return new BPromise(function(_0x3f7e2b,_0x3ca099){return client[_0xf0ab('0xa')](_0x233afe,_0x2c4628)['then'](function(_0x472508){logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,'request\x20sent');logger['debug'](_0xf0ab('0xd'),_0x57ff3b,'request\x20sent',JSON[_0xf0ab('0xe')](_0x472508));if(_0x472508[_0xf0ab('0xf')]){if(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x10')]===0x1f4){logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')]['message']);return _0x3ca099(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);return _0x3f7e2b(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}else{logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,_0xf0ab('0x12'));_0x3f7e2b(_0x472508[_0xf0ab('0x13')][_0xf0ab('0x11')]);}})[_0xf0ab('0x14')](function(_0x230f40){logger['error'](_0xf0ab('0xc'),_0x57ff3b,_0x230f40);_0x3ca099(_0x230f40);});});}exports[_0xf0ab('0x15')]=function(_0x1803f0){var _0x1ffeb5=this;return new Promise(function(_0x776619,_0xb9a33){return db[_0xf0ab('0x16')][_0xf0ab('0x17')](_0x1803f0[_0xf0ab('0x18')],{'raw':_0x1803f0[_0xf0ab('0x19')]?_0x1803f0[_0xf0ab('0x19')][_0xf0ab('0x1a')]===undefined?!![]:![]:!![]})[_0xf0ab('0x1b')](function(_0x22a205){logger[_0xf0ab('0xb')](_0xf0ab('0x15'),_0x1803f0);logger['debug'](_0xf0ab('0x15'),_0x1803f0,JSON[_0xf0ab('0xe')](_0x22a205));_0x776619(_0x22a205);})[_0xf0ab('0x14')](function(_0x11ab3a){logger[_0xf0ab('0xf')](_0xf0ab('0x15'),_0x11ab3a[_0xf0ab('0x11')],_0x1803f0);_0xb9a33(_0x1ffeb5[_0xf0ab('0xf')](0x1f4,_0x11ab3a[_0xf0ab('0x11')]));});});};exports[_0xf0ab('0x1c')]=function(_0x43119f){var _0x5645b2=this;return new Promise(function(_0x585841,_0x4eee21){return db[_0xf0ab('0x16')]['findAll']({'raw':_0x43119f[_0xf0ab('0x19')]?_0x43119f[_0xf0ab('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x43119f[_0xf0ab('0x19')]?_0x43119f[_0xf0ab('0x19')][_0xf0ab('0x1d')]||null:null,'attributes':[[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize'][_0xf0ab('0x20')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x22')))),_0xf0ab('0x23')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x25')))),_0xf0ab('0x26')],[db['sequelize']['fn']('AVG',db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xf0ab('0x27')],[db[_0xf0ab('0x1e')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x28')))),_0xf0ab('0x29')]]})[_0xf0ab('0x1b')](function(_0x36195d){logger[_0xf0ab('0xb')](_0xf0ab('0x1c'),_0x43119f);logger[_0xf0ab('0x2a')](_0xf0ab('0x1c'),_0x43119f,JSON[_0xf0ab('0xe')](_0x36195d));_0x585841(_0x36195d);})[_0xf0ab('0x14')](function(_0x22dcfe){logger[_0xf0ab('0xf')]('AvgHandleTime',_0x22dcfe[_0xf0ab('0x11')],_0x43119f);_0x4eee21(_0x5645b2[_0xf0ab('0xf')](0x1f4,_0x22dcfe[_0xf0ab('0x11')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x9e38af){var _0xe4d58b=this;return new Promise(function(_0x5d99e7,_0x58bc85){return db[_0xf0ab('0x16')]['findAll']({'raw':_0x9e38af[_0xf0ab('0x19')]?_0x9e38af['options'][_0xf0ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x9e38af[_0xf0ab('0x19')]?_0x9e38af[_0xf0ab('0x19')][_0xf0ab('0x1d')]||null:null,'attributes':[[_0xf0ab('0x2b'),_0xf0ab('0x2c')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x2d')))),_0xf0ab('0x2e')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')]['literal'](_0xf0ab('0x2f')))),_0xf0ab('0x30')],[db[_0xf0ab('0x1e')]['fn']('COUNT',db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x22')))),_0xf0ab('0x31')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x32')))),_0xf0ab('0x33')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x34')))),_0xf0ab('0x35')],[db['sequelize']['fn']('COUNT',db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x36')))),'outboundDropCallsDayTimeout'],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize']['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x37')))),_0xf0ab('0x38')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x39')))),_0xf0ab('0x3a')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xf0ab('0x3b')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x3c')))),_0xf0ab('0x3d')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x3e')))),_0xf0ab('0x3f')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x40')))),_0xf0ab('0x41')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xf0ab('0x42')))),_0xf0ab('0x3f')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x43')))),_0xf0ab('0x44')]],'group':[_0xf0ab('0x2b')]})[_0xf0ab('0x1b')](function(_0x33112b){logger[_0xf0ab('0xb')]('GetVoiceQueueHopperHistory',_0x9e38af);logger[_0xf0ab('0x2a')]('GetVoiceQueueHopperHistory',_0x9e38af,JSON[_0xf0ab('0xe')](_0x33112b));_0x5d99e7(_0x33112b);})['catch'](function(_0x1a402b){logger['error']('GetVoiceQueueHopperHistory',_0x1a402b[_0xf0ab('0x11')],_0x9e38af);_0x58bc85(_0xe4d58b['error'](0x1f4,_0x1a402b[_0xf0ab('0x11')]));});});};exports['GetCampaignHopperHistory']=function(_0x2eff07){var _0x488001=this;return new Promise(function(_0x42331c,_0x2114f0){return db[_0xf0ab('0x16')]['findAll']({'raw':_0x2eff07['options']?_0x2eff07['options'][_0xf0ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x2eff07[_0xf0ab('0x19')]?_0x2eff07['options']['where']||null:null,'attributes':[[_0xf0ab('0x2b'),_0xf0ab('0x2c')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')][_0xf0ab('0x20')]('id')),_0xf0ab('0x45')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')]['literal'](_0xf0ab('0x22')))),'ivrAnswerCallsDay']],'group':[_0xf0ab('0x2b')]})[_0xf0ab('0x1b')](function(_0x14e4ee){logger[_0xf0ab('0xb')](_0xf0ab('0x46'),_0x2eff07);logger[_0xf0ab('0x2a')](_0xf0ab('0x46'),_0x2eff07,JSON[_0xf0ab('0xe')](_0x14e4ee));_0x42331c(_0x14e4ee);})[_0xf0ab('0x14')](function(_0x180ee6){logger['error'](_0xf0ab('0x46'),_0x180ee6[_0xf0ab('0x11')],_0x2eff07);_0x2114f0(_0x488001[_0xf0ab('0xf')](0x1f4,_0x180ee6[_0xf0ab('0x11')]));});});}; \ No newline at end of file +var _0x3c81=['debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','catch','findAll','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent'];(function(_0x594dc7,_0x269225){var _0x2e287d=function(_0x57f96c){while(--_0x57f96c){_0x594dc7['push'](_0x594dc7['shift']());}};_0x2e287d(++_0x269225);}(_0x3c81,0x102));var _0x13c8=function(_0x149e0b,_0x3c25ca){_0x149e0b=_0x149e0b-0x0;var _0x44b7bb=_0x3c81[_0x149e0b];return _0x44b7bb;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var moment=require('moment');var BPromise=require(_0x13c8('0x2'));var rs=require(_0x13c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var jayson=require(_0x13c8('0x6'));var client=jayson[_0x13c8('0x7')][_0x13c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f0bd2,_0x445b69,_0x4f7bcc){return new BPromise(function(_0x17c228,_0x4905c3){return client[_0x13c8('0x9')](_0x3f0bd2,_0x4f7bcc)[_0x13c8('0xa')](function(_0x189ce6){logger[_0x13c8('0xb')](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));logger[_0x13c8('0xe')](_0x13c8('0xf'),_0x445b69,_0x13c8('0xd'),JSON[_0x13c8('0x10')](_0x189ce6));if(_0x189ce6[_0x13c8('0x11')]){if(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x12')]===0x1f4){logger[_0x13c8('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x445b69,_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);return _0x4905c3(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);}logger['error'](_0x13c8('0xc'),_0x445b69,_0x189ce6['error']['message']);return _0x17c228(_0x189ce6['error'][_0x13c8('0x13')]);}else{logger['info'](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));_0x17c228(_0x189ce6[_0x13c8('0x14')][_0x13c8('0x13')]);}})['catch'](function(_0x13a9e1){logger[_0x13c8('0x11')](_0x13c8('0xc'),_0x445b69,_0x13a9e1);_0x4905c3(_0x13a9e1);});});}exports[_0x13c8('0x15')]=function(_0xce1ad2){var _0x28f07e=this;return new Promise(function(_0x346417,_0x251c38){return db[_0x13c8('0x16')][_0x13c8('0x17')](_0xce1ad2[_0x13c8('0x18')],{'raw':_0xce1ad2['options']?_0xce1ad2[_0x13c8('0x19')][_0x13c8('0x1a')]===undefined?!![]:![]:!![]})[_0x13c8('0xa')](function(_0x313ea3){logger['info'](_0x13c8('0x15'),_0xce1ad2);logger[_0x13c8('0xe')](_0x13c8('0x15'),_0xce1ad2,JSON[_0x13c8('0x10')](_0x313ea3));_0x346417(_0x313ea3);})[_0x13c8('0x1b')](function(_0x2fc123){logger['error'](_0x13c8('0x15'),_0x2fc123[_0x13c8('0x13')],_0xce1ad2);_0x251c38(_0x28f07e[_0x13c8('0x11')](0x1f4,_0x2fc123[_0x13c8('0x13')]));});});};exports['AvgHandleTime']=function(_0x1770e5){var _0x458217=this;return new Promise(function(_0x4e392f,_0x49b552){return db[_0x13c8('0x16')][_0x13c8('0x1c')]({'raw':_0x1770e5['options']?_0x1770e5['options'][_0x13c8('0x1a')]===undefined?!![]:![]:!![],'where':_0x1770e5[_0x13c8('0x19')]?_0x1770e5['options']['where']||null:null,'attributes':[[db[_0x13c8('0x1d')]['fn']('COUNT',db['sequelize'][_0x13c8('0x1e')]('id')),_0x13c8('0x1f')],[db[_0x13c8('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')](_0x13c8('0x21')))),_0x13c8('0x22')],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x23'),db[_0x13c8('0x1d')]['fn']('IF',db['sequelize'][_0x13c8('0x20')](_0x13c8('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0x13c8('0x23'),db[_0x13c8('0x1d')]['fn']('IF',db['sequelize'][_0x13c8('0x20')](_0x13c8('0x25')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x26'),db[_0x13c8('0x1d')]['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')](_0x13c8('0x27')))),_0x13c8('0x28')],[db[_0x13c8('0x1d')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x13c8('0x29')]]})['then'](function(_0x1fdf7d){logger['info'](_0x13c8('0x2a'),_0x1770e5);logger[_0x13c8('0xe')](_0x13c8('0x2a'),_0x1770e5,JSON[_0x13c8('0x10')](_0x1fdf7d));_0x4e392f(_0x1fdf7d);})[_0x13c8('0x1b')](function(_0x42a176){logger[_0x13c8('0x11')]('AvgHandleTime',_0x42a176[_0x13c8('0x13')],_0x1770e5);_0x49b552(_0x458217[_0x13c8('0x11')](0x1f4,_0x42a176['message']));});});};exports[_0x13c8('0x2b')]=function(_0x8ae2e5){var _0x2bfbf4=this;return new Promise(function(_0x479399,_0x4a6225){return db['CmHopperHistory'][_0x13c8('0x1c')]({'raw':_0x8ae2e5[_0x13c8('0x19')]?_0x8ae2e5[_0x13c8('0x19')][_0x13c8('0x1a')]===undefined?!![]:![]:!![],'where':_0x8ae2e5[_0x13c8('0x19')]?_0x8ae2e5[_0x13c8('0x19')][_0x13c8('0x2c')]||null:null,'attributes':[[_0x13c8('0x2d'),_0x13c8('0x2e')],[db['sequelize']['fn']('COUNT',db[_0x13c8('0x1d')]['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')](_0x13c8('0x2f')))),'outboundNoSuchCallsDay'],[db[_0x13c8('0x1d')]['fn']('COUNT',db[_0x13c8('0x1d')]['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')](_0x13c8('0x30')))),_0x13c8('0x31')],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x23'),db[_0x13c8('0x1d')]['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')](_0x13c8('0x21')))),_0x13c8('0x32')],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x23'),db[_0x13c8('0x1d')]['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')](_0x13c8('0x33')))),_0x13c8('0x34')],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x23'),db[_0x13c8('0x1d')]['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')](_0x13c8('0x35')))),'outboundCongestionCallsDay'],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x23'),db[_0x13c8('0x1d')]['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x23'),db[_0x13c8('0x1d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x13c8('0x36')],[db['sequelize']['fn'](_0x13c8('0x23'),db['sequelize']['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')](_0x13c8('0x37')))),_0x13c8('0x38')],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x23'),db['sequelize']['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')]('`state`\x20=\x2013,\x201,\x20null'))),_0x13c8('0x39')],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x23'),db[_0x13c8('0x1d')]['fn']('IF',db[_0x13c8('0x1d')]['literal'](_0x13c8('0x3a')))),_0x13c8('0x3b')],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x23'),db[_0x13c8('0x1d')]['fn']('IF',db['sequelize'][_0x13c8('0x20')](_0x13c8('0x3c')))),_0x13c8('0x3d')],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x23'),db[_0x13c8('0x1d')]['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')](_0x13c8('0x3e')))),_0x13c8('0x3f')],[db[_0x13c8('0x1d')]['fn']('COUNT',db[_0x13c8('0x1d')]['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')](_0x13c8('0x40')))),_0x13c8('0x3d')],[db[_0x13c8('0x1d')]['fn']('COUNT',db[_0x13c8('0x1d')]['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x13c8('0x2d')]})[_0x13c8('0xa')](function(_0x55d353){logger[_0x13c8('0xb')](_0x13c8('0x2b'),_0x8ae2e5);logger['debug'](_0x13c8('0x2b'),_0x8ae2e5,JSON['stringify'](_0x55d353));_0x479399(_0x55d353);})[_0x13c8('0x1b')](function(_0x1f67bd){logger[_0x13c8('0x11')]('GetVoiceQueueHopperHistory',_0x1f67bd[_0x13c8('0x13')],_0x8ae2e5);_0x4a6225(_0x2bfbf4[_0x13c8('0x11')](0x1f4,_0x1f67bd['message']));});});};exports[_0x13c8('0x41')]=function(_0x52b70a){var _0x95289e=this;return new Promise(function(_0x5eda4c,_0x1614f8){return db[_0x13c8('0x16')][_0x13c8('0x1c')]({'raw':_0x52b70a['options']?_0x52b70a[_0x13c8('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x52b70a['options']?_0x52b70a['options']['where']||null:null,'attributes':[['campaign',_0x13c8('0x2e')],[db[_0x13c8('0x1d')]['fn'](_0x13c8('0x23'),db[_0x13c8('0x1d')][_0x13c8('0x1e')]('id')),_0x13c8('0x42')],[db[_0x13c8('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x13c8('0x1d')][_0x13c8('0x20')](_0x13c8('0x21')))),_0x13c8('0x43')]],'group':[_0x13c8('0x2d')]})[_0x13c8('0xa')](function(_0x4678a0){logger[_0x13c8('0xb')]('GetCampaignHopperHistory',_0x52b70a);logger[_0x13c8('0xe')](_0x13c8('0x41'),_0x52b70a,JSON['stringify'](_0x4678a0));_0x5eda4c(_0x4678a0);})[_0x13c8('0x1b')](function(_0x2ebbcd){logger[_0x13c8('0x11')](_0x13c8('0x41'),_0x2ebbcd[_0x13c8('0x13')],_0x52b70a);_0x1614f8(_0x95289e[_0x13c8('0x11')](0x1f4,_0x2ebbcd[_0x13c8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 1fc5e8b..2fce575 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 _0x5eca=['path','connect-timeout','express','../../components/auth/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','util'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x5eca,0x10e));var _0xa5ec=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5eca[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xa5ec('0x0'));var util=require(_0xa5ec('0x1'));var path=require(_0xa5ec('0x2'));var timeout=require(_0xa5ec('0x3'));var express=require(_0xa5ec('0x4'));var router=express['Router']();var auth=require(_0xa5ec('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa5ec('0x6'));router[_0xa5ec('0x7')]('/',auth[_0xa5ec('0x8')](),controller[_0xa5ec('0x9')]);router[_0xa5ec('0x7')](_0xa5ec('0xa'),auth[_0xa5ec('0x8')](),controller['describe']);router[_0xa5ec('0x7')](_0xa5ec('0xb'),auth['isAuthenticated'](),controller[_0xa5ec('0xc')]);router['post']('/',auth[_0xa5ec('0x8')](),controller[_0xa5ec('0xd')]);router[_0xa5ec('0xe')]('/:id',auth[_0xa5ec('0x8')](),controller[_0xa5ec('0xf')]);module[_0xa5ec('0x10')]=router; \ No newline at end of file +var _0x675f=['describe','/:id','isAuthenticated','create','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe'];(function(_0xfa2693,_0x445d62){var _0x4553fa=function(_0x58fd84){while(--_0x58fd84){_0xfa2693['push'](_0xfa2693['shift']());}};_0x4553fa(++_0x445d62);}(_0x675f,0x149));var _0xf675=function(_0x5a6106,_0x123e70){_0x5a6106=_0x5a6106-0x0;var _0x26d1bc=_0x675f[_0x5a6106];return _0x26d1bc;};'use strict';var multer=require(_0xf675('0x0'));var util=require(_0xf675('0x1'));var path=require(_0xf675('0x2'));var timeout=require(_0xf675('0x3'));var express=require(_0xf675('0x4'));var router=express[_0xf675('0x5')]();var auth=require(_0xf675('0x6'));var interaction=require(_0xf675('0x7'));var config=require(_0xf675('0x8'));var controller=require(_0xf675('0x9'));router[_0xf675('0xa')]('/',auth['isAuthenticated'](),controller[_0xf675('0xb')]);router[_0xf675('0xa')](_0xf675('0xc'),auth['isAuthenticated'](),controller[_0xf675('0xd')]);router[_0xf675('0xa')](_0xf675('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf675('0xf')](),controller[_0xf675('0x10')]);router[_0xf675('0x11')](_0xf675('0xe'),auth['isAuthenticated'](),controller[_0xf675('0x12')]);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 297fb7b..3f01d81 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 _0xbdd7=['sequelize','exports','STRING','name'];(function(_0x5d274f,_0x5641a6){var _0x1534c1=function(_0x5a8ba0){while(--_0x5a8ba0){_0x5d274f['push'](_0x5d274f['shift']());}};_0x1534c1(++_0x5641a6);}(_0xbdd7,0x1bc));var _0x7bdd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbdd7[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x7bdd('0x0'));module[_0x7bdd('0x1')]={'name':{'type':Sequelize[_0x7bdd('0x2')],'unique':_0x7bdd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7bdd('0x2')]},'dialPrefix':{'type':Sequelize[_0x7bdd('0x2')]}}; \ No newline at end of file +var _0xef5a=['exports','STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef5a,0x127));var _0xaef5=function(_0x41ca33,_0x131bbf){_0x41ca33=_0x41ca33-0x0;var _0x4f205a=_0xef5a[_0x41ca33];return _0x4f205a;};'use strict';var Sequelize=require(_0xaef5('0x0'));module[_0xaef5('0x1')]={'name':{'type':Sequelize[_0xaef5('0x2')],'unique':_0xaef5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xaef5('0x2')]},'dialPrefix':{'type':Sequelize[_0xaef5('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index ed67071..6e1c80d 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 _0xcb91=['bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','update','then','get','Lists','destroy','error','name','index','map','CmList','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','describe','addDisposition','ListId','Disposition','getDispositions','sort','includeAll','rows','removeDispositions','CmContact','tags','isArray','join','each','omit','ids','success','dataValues','errors','push','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContacts','getContactsCsv','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x596c43,_0x28647a){var _0x4e1315=function(_0x58e910){while(--_0x58e910){_0x596c43['push'](_0x596c43['shift']());}};_0x4e1315(++_0x28647a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0xcb91[_0x13137e];return _0x346261;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var as=require(_0x1cb9('0x10'));var hardwareService=require(_0x1cb9('0x11'));var logger=require('../../config/logger')(_0x1cb9('0x12'));var utils=require(_0x1cb9('0x13'));var config=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];config[_0x1cb9('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1cb9('0x17'))(new Redis(config[_0x1cb9('0x16')]));require(_0x1cb9('0x18'))[_0x1cb9('0x19')](socket);function respondWithStatusCode(_0x56884d,_0x397727){_0x397727=_0x397727||0xcc;return function(_0x6ef389){if(_0x6ef389){return _0x56884d[_0x1cb9('0x1a')](_0x397727);}return _0x56884d[_0x1cb9('0x1b')](_0x397727)[_0x1cb9('0x1c')]();};}function respondWithResult(_0x5806d8,_0x5572cb){_0x5572cb=_0x5572cb||0xc8;return function(_0xd446a3){if(_0xd446a3){return _0x5806d8[_0x1cb9('0x1b')](_0x5572cb)[_0x1cb9('0x1d')](_0xd446a3);}};}function respondWithFilteredResult(_0x3f1376,_0x3e21e0){return function(_0xf22920){if(_0xf22920){var _0x23d3a9=_0xf22920[_0x1cb9('0x1e')],_0x4e1340=_0x3e21e0[_0x1cb9('0x1f')],_0x479d43=_0x3e21e0[_0x1cb9('0x1f')]+_0x3e21e0[_0x1cb9('0x20')],_0x1b2fa6;if(_0x479d43>=_0x23d3a9){_0x479d43=_0x23d3a9;_0x1b2fa6=0xc8;}else{_0x1b2fa6=0xce;}_0x3f1376[_0x1cb9('0x1b')](_0x1b2fa6);return _0x3f1376[_0x1cb9('0x21')]('Content-Range',_0x4e1340+'-'+_0x479d43+'/'+_0x23d3a9)['json'](_0xf22920);}return null;};}function patchUpdates(_0x1a5a72){return function(_0x5dbfae){try{jsonpatch[_0x1cb9('0x22')](_0x5dbfae,_0x1a5a72,!![]);}catch(_0x2265ea){return BPromise['reject'](_0x2265ea);}return _0x5dbfae['save']();};}function saveUpdates(_0x2e3854,_0x325637){return function(_0x103a63){if(_0x103a63){return _0x103a63[_0x1cb9('0x23')](_0x2e3854)[_0x1cb9('0x24')](function(_0x27db16){return _0x27db16;});}return null;};}function removeEntity(_0x59ebea,_0x55b232){return function(_0x6c6f61){if(_0x6c6f61){return _0x6c6f61['destroy']()[_0x1cb9('0x24')](function(){var _0x2b1275=_0x6c6f61[_0x1cb9('0x25')]({'plain':!![]});var _0x44d3c4=_0x1cb9('0x26');return db['UserProfileResource'][_0x1cb9('0x27')]({'where':{'type':_0x44d3c4,'resourceId':_0x2b1275['id']}})[_0x1cb9('0x24')](function(){return _0x6c6f61;});})['then'](function(){_0x59ebea[_0x1cb9('0x1b')](0xcc)[_0x1cb9('0x1c')]();});}};}function handleEntityNotFound(_0x41a9a0,_0x1804fd){return function(_0x406821){if(!_0x406821){_0x41a9a0[_0x1cb9('0x1a')](0x194);}return _0x406821;};}function handleError(_0x2e28fe,_0xb644b3){_0xb644b3=_0xb644b3||0x1f4;return function(_0x41e5c2){logger[_0x1cb9('0x28')](_0x41e5c2['stack']);if(_0x41e5c2[_0x1cb9('0x29')]){delete _0x41e5c2['name'];}_0x2e28fe[_0x1cb9('0x1b')](_0xb644b3)['send'](_0x41e5c2);};}exports[_0x1cb9('0x2a')]=function(_0x41011c,_0x3cd7f5){var _0x2038aa={},_0x561d89={},_0x1c701f={'count':0x0,'rows':[]};var _0x4eba82=_[_0x1cb9('0x2b')](db[_0x1cb9('0x2c')][_0x1cb9('0x2d')],function(_0x5d8793){return{'name':_0x5d8793[_0x1cb9('0x2e')],'type':_0x5d8793['type'][_0x1cb9('0x2f')]};});_0x561d89['model']=_[_0x1cb9('0x2b')](_0x4eba82,_0x1cb9('0x29'));_0x561d89[_0x1cb9('0x30')]=_[_0x1cb9('0x31')](_0x41011c['query']);_0x561d89[_0x1cb9('0x32')]=_[_0x1cb9('0x33')](_0x561d89[_0x1cb9('0x34')],_0x561d89[_0x1cb9('0x30')]);_0x2038aa[_0x1cb9('0x35')]=_[_0x1cb9('0x33')](_0x561d89[_0x1cb9('0x34')],qs[_0x1cb9('0x36')](_0x41011c[_0x1cb9('0x30')][_0x1cb9('0x36')]));_0x2038aa[_0x1cb9('0x35')]=_0x2038aa[_0x1cb9('0x35')][_0x1cb9('0x37')]?_0x2038aa['attributes']:_0x561d89['model'];if(!_0x41011c[_0x1cb9('0x30')][_0x1cb9('0x38')](_0x1cb9('0x39'))){_0x2038aa[_0x1cb9('0x20')]=qs[_0x1cb9('0x20')](_0x41011c[_0x1cb9('0x30')][_0x1cb9('0x20')]);_0x2038aa[_0x1cb9('0x1f')]=qs['offset'](_0x41011c[_0x1cb9('0x30')][_0x1cb9('0x1f')]);}_0x2038aa[_0x1cb9('0x3a')]=qs['sort'](_0x41011c[_0x1cb9('0x30')]['sort']);_0x2038aa[_0x1cb9('0x3b')]=qs['filters'](_[_0x1cb9('0x3c')](_0x41011c[_0x1cb9('0x30')],_0x561d89[_0x1cb9('0x32')]));if(_0x41011c[_0x1cb9('0x30')][_0x1cb9('0x3d')]){_0x2038aa[_0x1cb9('0x3b')]=_[_0x1cb9('0x3e')](_0x2038aa['where'],{'$or':_['map'](_0x4eba82,function(_0x4111b8){if(_0x4111b8[_0x1cb9('0x3f')]!==_0x1cb9('0x40')){var _0x16ad1c={};_0x16ad1c[_0x4111b8[_0x1cb9('0x29')]]={'$like':'%'+_0x41011c[_0x1cb9('0x30')][_0x1cb9('0x3d')]+'%'};return _0x16ad1c;}})});}_0x2038aa=_['merge']({},_0x2038aa,_0x41011c[_0x1cb9('0x41')]);var _0x47edad={'where':_0x2038aa['where']};return db['CmList'][_0x1cb9('0x1e')](_0x47edad)[_0x1cb9('0x24')](function(_0x1bf51c){_0x1c701f[_0x1cb9('0x1e')]=_0x1bf51c;if(_0x41011c[_0x1cb9('0x30')]['includeAll']){_0x2038aa[_0x1cb9('0x42')]=[{'all':!![]}];}return db['CmList'][_0x1cb9('0x43')](_0x2038aa);})[_0x1cb9('0x24')](function(_0x38d973){_0x1c701f['rows']=_0x38d973;return _0x1c701f;})[_0x1cb9('0x24')](respondWithFilteredResult(_0x3cd7f5,_0x2038aa))['catch'](handleError(_0x3cd7f5,null));};exports[_0x1cb9('0x44')]=function(_0xbc36fc,_0x51a898){var _0x5839aa={'raw':![],'where':{'id':_0xbc36fc[_0x1cb9('0x45')]['id']}},_0x24c643={};_0x24c643[_0x1cb9('0x34')]=_[_0x1cb9('0x31')](db[_0x1cb9('0x2c')]['rawAttributes']);_0x24c643[_0x1cb9('0x30')]=_['keys'](_0xbc36fc['query']);_0x24c643['filters']=_[_0x1cb9('0x33')](_0x24c643[_0x1cb9('0x34')],_0x24c643[_0x1cb9('0x30')]);_0x5839aa[_0x1cb9('0x35')]=_[_0x1cb9('0x33')](_0x24c643[_0x1cb9('0x34')],qs[_0x1cb9('0x36')](_0xbc36fc[_0x1cb9('0x30')][_0x1cb9('0x36')]));_0x5839aa[_0x1cb9('0x35')]=_0x5839aa[_0x1cb9('0x35')]['length']?_0x5839aa[_0x1cb9('0x35')]:_0x24c643[_0x1cb9('0x34')];if(_0xbc36fc[_0x1cb9('0x30')]['includeAll']){_0x5839aa[_0x1cb9('0x42')]=[{'all':!![]}];}_0x5839aa=_[_0x1cb9('0x3e')]({},_0x5839aa,_0xbc36fc[_0x1cb9('0x41')]);return db[_0x1cb9('0x2c')][_0x1cb9('0x46')](_0x5839aa)['then'](handleEntityNotFound(_0x51a898,null))[_0x1cb9('0x24')](respondWithResult(_0x51a898,null))['catch'](handleError(_0x51a898,null));};exports[_0x1cb9('0x47')]=function(_0x4ac483,_0x1cf2ee){return db[_0x1cb9('0x2c')][_0x1cb9('0x47')](_0x4ac483[_0x1cb9('0x48')],{})['then'](function(_0x298475){var _0x1149b9=_0x4ac483[_0x1cb9('0x49')][_0x1cb9('0x25')]({'plain':!![]});if(!_0x1149b9)throw new Error(_0x1cb9('0x4a'));if(_0x1149b9[_0x1cb9('0x4b')]===_0x1cb9('0x49')){var _0x3b6a92=_0x298475[_0x1cb9('0x25')]({'plain':!![]});var _0x17f10e='Lists';return db['UserProfileSection'][_0x1cb9('0x46')]({'where':{'name':_0x17f10e,'userProfileId':_0x1149b9[_0x1cb9('0x4c')]},'raw':!![]})[_0x1cb9('0x24')](function(_0x1e073d){if(_0x1e073d&&_0x1e073d[_0x1cb9('0x4d')]===0x0){return db[_0x1cb9('0x4e')][_0x1cb9('0x47')]({'name':_0x3b6a92[_0x1cb9('0x29')],'resourceId':_0x3b6a92['id'],'type':_0x1e073d[_0x1cb9('0x29')],'sectionId':_0x1e073d['id']},{})[_0x1cb9('0x24')](function(){return _0x298475;});}else{return _0x298475;}})['catch'](function(_0x2cf8e2){logger['error'](_0x1cb9('0x4f'),_0x2cf8e2);throw _0x2cf8e2;});}return _0x298475;})['then'](respondWithResult(_0x1cf2ee,0xc9))[_0x1cb9('0x50')](handleError(_0x1cf2ee,null));};exports['update']=function(_0x5e5174,_0x44e918){if(_0x5e5174[_0x1cb9('0x48')]['id']){delete _0x5e5174[_0x1cb9('0x48')]['id'];}return db['CmList'][_0x1cb9('0x46')]({'where':{'id':_0x5e5174[_0x1cb9('0x45')]['id']}})['then'](handleEntityNotFound(_0x44e918,null))['then'](saveUpdates(_0x5e5174[_0x1cb9('0x48')],null))[_0x1cb9('0x24')](respondWithResult(_0x44e918,null))[_0x1cb9('0x50')](handleError(_0x44e918,null));};exports[_0x1cb9('0x27')]=function(_0x3de325,_0x310d6d){return db[_0x1cb9('0x2c')]['find']({'where':{'id':_0x3de325[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x24')](handleEntityNotFound(_0x310d6d,null))[_0x1cb9('0x24')](removeEntity(_0x310d6d,null))['catch'](handleError(_0x310d6d,null));};exports[_0x1cb9('0x51')]=function(_0x9893a3,_0x1651c5){return db[_0x1cb9('0x2c')][_0x1cb9('0x51')]()[_0x1cb9('0x24')](respondWithResult(_0x1651c5,null))['catch'](handleError(_0x1651c5,null));};exports[_0x1cb9('0x52')]=function(_0x36c40d,_0x41e81f,_0x128c5b){if(_0x36c40d[_0x1cb9('0x48')]['id']){delete _0x36c40d[_0x1cb9('0x48')]['id'];}return db[_0x1cb9('0x2c')][_0x1cb9('0x46')]({'where':{'id':_0x36c40d[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x24')](handleEntityNotFound(_0x41e81f,null))[_0x1cb9('0x24')](function(_0x55fb51){if(_0x55fb51){_0x36c40d[_0x1cb9('0x48')][_0x1cb9('0x53')]=_0x55fb51['id'];return db[_0x1cb9('0x54')][_0x1cb9('0x47')](_0x36c40d['body']);}})['then'](respondWithResult(_0x41e81f,null))[_0x1cb9('0x50')](handleError(_0x41e81f,null));};exports[_0x1cb9('0x55')]=function(_0x31eccc,_0x173db5,_0x3c2f9c){var _0x75c734={'raw':![],'where':{}};var _0xc515a6={};var _0xd010a9={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x31eccc[_0x1cb9('0x45')]['id']}})['then'](handleEntityNotFound(_0x173db5,null))['then'](function(_0x4ca5bc){if(_0x4ca5bc){_0xc515a6['model']=_['keys'](db[_0x1cb9('0x54')][_0x1cb9('0x2d')]);_0xc515a6[_0x1cb9('0x30')]=_[_0x1cb9('0x31')](_0x31eccc[_0x1cb9('0x30')]);_0xc515a6[_0x1cb9('0x32')]=_['intersection'](_0xc515a6[_0x1cb9('0x34')],_0xc515a6[_0x1cb9('0x30')]);_0x75c734['attributes']=_['intersection'](_0xc515a6[_0x1cb9('0x34')],qs[_0x1cb9('0x36')](_0x31eccc[_0x1cb9('0x30')][_0x1cb9('0x36')]));_0x75c734[_0x1cb9('0x35')]=_0x75c734['attributes']['length']?_0x75c734['attributes']:_0xc515a6[_0x1cb9('0x34')];if(!_0x31eccc[_0x1cb9('0x30')][_0x1cb9('0x38')](_0x1cb9('0x39'))){_0x75c734[_0x1cb9('0x20')]=qs['limit'](_0x31eccc[_0x1cb9('0x30')][_0x1cb9('0x20')]);_0x75c734['offset']=qs['offset'](_0x31eccc[_0x1cb9('0x30')]['offset']);}_0x75c734[_0x1cb9('0x3a')]=qs[_0x1cb9('0x56')](_0x31eccc[_0x1cb9('0x30')][_0x1cb9('0x56')]);_0x75c734[_0x1cb9('0x3b')]=qs[_0x1cb9('0x32')](_['pick'](_0x31eccc[_0x1cb9('0x30')],_0xc515a6[_0x1cb9('0x32')]));_0x75c734[_0x1cb9('0x3b')][_0x1cb9('0x53')]=_0x4ca5bc['id'];if(_0x31eccc['query']['filter']){_0x75c734[_0x1cb9('0x3b')]=_[_0x1cb9('0x3e')](_0x75c734[_0x1cb9('0x3b')],{'$or':_[_0x1cb9('0x2b')](_0x75c734[_0x1cb9('0x35')],function(_0x267a3c){var _0x4f8756={};_0x4f8756[_0x267a3c]={'$like':'%'+_0x31eccc[_0x1cb9('0x30')]['filter']+'%'};return _0x4f8756;})});}_0x75c734=_[_0x1cb9('0x3e')]({},_0x75c734,_0x31eccc[_0x1cb9('0x41')]);return db['Disposition'][_0x1cb9('0x1e')]({'where':_0x75c734[_0x1cb9('0x3b')]})[_0x1cb9('0x24')](function(_0x539514){_0xd010a9[_0x1cb9('0x1e')]=_0x539514;if(_0x31eccc[_0x1cb9('0x30')][_0x1cb9('0x57')]){_0x75c734[_0x1cb9('0x42')]=[{'all':!![]}];}return db[_0x1cb9('0x54')][_0x1cb9('0x43')](_0x75c734);})['then'](function(_0x2b2874){_0xd010a9[_0x1cb9('0x58')]=_0x2b2874;return _0xd010a9;});}})[_0x1cb9('0x24')](respondWithFilteredResult(_0x173db5,_0x75c734))[_0x1cb9('0x50')](handleError(_0x173db5,null));};exports[_0x1cb9('0x59')]=function(_0x1da41c,_0x128a41,_0x37bcd9){return db['CmList'][_0x1cb9('0x46')]({'where':{'id':_0x1da41c[_0x1cb9('0x45')]['id']}})['then'](handleEntityNotFound(_0x128a41,null))[_0x1cb9('0x24')](function(_0x5415fa){if(_0x5415fa){return _0x5415fa[_0x1cb9('0x59')](_0x1da41c['query']['ids']);}})[_0x1cb9('0x24')](respondWithStatusCode(_0x128a41,null))[_0x1cb9('0x50')](handleError(_0x128a41,null));};exports['addContacts']=function(_0x342cb1,_0x5b5419,_0x3d6474){return db[_0x1cb9('0x2c')][_0x1cb9('0x46')]({'where':{'id':_0x342cb1[_0x1cb9('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b5419,null))[_0x1cb9('0x24')](function(_0x3d25a3){if(_0x3d25a3){var _0x2a157d=[];var _0x27cc3c={'success':[],'errors':[]};return db[_0x1cb9('0x5a')][_0x1cb9('0x51')]()['then'](function(_0x248946){if(_0x342cb1[_0x1cb9('0x48')][_0x1cb9('0x5b')]&&_[_0x1cb9('0x5c')](_0x342cb1[_0x1cb9('0x48')][_0x1cb9('0x5b')])){if(_0x342cb1['body'][_0x1cb9('0x5b')][_0x1cb9('0x37')]){_0x342cb1['body'][_0x1cb9('0x5b')]=_0x342cb1[_0x1cb9('0x48')][_0x1cb9('0x5b')][_0x1cb9('0x5d')](';')+';';}else{_0x342cb1[_0x1cb9('0x48')][_0x1cb9('0x5b')]=null;}}else{_0x342cb1[_0x1cb9('0x48')]['tags']=null;}if(_0x342cb1[_0x1cb9('0x48')]&&_['isArray'](_0x342cb1[_0x1cb9('0x48')])){for(var _0xb5eac1=0x0;_0xb5eac1<_0x342cb1['body'][_0x1cb9('0x37')];_0xb5eac1+=0x1){_0x342cb1[_0x1cb9('0x48')][_0xb5eac1][_0x1cb9('0x53')]=_0x342cb1[_0x1cb9('0x45')]['id'];_0x2a157d['push'](_0x342cb1[_0x1cb9('0x48')][_0xb5eac1]);}return BPromise[_0x1cb9('0x5e')](_0x2a157d,function(_0x429371){return db['CmContact'][_0x1cb9('0x47')](_[_0x1cb9('0x5f')](_0x429371,[_0x1cb9('0x60'),'id'])||{},{'fields':_[_0x1cb9('0x31')](_0x248946),'raw':!![]})[_0x1cb9('0x24')](function(_0x1ea329){_0x27cc3c[_0x1cb9('0x61')]['push'](_0x1ea329[_0x1cb9('0x62')]);})['catch'](function(_0x27f1d2){_0x27cc3c[_0x1cb9('0x63')][_0x1cb9('0x64')]({'data':_0x429371,'error':_0x27f1d2[_0x1cb9('0x65')]});});})['then'](function(_0x1ff5e9){return _0x27cc3c;})[_0x1cb9('0x50')](function(_0x5e68a1){return _0x5e68a1;});}else{_0x5b5419[_0x1cb9('0x1b')](0x190)[_0x1cb9('0x1d')]({'message':_0x1cb9('0x66')});}});}})[_0x1cb9('0x24')](respondWithResult(_0x5b5419,null))[_0x1cb9('0x50')](handleError(_0x5b5419,null));};exports['getContacts']=function(_0x5e0e56,_0x544d2d,_0x5ad853){var _0x19daa1;return db[_0x1cb9('0x2c')][_0x1cb9('0x46')]({'where':{'id':_0x5e0e56[_0x1cb9('0x45')]['id']},'include':[{'model':db[_0x1cb9('0x67')],'as':_0x1cb9('0x68')}]})[_0x1cb9('0x24')](handleEntityNotFound(_0x544d2d,null))[_0x1cb9('0x24')](function(_0x4e969a){if(_0x4e969a){_0x19daa1=_0x4e969a;return db[_0x1cb9('0x5a')][_0x1cb9('0x2d')];}})[_0x1cb9('0x24')](function(_0x5eff1e){if(_0x5eff1e){var _0x10977f={};var _0xc6b64c={};_0xc6b64c['model']=_[_0x1cb9('0x69')](_[_0x1cb9('0x31')](_0x5eff1e),_[_0x1cb9('0x2b')](_0x19daa1[_0x1cb9('0x68')],function(_0x5cb5e5){return util[_0x1cb9('0x6a')](_0x1cb9('0x6b'),_0x5cb5e5['id']);}));_0xc6b64c['query']=_['keys'](_0x5e0e56[_0x1cb9('0x30')]);_0xc6b64c[_0x1cb9('0x32')]=_['intersection'](_0xc6b64c['model'],_0xc6b64c[_0x1cb9('0x30')]);_0x10977f[_0x1cb9('0x35')]=_['intersection'](_0xc6b64c['model'],qs[_0x1cb9('0x36')](_0x5e0e56['query']['fields']));_0x10977f['attributes']=_0x10977f[_0x1cb9('0x35')]['length']?_0x10977f[_0x1cb9('0x35')]:_0xc6b64c[_0x1cb9('0x34')];if(!_0x5e0e56[_0x1cb9('0x30')]['hasOwnProperty'](_0x1cb9('0x39'))){_0x10977f[_0x1cb9('0x20')]=qs[_0x1cb9('0x20')](_0x5e0e56['query'][_0x1cb9('0x20')]);_0x10977f[_0x1cb9('0x1f')]=qs[_0x1cb9('0x1f')](_0x5e0e56[_0x1cb9('0x30')][_0x1cb9('0x1f')]);}_0x10977f['order']=qs[_0x1cb9('0x56')](_0x5e0e56[_0x1cb9('0x30')][_0x1cb9('0x56')]);_0x10977f['where']=qs[_0x1cb9('0x32')](_[_0x1cb9('0x3c')](_0x5e0e56[_0x1cb9('0x30')],_0xc6b64c[_0x1cb9('0x32')]));_0x10977f[_0x1cb9('0x6c')]=!![];if(_0x5e0e56['query'][_0x1cb9('0x3d')]){_0x10977f[_0x1cb9('0x3b')]=_[_0x1cb9('0x3e')](_0x10977f[_0x1cb9('0x3b')],{'$or':_[_0x1cb9('0x2b')](_0x10977f[_0x1cb9('0x35')],function(_0x37affa){var _0x36864c={};_0x36864c[_0x37affa]={'$like':'%'+_0x5e0e56[_0x1cb9('0x30')][_0x1cb9('0x3d')]+'%'};return _0x36864c;})});}_0x10977f=_[_0x1cb9('0x3e')]({},_0x10977f,_0x5e0e56[_0x1cb9('0x41')]);return _0x19daa1[_0x1cb9('0x6d')](_0x10977f);}})[_0x1cb9('0x24')](respondWithResult(_0x544d2d,null))[_0x1cb9('0x50')](handleError(_0x544d2d,null));};exports[_0x1cb9('0x6e')]=function(_0x37b290,_0xf25415,_0x48e879){var _0x508a75;return db[_0x1cb9('0x2c')][_0x1cb9('0x46')]({'where':{'id':_0x37b290[_0x1cb9('0x45')]['id']},'include':[{'model':db[_0x1cb9('0x67')],'as':_0x1cb9('0x68')}]})[_0x1cb9('0x24')](handleEntityNotFound(_0xf25415,null))[_0x1cb9('0x24')](function(_0x56251d){if(_0x56251d){_0x508a75=_0x56251d;return db['CmContact'][_0x1cb9('0x2d')];}})[_0x1cb9('0x24')](function(_0x29b478){if(_0x29b478){var _0x11a46b={};var _0xed8968={};_0xed8968['model']=_[_0x1cb9('0x69')](_[_0x1cb9('0x31')](_0x29b478),_[_0x1cb9('0x2b')](_0x508a75['CustomFields'],function(_0x36faa4){return util[_0x1cb9('0x6a')](_0x1cb9('0x6b'),_0x36faa4['id']);}));_0xed8968['query']=_[_0x1cb9('0x31')](_0x37b290[_0x1cb9('0x30')]);_0xed8968[_0x1cb9('0x32')]=_['intersection'](_0xed8968['model'],_0xed8968['query']);_0x11a46b[_0x1cb9('0x35')]=_[_0x1cb9('0x33')](_0xed8968[_0x1cb9('0x34')],qs['fields'](_0x37b290[_0x1cb9('0x30')]['fields']));_0x11a46b['attributes']=_0x11a46b[_0x1cb9('0x35')][_0x1cb9('0x37')]?_0x11a46b[_0x1cb9('0x35')]:_0xed8968[_0x1cb9('0x34')];if(!_0x37b290[_0x1cb9('0x30')][_0x1cb9('0x38')](_0x1cb9('0x39'))){_0x11a46b[_0x1cb9('0x20')]=qs[_0x1cb9('0x20')](_0x37b290[_0x1cb9('0x30')]['limit']);_0x11a46b['offset']=qs[_0x1cb9('0x1f')](_0x37b290[_0x1cb9('0x30')]['offset']);}_0x11a46b['order']=qs['sort'](_0x37b290['query'][_0x1cb9('0x56')]);_0x11a46b[_0x1cb9('0x3b')]=qs['filters'](_[_0x1cb9('0x3c')](_0x37b290[_0x1cb9('0x30')],_0xed8968[_0x1cb9('0x32')]));_0x11a46b[_0x1cb9('0x6c')]=!![];if(_0x37b290[_0x1cb9('0x30')]['filter']){_0x11a46b[_0x1cb9('0x3b')]=_[_0x1cb9('0x3e')](_0x11a46b[_0x1cb9('0x3b')],{'$or':_[_0x1cb9('0x2b')](_0x11a46b['attributes'],function(_0x19f3db){var _0x3d82b0={};_0x3d82b0[_0x19f3db]={'$like':'%'+_0x37b290['query']['filter']+'%'};return _0x3d82b0;})});}_0x11a46b=_['merge']({},_0x11a46b,_0x37b290[_0x1cb9('0x41')]);return _0x508a75['getContacts'](_0x11a46b);}})[_0x1cb9('0x24')](function(_0x3506d7){if(!_[_0x1cb9('0x6f')](_0x3506d7)){var _0xf3c554=toCsv(_0x3506d7);var _0x31d1e5=Date[_0x1cb9('0x70')]();fs['writeFileSync'](util[_0x1cb9('0x6a')](_0x1cb9('0x71'),_0x508a75['id'],_0x31d1e5),_0xf3c554);_0xf25415[_0x1cb9('0x72')](_0x1cb9('0x73'),_0x1cb9('0x74')+util[_0x1cb9('0x6a')](_0x1cb9('0x75'),_0x508a75['id'],_0x31d1e5));_0xf25415[_0x1cb9('0x72')](_0x1cb9('0x76'),_0x1cb9('0x77'));return _0xf25415[_0x1cb9('0x78')](util[_0x1cb9('0x6a')](_0x1cb9('0x71'),_0x508a75['id'],_0x31d1e5));}else{return _0xf25415[_0x1cb9('0x1a')](0xcc);}})[_0x1cb9('0x50')](handleError(_0xf25415,null));};exports['addCustomField']=function(_0x592c04,_0x5aae4c,_0x9b1c60){var _0x35792e;delete _0x592c04['body']['id'];return db[_0x1cb9('0x2c')][_0x1cb9('0x79')]({'where':{'id':_0x592c04[_0x1cb9('0x45')]['id']}})['then'](handleEntityNotFound(_0x5aae4c,null))[_0x1cb9('0x24')](function(_0x3f817e){if(_0x3f817e){return db[_0x1cb9('0x7a')][_0x1cb9('0x7b')](function(_0x45b2e4){return db['CmCustomField'][_0x1cb9('0x47')](_0x592c04['body'],{'transaction':_0x45b2e4})['then'](function(_0x191988){_0x35792e=_0x191988;return _0x3f817e[_0x1cb9('0x7c')](_0x191988,{'transaction':_0x45b2e4});})[_0x1cb9('0x24')](function(){var _0x2e9d88={'type':db[_0x1cb9('0x7d')][_0x1cb9('0x7e')],'transaction':_0x45b2e4};switch(_0x592c04[_0x1cb9('0x48')][_0x1cb9('0x3f')]){case'text':_0x2e9d88[_0x1cb9('0x3f')]=db[_0x1cb9('0x7d')][_0x1cb9('0x7e')];break;case _0x1cb9('0x7f'):_0x2e9d88[_0x1cb9('0x3f')]=db['Sequelize'][_0x1cb9('0x80')];break;case _0x1cb9('0x81'):_0x2e9d88[_0x1cb9('0x3f')]=db[_0x1cb9('0x7d')][_0x1cb9('0x82')];_0x2e9d88['defaultValue']=![];break;default:}return db[_0x1cb9('0x7a')][_0x1cb9('0x83')][_0x1cb9('0x84')]('cm_contacts',util[_0x1cb9('0x6a')](_0x1cb9('0x85'),_0x35792e['id']),_0x2e9d88);})[_0x1cb9('0x24')](function(){return _0x35792e;});});}})[_0x1cb9('0x24')](respondWithResult(_0x5aae4c,null))[_0x1cb9('0x50')](handleError(_0x5aae4c,null));};exports[_0x1cb9('0x86')]=function(_0x4e3ad0,_0x45dc8c,_0x7118bb){var _0x17fdd1={};var _0x5d230a={};var _0x142f08;var _0x2485b9;return db['CmList']['findOne']({'where':{'id':_0x4e3ad0[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x24')](handleEntityNotFound(_0x45dc8c,null))[_0x1cb9('0x24')](function(_0x208ce1){if(_0x208ce1){_0x142f08=_0x208ce1;_0x5d230a[_0x1cb9('0x34')]=_['keys'](db[_0x1cb9('0x67')][_0x1cb9('0x2d')]);_0x5d230a[_0x1cb9('0x30')]=_[_0x1cb9('0x31')](_0x4e3ad0[_0x1cb9('0x30')]);_0x5d230a['filters']=_['intersection'](_0x5d230a[_0x1cb9('0x34')],_0x5d230a[_0x1cb9('0x30')]);_0x17fdd1[_0x1cb9('0x35')]=_['intersection'](_0x5d230a['model'],qs[_0x1cb9('0x36')](_0x4e3ad0[_0x1cb9('0x30')][_0x1cb9('0x36')]));_0x17fdd1['attributes']=_0x17fdd1['attributes']['length']?_0x17fdd1[_0x1cb9('0x35')]:_0x5d230a[_0x1cb9('0x34')];_0x17fdd1[_0x1cb9('0x3a')]=qs['sort'](_0x4e3ad0[_0x1cb9('0x30')]['sort']);_0x17fdd1[_0x1cb9('0x3b')]=qs[_0x1cb9('0x32')](_[_0x1cb9('0x3c')](_0x4e3ad0[_0x1cb9('0x30')],_0x5d230a[_0x1cb9('0x32')]));_0x17fdd1['where']=_[_0x1cb9('0x3e')](_0x17fdd1['where'],{'$or':[{'ListId':_0x208ce1['id']},{'ListId':null}]});if(_0x4e3ad0[_0x1cb9('0x30')][_0x1cb9('0x3d')]){_0x17fdd1[_0x1cb9('0x3b')]=_[_0x1cb9('0x3e')](_0x17fdd1[_0x1cb9('0x3b')],{'$or':_['map'](_0x17fdd1[_0x1cb9('0x35')],function(_0x174147){var _0xb4ea43={};_0xb4ea43[_0x174147]={'$like':'%'+_0x4e3ad0[_0x1cb9('0x30')][_0x1cb9('0x3d')]+'%'};return _0xb4ea43;})});}_0x17fdd1=_[_0x1cb9('0x3e')]({},_0x17fdd1,_0x4e3ad0[_0x1cb9('0x41')]);return db['CmCustomField']['findAndCountAll'](_0x17fdd1);}})[_0x1cb9('0x24')](respondWithResult(_0x45dc8c,null))[_0x1cb9('0x50')](handleError(_0x45dc8c,null));};exports[_0x1cb9('0x87')]=function(_0x1cdff0,_0x106fe7,_0x54b0d0){return db[_0x1cb9('0x2c')][_0x1cb9('0x46')]({'where':{'id':_0x1cdff0['params']['id']}})['then'](handleEntityNotFound(_0x106fe7,null))[_0x1cb9('0x24')](function(_0x48c8e7){if(_0x48c8e7){return _0x48c8e7[_0x1cb9('0x87')](_0x1cdff0['body'][_0x1cb9('0x60')],_[_0x1cb9('0x5f')](_0x1cdff0[_0x1cb9('0x48')],[_0x1cb9('0x60'),'id'])||{})[_0x1cb9('0x88')](function(_0x345e13){for(var _0x2c7326=0x0;_0x2c7326<_0x1cdff0[_0x1cb9('0x48')][_0x1cb9('0x60')][_0x1cb9('0x37')];_0x2c7326+=0x1){socket[_0x1cb9('0x89')](_0x1cb9('0x8a'),{'UserId':_0x1cdff0['body']['ids'][_0x2c7326],'CmListId':_0x1cdff0['params']['id']});}return _0x345e13;});}})['then'](respondWithResult(_0x106fe7,null))[_0x1cb9('0x50')](handleError(_0x106fe7,null));};exports[_0x1cb9('0x8b')]=function(_0x550877,_0x5b2b21,_0x4e46c1){return db[_0x1cb9('0x2c')][_0x1cb9('0x46')]({'where':{'id':_0x550877[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x24')](handleEntityNotFound(_0x5b2b21,null))['then'](function(_0x178cba){if(_0x178cba){return _0x178cba[_0x1cb9('0x8b')](_0x550877[_0x1cb9('0x30')]['ids'])[_0x1cb9('0x24')](function(){if(_[_0x1cb9('0x5c')](_0x550877['query'][_0x1cb9('0x60')])){for(var _0x57c3c4=0x0;_0x57c3c4<_0x550877[_0x1cb9('0x30')][_0x1cb9('0x60')][_0x1cb9('0x37')];_0x57c3c4+=0x1){socket[_0x1cb9('0x89')](_0x1cb9('0x8c'),{'UserId':Number(_0x550877[_0x1cb9('0x30')][_0x1cb9('0x60')][_0x57c3c4]),'CmListId':Number(_0x550877['params']['id'])});}}else{socket[_0x1cb9('0x89')](_0x1cb9('0x8c'),{'UserId':Number(_0x550877[_0x1cb9('0x30')][_0x1cb9('0x60')]),'CmListId':Number(_0x550877[_0x1cb9('0x45')]['id'])});}});}})[_0x1cb9('0x24')](respondWithStatusCode(_0x5b2b21,null))[_0x1cb9('0x50')](handleError(_0x5b2b21,null));};exports[_0x1cb9('0x8d')]=function(_0x181146,_0x394a89,_0x4a050d){var _0x183dbf={};var _0x32f255={};var _0x32be25;var _0x3e9fca;return db[_0x1cb9('0x2c')]['findOne']({'where':{'id':_0x181146[_0x1cb9('0x45')]['id']}})['then'](handleEntityNotFound(_0x394a89,null))['then'](function(_0x44f38a){if(_0x44f38a){_0x32be25=_0x44f38a;_0x32f255[_0x1cb9('0x34')]=_[_0x1cb9('0x31')](db[_0x1cb9('0x8e')][_0x1cb9('0x2d')]);_0x32f255[_0x1cb9('0x30')]=_[_0x1cb9('0x31')](_0x181146[_0x1cb9('0x30')]);_0x32f255[_0x1cb9('0x32')]=_['intersection'](_0x32f255['model'],_0x32f255[_0x1cb9('0x30')]);_0x183dbf[_0x1cb9('0x35')]=_[_0x1cb9('0x33')](_0x32f255[_0x1cb9('0x34')],qs[_0x1cb9('0x36')](_0x181146[_0x1cb9('0x30')][_0x1cb9('0x36')]));_0x183dbf[_0x1cb9('0x35')]=_0x183dbf[_0x1cb9('0x35')][_0x1cb9('0x37')]?_0x183dbf['attributes']:_0x32f255[_0x1cb9('0x34')];_0x183dbf[_0x1cb9('0x3a')]=qs[_0x1cb9('0x56')](_0x181146[_0x1cb9('0x30')][_0x1cb9('0x56')]);_0x183dbf[_0x1cb9('0x3b')]=qs['filters'](_[_0x1cb9('0x3c')](_0x181146[_0x1cb9('0x30')],_0x32f255[_0x1cb9('0x32')]));if(_0x181146[_0x1cb9('0x30')][_0x1cb9('0x3d')]){_0x183dbf[_0x1cb9('0x3b')]=_[_0x1cb9('0x3e')](_0x183dbf['where'],{'$or':_[_0x1cb9('0x2b')](_0x183dbf[_0x1cb9('0x35')],function(_0x276900){var _0x45c0e6={};_0x45c0e6[_0x276900]={'$like':'%'+_0x181146[_0x1cb9('0x30')][_0x1cb9('0x3d')]+'%'};return _0x45c0e6;})});}_0x183dbf=_[_0x1cb9('0x3e')]({},_0x183dbf,_0x181146[_0x1cb9('0x41')]);return _0x32be25[_0x1cb9('0x8d')](_0x183dbf);}})[_0x1cb9('0x24')](function(_0x27390a){if(_0x27390a){_0x3e9fca=_0x27390a[_0x1cb9('0x37')];if(!_0x181146[_0x1cb9('0x30')][_0x1cb9('0x38')](_0x1cb9('0x39'))){_0x183dbf[_0x1cb9('0x20')]=qs[_0x1cb9('0x20')](_0x181146[_0x1cb9('0x30')][_0x1cb9('0x20')]);_0x183dbf[_0x1cb9('0x1f')]=qs[_0x1cb9('0x1f')](_0x181146[_0x1cb9('0x30')]['offset']);}return _0x32be25[_0x1cb9('0x8d')](_0x183dbf);}})[_0x1cb9('0x24')](function(_0x16ec06){if(_0x16ec06){return _0x16ec06?{'count':_0x3e9fca,'rows':_0x16ec06}:null;}})[_0x1cb9('0x24')](respondWithResult(_0x394a89,null))[_0x1cb9('0x50')](handleError(_0x394a89,null));}; \ No newline at end of file +var _0x9c44=['fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','update','body','describe','ListId','getDispositions','findOne','order','Disposition','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','getContacts','CmCustomField','CustomFields','concat','raw','getContactsCsv','cf_%d','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','Sequelize','type','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','emit','userCmList:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','localhost','./cmList.socket','register','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','get','Lists','UserProfileResource','destroy','then','end','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','key','model','query','filters','intersection'];(function(_0x43a45b,_0x1edd3b){var _0x394b2a=function(_0xf53613){while(--_0xf53613){_0x43a45b['push'](_0x43a45b['shift']());}};_0x394b2a(++_0x1edd3b);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var as=require(_0x49c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x11'))(_0x49c4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49c4('0x13'))['db'];config[_0x49c4('0x14')]=_['defaults'](config[_0x49c4('0x14')],{'host':_0x49c4('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x49c4('0x14')]));require(_0x49c4('0x16'))[_0x49c4('0x17')](socket);function respondWithStatusCode(_0x2decee,_0x12777c){_0x12777c=_0x12777c||0xcc;return function(_0x18211c){if(_0x18211c){return _0x2decee[_0x49c4('0x18')](_0x12777c);}return _0x2decee[_0x49c4('0x19')](_0x12777c)['end']();};}function respondWithResult(_0x3acd06,_0x141003){_0x141003=_0x141003||0xc8;return function(_0x13a2db){if(_0x13a2db){return _0x3acd06[_0x49c4('0x19')](_0x141003)[_0x49c4('0x1a')](_0x13a2db);}};}function respondWithFilteredResult(_0x53e3a2,_0x44e607){return function(_0x2891f4){if(_0x2891f4){var _0x4c3253=_0x2891f4[_0x49c4('0x1b')],_0x512650=_0x44e607['offset'],_0x3c782d=_0x44e607[_0x49c4('0x1c')]+_0x44e607['limit'],_0x2f82d5;if(_0x3c782d>=_0x4c3253){_0x3c782d=_0x4c3253;_0x2f82d5=0xc8;}else{_0x2f82d5=0xce;}_0x53e3a2[_0x49c4('0x19')](_0x2f82d5);return _0x53e3a2[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x512650+'-'+_0x3c782d+'/'+_0x4c3253)[_0x49c4('0x1a')](_0x2891f4);}return null;};}function patchUpdates(_0x382040){return function(_0x41078c){try{jsonpatch[_0x49c4('0x1f')](_0x41078c,_0x382040,!![]);}catch(_0x46e475){return BPromise[_0x49c4('0x20')](_0x46e475);}return _0x41078c['save']();};}function saveUpdates(_0x527126,_0x57f502){return function(_0x1c99b1){if(_0x1c99b1){return _0x1c99b1['update'](_0x527126)['then'](function(_0x2263ae){return _0x2263ae;});}return null;};}function removeEntity(_0x15581b,_0x26c640){return function(_0xd335e4){if(_0xd335e4){return _0xd335e4['destroy']()['then'](function(){var _0x180276=_0xd335e4[_0x49c4('0x21')]({'plain':!![]});var _0x565423=_0x49c4('0x22');return db[_0x49c4('0x23')][_0x49c4('0x24')]({'where':{'type':_0x565423,'resourceId':_0x180276['id']}})[_0x49c4('0x25')](function(){return _0xd335e4;});})['then'](function(){_0x15581b['status'](0xcc)[_0x49c4('0x26')]();});}};}function handleEntityNotFound(_0x53c199,_0x3800b7){return function(_0x3852b2){if(!_0x3852b2){_0x53c199[_0x49c4('0x18')](0x194);}return _0x3852b2;};}function handleError(_0x372a47,_0x5987ae){_0x5987ae=_0x5987ae||0x1f4;return function(_0x889909){logger[_0x49c4('0x27')](_0x889909[_0x49c4('0x28')]);if(_0x889909[_0x49c4('0x29')]){delete _0x889909[_0x49c4('0x29')];}_0x372a47[_0x49c4('0x19')](_0x5987ae)[_0x49c4('0x2a')](_0x889909);};}exports[_0x49c4('0x2b')]=function(_0x17b50f,_0x2cbd88){var _0x46f7ea={},_0x4ea6ea={},_0x4f4495={'count':0x0,'rows':[]};var _0x59eb84=_[_0x49c4('0x2c')](db[_0x49c4('0x2d')][_0x49c4('0x2e')],function(_0x27e467){return{'name':_0x27e467[_0x49c4('0x2f')],'type':_0x27e467['type'][_0x49c4('0x30')]};});_0x4ea6ea[_0x49c4('0x31')]=_[_0x49c4('0x2c')](_0x59eb84,_0x49c4('0x29'));_0x4ea6ea['query']=_['keys'](_0x17b50f[_0x49c4('0x32')]);_0x4ea6ea[_0x49c4('0x33')]=_[_0x49c4('0x34')](_0x4ea6ea[_0x49c4('0x31')],_0x4ea6ea[_0x49c4('0x32')]);_0x46f7ea['attributes']=_[_0x49c4('0x34')](_0x4ea6ea[_0x49c4('0x31')],qs[_0x49c4('0x35')](_0x17b50f['query']['fields']));_0x46f7ea[_0x49c4('0x36')]=_0x46f7ea[_0x49c4('0x36')][_0x49c4('0x37')]?_0x46f7ea[_0x49c4('0x36')]:_0x4ea6ea[_0x49c4('0x31')];if(!_0x17b50f[_0x49c4('0x32')][_0x49c4('0x38')](_0x49c4('0x39'))){_0x46f7ea[_0x49c4('0x3a')]=qs['limit'](_0x17b50f[_0x49c4('0x32')]['limit']);_0x46f7ea[_0x49c4('0x1c')]=qs[_0x49c4('0x1c')](_0x17b50f[_0x49c4('0x32')][_0x49c4('0x1c')]);}_0x46f7ea['order']=qs[_0x49c4('0x3b')](_0x17b50f[_0x49c4('0x32')][_0x49c4('0x3b')]);_0x46f7ea['where']=qs[_0x49c4('0x33')](_[_0x49c4('0x3c')](_0x17b50f[_0x49c4('0x32')],_0x4ea6ea[_0x49c4('0x33')]));if(_0x17b50f[_0x49c4('0x32')][_0x49c4('0x3d')]){_0x46f7ea[_0x49c4('0x3e')]=_[_0x49c4('0x3f')](_0x46f7ea[_0x49c4('0x3e')],{'$or':_[_0x49c4('0x2c')](_0x59eb84,function(_0x1e506a){if(_0x1e506a['type']!==_0x49c4('0x40')){var _0x20cd21={};_0x20cd21[_0x1e506a[_0x49c4('0x29')]]={'$like':'%'+_0x17b50f[_0x49c4('0x32')][_0x49c4('0x3d')]+'%'};return _0x20cd21;}})});}_0x46f7ea=_[_0x49c4('0x3f')]({},_0x46f7ea,_0x17b50f[_0x49c4('0x41')]);var _0xc9722b={'where':_0x46f7ea[_0x49c4('0x3e')]};return db[_0x49c4('0x2d')][_0x49c4('0x1b')](_0xc9722b)[_0x49c4('0x25')](function(_0x326142){_0x4f4495['count']=_0x326142;if(_0x17b50f[_0x49c4('0x32')]['includeAll']){_0x46f7ea[_0x49c4('0x42')]=[{'all':!![]}];}return db[_0x49c4('0x2d')][_0x49c4('0x43')](_0x46f7ea);})[_0x49c4('0x25')](function(_0x239327){_0x4f4495[_0x49c4('0x44')]=_0x239327;return _0x4f4495;})['then'](respondWithFilteredResult(_0x2cbd88,_0x46f7ea))['catch'](handleError(_0x2cbd88,null));};exports[_0x49c4('0x45')]=function(_0x1e7bdc,_0x38349b){var _0x117151={'raw':![],'where':{'id':_0x1e7bdc[_0x49c4('0x46')]['id']}},_0x490823={};_0x490823[_0x49c4('0x31')]=_[_0x49c4('0x47')](db[_0x49c4('0x2d')][_0x49c4('0x2e')]);_0x490823[_0x49c4('0x32')]=_[_0x49c4('0x47')](_0x1e7bdc[_0x49c4('0x32')]);_0x490823[_0x49c4('0x33')]=_['intersection'](_0x490823[_0x49c4('0x31')],_0x490823['query']);_0x117151[_0x49c4('0x36')]=_[_0x49c4('0x34')](_0x490823[_0x49c4('0x31')],qs[_0x49c4('0x35')](_0x1e7bdc[_0x49c4('0x32')]['fields']));_0x117151[_0x49c4('0x36')]=_0x117151[_0x49c4('0x36')][_0x49c4('0x37')]?_0x117151[_0x49c4('0x36')]:_0x490823[_0x49c4('0x31')];if(_0x1e7bdc[_0x49c4('0x32')][_0x49c4('0x48')]){_0x117151['include']=[{'all':!![]}];}_0x117151=_[_0x49c4('0x3f')]({},_0x117151,_0x1e7bdc['options']);return db[_0x49c4('0x2d')][_0x49c4('0x49')](_0x117151)[_0x49c4('0x25')](handleEntityNotFound(_0x38349b,null))[_0x49c4('0x25')](respondWithResult(_0x38349b,null))[_0x49c4('0x4a')](handleError(_0x38349b,null));};exports[_0x49c4('0x4b')]=function(_0x2c6be1,_0x506c71){return db[_0x49c4('0x2d')][_0x49c4('0x4b')](_0x2c6be1['body'],{})[_0x49c4('0x25')](function(_0xaece5f){var _0xfbe179=_0x2c6be1[_0x49c4('0x4c')]['get']({'plain':!![]});if(!_0xfbe179)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfbe179[_0x49c4('0x4d')]==='user'){var _0x4597c3=_0xaece5f[_0x49c4('0x21')]({'plain':!![]});var _0x3811b2=_0x49c4('0x22');return db[_0x49c4('0x4e')][_0x49c4('0x49')]({'where':{'name':_0x3811b2,'userProfileId':_0xfbe179[_0x49c4('0x4f')]},'raw':!![]})['then'](function(_0x1f26c2){if(_0x1f26c2&&_0x1f26c2[_0x49c4('0x50')]===0x0){return db[_0x49c4('0x23')][_0x49c4('0x4b')]({'name':_0x4597c3[_0x49c4('0x29')],'resourceId':_0x4597c3['id'],'type':_0x1f26c2[_0x49c4('0x29')],'sectionId':_0x1f26c2['id']},{})[_0x49c4('0x25')](function(){return _0xaece5f;});}else{return _0xaece5f;}})[_0x49c4('0x4a')](function(_0x1e0b4f){logger[_0x49c4('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e0b4f);throw _0x1e0b4f;});}return _0xaece5f;})['then'](respondWithResult(_0x506c71,0xc9))[_0x49c4('0x4a')](handleError(_0x506c71,null));};exports[_0x49c4('0x51')]=function(_0x527e74,_0x59a8bc){if(_0x527e74[_0x49c4('0x52')]['id']){delete _0x527e74['body']['id'];}return db['CmList'][_0x49c4('0x49')]({'where':{'id':_0x527e74[_0x49c4('0x46')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x59a8bc,null))[_0x49c4('0x25')](saveUpdates(_0x527e74[_0x49c4('0x52')],null))[_0x49c4('0x25')](respondWithResult(_0x59a8bc,null))[_0x49c4('0x4a')](handleError(_0x59a8bc,null));};exports['destroy']=function(_0x859dde,_0xcc6a2b){return db[_0x49c4('0x2d')][_0x49c4('0x49')]({'where':{'id':_0x859dde[_0x49c4('0x46')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0xcc6a2b,null))['then'](removeEntity(_0xcc6a2b,null))['catch'](handleError(_0xcc6a2b,null));};exports[_0x49c4('0x53')]=function(_0x155c43,_0x2a6308){return db[_0x49c4('0x2d')][_0x49c4('0x53')]()[_0x49c4('0x25')](respondWithResult(_0x2a6308,null))[_0x49c4('0x4a')](handleError(_0x2a6308,null));};exports['addDisposition']=function(_0x45d715,_0x33c9a6,_0x4ba4eb){if(_0x45d715[_0x49c4('0x52')]['id']){delete _0x45d715['body']['id'];}return db[_0x49c4('0x2d')][_0x49c4('0x49')]({'where':{'id':_0x45d715[_0x49c4('0x46')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x33c9a6,null))[_0x49c4('0x25')](function(_0x3e44d7){if(_0x3e44d7){_0x45d715[_0x49c4('0x52')][_0x49c4('0x54')]=_0x3e44d7['id'];return db['Disposition'][_0x49c4('0x4b')](_0x45d715[_0x49c4('0x52')]);}})['then'](respondWithResult(_0x33c9a6,null))[_0x49c4('0x4a')](handleError(_0x33c9a6,null));};exports[_0x49c4('0x55')]=function(_0x4fefbd,_0x39c455,_0x42e0e6){var _0x4f50bf={'raw':![],'where':{}};var _0x4dc54d={};var _0x589484={'count':0x0,'rows':[]};return db['CmList'][_0x49c4('0x56')]({'where':{'id':_0x4fefbd['params']['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x39c455,null))[_0x49c4('0x25')](function(_0x515240){if(_0x515240){_0x4dc54d[_0x49c4('0x31')]=_[_0x49c4('0x47')](db['Disposition'][_0x49c4('0x2e')]);_0x4dc54d[_0x49c4('0x32')]=_[_0x49c4('0x47')](_0x4fefbd[_0x49c4('0x32')]);_0x4dc54d['filters']=_[_0x49c4('0x34')](_0x4dc54d[_0x49c4('0x31')],_0x4dc54d[_0x49c4('0x32')]);_0x4f50bf[_0x49c4('0x36')]=_['intersection'](_0x4dc54d[_0x49c4('0x31')],qs['fields'](_0x4fefbd['query']['fields']));_0x4f50bf['attributes']=_0x4f50bf[_0x49c4('0x36')][_0x49c4('0x37')]?_0x4f50bf[_0x49c4('0x36')]:_0x4dc54d[_0x49c4('0x31')];if(!_0x4fefbd['query']['hasOwnProperty'](_0x49c4('0x39'))){_0x4f50bf[_0x49c4('0x3a')]=qs[_0x49c4('0x3a')](_0x4fefbd[_0x49c4('0x32')][_0x49c4('0x3a')]);_0x4f50bf[_0x49c4('0x1c')]=qs[_0x49c4('0x1c')](_0x4fefbd[_0x49c4('0x32')]['offset']);}_0x4f50bf[_0x49c4('0x57')]=qs['sort'](_0x4fefbd[_0x49c4('0x32')][_0x49c4('0x3b')]);_0x4f50bf[_0x49c4('0x3e')]=qs[_0x49c4('0x33')](_[_0x49c4('0x3c')](_0x4fefbd[_0x49c4('0x32')],_0x4dc54d[_0x49c4('0x33')]));_0x4f50bf[_0x49c4('0x3e')][_0x49c4('0x54')]=_0x515240['id'];if(_0x4fefbd[_0x49c4('0x32')][_0x49c4('0x3d')]){_0x4f50bf[_0x49c4('0x3e')]=_[_0x49c4('0x3f')](_0x4f50bf[_0x49c4('0x3e')],{'$or':_[_0x49c4('0x2c')](_0x4f50bf[_0x49c4('0x36')],function(_0x371e49){var _0x3485c0={};_0x3485c0[_0x371e49]={'$like':'%'+_0x4fefbd['query']['filter']+'%'};return _0x3485c0;})});}_0x4f50bf=_[_0x49c4('0x3f')]({},_0x4f50bf,_0x4fefbd[_0x49c4('0x41')]);return db['Disposition'][_0x49c4('0x1b')]({'where':_0x4f50bf[_0x49c4('0x3e')]})[_0x49c4('0x25')](function(_0x16e7b1){_0x589484['count']=_0x16e7b1;if(_0x4fefbd['query']['includeAll']){_0x4f50bf[_0x49c4('0x42')]=[{'all':!![]}];}return db[_0x49c4('0x58')][_0x49c4('0x43')](_0x4f50bf);})[_0x49c4('0x25')](function(_0x118fc4){_0x589484[_0x49c4('0x44')]=_0x118fc4;return _0x589484;});}})[_0x49c4('0x25')](respondWithFilteredResult(_0x39c455,_0x4f50bf))[_0x49c4('0x4a')](handleError(_0x39c455,null));};exports[_0x49c4('0x59')]=function(_0x54dea5,_0x363b2e,_0x10fb84){return db[_0x49c4('0x2d')]['find']({'where':{'id':_0x54dea5[_0x49c4('0x46')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x363b2e,null))[_0x49c4('0x25')](function(_0xb6031b){if(_0xb6031b){return _0xb6031b[_0x49c4('0x59')](_0x54dea5[_0x49c4('0x32')][_0x49c4('0x5a')]);}})[_0x49c4('0x25')](respondWithStatusCode(_0x363b2e,null))['catch'](handleError(_0x363b2e,null));};exports[_0x49c4('0x5b')]=function(_0x20e2d5,_0x85540f,_0x18e82b){return db[_0x49c4('0x2d')]['find']({'where':{'id':_0x20e2d5['params']['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x85540f,null))['then'](function(_0x34cf49){if(_0x34cf49){var _0x558880=[];var _0x23516e={'success':[],'errors':[]};return db[_0x49c4('0x5c')][_0x49c4('0x53')]()[_0x49c4('0x25')](function(_0x4eb9f7){if(_0x20e2d5[_0x49c4('0x52')][_0x49c4('0x5d')]&&_[_0x49c4('0x5e')](_0x20e2d5[_0x49c4('0x52')][_0x49c4('0x5d')])){if(_0x20e2d5[_0x49c4('0x52')][_0x49c4('0x5d')][_0x49c4('0x37')]){_0x20e2d5[_0x49c4('0x52')][_0x49c4('0x5d')]=_0x20e2d5['body'][_0x49c4('0x5d')][_0x49c4('0x5f')](';')+';';}else{_0x20e2d5['body'][_0x49c4('0x5d')]=null;}}else{_0x20e2d5['body'][_0x49c4('0x5d')]=null;}if(_0x20e2d5[_0x49c4('0x52')]&&_[_0x49c4('0x5e')](_0x20e2d5[_0x49c4('0x52')])){for(var _0x2c32c0=0x0;_0x2c32c0<_0x20e2d5['body'][_0x49c4('0x37')];_0x2c32c0+=0x1){_0x20e2d5[_0x49c4('0x52')][_0x2c32c0]['ListId']=_0x20e2d5[_0x49c4('0x46')]['id'];_0x558880[_0x49c4('0x60')](_0x20e2d5['body'][_0x2c32c0]);}return BPromise[_0x49c4('0x61')](_0x558880,function(_0x2cb416){return db['CmContact'][_0x49c4('0x4b')](_[_0x49c4('0x62')](_0x2cb416,[_0x49c4('0x5a'),'id'])||{},{'fields':_[_0x49c4('0x47')](_0x4eb9f7),'raw':!![]})['then'](function(_0x999ae2){_0x23516e[_0x49c4('0x63')]['push'](_0x999ae2[_0x49c4('0x64')]);})['catch'](function(_0x4a4cb7){_0x23516e[_0x49c4('0x65')]['push']({'data':_0x2cb416,'error':_0x4a4cb7['message']});});})[_0x49c4('0x25')](function(_0x131064){return _0x23516e;})['catch'](function(_0x23e684){return _0x23e684;});}else{_0x85540f['status'](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0x49c4('0x25')](respondWithResult(_0x85540f,null))[_0x49c4('0x4a')](handleError(_0x85540f,null));};exports[_0x49c4('0x66')]=function(_0x2bfe15,_0x4a5f0b,_0x5b751a){var _0x348693;return db['CmList'][_0x49c4('0x49')]({'where':{'id':_0x2bfe15['params']['id']},'include':[{'model':db[_0x49c4('0x67')],'as':_0x49c4('0x68')}]})[_0x49c4('0x25')](handleEntityNotFound(_0x4a5f0b,null))[_0x49c4('0x25')](function(_0x12d060){if(_0x12d060){_0x348693=_0x12d060;return db[_0x49c4('0x5c')][_0x49c4('0x2e')];}})['then'](function(_0xbde4b2){if(_0xbde4b2){var _0x1518cb={};var _0x44a188={};_0x44a188[_0x49c4('0x31')]=_[_0x49c4('0x69')](_['keys'](_0xbde4b2),_[_0x49c4('0x2c')](_0x348693[_0x49c4('0x68')],function(_0x3f5a6e){return util['format']('cf_%d',_0x3f5a6e['id']);}));_0x44a188[_0x49c4('0x32')]=_[_0x49c4('0x47')](_0x2bfe15[_0x49c4('0x32')]);_0x44a188[_0x49c4('0x33')]=_[_0x49c4('0x34')](_0x44a188['model'],_0x44a188[_0x49c4('0x32')]);_0x1518cb[_0x49c4('0x36')]=_[_0x49c4('0x34')](_0x44a188[_0x49c4('0x31')],qs['fields'](_0x2bfe15['query'][_0x49c4('0x35')]));_0x1518cb[_0x49c4('0x36')]=_0x1518cb[_0x49c4('0x36')][_0x49c4('0x37')]?_0x1518cb[_0x49c4('0x36')]:_0x44a188['model'];if(!_0x2bfe15[_0x49c4('0x32')][_0x49c4('0x38')](_0x49c4('0x39'))){_0x1518cb[_0x49c4('0x3a')]=qs[_0x49c4('0x3a')](_0x2bfe15[_0x49c4('0x32')]['limit']);_0x1518cb[_0x49c4('0x1c')]=qs[_0x49c4('0x1c')](_0x2bfe15[_0x49c4('0x32')][_0x49c4('0x1c')]);}_0x1518cb['order']=qs['sort'](_0x2bfe15[_0x49c4('0x32')]['sort']);_0x1518cb[_0x49c4('0x3e')]=qs['filters'](_[_0x49c4('0x3c')](_0x2bfe15[_0x49c4('0x32')],_0x44a188[_0x49c4('0x33')]));_0x1518cb[_0x49c4('0x6a')]=!![];if(_0x2bfe15['query']['filter']){_0x1518cb[_0x49c4('0x3e')]=_[_0x49c4('0x3f')](_0x1518cb[_0x49c4('0x3e')],{'$or':_['map'](_0x1518cb['attributes'],function(_0x3e7ab3){var _0x4ce733={};_0x4ce733[_0x3e7ab3]={'$like':'%'+_0x2bfe15['query'][_0x49c4('0x3d')]+'%'};return _0x4ce733;})});}_0x1518cb=_['merge']({},_0x1518cb,_0x2bfe15[_0x49c4('0x41')]);return _0x348693[_0x49c4('0x66')](_0x1518cb);}})['then'](respondWithResult(_0x4a5f0b,null))[_0x49c4('0x4a')](handleError(_0x4a5f0b,null));};exports[_0x49c4('0x6b')]=function(_0x49f060,_0x5428a9,_0xdb9820){var _0x493b9a;return db[_0x49c4('0x2d')][_0x49c4('0x49')]({'where':{'id':_0x49f060[_0x49c4('0x46')]['id']},'include':[{'model':db[_0x49c4('0x67')],'as':_0x49c4('0x68')}]})[_0x49c4('0x25')](handleEntityNotFound(_0x5428a9,null))[_0x49c4('0x25')](function(_0x5f07fa){if(_0x5f07fa){_0x493b9a=_0x5f07fa;return db[_0x49c4('0x5c')][_0x49c4('0x2e')];}})[_0x49c4('0x25')](function(_0xcc42bf){if(_0xcc42bf){var _0x3107c9={};var _0x5795e8={};_0x5795e8[_0x49c4('0x31')]=_['concat'](_[_0x49c4('0x47')](_0xcc42bf),_[_0x49c4('0x2c')](_0x493b9a[_0x49c4('0x68')],function(_0x3d662c){return util['format'](_0x49c4('0x6c'),_0x3d662c['id']);}));_0x5795e8[_0x49c4('0x32')]=_[_0x49c4('0x47')](_0x49f060[_0x49c4('0x32')]);_0x5795e8[_0x49c4('0x33')]=_[_0x49c4('0x34')](_0x5795e8['model'],_0x5795e8[_0x49c4('0x32')]);_0x3107c9['attributes']=_[_0x49c4('0x34')](_0x5795e8[_0x49c4('0x31')],qs[_0x49c4('0x35')](_0x49f060[_0x49c4('0x32')]['fields']));_0x3107c9[_0x49c4('0x36')]=_0x3107c9[_0x49c4('0x36')]['length']?_0x3107c9[_0x49c4('0x36')]:_0x5795e8[_0x49c4('0x31')];if(!_0x49f060['query']['hasOwnProperty'](_0x49c4('0x39'))){_0x3107c9[_0x49c4('0x3a')]=qs[_0x49c4('0x3a')](_0x49f060[_0x49c4('0x32')][_0x49c4('0x3a')]);_0x3107c9[_0x49c4('0x1c')]=qs[_0x49c4('0x1c')](_0x49f060[_0x49c4('0x32')][_0x49c4('0x1c')]);}_0x3107c9[_0x49c4('0x57')]=qs[_0x49c4('0x3b')](_0x49f060['query']['sort']);_0x3107c9[_0x49c4('0x3e')]=qs[_0x49c4('0x33')](_[_0x49c4('0x3c')](_0x49f060['query'],_0x5795e8[_0x49c4('0x33')]));_0x3107c9[_0x49c4('0x6a')]=!![];if(_0x49f060['query'][_0x49c4('0x3d')]){_0x3107c9['where']=_[_0x49c4('0x3f')](_0x3107c9[_0x49c4('0x3e')],{'$or':_[_0x49c4('0x2c')](_0x3107c9[_0x49c4('0x36')],function(_0x572433){var _0x2456a0={};_0x2456a0[_0x572433]={'$like':'%'+_0x49f060[_0x49c4('0x32')][_0x49c4('0x3d')]+'%'};return _0x2456a0;})});}_0x3107c9=_[_0x49c4('0x3f')]({},_0x3107c9,_0x49f060[_0x49c4('0x41')]);return _0x493b9a['getContacts'](_0x3107c9);}})['then'](function(_0x5f4d82){if(!_[_0x49c4('0x6d')](_0x5f4d82)){var _0x10655c=toCsv(_0x5f4d82);var _0x228bbb=Date[_0x49c4('0x6e')]();fs[_0x49c4('0x6f')](util['format'](_0x49c4('0x70'),_0x493b9a['id'],_0x228bbb),_0x10655c);_0x5428a9[_0x49c4('0x71')](_0x49c4('0x72'),_0x49c4('0x73')+util['format'](_0x49c4('0x74'),_0x493b9a['id'],_0x228bbb));_0x5428a9[_0x49c4('0x71')](_0x49c4('0x75'),_0x49c4('0x76'));return _0x5428a9[_0x49c4('0x77')](util['format'](_0x49c4('0x70'),_0x493b9a['id'],_0x228bbb));}else{return _0x5428a9[_0x49c4('0x18')](0xcc);}})[_0x49c4('0x4a')](handleError(_0x5428a9,null));};exports['addCustomField']=function(_0x182d2f,_0x11f47f,_0xa1954a){var _0x56341f;delete _0x182d2f[_0x49c4('0x52')]['id'];return db['CmList']['findOne']({'where':{'id':_0x182d2f[_0x49c4('0x46')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x11f47f,null))['then'](function(_0x815b34){if(_0x815b34){return db[_0x49c4('0x78')][_0x49c4('0x79')](function(_0x1ffc9a){return db[_0x49c4('0x67')][_0x49c4('0x4b')](_0x182d2f[_0x49c4('0x52')],{'transaction':_0x1ffc9a})[_0x49c4('0x25')](function(_0x59dbef){_0x56341f=_0x59dbef;return _0x815b34['addCustomFields'](_0x59dbef,{'transaction':_0x1ffc9a});})[_0x49c4('0x25')](function(){var _0x4c85ab={'type':db[_0x49c4('0x7a')]['TEXT'],'transaction':_0x1ffc9a};switch(_0x182d2f['body'][_0x49c4('0x7b')]){case _0x49c4('0x7c'):_0x4c85ab[_0x49c4('0x7b')]=db[_0x49c4('0x7a')][_0x49c4('0x7d')];break;case _0x49c4('0x7e'):_0x4c85ab[_0x49c4('0x7b')]=db[_0x49c4('0x7a')][_0x49c4('0x7f')];break;case _0x49c4('0x80'):_0x4c85ab[_0x49c4('0x7b')]=db[_0x49c4('0x7a')][_0x49c4('0x81')];_0x4c85ab[_0x49c4('0x82')]=![];break;default:}return db['sequelize'][_0x49c4('0x83')][_0x49c4('0x84')](_0x49c4('0x85'),util[_0x49c4('0x86')]('cf_%s',_0x56341f['id']),_0x4c85ab);})['then'](function(){return _0x56341f;});});}})[_0x49c4('0x25')](respondWithResult(_0x11f47f,null))['catch'](handleError(_0x11f47f,null));};exports[_0x49c4('0x87')]=function(_0x1ac087,_0xd6dc2a,_0xfc5a8f){var _0x2bcc8c={};var _0x45a2ef={};var _0x3238e7;var _0xe9e187;return db[_0x49c4('0x2d')][_0x49c4('0x56')]({'where':{'id':_0x1ac087[_0x49c4('0x46')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0xd6dc2a,null))['then'](function(_0x22fdb9){if(_0x22fdb9){_0x3238e7=_0x22fdb9;_0x45a2ef[_0x49c4('0x31')]=_[_0x49c4('0x47')](db['CmCustomField'][_0x49c4('0x2e')]);_0x45a2ef['query']=_[_0x49c4('0x47')](_0x1ac087[_0x49c4('0x32')]);_0x45a2ef[_0x49c4('0x33')]=_[_0x49c4('0x34')](_0x45a2ef['model'],_0x45a2ef[_0x49c4('0x32')]);_0x2bcc8c['attributes']=_['intersection'](_0x45a2ef[_0x49c4('0x31')],qs[_0x49c4('0x35')](_0x1ac087[_0x49c4('0x32')]['fields']));_0x2bcc8c['attributes']=_0x2bcc8c[_0x49c4('0x36')][_0x49c4('0x37')]?_0x2bcc8c[_0x49c4('0x36')]:_0x45a2ef[_0x49c4('0x31')];_0x2bcc8c[_0x49c4('0x57')]=qs[_0x49c4('0x3b')](_0x1ac087[_0x49c4('0x32')][_0x49c4('0x3b')]);_0x2bcc8c[_0x49c4('0x3e')]=qs['filters'](_[_0x49c4('0x3c')](_0x1ac087[_0x49c4('0x32')],_0x45a2ef['filters']));_0x2bcc8c['where']=_[_0x49c4('0x3f')](_0x2bcc8c['where'],{'$or':[{'ListId':_0x22fdb9['id']},{'ListId':null}]});if(_0x1ac087[_0x49c4('0x32')]['filter']){_0x2bcc8c[_0x49c4('0x3e')]=_['merge'](_0x2bcc8c[_0x49c4('0x3e')],{'$or':_[_0x49c4('0x2c')](_0x2bcc8c[_0x49c4('0x36')],function(_0x1ab574){var _0x5b1e3d={};_0x5b1e3d[_0x1ab574]={'$like':'%'+_0x1ac087['query'][_0x49c4('0x3d')]+'%'};return _0x5b1e3d;})});}_0x2bcc8c=_[_0x49c4('0x3f')]({},_0x2bcc8c,_0x1ac087[_0x49c4('0x41')]);return db['CmCustomField'][_0x49c4('0x88')](_0x2bcc8c);}})[_0x49c4('0x25')](respondWithResult(_0xd6dc2a,null))['catch'](handleError(_0xd6dc2a,null));};exports['addAgents']=function(_0x43ca05,_0x269170,_0xa0698d){return db['CmList'][_0x49c4('0x49')]({'where':{'id':_0x43ca05[_0x49c4('0x46')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x269170,null))[_0x49c4('0x25')](function(_0x5a0045){if(_0x5a0045){return _0x5a0045[_0x49c4('0x89')](_0x43ca05['body']['ids'],_[_0x49c4('0x62')](_0x43ca05[_0x49c4('0x52')],[_0x49c4('0x5a'),'id'])||{})[_0x49c4('0x8a')](function(_0x5adb90){for(var _0x32b6e4=0x0;_0x32b6e4<_0x43ca05[_0x49c4('0x52')][_0x49c4('0x5a')][_0x49c4('0x37')];_0x32b6e4+=0x1){socket['emit'](_0x49c4('0x8b'),{'UserId':_0x43ca05['body']['ids'][_0x32b6e4],'CmListId':_0x43ca05[_0x49c4('0x46')]['id']});}return _0x5adb90;});}})[_0x49c4('0x25')](respondWithResult(_0x269170,null))[_0x49c4('0x4a')](handleError(_0x269170,null));};exports['removeAgents']=function(_0x336853,_0x4a874a,_0x30b616){return db[_0x49c4('0x2d')][_0x49c4('0x49')]({'where':{'id':_0x336853[_0x49c4('0x46')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x4a874a,null))[_0x49c4('0x25')](function(_0x2b31ac){if(_0x2b31ac){return _0x2b31ac['removeAgents'](_0x336853[_0x49c4('0x32')][_0x49c4('0x5a')])[_0x49c4('0x25')](function(){if(_[_0x49c4('0x5e')](_0x336853['query']['ids'])){for(var _0x4c15ff=0x0;_0x4c15ff<_0x336853[_0x49c4('0x32')][_0x49c4('0x5a')][_0x49c4('0x37')];_0x4c15ff+=0x1){socket[_0x49c4('0x8c')](_0x49c4('0x8d'),{'UserId':Number(_0x336853[_0x49c4('0x32')][_0x49c4('0x5a')][_0x4c15ff]),'CmListId':Number(_0x336853['params']['id'])});}}else{socket[_0x49c4('0x8c')](_0x49c4('0x8d'),{'UserId':Number(_0x336853['query']['ids']),'CmListId':Number(_0x336853['params']['id'])});}});}})[_0x49c4('0x25')](respondWithStatusCode(_0x4a874a,null))[_0x49c4('0x4a')](handleError(_0x4a874a,null));};exports[_0x49c4('0x8e')]=function(_0x3d0013,_0x1069b9,_0x1480d3){var _0x2f36c6={};var _0x5039fc={};var _0x83440b;var _0x3226c4;return db[_0x49c4('0x2d')][_0x49c4('0x56')]({'where':{'id':_0x3d0013['params']['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x1069b9,null))[_0x49c4('0x25')](function(_0x227c94){if(_0x227c94){_0x83440b=_0x227c94;_0x5039fc[_0x49c4('0x31')]=_[_0x49c4('0x47')](db['User'][_0x49c4('0x2e')]);_0x5039fc['query']=_['keys'](_0x3d0013[_0x49c4('0x32')]);_0x5039fc[_0x49c4('0x33')]=_[_0x49c4('0x34')](_0x5039fc[_0x49c4('0x31')],_0x5039fc[_0x49c4('0x32')]);_0x2f36c6['attributes']=_[_0x49c4('0x34')](_0x5039fc[_0x49c4('0x31')],qs[_0x49c4('0x35')](_0x3d0013['query'][_0x49c4('0x35')]));_0x2f36c6[_0x49c4('0x36')]=_0x2f36c6['attributes'][_0x49c4('0x37')]?_0x2f36c6[_0x49c4('0x36')]:_0x5039fc[_0x49c4('0x31')];_0x2f36c6[_0x49c4('0x57')]=qs[_0x49c4('0x3b')](_0x3d0013[_0x49c4('0x32')][_0x49c4('0x3b')]);_0x2f36c6['where']=qs[_0x49c4('0x33')](_[_0x49c4('0x3c')](_0x3d0013[_0x49c4('0x32')],_0x5039fc[_0x49c4('0x33')]));if(_0x3d0013[_0x49c4('0x32')]['filter']){_0x2f36c6[_0x49c4('0x3e')]=_[_0x49c4('0x3f')](_0x2f36c6[_0x49c4('0x3e')],{'$or':_[_0x49c4('0x2c')](_0x2f36c6[_0x49c4('0x36')],function(_0x50423b){var _0x2582e3={};_0x2582e3[_0x50423b]={'$like':'%'+_0x3d0013[_0x49c4('0x32')][_0x49c4('0x3d')]+'%'};return _0x2582e3;})});}_0x2f36c6=_[_0x49c4('0x3f')]({},_0x2f36c6,_0x3d0013[_0x49c4('0x41')]);return _0x83440b[_0x49c4('0x8e')](_0x2f36c6);}})[_0x49c4('0x25')](function(_0x2a25dc){if(_0x2a25dc){_0x3226c4=_0x2a25dc[_0x49c4('0x37')];if(!_0x3d0013[_0x49c4('0x32')]['hasOwnProperty'](_0x49c4('0x39'))){_0x2f36c6[_0x49c4('0x3a')]=qs[_0x49c4('0x3a')](_0x3d0013[_0x49c4('0x32')][_0x49c4('0x3a')]);_0x2f36c6['offset']=qs['offset'](_0x3d0013[_0x49c4('0x32')][_0x49c4('0x1c')]);}return _0x83440b[_0x49c4('0x8e')](_0x2f36c6);}})[_0x49c4('0x25')](function(_0xd87f7e){if(_0xd87f7e){return _0xd87f7e?{'count':_0x3226c4,'rows':_0xd87f7e}:null;}})[_0x49c4('0x25')](respondWithResult(_0x1069b9,null))['catch'](handleError(_0x1069b9,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index d4b8c3d..8a6712e 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 _0x0ddc=['emit','hasOwnProperty','hook','exports','../../mysqldb','CmList','save','remove'];(function(_0x3132ee,_0x42d88c){var _0x587c6f=function(_0x53bd14){while(--_0x53bd14){_0x3132ee['push'](_0x3132ee['shift']());}};_0x587c6f(++_0x42d88c);}(_0x0ddc,0xec));var _0xc0dd=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x0ddc[_0x580576];return _0x3f55a0;};'use strict';var EventEmitter=require('events');var CmList=require(_0xc0dd('0x0'))['db'][_0xc0dd('0x1')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc0dd('0x2'),'afterUpdate':'update','afterDestroy':_0xc0dd('0x3')};function emitEvent(_0x4e80b3){return function(_0x2e11d5,_0x584748,_0xb691b1){CmListEvents['emit'](_0x4e80b3+':'+_0x2e11d5['id'],_0x2e11d5);CmListEvents[_0xc0dd('0x4')](_0x4e80b3,_0x2e11d5);_0xb691b1(null);};}for(var e in events){if(events[_0xc0dd('0x5')](e)){var event=events[e];CmList[_0xc0dd('0x6')](e,emitEvent(event));}}module[_0xc0dd('0x7')]=CmListEvents; \ No newline at end of file +var _0xe825=['emit','hasOwnProperty','hook','events','../../mysqldb','CmList','setMaxListeners','save','update'];(function(_0x3e7b59,_0x14a4cd){var _0x4bd64a=function(_0x144656){while(--_0x144656){_0x3e7b59['push'](_0x3e7b59['shift']());}};_0x4bd64a(++_0x14a4cd);}(_0xe825,0x198));var _0x5e82=function(_0x2adda5,_0x1c2bd2){_0x2adda5=_0x2adda5-0x0;var _0x1e4dbb=_0xe825[_0x2adda5];return _0x1e4dbb;};'use strict';var EventEmitter=require(_0x5e82('0x0'));var CmList=require(_0x5e82('0x1'))['db'][_0x5e82('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x5e82('0x3')](0x0);var events={'afterCreate':_0x5e82('0x4'),'afterUpdate':_0x5e82('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4a01f8){return function(_0x4acfad,_0x444947,_0x315916){CmListEvents['emit'](_0x4a01f8+':'+_0x4acfad['id'],_0x4acfad);CmListEvents[_0x5e82('0x6')](_0x4a01f8,_0x4acfad);_0x315916(null);};}for(var e in events){if(events[_0x5e82('0x7')](e)){var event=events[e];CmList[_0x5e82('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 edd7a77..dd8d0be 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 _0xfb13=['CmList','cm_lists','util','api','moment','bluebird','path','rimraf','define'];(function(_0x4a91c0,_0x2aa953){var _0x551150=function(_0x165d42){while(--_0x165d42){_0x4a91c0['push'](_0x4a91c0['shift']());}};_0x551150(++_0x2aa953);}(_0xfb13,0x6e));var _0x3fb1=function(_0x539e85,_0x490d2f){_0x539e85=_0x539e85-0x0;var _0x2fb3fa=_0xfb13[_0x539e85];return _0x2fb3fa;};'use strict';var _=require('lodash');var util=require(_0x3fb1('0x0'));var logger=require('../../config/logger')(_0x3fb1('0x1'));var moment=require(_0x3fb1('0x2'));var BPromise=require(_0x3fb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fb1('0x4'));var rimraf=require(_0x3fb1('0x5'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module['exports']=function(_0x158a41,_0x3e2988){return _0x158a41[_0x3fb1('0x6')](_0x3fb1('0x7'),attributes,{'tableName':_0x3fb1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x096f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util'];(function(_0x5aad65,_0x3b76d6){var _0x577ef3=function(_0x5e1239){while(--_0x5e1239){_0x5aad65['push'](_0x5aad65['shift']());}};_0x577ef3(++_0x3b76d6);}(_0x096f,0x108));var _0xf096=function(_0x4e930f,_0x18dab8){_0x4e930f=_0x4e930f-0x0;var _0x24aedf=_0x096f[_0x4e930f];return _0x24aedf;};'use strict';var _=require(_0xf096('0x0'));var util=require(_0xf096('0x1'));var logger=require('../../config/logger')(_0xf096('0x2'));var moment=require(_0xf096('0x3'));var BPromise=require(_0xf096('0x4'));var rp=require(_0xf096('0x5'));var fs=require('fs');var path=require(_0xf096('0x6'));var rimraf=require(_0xf096('0x7'));var config=require(_0xf096('0x8'));var attributes=require(_0xf096('0x9'));module[_0xf096('0xa')]=function(_0x1935c1,_0x18c957){return _0x1935c1[_0xf096('0xb')](_0xf096('0xc'),attributes,{'tableName':_0xf096('0xd'),'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 4608e54..0b90774 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 _0x3b51=['CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request'];(function(_0x393500,_0x1037af){var _0x120d3b=function(_0x17234e){while(--_0x17234e){_0x393500['push'](_0x393500['shift']());}};_0x120d3b(++_0x1037af);}(_0x3b51,0x172));var _0x13b5=function(_0x4494fb,_0x214efb){_0x4494fb=_0x4494fb-0x0;var _0x472e38=_0x3b51[_0x4494fb];return _0x472e38;};'use strict';var _=require(_0x13b5('0x0'));var util=require(_0x13b5('0x1'));var moment=require(_0x13b5('0x2'));var BPromise=require(_0x13b5('0x3'));var rs=require(_0x13b5('0x4'));var fs=require('fs');var Redis=require(_0x13b5('0x5'));var db=require(_0x13b5('0x6'))['db'];var utils=require(_0x13b5('0x7'));var logger=require(_0x13b5('0x8'))(_0x13b5('0x9'));var config=require(_0x13b5('0xa'));var jayson=require(_0x13b5('0xb'));var client=jayson[_0x13b5('0xc')][_0x13b5('0xd')]({'port':0x232a});config[_0x13b5('0xe')]=_['defaults'](config[_0x13b5('0xe')],{'host':_0x13b5('0xf'),'port':0x18eb});var socket=require(_0x13b5('0x10'))(new Redis(config[_0x13b5('0xe')]));require(_0x13b5('0x11'))[_0x13b5('0x12')](socket);function respondWithRpcPromise(_0x4432b0,_0x4b439a,_0x150583){return new BPromise(function(_0x3ed7a5,_0x1d2bdf){return client[_0x13b5('0x13')](_0x4432b0,_0x150583)['then'](function(_0x2c5fe1){logger['info'](_0x13b5('0x14'),_0x4b439a,'request\x20sent');logger[_0x13b5('0x15')](_0x13b5('0x16'),_0x4b439a,_0x13b5('0x17'),JSON[_0x13b5('0x18')](_0x2c5fe1));if(_0x2c5fe1['error']){if(_0x2c5fe1[_0x13b5('0x19')][_0x13b5('0x1a')]===0x1f4){logger[_0x13b5('0x19')](_0x13b5('0x14'),_0x4b439a,_0x2c5fe1[_0x13b5('0x19')][_0x13b5('0x1b')]);return _0x1d2bdf(_0x2c5fe1[_0x13b5('0x19')][_0x13b5('0x1b')]);}logger['error']('CmList,\x20%s,\x20%s',_0x4b439a,_0x2c5fe1[_0x13b5('0x19')]['message']);return _0x3ed7a5(_0x2c5fe1[_0x13b5('0x19')][_0x13b5('0x1b')]);}else{logger['info'](_0x13b5('0x14'),_0x4b439a,_0x13b5('0x17'));_0x3ed7a5(_0x2c5fe1[_0x13b5('0x1c')][_0x13b5('0x1b')]);}})[_0x13b5('0x1d')](function(_0xe880f){logger['error'](_0x13b5('0x14'),_0x4b439a,_0xe880f);_0x1d2bdf(_0xe880f);});});} \ No newline at end of file +var _0xb46a=['util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','register','then','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0xfdc023,_0x57a04c){var _0x2ffab8=function(_0x211570){while(--_0x211570){_0xfdc023['push'](_0xfdc023['shift']());}};_0x2ffab8(++_0x57a04c);}(_0xb46a,0x17f));var _0xab46=function(_0x4c13b5,_0xab0f9){_0x4c13b5=_0x4c13b5-0x0;var _0x16ea94=_0xb46a[_0x4c13b5];return _0x16ea94;};'use strict';var _=require(_0xab46('0x0'));var util=require(_0xab46('0x1'));var moment=require(_0xab46('0x2'));var BPromise=require(_0xab46('0x3'));var rs=require(_0xab46('0x4'));var fs=require('fs');var Redis=require(_0xab46('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xab46('0x6'))('rpc');var config=require(_0xab46('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab46('0x8')]({'port':0x232a});config[_0xab46('0x9')]=_['defaults'](config[_0xab46('0x9')],{'host':_0xab46('0xa'),'port':0x18eb});var socket=require(_0xab46('0xb'))(new Redis(config['redis']));require('./cmList.socket')[_0xab46('0xc')](socket);function respondWithRpcPromise(_0x349a3a,_0x3ce9c7,_0x1bbfd9){return new BPromise(function(_0x321090,_0x1d1be3){return client['request'](_0x349a3a,_0x1bbfd9)[_0xab46('0xd')](function(_0x3f6a28){logger[_0xab46('0xe')]('CmList,\x20%s,\x20%s',_0x3ce9c7,_0xab46('0xf'));logger['debug'](_0xab46('0x10'),_0x3ce9c7,_0xab46('0xf'),JSON[_0xab46('0x11')](_0x3f6a28));if(_0x3f6a28[_0xab46('0x12')]){if(_0x3f6a28[_0xab46('0x12')][_0xab46('0x13')]===0x1f4){logger[_0xab46('0x12')](_0xab46('0x14'),_0x3ce9c7,_0x3f6a28[_0xab46('0x12')][_0xab46('0x15')]);return _0x1d1be3(_0x3f6a28[_0xab46('0x12')]['message']);}logger[_0xab46('0x12')](_0xab46('0x14'),_0x3ce9c7,_0x3f6a28[_0xab46('0x12')][_0xab46('0x15')]);return _0x321090(_0x3f6a28[_0xab46('0x12')][_0xab46('0x15')]);}else{logger[_0xab46('0xe')](_0xab46('0x14'),_0x3ce9c7,'request\x20sent');_0x321090(_0x3f6a28[_0xab46('0x16')]['message']);}})[_0xab46('0x17')](function(_0x14292e){logger[_0xab46('0x12')](_0xab46('0x14'),_0x3ce9c7,_0x14292e);_0x1d1be3(_0x14292e);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 444340d..f9575c9 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 _0xabe8=['./cmList.events','save','remove','emit','removeListener','register','cmList:'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xabe8,0x8c));var _0x8abe=function(_0x5f0de9,_0x366c4){_0x5f0de9=_0x5f0de9-0x0;var _0x511109=_0xabe8[_0x5f0de9];return _0x511109;};'use strict';var CmListEvents=require(_0x8abe('0x0'));var events=[_0x8abe('0x1'),_0x8abe('0x2'),'update'];function createListener(_0x813df4,_0x322fd9){return function(_0x4985b4){_0x322fd9[_0x8abe('0x3')](_0x813df4,_0x4985b4);};}function removeListener(_0x512339,_0x43d155){return function(){CmListEvents[_0x8abe('0x4')](_0x512339,_0x43d155);};}exports[_0x8abe('0x5')]=function(_0x3a24e6){for(var _0x7619bb=0x0,_0x4e49d7=events['length'];_0x7619bb<_0x4e49d7;_0x7619bb++){var _0x27ebd9=events[_0x7619bb];var _0xd686ac=createListener(_0x8abe('0x6')+_0x27ebd9,_0x3a24e6);CmListEvents['on'](_0x27ebd9,_0xd686ac);}}; \ No newline at end of file +var _0x102b=['length','cmList:','save','update','emit','removeListener'];(function(_0xb57d7d,_0x548180){var _0x8b88=function(_0x55673e){while(--_0x55673e){_0xb57d7d['push'](_0xb57d7d['shift']());}};_0x8b88(++_0x548180);}(_0x102b,0x1be));var _0xb102=function(_0x5e5c19,_0x257411){_0x5e5c19=_0x5e5c19-0x0;var _0x320f6c=_0x102b[_0x5e5c19];return _0x320f6c;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xb102('0x0'),'remove',_0xb102('0x1')];function createListener(_0x3e1311,_0x42172c){return function(_0x1be904){_0x42172c[_0xb102('0x2')](_0x3e1311,_0x1be904);};}function removeListener(_0x1402fb,_0x19e35d){return function(){CmListEvents[_0xb102('0x3')](_0x1402fb,_0x19e35d);};}exports['register']=function(_0x3325b7){for(var _0x370baa=0x0,_0xd131eb=events[_0xb102('0x4')];_0x370baa<_0xd131eb;_0x370baa++){var _0x1ee0c0=events[_0x370baa];var _0x5879bb=createListener(_0xb102('0x5')+_0x1ee0c0,_0x3325b7);CmListEvents['on'](_0x1ee0c0,_0x5879bb);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 818d7ca..4fedb13 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 _0xc424=['/:id','show','getDispositions','/:id/contacts','/:id/contacts/csv','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','update','destroy','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x37d4ac,_0x4e47d6){var _0x5e727a=function(_0x5adbff){while(--_0x5adbff){_0x37d4ac['push'](_0x37d4ac['shift']());}};_0x5e727a(++_0x4e47d6);}(_0xc424,0x1ad));var _0x4c42=function(_0x2c5f32,_0x26627a){_0x2c5f32=_0x2c5f32-0x0;var _0xf7e6c9=_0xc424[_0x2c5f32];return _0xf7e6c9;};'use strict';var multer=require(_0x4c42('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4c42('0x1'));var express=require(_0x4c42('0x2'));var router=express[_0x4c42('0x3')]();var auth=require(_0x4c42('0x4'));var interaction=require(_0x4c42('0x5'));var config=require(_0x4c42('0x6'));var controller=require(_0x4c42('0x7'));router[_0x4c42('0x8')]('/',auth[_0x4c42('0x9')](),controller[_0x4c42('0xa')]);router[_0x4c42('0x8')](_0x4c42('0xb'),auth['isAuthenticated'](),controller[_0x4c42('0xc')]);router[_0x4c42('0x8')](_0x4c42('0xd'),auth[_0x4c42('0x9')](),controller[_0x4c42('0xe')]);router[_0x4c42('0x8')]('/:id/dispositions',auth[_0x4c42('0x9')](),controller[_0x4c42('0xf')]);router['get'](_0x4c42('0x10'),auth[_0x4c42('0x9')](),controller['getContacts']);router['get'](_0x4c42('0x11'),auth[_0x4c42('0x9')](),controller['getContactsCsv']);router[_0x4c42('0x8')]('/:id/fields',auth[_0x4c42('0x9')](),controller[_0x4c42('0x12')]);router[_0x4c42('0x8')](_0x4c42('0x13'),auth['isAuthenticated'](),controller[_0x4c42('0x14')]);router[_0x4c42('0x15')]('/',auth[_0x4c42('0x9')](),controller[_0x4c42('0x16')]);router[_0x4c42('0x15')](_0x4c42('0x17'),auth[_0x4c42('0x9')](),controller[_0x4c42('0x18')]);router[_0x4c42('0x15')](_0x4c42('0x10'),auth[_0x4c42('0x9')](),controller[_0x4c42('0x19')]);router['post'](_0x4c42('0x1a'),auth[_0x4c42('0x9')](),controller[_0x4c42('0x1b')]);router[_0x4c42('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x4c42('0x1c')]);router[_0x4c42('0x1d')]('/:id',auth[_0x4c42('0x9')](),controller[_0x4c42('0x1e')]);router['delete'](_0x4c42('0xd'),auth['isAuthenticated'](),controller[_0x4c42('0x1f')]);router['delete'](_0x4c42('0x17'),auth[_0x4c42('0x9')](),controller['removeDispositions']);router[_0x4c42('0x20')](_0x4c42('0x13'),auth[_0x4c42('0x9')](),controller['removeAgents']);module[_0x4c42('0x21')]=router; \ No newline at end of file +var _0xd32b=['/:id/contacts','getContacts','/:id/contacts/csv','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','update','destroy','removeAgents','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x351a91,_0x1b45f6){var _0x430dd3=function(_0x8b51f0){while(--_0x8b51f0){_0x351a91['push'](_0x351a91['shift']());}};_0x430dd3(++_0x1b45f6);}(_0xd32b,0xcc));var _0xbd32=function(_0x18b662,_0x517a09){_0x18b662=_0x18b662-0x0;var _0x1e4ebd=_0xd32b[_0x18b662];return _0x1e4ebd;};'use strict';var multer=require(_0xbd32('0x0'));var util=require(_0xbd32('0x1'));var path=require('path');var timeout=require(_0xbd32('0x2'));var express=require('express');var router=express[_0xbd32('0x3')]();var auth=require(_0xbd32('0x4'));var interaction=require(_0xbd32('0x5'));var config=require(_0xbd32('0x6'));var controller=require('./cmList.controller');router[_0xbd32('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbd32('0x7')](_0xbd32('0x8'),auth[_0xbd32('0x9')](),controller[_0xbd32('0xa')]);router[_0xbd32('0x7')](_0xbd32('0xb'),auth[_0xbd32('0x9')](),controller[_0xbd32('0xc')]);router[_0xbd32('0x7')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xbd32('0x7')](_0xbd32('0xd'),auth[_0xbd32('0x9')](),controller[_0xbd32('0xe')]);router[_0xbd32('0x7')](_0xbd32('0xf'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0xbd32('0x7')]('/:id/fields',auth[_0xbd32('0x9')](),controller[_0xbd32('0x10')]);router['get'](_0xbd32('0x11'),auth[_0xbd32('0x9')](),controller[_0xbd32('0x12')]);router[_0xbd32('0x13')]('/',auth[_0xbd32('0x9')](),controller[_0xbd32('0x14')]);router[_0xbd32('0x13')](_0xbd32('0x15'),auth['isAuthenticated'](),controller[_0xbd32('0x16')]);router[_0xbd32('0x13')](_0xbd32('0xd'),auth[_0xbd32('0x9')](),controller[_0xbd32('0x17')]);router[_0xbd32('0x13')](_0xbd32('0x18'),auth[_0xbd32('0x9')](),controller[_0xbd32('0x19')]);router[_0xbd32('0x13')](_0xbd32('0x11'),auth['isAuthenticated'](),controller[_0xbd32('0x1a')]);router[_0xbd32('0x1b')](_0xbd32('0xb'),auth[_0xbd32('0x9')](),controller[_0xbd32('0x1c')]);router['delete'](_0xbd32('0xb'),auth[_0xbd32('0x9')](),controller[_0xbd32('0x1d')]);router['delete'](_0xbd32('0x15'),auth[_0xbd32('0x9')](),controller['removeDispositions']);router['delete'](_0xbd32('0x11'),auth[_0xbd32('0x9')](),controller[_0xbd32('0x1e')]);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 e3f8403..f60395f 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(_0x138427,_0x8499c6){var _0xb06e82=function(_0x5b13da){while(--_0x5b13da){_0x138427['push'](_0x138427['shift']());}};_0xb06e82(++_0x8499c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x1f5414,_0x348cdc){var _0x25fd3d=function(_0x4919d7){while(--_0x4919d7){_0x1f5414['push'](_0x1f5414['shift']());}};_0x25fd3d(++_0x348cdc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 548f800..f0c56b6 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 _0x0137=['catch','Condition','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','update','body','find','params'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x0137,0x1d8));var _0x7013=function(_0x1bd7b7,_0x18e7c4){_0x1bd7b7=_0x1bd7b7-0x0;var _0x46a408=_0x0137[_0x1bd7b7];return _0x46a408;};'use strict';var pdf=require(_0x7013('0x0'));var emlformat=require(_0x7013('0x1'));var rimraf=require(_0x7013('0x2'));var zipdir=require(_0x7013('0x3'));var jsonpatch=require(_0x7013('0x4'));var rp=require('request-promise');var moment=require(_0x7013('0x5'));var BPromise=require(_0x7013('0x6'));var Mustache=require(_0x7013('0x7'));var util=require(_0x7013('0x8'));var path=require(_0x7013('0x9'));var sox=require(_0x7013('0xa'));var csv=require('to-csv');var ejs=require(_0x7013('0xb'));var fs=require('fs');var _=require(_0x7013('0xc'));var squel=require('squel');var crypto=require(_0x7013('0xd'));var jsforce=require(_0x7013('0xe'));var deskjs=require(_0x7013('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7013('0x10'));var Papa=require(_0x7013('0x11'));var Redis=require(_0x7013('0x12'));var authService=require(_0x7013('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7013('0x14'));var hardwareService=require(_0x7013('0x15'));var logger=require(_0x7013('0x16'))(_0x7013('0x17'));var utils=require(_0x7013('0x18'));var config=require(_0x7013('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17a466,_0x3ea7f0){_0x3ea7f0=_0x3ea7f0||0xcc;return function(_0x2a91b8){if(_0x2a91b8){return _0x17a466[_0x7013('0x1a')](_0x3ea7f0);}return _0x17a466[_0x7013('0x1b')](_0x3ea7f0)[_0x7013('0x1c')]();};}function respondWithResult(_0x1032c1,_0x35ee96){_0x35ee96=_0x35ee96||0xc8;return function(_0x46ac83){if(_0x46ac83){return _0x1032c1[_0x7013('0x1b')](_0x35ee96)[_0x7013('0x1d')](_0x46ac83);}};}function respondWithFilteredResult(_0x4af565,_0x4b2efa){return function(_0x3b41ef){if(_0x3b41ef){var _0x17ac8a=_0x3b41ef['count'],_0x3e1a30=_0x4b2efa['offset'],_0x4651a6=_0x4b2efa[_0x7013('0x1e')]+_0x4b2efa[_0x7013('0x1f')],_0x36beb8;if(_0x4651a6>=_0x17ac8a){_0x4651a6=_0x17ac8a;_0x36beb8=0xc8;}else{_0x36beb8=0xce;}_0x4af565[_0x7013('0x1b')](_0x36beb8);return _0x4af565[_0x7013('0x20')](_0x7013('0x21'),_0x3e1a30+'-'+_0x4651a6+'/'+_0x17ac8a)['json'](_0x3b41ef);}return null;};}function patchUpdates(_0x25a64d){return function(_0x335cad){try{jsonpatch['apply'](_0x335cad,_0x25a64d,!![]);}catch(_0x5990ca){return BPromise[_0x7013('0x22')](_0x5990ca);}return _0x335cad[_0x7013('0x23')]();};}function saveUpdates(_0x1e6e54,_0x5cf9c9){return function(_0x1f8fa2){if(_0x1f8fa2){return _0x1f8fa2['update'](_0x1e6e54)[_0x7013('0x24')](function(_0x2314af){return _0x2314af;});}return null;};}function removeEntity(_0x2f0af8,_0x2ab843){return function(_0x3bb319){if(_0x3bb319){return _0x3bb319[_0x7013('0x25')]()[_0x7013('0x24')](function(){_0x2f0af8[_0x7013('0x1b')](0xcc)[_0x7013('0x1c')]();});}};}function handleEntityNotFound(_0x1ced21,_0x2e6e3d){return function(_0x99f13d){if(!_0x99f13d){_0x1ced21[_0x7013('0x1a')](0x194);}return _0x99f13d;};}function handleError(_0x18a137,_0x35653e){_0x35653e=_0x35653e||0x1f4;return function(_0x1e0a2d){logger[_0x7013('0x26')](_0x1e0a2d[_0x7013('0x27')]);if(_0x1e0a2d[_0x7013('0x28')]){delete _0x1e0a2d[_0x7013('0x28')];}_0x18a137[_0x7013('0x1b')](_0x35653e)['send'](_0x1e0a2d);};}exports[_0x7013('0x29')]=function(_0x1e9507,_0x35d23f){if(_0x1e9507['body']['id']){delete _0x1e9507[_0x7013('0x2a')]['id'];}return db['Condition'][_0x7013('0x2b')]({'where':{'id':_0x1e9507[_0x7013('0x2c')]['id']}})['then'](handleEntityNotFound(_0x35d23f,null))[_0x7013('0x24')](saveUpdates(_0x1e9507['body'],null))[_0x7013('0x24')](respondWithResult(_0x35d23f,null))[_0x7013('0x2d')](handleError(_0x35d23f,null));};exports[_0x7013('0x25')]=function(_0x486343,_0x16166e){return db[_0x7013('0x2e')][_0x7013('0x2b')]({'where':{'id':_0x486343[_0x7013('0x2c')]['id']}})['then'](handleEntityNotFound(_0x16166e,null))[_0x7013('0x24')](removeEntity(_0x16166e,null))[_0x7013('0x2d')](handleError(_0x16166e,null));}; \ No newline at end of file +var _0x2265=['lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','save','update','then','destroy','stack','name','body','find','params','catch','Condition','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x2ba720,_0xc69449){var _0x130f4e=function(_0x24f2da){while(--_0x24f2da){_0x2ba720['push'](_0x2ba720['shift']());}};_0x130f4e(++_0xc69449);}(_0x2265,0xfa));var _0x5226=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x2265[_0x9df060];return _0x338dfe;};'use strict';var pdf=require(_0x5226('0x0'));var emlformat=require(_0x5226('0x1'));var rimraf=require(_0x5226('0x2'));var zipdir=require(_0x5226('0x3'));var jsonpatch=require(_0x5226('0x4'));var rp=require(_0x5226('0x5'));var moment=require(_0x5226('0x6'));var BPromise=require(_0x5226('0x7'));var Mustache=require(_0x5226('0x8'));var util=require(_0x5226('0x9'));var path=require(_0x5226('0xa'));var sox=require(_0x5226('0xb'));var csv=require(_0x5226('0xc'));var ejs=require(_0x5226('0xd'));var fs=require('fs');var _=require(_0x5226('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5226('0xf'));var toCsv=require(_0x5226('0xc'));var querystring=require('querystring');var Papa=require(_0x5226('0x10'));var Redis=require(_0x5226('0x11'));var authService=require(_0x5226('0x12'));var qs=require(_0x5226('0x13'));var as=require(_0x5226('0x14'));var hardwareService=require(_0x5226('0x15'));var logger=require(_0x5226('0x16'))(_0x5226('0x17'));var utils=require(_0x5226('0x18'));var config=require('../../config/environment');var db=require(_0x5226('0x19'))['db'];function respondWithStatusCode(_0x19c300,_0x2ff13b){_0x2ff13b=_0x2ff13b||0xcc;return function(_0x5c1a7f){if(_0x5c1a7f){return _0x19c300[_0x5226('0x1a')](_0x2ff13b);}return _0x19c300['status'](_0x2ff13b)['end']();};}function respondWithResult(_0x46cfae,_0xad8fb){_0xad8fb=_0xad8fb||0xc8;return function(_0x2be035){if(_0x2be035){return _0x46cfae[_0x5226('0x1b')](_0xad8fb)[_0x5226('0x1c')](_0x2be035);}};}function respondWithFilteredResult(_0xcbf98c,_0x126ad3){return function(_0x112b17){if(_0x112b17){var _0x229a5f=_0x112b17[_0x5226('0x1d')],_0x5c5bfc=_0x126ad3['offset'],_0xc05815=_0x126ad3['offset']+_0x126ad3[_0x5226('0x1e')],_0x35b174;if(_0xc05815>=_0x229a5f){_0xc05815=_0x229a5f;_0x35b174=0xc8;}else{_0x35b174=0xce;}_0xcbf98c[_0x5226('0x1b')](_0x35b174);return _0xcbf98c[_0x5226('0x1f')](_0x5226('0x20'),_0x5c5bfc+'-'+_0xc05815+'/'+_0x229a5f)['json'](_0x112b17);}return null;};}function patchUpdates(_0x54757f){return function(_0x48a5fb){try{jsonpatch['apply'](_0x48a5fb,_0x54757f,!![]);}catch(_0x53e905){return BPromise['reject'](_0x53e905);}return _0x48a5fb[_0x5226('0x21')]();};}function saveUpdates(_0x48d455,_0x254ec7){return function(_0x17f51e){if(_0x17f51e){return _0x17f51e[_0x5226('0x22')](_0x48d455)[_0x5226('0x23')](function(_0x225c31){return _0x225c31;});}return null;};}function removeEntity(_0x1bd036,_0x11e546){return function(_0x4b0e3e){if(_0x4b0e3e){return _0x4b0e3e[_0x5226('0x24')]()[_0x5226('0x23')](function(){_0x1bd036[_0x5226('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfa1d48,_0x3798e4){return function(_0x3d80b6){if(!_0x3d80b6){_0xfa1d48[_0x5226('0x1a')](0x194);}return _0x3d80b6;};}function handleError(_0x478c55,_0x4656a1){_0x4656a1=_0x4656a1||0x1f4;return function(_0x4a7f47){logger['error'](_0x4a7f47[_0x5226('0x25')]);if(_0x4a7f47[_0x5226('0x26')]){delete _0x4a7f47[_0x5226('0x26')];}_0x478c55[_0x5226('0x1b')](_0x4656a1)['send'](_0x4a7f47);};}exports['update']=function(_0x565e0f,_0x56ab42){if(_0x565e0f['body']['id']){delete _0x565e0f[_0x5226('0x27')]['id'];}return db['Condition'][_0x5226('0x28')]({'where':{'id':_0x565e0f[_0x5226('0x29')]['id']}})[_0x5226('0x23')](handleEntityNotFound(_0x56ab42,null))['then'](saveUpdates(_0x565e0f['body'],null))[_0x5226('0x23')](respondWithResult(_0x56ab42,null))[_0x5226('0x2a')](handleError(_0x56ab42,null));};exports[_0x5226('0x24')]=function(_0x59df12,_0x1f3345){return db[_0x5226('0x2b')][_0x5226('0x28')]({'where':{'id':_0x59df12[_0x5226('0x29')]['id']}})[_0x5226('0x23')](handleEntityNotFound(_0x1f3345,null))[_0x5226('0x23')](removeEntity(_0x1f3345,null))[_0x5226('0x2a')](handleError(_0x1f3345,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 4ad57bd..f61dfb6 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 _0x71be=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Condition','tools_conditions','lodash'];(function(_0xe4a2e8,_0x150be9){var _0x1441a7=function(_0x2f9071){while(--_0x2f9071){_0xe4a2e8['push'](_0xe4a2e8['shift']());}};_0x1441a7(++_0x150be9);}(_0x71be,0xcf));var _0xe71b=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x71be[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0xe71b('0x0'));var util=require(_0xe71b('0x1'));var logger=require(_0xe71b('0x2'))('api');var moment=require(_0xe71b('0x3'));var BPromise=require(_0xe71b('0x4'));var rp=require(_0xe71b('0x5'));var fs=require('fs');var path=require(_0xe71b('0x6'));var rimraf=require(_0xe71b('0x7'));var config=require(_0xe71b('0x8'));var attributes=require('./condition.attributes');module[_0xe71b('0x9')]=function(_0x22b8fd,_0x440b22){return _0x22b8fd[_0xe71b('0xa')](_0xe71b('0xb'),attributes,{'tableName':_0xe71b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe17=['rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2cd1fb,_0x291f55){var _0x48fd2b=function(_0x18e23e){while(--_0x18e23e){_0x2cd1fb['push'](_0x2cd1fb['shift']());}};_0x48fd2b(++_0x291f55);}(_0xfe17,0x1b9));var _0x7fe1=function(_0x111bb6,_0x9ffdc){_0x111bb6=_0x111bb6-0x0;var _0x5499a3=_0xfe17[_0x111bb6];return _0x5499a3;};'use strict';var _=require('lodash');var util=require(_0x7fe1('0x0'));var logger=require(_0x7fe1('0x1'))(_0x7fe1('0x2'));var moment=require(_0x7fe1('0x3'));var BPromise=require(_0x7fe1('0x4'));var rp=require(_0x7fe1('0x5'));var fs=require('fs');var path=require(_0x7fe1('0x6'));var rimraf=require(_0x7fe1('0x7'));var config=require(_0x7fe1('0x8'));var attributes=require(_0x7fe1('0x9'));module[_0x7fe1('0xa')]=function(_0xc8d2b0,_0x16f29a){return _0xc8d2b0[_0x7fe1('0xb')](_0x7fe1('0xc'),attributes,{'tableName':_0x7fe1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 00e0b8d..ba426f1 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 _0x8d46=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','Condition,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','request\x20sent','debug'];(function(_0x1ed8ed,_0x20955e){var _0x45718c=function(_0x145db8){while(--_0x145db8){_0x1ed8ed['push'](_0x1ed8ed['shift']());}};_0x45718c(++_0x20955e);}(_0x8d46,0x143));var _0x68d4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8d46[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x68d4('0x0'));var util=require(_0x68d4('0x1'));var moment=require('moment');var BPromise=require(_0x68d4('0x2'));var rs=require(_0x68d4('0x3'));var fs=require('fs');var Redis=require(_0x68d4('0x4'));var db=require(_0x68d4('0x5'))['db'];var utils=require(_0x68d4('0x6'));var logger=require(_0x68d4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x68d4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3cd293,_0x2e5cc8,_0x3de303){return new BPromise(function(_0x589312,_0x38156d){return client[_0x68d4('0x9')](_0x3cd293,_0x3de303)[_0x68d4('0xa')](function(_0x4b6e18){logger['info']('Condition,\x20%s,\x20%s',_0x2e5cc8,_0x68d4('0xb'));logger[_0x68d4('0xc')](_0x68d4('0xd'),_0x2e5cc8,_0x68d4('0xb'),JSON[_0x68d4('0xe')](_0x4b6e18));if(_0x4b6e18['error']){if(_0x4b6e18[_0x68d4('0xf')][_0x68d4('0x10')]===0x1f4){logger[_0x68d4('0xf')]('Condition,\x20%s,\x20%s',_0x2e5cc8,_0x4b6e18[_0x68d4('0xf')]['message']);return _0x38156d(_0x4b6e18[_0x68d4('0xf')]['message']);}logger[_0x68d4('0xf')]('Condition,\x20%s,\x20%s',_0x2e5cc8,_0x4b6e18[_0x68d4('0xf')][_0x68d4('0x11')]);return _0x589312(_0x4b6e18[_0x68d4('0xf')][_0x68d4('0x11')]);}else{logger[_0x68d4('0x12')](_0x68d4('0x13'),_0x2e5cc8,_0x68d4('0xb'));_0x589312(_0x4b6e18[_0x68d4('0x14')][_0x68d4('0x11')]);}})['catch'](function(_0x4c1984){logger[_0x68d4('0xf')](_0x68d4('0x13'),_0x2e5cc8,_0x4c1984);_0x38156d(_0x4c1984);});});} \ No newline at end of file +var _0x59d7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x378830,_0xb532d7){var _0x4e4348=function(_0x496bc4){while(--_0x496bc4){_0x378830['push'](_0x378830['shift']());}};_0x4e4348(++_0xb532d7);}(_0x59d7,0xc5));var _0x759d=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0x59d7[_0x296809];return _0x18c0d3;};'use strict';var _=require('lodash');var util=require(_0x759d('0x0'));var moment=require('moment');var BPromise=require(_0x759d('0x1'));var rs=require(_0x759d('0x2'));var fs=require('fs');var Redis=require(_0x759d('0x3'));var db=require(_0x759d('0x4'))['db'];var utils=require(_0x759d('0x5'));var logger=require(_0x759d('0x6'))('rpc');var config=require(_0x759d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x759d('0x8')][_0x759d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5283a7,_0x4362ea,_0x378965){return new BPromise(function(_0x29be2a,_0x1b7d57){return client['request'](_0x5283a7,_0x378965)[_0x759d('0xa')](function(_0x48901d){logger[_0x759d('0xb')](_0x759d('0xc'),_0x4362ea,_0x759d('0xd'));logger[_0x759d('0xe')](_0x759d('0xf'),_0x4362ea,_0x759d('0xd'),JSON[_0x759d('0x10')](_0x48901d));if(_0x48901d[_0x759d('0x11')]){if(_0x48901d['error'][_0x759d('0x12')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x4362ea,_0x48901d[_0x759d('0x11')][_0x759d('0x13')]);return _0x1b7d57(_0x48901d[_0x759d('0x11')][_0x759d('0x13')]);}logger[_0x759d('0x11')](_0x759d('0xc'),_0x4362ea,_0x48901d[_0x759d('0x11')]['message']);return _0x29be2a(_0x48901d[_0x759d('0x11')]['message']);}else{logger[_0x759d('0xb')](_0x759d('0xc'),_0x4362ea,_0x759d('0xd'));_0x29be2a(_0x48901d[_0x759d('0x14')]['message']);}})[_0x759d('0x15')](function(_0x1e0c18){logger[_0x759d('0x11')](_0x759d('0xc'),_0x4362ea,_0x1e0c18);_0x1b7d57(_0x1e0c18);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 6fa2cf6..046dee7 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 _0xc2a6=['update','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','/:id','isAuthenticated'];(function(_0x295a5e,_0x20e1ca){var _0x51d391=function(_0x5c29ef){while(--_0x5c29ef){_0x295a5e['push'](_0x295a5e['shift']());}};_0x51d391(++_0x20e1ca);}(_0xc2a6,0x87));var _0x6c2a=function(_0x4725bc,_0x3c7569){_0x4725bc=_0x4725bc-0x0;var _0x444844=_0xc2a6[_0x4725bc];return _0x444844;};'use strict';var multer=require(_0x6c2a('0x0'));var util=require(_0x6c2a('0x1'));var path=require('path');var timeout=require(_0x6c2a('0x2'));var express=require(_0x6c2a('0x3'));var router=express[_0x6c2a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6c2a('0x5'));var config=require(_0x6c2a('0x6'));var controller=require('./condition.controller');router['put'](_0x6c2a('0x7'),auth[_0x6c2a('0x8')](),controller[_0x6c2a('0x9')]);router[_0x6c2a('0xa')](_0x6c2a('0x7'),auth[_0x6c2a('0x8')](),controller['destroy']);module[_0x6c2a('0xb')]=router; \ No newline at end of file +var _0x5e22=['./condition.controller','put','isAuthenticated','update','delete','exports','multer','util','path','express','Router','../../config/environment'];(function(_0x4880a2,_0x134ca4){var _0xff1f84=function(_0x36490b){while(--_0x36490b){_0x4880a2['push'](_0x4880a2['shift']());}};_0xff1f84(++_0x134ca4);}(_0x5e22,0x11a));var _0x25e2=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x5e22[_0x22f8ab];return _0x2a70e5;};'use strict';var multer=require(_0x25e2('0x0'));var util=require(_0x25e2('0x1'));var path=require(_0x25e2('0x2'));var timeout=require('connect-timeout');var express=require(_0x25e2('0x3'));var router=express[_0x25e2('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x25e2('0x5'));var controller=require(_0x25e2('0x6'));router[_0x25e2('0x7')]('/:id',auth[_0x25e2('0x8')](),controller[_0x25e2('0x9')]);router[_0x25e2('0xa')]('/:id',auth[_0x25e2('0x8')](),controller['destroy']);module[_0x25e2('0xb')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 8e1cbf4..4549355 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 _0x9f5a=['name','sequelize','exports','STRING'];(function(_0x2e726c,_0x1fc328){var _0x4a6de3=function(_0x536485){while(--_0x536485){_0x2e726c['push'](_0x2e726c['shift']());}};_0x4a6de3(++_0x1fc328);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x1b6c27,_0x279694){_0x1b6c27=_0x1b6c27-0x0;var _0x2f38c7=_0x9f5a[_0x1b6c27];return _0x2f38c7;};'use strict';var Sequelize=require(_0xa9f5('0x0'));module[_0xa9f5('0x1')]={'name':{'type':Sequelize[_0xa9f5('0x2')],'allowNull':![],'unique':_0xa9f5('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb2ac=['STRING','name','sequelize','exports'];(function(_0x4fb22c,_0x3a67ef){var _0x819153=function(_0x2875d0){while(--_0x2875d0){_0x4fb22c['push'](_0x4fb22c['shift']());}};_0x819153(++_0x3a67ef);}(_0xb2ac,0x16a));var _0xcb2a=function(_0x2af023,_0x352505){_0x2af023=_0x2af023-0x0;var _0x437526=_0xb2ac[_0x2af023];return _0x437526;};'use strict';var Sequelize=require(_0xcb2a('0x0'));module[_0xcb2a('0x1')]={'name':{'type':Sequelize[_0xcb2a('0x2')],'allowNull':![],'unique':_0xcb2a('0x3')},'description':{'type':Sequelize[_0xcb2a('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 93fa324..2b992e8 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 _0x54ef=['iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./dashboard.socket','sendStatus','end','json','count','offset','set','apply','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','status','error','stack','name','index','map','Dashboard','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x54ef,0x112));var _0xf54e=function(_0x48116f,_0x1bb464){_0x48116f=_0x48116f-0x0;var _0x19c6b9=_0x54ef[_0x48116f];return _0x19c6b9;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var db=require('../../mysqldb')['db'];config[_0xf54e('0x18')]=_['defaults'](config['redis'],{'host':_0xf54e('0x19'),'port':0x18eb});var socket=require(_0xf54e('0x1a'))(new Redis(config[_0xf54e('0x18')]));require(_0xf54e('0x1b'))['register'](socket);function respondWithStatusCode(_0x331732,_0x1bbeaa){_0x1bbeaa=_0x1bbeaa||0xcc;return function(_0x1855fe){if(_0x1855fe){return _0x331732[_0xf54e('0x1c')](_0x1bbeaa);}return _0x331732['status'](_0x1bbeaa)[_0xf54e('0x1d')]();};}function respondWithResult(_0x389abc,_0x3eb415){_0x3eb415=_0x3eb415||0xc8;return function(_0x5c5d00){if(_0x5c5d00){return _0x389abc['status'](_0x3eb415)[_0xf54e('0x1e')](_0x5c5d00);}};}function respondWithFilteredResult(_0x41fb35,_0x1c02e7){return function(_0x9647f){if(_0x9647f){var _0x15cc48=_0x9647f[_0xf54e('0x1f')],_0x3e7d96=_0x1c02e7[_0xf54e('0x20')],_0x2e27b6=_0x1c02e7[_0xf54e('0x20')]+_0x1c02e7['limit'],_0x1ef06e;if(_0x2e27b6>=_0x15cc48){_0x2e27b6=_0x15cc48;_0x1ef06e=0xc8;}else{_0x1ef06e=0xce;}_0x41fb35['status'](_0x1ef06e);return _0x41fb35[_0xf54e('0x21')]('Content-Range',_0x3e7d96+'-'+_0x2e27b6+'/'+_0x15cc48)[_0xf54e('0x1e')](_0x9647f);}return null;};}function patchUpdates(_0x1bfe99){return function(_0x106362){try{jsonpatch[_0xf54e('0x22')](_0x106362,_0x1bfe99,!![]);}catch(_0xf64f12){return BPromise[_0xf54e('0x23')](_0xf64f12);}return _0x106362[_0xf54e('0x24')]();};}function saveUpdates(_0x11985e,_0x3c0169){return function(_0x5f9eea){if(_0x5f9eea){return _0x5f9eea[_0xf54e('0x25')](_0x11985e)['then'](function(_0x6f6d29){return _0x6f6d29;});}return null;};}function removeEntity(_0x54f914,_0x264a8f){return function(_0x272df6){if(_0x272df6){return _0x272df6[_0xf54e('0x26')]()[_0xf54e('0x27')](function(){var _0x3805a7=_0x272df6[_0xf54e('0x28')]({'plain':!![]});var _0x1e08d1=_0xf54e('0x29');return db[_0xf54e('0x2a')][_0xf54e('0x26')]({'where':{'type':_0x1e08d1,'resourceId':_0x3805a7['id']}})[_0xf54e('0x27')](function(){return _0x272df6;});})[_0xf54e('0x27')](function(){_0x54f914[_0xf54e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb3706e,_0x4cbf7c){return function(_0x282c63){if(!_0x282c63){_0xb3706e['sendStatus'](0x194);}return _0x282c63;};}function handleError(_0x15b888,_0x269f47){_0x269f47=_0x269f47||0x1f4;return function(_0x21ba00){logger[_0xf54e('0x2c')](_0x21ba00[_0xf54e('0x2d')]);if(_0x21ba00[_0xf54e('0x2e')]){delete _0x21ba00[_0xf54e('0x2e')];}_0x15b888['status'](_0x269f47)['send'](_0x21ba00);};}exports[_0xf54e('0x2f')]=function(_0x258d29,_0x2ec92e){var _0x16d00f={},_0xb2d4c4={},_0x133cd7={'count':0x0,'rows':[]};var _0x2b5408=_[_0xf54e('0x30')](db[_0xf54e('0x31')][_0xf54e('0x32')],function(_0x5ea0cc){return{'name':_0x5ea0cc['fieldName'],'type':_0x5ea0cc[_0xf54e('0x33')][_0xf54e('0x34')]};});_0xb2d4c4['model']=_[_0xf54e('0x30')](_0x2b5408,_0xf54e('0x2e'));_0xb2d4c4[_0xf54e('0x35')]=_[_0xf54e('0x36')](_0x258d29['query']);_0xb2d4c4['filters']=_['intersection'](_0xb2d4c4[_0xf54e('0x37')],_0xb2d4c4[_0xf54e('0x35')]);_0x16d00f[_0xf54e('0x38')]=_[_0xf54e('0x39')](_0xb2d4c4[_0xf54e('0x37')],qs[_0xf54e('0x3a')](_0x258d29['query']['fields']));_0x16d00f['attributes']=_0x16d00f[_0xf54e('0x38')][_0xf54e('0x3b')]?_0x16d00f['attributes']:_0xb2d4c4['model'];if(!_0x258d29[_0xf54e('0x35')][_0xf54e('0x3c')](_0xf54e('0x3d'))){_0x16d00f['limit']=qs[_0xf54e('0x3e')](_0x258d29[_0xf54e('0x35')]['limit']);_0x16d00f[_0xf54e('0x20')]=qs[_0xf54e('0x20')](_0x258d29[_0xf54e('0x35')][_0xf54e('0x20')]);}_0x16d00f[_0xf54e('0x3f')]=qs[_0xf54e('0x40')](_0x258d29['query']['sort']);_0x16d00f[_0xf54e('0x41')]=qs[_0xf54e('0x42')](_[_0xf54e('0x43')](_0x258d29['query'],_0xb2d4c4[_0xf54e('0x42')]));if(_0x258d29[_0xf54e('0x35')][_0xf54e('0x44')]){_0x16d00f[_0xf54e('0x41')]=_[_0xf54e('0x45')](_0x16d00f[_0xf54e('0x41')],{'$or':_[_0xf54e('0x30')](_0x2b5408,function(_0x1345b0){if(_0x1345b0[_0xf54e('0x33')]!==_0xf54e('0x46')){var _0x1c1f0d={};_0x1c1f0d[_0x1345b0[_0xf54e('0x2e')]]={'$like':'%'+_0x258d29[_0xf54e('0x35')][_0xf54e('0x44')]+'%'};return _0x1c1f0d;}})});}_0x16d00f=_[_0xf54e('0x45')]({},_0x16d00f,_0x258d29['options']);var _0x4f311f={'where':_0x16d00f['where']};return db[_0xf54e('0x31')][_0xf54e('0x1f')](_0x4f311f)['then'](function(_0x3dae9b){_0x133cd7[_0xf54e('0x1f')]=_0x3dae9b;if(_0x258d29[_0xf54e('0x35')]['includeAll']){_0x16d00f[_0xf54e('0x47')]=[{'all':!![]}];}return db[_0xf54e('0x31')][_0xf54e('0x48')](_0x16d00f);})[_0xf54e('0x27')](function(_0x4b1931){_0x133cd7[_0xf54e('0x49')]=_0x4b1931;return _0x133cd7;})[_0xf54e('0x27')](respondWithFilteredResult(_0x2ec92e,_0x16d00f))[_0xf54e('0x4a')](handleError(_0x2ec92e,null));};exports[_0xf54e('0x4b')]=function(_0x47bedd,_0x11c736){var _0x3447fd={'raw':![],'where':{'id':_0x47bedd[_0xf54e('0x4c')]['id']}},_0x40df32={};_0x40df32[_0xf54e('0x37')]=_[_0xf54e('0x36')](db['Dashboard'][_0xf54e('0x32')]);_0x40df32['query']=_[_0xf54e('0x36')](_0x47bedd['query']);_0x40df32[_0xf54e('0x42')]=_[_0xf54e('0x39')](_0x40df32[_0xf54e('0x37')],_0x40df32['query']);_0x3447fd[_0xf54e('0x38')]=_[_0xf54e('0x39')](_0x40df32[_0xf54e('0x37')],qs[_0xf54e('0x3a')](_0x47bedd[_0xf54e('0x35')]['fields']));_0x3447fd[_0xf54e('0x38')]=_0x3447fd[_0xf54e('0x38')][_0xf54e('0x3b')]?_0x3447fd[_0xf54e('0x38')]:_0x40df32['model'];if(_0x47bedd[_0xf54e('0x35')][_0xf54e('0x4d')]){_0x3447fd['include']=[{'all':!![]}];}_0x3447fd=_[_0xf54e('0x45')]({},_0x3447fd,_0x47bedd[_0xf54e('0x4e')]);return db[_0xf54e('0x31')][_0xf54e('0x4f')](_0x3447fd)['then'](handleEntityNotFound(_0x11c736,null))[_0xf54e('0x27')](respondWithResult(_0x11c736,null))[_0xf54e('0x4a')](handleError(_0x11c736,null));};exports[_0xf54e('0x50')]=function(_0xb4654f,_0x346fc9){return db[_0xf54e('0x31')][_0xf54e('0x50')](_0xb4654f[_0xf54e('0x51')],{})[_0xf54e('0x27')](function(_0x21f2f8){var _0xaf9bf0=_0xb4654f[_0xf54e('0x52')][_0xf54e('0x28')]({'plain':!![]});if(!_0xaf9bf0)throw new Error(_0xf54e('0x53'));if(_0xaf9bf0[_0xf54e('0x54')]===_0xf54e('0x52')){var _0x40d8ab=_0x21f2f8[_0xf54e('0x28')]({'plain':!![]});var _0x21fd80=_0xf54e('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x21fd80,'userProfileId':_0xaf9bf0[_0xf54e('0x55')]},'raw':!![]})[_0xf54e('0x27')](function(_0x45861b){if(_0x45861b&&_0x45861b[_0xf54e('0x56')]===0x0){return db[_0xf54e('0x2a')][_0xf54e('0x50')]({'name':_0x40d8ab[_0xf54e('0x2e')],'resourceId':_0x40d8ab['id'],'type':_0x45861b[_0xf54e('0x2e')],'sectionId':_0x45861b['id']},{})[_0xf54e('0x27')](function(){return _0x21f2f8;});}else{return _0x21f2f8;}})[_0xf54e('0x4a')](function(_0x1df308){logger['error'](_0xf54e('0x57'),_0x1df308);throw _0x1df308;});}return _0x21f2f8;})[_0xf54e('0x27')](respondWithResult(_0x346fc9,0xc9))[_0xf54e('0x4a')](handleError(_0x346fc9,null));};exports[_0xf54e('0x58')]=function(_0x1b8f16,_0x30f53b){var _0x18a25f={'where':{'id':_0x1b8f16[_0xf54e('0x4c')]['id']}},_0x58988a={};_0x58988a[_0xf54e('0x37')]=_[_0xf54e('0x36')](db['Dashboard'][_0xf54e('0x32')]);_0x18a25f['attributes']=_[_0xf54e('0x39')](_0x58988a[_0xf54e('0x37')],qs[_0xf54e('0x3a')](_0x1b8f16['query'][_0xf54e('0x3a')]));_0x18a25f[_0xf54e('0x38')]=_0x18a25f[_0xf54e('0x38')][_0xf54e('0x3b')]?_0x18a25f[_0xf54e('0x38')]:_0x58988a[_0xf54e('0x37')];if(_0x1b8f16[_0xf54e('0x35')]['includeAll']){_0x18a25f['include']=[{'all':!![]}];}_0x18a25f=_[_0xf54e('0x45')]({},_0x18a25f,_0x1b8f16[_0xf54e('0x4e')]);return db['Dashboard'][_0xf54e('0x4f')](_0x18a25f)['then'](handleEntityNotFound(_0x30f53b,null))[_0xf54e('0x27')](function(_0x528a64){if(_0x528a64){var _0x324167=_0x528a64[_0xf54e('0x28')]({'plain':!![]});_0x324167=qs[_0xf54e('0x59')](_0x324167,['id',_0xf54e('0x5a'),_0xf54e('0x5b')]);_0x1b8f16[_0xf54e('0x51')]=_['omit'](_0x1b8f16['body'],['id',_0xf54e('0x5a'),_0xf54e('0x5b')]);return db['Dashboard']['create'](_[_0xf54e('0x45')](_0x324167,_0x1b8f16['body']),{'include':_0x1b8f16[_0xf54e('0x35')][_0xf54e('0x4d')]?[{'all':!![]}]:undefined})[_0xf54e('0x27')](function(_0x2b11f8){var _0x1d7c52=_0x1b8f16[_0xf54e('0x52')][_0xf54e('0x28')]({'plain':!![]});if(!_0x1d7c52)throw new Error(_0xf54e('0x53'));if(_0x1d7c52[_0xf54e('0x54')]===_0xf54e('0x52')){var _0x1f9dad=_0x2b11f8[_0xf54e('0x28')]({'plain':!![]});var _0x65bdf2=_0xf54e('0x29');return db['UserProfileSection'][_0xf54e('0x4f')]({'where':{'name':_0x65bdf2,'userProfileId':_0x1d7c52[_0xf54e('0x55')]},'raw':!![]})[_0xf54e('0x27')](function(_0x11908b){if(_0x11908b&&_0x11908b[_0xf54e('0x56')]===0x0){return db['UserProfileResource'][_0xf54e('0x50')]({'name':_0x1f9dad[_0xf54e('0x2e')],'resourceId':_0x1f9dad['id'],'type':_0x11908b['name'],'sectionId':_0x11908b['id']},{})['then'](function(){return _0x2b11f8;});}else{return _0x2b11f8;}})[_0xf54e('0x4a')](function(_0x4b4a2f){logger[_0xf54e('0x2c')](_0xf54e('0x57'),_0x4b4a2f);throw _0x4b4a2f;});}return _0x2b11f8;});}})[_0xf54e('0x27')](respondWithResult(_0x30f53b,0xc9))[_0xf54e('0x4a')](handleError(_0x30f53b,null));};exports['update']=function(_0x2ecda1,_0x5cdb8c){if(_0x2ecda1[_0xf54e('0x51')]['id']){delete _0x2ecda1[_0xf54e('0x51')]['id'];}return db[_0xf54e('0x31')]['find']({'where':{'id':_0x2ecda1[_0xf54e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5cdb8c,null))[_0xf54e('0x27')](saveUpdates(_0x2ecda1[_0xf54e('0x51')],null))['then'](respondWithResult(_0x5cdb8c,null))[_0xf54e('0x4a')](handleError(_0x5cdb8c,null));};exports['destroy']=function(_0x3aa7e5,_0x2df028){return db[_0xf54e('0x31')][_0xf54e('0x4f')]({'where':{'id':_0x3aa7e5[_0xf54e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2df028,null))[_0xf54e('0x27')](removeEntity(_0x2df028,null))[_0xf54e('0x4a')](handleError(_0x2df028,null));};function widgetAttributes(_0x57db6f){try{switch(_0x57db6f[_0xf54e('0x33')]){case _0xf54e('0x5c'):return[{'name':'attrUrl','value':_0x57db6f[_0xf54e('0x5d')]||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f[_0xf54e('0x5e')][0x0]?_0x57db6f['attrs'][0x0][_0xf54e('0x5f')]:undefined)||'https://'}];case _0xf54e('0x60'):return[{'name':_0xf54e('0x61'),'value':_0x57db6f['attrPath']||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f[_0xf54e('0x5e')][0x0]?_0x57db6f[_0xf54e('0x5e')][0x0][_0xf54e('0x5f')]:undefined)||''}];case _0xf54e('0x62'):return[{'name':_0xf54e('0x63'),'value':_0x57db6f[_0xf54e('0x63')]||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f[_0xf54e('0x5e')][0x0]?_0x57db6f[_0xf54e('0x5e')][0x0][_0xf54e('0x5f')]:undefined)||'HH:mm:ss'},{'name':_0xf54e('0x64'),'value':_0x57db6f[_0xf54e('0x64')]||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f['attrs'][0x1]?_0x57db6f[_0xf54e('0x5e')][0x1][_0xf54e('0x5f')]:undefined)||_0xf54e('0x65')},{'name':_0xf54e('0x66'),'value':_0x57db6f[_0xf54e('0x66')]||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f[_0xf54e('0x5e')][0x2]?_0x57db6f['attrs'][0x2][_0xf54e('0x5f')]:undefined)||0xc}];case _0xf54e('0x67'):return[{'name':_0xf54e('0x68'),'value':_0x57db6f['attrMetric']||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f[_0xf54e('0x5e')][0x0]?_0x57db6f[_0xf54e('0x5e')][0x0][_0xf54e('0x5f')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x57db6f[_0xf54e('0x69')]||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f[_0xf54e('0x5e')][0x1]?_0x57db6f[_0xf54e('0x5e')][0x1][_0xf54e('0x5f')]:undefined)||[]},{'name':_0xf54e('0x66'),'value':_0x57db6f[_0xf54e('0x66')]||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f[_0xf54e('0x5e')][0x2]?_0x57db6f[_0xf54e('0x5e')][0x2]['value']:undefined)||0x14}];case _0xf54e('0x6a'):case _0xf54e('0x6b'):return[{'name':_0xf54e('0x6c'),'value':_0x57db6f[_0xf54e('0x6c')]||(_0x57db6f['attrs']&&_0x57db6f[_0xf54e('0x5e')][0x0]?_0x57db6f[_0xf54e('0x5e')][0x0][_0xf54e('0x5f')]:undefined)||_0xf54e('0x6d')},{'name':'attrSerie2','value':_0x57db6f[_0xf54e('0x6e')]||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f[_0xf54e('0x5e')][0x1]?_0x57db6f['attrs'][0x1]['value']:undefined)||null},{'name':_0xf54e('0x6f'),'value':_0x57db6f[_0xf54e('0x6f')]||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f[_0xf54e('0x5e')][0x2]?_0x57db6f[_0xf54e('0x5e')][0x2][_0xf54e('0x5f')]:undefined)||null},{'name':_0xf54e('0x69'),'value':_0x57db6f[_0xf54e('0x69')]||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f['attrs'][0x3]?_0x57db6f[_0xf54e('0x5e')][0x3][_0xf54e('0x5f')]:undefined)||[]}];case _0xf54e('0x70'):return[{'name':_0xf54e('0x71'),'type':_0x57db6f[_0xf54e('0x72')]||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f[_0xf54e('0x5e')][0x0]?_0x57db6f[_0xf54e('0x5e')][0x0][_0xf54e('0x33')]:undefined)||null,'value':_0x57db6f[_0xf54e('0x71')]||(_0x57db6f[_0xf54e('0x5e')]&&_0x57db6f[_0xf54e('0x5e')][0x0]?_0x57db6f['attrs'][0x0][_0xf54e('0x5f')]:undefined)||null},{'name':_0xf54e('0x73'),'value':_0x57db6f['attrRefresh']||(_0x57db6f['attrs']&&_0x57db6f[_0xf54e('0x5e')][0x1]?_0x57db6f[_0xf54e('0x5e')][0x1][_0xf54e('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x3be745){logger[_0xf54e('0x2c')](_0xf54e('0x74'),JSON[_0xf54e('0x75')](_0x3be745));return[];}}exports[_0xf54e('0x76')]=function(_0x244451,_0x570c3a,_0x2bb31f){if(_0x244451[_0xf54e('0x51')]['id']){delete _0x244451[_0xf54e('0x51')]['id'];}return db['Dashboard'][_0xf54e('0x4f')]({'where':{'id':_0x244451['params']['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x570c3a,null))['then'](function(_0xfe35d8){if(_0xfe35d8){_0x244451[_0xf54e('0x51')]['DashboardId']=_0xfe35d8['id'];_0x244451['body'][_0xf54e('0x5e')]=widgetAttributes(_0x244451[_0xf54e('0x51')]);return db[_0xf54e('0x77')][_0xf54e('0x50')](_0x244451[_0xf54e('0x51')]);}})['then'](respondWithResult(_0x570c3a,null))['catch'](handleError(_0x570c3a,null));};exports[_0xf54e('0x78')]=function(_0x331e1f,_0x456159,_0xc31d53){var _0x9afe5={};var _0xe1205={};var _0x7568bf;var _0x138119;return db[_0xf54e('0x31')][_0xf54e('0x79')]({'where':{'id':_0x331e1f['params']['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x456159,null))[_0xf54e('0x27')](function(_0x4d4667){if(_0x4d4667){_0x7568bf=_0x4d4667;_0xe1205['model']=_[_0xf54e('0x36')](db[_0xf54e('0x77')][_0xf54e('0x32')]);_0xe1205[_0xf54e('0x35')]=_[_0xf54e('0x36')](_0x331e1f['query']);_0xe1205[_0xf54e('0x42')]=_[_0xf54e('0x39')](_0xe1205[_0xf54e('0x37')],_0xe1205[_0xf54e('0x35')]);_0x9afe5['attributes']=_[_0xf54e('0x39')](_0xe1205[_0xf54e('0x37')],qs[_0xf54e('0x3a')](_0x331e1f[_0xf54e('0x35')]['fields']));_0x9afe5[_0xf54e('0x38')]=_0x9afe5[_0xf54e('0x38')][_0xf54e('0x3b')]?_0x9afe5[_0xf54e('0x38')]:_0xe1205[_0xf54e('0x37')];_0x9afe5['order']=qs[_0xf54e('0x40')](_0x331e1f['query']['sort']);_0x9afe5[_0xf54e('0x41')]=qs[_0xf54e('0x42')](_[_0xf54e('0x43')](_0x331e1f[_0xf54e('0x35')],_0xe1205[_0xf54e('0x42')]));if(_0x331e1f[_0xf54e('0x35')][_0xf54e('0x44')]){_0x9afe5[_0xf54e('0x41')]=_[_0xf54e('0x45')](_0x9afe5['where'],{'$or':_[_0xf54e('0x30')](_0x9afe5[_0xf54e('0x38')],function(_0x259a3e){var _0x971a3e={};_0x971a3e[_0x259a3e]={'$like':'%'+_0x331e1f[_0xf54e('0x35')][_0xf54e('0x44')]+'%'};return _0x971a3e;})});}_0x9afe5=_['merge']({},_0x9afe5,_0x331e1f[_0xf54e('0x4e')]);return _0x7568bf[_0xf54e('0x78')](_0x9afe5);}})[_0xf54e('0x27')](function(_0x2b46d4){if(_0x2b46d4){_0x138119=_0x2b46d4[_0xf54e('0x3b')];if(!_0x331e1f[_0xf54e('0x35')]['hasOwnProperty'](_0xf54e('0x3d'))){_0x9afe5[_0xf54e('0x3e')]=qs[_0xf54e('0x3e')](_0x331e1f[_0xf54e('0x35')]['limit']);_0x9afe5['offset']=qs[_0xf54e('0x20')](_0x331e1f[_0xf54e('0x35')][_0xf54e('0x20')]);}return _0x7568bf[_0xf54e('0x78')](_0x9afe5);}})[_0xf54e('0x27')](function(_0x14e19e){if(_0x14e19e){return _0x14e19e?{'count':_0x138119,'rows':_0x14e19e}:null;}})['then'](respondWithResult(_0x456159,null))[_0xf54e('0x4a')](handleError(_0x456159,null));}; \ No newline at end of file +var _0x188e=['json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filter','merge','Dashboard','include','findAll','rows','catch','show','keys','includeAll','options','find','user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','pick','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status'];(function(_0x5da877,_0x361726){var _0x3f2c10=function(_0x3a2ebc){while(--_0x3a2ebc){_0x5da877['push'](_0x5da877['shift']());}};_0x3f2c10(++_0x361726);}(_0x188e,0x1cf));var _0xe188=function(_0x1d5ba4,_0x40b3b6){_0x1d5ba4=_0x1d5ba4-0x0;var _0x554955=_0x188e[_0x1d5ba4];return _0x554955;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe188('0x0'));var rimraf=require(_0xe188('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe188('0x2'));var rp=require(_0xe188('0x3'));var moment=require(_0xe188('0x4'));var BPromise=require(_0xe188('0x5'));var Mustache=require(_0xe188('0x6'));var util=require(_0xe188('0x7'));var path=require(_0xe188('0x8'));var sox=require('sox');var csv=require(_0xe188('0x9'));var ejs=require(_0xe188('0xa'));var fs=require('fs');var _=require(_0xe188('0xb'));var squel=require(_0xe188('0xc'));var crypto=require(_0xe188('0xd'));var jsforce=require(_0xe188('0xe'));var deskjs=require(_0xe188('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe188('0x10'));var Papa=require(_0xe188('0x11'));var Redis=require(_0xe188('0x12'));var authService=require(_0xe188('0x13'));var qs=require(_0xe188('0x14'));var as=require(_0xe188('0x15'));var hardwareService=require(_0xe188('0x16'));var logger=require('../../config/logger')(_0xe188('0x17'));var utils=require(_0xe188('0x18'));var config=require(_0xe188('0x19'));var db=require('../../mysqldb')['db'];config[_0xe188('0x1a')]=_[_0xe188('0x1b')](config[_0xe188('0x1a')],{'host':_0xe188('0x1c'),'port':0x18eb});var socket=require(_0xe188('0x1d'))(new Redis(config[_0xe188('0x1a')]));require('./dashboard.socket')[_0xe188('0x1e')](socket);function respondWithStatusCode(_0x3fc589,_0x2c190a){_0x2c190a=_0x2c190a||0xcc;return function(_0x432f4b){if(_0x432f4b){return _0x3fc589[_0xe188('0x1f')](_0x2c190a);}return _0x3fc589[_0xe188('0x20')](_0x2c190a)['end']();};}function respondWithResult(_0x3ae93f,_0x1ff120){_0x1ff120=_0x1ff120||0xc8;return function(_0x4231ad){if(_0x4231ad){return _0x3ae93f['status'](_0x1ff120)[_0xe188('0x21')](_0x4231ad);}};}function respondWithFilteredResult(_0x225447,_0x140c51){return function(_0x28ec69){if(_0x28ec69){var _0x2f1ea2=_0x28ec69[_0xe188('0x22')],_0x1d65d8=_0x140c51['offset'],_0x28d1e8=_0x140c51[_0xe188('0x23')]+_0x140c51['limit'],_0x284c3b;if(_0x28d1e8>=_0x2f1ea2){_0x28d1e8=_0x2f1ea2;_0x284c3b=0xc8;}else{_0x284c3b=0xce;}_0x225447[_0xe188('0x20')](_0x284c3b);return _0x225447[_0xe188('0x24')](_0xe188('0x25'),_0x1d65d8+'-'+_0x28d1e8+'/'+_0x2f1ea2)[_0xe188('0x21')](_0x28ec69);}return null;};}function patchUpdates(_0x1d5ae0){return function(_0x5b0840){try{jsonpatch[_0xe188('0x26')](_0x5b0840,_0x1d5ae0,!![]);}catch(_0x574589){return BPromise[_0xe188('0x27')](_0x574589);}return _0x5b0840[_0xe188('0x28')]();};}function saveUpdates(_0x4f93a7,_0x10c55f){return function(_0x508156){if(_0x508156){return _0x508156[_0xe188('0x29')](_0x4f93a7)[_0xe188('0x2a')](function(_0x4b9ec6){return _0x4b9ec6;});}return null;};}function removeEntity(_0x52856d,_0x3e7640){return function(_0x487906){if(_0x487906){return _0x487906[_0xe188('0x2b')]()[_0xe188('0x2a')](function(){var _0x3d280a=_0x487906[_0xe188('0x2c')]({'plain':!![]});var _0x2f47fc=_0xe188('0x2d');return db[_0xe188('0x2e')]['destroy']({'where':{'type':_0x2f47fc,'resourceId':_0x3d280a['id']}})['then'](function(){return _0x487906;});})['then'](function(){_0x52856d[_0xe188('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2700b8,_0x52282b){return function(_0x5dd9ef){if(!_0x5dd9ef){_0x2700b8['sendStatus'](0x194);}return _0x5dd9ef;};}function handleError(_0x1b2c25,_0x2e8b75){_0x2e8b75=_0x2e8b75||0x1f4;return function(_0x33ef8a){logger[_0xe188('0x2f')](_0x33ef8a[_0xe188('0x30')]);if(_0x33ef8a[_0xe188('0x31')]){delete _0x33ef8a[_0xe188('0x31')];}_0x1b2c25['status'](_0x2e8b75)['send'](_0x33ef8a);};}exports['index']=function(_0x2f008f,_0x166fcd){var _0xf7747d={},_0x1e4cfb={},_0x4c24b1={'count':0x0,'rows':[]};var _0x1d0c3d=_[_0xe188('0x32')](db['Dashboard'][_0xe188('0x33')],function(_0x541074){return{'name':_0x541074[_0xe188('0x34')],'type':_0x541074[_0xe188('0x35')][_0xe188('0x36')]};});_0x1e4cfb[_0xe188('0x37')]=_[_0xe188('0x32')](_0x1d0c3d,_0xe188('0x31'));_0x1e4cfb[_0xe188('0x38')]=_['keys'](_0x2f008f[_0xe188('0x38')]);_0x1e4cfb[_0xe188('0x39')]=_[_0xe188('0x3a')](_0x1e4cfb[_0xe188('0x37')],_0x1e4cfb[_0xe188('0x38')]);_0xf7747d['attributes']=_[_0xe188('0x3a')](_0x1e4cfb[_0xe188('0x37')],qs[_0xe188('0x3b')](_0x2f008f[_0xe188('0x38')][_0xe188('0x3b')]));_0xf7747d[_0xe188('0x3c')]=_0xf7747d[_0xe188('0x3c')][_0xe188('0x3d')]?_0xf7747d[_0xe188('0x3c')]:_0x1e4cfb['model'];if(!_0x2f008f[_0xe188('0x38')]['hasOwnProperty'](_0xe188('0x3e'))){_0xf7747d['limit']=qs[_0xe188('0x3f')](_0x2f008f[_0xe188('0x38')][_0xe188('0x3f')]);_0xf7747d[_0xe188('0x23')]=qs[_0xe188('0x23')](_0x2f008f[_0xe188('0x38')]['offset']);}_0xf7747d[_0xe188('0x40')]=qs[_0xe188('0x41')](_0x2f008f[_0xe188('0x38')][_0xe188('0x41')]);_0xf7747d[_0xe188('0x42')]=qs['filters'](_['pick'](_0x2f008f[_0xe188('0x38')],_0x1e4cfb[_0xe188('0x39')]));if(_0x2f008f[_0xe188('0x38')][_0xe188('0x43')]){_0xf7747d[_0xe188('0x42')]=_[_0xe188('0x44')](_0xf7747d[_0xe188('0x42')],{'$or':_['map'](_0x1d0c3d,function(_0x3ca8cf){if(_0x3ca8cf[_0xe188('0x35')]!=='VIRTUAL'){var _0x737d83={};_0x737d83[_0x3ca8cf[_0xe188('0x31')]]={'$like':'%'+_0x2f008f['query'][_0xe188('0x43')]+'%'};return _0x737d83;}})});}_0xf7747d=_[_0xe188('0x44')]({},_0xf7747d,_0x2f008f['options']);var _0x36ebb6={'where':_0xf7747d[_0xe188('0x42')]};return db[_0xe188('0x45')][_0xe188('0x22')](_0x36ebb6)[_0xe188('0x2a')](function(_0xb078ed){_0x4c24b1[_0xe188('0x22')]=_0xb078ed;if(_0x2f008f[_0xe188('0x38')]['includeAll']){_0xf7747d[_0xe188('0x46')]=[{'all':!![]}];}return db[_0xe188('0x45')][_0xe188('0x47')](_0xf7747d);})['then'](function(_0x1c61f7){_0x4c24b1[_0xe188('0x48')]=_0x1c61f7;return _0x4c24b1;})[_0xe188('0x2a')](respondWithFilteredResult(_0x166fcd,_0xf7747d))[_0xe188('0x49')](handleError(_0x166fcd,null));};exports[_0xe188('0x4a')]=function(_0x2a1508,_0x2cb591){var _0x26e08e={'raw':![],'where':{'id':_0x2a1508['params']['id']}},_0x1bf993={};_0x1bf993[_0xe188('0x37')]=_[_0xe188('0x4b')](db['Dashboard'][_0xe188('0x33')]);_0x1bf993['query']=_[_0xe188('0x4b')](_0x2a1508[_0xe188('0x38')]);_0x1bf993[_0xe188('0x39')]=_[_0xe188('0x3a')](_0x1bf993[_0xe188('0x37')],_0x1bf993['query']);_0x26e08e[_0xe188('0x3c')]=_[_0xe188('0x3a')](_0x1bf993[_0xe188('0x37')],qs[_0xe188('0x3b')](_0x2a1508[_0xe188('0x38')][_0xe188('0x3b')]));_0x26e08e['attributes']=_0x26e08e['attributes'][_0xe188('0x3d')]?_0x26e08e[_0xe188('0x3c')]:_0x1bf993[_0xe188('0x37')];if(_0x2a1508['query'][_0xe188('0x4c')]){_0x26e08e[_0xe188('0x46')]=[{'all':!![]}];}_0x26e08e=_['merge']({},_0x26e08e,_0x2a1508[_0xe188('0x4d')]);return db[_0xe188('0x45')][_0xe188('0x4e')](_0x26e08e)['then'](handleEntityNotFound(_0x2cb591,null))[_0xe188('0x2a')](respondWithResult(_0x2cb591,null))[_0xe188('0x49')](handleError(_0x2cb591,null));};exports['create']=function(_0x330816,_0x56355f){return db[_0xe188('0x45')]['create'](_0x330816['body'],{})['then'](function(_0x47628c){var _0x3868bc=_0x330816[_0xe188('0x4f')]['get']({'plain':!![]});if(!_0x3868bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3868bc[_0xe188('0x50')]===_0xe188('0x4f')){var _0x48631d=_0x47628c[_0xe188('0x2c')]({'plain':!![]});var _0x33927a=_0xe188('0x2d');return db['UserProfileSection'][_0xe188('0x4e')]({'where':{'name':_0x33927a,'userProfileId':_0x3868bc[_0xe188('0x51')]},'raw':!![]})[_0xe188('0x2a')](function(_0x58464e){if(_0x58464e&&_0x58464e[_0xe188('0x52')]===0x0){return db[_0xe188('0x2e')][_0xe188('0x53')]({'name':_0x48631d['name'],'resourceId':_0x48631d['id'],'type':_0x58464e[_0xe188('0x31')],'sectionId':_0x58464e['id']},{})[_0xe188('0x2a')](function(){return _0x47628c;});}else{return _0x47628c;}})['catch'](function(_0x11ddd7){logger[_0xe188('0x2f')](_0xe188('0x54'),_0x11ddd7);throw _0x11ddd7;});}return _0x47628c;})[_0xe188('0x2a')](respondWithResult(_0x56355f,0xc9))['catch'](handleError(_0x56355f,null));};exports['clone']=function(_0x14c27f,_0xcf6092){var _0x4450eb={'where':{'id':_0x14c27f[_0xe188('0x55')]['id']}},_0x452360={};_0x452360['model']=_[_0xe188('0x4b')](db[_0xe188('0x45')][_0xe188('0x33')]);_0x4450eb['attributes']=_['intersection'](_0x452360[_0xe188('0x37')],qs[_0xe188('0x3b')](_0x14c27f['query'][_0xe188('0x3b')]));_0x4450eb['attributes']=_0x4450eb[_0xe188('0x3c')][_0xe188('0x3d')]?_0x4450eb[_0xe188('0x3c')]:_0x452360[_0xe188('0x37')];if(_0x14c27f[_0xe188('0x38')][_0xe188('0x4c')]){_0x4450eb[_0xe188('0x46')]=[{'all':!![]}];}_0x4450eb=_[_0xe188('0x44')]({},_0x4450eb,_0x14c27f['options']);return db['Dashboard'][_0xe188('0x4e')](_0x4450eb)[_0xe188('0x2a')](handleEntityNotFound(_0xcf6092,null))[_0xe188('0x2a')](function(_0x43e994){if(_0x43e994){var _0x200d68=_0x43e994[_0xe188('0x2c')]({'plain':!![]});_0x200d68=qs['omit'](_0x200d68,['id',_0xe188('0x56'),_0xe188('0x57')]);_0x14c27f[_0xe188('0x58')]=_[_0xe188('0x59')](_0x14c27f['body'],['id',_0xe188('0x56'),'updatedAt']);return db[_0xe188('0x45')]['create'](_[_0xe188('0x44')](_0x200d68,_0x14c27f[_0xe188('0x58')]),{'include':_0x14c27f[_0xe188('0x38')][_0xe188('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0x67f5cf){var _0x1b5ad0=_0x14c27f[_0xe188('0x4f')][_0xe188('0x2c')]({'plain':!![]});if(!_0x1b5ad0)throw new Error(_0xe188('0x5a'));if(_0x1b5ad0[_0xe188('0x50')]===_0xe188('0x4f')){var _0x463607=_0x67f5cf[_0xe188('0x2c')]({'plain':!![]});var _0x26902f=_0xe188('0x2d');return db['UserProfileSection'][_0xe188('0x4e')]({'where':{'name':_0x26902f,'userProfileId':_0x1b5ad0[_0xe188('0x51')]},'raw':!![]})[_0xe188('0x2a')](function(_0x3db63f){if(_0x3db63f&&_0x3db63f[_0xe188('0x52')]===0x0){return db[_0xe188('0x2e')][_0xe188('0x53')]({'name':_0x463607[_0xe188('0x31')],'resourceId':_0x463607['id'],'type':_0x3db63f[_0xe188('0x31')],'sectionId':_0x3db63f['id']},{})[_0xe188('0x2a')](function(){return _0x67f5cf;});}else{return _0x67f5cf;}})['catch'](function(_0x45082e){logger[_0xe188('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45082e);throw _0x45082e;});}return _0x67f5cf;});}})[_0xe188('0x2a')](respondWithResult(_0xcf6092,0xc9))[_0xe188('0x49')](handleError(_0xcf6092,null));};exports[_0xe188('0x29')]=function(_0x6bb379,_0x2d4884){if(_0x6bb379[_0xe188('0x58')]['id']){delete _0x6bb379['body']['id'];}return db['Dashboard'][_0xe188('0x4e')]({'where':{'id':_0x6bb379[_0xe188('0x55')]['id']}})[_0xe188('0x2a')](handleEntityNotFound(_0x2d4884,null))[_0xe188('0x2a')](saveUpdates(_0x6bb379['body'],null))[_0xe188('0x2a')](respondWithResult(_0x2d4884,null))[_0xe188('0x49')](handleError(_0x2d4884,null));};exports[_0xe188('0x2b')]=function(_0x108a8b,_0x29cfc8){return db['Dashboard'][_0xe188('0x4e')]({'where':{'id':_0x108a8b[_0xe188('0x55')]['id']}})[_0xe188('0x2a')](handleEntityNotFound(_0x29cfc8,null))[_0xe188('0x2a')](removeEntity(_0x29cfc8,null))['catch'](handleError(_0x29cfc8,null));};function widgetAttributes(_0x3a6487){try{switch(_0x3a6487[_0xe188('0x35')]){case _0xe188('0x5b'):return[{'name':_0xe188('0x5c'),'value':_0x3a6487[_0xe188('0x5c')]||(_0x3a6487[_0xe188('0x5d')]&&_0x3a6487[_0xe188('0x5d')][0x0]?_0x3a6487[_0xe188('0x5d')][0x0][_0xe188('0x5e')]:undefined)||_0xe188('0x5f')}];case _0xe188('0x60'):return[{'name':'attrPath','value':_0x3a6487[_0xe188('0x61')]||(_0x3a6487[_0xe188('0x5d')]&&_0x3a6487[_0xe188('0x5d')][0x0]?_0x3a6487[_0xe188('0x5d')][0x0][_0xe188('0x5e')]:undefined)||''}];case _0xe188('0x62'):return[{'name':_0xe188('0x63'),'value':_0x3a6487[_0xe188('0x63')]||(_0x3a6487[_0xe188('0x5d')]&&_0x3a6487[_0xe188('0x5d')][0x0]?_0x3a6487[_0xe188('0x5d')][0x0][_0xe188('0x5e')]:undefined)||_0xe188('0x64')},{'name':_0xe188('0x65'),'value':_0x3a6487['attrTimezone']||(_0x3a6487[_0xe188('0x5d')]&&_0x3a6487[_0xe188('0x5d')][0x1]?_0x3a6487[_0xe188('0x5d')][0x1]['value']:undefined)||_0xe188('0x66')},{'name':_0xe188('0x67'),'value':_0x3a6487['attrFontSize']||(_0x3a6487[_0xe188('0x5d')]&&_0x3a6487[_0xe188('0x5d')][0x2]?_0x3a6487[_0xe188('0x5d')][0x2]['value']:undefined)||0xc}];case _0xe188('0x68'):return[{'name':_0xe188('0x69'),'value':_0x3a6487[_0xe188('0x69')]||(_0x3a6487[_0xe188('0x5d')]&&_0x3a6487[_0xe188('0x5d')][0x0]?_0x3a6487['attrs'][0x0][_0xe188('0x5e')]:undefined)||_0xe188('0x6a')},{'name':_0xe188('0x6b'),'value':_0x3a6487['attrVoiceQueues']||(_0x3a6487['attrs']&&_0x3a6487[_0xe188('0x5d')][0x1]?_0x3a6487['attrs'][0x1][_0xe188('0x5e')]:undefined)||[]},{'name':_0xe188('0x67'),'value':_0x3a6487['attrFontSize']||(_0x3a6487['attrs']&&_0x3a6487[_0xe188('0x5d')][0x2]?_0x3a6487[_0xe188('0x5d')][0x2][_0xe188('0x5e')]:undefined)||0x14}];case _0xe188('0x6c'):case _0xe188('0x6d'):return[{'name':_0xe188('0x6e'),'value':_0x3a6487[_0xe188('0x6e')]||(_0x3a6487['attrs']&&_0x3a6487[_0xe188('0x5d')][0x0]?_0x3a6487['attrs'][0x0][_0xe188('0x5e')]:undefined)||_0xe188('0x6a')},{'name':_0xe188('0x6f'),'value':_0x3a6487[_0xe188('0x6f')]||(_0x3a6487[_0xe188('0x5d')]&&_0x3a6487['attrs'][0x1]?_0x3a6487['attrs'][0x1][_0xe188('0x5e')]:undefined)||null},{'name':'attrSerie3','value':_0x3a6487[_0xe188('0x70')]||(_0x3a6487['attrs']&&_0x3a6487[_0xe188('0x5d')][0x2]?_0x3a6487['attrs'][0x2][_0xe188('0x5e')]:undefined)||null},{'name':_0xe188('0x6b'),'value':_0x3a6487['attrVoiceQueues']||(_0x3a6487['attrs']&&_0x3a6487['attrs'][0x3]?_0x3a6487[_0xe188('0x5d')][0x3][_0xe188('0x5e')]:undefined)||[]}];case _0xe188('0x71'):return[{'name':'attrReport','type':_0x3a6487['reportType']||(_0x3a6487[_0xe188('0x5d')]&&_0x3a6487['attrs'][0x0]?_0x3a6487[_0xe188('0x5d')][0x0][_0xe188('0x35')]:undefined)||null,'value':_0x3a6487[_0xe188('0x72')]||(_0x3a6487[_0xe188('0x5d')]&&_0x3a6487[_0xe188('0x5d')][0x0]?_0x3a6487[_0xe188('0x5d')][0x0][_0xe188('0x5e')]:undefined)||null},{'name':_0xe188('0x73'),'value':_0x3a6487[_0xe188('0x73')]||(_0x3a6487[_0xe188('0x5d')]&&_0x3a6487[_0xe188('0x5d')][0x1]?_0x3a6487[_0xe188('0x5d')][0x1][_0xe188('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0xd0b068){logger[_0xe188('0x2f')](_0xe188('0x74'),JSON['stringify'](_0xd0b068));return[];}}exports[_0xe188('0x75')]=function(_0x29fd05,_0x4577b3,_0x3b091e){if(_0x29fd05[_0xe188('0x58')]['id']){delete _0x29fd05[_0xe188('0x58')]['id'];}return db[_0xe188('0x45')]['find']({'where':{'id':_0x29fd05[_0xe188('0x55')]['id']}})[_0xe188('0x2a')](handleEntityNotFound(_0x4577b3,null))[_0xe188('0x2a')](function(_0x4f3d52){if(_0x4f3d52){_0x29fd05['body'][_0xe188('0x76')]=_0x4f3d52['id'];_0x29fd05[_0xe188('0x58')][_0xe188('0x5d')]=widgetAttributes(_0x29fd05[_0xe188('0x58')]);return db[_0xe188('0x77')][_0xe188('0x53')](_0x29fd05[_0xe188('0x58')]);}})[_0xe188('0x2a')](respondWithResult(_0x4577b3,null))[_0xe188('0x49')](handleError(_0x4577b3,null));};exports[_0xe188('0x78')]=function(_0x554958,_0x12e447,_0x4db83a){var _0x32dd6d={};var _0x4604b2={};var _0x4660a3;var _0x45b976;return db['Dashboard'][_0xe188('0x79')]({'where':{'id':_0x554958['params']['id']}})[_0xe188('0x2a')](handleEntityNotFound(_0x12e447,null))[_0xe188('0x2a')](function(_0x268bed){if(_0x268bed){_0x4660a3=_0x268bed;_0x4604b2['model']=_[_0xe188('0x4b')](db[_0xe188('0x77')]['rawAttributes']);_0x4604b2[_0xe188('0x38')]=_['keys'](_0x554958['query']);_0x4604b2[_0xe188('0x39')]=_[_0xe188('0x3a')](_0x4604b2[_0xe188('0x37')],_0x4604b2[_0xe188('0x38')]);_0x32dd6d['attributes']=_[_0xe188('0x3a')](_0x4604b2[_0xe188('0x37')],qs['fields'](_0x554958[_0xe188('0x38')][_0xe188('0x3b')]));_0x32dd6d[_0xe188('0x3c')]=_0x32dd6d['attributes'][_0xe188('0x3d')]?_0x32dd6d[_0xe188('0x3c')]:_0x4604b2[_0xe188('0x37')];_0x32dd6d[_0xe188('0x40')]=qs[_0xe188('0x41')](_0x554958[_0xe188('0x38')]['sort']);_0x32dd6d['where']=qs[_0xe188('0x39')](_[_0xe188('0x7a')](_0x554958['query'],_0x4604b2[_0xe188('0x39')]));if(_0x554958['query']['filter']){_0x32dd6d[_0xe188('0x42')]=_[_0xe188('0x44')](_0x32dd6d[_0xe188('0x42')],{'$or':_[_0xe188('0x32')](_0x32dd6d['attributes'],function(_0x4e749b){var _0x282a41={};_0x282a41[_0x4e749b]={'$like':'%'+_0x554958['query'][_0xe188('0x43')]+'%'};return _0x282a41;})});}_0x32dd6d=_['merge']({},_0x32dd6d,_0x554958['options']);return _0x4660a3[_0xe188('0x78')](_0x32dd6d);}})[_0xe188('0x2a')](function(_0x5a5188){if(_0x5a5188){_0x45b976=_0x5a5188['length'];if(!_0x554958[_0xe188('0x38')][_0xe188('0x7b')]('nolimit')){_0x32dd6d[_0xe188('0x3f')]=qs['limit'](_0x554958[_0xe188('0x38')][_0xe188('0x3f')]);_0x32dd6d[_0xe188('0x23')]=qs[_0xe188('0x23')](_0x554958[_0xe188('0x38')][_0xe188('0x23')]);}return _0x4660a3[_0xe188('0x78')](_0x32dd6d);}})['then'](function(_0x382667){if(_0x382667){return _0x382667?{'count':_0x45b976,'rows':_0x382667}:null;}})[_0xe188('0x2a')](respondWithResult(_0x12e447,null))[_0xe188('0x49')](handleError(_0x12e447,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index cc1246c..7dfaba3 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 _0xab66=['events','../../mysqldb','setMaxListeners','save','update','emit','exports'];(function(_0x3cc9ef,_0x881fc7){var _0x3d0f43=function(_0x4d40a9){while(--_0x4d40a9){_0x3cc9ef['push'](_0x3cc9ef['shift']());}};_0x3d0f43(++_0x881fc7);}(_0xab66,0x13b));var _0x6ab6=function(_0x1c2728,_0x4a799d){_0x1c2728=_0x1c2728-0x0;var _0x50e0a8=_0xab66[_0x1c2728];return _0x50e0a8;};'use strict';var EventEmitter=require(_0x6ab6('0x0'));var Dashboard=require(_0x6ab6('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x6ab6('0x2')](0x0);var events={'afterCreate':_0x6ab6('0x3'),'afterUpdate':_0x6ab6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2c5815){return function(_0x2e30c2,_0x5c4fec,_0x576282){DashboardEvents[_0x6ab6('0x5')](_0x2c5815+':'+_0x2e30c2['id'],_0x2e30c2);DashboardEvents[_0x6ab6('0x5')](_0x2c5815,_0x2e30c2);_0x576282(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x6ab6('0x6')]=DashboardEvents; \ No newline at end of file +var _0x6bdc=['hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','update'];(function(_0x12078c,_0x4b9d70){var _0x23ede4=function(_0x8142b6){while(--_0x8142b6){_0x12078c['push'](_0x12078c['shift']());}};_0x23ede4(++_0x4b9d70);}(_0x6bdc,0x16b));var _0xc6bd=function(_0x2d61cc,_0x59a466){_0x2d61cc=_0x2d61cc-0x0;var _0x3ad0ab=_0x6bdc[_0x2d61cc];return _0x3ad0ab;};'use strict';var EventEmitter=require(_0xc6bd('0x0'));var Dashboard=require(_0xc6bd('0x1'))['db'][_0xc6bd('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc6bd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc6bd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e9a97){return function(_0x3eda61,_0x541661,_0x62f515){DashboardEvents['emit'](_0x3e9a97+':'+_0x3eda61['id'],_0x3eda61);DashboardEvents['emit'](_0x3e9a97,_0x3eda61);_0x62f515(null);};}for(var e in events){if(events[_0xc6bd('0x5')](e)){var event=events[e];Dashboard[_0xc6bd('0x6')](e,emitEvent(event));}}module[_0xc6bd('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 8e7189d..ad88b93 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 _0x4c98=['rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','moment','bluebird','request-promise','path'];(function(_0x3cb6f6,_0x1018be){var _0x524a98=function(_0x33b744){while(--_0x33b744){_0x3cb6f6['push'](_0x3cb6f6['shift']());}};_0x524a98(++_0x1018be);}(_0x4c98,0x96));var _0x84c9=function(_0x24e54c,_0x43b639){_0x24e54c=_0x24e54c-0x0;var _0x71065a=_0x4c98[_0x24e54c];return _0x71065a;};'use strict';var _=require(_0x84c9('0x0'));var util=require(_0x84c9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x84c9('0x2'));var BPromise=require(_0x84c9('0x3'));var rp=require(_0x84c9('0x4'));var fs=require('fs');var path=require(_0x84c9('0x5'));var rimraf=require(_0x84c9('0x6'));var config=require(_0x84c9('0x7'));var attributes=require(_0x84c9('0x8'));module[_0x84c9('0x9')]=function(_0x13d441,_0x47ea4c){return _0x13d441[_0x84c9('0xa')](_0x84c9('0xb'),attributes,{'tableName':_0x84c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fff=['util','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard','lodash'];(function(_0x2e0d88,_0x47ea20){var _0x52c931=function(_0x5df9e7){while(--_0x5df9e7){_0x2e0d88['push'](_0x2e0d88['shift']());}};_0x52c931(++_0x47ea20);}(_0x4fff,0x1a7));var _0xf4ff=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4fff[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf4ff('0x0'));var util=require(_0xf4ff('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4ff('0x2'));var rimraf=require('rimraf');var config=require(_0xf4ff('0x3'));var attributes=require(_0xf4ff('0x4'));module[_0xf4ff('0x5')]=function(_0x100f14,_0x155ea6){return _0x100f14[_0xf4ff('0x6')](_0xf4ff('0x7'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 3925b22..4a4edae 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 _0x47c8=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2fd5d9,_0x238d40){var _0xd6b6cb=function(_0x3d6db7){while(--_0x3d6db7){_0x2fd5d9['push'](_0x2fd5d9['shift']());}};_0xd6b6cb(++_0x238d40);}(_0x47c8,0x1cc));var _0x847c=function(_0x2bf559,_0x5a4863){_0x2bf559=_0x2bf559-0x0;var _0x376fc7=_0x47c8[_0x2bf559];return _0x376fc7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x847c('0x0'));var BPromise=require(_0x847c('0x1'));var rs=require(_0x847c('0x2'));var fs=require('fs');var Redis=require(_0x847c('0x3'));var db=require(_0x847c('0x4'))['db'];var utils=require(_0x847c('0x5'));var logger=require('../../config/logger')(_0x847c('0x6'));var config=require(_0x847c('0x7'));var jayson=require(_0x847c('0x8'));var client=jayson[_0x847c('0x9')][_0x847c('0xa')]({'port':0x232a});config[_0x847c('0xb')]=_['defaults'](config[_0x847c('0xb')],{'host':_0x847c('0xc'),'port':0x18eb});var socket=require(_0x847c('0xd'))(new Redis(config[_0x847c('0xb')]));require(_0x847c('0xe'))['register'](socket);function respondWithRpcPromise(_0x5def96,_0x43585f,_0x59f388){return new BPromise(function(_0x453fc4,_0x5a28e7){return client[_0x847c('0xf')](_0x5def96,_0x59f388)[_0x847c('0x10')](function(_0x33ff9e){logger[_0x847c('0x11')](_0x847c('0x12'),_0x43585f,'request\x20sent');logger[_0x847c('0x13')](_0x847c('0x14'),_0x43585f,_0x847c('0x15'),JSON[_0x847c('0x16')](_0x33ff9e));if(_0x33ff9e['error']){if(_0x33ff9e[_0x847c('0x17')][_0x847c('0x18')]===0x1f4){logger[_0x847c('0x17')](_0x847c('0x12'),_0x43585f,_0x33ff9e[_0x847c('0x17')][_0x847c('0x19')]);return _0x5a28e7(_0x33ff9e[_0x847c('0x17')]['message']);}logger['error']('Dashboard,\x20%s,\x20%s',_0x43585f,_0x33ff9e[_0x847c('0x17')][_0x847c('0x19')]);return _0x453fc4(_0x33ff9e[_0x847c('0x17')][_0x847c('0x19')]);}else{logger[_0x847c('0x11')](_0x847c('0x12'),_0x43585f,'request\x20sent');_0x453fc4(_0x33ff9e['result']['message']);}})[_0x847c('0x1a')](function(_0x59416d){logger[_0x847c('0x17')]('Dashboard,\x20%s,\x20%s',_0x43585f,_0x59416d);_0x5a28e7(_0x59416d);});});} \ No newline at end of file +var _0x33dc=['then','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dashboard,\x20%s,\x20%s','message','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register'];(function(_0x474cba,_0xe5defa){var _0x180934=function(_0x45502d){while(--_0x45502d){_0x474cba['push'](_0x474cba['shift']());}};_0x180934(++_0xe5defa);}(_0x33dc,0x91));var _0xc33d=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x33dc[_0x425716];return _0x2d39af;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc33d('0x0'));var BPromise=require('bluebird');var rs=require(_0xc33d('0x1'));var fs=require('fs');var Redis=require(_0xc33d('0x2'));var db=require(_0xc33d('0x3'))['db'];var utils=require(_0xc33d('0x4'));var logger=require(_0xc33d('0x5'))(_0xc33d('0x6'));var config=require(_0xc33d('0x7'));var jayson=require(_0xc33d('0x8'));var client=jayson[_0xc33d('0x9')][_0xc33d('0xa')]({'port':0x232a});config['redis']=_[_0xc33d('0xb')](config[_0xc33d('0xc')],{'host':_0xc33d('0xd'),'port':0x18eb});var socket=require(_0xc33d('0xe'))(new Redis(config['redis']));require(_0xc33d('0xf'))[_0xc33d('0x10')](socket);function respondWithRpcPromise(_0x3ca8d4,_0x94212f,_0x362cf0){return new BPromise(function(_0x143d8a,_0x1e7323){return client['request'](_0x3ca8d4,_0x362cf0)[_0xc33d('0x11')](function(_0x5bb189){logger[_0xc33d('0x12')]('Dashboard,\x20%s,\x20%s',_0x94212f,'request\x20sent');logger[_0xc33d('0x13')](_0xc33d('0x14'),_0x94212f,_0xc33d('0x15'),JSON[_0xc33d('0x16')](_0x5bb189));if(_0x5bb189[_0xc33d('0x17')]){if(_0x5bb189[_0xc33d('0x17')][_0xc33d('0x18')]===0x1f4){logger[_0xc33d('0x17')](_0xc33d('0x19'),_0x94212f,_0x5bb189[_0xc33d('0x17')][_0xc33d('0x1a')]);return _0x1e7323(_0x5bb189[_0xc33d('0x17')][_0xc33d('0x1a')]);}logger[_0xc33d('0x17')](_0xc33d('0x19'),_0x94212f,_0x5bb189[_0xc33d('0x17')][_0xc33d('0x1a')]);return _0x143d8a(_0x5bb189[_0xc33d('0x17')][_0xc33d('0x1a')]);}else{logger[_0xc33d('0x12')](_0xc33d('0x19'),_0x94212f,'request\x20sent');_0x143d8a(_0x5bb189['result'][_0xc33d('0x1a')]);}})['catch'](function(_0x44d16b){logger[_0xc33d('0x17')]('Dashboard,\x20%s,\x20%s',_0x94212f,_0x44d16b);_0x1e7323(_0x44d16b);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index d516d57..08a702d 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 _0x03a3=['removeListener','register','dashboard:','./dashboard.events','emit'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x03a3,0xad));var _0x303a=function(_0x229b99,_0xb6a166){_0x229b99=_0x229b99-0x0;var _0x13e10c=_0x03a3[_0x229b99];return _0x13e10c;};'use strict';var DashboardEvents=require(_0x303a('0x0'));var events=['save','remove','update'];function createListener(_0x3585f0,_0xd9e00c){return function(_0x4b11c9){_0xd9e00c[_0x303a('0x1')](_0x3585f0,_0x4b11c9);};}function removeListener(_0x5327db,_0xf7873f){return function(){DashboardEvents[_0x303a('0x2')](_0x5327db,_0xf7873f);};}exports[_0x303a('0x3')]=function(_0x2f32b1){for(var _0x47b3cb=0x0,_0x2259e0=events['length'];_0x47b3cb<_0x2259e0;_0x47b3cb++){var _0x2420ee=events[_0x47b3cb];var _0x2954e5=createListener(_0x303a('0x4')+_0x2420ee,_0x2f32b1);DashboardEvents['on'](_0x2420ee,_0x2954e5);}}; \ No newline at end of file +var _0x51b4=['dashboard:','./dashboard.events','remove','emit','removeListener','register','length'];(function(_0x22cc36,_0x2c8292){var _0x7fc85=function(_0x4e476d){while(--_0x4e476d){_0x22cc36['push'](_0x22cc36['shift']());}};_0x7fc85(++_0x2c8292);}(_0x51b4,0x12e));var _0x451b=function(_0x8ab1a7,_0x1b5624){_0x8ab1a7=_0x8ab1a7-0x0;var _0x1f79e4=_0x51b4[_0x8ab1a7];return _0x1f79e4;};'use strict';var DashboardEvents=require(_0x451b('0x0'));var events=['save',_0x451b('0x1'),'update'];function createListener(_0x395360,_0x5923bb){return function(_0xc9707b){_0x5923bb[_0x451b('0x2')](_0x395360,_0xc9707b);};}function removeListener(_0x218156,_0x59f866){return function(){DashboardEvents[_0x451b('0x3')](_0x218156,_0x59f866);};}exports[_0x451b('0x4')]=function(_0xf1a0cf){for(var _0x3a7929=0x0,_0x442a67=events[_0x451b('0x5')];_0x3a7929<_0x442a67;_0x3a7929++){var _0x1f5848=events[_0x3a7929];var _0x3f4415=createListener(_0x451b('0x6')+_0x1f5848,_0xf1a0cf);DashboardEvents['on'](_0x1f5848,_0x3f4415);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 6562d85..4e776e0 100644 --- a/server/api/dashboard/index.js +++ b/server/api/dashboard/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['isAuthenticated','/:id','show','create','post','/:id/clone','/:id/items','addItem','put','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x3bfe11,_0x573678){var _0x19f6b2=function(_0x561817){while(--_0x561817){_0x3bfe11['push'](_0x3bfe11['shift']());}};_0x19f6b2(++_0x573678);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x59710f,_0x44c7f0){_0x59710f=_0x59710f-0x0;var _0xaae66a=_0xcb91[_0x59710f];return _0xaae66a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./dashboard.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/:id/items',auth[_0x1cb9('0x7')](),controller['getItems']);router['post']('/',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xa')]);router[_0x1cb9('0xb')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),controller['clone']);router[_0x1cb9('0xb')](_0x1cb9('0xd'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x10')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','multer','util','path','express','Router'];(function(_0x1a1460,_0x539531){var _0x33ab03=function(_0x26a04b){while(--_0x26a04b){_0x1a1460['push'](_0x1a1460['shift']());}};_0x33ab03(++_0x539531);}(_0xe706,0xa3));var _0x6e70=function(_0x35dc52,_0x5c666f){_0x35dc52=_0x35dc52-0x0;var _0x4134cd=_0xe706[_0x35dc52];return _0x4134cd;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x10')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x10')](_0x6e70('0x12'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['post']('/:id/items',auth[_0x6e70('0xa')](),controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 92f2981..e9e5b55 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 _0x4023=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','squel','exports','STRING'];(function(_0x13ed3a,_0x3499eb){var _0x189291=function(_0x5b520c){while(--_0x5b520c){_0x13ed3a['push'](_0x13ed3a['shift']());}};_0x189291(++_0x3499eb);}(_0x4023,0x14f));var _0x3402=function(_0x2b0ca5,_0x3c3aac){_0x2b0ca5=_0x2b0ca5-0x0;var _0x58a62b=_0x4023[_0x2b0ca5];return _0x58a62b;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x3402('0x0'));var _=require('lodash');module[_0x3402('0x1')]={'title':{'type':Sequelize[_0x3402('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3402('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3402('0x3')](_0x3402('0x4')),'get':function(){try{return JSON[_0x3402('0x5')](this[_0x3402('0x6')](_0x3402('0x7')));}catch(_0x1fa2fa){return[];}},'set':function(_0x2aedc2){try{this[_0x3402('0x8')](_0x3402('0x7'),JSON[_0x3402('0x9')](_0x2aedc2));}catch(_0x1074b6){this[_0x3402('0x8')](_0x3402('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x3402('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3402('0xa')]},'col':{'type':Sequelize[_0x3402('0xa')]},'background':{'type':Sequelize[_0x3402('0x2')],'allowNull':![],'defaultValue':_0x3402('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3402('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3402('0x2')]}}; \ No newline at end of file +var _0xa78f=['stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue'];(function(_0x1e3bf5,_0x565209){var _0x41c35b=function(_0x3726ff){while(--_0x3726ff){_0x1e3bf5['push'](_0x1e3bf5['shift']());}};_0x41c35b(++_0x565209);}(_0xa78f,0xe0));var _0xfa78=function(_0x4a9e4a,_0x585df1){_0x4a9e4a=_0x4a9e4a-0x0;var _0xaa903e=_0xa78f[_0x4a9e4a];return _0xaa903e;};'use strict';var Sequelize=require(_0xfa78('0x0'));var squel=require(_0xfa78('0x1'));var _=require(_0xfa78('0x2'));module[_0xfa78('0x3')]={'title':{'type':Sequelize[_0xfa78('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xfa78('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xfa78('0x5')](_0xfa78('0x6')),'get':function(){try{return JSON[_0xfa78('0x7')](this['getDataValue'](_0xfa78('0x8')));}catch(_0x2ed050){return[];}},'set':function(_0x4b0ac7){try{this[_0xfa78('0x9')](_0xfa78('0x8'),JSON[_0xfa78('0xa')](_0x4b0ac7));}catch(_0x5977f8){this['setDataValue'](_0xfa78('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xfa78('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xfa78('0xb')]},'col':{'type':Sequelize[_0xfa78('0xb')]},'background':{'type':Sequelize[_0xfa78('0x4')],'allowNull':![],'defaultValue':_0xfa78('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xfa78('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xfa78('0x4')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 3abe8e5..c39f707 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 _0xd750=['register','sendStatus','status','json','count','offset','set','apply','update','destroy','then','name','send','keys','DashboardItem','rawAttributes','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrMetric','attrVoiceQueues','attrFontSize','pie-chart','total','attrSerie2','attrSerie3','attrReport','attrRefresh','error','widgetAttributes:\x20%s','body','create','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket'];(function(_0x31a1c9,_0x2b1001){var _0x5acd7d=function(_0x1de828){while(--_0x1de828){_0x31a1c9['push'](_0x31a1c9['shift']());}};_0x5acd7d(++_0x2b1001);}(_0xd750,0x1d0));var _0x0d75=function(_0x39580c,_0x22425c){_0x39580c=_0x39580c-0x0;var _0x1a4cd8=_0xd750[_0x39580c];return _0x1a4cd8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0d75('0x0'));var zipdir=require(_0x0d75('0x1'));var jsonpatch=require(_0x0d75('0x2'));var rp=require('request-promise');var moment=require(_0x0d75('0x3'));var BPromise=require(_0x0d75('0x4'));var Mustache=require(_0x0d75('0x5'));var util=require('util');var path=require(_0x0d75('0x6'));var sox=require(_0x0d75('0x7'));var csv=require('to-csv');var ejs=require(_0x0d75('0x8'));var fs=require('fs');var _=require(_0x0d75('0x9'));var squel=require(_0x0d75('0xa'));var crypto=require(_0x0d75('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0d75('0xc'));var querystring=require('querystring');var Papa=require(_0x0d75('0xd'));var Redis=require(_0x0d75('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0d75('0xf'));var as=require(_0x0d75('0x10'));var hardwareService=require(_0x0d75('0x11'));var logger=require(_0x0d75('0x12'))(_0x0d75('0x13'));var utils=require(_0x0d75('0x14'));var config=require(_0x0d75('0x15'));var db=require(_0x0d75('0x16'))['db'];config['redis']=_[_0x0d75('0x17')](config[_0x0d75('0x18')],{'host':_0x0d75('0x19'),'port':0x18eb});var socket=require(_0x0d75('0x1a'))(new Redis(config['redis']));require(_0x0d75('0x1b'))[_0x0d75('0x1c')](socket);function respondWithStatusCode(_0x348b8f,_0x46b43e){_0x46b43e=_0x46b43e||0xcc;return function(_0x4fc3bb){if(_0x4fc3bb){return _0x348b8f[_0x0d75('0x1d')](_0x46b43e);}return _0x348b8f['status'](_0x46b43e)['end']();};}function respondWithResult(_0xf62be5,_0x22d5c3){_0x22d5c3=_0x22d5c3||0xc8;return function(_0x112543){if(_0x112543){return _0xf62be5[_0x0d75('0x1e')](_0x22d5c3)[_0x0d75('0x1f')](_0x112543);}};}function respondWithFilteredResult(_0x4f1a76,_0x14e4ce){return function(_0x21a220){if(_0x21a220){var _0x37fe37=_0x21a220[_0x0d75('0x20')],_0x4ad00e=_0x14e4ce[_0x0d75('0x21')],_0x547e89=_0x14e4ce['offset']+_0x14e4ce['limit'],_0x38a76b;if(_0x547e89>=_0x37fe37){_0x547e89=_0x37fe37;_0x38a76b=0xc8;}else{_0x38a76b=0xce;}_0x4f1a76['status'](_0x38a76b);return _0x4f1a76[_0x0d75('0x22')]('Content-Range',_0x4ad00e+'-'+_0x547e89+'/'+_0x37fe37)[_0x0d75('0x1f')](_0x21a220);}return null;};}function patchUpdates(_0x4b14c9){return function(_0x526363){try{jsonpatch[_0x0d75('0x23')](_0x526363,_0x4b14c9,!![]);}catch(_0x16f839){return BPromise['reject'](_0x16f839);}return _0x526363['save']();};}function saveUpdates(_0x3f1f4a,_0x2df261){return function(_0xa36d88){if(_0xa36d88){return _0xa36d88[_0x0d75('0x24')](_0x3f1f4a)['then'](function(_0x212832){return _0x212832;});}return null;};}function removeEntity(_0x46d4b7,_0x3b793a){return function(_0xfff872){if(_0xfff872){return _0xfff872[_0x0d75('0x25')]()[_0x0d75('0x26')](function(){_0x46d4b7[_0x0d75('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cac25,_0x46b13e){return function(_0x4cd7ad){if(!_0x4cd7ad){_0x5cac25[_0x0d75('0x1d')](0x194);}return _0x4cd7ad;};}function handleError(_0x5267ae,_0x31de4d){_0x31de4d=_0x31de4d||0x1f4;return function(_0x41c271){logger['error'](_0x41c271['stack']);if(_0x41c271['name']){delete _0x41c271[_0x0d75('0x27')];}_0x5267ae[_0x0d75('0x1e')](_0x31de4d)[_0x0d75('0x28')](_0x41c271);};}exports['show']=function(_0x2a5d50,_0xb6cd66){var _0x1682ee={'raw':![],'where':{'id':_0x2a5d50['params']['id']}},_0x19a46e={};_0x19a46e['model']=_[_0x0d75('0x29')](db[_0x0d75('0x2a')][_0x0d75('0x2b')]);_0x19a46e['query']=_['keys'](_0x2a5d50['query']);_0x19a46e[_0x0d75('0x2c')]=_[_0x0d75('0x2d')](_0x19a46e[_0x0d75('0x2e')],_0x19a46e['query']);_0x1682ee[_0x0d75('0x2f')]=_['intersection'](_0x19a46e[_0x0d75('0x2e')],qs[_0x0d75('0x30')](_0x2a5d50['query']['fields']));_0x1682ee[_0x0d75('0x2f')]=_0x1682ee[_0x0d75('0x2f')][_0x0d75('0x31')]?_0x1682ee[_0x0d75('0x2f')]:_0x19a46e[_0x0d75('0x2e')];if(_0x2a5d50['query'][_0x0d75('0x32')]){_0x1682ee[_0x0d75('0x33')]=[{'all':!![]}];}_0x1682ee=_[_0x0d75('0x34')]({},_0x1682ee,_0x2a5d50[_0x0d75('0x35')]);return db[_0x0d75('0x2a')][_0x0d75('0x36')](_0x1682ee)[_0x0d75('0x26')](handleEntityNotFound(_0xb6cd66,null))['then'](respondWithResult(_0xb6cd66,null))['catch'](handleError(_0xb6cd66,null));};exports['destroy']=function(_0xf45b62,_0x226077){return db[_0x0d75('0x2a')]['find']({'where':{'id':_0xf45b62['params']['id']}})[_0x0d75('0x26')](handleEntityNotFound(_0x226077,null))['then'](removeEntity(_0x226077,null))[_0x0d75('0x37')](handleError(_0x226077,null));};function widgetAttributes(_0x430ef5){try{switch(_0x430ef5[_0x0d75('0x38')]){case _0x0d75('0x39'):return[{'name':'attrUrl','value':_0x430ef5[_0x0d75('0x3a')]||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5[_0x0d75('0x3b')][0x0]?_0x430ef5['attrs'][0x0]['value']:undefined)||_0x0d75('0x3c')}];case _0x0d75('0x3d'):return[{'name':'attrPath','value':_0x430ef5[_0x0d75('0x3e')]||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5[_0x0d75('0x3b')][0x0]?_0x430ef5['attrs'][0x0][_0x0d75('0x3f')]:undefined)||''}];case _0x0d75('0x40'):return[{'name':_0x0d75('0x41'),'value':_0x430ef5[_0x0d75('0x41')]||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5[_0x0d75('0x3b')][0x0]?_0x430ef5[_0x0d75('0x3b')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x0d75('0x42'),'value':_0x430ef5[_0x0d75('0x42')]||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5[_0x0d75('0x3b')][0x1]?_0x430ef5['attrs'][0x1][_0x0d75('0x3f')]:undefined)||_0x0d75('0x43')},{'name':'attrFontSize','value':_0x430ef5['attrFontSize']||(_0x430ef5['attrs']&&_0x430ef5['attrs'][0x2]?_0x430ef5[_0x0d75('0x3b')][0x2][_0x0d75('0x3f')]:undefined)||0xc}];case'counter':return[{'name':_0x0d75('0x44'),'value':_0x430ef5['attrMetric']||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5['attrs'][0x0]?_0x430ef5[_0x0d75('0x3b')][0x0][_0x0d75('0x3f')]:undefined)||'total'},{'name':_0x0d75('0x45'),'value':_0x430ef5[_0x0d75('0x45')]||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5[_0x0d75('0x3b')][0x1]?_0x430ef5[_0x0d75('0x3b')][0x1][_0x0d75('0x3f')]:undefined)||[]},{'name':_0x0d75('0x46'),'value':_0x430ef5['attrFontSize']||(_0x430ef5['attrs']&&_0x430ef5[_0x0d75('0x3b')][0x2]?_0x430ef5['attrs'][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x0d75('0x47'):return[{'name':'attrSerie1','value':_0x430ef5['attrSerie1']||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5[_0x0d75('0x3b')][0x0]?_0x430ef5[_0x0d75('0x3b')][0x0][_0x0d75('0x3f')]:undefined)||_0x0d75('0x48')},{'name':_0x0d75('0x49'),'value':_0x430ef5[_0x0d75('0x49')]||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5[_0x0d75('0x3b')][0x1]?_0x430ef5[_0x0d75('0x3b')][0x1][_0x0d75('0x3f')]:undefined)||null},{'name':'attrSerie3','value':_0x430ef5[_0x0d75('0x4a')]||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5[_0x0d75('0x3b')][0x2]?_0x430ef5[_0x0d75('0x3b')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x430ef5[_0x0d75('0x45')]||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5['attrs'][0x3]?_0x430ef5['attrs'][0x3][_0x0d75('0x3f')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x430ef5['reportType']||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5[_0x0d75('0x3b')][0x0]?_0x430ef5['attrs'][0x0]['type']:undefined)||null,'value':_0x430ef5[_0x0d75('0x4b')]||(_0x430ef5['attrs']&&_0x430ef5[_0x0d75('0x3b')][0x0]?_0x430ef5[_0x0d75('0x3b')][0x0][_0x0d75('0x3f')]:undefined)||null},{'name':_0x0d75('0x4c'),'value':_0x430ef5[_0x0d75('0x4c')]||(_0x430ef5[_0x0d75('0x3b')]&&_0x430ef5[_0x0d75('0x3b')][0x1]?_0x430ef5[_0x0d75('0x3b')][0x1][_0x0d75('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x5867f7){logger[_0x0d75('0x4d')](_0x0d75('0x4e'),JSON['stringify'](_0x5867f7));return[];}}exports['create']=function(_0x40623d,_0x38297e){if(_0x40623d[_0x0d75('0x4f')]){_0x40623d[_0x0d75('0x4f')][_0x0d75('0x3b')]=widgetAttributes(_0x40623d[_0x0d75('0x4f')]);}return db[_0x0d75('0x2a')][_0x0d75('0x50')](_0x40623d[_0x0d75('0x4f')],{})[_0x0d75('0x26')](respondWithResult(_0x38297e,0xc9))[_0x0d75('0x37')](handleError(_0x38297e,null));};exports[_0x0d75('0x24')]=function(_0x5e1f0a,_0x468be2){if(_0x5e1f0a[_0x0d75('0x4f')]['id']){delete _0x5e1f0a['body']['id'];}_0x5e1f0a['body'][_0x0d75('0x3b')]=widgetAttributes(_0x5e1f0a[_0x0d75('0x4f')]);return db[_0x0d75('0x2a')][_0x0d75('0x36')]({'where':{'id':_0x5e1f0a[_0x0d75('0x51')]['id']}})['then'](handleEntityNotFound(_0x468be2,null))['then'](saveUpdates(_0x5e1f0a[_0x0d75('0x4f')],null))[_0x0d75('0x26')](respondWithResult(_0x468be2,null))[_0x0d75('0x37')](handleError(_0x468be2,null));}; \ No newline at end of file +var _0xd304=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','count','offset','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','show','model','keys','filters','query','attributes','intersection','fields','length','includeAll','merge','options','DashboardItem','find','catch','params','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','squel'];(function(_0x11018f,_0x27eebb){var _0x14af66=function(_0x25612f){while(--_0x25612f){_0x11018f['push'](_0x11018f['shift']());}};_0x14af66(++_0x27eebb);}(_0xd304,0xa2));var _0x4d30=function(_0x17e2c8,_0x4f69e6){_0x17e2c8=_0x17e2c8-0x0;var _0x4388ad=_0xd304[_0x17e2c8];return _0x4388ad;};'use strict';var pdf=require(_0x4d30('0x0'));var emlformat=require(_0x4d30('0x1'));var rimraf=require(_0x4d30('0x2'));var zipdir=require(_0x4d30('0x3'));var jsonpatch=require(_0x4d30('0x4'));var rp=require(_0x4d30('0x5'));var moment=require(_0x4d30('0x6'));var BPromise=require(_0x4d30('0x7'));var Mustache=require(_0x4d30('0x8'));var util=require('util');var path=require(_0x4d30('0x9'));var sox=require(_0x4d30('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4d30('0xb'));var crypto=require('crypto');var jsforce=require(_0x4d30('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4d30('0xd'));var Papa=require(_0x4d30('0xe'));var Redis=require('ioredis');var authService=require(_0x4d30('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4d30('0x10'));var hardwareService=require(_0x4d30('0x11'));var logger=require('../../config/logger')(_0x4d30('0x12'));var utils=require(_0x4d30('0x13'));var config=require(_0x4d30('0x14'));var db=require(_0x4d30('0x15'))['db'];config['redis']=_['defaults'](config[_0x4d30('0x16')],{'host':_0x4d30('0x17'),'port':0x18eb});var socket=require(_0x4d30('0x18'))(new Redis(config[_0x4d30('0x16')]));require(_0x4d30('0x19'))[_0x4d30('0x1a')](socket);function respondWithStatusCode(_0x2027e4,_0xdcfb04){_0xdcfb04=_0xdcfb04||0xcc;return function(_0x3de867){if(_0x3de867){return _0x2027e4[_0x4d30('0x1b')](_0xdcfb04);}return _0x2027e4[_0x4d30('0x1c')](_0xdcfb04)[_0x4d30('0x1d')]();};}function respondWithResult(_0x37cb98,_0x40776d){_0x40776d=_0x40776d||0xc8;return function(_0x5ca1a0){if(_0x5ca1a0){return _0x37cb98['status'](_0x40776d)['json'](_0x5ca1a0);}};}function respondWithFilteredResult(_0x277acb,_0x22d9ba){return function(_0x1106ba){if(_0x1106ba){var _0xfbc11d=_0x1106ba[_0x4d30('0x1e')],_0x16293e=_0x22d9ba[_0x4d30('0x1f')],_0x4bd5fc=_0x22d9ba[_0x4d30('0x1f')]+_0x22d9ba['limit'],_0x3f6394;if(_0x4bd5fc>=_0xfbc11d){_0x4bd5fc=_0xfbc11d;_0x3f6394=0xc8;}else{_0x3f6394=0xce;}_0x277acb['status'](_0x3f6394);return _0x277acb['set'](_0x4d30('0x20'),_0x16293e+'-'+_0x4bd5fc+'/'+_0xfbc11d)[_0x4d30('0x21')](_0x1106ba);}return null;};}function patchUpdates(_0x2728d0){return function(_0x53e27e){try{jsonpatch[_0x4d30('0x22')](_0x53e27e,_0x2728d0,!![]);}catch(_0x52dc99){return BPromise['reject'](_0x52dc99);}return _0x53e27e[_0x4d30('0x23')]();};}function saveUpdates(_0x35bbe2,_0x3bef2e){return function(_0x52e34d){if(_0x52e34d){return _0x52e34d[_0x4d30('0x24')](_0x35bbe2)[_0x4d30('0x25')](function(_0x409739){return _0x409739;});}return null;};}function removeEntity(_0x53dabc,_0x59cf32){return function(_0x296491){if(_0x296491){return _0x296491[_0x4d30('0x26')]()[_0x4d30('0x25')](function(){_0x53dabc[_0x4d30('0x1c')](0xcc)[_0x4d30('0x1d')]();});}};}function handleEntityNotFound(_0x444a53,_0x432e2d){return function(_0x277a55){if(!_0x277a55){_0x444a53['sendStatus'](0x194);}return _0x277a55;};}function handleError(_0x23e27b,_0x4c1ea9){_0x4c1ea9=_0x4c1ea9||0x1f4;return function(_0x516fb5){logger[_0x4d30('0x27')](_0x516fb5[_0x4d30('0x28')]);if(_0x516fb5[_0x4d30('0x29')]){delete _0x516fb5[_0x4d30('0x29')];}_0x23e27b[_0x4d30('0x1c')](_0x4c1ea9)[_0x4d30('0x2a')](_0x516fb5);};}exports[_0x4d30('0x2b')]=function(_0x2a6ca2,_0x378746){var _0x7a1058={'raw':![],'where':{'id':_0x2a6ca2['params']['id']}},_0x3610db={};_0x3610db[_0x4d30('0x2c')]=_[_0x4d30('0x2d')](db['DashboardItem']['rawAttributes']);_0x3610db['query']=_[_0x4d30('0x2d')](_0x2a6ca2['query']);_0x3610db[_0x4d30('0x2e')]=_['intersection'](_0x3610db['model'],_0x3610db[_0x4d30('0x2f')]);_0x7a1058[_0x4d30('0x30')]=_[_0x4d30('0x31')](_0x3610db[_0x4d30('0x2c')],qs[_0x4d30('0x32')](_0x2a6ca2[_0x4d30('0x2f')][_0x4d30('0x32')]));_0x7a1058['attributes']=_0x7a1058[_0x4d30('0x30')][_0x4d30('0x33')]?_0x7a1058['attributes']:_0x3610db['model'];if(_0x2a6ca2['query'][_0x4d30('0x34')]){_0x7a1058['include']=[{'all':!![]}];}_0x7a1058=_[_0x4d30('0x35')]({},_0x7a1058,_0x2a6ca2[_0x4d30('0x36')]);return db[_0x4d30('0x37')][_0x4d30('0x38')](_0x7a1058)[_0x4d30('0x25')](handleEntityNotFound(_0x378746,null))[_0x4d30('0x25')](respondWithResult(_0x378746,null))[_0x4d30('0x39')](handleError(_0x378746,null));};exports['destroy']=function(_0x3fa821,_0x611d14){return db[_0x4d30('0x37')][_0x4d30('0x38')]({'where':{'id':_0x3fa821[_0x4d30('0x3a')]['id']}})[_0x4d30('0x25')](handleEntityNotFound(_0x611d14,null))[_0x4d30('0x25')](removeEntity(_0x611d14,null))[_0x4d30('0x39')](handleError(_0x611d14,null));};function widgetAttributes(_0x1d1033){try{switch(_0x1d1033[_0x4d30('0x3b')]){case _0x4d30('0x3c'):return[{'name':_0x4d30('0x3d'),'value':_0x1d1033[_0x4d30('0x3d')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033['attrs'][0x0]?_0x1d1033['attrs'][0x0][_0x4d30('0x3f')]:undefined)||_0x4d30('0x40')}];case'custom':return[{'name':'attrPath','value':_0x1d1033[_0x4d30('0x41')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033['attrs'][0x0]?_0x1d1033[_0x4d30('0x3e')][0x0][_0x4d30('0x3f')]:undefined)||''}];case _0x4d30('0x42'):return[{'name':_0x4d30('0x43'),'value':_0x1d1033[_0x4d30('0x43')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033['attrs'][0x0]?_0x1d1033[_0x4d30('0x3e')][0x0][_0x4d30('0x3f')]:undefined)||_0x4d30('0x44')},{'name':'attrTimezone','value':_0x1d1033[_0x4d30('0x45')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033[_0x4d30('0x3e')][0x1]?_0x1d1033[_0x4d30('0x3e')][0x1][_0x4d30('0x3f')]:undefined)||_0x4d30('0x46')},{'name':_0x4d30('0x47'),'value':_0x1d1033[_0x4d30('0x47')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033['attrs'][0x2]?_0x1d1033[_0x4d30('0x3e')][0x2][_0x4d30('0x3f')]:undefined)||0xc}];case _0x4d30('0x48'):return[{'name':_0x4d30('0x49'),'value':_0x1d1033[_0x4d30('0x49')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033[_0x4d30('0x3e')][0x0]?_0x1d1033[_0x4d30('0x3e')][0x0]['value']:undefined)||_0x4d30('0x4a')},{'name':'attrVoiceQueues','value':_0x1d1033[_0x4d30('0x4b')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033['attrs'][0x1]?_0x1d1033['attrs'][0x1]['value']:undefined)||[]},{'name':_0x4d30('0x47'),'value':_0x1d1033[_0x4d30('0x47')]||(_0x1d1033['attrs']&&_0x1d1033[_0x4d30('0x3e')][0x2]?_0x1d1033[_0x4d30('0x3e')][0x2][_0x4d30('0x3f')]:undefined)||0x14}];case'multibar-chart':case _0x4d30('0x4c'):return[{'name':_0x4d30('0x4d'),'value':_0x1d1033[_0x4d30('0x4d')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033[_0x4d30('0x3e')][0x0]?_0x1d1033[_0x4d30('0x3e')][0x0]['value']:undefined)||_0x4d30('0x4a')},{'name':_0x4d30('0x4e'),'value':_0x1d1033[_0x4d30('0x4e')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033[_0x4d30('0x3e')][0x1]?_0x1d1033[_0x4d30('0x3e')][0x1][_0x4d30('0x3f')]:undefined)||null},{'name':_0x4d30('0x4f'),'value':_0x1d1033[_0x4d30('0x4f')]||(_0x1d1033['attrs']&&_0x1d1033[_0x4d30('0x3e')][0x2]?_0x1d1033[_0x4d30('0x3e')][0x2]['value']:undefined)||null},{'name':_0x4d30('0x4b'),'value':_0x1d1033[_0x4d30('0x4b')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033[_0x4d30('0x3e')][0x3]?_0x1d1033[_0x4d30('0x3e')][0x3][_0x4d30('0x3f')]:undefined)||[]}];case _0x4d30('0x50'):return[{'name':_0x4d30('0x51'),'type':_0x1d1033[_0x4d30('0x52')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033[_0x4d30('0x3e')][0x0]?_0x1d1033[_0x4d30('0x3e')][0x0][_0x4d30('0x3b')]:undefined)||null,'value':_0x1d1033['attrReport']||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033[_0x4d30('0x3e')][0x0]?_0x1d1033['attrs'][0x0][_0x4d30('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x1d1033[_0x4d30('0x53')]||(_0x1d1033[_0x4d30('0x3e')]&&_0x1d1033['attrs'][0x1]?_0x1d1033[_0x4d30('0x3e')][0x1][_0x4d30('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x5a124f){logger[_0x4d30('0x27')](_0x4d30('0x54'),JSON['stringify'](_0x5a124f));return[];}}exports[_0x4d30('0x55')]=function(_0x221d82,_0x1b0446){if(_0x221d82['body']){_0x221d82[_0x4d30('0x56')][_0x4d30('0x3e')]=widgetAttributes(_0x221d82[_0x4d30('0x56')]);}return db[_0x4d30('0x37')][_0x4d30('0x55')](_0x221d82[_0x4d30('0x56')],{})[_0x4d30('0x25')](respondWithResult(_0x1b0446,0xc9))[_0x4d30('0x39')](handleError(_0x1b0446,null));};exports[_0x4d30('0x24')]=function(_0x2438db,_0x3b7feb){if(_0x2438db[_0x4d30('0x56')]['id']){delete _0x2438db[_0x4d30('0x56')]['id'];}_0x2438db[_0x4d30('0x56')][_0x4d30('0x3e')]=widgetAttributes(_0x2438db[_0x4d30('0x56')]);return db['DashboardItem'][_0x4d30('0x38')]({'where':{'id':_0x2438db[_0x4d30('0x3a')]['id']}})[_0x4d30('0x25')](handleEntityNotFound(_0x3b7feb,null))[_0x4d30('0x25')](saveUpdates(_0x2438db[_0x4d30('0x56')],null))[_0x4d30('0x25')](respondWithResult(_0x3b7feb,null))[_0x4d30('0x39')](handleError(_0x3b7feb,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a9b4e83..f80426a 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 _0x9354=['hasOwnProperty','exports','events','DashboardItem','setMaxListeners','save','update','remove','emit'];(function(_0x4045fe,_0x809675){var _0x59b5af=function(_0x4d07e7){while(--_0x4d07e7){_0x4045fe['push'](_0x4045fe['shift']());}};_0x59b5af(++_0x809675);}(_0x9354,0x77));var _0x4935=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x9354[_0x79cd47];return _0x3b9484;};'use strict';var EventEmitter=require(_0x4935('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x4935('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x4935('0x2')](0x0);var events={'afterCreate':_0x4935('0x3'),'afterUpdate':_0x4935('0x4'),'afterDestroy':_0x4935('0x5')};function emitEvent(_0x312e9d){return function(_0x591d3b,_0x3231bb,_0x59482d){DashboardItemEvents[_0x4935('0x6')](_0x312e9d+':'+_0x591d3b['id'],_0x591d3b);DashboardItemEvents[_0x4935('0x6')](_0x312e9d,_0x591d3b);_0x59482d(null);};}for(var e in events){if(events[_0x4935('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x4935('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x8709=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0x8709,0xc6));var _0x9870=function(_0x3cbc98,_0x4af397){_0x3cbc98=_0x3cbc98-0x0;var _0x9a80c3=_0x8709[_0x3cbc98];return _0x9a80c3;};'use strict';var EventEmitter=require(_0x9870('0x0'));var DashboardItem=require(_0x9870('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9870('0x2')](0x0);var events={'afterCreate':_0x9870('0x3'),'afterUpdate':_0x9870('0x4'),'afterDestroy':_0x9870('0x5')};function emitEvent(_0x3dfed8){return function(_0x1ab839,_0x1cd217,_0x53300e){DashboardItemEvents[_0x9870('0x6')](_0x3dfed8+':'+_0x1ab839['id'],_0x1ab839);DashboardItemEvents['emit'](_0x3dfed8,_0x1ab839);_0x53300e(null);};}for(var e in events){if(events[_0x9870('0x7')](e)){var event=events[e];DashboardItem[_0x9870('0x8')](e,emitEvent(event));}}module[_0x9870('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 7fac0e7..1416e56 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 _0x5bdd=['api','bluebird','request-promise','../../config/environment','./dashboardItem.attributes','exports','define','dashboard_items','lodash','util'];(function(_0x421739,_0x485996){var _0x1934d6=function(_0x2dbacd){while(--_0x2dbacd){_0x421739['push'](_0x421739['shift']());}};_0x1934d6(++_0x485996);}(_0x5bdd,0xbc));var _0xd5bd=function(_0x2c1b01,_0x391fa3){_0x2c1b01=_0x2c1b01-0x0;var _0x27cd47=_0x5bdd[_0x2c1b01];return _0x27cd47;};'use strict';var _=require(_0xd5bd('0x0'));var util=require(_0xd5bd('0x1'));var logger=require('../../config/logger')(_0xd5bd('0x2'));var moment=require('moment');var BPromise=require(_0xd5bd('0x3'));var rp=require(_0xd5bd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd5bd('0x5'));var attributes=require(_0xd5bd('0x6'));module[_0xd5bd('0x7')]=function(_0x1a2668,_0x55cd8a){return _0x1a2668[_0xd5bd('0x8')]('DashboardItem',attributes,{'tableName':_0xd5bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb02e=['request-promise','rimraf','../../config/environment','./dashboardItem.attributes','define','DashboardItem','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2d5aff,_0x218bf9){var _0x71f75c=function(_0xf67087){while(--_0xf67087){_0x2d5aff['push'](_0x2d5aff['shift']());}};_0x71f75c(++_0x218bf9);}(_0xb02e,0xa0));var _0xeb02=function(_0x40ccce,_0x3d53f8){_0x40ccce=_0x40ccce-0x0;var _0x59e663=_0xb02e[_0x40ccce];return _0x59e663;};'use strict';var _=require(_0xeb02('0x0'));var util=require('util');var logger=require(_0xeb02('0x1'))(_0xeb02('0x2'));var moment=require(_0xeb02('0x3'));var BPromise=require(_0xeb02('0x4'));var rp=require(_0xeb02('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb02('0x6'));var config=require(_0xeb02('0x7'));var attributes=require(_0xeb02('0x8'));module['exports']=function(_0x569ac6,_0xdf611e){return _0x569ac6[_0xeb02('0x9')](_0xeb02('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index e677023..350ffca 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 _0xfc14=['register','request','then','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./dashboardItem.socket'];(function(_0x4f4cbb,_0x4a7abb){var _0x41003c=function(_0x40a3a8){while(--_0x40a3a8){_0x4f4cbb['push'](_0x4f4cbb['shift']());}};_0x41003c(++_0x4a7abb);}(_0xfc14,0x1ce));var _0x4fc1=function(_0xc92908,_0x42cea6){_0xc92908=_0xc92908-0x0;var _0x3828e1=_0xfc14[_0xc92908];return _0x3828e1;};'use strict';var _=require(_0x4fc1('0x0'));var util=require(_0x4fc1('0x1'));var moment=require(_0x4fc1('0x2'));var BPromise=require(_0x4fc1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4fc1('0x4'));var db=require(_0x4fc1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4fc1('0x6'));var config=require(_0x4fc1('0x7'));var jayson=require(_0x4fc1('0x8'));var client=jayson[_0x4fc1('0x9')][_0x4fc1('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4fc1('0xb')],{'host':_0x4fc1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4fc1('0xb')]));require(_0x4fc1('0xd'))[_0x4fc1('0xe')](socket);function respondWithRpcPromise(_0x63970f,_0x236461,_0x57566c){return new BPromise(function(_0xb7bd2c,_0x323b8f){return client[_0x4fc1('0xf')](_0x63970f,_0x57566c)[_0x4fc1('0x10')](function(_0x1e0510){logger['info'](_0x4fc1('0x11'),_0x236461,'request\x20sent');logger[_0x4fc1('0x12')](_0x4fc1('0x13'),_0x236461,_0x4fc1('0x14'),JSON[_0x4fc1('0x15')](_0x1e0510));if(_0x1e0510[_0x4fc1('0x16')]){if(_0x1e0510[_0x4fc1('0x16')][_0x4fc1('0x17')]===0x1f4){logger[_0x4fc1('0x16')](_0x4fc1('0x11'),_0x236461,_0x1e0510['error']['message']);return _0x323b8f(_0x1e0510['error'][_0x4fc1('0x18')]);}logger[_0x4fc1('0x16')](_0x4fc1('0x11'),_0x236461,_0x1e0510[_0x4fc1('0x16')][_0x4fc1('0x18')]);return _0xb7bd2c(_0x1e0510['error']['message']);}else{logger[_0x4fc1('0x19')]('DashboardItem,\x20%s,\x20%s',_0x236461,'request\x20sent');_0xb7bd2c(_0x1e0510[_0x4fc1('0x1a')][_0x4fc1('0x18')]);}})[_0x4fc1('0x1b')](function(_0x196005){logger[_0x4fc1('0x16')](_0x4fc1('0x11'),_0x236461,_0x196005);_0x323b8f(_0x196005);});});} \ No newline at end of file +var _0xf3f3=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xf3f3,0x11b));var _0x3f3f=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0xf3f3[_0x59b439];return _0x521ea3;};'use strict';var _=require(_0x3f3f('0x0'));var util=require(_0x3f3f('0x1'));var moment=require('moment');var BPromise=require(_0x3f3f('0x2'));var rs=require(_0x3f3f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f3f('0x4'))['db'];var utils=require(_0x3f3f('0x5'));var logger=require(_0x3f3f('0x6'))(_0x3f3f('0x7'));var config=require('../../config/environment');var jayson=require(_0x3f3f('0x8'));var client=jayson[_0x3f3f('0x9')][_0x3f3f('0xa')]({'port':0x232a});config[_0x3f3f('0xb')]=_[_0x3f3f('0xc')](config[_0x3f3f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3f3f('0xb')]));require(_0x3f3f('0xd'))[_0x3f3f('0xe')](socket);function respondWithRpcPromise(_0x1b0551,_0x24d158,_0x2c787c){return new BPromise(function(_0x22443b,_0x2bca39){return client[_0x3f3f('0xf')](_0x1b0551,_0x2c787c)[_0x3f3f('0x10')](function(_0x43ec76){logger[_0x3f3f('0x11')](_0x3f3f('0x12'),_0x24d158,_0x3f3f('0x13'));logger[_0x3f3f('0x14')](_0x3f3f('0x15'),_0x24d158,_0x3f3f('0x13'),JSON[_0x3f3f('0x16')](_0x43ec76));if(_0x43ec76['error']){if(_0x43ec76['error'][_0x3f3f('0x17')]===0x1f4){logger[_0x3f3f('0x18')](_0x3f3f('0x12'),_0x24d158,_0x43ec76[_0x3f3f('0x18')]['message']);return _0x2bca39(_0x43ec76[_0x3f3f('0x18')]['message']);}logger['error'](_0x3f3f('0x12'),_0x24d158,_0x43ec76['error'][_0x3f3f('0x19')]);return _0x22443b(_0x43ec76[_0x3f3f('0x18')][_0x3f3f('0x19')]);}else{logger['info'](_0x3f3f('0x12'),_0x24d158,_0x3f3f('0x13'));_0x22443b(_0x43ec76[_0x3f3f('0x1a')][_0x3f3f('0x19')]);}})[_0x3f3f('0x1b')](function(_0x1d88cc){logger[_0x3f3f('0x18')](_0x3f3f('0x12'),_0x24d158,_0x1d88cc);_0x2bca39(_0x1d88cc);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index da0c3a9..0283733 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 _0x6854=['length','update','emit','register'];(function(_0x461c65,_0x117083){var _0x449392=function(_0x164494){while(--_0x164494){_0x461c65['push'](_0x461c65['shift']());}};_0x449392(++_0x117083);}(_0x6854,0x19d));var _0x4685=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x6854[_0xef8146];return _0x5a6cb0;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save','remove',_0x4685('0x0')];function createListener(_0x514654,_0xa74025){return function(_0x539405){_0xa74025[_0x4685('0x1')](_0x514654,_0x539405);};}function removeListener(_0x4488a4,_0x34a2d7){return function(){DashboardItemEvents['removeListener'](_0x4488a4,_0x34a2d7);};}exports[_0x4685('0x2')]=function(_0xc61ec5){for(var _0x23886e=0x0,_0x46a5d8=events[_0x4685('0x3')];_0x23886e<_0x46a5d8;_0x23886e++){var _0x373e95=events[_0x23886e];var _0x3f4dd1=createListener('dashboardItem:'+_0x373e95,_0xc61ec5);DashboardItemEvents['on'](_0x373e95,_0x3f4dd1);}}; \ No newline at end of file +var _0x625a=['removeListener','register','./dashboardItem.events','save','update'];(function(_0x4f0a8c,_0x37e545){var _0x250654=function(_0x3131fa){while(--_0x3131fa){_0x4f0a8c['push'](_0x4f0a8c['shift']());}};_0x250654(++_0x37e545);}(_0x625a,0xe3));var _0xa625=function(_0x8cb2f9,_0x2b8706){_0x8cb2f9=_0x8cb2f9-0x0;var _0x164887=_0x625a[_0x8cb2f9];return _0x164887;};'use strict';var DashboardItemEvents=require(_0xa625('0x0'));var events=[_0xa625('0x1'),'remove',_0xa625('0x2')];function createListener(_0x35ae6c,_0xfe8505){return function(_0x3921d6){_0xfe8505['emit'](_0x35ae6c,_0x3921d6);};}function removeListener(_0x369c20,_0x3f0b03){return function(){DashboardItemEvents[_0xa625('0x3')](_0x369c20,_0x3f0b03);};}exports[_0xa625('0x4')]=function(_0x120bd6){for(var _0x9a0dbd=0x0,_0x1207c3=events['length'];_0x9a0dbd<_0x1207c3;_0x9a0dbd++){var _0x416cc8=events[_0x9a0dbd];var _0x2d84f6=createListener('dashboardItem:'+_0x416cc8,_0x120bd6);DashboardItemEvents['on'](_0x416cc8,_0x2d84f6);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 373ada4..e7e319d 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 _0x9c5a=['delete','isAuthenticated','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','show','post','put','update'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x2bd150,_0x691344){_0x2bd150=_0x2bd150-0x0;var _0x28a4c4=_0x9c5a[_0x2bd150];return _0x28a4c4;};'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'](_0xa9c5('0x8'),auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa9c5('0xb')](_0xa9c5('0x8'),auth['isAuthenticated'](),controller[_0xa9c5('0xc')]);router[_0xa9c5('0xd')]('/:id',auth[_0xa9c5('0xe')](),controller[_0xa9c5('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9c5a=['delete','isAuthenticated','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','show','post','put','update'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xa4e686,_0x4508e1){_0xa4e686=_0xa4e686-0x0;var _0x4755d2=_0x9c5a[_0xa4e686];return _0x4755d2;};'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'](_0xa9c5('0x8'),auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa9c5('0xb')](_0xa9c5('0x8'),auth['isAuthenticated'](),controller[_0xa9c5('0xc')]);router[_0xa9c5('0xd')]('/:id',auth[_0xa9c5('0xe')](),controller[_0xa9c5('0xf')]);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 226028c..41eaa07 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 _0x752a=['sequelize','STRING'];(function(_0x1fa44f,_0x46a191){var _0x3fc90e=function(_0x4dd431){while(--_0x4dd431){_0x1fa44f['push'](_0x1fa44f['shift']());}};_0x3fc90e(++_0x46a191);}(_0x752a,0x114));var _0xa752=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x752a[_0x5d07ff];return _0x5226ad;};'use strict';var Sequelize=require(_0xa752('0x0'));module['exports']={'name':{'type':Sequelize[_0xa752('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xf844=['STRING','sequelize'];(function(_0x49d26b,_0x1e552d){var _0x1c341c=function(_0x3b5f45){while(--_0x3b5f45){_0x49d26b['push'](_0x49d26b['shift']());}};_0x1c341c(++_0x1e552d);}(_0xf844,0x1f3));var _0x4f84=function(_0x41e793,_0x166684){_0x41e793=_0x41e793-0x0;var _0x2885fa=_0xf844[_0x41e793];return _0x2885fa;};'use strict';var Sequelize=require(_0x4f84('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f84('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index ea17e53..39f9126 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 _0x9c5a=['status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','Dispositions','UserProfileResource','end','error','stack','name','index','Disposition','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x26e8f9,_0x456e76){var _0xd62578=function(_0x4966ae){while(--_0x4966ae){_0x26e8f9['push'](_0x26e8f9['shift']());}};_0xd62578(++_0x456e76);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3fabb9,_0x5cc06f){_0x3fabb9=_0x3fabb9-0x0;var _0x5cc78f=_0x9c5a[_0x3fabb9];return _0x5cc78f;};'use strict';var pdf=require(_0xa9c5('0x0'));var emlformat=require(_0xa9c5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa9c5('0x2'));var jsonpatch=require(_0xa9c5('0x3'));var rp=require(_0xa9c5('0x4'));var moment=require(_0xa9c5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa9c5('0x6'));var util=require(_0xa9c5('0x7'));var path=require('path');var sox=require(_0xa9c5('0x8'));var csv=require('to-csv');var ejs=require(_0xa9c5('0x9'));var fs=require('fs');var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var db=require(_0xa9c5('0x15'))['db'];function respondWithStatusCode(_0x4492a4,_0x51c8d){_0x51c8d=_0x51c8d||0xcc;return function(_0x42d5cf){if(_0x42d5cf){return _0x4492a4[_0xa9c5('0x16')](_0x51c8d);}return _0x4492a4[_0xa9c5('0x17')](_0x51c8d)['end']();};}function respondWithResult(_0x390ca2,_0x1276d2){_0x1276d2=_0x1276d2||0xc8;return function(_0x7df76d){if(_0x7df76d){return _0x390ca2[_0xa9c5('0x17')](_0x1276d2)[_0xa9c5('0x18')](_0x7df76d);}};}function respondWithFilteredResult(_0x1dad66,_0x251099){return function(_0x40b001){if(_0x40b001){var _0x19a43e=_0x40b001[_0xa9c5('0x19')],_0xcf13f2=_0x251099[_0xa9c5('0x1a')],_0x4bb57e=_0x251099['offset']+_0x251099[_0xa9c5('0x1b')],_0x2b0d73;if(_0x4bb57e>=_0x19a43e){_0x4bb57e=_0x19a43e;_0x2b0d73=0xc8;}else{_0x2b0d73=0xce;}_0x1dad66[_0xa9c5('0x17')](_0x2b0d73);return _0x1dad66[_0xa9c5('0x1c')](_0xa9c5('0x1d'),_0xcf13f2+'-'+_0x4bb57e+'/'+_0x19a43e)[_0xa9c5('0x18')](_0x40b001);}return null;};}function patchUpdates(_0x349f27){return function(_0x3b8d4d){try{jsonpatch[_0xa9c5('0x1e')](_0x3b8d4d,_0x349f27,!![]);}catch(_0x2c7cd5){return BPromise[_0xa9c5('0x1f')](_0x2c7cd5);}return _0x3b8d4d[_0xa9c5('0x20')]();};}function saveUpdates(_0x2d95f8,_0x54f8b9){return function(_0x1115ad){if(_0x1115ad){return _0x1115ad[_0xa9c5('0x21')](_0x2d95f8)['then'](function(_0x5d2115){return _0x5d2115;});}return null;};}function removeEntity(_0xce9af6,_0x366f5c){return function(_0x10b208){if(_0x10b208){return _0x10b208[_0xa9c5('0x22')]()[_0xa9c5('0x23')](function(){var _0xd4b8a1=_0x10b208['get']({'plain':!![]});var _0x4fa280=_0xa9c5('0x24');return db[_0xa9c5('0x25')]['destroy']({'where':{'type':_0x4fa280,'resourceId':_0xd4b8a1['id']}})[_0xa9c5('0x23')](function(){return _0x10b208;});})[_0xa9c5('0x23')](function(){_0xce9af6[_0xa9c5('0x17')](0xcc)[_0xa9c5('0x26')]();});}};}function handleEntityNotFound(_0x4cbba1,_0x40f08b){return function(_0xe44e6d){if(!_0xe44e6d){_0x4cbba1['sendStatus'](0x194);}return _0xe44e6d;};}function handleError(_0x4e8a7f,_0x242771){_0x242771=_0x242771||0x1f4;return function(_0x4cd5e6){logger[_0xa9c5('0x27')](_0x4cd5e6[_0xa9c5('0x28')]);if(_0x4cd5e6['name']){delete _0x4cd5e6[_0xa9c5('0x29')];}_0x4e8a7f[_0xa9c5('0x17')](_0x242771)['send'](_0x4cd5e6);};}exports[_0xa9c5('0x2a')]=function(_0x32baf9,_0x198cdf){var _0x185eb8={},_0x325c65={},_0x4f6e70={'count':0x0,'rows':[]};var _0x36f267=_['map'](db[_0xa9c5('0x2b')][_0xa9c5('0x2c')],function(_0x2eeed1){return{'name':_0x2eeed1['fieldName'],'type':_0x2eeed1[_0xa9c5('0x2d')][_0xa9c5('0x2e')]};});_0x325c65['model']=_[_0xa9c5('0x2f')](_0x36f267,_0xa9c5('0x29'));_0x325c65[_0xa9c5('0x30')]=_[_0xa9c5('0x31')](_0x32baf9[_0xa9c5('0x30')]);_0x325c65[_0xa9c5('0x32')]=_[_0xa9c5('0x33')](_0x325c65['model'],_0x325c65[_0xa9c5('0x30')]);_0x185eb8[_0xa9c5('0x34')]=_[_0xa9c5('0x33')](_0x325c65[_0xa9c5('0x35')],qs[_0xa9c5('0x36')](_0x32baf9[_0xa9c5('0x30')][_0xa9c5('0x36')]));_0x185eb8[_0xa9c5('0x34')]=_0x185eb8['attributes']['length']?_0x185eb8[_0xa9c5('0x34')]:_0x325c65[_0xa9c5('0x35')];if(!_0x32baf9[_0xa9c5('0x30')][_0xa9c5('0x37')](_0xa9c5('0x38'))){_0x185eb8[_0xa9c5('0x1b')]=qs['limit'](_0x32baf9['query']['limit']);_0x185eb8[_0xa9c5('0x1a')]=qs[_0xa9c5('0x1a')](_0x32baf9['query'][_0xa9c5('0x1a')]);}_0x185eb8['order']=qs[_0xa9c5('0x39')](_0x32baf9[_0xa9c5('0x30')][_0xa9c5('0x39')]);_0x185eb8[_0xa9c5('0x3a')]=qs['filters'](_[_0xa9c5('0x3b')](_0x32baf9[_0xa9c5('0x30')],_0x325c65[_0xa9c5('0x32')]));if(_0x32baf9[_0xa9c5('0x30')][_0xa9c5('0x3c')]){_0x185eb8[_0xa9c5('0x3a')]=_[_0xa9c5('0x3d')](_0x185eb8[_0xa9c5('0x3a')],{'$or':_['map'](_0x36f267,function(_0x11b2b2){if(_0x11b2b2[_0xa9c5('0x2d')]!==_0xa9c5('0x3e')){var _0x2b95fa={};_0x2b95fa[_0x11b2b2[_0xa9c5('0x29')]]={'$like':'%'+_0x32baf9[_0xa9c5('0x30')]['filter']+'%'};return _0x2b95fa;}})});}_0x185eb8=_[_0xa9c5('0x3d')]({},_0x185eb8,_0x32baf9['options']);var _0x2fa3e3={'where':_0x185eb8['where']};return db[_0xa9c5('0x2b')][_0xa9c5('0x19')](_0x2fa3e3)[_0xa9c5('0x23')](function(_0x5d09c5){_0x4f6e70[_0xa9c5('0x19')]=_0x5d09c5;if(_0x32baf9[_0xa9c5('0x30')][_0xa9c5('0x3f')]){_0x185eb8[_0xa9c5('0x40')]=[{'all':!![]}];}return db['Disposition'][_0xa9c5('0x41')](_0x185eb8);})[_0xa9c5('0x23')](function(_0x3db918){_0x4f6e70[_0xa9c5('0x42')]=_0x3db918;return _0x4f6e70;})[_0xa9c5('0x23')](respondWithFilteredResult(_0x198cdf,_0x185eb8))['catch'](handleError(_0x198cdf,null));};exports[_0xa9c5('0x43')]=function(_0x566b60,_0x1de605){var _0x397614={'raw':!![],'where':{'id':_0x566b60[_0xa9c5('0x44')]['id']}},_0x2998ad={};_0x2998ad[_0xa9c5('0x35')]=_[_0xa9c5('0x31')](db[_0xa9c5('0x2b')][_0xa9c5('0x2c')]);_0x2998ad[_0xa9c5('0x30')]=_[_0xa9c5('0x31')](_0x566b60['query']);_0x2998ad[_0xa9c5('0x32')]=_[_0xa9c5('0x33')](_0x2998ad[_0xa9c5('0x35')],_0x2998ad[_0xa9c5('0x30')]);_0x397614[_0xa9c5('0x34')]=_[_0xa9c5('0x33')](_0x2998ad['model'],qs[_0xa9c5('0x36')](_0x566b60[_0xa9c5('0x30')]['fields']));_0x397614['attributes']=_0x397614['attributes']['length']?_0x397614['attributes']:_0x2998ad[_0xa9c5('0x35')];if(_0x566b60[_0xa9c5('0x30')][_0xa9c5('0x3f')]){_0x397614[_0xa9c5('0x40')]=[{'all':!![]}];}_0x397614=_[_0xa9c5('0x3d')]({},_0x397614,_0x566b60[_0xa9c5('0x45')]);return db[_0xa9c5('0x2b')][_0xa9c5('0x46')](_0x397614)[_0xa9c5('0x23')](handleEntityNotFound(_0x1de605,null))[_0xa9c5('0x23')](respondWithResult(_0x1de605,null))[_0xa9c5('0x47')](handleError(_0x1de605,null));};exports[_0xa9c5('0x48')]=function(_0x1c2ccf,_0x4bf8b4){return db[_0xa9c5('0x2b')]['create'](_0x1c2ccf[_0xa9c5('0x49')],{})[_0xa9c5('0x23')](function(_0x5c1c3a){var _0x5cbd33=_0x1c2ccf[_0xa9c5('0x4a')][_0xa9c5('0x4b')]({'plain':!![]});if(!_0x5cbd33)throw new Error(_0xa9c5('0x4c'));if(_0x5cbd33['role']==='user'){var _0x2333c4=_0x5c1c3a[_0xa9c5('0x4b')]({'plain':!![]});var _0x481f9c=_0xa9c5('0x24');return db[_0xa9c5('0x4d')][_0xa9c5('0x46')]({'where':{'name':_0x481f9c,'userProfileId':_0x5cbd33[_0xa9c5('0x4e')]},'raw':!![]})[_0xa9c5('0x23')](function(_0xb369da){if(_0xb369da&&_0xb369da['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2333c4[_0xa9c5('0x29')],'resourceId':_0x2333c4['id'],'type':_0xb369da[_0xa9c5('0x29')],'sectionId':_0xb369da['id']},{})[_0xa9c5('0x23')](function(){return _0x5c1c3a;});}else{return _0x5c1c3a;}})[_0xa9c5('0x47')](function(_0x380266){logger[_0xa9c5('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x380266);throw _0x380266;});}return _0x5c1c3a;})[_0xa9c5('0x23')](respondWithResult(_0x4bf8b4,0xc9))[_0xa9c5('0x47')](handleError(_0x4bf8b4,null));};exports[_0xa9c5('0x21')]=function(_0x2bdc77,_0xa0b458){if(_0x2bdc77[_0xa9c5('0x49')]['id']){delete _0x2bdc77['body']['id'];}return db['Disposition'][_0xa9c5('0x46')]({'where':{'id':_0x2bdc77['params']['id']}})[_0xa9c5('0x23')](handleEntityNotFound(_0xa0b458,null))['then'](saveUpdates(_0x2bdc77[_0xa9c5('0x49')],null))[_0xa9c5('0x23')](respondWithResult(_0xa0b458,null))[_0xa9c5('0x47')](handleError(_0xa0b458,null));};exports['destroy']=function(_0x344c7f,_0xe5390f){return db[_0xa9c5('0x2b')][_0xa9c5('0x46')]({'where':{'id':_0x344c7f['params']['id']}})['then'](handleEntityNotFound(_0xe5390f,null))[_0xa9c5('0x23')](removeEntity(_0xe5390f,null))[_0xa9c5('0x47')](handleError(_0xe5390f,null));}; \ No newline at end of file +var _0x00bb=['limit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','Dispositions','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','end','json','count','offset','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Disposition','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x2c183c,_0x4883bf){var _0xc66563=function(_0x2f9026){while(--_0x2f9026){_0x2c183c['push'](_0x2c183c['shift']());}};_0xc66563(++_0x4883bf);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x00bb[_0x55e08b];return _0xd1a7ff;};'use strict';var pdf=require(_0xb00b('0x0'));var emlformat=require(_0xb00b('0x1'));var rimraf=require(_0xb00b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb00b('0x3'));var rp=require('request-promise');var moment=require(_0xb00b('0x4'));var BPromise=require(_0xb00b('0x5'));var Mustache=require('mustache');var util=require(_0xb00b('0x6'));var path=require(_0xb00b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ff792,_0x2d8ddf){_0x2d8ddf=_0x2d8ddf||0xcc;return function(_0x1be8aa){if(_0x1be8aa){return _0x4ff792[_0xb00b('0x14')](_0x2d8ddf);}return _0x4ff792[_0xb00b('0x15')](_0x2d8ddf)[_0xb00b('0x16')]();};}function respondWithResult(_0x4ada81,_0x218de2){_0x218de2=_0x218de2||0xc8;return function(_0xb0d42e){if(_0xb0d42e){return _0x4ada81['status'](_0x218de2)[_0xb00b('0x17')](_0xb0d42e);}};}function respondWithFilteredResult(_0x1084a6,_0x540b79){return function(_0x5da36b){if(_0x5da36b){var _0x9b471e=_0x5da36b[_0xb00b('0x18')],_0x4dcd45=_0x540b79[_0xb00b('0x19')],_0x51d136=_0x540b79[_0xb00b('0x19')]+_0x540b79['limit'],_0x1f9c78;if(_0x51d136>=_0x9b471e){_0x51d136=_0x9b471e;_0x1f9c78=0xc8;}else{_0x1f9c78=0xce;}_0x1084a6[_0xb00b('0x15')](_0x1f9c78);return _0x1084a6['set'](_0xb00b('0x1a'),_0x4dcd45+'-'+_0x51d136+'/'+_0x9b471e)['json'](_0x5da36b);}return null;};}function patchUpdates(_0x25d7a0){return function(_0x5e8d7b){try{jsonpatch[_0xb00b('0x1b')](_0x5e8d7b,_0x25d7a0,!![]);}catch(_0x3355a3){return BPromise['reject'](_0x3355a3);}return _0x5e8d7b['save']();};}function saveUpdates(_0x2b0da1,_0x4a334b){return function(_0x1344c4){if(_0x1344c4){return _0x1344c4[_0xb00b('0x1c')](_0x2b0da1)[_0xb00b('0x1d')](function(_0x3501af){return _0x3501af;});}return null;};}function removeEntity(_0x56c189,_0x362ee0){return function(_0x4df284){if(_0x4df284){return _0x4df284[_0xb00b('0x1e')]()[_0xb00b('0x1d')](function(){var _0x51b841=_0x4df284[_0xb00b('0x1f')]({'plain':!![]});var _0x2896d1='Dispositions';return db[_0xb00b('0x20')][_0xb00b('0x1e')]({'where':{'type':_0x2896d1,'resourceId':_0x51b841['id']}})['then'](function(){return _0x4df284;});})[_0xb00b('0x1d')](function(){_0x56c189[_0xb00b('0x15')](0xcc)[_0xb00b('0x16')]();});}};}function handleEntityNotFound(_0x8caadf,_0x520e55){return function(_0x50be6c){if(!_0x50be6c){_0x8caadf[_0xb00b('0x14')](0x194);}return _0x50be6c;};}function handleError(_0x490380,_0x550587){_0x550587=_0x550587||0x1f4;return function(_0x4a635e){logger[_0xb00b('0x21')](_0x4a635e[_0xb00b('0x22')]);if(_0x4a635e[_0xb00b('0x23')]){delete _0x4a635e[_0xb00b('0x23')];}_0x490380[_0xb00b('0x15')](_0x550587)[_0xb00b('0x24')](_0x4a635e);};}exports[_0xb00b('0x25')]=function(_0x4a8d2b,_0x22c22d){var _0x503c9c={},_0x450129={},_0x348165={'count':0x0,'rows':[]};var _0x5424ca=_['map'](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x16fbd5){return{'name':_0x16fbd5[_0xb00b('0x28')],'type':_0x16fbd5[_0xb00b('0x29')][_0xb00b('0x2a')]};});_0x450129[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x5424ca,_0xb00b('0x23'));_0x450129['query']=_[_0xb00b('0x2d')](_0x4a8d2b[_0xb00b('0x2e')]);_0x450129['filters']=_[_0xb00b('0x2f')](_0x450129[_0xb00b('0x2b')],_0x450129['query']);_0x503c9c[_0xb00b('0x30')]=_['intersection'](_0x450129[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x503c9c[_0xb00b('0x30')]=_0x503c9c[_0xb00b('0x30')][_0xb00b('0x32')]?_0x503c9c['attributes']:_0x450129['model'];if(!_0x4a8d2b['query'][_0xb00b('0x33')](_0xb00b('0x34'))){_0x503c9c[_0xb00b('0x35')]=qs[_0xb00b('0x35')](_0x4a8d2b['query'][_0xb00b('0x35')]);_0x503c9c[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x19')]);}_0x503c9c[_0xb00b('0x36')]=qs[_0xb00b('0x37')](_0x4a8d2b[_0xb00b('0x2e')]['sort']);_0x503c9c['where']=qs[_0xb00b('0x38')](_['pick'](_0x4a8d2b[_0xb00b('0x2e')],_0x450129[_0xb00b('0x38')]));if(_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x39')]){_0x503c9c[_0xb00b('0x3a')]=_[_0xb00b('0x3b')](_0x503c9c[_0xb00b('0x3a')],{'$or':_['map'](_0x5424ca,function(_0x35f1ca){if(_0x35f1ca[_0xb00b('0x29')]!==_0xb00b('0x3c')){var _0xd9c03f={};_0xd9c03f[_0x35f1ca[_0xb00b('0x23')]]={'$like':'%'+_0x4a8d2b[_0xb00b('0x2e')]['filter']+'%'};return _0xd9c03f;}})});}_0x503c9c=_[_0xb00b('0x3b')]({},_0x503c9c,_0x4a8d2b[_0xb00b('0x3d')]);var _0x4801e7={'where':_0x503c9c[_0xb00b('0x3a')]};return db[_0xb00b('0x26')][_0xb00b('0x18')](_0x4801e7)[_0xb00b('0x1d')](function(_0x2954e8){_0x348165['count']=_0x2954e8;if(_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x3e')]){_0x503c9c[_0xb00b('0x3f')]=[{'all':!![]}];}return db[_0xb00b('0x26')]['findAll'](_0x503c9c);})['then'](function(_0x43f834){_0x348165[_0xb00b('0x40')]=_0x43f834;return _0x348165;})[_0xb00b('0x1d')](respondWithFilteredResult(_0x22c22d,_0x503c9c))[_0xb00b('0x41')](handleError(_0x22c22d,null));};exports[_0xb00b('0x42')]=function(_0x26f17b,_0x275664){var _0x493841={'raw':!![],'where':{'id':_0x26f17b[_0xb00b('0x43')]['id']}},_0x36200d={};_0x36200d[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db[_0xb00b('0x26')][_0xb00b('0x27')]);_0x36200d[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x26f17b[_0xb00b('0x2e')]);_0x36200d[_0xb00b('0x38')]=_[_0xb00b('0x2f')](_0x36200d[_0xb00b('0x2b')],_0x36200d['query']);_0x493841[_0xb00b('0x30')]=_[_0xb00b('0x2f')](_0x36200d[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x26f17b[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x493841[_0xb00b('0x30')]=_0x493841[_0xb00b('0x30')][_0xb00b('0x32')]?_0x493841[_0xb00b('0x30')]:_0x36200d[_0xb00b('0x2b')];if(_0x26f17b[_0xb00b('0x2e')]['includeAll']){_0x493841['include']=[{'all':!![]}];}_0x493841=_['merge']({},_0x493841,_0x26f17b[_0xb00b('0x3d')]);return db[_0xb00b('0x26')]['find'](_0x493841)[_0xb00b('0x1d')](handleEntityNotFound(_0x275664,null))[_0xb00b('0x1d')](respondWithResult(_0x275664,null))[_0xb00b('0x41')](handleError(_0x275664,null));};exports[_0xb00b('0x44')]=function(_0x4b62b3,_0x58e9cb){return db[_0xb00b('0x26')][_0xb00b('0x44')](_0x4b62b3['body'],{})['then'](function(_0x154759){var _0x3a205d=_0x4b62b3['user'][_0xb00b('0x1f')]({'plain':!![]});if(!_0x3a205d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a205d['role']==='user'){var _0x465d90=_0x154759['get']({'plain':!![]});var _0x1f7b86=_0xb00b('0x45');return db[_0xb00b('0x46')][_0xb00b('0x47')]({'where':{'name':_0x1f7b86,'userProfileId':_0x3a205d[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x1d')](function(_0x4846c9){if(_0x4846c9&&_0x4846c9['autoAssociation']===0x0){return db[_0xb00b('0x20')][_0xb00b('0x44')]({'name':_0x465d90['name'],'resourceId':_0x465d90['id'],'type':_0x4846c9[_0xb00b('0x23')],'sectionId':_0x4846c9['id']},{})[_0xb00b('0x1d')](function(){return _0x154759;});}else{return _0x154759;}})['catch'](function(_0x15dcbf){logger[_0xb00b('0x21')](_0xb00b('0x49'),_0x15dcbf);throw _0x15dcbf;});}return _0x154759;})['then'](respondWithResult(_0x58e9cb,0xc9))['catch'](handleError(_0x58e9cb,null));};exports[_0xb00b('0x1c')]=function(_0x398deb,_0x12737d){if(_0x398deb[_0xb00b('0x4a')]['id']){delete _0x398deb['body']['id'];}return db[_0xb00b('0x26')][_0xb00b('0x47')]({'where':{'id':_0x398deb['params']['id']}})['then'](handleEntityNotFound(_0x12737d,null))[_0xb00b('0x1d')](saveUpdates(_0x398deb['body'],null))[_0xb00b('0x1d')](respondWithResult(_0x12737d,null))[_0xb00b('0x41')](handleError(_0x12737d,null));};exports[_0xb00b('0x1e')]=function(_0x222459,_0x450ce7){return db[_0xb00b('0x26')]['find']({'where':{'id':_0x222459[_0xb00b('0x43')]['id']}})['then'](handleEntityNotFound(_0x450ce7,null))[_0xb00b('0x1d')](removeEntity(_0x450ce7,null))[_0xb00b('0x41')](handleError(_0x450ce7,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 9e8815f..a98582e 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 _0x0c5a=['name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','ListId','name','ChatWebsiteId'];(function(_0xc9204c,_0x4ad800){var _0x5dfd2d=function(_0x3c3074){while(--_0x3c3074){_0xc9204c['push'](_0xc9204c['shift']());}};_0x5dfd2d(++_0x4ad800);}(_0x0c5a,0x102));var _0xa0c5=function(_0x2da71d,_0x34f66b){_0x2da71d=_0x2da71d-0x0;var _0x16c334=_0x0c5a[_0x2da71d];return _0x16c334;};'use strict';var _=require(_0xa0c5('0x0'));var util=require(_0xa0c5('0x1'));var logger=require(_0xa0c5('0x2'))('api');var moment=require(_0xa0c5('0x3'));var BPromise=require(_0xa0c5('0x4'));var rp=require(_0xa0c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa0c5('0x6'));var attributes=require('./disposition.attributes');module[_0xa0c5('0x7')]=function(_0x475121,_0x4857a5){return _0x475121[_0xa0c5('0x8')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0xa0c5('0x9')]},{'unique':!![],'name':'name_chat','fields':[_0xa0c5('0xa'),_0xa0c5('0xb')]},{'unique':!![],'name':'name_mail','fields':[_0xa0c5('0xa'),'MailAccountId']},{'unique':!![],'name':_0xa0c5('0xc'),'fields':[_0xa0c5('0xa'),_0xa0c5('0xd')]},{'unique':!![],'name':_0xa0c5('0xe'),'fields':[_0xa0c5('0xa'),_0xa0c5('0xf')]},{'unique':!![],'name':_0xa0c5('0x10'),'fields':['name',_0xa0c5('0x11')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe2b=['../../config/environment','exports','define','Disposition','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xbe2b,0x1f3));var _0xbbe2=function(_0x123584,_0x376fe2){_0x123584=_0x123584-0x0;var _0x5e70a3=_0xbe2b[_0x123584];return _0x5e70a3;};'use strict';var _=require(_0xbbe2('0x0'));var util=require('util');var logger=require(_0xbbe2('0x1'))(_0xbbe2('0x2'));var moment=require('moment');var BPromise=require(_0xbbe2('0x3'));var rp=require(_0xbbe2('0x4'));var fs=require('fs');var path=require(_0xbbe2('0x5'));var rimraf=require(_0xbbe2('0x6'));var config=require(_0xbbe2('0x7'));var attributes=require('./disposition.attributes');module[_0xbbe2('0x8')]=function(_0x3ef73a,_0x2b533d){return _0x3ef73a[_0xbbe2('0x9')](_0xbbe2('0xa'),attributes,{'tableName':_0xbbe2('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xbbe2('0xc'),'fields':[_0xbbe2('0xd'),'ListId']},{'unique':!![],'name':_0xbbe2('0xe'),'fields':['name',_0xbbe2('0xf')]},{'unique':!![],'name':_0xbbe2('0x10'),'fields':[_0xbbe2('0xd'),'MailAccountId']},{'unique':!![],'name':_0xbbe2('0x11'),'fields':['name',_0xbbe2('0x12')]},{'unique':!![],'name':_0xbbe2('0x13'),'fields':[_0xbbe2('0xd'),_0xbbe2('0x14')]},{'unique':!![],'name':_0xbbe2('0x15'),'fields':['name',_0xbbe2('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 ca8bdaa..c605841 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 _0xbe23=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Disposition,\x20%s,\x20%s','debug','Disposition,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3bb245,_0x724c8c){var _0x2e2441=function(_0x815784){while(--_0x815784){_0x3bb245['push'](_0x3bb245['shift']());}};_0x2e2441(++_0x724c8c);}(_0xbe23,0x13e));var _0x3be2=function(_0x590af0,_0x1d1429){_0x590af0=_0x590af0-0x0;var _0x3b7d32=_0xbe23[_0x590af0];return _0x3b7d32;};'use strict';var _=require('lodash');var util=require(_0x3be2('0x0'));var moment=require(_0x3be2('0x1'));var BPromise=require(_0x3be2('0x2'));var rs=require(_0x3be2('0x3'));var fs=require('fs');var Redis=require(_0x3be2('0x4'));var db=require(_0x3be2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3be2('0x6'))(_0x3be2('0x7'));var config=require('../../config/environment');var jayson=require(_0x3be2('0x8'));var client=jayson[_0x3be2('0x9')][_0x3be2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3522fb,_0x17310b,_0x327ed7){return new BPromise(function(_0x4a8d01,_0x54154e){return client[_0x3be2('0xb')](_0x3522fb,_0x327ed7)[_0x3be2('0xc')](function(_0x103cae){logger[_0x3be2('0xd')](_0x3be2('0xe'),_0x17310b,'request\x20sent');logger[_0x3be2('0xf')](_0x3be2('0x10'),_0x17310b,_0x3be2('0x11'),JSON[_0x3be2('0x12')](_0x103cae));if(_0x103cae[_0x3be2('0x13')]){if(_0x103cae[_0x3be2('0x13')][_0x3be2('0x14')]===0x1f4){logger[_0x3be2('0x13')](_0x3be2('0xe'),_0x17310b,_0x103cae[_0x3be2('0x13')]['message']);return _0x54154e(_0x103cae[_0x3be2('0x13')][_0x3be2('0x15')]);}logger[_0x3be2('0x13')](_0x3be2('0xe'),_0x17310b,_0x103cae[_0x3be2('0x13')][_0x3be2('0x15')]);return _0x4a8d01(_0x103cae[_0x3be2('0x13')][_0x3be2('0x15')]);}else{logger[_0x3be2('0xd')](_0x3be2('0xe'),_0x17310b,_0x3be2('0x11'));_0x4a8d01(_0x103cae[_0x3be2('0x16')][_0x3be2('0x15')]);}})[_0x3be2('0x17')](function(_0x2f80ca){logger[_0x3be2('0x13')](_0x3be2('0xe'),_0x17310b,_0x2f80ca);_0x54154e(_0x2f80ca);});});} \ No newline at end of file +var _0xd270=['jayson/promise','http','request','then','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','Disposition,\x20%s,\x20%s','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xd270,0x15f));var _0x0d27=function(_0x19ea11,_0x1534b9){_0x19ea11=_0x19ea11-0x0;var _0x50cf44=_0xd270[_0x19ea11];return _0x50cf44;};'use strict';var _=require(_0x0d27('0x0'));var util=require('util');var moment=require(_0x0d27('0x1'));var BPromise=require(_0x0d27('0x2'));var rs=require(_0x0d27('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d27('0x4'))['db'];var utils=require(_0x0d27('0x5'));var logger=require(_0x0d27('0x6'))(_0x0d27('0x7'));var config=require(_0x0d27('0x8'));var jayson=require(_0x0d27('0x9'));var client=jayson['client'][_0x0d27('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e3322,_0xe6a932,_0xbe7129){return new BPromise(function(_0x1f31e1,_0x29e1ab){return client[_0x0d27('0xb')](_0x4e3322,_0xbe7129)[_0x0d27('0xc')](function(_0x49e2e9){logger['info']('Disposition,\x20%s,\x20%s',_0xe6a932,'request\x20sent');logger[_0x0d27('0xd')](_0x0d27('0xe'),_0xe6a932,'request\x20sent',JSON[_0x0d27('0xf')](_0x49e2e9));if(_0x49e2e9[_0x0d27('0x10')]){if(_0x49e2e9[_0x0d27('0x10')][_0x0d27('0x11')]===0x1f4){logger[_0x0d27('0x10')]('Disposition,\x20%s,\x20%s',_0xe6a932,_0x49e2e9['error'][_0x0d27('0x12')]);return _0x29e1ab(_0x49e2e9[_0x0d27('0x10')][_0x0d27('0x12')]);}logger[_0x0d27('0x10')]('Disposition,\x20%s,\x20%s',_0xe6a932,_0x49e2e9[_0x0d27('0x10')]['message']);return _0x1f31e1(_0x49e2e9[_0x0d27('0x10')][_0x0d27('0x12')]);}else{logger[_0x0d27('0x13')](_0x0d27('0x14'),_0xe6a932,_0x0d27('0x15'));_0x1f31e1(_0x49e2e9[_0x0d27('0x16')][_0x0d27('0x12')]);}})[_0x0d27('0x17')](function(_0x2a7793){logger[_0x0d27('0x10')]('Disposition,\x20%s,\x20%s',_0xe6a932,_0x2a7793);_0x29e1ab(_0x2a7793);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index e7ee47d..ea0a54f 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 _0x2faf=['Router','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','show','post','put','delete','/:id','destroy','exports','multer','util','path','express'];(function(_0x15852f,_0x1e6a3a){var _0x185bbd=function(_0x68d21){while(--_0x68d21){_0x15852f['push'](_0x15852f['shift']());}};_0x185bbd(++_0x1e6a3a);}(_0x2faf,0xb0));var _0xf2fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2faf[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xf2fa('0x0'));var util=require(_0xf2fa('0x1'));var path=require(_0xf2fa('0x2'));var timeout=require('connect-timeout');var express=require(_0xf2fa('0x3'));var router=express[_0xf2fa('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf2fa('0x5'));var config=require(_0xf2fa('0x6'));var controller=require(_0xf2fa('0x7'));router[_0xf2fa('0x8')]('/',auth[_0xf2fa('0x9')](),controller[_0xf2fa('0xa')]);router[_0xf2fa('0x8')]('/:id',auth[_0xf2fa('0x9')](),controller[_0xf2fa('0xb')]);router[_0xf2fa('0xc')]('/',auth[_0xf2fa('0x9')](),controller['create']);router[_0xf2fa('0xd')]('/:id',auth[_0xf2fa('0x9')](),controller['update']);router[_0xf2fa('0xe')](_0xf2fa('0xf'),auth[_0xf2fa('0x9')](),controller[_0xf2fa('0x10')]);module[_0xf2fa('0x11')]=router; \ No newline at end of file +var _0x3264=['show','post','create','put','/:id','delete','destroy','util','path','connect-timeout','express','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x3666c7,_0x26ef5e){var _0x1dc09a=function(_0x45f099){while(--_0x45f099){_0x3666c7['push'](_0x3666c7['shift']());}};_0x1dc09a(++_0x26ef5e);}(_0x3264,0x7f));var _0x4326=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x3264[_0x456fb1];return _0x4083d6;};'use strict';var multer=require('multer');var util=require(_0x4326('0x0'));var path=require(_0x4326('0x1'));var timeout=require(_0x4326('0x2'));var express=require(_0x4326('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4326('0x4'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x4326('0x5')]('/',auth[_0x4326('0x6')](),controller[_0x4326('0x7')]);router[_0x4326('0x5')]('/:id',auth[_0x4326('0x6')](),controller[_0x4326('0x8')]);router[_0x4326('0x9')]('/',auth[_0x4326('0x6')](),controller[_0x4326('0xa')]);router[_0x4326('0xb')](_0x4326('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4326('0xd')](_0x4326('0xc'),auth[_0x4326('0x6')](),controller[_0x4326('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 5c520ff..711f312 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 _0x2e45=['2400','4800','9600','14400','7200','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','exports','STRING','ENUM','xCALLY\x20Motion\x20Fax'];(function(_0x40f68b,_0x5e3f8b){var _0x412446=function(_0x323c85){while(--_0x323c85){_0x40f68b['push'](_0x40f68b['shift']());}};_0x412446(++_0x5e3f8b);}(_0x2e45,0x1df));var _0x52e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2e45[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x52e4('0x0')]={'name':{'type':Sequelize[_0x52e4('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x52e4('0x1')]},'ecm':{'type':Sequelize[_0x52e4('0x2')]('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x52e4('0x3')},'localstationid':{'type':Sequelize[_0x52e4('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x52e4('0x2')](_0x52e4('0x4'),_0x52e4('0x5'),'7200',_0x52e4('0x6'),'12000',_0x52e4('0x7')),'defaultValue':_0x52e4('0x5')},'maxrate':{'type':Sequelize[_0x52e4('0x2')]('2400','4800',_0x52e4('0x8'),_0x52e4('0x6'),'12000',_0x52e4('0x7')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x52e4('0x1')],'defaultValue':_0x52e4('0x9')},'gateway':{'type':Sequelize[_0x52e4('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x52e4('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x52e4('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x52e4('0x2')](_0x52e4('0xb'),_0x52e4('0xc'),_0x52e4('0xd'),_0x52e4('0xe')),'defaultValue':_0x52e4('0xb')},'key':{'type':Sequelize[_0x52e4('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x52e4('0xf');}},'notificationSound':{'type':Sequelize[_0x52e4('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x52e4('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x52e4('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x52e4('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x52e4('0xa')],'allowNull':!![],'defaultValue':null,'comment':_0x52e4('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x52e4('0x10')],'defaultValue':![],'comment':_0x52e4('0x12'),'set':function(_0x2ac946){if(!_0x2ac946)this['setDataValue'](_0x52e4('0x13'),null);this[_0x52e4('0x14')]('mandatoryDisposition',_0x2ac946);}}}; \ No newline at end of file +var _0xdb81=['7200','9600','12000','14400','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800'];(function(_0x1b8165,_0x25b78e){var _0x31d82d=function(_0x1446aa){while(--_0x1446aa){_0x1b8165['push'](_0x1b8165['shift']());}};_0x31d82d(++_0x25b78e);}(_0xdb81,0x180));var _0x1db8=function(_0x54300d,_0x5b8bbd){_0x54300d=_0x54300d-0x0;var _0x75eff=_0xdb81[_0x54300d];return _0x75eff;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1db8('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1db8('0x0')]},'ecm':{'type':Sequelize[_0x1db8('0x1')](_0x1db8('0x2'),'no'),'defaultValue':_0x1db8('0x2')},'headerinfo':{'type':Sequelize[_0x1db8('0x0')],'defaultValue':_0x1db8('0x3')},'localstationid':{'type':Sequelize[_0x1db8('0x0')],'unique':_0x1db8('0x4')},'minrate':{'type':Sequelize[_0x1db8('0x1')](_0x1db8('0x5'),_0x1db8('0x6'),_0x1db8('0x7'),_0x1db8('0x8'),_0x1db8('0x9'),'14400'),'defaultValue':_0x1db8('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x1db8('0x6'),'7200',_0x1db8('0x8'),_0x1db8('0x9'),_0x1db8('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x1db8('0x0')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x1db8('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x1db8('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1db8('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x1db8('0x1')](_0x1db8('0xc'),_0x1db8('0xd'),_0x1db8('0xe'),_0x1db8('0xf')),'defaultValue':_0x1db8('0xc')},'key':{'type':Sequelize[_0x1db8('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1db8('0x10');}},'notificationSound':{'type':Sequelize[_0x1db8('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1db8('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1db8('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1db8('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1db8('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x1db8('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x1db8('0x11')],'defaultValue':![],'comment':_0x1db8('0x13'),'set':function(_0x5cd7e5){if(!_0x5cd7e5)this[_0x1db8('0x14')](_0x1db8('0x15'),null);this[_0x1db8('0x14')](_0x1db8('0x16'),_0x5cd7e5);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 910822c..afbfd71 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 _0x018c=['attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','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','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','sendStatus','json','count','offset','limit','status','set','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','map','FaxAccount','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','sequelize','transaction','FaxApplication','priority','getApplications','context','from-voip-provider','app','type','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','bulkCreate','updateAccountApplications','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','List','Contacts','DESC'];(function(_0x14c3e7,_0x5b8f94){var _0x34fe7b=function(_0x445d31){while(--_0x445d31){_0x14c3e7['push'](_0x14c3e7['shift']());}};_0x34fe7b(++_0x5b8f94);}(_0x018c,0xda));var _0xc018=function(_0x5e6ad3,_0x34a50f){_0x5e6ad3=_0x5e6ad3-0x0;var _0xb2fb0b=_0x018c[_0x5e6ad3];return _0xb2fb0b;};'use strict';var pdf=require(_0xc018('0x0'));var emlformat=require(_0xc018('0x1'));var rimraf=require(_0xc018('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc018('0x3'));var moment=require('moment');var BPromise=require(_0xc018('0x4'));var Mustache=require(_0xc018('0x5'));var util=require(_0xc018('0x6'));var path=require(_0xc018('0x7'));var sox=require('sox');var csv=require(_0xc018('0x8'));var ejs=require(_0xc018('0x9'));var fs=require('fs');var _=require(_0xc018('0xa'));var squel=require(_0xc018('0xb'));var crypto=require(_0xc018('0xc'));var jsforce=require(_0xc018('0xd'));var deskjs=require(_0xc018('0xe'));var toCsv=require(_0xc018('0x8'));var querystring=require(_0xc018('0xf'));var Papa=require(_0xc018('0x10'));var Redis=require(_0xc018('0x11'));var authService=require(_0xc018('0x12'));var qs=require(_0xc018('0x13'));var as=require(_0xc018('0x14'));var hardwareService=require(_0xc018('0x15'));var logger=require(_0xc018('0x16'))(_0xc018('0x17'));var utils=require(_0xc018('0x18'));var config=require('../../config/environment');var db=require(_0xc018('0x19'))['db'];config['redis']=_[_0xc018('0x1a')](config[_0xc018('0x1b')],{'host':_0xc018('0x1c'),'port':0x18eb});var socket=require(_0xc018('0x1d'))(new Redis(config[_0xc018('0x1b')]));require(_0xc018('0x1e'))[_0xc018('0x1f')](socket);var jayson=require(_0xc018('0x20'));var client=jayson[_0xc018('0x21')][_0xc018('0x22')]({'port':0x232c});var client9002=jayson[_0xc018('0x21')]['http']({'port':0x232a});function checkPasswordPattern(_0x2f1a73,_0x2a6598,_0x21b840){if(_0x21b840){var _0x3a07f8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a07f8[_0xc018('0x23')](_0x2a6598)){return _0x2f1a73;}else{throw new db[(_0xc018('0x24'))][(_0xc018('0x25'))](_0xc018('0x26'));}}else{return _0x2f1a73;}}function respondWithRpcPromise(_0x550652,_0x5f2c11,_0xe5f2fe,_0x4e388e){return new BPromise(function(_0x994233,_0x41a22d){var _0x141afc=_0x4e388e||client;return _0x141afc['request'](_0x550652,_0xe5f2fe)[_0xc018('0x27')](function(_0x24ee89){logger[_0xc018('0x28')]('FaxAccount,\x20%s,\x20%s',_0x5f2c11,_0xc018('0x29'));logger[_0xc018('0x2a')](_0xc018('0x2b'),_0x5f2c11,_0xc018('0x29'),JSON[_0xc018('0x2c')](_0x24ee89));if(_0x24ee89[_0xc018('0x2d')]){if(_0x24ee89[_0xc018('0x2d')][_0xc018('0x2e')]===0x1f4){logger[_0xc018('0x2d')](_0xc018('0x2f'),_0x5f2c11,_0x24ee89[_0xc018('0x2d')][_0xc018('0x30')]);return _0x41a22d(_0x24ee89[_0xc018('0x2d')][_0xc018('0x30')]);}logger[_0xc018('0x2d')](_0xc018('0x2f'),_0x5f2c11,_0x24ee89[_0xc018('0x2d')][_0xc018('0x30')]);return _0x994233(_0x24ee89[_0xc018('0x2d')][_0xc018('0x30')]);}else{logger['info'](_0xc018('0x2f'),_0x5f2c11,_0xc018('0x29'));_0x994233(_0x24ee89[_0xc018('0x31')][_0xc018('0x30')]);}})['catch'](function(_0xde5fb6){logger[_0xc018('0x2d')](_0xc018('0x2f'),_0x5f2c11,_0xde5fb6);_0x41a22d(_0xde5fb6);});});}function respondWithStatusCode(_0x509bc0,_0x523fe3){_0x523fe3=_0x523fe3||0xcc;return function(_0x35c356){if(_0x35c356){return _0x509bc0[_0xc018('0x32')](_0x523fe3);}return _0x509bc0['status'](_0x523fe3)['end']();};}function respondWithResult(_0x1a631c,_0x31373c){_0x31373c=_0x31373c||0xc8;return function(_0x31fcdc){if(_0x31fcdc){return _0x1a631c['status'](_0x31373c)[_0xc018('0x33')](_0x31fcdc);}};}function respondWithFilteredResult(_0x2aa836,_0x11c53e){return function(_0x2e8fcd){if(_0x2e8fcd){var _0x34ea58=_0x2e8fcd[_0xc018('0x34')],_0x34fdf4=_0x11c53e[_0xc018('0x35')],_0x1f8cfd=_0x11c53e[_0xc018('0x35')]+_0x11c53e[_0xc018('0x36')],_0x24b2fb;if(_0x1f8cfd>=_0x34ea58){_0x1f8cfd=_0x34ea58;_0x24b2fb=0xc8;}else{_0x24b2fb=0xce;}_0x2aa836[_0xc018('0x37')](_0x24b2fb);return _0x2aa836[_0xc018('0x38')]('Content-Range',_0x34fdf4+'-'+_0x1f8cfd+'/'+_0x34ea58)[_0xc018('0x33')](_0x2e8fcd);}return null;};}function patchUpdates(_0x194535){return function(_0x25f39c){try{jsonpatch[_0xc018('0x39')](_0x25f39c,_0x194535,!![]);}catch(_0x438176){return BPromise[_0xc018('0x3a')](_0x438176);}return _0x25f39c[_0xc018('0x3b')]();};}function saveUpdates(_0x275316,_0x3f9696){return function(_0x20773f){if(_0x20773f){return _0x20773f[_0xc018('0x3c')](_0x275316)[_0xc018('0x27')](function(_0x1a7d13){return _0x1a7d13;});}return null;};}function removeEntity(_0x1eb8c7,_0x5b04c6){return function(_0x391127){if(_0x391127){return _0x391127[_0xc018('0x3d')]()[_0xc018('0x27')](function(){var _0x41f3af=_0x391127[_0xc018('0x3e')]({'plain':!![]});var _0x199ccc=_0xc018('0x3f');return db[_0xc018('0x40')][_0xc018('0x3d')]({'where':{'type':_0x199ccc,'resourceId':_0x41f3af['id']}})[_0xc018('0x27')](function(){return _0x391127;});})[_0xc018('0x27')](function(){_0x1eb8c7[_0xc018('0x37')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4074d1,_0x2efe0e){return function(_0x33c5df){if(!_0x33c5df){_0x4074d1[_0xc018('0x32')](0x194);}return _0x33c5df;};}function handleError(_0x1b3e09,_0x1c16bb){_0x1c16bb=_0x1c16bb||0x1f4;return function(_0x2493cf){logger[_0xc018('0x2d')](_0x2493cf[_0xc018('0x41')]);if(_0x2493cf[_0xc018('0x42')]){delete _0x2493cf[_0xc018('0x42')];}_0x1b3e09[_0xc018('0x37')](_0x1c16bb)[_0xc018('0x43')](_0x2493cf);};}exports[_0xc018('0x44')]=function(_0x52465a,_0x5a28ff){var _0x560fd3={'include':[{'model':db[_0xc018('0x45')],'as':'mandatoryDispositionPause'}]},_0x21896b={},_0x581775={'count':0x0,'rows':[]};var _0x15c815=_[_0xc018('0x46')](db[_0xc018('0x47')]['rawAttributes'],function(_0x187282){return{'name':_0x187282[_0xc018('0x48')],'type':_0x187282['type'][_0xc018('0x49')]};});_0x21896b['model']=_[_0xc018('0x46')](_0x15c815,_0xc018('0x42'));_0x21896b[_0xc018('0x4a')]=_[_0xc018('0x4b')](_0x52465a[_0xc018('0x4a')]);_0x21896b[_0xc018('0x4c')]=_[_0xc018('0x4d')](_0x21896b[_0xc018('0x4e')],_0x21896b['query']);_0x560fd3['attributes']=_[_0xc018('0x4d')](_0x21896b[_0xc018('0x4e')],qs[_0xc018('0x4f')](_0x52465a['query'][_0xc018('0x4f')]));_0x560fd3[_0xc018('0x50')]=_0x560fd3['attributes'][_0xc018('0x51')]?_0x560fd3[_0xc018('0x50')]:_0x21896b[_0xc018('0x4e')];if(!_0x52465a[_0xc018('0x4a')][_0xc018('0x52')](_0xc018('0x53'))){_0x560fd3[_0xc018('0x36')]=qs['limit'](_0x52465a['query'][_0xc018('0x36')]);_0x560fd3[_0xc018('0x35')]=qs['offset'](_0x52465a[_0xc018('0x4a')][_0xc018('0x35')]);}_0x560fd3[_0xc018('0x54')]=qs['sort'](_0x52465a[_0xc018('0x4a')][_0xc018('0x55')]);_0x560fd3['where']=qs[_0xc018('0x4c')](_[_0xc018('0x56')](_0x52465a[_0xc018('0x4a')],_0x21896b[_0xc018('0x4c')]));if(_0x52465a[_0xc018('0x4a')][_0xc018('0x57')]){_0x560fd3['where']=_[_0xc018('0x58')](_0x560fd3[_0xc018('0x59')],{'$or':_[_0xc018('0x46')](_0x15c815,function(_0x16116a){if(_0x16116a['type']!=='VIRTUAL'){var _0x5db5f2={};_0x5db5f2[_0x16116a['name']]={'$like':'%'+_0x52465a['query'][_0xc018('0x57')]+'%'};return _0x5db5f2;}})});}_0x560fd3=_[_0xc018('0x58')]({},_0x560fd3,_0x52465a[_0xc018('0x5a')]);var _0x2428af={'where':_0x560fd3[_0xc018('0x59')]};return db['FaxAccount']['count'](_0x2428af)['then'](function(_0x132dde){_0x581775[_0xc018('0x34')]=_0x132dde;if(_0x52465a[_0xc018('0x4a')][_0xc018('0x5b')]){_0x560fd3[_0xc018('0x5c')]=[{'all':!![]}];}return db['FaxAccount'][_0xc018('0x5d')](_0x560fd3);})[_0xc018('0x27')](function(_0x28532e){_0x581775[_0xc018('0x5e')]=_0x28532e;return _0x581775;})[_0xc018('0x27')](respondWithFilteredResult(_0x5a28ff,_0x560fd3))[_0xc018('0x5f')](handleError(_0x5a28ff,null));};exports[_0xc018('0x60')]=function(_0x45aedb,_0x5c7d79){var _0x4cc6b4={'raw':![],'where':{'id':_0x45aedb[_0xc018('0x61')]['id']},'include':[{'model':db[_0xc018('0x45')],'as':_0xc018('0x62')}]},_0x8063f5={};_0x8063f5['model']=_['keys'](db[_0xc018('0x47')][_0xc018('0x63')]);_0x8063f5[_0xc018('0x4a')]=_[_0xc018('0x4b')](_0x45aedb['query']);_0x8063f5[_0xc018('0x4c')]=_[_0xc018('0x4d')](_0x8063f5[_0xc018('0x4e')],_0x8063f5[_0xc018('0x4a')]);_0x4cc6b4['attributes']=_[_0xc018('0x4d')](_0x8063f5[_0xc018('0x4e')],qs[_0xc018('0x4f')](_0x45aedb[_0xc018('0x4a')][_0xc018('0x4f')]));_0x4cc6b4[_0xc018('0x50')]=_0x4cc6b4[_0xc018('0x50')][_0xc018('0x51')]?_0x4cc6b4['attributes']:_0x8063f5[_0xc018('0x4e')];if(_0x45aedb['query'][_0xc018('0x5b')]){_0x4cc6b4[_0xc018('0x5c')]=[{'all':!![]}];}_0x4cc6b4=_[_0xc018('0x58')]({},_0x4cc6b4,_0x45aedb[_0xc018('0x5a')]);return db[_0xc018('0x47')][_0xc018('0x64')](_0x4cc6b4)[_0xc018('0x27')](handleEntityNotFound(_0x5c7d79,null))[_0xc018('0x27')](respondWithResult(_0x5c7d79,null))['catch'](handleError(_0x5c7d79,null));};exports[_0xc018('0x65')]=function(_0x3308c3,_0x390e9b){return db['FaxAccount']['create'](_0x3308c3[_0xc018('0x66')],{})[_0xc018('0x27')](function(_0xecec23){var _0xe68edd=_0x3308c3[_0xc018('0x67')][_0xc018('0x3e')]({'plain':!![]});if(!_0xe68edd)throw new Error(_0xc018('0x68'));if(_0xe68edd['role']===_0xc018('0x67')){var _0x4ec693=_0xecec23[_0xc018('0x3e')]({'plain':!![]});var _0x286546=_0xc018('0x3f');return db[_0xc018('0x69')][_0xc018('0x64')]({'where':{'name':_0x286546,'userProfileId':_0xe68edd[_0xc018('0x6a')]},'raw':!![]})[_0xc018('0x27')](function(_0x37ef6a){if(_0x37ef6a&&_0x37ef6a[_0xc018('0x6b')]===0x0){return db[_0xc018('0x40')]['create']({'name':_0x4ec693['name'],'resourceId':_0x4ec693['id'],'type':_0x37ef6a['name'],'sectionId':_0x37ef6a['id']},{})[_0xc018('0x27')](function(){return _0xecec23;});}else{return _0xecec23;}})[_0xc018('0x5f')](function(_0x399516){logger[_0xc018('0x2d')](_0xc018('0x6c'),_0x399516);throw _0x399516;});}return _0xecec23;})[_0xc018('0x27')](respondWithResult(_0x390e9b,0xc9))[_0xc018('0x5f')](handleError(_0x390e9b,null));};exports[_0xc018('0x3c')]=function(_0x3f4d21,_0x1f14a9){if(_0x3f4d21[_0xc018('0x66')]['id']){delete _0x3f4d21[_0xc018('0x66')]['id'];}return db[_0xc018('0x47')][_0xc018('0x64')]({'where':{'id':_0x3f4d21[_0xc018('0x61')]['id']},'include':[{'model':db[_0xc018('0x45')],'as':'mandatoryDispositionPause'}]})[_0xc018('0x27')](handleEntityNotFound(_0x1f14a9,null))[_0xc018('0x27')](saveUpdates(_0x3f4d21[_0xc018('0x66')],null))[_0xc018('0x27')](respondWithResult(_0x1f14a9,null))[_0xc018('0x5f')](handleError(_0x1f14a9,null));};exports[_0xc018('0x3d')]=function(_0x2c4009,_0x5567a5){return db[_0xc018('0x47')][_0xc018('0x64')]({'where':{'id':_0x2c4009[_0xc018('0x61')]['id']}})[_0xc018('0x27')](handleEntityNotFound(_0x5567a5,null))[_0xc018('0x27')](removeEntity(_0x5567a5,null))[_0xc018('0x5f')](handleError(_0x5567a5,null));};exports['describe']=function(_0x202428,_0x49f4eb){return db[_0xc018('0x47')]['describe']()['then'](respondWithResult(_0x49f4eb,null))[_0xc018('0x5f')](handleError(_0x49f4eb,null));};exports['addDisposition']=function(_0x1e4023,_0x4b4c9f,_0x173c03){if(_0x1e4023[_0xc018('0x66')]['id']){delete _0x1e4023[_0xc018('0x66')]['id'];}return db[_0xc018('0x47')][_0xc018('0x64')]({'where':{'id':_0x1e4023['params']['id']}})['then'](handleEntityNotFound(_0x4b4c9f,null))[_0xc018('0x27')](function(_0x23d190){if(_0x23d190){_0x1e4023[_0xc018('0x66')][_0xc018('0x6d')]=_0x23d190['id'];return db[_0xc018('0x6e')]['create'](_0x1e4023['body']);}})[_0xc018('0x27')](respondWithResult(_0x4b4c9f,null))['catch'](handleError(_0x4b4c9f,null));};exports[_0xc018('0x6f')]=function(_0x4d222e,_0x3a0310,_0x573471){var _0x46461c={'raw':![],'where':{}};var _0x23d840={};var _0x4d3e1f={'count':0x0,'rows':[]};return db['FaxAccount'][_0xc018('0x70')]({'where':{'id':_0x4d222e['params']['id']}})[_0xc018('0x27')](handleEntityNotFound(_0x3a0310,null))[_0xc018('0x27')](function(_0x366400){if(_0x366400){_0x23d840[_0xc018('0x4e')]=_['keys'](db['Disposition'][_0xc018('0x63')]);_0x23d840['query']=_[_0xc018('0x4b')](_0x4d222e['query']);_0x23d840['filters']=_[_0xc018('0x4d')](_0x23d840[_0xc018('0x4e')],_0x23d840[_0xc018('0x4a')]);_0x46461c[_0xc018('0x50')]=_['intersection'](_0x23d840[_0xc018('0x4e')],qs[_0xc018('0x4f')](_0x4d222e[_0xc018('0x4a')][_0xc018('0x4f')]));_0x46461c[_0xc018('0x50')]=_0x46461c['attributes'][_0xc018('0x51')]?_0x46461c[_0xc018('0x50')]:_0x23d840[_0xc018('0x4e')];if(!_0x4d222e['query'][_0xc018('0x52')](_0xc018('0x53'))){_0x46461c[_0xc018('0x36')]=qs['limit'](_0x4d222e[_0xc018('0x4a')][_0xc018('0x36')]);_0x46461c[_0xc018('0x35')]=qs[_0xc018('0x35')](_0x4d222e[_0xc018('0x4a')][_0xc018('0x35')]);}_0x46461c[_0xc018('0x54')]=qs[_0xc018('0x55')](_0x4d222e[_0xc018('0x4a')][_0xc018('0x55')]);_0x46461c['where']=qs[_0xc018('0x4c')](_[_0xc018('0x56')](_0x4d222e['query'],_0x23d840[_0xc018('0x4c')]));_0x46461c[_0xc018('0x59')][_0xc018('0x6d')]=_0x366400['id'];if(_0x4d222e[_0xc018('0x4a')][_0xc018('0x57')]){_0x46461c[_0xc018('0x59')]=_[_0xc018('0x58')](_0x46461c[_0xc018('0x59')],{'$or':_['map'](_0x46461c[_0xc018('0x50')],function(_0x3e82b3){var _0x261776={};_0x261776[_0x3e82b3]={'$like':'%'+_0x4d222e[_0xc018('0x4a')][_0xc018('0x57')]+'%'};return _0x261776;})});}_0x46461c=_[_0xc018('0x58')]({},_0x46461c,_0x4d222e['options']);return db[_0xc018('0x6e')][_0xc018('0x34')]({'where':_0x46461c[_0xc018('0x59')]})[_0xc018('0x27')](function(_0x2e4a5f){_0x4d3e1f[_0xc018('0x34')]=_0x2e4a5f;if(_0x4d222e[_0xc018('0x4a')]['includeAll']){_0x46461c[_0xc018('0x5c')]=[{'all':!![]}];}return db[_0xc018('0x6e')]['findAll'](_0x46461c);})['then'](function(_0x4bd741){_0x4d3e1f['rows']=_0x4bd741;return _0x4d3e1f;});}})[_0xc018('0x27')](respondWithFilteredResult(_0x3a0310,_0x46461c))[_0xc018('0x5f')](handleError(_0x3a0310,null));};exports[_0xc018('0x71')]=function(_0x12266b,_0x51fbc5,_0x56f032){return db[_0xc018('0x47')]['find']({'where':{'id':_0x12266b['params']['id']}})[_0xc018('0x27')](handleEntityNotFound(_0x51fbc5,null))[_0xc018('0x27')](function(_0x4a17e7){if(_0x4a17e7){return _0x4a17e7[_0xc018('0x71')](_0x12266b[_0xc018('0x4a')]['ids']);}})['then'](respondWithStatusCode(_0x51fbc5,null))[_0xc018('0x5f')](handleError(_0x51fbc5,null));};exports[_0xc018('0x72')]=function(_0x44d43f,_0x1b9919,_0x517b6f){if(_0x44d43f['body']['id']){delete _0x44d43f[_0xc018('0x66')]['id'];}return db[_0xc018('0x47')]['find']({'where':{'id':_0x44d43f['params']['id']}})[_0xc018('0x27')](handleEntityNotFound(_0x1b9919,null))['then'](function(_0x5c8ce2){if(_0x5c8ce2){_0x44d43f[_0xc018('0x66')][_0xc018('0x6d')]=_0x5c8ce2['id'];return db[_0xc018('0x73')][_0xc018('0x65')](_0x44d43f['body']);}})['then'](respondWithResult(_0x1b9919,null))[_0xc018('0x5f')](handleError(_0x1b9919,null));};exports['getAnswers']=function(_0x5d41ea,_0x2241a0,_0x238114){var _0x5e8c6a={'raw':![],'where':{}};var _0x28dc84={};var _0x5a65d9={'count':0x0,'rows':[]};return db[_0xc018('0x47')]['findOne']({'where':{'id':_0x5d41ea[_0xc018('0x61')]['id']}})[_0xc018('0x27')](handleEntityNotFound(_0x2241a0,null))[_0xc018('0x27')](function(_0x1d2e8f){if(_0x1d2e8f){_0x28dc84[_0xc018('0x4e')]=_[_0xc018('0x4b')](db['CannedAnswer'][_0xc018('0x63')]);_0x28dc84[_0xc018('0x4a')]=_[_0xc018('0x4b')](_0x5d41ea['query']);_0x28dc84[_0xc018('0x4c')]=_[_0xc018('0x4d')](_0x28dc84[_0xc018('0x4e')],_0x28dc84[_0xc018('0x4a')]);_0x5e8c6a['attributes']=_[_0xc018('0x4d')](_0x28dc84[_0xc018('0x4e')],qs[_0xc018('0x4f')](_0x5d41ea[_0xc018('0x4a')][_0xc018('0x4f')]));_0x5e8c6a[_0xc018('0x50')]=_0x5e8c6a['attributes'][_0xc018('0x51')]?_0x5e8c6a[_0xc018('0x50')]:_0x28dc84[_0xc018('0x4e')];if(!_0x5d41ea['query'][_0xc018('0x52')](_0xc018('0x53'))){_0x5e8c6a[_0xc018('0x36')]=qs[_0xc018('0x36')](_0x5d41ea[_0xc018('0x4a')][_0xc018('0x36')]);_0x5e8c6a[_0xc018('0x35')]=qs[_0xc018('0x35')](_0x5d41ea['query'][_0xc018('0x35')]);}_0x5e8c6a[_0xc018('0x54')]=qs[_0xc018('0x55')](_0x5d41ea['query'][_0xc018('0x55')]);_0x5e8c6a[_0xc018('0x59')]=qs[_0xc018('0x4c')](_['pick'](_0x5d41ea[_0xc018('0x4a')],_0x28dc84[_0xc018('0x4c')]));_0x5e8c6a[_0xc018('0x59')][_0xc018('0x6d')]=_0x1d2e8f['id'];if(_0x5d41ea[_0xc018('0x4a')]['filter']){_0x5e8c6a['where']=_[_0xc018('0x58')](_0x5e8c6a[_0xc018('0x59')],{'$or':_[_0xc018('0x46')](_0x5e8c6a['attributes'],function(_0x5f2bf7){var _0x580355={};_0x580355[_0x5f2bf7]={'$like':'%'+_0x5d41ea[_0xc018('0x4a')][_0xc018('0x57')]+'%'};return _0x580355;})});}_0x5e8c6a=_[_0xc018('0x58')]({},_0x5e8c6a,_0x5d41ea[_0xc018('0x5a')]);return db['CannedAnswer']['count']({'where':_0x5e8c6a[_0xc018('0x59')]})[_0xc018('0x27')](function(_0x1a6b40){_0x5a65d9['count']=_0x1a6b40;if(_0x5d41ea[_0xc018('0x4a')]['includeAll']){_0x5e8c6a[_0xc018('0x5c')]=[{'all':!![]}];}return db[_0xc018('0x73')][_0xc018('0x5d')](_0x5e8c6a);})[_0xc018('0x27')](function(_0x65c8e9){_0x5a65d9[_0xc018('0x5e')]=_0x65c8e9;return _0x5a65d9;});}})['then'](respondWithFilteredResult(_0x2241a0,_0x5e8c6a))[_0xc018('0x5f')](handleError(_0x2241a0,null));};exports[_0xc018('0x74')]=function(_0x15dd12,_0x3eed82,_0x5c564e){return db[_0xc018('0x47')]['find']({'where':{'id':_0x15dd12[_0xc018('0x61')]['id']}})['then'](handleEntityNotFound(_0x3eed82,null))[_0xc018('0x27')](function(_0x30fa76){if(_0x30fa76){return _0x30fa76[_0xc018('0x74')](_0x15dd12[_0xc018('0x4a')][_0xc018('0x75')]);}})[_0xc018('0x27')](respondWithStatusCode(_0x3eed82,null))[_0xc018('0x5f')](handleError(_0x3eed82,null));};exports[_0xc018('0x76')]=function(_0x316121,_0x28f9e6,_0x17f9b3){return db['FaxInteraction']['find']({'where':{'id':_0x316121[_0xc018('0x61')]['id']}})[_0xc018('0x27')](handleEntityNotFound(_0x28f9e6,null))[_0xc018('0x27')](function(_0x1f3e1a){if(_0x1f3e1a){return _0x1f3e1a[_0xc018('0x76')](_0x316121['body'][_0xc018('0x75')],_[_0xc018('0x77')](_0x316121[_0xc018('0x66')],[_0xc018('0x75'),'id'])||{});}})[_0xc018('0x27')](respondWithResult(_0x28f9e6,null))[_0xc018('0x5f')](handleError(_0x28f9e6,null));};exports[_0xc018('0x78')]=function(_0x2859ce,_0x1142b7,_0x567e98){var _0x93be70={'raw':![],'where':{}};var _0x4dd182={};var _0xe9b25f={'count':0x0,'rows':[]};return db['FaxAccount'][_0xc018('0x70')]({'where':{'id':_0x2859ce['params']['id']}})['then'](handleEntityNotFound(_0x1142b7,null))[_0xc018('0x27')](function(_0x77331a){if(_0x77331a){_0x4dd182[_0xc018('0x4e')]=_[_0xc018('0x4b')](db['FaxInteraction'][_0xc018('0x63')]);_0x4dd182[_0xc018('0x4a')]=_[_0xc018('0x4b')](_0x2859ce[_0xc018('0x4a')]);_0x4dd182[_0xc018('0x4c')]=_['intersection'](_0x4dd182[_0xc018('0x4e')],_0x4dd182['query']);_0x93be70[_0xc018('0x50')]=_[_0xc018('0x4d')](_0x4dd182['model'],qs[_0xc018('0x4f')](_0x2859ce[_0xc018('0x4a')]['fields']));_0x93be70[_0xc018('0x50')]=_0x93be70[_0xc018('0x50')]['length']?_0x93be70['attributes']:_0x4dd182['model'];if(!_0x2859ce[_0xc018('0x4a')][_0xc018('0x52')](_0xc018('0x53'))){_0x93be70[_0xc018('0x36')]=qs[_0xc018('0x36')](_0x2859ce[_0xc018('0x4a')][_0xc018('0x36')]);_0x93be70['offset']=qs['offset'](_0x2859ce['query'][_0xc018('0x35')]);}_0x93be70[_0xc018('0x54')]=qs['sort'](_0x2859ce['query'][_0xc018('0x55')]);_0x93be70[_0xc018('0x59')]=qs[_0xc018('0x4c')](_[_0xc018('0x56')](_0x2859ce[_0xc018('0x4a')],_0x4dd182[_0xc018('0x4c')]));_0x93be70[_0xc018('0x59')][_0xc018('0x6d')]=_0x77331a['id'];if(_0x2859ce[_0xc018('0x4a')][_0xc018('0x57')]){_0x93be70[_0xc018('0x59')]=_[_0xc018('0x58')](_0x93be70[_0xc018('0x59')],{'$or':_[_0xc018('0x46')](_0x93be70[_0xc018('0x50')],function(_0x58d632){var _0x26664d={};_0x26664d[_0x58d632]={'$like':'%'+_0x2859ce['query']['filter']+'%'};return _0x26664d;})});}_0x93be70=_[_0xc018('0x58')]({},_0x93be70,_0x2859ce['options']);return db[_0xc018('0x79')][_0xc018('0x34')]({'where':_0x93be70['where']})[_0xc018('0x27')](function(_0x23900a){_0xe9b25f['count']=_0x23900a;if(_0x2859ce[_0xc018('0x4a')][_0xc018('0x5b')]){_0x93be70[_0xc018('0x5c')]=[{'model':db[_0xc018('0x7a')],'as':_0xc018('0x7b'),'required':![]},{'model':db[_0xc018('0x7c')],'as':_0xc018('0x7d'),'attributes':[_0xc018('0x42'),_0xc018('0x7e'),_0xc018('0x7f')],'required':![]},{'model':db[_0xc018('0x80')],'as':_0xc018('0x81'),'attributes':['id','name','color'],'where':_0x2859ce[_0xc018('0x4a')][_0xc018('0x82')]?{'id':_0x2859ce['query'][_0xc018('0x82')]}:undefined,'required':_0x2859ce['query'][_0xc018('0x82')]?!![]:![]}];}return db[_0xc018('0x79')][_0xc018('0x5d')](_0x93be70);})['then'](function(_0x389222){_0xe9b25f[_0xc018('0x5e')]=_0x389222;return _0xe9b25f;});}})[_0xc018('0x27')](respondWithFilteredResult(_0x1142b7,_0x93be70))[_0xc018('0x5f')](handleError(_0x1142b7,null));};exports['addApplications']=function(_0x1018ae,_0x29d920,_0x409a38){return db[_0xc018('0x47')]['findOne']({'where':{'id':_0x1018ae[_0xc018('0x61')]['id']}})[_0xc018('0x27')](handleEntityNotFound(_0x29d920,null))[_0xc018('0x27')](function(_0x51109e){if(_0x51109e){return db[_0xc018('0x83')][_0xc018('0x84')](function(_0x20e240){return db['FaxApplication'][_0xc018('0x3d')]({'where':{'FaxAccountId':_0x1018ae[_0xc018('0x61')]['id']},'transaction':_0x20e240})['then'](function(_0x90724b){var _0x183bd3=_[_0xc018('0x46')](_0x1018ae['body'],function(_0x2e2ff4){_0x2e2ff4[_0xc018('0x6d')]=_0x1018ae[_0xc018('0x61')]['id'];return _0x2e2ff4;});return db[_0xc018('0x85')]['bulkCreate'](_0x183bd3,{'transaction':_0x20e240});});})[_0xc018('0x27')](function(){return db[_0xc018('0x85')]['findAndCountAll']({'where':{'FaxAccountId':_0x1018ae['params']['id']},'order':_0xc018('0x86')});});}})[_0xc018('0x27')](respondWithResult(_0x29d920,null))['catch'](handleError(_0x29d920,null));};exports[_0xc018('0x87')]=function(_0xed28b5,_0x1707fc,_0x13e7bb){var _0x318667={};var _0x3df27f={};var _0x259e5b;var _0x582a93;return db[_0xc018('0x47')][_0xc018('0x70')]({'where':{'id':_0xed28b5[_0xc018('0x61')]['id']}})[_0xc018('0x27')](handleEntityNotFound(_0x1707fc,null))[_0xc018('0x27')](function(_0x35a1e0){if(_0x35a1e0){_0x259e5b=_0x35a1e0;_0x3df27f['model']=_['keys'](db['FaxApplication'][_0xc018('0x63')]);_0x3df27f[_0xc018('0x4a')]=_[_0xc018('0x4b')](_0xed28b5[_0xc018('0x4a')]);_0x3df27f[_0xc018('0x4c')]=_[_0xc018('0x4d')](_0x3df27f[_0xc018('0x4e')],_0x3df27f['query']);_0x318667[_0xc018('0x50')]=_[_0xc018('0x4d')](_0x3df27f[_0xc018('0x4e')],qs[_0xc018('0x4f')](_0xed28b5[_0xc018('0x4a')][_0xc018('0x4f')]));_0x318667[_0xc018('0x50')]=_0x318667[_0xc018('0x50')][_0xc018('0x51')]?_0x318667['attributes']:_0x3df27f['model'];_0x318667[_0xc018('0x54')]=qs[_0xc018('0x55')](_0xed28b5[_0xc018('0x4a')][_0xc018('0x55')]);_0x318667[_0xc018('0x59')]=qs[_0xc018('0x4c')](_[_0xc018('0x56')](_0xed28b5[_0xc018('0x4a')],_0x3df27f[_0xc018('0x4c')]));if(_0xed28b5[_0xc018('0x4a')][_0xc018('0x57')]){_0x318667[_0xc018('0x59')]=_[_0xc018('0x58')](_0x318667[_0xc018('0x59')],{'$or':_[_0xc018('0x46')](_0x318667[_0xc018('0x50')],function(_0x2d2748){var _0x5d74ef={};_0x5d74ef[_0x2d2748]={'$like':'%'+_0xed28b5['query'][_0xc018('0x57')]+'%'};return _0x5d74ef;})});}_0x318667=_['merge']({},_0x318667,_0xed28b5[_0xc018('0x5a')]);return _0x259e5b['getApplications'](_0x318667);}})[_0xc018('0x27')](function(_0x596632){if(_0x596632){_0x582a93=_0x596632[_0xc018('0x51')];if(!_0xed28b5[_0xc018('0x4a')]['hasOwnProperty']('nolimit')){_0x318667[_0xc018('0x36')]=qs['limit'](_0xed28b5[_0xc018('0x4a')][_0xc018('0x36')]);_0x318667[_0xc018('0x35')]=qs[_0xc018('0x35')](_0xed28b5['query'][_0xc018('0x35')]);}return _0x259e5b[_0xc018('0x87')](_0x318667);}})[_0xc018('0x27')](function(_0x194bc5){if(_0x194bc5){return _0x194bc5?{'count':_0x582a93,'rows':_0x194bc5}:null;}})['then'](respondWithResult(_0x1707fc,null))[_0xc018('0x5f')](handleError(_0x1707fc,null));};function Extension(_0x478fd7,_0x3a1df7,_0x77751b,_0x25bd64){this[_0xc018('0x88')]=_0xc018('0x89');this['exten']=_0x478fd7['localstationid'];this[_0xc018('0x8a')]=_0x25bd64;this[_0xc018('0x8b')]='system';this[_0xc018('0x8c')]=_0xc018('0x8d');this[_0xc018('0x6d')]=_0x478fd7['id'];this['priority']=_0x3a1df7;this[_0xc018('0x8e')]=_0x77751b;}function createExtensionsReciveFax(_0x3e6ce0){var _0x4ddfe8=0x1;var _0x5ca55a=[];_0x5ca55a[_0xc018('0x8f')](new Extension(_0x3e6ce0,_0x4ddfe8,'','Answer'));_0x4ddfe8+=0x1;_0x5ca55a[_0xc018('0x8f')](new Extension(_0x3e6ce0,_0x4ddfe8,_0xc018('0x90'),_0xc018('0x91')));_0x4ddfe8+=0x1;for(var _0x2bbb33 in _0x3e6ce0){if(_0x3e6ce0[_0xc018('0x52')](_0x2bbb33)&&(_0x2bbb33===_0xc018('0x92')||_0x2bbb33===_0xc018('0x93')||_0x2bbb33===_0xc018('0x94')||_0x2bbb33===_0xc018('0x95')||_0x2bbb33===_0xc018('0x96')||_0x2bbb33===_0xc018('0x97')||_0x2bbb33===_0xc018('0x98')||_0x2bbb33===_0xc018('0x99')||_0x2bbb33===_0xc018('0x9a'))){_0x5ca55a[_0xc018('0x8f')](new Extension(_0x3e6ce0,_0x4ddfe8,'FAXOPT('+_0x2bbb33+')='+_0x3e6ce0[_0x2bbb33],_0xc018('0x91')));_0x4ddfe8+=0x1;}}_0x5ca55a['push'](new Extension(_0x3e6ce0,_0x4ddfe8,'6','Wait'));_0x4ddfe8+=0x1;_0x5ca55a[_0xc018('0x8f')](new Extension(_0x3e6ce0,_0x4ddfe8,_0xc018('0x9b'),_0xc018('0x9c')));_0x4ddfe8=0x0;return _0x5ca55a;}exports['addAccountApplications']=function(_0x38708c,_0x2052a5,_0xdf5edc){var _0x281415;return db[_0xc018('0x83')][_0xc018('0x84')](function(_0x1066d0){return db[_0xc018('0x47')][_0xc018('0x65')](_0x38708c['body'],{'transaction':_0x1066d0})['then'](function(_0x2da233){_0x281415=_0x2da233[_0xc018('0x3e')]({'plain':!![]});return db[_0xc018('0x9d')][_0xc018('0x9e')](createExtensionsReciveFax(_0x281415),{'transaction':_0x1066d0});});})[_0xc018('0x27')](function(){return _0x281415;})['then'](respondWithResult(_0x2052a5,null))[_0xc018('0x5f')](handleError(_0x2052a5,null));};exports[_0xc018('0x9f')]=function(_0xf0fb62,_0x4885ab,_0x1d9db6){var _0x1f0269;return db['sequelize'][_0xc018('0x84')](function(_0x2af374){return db[_0xc018('0x47')][_0xc018('0x3c')](_0xf0fb62[_0xc018('0x66')],{'where':{'id':_0xf0fb62[_0xc018('0x66')]['id']},'transaction':_0x2af374})[_0xc018('0x27')](function(_0x389cc1){return db[_0xc018('0x9d')][_0xc018('0x3d')]({'where':{'FaxAccountId':_0xf0fb62[_0xc018('0x66')]['id']},'transaction':_0x2af374})[_0xc018('0x27')](function(_0x2d1d0d){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0xc018('0x77')](_0xf0fb62[_0xc018('0x66')],['tech',_0xc018('0x49'),'createdAt',_0xc018('0xa0'),_0xc018('0xa1'),_0xc018('0xa2')])),{'transaction':_0x2af374});});});})[_0xc018('0x27')](function(){return db[_0xc018('0x47')][_0xc018('0xa3')](_0xf0fb62[_0xc018('0x66')]['id']);})[_0xc018('0x27')](respondWithResult(_0x4885ab,null))['catch'](handleError(_0x4885ab,null));};exports[_0xc018('0xa4')]=function(_0x346a94,_0x2b05d2,_0x5dbcee){var _0x4021da={'raw':!![],'where':{}};var _0x26f83f={};var _0x2098f5={'count':0x0,'rows':[]};return db[_0xc018('0x47')][_0xc018('0x70')]({'where':{'id':_0x346a94['params']['id']}})[_0xc018('0x27')](handleEntityNotFound(_0x2b05d2,null))['then'](function(_0x1e4b93){if(_0x1e4b93){_0x26f83f['model']=_[_0xc018('0x4b')](db[_0xc018('0xa5')][_0xc018('0x63')]);_0x26f83f[_0xc018('0x4a')]=_[_0xc018('0x4b')](_0x346a94[_0xc018('0x4a')]);_0x26f83f[_0xc018('0x4c')]=_[_0xc018('0x4d')](_0x26f83f['model'],_0x26f83f['query']);_0x4021da[_0xc018('0x50')]=_[_0xc018('0x4d')](_0x26f83f[_0xc018('0x4e')],qs[_0xc018('0x4f')](_0x346a94[_0xc018('0x4a')][_0xc018('0x4f')]));_0x4021da[_0xc018('0x50')]=_0x4021da[_0xc018('0x50')][_0xc018('0x51')]?_0x4021da['attributes']:_0x26f83f[_0xc018('0x4e')];if(!_0x346a94[_0xc018('0x4a')]['hasOwnProperty'](_0xc018('0x53'))){_0x4021da[_0xc018('0x36')]=qs[_0xc018('0x36')](_0x346a94['query'][_0xc018('0x36')]);_0x4021da[_0xc018('0x35')]=qs[_0xc018('0x35')](_0x346a94[_0xc018('0x4a')][_0xc018('0x35')]);}_0x4021da['order']=qs[_0xc018('0x55')](_0x346a94[_0xc018('0x4a')][_0xc018('0x55')]);_0x4021da['where']=qs['filters'](_[_0xc018('0x56')](_0x346a94[_0xc018('0x4a')],_0x26f83f[_0xc018('0x4c')]));_0x4021da[_0xc018('0x59')][_0xc018('0x6d')]=_0x1e4b93['id'];if(_0x346a94[_0xc018('0x4a')][_0xc018('0x57')]){_0x4021da[_0xc018('0x59')]=_[_0xc018('0x58')](_0x4021da[_0xc018('0x59')],{'$or':_[_0xc018('0x46')](_0x4021da[_0xc018('0x50')],function(_0x270e60){var _0x2e2b85={};_0x2e2b85[_0x270e60]={'$like':'%'+_0x346a94[_0xc018('0x4a')][_0xc018('0x57')]+'%'};return _0x2e2b85;})});}if(_0x346a94['query'][_0xc018('0xa6')]){var _0x5580bd=_0x346a94[_0xc018('0x4a')][_0xc018('0xa6')][_0xc018('0xa7')](',');var _0x5a8c05={};_0x5a8c05[_0x5580bd[0x0]]={'$gte':moment(_0x5580bd[0x1])[_0xc018('0xa8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4021da[_0xc018('0x59')]=_['merge'](_0x4021da[_0xc018('0x59')],_0x5a8c05);}_0x4021da=_['merge']({},_0x4021da,_0x346a94[_0xc018('0x5a')]);return db[_0xc018('0xa5')][_0xc018('0x34')]({'where':_0x4021da[_0xc018('0x59')]})[_0xc018('0x27')](function(_0x41d1a2){_0x2098f5[_0xc018('0x34')]=_0x41d1a2;if(_0x346a94[_0xc018('0x4a')]['includeAll']){_0x4021da['include']=[{'all':!![]}];}return db[_0xc018('0xa5')][_0xc018('0x5d')](_0x4021da);})[_0xc018('0x27')](function(_0x4b6a98){_0x2098f5['rows']=_0x4b6a98;return _0x2098f5;});}})[_0xc018('0x27')](respondWithFilteredResult(_0x2b05d2,_0x4021da))[_0xc018('0x5f')](handleError(_0x2b05d2,null));};exports['send']=function(_0x1b6126,_0x2cd2ea,_0x4c9363){var _0x21a425,_0x11c9c3={},_0xde3d79;if(_0x1b6126[_0xc018('0x66')]['to']){_0xde3d79=_0x1b6126['body']['to'][0x0];}return db['FaxAccount'][_0xc018('0x64')]({'where':{'id':_0x1b6126[_0xc018('0x61')]['id']},'include':[{'model':db['CmList'],'as':_0xc018('0xa9'),'include':[{'model':db[_0xc018('0x7a')],'as':_0xc018('0xaa'),'where':{'fax':_0xde3d79},'limit':0x1,'order':[[_0xc018('0xa0'),_0xc018('0xab')]]}]}]})[_0xc018('0x27')](handleEntityNotFound(_0x2cd2ea,null))['then'](function(_0x432d82){_0x21a425=_0x432d82;if(_0x1b6126[_0xc018('0x66')][_0xc018('0xac')]&&_0x1b6126[_0xc018('0x66')][_0xc018('0xac')][_0xc018('0x51')]){for(var _0x295777=0x0;_0x295777<_0x1b6126[_0xc018('0x66')]['attachments'][_0xc018('0x51')];_0x295777+=0x1){_0x1b6126[_0xc018('0x66')][_0xc018('0xac')][_0x295777]={'filename':_0x1b6126[_0xc018('0x66')][_0xc018('0xac')][_0x295777]['name'],'id':_0x1b6126[_0xc018('0x66')][_0xc018('0xac')][_0x295777]['id'],'path':path[_0xc018('0xad')](config[_0xc018('0xae')],_0xc018('0xaf'),_0x1b6126['body'][_0xc018('0xac')][_0x295777][_0xc018('0xb0')])};}}return respondWithRpcPromise(_0xc018('0xb1'),_0xc018('0xb1'),{'FaxAccountId':_['isNil'](_0x1b6126[_0xc018('0x61')]['id'])?undefined:_0x1b6126[_0xc018('0x61')]['id'],'path':_[_0xc018('0xb2')](_0x1b6126['body'][_0xc018('0xac')][0x0][_0xc018('0x7')])?undefined:_0x1b6126[_0xc018('0x66')][_0xc018('0xac')][0x0][_0xc018('0x7')],'fax':_[_0xc018('0xb2')](_0x1b6126[_0xc018('0x66')]['to'][0x0])?undefined:_0x1b6126['body']['to'][0x0]},client9002);})[_0xc018('0x27')](function(){if(_0x21a425){if(_[_0xc018('0xb2')](_0x1b6126[_0xc018('0x66')]['from'])){_0x1b6126[_0xc018('0x66')]['from']=util[_0xc018('0xa8')](_0xc018('0xb3'),_0x21a425[_0xc018('0x42')],_0x21a425['fax']);}if(_0x21a425[_0xc018('0xa9')]){if(_0x21a425[_0xc018('0xa9')][_0xc018('0xaa')][_0xc018('0x51')]){return _0x21a425[_0xc018('0xa9')][_0xc018('0xaa')][0x0];}else{return db['CmContact'][_0xc018('0x65')](_['defaults'](_0x1b6126['body'],{'firstName':_0x1b6126[_0xc018('0x66')]['to'][0x0],'phone':_0x1b6126['body']['to'][0x0],'fax':_0x1b6126[_0xc018('0x66')]['to'][0x0],'ListId':_0x21a425['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xc018('0xb4'));}})[_0xc018('0x27')](function(_0x98d226){if(_0x98d226){return db['FaxInteraction'][_0xc018('0x64')]({'where':{'ContactId':_0x98d226['id'],'closed':![],'FaxAccountId':_0x21a425['id']}})[_0xc018('0x27')](function(_0x496cb9){if(_0x496cb9){return[_0x496cb9,![]];}return db[_0xc018('0x79')]['create']({'UserId':_0x1b6126['user']['id'],'ContactId':_0x98d226['id'],'FaxAccountId':_0x21a425['id'],'fax':_0x1b6126[_0xc018('0x66')]['to'][0x0],'firstMsgDirection':_0xc018('0xb5'),'Messages':[_[_0xc018('0x58')](_0x1b6126[_0xc018('0x66')],{'read':![],'body':_0x1b6126[_0xc018('0x66')][_0xc018('0xac')][0x0][_0xc018('0xb6')],'FaxAccountId':_0x21a425['id'],'UserId':_0x1b6126[_0xc018('0x67')]['id'],'ContactId':_0x98d226['id'],'AttachmentId':_0x1b6126['body'][_0xc018('0xac')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0xc018('0x27')](function(_0x3eacf1){return[_0x3eacf1,!![]];});});}else{throw new Error(_0xc018('0xb7'));}})[_0xc018('0xb8')](function(_0x30bb45,_0x57747f){if(_0x57747f){return _0x30bb45;}return db[_0xc018('0xa5')][_0xc018('0x65')]({'direction':_0xc018('0xb5'),'read':![],'body':_0x1b6126[_0xc018('0x66')][_0xc018('0xac')][0x0][_0xc018('0xb6')],'FaxAccountId':_0x21a425['id'],'FaxInteractionId':_0x30bb45['id'],'UserId':_0x1b6126['user']['id'],'ContactId':_0x30bb45['ContactId'],'AttachmentId':_0x1b6126[_0xc018('0x66')][_0xc018('0xac')][0x0]['id']})[_0xc018('0x27')](function(_0xd3a604){_0x30bb45[_0xc018('0xb9')]['Messages']=[];_0x30bb45[_0xc018('0xb9')]['Messages'][_0xc018('0x8f')](_0xd3a604[_0xc018('0xb9')]);return _0x30bb45;});})[_0xc018('0x27')](function(_0x116af0){respondWithRpcPromise('SendFax',_0xc018('0xba'),{'FaxAccountId':_[_0xc018('0xb2')](_0x1b6126[_0xc018('0x61')]['id'])?undefined:_0x1b6126[_0xc018('0x61')]['id'],'path':_[_0xc018('0xb2')](_0x1b6126[_0xc018('0x66')][_0xc018('0xac')][0x0][_0xc018('0x7')])?undefined:_0x1b6126[_0xc018('0x66')][_0xc018('0xac')][0x0][_0xc018('0x7')],'fax':_[_0xc018('0xb2')](_0x1b6126[_0xc018('0x66')]['to'][0x0])?undefined:_0x1b6126[_0xc018('0x66')]['to'][0x0],'AttachmentId':_0x1b6126[_0xc018('0x66')]['attachments'][0x0]['id']},client9002)['then'](function(_0x5e771a){logger[_0xc018('0x28')](_0xc018('0xbb'),_0x5e771a);})[_0xc018('0x5f')](function(_0xb3ca70){logger[_0xc018('0x28')](_0xc018('0xbb'),_0xb3ca70);});return _0x116af0;})['then'](respondWithResult(_0x2cd2ea,null))['catch'](handleError(_0x2cd2ea,null));};exports['addAgents']=function(_0x3aae36,_0x4bfd6d,_0x442f6f){return db[_0xc018('0x47')][_0xc018('0x64')]({'where':{'id':_0x3aae36[_0xc018('0x61')]['id']}})['then'](handleEntityNotFound(_0x4bfd6d,null))['then'](function(_0x4bffec){if(_0x4bffec){return _0x4bffec[_0xc018('0xbc')](_0x3aae36[_0xc018('0x66')][_0xc018('0x75')],_[_0xc018('0x77')](_0x3aae36[_0xc018('0x66')],['ids','id'])||{})['spread'](function(_0x4e1476){for(var _0x2b0dbd=0x0;_0x2b0dbd<_0x3aae36[_0xc018('0x66')][_0xc018('0x75')]['length'];_0x2b0dbd+=0x1){socket[_0xc018('0xbd')](_0xc018('0xbe'),{'UserId':_0x3aae36[_0xc018('0x66')][_0xc018('0x75')][_0x2b0dbd],'FaxAccountId':_0x3aae36[_0xc018('0x61')]['id']});}return _0x4e1476;});}})[_0xc018('0x27')](respondWithResult(_0x4bfd6d,null))['catch'](handleError(_0x4bfd6d,null));};exports[_0xc018('0xbf')]=function(_0x431948,_0x5b561d,_0x5fb070){return db[_0xc018('0x47')]['find']({'where':{'id':_0x431948['params']['id']}})['then'](handleEntityNotFound(_0x5b561d,null))[_0xc018('0x27')](function(_0x2610d5){if(_0x2610d5){return _0x2610d5['removeAgents'](_0x431948['query'][_0xc018('0x75')])[_0xc018('0x27')](function(){if(_[_0xc018('0xc0')](_0x431948[_0xc018('0x4a')]['ids'])){for(var _0x15883d=0x0;_0x15883d<_0x431948['query'][_0xc018('0x75')][_0xc018('0x51')];_0x15883d+=0x1){socket[_0xc018('0xbd')](_0xc018('0xc1'),{'UserId':Number(_0x431948['query'][_0xc018('0x75')][_0x15883d]),'FaxAccountId':Number(_0x431948['params']['id'])});}}else{socket[_0xc018('0xbd')](_0xc018('0xc1'),{'UserId':Number(_0x431948['query'][_0xc018('0x75')]),'FaxAccountId':Number(_0x431948[_0xc018('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x5b561d,null))[_0xc018('0x5f')](handleError(_0x5b561d,null));};exports[_0xc018('0xc2')]=function(_0x425212,_0x5b557a,_0x299207){var _0x4de494={};var _0x241d1b={};var _0x5da2b2;var _0x5c2689;return db[_0xc018('0x47')][_0xc018('0x70')]({'where':{'id':_0x425212['params']['id']}})[_0xc018('0x27')](handleEntityNotFound(_0x5b557a,null))[_0xc018('0x27')](function(_0x5d474e){if(_0x5d474e){_0x5da2b2=_0x5d474e;_0x241d1b['model']=_['keys'](db[_0xc018('0x7c')][_0xc018('0x63')]);_0x241d1b[_0xc018('0x4a')]=_[_0xc018('0x4b')](_0x425212[_0xc018('0x4a')]);_0x241d1b[_0xc018('0x4c')]=_['intersection'](_0x241d1b[_0xc018('0x4e')],_0x241d1b['query']);_0x4de494[_0xc018('0x50')]=_[_0xc018('0x4d')](_0x241d1b[_0xc018('0x4e')],qs[_0xc018('0x4f')](_0x425212[_0xc018('0x4a')][_0xc018('0x4f')]));_0x4de494[_0xc018('0x50')]=_0x4de494['attributes'][_0xc018('0x51')]?_0x4de494[_0xc018('0x50')]:_0x241d1b[_0xc018('0x4e')];_0x4de494['order']=qs['sort'](_0x425212[_0xc018('0x4a')][_0xc018('0x55')]);_0x4de494[_0xc018('0x59')]=qs[_0xc018('0x4c')](_[_0xc018('0x56')](_0x425212[_0xc018('0x4a')],_0x241d1b['filters']));if(_0x425212[_0xc018('0x4a')][_0xc018('0x57')]){_0x4de494[_0xc018('0x59')]=_[_0xc018('0x58')](_0x4de494[_0xc018('0x59')],{'$or':_[_0xc018('0x46')](_0x4de494[_0xc018('0x50')],function(_0x10b7f8){var _0x3ce656={};_0x3ce656[_0x10b7f8]={'$like':'%'+_0x425212[_0xc018('0x4a')][_0xc018('0x57')]+'%'};return _0x3ce656;})});}_0x4de494=_[_0xc018('0x58')]({},_0x4de494,_0x425212[_0xc018('0x5a')]);return _0x5da2b2[_0xc018('0xc2')](_0x4de494);}})[_0xc018('0x27')](function(_0x238819){if(_0x238819){_0x5c2689=_0x238819[_0xc018('0x51')];if(!_0x425212['query'][_0xc018('0x52')](_0xc018('0x53'))){_0x4de494[_0xc018('0x36')]=qs[_0xc018('0x36')](_0x425212[_0xc018('0x4a')]['limit']);_0x4de494[_0xc018('0x35')]=qs[_0xc018('0x35')](_0x425212[_0xc018('0x4a')][_0xc018('0x35')]);}return _0x5da2b2[_0xc018('0xc2')](_0x4de494);}})[_0xc018('0x27')](function(_0xa6149c){if(_0xa6149c){return _0xa6149c?{'count':_0x5c2689,'rows':_0xa6149c}:null;}})['then'](respondWithResult(_0x5b557a,null))[_0xc018('0x5f')](handleError(_0x5b557a,null));}; \ No newline at end of file +var _0x9407=['include','findAll','rows','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Pause','FaxAccountId','Disposition','getDispositions','findOne','sort','options','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','localstationid','app','system','description','Fax\x20Extension','push','Answer','Set','gateway','maxrate','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','sequelize','VoiceExtension','tech','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','CmList','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List','Contacts','ListId','List\x20not\x20found','filename','Messages','Contact\x20not\x20found','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','User','html-pdf','eml-format','fast-json-patch','moment','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','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','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','count','offset','limit','status','set','Content-Range','json','apply','reject','save','update','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filters','filter','merge','type','VIRTUAL','includeAll'];(function(_0x4b529d,_0x1aa0d8){var _0x311010=function(_0x2f7b12){while(--_0x2f7b12){_0x4b529d['push'](_0x4b529d['shift']());}};_0x311010(++_0x1aa0d8);}(_0x9407,0x1ec));var _0x7940=function(_0x249226,_0x7a6036){_0x249226=_0x249226-0x0;var _0x2188dc=_0x9407[_0x249226];return _0x2188dc;};'use strict';var pdf=require(_0x7940('0x0'));var emlformat=require(_0x7940('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7940('0x2'));var rp=require('request-promise');var moment=require(_0x7940('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7940('0x4'));var path=require(_0x7940('0x5'));var sox=require(_0x7940('0x6'));var csv=require(_0x7940('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7940('0x8'));var squel=require(_0x7940('0x9'));var crypto=require(_0x7940('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7940('0xb'));var toCsv=require(_0x7940('0x7'));var querystring=require(_0x7940('0xc'));var Papa=require(_0x7940('0xd'));var Redis=require(_0x7940('0xe'));var authService=require(_0x7940('0xf'));var qs=require(_0x7940('0x10'));var as=require(_0x7940('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7940('0x12'));var utils=require(_0x7940('0x13'));var config=require(_0x7940('0x14'));var db=require(_0x7940('0x15'))['db'];config['redis']=_['defaults'](config[_0x7940('0x16')],{'host':_0x7940('0x17'),'port':0x18eb});var socket=require(_0x7940('0x18'))(new Redis(config[_0x7940('0x16')]));require('./faxAccount.socket')[_0x7940('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7940('0x1a')][_0x7940('0x1b')]({'port':0x232c});var client9002=jayson[_0x7940('0x1a')][_0x7940('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x821d6c,_0x8878be,_0x467c71){if(_0x467c71){var _0x3cc3da=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3cc3da[_0x7940('0x1c')](_0x8878be)){return _0x821d6c;}else{throw new db[(_0x7940('0x1d'))][(_0x7940('0x1e'))](_0x7940('0x1f'));}}else{return _0x821d6c;}}function respondWithRpcPromise(_0x26369f,_0x213fa4,_0xa1d3d9,_0xa30fda){return new BPromise(function(_0xfcea0f,_0x2a6b9a){var _0x27de3a=_0xa30fda||client;return _0x27de3a[_0x7940('0x20')](_0x26369f,_0xa1d3d9)[_0x7940('0x21')](function(_0x1466cb){logger[_0x7940('0x22')](_0x7940('0x23'),_0x213fa4,_0x7940('0x24'));logger[_0x7940('0x25')](_0x7940('0x26'),_0x213fa4,'request\x20sent',JSON['stringify'](_0x1466cb));if(_0x1466cb[_0x7940('0x27')]){if(_0x1466cb['error'][_0x7940('0x28')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x213fa4,_0x1466cb[_0x7940('0x27')][_0x7940('0x29')]);return _0x2a6b9a(_0x1466cb[_0x7940('0x27')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x213fa4,_0x1466cb['error'][_0x7940('0x29')]);return _0xfcea0f(_0x1466cb[_0x7940('0x27')]['message']);}else{logger[_0x7940('0x22')](_0x7940('0x23'),_0x213fa4,_0x7940('0x24'));_0xfcea0f(_0x1466cb['result'][_0x7940('0x29')]);}})[_0x7940('0x2a')](function(_0x2ed4e6){logger[_0x7940('0x27')](_0x7940('0x23'),_0x213fa4,_0x2ed4e6);_0x2a6b9a(_0x2ed4e6);});});}function respondWithStatusCode(_0x4a6d1f,_0x3725d8){_0x3725d8=_0x3725d8||0xcc;return function(_0x4364bc){if(_0x4364bc){return _0x4a6d1f[_0x7940('0x2b')](_0x3725d8);}return _0x4a6d1f['status'](_0x3725d8)['end']();};}function respondWithResult(_0x27d2c3,_0x2bb5ac){_0x2bb5ac=_0x2bb5ac||0xc8;return function(_0x5df536){if(_0x5df536){return _0x27d2c3['status'](_0x2bb5ac)['json'](_0x5df536);}};}function respondWithFilteredResult(_0x5ca113,_0x3fc294){return function(_0x53b7f4){if(_0x53b7f4){var _0x4f843d=_0x53b7f4[_0x7940('0x2c')],_0x5205a6=_0x3fc294[_0x7940('0x2d')],_0x5d6ff0=_0x3fc294[_0x7940('0x2d')]+_0x3fc294[_0x7940('0x2e')],_0x48f1d5;if(_0x5d6ff0>=_0x4f843d){_0x5d6ff0=_0x4f843d;_0x48f1d5=0xc8;}else{_0x48f1d5=0xce;}_0x5ca113[_0x7940('0x2f')](_0x48f1d5);return _0x5ca113[_0x7940('0x30')](_0x7940('0x31'),_0x5205a6+'-'+_0x5d6ff0+'/'+_0x4f843d)[_0x7940('0x32')](_0x53b7f4);}return null;};}function patchUpdates(_0x4ea2bd){return function(_0x1048dd){try{jsonpatch[_0x7940('0x33')](_0x1048dd,_0x4ea2bd,!![]);}catch(_0x254be0){return BPromise[_0x7940('0x34')](_0x254be0);}return _0x1048dd[_0x7940('0x35')]();};}function saveUpdates(_0x4d3b3,_0x511616){return function(_0x528f0f){if(_0x528f0f){return _0x528f0f[_0x7940('0x36')](_0x4d3b3)[_0x7940('0x21')](function(_0x274799){return _0x274799;});}return null;};}function removeEntity(_0x31ecd2,_0x11fa57){return function(_0x5695cf){if(_0x5695cf){return _0x5695cf[_0x7940('0x37')]()[_0x7940('0x21')](function(){var _0xa71788=_0x5695cf['get']({'plain':!![]});var _0x5df341=_0x7940('0x38');return db[_0x7940('0x39')][_0x7940('0x37')]({'where':{'type':_0x5df341,'resourceId':_0xa71788['id']}})[_0x7940('0x21')](function(){return _0x5695cf;});})[_0x7940('0x21')](function(){_0x31ecd2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x364fe6,_0x46a93d){return function(_0x501f28){if(!_0x501f28){_0x364fe6[_0x7940('0x2b')](0x194);}return _0x501f28;};}function handleError(_0x16c920,_0x54f7e5){_0x54f7e5=_0x54f7e5||0x1f4;return function(_0x3e4223){logger['error'](_0x3e4223[_0x7940('0x3a')]);if(_0x3e4223[_0x7940('0x3b')]){delete _0x3e4223[_0x7940('0x3b')];}_0x16c920['status'](_0x54f7e5)[_0x7940('0x3c')](_0x3e4223);};}exports[_0x7940('0x3d')]=function(_0x1b550d,_0x387a5b){var _0x26e8a6={'include':[{'model':db['Pause'],'as':_0x7940('0x3e')}]},_0x55e759={},_0x3f5314={'count':0x0,'rows':[]};var _0x30d005=_[_0x7940('0x3f')](db[_0x7940('0x40')][_0x7940('0x41')],function(_0x3339d5){return{'name':_0x3339d5['fieldName'],'type':_0x3339d5['type'][_0x7940('0x42')]};});_0x55e759[_0x7940('0x43')]=_['map'](_0x30d005,'name');_0x55e759['query']=_[_0x7940('0x44')](_0x1b550d[_0x7940('0x45')]);_0x55e759['filters']=_[_0x7940('0x46')](_0x55e759['model'],_0x55e759['query']);_0x26e8a6[_0x7940('0x47')]=_[_0x7940('0x46')](_0x55e759[_0x7940('0x43')],qs['fields'](_0x1b550d[_0x7940('0x45')][_0x7940('0x48')]));_0x26e8a6[_0x7940('0x47')]=_0x26e8a6[_0x7940('0x47')][_0x7940('0x49')]?_0x26e8a6['attributes']:_0x55e759[_0x7940('0x43')];if(!_0x1b550d['query'][_0x7940('0x4a')]('nolimit')){_0x26e8a6[_0x7940('0x2e')]=qs[_0x7940('0x2e')](_0x1b550d['query']['limit']);_0x26e8a6[_0x7940('0x2d')]=qs[_0x7940('0x2d')](_0x1b550d[_0x7940('0x45')][_0x7940('0x2d')]);}_0x26e8a6[_0x7940('0x4b')]=qs['sort'](_0x1b550d[_0x7940('0x45')]['sort']);_0x26e8a6[_0x7940('0x4c')]=qs['filters'](_[_0x7940('0x4d')](_0x1b550d[_0x7940('0x45')],_0x55e759[_0x7940('0x4e')]));if(_0x1b550d[_0x7940('0x45')][_0x7940('0x4f')]){_0x26e8a6[_0x7940('0x4c')]=_[_0x7940('0x50')](_0x26e8a6[_0x7940('0x4c')],{'$or':_['map'](_0x30d005,function(_0x5c1348){if(_0x5c1348[_0x7940('0x51')]!==_0x7940('0x52')){var _0x3e5ca8={};_0x3e5ca8[_0x5c1348[_0x7940('0x3b')]]={'$like':'%'+_0x1b550d[_0x7940('0x45')]['filter']+'%'};return _0x3e5ca8;}})});}_0x26e8a6=_[_0x7940('0x50')]({},_0x26e8a6,_0x1b550d['options']);var _0x587b78={'where':_0x26e8a6[_0x7940('0x4c')]};return db[_0x7940('0x40')][_0x7940('0x2c')](_0x587b78)['then'](function(_0x23423e){_0x3f5314[_0x7940('0x2c')]=_0x23423e;if(_0x1b550d[_0x7940('0x45')][_0x7940('0x53')]){_0x26e8a6[_0x7940('0x54')]=[{'all':!![]}];}return db[_0x7940('0x40')][_0x7940('0x55')](_0x26e8a6);})[_0x7940('0x21')](function(_0x14548a){_0x3f5314[_0x7940('0x56')]=_0x14548a;return _0x3f5314;})[_0x7940('0x21')](respondWithFilteredResult(_0x387a5b,_0x26e8a6))[_0x7940('0x2a')](handleError(_0x387a5b,null));};exports[_0x7940('0x57')]=function(_0x1ce8db,_0x5141c5){var _0x43cdd6={'raw':![],'where':{'id':_0x1ce8db[_0x7940('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x7940('0x3e')}]},_0x311690={};_0x311690[_0x7940('0x43')]=_[_0x7940('0x44')](db[_0x7940('0x40')][_0x7940('0x41')]);_0x311690['query']=_[_0x7940('0x44')](_0x1ce8db['query']);_0x311690[_0x7940('0x4e')]=_['intersection'](_0x311690[_0x7940('0x43')],_0x311690[_0x7940('0x45')]);_0x43cdd6[_0x7940('0x47')]=_[_0x7940('0x46')](_0x311690[_0x7940('0x43')],qs[_0x7940('0x48')](_0x1ce8db['query'][_0x7940('0x48')]));_0x43cdd6['attributes']=_0x43cdd6[_0x7940('0x47')][_0x7940('0x49')]?_0x43cdd6['attributes']:_0x311690[_0x7940('0x43')];if(_0x1ce8db[_0x7940('0x45')][_0x7940('0x53')]){_0x43cdd6[_0x7940('0x54')]=[{'all':!![]}];}_0x43cdd6=_[_0x7940('0x50')]({},_0x43cdd6,_0x1ce8db['options']);return db['FaxAccount'][_0x7940('0x59')](_0x43cdd6)['then'](handleEntityNotFound(_0x5141c5,null))['then'](respondWithResult(_0x5141c5,null))[_0x7940('0x2a')](handleError(_0x5141c5,null));};exports[_0x7940('0x5a')]=function(_0x212885,_0x6c78ec){return db[_0x7940('0x40')][_0x7940('0x5a')](_0x212885[_0x7940('0x5b')],{})[_0x7940('0x21')](function(_0x398599){var _0x510da5=_0x212885[_0x7940('0x5c')][_0x7940('0x5d')]({'plain':!![]});if(!_0x510da5)throw new Error(_0x7940('0x5e'));if(_0x510da5[_0x7940('0x5f')]===_0x7940('0x5c')){var _0x43875f=_0x398599['get']({'plain':!![]});var _0x3aad8e='FaxAccounts';return db[_0x7940('0x60')]['find']({'where':{'name':_0x3aad8e,'userProfileId':_0x510da5[_0x7940('0x61')]},'raw':!![]})[_0x7940('0x21')](function(_0x319e64){if(_0x319e64&&_0x319e64[_0x7940('0x62')]===0x0){return db[_0x7940('0x39')][_0x7940('0x5a')]({'name':_0x43875f[_0x7940('0x3b')],'resourceId':_0x43875f['id'],'type':_0x319e64[_0x7940('0x3b')],'sectionId':_0x319e64['id']},{})[_0x7940('0x21')](function(){return _0x398599;});}else{return _0x398599;}})[_0x7940('0x2a')](function(_0x382e13){logger[_0x7940('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x382e13);throw _0x382e13;});}return _0x398599;})[_0x7940('0x21')](respondWithResult(_0x6c78ec,0xc9))[_0x7940('0x2a')](handleError(_0x6c78ec,null));};exports['update']=function(_0x21844d,_0xb27abb){if(_0x21844d[_0x7940('0x5b')]['id']){delete _0x21844d[_0x7940('0x5b')]['id'];}return db['FaxAccount'][_0x7940('0x59')]({'where':{'id':_0x21844d['params']['id']},'include':[{'model':db[_0x7940('0x63')],'as':_0x7940('0x3e')}]})[_0x7940('0x21')](handleEntityNotFound(_0xb27abb,null))['then'](saveUpdates(_0x21844d[_0x7940('0x5b')],null))[_0x7940('0x21')](respondWithResult(_0xb27abb,null))[_0x7940('0x2a')](handleError(_0xb27abb,null));};exports[_0x7940('0x37')]=function(_0x8a3750,_0x4911a5){return db[_0x7940('0x40')]['find']({'where':{'id':_0x8a3750[_0x7940('0x58')]['id']}})['then'](handleEntityNotFound(_0x4911a5,null))[_0x7940('0x21')](removeEntity(_0x4911a5,null))[_0x7940('0x2a')](handleError(_0x4911a5,null));};exports['describe']=function(_0x460311,_0x37c716){return db[_0x7940('0x40')]['describe']()['then'](respondWithResult(_0x37c716,null))[_0x7940('0x2a')](handleError(_0x37c716,null));};exports['addDisposition']=function(_0x51f855,_0x30bbb7,_0x50a106){if(_0x51f855[_0x7940('0x5b')]['id']){delete _0x51f855[_0x7940('0x5b')]['id'];}return db['FaxAccount'][_0x7940('0x59')]({'where':{'id':_0x51f855[_0x7940('0x58')]['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x30bbb7,null))[_0x7940('0x21')](function(_0x308c48){if(_0x308c48){_0x51f855[_0x7940('0x5b')][_0x7940('0x64')]=_0x308c48['id'];return db[_0x7940('0x65')][_0x7940('0x5a')](_0x51f855[_0x7940('0x5b')]);}})[_0x7940('0x21')](respondWithResult(_0x30bbb7,null))[_0x7940('0x2a')](handleError(_0x30bbb7,null));};exports[_0x7940('0x66')]=function(_0x203ab9,_0x266fdc,_0x4e4b93){var _0x21c313={'raw':![],'where':{}};var _0x268c50={};var _0xa26f5b={'count':0x0,'rows':[]};return db[_0x7940('0x40')][_0x7940('0x67')]({'where':{'id':_0x203ab9[_0x7940('0x58')]['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x266fdc,null))[_0x7940('0x21')](function(_0x5efffc){if(_0x5efffc){_0x268c50[_0x7940('0x43')]=_[_0x7940('0x44')](db[_0x7940('0x65')][_0x7940('0x41')]);_0x268c50[_0x7940('0x45')]=_[_0x7940('0x44')](_0x203ab9[_0x7940('0x45')]);_0x268c50['filters']=_[_0x7940('0x46')](_0x268c50[_0x7940('0x43')],_0x268c50[_0x7940('0x45')]);_0x21c313[_0x7940('0x47')]=_[_0x7940('0x46')](_0x268c50[_0x7940('0x43')],qs[_0x7940('0x48')](_0x203ab9['query'][_0x7940('0x48')]));_0x21c313[_0x7940('0x47')]=_0x21c313['attributes']['length']?_0x21c313['attributes']:_0x268c50['model'];if(!_0x203ab9[_0x7940('0x45')]['hasOwnProperty']('nolimit')){_0x21c313[_0x7940('0x2e')]=qs['limit'](_0x203ab9[_0x7940('0x45')][_0x7940('0x2e')]);_0x21c313['offset']=qs[_0x7940('0x2d')](_0x203ab9[_0x7940('0x45')][_0x7940('0x2d')]);}_0x21c313[_0x7940('0x4b')]=qs[_0x7940('0x68')](_0x203ab9['query'][_0x7940('0x68')]);_0x21c313[_0x7940('0x4c')]=qs['filters'](_[_0x7940('0x4d')](_0x203ab9[_0x7940('0x45')],_0x268c50[_0x7940('0x4e')]));_0x21c313[_0x7940('0x4c')][_0x7940('0x64')]=_0x5efffc['id'];if(_0x203ab9[_0x7940('0x45')][_0x7940('0x4f')]){_0x21c313['where']=_['merge'](_0x21c313[_0x7940('0x4c')],{'$or':_[_0x7940('0x3f')](_0x21c313[_0x7940('0x47')],function(_0x427e93){var _0x4f2fd4={};_0x4f2fd4[_0x427e93]={'$like':'%'+_0x203ab9['query'][_0x7940('0x4f')]+'%'};return _0x4f2fd4;})});}_0x21c313=_['merge']({},_0x21c313,_0x203ab9[_0x7940('0x69')]);return db[_0x7940('0x65')]['count']({'where':_0x21c313[_0x7940('0x4c')]})[_0x7940('0x21')](function(_0x3b61c2){_0xa26f5b['count']=_0x3b61c2;if(_0x203ab9[_0x7940('0x45')][_0x7940('0x53')]){_0x21c313[_0x7940('0x54')]=[{'all':!![]}];}return db[_0x7940('0x65')][_0x7940('0x55')](_0x21c313);})['then'](function(_0x34545f){_0xa26f5b[_0x7940('0x56')]=_0x34545f;return _0xa26f5b;});}})[_0x7940('0x21')](respondWithFilteredResult(_0x266fdc,_0x21c313))[_0x7940('0x2a')](handleError(_0x266fdc,null));};exports[_0x7940('0x6a')]=function(_0x2e6052,_0x4e7596,_0x281afd){return db['FaxAccount'][_0x7940('0x59')]({'where':{'id':_0x2e6052[_0x7940('0x58')]['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x4e7596,null))['then'](function(_0x4915af){if(_0x4915af){return _0x4915af[_0x7940('0x6a')](_0x2e6052['query']['ids']);}})['then'](respondWithStatusCode(_0x4e7596,null))[_0x7940('0x2a')](handleError(_0x4e7596,null));};exports[_0x7940('0x6b')]=function(_0x122ce3,_0x17b904,_0x17c548){if(_0x122ce3[_0x7940('0x5b')]['id']){delete _0x122ce3[_0x7940('0x5b')]['id'];}return db[_0x7940('0x40')][_0x7940('0x59')]({'where':{'id':_0x122ce3[_0x7940('0x58')]['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x17b904,null))['then'](function(_0x12f7ae){if(_0x12f7ae){_0x122ce3['body']['FaxAccountId']=_0x12f7ae['id'];return db[_0x7940('0x6c')]['create'](_0x122ce3[_0x7940('0x5b')]);}})[_0x7940('0x21')](respondWithResult(_0x17b904,null))['catch'](handleError(_0x17b904,null));};exports[_0x7940('0x6d')]=function(_0xfbd49a,_0x25cadc,_0x5c12f2){var _0x485cc9={'raw':![],'where':{}};var _0x2acc20={};var _0x197c3f={'count':0x0,'rows':[]};return db[_0x7940('0x40')][_0x7940('0x67')]({'where':{'id':_0xfbd49a[_0x7940('0x58')]['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x25cadc,null))['then'](function(_0x36ea77){if(_0x36ea77){_0x2acc20[_0x7940('0x43')]=_['keys'](db['CannedAnswer'][_0x7940('0x41')]);_0x2acc20[_0x7940('0x45')]=_[_0x7940('0x44')](_0xfbd49a[_0x7940('0x45')]);_0x2acc20[_0x7940('0x4e')]=_[_0x7940('0x46')](_0x2acc20[_0x7940('0x43')],_0x2acc20['query']);_0x485cc9['attributes']=_[_0x7940('0x46')](_0x2acc20[_0x7940('0x43')],qs['fields'](_0xfbd49a[_0x7940('0x45')][_0x7940('0x48')]));_0x485cc9[_0x7940('0x47')]=_0x485cc9[_0x7940('0x47')][_0x7940('0x49')]?_0x485cc9[_0x7940('0x47')]:_0x2acc20[_0x7940('0x43')];if(!_0xfbd49a[_0x7940('0x45')][_0x7940('0x4a')](_0x7940('0x6e'))){_0x485cc9['limit']=qs[_0x7940('0x2e')](_0xfbd49a[_0x7940('0x45')]['limit']);_0x485cc9[_0x7940('0x2d')]=qs[_0x7940('0x2d')](_0xfbd49a[_0x7940('0x45')]['offset']);}_0x485cc9[_0x7940('0x4b')]=qs[_0x7940('0x68')](_0xfbd49a[_0x7940('0x45')]['sort']);_0x485cc9[_0x7940('0x4c')]=qs[_0x7940('0x4e')](_[_0x7940('0x4d')](_0xfbd49a[_0x7940('0x45')],_0x2acc20['filters']));_0x485cc9['where'][_0x7940('0x64')]=_0x36ea77['id'];if(_0xfbd49a[_0x7940('0x45')][_0x7940('0x4f')]){_0x485cc9[_0x7940('0x4c')]=_[_0x7940('0x50')](_0x485cc9[_0x7940('0x4c')],{'$or':_[_0x7940('0x3f')](_0x485cc9[_0x7940('0x47')],function(_0x4fe202){var _0x5526fe={};_0x5526fe[_0x4fe202]={'$like':'%'+_0xfbd49a[_0x7940('0x45')][_0x7940('0x4f')]+'%'};return _0x5526fe;})});}_0x485cc9=_[_0x7940('0x50')]({},_0x485cc9,_0xfbd49a['options']);return db[_0x7940('0x6c')][_0x7940('0x2c')]({'where':_0x485cc9[_0x7940('0x4c')]})[_0x7940('0x21')](function(_0x188fda){_0x197c3f[_0x7940('0x2c')]=_0x188fda;if(_0xfbd49a[_0x7940('0x45')][_0x7940('0x53')]){_0x485cc9[_0x7940('0x54')]=[{'all':!![]}];}return db[_0x7940('0x6c')][_0x7940('0x55')](_0x485cc9);})[_0x7940('0x21')](function(_0x105e26){_0x197c3f[_0x7940('0x56')]=_0x105e26;return _0x197c3f;});}})[_0x7940('0x21')](respondWithFilteredResult(_0x25cadc,_0x485cc9))[_0x7940('0x2a')](handleError(_0x25cadc,null));};exports[_0x7940('0x6f')]=function(_0x1b4384,_0x1ee709,_0x3c4ba3){return db[_0x7940('0x40')][_0x7940('0x59')]({'where':{'id':_0x1b4384[_0x7940('0x58')]['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x1ee709,null))[_0x7940('0x21')](function(_0x5521f0){if(_0x5521f0){return _0x5521f0['removeAnswers'](_0x1b4384[_0x7940('0x45')][_0x7940('0x70')]);}})[_0x7940('0x21')](respondWithStatusCode(_0x1ee709,null))[_0x7940('0x2a')](handleError(_0x1ee709,null));};exports[_0x7940('0x71')]=function(_0x149480,_0xac266d,_0x30eaf8){return db[_0x7940('0x72')][_0x7940('0x59')]({'where':{'id':_0x149480[_0x7940('0x58')]['id']}})[_0x7940('0x21')](handleEntityNotFound(_0xac266d,null))['then'](function(_0x12e317){if(_0x12e317){return _0x12e317[_0x7940('0x71')](_0x149480[_0x7940('0x5b')][_0x7940('0x70')],_[_0x7940('0x73')](_0x149480[_0x7940('0x5b')],['ids','id'])||{});}})[_0x7940('0x21')](respondWithResult(_0xac266d,null))[_0x7940('0x2a')](handleError(_0xac266d,null));};exports[_0x7940('0x74')]=function(_0x40ed8d,_0x4710ec,_0x122b58){var _0x75076a={'raw':![],'where':{}};var _0x51f7b4={};var _0x1b7583={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7940('0x67')]({'where':{'id':_0x40ed8d[_0x7940('0x58')]['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x4710ec,null))['then'](function(_0x27f974){if(_0x27f974){_0x51f7b4['model']=_[_0x7940('0x44')](db[_0x7940('0x72')][_0x7940('0x41')]);_0x51f7b4[_0x7940('0x45')]=_[_0x7940('0x44')](_0x40ed8d[_0x7940('0x45')]);_0x51f7b4[_0x7940('0x4e')]=_[_0x7940('0x46')](_0x51f7b4[_0x7940('0x43')],_0x51f7b4[_0x7940('0x45')]);_0x75076a[_0x7940('0x47')]=_[_0x7940('0x46')](_0x51f7b4['model'],qs['fields'](_0x40ed8d[_0x7940('0x45')]['fields']));_0x75076a[_0x7940('0x47')]=_0x75076a['attributes'][_0x7940('0x49')]?_0x75076a[_0x7940('0x47')]:_0x51f7b4['model'];if(!_0x40ed8d['query'][_0x7940('0x4a')](_0x7940('0x6e'))){_0x75076a[_0x7940('0x2e')]=qs['limit'](_0x40ed8d[_0x7940('0x45')][_0x7940('0x2e')]);_0x75076a[_0x7940('0x2d')]=qs[_0x7940('0x2d')](_0x40ed8d[_0x7940('0x45')][_0x7940('0x2d')]);}_0x75076a['order']=qs['sort'](_0x40ed8d[_0x7940('0x45')]['sort']);_0x75076a[_0x7940('0x4c')]=qs[_0x7940('0x4e')](_[_0x7940('0x4d')](_0x40ed8d[_0x7940('0x45')],_0x51f7b4[_0x7940('0x4e')]));_0x75076a[_0x7940('0x4c')]['FaxAccountId']=_0x27f974['id'];if(_0x40ed8d[_0x7940('0x45')][_0x7940('0x4f')]){_0x75076a['where']=_[_0x7940('0x50')](_0x75076a[_0x7940('0x4c')],{'$or':_[_0x7940('0x3f')](_0x75076a['attributes'],function(_0x6a09c8){var _0x46333e={};_0x46333e[_0x6a09c8]={'$like':'%'+_0x40ed8d['query']['filter']+'%'};return _0x46333e;})});}_0x75076a=_[_0x7940('0x50')]({},_0x75076a,_0x40ed8d['options']);return db['FaxInteraction'][_0x7940('0x2c')]({'where':_0x75076a[_0x7940('0x4c')]})[_0x7940('0x21')](function(_0x42869a){_0x1b7583['count']=_0x42869a;if(_0x40ed8d[_0x7940('0x45')]['includeAll']){_0x75076a['include']=[{'model':db[_0x7940('0x75')],'as':_0x7940('0x76'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x7940('0x3b'),_0x7940('0x77'),_0x7940('0x78')],'required':![]},{'model':db[_0x7940('0x79')],'as':_0x7940('0x7a'),'attributes':['id','name',_0x7940('0x7b')],'where':_0x40ed8d[_0x7940('0x45')][_0x7940('0x7c')]?{'id':_0x40ed8d[_0x7940('0x45')][_0x7940('0x7c')]}:undefined,'required':_0x40ed8d[_0x7940('0x45')][_0x7940('0x7c')]?!![]:![]}];}return db['FaxInteraction'][_0x7940('0x55')](_0x75076a);})[_0x7940('0x21')](function(_0x4e9199){_0x1b7583[_0x7940('0x56')]=_0x4e9199;return _0x1b7583;});}})[_0x7940('0x21')](respondWithFilteredResult(_0x4710ec,_0x75076a))[_0x7940('0x2a')](handleError(_0x4710ec,null));};exports[_0x7940('0x7d')]=function(_0x3fee37,_0x4648eb,_0x492fe1){return db[_0x7940('0x40')]['findOne']({'where':{'id':_0x3fee37['params']['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x4648eb,null))[_0x7940('0x21')](function(_0x5cd26f){if(_0x5cd26f){return db['sequelize'][_0x7940('0x7e')](function(_0x1da38a){return db['FaxApplication'][_0x7940('0x37')]({'where':{'FaxAccountId':_0x3fee37[_0x7940('0x58')]['id']},'transaction':_0x1da38a})[_0x7940('0x21')](function(_0x2c5785){var _0xab83e4=_['map'](_0x3fee37[_0x7940('0x5b')],function(_0x54aab3){_0x54aab3[_0x7940('0x64')]=_0x3fee37['params']['id'];return _0x54aab3;});return db[_0x7940('0x7f')][_0x7940('0x80')](_0xab83e4,{'transaction':_0x1da38a});});})[_0x7940('0x21')](function(){return db['FaxApplication'][_0x7940('0x81')]({'where':{'FaxAccountId':_0x3fee37[_0x7940('0x58')]['id']},'order':_0x7940('0x82')});});}})[_0x7940('0x21')](respondWithResult(_0x4648eb,null))[_0x7940('0x2a')](handleError(_0x4648eb,null));};exports[_0x7940('0x83')]=function(_0x146ed7,_0x41f935,_0x234cbd){var _0x501144={};var _0x5eb196={};var _0x3732be;var _0x2f3577;return db['FaxAccount'][_0x7940('0x67')]({'where':{'id':_0x146ed7[_0x7940('0x58')]['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x41f935,null))[_0x7940('0x21')](function(_0x1955e0){if(_0x1955e0){_0x3732be=_0x1955e0;_0x5eb196['model']=_[_0x7940('0x44')](db['FaxApplication']['rawAttributes']);_0x5eb196[_0x7940('0x45')]=_[_0x7940('0x44')](_0x146ed7[_0x7940('0x45')]);_0x5eb196['filters']=_['intersection'](_0x5eb196[_0x7940('0x43')],_0x5eb196[_0x7940('0x45')]);_0x501144[_0x7940('0x47')]=_[_0x7940('0x46')](_0x5eb196[_0x7940('0x43')],qs[_0x7940('0x48')](_0x146ed7[_0x7940('0x45')][_0x7940('0x48')]));_0x501144['attributes']=_0x501144[_0x7940('0x47')][_0x7940('0x49')]?_0x501144[_0x7940('0x47')]:_0x5eb196['model'];_0x501144[_0x7940('0x4b')]=qs[_0x7940('0x68')](_0x146ed7['query'][_0x7940('0x68')]);_0x501144['where']=qs['filters'](_['pick'](_0x146ed7[_0x7940('0x45')],_0x5eb196['filters']));if(_0x146ed7[_0x7940('0x45')][_0x7940('0x4f')]){_0x501144[_0x7940('0x4c')]=_['merge'](_0x501144[_0x7940('0x4c')],{'$or':_[_0x7940('0x3f')](_0x501144[_0x7940('0x47')],function(_0x221b00){var _0x50d430={};_0x50d430[_0x221b00]={'$like':'%'+_0x146ed7['query'][_0x7940('0x4f')]+'%'};return _0x50d430;})});}_0x501144=_['merge']({},_0x501144,_0x146ed7[_0x7940('0x69')]);return _0x3732be[_0x7940('0x83')](_0x501144);}})['then'](function(_0x258c47){if(_0x258c47){_0x2f3577=_0x258c47[_0x7940('0x49')];if(!_0x146ed7['query'][_0x7940('0x4a')](_0x7940('0x6e'))){_0x501144[_0x7940('0x2e')]=qs['limit'](_0x146ed7[_0x7940('0x45')][_0x7940('0x2e')]);_0x501144[_0x7940('0x2d')]=qs[_0x7940('0x2d')](_0x146ed7[_0x7940('0x45')]['offset']);}return _0x3732be[_0x7940('0x83')](_0x501144);}})[_0x7940('0x21')](function(_0x33fc81){if(_0x33fc81){return _0x33fc81?{'count':_0x2f3577,'rows':_0x33fc81}:null;}})['then'](respondWithResult(_0x41f935,null))['catch'](handleError(_0x41f935,null));};function Extension(_0x3c766d,_0x2e8909,_0x4cf6f7,_0x218c35){this[_0x7940('0x84')]='from-voip-provider';this[_0x7940('0x85')]=_0x3c766d[_0x7940('0x86')];this[_0x7940('0x87')]=_0x218c35;this['type']=_0x7940('0x88');this[_0x7940('0x89')]=_0x7940('0x8a');this[_0x7940('0x64')]=_0x3c766d['id'];this['priority']=_0x2e8909;this['appdata']=_0x4cf6f7;}function createExtensionsReciveFax(_0x40392a){var _0x57f64e=0x1;var _0x47b02d=[];_0x47b02d[_0x7940('0x8b')](new Extension(_0x40392a,_0x57f64e,'',_0x7940('0x8c')));_0x57f64e+=0x1;_0x47b02d[_0x7940('0x8b')](new Extension(_0x40392a,_0x57f64e,'CDR(type)=inbound-fax',_0x7940('0x8d')));_0x57f64e+=0x1;for(var _0x59552c in _0x40392a){if(_0x40392a[_0x7940('0x4a')](_0x59552c)&&(_0x59552c==='ecm'||_0x59552c===_0x7940('0x86')||_0x59552c===_0x7940('0x8e')||_0x59552c==='faxdetect'||_0x59552c==='headerinfo'||_0x59552c===_0x7940('0x8f')||_0x59552c==='minrate'||_0x59552c===_0x7940('0x90')||_0x59552c===_0x7940('0x91'))){_0x47b02d['push'](new Extension(_0x40392a,_0x57f64e,_0x7940('0x92')+_0x59552c+')='+_0x40392a[_0x59552c],'Set'));_0x57f64e+=0x1;}}_0x47b02d[_0x7940('0x8b')](new Extension(_0x40392a,_0x57f64e,'6',_0x7940('0x93')));_0x57f64e+=0x1;_0x47b02d[_0x7940('0x8b')](new Extension(_0x40392a,_0x57f64e,_0x7940('0x94'),'ReceiveFax'));_0x57f64e=0x0;return _0x47b02d;}exports[_0x7940('0x95')]=function(_0x243133,_0x422a31,_0x1baa9e){var _0x282a8b;return db[_0x7940('0x96')]['transaction'](function(_0xd64350){return db[_0x7940('0x40')][_0x7940('0x5a')](_0x243133[_0x7940('0x5b')],{'transaction':_0xd64350})[_0x7940('0x21')](function(_0xe8d22){_0x282a8b=_0xe8d22['get']({'plain':!![]});return db[_0x7940('0x97')][_0x7940('0x80')](createExtensionsReciveFax(_0x282a8b),{'transaction':_0xd64350});});})[_0x7940('0x21')](function(){return _0x282a8b;})[_0x7940('0x21')](respondWithResult(_0x422a31,null))[_0x7940('0x2a')](handleError(_0x422a31,null));};exports['updateAccountApplications']=function(_0x43b590,_0x2cc317,_0x120bb1){var _0x303e0f;return db[_0x7940('0x96')][_0x7940('0x7e')](function(_0x91ccf6){return db[_0x7940('0x40')][_0x7940('0x36')](_0x43b590[_0x7940('0x5b')],{'where':{'id':_0x43b590[_0x7940('0x5b')]['id']},'transaction':_0x91ccf6})[_0x7940('0x21')](function(_0x41d083){return db[_0x7940('0x97')]['destroy']({'where':{'FaxAccountId':_0x43b590[_0x7940('0x5b')]['id']},'transaction':_0x91ccf6})['then'](function(_0x8acfe){return db[_0x7940('0x97')][_0x7940('0x80')](createExtensionsReciveFax(_[_0x7940('0x73')](_0x43b590['body'],[_0x7940('0x98'),'key','createdAt',_0x7940('0x99'),_0x7940('0x9a'),'ListId'])),{'transaction':_0x91ccf6});});});})[_0x7940('0x21')](function(){return db[_0x7940('0x40')][_0x7940('0x9b')](_0x43b590[_0x7940('0x5b')]['id']);})['then'](respondWithResult(_0x2cc317,null))['catch'](handleError(_0x2cc317,null));};exports[_0x7940('0x9c')]=function(_0x52bb98,_0x595265,_0x337d75){var _0xc48eea={'raw':!![],'where':{}};var _0x372a53={};var _0x3ae9c8={'count':0x0,'rows':[]};return db[_0x7940('0x40')][_0x7940('0x67')]({'where':{'id':_0x52bb98[_0x7940('0x58')]['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x595265,null))[_0x7940('0x21')](function(_0x45b891){if(_0x45b891){_0x372a53['model']=_[_0x7940('0x44')](db[_0x7940('0x9d')][_0x7940('0x41')]);_0x372a53[_0x7940('0x45')]=_[_0x7940('0x44')](_0x52bb98[_0x7940('0x45')]);_0x372a53[_0x7940('0x4e')]=_[_0x7940('0x46')](_0x372a53[_0x7940('0x43')],_0x372a53[_0x7940('0x45')]);_0xc48eea[_0x7940('0x47')]=_[_0x7940('0x46')](_0x372a53[_0x7940('0x43')],qs[_0x7940('0x48')](_0x52bb98[_0x7940('0x45')]['fields']));_0xc48eea[_0x7940('0x47')]=_0xc48eea['attributes'][_0x7940('0x49')]?_0xc48eea[_0x7940('0x47')]:_0x372a53['model'];if(!_0x52bb98[_0x7940('0x45')][_0x7940('0x4a')](_0x7940('0x6e'))){_0xc48eea[_0x7940('0x2e')]=qs[_0x7940('0x2e')](_0x52bb98['query'][_0x7940('0x2e')]);_0xc48eea['offset']=qs[_0x7940('0x2d')](_0x52bb98[_0x7940('0x45')][_0x7940('0x2d')]);}_0xc48eea['order']=qs[_0x7940('0x68')](_0x52bb98[_0x7940('0x45')][_0x7940('0x68')]);_0xc48eea['where']=qs[_0x7940('0x4e')](_[_0x7940('0x4d')](_0x52bb98[_0x7940('0x45')],_0x372a53['filters']));_0xc48eea[_0x7940('0x4c')]['FaxAccountId']=_0x45b891['id'];if(_0x52bb98[_0x7940('0x45')][_0x7940('0x4f')]){_0xc48eea['where']=_[_0x7940('0x50')](_0xc48eea[_0x7940('0x4c')],{'$or':_[_0x7940('0x3f')](_0xc48eea[_0x7940('0x47')],function(_0x16a1a6){var _0x1d4d8b={};_0x1d4d8b[_0x16a1a6]={'$like':'%'+_0x52bb98[_0x7940('0x45')]['filter']+'%'};return _0x1d4d8b;})});}if(_0x52bb98[_0x7940('0x45')][_0x7940('0x9e')]){var _0xf611da=_0x52bb98[_0x7940('0x45')][_0x7940('0x9e')][_0x7940('0x9f')](',');var _0x3e527f={};_0x3e527f[_0xf611da[0x0]]={'$gte':moment(_0xf611da[0x1])[_0x7940('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0xc48eea['where']=_[_0x7940('0x50')](_0xc48eea[_0x7940('0x4c')],_0x3e527f);}_0xc48eea=_['merge']({},_0xc48eea,_0x52bb98[_0x7940('0x69')]);return db[_0x7940('0x9d')][_0x7940('0x2c')]({'where':_0xc48eea['where']})['then'](function(_0x56420d){_0x3ae9c8[_0x7940('0x2c')]=_0x56420d;if(_0x52bb98[_0x7940('0x45')]['includeAll']){_0xc48eea[_0x7940('0x54')]=[{'all':!![]}];}return db[_0x7940('0x9d')][_0x7940('0x55')](_0xc48eea);})[_0x7940('0x21')](function(_0x2f4a53){_0x3ae9c8[_0x7940('0x56')]=_0x2f4a53;return _0x3ae9c8;});}})['then'](respondWithFilteredResult(_0x595265,_0xc48eea))[_0x7940('0x2a')](handleError(_0x595265,null));};exports['send']=function(_0x5dc40f,_0xb19e53,_0x29ebd5){var _0x4422b0,_0x9d2ef={},_0x2ea906;if(_0x5dc40f[_0x7940('0x5b')]['to']){_0x2ea906=_0x5dc40f[_0x7940('0x5b')]['to'][0x0];}return db[_0x7940('0x40')][_0x7940('0x59')]({'where':{'id':_0x5dc40f[_0x7940('0x58')]['id']},'include':[{'model':db[_0x7940('0xa1')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x2ea906},'limit':0x1,'order':[[_0x7940('0x99'),_0x7940('0xa2')]]}]}]})['then'](handleEntityNotFound(_0xb19e53,null))[_0x7940('0x21')](function(_0x480c2d){_0x4422b0=_0x480c2d;if(_0x5dc40f['body'][_0x7940('0xa3')]&&_0x5dc40f[_0x7940('0x5b')]['attachments'][_0x7940('0x49')]){for(var _0xb57fdf=0x0;_0xb57fdf<_0x5dc40f[_0x7940('0x5b')][_0x7940('0xa3')][_0x7940('0x49')];_0xb57fdf+=0x1){_0x5dc40f[_0x7940('0x5b')]['attachments'][_0xb57fdf]={'filename':_0x5dc40f['body'][_0x7940('0xa3')][_0xb57fdf]['name'],'id':_0x5dc40f[_0x7940('0x5b')][_0x7940('0xa3')][_0xb57fdf]['id'],'path':path[_0x7940('0xa4')](config[_0x7940('0xa5')],_0x7940('0xa6'),_0x5dc40f[_0x7940('0x5b')][_0x7940('0xa3')][_0xb57fdf][_0x7940('0xa7')])};}}return respondWithRpcPromise(_0x7940('0xa8'),_0x7940('0xa8'),{'FaxAccountId':_['isNil'](_0x5dc40f[_0x7940('0x58')]['id'])?undefined:_0x5dc40f[_0x7940('0x58')]['id'],'path':_[_0x7940('0xa9')](_0x5dc40f['body']['attachments'][0x0]['path'])?undefined:_0x5dc40f[_0x7940('0x5b')][_0x7940('0xa3')][0x0][_0x7940('0x5')],'fax':_[_0x7940('0xa9')](_0x5dc40f['body']['to'][0x0])?undefined:_0x5dc40f[_0x7940('0x5b')]['to'][0x0]},client9002);})['then'](function(){if(_0x4422b0){if(_['isNil'](_0x5dc40f[_0x7940('0x5b')][_0x7940('0xaa')])){_0x5dc40f[_0x7940('0x5b')][_0x7940('0xaa')]=util['format']('\x22%s\x22\x20<%s>',_0x4422b0[_0x7940('0x3b')],_0x4422b0[_0x7940('0xab')]);}if(_0x4422b0[_0x7940('0xac')]){if(_0x4422b0['List'][_0x7940('0xad')][_0x7940('0x49')]){return _0x4422b0[_0x7940('0xac')]['Contacts'][0x0];}else{return db[_0x7940('0x75')]['create'](_['defaults'](_0x5dc40f[_0x7940('0x5b')],{'firstName':_0x5dc40f[_0x7940('0x5b')]['to'][0x0],'phone':_0x5dc40f[_0x7940('0x5b')]['to'][0x0],'fax':_0x5dc40f[_0x7940('0x5b')]['to'][0x0],'ListId':_0x4422b0[_0x7940('0xae')]}));}}else{throw new Error(_0x7940('0xaf'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x50bfc1){if(_0x50bfc1){return db['FaxInteraction'][_0x7940('0x59')]({'where':{'ContactId':_0x50bfc1['id'],'closed':![],'FaxAccountId':_0x4422b0['id']}})['then'](function(_0x5bafc0){if(_0x5bafc0){return[_0x5bafc0,![]];}return db['FaxInteraction'][_0x7940('0x5a')]({'UserId':_0x5dc40f[_0x7940('0x5c')]['id'],'ContactId':_0x50bfc1['id'],'FaxAccountId':_0x4422b0['id'],'fax':_0x5dc40f['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x5dc40f[_0x7940('0x5b')],{'read':![],'body':_0x5dc40f['body'][_0x7940('0xa3')][0x0][_0x7940('0xb0')],'FaxAccountId':_0x4422b0['id'],'UserId':_0x5dc40f[_0x7940('0x5c')]['id'],'ContactId':_0x50bfc1['id'],'AttachmentId':_0x5dc40f[_0x7940('0x5b')][_0x7940('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0x7940('0x9d')],'as':_0x7940('0xb1')}]})[_0x7940('0x21')](function(_0x1201de){return[_0x1201de,!![]];});});}else{throw new Error(_0x7940('0xb2'));}})['spread'](function(_0x281f26,_0x101b5d){if(_0x101b5d){return _0x281f26;}return db['FaxMessage'][_0x7940('0x5a')]({'direction':_0x7940('0xb3'),'read':![],'body':_0x5dc40f[_0x7940('0x5b')][_0x7940('0xa3')][0x0][_0x7940('0xb0')],'FaxAccountId':_0x4422b0['id'],'FaxInteractionId':_0x281f26['id'],'UserId':_0x5dc40f['user']['id'],'ContactId':_0x281f26[_0x7940('0xb4')],'AttachmentId':_0x5dc40f['body'][_0x7940('0xa3')][0x0]['id']})[_0x7940('0x21')](function(_0x141bbc){_0x281f26[_0x7940('0xb5')][_0x7940('0xb1')]=[];_0x281f26[_0x7940('0xb5')][_0x7940('0xb1')]['push'](_0x141bbc[_0x7940('0xb5')]);return _0x281f26;});})[_0x7940('0x21')](function(_0x18d3f2){respondWithRpcPromise(_0x7940('0xb6'),_0x7940('0xb6'),{'FaxAccountId':_[_0x7940('0xa9')](_0x5dc40f['params']['id'])?undefined:_0x5dc40f['params']['id'],'path':_[_0x7940('0xa9')](_0x5dc40f[_0x7940('0x5b')][_0x7940('0xa3')][0x0]['path'])?undefined:_0x5dc40f['body'][_0x7940('0xa3')][0x0]['path'],'fax':_[_0x7940('0xa9')](_0x5dc40f['body']['to'][0x0])?undefined:_0x5dc40f[_0x7940('0x5b')]['to'][0x0],'AttachmentId':_0x5dc40f[_0x7940('0x5b')][_0x7940('0xa3')][0x0]['id']},client9002)['then'](function(_0x467ddc){logger[_0x7940('0x22')](_0x7940('0xb7'),_0x467ddc);})[_0x7940('0x2a')](function(_0x49ad02){logger[_0x7940('0x22')]('SendFaxRpc,\x20%s',_0x49ad02);});return _0x18d3f2;})[_0x7940('0x21')](respondWithResult(_0xb19e53,null))[_0x7940('0x2a')](handleError(_0xb19e53,null));};exports[_0x7940('0xb8')]=function(_0x292b04,_0x72fa31,_0x49f27a){return db[_0x7940('0x40')][_0x7940('0x59')]({'where':{'id':_0x292b04[_0x7940('0x58')]['id']}})['then'](handleEntityNotFound(_0x72fa31,null))[_0x7940('0x21')](function(_0x17dcf0){if(_0x17dcf0){return _0x17dcf0['addAgents'](_0x292b04['body']['ids'],_[_0x7940('0x73')](_0x292b04[_0x7940('0x5b')],[_0x7940('0x70'),'id'])||{})[_0x7940('0xb9')](function(_0x2d6628){for(var _0x50c11d=0x0;_0x50c11d<_0x292b04[_0x7940('0x5b')][_0x7940('0x70')][_0x7940('0x49')];_0x50c11d+=0x1){socket[_0x7940('0xba')]('userFaxAccount:save',{'UserId':_0x292b04[_0x7940('0x5b')][_0x7940('0x70')][_0x50c11d],'FaxAccountId':_0x292b04[_0x7940('0x58')]['id']});}return _0x2d6628;});}})['then'](respondWithResult(_0x72fa31,null))[_0x7940('0x2a')](handleError(_0x72fa31,null));};exports[_0x7940('0xbb')]=function(_0x58b954,_0x43a9cd,_0x1f2183){return db[_0x7940('0x40')][_0x7940('0x59')]({'where':{'id':_0x58b954[_0x7940('0x58')]['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x43a9cd,null))[_0x7940('0x21')](function(_0x31995b){if(_0x31995b){return _0x31995b[_0x7940('0xbb')](_0x58b954[_0x7940('0x45')][_0x7940('0x70')])[_0x7940('0x21')](function(){if(_[_0x7940('0xbc')](_0x58b954[_0x7940('0x45')][_0x7940('0x70')])){for(var _0x15c684=0x0;_0x15c684<_0x58b954[_0x7940('0x45')][_0x7940('0x70')][_0x7940('0x49')];_0x15c684+=0x1){socket[_0x7940('0xba')](_0x7940('0xbd'),{'UserId':Number(_0x58b954[_0x7940('0x45')][_0x7940('0x70')][_0x15c684]),'FaxAccountId':Number(_0x58b954[_0x7940('0x58')]['id'])});}}else{socket[_0x7940('0xba')](_0x7940('0xbd'),{'UserId':Number(_0x58b954['query']['ids']),'FaxAccountId':Number(_0x58b954[_0x7940('0x58')]['id'])});}});}})[_0x7940('0x21')](respondWithStatusCode(_0x43a9cd,null))[_0x7940('0x2a')](handleError(_0x43a9cd,null));};exports[_0x7940('0xbe')]=function(_0x2834d6,_0x110931,_0x1400c6){var _0x274fbe={};var _0x57de08={};var _0x2f500a;var _0x221fe6;return db['FaxAccount'][_0x7940('0x67')]({'where':{'id':_0x2834d6['params']['id']}})[_0x7940('0x21')](handleEntityNotFound(_0x110931,null))[_0x7940('0x21')](function(_0x360f7f){if(_0x360f7f){_0x2f500a=_0x360f7f;_0x57de08[_0x7940('0x43')]=_[_0x7940('0x44')](db[_0x7940('0xbf')][_0x7940('0x41')]);_0x57de08[_0x7940('0x45')]=_['keys'](_0x2834d6[_0x7940('0x45')]);_0x57de08[_0x7940('0x4e')]=_[_0x7940('0x46')](_0x57de08['model'],_0x57de08[_0x7940('0x45')]);_0x274fbe[_0x7940('0x47')]=_[_0x7940('0x46')](_0x57de08[_0x7940('0x43')],qs[_0x7940('0x48')](_0x2834d6[_0x7940('0x45')][_0x7940('0x48')]));_0x274fbe[_0x7940('0x47')]=_0x274fbe[_0x7940('0x47')]['length']?_0x274fbe[_0x7940('0x47')]:_0x57de08[_0x7940('0x43')];_0x274fbe[_0x7940('0x4b')]=qs[_0x7940('0x68')](_0x2834d6[_0x7940('0x45')]['sort']);_0x274fbe['where']=qs[_0x7940('0x4e')](_['pick'](_0x2834d6[_0x7940('0x45')],_0x57de08['filters']));if(_0x2834d6[_0x7940('0x45')][_0x7940('0x4f')]){_0x274fbe[_0x7940('0x4c')]=_['merge'](_0x274fbe[_0x7940('0x4c')],{'$or':_[_0x7940('0x3f')](_0x274fbe[_0x7940('0x47')],function(_0x6fba7b){var _0x5b7cbe={};_0x5b7cbe[_0x6fba7b]={'$like':'%'+_0x2834d6[_0x7940('0x45')][_0x7940('0x4f')]+'%'};return _0x5b7cbe;})});}_0x274fbe=_[_0x7940('0x50')]({},_0x274fbe,_0x2834d6[_0x7940('0x69')]);return _0x2f500a['getAgents'](_0x274fbe);}})[_0x7940('0x21')](function(_0xf2be91){if(_0xf2be91){_0x221fe6=_0xf2be91[_0x7940('0x49')];if(!_0x2834d6[_0x7940('0x45')][_0x7940('0x4a')](_0x7940('0x6e'))){_0x274fbe[_0x7940('0x2e')]=qs[_0x7940('0x2e')](_0x2834d6[_0x7940('0x45')]['limit']);_0x274fbe[_0x7940('0x2d')]=qs[_0x7940('0x2d')](_0x2834d6[_0x7940('0x45')]['offset']);}return _0x2f500a[_0x7940('0xbe')](_0x274fbe);}})[_0x7940('0x21')](function(_0x1d527d){if(_0x1d527d){return _0x1d527d?{'count':_0x221fe6,'rows':_0x1d527d}:null;}})[_0x7940('0x21')](respondWithResult(_0x110931,null))[_0x7940('0x2a')](handleError(_0x110931,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 891f940..2705171 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 _0xf7bf=['remove','emit','hook','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x4a3fd2,_0x285d09){var _0x2b6a86=function(_0x252c56){while(--_0x252c56){_0x4a3fd2['push'](_0x4a3fd2['shift']());}};_0x2b6a86(++_0x285d09);}(_0xf7bf,0x183));var _0xff7b=function(_0x3d0ffa,_0x2c71a7){_0x3d0ffa=_0x3d0ffa-0x0;var _0x249d3b=_0xf7bf[_0x3d0ffa];return _0x249d3b;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xff7b('0x0'))['db'][_0xff7b('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xff7b('0x2')](0x0);var events={'afterCreate':_0xff7b('0x3'),'afterUpdate':_0xff7b('0x4'),'afterDestroy':_0xff7b('0x5')};function emitEvent(_0xcb0cf5){return function(_0x3c334b,_0x23969d,_0x1c84e5){FaxAccountEvents[_0xff7b('0x6')](_0xcb0cf5+':'+_0x3c334b['id'],_0x3c334b);FaxAccountEvents['emit'](_0xcb0cf5,_0x3c334b);_0x1c84e5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xff7b('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x0227=['events','setMaxListeners','update','remove','emit','hook'];(function(_0x57f0c3,_0x29a4ef){var _0x1e1706=function(_0x135594){while(--_0x135594){_0x57f0c3['push'](_0x57f0c3['shift']());}};_0x1e1706(++_0x29a4ef);}(_0x0227,0x84));var _0x7022=function(_0x460713,_0x406625){_0x460713=_0x460713-0x0;var _0x5e0fe5=_0x0227[_0x460713];return _0x5e0fe5;};'use strict';var EventEmitter=require(_0x7022('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x7022('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7022('0x2'),'afterDestroy':_0x7022('0x3')};function emitEvent(_0x535d98){return function(_0x35fdc5,_0x776424,_0x4b25bf){FaxAccountEvents[_0x7022('0x4')](_0x535d98+':'+_0x35fdc5['id'],_0x35fdc5);FaxAccountEvents['emit'](_0x535d98,_0x35fdc5);_0x4b25bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x7022('0x5')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index c7ba656..dde1562 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 _0xfa78=['rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5d9f3f,_0x490914){var _0x419bd0=function(_0x44b5eb){while(--_0x44b5eb){_0x5d9f3f['push'](_0x5d9f3f['shift']());}};_0x419bd0(++_0x490914);}(_0xfa78,0x124));var _0x8fa7=function(_0x59b457,_0x2344c2){_0x59b457=_0x59b457-0x0;var _0x4ad359=_0xfa78[_0x59b457];return _0x4ad359;};'use strict';var _=require(_0x8fa7('0x0'));var util=require(_0x8fa7('0x1'));var logger=require(_0x8fa7('0x2'))(_0x8fa7('0x3'));var moment=require(_0x8fa7('0x4'));var BPromise=require(_0x8fa7('0x5'));var rp=require(_0x8fa7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fa7('0x7'));var config=require(_0x8fa7('0x8'));var attributes=require(_0x8fa7('0x9'));module[_0x8fa7('0xa')]=function(_0xc53ab1,_0x358024){return _0xc53ab1['define'](_0x8fa7('0xb'),attributes,{'tableName':_0x8fa7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf830=['rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','../../config/logger','moment','request-promise','path'];(function(_0x48e2db,_0x5bef01){var _0x44597e=function(_0x2d8c5c){while(--_0x2d8c5c){_0x48e2db['push'](_0x48e2db['shift']());}};_0x44597e(++_0x5bef01);}(_0xf830,0x1a8));var _0x0f83=function(_0x3737e6,_0x5b2de3){_0x3737e6=_0x3737e6-0x0;var _0x589409=_0xf830[_0x3737e6];return _0x589409;};'use strict';var _=require(_0x0f83('0x0'));var util=require('util');var logger=require(_0x0f83('0x1'))('api');var moment=require(_0x0f83('0x2'));var BPromise=require('bluebird');var rp=require(_0x0f83('0x3'));var fs=require('fs');var path=require(_0x0f83('0x4'));var rimraf=require(_0x0f83('0x5'));var config=require('../../config/environment');var attributes=require(_0x0f83('0x6'));module[_0x0f83('0x7')]=function(_0x577031,_0x5154b4){return _0x577031[_0x0f83('0x8')](_0x0f83('0x9'),attributes,{'tableName':_0x0f83('0xa'),'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 5274c80..0b7eb0c 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 _0x7c81=['Contacts','FaxApplication','get','applications','Applications','orderBy','priority','asc','length','contact','FaxInteraction','create','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','interaction','UserId','User','unshift','waitForTheAssignedAgent','Start','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','defaults','localhost','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','map','include','model','catch','NotifyFaxAccount','body','fax','CmContact','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List'];(function(_0x20fca7,_0x241074){var _0x199f40=function(_0x49685a){while(--_0x49685a){_0x20fca7['push'](_0x20fca7['shift']());}};_0x199f40(++_0x241074);}(_0x7c81,0x173));var _0x17c8=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0x7c81[_0x1f27df];return _0x286ee2;};'use strict';var _=require(_0x17c8('0x0'));var util=require(_0x17c8('0x1'));var moment=require(_0x17c8('0x2'));var BPromise=require(_0x17c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17c8('0x4'));var db=require(_0x17c8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x17c8('0x6'));var config=require(_0x17c8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x17c8('0x8')]['http']({'port':0x232c});config[_0x17c8('0x9')]=_[_0x17c8('0xa')](config[_0x17c8('0x9')],{'host':_0x17c8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x17c8('0x9')]));require('./faxAccount.socket')[_0x17c8('0xc')](socket);function respondWithRpcPromise(_0x4a3fd6,_0x1cf703,_0x4300f5){return new BPromise(function(_0x289beb,_0x2870e5){return client['request'](_0x4a3fd6,_0x4300f5)[_0x17c8('0xd')](function(_0x1942bf){logger[_0x17c8('0xe')](_0x17c8('0xf'),_0x1cf703,_0x17c8('0x10'));logger[_0x17c8('0x11')](_0x17c8('0x12'),_0x1cf703,'request\x20sent',JSON[_0x17c8('0x13')](_0x1942bf));if(_0x1942bf[_0x17c8('0x14')]){if(_0x1942bf['error'][_0x17c8('0x15')]===0x1f4){logger[_0x17c8('0x14')](_0x17c8('0xf'),_0x1cf703,_0x1942bf['error'][_0x17c8('0x16')]);return _0x2870e5(_0x1942bf[_0x17c8('0x14')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x1cf703,_0x1942bf['error'][_0x17c8('0x16')]);return _0x289beb(_0x1942bf[_0x17c8('0x14')][_0x17c8('0x16')]);}else{logger[_0x17c8('0xe')](_0x17c8('0xf'),_0x1cf703,_0x17c8('0x10'));_0x289beb(_0x1942bf['result'][_0x17c8('0x16')]);}})['catch'](function(_0x25ed42){logger[_0x17c8('0x14')](_0x17c8('0xf'),_0x1cf703,_0x25ed42);_0x2870e5(_0x25ed42);});});}exports[_0x17c8('0x17')]=function(_0x56002c){var _0xe8342=this;return new Promise(function(_0xfb0bb0,_0x3d1971){return db[_0x17c8('0x18')][_0x17c8('0x19')]({'raw':_0x56002c[_0x17c8('0x1a')]?_0x56002c[_0x17c8('0x1a')][_0x17c8('0x1b')]===undefined?!![]:![]:!![],'where':_0x56002c[_0x17c8('0x1a')]?_0x56002c[_0x17c8('0x1a')]['where']||null:null,'attributes':_0x56002c[_0x17c8('0x1a')]?_0x56002c['options'][_0x17c8('0x1c')]||null:null,'limit':_0x56002c[_0x17c8('0x1a')]?_0x56002c[_0x17c8('0x1a')][_0x17c8('0x1d')]||null:null,'include':_0x56002c[_0x17c8('0x1a')]?_0x56002c['options']['include']?_[_0x17c8('0x1e')](_0x56002c['options'][_0x17c8('0x1f')],function(_0x30e780){return{'model':db[_0x30e780['model']],'as':_0x30e780['as'],'attributes':_0x30e780[_0x17c8('0x1c')],'include':_0x30e780[_0x17c8('0x1f')]?_[_0x17c8('0x1e')](_0x30e780[_0x17c8('0x1f')],function(_0x243d02){return{'model':db[_0x243d02[_0x17c8('0x20')]],'as':_0x243d02['as'],'attributes':_0x243d02[_0x17c8('0x1c')],'include':_0x243d02['include']?_[_0x17c8('0x1e')](_0x243d02[_0x17c8('0x1f')],function(_0x4be411){return{'model':db[_0x4be411[_0x17c8('0x20')]],'as':_0x4be411['as'],'attributes':_0x4be411[_0x17c8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x17c8('0xd')](function(_0x4f4d32){logger[_0x17c8('0xe')](_0x17c8('0x17'),_0x56002c);logger[_0x17c8('0x11')](_0x17c8('0x17'),_0x56002c,JSON[_0x17c8('0x13')](_0x4f4d32));_0xfb0bb0(_0x4f4d32);})[_0x17c8('0x21')](function(_0x24b9cb){logger['error'](_0x17c8('0x17'),_0x24b9cb[_0x17c8('0x16')],_0x56002c);_0x3d1971(_0xe8342[_0x17c8('0x14')](0x1f4,_0x24b9cb[_0x17c8('0x16')]));});});};exports[_0x17c8('0x22')]=function(_0x2b7035,_0x158f1c,_0x550481){var _0x1ad53f=this;return new Promise(function(_0x47a0e7,_0x2b5f47){var _0x277589={'body':_0x2b7035[_0x17c8('0x23')],'channel':_0x17c8('0x24')};var _0x2cb6cf=[];var _0x37867c=[];var _0x481972={};return db[_0x17c8('0x25')]['describe']()[_0x17c8('0xd')](function(_0x6b5c90){if(!_0x6b5c90){throw new db['Sequelize'][(_0x17c8('0x26'))](_0x17c8('0x27'));}_0x2cb6cf=_[_0x17c8('0x28')](_[_0x17c8('0x29')](_0x6b5c90),['createdAt',_0x17c8('0x2a')]);_0x37867c=_[_0x17c8('0x28')](_[_0x17c8('0x29')](_0x6b5c90),[_0x17c8('0x2b'),_0x17c8('0x2a'),_0x17c8('0x2c'),_0x17c8('0x2d')]);if(_0x2b7035[_0x17c8('0x23')]['id']){delete _0x2b7035[_0x17c8('0x23')]['id'];}if(_['isNil'](_0x2b7035[_0x17c8('0x23')][_0x17c8('0x2e')])){throw new db[(_0x17c8('0x2f'))][(_0x17c8('0x26'))](_0x17c8('0x30'));}if(_[_0x17c8('0x31')](_0x2b7035[_0x17c8('0x23')]['body'])||_0x2b7035[_0x17c8('0x23')][_0x17c8('0x23')]===''){throw new db[(_0x17c8('0x2f'))]['ValidationError'](_0x17c8('0x32'));}if(_[_0x17c8('0x31')](_0x2b7035[_0x17c8('0x23')][_0x17c8('0x33')])){throw new db[(_0x17c8('0x2f'))]['ValidationError'](_0x17c8('0x34')+_0x37867c);}if(!_[_0x17c8('0x35')](_0x37867c,_0x2b7035[_0x17c8('0x23')]['mapKey'])){throw new db['Sequelize'][(_0x17c8('0x26'))](_0x17c8('0x36')+_0x37867c);}_0x481972[_0x2b7035['body'][_0x17c8('0x33')]]=_0x2b7035[_0x17c8('0x23')][_0x17c8('0x2e')];})[_0x17c8('0xd')](function(){return db[_0x17c8('0x18')][_0x17c8('0x37')]({'where':{'id':_0x2b7035[_0x17c8('0x38')]['id']},'include':[{'model':db[_0x17c8('0x39')],'as':_0x17c8('0x3a'),'include':[{'model':db[_0x17c8('0x25')],'as':_0x17c8('0x3b'),'where':_0x481972,'limit':0x1,'order':[[_0x17c8('0x2a'),'DESC']]}]},{'model':db[_0x17c8('0x3c')],'as':'Applications'}]});})[_0x17c8('0xd')](function(_0x31af1d){if(_0x31af1d&&_0x31af1d[_0x17c8('0x3a')]){var _0x2df4d8=_0x31af1d[_0x17c8('0x3d')]({'plain':!![]});_0x277589[_0x17c8('0x38')]=_0x2df4d8;_0x277589[_0x17c8('0x3e')]=_0x2df4d8[_0x17c8('0x3f')];_0x277589['list']=_0x2df4d8[_0x17c8('0x3a')];_0x277589['applications']=_[_0x17c8('0x40')](_0x277589[_0x17c8('0x3e')],[_0x17c8('0x41')],[_0x17c8('0x42')]);if(_0x277589[_0x17c8('0x38')]['Applications']){delete _0x277589[_0x17c8('0x38')][_0x17c8('0x3f')];}if(_0x277589[_0x17c8('0x38')]['List']&&_0x277589[_0x17c8('0x38')][_0x17c8('0x3a')]['Contacts'][_0x17c8('0x43')]){return _0x277589['account'][_0x17c8('0x3a')][_0x17c8('0x3b')][0x0];}var _0x262dae=_['defaults'](_0x2b7035[_0x17c8('0x23')],{'firstName':_0x2b7035[_0x17c8('0x23')][_0x17c8('0x2e')],'ListId':_0x2df4d8[_0x17c8('0x2d')]});_0x262dae[_0x2b7035['body']['mapKey']]=_0x2b7035[_0x17c8('0x23')]['from'];return db['CmContact']['create'](_0x262dae,{'fields':_0x2cb6cf,'raw':!![]});}})['then'](function(_0x602ce6){_0x277589[_0x17c8('0x44')]=_0x602ce6;if(_0x602ce6){var _0x1e1c20={'ContactId':_0x602ce6['id'],'FaxAccountId':_0x2b7035['account']['id'],'fax':_0x602ce6[_0x17c8('0x24')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x602ce6['id'],'closed':![],'FaxAccountId':_0x2b7035[_0x17c8('0x38')]['id']}})[_0x17c8('0xd')](function(_0x402b33){if(_0x402b33){return[_0x402b33,![]];}return db[_0x17c8('0x45')][_0x17c8('0x46')](_0x1e1c20)[_0x17c8('0xd')](function(_0x188d30){return[_0x188d30,!![]];});});}else{throw new Error(_0x17c8('0x47'));}})[_0x17c8('0x48')](function(_0x3d1823,_0x576920){var _0x52dc55=_0x3d1823[_0x17c8('0x3d')]({'plain':!![]});if(_0x576920){if(_0x277589[_0x17c8('0x38')]['autoclose']){_0x277589['applications'][_0x17c8('0x49')]({'id':0x0,'priority':_0x277589[_0x17c8('0x3e')][_0x17c8('0x43')]+0x1,'app':_0x17c8('0x4a'),'appdata':_0x17c8('0x4b'),'interval':_0x17c8('0x4c')});}_0x52dc55[_0x17c8('0x4d')]=!![];}else{_0x52dc55[_0x17c8('0x4d')]=![];}_0x277589['interaction']=_0x52dc55;return db['FaxMessage'][_0x17c8('0x46')]({'body':_0x2b7035[_0x17c8('0x23')]['body'],'FaxAccountId':_0x2b7035[_0x17c8('0x38')]['id'],'FaxInteractionId':_0x3d1823['id'],'direction':'in','ContactId':_0x3d1823[_0x17c8('0x4e')],'AttachmentId':_0x2b7035[_0x17c8('0x23')][_0x17c8('0x4f')]});})[_0x17c8('0xd')](function(_0x29f236){_0x277589[_0x17c8('0x16')]=_0x29f236;if(_0x277589[_0x17c8('0x50')][_0x17c8('0x51')]){return db[_0x17c8('0x52')]['find']({'attributes':['id','name'],'where':{'id':_0x277589[_0x17c8('0x50')][_0x17c8('0x51')]}})['then'](function(_0x20af1d){if(_0x20af1d){_0x277589['applications'][_0x17c8('0x53')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x20af1d['name']+','+(_0x277589[_0x17c8('0x38')][_0x17c8('0x54')]||0xa),'interval':_0x17c8('0x4c')});}return respondWithRpcPromise('Start','startRouting',_0x277589);});}return respondWithRpcPromise(_0x17c8('0x55'),'startRouting',_0x277589);})[_0x17c8('0xd')](function(_0x25921b){_0x47a0e7(_0x25921b);})[_0x17c8('0x21')](function(_0x1dd421){_0x2b5f47(_0x1ad53f['error'](0x1f4,_0x1dd421[_0x17c8('0x16')]));});});}; \ No newline at end of file +var _0xa34b=['get','autoclose','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','User','name','interaction','unshift','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','FaxAccount','options','raw','limit','map','model','attributes','include','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','updatedAt','keys','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','DESC','FaxApplication','Applications','applications','priority','asc','length','contact','FaxInteraction','create','Contact\x20not\x20found'];(function(_0x12bb27,_0x2aa17c){var _0x53ddb1=function(_0x547f1a){while(--_0x547f1a){_0x12bb27['push'](_0x12bb27['shift']());}};_0x53ddb1(++_0x2aa17c);}(_0xa34b,0xbf));var _0xba34=function(_0x3e5bb8,_0x475c54){_0x3e5bb8=_0x3e5bb8-0x0;var _0x4851f2=_0xa34b[_0x3e5bb8];return _0x4851f2;};'use strict';var _=require(_0xba34('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba34('0x1'));var rs=require(_0xba34('0x2'));var fs=require('fs');var Redis=require(_0xba34('0x3'));var db=require(_0xba34('0x4'))['db'];var utils=require(_0xba34('0x5'));var logger=require(_0xba34('0x6'))('rpc');var config=require(_0xba34('0x7'));var jayson=require(_0xba34('0x8'));var client=jayson[_0xba34('0x9')][_0xba34('0xa')]({'port':0x232c});config[_0xba34('0xb')]=_[_0xba34('0xc')](config[_0xba34('0xb')],{'host':_0xba34('0xd'),'port':0x18eb});var socket=require(_0xba34('0xe'))(new Redis(config[_0xba34('0xb')]));require(_0xba34('0xf'))[_0xba34('0x10')](socket);function respondWithRpcPromise(_0x5fbacc,_0x51378c,_0x151176){return new BPromise(function(_0x676b72,_0x412cd7){return client[_0xba34('0x11')](_0x5fbacc,_0x151176)[_0xba34('0x12')](function(_0x3cd59e){logger[_0xba34('0x13')](_0xba34('0x14'),_0x51378c,_0xba34('0x15'));logger[_0xba34('0x16')](_0xba34('0x17'),_0x51378c,_0xba34('0x15'),JSON[_0xba34('0x18')](_0x3cd59e));if(_0x3cd59e[_0xba34('0x19')]){if(_0x3cd59e[_0xba34('0x19')][_0xba34('0x1a')]===0x1f4){logger[_0xba34('0x19')](_0xba34('0x14'),_0x51378c,_0x3cd59e['error'][_0xba34('0x1b')]);return _0x412cd7(_0x3cd59e[_0xba34('0x19')][_0xba34('0x1b')]);}logger[_0xba34('0x19')](_0xba34('0x14'),_0x51378c,_0x3cd59e[_0xba34('0x19')][_0xba34('0x1b')]);return _0x676b72(_0x3cd59e[_0xba34('0x19')][_0xba34('0x1b')]);}else{logger['info'](_0xba34('0x14'),_0x51378c,'request\x20sent');_0x676b72(_0x3cd59e[_0xba34('0x1c')][_0xba34('0x1b')]);}})['catch'](function(_0x252296){logger[_0xba34('0x19')](_0xba34('0x14'),_0x51378c,_0x252296);_0x412cd7(_0x252296);});});}exports[_0xba34('0x1d')]=function(_0x45aba3){var _0x304137=this;return new Promise(function(_0x59ea7b,_0x81f12e){return db[_0xba34('0x1e')]['findAll']({'raw':_0x45aba3[_0xba34('0x1f')]?_0x45aba3[_0xba34('0x1f')][_0xba34('0x20')]===undefined?!![]:![]:!![],'where':_0x45aba3['options']?_0x45aba3[_0xba34('0x1f')]['where']||null:null,'attributes':_0x45aba3[_0xba34('0x1f')]?_0x45aba3[_0xba34('0x1f')]['attributes']||null:null,'limit':_0x45aba3[_0xba34('0x1f')]?_0x45aba3[_0xba34('0x1f')][_0xba34('0x21')]||null:null,'include':_0x45aba3[_0xba34('0x1f')]?_0x45aba3[_0xba34('0x1f')]['include']?_[_0xba34('0x22')](_0x45aba3['options']['include'],function(_0x4dbed8){return{'model':db[_0x4dbed8[_0xba34('0x23')]],'as':_0x4dbed8['as'],'attributes':_0x4dbed8[_0xba34('0x24')],'include':_0x4dbed8[_0xba34('0x25')]?_[_0xba34('0x22')](_0x4dbed8['include'],function(_0x234a6e){return{'model':db[_0x234a6e[_0xba34('0x23')]],'as':_0x234a6e['as'],'attributes':_0x234a6e[_0xba34('0x24')],'include':_0x234a6e[_0xba34('0x25')]?_[_0xba34('0x22')](_0x234a6e[_0xba34('0x25')],function(_0x4ee97b){return{'model':db[_0x4ee97b[_0xba34('0x23')]],'as':_0x4ee97b['as'],'attributes':_0x4ee97b['attributes']};}):[]};}):[]};}):[]:[]})[_0xba34('0x12')](function(_0x2596c4){logger['info']('GetFaxAccount',_0x45aba3);logger[_0xba34('0x16')](_0xba34('0x1d'),_0x45aba3,JSON[_0xba34('0x18')](_0x2596c4));_0x59ea7b(_0x2596c4);})['catch'](function(_0x770fd8){logger['error'](_0xba34('0x1d'),_0x770fd8[_0xba34('0x1b')],_0x45aba3);_0x81f12e(_0x304137[_0xba34('0x19')](0x1f4,_0x770fd8[_0xba34('0x1b')]));});});};exports[_0xba34('0x26')]=function(_0x5280b3,_0x3fe8a1,_0xc725c1){var _0x2654c6=this;return new Promise(function(_0x5171f6,_0x90e55b){var _0x3a08dc={'body':_0x5280b3[_0xba34('0x27')],'channel':_0xba34('0x28')};var _0x4c4950=[];var _0x5c2e37=[];var _0x413fdc={};return db[_0xba34('0x29')][_0xba34('0x2a')]()[_0xba34('0x12')](function(_0xb99900){if(!_0xb99900){throw new db['Sequelize'][(_0xba34('0x2b'))](_0xba34('0x2c'));}_0x4c4950=_[_0xba34('0x2d')](_['keys'](_0xb99900),['createdAt',_0xba34('0x2e')]);_0x5c2e37=_[_0xba34('0x2d')](_[_0xba34('0x2f')](_0xb99900),['createdAt',_0xba34('0x2e'),_0xba34('0x30'),_0xba34('0x31')]);if(_0x5280b3[_0xba34('0x27')]['id']){delete _0x5280b3['body']['id'];}if(_['isNil'](_0x5280b3[_0xba34('0x27')][_0xba34('0x32')])){throw new db['Sequelize'][(_0xba34('0x2b'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x5280b3[_0xba34('0x27')][_0xba34('0x27')])||_0x5280b3['body']['body']===''){throw new db['Sequelize'][(_0xba34('0x2b'))](_0xba34('0x33'));}if(_[_0xba34('0x34')](_0x5280b3['body'][_0xba34('0x35')])){throw new db[(_0xba34('0x36'))][(_0xba34('0x2b'))](_0xba34('0x37')+_0x5c2e37);}if(!_[_0xba34('0x38')](_0x5c2e37,_0x5280b3[_0xba34('0x27')][_0xba34('0x35')])){throw new db['Sequelize'][(_0xba34('0x2b'))](_0xba34('0x39')+_0x5c2e37);}_0x413fdc[_0x5280b3[_0xba34('0x27')][_0xba34('0x35')]]=_0x5280b3[_0xba34('0x27')][_0xba34('0x32')];})[_0xba34('0x12')](function(){return db['FaxAccount'][_0xba34('0x3a')]({'where':{'id':_0x5280b3[_0xba34('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0xba34('0x3c'),'include':[{'model':db['CmContact'],'as':_0xba34('0x3d'),'where':_0x413fdc,'limit':0x1,'order':[[_0xba34('0x2e'),_0xba34('0x3e')]]}]},{'model':db[_0xba34('0x3f')],'as':_0xba34('0x40')}]});})[_0xba34('0x12')](function(_0x2557cf){if(_0x2557cf&&_0x2557cf[_0xba34('0x3c')]){var _0x11f38e=_0x2557cf['get']({'plain':!![]});_0x3a08dc[_0xba34('0x3b')]=_0x11f38e;_0x3a08dc[_0xba34('0x41')]=_0x11f38e[_0xba34('0x40')];_0x3a08dc['list']=_0x11f38e[_0xba34('0x3c')];_0x3a08dc[_0xba34('0x41')]=_['orderBy'](_0x3a08dc[_0xba34('0x41')],[_0xba34('0x42')],[_0xba34('0x43')]);if(_0x3a08dc[_0xba34('0x3b')]['Applications']){delete _0x3a08dc[_0xba34('0x3b')][_0xba34('0x40')];}if(_0x3a08dc['account']['List']&&_0x3a08dc['account'][_0xba34('0x3c')][_0xba34('0x3d')][_0xba34('0x44')]){return _0x3a08dc[_0xba34('0x3b')][_0xba34('0x3c')][_0xba34('0x3d')][0x0];}var _0x5e1f71=_[_0xba34('0xc')](_0x5280b3[_0xba34('0x27')],{'firstName':_0x5280b3['body'][_0xba34('0x32')],'ListId':_0x11f38e[_0xba34('0x31')]});_0x5e1f71[_0x5280b3[_0xba34('0x27')][_0xba34('0x35')]]=_0x5280b3[_0xba34('0x27')][_0xba34('0x32')];return db[_0xba34('0x29')]['create'](_0x5e1f71,{'fields':_0x4c4950,'raw':!![]});}})[_0xba34('0x12')](function(_0x1a1ee7){_0x3a08dc[_0xba34('0x45')]=_0x1a1ee7;if(_0x1a1ee7){var _0x1a4fc={'ContactId':_0x1a1ee7['id'],'FaxAccountId':_0x5280b3[_0xba34('0x3b')]['id'],'fax':_0x1a1ee7[_0xba34('0x28')]};return db[_0xba34('0x46')][_0xba34('0x3a')]({'where':{'ContactId':_0x1a1ee7['id'],'closed':![],'FaxAccountId':_0x5280b3[_0xba34('0x3b')]['id']}})[_0xba34('0x12')](function(_0x12e9dc){if(_0x12e9dc){return[_0x12e9dc,![]];}return db['FaxInteraction'][_0xba34('0x47')](_0x1a4fc)[_0xba34('0x12')](function(_0xdfea0a){return[_0xdfea0a,!![]];});});}else{throw new Error(_0xba34('0x48'));}})['spread'](function(_0x19689d,_0x5869dc){var _0x4c7392=_0x19689d[_0xba34('0x49')]({'plain':!![]});if(_0x5869dc){if(_0x3a08dc['account'][_0xba34('0x4a')]){_0x3a08dc[_0xba34('0x41')]['push']({'id':0x0,'priority':_0x3a08dc[_0xba34('0x41')][_0xba34('0x44')]+0x1,'app':_0xba34('0x4b'),'appdata':_0xba34('0x4c'),'interval':_0xba34('0x4d')});}_0x4c7392[_0xba34('0x4e')]=!![];}else{_0x4c7392[_0xba34('0x4e')]=![];}_0x3a08dc['interaction']=_0x4c7392;return db[_0xba34('0x4f')][_0xba34('0x47')]({'body':_0x5280b3[_0xba34('0x27')][_0xba34('0x27')],'FaxAccountId':_0x5280b3[_0xba34('0x3b')]['id'],'FaxInteractionId':_0x19689d['id'],'direction':'in','ContactId':_0x19689d[_0xba34('0x50')],'AttachmentId':_0x5280b3['body'][_0xba34('0x51')]});})[_0xba34('0x12')](function(_0x4ec598){_0x3a08dc[_0xba34('0x1b')]=_0x4ec598;if(_0x3a08dc['interaction']['UserId']){return db[_0xba34('0x52')]['find']({'attributes':['id',_0xba34('0x53')],'where':{'id':_0x3a08dc[_0xba34('0x54')]['UserId']}})[_0xba34('0x12')](function(_0x507d43){if(_0x507d43){_0x3a08dc[_0xba34('0x41')][_0xba34('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x507d43['name']+','+(_0x3a08dc['account']['waitForTheAssignedAgent']||0xa),'interval':_0xba34('0x4d')});}return respondWithRpcPromise(_0xba34('0x56'),_0xba34('0x57'),_0x3a08dc);});}return respondWithRpcPromise(_0xba34('0x56'),_0xba34('0x57'),_0x3a08dc);})[_0xba34('0x12')](function(_0x2e1c92){_0x5171f6(_0x2e1c92);})['catch'](function(_0x592a48){_0x90e55b(_0x2654c6['error'](0x1f4,_0x592a48[_0xba34('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index f487fe5..bcfdddd 100644 --- a/server/api/faxAccount/faxAccount.socket.js +++ b/server/api/faxAccount/faxAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e3f=['remove','register','faxAccount:','./faxAccount.events','save'];(function(_0x4b65f1,_0x3dfc92){var _0x4efedd=function(_0x2b42f9){while(--_0x2b42f9){_0x4b65f1['push'](_0x4b65f1['shift']());}};_0x4efedd(++_0x3dfc92);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var FaxAccountEvents=require(_0xf8e3('0x0'));var events=[_0xf8e3('0x1'),_0xf8e3('0x2'),'update'];function createListener(_0x3f3440,_0x292de5){return function(_0x3b07a5){_0x292de5['emit'](_0x3f3440,_0x3b07a5);};}function removeListener(_0x15d6ea,_0x41bc05){return function(){FaxAccountEvents['removeListener'](_0x15d6ea,_0x41bc05);};}exports[_0xf8e3('0x3')]=function(_0xb21f8d){for(var _0x2621c5=0x0,_0x1ee9f3=events['length'];_0x2621c5<_0x1ee9f3;_0x2621c5++){var _0x4504dd=events[_0x2621c5];var _0x2e39b7=createListener(_0xf8e3('0x4')+_0x4504dd,_0xb21f8d);FaxAccountEvents['on'](_0x4504dd,_0x2e39b7);}}; \ No newline at end of file +var _0xf2e3=['faxAccount:','./faxAccount.events','remove','update','emit','removeListener','length'];(function(_0xc3aae7,_0x3bfa91){var _0x1f365a=function(_0x465838){while(--_0x465838){_0xc3aae7['push'](_0xc3aae7['shift']());}};_0x1f365a(++_0x3bfa91);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xf2e3[_0x5f309e];return _0x487b5e;};'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 diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index cb0236d..9a81edc 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 _0xc745=['connect-timeout','express','Router','../../components/interaction/service','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getApplications','/:id/messages','getMessages','create','post','addDisposition','addInteraction','/:id/applications','addApplications','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','update','destroy','delete','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','path'];(function(_0x3bb947,_0x34b6f3){var _0x122b67=function(_0x49cf0a){while(--_0x49cf0a){_0x3bb947['push'](_0x3bb947['shift']());}};_0x122b67(++_0x34b6f3);}(_0xc745,0x11c));var _0x5c74=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc745[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x5c74('0x0'));var util=require(_0x5c74('0x1'));var path=require(_0x5c74('0x2'));var timeout=require(_0x5c74('0x3'));var express=require(_0x5c74('0x4'));var router=express[_0x5c74('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5c74('0x6'));var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0x5c74('0x7')]('/',auth['isAuthenticated'](),controller[_0x5c74('0x8')]);router['get'](_0x5c74('0x9'),auth['isAuthenticated'](),controller[_0x5c74('0xa')]);router[_0x5c74('0x7')](_0x5c74('0xb'),auth[_0x5c74('0xc')](),controller[_0x5c74('0xd')]);router['get'](_0x5c74('0xe'),auth[_0x5c74('0xc')](),controller[_0x5c74('0xf')]);router[_0x5c74('0x7')](_0x5c74('0x10'),auth[_0x5c74('0xc')](),controller[_0x5c74('0x11')]);router[_0x5c74('0x7')](_0x5c74('0x12'),auth[_0x5c74('0xc')](),controller['getInteractions']);router[_0x5c74('0x7')]('/:id/applications',auth[_0x5c74('0xc')](),controller[_0x5c74('0x13')]);router[_0x5c74('0x7')](_0x5c74('0x14'),auth[_0x5c74('0xc')](),controller[_0x5c74('0x15')]);router['get']('/:id/users',auth[_0x5c74('0xc')](),controller['getAgents']);router['post']('/',auth[_0x5c74('0xc')](),controller[_0x5c74('0x16')]);router[_0x5c74('0x17')](_0x5c74('0xe'),auth[_0x5c74('0xc')](),controller[_0x5c74('0x18')]);router[_0x5c74('0x17')](_0x5c74('0x10'),auth[_0x5c74('0xc')](),controller['addAnswer']);router['post']('/:id/interactions',auth[_0x5c74('0xc')](),controller[_0x5c74('0x19')]);router[_0x5c74('0x17')](_0x5c74('0x1a'),auth['isAuthenticated'](),controller[_0x5c74('0x1b')]);router[_0x5c74('0x17')]('/addaccountapplications',auth[_0x5c74('0xc')](),controller[_0x5c74('0x1c')]);router[_0x5c74('0x17')]('/updateaccountapplications',auth[_0x5c74('0xc')](),controller[_0x5c74('0x1d')]);router['post'](_0x5c74('0x1e'),auth[_0x5c74('0xc')](),controller[_0x5c74('0x1f')]);router['post']('/:id/users',auth[_0x5c74('0xc')](),controller[_0x5c74('0x20')]);router['put'](_0x5c74('0xb'),auth[_0x5c74('0xc')](),controller[_0x5c74('0x21')]);router['delete'](_0x5c74('0xb'),auth[_0x5c74('0xc')](),controller[_0x5c74('0x22')]);router[_0x5c74('0x23')](_0x5c74('0xe'),auth[_0x5c74('0xc')](),controller[_0x5c74('0x24')]);router[_0x5c74('0x23')](_0x5c74('0x10'),auth['isAuthenticated'](),controller[_0x5c74('0x25')]);router['delete'](_0x5c74('0x26'),auth['isAuthenticated'](),controller[_0x5c74('0x27')]);module[_0x5c74('0x28')]=router; \ No newline at end of file +var _0x4b31=['get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','post','create','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x1eda18,_0x2ec45d){var _0x4f6b41=function(_0x5f3cbe){while(--_0x5f3cbe){_0x1eda18['push'](_0x1eda18['shift']());}};_0x4f6b41(++_0x2ec45d);}(_0x4b31,0x12a));var _0x14b3=function(_0x1a3ce1,_0x40ed90){_0x1a3ce1=_0x1a3ce1-0x0;var _0x24aaae=_0x4b31[_0x1a3ce1];return _0x24aaae;};'use strict';var multer=require('multer');var util=require(_0x14b3('0x0'));var path=require('path');var timeout=require(_0x14b3('0x1'));var express=require(_0x14b3('0x2'));var router=express[_0x14b3('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x14b3('0x4'));var config=require(_0x14b3('0x5'));var controller=require('./faxAccount.controller');router[_0x14b3('0x6')]('/',auth[_0x14b3('0x7')](),controller[_0x14b3('0x8')]);router[_0x14b3('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x14b3('0x9')]);router[_0x14b3('0x6')](_0x14b3('0xa'),auth['isAuthenticated'](),controller[_0x14b3('0xb')]);router[_0x14b3('0x6')](_0x14b3('0xc'),auth['isAuthenticated'](),controller[_0x14b3('0xd')]);router[_0x14b3('0x6')](_0x14b3('0xe'),auth[_0x14b3('0x7')](),controller[_0x14b3('0xf')]);router[_0x14b3('0x6')](_0x14b3('0x10'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x14b3('0x6')](_0x14b3('0x11'),auth[_0x14b3('0x7')](),controller[_0x14b3('0x12')]);router[_0x14b3('0x6')](_0x14b3('0x13'),auth[_0x14b3('0x7')](),controller[_0x14b3('0x14')]);router[_0x14b3('0x6')](_0x14b3('0x15'),auth[_0x14b3('0x7')](),controller['getAgents']);router[_0x14b3('0x16')]('/',auth['isAuthenticated'](),controller[_0x14b3('0x17')]);router[_0x14b3('0x16')](_0x14b3('0xc'),auth[_0x14b3('0x7')](),controller[_0x14b3('0x18')]);router[_0x14b3('0x16')](_0x14b3('0xe'),auth[_0x14b3('0x7')](),controller[_0x14b3('0x19')]);router['post'](_0x14b3('0x10'),auth[_0x14b3('0x7')](),controller[_0x14b3('0x1a')]);router[_0x14b3('0x16')]('/:id/applications',auth[_0x14b3('0x7')](),controller[_0x14b3('0x1b')]);router[_0x14b3('0x16')](_0x14b3('0x1c'),auth[_0x14b3('0x7')](),controller[_0x14b3('0x1d')]);router['post'](_0x14b3('0x1e'),auth[_0x14b3('0x7')](),controller['updateAccountApplications']);router[_0x14b3('0x16')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x14b3('0x16')](_0x14b3('0x15'),auth['isAuthenticated'](),controller[_0x14b3('0x1f')]);router['put'](_0x14b3('0xa'),auth[_0x14b3('0x7')](),controller[_0x14b3('0x20')]);router[_0x14b3('0x21')](_0x14b3('0xa'),auth[_0x14b3('0x7')](),controller[_0x14b3('0x22')]);router[_0x14b3('0x21')](_0x14b3('0xc'),auth[_0x14b3('0x7')](),controller[_0x14b3('0x23')]);router['delete'](_0x14b3('0xe'),auth[_0x14b3('0x7')](),controller[_0x14b3('0x24')]);router[_0x14b3('0x21')](_0x14b3('0x15'),auth[_0x14b3('0x7')](),controller[_0x14b3('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 6288ec4..e9f3e04 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 _0xd159=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x46aa76,_0x3b80d6){var _0x101246=function(_0x22c682){while(--_0x22c682){_0x46aa76['push'](_0x46aa76['shift']());}};_0x101246(++_0x3b80d6);}(_0xd159,0x19d));var _0x9d15=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd159[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x9d15('0x0'));module[_0x9d15('0x1')]={'priority':{'type':Sequelize[_0x9d15('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9d15('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9d15('0x4')]()},'description':{'type':Sequelize[_0x9d15('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9d15('0x5')}}; \ No newline at end of file +var _0x186d=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x2647d4,_0xbde0c2){var _0x365670=function(_0x2dc8f5){while(--_0x2dc8f5){_0x2647d4['push'](_0x2647d4['shift']());}};_0x365670(++_0xbde0c2);}(_0x186d,0x1ca));var _0xd186=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0x186d[_0x4df6f9];return _0x4b1a73;};'use strict';var Sequelize=require('sequelize');module[_0xd186('0x0')]={'priority':{'type':Sequelize[_0xd186('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd186('0x2')],'allowNull':![],'defaultValue':_0xd186('0x3')},'appdata':{'type':Sequelize[_0xd186('0x4')]()},'description':{'type':Sequelize[_0xd186('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd186('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 300fe50..37cf96d 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 _0x03ce=['name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','FaxApplication','findAll','catch','show','find','create','body','params','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','update','then','error','stack'];(function(_0x5713b5,_0x423f83){var _0x2f795d=function(_0x392aea){while(--_0x392aea){_0x5713b5['push'](_0x5713b5['shift']());}};_0x2f795d(++_0x423f83);}(_0x03ce,0x1a1));var _0xe03c=function(_0x2a8140,_0x24b053){_0x2a8140=_0x2a8140-0x0;var _0x124da5=_0x03ce[_0x2a8140];return _0x124da5;};'use strict';var pdf=require(_0xe03c('0x0'));var emlformat=require(_0xe03c('0x1'));var rimraf=require(_0xe03c('0x2'));var zipdir=require(_0xe03c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe03c('0x4'));var moment=require(_0xe03c('0x5'));var BPromise=require(_0xe03c('0x6'));var Mustache=require('mustache');var util=require(_0xe03c('0x7'));var path=require(_0xe03c('0x8'));var sox=require(_0xe03c('0x9'));var csv=require(_0xe03c('0xa'));var ejs=require(_0xe03c('0xb'));var fs=require('fs');var _=require(_0xe03c('0xc'));var squel=require(_0xe03c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe03c('0xe'));var toCsv=require(_0xe03c('0xa'));var querystring=require(_0xe03c('0xf'));var Papa=require(_0xe03c('0x10'));var Redis=require(_0xe03c('0x11'));var authService=require(_0xe03c('0x12'));var qs=require(_0xe03c('0x13'));var as=require(_0xe03c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe03c('0x15'))(_0xe03c('0x16'));var utils=require(_0xe03c('0x17'));var config=require('../../config/environment');var db=require(_0xe03c('0x18'))['db'];function respondWithStatusCode(_0x116bfd,_0x4d8249){_0x4d8249=_0x4d8249||0xcc;return function(_0x27838b){if(_0x27838b){return _0x116bfd[_0xe03c('0x19')](_0x4d8249);}return _0x116bfd['status'](_0x4d8249)[_0xe03c('0x1a')]();};}function respondWithResult(_0xacd30d,_0x25a5e9){_0x25a5e9=_0x25a5e9||0xc8;return function(_0x4f7139){if(_0x4f7139){return _0xacd30d[_0xe03c('0x1b')](_0x25a5e9)[_0xe03c('0x1c')](_0x4f7139);}};}function respondWithFilteredResult(_0x35856c,_0x408a8f){return function(_0x417a9e){if(_0x417a9e){var _0x54b705=_0x417a9e[_0xe03c('0x1d')],_0x3d6287=_0x408a8f[_0xe03c('0x1e')],_0x584cb6=_0x408a8f[_0xe03c('0x1e')]+_0x408a8f['limit'],_0x4887ad;if(_0x584cb6>=_0x54b705){_0x584cb6=_0x54b705;_0x4887ad=0xc8;}else{_0x4887ad=0xce;}_0x35856c['status'](_0x4887ad);return _0x35856c[_0xe03c('0x1f')](_0xe03c('0x20'),_0x3d6287+'-'+_0x584cb6+'/'+_0x54b705)['json'](_0x417a9e);}return null;};}function patchUpdates(_0x2b33b3){return function(_0x1ac79b){try{jsonpatch[_0xe03c('0x21')](_0x1ac79b,_0x2b33b3,!![]);}catch(_0x5a808d){return BPromise['reject'](_0x5a808d);}return _0x1ac79b[_0xe03c('0x22')]();};}function saveUpdates(_0x108acd,_0x3bf505){return function(_0x4741ed){if(_0x4741ed){return _0x4741ed[_0xe03c('0x23')](_0x108acd)[_0xe03c('0x24')](function(_0x28a82e){return _0x28a82e;});}return null;};}function removeEntity(_0x28d210,_0x4c9597){return function(_0x1cbf9f){if(_0x1cbf9f){return _0x1cbf9f['destroy']()[_0xe03c('0x24')](function(){_0x28d210[_0xe03c('0x1b')](0xcc)[_0xe03c('0x1a')]();});}};}function handleEntityNotFound(_0x28ac91,_0x3afdea){return function(_0x95a4b3){if(!_0x95a4b3){_0x28ac91[_0xe03c('0x19')](0x194);}return _0x95a4b3;};}function handleError(_0x55605d,_0x37c3cb){_0x37c3cb=_0x37c3cb||0x1f4;return function(_0x410d82){logger[_0xe03c('0x25')](_0x410d82[_0xe03c('0x26')]);if(_0x410d82[_0xe03c('0x27')]){delete _0x410d82[_0xe03c('0x27')];}_0x55605d[_0xe03c('0x1b')](_0x37c3cb)[_0xe03c('0x28')](_0x410d82);};}exports[_0xe03c('0x29')]=function(_0x1f9171,_0xc8aecb){var _0x234d64={},_0x208e0e={},_0x5e09b1={'count':0x0,'rows':[]};var _0xbfb6bb=_[_0xe03c('0x2a')](db['FaxApplication'][_0xe03c('0x2b')],function(_0x4c0618){return{'name':_0x4c0618[_0xe03c('0x2c')],'type':_0x4c0618[_0xe03c('0x2d')][_0xe03c('0x2e')]};});_0x208e0e[_0xe03c('0x2f')]=_[_0xe03c('0x2a')](_0xbfb6bb,_0xe03c('0x27'));_0x208e0e[_0xe03c('0x30')]=_[_0xe03c('0x31')](_0x1f9171['query']);_0x208e0e[_0xe03c('0x32')]=_[_0xe03c('0x33')](_0x208e0e[_0xe03c('0x2f')],_0x208e0e[_0xe03c('0x30')]);_0x234d64[_0xe03c('0x34')]=_['intersection'](_0x208e0e[_0xe03c('0x2f')],qs[_0xe03c('0x35')](_0x1f9171[_0xe03c('0x30')][_0xe03c('0x35')]));_0x234d64[_0xe03c('0x34')]=_0x234d64[_0xe03c('0x34')][_0xe03c('0x36')]?_0x234d64[_0xe03c('0x34')]:_0x208e0e[_0xe03c('0x2f')];if(!_0x1f9171[_0xe03c('0x30')][_0xe03c('0x37')](_0xe03c('0x38'))){_0x234d64[_0xe03c('0x39')]=qs[_0xe03c('0x39')](_0x1f9171[_0xe03c('0x30')][_0xe03c('0x39')]);_0x234d64[_0xe03c('0x1e')]=qs['offset'](_0x1f9171[_0xe03c('0x30')][_0xe03c('0x1e')]);}_0x234d64[_0xe03c('0x3a')]=qs[_0xe03c('0x3b')](_0x1f9171['query'][_0xe03c('0x3b')]);_0x234d64['where']=qs['filters'](_[_0xe03c('0x3c')](_0x1f9171[_0xe03c('0x30')],_0x208e0e[_0xe03c('0x32')]));if(_0x1f9171[_0xe03c('0x30')]['filter']){_0x234d64[_0xe03c('0x3d')]=_[_0xe03c('0x3e')](_0x234d64['where'],{'$or':_['map'](_0xbfb6bb,function(_0x486953){if(_0x486953['type']!==_0xe03c('0x3f')){var _0x516700={};_0x516700[_0x486953[_0xe03c('0x27')]]={'$like':'%'+_0x1f9171['query']['filter']+'%'};return _0x516700;}})});}_0x234d64=_[_0xe03c('0x3e')]({},_0x234d64,_0x1f9171[_0xe03c('0x40')]);var _0x357fa2={'where':_0x234d64[_0xe03c('0x3d')]};return db['FaxApplication'][_0xe03c('0x1d')](_0x357fa2)['then'](function(_0x3df044){_0x5e09b1[_0xe03c('0x1d')]=_0x3df044;if(_0x1f9171[_0xe03c('0x30')][_0xe03c('0x41')]){_0x234d64[_0xe03c('0x42')]=[{'all':!![]}];}return db[_0xe03c('0x43')][_0xe03c('0x44')](_0x234d64);})['then'](function(_0xc5fb8c){_0x5e09b1['rows']=_0xc5fb8c;return _0x5e09b1;})[_0xe03c('0x24')](respondWithFilteredResult(_0xc8aecb,_0x234d64))[_0xe03c('0x45')](handleError(_0xc8aecb,null));};exports[_0xe03c('0x46')]=function(_0x504fa5,_0x2b796b){var _0x1fa14d={'raw':!![],'where':{'id':_0x504fa5['params']['id']}},_0x4b4adc={};_0x4b4adc['model']=_[_0xe03c('0x31')](db[_0xe03c('0x43')]['rawAttributes']);_0x4b4adc[_0xe03c('0x30')]=_[_0xe03c('0x31')](_0x504fa5[_0xe03c('0x30')]);_0x4b4adc[_0xe03c('0x32')]=_['intersection'](_0x4b4adc[_0xe03c('0x2f')],_0x4b4adc[_0xe03c('0x30')]);_0x1fa14d[_0xe03c('0x34')]=_[_0xe03c('0x33')](_0x4b4adc[_0xe03c('0x2f')],qs[_0xe03c('0x35')](_0x504fa5['query'][_0xe03c('0x35')]));_0x1fa14d[_0xe03c('0x34')]=_0x1fa14d[_0xe03c('0x34')]['length']?_0x1fa14d['attributes']:_0x4b4adc[_0xe03c('0x2f')];if(_0x504fa5['query']['includeAll']){_0x1fa14d[_0xe03c('0x42')]=[{'all':!![]}];}_0x1fa14d=_[_0xe03c('0x3e')]({},_0x1fa14d,_0x504fa5['options']);return db[_0xe03c('0x43')][_0xe03c('0x47')](_0x1fa14d)[_0xe03c('0x24')](handleEntityNotFound(_0x2b796b,null))[_0xe03c('0x24')](respondWithResult(_0x2b796b,null))['catch'](handleError(_0x2b796b,null));};exports[_0xe03c('0x48')]=function(_0x4e3e47,_0x52388){return db[_0xe03c('0x43')][_0xe03c('0x48')](_0x4e3e47[_0xe03c('0x49')],{})['then'](respondWithResult(_0x52388,0xc9))[_0xe03c('0x45')](handleError(_0x52388,null));};exports['update']=function(_0x44ff92,_0x2e47f2){if(_0x44ff92['body']['id']){delete _0x44ff92[_0xe03c('0x49')]['id'];}return db[_0xe03c('0x43')][_0xe03c('0x47')]({'where':{'id':_0x44ff92[_0xe03c('0x4a')]['id']}})[_0xe03c('0x24')](handleEntityNotFound(_0x2e47f2,null))[_0xe03c('0x24')](saveUpdates(_0x44ff92[_0xe03c('0x49')],null))[_0xe03c('0x24')](respondWithResult(_0x2e47f2,null))[_0xe03c('0x45')](handleError(_0x2e47f2,null));};exports[_0xe03c('0x4b')]=function(_0x14fa31,_0x246ae4){return db[_0xe03c('0x43')][_0xe03c('0x47')]({'where':{'id':_0x14fa31[_0xe03c('0x4a')]['id']}})[_0xe03c('0x24')](handleEntityNotFound(_0x246ae4,null))['then'](removeEntity(_0x246ae4,null))[_0xe03c('0x45')](handleError(_0x246ae4,null));}; \ No newline at end of file +var _0xbdfd=['keys','create','body','find','params','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FaxApplication','findAll','catch','show'];(function(_0xcb51e0,_0x33b43f){var _0x177bfa=function(_0x3253de){while(--_0x3253de){_0xcb51e0['push'](_0xcb51e0['shift']());}};_0x177bfa(++_0x33b43f);}(_0xbdfd,0x135));var _0xdbdf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbdfd[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0xdbdf('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdbdf('0x1'));var jsonpatch=require(_0xdbdf('0x2'));var rp=require(_0xdbdf('0x3'));var moment=require(_0xdbdf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdbdf('0x5'));var util=require(_0xdbdf('0x6'));var path=require('path');var sox=require(_0xdbdf('0x7'));var csv=require(_0xdbdf('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdbdf('0x9'));var squel=require(_0xdbdf('0xa'));var crypto=require(_0xdbdf('0xb'));var jsforce=require(_0xdbdf('0xc'));var deskjs=require(_0xdbdf('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdbdf('0xe'));var Papa=require(_0xdbdf('0xf'));var Redis=require(_0xdbdf('0x10'));var authService=require(_0xdbdf('0x11'));var qs=require(_0xdbdf('0x12'));var as=require(_0xdbdf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdbdf('0x14'));var utils=require(_0xdbdf('0x15'));var config=require(_0xdbdf('0x16'));var db=require(_0xdbdf('0x17'))['db'];function respondWithStatusCode(_0x3dccaf,_0x244ecd){_0x244ecd=_0x244ecd||0xcc;return function(_0x51212c){if(_0x51212c){return _0x3dccaf[_0xdbdf('0x18')](_0x244ecd);}return _0x3dccaf[_0xdbdf('0x19')](_0x244ecd)[_0xdbdf('0x1a')]();};}function respondWithResult(_0xc1de13,_0x45b824){_0x45b824=_0x45b824||0xc8;return function(_0x24dfde){if(_0x24dfde){return _0xc1de13[_0xdbdf('0x19')](_0x45b824)['json'](_0x24dfde);}};}function respondWithFilteredResult(_0x3f38c8,_0x127060){return function(_0x98c104){if(_0x98c104){var _0x173a18=_0x98c104[_0xdbdf('0x1b')],_0x216c58=_0x127060[_0xdbdf('0x1c')],_0x50dbaa=_0x127060[_0xdbdf('0x1c')]+_0x127060[_0xdbdf('0x1d')],_0x219aa3;if(_0x50dbaa>=_0x173a18){_0x50dbaa=_0x173a18;_0x219aa3=0xc8;}else{_0x219aa3=0xce;}_0x3f38c8[_0xdbdf('0x19')](_0x219aa3);return _0x3f38c8[_0xdbdf('0x1e')](_0xdbdf('0x1f'),_0x216c58+'-'+_0x50dbaa+'/'+_0x173a18)[_0xdbdf('0x20')](_0x98c104);}return null;};}function patchUpdates(_0x3e70fd){return function(_0x419e9d){try{jsonpatch[_0xdbdf('0x21')](_0x419e9d,_0x3e70fd,!![]);}catch(_0x4fce88){return BPromise[_0xdbdf('0x22')](_0x4fce88);}return _0x419e9d[_0xdbdf('0x23')]();};}function saveUpdates(_0x3f522c,_0x2b6fe3){return function(_0x1670b3){if(_0x1670b3){return _0x1670b3[_0xdbdf('0x24')](_0x3f522c)[_0xdbdf('0x25')](function(_0x6f6585){return _0x6f6585;});}return null;};}function removeEntity(_0x4a93dd,_0x44d1d2){return function(_0x2737e5){if(_0x2737e5){return _0x2737e5[_0xdbdf('0x26')]()[_0xdbdf('0x25')](function(){_0x4a93dd['status'](0xcc)[_0xdbdf('0x1a')]();});}};}function handleEntityNotFound(_0x3f02b8,_0x237d86){return function(_0x563628){if(!_0x563628){_0x3f02b8[_0xdbdf('0x18')](0x194);}return _0x563628;};}function handleError(_0xf5c8a6,_0x45f868){_0x45f868=_0x45f868||0x1f4;return function(_0x16fc97){logger['error'](_0x16fc97[_0xdbdf('0x27')]);if(_0x16fc97[_0xdbdf('0x28')]){delete _0x16fc97[_0xdbdf('0x28')];}_0xf5c8a6[_0xdbdf('0x19')](_0x45f868)[_0xdbdf('0x29')](_0x16fc97);};}exports[_0xdbdf('0x2a')]=function(_0x2dac85,_0x3a7e6f){var _0x353fb1={},_0x3d0ad1={},_0x486fea={'count':0x0,'rows':[]};var _0x5c09e4=_[_0xdbdf('0x2b')](db['FaxApplication'][_0xdbdf('0x2c')],function(_0xfa1cd9){return{'name':_0xfa1cd9[_0xdbdf('0x2d')],'type':_0xfa1cd9[_0xdbdf('0x2e')][_0xdbdf('0x2f')]};});_0x3d0ad1[_0xdbdf('0x30')]=_[_0xdbdf('0x2b')](_0x5c09e4,_0xdbdf('0x28'));_0x3d0ad1[_0xdbdf('0x31')]=_['keys'](_0x2dac85[_0xdbdf('0x31')]);_0x3d0ad1[_0xdbdf('0x32')]=_['intersection'](_0x3d0ad1[_0xdbdf('0x30')],_0x3d0ad1[_0xdbdf('0x31')]);_0x353fb1[_0xdbdf('0x33')]=_[_0xdbdf('0x34')](_0x3d0ad1[_0xdbdf('0x30')],qs['fields'](_0x2dac85[_0xdbdf('0x31')][_0xdbdf('0x35')]));_0x353fb1['attributes']=_0x353fb1[_0xdbdf('0x33')][_0xdbdf('0x36')]?_0x353fb1[_0xdbdf('0x33')]:_0x3d0ad1[_0xdbdf('0x30')];if(!_0x2dac85[_0xdbdf('0x31')][_0xdbdf('0x37')](_0xdbdf('0x38'))){_0x353fb1['limit']=qs['limit'](_0x2dac85['query'][_0xdbdf('0x1d')]);_0x353fb1['offset']=qs[_0xdbdf('0x1c')](_0x2dac85['query']['offset']);}_0x353fb1[_0xdbdf('0x39')]=qs[_0xdbdf('0x3a')](_0x2dac85[_0xdbdf('0x31')][_0xdbdf('0x3a')]);_0x353fb1[_0xdbdf('0x3b')]=qs[_0xdbdf('0x32')](_[_0xdbdf('0x3c')](_0x2dac85['query'],_0x3d0ad1[_0xdbdf('0x32')]));if(_0x2dac85[_0xdbdf('0x31')][_0xdbdf('0x3d')]){_0x353fb1[_0xdbdf('0x3b')]=_[_0xdbdf('0x3e')](_0x353fb1[_0xdbdf('0x3b')],{'$or':_[_0xdbdf('0x2b')](_0x5c09e4,function(_0x1bb441){if(_0x1bb441['type']!==_0xdbdf('0x3f')){var _0x1f404c={};_0x1f404c[_0x1bb441['name']]={'$like':'%'+_0x2dac85[_0xdbdf('0x31')][_0xdbdf('0x3d')]+'%'};return _0x1f404c;}})});}_0x353fb1=_[_0xdbdf('0x3e')]({},_0x353fb1,_0x2dac85[_0xdbdf('0x40')]);var _0x555c2d={'where':_0x353fb1[_0xdbdf('0x3b')]};return db['FaxApplication'][_0xdbdf('0x1b')](_0x555c2d)['then'](function(_0x4ee97c){_0x486fea[_0xdbdf('0x1b')]=_0x4ee97c;if(_0x2dac85['query'][_0xdbdf('0x41')]){_0x353fb1[_0xdbdf('0x42')]=[{'all':!![]}];}return db[_0xdbdf('0x43')][_0xdbdf('0x44')](_0x353fb1);})[_0xdbdf('0x25')](function(_0x3c9ae1){_0x486fea['rows']=_0x3c9ae1;return _0x486fea;})['then'](respondWithFilteredResult(_0x3a7e6f,_0x353fb1))[_0xdbdf('0x45')](handleError(_0x3a7e6f,null));};exports[_0xdbdf('0x46')]=function(_0x1dd368,_0x2e2d4e){var _0x548374={'raw':!![],'where':{'id':_0x1dd368['params']['id']}},_0x32eb76={};_0x32eb76[_0xdbdf('0x30')]=_[_0xdbdf('0x47')](db[_0xdbdf('0x43')][_0xdbdf('0x2c')]);_0x32eb76[_0xdbdf('0x31')]=_['keys'](_0x1dd368[_0xdbdf('0x31')]);_0x32eb76[_0xdbdf('0x32')]=_['intersection'](_0x32eb76[_0xdbdf('0x30')],_0x32eb76['query']);_0x548374[_0xdbdf('0x33')]=_['intersection'](_0x32eb76[_0xdbdf('0x30')],qs['fields'](_0x1dd368[_0xdbdf('0x31')][_0xdbdf('0x35')]));_0x548374[_0xdbdf('0x33')]=_0x548374[_0xdbdf('0x33')][_0xdbdf('0x36')]?_0x548374[_0xdbdf('0x33')]:_0x32eb76[_0xdbdf('0x30')];if(_0x1dd368[_0xdbdf('0x31')][_0xdbdf('0x41')]){_0x548374[_0xdbdf('0x42')]=[{'all':!![]}];}_0x548374=_[_0xdbdf('0x3e')]({},_0x548374,_0x1dd368['options']);return db[_0xdbdf('0x43')]['find'](_0x548374)[_0xdbdf('0x25')](handleEntityNotFound(_0x2e2d4e,null))[_0xdbdf('0x25')](respondWithResult(_0x2e2d4e,null))[_0xdbdf('0x45')](handleError(_0x2e2d4e,null));};exports[_0xdbdf('0x48')]=function(_0x3b0fc3,_0x497db9){return db[_0xdbdf('0x43')][_0xdbdf('0x48')](_0x3b0fc3['body'],{})[_0xdbdf('0x25')](respondWithResult(_0x497db9,0xc9))['catch'](handleError(_0x497db9,null));};exports[_0xdbdf('0x24')]=function(_0x446ca5,_0x537247){if(_0x446ca5[_0xdbdf('0x49')]['id']){delete _0x446ca5[_0xdbdf('0x49')]['id'];}return db[_0xdbdf('0x43')][_0xdbdf('0x4a')]({'where':{'id':_0x446ca5[_0xdbdf('0x4b')]['id']}})[_0xdbdf('0x25')](handleEntityNotFound(_0x537247,null))[_0xdbdf('0x25')](saveUpdates(_0x446ca5[_0xdbdf('0x49')],null))[_0xdbdf('0x25')](respondWithResult(_0x537247,null))[_0xdbdf('0x45')](handleError(_0x537247,null));};exports['destroy']=function(_0x9db6e7,_0x40cbb4){return db[_0xdbdf('0x43')][_0xdbdf('0x4a')]({'where':{'id':_0x9db6e7[_0xdbdf('0x4b')]['id']}})[_0xdbdf('0x25')](handleEntityNotFound(_0x40cbb4,null))[_0xdbdf('0x25')](removeEntity(_0x40cbb4,null))[_0xdbdf('0x45')](handleError(_0x40cbb4,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index a71a991..702cce4 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 _0xcbdf=['api','moment','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1249f4,_0x27226c){var _0x47c8a9=function(_0x2d9917){while(--_0x2d9917){_0x1249f4['push'](_0x1249f4['shift']());}};_0x47c8a9(++_0x27226c);}(_0xcbdf,0xcb));var _0xfcbd=function(_0x232ee7,_0x1f4ac3){_0x232ee7=_0x232ee7-0x0;var _0xab373f=_0xcbdf[_0x232ee7];return _0xab373f;};'use strict';var _=require(_0xfcbd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfcbd('0x1'));var moment=require(_0xfcbd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfcbd('0x3'));var rimraf=require(_0xfcbd('0x4'));var config=require(_0xfcbd('0x5'));var attributes=require(_0xfcbd('0x6'));module[_0xfcbd('0x7')]=function(_0x19738f,_0x3a1de9){return _0x19738f[_0xfcbd('0x8')]('FaxApplication',attributes,{'tableName':_0xfcbd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfcbd('0xa'),'collate':_0xfcbd('0xb')});}; \ No newline at end of file +var _0x89f9=['moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0x89f9,0x164));var _0x989f=function(_0x5d0fe9,_0x313c6d){_0x5d0fe9=_0x5d0fe9-0x0;var _0x578105=_0x89f9[_0x5d0fe9];return _0x578105;};'use strict';var _=require(_0x989f('0x0'));var util=require(_0x989f('0x1'));var logger=require(_0x989f('0x2'))(_0x989f('0x3'));var moment=require(_0x989f('0x4'));var BPromise=require(_0x989f('0x5'));var rp=require(_0x989f('0x6'));var fs=require('fs');var path=require(_0x989f('0x7'));var rimraf=require('rimraf');var config=require(_0x989f('0x8'));var attributes=require(_0x989f('0x9'));module['exports']=function(_0x3cdf66,_0x49fac5){return _0x3cdf66[_0x989f('0xa')](_0x989f('0xb'),attributes,{'tableName':_0x989f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x989f('0xd'),'collate':_0x989f('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 8786ea8..3802a52 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 _0x8c0b=['FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','update','body','options','raw','where','limit','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','FaxApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c0b,0xa0));var _0xb8c0=function(_0x525c91,_0x44015d){_0x525c91=_0x525c91-0x0;var _0x49d9d8=_0x8c0b[_0x525c91];return _0x49d9d8;};'use strict';var _=require(_0xb8c0('0x0'));var util=require(_0xb8c0('0x1'));var moment=require(_0xb8c0('0x2'));var BPromise=require(_0xb8c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb8c0('0x4'));var db=require(_0xb8c0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb8c0('0x6'));var config=require(_0xb8c0('0x7'));var jayson=require(_0xb8c0('0x8'));var client=jayson[_0xb8c0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x131ca5,_0x27aedd,_0x2c3883){return new BPromise(function(_0x1fd534,_0x179cb8){return client[_0xb8c0('0xa')](_0x131ca5,_0x2c3883)['then'](function(_0x59c1a2){logger['info'](_0xb8c0('0xb'),_0x27aedd,_0xb8c0('0xc'));logger[_0xb8c0('0xd')](_0xb8c0('0xe'),_0x27aedd,_0xb8c0('0xc'),JSON[_0xb8c0('0xf')](_0x59c1a2));if(_0x59c1a2[_0xb8c0('0x10')]){if(_0x59c1a2['error'][_0xb8c0('0x11')]===0x1f4){logger['error'](_0xb8c0('0xb'),_0x27aedd,_0x59c1a2[_0xb8c0('0x10')]['message']);return _0x179cb8(_0x59c1a2[_0xb8c0('0x10')][_0xb8c0('0x12')]);}logger[_0xb8c0('0x10')](_0xb8c0('0xb'),_0x27aedd,_0x59c1a2[_0xb8c0('0x10')][_0xb8c0('0x12')]);return _0x1fd534(_0x59c1a2['error']['message']);}else{logger['info'](_0xb8c0('0xb'),_0x27aedd,_0xb8c0('0xc'));_0x1fd534(_0x59c1a2[_0xb8c0('0x13')]['message']);}})[_0xb8c0('0x14')](function(_0x358b47){logger[_0xb8c0('0x10')]('FaxApplication,\x20%s,\x20%s',_0x27aedd,_0x358b47);_0x179cb8(_0x358b47);});});}exports[_0xb8c0('0x15')]=function(_0x2740c2){var _0x29d520=this;return new Promise(function(_0xb44b8,_0x280914){return db['FaxApplication'][_0xb8c0('0x16')](_0x2740c2[_0xb8c0('0x17')],{'raw':_0x2740c2[_0xb8c0('0x18')]?_0x2740c2[_0xb8c0('0x18')][_0xb8c0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2740c2[_0xb8c0('0x18')]?_0x2740c2[_0xb8c0('0x18')][_0xb8c0('0x1a')]||null:null,'attributes':_0x2740c2[_0xb8c0('0x18')]?_0x2740c2[_0xb8c0('0x18')]['attributes']||null:null,'limit':_0x2740c2['options']?_0x2740c2['options'][_0xb8c0('0x1b')]||null:null})[_0xb8c0('0x1c')](function(_0x3a2a0c){logger['info'](_0xb8c0('0x15'),_0x2740c2);logger[_0xb8c0('0xd')](_0xb8c0('0x15'),_0x2740c2,JSON[_0xb8c0('0xf')](_0x3a2a0c));_0xb44b8(_0x3a2a0c);})[_0xb8c0('0x14')](function(_0x1bc9bf){logger[_0xb8c0('0x10')](_0xb8c0('0x15'),_0x1bc9bf[_0xb8c0('0x12')],_0x2740c2);_0x280914(_0x29d520[_0xb8c0('0x10')](0x1f4,_0x1bc9bf[_0xb8c0('0x12')]));});});}; \ No newline at end of file +var _0x9901=['body','options','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','update'];(function(_0x1a1c2,_0x1a4a70){var _0x433b22=function(_0x2961c6){while(--_0x2961c6){_0x1a1c2['push'](_0x1a1c2['shift']());}};_0x433b22(++_0x1a4a70);}(_0x9901,0x16f));var _0x1990=function(_0x216e72,_0x5cd161){_0x216e72=_0x216e72-0x0;var _0x2ff28d=_0x9901[_0x216e72];return _0x2ff28d;};'use strict';var _=require(_0x1990('0x0'));var util=require('util');var moment=require(_0x1990('0x1'));var BPromise=require('bluebird');var rs=require(_0x1990('0x2'));var fs=require('fs');var Redis=require(_0x1990('0x3'));var db=require(_0x1990('0x4'))['db'];var utils=require(_0x1990('0x5'));var logger=require(_0x1990('0x6'))(_0x1990('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1990('0x8')][_0x1990('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a5856,_0x251b76,_0x3d93e1){return new BPromise(function(_0x11d324,_0x5b89f8){return client[_0x1990('0xa')](_0x1a5856,_0x3d93e1)[_0x1990('0xb')](function(_0x45b708){logger[_0x1990('0xc')](_0x1990('0xd'),_0x251b76,_0x1990('0xe'));logger[_0x1990('0xf')](_0x1990('0x10'),_0x251b76,_0x1990('0xe'),JSON[_0x1990('0x11')](_0x45b708));if(_0x45b708['error']){if(_0x45b708[_0x1990('0x12')][_0x1990('0x13')]===0x1f4){logger['error'](_0x1990('0xd'),_0x251b76,_0x45b708[_0x1990('0x12')]['message']);return _0x5b89f8(_0x45b708['error'][_0x1990('0x14')]);}logger[_0x1990('0x12')](_0x1990('0xd'),_0x251b76,_0x45b708[_0x1990('0x12')][_0x1990('0x14')]);return _0x11d324(_0x45b708[_0x1990('0x12')][_0x1990('0x14')]);}else{logger[_0x1990('0xc')]('FaxApplication,\x20%s,\x20%s',_0x251b76,'request\x20sent');_0x11d324(_0x45b708[_0x1990('0x15')][_0x1990('0x14')]);}})[_0x1990('0x16')](function(_0x37dfbb){logger['error'](_0x1990('0xd'),_0x251b76,_0x37dfbb);_0x5b89f8(_0x37dfbb);});});}exports[_0x1990('0x17')]=function(_0x31ce96){var _0x4ae6f0=this;return new Promise(function(_0x2cfcd9,_0x5e6568){return db['FaxApplication'][_0x1990('0x18')](_0x31ce96[_0x1990('0x19')],{'raw':_0x31ce96[_0x1990('0x1a')]?_0x31ce96[_0x1990('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31ce96['options']?_0x31ce96[_0x1990('0x1a')]['where']||null:null,'attributes':_0x31ce96[_0x1990('0x1a')]?_0x31ce96['options']['attributes']||null:null,'limit':_0x31ce96[_0x1990('0x1a')]?_0x31ce96[_0x1990('0x1a')][_0x1990('0x1b')]||null:null})[_0x1990('0xb')](function(_0x1a7c48){logger[_0x1990('0xc')](_0x1990('0x17'),_0x31ce96);logger[_0x1990('0xf')](_0x1990('0x17'),_0x31ce96,JSON['stringify'](_0x1a7c48));_0x2cfcd9(_0x1a7c48);})[_0x1990('0x16')](function(_0x201d5a){logger[_0x1990('0x12')](_0x1990('0x17'),_0x201d5a[_0x1990('0x14')],_0x31ce96);_0x5e6568(_0x4ae6f0[_0x1990('0x12')](0x1f4,_0x201d5a[_0x1990('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d96c0ce..b278da6 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 _0x6f47=['put','delete','exports','util','path','express','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','post','create'];(function(_0x2417b,_0x16c906){var _0x505dd2=function(_0x54c136){while(--_0x54c136){_0x2417b['push'](_0x2417b['shift']());}};_0x505dd2(++_0x16c906);}(_0x6f47,0xc7));var _0x76f4=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x6f47[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var auth=require(_0x76f4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x76f4('0x4'));var controller=require(_0x76f4('0x5'));router[_0x76f4('0x6')]('/',auth[_0x76f4('0x7')](),controller['index']);router[_0x76f4('0x6')](_0x76f4('0x8'),auth[_0x76f4('0x7')](),controller['show']);router[_0x76f4('0x9')]('/',auth[_0x76f4('0x7')](),controller[_0x76f4('0xa')]);router[_0x76f4('0xb')](_0x76f4('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x76f4('0xc')](_0x76f4('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x76f4('0xd')]=router; \ No newline at end of file +var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x22827f,_0x2e4092){var _0x4a69cc=function(_0x386192){while(--_0x386192){_0x22827f['push'](_0x22827f['shift']());}};_0x4a69cc(++_0x2e4092);}(_0x46ed,0x168));var _0xd46e=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x46ed[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd46e('0x5'));var config=require(_0xd46e('0x6'));var controller=require('./faxApplication.controller');router[_0xd46e('0x7')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x9')]);router[_0xd46e('0x7')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')]('/:id',auth[_0xd46e('0x8')](),controller[_0xd46e('0xf')]);router['delete'](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 1551c24..379dc75 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 _0xbf74=['DATE','STRING','ENUM','out','exports'];(function(_0x2585a9,_0x36b8de){var _0x25b272=function(_0x1c8d7e){while(--_0x1c8d7e){_0x2585a9['push'](_0x2585a9['shift']());}};_0x25b272(++_0x36b8de);}(_0xbf74,0xb8));var _0x4bf7=function(_0xf56a50,_0x28a428){_0xf56a50=_0xf56a50-0x0;var _0x5ced15=_0xbf74[_0xf56a50];return _0x5ced15;};'use strict';var Sequelize=require('sequelize');module[_0x4bf7('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4bf7('0x1')]},'disposition':{'type':Sequelize[_0x4bf7('0x2')]},'note':{'type':Sequelize[_0x4bf7('0x2')]},'read1stAt':{'type':Sequelize[_0x4bf7('0x1')]},'fax':{'type':Sequelize[_0x4bf7('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x4bf7('0x3')]('in',_0x4bf7('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4bf7('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xf285=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x23e5d0,_0x27e6d4){var _0x5eb412=function(_0x3a788f){while(--_0x3a788f){_0x23e5d0['push'](_0x23e5d0['shift']());}};_0x5eb412(++_0x27e6d4);}(_0xf285,0x10e));var _0x5f28=function(_0x4e52f4,_0xb6f8a8){_0x4e52f4=_0x4e52f4-0x0;var _0x2ef869=_0xf285[_0x4e52f4];return _0x2ef869;};'use strict';var Sequelize=require(_0x5f28('0x0'));module[_0x5f28('0x1')]={'closed':{'type':Sequelize[_0x5f28('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5f28('0x3')]},'disposition':{'type':Sequelize[_0x5f28('0x4')]},'note':{'type':Sequelize[_0x5f28('0x4')]},'read1stAt':{'type':Sequelize[_0x5f28('0x3')]},'fax':{'type':Sequelize[_0x5f28('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5f28('0x5')]('in',_0x5f28('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x5f28('0x5')]('in',_0x5f28('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index b0ba5be..c4db096 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 _0x5003=['../../config/environment','../../mysqldb','redis','localhost','register','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','name','Users','map','fullname','TagIds','Tags','split','forEach','index','FaxInteraction','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','length','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','isEmpty','FaxAccountId','where','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.internal','Owner.internal','toString','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','catch','params','includeAll','include','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','color','emit','faxInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x175cb4,_0x485688){var _0x46b919=function(_0x1dd36f){while(--_0x1dd36f){_0x175cb4['push'](_0x175cb4['shift']());}};_0x46b919(++_0x485688);}(_0x5003,0x18d));var _0x3500=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5003[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x3500('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3500('0x1'));var zipdir=require(_0x3500('0x2'));var jsonpatch=require(_0x3500('0x3'));var rp=require(_0x3500('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3500('0x5'));var util=require(_0x3500('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3500('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3500('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x3500('0x9'));var toCsv=require(_0x3500('0x7'));var querystring=require(_0x3500('0xa'));var Papa=require(_0x3500('0xb'));var Redis=require(_0x3500('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x3500('0xd'));var as=require(_0x3500('0xe'));var hardwareService=require(_0x3500('0xf'));var logger=require(_0x3500('0x10'))(_0x3500('0x11'));var utils=require(_0x3500('0x12'));var config=require(_0x3500('0x13'));var db=require(_0x3500('0x14'))['db'];config[_0x3500('0x15')]=_['defaults'](config[_0x3500('0x15')],{'host':_0x3500('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3500('0x15')]));require('./faxInteraction.socket')[_0x3500('0x17')](socket);function respondWithStatusCode(_0x7e954c,_0x2eeb96){_0x2eeb96=_0x2eeb96||0xcc;return function(_0x4243a3){if(_0x4243a3){return _0x7e954c[_0x3500('0x18')](_0x2eeb96);}return _0x7e954c['status'](_0x2eeb96)[_0x3500('0x19')]();};}function respondWithResult(_0x3fd264,_0x15ba51){_0x15ba51=_0x15ba51||0xc8;return function(_0x44e607){if(_0x44e607){return _0x3fd264[_0x3500('0x1a')](_0x15ba51)[_0x3500('0x1b')](_0x44e607);}};}function respondWithFilteredResult(_0xe98b26,_0x5a0521){return function(_0x7c4e6f){if(_0x7c4e6f){var _0x2778bb=_0x7c4e6f[_0x3500('0x1c')],_0x2b822a=_0x5a0521['offset'],_0x224807=_0x5a0521[_0x3500('0x1d')]+_0x5a0521[_0x3500('0x1e')],_0x526748;if(_0x224807>=_0x2778bb){_0x224807=_0x2778bb;_0x526748=0xc8;}else{_0x526748=0xce;}_0xe98b26[_0x3500('0x1a')](_0x526748);return _0xe98b26['set'](_0x3500('0x1f'),_0x2b822a+'-'+_0x224807+'/'+_0x2778bb)[_0x3500('0x1b')](_0x7c4e6f);}return null;};}function patchUpdates(_0x1e88a0){return function(_0x643215){try{jsonpatch['apply'](_0x643215,_0x1e88a0,!![]);}catch(_0x3f444d){return BPromise[_0x3500('0x20')](_0x3f444d);}return _0x643215[_0x3500('0x21')]();};}function saveUpdates(_0x445d55,_0x35a901){return function(_0x526348){if(_0x526348){return _0x526348[_0x3500('0x22')](_0x445d55)[_0x3500('0x23')](function(_0x33ff76){return _0x33ff76;});}return null;};}function removeEntity(_0x3c8763,_0x4d7ce5){return function(_0x17483b){if(_0x17483b){return _0x17483b[_0x3500('0x24')]()[_0x3500('0x23')](function(){_0x3c8763[_0x3500('0x1a')](0xcc)[_0x3500('0x19')]();});}};}function handleEntityNotFound(_0x22c4e1,_0x1f66bf){return function(_0x43f035){if(!_0x43f035){_0x22c4e1[_0x3500('0x18')](0x194);}return _0x43f035;};}function handleError(_0x5467b5,_0x1afe35){_0x1afe35=_0x1afe35||0x1f4;return function(_0x486884){logger[_0x3500('0x25')](_0x486884['stack']);if(_0x486884[_0x3500('0x26')]){delete _0x486884['name'];}_0x5467b5[_0x3500('0x1a')](_0x1afe35)['send'](_0x486884);};}function getInteractionUsers(_0x22e926,_0x177259){return new BPromise(function(_0x5adea3,_0x14ce1f){try{if(_0x177259[_0x22e926['id']]){_0x22e926[_0x3500('0x27')]=_[_0x3500('0x28')](_0x177259[_0x22e926['id']],function(_0x228959){return{'id':_0x228959['id'],'fullname':_0x228959[_0x3500('0x29')]};});}}catch(_0x3057dc){_0x14ce1f(_0x3057dc);}_0x5adea3(_0x22e926);});}function getInteractionTags(_0x489d7d,_0x17d1bb){return new BPromise(function(_0x1d92ac,_0x30849b){try{if(_0x489d7d[_0x3500('0x2a')]){_0x489d7d[_0x3500('0x2b')]=[];_0x489d7d[_0x3500('0x2a')][_0x3500('0x2c')](',')[_0x3500('0x2d')](function(_0xe95a92){_0x489d7d['Tags']['push'](_0x17d1bb[_0xe95a92]);});}delete _0x489d7d['TagIds'];}catch(_0x5f28bc){_0x30849b(_0x5f28bc);}_0x1d92ac(_0x489d7d);});}function updateFaxInteraction(_0x560b50,_0x4397d8,_0x2008a0){return new BPromise(function(_0x35ca09,_0x74a41a){return getInteractionUsers(_0x560b50,_0x2008a0)[_0x3500('0x23')](function(_0x3d832b){return getInteractionTags(_0x3d832b,_0x4397d8);})[_0x3500('0x23')](function(_0x2f5a19){_0x35ca09(_0x2f5a19);})['catch'](function(_0x56115d){_0x74a41a(_0x56115d);});});}exports[_0x3500('0x2e')]=function(_0x4369ee,_0x3d6498){var _0x5bbbcc={},_0x22a064={},_0x19a991={'count':0x0,'rows':[]};var _0x7061ff=_[_0x3500('0x28')](db[_0x3500('0x2f')][_0x3500('0x30')],function(_0x43601a){return{'name':_0x43601a[_0x3500('0x31')],'type':_0x43601a['type']['key']};});_0x22a064['model']=_['map'](_0x7061ff,_0x3500('0x26'));_0x22a064[_0x3500('0x32')]=_[_0x3500('0x33')](_0x4369ee[_0x3500('0x32')]);_0x22a064[_0x3500('0x34')]=_['intersection'](_0x22a064[_0x3500('0x35')],_0x22a064[_0x3500('0x32')]);_0x5bbbcc[_0x3500('0x36')]=_[_0x3500('0x37')](_0x22a064[_0x3500('0x35')],qs[_0x3500('0x38')](_0x4369ee['query']['fields']));_0x5bbbcc[_0x3500('0x36')]=_0x5bbbcc[_0x3500('0x36')]['length']?_0x5bbbcc[_0x3500('0x36')]:_0x22a064[_0x3500('0x35')];if(!_0x4369ee['query'][_0x3500('0x39')](_0x3500('0x3a'))){_0x5bbbcc[_0x3500('0x1e')]=qs[_0x3500('0x1e')](_0x4369ee['query'][_0x3500('0x1e')]);_0x5bbbcc[_0x3500('0x1d')]=qs[_0x3500('0x1d')](_0x4369ee['query'][_0x3500('0x1d')]);}_0x5bbbcc[_0x3500('0x3b')]=qs[_0x3500('0x3c')](_0x4369ee[_0x3500('0x32')][_0x3500('0x3c')]);_0x5bbbcc['where']=qs[_0x3500('0x34')](_[_0x3500('0x3d')](_0x4369ee[_0x3500('0x32')],_0x22a064['filters']));var _0x2c3b09=[];var _0x5c7cb2=squel[_0x3500('0x3e')]()['field']('id')[_0x3500('0x3f')](_0x3500('0x26'))[_0x3500('0x3f')]('color')[_0x3500('0x40')](_0x3500('0x41'));var _0x5750da=squel['select']()['field'](_0x3500('0x42'))[_0x3500('0x3f')](_0x3500('0x43'))['field'](_0x3500('0x44'))[_0x3500('0x40')](_0x3500('0x45'),'ui')[_0x3500('0x46')]('users','u',_0x3500('0x47'));var _0x2a4011=squel[_0x3500('0x3e')]()[_0x3500('0x40')](_0x3500('0x48'),'i')[_0x3500('0x46')](_0x3500('0x49'),'c',_0x3500('0x4a'))['left_join'](_0x3500('0x4b'),'o',_0x3500('0x4c'))[_0x3500('0x46')](_0x3500('0x4d'),'a','a.id\x20=\x20i.FaxAccountId')[_0x3500('0x46')]('fax_messages','me',_0x3500('0x4e'))[_0x3500('0x46')](_0x3500('0x4f'),'it',_0x3500('0x50'))[_0x3500('0x46')](_0x3500('0x41'),'t',_0x3500('0x51'));var _0x46a357=squel['expr']();var _0x39096e=[];var _0x34210f=squel[_0x3500('0x52')]();var _0x210438;if(_0x4369ee['query']['search']){_0x210438=as[_0x3500('0x53')](_0x4369ee[_0x3500('0x32')]['search']);var _0x1a12eb=_0x210438['sqlOperator'];for(var _0x13bab2=0x0;_0x13bab2<_0x210438['conditions'][_0x3500('0x54')];_0x13bab2++){var _0x27b11a=_0x210438[_0x3500('0x55')][_0x13bab2];var _0x484248='i';var _0x3b5c6b=_[_0x3500('0x56')](_0x7061ff,[_0x3500('0x26'),_0x27b11a[_0x3500('0x3f')]]);if(!_0x3b5c6b){switch(_0x27b11a[_0x3500('0x3f')]){case _0x3500('0x57'):if(_0x27b11a[_0x3500('0x58')]==0x1){_0x2a4011[_0x3500('0x59')]('`'+_0x27b11a['field']+_0x3500('0x5a'));}else{_0x2a4011[_0x3500('0x59')]('`'+_0x27b11a['field']+_0x3500('0x5b'));}break;case _0x3500('0x5c'):if(_0x27b11a[_0x3500('0x5d')]==='$substring'){if(_0x27b11a[_0x3500('0x58')][_0x3500('0x2c')]('\x20')[_0x3500('0x54')]>0x1){_0x46a357[_0x1a12eb]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x27b11a[_0x3500('0x58')]),null);}else{var _0x5251f1='%'+_0x27b11a[_0x3500('0x58')]+'%';_0x46a357[_0x1a12eb](_0x3500('0x5e'),_0x5251f1,_0x5251f1,_0x5251f1);}}else{_0x3b5c6b=_[_0x3500('0x56')](_0x7061ff,['name',_0x3500('0x5f')]);_0x27b11a[_0x3500('0x3f')]=_0x3500('0x5f');_0x41beac=as[_0x3500('0x60')](_0x484248,_0x3b5c6b[_0x3500('0x61')],_0x27b11a);_0x46a357[_0x1a12eb](_0x41beac[_0x3500('0x62')],_0x41beac[_0x3500('0x58')]['start'],_0x41beac[_0x3500('0x58')]['end']);}break;case'Tag':var _0x498a37=_0x27b11a[_0x3500('0x58')]['split'](',')[_0x3500('0x28')](function(_0x211c6f){return Number(_0x211c6f);});_0x498a37['forEach'](function(_0x4e496d){_0x34210f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4e496d+',%');});_0x39096e=_['union'](_0x39096e,_0x498a37);break;case _0x3500('0x63'):if(_0x27b11a[_0x3500('0x5d')]===_0x3500('0x64')){_0x46a357[_0x1a12eb](_0x3500('0x65'),'%'+_0x27b11a['value']+'%',null);}else{_0x3b5c6b=_[_0x3500('0x56')](_0x7061ff,['name','UserId']);_0x27b11a['field']=_0x3500('0x66');_0x41beac=as['buildExpression'](_0x484248,_0x3b5c6b[_0x3500('0x61')],_0x27b11a);_0x46a357[_0x1a12eb](_0x41beac['text'],_0x41beac[_0x3500('0x58')][_0x3500('0x67')],_0x41beac[_0x3500('0x58')][_0x3500('0x19')]);}break;case _0x3500('0x68'):_0x41beac=as['buildExpression']('me',null,_0x27b11a);_0x46a357[_0x1a12eb](_0x41beac['text'],_0x41beac[_0x3500('0x58')][_0x3500('0x67')],_0x41beac[_0x3500('0x58')]['end']);break;}}else{var _0x41beac=as[_0x3500('0x60')](_0x484248,_0x3b5c6b[_0x3500('0x61')],_0x27b11a);_0x46a357[_0x1a12eb](_0x41beac[_0x3500('0x62')],_0x41beac[_0x3500('0x58')][_0x3500('0x67')],_0x41beac[_0x3500('0x58')][_0x3500('0x19')]);}}}else{var _0xe3aa79=_(_0x4369ee[_0x3500('0x32')])['keys']()[_0x3500('0x28')](function(_0x2554d9){return _[_0x3500('0x69')](_0x7061ff,[_0x3500('0x26'),_0x2554d9])?_0x2554d9:undefined;})[_0x3500('0x6a')]()['value']();if(!_[_0x3500('0x6b')](_0xe3aa79)){_0xe3aa79[_0x3500('0x2d')](function(_0x41ef8a){if(_0x41ef8a===_0x3500('0x6c')){_0x2a4011[_0x3500('0x6d')]('i.FaxAccountId\x20IN\x20?',[][_0x3500('0x6e')](_0x4369ee['query'][_0x41ef8a]));}else if(_0x41ef8a===_0x3500('0x6f')){var _0x1a7681=JSON[_0x3500('0x70')](_0x4369ee[_0x3500('0x32')][_0x41ef8a])['$gte'];var _0x1445e0=JSON[_0x3500('0x70')](_0x4369ee[_0x3500('0x32')][_0x41ef8a])[_0x3500('0x71')];_0x2a4011[_0x3500('0x6d')](_0x3500('0x72'),_0x1a7681,_0x1445e0);}else{if(_0x4369ee[_0x3500('0x32')][_0x41ef8a]===_0x3500('0x73')){_0x2a4011[_0x3500('0x6d')]('i.'+_0x41ef8a+_0x3500('0x74'));}else{_0x2a4011[_0x3500('0x6d')]('i.'+_0x41ef8a+_0x3500('0x75'),_0x4369ee['query'][_0x41ef8a]);}}});}if(_0x4369ee['query'][_0x3500('0x76')]){if(_0x4369ee[_0x3500('0x32')][_0x3500('0x76')]==0x1){_0x2a4011['having'](_0x3500('0x77'));}else{_0x2a4011[_0x3500('0x59')](_0x3500('0x78'));}}if(_0x4369ee[_0x3500('0x32')][_0x3500('0x79')]){_0x39096e=_[_0x3500('0x7a')](_0x4369ee[_0x3500('0x32')][_0x3500('0x79')])?_0x4369ee['query'][_0x3500('0x79')]:new Array(_0x4369ee[_0x3500('0x32')][_0x3500('0x79')]);_0x39096e[_0x3500('0x2d')](function(_0x197c26){_0x34210f['or'](_0x3500('0x7b'),'%,'+_0x197c26+',%');});}if(_0x4369ee['query'][_0x3500('0x7c')]){var _0xae26db=_0x4369ee[_0x3500('0x32')][_0x3500('0x7c')][_0x3500('0x7d')]('\x5c','\x5c\x5c')[_0x3500('0x7d')]('\x27\x27',_0x3500('0x7e'));if(qs[_0x3500('0x7f')](_0xae26db)){_0x46a357['or'](_0x3500('0x80'),_0xae26db+'%')['or'](_0x3500('0x81'),_0xae26db+'%');}_0x46a357['or'](_0x3500('0x82'),_0xae26db+'%');}}_0x2a4011[_0x3500('0x6d')](_0x46a357);_0x2a4011[_0x3500('0x83')](_0x3500('0x84'));var _0x2f4d2d={'type':db[_0x3500('0x85')]['QueryTypes'][_0x3500('0x86')],'raw':!![]};var _0x4e9b6d=_0x2a4011[_0x3500('0x87')]();_0x4e9b6d[_0x3500('0x3f')](_0x3500('0x84'));_0x4e9b6d['field'](_0x3500('0x88'),_0x3500('0x57'));if(_0x5bbbcc[_0x3500('0x3b')]){_0x5bbbcc[_0x3500('0x3b')][_0x3500('0x2d')](function(_0x21cfe1){_0x2a4011[_0x3500('0x3b')]('i.'+_0x21cfe1[0x0],_0x21cfe1[0x1]===_0x3500('0x89')?![]:!![]);});}if(!_[_0x3500('0x6b')](_0x39096e)){_0x2a4011[_0x3500('0x59')](_0x34210f);_0x4e9b6d[_0x3500('0x6d')](_0x3500('0x8a'),_0x39096e);}BPromise[_0x3500('0x8b')]()[_0x3500('0x23')](function(){if(!_0x210438){if(_0x4369ee[_0x3500('0x32')]['FaxAccountId']||_0x4369ee[_0x3500('0x32')]['journey'])return;_0x4e9b6d[_0x3500('0x6d')](_0x3500('0x8c'));_0x2a4011[_0x3500('0x6d')](_0x3500('0x8c'));return;}return _0x4369ee['user'][_0x3500('0x8d')]({'attributes':['id'],'raw':!![]})[_0x3500('0x23')](function(_0x2180b2){if(_[_0x3500('0x6b')](_0x2180b2)){_0x4e9b6d[_0x3500('0x6d')](_0x3500('0x8e'));_0x2a4011[_0x3500('0x6d')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x4e9b6d[_0x3500('0x6d')](_0x3500('0x8f'),_[_0x3500('0x28')](_0x2180b2,'id'));_0x2a4011['where']('i.FaxAccountId\x20IN\x20?',_[_0x3500('0x28')](_0x2180b2,'id'));}});})[_0x3500('0x23')](function(){db['sequelize'][_0x3500('0x32')](_0x4e9b6d['toString'](),_0x2f4d2d)[_0x3500('0x23')](function(_0x3fdad0){_0x19a991['count']=_0x3fdad0[_0x3500('0x54')];if(_0x19a991['count']===0x0)return[];return db[_0x3500('0x90')][_0x3500('0x32')](_0x5c7cb2['toString'](),_0x2f4d2d)[_0x3500('0x23')](function(_0x20d593){_0x2c3b09=_[_0x3500('0x91')](_0x20d593,'id');_0x2f4d2d=_[_0x3500('0x92')](_0x2f4d2d,{'model':db[_0x3500('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4369ee[_0x3500('0x32')][_0x3500('0x38')]){_0x5bbbcc[_0x3500('0x36')][_0x3500('0x2d')](function(_0x583e56){_0x2a4011[_0x3500('0x3f')]('i.'+_0x583e56);});}else{_0x2a4011['field'](_0x3500('0x88'),_0x3500('0x57'));_0x2a4011[_0x3500('0x3f')](_0x3500('0x93'),_0x3500('0x94'));_0x2a4011['field'](_0x3500('0x95'),'Account.mandatoryDisposition');_0x2a4011[_0x3500('0x3f')](_0x3500('0x96'));_0x2a4011[_0x3500('0x3f')](_0x3500('0x97'),_0x3500('0x98'));_0x2a4011['field'](_0x3500('0x99'),_0x3500('0x9a'));_0x2a4011['field'](_0x3500('0x9b'),'Contact.email');_0x2a4011['field'](_0x3500('0x9c'),_0x3500('0x9d'));_0x2a4011[_0x3500('0x3f')](_0x3500('0x9e'),_0x3500('0x9f'));_0x2a4011[_0x3500('0x3f')]('c.fax','Contact.fax');_0x2a4011[_0x3500('0x3f')]('o.fullname','Owner.fullname');_0x2a4011['field'](_0x3500('0xa0'),_0x3500('0xa1'));_0x2a4011[_0x3500('0x3f')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}_0x2a4011[_0x3500('0x1e')](_0x5bbbcc[_0x3500('0x1e')]);_0x2a4011[_0x3500('0x1d')](_0x5bbbcc[_0x3500('0x1d')]);return db[_0x3500('0x90')]['query'](_0x2a4011[_0x3500('0xa2')](),_0x2f4d2d);})['then'](function(_0x22019f){_0x5750da[_0x3500('0x6d')](_0x3500('0xa3'),_[_0x3500('0x28')](_0x22019f,'id'));return db[_0x3500('0x90')]['query'](_0x5750da[_0x3500('0xa2')](),_0x2f4d2d)[_0x3500('0x23')](function(_0x172158){var _0x2ad80d=_[_0x3500('0xa4')](_0x172158,_0x3500('0xa5'));var _0x29ccc9=[];_0x22019f[_0x3500('0x2d')](function(_0xb96284){_0x29ccc9['push'](updateFaxInteraction(_0xb96284,_0x2c3b09,_0x2ad80d));});return BPromise['all'](_0x29ccc9);});});})[_0x3500('0x23')](function(_0x14ab21){_0x19a991['rows']=_0x14ab21;return _0x19a991;})[_0x3500('0x23')](respondWithFilteredResult(_0x3d6498,_0x5bbbcc));})[_0x3500('0xa6')](handleError(_0x3d6498,null));};exports['show']=function(_0x16604c,_0x3a07ce){var _0x21b41b={'raw':![],'where':{'id':_0x16604c[_0x3500('0xa7')]['id']}},_0x9f2790={};_0x9f2790[_0x3500('0x35')]=_[_0x3500('0x33')](db[_0x3500('0x2f')]['rawAttributes']);_0x9f2790[_0x3500('0x32')]=_[_0x3500('0x33')](_0x16604c['query']);_0x9f2790[_0x3500('0x34')]=_['intersection'](_0x9f2790['model'],_0x9f2790['query']);_0x21b41b['attributes']=_['intersection'](_0x9f2790[_0x3500('0x35')],qs[_0x3500('0x38')](_0x16604c[_0x3500('0x32')][_0x3500('0x38')]));_0x21b41b[_0x3500('0x36')]=_0x21b41b[_0x3500('0x36')][_0x3500('0x54')]?_0x21b41b[_0x3500('0x36')]:_0x9f2790[_0x3500('0x35')];if(_0x16604c['query'][_0x3500('0xa8')]){_0x21b41b[_0x3500('0xa9')]=[{'all':!![]}];}_0x21b41b=_[_0x3500('0x92')]({},_0x21b41b,_0x16604c['options']);return db[_0x3500('0x2f')][_0x3500('0x56')](_0x21b41b)['then'](handleEntityNotFound(_0x3a07ce,null))[_0x3500('0x23')](respondWithResult(_0x3a07ce,null))[_0x3500('0xa6')](handleError(_0x3a07ce,null));};exports['create']=function(_0x1e15c4,_0x5155b3){return db['FaxInteraction'][_0x3500('0xaa')](_0x1e15c4[_0x3500('0x68')],{})[_0x3500('0x23')](respondWithResult(_0x5155b3,0xc9))[_0x3500('0xa6')](handleError(_0x5155b3,null));};exports[_0x3500('0x22')]=function(_0x207901,_0x2d67fb){if(_0x207901['body']['id']){delete _0x207901[_0x3500('0x68')]['id'];}return db['FaxInteraction'][_0x3500('0x56')]({'where':{'id':_0x207901[_0x3500('0xa7')]['id']}})['then'](handleEntityNotFound(_0x2d67fb,null))[_0x3500('0x23')](saveUpdates(_0x207901[_0x3500('0x68')],null))[_0x3500('0x23')](respondWithResult(_0x2d67fb,null))['catch'](handleError(_0x2d67fb,null));};exports[_0x3500('0x24')]=function(_0x1a096d,_0x48435d){return db[_0x3500('0x2f')]['find']({'where':{'id':_0x1a096d['params']['id']}})[_0x3500('0x23')](handleEntityNotFound(_0x48435d,null))[_0x3500('0x23')](removeEntity(_0x48435d,null))['catch'](handleError(_0x48435d,null));};exports[_0x3500('0xab')]=function(_0x14cfb2,_0x410eab){return db['FaxInteraction'][_0x3500('0xab')]()[_0x3500('0x23')](respondWithResult(_0x410eab,null))['catch'](handleError(_0x410eab,null));};exports[_0x3500('0xac')]=function(_0x4336ae,_0x3e1dec,_0x48e4e6){return db[_0x3500('0xad')][_0x3500('0x56')]({'where':{'id':_0x4336ae['params']['id']}})['then'](handleEntityNotFound(_0x3e1dec,null))[_0x3500('0x23')](function(_0x52406a){if(_0x52406a){return _0x52406a[_0x3500('0xac')](_0x4336ae['body'][_0x3500('0xae')],_[_0x3500('0xaf')](_0x4336ae[_0x3500('0x68')],[_0x3500('0xae'),'id'])||{});}})[_0x3500('0x23')](respondWithResult(_0x3e1dec,null))[_0x3500('0xa6')](handleError(_0x3e1dec,null));};exports[_0x3500('0xb0')]=function(_0x2f131d,_0x561242,_0x178e0c){var _0xc13874={'raw':![],'where':{}};var _0x2fea12={};var _0x1c1d4e={'count':0x0,'rows':[]};return db[_0x3500('0x2f')][_0x3500('0xb1')]({'where':{'id':_0x2f131d['params']['id']}})[_0x3500('0x23')](handleEntityNotFound(_0x561242,null))[_0x3500('0x23')](function(_0x455672){if(_0x455672){_0x2fea12[_0x3500('0x35')]=_[_0x3500('0x33')](db[_0x3500('0xad')]['rawAttributes']);_0x2fea12['query']=_[_0x3500('0x33')](_0x2f131d[_0x3500('0x32')]);_0x2fea12['filters']=_['intersection'](_0x2fea12[_0x3500('0x35')],_0x2fea12['query']);_0xc13874[_0x3500('0x36')]=_[_0x3500('0x37')](_0x2fea12['model'],qs[_0x3500('0x38')](_0x2f131d['query'][_0x3500('0x38')]));_0xc13874[_0x3500('0x36')]=_0xc13874['attributes'][_0x3500('0x54')]?_0xc13874['attributes']:_0x2fea12[_0x3500('0x35')];if(!_0x2f131d[_0x3500('0x32')]['hasOwnProperty'](_0x3500('0x3a'))){_0xc13874[_0x3500('0x1e')]=qs['limit'](_0x2f131d['query'][_0x3500('0x1e')]);_0xc13874[_0x3500('0x1d')]=qs[_0x3500('0x1d')](_0x2f131d[_0x3500('0x32')][_0x3500('0x1d')]);}_0xc13874[_0x3500('0x3b')]=qs['sort'](_0x2f131d[_0x3500('0x32')][_0x3500('0x3c')]);_0xc13874['where']=qs[_0x3500('0x34')](_[_0x3500('0x3d')](_0x2f131d[_0x3500('0x32')],_0x2fea12[_0x3500('0x34')]));_0xc13874[_0x3500('0x6d')]['FaxInteractionId']=_0x455672['id'];if(_0x2f131d['query'][_0x3500('0x7c')]){_0xc13874[_0x3500('0x6d')]=_[_0x3500('0x92')](_0xc13874['where'],{'$or':_[_0x3500('0x28')](_0xc13874[_0x3500('0x36')],function(_0x130a95){var _0x401e2a={};_0x401e2a[_0x130a95]={'$like':'%'+_0x2f131d[_0x3500('0x32')][_0x3500('0x7c')]+'%'};return _0x401e2a;})});}if(_0x2f131d[_0x3500('0x32')][_0x3500('0xb2')]){var _0x58951d=_0x2f131d['query'][_0x3500('0xb2')][_0x3500('0x2c')](',');var _0x1a56a0={};_0x1a56a0[_0x58951d[0x0]]={'$gte':moment(_0x58951d[0x1])[_0x3500('0xb3')](_0x3500('0xb4'))};_0xc13874[_0x3500('0x6d')]=_[_0x3500('0x92')](_0xc13874['where'],_0x1a56a0);}_0xc13874=_[_0x3500('0x92')]({},_0xc13874,_0x2f131d[_0x3500('0xb5')]);return db[_0x3500('0xad')][_0x3500('0x1c')]({'where':_0xc13874[_0x3500('0x6d')]})['then'](function(_0x32be58){_0x1c1d4e[_0x3500('0x1c')]=_0x32be58;if(_0x2f131d[_0x3500('0x32')][_0x3500('0xa8')]){_0xc13874['include']=[{'all':!![]}];}return db[_0x3500('0xad')][_0x3500('0xb6')](_0xc13874);})['then'](function(_0x53a1d9){_0x1c1d4e['rows']=_0x53a1d9;return _0x1c1d4e;});}})[_0x3500('0x23')](respondWithFilteredResult(_0x561242,_0xc13874))['catch'](handleError(_0x561242,null));};exports[_0x3500('0xb7')]=function(_0x5c2092,_0x53d236,_0x284256){return db['FaxInteraction'][_0x3500('0x56')]({'where':{'id':_0x5c2092['params']['id']}})[_0x3500('0x23')](handleEntityNotFound(_0x53d236,null))[_0x3500('0x23')](function(_0x2fec41){if(_0x2fec41){return _0x2fec41[_0x3500('0xb8')](_0x5c2092['body'][_0x3500('0xae')],_['omit'](_0x5c2092[_0x3500('0x68')],[_0x3500('0xae'),'id'])||{})['spread'](function(){return db['Tag'][_0x3500('0xb6')]({'attributes':['id',_0x3500('0x26'),_0x3500('0xb9')],'where':{'id':_0x5c2092[_0x3500('0x68')]['ids']}});})[_0x3500('0x23')](function(_0x4327d3){socket[_0x3500('0xba')](_0x3500('0xbb'),{'id':Number(_0x5c2092[_0x3500('0xa7')]['id']),'tags':_0x4327d3||[]});return{'id':Number(_0x5c2092['params']['id']),'tags':_0x4327d3||[]};});}})[_0x3500('0x23')](respondWithResult(_0x53d236,null))['catch'](handleError(_0x53d236,null));};exports['removeTags']=function(_0x391670,_0x48ecab,_0x3b2d60){return db[_0x3500('0x2f')][_0x3500('0x56')]({'where':{'id':_0x391670[_0x3500('0xa7')]['id']}})[_0x3500('0x23')](handleEntityNotFound(_0x48ecab,null))[_0x3500('0x23')](function(_0x57b41f){if(_0x57b41f){return _0x57b41f[_0x3500('0xbc')](_0x391670[_0x3500('0x32')]['ids']);}})['then'](respondWithStatusCode(_0x48ecab,null))[_0x3500('0xa6')](handleError(_0x48ecab,null));};exports[_0x3500('0xbd')]=function(_0x1e0fac,_0xc3b7a9){var _0x9eeb1=moment()['unix']()[_0x3500('0xa2')]();var _0x11e33b=path[_0x3500('0xbe')](config[_0x3500('0xbf')],_0x3500('0xc0'),_0x3500('0xc1'),_0x3500('0xc2'));var _0x43808f=path[_0x3500('0xbe')](config['root'],'server','files',_0x3500('0xc3'));var _0xb408b2=path['join'](_0x11e33b,_0x9eeb1);var _0x14c4e5=util[_0x3500('0xb3')](_0x3500('0xc4'),_0x1e0fac[_0x3500('0xa7')]['id'],_0x9eeb1);var _0x58ad1b=path[_0x3500('0xbe')](_0x11e33b,_0x14c4e5);var _0x27c671=[];_0x27c671[_0x3500('0xc5')]({'model':db[_0x3500('0xc6')],'as':_0x3500('0xc6'),'raw':!![]});var _0x4ae3af=[{'model':db[_0x3500('0xad')],'as':_0x3500('0xc7'),'attributes':['id',_0x3500('0x68'),_0x3500('0x6f')],'include':_0x27c671}];return db[_0x3500('0x2f')][_0x3500('0x56')]({'where':{'id':_0x1e0fac[_0x3500('0xa7')]['id']},'include':_0x4ae3af})[_0x3500('0x23')](handleEntityNotFound(_0xc3b7a9,null))[_0x3500('0x23')](function(_0x36965f){if(_0x36965f&&_0x36965f[_0x3500('0xc7')]){var _0xdcb202=_0x36965f[_0x3500('0xc8')]({'plain':!![]});fs[_0x3500('0xc9')](_0xb408b2);for(var _0x48028f=0x0;_0x48028f<_0xdcb202[_0x3500('0xc7')][_0x3500('0x54')];_0x48028f++){var _0x5145b7=_0xdcb202[_0x3500('0xc7')][_0x48028f][_0x3500('0xc6')];if(_0x5145b7){var _0x33b614=path[_0x3500('0xbe')](_0x43808f,_0x5145b7[_0x3500('0xca')]);if(fs[_0x3500('0xcb')](_0x33b614)){fs[_0x3500('0xcc')](_0x33b614)[_0x3500('0xcd')](fs['createWriteStream'](path[_0x3500('0xbe')](_0xb408b2,_0x5145b7[_0x3500('0xca')])));}}}return BPromise[_0x3500('0x8b')]()[_0x3500('0x23')](function(){return new BPromise(function(_0x5efd93,_0x5a501e){zipdir(_0xb408b2,{'saveTo':_0x58ad1b},function(_0x46aecc,_0x41aa5e){if(_0x46aecc)return _0x5a501e(_0x46aecc);return _0x5efd93(_0x41aa5e);});})[_0x3500('0x23')](function(){return new BPromise(function(_0x30b99a,_0x42c5a2){rimraf(_0xb408b2,function(_0x227108){if(_0x227108)_0x42c5a2(_0x227108);return _0x30b99a();});});})[_0x3500('0x23')](function(){return _0xc3b7a9['download'](_0x58ad1b,_0x14c4e5,function(_0x2b9772){if(_0x2b9772){console[_0x3500('0xce')]('err',_0x2b9772);}else{fs[_0x3500('0xcf')](_0x58ad1b);}});});});}else{return _0xc3b7a9[_0x3500('0x18')](0xc8);}})[_0x3500('0xa6')](handleError(_0xc3b7a9,null));}; \ No newline at end of file +var _0x8fd6=['UserId','body','start','compact','isEmpty','where','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','toString','sequelize','merge','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','rows','show','params','includeAll','create','update','describe','addMessage','ids','omit','findOne','FaxInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','FaxMessage','include','findAll','spread','emit','removeTags','download','join','root','server','attachments','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','end','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','index','FaxInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','field','color','from','tools_tags','select','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?'];(function(_0x432075,_0x308bed){var _0x575582=function(_0x1337e7){while(--_0x1337e7){_0x432075['push'](_0x432075['shift']());}};_0x575582(++_0x308bed);}(_0x8fd6,0x67));var _0x68fd=function(_0x35cf3d,_0x5b755c){_0x35cf3d=_0x35cf3d-0x0;var _0x507252=_0x8fd6[_0x35cf3d];return _0x507252;};'use strict';var pdf=require(_0x68fd('0x0'));var emlformat=require(_0x68fd('0x1'));var rimraf=require(_0x68fd('0x2'));var zipdir=require(_0x68fd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68fd('0x4'));var moment=require('moment');var BPromise=require(_0x68fd('0x5'));var Mustache=require(_0x68fd('0x6'));var util=require('util');var path=require('path');var sox=require(_0x68fd('0x7'));var csv=require(_0x68fd('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x68fd('0x9'));var squel=require(_0x68fd('0xa'));var crypto=require('crypto');var jsforce=require(_0x68fd('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x68fd('0x8'));var querystring=require(_0x68fd('0xc'));var Papa=require(_0x68fd('0xd'));var Redis=require(_0x68fd('0xe'));var authService=require(_0x68fd('0xf'));var qs=require(_0x68fd('0x10'));var as=require(_0x68fd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x68fd('0x12'))(_0x68fd('0x13'));var utils=require(_0x68fd('0x14'));var config=require(_0x68fd('0x15'));var db=require(_0x68fd('0x16'))['db'];config['redis']=_['defaults'](config[_0x68fd('0x17')],{'host':_0x68fd('0x18'),'port':0x18eb});var socket=require(_0x68fd('0x19'))(new Redis(config[_0x68fd('0x17')]));require('./faxInteraction.socket')[_0x68fd('0x1a')](socket);function respondWithStatusCode(_0x22bb60,_0x3f6ecc){_0x3f6ecc=_0x3f6ecc||0xcc;return function(_0xd7be1c){if(_0xd7be1c){return _0x22bb60[_0x68fd('0x1b')](_0x3f6ecc);}return _0x22bb60[_0x68fd('0x1c')](_0x3f6ecc)['end']();};}function respondWithResult(_0x508628,_0x29e322){_0x29e322=_0x29e322||0xc8;return function(_0x3ef8fe){if(_0x3ef8fe){return _0x508628['status'](_0x29e322)[_0x68fd('0x1d')](_0x3ef8fe);}};}function respondWithFilteredResult(_0xacd7ae,_0x460904){return function(_0x37fa27){if(_0x37fa27){var _0x218f85=_0x37fa27[_0x68fd('0x1e')],_0x4c2aef=_0x460904[_0x68fd('0x1f')],_0x590be5=_0x460904[_0x68fd('0x1f')]+_0x460904[_0x68fd('0x20')],_0x50eb50;if(_0x590be5>=_0x218f85){_0x590be5=_0x218f85;_0x50eb50=0xc8;}else{_0x50eb50=0xce;}_0xacd7ae[_0x68fd('0x1c')](_0x50eb50);return _0xacd7ae[_0x68fd('0x21')](_0x68fd('0x22'),_0x4c2aef+'-'+_0x590be5+'/'+_0x218f85)[_0x68fd('0x1d')](_0x37fa27);}return null;};}function patchUpdates(_0x104e6a){return function(_0x50789a){try{jsonpatch[_0x68fd('0x23')](_0x50789a,_0x104e6a,!![]);}catch(_0x2c2f89){return BPromise['reject'](_0x2c2f89);}return _0x50789a[_0x68fd('0x24')]();};}function saveUpdates(_0x21427b,_0x1b8d13){return function(_0x3cc70f){if(_0x3cc70f){return _0x3cc70f['update'](_0x21427b)[_0x68fd('0x25')](function(_0xb155a3){return _0xb155a3;});}return null;};}function removeEntity(_0x5f37d6,_0x5df6bd){return function(_0x52a729){if(_0x52a729){return _0x52a729[_0x68fd('0x26')]()[_0x68fd('0x25')](function(){_0x5f37d6[_0x68fd('0x1c')](0xcc)[_0x68fd('0x27')]();});}};}function handleEntityNotFound(_0x350804,_0x2a17b4){return function(_0x6be347){if(!_0x6be347){_0x350804['sendStatus'](0x194);}return _0x6be347;};}function handleError(_0x101477,_0x51991e){_0x51991e=_0x51991e||0x1f4;return function(_0x43cd1){logger['error'](_0x43cd1[_0x68fd('0x28')]);if(_0x43cd1[_0x68fd('0x29')]){delete _0x43cd1[_0x68fd('0x29')];}_0x101477[_0x68fd('0x1c')](_0x51991e)[_0x68fd('0x2a')](_0x43cd1);};}function getInteractionUsers(_0x168b3d,_0x5268a0){return new BPromise(function(_0xd892cd,_0x199672){try{if(_0x5268a0[_0x168b3d['id']]){_0x168b3d[_0x68fd('0x2b')]=_[_0x68fd('0x2c')](_0x5268a0[_0x168b3d['id']],function(_0x28e2e8){return{'id':_0x28e2e8['id'],'fullname':_0x28e2e8[_0x68fd('0x2d')]};});}}catch(_0x4ebb3a){_0x199672(_0x4ebb3a);}_0xd892cd(_0x168b3d);});}function getInteractionTags(_0x31ff07,_0x3f503c){return new BPromise(function(_0x580b47,_0x27e02e){try{if(_0x31ff07[_0x68fd('0x2e')]){_0x31ff07[_0x68fd('0x2f')]=[];_0x31ff07[_0x68fd('0x2e')][_0x68fd('0x30')](',')['forEach'](function(_0x1a47fc){_0x31ff07[_0x68fd('0x2f')][_0x68fd('0x31')](_0x3f503c[_0x1a47fc]);});}delete _0x31ff07[_0x68fd('0x2e')];}catch(_0xd69e87){_0x27e02e(_0xd69e87);}_0x580b47(_0x31ff07);});}function updateFaxInteraction(_0x555938,_0x3efc4e,_0x1ce193){return new BPromise(function(_0x3583b0,_0x11a141){return getInteractionUsers(_0x555938,_0x1ce193)['then'](function(_0x53da0b){return getInteractionTags(_0x53da0b,_0x3efc4e);})['then'](function(_0x7b0730){_0x3583b0(_0x7b0730);})[_0x68fd('0x32')](function(_0x3ea7ad){_0x11a141(_0x3ea7ad);});});}exports[_0x68fd('0x33')]=function(_0x5d43ea,_0x1a8712){var _0x5e23ae={},_0x36dddd={},_0x559cd5={'count':0x0,'rows':[]};var _0x5d0696=_[_0x68fd('0x2c')](db[_0x68fd('0x34')][_0x68fd('0x35')],function(_0x1861b8){return{'name':_0x1861b8[_0x68fd('0x36')],'type':_0x1861b8['type'][_0x68fd('0x37')]};});_0x36dddd[_0x68fd('0x38')]=_[_0x68fd('0x2c')](_0x5d0696,_0x68fd('0x29'));_0x36dddd[_0x68fd('0x39')]=_[_0x68fd('0x3a')](_0x5d43ea[_0x68fd('0x39')]);_0x36dddd[_0x68fd('0x3b')]=_[_0x68fd('0x3c')](_0x36dddd[_0x68fd('0x38')],_0x36dddd[_0x68fd('0x39')]);_0x5e23ae[_0x68fd('0x3d')]=_[_0x68fd('0x3c')](_0x36dddd[_0x68fd('0x38')],qs[_0x68fd('0x3e')](_0x5d43ea['query'][_0x68fd('0x3e')]));_0x5e23ae[_0x68fd('0x3d')]=_0x5e23ae[_0x68fd('0x3d')][_0x68fd('0x3f')]?_0x5e23ae[_0x68fd('0x3d')]:_0x36dddd[_0x68fd('0x38')];if(!_0x5d43ea[_0x68fd('0x39')][_0x68fd('0x40')](_0x68fd('0x41'))){_0x5e23ae[_0x68fd('0x20')]=qs['limit'](_0x5d43ea[_0x68fd('0x39')][_0x68fd('0x20')]);_0x5e23ae['offset']=qs['offset'](_0x5d43ea[_0x68fd('0x39')]['offset']);}_0x5e23ae[_0x68fd('0x42')]=qs[_0x68fd('0x43')](_0x5d43ea[_0x68fd('0x39')][_0x68fd('0x43')]);_0x5e23ae['where']=qs[_0x68fd('0x3b')](_[_0x68fd('0x44')](_0x5d43ea[_0x68fd('0x39')],_0x36dddd[_0x68fd('0x3b')]));var _0x2c24d8=[];var _0x533b35=squel['select']()[_0x68fd('0x45')]('id')['field']('name')['field'](_0x68fd('0x46'))[_0x68fd('0x47')](_0x68fd('0x48'));var _0x234e17=squel[_0x68fd('0x49')]()['field']('u.id')[_0x68fd('0x45')](_0x68fd('0x4a'))['field'](_0x68fd('0x4b'))[_0x68fd('0x47')](_0x68fd('0x4c'),'ui')[_0x68fd('0x4d')](_0x68fd('0x4e'),'u',_0x68fd('0x4f'));var _0x2be3de=squel['select']()[_0x68fd('0x47')](_0x68fd('0x50'),'i')[_0x68fd('0x4d')]('cm_contacts','c',_0x68fd('0x51'))[_0x68fd('0x4d')](_0x68fd('0x4e'),'o',_0x68fd('0x52'))[_0x68fd('0x4d')]('fax_accounts','a',_0x68fd('0x53'))[_0x68fd('0x4d')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0x68fd('0x4d')](_0x68fd('0x54'),'it',_0x68fd('0x55'))[_0x68fd('0x4d')](_0x68fd('0x48'),'t',_0x68fd('0x56'));var _0x5d2ad2=squel[_0x68fd('0x57')]();var _0x45c155=[];var _0x48866f=squel[_0x68fd('0x57')]();var _0x36f834;if(_0x5d43ea[_0x68fd('0x39')][_0x68fd('0x58')]){_0x36f834=as['parseSearch'](_0x5d43ea['query'][_0x68fd('0x58')]);var _0x444761=_0x36f834[_0x68fd('0x59')];for(var _0x551099=0x0;_0x551099<_0x36f834['conditions'][_0x68fd('0x3f')];_0x551099++){var _0x5cd400=_0x36f834[_0x68fd('0x5a')][_0x551099];var _0x5b3147='i';var _0x631478=_[_0x68fd('0x5b')](_0x5d0696,[_0x68fd('0x29'),_0x5cd400['field']]);if(!_0x631478){switch(_0x5cd400[_0x68fd('0x45')]){case _0x68fd('0x5c'):if(_0x5cd400[_0x68fd('0x5d')]==0x1){_0x2be3de[_0x68fd('0x5e')]('`'+_0x5cd400[_0x68fd('0x45')]+_0x68fd('0x5f'));}else{_0x2be3de[_0x68fd('0x5e')]('`'+_0x5cd400[_0x68fd('0x45')]+'`\x20>\x200');}break;case _0x68fd('0x60'):if(_0x5cd400[_0x68fd('0x61')]===_0x68fd('0x62')){if(_0x5cd400[_0x68fd('0x5d')][_0x68fd('0x30')]('\x20')['length']>0x1){_0x5d2ad2[_0x444761](_0x68fd('0x63'),qs[_0x68fd('0x64')](_0x5cd400[_0x68fd('0x5d')]),null);}else{var _0x58c944='%'+_0x5cd400['value']+'%';_0x5d2ad2[_0x444761]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x58c944,_0x58c944,_0x58c944);}}else{_0x631478=_[_0x68fd('0x5b')](_0x5d0696,[_0x68fd('0x29'),'ContactId']);_0x5cd400[_0x68fd('0x45')]=_0x68fd('0x65');_0x553884=as[_0x68fd('0x66')](_0x5b3147,_0x631478[_0x68fd('0x67')],_0x5cd400);_0x5d2ad2[_0x444761](_0x553884[_0x68fd('0x68')],_0x553884['value']['start'],_0x553884['value'][_0x68fd('0x27')]);}break;case _0x68fd('0x69'):var _0x89aca=_0x5cd400[_0x68fd('0x5d')][_0x68fd('0x30')](',')[_0x68fd('0x2c')](function(_0x2197fd){return Number(_0x2197fd);});_0x89aca[_0x68fd('0x6a')](function(_0x472a32){_0x48866f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x472a32+',%');});_0x45c155=_[_0x68fd('0x6b')](_0x45c155,_0x89aca);break;case _0x68fd('0x6c'):if(_0x5cd400[_0x68fd('0x61')]===_0x68fd('0x62')){_0x5d2ad2[_0x444761](_0x68fd('0x6d'),'%'+_0x5cd400[_0x68fd('0x5d')]+'%',null);}else{_0x631478=_['find'](_0x5d0696,[_0x68fd('0x29'),'UserId']);_0x5cd400[_0x68fd('0x45')]=_0x68fd('0x6e');_0x553884=as['buildExpression'](_0x5b3147,_0x631478[_0x68fd('0x67')],_0x5cd400);_0x5d2ad2[_0x444761](_0x553884[_0x68fd('0x68')],_0x553884[_0x68fd('0x5d')]['start'],_0x553884[_0x68fd('0x5d')][_0x68fd('0x27')]);}break;case _0x68fd('0x6f'):_0x553884=as['buildExpression']('me',null,_0x5cd400);_0x5d2ad2[_0x444761](_0x553884['text'],_0x553884[_0x68fd('0x5d')][_0x68fd('0x70')],_0x553884['value'][_0x68fd('0x27')]);break;}}else{var _0x553884=as[_0x68fd('0x66')](_0x5b3147,_0x631478[_0x68fd('0x67')],_0x5cd400);_0x5d2ad2[_0x444761](_0x553884['text'],_0x553884['value'][_0x68fd('0x70')],_0x553884['value'][_0x68fd('0x27')]);}}}else{var _0x180942=_(_0x5d43ea[_0x68fd('0x39')])[_0x68fd('0x3a')]()['map'](function(_0x5dcbaf){return _['some'](_0x5d0696,['name',_0x5dcbaf])?_0x5dcbaf:undefined;})[_0x68fd('0x71')]()['value']();if(!_[_0x68fd('0x72')](_0x180942)){_0x180942[_0x68fd('0x6a')](function(_0x32fa29){if(_0x32fa29==='FaxAccountId'){_0x2be3de[_0x68fd('0x73')]('i.FaxAccountId\x20IN\x20?',[][_0x68fd('0x74')](_0x5d43ea[_0x68fd('0x39')][_0x32fa29]));}else if(_0x32fa29===_0x68fd('0x75')){var _0x5353fc=JSON[_0x68fd('0x76')](_0x5d43ea[_0x68fd('0x39')][_0x32fa29])['$gte'];var _0xb87fe3=JSON[_0x68fd('0x76')](_0x5d43ea[_0x68fd('0x39')][_0x32fa29])[_0x68fd('0x77')];_0x2be3de[_0x68fd('0x73')](_0x68fd('0x78'),_0x5353fc,_0xb87fe3);}else{if(_0x5d43ea['query'][_0x32fa29]===_0x68fd('0x79')){_0x2be3de[_0x68fd('0x73')]('i.'+_0x32fa29+_0x68fd('0x7a'));}else{_0x2be3de[_0x68fd('0x73')]('i.'+_0x32fa29+_0x68fd('0x7b'),_0x5d43ea['query'][_0x32fa29]);}}});}if(_0x5d43ea[_0x68fd('0x39')][_0x68fd('0x7c')]){if(_0x5d43ea[_0x68fd('0x39')][_0x68fd('0x7c')]==0x1){_0x2be3de['having'](_0x68fd('0x7d'));}else{_0x2be3de[_0x68fd('0x5e')](_0x68fd('0x7e'));}}if(_0x5d43ea['query']['tag']){_0x45c155=_[_0x68fd('0x7f')](_0x5d43ea[_0x68fd('0x39')]['tag'])?_0x5d43ea['query'][_0x68fd('0x80')]:new Array(_0x5d43ea[_0x68fd('0x39')]['tag']);_0x45c155[_0x68fd('0x6a')](function(_0x36c19e){_0x48866f['or'](_0x68fd('0x81'),'%,'+_0x36c19e+',%');});}if(_0x5d43ea[_0x68fd('0x39')][_0x68fd('0x82')]){var _0x143637=_0x5d43ea['query']['filter'][_0x68fd('0x83')]('\x5c','\x5c\x5c')[_0x68fd('0x83')]('\x27\x27',_0x68fd('0x84'));if(qs[_0x68fd('0x85')](_0x143637)){_0x5d2ad2['or']('i.id\x20LIKE\x20?',_0x143637+'%')['or'](_0x68fd('0x86'),_0x143637+'%');}_0x5d2ad2['or'](_0x68fd('0x87'),_0x143637+'%');}}_0x2be3de[_0x68fd('0x73')](_0x5d2ad2);_0x2be3de[_0x68fd('0x88')]('i.id');var _0x9f28c3={'type':db[_0x68fd('0x89')][_0x68fd('0x8a')][_0x68fd('0x8b')],'raw':!![]};var _0x234da1=_0x2be3de[_0x68fd('0x8c')]();_0x234da1[_0x68fd('0x45')](_0x68fd('0x8d'));_0x234da1['field'](_0x68fd('0x8e'),_0x68fd('0x5c'));if(_0x5e23ae[_0x68fd('0x42')]){_0x5e23ae['order']['forEach'](function(_0x4ace23){_0x2be3de[_0x68fd('0x42')]('i.'+_0x4ace23[0x0],_0x4ace23[0x1]===_0x68fd('0x8f')?![]:!![]);});}if(!_[_0x68fd('0x72')](_0x45c155)){_0x2be3de['having'](_0x48866f);_0x234da1['where'](_0x68fd('0x90'),_0x45c155);}BPromise[_0x68fd('0x91')]()[_0x68fd('0x25')](function(){if(!_0x36f834){if(_0x5d43ea[_0x68fd('0x39')][_0x68fd('0x92')]||_0x5d43ea['query'][_0x68fd('0x93')])return;_0x234da1[_0x68fd('0x73')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x2be3de[_0x68fd('0x73')](_0x68fd('0x94'));return;}return _0x5d43ea[_0x68fd('0x95')][_0x68fd('0x96')]({'attributes':['id'],'raw':!![]})[_0x68fd('0x25')](function(_0x2316d3){if(_['isEmpty'](_0x2316d3)){_0x234da1[_0x68fd('0x73')]('i.FaxAccountId\x20IS\x20NULL');_0x2be3de[_0x68fd('0x73')](_0x68fd('0x97'));}else{_0x234da1[_0x68fd('0x73')](_0x68fd('0x98'),_[_0x68fd('0x2c')](_0x2316d3,'id'));_0x2be3de['where']('i.FaxAccountId\x20IN\x20?',_['map'](_0x2316d3,'id'));}});})[_0x68fd('0x25')](function(){db['sequelize'][_0x68fd('0x39')](_0x234da1[_0x68fd('0x99')](),_0x9f28c3)['then'](function(_0x3e4056){_0x559cd5[_0x68fd('0x1e')]=_0x3e4056[_0x68fd('0x3f')];if(_0x559cd5[_0x68fd('0x1e')]===0x0)return[];return db[_0x68fd('0x9a')]['query'](_0x533b35[_0x68fd('0x99')](),_0x9f28c3)[_0x68fd('0x25')](function(_0x130b64){_0x2c24d8=_['keyBy'](_0x130b64,'id');_0x9f28c3=_[_0x68fd('0x9b')](_0x9f28c3,{'model':db[_0x68fd('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d43ea[_0x68fd('0x39')]['fields']){_0x5e23ae[_0x68fd('0x3d')][_0x68fd('0x6a')](function(_0x49e0c5){_0x2be3de[_0x68fd('0x45')]('i.'+_0x49e0c5);});}else{_0x2be3de['field'](_0x68fd('0x8e'),_0x68fd('0x5c'));_0x2be3de[_0x68fd('0x45')](_0x68fd('0x9c'),_0x68fd('0x9d'));_0x2be3de[_0x68fd('0x45')](_0x68fd('0x9e'),'Account.mandatoryDisposition');_0x2be3de[_0x68fd('0x45')](_0x68fd('0x9f'));_0x2be3de[_0x68fd('0x45')](_0x68fd('0xa0'),_0x68fd('0xa1'));_0x2be3de[_0x68fd('0x45')](_0x68fd('0xa2'),_0x68fd('0xa3'));_0x2be3de[_0x68fd('0x45')](_0x68fd('0xa4'),_0x68fd('0xa5'));_0x2be3de[_0x68fd('0x45')](_0x68fd('0xa6'),_0x68fd('0xa7'));_0x2be3de[_0x68fd('0x45')]('c.mobile','Contact.mobile');_0x2be3de[_0x68fd('0x45')]('c.fax',_0x68fd('0xa8'));_0x2be3de[_0x68fd('0x45')](_0x68fd('0xa9'),'Owner.fullname');_0x2be3de[_0x68fd('0x45')](_0x68fd('0xaa'),_0x68fd('0xab'));_0x2be3de['field'](_0x68fd('0xac'),_0x68fd('0x2e'));}_0x2be3de[_0x68fd('0x20')](_0x5e23ae[_0x68fd('0x20')]);_0x2be3de[_0x68fd('0x1f')](_0x5e23ae['offset']);return db[_0x68fd('0x9a')][_0x68fd('0x39')](_0x2be3de[_0x68fd('0x99')](),_0x9f28c3);})['then'](function(_0x5674be){_0x234e17['where'](_0x68fd('0xad'),_['map'](_0x5674be,'id'));return db['sequelize'][_0x68fd('0x39')](_0x234e17[_0x68fd('0x99')](),_0x9f28c3)['then'](function(_0x412f92){var _0x3e5c7f=_[_0x68fd('0xae')](_0x412f92,'FaxInteractionId');var _0x42efda=[];_0x5674be['forEach'](function(_0x49f42a){_0x42efda[_0x68fd('0x31')](updateFaxInteraction(_0x49f42a,_0x2c24d8,_0x3e5c7f));});return BPromise['all'](_0x42efda);});});})[_0x68fd('0x25')](function(_0x5910af){_0x559cd5[_0x68fd('0xaf')]=_0x5910af;return _0x559cd5;})[_0x68fd('0x25')](respondWithFilteredResult(_0x1a8712,_0x5e23ae));})['catch'](handleError(_0x1a8712,null));};exports[_0x68fd('0xb0')]=function(_0x373efe,_0x12826b){var _0x17f101={'raw':![],'where':{'id':_0x373efe[_0x68fd('0xb1')]['id']}},_0x17b4a8={};_0x17b4a8[_0x68fd('0x38')]=_[_0x68fd('0x3a')](db[_0x68fd('0x34')][_0x68fd('0x35')]);_0x17b4a8[_0x68fd('0x39')]=_[_0x68fd('0x3a')](_0x373efe[_0x68fd('0x39')]);_0x17b4a8[_0x68fd('0x3b')]=_[_0x68fd('0x3c')](_0x17b4a8[_0x68fd('0x38')],_0x17b4a8['query']);_0x17f101[_0x68fd('0x3d')]=_[_0x68fd('0x3c')](_0x17b4a8['model'],qs[_0x68fd('0x3e')](_0x373efe[_0x68fd('0x39')][_0x68fd('0x3e')]));_0x17f101['attributes']=_0x17f101['attributes'][_0x68fd('0x3f')]?_0x17f101[_0x68fd('0x3d')]:_0x17b4a8[_0x68fd('0x38')];if(_0x373efe[_0x68fd('0x39')][_0x68fd('0xb2')]){_0x17f101['include']=[{'all':!![]}];}_0x17f101=_[_0x68fd('0x9b')]({},_0x17f101,_0x373efe['options']);return db[_0x68fd('0x34')][_0x68fd('0x5b')](_0x17f101)[_0x68fd('0x25')](handleEntityNotFound(_0x12826b,null))['then'](respondWithResult(_0x12826b,null))[_0x68fd('0x32')](handleError(_0x12826b,null));};exports[_0x68fd('0xb3')]=function(_0x2e65b6,_0x450e22){return db[_0x68fd('0x34')][_0x68fd('0xb3')](_0x2e65b6[_0x68fd('0x6f')],{})[_0x68fd('0x25')](respondWithResult(_0x450e22,0xc9))[_0x68fd('0x32')](handleError(_0x450e22,null));};exports[_0x68fd('0xb4')]=function(_0x51d7ab,_0x2c86f1){if(_0x51d7ab['body']['id']){delete _0x51d7ab[_0x68fd('0x6f')]['id'];}return db[_0x68fd('0x34')][_0x68fd('0x5b')]({'where':{'id':_0x51d7ab[_0x68fd('0xb1')]['id']}})[_0x68fd('0x25')](handleEntityNotFound(_0x2c86f1,null))['then'](saveUpdates(_0x51d7ab['body'],null))[_0x68fd('0x25')](respondWithResult(_0x2c86f1,null))[_0x68fd('0x32')](handleError(_0x2c86f1,null));};exports['destroy']=function(_0x4a68ed,_0x1d1cbb){return db['FaxInteraction'][_0x68fd('0x5b')]({'where':{'id':_0x4a68ed[_0x68fd('0xb1')]['id']}})[_0x68fd('0x25')](handleEntityNotFound(_0x1d1cbb,null))[_0x68fd('0x25')](removeEntity(_0x1d1cbb,null))[_0x68fd('0x32')](handleError(_0x1d1cbb,null));};exports[_0x68fd('0xb5')]=function(_0x1cba51,_0x16ac07){return db['FaxInteraction'][_0x68fd('0xb5')]()[_0x68fd('0x25')](respondWithResult(_0x16ac07,null))['catch'](handleError(_0x16ac07,null));};exports[_0x68fd('0xb6')]=function(_0x4ff86e,_0x38fe4c,_0x4d001a){return db['FaxMessage'][_0x68fd('0x5b')]({'where':{'id':_0x4ff86e[_0x68fd('0xb1')]['id']}})['then'](handleEntityNotFound(_0x38fe4c,null))['then'](function(_0x2ba8bd){if(_0x2ba8bd){return _0x2ba8bd['addMessage'](_0x4ff86e['body'][_0x68fd('0xb7')],_[_0x68fd('0xb8')](_0x4ff86e[_0x68fd('0x6f')],[_0x68fd('0xb7'),'id'])||{});}})[_0x68fd('0x25')](respondWithResult(_0x38fe4c,null))['catch'](handleError(_0x38fe4c,null));};exports['getMessages']=function(_0xadbfef,_0xadc2e2,_0x40527a){var _0xb9b01={'raw':![],'where':{}};var _0x17bdd8={};var _0x1004f9={'count':0x0,'rows':[]};return db[_0x68fd('0x34')][_0x68fd('0xb9')]({'where':{'id':_0xadbfef[_0x68fd('0xb1')]['id']}})[_0x68fd('0x25')](handleEntityNotFound(_0xadc2e2,null))[_0x68fd('0x25')](function(_0xb5f58c){if(_0xb5f58c){_0x17bdd8['model']=_[_0x68fd('0x3a')](db['FaxMessage'][_0x68fd('0x35')]);_0x17bdd8['query']=_['keys'](_0xadbfef[_0x68fd('0x39')]);_0x17bdd8[_0x68fd('0x3b')]=_[_0x68fd('0x3c')](_0x17bdd8[_0x68fd('0x38')],_0x17bdd8['query']);_0xb9b01[_0x68fd('0x3d')]=_[_0x68fd('0x3c')](_0x17bdd8[_0x68fd('0x38')],qs[_0x68fd('0x3e')](_0xadbfef[_0x68fd('0x39')][_0x68fd('0x3e')]));_0xb9b01[_0x68fd('0x3d')]=_0xb9b01['attributes'][_0x68fd('0x3f')]?_0xb9b01['attributes']:_0x17bdd8[_0x68fd('0x38')];if(!_0xadbfef[_0x68fd('0x39')]['hasOwnProperty'](_0x68fd('0x41'))){_0xb9b01['limit']=qs[_0x68fd('0x20')](_0xadbfef[_0x68fd('0x39')][_0x68fd('0x20')]);_0xb9b01[_0x68fd('0x1f')]=qs[_0x68fd('0x1f')](_0xadbfef['query'][_0x68fd('0x1f')]);}_0xb9b01[_0x68fd('0x42')]=qs[_0x68fd('0x43')](_0xadbfef[_0x68fd('0x39')]['sort']);_0xb9b01[_0x68fd('0x73')]=qs[_0x68fd('0x3b')](_[_0x68fd('0x44')](_0xadbfef[_0x68fd('0x39')],_0x17bdd8[_0x68fd('0x3b')]));_0xb9b01[_0x68fd('0x73')][_0x68fd('0xba')]=_0xb5f58c['id'];if(_0xadbfef['query'][_0x68fd('0x82')]){_0xb9b01[_0x68fd('0x73')]=_[_0x68fd('0x9b')](_0xb9b01[_0x68fd('0x73')],{'$or':_[_0x68fd('0x2c')](_0xb9b01['attributes'],function(_0x3698fe){var _0xa77eeb={};_0xa77eeb[_0x3698fe]={'$like':'%'+_0xadbfef[_0x68fd('0x39')][_0x68fd('0x82')]+'%'};return _0xa77eeb;})});}if(_0xadbfef[_0x68fd('0x39')][_0x68fd('0xbb')]){var _0x22b197=_0xadbfef['query'][_0x68fd('0xbb')][_0x68fd('0x30')](',');var _0x246bca={};_0x246bca[_0x22b197[0x0]]={'$gte':moment(_0x22b197[0x1])[_0x68fd('0xbc')](_0x68fd('0xbd'))};_0xb9b01[_0x68fd('0x73')]=_[_0x68fd('0x9b')](_0xb9b01[_0x68fd('0x73')],_0x246bca);}_0xb9b01=_[_0x68fd('0x9b')]({},_0xb9b01,_0xadbfef[_0x68fd('0xbe')]);return db[_0x68fd('0xbf')][_0x68fd('0x1e')]({'where':_0xb9b01['where']})[_0x68fd('0x25')](function(_0x1ea0a6){_0x1004f9['count']=_0x1ea0a6;if(_0xadbfef['query'][_0x68fd('0xb2')]){_0xb9b01[_0x68fd('0xc0')]=[{'all':!![]}];}return db[_0x68fd('0xbf')][_0x68fd('0xc1')](_0xb9b01);})[_0x68fd('0x25')](function(_0x1e7ac7){_0x1004f9[_0x68fd('0xaf')]=_0x1e7ac7;return _0x1004f9;});}})[_0x68fd('0x25')](respondWithFilteredResult(_0xadc2e2,_0xb9b01))[_0x68fd('0x32')](handleError(_0xadc2e2,null));};exports['addTags']=function(_0x375fab,_0x126f42,_0xaa72b){return db[_0x68fd('0x34')][_0x68fd('0x5b')]({'where':{'id':_0x375fab[_0x68fd('0xb1')]['id']}})[_0x68fd('0x25')](handleEntityNotFound(_0x126f42,null))['then'](function(_0x535ff9){if(_0x535ff9){return _0x535ff9['setTags'](_0x375fab['body'][_0x68fd('0xb7')],_[_0x68fd('0xb8')](_0x375fab['body'],['ids','id'])||{})[_0x68fd('0xc2')](function(){return db['Tag'][_0x68fd('0xc1')]({'attributes':['id','name',_0x68fd('0x46')],'where':{'id':_0x375fab[_0x68fd('0x6f')][_0x68fd('0xb7')]}});})['then'](function(_0x3cdb7b){socket[_0x68fd('0xc3')]('faxInteractionTags:save',{'id':Number(_0x375fab[_0x68fd('0xb1')]['id']),'tags':_0x3cdb7b||[]});return{'id':Number(_0x375fab[_0x68fd('0xb1')]['id']),'tags':_0x3cdb7b||[]};});}})[_0x68fd('0x25')](respondWithResult(_0x126f42,null))[_0x68fd('0x32')](handleError(_0x126f42,null));};exports[_0x68fd('0xc4')]=function(_0x581d13,_0x4c57ee,_0x53794a){return db[_0x68fd('0x34')][_0x68fd('0x5b')]({'where':{'id':_0x581d13[_0x68fd('0xb1')]['id']}})[_0x68fd('0x25')](handleEntityNotFound(_0x4c57ee,null))[_0x68fd('0x25')](function(_0x1c5a5d){if(_0x1c5a5d){return _0x1c5a5d[_0x68fd('0xc4')](_0x581d13[_0x68fd('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x4c57ee,null))[_0x68fd('0x32')](handleError(_0x4c57ee,null));};exports[_0x68fd('0xc5')]=function(_0x334f3e,_0x30c457){var _0x829506=moment()['unix']()['toString']();var _0x2de0e2=path[_0x68fd('0xc6')](config[_0x68fd('0xc7')],'server','files','tmp');var _0x2f99ee=path[_0x68fd('0xc6')](config[_0x68fd('0xc7')],_0x68fd('0xc8'),'files',_0x68fd('0xc9'));var _0x4a6a85=path['join'](_0x2de0e2,_0x829506);var _0x3cfb7e=util[_0x68fd('0xbc')]('transcript-%d-%s.zip',_0x334f3e[_0x68fd('0xb1')]['id'],_0x829506);var _0x1f8786=path[_0x68fd('0xc6')](_0x2de0e2,_0x3cfb7e);var _0x5d7439=[];_0x5d7439['push']({'model':db[_0x68fd('0xca')],'as':_0x68fd('0xca'),'raw':!![]});var _0x1f0a26=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id','body',_0x68fd('0x75')],'include':_0x5d7439}];return db[_0x68fd('0x34')]['find']({'where':{'id':_0x334f3e[_0x68fd('0xb1')]['id']},'include':_0x1f0a26})[_0x68fd('0x25')](handleEntityNotFound(_0x30c457,null))[_0x68fd('0x25')](function(_0xd83bd7){if(_0xd83bd7&&_0xd83bd7[_0x68fd('0xcb')]){var _0xf0a762=_0xd83bd7[_0x68fd('0xcc')]({'plain':!![]});fs[_0x68fd('0xcd')](_0x4a6a85);for(var _0x429dbc=0x0;_0x429dbc<_0xf0a762['Messages']['length'];_0x429dbc++){var _0x31990f=_0xf0a762[_0x68fd('0xcb')][_0x429dbc][_0x68fd('0xca')];if(_0x31990f){var _0x38179d=path[_0x68fd('0xc6')](_0x2f99ee,_0x31990f[_0x68fd('0xce')]);if(fs[_0x68fd('0xcf')](_0x38179d)){fs[_0x68fd('0xd0')](_0x38179d)[_0x68fd('0xd1')](fs[_0x68fd('0xd2')](path[_0x68fd('0xc6')](_0x4a6a85,_0x31990f[_0x68fd('0xce')])));}}}return BPromise[_0x68fd('0x91')]()[_0x68fd('0x25')](function(){return new BPromise(function(_0x561b62,_0x5adbc1){zipdir(_0x4a6a85,{'saveTo':_0x1f8786},function(_0x432db2,_0x3adb1b){if(_0x432db2)return _0x5adbc1(_0x432db2);return _0x561b62(_0x3adb1b);});})[_0x68fd('0x25')](function(){return new BPromise(function(_0x51fd73,_0x4f0cb4){rimraf(_0x4a6a85,function(_0x31b74d){if(_0x31b74d)_0x4f0cb4(_0x31b74d);return _0x51fd73();});});})[_0x68fd('0x25')](function(){return _0x30c457[_0x68fd('0xc5')](_0x1f8786,_0x3cfb7e,function(_0x22d1f3){if(_0x22d1f3){console[_0x68fd('0xd3')](_0x68fd('0xd4'),_0x22d1f3);}else{fs['unlinkSync'](_0x1f8786);}});});});}else{return _0x30c457['sendStatus'](0xc8);}})[_0x68fd('0x32')](handleError(_0x30c457,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 4f48076..a581f3b 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 _0x2ef3=['remove','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ef3,0xba));var _0x32ef=function(_0x37f333,_0x1c5e01){_0x37f333=_0x37f333-0x0;var _0x33f57a=_0x2ef3[_0x37f333];return _0x33f57a;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var FaxInteraction=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var FaxMessage=require(_0x32ef('0x1'))['db'][_0x32ef('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x32ef('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x32ef('0x5'),'afterDestroy':_0x32ef('0x6')};function emitEvent(_0x524ab6){return function(_0x402857,_0x37dd1d,_0x4c8104){_0x402857['getUsers']({'attributes':['id'],'raw':!![]})[_0x32ef('0x7')](function(_0x4bfcf8){_0x402857[_0x32ef('0x8')](_0x32ef('0x9'),_0x4bfcf8[_0x32ef('0xa')](function(_0x298066){return{'id':_0x298066['id']};}));return FaxMessage[_0x32ef('0xb')]({'where':{'FaxInteractionId':_0x402857['id'],'direction':'in','read':![]},'raw':!![]});})[_0x32ef('0x7')](function(_0x28275c){_0x402857[_0x32ef('0x8')]('unreadMessages',_0x28275c['length']);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6+':'+_0x402857['id'],_0x402857);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6,_0x402857);_0x4c8104(null);})[_0x32ef('0xd')](_0x4c8104(null));};}for(var e in events){if(events[_0x32ef('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x32ef('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x2ef3=['remove','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ef3,0xba));var _0x32ef=function(_0x2f4859,_0x22227a){_0x2f4859=_0x2f4859-0x0;var _0xe5dae1=_0x2ef3[_0x2f4859];return _0xe5dae1;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var FaxInteraction=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var FaxMessage=require(_0x32ef('0x1'))['db'][_0x32ef('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x32ef('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x32ef('0x5'),'afterDestroy':_0x32ef('0x6')};function emitEvent(_0x524ab6){return function(_0x402857,_0x37dd1d,_0x4c8104){_0x402857['getUsers']({'attributes':['id'],'raw':!![]})[_0x32ef('0x7')](function(_0x4bfcf8){_0x402857[_0x32ef('0x8')](_0x32ef('0x9'),_0x4bfcf8[_0x32ef('0xa')](function(_0x298066){return{'id':_0x298066['id']};}));return FaxMessage[_0x32ef('0xb')]({'where':{'FaxInteractionId':_0x402857['id'],'direction':'in','read':![]},'raw':!![]});})[_0x32ef('0x7')](function(_0x28275c){_0x402857[_0x32ef('0x8')]('unreadMessages',_0x28275c['length']);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6+':'+_0x402857['id'],_0x402857);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6,_0x402857);_0x4c8104(null);})[_0x32ef('0xd')](_0x4c8104(null));};}for(var e in events){if(events[_0x32ef('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x32ef('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 c3cd391..c435750 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 _0x3a8e=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','fax_interactions'];(function(_0x1d092e,_0x1f56d3){var _0x3f3bcd=function(_0x18b299){while(--_0x18b299){_0x1d092e['push'](_0x1d092e['shift']());}};_0x3f3bcd(++_0x1f56d3);}(_0x3a8e,0x148));var _0xe3a8=function(_0x26a515,_0x286339){_0x26a515=_0x26a515-0x0;var _0x314682=_0x3a8e[_0x26a515];return _0x314682;};'use strict';var _=require(_0xe3a8('0x0'));var util=require(_0xe3a8('0x1'));var logger=require(_0xe3a8('0x2'))('api');var moment=require(_0xe3a8('0x3'));var BPromise=require(_0xe3a8('0x4'));var rp=require(_0xe3a8('0x5'));var fs=require('fs');var path=require(_0xe3a8('0x6'));var rimraf=require(_0xe3a8('0x7'));var config=require(_0xe3a8('0x8'));var attributes=require(_0xe3a8('0x9'));module['exports']=function(_0x388aaa,_0x274bc0){return _0x388aaa[_0xe3a8('0xa')]('FaxInteraction',attributes,{'tableName':_0xe3a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2fd46b,_0x322ec5,_0xc05ac0){if(_0x2fd46b[_0xe3a8('0xc')](_0xe3a8('0xd'))){_0x2fd46b[_0xe3a8('0xe')]=moment()[_0xe3a8('0xf')](_0xe3a8('0x10'));}_0xc05ac0(null,_0x2fd46b);}}});}; \ No newline at end of file +var _0xdbf1=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions'];(function(_0x5d41af,_0x50e55c){var _0x5b9faf=function(_0x2c3814){while(--_0x2c3814){_0x5d41af['push'](_0x5d41af['shift']());}};_0x5b9faf(++_0x50e55c);}(_0xdbf1,0xa4));var _0x1dbf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdbf1[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1dbf('0x0'));var util=require('util');var logger=require(_0x1dbf('0x1'))(_0x1dbf('0x2'));var moment=require(_0x1dbf('0x3'));var BPromise=require('bluebird');var rp=require(_0x1dbf('0x4'));var fs=require('fs');var path=require(_0x1dbf('0x5'));var rimraf=require(_0x1dbf('0x6'));var config=require(_0x1dbf('0x7'));var attributes=require(_0x1dbf('0x8'));module['exports']=function(_0x1f860e,_0x1bdff4){return _0x1f860e[_0x1dbf('0x9')](_0x1dbf('0xa'),attributes,{'tableName':_0x1dbf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b65aa,_0x34e6e0,_0x936d61){if(_0x4b65aa['changed'](_0x1dbf('0xc'))){_0x4b65aa[_0x1dbf('0xd')]=moment()[_0x1dbf('0xe')](_0x1dbf('0xf'));}_0x936d61(null,_0x4b65aa);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index ecdade0..7039257 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 _0x6df0=['redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','update','body','options','raw','where','limit','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','FaxInteraction','find','addTags','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x6df0,0x145));var _0x06df=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x6df0[_0x4d7f3f];return _0x5d67cc;};'use strict';var _=require(_0x06df('0x0'));var util=require(_0x06df('0x1'));var moment=require('moment');var BPromise=require(_0x06df('0x2'));var rs=require(_0x06df('0x3'));var fs=require('fs');var Redis=require(_0x06df('0x4'));var db=require(_0x06df('0x5'))['db'];var utils=require(_0x06df('0x6'));var logger=require(_0x06df('0x7'))(_0x06df('0x8'));var config=require(_0x06df('0x9'));var jayson=require(_0x06df('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x06df('0xb')]=_[_0x06df('0xc')](config[_0x06df('0xb')],{'host':_0x06df('0xd'),'port':0x18eb});var socket=require(_0x06df('0xe'))(new Redis(config[_0x06df('0xb')]));require(_0x06df('0xf'))[_0x06df('0x10')](socket);function respondWithRpcPromise(_0x24c45f,_0x531c33,_0x2f8d77){return new BPromise(function(_0x3f77d7,_0x2f05cd){return client['request'](_0x24c45f,_0x2f8d77)[_0x06df('0x11')](function(_0x54d09a){logger[_0x06df('0x12')](_0x06df('0x13'),_0x531c33,_0x06df('0x14'));logger[_0x06df('0x15')](_0x06df('0x16'),_0x531c33,_0x06df('0x14'),JSON['stringify'](_0x54d09a));if(_0x54d09a['error']){if(_0x54d09a[_0x06df('0x17')]['code']===0x1f4){logger['error'](_0x06df('0x13'),_0x531c33,_0x54d09a[_0x06df('0x17')][_0x06df('0x18')]);return _0x2f05cd(_0x54d09a[_0x06df('0x17')]['message']);}logger[_0x06df('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x531c33,_0x54d09a[_0x06df('0x17')][_0x06df('0x18')]);return _0x3f77d7(_0x54d09a['error'][_0x06df('0x18')]);}else{logger[_0x06df('0x12')](_0x06df('0x13'),_0x531c33,'request\x20sent');_0x3f77d7(_0x54d09a[_0x06df('0x19')][_0x06df('0x18')]);}})[_0x06df('0x1a')](function(_0xb0c6aa){logger[_0x06df('0x17')](_0x06df('0x13'),_0x531c33,_0xb0c6aa);_0x2f05cd(_0xb0c6aa);});});}exports['UpdateFaxInteraction']=function(_0x11d215){var _0x1b8c07=this;return new Promise(function(_0x3de241,_0x163ccc){return db['FaxInteraction'][_0x06df('0x1b')](_0x11d215[_0x06df('0x1c')],{'raw':_0x11d215[_0x06df('0x1d')]?_0x11d215[_0x06df('0x1d')][_0x06df('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11d215[_0x06df('0x1d')]?_0x11d215[_0x06df('0x1d')][_0x06df('0x1f')]||null:null,'attributes':_0x11d215[_0x06df('0x1d')]?_0x11d215[_0x06df('0x1d')]['attributes']||null:null,'limit':_0x11d215[_0x06df('0x1d')]?_0x11d215[_0x06df('0x1d')][_0x06df('0x20')]||null:null})['then'](function(_0x33f6ab){logger[_0x06df('0x12')](_0x06df('0x21'),_0x11d215);logger[_0x06df('0x15')]('UpdateFaxInteraction',_0x11d215,JSON[_0x06df('0x22')](_0x33f6ab));_0x3de241(_0x33f6ab);})[_0x06df('0x1a')](function(_0x40e8f7){logger[_0x06df('0x17')]('UpdateFaxInteraction',_0x40e8f7['message'],_0x11d215);_0x163ccc(_0x1b8c07[_0x06df('0x17')](0x1f4,_0x40e8f7[_0x06df('0x18')]));});});};exports[_0x06df('0x23')]=function(_0x3ecd7a){return new Promise(function(_0x4333c9,_0x588703){return db[_0x06df('0x24')][_0x06df('0x25')]({'where':_0x3ecd7a[_0x06df('0x1d')]?_0x3ecd7a['options'][_0x06df('0x1f')]||null:null})['then'](function(_0x4bea88){if(_0x4bea88){return _0x4bea88[_0x06df('0x26')](_0x3ecd7a[_0x06df('0x1c')]['ids'],_[_0x06df('0x27')](_0x3ecd7a[_0x06df('0x1c')],['ids','id'])||{});}})[_0x06df('0x28')](function(_0x2b5b65){logger[_0x06df('0x12')](_0x06df('0x29'),_0x3ecd7a);logger[_0x06df('0x15')](_0x06df('0x29'),_0x3ecd7a,JSON[_0x06df('0x22')](_0x2b5b65));_0x4333c9(_0x2b5b65);})['catch'](function(_0x3f1d2d){logger[_0x06df('0x17')]('AddTags',_0x3f1d2d[_0x06df('0x18')],_0x3ecd7a);_0x588703(_this['error'](0x1f4,_0x3f1d2d[_0x06df('0x18')]));});});}; \ No newline at end of file +var _0x64be=['stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','AddTagsToFaxInteraction','addTags','ids','omit','spread','AddTags','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x7f2b94,_0x561107){var _0x11f212=function(_0x52a9f2){while(--_0x52a9f2){_0x7f2b94['push'](_0x7f2b94['shift']());}};_0x11f212(++_0x561107);}(_0x64be,0x197));var _0xe64b=function(_0x272f3d,_0x1540c1){_0x272f3d=_0x272f3d-0x0;var _0x27e53e=_0x64be[_0x272f3d];return _0x27e53e;};'use strict';var _=require(_0xe64b('0x0'));var util=require(_0xe64b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe64b('0x2'));var db=require(_0xe64b('0x3'))['db'];var utils=require(_0xe64b('0x4'));var logger=require(_0xe64b('0x5'))('rpc');var config=require(_0xe64b('0x6'));var jayson=require(_0xe64b('0x7'));var client=jayson[_0xe64b('0x8')][_0xe64b('0x9')]({'port':0x232a});config[_0xe64b('0xa')]=_[_0xe64b('0xb')](config[_0xe64b('0xa')],{'host':_0xe64b('0xc'),'port':0x18eb});var socket=require(_0xe64b('0xd'))(new Redis(config[_0xe64b('0xa')]));require(_0xe64b('0xe'))['register'](socket);function respondWithRpcPromise(_0x252baa,_0x5ea95c,_0x3dc71a){return new BPromise(function(_0x437146,_0x463623){return client[_0xe64b('0xf')](_0x252baa,_0x3dc71a)[_0xe64b('0x10')](function(_0x101522){logger[_0xe64b('0x11')](_0xe64b('0x12'),_0x5ea95c,_0xe64b('0x13'));logger[_0xe64b('0x14')](_0xe64b('0x15'),_0x5ea95c,'request\x20sent',JSON[_0xe64b('0x16')](_0x101522));if(_0x101522[_0xe64b('0x17')]){if(_0x101522['error'][_0xe64b('0x18')]===0x1f4){logger['error'](_0xe64b('0x12'),_0x5ea95c,_0x101522[_0xe64b('0x17')][_0xe64b('0x19')]);return _0x463623(_0x101522[_0xe64b('0x17')][_0xe64b('0x19')]);}logger[_0xe64b('0x17')](_0xe64b('0x12'),_0x5ea95c,_0x101522[_0xe64b('0x17')][_0xe64b('0x19')]);return _0x437146(_0x101522['error'][_0xe64b('0x19')]);}else{logger[_0xe64b('0x11')](_0xe64b('0x12'),_0x5ea95c,'request\x20sent');_0x437146(_0x101522['result'][_0xe64b('0x19')]);}})[_0xe64b('0x1a')](function(_0x5bdcb6){logger[_0xe64b('0x17')](_0xe64b('0x12'),_0x5ea95c,_0x5bdcb6);_0x463623(_0x5bdcb6);});});}exports[_0xe64b('0x1b')]=function(_0x4dbe0a){var _0x4dd4e7=this;return new Promise(function(_0x3a82e5,_0x2f7e01){return db[_0xe64b('0x1c')]['update'](_0x4dbe0a[_0xe64b('0x1d')],{'raw':_0x4dbe0a[_0xe64b('0x1e')]?_0x4dbe0a[_0xe64b('0x1e')][_0xe64b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dbe0a[_0xe64b('0x1e')]?_0x4dbe0a[_0xe64b('0x1e')][_0xe64b('0x20')]||null:null,'attributes':_0x4dbe0a[_0xe64b('0x1e')]?_0x4dbe0a[_0xe64b('0x1e')]['attributes']||null:null,'limit':_0x4dbe0a['options']?_0x4dbe0a['options']['limit']||null:null})[_0xe64b('0x10')](function(_0x55898c){logger[_0xe64b('0x11')]('UpdateFaxInteraction',_0x4dbe0a);logger[_0xe64b('0x14')]('UpdateFaxInteraction',_0x4dbe0a,JSON[_0xe64b('0x16')](_0x55898c));_0x3a82e5(_0x55898c);})[_0xe64b('0x1a')](function(_0x11384c){logger[_0xe64b('0x17')]('UpdateFaxInteraction',_0x11384c[_0xe64b('0x19')],_0x4dbe0a);_0x2f7e01(_0x4dd4e7[_0xe64b('0x17')](0x1f4,_0x11384c[_0xe64b('0x19')]));});});};exports[_0xe64b('0x21')]=function(_0x23348a){return new Promise(function(_0x4e75bd,_0x1c310e){return db[_0xe64b('0x1c')]['find']({'where':_0x23348a['options']?_0x23348a[_0xe64b('0x1e')][_0xe64b('0x20')]||null:null})[_0xe64b('0x10')](function(_0x5c7907){if(_0x5c7907){return _0x5c7907[_0xe64b('0x22')](_0x23348a[_0xe64b('0x1d')][_0xe64b('0x23')],_[_0xe64b('0x24')](_0x23348a[_0xe64b('0x1d')],[_0xe64b('0x23'),'id'])||{});}})[_0xe64b('0x25')](function(_0x2d65ab){logger[_0xe64b('0x11')](_0xe64b('0x26'),_0x23348a);logger[_0xe64b('0x14')](_0xe64b('0x26'),_0x23348a,JSON[_0xe64b('0x16')](_0x2d65ab));_0x4e75bd(_0x2d65ab);})['catch'](function(_0x1a253c){logger[_0xe64b('0x17')]('AddTags',_0x1a253c[_0xe64b('0x19')],_0x23348a);_0x1c310e(_this[_0xe64b('0x17')](0x1f4,_0x1a253c[_0xe64b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index e7f7eb5..ca6363f 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 _0x225d=['length','./faxInteraction.events','update','emit','register'];(function(_0x1ea774,_0x5c538f){var _0x4c1df6=function(_0x1c9720){while(--_0x1c9720){_0x1ea774['push'](_0x1ea774['shift']());}};_0x4c1df6(++_0x5c538f);}(_0x225d,0xc4));var _0xd225=function(_0x240c26,_0x2133d3){_0x240c26=_0x240c26-0x0;var _0x1c8c1a=_0x225d[_0x240c26];return _0x1c8c1a;};'use strict';var FaxInteractionEvents=require(_0xd225('0x0'));var events=['save','remove',_0xd225('0x1')];function createListener(_0x5e5a4a,_0x275afb){return function(_0x31d308){_0x275afb[_0xd225('0x2')](_0x5e5a4a,_0x31d308);};}function removeListener(_0xd507bd,_0x4d4d79){return function(){FaxInteractionEvents['removeListener'](_0xd507bd,_0x4d4d79);};}exports[_0xd225('0x3')]=function(_0x3c037d){for(var _0x1fdf2f=0x0,_0x40f6ee=events[_0xd225('0x4')];_0x1fdf2f<_0x40f6ee;_0x1fdf2f++){var _0x154a3d=events[_0x1fdf2f];var _0x1b6a42=createListener('faxInteraction:'+_0x154a3d,_0x3c037d);FaxInteractionEvents['on'](_0x154a3d,_0x1b6a42);}}; \ No newline at end of file +var _0x96e1=['remove','emit','removeListener','register','faxInteraction:'];(function(_0x20f715,_0x352dc2){var _0x1532d1=function(_0x10e770){while(--_0x10e770){_0x20f715['push'](_0x20f715['shift']());}};_0x1532d1(++_0x352dc2);}(_0x96e1,0x186));var _0x196e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x96e1[_0x122ef9];return _0x42fba0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x196e('0x0'),'update'];function createListener(_0x51288c,_0x407eea){return function(_0x5da718){_0x407eea[_0x196e('0x1')](_0x51288c,_0x5da718);};}function removeListener(_0x341401,_0x1aae79){return function(){FaxInteractionEvents[_0x196e('0x2')](_0x341401,_0x1aae79);};}exports[_0x196e('0x3')]=function(_0x197a0a){for(var _0x59c2b8=0x0,_0x5ef8c9=events['length'];_0x59c2b8<_0x5ef8c9;_0x59c2b8++){var _0x43664c=events[_0x59c2b8];var _0x5c3c1e=createListener(_0x196e('0x4')+_0x43664c,_0x197a0a);FaxInteractionEvents['on'](_0x43664c,_0x5c3c1e);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index d400eed..25cbcfc 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 _0x5c12=['show','getMessages','/:id/download','post','/:id/messages','addMessage','fax','faxinteraction:addtags','addTags','put','tracked','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','/:id','isAuthenticated'];(function(_0x3210d5,_0x2af039){var _0xb3dc8c=function(_0x441938){while(--_0x441938){_0x3210d5['push'](_0x3210d5['shift']());}};_0xb3dc8c(++_0x2af039);}(_0x5c12,0x188));var _0x25c1=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0x5c12[_0x2cc711];return _0x31a52e;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var auth=require(_0x25c1('0x4'));var interaction=require(_0x25c1('0x5'));var config=require(_0x25c1('0x6'));var controller=require(_0x25c1('0x7'));router[_0x25c1('0x8')]('/',auth['isAuthenticated'](),controller[_0x25c1('0x9')]);router[_0x25c1('0x8')](_0x25c1('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x25c1('0x8')](_0x25c1('0xb'),auth[_0x25c1('0xc')](),controller[_0x25c1('0xd')]);router[_0x25c1('0x8')]('/:id/messages',auth[_0x25c1('0xc')](),controller[_0x25c1('0xe')]);router[_0x25c1('0x8')](_0x25c1('0xf'),auth[_0x25c1('0xc')](),controller['download']);router[_0x25c1('0x10')]('/',auth[_0x25c1('0xc')](),controller['create']);router[_0x25c1('0x10')](_0x25c1('0x11'),auth[_0x25c1('0xc')](),controller[_0x25c1('0x12')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0x25c1('0x13'),_0x25c1('0x14')),controller[_0x25c1('0x15')]);router[_0x25c1('0x16')](_0x25c1('0xb'),auth['isAuthenticated'](),interaction[_0x25c1('0x17')]('fax','faxinteraction:update'),controller['update']);router[_0x25c1('0x18')](_0x25c1('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x25c1('0x13'),'faxinteraction:destroy'),controller[_0x25c1('0x19')]);router[_0x25c1('0x18')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x25c1('0x1a')]=router; \ No newline at end of file +var _0x5d66=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags'];(function(_0x2509c2,_0x9831bc){var _0x21ad8a=function(_0xb02424){while(--_0xb02424){_0x2509c2['push'](_0x2509c2['shift']());}};_0x21ad8a(++_0x9831bc);}(_0x5d66,0x109));var _0x65d6=function(_0x2549f4,_0x643407){_0x2549f4=_0x2549f4-0x0;var _0x459936=_0x5d66[_0x2549f4];return _0x459936;};'use strict';var multer=require(_0x65d6('0x0'));var util=require('util');var path=require(_0x65d6('0x1'));var timeout=require(_0x65d6('0x2'));var express=require(_0x65d6('0x3'));var router=express[_0x65d6('0x4')]();var auth=require(_0x65d6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65d6('0x6'));var controller=require(_0x65d6('0x7'));router[_0x65d6('0x8')]('/',auth[_0x65d6('0x9')](),controller[_0x65d6('0xa')]);router[_0x65d6('0x8')](_0x65d6('0xb'),auth[_0x65d6('0x9')](),controller[_0x65d6('0xc')]);router[_0x65d6('0x8')](_0x65d6('0xd'),auth[_0x65d6('0x9')](),controller[_0x65d6('0xe')]);router[_0x65d6('0x8')](_0x65d6('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0x65d6('0x8')](_0x65d6('0x10'),auth[_0x65d6('0x9')](),controller['download']);router[_0x65d6('0x11')]('/',auth['isAuthenticated'](),controller[_0x65d6('0x12')]);router['post'](_0x65d6('0xf'),auth[_0x65d6('0x9')](),controller[_0x65d6('0x13')]);router[_0x65d6('0x11')](_0x65d6('0x14'),auth[_0x65d6('0x9')](),interaction[_0x65d6('0x15')](_0x65d6('0x16'),_0x65d6('0x17')),controller[_0x65d6('0x18')]);router[_0x65d6('0x19')](_0x65d6('0xd'),auth[_0x65d6('0x9')](),interaction[_0x65d6('0x15')](_0x65d6('0x16'),_0x65d6('0x1a')),controller[_0x65d6('0x1b')]);router[_0x65d6('0x1c')](_0x65d6('0xd'),auth[_0x65d6('0x9')](),interaction[_0x65d6('0x15')](_0x65d6('0x16'),_0x65d6('0x1d')),controller[_0x65d6('0x1e')]);router[_0x65d6('0x1c')](_0x65d6('0x14'),auth['isAuthenticated'](),controller[_0x65d6('0x1f')]);module[_0x65d6('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 92b1fc3..3ac0793 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 _0xdec8=['out','DATE','sequelize','exports','TEXT','medium','ENUM'];(function(_0x49732d,_0x413d47){var _0x18dcaa=function(_0x49b904){while(--_0x49b904){_0x49732d['push'](_0x49732d['shift']());}};_0x18dcaa(++_0x413d47);}(_0xdec8,0x1e5));var _0x8dec=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xdec8[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x8dec('0x0'));module[_0x8dec('0x1')]={'body':{'type':Sequelize[_0x8dec('0x2')](_0x8dec('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8dec('0x4')]('in',_0x8dec('0x5')),'defaultValue':_0x8dec('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8dec('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8dec('0x6')]}}; \ No newline at end of file +var _0x5579=['sequelize','exports','TEXT','medium','out','DATE'];(function(_0x2f3ecd,_0x57976b){var _0xffdc44=function(_0xf21bc6){while(--_0xf21bc6){_0x2f3ecd['push'](_0x2f3ecd['shift']());}};_0xffdc44(++_0x57976b);}(_0x5579,0x90));var _0x9557=function(_0x4357dc,_0x555013){_0x4357dc=_0x4357dc-0x0;var _0x255285=_0x5579[_0x4357dc];return _0x255285;};'use strict';var Sequelize=require(_0x9557('0x0'));module[_0x9557('0x1')]={'body':{'type':Sequelize[_0x9557('0x2')](_0x9557('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9557('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x9557('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x9557('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 10f4922..acb8ac9 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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x275566,_0x5a87a7){var _0x13a58c=function(_0x3c12da){while(--_0x3c12da){_0x275566['push'](_0x275566['shift']());}};_0x13a58c(++_0x5a87a7);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a7fd1,_0x4bdde1){_0x4a7fd1=_0x4a7fd1-0x0;var _0x12ef10=_0xb10b[_0x4a7fd1];return _0x12ef10;};'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 708c6cf..4fca15b 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(_0x1e271f,_0xf14504){var _0x2b2ac5=function(_0x21c3b6){while(--_0x21c3b6){_0x1e271f['push'](_0x1e271f['shift']());}};_0x2b2ac5(++_0xf14504);}(_0x7217,0x19e));var _0x7721=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x7217[_0x5e3b04];return _0x1fc44d;};'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 _0x3e74=['hasOwnProperty','exports','events','FaxMessage','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x5ad792,_0x29bf9a){_0x5ad792=_0x5ad792-0x0;var _0x170baf=_0x3e74[_0x5ad792];return _0x170baf;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x43e7('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){FaxMessageEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);FaxMessageEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 8347091..0c154b2 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 _0xb3d2=['toLowerCase','UserId','FaxInteraction','FaxInteractionId','then','update','catch','error','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb3d2,0x175));var _0x2b3d=function(_0x3adec6,_0x41b3de){_0x3adec6=_0x3adec6-0x0;var _0x5ae990=_0xb3d2[_0x3adec6];return _0x5ae990;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2b3d('0x0'))(_0x2b3d('0x1'));var moment=require(_0x2b3d('0x2'));var BPromise=require(_0x2b3d('0x3'));var rp=require(_0x2b3d('0x4'));var fs=require('fs');var path=require(_0x2b3d('0x5'));var rimraf=require(_0x2b3d('0x6'));var config=require(_0x2b3d('0x7'));var attributes=require(_0x2b3d('0x8'));module['exports']=function(_0xd1a2e9,_0x291e1c){return _0xd1a2e9[_0x2b3d('0x9')](_0x2b3d('0xa'),attributes,{'tableName':_0x2b3d('0xb'),'paranoid':![],'indexes':[{'name':_0x2b3d('0xc'),'fields':[_0x2b3d('0xd')],'type':_0x2b3d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xccf13f,_0x2c7bc9,_0x127dca){var _0x2671cf=_0xd1a2e9['models'];var _0x3511a1=_0xccf13f[_0x2b3d('0xf')]({'plain':!![]});if(_0x3511a1['direction']['toLowerCase']()==='in'||_0x3511a1[_0x2b3d('0x10')][_0x2b3d('0x11')]()==='out'&&!_0x3511a1['secret']&&!_['isNil'](_0x3511a1[_0x2b3d('0x12')])){_0x2671cf[_0x2b3d('0x13')]['findOne']({'where':{'id':_0x3511a1[_0x2b3d('0x14')]}})[_0x2b3d('0x15')](function(_0x389edb){if(_0x389edb){_0x389edb[_0x2b3d('0x16')]({'lastMsgAt':_0x3511a1['createdAt'],'lastMsgDirection':_0x3511a1[_0x2b3d('0x10')]['toLowerCase']()});}})[_0x2b3d('0x17')](function(_0x518607){console[_0x2b3d('0x18')](_0x518607);});}_0x127dca();}},'charset':'utf8mb4','collate':_0x2b3d('0x19')});}; \ No newline at end of file +var _0x9d89=['fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','then','update','createdAt','catch','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','FaxMessage'];(function(_0x4e90f0,_0x3b7e3c){var _0x1a2cee=function(_0xc0c5f5){while(--_0xc0c5f5){_0x4e90f0['push'](_0x4e90f0['shift']());}};_0x1a2cee(++_0x3b7e3c);}(_0x9d89,0x10a));var _0x99d8=function(_0x2f7354,_0x87a86a){_0x2f7354=_0x2f7354-0x0;var _0x49c78b=_0x9d89[_0x2f7354];return _0x49c78b;};'use strict';var _=require(_0x99d8('0x0'));var util=require('util');var logger=require(_0x99d8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x99d8('0x2'));var rp=require(_0x99d8('0x3'));var fs=require('fs');var path=require(_0x99d8('0x4'));var rimraf=require('rimraf');var config=require(_0x99d8('0x5'));var attributes=require(_0x99d8('0x6'));module[_0x99d8('0x7')]=function(_0x2cc7a9,_0x48482f){return _0x2cc7a9['define'](_0x99d8('0x8'),attributes,{'tableName':_0x99d8('0x9'),'paranoid':![],'indexes':[{'name':_0x99d8('0xa'),'fields':[_0x99d8('0xb')],'type':_0x99d8('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x10fbae,_0x2436a6,_0xa6bb3b){var _0x4de827=_0x2cc7a9[_0x99d8('0xd')];var _0x2c7443=_0x10fbae['get']({'plain':!![]});if(_0x2c7443[_0x99d8('0xe')][_0x99d8('0xf')]()==='in'||_0x2c7443[_0x99d8('0xe')][_0x99d8('0xf')]()==='out'&&!_0x2c7443[_0x99d8('0x10')]&&!_[_0x99d8('0x11')](_0x2c7443[_0x99d8('0x12')])){_0x4de827[_0x99d8('0x13')][_0x99d8('0x14')]({'where':{'id':_0x2c7443['FaxInteractionId']}})[_0x99d8('0x15')](function(_0x3f5191){if(_0x3f5191){_0x3f5191[_0x99d8('0x16')]({'lastMsgAt':_0x2c7443[_0x99d8('0x17')],'lastMsgDirection':_0x2c7443[_0x99d8('0xe')][_0x99d8('0xf')]()});}})[_0x99d8('0x18')](function(_0x574ebf){console['error'](_0x574ebf);});}_0xa6bb3b();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index a98decd..31e0595 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 _0x4d6e=['options','raw','then','debug','UpdateFaxMessage','update','limit','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','FaxMessage','body'];(function(_0x20ed59,_0x3d6498){var _0x778dc1=function(_0x2f3389){while(--_0x2f3389){_0x20ed59['push'](_0x20ed59['shift']());}};_0x778dc1(++_0x3d6498);}(_0x4d6e,0x77));var _0xe4d6=function(_0x948e6c,_0x21ba9c){_0x948e6c=_0x948e6c-0x0;var _0x1302c5=_0x4d6e[_0x948e6c];return _0x1302c5;};'use strict';var _=require(_0xe4d6('0x0'));var util=require(_0xe4d6('0x1'));var moment=require(_0xe4d6('0x2'));var BPromise=require(_0xe4d6('0x3'));var rs=require(_0xe4d6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4d6('0x5'))['db'];var utils=require(_0xe4d6('0x6'));var logger=require(_0xe4d6('0x7'))(_0xe4d6('0x8'));var config=require(_0xe4d6('0x9'));var jayson=require(_0xe4d6('0xa'));var client=jayson[_0xe4d6('0xb')][_0xe4d6('0xc')]({'port':0x232a});config[_0xe4d6('0xd')]=_[_0xe4d6('0xe')](config[_0xe4d6('0xd')],{'host':_0xe4d6('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe4d6('0xd')]));require(_0xe4d6('0x10'))['register'](socket);function respondWithRpcPromise(_0x1cca29,_0x162a11,_0x782aa6){return new BPromise(function(_0xb27ad4,_0x2fb743){return client[_0xe4d6('0x11')](_0x1cca29,_0x782aa6)['then'](function(_0x4ca8b5){logger[_0xe4d6('0x12')](_0xe4d6('0x13'),_0x162a11,_0xe4d6('0x14'));logger['debug'](_0xe4d6('0x15'),_0x162a11,_0xe4d6('0x14'),JSON['stringify'](_0x4ca8b5));if(_0x4ca8b5[_0xe4d6('0x16')]){if(_0x4ca8b5[_0xe4d6('0x16')]['code']===0x1f4){logger[_0xe4d6('0x16')](_0xe4d6('0x13'),_0x162a11,_0x4ca8b5[_0xe4d6('0x16')][_0xe4d6('0x17')]);return _0x2fb743(_0x4ca8b5['error'][_0xe4d6('0x17')]);}logger[_0xe4d6('0x16')](_0xe4d6('0x13'),_0x162a11,_0x4ca8b5[_0xe4d6('0x16')]['message']);return _0xb27ad4(_0x4ca8b5[_0xe4d6('0x16')]['message']);}else{logger['info'](_0xe4d6('0x13'),_0x162a11,_0xe4d6('0x14'));_0xb27ad4(_0x4ca8b5[_0xe4d6('0x18')][_0xe4d6('0x17')]);}})[_0xe4d6('0x19')](function(_0x47e4bb){logger[_0xe4d6('0x16')](_0xe4d6('0x13'),_0x162a11,_0x47e4bb);_0x2fb743(_0x47e4bb);});});}exports[_0xe4d6('0x1a')]=function(_0x34f6bd){var _0x3895ed=this;return new Promise(function(_0x2fbefc,_0x26b9b6){return db[_0xe4d6('0x1b')]['create'](_0x34f6bd[_0xe4d6('0x1c')],{'raw':_0x34f6bd['options']?_0x34f6bd[_0xe4d6('0x1d')][_0xe4d6('0x1e')]===undefined?!![]:![]:!![]})[_0xe4d6('0x1f')](function(_0x162b57){logger[_0xe4d6('0x12')](_0xe4d6('0x1a'),_0x34f6bd);logger[_0xe4d6('0x20')](_0xe4d6('0x1a'),_0x34f6bd,JSON['stringify'](_0x162b57));_0x2fbefc(_0x162b57);})[_0xe4d6('0x19')](function(_0x12b159){logger['error'](_0xe4d6('0x1a'),_0x12b159[_0xe4d6('0x17')],_0x34f6bd);_0x26b9b6(_0x3895ed[_0xe4d6('0x16')](0x1f4,_0x12b159[_0xe4d6('0x17')]));});});};exports[_0xe4d6('0x21')]=function(_0x2f467f){var _0x1913ba=this;return new Promise(function(_0xb4fe6a,_0x53110a){return db[_0xe4d6('0x1b')][_0xe4d6('0x22')](_0x2f467f['body'],{'raw':_0x2f467f['options']?_0x2f467f['options'][_0xe4d6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f467f['options']?_0x2f467f[_0xe4d6('0x1d')]['where']||null:null,'attributes':_0x2f467f['options']?_0x2f467f[_0xe4d6('0x1d')]['attributes']||null:null,'limit':_0x2f467f['options']?_0x2f467f[_0xe4d6('0x1d')][_0xe4d6('0x23')]||null:null})['then'](function(_0x580d44){logger[_0xe4d6('0x12')](_0xe4d6('0x21'),_0x2f467f);logger['debug'](_0xe4d6('0x21'),_0x2f467f,JSON[_0xe4d6('0x24')](_0x580d44));_0xb4fe6a(_0x580d44);})[_0xe4d6('0x19')](function(_0x4479b8){logger[_0xe4d6('0x16')](_0xe4d6('0x21'),_0x4479b8['message'],_0x2f467f);_0x53110a(_0x1913ba['error'](0x1f4,_0x4479b8[_0xe4d6('0x17')]));});});}; \ No newline at end of file +var _0xfe58=['info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxMessage,\x20%s,\x20%s','message','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','attributes','limit','stringify','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','register','request'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfe58,0x1cf));var _0x8fe5=function(_0xc9bb08,_0x3ecfa8){_0xc9bb08=_0xc9bb08-0x0;var _0x350e87=_0xfe58[_0xc9bb08];return _0x350e87;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8fe5('0x0'));var BPromise=require(_0x8fe5('0x1'));var rs=require(_0x8fe5('0x2'));var fs=require('fs');var Redis=require(_0x8fe5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8fe5('0x4'));var logger=require(_0x8fe5('0x5'))(_0x8fe5('0x6'));var config=require(_0x8fe5('0x7'));var jayson=require(_0x8fe5('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x8fe5('0x9')]=_['defaults'](config[_0x8fe5('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8fe5('0xa'))(new Redis(config[_0x8fe5('0x9')]));require('./faxMessage.socket')[_0x8fe5('0xb')](socket);function respondWithRpcPromise(_0x11aa2f,_0x2e9c93,_0x4f16b8){return new BPromise(function(_0x4106c9,_0x313cd1){return client[_0x8fe5('0xc')](_0x11aa2f,_0x4f16b8)['then'](function(_0x53d274){logger[_0x8fe5('0xd')]('FaxMessage,\x20%s,\x20%s',_0x2e9c93,'request\x20sent');logger[_0x8fe5('0xe')](_0x8fe5('0xf'),_0x2e9c93,_0x8fe5('0x10'),JSON['stringify'](_0x53d274));if(_0x53d274[_0x8fe5('0x11')]){if(_0x53d274['error'][_0x8fe5('0x12')]===0x1f4){logger[_0x8fe5('0x11')](_0x8fe5('0x13'),_0x2e9c93,_0x53d274['error'][_0x8fe5('0x14')]);return _0x313cd1(_0x53d274[_0x8fe5('0x11')]['message']);}logger[_0x8fe5('0x11')](_0x8fe5('0x13'),_0x2e9c93,_0x53d274['error'][_0x8fe5('0x14')]);return _0x4106c9(_0x53d274[_0x8fe5('0x11')][_0x8fe5('0x14')]);}else{logger['info'](_0x8fe5('0x13'),_0x2e9c93,_0x8fe5('0x10'));_0x4106c9(_0x53d274['result'][_0x8fe5('0x14')]);}})[_0x8fe5('0x15')](function(_0x444f83){logger[_0x8fe5('0x11')](_0x8fe5('0x13'),_0x2e9c93,_0x444f83);_0x313cd1(_0x444f83);});});}exports[_0x8fe5('0x16')]=function(_0x28bac7){var _0x2b1f5e=this;return new Promise(function(_0x5dfc1a,_0x2fe4f2){return db[_0x8fe5('0x17')][_0x8fe5('0x18')](_0x28bac7[_0x8fe5('0x19')],{'raw':_0x28bac7[_0x8fe5('0x1a')]?_0x28bac7['options'][_0x8fe5('0x1b')]===undefined?!![]:![]:!![]})[_0x8fe5('0x1c')](function(_0x298a4a){logger[_0x8fe5('0xd')](_0x8fe5('0x16'),_0x28bac7);logger[_0x8fe5('0xe')](_0x8fe5('0x16'),_0x28bac7,JSON['stringify'](_0x298a4a));_0x5dfc1a(_0x298a4a);})[_0x8fe5('0x15')](function(_0x32adcd){logger['error'](_0x8fe5('0x16'),_0x32adcd[_0x8fe5('0x14')],_0x28bac7);_0x2fe4f2(_0x2b1f5e[_0x8fe5('0x11')](0x1f4,_0x32adcd[_0x8fe5('0x14')]));});});};exports[_0x8fe5('0x1d')]=function(_0x25b246){var _0x5f481c=this;return new Promise(function(_0x41a4f3,_0x2916b8){return db['FaxMessage'][_0x8fe5('0x1e')](_0x25b246[_0x8fe5('0x19')],{'raw':_0x25b246[_0x8fe5('0x1a')]?_0x25b246[_0x8fe5('0x1a')][_0x8fe5('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25b246[_0x8fe5('0x1a')]?_0x25b246[_0x8fe5('0x1a')]['where']||null:null,'attributes':_0x25b246['options']?_0x25b246['options'][_0x8fe5('0x1f')]||null:null,'limit':_0x25b246[_0x8fe5('0x1a')]?_0x25b246[_0x8fe5('0x1a')][_0x8fe5('0x20')]||null:null})[_0x8fe5('0x1c')](function(_0x351a58){logger[_0x8fe5('0xd')](_0x8fe5('0x1d'),_0x25b246);logger[_0x8fe5('0xe')](_0x8fe5('0x1d'),_0x25b246,JSON[_0x8fe5('0x21')](_0x351a58));_0x41a4f3(_0x351a58);})['catch'](function(_0x443645){logger[_0x8fe5('0x11')](_0x8fe5('0x1d'),_0x443645[_0x8fe5('0x14')],_0x25b246);_0x2916b8(_0x5f481c[_0x8fe5('0x11')](0x1f4,_0x443645[_0x8fe5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 2fe8e32..aa00681 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 _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file +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(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 d654781..0328aeb 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 _0x4bf2=['describe','show','/:id/download','download','post','faxmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','isAuthenticated'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x4bf2,0xa3));var _0x24bf=function(_0x1bf939,_0x33daf9){_0x1bf939=_0x1bf939-0x0;var _0x354bee=_0x4bf2[_0x1bf939];return _0x354bee;};'use strict';var multer=require('multer');var util=require(_0x24bf('0x0'));var path=require(_0x24bf('0x1'));var timeout=require(_0x24bf('0x2'));var express=require(_0x24bf('0x3'));var router=express[_0x24bf('0x4')]();var auth=require(_0x24bf('0x5'));var interaction=require(_0x24bf('0x6'));var config=require(_0x24bf('0x7'));var controller=require(_0x24bf('0x8'));router[_0x24bf('0x9')]('/',auth['isAuthenticated'](),controller[_0x24bf('0xa')]);router['get']('/describe',auth[_0x24bf('0xb')](),controller[_0x24bf('0xc')]);router[_0x24bf('0x9')]('/:id',auth[_0x24bf('0xb')](),controller[_0x24bf('0xd')]);router[_0x24bf('0x9')](_0x24bf('0xe'),auth['isAuthenticated'](),controller[_0x24bf('0xf')]);router[_0x24bf('0x10')]('/',auth['isAuthenticated'](),interaction['tracked']('fax',_0x24bf('0x11')),controller['create']);router[_0x24bf('0x12')]('/:id',auth[_0x24bf('0xb')](),controller[_0x24bf('0x13')]);router[_0x24bf('0x12')]('/:id/accept',auth[_0x24bf('0xb')](),controller[_0x24bf('0x14')]);router['put'](_0x24bf('0x15'),auth[_0x24bf('0xb')](),controller['reject']);router[_0x24bf('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x24bf('0x17')]);module[_0x24bf('0x18')]=router; \ No newline at end of file +var _0x7f4b=['reject','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe','/:id','/:id/download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x2e45ee,_0x580e1e){var _0x26c408=function(_0x267940){while(--_0x267940){_0x2e45ee['push'](_0x2e45ee['shift']());}};_0x26c408(++_0x580e1e);}(_0x7f4b,0x6b));var _0xb7f4=function(_0x4ac2ff,_0x51838d){_0x4ac2ff=_0x4ac2ff-0x0;var _0x463521=_0x7f4b[_0x4ac2ff];return _0x463521;};'use strict';var multer=require(_0xb7f4('0x0'));var util=require(_0xb7f4('0x1'));var path=require(_0xb7f4('0x2'));var timeout=require('connect-timeout');var express=require(_0xb7f4('0x3'));var router=express['Router']();var auth=require(_0xb7f4('0x4'));var interaction=require(_0xb7f4('0x5'));var config=require(_0xb7f4('0x6'));var controller=require(_0xb7f4('0x7'));router[_0xb7f4('0x8')]('/',auth[_0xb7f4('0x9')](),controller[_0xb7f4('0xa')]);router[_0xb7f4('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xb7f4('0xb')]);router[_0xb7f4('0x8')](_0xb7f4('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb7f4('0x8')](_0xb7f4('0xd'),auth[_0xb7f4('0x9')](),controller['download']);router[_0xb7f4('0xe')]('/',auth['isAuthenticated'](),interaction[_0xb7f4('0xf')](_0xb7f4('0x10'),_0xb7f4('0x11')),controller['create']);router[_0xb7f4('0x12')]('/:id',auth[_0xb7f4('0x9')](),controller[_0xb7f4('0x13')]);router['put'](_0xb7f4('0x14'),auth['isAuthenticated'](),controller[_0xb7f4('0x15')]);router[_0xb7f4('0x12')](_0xb7f4('0x16'),auth['isAuthenticated'](),controller[_0xb7f4('0x17')]);router[_0xb7f4('0x18')](_0xb7f4('0xc'),auth[_0xb7f4('0x9')](),controller[_0xb7f4('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index b4c587f..f7c6ef5 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 _0x93d3=['STRING','rrmemory','beepall','roundrobin','sequelize'];(function(_0x5c1fd7,_0x36f1b1){var _0x610596=function(_0x2fe864){while(--_0x2fe864){_0x5c1fd7['push'](_0x5c1fd7['shift']());}};_0x610596(++_0x36f1b1);}(_0x93d3,0x1e9));var _0x393d=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x93d3[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0x393d('0x0'));module['exports']={'name':{'type':Sequelize[_0x393d('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x393d('0x2'),_0x393d('0x3'),_0x393d('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7c59=['ENUM','rrmemory','INTEGER','exports','STRING','name'];(function(_0x253a6c,_0x1ce533){var _0x5e48ff=function(_0x900553){while(--_0x900553){_0x253a6c['push'](_0x253a6c['shift']());}};_0x5e48ff(++_0x1ce533);}(_0x7c59,0x147));var _0x97c5=function(_0x38db75,_0x3bfd1b){_0x38db75=_0x38db75-0x0;var _0x44bd3c=_0x7c59[_0x38db75];return _0x44bd3c;};'use strict';var Sequelize=require('sequelize');module[_0x97c5('0x0')]={'name':{'type':Sequelize[_0x97c5('0x1')],'unique':_0x97c5('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x97c5('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x97c5('0x3')](_0x97c5('0x4'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x97c5('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 e48b6b5..7f15157 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 _0x8ce8=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','describe','findOne','UserFaxQueue','order','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','%s/%s','Team','getTeams','addTeams','ids','online','voicePause','interface','flatMap','transaction','findOrCreate','forEach','userFaxQueue:save','removeTeams','Agents','select','field','tq.TeamId','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','addAgents','emit','isArray','userFaxQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','./faxQueue.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','FaxQueues','UserProfileResource','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x576eab,_0xb1c2ac){var _0x2033c7=function(_0x3ae809){while(--_0x3ae809){_0x576eab['push'](_0x576eab['shift']());}};_0x2033c7(++_0xb1c2ac);}(_0x8ce8,0xd3));var _0x88ce=function(_0x112949,_0x5f5849){_0x112949=_0x112949-0x0;var _0xf8d2f5=_0x8ce8[_0x112949];return _0xf8d2f5;};'use strict';var pdf=require(_0x88ce('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x88ce('0x1'));var zipdir=require(_0x88ce('0x2'));var jsonpatch=require(_0x88ce('0x3'));var rp=require(_0x88ce('0x4'));var moment=require(_0x88ce('0x5'));var BPromise=require(_0x88ce('0x6'));var Mustache=require(_0x88ce('0x7'));var util=require(_0x88ce('0x8'));var path=require(_0x88ce('0x9'));var sox=require(_0x88ce('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x88ce('0xb'));var squel=require(_0x88ce('0xc'));var crypto=require(_0x88ce('0xd'));var jsforce=require(_0x88ce('0xe'));var deskjs=require(_0x88ce('0xf'));var toCsv=require('to-csv');var querystring=require(_0x88ce('0x10'));var Papa=require('papaparse');var Redis=require(_0x88ce('0x11'));var authService=require(_0x88ce('0x12'));var qs=require(_0x88ce('0x13'));var as=require(_0x88ce('0x14'));var hardwareService=require(_0x88ce('0x15'));var logger=require(_0x88ce('0x16'))(_0x88ce('0x17'));var utils=require(_0x88ce('0x18'));var config=require('../../config/environment');var db=require(_0x88ce('0x19'))['db'];config['redis']=_[_0x88ce('0x1a')](config[_0x88ce('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88ce('0x1b')]));require(_0x88ce('0x1c'))[_0x88ce('0x1d')](socket);function respondWithStatusCode(_0xad722b,_0x417896){_0x417896=_0x417896||0xcc;return function(_0x210e70){if(_0x210e70){return _0xad722b[_0x88ce('0x1e')](_0x417896);}return _0xad722b['status'](_0x417896)[_0x88ce('0x1f')]();};}function respondWithResult(_0x5bcd5a,_0x3da93e){_0x3da93e=_0x3da93e||0xc8;return function(_0x58d3da){if(_0x58d3da){return _0x5bcd5a[_0x88ce('0x20')](_0x3da93e)[_0x88ce('0x21')](_0x58d3da);}};}function respondWithFilteredResult(_0x4500d3,_0x34b0e4){return function(_0x509a84){if(_0x509a84){var _0x50c9df=_0x509a84[_0x88ce('0x22')],_0xdb0d1f=_0x34b0e4[_0x88ce('0x23')],_0x65fa81=_0x34b0e4[_0x88ce('0x23')]+_0x34b0e4[_0x88ce('0x24')],_0x404df9;if(_0x65fa81>=_0x50c9df){_0x65fa81=_0x50c9df;_0x404df9=0xc8;}else{_0x404df9=0xce;}_0x4500d3[_0x88ce('0x20')](_0x404df9);return _0x4500d3[_0x88ce('0x25')](_0x88ce('0x26'),_0xdb0d1f+'-'+_0x65fa81+'/'+_0x50c9df)[_0x88ce('0x21')](_0x509a84);}return null;};}function patchUpdates(_0x7de0ac){return function(_0xbe7eff){try{jsonpatch[_0x88ce('0x27')](_0xbe7eff,_0x7de0ac,!![]);}catch(_0x218308){return BPromise[_0x88ce('0x28')](_0x218308);}return _0xbe7eff['save']();};}function saveUpdates(_0x356d7d,_0x34fbcc){return function(_0x3bb68b){if(_0x3bb68b){return _0x3bb68b[_0x88ce('0x29')](_0x356d7d)[_0x88ce('0x2a')](function(_0x4e45eb){return _0x4e45eb;});}return null;};}function removeEntity(_0x4c9133,_0x4dcdc4){return function(_0x22c911){if(_0x22c911){return _0x22c911[_0x88ce('0x2b')]()[_0x88ce('0x2a')](function(){var _0x51a894=_0x22c911['get']({'plain':!![]});var _0x1f0adc=_0x88ce('0x2c');return db[_0x88ce('0x2d')][_0x88ce('0x2b')]({'where':{'type':_0x1f0adc,'resourceId':_0x51a894['id']}})[_0x88ce('0x2a')](function(){return _0x22c911;});})[_0x88ce('0x2a')](function(){_0x4c9133[_0x88ce('0x20')](0xcc)[_0x88ce('0x1f')]();});}};}function handleEntityNotFound(_0x19c87f,_0x40aa83){return function(_0x4209bc){if(!_0x4209bc){_0x19c87f[_0x88ce('0x1e')](0x194);}return _0x4209bc;};}function handleError(_0x1013a8,_0x29698a){_0x29698a=_0x29698a||0x1f4;return function(_0x12b9a1){logger[_0x88ce('0x2e')](_0x12b9a1['stack']);if(_0x12b9a1[_0x88ce('0x2f')]){delete _0x12b9a1['name'];}_0x1013a8[_0x88ce('0x20')](_0x29698a)[_0x88ce('0x30')](_0x12b9a1);};}exports[_0x88ce('0x31')]=function(_0x2fe609,_0x544be7){var _0x28e7a4={},_0x2c9027={},_0x326ebe={'count':0x0,'rows':[]};var _0x3fae46=_[_0x88ce('0x32')](db[_0x88ce('0x33')][_0x88ce('0x34')],function(_0x554cff){return{'name':_0x554cff[_0x88ce('0x35')],'type':_0x554cff[_0x88ce('0x36')]['key']};});_0x2c9027[_0x88ce('0x37')]=_[_0x88ce('0x32')](_0x3fae46,_0x88ce('0x2f'));_0x2c9027[_0x88ce('0x38')]=_[_0x88ce('0x39')](_0x2fe609[_0x88ce('0x38')]);_0x2c9027[_0x88ce('0x3a')]=_[_0x88ce('0x3b')](_0x2c9027[_0x88ce('0x37')],_0x2c9027['query']);_0x28e7a4[_0x88ce('0x3c')]=_[_0x88ce('0x3b')](_0x2c9027[_0x88ce('0x37')],qs['fields'](_0x2fe609[_0x88ce('0x38')][_0x88ce('0x3d')]));_0x28e7a4['attributes']=_0x28e7a4['attributes'][_0x88ce('0x3e')]?_0x28e7a4[_0x88ce('0x3c')]:_0x2c9027[_0x88ce('0x37')];if(!_0x2fe609[_0x88ce('0x38')][_0x88ce('0x3f')](_0x88ce('0x40'))){_0x28e7a4['limit']=qs[_0x88ce('0x24')](_0x2fe609[_0x88ce('0x38')]['limit']);_0x28e7a4[_0x88ce('0x23')]=qs[_0x88ce('0x23')](_0x2fe609['query'][_0x88ce('0x23')]);}_0x28e7a4['order']=qs[_0x88ce('0x41')](_0x2fe609[_0x88ce('0x38')][_0x88ce('0x41')]);_0x28e7a4[_0x88ce('0x42')]=qs[_0x88ce('0x3a')](_[_0x88ce('0x43')](_0x2fe609['query'],_0x2c9027[_0x88ce('0x3a')]));if(_0x2fe609[_0x88ce('0x38')][_0x88ce('0x44')]){_0x28e7a4[_0x88ce('0x42')]=_['merge'](_0x28e7a4[_0x88ce('0x42')],{'$or':_[_0x88ce('0x32')](_0x3fae46,function(_0x124149){if(_0x124149['type']!=='VIRTUAL'){var _0x194c42={};_0x194c42[_0x124149[_0x88ce('0x2f')]]={'$like':'%'+_0x2fe609[_0x88ce('0x38')]['filter']+'%'};return _0x194c42;}})});}_0x28e7a4=_[_0x88ce('0x45')]({},_0x28e7a4,_0x2fe609[_0x88ce('0x46')]);var _0x5eb72d={'where':_0x28e7a4[_0x88ce('0x42')]};return db[_0x88ce('0x33')][_0x88ce('0x22')](_0x5eb72d)[_0x88ce('0x2a')](function(_0x3a4898){_0x326ebe['count']=_0x3a4898;if(_0x2fe609[_0x88ce('0x38')][_0x88ce('0x47')]){_0x28e7a4[_0x88ce('0x48')]=[{'all':!![]}];}return db[_0x88ce('0x33')][_0x88ce('0x49')](_0x28e7a4);})[_0x88ce('0x2a')](function(_0x39bfb8){_0x326ebe['rows']=_0x39bfb8;return _0x326ebe;})[_0x88ce('0x2a')](respondWithFilteredResult(_0x544be7,_0x28e7a4))[_0x88ce('0x4a')](handleError(_0x544be7,null));};exports['show']=function(_0x1b4a57,_0x29c0d0){var _0x52b4d9={'raw':!![],'where':{'id':_0x1b4a57['params']['id']}},_0x49489d={};_0x49489d[_0x88ce('0x37')]=_[_0x88ce('0x39')](db[_0x88ce('0x33')][_0x88ce('0x34')]);_0x49489d[_0x88ce('0x38')]=_[_0x88ce('0x39')](_0x1b4a57[_0x88ce('0x38')]);_0x49489d['filters']=_[_0x88ce('0x3b')](_0x49489d['model'],_0x49489d[_0x88ce('0x38')]);_0x52b4d9[_0x88ce('0x3c')]=_[_0x88ce('0x3b')](_0x49489d['model'],qs[_0x88ce('0x3d')](_0x1b4a57['query'][_0x88ce('0x3d')]));_0x52b4d9[_0x88ce('0x3c')]=_0x52b4d9[_0x88ce('0x3c')][_0x88ce('0x3e')]?_0x52b4d9[_0x88ce('0x3c')]:_0x49489d[_0x88ce('0x37')];if(_0x1b4a57[_0x88ce('0x38')]['includeAll']){_0x52b4d9[_0x88ce('0x48')]=[{'all':!![]}];}_0x52b4d9=_[_0x88ce('0x45')]({},_0x52b4d9,_0x1b4a57[_0x88ce('0x46')]);return db[_0x88ce('0x33')]['find'](_0x52b4d9)['then'](handleEntityNotFound(_0x29c0d0,null))[_0x88ce('0x2a')](respondWithResult(_0x29c0d0,null))[_0x88ce('0x4a')](handleError(_0x29c0d0,null));};exports[_0x88ce('0x4b')]=function(_0x46d70a,_0x23967c){return db[_0x88ce('0x33')][_0x88ce('0x4b')](_0x46d70a['body'],{})['then'](function(_0x3471ae){var _0x55cd0e=_0x46d70a['user']['get']({'plain':!![]});if(!_0x55cd0e)throw new Error(_0x88ce('0x4c'));if(_0x55cd0e['role']===_0x88ce('0x4d')){var _0x23ca86=_0x3471ae[_0x88ce('0x4e')]({'plain':!![]});var _0x2707df=_0x88ce('0x2c');return db[_0x88ce('0x4f')]['find']({'where':{'name':_0x2707df,'userProfileId':_0x55cd0e['userProfileId']},'raw':!![]})[_0x88ce('0x2a')](function(_0x39a801){if(_0x39a801&&_0x39a801[_0x88ce('0x50')]===0x0){return db[_0x88ce('0x2d')]['create']({'name':_0x23ca86['name'],'resourceId':_0x23ca86['id'],'type':_0x39a801[_0x88ce('0x2f')],'sectionId':_0x39a801['id']},{})[_0x88ce('0x2a')](function(){return _0x3471ae;});}else{return _0x3471ae;}})[_0x88ce('0x4a')](function(_0xf7a92a){logger[_0x88ce('0x2e')](_0x88ce('0x51'),_0xf7a92a);throw _0xf7a92a;});}return _0x3471ae;})[_0x88ce('0x2a')](respondWithResult(_0x23967c,0xc9))[_0x88ce('0x4a')](handleError(_0x23967c,null));};exports[_0x88ce('0x29')]=function(_0x461b10,_0x3fab06){if(_0x461b10[_0x88ce('0x52')]['id']){delete _0x461b10[_0x88ce('0x52')]['id'];}return db['FaxQueue'][_0x88ce('0x53')]({'where':{'id':_0x461b10[_0x88ce('0x54')]['id']}})[_0x88ce('0x2a')](handleEntityNotFound(_0x3fab06,null))[_0x88ce('0x2a')](saveUpdates(_0x461b10[_0x88ce('0x52')],null))[_0x88ce('0x2a')](respondWithResult(_0x3fab06,null))['catch'](handleError(_0x3fab06,null));};exports[_0x88ce('0x2b')]=function(_0x564f37,_0x3b5b43){return db[_0x88ce('0x33')][_0x88ce('0x53')]({'where':{'id':_0x564f37[_0x88ce('0x54')]['id']}})[_0x88ce('0x2a')](handleEntityNotFound(_0x3b5b43,null))['then'](removeEntity(_0x3b5b43,null))[_0x88ce('0x4a')](handleError(_0x3b5b43,null));};exports[_0x88ce('0x55')]=function(_0x4adbb7,_0x42963f){return db['FaxQueue'][_0x88ce('0x55')]()[_0x88ce('0x2a')](respondWithResult(_0x42963f,null))[_0x88ce('0x4a')](handleError(_0x42963f,null));};exports['getMembers']=function(_0x1e45cc,_0x2cc506,_0x27c25d){var _0x1988ab={'raw':!![],'where':{}},_0x317321={},_0x27c41e;return db[_0x88ce('0x33')][_0x88ce('0x56')]({'where':{'id':_0x1e45cc[_0x88ce('0x54')]['id']}})['then'](handleEntityNotFound(_0x2cc506,null))['then'](function(_0x24f2d1){if(_0x24f2d1){_0x27c41e=_0x24f2d1[_0x88ce('0x4e')]({'plain':!![]});_0x317321[_0x88ce('0x37')]=_['keys'](db[_0x88ce('0x57')]['rawAttributes']);_0x317321['query']=_['keys'](_0x1e45cc[_0x88ce('0x38')]);_0x317321['filters']=_[_0x88ce('0x3b')](_0x317321[_0x88ce('0x37')],_0x317321[_0x88ce('0x38')]);_0x1988ab['attributes']=_[_0x88ce('0x3b')](_0x317321['model'],qs[_0x88ce('0x3d')](_0x1e45cc[_0x88ce('0x38')][_0x88ce('0x3d')]));_0x1988ab[_0x88ce('0x3c')]=_0x1988ab['attributes'][_0x88ce('0x3e')]?_0x1988ab[_0x88ce('0x3c')]:_0x317321[_0x88ce('0x37')];if(!_0x1e45cc['query']['hasOwnProperty']('nolimit')){_0x1988ab[_0x88ce('0x24')]=qs[_0x88ce('0x24')](_0x1e45cc[_0x88ce('0x38')][_0x88ce('0x24')]);_0x1988ab['offset']=qs['offset'](_0x1e45cc['query'][_0x88ce('0x23')]);}_0x1988ab[_0x88ce('0x58')]=qs[_0x88ce('0x41')](_0x1e45cc[_0x88ce('0x38')][_0x88ce('0x41')]);_0x1988ab['where']=qs['filters'](_[_0x88ce('0x43')](_0x1e45cc[_0x88ce('0x38')],_0x317321[_0x88ce('0x3a')]));_0x1988ab[_0x88ce('0x42')][_0x88ce('0x59')]=_0x24f2d1['id'];if(_0x1e45cc['query']['filter']){_0x1988ab[_0x88ce('0x42')]=_[_0x88ce('0x45')](_0x1988ab[_0x88ce('0x42')],{'$or':_[_0x88ce('0x32')](_0x1988ab['attributes'],function(_0x355137){var _0x4e8c71={};_0x4e8c71[_0x355137]={'$like':'%'+_0x1e45cc['query'][_0x88ce('0x44')]+'%'};return _0x4e8c71;})});}_0x1988ab=_[_0x88ce('0x45')]({},_0x1988ab,_0x1e45cc[_0x88ce('0x46')]);return db[_0x88ce('0x57')][_0x88ce('0x49')](_0x1988ab);}})[_0x88ce('0x2a')](function(_0x19d365){if(_0x19d365){return db[_0x88ce('0x5a')][_0x88ce('0x5b')]({'where':{'id':_[_0x88ce('0x32')](_0x19d365,_0x88ce('0x5c')),'role':_0x88ce('0x5d')},'attributes':['id',_0x88ce('0x2f'),_0x88ce('0x5e'),_0x88ce('0x5f'),_0x88ce('0x60')]});}})[_0x88ce('0x2a')](function(_0x458343){if(_0x458343){return{'count':_0x458343[_0x88ce('0x22')],'rows':_['map'](_0x458343['rows'],function(_0x8db11d){return{'membername':_0x8db11d[_0x88ce('0x2f')],'UserId':_0x8db11d['id'],'queue_name':_0x27c41e[_0x88ce('0x2f')],'FaxQueueId':_0x27c41e['id'],'interface':util['format'](_0x88ce('0x61'),'SIP',_0x8db11d[_0x88ce('0x2f')]),'penalty':0x0,'paused':_0x8db11d[_0x88ce('0x5e')],'createdAt':_0x8db11d[_0x88ce('0x60')],'updatedAt':_0x8db11d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2cc506,_0x1988ab))['catch'](handleError(_0x2cc506,null));};exports['getTeams']=function(_0x48907a,_0x5220cc,_0x3359ea){var _0x28826e={};var _0x4dbc91={};var _0x17bf86;var _0x2bee64;return db[_0x88ce('0x33')][_0x88ce('0x56')]({'where':{'id':_0x48907a[_0x88ce('0x54')]['id']}})[_0x88ce('0x2a')](handleEntityNotFound(_0x5220cc,null))[_0x88ce('0x2a')](function(_0x134574){if(_0x134574){_0x17bf86=_0x134574;_0x4dbc91[_0x88ce('0x37')]=_[_0x88ce('0x39')](db[_0x88ce('0x62')][_0x88ce('0x34')]);_0x4dbc91[_0x88ce('0x38')]=_['keys'](_0x48907a['query']);_0x4dbc91[_0x88ce('0x3a')]=_[_0x88ce('0x3b')](_0x4dbc91[_0x88ce('0x37')],_0x4dbc91[_0x88ce('0x38')]);_0x28826e['attributes']=_[_0x88ce('0x3b')](_0x4dbc91[_0x88ce('0x37')],qs[_0x88ce('0x3d')](_0x48907a['query']['fields']));_0x28826e[_0x88ce('0x3c')]=_0x28826e[_0x88ce('0x3c')][_0x88ce('0x3e')]?_0x28826e[_0x88ce('0x3c')]:_0x4dbc91['model'];_0x28826e[_0x88ce('0x58')]=qs[_0x88ce('0x41')](_0x48907a[_0x88ce('0x38')][_0x88ce('0x41')]);_0x28826e[_0x88ce('0x42')]=qs[_0x88ce('0x3a')](_[_0x88ce('0x43')](_0x48907a[_0x88ce('0x38')],_0x4dbc91[_0x88ce('0x3a')]));if(_0x48907a[_0x88ce('0x38')][_0x88ce('0x44')]){_0x28826e['where']=_[_0x88ce('0x45')](_0x28826e[_0x88ce('0x42')],{'$or':_[_0x88ce('0x32')](_0x28826e[_0x88ce('0x3c')],function(_0x59fd8a){var _0x34093f={};_0x34093f[_0x59fd8a]={'$like':'%'+_0x48907a[_0x88ce('0x38')]['filter']+'%'};return _0x34093f;})});}_0x28826e=_[_0x88ce('0x45')]({},_0x28826e,_0x48907a[_0x88ce('0x46')]);return _0x17bf86[_0x88ce('0x63')](_0x28826e);}})[_0x88ce('0x2a')](function(_0x28a517){if(_0x28a517){_0x2bee64=_0x28a517[_0x88ce('0x3e')];if(!_0x48907a['query']['hasOwnProperty'](_0x88ce('0x40'))){_0x28826e[_0x88ce('0x24')]=qs['limit'](_0x48907a['query'][_0x88ce('0x24')]);_0x28826e[_0x88ce('0x23')]=qs[_0x88ce('0x23')](_0x48907a[_0x88ce('0x38')][_0x88ce('0x23')]);}return _0x17bf86[_0x88ce('0x63')](_0x28826e);}})[_0x88ce('0x2a')](function(_0x1c613d){if(_0x1c613d){return _0x1c613d?{'count':_0x2bee64,'rows':_0x1c613d}:null;}})['then'](respondWithResult(_0x5220cc,null))[_0x88ce('0x4a')](handleError(_0x5220cc,null));};exports[_0x88ce('0x64')]=function(_0x2b00ec,_0x2f49b6,_0x27e312){var _0x4a9e42=_0x2b00ec[_0x88ce('0x52')][_0x88ce('0x65')];return db[_0x88ce('0x62')][_0x88ce('0x49')]({'where':{'id':_0x4a9e42},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x88ce('0x2f'),_0x88ce('0x66'),_0x88ce('0x67'),_0x88ce('0x68')],'raw':!![]}]})[_0x88ce('0x2a')](function(_0x35f619){if(_0x35f619){var _0x2781a5=_[_0x88ce('0x69')](_0x35f619,function(_0x557c55){var _0x2e2e71=_0x557c55[_0x88ce('0x4e')]({'plain':!![]});return _0x2e2e71['Agents'];});return db['FaxQueue'][_0x88ce('0x53')]({'where':{'id':_0x2b00ec[_0x88ce('0x54')]['id']}})['then'](function(_0x4d475e){return db['sequelize'][_0x88ce('0x6a')](function(_0x58fdf4){return _0x4d475e['addTeams'](_0x4a9e42,{'transaction':_0x58fdf4})[_0x88ce('0x2a')](function(){return BPromise['each'](_0x2781a5,function(_0x1022bc){return db[_0x88ce('0x57')][_0x88ce('0x6b')]({'where':{'UserId':_0x1022bc['id'],'FaxQueueId':_0x2b00ec[_0x88ce('0x54')]['id']},'transaction':_0x58fdf4});});})[_0x88ce('0x2a')](function(){_0x2781a5[_0x88ce('0x6c')](function(_0x2f2d2e){socket['emit'](_0x88ce('0x6d'),{'UserId':_0x2f2d2e['id'],'FaxQueueId':_0x4d475e['id']});});});});});}})[_0x88ce('0x2a')](respondWithStatusCode(_0x2f49b6,null))['catch'](handleError(_0x2f49b6,null));};exports[_0x88ce('0x6e')]=function(_0x328928,_0xac2b3e,_0x182ee2){return db[_0x88ce('0x62')][_0x88ce('0x49')]({'where':{'id':_0x328928[_0x88ce('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x88ce('0x5a')],'as':_0x88ce('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x88ce('0x2a')](handleEntityNotFound(_0xac2b3e,null))[_0x88ce('0x2a')](function(_0x20edad){var _0x158b12=_[_0x88ce('0x32')](_0x20edad,'id');var _0x41a8e3=[];var _0x567493=[];var _0x1eca31=squel[_0x88ce('0x70')]();_0x1eca31[_0x88ce('0x71')](_0x88ce('0x72'))['from'](_0x88ce('0x73'),'tq')[_0x88ce('0x74')]('user_has_teams','ut',_0x88ce('0x75'))[_0x88ce('0x42')](_0x88ce('0x76'),_0x328928[_0x88ce('0x54')]['id']);for(var _0x172e44=0x0;_0x172e44<_0x20edad[_0x88ce('0x3e')];_0x172e44+=0x1){let _0x38a64f=_0x20edad[_0x172e44];for(var _0x53255f=0x0;_0x53255f<_0x38a64f['Agents']['length'];_0x53255f+=0x1){let _0x1361b5=_0x38a64f[_0x88ce('0x6f')][_0x53255f];var _0x490b46=_0x1eca31[_0x88ce('0x77')]();_0x490b46['where'](_0x88ce('0x78'),_0x1361b5['id']);_0x567493[_0x88ce('0x79')](db[_0x88ce('0x7a')][_0x88ce('0x38')](_0x490b46[_0x88ce('0x7b')](),{'type':db[_0x88ce('0x7a')]['QueryTypes'][_0x88ce('0x7c')]})[_0x88ce('0x2a')](function(_0x39e8d5){if(_0x39e8d5['length']===0x1){return _0x1361b5['id'];}else{var _0x29ca5b=_['every'](_[_0x88ce('0x32')](_0x39e8d5,_0x88ce('0x7d')),function(_0x4d96cc){return _[_0x88ce('0x7e')](_0x158b12,_0x4d96cc);});if(_0x29ca5b){return _0x1361b5['id'];}}}));}}return BPromise['all'](_0x567493)['then'](function(_0x1ebc05){_0x41a8e3=_(_0x41a8e3)[_0x88ce('0x7f')](_0x1ebc05)[_0x88ce('0x80')]()[_0x88ce('0x81')]();return db[_0x88ce('0x33')]['find']({'where':{'id':_0x328928[_0x88ce('0x54')]['id']}})[_0x88ce('0x2a')](function(_0x5ef75c){return db[_0x88ce('0x7a')]['transaction'](function(_0x1d174){return _0x5ef75c[_0x88ce('0x6e')](_0x328928['query'][_0x88ce('0x65')],{'transaction':_0x1d174})[_0x88ce('0x2a')](function(){if(!_[_0x88ce('0x82')](_0x41a8e3)){return _0x5ef75c[_0x88ce('0x83')](_0x41a8e3,{'transaction':_0x1d174});}})[_0x88ce('0x2a')](function(){_0x41a8e3['forEach'](function(_0x4ebfdb){socket['emit']('userFaxQueue:remove',{'UserId':_0x4ebfdb,'FaxQueueId':_0x5ef75c['id']});});});});});});})[_0x88ce('0x2a')](respondWithStatusCode(_0xac2b3e,null))['catch'](handleError(_0xac2b3e,null));};exports[_0x88ce('0x84')]=function(_0x203da1,_0x3911d8,_0x589707){return db['FaxQueue'][_0x88ce('0x53')]({'where':{'id':_0x203da1['params']['id']}})[_0x88ce('0x2a')](handleEntityNotFound(_0x3911d8,null))[_0x88ce('0x2a')](function(_0x27e53b){if(_0x27e53b){return _0x27e53b['addAgents'](_0x203da1['body'][_0x88ce('0x65')],_['omit'](_0x203da1[_0x88ce('0x52')],[_0x88ce('0x65'),'id'])||{})['spread'](function(_0xc7cd8){for(var _0x14fc54=0x0;_0x14fc54<_0x203da1[_0x88ce('0x52')][_0x88ce('0x65')][_0x88ce('0x3e')];_0x14fc54+=0x1){socket[_0x88ce('0x85')](_0x88ce('0x6d'),{'UserId':_0x203da1[_0x88ce('0x52')][_0x88ce('0x65')][_0x14fc54],'FaxQueueId':_0x203da1[_0x88ce('0x54')]['id']});}return _0xc7cd8;});}})[_0x88ce('0x2a')](respondWithResult(_0x3911d8,null))[_0x88ce('0x4a')](handleError(_0x3911d8,null));};exports['removeAgents']=function(_0x4ab063,_0x24e70b,_0x5b1a7b){return db[_0x88ce('0x33')][_0x88ce('0x53')]({'where':{'id':_0x4ab063['params']['id']}})['then'](handleEntityNotFound(_0x24e70b,null))[_0x88ce('0x2a')](function(_0x3e23b7){if(_0x3e23b7){return _0x3e23b7[_0x88ce('0x83')](_0x4ab063[_0x88ce('0x38')][_0x88ce('0x65')])[_0x88ce('0x2a')](function(){if(_[_0x88ce('0x86')](_0x4ab063['query']['ids'])){for(var _0x491d24=0x0;_0x491d24<_0x4ab063[_0x88ce('0x38')]['ids']['length'];_0x491d24+=0x1){socket[_0x88ce('0x85')](_0x88ce('0x87'),{'UserId':Number(_0x4ab063[_0x88ce('0x38')][_0x88ce('0x65')][_0x491d24]),'FaxQueueId':Number(_0x4ab063[_0x88ce('0x54')]['id'])});}}else{socket[_0x88ce('0x85')](_0x88ce('0x87'),{'UserId':Number(_0x4ab063[_0x88ce('0x38')]['ids']),'FaxQueueId':Number(_0x4ab063['params']['id'])});}});}})[_0x88ce('0x2a')](respondWithStatusCode(_0x24e70b,null))[_0x88ce('0x4a')](handleError(_0x24e70b,null));};exports[_0x88ce('0x88')]=function(_0x25e4f4,_0x41a4dc,_0x25f0f3){var _0xa408ea={};var _0x4f86e1={};var _0x106e58;var _0x49e271;return db[_0x88ce('0x33')]['findOne']({'where':{'id':_0x25e4f4[_0x88ce('0x54')]['id']}})[_0x88ce('0x2a')](handleEntityNotFound(_0x41a4dc,null))[_0x88ce('0x2a')](function(_0xf712d8){if(_0xf712d8){_0x106e58=_0xf712d8;_0x4f86e1[_0x88ce('0x37')]=_['keys'](db['User'][_0x88ce('0x34')]);_0x4f86e1[_0x88ce('0x38')]=_[_0x88ce('0x39')](_0x25e4f4[_0x88ce('0x38')]);_0x4f86e1['filters']=_[_0x88ce('0x3b')](_0x4f86e1[_0x88ce('0x37')],_0x4f86e1[_0x88ce('0x38')]);_0xa408ea[_0x88ce('0x3c')]=_[_0x88ce('0x3b')](_0x4f86e1[_0x88ce('0x37')],qs[_0x88ce('0x3d')](_0x25e4f4[_0x88ce('0x38')][_0x88ce('0x3d')]));_0xa408ea['attributes']=_0xa408ea[_0x88ce('0x3c')][_0x88ce('0x3e')]?_0xa408ea['attributes']:_0x4f86e1[_0x88ce('0x37')];_0xa408ea[_0x88ce('0x58')]=qs[_0x88ce('0x41')](_0x25e4f4[_0x88ce('0x38')][_0x88ce('0x41')]);_0xa408ea['where']=qs[_0x88ce('0x3a')](_[_0x88ce('0x43')](_0x25e4f4['query'],_0x4f86e1['filters']));if(_0x25e4f4['query'][_0x88ce('0x44')]){_0xa408ea[_0x88ce('0x42')]=_[_0x88ce('0x45')](_0xa408ea[_0x88ce('0x42')],{'$or':_['map'](_0xa408ea[_0x88ce('0x3c')],function(_0x189a4f){var _0x40f835={};_0x40f835[_0x189a4f]={'$like':'%'+_0x25e4f4[_0x88ce('0x38')][_0x88ce('0x44')]+'%'};return _0x40f835;})});}_0xa408ea=_[_0x88ce('0x45')]({},_0xa408ea,_0x25e4f4[_0x88ce('0x46')]);return _0x106e58[_0x88ce('0x88')](_0xa408ea);}})['then'](function(_0x7e4aca){if(_0x7e4aca){_0x49e271=_0x7e4aca[_0x88ce('0x3e')];if(!_0x25e4f4[_0x88ce('0x38')]['hasOwnProperty'](_0x88ce('0x40'))){_0xa408ea['limit']=qs[_0x88ce('0x24')](_0x25e4f4[_0x88ce('0x38')]['limit']);_0xa408ea[_0x88ce('0x23')]=qs[_0x88ce('0x23')](_0x25e4f4[_0x88ce('0x38')][_0x88ce('0x23')]);}return _0x106e58[_0x88ce('0x88')](_0xa408ea);}})[_0x88ce('0x2a')](function(_0x4ba31e){if(_0x4ba31e){return _0x4ba31e?{'count':_0x49e271,'rows':_0x4ba31e}:null;}})[_0x88ce('0x2a')](respondWithResult(_0x41a4dc,null))['catch'](handleError(_0x41a4dc,null));}; \ No newline at end of file +var _0xe5fc=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','get','FaxQueues','destroy','sendStatus','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','model','filters','query','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','update','describe','getMembers','UserFaxQueue','nolimit','order','FaxQueueId','User','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','faxPause','findOne','getTeams','addTeams','Agents','online','flatMap','sequelize','findOrCreate','emit','userFaxQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','SELECT','every','all','union','compact','value','transaction','ids','isEmpty','userFaxQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0xe5fc,0x109));var _0xce5f=function(_0x9330ce,_0x52decc){_0x9330ce=_0x9330ce-0x0;var _0x455fd8=_0xe5fc[_0x9330ce];return _0x455fd8;};'use strict';var pdf=require(_0xce5f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xce5f('0x1'));var zipdir=require(_0xce5f('0x2'));var jsonpatch=require(_0xce5f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xce5f('0x4'));var util=require('util');var path=require(_0xce5f('0x5'));var sox=require(_0xce5f('0x6'));var csv=require(_0xce5f('0x7'));var ejs=require(_0xce5f('0x8'));var fs=require('fs');var _=require(_0xce5f('0x9'));var squel=require(_0xce5f('0xa'));var crypto=require(_0xce5f('0xb'));var jsforce=require(_0xce5f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xce5f('0x7'));var querystring=require(_0xce5f('0xd'));var Papa=require(_0xce5f('0xe'));var Redis=require(_0xce5f('0xf'));var authService=require(_0xce5f('0x10'));var qs=require(_0xce5f('0x11'));var as=require(_0xce5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce5f('0x13'))(_0xce5f('0x14'));var utils=require(_0xce5f('0x15'));var config=require(_0xce5f('0x16'));var db=require(_0xce5f('0x17'))['db'];config[_0xce5f('0x18')]=_[_0xce5f('0x19')](config[_0xce5f('0x18')],{'host':_0xce5f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0xce5f('0x1b')](socket);function respondWithStatusCode(_0xb0438e,_0x3f69cb){_0x3f69cb=_0x3f69cb||0xcc;return function(_0x4782d0){if(_0x4782d0){return _0xb0438e['sendStatus'](_0x3f69cb);}return _0xb0438e[_0xce5f('0x1c')](_0x3f69cb)[_0xce5f('0x1d')]();};}function respondWithResult(_0x1f0762,_0x44ab13){_0x44ab13=_0x44ab13||0xc8;return function(_0x208947){if(_0x208947){return _0x1f0762[_0xce5f('0x1c')](_0x44ab13)[_0xce5f('0x1e')](_0x208947);}};}function respondWithFilteredResult(_0x1b3e51,_0x257d8b){return function(_0x403304){if(_0x403304){var _0xc42202=_0x403304[_0xce5f('0x1f')],_0xf9342b=_0x257d8b[_0xce5f('0x20')],_0x274bd5=_0x257d8b['offset']+_0x257d8b['limit'],_0x82a2bb;if(_0x274bd5>=_0xc42202){_0x274bd5=_0xc42202;_0x82a2bb=0xc8;}else{_0x82a2bb=0xce;}_0x1b3e51['status'](_0x82a2bb);return _0x1b3e51[_0xce5f('0x21')](_0xce5f('0x22'),_0xf9342b+'-'+_0x274bd5+'/'+_0xc42202)[_0xce5f('0x1e')](_0x403304);}return null;};}function patchUpdates(_0x202a9a){return function(_0x3c4d17){try{jsonpatch[_0xce5f('0x23')](_0x3c4d17,_0x202a9a,!![]);}catch(_0x196615){return BPromise[_0xce5f('0x24')](_0x196615);}return _0x3c4d17[_0xce5f('0x25')]();};}function saveUpdates(_0x531b54,_0x1bc889){return function(_0x2c4334){if(_0x2c4334){return _0x2c4334['update'](_0x531b54)[_0xce5f('0x26')](function(_0x1d613b){return _0x1d613b;});}return null;};}function removeEntity(_0x2e0ad7,_0x1e0c39){return function(_0x2bed6d){if(_0x2bed6d){return _0x2bed6d['destroy']()['then'](function(){var _0x3d44fc=_0x2bed6d[_0xce5f('0x27')]({'plain':!![]});var _0x44141d=_0xce5f('0x28');return db['UserProfileResource'][_0xce5f('0x29')]({'where':{'type':_0x44141d,'resourceId':_0x3d44fc['id']}})[_0xce5f('0x26')](function(){return _0x2bed6d;});})[_0xce5f('0x26')](function(){_0x2e0ad7[_0xce5f('0x1c')](0xcc)[_0xce5f('0x1d')]();});}};}function handleEntityNotFound(_0x1e9844,_0x179325){return function(_0x118ccf){if(!_0x118ccf){_0x1e9844[_0xce5f('0x2a')](0x194);}return _0x118ccf;};}function handleError(_0x329f1a,_0x5e86c4){_0x5e86c4=_0x5e86c4||0x1f4;return function(_0x219ede){logger[_0xce5f('0x2b')](_0x219ede[_0xce5f('0x2c')]);if(_0x219ede[_0xce5f('0x2d')]){delete _0x219ede[_0xce5f('0x2d')];}_0x329f1a[_0xce5f('0x1c')](_0x5e86c4)[_0xce5f('0x2e')](_0x219ede);};}exports[_0xce5f('0x2f')]=function(_0x1179c1,_0x4dc1b1){var _0x5233b1={},_0xda99b6={},_0x5d4640={'count':0x0,'rows':[]};var _0x113e70=_[_0xce5f('0x30')](db[_0xce5f('0x31')][_0xce5f('0x32')],function(_0x4137cb){return{'name':_0x4137cb[_0xce5f('0x33')],'type':_0x4137cb['type']['key']};});_0xda99b6[_0xce5f('0x34')]=_['map'](_0x113e70,_0xce5f('0x2d'));_0xda99b6['query']=_['keys'](_0x1179c1['query']);_0xda99b6[_0xce5f('0x35')]=_['intersection'](_0xda99b6['model'],_0xda99b6[_0xce5f('0x36')]);_0x5233b1['attributes']=_[_0xce5f('0x37')](_0xda99b6['model'],qs[_0xce5f('0x38')](_0x1179c1[_0xce5f('0x36')][_0xce5f('0x38')]));_0x5233b1[_0xce5f('0x39')]=_0x5233b1[_0xce5f('0x39')][_0xce5f('0x3a')]?_0x5233b1['attributes']:_0xda99b6[_0xce5f('0x34')];if(!_0x1179c1[_0xce5f('0x36')][_0xce5f('0x3b')]('nolimit')){_0x5233b1['limit']=qs[_0xce5f('0x3c')](_0x1179c1[_0xce5f('0x36')][_0xce5f('0x3c')]);_0x5233b1['offset']=qs[_0xce5f('0x20')](_0x1179c1[_0xce5f('0x36')][_0xce5f('0x20')]);}_0x5233b1['order']=qs['sort'](_0x1179c1[_0xce5f('0x36')][_0xce5f('0x3d')]);_0x5233b1[_0xce5f('0x3e')]=qs[_0xce5f('0x35')](_[_0xce5f('0x3f')](_0x1179c1[_0xce5f('0x36')],_0xda99b6['filters']));if(_0x1179c1[_0xce5f('0x36')][_0xce5f('0x40')]){_0x5233b1[_0xce5f('0x3e')]=_[_0xce5f('0x41')](_0x5233b1['where'],{'$or':_['map'](_0x113e70,function(_0x1f1ca1){if(_0x1f1ca1[_0xce5f('0x42')]!==_0xce5f('0x43')){var _0x26413e={};_0x26413e[_0x1f1ca1[_0xce5f('0x2d')]]={'$like':'%'+_0x1179c1['query'][_0xce5f('0x40')]+'%'};return _0x26413e;}})});}_0x5233b1=_[_0xce5f('0x41')]({},_0x5233b1,_0x1179c1[_0xce5f('0x44')]);var _0x4f980e={'where':_0x5233b1['where']};return db[_0xce5f('0x31')]['count'](_0x4f980e)['then'](function(_0x3abb1e){_0x5d4640['count']=_0x3abb1e;if(_0x1179c1[_0xce5f('0x36')][_0xce5f('0x45')]){_0x5233b1[_0xce5f('0x46')]=[{'all':!![]}];}return db['FaxQueue'][_0xce5f('0x47')](_0x5233b1);})[_0xce5f('0x26')](function(_0x1c81ce){_0x5d4640[_0xce5f('0x48')]=_0x1c81ce;return _0x5d4640;})[_0xce5f('0x26')](respondWithFilteredResult(_0x4dc1b1,_0x5233b1))['catch'](handleError(_0x4dc1b1,null));};exports[_0xce5f('0x49')]=function(_0x203788,_0x5a826f){var _0x5cdd9f={'raw':!![],'where':{'id':_0x203788[_0xce5f('0x4a')]['id']}},_0x58193b={};_0x58193b[_0xce5f('0x34')]=_[_0xce5f('0x4b')](db['FaxQueue'][_0xce5f('0x32')]);_0x58193b[_0xce5f('0x36')]=_['keys'](_0x203788[_0xce5f('0x36')]);_0x58193b[_0xce5f('0x35')]=_[_0xce5f('0x37')](_0x58193b[_0xce5f('0x34')],_0x58193b[_0xce5f('0x36')]);_0x5cdd9f[_0xce5f('0x39')]=_[_0xce5f('0x37')](_0x58193b['model'],qs[_0xce5f('0x38')](_0x203788[_0xce5f('0x36')][_0xce5f('0x38')]));_0x5cdd9f[_0xce5f('0x39')]=_0x5cdd9f['attributes']['length']?_0x5cdd9f['attributes']:_0x58193b[_0xce5f('0x34')];if(_0x203788[_0xce5f('0x36')]['includeAll']){_0x5cdd9f[_0xce5f('0x46')]=[{'all':!![]}];}_0x5cdd9f=_[_0xce5f('0x41')]({},_0x5cdd9f,_0x203788[_0xce5f('0x44')]);return db[_0xce5f('0x31')][_0xce5f('0x4c')](_0x5cdd9f)[_0xce5f('0x26')](handleEntityNotFound(_0x5a826f,null))[_0xce5f('0x26')](respondWithResult(_0x5a826f,null))[_0xce5f('0x4d')](handleError(_0x5a826f,null));};exports['create']=function(_0x31d383,_0x55df60){return db[_0xce5f('0x31')]['create'](_0x31d383[_0xce5f('0x4e')],{})['then'](function(_0x355fc2){var _0xd029fe=_0x31d383[_0xce5f('0x4f')][_0xce5f('0x27')]({'plain':!![]});if(!_0xd029fe)throw new Error(_0xce5f('0x50'));if(_0xd029fe[_0xce5f('0x51')]==='user'){var _0x4f68cd=_0x355fc2['get']({'plain':!![]});var _0x3d5ac5=_0xce5f('0x28');return db['UserProfileSection'][_0xce5f('0x4c')]({'where':{'name':_0x3d5ac5,'userProfileId':_0xd029fe[_0xce5f('0x52')]},'raw':!![]})[_0xce5f('0x26')](function(_0x556b7b){if(_0x556b7b&&_0x556b7b['autoAssociation']===0x0){return db[_0xce5f('0x53')]['create']({'name':_0x4f68cd['name'],'resourceId':_0x4f68cd['id'],'type':_0x556b7b['name'],'sectionId':_0x556b7b['id']},{})[_0xce5f('0x26')](function(){return _0x355fc2;});}else{return _0x355fc2;}})[_0xce5f('0x4d')](function(_0x37d0b8){logger[_0xce5f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37d0b8);throw _0x37d0b8;});}return _0x355fc2;})['then'](respondWithResult(_0x55df60,0xc9))[_0xce5f('0x4d')](handleError(_0x55df60,null));};exports[_0xce5f('0x54')]=function(_0x4fd94c,_0x30d81c){if(_0x4fd94c[_0xce5f('0x4e')]['id']){delete _0x4fd94c['body']['id'];}return db[_0xce5f('0x31')][_0xce5f('0x4c')]({'where':{'id':_0x4fd94c[_0xce5f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x30d81c,null))['then'](saveUpdates(_0x4fd94c[_0xce5f('0x4e')],null))[_0xce5f('0x26')](respondWithResult(_0x30d81c,null))[_0xce5f('0x4d')](handleError(_0x30d81c,null));};exports['destroy']=function(_0x3aabad,_0x45382c){return db[_0xce5f('0x31')][_0xce5f('0x4c')]({'where':{'id':_0x3aabad[_0xce5f('0x4a')]['id']}})[_0xce5f('0x26')](handleEntityNotFound(_0x45382c,null))['then'](removeEntity(_0x45382c,null))[_0xce5f('0x4d')](handleError(_0x45382c,null));};exports[_0xce5f('0x55')]=function(_0x3f8b8f,_0x581b3e){return db[_0xce5f('0x31')][_0xce5f('0x55')]()['then'](respondWithResult(_0x581b3e,null))[_0xce5f('0x4d')](handleError(_0x581b3e,null));};exports[_0xce5f('0x56')]=function(_0x707715,_0x303ac3,_0x7282df){var _0x5080b4={'raw':!![],'where':{}},_0x260aec={},_0x212318;return db[_0xce5f('0x31')]['findOne']({'where':{'id':_0x707715[_0xce5f('0x4a')]['id']}})[_0xce5f('0x26')](handleEntityNotFound(_0x303ac3,null))[_0xce5f('0x26')](function(_0x19ceb2){if(_0x19ceb2){_0x212318=_0x19ceb2[_0xce5f('0x27')]({'plain':!![]});_0x260aec['model']=_[_0xce5f('0x4b')](db[_0xce5f('0x57')][_0xce5f('0x32')]);_0x260aec[_0xce5f('0x36')]=_[_0xce5f('0x4b')](_0x707715[_0xce5f('0x36')]);_0x260aec[_0xce5f('0x35')]=_[_0xce5f('0x37')](_0x260aec[_0xce5f('0x34')],_0x260aec[_0xce5f('0x36')]);_0x5080b4[_0xce5f('0x39')]=_['intersection'](_0x260aec[_0xce5f('0x34')],qs['fields'](_0x707715[_0xce5f('0x36')][_0xce5f('0x38')]));_0x5080b4[_0xce5f('0x39')]=_0x5080b4[_0xce5f('0x39')][_0xce5f('0x3a')]?_0x5080b4['attributes']:_0x260aec['model'];if(!_0x707715['query']['hasOwnProperty'](_0xce5f('0x58'))){_0x5080b4['limit']=qs[_0xce5f('0x3c')](_0x707715[_0xce5f('0x36')]['limit']);_0x5080b4[_0xce5f('0x20')]=qs[_0xce5f('0x20')](_0x707715[_0xce5f('0x36')][_0xce5f('0x20')]);}_0x5080b4[_0xce5f('0x59')]=qs[_0xce5f('0x3d')](_0x707715[_0xce5f('0x36')]['sort']);_0x5080b4[_0xce5f('0x3e')]=qs[_0xce5f('0x35')](_[_0xce5f('0x3f')](_0x707715['query'],_0x260aec[_0xce5f('0x35')]));_0x5080b4[_0xce5f('0x3e')][_0xce5f('0x5a')]=_0x19ceb2['id'];if(_0x707715[_0xce5f('0x36')][_0xce5f('0x40')]){_0x5080b4[_0xce5f('0x3e')]=_[_0xce5f('0x41')](_0x5080b4[_0xce5f('0x3e')],{'$or':_[_0xce5f('0x30')](_0x5080b4[_0xce5f('0x39')],function(_0x15ac07){var _0xfc42f5={};_0xfc42f5[_0x15ac07]={'$like':'%'+_0x707715[_0xce5f('0x36')][_0xce5f('0x40')]+'%'};return _0xfc42f5;})});}_0x5080b4=_['merge']({},_0x5080b4,_0x707715['options']);return db[_0xce5f('0x57')][_0xce5f('0x47')](_0x5080b4);}})[_0xce5f('0x26')](function(_0x3f2d79){if(_0x3f2d79){return db[_0xce5f('0x5b')]['findAndCountAll']({'where':{'id':_[_0xce5f('0x30')](_0x3f2d79,_0xce5f('0x5c')),'role':_0xce5f('0x5d')},'attributes':['id',_0xce5f('0x2d'),'faxPause',_0xce5f('0x5e'),_0xce5f('0x5f')]});}})[_0xce5f('0x26')](function(_0x4c58d4){if(_0x4c58d4){return{'count':_0x4c58d4['count'],'rows':_[_0xce5f('0x30')](_0x4c58d4['rows'],function(_0x4e09e7){return{'membername':_0x4e09e7[_0xce5f('0x2d')],'UserId':_0x4e09e7['id'],'queue_name':_0x212318[_0xce5f('0x2d')],'FaxQueueId':_0x212318['id'],'interface':util[_0xce5f('0x60')](_0xce5f('0x61'),_0xce5f('0x62'),_0x4e09e7['name']),'penalty':0x0,'paused':_0x4e09e7[_0xce5f('0x63')],'createdAt':_0x4e09e7[_0xce5f('0x5f')],'updatedAt':_0x4e09e7[_0xce5f('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xce5f('0x26')](respondWithFilteredResult(_0x303ac3,_0x5080b4))['catch'](handleError(_0x303ac3,null));};exports['getTeams']=function(_0x3a492e,_0x3424c6,_0x137ee9){var _0x5f3239={};var _0x5bfa14={};var _0x536007;var _0x4f0d4b;return db[_0xce5f('0x31')][_0xce5f('0x64')]({'where':{'id':_0x3a492e['params']['id']}})[_0xce5f('0x26')](handleEntityNotFound(_0x3424c6,null))[_0xce5f('0x26')](function(_0x243bdc){if(_0x243bdc){_0x536007=_0x243bdc;_0x5bfa14['model']=_[_0xce5f('0x4b')](db['Team'][_0xce5f('0x32')]);_0x5bfa14[_0xce5f('0x36')]=_[_0xce5f('0x4b')](_0x3a492e[_0xce5f('0x36')]);_0x5bfa14['filters']=_[_0xce5f('0x37')](_0x5bfa14[_0xce5f('0x34')],_0x5bfa14[_0xce5f('0x36')]);_0x5f3239[_0xce5f('0x39')]=_[_0xce5f('0x37')](_0x5bfa14[_0xce5f('0x34')],qs['fields'](_0x3a492e[_0xce5f('0x36')][_0xce5f('0x38')]));_0x5f3239[_0xce5f('0x39')]=_0x5f3239[_0xce5f('0x39')][_0xce5f('0x3a')]?_0x5f3239['attributes']:_0x5bfa14[_0xce5f('0x34')];_0x5f3239[_0xce5f('0x59')]=qs['sort'](_0x3a492e['query']['sort']);_0x5f3239[_0xce5f('0x3e')]=qs['filters'](_['pick'](_0x3a492e[_0xce5f('0x36')],_0x5bfa14[_0xce5f('0x35')]));if(_0x3a492e[_0xce5f('0x36')][_0xce5f('0x40')]){_0x5f3239[_0xce5f('0x3e')]=_[_0xce5f('0x41')](_0x5f3239[_0xce5f('0x3e')],{'$or':_['map'](_0x5f3239[_0xce5f('0x39')],function(_0x8effaf){var _0x2f7521={};_0x2f7521[_0x8effaf]={'$like':'%'+_0x3a492e[_0xce5f('0x36')][_0xce5f('0x40')]+'%'};return _0x2f7521;})});}_0x5f3239=_['merge']({},_0x5f3239,_0x3a492e['options']);return _0x536007[_0xce5f('0x65')](_0x5f3239);}})[_0xce5f('0x26')](function(_0x3dcb47){if(_0x3dcb47){_0x4f0d4b=_0x3dcb47[_0xce5f('0x3a')];if(!_0x3a492e['query'][_0xce5f('0x3b')]('nolimit')){_0x5f3239[_0xce5f('0x3c')]=qs[_0xce5f('0x3c')](_0x3a492e['query'][_0xce5f('0x3c')]);_0x5f3239[_0xce5f('0x20')]=qs[_0xce5f('0x20')](_0x3a492e[_0xce5f('0x36')][_0xce5f('0x20')]);}return _0x536007[_0xce5f('0x65')](_0x5f3239);}})['then'](function(_0xfac4e5){if(_0xfac4e5){return _0xfac4e5?{'count':_0x4f0d4b,'rows':_0xfac4e5}:null;}})[_0xce5f('0x26')](respondWithResult(_0x3424c6,null))[_0xce5f('0x4d')](handleError(_0x3424c6,null));};exports[_0xce5f('0x66')]=function(_0x184055,_0xf5328b,_0x29fde2){var _0x448f00=_0x184055[_0xce5f('0x4e')]['ids'];return db['Team'][_0xce5f('0x47')]({'where':{'id':_0x448f00},'attributes':['id'],'include':[{'model':db[_0xce5f('0x5b')],'as':_0xce5f('0x67'),'attributes':['id',_0xce5f('0x2d'),_0xce5f('0x68'),'voicePause','interface'],'raw':!![]}]})[_0xce5f('0x26')](function(_0x3f1bfd){if(_0x3f1bfd){var _0x531aeb=_[_0xce5f('0x69')](_0x3f1bfd,function(_0x314128){var _0x441a24=_0x314128[_0xce5f('0x27')]({'plain':!![]});return _0x441a24['Agents'];});return db['FaxQueue'][_0xce5f('0x4c')]({'where':{'id':_0x184055[_0xce5f('0x4a')]['id']}})[_0xce5f('0x26')](function(_0x46ff06){return db[_0xce5f('0x6a')]['transaction'](function(_0x6202e2){return _0x46ff06[_0xce5f('0x66')](_0x448f00,{'transaction':_0x6202e2})[_0xce5f('0x26')](function(){return BPromise['each'](_0x531aeb,function(_0x46323f){return db[_0xce5f('0x57')][_0xce5f('0x6b')]({'where':{'UserId':_0x46323f['id'],'FaxQueueId':_0x184055[_0xce5f('0x4a')]['id']},'transaction':_0x6202e2});});})[_0xce5f('0x26')](function(){_0x531aeb['forEach'](function(_0x4db359){socket[_0xce5f('0x6c')](_0xce5f('0x6d'),{'UserId':_0x4db359['id'],'FaxQueueId':_0x46ff06['id']});});});});});}})[_0xce5f('0x26')](respondWithStatusCode(_0xf5328b,null))['catch'](handleError(_0xf5328b,null));};exports[_0xce5f('0x6e')]=function(_0x5b6f21,_0x587d53,_0x61f244){return db[_0xce5f('0x6f')]['findAll']({'where':{'id':_0x5b6f21[_0xce5f('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xce5f('0x67'),'attributes':['id'],'raw':!![]}]})[_0xce5f('0x26')](handleEntityNotFound(_0x587d53,null))[_0xce5f('0x26')](function(_0x3c76ce){var _0x44625c=_[_0xce5f('0x30')](_0x3c76ce,'id');var _0x39d0f0=[];var _0x25050b=[];var _0x4a1feb=squel[_0xce5f('0x70')]();_0x4a1feb[_0xce5f('0x71')](_0xce5f('0x72'))[_0xce5f('0x73')](_0xce5f('0x74'),'tq')[_0xce5f('0x75')](_0xce5f('0x76'),'ut',_0xce5f('0x77'))[_0xce5f('0x3e')](_0xce5f('0x78'),_0x5b6f21['params']['id']);for(var _0x3b30ec=0x0;_0x3b30ec<_0x3c76ce[_0xce5f('0x3a')];_0x3b30ec+=0x1){let _0x21d3c1=_0x3c76ce[_0x3b30ec];for(var _0x12ba2d=0x0;_0x12ba2d<_0x21d3c1[_0xce5f('0x67')]['length'];_0x12ba2d+=0x1){let _0x16c5c1=_0x21d3c1['Agents'][_0x12ba2d];var _0x2191fd=_0x4a1feb['clone']();_0x2191fd[_0xce5f('0x3e')]('ut.UserId\x20=\x20?',_0x16c5c1['id']);_0x25050b[_0xce5f('0x79')](db[_0xce5f('0x6a')]['query'](_0x2191fd['toString'](),{'type':db[_0xce5f('0x6a')]['QueryTypes'][_0xce5f('0x7a')]})[_0xce5f('0x26')](function(_0x5eb017){if(_0x5eb017['length']===0x1){return _0x16c5c1['id'];}else{var _0x2d40d4=_[_0xce5f('0x7b')](_[_0xce5f('0x30')](_0x5eb017,'TeamId'),function(_0x182622){return _['includes'](_0x44625c,_0x182622);});if(_0x2d40d4){return _0x16c5c1['id'];}}}));}}return BPromise[_0xce5f('0x7c')](_0x25050b)[_0xce5f('0x26')](function(_0x2918f9){_0x39d0f0=_(_0x39d0f0)[_0xce5f('0x7d')](_0x2918f9)[_0xce5f('0x7e')]()[_0xce5f('0x7f')]();return db[_0xce5f('0x31')][_0xce5f('0x4c')]({'where':{'id':_0x5b6f21[_0xce5f('0x4a')]['id']}})[_0xce5f('0x26')](function(_0x3728c5){return db['sequelize'][_0xce5f('0x80')](function(_0x28396e){return _0x3728c5['removeTeams'](_0x5b6f21['query'][_0xce5f('0x81')],{'transaction':_0x28396e})['then'](function(){if(!_[_0xce5f('0x82')](_0x39d0f0)){return _0x3728c5['removeAgents'](_0x39d0f0,{'transaction':_0x28396e});}})[_0xce5f('0x26')](function(){_0x39d0f0['forEach'](function(_0x10f7c3){socket[_0xce5f('0x6c')](_0xce5f('0x83'),{'UserId':_0x10f7c3,'FaxQueueId':_0x3728c5['id']});});});});});});})[_0xce5f('0x26')](respondWithStatusCode(_0x587d53,null))[_0xce5f('0x4d')](handleError(_0x587d53,null));};exports[_0xce5f('0x84')]=function(_0x10c5f2,_0x3966e2,_0x3cfd27){return db['FaxQueue'][_0xce5f('0x4c')]({'where':{'id':_0x10c5f2[_0xce5f('0x4a')]['id']}})[_0xce5f('0x26')](handleEntityNotFound(_0x3966e2,null))[_0xce5f('0x26')](function(_0x1b0b29){if(_0x1b0b29){return _0x1b0b29[_0xce5f('0x84')](_0x10c5f2['body'][_0xce5f('0x81')],_['omit'](_0x10c5f2[_0xce5f('0x4e')],['ids','id'])||{})[_0xce5f('0x85')](function(_0x31a06f){for(var _0x1eb4ee=0x0;_0x1eb4ee<_0x10c5f2[_0xce5f('0x4e')][_0xce5f('0x81')][_0xce5f('0x3a')];_0x1eb4ee+=0x1){socket[_0xce5f('0x6c')](_0xce5f('0x6d'),{'UserId':_0x10c5f2[_0xce5f('0x4e')][_0xce5f('0x81')][_0x1eb4ee],'FaxQueueId':_0x10c5f2[_0xce5f('0x4a')]['id']});}return _0x31a06f;});}})[_0xce5f('0x26')](respondWithResult(_0x3966e2,null))['catch'](handleError(_0x3966e2,null));};exports[_0xce5f('0x86')]=function(_0x539b3e,_0x138777,_0x37ee2c){return db[_0xce5f('0x31')][_0xce5f('0x4c')]({'where':{'id':_0x539b3e[_0xce5f('0x4a')]['id']}})[_0xce5f('0x26')](handleEntityNotFound(_0x138777,null))[_0xce5f('0x26')](function(_0x42426f){if(_0x42426f){return _0x42426f[_0xce5f('0x86')](_0x539b3e[_0xce5f('0x36')][_0xce5f('0x81')])[_0xce5f('0x26')](function(){if(_[_0xce5f('0x87')](_0x539b3e[_0xce5f('0x36')]['ids'])){for(var _0x2111f3=0x0;_0x2111f3<_0x539b3e[_0xce5f('0x36')]['ids'][_0xce5f('0x3a')];_0x2111f3+=0x1){socket['emit'](_0xce5f('0x83'),{'UserId':Number(_0x539b3e[_0xce5f('0x36')][_0xce5f('0x81')][_0x2111f3]),'FaxQueueId':Number(_0x539b3e[_0xce5f('0x4a')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x539b3e[_0xce5f('0x36')][_0xce5f('0x81')]),'FaxQueueId':Number(_0x539b3e['params']['id'])});}});}})[_0xce5f('0x26')](respondWithStatusCode(_0x138777,null))[_0xce5f('0x4d')](handleError(_0x138777,null));};exports[_0xce5f('0x88')]=function(_0x3287ff,_0x4ff69c,_0x4e9bc5){var _0x5ec615={};var _0xbb69bc={};var _0x50eeed;var _0x4c4b1f;return db[_0xce5f('0x31')][_0xce5f('0x64')]({'where':{'id':_0x3287ff[_0xce5f('0x4a')]['id']}})[_0xce5f('0x26')](handleEntityNotFound(_0x4ff69c,null))[_0xce5f('0x26')](function(_0x583045){if(_0x583045){_0x50eeed=_0x583045;_0xbb69bc[_0xce5f('0x34')]=_[_0xce5f('0x4b')](db['User'][_0xce5f('0x32')]);_0xbb69bc[_0xce5f('0x36')]=_[_0xce5f('0x4b')](_0x3287ff['query']);_0xbb69bc[_0xce5f('0x35')]=_[_0xce5f('0x37')](_0xbb69bc[_0xce5f('0x34')],_0xbb69bc['query']);_0x5ec615[_0xce5f('0x39')]=_['intersection'](_0xbb69bc[_0xce5f('0x34')],qs[_0xce5f('0x38')](_0x3287ff['query']['fields']));_0x5ec615['attributes']=_0x5ec615['attributes']['length']?_0x5ec615['attributes']:_0xbb69bc[_0xce5f('0x34')];_0x5ec615[_0xce5f('0x59')]=qs[_0xce5f('0x3d')](_0x3287ff[_0xce5f('0x36')][_0xce5f('0x3d')]);_0x5ec615[_0xce5f('0x3e')]=qs['filters'](_[_0xce5f('0x3f')](_0x3287ff[_0xce5f('0x36')],_0xbb69bc['filters']));if(_0x3287ff[_0xce5f('0x36')][_0xce5f('0x40')]){_0x5ec615[_0xce5f('0x3e')]=_[_0xce5f('0x41')](_0x5ec615[_0xce5f('0x3e')],{'$or':_[_0xce5f('0x30')](_0x5ec615['attributes'],function(_0x2f4b70){var _0x3551b8={};_0x3551b8[_0x2f4b70]={'$like':'%'+_0x3287ff[_0xce5f('0x36')]['filter']+'%'};return _0x3551b8;})});}_0x5ec615=_['merge']({},_0x5ec615,_0x3287ff[_0xce5f('0x44')]);return _0x50eeed[_0xce5f('0x88')](_0x5ec615);}})['then'](function(_0x2dc31a){if(_0x2dc31a){_0x4c4b1f=_0x2dc31a[_0xce5f('0x3a')];if(!_0x3287ff[_0xce5f('0x36')][_0xce5f('0x3b')](_0xce5f('0x58'))){_0x5ec615[_0xce5f('0x3c')]=qs[_0xce5f('0x3c')](_0x3287ff['query'][_0xce5f('0x3c')]);_0x5ec615[_0xce5f('0x20')]=qs[_0xce5f('0x20')](_0x3287ff[_0xce5f('0x36')][_0xce5f('0x20')]);}return _0x50eeed[_0xce5f('0x88')](_0x5ec615);}})['then'](function(_0x13d7e2){if(_0x13d7e2){return _0x13d7e2?{'count':_0x4c4b1f,'rows':_0x13d7e2}:null;}})[_0xce5f('0x26')](respondWithResult(_0x4ff69c,null))[_0xce5f('0x4d')](handleError(_0x4ff69c,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 002a3c4..214723e 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 _0x2ac1=['FaxQueue','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4f3710,_0x2f8891){var _0x17d102=function(_0x37277e){while(--_0x37277e){_0x4f3710['push'](_0x4f3710['shift']());}};_0x17d102(++_0x2f8891);}(_0x2ac1,0xc4));var _0x12ac=function(_0x2dc342,_0x1f275a){_0x2dc342=_0x2dc342-0x0;var _0x2815e7=_0x2ac1[_0x2dc342];return _0x2815e7;};'use strict';var EventEmitter=require(_0x12ac('0x0'));var FaxQueue=require(_0x12ac('0x1'))['db'][_0x12ac('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x12ac('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x12ac('0x4')};function emitEvent(_0x2b2493){return function(_0x5e88b6,_0x3c11c8,_0x1be167){FaxQueueEvents[_0x12ac('0x5')](_0x2b2493+':'+_0x5e88b6['id'],_0x5e88b6);FaxQueueEvents[_0x12ac('0x5')](_0x2b2493,_0x5e88b6);_0x1be167(null);};}for(var e in events){if(events[_0x12ac('0x6')](e)){var event=events[e];FaxQueue[_0x12ac('0x7')](e,emitEvent(event));}}module[_0x12ac('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0xd76b=['FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4dee2a,_0x380267){var _0x2b2714=function(_0x5117e0){while(--_0x5117e0){_0x4dee2a['push'](_0x4dee2a['shift']());}};_0x2b2714(++_0x380267);}(_0xd76b,0x127));var _0xbd76=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xd76b[_0x13b02f];return _0x12e9a6;};'use strict';var EventEmitter=require(_0xbd76('0x0'));var FaxQueue=require(_0xbd76('0x1'))['db'][_0xbd76('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xbd76('0x3')](0x0);var events={'afterCreate':_0xbd76('0x4'),'afterUpdate':_0xbd76('0x5'),'afterDestroy':_0xbd76('0x6')};function emitEvent(_0x518653){return function(_0x47aafc,_0x56cf3e,_0x50ae1c){FaxQueueEvents[_0xbd76('0x7')](_0x518653+':'+_0x47aafc['id'],_0x47aafc);FaxQueueEvents[_0xbd76('0x7')](_0x518653,_0x47aafc);_0x50ae1c(null);};}for(var e in events){if(events[_0xbd76('0x8')](e)){var event=events[e];FaxQueue[_0xbd76('0x9')](e,emitEvent(event));}}module[_0xbd76('0xa')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 323a1c6..d43e6c9 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 _0x796e=['api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','FaxQueue','lodash','util','../../config/logger'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x796e,0x19f));var _0xe796=function(_0x52c907,_0x5bb5cb){_0x52c907=_0x52c907-0x0;var _0x568c5a=_0x796e[_0x52c907];return _0x568c5a;};'use strict';var _=require(_0xe796('0x0'));var util=require(_0xe796('0x1'));var logger=require(_0xe796('0x2'))(_0xe796('0x3'));var moment=require(_0xe796('0x4'));var BPromise=require('bluebird');var rp=require(_0xe796('0x5'));var fs=require('fs');var path=require(_0xe796('0x6'));var rimraf=require(_0xe796('0x7'));var config=require(_0xe796('0x8'));var attributes=require(_0xe796('0x9'));module['exports']=function(_0x122ca2,_0x22c930){return _0x122ca2['define'](_0xe796('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c0b=['../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','FaxQueue','fax_queues'];(function(_0x4a0b2f,_0x461ad4){var _0xba147f=function(_0xb828cd){while(--_0xb828cd){_0x4a0b2f['push'](_0x4a0b2f['shift']());}};_0xba147f(++_0x461ad4);}(_0x9c0b,0x1b8));var _0xb9c0=function(_0x143ea6,_0x3c9999){_0x143ea6=_0x143ea6-0x0;var _0xfb14d=_0x9c0b[_0x143ea6];return _0xfb14d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb9c0('0x0'))(_0xb9c0('0x1'));var moment=require('moment');var BPromise=require(_0xb9c0('0x2'));var rp=require(_0xb9c0('0x3'));var fs=require('fs');var path=require(_0xb9c0('0x4'));var rimraf=require(_0xb9c0('0x5'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0xb9c0('0x6')]=function(_0x383cbd,_0x538e4e){return _0x383cbd[_0xb9c0('0x7')](_0xb9c0('0x8'),attributes,{'tableName':_0xb9c0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index b5b6f32..ef03f5b 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 _0xb333=['FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','FaxQueue','raw','options','attributes','limit','map','model','include','GetFaxQueue','stringify','ShowFaxQueue','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','info'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xb333,0x154));var _0x3b33=function(_0x408f22,_0x102170){_0x408f22=_0x408f22-0x0;var _0x304dbb=_0xb333[_0x408f22];return _0x304dbb;};'use strict';var _=require(_0x3b33('0x0'));var util=require(_0x3b33('0x1'));var moment=require(_0x3b33('0x2'));var BPromise=require(_0x3b33('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b33('0x4'));var db=require(_0x3b33('0x5'))['db'];var utils=require(_0x3b33('0x6'));var logger=require(_0x3b33('0x7'))(_0x3b33('0x8'));var config=require(_0x3b33('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3b33('0xa')][_0x3b33('0xb')]({'port':0x232a});config[_0x3b33('0xc')]=_[_0x3b33('0xd')](config[_0x3b33('0xc')],{'host':_0x3b33('0xe'),'port':0x18eb});var socket=require(_0x3b33('0xf'))(new Redis(config['redis']));require(_0x3b33('0x10'))[_0x3b33('0x11')](socket);function respondWithRpcPromise(_0x13d171,_0x5b7e5d,_0x418666){return new BPromise(function(_0x17e64a,_0x4935f8){return client['request'](_0x13d171,_0x418666)[_0x3b33('0x12')](function(_0x509020){logger[_0x3b33('0x13')](_0x3b33('0x14'),_0x5b7e5d,'request\x20sent');logger[_0x3b33('0x15')](_0x3b33('0x16'),_0x5b7e5d,_0x3b33('0x17'),JSON['stringify'](_0x509020));if(_0x509020[_0x3b33('0x18')]){if(_0x509020['error'][_0x3b33('0x19')]===0x1f4){logger[_0x3b33('0x18')](_0x3b33('0x14'),_0x5b7e5d,_0x509020[_0x3b33('0x18')][_0x3b33('0x1a')]);return _0x4935f8(_0x509020[_0x3b33('0x18')][_0x3b33('0x1a')]);}logger[_0x3b33('0x18')](_0x3b33('0x14'),_0x5b7e5d,_0x509020[_0x3b33('0x18')][_0x3b33('0x1a')]);return _0x17e64a(_0x509020[_0x3b33('0x18')][_0x3b33('0x1a')]);}else{logger[_0x3b33('0x13')]('FaxQueue,\x20%s,\x20%s',_0x5b7e5d,_0x3b33('0x17'));_0x17e64a(_0x509020['result']['message']);}})[_0x3b33('0x1b')](function(_0x2980c8){logger[_0x3b33('0x18')](_0x3b33('0x14'),_0x5b7e5d,_0x2980c8);_0x4935f8(_0x2980c8);});});}exports['GetFaxQueue']=function(_0x1828d7){var _0x3f278a=this;return new Promise(function(_0x9aa81e,_0x255bfa){return db[_0x3b33('0x1c')]['findAll']({'raw':_0x1828d7['options']?_0x1828d7['options'][_0x3b33('0x1d')]===undefined?!![]:![]:!![],'where':_0x1828d7[_0x3b33('0x1e')]?_0x1828d7[_0x3b33('0x1e')]['where']||null:null,'attributes':_0x1828d7['options']?_0x1828d7[_0x3b33('0x1e')][_0x3b33('0x1f')]||null:null,'limit':_0x1828d7[_0x3b33('0x1e')]?_0x1828d7['options'][_0x3b33('0x20')]||null:null,'include':_0x1828d7[_0x3b33('0x1e')]?_0x1828d7[_0x3b33('0x1e')]['include']?_[_0x3b33('0x21')](_0x1828d7['options']['include'],function(_0x536491){return{'model':db[_0x536491[_0x3b33('0x22')]],'as':_0x536491['as'],'attributes':_0x536491['attributes'],'include':_0x536491[_0x3b33('0x23')]?_[_0x3b33('0x21')](_0x536491[_0x3b33('0x23')],function(_0x2f63b0){return{'model':db[_0x2f63b0[_0x3b33('0x22')]],'as':_0x2f63b0['as'],'attributes':_0x2f63b0['attributes'],'include':_0x2f63b0[_0x3b33('0x23')]?_[_0x3b33('0x21')](_0x2f63b0[_0x3b33('0x23')],function(_0x21818e){return{'model':db[_0x21818e[_0x3b33('0x22')]],'as':_0x21818e['as'],'attributes':_0x21818e[_0x3b33('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b41e7){logger[_0x3b33('0x13')](_0x3b33('0x24'),_0x1828d7);logger[_0x3b33('0x15')](_0x3b33('0x24'),_0x1828d7,JSON[_0x3b33('0x25')](_0x3b41e7));_0x9aa81e(_0x3b41e7);})[_0x3b33('0x1b')](function(_0x1b4b0c){logger[_0x3b33('0x18')]('GetFaxQueue',_0x1b4b0c[_0x3b33('0x1a')],_0x1828d7);_0x255bfa(_0x3f278a[_0x3b33('0x18')](0x1f4,_0x1b4b0c['message']));});});};exports[_0x3b33('0x26')]=function(_0xfca2ab){var _0x150d03=this;return new Promise(function(_0x2111a6,_0x4ae911){return db[_0x3b33('0x1c')]['find']({'raw':_0xfca2ab[_0x3b33('0x1e')]?_0xfca2ab[_0x3b33('0x1e')][_0x3b33('0x1d')]===undefined?!![]:![]:!![],'where':_0xfca2ab[_0x3b33('0x1e')]?_0xfca2ab[_0x3b33('0x1e')][_0x3b33('0x27')]||null:null,'attributes':_0xfca2ab['options']?_0xfca2ab[_0x3b33('0x1e')][_0x3b33('0x1f')]||null:null,'include':_0xfca2ab['options']?_0xfca2ab[_0x3b33('0x1e')][_0x3b33('0x23')]?_[_0x3b33('0x21')](_0xfca2ab[_0x3b33('0x1e')][_0x3b33('0x23')],function(_0x3296e4){return{'model':db[_0x3296e4[_0x3b33('0x22')]],'as':_0x3296e4['as'],'attributes':_0x3296e4[_0x3b33('0x1f')],'include':_0x3296e4['include']?_[_0x3b33('0x21')](_0x3296e4[_0x3b33('0x23')],function(_0x41853c){return{'model':db[_0x41853c[_0x3b33('0x22')]],'as':_0x41853c['as'],'attributes':_0x41853c[_0x3b33('0x1f')],'include':_0x41853c['include']?_[_0x3b33('0x21')](_0x41853c[_0x3b33('0x23')],function(_0x1d4daf){return{'model':db[_0x1d4daf['model']],'as':_0x1d4daf['as'],'attributes':_0x1d4daf[_0x3b33('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3b33('0x12')](function(_0x3507ce){logger[_0x3b33('0x13')](_0x3b33('0x26'),_0xfca2ab);logger[_0x3b33('0x15')](_0x3b33('0x26'),_0xfca2ab,JSON[_0x3b33('0x25')](_0x3507ce));_0x2111a6(_0x3507ce);})[_0x3b33('0x1b')](function(_0xa5b618){logger[_0x3b33('0x18')](_0x3b33('0x26'),_0xa5b618['message'],_0xfca2ab);_0x4ae911(_0x150d03[_0x3b33('0x18')](0x1f4,_0xa5b618[_0x3b33('0x1a')]));});});}; \ No newline at end of file +var _0x136f=['../../config/environment','jayson/promise','redis','defaults','localhost','./faxQueue.socket','register','request','then','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','GetFaxQueue','findAll','options','where','attributes','limit','include','map','model','info','debug','catch','ShowFaxQueue','FaxQueue','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x27926c,_0x37d579){var _0x584578=function(_0x32e167){while(--_0x32e167){_0x27926c['push'](_0x27926c['shift']());}};_0x584578(++_0x37d579);}(_0x136f,0x6c));var _0xf136=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x136f[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xf136('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf136('0x1'));var rs=require(_0xf136('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf136('0x3'))['db'];var utils=require(_0xf136('0x4'));var logger=require(_0xf136('0x5'))('rpc');var config=require(_0xf136('0x6'));var jayson=require(_0xf136('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xf136('0x8')]=_[_0xf136('0x9')](config[_0xf136('0x8')],{'host':_0xf136('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf136('0xb'))[_0xf136('0xc')](socket);function respondWithRpcPromise(_0x2bfd6c,_0x46b5cd,_0x4f5add){return new BPromise(function(_0x334027,_0x35fe81){return client[_0xf136('0xd')](_0x2bfd6c,_0x4f5add)[_0xf136('0xe')](function(_0x273234){logger['info']('FaxQueue,\x20%s,\x20%s',_0x46b5cd,_0xf136('0xf'));logger['debug'](_0xf136('0x10'),_0x46b5cd,_0xf136('0xf'),JSON[_0xf136('0x11')](_0x273234));if(_0x273234[_0xf136('0x12')]){if(_0x273234[_0xf136('0x12')][_0xf136('0x13')]===0x1f4){logger[_0xf136('0x12')](_0xf136('0x14'),_0x46b5cd,_0x273234[_0xf136('0x12')][_0xf136('0x15')]);return _0x35fe81(_0x273234[_0xf136('0x12')][_0xf136('0x15')]);}logger[_0xf136('0x12')](_0xf136('0x14'),_0x46b5cd,_0x273234[_0xf136('0x12')][_0xf136('0x15')]);return _0x334027(_0x273234[_0xf136('0x12')]['message']);}else{logger['info'](_0xf136('0x14'),_0x46b5cd,_0xf136('0xf'));_0x334027(_0x273234[_0xf136('0x16')][_0xf136('0x15')]);}})['catch'](function(_0x340e24){logger[_0xf136('0x12')](_0xf136('0x14'),_0x46b5cd,_0x340e24);_0x35fe81(_0x340e24);});});}exports[_0xf136('0x17')]=function(_0x4dd9ba){var _0x43da2f=this;return new Promise(function(_0xbceb74,_0x121ad2){return db['FaxQueue'][_0xf136('0x18')]({'raw':_0x4dd9ba['options']?_0x4dd9ba[_0xf136('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4dd9ba[_0xf136('0x19')]?_0x4dd9ba['options'][_0xf136('0x1a')]||null:null,'attributes':_0x4dd9ba['options']?_0x4dd9ba[_0xf136('0x19')][_0xf136('0x1b')]||null:null,'limit':_0x4dd9ba['options']?_0x4dd9ba[_0xf136('0x19')][_0xf136('0x1c')]||null:null,'include':_0x4dd9ba['options']?_0x4dd9ba['options'][_0xf136('0x1d')]?_[_0xf136('0x1e')](_0x4dd9ba[_0xf136('0x19')]['include'],function(_0x5f3663){return{'model':db[_0x5f3663[_0xf136('0x1f')]],'as':_0x5f3663['as'],'attributes':_0x5f3663['attributes'],'include':_0x5f3663[_0xf136('0x1d')]?_[_0xf136('0x1e')](_0x5f3663[_0xf136('0x1d')],function(_0x18176d){return{'model':db[_0x18176d['model']],'as':_0x18176d['as'],'attributes':_0x18176d[_0xf136('0x1b')],'include':_0x18176d[_0xf136('0x1d')]?_['map'](_0x18176d['include'],function(_0x35424b){return{'model':db[_0x35424b[_0xf136('0x1f')]],'as':_0x35424b['as'],'attributes':_0x35424b[_0xf136('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x132b60){logger[_0xf136('0x20')](_0xf136('0x17'),_0x4dd9ba);logger[_0xf136('0x21')](_0xf136('0x17'),_0x4dd9ba,JSON[_0xf136('0x11')](_0x132b60));_0xbceb74(_0x132b60);})[_0xf136('0x22')](function(_0x29546e){logger[_0xf136('0x12')](_0xf136('0x17'),_0x29546e[_0xf136('0x15')],_0x4dd9ba);_0x121ad2(_0x43da2f[_0xf136('0x12')](0x1f4,_0x29546e[_0xf136('0x15')]));});});};exports[_0xf136('0x23')]=function(_0x1e4a73){var _0x3665d8=this;return new Promise(function(_0x7180b7,_0x1dea9f){return db[_0xf136('0x24')]['find']({'raw':_0x1e4a73[_0xf136('0x19')]?_0x1e4a73['options'][_0xf136('0x25')]===undefined?!![]:![]:!![],'where':_0x1e4a73[_0xf136('0x19')]?_0x1e4a73[_0xf136('0x19')]['where']||null:null,'attributes':_0x1e4a73[_0xf136('0x19')]?_0x1e4a73[_0xf136('0x19')][_0xf136('0x1b')]||null:null,'include':_0x1e4a73[_0xf136('0x19')]?_0x1e4a73[_0xf136('0x19')]['include']?_[_0xf136('0x1e')](_0x1e4a73[_0xf136('0x19')]['include'],function(_0x381663){return{'model':db[_0x381663['model']],'as':_0x381663['as'],'attributes':_0x381663[_0xf136('0x1b')],'include':_0x381663[_0xf136('0x1d')]?_[_0xf136('0x1e')](_0x381663[_0xf136('0x1d')],function(_0x5ab617){return{'model':db[_0x5ab617[_0xf136('0x1f')]],'as':_0x5ab617['as'],'attributes':_0x5ab617[_0xf136('0x1b')],'include':_0x5ab617[_0xf136('0x1d')]?_[_0xf136('0x1e')](_0x5ab617[_0xf136('0x1d')],function(_0x4b20ac){return{'model':db[_0x4b20ac[_0xf136('0x1f')]],'as':_0x4b20ac['as'],'attributes':_0x4b20ac[_0xf136('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3eb6ff){logger[_0xf136('0x20')](_0xf136('0x23'),_0x1e4a73);logger[_0xf136('0x21')]('ShowFaxQueue',_0x1e4a73,JSON[_0xf136('0x11')](_0x3eb6ff));_0x7180b7(_0x3eb6ff);})[_0xf136('0x22')](function(_0xa04c8e){logger[_0xf136('0x12')]('ShowFaxQueue',_0xa04c8e[_0xf136('0x15')],_0x1e4a73);_0x1dea9f(_0x3665d8['error'](0x1f4,_0xa04c8e[_0xf136('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index c70d809..e150fc0 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 _0x0089=['./faxQueue.events','save','remove','update','emit','removeListener','register','length','faxQueue:'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x0089,0x132));var _0x9008=function(_0x2ced7b,_0x350666){_0x2ced7b=_0x2ced7b-0x0;var _0x1b11f1=_0x0089[_0x2ced7b];return _0x1b11f1;};'use strict';var FaxQueueEvents=require(_0x9008('0x0'));var events=[_0x9008('0x1'),_0x9008('0x2'),_0x9008('0x3')];function createListener(_0x1dbca4,_0x306782){return function(_0x2de1a8){_0x306782[_0x9008('0x4')](_0x1dbca4,_0x2de1a8);};}function removeListener(_0x36040f,_0x36ee98){return function(){FaxQueueEvents[_0x9008('0x5')](_0x36040f,_0x36ee98);};}exports[_0x9008('0x6')]=function(_0x2b1f6a){for(var _0x4d1696=0x0,_0x49381e=events[_0x9008('0x7')];_0x4d1696<_0x49381e;_0x4d1696++){var _0x210401=events[_0x4d1696];var _0x1438ad=createListener(_0x9008('0x8')+_0x210401,_0x2b1f6a);FaxQueueEvents['on'](_0x210401,_0x1438ad);}}; \ No newline at end of file +var _0xc7e4=['removeListener','register','faxQueue:','./faxQueue.events','save','remove','emit'];(function(_0x21ada4,_0xc89442){var _0x2c157d=function(_0x4e5558){while(--_0x4e5558){_0x21ada4['push'](_0x21ada4['shift']());}};_0x2c157d(++_0xc89442);}(_0xc7e4,0x137));var _0x4c7e=function(_0x19be15,_0x5271d3){_0x19be15=_0x19be15-0x0;var _0x28b46d=_0xc7e4[_0x19be15];return _0x28b46d;};'use strict';var FaxQueueEvents=require(_0x4c7e('0x0'));var events=[_0x4c7e('0x1'),_0x4c7e('0x2'),'update'];function createListener(_0x28ec66,_0x521d5a){return function(_0x84d4e9){_0x521d5a[_0x4c7e('0x3')](_0x28ec66,_0x84d4e9);};}function removeListener(_0x4245a7,_0x4ccf5e){return function(){FaxQueueEvents[_0x4c7e('0x4')](_0x4245a7,_0x4ccf5e);};}exports[_0x4c7e('0x5')]=function(_0x3d7dc6){for(var _0x41ef00=0x0,_0x258985=events['length'];_0x41ef00<_0x258985;_0x41ef00++){var _0x496872=events[_0x41ef00];var _0x5e9e61=createListener(_0x4c7e('0x6')+_0x496872,_0x3d7dc6);FaxQueueEvents['on'](_0x496872,_0x5e9e61);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index d583ca7..59c06ae 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(_0x4e41a2,_0x30aaef){var _0x4ae214=function(_0x3ddd82){while(--_0x3ddd82){_0x4e41a2['push'](_0x4e41a2['shift']());}};_0x4ae214(++_0x30aaef);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'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(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0x0b0e[_0x3e182f];return _0x23edc9;};'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 2279549..1c5261b 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 _0x6052=['sequelize','STRING','DATE','moment'];(function(_0x33b0a6,_0x29e01e){var _0x3d52e2=function(_0x4a02f7){while(--_0x4a02f7){_0x33b0a6['push'](_0x33b0a6['shift']());}};_0x3d52e2(++_0x29e01e);}(_0x6052,0xd7));var _0x2605=function(_0x41b214,_0x4ad44b){_0x41b214=_0x41b214-0x0;var _0x32a42b=_0x6052[_0x41b214];return _0x32a42b;};'use strict';var moment=require(_0x2605('0x0'));var Sequelize=require(_0x2605('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x2605('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2605('0x2')]},'joinAt':{'type':Sequelize[_0x2605('0x3')]},'leaveAt':{'type':Sequelize[_0x2605('0x3')]},'acceptAt':{'type':Sequelize[_0x2605('0x3')]},'exitAt':{'type':Sequelize[_0x2605('0x3')]},'reason':{'type':Sequelize[_0x2605('0x2')]}}; \ No newline at end of file +var _0xcf33=['DATE','STRING'];(function(_0x53b57d,_0x2f2fbf){var _0x3286a9=function(_0x3a036e){while(--_0x3a036e){_0x53b57d['push'](_0x53b57d['shift']());}};_0x3286a9(++_0x2f2fbf);}(_0xcf33,0xed));var _0x3cf3=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xcf33[_0x13b8f3];return _0x1a6d06;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3cf3('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x3cf3('0x0')]},'joinAt':{'type':Sequelize[_0x3cf3('0x1')]},'leaveAt':{'type':Sequelize[_0x3cf3('0x1')]},'acceptAt':{'type':Sequelize[_0x3cf3('0x1')]},'exitAt':{'type':Sequelize[_0x3cf3('0x1')]},'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 8552b80..028944a 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 _0xf88b=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','FaxQueueReport','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xf88b,0x84));var _0xbf88=function(_0x541554,_0x566051){_0x541554=_0x541554-0x0;var _0xd17e04=_0xf88b[_0x541554];return _0xd17e04;};'use strict';var pdf=require(_0xbf88('0x0'));var emlformat=require(_0xbf88('0x1'));var rimraf=require(_0xbf88('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf88('0x3'));var rp=require('request-promise');var moment=require(_0xbf88('0x4'));var BPromise=require(_0xbf88('0x5'));var Mustache=require('mustache');var util=require(_0xbf88('0x6'));var path=require(_0xbf88('0x7'));var sox=require(_0xbf88('0x8'));var csv=require('to-csv');var ejs=require(_0xbf88('0x9'));var fs=require('fs');var _=require(_0xbf88('0xa'));var squel=require(_0xbf88('0xb'));var crypto=require(_0xbf88('0xc'));var jsforce=require(_0xbf88('0xd'));var deskjs=require(_0xbf88('0xe'));var toCsv=require(_0xbf88('0xf'));var querystring=require(_0xbf88('0x10'));var Papa=require(_0xbf88('0x11'));var Redis=require(_0xbf88('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbf88('0x13'));var hardwareService=require(_0xbf88('0x14'));var logger=require('../../config/logger')(_0xbf88('0x15'));var utils=require(_0xbf88('0x16'));var config=require(_0xbf88('0x17'));var db=require(_0xbf88('0x18'))['db'];function respondWithStatusCode(_0x6f5d08,_0x490f6f){_0x490f6f=_0x490f6f||0xcc;return function(_0x51cb2c){if(_0x51cb2c){return _0x6f5d08[_0xbf88('0x19')](_0x490f6f);}return _0x6f5d08[_0xbf88('0x1a')](_0x490f6f)[_0xbf88('0x1b')]();};}function respondWithResult(_0x161c64,_0x34c748){_0x34c748=_0x34c748||0xc8;return function(_0x58921c){if(_0x58921c){return _0x161c64['status'](_0x34c748)[_0xbf88('0x1c')](_0x58921c);}};}function respondWithFilteredResult(_0x2c1048,_0x33d48d){return function(_0x31f4d6){if(_0x31f4d6){var _0x5cf502=_0x31f4d6[_0xbf88('0x1d')],_0x45767e=_0x33d48d[_0xbf88('0x1e')],_0x30ea1c=_0x33d48d[_0xbf88('0x1e')]+_0x33d48d['limit'],_0x50bd08;if(_0x30ea1c>=_0x5cf502){_0x30ea1c=_0x5cf502;_0x50bd08=0xc8;}else{_0x50bd08=0xce;}_0x2c1048[_0xbf88('0x1a')](_0x50bd08);return _0x2c1048[_0xbf88('0x1f')](_0xbf88('0x20'),_0x45767e+'-'+_0x30ea1c+'/'+_0x5cf502)[_0xbf88('0x1c')](_0x31f4d6);}return null;};}function patchUpdates(_0x161a4e){return function(_0x5d4fcc){try{jsonpatch[_0xbf88('0x21')](_0x5d4fcc,_0x161a4e,!![]);}catch(_0xa85bb){return BPromise['reject'](_0xa85bb);}return _0x5d4fcc[_0xbf88('0x22')]();};}function saveUpdates(_0x3d5589,_0x2d0179){return function(_0x391e03){if(_0x391e03){return _0x391e03[_0xbf88('0x23')](_0x3d5589)['then'](function(_0x45bb57){return _0x45bb57;});}return null;};}function removeEntity(_0x50a59f,_0x38aba5){return function(_0x17c1b9){if(_0x17c1b9){return _0x17c1b9[_0xbf88('0x24')]()[_0xbf88('0x25')](function(){_0x50a59f[_0xbf88('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x244796,_0xe39817){return function(_0x4368ae){if(!_0x4368ae){_0x244796['sendStatus'](0x194);}return _0x4368ae;};}function handleError(_0x41dd13,_0x30d936){_0x30d936=_0x30d936||0x1f4;return function(_0x16df8c){logger[_0xbf88('0x26')](_0x16df8c[_0xbf88('0x27')]);if(_0x16df8c[_0xbf88('0x28')]){delete _0x16df8c[_0xbf88('0x28')];}_0x41dd13[_0xbf88('0x1a')](_0x30d936)['send'](_0x16df8c);};}exports['index']=function(_0x2bb420,_0x2afa04){var _0x2ca508={},_0x50326e={},_0x2d6297={'count':0x0,'rows':[]};var _0x1433fa=_[_0xbf88('0x29')](db['FaxQueueReport']['rawAttributes'],function(_0x588ff9){return{'name':_0x588ff9[_0xbf88('0x2a')],'type':_0x588ff9[_0xbf88('0x2b')][_0xbf88('0x2c')]};});_0x50326e[_0xbf88('0x2d')]=_[_0xbf88('0x29')](_0x1433fa,_0xbf88('0x28'));_0x50326e[_0xbf88('0x2e')]=_[_0xbf88('0x2f')](_0x2bb420[_0xbf88('0x2e')]);_0x50326e[_0xbf88('0x30')]=_[_0xbf88('0x31')](_0x50326e[_0xbf88('0x2d')],_0x50326e[_0xbf88('0x2e')]);_0x2ca508[_0xbf88('0x32')]=_[_0xbf88('0x31')](_0x50326e[_0xbf88('0x2d')],qs[_0xbf88('0x33')](_0x2bb420[_0xbf88('0x2e')][_0xbf88('0x33')]));_0x2ca508[_0xbf88('0x32')]=_0x2ca508[_0xbf88('0x32')][_0xbf88('0x34')]?_0x2ca508[_0xbf88('0x32')]:_0x50326e[_0xbf88('0x2d')];if(!_0x2bb420['query']['hasOwnProperty'](_0xbf88('0x35'))){_0x2ca508[_0xbf88('0x36')]=qs['limit'](_0x2bb420[_0xbf88('0x2e')][_0xbf88('0x36')]);_0x2ca508[_0xbf88('0x1e')]=qs[_0xbf88('0x1e')](_0x2bb420['query'][_0xbf88('0x1e')]);}_0x2ca508[_0xbf88('0x37')]=qs[_0xbf88('0x38')](_0x2bb420[_0xbf88('0x2e')]['sort']);_0x2ca508[_0xbf88('0x39')]=qs['filters'](_[_0xbf88('0x3a')](_0x2bb420[_0xbf88('0x2e')],_0x50326e['filters']));if(_0x2bb420[_0xbf88('0x2e')][_0xbf88('0x3b')]){_0x2ca508[_0xbf88('0x39')]=_[_0xbf88('0x3c')](_0x2ca508['where'],{'$or':_[_0xbf88('0x29')](_0x1433fa,function(_0x3f3fc0){if(_0x3f3fc0[_0xbf88('0x2b')]!==_0xbf88('0x3d')){var _0x5cc21a={};_0x5cc21a[_0x3f3fc0['name']]={'$like':'%'+_0x2bb420['query'][_0xbf88('0x3b')]+'%'};return _0x5cc21a;}})});}_0x2ca508=_[_0xbf88('0x3c')]({},_0x2ca508,_0x2bb420['options']);var _0x11a36d={'where':_0x2ca508[_0xbf88('0x39')]};return db[_0xbf88('0x3e')][_0xbf88('0x1d')](_0x11a36d)[_0xbf88('0x25')](function(_0x18f833){_0x2d6297[_0xbf88('0x1d')]=_0x18f833;if(_0x2bb420[_0xbf88('0x2e')]['includeAll']){_0x2ca508['include']=[{'all':!![]}];}return db[_0xbf88('0x3e')][_0xbf88('0x3f')](_0x2ca508);})['then'](function(_0x41348f){_0x2d6297[_0xbf88('0x40')]=_0x41348f;return _0x2d6297;})['then'](respondWithFilteredResult(_0x2afa04,_0x2ca508))[_0xbf88('0x41')](handleError(_0x2afa04,null));};exports[_0xbf88('0x42')]=function(_0x20bab2,_0x3a1163){var _0x134f63={'raw':!![],'where':{'id':_0x20bab2[_0xbf88('0x43')]['id']}},_0x106e31={};_0x106e31[_0xbf88('0x2d')]=_[_0xbf88('0x2f')](db[_0xbf88('0x3e')][_0xbf88('0x44')]);_0x106e31[_0xbf88('0x2e')]=_[_0xbf88('0x2f')](_0x20bab2[_0xbf88('0x2e')]);_0x106e31[_0xbf88('0x30')]=_[_0xbf88('0x31')](_0x106e31[_0xbf88('0x2d')],_0x106e31[_0xbf88('0x2e')]);_0x134f63[_0xbf88('0x32')]=_[_0xbf88('0x31')](_0x106e31[_0xbf88('0x2d')],qs[_0xbf88('0x33')](_0x20bab2['query'][_0xbf88('0x33')]));_0x134f63[_0xbf88('0x32')]=_0x134f63[_0xbf88('0x32')][_0xbf88('0x34')]?_0x134f63[_0xbf88('0x32')]:_0x106e31[_0xbf88('0x2d')];if(_0x20bab2[_0xbf88('0x2e')]['includeAll']){_0x134f63['include']=[{'all':!![]}];}_0x134f63=_[_0xbf88('0x3c')]({},_0x134f63,_0x20bab2[_0xbf88('0x45')]);return db[_0xbf88('0x3e')][_0xbf88('0x46')](_0x134f63)[_0xbf88('0x25')](handleEntityNotFound(_0x3a1163,null))['then'](respondWithResult(_0x3a1163,null))[_0xbf88('0x41')](handleError(_0x3a1163,null));};exports[_0xbf88('0x47')]=function(_0x1419a3,_0x1482e0){return db[_0xbf88('0x3e')]['create'](_0x1419a3[_0xbf88('0x48')],{})[_0xbf88('0x25')](respondWithResult(_0x1482e0,0xc9))[_0xbf88('0x41')](handleError(_0x1482e0,null));};exports[_0xbf88('0x23')]=function(_0x148760,_0x30989b){if(_0x148760['body']['id']){delete _0x148760[_0xbf88('0x48')]['id'];}return db['FaxQueueReport'][_0xbf88('0x46')]({'where':{'id':_0x148760['params']['id']}})[_0xbf88('0x25')](handleEntityNotFound(_0x30989b,null))[_0xbf88('0x25')](saveUpdates(_0x148760['body'],null))[_0xbf88('0x25')](respondWithResult(_0x30989b,null))[_0xbf88('0x41')](handleError(_0x30989b,null));};exports[_0xbf88('0x24')]=function(_0x136b6f,_0x51e6bb){return db[_0xbf88('0x3e')][_0xbf88('0x46')]({'where':{'id':_0x136b6f[_0xbf88('0x43')]['id']}})[_0xbf88('0x25')](handleEntityNotFound(_0x51e6bb,null))[_0xbf88('0x25')](removeEntity(_0x51e6bb,null))['catch'](handleError(_0x51e6bb,null));};exports['describe']=function(_0x5f5246,_0x457176){return db[_0xbf88('0x3e')][_0xbf88('0x49')]()['then'](respondWithResult(_0x457176,null))['catch'](handleError(_0x457176,null));}; \ No newline at end of file +var _0x4563=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','FaxQueueReport','findAll','catch','show','params','include','find','create','body','describe','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x4563,0x67));var _0x3456=function(_0x25af71,_0xbbfe94){_0x25af71=_0x25af71-0x0;var _0x2c7fd9=_0x4563[_0x25af71];return _0x2c7fd9;};'use strict';var pdf=require(_0x3456('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3456('0x1'));var zipdir=require(_0x3456('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3456('0x3'));var moment=require(_0x3456('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3456('0x5'));var util=require(_0x3456('0x6'));var path=require('path');var sox=require(_0x3456('0x7'));var csv=require(_0x3456('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3456('0x9'));var crypto=require(_0x3456('0xa'));var jsforce=require(_0x3456('0xb'));var deskjs=require(_0x3456('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3456('0xd'));var Redis=require('ioredis');var authService=require(_0x3456('0xe'));var qs=require(_0x3456('0xf'));var as=require(_0x3456('0x10'));var hardwareService=require(_0x3456('0x11'));var logger=require(_0x3456('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x3456('0x13'));var db=require(_0x3456('0x14'))['db'];function respondWithStatusCode(_0x106837,_0x6170ca){_0x6170ca=_0x6170ca||0xcc;return function(_0x14cfe9){if(_0x14cfe9){return _0x106837[_0x3456('0x15')](_0x6170ca);}return _0x106837['status'](_0x6170ca)[_0x3456('0x16')]();};}function respondWithResult(_0x286cab,_0x175634){_0x175634=_0x175634||0xc8;return function(_0x195677){if(_0x195677){return _0x286cab['status'](_0x175634)[_0x3456('0x17')](_0x195677);}};}function respondWithFilteredResult(_0x50c76f,_0x177f7b){return function(_0x3f7818){if(_0x3f7818){var _0x5f55da=_0x3f7818[_0x3456('0x18')],_0x458604=_0x177f7b['offset'],_0x1e783f=_0x177f7b[_0x3456('0x19')]+_0x177f7b['limit'],_0x57bf1d;if(_0x1e783f>=_0x5f55da){_0x1e783f=_0x5f55da;_0x57bf1d=0xc8;}else{_0x57bf1d=0xce;}_0x50c76f[_0x3456('0x1a')](_0x57bf1d);return _0x50c76f[_0x3456('0x1b')](_0x3456('0x1c'),_0x458604+'-'+_0x1e783f+'/'+_0x5f55da)[_0x3456('0x17')](_0x3f7818);}return null;};}function patchUpdates(_0x38fec6){return function(_0x1d75ba){try{jsonpatch['apply'](_0x1d75ba,_0x38fec6,!![]);}catch(_0x14d8d0){return BPromise[_0x3456('0x1d')](_0x14d8d0);}return _0x1d75ba[_0x3456('0x1e')]();};}function saveUpdates(_0x3aaeea,_0x5971c0){return function(_0x58fff4){if(_0x58fff4){return _0x58fff4[_0x3456('0x1f')](_0x3aaeea)[_0x3456('0x20')](function(_0x165398){return _0x165398;});}return null;};}function removeEntity(_0x7ae69a,_0x4e96b1){return function(_0x129a45){if(_0x129a45){return _0x129a45[_0x3456('0x21')]()[_0x3456('0x20')](function(){_0x7ae69a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfc9efa,_0xd73cf7){return function(_0x368491){if(!_0x368491){_0xfc9efa['sendStatus'](0x194);}return _0x368491;};}function handleError(_0x15a49b,_0x38be82){_0x38be82=_0x38be82||0x1f4;return function(_0x4dc21d){logger[_0x3456('0x22')](_0x4dc21d[_0x3456('0x23')]);if(_0x4dc21d[_0x3456('0x24')]){delete _0x4dc21d[_0x3456('0x24')];}_0x15a49b[_0x3456('0x1a')](_0x38be82)['send'](_0x4dc21d);};}exports[_0x3456('0x25')]=function(_0x112e3c,_0x265481){var _0x24a1d2={},_0x5eecca={},_0x8480db={'count':0x0,'rows':[]};var _0xdfa38e=_[_0x3456('0x26')](db['FaxQueueReport'][_0x3456('0x27')],function(_0x5f3c2c){return{'name':_0x5f3c2c[_0x3456('0x28')],'type':_0x5f3c2c[_0x3456('0x29')]['key']};});_0x5eecca[_0x3456('0x2a')]=_['map'](_0xdfa38e,'name');_0x5eecca[_0x3456('0x2b')]=_[_0x3456('0x2c')](_0x112e3c[_0x3456('0x2b')]);_0x5eecca[_0x3456('0x2d')]=_[_0x3456('0x2e')](_0x5eecca[_0x3456('0x2a')],_0x5eecca[_0x3456('0x2b')]);_0x24a1d2[_0x3456('0x2f')]=_[_0x3456('0x2e')](_0x5eecca[_0x3456('0x2a')],qs[_0x3456('0x30')](_0x112e3c[_0x3456('0x2b')][_0x3456('0x30')]));_0x24a1d2[_0x3456('0x2f')]=_0x24a1d2[_0x3456('0x2f')][_0x3456('0x31')]?_0x24a1d2[_0x3456('0x2f')]:_0x5eecca['model'];if(!_0x112e3c[_0x3456('0x2b')]['hasOwnProperty'](_0x3456('0x32'))){_0x24a1d2[_0x3456('0x33')]=qs[_0x3456('0x33')](_0x112e3c['query'][_0x3456('0x33')]);_0x24a1d2[_0x3456('0x19')]=qs[_0x3456('0x19')](_0x112e3c[_0x3456('0x2b')][_0x3456('0x19')]);}_0x24a1d2[_0x3456('0x34')]=qs['sort'](_0x112e3c[_0x3456('0x2b')][_0x3456('0x35')]);_0x24a1d2[_0x3456('0x36')]=qs['filters'](_[_0x3456('0x37')](_0x112e3c[_0x3456('0x2b')],_0x5eecca['filters']));if(_0x112e3c[_0x3456('0x2b')][_0x3456('0x38')]){_0x24a1d2['where']=_[_0x3456('0x39')](_0x24a1d2[_0x3456('0x36')],{'$or':_[_0x3456('0x26')](_0xdfa38e,function(_0x5b478e){if(_0x5b478e[_0x3456('0x29')]!==_0x3456('0x3a')){var _0x491673={};_0x491673[_0x5b478e['name']]={'$like':'%'+_0x112e3c[_0x3456('0x2b')][_0x3456('0x38')]+'%'};return _0x491673;}})});}_0x24a1d2=_['merge']({},_0x24a1d2,_0x112e3c[_0x3456('0x3b')]);var _0x2ac666={'where':_0x24a1d2[_0x3456('0x36')]};return db['FaxQueueReport'][_0x3456('0x18')](_0x2ac666)[_0x3456('0x20')](function(_0x2c9903){_0x8480db[_0x3456('0x18')]=_0x2c9903;if(_0x112e3c[_0x3456('0x2b')][_0x3456('0x3c')]){_0x24a1d2['include']=[{'all':!![]}];}return db[_0x3456('0x3d')][_0x3456('0x3e')](_0x24a1d2);})[_0x3456('0x20')](function(_0x19b11a){_0x8480db['rows']=_0x19b11a;return _0x8480db;})[_0x3456('0x20')](respondWithFilteredResult(_0x265481,_0x24a1d2))[_0x3456('0x3f')](handleError(_0x265481,null));};exports[_0x3456('0x40')]=function(_0x190b07,_0x3fd7d3){var _0x2afa82={'raw':!![],'where':{'id':_0x190b07[_0x3456('0x41')]['id']}},_0x112109={};_0x112109['model']=_[_0x3456('0x2c')](db[_0x3456('0x3d')][_0x3456('0x27')]);_0x112109[_0x3456('0x2b')]=_['keys'](_0x190b07['query']);_0x112109[_0x3456('0x2d')]=_[_0x3456('0x2e')](_0x112109[_0x3456('0x2a')],_0x112109[_0x3456('0x2b')]);_0x2afa82[_0x3456('0x2f')]=_['intersection'](_0x112109[_0x3456('0x2a')],qs[_0x3456('0x30')](_0x190b07['query'][_0x3456('0x30')]));_0x2afa82[_0x3456('0x2f')]=_0x2afa82[_0x3456('0x2f')][_0x3456('0x31')]?_0x2afa82['attributes']:_0x112109['model'];if(_0x190b07[_0x3456('0x2b')][_0x3456('0x3c')]){_0x2afa82[_0x3456('0x42')]=[{'all':!![]}];}_0x2afa82=_[_0x3456('0x39')]({},_0x2afa82,_0x190b07[_0x3456('0x3b')]);return db[_0x3456('0x3d')][_0x3456('0x43')](_0x2afa82)[_0x3456('0x20')](handleEntityNotFound(_0x3fd7d3,null))[_0x3456('0x20')](respondWithResult(_0x3fd7d3,null))[_0x3456('0x3f')](handleError(_0x3fd7d3,null));};exports['create']=function(_0xa76295,_0x3a5e66){return db[_0x3456('0x3d')][_0x3456('0x44')](_0xa76295['body'],{})['then'](respondWithResult(_0x3a5e66,0xc9))[_0x3456('0x3f')](handleError(_0x3a5e66,null));};exports[_0x3456('0x1f')]=function(_0x463e69,_0x381241){if(_0x463e69[_0x3456('0x45')]['id']){delete _0x463e69[_0x3456('0x45')]['id'];}return db['FaxQueueReport'][_0x3456('0x43')]({'where':{'id':_0x463e69[_0x3456('0x41')]['id']}})[_0x3456('0x20')](handleEntityNotFound(_0x381241,null))[_0x3456('0x20')](saveUpdates(_0x463e69['body'],null))['then'](respondWithResult(_0x381241,null))[_0x3456('0x3f')](handleError(_0x381241,null));};exports[_0x3456('0x21')]=function(_0x3f50f3,_0x3b6604){return db['FaxQueueReport']['find']({'where':{'id':_0x3f50f3[_0x3456('0x41')]['id']}})[_0x3456('0x20')](handleEntityNotFound(_0x3b6604,null))[_0x3456('0x20')](removeEntity(_0x3b6604,null))['catch'](handleError(_0x3b6604,null));};exports[_0x3456('0x46')]=function(_0x3bd94d,_0x2328b5){return db['FaxQueueReport'][_0x3456('0x46')]()[_0x3456('0x20')](respondWithResult(_0x2328b5,null))['catch'](handleError(_0x2328b5,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 343431f..2d9fe53 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 _0x65d6=['./faxQueueReport.attributes','exports','FaxQueueReport','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x65d6,0x88));var _0x665d=function(_0x13beff,_0x2ce78e){_0x13beff=_0x13beff-0x0;var _0xa80eaf=_0x65d6[_0x13beff];return _0xa80eaf;};'use strict';var _=require(_0x665d('0x0'));var util=require(_0x665d('0x1'));var logger=require('../../config/logger')(_0x665d('0x2'));var moment=require(_0x665d('0x3'));var BPromise=require('bluebird');var rp=require(_0x665d('0x4'));var fs=require('fs');var path=require(_0x665d('0x5'));var rimraf=require(_0x665d('0x6'));var config=require(_0x665d('0x7'));var attributes=require(_0x665d('0x8'));module[_0x665d('0x9')]=function(_0x4aadf1,_0x1fcf42){return _0x4aadf1['define'](_0x665d('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x665d('0xb'),'fields':[_0x665d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5aa3=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util'];(function(_0x124921,_0x36596b){var _0x2fd6a9=function(_0xd65921){while(--_0xd65921){_0x124921['push'](_0x124921['shift']());}};_0x2fd6a9(++_0x36596b);}(_0x5aa3,0x184));var _0x35aa=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x5aa3[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0x35aa('0x0'));var util=require(_0x35aa('0x1'));var logger=require(_0x35aa('0x2'))(_0x35aa('0x3'));var moment=require(_0x35aa('0x4'));var BPromise=require(_0x35aa('0x5'));var rp=require(_0x35aa('0x6'));var fs=require('fs');var path=require(_0x35aa('0x7'));var rimraf=require(_0x35aa('0x8'));var config=require(_0x35aa('0x9'));var attributes=require(_0x35aa('0xa'));module[_0x35aa('0xb')]=function(_0x1e8849,_0x2e4acd){return _0x1e8849['define'](_0x35aa('0xc'),attributes,{'tableName':_0x35aa('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x35aa('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index ee0fac6..0edf6ed 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 _0x9a61=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','CreateFaxQueueReport','create','options','raw','UpdateFaxQueueReport','FaxQueueReport','body','where','attributes','limit','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9a61,0x1cb));var _0x19a6=function(_0x2fbb8b,_0x3293b9){_0x2fbb8b=_0x2fbb8b-0x0;var _0x3cfb27=_0x9a61[_0x2fbb8b];return _0x3cfb27;};'use strict';var _=require(_0x19a6('0x0'));var util=require(_0x19a6('0x1'));var moment=require(_0x19a6('0x2'));var BPromise=require(_0x19a6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x19a6('0x4'));var db=require(_0x19a6('0x5'))['db'];var utils=require(_0x19a6('0x6'));var logger=require('../../config/logger')(_0x19a6('0x7'));var config=require('../../config/environment');var jayson=require(_0x19a6('0x8'));var client=jayson[_0x19a6('0x9')][_0x19a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b4df1,_0x587d52,_0x3c7972){return new BPromise(function(_0x512dbe,_0x3631af){return client[_0x19a6('0xb')](_0x1b4df1,_0x3c7972)[_0x19a6('0xc')](function(_0x421672){logger[_0x19a6('0xd')](_0x19a6('0xe'),_0x587d52,_0x19a6('0xf'));logger[_0x19a6('0x10')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x587d52,'request\x20sent',JSON['stringify'](_0x421672));if(_0x421672['error']){if(_0x421672[_0x19a6('0x11')]['code']===0x1f4){logger[_0x19a6('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x587d52,_0x421672[_0x19a6('0x11')]['message']);return _0x3631af(_0x421672['error'][_0x19a6('0x12')]);}logger[_0x19a6('0x11')](_0x19a6('0xe'),_0x587d52,_0x421672['error']['message']);return _0x512dbe(_0x421672['error'][_0x19a6('0x12')]);}else{logger[_0x19a6('0xd')](_0x19a6('0xe'),_0x587d52,_0x19a6('0xf'));_0x512dbe(_0x421672['result']['message']);}})[_0x19a6('0x13')](function(_0xed2a4){logger[_0x19a6('0x11')](_0x19a6('0xe'),_0x587d52,_0xed2a4);_0x3631af(_0xed2a4);});});}exports[_0x19a6('0x14')]=function(_0x40cd43){var _0x53786d=this;return new Promise(function(_0x3cf156,_0x54c9c9){return db['FaxQueueReport'][_0x19a6('0x15')](_0x40cd43['body'],{'raw':_0x40cd43[_0x19a6('0x16')]?_0x40cd43[_0x19a6('0x16')][_0x19a6('0x17')]===undefined?!![]:![]:!![]})[_0x19a6('0xc')](function(_0x3df715){logger[_0x19a6('0xd')](_0x19a6('0x14'),_0x40cd43);logger[_0x19a6('0x10')]('CreateFaxQueueReport',_0x40cd43,JSON['stringify'](_0x3df715));_0x3cf156(_0x3df715);})[_0x19a6('0x13')](function(_0x4910b2){logger[_0x19a6('0x11')](_0x19a6('0x14'),_0x4910b2['message'],_0x40cd43);_0x54c9c9(_0x53786d[_0x19a6('0x11')](0x1f4,_0x4910b2[_0x19a6('0x12')]));});});};exports[_0x19a6('0x18')]=function(_0x514c00){var _0x590c42=this;return new Promise(function(_0x37cfa8,_0x1abe1d){return db[_0x19a6('0x19')]['update'](_0x514c00[_0x19a6('0x1a')],{'raw':_0x514c00[_0x19a6('0x16')]?_0x514c00[_0x19a6('0x16')][_0x19a6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x514c00[_0x19a6('0x16')]?_0x514c00[_0x19a6('0x16')][_0x19a6('0x1b')]||null:null,'attributes':_0x514c00[_0x19a6('0x16')]?_0x514c00[_0x19a6('0x16')][_0x19a6('0x1c')]||null:null,'limit':_0x514c00['options']?_0x514c00['options'][_0x19a6('0x1d')]||null:null})[_0x19a6('0xc')](function(_0x5f41aa){logger['info'](_0x19a6('0x18'),_0x514c00);logger['debug'](_0x19a6('0x18'),_0x514c00,JSON[_0x19a6('0x1e')](_0x5f41aa));_0x37cfa8(_0x5f41aa);})['catch'](function(_0xf762d6){logger[_0x19a6('0x11')](_0x19a6('0x18'),_0xf762d6[_0x19a6('0x12')],_0x514c00);_0x1abe1d(_0x590c42[_0x19a6('0x11')](0x1f4,_0xf762d6[_0x19a6('0x12')]));});});}; \ No newline at end of file +var _0xb8ec=['../../config/environment','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateFaxQueueReport','FaxQueueReport','body','options','catch','UpdateFaxQueueReport','update','raw','where','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x80ce0d,_0x5ca10){var _0x3c33ae=function(_0x3bc9c4){while(--_0x3bc9c4){_0x80ce0d['push'](_0x80ce0d['shift']());}};_0x3c33ae(++_0x5ca10);}(_0xb8ec,0x1ca));var _0xcb8e=function(_0x2bd939,_0x55556d){_0x2bd939=_0x2bd939-0x0;var _0x486200=_0xb8ec[_0x2bd939];return _0x486200;};'use strict';var _=require(_0xcb8e('0x0'));var util=require('util');var moment=require(_0xcb8e('0x1'));var BPromise=require(_0xcb8e('0x2'));var rs=require(_0xcb8e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb8e('0x4'))['db'];var utils=require(_0xcb8e('0x5'));var logger=require('../../config/logger')(_0xcb8e('0x6'));var config=require(_0xcb8e('0x7'));var jayson=require(_0xcb8e('0x8'));var client=jayson['client'][_0xcb8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6c3755,_0x21da8c,_0x237250){return new BPromise(function(_0x38e6b1,_0x4ec58b){return client[_0xcb8e('0xa')](_0x6c3755,_0x237250)[_0xcb8e('0xb')](function(_0x48139e){logger[_0xcb8e('0xc')](_0xcb8e('0xd'),_0x21da8c,_0xcb8e('0xe'));logger[_0xcb8e('0xf')](_0xcb8e('0x10'),_0x21da8c,_0xcb8e('0xe'),JSON[_0xcb8e('0x11')](_0x48139e));if(_0x48139e[_0xcb8e('0x12')]){if(_0x48139e[_0xcb8e('0x12')][_0xcb8e('0x13')]===0x1f4){logger[_0xcb8e('0x12')](_0xcb8e('0xd'),_0x21da8c,_0x48139e['error']['message']);return _0x4ec58b(_0x48139e[_0xcb8e('0x12')][_0xcb8e('0x14')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x21da8c,_0x48139e[_0xcb8e('0x12')][_0xcb8e('0x14')]);return _0x38e6b1(_0x48139e['error'][_0xcb8e('0x14')]);}else{logger['info'](_0xcb8e('0xd'),_0x21da8c,_0xcb8e('0xe'));_0x38e6b1(_0x48139e['result'][_0xcb8e('0x14')]);}})['catch'](function(_0x501245){logger[_0xcb8e('0x12')](_0xcb8e('0xd'),_0x21da8c,_0x501245);_0x4ec58b(_0x501245);});});}exports[_0xcb8e('0x15')]=function(_0x5914a2){var _0x36e4ca=this;return new Promise(function(_0x3b0601,_0x39b703){return db[_0xcb8e('0x16')]['create'](_0x5914a2[_0xcb8e('0x17')],{'raw':_0x5914a2[_0xcb8e('0x18')]?_0x5914a2['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4987d6){logger['info']('CreateFaxQueueReport',_0x5914a2);logger[_0xcb8e('0xf')]('CreateFaxQueueReport',_0x5914a2,JSON[_0xcb8e('0x11')](_0x4987d6));_0x3b0601(_0x4987d6);})[_0xcb8e('0x19')](function(_0x7285c2){logger[_0xcb8e('0x12')](_0xcb8e('0x15'),_0x7285c2[_0xcb8e('0x14')],_0x5914a2);_0x39b703(_0x36e4ca[_0xcb8e('0x12')](0x1f4,_0x7285c2['message']));});});};exports[_0xcb8e('0x1a')]=function(_0x54ef73){var _0x5ae0ed=this;return new Promise(function(_0x44a148,_0x453193){return db['FaxQueueReport'][_0xcb8e('0x1b')](_0x54ef73[_0xcb8e('0x17')],{'raw':_0x54ef73[_0xcb8e('0x18')]?_0x54ef73['options'][_0xcb8e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54ef73[_0xcb8e('0x18')]?_0x54ef73[_0xcb8e('0x18')][_0xcb8e('0x1d')]||null:null,'attributes':_0x54ef73[_0xcb8e('0x18')]?_0x54ef73[_0xcb8e('0x18')][_0xcb8e('0x1e')]||null:null,'limit':_0x54ef73[_0xcb8e('0x18')]?_0x54ef73[_0xcb8e('0x18')]['limit']||null:null})['then'](function(_0x2d0a2d){logger[_0xcb8e('0xc')](_0xcb8e('0x1a'),_0x54ef73);logger[_0xcb8e('0xf')](_0xcb8e('0x1a'),_0x54ef73,JSON[_0xcb8e('0x11')](_0x2d0a2d));_0x44a148(_0x2d0a2d);})[_0xcb8e('0x19')](function(_0x27985e){logger['error']('UpdateFaxQueueReport',_0x27985e['message'],_0x54ef73);_0x453193(_0x5ae0ed[_0xcb8e('0x12')](0x1f4,_0x27985e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index aaf2b52..bd5cc19 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 _0x0209=['./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create','/:id','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x47f98b,_0x1e254f){var _0x22eef2=function(_0x41137b){while(--_0x41137b){_0x47f98b['push'](_0x47f98b['shift']());}};_0x22eef2(++_0x1e254f);}(_0x0209,0xa4));var _0x9020=function(_0x5465d4,_0x5fe209){_0x5465d4=_0x5465d4-0x0;var _0x54dca2=_0x0209[_0x5465d4];return _0x54dca2;};'use strict';var multer=require(_0x9020('0x0'));var util=require(_0x9020('0x1'));var path=require('path');var timeout=require(_0x9020('0x2'));var express=require(_0x9020('0x3'));var router=express['Router']();var auth=require(_0x9020('0x4'));var interaction=require(_0x9020('0x5'));var config=require(_0x9020('0x6'));var controller=require(_0x9020('0x7'));router[_0x9020('0x8')]('/',auth[_0x9020('0x9')](),controller[_0x9020('0xa')]);router[_0x9020('0x8')](_0x9020('0xb'),auth[_0x9020('0x9')](),controller[_0x9020('0xc')]);router[_0x9020('0x8')]('/:id',auth[_0x9020('0x9')](),controller[_0x9020('0xd')]);router['post']('/',auth[_0x9020('0x9')](),controller[_0x9020('0xe')]);router['put'](_0x9020('0xf'),auth[_0x9020('0x9')](),controller['update']);router[_0x9020('0x10')](_0x9020('0xf'),auth['isAuthenticated'](),controller[_0x9020('0x11')]);module[_0x9020('0x12')]=router; \ No newline at end of file +var _0x6211=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','/:id','delete','destroy','multer','path','connect-timeout','express'];(function(_0x13c40f,_0x162130){var _0x10ee2c=function(_0x1394d1){while(--_0x1394d1){_0x13c40f['push'](_0x13c40f['shift']());}};_0x10ee2c(++_0x162130);}(_0x6211,0x1cc));var _0x1621=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6211[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x1621('0x0'));var util=require('util');var path=require(_0x1621('0x1'));var timeout=require(_0x1621('0x2'));var express=require(_0x1621('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1621('0x4'));var config=require(_0x1621('0x5'));var controller=require('./faxQueueReport.controller');router[_0x1621('0x6')]('/',auth[_0x1621('0x7')](),controller[_0x1621('0x8')]);router[_0x1621('0x6')](_0x1621('0x9'),auth[_0x1621('0x7')](),controller[_0x1621('0xa')]);router[_0x1621('0x6')]('/:id',auth[_0x1621('0x7')](),controller[_0x1621('0xb')]);router[_0x1621('0xc')]('/',auth[_0x1621('0x7')](),controller['create']);router['put'](_0x1621('0xd'),auth[_0x1621('0x7')](),controller['update']);router[_0x1621('0xe')](_0x1621('0xd'),auth['isAuthenticated'](),controller[_0x1621('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 0d9057c..586cbd2 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 _0x95b1=['moment','exports','ENUM','account','agent','queue','DATE'];(function(_0x2bef3a,_0x1c0027){var _0x8fc616=function(_0x24f290){while(--_0x24f290){_0x2bef3a['push'](_0x2bef3a['shift']());}};_0x8fc616(++_0x1c0027);}(_0x95b1,0x1e3));var _0x195b=function(_0x252a26,_0xe7e052){_0x252a26=_0x252a26-0x0;var _0x763a6c=_0x95b1[_0x252a26];return _0x763a6c;};'use strict';var moment=require(_0x195b('0x0'));var Sequelize=require('sequelize');module[_0x195b('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x195b('0x2')](_0x195b('0x3'),_0x195b('0x4'),_0x195b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x195b('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x7563=['STRING','ENUM','account','queue','DATE','NOW','moment','exports'];(function(_0xe03fe6,_0x5eb7fe){var _0x10f97c=function(_0x352d57){while(--_0x352d57){_0xe03fe6['push'](_0xe03fe6['shift']());}};_0x10f97c(++_0x5eb7fe);}(_0x7563,0x1de));var _0x3756=function(_0x4beb28,_0x7dd554){_0x4beb28=_0x4beb28-0x0;var _0x56177d=_0x7563[_0x4beb28];return _0x56177d;};'use strict';var moment=require(_0x3756('0x0'));var Sequelize=require('sequelize');module[_0x3756('0x1')]={'uniqueid':{'type':Sequelize[_0x3756('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3756('0x3')](_0x3756('0x4'),'agent','queue'),'allowNull':![],'defaultValue':_0x3756('0x5')},'transferredAt':{'type':Sequelize[_0x3756('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x3756('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index cbf4b8f..183dc9c 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 _0x63e2=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','sendStatus','name','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','map','VIRTUAL','merge','options','FaxTransferReport','includeAll','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xea1c9c,_0x4af7fa){var _0x39664e=function(_0x3c97a3){while(--_0x3c97a3){_0xea1c9c['push'](_0xea1c9c['shift']());}};_0x39664e(++_0x4af7fa);}(_0x63e2,0x105));var _0x263e=function(_0x38add1,_0x44b935){_0x38add1=_0x38add1-0x0;var _0x234c6f=_0x63e2[_0x38add1];return _0x234c6f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x263e('0x0'));var rimraf=require(_0x263e('0x1'));var zipdir=require(_0x263e('0x2'));var jsonpatch=require(_0x263e('0x3'));var rp=require(_0x263e('0x4'));var moment=require(_0x263e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x263e('0x6'));var util=require(_0x263e('0x7'));var path=require(_0x263e('0x8'));var sox=require(_0x263e('0x9'));var csv=require(_0x263e('0xa'));var ejs=require(_0x263e('0xb'));var fs=require('fs');var _=require(_0x263e('0xc'));var squel=require('squel');var crypto=require(_0x263e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x263e('0xe'));var toCsv=require(_0x263e('0xa'));var querystring=require('querystring');var Papa=require(_0x263e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x263e('0x10'));var as=require(_0x263e('0x11'));var hardwareService=require(_0x263e('0x12'));var logger=require(_0x263e('0x13'))(_0x263e('0x14'));var utils=require(_0x263e('0x15'));var config=require(_0x263e('0x16'));var db=require(_0x263e('0x17'))['db'];function respondWithStatusCode(_0x293f20,_0xaa2eeb){_0xaa2eeb=_0xaa2eeb||0xcc;return function(_0x217d68){if(_0x217d68){return _0x293f20['sendStatus'](_0xaa2eeb);}return _0x293f20[_0x263e('0x18')](_0xaa2eeb)[_0x263e('0x19')]();};}function respondWithResult(_0xe479c0,_0x4769eb){_0x4769eb=_0x4769eb||0xc8;return function(_0x1b7ea5){if(_0x1b7ea5){return _0xe479c0[_0x263e('0x18')](_0x4769eb)['json'](_0x1b7ea5);}};}function respondWithFilteredResult(_0x589dfb,_0x37de53){return function(_0xe30be9){if(_0xe30be9){var _0x46f8e5=_0xe30be9[_0x263e('0x1a')],_0x30e9c7=_0x37de53[_0x263e('0x1b')],_0x260da1=_0x37de53[_0x263e('0x1b')]+_0x37de53[_0x263e('0x1c')],_0x288f24;if(_0x260da1>=_0x46f8e5){_0x260da1=_0x46f8e5;_0x288f24=0xc8;}else{_0x288f24=0xce;}_0x589dfb[_0x263e('0x18')](_0x288f24);return _0x589dfb[_0x263e('0x1d')](_0x263e('0x1e'),_0x30e9c7+'-'+_0x260da1+'/'+_0x46f8e5)[_0x263e('0x1f')](_0xe30be9);}return null;};}function patchUpdates(_0x2331fe){return function(_0x4dc109){try{jsonpatch[_0x263e('0x20')](_0x4dc109,_0x2331fe,!![]);}catch(_0x23feac){return BPromise[_0x263e('0x21')](_0x23feac);}return _0x4dc109['save']();};}function saveUpdates(_0x1e4bb7,_0x33ecc3){return function(_0x3d9978){if(_0x3d9978){return _0x3d9978['update'](_0x1e4bb7)[_0x263e('0x22')](function(_0x100a61){return _0x100a61;});}return null;};}function removeEntity(_0x2ff62b,_0x59927a){return function(_0x1b1fa5){if(_0x1b1fa5){return _0x1b1fa5[_0x263e('0x23')]()[_0x263e('0x22')](function(){_0x2ff62b[_0x263e('0x18')](0xcc)[_0x263e('0x19')]();});}};}function handleEntityNotFound(_0x1c2e4a,_0x12743d){return function(_0x4965c8){if(!_0x4965c8){_0x1c2e4a[_0x263e('0x24')](0x194);}return _0x4965c8;};}function handleError(_0x115665,_0x829ff3){_0x829ff3=_0x829ff3||0x1f4;return function(_0x261155){logger['error'](_0x261155['stack']);if(_0x261155[_0x263e('0x25')]){delete _0x261155['name'];}_0x115665[_0x263e('0x18')](_0x829ff3)[_0x263e('0x26')](_0x261155);};}exports[_0x263e('0x27')]=function(_0xde2e3b,_0x30c42a){var _0x4c3269={},_0x425e99={},_0x4e89da={'count':0x0,'rows':[]};var _0x51891c=_['map'](db['FaxTransferReport'][_0x263e('0x28')],function(_0x9bf48f){return{'name':_0x9bf48f['fieldName'],'type':_0x9bf48f[_0x263e('0x29')][_0x263e('0x2a')]};});_0x425e99[_0x263e('0x2b')]=_['map'](_0x51891c,'name');_0x425e99[_0x263e('0x2c')]=_[_0x263e('0x2d')](_0xde2e3b['query']);_0x425e99[_0x263e('0x2e')]=_[_0x263e('0x2f')](_0x425e99[_0x263e('0x2b')],_0x425e99[_0x263e('0x2c')]);_0x4c3269['attributes']=_['intersection'](_0x425e99['model'],qs[_0x263e('0x30')](_0xde2e3b['query']['fields']));_0x4c3269[_0x263e('0x31')]=_0x4c3269['attributes'][_0x263e('0x32')]?_0x4c3269['attributes']:_0x425e99[_0x263e('0x2b')];if(!_0xde2e3b[_0x263e('0x2c')]['hasOwnProperty'](_0x263e('0x33'))){_0x4c3269[_0x263e('0x1c')]=qs['limit'](_0xde2e3b[_0x263e('0x2c')]['limit']);_0x4c3269[_0x263e('0x1b')]=qs[_0x263e('0x1b')](_0xde2e3b[_0x263e('0x2c')]['offset']);}_0x4c3269[_0x263e('0x34')]=qs[_0x263e('0x35')](_0xde2e3b['query'][_0x263e('0x35')]);_0x4c3269['where']=qs['filters'](_['pick'](_0xde2e3b['query'],_0x425e99[_0x263e('0x2e')]));if(_0xde2e3b['query'][_0x263e('0x36')]){_0x4c3269[_0x263e('0x37')]=_['merge'](_0x4c3269[_0x263e('0x37')],{'$or':_[_0x263e('0x38')](_0x51891c,function(_0x16ea48){if(_0x16ea48[_0x263e('0x29')]!==_0x263e('0x39')){var _0x4c0e45={};_0x4c0e45[_0x16ea48[_0x263e('0x25')]]={'$like':'%'+_0xde2e3b[_0x263e('0x2c')][_0x263e('0x36')]+'%'};return _0x4c0e45;}})});}_0x4c3269=_[_0x263e('0x3a')]({},_0x4c3269,_0xde2e3b[_0x263e('0x3b')]);var _0x518a1a={'where':_0x4c3269['where']};return db[_0x263e('0x3c')]['count'](_0x518a1a)[_0x263e('0x22')](function(_0x5f036b){_0x4e89da[_0x263e('0x1a')]=_0x5f036b;if(_0xde2e3b['query'][_0x263e('0x3d')]){_0x4c3269['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x263e('0x3e')](_0x4c3269);})[_0x263e('0x22')](function(_0x33a310){_0x4e89da[_0x263e('0x3f')]=_0x33a310;return _0x4e89da;})[_0x263e('0x22')](respondWithFilteredResult(_0x30c42a,_0x4c3269))[_0x263e('0x40')](handleError(_0x30c42a,null));};exports['show']=function(_0x4423f9,_0x2a5a4c){var _0xa4424d={'raw':!![],'where':{'id':_0x4423f9[_0x263e('0x41')]['id']}},_0x427d46={};_0x427d46['model']=_[_0x263e('0x2d')](db[_0x263e('0x3c')][_0x263e('0x28')]);_0x427d46[_0x263e('0x2c')]=_['keys'](_0x4423f9[_0x263e('0x2c')]);_0x427d46[_0x263e('0x2e')]=_[_0x263e('0x2f')](_0x427d46['model'],_0x427d46[_0x263e('0x2c')]);_0xa4424d['attributes']=_[_0x263e('0x2f')](_0x427d46[_0x263e('0x2b')],qs['fields'](_0x4423f9[_0x263e('0x2c')]['fields']));_0xa4424d[_0x263e('0x31')]=_0xa4424d['attributes'][_0x263e('0x32')]?_0xa4424d[_0x263e('0x31')]:_0x427d46[_0x263e('0x2b')];if(_0x4423f9[_0x263e('0x2c')]['includeAll']){_0xa4424d['include']=[{'all':!![]}];}_0xa4424d=_[_0x263e('0x3a')]({},_0xa4424d,_0x4423f9[_0x263e('0x3b')]);return db['FaxTransferReport'][_0x263e('0x42')](_0xa4424d)['then'](handleEntityNotFound(_0x2a5a4c,null))[_0x263e('0x22')](respondWithResult(_0x2a5a4c,null))[_0x263e('0x40')](handleError(_0x2a5a4c,null));};exports[_0x263e('0x43')]=function(_0x453e5f,_0xd521f9){return db[_0x263e('0x3c')][_0x263e('0x43')](_0x453e5f['body'],{})[_0x263e('0x22')](respondWithResult(_0xd521f9,0xc9))[_0x263e('0x40')](handleError(_0xd521f9,null));};exports['update']=function(_0x447d16,_0x527b52){if(_0x447d16[_0x263e('0x44')]['id']){delete _0x447d16[_0x263e('0x44')]['id'];}return db[_0x263e('0x3c')]['find']({'where':{'id':_0x447d16['params']['id']}})[_0x263e('0x22')](handleEntityNotFound(_0x527b52,null))['then'](saveUpdates(_0x447d16[_0x263e('0x44')],null))[_0x263e('0x22')](respondWithResult(_0x527b52,null))['catch'](handleError(_0x527b52,null));};exports['destroy']=function(_0x2bf1f7,_0x48cde5){return db[_0x263e('0x3c')][_0x263e('0x42')]({'where':{'id':_0x2bf1f7[_0x263e('0x41')]['id']}})[_0x263e('0x22')](handleEntityNotFound(_0x48cde5,null))[_0x263e('0x22')](removeEntity(_0x48cde5,null))['catch'](handleError(_0x48cde5,null));};exports[_0x263e('0x45')]=function(_0x2ec266,_0x500787){return db[_0x263e('0x3c')][_0x263e('0x45')]()['then'](respondWithResult(_0x500787,null))['catch'](handleError(_0x500787,null));}; \ No newline at end of file +var _0x7d1b=['rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','apply','reject','save','then','destroy','end','error','name','send','index','map','FaxTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','html-pdf','eml-format'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7d1b,0x1a8));var _0xb7d1=function(_0xa4a176,_0x536504){_0xa4a176=_0xa4a176-0x0;var _0x5e4de2=_0x7d1b[_0xa4a176];return _0x5e4de2;};'use strict';var pdf=require(_0xb7d1('0x0'));var emlformat=require(_0xb7d1('0x1'));var rimraf=require(_0xb7d1('0x2'));var zipdir=require(_0xb7d1('0x3'));var jsonpatch=require(_0xb7d1('0x4'));var rp=require('request-promise');var moment=require(_0xb7d1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb7d1('0x6'));var util=require('util');var path=require(_0xb7d1('0x7'));var sox=require(_0xb7d1('0x8'));var csv=require(_0xb7d1('0x9'));var ejs=require(_0xb7d1('0xa'));var fs=require('fs');var _=require(_0xb7d1('0xb'));var squel=require(_0xb7d1('0xc'));var crypto=require(_0xb7d1('0xd'));var jsforce=require(_0xb7d1('0xe'));var deskjs=require(_0xb7d1('0xf'));var toCsv=require(_0xb7d1('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb7d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb7d1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7d1('0x12'))('api');var utils=require(_0xb7d1('0x13'));var config=require(_0xb7d1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3caaa1,_0x6199c5){_0x6199c5=_0x6199c5||0xcc;return function(_0x48a7c4){if(_0x48a7c4){return _0x3caaa1[_0xb7d1('0x15')](_0x6199c5);}return _0x3caaa1[_0xb7d1('0x16')](_0x6199c5)['end']();};}function respondWithResult(_0x285037,_0x4c6799){_0x4c6799=_0x4c6799||0xc8;return function(_0x2ee25a){if(_0x2ee25a){return _0x285037[_0xb7d1('0x16')](_0x4c6799)[_0xb7d1('0x17')](_0x2ee25a);}};}function respondWithFilteredResult(_0x53ceea,_0x48e8f5){return function(_0x1129be){if(_0x1129be){var _0x2576fc=_0x1129be[_0xb7d1('0x18')],_0x149467=_0x48e8f5[_0xb7d1('0x19')],_0x3e437d=_0x48e8f5['offset']+_0x48e8f5[_0xb7d1('0x1a')],_0x4ea057;if(_0x3e437d>=_0x2576fc){_0x3e437d=_0x2576fc;_0x4ea057=0xc8;}else{_0x4ea057=0xce;}_0x53ceea[_0xb7d1('0x16')](_0x4ea057);return _0x53ceea[_0xb7d1('0x1b')]('Content-Range',_0x149467+'-'+_0x3e437d+'/'+_0x2576fc)[_0xb7d1('0x17')](_0x1129be);}return null;};}function patchUpdates(_0x42acba){return function(_0x1e485f){try{jsonpatch[_0xb7d1('0x1c')](_0x1e485f,_0x42acba,!![]);}catch(_0x320e1b){return BPromise[_0xb7d1('0x1d')](_0x320e1b);}return _0x1e485f[_0xb7d1('0x1e')]();};}function saveUpdates(_0x238aeb,_0x5b2e1a){return function(_0x2a0361){if(_0x2a0361){return _0x2a0361['update'](_0x238aeb)[_0xb7d1('0x1f')](function(_0x54f3cf){return _0x54f3cf;});}return null;};}function removeEntity(_0xdd0fc0,_0xd946b2){return function(_0x10d587){if(_0x10d587){return _0x10d587[_0xb7d1('0x20')]()[_0xb7d1('0x1f')](function(){_0xdd0fc0[_0xb7d1('0x16')](0xcc)[_0xb7d1('0x21')]();});}};}function handleEntityNotFound(_0x598dda,_0x9f9c57){return function(_0xb2c9eb){if(!_0xb2c9eb){_0x598dda['sendStatus'](0x194);}return _0xb2c9eb;};}function handleError(_0x1d6cf4,_0x12ef78){_0x12ef78=_0x12ef78||0x1f4;return function(_0x5048b8){logger[_0xb7d1('0x22')](_0x5048b8['stack']);if(_0x5048b8[_0xb7d1('0x23')]){delete _0x5048b8[_0xb7d1('0x23')];}_0x1d6cf4[_0xb7d1('0x16')](_0x12ef78)[_0xb7d1('0x24')](_0x5048b8);};}exports[_0xb7d1('0x25')]=function(_0x24e0a7,_0x1ab632){var _0x7388dd={},_0xb6979d={},_0x2f4f9a={'count':0x0,'rows':[]};var _0x22ef4a=_[_0xb7d1('0x26')](db[_0xb7d1('0x27')][_0xb7d1('0x28')],function(_0x3fd88a){return{'name':_0x3fd88a['fieldName'],'type':_0x3fd88a[_0xb7d1('0x29')][_0xb7d1('0x2a')]};});_0xb6979d[_0xb7d1('0x2b')]=_[_0xb7d1('0x26')](_0x22ef4a,_0xb7d1('0x23'));_0xb6979d[_0xb7d1('0x2c')]=_[_0xb7d1('0x2d')](_0x24e0a7[_0xb7d1('0x2c')]);_0xb6979d[_0xb7d1('0x2e')]=_[_0xb7d1('0x2f')](_0xb6979d['model'],_0xb6979d['query']);_0x7388dd[_0xb7d1('0x30')]=_[_0xb7d1('0x2f')](_0xb6979d[_0xb7d1('0x2b')],qs[_0xb7d1('0x31')](_0x24e0a7[_0xb7d1('0x2c')][_0xb7d1('0x31')]));_0x7388dd[_0xb7d1('0x30')]=_0x7388dd[_0xb7d1('0x30')][_0xb7d1('0x32')]?_0x7388dd['attributes']:_0xb6979d['model'];if(!_0x24e0a7['query'][_0xb7d1('0x33')]('nolimit')){_0x7388dd['limit']=qs[_0xb7d1('0x1a')](_0x24e0a7[_0xb7d1('0x2c')][_0xb7d1('0x1a')]);_0x7388dd['offset']=qs[_0xb7d1('0x19')](_0x24e0a7[_0xb7d1('0x2c')][_0xb7d1('0x19')]);}_0x7388dd[_0xb7d1('0x34')]=qs[_0xb7d1('0x35')](_0x24e0a7[_0xb7d1('0x2c')][_0xb7d1('0x35')]);_0x7388dd['where']=qs[_0xb7d1('0x2e')](_[_0xb7d1('0x36')](_0x24e0a7[_0xb7d1('0x2c')],_0xb6979d[_0xb7d1('0x2e')]));if(_0x24e0a7[_0xb7d1('0x2c')]['filter']){_0x7388dd[_0xb7d1('0x37')]=_[_0xb7d1('0x38')](_0x7388dd[_0xb7d1('0x37')],{'$or':_[_0xb7d1('0x26')](_0x22ef4a,function(_0x382e5d){if(_0x382e5d[_0xb7d1('0x29')]!==_0xb7d1('0x39')){var _0x98baba={};_0x98baba[_0x382e5d[_0xb7d1('0x23')]]={'$like':'%'+_0x24e0a7['query'][_0xb7d1('0x3a')]+'%'};return _0x98baba;}})});}_0x7388dd=_[_0xb7d1('0x38')]({},_0x7388dd,_0x24e0a7[_0xb7d1('0x3b')]);var _0xfa5c71={'where':_0x7388dd[_0xb7d1('0x37')]};return db['FaxTransferReport'][_0xb7d1('0x18')](_0xfa5c71)[_0xb7d1('0x1f')](function(_0x28ca57){_0x2f4f9a[_0xb7d1('0x18')]=_0x28ca57;if(_0x24e0a7[_0xb7d1('0x2c')][_0xb7d1('0x3c')]){_0x7388dd[_0xb7d1('0x3d')]=[{'all':!![]}];}return db[_0xb7d1('0x27')][_0xb7d1('0x3e')](_0x7388dd);})[_0xb7d1('0x1f')](function(_0x3bf11e){_0x2f4f9a['rows']=_0x3bf11e;return _0x2f4f9a;})[_0xb7d1('0x1f')](respondWithFilteredResult(_0x1ab632,_0x7388dd))[_0xb7d1('0x3f')](handleError(_0x1ab632,null));};exports[_0xb7d1('0x40')]=function(_0x3ae501,_0xddedd){var _0x581b3c={'raw':!![],'where':{'id':_0x3ae501[_0xb7d1('0x41')]['id']}},_0x26b464={};_0x26b464[_0xb7d1('0x2b')]=_[_0xb7d1('0x2d')](db[_0xb7d1('0x27')]['rawAttributes']);_0x26b464[_0xb7d1('0x2c')]=_[_0xb7d1('0x2d')](_0x3ae501[_0xb7d1('0x2c')]);_0x26b464[_0xb7d1('0x2e')]=_[_0xb7d1('0x2f')](_0x26b464['model'],_0x26b464[_0xb7d1('0x2c')]);_0x581b3c[_0xb7d1('0x30')]=_[_0xb7d1('0x2f')](_0x26b464[_0xb7d1('0x2b')],qs[_0xb7d1('0x31')](_0x3ae501[_0xb7d1('0x2c')][_0xb7d1('0x31')]));_0x581b3c['attributes']=_0x581b3c['attributes'][_0xb7d1('0x32')]?_0x581b3c[_0xb7d1('0x30')]:_0x26b464[_0xb7d1('0x2b')];if(_0x3ae501[_0xb7d1('0x2c')][_0xb7d1('0x3c')]){_0x581b3c[_0xb7d1('0x3d')]=[{'all':!![]}];}_0x581b3c=_[_0xb7d1('0x38')]({},_0x581b3c,_0x3ae501['options']);return db[_0xb7d1('0x27')][_0xb7d1('0x42')](_0x581b3c)['then'](handleEntityNotFound(_0xddedd,null))['then'](respondWithResult(_0xddedd,null))['catch'](handleError(_0xddedd,null));};exports[_0xb7d1('0x43')]=function(_0x2b1e73,_0x3c79c9){return db[_0xb7d1('0x27')][_0xb7d1('0x43')](_0x2b1e73[_0xb7d1('0x44')],{})[_0xb7d1('0x1f')](respondWithResult(_0x3c79c9,0xc9))['catch'](handleError(_0x3c79c9,null));};exports[_0xb7d1('0x45')]=function(_0x56d251,_0x354e89){if(_0x56d251[_0xb7d1('0x44')]['id']){delete _0x56d251['body']['id'];}return db[_0xb7d1('0x27')]['find']({'where':{'id':_0x56d251['params']['id']}})[_0xb7d1('0x1f')](handleEntityNotFound(_0x354e89,null))[_0xb7d1('0x1f')](saveUpdates(_0x56d251['body'],null))[_0xb7d1('0x1f')](respondWithResult(_0x354e89,null))[_0xb7d1('0x3f')](handleError(_0x354e89,null));};exports[_0xb7d1('0x20')]=function(_0x36a2b1,_0x78355f){return db[_0xb7d1('0x27')]['find']({'where':{'id':_0x36a2b1[_0xb7d1('0x41')]['id']}})['then'](handleEntityNotFound(_0x78355f,null))[_0xb7d1('0x1f')](removeEntity(_0x78355f,null))[_0xb7d1('0x3f')](handleError(_0x78355f,null));};exports[_0xb7d1('0x46')]=function(_0x1fd76b,_0x41ebdc){return db[_0xb7d1('0x27')][_0xb7d1('0x46')]()[_0xb7d1('0x1f')](respondWithResult(_0x41ebdc,null))[_0xb7d1('0x3f')](handleError(_0x41ebdc,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index db94a6f..f7f6ded 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 _0xb1c6=['report_fax_transfer','uniqueid','lodash','../../config/logger','api','moment','path','rimraf','./faxTransferReport.attributes','exports','FaxTransferReport'];(function(_0x242760,_0x17d029){var _0x2b8b48=function(_0x2aee10){while(--_0x2aee10){_0x242760['push'](_0x242760['shift']());}};_0x2b8b48(++_0x17d029);}(_0xb1c6,0x1e6));var _0x6b1c=function(_0x4fe0f2,_0x5dbc89){_0x4fe0f2=_0x4fe0f2-0x0;var _0x982e06=_0xb1c6[_0x4fe0f2];return _0x982e06;};'use strict';var _=require(_0x6b1c('0x0'));var util=require('util');var logger=require(_0x6b1c('0x1'))(_0x6b1c('0x2'));var moment=require(_0x6b1c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b1c('0x4'));var rimraf=require(_0x6b1c('0x5'));var config=require('../../config/environment');var attributes=require(_0x6b1c('0x6'));module[_0x6b1c('0x7')]=function(_0x18beb6,_0x113d92){return _0x18beb6['define'](_0x6b1c('0x8'),attributes,{'tableName':_0x6b1c('0x9'),'paranoid':![],'indexes':[{'name':_0x6b1c('0xa'),'fields':[_0x6b1c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa825=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid'];(function(_0xb3eb5a,_0x9d4bef){var _0xd4e56b=function(_0x472e47){while(--_0x472e47){_0xb3eb5a['push'](_0xb3eb5a['shift']());}};_0xd4e56b(++_0x9d4bef);}(_0xa825,0x1ea));var _0x5a82=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa825[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x5a82('0x0'));var util=require(_0x5a82('0x1'));var logger=require(_0x5a82('0x2'))(_0x5a82('0x3'));var moment=require(_0x5a82('0x4'));var BPromise=require(_0x5a82('0x5'));var rp=require(_0x5a82('0x6'));var fs=require('fs');var path=require(_0x5a82('0x7'));var rimraf=require('rimraf');var config=require(_0x5a82('0x8'));var attributes=require(_0x5a82('0x9'));module[_0x5a82('0xa')]=function(_0x535470,_0x24bc45){return _0x535470[_0x5a82('0xb')]('FaxTransferReport',attributes,{'tableName':_0x5a82('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5a82('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 7126734..561800c 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 _0xb215=['then','info','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','client','http','request'];(function(_0x29b403,_0x442a5a){var _0xfa3af1=function(_0x517dfb){while(--_0x517dfb){_0x29b403['push'](_0x29b403['shift']());}};_0xfa3af1(++_0x442a5a);}(_0xb215,0x129));var _0x5b21=function(_0x8215c6,_0x4acf13){_0x8215c6=_0x8215c6-0x0;var _0x101ce0=_0xb215[_0x8215c6];return _0x101ce0;};'use strict';var _=require(_0x5b21('0x0'));var util=require(_0x5b21('0x1'));var moment=require('moment');var BPromise=require(_0x5b21('0x2'));var rs=require(_0x5b21('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b21('0x4'));var logger=require('../../config/logger')(_0x5b21('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5b21('0x6')][_0x5b21('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x324dab,_0x548578,_0x4c8944){return new BPromise(function(_0x1ed775,_0x380d65){return client[_0x5b21('0x8')](_0x324dab,_0x4c8944)[_0x5b21('0x9')](function(_0x601cb0){logger[_0x5b21('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x548578,'request\x20sent');logger['debug'](_0x5b21('0xb'),_0x548578,'request\x20sent',JSON[_0x5b21('0xc')](_0x601cb0));if(_0x601cb0[_0x5b21('0xd')]){if(_0x601cb0['error']['code']===0x1f4){logger[_0x5b21('0xd')](_0x5b21('0xe'),_0x548578,_0x601cb0['error']['message']);return _0x380d65(_0x601cb0[_0x5b21('0xd')]['message']);}logger[_0x5b21('0xd')](_0x5b21('0xe'),_0x548578,_0x601cb0[_0x5b21('0xd')][_0x5b21('0xf')]);return _0x1ed775(_0x601cb0[_0x5b21('0xd')][_0x5b21('0xf')]);}else{logger[_0x5b21('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x548578,'request\x20sent');_0x1ed775(_0x601cb0[_0x5b21('0x10')][_0x5b21('0xf')]);}})[_0x5b21('0x11')](function(_0x3e9f71){logger[_0x5b21('0xd')](_0x5b21('0xe'),_0x548578,_0x3e9f71);_0x380d65(_0x3e9f71);});});} \ No newline at end of file +var _0xaf81=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xaf81,0x86));var _0x1af8=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xaf81[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x1af8('0x0'));var util=require(_0x1af8('0x1'));var moment=require(_0x1af8('0x2'));var BPromise=require(_0x1af8('0x3'));var rs=require(_0x1af8('0x4'));var fs=require('fs');var Redis=require(_0x1af8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1af8('0x6'));var logger=require('../../config/logger')(_0x1af8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1af8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbc24f,_0x44ff8c,_0x4e7426){return new BPromise(function(_0xc5d032,_0x509641){return client[_0x1af8('0x9')](_0xbc24f,_0x4e7426)['then'](function(_0x58209a){logger[_0x1af8('0xa')](_0x1af8('0xb'),_0x44ff8c,_0x1af8('0xc'));logger[_0x1af8('0xd')](_0x1af8('0xe'),_0x44ff8c,_0x1af8('0xc'),JSON[_0x1af8('0xf')](_0x58209a));if(_0x58209a[_0x1af8('0x10')]){if(_0x58209a['error'][_0x1af8('0x11')]===0x1f4){logger[_0x1af8('0x10')](_0x1af8('0xb'),_0x44ff8c,_0x58209a['error'][_0x1af8('0x12')]);return _0x509641(_0x58209a[_0x1af8('0x10')][_0x1af8('0x12')]);}logger[_0x1af8('0x10')](_0x1af8('0xb'),_0x44ff8c,_0x58209a[_0x1af8('0x10')][_0x1af8('0x12')]);return _0xc5d032(_0x58209a[_0x1af8('0x10')][_0x1af8('0x12')]);}else{logger[_0x1af8('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x44ff8c,_0x1af8('0xc'));_0xc5d032(_0x58209a[_0x1af8('0x13')]['message']);}})[_0x1af8('0x14')](function(_0x91106c){logger[_0x1af8('0x10')](_0x1af8('0xb'),_0x44ff8c,_0x91106c);_0x509641(_0x91106c);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 5faaffb..9910ffb 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 _0x500a=['/describe','isAuthenticated','describe','show','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index'];(function(_0x11502e,_0x122319){var _0x527554=function(_0x376264){while(--_0x376264){_0x11502e['push'](_0x11502e['shift']());}};_0x527554(++_0x122319);}(_0x500a,0xe6));var _0xa500=function(_0x47bc06,_0x26efee){_0x47bc06=_0x47bc06-0x0;var _0x5c3c64=_0x500a[_0x47bc06];return _0x5c3c64;};'use strict';var multer=require(_0xa500('0x0'));var util=require(_0xa500('0x1'));var path=require(_0xa500('0x2'));var timeout=require(_0xa500('0x3'));var express=require(_0xa500('0x4'));var router=express[_0xa500('0x5')]();var auth=require(_0xa500('0x6'));var interaction=require(_0xa500('0x7'));var config=require(_0xa500('0x8'));var controller=require(_0xa500('0x9'));router[_0xa500('0xa')]('/',auth['isAuthenticated'](),controller[_0xa500('0xb')]);router[_0xa500('0xa')](_0xa500('0xc'),auth[_0xa500('0xd')](),controller[_0xa500('0xe')]);router[_0xa500('0xa')]('/:id',auth[_0xa500('0xd')](),controller[_0xa500('0xf')]);router[_0xa500('0x10')]('/',auth[_0xa500('0xd')](),controller[_0xa500('0x11')]);router[_0xa500('0x12')](_0xa500('0x13'),auth[_0xa500('0xd')](),controller['update']);router['delete'](_0xa500('0x13'),auth[_0xa500('0xd')](),controller[_0xa500('0x14')]);module[_0xa500('0x15')]=router; \ No newline at end of file +var _0xcda6=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0xcda6,0x98));var _0x6cda=function(_0x227669,_0x551f1f){_0x227669=_0x227669-0x0;var _0x2272e2=_0xcda6[_0x227669];return _0x2272e2;};'use strict';var multer=require(_0x6cda('0x0'));var util=require(_0x6cda('0x1'));var path=require(_0x6cda('0x2'));var timeout=require(_0x6cda('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6cda('0x4'));var interaction=require(_0x6cda('0x5'));var config=require(_0x6cda('0x6'));var controller=require(_0x6cda('0x7'));router['get']('/',auth[_0x6cda('0x8')](),controller[_0x6cda('0x9')]);router[_0x6cda('0xa')](_0x6cda('0xb'),auth[_0x6cda('0x8')](),controller[_0x6cda('0xc')]);router[_0x6cda('0xa')](_0x6cda('0xd'),auth[_0x6cda('0x8')](),controller[_0x6cda('0xe')]);router[_0x6cda('0xf')]('/',auth[_0x6cda('0x8')](),controller[_0x6cda('0x10')]);router['put']('/:id',auth[_0x6cda('0x8')](),controller[_0x6cda('0x11')]);router[_0x6cda('0x12')](_0x6cda('0xd'),auth[_0x6cda('0x8')](),controller[_0x6cda('0x13')]);module[_0x6cda('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 468d816..59e3399 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 _0xa630=['show','/:id/configurations','/:id/fields','getFields','post','create','put','update','destroy','exports','multer','util','express','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x5e9174,_0x39e774){var _0x2833df=function(_0x2515d3){while(--_0x2515d3){_0x5e9174['push'](_0x5e9174['shift']());}};_0x2833df(++_0x39e774);}(_0xa630,0xbe));var _0x0a63=function(_0x25598c,_0x9ec56c){_0x25598c=_0x25598c-0x0;var _0x57813c=_0xa630[_0x25598c];return _0x57813c;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var auth=require(_0x0a63('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a63('0x4'));var controller=require(_0x0a63('0x5'));router[_0x0a63('0x6')]('/',auth[_0x0a63('0x7')](),controller[_0x0a63('0x8')]);router['get'](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xa')]);router[_0x0a63('0x6')](_0x0a63('0xb'),auth[_0x0a63('0x7')](),controller['getConfigurations']);router[_0x0a63('0x6')](_0x0a63('0xc'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xd')]);router[_0x0a63('0xe')]('/',auth[_0x0a63('0x7')](),controller[_0x0a63('0xf')]);router[_0x0a63('0xe')](_0x0a63('0xb'),auth[_0x0a63('0x7')](),controller['addConfiguration']);router[_0x0a63('0x10')](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x11')]);router['delete'](_0x0a63('0x9'),auth['isAuthenticated'](),controller[_0x0a63('0x12')]);module[_0x0a63('0x13')]=router; \ No newline at end of file +var _0x81bd=['/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','getConfigurations'];(function(_0x49f28a,_0x580a24){var _0x3c28e0=function(_0x51029f){while(--_0x51029f){_0x49f28a['push'](_0x49f28a['shift']());}};_0x3c28e0(++_0x580a24);}(_0x81bd,0x7c));var _0xd81b=function(_0x464f8b,_0x10ae65){_0x464f8b=_0x464f8b-0x0;var _0x46f2c7=_0x81bd[_0x464f8b];return _0x46f2c7;};'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('0x9')]('/:id/configurations',auth[_0xd81b('0xc')](),controller[_0xd81b('0xd')]);router[_0xd81b('0x9')](_0xd81b('0xe'),auth[_0xd81b('0xc')](),controller[_0xd81b('0xf')]);router[_0xd81b('0x10')]('/',auth[_0xd81b('0xc')](),controller[_0xd81b('0x11')]);router[_0xd81b('0x10')](_0xd81b('0x12'),auth[_0xd81b('0xc')](),controller[_0xd81b('0x13')]);router['put'](_0xd81b('0xb'),auth['isAuthenticated'](),controller[_0xd81b('0x14')]);router[_0xd81b('0x15')]('/:id',auth[_0xd81b('0xc')](),controller['destroy']);module[_0xd81b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 2a2446d..9016c9a 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 _0x33b4=['integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x13e0d1,_0x51d081){var _0x1a1808=function(_0x1347e2){while(--_0x1347e2){_0x13e0d1['push'](_0x13e0d1['shift']());}};_0x1a1808(++_0x51d081);}(_0x33b4,0xe0));var _0x433b=function(_0xd0f0af,_0x5dc1ab){_0xd0f0af=_0xd0f0af-0x0;var _0x5333e2=_0x33b4[_0xd0f0af];return _0x5333e2;};'use strict';var Sequelize=require(_0x433b('0x0'));module[_0x433b('0x1')]={'name':{'type':Sequelize[_0x433b('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x433b('0x2')]},'remoteUri':{'type':Sequelize[_0x433b('0x2')]},'authType':{'type':Sequelize[_0x433b('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x433b('0x2')]},'consumerKey':{'type':Sequelize[_0x433b('0x2')]},'consumerSecret':{'type':Sequelize[_0x433b('0x2')]},'token':{'type':Sequelize[_0x433b('0x2')]},'tokenSecret':{'type':Sequelize[_0x433b('0x2')]},'serverUrl':{'type':Sequelize[_0x433b('0x2')]},'type':{'type':Sequelize['ENUM'](_0x433b('0x4'),_0x433b('0x5')),'defaultValue':_0x433b('0x4')}}; \ No newline at end of file +var _0x9e16=['newTab','integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x32d19a,_0x4db374){var _0x3867f2=function(_0x473234){while(--_0x473234){_0x32d19a['push'](_0x32d19a['shift']());}};_0x3867f2(++_0x4db374);}(_0x9e16,0x87));var _0x69e1=function(_0xcddac9,_0x59c7fb){_0xcddac9=_0xcddac9-0x0;var _0x39b4fd=_0x9e16[_0xcddac9];return _0x39b4fd;};'use strict';var Sequelize=require(_0x69e1('0x0'));module[_0x69e1('0x1')]={'name':{'type':Sequelize[_0x69e1('0x2')]},'description':{'type':Sequelize[_0x69e1('0x2')]},'username':{'type':Sequelize[_0x69e1('0x2')]},'remoteUri':{'type':Sequelize[_0x69e1('0x2')]},'authType':{'type':Sequelize[_0x69e1('0x3')](_0x69e1('0x4')),'defaultValue':_0x69e1('0x4')},'password':{'type':Sequelize[_0x69e1('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x69e1('0x2')]},'token':{'type':Sequelize[_0x69e1('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x69e1('0x2')]},'type':{'type':Sequelize[_0x69e1('0x3')]('integrationTab',_0x69e1('0x5')),'defaultValue':_0x69e1('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 7ecc034..5f69f79 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 _0x2e79=['status','end','count','limit','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','DeskAccount','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','show','params','keys','find','create','body','update','getConfigurations','findOne','DeskConfiguration','order','filter','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerSecret','token','tokenSecret','slice','substring','GET','%s/custom_fields','application/json','basic','Authorization','format','Basic\x20%s','base64','_embedded','entries','active','label','statusCode','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../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','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus'];(function(_0x59b108,_0x3fe4eb){var _0xaa13b1=function(_0x49efc8){while(--_0x49efc8){_0x59b108['push'](_0x59b108['shift']());}};_0xaa13b1(++_0x3fe4eb);}(_0x2e79,0x155));var _0x92e7=function(_0x4703b8,_0x18cd45){_0x4703b8=_0x4703b8-0x0;var _0x3229e8=_0x2e79[_0x4703b8];return _0x3229e8;};'use strict';var pdf=require(_0x92e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x92e7('0x1'));var zipdir=require(_0x92e7('0x2'));var jsonpatch=require(_0x92e7('0x3'));var rp=require(_0x92e7('0x4'));var moment=require(_0x92e7('0x5'));var BPromise=require(_0x92e7('0x6'));var Mustache=require(_0x92e7('0x7'));var util=require(_0x92e7('0x8'));var path=require('path');var sox=require(_0x92e7('0x9'));var csv=require(_0x92e7('0xa'));var ejs=require(_0x92e7('0xb'));var fs=require('fs');var _=require(_0x92e7('0xc'));var squel=require(_0x92e7('0xd'));var crypto=require(_0x92e7('0xe'));var jsforce=require(_0x92e7('0xf'));var deskjs=require(_0x92e7('0x10'));var toCsv=require(_0x92e7('0xa'));var querystring=require(_0x92e7('0x11'));var Papa=require('papaparse');var Redis=require(_0x92e7('0x12'));var authService=require(_0x92e7('0x13'));var qs=require(_0x92e7('0x14'));var as=require(_0x92e7('0x15'));var hardwareService=require(_0x92e7('0x16'));var logger=require(_0x92e7('0x17'))(_0x92e7('0x18'));var utils=require(_0x92e7('0x19'));var config=require(_0x92e7('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x92e7('0x1b'));var jayson=require(_0x92e7('0x1c'));var client=jayson[_0x92e7('0x1d')][_0x92e7('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x1bd9b2,_0x117025,_0x5850be){if(_0x5850be){var _0x4a6742=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a6742[_0x92e7('0x1f')](_0x117025)){return _0x1bd9b2;}else{throw new db[(_0x92e7('0x20'))][(_0x92e7('0x21'))](_0x92e7('0x22'));}}else{return _0x1bd9b2;}}function respondWithRpcPromise(_0x440f60,_0xf33d40,_0x39f5a9,_0x15403d){return new BPromise(function(_0xba16fc,_0x338a94){var _0xb6d213=_0x15403d||client;return _0xb6d213[_0x92e7('0x23')](_0x440f60,_0x39f5a9)[_0x92e7('0x24')](function(_0x423013){logger[_0x92e7('0x25')](_0x92e7('0x26'),_0xf33d40,_0x92e7('0x27'));logger['debug'](_0x92e7('0x28'),_0xf33d40,_0x92e7('0x27'),JSON[_0x92e7('0x29')](_0x423013));if(_0x423013[_0x92e7('0x2a')]){if(_0x423013[_0x92e7('0x2a')]['code']===0x1f4){logger['error'](_0x92e7('0x26'),_0xf33d40,_0x423013[_0x92e7('0x2a')][_0x92e7('0x2b')]);return _0x338a94(_0x423013[_0x92e7('0x2a')][_0x92e7('0x2b')]);}logger['error'](_0x92e7('0x26'),_0xf33d40,_0x423013['error'][_0x92e7('0x2b')]);return _0xba16fc(_0x423013[_0x92e7('0x2a')]['message']);}else{logger[_0x92e7('0x25')](_0x92e7('0x26'),_0xf33d40,_0x92e7('0x27'));_0xba16fc(_0x423013['result'][_0x92e7('0x2b')]);}})[_0x92e7('0x2c')](function(_0x303d62){logger['error'](_0x92e7('0x26'),_0xf33d40,_0x303d62);_0x338a94(_0x303d62);});});}function respondWithStatusCode(_0x265e95,_0x4c807b){_0x4c807b=_0x4c807b||0xcc;return function(_0x540c5e){if(_0x540c5e){return _0x265e95[_0x92e7('0x2d')](_0x4c807b);}return _0x265e95[_0x92e7('0x2e')](_0x4c807b)[_0x92e7('0x2f')]();};}function respondWithResult(_0x14a86a,_0x356177){_0x356177=_0x356177||0xc8;return function(_0x4d8fdf){if(_0x4d8fdf){return _0x14a86a[_0x92e7('0x2e')](_0x356177)['json'](_0x4d8fdf);}};}function respondWithFilteredResult(_0x19f913,_0x3e578e){return function(_0x18d47e){if(_0x18d47e){var _0x56ef77=_0x18d47e[_0x92e7('0x30')],_0x11adc9=_0x3e578e['offset'],_0x50cacf=_0x3e578e['offset']+_0x3e578e[_0x92e7('0x31')],_0x300e4e;if(_0x50cacf>=_0x56ef77){_0x50cacf=_0x56ef77;_0x300e4e=0xc8;}else{_0x300e4e=0xce;}_0x19f913[_0x92e7('0x2e')](_0x300e4e);return _0x19f913[_0x92e7('0x32')](_0x92e7('0x33'),_0x11adc9+'-'+_0x50cacf+'/'+_0x56ef77)[_0x92e7('0x34')](_0x18d47e);}return null;};}function patchUpdates(_0x4a8c2e){return function(_0x47df14){try{jsonpatch[_0x92e7('0x35')](_0x47df14,_0x4a8c2e,!![]);}catch(_0x4ea978){return BPromise[_0x92e7('0x36')](_0x4ea978);}return _0x47df14[_0x92e7('0x37')]();};}function saveUpdates(_0x1bcc22,_0x806afe){return function(_0xff8325){if(_0xff8325){return _0xff8325['update'](_0x1bcc22)[_0x92e7('0x24')](function(_0x1fc51e){return _0x1fc51e;});}return null;};}function removeEntity(_0x3a7cfa,_0x5f2539){return function(_0x2529dc){if(_0x2529dc){return _0x2529dc[_0x92e7('0x38')]()['then'](function(){_0x3a7cfa[_0x92e7('0x2e')](0xcc)[_0x92e7('0x2f')]();});}};}function handleEntityNotFound(_0x4e14d5,_0x1a91b1){return function(_0x3bd8e4){if(!_0x3bd8e4){_0x4e14d5[_0x92e7('0x2d')](0x194);}return _0x3bd8e4;};}function handleError(_0x477962,_0xa0ac42){_0xa0ac42=_0xa0ac42||0x1f4;return function(_0x6a68a9){logger[_0x92e7('0x2a')](_0x6a68a9[_0x92e7('0x39')]);if(_0x6a68a9[_0x92e7('0x3a')]){delete _0x6a68a9[_0x92e7('0x3a')];}_0x477962['status'](_0xa0ac42)[_0x92e7('0x3b')](_0x6a68a9);};}exports['index']=function(_0x5690a1,_0x290966){var _0x3d4517={},_0x5784f6={},_0x3641c0={'count':0x0,'rows':[]};var _0x3d558b=_['map'](db[_0x92e7('0x3c')][_0x92e7('0x3d')],function(_0x559b6b){return{'name':_0x559b6b[_0x92e7('0x3e')],'type':_0x559b6b[_0x92e7('0x3f')][_0x92e7('0x40')]};});_0x5784f6[_0x92e7('0x41')]=_[_0x92e7('0x42')](_0x3d558b,_0x92e7('0x3a'));_0x5784f6['query']=_['keys'](_0x5690a1['query']);_0x5784f6[_0x92e7('0x43')]=_[_0x92e7('0x44')](_0x5784f6[_0x92e7('0x41')],_0x5784f6[_0x92e7('0x45')]);_0x3d4517[_0x92e7('0x46')]=_[_0x92e7('0x44')](_0x5784f6[_0x92e7('0x41')],qs['fields'](_0x5690a1[_0x92e7('0x45')][_0x92e7('0x47')]));_0x3d4517[_0x92e7('0x46')]=_0x3d4517[_0x92e7('0x46')][_0x92e7('0x48')]?_0x3d4517[_0x92e7('0x46')]:_0x5784f6[_0x92e7('0x41')];if(!_0x5690a1[_0x92e7('0x45')][_0x92e7('0x49')](_0x92e7('0x4a'))){_0x3d4517['limit']=qs[_0x92e7('0x31')](_0x5690a1[_0x92e7('0x45')][_0x92e7('0x31')]);_0x3d4517[_0x92e7('0x4b')]=qs[_0x92e7('0x4b')](_0x5690a1[_0x92e7('0x45')][_0x92e7('0x4b')]);}_0x3d4517['order']=qs[_0x92e7('0x4c')](_0x5690a1[_0x92e7('0x45')][_0x92e7('0x4c')]);_0x3d4517[_0x92e7('0x4d')]=qs[_0x92e7('0x43')](_[_0x92e7('0x4e')](_0x5690a1[_0x92e7('0x45')],_0x5784f6[_0x92e7('0x43')]));if(_0x5690a1[_0x92e7('0x45')]['filter']){_0x3d4517[_0x92e7('0x4d')]=_['merge'](_0x3d4517['where'],{'$or':_[_0x92e7('0x42')](_0x3d558b,function(_0x165847){if(_0x165847[_0x92e7('0x3f')]!==_0x92e7('0x4f')){var _0xe7e8ea={};_0xe7e8ea[_0x165847['name']]={'$like':'%'+_0x5690a1['query']['filter']+'%'};return _0xe7e8ea;}})});}_0x3d4517=_[_0x92e7('0x50')]({},_0x3d4517,_0x5690a1[_0x92e7('0x51')]);var _0x5f213c={'where':_0x3d4517[_0x92e7('0x4d')]};return db['DeskAccount'][_0x92e7('0x30')](_0x5f213c)[_0x92e7('0x24')](function(_0x3f8618){_0x3641c0[_0x92e7('0x30')]=_0x3f8618;if(_0x5690a1[_0x92e7('0x45')][_0x92e7('0x52')]){_0x3d4517[_0x92e7('0x53')]=[{'all':!![]}];}return db[_0x92e7('0x3c')][_0x92e7('0x54')](_0x3d4517);})['then'](function(_0x4a16f2){_0x3641c0['rows']=_0x4a16f2;return _0x3641c0;})['then'](respondWithFilteredResult(_0x290966,_0x3d4517))['catch'](handleError(_0x290966,null));};exports[_0x92e7('0x55')]=function(_0x56369f,_0x2288c2){var _0x57ab56={'raw':![],'where':{'id':_0x56369f[_0x92e7('0x56')]['id']}},_0x418c26={};_0x418c26[_0x92e7('0x41')]=_[_0x92e7('0x57')](db[_0x92e7('0x3c')][_0x92e7('0x3d')]);_0x418c26['query']=_[_0x92e7('0x57')](_0x56369f[_0x92e7('0x45')]);_0x418c26[_0x92e7('0x43')]=_[_0x92e7('0x44')](_0x418c26[_0x92e7('0x41')],_0x418c26[_0x92e7('0x45')]);_0x57ab56[_0x92e7('0x46')]=_[_0x92e7('0x44')](_0x418c26['model'],qs[_0x92e7('0x47')](_0x56369f['query']['fields']));_0x57ab56['attributes']=_0x57ab56[_0x92e7('0x46')][_0x92e7('0x48')]?_0x57ab56['attributes']:_0x418c26[_0x92e7('0x41')];if(_0x56369f[_0x92e7('0x45')][_0x92e7('0x52')]){_0x57ab56[_0x92e7('0x53')]=[{'all':!![]}];}_0x57ab56=_['merge']({},_0x57ab56,_0x56369f['options']);return db[_0x92e7('0x3c')][_0x92e7('0x58')](_0x57ab56)[_0x92e7('0x24')](handleEntityNotFound(_0x2288c2,null))[_0x92e7('0x24')](respondWithResult(_0x2288c2,null))['catch'](handleError(_0x2288c2,null));};exports['create']=function(_0x2b6051,_0x5b08bd){return db[_0x92e7('0x3c')][_0x92e7('0x59')](_0x2b6051[_0x92e7('0x5a')],{})[_0x92e7('0x24')](respondWithResult(_0x5b08bd,0xc9))[_0x92e7('0x2c')](handleError(_0x5b08bd,null));};exports[_0x92e7('0x5b')]=function(_0x5aa275,_0x2e11f4){if(_0x5aa275[_0x92e7('0x5a')]['id']){delete _0x5aa275['body']['id'];}return db[_0x92e7('0x3c')][_0x92e7('0x58')]({'where':{'id':_0x5aa275[_0x92e7('0x56')]['id']}})['then'](handleEntityNotFound(_0x2e11f4,null))[_0x92e7('0x24')](saveUpdates(_0x5aa275['body'],null))[_0x92e7('0x24')](respondWithResult(_0x2e11f4,null))[_0x92e7('0x2c')](handleError(_0x2e11f4,null));};exports[_0x92e7('0x38')]=function(_0x13ad02,_0x2d449a){return db[_0x92e7('0x3c')][_0x92e7('0x58')]({'where':{'id':_0x13ad02[_0x92e7('0x56')]['id']}})[_0x92e7('0x24')](handleEntityNotFound(_0x2d449a,null))[_0x92e7('0x24')](removeEntity(_0x2d449a,null))[_0x92e7('0x2c')](handleError(_0x2d449a,null));};exports[_0x92e7('0x5c')]=function(_0x3bf76d,_0x5227a6,_0x5335e8){var _0x4fd432={};var _0x4fe42b={};var _0x27b273;var _0x3be320;return db[_0x92e7('0x3c')][_0x92e7('0x5d')]({'where':{'id':_0x3bf76d[_0x92e7('0x56')]['id']}})['then'](handleEntityNotFound(_0x5227a6,null))[_0x92e7('0x24')](function(_0x541597){if(_0x541597){_0x27b273=_0x541597;_0x4fe42b['model']=_[_0x92e7('0x57')](db[_0x92e7('0x5e')]['rawAttributes']);_0x4fe42b[_0x92e7('0x45')]=_['keys'](_0x3bf76d[_0x92e7('0x45')]);_0x4fe42b[_0x92e7('0x43')]=_[_0x92e7('0x44')](_0x4fe42b[_0x92e7('0x41')],_0x4fe42b[_0x92e7('0x45')]);_0x4fd432[_0x92e7('0x46')]=_[_0x92e7('0x44')](_0x4fe42b['model'],qs[_0x92e7('0x47')](_0x3bf76d[_0x92e7('0x45')][_0x92e7('0x47')]));_0x4fd432[_0x92e7('0x46')]=_0x4fd432[_0x92e7('0x46')][_0x92e7('0x48')]?_0x4fd432[_0x92e7('0x46')]:_0x4fe42b[_0x92e7('0x41')];_0x4fd432[_0x92e7('0x5f')]=qs['sort'](_0x3bf76d[_0x92e7('0x45')][_0x92e7('0x4c')]);_0x4fd432['where']=qs[_0x92e7('0x43')](_[_0x92e7('0x4e')](_0x3bf76d['query'],_0x4fe42b[_0x92e7('0x43')]));if(_0x3bf76d[_0x92e7('0x45')][_0x92e7('0x60')]){_0x4fd432['where']=_[_0x92e7('0x50')](_0x4fd432[_0x92e7('0x4d')],{'$or':_[_0x92e7('0x42')](_0x4fd432[_0x92e7('0x46')],function(_0xb0f7f8){var _0x1bb78c={};_0x1bb78c[_0xb0f7f8]={'$like':'%'+_0x3bf76d['query'][_0x92e7('0x60')]+'%'};return _0x1bb78c;})});}_0x4fd432=_[_0x92e7('0x50')]({},_0x4fd432,_0x3bf76d['options']);return _0x27b273['getConfigurations'](_0x4fd432);}})[_0x92e7('0x24')](function(_0x49ff95){if(_0x49ff95){_0x3be320=_0x49ff95['length'];if(!_0x3bf76d['query'][_0x92e7('0x49')](_0x92e7('0x4a'))){_0x4fd432['limit']=qs[_0x92e7('0x31')](_0x3bf76d[_0x92e7('0x45')][_0x92e7('0x31')]);_0x4fd432[_0x92e7('0x4b')]=qs[_0x92e7('0x4b')](_0x3bf76d[_0x92e7('0x45')][_0x92e7('0x4b')]);}return _0x27b273['getConfigurations'](_0x4fd432);}})[_0x92e7('0x24')](function(_0x15d7bd){if(_0x15d7bd){return _0x15d7bd?{'count':_0x3be320,'rows':_0x15d7bd}:null;}})[_0x92e7('0x24')](respondWithResult(_0x5227a6,null))['catch'](handleError(_0x5227a6,null));};exports[_0x92e7('0x61')]=function(_0x4bef56,_0x2898ca,_0x4fe499){if(_0x4bef56[_0x92e7('0x5a')]['id']){delete _0x4bef56[_0x92e7('0x5a')]['id'];}return db['DeskAccount'][_0x92e7('0x5d')]({'where':{'id':_0x4bef56[_0x92e7('0x56')]['id']}})['then'](handleEntityNotFound(_0x2898ca,null))[_0x92e7('0x24')](function(_0x3442ba){if(_0x3442ba){_0x4bef56[_0x92e7('0x5a')][_0x92e7('0x62')]=_0x3442ba['id'];_0x4bef56[_0x92e7('0x5a')][_0x92e7('0x63')]=integrations['getSubjects'](_0x4bef56[_0x92e7('0x5a')][_0x92e7('0x64')],_0x4bef56[_0x92e7('0x5a')][_0x92e7('0x3f')]);_0x4bef56[_0x92e7('0x5a')][_0x92e7('0x65')]=integrations[_0x92e7('0x66')](_0x4bef56[_0x92e7('0x5a')][_0x92e7('0x64')],_0x4bef56[_0x92e7('0x5a')][_0x92e7('0x3f')]);return db['DeskConfiguration'][_0x92e7('0x59')](_0x4bef56[_0x92e7('0x5a')],{'include':[{'model':db[_0x92e7('0x67')],'as':_0x92e7('0x63')},{'model':db[_0x92e7('0x67')],'as':_0x92e7('0x65')}]});}return null;})[_0x92e7('0x24')](respondWithResult(_0x2898ca,null))[_0x92e7('0x2c')](handleError(_0x2898ca,null));};exports[_0x92e7('0x68')]=function(_0x4695f8,_0x5779aa,_0x7c414f){var _0x52aeb8=[{'name':_0x92e7('0x69'),'label':_0x92e7('0x69'),'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 _0x1070fc='';return db['DeskAccount'][_0x92e7('0x5d')]({'where':{'id':_0x4695f8[_0x92e7('0x56')]['id']},'attributes':['id',_0x92e7('0x6a'),_0x92e7('0x6b'),_0x92e7('0x6c'),_0x92e7('0x6d'),'consumerKey',_0x92e7('0x6e'),_0x92e7('0x6f'),_0x92e7('0x70')]})[_0x92e7('0x24')](handleEntityNotFound(_0x5779aa,null))[_0x92e7('0x24')](function(_0x180a63){if(_0x180a63){_0x1070fc=_0x180a63[_0x92e7('0x6a')];var _0x101209=_0x1070fc[_0x92e7('0x71')](-0x1);if(_0x101209==='/'){_0x1070fc=_0x1070fc[_0x92e7('0x72')](0x0,_0x1070fc['lastIndexOf'](_0x101209));}var _0x33025c={'method':_0x92e7('0x73'),'uri':util['format'](_0x92e7('0x74'),_0x1070fc),'headers':{'Content-Type':_0x92e7('0x75'),'Accept':_0x92e7('0x75')},'json':!![]};if(_0x180a63['authType']===_0x92e7('0x76')){_0x33025c['headers'][_0x92e7('0x77')]=util[_0x92e7('0x78')](_0x92e7('0x79'),new Buffer(util[_0x92e7('0x78')]('%s:%s',_0x180a63['username'],_0x180a63[_0x92e7('0x6d')]))['toString'](_0x92e7('0x7a')));}return rp(_0x33025c)[_0x92e7('0x24')](function(_0x21b62e){return _0x52aeb8['concat'](_[_0x92e7('0x42')](_0x21b62e[_0x92e7('0x7b')][_0x92e7('0x7c')],function(_0x5c7e73){return{'id':_0x5c7e73[_0x92e7('0x3a')],'name':_0x5c7e73[_0x92e7('0x3a')],'type':_0x5c7e73[_0x92e7('0x3f')],'active':_0x5c7e73[_0x92e7('0x7d')],'label':_0x5c7e73[_0x92e7('0x7e')],'custom':!![]};}));});}})[_0x92e7('0x24')](function(_0x41d1d7){return{'count':_0x41d1d7[_0x92e7('0x48')],'rows':_0x41d1d7};})[_0x92e7('0x24')](respondWithResult(_0x5779aa,null))[_0x92e7('0x2c')](function(_0x3f3ad5){var _0x2c51ae=_0x4695f8['query'][_0x92e7('0x1f')]?0x1f4:_0x3f3ad5[_0x92e7('0x7f')]||0x1f4;logger[_0x92e7('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x92e7('0x68'),_0x2c51ae,JSON[_0x92e7('0x29')](_0x3f3ad5));delete _0x3f3ad5[_0x92e7('0x3a')];if(_0x2c51ae===0x191){_0x2c51ae=0x190;}_0x5779aa[_0x92e7('0x2e')](_0x2c51ae)[_0x92e7('0x3b')](_0x4695f8[_0x92e7('0x45')][_0x92e7('0x1f')]?{'message':_0x92e7('0x80'),'statusCode':_0x3f3ad5['statusCode']}:_0x3f3ad5);});}; \ No newline at end of file +var _0x09e3=['pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','slice','substring','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','base64','concat','entries','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','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','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','sendStatus','stack','name','map','DeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','find','create','body','update','getConfigurations','DeskConfiguration','order'];(function(_0x1de59b,_0x46bc39){var _0x3977ad=function(_0x4f2d7b){while(--_0x4f2d7b){_0x1de59b['push'](_0x1de59b['shift']());}};_0x3977ad(++_0x46bc39);}(_0x09e3,0x188));var _0x309e=function(_0x2f0d77,_0x5ce6fa){_0x2f0d77=_0x2f0d77-0x0;var _0x3d3ef7=_0x09e3[_0x2f0d77];return _0x3d3ef7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x309e('0x0'));var rimraf=require(_0x309e('0x1'));var zipdir=require(_0x309e('0x2'));var jsonpatch=require(_0x309e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x309e('0x4'));var Mustache=require(_0x309e('0x5'));var util=require(_0x309e('0x6'));var path=require('path');var sox=require(_0x309e('0x7'));var csv=require(_0x309e('0x8'));var ejs=require(_0x309e('0x9'));var fs=require('fs');var _=require(_0x309e('0xa'));var squel=require('squel');var crypto=require(_0x309e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x309e('0xc'));var toCsv=require(_0x309e('0x8'));var querystring=require('querystring');var Papa=require(_0x309e('0xd'));var Redis=require(_0x309e('0xe'));var authService=require(_0x309e('0xf'));var qs=require(_0x309e('0x10'));var as=require(_0x309e('0x11'));var hardwareService=require(_0x309e('0x12'));var logger=require(_0x309e('0x13'))('api');var utils=require(_0x309e('0x14'));var config=require(_0x309e('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x309e('0x16'));var jayson=require('jayson/promise');var client=jayson[_0x309e('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x535947,_0x30c66f,_0x3f79d3){if(_0x3f79d3){var _0x5d01d3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d01d3[_0x309e('0x18')](_0x30c66f)){return _0x535947;}else{throw new db[(_0x309e('0x19'))][(_0x309e('0x1a'))](_0x309e('0x1b'));}}else{return _0x535947;}}function respondWithRpcPromise(_0x49741f,_0x3c8b8f,_0x104d96,_0x51d7a8){return new BPromise(function(_0xef0d48,_0x37605d){var _0x2f17ce=_0x51d7a8||client;return _0x2f17ce['request'](_0x49741f,_0x104d96)['then'](function(_0x1fa9a6){logger[_0x309e('0x1c')]('DeskAccount,\x20%s,\x20%s',_0x3c8b8f,_0x309e('0x1d'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x3c8b8f,_0x309e('0x1d'),JSON[_0x309e('0x1e')](_0x1fa9a6));if(_0x1fa9a6[_0x309e('0x1f')]){if(_0x1fa9a6[_0x309e('0x1f')][_0x309e('0x20')]===0x1f4){logger['error'](_0x309e('0x21'),_0x3c8b8f,_0x1fa9a6[_0x309e('0x1f')][_0x309e('0x22')]);return _0x37605d(_0x1fa9a6[_0x309e('0x1f')]['message']);}logger[_0x309e('0x1f')](_0x309e('0x21'),_0x3c8b8f,_0x1fa9a6[_0x309e('0x1f')][_0x309e('0x22')]);return _0xef0d48(_0x1fa9a6['error'][_0x309e('0x22')]);}else{logger[_0x309e('0x1c')]('DeskAccount,\x20%s,\x20%s',_0x3c8b8f,_0x309e('0x1d'));_0xef0d48(_0x1fa9a6[_0x309e('0x23')][_0x309e('0x22')]);}})[_0x309e('0x24')](function(_0x4395e2){logger[_0x309e('0x1f')]('DeskAccount,\x20%s,\x20%s',_0x3c8b8f,_0x4395e2);_0x37605d(_0x4395e2);});});}function respondWithStatusCode(_0x2c52fd,_0x380063){_0x380063=_0x380063||0xcc;return function(_0x190fcb){if(_0x190fcb){return _0x2c52fd['sendStatus'](_0x380063);}return _0x2c52fd[_0x309e('0x25')](_0x380063)[_0x309e('0x26')]();};}function respondWithResult(_0x4c44d3,_0x1a8c5e){_0x1a8c5e=_0x1a8c5e||0xc8;return function(_0x3f70f6){if(_0x3f70f6){return _0x4c44d3['status'](_0x1a8c5e)[_0x309e('0x27')](_0x3f70f6);}};}function respondWithFilteredResult(_0x214036,_0x56d8c2){return function(_0x21daa2){if(_0x21daa2){var _0x10bd6e=_0x21daa2[_0x309e('0x28')],_0x2c199e=_0x56d8c2[_0x309e('0x29')],_0x641095=_0x56d8c2[_0x309e('0x29')]+_0x56d8c2[_0x309e('0x2a')],_0x245fb5;if(_0x641095>=_0x10bd6e){_0x641095=_0x10bd6e;_0x245fb5=0xc8;}else{_0x245fb5=0xce;}_0x214036[_0x309e('0x25')](_0x245fb5);return _0x214036[_0x309e('0x2b')](_0x309e('0x2c'),_0x2c199e+'-'+_0x641095+'/'+_0x10bd6e)[_0x309e('0x27')](_0x21daa2);}return null;};}function patchUpdates(_0x2b4efb){return function(_0x106be2){try{jsonpatch[_0x309e('0x2d')](_0x106be2,_0x2b4efb,!![]);}catch(_0x4f9cbe){return BPromise[_0x309e('0x2e')](_0x4f9cbe);}return _0x106be2['save']();};}function saveUpdates(_0x328c9b,_0x3b72e7){return function(_0x419fb5){if(_0x419fb5){return _0x419fb5['update'](_0x328c9b)[_0x309e('0x2f')](function(_0x39ea8f){return _0x39ea8f;});}return null;};}function removeEntity(_0x9c28,_0x4092b0){return function(_0x33fc82){if(_0x33fc82){return _0x33fc82['destroy']()[_0x309e('0x2f')](function(){_0x9c28[_0x309e('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c3a6d,_0x4c1916){return function(_0x3774e7){if(!_0x3774e7){_0x2c3a6d[_0x309e('0x30')](0x194);}return _0x3774e7;};}function handleError(_0x82dd3e,_0x47635c){_0x47635c=_0x47635c||0x1f4;return function(_0x1fa1f8){logger[_0x309e('0x1f')](_0x1fa1f8[_0x309e('0x31')]);if(_0x1fa1f8[_0x309e('0x32')]){delete _0x1fa1f8[_0x309e('0x32')];}_0x82dd3e[_0x309e('0x25')](_0x47635c)['send'](_0x1fa1f8);};}exports['index']=function(_0xa8421,_0x56611f){var _0x2a68e4={},_0x3f8c92={},_0xb3cbb1={'count':0x0,'rows':[]};var _0x1d2766=_[_0x309e('0x33')](db[_0x309e('0x34')][_0x309e('0x35')],function(_0x3e859a){return{'name':_0x3e859a['fieldName'],'type':_0x3e859a[_0x309e('0x36')][_0x309e('0x37')]};});_0x3f8c92[_0x309e('0x38')]=_[_0x309e('0x33')](_0x1d2766,'name');_0x3f8c92[_0x309e('0x39')]=_[_0x309e('0x3a')](_0xa8421[_0x309e('0x39')]);_0x3f8c92[_0x309e('0x3b')]=_[_0x309e('0x3c')](_0x3f8c92[_0x309e('0x38')],_0x3f8c92['query']);_0x2a68e4['attributes']=_[_0x309e('0x3c')](_0x3f8c92[_0x309e('0x38')],qs[_0x309e('0x3d')](_0xa8421[_0x309e('0x39')][_0x309e('0x3d')]));_0x2a68e4[_0x309e('0x3e')]=_0x2a68e4[_0x309e('0x3e')][_0x309e('0x3f')]?_0x2a68e4['attributes']:_0x3f8c92[_0x309e('0x38')];if(!_0xa8421[_0x309e('0x39')][_0x309e('0x40')](_0x309e('0x41'))){_0x2a68e4[_0x309e('0x2a')]=qs[_0x309e('0x2a')](_0xa8421[_0x309e('0x39')]['limit']);_0x2a68e4[_0x309e('0x29')]=qs[_0x309e('0x29')](_0xa8421[_0x309e('0x39')][_0x309e('0x29')]);}_0x2a68e4['order']=qs[_0x309e('0x42')](_0xa8421[_0x309e('0x39')]['sort']);_0x2a68e4[_0x309e('0x43')]=qs[_0x309e('0x3b')](_['pick'](_0xa8421[_0x309e('0x39')],_0x3f8c92[_0x309e('0x3b')]));if(_0xa8421[_0x309e('0x39')][_0x309e('0x44')]){_0x2a68e4[_0x309e('0x43')]=_[_0x309e('0x45')](_0x2a68e4[_0x309e('0x43')],{'$or':_[_0x309e('0x33')](_0x1d2766,function(_0x364722){if(_0x364722['type']!==_0x309e('0x46')){var _0x398102={};_0x398102[_0x364722['name']]={'$like':'%'+_0xa8421[_0x309e('0x39')][_0x309e('0x44')]+'%'};return _0x398102;}})});}_0x2a68e4=_[_0x309e('0x45')]({},_0x2a68e4,_0xa8421[_0x309e('0x47')]);var _0x2adb34={'where':_0x2a68e4[_0x309e('0x43')]};return db[_0x309e('0x34')]['count'](_0x2adb34)[_0x309e('0x2f')](function(_0x4e563e){_0xb3cbb1[_0x309e('0x28')]=_0x4e563e;if(_0xa8421[_0x309e('0x39')][_0x309e('0x48')]){_0x2a68e4['include']=[{'all':!![]}];}return db[_0x309e('0x34')][_0x309e('0x49')](_0x2a68e4);})[_0x309e('0x2f')](function(_0x555a4e){_0xb3cbb1['rows']=_0x555a4e;return _0xb3cbb1;})[_0x309e('0x2f')](respondWithFilteredResult(_0x56611f,_0x2a68e4))['catch'](handleError(_0x56611f,null));};exports[_0x309e('0x4a')]=function(_0x53d4a2,_0x2e2811){var _0x242304={'raw':![],'where':{'id':_0x53d4a2[_0x309e('0x4b')]['id']}},_0xaeaf03={};_0xaeaf03[_0x309e('0x38')]=_[_0x309e('0x3a')](db[_0x309e('0x34')]['rawAttributes']);_0xaeaf03[_0x309e('0x39')]=_[_0x309e('0x3a')](_0x53d4a2[_0x309e('0x39')]);_0xaeaf03[_0x309e('0x3b')]=_[_0x309e('0x3c')](_0xaeaf03[_0x309e('0x38')],_0xaeaf03[_0x309e('0x39')]);_0x242304['attributes']=_[_0x309e('0x3c')](_0xaeaf03[_0x309e('0x38')],qs[_0x309e('0x3d')](_0x53d4a2[_0x309e('0x39')][_0x309e('0x3d')]));_0x242304[_0x309e('0x3e')]=_0x242304[_0x309e('0x3e')]['length']?_0x242304[_0x309e('0x3e')]:_0xaeaf03[_0x309e('0x38')];if(_0x53d4a2[_0x309e('0x39')][_0x309e('0x48')]){_0x242304[_0x309e('0x4c')]=[{'all':!![]}];}_0x242304=_[_0x309e('0x45')]({},_0x242304,_0x53d4a2[_0x309e('0x47')]);return db[_0x309e('0x34')][_0x309e('0x4d')](_0x242304)[_0x309e('0x2f')](handleEntityNotFound(_0x2e2811,null))[_0x309e('0x2f')](respondWithResult(_0x2e2811,null))[_0x309e('0x24')](handleError(_0x2e2811,null));};exports[_0x309e('0x4e')]=function(_0x5bd053,_0x61b801){return db['DeskAccount']['create'](_0x5bd053[_0x309e('0x4f')],{})[_0x309e('0x2f')](respondWithResult(_0x61b801,0xc9))[_0x309e('0x24')](handleError(_0x61b801,null));};exports[_0x309e('0x50')]=function(_0xd15412,_0x5392df){if(_0xd15412[_0x309e('0x4f')]['id']){delete _0xd15412[_0x309e('0x4f')]['id'];}return db[_0x309e('0x34')][_0x309e('0x4d')]({'where':{'id':_0xd15412[_0x309e('0x4b')]['id']}})[_0x309e('0x2f')](handleEntityNotFound(_0x5392df,null))['then'](saveUpdates(_0xd15412[_0x309e('0x4f')],null))[_0x309e('0x2f')](respondWithResult(_0x5392df,null))[_0x309e('0x24')](handleError(_0x5392df,null));};exports['destroy']=function(_0x5d46b3,_0xe662c1){return db[_0x309e('0x34')][_0x309e('0x4d')]({'where':{'id':_0x5d46b3[_0x309e('0x4b')]['id']}})[_0x309e('0x2f')](handleEntityNotFound(_0xe662c1,null))[_0x309e('0x2f')](removeEntity(_0xe662c1,null))[_0x309e('0x24')](handleError(_0xe662c1,null));};exports[_0x309e('0x51')]=function(_0x151ade,_0x48ad98,_0xb31869){var _0x420dc8={};var _0x5ce723={};var _0x5bf20f;var _0x55552f;return db[_0x309e('0x34')]['findOne']({'where':{'id':_0x151ade[_0x309e('0x4b')]['id']}})[_0x309e('0x2f')](handleEntityNotFound(_0x48ad98,null))[_0x309e('0x2f')](function(_0x38b6c5){if(_0x38b6c5){_0x5bf20f=_0x38b6c5;_0x5ce723['model']=_['keys'](db[_0x309e('0x52')][_0x309e('0x35')]);_0x5ce723['query']=_[_0x309e('0x3a')](_0x151ade[_0x309e('0x39')]);_0x5ce723[_0x309e('0x3b')]=_[_0x309e('0x3c')](_0x5ce723[_0x309e('0x38')],_0x5ce723['query']);_0x420dc8[_0x309e('0x3e')]=_['intersection'](_0x5ce723[_0x309e('0x38')],qs[_0x309e('0x3d')](_0x151ade['query'][_0x309e('0x3d')]));_0x420dc8['attributes']=_0x420dc8[_0x309e('0x3e')][_0x309e('0x3f')]?_0x420dc8['attributes']:_0x5ce723[_0x309e('0x38')];_0x420dc8[_0x309e('0x53')]=qs['sort'](_0x151ade[_0x309e('0x39')][_0x309e('0x42')]);_0x420dc8[_0x309e('0x43')]=qs[_0x309e('0x3b')](_[_0x309e('0x54')](_0x151ade[_0x309e('0x39')],_0x5ce723[_0x309e('0x3b')]));if(_0x151ade[_0x309e('0x39')][_0x309e('0x44')]){_0x420dc8[_0x309e('0x43')]=_['merge'](_0x420dc8['where'],{'$or':_[_0x309e('0x33')](_0x420dc8['attributes'],function(_0x5b732a){var _0x108a6e={};_0x108a6e[_0x5b732a]={'$like':'%'+_0x151ade[_0x309e('0x39')]['filter']+'%'};return _0x108a6e;})});}_0x420dc8=_[_0x309e('0x45')]({},_0x420dc8,_0x151ade['options']);return _0x5bf20f['getConfigurations'](_0x420dc8);}})['then'](function(_0x4cd9b7){if(_0x4cd9b7){_0x55552f=_0x4cd9b7[_0x309e('0x3f')];if(!_0x151ade['query']['hasOwnProperty'](_0x309e('0x41'))){_0x420dc8['limit']=qs[_0x309e('0x2a')](_0x151ade[_0x309e('0x39')][_0x309e('0x2a')]);_0x420dc8[_0x309e('0x29')]=qs['offset'](_0x151ade['query'][_0x309e('0x29')]);}return _0x5bf20f['getConfigurations'](_0x420dc8);}})[_0x309e('0x2f')](function(_0x5283da){if(_0x5283da){return _0x5283da?{'count':_0x55552f,'rows':_0x5283da}:null;}})[_0x309e('0x2f')](respondWithResult(_0x48ad98,null))[_0x309e('0x24')](handleError(_0x48ad98,null));};exports[_0x309e('0x55')]=function(_0x201129,_0x48db85,_0x5e0ed9){if(_0x201129[_0x309e('0x4f')]['id']){delete _0x201129[_0x309e('0x4f')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x201129[_0x309e('0x4b')]['id']}})[_0x309e('0x2f')](handleEntityNotFound(_0x48db85,null))[_0x309e('0x2f')](function(_0x4a5ab5){if(_0x4a5ab5){_0x201129['body'][_0x309e('0x56')]=_0x4a5ab5['id'];_0x201129[_0x309e('0x4f')]['Subjects']=integrations[_0x309e('0x57')](_0x201129['body'][_0x309e('0x58')],_0x201129[_0x309e('0x4f')][_0x309e('0x36')]);_0x201129[_0x309e('0x4f')][_0x309e('0x59')]=integrations[_0x309e('0x5a')](_0x201129['body'][_0x309e('0x58')],_0x201129[_0x309e('0x4f')]['type']);return db['DeskConfiguration']['create'](_0x201129[_0x309e('0x4f')],{'include':[{'model':db[_0x309e('0x5b')],'as':_0x309e('0x5c')},{'model':db[_0x309e('0x5b')],'as':_0x309e('0x59')}]});}return null;})[_0x309e('0x2f')](respondWithResult(_0x48db85,null))[_0x309e('0x24')](handleError(_0x48db85,null));};exports[_0x309e('0x5d')]=function(_0x36a535,_0x53ac70,_0x5c09e1){var _0x4c1880=[{'name':_0x309e('0x5e'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x3d182b='';return db[_0x309e('0x34')]['findOne']({'where':{'id':_0x36a535[_0x309e('0x4b')]['id']},'attributes':['id',_0x309e('0x5f'),_0x309e('0x60'),_0x309e('0x61'),_0x309e('0x62'),_0x309e('0x63'),_0x309e('0x64'),_0x309e('0x65'),'tokenSecret']})[_0x309e('0x2f')](handleEntityNotFound(_0x53ac70,null))['then'](function(_0x10478b){if(_0x10478b){_0x3d182b=_0x10478b[_0x309e('0x5f')];var _0x5d86b0=_0x3d182b[_0x309e('0x66')](-0x1);if(_0x5d86b0==='/'){_0x3d182b=_0x3d182b[_0x309e('0x67')](0x0,_0x3d182b['lastIndexOf'](_0x5d86b0));}var _0x1f34e5={'method':_0x309e('0x68'),'uri':util[_0x309e('0x69')](_0x309e('0x6a'),_0x3d182b),'headers':{'Content-Type':_0x309e('0x6b'),'Accept':_0x309e('0x6b')},'json':!![]};if(_0x10478b[_0x309e('0x60')]===_0x309e('0x6c')){_0x1f34e5[_0x309e('0x6d')][_0x309e('0x6e')]=util[_0x309e('0x69')](_0x309e('0x6f'),new Buffer(util[_0x309e('0x69')]('%s:%s',_0x10478b[_0x309e('0x61')],_0x10478b[_0x309e('0x62')]))['toString'](_0x309e('0x70')));}return rp(_0x1f34e5)[_0x309e('0x2f')](function(_0x16106e){return _0x4c1880[_0x309e('0x71')](_['map'](_0x16106e['_embedded'][_0x309e('0x72')],function(_0x266fdf){return{'id':_0x266fdf[_0x309e('0x32')],'name':_0x266fdf['name'],'type':_0x266fdf[_0x309e('0x36')],'active':_0x266fdf['active'],'label':_0x266fdf[_0x309e('0x73')],'custom':!![]};}));});}})[_0x309e('0x2f')](function(_0x3531e){return{'count':_0x3531e[_0x309e('0x3f')],'rows':_0x3531e};})[_0x309e('0x2f')](respondWithResult(_0x53ac70,null))[_0x309e('0x24')](function(_0x31252a){var _0x5829db=_0x36a535[_0x309e('0x39')][_0x309e('0x18')]?0x1f4:_0x31252a[_0x309e('0x74')]||0x1f4;logger[_0x309e('0x1f')](_0x309e('0x75'),_0x309e('0x5d'),_0x5829db,JSON[_0x309e('0x1e')](_0x31252a));delete _0x31252a['name'];if(_0x5829db===0x191){_0x5829db=0x190;}_0x53ac70['status'](_0x5829db)[_0x309e('0x76')](_0x36a535[_0x309e('0x39')][_0x309e('0x18')]?{'message':'Wrong\x20credentials','statusCode':_0x31252a[_0x309e('0x74')]}:_0x31252a);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 40b38e5..ebc8754 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 _0x18df=['./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','request-promise','path','rimraf','../../config/environment'];(function(_0x563d3b,_0x40812b){var _0xcc6fa4=function(_0x262fd8){while(--_0x262fd8){_0x563d3b['push'](_0x563d3b['shift']());}};_0xcc6fa4(++_0x40812b);}(_0x18df,0x68));var _0xf18d=function(_0x386079,_0x118a6c){_0x386079=_0x386079-0x0;var _0xb16803=_0x18df[_0x386079];return _0xb16803;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf18d('0x0'));var fs=require('fs');var path=require(_0xf18d('0x1'));var rimraf=require(_0xf18d('0x2'));var config=require(_0xf18d('0x3'));var attributes=require(_0xf18d('0x4'));var integrations=require(_0xf18d('0x5'));module['exports']=function(_0x69b3d1,_0x31949c){return _0x69b3d1[_0xf18d('0x6')](_0xf18d('0x7'),attributes,{'tableName':_0xf18d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75fd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','define','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x75fd,0x1c5));var _0xd75f=function(_0x1e6136,_0x1aee49){_0x1e6136=_0x1e6136-0x0;var _0x4e8071=_0x75fd[_0x1e6136];return _0x4e8071;};'use strict';var _=require(_0xd75f('0x0'));var util=require(_0xd75f('0x1'));var logger=require(_0xd75f('0x2'))('api');var moment=require(_0xd75f('0x3'));var BPromise=require(_0xd75f('0x4'));var rp=require(_0xd75f('0x5'));var fs=require('fs');var path=require(_0xd75f('0x6'));var rimraf=require(_0xd75f('0x7'));var config=require(_0xd75f('0x8'));var attributes=require(_0xd75f('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2e6522,_0x310761){return _0x2e6522[_0xd75f('0xa')]('DeskAccount',attributes,{'tableName':_0xd75f('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 49884c1..071b154 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 _0xbe0b=['limit','include','map','model','attributes','stringify','ShowDeskAccount','find','where','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetDeskAccount','DeskAccount','options','raw'];(function(_0x3d6db1,_0x4358f8){var _0x5e1cc3=function(_0x3ad5af){while(--_0x3ad5af){_0x3d6db1['push'](_0x3d6db1['shift']());}};_0x5e1cc3(++_0x4358f8);}(_0xbe0b,0x140));var _0xbbe0=function(_0x5426af,_0x50755c){_0x5426af=_0x5426af-0x0;var _0x290f15=_0xbe0b[_0x5426af];return _0x290f15;};'use strict';var _=require(_0xbbe0('0x0'));var util=require(_0xbbe0('0x1'));var moment=require(_0xbbe0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbe0('0x3'));var db=require(_0xbbe0('0x4'))['db'];var utils=require(_0xbbe0('0x5'));var logger=require(_0xbbe0('0x6'))(_0xbbe0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa98c46,_0x676c9e,_0x39dec0){return new BPromise(function(_0x44721f,_0x20efb1){return client[_0xbbe0('0x8')](_0xa98c46,_0x39dec0)[_0xbbe0('0x9')](function(_0x45b72a){logger[_0xbbe0('0xa')](_0xbbe0('0xb'),_0x676c9e,'request\x20sent');logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x676c9e,_0xbbe0('0xc'),JSON['stringify'](_0x45b72a));if(_0x45b72a[_0xbbe0('0xd')]){if(_0x45b72a[_0xbbe0('0xd')][_0xbbe0('0xe')]===0x1f4){logger['error'](_0xbbe0('0xb'),_0x676c9e,_0x45b72a[_0xbbe0('0xd')]['message']);return _0x20efb1(_0x45b72a['error'][_0xbbe0('0xf')]);}logger['error'](_0xbbe0('0xb'),_0x676c9e,_0x45b72a['error'][_0xbbe0('0xf')]);return _0x44721f(_0x45b72a[_0xbbe0('0xd')][_0xbbe0('0xf')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x676c9e,'request\x20sent');_0x44721f(_0x45b72a['result'][_0xbbe0('0xf')]);}})[_0xbbe0('0x10')](function(_0x44dcf9){logger[_0xbbe0('0xd')](_0xbbe0('0xb'),_0x676c9e,_0x44dcf9);_0x20efb1(_0x44dcf9);});});}exports[_0xbbe0('0x11')]=function(_0x1f2f33){var _0x473f5f=this;return new Promise(function(_0x565e9f,_0xa937f9){return db[_0xbbe0('0x12')]['findAll']({'raw':_0x1f2f33[_0xbbe0('0x13')]?_0x1f2f33[_0xbbe0('0x13')][_0xbbe0('0x14')]===undefined?!![]:![]:!![],'where':_0x1f2f33[_0xbbe0('0x13')]?_0x1f2f33[_0xbbe0('0x13')]['where']||null:null,'attributes':_0x1f2f33['options']?_0x1f2f33['options']['attributes']||null:null,'limit':_0x1f2f33[_0xbbe0('0x13')]?_0x1f2f33[_0xbbe0('0x13')][_0xbbe0('0x15')]||null:null,'include':_0x1f2f33[_0xbbe0('0x13')]?_0x1f2f33[_0xbbe0('0x13')][_0xbbe0('0x16')]?_[_0xbbe0('0x17')](_0x1f2f33[_0xbbe0('0x13')][_0xbbe0('0x16')],function(_0x198c96){return{'model':db[_0x198c96[_0xbbe0('0x18')]],'as':_0x198c96['as'],'attributes':_0x198c96[_0xbbe0('0x19')],'include':_0x198c96['include']?_[_0xbbe0('0x17')](_0x198c96[_0xbbe0('0x16')],function(_0x585e35){return{'model':db[_0x585e35[_0xbbe0('0x18')]],'as':_0x585e35['as'],'attributes':_0x585e35['attributes'],'include':_0x585e35[_0xbbe0('0x16')]?_[_0xbbe0('0x17')](_0x585e35[_0xbbe0('0x16')],function(_0x21467d){return{'model':db[_0x21467d['model']],'as':_0x21467d['as'],'attributes':_0x21467d[_0xbbe0('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbbe0('0x9')](function(_0x51ccad){logger[_0xbbe0('0xa')](_0xbbe0('0x11'),_0x1f2f33);logger['debug']('GetDeskAccount',_0x1f2f33,JSON[_0xbbe0('0x1a')](_0x51ccad));_0x565e9f(_0x51ccad);})[_0xbbe0('0x10')](function(_0x1aa742){logger[_0xbbe0('0xd')](_0xbbe0('0x11'),_0x1aa742['message'],_0x1f2f33);_0xa937f9(_0x473f5f[_0xbbe0('0xd')](0x1f4,_0x1aa742['message']));});});};exports[_0xbbe0('0x1b')]=function(_0x5019f2){var _0x3394c5=this;return new Promise(function(_0x223d90,_0x37f4b8){return db['DeskAccount'][_0xbbe0('0x1c')]({'raw':_0x5019f2[_0xbbe0('0x13')]?_0x5019f2[_0xbbe0('0x13')][_0xbbe0('0x14')]===undefined?!![]:![]:!![],'where':_0x5019f2[_0xbbe0('0x13')]?_0x5019f2[_0xbbe0('0x13')][_0xbbe0('0x1d')]||null:null,'attributes':_0x5019f2[_0xbbe0('0x13')]?_0x5019f2[_0xbbe0('0x13')]['attributes']||null:null,'include':_0x5019f2[_0xbbe0('0x13')]?_0x5019f2[_0xbbe0('0x13')][_0xbbe0('0x16')]?_[_0xbbe0('0x17')](_0x5019f2[_0xbbe0('0x13')][_0xbbe0('0x16')],function(_0x258dcf){return{'model':db[_0x258dcf['model']],'as':_0x258dcf['as'],'attributes':_0x258dcf[_0xbbe0('0x19')],'include':_0x258dcf[_0xbbe0('0x16')]?_['map'](_0x258dcf[_0xbbe0('0x16')],function(_0xb6ba76){return{'model':db[_0xb6ba76[_0xbbe0('0x18')]],'as':_0xb6ba76['as'],'attributes':_0xb6ba76['attributes'],'include':_0xb6ba76['include']?_['map'](_0xb6ba76['include'],function(_0x4b4748){return{'model':db[_0x4b4748[_0xbbe0('0x18')]],'as':_0x4b4748['as'],'attributes':_0x4b4748['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbe0('0x9')](function(_0x5e70a8){logger[_0xbbe0('0xa')](_0xbbe0('0x1b'),_0x5019f2);logger[_0xbbe0('0x1e')](_0xbbe0('0x1b'),_0x5019f2,JSON[_0xbbe0('0x1a')](_0x5e70a8));_0x223d90(_0x5e70a8);})['catch'](function(_0x224115){logger[_0xbbe0('0xd')]('ShowDeskAccount',_0x224115['message'],_0x5019f2);_0x37f4b8(_0x3394c5[_0xbbe0('0xd')](0x1f4,_0x224115[_0xbbe0('0xf')]));});});}; \ No newline at end of file +var _0xb76b=['../../config/environment','client','http','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetDeskAccount','options','where','attributes','limit','include','model','stringify','DeskAccount','find','raw','map','ShowDeskAccount','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4347d4,_0x33b2f2){var _0x10b11a=function(_0x46b0e4){while(--_0x46b0e4){_0x4347d4['push'](_0x4347d4['shift']());}};_0x10b11a(++_0x33b2f2);}(_0xb76b,0xf2));var _0xbb76=function(_0x4c1ff6,_0x15ea38){_0x4c1ff6=_0x4c1ff6-0x0;var _0x5201fe=_0xb76b[_0x4c1ff6];return _0x5201fe;};'use strict';var _=require('lodash');var util=require(_0xbb76('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb76('0x1'));var db=require(_0xbb76('0x2'))['db'];var utils=require(_0xbb76('0x3'));var logger=require(_0xbb76('0x4'))(_0xbb76('0x5'));var config=require(_0xbb76('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbb76('0x7')][_0xbb76('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c22f2,_0x37a677,_0x1ec735){return new BPromise(function(_0x2b9d7a,_0x3da35e){return client['request'](_0x2c22f2,_0x1ec735)['then'](function(_0x1c56d1){logger[_0xbb76('0x9')](_0xbb76('0xa'),_0x37a677,_0xbb76('0xb'));logger[_0xbb76('0xc')](_0xbb76('0xd'),_0x37a677,_0xbb76('0xb'),JSON['stringify'](_0x1c56d1));if(_0x1c56d1['error']){if(_0x1c56d1[_0xbb76('0xe')][_0xbb76('0xf')]===0x1f4){logger[_0xbb76('0xe')]('DeskAccount,\x20%s,\x20%s',_0x37a677,_0x1c56d1[_0xbb76('0xe')]['message']);return _0x3da35e(_0x1c56d1[_0xbb76('0xe')][_0xbb76('0x10')]);}logger['error'](_0xbb76('0xa'),_0x37a677,_0x1c56d1[_0xbb76('0xe')][_0xbb76('0x10')]);return _0x2b9d7a(_0x1c56d1[_0xbb76('0xe')][_0xbb76('0x10')]);}else{logger[_0xbb76('0x9')](_0xbb76('0xa'),_0x37a677,_0xbb76('0xb'));_0x2b9d7a(_0x1c56d1['result'][_0xbb76('0x10')]);}})[_0xbb76('0x11')](function(_0x46148f){logger[_0xbb76('0xe')](_0xbb76('0xa'),_0x37a677,_0x46148f);_0x3da35e(_0x46148f);});});}exports[_0xbb76('0x12')]=function(_0xcbfb68){var _0x30588a=this;return new Promise(function(_0x171405,_0x46e676){return db['DeskAccount']['findAll']({'raw':_0xcbfb68[_0xbb76('0x13')]?_0xcbfb68[_0xbb76('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0xcbfb68[_0xbb76('0x13')]?_0xcbfb68[_0xbb76('0x13')][_0xbb76('0x14')]||null:null,'attributes':_0xcbfb68[_0xbb76('0x13')]?_0xcbfb68[_0xbb76('0x13')][_0xbb76('0x15')]||null:null,'limit':_0xcbfb68[_0xbb76('0x13')]?_0xcbfb68[_0xbb76('0x13')][_0xbb76('0x16')]||null:null,'include':_0xcbfb68[_0xbb76('0x13')]?_0xcbfb68[_0xbb76('0x13')][_0xbb76('0x17')]?_['map'](_0xcbfb68[_0xbb76('0x13')]['include'],function(_0x4abdc4){return{'model':db[_0x4abdc4[_0xbb76('0x18')]],'as':_0x4abdc4['as'],'attributes':_0x4abdc4[_0xbb76('0x15')],'include':_0x4abdc4[_0xbb76('0x17')]?_['map'](_0x4abdc4[_0xbb76('0x17')],function(_0x562610){return{'model':db[_0x562610['model']],'as':_0x562610['as'],'attributes':_0x562610[_0xbb76('0x15')],'include':_0x562610[_0xbb76('0x17')]?_['map'](_0x562610[_0xbb76('0x17')],function(_0x11de3a){return{'model':db[_0x11de3a['model']],'as':_0x11de3a['as'],'attributes':_0x11de3a[_0xbb76('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bc1c1){logger[_0xbb76('0x9')](_0xbb76('0x12'),_0xcbfb68);logger[_0xbb76('0xc')]('GetDeskAccount',_0xcbfb68,JSON[_0xbb76('0x19')](_0x4bc1c1));_0x171405(_0x4bc1c1);})['catch'](function(_0xcda085){logger[_0xbb76('0xe')](_0xbb76('0x12'),_0xcda085[_0xbb76('0x10')],_0xcbfb68);_0x46e676(_0x30588a[_0xbb76('0xe')](0x1f4,_0xcda085[_0xbb76('0x10')]));});});};exports['ShowDeskAccount']=function(_0x3d121a){var _0x3bf902=this;return new Promise(function(_0x352b37,_0x2c5712){return db[_0xbb76('0x1a')][_0xbb76('0x1b')]({'raw':_0x3d121a['options']?_0x3d121a[_0xbb76('0x13')][_0xbb76('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d121a[_0xbb76('0x13')]?_0x3d121a['options'][_0xbb76('0x14')]||null:null,'attributes':_0x3d121a[_0xbb76('0x13')]?_0x3d121a['options'][_0xbb76('0x15')]||null:null,'include':_0x3d121a[_0xbb76('0x13')]?_0x3d121a['options'][_0xbb76('0x17')]?_[_0xbb76('0x1d')](_0x3d121a[_0xbb76('0x13')][_0xbb76('0x17')],function(_0x31bf59){return{'model':db[_0x31bf59[_0xbb76('0x18')]],'as':_0x31bf59['as'],'attributes':_0x31bf59[_0xbb76('0x15')],'include':_0x31bf59[_0xbb76('0x17')]?_[_0xbb76('0x1d')](_0x31bf59[_0xbb76('0x17')],function(_0x1729d2){return{'model':db[_0x1729d2[_0xbb76('0x18')]],'as':_0x1729d2['as'],'attributes':_0x1729d2['attributes'],'include':_0x1729d2[_0xbb76('0x17')]?_[_0xbb76('0x1d')](_0x1729d2[_0xbb76('0x17')],function(_0xa1518c){return{'model':db[_0xa1518c[_0xbb76('0x18')]],'as':_0xa1518c['as'],'attributes':_0xa1518c[_0xbb76('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x327ad3){logger['info'](_0xbb76('0x1e'),_0x3d121a);logger['debug'](_0xbb76('0x1e'),_0x3d121a,JSON[_0xbb76('0x19')](_0x327ad3));_0x352b37(_0x327ad3);})['catch'](function(_0x2e45a0){logger[_0xbb76('0xe')]('ShowDeskAccount',_0x2e45a0[_0xbb76('0x10')],_0x3d121a);_0x2c5712(_0x3bf902[_0xbb76('0xe')](0x1f4,_0x2e45a0[_0xbb76('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 0f79c3a..baf413d 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 _0xd117=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getDescriptions','post','/:id/tags','setTags','put','update'];(function(_0x422791,_0x415b47){var _0x2cbe89=function(_0x2c9044){while(--_0x2c9044){_0x422791['push'](_0x422791['shift']());}};_0x2cbe89(++_0x415b47);}(_0xd117,0x182));var _0x7d11=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0xd117[_0x59616b];return _0x5c4523;};'use strict';var multer=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var path=require(_0x7d11('0x2'));var timeout=require(_0x7d11('0x3'));var express=require(_0x7d11('0x4'));var router=express[_0x7d11('0x5')]();var auth=require(_0x7d11('0x6'));var interaction=require(_0x7d11('0x7'));var config=require(_0x7d11('0x8'));var controller=require(_0x7d11('0x9'));router[_0x7d11('0xa')]('/',auth[_0x7d11('0xb')](),controller[_0x7d11('0xc')]);router[_0x7d11('0xa')](_0x7d11('0xd'),auth[_0x7d11('0xb')](),controller['show']);router[_0x7d11('0xa')](_0x7d11('0xe'),auth[_0x7d11('0xb')](),controller['getFields']);router[_0x7d11('0xa')](_0x7d11('0xf'),auth[_0x7d11('0xb')](),controller['getSubjects']);router[_0x7d11('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x7d11('0x10')]);router['get']('/:id/tags',auth[_0x7d11('0xb')](),controller['getTags']);router[_0x7d11('0x11')]('/',auth[_0x7d11('0xb')](),controller['create']);router[_0x7d11('0x11')](_0x7d11('0x12'),auth['isAuthenticated'](),controller[_0x7d11('0x13')]);router[_0x7d11('0x14')](_0x7d11('0xd'),auth[_0x7d11('0xb')](),controller[_0x7d11('0x15')]);router[_0x7d11('0x16')](_0x7d11('0xd'),auth[_0x7d11('0xb')](),controller['destroy']);module[_0x7d11('0x17')]=router; \ No newline at end of file +var _0x2ef3=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','setTags','update'];(function(_0x3a4047,_0x54c537){var _0x502a29=function(_0x109986){while(--_0x109986){_0x3a4047['push'](_0x3a4047['shift']());}};_0x502a29(++_0x54c537);}(_0x2ef3,0xba));var _0x32ef=function(_0x35205d,_0x415cb9){_0x35205d=_0x35205d-0x0;var _0x4dd418=_0x2ef3[_0x35205d];return _0x4dd418;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./intDeskConfiguration.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0x8')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller['getSubjects']);router['get'](_0x32ef('0xf'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x8')]('/:id/tags',auth[_0x32ef('0x9')](),controller['getTags']);router[_0x32ef('0x11')]('/',auth['isAuthenticated'](),controller[_0x32ef('0x12')]);router[_0x32ef('0x11')]('/:id/tags',auth['isAuthenticated'](),controller[_0x32ef('0x13')]);router['put'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x14')]);router[_0x32ef('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x32ef('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 252a025..39d932d 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 _0xba8c=['sequelize','exports','STRING'];(function(_0x391263,_0x57eb33){var _0x48fbdc=function(_0x41fd22){while(--_0x41fd22){_0x391263['push'](_0x391263['shift']());}};_0x48fbdc(++_0x57eb33);}(_0xba8c,0x192));var _0xcba8=function(_0x3108d4,_0x51dbe1){_0x3108d4=_0x3108d4-0x0;var _0x463458=_0xba8c[_0x3108d4];return _0x463458;};'use strict';var Sequelize=require(_0xcba8('0x0'));module[_0xcba8('0x1')]={'name':{'type':Sequelize[_0xcba8('0x2')]},'description':{'type':Sequelize[_0xcba8('0x2')]}}; \ No newline at end of file +var _0x7641=['exports','sequelize'];(function(_0x5d48dd,_0x536856){var _0x13d94c=function(_0x4c32c3){while(--_0x4c32c3){_0x5d48dd['push'](_0x5d48dd['shift']());}};_0x13d94c(++_0x536856);}(_0x7641,0x18f));var _0x1764=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7641[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x1764('0x0'));module[_0x1764('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index c10c9fd..139f12c 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 _0xfb60=['html-pdf','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','sendStatus','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','getFields','findOne','DeskField','order','pick','getSubjects','hasOwnProperty','getDescriptions','setTags'];(function(_0x2b6772,_0x1f97fd){var _0x5ad80e=function(_0x59d7b2){while(--_0x59d7b2){_0x2b6772['push'](_0x2b6772['shift']());}};_0x5ad80e(++_0x1f97fd);}(_0xfb60,0x108));var _0x0fb6=function(_0x123902,_0x4912bf){_0x123902=_0x123902-0x0;var _0x1464f1=_0xfb60[_0x123902];return _0x1464f1;};'use strict';var pdf=require(_0x0fb6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0fb6('0x1'));var zipdir=require(_0x0fb6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0fb6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0fb6('0x4'));var path=require(_0x0fb6('0x5'));var sox=require(_0x0fb6('0x6'));var csv=require(_0x0fb6('0x7'));var ejs=require(_0x0fb6('0x8'));var fs=require('fs');var _=require(_0x0fb6('0x9'));var squel=require('squel');var crypto=require(_0x0fb6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0fb6('0xb'));var toCsv=require(_0x0fb6('0x7'));var querystring=require(_0x0fb6('0xc'));var Papa=require(_0x0fb6('0xd'));var Redis=require('ioredis');var authService=require(_0x0fb6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0fb6('0xf'));var hardwareService=require(_0x0fb6('0x10'));var logger=require(_0x0fb6('0x11'))(_0x0fb6('0x12'));var utils=require('../../config/utils');var config=require(_0x0fb6('0x13'));var db=require(_0x0fb6('0x14'))['db'];var jayson=require(_0x0fb6('0x15'));var client=jayson[_0x0fb6('0x16')][_0x0fb6('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1913a2,_0x10bd8e,_0x3f5cb1){if(_0x3f5cb1){var _0x2d777d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d777d[_0x0fb6('0x18')](_0x10bd8e)){return _0x1913a2;}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 _0x1913a2;}}function respondWithRpcPromise(_0x262add,_0x3fd3bc,_0x5e4225,_0x73f854){return new BPromise(function(_0x154a9a,_0x1a55e5){var _0x22bc19=_0x73f854||client;return _0x22bc19['request'](_0x262add,_0x5e4225)['then'](function(_0x1f42d9){logger[_0x0fb6('0x19')](_0x0fb6('0x1a'),_0x3fd3bc,_0x0fb6('0x1b'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3fd3bc,_0x0fb6('0x1b'),JSON[_0x0fb6('0x1c')](_0x1f42d9));if(_0x1f42d9['error']){if(_0x1f42d9[_0x0fb6('0x1d')][_0x0fb6('0x1e')]===0x1f4){logger[_0x0fb6('0x1d')](_0x0fb6('0x1a'),_0x3fd3bc,_0x1f42d9[_0x0fb6('0x1d')][_0x0fb6('0x1f')]);return _0x1a55e5(_0x1f42d9[_0x0fb6('0x1d')]['message']);}logger['error'](_0x0fb6('0x1a'),_0x3fd3bc,_0x1f42d9['error'][_0x0fb6('0x1f')]);return _0x154a9a(_0x1f42d9[_0x0fb6('0x1d')]['message']);}else{logger[_0x0fb6('0x19')](_0x0fb6('0x1a'),_0x3fd3bc,'request\x20sent');_0x154a9a(_0x1f42d9[_0x0fb6('0x20')][_0x0fb6('0x1f')]);}})['catch'](function(_0x174e63){logger[_0x0fb6('0x1d')](_0x0fb6('0x1a'),_0x3fd3bc,_0x174e63);_0x1a55e5(_0x174e63);});});}function respondWithStatusCode(_0x381eb5,_0x4c2561){_0x4c2561=_0x4c2561||0xcc;return function(_0x4b7d8e){if(_0x4b7d8e){return _0x381eb5['sendStatus'](_0x4c2561);}return _0x381eb5[_0x0fb6('0x21')](_0x4c2561)[_0x0fb6('0x22')]();};}function respondWithResult(_0x103159,_0x1700f1){_0x1700f1=_0x1700f1||0xc8;return function(_0x8d58f9){if(_0x8d58f9){return _0x103159[_0x0fb6('0x21')](_0x1700f1)[_0x0fb6('0x23')](_0x8d58f9);}};}function respondWithFilteredResult(_0x3d3127,_0x5aa40c){return function(_0x3c9a37){if(_0x3c9a37){var _0x1374df=_0x3c9a37[_0x0fb6('0x24')],_0x517ef4=_0x5aa40c['offset'],_0x4bd61a=_0x5aa40c[_0x0fb6('0x25')]+_0x5aa40c[_0x0fb6('0x26')],_0x1e8754;if(_0x4bd61a>=_0x1374df){_0x4bd61a=_0x1374df;_0x1e8754=0xc8;}else{_0x1e8754=0xce;}_0x3d3127[_0x0fb6('0x21')](_0x1e8754);return _0x3d3127[_0x0fb6('0x27')](_0x0fb6('0x28'),_0x517ef4+'-'+_0x4bd61a+'/'+_0x1374df)['json'](_0x3c9a37);}return null;};}function patchUpdates(_0x511cc8){return function(_0x285fc1){try{jsonpatch[_0x0fb6('0x29')](_0x285fc1,_0x511cc8,!![]);}catch(_0x90678a){return BPromise['reject'](_0x90678a);}return _0x285fc1['save']();};}function saveUpdates(_0x466831,_0x4024d8){return function(_0x2ab501){if(_0x2ab501){return _0x2ab501[_0x0fb6('0x2a')](_0x466831)[_0x0fb6('0x2b')](function(_0xde2372){return _0xde2372;});}return null;};}function removeEntity(_0x2c0bc1,_0x18731a){return function(_0x3a28d7){if(_0x3a28d7){return _0x3a28d7[_0x0fb6('0x2c')]()[_0x0fb6('0x2b')](function(){_0x2c0bc1[_0x0fb6('0x21')](0xcc)[_0x0fb6('0x22')]();});}};}function handleEntityNotFound(_0x24dcbb,_0x314909){return function(_0x25bbe1){if(!_0x25bbe1){_0x24dcbb[_0x0fb6('0x2d')](0x194);}return _0x25bbe1;};}function handleError(_0x20a89f,_0x4b8d7b){_0x4b8d7b=_0x4b8d7b||0x1f4;return function(_0x4f3381){logger[_0x0fb6('0x1d')](_0x4f3381[_0x0fb6('0x2e')]);if(_0x4f3381[_0x0fb6('0x2f')]){delete _0x4f3381[_0x0fb6('0x2f')];}_0x20a89f[_0x0fb6('0x21')](_0x4b8d7b)[_0x0fb6('0x30')](_0x4f3381);};}exports[_0x0fb6('0x31')]=function(_0x585998,_0x33ec65){var _0x1bc6de={},_0x4875e2={},_0xe3b14e={'count':0x0,'rows':[]};var _0x5ad113=_['map'](db[_0x0fb6('0x32')][_0x0fb6('0x33')],function(_0x2d2539){return{'name':_0x2d2539[_0x0fb6('0x34')],'type':_0x2d2539[_0x0fb6('0x35')][_0x0fb6('0x36')]};});_0x4875e2[_0x0fb6('0x37')]=_[_0x0fb6('0x38')](_0x5ad113,_0x0fb6('0x2f'));_0x4875e2[_0x0fb6('0x39')]=_[_0x0fb6('0x3a')](_0x585998[_0x0fb6('0x39')]);_0x4875e2[_0x0fb6('0x3b')]=_[_0x0fb6('0x3c')](_0x4875e2[_0x0fb6('0x37')],_0x4875e2[_0x0fb6('0x39')]);_0x1bc6de[_0x0fb6('0x3d')]=_[_0x0fb6('0x3c')](_0x4875e2['model'],qs[_0x0fb6('0x3e')](_0x585998[_0x0fb6('0x39')][_0x0fb6('0x3e')]));_0x1bc6de[_0x0fb6('0x3d')]=_0x1bc6de[_0x0fb6('0x3d')][_0x0fb6('0x3f')]?_0x1bc6de['attributes']:_0x4875e2['model'];if(!_0x585998['query']['hasOwnProperty'](_0x0fb6('0x40'))){_0x1bc6de['limit']=qs[_0x0fb6('0x26')](_0x585998[_0x0fb6('0x39')][_0x0fb6('0x26')]);_0x1bc6de[_0x0fb6('0x25')]=qs[_0x0fb6('0x25')](_0x585998[_0x0fb6('0x39')][_0x0fb6('0x25')]);}_0x1bc6de['order']=qs[_0x0fb6('0x41')](_0x585998['query'][_0x0fb6('0x41')]);_0x1bc6de['where']=qs[_0x0fb6('0x3b')](_['pick'](_0x585998[_0x0fb6('0x39')],_0x4875e2[_0x0fb6('0x3b')]));if(_0x585998[_0x0fb6('0x39')][_0x0fb6('0x42')]){_0x1bc6de[_0x0fb6('0x43')]=_['merge'](_0x1bc6de[_0x0fb6('0x43')],{'$or':_[_0x0fb6('0x38')](_0x5ad113,function(_0x45cc48){if(_0x45cc48['type']!=='VIRTUAL'){var _0x3ca24a={};_0x3ca24a[_0x45cc48[_0x0fb6('0x2f')]]={'$like':'%'+_0x585998['query'][_0x0fb6('0x42')]+'%'};return _0x3ca24a;}})});}_0x1bc6de=_[_0x0fb6('0x44')]({},_0x1bc6de,_0x585998[_0x0fb6('0x45')]);var _0x4fef60={'where':_0x1bc6de[_0x0fb6('0x43')]};return db['DeskConfiguration'][_0x0fb6('0x24')](_0x4fef60)['then'](function(_0x3ee6e7){_0xe3b14e['count']=_0x3ee6e7;if(_0x585998[_0x0fb6('0x39')][_0x0fb6('0x46')]){_0x1bc6de[_0x0fb6('0x47')]=[{'all':!![]}];}return db[_0x0fb6('0x32')][_0x0fb6('0x48')](_0x1bc6de);})[_0x0fb6('0x2b')](function(_0x413143){_0xe3b14e[_0x0fb6('0x49')]=_0x413143;return _0xe3b14e;})[_0x0fb6('0x2b')](respondWithFilteredResult(_0x33ec65,_0x1bc6de))['catch'](handleError(_0x33ec65,null));};exports['show']=function(_0x4a74bc,_0x5baa4e){var _0x9cef0={'raw':![],'where':{'id':_0x4a74bc[_0x0fb6('0x4a')]['id']}},_0x2ad30f={};_0x2ad30f[_0x0fb6('0x37')]=_[_0x0fb6('0x3a')](db[_0x0fb6('0x32')][_0x0fb6('0x33')]);_0x2ad30f[_0x0fb6('0x39')]=_[_0x0fb6('0x3a')](_0x4a74bc[_0x0fb6('0x39')]);_0x2ad30f['filters']=_[_0x0fb6('0x3c')](_0x2ad30f[_0x0fb6('0x37')],_0x2ad30f[_0x0fb6('0x39')]);_0x9cef0['attributes']=_['intersection'](_0x2ad30f['model'],qs['fields'](_0x4a74bc[_0x0fb6('0x39')][_0x0fb6('0x3e')]));_0x9cef0[_0x0fb6('0x3d')]=_0x9cef0[_0x0fb6('0x3d')][_0x0fb6('0x3f')]?_0x9cef0['attributes']:_0x2ad30f['model'];if(_0x4a74bc['query'][_0x0fb6('0x46')]){_0x9cef0[_0x0fb6('0x47')]=[{'all':!![]}];}_0x9cef0=_[_0x0fb6('0x44')]({},_0x9cef0,_0x4a74bc['options']);return db[_0x0fb6('0x32')][_0x0fb6('0x4b')](_0x9cef0)['then'](handleEntityNotFound(_0x5baa4e,null))[_0x0fb6('0x2b')](respondWithResult(_0x5baa4e,null))[_0x0fb6('0x4c')](handleError(_0x5baa4e,null));};exports[_0x0fb6('0x4d')]=function(_0x29b40b,_0x211c33){return db['DeskConfiguration']['create'](_0x29b40b[_0x0fb6('0x4e')],{})[_0x0fb6('0x2b')](respondWithResult(_0x211c33,0xc9))[_0x0fb6('0x4c')](handleError(_0x211c33,null));};exports[_0x0fb6('0x2a')]=function(_0x3bd0fd,_0x4f4c29){if(_0x3bd0fd[_0x0fb6('0x4e')]['id']){delete _0x3bd0fd[_0x0fb6('0x4e')]['id'];}return db['DeskConfiguration'][_0x0fb6('0x4b')]({'where':{'id':_0x3bd0fd['params']['id']}})[_0x0fb6('0x2b')](handleEntityNotFound(_0x4f4c29,null))[_0x0fb6('0x2b')](saveUpdates(_0x3bd0fd[_0x0fb6('0x4e')],null))['then'](respondWithResult(_0x4f4c29,null))['catch'](handleError(_0x4f4c29,null));};exports[_0x0fb6('0x2c')]=function(_0x1121b5,_0x49e16a){return db['DeskConfiguration'][_0x0fb6('0x4b')]({'where':{'id':_0x1121b5[_0x0fb6('0x4a')]['id']}})[_0x0fb6('0x2b')](handleEntityNotFound(_0x49e16a,null))['then'](removeEntity(_0x49e16a,null))[_0x0fb6('0x4c')](handleError(_0x49e16a,null));};exports[_0x0fb6('0x4f')]=function(_0x1e65d4,_0x4e9044,_0x2d7ef2){var _0x351397={};var _0x398bbc={};var _0x5aca38;var _0xff87fe;return db[_0x0fb6('0x32')][_0x0fb6('0x50')]({'where':{'id':_0x1e65d4[_0x0fb6('0x4a')]['id']}})[_0x0fb6('0x2b')](handleEntityNotFound(_0x4e9044,null))[_0x0fb6('0x2b')](function(_0x5800ba){if(_0x5800ba){_0x5aca38=_0x5800ba;_0x398bbc[_0x0fb6('0x37')]=_['keys'](db[_0x0fb6('0x51')][_0x0fb6('0x33')]);_0x398bbc[_0x0fb6('0x39')]=_[_0x0fb6('0x3a')](_0x1e65d4[_0x0fb6('0x39')]);_0x398bbc['filters']=_[_0x0fb6('0x3c')](_0x398bbc[_0x0fb6('0x37')],_0x398bbc[_0x0fb6('0x39')]);_0x351397['attributes']=_[_0x0fb6('0x3c')](_0x398bbc[_0x0fb6('0x37')],qs['fields'](_0x1e65d4[_0x0fb6('0x39')]['fields']));_0x351397[_0x0fb6('0x3d')]=_0x351397[_0x0fb6('0x3d')][_0x0fb6('0x3f')]?_0x351397[_0x0fb6('0x3d')]:_0x398bbc[_0x0fb6('0x37')];_0x351397[_0x0fb6('0x52')]=qs[_0x0fb6('0x41')](_0x1e65d4[_0x0fb6('0x39')]['sort']);_0x351397['where']=qs['filters'](_[_0x0fb6('0x53')](_0x1e65d4[_0x0fb6('0x39')],_0x398bbc[_0x0fb6('0x3b')]));if(_0x1e65d4[_0x0fb6('0x39')]['filter']){_0x351397[_0x0fb6('0x43')]=_[_0x0fb6('0x44')](_0x351397[_0x0fb6('0x43')],{'$or':_[_0x0fb6('0x38')](_0x351397[_0x0fb6('0x3d')],function(_0x4bc30f){var _0x59e627={};_0x59e627[_0x4bc30f]={'$like':'%'+_0x1e65d4[_0x0fb6('0x39')]['filter']+'%'};return _0x59e627;})});}_0x351397=_[_0x0fb6('0x44')]({},_0x351397,_0x1e65d4[_0x0fb6('0x45')]);return _0x5aca38[_0x0fb6('0x4f')](_0x351397);}})[_0x0fb6('0x2b')](function(_0x1ac079){if(_0x1ac079){_0xff87fe=_0x1ac079[_0x0fb6('0x3f')];if(!_0x1e65d4['query']['hasOwnProperty'](_0x0fb6('0x40'))){_0x351397[_0x0fb6('0x26')]=qs[_0x0fb6('0x26')](_0x1e65d4[_0x0fb6('0x39')][_0x0fb6('0x26')]);_0x351397[_0x0fb6('0x25')]=qs[_0x0fb6('0x25')](_0x1e65d4[_0x0fb6('0x39')]['offset']);}return _0x5aca38[_0x0fb6('0x4f')](_0x351397);}})[_0x0fb6('0x2b')](function(_0x5bdd1c){if(_0x5bdd1c){return _0x5bdd1c?{'count':_0xff87fe,'rows':_0x5bdd1c}:null;}})[_0x0fb6('0x2b')](respondWithResult(_0x4e9044,null))[_0x0fb6('0x4c')](handleError(_0x4e9044,null));};exports[_0x0fb6('0x54')]=function(_0x3081b4,_0x5d158b,_0x5e0277){var _0x2092e8={};var _0x334bfc={};var _0x420008;var _0x2b1fbd;return db[_0x0fb6('0x32')][_0x0fb6('0x50')]({'where':{'id':_0x3081b4['params']['id']}})['then'](handleEntityNotFound(_0x5d158b,null))['then'](function(_0xc4aaa4){if(_0xc4aaa4){_0x420008=_0xc4aaa4;_0x334bfc[_0x0fb6('0x37')]=_[_0x0fb6('0x3a')](db[_0x0fb6('0x51')][_0x0fb6('0x33')]);_0x334bfc[_0x0fb6('0x39')]=_[_0x0fb6('0x3a')](_0x3081b4['query']);_0x334bfc['filters']=_[_0x0fb6('0x3c')](_0x334bfc[_0x0fb6('0x37')],_0x334bfc['query']);_0x2092e8['attributes']=_[_0x0fb6('0x3c')](_0x334bfc[_0x0fb6('0x37')],qs[_0x0fb6('0x3e')](_0x3081b4[_0x0fb6('0x39')][_0x0fb6('0x3e')]));_0x2092e8[_0x0fb6('0x3d')]=_0x2092e8['attributes'][_0x0fb6('0x3f')]?_0x2092e8['attributes']:_0x334bfc['model'];_0x2092e8['order']=qs[_0x0fb6('0x41')](_0x3081b4[_0x0fb6('0x39')][_0x0fb6('0x41')]);_0x2092e8[_0x0fb6('0x43')]=qs['filters'](_[_0x0fb6('0x53')](_0x3081b4['query'],_0x334bfc[_0x0fb6('0x3b')]));if(_0x3081b4[_0x0fb6('0x39')][_0x0fb6('0x42')]){_0x2092e8[_0x0fb6('0x43')]=_['merge'](_0x2092e8[_0x0fb6('0x43')],{'$or':_[_0x0fb6('0x38')](_0x2092e8[_0x0fb6('0x3d')],function(_0x2fd16a){var _0x484c2f={};_0x484c2f[_0x2fd16a]={'$like':'%'+_0x3081b4[_0x0fb6('0x39')][_0x0fb6('0x42')]+'%'};return _0x484c2f;})});}_0x2092e8=_[_0x0fb6('0x44')]({},_0x2092e8,_0x3081b4['options']);return _0x420008[_0x0fb6('0x54')](_0x2092e8);}})[_0x0fb6('0x2b')](function(_0x56b559){if(_0x56b559){_0x2b1fbd=_0x56b559[_0x0fb6('0x3f')];if(!_0x3081b4[_0x0fb6('0x39')][_0x0fb6('0x55')](_0x0fb6('0x40'))){_0x2092e8[_0x0fb6('0x26')]=qs['limit'](_0x3081b4['query'][_0x0fb6('0x26')]);_0x2092e8[_0x0fb6('0x25')]=qs[_0x0fb6('0x25')](_0x3081b4['query'][_0x0fb6('0x25')]);}return _0x420008[_0x0fb6('0x54')](_0x2092e8);}})[_0x0fb6('0x2b')](function(_0x1404f3){if(_0x1404f3){return _0x1404f3?{'count':_0x2b1fbd,'rows':_0x1404f3}:null;}})[_0x0fb6('0x2b')](respondWithResult(_0x5d158b,null))['catch'](handleError(_0x5d158b,null));};exports[_0x0fb6('0x56')]=function(_0x3343a9,_0x542bd8,_0x40b675){var _0x578c18={};var _0x174a90={};var _0x47317d;var _0x1381db;return db[_0x0fb6('0x32')][_0x0fb6('0x50')]({'where':{'id':_0x3343a9['params']['id']}})['then'](handleEntityNotFound(_0x542bd8,null))[_0x0fb6('0x2b')](function(_0x19cf6b){if(_0x19cf6b){_0x47317d=_0x19cf6b;_0x174a90[_0x0fb6('0x37')]=_[_0x0fb6('0x3a')](db['DeskField']['rawAttributes']);_0x174a90[_0x0fb6('0x39')]=_[_0x0fb6('0x3a')](_0x3343a9['query']);_0x174a90[_0x0fb6('0x3b')]=_[_0x0fb6('0x3c')](_0x174a90['model'],_0x174a90[_0x0fb6('0x39')]);_0x578c18[_0x0fb6('0x3d')]=_[_0x0fb6('0x3c')](_0x174a90[_0x0fb6('0x37')],qs[_0x0fb6('0x3e')](_0x3343a9[_0x0fb6('0x39')]['fields']));_0x578c18[_0x0fb6('0x3d')]=_0x578c18[_0x0fb6('0x3d')]['length']?_0x578c18['attributes']:_0x174a90[_0x0fb6('0x37')];_0x578c18[_0x0fb6('0x52')]=qs[_0x0fb6('0x41')](_0x3343a9[_0x0fb6('0x39')][_0x0fb6('0x41')]);_0x578c18['where']=qs[_0x0fb6('0x3b')](_[_0x0fb6('0x53')](_0x3343a9[_0x0fb6('0x39')],_0x174a90['filters']));if(_0x3343a9[_0x0fb6('0x39')]['filter']){_0x578c18[_0x0fb6('0x43')]=_[_0x0fb6('0x44')](_0x578c18[_0x0fb6('0x43')],{'$or':_[_0x0fb6('0x38')](_0x578c18[_0x0fb6('0x3d')],function(_0x324211){var _0x5d8d08={};_0x5d8d08[_0x324211]={'$like':'%'+_0x3343a9[_0x0fb6('0x39')][_0x0fb6('0x42')]+'%'};return _0x5d8d08;})});}_0x578c18=_[_0x0fb6('0x44')]({},_0x578c18,_0x3343a9[_0x0fb6('0x45')]);return _0x47317d[_0x0fb6('0x56')](_0x578c18);}})[_0x0fb6('0x2b')](function(_0x3b041e){if(_0x3b041e){_0x1381db=_0x3b041e[_0x0fb6('0x3f')];if(!_0x3343a9['query'][_0x0fb6('0x55')](_0x0fb6('0x40'))){_0x578c18['limit']=qs[_0x0fb6('0x26')](_0x3343a9[_0x0fb6('0x39')][_0x0fb6('0x26')]);_0x578c18[_0x0fb6('0x25')]=qs['offset'](_0x3343a9['query']['offset']);}return _0x47317d['getDescriptions'](_0x578c18);}})[_0x0fb6('0x2b')](function(_0x3b3669){if(_0x3b3669){return _0x3b3669?{'count':_0x1381db,'rows':_0x3b3669}:null;}})[_0x0fb6('0x2b')](respondWithResult(_0x542bd8,null))[_0x0fb6('0x4c')](handleError(_0x542bd8,null));};exports['getTags']=function(_0x45fa54,_0x2a5969,_0x3c91ca){var _0x332339={};var _0x2dc997={};var _0x3200d7;var _0x5e0e60;return db[_0x0fb6('0x32')][_0x0fb6('0x50')]({'where':{'id':_0x45fa54['params']['id']}})[_0x0fb6('0x2b')](handleEntityNotFound(_0x2a5969,null))[_0x0fb6('0x2b')](function(_0x36dbfb){if(_0x36dbfb){_0x3200d7=_0x36dbfb;_0x2dc997[_0x0fb6('0x37')]=_[_0x0fb6('0x3a')](db['Tag']['rawAttributes']);_0x2dc997[_0x0fb6('0x39')]=_[_0x0fb6('0x3a')](_0x45fa54[_0x0fb6('0x39')]);_0x2dc997[_0x0fb6('0x3b')]=_[_0x0fb6('0x3c')](_0x2dc997[_0x0fb6('0x37')],_0x2dc997[_0x0fb6('0x39')]);_0x332339[_0x0fb6('0x3d')]=_[_0x0fb6('0x3c')](_0x2dc997[_0x0fb6('0x37')],qs[_0x0fb6('0x3e')](_0x45fa54[_0x0fb6('0x39')][_0x0fb6('0x3e')]));_0x332339['attributes']=_0x332339['attributes'][_0x0fb6('0x3f')]?_0x332339[_0x0fb6('0x3d')]:_0x2dc997['model'];_0x332339[_0x0fb6('0x52')]=qs[_0x0fb6('0x41')](_0x45fa54['query'][_0x0fb6('0x41')]);_0x332339[_0x0fb6('0x43')]=qs['filters'](_[_0x0fb6('0x53')](_0x45fa54[_0x0fb6('0x39')],_0x2dc997[_0x0fb6('0x3b')]));if(_0x45fa54[_0x0fb6('0x39')][_0x0fb6('0x42')]){_0x332339[_0x0fb6('0x43')]=_[_0x0fb6('0x44')](_0x332339[_0x0fb6('0x43')],{'$or':_[_0x0fb6('0x38')](_0x332339[_0x0fb6('0x3d')],function(_0x38efe8){var _0x53fc1a={};_0x53fc1a[_0x38efe8]={'$like':'%'+_0x45fa54[_0x0fb6('0x39')][_0x0fb6('0x42')]+'%'};return _0x53fc1a;})});}_0x332339=_[_0x0fb6('0x44')]({},_0x332339,_0x45fa54[_0x0fb6('0x45')]);return _0x3200d7['getTags'](_0x332339);}})[_0x0fb6('0x2b')](function(_0x2927ac){if(_0x2927ac){_0x5e0e60=_0x2927ac[_0x0fb6('0x3f')];if(!_0x45fa54[_0x0fb6('0x39')][_0x0fb6('0x55')](_0x0fb6('0x40'))){_0x332339['limit']=qs[_0x0fb6('0x26')](_0x45fa54['query'][_0x0fb6('0x26')]);_0x332339[_0x0fb6('0x25')]=qs['offset'](_0x45fa54[_0x0fb6('0x39')][_0x0fb6('0x25')]);}return _0x3200d7['getTags'](_0x332339);}})[_0x0fb6('0x2b')](function(_0x36aa65){if(_0x36aa65){return _0x36aa65?{'count':_0x5e0e60,'rows':_0x36aa65}:null;}})[_0x0fb6('0x2b')](respondWithResult(_0x2a5969,null))['catch'](handleError(_0x2a5969,null));};exports[_0x0fb6('0x57')]=function(_0x5ecb4e,_0x1426b3,_0x2d46a6){if(_0x5ecb4e[_0x0fb6('0x4e')]['id']){delete _0x5ecb4e['body']['id'];}return db[_0x0fb6('0x32')][_0x0fb6('0x50')]({'where':{'id':_0x5ecb4e[_0x0fb6('0x4a')]['id']}})[_0x0fb6('0x2b')](handleEntityNotFound(_0x1426b3,null))[_0x0fb6('0x2b')](function(_0x57ffe6){if(_0x57ffe6){return _0x57ffe6['setTags'](_0x5ecb4e[_0x0fb6('0x4e')]['ids']||[]);}return null;})[_0x0fb6('0x2b')](respondWithResult(_0x1426b3,null))[_0x0fb6('0x4c')](handleError(_0x1426b3,null));}; \ No newline at end of file +var _0x43a9=['Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','DeskConfiguration','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','nolimit','sort','pick','filter','where','map','options','includeAll','include','findAll','show','params','keys','find','create','body','getFields','DeskField','order','merge','hasOwnProperty','getSubjects','findOne','getDescriptions','getTags'];(function(_0x3c7601,_0x5eb803){var _0x254f65=function(_0x1a65ad){while(--_0x1a65ad){_0x3c7601['push'](_0x3c7601['shift']());}};_0x254f65(++_0x5eb803);}(_0x43a9,0x128));var _0x943a=function(_0x25fe80,_0x35f583){_0x25fe80=_0x25fe80-0x0;var _0x329fd7=_0x43a9[_0x25fe80];return _0x329fd7;};'use strict';var pdf=require(_0x943a('0x0'));var emlformat=require(_0x943a('0x1'));var rimraf=require(_0x943a('0x2'));var zipdir=require(_0x943a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x943a('0x4'));var moment=require(_0x943a('0x5'));var BPromise=require(_0x943a('0x6'));var Mustache=require('mustache');var util=require(_0x943a('0x7'));var path=require(_0x943a('0x8'));var sox=require(_0x943a('0x9'));var csv=require(_0x943a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x943a('0xb'));var squel=require(_0x943a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x943a('0xd'));var toCsv=require(_0x943a('0xa'));var querystring=require(_0x943a('0xe'));var Papa=require(_0x943a('0xf'));var Redis=require(_0x943a('0x10'));var authService=require(_0x943a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x943a('0x12'));var hardwareService=require(_0x943a('0x13'));var logger=require('../../config/logger')(_0x943a('0x14'));var utils=require(_0x943a('0x15'));var config=require(_0x943a('0x16'));var db=require(_0x943a('0x17'))['db'];var jayson=require(_0x943a('0x18'));var client=jayson[_0x943a('0x19')][_0x943a('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5c3c06,_0x19d10c,_0x36b8ef){if(_0x36b8ef){var _0x4def05=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4def05[_0x943a('0x1b')](_0x19d10c)){return _0x5c3c06;}else{throw new db[(_0x943a('0x1c'))][(_0x943a('0x1d'))](_0x943a('0x1e'));}}else{return _0x5c3c06;}}function respondWithRpcPromise(_0x189b12,_0x2e396b,_0x3fc868,_0x555623){return new BPromise(function(_0x182672,_0x1bbd78){var _0x29d533=_0x555623||client;return _0x29d533[_0x943a('0x1f')](_0x189b12,_0x3fc868)[_0x943a('0x20')](function(_0x374ce7){logger[_0x943a('0x21')](_0x943a('0x22'),_0x2e396b,_0x943a('0x23'));logger[_0x943a('0x24')](_0x943a('0x25'),_0x2e396b,_0x943a('0x23'),JSON[_0x943a('0x26')](_0x374ce7));if(_0x374ce7[_0x943a('0x27')]){if(_0x374ce7[_0x943a('0x27')][_0x943a('0x28')]===0x1f4){logger[_0x943a('0x27')](_0x943a('0x22'),_0x2e396b,_0x374ce7[_0x943a('0x27')]['message']);return _0x1bbd78(_0x374ce7[_0x943a('0x27')][_0x943a('0x29')]);}logger[_0x943a('0x27')](_0x943a('0x22'),_0x2e396b,_0x374ce7[_0x943a('0x27')][_0x943a('0x29')]);return _0x182672(_0x374ce7[_0x943a('0x27')]['message']);}else{logger[_0x943a('0x21')](_0x943a('0x22'),_0x2e396b,_0x943a('0x23'));_0x182672(_0x374ce7[_0x943a('0x2a')]['message']);}})[_0x943a('0x2b')](function(_0x2a39c3){logger['error'](_0x943a('0x22'),_0x2e396b,_0x2a39c3);_0x1bbd78(_0x2a39c3);});});}function respondWithStatusCode(_0x18dbef,_0xf778a9){_0xf778a9=_0xf778a9||0xcc;return function(_0x1b3002){if(_0x1b3002){return _0x18dbef[_0x943a('0x2c')](_0xf778a9);}return _0x18dbef['status'](_0xf778a9)[_0x943a('0x2d')]();};}function respondWithResult(_0x34f703,_0xdd08c7){_0xdd08c7=_0xdd08c7||0xc8;return function(_0x56273f){if(_0x56273f){return _0x34f703[_0x943a('0x2e')](_0xdd08c7)['json'](_0x56273f);}};}function respondWithFilteredResult(_0x1a1134,_0x5ce0fc){return function(_0x42cb37){if(_0x42cb37){var _0x39f059=_0x42cb37[_0x943a('0x2f')],_0x1fef75=_0x5ce0fc[_0x943a('0x30')],_0x1c1f22=_0x5ce0fc['offset']+_0x5ce0fc[_0x943a('0x31')],_0x2f22b1;if(_0x1c1f22>=_0x39f059){_0x1c1f22=_0x39f059;_0x2f22b1=0xc8;}else{_0x2f22b1=0xce;}_0x1a1134['status'](_0x2f22b1);return _0x1a1134[_0x943a('0x32')](_0x943a('0x33'),_0x1fef75+'-'+_0x1c1f22+'/'+_0x39f059)[_0x943a('0x34')](_0x42cb37);}return null;};}function patchUpdates(_0x596c58){return function(_0x1e5592){try{jsonpatch[_0x943a('0x35')](_0x1e5592,_0x596c58,!![]);}catch(_0x3d86b8){return BPromise[_0x943a('0x36')](_0x3d86b8);}return _0x1e5592[_0x943a('0x37')]();};}function saveUpdates(_0x3bc4f2,_0x27baa3){return function(_0x1cd5d0){if(_0x1cd5d0){return _0x1cd5d0[_0x943a('0x38')](_0x3bc4f2)[_0x943a('0x20')](function(_0x21c21e){return _0x21c21e;});}return null;};}function removeEntity(_0x5872f0,_0x46f9bc){return function(_0x1d3f57){if(_0x1d3f57){return _0x1d3f57[_0x943a('0x39')]()['then'](function(){_0x5872f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1852f4,_0x1e732f){return function(_0x55325f){if(!_0x55325f){_0x1852f4[_0x943a('0x2c')](0x194);}return _0x55325f;};}function handleError(_0xf7eee4,_0x2c4293){_0x2c4293=_0x2c4293||0x1f4;return function(_0x198c75){logger[_0x943a('0x27')](_0x198c75[_0x943a('0x3a')]);if(_0x198c75[_0x943a('0x3b')]){delete _0x198c75[_0x943a('0x3b')];}_0xf7eee4[_0x943a('0x2e')](_0x2c4293)[_0x943a('0x3c')](_0x198c75);};}exports['index']=function(_0x1613c3,_0x1d05d7){var _0x1e06cd={},_0x2fe1ae={},_0x29d294={'count':0x0,'rows':[]};var _0x63259d=_['map'](db[_0x943a('0x3d')][_0x943a('0x3e')],function(_0x5aac33){return{'name':_0x5aac33['fieldName'],'type':_0x5aac33[_0x943a('0x3f')]['key']};});_0x2fe1ae[_0x943a('0x40')]=_['map'](_0x63259d,_0x943a('0x3b'));_0x2fe1ae[_0x943a('0x41')]=_['keys'](_0x1613c3[_0x943a('0x41')]);_0x2fe1ae[_0x943a('0x42')]=_['intersection'](_0x2fe1ae[_0x943a('0x40')],_0x2fe1ae[_0x943a('0x41')]);_0x1e06cd[_0x943a('0x43')]=_[_0x943a('0x44')](_0x2fe1ae[_0x943a('0x40')],qs[_0x943a('0x45')](_0x1613c3[_0x943a('0x41')][_0x943a('0x45')]));_0x1e06cd[_0x943a('0x43')]=_0x1e06cd['attributes'][_0x943a('0x46')]?_0x1e06cd[_0x943a('0x43')]:_0x2fe1ae['model'];if(!_0x1613c3[_0x943a('0x41')]['hasOwnProperty'](_0x943a('0x47'))){_0x1e06cd[_0x943a('0x31')]=qs[_0x943a('0x31')](_0x1613c3['query'][_0x943a('0x31')]);_0x1e06cd[_0x943a('0x30')]=qs[_0x943a('0x30')](_0x1613c3[_0x943a('0x41')][_0x943a('0x30')]);}_0x1e06cd['order']=qs[_0x943a('0x48')](_0x1613c3['query'][_0x943a('0x48')]);_0x1e06cd['where']=qs[_0x943a('0x42')](_[_0x943a('0x49')](_0x1613c3[_0x943a('0x41')],_0x2fe1ae[_0x943a('0x42')]));if(_0x1613c3[_0x943a('0x41')][_0x943a('0x4a')]){_0x1e06cd[_0x943a('0x4b')]=_['merge'](_0x1e06cd['where'],{'$or':_[_0x943a('0x4c')](_0x63259d,function(_0x1d2090){if(_0x1d2090[_0x943a('0x3f')]!=='VIRTUAL'){var _0x565167={};_0x565167[_0x1d2090[_0x943a('0x3b')]]={'$like':'%'+_0x1613c3[_0x943a('0x41')][_0x943a('0x4a')]+'%'};return _0x565167;}})});}_0x1e06cd=_['merge']({},_0x1e06cd,_0x1613c3[_0x943a('0x4d')]);var _0x5bec37={'where':_0x1e06cd[_0x943a('0x4b')]};return db[_0x943a('0x3d')]['count'](_0x5bec37)[_0x943a('0x20')](function(_0x79bb1e){_0x29d294['count']=_0x79bb1e;if(_0x1613c3[_0x943a('0x41')][_0x943a('0x4e')]){_0x1e06cd[_0x943a('0x4f')]=[{'all':!![]}];}return db[_0x943a('0x3d')][_0x943a('0x50')](_0x1e06cd);})[_0x943a('0x20')](function(_0x4af976){_0x29d294['rows']=_0x4af976;return _0x29d294;})[_0x943a('0x20')](respondWithFilteredResult(_0x1d05d7,_0x1e06cd))[_0x943a('0x2b')](handleError(_0x1d05d7,null));};exports[_0x943a('0x51')]=function(_0xd4ae6a,_0x48088d){var _0x2fe00d={'raw':![],'where':{'id':_0xd4ae6a[_0x943a('0x52')]['id']}},_0x47d477={};_0x47d477['model']=_[_0x943a('0x53')](db['DeskConfiguration'][_0x943a('0x3e')]);_0x47d477[_0x943a('0x41')]=_[_0x943a('0x53')](_0xd4ae6a['query']);_0x47d477[_0x943a('0x42')]=_[_0x943a('0x44')](_0x47d477[_0x943a('0x40')],_0x47d477[_0x943a('0x41')]);_0x2fe00d[_0x943a('0x43')]=_[_0x943a('0x44')](_0x47d477['model'],qs[_0x943a('0x45')](_0xd4ae6a[_0x943a('0x41')][_0x943a('0x45')]));_0x2fe00d[_0x943a('0x43')]=_0x2fe00d[_0x943a('0x43')][_0x943a('0x46')]?_0x2fe00d[_0x943a('0x43')]:_0x47d477['model'];if(_0xd4ae6a[_0x943a('0x41')][_0x943a('0x4e')]){_0x2fe00d[_0x943a('0x4f')]=[{'all':!![]}];}_0x2fe00d=_['merge']({},_0x2fe00d,_0xd4ae6a['options']);return db[_0x943a('0x3d')][_0x943a('0x54')](_0x2fe00d)[_0x943a('0x20')](handleEntityNotFound(_0x48088d,null))[_0x943a('0x20')](respondWithResult(_0x48088d,null))[_0x943a('0x2b')](handleError(_0x48088d,null));};exports['create']=function(_0x490759,_0x2a01a1){return db[_0x943a('0x3d')][_0x943a('0x55')](_0x490759[_0x943a('0x56')],{})[_0x943a('0x20')](respondWithResult(_0x2a01a1,0xc9))[_0x943a('0x2b')](handleError(_0x2a01a1,null));};exports['update']=function(_0x5e284b,_0x111162){if(_0x5e284b[_0x943a('0x56')]['id']){delete _0x5e284b[_0x943a('0x56')]['id'];}return db[_0x943a('0x3d')][_0x943a('0x54')]({'where':{'id':_0x5e284b[_0x943a('0x52')]['id']}})['then'](handleEntityNotFound(_0x111162,null))[_0x943a('0x20')](saveUpdates(_0x5e284b['body'],null))['then'](respondWithResult(_0x111162,null))['catch'](handleError(_0x111162,null));};exports[_0x943a('0x39')]=function(_0x35ad8d,_0x472bbc){return db[_0x943a('0x3d')]['find']({'where':{'id':_0x35ad8d[_0x943a('0x52')]['id']}})[_0x943a('0x20')](handleEntityNotFound(_0x472bbc,null))[_0x943a('0x20')](removeEntity(_0x472bbc,null))[_0x943a('0x2b')](handleError(_0x472bbc,null));};exports[_0x943a('0x57')]=function(_0x1e7426,_0x16e674,_0x4cd353){var _0xdae9e0={};var _0x1ce4bc={};var _0x18f38f;var _0x580312;return db['DeskConfiguration']['findOne']({'where':{'id':_0x1e7426['params']['id']}})[_0x943a('0x20')](handleEntityNotFound(_0x16e674,null))[_0x943a('0x20')](function(_0x1e9764){if(_0x1e9764){_0x18f38f=_0x1e9764;_0x1ce4bc[_0x943a('0x40')]=_[_0x943a('0x53')](db[_0x943a('0x58')][_0x943a('0x3e')]);_0x1ce4bc['query']=_[_0x943a('0x53')](_0x1e7426[_0x943a('0x41')]);_0x1ce4bc[_0x943a('0x42')]=_[_0x943a('0x44')](_0x1ce4bc[_0x943a('0x40')],_0x1ce4bc[_0x943a('0x41')]);_0xdae9e0[_0x943a('0x43')]=_[_0x943a('0x44')](_0x1ce4bc[_0x943a('0x40')],qs[_0x943a('0x45')](_0x1e7426[_0x943a('0x41')][_0x943a('0x45')]));_0xdae9e0[_0x943a('0x43')]=_0xdae9e0[_0x943a('0x43')][_0x943a('0x46')]?_0xdae9e0[_0x943a('0x43')]:_0x1ce4bc['model'];_0xdae9e0[_0x943a('0x59')]=qs[_0x943a('0x48')](_0x1e7426[_0x943a('0x41')][_0x943a('0x48')]);_0xdae9e0[_0x943a('0x4b')]=qs[_0x943a('0x42')](_[_0x943a('0x49')](_0x1e7426[_0x943a('0x41')],_0x1ce4bc['filters']));if(_0x1e7426[_0x943a('0x41')][_0x943a('0x4a')]){_0xdae9e0[_0x943a('0x4b')]=_['merge'](_0xdae9e0['where'],{'$or':_['map'](_0xdae9e0[_0x943a('0x43')],function(_0x11d16f){var _0x2ea26b={};_0x2ea26b[_0x11d16f]={'$like':'%'+_0x1e7426[_0x943a('0x41')][_0x943a('0x4a')]+'%'};return _0x2ea26b;})});}_0xdae9e0=_[_0x943a('0x5a')]({},_0xdae9e0,_0x1e7426[_0x943a('0x4d')]);return _0x18f38f[_0x943a('0x57')](_0xdae9e0);}})[_0x943a('0x20')](function(_0x153f64){if(_0x153f64){_0x580312=_0x153f64[_0x943a('0x46')];if(!_0x1e7426[_0x943a('0x41')][_0x943a('0x5b')](_0x943a('0x47'))){_0xdae9e0[_0x943a('0x31')]=qs[_0x943a('0x31')](_0x1e7426['query'][_0x943a('0x31')]);_0xdae9e0[_0x943a('0x30')]=qs['offset'](_0x1e7426[_0x943a('0x41')][_0x943a('0x30')]);}return _0x18f38f['getFields'](_0xdae9e0);}})[_0x943a('0x20')](function(_0x4c98c3){if(_0x4c98c3){return _0x4c98c3?{'count':_0x580312,'rows':_0x4c98c3}:null;}})[_0x943a('0x20')](respondWithResult(_0x16e674,null))['catch'](handleError(_0x16e674,null));};exports[_0x943a('0x5c')]=function(_0x162e71,_0x1e95dc,_0x276730){var _0x4498f9={};var _0x4ba3cc={};var _0x454554;var _0x3a9536;return db[_0x943a('0x3d')][_0x943a('0x5d')]({'where':{'id':_0x162e71[_0x943a('0x52')]['id']}})['then'](handleEntityNotFound(_0x1e95dc,null))[_0x943a('0x20')](function(_0x31efef){if(_0x31efef){_0x454554=_0x31efef;_0x4ba3cc[_0x943a('0x40')]=_[_0x943a('0x53')](db[_0x943a('0x58')][_0x943a('0x3e')]);_0x4ba3cc[_0x943a('0x41')]=_[_0x943a('0x53')](_0x162e71[_0x943a('0x41')]);_0x4ba3cc['filters']=_['intersection'](_0x4ba3cc['model'],_0x4ba3cc[_0x943a('0x41')]);_0x4498f9[_0x943a('0x43')]=_[_0x943a('0x44')](_0x4ba3cc[_0x943a('0x40')],qs[_0x943a('0x45')](_0x162e71[_0x943a('0x41')][_0x943a('0x45')]));_0x4498f9[_0x943a('0x43')]=_0x4498f9[_0x943a('0x43')][_0x943a('0x46')]?_0x4498f9[_0x943a('0x43')]:_0x4ba3cc['model'];_0x4498f9[_0x943a('0x59')]=qs['sort'](_0x162e71[_0x943a('0x41')][_0x943a('0x48')]);_0x4498f9[_0x943a('0x4b')]=qs[_0x943a('0x42')](_[_0x943a('0x49')](_0x162e71[_0x943a('0x41')],_0x4ba3cc[_0x943a('0x42')]));if(_0x162e71['query'][_0x943a('0x4a')]){_0x4498f9['where']=_[_0x943a('0x5a')](_0x4498f9[_0x943a('0x4b')],{'$or':_[_0x943a('0x4c')](_0x4498f9[_0x943a('0x43')],function(_0x64678){var _0x2db6b3={};_0x2db6b3[_0x64678]={'$like':'%'+_0x162e71[_0x943a('0x41')][_0x943a('0x4a')]+'%'};return _0x2db6b3;})});}_0x4498f9=_['merge']({},_0x4498f9,_0x162e71['options']);return _0x454554[_0x943a('0x5c')](_0x4498f9);}})['then'](function(_0x5943f6){if(_0x5943f6){_0x3a9536=_0x5943f6[_0x943a('0x46')];if(!_0x162e71[_0x943a('0x41')][_0x943a('0x5b')](_0x943a('0x47'))){_0x4498f9[_0x943a('0x31')]=qs[_0x943a('0x31')](_0x162e71[_0x943a('0x41')][_0x943a('0x31')]);_0x4498f9['offset']=qs[_0x943a('0x30')](_0x162e71['query'][_0x943a('0x30')]);}return _0x454554[_0x943a('0x5c')](_0x4498f9);}})[_0x943a('0x20')](function(_0x41aa5a){if(_0x41aa5a){return _0x41aa5a?{'count':_0x3a9536,'rows':_0x41aa5a}:null;}})[_0x943a('0x20')](respondWithResult(_0x1e95dc,null))[_0x943a('0x2b')](handleError(_0x1e95dc,null));};exports[_0x943a('0x5e')]=function(_0x5542e1,_0x11a47a,_0x54ad0e){var _0x106a45={};var _0x3fc5b0={};var _0x111f96;var _0x165104;return db[_0x943a('0x3d')]['findOne']({'where':{'id':_0x5542e1[_0x943a('0x52')]['id']}})['then'](handleEntityNotFound(_0x11a47a,null))[_0x943a('0x20')](function(_0x388dcd){if(_0x388dcd){_0x111f96=_0x388dcd;_0x3fc5b0[_0x943a('0x40')]=_['keys'](db[_0x943a('0x58')][_0x943a('0x3e')]);_0x3fc5b0[_0x943a('0x41')]=_['keys'](_0x5542e1[_0x943a('0x41')]);_0x3fc5b0[_0x943a('0x42')]=_['intersection'](_0x3fc5b0[_0x943a('0x40')],_0x3fc5b0[_0x943a('0x41')]);_0x106a45[_0x943a('0x43')]=_[_0x943a('0x44')](_0x3fc5b0[_0x943a('0x40')],qs['fields'](_0x5542e1[_0x943a('0x41')][_0x943a('0x45')]));_0x106a45[_0x943a('0x43')]=_0x106a45[_0x943a('0x43')][_0x943a('0x46')]?_0x106a45['attributes']:_0x3fc5b0['model'];_0x106a45[_0x943a('0x59')]=qs[_0x943a('0x48')](_0x5542e1[_0x943a('0x41')][_0x943a('0x48')]);_0x106a45[_0x943a('0x4b')]=qs[_0x943a('0x42')](_[_0x943a('0x49')](_0x5542e1['query'],_0x3fc5b0[_0x943a('0x42')]));if(_0x5542e1[_0x943a('0x41')]['filter']){_0x106a45[_0x943a('0x4b')]=_['merge'](_0x106a45[_0x943a('0x4b')],{'$or':_['map'](_0x106a45[_0x943a('0x43')],function(_0x52b7e2){var _0x37ca24={};_0x37ca24[_0x52b7e2]={'$like':'%'+_0x5542e1[_0x943a('0x41')][_0x943a('0x4a')]+'%'};return _0x37ca24;})});}_0x106a45=_[_0x943a('0x5a')]({},_0x106a45,_0x5542e1[_0x943a('0x4d')]);return _0x111f96[_0x943a('0x5e')](_0x106a45);}})[_0x943a('0x20')](function(_0x3fcdb1){if(_0x3fcdb1){_0x165104=_0x3fcdb1[_0x943a('0x46')];if(!_0x5542e1[_0x943a('0x41')]['hasOwnProperty'](_0x943a('0x47'))){_0x106a45['limit']=qs['limit'](_0x5542e1[_0x943a('0x41')]['limit']);_0x106a45[_0x943a('0x30')]=qs['offset'](_0x5542e1[_0x943a('0x41')][_0x943a('0x30')]);}return _0x111f96['getDescriptions'](_0x106a45);}})[_0x943a('0x20')](function(_0x2d066f){if(_0x2d066f){return _0x2d066f?{'count':_0x165104,'rows':_0x2d066f}:null;}})['then'](respondWithResult(_0x11a47a,null))['catch'](handleError(_0x11a47a,null));};exports[_0x943a('0x5f')]=function(_0x105422,_0x48e694,_0x5caad6){var _0x5b4df1={};var _0x46a503={};var _0x156bbc;var _0xe4c33c;return db[_0x943a('0x3d')][_0x943a('0x5d')]({'where':{'id':_0x105422[_0x943a('0x52')]['id']}})[_0x943a('0x20')](handleEntityNotFound(_0x48e694,null))[_0x943a('0x20')](function(_0x1df7c6){if(_0x1df7c6){_0x156bbc=_0x1df7c6;_0x46a503[_0x943a('0x40')]=_[_0x943a('0x53')](db[_0x943a('0x60')][_0x943a('0x3e')]);_0x46a503[_0x943a('0x41')]=_[_0x943a('0x53')](_0x105422[_0x943a('0x41')]);_0x46a503['filters']=_['intersection'](_0x46a503[_0x943a('0x40')],_0x46a503[_0x943a('0x41')]);_0x5b4df1[_0x943a('0x43')]=_[_0x943a('0x44')](_0x46a503[_0x943a('0x40')],qs[_0x943a('0x45')](_0x105422[_0x943a('0x41')][_0x943a('0x45')]));_0x5b4df1[_0x943a('0x43')]=_0x5b4df1[_0x943a('0x43')][_0x943a('0x46')]?_0x5b4df1[_0x943a('0x43')]:_0x46a503[_0x943a('0x40')];_0x5b4df1[_0x943a('0x59')]=qs[_0x943a('0x48')](_0x105422[_0x943a('0x41')][_0x943a('0x48')]);_0x5b4df1[_0x943a('0x4b')]=qs[_0x943a('0x42')](_[_0x943a('0x49')](_0x105422[_0x943a('0x41')],_0x46a503[_0x943a('0x42')]));if(_0x105422[_0x943a('0x41')]['filter']){_0x5b4df1[_0x943a('0x4b')]=_[_0x943a('0x5a')](_0x5b4df1[_0x943a('0x4b')],{'$or':_['map'](_0x5b4df1[_0x943a('0x43')],function(_0x4048c5){var _0xd2e6a9={};_0xd2e6a9[_0x4048c5]={'$like':'%'+_0x105422[_0x943a('0x41')]['filter']+'%'};return _0xd2e6a9;})});}_0x5b4df1=_[_0x943a('0x5a')]({},_0x5b4df1,_0x105422[_0x943a('0x4d')]);return _0x156bbc['getTags'](_0x5b4df1);}})[_0x943a('0x20')](function(_0x380943){if(_0x380943){_0xe4c33c=_0x380943[_0x943a('0x46')];if(!_0x105422[_0x943a('0x41')][_0x943a('0x5b')](_0x943a('0x47'))){_0x5b4df1[_0x943a('0x31')]=qs[_0x943a('0x31')](_0x105422[_0x943a('0x41')][_0x943a('0x31')]);_0x5b4df1[_0x943a('0x30')]=qs['offset'](_0x105422[_0x943a('0x41')][_0x943a('0x30')]);}return _0x156bbc[_0x943a('0x5f')](_0x5b4df1);}})[_0x943a('0x20')](function(_0xa91d8d){if(_0xa91d8d){return _0xa91d8d?{'count':_0xe4c33c,'rows':_0xa91d8d}:null;}})[_0x943a('0x20')](respondWithResult(_0x48e694,null))['catch'](handleError(_0x48e694,null));};exports[_0x943a('0x61')]=function(_0x240cef,_0x188ab2,_0x2f9d91){if(_0x240cef[_0x943a('0x56')]['id']){delete _0x240cef[_0x943a('0x56')]['id'];}return db[_0x943a('0x3d')][_0x943a('0x5d')]({'where':{'id':_0x240cef[_0x943a('0x52')]['id']}})['then'](handleEntityNotFound(_0x188ab2,null))[_0x943a('0x20')](function(_0xc95df6){if(_0xc95df6){return _0xc95df6[_0x943a('0x61')](_0x240cef['body']['ids']||[]);}return null;})[_0x943a('0x20')](respondWithResult(_0x188ab2,null))['catch'](handleError(_0x188ab2,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 41a6fe2..a1ab36b 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 _0x7be1=['exports','DeskConfiguration','int_desk_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x365c13,_0x1c55e2){var _0x530e8b=function(_0x33242e){while(--_0x33242e){_0x365c13['push'](_0x365c13['shift']());}};_0x530e8b(++_0x1c55e2);}(_0x7be1,0xdb));var _0x17be=function(_0x5bcd23,_0x1242f1){_0x5bcd23=_0x5bcd23-0x0;var _0x17ec3c=_0x7be1[_0x5bcd23];return _0x17ec3c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x17be('0x0'))(_0x17be('0x1'));var moment=require(_0x17be('0x2'));var BPromise=require(_0x17be('0x3'));var rp=require(_0x17be('0x4'));var fs=require('fs');var path=require(_0x17be('0x5'));var rimraf=require(_0x17be('0x6'));var config=require(_0x17be('0x7'));var attributes=require(_0x17be('0x8'));module[_0x17be('0x9')]=function(_0x1769fb,_0x3ff647){return _0x1769fb['define'](_0x17be('0xa'),attributes,{'tableName':_0x17be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c62=['rimraf','../../config/environment','./intDeskConfiguration.attributes','lodash','util','api','moment','request-promise','path'];(function(_0x3d6d4e,_0x44be00){var _0xa6f07c=function(_0x3a9df1){while(--_0x3a9df1){_0x3d6d4e['push'](_0x3d6d4e['shift']());}};_0xa6f07c(++_0x44be00);}(_0x7c62,0x108));var _0x27c6=function(_0x2321f6,_0x11ce8c){_0x2321f6=_0x2321f6-0x0;var _0x279b7e=_0x7c62[_0x2321f6];return _0x279b7e;};'use strict';var _=require(_0x27c6('0x0'));var util=require(_0x27c6('0x1'));var logger=require('../../config/logger')(_0x27c6('0x2'));var moment=require(_0x27c6('0x3'));var BPromise=require('bluebird');var rp=require(_0x27c6('0x4'));var fs=require('fs');var path=require(_0x27c6('0x5'));var rimraf=require(_0x27c6('0x6'));var config=require(_0x27c6('0x7'));var attributes=require(_0x27c6('0x8'));module['exports']=function(_0xbac69a,_0x3b36da){return _0xbac69a['define']('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index c059d0a..f77e5ee 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 _0x9bb4=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x9bb4,0xd5));var _0x49bb=function(_0x22e9b0,_0x11e51c){_0x22e9b0=_0x22e9b0-0x0;var _0x460821=_0x9bb4[_0x22e9b0];return _0x460821;};'use strict';var _=require(_0x49bb('0x0'));var util=require(_0x49bb('0x1'));var moment=require(_0x49bb('0x2'));var BPromise=require(_0x49bb('0x3'));var rs=require(_0x49bb('0x4'));var fs=require('fs');var Redis=require(_0x49bb('0x5'));var db=require(_0x49bb('0x6'))['db'];var utils=require(_0x49bb('0x7'));var logger=require(_0x49bb('0x8'))('rpc');var config=require(_0x49bb('0x9'));var jayson=require(_0x49bb('0xa'));var client=jayson[_0x49bb('0xb')][_0x49bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d603d,_0x15c24c,_0x353853){return new BPromise(function(_0x1a4094,_0x2967d4){return client[_0x49bb('0xd')](_0x4d603d,_0x353853)['then'](function(_0x6ba4a2){logger['info'](_0x49bb('0xe'),_0x15c24c,_0x49bb('0xf'));logger['debug'](_0x49bb('0x10'),_0x15c24c,'request\x20sent',JSON['stringify'](_0x6ba4a2));if(_0x6ba4a2[_0x49bb('0x11')]){if(_0x6ba4a2['error'][_0x49bb('0x12')]===0x1f4){logger[_0x49bb('0x11')](_0x49bb('0xe'),_0x15c24c,_0x6ba4a2[_0x49bb('0x11')][_0x49bb('0x13')]);return _0x2967d4(_0x6ba4a2[_0x49bb('0x11')][_0x49bb('0x13')]);}logger[_0x49bb('0x11')](_0x49bb('0xe'),_0x15c24c,_0x6ba4a2['error'][_0x49bb('0x13')]);return _0x1a4094(_0x6ba4a2['error'][_0x49bb('0x13')]);}else{logger[_0x49bb('0x14')](_0x49bb('0xe'),_0x15c24c,_0x49bb('0xf'));_0x1a4094(_0x6ba4a2[_0x49bb('0x15')][_0x49bb('0x13')]);}})[_0x49bb('0x16')](function(_0x11bc5f){logger['error'](_0x49bb('0xe'),_0x15c24c,_0x11bc5f);_0x2967d4(_0x11bc5f);});});} \ No newline at end of file +var _0x949d=['../../config/environment','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x307ee9,_0x145e8b){var _0x2b3fbe=function(_0x30f0e0){while(--_0x30f0e0){_0x307ee9['push'](_0x307ee9['shift']());}};_0x2b3fbe(++_0x145e8b);}(_0x949d,0x162));var _0xd949=function(_0x336402,_0x354cf4){_0x336402=_0x336402-0x0;var _0x4840a9=_0x949d[_0x336402];return _0x4840a9;};'use strict';var _=require(_0xd949('0x0'));var util=require(_0xd949('0x1'));var moment=require(_0xd949('0x2'));var BPromise=require(_0xd949('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd949('0x4'))['db'];var utils=require(_0xd949('0x5'));var logger=require('../../config/logger')(_0xd949('0x6'));var config=require(_0xd949('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd949('0x8')][_0xd949('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6e8175,_0x5e90f2,_0x208942){return new BPromise(function(_0x158cc2,_0x49b70a){return client['request'](_0x6e8175,_0x208942)[_0xd949('0xa')](function(_0x1bbff8){logger[_0xd949('0xb')](_0xd949('0xc'),_0x5e90f2,_0xd949('0xd'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5e90f2,_0xd949('0xd'),JSON[_0xd949('0xe')](_0x1bbff8));if(_0x1bbff8[_0xd949('0xf')]){if(_0x1bbff8[_0xd949('0xf')]['code']===0x1f4){logger[_0xd949('0xf')](_0xd949('0xc'),_0x5e90f2,_0x1bbff8[_0xd949('0xf')][_0xd949('0x10')]);return _0x49b70a(_0x1bbff8[_0xd949('0xf')][_0xd949('0x10')]);}logger[_0xd949('0xf')](_0xd949('0xc'),_0x5e90f2,_0x1bbff8['error'][_0xd949('0x10')]);return _0x158cc2(_0x1bbff8[_0xd949('0xf')][_0xd949('0x10')]);}else{logger[_0xd949('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x5e90f2,_0xd949('0xd'));_0x158cc2(_0x1bbff8[_0xd949('0x11')][_0xd949('0x10')]);}})[_0xd949('0x12')](function(_0xf5af){logger[_0xd949('0xf')](_0xd949('0xc'),_0x5e90f2,_0xf5af);_0x49b70a(_0xf5af);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index bc1bd71..7dc087a 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 _0xb84b=['exports','util','path','connect-timeout','Router','../../components/auth/service','./intDeskField.controller','isAuthenticated','index','get','show','create','put','/:id','destroy'];(function(_0x132625,_0x11ed59){var _0xf6d38f=function(_0x391ce8){while(--_0x391ce8){_0x132625['push'](_0x132625['shift']());}};_0xf6d38f(++_0x11ed59);}(_0xb84b,0x10f));var _0xbb84=function(_0x302fca,_0x31e1c3){_0x302fca=_0x302fca-0x0;var _0x9d732e=_0xb84b[_0x302fca];return _0x9d732e;};'use strict';var multer=require('multer');var util=require(_0xbb84('0x0'));var path=require(_0xbb84('0x1'));var timeout=require(_0xbb84('0x2'));var express=require('express');var router=express[_0xbb84('0x3')]();var auth=require(_0xbb84('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbb84('0x5'));router['get']('/',auth[_0xbb84('0x6')](),controller[_0xbb84('0x7')]);router[_0xbb84('0x8')]('/:id',auth[_0xbb84('0x6')](),controller[_0xbb84('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbb84('0xa')]);router[_0xbb84('0xb')](_0xbb84('0xc'),auth[_0xbb84('0x6')](),controller['update']);router['delete']('/:id',auth[_0xbb84('0x6')](),controller[_0xbb84('0xd')]);module[_0xbb84('0xe')]=router; \ No newline at end of file +var _0x345d=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','/:id','isAuthenticated','show','post'];(function(_0x57025e,_0x1c645f){var _0xa7d5fa=function(_0x5d6799){while(--_0x5d6799){_0x57025e['push'](_0x57025e['shift']());}};_0xa7d5fa(++_0x1c645f);}(_0x345d,0x182));var _0xd345=function(_0x48a296,_0x9a3870){_0x48a296=_0x48a296-0x0;var _0x5a66d4=_0x345d[_0x48a296];return _0x5a66d4;};'use strict';var multer=require(_0xd345('0x0'));var util=require(_0xd345('0x1'));var path=require('path');var timeout=require(_0xd345('0x2'));var express=require(_0xd345('0x3'));var router=express[_0xd345('0x4')]();var auth=require(_0xd345('0x5'));var interaction=require(_0xd345('0x6'));var config=require('../../config/environment');var controller=require(_0xd345('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd345('0x8')](_0xd345('0x9'),auth[_0xd345('0xa')](),controller[_0xd345('0xb')]);router[_0xd345('0xc')]('/',auth[_0xd345('0xa')](),controller[_0xd345('0xd')]);router[_0xd345('0xe')](_0xd345('0x9'),auth[_0xd345('0xa')](),controller[_0xd345('0xf')]);router[_0xd345('0x10')](_0xd345('0x9'),auth['isAuthenticated'](),controller[_0xd345('0x11')]);module[_0xd345('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 4a0cbd1..8cf70fd 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 _0x1499=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x1499,0x83));var _0x9149=function(_0x1bda9c,_0x1c8fc8){_0x1bda9c=_0x1bda9c-0x0;var _0x1d0ba6=_0x1499[_0x1bda9c];return _0x1d0ba6;};'use strict';var Sequelize=require(_0x9149('0x0'));module[_0x9149('0x1')]={'type':{'type':Sequelize[_0x9149('0x2')](_0x9149('0x3'),'variable',_0x9149('0x4'),_0x9149('0x5')),'defaultValue':_0x9149('0x3')},'content':{'type':Sequelize[_0x9149('0x6')]},'key':{'type':Sequelize[_0x9149('0x6')]},'keyType':{'type':Sequelize[_0x9149('0x2')](_0x9149('0x3'),'variable',_0x9149('0x4'))},'keyContent':{'type':Sequelize[_0x9149('0x6')]},'idField':{'type':Sequelize[_0x9149('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9149('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9149('0x6')]}}; \ No newline at end of file +var _0x64f4=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x5f4400,_0xf8f000){var _0x547b3d=function(_0x19a1fe){while(--_0x19a1fe){_0x5f4400['push'](_0x5f4400['shift']());}};_0x547b3d(++_0xf8f000);}(_0x64f4,0x15f));var _0x464f=function(_0x1fa734,_0x638ecf){_0x1fa734=_0x1fa734-0x0;var _0x27b129=_0x64f4[_0x1fa734];return _0x27b129;};'use strict';var Sequelize=require(_0x464f('0x0'));module[_0x464f('0x1')]={'type':{'type':Sequelize[_0x464f('0x2')](_0x464f('0x3'),_0x464f('0x4'),_0x464f('0x5'),_0x464f('0x6')),'defaultValue':_0x464f('0x3')},'content':{'type':Sequelize[_0x464f('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x464f('0x2')](_0x464f('0x3'),_0x464f('0x4'),_0x464f('0x5'))},'keyContent':{'type':Sequelize[_0x464f('0x7')]},'idField':{'type':Sequelize[_0x464f('0x7')]},'nameField':{'type':Sequelize[_0x464f('0x7')]},'customField':{'type':Sequelize[_0x464f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x464f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index b3c5b9a..4b8679c 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 _0xedd9=['offset','limit','Content-Range','reject','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','DeskField','includeAll','catch','show','params','include','options','create','body','find','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(_0x1f2c7e,_0x29d121){var _0x720633=function(_0x5b29ef){while(--_0x5b29ef){_0x1f2c7e['push'](_0x1f2c7e['shift']());}};_0x720633(++_0x29d121);}(_0xedd9,0xfc));var _0x9edd=function(_0xb17696,_0xbf3738){_0xb17696=_0xb17696-0x0;var _0x80b44e=_0xedd9[_0xb17696];return _0x80b44e;};'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={},_0x57a2cc={},_0x214d0a={'count':0x0,'rows':[]};var _0x257a26=_[_0x9edd('0x27')](db['DeskField'][_0x9edd('0x28')],function(_0x28cfae){return{'name':_0x28cfae[_0x9edd('0x29')],'type':_0x28cfae[_0x9edd('0x2a')]['key']};});_0x57a2cc[_0x9edd('0x2b')]=_[_0x9edd('0x27')](_0x257a26,_0x9edd('0x2c'));_0x57a2cc[_0x9edd('0x2d')]=_[_0x9edd('0x2e')](_0x25e135[_0x9edd('0x2d')]);_0x57a2cc[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x57a2cc[_0x9edd('0x2b')],_0x57a2cc[_0x9edd('0x2d')]);_0x4fe471[_0x9edd('0x31')]=_[_0x9edd('0x30')](_0x57a2cc[_0x9edd('0x2b')],qs[_0x9edd('0x32')](_0x25e135[_0x9edd('0x2d')]['fields']));_0x4fe471[_0x9edd('0x31')]=_0x4fe471[_0x9edd('0x31')][_0x9edd('0x33')]?_0x4fe471['attributes']:_0x57a2cc[_0x9edd('0x2b')];if(!_0x25e135[_0x9edd('0x2d')][_0x9edd('0x34')](_0x9edd('0x35'))){_0x4fe471[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x25e135[_0x9edd('0x2d')][_0x9edd('0x1d')]);_0x4fe471[_0x9edd('0x1c')]=qs[_0x9edd('0x1c')](_0x25e135[_0x9edd('0x2d')][_0x9edd('0x1c')]);}_0x4fe471[_0x9edd('0x36')]=qs[_0x9edd('0x37')](_0x25e135['query'][_0x9edd('0x37')]);_0x4fe471['where']=qs[_0x9edd('0x2f')](_[_0x9edd('0x38')](_0x25e135[_0x9edd('0x2d')],_0x57a2cc[_0x9edd('0x2f')]));if(_0x25e135[_0x9edd('0x2d')]['filter']){_0x4fe471[_0x9edd('0x39')]=_[_0x9edd('0x3a')](_0x4fe471[_0x9edd('0x39')],{'$or':_[_0x9edd('0x27')](_0x257a26,function(_0x1be77f){if(_0x1be77f[_0x9edd('0x2a')]!==_0x9edd('0x3b')){var _0x1cbbac={};_0x1cbbac[_0x1be77f[_0x9edd('0x2c')]]={'$like':'%'+_0x25e135[_0x9edd('0x2d')]['filter']+'%'};return _0x1cbbac;}})});}_0x4fe471=_[_0x9edd('0x3a')]({},_0x4fe471,_0x25e135['options']);var _0x3ef1d5={'where':_0x4fe471['where']};return db[_0x9edd('0x3c')][_0x9edd('0x1b')](_0x3ef1d5)[_0x9edd('0x21')](function(_0x479661){_0x214d0a[_0x9edd('0x1b')]=_0x479661;if(_0x25e135[_0x9edd('0x2d')][_0x9edd('0x3d')]){_0x4fe471['include']=[{'all':!![]}];}return db[_0x9edd('0x3c')]['findAll'](_0x4fe471);})[_0x9edd('0x21')](function(_0xfbc492){_0x214d0a['rows']=_0xfbc492;return _0x214d0a;})[_0x9edd('0x21')](respondWithFilteredResult(_0x3c2227,_0x4fe471))[_0x9edd('0x3e')](handleError(_0x3c2227,null));};exports[_0x9edd('0x3f')]=function(_0x810331,_0x492900){var _0x449f01={'raw':!![],'where':{'id':_0x810331[_0x9edd('0x40')]['id']}},_0x5bbdf8={};_0x5bbdf8[_0x9edd('0x2b')]=_['keys'](db[_0x9edd('0x3c')]['rawAttributes']);_0x5bbdf8['query']=_[_0x9edd('0x2e')](_0x810331[_0x9edd('0x2d')]);_0x5bbdf8[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x5bbdf8[_0x9edd('0x2b')],_0x5bbdf8[_0x9edd('0x2d')]);_0x449f01[_0x9edd('0x31')]=_[_0x9edd('0x30')](_0x5bbdf8[_0x9edd('0x2b')],qs[_0x9edd('0x32')](_0x810331[_0x9edd('0x2d')][_0x9edd('0x32')]));_0x449f01[_0x9edd('0x31')]=_0x449f01[_0x9edd('0x31')][_0x9edd('0x33')]?_0x449f01['attributes']:_0x5bbdf8[_0x9edd('0x2b')];if(_0x810331[_0x9edd('0x2d')][_0x9edd('0x3d')]){_0x449f01[_0x9edd('0x41')]=[{'all':!![]}];}_0x449f01=_[_0x9edd('0x3a')]({},_0x449f01,_0x810331[_0x9edd('0x42')]);return db[_0x9edd('0x3c')]['find'](_0x449f01)['then'](handleEntityNotFound(_0x492900,null))['then'](respondWithResult(_0x492900,null))[_0x9edd('0x3e')](handleError(_0x492900,null));};exports['create']=function(_0x8b1fdb,_0x19b56b){return db[_0x9edd('0x3c')][_0x9edd('0x43')](_0x8b1fdb[_0x9edd('0x44')],{})['then'](respondWithResult(_0x19b56b,0xc9))[_0x9edd('0x3e')](handleError(_0x19b56b,null));};exports[_0x9edd('0x20')]=function(_0x40e33d,_0x4a89ae){if(_0x40e33d[_0x9edd('0x44')]['id']){delete _0x40e33d[_0x9edd('0x44')]['id'];}return db[_0x9edd('0x3c')][_0x9edd('0x45')]({'where':{'id':_0x40e33d[_0x9edd('0x40')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x4a89ae,null))['then'](saveUpdates(_0x40e33d[_0x9edd('0x44')],null))[_0x9edd('0x21')](respondWithResult(_0x4a89ae,null))['catch'](handleError(_0x4a89ae,null));};exports[_0x9edd('0x22')]=function(_0x8d8701,_0x4bb324){return db[_0x9edd('0x3c')][_0x9edd('0x45')]({'where':{'id':_0x8d8701[_0x9edd('0x40')]['id']}})['then'](handleEntityNotFound(_0x4bb324,null))[_0x9edd('0x21')](removeEntity(_0x4bb324,null))[_0x9edd('0x3e')](handleError(_0x4bb324,null));}; \ No newline at end of file +var _0xe132=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','name','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','count','includeAll','include','findAll','catch','params','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash'];(function(_0x5c24d0,_0x2c6ded){var _0x18f479=function(_0x493bf2){while(--_0x493bf2){_0x5c24d0['push'](_0x5c24d0['shift']());}};_0x18f479(++_0x2c6ded);}(_0xe132,0x162));var _0x2e13=function(_0x5216bb,_0x516496){_0x5216bb=_0x5216bb-0x0;var _0x136e1e=_0xe132[_0x5216bb];return _0x136e1e;};'use strict';var pdf=require(_0x2e13('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2e13('0x1'));var zipdir=require(_0x2e13('0x2'));var jsonpatch=require(_0x2e13('0x3'));var rp=require(_0x2e13('0x4'));var moment=require(_0x2e13('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2e13('0x6'));var util=require(_0x2e13('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2e13('0x8'));var ejs=require(_0x2e13('0x9'));var fs=require('fs');var _=require(_0x2e13('0xa'));var squel=require(_0x2e13('0xb'));var crypto=require(_0x2e13('0xc'));var jsforce=require(_0x2e13('0xd'));var deskjs=require(_0x2e13('0xe'));var toCsv=require(_0x2e13('0x8'));var querystring=require(_0x2e13('0xf'));var Papa=require(_0x2e13('0x10'));var Redis=require('ioredis');var authService=require(_0x2e13('0x11'));var qs=require(_0x2e13('0x12'));var as=require(_0x2e13('0x13'));var hardwareService=require(_0x2e13('0x14'));var logger=require(_0x2e13('0x15'))(_0x2e13('0x16'));var utils=require(_0x2e13('0x17'));var config=require('../../config/environment');var db=require(_0x2e13('0x18'))['db'];function respondWithStatusCode(_0x441335,_0x320303){_0x320303=_0x320303||0xcc;return function(_0x299dd3){if(_0x299dd3){return _0x441335[_0x2e13('0x19')](_0x320303);}return _0x441335[_0x2e13('0x1a')](_0x320303)[_0x2e13('0x1b')]();};}function respondWithResult(_0x51f1a3,_0xb70eb8){_0xb70eb8=_0xb70eb8||0xc8;return function(_0xea6c20){if(_0xea6c20){return _0x51f1a3[_0x2e13('0x1a')](_0xb70eb8)['json'](_0xea6c20);}};}function respondWithFilteredResult(_0x4d7fa3,_0x2a58e5){return function(_0x433bbd){if(_0x433bbd){var _0x5e96a5=_0x433bbd['count'],_0xd25628=_0x2a58e5['offset'],_0x358a0d=_0x2a58e5[_0x2e13('0x1c')]+_0x2a58e5[_0x2e13('0x1d')],_0x1667b6;if(_0x358a0d>=_0x5e96a5){_0x358a0d=_0x5e96a5;_0x1667b6=0xc8;}else{_0x1667b6=0xce;}_0x4d7fa3[_0x2e13('0x1a')](_0x1667b6);return _0x4d7fa3[_0x2e13('0x1e')](_0x2e13('0x1f'),_0xd25628+'-'+_0x358a0d+'/'+_0x5e96a5)[_0x2e13('0x20')](_0x433bbd);}return null;};}function patchUpdates(_0x2496ee){return function(_0x226254){try{jsonpatch['apply'](_0x226254,_0x2496ee,!![]);}catch(_0x26bac1){return BPromise[_0x2e13('0x21')](_0x26bac1);}return _0x226254[_0x2e13('0x22')]();};}function saveUpdates(_0x173a27,_0x479013){return function(_0x5d6938){if(_0x5d6938){return _0x5d6938[_0x2e13('0x23')](_0x173a27)[_0x2e13('0x24')](function(_0x59c180){return _0x59c180;});}return null;};}function removeEntity(_0x4c769c,_0x584040){return function(_0x30f744){if(_0x30f744){return _0x30f744[_0x2e13('0x25')]()[_0x2e13('0x24')](function(){_0x4c769c[_0x2e13('0x1a')](0xcc)[_0x2e13('0x1b')]();});}};}function handleEntityNotFound(_0x2416b3,_0x5ce58b){return function(_0x1482fc){if(!_0x1482fc){_0x2416b3[_0x2e13('0x19')](0x194);}return _0x1482fc;};}function handleError(_0x943ffb,_0x2b1b79){_0x2b1b79=_0x2b1b79||0x1f4;return function(_0x20417c){logger[_0x2e13('0x26')](_0x20417c['stack']);if(_0x20417c[_0x2e13('0x27')]){delete _0x20417c[_0x2e13('0x27')];}_0x943ffb['status'](_0x2b1b79)['send'](_0x20417c);};}exports[_0x2e13('0x28')]=function(_0x468102,_0x279d9e){var _0x5a4ff6={},_0x227ef8={},_0x4504d3={'count':0x0,'rows':[]};var _0x3838a0=_[_0x2e13('0x29')](db[_0x2e13('0x2a')][_0x2e13('0x2b')],function(_0x103867){return{'name':_0x103867[_0x2e13('0x2c')],'type':_0x103867[_0x2e13('0x2d')][_0x2e13('0x2e')]};});_0x227ef8[_0x2e13('0x2f')]=_[_0x2e13('0x29')](_0x3838a0,_0x2e13('0x27'));_0x227ef8[_0x2e13('0x30')]=_[_0x2e13('0x31')](_0x468102['query']);_0x227ef8[_0x2e13('0x32')]=_[_0x2e13('0x33')](_0x227ef8[_0x2e13('0x2f')],_0x227ef8['query']);_0x5a4ff6['attributes']=_[_0x2e13('0x33')](_0x227ef8[_0x2e13('0x2f')],qs[_0x2e13('0x34')](_0x468102[_0x2e13('0x30')][_0x2e13('0x34')]));_0x5a4ff6[_0x2e13('0x35')]=_0x5a4ff6['attributes']['length']?_0x5a4ff6[_0x2e13('0x35')]:_0x227ef8[_0x2e13('0x2f')];if(!_0x468102[_0x2e13('0x30')][_0x2e13('0x36')](_0x2e13('0x37'))){_0x5a4ff6[_0x2e13('0x1d')]=qs[_0x2e13('0x1d')](_0x468102[_0x2e13('0x30')]['limit']);_0x5a4ff6[_0x2e13('0x1c')]=qs[_0x2e13('0x1c')](_0x468102[_0x2e13('0x30')][_0x2e13('0x1c')]);}_0x5a4ff6[_0x2e13('0x38')]=qs['sort'](_0x468102[_0x2e13('0x30')][_0x2e13('0x39')]);_0x5a4ff6['where']=qs[_0x2e13('0x32')](_[_0x2e13('0x3a')](_0x468102[_0x2e13('0x30')],_0x227ef8['filters']));if(_0x468102[_0x2e13('0x30')][_0x2e13('0x3b')]){_0x5a4ff6['where']=_[_0x2e13('0x3c')](_0x5a4ff6[_0x2e13('0x3d')],{'$or':_['map'](_0x3838a0,function(_0x2d0f31){if(_0x2d0f31['type']!==_0x2e13('0x3e')){var _0x20c4e3={};_0x20c4e3[_0x2d0f31['name']]={'$like':'%'+_0x468102[_0x2e13('0x30')][_0x2e13('0x3b')]+'%'};return _0x20c4e3;}})});}_0x5a4ff6=_[_0x2e13('0x3c')]({},_0x5a4ff6,_0x468102[_0x2e13('0x3f')]);var _0x20ae95={'where':_0x5a4ff6[_0x2e13('0x3d')]};return db[_0x2e13('0x2a')][_0x2e13('0x40')](_0x20ae95)[_0x2e13('0x24')](function(_0x1cca7f){_0x4504d3['count']=_0x1cca7f;if(_0x468102[_0x2e13('0x30')][_0x2e13('0x41')]){_0x5a4ff6[_0x2e13('0x42')]=[{'all':!![]}];}return db[_0x2e13('0x2a')][_0x2e13('0x43')](_0x5a4ff6);})['then'](function(_0x37d997){_0x4504d3['rows']=_0x37d997;return _0x4504d3;})[_0x2e13('0x24')](respondWithFilteredResult(_0x279d9e,_0x5a4ff6))[_0x2e13('0x44')](handleError(_0x279d9e,null));};exports['show']=function(_0x432ec7,_0x54feeb){var _0x73f6a2={'raw':!![],'where':{'id':_0x432ec7[_0x2e13('0x45')]['id']}},_0x790564={};_0x790564[_0x2e13('0x2f')]=_[_0x2e13('0x31')](db['DeskField'][_0x2e13('0x2b')]);_0x790564['query']=_[_0x2e13('0x31')](_0x432ec7[_0x2e13('0x30')]);_0x790564[_0x2e13('0x32')]=_[_0x2e13('0x33')](_0x790564[_0x2e13('0x2f')],_0x790564[_0x2e13('0x30')]);_0x73f6a2['attributes']=_['intersection'](_0x790564[_0x2e13('0x2f')],qs[_0x2e13('0x34')](_0x432ec7['query'][_0x2e13('0x34')]));_0x73f6a2[_0x2e13('0x35')]=_0x73f6a2[_0x2e13('0x35')]['length']?_0x73f6a2['attributes']:_0x790564[_0x2e13('0x2f')];if(_0x432ec7['query']['includeAll']){_0x73f6a2[_0x2e13('0x42')]=[{'all':!![]}];}_0x73f6a2=_[_0x2e13('0x3c')]({},_0x73f6a2,_0x432ec7[_0x2e13('0x3f')]);return db['DeskField'][_0x2e13('0x46')](_0x73f6a2)[_0x2e13('0x24')](handleEntityNotFound(_0x54feeb,null))[_0x2e13('0x24')](respondWithResult(_0x54feeb,null))[_0x2e13('0x44')](handleError(_0x54feeb,null));};exports['create']=function(_0x1131bf,_0x52697e){return db[_0x2e13('0x2a')][_0x2e13('0x47')](_0x1131bf[_0x2e13('0x48')],{})[_0x2e13('0x24')](respondWithResult(_0x52697e,0xc9))[_0x2e13('0x44')](handleError(_0x52697e,null));};exports[_0x2e13('0x23')]=function(_0x961af7,_0x8e8b86){if(_0x961af7[_0x2e13('0x48')]['id']){delete _0x961af7[_0x2e13('0x48')]['id'];}return db['DeskField'][_0x2e13('0x46')]({'where':{'id':_0x961af7[_0x2e13('0x45')]['id']}})[_0x2e13('0x24')](handleEntityNotFound(_0x8e8b86,null))[_0x2e13('0x24')](saveUpdates(_0x961af7[_0x2e13('0x48')],null))[_0x2e13('0x24')](respondWithResult(_0x8e8b86,null))[_0x2e13('0x44')](handleError(_0x8e8b86,null));};exports[_0x2e13('0x25')]=function(_0x74076a,_0x28010f){return db[_0x2e13('0x2a')][_0x2e13('0x46')]({'where':{'id':_0x74076a['params']['id']}})[_0x2e13('0x24')](handleEntityNotFound(_0x28010f,null))[_0x2e13('0x24')](removeEntity(_0x28010f,null))[_0x2e13('0x44')](handleError(_0x28010f,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index d9009da..fad777d 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 _0xad90=['./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4e5917,_0x56ab60){var _0x3ac16a=function(_0x4eade7){while(--_0x4eade7){_0x4e5917['push'](_0x4e5917['shift']());}};_0x3ac16a(++_0x56ab60);}(_0xad90,0xf5));var _0x0ad9=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0xad90[_0x152121];return _0x592a85;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0ad9('0x0'))(_0x0ad9('0x1'));var moment=require(_0x0ad9('0x2'));var BPromise=require(_0x0ad9('0x3'));var rp=require(_0x0ad9('0x4'));var fs=require('fs');var path=require(_0x0ad9('0x5'));var rimraf=require('rimraf');var config=require(_0x0ad9('0x6'));var attributes=require(_0x0ad9('0x7'));module[_0x0ad9('0x8')]=function(_0x4b1660,_0x59657c){return _0x4b1660[_0x0ad9('0x9')]('DeskField',attributes,{'tableName':_0x0ad9('0xa'),'paranoid':![],'indexes':[{'name':_0x0ad9('0xb'),'fields':[_0x0ad9('0xc'),_0x0ad9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x322c=['int_desk_fields','idField','FieldId','lodash','util','api','moment','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField'];(function(_0x3fe988,_0x149b45){var _0x62ef22=function(_0x1367f1){while(--_0x1367f1){_0x3fe988['push'](_0x3fe988['shift']());}};_0x62ef22(++_0x149b45);}(_0x322c,0x162));var _0xc322=function(_0x1d73c6,_0x1c08f4){_0x1d73c6=_0x1d73c6-0x0;var _0x2bc9e7=_0x322c[_0x1d73c6];return _0x2bc9e7;};'use strict';var _=require(_0xc322('0x0'));var util=require(_0xc322('0x1'));var logger=require('../../config/logger')(_0xc322('0x2'));var moment=require(_0xc322('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc322('0x4'));var config=require(_0xc322('0x5'));var attributes=require(_0xc322('0x6'));module[_0xc322('0x7')]=function(_0xae603e,_0x3c00d1){return _0xae603e[_0xc322('0x8')](_0xc322('0x9'),attributes,{'tableName':_0xc322('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xc322('0xb'),_0xc322('0xc')],'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 9cc52a3..ed4926f 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 _0x1072=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1072,0x134));var _0x2107=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x1072[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x2107('0x0'));var util=require('util');var moment=require(_0x2107('0x1'));var BPromise=require('bluebird');var rs=require(_0x2107('0x2'));var fs=require('fs');var Redis=require(_0x2107('0x3'));var db=require(_0x2107('0x4'))['db'];var utils=require(_0x2107('0x5'));var logger=require(_0x2107('0x6'))('rpc');var config=require(_0x2107('0x7'));var jayson=require(_0x2107('0x8'));var client=jayson[_0x2107('0x9')][_0x2107('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b9ae3,_0x2063e1,_0xfd6236){return new BPromise(function(_0x4108cd,_0x26ce13){return client[_0x2107('0xb')](_0x1b9ae3,_0xfd6236)[_0x2107('0xc')](function(_0x1238a3){logger[_0x2107('0xd')](_0x2107('0xe'),_0x2063e1,_0x2107('0xf'));logger[_0x2107('0x10')](_0x2107('0x11'),_0x2063e1,_0x2107('0xf'),JSON[_0x2107('0x12')](_0x1238a3));if(_0x1238a3[_0x2107('0x13')]){if(_0x1238a3[_0x2107('0x13')][_0x2107('0x14')]===0x1f4){logger[_0x2107('0x13')](_0x2107('0xe'),_0x2063e1,_0x1238a3[_0x2107('0x13')]['message']);return _0x26ce13(_0x1238a3[_0x2107('0x13')][_0x2107('0x15')]);}logger['error'](_0x2107('0xe'),_0x2063e1,_0x1238a3[_0x2107('0x13')][_0x2107('0x15')]);return _0x4108cd(_0x1238a3[_0x2107('0x13')][_0x2107('0x15')]);}else{logger[_0x2107('0xd')](_0x2107('0xe'),_0x2063e1,_0x2107('0xf'));_0x4108cd(_0x1238a3[_0x2107('0x16')][_0x2107('0x15')]);}})[_0x2107('0x17')](function(_0x2ca9e5){logger[_0x2107('0x13')]('DeskField,\x20%s,\x20%s',_0x2063e1,_0x2ca9e5);_0x26ce13(_0x2ca9e5);});});} \ No newline at end of file +var _0xc299=['DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0xcf244f,_0xff2170){var _0x4676b6=function(_0x594fd0){while(--_0x594fd0){_0xcf244f['push'](_0xcf244f['shift']());}};_0x4676b6(++_0xff2170);}(_0xc299,0x18f));var _0x9c29=function(_0x3beea0,_0x416691){_0x3beea0=_0x3beea0-0x0;var _0x314eb1=_0xc299[_0x3beea0];return _0x314eb1;};'use strict';var _=require('lodash');var util=require(_0x9c29('0x0'));var moment=require(_0x9c29('0x1'));var BPromise=require(_0x9c29('0x2'));var rs=require(_0x9c29('0x3'));var fs=require('fs');var Redis=require(_0x9c29('0x4'));var db=require(_0x9c29('0x5'))['db'];var utils=require(_0x9c29('0x6'));var logger=require(_0x9c29('0x7'))(_0x9c29('0x8'));var config=require(_0x9c29('0x9'));var jayson=require(_0x9c29('0xa'));var client=jayson[_0x9c29('0xb')][_0x9c29('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x205dc3,_0x2e250c,_0x36ba08){return new BPromise(function(_0x2ae86f,_0x9f64d3){return client[_0x9c29('0xd')](_0x205dc3,_0x36ba08)[_0x9c29('0xe')](function(_0x4e4cef){logger['info']('DeskField,\x20%s,\x20%s',_0x2e250c,_0x9c29('0xf'));logger[_0x9c29('0x10')](_0x9c29('0x11'),_0x2e250c,_0x9c29('0xf'),JSON[_0x9c29('0x12')](_0x4e4cef));if(_0x4e4cef['error']){if(_0x4e4cef[_0x9c29('0x13')][_0x9c29('0x14')]===0x1f4){logger[_0x9c29('0x13')](_0x9c29('0x15'),_0x2e250c,_0x4e4cef[_0x9c29('0x13')][_0x9c29('0x16')]);return _0x9f64d3(_0x4e4cef[_0x9c29('0x13')][_0x9c29('0x16')]);}logger[_0x9c29('0x13')](_0x9c29('0x15'),_0x2e250c,_0x4e4cef['error'][_0x9c29('0x16')]);return _0x2ae86f(_0x4e4cef[_0x9c29('0x13')]['message']);}else{logger[_0x9c29('0x17')](_0x9c29('0x15'),_0x2e250c,_0x9c29('0xf'));_0x2ae86f(_0x4e4cef[_0x9c29('0x18')][_0x9c29('0x16')]);}})[_0x9c29('0x19')](function(_0x14361f){logger[_0x9c29('0x13')](_0x9c29('0x15'),_0x2e250c,_0x14361f);_0x9f64d3(_0x14361f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 337ffcc..9c5f784 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 _0x7bc6=['/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','delete','destroy','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getConfigurations'];(function(_0x414a33,_0x5bf179){var _0x1922bd=function(_0xa5ca9c){while(--_0xa5ca9c){_0x414a33['push'](_0x414a33['shift']());}};_0x1922bd(++_0x5bf179);}(_0x7bc6,0x15e));var _0x67bc=function(_0x57a4d0,_0xa6e6b){_0x57a4d0=_0x57a4d0-0x0;var _0xaaadee=_0x7bc6[_0x57a4d0];return _0xaaadee;};'use strict';var multer=require(_0x67bc('0x0'));var util=require(_0x67bc('0x1'));var path=require('path');var timeout=require(_0x67bc('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x67bc('0x3'));var config=require(_0x67bc('0x4'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0x67bc('0x5')](),controller[_0x67bc('0x6')]);router[_0x67bc('0x7')](_0x67bc('0x8'),auth[_0x67bc('0x5')](),controller[_0x67bc('0x9')]);router[_0x67bc('0x7')]('/:id/configurations',auth[_0x67bc('0x5')](),controller[_0x67bc('0xa')]);router[_0x67bc('0x7')](_0x67bc('0xb'),auth[_0x67bc('0x5')](),controller[_0x67bc('0xc')]);router[_0x67bc('0xd')]('/',auth[_0x67bc('0x5')](),controller[_0x67bc('0xe')]);router['post'](_0x67bc('0xf'),auth[_0x67bc('0x5')](),controller[_0x67bc('0x10')]);router['put'](_0x67bc('0x8'),auth[_0x67bc('0x5')](),controller['update']);router[_0x67bc('0x11')]('/:id',auth[_0x67bc('0x5')](),controller[_0x67bc('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9a0f=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','post','update','delete','exports','multer','util'];(function(_0xe7fc64,_0x536d20){var _0x9af0d7=function(_0x5e8110){while(--_0x5e8110){_0xe7fc64['push'](_0xe7fc64['shift']());}};_0x9af0d7(++_0x536d20);}(_0x9a0f,0x18a));var _0xf9a0=function(_0x583125,_0x34c12b){_0x583125=_0x583125-0x0;var _0x118c4d=_0x9a0f[_0x583125];return _0x118c4d;};'use strict';var multer=require(_0xf9a0('0x0'));var util=require(_0xf9a0('0x1'));var path=require(_0xf9a0('0x2'));var timeout=require(_0xf9a0('0x3'));var express=require(_0xf9a0('0x4'));var router=express[_0xf9a0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xf9a0('0x6'));var config=require(_0xf9a0('0x7'));var controller=require('./intDynamics365Account.controller');router[_0xf9a0('0x8')]('/',auth[_0xf9a0('0x9')](),controller['index']);router[_0xf9a0('0x8')](_0xf9a0('0xa'),auth[_0xf9a0('0x9')](),controller[_0xf9a0('0xb')]);router['get'](_0xf9a0('0xc'),auth[_0xf9a0('0x9')](),controller[_0xf9a0('0xd')]);router[_0xf9a0('0x8')]('/:id/fields',auth[_0xf9a0('0x9')](),controller['getFields']);router[_0xf9a0('0xe')]('/',auth[_0xf9a0('0x9')](),controller['create']);router[_0xf9a0('0xe')](_0xf9a0('0xc'),auth[_0xf9a0('0x9')](),controller['addConfiguration']);router['put']('/:id',auth[_0xf9a0('0x9')](),controller[_0xf9a0('0xf')]);router[_0xf9a0('0x10')]('/:id',auth[_0xf9a0('0x9')](),controller['destroy']);module[_0xf9a0('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index a51224c..80b3acf 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 _0x81e8=['STRING','sequelize','exports'];(function(_0x581322,_0x3ebc53){var _0x41692d=function(_0xd0ad20){while(--_0xd0ad20){_0x581322['push'](_0x581322['shift']());}};_0x41692d(++_0x3ebc53);}(_0x81e8,0x73));var _0x881e=function(_0x44304b,_0x480030){_0x44304b=_0x44304b-0x0;var _0x292e63=_0x81e8[_0x44304b];return _0x292e63;};'use strict';var Sequelize=require(_0x881e('0x0'));module[_0x881e('0x1')]={'name':{'type':Sequelize[_0x881e('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x881e('0x2')]},'remoteUri':{'type':Sequelize[_0x881e('0x2')]},'tenantId':{'type':Sequelize[_0x881e('0x2')]},'clientId':{'type':Sequelize[_0x881e('0x2')]},'clientSecret':{'type':Sequelize[_0x881e('0x2')]},'serverUrl':{'type':Sequelize[_0x881e('0x2')]},'description':{'type':Sequelize[_0x881e('0x2')]}}; \ No newline at end of file +var _0x37ac=['sequelize','exports','STRING'];(function(_0x333f4a,_0x4770a4){var _0x55c80d=function(_0x5465d6){while(--_0x5465d6){_0x333f4a['push'](_0x333f4a['shift']());}};_0x55c80d(++_0x4770a4);}(_0x37ac,0x99));var _0xc37a=function(_0x22b377,_0x528f67){_0x22b377=_0x22b377-0x0;var _0x38ec4b=_0x37ac[_0x22b377];return _0x38ec4b;};'use strict';var Sequelize=require(_0xc37a('0x0'));module[_0xc37a('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc37a('0x2')]},'password':{'type':Sequelize[_0xc37a('0x2')]},'remoteUri':{'type':Sequelize[_0xc37a('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc37a('0x2')]},'clientSecret':{'type':Sequelize[_0xc37a('0x2')]},'serverUrl':{'type':Sequelize[_0xc37a('0x2')]},'description':{'type':Sequelize[_0xc37a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 2e82fa3..3e85d72 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 _0x4361=['productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','username','password','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','4.0','OptionSet','Options','UserLocalizedLabel','Label','LogicalName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','DisplayName','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','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','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','index','map','Dynamics365Account','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','keys','length','create','body','find','destroy','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','Subjects','Dynamics365Field','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename'];(function(_0xdb8e55,_0x31a538){var _0x423cfa=function(_0x1b9091){while(--_0x1b9091){_0xdb8e55['push'](_0xdb8e55['shift']());}};_0x423cfa(++_0x31a538);}(_0x4361,0x1ea));var _0x1436=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x4361[_0x24237f];return _0x48298e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1436('0x0'));var rimraf=require(_0x1436('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1436('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1436('0x3'));var Mustache=require(_0x1436('0x4'));var util=require(_0x1436('0x5'));var path=require(_0x1436('0x6'));var sox=require(_0x1436('0x7'));var csv=require(_0x1436('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1436('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1436('0xa'));var deskjs=require(_0x1436('0xb'));var toCsv=require(_0x1436('0x8'));var querystring=require(_0x1436('0xc'));var Papa=require(_0x1436('0xd'));var Redis=require(_0x1436('0xe'));var authService=require(_0x1436('0xf'));var qs=require(_0x1436('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1436('0x11'));var logger=require(_0x1436('0x12'))(_0x1436('0x13'));var utils=require(_0x1436('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x1436('0x15'));var client=jayson[_0x1436('0x16')][_0x1436('0x17')]({'port':0x232a});function checkPasswordPattern(_0x36ff0f,_0x49195b,_0x30b1a5){if(_0x30b1a5){var _0x3bb7c6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bb7c6['test'](_0x49195b)){return _0x36ff0f;}else{throw new db[(_0x1436('0x18'))][(_0x1436('0x19'))](_0x1436('0x1a'));}}else{return _0x36ff0f;}}function respondWithRpcPromise(_0x439bdc,_0x4a4947,_0x3de235,_0x495100){return new BPromise(function(_0x9be666,_0x492905){var _0xc5b98a=_0x495100||client;return _0xc5b98a[_0x1436('0x1b')](_0x439bdc,_0x3de235)[_0x1436('0x1c')](function(_0x4f0d24){logger['info'](_0x1436('0x1d'),_0x4a4947,_0x1436('0x1e'));logger[_0x1436('0x1f')](_0x1436('0x20'),_0x4a4947,_0x1436('0x1e'),JSON['stringify'](_0x4f0d24));if(_0x4f0d24[_0x1436('0x21')]){if(_0x4f0d24[_0x1436('0x21')][_0x1436('0x22')]===0x1f4){logger[_0x1436('0x21')](_0x1436('0x1d'),_0x4a4947,_0x4f0d24['error'][_0x1436('0x23')]);return _0x492905(_0x4f0d24[_0x1436('0x21')][_0x1436('0x23')]);}logger[_0x1436('0x21')](_0x1436('0x1d'),_0x4a4947,_0x4f0d24[_0x1436('0x21')][_0x1436('0x23')]);return _0x9be666(_0x4f0d24[_0x1436('0x21')][_0x1436('0x23')]);}else{logger[_0x1436('0x24')]('Dynamics365Account,\x20%s,\x20%s',_0x4a4947,_0x1436('0x1e'));_0x9be666(_0x4f0d24['result'][_0x1436('0x23')]);}})[_0x1436('0x25')](function(_0x52de82){logger['error'](_0x1436('0x1d'),_0x4a4947,_0x52de82);_0x492905(_0x52de82);});});}function respondWithStatusCode(_0x49a144,_0x33c489){_0x33c489=_0x33c489||0xcc;return function(_0x23d019){if(_0x23d019){return _0x49a144[_0x1436('0x26')](_0x33c489);}return _0x49a144[_0x1436('0x27')](_0x33c489)[_0x1436('0x28')]();};}function respondWithResult(_0x3c02ca,_0xd0d617){_0xd0d617=_0xd0d617||0xc8;return function(_0x4feb4b){if(_0x4feb4b){return _0x3c02ca[_0x1436('0x27')](_0xd0d617)[_0x1436('0x29')](_0x4feb4b);}};}function respondWithFilteredResult(_0x3b065c,_0x3ea67a){return function(_0x42e79d){if(_0x42e79d){var _0x40d570=_0x42e79d['count'],_0x50d241=_0x3ea67a[_0x1436('0x2a')],_0x17ad87=_0x3ea67a[_0x1436('0x2a')]+_0x3ea67a[_0x1436('0x2b')],_0x35a1e9;if(_0x17ad87>=_0x40d570){_0x17ad87=_0x40d570;_0x35a1e9=0xc8;}else{_0x35a1e9=0xce;}_0x3b065c[_0x1436('0x27')](_0x35a1e9);return _0x3b065c[_0x1436('0x2c')](_0x1436('0x2d'),_0x50d241+'-'+_0x17ad87+'/'+_0x40d570)[_0x1436('0x29')](_0x42e79d);}return null;};}function patchUpdates(_0x4b2db0){return function(_0x2c3196){try{jsonpatch[_0x1436('0x2e')](_0x2c3196,_0x4b2db0,!![]);}catch(_0x80d868){return BPromise[_0x1436('0x2f')](_0x80d868);}return _0x2c3196[_0x1436('0x30')]();};}function saveUpdates(_0x12dd72,_0x424436){return function(_0x226689){if(_0x226689){return _0x226689[_0x1436('0x31')](_0x12dd72)[_0x1436('0x1c')](function(_0x3376df){return _0x3376df;});}return null;};}function removeEntity(_0x38c40,_0x30585c){return function(_0x1eed84){if(_0x1eed84){return _0x1eed84['destroy']()['then'](function(){_0x38c40[_0x1436('0x27')](0xcc)[_0x1436('0x28')]();});}};}function handleEntityNotFound(_0x3e3b1a,_0x4fc76c){return function(_0xee03e7){if(!_0xee03e7){_0x3e3b1a['sendStatus'](0x194);}return _0xee03e7;};}function handleError(_0x271c3c,_0xddecc7){_0xddecc7=_0xddecc7||0x1f4;return function(_0x414243){logger[_0x1436('0x21')](_0x414243[_0x1436('0x32')]);if(_0x414243[_0x1436('0x33')]){delete _0x414243[_0x1436('0x33')];}_0x271c3c['status'](_0xddecc7)['send'](_0x414243);};}exports[_0x1436('0x34')]=function(_0x34c238,_0x3fcf37){var _0x577831={},_0xa299be={},_0x179a47={'count':0x0,'rows':[]};var _0x28fe5b=_[_0x1436('0x35')](db[_0x1436('0x36')][_0x1436('0x37')],function(_0x5c8c4d){return{'name':_0x5c8c4d[_0x1436('0x38')],'type':_0x5c8c4d['type'][_0x1436('0x39')]};});_0xa299be['model']=_[_0x1436('0x35')](_0x28fe5b,_0x1436('0x33'));_0xa299be[_0x1436('0x3a')]=_['keys'](_0x34c238['query']);_0xa299be[_0x1436('0x3b')]=_['intersection'](_0xa299be['model'],_0xa299be[_0x1436('0x3a')]);_0x577831['attributes']=_[_0x1436('0x3c')](_0xa299be[_0x1436('0x3d')],qs[_0x1436('0x3e')](_0x34c238[_0x1436('0x3a')][_0x1436('0x3e')]));_0x577831[_0x1436('0x3f')]=_0x577831[_0x1436('0x3f')]['length']?_0x577831['attributes']:_0xa299be['model'];if(!_0x34c238[_0x1436('0x3a')]['hasOwnProperty'](_0x1436('0x40'))){_0x577831[_0x1436('0x2b')]=qs[_0x1436('0x2b')](_0x34c238[_0x1436('0x3a')][_0x1436('0x2b')]);_0x577831[_0x1436('0x2a')]=qs[_0x1436('0x2a')](_0x34c238['query'][_0x1436('0x2a')]);}_0x577831[_0x1436('0x41')]=qs[_0x1436('0x42')](_0x34c238[_0x1436('0x3a')][_0x1436('0x42')]);_0x577831[_0x1436('0x43')]=qs[_0x1436('0x3b')](_[_0x1436('0x44')](_0x34c238[_0x1436('0x3a')],_0xa299be['filters']));if(_0x34c238[_0x1436('0x3a')][_0x1436('0x45')]){_0x577831[_0x1436('0x43')]=_['merge'](_0x577831[_0x1436('0x43')],{'$or':_['map'](_0x28fe5b,function(_0x494afa){if(_0x494afa[_0x1436('0x46')]!==_0x1436('0x47')){var _0x390d85={};_0x390d85[_0x494afa[_0x1436('0x33')]]={'$like':'%'+_0x34c238[_0x1436('0x3a')][_0x1436('0x45')]+'%'};return _0x390d85;}})});}_0x577831=_[_0x1436('0x48')]({},_0x577831,_0x34c238[_0x1436('0x49')]);var _0x94a0d2={'where':_0x577831[_0x1436('0x43')]};return db[_0x1436('0x36')]['count'](_0x94a0d2)['then'](function(_0x159f47){_0x179a47[_0x1436('0x4a')]=_0x159f47;if(_0x34c238[_0x1436('0x3a')][_0x1436('0x4b')]){_0x577831[_0x1436('0x4c')]=[{'all':!![]}];}return db[_0x1436('0x36')]['findAll'](_0x577831);})[_0x1436('0x1c')](function(_0x3c0c5c){_0x179a47[_0x1436('0x4d')]=_0x3c0c5c;return _0x179a47;})['then'](respondWithFilteredResult(_0x3fcf37,_0x577831))[_0x1436('0x25')](handleError(_0x3fcf37,null));};exports[_0x1436('0x4e')]=function(_0x11ae33,_0x697351){var _0x28507e={'raw':![],'where':{'id':_0x11ae33[_0x1436('0x4f')]['id']}},_0x4ab0b1={};_0x4ab0b1[_0x1436('0x3d')]=_[_0x1436('0x50')](db[_0x1436('0x36')][_0x1436('0x37')]);_0x4ab0b1[_0x1436('0x3a')]=_[_0x1436('0x50')](_0x11ae33['query']);_0x4ab0b1['filters']=_[_0x1436('0x3c')](_0x4ab0b1[_0x1436('0x3d')],_0x4ab0b1[_0x1436('0x3a')]);_0x28507e[_0x1436('0x3f')]=_[_0x1436('0x3c')](_0x4ab0b1['model'],qs['fields'](_0x11ae33[_0x1436('0x3a')][_0x1436('0x3e')]));_0x28507e[_0x1436('0x3f')]=_0x28507e[_0x1436('0x3f')][_0x1436('0x51')]?_0x28507e[_0x1436('0x3f')]:_0x4ab0b1[_0x1436('0x3d')];if(_0x11ae33['query'][_0x1436('0x4b')]){_0x28507e['include']=[{'all':!![]}];}_0x28507e=_[_0x1436('0x48')]({},_0x28507e,_0x11ae33[_0x1436('0x49')]);return db[_0x1436('0x36')]['find'](_0x28507e)[_0x1436('0x1c')](handleEntityNotFound(_0x697351,null))[_0x1436('0x1c')](respondWithResult(_0x697351,null))[_0x1436('0x25')](handleError(_0x697351,null));};exports[_0x1436('0x52')]=function(_0xb7034d,_0x2b5412){return db[_0x1436('0x36')][_0x1436('0x52')](_0xb7034d[_0x1436('0x53')],{})[_0x1436('0x1c')](respondWithResult(_0x2b5412,0xc9))[_0x1436('0x25')](handleError(_0x2b5412,null));};exports[_0x1436('0x31')]=function(_0xccc242,_0x45e504){if(_0xccc242[_0x1436('0x53')]['id']){delete _0xccc242[_0x1436('0x53')]['id'];}return db[_0x1436('0x36')][_0x1436('0x54')]({'where':{'id':_0xccc242['params']['id']}})['then'](handleEntityNotFound(_0x45e504,null))['then'](saveUpdates(_0xccc242[_0x1436('0x53')],null))[_0x1436('0x1c')](respondWithResult(_0x45e504,null))['catch'](handleError(_0x45e504,null));};exports[_0x1436('0x55')]=function(_0xd4c950,_0x135aad){return db[_0x1436('0x36')][_0x1436('0x54')]({'where':{'id':_0xd4c950[_0x1436('0x4f')]['id']}})[_0x1436('0x1c')](handleEntityNotFound(_0x135aad,null))[_0x1436('0x1c')](removeEntity(_0x135aad,null))[_0x1436('0x25')](handleError(_0x135aad,null));};exports[_0x1436('0x56')]=function(_0x118c06,_0x4e79d0,_0x2d9922){var _0x25285a={};var _0x13dae7={};var _0x172911;var _0x1b24c3;return db[_0x1436('0x36')][_0x1436('0x57')]({'where':{'id':_0x118c06[_0x1436('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4e79d0,null))[_0x1436('0x1c')](function(_0x31d83e){if(_0x31d83e){_0x172911=_0x31d83e;_0x13dae7['model']=_[_0x1436('0x50')](db[_0x1436('0x58')]['rawAttributes']);_0x13dae7['query']=_[_0x1436('0x50')](_0x118c06[_0x1436('0x3a')]);_0x13dae7[_0x1436('0x3b')]=_['intersection'](_0x13dae7[_0x1436('0x3d')],_0x13dae7[_0x1436('0x3a')]);_0x25285a[_0x1436('0x3f')]=_[_0x1436('0x3c')](_0x13dae7[_0x1436('0x3d')],qs[_0x1436('0x3e')](_0x118c06[_0x1436('0x3a')][_0x1436('0x3e')]));_0x25285a[_0x1436('0x3f')]=_0x25285a[_0x1436('0x3f')][_0x1436('0x51')]?_0x25285a['attributes']:_0x13dae7[_0x1436('0x3d')];_0x25285a[_0x1436('0x41')]=qs[_0x1436('0x42')](_0x118c06[_0x1436('0x3a')][_0x1436('0x42')]);_0x25285a['where']=qs[_0x1436('0x3b')](_[_0x1436('0x44')](_0x118c06[_0x1436('0x3a')],_0x13dae7['filters']));if(_0x118c06[_0x1436('0x3a')]['filter']){_0x25285a['where']=_['merge'](_0x25285a[_0x1436('0x43')],{'$or':_['map'](_0x25285a[_0x1436('0x3f')],function(_0x4a3919){var _0x41b11c={};_0x41b11c[_0x4a3919]={'$like':'%'+_0x118c06[_0x1436('0x3a')][_0x1436('0x45')]+'%'};return _0x41b11c;})});}_0x25285a=_[_0x1436('0x48')]({},_0x25285a,_0x118c06['options']);return _0x172911[_0x1436('0x56')](_0x25285a);}})[_0x1436('0x1c')](function(_0x6db320){if(_0x6db320){_0x1b24c3=_0x6db320['length'];if(!_0x118c06['query'][_0x1436('0x59')](_0x1436('0x40'))){_0x25285a['limit']=qs[_0x1436('0x2b')](_0x118c06[_0x1436('0x3a')][_0x1436('0x2b')]);_0x25285a[_0x1436('0x2a')]=qs[_0x1436('0x2a')](_0x118c06['query'][_0x1436('0x2a')]);}return _0x172911[_0x1436('0x56')](_0x25285a);}})[_0x1436('0x1c')](function(_0x42b8fa){if(_0x42b8fa){return _0x42b8fa?{'count':_0x1b24c3,'rows':_0x42b8fa}:null;}})[_0x1436('0x1c')](respondWithResult(_0x4e79d0,null))[_0x1436('0x25')](handleError(_0x4e79d0,null));};exports[_0x1436('0x5a')]=function(_0x1930cb,_0x352205,_0x2f815c){if(_0x1930cb[_0x1436('0x53')]['id']){delete _0x1930cb[_0x1436('0x53')]['id'];}return db[_0x1436('0x36')][_0x1436('0x57')]({'where':{'id':_0x1930cb['params']['id']}})[_0x1436('0x1c')](handleEntityNotFound(_0x352205,null))['then'](function(_0x196a71){if(_0x196a71){_0x1930cb['body'][_0x1436('0x5b')]=_0x196a71['id'];_0x1930cb['body']['Subjects']=integrations[_0x1436('0x5c')](_0x1930cb[_0x1436('0x53')]['channel'],_0x1930cb[_0x1436('0x53')]['type']);_0x1930cb[_0x1436('0x53')][_0x1436('0x5d')]=integrations[_0x1436('0x5e')](_0x1930cb[_0x1436('0x53')]['channel'],_0x1930cb[_0x1436('0x53')]['type']);return db[_0x1436('0x58')][_0x1436('0x52')](_0x1930cb['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x1436('0x5f')},{'model':db[_0x1436('0x60')],'as':_0x1436('0x5d')}]});}return null;})[_0x1436('0x1c')](respondWithResult(_0x352205,null))['catch'](handleError(_0x352205,null));};exports['getFields']=function(_0x2ad1b3,_0x2104af,_0x287ed7){var _0x2415d6=_0x2ad1b3['query'][_0x1436('0x61')];var _0x2c269d=_0x2415d6===_0x1436('0x62')?_0x1436('0x63'):_0x1436('0x64');var _0x1aa680='';var _0x22460e='';var _0x3074e8='';var _0x277bfe='';var _0x5b9c34='';var _0x2ad930='';var _0x326f1b='';var _0x3c2187='';var _0x536a7d=['title',_0x1436('0x65'),_0x1436('0x66'),_0x1436('0x67'),_0x1436('0x68'),_0x1436('0x69'),'phonenumber',_0x1436('0x6a'),'directioncode',_0x1436('0x6b')];var _0x2d7bbd=[_0x1436('0x6c'),_0x1436('0x6d'),'actualserviceunits',_0x1436('0x6e'),'contactidname',_0x1436('0x6f'),_0x1436('0x70'),_0x1436('0x71'),'createdbyexternalpartyname',_0x1436('0x72'),_0x1436('0x73'),'createdbyyominame',_0x1436('0x74'),'createdonbehalfbyname',_0x1436('0x75'),_0x1436('0x76'),_0x1436('0x77'),_0x1436('0x78'),'emailaddress',_0x1436('0x79'),_0x1436('0x7a'),'entityimage_url','escalatedon',_0x1436('0x7b'),_0x1436('0x7c'),_0x1436('0x7d'),_0x1436('0x7e'),_0x1436('0x7f'),'kbarticleidname',_0x1436('0x80'),'masteridname',_0x1436('0x81'),_0x1436('0x82'),_0x1436('0x83'),_0x1436('0x84'),_0x1436('0x85'),_0x1436('0x86'),_0x1436('0x87'),_0x1436('0x88'),_0x1436('0x89'),_0x1436('0x8a'),_0x1436('0x8b'),'overriddencreatedon',_0x1436('0x8c'),_0x1436('0x8d'),_0x1436('0x8e'),_0x1436('0x8f'),_0x1436('0x90'),'primarycontactidyominame',_0x1436('0x91'),'productidname',_0x1436('0x92'),_0x1436('0x93'),_0x1436('0x94'),'responseby',_0x1436('0x95'),'responsiblecontactidyominame','sentimentvalue',_0x1436('0x96'),_0x1436('0x97'),'socialprofileidname',_0x1436('0x98'),_0x1436('0x99'),_0x1436('0x9a'),_0x1436('0x9b'),'timezoneruleversionnumber',_0x1436('0x9c'),_0x1436('0x9d'),_0x1436('0x9e'),_0x1436('0x9f')];var _0x1e03c5=_0x536a7d[_0x1436('0xa0')](_0x2d7bbd);return db['Dynamics365Account']['findOne']({'where':{'id':_0x2ad1b3[_0x1436('0x4f')]['id']},'attributes':['id','username','password',_0x1436('0xa1'),_0x1436('0xa2'),_0x1436('0xa3'),_0x1436('0xa4')]})[_0x1436('0x1c')](handleEntityNotFound(_0x2104af,null))[_0x1436('0x1c')](function(_0x2049c0){if(_0x2049c0){_0x3c2187=_0x2049c0['remoteUri'];var _0x1f9234=_0x3c2187[_0x1436('0xa5')](-0x1);if(_0x1f9234==='/'){_0x3c2187=_0x3c2187[_0x1436('0xa6')](0x0,_0x3c2187[_0x1436('0xa7')](_0x1f9234));}_0x326f1b=util['format'](_0x1436('0xa8'),_0x3c2187);var _0x1115f6={'method':'POST','uri':_0x1436('0xa9')+_0x2049c0[_0x1436('0xa2')]+_0x1436('0xaa'),'form':{'client_id':_0x2049c0[_0x1436('0xa3')],'resource':_0x3c2187,'username':_0x2049c0[_0x1436('0xab')],'password':_0x2049c0[_0x1436('0xac')],'grant_type':_0x1436('0xac'),'client_secret':_0x2049c0[_0x1436('0xa4')]},'json':!![]};return rp(_0x1115f6);}})[_0x1436('0x1c')](function(_0xb94502){_0x2ad930=_0xb94502[_0x1436('0xad')];var _0x3b4af4={'method':'GET','uri':encodeURI(_0x326f1b+_0x1436('0xae')+_0x2c269d+'\x27'),'headers':{'Authorization':_0x1436('0xaf')+_0x2ad930,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3b4af4);})[_0x1436('0x1c')](function(_0x53449e){var _0x4a9147=_0x53449e[_0x1436('0xb0')][0x0];var _0x3c8de0=_0x4a9147[_0x1436('0xb1')];var _0x2de013={'method':_0x1436('0xb2'),'uri':_0x326f1b+_0x1436('0xb3')+_0x3c8de0+_0x1436('0xb4'),'headers':{'Authorization':_0x1436('0xaf')+_0x2ad930,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2de013);})[_0x1436('0x1c')](function(_0x511ec8){_0x1aa680=_0x511ec8;_0x22460e=_0x1aa680[_0x1436('0xb5')];_0x22460e=_[_0x1436('0xb6')](_0x22460e,function(_0x589b56){return!_0x1e03c5[_0x1436('0xb7')](_0x589b56['LogicalName']);});var _0x2ac6b5=[];var _0x44578d=[];_0x22460e[_0x1436('0xb8')](function(_0x95afa9){if(_0x95afa9[_0x1436('0xb9')]){var _0x2a095b=_0x95afa9[_0x1436('0xb9')][_0x1436('0xa6')](_0x95afa9[_0x1436('0xb9')][_0x1436('0xa7')]('.')+0x1);if(_0x2a095b===_0x1436('0xba')){_0x2ac6b5['push'](getSelectList(_0x326f1b,_0x2415d6,_0x44578d,_0x1aa680[_0x1436('0xb1')],_0x95afa9[_0x1436('0xb1')],_0x2ad930));}}});return Promise[_0x1436('0xbb')](_0x2ac6b5);})[_0x1436('0x1c')](function(_0x2a38cc){_0x3074e8=_0x2a38cc[0x0];var _0xac8cde=[];var _0x2dd20e=[];_0x22460e[_0x1436('0xb8')](function(_0x2de649){if(!_[_0x1436('0xbc')](_0x2de649[_0x1436('0xb9')])){var _0x23e288=_0x2de649[_0x1436('0xb9')][_0x1436('0xa6')](_0x2de649[_0x1436('0xb9')][_0x1436('0xa7')]('.')+0x1);if(_0x23e288===_0x1436('0xbd')){_0xac8cde[_0x1436('0xbe')](getBooleanList(_0x326f1b,_0x2415d6,_0x2dd20e,_0x1aa680[_0x1436('0xb1')],_0x2de649[_0x1436('0xb1')],_0x2ad930));}}});return Promise['all'](_0xac8cde);})['then'](function(_0x45e2eb){_0x277bfe=_0x45e2eb[0x0];var _0x593ead=[];var _0x505008=[];_0x22460e[_0x1436('0xb8')](function(_0x1c35d0){if(_0x1c35d0[_0x1436('0xb9')]){var _0x5deaf5=_0x1c35d0[_0x1436('0xb9')][_0x1436('0xa6')](_0x1c35d0['@odata.type']['lastIndexOf']('.')+0x1);if(_0x5deaf5===_0x1436('0xbf')||_0x5deaf5==='DoubleAttributeMetadata'||_0x5deaf5===_0x1436('0xc0')||_0x5deaf5===_0x1436('0xc1')||_0x5deaf5===_0x1436('0xc2')||_0x5deaf5==='DateTimeAttributeMetadata'||_0x5deaf5===_0x1436('0xc3')||_0x5deaf5===_0x1436('0xc4')||_0x5deaf5==='StateAttributeMetadata'||_0x5deaf5===_0x1436('0xc5')){_0x593ead[_0x1436('0xbe')](getInputList(_0x326f1b,_0x2415d6,_0x5deaf5,_0x505008,_0x1aa680[_0x1436('0xb1')],_0x1c35d0['MetadataId'],_0x2ad930));}}});return Promise[_0x1436('0xbb')](_0x593ead);})[_0x1436('0x1c')](function(_0x3cc4c8){_0x5b9c34=_0x3cc4c8[0x0];var _0x3613bd=_0x3074e8['concat'](_0x277bfe)[_0x1436('0xa0')](_0x5b9c34);var _0x4ad74b={'count':_0x3613bd['length'],'rows':_0x3613bd};return _0x4ad74b;})[_0x1436('0x1c')](respondWithResult(_0x2104af,null))[_0x1436('0x25')](function(_0x1dddad){var _0x4e8b44=_0x2ad1b3[_0x1436('0x3a')]['test']?0x1f4:_0x1dddad[_0x1436('0xc6')]||0x1f4;logger['error'](_0x1dddad[_0x1436('0x32')]);delete _0x1dddad[_0x1436('0x33')];if(_0x4e8b44===0x191){_0x4e8b44=0x190;}_0x2104af[_0x1436('0x27')](_0x4e8b44)['send'](_0x2ad1b3[_0x1436('0x3a')][_0x1436('0xc7')]?{'message':_0x1436('0xc8'),'statusCode':_0x1dddad[_0x1436('0xc6')]}:_0x1dddad);});};function getSelectList(_0x3197cd,_0x33bd27,_0x29a372,_0x1a89c6,_0x254194,_0x1a2f77){var _0x3975f7={'method':'GET','uri':_0x3197cd+_0x1436('0xb3')+_0x1a89c6+')/Attributes('+_0x254194+_0x1436('0xc9')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x1436('0xaf')+_0x1a2f77,'If-None-Match':null,'OData-Version':_0x1436('0xca')},'json':!![]};return rp(_0x3975f7)[_0x1436('0x1c')](function(_0x1da161){var _0x479853=[];var _0x26fcb7=_0x1da161[_0x1436('0xcb')][_0x1436('0xcc')];_0x26fcb7[_0x1436('0xb8')](function(_0x23c42a){_0x479853['push']({'name':_0x23c42a['Label'][_0x1436('0xcd')][_0x1436('0xce')],'value':String(_0x23c42a['Value'])});});var _0x22c971={'id':_0x33bd27+'_'+_0x1da161[_0x1436('0xcf')],'name':_0x1da161['DisplayName'][_0x1436('0xcd')]['Label'],'custom':![],'options':_0x479853};_0x29a372[_0x1436('0xbe')](_0x22c971);return _0x29a372;});}function getBooleanList(_0x5e1f5a,_0x5020a1,_0x437103,_0x3200de,_0x479f40,_0x5a94e2){var _0x30669c={'method':_0x1436('0xb2'),'uri':_0x5e1f5a+_0x1436('0xb3')+_0x3200de+_0x1436('0xd0')+_0x479f40+_0x1436('0xd1'),'headers':{'Authorization':_0x1436('0xaf')+_0x5a94e2,'If-None-Match':null,'OData-Version':_0x1436('0xca')},'json':!![]};return rp(_0x30669c)[_0x1436('0x1c')](function(_0x58523a){var _0x257252=[];_0x257252['push']({'name':_0x58523a['OptionSet']['TrueOption'][_0x1436('0xce')][_0x1436('0xcd')]['Label'],'value':'true'},{'name':_0x58523a['OptionSet']['FalseOption']['Label'][_0x1436('0xcd')]['Label'],'value':'false'});var _0x295033={'id':_0x5020a1+'_'+_0x58523a[_0x1436('0xcf')],'name':_0x58523a[_0x1436('0xd2')][_0x1436('0xcd')][_0x1436('0xce')],'custom':![],'options':_0x257252};_0x437103[_0x1436('0xbe')](_0x295033);return _0x437103;});}function getInputList(_0x543dd2,_0xac901d,_0x46bc3d,_0x4d70ad,_0x559a7c,_0x35765c,_0x2f5edb){var _0x5f1fa4={'method':'GET','uri':_0x543dd2+'EntityDefinitions('+_0x559a7c+')/Attributes('+_0x35765c+')/Microsoft.Dynamics.CRM.'+_0x46bc3d+_0x1436('0xd3'),'headers':{'Authorization':_0x1436('0xaf')+_0x2f5edb,'If-None-Match':null,'OData-Version':_0x1436('0xca')},'json':!![]};return rp(_0x5f1fa4)[_0x1436('0x1c')](function(_0x5834b9){var _0x42287c={'id':_0xac901d+'_'+_0x5834b9[_0x1436('0xcf')],'name':_0x5834b9[_0x1436('0xd2')][_0x1436('0xcd')]?_0x5834b9[_0x1436('0xd2')][_0x1436('0xcd')][_0x1436('0xce')]:_0x5834b9['LogicalName'],'custom':![],'options':[]};_0x4d70ad[_0x1436('0xbe')](_0x42287c);return _0x4d70ad;});} \ No newline at end of file +var _0x1ece=['customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','clientId','clientSecret','remoteUri','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','username','GET','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','includes','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Wrong\x20credentials','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','Value','LogicalName','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','html-pdf','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','Dynamics365Account,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','Dynamics365Account','options','find','create','body','destroy','getConfigurations','findOne','length','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','getFields','incident','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','actualserviceunits','contactidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype'];(function(_0x4988f5,_0x22e4fa){var _0x2921e4=function(_0x625316){while(--_0x625316){_0x4988f5['push'](_0x4988f5['shift']());}};_0x2921e4(++_0x22e4fa);}(_0x1ece,0x13f));var _0xe1ec=function(_0x43e41e,_0x2d724e){_0x43e41e=_0x43e41e-0x0;var _0xc59837=_0x1ece[_0x43e41e];return _0xc59837;};'use strict';var pdf=require(_0xe1ec('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe1ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1ec('0x2'));var rp=require('request-promise');var moment=require(_0xe1ec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe1ec('0x4'));var util=require('util');var path=require(_0xe1ec('0x5'));var sox=require(_0xe1ec('0x6'));var csv=require(_0xe1ec('0x7'));var ejs=require(_0xe1ec('0x8'));var fs=require('fs');var _=require(_0xe1ec('0x9'));var squel=require('squel');var crypto=require(_0xe1ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe1ec('0xb'));var toCsv=require(_0xe1ec('0x7'));var querystring=require('querystring');var Papa=require(_0xe1ec('0xc'));var Redis=require(_0xe1ec('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe1ec('0xe'));var as=require(_0xe1ec('0xf'));var hardwareService=require(_0xe1ec('0x10'));var logger=require(_0xe1ec('0x11'))(_0xe1ec('0x12'));var utils=require(_0xe1ec('0x13'));var config=require(_0xe1ec('0x14'));var db=require(_0xe1ec('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xe1ec('0x16')][_0xe1ec('0x17')]({'port':0x232a});function checkPasswordPattern(_0x35613f,_0x557fd4,_0x2f6772){if(_0x2f6772){var _0xa2b807=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa2b807[_0xe1ec('0x18')](_0x557fd4)){return _0x35613f;}else{throw new db[(_0xe1ec('0x19'))]['ValidationError'](_0xe1ec('0x1a'));}}else{return _0x35613f;}}function respondWithRpcPromise(_0x1526e8,_0x2c8d5a,_0x5bbc75,_0x444f24){return new BPromise(function(_0x45b709,_0x39502c){var _0x35c54c=_0x444f24||client;return _0x35c54c[_0xe1ec('0x1b')](_0x1526e8,_0x5bbc75)[_0xe1ec('0x1c')](function(_0x4dea14){logger[_0xe1ec('0x1d')]('Dynamics365Account,\x20%s,\x20%s',_0x2c8d5a,_0xe1ec('0x1e'));logger[_0xe1ec('0x1f')](_0xe1ec('0x20'),_0x2c8d5a,'request\x20sent',JSON['stringify'](_0x4dea14));if(_0x4dea14[_0xe1ec('0x21')]){if(_0x4dea14[_0xe1ec('0x21')]['code']===0x1f4){logger['error'](_0xe1ec('0x22'),_0x2c8d5a,_0x4dea14[_0xe1ec('0x21')][_0xe1ec('0x23')]);return _0x39502c(_0x4dea14[_0xe1ec('0x21')][_0xe1ec('0x23')]);}logger[_0xe1ec('0x21')](_0xe1ec('0x22'),_0x2c8d5a,_0x4dea14['error'][_0xe1ec('0x23')]);return _0x45b709(_0x4dea14['error']['message']);}else{logger[_0xe1ec('0x1d')](_0xe1ec('0x22'),_0x2c8d5a,_0xe1ec('0x1e'));_0x45b709(_0x4dea14[_0xe1ec('0x24')][_0xe1ec('0x23')]);}})[_0xe1ec('0x25')](function(_0x12bd71){logger[_0xe1ec('0x21')](_0xe1ec('0x22'),_0x2c8d5a,_0x12bd71);_0x39502c(_0x12bd71);});});}function respondWithStatusCode(_0x5d06fd,_0x3a57ce){_0x3a57ce=_0x3a57ce||0xcc;return function(_0x2e8b14){if(_0x2e8b14){return _0x5d06fd['sendStatus'](_0x3a57ce);}return _0x5d06fd[_0xe1ec('0x26')](_0x3a57ce)[_0xe1ec('0x27')]();};}function respondWithResult(_0x1855cc,_0x573440){_0x573440=_0x573440||0xc8;return function(_0x4ca685){if(_0x4ca685){return _0x1855cc[_0xe1ec('0x26')](_0x573440)[_0xe1ec('0x28')](_0x4ca685);}};}function respondWithFilteredResult(_0x2d2cef,_0x5c03a9){return function(_0x5d0e55){if(_0x5d0e55){var _0x59172e=_0x5d0e55[_0xe1ec('0x29')],_0x128834=_0x5c03a9[_0xe1ec('0x2a')],_0x1fb232=_0x5c03a9[_0xe1ec('0x2a')]+_0x5c03a9[_0xe1ec('0x2b')],_0x146b57;if(_0x1fb232>=_0x59172e){_0x1fb232=_0x59172e;_0x146b57=0xc8;}else{_0x146b57=0xce;}_0x2d2cef['status'](_0x146b57);return _0x2d2cef[_0xe1ec('0x2c')](_0xe1ec('0x2d'),_0x128834+'-'+_0x1fb232+'/'+_0x59172e)[_0xe1ec('0x28')](_0x5d0e55);}return null;};}function patchUpdates(_0x52154f){return function(_0x15f226){try{jsonpatch['apply'](_0x15f226,_0x52154f,!![]);}catch(_0x4591f5){return BPromise[_0xe1ec('0x2e')](_0x4591f5);}return _0x15f226[_0xe1ec('0x2f')]();};}function saveUpdates(_0x81cac5,_0x504276){return function(_0x5cf052){if(_0x5cf052){return _0x5cf052[_0xe1ec('0x30')](_0x81cac5)[_0xe1ec('0x1c')](function(_0x49ea1e){return _0x49ea1e;});}return null;};}function removeEntity(_0x39e0fa,_0x89b7f7){return function(_0x4749dc){if(_0x4749dc){return _0x4749dc['destroy']()['then'](function(){_0x39e0fa[_0xe1ec('0x26')](0xcc)[_0xe1ec('0x27')]();});}};}function handleEntityNotFound(_0x1e2215,_0x385a0b){return function(_0x2725d2){if(!_0x2725d2){_0x1e2215[_0xe1ec('0x31')](0x194);}return _0x2725d2;};}function handleError(_0x51cfe4,_0x47ae65){_0x47ae65=_0x47ae65||0x1f4;return function(_0x5071c1){logger['error'](_0x5071c1[_0xe1ec('0x32')]);if(_0x5071c1[_0xe1ec('0x33')]){delete _0x5071c1[_0xe1ec('0x33')];}_0x51cfe4[_0xe1ec('0x26')](_0x47ae65)[_0xe1ec('0x34')](_0x5071c1);};}exports['index']=function(_0x37f1ca,_0x1c2c55){var _0x36f4f1={},_0x1bf756={},_0x339c55={'count':0x0,'rows':[]};var _0x4cb460=_[_0xe1ec('0x35')](db['Dynamics365Account'][_0xe1ec('0x36')],function(_0x3cc1b3){return{'name':_0x3cc1b3[_0xe1ec('0x37')],'type':_0x3cc1b3[_0xe1ec('0x38')][_0xe1ec('0x39')]};});_0x1bf756['model']=_[_0xe1ec('0x35')](_0x4cb460,_0xe1ec('0x33'));_0x1bf756[_0xe1ec('0x3a')]=_[_0xe1ec('0x3b')](_0x37f1ca[_0xe1ec('0x3a')]);_0x1bf756[_0xe1ec('0x3c')]=_[_0xe1ec('0x3d')](_0x1bf756[_0xe1ec('0x3e')],_0x1bf756[_0xe1ec('0x3a')]);_0x36f4f1[_0xe1ec('0x3f')]=_[_0xe1ec('0x3d')](_0x1bf756[_0xe1ec('0x3e')],qs[_0xe1ec('0x40')](_0x37f1ca[_0xe1ec('0x3a')]['fields']));_0x36f4f1['attributes']=_0x36f4f1[_0xe1ec('0x3f')]['length']?_0x36f4f1[_0xe1ec('0x3f')]:_0x1bf756['model'];if(!_0x37f1ca['query'][_0xe1ec('0x41')]('nolimit')){_0x36f4f1[_0xe1ec('0x2b')]=qs['limit'](_0x37f1ca[_0xe1ec('0x3a')][_0xe1ec('0x2b')]);_0x36f4f1['offset']=qs[_0xe1ec('0x2a')](_0x37f1ca['query'][_0xe1ec('0x2a')]);}_0x36f4f1[_0xe1ec('0x42')]=qs['sort'](_0x37f1ca[_0xe1ec('0x3a')][_0xe1ec('0x43')]);_0x36f4f1['where']=qs['filters'](_[_0xe1ec('0x44')](_0x37f1ca[_0xe1ec('0x3a')],_0x1bf756[_0xe1ec('0x3c')]));if(_0x37f1ca[_0xe1ec('0x3a')][_0xe1ec('0x45')]){_0x36f4f1[_0xe1ec('0x46')]=_[_0xe1ec('0x47')](_0x36f4f1[_0xe1ec('0x46')],{'$or':_[_0xe1ec('0x35')](_0x4cb460,function(_0x7916ef){if(_0x7916ef[_0xe1ec('0x38')]!==_0xe1ec('0x48')){var _0x30a056={};_0x30a056[_0x7916ef[_0xe1ec('0x33')]]={'$like':'%'+_0x37f1ca['query'][_0xe1ec('0x45')]+'%'};return _0x30a056;}})});}_0x36f4f1=_[_0xe1ec('0x47')]({},_0x36f4f1,_0x37f1ca['options']);var _0x3aa067={'where':_0x36f4f1[_0xe1ec('0x46')]};return db['Dynamics365Account'][_0xe1ec('0x29')](_0x3aa067)[_0xe1ec('0x1c')](function(_0x29b9e5){_0x339c55[_0xe1ec('0x29')]=_0x29b9e5;if(_0x37f1ca[_0xe1ec('0x3a')][_0xe1ec('0x49')]){_0x36f4f1[_0xe1ec('0x4a')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xe1ec('0x4b')](_0x36f4f1);})[_0xe1ec('0x1c')](function(_0x431b97){_0x339c55[_0xe1ec('0x4c')]=_0x431b97;return _0x339c55;})[_0xe1ec('0x1c')](respondWithFilteredResult(_0x1c2c55,_0x36f4f1))[_0xe1ec('0x25')](handleError(_0x1c2c55,null));};exports[_0xe1ec('0x4d')]=function(_0x20704a,_0x4d80f4){var _0x323c07={'raw':![],'where':{'id':_0x20704a[_0xe1ec('0x4e')]['id']}},_0x595f86={};_0x595f86[_0xe1ec('0x3e')]=_[_0xe1ec('0x3b')](db[_0xe1ec('0x4f')][_0xe1ec('0x36')]);_0x595f86['query']=_[_0xe1ec('0x3b')](_0x20704a[_0xe1ec('0x3a')]);_0x595f86[_0xe1ec('0x3c')]=_[_0xe1ec('0x3d')](_0x595f86[_0xe1ec('0x3e')],_0x595f86['query']);_0x323c07[_0xe1ec('0x3f')]=_[_0xe1ec('0x3d')](_0x595f86[_0xe1ec('0x3e')],qs[_0xe1ec('0x40')](_0x20704a[_0xe1ec('0x3a')][_0xe1ec('0x40')]));_0x323c07[_0xe1ec('0x3f')]=_0x323c07[_0xe1ec('0x3f')]['length']?_0x323c07[_0xe1ec('0x3f')]:_0x595f86[_0xe1ec('0x3e')];if(_0x20704a[_0xe1ec('0x3a')][_0xe1ec('0x49')]){_0x323c07[_0xe1ec('0x4a')]=[{'all':!![]}];}_0x323c07=_['merge']({},_0x323c07,_0x20704a[_0xe1ec('0x50')]);return db[_0xe1ec('0x4f')][_0xe1ec('0x51')](_0x323c07)[_0xe1ec('0x1c')](handleEntityNotFound(_0x4d80f4,null))[_0xe1ec('0x1c')](respondWithResult(_0x4d80f4,null))[_0xe1ec('0x25')](handleError(_0x4d80f4,null));};exports[_0xe1ec('0x52')]=function(_0x4c5ac2,_0x6d1cf5){return db['Dynamics365Account']['create'](_0x4c5ac2[_0xe1ec('0x53')],{})[_0xe1ec('0x1c')](respondWithResult(_0x6d1cf5,0xc9))[_0xe1ec('0x25')](handleError(_0x6d1cf5,null));};exports[_0xe1ec('0x30')]=function(_0xc44515,_0x150a90){if(_0xc44515['body']['id']){delete _0xc44515[_0xe1ec('0x53')]['id'];}return db[_0xe1ec('0x4f')][_0xe1ec('0x51')]({'where':{'id':_0xc44515['params']['id']}})[_0xe1ec('0x1c')](handleEntityNotFound(_0x150a90,null))['then'](saveUpdates(_0xc44515[_0xe1ec('0x53')],null))[_0xe1ec('0x1c')](respondWithResult(_0x150a90,null))['catch'](handleError(_0x150a90,null));};exports[_0xe1ec('0x54')]=function(_0x59917c,_0x1f0f1e){return db[_0xe1ec('0x4f')]['find']({'where':{'id':_0x59917c[_0xe1ec('0x4e')]['id']}})[_0xe1ec('0x1c')](handleEntityNotFound(_0x1f0f1e,null))['then'](removeEntity(_0x1f0f1e,null))[_0xe1ec('0x25')](handleError(_0x1f0f1e,null));};exports[_0xe1ec('0x55')]=function(_0x343fc8,_0x3e39ee,_0x29cb49){var _0x5509bb={};var _0x11f051={};var _0x5de60d;var _0x124940;return db[_0xe1ec('0x4f')][_0xe1ec('0x56')]({'where':{'id':_0x343fc8['params']['id']}})[_0xe1ec('0x1c')](handleEntityNotFound(_0x3e39ee,null))[_0xe1ec('0x1c')](function(_0x46ae0e){if(_0x46ae0e){_0x5de60d=_0x46ae0e;_0x11f051[_0xe1ec('0x3e')]=_[_0xe1ec('0x3b')](db['Dynamics365Configuration'][_0xe1ec('0x36')]);_0x11f051[_0xe1ec('0x3a')]=_['keys'](_0x343fc8[_0xe1ec('0x3a')]);_0x11f051[_0xe1ec('0x3c')]=_[_0xe1ec('0x3d')](_0x11f051[_0xe1ec('0x3e')],_0x11f051[_0xe1ec('0x3a')]);_0x5509bb['attributes']=_['intersection'](_0x11f051[_0xe1ec('0x3e')],qs[_0xe1ec('0x40')](_0x343fc8[_0xe1ec('0x3a')][_0xe1ec('0x40')]));_0x5509bb[_0xe1ec('0x3f')]=_0x5509bb[_0xe1ec('0x3f')][_0xe1ec('0x57')]?_0x5509bb[_0xe1ec('0x3f')]:_0x11f051[_0xe1ec('0x3e')];_0x5509bb[_0xe1ec('0x42')]=qs['sort'](_0x343fc8[_0xe1ec('0x3a')][_0xe1ec('0x43')]);_0x5509bb[_0xe1ec('0x46')]=qs['filters'](_[_0xe1ec('0x44')](_0x343fc8[_0xe1ec('0x3a')],_0x11f051[_0xe1ec('0x3c')]));if(_0x343fc8[_0xe1ec('0x3a')][_0xe1ec('0x45')]){_0x5509bb[_0xe1ec('0x46')]=_[_0xe1ec('0x47')](_0x5509bb['where'],{'$or':_[_0xe1ec('0x35')](_0x5509bb[_0xe1ec('0x3f')],function(_0x4e4c2c){var _0x2ebb69={};_0x2ebb69[_0x4e4c2c]={'$like':'%'+_0x343fc8[_0xe1ec('0x3a')][_0xe1ec('0x45')]+'%'};return _0x2ebb69;})});}_0x5509bb=_['merge']({},_0x5509bb,_0x343fc8[_0xe1ec('0x50')]);return _0x5de60d['getConfigurations'](_0x5509bb);}})[_0xe1ec('0x1c')](function(_0x1b3a64){if(_0x1b3a64){_0x124940=_0x1b3a64['length'];if(!_0x343fc8[_0xe1ec('0x3a')][_0xe1ec('0x41')]('nolimit')){_0x5509bb['limit']=qs[_0xe1ec('0x2b')](_0x343fc8[_0xe1ec('0x3a')][_0xe1ec('0x2b')]);_0x5509bb[_0xe1ec('0x2a')]=qs[_0xe1ec('0x2a')](_0x343fc8[_0xe1ec('0x3a')][_0xe1ec('0x2a')]);}return _0x5de60d['getConfigurations'](_0x5509bb);}})[_0xe1ec('0x1c')](function(_0x176cc2){if(_0x176cc2){return _0x176cc2?{'count':_0x124940,'rows':_0x176cc2}:null;}})[_0xe1ec('0x1c')](respondWithResult(_0x3e39ee,null))[_0xe1ec('0x25')](handleError(_0x3e39ee,null));};exports[_0xe1ec('0x58')]=function(_0x4e3a0f,_0x29333b,_0x442005){if(_0x4e3a0f[_0xe1ec('0x53')]['id']){delete _0x4e3a0f[_0xe1ec('0x53')]['id'];}return db[_0xe1ec('0x4f')]['findOne']({'where':{'id':_0x4e3a0f['params']['id']}})[_0xe1ec('0x1c')](handleEntityNotFound(_0x29333b,null))[_0xe1ec('0x1c')](function(_0x415ffa){if(_0x415ffa){_0x4e3a0f[_0xe1ec('0x53')][_0xe1ec('0x59')]=_0x415ffa['id'];_0x4e3a0f[_0xe1ec('0x53')][_0xe1ec('0x5a')]=integrations[_0xe1ec('0x5b')](_0x4e3a0f['body']['channel'],_0x4e3a0f[_0xe1ec('0x53')][_0xe1ec('0x38')]);_0x4e3a0f[_0xe1ec('0x53')][_0xe1ec('0x5c')]=integrations[_0xe1ec('0x5d')](_0x4e3a0f['body']['channel'],_0x4e3a0f[_0xe1ec('0x53')][_0xe1ec('0x38')]);return db[_0xe1ec('0x5e')][_0xe1ec('0x52')](_0x4e3a0f['body'],{'include':[{'model':db[_0xe1ec('0x5f')],'as':'Subjects'},{'model':db[_0xe1ec('0x5f')],'as':_0xe1ec('0x5c')}]});}return null;})[_0xe1ec('0x1c')](respondWithResult(_0x29333b,null))['catch'](handleError(_0x29333b,null));};exports[_0xe1ec('0x60')]=function(_0x594319,_0x2a9d68,_0xe6a6c8){var _0x452792=_0x594319[_0xe1ec('0x3a')]['ticketType'];var _0x160888=_0x452792===_0xe1ec('0x61')?_0xe1ec('0x62'):_0xe1ec('0x63');var _0x1fa316='';var _0xb93057='';var _0x511a07='';var _0x519747='';var _0x31dc7d='';var _0x380296='';var _0x3b7564='';var _0x598e9f='';var _0x1089b8=[_0xe1ec('0x64'),_0xe1ec('0x65'),'customerid',_0xe1ec('0x66'),_0xe1ec('0x67'),_0xe1ec('0x68'),_0xe1ec('0x69'),_0xe1ec('0x6a'),_0xe1ec('0x6b'),'phonecall_activity_parties'];var _0x4147e1=[_0xe1ec('0x6c'),'accountidyominame',_0xe1ec('0x6d'),'billedserviceunits',_0xe1ec('0x6e'),'contactidyominame','contractdetailidname','contractidname',_0xe1ec('0x6f'),_0xe1ec('0x70'),_0xe1ec('0x71'),_0xe1ec('0x72'),_0xe1ec('0x73'),'createdonbehalfbyname',_0xe1ec('0x74'),_0xe1ec('0x75'),_0xe1ec('0x76'),_0xe1ec('0x77'),_0xe1ec('0x78'),_0xe1ec('0x79'),_0xe1ec('0x7a'),'entityimage_url',_0xe1ec('0x7b'),_0xe1ec('0x7c'),_0xe1ec('0x7d'),_0xe1ec('0x7e'),_0xe1ec('0x7f'),_0xe1ec('0x80'),_0xe1ec('0x81'),_0xe1ec('0x82'),_0xe1ec('0x83'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname',_0xe1ec('0x84'),_0xe1ec('0x85'),_0xe1ec('0x86'),_0xe1ec('0x87'),_0xe1ec('0x88'),_0xe1ec('0x89'),'numberofchildincidents',_0xe1ec('0x8a'),_0xe1ec('0x8b'),_0xe1ec('0x8c'),_0xe1ec('0x8d'),_0xe1ec('0x8e'),_0xe1ec('0x8f'),_0xe1ec('0x90'),_0xe1ec('0x91'),_0xe1ec('0x92'),_0xe1ec('0x93'),_0xe1ec('0x94'),_0xe1ec('0x95'),_0xe1ec('0x96'),_0xe1ec('0x97'),_0xe1ec('0x98'),'responsiblecontactidyominame',_0xe1ec('0x99'),_0xe1ec('0x9a'),_0xe1ec('0x9b'),_0xe1ec('0x9c'),_0xe1ec('0x9d'),'statuscode',_0xe1ec('0x9e'),_0xe1ec('0x9f'),'timezoneruleversionnumber',_0xe1ec('0xa0'),_0xe1ec('0xa1'),_0xe1ec('0xa2'),_0xe1ec('0xa3')];var _0x31f6be=_0x1089b8[_0xe1ec('0xa4')](_0x4147e1);return db[_0xe1ec('0x4f')][_0xe1ec('0x56')]({'where':{'id':_0x594319[_0xe1ec('0x4e')]['id']},'attributes':['id','username',_0xe1ec('0xa5'),'remoteUri','tenantId',_0xe1ec('0xa6'),_0xe1ec('0xa7')]})[_0xe1ec('0x1c')](handleEntityNotFound(_0x2a9d68,null))['then'](function(_0x14a3b9){if(_0x14a3b9){_0x598e9f=_0x14a3b9[_0xe1ec('0xa8')];var _0x34905d=_0x598e9f[_0xe1ec('0xa9')](-0x1);if(_0x34905d==='/'){_0x598e9f=_0x598e9f['substring'](0x0,_0x598e9f[_0xe1ec('0xaa')](_0x34905d));}_0x3b7564=util[_0xe1ec('0xab')](_0xe1ec('0xac'),_0x598e9f);var _0x51368e={'method':_0xe1ec('0xad'),'uri':_0xe1ec('0xae')+_0x14a3b9[_0xe1ec('0xaf')]+_0xe1ec('0xb0'),'form':{'client_id':_0x14a3b9[_0xe1ec('0xa6')],'resource':_0x598e9f,'username':_0x14a3b9[_0xe1ec('0xb1')],'password':_0x14a3b9['password'],'grant_type':'password','client_secret':_0x14a3b9[_0xe1ec('0xa7')]},'json':!![]};return rp(_0x51368e);}})[_0xe1ec('0x1c')](function(_0x3c3eea){_0x380296=_0x3c3eea['access_token'];var _0x4b5c63={'method':_0xe1ec('0xb2'),'uri':encodeURI(_0x3b7564+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x160888+'\x27'),'headers':{'Authorization':_0xe1ec('0xb3')+_0x380296,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4b5c63);})[_0xe1ec('0x1c')](function(_0x467f90){var _0x1aa979=_0x467f90[_0xe1ec('0xb4')][0x0];var _0x34e325=_0x1aa979[_0xe1ec('0xb5')];var _0x835b45={'method':_0xe1ec('0xb2'),'uri':_0x3b7564+_0xe1ec('0xb6')+_0x34e325+_0xe1ec('0xb7'),'headers':{'Authorization':_0xe1ec('0xb3')+_0x380296,'If-None-Match':null,'OData-Version':_0xe1ec('0xb8')},'json':!![]};return rp(_0x835b45);})[_0xe1ec('0x1c')](function(_0x136b2c){_0x1fa316=_0x136b2c;_0xb93057=_0x1fa316[_0xe1ec('0xb9')];_0xb93057=_['remove'](_0xb93057,function(_0x372218){return!_0x31f6be[_0xe1ec('0xba')](_0x372218['LogicalName']);});var _0x503aae=[];var _0x1475fd=[];_0xb93057[_0xe1ec('0xbb')](function(_0x13130b){if(_0x13130b[_0xe1ec('0xbc')]){var _0xd0f97b=_0x13130b[_0xe1ec('0xbc')][_0xe1ec('0xbd')](_0x13130b['@odata.type'][_0xe1ec('0xaa')]('.')+0x1);if(_0xd0f97b===_0xe1ec('0xbe')){_0x503aae[_0xe1ec('0xbf')](getSelectList(_0x3b7564,_0x452792,_0x1475fd,_0x1fa316[_0xe1ec('0xb5')],_0x13130b[_0xe1ec('0xb5')],_0x380296));}}});return Promise[_0xe1ec('0xc0')](_0x503aae);})[_0xe1ec('0x1c')](function(_0x165442){_0x511a07=_0x165442[0x0];var _0x31b28d=[];var _0x5709e8=[];_0xb93057[_0xe1ec('0xbb')](function(_0x489726){if(!_[_0xe1ec('0xc1')](_0x489726[_0xe1ec('0xbc')])){var _0x47ea7a=_0x489726['@odata.type']['substring'](_0x489726[_0xe1ec('0xbc')]['lastIndexOf']('.')+0x1);if(_0x47ea7a===_0xe1ec('0xc2')){_0x31b28d[_0xe1ec('0xbf')](getBooleanList(_0x3b7564,_0x452792,_0x5709e8,_0x1fa316[_0xe1ec('0xb5')],_0x489726[_0xe1ec('0xb5')],_0x380296));}}});return Promise['all'](_0x31b28d);})[_0xe1ec('0x1c')](function(_0x14821d){_0x519747=_0x14821d[0x0];var _0x3ed0a5=[];var _0x10c5b9=[];_0xb93057[_0xe1ec('0xbb')](function(_0x58fdf3){if(_0x58fdf3[_0xe1ec('0xbc')]){var _0x1baccf=_0x58fdf3[_0xe1ec('0xbc')]['substring'](_0x58fdf3[_0xe1ec('0xbc')][_0xe1ec('0xaa')]('.')+0x1);if(_0x1baccf===_0xe1ec('0xc3')||_0x1baccf===_0xe1ec('0xc4')||_0x1baccf==='BigIntAttributeMetadata'||_0x1baccf===_0xe1ec('0xc5')||_0x1baccf===_0xe1ec('0xc6')||_0x1baccf===_0xe1ec('0xc7')||_0x1baccf==='StatusAttributeMetadata'||_0x1baccf===_0xe1ec('0xc8')||_0x1baccf===_0xe1ec('0xc9')||_0x1baccf===_0xe1ec('0xca')){_0x3ed0a5[_0xe1ec('0xbf')](getInputList(_0x3b7564,_0x452792,_0x1baccf,_0x10c5b9,_0x1fa316[_0xe1ec('0xb5')],_0x58fdf3[_0xe1ec('0xb5')],_0x380296));}}});return Promise['all'](_0x3ed0a5);})[_0xe1ec('0x1c')](function(_0x2e10b4){_0x31dc7d=_0x2e10b4[0x0];var _0x420118=_0x511a07['concat'](_0x519747)[_0xe1ec('0xa4')](_0x31dc7d);var _0x2661d6={'count':_0x420118[_0xe1ec('0x57')],'rows':_0x420118};return _0x2661d6;})[_0xe1ec('0x1c')](respondWithResult(_0x2a9d68,null))[_0xe1ec('0x25')](function(_0x1aa51f){var _0x4580e6=_0x594319[_0xe1ec('0x3a')][_0xe1ec('0x18')]?0x1f4:_0x1aa51f['statusCode']||0x1f4;logger['error'](_0x1aa51f[_0xe1ec('0x32')]);delete _0x1aa51f[_0xe1ec('0x33')];if(_0x4580e6===0x191){_0x4580e6=0x190;}_0x2a9d68['status'](_0x4580e6)[_0xe1ec('0x34')](_0x594319['query'][_0xe1ec('0x18')]?{'message':_0xe1ec('0xcb'),'statusCode':_0x1aa51f[_0xe1ec('0xcc')]}:_0x1aa51f);});};function getSelectList(_0x787e11,_0x3b452c,_0x133da4,_0x1a598e,_0x3159f9,_0x5a4175){var _0x29bf1d={'method':_0xe1ec('0xb2'),'uri':_0x787e11+_0xe1ec('0xb6')+_0x1a598e+_0xe1ec('0xcd')+_0x3159f9+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xe1ec('0xce'),'headers':{'Authorization':_0xe1ec('0xb3')+_0x5a4175,'If-None-Match':null,'OData-Version':_0xe1ec('0xb8')},'json':!![]};return rp(_0x29bf1d)[_0xe1ec('0x1c')](function(_0x535535){var _0x370e60=[];var _0x1c6c91=_0x535535[_0xe1ec('0xcf')]['Options'];_0x1c6c91[_0xe1ec('0xbb')](function(_0x4c0b13){_0x370e60[_0xe1ec('0xbf')]({'name':_0x4c0b13[_0xe1ec('0xd0')]['UserLocalizedLabel'][_0xe1ec('0xd0')],'value':String(_0x4c0b13[_0xe1ec('0xd1')])});});var _0x35a467={'id':_0x3b452c+'_'+_0x535535[_0xe1ec('0xd2')],'name':_0x535535[_0xe1ec('0xd3')][_0xe1ec('0xd4')]['Label'],'custom':![],'options':_0x370e60};_0x133da4['push'](_0x35a467);return _0x133da4;});}function getBooleanList(_0x16a465,_0x26fe9d,_0x5392b4,_0x44c9b5,_0x405bb1,_0x20ddda){var _0x2fbf71={'method':_0xe1ec('0xb2'),'uri':_0x16a465+_0xe1ec('0xb6')+_0x44c9b5+_0xe1ec('0xcd')+_0x405bb1+_0xe1ec('0xd5'),'headers':{'Authorization':_0xe1ec('0xb3')+_0x20ddda,'If-None-Match':null,'OData-Version':_0xe1ec('0xb8')},'json':!![]};return rp(_0x2fbf71)[_0xe1ec('0x1c')](function(_0xa106fc){var _0x4bf0d5=[];_0x4bf0d5[_0xe1ec('0xbf')]({'name':_0xa106fc['OptionSet'][_0xe1ec('0xd6')][_0xe1ec('0xd0')][_0xe1ec('0xd4')][_0xe1ec('0xd0')],'value':_0xe1ec('0xd7')},{'name':_0xa106fc['OptionSet'][_0xe1ec('0xd8')]['Label'][_0xe1ec('0xd4')]['Label'],'value':_0xe1ec('0xd9')});var _0x46d521={'id':_0x26fe9d+'_'+_0xa106fc[_0xe1ec('0xd2')],'name':_0xa106fc[_0xe1ec('0xd3')]['UserLocalizedLabel'][_0xe1ec('0xd0')],'custom':![],'options':_0x4bf0d5};_0x5392b4['push'](_0x46d521);return _0x5392b4;});}function getInputList(_0x1340fd,_0x3f6996,_0x13a870,_0x4039c7,_0x4030cf,_0x59554a,_0x168846){var _0x508832={'method':_0xe1ec('0xb2'),'uri':_0x1340fd+'EntityDefinitions('+_0x4030cf+_0xe1ec('0xcd')+_0x59554a+')/Microsoft.Dynamics.CRM.'+_0x13a870+_0xe1ec('0xda'),'headers':{'Authorization':_0xe1ec('0xb3')+_0x168846,'If-None-Match':null,'OData-Version':_0xe1ec('0xb8')},'json':!![]};return rp(_0x508832)[_0xe1ec('0x1c')](function(_0x9b2562){var _0xf5677f={'id':_0x3f6996+'_'+_0x9b2562[_0xe1ec('0xd2')],'name':_0x9b2562[_0xe1ec('0xd3')][_0xe1ec('0xd4')]?_0x9b2562[_0xe1ec('0xd3')]['UserLocalizedLabel'][_0xe1ec('0xd0')]:_0x9b2562[_0xe1ec('0xd2')],'custom':![],'options':[]};_0x4039c7['push'](_0xf5677f);return _0x4039c7;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index fc2e558..c150e6a 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 _0xa32a=['./intDynamics365Account.attributes','define','Dynamics365Account','int_dynamics365_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x40397c,_0x6ae591){var _0x426690=function(_0x54dd66){while(--_0x54dd66){_0x40397c['push'](_0x40397c['shift']());}};_0x426690(++_0x6ae591);}(_0xa32a,0xe1));var _0xaa32=function(_0x30aadd,_0x20a265){_0x30aadd=_0x30aadd-0x0;var _0x428865=_0xa32a[_0x30aadd];return _0x428865;};'use strict';var _=require(_0xaa32('0x0'));var util=require('util');var logger=require(_0xaa32('0x1'))(_0xaa32('0x2'));var moment=require(_0xaa32('0x3'));var BPromise=require(_0xaa32('0x4'));var rp=require(_0xaa32('0x5'));var fs=require('fs');var path=require(_0xaa32('0x6'));var rimraf=require(_0xaa32('0x7'));var config=require(_0xaa32('0x8'));var attributes=require(_0xaa32('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x28bce9,_0x35199d){return _0x28bce9[_0xaa32('0xa')](_0xaa32('0xb'),attributes,{'tableName':_0xaa32('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdfe=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','Dynamics365Account'];(function(_0xa96158,_0xf02370){var _0x33c3ca=function(_0x5056d7){while(--_0x5056d7){_0xa96158['push'](_0xa96158['shift']());}};_0x33c3ca(++_0xf02370);}(_0xbdfe,0x134));var _0xebdf=function(_0x2ab76b,_0x176579){_0x2ab76b=_0x2ab76b-0x0;var _0x201126=_0xbdfe[_0x2ab76b];return _0x201126;};'use strict';var _=require(_0xebdf('0x0'));var util=require(_0xebdf('0x1'));var logger=require(_0xebdf('0x2'))(_0xebdf('0x3'));var moment=require(_0xebdf('0x4'));var BPromise=require(_0xebdf('0x5'));var rp=require(_0xebdf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xebdf('0x7'));var config=require(_0xebdf('0x8'));var attributes=require(_0xebdf('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3622e1,_0x42a515){return _0x3622e1['define'](_0xebdf('0xa'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 5b2a006..d9eacc1 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 _0x8ad5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','map','include','model','ShowDynamics365Account','where','lodash','util','moment','bluebird'];(function(_0xa99357,_0x50ffad){var _0x111875=function(_0x4dce0c){while(--_0x4dce0c){_0xa99357['push'](_0xa99357['shift']());}};_0x111875(++_0x50ffad);}(_0x8ad5,0xf1));var _0x58ad=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x8ad5[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x58ad('0x0'));var util=require(_0x58ad('0x1'));var moment=require(_0x58ad('0x2'));var BPromise=require(_0x58ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58ad('0x4'))['db'];var utils=require(_0x58ad('0x5'));var logger=require(_0x58ad('0x6'))(_0x58ad('0x7'));var config=require(_0x58ad('0x8'));var jayson=require(_0x58ad('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x394972,_0x22c63f,_0x220c5f){return new BPromise(function(_0x2033a3,_0xe5d483){return client[_0x58ad('0xa')](_0x394972,_0x220c5f)[_0x58ad('0xb')](function(_0x14fa03){logger[_0x58ad('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x22c63f,_0x58ad('0xd'));logger[_0x58ad('0xe')](_0x58ad('0xf'),_0x22c63f,_0x58ad('0xd'),JSON[_0x58ad('0x10')](_0x14fa03));if(_0x14fa03[_0x58ad('0x11')]){if(_0x14fa03[_0x58ad('0x11')][_0x58ad('0x12')]===0x1f4){logger['error'](_0x58ad('0x13'),_0x22c63f,_0x14fa03[_0x58ad('0x11')][_0x58ad('0x14')]);return _0xe5d483(_0x14fa03[_0x58ad('0x11')][_0x58ad('0x14')]);}logger[_0x58ad('0x11')](_0x58ad('0x13'),_0x22c63f,_0x14fa03[_0x58ad('0x11')]['message']);return _0x2033a3(_0x14fa03['error']['message']);}else{logger['info'](_0x58ad('0x13'),_0x22c63f,'request\x20sent');_0x2033a3(_0x14fa03[_0x58ad('0x15')][_0x58ad('0x14')]);}})[_0x58ad('0x16')](function(_0x280618){logger[_0x58ad('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x22c63f,_0x280618);_0xe5d483(_0x280618);});});}exports[_0x58ad('0x17')]=function(_0x24fbe0){var _0x3233d8=this;return new Promise(function(_0xc8b034,_0x397027){return db[_0x58ad('0x18')][_0x58ad('0x19')]({'raw':_0x24fbe0[_0x58ad('0x1a')]?_0x24fbe0['options'][_0x58ad('0x1b')]===undefined?!![]:![]:!![],'where':_0x24fbe0[_0x58ad('0x1a')]?_0x24fbe0[_0x58ad('0x1a')]['where']||null:null,'attributes':_0x24fbe0[_0x58ad('0x1a')]?_0x24fbe0[_0x58ad('0x1a')][_0x58ad('0x1c')]||null:null,'limit':_0x24fbe0['options']?_0x24fbe0[_0x58ad('0x1a')][_0x58ad('0x1d')]||null:null,'include':_0x24fbe0[_0x58ad('0x1a')]?_0x24fbe0[_0x58ad('0x1a')]['include']?_[_0x58ad('0x1e')](_0x24fbe0[_0x58ad('0x1a')][_0x58ad('0x1f')],function(_0x5f7669){return{'model':db[_0x5f7669[_0x58ad('0x20')]],'as':_0x5f7669['as'],'attributes':_0x5f7669[_0x58ad('0x1c')],'include':_0x5f7669[_0x58ad('0x1f')]?_[_0x58ad('0x1e')](_0x5f7669['include'],function(_0x13220b){return{'model':db[_0x13220b['model']],'as':_0x13220b['as'],'attributes':_0x13220b[_0x58ad('0x1c')],'include':_0x13220b['include']?_['map'](_0x13220b[_0x58ad('0x1f')],function(_0x3d7d74){return{'model':db[_0x3d7d74[_0x58ad('0x20')]],'as':_0x3d7d74['as'],'attributes':_0x3d7d74[_0x58ad('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x58ad('0xb')](function(_0x4332c){logger[_0x58ad('0xc')](_0x58ad('0x17'),_0x24fbe0);logger[_0x58ad('0xe')](_0x58ad('0x17'),_0x24fbe0,JSON[_0x58ad('0x10')](_0x4332c));_0xc8b034(_0x4332c);})['catch'](function(_0x2bffbd){logger[_0x58ad('0x11')](_0x58ad('0x17'),_0x2bffbd[_0x58ad('0x14')],_0x24fbe0);_0x397027(_0x3233d8[_0x58ad('0x11')](0x1f4,_0x2bffbd['message']));});});};exports[_0x58ad('0x21')]=function(_0x35ee58){var _0x3850d4=this;return new Promise(function(_0x7dacc4,_0x370d12){return db['Dynamics365Account']['find']({'raw':_0x35ee58[_0x58ad('0x1a')]?_0x35ee58[_0x58ad('0x1a')][_0x58ad('0x1b')]===undefined?!![]:![]:!![],'where':_0x35ee58[_0x58ad('0x1a')]?_0x35ee58[_0x58ad('0x1a')][_0x58ad('0x22')]||null:null,'attributes':_0x35ee58[_0x58ad('0x1a')]?_0x35ee58[_0x58ad('0x1a')]['attributes']||null:null,'include':_0x35ee58[_0x58ad('0x1a')]?_0x35ee58[_0x58ad('0x1a')][_0x58ad('0x1f')]?_['map'](_0x35ee58[_0x58ad('0x1a')]['include'],function(_0x288f93){return{'model':db[_0x288f93[_0x58ad('0x20')]],'as':_0x288f93['as'],'attributes':_0x288f93['attributes'],'include':_0x288f93[_0x58ad('0x1f')]?_[_0x58ad('0x1e')](_0x288f93['include'],function(_0x4caf7b){return{'model':db[_0x4caf7b[_0x58ad('0x20')]],'as':_0x4caf7b['as'],'attributes':_0x4caf7b[_0x58ad('0x1c')],'include':_0x4caf7b['include']?_[_0x58ad('0x1e')](_0x4caf7b['include'],function(_0x5d7d8e){return{'model':db[_0x5d7d8e[_0x58ad('0x20')]],'as':_0x5d7d8e['as'],'attributes':_0x5d7d8e[_0x58ad('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x58ad('0xb')](function(_0x16b89c){logger[_0x58ad('0xc')]('ShowDynamics365Account',_0x35ee58);logger[_0x58ad('0xe')](_0x58ad('0x21'),_0x35ee58,JSON[_0x58ad('0x10')](_0x16b89c));_0x7dacc4(_0x16b89c);})[_0x58ad('0x16')](function(_0x3a24a2){logger['error'](_0x58ad('0x21'),_0x3a24a2[_0x58ad('0x14')],_0x35ee58);_0x370d12(_0x3850d4[_0x58ad('0x11')](0x1f4,_0x3a24a2['message']));});});}; \ No newline at end of file +var _0xaf0d=['request','request\x20sent','debug','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','map','include','model','then','ShowDynamics365Account','info','util','moment','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xaf0d,0x6d));var _0xdaf0=function(_0x3094bb,_0x3ee41f){_0x3094bb=_0x3094bb-0x0;var _0x4f73a2=_0xaf0d[_0x3094bb];return _0x4f73a2;};'use strict';var _=require('lodash');var util=require(_0xdaf0('0x0'));var moment=require(_0xdaf0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdaf0('0x2'))(_0xdaf0('0x3'));var config=require(_0xdaf0('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xdaf0('0x5')][_0xdaf0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x53aec7,_0x5ad050,_0x26bda3){return new BPromise(function(_0x1dc345,_0x16d746){return client[_0xdaf0('0x7')](_0x53aec7,_0x26bda3)['then'](function(_0x528d8a){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x5ad050,_0xdaf0('0x8'));logger[_0xdaf0('0x9')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x5ad050,_0xdaf0('0x8'),JSON[_0xdaf0('0xa')](_0x528d8a));if(_0x528d8a[_0xdaf0('0xb')]){if(_0x528d8a[_0xdaf0('0xb')]['code']===0x1f4){logger[_0xdaf0('0xb')](_0xdaf0('0xc'),_0x5ad050,_0x528d8a[_0xdaf0('0xb')]['message']);return _0x16d746(_0x528d8a[_0xdaf0('0xb')][_0xdaf0('0xd')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5ad050,_0x528d8a['error']['message']);return _0x1dc345(_0x528d8a['error'][_0xdaf0('0xd')]);}else{logger['info'](_0xdaf0('0xc'),_0x5ad050,'request\x20sent');_0x1dc345(_0x528d8a['result'][_0xdaf0('0xd')]);}})[_0xdaf0('0xe')](function(_0x370345){logger['error'](_0xdaf0('0xc'),_0x5ad050,_0x370345);_0x16d746(_0x370345);});});}exports[_0xdaf0('0xf')]=function(_0x21db47){var _0x4b8588=this;return new Promise(function(_0x5a2180,_0xb6b5e2){return db[_0xdaf0('0x10')][_0xdaf0('0x11')]({'raw':_0x21db47[_0xdaf0('0x12')]?_0x21db47[_0xdaf0('0x12')][_0xdaf0('0x13')]===undefined?!![]:![]:!![],'where':_0x21db47[_0xdaf0('0x12')]?_0x21db47['options'][_0xdaf0('0x14')]||null:null,'attributes':_0x21db47[_0xdaf0('0x12')]?_0x21db47[_0xdaf0('0x12')][_0xdaf0('0x15')]||null:null,'limit':_0x21db47['options']?_0x21db47[_0xdaf0('0x12')][_0xdaf0('0x16')]||null:null,'include':_0x21db47[_0xdaf0('0x12')]?_0x21db47[_0xdaf0('0x12')]['include']?_[_0xdaf0('0x17')](_0x21db47[_0xdaf0('0x12')][_0xdaf0('0x18')],function(_0x13abfc){return{'model':db[_0x13abfc[_0xdaf0('0x19')]],'as':_0x13abfc['as'],'attributes':_0x13abfc[_0xdaf0('0x15')],'include':_0x13abfc[_0xdaf0('0x18')]?_['map'](_0x13abfc[_0xdaf0('0x18')],function(_0x33e5c2){return{'model':db[_0x33e5c2[_0xdaf0('0x19')]],'as':_0x33e5c2['as'],'attributes':_0x33e5c2[_0xdaf0('0x15')],'include':_0x33e5c2[_0xdaf0('0x18')]?_[_0xdaf0('0x17')](_0x33e5c2[_0xdaf0('0x18')],function(_0x4d3347){return{'model':db[_0x4d3347[_0xdaf0('0x19')]],'as':_0x4d3347['as'],'attributes':_0x4d3347['attributes']};}):[]};}):[]};}):[]:[]})[_0xdaf0('0x1a')](function(_0x740ff){logger['info'](_0xdaf0('0xf'),_0x21db47);logger['debug'](_0xdaf0('0xf'),_0x21db47,JSON[_0xdaf0('0xa')](_0x740ff));_0x5a2180(_0x740ff);})['catch'](function(_0xaf86cb){logger[_0xdaf0('0xb')](_0xdaf0('0xf'),_0xaf86cb[_0xdaf0('0xd')],_0x21db47);_0xb6b5e2(_0x4b8588[_0xdaf0('0xb')](0x1f4,_0xaf86cb['message']));});});};exports[_0xdaf0('0x1b')]=function(_0x16821a){var _0x3018b8=this;return new Promise(function(_0x570df5,_0x443cc7){return db[_0xdaf0('0x10')]['find']({'raw':_0x16821a[_0xdaf0('0x12')]?_0x16821a[_0xdaf0('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x16821a[_0xdaf0('0x12')]?_0x16821a[_0xdaf0('0x12')][_0xdaf0('0x14')]||null:null,'attributes':_0x16821a[_0xdaf0('0x12')]?_0x16821a[_0xdaf0('0x12')][_0xdaf0('0x15')]||null:null,'include':_0x16821a[_0xdaf0('0x12')]?_0x16821a[_0xdaf0('0x12')][_0xdaf0('0x18')]?_[_0xdaf0('0x17')](_0x16821a[_0xdaf0('0x12')]['include'],function(_0x5b955e){return{'model':db[_0x5b955e['model']],'as':_0x5b955e['as'],'attributes':_0x5b955e[_0xdaf0('0x15')],'include':_0x5b955e[_0xdaf0('0x18')]?_['map'](_0x5b955e[_0xdaf0('0x18')],function(_0x2128cc){return{'model':db[_0x2128cc[_0xdaf0('0x19')]],'as':_0x2128cc['as'],'attributes':_0x2128cc[_0xdaf0('0x15')],'include':_0x2128cc[_0xdaf0('0x18')]?_[_0xdaf0('0x17')](_0x2128cc[_0xdaf0('0x18')],function(_0x399116){return{'model':db[_0x399116[_0xdaf0('0x19')]],'as':_0x399116['as'],'attributes':_0x399116[_0xdaf0('0x15')]};}):[]};}):[]};}):[]:[]})[_0xdaf0('0x1a')](function(_0x1a9838){logger[_0xdaf0('0x1c')](_0xdaf0('0x1b'),_0x16821a);logger[_0xdaf0('0x9')](_0xdaf0('0x1b'),_0x16821a,JSON[_0xdaf0('0xa')](_0x1a9838));_0x570df5(_0x1a9838);})['catch'](function(_0xe61d26){logger[_0xdaf0('0xb')](_0xdaf0('0x1b'),_0xe61d26[_0xdaf0('0xd')],_0x16821a);_0x443cc7(_0x3018b8[_0xdaf0('0xb')](0x1f4,_0xe61d26[_0xdaf0('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index b1517ae..b9f987e 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 _0x25a2=['index','/:id','show','/:id/fields','/:id/subjects','get','/:id/descriptions','create','put','update','delete','destroy','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated'];(function(_0x2078ff,_0x23c66f){var _0x4ee9ab=function(_0x3eb14c){while(--_0x3eb14c){_0x2078ff['push'](_0x2078ff['shift']());}};_0x4ee9ab(++_0x23c66f);}(_0x25a2,0x161));var _0x225a=function(_0x23837c,_0x1b559a){_0x23837c=_0x23837c-0x0;var _0xfb2461=_0x25a2[_0x23837c];return _0xfb2461;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x225a('0x0'));var express=require('express');var router=express[_0x225a('0x1')]();var auth=require(_0x225a('0x2'));var interaction=require(_0x225a('0x3'));var config=require(_0x225a('0x4'));var controller=require(_0x225a('0x5'));router['get']('/',auth[_0x225a('0x6')](),controller[_0x225a('0x7')]);router['get'](_0x225a('0x8'),auth[_0x225a('0x6')](),controller[_0x225a('0x9')]);router['get'](_0x225a('0xa'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x225a('0xb'),auth[_0x225a('0x6')](),controller['getSubjects']);router[_0x225a('0xc')](_0x225a('0xd'),auth[_0x225a('0x6')](),controller['getDescriptions']);router['post']('/',auth[_0x225a('0x6')](),controller[_0x225a('0xe')]);router[_0x225a('0xf')](_0x225a('0x8'),auth[_0x225a('0x6')](),controller[_0x225a('0x10')]);router[_0x225a('0x11')](_0x225a('0x8'),auth[_0x225a('0x6')](),controller[_0x225a('0x12')]);module[_0x225a('0x13')]=router; \ No newline at end of file +var _0x77e0=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','exports','multer'];(function(_0x2deb15,_0x102a17){var _0x1abb33=function(_0x1a1a10){while(--_0x1a1a10){_0x2deb15['push'](_0x2deb15['shift']());}};_0x1abb33(++_0x102a17);}(_0x77e0,0xdb));var _0x077e=function(_0x54df53,_0x170cfc){_0x54df53=_0x54df53-0x0;var _0x322e63=_0x77e0[_0x54df53];return _0x322e63;};'use strict';var multer=require(_0x077e('0x0'));var util=require(_0x077e('0x1'));var path=require(_0x077e('0x2'));var timeout=require(_0x077e('0x3'));var express=require(_0x077e('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x077e('0x5'));var config=require(_0x077e('0x6'));var controller=require(_0x077e('0x7'));router[_0x077e('0x8')]('/',auth[_0x077e('0x9')](),controller['index']);router['get'](_0x077e('0xa'),auth[_0x077e('0x9')](),controller[_0x077e('0xb')]);router[_0x077e('0x8')](_0x077e('0xc'),auth[_0x077e('0x9')](),controller[_0x077e('0xd')]);router[_0x077e('0x8')]('/:id/subjects',auth[_0x077e('0x9')](),controller[_0x077e('0xe')]);router['get'](_0x077e('0xf'),auth[_0x077e('0x9')](),controller[_0x077e('0x10')]);router[_0x077e('0x11')]('/',auth[_0x077e('0x9')](),controller['create']);router[_0x077e('0x12')](_0x077e('0xa'),auth[_0x077e('0x9')](),controller[_0x077e('0x13')]);router[_0x077e('0x14')](_0x077e('0xa'),auth[_0x077e('0x9')](),controller['destroy']);module[_0x077e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 45c4a58..f2a0e59 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 _0x0091=['sequelize','STRING','ENUM','incident','phonecall'];(function(_0x508bf1,_0x4e8400){var _0x1b8ce7=function(_0x2c51dd){while(--_0x2c51dd){_0x508bf1['push'](_0x508bf1['shift']());}};_0x1b8ce7(++_0x4e8400);}(_0x0091,0x15e));var _0x1009=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0091[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x1009('0x0'));module['exports']={'name':{'type':Sequelize[_0x1009('0x1')]},'description':{'type':Sequelize[_0x1009('0x1')]},'ticketType':{'type':Sequelize[_0x1009('0x2')](_0x1009('0x3'),_0x1009('0x4')),'defaultValue':_0x1009('0x3')}}; \ No newline at end of file +var _0x8ddf=['STRING','incident','phonecall','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8ddf,0x15f));var _0xf8dd=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x8ddf[_0x1ae5ab];return _0x1ce001;};'use strict';var Sequelize=require(_0xf8dd('0x0'));module['exports']={'name':{'type':Sequelize[_0xf8dd('0x1')]},'description':{'type':Sequelize[_0xf8dd('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xf8dd('0x2'),_0xf8dd('0x3')),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 8993841..ec56e57 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 _0x01ff=['fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','where','VIRTUAL','merge','options','rows','show','params','includeAll','include','create','body','find','getFields','findOne','Dynamics365Field','rawAttributes','sort','filter','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','client','http','test','Sequelize','ValidationError','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','update','destroy','stack','name','send','index','map','Dynamics365Configuration'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x01ff,0x12d));var _0xf01f=function(_0x5222c9,_0x462060){_0x5222c9=_0x5222c9-0x0;var _0x1e53d6=_0x01ff[_0x5222c9];return _0x1e53d6;};'use strict';var pdf=require(_0xf01f('0x0'));var emlformat=require(_0xf01f('0x1'));var rimraf=require(_0xf01f('0x2'));var zipdir=require(_0xf01f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf01f('0x4'));var moment=require(_0xf01f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf01f('0x6'));var path=require('path');var sox=require(_0xf01f('0x7'));var csv=require(_0xf01f('0x8'));var ejs=require(_0xf01f('0x9'));var fs=require('fs');var _=require(_0xf01f('0xa'));var squel=require(_0xf01f('0xb'));var crypto=require('crypto');var jsforce=require(_0xf01f('0xc'));var deskjs=require(_0xf01f('0xd'));var toCsv=require(_0xf01f('0x8'));var querystring=require(_0xf01f('0xe'));var Papa=require(_0xf01f('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf01f('0x10'));var as=require(_0xf01f('0x11'));var hardwareService=require(_0xf01f('0x12'));var logger=require(_0xf01f('0x13'))(_0xf01f('0x14'));var utils=require(_0xf01f('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xf01f('0x16')][_0xf01f('0x17')]({'port':0x232a});function checkPasswordPattern(_0x87f7d7,_0x9a2908,_0x4e7386){if(_0x4e7386){var _0x36a94a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36a94a[_0xf01f('0x18')](_0x9a2908)){return _0x87f7d7;}else{throw new db[(_0xf01f('0x19'))][(_0xf01f('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 _0x87f7d7;}}function respondWithRpcPromise(_0x4faf15,_0x5dbdfe,_0x1644b5,_0x25ca26){return new BPromise(function(_0x59cdde,_0x4888f6){var _0x1a65f2=_0x25ca26||client;return _0x1a65f2[_0xf01f('0x1b')](_0x4faf15,_0x1644b5)[_0xf01f('0x1c')](function(_0x2de57f){logger[_0xf01f('0x1d')](_0xf01f('0x1e'),_0x5dbdfe,_0xf01f('0x1f'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5dbdfe,_0xf01f('0x1f'),JSON[_0xf01f('0x20')](_0x2de57f));if(_0x2de57f[_0xf01f('0x21')]){if(_0x2de57f[_0xf01f('0x21')]['code']===0x1f4){logger[_0xf01f('0x21')](_0xf01f('0x1e'),_0x5dbdfe,_0x2de57f[_0xf01f('0x21')][_0xf01f('0x22')]);return _0x4888f6(_0x2de57f['error'][_0xf01f('0x22')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x5dbdfe,_0x2de57f[_0xf01f('0x21')][_0xf01f('0x22')]);return _0x59cdde(_0x2de57f[_0xf01f('0x21')][_0xf01f('0x22')]);}else{logger[_0xf01f('0x1d')](_0xf01f('0x1e'),_0x5dbdfe,'request\x20sent');_0x59cdde(_0x2de57f[_0xf01f('0x23')][_0xf01f('0x22')]);}})[_0xf01f('0x24')](function(_0x42c699){logger[_0xf01f('0x21')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5dbdfe,_0x42c699);_0x4888f6(_0x42c699);});});}function respondWithStatusCode(_0x1fac56,_0x3b00c9){_0x3b00c9=_0x3b00c9||0xcc;return function(_0xaa7291){if(_0xaa7291){return _0x1fac56[_0xf01f('0x25')](_0x3b00c9);}return _0x1fac56[_0xf01f('0x26')](_0x3b00c9)[_0xf01f('0x27')]();};}function respondWithResult(_0x48bec3,_0x2ae007){_0x2ae007=_0x2ae007||0xc8;return function(_0x317dbc){if(_0x317dbc){return _0x48bec3[_0xf01f('0x26')](_0x2ae007)['json'](_0x317dbc);}};}function respondWithFilteredResult(_0xe173a9,_0x178779){return function(_0x4e25b7){if(_0x4e25b7){var _0x4a6159=_0x4e25b7[_0xf01f('0x28')],_0x49875d=_0x178779[_0xf01f('0x29')],_0xdf65b9=_0x178779[_0xf01f('0x29')]+_0x178779[_0xf01f('0x2a')],_0x3bb732;if(_0xdf65b9>=_0x4a6159){_0xdf65b9=_0x4a6159;_0x3bb732=0xc8;}else{_0x3bb732=0xce;}_0xe173a9[_0xf01f('0x26')](_0x3bb732);return _0xe173a9[_0xf01f('0x2b')](_0xf01f('0x2c'),_0x49875d+'-'+_0xdf65b9+'/'+_0x4a6159)[_0xf01f('0x2d')](_0x4e25b7);}return null;};}function patchUpdates(_0x54ac59){return function(_0x276a33){try{jsonpatch[_0xf01f('0x2e')](_0x276a33,_0x54ac59,!![]);}catch(_0x300bf4){return BPromise['reject'](_0x300bf4);}return _0x276a33['save']();};}function saveUpdates(_0x227f47,_0x17e4be){return function(_0x191f29){if(_0x191f29){return _0x191f29[_0xf01f('0x2f')](_0x227f47)[_0xf01f('0x1c')](function(_0x28b7e3){return _0x28b7e3;});}return null;};}function removeEntity(_0x3cd1a3,_0x30e533){return function(_0x3d4288){if(_0x3d4288){return _0x3d4288[_0xf01f('0x30')]()[_0xf01f('0x1c')](function(){_0x3cd1a3['status'](0xcc)[_0xf01f('0x27')]();});}};}function handleEntityNotFound(_0x19a26a,_0x3f2068){return function(_0x10fa29){if(!_0x10fa29){_0x19a26a[_0xf01f('0x25')](0x194);}return _0x10fa29;};}function handleError(_0x4c7594,_0x62e36d){_0x62e36d=_0x62e36d||0x1f4;return function(_0x373efd){logger[_0xf01f('0x21')](_0x373efd[_0xf01f('0x31')]);if(_0x373efd[_0xf01f('0x32')]){delete _0x373efd[_0xf01f('0x32')];}_0x4c7594[_0xf01f('0x26')](_0x62e36d)[_0xf01f('0x33')](_0x373efd);};}exports[_0xf01f('0x34')]=function(_0x10eded,_0x176d18){var _0x526994={},_0x399f90={},_0x3f3a68={'count':0x0,'rows':[]};var _0x4aebca=_[_0xf01f('0x35')](db[_0xf01f('0x36')]['rawAttributes'],function(_0x5a2346){return{'name':_0x5a2346[_0xf01f('0x37')],'type':_0x5a2346['type'][_0xf01f('0x38')]};});_0x399f90[_0xf01f('0x39')]=_['map'](_0x4aebca,'name');_0x399f90['query']=_[_0xf01f('0x3a')](_0x10eded[_0xf01f('0x3b')]);_0x399f90[_0xf01f('0x3c')]=_['intersection'](_0x399f90[_0xf01f('0x39')],_0x399f90[_0xf01f('0x3b')]);_0x526994[_0xf01f('0x3d')]=_[_0xf01f('0x3e')](_0x399f90[_0xf01f('0x39')],qs['fields'](_0x10eded['query'][_0xf01f('0x3f')]));_0x526994['attributes']=_0x526994['attributes'][_0xf01f('0x40')]?_0x526994[_0xf01f('0x3d')]:_0x399f90[_0xf01f('0x39')];if(!_0x10eded['query'][_0xf01f('0x41')](_0xf01f('0x42'))){_0x526994[_0xf01f('0x2a')]=qs['limit'](_0x10eded['query'][_0xf01f('0x2a')]);_0x526994[_0xf01f('0x29')]=qs['offset'](_0x10eded['query']['offset']);}_0x526994[_0xf01f('0x43')]=qs['sort'](_0x10eded[_0xf01f('0x3b')]['sort']);_0x526994['where']=qs[_0xf01f('0x3c')](_[_0xf01f('0x44')](_0x10eded[_0xf01f('0x3b')],_0x399f90[_0xf01f('0x3c')]));if(_0x10eded['query']['filter']){_0x526994[_0xf01f('0x45')]=_['merge'](_0x526994[_0xf01f('0x45')],{'$or':_['map'](_0x4aebca,function(_0x22bb3f){if(_0x22bb3f['type']!==_0xf01f('0x46')){var _0x316001={};_0x316001[_0x22bb3f[_0xf01f('0x32')]]={'$like':'%'+_0x10eded['query']['filter']+'%'};return _0x316001;}})});}_0x526994=_[_0xf01f('0x47')]({},_0x526994,_0x10eded[_0xf01f('0x48')]);var _0x1108c7={'where':_0x526994[_0xf01f('0x45')]};return db['Dynamics365Configuration'][_0xf01f('0x28')](_0x1108c7)['then'](function(_0x25f070){_0x3f3a68[_0xf01f('0x28')]=_0x25f070;if(_0x10eded[_0xf01f('0x3b')]['includeAll']){_0x526994['include']=[{'all':!![]}];}return db[_0xf01f('0x36')]['findAll'](_0x526994);})[_0xf01f('0x1c')](function(_0x46e7d9){_0x3f3a68[_0xf01f('0x49')]=_0x46e7d9;return _0x3f3a68;})[_0xf01f('0x1c')](respondWithFilteredResult(_0x176d18,_0x526994))[_0xf01f('0x24')](handleError(_0x176d18,null));};exports[_0xf01f('0x4a')]=function(_0x278c0e,_0x27fbca){var _0x507b1d={'raw':![],'where':{'id':_0x278c0e[_0xf01f('0x4b')]['id']}},_0x49e9ea={};_0x49e9ea[_0xf01f('0x39')]=_[_0xf01f('0x3a')](db[_0xf01f('0x36')]['rawAttributes']);_0x49e9ea[_0xf01f('0x3b')]=_[_0xf01f('0x3a')](_0x278c0e['query']);_0x49e9ea[_0xf01f('0x3c')]=_[_0xf01f('0x3e')](_0x49e9ea[_0xf01f('0x39')],_0x49e9ea[_0xf01f('0x3b')]);_0x507b1d['attributes']=_[_0xf01f('0x3e')](_0x49e9ea[_0xf01f('0x39')],qs[_0xf01f('0x3f')](_0x278c0e[_0xf01f('0x3b')][_0xf01f('0x3f')]));_0x507b1d['attributes']=_0x507b1d[_0xf01f('0x3d')][_0xf01f('0x40')]?_0x507b1d[_0xf01f('0x3d')]:_0x49e9ea[_0xf01f('0x39')];if(_0x278c0e[_0xf01f('0x3b')][_0xf01f('0x4c')]){_0x507b1d[_0xf01f('0x4d')]=[{'all':!![]}];}_0x507b1d=_[_0xf01f('0x47')]({},_0x507b1d,_0x278c0e[_0xf01f('0x48')]);return db[_0xf01f('0x36')]['find'](_0x507b1d)[_0xf01f('0x1c')](handleEntityNotFound(_0x27fbca,null))[_0xf01f('0x1c')](respondWithResult(_0x27fbca,null))[_0xf01f('0x24')](handleError(_0x27fbca,null));};exports['create']=function(_0x410093,_0x4b0c2d){return db[_0xf01f('0x36')][_0xf01f('0x4e')](_0x410093[_0xf01f('0x4f')],{})[_0xf01f('0x1c')](respondWithResult(_0x4b0c2d,0xc9))[_0xf01f('0x24')](handleError(_0x4b0c2d,null));};exports[_0xf01f('0x2f')]=function(_0xb87efa,_0x54ca38){if(_0xb87efa[_0xf01f('0x4f')]['id']){delete _0xb87efa[_0xf01f('0x4f')]['id'];}return db[_0xf01f('0x36')][_0xf01f('0x50')]({'where':{'id':_0xb87efa[_0xf01f('0x4b')]['id']}})[_0xf01f('0x1c')](handleEntityNotFound(_0x54ca38,null))[_0xf01f('0x1c')](saveUpdates(_0xb87efa[_0xf01f('0x4f')],null))[_0xf01f('0x1c')](respondWithResult(_0x54ca38,null))['catch'](handleError(_0x54ca38,null));};exports[_0xf01f('0x30')]=function(_0x412b64,_0x144fd9){return db[_0xf01f('0x36')][_0xf01f('0x50')]({'where':{'id':_0x412b64[_0xf01f('0x4b')]['id']}})[_0xf01f('0x1c')](handleEntityNotFound(_0x144fd9,null))[_0xf01f('0x1c')](removeEntity(_0x144fd9,null))[_0xf01f('0x24')](handleError(_0x144fd9,null));};exports[_0xf01f('0x51')]=function(_0x4fcfca,_0x1bf8e4,_0x164785){var _0x2fa060={};var _0x451e98={};var _0x294037;var _0x4d663c;return db['Dynamics365Configuration'][_0xf01f('0x52')]({'where':{'id':_0x4fcfca['params']['id']}})[_0xf01f('0x1c')](handleEntityNotFound(_0x1bf8e4,null))[_0xf01f('0x1c')](function(_0x50a373){if(_0x50a373){_0x294037=_0x50a373;_0x451e98[_0xf01f('0x39')]=_[_0xf01f('0x3a')](db[_0xf01f('0x53')][_0xf01f('0x54')]);_0x451e98[_0xf01f('0x3b')]=_[_0xf01f('0x3a')](_0x4fcfca[_0xf01f('0x3b')]);_0x451e98[_0xf01f('0x3c')]=_[_0xf01f('0x3e')](_0x451e98['model'],_0x451e98[_0xf01f('0x3b')]);_0x2fa060[_0xf01f('0x3d')]=_[_0xf01f('0x3e')](_0x451e98['model'],qs[_0xf01f('0x3f')](_0x4fcfca[_0xf01f('0x3b')][_0xf01f('0x3f')]));_0x2fa060[_0xf01f('0x3d')]=_0x2fa060[_0xf01f('0x3d')][_0xf01f('0x40')]?_0x2fa060[_0xf01f('0x3d')]:_0x451e98[_0xf01f('0x39')];_0x2fa060['order']=qs[_0xf01f('0x55')](_0x4fcfca[_0xf01f('0x3b')][_0xf01f('0x55')]);_0x2fa060[_0xf01f('0x45')]=qs[_0xf01f('0x3c')](_['pick'](_0x4fcfca[_0xf01f('0x3b')],_0x451e98[_0xf01f('0x3c')]));if(_0x4fcfca[_0xf01f('0x3b')][_0xf01f('0x56')]){_0x2fa060['where']=_[_0xf01f('0x47')](_0x2fa060[_0xf01f('0x45')],{'$or':_[_0xf01f('0x35')](_0x2fa060[_0xf01f('0x3d')],function(_0x1cfd42){var _0x39b6fa={};_0x39b6fa[_0x1cfd42]={'$like':'%'+_0x4fcfca[_0xf01f('0x3b')][_0xf01f('0x56')]+'%'};return _0x39b6fa;})});}_0x2fa060=_[_0xf01f('0x47')]({},_0x2fa060,_0x4fcfca['options']);return _0x294037['getFields'](_0x2fa060);}})[_0xf01f('0x1c')](function(_0x31d71f){if(_0x31d71f){_0x4d663c=_0x31d71f[_0xf01f('0x40')];if(!_0x4fcfca[_0xf01f('0x3b')][_0xf01f('0x41')]('nolimit')){_0x2fa060[_0xf01f('0x2a')]=qs['limit'](_0x4fcfca[_0xf01f('0x3b')][_0xf01f('0x2a')]);_0x2fa060[_0xf01f('0x29')]=qs[_0xf01f('0x29')](_0x4fcfca[_0xf01f('0x3b')][_0xf01f('0x29')]);}return _0x294037[_0xf01f('0x51')](_0x2fa060);}})['then'](function(_0x1a0ef8){if(_0x1a0ef8){return _0x1a0ef8?{'count':_0x4d663c,'rows':_0x1a0ef8}:null;}})[_0xf01f('0x1c')](respondWithResult(_0x1bf8e4,null))[_0xf01f('0x24')](handleError(_0x1bf8e4,null));};exports[_0xf01f('0x57')]=function(_0x1b7c7b,_0x28d3bd,_0x401378){var _0x38abc2={};var _0x1327d9={};var _0x14e169;var _0x416a33;return db[_0xf01f('0x36')][_0xf01f('0x52')]({'where':{'id':_0x1b7c7b[_0xf01f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x28d3bd,null))[_0xf01f('0x1c')](function(_0x5a9248){if(_0x5a9248){_0x14e169=_0x5a9248;_0x1327d9[_0xf01f('0x39')]=_[_0xf01f('0x3a')](db['Dynamics365Field'][_0xf01f('0x54')]);_0x1327d9[_0xf01f('0x3b')]=_[_0xf01f('0x3a')](_0x1b7c7b[_0xf01f('0x3b')]);_0x1327d9[_0xf01f('0x3c')]=_[_0xf01f('0x3e')](_0x1327d9[_0xf01f('0x39')],_0x1327d9[_0xf01f('0x3b')]);_0x38abc2[_0xf01f('0x3d')]=_[_0xf01f('0x3e')](_0x1327d9[_0xf01f('0x39')],qs[_0xf01f('0x3f')](_0x1b7c7b['query']['fields']));_0x38abc2['attributes']=_0x38abc2[_0xf01f('0x3d')][_0xf01f('0x40')]?_0x38abc2[_0xf01f('0x3d')]:_0x1327d9[_0xf01f('0x39')];_0x38abc2[_0xf01f('0x43')]=qs['sort'](_0x1b7c7b[_0xf01f('0x3b')][_0xf01f('0x55')]);_0x38abc2[_0xf01f('0x45')]=qs[_0xf01f('0x3c')](_[_0xf01f('0x44')](_0x1b7c7b[_0xf01f('0x3b')],_0x1327d9[_0xf01f('0x3c')]));if(_0x1b7c7b['query'][_0xf01f('0x56')]){_0x38abc2[_0xf01f('0x45')]=_['merge'](_0x38abc2[_0xf01f('0x45')],{'$or':_[_0xf01f('0x35')](_0x38abc2['attributes'],function(_0x43ce8c){var _0x3f1a62={};_0x3f1a62[_0x43ce8c]={'$like':'%'+_0x1b7c7b[_0xf01f('0x3b')][_0xf01f('0x56')]+'%'};return _0x3f1a62;})});}_0x38abc2=_[_0xf01f('0x47')]({},_0x38abc2,_0x1b7c7b[_0xf01f('0x48')]);return _0x14e169[_0xf01f('0x57')](_0x38abc2);}})[_0xf01f('0x1c')](function(_0x39702a){if(_0x39702a){_0x416a33=_0x39702a['length'];if(!_0x1b7c7b[_0xf01f('0x3b')][_0xf01f('0x41')]('nolimit')){_0x38abc2[_0xf01f('0x2a')]=qs[_0xf01f('0x2a')](_0x1b7c7b[_0xf01f('0x3b')][_0xf01f('0x2a')]);_0x38abc2['offset']=qs[_0xf01f('0x29')](_0x1b7c7b[_0xf01f('0x3b')][_0xf01f('0x29')]);}return _0x14e169[_0xf01f('0x57')](_0x38abc2);}})['then'](function(_0x2a0aad){if(_0x2a0aad){return _0x2a0aad?{'count':_0x416a33,'rows':_0x2a0aad}:null;}})[_0xf01f('0x1c')](respondWithResult(_0x28d3bd,null))[_0xf01f('0x24')](handleError(_0x28d3bd,null));};exports['getDescriptions']=function(_0x3b21d6,_0x175d2d,_0x527dc0){var _0x55055a={};var _0x4b0f12={};var _0x2e379c;var _0x19d48f;return db[_0xf01f('0x36')][_0xf01f('0x52')]({'where':{'id':_0x3b21d6[_0xf01f('0x4b')]['id']}})[_0xf01f('0x1c')](handleEntityNotFound(_0x175d2d,null))[_0xf01f('0x1c')](function(_0x9c20c4){if(_0x9c20c4){_0x2e379c=_0x9c20c4;_0x4b0f12[_0xf01f('0x39')]=_[_0xf01f('0x3a')](db[_0xf01f('0x53')]['rawAttributes']);_0x4b0f12[_0xf01f('0x3b')]=_[_0xf01f('0x3a')](_0x3b21d6[_0xf01f('0x3b')]);_0x4b0f12[_0xf01f('0x3c')]=_['intersection'](_0x4b0f12[_0xf01f('0x39')],_0x4b0f12[_0xf01f('0x3b')]);_0x55055a['attributes']=_[_0xf01f('0x3e')](_0x4b0f12[_0xf01f('0x39')],qs['fields'](_0x3b21d6[_0xf01f('0x3b')][_0xf01f('0x3f')]));_0x55055a[_0xf01f('0x3d')]=_0x55055a['attributes'][_0xf01f('0x40')]?_0x55055a[_0xf01f('0x3d')]:_0x4b0f12[_0xf01f('0x39')];_0x55055a[_0xf01f('0x43')]=qs[_0xf01f('0x55')](_0x3b21d6[_0xf01f('0x3b')][_0xf01f('0x55')]);_0x55055a[_0xf01f('0x45')]=qs[_0xf01f('0x3c')](_[_0xf01f('0x44')](_0x3b21d6[_0xf01f('0x3b')],_0x4b0f12[_0xf01f('0x3c')]));if(_0x3b21d6[_0xf01f('0x3b')][_0xf01f('0x56')]){_0x55055a['where']=_[_0xf01f('0x47')](_0x55055a[_0xf01f('0x45')],{'$or':_[_0xf01f('0x35')](_0x55055a['attributes'],function(_0x4183c3){var _0x14d016={};_0x14d016[_0x4183c3]={'$like':'%'+_0x3b21d6[_0xf01f('0x3b')][_0xf01f('0x56')]+'%'};return _0x14d016;})});}_0x55055a=_[_0xf01f('0x47')]({},_0x55055a,_0x3b21d6['options']);return _0x2e379c[_0xf01f('0x58')](_0x55055a);}})[_0xf01f('0x1c')](function(_0x294bd4){if(_0x294bd4){_0x19d48f=_0x294bd4['length'];if(!_0x3b21d6[_0xf01f('0x3b')]['hasOwnProperty'](_0xf01f('0x42'))){_0x55055a[_0xf01f('0x2a')]=qs[_0xf01f('0x2a')](_0x3b21d6[_0xf01f('0x3b')][_0xf01f('0x2a')]);_0x55055a[_0xf01f('0x29')]=qs[_0xf01f('0x29')](_0x3b21d6[_0xf01f('0x3b')]['offset']);}return _0x2e379c[_0xf01f('0x58')](_0x55055a);}})[_0xf01f('0x1c')](function(_0x42f805){if(_0x42f805){return _0x42f805?{'count':_0x19d48f,'rows':_0x42f805}:null;}})[_0xf01f('0x1c')](respondWithResult(_0x175d2d,null))[_0xf01f('0x24')](handleError(_0x175d2d,null));}; \ No newline at end of file +var _0x0353=['offset','limit','apply','reject','update','destroy','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','getFields','findOne','Dynamics365Field','pick','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','moment','bluebird','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/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count'];(function(_0x578131,_0x15425f){var _0x3f1b45=function(_0x53b32e){while(--_0x53b32e){_0x578131['push'](_0x578131['shift']());}};_0x3f1b45(++_0x15425f);}(_0x0353,0x8e));var _0x3035=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x0353[_0x28611e];return _0x530f69;};'use strict';var pdf=require(_0x3035('0x0'));var emlformat=require(_0x3035('0x1'));var rimraf=require(_0x3035('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3035('0x3'));var BPromise=require(_0x3035('0x4'));var Mustache=require('mustache');var util=require(_0x3035('0x5'));var path=require(_0x3035('0x6'));var sox=require(_0x3035('0x7'));var csv=require(_0x3035('0x8'));var ejs=require(_0x3035('0x9'));var fs=require('fs');var _=require(_0x3035('0xa'));var squel=require(_0x3035('0xb'));var crypto=require(_0x3035('0xc'));var jsforce=require(_0x3035('0xd'));var deskjs=require(_0x3035('0xe'));var toCsv=require(_0x3035('0x8'));var querystring=require(_0x3035('0xf'));var Papa=require(_0x3035('0x10'));var Redis=require(_0x3035('0x11'));var authService=require(_0x3035('0x12'));var qs=require(_0x3035('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3035('0x14'));var logger=require(_0x3035('0x15'))(_0x3035('0x16'));var utils=require('../../config/utils');var config=require(_0x3035('0x17'));var db=require(_0x3035('0x18'))['db'];var jayson=require(_0x3035('0x19'));var client=jayson['client'][_0x3035('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x344011,_0x1bbebe,_0x4e6cbe){if(_0x4e6cbe){var _0x260968=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x260968[_0x3035('0x1b')](_0x1bbebe)){return _0x344011;}else{throw new db[(_0x3035('0x1c'))][(_0x3035('0x1d'))](_0x3035('0x1e'));}}else{return _0x344011;}}function respondWithRpcPromise(_0x5e3834,_0x31ae36,_0x3d42ab,_0x263759){return new BPromise(function(_0xeed4a6,_0x28da89){var _0x1fe810=_0x263759||client;return _0x1fe810[_0x3035('0x1f')](_0x5e3834,_0x3d42ab)[_0x3035('0x20')](function(_0x46c21c){logger[_0x3035('0x21')](_0x3035('0x22'),_0x31ae36,_0x3035('0x23'));logger[_0x3035('0x24')](_0x3035('0x25'),_0x31ae36,_0x3035('0x23'),JSON['stringify'](_0x46c21c));if(_0x46c21c[_0x3035('0x26')]){if(_0x46c21c['error'][_0x3035('0x27')]===0x1f4){logger[_0x3035('0x26')]('Dynamics365Configuration,\x20%s,\x20%s',_0x31ae36,_0x46c21c['error'][_0x3035('0x28')]);return _0x28da89(_0x46c21c[_0x3035('0x26')][_0x3035('0x28')]);}logger[_0x3035('0x26')](_0x3035('0x22'),_0x31ae36,_0x46c21c['error'][_0x3035('0x28')]);return _0xeed4a6(_0x46c21c['error'][_0x3035('0x28')]);}else{logger[_0x3035('0x21')](_0x3035('0x22'),_0x31ae36,_0x3035('0x23'));_0xeed4a6(_0x46c21c[_0x3035('0x29')][_0x3035('0x28')]);}})[_0x3035('0x2a')](function(_0x5a33d3){logger['error'](_0x3035('0x22'),_0x31ae36,_0x5a33d3);_0x28da89(_0x5a33d3);});});}function respondWithStatusCode(_0x2951ba,_0x2ab643){_0x2ab643=_0x2ab643||0xcc;return function(_0x3336bb){if(_0x3336bb){return _0x2951ba[_0x3035('0x2b')](_0x2ab643);}return _0x2951ba[_0x3035('0x2c')](_0x2ab643)[_0x3035('0x2d')]();};}function respondWithResult(_0xb3a380,_0x570505){_0x570505=_0x570505||0xc8;return function(_0x3791cd){if(_0x3791cd){return _0xb3a380[_0x3035('0x2c')](_0x570505)[_0x3035('0x2e')](_0x3791cd);}};}function respondWithFilteredResult(_0x2ae50c,_0x2ebc38){return function(_0x12f03f){if(_0x12f03f){var _0x4ba6b9=_0x12f03f[_0x3035('0x2f')],_0x10cb6f=_0x2ebc38[_0x3035('0x30')],_0x34bb29=_0x2ebc38['offset']+_0x2ebc38[_0x3035('0x31')],_0x26e51f;if(_0x34bb29>=_0x4ba6b9){_0x34bb29=_0x4ba6b9;_0x26e51f=0xc8;}else{_0x26e51f=0xce;}_0x2ae50c[_0x3035('0x2c')](_0x26e51f);return _0x2ae50c['set']('Content-Range',_0x10cb6f+'-'+_0x34bb29+'/'+_0x4ba6b9)[_0x3035('0x2e')](_0x12f03f);}return null;};}function patchUpdates(_0x1864fb){return function(_0x1e638a){try{jsonpatch[_0x3035('0x32')](_0x1e638a,_0x1864fb,!![]);}catch(_0x51e2fe){return BPromise[_0x3035('0x33')](_0x51e2fe);}return _0x1e638a['save']();};}function saveUpdates(_0x237893,_0xc8e023){return function(_0x2920e0){if(_0x2920e0){return _0x2920e0[_0x3035('0x34')](_0x237893)['then'](function(_0x2e6ca7){return _0x2e6ca7;});}return null;};}function removeEntity(_0x41a60c,_0x5e0f75){return function(_0x14c65b){if(_0x14c65b){return _0x14c65b[_0x3035('0x35')]()[_0x3035('0x20')](function(){_0x41a60c[_0x3035('0x2c')](0xcc)[_0x3035('0x2d')]();});}};}function handleEntityNotFound(_0x2dcdbd,_0x5985be){return function(_0x4000de){if(!_0x4000de){_0x2dcdbd[_0x3035('0x2b')](0x194);}return _0x4000de;};}function handleError(_0x5dbbe2,_0x2c5983){_0x2c5983=_0x2c5983||0x1f4;return function(_0x440fb6){logger['error'](_0x440fb6[_0x3035('0x36')]);if(_0x440fb6['name']){delete _0x440fb6[_0x3035('0x37')];}_0x5dbbe2[_0x3035('0x2c')](_0x2c5983)[_0x3035('0x38')](_0x440fb6);};}exports[_0x3035('0x39')]=function(_0xbf68dd,_0x1c190f){var _0x2dd455={},_0x3b33b1={},_0x8838e2={'count':0x0,'rows':[]};var _0x135d1c=_[_0x3035('0x3a')](db[_0x3035('0x3b')][_0x3035('0x3c')],function(_0x3c7033){return{'name':_0x3c7033[_0x3035('0x3d')],'type':_0x3c7033[_0x3035('0x3e')][_0x3035('0x3f')]};});_0x3b33b1[_0x3035('0x40')]=_['map'](_0x135d1c,_0x3035('0x37'));_0x3b33b1[_0x3035('0x41')]=_[_0x3035('0x42')](_0xbf68dd[_0x3035('0x41')]);_0x3b33b1['filters']=_[_0x3035('0x43')](_0x3b33b1['model'],_0x3b33b1['query']);_0x2dd455['attributes']=_[_0x3035('0x43')](_0x3b33b1[_0x3035('0x40')],qs[_0x3035('0x44')](_0xbf68dd[_0x3035('0x41')][_0x3035('0x44')]));_0x2dd455[_0x3035('0x45')]=_0x2dd455[_0x3035('0x45')][_0x3035('0x46')]?_0x2dd455[_0x3035('0x45')]:_0x3b33b1['model'];if(!_0xbf68dd['query'][_0x3035('0x47')](_0x3035('0x48'))){_0x2dd455[_0x3035('0x31')]=qs['limit'](_0xbf68dd['query'][_0x3035('0x31')]);_0x2dd455['offset']=qs['offset'](_0xbf68dd[_0x3035('0x41')][_0x3035('0x30')]);}_0x2dd455[_0x3035('0x49')]=qs[_0x3035('0x4a')](_0xbf68dd['query'][_0x3035('0x4a')]);_0x2dd455[_0x3035('0x4b')]=qs[_0x3035('0x4c')](_['pick'](_0xbf68dd[_0x3035('0x41')],_0x3b33b1[_0x3035('0x4c')]));if(_0xbf68dd['query'][_0x3035('0x4d')]){_0x2dd455['where']=_[_0x3035('0x4e')](_0x2dd455['where'],{'$or':_['map'](_0x135d1c,function(_0x28ca83){if(_0x28ca83[_0x3035('0x3e')]!==_0x3035('0x4f')){var _0x35a3e1={};_0x35a3e1[_0x28ca83[_0x3035('0x37')]]={'$like':'%'+_0xbf68dd['query']['filter']+'%'};return _0x35a3e1;}})});}_0x2dd455=_['merge']({},_0x2dd455,_0xbf68dd[_0x3035('0x50')]);var _0x1515c4={'where':_0x2dd455[_0x3035('0x4b')]};return db[_0x3035('0x3b')][_0x3035('0x2f')](_0x1515c4)[_0x3035('0x20')](function(_0x2cdd22){_0x8838e2['count']=_0x2cdd22;if(_0xbf68dd[_0x3035('0x41')][_0x3035('0x51')]){_0x2dd455[_0x3035('0x52')]=[{'all':!![]}];}return db[_0x3035('0x3b')]['findAll'](_0x2dd455);})['then'](function(_0x5e02f3){_0x8838e2[_0x3035('0x53')]=_0x5e02f3;return _0x8838e2;})['then'](respondWithFilteredResult(_0x1c190f,_0x2dd455))[_0x3035('0x2a')](handleError(_0x1c190f,null));};exports[_0x3035('0x54')]=function(_0x29f3fe,_0x3c8cf4){var _0x5dd07d={'raw':![],'where':{'id':_0x29f3fe[_0x3035('0x55')]['id']}},_0x580f42={};_0x580f42['model']=_[_0x3035('0x42')](db[_0x3035('0x3b')][_0x3035('0x3c')]);_0x580f42[_0x3035('0x41')]=_[_0x3035('0x42')](_0x29f3fe[_0x3035('0x41')]);_0x580f42[_0x3035('0x4c')]=_[_0x3035('0x43')](_0x580f42['model'],_0x580f42[_0x3035('0x41')]);_0x5dd07d[_0x3035('0x45')]=_['intersection'](_0x580f42[_0x3035('0x40')],qs[_0x3035('0x44')](_0x29f3fe['query'][_0x3035('0x44')]));_0x5dd07d[_0x3035('0x45')]=_0x5dd07d[_0x3035('0x45')][_0x3035('0x46')]?_0x5dd07d['attributes']:_0x580f42[_0x3035('0x40')];if(_0x29f3fe[_0x3035('0x41')][_0x3035('0x51')]){_0x5dd07d[_0x3035('0x52')]=[{'all':!![]}];}_0x5dd07d=_[_0x3035('0x4e')]({},_0x5dd07d,_0x29f3fe[_0x3035('0x50')]);return db['Dynamics365Configuration'][_0x3035('0x56')](_0x5dd07d)[_0x3035('0x20')](handleEntityNotFound(_0x3c8cf4,null))[_0x3035('0x20')](respondWithResult(_0x3c8cf4,null))[_0x3035('0x2a')](handleError(_0x3c8cf4,null));};exports[_0x3035('0x57')]=function(_0x5c801d,_0x5014f2){return db[_0x3035('0x3b')]['create'](_0x5c801d[_0x3035('0x58')],{})[_0x3035('0x20')](respondWithResult(_0x5014f2,0xc9))[_0x3035('0x2a')](handleError(_0x5014f2,null));};exports[_0x3035('0x34')]=function(_0x19d1e9,_0x4e5c8b){if(_0x19d1e9[_0x3035('0x58')]['id']){delete _0x19d1e9[_0x3035('0x58')]['id'];}return db[_0x3035('0x3b')]['find']({'where':{'id':_0x19d1e9['params']['id']}})[_0x3035('0x20')](handleEntityNotFound(_0x4e5c8b,null))[_0x3035('0x20')](saveUpdates(_0x19d1e9[_0x3035('0x58')],null))[_0x3035('0x20')](respondWithResult(_0x4e5c8b,null))[_0x3035('0x2a')](handleError(_0x4e5c8b,null));};exports[_0x3035('0x35')]=function(_0x178dca,_0x37d013){return db[_0x3035('0x3b')][_0x3035('0x56')]({'where':{'id':_0x178dca[_0x3035('0x55')]['id']}})[_0x3035('0x20')](handleEntityNotFound(_0x37d013,null))[_0x3035('0x20')](removeEntity(_0x37d013,null))[_0x3035('0x2a')](handleError(_0x37d013,null));};exports[_0x3035('0x59')]=function(_0x27b53f,_0x43d194,_0x2418f9){var _0x50528d={};var _0xfbf726={};var _0xcf129;var _0x38415d;return db[_0x3035('0x3b')][_0x3035('0x5a')]({'where':{'id':_0x27b53f[_0x3035('0x55')]['id']}})[_0x3035('0x20')](handleEntityNotFound(_0x43d194,null))[_0x3035('0x20')](function(_0x18dadb){if(_0x18dadb){_0xcf129=_0x18dadb;_0xfbf726['model']=_[_0x3035('0x42')](db[_0x3035('0x5b')][_0x3035('0x3c')]);_0xfbf726['query']=_[_0x3035('0x42')](_0x27b53f['query']);_0xfbf726[_0x3035('0x4c')]=_[_0x3035('0x43')](_0xfbf726['model'],_0xfbf726[_0x3035('0x41')]);_0x50528d[_0x3035('0x45')]=_['intersection'](_0xfbf726['model'],qs['fields'](_0x27b53f[_0x3035('0x41')][_0x3035('0x44')]));_0x50528d[_0x3035('0x45')]=_0x50528d[_0x3035('0x45')][_0x3035('0x46')]?_0x50528d[_0x3035('0x45')]:_0xfbf726[_0x3035('0x40')];_0x50528d[_0x3035('0x49')]=qs['sort'](_0x27b53f['query'][_0x3035('0x4a')]);_0x50528d[_0x3035('0x4b')]=qs[_0x3035('0x4c')](_[_0x3035('0x5c')](_0x27b53f[_0x3035('0x41')],_0xfbf726['filters']));if(_0x27b53f['query'][_0x3035('0x4d')]){_0x50528d[_0x3035('0x4b')]=_['merge'](_0x50528d['where'],{'$or':_[_0x3035('0x3a')](_0x50528d['attributes'],function(_0x4999c0){var _0x45bcaa={};_0x45bcaa[_0x4999c0]={'$like':'%'+_0x27b53f['query'][_0x3035('0x4d')]+'%'};return _0x45bcaa;})});}_0x50528d=_[_0x3035('0x4e')]({},_0x50528d,_0x27b53f['options']);return _0xcf129[_0x3035('0x59')](_0x50528d);}})[_0x3035('0x20')](function(_0x13eb45){if(_0x13eb45){_0x38415d=_0x13eb45['length'];if(!_0x27b53f[_0x3035('0x41')][_0x3035('0x47')]('nolimit')){_0x50528d[_0x3035('0x31')]=qs[_0x3035('0x31')](_0x27b53f[_0x3035('0x41')][_0x3035('0x31')]);_0x50528d[_0x3035('0x30')]=qs[_0x3035('0x30')](_0x27b53f[_0x3035('0x41')][_0x3035('0x30')]);}return _0xcf129['getFields'](_0x50528d);}})[_0x3035('0x20')](function(_0x815668){if(_0x815668){return _0x815668?{'count':_0x38415d,'rows':_0x815668}:null;}})['then'](respondWithResult(_0x43d194,null))[_0x3035('0x2a')](handleError(_0x43d194,null));};exports[_0x3035('0x5d')]=function(_0xacb99a,_0x54a999,_0x693dac){var _0x22e484={};var _0x2cda75={};var _0x2d0d82;var _0x5f50ca;return db[_0x3035('0x3b')]['findOne']({'where':{'id':_0xacb99a[_0x3035('0x55')]['id']}})['then'](handleEntityNotFound(_0x54a999,null))[_0x3035('0x20')](function(_0x171815){if(_0x171815){_0x2d0d82=_0x171815;_0x2cda75[_0x3035('0x40')]=_[_0x3035('0x42')](db['Dynamics365Field'][_0x3035('0x3c')]);_0x2cda75[_0x3035('0x41')]=_[_0x3035('0x42')](_0xacb99a[_0x3035('0x41')]);_0x2cda75[_0x3035('0x4c')]=_['intersection'](_0x2cda75[_0x3035('0x40')],_0x2cda75[_0x3035('0x41')]);_0x22e484[_0x3035('0x45')]=_[_0x3035('0x43')](_0x2cda75[_0x3035('0x40')],qs[_0x3035('0x44')](_0xacb99a[_0x3035('0x41')][_0x3035('0x44')]));_0x22e484[_0x3035('0x45')]=_0x22e484['attributes'][_0x3035('0x46')]?_0x22e484[_0x3035('0x45')]:_0x2cda75[_0x3035('0x40')];_0x22e484[_0x3035('0x49')]=qs[_0x3035('0x4a')](_0xacb99a['query'][_0x3035('0x4a')]);_0x22e484['where']=qs['filters'](_[_0x3035('0x5c')](_0xacb99a[_0x3035('0x41')],_0x2cda75[_0x3035('0x4c')]));if(_0xacb99a[_0x3035('0x41')]['filter']){_0x22e484['where']=_[_0x3035('0x4e')](_0x22e484[_0x3035('0x4b')],{'$or':_[_0x3035('0x3a')](_0x22e484['attributes'],function(_0x3457b6){var _0x3458b1={};_0x3458b1[_0x3457b6]={'$like':'%'+_0xacb99a[_0x3035('0x41')][_0x3035('0x4d')]+'%'};return _0x3458b1;})});}_0x22e484=_['merge']({},_0x22e484,_0xacb99a[_0x3035('0x50')]);return _0x2d0d82[_0x3035('0x5d')](_0x22e484);}})['then'](function(_0x5bca23){if(_0x5bca23){_0x5f50ca=_0x5bca23[_0x3035('0x46')];if(!_0xacb99a[_0x3035('0x41')]['hasOwnProperty']('nolimit')){_0x22e484[_0x3035('0x31')]=qs[_0x3035('0x31')](_0xacb99a['query'][_0x3035('0x31')]);_0x22e484[_0x3035('0x30')]=qs[_0x3035('0x30')](_0xacb99a['query'][_0x3035('0x30')]);}return _0x2d0d82['getSubjects'](_0x22e484);}})[_0x3035('0x20')](function(_0x3743cb){if(_0x3743cb){return _0x3743cb?{'count':_0x5f50ca,'rows':_0x3743cb}:null;}})[_0x3035('0x20')](respondWithResult(_0x54a999,null))['catch'](handleError(_0x54a999,null));};exports[_0x3035('0x5e')]=function(_0x324560,_0xe21561,_0x41f4c9){var _0x19bf99={};var _0x2a212b={};var _0x32deee;var _0x4e2268;return db['Dynamics365Configuration'][_0x3035('0x5a')]({'where':{'id':_0x324560[_0x3035('0x55')]['id']}})['then'](handleEntityNotFound(_0xe21561,null))[_0x3035('0x20')](function(_0x3b7fe1){if(_0x3b7fe1){_0x32deee=_0x3b7fe1;_0x2a212b[_0x3035('0x40')]=_[_0x3035('0x42')](db[_0x3035('0x5b')]['rawAttributes']);_0x2a212b[_0x3035('0x41')]=_[_0x3035('0x42')](_0x324560[_0x3035('0x41')]);_0x2a212b['filters']=_[_0x3035('0x43')](_0x2a212b[_0x3035('0x40')],_0x2a212b[_0x3035('0x41')]);_0x19bf99[_0x3035('0x45')]=_[_0x3035('0x43')](_0x2a212b[_0x3035('0x40')],qs[_0x3035('0x44')](_0x324560[_0x3035('0x41')][_0x3035('0x44')]));_0x19bf99[_0x3035('0x45')]=_0x19bf99[_0x3035('0x45')][_0x3035('0x46')]?_0x19bf99[_0x3035('0x45')]:_0x2a212b['model'];_0x19bf99[_0x3035('0x49')]=qs[_0x3035('0x4a')](_0x324560[_0x3035('0x41')][_0x3035('0x4a')]);_0x19bf99[_0x3035('0x4b')]=qs[_0x3035('0x4c')](_[_0x3035('0x5c')](_0x324560['query'],_0x2a212b[_0x3035('0x4c')]));if(_0x324560[_0x3035('0x41')][_0x3035('0x4d')]){_0x19bf99[_0x3035('0x4b')]=_[_0x3035('0x4e')](_0x19bf99[_0x3035('0x4b')],{'$or':_[_0x3035('0x3a')](_0x19bf99[_0x3035('0x45')],function(_0x41affd){var _0x27688d={};_0x27688d[_0x41affd]={'$like':'%'+_0x324560['query']['filter']+'%'};return _0x27688d;})});}_0x19bf99=_[_0x3035('0x4e')]({},_0x19bf99,_0x324560[_0x3035('0x50')]);return _0x32deee[_0x3035('0x5e')](_0x19bf99);}})[_0x3035('0x20')](function(_0x4a813c){if(_0x4a813c){_0x4e2268=_0x4a813c[_0x3035('0x46')];if(!_0x324560[_0x3035('0x41')][_0x3035('0x47')]('nolimit')){_0x19bf99[_0x3035('0x31')]=qs[_0x3035('0x31')](_0x324560[_0x3035('0x41')][_0x3035('0x31')]);_0x19bf99[_0x3035('0x30')]=qs['offset'](_0x324560[_0x3035('0x41')][_0x3035('0x30')]);}return _0x32deee[_0x3035('0x5e')](_0x19bf99);}})[_0x3035('0x20')](function(_0x3b0120){if(_0x3b0120){return _0x3b0120?{'count':_0x4e2268,'rows':_0x3b0120}:null;}})[_0x3035('0x20')](respondWithResult(_0xe21561,null))[_0x3035('0x2a')](handleError(_0xe21561,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 6c2bd5e..36f97bd 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 _0x75b8=['Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0xcfeb67,_0x538c8c){var _0x2b5282=function(_0x2d2a0d){while(--_0x2d2a0d){_0xcfeb67['push'](_0xcfeb67['shift']());}};_0x2b5282(++_0x538c8c);}(_0x75b8,0x9e));var _0x875b=function(_0x23be51,_0xc02a1b){_0x23be51=_0x23be51-0x0;var _0x47a26d=_0x75b8[_0x23be51];return _0x47a26d;};'use strict';var _=require(_0x875b('0x0'));var util=require(_0x875b('0x1'));var logger=require(_0x875b('0x2'))(_0x875b('0x3'));var moment=require(_0x875b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x875b('0x5'));var rimraf=require(_0x875b('0x6'));var config=require(_0x875b('0x7'));var attributes=require(_0x875b('0x8'));module[_0x875b('0x9')]=function(_0x50a8a4,_0x2b6fd3){return _0x50a8a4[_0x875b('0xa')](_0x875b('0xb'),attributes,{'tableName':_0x875b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x409e=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','lodash'];(function(_0x2353fe,_0x4b0bca){var _0x4d43f6=function(_0x5d0bd9){while(--_0x5d0bd9){_0x2353fe['push'](_0x2353fe['shift']());}};_0x4d43f6(++_0x4b0bca);}(_0x409e,0x1a3));var _0xe409=function(_0x485f53,_0x104081){_0x485f53=_0x485f53-0x0;var _0x480f1e=_0x409e[_0x485f53];return _0x480f1e;};'use strict';var _=require(_0xe409('0x0'));var util=require(_0xe409('0x1'));var logger=require(_0xe409('0x2'))('api');var moment=require(_0xe409('0x3'));var BPromise=require(_0xe409('0x4'));var rp=require(_0xe409('0x5'));var fs=require('fs');var path=require(_0xe409('0x6'));var rimraf=require(_0xe409('0x7'));var config=require(_0xe409('0x8'));var attributes=require(_0xe409('0x9'));module[_0xe409('0xa')]=function(_0x1118b6,_0x3d9cb2){return _0x1118b6[_0xe409('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','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 babfc09..7a2692e 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 _0x131b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash'];(function(_0x5454a2,_0x5a9b6a){var _0x1f241f=function(_0x333d8d){while(--_0x333d8d){_0x5454a2['push'](_0x5454a2['shift']());}};_0x1f241f(++_0x5a9b6a);}(_0x131b,0xf1));var _0xb131=function(_0x494c6f,_0x54dbe7){_0x494c6f=_0x494c6f-0x0;var _0x4c9c08=_0x131b[_0x494c6f];return _0x4c9c08;};'use strict';var _=require(_0xb131('0x0'));var util=require('util');var moment=require(_0xb131('0x1'));var BPromise=require(_0xb131('0x2'));var rs=require(_0xb131('0x3'));var fs=require('fs');var Redis=require(_0xb131('0x4'));var db=require(_0xb131('0x5'))['db'];var utils=require(_0xb131('0x6'));var logger=require(_0xb131('0x7'))(_0xb131('0x8'));var config=require(_0xb131('0x9'));var jayson=require(_0xb131('0xa'));var client=jayson[_0xb131('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50436c,_0xee358e,_0x72972f){return new BPromise(function(_0x7917ee,_0xb56319){return client[_0xb131('0xc')](_0x50436c,_0x72972f)[_0xb131('0xd')](function(_0x16007f){logger[_0xb131('0xe')](_0xb131('0xf'),_0xee358e,_0xb131('0x10'));logger[_0xb131('0x11')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0xee358e,'request\x20sent',JSON['stringify'](_0x16007f));if(_0x16007f[_0xb131('0x12')]){if(_0x16007f['error'][_0xb131('0x13')]===0x1f4){logger['error'](_0xb131('0xf'),_0xee358e,_0x16007f[_0xb131('0x12')][_0xb131('0x14')]);return _0xb56319(_0x16007f['error']['message']);}logger['error'](_0xb131('0xf'),_0xee358e,_0x16007f['error'][_0xb131('0x14')]);return _0x7917ee(_0x16007f[_0xb131('0x12')][_0xb131('0x14')]);}else{logger['info'](_0xb131('0xf'),_0xee358e,_0xb131('0x10'));_0x7917ee(_0x16007f['result'][_0xb131('0x14')]);}})[_0xb131('0x15')](function(_0x3c0987){logger['error'](_0xb131('0xf'),_0xee358e,_0x3c0987);_0xb56319(_0x3c0987);});});} \ No newline at end of file +var _0x19f3=['result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x514b40,_0x1945f4){var _0x40b68f=function(_0x57d1e3){while(--_0x57d1e3){_0x514b40['push'](_0x514b40['shift']());}};_0x40b68f(++_0x1945f4);}(_0x19f3,0x142));var _0x319f=function(_0xfee10f,_0x53470e){_0xfee10f=_0xfee10f-0x0;var _0xb91051=_0x19f3[_0xfee10f];return _0xb91051;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x319f('0x0'));var BPromise=require(_0x319f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x319f('0x2'))['db'];var utils=require(_0x319f('0x3'));var logger=require(_0x319f('0x4'))(_0x319f('0x5'));var config=require(_0x319f('0x6'));var jayson=require(_0x319f('0x7'));var client=jayson[_0x319f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f8d92,_0x247e8f,_0x44008d){return new BPromise(function(_0x5621d1,_0x4e419){return client['request'](_0x2f8d92,_0x44008d)[_0x319f('0x9')](function(_0x1a7af0){logger[_0x319f('0xa')](_0x319f('0xb'),_0x247e8f,_0x319f('0xc'));logger[_0x319f('0xd')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x247e8f,_0x319f('0xc'),JSON[_0x319f('0xe')](_0x1a7af0));if(_0x1a7af0[_0x319f('0xf')]){if(_0x1a7af0['error'][_0x319f('0x10')]===0x1f4){logger[_0x319f('0xf')](_0x319f('0xb'),_0x247e8f,_0x1a7af0[_0x319f('0xf')][_0x319f('0x11')]);return _0x4e419(_0x1a7af0['error'][_0x319f('0x11')]);}logger[_0x319f('0xf')](_0x319f('0xb'),_0x247e8f,_0x1a7af0[_0x319f('0xf')][_0x319f('0x11')]);return _0x5621d1(_0x1a7af0['error']['message']);}else{logger[_0x319f('0xa')](_0x319f('0xb'),_0x247e8f,_0x319f('0xc'));_0x5621d1(_0x1a7af0[_0x319f('0x12')][_0x319f('0x11')]);}})[_0x319f('0x13')](function(_0x29b38b){logger[_0x319f('0xf')](_0x319f('0xb'),_0x247e8f,_0x29b38b);_0x4e419(_0x29b38b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index e3dd62c..bd0cb79 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 _0xb58b=['put','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x45504c,_0xb1b9b9){var _0x58ce6f=function(_0x39989a){while(--_0x39989a){_0x45504c['push'](_0x45504c['shift']());}};_0x58ce6f(++_0xb1b9b9);}(_0xb58b,0x1f1));var _0xbb58=function(_0x1f4a0c,_0x901279){_0x1f4a0c=_0x1f4a0c-0x0;var _0x3ba284=_0xb58b[_0x1f4a0c];return _0x3ba284;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var auth=require(_0xbb58('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbb58('0x5'));var controller=require('./intDynamics365Field.controller');router[_0xbb58('0x6')]('/',auth[_0xbb58('0x7')](),controller[_0xbb58('0x8')]);router['get'](_0xbb58('0x9'),auth[_0xbb58('0x7')](),controller[_0xbb58('0xa')]);router[_0xbb58('0xb')]('/',auth[_0xbb58('0x7')](),controller[_0xbb58('0xc')]);router[_0xbb58('0xd')](_0xbb58('0x9'),auth[_0xbb58('0x7')](),controller[_0xbb58('0xe')]);router[_0xbb58('0xf')]('/:id',auth[_0xbb58('0x7')](),controller['destroy']);module[_0xbb58('0x10')]=router; \ No newline at end of file +var _0x3667=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var path=require(_0x7366('0x2'));var timeout=require(_0x7366('0x3'));var express=require(_0x7366('0x4'));var router=express['Router']();var auth=require(_0x7366('0x5'));var interaction=require(_0x7366('0x6'));var config=require('../../config/environment');var controller=require(_0x7366('0x7'));router[_0x7366('0x8')]('/',auth[_0x7366('0x9')](),controller[_0x7366('0xa')]);router[_0x7366('0x8')]('/:id',auth[_0x7366('0x9')](),controller[_0x7366('0xb')]);router[_0x7366('0xc')]('/',auth[_0x7366('0x9')](),controller[_0x7366('0xd')]);router[_0x7366('0xe')](_0x7366('0xf'),auth[_0x7366('0x9')](),controller[_0x7366('0x10')]);router[_0x7366('0x11')](_0x7366('0xf'),auth[_0x7366('0x9')](),controller[_0x7366('0x12')]);module[_0x7366('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 078a463..44c78e7 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 _0xfd7f=['exports','ENUM','string','STRING','variable','customVariable'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xfd7f,0xba));var _0xffd7=function(_0x1c8eca,_0x4a069d){_0x1c8eca=_0x1c8eca-0x0;var _0x349d81=_0xfd7f[_0x1c8eca];return _0x349d81;};'use strict';var Sequelize=require('sequelize');module[_0xffd7('0x0')]={'type':{'type':Sequelize[_0xffd7('0x1')]('string','variable','customVariable','keyValue'),'defaultValue':_0xffd7('0x2')},'content':{'type':Sequelize[_0xffd7('0x3')]},'key':{'type':Sequelize[_0xffd7('0x3')]},'keyType':{'type':Sequelize[_0xffd7('0x1')](_0xffd7('0x2'),_0xffd7('0x4'),_0xffd7('0x5'))},'keyContent':{'type':Sequelize[_0xffd7('0x3')]},'idField':{'type':Sequelize[_0xffd7('0x3')]},'nameField':{'type':Sequelize[_0xffd7('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xffd7('0x3')]}}; \ No newline at end of file +var _0x78b7=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x1a7324,_0x4fd76d){var _0xe7e111=function(_0x4c059a){while(--_0x4c059a){_0x1a7324['push'](_0x1a7324['shift']());}};_0xe7e111(++_0x4fd76d);}(_0x78b7,0x1ae));var _0x778b=function(_0x3ff853,_0x1ed201){_0x3ff853=_0x3ff853-0x0;var _0x38dbed=_0x78b7[_0x3ff853];return _0x38dbed;};'use strict';var Sequelize=require(_0x778b('0x0'));module[_0x778b('0x1')]={'type':{'type':Sequelize[_0x778b('0x2')](_0x778b('0x3'),_0x778b('0x4'),_0x778b('0x5'),_0x778b('0x6')),'defaultValue':_0x778b('0x3')},'content':{'type':Sequelize[_0x778b('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x778b('0x3'),'variable',_0x778b('0x5'))},'keyContent':{'type':Sequelize[_0x778b('0x7')]},'idField':{'type':Sequelize[_0x778b('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x778b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index f20830b..0c3a27c 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 _0x4cc7=['end','json','offset','limit','set','apply','reject','save','then','destroy','error','stack','name','index','map','Dynamics365Field','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','keys','find','catch','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0xf2d1bf,_0x19c53a){var _0x388d2c=function(_0x217e55){while(--_0x217e55){_0xf2d1bf['push'](_0xf2d1bf['shift']());}};_0x388d2c(++_0x19c53a);}(_0x4cc7,0x1b6));var _0x74cc=function(_0x376f9a,_0x9cd467){_0x376f9a=_0x376f9a-0x0;var _0x35a9e8=_0x4cc7[_0x376f9a];return _0x35a9e8;};'use strict';var pdf=require(_0x74cc('0x0'));var emlformat=require(_0x74cc('0x1'));var rimraf=require(_0x74cc('0x2'));var zipdir=require(_0x74cc('0x3'));var jsonpatch=require(_0x74cc('0x4'));var rp=require(_0x74cc('0x5'));var moment=require(_0x74cc('0x6'));var BPromise=require(_0x74cc('0x7'));var Mustache=require('mustache');var util=require(_0x74cc('0x8'));var path=require(_0x74cc('0x9'));var sox=require(_0x74cc('0xa'));var csv=require(_0x74cc('0xb'));var ejs=require(_0x74cc('0xc'));var fs=require('fs');var _=require(_0x74cc('0xd'));var squel=require(_0x74cc('0xe'));var crypto=require(_0x74cc('0xf'));var jsforce=require(_0x74cc('0x10'));var deskjs=require(_0x74cc('0x11'));var toCsv=require(_0x74cc('0xb'));var querystring=require(_0x74cc('0x12'));var Papa=require(_0x74cc('0x13'));var Redis=require('ioredis');var authService=require(_0x74cc('0x14'));var qs=require(_0x74cc('0x15'));var as=require(_0x74cc('0x16'));var hardwareService=require(_0x74cc('0x17'));var logger=require(_0x74cc('0x18'))(_0x74cc('0x19'));var utils=require(_0x74cc('0x1a'));var config=require(_0x74cc('0x1b'));var db=require(_0x74cc('0x1c'))['db'];function respondWithStatusCode(_0x338ae9,_0x34939c){_0x34939c=_0x34939c||0xcc;return function(_0x31c6bd){if(_0x31c6bd){return _0x338ae9['sendStatus'](_0x34939c);}return _0x338ae9[_0x74cc('0x1d')](_0x34939c)[_0x74cc('0x1e')]();};}function respondWithResult(_0x59c20f,_0x566061){_0x566061=_0x566061||0xc8;return function(_0x1a2814){if(_0x1a2814){return _0x59c20f[_0x74cc('0x1d')](_0x566061)[_0x74cc('0x1f')](_0x1a2814);}};}function respondWithFilteredResult(_0x1d248c,_0x2c3c81){return function(_0x336069){if(_0x336069){var _0x2f317c=_0x336069['count'],_0x47e76b=_0x2c3c81[_0x74cc('0x20')],_0x363163=_0x2c3c81[_0x74cc('0x20')]+_0x2c3c81[_0x74cc('0x21')],_0x5d8c7b;if(_0x363163>=_0x2f317c){_0x363163=_0x2f317c;_0x5d8c7b=0xc8;}else{_0x5d8c7b=0xce;}_0x1d248c[_0x74cc('0x1d')](_0x5d8c7b);return _0x1d248c[_0x74cc('0x22')]('Content-Range',_0x47e76b+'-'+_0x363163+'/'+_0x2f317c)[_0x74cc('0x1f')](_0x336069);}return null;};}function patchUpdates(_0x1bd301){return function(_0x1072a5){try{jsonpatch[_0x74cc('0x23')](_0x1072a5,_0x1bd301,!![]);}catch(_0x2885c0){return BPromise[_0x74cc('0x24')](_0x2885c0);}return _0x1072a5[_0x74cc('0x25')]();};}function saveUpdates(_0x261bf7,_0x477605){return function(_0x341bcb){if(_0x341bcb){return _0x341bcb['update'](_0x261bf7)[_0x74cc('0x26')](function(_0x2d0912){return _0x2d0912;});}return null;};}function removeEntity(_0x3b0e23,_0x36a77a){return function(_0x433583){if(_0x433583){return _0x433583[_0x74cc('0x27')]()[_0x74cc('0x26')](function(){_0x3b0e23[_0x74cc('0x1d')](0xcc)[_0x74cc('0x1e')]();});}};}function handleEntityNotFound(_0x49ccbe,_0x2dfdf4){return function(_0x3c327d){if(!_0x3c327d){_0x49ccbe['sendStatus'](0x194);}return _0x3c327d;};}function handleError(_0x44c079,_0x1a2707){_0x1a2707=_0x1a2707||0x1f4;return function(_0x255f17){logger[_0x74cc('0x28')](_0x255f17[_0x74cc('0x29')]);if(_0x255f17['name']){delete _0x255f17[_0x74cc('0x2a')];}_0x44c079[_0x74cc('0x1d')](_0x1a2707)['send'](_0x255f17);};}exports[_0x74cc('0x2b')]=function(_0x34147f,_0x2843f6){var _0x1a7739={},_0x31daaa={},_0x14e374={'count':0x0,'rows':[]};var _0x581872=_[_0x74cc('0x2c')](db[_0x74cc('0x2d')]['rawAttributes'],function(_0x49b780){return{'name':_0x49b780[_0x74cc('0x2e')],'type':_0x49b780[_0x74cc('0x2f')][_0x74cc('0x30')]};});_0x31daaa[_0x74cc('0x31')]=_[_0x74cc('0x2c')](_0x581872,_0x74cc('0x2a'));_0x31daaa[_0x74cc('0x32')]=_['keys'](_0x34147f[_0x74cc('0x32')]);_0x31daaa[_0x74cc('0x33')]=_[_0x74cc('0x34')](_0x31daaa['model'],_0x31daaa[_0x74cc('0x32')]);_0x1a7739[_0x74cc('0x35')]=_[_0x74cc('0x34')](_0x31daaa[_0x74cc('0x31')],qs[_0x74cc('0x36')](_0x34147f[_0x74cc('0x32')][_0x74cc('0x36')]));_0x1a7739[_0x74cc('0x35')]=_0x1a7739[_0x74cc('0x35')][_0x74cc('0x37')]?_0x1a7739[_0x74cc('0x35')]:_0x31daaa[_0x74cc('0x31')];if(!_0x34147f[_0x74cc('0x32')][_0x74cc('0x38')](_0x74cc('0x39'))){_0x1a7739[_0x74cc('0x21')]=qs[_0x74cc('0x21')](_0x34147f['query']['limit']);_0x1a7739[_0x74cc('0x20')]=qs[_0x74cc('0x20')](_0x34147f[_0x74cc('0x32')][_0x74cc('0x20')]);}_0x1a7739[_0x74cc('0x3a')]=qs[_0x74cc('0x3b')](_0x34147f[_0x74cc('0x32')][_0x74cc('0x3b')]);_0x1a7739[_0x74cc('0x3c')]=qs[_0x74cc('0x33')](_[_0x74cc('0x3d')](_0x34147f[_0x74cc('0x32')],_0x31daaa['filters']));if(_0x34147f['query'][_0x74cc('0x3e')]){_0x1a7739[_0x74cc('0x3c')]=_[_0x74cc('0x3f')](_0x1a7739[_0x74cc('0x3c')],{'$or':_[_0x74cc('0x2c')](_0x581872,function(_0x981ade){if(_0x981ade[_0x74cc('0x2f')]!==_0x74cc('0x40')){var _0x3b2fc3={};_0x3b2fc3[_0x981ade[_0x74cc('0x2a')]]={'$like':'%'+_0x34147f[_0x74cc('0x32')][_0x74cc('0x3e')]+'%'};return _0x3b2fc3;}})});}_0x1a7739=_[_0x74cc('0x3f')]({},_0x1a7739,_0x34147f[_0x74cc('0x41')]);var _0x2e4a6a={'where':_0x1a7739[_0x74cc('0x3c')]};return db[_0x74cc('0x2d')][_0x74cc('0x42')](_0x2e4a6a)[_0x74cc('0x26')](function(_0x305a74){_0x14e374['count']=_0x305a74;if(_0x34147f[_0x74cc('0x32')][_0x74cc('0x43')]){_0x1a7739[_0x74cc('0x44')]=[{'all':!![]}];}return db[_0x74cc('0x2d')]['findAll'](_0x1a7739);})[_0x74cc('0x26')](function(_0x277ebc){_0x14e374[_0x74cc('0x45')]=_0x277ebc;return _0x14e374;})[_0x74cc('0x26')](respondWithFilteredResult(_0x2843f6,_0x1a7739))['catch'](handleError(_0x2843f6,null));};exports[_0x74cc('0x46')]=function(_0x5651a6,_0x5e148e){var _0x5728f4={'raw':!![],'where':{'id':_0x5651a6[_0x74cc('0x47')]['id']}},_0x224983={};_0x224983[_0x74cc('0x31')]=_[_0x74cc('0x48')](db[_0x74cc('0x2d')]['rawAttributes']);_0x224983['query']=_[_0x74cc('0x48')](_0x5651a6[_0x74cc('0x32')]);_0x224983['filters']=_[_0x74cc('0x34')](_0x224983[_0x74cc('0x31')],_0x224983['query']);_0x5728f4[_0x74cc('0x35')]=_['intersection'](_0x224983['model'],qs['fields'](_0x5651a6['query'][_0x74cc('0x36')]));_0x5728f4[_0x74cc('0x35')]=_0x5728f4['attributes']['length']?_0x5728f4['attributes']:_0x224983[_0x74cc('0x31')];if(_0x5651a6['query']['includeAll']){_0x5728f4[_0x74cc('0x44')]=[{'all':!![]}];}_0x5728f4=_['merge']({},_0x5728f4,_0x5651a6[_0x74cc('0x41')]);return db[_0x74cc('0x2d')][_0x74cc('0x49')](_0x5728f4)[_0x74cc('0x26')](handleEntityNotFound(_0x5e148e,null))[_0x74cc('0x26')](respondWithResult(_0x5e148e,null))[_0x74cc('0x4a')](handleError(_0x5e148e,null));};exports[_0x74cc('0x4b')]=function(_0x2fa4c6,_0x4957f3){return db['Dynamics365Field'][_0x74cc('0x4b')](_0x2fa4c6[_0x74cc('0x4c')],{})['then'](respondWithResult(_0x4957f3,0xc9))[_0x74cc('0x4a')](handleError(_0x4957f3,null));};exports[_0x74cc('0x4d')]=function(_0x29b385,_0x111fce){if(_0x29b385[_0x74cc('0x4c')]['id']){delete _0x29b385[_0x74cc('0x4c')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x29b385[_0x74cc('0x47')]['id']}})[_0x74cc('0x26')](handleEntityNotFound(_0x111fce,null))[_0x74cc('0x26')](saveUpdates(_0x29b385['body'],null))['then'](respondWithResult(_0x111fce,null))[_0x74cc('0x4a')](handleError(_0x111fce,null));};exports[_0x74cc('0x27')]=function(_0x4910bc,_0x1c79d3){return db[_0x74cc('0x2d')][_0x74cc('0x49')]({'where':{'id':_0x4910bc[_0x74cc('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c79d3,null))[_0x74cc('0x26')](removeEntity(_0x1c79d3,null))['catch'](handleError(_0x1c79d3,null));}; \ No newline at end of file +var _0x8969=['includeAll','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','error','stack','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','name','options','then','include','findAll','rows','catch','show','params','keys'];(function(_0x5d0bfb,_0x1de3e5){var _0x587698=function(_0x98aaa){while(--_0x98aaa){_0x5d0bfb['push'](_0x5d0bfb['shift']());}};_0x587698(++_0x1de3e5);}(_0x8969,0x130));var _0x9896=function(_0x82aebb,_0x2658c1){_0x82aebb=_0x82aebb-0x0;var _0x4c3aa3=_0x8969[_0x82aebb];return _0x4c3aa3;};'use strict';var pdf=require(_0x9896('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9896('0x1'));var zipdir=require(_0x9896('0x2'));var jsonpatch=require(_0x9896('0x3'));var rp=require(_0x9896('0x4'));var moment=require(_0x9896('0x5'));var BPromise=require(_0x9896('0x6'));var Mustache=require(_0x9896('0x7'));var util=require('util');var path=require(_0x9896('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9896('0x9'));var fs=require('fs');var _=require(_0x9896('0xa'));var squel=require(_0x9896('0xb'));var crypto=require('crypto');var jsforce=require(_0x9896('0xc'));var deskjs=require(_0x9896('0xd'));var toCsv=require(_0x9896('0xe'));var querystring=require('querystring');var Papa=require(_0x9896('0xf'));var Redis=require(_0x9896('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9896('0x11'));var as=require(_0x9896('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9896('0x13'))(_0x9896('0x14'));var utils=require(_0x9896('0x15'));var config=require(_0x9896('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5611f3,_0x5520ac){_0x5520ac=_0x5520ac||0xcc;return function(_0x331757){if(_0x331757){return _0x5611f3[_0x9896('0x17')](_0x5520ac);}return _0x5611f3[_0x9896('0x18')](_0x5520ac)[_0x9896('0x19')]();};}function respondWithResult(_0x37a660,_0x240012){_0x240012=_0x240012||0xc8;return function(_0x29f386){if(_0x29f386){return _0x37a660[_0x9896('0x18')](_0x240012)[_0x9896('0x1a')](_0x29f386);}};}function respondWithFilteredResult(_0x29952c,_0x51dce3){return function(_0xa13db9){if(_0xa13db9){var _0x51e8cc=_0xa13db9[_0x9896('0x1b')],_0x36596b=_0x51dce3['offset'],_0x12c503=_0x51dce3[_0x9896('0x1c')]+_0x51dce3[_0x9896('0x1d')],_0x2d0d7e;if(_0x12c503>=_0x51e8cc){_0x12c503=_0x51e8cc;_0x2d0d7e=0xc8;}else{_0x2d0d7e=0xce;}_0x29952c[_0x9896('0x18')](_0x2d0d7e);return _0x29952c[_0x9896('0x1e')]('Content-Range',_0x36596b+'-'+_0x12c503+'/'+_0x51e8cc)[_0x9896('0x1a')](_0xa13db9);}return null;};}function patchUpdates(_0x581480){return function(_0x41580e){try{jsonpatch[_0x9896('0x1f')](_0x41580e,_0x581480,!![]);}catch(_0x596a3f){return BPromise[_0x9896('0x20')](_0x596a3f);}return _0x41580e[_0x9896('0x21')]();};}function saveUpdates(_0x435714,_0x3038fd){return function(_0x281bd8){if(_0x281bd8){return _0x281bd8[_0x9896('0x22')](_0x435714)['then'](function(_0x18ff6e){return _0x18ff6e;});}return null;};}function removeEntity(_0x389318,_0x4276e3){return function(_0xc6372c){if(_0xc6372c){return _0xc6372c[_0x9896('0x23')]()['then'](function(){_0x389318[_0x9896('0x18')](0xcc)[_0x9896('0x19')]();});}};}function handleEntityNotFound(_0x173eb6,_0x550ed9){return function(_0x5ea62d){if(!_0x5ea62d){_0x173eb6[_0x9896('0x17')](0x194);}return _0x5ea62d;};}function handleError(_0x5a3515,_0x2627c9){_0x2627c9=_0x2627c9||0x1f4;return function(_0x438e9c){logger[_0x9896('0x24')](_0x438e9c[_0x9896('0x25')]);if(_0x438e9c['name']){delete _0x438e9c['name'];}_0x5a3515[_0x9896('0x18')](_0x2627c9)['send'](_0x438e9c);};}exports[_0x9896('0x26')]=function(_0x2685e8,_0x22c783){var _0x1a6c92={},_0x3b9ee2={},_0xa316c={'count':0x0,'rows':[]};var _0x19cecb=_[_0x9896('0x27')](db[_0x9896('0x28')][_0x9896('0x29')],function(_0x17a8fe){return{'name':_0x17a8fe[_0x9896('0x2a')],'type':_0x17a8fe[_0x9896('0x2b')][_0x9896('0x2c')]};});_0x3b9ee2[_0x9896('0x2d')]=_[_0x9896('0x27')](_0x19cecb,'name');_0x3b9ee2[_0x9896('0x2e')]=_['keys'](_0x2685e8[_0x9896('0x2e')]);_0x3b9ee2['filters']=_['intersection'](_0x3b9ee2[_0x9896('0x2d')],_0x3b9ee2[_0x9896('0x2e')]);_0x1a6c92['attributes']=_[_0x9896('0x2f')](_0x3b9ee2[_0x9896('0x2d')],qs[_0x9896('0x30')](_0x2685e8['query'][_0x9896('0x30')]));_0x1a6c92[_0x9896('0x31')]=_0x1a6c92['attributes'][_0x9896('0x32')]?_0x1a6c92[_0x9896('0x31')]:_0x3b9ee2[_0x9896('0x2d')];if(!_0x2685e8[_0x9896('0x2e')][_0x9896('0x33')](_0x9896('0x34'))){_0x1a6c92[_0x9896('0x1d')]=qs[_0x9896('0x1d')](_0x2685e8[_0x9896('0x2e')][_0x9896('0x1d')]);_0x1a6c92[_0x9896('0x1c')]=qs[_0x9896('0x1c')](_0x2685e8['query'][_0x9896('0x1c')]);}_0x1a6c92[_0x9896('0x35')]=qs[_0x9896('0x36')](_0x2685e8[_0x9896('0x2e')][_0x9896('0x36')]);_0x1a6c92['where']=qs[_0x9896('0x37')](_[_0x9896('0x38')](_0x2685e8[_0x9896('0x2e')],_0x3b9ee2[_0x9896('0x37')]));if(_0x2685e8[_0x9896('0x2e')][_0x9896('0x39')]){_0x1a6c92[_0x9896('0x3a')]=_[_0x9896('0x3b')](_0x1a6c92[_0x9896('0x3a')],{'$or':_[_0x9896('0x27')](_0x19cecb,function(_0x26131a){if(_0x26131a[_0x9896('0x2b')]!==_0x9896('0x3c')){var _0x4d2922={};_0x4d2922[_0x26131a[_0x9896('0x3d')]]={'$like':'%'+_0x2685e8['query']['filter']+'%'};return _0x4d2922;}})});}_0x1a6c92=_['merge']({},_0x1a6c92,_0x2685e8[_0x9896('0x3e')]);var _0x373b3a={'where':_0x1a6c92[_0x9896('0x3a')]};return db[_0x9896('0x28')][_0x9896('0x1b')](_0x373b3a)[_0x9896('0x3f')](function(_0x27fd79){_0xa316c[_0x9896('0x1b')]=_0x27fd79;if(_0x2685e8[_0x9896('0x2e')]['includeAll']){_0x1a6c92[_0x9896('0x40')]=[{'all':!![]}];}return db[_0x9896('0x28')][_0x9896('0x41')](_0x1a6c92);})[_0x9896('0x3f')](function(_0x3df2a9){_0xa316c[_0x9896('0x42')]=_0x3df2a9;return _0xa316c;})[_0x9896('0x3f')](respondWithFilteredResult(_0x22c783,_0x1a6c92))[_0x9896('0x43')](handleError(_0x22c783,null));};exports[_0x9896('0x44')]=function(_0x1e302a,_0x3f849d){var _0x58b611={'raw':!![],'where':{'id':_0x1e302a[_0x9896('0x45')]['id']}},_0x5a7c76={};_0x5a7c76[_0x9896('0x2d')]=_[_0x9896('0x46')](db['Dynamics365Field'][_0x9896('0x29')]);_0x5a7c76[_0x9896('0x2e')]=_['keys'](_0x1e302a[_0x9896('0x2e')]);_0x5a7c76[_0x9896('0x37')]=_['intersection'](_0x5a7c76[_0x9896('0x2d')],_0x5a7c76[_0x9896('0x2e')]);_0x58b611[_0x9896('0x31')]=_['intersection'](_0x5a7c76[_0x9896('0x2d')],qs[_0x9896('0x30')](_0x1e302a[_0x9896('0x2e')]['fields']));_0x58b611[_0x9896('0x31')]=_0x58b611[_0x9896('0x31')]['length']?_0x58b611['attributes']:_0x5a7c76[_0x9896('0x2d')];if(_0x1e302a[_0x9896('0x2e')][_0x9896('0x47')]){_0x58b611[_0x9896('0x40')]=[{'all':!![]}];}_0x58b611=_[_0x9896('0x3b')]({},_0x58b611,_0x1e302a[_0x9896('0x3e')]);return db[_0x9896('0x28')][_0x9896('0x48')](_0x58b611)[_0x9896('0x3f')](handleEntityNotFound(_0x3f849d,null))[_0x9896('0x3f')](respondWithResult(_0x3f849d,null))[_0x9896('0x43')](handleError(_0x3f849d,null));};exports[_0x9896('0x49')]=function(_0x5d7557,_0x489584){return db[_0x9896('0x28')][_0x9896('0x49')](_0x5d7557[_0x9896('0x4a')],{})[_0x9896('0x3f')](respondWithResult(_0x489584,0xc9))[_0x9896('0x43')](handleError(_0x489584,null));};exports[_0x9896('0x22')]=function(_0x1f2aa5,_0x2a21a5){if(_0x1f2aa5[_0x9896('0x4a')]['id']){delete _0x1f2aa5[_0x9896('0x4a')]['id'];}return db[_0x9896('0x28')][_0x9896('0x48')]({'where':{'id':_0x1f2aa5[_0x9896('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a21a5,null))[_0x9896('0x3f')](saveUpdates(_0x1f2aa5[_0x9896('0x4a')],null))[_0x9896('0x3f')](respondWithResult(_0x2a21a5,null))[_0x9896('0x43')](handleError(_0x2a21a5,null));};exports[_0x9896('0x23')]=function(_0x5d9807,_0x5701e2){return db['Dynamics365Field'][_0x9896('0x48')]({'where':{'id':_0x5d9807[_0x9896('0x45')]['id']}})[_0x9896('0x3f')](handleEntityNotFound(_0x5701e2,null))['then'](removeEntity(_0x5701e2,null))[_0x9896('0x43')](handleError(_0x5701e2,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 8b52126..2598c3b 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 _0x5044=['dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0x3aaa0a,_0x39587f){var _0x4ec022=function(_0x3ff040){while(--_0x3ff040){_0x3aaa0a['push'](_0x3aaa0a['shift']());}};_0x4ec022(++_0x39587f);}(_0x5044,0x1b5));var _0x4504=function(_0x3c5e51,_0x413dd5){_0x3c5e51=_0x3c5e51-0x0;var _0x796c2b=_0x5044[_0x3c5e51];return _0x796c2b;};'use strict';var _=require(_0x4504('0x0'));var util=require(_0x4504('0x1'));var logger=require(_0x4504('0x2'))(_0x4504('0x3'));var moment=require(_0x4504('0x4'));var BPromise=require(_0x4504('0x5'));var rp=require(_0x4504('0x6'));var fs=require('fs');var path=require(_0x4504('0x7'));var rimraf=require('rimraf');var config=require(_0x4504('0x8'));var attributes=require(_0x4504('0x9'));module[_0x4504('0xa')]=function(_0x372cf0,_0x52a66b){return _0x372cf0[_0x4504('0xb')](_0x4504('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x4504('0xd'),'fields':['idField',_0x4504('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d53=['../../config/logger','api','bluebird','path','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util'];(function(_0x30e201,_0x1350d8){var _0x3e7507=function(_0x35524f){while(--_0x35524f){_0x30e201['push'](_0x30e201['shift']());}};_0x3e7507(++_0x1350d8);}(_0x7d53,0x1b1));var _0x37d5=function(_0x37de11,_0x237545){_0x37de11=_0x37de11-0x0;var _0x421558=_0x7d53[_0x37de11];return _0x421558;};'use strict';var _=require(_0x37d5('0x0'));var util=require(_0x37d5('0x1'));var logger=require(_0x37d5('0x2'))(_0x37d5('0x3'));var moment=require('moment');var BPromise=require(_0x37d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37d5('0x5'));var rimraf=require('rimraf');var config=require(_0x37d5('0x6'));var attributes=require(_0x37d5('0x7'));module[_0x37d5('0x8')]=function(_0x4b5d24,_0x1cbbd6){return _0x4b5d24[_0x37d5('0x9')](_0x37d5('0xa'),attributes,{'tableName':_0x37d5('0xb'),'paranoid':![],'indexes':[{'name':_0x37d5('0xc'),'fields':[_0x37d5('0xd'),_0x37d5('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 e33b995..9e18c25 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 _0xba6f=['debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x30a6fa,_0x4d2e1d){var _0x354c2c=function(_0x1c08df){while(--_0x1c08df){_0x30a6fa['push'](_0x30a6fa['shift']());}};_0x354c2c(++_0x4d2e1d);}(_0xba6f,0x1d0));var _0xfba6=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0xba6f[_0x4ca333];return _0x13b2e1;};'use strict';var _=require(_0xfba6('0x0'));var util=require('util');var moment=require(_0xfba6('0x1'));var BPromise=require(_0xfba6('0x2'));var rs=require(_0xfba6('0x3'));var fs=require('fs');var Redis=require(_0xfba6('0x4'));var db=require(_0xfba6('0x5'))['db'];var utils=require(_0xfba6('0x6'));var logger=require(_0xfba6('0x7'))(_0xfba6('0x8'));var config=require(_0xfba6('0x9'));var jayson=require(_0xfba6('0xa'));var client=jayson[_0xfba6('0xb')][_0xfba6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x99e213,_0x5d86c3,_0x1b3c5c){return new BPromise(function(_0x2bd0e6,_0x4dd2a2){return client['request'](_0x99e213,_0x1b3c5c)['then'](function(_0x3effea){logger[_0xfba6('0xd')](_0xfba6('0xe'),_0x5d86c3,_0xfba6('0xf'));logger[_0xfba6('0x10')](_0xfba6('0x11'),_0x5d86c3,_0xfba6('0xf'),JSON[_0xfba6('0x12')](_0x3effea));if(_0x3effea[_0xfba6('0x13')]){if(_0x3effea[_0xfba6('0x13')][_0xfba6('0x14')]===0x1f4){logger['error'](_0xfba6('0xe'),_0x5d86c3,_0x3effea[_0xfba6('0x13')][_0xfba6('0x15')]);return _0x4dd2a2(_0x3effea[_0xfba6('0x13')]['message']);}logger[_0xfba6('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x5d86c3,_0x3effea['error'][_0xfba6('0x15')]);return _0x2bd0e6(_0x3effea[_0xfba6('0x13')][_0xfba6('0x15')]);}else{logger[_0xfba6('0xd')](_0xfba6('0xe'),_0x5d86c3,_0xfba6('0xf'));_0x2bd0e6(_0x3effea[_0xfba6('0x16')][_0xfba6('0x15')]);}})[_0xfba6('0x17')](function(_0x228add){logger[_0xfba6('0x13')](_0xfba6('0xe'),_0x5d86c3,_0x228add);_0x4dd2a2(_0x228add);});});} \ No newline at end of file +var _0xfc17=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x121ba0,_0x2729d1){var _0x7767c2=function(_0x314494){while(--_0x314494){_0x121ba0['push'](_0x121ba0['shift']());}};_0x7767c2(++_0x2729d1);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x329528,_0x361060){_0x329528=_0x329528-0x0;var _0x2adb13=_0xfc17[_0x329528];return _0x2adb13;};'use strict';var _=require(_0x7fc1('0x0'));var util=require(_0x7fc1('0x1'));var moment=require(_0x7fc1('0x2'));var BPromise=require(_0x7fc1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7fc1('0x4'));var db=require(_0x7fc1('0x5'))['db'];var utils=require(_0x7fc1('0x6'));var logger=require(_0x7fc1('0x7'))(_0x7fc1('0x8'));var config=require(_0x7fc1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7fc1('0xa')][_0x7fc1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2267ea,_0xf0d3fa,_0x24c678){return new BPromise(function(_0x1b7106,_0x3b631b){return client['request'](_0x2267ea,_0x24c678)[_0x7fc1('0xc')](function(_0x10e02b){logger[_0x7fc1('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0xf0d3fa,_0x7fc1('0xe'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0xf0d3fa,_0x7fc1('0xe'),JSON[_0x7fc1('0xf')](_0x10e02b));if(_0x10e02b[_0x7fc1('0x10')]){if(_0x10e02b[_0x7fc1('0x10')][_0x7fc1('0x11')]===0x1f4){logger[_0x7fc1('0x10')](_0x7fc1('0x12'),_0xf0d3fa,_0x10e02b[_0x7fc1('0x10')][_0x7fc1('0x13')]);return _0x3b631b(_0x10e02b[_0x7fc1('0x10')][_0x7fc1('0x13')]);}logger[_0x7fc1('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0xf0d3fa,_0x10e02b['error'][_0x7fc1('0x13')]);return _0x1b7106(_0x10e02b[_0x7fc1('0x10')][_0x7fc1('0x13')]);}else{logger[_0x7fc1('0xd')](_0x7fc1('0x12'),_0xf0d3fa,_0x7fc1('0xe'));_0x1b7106(_0x10e02b[_0x7fc1('0x14')][_0x7fc1('0x13')]);}})[_0x7fc1('0x15')](function(_0x442176){logger['error'](_0x7fc1('0x12'),_0xf0d3fa,_0x442176);_0x3b631b(_0x442176);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index ee80b3c..421f80d 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 _0xc491=['../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','post','create','update','delete','destroy','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x385f25,_0x5bf602){var _0x39d2cf=function(_0x202d51){while(--_0x202d51){_0x385f25['push'](_0x385f25['shift']());}};_0x39d2cf(++_0x5bf602);}(_0xc491,0x1ab));var _0x1c49=function(_0x4a9fb7,_0x4cbfd7){_0x4a9fb7=_0x4a9fb7-0x0;var _0x40b90e=_0xc491[_0x4a9fb7];return _0x40b90e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1c49('0x0'));var express=require(_0x1c49('0x1'));var router=express[_0x1c49('0x2')]();var auth=require(_0x1c49('0x3'));var interaction=require(_0x1c49('0x4'));var config=require(_0x1c49('0x5'));var controller=require(_0x1c49('0x6'));router[_0x1c49('0x7')]('/',auth['isAuthenticated'](),controller[_0x1c49('0x8')]);router[_0x1c49('0x7')](_0x1c49('0x9'),auth[_0x1c49('0xa')](),controller['show']);router['get'](_0x1c49('0xb'),auth[_0x1c49('0xa')](),controller[_0x1c49('0xc')]);router[_0x1c49('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x1c49('0xd')]('/',auth[_0x1c49('0xa')](),controller[_0x1c49('0xe')]);router['post'](_0x1c49('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x1c49('0x9'),auth[_0x1c49('0xa')](),controller[_0x1c49('0xf')]);router[_0x1c49('0x10')](_0x1c49('0x9'),auth[_0x1c49('0xa')](),controller[_0x1c49('0x11')]);module['exports']=router; \ No newline at end of file +var _0x295e=['update','delete','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x5c38cd,_0x5a6b4e){var _0xc985ef=function(_0x4aa1df){while(--_0x4aa1df){_0x5c38cd['push'](_0x5c38cd['shift']());}};_0xc985ef(++_0x5a6b4e);}(_0x295e,0x1b8));var _0xe295=function(_0x21a57e,_0x390ab9){_0x21a57e=_0x21a57e-0x0;var _0xd467a6=_0x295e[_0x21a57e];return _0xd467a6;};'use strict';var multer=require('multer');var util=require(_0xe295('0x0'));var path=require(_0xe295('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe295('0x2')]();var auth=require(_0xe295('0x3'));var interaction=require(_0xe295('0x4'));var config=require(_0xe295('0x5'));var controller=require(_0xe295('0x6'));router[_0xe295('0x7')]('/',auth[_0xe295('0x8')](),controller[_0xe295('0x9')]);router['get'](_0xe295('0xa'),auth[_0xe295('0x8')](),controller[_0xe295('0xb')]);router[_0xe295('0x7')](_0xe295('0xc'),auth['isAuthenticated'](),controller[_0xe295('0xd')]);router[_0xe295('0x7')](_0xe295('0xe'),auth[_0xe295('0x8')](),controller[_0xe295('0xf')]);router['post']('/',auth[_0xe295('0x8')](),controller['create']);router['post'](_0xe295('0xc'),auth[_0xe295('0x8')](),controller['addConfiguration']);router['put'](_0xe295('0xa'),auth['isAuthenticated'](),controller[_0xe295('0x10')]);router[_0xe295('0x11')](_0xe295('0xa'),auth[_0xe295('0x8')](),controller['destroy']);module[_0xe295('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 6704648..193e308 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 _0xf954=['STRING','username','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf954,0x10e));var _0x4f95=function(_0x3e26b8,_0x336ff7){_0x3e26b8=_0x3e26b8-0x0;var _0x41f8cd=_0xf954[_0x3e26b8];return _0x41f8cd;};'use strict';var Sequelize=require(_0x4f95('0x0'));module[_0x4f95('0x1')]={'name':{'type':Sequelize[_0x4f95('0x2')]},'description':{'type':Sequelize[_0x4f95('0x2')]},'username':{'type':Sequelize[_0x4f95('0x2')],'unique':_0x4f95('0x3')},'apiKey':{'type':Sequelize[_0x4f95('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4f95('0x2')]}}; \ No newline at end of file +var _0x3024=['STRING','sequelize','exports'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x3024,0x64));var _0x4302=function(_0x5381d2,_0x5819ad){_0x5381d2=_0x5381d2-0x0;var _0x5e09b1=_0x3024[_0x5381d2];return _0x5e09b1;};'use strict';var Sequelize=require(_0x4302('0x0'));module[_0x4302('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4302('0x2')]},'username':{'type':Sequelize[_0x4302('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4302('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4302('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index d15d542..5f197ec 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 _0x938c=['rows','show','length','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','requester','subject','agent','description','priority','source','ticket_type','group','company','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','request','then','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','end','json','offset','limit','status','set','Content-Range','save','update','destroy','name','send','index','map','FreshdeskAccount','rawAttributes','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll'];(function(_0x10d3b5,_0x14186f){var _0x18eb15=function(_0x38ac68){while(--_0x38ac68){_0x10d3b5['push'](_0x10d3b5['shift']());}};_0x18eb15(++_0x14186f);}(_0x938c,0x1a4));var _0xc938=function(_0x3cdf08,_0x3183ba){_0x3cdf08=_0x3cdf08-0x0;var _0xdcf34f=_0x938c[_0x3cdf08];return _0xdcf34f;};'use strict';var pdf=require(_0xc938('0x0'));var emlformat=require(_0xc938('0x1'));var rimraf=require(_0xc938('0x2'));var zipdir=require(_0xc938('0x3'));var jsonpatch=require(_0xc938('0x4'));var rp=require(_0xc938('0x5'));var moment=require(_0xc938('0x6'));var BPromise=require(_0xc938('0x7'));var Mustache=require(_0xc938('0x8'));var util=require('util');var path=require(_0xc938('0x9'));var sox=require(_0xc938('0xa'));var csv=require(_0xc938('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc938('0xc'));var squel=require(_0xc938('0xd'));var crypto=require(_0xc938('0xe'));var jsforce=require(_0xc938('0xf'));var deskjs=require(_0xc938('0x10'));var toCsv=require(_0xc938('0xb'));var querystring=require(_0xc938('0x11'));var Papa=require(_0xc938('0x12'));var Redis=require(_0xc938('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc938('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc938('0x15'))(_0xc938('0x16'));var utils=require(_0xc938('0x17'));var config=require(_0xc938('0x18'));var db=require(_0xc938('0x19'))['db'];var integrations=require(_0xc938('0x1a'));var jayson=require('jayson/promise');var client=jayson[_0xc938('0x1b')][_0xc938('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1459d2,_0x433597,_0x486911){if(_0x486911){var _0x3d6e6f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d6e6f[_0xc938('0x1d')](_0x433597)){return _0x1459d2;}else{throw new db[(_0xc938('0x1e'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1459d2;}}function respondWithRpcPromise(_0x599123,_0x53fb9b,_0x3cba9f,_0x50cc27){return new BPromise(function(_0x440051,_0x17a9dd){var _0x5de828=_0x50cc27||client;return _0x5de828[_0xc938('0x1f')](_0x599123,_0x3cba9f)[_0xc938('0x20')](function(_0x54b82d){logger['info'](_0xc938('0x21'),_0x53fb9b,'request\x20sent');logger['debug'](_0xc938('0x22'),_0x53fb9b,'request\x20sent',JSON[_0xc938('0x23')](_0x54b82d));if(_0x54b82d[_0xc938('0x24')]){if(_0x54b82d[_0xc938('0x24')]['code']===0x1f4){logger['error'](_0xc938('0x21'),_0x53fb9b,_0x54b82d[_0xc938('0x24')][_0xc938('0x25')]);return _0x17a9dd(_0x54b82d[_0xc938('0x24')]['message']);}logger[_0xc938('0x24')](_0xc938('0x21'),_0x53fb9b,_0x54b82d[_0xc938('0x24')][_0xc938('0x25')]);return _0x440051(_0x54b82d[_0xc938('0x24')][_0xc938('0x25')]);}else{logger[_0xc938('0x26')]('FreshdeskAccount,\x20%s,\x20%s',_0x53fb9b,'request\x20sent');_0x440051(_0x54b82d[_0xc938('0x27')][_0xc938('0x25')]);}})[_0xc938('0x28')](function(_0x23b532){logger[_0xc938('0x24')](_0xc938('0x21'),_0x53fb9b,_0x23b532);_0x17a9dd(_0x23b532);});});}function respondWithStatusCode(_0x48f468,_0xf9aba2){_0xf9aba2=_0xf9aba2||0xcc;return function(_0x29622a){if(_0x29622a){return _0x48f468[_0xc938('0x29')](_0xf9aba2);}return _0x48f468['status'](_0xf9aba2)[_0xc938('0x2a')]();};}function respondWithResult(_0x1c9733,_0x43cb50){_0x43cb50=_0x43cb50||0xc8;return function(_0x1c646a){if(_0x1c646a){return _0x1c9733['status'](_0x43cb50)[_0xc938('0x2b')](_0x1c646a);}};}function respondWithFilteredResult(_0x3d1e68,_0x2c69ba){return function(_0x386963){if(_0x386963){var _0x40e09b=_0x386963['count'],_0x31e746=_0x2c69ba[_0xc938('0x2c')],_0x1bb2e9=_0x2c69ba[_0xc938('0x2c')]+_0x2c69ba[_0xc938('0x2d')],_0x4b1940;if(_0x1bb2e9>=_0x40e09b){_0x1bb2e9=_0x40e09b;_0x4b1940=0xc8;}else{_0x4b1940=0xce;}_0x3d1e68[_0xc938('0x2e')](_0x4b1940);return _0x3d1e68[_0xc938('0x2f')](_0xc938('0x30'),_0x31e746+'-'+_0x1bb2e9+'/'+_0x40e09b)[_0xc938('0x2b')](_0x386963);}return null;};}function patchUpdates(_0x511b35){return function(_0x2ad720){try{jsonpatch['apply'](_0x2ad720,_0x511b35,!![]);}catch(_0x53c03f){return BPromise['reject'](_0x53c03f);}return _0x2ad720[_0xc938('0x31')]();};}function saveUpdates(_0x2bbc1,_0x43975a){return function(_0x11c74f){if(_0x11c74f){return _0x11c74f[_0xc938('0x32')](_0x2bbc1)[_0xc938('0x20')](function(_0x473d90){return _0x473d90;});}return null;};}function removeEntity(_0x40b459,_0x45bff4){return function(_0xff606d){if(_0xff606d){return _0xff606d[_0xc938('0x33')]()[_0xc938('0x20')](function(){_0x40b459[_0xc938('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x285f81,_0x15a71f){return function(_0x476730){if(!_0x476730){_0x285f81[_0xc938('0x29')](0x194);}return _0x476730;};}function handleError(_0x1589e3,_0xb83d2f){_0xb83d2f=_0xb83d2f||0x1f4;return function(_0x451144){logger['error'](_0x451144['stack']);if(_0x451144['name']){delete _0x451144[_0xc938('0x34')];}_0x1589e3[_0xc938('0x2e')](_0xb83d2f)[_0xc938('0x35')](_0x451144);};}exports[_0xc938('0x36')]=function(_0x22cf2a,_0x3b3a3c){var _0x445adc={},_0x529afc={},_0x10aa2d={'count':0x0,'rows':[]};var _0x559f53=_[_0xc938('0x37')](db[_0xc938('0x38')][_0xc938('0x39')],function(_0x257a4e){return{'name':_0x257a4e['fieldName'],'type':_0x257a4e['type'][_0xc938('0x3a')]};});_0x529afc['model']=_['map'](_0x559f53,_0xc938('0x34'));_0x529afc['query']=_[_0xc938('0x3b')](_0x22cf2a[_0xc938('0x3c')]);_0x529afc[_0xc938('0x3d')]=_[_0xc938('0x3e')](_0x529afc[_0xc938('0x3f')],_0x529afc[_0xc938('0x3c')]);_0x445adc['attributes']=_[_0xc938('0x3e')](_0x529afc[_0xc938('0x3f')],qs[_0xc938('0x40')](_0x22cf2a[_0xc938('0x3c')][_0xc938('0x40')]));_0x445adc[_0xc938('0x41')]=_0x445adc[_0xc938('0x41')]['length']?_0x445adc['attributes']:_0x529afc[_0xc938('0x3f')];if(!_0x22cf2a[_0xc938('0x3c')][_0xc938('0x42')](_0xc938('0x43'))){_0x445adc['limit']=qs['limit'](_0x22cf2a['query']['limit']);_0x445adc[_0xc938('0x2c')]=qs[_0xc938('0x2c')](_0x22cf2a[_0xc938('0x3c')]['offset']);}_0x445adc[_0xc938('0x44')]=qs[_0xc938('0x45')](_0x22cf2a[_0xc938('0x3c')][_0xc938('0x45')]);_0x445adc[_0xc938('0x46')]=qs[_0xc938('0x3d')](_['pick'](_0x22cf2a[_0xc938('0x3c')],_0x529afc[_0xc938('0x3d')]));if(_0x22cf2a[_0xc938('0x3c')][_0xc938('0x47')]){_0x445adc[_0xc938('0x46')]=_[_0xc938('0x48')](_0x445adc['where'],{'$or':_[_0xc938('0x37')](_0x559f53,function(_0x34a133){if(_0x34a133[_0xc938('0x49')]!==_0xc938('0x4a')){var _0x57cdfd={};_0x57cdfd[_0x34a133[_0xc938('0x34')]]={'$like':'%'+_0x22cf2a[_0xc938('0x3c')][_0xc938('0x47')]+'%'};return _0x57cdfd;}})});}_0x445adc=_[_0xc938('0x48')]({},_0x445adc,_0x22cf2a[_0xc938('0x4b')]);var _0x226058={'where':_0x445adc[_0xc938('0x46')]};return db[_0xc938('0x38')][_0xc938('0x4c')](_0x226058)[_0xc938('0x20')](function(_0x550e1f){_0x10aa2d[_0xc938('0x4c')]=_0x550e1f;if(_0x22cf2a[_0xc938('0x3c')][_0xc938('0x4d')]){_0x445adc[_0xc938('0x4e')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xc938('0x4f')](_0x445adc);})[_0xc938('0x20')](function(_0x1b64df){_0x10aa2d[_0xc938('0x50')]=_0x1b64df;return _0x10aa2d;})['then'](respondWithFilteredResult(_0x3b3a3c,_0x445adc))['catch'](handleError(_0x3b3a3c,null));};exports[_0xc938('0x51')]=function(_0x1325cd,_0x1b321b){var _0xc378db={'raw':![],'where':{'id':_0x1325cd['params']['id']}},_0x45ddae={};_0x45ddae[_0xc938('0x3f')]=_[_0xc938('0x3b')](db[_0xc938('0x38')][_0xc938('0x39')]);_0x45ddae[_0xc938('0x3c')]=_['keys'](_0x1325cd[_0xc938('0x3c')]);_0x45ddae['filters']=_['intersection'](_0x45ddae['model'],_0x45ddae[_0xc938('0x3c')]);_0xc378db['attributes']=_['intersection'](_0x45ddae['model'],qs['fields'](_0x1325cd['query'][_0xc938('0x40')]));_0xc378db[_0xc938('0x41')]=_0xc378db['attributes'][_0xc938('0x52')]?_0xc378db[_0xc938('0x41')]:_0x45ddae[_0xc938('0x3f')];if(_0x1325cd[_0xc938('0x3c')][_0xc938('0x4d')]){_0xc378db[_0xc938('0x4e')]=[{'all':!![]}];}_0xc378db=_['merge']({},_0xc378db,_0x1325cd[_0xc938('0x4b')]);return db[_0xc938('0x38')][_0xc938('0x53')](_0xc378db)['then'](handleEntityNotFound(_0x1b321b,null))[_0xc938('0x20')](respondWithResult(_0x1b321b,null))[_0xc938('0x28')](handleError(_0x1b321b,null));};exports[_0xc938('0x54')]=function(_0x43734e,_0x42e937){return db[_0xc938('0x38')][_0xc938('0x54')](_0x43734e['body'],{})['then'](respondWithResult(_0x42e937,0xc9))['catch'](handleError(_0x42e937,null));};exports[_0xc938('0x32')]=function(_0x3662f8,_0x3f762a){if(_0x3662f8[_0xc938('0x55')]['id']){delete _0x3662f8[_0xc938('0x55')]['id'];}return db['FreshdeskAccount'][_0xc938('0x53')]({'where':{'id':_0x3662f8[_0xc938('0x56')]['id']}})[_0xc938('0x20')](handleEntityNotFound(_0x3f762a,null))[_0xc938('0x20')](saveUpdates(_0x3662f8[_0xc938('0x55')],null))[_0xc938('0x20')](respondWithResult(_0x3f762a,null))['catch'](handleError(_0x3f762a,null));};exports[_0xc938('0x33')]=function(_0x4bc06b,_0x2ad5f9){return db[_0xc938('0x38')]['find']({'where':{'id':_0x4bc06b['params']['id']}})[_0xc938('0x20')](handleEntityNotFound(_0x2ad5f9,null))[_0xc938('0x20')](removeEntity(_0x2ad5f9,null))['catch'](handleError(_0x2ad5f9,null));};exports[_0xc938('0x57')]=function(_0x10bc4e,_0x9ac654,_0x3d4729){var _0xb5fd94={};var _0x258917={};var _0x1c0eca;var _0x18f6e1;return db[_0xc938('0x38')][_0xc938('0x58')]({'where':{'id':_0x10bc4e['params']['id']}})[_0xc938('0x20')](handleEntityNotFound(_0x9ac654,null))[_0xc938('0x20')](function(_0x3ae613){if(_0x3ae613){_0x1c0eca=_0x3ae613;_0x258917[_0xc938('0x3f')]=_['keys'](db[_0xc938('0x59')][_0xc938('0x39')]);_0x258917['query']=_[_0xc938('0x3b')](_0x10bc4e['query']);_0x258917[_0xc938('0x3d')]=_[_0xc938('0x3e')](_0x258917['model'],_0x258917[_0xc938('0x3c')]);_0xb5fd94[_0xc938('0x41')]=_[_0xc938('0x3e')](_0x258917[_0xc938('0x3f')],qs[_0xc938('0x40')](_0x10bc4e[_0xc938('0x3c')][_0xc938('0x40')]));_0xb5fd94[_0xc938('0x41')]=_0xb5fd94['attributes'][_0xc938('0x52')]?_0xb5fd94[_0xc938('0x41')]:_0x258917[_0xc938('0x3f')];_0xb5fd94[_0xc938('0x44')]=qs[_0xc938('0x45')](_0x10bc4e[_0xc938('0x3c')][_0xc938('0x45')]);_0xb5fd94[_0xc938('0x46')]=qs['filters'](_['pick'](_0x10bc4e[_0xc938('0x3c')],_0x258917['filters']));if(_0x10bc4e['query'][_0xc938('0x47')]){_0xb5fd94[_0xc938('0x46')]=_[_0xc938('0x48')](_0xb5fd94['where'],{'$or':_[_0xc938('0x37')](_0xb5fd94['attributes'],function(_0x34e690){var _0x53de2a={};_0x53de2a[_0x34e690]={'$like':'%'+_0x10bc4e[_0xc938('0x3c')]['filter']+'%'};return _0x53de2a;})});}_0xb5fd94=_['merge']({},_0xb5fd94,_0x10bc4e[_0xc938('0x4b')]);return _0x1c0eca[_0xc938('0x57')](_0xb5fd94);}})[_0xc938('0x20')](function(_0x58483e){if(_0x58483e){_0x18f6e1=_0x58483e[_0xc938('0x52')];if(!_0x10bc4e['query'][_0xc938('0x42')](_0xc938('0x43'))){_0xb5fd94[_0xc938('0x2d')]=qs[_0xc938('0x2d')](_0x10bc4e[_0xc938('0x3c')]['limit']);_0xb5fd94[_0xc938('0x2c')]=qs[_0xc938('0x2c')](_0x10bc4e[_0xc938('0x3c')][_0xc938('0x2c')]);}return _0x1c0eca['getConfigurations'](_0xb5fd94);}})[_0xc938('0x20')](function(_0x24a860){if(_0x24a860){return _0x24a860?{'count':_0x18f6e1,'rows':_0x24a860}:null;}})[_0xc938('0x20')](respondWithResult(_0x9ac654,null))[_0xc938('0x28')](handleError(_0x9ac654,null));};exports['addConfiguration']=function(_0x20f79a,_0x1c5fd9,_0x565d99){if(_0x20f79a[_0xc938('0x55')]['id']){delete _0x20f79a[_0xc938('0x55')]['id'];}return db['FreshdeskAccount'][_0xc938('0x58')]({'where':{'id':_0x20f79a[_0xc938('0x56')]['id']}})['then'](handleEntityNotFound(_0x1c5fd9,null))['then'](function(_0x17d9c4){if(_0x17d9c4){_0x20f79a[_0xc938('0x55')]['AccountId']=_0x17d9c4['id'];_0x20f79a['body'][_0xc938('0x5a')]=integrations[_0xc938('0x5b')](_0x20f79a[_0xc938('0x55')][_0xc938('0x5c')],_0x20f79a[_0xc938('0x55')]['type']);_0x20f79a[_0xc938('0x55')][_0xc938('0x5d')]=integrations[_0xc938('0x5e')](_0x20f79a[_0xc938('0x55')][_0xc938('0x5c')],_0x20f79a[_0xc938('0x55')][_0xc938('0x49')]);return db[_0xc938('0x59')][_0xc938('0x54')](_0x20f79a[_0xc938('0x55')],{'include':[{'model':db['FreshdeskField'],'as':_0xc938('0x5a')},{'model':db[_0xc938('0x5f')],'as':_0xc938('0x5d')}]});}return null;})[_0xc938('0x20')](respondWithResult(_0x1c5fd9,null))['catch'](handleError(_0x1c5fd9,null));};exports[_0xc938('0x60')]=function(_0x56760b,_0x3d1f05,_0x313d74){var _0x23c37e='';return db[_0xc938('0x38')][_0xc938('0x58')]({'where':{'id':_0x56760b[_0xc938('0x56')]['id']},'attributes':['id',_0xc938('0x61'),_0xc938('0x62')]})[_0xc938('0x20')](handleEntityNotFound(_0x3d1f05,null))['then'](function(_0x5c73cc){if(_0x5c73cc){_0x23c37e=_0x5c73cc[_0xc938('0x61')];var _0xe82e5=_0x23c37e[_0xc938('0x63')](-0x1);if(_0xe82e5==='/'){_0x23c37e=_0x23c37e['substring'](0x0,_0x23c37e[_0xc938('0x64')](_0xe82e5));}return rp({'method':_0xc938('0x65'),'uri':util[_0xc938('0x66')](_0xc938('0x67'),_0x23c37e,_0xc938('0x68')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xc938('0x66')](_0xc938('0x69'),_0x5c73cc['apiKey']))[_0xc938('0x6a')]('base64'))},'json':!![]});}})[_0xc938('0x20')](function(_0x3588a5){if(_0x3588a5){var _0x23a880=[_0xc938('0x6b'),_0xc938('0x6c'),_0xc938('0x6d'),_0xc938('0x6e'),_0xc938('0x2e'),_0xc938('0x6f'),'group',_0xc938('0x70'),_0xc938('0x71'),_0xc938('0x72'),_0xc938('0x73')];_['remove'](_0x3588a5,function(_0x34fcfc){return _0x23a880['includes'](_0x34fcfc[_0xc938('0x34')])||!_0x34fcfc[_0xc938('0x74')]&&_0x34fcfc[_0xc938('0x49')]!==_0xc938('0x75')&&_0x34fcfc[_0xc938('0x49')]!==_0xc938('0x76');});return{'count':_0x3588a5[_0xc938('0x52')],'rows':_['map'](_0x3588a5,function(_0x9cdcdf){return{'id':_0x9cdcdf[_0xc938('0x34')],'name':_0x9cdcdf[_0xc938('0x77')],'custom':!_0x9cdcdf[_0xc938('0x74')],'options':_0x9cdcdf[_0xc938('0x78')]?_['map'](_0x9cdcdf[_0xc938('0x78')],function(_0x3588ee){return{'name':_[_0xc938('0x79')](_0x3588ee),'value':_0x3588ee};}):[]};})};}})[_0xc938('0x20')](respondWithResult(_0x3d1f05,null))[_0xc938('0x28')](function(_0x1a8f5f){var _0x1671f9=_0x56760b[_0xc938('0x3c')][_0xc938('0x1d')]?0x1f4:_0x1a8f5f[_0xc938('0x7a')]||0x1f4;logger[_0xc938('0x24')](_0xc938('0x7b'),_0xc938('0x60'),_0x1671f9,JSON[_0xc938('0x23')](_0x1a8f5f));delete _0x1a8f5f['name'];if(_0x1671f9===0x191){_0x1671f9=0x190;}_0x3d1f05[_0xc938('0x2e')](_0x1671f9)[_0xc938('0x35')](_0x56760b[_0xc938('0x3c')][_0xc938('0x1d')]?{'message':_0xc938('0x7c'),'statusCode':_0x1a8f5f[_0xc938('0x7a')]}:_0x1a8f5f);});}; \ No newline at end of file +var _0x85f6=['Content-Range','json','apply','reject','save','update','sendStatus','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','FreshdeskField','Subjects','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','default','custom_text','custom_dropdown','label','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','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','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','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','count','offset'];(function(_0x15408c,_0x1327b4){var _0x583777=function(_0x4e5db2){while(--_0x4e5db2){_0x15408c['push'](_0x15408c['shift']());}};_0x583777(++_0x1327b4);}(_0x85f6,0xd7));var _0x685f=function(_0x478b3c,_0x39feb2){_0x478b3c=_0x478b3c-0x0;var _0xa7a542=_0x85f6[_0x478b3c];return _0xa7a542;};'use strict';var pdf=require(_0x685f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x685f('0x1'));var jsonpatch=require(_0x685f('0x2'));var rp=require(_0x685f('0x3'));var moment=require(_0x685f('0x4'));var BPromise=require(_0x685f('0x5'));var Mustache=require('mustache');var util=require(_0x685f('0x6'));var path=require(_0x685f('0x7'));var sox=require(_0x685f('0x8'));var csv=require(_0x685f('0x9'));var ejs=require(_0x685f('0xa'));var fs=require('fs');var _=require(_0x685f('0xb'));var squel=require('squel');var crypto=require(_0x685f('0xc'));var jsforce=require(_0x685f('0xd'));var deskjs=require(_0x685f('0xe'));var toCsv=require(_0x685f('0x9'));var querystring=require('querystring');var Papa=require(_0x685f('0xf'));var Redis=require('ioredis');var authService=require(_0x685f('0x10'));var qs=require(_0x685f('0x11'));var as=require(_0x685f('0x12'));var hardwareService=require(_0x685f('0x13'));var logger=require(_0x685f('0x14'))(_0x685f('0x15'));var utils=require(_0x685f('0x16'));var config=require(_0x685f('0x17'));var db=require(_0x685f('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x685f('0x19'));var client=jayson[_0x685f('0x1a')][_0x685f('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x581ee4,_0x57ca2f,_0x5e05c3){if(_0x5e05c3){var _0x421a10=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x421a10[_0x685f('0x1c')](_0x57ca2f)){return _0x581ee4;}else{throw new db[(_0x685f('0x1d'))]['ValidationError'](_0x685f('0x1e'));}}else{return _0x581ee4;}}function respondWithRpcPromise(_0x114121,_0x286575,_0x166c8b,_0x81cb35){return new BPromise(function(_0xbd6410,_0x4e70cb){var _0x1829ac=_0x81cb35||client;return _0x1829ac[_0x685f('0x1f')](_0x114121,_0x166c8b)[_0x685f('0x20')](function(_0x4b7fe3){logger[_0x685f('0x21')](_0x685f('0x22'),_0x286575,_0x685f('0x23'));logger[_0x685f('0x24')](_0x685f('0x25'),_0x286575,_0x685f('0x23'),JSON[_0x685f('0x26')](_0x4b7fe3));if(_0x4b7fe3['error']){if(_0x4b7fe3[_0x685f('0x27')][_0x685f('0x28')]===0x1f4){logger['error'](_0x685f('0x22'),_0x286575,_0x4b7fe3['error']['message']);return _0x4e70cb(_0x4b7fe3[_0x685f('0x27')][_0x685f('0x29')]);}logger[_0x685f('0x27')]('FreshdeskAccount,\x20%s,\x20%s',_0x286575,_0x4b7fe3['error'][_0x685f('0x29')]);return _0xbd6410(_0x4b7fe3[_0x685f('0x27')]['message']);}else{logger[_0x685f('0x21')](_0x685f('0x22'),_0x286575,_0x685f('0x23'));_0xbd6410(_0x4b7fe3[_0x685f('0x2a')][_0x685f('0x29')]);}})['catch'](function(_0x6290b3){logger[_0x685f('0x27')](_0x685f('0x22'),_0x286575,_0x6290b3);_0x4e70cb(_0x6290b3);});});}function respondWithStatusCode(_0x1f64db,_0x701407){_0x701407=_0x701407||0xcc;return function(_0x2b8e7f){if(_0x2b8e7f){return _0x1f64db['sendStatus'](_0x701407);}return _0x1f64db[_0x685f('0x2b')](_0x701407)[_0x685f('0x2c')]();};}function respondWithResult(_0x397b53,_0x52a5f4){_0x52a5f4=_0x52a5f4||0xc8;return function(_0x781b4c){if(_0x781b4c){return _0x397b53['status'](_0x52a5f4)['json'](_0x781b4c);}};}function respondWithFilteredResult(_0x46e3c1,_0x40fa02){return function(_0x1b2f86){if(_0x1b2f86){var _0x25217f=_0x1b2f86[_0x685f('0x2d')],_0x3e6653=_0x40fa02['offset'],_0x3e939f=_0x40fa02[_0x685f('0x2e')]+_0x40fa02['limit'],_0x20e5ec;if(_0x3e939f>=_0x25217f){_0x3e939f=_0x25217f;_0x20e5ec=0xc8;}else{_0x20e5ec=0xce;}_0x46e3c1[_0x685f('0x2b')](_0x20e5ec);return _0x46e3c1['set'](_0x685f('0x2f'),_0x3e6653+'-'+_0x3e939f+'/'+_0x25217f)[_0x685f('0x30')](_0x1b2f86);}return null;};}function patchUpdates(_0x589745){return function(_0x5ab456){try{jsonpatch[_0x685f('0x31')](_0x5ab456,_0x589745,!![]);}catch(_0x395b30){return BPromise[_0x685f('0x32')](_0x395b30);}return _0x5ab456[_0x685f('0x33')]();};}function saveUpdates(_0xbf748,_0x4f237b){return function(_0x2b811c){if(_0x2b811c){return _0x2b811c[_0x685f('0x34')](_0xbf748)[_0x685f('0x20')](function(_0x2739be){return _0x2739be;});}return null;};}function removeEntity(_0x4fa344,_0x2480e4){return function(_0x54bf30){if(_0x54bf30){return _0x54bf30['destroy']()[_0x685f('0x20')](function(){_0x4fa344[_0x685f('0x2b')](0xcc)[_0x685f('0x2c')]();});}};}function handleEntityNotFound(_0x11924a,_0xcafadd){return function(_0x516936){if(!_0x516936){_0x11924a[_0x685f('0x35')](0x194);}return _0x516936;};}function handleError(_0x479065,_0x38f25a){_0x38f25a=_0x38f25a||0x1f4;return function(_0x52a7d5){logger[_0x685f('0x27')](_0x52a7d5[_0x685f('0x36')]);if(_0x52a7d5[_0x685f('0x37')]){delete _0x52a7d5['name'];}_0x479065[_0x685f('0x2b')](_0x38f25a)[_0x685f('0x38')](_0x52a7d5);};}exports[_0x685f('0x39')]=function(_0x1f3c6a,_0x5716d6){var _0x40d1b6={},_0x1ae6f3={},_0x4c7de8={'count':0x0,'rows':[]};var _0x5b84c3=_[_0x685f('0x3a')](db[_0x685f('0x3b')][_0x685f('0x3c')],function(_0x3d797f){return{'name':_0x3d797f[_0x685f('0x3d')],'type':_0x3d797f[_0x685f('0x3e')]['key']};});_0x1ae6f3[_0x685f('0x3f')]=_[_0x685f('0x3a')](_0x5b84c3,_0x685f('0x37'));_0x1ae6f3['query']=_[_0x685f('0x40')](_0x1f3c6a[_0x685f('0x41')]);_0x1ae6f3[_0x685f('0x42')]=_[_0x685f('0x43')](_0x1ae6f3[_0x685f('0x3f')],_0x1ae6f3[_0x685f('0x41')]);_0x40d1b6[_0x685f('0x44')]=_[_0x685f('0x43')](_0x1ae6f3['model'],qs[_0x685f('0x45')](_0x1f3c6a[_0x685f('0x41')][_0x685f('0x45')]));_0x40d1b6[_0x685f('0x44')]=_0x40d1b6[_0x685f('0x44')][_0x685f('0x46')]?_0x40d1b6['attributes']:_0x1ae6f3[_0x685f('0x3f')];if(!_0x1f3c6a[_0x685f('0x41')][_0x685f('0x47')]('nolimit')){_0x40d1b6[_0x685f('0x48')]=qs[_0x685f('0x48')](_0x1f3c6a['query'][_0x685f('0x48')]);_0x40d1b6[_0x685f('0x2e')]=qs['offset'](_0x1f3c6a[_0x685f('0x41')][_0x685f('0x2e')]);}_0x40d1b6[_0x685f('0x49')]=qs['sort'](_0x1f3c6a[_0x685f('0x41')][_0x685f('0x4a')]);_0x40d1b6['where']=qs[_0x685f('0x42')](_[_0x685f('0x4b')](_0x1f3c6a['query'],_0x1ae6f3[_0x685f('0x42')]));if(_0x1f3c6a['query'][_0x685f('0x4c')]){_0x40d1b6[_0x685f('0x4d')]=_[_0x685f('0x4e')](_0x40d1b6[_0x685f('0x4d')],{'$or':_[_0x685f('0x3a')](_0x5b84c3,function(_0x49b9e1){if(_0x49b9e1[_0x685f('0x3e')]!==_0x685f('0x4f')){var _0x29ccdd={};_0x29ccdd[_0x49b9e1['name']]={'$like':'%'+_0x1f3c6a[_0x685f('0x41')]['filter']+'%'};return _0x29ccdd;}})});}_0x40d1b6=_[_0x685f('0x4e')]({},_0x40d1b6,_0x1f3c6a[_0x685f('0x50')]);var _0x3f5122={'where':_0x40d1b6[_0x685f('0x4d')]};return db[_0x685f('0x3b')][_0x685f('0x2d')](_0x3f5122)['then'](function(_0x289e9f){_0x4c7de8[_0x685f('0x2d')]=_0x289e9f;if(_0x1f3c6a[_0x685f('0x41')][_0x685f('0x51')]){_0x40d1b6[_0x685f('0x52')]=[{'all':!![]}];}return db[_0x685f('0x3b')][_0x685f('0x53')](_0x40d1b6);})[_0x685f('0x20')](function(_0x58db1f){_0x4c7de8[_0x685f('0x54')]=_0x58db1f;return _0x4c7de8;})['then'](respondWithFilteredResult(_0x5716d6,_0x40d1b6))[_0x685f('0x55')](handleError(_0x5716d6,null));};exports['show']=function(_0x403413,_0x53b1ec){var _0x257f7b={'raw':![],'where':{'id':_0x403413[_0x685f('0x56')]['id']}},_0x3e8508={};_0x3e8508[_0x685f('0x3f')]=_[_0x685f('0x40')](db[_0x685f('0x3b')]['rawAttributes']);_0x3e8508['query']=_['keys'](_0x403413[_0x685f('0x41')]);_0x3e8508[_0x685f('0x42')]=_[_0x685f('0x43')](_0x3e8508['model'],_0x3e8508[_0x685f('0x41')]);_0x257f7b[_0x685f('0x44')]=_['intersection'](_0x3e8508[_0x685f('0x3f')],qs[_0x685f('0x45')](_0x403413[_0x685f('0x41')]['fields']));_0x257f7b[_0x685f('0x44')]=_0x257f7b[_0x685f('0x44')]['length']?_0x257f7b[_0x685f('0x44')]:_0x3e8508[_0x685f('0x3f')];if(_0x403413['query']['includeAll']){_0x257f7b[_0x685f('0x52')]=[{'all':!![]}];}_0x257f7b=_[_0x685f('0x4e')]({},_0x257f7b,_0x403413[_0x685f('0x50')]);return db[_0x685f('0x3b')][_0x685f('0x57')](_0x257f7b)[_0x685f('0x20')](handleEntityNotFound(_0x53b1ec,null))[_0x685f('0x20')](respondWithResult(_0x53b1ec,null))[_0x685f('0x55')](handleError(_0x53b1ec,null));};exports[_0x685f('0x58')]=function(_0x32a93c,_0xcc071){return db[_0x685f('0x3b')]['create'](_0x32a93c[_0x685f('0x59')],{})[_0x685f('0x20')](respondWithResult(_0xcc071,0xc9))[_0x685f('0x55')](handleError(_0xcc071,null));};exports[_0x685f('0x34')]=function(_0x5f3799,_0x49dae8){if(_0x5f3799[_0x685f('0x59')]['id']){delete _0x5f3799[_0x685f('0x59')]['id'];}return db[_0x685f('0x3b')][_0x685f('0x57')]({'where':{'id':_0x5f3799['params']['id']}})[_0x685f('0x20')](handleEntityNotFound(_0x49dae8,null))[_0x685f('0x20')](saveUpdates(_0x5f3799[_0x685f('0x59')],null))['then'](respondWithResult(_0x49dae8,null))[_0x685f('0x55')](handleError(_0x49dae8,null));};exports[_0x685f('0x5a')]=function(_0x152805,_0x869222){return db[_0x685f('0x3b')][_0x685f('0x57')]({'where':{'id':_0x152805[_0x685f('0x56')]['id']}})['then'](handleEntityNotFound(_0x869222,null))['then'](removeEntity(_0x869222,null))[_0x685f('0x55')](handleError(_0x869222,null));};exports[_0x685f('0x5b')]=function(_0x56e929,_0x7283bc,_0x184e22){var _0x2c3614={};var _0x30a82a={};var _0x3d057a;var _0x53a2db;return db['FreshdeskAccount'][_0x685f('0x5c')]({'where':{'id':_0x56e929[_0x685f('0x56')]['id']}})[_0x685f('0x20')](handleEntityNotFound(_0x7283bc,null))['then'](function(_0x554673){if(_0x554673){_0x3d057a=_0x554673;_0x30a82a[_0x685f('0x3f')]=_[_0x685f('0x40')](db[_0x685f('0x5d')][_0x685f('0x3c')]);_0x30a82a['query']=_['keys'](_0x56e929[_0x685f('0x41')]);_0x30a82a[_0x685f('0x42')]=_[_0x685f('0x43')](_0x30a82a[_0x685f('0x3f')],_0x30a82a[_0x685f('0x41')]);_0x2c3614[_0x685f('0x44')]=_[_0x685f('0x43')](_0x30a82a[_0x685f('0x3f')],qs[_0x685f('0x45')](_0x56e929[_0x685f('0x41')]['fields']));_0x2c3614[_0x685f('0x44')]=_0x2c3614[_0x685f('0x44')][_0x685f('0x46')]?_0x2c3614['attributes']:_0x30a82a[_0x685f('0x3f')];_0x2c3614[_0x685f('0x49')]=qs['sort'](_0x56e929[_0x685f('0x41')][_0x685f('0x4a')]);_0x2c3614[_0x685f('0x4d')]=qs[_0x685f('0x42')](_[_0x685f('0x4b')](_0x56e929[_0x685f('0x41')],_0x30a82a[_0x685f('0x42')]));if(_0x56e929['query']['filter']){_0x2c3614[_0x685f('0x4d')]=_[_0x685f('0x4e')](_0x2c3614[_0x685f('0x4d')],{'$or':_[_0x685f('0x3a')](_0x2c3614['attributes'],function(_0x405ac0){var _0x396f71={};_0x396f71[_0x405ac0]={'$like':'%'+_0x56e929[_0x685f('0x41')][_0x685f('0x4c')]+'%'};return _0x396f71;})});}_0x2c3614=_['merge']({},_0x2c3614,_0x56e929[_0x685f('0x50')]);return _0x3d057a[_0x685f('0x5b')](_0x2c3614);}})[_0x685f('0x20')](function(_0xd41f6){if(_0xd41f6){_0x53a2db=_0xd41f6[_0x685f('0x46')];if(!_0x56e929[_0x685f('0x41')][_0x685f('0x47')](_0x685f('0x5e'))){_0x2c3614[_0x685f('0x48')]=qs[_0x685f('0x48')](_0x56e929[_0x685f('0x41')]['limit']);_0x2c3614[_0x685f('0x2e')]=qs['offset'](_0x56e929['query'][_0x685f('0x2e')]);}return _0x3d057a['getConfigurations'](_0x2c3614);}})[_0x685f('0x20')](function(_0x33ccc5){if(_0x33ccc5){return _0x33ccc5?{'count':_0x53a2db,'rows':_0x33ccc5}:null;}})['then'](respondWithResult(_0x7283bc,null))['catch'](handleError(_0x7283bc,null));};exports[_0x685f('0x5f')]=function(_0x42f920,_0x2c309f,_0x8b5be8){if(_0x42f920[_0x685f('0x59')]['id']){delete _0x42f920['body']['id'];}return db[_0x685f('0x3b')][_0x685f('0x5c')]({'where':{'id':_0x42f920[_0x685f('0x56')]['id']}})[_0x685f('0x20')](handleEntityNotFound(_0x2c309f,null))['then'](function(_0x2d0d5e){if(_0x2d0d5e){_0x42f920[_0x685f('0x59')][_0x685f('0x60')]=_0x2d0d5e['id'];_0x42f920[_0x685f('0x59')]['Subjects']=integrations[_0x685f('0x61')](_0x42f920['body'][_0x685f('0x62')],_0x42f920[_0x685f('0x59')][_0x685f('0x3e')]);_0x42f920['body'][_0x685f('0x63')]=integrations['getDescriptions'](_0x42f920['body'][_0x685f('0x62')],_0x42f920['body'][_0x685f('0x3e')]);return db[_0x685f('0x5d')][_0x685f('0x58')](_0x42f920[_0x685f('0x59')],{'include':[{'model':db[_0x685f('0x64')],'as':_0x685f('0x65')},{'model':db['FreshdeskField'],'as':_0x685f('0x63')}]});}return null;})[_0x685f('0x20')](respondWithResult(_0x2c309f,null))[_0x685f('0x55')](handleError(_0x2c309f,null));};exports[_0x685f('0x66')]=function(_0x5ec1c7,_0x13fcc0,_0x6b52e6){var _0x25afae='';return db[_0x685f('0x3b')][_0x685f('0x5c')]({'where':{'id':_0x5ec1c7[_0x685f('0x56')]['id']},'attributes':['id',_0x685f('0x67'),_0x685f('0x68')]})[_0x685f('0x20')](handleEntityNotFound(_0x13fcc0,null))[_0x685f('0x20')](function(_0x576b5f){if(_0x576b5f){_0x25afae=_0x576b5f[_0x685f('0x67')];var _0x509fa4=_0x25afae[_0x685f('0x69')](-0x1);if(_0x509fa4==='/'){_0x25afae=_0x25afae[_0x685f('0x6a')](0x0,_0x25afae[_0x685f('0x6b')](_0x509fa4));}return rp({'method':_0x685f('0x6c'),'uri':util[_0x685f('0x6d')](_0x685f('0x6e'),_0x25afae,_0x685f('0x6f')),'headers':{'Authorization':util[_0x685f('0x6d')]('Basic\x20%s',new Buffer(util[_0x685f('0x6d')]('%s:X',_0x576b5f[_0x685f('0x68')]))[_0x685f('0x70')](_0x685f('0x71')))},'json':!![]});}})[_0x685f('0x20')](function(_0x3351ce){if(_0x3351ce){var _0x378339=[_0x685f('0x72'),_0x685f('0x73'),_0x685f('0x74'),_0x685f('0x75'),_0x685f('0x2b'),_0x685f('0x76'),_0x685f('0x77'),_0x685f('0x78'),_0x685f('0x79'),'group',_0x685f('0x7a')];_['remove'](_0x3351ce,function(_0x189574){return _0x378339['includes'](_0x189574[_0x685f('0x37')])||!_0x189574[_0x685f('0x7b')]&&_0x189574[_0x685f('0x3e')]!==_0x685f('0x7c')&&_0x189574['type']!==_0x685f('0x7d');});return{'count':_0x3351ce[_0x685f('0x46')],'rows':_[_0x685f('0x3a')](_0x3351ce,function(_0x3254b4){return{'id':_0x3254b4['name'],'name':_0x3254b4[_0x685f('0x7e')],'custom':!_0x3254b4[_0x685f('0x7b')],'options':_0x3254b4[_0x685f('0x7f')]?_['map'](_0x3254b4[_0x685f('0x7f')],function(_0x29c2db){return{'name':_['capitalize'](_0x29c2db),'value':_0x29c2db};}):[]};})};}})[_0x685f('0x20')](respondWithResult(_0x13fcc0,null))[_0x685f('0x55')](function(_0x3addc3){var _0x3f4f21=_0x5ec1c7[_0x685f('0x41')]['test']?0x1f4:_0x3addc3[_0x685f('0x80')]||0x1f4;logger[_0x685f('0x27')](_0x685f('0x81'),_0x685f('0x66'),_0x3f4f21,JSON[_0x685f('0x26')](_0x3addc3));delete _0x3addc3['name'];if(_0x3f4f21===0x191){_0x3f4f21=0x190;}_0x13fcc0[_0x685f('0x2b')](_0x3f4f21)['send'](_0x5ec1c7[_0x685f('0x41')]['test']?{'message':_0x685f('0x82'),'statusCode':_0x3addc3['statusCode']}:_0x3addc3);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 7eb39b5..77b1120 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 _0x177b=['lodash','util','moment','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x30b287,_0xf8d162){var _0x25eb22=function(_0x52697d){while(--_0x52697d){_0x30b287['push'](_0x30b287['shift']());}};_0x25eb22(++_0xf8d162);}(_0x177b,0x84));var _0xb177=function(_0x561e73,_0x13a224){_0x561e73=_0x561e73-0x0;var _0x2dc60d=_0x177b[_0x561e73];return _0x2dc60d;};'use strict';var _=require(_0xb177('0x0'));var util=require(_0xb177('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb177('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb177('0x3'));var rimraf=require(_0xb177('0x4'));var config=require(_0xb177('0x5'));var attributes=require(_0xb177('0x6'));var integrations=require(_0xb177('0x7'));module[_0xb177('0x8')]=function(_0x6b7f29,_0x267e9b){return _0x6b7f29['define'](_0xb177('0x9'),attributes,{'tableName':_0xb177('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2f2=['../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes'];(function(_0x140357,_0x6670bd){var _0x4fdf00=function(_0x527977){while(--_0x527977){_0x140357['push'](_0x140357['shift']());}};_0x4fdf00(++_0x6670bd);}(_0xc2f2,0x67));var _0x2c2f=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc2f2[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x2c2f('0x0'));var util=require('util');var logger=require(_0x2c2f('0x1'))(_0x2c2f('0x2'));var moment=require(_0x2c2f('0x3'));var BPromise=require(_0x2c2f('0x4'));var rp=require(_0x2c2f('0x5'));var fs=require('fs');var path=require(_0x2c2f('0x6'));var rimraf=require(_0x2c2f('0x7'));var config=require('../../config/environment');var attributes=require(_0x2c2f('0x8'));var integrations=require(_0x2c2f('0x9'));module[_0x2c2f('0xa')]=function(_0x56010e,_0x3f1fad){return _0x56010e[_0x2c2f('0xb')](_0x2c2f('0xc'),attributes,{'tableName':_0x2c2f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index dd8fdba..c80d6da 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 _0x083b=['info','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowFreshdeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','code','error','message'];(function(_0x48fe07,_0x361a5a){var _0x589bb0=function(_0x3bd240){while(--_0x3bd240){_0x48fe07['push'](_0x48fe07['shift']());}};_0x589bb0(++_0x361a5a);}(_0x083b,0x1b4));var _0xb083=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x083b[_0x5ecadc];return _0x565037;};'use strict';var _=require(_0xb083('0x0'));var util=require(_0xb083('0x1'));var moment=require('moment');var BPromise=require(_0xb083('0x2'));var rs=require(_0xb083('0x3'));var fs=require('fs');var Redis=require(_0xb083('0x4'));var db=require(_0xb083('0x5'))['db'];var utils=require(_0xb083('0x6'));var logger=require(_0xb083('0x7'))(_0xb083('0x8'));var config=require(_0xb083('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb083('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cf4f3,_0x4449fd,_0x17078){return new BPromise(function(_0x3ee62b,_0x3beaab){return client[_0xb083('0xb')](_0x4cf4f3,_0x17078)[_0xb083('0xc')](function(_0x41b051){logger['info'](_0xb083('0xd'),_0x4449fd,_0xb083('0xe'));logger[_0xb083('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x4449fd,_0xb083('0xe'),JSON['stringify'](_0x41b051));if(_0x41b051['error']){if(_0x41b051['error'][_0xb083('0x10')]===0x1f4){logger[_0xb083('0x11')](_0xb083('0xd'),_0x4449fd,_0x41b051[_0xb083('0x11')][_0xb083('0x12')]);return _0x3beaab(_0x41b051[_0xb083('0x11')]['message']);}logger[_0xb083('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x4449fd,_0x41b051[_0xb083('0x11')]['message']);return _0x3ee62b(_0x41b051[_0xb083('0x11')][_0xb083('0x12')]);}else{logger[_0xb083('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x4449fd,_0xb083('0xe'));_0x3ee62b(_0x41b051[_0xb083('0x14')][_0xb083('0x12')]);}})[_0xb083('0x15')](function(_0x22635d){logger[_0xb083('0x11')](_0xb083('0xd'),_0x4449fd,_0x22635d);_0x3beaab(_0x22635d);});});}exports[_0xb083('0x16')]=function(_0x52d501){var _0xb6f0f4=this;return new Promise(function(_0x2b0560,_0xf7e4c){return db[_0xb083('0x17')][_0xb083('0x18')]({'raw':_0x52d501['options']?_0x52d501[_0xb083('0x19')][_0xb083('0x1a')]===undefined?!![]:![]:!![],'where':_0x52d501['options']?_0x52d501[_0xb083('0x19')][_0xb083('0x1b')]||null:null,'attributes':_0x52d501[_0xb083('0x19')]?_0x52d501['options']['attributes']||null:null,'limit':_0x52d501[_0xb083('0x19')]?_0x52d501['options'][_0xb083('0x1c')]||null:null,'include':_0x52d501[_0xb083('0x19')]?_0x52d501[_0xb083('0x19')][_0xb083('0x1d')]?_[_0xb083('0x1e')](_0x52d501[_0xb083('0x19')][_0xb083('0x1d')],function(_0x59dcc0){return{'model':db[_0x59dcc0[_0xb083('0x1f')]],'as':_0x59dcc0['as'],'attributes':_0x59dcc0[_0xb083('0x20')],'include':_0x59dcc0['include']?_[_0xb083('0x1e')](_0x59dcc0[_0xb083('0x1d')],function(_0xed0a1){return{'model':db[_0xed0a1['model']],'as':_0xed0a1['as'],'attributes':_0xed0a1['attributes'],'include':_0xed0a1['include']?_['map'](_0xed0a1[_0xb083('0x1d')],function(_0xd147db){return{'model':db[_0xd147db['model']],'as':_0xd147db['as'],'attributes':_0xd147db[_0xb083('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x424e5a){logger[_0xb083('0x13')](_0xb083('0x16'),_0x52d501);logger[_0xb083('0xf')]('GetFreshdeskAccount',_0x52d501,JSON['stringify'](_0x424e5a));_0x2b0560(_0x424e5a);})[_0xb083('0x15')](function(_0x24fe20){logger['error'](_0xb083('0x16'),_0x24fe20[_0xb083('0x12')],_0x52d501);_0xf7e4c(_0xb6f0f4['error'](0x1f4,_0x24fe20[_0xb083('0x12')]));});});};exports[_0xb083('0x21')]=function(_0x501f3b){var _0x10f2ed=this;return new Promise(function(_0x51cf98,_0x5b1922){return db[_0xb083('0x17')][_0xb083('0x22')]({'raw':_0x501f3b[_0xb083('0x19')]?_0x501f3b[_0xb083('0x19')][_0xb083('0x1a')]===undefined?!![]:![]:!![],'where':_0x501f3b[_0xb083('0x19')]?_0x501f3b[_0xb083('0x19')][_0xb083('0x1b')]||null:null,'attributes':_0x501f3b[_0xb083('0x19')]?_0x501f3b[_0xb083('0x19')][_0xb083('0x20')]||null:null,'include':_0x501f3b[_0xb083('0x19')]?_0x501f3b[_0xb083('0x19')][_0xb083('0x1d')]?_[_0xb083('0x1e')](_0x501f3b[_0xb083('0x19')][_0xb083('0x1d')],function(_0x185c8e){return{'model':db[_0x185c8e[_0xb083('0x1f')]],'as':_0x185c8e['as'],'attributes':_0x185c8e[_0xb083('0x20')],'include':_0x185c8e[_0xb083('0x1d')]?_['map'](_0x185c8e[_0xb083('0x1d')],function(_0x1b1eae){return{'model':db[_0x1b1eae[_0xb083('0x1f')]],'as':_0x1b1eae['as'],'attributes':_0x1b1eae[_0xb083('0x20')],'include':_0x1b1eae[_0xb083('0x1d')]?_[_0xb083('0x1e')](_0x1b1eae[_0xb083('0x1d')],function(_0x494d5c){return{'model':db[_0x494d5c[_0xb083('0x1f')]],'as':_0x494d5c['as'],'attributes':_0x494d5c[_0xb083('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb083('0xc')](function(_0xcb343d){logger[_0xb083('0x13')]('ShowFreshdeskAccount',_0x501f3b);logger['debug']('ShowFreshdeskAccount',_0x501f3b,JSON['stringify'](_0xcb343d));_0x51cf98(_0xcb343d);})[_0xb083('0x15')](function(_0x5cdf0b){logger['error']('ShowFreshdeskAccount',_0x5cdf0b['message'],_0x501f3b);_0x5b1922(_0x10f2ed['error'](0x1f4,_0x5cdf0b[_0xb083('0x12')]));});});}; \ No newline at end of file +var _0xaea5=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','FreshdeskAccount','findAll','options','raw','attributes','limit','map','include','model','GetFreshdeskAccount','stringify','ShowFreshdeskAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2a1481,_0x5b1770){var _0x49ab92=function(_0x258e6f){while(--_0x258e6f){_0x2a1481['push'](_0x2a1481['shift']());}};_0x49ab92(++_0x5b1770);}(_0xaea5,0x8f));var _0x5aea=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xaea5[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x5aea('0x0'));var util=require(_0x5aea('0x1'));var moment=require(_0x5aea('0x2'));var BPromise=require(_0x5aea('0x3'));var rs=require(_0x5aea('0x4'));var fs=require('fs');var Redis=require(_0x5aea('0x5'));var db=require(_0x5aea('0x6'))['db'];var utils=require(_0x5aea('0x7'));var logger=require(_0x5aea('0x8'))(_0x5aea('0x9'));var config=require(_0x5aea('0xa'));var jayson=require(_0x5aea('0xb'));var client=jayson[_0x5aea('0xc')][_0x5aea('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4792a7,_0x524fe6,_0x9712ab){return new BPromise(function(_0x218a8c,_0x1d286b){return client[_0x5aea('0xe')](_0x4792a7,_0x9712ab)[_0x5aea('0xf')](function(_0x2ab96d){logger[_0x5aea('0x10')](_0x5aea('0x11'),_0x524fe6,_0x5aea('0x12'));logger[_0x5aea('0x13')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x524fe6,_0x5aea('0x12'),JSON['stringify'](_0x2ab96d));if(_0x2ab96d['error']){if(_0x2ab96d[_0x5aea('0x14')][_0x5aea('0x15')]===0x1f4){logger[_0x5aea('0x14')](_0x5aea('0x11'),_0x524fe6,_0x2ab96d[_0x5aea('0x14')]['message']);return _0x1d286b(_0x2ab96d[_0x5aea('0x14')][_0x5aea('0x16')]);}logger[_0x5aea('0x14')](_0x5aea('0x11'),_0x524fe6,_0x2ab96d[_0x5aea('0x14')][_0x5aea('0x16')]);return _0x218a8c(_0x2ab96d[_0x5aea('0x14')][_0x5aea('0x16')]);}else{logger[_0x5aea('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x524fe6,'request\x20sent');_0x218a8c(_0x2ab96d[_0x5aea('0x17')][_0x5aea('0x16')]);}})[_0x5aea('0x18')](function(_0x5df886){logger[_0x5aea('0x14')](_0x5aea('0x11'),_0x524fe6,_0x5df886);_0x1d286b(_0x5df886);});});}exports['GetFreshdeskAccount']=function(_0x34595b){var _0x432be6=this;return new Promise(function(_0x4eaad3,_0x4e8c0b){return db[_0x5aea('0x19')][_0x5aea('0x1a')]({'raw':_0x34595b[_0x5aea('0x1b')]?_0x34595b['options'][_0x5aea('0x1c')]===undefined?!![]:![]:!![],'where':_0x34595b[_0x5aea('0x1b')]?_0x34595b[_0x5aea('0x1b')]['where']||null:null,'attributes':_0x34595b[_0x5aea('0x1b')]?_0x34595b[_0x5aea('0x1b')][_0x5aea('0x1d')]||null:null,'limit':_0x34595b[_0x5aea('0x1b')]?_0x34595b['options'][_0x5aea('0x1e')]||null:null,'include':_0x34595b[_0x5aea('0x1b')]?_0x34595b[_0x5aea('0x1b')]['include']?_[_0x5aea('0x1f')](_0x34595b[_0x5aea('0x1b')][_0x5aea('0x20')],function(_0xd09170){return{'model':db[_0xd09170[_0x5aea('0x21')]],'as':_0xd09170['as'],'attributes':_0xd09170['attributes'],'include':_0xd09170['include']?_['map'](_0xd09170[_0x5aea('0x20')],function(_0x1e69fd){return{'model':db[_0x1e69fd[_0x5aea('0x21')]],'as':_0x1e69fd['as'],'attributes':_0x1e69fd[_0x5aea('0x1d')],'include':_0x1e69fd[_0x5aea('0x20')]?_[_0x5aea('0x1f')](_0x1e69fd[_0x5aea('0x20')],function(_0x25befd){return{'model':db[_0x25befd[_0x5aea('0x21')]],'as':_0x25befd['as'],'attributes':_0x25befd[_0x5aea('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50822d){logger['info'](_0x5aea('0x22'),_0x34595b);logger[_0x5aea('0x13')](_0x5aea('0x22'),_0x34595b,JSON[_0x5aea('0x23')](_0x50822d));_0x4eaad3(_0x50822d);})[_0x5aea('0x18')](function(_0x5eab6a){logger[_0x5aea('0x14')]('GetFreshdeskAccount',_0x5eab6a[_0x5aea('0x16')],_0x34595b);_0x4e8c0b(_0x432be6[_0x5aea('0x14')](0x1f4,_0x5eab6a[_0x5aea('0x16')]));});});};exports[_0x5aea('0x24')]=function(_0x354cc6){var _0x20ca48=this;return new Promise(function(_0x527ff5,_0x5c89fd){return db['FreshdeskAccount']['find']({'raw':_0x354cc6[_0x5aea('0x1b')]?_0x354cc6['options'][_0x5aea('0x1c')]===undefined?!![]:![]:!![],'where':_0x354cc6[_0x5aea('0x1b')]?_0x354cc6[_0x5aea('0x1b')][_0x5aea('0x25')]||null:null,'attributes':_0x354cc6[_0x5aea('0x1b')]?_0x354cc6[_0x5aea('0x1b')][_0x5aea('0x1d')]||null:null,'include':_0x354cc6[_0x5aea('0x1b')]?_0x354cc6['options'][_0x5aea('0x20')]?_[_0x5aea('0x1f')](_0x354cc6[_0x5aea('0x1b')][_0x5aea('0x20')],function(_0x54d4b4){return{'model':db[_0x54d4b4[_0x5aea('0x21')]],'as':_0x54d4b4['as'],'attributes':_0x54d4b4[_0x5aea('0x1d')],'include':_0x54d4b4[_0x5aea('0x20')]?_[_0x5aea('0x1f')](_0x54d4b4[_0x5aea('0x20')],function(_0x3068ac){return{'model':db[_0x3068ac['model']],'as':_0x3068ac['as'],'attributes':_0x3068ac[_0x5aea('0x1d')],'include':_0x3068ac['include']?_[_0x5aea('0x1f')](_0x3068ac[_0x5aea('0x20')],function(_0x3531e8){return{'model':db[_0x3531e8[_0x5aea('0x21')]],'as':_0x3531e8['as'],'attributes':_0x3531e8[_0x5aea('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b90d8){logger[_0x5aea('0x10')](_0x5aea('0x24'),_0x354cc6);logger[_0x5aea('0x13')](_0x5aea('0x24'),_0x354cc6,JSON[_0x5aea('0x23')](_0x1b90d8));_0x527ff5(_0x1b90d8);})[_0x5aea('0x18')](function(_0x1aeefa){logger[_0x5aea('0x14')](_0x5aea('0x24'),_0x1aeefa[_0x5aea('0x16')],_0x354cc6);_0x5c89fd(_0x20ca48['error'](0x1f4,_0x1aeefa['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index ab08ffe..24019fd 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 _0x16ce=['/:id','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put'];(function(_0x40860d,_0x1874fb){var _0x21b9ac=function(_0x3bc0bd){while(--_0x3bc0bd){_0x40860d['push'](_0x40860d['shift']());}};_0x21b9ac(++_0x1874fb);}(_0x16ce,0x1a3));var _0xe16c=function(_0x42b10f,_0x221e68){_0x42b10f=_0x42b10f-0x0;var _0x3c98d3=_0x16ce[_0x42b10f];return _0x3c98d3;};'use strict';var multer=require(_0xe16c('0x0'));var util=require(_0xe16c('0x1'));var path=require(_0xe16c('0x2'));var timeout=require(_0xe16c('0x3'));var express=require('express');var router=express[_0xe16c('0x4')]();var auth=require(_0xe16c('0x5'));var interaction=require(_0xe16c('0x6'));var config=require(_0xe16c('0x7'));var controller=require(_0xe16c('0x8'));router[_0xe16c('0x9')]('/',auth[_0xe16c('0xa')](),controller['index']);router['get']('/:id',auth[_0xe16c('0xa')](),controller[_0xe16c('0xb')]);router['get']('/:id/fields',auth[_0xe16c('0xa')](),controller[_0xe16c('0xc')]);router[_0xe16c('0x9')](_0xe16c('0xd'),auth['isAuthenticated'](),controller[_0xe16c('0xe')]);router[_0xe16c('0x9')](_0xe16c('0xf'),auth[_0xe16c('0xa')](),controller[_0xe16c('0x10')]);router[_0xe16c('0x9')](_0xe16c('0x11'),auth[_0xe16c('0xa')](),controller[_0xe16c('0x12')]);router[_0xe16c('0x13')]('/',auth['isAuthenticated'](),controller[_0xe16c('0x14')]);router[_0xe16c('0x13')]('/:id/tags',auth[_0xe16c('0xa')](),controller[_0xe16c('0x15')]);router[_0xe16c('0x16')](_0xe16c('0x17'),auth[_0xe16c('0xa')](),controller['update']);router[_0xe16c('0x18')](_0xe16c('0x17'),auth['isAuthenticated'](),controller['destroy']);module[_0xe16c('0x19')]=router; \ No newline at end of file +var _0xd386=['/:id/tags','getTags','post','create','setTags','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x2bcbff,_0x5c1d7d){var _0x5d0abd=function(_0xf0ab54){while(--_0xf0ab54){_0x2bcbff['push'](_0x2bcbff['shift']());}};_0x5d0abd(++_0x5c1d7d);}(_0xd386,0x133));var _0x6d38=function(_0x33c7f0,_0x5c9f1c){_0x33c7f0=_0x33c7f0-0x0;var _0x491bef=_0xd386[_0x33c7f0];return _0x491bef;};'use strict';var multer=require('multer');var util=require(_0x6d38('0x0'));var path=require('path');var timeout=require(_0x6d38('0x1'));var express=require(_0x6d38('0x2'));var router=express[_0x6d38('0x3')]();var auth=require(_0x6d38('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6d38('0x5'));var controller=require(_0x6d38('0x6'));router[_0x6d38('0x7')]('/',auth[_0x6d38('0x8')](),controller['index']);router['get'](_0x6d38('0x9'),auth['isAuthenticated'](),controller[_0x6d38('0xa')]);router[_0x6d38('0x7')](_0x6d38('0xb'),auth[_0x6d38('0x8')](),controller['getFields']);router[_0x6d38('0x7')](_0x6d38('0xc'),auth[_0x6d38('0x8')](),controller[_0x6d38('0xd')]);router[_0x6d38('0x7')](_0x6d38('0xe'),auth[_0x6d38('0x8')](),controller['getDescriptions']);router[_0x6d38('0x7')](_0x6d38('0xf'),auth['isAuthenticated'](),controller[_0x6d38('0x10')]);router[_0x6d38('0x11')]('/',auth[_0x6d38('0x8')](),controller[_0x6d38('0x12')]);router[_0x6d38('0x11')](_0x6d38('0xf'),auth['isAuthenticated'](),controller[_0x6d38('0x13')]);router['put']('/:id',auth[_0x6d38('0x8')](),controller[_0x6d38('0x14')]);router[_0x6d38('0x15')](_0x6d38('0x9'),auth[_0x6d38('0x8')](),controller[_0x6d38('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 047973f..02ab6c2 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 _0xac49=['sequelize','STRING'];(function(_0x355b15,_0x51becb){var _0x50a588=function(_0x507474){while(--_0x507474){_0x355b15['push'](_0x355b15['shift']());}};_0x50a588(++_0x51becb);}(_0xac49,0x150));var _0x9ac4=function(_0xd2910c,_0x53ed42){_0xd2910c=_0xd2910c-0x0;var _0x3baf0a=_0xac49[_0xd2910c];return _0x3baf0a;};'use strict';var Sequelize=require(_0x9ac4('0x0'));module['exports']={'name':{'type':Sequelize[_0x9ac4('0x1')]},'description':{'type':Sequelize[_0x9ac4('0x1')]}}; \ No newline at end of file +var _0x7c8e=['STRING','exports'];(function(_0x32bb6b,_0x1a5fbe){var _0x58dcb4=function(_0x402ee2){while(--_0x402ee2){_0x32bb6b['push'](_0x32bb6b['shift']());}};_0x58dcb4(++_0x1a5fbe);}(_0x7c8e,0x95));var _0xe7c8=function(_0x45385c,_0x840419){_0x45385c=_0x45385c-0x0;var _0x523eb1=_0x7c8e[_0x45385c];return _0x523eb1;};'use strict';var Sequelize=require('sequelize');module[_0xe7c8('0x0')]={'name':{'type':Sequelize[_0xe7c8('0x1')]},'description':{'type':Sequelize[_0xe7c8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 5958ecf..baadffd 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 _0xc35f=['Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','Sequelize','ValidationError','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','sendStatus','status','end','json','count','limit','set','Content-Range','apply','save','update','name','send','index','map','FreshdeskConfiguration','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','getFields','order','getSubjects','findOne','FreshdeskField','getDescriptions','getTags'];(function(_0x1935b5,_0x25693e){var _0x2ece97=function(_0x58e504){while(--_0x58e504){_0x1935b5['push'](_0x1935b5['shift']());}};_0x2ece97(++_0x25693e);}(_0xc35f,0x1ca));var _0xfc35=function(_0x51fef5,_0x58d17e){_0x51fef5=_0x51fef5-0x0;var _0x415a19=_0xc35f[_0x51fef5];return _0x415a19;};'use strict';var pdf=require(_0xfc35('0x0'));var emlformat=require(_0xfc35('0x1'));var rimraf=require(_0xfc35('0x2'));var zipdir=require(_0xfc35('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc35('0x4'));var moment=require(_0xfc35('0x5'));var BPromise=require(_0xfc35('0x6'));var Mustache=require('mustache');var util=require(_0xfc35('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfc35('0x8'));var ejs=require(_0xfc35('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xfc35('0xa'));var jsforce=require(_0xfc35('0xb'));var deskjs=require(_0xfc35('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfc35('0xd'));var Papa=require(_0xfc35('0xe'));var Redis=require(_0xfc35('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfc35('0x10'));var as=require(_0xfc35('0x11'));var hardwareService=require(_0xfc35('0x12'));var logger=require(_0xfc35('0x13'))('api');var utils=require(_0xfc35('0x14'));var config=require(_0xfc35('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xfc35('0x16'));var client=jayson[_0xfc35('0x17')][_0xfc35('0x18')]({'port':0x232a});function checkPasswordPattern(_0x48bf41,_0x3703cf,_0x4f1d03){if(_0x4f1d03){var _0x3a7fb1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a7fb1['test'](_0x3703cf)){return _0x48bf41;}else{throw new db[(_0xfc35('0x19'))][(_0xfc35('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 _0x48bf41;}}function respondWithRpcPromise(_0x5cd93e,_0x392562,_0x22d5eb,_0xea3e2a){return new BPromise(function(_0x10cf41,_0x163287){var _0x2fda51=_0xea3e2a||client;return _0x2fda51['request'](_0x5cd93e,_0x22d5eb)[_0xfc35('0x1b')](function(_0x2ff03c){logger['info'](_0xfc35('0x1c'),_0x392562,_0xfc35('0x1d'));logger[_0xfc35('0x1e')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x392562,_0xfc35('0x1d'),JSON[_0xfc35('0x1f')](_0x2ff03c));if(_0x2ff03c[_0xfc35('0x20')]){if(_0x2ff03c[_0xfc35('0x20')]['code']===0x1f4){logger[_0xfc35('0x20')](_0xfc35('0x1c'),_0x392562,_0x2ff03c[_0xfc35('0x20')]['message']);return _0x163287(_0x2ff03c[_0xfc35('0x20')][_0xfc35('0x21')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x392562,_0x2ff03c[_0xfc35('0x20')][_0xfc35('0x21')]);return _0x10cf41(_0x2ff03c['error'][_0xfc35('0x21')]);}else{logger[_0xfc35('0x22')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x392562,_0xfc35('0x1d'));_0x10cf41(_0x2ff03c[_0xfc35('0x23')][_0xfc35('0x21')]);}})['catch'](function(_0x2f08ac){logger['error'](_0xfc35('0x1c'),_0x392562,_0x2f08ac);_0x163287(_0x2f08ac);});});}function respondWithStatusCode(_0x394e1f,_0x1d42fd){_0x1d42fd=_0x1d42fd||0xcc;return function(_0x1e729e){if(_0x1e729e){return _0x394e1f[_0xfc35('0x24')](_0x1d42fd);}return _0x394e1f[_0xfc35('0x25')](_0x1d42fd)[_0xfc35('0x26')]();};}function respondWithResult(_0x2962f5,_0x3f13d3){_0x3f13d3=_0x3f13d3||0xc8;return function(_0x513282){if(_0x513282){return _0x2962f5[_0xfc35('0x25')](_0x3f13d3)[_0xfc35('0x27')](_0x513282);}};}function respondWithFilteredResult(_0x102d34,_0x4bedfe){return function(_0x52565a){if(_0x52565a){var _0xc977fd=_0x52565a[_0xfc35('0x28')],_0x167106=_0x4bedfe['offset'],_0x6c8e0e=_0x4bedfe['offset']+_0x4bedfe[_0xfc35('0x29')],_0x109936;if(_0x6c8e0e>=_0xc977fd){_0x6c8e0e=_0xc977fd;_0x109936=0xc8;}else{_0x109936=0xce;}_0x102d34[_0xfc35('0x25')](_0x109936);return _0x102d34[_0xfc35('0x2a')](_0xfc35('0x2b'),_0x167106+'-'+_0x6c8e0e+'/'+_0xc977fd)[_0xfc35('0x27')](_0x52565a);}return null;};}function patchUpdates(_0xa9c9d7){return function(_0x35d830){try{jsonpatch[_0xfc35('0x2c')](_0x35d830,_0xa9c9d7,!![]);}catch(_0x3a5a98){return BPromise['reject'](_0x3a5a98);}return _0x35d830[_0xfc35('0x2d')]();};}function saveUpdates(_0x159e52,_0x412157){return function(_0xa09fbd){if(_0xa09fbd){return _0xa09fbd[_0xfc35('0x2e')](_0x159e52)[_0xfc35('0x1b')](function(_0xfd66c){return _0xfd66c;});}return null;};}function removeEntity(_0x485506,_0x30282a){return function(_0x3ce9d4){if(_0x3ce9d4){return _0x3ce9d4['destroy']()[_0xfc35('0x1b')](function(){_0x485506[_0xfc35('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277ad7,_0x370cee){return function(_0x59f59d){if(!_0x59f59d){_0x277ad7['sendStatus'](0x194);}return _0x59f59d;};}function handleError(_0x31bee4,_0xb6d619){_0xb6d619=_0xb6d619||0x1f4;return function(_0x480aa1){logger[_0xfc35('0x20')](_0x480aa1['stack']);if(_0x480aa1[_0xfc35('0x2f')]){delete _0x480aa1[_0xfc35('0x2f')];}_0x31bee4[_0xfc35('0x25')](_0xb6d619)[_0xfc35('0x30')](_0x480aa1);};}exports[_0xfc35('0x31')]=function(_0x261997,_0x4d9b53){var _0x5e6b6e={},_0x2a0e07={},_0x4d6259={'count':0x0,'rows':[]};var _0x2c1199=_[_0xfc35('0x32')](db[_0xfc35('0x33')]['rawAttributes'],function(_0x19bf10){return{'name':_0x19bf10['fieldName'],'type':_0x19bf10[_0xfc35('0x34')][_0xfc35('0x35')]};});_0x2a0e07[_0xfc35('0x36')]=_[_0xfc35('0x32')](_0x2c1199,_0xfc35('0x2f'));_0x2a0e07['query']=_[_0xfc35('0x37')](_0x261997[_0xfc35('0x38')]);_0x2a0e07[_0xfc35('0x39')]=_[_0xfc35('0x3a')](_0x2a0e07[_0xfc35('0x36')],_0x2a0e07[_0xfc35('0x38')]);_0x5e6b6e['attributes']=_['intersection'](_0x2a0e07[_0xfc35('0x36')],qs[_0xfc35('0x3b')](_0x261997[_0xfc35('0x38')][_0xfc35('0x3b')]));_0x5e6b6e[_0xfc35('0x3c')]=_0x5e6b6e[_0xfc35('0x3c')][_0xfc35('0x3d')]?_0x5e6b6e['attributes']:_0x2a0e07[_0xfc35('0x36')];if(!_0x261997[_0xfc35('0x38')][_0xfc35('0x3e')](_0xfc35('0x3f'))){_0x5e6b6e[_0xfc35('0x29')]=qs[_0xfc35('0x29')](_0x261997[_0xfc35('0x38')][_0xfc35('0x29')]);_0x5e6b6e[_0xfc35('0x40')]=qs[_0xfc35('0x40')](_0x261997[_0xfc35('0x38')]['offset']);}_0x5e6b6e['order']=qs[_0xfc35('0x41')](_0x261997['query'][_0xfc35('0x41')]);_0x5e6b6e['where']=qs[_0xfc35('0x39')](_[_0xfc35('0x42')](_0x261997[_0xfc35('0x38')],_0x2a0e07['filters']));if(_0x261997[_0xfc35('0x38')][_0xfc35('0x43')]){_0x5e6b6e[_0xfc35('0x44')]=_['merge'](_0x5e6b6e['where'],{'$or':_[_0xfc35('0x32')](_0x2c1199,function(_0x2187c1){if(_0x2187c1[_0xfc35('0x34')]!=='VIRTUAL'){var _0x37c3c9={};_0x37c3c9[_0x2187c1[_0xfc35('0x2f')]]={'$like':'%'+_0x261997[_0xfc35('0x38')][_0xfc35('0x43')]+'%'};return _0x37c3c9;}})});}_0x5e6b6e=_[_0xfc35('0x45')]({},_0x5e6b6e,_0x261997[_0xfc35('0x46')]);var _0xc3af72={'where':_0x5e6b6e[_0xfc35('0x44')]};return db[_0xfc35('0x33')]['count'](_0xc3af72)[_0xfc35('0x1b')](function(_0x1a3bb3){_0x4d6259[_0xfc35('0x28')]=_0x1a3bb3;if(_0x261997[_0xfc35('0x38')][_0xfc35('0x47')]){_0x5e6b6e[_0xfc35('0x48')]=[{'all':!![]}];}return db[_0xfc35('0x33')][_0xfc35('0x49')](_0x5e6b6e);})[_0xfc35('0x1b')](function(_0x294e5a){_0x4d6259['rows']=_0x294e5a;return _0x4d6259;})['then'](respondWithFilteredResult(_0x4d9b53,_0x5e6b6e))[_0xfc35('0x4a')](handleError(_0x4d9b53,null));};exports[_0xfc35('0x4b')]=function(_0x25e838,_0xc38758){var _0x32d9b1={'raw':![],'where':{'id':_0x25e838[_0xfc35('0x4c')]['id']}},_0x10d39e={};_0x10d39e[_0xfc35('0x36')]=_[_0xfc35('0x37')](db[_0xfc35('0x33')][_0xfc35('0x4d')]);_0x10d39e[_0xfc35('0x38')]=_[_0xfc35('0x37')](_0x25e838[_0xfc35('0x38')]);_0x10d39e[_0xfc35('0x39')]=_[_0xfc35('0x3a')](_0x10d39e[_0xfc35('0x36')],_0x10d39e[_0xfc35('0x38')]);_0x32d9b1[_0xfc35('0x3c')]=_['intersection'](_0x10d39e['model'],qs[_0xfc35('0x3b')](_0x25e838[_0xfc35('0x38')][_0xfc35('0x3b')]));_0x32d9b1[_0xfc35('0x3c')]=_0x32d9b1[_0xfc35('0x3c')][_0xfc35('0x3d')]?_0x32d9b1[_0xfc35('0x3c')]:_0x10d39e[_0xfc35('0x36')];if(_0x25e838[_0xfc35('0x38')][_0xfc35('0x47')]){_0x32d9b1['include']=[{'all':!![]}];}_0x32d9b1=_[_0xfc35('0x45')]({},_0x32d9b1,_0x25e838[_0xfc35('0x46')]);return db[_0xfc35('0x33')][_0xfc35('0x4e')](_0x32d9b1)[_0xfc35('0x1b')](handleEntityNotFound(_0xc38758,null))[_0xfc35('0x1b')](respondWithResult(_0xc38758,null))[_0xfc35('0x4a')](handleError(_0xc38758,null));};exports[_0xfc35('0x4f')]=function(_0x322ba9,_0x39a61b){return db[_0xfc35('0x33')][_0xfc35('0x4f')](_0x322ba9[_0xfc35('0x50')],{})[_0xfc35('0x1b')](respondWithResult(_0x39a61b,0xc9))[_0xfc35('0x4a')](handleError(_0x39a61b,null));};exports[_0xfc35('0x2e')]=function(_0x13515b,_0x859e1b){if(_0x13515b[_0xfc35('0x50')]['id']){delete _0x13515b['body']['id'];}return db[_0xfc35('0x33')][_0xfc35('0x4e')]({'where':{'id':_0x13515b[_0xfc35('0x4c')]['id']}})[_0xfc35('0x1b')](handleEntityNotFound(_0x859e1b,null))[_0xfc35('0x1b')](saveUpdates(_0x13515b[_0xfc35('0x50')],null))['then'](respondWithResult(_0x859e1b,null))[_0xfc35('0x4a')](handleError(_0x859e1b,null));};exports['destroy']=function(_0x529d80,_0xfe7c99){return db[_0xfc35('0x33')][_0xfc35('0x4e')]({'where':{'id':_0x529d80[_0xfc35('0x4c')]['id']}})[_0xfc35('0x1b')](handleEntityNotFound(_0xfe7c99,null))[_0xfc35('0x1b')](removeEntity(_0xfe7c99,null))['catch'](handleError(_0xfe7c99,null));};exports[_0xfc35('0x51')]=function(_0xd5057,_0x9540b9,_0x2871f3){var _0x272236={};var _0x1b7f2d={};var _0x99e62d;var _0x435b82;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0xd5057[_0xfc35('0x4c')]['id']}})[_0xfc35('0x1b')](handleEntityNotFound(_0x9540b9,null))[_0xfc35('0x1b')](function(_0x4a0e54){if(_0x4a0e54){_0x99e62d=_0x4a0e54;_0x1b7f2d[_0xfc35('0x36')]=_[_0xfc35('0x37')](db['FreshdeskField']['rawAttributes']);_0x1b7f2d['query']=_[_0xfc35('0x37')](_0xd5057[_0xfc35('0x38')]);_0x1b7f2d[_0xfc35('0x39')]=_[_0xfc35('0x3a')](_0x1b7f2d[_0xfc35('0x36')],_0x1b7f2d[_0xfc35('0x38')]);_0x272236[_0xfc35('0x3c')]=_[_0xfc35('0x3a')](_0x1b7f2d[_0xfc35('0x36')],qs[_0xfc35('0x3b')](_0xd5057[_0xfc35('0x38')][_0xfc35('0x3b')]));_0x272236[_0xfc35('0x3c')]=_0x272236[_0xfc35('0x3c')][_0xfc35('0x3d')]?_0x272236[_0xfc35('0x3c')]:_0x1b7f2d[_0xfc35('0x36')];_0x272236[_0xfc35('0x52')]=qs[_0xfc35('0x41')](_0xd5057[_0xfc35('0x38')]['sort']);_0x272236['where']=qs['filters'](_[_0xfc35('0x42')](_0xd5057[_0xfc35('0x38')],_0x1b7f2d[_0xfc35('0x39')]));if(_0xd5057[_0xfc35('0x38')][_0xfc35('0x43')]){_0x272236[_0xfc35('0x44')]=_[_0xfc35('0x45')](_0x272236[_0xfc35('0x44')],{'$or':_[_0xfc35('0x32')](_0x272236['attributes'],function(_0x472927){var _0x56e69a={};_0x56e69a[_0x472927]={'$like':'%'+_0xd5057[_0xfc35('0x38')][_0xfc35('0x43')]+'%'};return _0x56e69a;})});}_0x272236=_['merge']({},_0x272236,_0xd5057[_0xfc35('0x46')]);return _0x99e62d[_0xfc35('0x51')](_0x272236);}})[_0xfc35('0x1b')](function(_0x590116){if(_0x590116){_0x435b82=_0x590116[_0xfc35('0x3d')];if(!_0xd5057[_0xfc35('0x38')]['hasOwnProperty'](_0xfc35('0x3f'))){_0x272236[_0xfc35('0x29')]=qs['limit'](_0xd5057[_0xfc35('0x38')][_0xfc35('0x29')]);_0x272236[_0xfc35('0x40')]=qs[_0xfc35('0x40')](_0xd5057['query'][_0xfc35('0x40')]);}return _0x99e62d['getFields'](_0x272236);}})[_0xfc35('0x1b')](function(_0x2d6d4b){if(_0x2d6d4b){return _0x2d6d4b?{'count':_0x435b82,'rows':_0x2d6d4b}:null;}})[_0xfc35('0x1b')](respondWithResult(_0x9540b9,null))[_0xfc35('0x4a')](handleError(_0x9540b9,null));};exports[_0xfc35('0x53')]=function(_0x2af34e,_0x3fa81e,_0xb63294){var _0x30fc78={};var _0x227302={};var _0x4d5d17;var _0x290d73;return db['FreshdeskConfiguration'][_0xfc35('0x54')]({'where':{'id':_0x2af34e[_0xfc35('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3fa81e,null))[_0xfc35('0x1b')](function(_0x5b95c5){if(_0x5b95c5){_0x4d5d17=_0x5b95c5;_0x227302[_0xfc35('0x36')]=_[_0xfc35('0x37')](db[_0xfc35('0x55')][_0xfc35('0x4d')]);_0x227302[_0xfc35('0x38')]=_[_0xfc35('0x37')](_0x2af34e[_0xfc35('0x38')]);_0x227302[_0xfc35('0x39')]=_['intersection'](_0x227302['model'],_0x227302[_0xfc35('0x38')]);_0x30fc78[_0xfc35('0x3c')]=_[_0xfc35('0x3a')](_0x227302[_0xfc35('0x36')],qs[_0xfc35('0x3b')](_0x2af34e['query']['fields']));_0x30fc78[_0xfc35('0x3c')]=_0x30fc78[_0xfc35('0x3c')][_0xfc35('0x3d')]?_0x30fc78[_0xfc35('0x3c')]:_0x227302['model'];_0x30fc78['order']=qs[_0xfc35('0x41')](_0x2af34e[_0xfc35('0x38')][_0xfc35('0x41')]);_0x30fc78[_0xfc35('0x44')]=qs[_0xfc35('0x39')](_[_0xfc35('0x42')](_0x2af34e['query'],_0x227302[_0xfc35('0x39')]));if(_0x2af34e[_0xfc35('0x38')][_0xfc35('0x43')]){_0x30fc78[_0xfc35('0x44')]=_[_0xfc35('0x45')](_0x30fc78[_0xfc35('0x44')],{'$or':_['map'](_0x30fc78[_0xfc35('0x3c')],function(_0x4500fa){var _0x20557a={};_0x20557a[_0x4500fa]={'$like':'%'+_0x2af34e[_0xfc35('0x38')][_0xfc35('0x43')]+'%'};return _0x20557a;})});}_0x30fc78=_[_0xfc35('0x45')]({},_0x30fc78,_0x2af34e[_0xfc35('0x46')]);return _0x4d5d17[_0xfc35('0x53')](_0x30fc78);}})[_0xfc35('0x1b')](function(_0x26994c){if(_0x26994c){_0x290d73=_0x26994c[_0xfc35('0x3d')];if(!_0x2af34e['query']['hasOwnProperty']('nolimit')){_0x30fc78[_0xfc35('0x29')]=qs[_0xfc35('0x29')](_0x2af34e['query'][_0xfc35('0x29')]);_0x30fc78[_0xfc35('0x40')]=qs[_0xfc35('0x40')](_0x2af34e[_0xfc35('0x38')][_0xfc35('0x40')]);}return _0x4d5d17[_0xfc35('0x53')](_0x30fc78);}})[_0xfc35('0x1b')](function(_0x24f18c){if(_0x24f18c){return _0x24f18c?{'count':_0x290d73,'rows':_0x24f18c}:null;}})[_0xfc35('0x1b')](respondWithResult(_0x3fa81e,null))[_0xfc35('0x4a')](handleError(_0x3fa81e,null));};exports[_0xfc35('0x56')]=function(_0x53c9b8,_0xa9560e,_0x2ef039){var _0x338f4e={};var _0x4d41e1={};var _0x122426;var _0x4e8651;return db['FreshdeskConfiguration'][_0xfc35('0x54')]({'where':{'id':_0x53c9b8[_0xfc35('0x4c')]['id']}})[_0xfc35('0x1b')](handleEntityNotFound(_0xa9560e,null))[_0xfc35('0x1b')](function(_0x41e011){if(_0x41e011){_0x122426=_0x41e011;_0x4d41e1[_0xfc35('0x36')]=_[_0xfc35('0x37')](db[_0xfc35('0x55')]['rawAttributes']);_0x4d41e1[_0xfc35('0x38')]=_['keys'](_0x53c9b8[_0xfc35('0x38')]);_0x4d41e1['filters']=_[_0xfc35('0x3a')](_0x4d41e1['model'],_0x4d41e1['query']);_0x338f4e[_0xfc35('0x3c')]=_[_0xfc35('0x3a')](_0x4d41e1[_0xfc35('0x36')],qs[_0xfc35('0x3b')](_0x53c9b8['query'][_0xfc35('0x3b')]));_0x338f4e[_0xfc35('0x3c')]=_0x338f4e[_0xfc35('0x3c')][_0xfc35('0x3d')]?_0x338f4e[_0xfc35('0x3c')]:_0x4d41e1['model'];_0x338f4e['order']=qs[_0xfc35('0x41')](_0x53c9b8[_0xfc35('0x38')][_0xfc35('0x41')]);_0x338f4e['where']=qs[_0xfc35('0x39')](_[_0xfc35('0x42')](_0x53c9b8[_0xfc35('0x38')],_0x4d41e1[_0xfc35('0x39')]));if(_0x53c9b8[_0xfc35('0x38')][_0xfc35('0x43')]){_0x338f4e[_0xfc35('0x44')]=_[_0xfc35('0x45')](_0x338f4e[_0xfc35('0x44')],{'$or':_[_0xfc35('0x32')](_0x338f4e['attributes'],function(_0x417813){var _0x160bfa={};_0x160bfa[_0x417813]={'$like':'%'+_0x53c9b8[_0xfc35('0x38')][_0xfc35('0x43')]+'%'};return _0x160bfa;})});}_0x338f4e=_['merge']({},_0x338f4e,_0x53c9b8[_0xfc35('0x46')]);return _0x122426[_0xfc35('0x56')](_0x338f4e);}})['then'](function(_0x17e34a){if(_0x17e34a){_0x4e8651=_0x17e34a[_0xfc35('0x3d')];if(!_0x53c9b8[_0xfc35('0x38')]['hasOwnProperty']('nolimit')){_0x338f4e[_0xfc35('0x29')]=qs[_0xfc35('0x29')](_0x53c9b8['query'][_0xfc35('0x29')]);_0x338f4e[_0xfc35('0x40')]=qs[_0xfc35('0x40')](_0x53c9b8[_0xfc35('0x38')][_0xfc35('0x40')]);}return _0x122426[_0xfc35('0x56')](_0x338f4e);}})[_0xfc35('0x1b')](function(_0x3cf9e7){if(_0x3cf9e7){return _0x3cf9e7?{'count':_0x4e8651,'rows':_0x3cf9e7}:null;}})[_0xfc35('0x1b')](respondWithResult(_0xa9560e,null))[_0xfc35('0x4a')](handleError(_0xa9560e,null));};exports[_0xfc35('0x57')]=function(_0x55c061,_0x276243,_0x1e85ed){var _0x4166cc={};var _0x59495e={};var _0x559750;var _0x1603ce;return db['FreshdeskConfiguration'][_0xfc35('0x54')]({'where':{'id':_0x55c061[_0xfc35('0x4c')]['id']}})[_0xfc35('0x1b')](handleEntityNotFound(_0x276243,null))[_0xfc35('0x1b')](function(_0x2e9e10){if(_0x2e9e10){_0x559750=_0x2e9e10;_0x59495e[_0xfc35('0x36')]=_[_0xfc35('0x37')](db[_0xfc35('0x58')][_0xfc35('0x4d')]);_0x59495e['query']=_[_0xfc35('0x37')](_0x55c061[_0xfc35('0x38')]);_0x59495e[_0xfc35('0x39')]=_[_0xfc35('0x3a')](_0x59495e[_0xfc35('0x36')],_0x59495e[_0xfc35('0x38')]);_0x4166cc[_0xfc35('0x3c')]=_['intersection'](_0x59495e[_0xfc35('0x36')],qs[_0xfc35('0x3b')](_0x55c061['query'][_0xfc35('0x3b')]));_0x4166cc[_0xfc35('0x3c')]=_0x4166cc[_0xfc35('0x3c')][_0xfc35('0x3d')]?_0x4166cc[_0xfc35('0x3c')]:_0x59495e[_0xfc35('0x36')];_0x4166cc[_0xfc35('0x52')]=qs[_0xfc35('0x41')](_0x55c061[_0xfc35('0x38')][_0xfc35('0x41')]);_0x4166cc[_0xfc35('0x44')]=qs[_0xfc35('0x39')](_[_0xfc35('0x42')](_0x55c061[_0xfc35('0x38')],_0x59495e[_0xfc35('0x39')]));if(_0x55c061['query'][_0xfc35('0x43')]){_0x4166cc[_0xfc35('0x44')]=_[_0xfc35('0x45')](_0x4166cc['where'],{'$or':_['map'](_0x4166cc['attributes'],function(_0x345c91){var _0x3910fc={};_0x3910fc[_0x345c91]={'$like':'%'+_0x55c061[_0xfc35('0x38')][_0xfc35('0x43')]+'%'};return _0x3910fc;})});}_0x4166cc=_[_0xfc35('0x45')]({},_0x4166cc,_0x55c061[_0xfc35('0x46')]);return _0x559750['getTags'](_0x4166cc);}})['then'](function(_0x2da196){if(_0x2da196){_0x1603ce=_0x2da196['length'];if(!_0x55c061[_0xfc35('0x38')][_0xfc35('0x3e')](_0xfc35('0x3f'))){_0x4166cc[_0xfc35('0x29')]=qs[_0xfc35('0x29')](_0x55c061[_0xfc35('0x38')][_0xfc35('0x29')]);_0x4166cc[_0xfc35('0x40')]=qs[_0xfc35('0x40')](_0x55c061['query']['offset']);}return _0x559750[_0xfc35('0x57')](_0x4166cc);}})['then'](function(_0x19d036){if(_0x19d036){return _0x19d036?{'count':_0x1603ce,'rows':_0x19d036}:null;}})['then'](respondWithResult(_0x276243,null))[_0xfc35('0x4a')](handleError(_0x276243,null));};exports[_0xfc35('0x59')]=function(_0x4ac30e,_0x172fc6,_0x42867c){if(_0x4ac30e['body']['id']){delete _0x4ac30e['body']['id'];}return db[_0xfc35('0x33')][_0xfc35('0x54')]({'where':{'id':_0x4ac30e[_0xfc35('0x4c')]['id']}})[_0xfc35('0x1b')](handleEntityNotFound(_0x172fc6,null))['then'](function(_0x2b1ace){if(_0x2b1ace){return _0x2b1ace[_0xfc35('0x59')](_0x4ac30e[_0xfc35('0x50')][_0xfc35('0x5a')]||[]);}return null;})['then'](respondWithResult(_0x172fc6,null))['catch'](handleError(_0x172fc6,null));}; \ No newline at end of file +var _0x691a=['code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','then','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','filters','intersection','model','attributes','fields','query','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','show','params','keys','include','find','create','body','destroy','findOne','order','pick','getFields','length','getSubjects','FreshdeskField','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','stringify','error'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x691a,0xfb));var _0xa691=function(_0x22bf43,_0x54eb72){_0x22bf43=_0x22bf43-0x0;var _0x394796=_0x691a[_0x22bf43];return _0x394796;};'use strict';var pdf=require(_0xa691('0x0'));var emlformat=require(_0xa691('0x1'));var rimraf=require(_0xa691('0x2'));var zipdir=require(_0xa691('0x3'));var jsonpatch=require(_0xa691('0x4'));var rp=require('request-promise');var moment=require(_0xa691('0x5'));var BPromise=require(_0xa691('0x6'));var Mustache=require('mustache');var util=require(_0xa691('0x7'));var path=require('path');var sox=require(_0xa691('0x8'));var csv=require(_0xa691('0x9'));var ejs=require(_0xa691('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa691('0xb'));var crypto=require(_0xa691('0xc'));var jsforce=require(_0xa691('0xd'));var deskjs=require(_0xa691('0xe'));var toCsv=require(_0xa691('0x9'));var querystring=require(_0xa691('0xf'));var Papa=require(_0xa691('0x10'));var Redis=require(_0xa691('0x11'));var authService=require(_0xa691('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa691('0x13'));var logger=require(_0xa691('0x14'))(_0xa691('0x15'));var utils=require(_0xa691('0x16'));var config=require('../../config/environment');var db=require(_0xa691('0x17'))['db'];var jayson=require(_0xa691('0x18'));var client=jayson[_0xa691('0x19')][_0xa691('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x34b760,_0x218f6d,_0x3d2fde){if(_0x3d2fde){var _0x32faca=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32faca[_0xa691('0x1b')](_0x218f6d)){return _0x34b760;}else{throw new db[(_0xa691('0x1c'))][(_0xa691('0x1d'))](_0xa691('0x1e'));}}else{return _0x34b760;}}function respondWithRpcPromise(_0x3ef5c9,_0x389ccc,_0x2bf2a4,_0x205fe3){return new BPromise(function(_0xb40978,_0x77caa6){var _0x1f0549=_0x205fe3||client;return _0x1f0549[_0xa691('0x1f')](_0x3ef5c9,_0x2bf2a4)['then'](function(_0x4bcf27){logger[_0xa691('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x389ccc,_0xa691('0x21'));logger[_0xa691('0x22')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x389ccc,_0xa691('0x21'),JSON[_0xa691('0x23')](_0x4bcf27));if(_0x4bcf27[_0xa691('0x24')]){if(_0x4bcf27[_0xa691('0x24')][_0xa691('0x25')]===0x1f4){logger[_0xa691('0x24')](_0xa691('0x26'),_0x389ccc,_0x4bcf27[_0xa691('0x24')][_0xa691('0x27')]);return _0x77caa6(_0x4bcf27['error'][_0xa691('0x27')]);}logger[_0xa691('0x24')](_0xa691('0x26'),_0x389ccc,_0x4bcf27['error']['message']);return _0xb40978(_0x4bcf27[_0xa691('0x24')][_0xa691('0x27')]);}else{logger[_0xa691('0x20')](_0xa691('0x26'),_0x389ccc,_0xa691('0x21'));_0xb40978(_0x4bcf27['result'][_0xa691('0x27')]);}})[_0xa691('0x28')](function(_0x54d587){logger[_0xa691('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x389ccc,_0x54d587);_0x77caa6(_0x54d587);});});}function respondWithStatusCode(_0x29a394,_0x392b3f){_0x392b3f=_0x392b3f||0xcc;return function(_0x4f7473){if(_0x4f7473){return _0x29a394[_0xa691('0x29')](_0x392b3f);}return _0x29a394[_0xa691('0x2a')](_0x392b3f)[_0xa691('0x2b')]();};}function respondWithResult(_0x241753,_0x35e761){_0x35e761=_0x35e761||0xc8;return function(_0x1f4828){if(_0x1f4828){return _0x241753[_0xa691('0x2a')](_0x35e761)[_0xa691('0x2c')](_0x1f4828);}};}function respondWithFilteredResult(_0x2ffa42,_0x2f778b){return function(_0xd1bf1a){if(_0xd1bf1a){var _0x97a8d8=_0xd1bf1a[_0xa691('0x2d')],_0xced4e9=_0x2f778b[_0xa691('0x2e')],_0x90e9ea=_0x2f778b[_0xa691('0x2e')]+_0x2f778b['limit'],_0x4640b2;if(_0x90e9ea>=_0x97a8d8){_0x90e9ea=_0x97a8d8;_0x4640b2=0xc8;}else{_0x4640b2=0xce;}_0x2ffa42[_0xa691('0x2a')](_0x4640b2);return _0x2ffa42['set'](_0xa691('0x2f'),_0xced4e9+'-'+_0x90e9ea+'/'+_0x97a8d8)[_0xa691('0x2c')](_0xd1bf1a);}return null;};}function patchUpdates(_0x1afbc9){return function(_0x15f6a7){try{jsonpatch[_0xa691('0x30')](_0x15f6a7,_0x1afbc9,!![]);}catch(_0x288c69){return BPromise[_0xa691('0x31')](_0x288c69);}return _0x15f6a7[_0xa691('0x32')]();};}function saveUpdates(_0xaa4a07,_0x9aa10b){return function(_0x32d315){if(_0x32d315){return _0x32d315['update'](_0xaa4a07)['then'](function(_0x31376b){return _0x31376b;});}return null;};}function removeEntity(_0xa8ece7,_0x5672cd){return function(_0x84ab32){if(_0x84ab32){return _0x84ab32['destroy']()[_0xa691('0x33')](function(){_0xa8ece7[_0xa691('0x2a')](0xcc)[_0xa691('0x2b')]();});}};}function handleEntityNotFound(_0x148143,_0x232130){return function(_0x52a667){if(!_0x52a667){_0x148143[_0xa691('0x29')](0x194);}return _0x52a667;};}function handleError(_0x23405b,_0x25d858){_0x25d858=_0x25d858||0x1f4;return function(_0x11f18d){logger[_0xa691('0x24')](_0x11f18d[_0xa691('0x34')]);if(_0x11f18d[_0xa691('0x35')]){delete _0x11f18d[_0xa691('0x35')];}_0x23405b['status'](_0x25d858)[_0xa691('0x36')](_0x11f18d);};}exports[_0xa691('0x37')]=function(_0xc117e9,_0x49f671){var _0x5c4028={},_0x5086fa={},_0x29cfa9={'count':0x0,'rows':[]};var _0x11c516=_[_0xa691('0x38')](db[_0xa691('0x39')][_0xa691('0x3a')],function(_0x8ccfb1){return{'name':_0x8ccfb1['fieldName'],'type':_0x8ccfb1[_0xa691('0x3b')][_0xa691('0x3c')]};});_0x5086fa['model']=_[_0xa691('0x38')](_0x11c516,'name');_0x5086fa['query']=_['keys'](_0xc117e9['query']);_0x5086fa[_0xa691('0x3d')]=_[_0xa691('0x3e')](_0x5086fa[_0xa691('0x3f')],_0x5086fa['query']);_0x5c4028[_0xa691('0x40')]=_[_0xa691('0x3e')](_0x5086fa['model'],qs['fields'](_0xc117e9['query'][_0xa691('0x41')]));_0x5c4028['attributes']=_0x5c4028['attributes']['length']?_0x5c4028[_0xa691('0x40')]:_0x5086fa[_0xa691('0x3f')];if(!_0xc117e9[_0xa691('0x42')][_0xa691('0x43')](_0xa691('0x44'))){_0x5c4028[_0xa691('0x45')]=qs[_0xa691('0x45')](_0xc117e9['query'][_0xa691('0x45')]);_0x5c4028[_0xa691('0x2e')]=qs[_0xa691('0x2e')](_0xc117e9['query'][_0xa691('0x2e')]);}_0x5c4028['order']=qs['sort'](_0xc117e9[_0xa691('0x42')][_0xa691('0x46')]);_0x5c4028[_0xa691('0x47')]=qs[_0xa691('0x3d')](_['pick'](_0xc117e9[_0xa691('0x42')],_0x5086fa['filters']));if(_0xc117e9['query'][_0xa691('0x48')]){_0x5c4028[_0xa691('0x47')]=_[_0xa691('0x49')](_0x5c4028[_0xa691('0x47')],{'$or':_[_0xa691('0x38')](_0x11c516,function(_0xe5ff07){if(_0xe5ff07[_0xa691('0x3b')]!==_0xa691('0x4a')){var _0x153620={};_0x153620[_0xe5ff07[_0xa691('0x35')]]={'$like':'%'+_0xc117e9[_0xa691('0x42')][_0xa691('0x48')]+'%'};return _0x153620;}})});}_0x5c4028=_[_0xa691('0x49')]({},_0x5c4028,_0xc117e9[_0xa691('0x4b')]);var _0x4a1940={'where':_0x5c4028[_0xa691('0x47')]};return db[_0xa691('0x39')][_0xa691('0x2d')](_0x4a1940)[_0xa691('0x33')](function(_0x274759){_0x29cfa9[_0xa691('0x2d')]=_0x274759;if(_0xc117e9[_0xa691('0x42')][_0xa691('0x4c')]){_0x5c4028['include']=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x5c4028);})['then'](function(_0x32e1cf){_0x29cfa9['rows']=_0x32e1cf;return _0x29cfa9;})[_0xa691('0x33')](respondWithFilteredResult(_0x49f671,_0x5c4028))['catch'](handleError(_0x49f671,null));};exports[_0xa691('0x4d')]=function(_0x1cadc6,_0x1c2fd8){var _0x4f00b9={'raw':![],'where':{'id':_0x1cadc6[_0xa691('0x4e')]['id']}},_0x29cbfd={};_0x29cbfd[_0xa691('0x3f')]=_[_0xa691('0x4f')](db[_0xa691('0x39')][_0xa691('0x3a')]);_0x29cbfd[_0xa691('0x42')]=_[_0xa691('0x4f')](_0x1cadc6['query']);_0x29cbfd[_0xa691('0x3d')]=_['intersection'](_0x29cbfd['model'],_0x29cbfd['query']);_0x4f00b9[_0xa691('0x40')]=_['intersection'](_0x29cbfd['model'],qs[_0xa691('0x41')](_0x1cadc6[_0xa691('0x42')][_0xa691('0x41')]));_0x4f00b9['attributes']=_0x4f00b9[_0xa691('0x40')]['length']?_0x4f00b9[_0xa691('0x40')]:_0x29cbfd[_0xa691('0x3f')];if(_0x1cadc6[_0xa691('0x42')][_0xa691('0x4c')]){_0x4f00b9[_0xa691('0x50')]=[{'all':!![]}];}_0x4f00b9=_[_0xa691('0x49')]({},_0x4f00b9,_0x1cadc6['options']);return db['FreshdeskConfiguration'][_0xa691('0x51')](_0x4f00b9)[_0xa691('0x33')](handleEntityNotFound(_0x1c2fd8,null))[_0xa691('0x33')](respondWithResult(_0x1c2fd8,null))[_0xa691('0x28')](handleError(_0x1c2fd8,null));};exports['create']=function(_0x22af94,_0x3b686d){return db[_0xa691('0x39')][_0xa691('0x52')](_0x22af94[_0xa691('0x53')],{})[_0xa691('0x33')](respondWithResult(_0x3b686d,0xc9))[_0xa691('0x28')](handleError(_0x3b686d,null));};exports['update']=function(_0xaefe3a,_0x43d9fc){if(_0xaefe3a[_0xa691('0x53')]['id']){delete _0xaefe3a[_0xa691('0x53')]['id'];}return db[_0xa691('0x39')]['find']({'where':{'id':_0xaefe3a[_0xa691('0x4e')]['id']}})[_0xa691('0x33')](handleEntityNotFound(_0x43d9fc,null))[_0xa691('0x33')](saveUpdates(_0xaefe3a[_0xa691('0x53')],null))[_0xa691('0x33')](respondWithResult(_0x43d9fc,null))['catch'](handleError(_0x43d9fc,null));};exports[_0xa691('0x54')]=function(_0xa7c878,_0x3b303d){return db[_0xa691('0x39')][_0xa691('0x51')]({'where':{'id':_0xa7c878[_0xa691('0x4e')]['id']}})[_0xa691('0x33')](handleEntityNotFound(_0x3b303d,null))[_0xa691('0x33')](removeEntity(_0x3b303d,null))[_0xa691('0x28')](handleError(_0x3b303d,null));};exports['getFields']=function(_0x3d4866,_0x1b51f7,_0x893641){var _0x5b4db1={};var _0x36ad6e={};var _0x3e7b83;var _0x1d19cb;return db[_0xa691('0x39')][_0xa691('0x55')]({'where':{'id':_0x3d4866['params']['id']}})[_0xa691('0x33')](handleEntityNotFound(_0x1b51f7,null))[_0xa691('0x33')](function(_0x4bc7c5){if(_0x4bc7c5){_0x3e7b83=_0x4bc7c5;_0x36ad6e['model']=_['keys'](db['FreshdeskField']['rawAttributes']);_0x36ad6e['query']=_[_0xa691('0x4f')](_0x3d4866[_0xa691('0x42')]);_0x36ad6e[_0xa691('0x3d')]=_[_0xa691('0x3e')](_0x36ad6e['model'],_0x36ad6e[_0xa691('0x42')]);_0x5b4db1[_0xa691('0x40')]=_[_0xa691('0x3e')](_0x36ad6e[_0xa691('0x3f')],qs[_0xa691('0x41')](_0x3d4866['query'][_0xa691('0x41')]));_0x5b4db1['attributes']=_0x5b4db1['attributes']['length']?_0x5b4db1[_0xa691('0x40')]:_0x36ad6e[_0xa691('0x3f')];_0x5b4db1[_0xa691('0x56')]=qs[_0xa691('0x46')](_0x3d4866[_0xa691('0x42')]['sort']);_0x5b4db1[_0xa691('0x47')]=qs[_0xa691('0x3d')](_[_0xa691('0x57')](_0x3d4866['query'],_0x36ad6e[_0xa691('0x3d')]));if(_0x3d4866[_0xa691('0x42')][_0xa691('0x48')]){_0x5b4db1[_0xa691('0x47')]=_[_0xa691('0x49')](_0x5b4db1[_0xa691('0x47')],{'$or':_[_0xa691('0x38')](_0x5b4db1[_0xa691('0x40')],function(_0x5af923){var _0x3851f9={};_0x3851f9[_0x5af923]={'$like':'%'+_0x3d4866[_0xa691('0x42')]['filter']+'%'};return _0x3851f9;})});}_0x5b4db1=_[_0xa691('0x49')]({},_0x5b4db1,_0x3d4866[_0xa691('0x4b')]);return _0x3e7b83[_0xa691('0x58')](_0x5b4db1);}})['then'](function(_0x4fca97){if(_0x4fca97){_0x1d19cb=_0x4fca97[_0xa691('0x59')];if(!_0x3d4866[_0xa691('0x42')][_0xa691('0x43')]('nolimit')){_0x5b4db1[_0xa691('0x45')]=qs['limit'](_0x3d4866[_0xa691('0x42')][_0xa691('0x45')]);_0x5b4db1[_0xa691('0x2e')]=qs[_0xa691('0x2e')](_0x3d4866[_0xa691('0x42')][_0xa691('0x2e')]);}return _0x3e7b83[_0xa691('0x58')](_0x5b4db1);}})[_0xa691('0x33')](function(_0x41d15b){if(_0x41d15b){return _0x41d15b?{'count':_0x1d19cb,'rows':_0x41d15b}:null;}})['then'](respondWithResult(_0x1b51f7,null))[_0xa691('0x28')](handleError(_0x1b51f7,null));};exports[_0xa691('0x5a')]=function(_0x2c7b56,_0x5d2006,_0x1adfca){var _0xf8b6a9={};var _0x37e729={};var _0x13ffaa;var _0x332651;return db[_0xa691('0x39')][_0xa691('0x55')]({'where':{'id':_0x2c7b56[_0xa691('0x4e')]['id']}})[_0xa691('0x33')](handleEntityNotFound(_0x5d2006,null))['then'](function(_0x2d10a3){if(_0x2d10a3){_0x13ffaa=_0x2d10a3;_0x37e729[_0xa691('0x3f')]=_[_0xa691('0x4f')](db[_0xa691('0x5b')][_0xa691('0x3a')]);_0x37e729[_0xa691('0x42')]=_[_0xa691('0x4f')](_0x2c7b56[_0xa691('0x42')]);_0x37e729['filters']=_[_0xa691('0x3e')](_0x37e729[_0xa691('0x3f')],_0x37e729[_0xa691('0x42')]);_0xf8b6a9[_0xa691('0x40')]=_['intersection'](_0x37e729[_0xa691('0x3f')],qs[_0xa691('0x41')](_0x2c7b56[_0xa691('0x42')][_0xa691('0x41')]));_0xf8b6a9[_0xa691('0x40')]=_0xf8b6a9['attributes'][_0xa691('0x59')]?_0xf8b6a9[_0xa691('0x40')]:_0x37e729[_0xa691('0x3f')];_0xf8b6a9[_0xa691('0x56')]=qs[_0xa691('0x46')](_0x2c7b56[_0xa691('0x42')][_0xa691('0x46')]);_0xf8b6a9[_0xa691('0x47')]=qs[_0xa691('0x3d')](_[_0xa691('0x57')](_0x2c7b56['query'],_0x37e729[_0xa691('0x3d')]));if(_0x2c7b56['query'][_0xa691('0x48')]){_0xf8b6a9[_0xa691('0x47')]=_[_0xa691('0x49')](_0xf8b6a9['where'],{'$or':_[_0xa691('0x38')](_0xf8b6a9[_0xa691('0x40')],function(_0xfc154d){var _0xda5ae7={};_0xda5ae7[_0xfc154d]={'$like':'%'+_0x2c7b56[_0xa691('0x42')][_0xa691('0x48')]+'%'};return _0xda5ae7;})});}_0xf8b6a9=_['merge']({},_0xf8b6a9,_0x2c7b56['options']);return _0x13ffaa[_0xa691('0x5a')](_0xf8b6a9);}})[_0xa691('0x33')](function(_0x50fe67){if(_0x50fe67){_0x332651=_0x50fe67[_0xa691('0x59')];if(!_0x2c7b56[_0xa691('0x42')][_0xa691('0x43')](_0xa691('0x44'))){_0xf8b6a9[_0xa691('0x45')]=qs[_0xa691('0x45')](_0x2c7b56[_0xa691('0x42')][_0xa691('0x45')]);_0xf8b6a9[_0xa691('0x2e')]=qs['offset'](_0x2c7b56[_0xa691('0x42')]['offset']);}return _0x13ffaa[_0xa691('0x5a')](_0xf8b6a9);}})[_0xa691('0x33')](function(_0x1eecd0){if(_0x1eecd0){return _0x1eecd0?{'count':_0x332651,'rows':_0x1eecd0}:null;}})[_0xa691('0x33')](respondWithResult(_0x5d2006,null))[_0xa691('0x28')](handleError(_0x5d2006,null));};exports[_0xa691('0x5c')]=function(_0x1788fa,_0x16053b,_0x401ef9){var _0x5a410f={};var _0x5bccb6={};var _0xcdb708;var _0x5263ca;return db['FreshdeskConfiguration'][_0xa691('0x55')]({'where':{'id':_0x1788fa['params']['id']}})['then'](handleEntityNotFound(_0x16053b,null))[_0xa691('0x33')](function(_0x299c17){if(_0x299c17){_0xcdb708=_0x299c17;_0x5bccb6[_0xa691('0x3f')]=_['keys'](db[_0xa691('0x5b')]['rawAttributes']);_0x5bccb6[_0xa691('0x42')]=_['keys'](_0x1788fa[_0xa691('0x42')]);_0x5bccb6[_0xa691('0x3d')]=_[_0xa691('0x3e')](_0x5bccb6[_0xa691('0x3f')],_0x5bccb6[_0xa691('0x42')]);_0x5a410f['attributes']=_[_0xa691('0x3e')](_0x5bccb6[_0xa691('0x3f')],qs[_0xa691('0x41')](_0x1788fa[_0xa691('0x42')]['fields']));_0x5a410f[_0xa691('0x40')]=_0x5a410f[_0xa691('0x40')][_0xa691('0x59')]?_0x5a410f[_0xa691('0x40')]:_0x5bccb6['model'];_0x5a410f[_0xa691('0x56')]=qs['sort'](_0x1788fa[_0xa691('0x42')][_0xa691('0x46')]);_0x5a410f[_0xa691('0x47')]=qs['filters'](_[_0xa691('0x57')](_0x1788fa[_0xa691('0x42')],_0x5bccb6[_0xa691('0x3d')]));if(_0x1788fa[_0xa691('0x42')]['filter']){_0x5a410f[_0xa691('0x47')]=_['merge'](_0x5a410f[_0xa691('0x47')],{'$or':_['map'](_0x5a410f[_0xa691('0x40')],function(_0x12e8c8){var _0x5a90ac={};_0x5a90ac[_0x12e8c8]={'$like':'%'+_0x1788fa[_0xa691('0x42')][_0xa691('0x48')]+'%'};return _0x5a90ac;})});}_0x5a410f=_[_0xa691('0x49')]({},_0x5a410f,_0x1788fa['options']);return _0xcdb708[_0xa691('0x5c')](_0x5a410f);}})['then'](function(_0x43a276){if(_0x43a276){_0x5263ca=_0x43a276[_0xa691('0x59')];if(!_0x1788fa[_0xa691('0x42')][_0xa691('0x43')](_0xa691('0x44'))){_0x5a410f[_0xa691('0x45')]=qs[_0xa691('0x45')](_0x1788fa[_0xa691('0x42')][_0xa691('0x45')]);_0x5a410f[_0xa691('0x2e')]=qs['offset'](_0x1788fa[_0xa691('0x42')][_0xa691('0x2e')]);}return _0xcdb708[_0xa691('0x5c')](_0x5a410f);}})[_0xa691('0x33')](function(_0x4fc4eb){if(_0x4fc4eb){return _0x4fc4eb?{'count':_0x5263ca,'rows':_0x4fc4eb}:null;}})[_0xa691('0x33')](respondWithResult(_0x16053b,null))[_0xa691('0x28')](handleError(_0x16053b,null));};exports['getTags']=function(_0x49056e,_0x105a65,_0x4fedb1){var _0x113561={};var _0x416e80={};var _0x11528d;var _0x211894;return db[_0xa691('0x39')][_0xa691('0x55')]({'where':{'id':_0x49056e['params']['id']}})[_0xa691('0x33')](handleEntityNotFound(_0x105a65,null))[_0xa691('0x33')](function(_0xf71c57){if(_0xf71c57){_0x11528d=_0xf71c57;_0x416e80['model']=_[_0xa691('0x4f')](db['Tag'][_0xa691('0x3a')]);_0x416e80[_0xa691('0x42')]=_['keys'](_0x49056e[_0xa691('0x42')]);_0x416e80[_0xa691('0x3d')]=_[_0xa691('0x3e')](_0x416e80[_0xa691('0x3f')],_0x416e80[_0xa691('0x42')]);_0x113561[_0xa691('0x40')]=_[_0xa691('0x3e')](_0x416e80[_0xa691('0x3f')],qs[_0xa691('0x41')](_0x49056e['query'][_0xa691('0x41')]));_0x113561['attributes']=_0x113561[_0xa691('0x40')]['length']?_0x113561[_0xa691('0x40')]:_0x416e80['model'];_0x113561[_0xa691('0x56')]=qs['sort'](_0x49056e[_0xa691('0x42')][_0xa691('0x46')]);_0x113561[_0xa691('0x47')]=qs[_0xa691('0x3d')](_[_0xa691('0x57')](_0x49056e['query'],_0x416e80[_0xa691('0x3d')]));if(_0x49056e['query'][_0xa691('0x48')]){_0x113561['where']=_[_0xa691('0x49')](_0x113561[_0xa691('0x47')],{'$or':_['map'](_0x113561['attributes'],function(_0x2b91f8){var _0x5c1f06={};_0x5c1f06[_0x2b91f8]={'$like':'%'+_0x49056e[_0xa691('0x42')][_0xa691('0x48')]+'%'};return _0x5c1f06;})});}_0x113561=_[_0xa691('0x49')]({},_0x113561,_0x49056e[_0xa691('0x4b')]);return _0x11528d[_0xa691('0x5d')](_0x113561);}})[_0xa691('0x33')](function(_0x59cea4){if(_0x59cea4){_0x211894=_0x59cea4[_0xa691('0x59')];if(!_0x49056e[_0xa691('0x42')][_0xa691('0x43')](_0xa691('0x44'))){_0x113561[_0xa691('0x45')]=qs[_0xa691('0x45')](_0x49056e['query'][_0xa691('0x45')]);_0x113561[_0xa691('0x2e')]=qs[_0xa691('0x2e')](_0x49056e[_0xa691('0x42')][_0xa691('0x2e')]);}return _0x11528d[_0xa691('0x5d')](_0x113561);}})[_0xa691('0x33')](function(_0xf96bba){if(_0xf96bba){return _0xf96bba?{'count':_0x211894,'rows':_0xf96bba}:null;}})[_0xa691('0x33')](respondWithResult(_0x105a65,null))[_0xa691('0x28')](handleError(_0x105a65,null));};exports[_0xa691('0x5e')]=function(_0x4bc5d9,_0x583829,_0x5136b2){if(_0x4bc5d9[_0xa691('0x53')]['id']){delete _0x4bc5d9[_0xa691('0x53')]['id'];}return db['FreshdeskConfiguration'][_0xa691('0x55')]({'where':{'id':_0x4bc5d9[_0xa691('0x4e')]['id']}})[_0xa691('0x33')](handleEntityNotFound(_0x583829,null))[_0xa691('0x33')](function(_0x3ccb84){if(_0x3ccb84){return _0x3ccb84[_0xa691('0x5e')](_0x4bc5d9[_0xa691('0x53')][_0xa691('0x5f')]||[]);}return null;})[_0xa691('0x33')](respondWithResult(_0x583829,null))['catch'](handleError(_0x583829,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index c107302..a498dab 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 _0xfd66=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util'];(function(_0x223b5b,_0x284ed1){var _0x66888c=function(_0x2a5f4b){while(--_0x2a5f4b){_0x223b5b['push'](_0x223b5b['shift']());}};_0x66888c(++_0x284ed1);}(_0xfd66,0x1af));var _0x6fd6=function(_0x4b17bd,_0x180635){_0x4b17bd=_0x4b17bd-0x0;var _0x575fb2=_0xfd66[_0x4b17bd];return _0x575fb2;};'use strict';var _=require('lodash');var util=require(_0x6fd6('0x0'));var logger=require(_0x6fd6('0x1'))(_0x6fd6('0x2'));var moment=require('moment');var BPromise=require(_0x6fd6('0x3'));var rp=require(_0x6fd6('0x4'));var fs=require('fs');var path=require(_0x6fd6('0x5'));var rimraf=require(_0x6fd6('0x6'));var config=require(_0x6fd6('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x6fd6('0x8')]=function(_0x57e928,_0x1eda86){return _0x57e928[_0x6fd6('0x9')](_0x6fd6('0xa'),attributes,{'tableName':_0x6fd6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55fd=['FreshdeskConfiguration','int_freshdesk_configurations','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1aba84,_0x1e663a){var _0x4ca2cb=function(_0x5c3132){while(--_0x5c3132){_0x1aba84['push'](_0x1aba84['shift']());}};_0x4ca2cb(++_0x1e663a);}(_0x55fd,0x120));var _0xd55f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x55fd[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd55f('0x0'));var moment=require(_0xd55f('0x1'));var BPromise=require(_0xd55f('0x2'));var rp=require(_0xd55f('0x3'));var fs=require('fs');var path=require(_0xd55f('0x4'));var rimraf=require(_0xd55f('0x5'));var config=require(_0xd55f('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xd55f('0x7')]=function(_0x197119,_0x2fe0de){return _0x197119[_0xd55f('0x8')](_0xd55f('0x9'),attributes,{'tableName':_0xd55f('0xa'),'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 41aa1ae..3ac29e1 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 _0xf75d=['code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2b61d7,_0x25799d){var _0x103201=function(_0x18c79f){while(--_0x18c79f){_0x2b61d7['push'](_0x2b61d7['shift']());}};_0x103201(++_0x25799d);}(_0xf75d,0x101));var _0xdf75=function(_0x1cd633,_0x21c3db){_0x1cd633=_0x1cd633-0x0;var _0x5bf6d8=_0xf75d[_0x1cd633];return _0x5bf6d8;};'use strict';var _=require(_0xdf75('0x0'));var util=require(_0xdf75('0x1'));var moment=require('moment');var BPromise=require(_0xdf75('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf75('0x3'));var db=require(_0xdf75('0x4'))['db'];var utils=require(_0xdf75('0x5'));var logger=require(_0xdf75('0x6'))('rpc');var config=require(_0xdf75('0x7'));var jayson=require(_0xdf75('0x8'));var client=jayson[_0xdf75('0x9')][_0xdf75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19f520,_0x3c62cc,_0x71fba3){return new BPromise(function(_0x459626,_0x2f02ef){return client[_0xdf75('0xb')](_0x19f520,_0x71fba3)['then'](function(_0x6bbf89){logger[_0xdf75('0xc')](_0xdf75('0xd'),_0x3c62cc,_0xdf75('0xe'));logger[_0xdf75('0xf')](_0xdf75('0x10'),_0x3c62cc,_0xdf75('0xe'),JSON[_0xdf75('0x11')](_0x6bbf89));if(_0x6bbf89[_0xdf75('0x12')]){if(_0x6bbf89['error'][_0xdf75('0x13')]===0x1f4){logger[_0xdf75('0x12')](_0xdf75('0xd'),_0x3c62cc,_0x6bbf89[_0xdf75('0x12')][_0xdf75('0x14')]);return _0x2f02ef(_0x6bbf89[_0xdf75('0x12')][_0xdf75('0x14')]);}logger[_0xdf75('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3c62cc,_0x6bbf89[_0xdf75('0x12')][_0xdf75('0x14')]);return _0x459626(_0x6bbf89[_0xdf75('0x12')][_0xdf75('0x14')]);}else{logger[_0xdf75('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3c62cc,_0xdf75('0xe'));_0x459626(_0x6bbf89[_0xdf75('0x15')]['message']);}})[_0xdf75('0x16')](function(_0x3f497f){logger[_0xdf75('0x12')](_0xdf75('0xd'),_0x3c62cc,_0x3f497f);_0x2f02ef(_0x3f497f);});});} \ No newline at end of file +var _0x3596=['message','info','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x53c7f4,_0x272dd5){var _0x12f418=function(_0x29a01f){while(--_0x29a01f){_0x53c7f4['push'](_0x53c7f4['shift']());}};_0x12f418(++_0x272dd5);}(_0x3596,0xb6));var _0x6359=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x3596[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x6359('0x0'));var util=require('util');var moment=require(_0x6359('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6359('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6359('0x3'))(_0x6359('0x4'));var config=require(_0x6359('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6359('0x6')][_0x6359('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2254e2,_0x3d0993,_0x327bd5){return new BPromise(function(_0x21ca4b,_0x26e128){return client[_0x6359('0x8')](_0x2254e2,_0x327bd5)['then'](function(_0x5f492a){logger['info'](_0x6359('0x9'),_0x3d0993,'request\x20sent');logger[_0x6359('0xa')](_0x6359('0xb'),_0x3d0993,_0x6359('0xc'),JSON[_0x6359('0xd')](_0x5f492a));if(_0x5f492a[_0x6359('0xe')]){if(_0x5f492a[_0x6359('0xe')][_0x6359('0xf')]===0x1f4){logger['error'](_0x6359('0x9'),_0x3d0993,_0x5f492a[_0x6359('0xe')][_0x6359('0x10')]);return _0x26e128(_0x5f492a[_0x6359('0xe')]['message']);}logger[_0x6359('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d0993,_0x5f492a[_0x6359('0xe')][_0x6359('0x10')]);return _0x21ca4b(_0x5f492a[_0x6359('0xe')][_0x6359('0x10')]);}else{logger[_0x6359('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d0993,_0x6359('0xc'));_0x21ca4b(_0x5f492a['result'][_0x6359('0x10')]);}})['catch'](function(_0xad8391){logger[_0x6359('0xe')](_0x6359('0x9'),_0x3d0993,_0xad8391);_0x26e128(_0xad8391);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 0e47781..e369513 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 _0x70e0=['create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated'];(function(_0x2d9f8f,_0x40bc79){var _0x240df4=function(_0x397d13){while(--_0x397d13){_0x2d9f8f['push'](_0x2d9f8f['shift']());}};_0x240df4(++_0x40bc79);}(_0x70e0,0x17b));var _0x070e=function(_0x455d5e,_0x5ec532){_0x455d5e=_0x455d5e-0x0;var _0x354f47=_0x70e0[_0x455d5e];return _0x354f47;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./intFreshdeskField.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0xa')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')](_0x070e('0xe'),auth[_0x070e('0xb')](),controller['update']);router['delete'](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);module[_0x070e('0x10')]=router; \ No newline at end of file +var _0xcb91=['post','create','update','delete','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x11f249,_0x4ca4a8){var _0x5c3656=function(_0x27c9f8){while(--_0x27c9f8){_0x11f249['push'](_0x11f249['shift']());}};_0x5c3656(++_0x4ca4a8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0xcb91[_0x469a3c];return _0x968f4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./intFreshdeskField.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0xa')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0xb')]);router['put']('/:id',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xc')]);router[_0x1cb9('0xd')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller['destroy']);module[_0x1cb9('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 38c77d3..6e67f87 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 _0xb701=['ENUM','variable','customVariable','BOOLEAN','exports','string','keyValue','STRING'];(function(_0x48cb3e,_0x49aeea){var _0x56f010=function(_0x4ceb94){while(--_0x4ceb94){_0x48cb3e['push'](_0x48cb3e['shift']());}};_0x56f010(++_0x49aeea);}(_0xb701,0x144));var _0x1b70=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb701[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module[_0x1b70('0x0')]={'type':{'type':Sequelize['ENUM'](_0x1b70('0x1'),'variable','customVariable',_0x1b70('0x2')),'defaultValue':_0x1b70('0x1')},'content':{'type':Sequelize[_0x1b70('0x3')]},'key':{'type':Sequelize[_0x1b70('0x3')]},'keyType':{'type':Sequelize[_0x1b70('0x4')](_0x1b70('0x1'),_0x1b70('0x5'),_0x1b70('0x6'))},'keyContent':{'type':Sequelize[_0x1b70('0x3')]},'idField':{'type':Sequelize[_0x1b70('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1b70('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1b70('0x3')]}}; \ No newline at end of file +var _0xcb99=['STRING','variable','BOOLEAN','sequelize','ENUM','customVariable','keyValue','string'];(function(_0x5b2835,_0x2d9f5d){var _0xad488b=function(_0x1c3794){while(--_0x1c3794){_0x5b2835['push'](_0x5b2835['shift']());}};_0xad488b(++_0x2d9f5d);}(_0xcb99,0x8b));var _0x9cb9=function(_0x4a4bc9,_0xd8cbdb){_0x4a4bc9=_0x4a4bc9-0x0;var _0x3589ca=_0xcb99[_0x4a4bc9];return _0x3589ca;};'use strict';var Sequelize=require(_0x9cb9('0x0'));module['exports']={'type':{'type':Sequelize[_0x9cb9('0x1')]('string','variable',_0x9cb9('0x2'),_0x9cb9('0x3')),'defaultValue':_0x9cb9('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9cb9('0x5')]},'keyType':{'type':Sequelize[_0x9cb9('0x1')]('string',_0x9cb9('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x9cb9('0x5')]},'idField':{'type':Sequelize[_0x9cb9('0x5')]},'nameField':{'type':Sequelize[_0x9cb9('0x5')]},'customField':{'type':Sequelize[_0x9cb9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 97b888a..946cf22 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 _0xe325=['../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','type','VIRTUAL','options','includeAll','include','rows','params','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x3d5046,_0x9877e9){var _0x1adbe9=function(_0x35eaac){while(--_0x35eaac){_0x3d5046['push'](_0x3d5046['shift']());}};_0x1adbe9(++_0x9877e9);}(_0xe325,0x1db));var _0x5e32=function(_0x280820,_0xce9bc7){_0x280820=_0x280820-0x0;var _0x474787=_0xe325[_0x280820];return _0x474787;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5e32('0x0'));var rimraf=require(_0x5e32('0x1'));var zipdir=require(_0x5e32('0x2'));var jsonpatch=require(_0x5e32('0x3'));var rp=require(_0x5e32('0x4'));var moment=require(_0x5e32('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5e32('0x6'));var util=require(_0x5e32('0x7'));var path=require('path');var sox=require(_0x5e32('0x8'));var csv=require(_0x5e32('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5e32('0xa'));var squel=require(_0x5e32('0xb'));var crypto=require(_0x5e32('0xc'));var jsforce=require(_0x5e32('0xd'));var deskjs=require(_0x5e32('0xe'));var toCsv=require(_0x5e32('0x9'));var querystring=require(_0x5e32('0xf'));var Papa=require(_0x5e32('0x10'));var Redis=require('ioredis');var authService=require(_0x5e32('0x11'));var qs=require(_0x5e32('0x12'));var as=require(_0x5e32('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e32('0x14'))('api');var utils=require(_0x5e32('0x15'));var config=require(_0x5e32('0x16'));var db=require(_0x5e32('0x17'))['db'];function respondWithStatusCode(_0x38b837,_0x38726e){_0x38726e=_0x38726e||0xcc;return function(_0x1a47d6){if(_0x1a47d6){return _0x38b837[_0x5e32('0x18')](_0x38726e);}return _0x38b837[_0x5e32('0x19')](_0x38726e)[_0x5e32('0x1a')]();};}function respondWithResult(_0x3f9cb1,_0x429ffa){_0x429ffa=_0x429ffa||0xc8;return function(_0x125610){if(_0x125610){return _0x3f9cb1[_0x5e32('0x19')](_0x429ffa)[_0x5e32('0x1b')](_0x125610);}};}function respondWithFilteredResult(_0x3de7ce,_0x553c5f){return function(_0x35136f){if(_0x35136f){var _0x264429=_0x35136f[_0x5e32('0x1c')],_0x4770f7=_0x553c5f['offset'],_0x3fd79a=_0x553c5f[_0x5e32('0x1d')]+_0x553c5f[_0x5e32('0x1e')],_0x5a66d0;if(_0x3fd79a>=_0x264429){_0x3fd79a=_0x264429;_0x5a66d0=0xc8;}else{_0x5a66d0=0xce;}_0x3de7ce[_0x5e32('0x19')](_0x5a66d0);return _0x3de7ce['set'](_0x5e32('0x1f'),_0x4770f7+'-'+_0x3fd79a+'/'+_0x264429)[_0x5e32('0x1b')](_0x35136f);}return null;};}function patchUpdates(_0x4311e6){return function(_0x3b90dc){try{jsonpatch[_0x5e32('0x20')](_0x3b90dc,_0x4311e6,!![]);}catch(_0x5171d9){return BPromise[_0x5e32('0x21')](_0x5171d9);}return _0x3b90dc[_0x5e32('0x22')]();};}function saveUpdates(_0x25f2c2,_0x207717){return function(_0x28a507){if(_0x28a507){return _0x28a507['update'](_0x25f2c2)[_0x5e32('0x23')](function(_0x51a573){return _0x51a573;});}return null;};}function removeEntity(_0x1fd837,_0x5aba2a){return function(_0x1226c5){if(_0x1226c5){return _0x1226c5[_0x5e32('0x24')]()[_0x5e32('0x23')](function(){_0x1fd837[_0x5e32('0x19')](0xcc)[_0x5e32('0x1a')]();});}};}function handleEntityNotFound(_0x445b17,_0xd9f45d){return function(_0x2d5015){if(!_0x2d5015){_0x445b17[_0x5e32('0x18')](0x194);}return _0x2d5015;};}function handleError(_0x1d848c,_0x3d3159){_0x3d3159=_0x3d3159||0x1f4;return function(_0x1ada2c){logger['error'](_0x1ada2c[_0x5e32('0x25')]);if(_0x1ada2c[_0x5e32('0x26')]){delete _0x1ada2c['name'];}_0x1d848c[_0x5e32('0x19')](_0x3d3159)[_0x5e32('0x27')](_0x1ada2c);};}exports[_0x5e32('0x28')]=function(_0x161e05,_0x5cfe5d){var _0x46981c={},_0x19774c={},_0x3093be={'count':0x0,'rows':[]};var _0xed7fe2=_['map'](db[_0x5e32('0x29')][_0x5e32('0x2a')],function(_0x1dcd25){return{'name':_0x1dcd25[_0x5e32('0x2b')],'type':_0x1dcd25['type'][_0x5e32('0x2c')]};});_0x19774c[_0x5e32('0x2d')]=_[_0x5e32('0x2e')](_0xed7fe2,_0x5e32('0x26'));_0x19774c[_0x5e32('0x2f')]=_[_0x5e32('0x30')](_0x161e05[_0x5e32('0x2f')]);_0x19774c[_0x5e32('0x31')]=_[_0x5e32('0x32')](_0x19774c[_0x5e32('0x2d')],_0x19774c[_0x5e32('0x2f')]);_0x46981c[_0x5e32('0x33')]=_[_0x5e32('0x32')](_0x19774c['model'],qs[_0x5e32('0x34')](_0x161e05[_0x5e32('0x2f')]['fields']));_0x46981c['attributes']=_0x46981c[_0x5e32('0x33')][_0x5e32('0x35')]?_0x46981c[_0x5e32('0x33')]:_0x19774c[_0x5e32('0x2d')];if(!_0x161e05[_0x5e32('0x2f')][_0x5e32('0x36')]('nolimit')){_0x46981c[_0x5e32('0x1e')]=qs[_0x5e32('0x1e')](_0x161e05[_0x5e32('0x2f')][_0x5e32('0x1e')]);_0x46981c[_0x5e32('0x1d')]=qs[_0x5e32('0x1d')](_0x161e05['query'][_0x5e32('0x1d')]);}_0x46981c['order']=qs[_0x5e32('0x37')](_0x161e05[_0x5e32('0x2f')][_0x5e32('0x37')]);_0x46981c['where']=qs[_0x5e32('0x31')](_[_0x5e32('0x38')](_0x161e05[_0x5e32('0x2f')],_0x19774c[_0x5e32('0x31')]));if(_0x161e05['query'][_0x5e32('0x39')]){_0x46981c[_0x5e32('0x3a')]=_['merge'](_0x46981c[_0x5e32('0x3a')],{'$or':_[_0x5e32('0x2e')](_0xed7fe2,function(_0x5c73c8){if(_0x5c73c8[_0x5e32('0x3b')]!==_0x5e32('0x3c')){var _0x396980={};_0x396980[_0x5c73c8[_0x5e32('0x26')]]={'$like':'%'+_0x161e05[_0x5e32('0x2f')]['filter']+'%'};return _0x396980;}})});}_0x46981c=_['merge']({},_0x46981c,_0x161e05[_0x5e32('0x3d')]);var _0x4db31d={'where':_0x46981c[_0x5e32('0x3a')]};return db['FreshdeskField']['count'](_0x4db31d)[_0x5e32('0x23')](function(_0xfd884a){_0x3093be[_0x5e32('0x1c')]=_0xfd884a;if(_0x161e05[_0x5e32('0x2f')][_0x5e32('0x3e')]){_0x46981c[_0x5e32('0x3f')]=[{'all':!![]}];}return db[_0x5e32('0x29')]['findAll'](_0x46981c);})[_0x5e32('0x23')](function(_0x12a89b){_0x3093be[_0x5e32('0x40')]=_0x12a89b;return _0x3093be;})[_0x5e32('0x23')](respondWithFilteredResult(_0x5cfe5d,_0x46981c))['catch'](handleError(_0x5cfe5d,null));};exports['show']=function(_0x46bde2,_0x42a61f){var _0x47c68b={'raw':!![],'where':{'id':_0x46bde2[_0x5e32('0x41')]['id']}},_0x4f288f={};_0x4f288f[_0x5e32('0x2d')]=_[_0x5e32('0x30')](db['FreshdeskField'][_0x5e32('0x2a')]);_0x4f288f['query']=_[_0x5e32('0x30')](_0x46bde2[_0x5e32('0x2f')]);_0x4f288f[_0x5e32('0x31')]=_['intersection'](_0x4f288f['model'],_0x4f288f[_0x5e32('0x2f')]);_0x47c68b['attributes']=_[_0x5e32('0x32')](_0x4f288f[_0x5e32('0x2d')],qs[_0x5e32('0x34')](_0x46bde2[_0x5e32('0x2f')][_0x5e32('0x34')]));_0x47c68b[_0x5e32('0x33')]=_0x47c68b[_0x5e32('0x33')][_0x5e32('0x35')]?_0x47c68b[_0x5e32('0x33')]:_0x4f288f[_0x5e32('0x2d')];if(_0x46bde2[_0x5e32('0x2f')]['includeAll']){_0x47c68b[_0x5e32('0x3f')]=[{'all':!![]}];}_0x47c68b=_[_0x5e32('0x42')]({},_0x47c68b,_0x46bde2[_0x5e32('0x3d')]);return db['FreshdeskField'][_0x5e32('0x43')](_0x47c68b)['then'](handleEntityNotFound(_0x42a61f,null))[_0x5e32('0x23')](respondWithResult(_0x42a61f,null))[_0x5e32('0x44')](handleError(_0x42a61f,null));};exports[_0x5e32('0x45')]=function(_0x131652,_0x4bbac1){return db[_0x5e32('0x29')]['create'](_0x131652[_0x5e32('0x46')],{})['then'](respondWithResult(_0x4bbac1,0xc9))[_0x5e32('0x44')](handleError(_0x4bbac1,null));};exports['update']=function(_0x13acb2,_0x345e8a){if(_0x13acb2[_0x5e32('0x46')]['id']){delete _0x13acb2[_0x5e32('0x46')]['id'];}return db[_0x5e32('0x29')]['find']({'where':{'id':_0x13acb2[_0x5e32('0x41')]['id']}})[_0x5e32('0x23')](handleEntityNotFound(_0x345e8a,null))[_0x5e32('0x23')](saveUpdates(_0x13acb2[_0x5e32('0x46')],null))[_0x5e32('0x23')](respondWithResult(_0x345e8a,null))['catch'](handleError(_0x345e8a,null));};exports[_0x5e32('0x24')]=function(_0x55e01b,_0x5db3e6){return db[_0x5e32('0x29')][_0x5e32('0x43')]({'where':{'id':_0x55e01b['params']['id']}})[_0x5e32('0x23')](handleEntityNotFound(_0x5db3e6,null))[_0x5e32('0x23')](removeEntity(_0x5db3e6,null))['catch'](handleError(_0x5db3e6,null));}; \ No newline at end of file +var _0x7b70=['apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','rawAttributes','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range'];(function(_0x5a452e,_0x41c693){var _0x21a12a=function(_0x1e6888){while(--_0x1e6888){_0x5a452e['push'](_0x5a452e['shift']());}};_0x21a12a(++_0x41c693);}(_0x7b70,0x10c));var _0x07b7=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x7b70[_0x9c2427];return _0x51984f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x07b7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x07b7('0x1'));var jsonpatch=require(_0x07b7('0x2'));var rp=require(_0x07b7('0x3'));var moment=require(_0x07b7('0x4'));var BPromise=require(_0x07b7('0x5'));var Mustache=require(_0x07b7('0x6'));var util=require(_0x07b7('0x7'));var path=require(_0x07b7('0x8'));var sox=require(_0x07b7('0x9'));var csv=require(_0x07b7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x07b7('0xb'));var crypto=require('crypto');var jsforce=require(_0x07b7('0xc'));var deskjs=require(_0x07b7('0xd'));var toCsv=require(_0x07b7('0xa'));var querystring=require(_0x07b7('0xe'));var Papa=require(_0x07b7('0xf'));var Redis=require(_0x07b7('0x10'));var authService=require(_0x07b7('0x11'));var qs=require(_0x07b7('0x12'));var as=require(_0x07b7('0x13'));var hardwareService=require(_0x07b7('0x14'));var logger=require('../../config/logger')(_0x07b7('0x15'));var utils=require(_0x07b7('0x16'));var config=require(_0x07b7('0x17'));var db=require(_0x07b7('0x18'))['db'];function respondWithStatusCode(_0x56642c,_0x41be2e){_0x41be2e=_0x41be2e||0xcc;return function(_0x26e01d){if(_0x26e01d){return _0x56642c[_0x07b7('0x19')](_0x41be2e);}return _0x56642c[_0x07b7('0x1a')](_0x41be2e)[_0x07b7('0x1b')]();};}function respondWithResult(_0x58ee4b,_0x2d24c9){_0x2d24c9=_0x2d24c9||0xc8;return function(_0x57eb4a){if(_0x57eb4a){return _0x58ee4b[_0x07b7('0x1a')](_0x2d24c9)[_0x07b7('0x1c')](_0x57eb4a);}};}function respondWithFilteredResult(_0xd6e0ba,_0x4dac22){return function(_0x3bae12){if(_0x3bae12){var _0xfc6e82=_0x3bae12[_0x07b7('0x1d')],_0x16f11d=_0x4dac22[_0x07b7('0x1e')],_0x12c7f3=_0x4dac22[_0x07b7('0x1e')]+_0x4dac22['limit'],_0xda9ef9;if(_0x12c7f3>=_0xfc6e82){_0x12c7f3=_0xfc6e82;_0xda9ef9=0xc8;}else{_0xda9ef9=0xce;}_0xd6e0ba[_0x07b7('0x1a')](_0xda9ef9);return _0xd6e0ba['set'](_0x07b7('0x1f'),_0x16f11d+'-'+_0x12c7f3+'/'+_0xfc6e82)[_0x07b7('0x1c')](_0x3bae12);}return null;};}function patchUpdates(_0xd2e4e8){return function(_0x541856){try{jsonpatch[_0x07b7('0x20')](_0x541856,_0xd2e4e8,!![]);}catch(_0x5d659b){return BPromise[_0x07b7('0x21')](_0x5d659b);}return _0x541856[_0x07b7('0x22')]();};}function saveUpdates(_0xafa458,_0x220919){return function(_0x17e171){if(_0x17e171){return _0x17e171[_0x07b7('0x23')](_0xafa458)[_0x07b7('0x24')](function(_0x262b39){return _0x262b39;});}return null;};}function removeEntity(_0x2abccb,_0x29a9fa){return function(_0x206faa){if(_0x206faa){return _0x206faa[_0x07b7('0x25')]()[_0x07b7('0x24')](function(){_0x2abccb[_0x07b7('0x1a')](0xcc)[_0x07b7('0x1b')]();});}};}function handleEntityNotFound(_0x470771,_0x5db173){return function(_0x11aa74){if(!_0x11aa74){_0x470771[_0x07b7('0x19')](0x194);}return _0x11aa74;};}function handleError(_0x2d4c21,_0x273f6e){_0x273f6e=_0x273f6e||0x1f4;return function(_0x25e9e5){logger[_0x07b7('0x26')](_0x25e9e5[_0x07b7('0x27')]);if(_0x25e9e5[_0x07b7('0x28')]){delete _0x25e9e5['name'];}_0x2d4c21[_0x07b7('0x1a')](_0x273f6e)[_0x07b7('0x29')](_0x25e9e5);};}exports[_0x07b7('0x2a')]=function(_0x5ba7e2,_0x755d7f){var _0x5c6e5a={},_0x12620c={},_0x7596a9={'count':0x0,'rows':[]};var _0x2a2f97=_[_0x07b7('0x2b')](db[_0x07b7('0x2c')][_0x07b7('0x2d')],function(_0xf68daf){return{'name':_0xf68daf['fieldName'],'type':_0xf68daf['type'][_0x07b7('0x2e')]};});_0x12620c['model']=_[_0x07b7('0x2b')](_0x2a2f97,_0x07b7('0x28'));_0x12620c[_0x07b7('0x2f')]=_[_0x07b7('0x30')](_0x5ba7e2[_0x07b7('0x2f')]);_0x12620c['filters']=_[_0x07b7('0x31')](_0x12620c[_0x07b7('0x32')],_0x12620c[_0x07b7('0x2f')]);_0x5c6e5a[_0x07b7('0x33')]=_[_0x07b7('0x31')](_0x12620c[_0x07b7('0x32')],qs[_0x07b7('0x34')](_0x5ba7e2['query'][_0x07b7('0x34')]));_0x5c6e5a[_0x07b7('0x33')]=_0x5c6e5a['attributes']['length']?_0x5c6e5a[_0x07b7('0x33')]:_0x12620c[_0x07b7('0x32')];if(!_0x5ba7e2[_0x07b7('0x2f')][_0x07b7('0x35')]('nolimit')){_0x5c6e5a['limit']=qs[_0x07b7('0x36')](_0x5ba7e2[_0x07b7('0x2f')][_0x07b7('0x36')]);_0x5c6e5a[_0x07b7('0x1e')]=qs[_0x07b7('0x1e')](_0x5ba7e2[_0x07b7('0x2f')]['offset']);}_0x5c6e5a[_0x07b7('0x37')]=qs[_0x07b7('0x38')](_0x5ba7e2[_0x07b7('0x2f')][_0x07b7('0x38')]);_0x5c6e5a[_0x07b7('0x39')]=qs[_0x07b7('0x3a')](_[_0x07b7('0x3b')](_0x5ba7e2[_0x07b7('0x2f')],_0x12620c['filters']));if(_0x5ba7e2[_0x07b7('0x2f')]['filter']){_0x5c6e5a[_0x07b7('0x39')]=_[_0x07b7('0x3c')](_0x5c6e5a[_0x07b7('0x39')],{'$or':_[_0x07b7('0x2b')](_0x2a2f97,function(_0x362fc2){if(_0x362fc2[_0x07b7('0x3d')]!==_0x07b7('0x3e')){var _0x29ca2b={};_0x29ca2b[_0x362fc2[_0x07b7('0x28')]]={'$like':'%'+_0x5ba7e2[_0x07b7('0x2f')]['filter']+'%'};return _0x29ca2b;}})});}_0x5c6e5a=_[_0x07b7('0x3c')]({},_0x5c6e5a,_0x5ba7e2[_0x07b7('0x3f')]);var _0xe203a6={'where':_0x5c6e5a[_0x07b7('0x39')]};return db[_0x07b7('0x2c')][_0x07b7('0x1d')](_0xe203a6)[_0x07b7('0x24')](function(_0x58cd62){_0x7596a9['count']=_0x58cd62;if(_0x5ba7e2['query'][_0x07b7('0x40')]){_0x5c6e5a[_0x07b7('0x41')]=[{'all':!![]}];}return db[_0x07b7('0x2c')][_0x07b7('0x42')](_0x5c6e5a);})[_0x07b7('0x24')](function(_0x4a6fa7){_0x7596a9[_0x07b7('0x43')]=_0x4a6fa7;return _0x7596a9;})[_0x07b7('0x24')](respondWithFilteredResult(_0x755d7f,_0x5c6e5a))[_0x07b7('0x44')](handleError(_0x755d7f,null));};exports[_0x07b7('0x45')]=function(_0xb4c5f0,_0x1443da){var _0x480609={'raw':!![],'where':{'id':_0xb4c5f0[_0x07b7('0x46')]['id']}},_0x41cd77={};_0x41cd77[_0x07b7('0x32')]=_[_0x07b7('0x30')](db[_0x07b7('0x2c')][_0x07b7('0x2d')]);_0x41cd77[_0x07b7('0x2f')]=_[_0x07b7('0x30')](_0xb4c5f0['query']);_0x41cd77['filters']=_['intersection'](_0x41cd77[_0x07b7('0x32')],_0x41cd77[_0x07b7('0x2f')]);_0x480609['attributes']=_['intersection'](_0x41cd77[_0x07b7('0x32')],qs[_0x07b7('0x34')](_0xb4c5f0[_0x07b7('0x2f')][_0x07b7('0x34')]));_0x480609['attributes']=_0x480609[_0x07b7('0x33')][_0x07b7('0x47')]?_0x480609[_0x07b7('0x33')]:_0x41cd77['model'];if(_0xb4c5f0[_0x07b7('0x2f')][_0x07b7('0x40')]){_0x480609[_0x07b7('0x41')]=[{'all':!![]}];}_0x480609=_[_0x07b7('0x3c')]({},_0x480609,_0xb4c5f0['options']);return db['FreshdeskField'][_0x07b7('0x48')](_0x480609)[_0x07b7('0x24')](handleEntityNotFound(_0x1443da,null))['then'](respondWithResult(_0x1443da,null))[_0x07b7('0x44')](handleError(_0x1443da,null));};exports[_0x07b7('0x49')]=function(_0x32955e,_0x54be3d){return db['FreshdeskField']['create'](_0x32955e[_0x07b7('0x4a')],{})['then'](respondWithResult(_0x54be3d,0xc9))[_0x07b7('0x44')](handleError(_0x54be3d,null));};exports[_0x07b7('0x23')]=function(_0x3eadf8,_0x1f6c2c){if(_0x3eadf8['body']['id']){delete _0x3eadf8[_0x07b7('0x4a')]['id'];}return db[_0x07b7('0x2c')]['find']({'where':{'id':_0x3eadf8[_0x07b7('0x46')]['id']}})[_0x07b7('0x24')](handleEntityNotFound(_0x1f6c2c,null))[_0x07b7('0x24')](saveUpdates(_0x3eadf8[_0x07b7('0x4a')],null))[_0x07b7('0x24')](respondWithResult(_0x1f6c2c,null))[_0x07b7('0x44')](handleError(_0x1f6c2c,null));};exports[_0x07b7('0x25')]=function(_0x2624b9,_0x4ea984){return db['FreshdeskField'][_0x07b7('0x48')]({'where':{'id':_0x2624b9['params']['id']}})[_0x07b7('0x24')](handleEntityNotFound(_0x4ea984,null))[_0x07b7('0x24')](removeEntity(_0x4ea984,null))[_0x07b7('0x44')](handleError(_0x4ea984,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index b119984..21c526e 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 _0xb753=['exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4cd91e,_0x268dec){var _0x1b2a3b=function(_0x9469c9){while(--_0x9469c9){_0x4cd91e['push'](_0x4cd91e['shift']());}};_0x1b2a3b(++_0x268dec);}(_0xb753,0x19c));var _0x3b75=function(_0x54a2e4,_0x1ff92c){_0x54a2e4=_0x54a2e4-0x0;var _0x4742d0=_0xb753[_0x54a2e4];return _0x4742d0;};'use strict';var _=require(_0x3b75('0x0'));var util=require(_0x3b75('0x1'));var logger=require('../../config/logger')(_0x3b75('0x2'));var moment=require(_0x3b75('0x3'));var BPromise=require(_0x3b75('0x4'));var rp=require(_0x3b75('0x5'));var fs=require('fs');var path=require(_0x3b75('0x6'));var rimraf=require('rimraf');var config=require(_0x3b75('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x3b75('0x8')]=function(_0x4eb43f,_0x4ab432){return _0x4eb43f[_0x3b75('0x9')](_0x3b75('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x3b75('0xb'),'fields':[_0x3b75('0xc'),_0x3b75('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe4b3=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','freshdesk_unique_index','idField','lodash'];(function(_0x16d7fb,_0x4b9dc3){var _0x404e18=function(_0x1f0bbf){while(--_0x1f0bbf){_0x16d7fb['push'](_0x16d7fb['shift']());}};_0x404e18(++_0x4b9dc3);}(_0xe4b3,0xb3));var _0x3e4b=function(_0x287a95,_0x1aa354){_0x287a95=_0x287a95-0x0;var _0x2c61b7=_0xe4b3[_0x287a95];return _0x2c61b7;};'use strict';var _=require(_0x3e4b('0x0'));var util=require(_0x3e4b('0x1'));var logger=require(_0x3e4b('0x2'))(_0x3e4b('0x3'));var moment=require('moment');var BPromise=require(_0x3e4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e4b('0x5'));var rimraf=require(_0x3e4b('0x6'));var config=require(_0x3e4b('0x7'));var attributes=require(_0x3e4b('0x8'));module[_0x3e4b('0x9')]=function(_0x130519,_0xdc901f){return _0x130519['define']('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x3e4b('0xa'),'fields':[_0x3e4b('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index ac9dbf5..b0de6bd 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x461d2b,_0x521a2a){var _0x182cf0=function(_0x7dfc83){while(--_0x7dfc83){_0x461d2b['push'](_0x461d2b['shift']());}};_0x182cf0(++_0x521a2a);}(_0xb10b,0x12a));var _0xbb10=function(_0x37d3e0,_0x51d1f4){_0x37d3e0=_0x37d3e0-0x0;var _0x5512a3=_0xb10b[_0x37d3e0];return _0x5512a3;};'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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x28ceff,_0xc9b4a4){var _0x251ee2=function(_0x3ec3b8){while(--_0x3ec3b8){_0x28ceff['push'](_0x28ceff['shift']());}};_0x251ee2(++_0xc9b4a4);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0xb10b[_0x5b5cde];return _0x364ad2;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index b147867..4eef286 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc51d=['create','addConfiguration','delete','/:id','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc51d,0xc3));var _0xdc51=function(_0x2b6ebb,_0x3b6985){_0x2b6ebb=_0x2b6ebb-0x0;var _0x124310=_0xc51d[_0x2b6ebb];return _0x124310;};'use strict';var multer=require(_0xdc51('0x0'));var util=require('util');var path=require(_0xdc51('0x1'));var timeout=require(_0xdc51('0x2'));var express=require('express');var router=express[_0xdc51('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xdc51('0x4'));var config=require('../../config/environment');var controller=require(_0xdc51('0x5'));router[_0xdc51('0x6')]('/',auth[_0xdc51('0x7')](),controller[_0xdc51('0x8')]);router['get']('/:id',auth[_0xdc51('0x7')](),controller[_0xdc51('0x9')]);router[_0xdc51('0x6')](_0xdc51('0xa'),auth['isAuthenticated'](),controller[_0xdc51('0xb')]);router[_0xdc51('0x6')](_0xdc51('0xc'),auth[_0xdc51('0x7')](),controller[_0xdc51('0xd')]);router[_0xdc51('0xe')]('/',auth['isAuthenticated'](),controller[_0xdc51('0xf')]);router['post'](_0xdc51('0xa'),auth[_0xdc51('0x7')](),controller[_0xdc51('0x10')]);router['put']('/:id',auth[_0xdc51('0x7')](),controller['update']);router[_0xdc51('0x11')](_0xdc51('0x12'),auth['isAuthenticated'](),controller[_0xdc51('0x13')]);module[_0xdc51('0x14')]=router; \ No newline at end of file +var _0x8400=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','util'];(function(_0x47cfe9,_0x465805){var _0x1dae57=function(_0x18bc76){while(--_0x18bc76){_0x47cfe9['push'](_0x47cfe9['shift']());}};_0x1dae57(++_0x465805);}(_0x8400,0x15e));var _0x0840=function(_0x1272f2,_0x5f1282){_0x1272f2=_0x1272f2-0x0;var _0x4e07a4=_0x8400[_0x1272f2];return _0x4e07a4;};'use strict';var multer=require(_0x0840('0x0'));var util=require(_0x0840('0x1'));var path=require(_0x0840('0x2'));var timeout=require(_0x0840('0x3'));var express=require('express');var router=express[_0x0840('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0840('0x5'));var config=require(_0x0840('0x6'));var controller=require('./intFreshsalesAccount.controller');router['get']('/',auth[_0x0840('0x7')](),controller[_0x0840('0x8')]);router[_0x0840('0x9')](_0x0840('0xa'),auth[_0x0840('0x7')](),controller[_0x0840('0xb')]);router[_0x0840('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0840('0xc')]);router['get'](_0x0840('0xd'),auth[_0x0840('0x7')](),controller['getFields']);router[_0x0840('0xe')]('/',auth[_0x0840('0x7')](),controller[_0x0840('0xf')]);router[_0x0840('0xe')](_0x0840('0x10'),auth[_0x0840('0x7')](),controller[_0x0840('0x11')]);router[_0x0840('0x12')](_0x0840('0xa'),auth[_0x0840('0x7')](),controller['update']);router[_0x0840('0x13')]('/:id',auth[_0x0840('0x7')](),controller[_0x0840('0x14')]);module[_0x0840('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 7553834..ba50074 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c63=['sequelize','exports','STRING','username'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0x1c63,0xdc));var _0x31c6=function(_0x1e830c,_0x31776b){_0x1e830c=_0x1e830c-0x0;var _0x3196e9=_0x1c63[_0x1e830c];return _0x3196e9;};'use strict';var Sequelize=require(_0x31c6('0x0'));module[_0x31c6('0x1')]={'name':{'type':Sequelize[_0x31c6('0x2')]},'description':{'type':Sequelize[_0x31c6('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x31c6('0x3')},'apiKey':{'type':Sequelize[_0x31c6('0x2')]},'remoteUri':{'type':Sequelize[_0x31c6('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x31c6('0x2')]}}; \ No newline at end of file +var _0x147b=['exports','STRING','remoteUri','sequelize'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x147b,0x193));var _0xb147=function(_0x448733,_0x5638fa){_0x448733=_0x448733-0x0;var _0x8b38c8=_0x147b[_0x448733];return _0x8b38c8;};'use strict';var Sequelize=require(_0xb147('0x0'));module[_0xb147('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb147('0x2')]},'username':{'type':Sequelize[_0xb147('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xb147('0x2')]},'remoteUri':{'type':Sequelize[_0xb147('0x2')],'unique':_0xb147('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 1643483..b037f36 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf206=['fieldName','type','key','model','query','filters','intersection','attributes','fields','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','show','params','keys','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','pick','length','hasOwnProperty','nolimit','AccountId','Subjects','channel','Descriptions','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','/api/selector/owners','Token\x20token=','apiKey','users','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','reject','update','destroy','name','send','index','map','FreshsalesAccount','rawAttributes'];(function(_0x3ac514,_0x1dfed9){var _0x47324c=function(_0x42285d){while(--_0x42285d){_0x3ac514['push'](_0x3ac514['shift']());}};_0x47324c(++_0x1dfed9);}(_0xf206,0x1f0));var _0x6f20=function(_0x23d068,_0x57a93e){_0x23d068=_0x23d068-0x0;var _0x4f3805=_0xf206[_0x23d068];return _0x4f3805;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6f20('0x0'));var rimraf=require(_0x6f20('0x1'));var zipdir=require(_0x6f20('0x2'));var jsonpatch=require(_0x6f20('0x3'));var rp=require(_0x6f20('0x4'));var moment=require('moment');var BPromise=require(_0x6f20('0x5'));var Mustache=require('mustache');var util=require(_0x6f20('0x6'));var path=require(_0x6f20('0x7'));var sox=require('sox');var csv=require(_0x6f20('0x8'));var ejs=require(_0x6f20('0x9'));var fs=require('fs');var _=require(_0x6f20('0xa'));var squel=require(_0x6f20('0xb'));var crypto=require(_0x6f20('0xc'));var jsforce=require(_0x6f20('0xd'));var deskjs=require(_0x6f20('0xe'));var toCsv=require(_0x6f20('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f20('0xf'));var authService=require(_0x6f20('0x10'));var qs=require(_0x6f20('0x11'));var as=require(_0x6f20('0x12'));var hardwareService=require(_0x6f20('0x13'));var logger=require('../../config/logger')(_0x6f20('0x14'));var utils=require(_0x6f20('0x15'));var config=require(_0x6f20('0x16'));var db=require(_0x6f20('0x17'))['db'];var integrations=require(_0x6f20('0x18'));var jayson=require(_0x6f20('0x19'));var client=jayson[_0x6f20('0x1a')][_0x6f20('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3711f9,_0x3308b2,_0x59a43e){if(_0x59a43e){var _0x2fac30=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2fac30[_0x6f20('0x1c')](_0x3308b2)){return _0x3711f9;}else{throw new db['Sequelize'][(_0x6f20('0x1d'))](_0x6f20('0x1e'));}}else{return _0x3711f9;}}function respondWithRpcPromise(_0x1d47b8,_0x1d4450,_0x502388,_0x3ec37d){return new BPromise(function(_0xf83abf,_0x5f0942){var _0x1d3bb8=_0x3ec37d||client;return _0x1d3bb8[_0x6f20('0x1f')](_0x1d47b8,_0x502388)[_0x6f20('0x20')](function(_0xadf703){logger['info'](_0x6f20('0x21'),_0x1d4450,_0x6f20('0x22'));logger[_0x6f20('0x23')](_0x6f20('0x24'),_0x1d4450,_0x6f20('0x22'),JSON[_0x6f20('0x25')](_0xadf703));if(_0xadf703['error']){if(_0xadf703[_0x6f20('0x26')]['code']===0x1f4){logger['error'](_0x6f20('0x21'),_0x1d4450,_0xadf703[_0x6f20('0x26')]['message']);return _0x5f0942(_0xadf703[_0x6f20('0x26')][_0x6f20('0x27')]);}logger['error'](_0x6f20('0x21'),_0x1d4450,_0xadf703[_0x6f20('0x26')][_0x6f20('0x27')]);return _0xf83abf(_0xadf703[_0x6f20('0x26')][_0x6f20('0x27')]);}else{logger[_0x6f20('0x28')](_0x6f20('0x21'),_0x1d4450,_0x6f20('0x22'));_0xf83abf(_0xadf703[_0x6f20('0x29')][_0x6f20('0x27')]);}})[_0x6f20('0x2a')](function(_0x2f472c){logger[_0x6f20('0x26')](_0x6f20('0x21'),_0x1d4450,_0x2f472c);_0x5f0942(_0x2f472c);});});}function respondWithStatusCode(_0x131a76,_0x25a2c3){_0x25a2c3=_0x25a2c3||0xcc;return function(_0x5de47b){if(_0x5de47b){return _0x131a76[_0x6f20('0x2b')](_0x25a2c3);}return _0x131a76[_0x6f20('0x2c')](_0x25a2c3)['end']();};}function respondWithResult(_0x551124,_0x2142bf){_0x2142bf=_0x2142bf||0xc8;return function(_0x2c92a6){if(_0x2c92a6){return _0x551124[_0x6f20('0x2c')](_0x2142bf)[_0x6f20('0x2d')](_0x2c92a6);}};}function respondWithFilteredResult(_0x41499b,_0x21f916){return function(_0x2d0dbf){if(_0x2d0dbf){var _0x27be99=_0x2d0dbf[_0x6f20('0x2e')],_0x52dfcf=_0x21f916[_0x6f20('0x2f')],_0x544473=_0x21f916['offset']+_0x21f916[_0x6f20('0x30')],_0x2e2f89;if(_0x544473>=_0x27be99){_0x544473=_0x27be99;_0x2e2f89=0xc8;}else{_0x2e2f89=0xce;}_0x41499b['status'](_0x2e2f89);return _0x41499b['set'](_0x6f20('0x31'),_0x52dfcf+'-'+_0x544473+'/'+_0x27be99)[_0x6f20('0x2d')](_0x2d0dbf);}return null;};}function patchUpdates(_0x332d03){return function(_0x27cd33){try{jsonpatch['apply'](_0x27cd33,_0x332d03,!![]);}catch(_0x18d308){return BPromise[_0x6f20('0x32')](_0x18d308);}return _0x27cd33['save']();};}function saveUpdates(_0x40385f,_0x2fd8b5){return function(_0x48943b){if(_0x48943b){return _0x48943b[_0x6f20('0x33')](_0x40385f)[_0x6f20('0x20')](function(_0x1b7c49){return _0x1b7c49;});}return null;};}function removeEntity(_0x1a958d,_0x4f592e){return function(_0x1daff6){if(_0x1daff6){return _0x1daff6[_0x6f20('0x34')]()['then'](function(){_0x1a958d[_0x6f20('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eb203,_0xd08ecf){return function(_0x185462){if(!_0x185462){_0x1eb203[_0x6f20('0x2b')](0x194);}return _0x185462;};}function handleError(_0x2bfcae,_0x5de945){_0x5de945=_0x5de945||0x1f4;return function(_0x2720ae){logger[_0x6f20('0x26')](_0x2720ae['stack']);if(_0x2720ae[_0x6f20('0x35')]){delete _0x2720ae['name'];}_0x2bfcae[_0x6f20('0x2c')](_0x5de945)[_0x6f20('0x36')](_0x2720ae);};}exports[_0x6f20('0x37')]=function(_0x379395,_0x29fde1){var _0x47bacd={},_0x18229e={},_0x36b2b1={'count':0x0,'rows':[]};var _0x13ed14=_[_0x6f20('0x38')](db[_0x6f20('0x39')][_0x6f20('0x3a')],function(_0x258938){return{'name':_0x258938[_0x6f20('0x3b')],'type':_0x258938[_0x6f20('0x3c')][_0x6f20('0x3d')]};});_0x18229e[_0x6f20('0x3e')]=_['map'](_0x13ed14,_0x6f20('0x35'));_0x18229e[_0x6f20('0x3f')]=_['keys'](_0x379395[_0x6f20('0x3f')]);_0x18229e[_0x6f20('0x40')]=_[_0x6f20('0x41')](_0x18229e[_0x6f20('0x3e')],_0x18229e['query']);_0x47bacd[_0x6f20('0x42')]=_[_0x6f20('0x41')](_0x18229e[_0x6f20('0x3e')],qs['fields'](_0x379395[_0x6f20('0x3f')][_0x6f20('0x43')]));_0x47bacd['attributes']=_0x47bacd['attributes']['length']?_0x47bacd[_0x6f20('0x42')]:_0x18229e[_0x6f20('0x3e')];if(!_0x379395[_0x6f20('0x3f')]['hasOwnProperty']('nolimit')){_0x47bacd[_0x6f20('0x30')]=qs[_0x6f20('0x30')](_0x379395[_0x6f20('0x3f')][_0x6f20('0x30')]);_0x47bacd[_0x6f20('0x2f')]=qs[_0x6f20('0x2f')](_0x379395[_0x6f20('0x3f')][_0x6f20('0x2f')]);}_0x47bacd[_0x6f20('0x44')]=qs[_0x6f20('0x45')](_0x379395['query'][_0x6f20('0x45')]);_0x47bacd[_0x6f20('0x46')]=qs[_0x6f20('0x40')](_['pick'](_0x379395[_0x6f20('0x3f')],_0x18229e[_0x6f20('0x40')]));if(_0x379395['query'][_0x6f20('0x47')]){_0x47bacd[_0x6f20('0x46')]=_['merge'](_0x47bacd[_0x6f20('0x46')],{'$or':_[_0x6f20('0x38')](_0x13ed14,function(_0x10330d){if(_0x10330d[_0x6f20('0x3c')]!==_0x6f20('0x48')){var _0x5c884c={};_0x5c884c[_0x10330d[_0x6f20('0x35')]]={'$like':'%'+_0x379395[_0x6f20('0x3f')][_0x6f20('0x47')]+'%'};return _0x5c884c;}})});}_0x47bacd=_[_0x6f20('0x49')]({},_0x47bacd,_0x379395[_0x6f20('0x4a')]);var _0x39ca34={'where':_0x47bacd[_0x6f20('0x46')]};return db['FreshsalesAccount'][_0x6f20('0x2e')](_0x39ca34)[_0x6f20('0x20')](function(_0x2e52ec){_0x36b2b1[_0x6f20('0x2e')]=_0x2e52ec;if(_0x379395[_0x6f20('0x3f')][_0x6f20('0x4b')]){_0x47bacd[_0x6f20('0x4c')]=[{'all':!![]}];}return db[_0x6f20('0x39')]['findAll'](_0x47bacd);})[_0x6f20('0x20')](function(_0x3c9f63){_0x36b2b1['rows']=_0x3c9f63;return _0x36b2b1;})['then'](respondWithFilteredResult(_0x29fde1,_0x47bacd))[_0x6f20('0x2a')](handleError(_0x29fde1,null));};exports[_0x6f20('0x4d')]=function(_0x4229b2,_0x52b2ee){var _0x748f6c={'raw':![],'where':{'id':_0x4229b2[_0x6f20('0x4e')]['id']}},_0x3bf318={};_0x3bf318[_0x6f20('0x3e')]=_[_0x6f20('0x4f')](db[_0x6f20('0x39')][_0x6f20('0x3a')]);_0x3bf318[_0x6f20('0x3f')]=_['keys'](_0x4229b2[_0x6f20('0x3f')]);_0x3bf318[_0x6f20('0x40')]=_[_0x6f20('0x41')](_0x3bf318['model'],_0x3bf318[_0x6f20('0x3f')]);_0x748f6c[_0x6f20('0x42')]=_[_0x6f20('0x41')](_0x3bf318[_0x6f20('0x3e')],qs[_0x6f20('0x43')](_0x4229b2['query']['fields']));_0x748f6c[_0x6f20('0x42')]=_0x748f6c['attributes']['length']?_0x748f6c[_0x6f20('0x42')]:_0x3bf318[_0x6f20('0x3e')];if(_0x4229b2['query'][_0x6f20('0x4b')]){_0x748f6c['include']=[{'all':!![]}];}_0x748f6c=_[_0x6f20('0x49')]({},_0x748f6c,_0x4229b2[_0x6f20('0x4a')]);return db[_0x6f20('0x39')][_0x6f20('0x50')](_0x748f6c)[_0x6f20('0x20')](handleEntityNotFound(_0x52b2ee,null))[_0x6f20('0x20')](respondWithResult(_0x52b2ee,null))[_0x6f20('0x2a')](handleError(_0x52b2ee,null));};exports[_0x6f20('0x51')]=function(_0x10570d,_0x4dfe51){return db[_0x6f20('0x39')][_0x6f20('0x51')](_0x10570d[_0x6f20('0x52')],{})[_0x6f20('0x20')](respondWithResult(_0x4dfe51,0xc9))[_0x6f20('0x2a')](handleError(_0x4dfe51,null));};exports[_0x6f20('0x33')]=function(_0x1a01af,_0x4c6dd0){if(_0x1a01af[_0x6f20('0x52')]['id']){delete _0x1a01af[_0x6f20('0x52')]['id'];}return db[_0x6f20('0x39')][_0x6f20('0x50')]({'where':{'id':_0x1a01af['params']['id']}})[_0x6f20('0x20')](handleEntityNotFound(_0x4c6dd0,null))[_0x6f20('0x20')](saveUpdates(_0x1a01af['body'],null))[_0x6f20('0x20')](respondWithResult(_0x4c6dd0,null))[_0x6f20('0x2a')](handleError(_0x4c6dd0,null));};exports[_0x6f20('0x34')]=function(_0x5b12e6,_0x3ad5de){return db[_0x6f20('0x39')][_0x6f20('0x50')]({'where':{'id':_0x5b12e6['params']['id']}})[_0x6f20('0x20')](handleEntityNotFound(_0x3ad5de,null))[_0x6f20('0x20')](removeEntity(_0x3ad5de,null))[_0x6f20('0x2a')](handleError(_0x3ad5de,null));};exports[_0x6f20('0x53')]=function(_0x420798,_0x3c624,_0xe6f1fa){var _0xfe9048={};var _0x44d60d={};var _0x56cd67;var _0x139ee8;return db['FreshsalesAccount'][_0x6f20('0x54')]({'where':{'id':_0x420798[_0x6f20('0x4e')]['id']}})[_0x6f20('0x20')](handleEntityNotFound(_0x3c624,null))[_0x6f20('0x20')](function(_0xcd6e07){if(_0xcd6e07){_0x56cd67=_0xcd6e07;_0x44d60d[_0x6f20('0x3e')]=_[_0x6f20('0x4f')](db[_0x6f20('0x55')]['rawAttributes']);_0x44d60d[_0x6f20('0x3f')]=_[_0x6f20('0x4f')](_0x420798[_0x6f20('0x3f')]);_0x44d60d[_0x6f20('0x40')]=_['intersection'](_0x44d60d['model'],_0x44d60d[_0x6f20('0x3f')]);_0xfe9048[_0x6f20('0x42')]=_[_0x6f20('0x41')](_0x44d60d[_0x6f20('0x3e')],qs['fields'](_0x420798[_0x6f20('0x3f')][_0x6f20('0x43')]));_0xfe9048[_0x6f20('0x42')]=_0xfe9048[_0x6f20('0x42')]['length']?_0xfe9048[_0x6f20('0x42')]:_0x44d60d[_0x6f20('0x3e')];_0xfe9048[_0x6f20('0x44')]=qs[_0x6f20('0x45')](_0x420798[_0x6f20('0x3f')]['sort']);_0xfe9048[_0x6f20('0x46')]=qs[_0x6f20('0x40')](_[_0x6f20('0x56')](_0x420798[_0x6f20('0x3f')],_0x44d60d[_0x6f20('0x40')]));if(_0x420798[_0x6f20('0x3f')][_0x6f20('0x47')]){_0xfe9048[_0x6f20('0x46')]=_[_0x6f20('0x49')](_0xfe9048[_0x6f20('0x46')],{'$or':_[_0x6f20('0x38')](_0xfe9048[_0x6f20('0x42')],function(_0x4442ef){var _0x4dd367={};_0x4dd367[_0x4442ef]={'$like':'%'+_0x420798['query']['filter']+'%'};return _0x4dd367;})});}_0xfe9048=_['merge']({},_0xfe9048,_0x420798['options']);return _0x56cd67['getConfigurations'](_0xfe9048);}})['then'](function(_0x7c3649){if(_0x7c3649){_0x139ee8=_0x7c3649[_0x6f20('0x57')];if(!_0x420798[_0x6f20('0x3f')][_0x6f20('0x58')](_0x6f20('0x59'))){_0xfe9048[_0x6f20('0x30')]=qs[_0x6f20('0x30')](_0x420798['query'][_0x6f20('0x30')]);_0xfe9048[_0x6f20('0x2f')]=qs[_0x6f20('0x2f')](_0x420798[_0x6f20('0x3f')][_0x6f20('0x2f')]);}return _0x56cd67['getConfigurations'](_0xfe9048);}})[_0x6f20('0x20')](function(_0x460fa1){if(_0x460fa1){return _0x460fa1?{'count':_0x139ee8,'rows':_0x460fa1}:null;}})[_0x6f20('0x20')](respondWithResult(_0x3c624,null))[_0x6f20('0x2a')](handleError(_0x3c624,null));};exports['addConfiguration']=function(_0x387f6d,_0x32cb83,_0x3f2571){if(_0x387f6d[_0x6f20('0x52')]['id']){delete _0x387f6d[_0x6f20('0x52')]['id'];}return db[_0x6f20('0x39')]['findOne']({'where':{'id':_0x387f6d[_0x6f20('0x4e')]['id']}})[_0x6f20('0x20')](handleEntityNotFound(_0x32cb83,null))[_0x6f20('0x20')](function(_0x378f4d){if(_0x378f4d){_0x387f6d['body'][_0x6f20('0x5a')]=_0x378f4d['id'];_0x387f6d['body'][_0x6f20('0x5b')]=integrations['getSubjects'](_0x387f6d[_0x6f20('0x52')][_0x6f20('0x5c')],_0x387f6d[_0x6f20('0x52')][_0x6f20('0x3c')]);_0x387f6d['body'][_0x6f20('0x5d')]=integrations['getDescriptions'](_0x387f6d[_0x6f20('0x52')][_0x6f20('0x5c')],_0x387f6d['body'][_0x6f20('0x3c')]);return db[_0x6f20('0x55')][_0x6f20('0x51')](_0x387f6d[_0x6f20('0x52')],{'include':[{'model':db[_0x6f20('0x5e')],'as':_0x6f20('0x5b')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x32cb83,null))[_0x6f20('0x2a')](handleError(_0x32cb83,null));};exports[_0x6f20('0x5f')]=function(_0x28a0ab,_0x36b0bf,_0xf50d1d){var _0x4cfa09='';var _0xcd5a01='';return db['FreshsalesAccount'][_0x6f20('0x54')]({'where':{'id':_0x28a0ab[_0x6f20('0x4e')]['id']},'attributes':['id',_0x6f20('0x60'),_0x6f20('0x61'),'apiKey']})[_0x6f20('0x20')](handleEntityNotFound(_0x36b0bf,null))['then'](function(_0x1cc17e){if(_0x1cc17e){_0xcd5a01=_0x1cc17e[_0x6f20('0x60')];_0x4cfa09=_0x1cc17e[_0x6f20('0x61')];var _0x25f773=_0x1cc17e[_0x6f20('0x61')][_0x6f20('0x62')](-0x1);if(_0x25f773==='/'){_0x4cfa09=_0x4cfa09[_0x6f20('0x63')](0x0,_0x4cfa09[_0x6f20('0x64')](_0x25f773));}return rp({'method':_0x6f20('0x65'),'uri':util[_0x6f20('0x66')]('%s%s',_0x4cfa09,_0x6f20('0x67')),'headers':{'Authorization':_0x6f20('0x68')+_0x1cc17e[_0x6f20('0x69')]},'json':!![]});}})[_0x6f20('0x20')](function(_0x4005ac){if(_0x4005ac){var _0x8b4b29=_0x4005ac[_0x6f20('0x6a')];var _0x33a088=![];var _0xbecc14=null;for(_0xbecc14=0x0;_0xbecc14<_0x8b4b29[_0x6f20('0x57')];_0xbecc14++){if(_0x8b4b29[_0xbecc14][_0x6f20('0x6b')]===_0xcd5a01){_0x33a088=!![];}}if(_0x33a088){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x6f20('0x20')](respondWithResult(_0x36b0bf,null))['catch'](function(_0x496241){var _0x56fcbd=_0x28a0ab[_0x6f20('0x3f')]['test']?0x1f4:_0x496241[_0x6f20('0x6c')]||0x1f4;logger['error'](_0x6f20('0x6d'),_0x6f20('0x5f'),_0x56fcbd,JSON[_0x6f20('0x25')](_0x496241));delete _0x496241[_0x6f20('0x35')];if(_0x56fcbd===0x191){_0x56fcbd=0x190;}_0x36b0bf['status'](_0x56fcbd)[_0x6f20('0x36')](_0x28a0ab['query'][_0x6f20('0x1c')]?{'message':_0x6f20('0x6e'),'statusCode':_0x496241['statusCode']}:_0x496241);});}; \ No newline at end of file +var _0x0b08=['hasOwnProperty','nolimit','sort','where','pick','filters','merge','filter','options','includeAll','findAll','rows','show','params','rawAttributes','intersection','find','create','body','catch','FreshsalesConfiguration','order','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','findOne','username','apiKey','remoteUri','substring','lastIndexOf','GET','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','html-pdf','eml-format','fast-json-patch','request-promise','mustache','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','../../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~!@#$%^&-_=+[{]}.','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','send','index','map','FreshsalesAccount','fieldName','type','key','model','name','query','keys','fields','attributes','length'];(function(_0x594413,_0x437c52){var _0xb7ae32=function(_0x3189e6){while(--_0x3189e6){_0x594413['push'](_0x594413['shift']());}};_0xb7ae32(++_0x437c52);}(_0x0b08,0x108));var _0x80b0=function(_0x2976de,_0x4c546d){_0x2976de=_0x2976de-0x0;var _0xecbf51=_0x0b08[_0x2976de];return _0xecbf51;};'use strict';var pdf=require(_0x80b0('0x0'));var emlformat=require(_0x80b0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x80b0('0x2'));var rp=require(_0x80b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x80b0('0x4'));var util=require('util');var path=require(_0x80b0('0x5'));var sox=require(_0x80b0('0x6'));var csv=require('to-csv');var ejs=require(_0x80b0('0x7'));var fs=require('fs');var _=require(_0x80b0('0x8'));var squel=require(_0x80b0('0x9'));var crypto=require(_0x80b0('0xa'));var jsforce=require(_0x80b0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x80b0('0xc'));var querystring=require(_0x80b0('0xd'));var Papa=require(_0x80b0('0xe'));var Redis=require('ioredis');var authService=require(_0x80b0('0xf'));var qs=require(_0x80b0('0x10'));var as=require(_0x80b0('0x11'));var hardwareService=require(_0x80b0('0x12'));var logger=require(_0x80b0('0x13'))(_0x80b0('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x80b0('0x15'))['db'];var integrations=require(_0x80b0('0x16'));var jayson=require(_0x80b0('0x17'));var client=jayson[_0x80b0('0x18')][_0x80b0('0x19')]({'port':0x232a});function checkPasswordPattern(_0x53b096,_0x1cf524,_0x10ec91){if(_0x10ec91){var _0x3e2b94=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e2b94[_0x80b0('0x1a')](_0x1cf524)){return _0x53b096;}else{throw new db[(_0x80b0('0x1b'))][(_0x80b0('0x1c'))](_0x80b0('0x1d'));}}else{return _0x53b096;}}function respondWithRpcPromise(_0xfa137b,_0x146c73,_0x593bf6,_0x2b05ad){return new BPromise(function(_0x4cf603,_0x15ebe6){var _0x4abe8e=_0x2b05ad||client;return _0x4abe8e['request'](_0xfa137b,_0x593bf6)[_0x80b0('0x1e')](function(_0x9f9b43){logger[_0x80b0('0x1f')](_0x80b0('0x20'),_0x146c73,_0x80b0('0x21'));logger[_0x80b0('0x22')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x146c73,'request\x20sent',JSON['stringify'](_0x9f9b43));if(_0x9f9b43[_0x80b0('0x23')]){if(_0x9f9b43[_0x80b0('0x23')]['code']===0x1f4){logger[_0x80b0('0x23')]('FreshsalesAccount,\x20%s,\x20%s',_0x146c73,_0x9f9b43[_0x80b0('0x23')][_0x80b0('0x24')]);return _0x15ebe6(_0x9f9b43['error'][_0x80b0('0x24')]);}logger[_0x80b0('0x23')]('FreshsalesAccount,\x20%s,\x20%s',_0x146c73,_0x9f9b43[_0x80b0('0x23')][_0x80b0('0x24')]);return _0x4cf603(_0x9f9b43['error'][_0x80b0('0x24')]);}else{logger[_0x80b0('0x1f')](_0x80b0('0x20'),_0x146c73,'request\x20sent');_0x4cf603(_0x9f9b43[_0x80b0('0x25')][_0x80b0('0x24')]);}})['catch'](function(_0x409efc){logger['error'](_0x80b0('0x20'),_0x146c73,_0x409efc);_0x15ebe6(_0x409efc);});});}function respondWithStatusCode(_0x256858,_0x1c59e8){_0x1c59e8=_0x1c59e8||0xcc;return function(_0x281515){if(_0x281515){return _0x256858[_0x80b0('0x26')](_0x1c59e8);}return _0x256858[_0x80b0('0x27')](_0x1c59e8)['end']();};}function respondWithResult(_0x8cca01,_0x119cfa){_0x119cfa=_0x119cfa||0xc8;return function(_0x1f9ae2){if(_0x1f9ae2){return _0x8cca01[_0x80b0('0x27')](_0x119cfa)[_0x80b0('0x28')](_0x1f9ae2);}};}function respondWithFilteredResult(_0x2cfd5c,_0x56678d){return function(_0x28feb1){if(_0x28feb1){var _0x30bb8e=_0x28feb1[_0x80b0('0x29')],_0x59a2ed=_0x56678d[_0x80b0('0x2a')],_0x401b59=_0x56678d[_0x80b0('0x2a')]+_0x56678d[_0x80b0('0x2b')],_0x253fc8;if(_0x401b59>=_0x30bb8e){_0x401b59=_0x30bb8e;_0x253fc8=0xc8;}else{_0x253fc8=0xce;}_0x2cfd5c['status'](_0x253fc8);return _0x2cfd5c['set'](_0x80b0('0x2c'),_0x59a2ed+'-'+_0x401b59+'/'+_0x30bb8e)['json'](_0x28feb1);}return null;};}function patchUpdates(_0x2ab5b6){return function(_0x3a0e85){try{jsonpatch['apply'](_0x3a0e85,_0x2ab5b6,!![]);}catch(_0x3d7cc6){return BPromise[_0x80b0('0x2d')](_0x3d7cc6);}return _0x3a0e85[_0x80b0('0x2e')]();};}function saveUpdates(_0x11c030,_0x1de6a3){return function(_0x169d1c){if(_0x169d1c){return _0x169d1c[_0x80b0('0x2f')](_0x11c030)[_0x80b0('0x1e')](function(_0x691e81){return _0x691e81;});}return null;};}function removeEntity(_0x13d174,_0xd94ef7){return function(_0x4357de){if(_0x4357de){return _0x4357de[_0x80b0('0x30')]()[_0x80b0('0x1e')](function(){_0x13d174['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47c5bb,_0x6a9167){return function(_0xd79281){if(!_0xd79281){_0x47c5bb[_0x80b0('0x26')](0x194);}return _0xd79281;};}function handleError(_0x1c7dcf,_0x50ddf9){_0x50ddf9=_0x50ddf9||0x1f4;return function(_0x3323b2){logger[_0x80b0('0x23')](_0x3323b2['stack']);if(_0x3323b2['name']){delete _0x3323b2['name'];}_0x1c7dcf[_0x80b0('0x27')](_0x50ddf9)[_0x80b0('0x31')](_0x3323b2);};}exports[_0x80b0('0x32')]=function(_0x12c8bd,_0x2b763d){var _0x5babbf={},_0x2cf8e4={},_0x4dab62={'count':0x0,'rows':[]};var _0x1df924=_[_0x80b0('0x33')](db[_0x80b0('0x34')]['rawAttributes'],function(_0x1a5db2){return{'name':_0x1a5db2[_0x80b0('0x35')],'type':_0x1a5db2[_0x80b0('0x36')][_0x80b0('0x37')]};});_0x2cf8e4[_0x80b0('0x38')]=_[_0x80b0('0x33')](_0x1df924,_0x80b0('0x39'));_0x2cf8e4[_0x80b0('0x3a')]=_[_0x80b0('0x3b')](_0x12c8bd[_0x80b0('0x3a')]);_0x2cf8e4['filters']=_['intersection'](_0x2cf8e4[_0x80b0('0x38')],_0x2cf8e4['query']);_0x5babbf['attributes']=_['intersection'](_0x2cf8e4['model'],qs[_0x80b0('0x3c')](_0x12c8bd[_0x80b0('0x3a')][_0x80b0('0x3c')]));_0x5babbf[_0x80b0('0x3d')]=_0x5babbf[_0x80b0('0x3d')][_0x80b0('0x3e')]?_0x5babbf[_0x80b0('0x3d')]:_0x2cf8e4[_0x80b0('0x38')];if(!_0x12c8bd[_0x80b0('0x3a')][_0x80b0('0x3f')](_0x80b0('0x40'))){_0x5babbf[_0x80b0('0x2b')]=qs['limit'](_0x12c8bd[_0x80b0('0x3a')]['limit']);_0x5babbf[_0x80b0('0x2a')]=qs[_0x80b0('0x2a')](_0x12c8bd['query'][_0x80b0('0x2a')]);}_0x5babbf['order']=qs[_0x80b0('0x41')](_0x12c8bd[_0x80b0('0x3a')]['sort']);_0x5babbf[_0x80b0('0x42')]=qs['filters'](_[_0x80b0('0x43')](_0x12c8bd[_0x80b0('0x3a')],_0x2cf8e4[_0x80b0('0x44')]));if(_0x12c8bd['query']['filter']){_0x5babbf['where']=_[_0x80b0('0x45')](_0x5babbf[_0x80b0('0x42')],{'$or':_[_0x80b0('0x33')](_0x1df924,function(_0x1c41a9){if(_0x1c41a9[_0x80b0('0x36')]!=='VIRTUAL'){var _0x19ae3b={};_0x19ae3b[_0x1c41a9[_0x80b0('0x39')]]={'$like':'%'+_0x12c8bd['query'][_0x80b0('0x46')]+'%'};return _0x19ae3b;}})});}_0x5babbf=_[_0x80b0('0x45')]({},_0x5babbf,_0x12c8bd[_0x80b0('0x47')]);var _0x18ffc2={'where':_0x5babbf['where']};return db[_0x80b0('0x34')][_0x80b0('0x29')](_0x18ffc2)[_0x80b0('0x1e')](function(_0x286d78){_0x4dab62[_0x80b0('0x29')]=_0x286d78;if(_0x12c8bd[_0x80b0('0x3a')][_0x80b0('0x48')]){_0x5babbf['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x80b0('0x49')](_0x5babbf);})[_0x80b0('0x1e')](function(_0x2ba0a1){_0x4dab62[_0x80b0('0x4a')]=_0x2ba0a1;return _0x4dab62;})[_0x80b0('0x1e')](respondWithFilteredResult(_0x2b763d,_0x5babbf))['catch'](handleError(_0x2b763d,null));};exports[_0x80b0('0x4b')]=function(_0x2cc587,_0x511265){var _0x3a6ab1={'raw':![],'where':{'id':_0x2cc587[_0x80b0('0x4c')]['id']}},_0x51de6c={};_0x51de6c[_0x80b0('0x38')]=_[_0x80b0('0x3b')](db[_0x80b0('0x34')][_0x80b0('0x4d')]);_0x51de6c['query']=_[_0x80b0('0x3b')](_0x2cc587[_0x80b0('0x3a')]);_0x51de6c['filters']=_[_0x80b0('0x4e')](_0x51de6c[_0x80b0('0x38')],_0x51de6c[_0x80b0('0x3a')]);_0x3a6ab1[_0x80b0('0x3d')]=_[_0x80b0('0x4e')](_0x51de6c[_0x80b0('0x38')],qs[_0x80b0('0x3c')](_0x2cc587[_0x80b0('0x3a')]['fields']));_0x3a6ab1['attributes']=_0x3a6ab1[_0x80b0('0x3d')]['length']?_0x3a6ab1[_0x80b0('0x3d')]:_0x51de6c[_0x80b0('0x38')];if(_0x2cc587['query'][_0x80b0('0x48')]){_0x3a6ab1['include']=[{'all':!![]}];}_0x3a6ab1=_[_0x80b0('0x45')]({},_0x3a6ab1,_0x2cc587[_0x80b0('0x47')]);return db[_0x80b0('0x34')][_0x80b0('0x4f')](_0x3a6ab1)['then'](handleEntityNotFound(_0x511265,null))[_0x80b0('0x1e')](respondWithResult(_0x511265,null))['catch'](handleError(_0x511265,null));};exports[_0x80b0('0x50')]=function(_0x3daf15,_0x4646c4){return db[_0x80b0('0x34')][_0x80b0('0x50')](_0x3daf15[_0x80b0('0x51')],{})[_0x80b0('0x1e')](respondWithResult(_0x4646c4,0xc9))['catch'](handleError(_0x4646c4,null));};exports[_0x80b0('0x2f')]=function(_0x26fef7,_0x50a0c1){if(_0x26fef7[_0x80b0('0x51')]['id']){delete _0x26fef7[_0x80b0('0x51')]['id'];}return db[_0x80b0('0x34')]['find']({'where':{'id':_0x26fef7[_0x80b0('0x4c')]['id']}})[_0x80b0('0x1e')](handleEntityNotFound(_0x50a0c1,null))[_0x80b0('0x1e')](saveUpdates(_0x26fef7[_0x80b0('0x51')],null))[_0x80b0('0x1e')](respondWithResult(_0x50a0c1,null))['catch'](handleError(_0x50a0c1,null));};exports[_0x80b0('0x30')]=function(_0x23a52a,_0x307b9d){return db[_0x80b0('0x34')]['find']({'where':{'id':_0x23a52a[_0x80b0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x307b9d,null))['then'](removeEntity(_0x307b9d,null))[_0x80b0('0x52')](handleError(_0x307b9d,null));};exports['getConfigurations']=function(_0x3419ae,_0x38f7c3,_0x57739e){var _0x4029fa={};var _0x193a9a={};var _0x65d1e6;var _0x5bf239;return db[_0x80b0('0x34')]['findOne']({'where':{'id':_0x3419ae[_0x80b0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x38f7c3,null))[_0x80b0('0x1e')](function(_0x164859){if(_0x164859){_0x65d1e6=_0x164859;_0x193a9a['model']=_[_0x80b0('0x3b')](db[_0x80b0('0x53')][_0x80b0('0x4d')]);_0x193a9a[_0x80b0('0x3a')]=_[_0x80b0('0x3b')](_0x3419ae['query']);_0x193a9a[_0x80b0('0x44')]=_[_0x80b0('0x4e')](_0x193a9a[_0x80b0('0x38')],_0x193a9a[_0x80b0('0x3a')]);_0x4029fa[_0x80b0('0x3d')]=_[_0x80b0('0x4e')](_0x193a9a[_0x80b0('0x38')],qs[_0x80b0('0x3c')](_0x3419ae[_0x80b0('0x3a')][_0x80b0('0x3c')]));_0x4029fa[_0x80b0('0x3d')]=_0x4029fa[_0x80b0('0x3d')]['length']?_0x4029fa[_0x80b0('0x3d')]:_0x193a9a[_0x80b0('0x38')];_0x4029fa[_0x80b0('0x54')]=qs['sort'](_0x3419ae['query']['sort']);_0x4029fa[_0x80b0('0x42')]=qs[_0x80b0('0x44')](_[_0x80b0('0x43')](_0x3419ae[_0x80b0('0x3a')],_0x193a9a[_0x80b0('0x44')]));if(_0x3419ae[_0x80b0('0x3a')][_0x80b0('0x46')]){_0x4029fa['where']=_[_0x80b0('0x45')](_0x4029fa[_0x80b0('0x42')],{'$or':_[_0x80b0('0x33')](_0x4029fa['attributes'],function(_0x5a30c2){var _0x5ef95f={};_0x5ef95f[_0x5a30c2]={'$like':'%'+_0x3419ae['query']['filter']+'%'};return _0x5ef95f;})});}_0x4029fa=_[_0x80b0('0x45')]({},_0x4029fa,_0x3419ae[_0x80b0('0x47')]);return _0x65d1e6[_0x80b0('0x55')](_0x4029fa);}})[_0x80b0('0x1e')](function(_0x533709){if(_0x533709){_0x5bf239=_0x533709[_0x80b0('0x3e')];if(!_0x3419ae[_0x80b0('0x3a')][_0x80b0('0x3f')]('nolimit')){_0x4029fa[_0x80b0('0x2b')]=qs[_0x80b0('0x2b')](_0x3419ae[_0x80b0('0x3a')]['limit']);_0x4029fa[_0x80b0('0x2a')]=qs[_0x80b0('0x2a')](_0x3419ae[_0x80b0('0x3a')][_0x80b0('0x2a')]);}return _0x65d1e6[_0x80b0('0x55')](_0x4029fa);}})[_0x80b0('0x1e')](function(_0x204c01){if(_0x204c01){return _0x204c01?{'count':_0x5bf239,'rows':_0x204c01}:null;}})[_0x80b0('0x1e')](respondWithResult(_0x38f7c3,null))['catch'](handleError(_0x38f7c3,null));};exports[_0x80b0('0x56')]=function(_0x2d3441,_0x2509e2,_0x2565c0){if(_0x2d3441[_0x80b0('0x51')]['id']){delete _0x2d3441[_0x80b0('0x51')]['id'];}return db[_0x80b0('0x34')]['findOne']({'where':{'id':_0x2d3441['params']['id']}})[_0x80b0('0x1e')](handleEntityNotFound(_0x2509e2,null))['then'](function(_0x1353fd){if(_0x1353fd){_0x2d3441[_0x80b0('0x51')][_0x80b0('0x57')]=_0x1353fd['id'];_0x2d3441['body'][_0x80b0('0x58')]=integrations['getSubjects'](_0x2d3441['body'][_0x80b0('0x59')],_0x2d3441[_0x80b0('0x51')][_0x80b0('0x36')]);_0x2d3441[_0x80b0('0x51')][_0x80b0('0x5a')]=integrations[_0x80b0('0x5b')](_0x2d3441['body'][_0x80b0('0x59')],_0x2d3441[_0x80b0('0x51')]['type']);return db[_0x80b0('0x53')]['create'](_0x2d3441[_0x80b0('0x51')],{'include':[{'model':db[_0x80b0('0x5c')],'as':'Subjects'},{'model':db[_0x80b0('0x5c')],'as':_0x80b0('0x5a')}]});}return null;})['then'](respondWithResult(_0x2509e2,null))[_0x80b0('0x52')](handleError(_0x2509e2,null));};exports[_0x80b0('0x5d')]=function(_0x35432b,_0x5bd0bd,_0xfaa876){var _0x36ded1='';var _0x1a6585='';return db['FreshsalesAccount'][_0x80b0('0x5e')]({'where':{'id':_0x35432b['params']['id']},'attributes':['id',_0x80b0('0x5f'),'remoteUri',_0x80b0('0x60')]})[_0x80b0('0x1e')](handleEntityNotFound(_0x5bd0bd,null))['then'](function(_0xfe17aa){if(_0xfe17aa){_0x1a6585=_0xfe17aa[_0x80b0('0x5f')];_0x36ded1=_0xfe17aa[_0x80b0('0x61')];var _0x23809e=_0xfe17aa[_0x80b0('0x61')]['slice'](-0x1);if(_0x23809e==='/'){_0x36ded1=_0x36ded1[_0x80b0('0x62')](0x0,_0x36ded1[_0x80b0('0x63')](_0x23809e));}return rp({'method':_0x80b0('0x64'),'uri':util['format']('%s%s',_0x36ded1,_0x80b0('0x65')),'headers':{'Authorization':_0x80b0('0x66')+_0xfe17aa[_0x80b0('0x60')]},'json':!![]});}})['then'](function(_0x4e0387){if(_0x4e0387){var _0x29b4ed=_0x4e0387['users'];var _0x4ab002=![];var _0xf9a4c3=null;for(_0xf9a4c3=0x0;_0xf9a4c3<_0x29b4ed[_0x80b0('0x3e')];_0xf9a4c3++){if(_0x29b4ed[_0xf9a4c3][_0x80b0('0x67')]===_0x1a6585){_0x4ab002=!![];}}if(_0x4ab002){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x80b0('0x68')});}}})[_0x80b0('0x1e')](respondWithResult(_0x5bd0bd,null))[_0x80b0('0x52')](function(_0x46b535){var _0x1b8526=_0x35432b[_0x80b0('0x3a')][_0x80b0('0x1a')]?0x1f4:_0x46b535['statusCode']||0x1f4;logger[_0x80b0('0x23')](_0x80b0('0x69'),_0x80b0('0x5d'),_0x1b8526,JSON[_0x80b0('0x6a')](_0x46b535));delete _0x46b535[_0x80b0('0x39')];if(_0x1b8526===0x191){_0x1b8526=0x190;}_0x5bd0bd[_0x80b0('0x27')](_0x1b8526)[_0x80b0('0x31')](_0x35432b[_0x80b0('0x3a')][_0x80b0('0x1a')]?{'message':_0x80b0('0x6b'),'statusCode':_0x46b535[_0x80b0('0x6c')]}:_0x46b535);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 8a5ae6b..2920393 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9007=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash'];(function(_0x3b6013,_0x346c0e){var _0x837aeb=function(_0x4abd85){while(--_0x4abd85){_0x3b6013['push'](_0x3b6013['shift']());}};_0x837aeb(++_0x346c0e);}(_0x9007,0x1db));var _0x7900=function(_0x4e68aa,_0x77632d){_0x4e68aa=_0x4e68aa-0x0;var _0xfe0a56=_0x9007[_0x4e68aa];return _0xfe0a56;};'use strict';var _=require(_0x7900('0x0'));var util=require(_0x7900('0x1'));var logger=require(_0x7900('0x2'))('api');var moment=require(_0x7900('0x3'));var BPromise=require(_0x7900('0x4'));var rp=require(_0x7900('0x5'));var fs=require('fs');var path=require(_0x7900('0x6'));var rimraf=require(_0x7900('0x7'));var config=require(_0x7900('0x8'));var attributes=require(_0x7900('0x9'));var integrations=require(_0x7900('0xa'));module[_0x7900('0xb')]=function(_0x13c1d2,_0x537274){return _0x13c1d2[_0x7900('0xc')]('FreshsalesAccount',attributes,{'tableName':_0x7900('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a4d=['exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x0a4d,0xad));var _0xd0a4=function(_0x41d5f1,_0x297f25){_0x41d5f1=_0x41d5f1-0x0;var _0x57ab91=_0x0a4d[_0x41d5f1];return _0x57ab91;};'use strict';var _=require('lodash');var util=require(_0xd0a4('0x0'));var logger=require(_0xd0a4('0x1'))(_0xd0a4('0x2'));var moment=require(_0xd0a4('0x3'));var BPromise=require('bluebird');var rp=require(_0xd0a4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0a4('0x5'));var config=require(_0xd0a4('0x6'));var attributes=require(_0xd0a4('0x7'));var integrations=require(_0xd0a4('0x8'));module[_0xd0a4('0x9')]=function(_0x257a92,_0x42e06b){return _0x257a92[_0xd0a4('0xa')](_0xd0a4('0xb'),attributes,{'tableName':_0xd0a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index bfb970c..7eb9234 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f9b=['FreshsalesAccount','options','where','attributes','include','model','ShowFreshsalesAccount','find','map','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesAccount,\x20%s,\x20%s','message','result','GetFreshsalesAccount'];(function(_0x2e4ee7,_0x4bdc11){var _0x49e2e8=function(_0x455ee6){while(--_0x455ee6){_0x2e4ee7['push'](_0x2e4ee7['shift']());}};_0x49e2e8(++_0x4bdc11);}(_0x4f9b,0x6d));var _0xb4f9=function(_0xed16f3,_0x477fc7){_0xed16f3=_0xed16f3-0x0;var _0x16dc72=_0x4f9b[_0xed16f3];return _0x16dc72;};'use strict';var _=require(_0xb4f9('0x0'));var util=require(_0xb4f9('0x1'));var moment=require(_0xb4f9('0x2'));var BPromise=require(_0xb4f9('0x3'));var rs=require(_0xb4f9('0x4'));var fs=require('fs');var Redis=require(_0xb4f9('0x5'));var db=require(_0xb4f9('0x6'))['db'];var utils=require(_0xb4f9('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb4f9('0x8'));var client=jayson[_0xb4f9('0x9')][_0xb4f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e8f3c,_0x37b924,_0xfb58e5){return new BPromise(function(_0x5f21cf,_0x5ecbc5){return client[_0xb4f9('0xb')](_0x4e8f3c,_0xfb58e5)[_0xb4f9('0xc')](function(_0x4a9df3){logger[_0xb4f9('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x37b924,_0xb4f9('0xe'));logger[_0xb4f9('0xf')](_0xb4f9('0x10'),_0x37b924,_0xb4f9('0xe'),JSON[_0xb4f9('0x11')](_0x4a9df3));if(_0x4a9df3[_0xb4f9('0x12')]){if(_0x4a9df3[_0xb4f9('0x12')]['code']===0x1f4){logger[_0xb4f9('0x12')](_0xb4f9('0x13'),_0x37b924,_0x4a9df3[_0xb4f9('0x12')]['message']);return _0x5ecbc5(_0x4a9df3['error'][_0xb4f9('0x14')]);}logger[_0xb4f9('0x12')](_0xb4f9('0x13'),_0x37b924,_0x4a9df3[_0xb4f9('0x12')][_0xb4f9('0x14')]);return _0x5f21cf(_0x4a9df3[_0xb4f9('0x12')][_0xb4f9('0x14')]);}else{logger[_0xb4f9('0xd')](_0xb4f9('0x13'),_0x37b924,_0xb4f9('0xe'));_0x5f21cf(_0x4a9df3[_0xb4f9('0x15')][_0xb4f9('0x14')]);}})['catch'](function(_0x1ad88c){logger[_0xb4f9('0x12')](_0xb4f9('0x13'),_0x37b924,_0x1ad88c);_0x5ecbc5(_0x1ad88c);});});}exports[_0xb4f9('0x16')]=function(_0x53a012){var _0x4d7c24=this;return new Promise(function(_0x4824b1,_0x5f55d6){return db[_0xb4f9('0x17')]['findAll']({'raw':_0x53a012[_0xb4f9('0x18')]?_0x53a012[_0xb4f9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x53a012[_0xb4f9('0x18')]?_0x53a012['options'][_0xb4f9('0x19')]||null:null,'attributes':_0x53a012[_0xb4f9('0x18')]?_0x53a012[_0xb4f9('0x18')][_0xb4f9('0x1a')]||null:null,'limit':_0x53a012[_0xb4f9('0x18')]?_0x53a012[_0xb4f9('0x18')]['limit']||null:null,'include':_0x53a012['options']?_0x53a012['options'][_0xb4f9('0x1b')]?_['map'](_0x53a012[_0xb4f9('0x18')][_0xb4f9('0x1b')],function(_0x3f3444){return{'model':db[_0x3f3444[_0xb4f9('0x1c')]],'as':_0x3f3444['as'],'attributes':_0x3f3444[_0xb4f9('0x1a')],'include':_0x3f3444[_0xb4f9('0x1b')]?_['map'](_0x3f3444[_0xb4f9('0x1b')],function(_0x4e428d){return{'model':db[_0x4e428d[_0xb4f9('0x1c')]],'as':_0x4e428d['as'],'attributes':_0x4e428d[_0xb4f9('0x1a')],'include':_0x4e428d['include']?_['map'](_0x4e428d[_0xb4f9('0x1b')],function(_0x5f4674){return{'model':db[_0x5f4674[_0xb4f9('0x1c')]],'as':_0x5f4674['as'],'attributes':_0x5f4674[_0xb4f9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb4f9('0xc')](function(_0xe5175a){logger[_0xb4f9('0xd')](_0xb4f9('0x16'),_0x53a012);logger[_0xb4f9('0xf')](_0xb4f9('0x16'),_0x53a012,JSON['stringify'](_0xe5175a));_0x4824b1(_0xe5175a);})['catch'](function(_0x5646f4){logger[_0xb4f9('0x12')](_0xb4f9('0x16'),_0x5646f4[_0xb4f9('0x14')],_0x53a012);_0x5f55d6(_0x4d7c24['error'](0x1f4,_0x5646f4[_0xb4f9('0x14')]));});});};exports[_0xb4f9('0x1d')]=function(_0x6e9371){var _0x264a55=this;return new Promise(function(_0x399df5,_0x2d2f9d){return db[_0xb4f9('0x17')][_0xb4f9('0x1e')]({'raw':_0x6e9371['options']?_0x6e9371[_0xb4f9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x6e9371[_0xb4f9('0x18')]?_0x6e9371['options']['where']||null:null,'attributes':_0x6e9371[_0xb4f9('0x18')]?_0x6e9371[_0xb4f9('0x18')][_0xb4f9('0x1a')]||null:null,'include':_0x6e9371[_0xb4f9('0x18')]?_0x6e9371['options'][_0xb4f9('0x1b')]?_[_0xb4f9('0x1f')](_0x6e9371[_0xb4f9('0x18')][_0xb4f9('0x1b')],function(_0x4681b4){return{'model':db[_0x4681b4[_0xb4f9('0x1c')]],'as':_0x4681b4['as'],'attributes':_0x4681b4[_0xb4f9('0x1a')],'include':_0x4681b4[_0xb4f9('0x1b')]?_[_0xb4f9('0x1f')](_0x4681b4[_0xb4f9('0x1b')],function(_0x157396){return{'model':db[_0x157396[_0xb4f9('0x1c')]],'as':_0x157396['as'],'attributes':_0x157396[_0xb4f9('0x1a')],'include':_0x157396['include']?_[_0xb4f9('0x1f')](_0x157396[_0xb4f9('0x1b')],function(_0x58635c){return{'model':db[_0x58635c[_0xb4f9('0x1c')]],'as':_0x58635c['as'],'attributes':_0x58635c[_0xb4f9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb4f9('0xc')](function(_0x176ff6){logger['info'](_0xb4f9('0x1d'),_0x6e9371);logger['debug'](_0xb4f9('0x1d'),_0x6e9371,JSON['stringify'](_0x176ff6));_0x399df5(_0x176ff6);})[_0xb4f9('0x20')](function(_0x4919a8){logger[_0xb4f9('0x12')]('ShowFreshsalesAccount',_0x4919a8[_0xb4f9('0x14')],_0x6e9371);_0x2d2f9d(_0x264a55[_0xb4f9('0x12')](0x1f4,_0x4919a8[_0xb4f9('0x14')]));});});}; \ No newline at end of file +var _0x556a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','map','model','then','catch','find','ShowFreshsalesAccount','lodash','util','moment','bluebird'];(function(_0x4513e8,_0x16f480){var _0x1e8758=function(_0x5c2038){while(--_0x5c2038){_0x4513e8['push'](_0x4513e8['shift']());}};_0x1e8758(++_0x16f480);}(_0x556a,0x1dd));var _0xa556=function(_0x34b727,_0xd967e1){_0x34b727=_0x34b727-0x0;var _0x27c307=_0x556a[_0x34b727];return _0x27c307;};'use strict';var _=require(_0xa556('0x0'));var util=require(_0xa556('0x1'));var moment=require(_0xa556('0x2'));var BPromise=require(_0xa556('0x3'));var rs=require(_0xa556('0x4'));var fs=require('fs');var Redis=require(_0xa556('0x5'));var db=require(_0xa556('0x6'))['db'];var utils=require(_0xa556('0x7'));var logger=require(_0xa556('0x8'))('rpc');var config=require(_0xa556('0x9'));var jayson=require(_0xa556('0xa'));var client=jayson[_0xa556('0xb')][_0xa556('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x358b8c,_0x5a745c,_0x2c9a0c){return new BPromise(function(_0x644538,_0x17c2c2){return client[_0xa556('0xd')](_0x358b8c,_0x2c9a0c)['then'](function(_0x44ea8e){logger[_0xa556('0xe')](_0xa556('0xf'),_0x5a745c,_0xa556('0x10'));logger[_0xa556('0x11')](_0xa556('0x12'),_0x5a745c,_0xa556('0x10'),JSON[_0xa556('0x13')](_0x44ea8e));if(_0x44ea8e['error']){if(_0x44ea8e[_0xa556('0x14')]['code']===0x1f4){logger[_0xa556('0x14')]('FreshsalesAccount,\x20%s,\x20%s',_0x5a745c,_0x44ea8e['error'][_0xa556('0x15')]);return _0x17c2c2(_0x44ea8e[_0xa556('0x14')][_0xa556('0x15')]);}logger[_0xa556('0x14')]('FreshsalesAccount,\x20%s,\x20%s',_0x5a745c,_0x44ea8e[_0xa556('0x14')][_0xa556('0x15')]);return _0x644538(_0x44ea8e[_0xa556('0x14')][_0xa556('0x15')]);}else{logger[_0xa556('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5a745c,'request\x20sent');_0x644538(_0x44ea8e[_0xa556('0x16')][_0xa556('0x15')]);}})['catch'](function(_0x3f8bd7){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x5a745c,_0x3f8bd7);_0x17c2c2(_0x3f8bd7);});});}exports[_0xa556('0x17')]=function(_0x529879){var _0x429a55=this;return new Promise(function(_0x46b205,_0xd68e21){return db[_0xa556('0x18')]['findAll']({'raw':_0x529879[_0xa556('0x19')]?_0x529879[_0xa556('0x19')][_0xa556('0x1a')]===undefined?!![]:![]:!![],'where':_0x529879['options']?_0x529879[_0xa556('0x19')][_0xa556('0x1b')]||null:null,'attributes':_0x529879['options']?_0x529879['options'][_0xa556('0x1c')]||null:null,'limit':_0x529879[_0xa556('0x19')]?_0x529879['options'][_0xa556('0x1d')]||null:null,'include':_0x529879['options']?_0x529879[_0xa556('0x19')][_0xa556('0x1e')]?_[_0xa556('0x1f')](_0x529879[_0xa556('0x19')][_0xa556('0x1e')],function(_0xfb4dda){return{'model':db[_0xfb4dda[_0xa556('0x20')]],'as':_0xfb4dda['as'],'attributes':_0xfb4dda[_0xa556('0x1c')],'include':_0xfb4dda[_0xa556('0x1e')]?_[_0xa556('0x1f')](_0xfb4dda[_0xa556('0x1e')],function(_0xec6fbb){return{'model':db[_0xec6fbb['model']],'as':_0xec6fbb['as'],'attributes':_0xec6fbb[_0xa556('0x1c')],'include':_0xec6fbb[_0xa556('0x1e')]?_['map'](_0xec6fbb[_0xa556('0x1e')],function(_0x169d01){return{'model':db[_0x169d01['model']],'as':_0x169d01['as'],'attributes':_0x169d01[_0xa556('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa556('0x21')](function(_0x157ac5){logger['info'](_0xa556('0x17'),_0x529879);logger[_0xa556('0x11')](_0xa556('0x17'),_0x529879,JSON['stringify'](_0x157ac5));_0x46b205(_0x157ac5);})[_0xa556('0x22')](function(_0x1f5ce4){logger[_0xa556('0x14')](_0xa556('0x17'),_0x1f5ce4[_0xa556('0x15')],_0x529879);_0xd68e21(_0x429a55[_0xa556('0x14')](0x1f4,_0x1f5ce4[_0xa556('0x15')]));});});};exports['ShowFreshsalesAccount']=function(_0x3446f0){var _0x51cb84=this;return new Promise(function(_0x34f2cf,_0x356a0c){return db[_0xa556('0x18')][_0xa556('0x23')]({'raw':_0x3446f0[_0xa556('0x19')]?_0x3446f0[_0xa556('0x19')][_0xa556('0x1a')]===undefined?!![]:![]:!![],'where':_0x3446f0['options']?_0x3446f0[_0xa556('0x19')][_0xa556('0x1b')]||null:null,'attributes':_0x3446f0[_0xa556('0x19')]?_0x3446f0[_0xa556('0x19')][_0xa556('0x1c')]||null:null,'include':_0x3446f0[_0xa556('0x19')]?_0x3446f0[_0xa556('0x19')][_0xa556('0x1e')]?_[_0xa556('0x1f')](_0x3446f0['options'][_0xa556('0x1e')],function(_0x38fec7){return{'model':db[_0x38fec7[_0xa556('0x20')]],'as':_0x38fec7['as'],'attributes':_0x38fec7['attributes'],'include':_0x38fec7[_0xa556('0x1e')]?_[_0xa556('0x1f')](_0x38fec7[_0xa556('0x1e')],function(_0x2addf5){return{'model':db[_0x2addf5['model']],'as':_0x2addf5['as'],'attributes':_0x2addf5[_0xa556('0x1c')],'include':_0x2addf5['include']?_[_0xa556('0x1f')](_0x2addf5['include'],function(_0x201d0c){return{'model':db[_0x201d0c[_0xa556('0x20')]],'as':_0x201d0c['as'],'attributes':_0x201d0c[_0xa556('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa556('0x21')](function(_0x3f9d63){logger['info']('ShowFreshsalesAccount',_0x3446f0);logger[_0xa556('0x11')](_0xa556('0x24'),_0x3446f0,JSON[_0xa556('0x13')](_0x3f9d63));_0x34f2cf(_0x3f9d63);})[_0xa556('0x22')](function(_0x3c557d){logger[_0xa556('0x14')](_0xa556('0x24'),_0x3c557d[_0xa556('0x15')],_0x3446f0);_0x356a0c(_0x51cb84[_0xa556('0x14')](0x1f4,_0x3c557d[_0xa556('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index aba82f9..d4f9107 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3515=['/:id/descriptions','getDescriptions','/:id/fields','getFields','delete','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','index','get','/:id','isAuthenticated','show','/:id/subjects','getSubjects'];(function(_0x3c5a55,_0x2cb32f){var _0x3831f1=function(_0x1c904a){while(--_0x1c904a){_0x3c5a55['push'](_0x3c5a55['shift']());}};_0x3831f1(++_0x2cb32f);}(_0x3515,0xfc));var _0x5351=function(_0x32d26c,_0x50d1cc){_0x32d26c=_0x32d26c-0x0;var _0x43fc68=_0x3515[_0x32d26c];return _0x43fc68;};'use strict';var multer=require(_0x5351('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5351('0x1'));var router=express[_0x5351('0x2')]();var auth=require(_0x5351('0x3'));var interaction=require(_0x5351('0x4'));var config=require(_0x5351('0x5'));var controller=require(_0x5351('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5351('0x7')]);router[_0x5351('0x8')](_0x5351('0x9'),auth[_0x5351('0xa')](),controller[_0x5351('0xb')]);router[_0x5351('0x8')](_0x5351('0xc'),auth[_0x5351('0xa')](),controller[_0x5351('0xd')]);router['get'](_0x5351('0xe'),auth[_0x5351('0xa')](),controller[_0x5351('0xf')]);router[_0x5351('0x8')](_0x5351('0x10'),auth['isAuthenticated'](),controller[_0x5351('0x11')]);router['post']('/',auth[_0x5351('0xa')](),controller['create']);router['put'](_0x5351('0x9'),auth[_0x5351('0xa')](),controller['update']);router[_0x5351('0x12')](_0x5351('0x9'),auth[_0x5351('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3812=['/:id/descriptions','getDescriptions','/:id/fields','getFields','post','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects'];(function(_0x7af628,_0x3613ad){var _0x37606d=function(_0x651806){while(--_0x651806){_0x7af628['push'](_0x7af628['shift']());}};_0x37606d(++_0x3613ad);}(_0x3812,0x1c0));var _0x2381=function(_0x55372c,_0x4a7e98){_0x55372c=_0x55372c-0x0;var _0x2959b7=_0x3812[_0x55372c];return _0x2959b7;};'use strict';var multer=require(_0x2381('0x0'));var util=require(_0x2381('0x1'));var path=require('path');var timeout=require(_0x2381('0x2'));var express=require('express');var router=express[_0x2381('0x3')]();var auth=require(_0x2381('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2381('0x5'));var controller=require(_0x2381('0x6'));router[_0x2381('0x7')]('/',auth['isAuthenticated'](),controller[_0x2381('0x8')]);router[_0x2381('0x7')](_0x2381('0x9'),auth[_0x2381('0xa')](),controller[_0x2381('0xb')]);router[_0x2381('0x7')](_0x2381('0xc'),auth['isAuthenticated'](),controller[_0x2381('0xd')]);router['get'](_0x2381('0xe'),auth[_0x2381('0xa')](),controller[_0x2381('0xf')]);router['get'](_0x2381('0x10'),auth[_0x2381('0xa')](),controller[_0x2381('0x11')]);router[_0x2381('0x12')]('/',auth[_0x2381('0xa')](),controller['create']);router['put'](_0x2381('0x9'),auth[_0x2381('0xa')](),controller['update']);router[_0x2381('0x13')](_0x2381('0x9'),auth[_0x2381('0xa')](),controller['destroy']);module[_0x2381('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index c4d1b03..11fbda6 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f00=['sequelize','exports','STRING'];(function(_0x81061,_0x2d0a69){var _0x51f63c=function(_0x502cf5){while(--_0x502cf5){_0x81061['push'](_0x81061['shift']());}};_0x51f63c(++_0x2d0a69);}(_0x3f00,0x11a));var _0x03f0=function(_0x28d9b6,_0x10f7fd){_0x28d9b6=_0x28d9b6-0x0;var _0x31c3b8=_0x3f00[_0x28d9b6];return _0x31c3b8;};'use strict';var Sequelize=require(_0x03f0('0x0'));module[_0x03f0('0x1')]={'name':{'type':Sequelize[_0x03f0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa70c=['exports','STRING'];(function(_0x473c6f,_0x2d520a){var _0x54af12=function(_0xfa823){while(--_0xfa823){_0x473c6f['push'](_0x473c6f['shift']());}};_0x54af12(++_0x2d520a);}(_0xa70c,0x13a));var _0xca70=function(_0x52ea48,_0x14f622){_0x52ea48=_0x52ea48-0x0;var _0x1f8e44=_0xa70c[_0x52ea48];return _0x1f8e44;};'use strict';var Sequelize=require('sequelize');module[_0xca70('0x0')]={'name':{'type':Sequelize[_0xca70('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 1a1218f..a7aecd3 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbeea=['path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','reject','destroy','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','find','create','body','getSubjects','getDescriptions','FreshsalesField','findOne','getFields','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0xbeea,0xb1));var _0xabee=function(_0x2aa921,_0x3f0b6e){_0x2aa921=_0x2aa921-0x0;var _0x1e3f79=_0xbeea[_0x2aa921];return _0x1e3f79;};'use strict';var pdf=require(_0xabee('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xabee('0x1'));var zipdir=require(_0xabee('0x2'));var jsonpatch=require(_0xabee('0x3'));var rp=require('request-promise');var moment=require(_0xabee('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xabee('0x5'));var util=require(_0xabee('0x6'));var path=require(_0xabee('0x7'));var sox=require(_0xabee('0x8'));var csv=require(_0xabee('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xabee('0xa'));var crypto=require(_0xabee('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xabee('0xc'));var toCsv=require('to-csv');var querystring=require(_0xabee('0xd'));var Papa=require(_0xabee('0xe'));var Redis=require(_0xabee('0xf'));var authService=require(_0xabee('0x10'));var qs=require(_0xabee('0x11'));var as=require(_0xabee('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabee('0x13'))(_0xabee('0x14'));var utils=require(_0xabee('0x15'));var config=require('../../config/environment');var db=require(_0xabee('0x16'))['db'];var jayson=require(_0xabee('0x17'));var client=jayson[_0xabee('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x5915a1,_0x4c5184,_0x4a526b){if(_0x4a526b){var _0x57abc2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57abc2[_0xabee('0x19')](_0x4c5184)){return _0x5915a1;}else{throw new db[(_0xabee('0x1a'))][(_0xabee('0x1b'))](_0xabee('0x1c'));}}else{return _0x5915a1;}}function respondWithRpcPromise(_0x38cf66,_0x5e94ff,_0x177670,_0x2d85a4){return new BPromise(function(_0x2f1107,_0x22b765){var _0x1a3d27=_0x2d85a4||client;return _0x1a3d27[_0xabee('0x1d')](_0x38cf66,_0x177670)[_0xabee('0x1e')](function(_0x5a9562){logger[_0xabee('0x1f')](_0xabee('0x20'),_0x5e94ff,_0xabee('0x21'));logger[_0xabee('0x22')](_0xabee('0x23'),_0x5e94ff,_0xabee('0x21'),JSON['stringify'](_0x5a9562));if(_0x5a9562['error']){if(_0x5a9562[_0xabee('0x24')]['code']===0x1f4){logger['error'](_0xabee('0x20'),_0x5e94ff,_0x5a9562[_0xabee('0x24')][_0xabee('0x25')]);return _0x22b765(_0x5a9562[_0xabee('0x24')][_0xabee('0x25')]);}logger['error'](_0xabee('0x20'),_0x5e94ff,_0x5a9562['error']['message']);return _0x2f1107(_0x5a9562['error'][_0xabee('0x25')]);}else{logger['info'](_0xabee('0x20'),_0x5e94ff,_0xabee('0x21'));_0x2f1107(_0x5a9562[_0xabee('0x26')][_0xabee('0x25')]);}})[_0xabee('0x27')](function(_0x390f7f){logger[_0xabee('0x24')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5e94ff,_0x390f7f);_0x22b765(_0x390f7f);});});}function respondWithStatusCode(_0xdbbf57,_0xfc419d){_0xfc419d=_0xfc419d||0xcc;return function(_0x42277e){if(_0x42277e){return _0xdbbf57[_0xabee('0x28')](_0xfc419d);}return _0xdbbf57['status'](_0xfc419d)[_0xabee('0x29')]();};}function respondWithResult(_0x123d58,_0x4ec9bc){_0x4ec9bc=_0x4ec9bc||0xc8;return function(_0x39da2d){if(_0x39da2d){return _0x123d58[_0xabee('0x2a')](_0x4ec9bc)[_0xabee('0x2b')](_0x39da2d);}};}function respondWithFilteredResult(_0x26a5d1,_0x596f23){return function(_0x3438ac){if(_0x3438ac){var _0x2b7464=_0x3438ac[_0xabee('0x2c')],_0x1b5aee=_0x596f23[_0xabee('0x2d')],_0x37e780=_0x596f23[_0xabee('0x2d')]+_0x596f23[_0xabee('0x2e')],_0x1c4f51;if(_0x37e780>=_0x2b7464){_0x37e780=_0x2b7464;_0x1c4f51=0xc8;}else{_0x1c4f51=0xce;}_0x26a5d1['status'](_0x1c4f51);return _0x26a5d1[_0xabee('0x2f')]('Content-Range',_0x1b5aee+'-'+_0x37e780+'/'+_0x2b7464)[_0xabee('0x2b')](_0x3438ac);}return null;};}function patchUpdates(_0x1ebc01){return function(_0xe0b7bd){try{jsonpatch[_0xabee('0x30')](_0xe0b7bd,_0x1ebc01,!![]);}catch(_0x4c6736){return BPromise[_0xabee('0x31')](_0x4c6736);}return _0xe0b7bd['save']();};}function saveUpdates(_0x4098ec,_0x525e85){return function(_0x123a34){if(_0x123a34){return _0x123a34['update'](_0x4098ec)['then'](function(_0x7dfe55){return _0x7dfe55;});}return null;};}function removeEntity(_0x19f402,_0x3c839e){return function(_0x332ee0){if(_0x332ee0){return _0x332ee0[_0xabee('0x32')]()[_0xabee('0x1e')](function(){_0x19f402[_0xabee('0x2a')](0xcc)[_0xabee('0x29')]();});}};}function handleEntityNotFound(_0x55a27b,_0x261bfb){return function(_0x1e34bf){if(!_0x1e34bf){_0x55a27b[_0xabee('0x28')](0x194);}return _0x1e34bf;};}function handleError(_0x144107,_0x146ae9){_0x146ae9=_0x146ae9||0x1f4;return function(_0x77c942){logger[_0xabee('0x24')](_0x77c942[_0xabee('0x33')]);if(_0x77c942[_0xabee('0x34')]){delete _0x77c942[_0xabee('0x34')];}_0x144107[_0xabee('0x2a')](_0x146ae9)[_0xabee('0x35')](_0x77c942);};}exports[_0xabee('0x36')]=function(_0x2ca217,_0x36733b){var _0x2e2769={},_0x3db173={},_0x491279={'count':0x0,'rows':[]};var _0x559f0a=_[_0xabee('0x37')](db[_0xabee('0x38')][_0xabee('0x39')],function(_0x153c0b){return{'name':_0x153c0b['fieldName'],'type':_0x153c0b[_0xabee('0x3a')][_0xabee('0x3b')]};});_0x3db173[_0xabee('0x3c')]=_['map'](_0x559f0a,_0xabee('0x34'));_0x3db173['query']=_[_0xabee('0x3d')](_0x2ca217[_0xabee('0x3e')]);_0x3db173[_0xabee('0x3f')]=_[_0xabee('0x40')](_0x3db173['model'],_0x3db173['query']);_0x2e2769[_0xabee('0x41')]=_[_0xabee('0x40')](_0x3db173[_0xabee('0x3c')],qs[_0xabee('0x42')](_0x2ca217[_0xabee('0x3e')]['fields']));_0x2e2769[_0xabee('0x41')]=_0x2e2769[_0xabee('0x41')]['length']?_0x2e2769[_0xabee('0x41')]:_0x3db173[_0xabee('0x3c')];if(!_0x2ca217['query'][_0xabee('0x43')](_0xabee('0x44'))){_0x2e2769[_0xabee('0x2e')]=qs[_0xabee('0x2e')](_0x2ca217[_0xabee('0x3e')][_0xabee('0x2e')]);_0x2e2769[_0xabee('0x2d')]=qs['offset'](_0x2ca217[_0xabee('0x3e')][_0xabee('0x2d')]);}_0x2e2769[_0xabee('0x45')]=qs['sort'](_0x2ca217[_0xabee('0x3e')][_0xabee('0x46')]);_0x2e2769['where']=qs[_0xabee('0x3f')](_[_0xabee('0x47')](_0x2ca217['query'],_0x3db173[_0xabee('0x3f')]));if(_0x2ca217[_0xabee('0x3e')][_0xabee('0x48')]){_0x2e2769[_0xabee('0x49')]=_[_0xabee('0x4a')](_0x2e2769[_0xabee('0x49')],{'$or':_[_0xabee('0x37')](_0x559f0a,function(_0x5a5fa7){if(_0x5a5fa7[_0xabee('0x3a')]!==_0xabee('0x4b')){var _0x441af1={};_0x441af1[_0x5a5fa7['name']]={'$like':'%'+_0x2ca217[_0xabee('0x3e')][_0xabee('0x48')]+'%'};return _0x441af1;}})});}_0x2e2769=_['merge']({},_0x2e2769,_0x2ca217['options']);var _0x4b458f={'where':_0x2e2769[_0xabee('0x49')]};return db[_0xabee('0x38')]['count'](_0x4b458f)['then'](function(_0x2b5198){_0x491279[_0xabee('0x2c')]=_0x2b5198;if(_0x2ca217[_0xabee('0x3e')][_0xabee('0x4c')]){_0x2e2769[_0xabee('0x4d')]=[{'all':!![]}];}return db[_0xabee('0x38')][_0xabee('0x4e')](_0x2e2769);})[_0xabee('0x1e')](function(_0xfb2b6f){_0x491279[_0xabee('0x4f')]=_0xfb2b6f;return _0x491279;})[_0xabee('0x1e')](respondWithFilteredResult(_0x36733b,_0x2e2769))[_0xabee('0x27')](handleError(_0x36733b,null));};exports[_0xabee('0x50')]=function(_0x13ad64,_0x3e277d){var _0x252f60={'raw':![],'where':{'id':_0x13ad64[_0xabee('0x51')]['id']}},_0x1b5cf2={};_0x1b5cf2['model']=_[_0xabee('0x3d')](db[_0xabee('0x38')]['rawAttributes']);_0x1b5cf2['query']=_[_0xabee('0x3d')](_0x13ad64[_0xabee('0x3e')]);_0x1b5cf2[_0xabee('0x3f')]=_[_0xabee('0x40')](_0x1b5cf2[_0xabee('0x3c')],_0x1b5cf2[_0xabee('0x3e')]);_0x252f60[_0xabee('0x41')]=_['intersection'](_0x1b5cf2[_0xabee('0x3c')],qs['fields'](_0x13ad64[_0xabee('0x3e')][_0xabee('0x42')]));_0x252f60['attributes']=_0x252f60[_0xabee('0x41')][_0xabee('0x52')]?_0x252f60[_0xabee('0x41')]:_0x1b5cf2['model'];if(_0x13ad64[_0xabee('0x3e')]['includeAll']){_0x252f60[_0xabee('0x4d')]=[{'all':!![]}];}_0x252f60=_[_0xabee('0x4a')]({},_0x252f60,_0x13ad64[_0xabee('0x53')]);return db['FreshsalesConfiguration'][_0xabee('0x54')](_0x252f60)[_0xabee('0x1e')](handleEntityNotFound(_0x3e277d,null))[_0xabee('0x1e')](respondWithResult(_0x3e277d,null))['catch'](handleError(_0x3e277d,null));};exports[_0xabee('0x55')]=function(_0x2bb90a,_0x145f62){return db[_0xabee('0x38')]['create'](_0x2bb90a[_0xabee('0x56')],{})[_0xabee('0x1e')](respondWithResult(_0x145f62,0xc9))[_0xabee('0x27')](handleError(_0x145f62,null));};exports['update']=function(_0x2d7f20,_0x249da7){if(_0x2d7f20[_0xabee('0x56')]['id']){delete _0x2d7f20[_0xabee('0x56')]['id'];}return db[_0xabee('0x38')][_0xabee('0x54')]({'where':{'id':_0x2d7f20[_0xabee('0x51')]['id']}})[_0xabee('0x1e')](handleEntityNotFound(_0x249da7,null))[_0xabee('0x1e')](saveUpdates(_0x2d7f20['body'],null))['then'](respondWithResult(_0x249da7,null))[_0xabee('0x27')](handleError(_0x249da7,null));};exports[_0xabee('0x32')]=function(_0x2f18b8,_0x1dc937){return db[_0xabee('0x38')][_0xabee('0x54')]({'where':{'id':_0x2f18b8['params']['id']}})[_0xabee('0x1e')](handleEntityNotFound(_0x1dc937,null))[_0xabee('0x1e')](removeEntity(_0x1dc937,null))[_0xabee('0x27')](handleError(_0x1dc937,null));};exports['getSubjects']=function(_0x5e2b07,_0x34e7d6,_0x4b1448){var _0x593f3b={};var _0x50eae9={};var _0x3918b3;var _0x5b975b;return db[_0xabee('0x38')]['findOne']({'where':{'id':_0x5e2b07[_0xabee('0x51')]['id']}})['then'](handleEntityNotFound(_0x34e7d6,null))[_0xabee('0x1e')](function(_0x2c88fc){if(_0x2c88fc){_0x3918b3=_0x2c88fc;_0x50eae9[_0xabee('0x3c')]=_[_0xabee('0x3d')](db['FreshsalesField'][_0xabee('0x39')]);_0x50eae9['query']=_[_0xabee('0x3d')](_0x5e2b07[_0xabee('0x3e')]);_0x50eae9[_0xabee('0x3f')]=_[_0xabee('0x40')](_0x50eae9[_0xabee('0x3c')],_0x50eae9[_0xabee('0x3e')]);_0x593f3b[_0xabee('0x41')]=_[_0xabee('0x40')](_0x50eae9['model'],qs[_0xabee('0x42')](_0x5e2b07[_0xabee('0x3e')]['fields']));_0x593f3b[_0xabee('0x41')]=_0x593f3b['attributes'][_0xabee('0x52')]?_0x593f3b[_0xabee('0x41')]:_0x50eae9[_0xabee('0x3c')];_0x593f3b[_0xabee('0x45')]=qs['sort'](_0x5e2b07[_0xabee('0x3e')][_0xabee('0x46')]);_0x593f3b[_0xabee('0x49')]=qs['filters'](_[_0xabee('0x47')](_0x5e2b07[_0xabee('0x3e')],_0x50eae9['filters']));if(_0x5e2b07['query'][_0xabee('0x48')]){_0x593f3b[_0xabee('0x49')]=_['merge'](_0x593f3b[_0xabee('0x49')],{'$or':_['map'](_0x593f3b[_0xabee('0x41')],function(_0x103a32){var _0x5e0133={};_0x5e0133[_0x103a32]={'$like':'%'+_0x5e2b07[_0xabee('0x3e')][_0xabee('0x48')]+'%'};return _0x5e0133;})});}_0x593f3b=_[_0xabee('0x4a')]({},_0x593f3b,_0x5e2b07[_0xabee('0x53')]);return _0x3918b3[_0xabee('0x57')](_0x593f3b);}})[_0xabee('0x1e')](function(_0x5c77a6){if(_0x5c77a6){_0x5b975b=_0x5c77a6[_0xabee('0x52')];if(!_0x5e2b07[_0xabee('0x3e')][_0xabee('0x43')](_0xabee('0x44'))){_0x593f3b['limit']=qs[_0xabee('0x2e')](_0x5e2b07[_0xabee('0x3e')]['limit']);_0x593f3b[_0xabee('0x2d')]=qs[_0xabee('0x2d')](_0x5e2b07[_0xabee('0x3e')]['offset']);}return _0x3918b3[_0xabee('0x57')](_0x593f3b);}})[_0xabee('0x1e')](function(_0x3da7af){if(_0x3da7af){return _0x3da7af?{'count':_0x5b975b,'rows':_0x3da7af}:null;}})[_0xabee('0x1e')](respondWithResult(_0x34e7d6,null))['catch'](handleError(_0x34e7d6,null));};exports[_0xabee('0x58')]=function(_0x5c4aa2,_0x26c8c2,_0xeb4c00){var _0x339100={};var _0x3012eb={};var _0x364386;var _0x424851;return db[_0xabee('0x38')]['findOne']({'where':{'id':_0x5c4aa2[_0xabee('0x51')]['id']}})['then'](handleEntityNotFound(_0x26c8c2,null))[_0xabee('0x1e')](function(_0x359dd5){if(_0x359dd5){_0x364386=_0x359dd5;_0x3012eb['model']=_[_0xabee('0x3d')](db[_0xabee('0x59')]['rawAttributes']);_0x3012eb[_0xabee('0x3e')]=_[_0xabee('0x3d')](_0x5c4aa2[_0xabee('0x3e')]);_0x3012eb['filters']=_[_0xabee('0x40')](_0x3012eb[_0xabee('0x3c')],_0x3012eb['query']);_0x339100[_0xabee('0x41')]=_[_0xabee('0x40')](_0x3012eb['model'],qs[_0xabee('0x42')](_0x5c4aa2[_0xabee('0x3e')][_0xabee('0x42')]));_0x339100['attributes']=_0x339100[_0xabee('0x41')][_0xabee('0x52')]?_0x339100[_0xabee('0x41')]:_0x3012eb[_0xabee('0x3c')];_0x339100[_0xabee('0x45')]=qs[_0xabee('0x46')](_0x5c4aa2[_0xabee('0x3e')][_0xabee('0x46')]);_0x339100[_0xabee('0x49')]=qs[_0xabee('0x3f')](_[_0xabee('0x47')](_0x5c4aa2[_0xabee('0x3e')],_0x3012eb[_0xabee('0x3f')]));if(_0x5c4aa2['query']['filter']){_0x339100[_0xabee('0x49')]=_[_0xabee('0x4a')](_0x339100[_0xabee('0x49')],{'$or':_['map'](_0x339100[_0xabee('0x41')],function(_0x50bb0a){var _0x1b8c0e={};_0x1b8c0e[_0x50bb0a]={'$like':'%'+_0x5c4aa2['query'][_0xabee('0x48')]+'%'};return _0x1b8c0e;})});}_0x339100=_[_0xabee('0x4a')]({},_0x339100,_0x5c4aa2[_0xabee('0x53')]);return _0x364386[_0xabee('0x58')](_0x339100);}})['then'](function(_0x557dc7){if(_0x557dc7){_0x424851=_0x557dc7[_0xabee('0x52')];if(!_0x5c4aa2['query']['hasOwnProperty'](_0xabee('0x44'))){_0x339100[_0xabee('0x2e')]=qs[_0xabee('0x2e')](_0x5c4aa2[_0xabee('0x3e')][_0xabee('0x2e')]);_0x339100[_0xabee('0x2d')]=qs[_0xabee('0x2d')](_0x5c4aa2['query']['offset']);}return _0x364386[_0xabee('0x58')](_0x339100);}})[_0xabee('0x1e')](function(_0x5c49e6){if(_0x5c49e6){return _0x5c49e6?{'count':_0x424851,'rows':_0x5c49e6}:null;}})[_0xabee('0x1e')](respondWithResult(_0x26c8c2,null))[_0xabee('0x27')](handleError(_0x26c8c2,null));};exports['getFields']=function(_0x3ac86e,_0x387ca6,_0x5eb87b){var _0x27f7f2={};var _0x51a3fd={};var _0x18bd84;var _0x2eb7bf;return db[_0xabee('0x38')][_0xabee('0x5a')]({'where':{'id':_0x3ac86e[_0xabee('0x51')]['id']}})[_0xabee('0x1e')](handleEntityNotFound(_0x387ca6,null))[_0xabee('0x1e')](function(_0x1de5c0){if(_0x1de5c0){_0x18bd84=_0x1de5c0;_0x51a3fd[_0xabee('0x3c')]=_[_0xabee('0x3d')](db[_0xabee('0x59')][_0xabee('0x39')]);_0x51a3fd[_0xabee('0x3e')]=_['keys'](_0x3ac86e[_0xabee('0x3e')]);_0x51a3fd[_0xabee('0x3f')]=_[_0xabee('0x40')](_0x51a3fd['model'],_0x51a3fd['query']);_0x27f7f2[_0xabee('0x41')]=_['intersection'](_0x51a3fd[_0xabee('0x3c')],qs[_0xabee('0x42')](_0x3ac86e[_0xabee('0x3e')][_0xabee('0x42')]));_0x27f7f2[_0xabee('0x41')]=_0x27f7f2[_0xabee('0x41')][_0xabee('0x52')]?_0x27f7f2[_0xabee('0x41')]:_0x51a3fd[_0xabee('0x3c')];_0x27f7f2['order']=qs[_0xabee('0x46')](_0x3ac86e['query'][_0xabee('0x46')]);_0x27f7f2['where']=qs['filters'](_[_0xabee('0x47')](_0x3ac86e[_0xabee('0x3e')],_0x51a3fd[_0xabee('0x3f')]));if(_0x3ac86e[_0xabee('0x3e')]['filter']){_0x27f7f2[_0xabee('0x49')]=_[_0xabee('0x4a')](_0x27f7f2['where'],{'$or':_[_0xabee('0x37')](_0x27f7f2[_0xabee('0x41')],function(_0x14d070){var _0x276ae8={};_0x276ae8[_0x14d070]={'$like':'%'+_0x3ac86e[_0xabee('0x3e')][_0xabee('0x48')]+'%'};return _0x276ae8;})});}_0x27f7f2=_[_0xabee('0x4a')]({},_0x27f7f2,_0x3ac86e[_0xabee('0x53')]);return _0x18bd84['getFields'](_0x27f7f2);}})[_0xabee('0x1e')](function(_0x321bcf){if(_0x321bcf){_0x2eb7bf=_0x321bcf['length'];if(!_0x3ac86e[_0xabee('0x3e')][_0xabee('0x43')](_0xabee('0x44'))){_0x27f7f2[_0xabee('0x2e')]=qs[_0xabee('0x2e')](_0x3ac86e['query'][_0xabee('0x2e')]);_0x27f7f2[_0xabee('0x2d')]=qs[_0xabee('0x2d')](_0x3ac86e[_0xabee('0x3e')]['offset']);}return _0x18bd84[_0xabee('0x5b')](_0x27f7f2);}})['then'](function(_0x3dee36){if(_0x3dee36){return _0x3dee36?{'count':_0x2eb7bf,'rows':_0x3dee36}:null;}})['then'](respondWithResult(_0x387ca6,null))[_0xabee('0x27')](handleError(_0x387ca6,null));}; \ No newline at end of file +var _0x2c8f=['map','FreshsalesConfiguration','fieldName','type','query','intersection','attributes','fields','length','model','order','sort','where','pick','filters','filter','merge','VIRTUAL','count','include','findAll','rows','show','rawAttributes','keys','includeAll','options','body','update','find','params','getSubjects','findOne','FreshsalesField','nolimit','getDescriptions','hasOwnProperty','getFields','eml-format','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','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','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','destroy','stack','name'];(function(_0x39cf1c,_0x2a6723){var _0x167799=function(_0x5a24a2){while(--_0x5a24a2){_0x39cf1c['push'](_0x39cf1c['shift']());}};_0x167799(++_0x2a6723);}(_0x2c8f,0x192));var _0xf2c8=function(_0x46ecd2,_0x2d2984){_0x46ecd2=_0x46ecd2-0x0;var _0x36a0e8=_0x2c8f[_0x46ecd2];return _0x36a0e8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf2c8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf2c8('0x1'));var moment=require(_0xf2c8('0x2'));var BPromise=require(_0xf2c8('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf2c8('0x4'));var sox=require(_0xf2c8('0x5'));var csv=require(_0xf2c8('0x6'));var ejs=require(_0xf2c8('0x7'));var fs=require('fs');var _=require(_0xf2c8('0x8'));var squel=require('squel');var crypto=require(_0xf2c8('0x9'));var jsforce=require(_0xf2c8('0xa'));var deskjs=require(_0xf2c8('0xb'));var toCsv=require(_0xf2c8('0x6'));var querystring=require(_0xf2c8('0xc'));var Papa=require(_0xf2c8('0xd'));var Redis=require('ioredis');var authService=require(_0xf2c8('0xe'));var qs=require(_0xf2c8('0xf'));var as=require(_0xf2c8('0x10'));var hardwareService=require(_0xf2c8('0x11'));var logger=require(_0xf2c8('0x12'))(_0xf2c8('0x13'));var utils=require(_0xf2c8('0x14'));var config=require(_0xf2c8('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf2c8('0x16'));var client=jayson['client'][_0xf2c8('0x17')]({'port':0x232a});function checkPasswordPattern(_0x16b7a4,_0x2b6565,_0x46d0c6){if(_0x46d0c6){var _0x37db9b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37db9b[_0xf2c8('0x18')](_0x2b6565)){return _0x16b7a4;}else{throw new db['Sequelize'][(_0xf2c8('0x19'))](_0xf2c8('0x1a'));}}else{return _0x16b7a4;}}function respondWithRpcPromise(_0x9152f1,_0x34f9b1,_0x3ed09e,_0x383af2){return new BPromise(function(_0x1b8c5b,_0x5f37ba){var _0x282094=_0x383af2||client;return _0x282094[_0xf2c8('0x1b')](_0x9152f1,_0x3ed09e)[_0xf2c8('0x1c')](function(_0x31b8e0){logger[_0xf2c8('0x1d')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x34f9b1,'request\x20sent');logger[_0xf2c8('0x1e')](_0xf2c8('0x1f'),_0x34f9b1,_0xf2c8('0x20'),JSON[_0xf2c8('0x21')](_0x31b8e0));if(_0x31b8e0['error']){if(_0x31b8e0[_0xf2c8('0x22')][_0xf2c8('0x23')]===0x1f4){logger[_0xf2c8('0x22')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x34f9b1,_0x31b8e0[_0xf2c8('0x22')][_0xf2c8('0x24')]);return _0x5f37ba(_0x31b8e0['error']['message']);}logger[_0xf2c8('0x22')](_0xf2c8('0x25'),_0x34f9b1,_0x31b8e0[_0xf2c8('0x22')]['message']);return _0x1b8c5b(_0x31b8e0[_0xf2c8('0x22')][_0xf2c8('0x24')]);}else{logger[_0xf2c8('0x1d')](_0xf2c8('0x25'),_0x34f9b1,'request\x20sent');_0x1b8c5b(_0x31b8e0[_0xf2c8('0x26')][_0xf2c8('0x24')]);}})[_0xf2c8('0x27')](function(_0x440b41){logger[_0xf2c8('0x22')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x34f9b1,_0x440b41);_0x5f37ba(_0x440b41);});});}function respondWithStatusCode(_0x93707c,_0x54bbcb){_0x54bbcb=_0x54bbcb||0xcc;return function(_0x3cd344){if(_0x3cd344){return _0x93707c[_0xf2c8('0x28')](_0x54bbcb);}return _0x93707c[_0xf2c8('0x29')](_0x54bbcb)[_0xf2c8('0x2a')]();};}function respondWithResult(_0x1d2e74,_0x3160a5){_0x3160a5=_0x3160a5||0xc8;return function(_0x3ffd20){if(_0x3ffd20){return _0x1d2e74[_0xf2c8('0x29')](_0x3160a5)[_0xf2c8('0x2b')](_0x3ffd20);}};}function respondWithFilteredResult(_0xcf5239,_0xf17065){return function(_0x20af1e){if(_0x20af1e){var _0x311349=_0x20af1e['count'],_0x4e12a2=_0xf17065[_0xf2c8('0x2c')],_0x1cb979=_0xf17065['offset']+_0xf17065[_0xf2c8('0x2d')],_0x5146e4;if(_0x1cb979>=_0x311349){_0x1cb979=_0x311349;_0x5146e4=0xc8;}else{_0x5146e4=0xce;}_0xcf5239[_0xf2c8('0x29')](_0x5146e4);return _0xcf5239[_0xf2c8('0x2e')](_0xf2c8('0x2f'),_0x4e12a2+'-'+_0x1cb979+'/'+_0x311349)[_0xf2c8('0x2b')](_0x20af1e);}return null;};}function patchUpdates(_0x12a547){return function(_0x27a7dc){try{jsonpatch['apply'](_0x27a7dc,_0x12a547,!![]);}catch(_0x27c02e){return BPromise[_0xf2c8('0x30')](_0x27c02e);}return _0x27a7dc[_0xf2c8('0x31')]();};}function saveUpdates(_0x391045,_0x18ed3f){return function(_0x3f43ee){if(_0x3f43ee){return _0x3f43ee['update'](_0x391045)[_0xf2c8('0x1c')](function(_0x5d530b){return _0x5d530b;});}return null;};}function removeEntity(_0x3a01db,_0x4abc1e){return function(_0x25238f){if(_0x25238f){return _0x25238f[_0xf2c8('0x32')]()[_0xf2c8('0x1c')](function(){_0x3a01db[_0xf2c8('0x29')](0xcc)[_0xf2c8('0x2a')]();});}};}function handleEntityNotFound(_0x5b6e0b,_0x3fb2b0){return function(_0x1927bd){if(!_0x1927bd){_0x5b6e0b['sendStatus'](0x194);}return _0x1927bd;};}function handleError(_0x309232,_0x23f6be){_0x23f6be=_0x23f6be||0x1f4;return function(_0x4a24e8){logger[_0xf2c8('0x22')](_0x4a24e8[_0xf2c8('0x33')]);if(_0x4a24e8[_0xf2c8('0x34')]){delete _0x4a24e8[_0xf2c8('0x34')];}_0x309232[_0xf2c8('0x29')](_0x23f6be)['send'](_0x4a24e8);};}exports['index']=function(_0x25abb5,_0x301567){var _0xb48f51={},_0x80c939={},_0x24e728={'count':0x0,'rows':[]};var _0x3a807e=_[_0xf2c8('0x35')](db[_0xf2c8('0x36')]['rawAttributes'],function(_0x2e7c54){return{'name':_0x2e7c54[_0xf2c8('0x37')],'type':_0x2e7c54[_0xf2c8('0x38')]['key']};});_0x80c939['model']=_['map'](_0x3a807e,'name');_0x80c939[_0xf2c8('0x39')]=_['keys'](_0x25abb5[_0xf2c8('0x39')]);_0x80c939['filters']=_[_0xf2c8('0x3a')](_0x80c939['model'],_0x80c939['query']);_0xb48f51[_0xf2c8('0x3b')]=_[_0xf2c8('0x3a')](_0x80c939['model'],qs[_0xf2c8('0x3c')](_0x25abb5[_0xf2c8('0x39')]['fields']));_0xb48f51[_0xf2c8('0x3b')]=_0xb48f51[_0xf2c8('0x3b')][_0xf2c8('0x3d')]?_0xb48f51[_0xf2c8('0x3b')]:_0x80c939[_0xf2c8('0x3e')];if(!_0x25abb5[_0xf2c8('0x39')]['hasOwnProperty']('nolimit')){_0xb48f51[_0xf2c8('0x2d')]=qs['limit'](_0x25abb5[_0xf2c8('0x39')]['limit']);_0xb48f51[_0xf2c8('0x2c')]=qs['offset'](_0x25abb5[_0xf2c8('0x39')][_0xf2c8('0x2c')]);}_0xb48f51[_0xf2c8('0x3f')]=qs[_0xf2c8('0x40')](_0x25abb5['query'][_0xf2c8('0x40')]);_0xb48f51[_0xf2c8('0x41')]=qs['filters'](_[_0xf2c8('0x42')](_0x25abb5[_0xf2c8('0x39')],_0x80c939[_0xf2c8('0x43')]));if(_0x25abb5[_0xf2c8('0x39')][_0xf2c8('0x44')]){_0xb48f51[_0xf2c8('0x41')]=_[_0xf2c8('0x45')](_0xb48f51['where'],{'$or':_[_0xf2c8('0x35')](_0x3a807e,function(_0x37555d){if(_0x37555d[_0xf2c8('0x38')]!==_0xf2c8('0x46')){var _0x593a45={};_0x593a45[_0x37555d['name']]={'$like':'%'+_0x25abb5[_0xf2c8('0x39')][_0xf2c8('0x44')]+'%'};return _0x593a45;}})});}_0xb48f51=_[_0xf2c8('0x45')]({},_0xb48f51,_0x25abb5['options']);var _0xe257cc={'where':_0xb48f51[_0xf2c8('0x41')]};return db['FreshsalesConfiguration']['count'](_0xe257cc)[_0xf2c8('0x1c')](function(_0xce3dd5){_0x24e728[_0xf2c8('0x47')]=_0xce3dd5;if(_0x25abb5[_0xf2c8('0x39')]['includeAll']){_0xb48f51[_0xf2c8('0x48')]=[{'all':!![]}];}return db[_0xf2c8('0x36')][_0xf2c8('0x49')](_0xb48f51);})['then'](function(_0xc78712){_0x24e728[_0xf2c8('0x4a')]=_0xc78712;return _0x24e728;})[_0xf2c8('0x1c')](respondWithFilteredResult(_0x301567,_0xb48f51))['catch'](handleError(_0x301567,null));};exports[_0xf2c8('0x4b')]=function(_0x452b12,_0x24d4a2){var _0x3d90f5={'raw':![],'where':{'id':_0x452b12['params']['id']}},_0x143cd0={};_0x143cd0[_0xf2c8('0x3e')]=_['keys'](db['FreshsalesConfiguration'][_0xf2c8('0x4c')]);_0x143cd0[_0xf2c8('0x39')]=_[_0xf2c8('0x4d')](_0x452b12[_0xf2c8('0x39')]);_0x143cd0[_0xf2c8('0x43')]=_['intersection'](_0x143cd0[_0xf2c8('0x3e')],_0x143cd0[_0xf2c8('0x39')]);_0x3d90f5[_0xf2c8('0x3b')]=_[_0xf2c8('0x3a')](_0x143cd0[_0xf2c8('0x3e')],qs[_0xf2c8('0x3c')](_0x452b12['query']['fields']));_0x3d90f5[_0xf2c8('0x3b')]=_0x3d90f5[_0xf2c8('0x3b')][_0xf2c8('0x3d')]?_0x3d90f5[_0xf2c8('0x3b')]:_0x143cd0[_0xf2c8('0x3e')];if(_0x452b12[_0xf2c8('0x39')][_0xf2c8('0x4e')]){_0x3d90f5[_0xf2c8('0x48')]=[{'all':!![]}];}_0x3d90f5=_['merge']({},_0x3d90f5,_0x452b12[_0xf2c8('0x4f')]);return db[_0xf2c8('0x36')]['find'](_0x3d90f5)['then'](handleEntityNotFound(_0x24d4a2,null))[_0xf2c8('0x1c')](respondWithResult(_0x24d4a2,null))[_0xf2c8('0x27')](handleError(_0x24d4a2,null));};exports['create']=function(_0xb207b,_0x232884){return db[_0xf2c8('0x36')]['create'](_0xb207b[_0xf2c8('0x50')],{})[_0xf2c8('0x1c')](respondWithResult(_0x232884,0xc9))[_0xf2c8('0x27')](handleError(_0x232884,null));};exports[_0xf2c8('0x51')]=function(_0x3b33fb,_0x268fbc){if(_0x3b33fb[_0xf2c8('0x50')]['id']){delete _0x3b33fb[_0xf2c8('0x50')]['id'];}return db['FreshsalesConfiguration'][_0xf2c8('0x52')]({'where':{'id':_0x3b33fb[_0xf2c8('0x53')]['id']}})[_0xf2c8('0x1c')](handleEntityNotFound(_0x268fbc,null))['then'](saveUpdates(_0x3b33fb['body'],null))[_0xf2c8('0x1c')](respondWithResult(_0x268fbc,null))[_0xf2c8('0x27')](handleError(_0x268fbc,null));};exports['destroy']=function(_0xb8c07b,_0x4f9596){return db['FreshsalesConfiguration'][_0xf2c8('0x52')]({'where':{'id':_0xb8c07b[_0xf2c8('0x53')]['id']}})['then'](handleEntityNotFound(_0x4f9596,null))[_0xf2c8('0x1c')](removeEntity(_0x4f9596,null))[_0xf2c8('0x27')](handleError(_0x4f9596,null));};exports[_0xf2c8('0x54')]=function(_0x3d2d39,_0x2f78b1,_0x4f1c78){var _0x19dc1b={};var _0x3601be={};var _0x51e918;var _0x44b578;return db['FreshsalesConfiguration'][_0xf2c8('0x55')]({'where':{'id':_0x3d2d39[_0xf2c8('0x53')]['id']}})[_0xf2c8('0x1c')](handleEntityNotFound(_0x2f78b1,null))[_0xf2c8('0x1c')](function(_0x387497){if(_0x387497){_0x51e918=_0x387497;_0x3601be[_0xf2c8('0x3e')]=_['keys'](db[_0xf2c8('0x56')][_0xf2c8('0x4c')]);_0x3601be[_0xf2c8('0x39')]=_[_0xf2c8('0x4d')](_0x3d2d39[_0xf2c8('0x39')]);_0x3601be['filters']=_[_0xf2c8('0x3a')](_0x3601be[_0xf2c8('0x3e')],_0x3601be[_0xf2c8('0x39')]);_0x19dc1b[_0xf2c8('0x3b')]=_['intersection'](_0x3601be[_0xf2c8('0x3e')],qs[_0xf2c8('0x3c')](_0x3d2d39[_0xf2c8('0x39')][_0xf2c8('0x3c')]));_0x19dc1b[_0xf2c8('0x3b')]=_0x19dc1b[_0xf2c8('0x3b')][_0xf2c8('0x3d')]?_0x19dc1b[_0xf2c8('0x3b')]:_0x3601be[_0xf2c8('0x3e')];_0x19dc1b['order']=qs[_0xf2c8('0x40')](_0x3d2d39[_0xf2c8('0x39')]['sort']);_0x19dc1b[_0xf2c8('0x41')]=qs[_0xf2c8('0x43')](_['pick'](_0x3d2d39[_0xf2c8('0x39')],_0x3601be[_0xf2c8('0x43')]));if(_0x3d2d39[_0xf2c8('0x39')][_0xf2c8('0x44')]){_0x19dc1b['where']=_['merge'](_0x19dc1b[_0xf2c8('0x41')],{'$or':_['map'](_0x19dc1b[_0xf2c8('0x3b')],function(_0x1d46c4){var _0x443e06={};_0x443e06[_0x1d46c4]={'$like':'%'+_0x3d2d39[_0xf2c8('0x39')][_0xf2c8('0x44')]+'%'};return _0x443e06;})});}_0x19dc1b=_[_0xf2c8('0x45')]({},_0x19dc1b,_0x3d2d39['options']);return _0x51e918[_0xf2c8('0x54')](_0x19dc1b);}})[_0xf2c8('0x1c')](function(_0x4dcfd0){if(_0x4dcfd0){_0x44b578=_0x4dcfd0[_0xf2c8('0x3d')];if(!_0x3d2d39[_0xf2c8('0x39')]['hasOwnProperty'](_0xf2c8('0x57'))){_0x19dc1b['limit']=qs[_0xf2c8('0x2d')](_0x3d2d39[_0xf2c8('0x39')]['limit']);_0x19dc1b['offset']=qs['offset'](_0x3d2d39[_0xf2c8('0x39')][_0xf2c8('0x2c')]);}return _0x51e918[_0xf2c8('0x54')](_0x19dc1b);}})[_0xf2c8('0x1c')](function(_0xb5801f){if(_0xb5801f){return _0xb5801f?{'count':_0x44b578,'rows':_0xb5801f}:null;}})[_0xf2c8('0x1c')](respondWithResult(_0x2f78b1,null))['catch'](handleError(_0x2f78b1,null));};exports[_0xf2c8('0x58')]=function(_0x373d14,_0x2a6cba,_0x299cdc){var _0x4ff195={};var _0x5b0b51={};var _0x949a87;var _0x9d63ca;return db[_0xf2c8('0x36')][_0xf2c8('0x55')]({'where':{'id':_0x373d14['params']['id']}})['then'](handleEntityNotFound(_0x2a6cba,null))[_0xf2c8('0x1c')](function(_0x1ad6af){if(_0x1ad6af){_0x949a87=_0x1ad6af;_0x5b0b51[_0xf2c8('0x3e')]=_[_0xf2c8('0x4d')](db['FreshsalesField']['rawAttributes']);_0x5b0b51[_0xf2c8('0x39')]=_[_0xf2c8('0x4d')](_0x373d14[_0xf2c8('0x39')]);_0x5b0b51[_0xf2c8('0x43')]=_[_0xf2c8('0x3a')](_0x5b0b51[_0xf2c8('0x3e')],_0x5b0b51['query']);_0x4ff195[_0xf2c8('0x3b')]=_[_0xf2c8('0x3a')](_0x5b0b51['model'],qs[_0xf2c8('0x3c')](_0x373d14['query'][_0xf2c8('0x3c')]));_0x4ff195['attributes']=_0x4ff195[_0xf2c8('0x3b')][_0xf2c8('0x3d')]?_0x4ff195[_0xf2c8('0x3b')]:_0x5b0b51[_0xf2c8('0x3e')];_0x4ff195[_0xf2c8('0x3f')]=qs['sort'](_0x373d14['query']['sort']);_0x4ff195[_0xf2c8('0x41')]=qs[_0xf2c8('0x43')](_[_0xf2c8('0x42')](_0x373d14['query'],_0x5b0b51[_0xf2c8('0x43')]));if(_0x373d14['query'][_0xf2c8('0x44')]){_0x4ff195['where']=_[_0xf2c8('0x45')](_0x4ff195['where'],{'$or':_[_0xf2c8('0x35')](_0x4ff195[_0xf2c8('0x3b')],function(_0x269d81){var _0x30ca9a={};_0x30ca9a[_0x269d81]={'$like':'%'+_0x373d14[_0xf2c8('0x39')][_0xf2c8('0x44')]+'%'};return _0x30ca9a;})});}_0x4ff195=_[_0xf2c8('0x45')]({},_0x4ff195,_0x373d14[_0xf2c8('0x4f')]);return _0x949a87['getDescriptions'](_0x4ff195);}})[_0xf2c8('0x1c')](function(_0x4f3522){if(_0x4f3522){_0x9d63ca=_0x4f3522[_0xf2c8('0x3d')];if(!_0x373d14['query']['hasOwnProperty']('nolimit')){_0x4ff195['limit']=qs[_0xf2c8('0x2d')](_0x373d14[_0xf2c8('0x39')][_0xf2c8('0x2d')]);_0x4ff195[_0xf2c8('0x2c')]=qs['offset'](_0x373d14[_0xf2c8('0x39')][_0xf2c8('0x2c')]);}return _0x949a87[_0xf2c8('0x58')](_0x4ff195);}})[_0xf2c8('0x1c')](function(_0x48f6b9){if(_0x48f6b9){return _0x48f6b9?{'count':_0x9d63ca,'rows':_0x48f6b9}:null;}})[_0xf2c8('0x1c')](respondWithResult(_0x2a6cba,null))[_0xf2c8('0x27')](handleError(_0x2a6cba,null));};exports['getFields']=function(_0x4d7e27,_0x15bb5d,_0xa68658){var _0x32ce0a={};var _0x4d2686={};var _0x14edd6;var _0x28fdcc;return db[_0xf2c8('0x36')]['findOne']({'where':{'id':_0x4d7e27[_0xf2c8('0x53')]['id']}})[_0xf2c8('0x1c')](handleEntityNotFound(_0x15bb5d,null))[_0xf2c8('0x1c')](function(_0x84457d){if(_0x84457d){_0x14edd6=_0x84457d;_0x4d2686[_0xf2c8('0x3e')]=_[_0xf2c8('0x4d')](db['FreshsalesField'][_0xf2c8('0x4c')]);_0x4d2686[_0xf2c8('0x39')]=_[_0xf2c8('0x4d')](_0x4d7e27[_0xf2c8('0x39')]);_0x4d2686[_0xf2c8('0x43')]=_[_0xf2c8('0x3a')](_0x4d2686['model'],_0x4d2686[_0xf2c8('0x39')]);_0x32ce0a[_0xf2c8('0x3b')]=_[_0xf2c8('0x3a')](_0x4d2686[_0xf2c8('0x3e')],qs[_0xf2c8('0x3c')](_0x4d7e27['query'][_0xf2c8('0x3c')]));_0x32ce0a[_0xf2c8('0x3b')]=_0x32ce0a[_0xf2c8('0x3b')]['length']?_0x32ce0a[_0xf2c8('0x3b')]:_0x4d2686[_0xf2c8('0x3e')];_0x32ce0a[_0xf2c8('0x3f')]=qs[_0xf2c8('0x40')](_0x4d7e27[_0xf2c8('0x39')]['sort']);_0x32ce0a['where']=qs[_0xf2c8('0x43')](_['pick'](_0x4d7e27[_0xf2c8('0x39')],_0x4d2686[_0xf2c8('0x43')]));if(_0x4d7e27[_0xf2c8('0x39')]['filter']){_0x32ce0a[_0xf2c8('0x41')]=_[_0xf2c8('0x45')](_0x32ce0a[_0xf2c8('0x41')],{'$or':_[_0xf2c8('0x35')](_0x32ce0a[_0xf2c8('0x3b')],function(_0x1cf5fa){var _0x8acd72={};_0x8acd72[_0x1cf5fa]={'$like':'%'+_0x4d7e27[_0xf2c8('0x39')][_0xf2c8('0x44')]+'%'};return _0x8acd72;})});}_0x32ce0a=_[_0xf2c8('0x45')]({},_0x32ce0a,_0x4d7e27[_0xf2c8('0x4f')]);return _0x14edd6['getFields'](_0x32ce0a);}})['then'](function(_0x17352c){if(_0x17352c){_0x28fdcc=_0x17352c[_0xf2c8('0x3d')];if(!_0x4d7e27[_0xf2c8('0x39')][_0xf2c8('0x59')](_0xf2c8('0x57'))){_0x32ce0a[_0xf2c8('0x2d')]=qs[_0xf2c8('0x2d')](_0x4d7e27[_0xf2c8('0x39')][_0xf2c8('0x2d')]);_0x32ce0a[_0xf2c8('0x2c')]=qs[_0xf2c8('0x2c')](_0x4d7e27[_0xf2c8('0x39')][_0xf2c8('0x2c')]);}return _0x14edd6[_0xf2c8('0x5a')](_0x32ce0a);}})[_0xf2c8('0x1c')](function(_0x5abd3d){if(_0x5abd3d){return _0x5abd3d?{'count':_0x28fdcc,'rows':_0x5abd3d}:null;}})[_0xf2c8('0x1c')](respondWithResult(_0x15bb5d,null))[_0xf2c8('0x27')](handleError(_0x15bb5d,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 54fef56..547ee1b 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0962=['../../config/environment','./intFreshsalesConfiguration.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3b641c,_0x13fbf9){var _0x5d3e6f=function(_0x3a1e6b){while(--_0x3a1e6b){_0x3b641c['push'](_0x3b641c['shift']());}};_0x5d3e6f(++_0x13fbf9);}(_0x0962,0x116));var _0x2096=function(_0xe5782,_0x18a38e){_0xe5782=_0xe5782-0x0;var _0x4afe80=_0x0962[_0xe5782];return _0x4afe80;};'use strict';var _=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var logger=require(_0x2096('0x2'))(_0x2096('0x3'));var moment=require(_0x2096('0x4'));var BPromise=require(_0x2096('0x5'));var rp=require(_0x2096('0x6'));var fs=require('fs');var path=require(_0x2096('0x7'));var rimraf=require('rimraf');var config=require(_0x2096('0x8'));var attributes=require(_0x2096('0x9'));module['exports']=function(_0x233148,_0x38b92b){return _0x233148[_0x2096('0xa')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe235=['api','request-promise','path','rimraf','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0x1a72de,_0x1904fd){var _0x2c7a60=function(_0x3464f3){while(--_0x3464f3){_0x1a72de['push'](_0x1a72de['shift']());}};_0x2c7a60(++_0x1904fd);}(_0xe235,0xe4));var _0x5e23=function(_0x43eb68,_0x34acfe){_0x43eb68=_0x43eb68-0x0;var _0x451a50=_0xe235[_0x43eb68];return _0x451a50;};'use strict';var _=require(_0x5e23('0x0'));var util=require(_0x5e23('0x1'));var logger=require(_0x5e23('0x2'))(_0x5e23('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5e23('0x4'));var fs=require('fs');var path=require(_0x5e23('0x5'));var rimraf=require(_0x5e23('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x5e23('0x7')]=function(_0x37c8a7,_0x1b49b2){return _0x37c8a7[_0x5e23('0x8')](_0x5e23('0x9'),attributes,{'tableName':_0x5e23('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 7ae4e2b..13b1823 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c00=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis'];(function(_0x2f4635,_0x5b5805){var _0x197052=function(_0x1659cc){while(--_0x1659cc){_0x2f4635['push'](_0x2f4635['shift']());}};_0x197052(++_0x5b5805);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4b7b9b,_0xa4aff9){_0x4b7b9b=_0x4b7b9b-0x0;var _0x3be710=_0x9c00[_0x4b7b9b];return _0x3be710;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x09c0('0x2'));var fs=require('fs');var Redis=require(_0x09c0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09c0('0x4'));var logger=require(_0x09c0('0x5'))(_0x09c0('0x6'));var config=require(_0x09c0('0x7'));var jayson=require(_0x09c0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f3d7e,_0x17d11f,_0x1b633b){return new BPromise(function(_0x3187aa,_0x17cd9d){return client['request'](_0x1f3d7e,_0x1b633b)[_0x09c0('0x9')](function(_0x1c1246){logger[_0x09c0('0xa')](_0x09c0('0xb'),_0x17d11f,_0x09c0('0xc'));logger[_0x09c0('0xd')](_0x09c0('0xe'),_0x17d11f,_0x09c0('0xc'),JSON[_0x09c0('0xf')](_0x1c1246));if(_0x1c1246[_0x09c0('0x10')]){if(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x11')]===0x1f4){logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);return _0x17cd9d(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);}logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);return _0x3187aa(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);}else{logger[_0x09c0('0xa')](_0x09c0('0xb'),_0x17d11f,'request\x20sent');_0x3187aa(_0x1c1246['result']['message']);}})[_0x09c0('0x13')](function(_0x11f4b2){logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x11f4b2);_0x17cd9d(_0x11f4b2);});});} \ No newline at end of file +var _0x0565=['client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2421c4,_0x37997c){var _0x49dbd7=function(_0x4804c0){while(--_0x4804c0){_0x2421c4['push'](_0x2421c4['shift']());}};_0x49dbd7(++_0x37997c);}(_0x0565,0xf2));var _0x5056=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x0565[_0x49b207];return _0x2dc8fa;};'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']('FreshsalesConfiguration,\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);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 262348d..b4f3675 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f60=['isAuthenticated','create','put','/:id','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','post'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x6f60,0x15a));var _0x06f6=function(_0x216f7a,_0x1a9828){_0x216f7a=_0x216f7a-0x0;var _0x54feae=_0x6f60[_0x216f7a];return _0x54feae;};'use strict';var multer=require(_0x06f6('0x0'));var util=require(_0x06f6('0x1'));var path=require('path');var timeout=require(_0x06f6('0x2'));var express=require(_0x06f6('0x3'));var router=express[_0x06f6('0x4')]();var auth=require(_0x06f6('0x5'));var interaction=require(_0x06f6('0x6'));var config=require(_0x06f6('0x7'));var controller=require('./intFreshsalesField.controller');router[_0x06f6('0x8')]('/',auth['isAuthenticated'](),controller[_0x06f6('0x9')]);router[_0x06f6('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x06f6('0xa')]('/',auth[_0x06f6('0xb')](),controller[_0x06f6('0xc')]);router[_0x06f6('0xd')](_0x06f6('0xe'),auth[_0x06f6('0xb')](),controller[_0x06f6('0xf')]);router['delete'](_0x06f6('0xe'),auth['isAuthenticated'](),controller[_0x06f6('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe49f=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','post','create','put','update','/:id','destroy','multer','util'];(function(_0x1dfe96,_0xacd7bf){var _0x23bb8a=function(_0x2f9f1a){while(--_0x2f9f1a){_0x1dfe96['push'](_0x1dfe96['shift']());}};_0x23bb8a(++_0xacd7bf);}(_0xe49f,0xb9));var _0xfe49=function(_0x2c7c7d,_0x26f5cd){_0x2c7c7d=_0x2c7c7d-0x0;var _0x1e8ec7=_0xe49f[_0x2c7c7d];return _0x1e8ec7;};'use strict';var multer=require(_0xfe49('0x0'));var util=require(_0xfe49('0x1'));var path=require(_0xfe49('0x2'));var timeout=require('connect-timeout');var express=require(_0xfe49('0x3'));var router=express[_0xfe49('0x4')]();var auth=require(_0xfe49('0x5'));var interaction=require(_0xfe49('0x6'));var config=require(_0xfe49('0x7'));var controller=require(_0xfe49('0x8'));router[_0xfe49('0x9')]('/',auth[_0xfe49('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfe49('0xb')]('/',auth[_0xfe49('0xa')](),controller[_0xfe49('0xc')]);router[_0xfe49('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xfe49('0xe')]);router['delete'](_0xfe49('0xf'),auth[_0xfe49('0xa')](),controller[_0xfe49('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index e40e99a..2320e7f 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd66c=['customVariable','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x3de235,_0x51796e){var _0x2569e1=function(_0x1edfb2){while(--_0x1edfb2){_0x3de235['push'](_0x3de235['shift']());}};_0x2569e1(++_0x51796e);}(_0xd66c,0x106));var _0xcd66=function(_0x5b1931,_0x3d62f4){_0x5b1931=_0x5b1931-0x0;var _0x47bc23=_0xd66c[_0x5b1931];return _0x47bc23;};'use strict';var Sequelize=require(_0xcd66('0x0'));module['exports']={'type':{'type':Sequelize[_0xcd66('0x1')](_0xcd66('0x2'),_0xcd66('0x3'),_0xcd66('0x4'),'keyValue'),'defaultValue':_0xcd66('0x2')},'content':{'type':Sequelize[_0xcd66('0x5')]},'key':{'type':Sequelize[_0xcd66('0x5')]},'keyType':{'type':Sequelize[_0xcd66('0x1')](_0xcd66('0x2'),_0xcd66('0x3'),_0xcd66('0x4'))},'keyContent':{'type':Sequelize[_0xcd66('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xcd66('0x5')]},'customField':{'type':Sequelize[_0xcd66('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcd66('0x5')]}}; \ No newline at end of file +var _0xebb1=['STRING','variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue'];(function(_0xa84536,_0x15e7fc){var _0x2eea26=function(_0x1d132a){while(--_0x1d132a){_0xa84536['push'](_0xa84536['shift']());}};_0x2eea26(++_0x15e7fc);}(_0xebb1,0x1d8));var _0x1ebb=function(_0x167791,_0x2b9890){_0x167791=_0x167791-0x0;var _0x599f82=_0xebb1[_0x167791];return _0x599f82;};'use strict';var Sequelize=require(_0x1ebb('0x0'));module[_0x1ebb('0x1')]={'type':{'type':Sequelize[_0x1ebb('0x2')](_0x1ebb('0x3'),'variable','customVariable',_0x1ebb('0x4')),'defaultValue':_0x1ebb('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1ebb('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x1ebb('0x6'),_0x1ebb('0x7'))},'keyContent':{'type':Sequelize[_0x1ebb('0x5')]},'idField':{'type':Sequelize[_0x1ebb('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1ebb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1ebb('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 4a53e80..f01bb6f 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','pick','filter','where','merge','options','FreshsalesField','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','count','offset','json','apply','reject','update','then','destroy'];(function(_0x2953da,_0x5b85d4){var _0x311737=function(_0x59a88a){while(--_0x59a88a){_0x2953da['push'](_0x2953da['shift']());}};_0x311737(++_0x5b85d4);}(_0xaa88,0x137));var _0x8aa8=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0xaa88[_0x2742db];return _0x18659e;};'use strict';var pdf=require(_0x8aa8('0x0'));var emlformat=require(_0x8aa8('0x1'));var rimraf=require(_0x8aa8('0x2'));var zipdir=require(_0x8aa8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8aa8('0x4'));var moment=require(_0x8aa8('0x5'));var BPromise=require(_0x8aa8('0x6'));var Mustache=require(_0x8aa8('0x7'));var util=require(_0x8aa8('0x8'));var path=require(_0x8aa8('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8aa8('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x370b25,_0xa691d6){_0xa691d6=_0xa691d6||0xcc;return function(_0x28132f){if(_0x28132f){return _0x370b25['sendStatus'](_0xa691d6);}return _0x370b25[_0x8aa8('0x18')](_0xa691d6)[_0x8aa8('0x19')]();};}function respondWithResult(_0x2fa66f,_0x4b686e){_0x4b686e=_0x4b686e||0xc8;return function(_0x391642){if(_0x391642){return _0x2fa66f['status'](_0x4b686e)['json'](_0x391642);}};}function respondWithFilteredResult(_0x433e95,_0x200662){return function(_0xae81a0){if(_0xae81a0){var _0xa6c2af=_0xae81a0[_0x8aa8('0x1a')],_0x42a6a4=_0x200662[_0x8aa8('0x1b')],_0x3778f4=_0x200662['offset']+_0x200662['limit'],_0x1bdd39;if(_0x3778f4>=_0xa6c2af){_0x3778f4=_0xa6c2af;_0x1bdd39=0xc8;}else{_0x1bdd39=0xce;}_0x433e95[_0x8aa8('0x18')](_0x1bdd39);return _0x433e95['set']('Content-Range',_0x42a6a4+'-'+_0x3778f4+'/'+_0xa6c2af)[_0x8aa8('0x1c')](_0xae81a0);}return null;};}function patchUpdates(_0x5ac0d9){return function(_0x438198){try{jsonpatch[_0x8aa8('0x1d')](_0x438198,_0x5ac0d9,!![]);}catch(_0x2a9f56){return BPromise[_0x8aa8('0x1e')](_0x2a9f56);}return _0x438198['save']();};}function saveUpdates(_0xcc2c19,_0x36c445){return function(_0x2825fd){if(_0x2825fd){return _0x2825fd[_0x8aa8('0x1f')](_0xcc2c19)[_0x8aa8('0x20')](function(_0x34f1b7){return _0x34f1b7;});}return null;};}function removeEntity(_0x5d9b62,_0x26cf63){return function(_0x4cc455){if(_0x4cc455){return _0x4cc455[_0x8aa8('0x21')]()['then'](function(){_0x5d9b62[_0x8aa8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(!_0x3ca7dc){_0x65945b['sendStatus'](0x194);}return _0x3ca7dc;};}function handleError(_0x24f428,_0xe978ab){_0xe978ab=_0xe978ab||0x1f4;return function(_0x15b235){logger['error'](_0x15b235['stack']);if(_0x15b235[_0x8aa8('0x22')]){delete _0x15b235[_0x8aa8('0x22')];}_0x24f428[_0x8aa8('0x18')](_0xe978ab)[_0x8aa8('0x23')](_0x15b235);};}exports[_0x8aa8('0x24')]=function(_0x4a8212,_0x2bc34a){var _0x49d561={},_0x2a0ff2={},_0xe7768={'count':0x0,'rows':[]};var _0x15ff33=_['map'](db['FreshsalesField'][_0x8aa8('0x25')],function(_0x5e96c9){return{'name':_0x5e96c9[_0x8aa8('0x26')],'type':_0x5e96c9[_0x8aa8('0x27')][_0x8aa8('0x28')]};});_0x2a0ff2[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](_0x15ff33,'name');_0x2a0ff2[_0x8aa8('0x2b')]=_[_0x8aa8('0x2c')](_0x4a8212['query']);_0x2a0ff2[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x2a0ff2[_0x8aa8('0x29')],_0x2a0ff2['query']);_0x49d561[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x2a0ff2[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4a8212[_0x8aa8('0x2b')][_0x8aa8('0x30')]));_0x49d561[_0x8aa8('0x2f')]=_0x49d561[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x49d561[_0x8aa8('0x2f')]:_0x2a0ff2[_0x8aa8('0x29')];if(!_0x4a8212['query']['hasOwnProperty'](_0x8aa8('0x32'))){_0x49d561[_0x8aa8('0x33')]=qs[_0x8aa8('0x33')](_0x4a8212[_0x8aa8('0x2b')][_0x8aa8('0x33')]);_0x49d561[_0x8aa8('0x1b')]=qs['offset'](_0x4a8212['query'][_0x8aa8('0x1b')]);}_0x49d561['order']=qs[_0x8aa8('0x34')](_0x4a8212[_0x8aa8('0x2b')][_0x8aa8('0x34')]);_0x49d561['where']=qs[_0x8aa8('0x2d')](_[_0x8aa8('0x35')](_0x4a8212[_0x8aa8('0x2b')],_0x2a0ff2['filters']));if(_0x4a8212['query'][_0x8aa8('0x36')]){_0x49d561[_0x8aa8('0x37')]=_['merge'](_0x49d561[_0x8aa8('0x37')],{'$or':_[_0x8aa8('0x2a')](_0x15ff33,function(_0x5c65fe){if(_0x5c65fe[_0x8aa8('0x27')]!=='VIRTUAL'){var _0x530a66={};_0x530a66[_0x5c65fe[_0x8aa8('0x22')]]={'$like':'%'+_0x4a8212['query'][_0x8aa8('0x36')]+'%'};return _0x530a66;}})});}_0x49d561=_[_0x8aa8('0x38')]({},_0x49d561,_0x4a8212[_0x8aa8('0x39')]);var _0x39b063={'where':_0x49d561['where']};return db[_0x8aa8('0x3a')][_0x8aa8('0x1a')](_0x39b063)['then'](function(_0x40867c){_0xe7768[_0x8aa8('0x1a')]=_0x40867c;if(_0x4a8212['query'][_0x8aa8('0x3b')]){_0x49d561[_0x8aa8('0x3c')]=[{'all':!![]}];}return db[_0x8aa8('0x3a')][_0x8aa8('0x3d')](_0x49d561);})[_0x8aa8('0x20')](function(_0xea42cb){_0xe7768[_0x8aa8('0x3e')]=_0xea42cb;return _0xe7768;})[_0x8aa8('0x20')](respondWithFilteredResult(_0x2bc34a,_0x49d561))[_0x8aa8('0x3f')](handleError(_0x2bc34a,null));};exports[_0x8aa8('0x40')]=function(_0x36c842,_0x36c48b){var _0x17c730={'raw':!![],'where':{'id':_0x36c842[_0x8aa8('0x41')]['id']}},_0x36325f={};_0x36325f[_0x8aa8('0x29')]=_['keys'](db[_0x8aa8('0x3a')]['rawAttributes']);_0x36325f['query']=_['keys'](_0x36c842[_0x8aa8('0x2b')]);_0x36325f['filters']=_['intersection'](_0x36325f[_0x8aa8('0x29')],_0x36325f['query']);_0x17c730[_0x8aa8('0x2f')]=_['intersection'](_0x36325f['model'],qs[_0x8aa8('0x30')](_0x36c842[_0x8aa8('0x2b')][_0x8aa8('0x30')]));_0x17c730[_0x8aa8('0x2f')]=_0x17c730[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x17c730[_0x8aa8('0x2f')]:_0x36325f['model'];if(_0x36c842[_0x8aa8('0x2b')]['includeAll']){_0x17c730[_0x8aa8('0x3c')]=[{'all':!![]}];}_0x17c730=_[_0x8aa8('0x38')]({},_0x17c730,_0x36c842[_0x8aa8('0x39')]);return db[_0x8aa8('0x3a')][_0x8aa8('0x42')](_0x17c730)[_0x8aa8('0x20')](handleEntityNotFound(_0x36c48b,null))['then'](respondWithResult(_0x36c48b,null))['catch'](handleError(_0x36c48b,null));};exports[_0x8aa8('0x43')]=function(_0x48b89b,_0x5e1d3a){return db[_0x8aa8('0x3a')][_0x8aa8('0x43')](_0x48b89b[_0x8aa8('0x44')],{})['then'](respondWithResult(_0x5e1d3a,0xc9))['catch'](handleError(_0x5e1d3a,null));};exports['update']=function(_0x4e05e7,_0x2bd2ae){if(_0x4e05e7[_0x8aa8('0x44')]['id']){delete _0x4e05e7['body']['id'];}return db[_0x8aa8('0x3a')][_0x8aa8('0x42')]({'where':{'id':_0x4e05e7[_0x8aa8('0x41')]['id']}})[_0x8aa8('0x20')](handleEntityNotFound(_0x2bd2ae,null))[_0x8aa8('0x20')](saveUpdates(_0x4e05e7[_0x8aa8('0x44')],null))['then'](respondWithResult(_0x2bd2ae,null))['catch'](handleError(_0x2bd2ae,null));};exports[_0x8aa8('0x21')]=function(_0x546988,_0x20c368){return db['FreshsalesField'][_0x8aa8('0x42')]({'where':{'id':_0x546988[_0x8aa8('0x41')]['id']}})[_0x8aa8('0x20')](handleEntityNotFound(_0x20c368,null))[_0x8aa8('0x20')](removeEntity(_0x20c368,null))[_0x8aa8('0x3f')](handleError(_0x20c368,null));}; \ No newline at end of file +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','FreshsalesField','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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5c00,0x17e));var _0x05c0=function(_0x3fd4b3,_0x17d3ef){_0x3fd4b3=_0x3fd4b3-0x0;var _0x2979a3=_0x5c00[_0x3fd4b3];return _0x2979a3;};'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['FreshsalesField']['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['FreshsalesField']['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['FreshsalesField'][_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['FreshsalesField'][_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['FreshsalesField'][_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 diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index a4315d6..8fd352a 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b10=['../../config/environment','define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x1ed736,_0x1247eb){var _0x3b2856=function(_0x556f02){while(--_0x556f02){_0x1ed736['push'](_0x1ed736['shift']());}};_0x3b2856(++_0x1247eb);}(_0x3b10,0xea));var _0x03b1=function(_0x141736,_0x3d0aa9){_0x141736=_0x141736-0x0;var _0x137537=_0x3b10[_0x141736];return _0x137537;};'use strict';var _=require(_0x03b1('0x0'));var util=require(_0x03b1('0x1'));var logger=require(_0x03b1('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x03b1('0x3'));var fs=require('fs');var path=require(_0x03b1('0x4'));var rimraf=require(_0x03b1('0x5'));var config=require(_0x03b1('0x6'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x1299a4,_0x140dec){return _0x1299a4[_0x03b1('0x7')]('FreshsalesField',attributes,{'tableName':_0x03b1('0x8'),'paranoid':![],'indexes':[{'name':_0x03b1('0x9'),'fields':[_0x03b1('0xa'),_0x03b1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb338=['../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','idField','FieldId','lodash','api','moment','bluebird'];(function(_0x1ad990,_0x219d08){var _0x4f1580=function(_0x3b6f26){while(--_0x3b6f26){_0x1ad990['push'](_0x1ad990['shift']());}};_0x4f1580(++_0x219d08);}(_0xb338,0x16e));var _0x8b33=function(_0xbe41ba,_0x384563){_0xbe41ba=_0xbe41ba-0x0;var _0x2c2085=_0xb338[_0xbe41ba];return _0x2c2085;};'use strict';var _=require(_0x8b33('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8b33('0x1'));var moment=require(_0x8b33('0x2'));var BPromise=require(_0x8b33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8b33('0x4'));var attributes=require(_0x8b33('0x5'));module['exports']=function(_0x1808fb,_0x49545d){return _0x1808fb[_0x8b33('0x6')](_0x8b33('0x7'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x8b33('0x8'),_0x8b33('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index ee8b3a9..dd04567 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x195f=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x195f,0x101));var _0xf195=function(_0x4254e7,_0x4fc342){_0x4254e7=_0x4254e7-0x0;var _0x5e0844=_0x195f[_0x4254e7];return _0x5e0844;};'use strict';var _=require('lodash');var util=require(_0xf195('0x0'));var moment=require(_0xf195('0x1'));var BPromise=require(_0xf195('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf195('0x3'));var logger=require(_0xf195('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf195('0x5'));var client=jayson[_0xf195('0x6')][_0xf195('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2e5883,_0x4dcdc8,_0x5d5752){return new BPromise(function(_0x51443b,_0x41ff55){return client[_0xf195('0x8')](_0x2e5883,_0x5d5752)[_0xf195('0x9')](function(_0x4e17cc){logger[_0xf195('0xa')](_0xf195('0xb'),_0x4dcdc8,_0xf195('0xc'));logger[_0xf195('0xd')](_0xf195('0xe'),_0x4dcdc8,'request\x20sent',JSON[_0xf195('0xf')](_0x4e17cc));if(_0x4e17cc[_0xf195('0x10')]){if(_0x4e17cc['error'][_0xf195('0x11')]===0x1f4){logger[_0xf195('0x10')](_0xf195('0xb'),_0x4dcdc8,_0x4e17cc['error'][_0xf195('0x12')]);return _0x41ff55(_0x4e17cc['error'][_0xf195('0x12')]);}logger[_0xf195('0x10')](_0xf195('0xb'),_0x4dcdc8,_0x4e17cc[_0xf195('0x10')][_0xf195('0x12')]);return _0x51443b(_0x4e17cc[_0xf195('0x10')][_0xf195('0x12')]);}else{logger[_0xf195('0xa')](_0xf195('0xb'),_0x4dcdc8,_0xf195('0xc'));_0x51443b(_0x4e17cc['result']['message']);}})[_0xf195('0x13')](function(_0x22f7cf){logger[_0xf195('0x10')](_0xf195('0xb'),_0x4dcdc8,_0x22f7cf);_0x41ff55(_0x22f7cf);});});} \ No newline at end of file +var _0x18f4=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2ed880,_0x2ad96c){var _0x61faf=function(_0x416f51){while(--_0x416f51){_0x2ed880['push'](_0x2ed880['shift']());}};_0x61faf(++_0x2ad96c);}(_0x18f4,0x1a4));var _0x418f=function(_0x980b65,_0x24e334){_0x980b65=_0x980b65-0x0;var _0x366f0d=_0x18f4[_0x980b65];return _0x366f0d;};'use strict';var _=require('lodash');var util=require(_0x418f('0x0'));var moment=require(_0x418f('0x1'));var BPromise=require('bluebird');var rs=require(_0x418f('0x2'));var fs=require('fs');var Redis=require(_0x418f('0x3'));var db=require(_0x418f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x418f('0x5'));var config=require(_0x418f('0x6'));var jayson=require(_0x418f('0x7'));var client=jayson[_0x418f('0x8')][_0x418f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e23c8,_0x14eca7,_0x7c0e09){return new BPromise(function(_0x4f4263,_0x1144ab){return client['request'](_0x3e23c8,_0x7c0e09)[_0x418f('0xa')](function(_0x525368){logger[_0x418f('0xb')](_0x418f('0xc'),_0x14eca7,_0x418f('0xd'));logger[_0x418f('0xe')](_0x418f('0xf'),_0x14eca7,_0x418f('0xd'),JSON[_0x418f('0x10')](_0x525368));if(_0x525368['error']){if(_0x525368[_0x418f('0x11')][_0x418f('0x12')]===0x1f4){logger[_0x418f('0x11')](_0x418f('0xc'),_0x14eca7,_0x525368['error'][_0x418f('0x13')]);return _0x1144ab(_0x525368[_0x418f('0x11')]['message']);}logger[_0x418f('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x14eca7,_0x525368[_0x418f('0x11')][_0x418f('0x13')]);return _0x4f4263(_0x525368[_0x418f('0x11')]['message']);}else{logger[_0x418f('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x14eca7,_0x418f('0xd'));_0x4f4263(_0x525368[_0x418f('0x14')][_0x418f('0x13')]);}})[_0x418f('0x15')](function(_0x50a923){logger[_0x418f('0x11')](_0x418f('0xc'),_0x14eca7,_0x50a923);_0x1144ab(_0x50a923);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index ba1e484..f99c233 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 _0xe20e=['post','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout','express','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create'];(function(_0x25f65c,_0xa78bc4){var _0x549c15=function(_0x506ab3){while(--_0x506ab3){_0x25f65c['push'](_0x25f65c['shift']());}};_0x549c15(++_0xa78bc4);}(_0xe20e,0x195));var _0xee20=function(_0x258fb5,_0x47c7f5){_0x258fb5=_0x258fb5-0x0;var _0x124437=_0xe20e[_0x258fb5];return _0x124437;};'use strict';var multer=require(_0xee20('0x0'));var util=require(_0xee20('0x1'));var path=require('path');var timeout=require(_0xee20('0x2'));var express=require(_0xee20('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xee20('0x4'));var config=require('../../config/environment');var controller=require(_0xee20('0x5'));router[_0xee20('0x6')]('/',auth[_0xee20('0x7')](),controller[_0xee20('0x8')]);router[_0xee20('0x6')](_0xee20('0x9'),auth[_0xee20('0x7')](),controller[_0xee20('0xa')]);router[_0xee20('0x6')](_0xee20('0xb'),auth[_0xee20('0x7')](),controller[_0xee20('0xc')]);router['get'](_0xee20('0xd'),auth[_0xee20('0x7')](),controller['getFields']);router['post']('/',auth[_0xee20('0x7')](),controller[_0xee20('0xe')]);router[_0xee20('0xf')](_0xee20('0xb'),auth['isAuthenticated'](),controller[_0xee20('0x10')]);router[_0xee20('0x11')](_0xee20('0x9'),auth[_0xee20('0x7')](),controller[_0xee20('0x12')]);router[_0xee20('0x13')](_0xee20('0x9'),auth['isAuthenticated'](),controller[_0xee20('0x14')]);module['exports']=router; \ No newline at end of file +var _0x1bb2=['getConfigurations','/:id/fields','post','create','addConfiguration','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','isAuthenticated'];(function(_0x4589b8,_0x147234){var _0x14bf43=function(_0x4c7ab5){while(--_0x4c7ab5){_0x4589b8['push'](_0x4589b8['shift']());}};_0x14bf43(++_0x147234);}(_0x1bb2,0xc6));var _0x21bb=function(_0x1df8ff,_0x34b8cc){_0x1df8ff=_0x1df8ff-0x0;var _0x50053a=_0x1bb2[_0x1df8ff];return _0x50053a;};'use strict';var multer=require('multer');var util=require(_0x21bb('0x0'));var path=require(_0x21bb('0x1'));var timeout=require(_0x21bb('0x2'));var express=require('express');var router=express[_0x21bb('0x3')]();var auth=require(_0x21bb('0x4'));var interaction=require(_0x21bb('0x5'));var config=require(_0x21bb('0x6'));var controller=require(_0x21bb('0x7'));router[_0x21bb('0x8')]('/',auth['isAuthenticated'](),controller[_0x21bb('0x9')]);router[_0x21bb('0x8')](_0x21bb('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x21bb('0x8')]('/:id/configurations',auth[_0x21bb('0xb')](),controller[_0x21bb('0xc')]);router[_0x21bb('0x8')](_0x21bb('0xd'),auth[_0x21bb('0xb')](),controller['getFields']);router[_0x21bb('0xe')]('/',auth[_0x21bb('0xb')](),controller[_0x21bb('0xf')]);router[_0x21bb('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x21bb('0x10')]);router[_0x21bb('0x11')](_0x21bb('0xa'),auth[_0x21bb('0xb')](),controller[_0x21bb('0x12')]);router['delete'](_0x21bb('0xa'),auth['isAuthenticated'](),controller[_0x21bb('0x13')]);module[_0x21bb('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 0198552..28d2b92 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 _0xe14b=['sequelize','exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe14b,0x93));var _0xbe14=function(_0x23882d,_0x2899a8){_0x23882d=_0x23882d-0x0;var _0x33d25b=_0xe14b[_0x23882d];return _0x33d25b;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xbe14('0x2')],'unique':_0xbe14('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xbe14('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xbe14('0x2')]},'serverUrl':{'type':Sequelize[_0xbe14('0x2')]},'type':{'type':Sequelize[_0xbe14('0x4')](_0xbe14('0x5'),_0xbe14('0x6')),'defaultValue':_0xbe14('0x5')}}; \ No newline at end of file +var _0x7217=['sequelize','STRING','username','ENUM','integrationTab','newTab'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0x7217,0x19e));var _0x7721=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x7217[_0x37bd26];return _0xe83dc4;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')]},'description':{'type':Sequelize[_0x7721('0x1')]},'username':{'type':Sequelize[_0x7721('0x1')],'unique':_0x7721('0x2')},'remoteUri':{'type':Sequelize[_0x7721('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x7721('0x1')]},'securityToken':{'type':Sequelize[_0x7721('0x1')]},'serverUrl':{'type':Sequelize[_0x7721('0x1')]},'type':{'type':Sequelize[_0x7721('0x3')](_0x7721('0x4'),_0x7721('0x5')),'defaultValue':_0x7721('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 784c2c9..b86c91f 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(_0x4e93af,_0x195a6d){var _0x3ecf6c=function(_0x494369){while(--_0x494369){_0x4e93af['push'](_0x4e93af['shift']());}};_0x3ecf6c(++_0x195a6d);}(_0x2ef3,0xba));var _0x32ef=function(_0x557e50,_0x2f7b04){_0x557e50=_0x557e50-0x0;var _0x569c79=_0x2ef3[_0x557e50];return _0x569c79;};'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 _0x1cb9=['keys','include','find','create','body','params','getConfigurations','findOne','order','pick','addConfiguration','AccountId','Descriptions','channel','SalesforceConfiguration','Subjects','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Status','Type','Case','Origin','Priority','IsEscalated','SuppliedName','remove','custom','includes','label','picklistValues','value','boolean','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','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','../../components/integrations/configuration','jayson/promise','http','Sequelize','ValidationError','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','count','includeAll','findAll'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x1cb9,0x14e));var _0x91cb=function(_0x337b9c,_0x30be51){_0x337b9c=_0x337b9c-0x0;var _0x4ddf9a=_0x1cb9[_0x337b9c];return _0x4ddf9a;};'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'];var integrations=require(_0x91cb('0x18'));var jayson=require(_0x91cb('0x19'));var client=jayson['client'][_0x91cb('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3ea707,_0x44f2e9,_0x2c7d40){if(_0x2c7d40){var _0x4a7d45=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a7d45['test'](_0x44f2e9)){return _0x3ea707;}else{throw new db[(_0x91cb('0x1b'))][(_0x91cb('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 _0x3ea707;}}function respondWithRpcPromise(_0x528f73,_0x576369,_0xc3629e,_0x347980){return new BPromise(function(_0x5ea796,_0x238f11){var _0x135890=_0x347980||client;return _0x135890['request'](_0x528f73,_0xc3629e)[_0x91cb('0x1d')](function(_0x139f4b){logger[_0x91cb('0x1e')](_0x91cb('0x1f'),_0x576369,'request\x20sent');logger[_0x91cb('0x20')](_0x91cb('0x21'),_0x576369,'request\x20sent',JSON[_0x91cb('0x22')](_0x139f4b));if(_0x139f4b['error']){if(_0x139f4b['error'][_0x91cb('0x23')]===0x1f4){logger[_0x91cb('0x24')]('SalesforceAccount,\x20%s,\x20%s',_0x576369,_0x139f4b['error']['message']);return _0x238f11(_0x139f4b[_0x91cb('0x24')][_0x91cb('0x25')]);}logger[_0x91cb('0x24')](_0x91cb('0x1f'),_0x576369,_0x139f4b['error'][_0x91cb('0x25')]);return _0x5ea796(_0x139f4b[_0x91cb('0x24')][_0x91cb('0x25')]);}else{logger['info'](_0x91cb('0x1f'),_0x576369,_0x91cb('0x26'));_0x5ea796(_0x139f4b[_0x91cb('0x27')][_0x91cb('0x25')]);}})[_0x91cb('0x28')](function(_0x7ad361){logger[_0x91cb('0x24')](_0x91cb('0x1f'),_0x576369,_0x7ad361);_0x238f11(_0x7ad361);});});}function respondWithStatusCode(_0x264e9b,_0x4c8438){_0x4c8438=_0x4c8438||0xcc;return function(_0x59bf3a){if(_0x59bf3a){return _0x264e9b[_0x91cb('0x29')](_0x4c8438);}return _0x264e9b['status'](_0x4c8438)[_0x91cb('0x2a')]();};}function respondWithResult(_0x34d372,_0x318031){_0x318031=_0x318031||0xc8;return function(_0x5595c5){if(_0x5595c5){return _0x34d372[_0x91cb('0x2b')](_0x318031)['json'](_0x5595c5);}};}function respondWithFilteredResult(_0x4572f6,_0x308e8c){return function(_0x3b3ee6){if(_0x3b3ee6){var _0x2fb473=_0x3b3ee6['count'],_0x468908=_0x308e8c[_0x91cb('0x2c')],_0x504275=_0x308e8c[_0x91cb('0x2c')]+_0x308e8c[_0x91cb('0x2d')],_0x2f04a3;if(_0x504275>=_0x2fb473){_0x504275=_0x2fb473;_0x2f04a3=0xc8;}else{_0x2f04a3=0xce;}_0x4572f6['status'](_0x2f04a3);return _0x4572f6[_0x91cb('0x2e')](_0x91cb('0x2f'),_0x468908+'-'+_0x504275+'/'+_0x2fb473)[_0x91cb('0x30')](_0x3b3ee6);}return null;};}function patchUpdates(_0x361e4c){return function(_0xf296bc){try{jsonpatch[_0x91cb('0x31')](_0xf296bc,_0x361e4c,!![]);}catch(_0x1e5bf1){return BPromise[_0x91cb('0x32')](_0x1e5bf1);}return _0xf296bc[_0x91cb('0x33')]();};}function saveUpdates(_0x5e6ed3,_0x2ccf6e){return function(_0x474a15){if(_0x474a15){return _0x474a15[_0x91cb('0x34')](_0x5e6ed3)[_0x91cb('0x1d')](function(_0x440060){return _0x440060;});}return null;};}function removeEntity(_0x4e70cd,_0x2409d3){return function(_0x74b443){if(_0x74b443){return _0x74b443[_0x91cb('0x35')]()[_0x91cb('0x1d')](function(){_0x4e70cd[_0x91cb('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x121c37,_0x5927cb){return function(_0x47fc17){if(!_0x47fc17){_0x121c37['sendStatus'](0x194);}return _0x47fc17;};}function handleError(_0x2011fc,_0x4bba88){_0x4bba88=_0x4bba88||0x1f4;return function(_0x341ebe){logger['error'](_0x341ebe['stack']);if(_0x341ebe[_0x91cb('0x36')]){delete _0x341ebe[_0x91cb('0x36')];}_0x2011fc[_0x91cb('0x2b')](_0x4bba88)[_0x91cb('0x37')](_0x341ebe);};}exports[_0x91cb('0x38')]=function(_0x4b0ca6,_0x8beb3a){var _0x3ddc0b={},_0x13a5ea={},_0x8496a3={'count':0x0,'rows':[]};var _0x486a89=_['map'](db[_0x91cb('0x39')][_0x91cb('0x3a')],function(_0x56d614){return{'name':_0x56d614[_0x91cb('0x3b')],'type':_0x56d614[_0x91cb('0x3c')]['key']};});_0x13a5ea[_0x91cb('0x3d')]=_[_0x91cb('0x3e')](_0x486a89,'name');_0x13a5ea[_0x91cb('0x3f')]=_['keys'](_0x4b0ca6[_0x91cb('0x3f')]);_0x13a5ea[_0x91cb('0x40')]=_[_0x91cb('0x41')](_0x13a5ea[_0x91cb('0x3d')],_0x13a5ea[_0x91cb('0x3f')]);_0x3ddc0b[_0x91cb('0x42')]=_['intersection'](_0x13a5ea[_0x91cb('0x3d')],qs[_0x91cb('0x43')](_0x4b0ca6['query'][_0x91cb('0x43')]));_0x3ddc0b['attributes']=_0x3ddc0b[_0x91cb('0x42')][_0x91cb('0x44')]?_0x3ddc0b[_0x91cb('0x42')]:_0x13a5ea[_0x91cb('0x3d')];if(!_0x4b0ca6['query'][_0x91cb('0x45')](_0x91cb('0x46'))){_0x3ddc0b[_0x91cb('0x2d')]=qs[_0x91cb('0x2d')](_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x2d')]);_0x3ddc0b[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x2c')]);}_0x3ddc0b['order']=qs[_0x91cb('0x47')](_0x4b0ca6['query'][_0x91cb('0x47')]);_0x3ddc0b['where']=qs[_0x91cb('0x40')](_['pick'](_0x4b0ca6[_0x91cb('0x3f')],_0x13a5ea[_0x91cb('0x40')]));if(_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x48')]){_0x3ddc0b['where']=_[_0x91cb('0x49')](_0x3ddc0b[_0x91cb('0x4a')],{'$or':_['map'](_0x486a89,function(_0x461e1e){if(_0x461e1e[_0x91cb('0x3c')]!==_0x91cb('0x4b')){var _0x32517d={};_0x32517d[_0x461e1e[_0x91cb('0x36')]]={'$like':'%'+_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x48')]+'%'};return _0x32517d;}})});}_0x3ddc0b=_[_0x91cb('0x49')]({},_0x3ddc0b,_0x4b0ca6[_0x91cb('0x4c')]);var _0x4b26f6={'where':_0x3ddc0b[_0x91cb('0x4a')]};return db[_0x91cb('0x39')][_0x91cb('0x4d')](_0x4b26f6)[_0x91cb('0x1d')](function(_0x3314cc){_0x8496a3[_0x91cb('0x4d')]=_0x3314cc;if(_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x4e')]){_0x3ddc0b['include']=[{'all':!![]}];}return db[_0x91cb('0x39')][_0x91cb('0x4f')](_0x3ddc0b);})[_0x91cb('0x1d')](function(_0x3b8cfd){_0x8496a3['rows']=_0x3b8cfd;return _0x8496a3;})[_0x91cb('0x1d')](respondWithFilteredResult(_0x8beb3a,_0x3ddc0b))[_0x91cb('0x28')](handleError(_0x8beb3a,null));};exports['show']=function(_0x212473,_0x47cdb7){var _0x2c419b={'raw':![],'where':{'id':_0x212473['params']['id']}},_0x4c0acd={};_0x4c0acd['model']=_[_0x91cb('0x50')](db[_0x91cb('0x39')][_0x91cb('0x3a')]);_0x4c0acd[_0x91cb('0x3f')]=_[_0x91cb('0x50')](_0x212473['query']);_0x4c0acd['filters']=_[_0x91cb('0x41')](_0x4c0acd[_0x91cb('0x3d')],_0x4c0acd[_0x91cb('0x3f')]);_0x2c419b[_0x91cb('0x42')]=_['intersection'](_0x4c0acd['model'],qs['fields'](_0x212473[_0x91cb('0x3f')]['fields']));_0x2c419b[_0x91cb('0x42')]=_0x2c419b['attributes'][_0x91cb('0x44')]?_0x2c419b[_0x91cb('0x42')]:_0x4c0acd[_0x91cb('0x3d')];if(_0x212473[_0x91cb('0x3f')][_0x91cb('0x4e')]){_0x2c419b[_0x91cb('0x51')]=[{'all':!![]}];}_0x2c419b=_[_0x91cb('0x49')]({},_0x2c419b,_0x212473[_0x91cb('0x4c')]);return db[_0x91cb('0x39')][_0x91cb('0x52')](_0x2c419b)[_0x91cb('0x1d')](handleEntityNotFound(_0x47cdb7,null))['then'](respondWithResult(_0x47cdb7,null))[_0x91cb('0x28')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x53')]=function(_0x4d7a34,_0x3f719b){return db[_0x91cb('0x39')]['create'](_0x4d7a34[_0x91cb('0x54')],{})[_0x91cb('0x1d')](respondWithResult(_0x3f719b,0xc9))[_0x91cb('0x28')](handleError(_0x3f719b,null));};exports[_0x91cb('0x34')]=function(_0x43ddee,_0x42a9ef){if(_0x43ddee[_0x91cb('0x54')]['id']){delete _0x43ddee[_0x91cb('0x54')]['id'];}return db[_0x91cb('0x39')][_0x91cb('0x52')]({'where':{'id':_0x43ddee[_0x91cb('0x55')]['id']}})['then'](handleEntityNotFound(_0x42a9ef,null))[_0x91cb('0x1d')](saveUpdates(_0x43ddee['body'],null))[_0x91cb('0x1d')](respondWithResult(_0x42a9ef,null))['catch'](handleError(_0x42a9ef,null));};exports[_0x91cb('0x35')]=function(_0x1b2fec,_0x1986d7){return db['SalesforceAccount'][_0x91cb('0x52')]({'where':{'id':_0x1b2fec[_0x91cb('0x55')]['id']}})['then'](handleEntityNotFound(_0x1986d7,null))[_0x91cb('0x1d')](removeEntity(_0x1986d7,null))[_0x91cb('0x28')](handleError(_0x1986d7,null));};exports[_0x91cb('0x56')]=function(_0x25548b,_0x48e825,_0x2f5658){var _0x3854e9={};var _0x4250c2={};var _0x373076;var _0x55a0e3;return db[_0x91cb('0x39')][_0x91cb('0x57')]({'where':{'id':_0x25548b['params']['id']}})['then'](handleEntityNotFound(_0x48e825,null))[_0x91cb('0x1d')](function(_0x525021){if(_0x525021){_0x373076=_0x525021;_0x4250c2[_0x91cb('0x3d')]=_[_0x91cb('0x50')](db['SalesforceConfiguration']['rawAttributes']);_0x4250c2[_0x91cb('0x3f')]=_['keys'](_0x25548b[_0x91cb('0x3f')]);_0x4250c2[_0x91cb('0x40')]=_[_0x91cb('0x41')](_0x4250c2['model'],_0x4250c2[_0x91cb('0x3f')]);_0x3854e9['attributes']=_[_0x91cb('0x41')](_0x4250c2[_0x91cb('0x3d')],qs[_0x91cb('0x43')](_0x25548b[_0x91cb('0x3f')]['fields']));_0x3854e9[_0x91cb('0x42')]=_0x3854e9[_0x91cb('0x42')][_0x91cb('0x44')]?_0x3854e9[_0x91cb('0x42')]:_0x4250c2[_0x91cb('0x3d')];_0x3854e9[_0x91cb('0x58')]=qs[_0x91cb('0x47')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x47')]);_0x3854e9[_0x91cb('0x4a')]=qs[_0x91cb('0x40')](_[_0x91cb('0x59')](_0x25548b['query'],_0x4250c2[_0x91cb('0x40')]));if(_0x25548b[_0x91cb('0x3f')][_0x91cb('0x48')]){_0x3854e9[_0x91cb('0x4a')]=_[_0x91cb('0x49')](_0x3854e9[_0x91cb('0x4a')],{'$or':_[_0x91cb('0x3e')](_0x3854e9['attributes'],function(_0x325b2d){var _0x5a3c7d={};_0x5a3c7d[_0x325b2d]={'$like':'%'+_0x25548b[_0x91cb('0x3f')][_0x91cb('0x48')]+'%'};return _0x5a3c7d;})});}_0x3854e9=_[_0x91cb('0x49')]({},_0x3854e9,_0x25548b[_0x91cb('0x4c')]);return _0x373076['getConfigurations'](_0x3854e9);}})[_0x91cb('0x1d')](function(_0x22ab40){if(_0x22ab40){_0x55a0e3=_0x22ab40[_0x91cb('0x44')];if(!_0x25548b[_0x91cb('0x3f')][_0x91cb('0x45')](_0x91cb('0x46'))){_0x3854e9['limit']=qs[_0x91cb('0x2d')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x2d')]);_0x3854e9[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x2c')]);}return _0x373076[_0x91cb('0x56')](_0x3854e9);}})[_0x91cb('0x1d')](function(_0x457f81){if(_0x457f81){return _0x457f81?{'count':_0x55a0e3,'rows':_0x457f81}:null;}})[_0x91cb('0x1d')](respondWithResult(_0x48e825,null))[_0x91cb('0x28')](handleError(_0x48e825,null));};exports[_0x91cb('0x5a')]=function(_0x3eead5,_0x2d2613,_0x2605c3){if(_0x3eead5[_0x91cb('0x54')]['id']){delete _0x3eead5['body']['id'];}return db[_0x91cb('0x39')][_0x91cb('0x57')]({'where':{'id':_0x3eead5['params']['id']}})[_0x91cb('0x1d')](handleEntityNotFound(_0x2d2613,null))[_0x91cb('0x1d')](function(_0x1c3e0a){if(_0x1c3e0a){_0x3eead5['body'][_0x91cb('0x5b')]=_0x1c3e0a['id'];_0x3eead5[_0x91cb('0x54')]['Subjects']=integrations['getSubjects'](_0x3eead5[_0x91cb('0x54')]['channel'],_0x3eead5[_0x91cb('0x54')][_0x91cb('0x3c')]);_0x3eead5['body'][_0x91cb('0x5c')]=integrations['getDescriptions'](_0x3eead5[_0x91cb('0x54')][_0x91cb('0x5d')],_0x3eead5['body']['type']);return db[_0x91cb('0x5e')][_0x91cb('0x53')](_0x3eead5[_0x91cb('0x54')],{'include':[{'model':db['SalesforceField'],'as':_0x91cb('0x5f')},{'model':db[_0x91cb('0x60')],'as':_0x91cb('0x5c')}]});}return null;})[_0x91cb('0x1d')](respondWithResult(_0x2d2613,null))['catch'](handleError(_0x2d2613,null));};exports[_0x91cb('0x61')]=function(_0x4ee1e3,_0x342587,_0x4118eb){var _0x30c607;var _0x281eda='';var _0x5f2418='Task';return db[_0x91cb('0x39')]['findOne']({'where':{'id':_0x4ee1e3[_0x91cb('0x55')]['id']},'attributes':['id',_0x91cb('0x62'),_0x91cb('0x63'),_0x91cb('0x64'),_0x91cb('0x65'),_0x91cb('0x66'),_0x91cb('0x67')]})['then'](handleEntityNotFound(_0x342587,null))[_0x91cb('0x1d')](function(_0x2074fc){if(_0x2074fc){_0x281eda=_0x2074fc['remoteUri'];var _0x10ec48=_0x281eda['slice'](-0x1);if(_0x10ec48==='/'){_0x281eda=_0x281eda[_0x91cb('0x68')](0x0,_0x281eda[_0x91cb('0x69')](_0x10ec48));}_0x30c607=new jsforce[(_0x91cb('0x6a'))]({'oauth2':{'loginUrl':_0x281eda,'clientId':_0x2074fc[_0x91cb('0x63')],'clientSecret':_0x2074fc[_0x91cb('0x64')]}});return _0x30c607[_0x91cb('0x6b')](_0x2074fc[_0x91cb('0x65')],_0x2074fc[_0x91cb('0x66')][_0x91cb('0x6c')](_0x2074fc[_0x91cb('0x67')]));}})[_0x91cb('0x1d')](function(_0x11411d){if(_0x11411d){if(!_[_0x91cb('0x6d')](_0x4ee1e3[_0x91cb('0x3f')][_0x91cb('0x6e')])){_0x5f2418=_0x4ee1e3[_0x91cb('0x3f')]['ticketType'];}return _0x30c607[_0x91cb('0x6f')](_0x5f2418)['describe']();}})[_0x91cb('0x1d')](function(_0x123d72){var _0x13f358=[_0x91cb('0x70'),_0x91cb('0x71'),_0x91cb('0x72'),_0x91cb('0x73'),_0x91cb('0x74'),'Priority',_0x91cb('0x75'),_0x91cb('0x76')];if(!_['isNil'](_0x4ee1e3['query'][_0x91cb('0x6e')])&&_0x4ee1e3['query']['ticketType']===_0x91cb('0x77')){_0x13f358=['Type',_0x91cb('0x78'),'Reason',_0x91cb('0x75'),_0x91cb('0x79'),_0x91cb('0x7a'),_0x91cb('0x7b'),'SuppliedCompany'];}if(_0x123d72){_[_0x91cb('0x7c')](_0x123d72[_0x91cb('0x43')],function(_0x42d07b){return _0x42d07b[_0x91cb('0x7d')]===![]&&!_0x13f358[_0x91cb('0x7e')](_0x42d07b[_0x91cb('0x36')]);});return{'count':_0x123d72[_0x91cb('0x43')][_0x91cb('0x44')],'rows':_[_0x91cb('0x3e')](_0x123d72[_0x91cb('0x43')],function(_0xafda63){return{'id':_0xafda63[_0x91cb('0x36')],'name':_0xafda63[_0x91cb('0x7f')],'custom':_0xafda63[_0x91cb('0x7d')],'options':_0xafda63[_0x91cb('0x80')][_0x91cb('0x44')]>0x0?_[_0x91cb('0x3e')](_0xafda63[_0x91cb('0x80')],function(_0x30640e){return{'name':_0x30640e[_0x91cb('0x7f')],'value':_0x30640e[_0x91cb('0x81')]};}):_0xafda63[_0x91cb('0x3c')]==_0x91cb('0x82')?[{'name':_0x91cb('0x83'),'value':_0x91cb('0x84')},{'name':'False','value':_0x91cb('0x85')}]:[]};})};}})[_0x91cb('0x1d')](respondWithResult(_0x342587,null))[_0x91cb('0x28')](function(_0x1a654b){var _0x320315=_0x4ee1e3[_0x91cb('0x3f')][_0x91cb('0x86')]?0x1f4:_0x1a654b[_0x91cb('0x87')]||0x1f4;logger[_0x91cb('0x24')](_0x91cb('0x88'),_0x91cb('0x61'),_0x320315,JSON['stringify'](_0x1a654b));delete _0x1a654b[_0x91cb('0x36')];if(_0x320315===0x191){_0x320315=0x190;}_0x342587['status'](_0x320315)['send'](_0x4ee1e3[_0x91cb('0x3f')][_0x91cb('0x86')]?{'message':_0x91cb('0x89'),'statusCode':_0x1a654b[_0x91cb('0x87')]}:_0x1a654b);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 0a5d32b..56964e9 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 _0xef40=['exports','int_salesforce_accounts','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSalesforceAccount.attributes'];(function(_0x2d1982,_0x3bee62){var _0x59a4be=function(_0x352f46){while(--_0x352f46){_0x2d1982['push'](_0x2d1982['shift']());}};_0x59a4be(++_0x3bee62);}(_0xef40,0x12e));var _0x0ef4=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xef40[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x0ef4('0x0'));var util=require('util');var logger=require(_0x0ef4('0x1'))(_0x0ef4('0x2'));var moment=require(_0x0ef4('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ef4('0x4'));var fs=require('fs');var path=require(_0x0ef4('0x5'));var rimraf=require('rimraf');var config=require(_0x0ef4('0x6'));var attributes=require(_0x0ef4('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x0ef4('0x8')]=function(_0x46ac37,_0x335eb0){return _0x46ac37['define']('SalesforceAccount',attributes,{'tableName':_0x0ef4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f9a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1cfe20,_0x121d39){var _0x4ded09=function(_0x279441){while(--_0x279441){_0x1cfe20['push'](_0x1cfe20['shift']());}};_0x4ded09(++_0x121d39);}(_0x5f9a,0x114));var _0xa5f9=function(_0x4d70d2,_0x3e0ed5){_0x4d70d2=_0x4d70d2-0x0;var _0x25629a=_0x5f9a[_0x4d70d2];return _0x25629a;};'use strict';var _=require(_0xa5f9('0x0'));var util=require(_0xa5f9('0x1'));var logger=require(_0xa5f9('0x2'))(_0xa5f9('0x3'));var moment=require(_0xa5f9('0x4'));var BPromise=require(_0xa5f9('0x5'));var rp=require(_0xa5f9('0x6'));var fs=require('fs');var path=require(_0xa5f9('0x7'));var rimraf=require(_0xa5f9('0x8'));var config=require('../../config/environment');var attributes=require(_0xa5f9('0x9'));var integrations=require(_0xa5f9('0xa'));module[_0xa5f9('0xb')]=function(_0x21b0c5,_0x29353b){return _0x21b0c5['define']('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 22c4cb1..4b1e67d 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 _0x5b02=['request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSalesforceAccount','ShowSalesforceAccount','find','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x4942af,_0x1fa7f4){var _0x16235e=function(_0x198c6d){while(--_0x198c6d){_0x4942af['push'](_0x4942af['shift']());}};_0x16235e(++_0x1fa7f4);}(_0x5b02,0xe9));var _0x25b0=function(_0x5909a8,_0x14f190){_0x5909a8=_0x5909a8-0x0;var _0x292613=_0x5b02[_0x5909a8];return _0x292613;};'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')]('SalesforceAccount,\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')]('SalesforceAccount,\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);});});}exports['GetSalesforceAccount']=function(_0x1d850f){var _0x213a77=this;return new Promise(function(_0x20762e,_0x385334){return db[_0x25b0('0x16')][_0x25b0('0x17')]({'raw':_0x1d850f['options']?_0x1d850f[_0x25b0('0x18')][_0x25b0('0x19')]===undefined?!![]:![]:!![],'where':_0x1d850f[_0x25b0('0x18')]?_0x1d850f[_0x25b0('0x18')][_0x25b0('0x1a')]||null:null,'attributes':_0x1d850f[_0x25b0('0x18')]?_0x1d850f[_0x25b0('0x18')][_0x25b0('0x1b')]||null:null,'limit':_0x1d850f[_0x25b0('0x18')]?_0x1d850f[_0x25b0('0x18')][_0x25b0('0x1c')]||null:null,'include':_0x1d850f[_0x25b0('0x18')]?_0x1d850f['options'][_0x25b0('0x1d')]?_[_0x25b0('0x1e')](_0x1d850f['options'][_0x25b0('0x1d')],function(_0x2023d8){return{'model':db[_0x2023d8[_0x25b0('0x1f')]],'as':_0x2023d8['as'],'attributes':_0x2023d8['attributes'],'include':_0x2023d8['include']?_['map'](_0x2023d8[_0x25b0('0x1d')],function(_0x433085){return{'model':db[_0x433085[_0x25b0('0x1f')]],'as':_0x433085['as'],'attributes':_0x433085[_0x25b0('0x1b')],'include':_0x433085[_0x25b0('0x1d')]?_[_0x25b0('0x1e')](_0x433085[_0x25b0('0x1d')],function(_0x75ce7a){return{'model':db[_0x75ce7a[_0x25b0('0x1f')]],'as':_0x75ce7a['as'],'attributes':_0x75ce7a['attributes']};}):[]};}):[]};}):[]:[]})[_0x25b0('0xa')](function(_0xbfba84){logger['info']('GetSalesforceAccount',_0x1d850f);logger['debug'](_0x25b0('0x20'),_0x1d850f,JSON[_0x25b0('0xf')](_0xbfba84));_0x20762e(_0xbfba84);})[_0x25b0('0x15')](function(_0x105129){logger[_0x25b0('0x10')](_0x25b0('0x20'),_0x105129[_0x25b0('0x13')],_0x1d850f);_0x385334(_0x213a77[_0x25b0('0x10')](0x1f4,_0x105129[_0x25b0('0x13')]));});});};exports[_0x25b0('0x21')]=function(_0x1e217c){var _0x3161c1=this;return new Promise(function(_0x1ea374,_0x4f640f){return db['SalesforceAccount'][_0x25b0('0x22')]({'raw':_0x1e217c['options']?_0x1e217c['options'][_0x25b0('0x19')]===undefined?!![]:![]:!![],'where':_0x1e217c[_0x25b0('0x18')]?_0x1e217c[_0x25b0('0x18')][_0x25b0('0x1a')]||null:null,'attributes':_0x1e217c[_0x25b0('0x18')]?_0x1e217c['options'][_0x25b0('0x1b')]||null:null,'include':_0x1e217c[_0x25b0('0x18')]?_0x1e217c['options'][_0x25b0('0x1d')]?_[_0x25b0('0x1e')](_0x1e217c['options'][_0x25b0('0x1d')],function(_0x49b3a5){return{'model':db[_0x49b3a5[_0x25b0('0x1f')]],'as':_0x49b3a5['as'],'attributes':_0x49b3a5[_0x25b0('0x1b')],'include':_0x49b3a5[_0x25b0('0x1d')]?_[_0x25b0('0x1e')](_0x49b3a5[_0x25b0('0x1d')],function(_0x1587a7){return{'model':db[_0x1587a7[_0x25b0('0x1f')]],'as':_0x1587a7['as'],'attributes':_0x1587a7[_0x25b0('0x1b')],'include':_0x1587a7[_0x25b0('0x1d')]?_['map'](_0x1587a7[_0x25b0('0x1d')],function(_0x434bda){return{'model':db[_0x434bda[_0x25b0('0x1f')]],'as':_0x434bda['as'],'attributes':_0x434bda[_0x25b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x25b0('0xa')](function(_0x289416){logger[_0x25b0('0xb')](_0x25b0('0x21'),_0x1e217c);logger[_0x25b0('0xd')](_0x25b0('0x21'),_0x1e217c,JSON['stringify'](_0x289416));_0x1ea374(_0x289416);})[_0x25b0('0x15')](function(_0x104b35){logger[_0x25b0('0x10')]('ShowSalesforceAccount',_0x104b35[_0x25b0('0x13')],_0x1e217c);_0x4f640f(_0x3161c1[_0x25b0('0x10')](0x1f4,_0x104b35[_0x25b0('0x13')]));});});}; \ No newline at end of file +var _0xb43b=['GetSalesforceAccount','SalesforceAccount','findAll','raw','options','where','limit','include','model','attributes','map','then','ShowSalesforceAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceAccount,\x20%s,\x20%s','catch'];(function(_0x229302,_0x4f89a9){var _0x27fd2f=function(_0x115305){while(--_0x115305){_0x229302['push'](_0x229302['shift']());}};_0x27fd2f(++_0x4f89a9);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4246a4,_0x266a5f){_0x4246a4=_0x4246a4-0x0;var _0x42d751=_0xb43b[_0x4246a4];return _0x42d751;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}exports[_0xbb43('0x15')]=function(_0x2e3b43){var _0x55dd73=this;return new Promise(function(_0x1c16d7,_0x4f28b8){return db[_0xbb43('0x16')][_0xbb43('0x17')]({'raw':_0x2e3b43['options']?_0x2e3b43['options'][_0xbb43('0x18')]===undefined?!![]:![]:!![],'where':_0x2e3b43[_0xbb43('0x19')]?_0x2e3b43[_0xbb43('0x19')][_0xbb43('0x1a')]||null:null,'attributes':_0x2e3b43['options']?_0x2e3b43[_0xbb43('0x19')]['attributes']||null:null,'limit':_0x2e3b43[_0xbb43('0x19')]?_0x2e3b43['options'][_0xbb43('0x1b')]||null:null,'include':_0x2e3b43['options']?_0x2e3b43[_0xbb43('0x19')][_0xbb43('0x1c')]?_['map'](_0x2e3b43[_0xbb43('0x19')]['include'],function(_0xf24e60){return{'model':db[_0xf24e60[_0xbb43('0x1d')]],'as':_0xf24e60['as'],'attributes':_0xf24e60[_0xbb43('0x1e')],'include':_0xf24e60['include']?_['map'](_0xf24e60['include'],function(_0x269ca5){return{'model':db[_0x269ca5[_0xbb43('0x1d')]],'as':_0x269ca5['as'],'attributes':_0x269ca5['attributes'],'include':_0x269ca5[_0xbb43('0x1c')]?_[_0xbb43('0x1f')](_0x269ca5[_0xbb43('0x1c')],function(_0x3874fb){return{'model':db[_0x3874fb['model']],'as':_0x3874fb['as'],'attributes':_0x3874fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb43('0x20')](function(_0x42800f){logger[_0xbb43('0xb')](_0xbb43('0x15'),_0x2e3b43);logger[_0xbb43('0xd')](_0xbb43('0x15'),_0x2e3b43,JSON[_0xbb43('0xf')](_0x42800f));_0x1c16d7(_0x42800f);})[_0xbb43('0x14')](function(_0x539730){logger[_0xbb43('0x10')]('GetSalesforceAccount',_0x539730[_0xbb43('0x12')],_0x2e3b43);_0x4f28b8(_0x55dd73[_0xbb43('0x10')](0x1f4,_0x539730[_0xbb43('0x12')]));});});};exports[_0xbb43('0x21')]=function(_0x555b99){var _0x157d62=this;return new Promise(function(_0x547a6f,_0x5566cf){return db['SalesforceAccount'][_0xbb43('0x22')]({'raw':_0x555b99['options']?_0x555b99[_0xbb43('0x19')][_0xbb43('0x18')]===undefined?!![]:![]:!![],'where':_0x555b99[_0xbb43('0x19')]?_0x555b99['options'][_0xbb43('0x1a')]||null:null,'attributes':_0x555b99[_0xbb43('0x19')]?_0x555b99[_0xbb43('0x19')][_0xbb43('0x1e')]||null:null,'include':_0x555b99[_0xbb43('0x19')]?_0x555b99[_0xbb43('0x19')][_0xbb43('0x1c')]?_[_0xbb43('0x1f')](_0x555b99['options'][_0xbb43('0x1c')],function(_0x3961f5){return{'model':db[_0x3961f5[_0xbb43('0x1d')]],'as':_0x3961f5['as'],'attributes':_0x3961f5[_0xbb43('0x1e')],'include':_0x3961f5[_0xbb43('0x1c')]?_[_0xbb43('0x1f')](_0x3961f5[_0xbb43('0x1c')],function(_0x342714){return{'model':db[_0x342714[_0xbb43('0x1d')]],'as':_0x342714['as'],'attributes':_0x342714[_0xbb43('0x1e')],'include':_0x342714[_0xbb43('0x1c')]?_[_0xbb43('0x1f')](_0x342714[_0xbb43('0x1c')],function(_0x33f45c){return{'model':db[_0x33f45c[_0xbb43('0x1d')]],'as':_0x33f45c['as'],'attributes':_0x33f45c[_0xbb43('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39cbd7){logger[_0xbb43('0xb')]('ShowSalesforceAccount',_0x555b99);logger[_0xbb43('0xd')](_0xbb43('0x21'),_0x555b99,JSON[_0xbb43('0xf')](_0x39cbd7));_0x547a6f(_0x39cbd7);})['catch'](function(_0x5f4601){logger['error'](_0xbb43('0x21'),_0x5f4601[_0xbb43('0x12')],_0x555b99);_0x5566cf(_0x157d62['error'](0x1f4,_0x5f4601['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 773e314..cf082ec 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 _0x3cb6=['../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','util','Router','../../components/auth/service'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x3cb6,0xc3));var _0x63cb=function(_0x5d6c84,_0x46b6ad){_0x5d6c84=_0x5d6c84-0x0;var _0x1bec91=_0x3cb6[_0x5d6c84];return _0x1bec91;};'use strict';var multer=require('multer');var util=require(_0x63cb('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x63cb('0x1')]();var auth=require(_0x63cb('0x2'));var interaction=require(_0x63cb('0x3'));var config=require(_0x63cb('0x4'));var controller=require(_0x63cb('0x5'));router['get']('/',auth[_0x63cb('0x6')](),controller[_0x63cb('0x7')]);router['get'](_0x63cb('0x8'),auth[_0x63cb('0x6')](),controller[_0x63cb('0x9')]);router[_0x63cb('0xa')](_0x63cb('0xb'),auth[_0x63cb('0x6')](),controller[_0x63cb('0xc')]);router[_0x63cb('0xa')](_0x63cb('0xd'),auth['isAuthenticated'](),controller[_0x63cb('0xe')]);router[_0x63cb('0xa')](_0x63cb('0xf'),auth[_0x63cb('0x6')](),controller[_0x63cb('0x10')]);router['post']('/',auth[_0x63cb('0x6')](),controller[_0x63cb('0x11')]);router[_0x63cb('0x12')](_0x63cb('0x8'),auth[_0x63cb('0x6')](),controller[_0x63cb('0x13')]);router[_0x63cb('0x14')](_0x63cb('0x8'),auth[_0x63cb('0x6')](),controller[_0x63cb('0x15')]);module['exports']=router; \ No newline at end of file +var _0xd5a8=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','/:id/fields','get','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3dcdb8,_0x4bada8){var _0x344920=function(_0x1a5c80){while(--_0x1a5c80){_0x3dcdb8['push'](_0x3dcdb8['shift']());}};_0x344920(++_0x4bada8);}(_0xd5a8,0x1e3));var _0x8d5a=function(_0x1d8d45,_0x5048dd){_0x1d8d45=_0x1d8d45-0x0;var _0x305b41=_0xd5a8[_0x1d8d45];return _0x305b41;};'use strict';var multer=require(_0x8d5a('0x0'));var util=require(_0x8d5a('0x1'));var path=require(_0x8d5a('0x2'));var timeout=require('connect-timeout');var express=require(_0x8d5a('0x3'));var router=express['Router']();var auth=require(_0x8d5a('0x4'));var interaction=require(_0x8d5a('0x5'));var config=require(_0x8d5a('0x6'));var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth[_0x8d5a('0x7')](),controller[_0x8d5a('0x8')]);router['get'](_0x8d5a('0x9'),auth['isAuthenticated'](),controller[_0x8d5a('0xa')]);router['get'](_0x8d5a('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x8d5a('0xc')]('/:id/subjects',auth[_0x8d5a('0x7')](),controller['getSubjects']);router[_0x8d5a('0xc')](_0x8d5a('0xd'),auth['isAuthenticated'](),controller[_0x8d5a('0xe')]);router[_0x8d5a('0xf')]('/',auth[_0x8d5a('0x7')](),controller[_0x8d5a('0x10')]);router[_0x8d5a('0x11')](_0x8d5a('0x9'),auth[_0x8d5a('0x7')](),controller[_0x8d5a('0x12')]);router[_0x8d5a('0x13')]('/:id',auth[_0x8d5a('0x7')](),controller[_0x8d5a('0x14')]);module[_0x8d5a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 47b4fd0..3ad62ec 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 _0xe759=['lead','sequelize','exports','STRING','ENUM','Task','contact_lead','contact','nothing'];(function(_0x4bfdc5,_0x404541){var _0x5a7879=function(_0xbcaee){while(--_0xbcaee){_0x4bfdc5['push'](_0x4bfdc5['shift']());}};_0x5a7879(++_0x404541);}(_0xe759,0xd9));var _0x9e75=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe759[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x9e75('0x0'));module[_0x9e75('0x1')]={'name':{'type':Sequelize[_0x9e75('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x9e75('0x3')](_0x9e75('0x4'),'Case'),'defaultValue':_0x9e75('0x4')},'moduleSearch':{'type':Sequelize[_0x9e75('0x3')](_0x9e75('0x5'),_0x9e75('0x6'),'lead'),'defaultValue':_0x9e75('0x5')},'moduleCreate':{'type':Sequelize[_0x9e75('0x3')](_0x9e75('0x7'),_0x9e75('0x6'),_0x9e75('0x8')),'defaultValue':_0x9e75('0x8')}}; \ No newline at end of file +var _0x7236=['lead','sequelize','STRING','Task','Case','ENUM','contact_lead','contact'];(function(_0x11deef,_0x34bbdb){var _0xe9ba85=function(_0x591377){while(--_0x591377){_0x11deef['push'](_0x11deef['shift']());}};_0xe9ba85(++_0x34bbdb);}(_0x7236,0x179));var _0x6723=function(_0x45c51a,_0x1da5b8){_0x45c51a=_0x45c51a-0x0;var _0x30f8eb=_0x7236[_0x45c51a];return _0x30f8eb;};'use strict';var Sequelize=require(_0x6723('0x0'));module['exports']={'name':{'type':Sequelize[_0x6723('0x1')]},'description':{'type':Sequelize[_0x6723('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x6723('0x2'),_0x6723('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x6723('0x4')](_0x6723('0x5'),_0x6723('0x6'),_0x6723('0x7')),'defaultValue':_0x6723('0x5')},'moduleCreate':{'type':Sequelize['ENUM']('nothing','contact','lead'),'defaultValue':_0x6723('0x7')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 66c0e60..ac8ceb5 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 _0x335f=['code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','length','includeAll','find','create','body','getFields','findOne','SalesforceField','getSubjects','nolimit','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x276de9,_0x2c2f75){var _0xbac321=function(_0x3ebcfd){while(--_0x3ebcfd){_0x276de9['push'](_0x276de9['shift']());}};_0xbac321(++_0x2c2f75);}(_0x335f,0xfb));var _0xf335=function(_0x4a08db,_0x3e6319){_0x4a08db=_0x4a08db-0x0;var _0x58be85=_0x335f[_0x4a08db];return _0x58be85;};'use strict';var pdf=require(_0xf335('0x0'));var emlformat=require(_0xf335('0x1'));var rimraf=require(_0xf335('0x2'));var zipdir=require(_0xf335('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf335('0x4'));var moment=require('moment');var BPromise=require(_0xf335('0x5'));var Mustache=require(_0xf335('0x6'));var util=require(_0xf335('0x7'));var path=require(_0xf335('0x8'));var sox=require(_0xf335('0x9'));var csv=require(_0xf335('0xa'));var ejs=require(_0xf335('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf335('0xc'));var jsforce=require(_0xf335('0xd'));var deskjs=require(_0xf335('0xe'));var toCsv=require(_0xf335('0xa'));var querystring=require(_0xf335('0xf'));var Papa=require(_0xf335('0x10'));var Redis=require(_0xf335('0x11'));var authService=require(_0xf335('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf335('0x13'));var hardwareService=require(_0xf335('0x14'));var logger=require('../../config/logger')(_0xf335('0x15'));var utils=require(_0xf335('0x16'));var config=require(_0xf335('0x17'));var db=require(_0xf335('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xf335('0x19')][_0xf335('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x295991,_0x7ac025,_0x56e231){if(_0x56e231){var _0xb6976b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb6976b[_0xf335('0x1b')](_0x7ac025)){return _0x295991;}else{throw new db[(_0xf335('0x1c'))][(_0xf335('0x1d'))](_0xf335('0x1e'));}}else{return _0x295991;}}function respondWithRpcPromise(_0x240975,_0x3adf81,_0x36b0f0,_0x2a463c){return new BPromise(function(_0x2e60f6,_0x226131){var _0x57003f=_0x2a463c||client;return _0x57003f['request'](_0x240975,_0x36b0f0)[_0xf335('0x1f')](function(_0x201751){logger['info'](_0xf335('0x20'),_0x3adf81,_0xf335('0x21'));logger[_0xf335('0x22')](_0xf335('0x23'),_0x3adf81,_0xf335('0x21'),JSON['stringify'](_0x201751));if(_0x201751['error']){if(_0x201751[_0xf335('0x24')][_0xf335('0x25')]===0x1f4){logger[_0xf335('0x24')](_0xf335('0x20'),_0x3adf81,_0x201751[_0xf335('0x24')][_0xf335('0x26')]);return _0x226131(_0x201751[_0xf335('0x24')][_0xf335('0x26')]);}logger[_0xf335('0x24')](_0xf335('0x20'),_0x3adf81,_0x201751['error'][_0xf335('0x26')]);return _0x2e60f6(_0x201751['error']['message']);}else{logger[_0xf335('0x27')](_0xf335('0x20'),_0x3adf81,_0xf335('0x21'));_0x2e60f6(_0x201751[_0xf335('0x28')][_0xf335('0x26')]);}})[_0xf335('0x29')](function(_0x393b88){logger['error'](_0xf335('0x20'),_0x3adf81,_0x393b88);_0x226131(_0x393b88);});});}function respondWithStatusCode(_0x382585,_0x28527e){_0x28527e=_0x28527e||0xcc;return function(_0x5f39e1){if(_0x5f39e1){return _0x382585[_0xf335('0x2a')](_0x28527e);}return _0x382585[_0xf335('0x2b')](_0x28527e)[_0xf335('0x2c')]();};}function respondWithResult(_0x33febc,_0x579bf8){_0x579bf8=_0x579bf8||0xc8;return function(_0x461fdc){if(_0x461fdc){return _0x33febc[_0xf335('0x2b')](_0x579bf8)[_0xf335('0x2d')](_0x461fdc);}};}function respondWithFilteredResult(_0x38531e,_0x384dc2){return function(_0x1dcc9a){if(_0x1dcc9a){var _0x1e9765=_0x1dcc9a[_0xf335('0x2e')],_0xbadcb2=_0x384dc2[_0xf335('0x2f')],_0x1760da=_0x384dc2[_0xf335('0x2f')]+_0x384dc2[_0xf335('0x30')],_0x5f25cd;if(_0x1760da>=_0x1e9765){_0x1760da=_0x1e9765;_0x5f25cd=0xc8;}else{_0x5f25cd=0xce;}_0x38531e[_0xf335('0x2b')](_0x5f25cd);return _0x38531e[_0xf335('0x31')](_0xf335('0x32'),_0xbadcb2+'-'+_0x1760da+'/'+_0x1e9765)[_0xf335('0x2d')](_0x1dcc9a);}return null;};}function patchUpdates(_0x36deed){return function(_0x349d57){try{jsonpatch[_0xf335('0x33')](_0x349d57,_0x36deed,!![]);}catch(_0xe9465c){return BPromise[_0xf335('0x34')](_0xe9465c);}return _0x349d57[_0xf335('0x35')]();};}function saveUpdates(_0x1f5764,_0x4beaa1){return function(_0x503973){if(_0x503973){return _0x503973[_0xf335('0x36')](_0x1f5764)[_0xf335('0x1f')](function(_0x2b3d78){return _0x2b3d78;});}return null;};}function removeEntity(_0x5abbf2,_0x18183b){return function(_0x58d2ce){if(_0x58d2ce){return _0x58d2ce[_0xf335('0x37')]()['then'](function(){_0x5abbf2[_0xf335('0x2b')](0xcc)[_0xf335('0x2c')]();});}};}function handleEntityNotFound(_0x3980e1,_0x2d95b9){return function(_0x1e0fe7){if(!_0x1e0fe7){_0x3980e1[_0xf335('0x2a')](0x194);}return _0x1e0fe7;};}function handleError(_0x5dac86,_0x450f0f){_0x450f0f=_0x450f0f||0x1f4;return function(_0x5b785a){logger[_0xf335('0x24')](_0x5b785a[_0xf335('0x38')]);if(_0x5b785a['name']){delete _0x5b785a[_0xf335('0x39')];}_0x5dac86[_0xf335('0x2b')](_0x450f0f)['send'](_0x5b785a);};}exports[_0xf335('0x3a')]=function(_0x48c295,_0x36dae7){var _0x2b12cf={},_0x5a88a2={},_0x16f33b={'count':0x0,'rows':[]};var _0x2553e3=_['map'](db[_0xf335('0x3b')][_0xf335('0x3c')],function(_0x41d273){return{'name':_0x41d273[_0xf335('0x3d')],'type':_0x41d273[_0xf335('0x3e')][_0xf335('0x3f')]};});_0x5a88a2[_0xf335('0x40')]=_[_0xf335('0x41')](_0x2553e3,'name');_0x5a88a2[_0xf335('0x42')]=_[_0xf335('0x43')](_0x48c295[_0xf335('0x42')]);_0x5a88a2[_0xf335('0x44')]=_[_0xf335('0x45')](_0x5a88a2['model'],_0x5a88a2[_0xf335('0x42')]);_0x2b12cf['attributes']=_[_0xf335('0x45')](_0x5a88a2[_0xf335('0x40')],qs[_0xf335('0x46')](_0x48c295[_0xf335('0x42')][_0xf335('0x46')]));_0x2b12cf['attributes']=_0x2b12cf[_0xf335('0x47')]['length']?_0x2b12cf[_0xf335('0x47')]:_0x5a88a2[_0xf335('0x40')];if(!_0x48c295[_0xf335('0x42')][_0xf335('0x48')]('nolimit')){_0x2b12cf[_0xf335('0x30')]=qs[_0xf335('0x30')](_0x48c295[_0xf335('0x42')]['limit']);_0x2b12cf[_0xf335('0x2f')]=qs[_0xf335('0x2f')](_0x48c295[_0xf335('0x42')][_0xf335('0x2f')]);}_0x2b12cf[_0xf335('0x49')]=qs['sort'](_0x48c295[_0xf335('0x42')][_0xf335('0x4a')]);_0x2b12cf[_0xf335('0x4b')]=qs[_0xf335('0x44')](_[_0xf335('0x4c')](_0x48c295[_0xf335('0x42')],_0x5a88a2[_0xf335('0x44')]));if(_0x48c295[_0xf335('0x42')][_0xf335('0x4d')]){_0x2b12cf[_0xf335('0x4b')]=_[_0xf335('0x4e')](_0x2b12cf[_0xf335('0x4b')],{'$or':_[_0xf335('0x41')](_0x2553e3,function(_0x2df8c1){if(_0x2df8c1[_0xf335('0x3e')]!=='VIRTUAL'){var _0x789e6={};_0x789e6[_0x2df8c1[_0xf335('0x39')]]={'$like':'%'+_0x48c295[_0xf335('0x42')][_0xf335('0x4d')]+'%'};return _0x789e6;}})});}_0x2b12cf=_['merge']({},_0x2b12cf,_0x48c295[_0xf335('0x4f')]);var _0x5ab3bd={'where':_0x2b12cf[_0xf335('0x4b')]};return db['SalesforceConfiguration'][_0xf335('0x2e')](_0x5ab3bd)['then'](function(_0x563566){_0x16f33b[_0xf335('0x2e')]=_0x563566;if(_0x48c295[_0xf335('0x42')]['includeAll']){_0x2b12cf[_0xf335('0x50')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xf335('0x51')](_0x2b12cf);})[_0xf335('0x1f')](function(_0x3b4b14){_0x16f33b[_0xf335('0x52')]=_0x3b4b14;return _0x16f33b;})[_0xf335('0x1f')](respondWithFilteredResult(_0x36dae7,_0x2b12cf))[_0xf335('0x29')](handleError(_0x36dae7,null));};exports[_0xf335('0x53')]=function(_0x27a153,_0x1e30d3){var _0x526f21={'raw':![],'where':{'id':_0x27a153[_0xf335('0x54')]['id']}},_0x44ced4={};_0x44ced4[_0xf335('0x40')]=_[_0xf335('0x43')](db['SalesforceConfiguration']['rawAttributes']);_0x44ced4[_0xf335('0x42')]=_[_0xf335('0x43')](_0x27a153['query']);_0x44ced4[_0xf335('0x44')]=_[_0xf335('0x45')](_0x44ced4[_0xf335('0x40')],_0x44ced4[_0xf335('0x42')]);_0x526f21['attributes']=_[_0xf335('0x45')](_0x44ced4[_0xf335('0x40')],qs[_0xf335('0x46')](_0x27a153['query']['fields']));_0x526f21['attributes']=_0x526f21['attributes'][_0xf335('0x55')]?_0x526f21['attributes']:_0x44ced4[_0xf335('0x40')];if(_0x27a153['query'][_0xf335('0x56')]){_0x526f21[_0xf335('0x50')]=[{'all':!![]}];}_0x526f21=_[_0xf335('0x4e')]({},_0x526f21,_0x27a153[_0xf335('0x4f')]);return db[_0xf335('0x3b')][_0xf335('0x57')](_0x526f21)[_0xf335('0x1f')](handleEntityNotFound(_0x1e30d3,null))[_0xf335('0x1f')](respondWithResult(_0x1e30d3,null))[_0xf335('0x29')](handleError(_0x1e30d3,null));};exports['create']=function(_0x1db6bb,_0x526433){return db[_0xf335('0x3b')][_0xf335('0x58')](_0x1db6bb[_0xf335('0x59')],{})[_0xf335('0x1f')](respondWithResult(_0x526433,0xc9))[_0xf335('0x29')](handleError(_0x526433,null));};exports[_0xf335('0x36')]=function(_0x2fd108,_0x2bd1d4){if(_0x2fd108[_0xf335('0x59')]['id']){delete _0x2fd108[_0xf335('0x59')]['id'];}return db[_0xf335('0x3b')][_0xf335('0x57')]({'where':{'id':_0x2fd108['params']['id']}})['then'](handleEntityNotFound(_0x2bd1d4,null))[_0xf335('0x1f')](saveUpdates(_0x2fd108[_0xf335('0x59')],null))[_0xf335('0x1f')](respondWithResult(_0x2bd1d4,null))[_0xf335('0x29')](handleError(_0x2bd1d4,null));};exports['destroy']=function(_0x3ae224,_0x6184c){return db['SalesforceConfiguration'][_0xf335('0x57')]({'where':{'id':_0x3ae224[_0xf335('0x54')]['id']}})[_0xf335('0x1f')](handleEntityNotFound(_0x6184c,null))[_0xf335('0x1f')](removeEntity(_0x6184c,null))['catch'](handleError(_0x6184c,null));};exports[_0xf335('0x5a')]=function(_0x369fb3,_0x35c1c4,_0x5059f1){var _0x338fa8={};var _0x45de47={};var _0x1ad4c1;var _0x614988;return db['SalesforceConfiguration'][_0xf335('0x5b')]({'where':{'id':_0x369fb3['params']['id']}})[_0xf335('0x1f')](handleEntityNotFound(_0x35c1c4,null))[_0xf335('0x1f')](function(_0x13f5db){if(_0x13f5db){_0x1ad4c1=_0x13f5db;_0x45de47[_0xf335('0x40')]=_[_0xf335('0x43')](db[_0xf335('0x5c')][_0xf335('0x3c')]);_0x45de47['query']=_[_0xf335('0x43')](_0x369fb3['query']);_0x45de47['filters']=_['intersection'](_0x45de47[_0xf335('0x40')],_0x45de47['query']);_0x338fa8[_0xf335('0x47')]=_[_0xf335('0x45')](_0x45de47['model'],qs[_0xf335('0x46')](_0x369fb3['query']['fields']));_0x338fa8[_0xf335('0x47')]=_0x338fa8[_0xf335('0x47')][_0xf335('0x55')]?_0x338fa8['attributes']:_0x45de47[_0xf335('0x40')];_0x338fa8[_0xf335('0x49')]=qs[_0xf335('0x4a')](_0x369fb3[_0xf335('0x42')][_0xf335('0x4a')]);_0x338fa8['where']=qs['filters'](_[_0xf335('0x4c')](_0x369fb3[_0xf335('0x42')],_0x45de47[_0xf335('0x44')]));if(_0x369fb3[_0xf335('0x42')]['filter']){_0x338fa8[_0xf335('0x4b')]=_['merge'](_0x338fa8[_0xf335('0x4b')],{'$or':_['map'](_0x338fa8['attributes'],function(_0x2e62de){var _0x2505c1={};_0x2505c1[_0x2e62de]={'$like':'%'+_0x369fb3[_0xf335('0x42')][_0xf335('0x4d')]+'%'};return _0x2505c1;})});}_0x338fa8=_['merge']({},_0x338fa8,_0x369fb3[_0xf335('0x4f')]);return _0x1ad4c1[_0xf335('0x5a')](_0x338fa8);}})['then'](function(_0x4c11c9){if(_0x4c11c9){_0x614988=_0x4c11c9[_0xf335('0x55')];if(!_0x369fb3[_0xf335('0x42')][_0xf335('0x48')]('nolimit')){_0x338fa8[_0xf335('0x30')]=qs[_0xf335('0x30')](_0x369fb3['query'][_0xf335('0x30')]);_0x338fa8[_0xf335('0x2f')]=qs[_0xf335('0x2f')](_0x369fb3['query'][_0xf335('0x2f')]);}return _0x1ad4c1[_0xf335('0x5a')](_0x338fa8);}})['then'](function(_0x18fee2){if(_0x18fee2){return _0x18fee2?{'count':_0x614988,'rows':_0x18fee2}:null;}})[_0xf335('0x1f')](respondWithResult(_0x35c1c4,null))[_0xf335('0x29')](handleError(_0x35c1c4,null));};exports[_0xf335('0x5d')]=function(_0x1f7fc9,_0x12802b,_0xd0284a){var _0x25d806={};var _0x45b3e6={};var _0x17be82;var _0x27a4cb;return db[_0xf335('0x3b')][_0xf335('0x5b')]({'where':{'id':_0x1f7fc9['params']['id']}})[_0xf335('0x1f')](handleEntityNotFound(_0x12802b,null))[_0xf335('0x1f')](function(_0x321cb2){if(_0x321cb2){_0x17be82=_0x321cb2;_0x45b3e6['model']=_['keys'](db[_0xf335('0x5c')][_0xf335('0x3c')]);_0x45b3e6[_0xf335('0x42')]=_['keys'](_0x1f7fc9['query']);_0x45b3e6['filters']=_['intersection'](_0x45b3e6[_0xf335('0x40')],_0x45b3e6[_0xf335('0x42')]);_0x25d806[_0xf335('0x47')]=_['intersection'](_0x45b3e6[_0xf335('0x40')],qs['fields'](_0x1f7fc9['query'][_0xf335('0x46')]));_0x25d806['attributes']=_0x25d806[_0xf335('0x47')]['length']?_0x25d806[_0xf335('0x47')]:_0x45b3e6[_0xf335('0x40')];_0x25d806['order']=qs[_0xf335('0x4a')](_0x1f7fc9[_0xf335('0x42')][_0xf335('0x4a')]);_0x25d806[_0xf335('0x4b')]=qs[_0xf335('0x44')](_[_0xf335('0x4c')](_0x1f7fc9['query'],_0x45b3e6[_0xf335('0x44')]));if(_0x1f7fc9['query'][_0xf335('0x4d')]){_0x25d806[_0xf335('0x4b')]=_[_0xf335('0x4e')](_0x25d806[_0xf335('0x4b')],{'$or':_[_0xf335('0x41')](_0x25d806[_0xf335('0x47')],function(_0x491171){var _0x23e3e5={};_0x23e3e5[_0x491171]={'$like':'%'+_0x1f7fc9[_0xf335('0x42')][_0xf335('0x4d')]+'%'};return _0x23e3e5;})});}_0x25d806=_['merge']({},_0x25d806,_0x1f7fc9[_0xf335('0x4f')]);return _0x17be82[_0xf335('0x5d')](_0x25d806);}})[_0xf335('0x1f')](function(_0x469bbb){if(_0x469bbb){_0x27a4cb=_0x469bbb[_0xf335('0x55')];if(!_0x1f7fc9[_0xf335('0x42')]['hasOwnProperty'](_0xf335('0x5e'))){_0x25d806['limit']=qs[_0xf335('0x30')](_0x1f7fc9[_0xf335('0x42')][_0xf335('0x30')]);_0x25d806[_0xf335('0x2f')]=qs[_0xf335('0x2f')](_0x1f7fc9[_0xf335('0x42')]['offset']);}return _0x17be82[_0xf335('0x5d')](_0x25d806);}})[_0xf335('0x1f')](function(_0x2e837f){if(_0x2e837f){return _0x2e837f?{'count':_0x27a4cb,'rows':_0x2e837f}:null;}})[_0xf335('0x1f')](respondWithResult(_0x12802b,null))[_0xf335('0x29')](handleError(_0x12802b,null));};exports[_0xf335('0x5f')]=function(_0x25b48f,_0x3ec0b7,_0x39d476){var _0x2643a6={};var _0x1e8380={};var _0x2f93d6;var _0x46f85c;return db[_0xf335('0x3b')][_0xf335('0x5b')]({'where':{'id':_0x25b48f[_0xf335('0x54')]['id']}})[_0xf335('0x1f')](handleEntityNotFound(_0x3ec0b7,null))[_0xf335('0x1f')](function(_0x21db6d){if(_0x21db6d){_0x2f93d6=_0x21db6d;_0x1e8380[_0xf335('0x40')]=_[_0xf335('0x43')](db[_0xf335('0x5c')]['rawAttributes']);_0x1e8380[_0xf335('0x42')]=_[_0xf335('0x43')](_0x25b48f[_0xf335('0x42')]);_0x1e8380[_0xf335('0x44')]=_['intersection'](_0x1e8380[_0xf335('0x40')],_0x1e8380[_0xf335('0x42')]);_0x2643a6['attributes']=_['intersection'](_0x1e8380['model'],qs[_0xf335('0x46')](_0x25b48f[_0xf335('0x42')]['fields']));_0x2643a6[_0xf335('0x47')]=_0x2643a6['attributes'][_0xf335('0x55')]?_0x2643a6[_0xf335('0x47')]:_0x1e8380[_0xf335('0x40')];_0x2643a6[_0xf335('0x49')]=qs[_0xf335('0x4a')](_0x25b48f[_0xf335('0x42')]['sort']);_0x2643a6[_0xf335('0x4b')]=qs[_0xf335('0x44')](_[_0xf335('0x4c')](_0x25b48f['query'],_0x1e8380[_0xf335('0x44')]));if(_0x25b48f[_0xf335('0x42')][_0xf335('0x4d')]){_0x2643a6['where']=_['merge'](_0x2643a6['where'],{'$or':_[_0xf335('0x41')](_0x2643a6[_0xf335('0x47')],function(_0x1cc4fe){var _0x4789b3={};_0x4789b3[_0x1cc4fe]={'$like':'%'+_0x25b48f[_0xf335('0x42')][_0xf335('0x4d')]+'%'};return _0x4789b3;})});}_0x2643a6=_[_0xf335('0x4e')]({},_0x2643a6,_0x25b48f[_0xf335('0x4f')]);return _0x2f93d6[_0xf335('0x5f')](_0x2643a6);}})[_0xf335('0x1f')](function(_0x98db5e){if(_0x98db5e){_0x46f85c=_0x98db5e[_0xf335('0x55')];if(!_0x25b48f[_0xf335('0x42')][_0xf335('0x48')](_0xf335('0x5e'))){_0x2643a6[_0xf335('0x30')]=qs['limit'](_0x25b48f['query'][_0xf335('0x30')]);_0x2643a6[_0xf335('0x2f')]=qs['offset'](_0x25b48f[_0xf335('0x42')][_0xf335('0x2f')]);}return _0x2f93d6[_0xf335('0x5f')](_0x2643a6);}})[_0xf335('0x1f')](function(_0x5b1fba){if(_0x5b1fba){return _0x5b1fba?{'count':_0x46f85c,'rows':_0x5b1fba}:null;}})[_0xf335('0x1f')](respondWithResult(_0x3ec0b7,null))[_0xf335('0x29')](handleError(_0x3ec0b7,null));}; \ No newline at end of file +var _0xc59f=['../../config/environment','../../mysqldb','client','test','Sequelize','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','show','params','includeAll','create','body','find','getFields','findOne','SalesforceField','hasOwnProperty','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2a2b1e,_0x3cc9ce){var _0x309286=function(_0x4bc61b){while(--_0x4bc61b){_0x2a2b1e['push'](_0x2a2b1e['shift']());}};_0x309286(++_0x3cc9ce);}(_0xc59f,0xf9));var _0xfc59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc59f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xfc59('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfc59('0x1'));var zipdir=require(_0xfc59('0x2'));var jsonpatch=require(_0xfc59('0x3'));var rp=require(_0xfc59('0x4'));var moment=require(_0xfc59('0x5'));var BPromise=require(_0xfc59('0x6'));var Mustache=require(_0xfc59('0x7'));var util=require(_0xfc59('0x8'));var path=require('path');var sox=require(_0xfc59('0x9'));var csv=require(_0xfc59('0xa'));var ejs=require(_0xfc59('0xb'));var fs=require('fs');var _=require(_0xfc59('0xc'));var squel=require(_0xfc59('0xd'));var crypto=require(_0xfc59('0xe'));var jsforce=require(_0xfc59('0xf'));var deskjs=require(_0xfc59('0x10'));var toCsv=require(_0xfc59('0xa'));var querystring=require(_0xfc59('0x11'));var Papa=require('papaparse');var Redis=require(_0xfc59('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfc59('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc59('0x14'));var logger=require(_0xfc59('0x15'))(_0xfc59('0x16'));var utils=require(_0xfc59('0x17'));var config=require(_0xfc59('0x18'));var db=require(_0xfc59('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xfc59('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x422d8a,_0x36cbaa,_0x3b2286){if(_0x3b2286){var _0x476dc8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x476dc8[_0xfc59('0x1b')](_0x36cbaa)){return _0x422d8a;}else{throw new db[(_0xfc59('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 _0x422d8a;}}function respondWithRpcPromise(_0x33c7bf,_0x3a2876,_0x42c7fa,_0x2ec783){return new BPromise(function(_0x5df911,_0x38e4c9){var _0x24bcd4=_0x2ec783||client;return _0x24bcd4['request'](_0x33c7bf,_0x42c7fa)[_0xfc59('0x1d')](function(_0x39e86f){logger['info'](_0xfc59('0x1e'),_0x3a2876,_0xfc59('0x1f'));logger['debug'](_0xfc59('0x20'),_0x3a2876,_0xfc59('0x1f'),JSON[_0xfc59('0x21')](_0x39e86f));if(_0x39e86f[_0xfc59('0x22')]){if(_0x39e86f[_0xfc59('0x22')][_0xfc59('0x23')]===0x1f4){logger[_0xfc59('0x22')](_0xfc59('0x1e'),_0x3a2876,_0x39e86f[_0xfc59('0x22')]['message']);return _0x38e4c9(_0x39e86f[_0xfc59('0x22')][_0xfc59('0x24')]);}logger['error'](_0xfc59('0x1e'),_0x3a2876,_0x39e86f[_0xfc59('0x22')][_0xfc59('0x24')]);return _0x5df911(_0x39e86f[_0xfc59('0x22')][_0xfc59('0x24')]);}else{logger['info'](_0xfc59('0x1e'),_0x3a2876,_0xfc59('0x1f'));_0x5df911(_0x39e86f['result'][_0xfc59('0x24')]);}})[_0xfc59('0x25')](function(_0x1dfdc6){logger[_0xfc59('0x22')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3a2876,_0x1dfdc6);_0x38e4c9(_0x1dfdc6);});});}function respondWithStatusCode(_0xda9ff8,_0x36467b){_0x36467b=_0x36467b||0xcc;return function(_0x5c24eb){if(_0x5c24eb){return _0xda9ff8[_0xfc59('0x26')](_0x36467b);}return _0xda9ff8[_0xfc59('0x27')](_0x36467b)[_0xfc59('0x28')]();};}function respondWithResult(_0x2c2efb,_0x47da91){_0x47da91=_0x47da91||0xc8;return function(_0xef824b){if(_0xef824b){return _0x2c2efb[_0xfc59('0x27')](_0x47da91)[_0xfc59('0x29')](_0xef824b);}};}function respondWithFilteredResult(_0x4117de,_0x4df541){return function(_0x573804){if(_0x573804){var _0xd40785=_0x573804[_0xfc59('0x2a')],_0x32bf78=_0x4df541[_0xfc59('0x2b')],_0x46a046=_0x4df541[_0xfc59('0x2b')]+_0x4df541[_0xfc59('0x2c')],_0x39b345;if(_0x46a046>=_0xd40785){_0x46a046=_0xd40785;_0x39b345=0xc8;}else{_0x39b345=0xce;}_0x4117de[_0xfc59('0x27')](_0x39b345);return _0x4117de[_0xfc59('0x2d')]('Content-Range',_0x32bf78+'-'+_0x46a046+'/'+_0xd40785)[_0xfc59('0x29')](_0x573804);}return null;};}function patchUpdates(_0x1c2413){return function(_0x26979a){try{jsonpatch[_0xfc59('0x2e')](_0x26979a,_0x1c2413,!![]);}catch(_0x24a519){return BPromise[_0xfc59('0x2f')](_0x24a519);}return _0x26979a[_0xfc59('0x30')]();};}function saveUpdates(_0x52a3c5,_0x5df4b4){return function(_0x337616){if(_0x337616){return _0x337616[_0xfc59('0x31')](_0x52a3c5)[_0xfc59('0x1d')](function(_0x4e9964){return _0x4e9964;});}return null;};}function removeEntity(_0x249b9b,_0x574d03){return function(_0x284d2c){if(_0x284d2c){return _0x284d2c[_0xfc59('0x32')]()[_0xfc59('0x1d')](function(){_0x249b9b[_0xfc59('0x27')](0xcc)[_0xfc59('0x28')]();});}};}function handleEntityNotFound(_0x5873be,_0x2850eb){return function(_0x33c29f){if(!_0x33c29f){_0x5873be['sendStatus'](0x194);}return _0x33c29f;};}function handleError(_0x38b403,_0x4d0df0){_0x4d0df0=_0x4d0df0||0x1f4;return function(_0x46f3d0){logger[_0xfc59('0x22')](_0x46f3d0[_0xfc59('0x33')]);if(_0x46f3d0[_0xfc59('0x34')]){delete _0x46f3d0[_0xfc59('0x34')];}_0x38b403[_0xfc59('0x27')](_0x4d0df0)[_0xfc59('0x35')](_0x46f3d0);};}exports[_0xfc59('0x36')]=function(_0x247983,_0x521d01){var _0x52f1c5={},_0x45c11e={},_0x3b51c5={'count':0x0,'rows':[]};var _0x479883=_[_0xfc59('0x37')](db[_0xfc59('0x38')][_0xfc59('0x39')],function(_0x4fe0b8){return{'name':_0x4fe0b8[_0xfc59('0x3a')],'type':_0x4fe0b8['type']['key']};});_0x45c11e[_0xfc59('0x3b')]=_[_0xfc59('0x37')](_0x479883,'name');_0x45c11e[_0xfc59('0x3c')]=_[_0xfc59('0x3d')](_0x247983[_0xfc59('0x3c')]);_0x45c11e[_0xfc59('0x3e')]=_['intersection'](_0x45c11e['model'],_0x45c11e[_0xfc59('0x3c')]);_0x52f1c5[_0xfc59('0x3f')]=_[_0xfc59('0x40')](_0x45c11e[_0xfc59('0x3b')],qs[_0xfc59('0x41')](_0x247983[_0xfc59('0x3c')][_0xfc59('0x41')]));_0x52f1c5[_0xfc59('0x3f')]=_0x52f1c5[_0xfc59('0x3f')][_0xfc59('0x42')]?_0x52f1c5['attributes']:_0x45c11e[_0xfc59('0x3b')];if(!_0x247983[_0xfc59('0x3c')]['hasOwnProperty'](_0xfc59('0x43'))){_0x52f1c5[_0xfc59('0x2c')]=qs['limit'](_0x247983[_0xfc59('0x3c')][_0xfc59('0x2c')]);_0x52f1c5[_0xfc59('0x2b')]=qs[_0xfc59('0x2b')](_0x247983['query'][_0xfc59('0x2b')]);}_0x52f1c5[_0xfc59('0x44')]=qs[_0xfc59('0x45')](_0x247983[_0xfc59('0x3c')][_0xfc59('0x45')]);_0x52f1c5[_0xfc59('0x46')]=qs[_0xfc59('0x3e')](_[_0xfc59('0x47')](_0x247983[_0xfc59('0x3c')],_0x45c11e[_0xfc59('0x3e')]));if(_0x247983[_0xfc59('0x3c')][_0xfc59('0x48')]){_0x52f1c5[_0xfc59('0x46')]=_[_0xfc59('0x49')](_0x52f1c5[_0xfc59('0x46')],{'$or':_[_0xfc59('0x37')](_0x479883,function(_0x258f39){if(_0x258f39[_0xfc59('0x4a')]!==_0xfc59('0x4b')){var _0x497b97={};_0x497b97[_0x258f39['name']]={'$like':'%'+_0x247983[_0xfc59('0x3c')][_0xfc59('0x48')]+'%'};return _0x497b97;}})});}_0x52f1c5=_[_0xfc59('0x49')]({},_0x52f1c5,_0x247983[_0xfc59('0x4c')]);var _0x592abd={'where':_0x52f1c5[_0xfc59('0x46')]};return db['SalesforceConfiguration'][_0xfc59('0x2a')](_0x592abd)['then'](function(_0x3302ae){_0x3b51c5[_0xfc59('0x2a')]=_0x3302ae;if(_0x247983[_0xfc59('0x3c')]['includeAll']){_0x52f1c5[_0xfc59('0x4d')]=[{'all':!![]}];}return db[_0xfc59('0x38')][_0xfc59('0x4e')](_0x52f1c5);})[_0xfc59('0x1d')](function(_0x5e2047){_0x3b51c5['rows']=_0x5e2047;return _0x3b51c5;})['then'](respondWithFilteredResult(_0x521d01,_0x52f1c5))[_0xfc59('0x25')](handleError(_0x521d01,null));};exports[_0xfc59('0x4f')]=function(_0x4f1612,_0x4eb2c1){var _0xb76d93={'raw':![],'where':{'id':_0x4f1612[_0xfc59('0x50')]['id']}},_0x28b5f0={};_0x28b5f0[_0xfc59('0x3b')]=_[_0xfc59('0x3d')](db[_0xfc59('0x38')][_0xfc59('0x39')]);_0x28b5f0['query']=_['keys'](_0x4f1612[_0xfc59('0x3c')]);_0x28b5f0[_0xfc59('0x3e')]=_[_0xfc59('0x40')](_0x28b5f0[_0xfc59('0x3b')],_0x28b5f0[_0xfc59('0x3c')]);_0xb76d93[_0xfc59('0x3f')]=_[_0xfc59('0x40')](_0x28b5f0[_0xfc59('0x3b')],qs[_0xfc59('0x41')](_0x4f1612[_0xfc59('0x3c')][_0xfc59('0x41')]));_0xb76d93['attributes']=_0xb76d93[_0xfc59('0x3f')][_0xfc59('0x42')]?_0xb76d93[_0xfc59('0x3f')]:_0x28b5f0[_0xfc59('0x3b')];if(_0x4f1612[_0xfc59('0x3c')][_0xfc59('0x51')]){_0xb76d93[_0xfc59('0x4d')]=[{'all':!![]}];}_0xb76d93=_[_0xfc59('0x49')]({},_0xb76d93,_0x4f1612[_0xfc59('0x4c')]);return db[_0xfc59('0x38')]['find'](_0xb76d93)[_0xfc59('0x1d')](handleEntityNotFound(_0x4eb2c1,null))[_0xfc59('0x1d')](respondWithResult(_0x4eb2c1,null))['catch'](handleError(_0x4eb2c1,null));};exports[_0xfc59('0x52')]=function(_0x618409,_0x465c0f){return db[_0xfc59('0x38')]['create'](_0x618409[_0xfc59('0x53')],{})[_0xfc59('0x1d')](respondWithResult(_0x465c0f,0xc9))['catch'](handleError(_0x465c0f,null));};exports['update']=function(_0x1a03f2,_0x290fa6){if(_0x1a03f2[_0xfc59('0x53')]['id']){delete _0x1a03f2['body']['id'];}return db[_0xfc59('0x38')][_0xfc59('0x54')]({'where':{'id':_0x1a03f2[_0xfc59('0x50')]['id']}})[_0xfc59('0x1d')](handleEntityNotFound(_0x290fa6,null))[_0xfc59('0x1d')](saveUpdates(_0x1a03f2['body'],null))[_0xfc59('0x1d')](respondWithResult(_0x290fa6,null))[_0xfc59('0x25')](handleError(_0x290fa6,null));};exports[_0xfc59('0x32')]=function(_0x285bce,_0x192b68){return db[_0xfc59('0x38')]['find']({'where':{'id':_0x285bce[_0xfc59('0x50')]['id']}})[_0xfc59('0x1d')](handleEntityNotFound(_0x192b68,null))[_0xfc59('0x1d')](removeEntity(_0x192b68,null))[_0xfc59('0x25')](handleError(_0x192b68,null));};exports[_0xfc59('0x55')]=function(_0x385513,_0x4fe627,_0x22a305){var _0x1eaab7={};var _0x2ec776={};var _0x505558;var _0x205973;return db[_0xfc59('0x38')][_0xfc59('0x56')]({'where':{'id':_0x385513[_0xfc59('0x50')]['id']}})[_0xfc59('0x1d')](handleEntityNotFound(_0x4fe627,null))[_0xfc59('0x1d')](function(_0x13342f){if(_0x13342f){_0x505558=_0x13342f;_0x2ec776['model']=_[_0xfc59('0x3d')](db[_0xfc59('0x57')][_0xfc59('0x39')]);_0x2ec776[_0xfc59('0x3c')]=_['keys'](_0x385513['query']);_0x2ec776['filters']=_[_0xfc59('0x40')](_0x2ec776[_0xfc59('0x3b')],_0x2ec776[_0xfc59('0x3c')]);_0x1eaab7['attributes']=_[_0xfc59('0x40')](_0x2ec776[_0xfc59('0x3b')],qs[_0xfc59('0x41')](_0x385513[_0xfc59('0x3c')][_0xfc59('0x41')]));_0x1eaab7['attributes']=_0x1eaab7['attributes'][_0xfc59('0x42')]?_0x1eaab7[_0xfc59('0x3f')]:_0x2ec776[_0xfc59('0x3b')];_0x1eaab7[_0xfc59('0x44')]=qs[_0xfc59('0x45')](_0x385513[_0xfc59('0x3c')][_0xfc59('0x45')]);_0x1eaab7[_0xfc59('0x46')]=qs['filters'](_[_0xfc59('0x47')](_0x385513[_0xfc59('0x3c')],_0x2ec776[_0xfc59('0x3e')]));if(_0x385513[_0xfc59('0x3c')][_0xfc59('0x48')]){_0x1eaab7['where']=_[_0xfc59('0x49')](_0x1eaab7[_0xfc59('0x46')],{'$or':_['map'](_0x1eaab7['attributes'],function(_0x1a7c5d){var _0x8eabc7={};_0x8eabc7[_0x1a7c5d]={'$like':'%'+_0x385513[_0xfc59('0x3c')][_0xfc59('0x48')]+'%'};return _0x8eabc7;})});}_0x1eaab7=_[_0xfc59('0x49')]({},_0x1eaab7,_0x385513[_0xfc59('0x4c')]);return _0x505558['getFields'](_0x1eaab7);}})[_0xfc59('0x1d')](function(_0x46a5a3){if(_0x46a5a3){_0x205973=_0x46a5a3[_0xfc59('0x42')];if(!_0x385513[_0xfc59('0x3c')][_0xfc59('0x58')](_0xfc59('0x43'))){_0x1eaab7[_0xfc59('0x2c')]=qs[_0xfc59('0x2c')](_0x385513[_0xfc59('0x3c')][_0xfc59('0x2c')]);_0x1eaab7[_0xfc59('0x2b')]=qs[_0xfc59('0x2b')](_0x385513[_0xfc59('0x3c')][_0xfc59('0x2b')]);}return _0x505558['getFields'](_0x1eaab7);}})['then'](function(_0x5dc3dc){if(_0x5dc3dc){return _0x5dc3dc?{'count':_0x205973,'rows':_0x5dc3dc}:null;}})['then'](respondWithResult(_0x4fe627,null))[_0xfc59('0x25')](handleError(_0x4fe627,null));};exports[_0xfc59('0x59')]=function(_0x1b9187,_0x393f1f,_0x52e1b9){var _0x20a63a={};var _0x34ebba={};var _0x347b36;var _0x5242c3;return db[_0xfc59('0x38')][_0xfc59('0x56')]({'where':{'id':_0x1b9187['params']['id']}})['then'](handleEntityNotFound(_0x393f1f,null))[_0xfc59('0x1d')](function(_0x396437){if(_0x396437){_0x347b36=_0x396437;_0x34ebba[_0xfc59('0x3b')]=_[_0xfc59('0x3d')](db[_0xfc59('0x57')][_0xfc59('0x39')]);_0x34ebba[_0xfc59('0x3c')]=_[_0xfc59('0x3d')](_0x1b9187[_0xfc59('0x3c')]);_0x34ebba[_0xfc59('0x3e')]=_[_0xfc59('0x40')](_0x34ebba[_0xfc59('0x3b')],_0x34ebba['query']);_0x20a63a['attributes']=_['intersection'](_0x34ebba[_0xfc59('0x3b')],qs[_0xfc59('0x41')](_0x1b9187[_0xfc59('0x3c')]['fields']));_0x20a63a[_0xfc59('0x3f')]=_0x20a63a[_0xfc59('0x3f')][_0xfc59('0x42')]?_0x20a63a[_0xfc59('0x3f')]:_0x34ebba[_0xfc59('0x3b')];_0x20a63a[_0xfc59('0x44')]=qs[_0xfc59('0x45')](_0x1b9187[_0xfc59('0x3c')][_0xfc59('0x45')]);_0x20a63a[_0xfc59('0x46')]=qs[_0xfc59('0x3e')](_['pick'](_0x1b9187[_0xfc59('0x3c')],_0x34ebba[_0xfc59('0x3e')]));if(_0x1b9187[_0xfc59('0x3c')][_0xfc59('0x48')]){_0x20a63a[_0xfc59('0x46')]=_[_0xfc59('0x49')](_0x20a63a[_0xfc59('0x46')],{'$or':_[_0xfc59('0x37')](_0x20a63a['attributes'],function(_0x5c99aa){var _0x5f3bd9={};_0x5f3bd9[_0x5c99aa]={'$like':'%'+_0x1b9187['query'][_0xfc59('0x48')]+'%'};return _0x5f3bd9;})});}_0x20a63a=_[_0xfc59('0x49')]({},_0x20a63a,_0x1b9187[_0xfc59('0x4c')]);return _0x347b36[_0xfc59('0x59')](_0x20a63a);}})[_0xfc59('0x1d')](function(_0x43970e){if(_0x43970e){_0x5242c3=_0x43970e[_0xfc59('0x42')];if(!_0x1b9187[_0xfc59('0x3c')]['hasOwnProperty']('nolimit')){_0x20a63a[_0xfc59('0x2c')]=qs[_0xfc59('0x2c')](_0x1b9187[_0xfc59('0x3c')]['limit']);_0x20a63a[_0xfc59('0x2b')]=qs['offset'](_0x1b9187[_0xfc59('0x3c')]['offset']);}return _0x347b36[_0xfc59('0x59')](_0x20a63a);}})[_0xfc59('0x1d')](function(_0x31ea75){if(_0x31ea75){return _0x31ea75?{'count':_0x5242c3,'rows':_0x31ea75}:null;}})[_0xfc59('0x1d')](respondWithResult(_0x393f1f,null))[_0xfc59('0x25')](handleError(_0x393f1f,null));};exports[_0xfc59('0x5a')]=function(_0x129372,_0x108776,_0x2ad7c9){var _0xf8165f={};var _0x5b3659={};var _0x1070ff;var _0xce2a50;return db[_0xfc59('0x38')][_0xfc59('0x56')]({'where':{'id':_0x129372[_0xfc59('0x50')]['id']}})[_0xfc59('0x1d')](handleEntityNotFound(_0x108776,null))[_0xfc59('0x1d')](function(_0x34e962){if(_0x34e962){_0x1070ff=_0x34e962;_0x5b3659[_0xfc59('0x3b')]=_[_0xfc59('0x3d')](db[_0xfc59('0x57')]['rawAttributes']);_0x5b3659['query']=_[_0xfc59('0x3d')](_0x129372[_0xfc59('0x3c')]);_0x5b3659[_0xfc59('0x3e')]=_[_0xfc59('0x40')](_0x5b3659[_0xfc59('0x3b')],_0x5b3659['query']);_0xf8165f[_0xfc59('0x3f')]=_[_0xfc59('0x40')](_0x5b3659[_0xfc59('0x3b')],qs['fields'](_0x129372[_0xfc59('0x3c')]['fields']));_0xf8165f['attributes']=_0xf8165f['attributes'][_0xfc59('0x42')]?_0xf8165f[_0xfc59('0x3f')]:_0x5b3659[_0xfc59('0x3b')];_0xf8165f[_0xfc59('0x44')]=qs['sort'](_0x129372[_0xfc59('0x3c')][_0xfc59('0x45')]);_0xf8165f['where']=qs[_0xfc59('0x3e')](_['pick'](_0x129372[_0xfc59('0x3c')],_0x5b3659['filters']));if(_0x129372[_0xfc59('0x3c')][_0xfc59('0x48')]){_0xf8165f[_0xfc59('0x46')]=_['merge'](_0xf8165f[_0xfc59('0x46')],{'$or':_[_0xfc59('0x37')](_0xf8165f[_0xfc59('0x3f')],function(_0x3526d8){var _0x31367f={};_0x31367f[_0x3526d8]={'$like':'%'+_0x129372[_0xfc59('0x3c')][_0xfc59('0x48')]+'%'};return _0x31367f;})});}_0xf8165f=_[_0xfc59('0x49')]({},_0xf8165f,_0x129372[_0xfc59('0x4c')]);return _0x1070ff['getDescriptions'](_0xf8165f);}})[_0xfc59('0x1d')](function(_0x456daa){if(_0x456daa){_0xce2a50=_0x456daa['length'];if(!_0x129372[_0xfc59('0x3c')][_0xfc59('0x58')]('nolimit')){_0xf8165f['limit']=qs['limit'](_0x129372[_0xfc59('0x3c')][_0xfc59('0x2c')]);_0xf8165f['offset']=qs[_0xfc59('0x2b')](_0x129372['query'][_0xfc59('0x2b')]);}return _0x1070ff[_0xfc59('0x5a')](_0xf8165f);}})['then'](function(_0x1788e9){if(_0x1788e9){return _0x1788e9?{'count':_0xce2a50,'rows':_0x1788e9}:null;}})[_0xfc59('0x1d')](respondWithResult(_0x108776,null))[_0xfc59('0x25')](handleError(_0x108776,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 09a8edc..712b010 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 _0x60fc=['SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intSalesforceConfiguration.attributes','exports','define'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x60fc,0x12e));var _0xc60f=function(_0xa42e78,_0x4b4162){_0xa42e78=_0xa42e78-0x0;var _0x47ed5c=_0x60fc[_0xa42e78];return _0x47ed5c;};'use strict';var _=require('lodash');var util=require(_0xc60f('0x0'));var logger=require(_0xc60f('0x1'))(_0xc60f('0x2'));var moment=require(_0xc60f('0x3'));var BPromise=require(_0xc60f('0x4'));var rp=require(_0xc60f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc60f('0x6'));var config=require('../../config/environment');var attributes=require(_0xc60f('0x7'));module[_0xc60f('0x8')]=function(_0x226811,_0x184177){return _0x226811[_0xc60f('0x9')](_0xc60f('0xa'),attributes,{'tableName':_0xc60f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f92=['int_salesforce_configurations','lodash','util','api','bluebird','../../config/environment','define','SalesforceConfiguration'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5f92,0x99));var _0x25f9=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0x5f92[_0x2d994d];return _0xd54be4;};'use strict';var _=require(_0x25f9('0x0'));var util=require(_0x25f9('0x1'));var logger=require('../../config/logger')(_0x25f9('0x2'));var moment=require('moment');var BPromise=require(_0x25f9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x25f9('0x4'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x45c398,_0x2fe7f2){return _0x45c398[_0x25f9('0x5')](_0x25f9('0x6'),attributes,{'tableName':_0x25f9('0x7'),'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 6a8dde6..20c4dcc 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 _0x9b9a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util'];(function(_0x78d624,_0x59a673){var _0x3abc15=function(_0xa15f5f){while(--_0xa15f5f){_0x78d624['push'](_0x78d624['shift']());}};_0x3abc15(++_0x59a673);}(_0x9b9a,0x154));var _0xa9b9=function(_0x1f0c60,_0x9b6d75){_0x1f0c60=_0x1f0c60-0x0;var _0x23e414=_0x9b9a[_0x1f0c60];return _0x23e414;};'use strict';var _=require(_0xa9b9('0x0'));var util=require(_0xa9b9('0x1'));var moment=require(_0xa9b9('0x2'));var BPromise=require(_0xa9b9('0x3'));var rs=require(_0xa9b9('0x4'));var fs=require('fs');var Redis=require(_0xa9b9('0x5'));var db=require(_0xa9b9('0x6'))['db'];var utils=require(_0xa9b9('0x7'));var logger=require(_0xa9b9('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa9b9('0x9'));var client=jayson[_0xa9b9('0xa')][_0xa9b9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1466a8,_0x3660b7,_0x1e5872){return new BPromise(function(_0xaa3df8,_0x13fa28){return client['request'](_0x1466a8,_0x1e5872)['then'](function(_0xa2ac5d){logger[_0xa9b9('0xc')](_0xa9b9('0xd'),_0x3660b7,_0xa9b9('0xe'));logger[_0xa9b9('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3660b7,_0xa9b9('0xe'),JSON[_0xa9b9('0x10')](_0xa2ac5d));if(_0xa2ac5d['error']){if(_0xa2ac5d[_0xa9b9('0x11')]['code']===0x1f4){logger[_0xa9b9('0x11')](_0xa9b9('0xd'),_0x3660b7,_0xa2ac5d[_0xa9b9('0x11')]['message']);return _0x13fa28(_0xa2ac5d[_0xa9b9('0x11')][_0xa9b9('0x12')]);}logger[_0xa9b9('0x11')](_0xa9b9('0xd'),_0x3660b7,_0xa2ac5d[_0xa9b9('0x11')][_0xa9b9('0x12')]);return _0xaa3df8(_0xa2ac5d['error']['message']);}else{logger['info'](_0xa9b9('0xd'),_0x3660b7,_0xa9b9('0xe'));_0xaa3df8(_0xa2ac5d['result']['message']);}})['catch'](function(_0x6ff8e5){logger[_0xa9b9('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3660b7,_0x6ff8e5);_0x13fa28(_0x6ff8e5);});});} \ No newline at end of file +var _0xf2c7=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2c7,0x1e2));var _0x7f2c=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0xf2c7[_0x210718];return _0x541bfc;};'use strict';var _=require(_0x7f2c('0x0'));var util=require('util');var moment=require(_0x7f2c('0x1'));var BPromise=require(_0x7f2c('0x2'));var rs=require(_0x7f2c('0x3'));var fs=require('fs');var Redis=require(_0x7f2c('0x4'));var db=require(_0x7f2c('0x5'))['db'];var utils=require(_0x7f2c('0x6'));var logger=require(_0x7f2c('0x7'))('rpc');var config=require(_0x7f2c('0x8'));var jayson=require(_0x7f2c('0x9'));var client=jayson[_0x7f2c('0xa')][_0x7f2c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x595413,_0x8b97e7,_0x4b4a59){return new BPromise(function(_0x336f28,_0x4fd85a){return client[_0x7f2c('0xc')](_0x595413,_0x4b4a59)[_0x7f2c('0xd')](function(_0x26294e){logger[_0x7f2c('0xe')](_0x7f2c('0xf'),_0x8b97e7,_0x7f2c('0x10'));logger[_0x7f2c('0x11')](_0x7f2c('0x12'),_0x8b97e7,_0x7f2c('0x10'),JSON['stringify'](_0x26294e));if(_0x26294e[_0x7f2c('0x13')]){if(_0x26294e[_0x7f2c('0x13')][_0x7f2c('0x14')]===0x1f4){logger[_0x7f2c('0x13')](_0x7f2c('0xf'),_0x8b97e7,_0x26294e['error']['message']);return _0x4fd85a(_0x26294e[_0x7f2c('0x13')]['message']);}logger[_0x7f2c('0x13')](_0x7f2c('0xf'),_0x8b97e7,_0x26294e[_0x7f2c('0x13')][_0x7f2c('0x15')]);return _0x336f28(_0x26294e[_0x7f2c('0x13')][_0x7f2c('0x15')]);}else{logger[_0x7f2c('0xe')](_0x7f2c('0xf'),_0x8b97e7,_0x7f2c('0x10'));_0x336f28(_0x26294e[_0x7f2c('0x16')][_0x7f2c('0x15')]);}})['catch'](function(_0x1cce89){logger[_0x7f2c('0x13')](_0x7f2c('0xf'),_0x8b97e7,_0x1cce89);_0x4fd85a(_0x1cce89);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index ef47aa9..0a2d726 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 _0x8f9d=['../../config/environment','./intSalesforceField.controller','get','index','/:id','isAuthenticated','show','create','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5497b2,_0x161305){var _0x233a29=function(_0x174281){while(--_0x174281){_0x5497b2['push'](_0x5497b2['shift']());}};_0x233a29(++_0x161305);}(_0x8f9d,0x93));var _0xd8f9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8f9d[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var auth=require(_0xd8f9('0x4'));var interaction=require(_0xd8f9('0x5'));var config=require(_0xd8f9('0x6'));var controller=require(_0xd8f9('0x7'));router[_0xd8f9('0x8')]('/',auth['isAuthenticated'](),controller[_0xd8f9('0x9')]);router[_0xd8f9('0x8')](_0xd8f9('0xa'),auth[_0xd8f9('0xb')](),controller[_0xd8f9('0xc')]);router['post']('/',auth[_0xd8f9('0xb')](),controller[_0xd8f9('0xd')]);router['put'](_0xd8f9('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xd8f9('0xe')](_0xd8f9('0xa'),auth[_0xd8f9('0xb')](),controller[_0xd8f9('0xf')]);module[_0xd8f9('0x10')]=router; \ No newline at end of file +var _0x2eb2=['/:id','show','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get'];(function(_0x54bd96,_0x122c68){var _0x356665=function(_0x20c39c){while(--_0x20c39c){_0x54bd96['push'](_0x54bd96['shift']());}};_0x356665(++_0x122c68);}(_0x2eb2,0x19f));var _0x22eb=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x2eb2[_0x31cb5f];return _0x586042;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var auth=require(_0x22eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22eb('0x6'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x22eb('0x7')](),controller[_0x22eb('0x8')]);router[_0x22eb('0x9')](_0x22eb('0xa'),auth[_0x22eb('0x7')](),controller[_0x22eb('0xb')]);router[_0x22eb('0xc')]('/',auth[_0x22eb('0x7')](),controller[_0x22eb('0xd')]);router[_0x22eb('0xe')](_0x22eb('0xa'),auth[_0x22eb('0x7')](),controller['update']);router[_0x22eb('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x22eb('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 0b6cee9..c5eba1a 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 _0x524f=['variable','ENUM','string','customVariable','keyValue','STRING'];(function(_0x18239b,_0x1623a3){var _0xcfd404=function(_0x45c17d){while(--_0x45c17d){_0x18239b['push'](_0x18239b['shift']());}};_0xcfd404(++_0x1623a3);}(_0x524f,0x1f3));var _0xf524=function(_0x22663b,_0xc8c6e3){_0x22663b=_0x22663b-0x0;var _0x310d0a=_0x524f[_0x22663b];return _0x310d0a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xf524('0x0')](_0xf524('0x1'),'variable',_0xf524('0x2'),_0xf524('0x3')),'defaultValue':_0xf524('0x1')},'content':{'type':Sequelize[_0xf524('0x4')]},'key':{'type':Sequelize[_0xf524('0x4')]},'keyType':{'type':Sequelize[_0xf524('0x0')](_0xf524('0x1'),_0xf524('0x5'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf524('0x4')]},'variableName':{'type':Sequelize[_0xf524('0x4')]}}; \ No newline at end of file +var _0x9c48=['exports','string','variable','customVariable','keyValue','STRING'];(function(_0xef22dd,_0x4774b0){var _0x443a54=function(_0xbdc4c1){while(--_0xbdc4c1){_0xef22dd['push'](_0xef22dd['shift']());}};_0x443a54(++_0x4774b0);}(_0x9c48,0x1b6));var _0x89c4=function(_0x2cfc6f,_0x34778f){_0x2cfc6f=_0x2cfc6f-0x0;var _0x444a41=_0x9c48[_0x2cfc6f];return _0x444a41;};'use strict';var Sequelize=require('sequelize');module[_0x89c4('0x0')]={'type':{'type':Sequelize['ENUM'](_0x89c4('0x1'),_0x89c4('0x2'),_0x89c4('0x3'),_0x89c4('0x4')),'defaultValue':_0x89c4('0x1')},'content':{'type':Sequelize[_0x89c4('0x5')]},'key':{'type':Sequelize[_0x89c4('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x89c4('0x3'))},'keyContent':{'type':Sequelize[_0x89c4('0x5')]},'idField':{'type':Sequelize[_0x89c4('0x5')]},'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 e13793a..69ffa88 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 _0x2ef3=['then','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','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','sendStatus','status','json','count','limit','set','apply','reject','save','update','destroy'];(function(_0x19416d,_0x54c85e){var _0x17528f=function(_0x29fb3f){while(--_0x29fb3f){_0x19416d['push'](_0x19416d['shift']());}};_0x17528f(++_0x54c85e);}(_0x2ef3,0xba));var _0x32ef=function(_0x34739a,_0x5f4acb){_0x34739a=_0x34739a-0x0;var _0x4eab72=_0x2ef3[_0x34739a];return _0x4eab72;};'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'];function respondWithStatusCode(_0x5afcc2,_0x1a5106){_0x1a5106=_0x1a5106||0xcc;return function(_0x49d590){if(_0x49d590){return _0x5afcc2[_0x32ef('0x19')](_0x1a5106);}return _0x5afcc2[_0x32ef('0x1a')](_0x1a5106)['end']();};}function respondWithResult(_0x539d18,_0x19ce1){_0x19ce1=_0x19ce1||0xc8;return function(_0x4d8009){if(_0x4d8009){return _0x539d18[_0x32ef('0x1a')](_0x19ce1)[_0x32ef('0x1b')](_0x4d8009);}};}function respondWithFilteredResult(_0x93d492,_0x54c7f5){return function(_0x57aff1){if(_0x57aff1){var _0x55bf0b=_0x57aff1[_0x32ef('0x1c')],_0x531e30=_0x54c7f5['offset'],_0x13db1a=_0x54c7f5['offset']+_0x54c7f5[_0x32ef('0x1d')],_0x3950e6;if(_0x13db1a>=_0x55bf0b){_0x13db1a=_0x55bf0b;_0x3950e6=0xc8;}else{_0x3950e6=0xce;}_0x93d492[_0x32ef('0x1a')](_0x3950e6);return _0x93d492[_0x32ef('0x1e')]('Content-Range',_0x531e30+'-'+_0x13db1a+'/'+_0x55bf0b)[_0x32ef('0x1b')](_0x57aff1);}return null;};}function patchUpdates(_0x33e230){return function(_0x4f4c98){try{jsonpatch[_0x32ef('0x1f')](_0x4f4c98,_0x33e230,!![]);}catch(_0x314ef1){return BPromise[_0x32ef('0x20')](_0x314ef1);}return _0x4f4c98[_0x32ef('0x21')]();};}function saveUpdates(_0x445cda,_0x3aec05){return function(_0x4de441){if(_0x4de441){return _0x4de441[_0x32ef('0x22')](_0x445cda)['then'](function(_0x309866){return _0x309866;});}return null;};}function removeEntity(_0x3a20ca,_0x49f2d8){return function(_0x1af371){if(_0x1af371){return _0x1af371[_0x32ef('0x23')]()[_0x32ef('0x24')](function(){_0x3a20ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(!_0x225feb){_0x22f2d7['sendStatus'](0x194);}return _0x225feb;};}function handleError(_0x59585f,_0x19ea6){_0x19ea6=_0x19ea6||0x1f4;return function(_0x4d584b){logger['error'](_0x4d584b[_0x32ef('0x25')]);if(_0x4d584b[_0x32ef('0x26')]){delete _0x4d584b[_0x32ef('0x26')];}_0x59585f[_0x32ef('0x1a')](_0x19ea6)[_0x32ef('0x27')](_0x4d584b);};}exports[_0x32ef('0x28')]=function(_0x1874ea,_0x38aed5){var _0x338f19={},_0x2f52d7={},_0x1335e2={'count':0x0,'rows':[]};var _0xba4b3f=_['map'](db[_0x32ef('0x29')][_0x32ef('0x2a')],function(_0x5a04cd){return{'name':_0x5a04cd[_0x32ef('0x2b')],'type':_0x5a04cd[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x2f52d7[_0x32ef('0x2e')]=_['map'](_0xba4b3f,_0x32ef('0x26'));_0x2f52d7[_0x32ef('0x2f')]=_[_0x32ef('0x30')](_0x1874ea[_0x32ef('0x2f')]);_0x2f52d7[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2f52d7[_0x32ef('0x2e')],_0x2f52d7['query']);_0x338f19[_0x32ef('0x33')]=_['intersection'](_0x2f52d7[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x1874ea['query'][_0x32ef('0x34')]));_0x338f19[_0x32ef('0x33')]=_0x338f19[_0x32ef('0x33')][_0x32ef('0x35')]?_0x338f19[_0x32ef('0x33')]:_0x2f52d7['model'];if(!_0x1874ea['query'][_0x32ef('0x36')]('nolimit')){_0x338f19[_0x32ef('0x1d')]=qs[_0x32ef('0x1d')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x338f19[_0x32ef('0x37')]=qs[_0x32ef('0x37')](_0x1874ea['query']['offset']);}_0x338f19['order']=qs[_0x32ef('0x38')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x38')]);_0x338f19['where']=qs['filters'](_[_0x32ef('0x39')](_0x1874ea[_0x32ef('0x2f')],_0x2f52d7[_0x32ef('0x31')]));if(_0x1874ea['query']['filter']){_0x338f19[_0x32ef('0x3a')]=_[_0x32ef('0x3b')](_0x338f19[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x3c')](_0xba4b3f,function(_0x3a7c49){if(_0x3a7c49[_0x32ef('0x2c')]!==_0x32ef('0x3d')){var _0x21da90={};_0x21da90[_0x3a7c49[_0x32ef('0x26')]]={'$like':'%'+_0x1874ea['query'][_0x32ef('0x3e')]+'%'};return _0x21da90;}})});}_0x338f19=_[_0x32ef('0x3b')]({},_0x338f19,_0x1874ea[_0x32ef('0x3f')]);var _0x4b97dc={'where':_0x338f19[_0x32ef('0x3a')]};return db[_0x32ef('0x29')][_0x32ef('0x1c')](_0x4b97dc)[_0x32ef('0x24')](function(_0x1faf72){_0x1335e2[_0x32ef('0x1c')]=_0x1faf72;if(_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x40')]){_0x338f19[_0x32ef('0x41')]=[{'all':!![]}];}return db[_0x32ef('0x29')][_0x32ef('0x42')](_0x338f19);})[_0x32ef('0x24')](function(_0x48e071){_0x1335e2[_0x32ef('0x43')]=_0x48e071;return _0x1335e2;})[_0x32ef('0x24')](respondWithFilteredResult(_0x38aed5,_0x338f19))[_0x32ef('0x44')](handleError(_0x38aed5,null));};exports[_0x32ef('0x45')]=function(_0x2f92f5,_0x2ca66b){var _0x3c0e44={'raw':!![],'where':{'id':_0x2f92f5['params']['id']}},_0x596d5a={};_0x596d5a[_0x32ef('0x2e')]=_[_0x32ef('0x30')](db[_0x32ef('0x29')][_0x32ef('0x2a')]);_0x596d5a['query']=_[_0x32ef('0x30')](_0x2f92f5[_0x32ef('0x2f')]);_0x596d5a['filters']=_[_0x32ef('0x32')](_0x596d5a['model'],_0x596d5a[_0x32ef('0x2f')]);_0x3c0e44[_0x32ef('0x33')]=_[_0x32ef('0x32')](_0x596d5a[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x2f92f5[_0x32ef('0x2f')][_0x32ef('0x34')]));_0x3c0e44[_0x32ef('0x33')]=_0x3c0e44[_0x32ef('0x33')][_0x32ef('0x35')]?_0x3c0e44['attributes']:_0x596d5a[_0x32ef('0x2e')];if(_0x2f92f5['query'][_0x32ef('0x40')]){_0x3c0e44[_0x32ef('0x41')]=[{'all':!![]}];}_0x3c0e44=_[_0x32ef('0x3b')]({},_0x3c0e44,_0x2f92f5['options']);return db[_0x32ef('0x29')][_0x32ef('0x46')](_0x3c0e44)[_0x32ef('0x24')](handleEntityNotFound(_0x2ca66b,null))[_0x32ef('0x24')](respondWithResult(_0x2ca66b,null))[_0x32ef('0x44')](handleError(_0x2ca66b,null));};exports[_0x32ef('0x47')]=function(_0x12c9e6,_0x47dbe1){return db['SalesforceField'][_0x32ef('0x47')](_0x12c9e6[_0x32ef('0x48')],{})[_0x32ef('0x24')](respondWithResult(_0x47dbe1,0xc9))[_0x32ef('0x44')](handleError(_0x47dbe1,null));};exports[_0x32ef('0x22')]=function(_0xd67dc9,_0x44ad11){if(_0xd67dc9[_0x32ef('0x48')]['id']){delete _0xd67dc9[_0x32ef('0x48')]['id'];}return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0xd67dc9[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x44ad11,null))['then'](saveUpdates(_0xd67dc9[_0x32ef('0x48')],null))[_0x32ef('0x24')](respondWithResult(_0x44ad11,null))[_0x32ef('0x44')](handleError(_0x44ad11,null));};exports[_0x32ef('0x23')]=function(_0x1cc9f3,_0x4353f0){return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0x1cc9f3[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x4353f0,null))[_0x32ef('0x24')](removeEntity(_0x4353f0,null))[_0x32ef('0x44')](handleError(_0x4353f0,null));}; \ No newline at end of file +var _0x2ef3=['then','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','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','sendStatus','status','json','count','limit','set','apply','reject','save','update','destroy'];(function(_0x50762b,_0x1e807f){var _0x31bfb8=function(_0x239e54){while(--_0x239e54){_0x50762b['push'](_0x50762b['shift']());}};_0x31bfb8(++_0x1e807f);}(_0x2ef3,0xba));var _0x32ef=function(_0x5f4fe6,_0x577a36){_0x5f4fe6=_0x5f4fe6-0x0;var _0x30787b=_0x2ef3[_0x5f4fe6];return _0x30787b;};'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'];function respondWithStatusCode(_0x5afcc2,_0x1a5106){_0x1a5106=_0x1a5106||0xcc;return function(_0x49d590){if(_0x49d590){return _0x5afcc2[_0x32ef('0x19')](_0x1a5106);}return _0x5afcc2[_0x32ef('0x1a')](_0x1a5106)['end']();};}function respondWithResult(_0x539d18,_0x19ce1){_0x19ce1=_0x19ce1||0xc8;return function(_0x4d8009){if(_0x4d8009){return _0x539d18[_0x32ef('0x1a')](_0x19ce1)[_0x32ef('0x1b')](_0x4d8009);}};}function respondWithFilteredResult(_0x93d492,_0x54c7f5){return function(_0x57aff1){if(_0x57aff1){var _0x55bf0b=_0x57aff1[_0x32ef('0x1c')],_0x531e30=_0x54c7f5['offset'],_0x13db1a=_0x54c7f5['offset']+_0x54c7f5[_0x32ef('0x1d')],_0x3950e6;if(_0x13db1a>=_0x55bf0b){_0x13db1a=_0x55bf0b;_0x3950e6=0xc8;}else{_0x3950e6=0xce;}_0x93d492[_0x32ef('0x1a')](_0x3950e6);return _0x93d492[_0x32ef('0x1e')]('Content-Range',_0x531e30+'-'+_0x13db1a+'/'+_0x55bf0b)[_0x32ef('0x1b')](_0x57aff1);}return null;};}function patchUpdates(_0x33e230){return function(_0x4f4c98){try{jsonpatch[_0x32ef('0x1f')](_0x4f4c98,_0x33e230,!![]);}catch(_0x314ef1){return BPromise[_0x32ef('0x20')](_0x314ef1);}return _0x4f4c98[_0x32ef('0x21')]();};}function saveUpdates(_0x445cda,_0x3aec05){return function(_0x4de441){if(_0x4de441){return _0x4de441[_0x32ef('0x22')](_0x445cda)['then'](function(_0x309866){return _0x309866;});}return null;};}function removeEntity(_0x3a20ca,_0x49f2d8){return function(_0x1af371){if(_0x1af371){return _0x1af371[_0x32ef('0x23')]()[_0x32ef('0x24')](function(){_0x3a20ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(!_0x225feb){_0x22f2d7['sendStatus'](0x194);}return _0x225feb;};}function handleError(_0x59585f,_0x19ea6){_0x19ea6=_0x19ea6||0x1f4;return function(_0x4d584b){logger['error'](_0x4d584b[_0x32ef('0x25')]);if(_0x4d584b[_0x32ef('0x26')]){delete _0x4d584b[_0x32ef('0x26')];}_0x59585f[_0x32ef('0x1a')](_0x19ea6)[_0x32ef('0x27')](_0x4d584b);};}exports[_0x32ef('0x28')]=function(_0x1874ea,_0x38aed5){var _0x338f19={},_0x2f52d7={},_0x1335e2={'count':0x0,'rows':[]};var _0xba4b3f=_['map'](db[_0x32ef('0x29')][_0x32ef('0x2a')],function(_0x5a04cd){return{'name':_0x5a04cd[_0x32ef('0x2b')],'type':_0x5a04cd[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x2f52d7[_0x32ef('0x2e')]=_['map'](_0xba4b3f,_0x32ef('0x26'));_0x2f52d7[_0x32ef('0x2f')]=_[_0x32ef('0x30')](_0x1874ea[_0x32ef('0x2f')]);_0x2f52d7[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2f52d7[_0x32ef('0x2e')],_0x2f52d7['query']);_0x338f19[_0x32ef('0x33')]=_['intersection'](_0x2f52d7[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x1874ea['query'][_0x32ef('0x34')]));_0x338f19[_0x32ef('0x33')]=_0x338f19[_0x32ef('0x33')][_0x32ef('0x35')]?_0x338f19[_0x32ef('0x33')]:_0x2f52d7['model'];if(!_0x1874ea['query'][_0x32ef('0x36')]('nolimit')){_0x338f19[_0x32ef('0x1d')]=qs[_0x32ef('0x1d')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x338f19[_0x32ef('0x37')]=qs[_0x32ef('0x37')](_0x1874ea['query']['offset']);}_0x338f19['order']=qs[_0x32ef('0x38')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x38')]);_0x338f19['where']=qs['filters'](_[_0x32ef('0x39')](_0x1874ea[_0x32ef('0x2f')],_0x2f52d7[_0x32ef('0x31')]));if(_0x1874ea['query']['filter']){_0x338f19[_0x32ef('0x3a')]=_[_0x32ef('0x3b')](_0x338f19[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x3c')](_0xba4b3f,function(_0x3a7c49){if(_0x3a7c49[_0x32ef('0x2c')]!==_0x32ef('0x3d')){var _0x21da90={};_0x21da90[_0x3a7c49[_0x32ef('0x26')]]={'$like':'%'+_0x1874ea['query'][_0x32ef('0x3e')]+'%'};return _0x21da90;}})});}_0x338f19=_[_0x32ef('0x3b')]({},_0x338f19,_0x1874ea[_0x32ef('0x3f')]);var _0x4b97dc={'where':_0x338f19[_0x32ef('0x3a')]};return db[_0x32ef('0x29')][_0x32ef('0x1c')](_0x4b97dc)[_0x32ef('0x24')](function(_0x1faf72){_0x1335e2[_0x32ef('0x1c')]=_0x1faf72;if(_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x40')]){_0x338f19[_0x32ef('0x41')]=[{'all':!![]}];}return db[_0x32ef('0x29')][_0x32ef('0x42')](_0x338f19);})[_0x32ef('0x24')](function(_0x48e071){_0x1335e2[_0x32ef('0x43')]=_0x48e071;return _0x1335e2;})[_0x32ef('0x24')](respondWithFilteredResult(_0x38aed5,_0x338f19))[_0x32ef('0x44')](handleError(_0x38aed5,null));};exports[_0x32ef('0x45')]=function(_0x2f92f5,_0x2ca66b){var _0x3c0e44={'raw':!![],'where':{'id':_0x2f92f5['params']['id']}},_0x596d5a={};_0x596d5a[_0x32ef('0x2e')]=_[_0x32ef('0x30')](db[_0x32ef('0x29')][_0x32ef('0x2a')]);_0x596d5a['query']=_[_0x32ef('0x30')](_0x2f92f5[_0x32ef('0x2f')]);_0x596d5a['filters']=_[_0x32ef('0x32')](_0x596d5a['model'],_0x596d5a[_0x32ef('0x2f')]);_0x3c0e44[_0x32ef('0x33')]=_[_0x32ef('0x32')](_0x596d5a[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x2f92f5[_0x32ef('0x2f')][_0x32ef('0x34')]));_0x3c0e44[_0x32ef('0x33')]=_0x3c0e44[_0x32ef('0x33')][_0x32ef('0x35')]?_0x3c0e44['attributes']:_0x596d5a[_0x32ef('0x2e')];if(_0x2f92f5['query'][_0x32ef('0x40')]){_0x3c0e44[_0x32ef('0x41')]=[{'all':!![]}];}_0x3c0e44=_[_0x32ef('0x3b')]({},_0x3c0e44,_0x2f92f5['options']);return db[_0x32ef('0x29')][_0x32ef('0x46')](_0x3c0e44)[_0x32ef('0x24')](handleEntityNotFound(_0x2ca66b,null))[_0x32ef('0x24')](respondWithResult(_0x2ca66b,null))[_0x32ef('0x44')](handleError(_0x2ca66b,null));};exports[_0x32ef('0x47')]=function(_0x12c9e6,_0x47dbe1){return db['SalesforceField'][_0x32ef('0x47')](_0x12c9e6[_0x32ef('0x48')],{})[_0x32ef('0x24')](respondWithResult(_0x47dbe1,0xc9))[_0x32ef('0x44')](handleError(_0x47dbe1,null));};exports[_0x32ef('0x22')]=function(_0xd67dc9,_0x44ad11){if(_0xd67dc9[_0x32ef('0x48')]['id']){delete _0xd67dc9[_0x32ef('0x48')]['id'];}return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0xd67dc9[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x44ad11,null))['then'](saveUpdates(_0xd67dc9[_0x32ef('0x48')],null))[_0x32ef('0x24')](respondWithResult(_0x44ad11,null))[_0x32ef('0x44')](handleError(_0x44ad11,null));};exports[_0x32ef('0x23')]=function(_0x1cc9f3,_0x4353f0){return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0x1cc9f3[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x4353f0,null))[_0x32ef('0x24')](removeEntity(_0x4353f0,null))[_0x32ef('0x44')](handleError(_0x4353f0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index dda469a..2fbef2f 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 _0xd2d6=['path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1dac3f,_0x3538f8){var _0x17c156=function(_0x391d83){while(--_0x391d83){_0x1dac3f['push'](_0x1dac3f['shift']());}};_0x17c156(++_0x3538f8);}(_0xd2d6,0xa3));var _0x6d2d=function(_0x40ee2a,_0x5b374e){_0x40ee2a=_0x40ee2a-0x0;var _0x1acf8b=_0xd2d6[_0x40ee2a];return _0x1acf8b;};'use strict';var _=require(_0x6d2d('0x0'));var util=require(_0x6d2d('0x1'));var logger=require(_0x6d2d('0x2'))('api');var moment=require(_0x6d2d('0x3'));var BPromise=require(_0x6d2d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d2d('0x5'));var rimraf=require(_0x6d2d('0x6'));var config=require(_0x6d2d('0x7'));var attributes=require(_0x6d2d('0x8'));module[_0x6d2d('0x9')]=function(_0x43dfa0,_0x3575eb){return _0x43dfa0[_0x6d2d('0xa')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x6d2d('0xb'),'fields':[_0x6d2d('0xc'),_0x6d2d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdcb=['../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x24eb89,_0x2d44bf){var _0x50c325=function(_0x184097){while(--_0x184097){_0x24eb89['push'](_0x24eb89['shift']());}};_0x50c325(++_0x2d44bf);}(_0xfdcb,0x134));var _0xbfdc=function(_0x356107,_0x3bb13c){_0x356107=_0x356107-0x0;var _0x2f9d2b=_0xfdcb[_0x356107];return _0x2f9d2b;};'use strict';var _=require(_0xbfdc('0x0'));var util=require(_0xbfdc('0x1'));var logger=require(_0xbfdc('0x2'))(_0xbfdc('0x3'));var moment=require(_0xbfdc('0x4'));var BPromise=require(_0xbfdc('0x5'));var rp=require(_0xbfdc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbfdc('0x7'));var attributes=require(_0xbfdc('0x8'));module[_0xbfdc('0x9')]=function(_0x499dc1,_0x29b7f2){return _0x499dc1[_0xbfdc('0xa')](_0xbfdc('0xb'),attributes,{'tableName':_0xbfdc('0xc'),'paranoid':![],'indexes':[{'name':_0xbfdc('0xd'),'fields':[_0xbfdc('0xe'),'FieldId'],'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 42b96f8..742c807 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 _0x9bde=['code','message','SalesforceField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3849ac,_0x180ad3){var _0x553d2a=function(_0x23fe08){while(--_0x23fe08){_0x3849ac['push'](_0x3849ac['shift']());}};_0x553d2a(++_0x180ad3);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5e9a46,_0x4302a6){_0x5e9a46=_0x5e9a46-0x0;var _0x3f8352=_0x9bde[_0x5e9a46];return _0x3f8352;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('SalesforceField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('SalesforceField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('SalesforceField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('SalesforceField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0x878f=['../../config/logger','rpc','../../config/environment','jayson/promise','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x54772a,_0x4ed88e){var _0x50afcc=function(_0x5be5ca){while(--_0x5be5ca){_0x54772a['push'](_0x54772a['shift']());}};_0x50afcc(++_0x4ed88e);}(_0x878f,0x173));var _0xf878=function(_0x46edd0,_0x2e1b4d){_0x46edd0=_0x46edd0-0x0;var _0x3d7c2f=_0x878f[_0x46edd0];return _0x3d7c2f;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var moment=require(_0xf878('0x1'));var BPromise=require(_0xf878('0x2'));var rs=require(_0xf878('0x3'));var fs=require('fs');var Redis=require(_0xf878('0x4'));var db=require(_0xf878('0x5'))['db'];var utils=require(_0xf878('0x6'));var logger=require(_0xf878('0x7'))(_0xf878('0x8'));var config=require(_0xf878('0x9'));var jayson=require(_0xf878('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c5f5c,_0x62b420,_0x59e564){return new BPromise(function(_0x52851e,_0x530767){return client[_0xf878('0xb')](_0x3c5f5c,_0x59e564)['then'](function(_0x4a9d79){logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));logger['debug'](_0xf878('0xf'),_0x62b420,_0xf878('0xe'),JSON['stringify'](_0x4a9d79));if(_0x4a9d79[_0xf878('0x10')]){if(_0x4a9d79['error'][_0xf878('0x11')]===0x1f4){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x4a9d79['error'][_0xf878('0x12')]);return _0x530767(_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);}logger['error'](_0xf878('0xd'),_0x62b420,_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);return _0x52851e(_0x4a9d79['error']['message']);}else{logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));_0x52851e(_0x4a9d79[_0xf878('0x13')][_0xf878('0x12')]);}})[_0xf878('0x14')](function(_0x415056){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x415056);_0x530767(_0x415056);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index e538233..a3f452b 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 _0x556b=['show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','/:id','isAuthenticated'];(function(_0x2b3a80,_0x42274d){var _0x506f20=function(_0x326d62){while(--_0x326d62){_0x2b3a80['push'](_0x2b3a80['shift']());}};_0x506f20(++_0x42274d);}(_0x556b,0x1d7));var _0xb556=function(_0x2d8014,_0x5d3edb){_0x2d8014=_0x2d8014-0x0;var _0x5ea8d6=_0x556b[_0x2d8014];return _0x5ea8d6;};'use strict';var multer=require(_0xb556('0x0'));var util=require(_0xb556('0x1'));var path=require(_0xb556('0x2'));var timeout=require(_0xb556('0x3'));var express=require(_0xb556('0x4'));var router=express['Router']();var auth=require(_0xb556('0x5'));var interaction=require(_0xb556('0x6'));var config=require(_0xb556('0x7'));var controller=require(_0xb556('0x8'));router[_0xb556('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb556('0xa'),auth[_0xb556('0xb')](),controller[_0xb556('0xc')]);router[_0xb556('0x9')](_0xb556('0xd'),auth[_0xb556('0xb')](),controller[_0xb556('0xe')]);router[_0xb556('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xb556('0xf')]);router['post']('/',auth[_0xb556('0xb')](),controller[_0xb556('0x10')]);router['post']('/:id/configurations',auth[_0xb556('0xb')](),controller[_0xb556('0x11')]);router[_0xb556('0x12')](_0xb556('0xa'),auth[_0xb556('0xb')](),controller[_0xb556('0x13')]);router['delete']('/:id',auth[_0xb556('0xb')](),controller['destroy']);module[_0xb556('0x14')]=router; \ No newline at end of file +var _0xa8c4=['delete','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8c4,0x12d));var _0x4a8c=function(_0x59c4a4,_0x2759e9){_0x59c4a4=_0x59c4a4-0x0;var _0x45b0a5=_0xa8c4[_0x59c4a4];return _0x45b0a5;};'use strict';var multer=require('multer');var util=require(_0x4a8c('0x0'));var path=require(_0x4a8c('0x1'));var timeout=require('connect-timeout');var express=require(_0x4a8c('0x2'));var router=express[_0x4a8c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4a8c('0x4'));var config=require(_0x4a8c('0x5'));var controller=require(_0x4a8c('0x6'));router[_0x4a8c('0x7')]('/',auth[_0x4a8c('0x8')](),controller[_0x4a8c('0x9')]);router[_0x4a8c('0x7')](_0x4a8c('0xa'),auth[_0x4a8c('0x8')](),controller[_0x4a8c('0xb')]);router['get'](_0x4a8c('0xc'),auth[_0x4a8c('0x8')](),controller[_0x4a8c('0xd')]);router[_0x4a8c('0x7')](_0x4a8c('0xe'),auth[_0x4a8c('0x8')](),controller[_0x4a8c('0xf')]);router[_0x4a8c('0x10')]('/',auth['isAuthenticated'](),controller[_0x4a8c('0x11')]);router['post']('/:id/configurations',auth[_0x4a8c('0x8')](),controller[_0x4a8c('0x12')]);router[_0x4a8c('0x13')](_0x4a8c('0xa'),auth[_0x4a8c('0x8')](),controller[_0x4a8c('0x14')]);router[_0x4a8c('0x15')](_0x4a8c('0xa'),auth[_0x4a8c('0x8')](),controller['destroy']);module[_0x4a8c('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 f8fbf92..54f85f5 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 _0xbb50=['exports','STRING','remoteUri','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbb50,0xf3));var _0x0bb5=function(_0x3060e3,_0x14f2c6){_0x3060e3=_0x3060e3-0x0;var _0x497d2c=_0xbb50[_0x3060e3];return _0x497d2c;};'use strict';var Sequelize=require(_0x0bb5('0x0'));module[_0x0bb5('0x1')]={'name':{'type':Sequelize[_0x0bb5('0x2')]},'description':{'type':Sequelize[_0x0bb5('0x2')]},'username':{'type':Sequelize[_0x0bb5('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0bb5('0x2')]},'remoteUri':{'type':Sequelize[_0x0bb5('0x2')],'unique':_0x0bb5('0x3')},'serverUrl':{'type':Sequelize[_0x0bb5('0x2')]}}; \ No newline at end of file +var _0x2917=['remoteUri','sequelize','exports','STRING'];(function(_0x37fa07,_0x2cee43){var _0x33f488=function(_0x5c960d){while(--_0x5c960d){_0x37fa07['push'](_0x37fa07['shift']());}};_0x33f488(++_0x2cee43);}(_0x2917,0x151));var _0x7291=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0x2917[_0x387dc1];return _0x17567c;};'use strict';var Sequelize=require(_0x7291('0x0'));module[_0x7291('0x1')]={'name':{'type':Sequelize[_0x7291('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7291('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7291('0x2')]},'remoteUri':{'type':Sequelize[_0x7291('0x2')],'unique':_0x7291('0x3')},'serverUrl':{'type':Sequelize[_0x7291('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index ab738c9..ebfa322 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 _0xda34=['body','destroy','findOne','ServicenowConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','business_duration','group_list','resolved_at','approval_set','subcategory','short_description','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','company','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','includes','forEach','internalType','label','all','TCL:\x20_object','remove','push','concat','statusCode','stack','Wrong\x20credentials','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','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','../../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~!@#$%^&-_=+[{]}.','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','name','index','map','ServicenowAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','create'];(function(_0x1f7774,_0x5b4e7f){var _0x3e8044=function(_0x2ea2a8){while(--_0x2ea2a8){_0x1f7774['push'](_0x1f7774['shift']());}};_0x3e8044(++_0x5b4e7f);}(_0xda34,0x129));var _0x4da3=function(_0x20d2a5,_0x796ba7){_0x20d2a5=_0x20d2a5-0x0;var _0x5b10f2=_0xda34[_0x20d2a5];return _0x5b10f2;};'use strict';var pdf=require(_0x4da3('0x0'));var emlformat=require(_0x4da3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4da3('0x2'));var jsonpatch=require(_0x4da3('0x3'));var rp=require('request-promise');var moment=require(_0x4da3('0x4'));var BPromise=require(_0x4da3('0x5'));var Mustache=require(_0x4da3('0x6'));var util=require(_0x4da3('0x7'));var path=require(_0x4da3('0x8'));var sox=require(_0x4da3('0x9'));var csv=require('to-csv');var ejs=require(_0x4da3('0xa'));var fs=require('fs');var _=require(_0x4da3('0xb'));var squel=require('squel');var crypto=require(_0x4da3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4da3('0xd'));var toCsv=require(_0x4da3('0xe'));var querystring=require(_0x4da3('0xf'));var Papa=require('papaparse');var Redis=require(_0x4da3('0x10'));var authService=require(_0x4da3('0x11'));var qs=require(_0x4da3('0x12'));var as=require(_0x4da3('0x13'));var hardwareService=require(_0x4da3('0x14'));var logger=require(_0x4da3('0x15'))(_0x4da3('0x16'));var utils=require(_0x4da3('0x17'));var config=require(_0x4da3('0x18'));var db=require(_0x4da3('0x19'))['db'];var integrations=require(_0x4da3('0x1a'));var jayson=require(_0x4da3('0x1b'));var client=jayson[_0x4da3('0x1c')][_0x4da3('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x3a1283,_0x4fcc76,_0x3f6ae7){if(_0x3f6ae7){var _0x409453=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x409453[_0x4da3('0x1e')](_0x4fcc76)){return _0x3a1283;}else{throw new db[(_0x4da3('0x1f'))][(_0x4da3('0x20'))](_0x4da3('0x21'));}}else{return _0x3a1283;}}function respondWithRpcPromise(_0x55bf45,_0x1d77ac,_0x3e46ab,_0x7001ef){return new BPromise(function(_0x4bcbac,_0x5ca854){var _0x22a67d=_0x7001ef||client;return _0x22a67d['request'](_0x55bf45,_0x3e46ab)[_0x4da3('0x22')](function(_0x2742b0){logger[_0x4da3('0x23')](_0x4da3('0x24'),_0x1d77ac,'request\x20sent');logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1d77ac,_0x4da3('0x25'),JSON[_0x4da3('0x26')](_0x2742b0));if(_0x2742b0[_0x4da3('0x27')]){if(_0x2742b0[_0x4da3('0x27')][_0x4da3('0x28')]===0x1f4){logger['error'](_0x4da3('0x24'),_0x1d77ac,_0x2742b0[_0x4da3('0x27')][_0x4da3('0x29')]);return _0x5ca854(_0x2742b0[_0x4da3('0x27')][_0x4da3('0x29')]);}logger[_0x4da3('0x27')](_0x4da3('0x24'),_0x1d77ac,_0x2742b0[_0x4da3('0x27')]['message']);return _0x4bcbac(_0x2742b0[_0x4da3('0x27')][_0x4da3('0x29')]);}else{logger[_0x4da3('0x23')](_0x4da3('0x24'),_0x1d77ac,'request\x20sent');_0x4bcbac(_0x2742b0[_0x4da3('0x2a')][_0x4da3('0x29')]);}})[_0x4da3('0x2b')](function(_0x782263){logger[_0x4da3('0x27')](_0x4da3('0x24'),_0x1d77ac,_0x782263);_0x5ca854(_0x782263);});});}function respondWithStatusCode(_0x1ffe8e,_0x248181){_0x248181=_0x248181||0xcc;return function(_0x2f3dd0){if(_0x2f3dd0){return _0x1ffe8e[_0x4da3('0x2c')](_0x248181);}return _0x1ffe8e[_0x4da3('0x2d')](_0x248181)[_0x4da3('0x2e')]();};}function respondWithResult(_0x274413,_0x3274b3){_0x3274b3=_0x3274b3||0xc8;return function(_0xbfefe0){if(_0xbfefe0){return _0x274413['status'](_0x3274b3)[_0x4da3('0x2f')](_0xbfefe0);}};}function respondWithFilteredResult(_0x181a8d,_0x181d21){return function(_0x4cb539){if(_0x4cb539){var _0xdba4cf=_0x4cb539[_0x4da3('0x30')],_0x1ca4a7=_0x181d21[_0x4da3('0x31')],_0x531f26=_0x181d21[_0x4da3('0x31')]+_0x181d21['limit'],_0x2d2a55;if(_0x531f26>=_0xdba4cf){_0x531f26=_0xdba4cf;_0x2d2a55=0xc8;}else{_0x2d2a55=0xce;}_0x181a8d['status'](_0x2d2a55);return _0x181a8d['set'](_0x4da3('0x32'),_0x1ca4a7+'-'+_0x531f26+'/'+_0xdba4cf)[_0x4da3('0x2f')](_0x4cb539);}return null;};}function patchUpdates(_0x28362d){return function(_0x1cf73e){try{jsonpatch[_0x4da3('0x33')](_0x1cf73e,_0x28362d,!![]);}catch(_0x2fed75){return BPromise[_0x4da3('0x34')](_0x2fed75);}return _0x1cf73e[_0x4da3('0x35')]();};}function saveUpdates(_0x1e3046,_0x23b129){return function(_0x32fb08){if(_0x32fb08){return _0x32fb08[_0x4da3('0x36')](_0x1e3046)[_0x4da3('0x22')](function(_0x4871c9){return _0x4871c9;});}return null;};}function removeEntity(_0x56cf5a,_0x266609){return function(_0x4c25ab){if(_0x4c25ab){return _0x4c25ab['destroy']()[_0x4da3('0x22')](function(){_0x56cf5a[_0x4da3('0x2d')](0xcc)[_0x4da3('0x2e')]();});}};}function handleEntityNotFound(_0x2528ed,_0x526a7b){return function(_0x2e737e){if(!_0x2e737e){_0x2528ed['sendStatus'](0x194);}return _0x2e737e;};}function handleError(_0x17502e,_0x106537){_0x106537=_0x106537||0x1f4;return function(_0x59ef79){logger['error'](_0x59ef79['stack']);if(_0x59ef79[_0x4da3('0x37')]){delete _0x59ef79[_0x4da3('0x37')];}_0x17502e[_0x4da3('0x2d')](_0x106537)['send'](_0x59ef79);};}exports[_0x4da3('0x38')]=function(_0x2e9f90,_0x225417){var _0x165028={},_0x3dbe64={},_0x8c465={'count':0x0,'rows':[]};var _0xd1026=_[_0x4da3('0x39')](db[_0x4da3('0x3a')][_0x4da3('0x3b')],function(_0xdedf33){return{'name':_0xdedf33['fieldName'],'type':_0xdedf33[_0x4da3('0x3c')][_0x4da3('0x3d')]};});_0x3dbe64['model']=_['map'](_0xd1026,_0x4da3('0x37'));_0x3dbe64['query']=_['keys'](_0x2e9f90[_0x4da3('0x3e')]);_0x3dbe64[_0x4da3('0x3f')]=_[_0x4da3('0x40')](_0x3dbe64[_0x4da3('0x41')],_0x3dbe64['query']);_0x165028[_0x4da3('0x42')]=_[_0x4da3('0x40')](_0x3dbe64[_0x4da3('0x41')],qs['fields'](_0x2e9f90[_0x4da3('0x3e')][_0x4da3('0x43')]));_0x165028[_0x4da3('0x42')]=_0x165028[_0x4da3('0x42')][_0x4da3('0x44')]?_0x165028[_0x4da3('0x42')]:_0x3dbe64['model'];if(!_0x2e9f90[_0x4da3('0x3e')][_0x4da3('0x45')](_0x4da3('0x46'))){_0x165028['limit']=qs['limit'](_0x2e9f90[_0x4da3('0x3e')][_0x4da3('0x47')]);_0x165028[_0x4da3('0x31')]=qs[_0x4da3('0x31')](_0x2e9f90[_0x4da3('0x3e')]['offset']);}_0x165028[_0x4da3('0x48')]=qs[_0x4da3('0x49')](_0x2e9f90[_0x4da3('0x3e')][_0x4da3('0x49')]);_0x165028[_0x4da3('0x4a')]=qs[_0x4da3('0x3f')](_[_0x4da3('0x4b')](_0x2e9f90[_0x4da3('0x3e')],_0x3dbe64['filters']));if(_0x2e9f90[_0x4da3('0x3e')][_0x4da3('0x4c')]){_0x165028[_0x4da3('0x4a')]=_['merge'](_0x165028[_0x4da3('0x4a')],{'$or':_[_0x4da3('0x39')](_0xd1026,function(_0x2ca2f1){if(_0x2ca2f1['type']!==_0x4da3('0x4d')){var _0x2c48eb={};_0x2c48eb[_0x2ca2f1[_0x4da3('0x37')]]={'$like':'%'+_0x2e9f90['query'][_0x4da3('0x4c')]+'%'};return _0x2c48eb;}})});}_0x165028=_[_0x4da3('0x4e')]({},_0x165028,_0x2e9f90[_0x4da3('0x4f')]);var _0xc0ba9f={'where':_0x165028[_0x4da3('0x4a')]};return db['ServicenowAccount'][_0x4da3('0x30')](_0xc0ba9f)['then'](function(_0x5c9a2a){_0x8c465[_0x4da3('0x30')]=_0x5c9a2a;if(_0x2e9f90[_0x4da3('0x3e')][_0x4da3('0x50')]){_0x165028[_0x4da3('0x51')]=[{'all':!![]}];}return db[_0x4da3('0x3a')][_0x4da3('0x52')](_0x165028);})[_0x4da3('0x22')](function(_0x38962b){_0x8c465[_0x4da3('0x53')]=_0x38962b;return _0x8c465;})[_0x4da3('0x22')](respondWithFilteredResult(_0x225417,_0x165028))[_0x4da3('0x2b')](handleError(_0x225417,null));};exports[_0x4da3('0x54')]=function(_0x15258e,_0x55373e){var _0x360df6={'raw':![],'where':{'id':_0x15258e[_0x4da3('0x55')]['id']}},_0x3e1fe9={};_0x3e1fe9['model']=_['keys'](db[_0x4da3('0x3a')]['rawAttributes']);_0x3e1fe9[_0x4da3('0x3e')]=_[_0x4da3('0x56')](_0x15258e[_0x4da3('0x3e')]);_0x3e1fe9[_0x4da3('0x3f')]=_[_0x4da3('0x40')](_0x3e1fe9[_0x4da3('0x41')],_0x3e1fe9[_0x4da3('0x3e')]);_0x360df6[_0x4da3('0x42')]=_[_0x4da3('0x40')](_0x3e1fe9[_0x4da3('0x41')],qs[_0x4da3('0x43')](_0x15258e[_0x4da3('0x3e')]['fields']));_0x360df6[_0x4da3('0x42')]=_0x360df6['attributes'][_0x4da3('0x44')]?_0x360df6[_0x4da3('0x42')]:_0x3e1fe9[_0x4da3('0x41')];if(_0x15258e[_0x4da3('0x3e')][_0x4da3('0x50')]){_0x360df6[_0x4da3('0x51')]=[{'all':!![]}];}_0x360df6=_[_0x4da3('0x4e')]({},_0x360df6,_0x15258e[_0x4da3('0x4f')]);return db[_0x4da3('0x3a')][_0x4da3('0x57')](_0x360df6)[_0x4da3('0x22')](handleEntityNotFound(_0x55373e,null))[_0x4da3('0x22')](respondWithResult(_0x55373e,null))['catch'](handleError(_0x55373e,null));};exports['create']=function(_0x2304c2,_0x2fe6c3){return db[_0x4da3('0x3a')][_0x4da3('0x58')](_0x2304c2['body'],{})[_0x4da3('0x22')](respondWithResult(_0x2fe6c3,0xc9))[_0x4da3('0x2b')](handleError(_0x2fe6c3,null));};exports[_0x4da3('0x36')]=function(_0x597137,_0x2996aa){if(_0x597137[_0x4da3('0x59')]['id']){delete _0x597137[_0x4da3('0x59')]['id'];}return db[_0x4da3('0x3a')][_0x4da3('0x57')]({'where':{'id':_0x597137[_0x4da3('0x55')]['id']}})[_0x4da3('0x22')](handleEntityNotFound(_0x2996aa,null))[_0x4da3('0x22')](saveUpdates(_0x597137[_0x4da3('0x59')],null))[_0x4da3('0x22')](respondWithResult(_0x2996aa,null))[_0x4da3('0x2b')](handleError(_0x2996aa,null));};exports[_0x4da3('0x5a')]=function(_0x4b1a1b,_0x3f1c6a){return db[_0x4da3('0x3a')]['find']({'where':{'id':_0x4b1a1b[_0x4da3('0x55')]['id']}})[_0x4da3('0x22')](handleEntityNotFound(_0x3f1c6a,null))[_0x4da3('0x22')](removeEntity(_0x3f1c6a,null))['catch'](handleError(_0x3f1c6a,null));};exports['getConfigurations']=function(_0x469ff2,_0x17bda9,_0x53b906){var _0x3d2216={};var _0x32a6c5={};var _0x1c47c3;var _0x58ad2d;return db['ServicenowAccount'][_0x4da3('0x5b')]({'where':{'id':_0x469ff2[_0x4da3('0x55')]['id']}})[_0x4da3('0x22')](handleEntityNotFound(_0x17bda9,null))['then'](function(_0x2bf4a7){if(_0x2bf4a7){_0x1c47c3=_0x2bf4a7;_0x32a6c5['model']=_['keys'](db[_0x4da3('0x5c')][_0x4da3('0x3b')]);_0x32a6c5['query']=_[_0x4da3('0x56')](_0x469ff2[_0x4da3('0x3e')]);_0x32a6c5[_0x4da3('0x3f')]=_['intersection'](_0x32a6c5[_0x4da3('0x41')],_0x32a6c5[_0x4da3('0x3e')]);_0x3d2216[_0x4da3('0x42')]=_[_0x4da3('0x40')](_0x32a6c5['model'],qs[_0x4da3('0x43')](_0x469ff2[_0x4da3('0x3e')][_0x4da3('0x43')]));_0x3d2216[_0x4da3('0x42')]=_0x3d2216[_0x4da3('0x42')][_0x4da3('0x44')]?_0x3d2216[_0x4da3('0x42')]:_0x32a6c5['model'];_0x3d2216[_0x4da3('0x48')]=qs[_0x4da3('0x49')](_0x469ff2[_0x4da3('0x3e')][_0x4da3('0x49')]);_0x3d2216[_0x4da3('0x4a')]=qs[_0x4da3('0x3f')](_[_0x4da3('0x4b')](_0x469ff2[_0x4da3('0x3e')],_0x32a6c5[_0x4da3('0x3f')]));if(_0x469ff2[_0x4da3('0x3e')]['filter']){_0x3d2216[_0x4da3('0x4a')]=_['merge'](_0x3d2216[_0x4da3('0x4a')],{'$or':_[_0x4da3('0x39')](_0x3d2216[_0x4da3('0x42')],function(_0x2b48b1){var _0x1b6bea={};_0x1b6bea[_0x2b48b1]={'$like':'%'+_0x469ff2[_0x4da3('0x3e')][_0x4da3('0x4c')]+'%'};return _0x1b6bea;})});}_0x3d2216=_[_0x4da3('0x4e')]({},_0x3d2216,_0x469ff2[_0x4da3('0x4f')]);return _0x1c47c3[_0x4da3('0x5d')](_0x3d2216);}})[_0x4da3('0x22')](function(_0x2029c6){if(_0x2029c6){_0x58ad2d=_0x2029c6[_0x4da3('0x44')];if(!_0x469ff2[_0x4da3('0x3e')][_0x4da3('0x45')](_0x4da3('0x46'))){_0x3d2216[_0x4da3('0x47')]=qs['limit'](_0x469ff2[_0x4da3('0x3e')]['limit']);_0x3d2216[_0x4da3('0x31')]=qs[_0x4da3('0x31')](_0x469ff2[_0x4da3('0x3e')]['offset']);}return _0x1c47c3[_0x4da3('0x5d')](_0x3d2216);}})[_0x4da3('0x22')](function(_0x32fafb){if(_0x32fafb){return _0x32fafb?{'count':_0x58ad2d,'rows':_0x32fafb}:null;}})[_0x4da3('0x22')](respondWithResult(_0x17bda9,null))[_0x4da3('0x2b')](handleError(_0x17bda9,null));};exports['addConfiguration']=function(_0x448704,_0xd91196,_0x4f93c0){if(_0x448704['body']['id']){delete _0x448704[_0x4da3('0x59')]['id'];}return db['ServicenowAccount'][_0x4da3('0x5b')]({'where':{'id':_0x448704['params']['id']}})[_0x4da3('0x22')](handleEntityNotFound(_0xd91196,null))['then'](function(_0x132ab0){if(_0x132ab0){_0x448704['body'][_0x4da3('0x5e')]=_0x132ab0['id'];_0x448704['body'][_0x4da3('0x5f')]=integrations[_0x4da3('0x60')](_0x448704[_0x4da3('0x59')][_0x4da3('0x61')],_0x448704[_0x4da3('0x59')][_0x4da3('0x3c')]);_0x448704[_0x4da3('0x59')][_0x4da3('0x62')]=integrations[_0x4da3('0x63')](_0x448704[_0x4da3('0x59')][_0x4da3('0x61')],_0x448704[_0x4da3('0x59')][_0x4da3('0x3c')]);return db['ServicenowConfiguration'][_0x4da3('0x58')](_0x448704[_0x4da3('0x59')],{'include':[{'model':db[_0x4da3('0x64')],'as':'Subjects'},{'model':db[_0x4da3('0x64')],'as':_0x4da3('0x62')}]});}return null;})['then'](respondWithResult(_0xd91196,null))[_0x4da3('0x2b')](handleError(_0xd91196,null));};exports['getFields']=function(_0x4f2aa2,_0x192f33,_0x52a234){var _0x434997=[_0x4da3('0x65'),_0x4da3('0x66'),_0x4da3('0x67'),'subcategory',_0x4da3('0x68'),_0x4da3('0x69'),_0x4da3('0x6a'),_0x4da3('0x6b'),_0x4da3('0x6c')];var _0x2c33bc=['parent','made_sla','caused_by',_0x4da3('0x6d'),_0x4da3('0x6e'),'sys_updated_on',_0x4da3('0x6f'),_0x4da3('0x66'),_0x4da3('0x70'),_0x4da3('0x71'),_0x4da3('0x72'),_0x4da3('0x73'),_0x4da3('0x74'),'user_input',_0x4da3('0x75'),_0x4da3('0x76'),_0x4da3('0x77'),_0x4da3('0x78'),_0x4da3('0x67'),_0x4da3('0x48'),_0x4da3('0x79'),_0x4da3('0x7a'),'cmdb_ci',_0x4da3('0x7b'),'impact','active',_0x4da3('0x7c'),_0x4da3('0x7d'),_0x4da3('0x7e'),_0x4da3('0x7f'),_0x4da3('0x80'),'time_worked',_0x4da3('0x81'),'opened_at',_0x4da3('0x82'),_0x4da3('0x83'),'work_end','reopened_time',_0x4da3('0x84'),'caller_id',_0x4da3('0x85'),_0x4da3('0x86'),'work_notes',_0x4da3('0x87'),_0x4da3('0x68'),'correlation_display','delivery_task','work_start','assignment_group','business_stc',_0x4da3('0x88'),_0x4da3('0x89'),'calendar_duration',_0x4da3('0x69'),_0x4da3('0x8a'),_0x4da3('0x8b'),_0x4da3('0x8c'),_0x4da3('0x8d'),_0x4da3('0x8e'),'sys_id',_0x4da3('0x8f'),_0x4da3('0x90'),'incident_state',_0x4da3('0x91'),_0x4da3('0x92'),_0x4da3('0x93'),'reassignment_count',_0x4da3('0x94'),_0x4da3('0x95'),_0x4da3('0x6b'),_0x4da3('0x96'),_0x4da3('0x97'),_0x4da3('0x98'),_0x4da3('0x99'),_0x4da3('0x9a'),_0x4da3('0x9b'),_0x4da3('0x9c'),_0x4da3('0x9d'),'escalation',_0x4da3('0x9e'),_0x4da3('0x9f'),_0x4da3('0xa0'),'category'];var _0x48859d='';var _0x58efa5='';var _0x537370=[];var _0x56a966='';var _0x542ac6='';var _0x5d070c=[];var _0x4c17fd='';var _0x53247b='';var _0x38bc88={};var _0x2af4b1='';return db[_0x4da3('0x3a')]['findOne']({'where':{'id':_0x4f2aa2['params']['id']},'attributes':['id',_0x4da3('0xa1'),_0x4da3('0xa2'),_0x4da3('0xa3'),'remoteUri',_0x4da3('0xa4')]})[_0x4da3('0x22')](handleEntityNotFound(_0x192f33,null))['then'](function(_0x53a644){if(_0x53a644){_0x2af4b1=_0x53a644[_0x4da3('0xa5')];var _0xf806e7=_0x2af4b1[_0x4da3('0xa6')](-0x1);if(_0xf806e7==='/'){_0x2af4b1=_0x2af4b1[_0x4da3('0xa7')](0x0,_0x2af4b1[_0x4da3('0xa8')](_0xf806e7));}_0x53247b=util[_0x4da3('0xa9')](_0x4da3('0xaa'),_0x2af4b1);_0x4c17fd=util['format'](_0x4da3('0xab'),_0x2af4b1);_0x38bc88={'user':_0x53a644['username'],'pass':_0x53a644[_0x4da3('0xa2')]};var _0x408235={'method':_0x4da3('0xac'),'uri':_0x53247b+_0x4da3('0xad'),'auth':_0x38bc88,'json':!![]};return rp(_0x408235);}})[_0x4da3('0x22')](function(_0xf943ae){if(_0xf943ae[_0x4da3('0x2a')][_0x4da3('0x44')]>0x0){_0x48859d=_0xf943ae[_0x4da3('0x2a')];}console[_0x4da3('0xae')](_0x4da3('0xaf'),_0x48859d);_0x5d070c=[];_0x58efa5=Object['assign']([],_0x48859d);_['remove'](_0x58efa5,function(_0x56aa47){return!_0x434997[_0x4da3('0xb0')](_0x56aa47['name']);});_0x58efa5[_0x4da3('0xb1')](function(_0x3b2424){var _0xee682=createFieldObject(_0x4c17fd,_0x38bc88,_0x3b2424[_0x4da3('0xb2')],_0x3b2424[_0x4da3('0x37')],_0x3b2424[_0x4da3('0xb3')],![]);_0x5d070c['push'](_0xee682);});return Promise[_0x4da3('0xb4')](_0x5d070c);})[_0x4da3('0x22')](function(_0x15f431){_0x537370=_0x15f431;_0x56a966=Object['assign']([],_0x48859d);console[_0x4da3('0xae')](_0x4da3('0xb5'),_0x48859d);_[_0x4da3('0xb6')](_0x56a966,function(_0x5afa7e){return _0x2c33bc[_0x4da3('0xb0')](_0x5afa7e['name']);});console[_0x4da3('0xae')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x56a966);_0x5d070c=[];_0x56a966['forEach'](function(_0x3d254e){var _0x1f1260=createFieldObject(_0x4c17fd,_0x38bc88,_0x3d254e[_0x4da3('0xb2')],_0x3d254e[_0x4da3('0x37')],_0x3d254e[_0x4da3('0xb3')],!![]);_0x5d070c[_0x4da3('0xb7')](_0x1f1260);});return Promise['all'](_0x5d070c);})['then'](function(_0x27e22a){_0x542ac6=_0x27e22a;var _0xc8ca5d=_0x537370[_0x4da3('0xb8')](_0x542ac6);return{'count':_0xc8ca5d[_0x4da3('0x44')],'rows':_0xc8ca5d};})[_0x4da3('0x22')](respondWithResult(_0x192f33,null))['catch'](function(_0x266b79){console[_0x4da3('0xae')]('ServiceNow\x20error:\x20'+_0x266b79);var _0x2efa7f=_0x4f2aa2[_0x4da3('0x3e')][_0x4da3('0x1e')]?0x1f4:_0x266b79[_0x4da3('0xb9')]||0x1f4;logger[_0x4da3('0x27')](_0x266b79[_0x4da3('0xba')]);delete _0x266b79['name'];if(_0x2efa7f===0x191){_0x2efa7f=0x190;}_0x192f33[_0x4da3('0x2d')](_0x2efa7f)['send'](_0x4f2aa2[_0x4da3('0x3e')][_0x4da3('0x1e')]?{'message':_0x4da3('0xbb'),'statusCode':_0x266b79['statusCode']}:_0x266b79);});};function createFieldObject(_0x22bbd3,_0x5f9ce0,_0x499c5c,_0x44ec64,_0x5a3c3b,_0x555d0d){return new Promise(function(_0x1e8121,_0x356e38){var _0x5b33cb={'id':_0x44ec64,'name':_0x5a3c3b,'custom':_0x555d0d};if(_0x499c5c==='boolean'){_0x5b33cb['options']=[{'name':'True','value':_0x4da3('0xbc')},{'name':_0x4da3('0xbd'),'value':_0x4da3('0xbe')}];_0x1e8121(_0x5b33cb);}else{var _0x4ab572={'method':_0x4da3('0xac'),'uri':_0x22bbd3+_0x4da3('0xbf')+_0x44ec64,'auth':_0x5f9ce0,'json':!![]};return rp(_0x4ab572)[_0x4da3('0x22')](function(_0x99dbc5){var _0x2301d4=[];if(_0x99dbc5[_0x4da3('0x2a')]['length']>0x0){_0x99dbc5[_0x4da3('0x2a')][_0x4da3('0xb1')](function(_0x4950d0){if(_0x4950d0['inactive']==='false'){var _0x3e5ff9={'name':_0x4950d0[_0x4da3('0xb3')],'value':_0x4950d0[_0x4da3('0xc0')]};_0x2301d4[_0x4da3('0xb7')](_0x3e5ff9);}});}_0x5b33cb[_0x4da3('0x4f')]=_0x2301d4;if(_0x5b33cb[_0x4da3('0x4f')]['length']>0x0){_0x1e8121(_0x5b33cb);}else{if(_0x555d0d==![]){_0x1e8121();}else{_0x1e8121(_0x5b33cb);}}});}});} \ No newline at end of file +var _0x06cc=['calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','close_notes','parent_incident','sys_id','contact_type','urgency','company','reassignment_count','assigned_to','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','username','email','remoteUri','substring','format','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../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','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','count','offset','Content-Range','json','apply','save','destroy','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','update','params','getConfigurations','findOne','ServicenowConfiguration','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on'];(function(_0x57f91f,_0x21cf17){var _0x4deca6=function(_0x5c97bb){while(--_0x5c97bb){_0x57f91f['push'](_0x57f91f['shift']());}};_0x4deca6(++_0x21cf17);}(_0x06cc,0x105));var _0xc06c=function(_0x52770a,_0x47673c){_0x52770a=_0x52770a-0x0;var _0x25f46a=_0x06cc[_0x52770a];return _0x25f46a;};'use strict';var pdf=require(_0xc06c('0x0'));var emlformat=require(_0xc06c('0x1'));var rimraf=require(_0xc06c('0x2'));var zipdir=require(_0xc06c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc06c('0x4'));var moment=require('moment');var BPromise=require(_0xc06c('0x5'));var Mustache=require(_0xc06c('0x6'));var util=require(_0xc06c('0x7'));var path=require(_0xc06c('0x8'));var sox=require(_0xc06c('0x9'));var csv=require(_0xc06c('0xa'));var ejs=require(_0xc06c('0xb'));var fs=require('fs');var _=require(_0xc06c('0xc'));var squel=require(_0xc06c('0xd'));var crypto=require(_0xc06c('0xe'));var jsforce=require(_0xc06c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc06c('0xa'));var querystring=require(_0xc06c('0x10'));var Papa=require(_0xc06c('0x11'));var Redis=require(_0xc06c('0x12'));var authService=require(_0xc06c('0x13'));var qs=require(_0xc06c('0x14'));var as=require(_0xc06c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc06c('0x16'))('api');var utils=require(_0xc06c('0x17'));var config=require(_0xc06c('0x18'));var db=require(_0xc06c('0x19'))['db'];var integrations=require(_0xc06c('0x1a'));var jayson=require(_0xc06c('0x1b'));var client=jayson[_0xc06c('0x1c')][_0xc06c('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x1243c7,_0x163cb0,_0x508fb6){if(_0x508fb6){var _0x4628cb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4628cb[_0xc06c('0x1e')](_0x163cb0)){return _0x1243c7;}else{throw new db[(_0xc06c('0x1f'))][(_0xc06c('0x20'))](_0xc06c('0x21'));}}else{return _0x1243c7;}}function respondWithRpcPromise(_0x590ebd,_0x3a94e7,_0x53510f,_0x557c1e){return new BPromise(function(_0x1395b6,_0x31730c){var _0x4589f9=_0x557c1e||client;return _0x4589f9[_0xc06c('0x22')](_0x590ebd,_0x53510f)[_0xc06c('0x23')](function(_0x38da16){logger['info'](_0xc06c('0x24'),_0x3a94e7,_0xc06c('0x25'));logger['debug'](_0xc06c('0x26'),_0x3a94e7,_0xc06c('0x25'),JSON[_0xc06c('0x27')](_0x38da16));if(_0x38da16[_0xc06c('0x28')]){if(_0x38da16[_0xc06c('0x28')][_0xc06c('0x29')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x3a94e7,_0x38da16[_0xc06c('0x28')][_0xc06c('0x2a')]);return _0x31730c(_0x38da16[_0xc06c('0x28')][_0xc06c('0x2a')]);}logger[_0xc06c('0x28')](_0xc06c('0x24'),_0x3a94e7,_0x38da16[_0xc06c('0x28')][_0xc06c('0x2a')]);return _0x1395b6(_0x38da16[_0xc06c('0x28')][_0xc06c('0x2a')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x3a94e7,_0xc06c('0x25'));_0x1395b6(_0x38da16['result'][_0xc06c('0x2a')]);}})['catch'](function(_0x1778be){logger[_0xc06c('0x28')](_0xc06c('0x24'),_0x3a94e7,_0x1778be);_0x31730c(_0x1778be);});});}function respondWithStatusCode(_0x4de829,_0x380b42){_0x380b42=_0x380b42||0xcc;return function(_0x2aad0d){if(_0x2aad0d){return _0x4de829[_0xc06c('0x2b')](_0x380b42);}return _0x4de829[_0xc06c('0x2c')](_0x380b42)[_0xc06c('0x2d')]();};}function respondWithResult(_0x15341d,_0x1e510f){_0x1e510f=_0x1e510f||0xc8;return function(_0xcf5512){if(_0xcf5512){return _0x15341d[_0xc06c('0x2c')](_0x1e510f)['json'](_0xcf5512);}};}function respondWithFilteredResult(_0x23e546,_0x2b26ec){return function(_0x450b39){if(_0x450b39){var _0x4a5b14=_0x450b39[_0xc06c('0x2e')],_0x309a04=_0x2b26ec[_0xc06c('0x2f')],_0x9730ef=_0x2b26ec[_0xc06c('0x2f')]+_0x2b26ec['limit'],_0xbee30b;if(_0x9730ef>=_0x4a5b14){_0x9730ef=_0x4a5b14;_0xbee30b=0xc8;}else{_0xbee30b=0xce;}_0x23e546[_0xc06c('0x2c')](_0xbee30b);return _0x23e546['set'](_0xc06c('0x30'),_0x309a04+'-'+_0x9730ef+'/'+_0x4a5b14)[_0xc06c('0x31')](_0x450b39);}return null;};}function patchUpdates(_0x36bd18){return function(_0x404df2){try{jsonpatch[_0xc06c('0x32')](_0x404df2,_0x36bd18,!![]);}catch(_0x175af9){return BPromise['reject'](_0x175af9);}return _0x404df2[_0xc06c('0x33')]();};}function saveUpdates(_0x3ebeab,_0x5f31a1){return function(_0x3cb652){if(_0x3cb652){return _0x3cb652['update'](_0x3ebeab)[_0xc06c('0x23')](function(_0x4ef5f6){return _0x4ef5f6;});}return null;};}function removeEntity(_0x2a5dd,_0x2dc220){return function(_0x28ba36){if(_0x28ba36){return _0x28ba36[_0xc06c('0x34')]()[_0xc06c('0x23')](function(){_0x2a5dd[_0xc06c('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bb999,_0x518fde){return function(_0x1f0380){if(!_0x1f0380){_0x4bb999['sendStatus'](0x194);}return _0x1f0380;};}function handleError(_0x423a41,_0x128b92){_0x128b92=_0x128b92||0x1f4;return function(_0x349fe9){logger[_0xc06c('0x28')](_0x349fe9[_0xc06c('0x35')]);if(_0x349fe9[_0xc06c('0x36')]){delete _0x349fe9[_0xc06c('0x36')];}_0x423a41['status'](_0x128b92)[_0xc06c('0x37')](_0x349fe9);};}exports['index']=function(_0x5db986,_0x3678bb){var _0x1c4035={},_0x24d8ba={},_0x3f1658={'count':0x0,'rows':[]};var _0x15cd3a=_[_0xc06c('0x38')](db[_0xc06c('0x39')][_0xc06c('0x3a')],function(_0x2ba870){return{'name':_0x2ba870[_0xc06c('0x3b')],'type':_0x2ba870[_0xc06c('0x3c')][_0xc06c('0x3d')]};});_0x24d8ba[_0xc06c('0x3e')]=_[_0xc06c('0x38')](_0x15cd3a,_0xc06c('0x36'));_0x24d8ba[_0xc06c('0x3f')]=_[_0xc06c('0x40')](_0x5db986['query']);_0x24d8ba[_0xc06c('0x41')]=_[_0xc06c('0x42')](_0x24d8ba['model'],_0x24d8ba[_0xc06c('0x3f')]);_0x1c4035[_0xc06c('0x43')]=_[_0xc06c('0x42')](_0x24d8ba['model'],qs[_0xc06c('0x44')](_0x5db986[_0xc06c('0x3f')][_0xc06c('0x44')]));_0x1c4035[_0xc06c('0x43')]=_0x1c4035['attributes'][_0xc06c('0x45')]?_0x1c4035['attributes']:_0x24d8ba['model'];if(!_0x5db986['query']['hasOwnProperty'](_0xc06c('0x46'))){_0x1c4035[_0xc06c('0x47')]=qs['limit'](_0x5db986[_0xc06c('0x3f')]['limit']);_0x1c4035[_0xc06c('0x2f')]=qs[_0xc06c('0x2f')](_0x5db986[_0xc06c('0x3f')]['offset']);}_0x1c4035['order']=qs[_0xc06c('0x48')](_0x5db986[_0xc06c('0x3f')]['sort']);_0x1c4035[_0xc06c('0x49')]=qs[_0xc06c('0x41')](_[_0xc06c('0x4a')](_0x5db986[_0xc06c('0x3f')],_0x24d8ba[_0xc06c('0x41')]));if(_0x5db986[_0xc06c('0x3f')][_0xc06c('0x4b')]){_0x1c4035[_0xc06c('0x49')]=_[_0xc06c('0x4c')](_0x1c4035[_0xc06c('0x49')],{'$or':_[_0xc06c('0x38')](_0x15cd3a,function(_0x58460e){if(_0x58460e[_0xc06c('0x3c')]!==_0xc06c('0x4d')){var _0x85006e={};_0x85006e[_0x58460e['name']]={'$like':'%'+_0x5db986[_0xc06c('0x3f')][_0xc06c('0x4b')]+'%'};return _0x85006e;}})});}_0x1c4035=_[_0xc06c('0x4c')]({},_0x1c4035,_0x5db986['options']);var _0x1acdf2={'where':_0x1c4035['where']};return db['ServicenowAccount'][_0xc06c('0x2e')](_0x1acdf2)[_0xc06c('0x23')](function(_0x2c0d5f){_0x3f1658[_0xc06c('0x2e')]=_0x2c0d5f;if(_0x5db986[_0xc06c('0x3f')][_0xc06c('0x4e')]){_0x1c4035[_0xc06c('0x4f')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xc06c('0x50')](_0x1c4035);})['then'](function(_0x2b45e5){_0x3f1658[_0xc06c('0x51')]=_0x2b45e5;return _0x3f1658;})[_0xc06c('0x23')](respondWithFilteredResult(_0x3678bb,_0x1c4035))[_0xc06c('0x52')](handleError(_0x3678bb,null));};exports[_0xc06c('0x53')]=function(_0x3ad845,_0x467e45){var _0x544289={'raw':![],'where':{'id':_0x3ad845['params']['id']}},_0x17f749={};_0x17f749['model']=_[_0xc06c('0x40')](db[_0xc06c('0x39')][_0xc06c('0x3a')]);_0x17f749[_0xc06c('0x3f')]=_[_0xc06c('0x40')](_0x3ad845[_0xc06c('0x3f')]);_0x17f749[_0xc06c('0x41')]=_[_0xc06c('0x42')](_0x17f749[_0xc06c('0x3e')],_0x17f749['query']);_0x544289[_0xc06c('0x43')]=_[_0xc06c('0x42')](_0x17f749[_0xc06c('0x3e')],qs[_0xc06c('0x44')](_0x3ad845[_0xc06c('0x3f')][_0xc06c('0x44')]));_0x544289[_0xc06c('0x43')]=_0x544289['attributes']['length']?_0x544289[_0xc06c('0x43')]:_0x17f749[_0xc06c('0x3e')];if(_0x3ad845['query'][_0xc06c('0x4e')]){_0x544289['include']=[{'all':!![]}];}_0x544289=_[_0xc06c('0x4c')]({},_0x544289,_0x3ad845[_0xc06c('0x54')]);return db[_0xc06c('0x39')][_0xc06c('0x55')](_0x544289)[_0xc06c('0x23')](handleEntityNotFound(_0x467e45,null))[_0xc06c('0x23')](respondWithResult(_0x467e45,null))[_0xc06c('0x52')](handleError(_0x467e45,null));};exports[_0xc06c('0x56')]=function(_0x9cedd2,_0x4926a8){return db[_0xc06c('0x39')]['create'](_0x9cedd2[_0xc06c('0x57')],{})['then'](respondWithResult(_0x4926a8,0xc9))[_0xc06c('0x52')](handleError(_0x4926a8,null));};exports[_0xc06c('0x58')]=function(_0xaf39db,_0x1d3440){if(_0xaf39db[_0xc06c('0x57')]['id']){delete _0xaf39db[_0xc06c('0x57')]['id'];}return db[_0xc06c('0x39')][_0xc06c('0x55')]({'where':{'id':_0xaf39db['params']['id']}})[_0xc06c('0x23')](handleEntityNotFound(_0x1d3440,null))[_0xc06c('0x23')](saveUpdates(_0xaf39db[_0xc06c('0x57')],null))[_0xc06c('0x23')](respondWithResult(_0x1d3440,null))[_0xc06c('0x52')](handleError(_0x1d3440,null));};exports[_0xc06c('0x34')]=function(_0x48c8f3,_0x465f19){return db['ServicenowAccount'][_0xc06c('0x55')]({'where':{'id':_0x48c8f3[_0xc06c('0x59')]['id']}})[_0xc06c('0x23')](handleEntityNotFound(_0x465f19,null))[_0xc06c('0x23')](removeEntity(_0x465f19,null))[_0xc06c('0x52')](handleError(_0x465f19,null));};exports[_0xc06c('0x5a')]=function(_0x26025f,_0x33fa93,_0xf66200){var _0x37fbc3={};var _0x1b15b9={};var _0x31327e;var _0x1ced63;return db[_0xc06c('0x39')][_0xc06c('0x5b')]({'where':{'id':_0x26025f[_0xc06c('0x59')]['id']}})[_0xc06c('0x23')](handleEntityNotFound(_0x33fa93,null))['then'](function(_0x47caeb){if(_0x47caeb){_0x31327e=_0x47caeb;_0x1b15b9[_0xc06c('0x3e')]=_[_0xc06c('0x40')](db[_0xc06c('0x5c')][_0xc06c('0x3a')]);_0x1b15b9[_0xc06c('0x3f')]=_[_0xc06c('0x40')](_0x26025f[_0xc06c('0x3f')]);_0x1b15b9[_0xc06c('0x41')]=_[_0xc06c('0x42')](_0x1b15b9['model'],_0x1b15b9[_0xc06c('0x3f')]);_0x37fbc3[_0xc06c('0x43')]=_[_0xc06c('0x42')](_0x1b15b9['model'],qs[_0xc06c('0x44')](_0x26025f[_0xc06c('0x3f')]['fields']));_0x37fbc3[_0xc06c('0x43')]=_0x37fbc3[_0xc06c('0x43')][_0xc06c('0x45')]?_0x37fbc3[_0xc06c('0x43')]:_0x1b15b9['model'];_0x37fbc3[_0xc06c('0x5d')]=qs[_0xc06c('0x48')](_0x26025f[_0xc06c('0x3f')][_0xc06c('0x48')]);_0x37fbc3[_0xc06c('0x49')]=qs[_0xc06c('0x41')](_[_0xc06c('0x4a')](_0x26025f[_0xc06c('0x3f')],_0x1b15b9[_0xc06c('0x41')]));if(_0x26025f[_0xc06c('0x3f')]['filter']){_0x37fbc3['where']=_[_0xc06c('0x4c')](_0x37fbc3[_0xc06c('0x49')],{'$or':_[_0xc06c('0x38')](_0x37fbc3[_0xc06c('0x43')],function(_0xecd574){var _0xce63be={};_0xce63be[_0xecd574]={'$like':'%'+_0x26025f[_0xc06c('0x3f')]['filter']+'%'};return _0xce63be;})});}_0x37fbc3=_['merge']({},_0x37fbc3,_0x26025f['options']);return _0x31327e[_0xc06c('0x5a')](_0x37fbc3);}})[_0xc06c('0x23')](function(_0xb3e6e9){if(_0xb3e6e9){_0x1ced63=_0xb3e6e9[_0xc06c('0x45')];if(!_0x26025f[_0xc06c('0x3f')][_0xc06c('0x5e')]('nolimit')){_0x37fbc3['limit']=qs[_0xc06c('0x47')](_0x26025f[_0xc06c('0x3f')][_0xc06c('0x47')]);_0x37fbc3[_0xc06c('0x2f')]=qs[_0xc06c('0x2f')](_0x26025f[_0xc06c('0x3f')][_0xc06c('0x2f')]);}return _0x31327e['getConfigurations'](_0x37fbc3);}})[_0xc06c('0x23')](function(_0x844f25){if(_0x844f25){return _0x844f25?{'count':_0x1ced63,'rows':_0x844f25}:null;}})[_0xc06c('0x23')](respondWithResult(_0x33fa93,null))[_0xc06c('0x52')](handleError(_0x33fa93,null));};exports[_0xc06c('0x5f')]=function(_0x49923d,_0x3110b4,_0x274b8d){if(_0x49923d['body']['id']){delete _0x49923d['body']['id'];}return db['ServicenowAccount'][_0xc06c('0x5b')]({'where':{'id':_0x49923d[_0xc06c('0x59')]['id']}})[_0xc06c('0x23')](handleEntityNotFound(_0x3110b4,null))[_0xc06c('0x23')](function(_0x14bf39){if(_0x14bf39){_0x49923d[_0xc06c('0x57')][_0xc06c('0x60')]=_0x14bf39['id'];_0x49923d[_0xc06c('0x57')][_0xc06c('0x61')]=integrations[_0xc06c('0x62')](_0x49923d[_0xc06c('0x57')]['channel'],_0x49923d[_0xc06c('0x57')][_0xc06c('0x3c')]);_0x49923d[_0xc06c('0x57')][_0xc06c('0x63')]=integrations[_0xc06c('0x64')](_0x49923d[_0xc06c('0x57')][_0xc06c('0x65')],_0x49923d[_0xc06c('0x57')][_0xc06c('0x3c')]);return db[_0xc06c('0x5c')]['create'](_0x49923d['body'],{'include':[{'model':db[_0xc06c('0x66')],'as':_0xc06c('0x61')},{'model':db[_0xc06c('0x66')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3110b4,null))[_0xc06c('0x52')](handleError(_0x3110b4,null));};exports['getFields']=function(_0x4d067e,_0xe5656,_0x50b863){var _0x3df153=[_0xc06c('0x67'),_0xc06c('0x68'),_0xc06c('0x69'),_0xc06c('0x6a'),_0xc06c('0x6b'),_0xc06c('0x6c'),_0xc06c('0x6d'),_0xc06c('0x6e'),_0xc06c('0x6f')];var _0x1ed0fc=[_0xc06c('0x70'),_0xc06c('0x67'),_0xc06c('0x71'),_0xc06c('0x72'),_0xc06c('0x73'),_0xc06c('0x74'),_0xc06c('0x75'),_0xc06c('0x68'),_0xc06c('0x76'),_0xc06c('0x77'),_0xc06c('0x78'),_0xc06c('0x79'),_0xc06c('0x7a'),_0xc06c('0x7b'),_0xc06c('0x7c'),'sys_domain','state','sys_created_by',_0xc06c('0x69'),_0xc06c('0x5d'),_0xc06c('0x7d'),_0xc06c('0x7e'),_0xc06c('0x7f'),_0xc06c('0x80'),_0xc06c('0x81'),_0xc06c('0x82'),'work_notes_list',_0xc06c('0x83'),'priority',_0xc06c('0x84'),_0xc06c('0x85'),_0xc06c('0x86'),_0xc06c('0x87'),_0xc06c('0x88'),_0xc06c('0x89'),'group_list',_0xc06c('0x8a'),_0xc06c('0x8b'),'resolved_at',_0xc06c('0x8c'),_0xc06c('0x8d'),_0xc06c('0x6a'),_0xc06c('0x8e'),_0xc06c('0x8f'),_0xc06c('0x6b'),_0xc06c('0x90'),_0xc06c('0x91'),_0xc06c('0x92'),_0xc06c('0x93'),_0xc06c('0x94'),_0xc06c('0x95'),'description',_0xc06c('0x96'),'notify','sys_class_name',_0xc06c('0x97'),'closed_by','follow_up',_0xc06c('0x98'),_0xc06c('0x99'),_0xc06c('0x9a'),'reopened_by',_0xc06c('0x6d'),_0xc06c('0x9b'),'problem_id',_0xc06c('0x9c'),_0xc06c('0x9d'),'activity_due',_0xc06c('0x9e'),_0xc06c('0x6e'),'comments','sla_due',_0xc06c('0x9f'),'comments_and_work_notes',_0xc06c('0xa0'),_0xc06c('0xa1'),_0xc06c('0xa2'),_0xc06c('0xa3'),_0xc06c('0xa4'),'upon_approval',_0xc06c('0xa5'),'location','category'];var _0x365009='';var _0x4dd7a1='';var _0x2747d8=[];var _0x3ed639='';var _0x25e589='';var _0x1faa1c=[];var _0x1cdb59='';var _0x5f14cf='';var _0x33bf41={};var _0x343192='';return db[_0xc06c('0x39')]['findOne']({'where':{'id':_0x4d067e['params']['id']},'attributes':['id',_0xc06c('0xa6'),'password',_0xc06c('0xa7'),_0xc06c('0xa8'),'serverUrl']})[_0xc06c('0x23')](handleEntityNotFound(_0xe5656,null))[_0xc06c('0x23')](function(_0x16e6f7){if(_0x16e6f7){_0x343192=_0x16e6f7[_0xc06c('0xa8')];var _0x573582=_0x343192['slice'](-0x1);if(_0x573582==='/'){_0x343192=_0x343192[_0xc06c('0xa9')](0x0,_0x343192['lastIndexOf'](_0x573582));}_0x5f14cf=util[_0xc06c('0xaa')]('%s/api/now/doc/table/schema/',_0x343192);_0x1cdb59=util['format']('%s/api/now/table/',_0x343192);_0x33bf41={'user':_0x16e6f7[_0xc06c('0xa6')],'pass':_0x16e6f7['password']};var _0x25855b={'method':'GET','uri':_0x5f14cf+_0xc06c('0xab'),'auth':_0x33bf41,'json':!![]};return rp(_0x25855b);}})[_0xc06c('0x23')](function(_0x2c4cdd){if(_0x2c4cdd[_0xc06c('0xac')]['length']>0x0){_0x365009=_0x2c4cdd[_0xc06c('0xac')];}console[_0xc06c('0xad')](_0xc06c('0xae'),_0x365009);_0x1faa1c=[];_0x4dd7a1=Object[_0xc06c('0xaf')]([],_0x365009);_[_0xc06c('0xb0')](_0x4dd7a1,function(_0x51d249){return!_0x3df153['includes'](_0x51d249['name']);});_0x4dd7a1[_0xc06c('0xb1')](function(_0x1783e3){var _0x13773d=createFieldObject(_0x1cdb59,_0x33bf41,_0x1783e3[_0xc06c('0xb2')],_0x1783e3[_0xc06c('0x36')],_0x1783e3['label'],![]);_0x1faa1c[_0xc06c('0xb3')](_0x13773d);});return Promise[_0xc06c('0xb4')](_0x1faa1c);})[_0xc06c('0x23')](function(_0x3c40f0){_0x2747d8=_0x3c40f0;_0x3ed639=Object['assign']([],_0x365009);console[_0xc06c('0xad')](_0xc06c('0xb5'),_0x365009);_['remove'](_0x3ed639,function(_0x175019){return _0x1ed0fc[_0xc06c('0xb6')](_0x175019[_0xc06c('0x36')]);});console[_0xc06c('0xad')](_0xc06c('0xb7'),_0x3ed639);_0x1faa1c=[];_0x3ed639[_0xc06c('0xb1')](function(_0xc45dbe){var _0x3dad63=createFieldObject(_0x1cdb59,_0x33bf41,_0xc45dbe[_0xc06c('0xb2')],_0xc45dbe['name'],_0xc45dbe[_0xc06c('0xb8')],!![]);_0x1faa1c[_0xc06c('0xb3')](_0x3dad63);});return Promise['all'](_0x1faa1c);})['then'](function(_0x32c4c9){_0x25e589=_0x32c4c9;var _0x21c4eb=_0x2747d8['concat'](_0x25e589);return{'count':_0x21c4eb[_0xc06c('0x45')],'rows':_0x21c4eb};})[_0xc06c('0x23')](respondWithResult(_0xe5656,null))[_0xc06c('0x52')](function(_0x3a518f){console[_0xc06c('0xad')]('ServiceNow\x20error:\x20'+_0x3a518f);var _0x3beb06=_0x4d067e[_0xc06c('0x3f')][_0xc06c('0x1e')]?0x1f4:_0x3a518f[_0xc06c('0xb9')]||0x1f4;logger[_0xc06c('0x28')](_0x3a518f[_0xc06c('0x35')]);delete _0x3a518f['name'];if(_0x3beb06===0x191){_0x3beb06=0x190;}_0xe5656[_0xc06c('0x2c')](_0x3beb06)[_0xc06c('0x37')](_0x4d067e[_0xc06c('0x3f')][_0xc06c('0x1e')]?{'message':'Wrong\x20credentials','statusCode':_0x3a518f['statusCode']}:_0x3a518f);});};function createFieldObject(_0x3e5018,_0x395478,_0x5dc890,_0x4463c1,_0x3bf272,_0xe4372f){return new Promise(function(_0x2dfa51,_0x197af5){var _0x2bf689={'id':_0x4463c1,'name':_0x3bf272,'custom':_0xe4372f};if(_0x5dc890===_0xc06c('0xba')){_0x2bf689['options']=[{'name':_0xc06c('0xbb'),'value':_0xc06c('0xbc')},{'name':_0xc06c('0xbd'),'value':_0xc06c('0xbe')}];_0x2dfa51(_0x2bf689);}else{var _0x5897b4={'method':'GET','uri':_0x3e5018+_0xc06c('0xbf')+_0x4463c1,'auth':_0x395478,'json':!![]};return rp(_0x5897b4)[_0xc06c('0x23')](function(_0x43138d){var _0x3783c2=[];if(_0x43138d[_0xc06c('0xac')][_0xc06c('0x45')]>0x0){_0x43138d[_0xc06c('0xac')]['forEach'](function(_0x502d9b){if(_0x502d9b['inactive']===_0xc06c('0xbe')){var _0x377d02={'name':_0x502d9b[_0xc06c('0xb8')],'value':_0x502d9b[_0xc06c('0xc0')]};_0x3783c2[_0xc06c('0xb3')](_0x377d02);}});}_0x2bf689['options']=_0x3783c2;if(_0x2bf689[_0xc06c('0x54')]['length']>0x0){_0x2dfa51(_0x2bf689);}else{if(_0xe4372f==![]){_0x2dfa51();}else{_0x2dfa51(_0x2bf689);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index f89c8cf..df45d90 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 _0x6b8f=['../../components/integrations/configuration','define','ServicenowAccount','util','api','request-promise','path','../../config/environment','./intServicenowAccount.attributes'];(function(_0x456066,_0xcc93b7){var _0x3410b1=function(_0x57c4b1){while(--_0x57c4b1){_0x456066['push'](_0x456066['shift']());}};_0x3410b1(++_0xcc93b7);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x53ee26,_0x42daae){_0x53ee26=_0x53ee26-0x0;var _0x2914fc=_0x6b8f[_0x53ee26];return _0x2914fc;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var logger=require('../../config/logger')(_0xf6b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6b8('0x2'));var fs=require('fs');var path=require(_0xf6b8('0x3'));var rimraf=require('rimraf');var config=require(_0xf6b8('0x4'));var attributes=require(_0xf6b8('0x5'));var integrations=require(_0xf6b8('0x6'));module['exports']=function(_0x2d035e,_0x79c66d){return _0x2d035e[_0xf6b8('0x7')](_0xf6b8('0x8'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c7=['moment','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api'];(function(_0x27314d,_0x33c0f2){var _0x30a648=function(_0x21e50b){while(--_0x21e50b){_0x27314d['push'](_0x27314d['shift']());}};_0x30a648(++_0x33c0f2);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x52a53c,_0x5395a4){_0x52a53c=_0x52a53c-0x0;var _0x1e5a03=_0xb4c7[_0x52a53c];return _0x1e5a03;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x7b4c('0xa')]=function(_0x10e197,_0x2dd5c7){return _0x10e197['define'](_0x7b4c('0xb'),attributes,{'tableName':_0x7b4c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 035ae15..d2bb562 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 _0x7ec8=['where','attributes','limit','include','model','map','GetServicenowAccount','stringify','ShowServicenowAccount','find','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','options'];(function(_0xc715c7,_0x709bc8){var _0x469789=function(_0x3ad562){while(--_0x3ad562){_0xc715c7['push'](_0xc715c7['shift']());}};_0x469789(++_0x709bc8);}(_0x7ec8,0xf1));var _0x87ec=function(_0x346379,_0xd5f749){_0x346379=_0x346379-0x0;var _0x9c1bb6=_0x7ec8[_0x346379];return _0x9c1bb6;};'use strict';var _=require(_0x87ec('0x0'));var util=require(_0x87ec('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x87ec('0x2'));var fs=require('fs');var Redis=require(_0x87ec('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x87ec('0x4'));var logger=require(_0x87ec('0x5'))(_0x87ec('0x6'));var config=require(_0x87ec('0x7'));var jayson=require(_0x87ec('0x8'));var client=jayson[_0x87ec('0x9')][_0x87ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x174420,_0x5696b8,_0x247b35){return new BPromise(function(_0x304177,_0x30094f){return client[_0x87ec('0xb')](_0x174420,_0x247b35)[_0x87ec('0xc')](function(_0x275c87){logger[_0x87ec('0xd')](_0x87ec('0xe'),_0x5696b8,_0x87ec('0xf'));logger[_0x87ec('0x10')](_0x87ec('0x11'),_0x5696b8,'request\x20sent',JSON['stringify'](_0x275c87));if(_0x275c87[_0x87ec('0x12')]){if(_0x275c87[_0x87ec('0x12')]['code']===0x1f4){logger[_0x87ec('0x12')](_0x87ec('0xe'),_0x5696b8,_0x275c87['error'][_0x87ec('0x13')]);return _0x30094f(_0x275c87[_0x87ec('0x12')]['message']);}logger[_0x87ec('0x12')](_0x87ec('0xe'),_0x5696b8,_0x275c87[_0x87ec('0x12')]['message']);return _0x304177(_0x275c87['error'][_0x87ec('0x13')]);}else{logger['info'](_0x87ec('0xe'),_0x5696b8,_0x87ec('0xf'));_0x304177(_0x275c87[_0x87ec('0x14')][_0x87ec('0x13')]);}})[_0x87ec('0x15')](function(_0x42bde2){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x5696b8,_0x42bde2);_0x30094f(_0x42bde2);});});}exports['GetServicenowAccount']=function(_0x2a09bf){var _0x1041bf=this;return new Promise(function(_0x656717,_0x154e12){return db['ServicenowAccount']['findAll']({'raw':_0x2a09bf[_0x87ec('0x16')]?_0x2a09bf[_0x87ec('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2a09bf['options']?_0x2a09bf['options'][_0x87ec('0x17')]||null:null,'attributes':_0x2a09bf['options']?_0x2a09bf[_0x87ec('0x16')][_0x87ec('0x18')]||null:null,'limit':_0x2a09bf[_0x87ec('0x16')]?_0x2a09bf[_0x87ec('0x16')][_0x87ec('0x19')]||null:null,'include':_0x2a09bf[_0x87ec('0x16')]?_0x2a09bf[_0x87ec('0x16')][_0x87ec('0x1a')]?_['map'](_0x2a09bf[_0x87ec('0x16')]['include'],function(_0x41f5c0){return{'model':db[_0x41f5c0[_0x87ec('0x1b')]],'as':_0x41f5c0['as'],'attributes':_0x41f5c0['attributes'],'include':_0x41f5c0['include']?_[_0x87ec('0x1c')](_0x41f5c0['include'],function(_0x4706bb){return{'model':db[_0x4706bb['model']],'as':_0x4706bb['as'],'attributes':_0x4706bb[_0x87ec('0x18')],'include':_0x4706bb[_0x87ec('0x1a')]?_[_0x87ec('0x1c')](_0x4706bb['include'],function(_0x5a8b60){return{'model':db[_0x5a8b60['model']],'as':_0x5a8b60['as'],'attributes':_0x5a8b60['attributes']};}):[]};}):[]};}):[]:[]})[_0x87ec('0xc')](function(_0x46b1e8){logger[_0x87ec('0xd')](_0x87ec('0x1d'),_0x2a09bf);logger[_0x87ec('0x10')](_0x87ec('0x1d'),_0x2a09bf,JSON[_0x87ec('0x1e')](_0x46b1e8));_0x656717(_0x46b1e8);})[_0x87ec('0x15')](function(_0x424de7){logger['error']('GetServicenowAccount',_0x424de7[_0x87ec('0x13')],_0x2a09bf);_0x154e12(_0x1041bf[_0x87ec('0x12')](0x1f4,_0x424de7[_0x87ec('0x13')]));});});};exports[_0x87ec('0x1f')]=function(_0x403035){var _0x471991=this;return new Promise(function(_0x2af625,_0x4c0d71){return db['ServicenowAccount'][_0x87ec('0x20')]({'raw':_0x403035[_0x87ec('0x16')]?_0x403035[_0x87ec('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x403035[_0x87ec('0x16')]?_0x403035[_0x87ec('0x16')][_0x87ec('0x17')]||null:null,'attributes':_0x403035['options']?_0x403035[_0x87ec('0x16')][_0x87ec('0x18')]||null:null,'include':_0x403035[_0x87ec('0x16')]?_0x403035[_0x87ec('0x16')]['include']?_[_0x87ec('0x1c')](_0x403035['options'][_0x87ec('0x1a')],function(_0xde73e3){return{'model':db[_0xde73e3[_0x87ec('0x1b')]],'as':_0xde73e3['as'],'attributes':_0xde73e3['attributes'],'include':_0xde73e3['include']?_[_0x87ec('0x1c')](_0xde73e3[_0x87ec('0x1a')],function(_0x55b0ec){return{'model':db[_0x55b0ec[_0x87ec('0x1b')]],'as':_0x55b0ec['as'],'attributes':_0x55b0ec[_0x87ec('0x18')],'include':_0x55b0ec['include']?_['map'](_0x55b0ec['include'],function(_0x17d3e6){return{'model':db[_0x17d3e6[_0x87ec('0x1b')]],'as':_0x17d3e6['as'],'attributes':_0x17d3e6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x335a5f){logger[_0x87ec('0xd')](_0x87ec('0x1f'),_0x403035);logger[_0x87ec('0x10')](_0x87ec('0x1f'),_0x403035,JSON[_0x87ec('0x1e')](_0x335a5f));_0x2af625(_0x335a5f);})[_0x87ec('0x15')](function(_0xef0ba8){logger['error'](_0x87ec('0x1f'),_0xef0ba8['message'],_0x403035);_0x4c0d71(_0x471991[_0x87ec('0x12')](0x1f4,_0xef0ba8[_0x87ec('0x13')]));});});}; \ No newline at end of file +var _0x7f6f=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowServicenowAccount','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x191b48,_0x402e4e){var _0x2aff3c=function(_0x2b7faf){while(--_0x2b7faf){_0x191b48['push'](_0x191b48['shift']());}};_0x2aff3c(++_0x402e4e);}(_0x7f6f,0xa5));var _0xf7f6=function(_0x187309,_0x2cb520){_0x187309=_0x187309-0x0;var _0x1d3711=_0x7f6f[_0x187309];return _0x1d3711;};'use strict';var _=require('lodash');var util=require(_0xf7f6('0x0'));var moment=require(_0xf7f6('0x1'));var BPromise=require(_0xf7f6('0x2'));var rs=require(_0xf7f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf7f6('0x4'));var logger=require('../../config/logger')(_0xf7f6('0x5'));var config=require(_0xf7f6('0x6'));var jayson=require(_0xf7f6('0x7'));var client=jayson[_0xf7f6('0x8')][_0xf7f6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e4ca5,_0x4efb0f,_0x457fe9){return new BPromise(function(_0x58ff99,_0x3f2b46){return client[_0xf7f6('0xa')](_0x5e4ca5,_0x457fe9)[_0xf7f6('0xb')](function(_0x114d7e){logger[_0xf7f6('0xc')](_0xf7f6('0xd'),_0x4efb0f,_0xf7f6('0xe'));logger['debug'](_0xf7f6('0xf'),_0x4efb0f,_0xf7f6('0xe'),JSON[_0xf7f6('0x10')](_0x114d7e));if(_0x114d7e[_0xf7f6('0x11')]){if(_0x114d7e[_0xf7f6('0x11')][_0xf7f6('0x12')]===0x1f4){logger[_0xf7f6('0x11')](_0xf7f6('0xd'),_0x4efb0f,_0x114d7e['error']['message']);return _0x3f2b46(_0x114d7e[_0xf7f6('0x11')][_0xf7f6('0x13')]);}logger[_0xf7f6('0x11')](_0xf7f6('0xd'),_0x4efb0f,_0x114d7e['error'][_0xf7f6('0x13')]);return _0x58ff99(_0x114d7e[_0xf7f6('0x11')][_0xf7f6('0x13')]);}else{logger['info'](_0xf7f6('0xd'),_0x4efb0f,_0xf7f6('0xe'));_0x58ff99(_0x114d7e['result'][_0xf7f6('0x13')]);}})[_0xf7f6('0x14')](function(_0x9136b4){logger[_0xf7f6('0x11')](_0xf7f6('0xd'),_0x4efb0f,_0x9136b4);_0x3f2b46(_0x9136b4);});});}exports[_0xf7f6('0x15')]=function(_0x42ae9f){var _0x2b60ab=this;return new Promise(function(_0x72dadf,_0x2425fd){return db[_0xf7f6('0x16')][_0xf7f6('0x17')]({'raw':_0x42ae9f[_0xf7f6('0x18')]?_0x42ae9f['options'][_0xf7f6('0x19')]===undefined?!![]:![]:!![],'where':_0x42ae9f['options']?_0x42ae9f[_0xf7f6('0x18')][_0xf7f6('0x1a')]||null:null,'attributes':_0x42ae9f[_0xf7f6('0x18')]?_0x42ae9f[_0xf7f6('0x18')][_0xf7f6('0x1b')]||null:null,'limit':_0x42ae9f[_0xf7f6('0x18')]?_0x42ae9f['options'][_0xf7f6('0x1c')]||null:null,'include':_0x42ae9f[_0xf7f6('0x18')]?_0x42ae9f['options'][_0xf7f6('0x1d')]?_[_0xf7f6('0x1e')](_0x42ae9f[_0xf7f6('0x18')][_0xf7f6('0x1d')],function(_0x276dbf){return{'model':db[_0x276dbf['model']],'as':_0x276dbf['as'],'attributes':_0x276dbf[_0xf7f6('0x1b')],'include':_0x276dbf[_0xf7f6('0x1d')]?_['map'](_0x276dbf[_0xf7f6('0x1d')],function(_0x3ec86b){return{'model':db[_0x3ec86b[_0xf7f6('0x1f')]],'as':_0x3ec86b['as'],'attributes':_0x3ec86b[_0xf7f6('0x1b')],'include':_0x3ec86b['include']?_[_0xf7f6('0x1e')](_0x3ec86b[_0xf7f6('0x1d')],function(_0xda743b){return{'model':db[_0xda743b[_0xf7f6('0x1f')]],'as':_0xda743b['as'],'attributes':_0xda743b['attributes']};}):[]};}):[]};}):[]:[]})[_0xf7f6('0xb')](function(_0x341f23){logger['info']('GetServicenowAccount',_0x42ae9f);logger[_0xf7f6('0x20')](_0xf7f6('0x15'),_0x42ae9f,JSON[_0xf7f6('0x10')](_0x341f23));_0x72dadf(_0x341f23);})['catch'](function(_0x36ca56){logger[_0xf7f6('0x11')](_0xf7f6('0x15'),_0x36ca56[_0xf7f6('0x13')],_0x42ae9f);_0x2425fd(_0x2b60ab[_0xf7f6('0x11')](0x1f4,_0x36ca56[_0xf7f6('0x13')]));});});};exports[_0xf7f6('0x21')]=function(_0x50d204){var _0x45659e=this;return new Promise(function(_0x51c434,_0x3d9d95){return db[_0xf7f6('0x16')]['find']({'raw':_0x50d204[_0xf7f6('0x18')]?_0x50d204['options'][_0xf7f6('0x19')]===undefined?!![]:![]:!![],'where':_0x50d204['options']?_0x50d204['options'][_0xf7f6('0x1a')]||null:null,'attributes':_0x50d204['options']?_0x50d204[_0xf7f6('0x18')][_0xf7f6('0x1b')]||null:null,'include':_0x50d204[_0xf7f6('0x18')]?_0x50d204[_0xf7f6('0x18')][_0xf7f6('0x1d')]?_[_0xf7f6('0x1e')](_0x50d204[_0xf7f6('0x18')][_0xf7f6('0x1d')],function(_0xdbe4d2){return{'model':db[_0xdbe4d2['model']],'as':_0xdbe4d2['as'],'attributes':_0xdbe4d2[_0xf7f6('0x1b')],'include':_0xdbe4d2[_0xf7f6('0x1d')]?_[_0xf7f6('0x1e')](_0xdbe4d2[_0xf7f6('0x1d')],function(_0x52cee9){return{'model':db[_0x52cee9[_0xf7f6('0x1f')]],'as':_0x52cee9['as'],'attributes':_0x52cee9['attributes'],'include':_0x52cee9[_0xf7f6('0x1d')]?_[_0xf7f6('0x1e')](_0x52cee9['include'],function(_0x5ae9e8){return{'model':db[_0x5ae9e8['model']],'as':_0x5ae9e8['as'],'attributes':_0x5ae9e8[_0xf7f6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf7f6('0xb')](function(_0x56e39b){logger[_0xf7f6('0xc')]('ShowServicenowAccount',_0x50d204);logger[_0xf7f6('0x20')](_0xf7f6('0x21'),_0x50d204,JSON['stringify'](_0x56e39b));_0x51c434(_0x56e39b);})[_0xf7f6('0x14')](function(_0x1b2a7c){logger[_0xf7f6('0x11')](_0xf7f6('0x21'),_0x1b2a7c[_0xf7f6('0x13')],_0x50d204);_0x3d9d95(_0x45659e[_0xf7f6('0x11')](0x1f4,_0x1b2a7c['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index bbf9594..a3e6277 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 _0x92ac=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x171491,_0x4eb264){var _0xd4e112=function(_0x148521){while(--_0x148521){_0x171491['push'](_0x171491['shift']());}};_0xd4e112(++_0x4eb264);}(_0x92ac,0x1a6));var _0xc92a=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x92ac[_0x202c61];return _0x540691;};'use strict';var multer=require(_0xc92a('0x0'));var util=require('util');var path=require(_0xc92a('0x1'));var timeout=require(_0xc92a('0x2'));var express=require(_0xc92a('0x3'));var router=express[_0xc92a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc92a('0x5'));var config=require(_0xc92a('0x6'));var controller=require(_0xc92a('0x7'));router['get']('/',auth[_0xc92a('0x8')](),controller[_0xc92a('0x9')]);router[_0xc92a('0xa')]('/:id',auth[_0xc92a('0x8')](),controller[_0xc92a('0xb')]);router[_0xc92a('0xa')](_0xc92a('0xc'),auth[_0xc92a('0x8')](),controller[_0xc92a('0xd')]);router[_0xc92a('0xa')](_0xc92a('0xe'),auth[_0xc92a('0x8')](),controller[_0xc92a('0xf')]);router['get'](_0xc92a('0x10'),auth[_0xc92a('0x8')](),controller[_0xc92a('0x11')]);router[_0xc92a('0x12')]('/',auth[_0xc92a('0x8')](),controller[_0xc92a('0x13')]);router[_0xc92a('0x14')](_0xc92a('0x15'),auth[_0xc92a('0x8')](),controller[_0xc92a('0x16')]);router[_0xc92a('0x17')](_0xc92a('0x15'),auth[_0xc92a('0x8')](),controller[_0xc92a('0x18')]);module[_0xc92a('0x19')]=router; \ No newline at end of file +var _0xb2d1=['update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x1381a3,_0x38a97a){var _0x5dc170=function(_0x54aff4){while(--_0x54aff4){_0x1381a3['push'](_0x1381a3['shift']());}};_0x5dc170(++_0x38a97a);}(_0xb2d1,0x144));var _0x1b2d=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0xb2d1[_0x3ce2c4];return _0x4047c1;};'use strict';var multer=require(_0x1b2d('0x0'));var util=require(_0x1b2d('0x1'));var path=require(_0x1b2d('0x2'));var timeout=require(_0x1b2d('0x3'));var express=require('express');var router=express[_0x1b2d('0x4')]();var auth=require(_0x1b2d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1b2d('0x6'));var controller=require('./intServicenowConfiguration.controller');router[_0x1b2d('0x7')]('/',auth[_0x1b2d('0x8')](),controller[_0x1b2d('0x9')]);router[_0x1b2d('0x7')](_0x1b2d('0xa'),auth[_0x1b2d('0x8')](),controller[_0x1b2d('0xb')]);router['get'](_0x1b2d('0xc'),auth[_0x1b2d('0x8')](),controller[_0x1b2d('0xd')]);router[_0x1b2d('0x7')](_0x1b2d('0xe'),auth['isAuthenticated'](),controller[_0x1b2d('0xf')]);router[_0x1b2d('0x7')](_0x1b2d('0x10'),auth[_0x1b2d('0x8')](),controller[_0x1b2d('0x11')]);router[_0x1b2d('0x12')]('/',auth['isAuthenticated'](),controller[_0x1b2d('0x13')]);router[_0x1b2d('0x14')](_0x1b2d('0xa'),auth['isAuthenticated'](),controller[_0x1b2d('0x15')]);router['delete']('/:id',auth[_0x1b2d('0x8')](),controller['destroy']);module[_0x1b2d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index e9d24d0..cb1df52 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 _0x2e7b=['exports','STRING','sequelize'];(function(_0x4b3db9,_0x356b70){var _0x3f332b=function(_0x254312){while(--_0x254312){_0x4b3db9['push'](_0x4b3db9['shift']());}};_0x3f332b(++_0x356b70);}(_0x2e7b,0x13a));var _0xb2e7=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2e7b[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xb2e7('0x0'));module[_0xb2e7('0x1')]={'name':{'type':Sequelize[_0xb2e7('0x2')]},'description':{'type':Sequelize[_0xb2e7('0x2')]}}; \ No newline at end of file +var _0xc20f=['exports','STRING','sequelize'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xc20f,0x14c));var _0xfc20=function(_0x56e9af,_0x76252b){_0x56e9af=_0x56e9af-0x0;var _0x48ecd2=_0xc20f[_0x56e9af];return _0x48ecd2;};'use strict';var Sequelize=require(_0xfc20('0x0'));module[_0xfc20('0x1')]={'name':{'type':Sequelize[_0xfc20('0x2')]},'description':{'type':Sequelize[_0xfc20('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 1439985..b40cc7b 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 _0x562e=['ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','params','length','find','create','body','pick','getFields','getSubjects','findOne','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info'];(function(_0x1860c8,_0x201951){var _0x5914bf=function(_0xa37f5f){while(--_0xa37f5f){_0x1860c8['push'](_0x1860c8['shift']());}};_0x5914bf(++_0x201951);}(_0x562e,0x1a8));var _0xe562=function(_0x358a99,_0x653fb9){_0x358a99=_0x358a99-0x0;var _0x3d2caa=_0x562e[_0x358a99];return _0x3d2caa;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe562('0x0'));var rimraf=require(_0xe562('0x1'));var zipdir=require(_0xe562('0x2'));var jsonpatch=require(_0xe562('0x3'));var rp=require('request-promise');var moment=require(_0xe562('0x4'));var BPromise=require(_0xe562('0x5'));var Mustache=require(_0xe562('0x6'));var util=require(_0xe562('0x7'));var path=require(_0xe562('0x8'));var sox=require(_0xe562('0x9'));var csv=require(_0xe562('0xa'));var ejs=require(_0xe562('0xb'));var fs=require('fs');var _=require(_0xe562('0xc'));var squel=require('squel');var crypto=require(_0xe562('0xd'));var jsforce=require(_0xe562('0xe'));var deskjs=require(_0xe562('0xf'));var toCsv=require(_0xe562('0xa'));var querystring=require(_0xe562('0x10'));var Papa=require(_0xe562('0x11'));var Redis=require(_0xe562('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe562('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe562('0x14'))(_0xe562('0x15'));var utils=require(_0xe562('0x16'));var config=require(_0xe562('0x17'));var db=require(_0xe562('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe562('0x19')][_0xe562('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x535413,_0x90752e,_0xc8fc69){if(_0xc8fc69){var _0x5e935c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e935c[_0xe562('0x1b')](_0x90752e)){return _0x535413;}else{throw new db['Sequelize']['ValidationError'](_0xe562('0x1c'));}}else{return _0x535413;}}function respondWithRpcPromise(_0x264f84,_0x139d36,_0x3572b7,_0x3cbfbf){return new BPromise(function(_0x5d2057,_0x507e5d){var _0x15e21d=_0x3cbfbf||client;return _0x15e21d['request'](_0x264f84,_0x3572b7)[_0xe562('0x1d')](function(_0x11fa4a){logger[_0xe562('0x1e')](_0xe562('0x1f'),_0x139d36,_0xe562('0x20'));logger['debug'](_0xe562('0x21'),_0x139d36,'request\x20sent',JSON[_0xe562('0x22')](_0x11fa4a));if(_0x11fa4a['error']){if(_0x11fa4a[_0xe562('0x23')][_0xe562('0x24')]===0x1f4){logger[_0xe562('0x23')](_0xe562('0x1f'),_0x139d36,_0x11fa4a[_0xe562('0x23')]['message']);return _0x507e5d(_0x11fa4a['error'][_0xe562('0x25')]);}logger[_0xe562('0x23')](_0xe562('0x1f'),_0x139d36,_0x11fa4a[_0xe562('0x23')][_0xe562('0x25')]);return _0x5d2057(_0x11fa4a[_0xe562('0x23')][_0xe562('0x25')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x139d36,_0xe562('0x20'));_0x5d2057(_0x11fa4a['result'][_0xe562('0x25')]);}})[_0xe562('0x26')](function(_0x63031a){logger[_0xe562('0x23')](_0xe562('0x1f'),_0x139d36,_0x63031a);_0x507e5d(_0x63031a);});});}function respondWithStatusCode(_0x9aad09,_0xd4ec1b){_0xd4ec1b=_0xd4ec1b||0xcc;return function(_0x18c5ed){if(_0x18c5ed){return _0x9aad09[_0xe562('0x27')](_0xd4ec1b);}return _0x9aad09['status'](_0xd4ec1b)[_0xe562('0x28')]();};}function respondWithResult(_0x4d2025,_0x497e57){_0x497e57=_0x497e57||0xc8;return function(_0x3362ce){if(_0x3362ce){return _0x4d2025[_0xe562('0x29')](_0x497e57)['json'](_0x3362ce);}};}function respondWithFilteredResult(_0x203a34,_0xccc429){return function(_0x4b4238){if(_0x4b4238){var _0x48953f=_0x4b4238[_0xe562('0x2a')],_0x475863=_0xccc429[_0xe562('0x2b')],_0x53eab8=_0xccc429[_0xe562('0x2b')]+_0xccc429[_0xe562('0x2c')],_0x2141c7;if(_0x53eab8>=_0x48953f){_0x53eab8=_0x48953f;_0x2141c7=0xc8;}else{_0x2141c7=0xce;}_0x203a34[_0xe562('0x29')](_0x2141c7);return _0x203a34[_0xe562('0x2d')](_0xe562('0x2e'),_0x475863+'-'+_0x53eab8+'/'+_0x48953f)[_0xe562('0x2f')](_0x4b4238);}return null;};}function patchUpdates(_0xc00f15){return function(_0x3c4ed9){try{jsonpatch[_0xe562('0x30')](_0x3c4ed9,_0xc00f15,!![]);}catch(_0x1b1f91){return BPromise[_0xe562('0x31')](_0x1b1f91);}return _0x3c4ed9['save']();};}function saveUpdates(_0x20f333,_0x26816d){return function(_0xee0319){if(_0xee0319){return _0xee0319[_0xe562('0x32')](_0x20f333)[_0xe562('0x1d')](function(_0x114967){return _0x114967;});}return null;};}function removeEntity(_0x360ea5,_0x2d9cb2){return function(_0x232075){if(_0x232075){return _0x232075['destroy']()['then'](function(){_0x360ea5[_0xe562('0x29')](0xcc)[_0xe562('0x28')]();});}};}function handleEntityNotFound(_0xb62e48,_0x5b9e51){return function(_0x53993e){if(!_0x53993e){_0xb62e48[_0xe562('0x27')](0x194);}return _0x53993e;};}function handleError(_0x79333a,_0x462c2f){_0x462c2f=_0x462c2f||0x1f4;return function(_0x37777f){logger[_0xe562('0x23')](_0x37777f[_0xe562('0x33')]);if(_0x37777f[_0xe562('0x34')]){delete _0x37777f[_0xe562('0x34')];}_0x79333a[_0xe562('0x29')](_0x462c2f)[_0xe562('0x35')](_0x37777f);};}exports[_0xe562('0x36')]=function(_0x3b549e,_0x375b5f){var _0x36d26d={},_0x2b34d7={},_0x1962fe={'count':0x0,'rows':[]};var _0xaea222=_['map'](db[_0xe562('0x37')][_0xe562('0x38')],function(_0x3d4e9b){return{'name':_0x3d4e9b[_0xe562('0x39')],'type':_0x3d4e9b['type'][_0xe562('0x3a')]};});_0x2b34d7[_0xe562('0x3b')]=_[_0xe562('0x3c')](_0xaea222,_0xe562('0x34'));_0x2b34d7[_0xe562('0x3d')]=_[_0xe562('0x3e')](_0x3b549e[_0xe562('0x3d')]);_0x2b34d7[_0xe562('0x3f')]=_[_0xe562('0x40')](_0x2b34d7[_0xe562('0x3b')],_0x2b34d7[_0xe562('0x3d')]);_0x36d26d[_0xe562('0x41')]=_[_0xe562('0x40')](_0x2b34d7[_0xe562('0x3b')],qs[_0xe562('0x42')](_0x3b549e[_0xe562('0x3d')][_0xe562('0x42')]));_0x36d26d[_0xe562('0x41')]=_0x36d26d[_0xe562('0x41')]['length']?_0x36d26d[_0xe562('0x41')]:_0x2b34d7[_0xe562('0x3b')];if(!_0x3b549e[_0xe562('0x3d')][_0xe562('0x43')](_0xe562('0x44'))){_0x36d26d['limit']=qs[_0xe562('0x2c')](_0x3b549e[_0xe562('0x3d')]['limit']);_0x36d26d[_0xe562('0x2b')]=qs[_0xe562('0x2b')](_0x3b549e['query'][_0xe562('0x2b')]);}_0x36d26d[_0xe562('0x45')]=qs[_0xe562('0x46')](_0x3b549e['query'][_0xe562('0x46')]);_0x36d26d['where']=qs['filters'](_['pick'](_0x3b549e['query'],_0x2b34d7[_0xe562('0x3f')]));if(_0x3b549e['query'][_0xe562('0x47')]){_0x36d26d[_0xe562('0x48')]=_[_0xe562('0x49')](_0x36d26d[_0xe562('0x48')],{'$or':_[_0xe562('0x3c')](_0xaea222,function(_0x2d0ba9){if(_0x2d0ba9[_0xe562('0x4a')]!==_0xe562('0x4b')){var _0x430b29={};_0x430b29[_0x2d0ba9[_0xe562('0x34')]]={'$like':'%'+_0x3b549e[_0xe562('0x3d')]['filter']+'%'};return _0x430b29;}})});}_0x36d26d=_['merge']({},_0x36d26d,_0x3b549e[_0xe562('0x4c')]);var _0x2e4820={'where':_0x36d26d[_0xe562('0x48')]};return db[_0xe562('0x37')][_0xe562('0x2a')](_0x2e4820)[_0xe562('0x1d')](function(_0x58670c){_0x1962fe[_0xe562('0x2a')]=_0x58670c;if(_0x3b549e[_0xe562('0x3d')][_0xe562('0x4d')]){_0x36d26d[_0xe562('0x4e')]=[{'all':!![]}];}return db[_0xe562('0x37')]['findAll'](_0x36d26d);})[_0xe562('0x1d')](function(_0x2b602b){_0x1962fe[_0xe562('0x4f')]=_0x2b602b;return _0x1962fe;})[_0xe562('0x1d')](respondWithFilteredResult(_0x375b5f,_0x36d26d))[_0xe562('0x26')](handleError(_0x375b5f,null));};exports['show']=function(_0x5d586f,_0x29e2fd){var _0x2d840b={'raw':![],'where':{'id':_0x5d586f[_0xe562('0x50')]['id']}},_0x26a4c1={};_0x26a4c1[_0xe562('0x3b')]=_[_0xe562('0x3e')](db['ServicenowConfiguration'][_0xe562('0x38')]);_0x26a4c1[_0xe562('0x3d')]=_[_0xe562('0x3e')](_0x5d586f[_0xe562('0x3d')]);_0x26a4c1[_0xe562('0x3f')]=_[_0xe562('0x40')](_0x26a4c1[_0xe562('0x3b')],_0x26a4c1[_0xe562('0x3d')]);_0x2d840b[_0xe562('0x41')]=_[_0xe562('0x40')](_0x26a4c1['model'],qs[_0xe562('0x42')](_0x5d586f[_0xe562('0x3d')]['fields']));_0x2d840b[_0xe562('0x41')]=_0x2d840b[_0xe562('0x41')][_0xe562('0x51')]?_0x2d840b[_0xe562('0x41')]:_0x26a4c1[_0xe562('0x3b')];if(_0x5d586f['query'][_0xe562('0x4d')]){_0x2d840b[_0xe562('0x4e')]=[{'all':!![]}];}_0x2d840b=_[_0xe562('0x49')]({},_0x2d840b,_0x5d586f[_0xe562('0x4c')]);return db[_0xe562('0x37')][_0xe562('0x52')](_0x2d840b)['then'](handleEntityNotFound(_0x29e2fd,null))[_0xe562('0x1d')](respondWithResult(_0x29e2fd,null))[_0xe562('0x26')](handleError(_0x29e2fd,null));};exports[_0xe562('0x53')]=function(_0x5653e8,_0x2047a3){return db[_0xe562('0x37')][_0xe562('0x53')](_0x5653e8[_0xe562('0x54')],{})[_0xe562('0x1d')](respondWithResult(_0x2047a3,0xc9))[_0xe562('0x26')](handleError(_0x2047a3,null));};exports[_0xe562('0x32')]=function(_0x309299,_0x390799){if(_0x309299['body']['id']){delete _0x309299['body']['id'];}return db[_0xe562('0x37')][_0xe562('0x52')]({'where':{'id':_0x309299[_0xe562('0x50')]['id']}})[_0xe562('0x1d')](handleEntityNotFound(_0x390799,null))[_0xe562('0x1d')](saveUpdates(_0x309299[_0xe562('0x54')],null))['then'](respondWithResult(_0x390799,null))[_0xe562('0x26')](handleError(_0x390799,null));};exports['destroy']=function(_0x2ad0ad,_0x356439){return db[_0xe562('0x37')][_0xe562('0x52')]({'where':{'id':_0x2ad0ad[_0xe562('0x50')]['id']}})[_0xe562('0x1d')](handleEntityNotFound(_0x356439,null))['then'](removeEntity(_0x356439,null))[_0xe562('0x26')](handleError(_0x356439,null));};exports['getFields']=function(_0x4a3c86,_0x3a2aa1,_0x3bbb56){var _0x1f4d17={};var _0x4b0e1f={};var _0x21046c;var _0x3ba2eb;return db[_0xe562('0x37')]['findOne']({'where':{'id':_0x4a3c86[_0xe562('0x50')]['id']}})['then'](handleEntityNotFound(_0x3a2aa1,null))['then'](function(_0x31d659){if(_0x31d659){_0x21046c=_0x31d659;_0x4b0e1f[_0xe562('0x3b')]=_['keys'](db['ServicenowField'][_0xe562('0x38')]);_0x4b0e1f['query']=_[_0xe562('0x3e')](_0x4a3c86['query']);_0x4b0e1f[_0xe562('0x3f')]=_['intersection'](_0x4b0e1f[_0xe562('0x3b')],_0x4b0e1f[_0xe562('0x3d')]);_0x1f4d17[_0xe562('0x41')]=_[_0xe562('0x40')](_0x4b0e1f[_0xe562('0x3b')],qs['fields'](_0x4a3c86[_0xe562('0x3d')][_0xe562('0x42')]));_0x1f4d17[_0xe562('0x41')]=_0x1f4d17[_0xe562('0x41')]['length']?_0x1f4d17[_0xe562('0x41')]:_0x4b0e1f['model'];_0x1f4d17[_0xe562('0x45')]=qs[_0xe562('0x46')](_0x4a3c86['query'][_0xe562('0x46')]);_0x1f4d17[_0xe562('0x48')]=qs[_0xe562('0x3f')](_[_0xe562('0x55')](_0x4a3c86[_0xe562('0x3d')],_0x4b0e1f[_0xe562('0x3f')]));if(_0x4a3c86['query'][_0xe562('0x47')]){_0x1f4d17[_0xe562('0x48')]=_['merge'](_0x1f4d17[_0xe562('0x48')],{'$or':_['map'](_0x1f4d17[_0xe562('0x41')],function(_0x331c72){var _0x358bbc={};_0x358bbc[_0x331c72]={'$like':'%'+_0x4a3c86[_0xe562('0x3d')][_0xe562('0x47')]+'%'};return _0x358bbc;})});}_0x1f4d17=_[_0xe562('0x49')]({},_0x1f4d17,_0x4a3c86[_0xe562('0x4c')]);return _0x21046c['getFields'](_0x1f4d17);}})[_0xe562('0x1d')](function(_0x3a455e){if(_0x3a455e){_0x3ba2eb=_0x3a455e['length'];if(!_0x4a3c86['query'][_0xe562('0x43')](_0xe562('0x44'))){_0x1f4d17[_0xe562('0x2c')]=qs[_0xe562('0x2c')](_0x4a3c86[_0xe562('0x3d')][_0xe562('0x2c')]);_0x1f4d17[_0xe562('0x2b')]=qs['offset'](_0x4a3c86[_0xe562('0x3d')][_0xe562('0x2b')]);}return _0x21046c[_0xe562('0x56')](_0x1f4d17);}})[_0xe562('0x1d')](function(_0x3fb1f4){if(_0x3fb1f4){return _0x3fb1f4?{'count':_0x3ba2eb,'rows':_0x3fb1f4}:null;}})[_0xe562('0x1d')](respondWithResult(_0x3a2aa1,null))[_0xe562('0x26')](handleError(_0x3a2aa1,null));};exports[_0xe562('0x57')]=function(_0x49424b,_0x3ce422,_0x1173b9){var _0x4a3c51={};var _0x4c7bcc={};var _0x29fb86;var _0x88fdb3;return db['ServicenowConfiguration'][_0xe562('0x58')]({'where':{'id':_0x49424b[_0xe562('0x50')]['id']}})[_0xe562('0x1d')](handleEntityNotFound(_0x3ce422,null))[_0xe562('0x1d')](function(_0x15d7c3){if(_0x15d7c3){_0x29fb86=_0x15d7c3;_0x4c7bcc[_0xe562('0x3b')]=_[_0xe562('0x3e')](db[_0xe562('0x59')][_0xe562('0x38')]);_0x4c7bcc[_0xe562('0x3d')]=_[_0xe562('0x3e')](_0x49424b[_0xe562('0x3d')]);_0x4c7bcc[_0xe562('0x3f')]=_[_0xe562('0x40')](_0x4c7bcc[_0xe562('0x3b')],_0x4c7bcc[_0xe562('0x3d')]);_0x4a3c51['attributes']=_[_0xe562('0x40')](_0x4c7bcc[_0xe562('0x3b')],qs['fields'](_0x49424b[_0xe562('0x3d')]['fields']));_0x4a3c51['attributes']=_0x4a3c51[_0xe562('0x41')][_0xe562('0x51')]?_0x4a3c51[_0xe562('0x41')]:_0x4c7bcc[_0xe562('0x3b')];_0x4a3c51['order']=qs[_0xe562('0x46')](_0x49424b['query']['sort']);_0x4a3c51[_0xe562('0x48')]=qs[_0xe562('0x3f')](_[_0xe562('0x55')](_0x49424b['query'],_0x4c7bcc[_0xe562('0x3f')]));if(_0x49424b[_0xe562('0x3d')][_0xe562('0x47')]){_0x4a3c51[_0xe562('0x48')]=_['merge'](_0x4a3c51['where'],{'$or':_[_0xe562('0x3c')](_0x4a3c51[_0xe562('0x41')],function(_0x4efe19){var _0x47c89d={};_0x47c89d[_0x4efe19]={'$like':'%'+_0x49424b[_0xe562('0x3d')][_0xe562('0x47')]+'%'};return _0x47c89d;})});}_0x4a3c51=_[_0xe562('0x49')]({},_0x4a3c51,_0x49424b[_0xe562('0x4c')]);return _0x29fb86[_0xe562('0x57')](_0x4a3c51);}})[_0xe562('0x1d')](function(_0x338a0d){if(_0x338a0d){_0x88fdb3=_0x338a0d[_0xe562('0x51')];if(!_0x49424b[_0xe562('0x3d')][_0xe562('0x43')]('nolimit')){_0x4a3c51['limit']=qs[_0xe562('0x2c')](_0x49424b[_0xe562('0x3d')][_0xe562('0x2c')]);_0x4a3c51[_0xe562('0x2b')]=qs[_0xe562('0x2b')](_0x49424b[_0xe562('0x3d')][_0xe562('0x2b')]);}return _0x29fb86[_0xe562('0x57')](_0x4a3c51);}})[_0xe562('0x1d')](function(_0x185388){if(_0x185388){return _0x185388?{'count':_0x88fdb3,'rows':_0x185388}:null;}})[_0xe562('0x1d')](respondWithResult(_0x3ce422,null))['catch'](handleError(_0x3ce422,null));};exports[_0xe562('0x5a')]=function(_0x81288f,_0x2e3927,_0xb4db8f){var _0x35327e={};var _0x4aa1f3={};var _0x3a9095;var _0x23524b;return db[_0xe562('0x37')][_0xe562('0x58')]({'where':{'id':_0x81288f[_0xe562('0x50')]['id']}})[_0xe562('0x1d')](handleEntityNotFound(_0x2e3927,null))[_0xe562('0x1d')](function(_0x5556fd){if(_0x5556fd){_0x3a9095=_0x5556fd;_0x4aa1f3['model']=_[_0xe562('0x3e')](db[_0xe562('0x59')]['rawAttributes']);_0x4aa1f3['query']=_['keys'](_0x81288f[_0xe562('0x3d')]);_0x4aa1f3['filters']=_['intersection'](_0x4aa1f3['model'],_0x4aa1f3[_0xe562('0x3d')]);_0x35327e[_0xe562('0x41')]=_['intersection'](_0x4aa1f3[_0xe562('0x3b')],qs[_0xe562('0x42')](_0x81288f[_0xe562('0x3d')][_0xe562('0x42')]));_0x35327e[_0xe562('0x41')]=_0x35327e[_0xe562('0x41')]['length']?_0x35327e[_0xe562('0x41')]:_0x4aa1f3[_0xe562('0x3b')];_0x35327e[_0xe562('0x45')]=qs[_0xe562('0x46')](_0x81288f[_0xe562('0x3d')][_0xe562('0x46')]);_0x35327e[_0xe562('0x48')]=qs['filters'](_[_0xe562('0x55')](_0x81288f[_0xe562('0x3d')],_0x4aa1f3['filters']));if(_0x81288f[_0xe562('0x3d')]['filter']){_0x35327e[_0xe562('0x48')]=_[_0xe562('0x49')](_0x35327e[_0xe562('0x48')],{'$or':_[_0xe562('0x3c')](_0x35327e[_0xe562('0x41')],function(_0x29d8e6){var _0x498080={};_0x498080[_0x29d8e6]={'$like':'%'+_0x81288f['query'][_0xe562('0x47')]+'%'};return _0x498080;})});}_0x35327e=_[_0xe562('0x49')]({},_0x35327e,_0x81288f[_0xe562('0x4c')]);return _0x3a9095['getDescriptions'](_0x35327e);}})['then'](function(_0x2fd391){if(_0x2fd391){_0x23524b=_0x2fd391['length'];if(!_0x81288f[_0xe562('0x3d')][_0xe562('0x43')](_0xe562('0x44'))){_0x35327e[_0xe562('0x2c')]=qs[_0xe562('0x2c')](_0x81288f['query'][_0xe562('0x2c')]);_0x35327e[_0xe562('0x2b')]=qs[_0xe562('0x2b')](_0x81288f[_0xe562('0x3d')][_0xe562('0x2b')]);}return _0x3a9095[_0xe562('0x5a')](_0x35327e);}})[_0xe562('0x1d')](function(_0x5a316f){if(_0x5a316f){return _0x5a316f?{'count':_0x23524b,'rows':_0x5a316f}:null;}})[_0xe562('0x1d')](respondWithResult(_0x2e3927,null))['catch'](handleError(_0x2e3927,null));}; \ No newline at end of file +var _0xc287=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','count','offset','limit','set','Content-Range','apply','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ServicenowConfiguration','include','findAll','show','params','find','create','body','update','getFields','findOne','hasOwnProperty','ServicenowField','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x1a3e8a,_0x52680e){var _0x53e696=function(_0x5cb155){while(--_0x5cb155){_0x1a3e8a['push'](_0x1a3e8a['shift']());}};_0x53e696(++_0x52680e);}(_0xc287,0xa4));var _0x7c28=function(_0x35949a,_0xece70){_0x35949a=_0x35949a-0x0;var _0x9e2198=_0xc287[_0x35949a];return _0x9e2198;};'use strict';var pdf=require(_0x7c28('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7c28('0x1'));var zipdir=require(_0x7c28('0x2'));var jsonpatch=require(_0x7c28('0x3'));var rp=require('request-promise');var moment=require(_0x7c28('0x4'));var BPromise=require(_0x7c28('0x5'));var Mustache=require(_0x7c28('0x6'));var util=require(_0x7c28('0x7'));var path=require('path');var sox=require(_0x7c28('0x8'));var csv=require(_0x7c28('0x9'));var ejs=require(_0x7c28('0xa'));var fs=require('fs');var _=require(_0x7c28('0xb'));var squel=require(_0x7c28('0xc'));var crypto=require(_0x7c28('0xd'));var jsforce=require(_0x7c28('0xe'));var deskjs=require(_0x7c28('0xf'));var toCsv=require(_0x7c28('0x9'));var querystring=require(_0x7c28('0x10'));var Papa=require(_0x7c28('0x11'));var Redis=require(_0x7c28('0x12'));var authService=require(_0x7c28('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7c28('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c28('0x15'))('api');var utils=require(_0x7c28('0x16'));var config=require('../../config/environment');var db=require(_0x7c28('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x7c28('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0xd22f0f,_0x2aefd2,_0x71d4f6){if(_0x71d4f6){var _0xfd1daa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xfd1daa['test'](_0x2aefd2)){return _0xd22f0f;}else{throw new db[(_0x7c28('0x19'))][(_0x7c28('0x1a'))](_0x7c28('0x1b'));}}else{return _0xd22f0f;}}function respondWithRpcPromise(_0x561eca,_0x331d36,_0x3519e3,_0x1bd59a){return new BPromise(function(_0x2198a9,_0x408840){var _0x53ceba=_0x1bd59a||client;return _0x53ceba[_0x7c28('0x1c')](_0x561eca,_0x3519e3)[_0x7c28('0x1d')](function(_0x19bb25){logger[_0x7c28('0x1e')](_0x7c28('0x1f'),_0x331d36,_0x7c28('0x20'));logger[_0x7c28('0x21')](_0x7c28('0x22'),_0x331d36,_0x7c28('0x20'),JSON[_0x7c28('0x23')](_0x19bb25));if(_0x19bb25[_0x7c28('0x24')]){if(_0x19bb25[_0x7c28('0x24')][_0x7c28('0x25')]===0x1f4){logger[_0x7c28('0x24')](_0x7c28('0x1f'),_0x331d36,_0x19bb25[_0x7c28('0x24')][_0x7c28('0x26')]);return _0x408840(_0x19bb25[_0x7c28('0x24')]['message']);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x331d36,_0x19bb25['error'][_0x7c28('0x26')]);return _0x2198a9(_0x19bb25['error']['message']);}else{logger[_0x7c28('0x1e')](_0x7c28('0x1f'),_0x331d36,_0x7c28('0x20'));_0x2198a9(_0x19bb25['result'][_0x7c28('0x26')]);}})[_0x7c28('0x27')](function(_0x19f086){logger[_0x7c28('0x24')]('ServicenowConfiguration,\x20%s,\x20%s',_0x331d36,_0x19f086);_0x408840(_0x19f086);});});}function respondWithStatusCode(_0x43ad17,_0x374421){_0x374421=_0x374421||0xcc;return function(_0x49875d){if(_0x49875d){return _0x43ad17['sendStatus'](_0x374421);}return _0x43ad17[_0x7c28('0x28')](_0x374421)['end']();};}function respondWithResult(_0x591a5d,_0x424420){_0x424420=_0x424420||0xc8;return function(_0x1729a0){if(_0x1729a0){return _0x591a5d[_0x7c28('0x28')](_0x424420)[_0x7c28('0x29')](_0x1729a0);}};}function respondWithFilteredResult(_0x748d26,_0x371d69){return function(_0x3c3e2a){if(_0x3c3e2a){var _0x1fdf0c=_0x3c3e2a[_0x7c28('0x2a')],_0x551b25=_0x371d69[_0x7c28('0x2b')],_0x510ef3=_0x371d69[_0x7c28('0x2b')]+_0x371d69[_0x7c28('0x2c')],_0x4a647f;if(_0x510ef3>=_0x1fdf0c){_0x510ef3=_0x1fdf0c;_0x4a647f=0xc8;}else{_0x4a647f=0xce;}_0x748d26['status'](_0x4a647f);return _0x748d26[_0x7c28('0x2d')](_0x7c28('0x2e'),_0x551b25+'-'+_0x510ef3+'/'+_0x1fdf0c)['json'](_0x3c3e2a);}return null;};}function patchUpdates(_0x3c1506){return function(_0x5ccdf4){try{jsonpatch[_0x7c28('0x2f')](_0x5ccdf4,_0x3c1506,!![]);}catch(_0x3ce8b4){return BPromise['reject'](_0x3ce8b4);}return _0x5ccdf4['save']();};}function saveUpdates(_0x55e700,_0x56a3ba){return function(_0x4fccdf){if(_0x4fccdf){return _0x4fccdf['update'](_0x55e700)[_0x7c28('0x1d')](function(_0x48510d){return _0x48510d;});}return null;};}function removeEntity(_0x294850,_0x145f02){return function(_0x344300){if(_0x344300){return _0x344300[_0x7c28('0x30')]()[_0x7c28('0x1d')](function(){_0x294850[_0x7c28('0x28')](0xcc)[_0x7c28('0x31')]();});}};}function handleEntityNotFound(_0x5db334,_0x47f1ee){return function(_0x45d2d2){if(!_0x45d2d2){_0x5db334[_0x7c28('0x32')](0x194);}return _0x45d2d2;};}function handleError(_0x2d859d,_0x34d47d){_0x34d47d=_0x34d47d||0x1f4;return function(_0x3d37d8){logger[_0x7c28('0x24')](_0x3d37d8[_0x7c28('0x33')]);if(_0x3d37d8[_0x7c28('0x34')]){delete _0x3d37d8[_0x7c28('0x34')];}_0x2d859d[_0x7c28('0x28')](_0x34d47d)[_0x7c28('0x35')](_0x3d37d8);};}exports[_0x7c28('0x36')]=function(_0x3bae49,_0x1df0a0){var _0x39c30b={},_0x328e5f={},_0x150311={'count':0x0,'rows':[]};var _0x3b6ae6=_[_0x7c28('0x37')](db['ServicenowConfiguration'][_0x7c28('0x38')],function(_0x18f252){return{'name':_0x18f252['fieldName'],'type':_0x18f252[_0x7c28('0x39')][_0x7c28('0x3a')]};});_0x328e5f['model']=_[_0x7c28('0x37')](_0x3b6ae6,_0x7c28('0x34'));_0x328e5f['query']=_[_0x7c28('0x3b')](_0x3bae49['query']);_0x328e5f[_0x7c28('0x3c')]=_[_0x7c28('0x3d')](_0x328e5f[_0x7c28('0x3e')],_0x328e5f[_0x7c28('0x3f')]);_0x39c30b[_0x7c28('0x40')]=_[_0x7c28('0x3d')](_0x328e5f[_0x7c28('0x3e')],qs['fields'](_0x3bae49[_0x7c28('0x3f')][_0x7c28('0x41')]));_0x39c30b['attributes']=_0x39c30b['attributes'][_0x7c28('0x42')]?_0x39c30b[_0x7c28('0x40')]:_0x328e5f['model'];if(!_0x3bae49['query']['hasOwnProperty'](_0x7c28('0x43'))){_0x39c30b[_0x7c28('0x2c')]=qs[_0x7c28('0x2c')](_0x3bae49['query'][_0x7c28('0x2c')]);_0x39c30b[_0x7c28('0x2b')]=qs[_0x7c28('0x2b')](_0x3bae49[_0x7c28('0x3f')][_0x7c28('0x2b')]);}_0x39c30b[_0x7c28('0x44')]=qs[_0x7c28('0x45')](_0x3bae49[_0x7c28('0x3f')][_0x7c28('0x45')]);_0x39c30b[_0x7c28('0x46')]=qs[_0x7c28('0x3c')](_[_0x7c28('0x47')](_0x3bae49[_0x7c28('0x3f')],_0x328e5f['filters']));if(_0x3bae49[_0x7c28('0x3f')]['filter']){_0x39c30b[_0x7c28('0x46')]=_[_0x7c28('0x48')](_0x39c30b[_0x7c28('0x46')],{'$or':_['map'](_0x3b6ae6,function(_0x1d28b3){if(_0x1d28b3['type']!==_0x7c28('0x49')){var _0x56e1f4={};_0x56e1f4[_0x1d28b3[_0x7c28('0x34')]]={'$like':'%'+_0x3bae49[_0x7c28('0x3f')][_0x7c28('0x4a')]+'%'};return _0x56e1f4;}})});}_0x39c30b=_[_0x7c28('0x48')]({},_0x39c30b,_0x3bae49[_0x7c28('0x4b')]);var _0x1045b0={'where':_0x39c30b[_0x7c28('0x46')]};return db[_0x7c28('0x4c')][_0x7c28('0x2a')](_0x1045b0)[_0x7c28('0x1d')](function(_0x1cae17){_0x150311[_0x7c28('0x2a')]=_0x1cae17;if(_0x3bae49[_0x7c28('0x3f')]['includeAll']){_0x39c30b[_0x7c28('0x4d')]=[{'all':!![]}];}return db[_0x7c28('0x4c')][_0x7c28('0x4e')](_0x39c30b);})[_0x7c28('0x1d')](function(_0x1d0252){_0x150311['rows']=_0x1d0252;return _0x150311;})[_0x7c28('0x1d')](respondWithFilteredResult(_0x1df0a0,_0x39c30b))[_0x7c28('0x27')](handleError(_0x1df0a0,null));};exports[_0x7c28('0x4f')]=function(_0x166e87,_0x2f1e6b){var _0x156173={'raw':![],'where':{'id':_0x166e87[_0x7c28('0x50')]['id']}},_0x1e5deb={};_0x1e5deb['model']=_[_0x7c28('0x3b')](db['ServicenowConfiguration']['rawAttributes']);_0x1e5deb[_0x7c28('0x3f')]=_['keys'](_0x166e87[_0x7c28('0x3f')]);_0x1e5deb[_0x7c28('0x3c')]=_[_0x7c28('0x3d')](_0x1e5deb[_0x7c28('0x3e')],_0x1e5deb[_0x7c28('0x3f')]);_0x156173['attributes']=_['intersection'](_0x1e5deb['model'],qs[_0x7c28('0x41')](_0x166e87[_0x7c28('0x3f')][_0x7c28('0x41')]));_0x156173[_0x7c28('0x40')]=_0x156173[_0x7c28('0x40')]['length']?_0x156173[_0x7c28('0x40')]:_0x1e5deb[_0x7c28('0x3e')];if(_0x166e87['query']['includeAll']){_0x156173['include']=[{'all':!![]}];}_0x156173=_['merge']({},_0x156173,_0x166e87[_0x7c28('0x4b')]);return db[_0x7c28('0x4c')][_0x7c28('0x51')](_0x156173)[_0x7c28('0x1d')](handleEntityNotFound(_0x2f1e6b,null))['then'](respondWithResult(_0x2f1e6b,null))['catch'](handleError(_0x2f1e6b,null));};exports[_0x7c28('0x52')]=function(_0x294a04,_0x3cf377){return db[_0x7c28('0x4c')][_0x7c28('0x52')](_0x294a04[_0x7c28('0x53')],{})[_0x7c28('0x1d')](respondWithResult(_0x3cf377,0xc9))['catch'](handleError(_0x3cf377,null));};exports[_0x7c28('0x54')]=function(_0x35cf19,_0x436111){if(_0x35cf19[_0x7c28('0x53')]['id']){delete _0x35cf19[_0x7c28('0x53')]['id'];}return db[_0x7c28('0x4c')]['find']({'where':{'id':_0x35cf19[_0x7c28('0x50')]['id']}})[_0x7c28('0x1d')](handleEntityNotFound(_0x436111,null))[_0x7c28('0x1d')](saveUpdates(_0x35cf19[_0x7c28('0x53')],null))[_0x7c28('0x1d')](respondWithResult(_0x436111,null))[_0x7c28('0x27')](handleError(_0x436111,null));};exports[_0x7c28('0x30')]=function(_0x553aa3,_0x3137cc){return db[_0x7c28('0x4c')]['find']({'where':{'id':_0x553aa3[_0x7c28('0x50')]['id']}})['then'](handleEntityNotFound(_0x3137cc,null))[_0x7c28('0x1d')](removeEntity(_0x3137cc,null))['catch'](handleError(_0x3137cc,null));};exports[_0x7c28('0x55')]=function(_0x145b3a,_0x430c2f,_0x549d14){var _0x5a75d4={};var _0x50973e={};var _0x2ccb2d;var _0x48351a;return db[_0x7c28('0x4c')][_0x7c28('0x56')]({'where':{'id':_0x145b3a[_0x7c28('0x50')]['id']}})[_0x7c28('0x1d')](handleEntityNotFound(_0x430c2f,null))[_0x7c28('0x1d')](function(_0x566017){if(_0x566017){_0x2ccb2d=_0x566017;_0x50973e['model']=_['keys'](db['ServicenowField'][_0x7c28('0x38')]);_0x50973e[_0x7c28('0x3f')]=_[_0x7c28('0x3b')](_0x145b3a[_0x7c28('0x3f')]);_0x50973e['filters']=_[_0x7c28('0x3d')](_0x50973e[_0x7c28('0x3e')],_0x50973e[_0x7c28('0x3f')]);_0x5a75d4['attributes']=_[_0x7c28('0x3d')](_0x50973e[_0x7c28('0x3e')],qs[_0x7c28('0x41')](_0x145b3a['query'][_0x7c28('0x41')]));_0x5a75d4[_0x7c28('0x40')]=_0x5a75d4[_0x7c28('0x40')][_0x7c28('0x42')]?_0x5a75d4[_0x7c28('0x40')]:_0x50973e[_0x7c28('0x3e')];_0x5a75d4[_0x7c28('0x44')]=qs[_0x7c28('0x45')](_0x145b3a[_0x7c28('0x3f')]['sort']);_0x5a75d4[_0x7c28('0x46')]=qs['filters'](_[_0x7c28('0x47')](_0x145b3a[_0x7c28('0x3f')],_0x50973e['filters']));if(_0x145b3a[_0x7c28('0x3f')]['filter']){_0x5a75d4[_0x7c28('0x46')]=_[_0x7c28('0x48')](_0x5a75d4[_0x7c28('0x46')],{'$or':_[_0x7c28('0x37')](_0x5a75d4[_0x7c28('0x40')],function(_0x4a9b73){var _0x261c31={};_0x261c31[_0x4a9b73]={'$like':'%'+_0x145b3a[_0x7c28('0x3f')][_0x7c28('0x4a')]+'%'};return _0x261c31;})});}_0x5a75d4=_[_0x7c28('0x48')]({},_0x5a75d4,_0x145b3a['options']);return _0x2ccb2d['getFields'](_0x5a75d4);}})['then'](function(_0x35598b){if(_0x35598b){_0x48351a=_0x35598b[_0x7c28('0x42')];if(!_0x145b3a[_0x7c28('0x3f')][_0x7c28('0x57')]('nolimit')){_0x5a75d4[_0x7c28('0x2c')]=qs[_0x7c28('0x2c')](_0x145b3a[_0x7c28('0x3f')]['limit']);_0x5a75d4['offset']=qs[_0x7c28('0x2b')](_0x145b3a[_0x7c28('0x3f')][_0x7c28('0x2b')]);}return _0x2ccb2d[_0x7c28('0x55')](_0x5a75d4);}})[_0x7c28('0x1d')](function(_0x405a62){if(_0x405a62){return _0x405a62?{'count':_0x48351a,'rows':_0x405a62}:null;}})[_0x7c28('0x1d')](respondWithResult(_0x430c2f,null))[_0x7c28('0x27')](handleError(_0x430c2f,null));};exports['getSubjects']=function(_0x1b1c79,_0x4105ca,_0x2896f1){var _0x4071e0={};var _0x123f4b={};var _0x57d71a;var _0x2d3f43;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x1b1c79[_0x7c28('0x50')]['id']}})[_0x7c28('0x1d')](handleEntityNotFound(_0x4105ca,null))['then'](function(_0x48316a){if(_0x48316a){_0x57d71a=_0x48316a;_0x123f4b[_0x7c28('0x3e')]=_[_0x7c28('0x3b')](db[_0x7c28('0x58')]['rawAttributes']);_0x123f4b[_0x7c28('0x3f')]=_[_0x7c28('0x3b')](_0x1b1c79[_0x7c28('0x3f')]);_0x123f4b[_0x7c28('0x3c')]=_['intersection'](_0x123f4b[_0x7c28('0x3e')],_0x123f4b[_0x7c28('0x3f')]);_0x4071e0[_0x7c28('0x40')]=_['intersection'](_0x123f4b[_0x7c28('0x3e')],qs[_0x7c28('0x41')](_0x1b1c79[_0x7c28('0x3f')][_0x7c28('0x41')]));_0x4071e0[_0x7c28('0x40')]=_0x4071e0['attributes'][_0x7c28('0x42')]?_0x4071e0[_0x7c28('0x40')]:_0x123f4b[_0x7c28('0x3e')];_0x4071e0[_0x7c28('0x44')]=qs[_0x7c28('0x45')](_0x1b1c79[_0x7c28('0x3f')][_0x7c28('0x45')]);_0x4071e0['where']=qs['filters'](_['pick'](_0x1b1c79[_0x7c28('0x3f')],_0x123f4b[_0x7c28('0x3c')]));if(_0x1b1c79[_0x7c28('0x3f')][_0x7c28('0x4a')]){_0x4071e0['where']=_[_0x7c28('0x48')](_0x4071e0[_0x7c28('0x46')],{'$or':_[_0x7c28('0x37')](_0x4071e0[_0x7c28('0x40')],function(_0x585bc9){var _0x14b9bd={};_0x14b9bd[_0x585bc9]={'$like':'%'+_0x1b1c79[_0x7c28('0x3f')][_0x7c28('0x4a')]+'%'};return _0x14b9bd;})});}_0x4071e0=_[_0x7c28('0x48')]({},_0x4071e0,_0x1b1c79[_0x7c28('0x4b')]);return _0x57d71a[_0x7c28('0x59')](_0x4071e0);}})[_0x7c28('0x1d')](function(_0x5bf90b){if(_0x5bf90b){_0x2d3f43=_0x5bf90b[_0x7c28('0x42')];if(!_0x1b1c79['query']['hasOwnProperty'](_0x7c28('0x43'))){_0x4071e0[_0x7c28('0x2c')]=qs[_0x7c28('0x2c')](_0x1b1c79[_0x7c28('0x3f')]['limit']);_0x4071e0[_0x7c28('0x2b')]=qs['offset'](_0x1b1c79[_0x7c28('0x3f')]['offset']);}return _0x57d71a[_0x7c28('0x59')](_0x4071e0);}})[_0x7c28('0x1d')](function(_0x1fbfdb){if(_0x1fbfdb){return _0x1fbfdb?{'count':_0x2d3f43,'rows':_0x1fbfdb}:null;}})[_0x7c28('0x1d')](respondWithResult(_0x4105ca,null))[_0x7c28('0x27')](handleError(_0x4105ca,null));};exports[_0x7c28('0x5a')]=function(_0x36f628,_0x37951f,_0x51324d){var _0x50bd70={};var _0xceaafb={};var _0x447943;var _0x33d6b2;return db[_0x7c28('0x4c')][_0x7c28('0x56')]({'where':{'id':_0x36f628[_0x7c28('0x50')]['id']}})[_0x7c28('0x1d')](handleEntityNotFound(_0x37951f,null))['then'](function(_0x108742){if(_0x108742){_0x447943=_0x108742;_0xceaafb['model']=_[_0x7c28('0x3b')](db[_0x7c28('0x58')][_0x7c28('0x38')]);_0xceaafb[_0x7c28('0x3f')]=_['keys'](_0x36f628[_0x7c28('0x3f')]);_0xceaafb[_0x7c28('0x3c')]=_[_0x7c28('0x3d')](_0xceaafb['model'],_0xceaafb[_0x7c28('0x3f')]);_0x50bd70[_0x7c28('0x40')]=_[_0x7c28('0x3d')](_0xceaafb[_0x7c28('0x3e')],qs[_0x7c28('0x41')](_0x36f628[_0x7c28('0x3f')][_0x7c28('0x41')]));_0x50bd70[_0x7c28('0x40')]=_0x50bd70[_0x7c28('0x40')][_0x7c28('0x42')]?_0x50bd70[_0x7c28('0x40')]:_0xceaafb[_0x7c28('0x3e')];_0x50bd70[_0x7c28('0x44')]=qs[_0x7c28('0x45')](_0x36f628[_0x7c28('0x3f')]['sort']);_0x50bd70[_0x7c28('0x46')]=qs['filters'](_[_0x7c28('0x47')](_0x36f628[_0x7c28('0x3f')],_0xceaafb[_0x7c28('0x3c')]));if(_0x36f628['query'][_0x7c28('0x4a')]){_0x50bd70[_0x7c28('0x46')]=_[_0x7c28('0x48')](_0x50bd70[_0x7c28('0x46')],{'$or':_[_0x7c28('0x37')](_0x50bd70[_0x7c28('0x40')],function(_0x548ccd){var _0x16d784={};_0x16d784[_0x548ccd]={'$like':'%'+_0x36f628[_0x7c28('0x3f')][_0x7c28('0x4a')]+'%'};return _0x16d784;})});}_0x50bd70=_[_0x7c28('0x48')]({},_0x50bd70,_0x36f628[_0x7c28('0x4b')]);return _0x447943[_0x7c28('0x5a')](_0x50bd70);}})['then'](function(_0x1295a9){if(_0x1295a9){_0x33d6b2=_0x1295a9['length'];if(!_0x36f628[_0x7c28('0x3f')][_0x7c28('0x57')](_0x7c28('0x43'))){_0x50bd70[_0x7c28('0x2c')]=qs['limit'](_0x36f628[_0x7c28('0x3f')][_0x7c28('0x2c')]);_0x50bd70[_0x7c28('0x2b')]=qs[_0x7c28('0x2b')](_0x36f628['query'][_0x7c28('0x2b')]);}return _0x447943['getDescriptions'](_0x50bd70);}})[_0x7c28('0x1d')](function(_0x3bbaf7){if(_0x3bbaf7){return _0x3bbaf7?{'count':_0x33d6b2,'rows':_0x3bbaf7}:null;}})['then'](respondWithResult(_0x37951f,null))[_0x7c28('0x27')](handleError(_0x37951f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 3ad400d..09c3e44 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 _0x7a95=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0x7a95,0xe4));var _0x57a9=function(_0x250761,_0x1d62e8){_0x250761=_0x250761-0x0;var _0xe99a=_0x7a95[_0x250761];return _0xe99a;};'use strict';var _=require(_0x57a9('0x0'));var util=require('util');var logger=require(_0x57a9('0x1'))(_0x57a9('0x2'));var moment=require(_0x57a9('0x3'));var BPromise=require(_0x57a9('0x4'));var rp=require(_0x57a9('0x5'));var fs=require('fs');var path=require(_0x57a9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x57a9('0x7'));module[_0x57a9('0x8')]=function(_0x6014b3,_0x51bbe7){return _0x6014b3[_0x57a9('0x9')](_0x57a9('0xa'),attributes,{'tableName':_0x57a9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7294=['bluebird','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x375efe,_0x27df2d){var _0x1d5db6=function(_0x43e15d){while(--_0x43e15d){_0x375efe['push'](_0x375efe['shift']());}};_0x1d5db6(++_0x27df2d);}(_0x7294,0x157));var _0x4729=function(_0x1ad6bf,_0x5c3b39){_0x1ad6bf=_0x1ad6bf-0x0;var _0x2ac4e9=_0x7294[_0x1ad6bf];return _0x2ac4e9;};'use strict';var _=require(_0x4729('0x0'));var util=require(_0x4729('0x1'));var logger=require(_0x4729('0x2'))(_0x4729('0x3'));var moment=require(_0x4729('0x4'));var BPromise=require(_0x4729('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4729('0x6'));var rimraf=require(_0x4729('0x7'));var config=require(_0x4729('0x8'));var attributes=require(_0x4729('0x9'));module['exports']=function(_0x57392c,_0xa7a0c8){return _0x57392c['define'](_0x4729('0xa'),attributes,{'tableName':_0x4729('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index b9be169..f2b98c1 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 _0x4e67=['jayson/promise','http','then','ServicenowConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x6f4e71,_0xd05812){var _0x1f2139=function(_0x10f09b){while(--_0x10f09b){_0x6f4e71['push'](_0x6f4e71['shift']());}};_0x1f2139(++_0xd05812);}(_0x4e67,0x12a));var _0x74e6=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0x4e67[_0x4e170e];return _0x338291;};'use strict';var _=require(_0x74e6('0x0'));var util=require(_0x74e6('0x1'));var moment=require(_0x74e6('0x2'));var BPromise=require(_0x74e6('0x3'));var rs=require(_0x74e6('0x4'));var fs=require('fs');var Redis=require(_0x74e6('0x5'));var db=require(_0x74e6('0x6'))['db'];var utils=require(_0x74e6('0x7'));var logger=require('../../config/logger')(_0x74e6('0x8'));var config=require(_0x74e6('0x9'));var jayson=require(_0x74e6('0xa'));var client=jayson['client'][_0x74e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x775c99,_0x4274dd,_0x4b0447){return new BPromise(function(_0x1accc3,_0x2ef975){return client['request'](_0x775c99,_0x4b0447)[_0x74e6('0xc')](function(_0x136fb3){logger['info'](_0x74e6('0xd'),_0x4274dd,'request\x20sent');logger[_0x74e6('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x4274dd,'request\x20sent',JSON[_0x74e6('0xf')](_0x136fb3));if(_0x136fb3[_0x74e6('0x10')]){if(_0x136fb3[_0x74e6('0x10')][_0x74e6('0x11')]===0x1f4){logger['error'](_0x74e6('0xd'),_0x4274dd,_0x136fb3['error']['message']);return _0x2ef975(_0x136fb3['error'][_0x74e6('0x12')]);}logger[_0x74e6('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4274dd,_0x136fb3[_0x74e6('0x10')][_0x74e6('0x12')]);return _0x1accc3(_0x136fb3['error'][_0x74e6('0x12')]);}else{logger['info'](_0x74e6('0xd'),_0x4274dd,_0x74e6('0x13'));_0x1accc3(_0x136fb3[_0x74e6('0x14')][_0x74e6('0x12')]);}})[_0x74e6('0x15')](function(_0x3783d1){logger['error'](_0x74e6('0xd'),_0x4274dd,_0x3783d1);_0x2ef975(_0x3783d1);});});} \ No newline at end of file +var _0xeebd=['then','info','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http'];(function(_0x492451,_0x3771c3){var _0x1984e9=function(_0x8b7510){while(--_0x8b7510){_0x492451['push'](_0x492451['shift']());}};_0x1984e9(++_0x3771c3);}(_0xeebd,0x119));var _0xdeeb=function(_0x197c48,_0x46b30f){_0x197c48=_0x197c48-0x0;var _0x536305=_0xeebd[_0x197c48];return _0x536305;};'use strict';var _=require('lodash');var util=require(_0xdeeb('0x0'));var moment=require('moment');var BPromise=require(_0xdeeb('0x1'));var rs=require(_0xdeeb('0x2'));var fs=require('fs');var Redis=require(_0xdeeb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdeeb('0x4'));var logger=require('../../config/logger')(_0xdeeb('0x5'));var config=require(_0xdeeb('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdeeb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x459271,_0x43e48b,_0x3ff94c){return new BPromise(function(_0x599f8a,_0x434093){return client['request'](_0x459271,_0x3ff94c)[_0xdeeb('0x8')](function(_0x14b11b){logger[_0xdeeb('0x9')]('ServicenowConfiguration,\x20%s,\x20%s',_0x43e48b,_0xdeeb('0xa'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x43e48b,_0xdeeb('0xa'),JSON[_0xdeeb('0xb')](_0x14b11b));if(_0x14b11b[_0xdeeb('0xc')]){if(_0x14b11b[_0xdeeb('0xc')][_0xdeeb('0xd')]===0x1f4){logger['error'](_0xdeeb('0xe'),_0x43e48b,_0x14b11b[_0xdeeb('0xc')]['message']);return _0x434093(_0x14b11b[_0xdeeb('0xc')][_0xdeeb('0xf')]);}logger[_0xdeeb('0xc')](_0xdeeb('0xe'),_0x43e48b,_0x14b11b[_0xdeeb('0xc')][_0xdeeb('0xf')]);return _0x599f8a(_0x14b11b['error'][_0xdeeb('0xf')]);}else{logger[_0xdeeb('0x9')](_0xdeeb('0xe'),_0x43e48b,_0xdeeb('0xa'));_0x599f8a(_0x14b11b[_0xdeeb('0x10')][_0xdeeb('0xf')]);}})['catch'](function(_0x590180){logger['error'](_0xdeeb('0xe'),_0x43e48b,_0x590180);_0x434093(_0x590180);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 34d5ad0..2ebfe96 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 _0x855b=['../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','isAuthenticated','get','/:id','create','put','update','delete','multer','util','connect-timeout','Router'];(function(_0x2f8a7c,_0x3f65fd){var _0x257e01=function(_0x412826){while(--_0x412826){_0x2f8a7c['push'](_0x2f8a7c['shift']());}};_0x257e01(++_0x3f65fd);}(_0x855b,0x1e6));var _0xb855=function(_0xc2ac2f,_0x5856c7){_0xc2ac2f=_0xc2ac2f-0x0;var _0x4a4fe7=_0x855b[_0xc2ac2f];return _0x4a4fe7;};'use strict';var multer=require(_0xb855('0x0'));var util=require(_0xb855('0x1'));var path=require('path');var timeout=require(_0xb855('0x2'));var express=require('express');var router=express[_0xb855('0x3')]();var auth=require(_0xb855('0x4'));var interaction=require(_0xb855('0x5'));var config=require('../../config/environment');var controller=require(_0xb855('0x6'));router['get']('/',auth[_0xb855('0x7')](),controller['index']);router[_0xb855('0x8')](_0xb855('0x9'),auth[_0xb855('0x7')](),controller['show']);router['post']('/',auth[_0xb855('0x7')](),controller[_0xb855('0xa')]);router[_0xb855('0xb')](_0xb855('0x9'),auth[_0xb855('0x7')](),controller[_0xb855('0xc')]);router[_0xb855('0xd')](_0xb855('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3529=['destroy','exports','util','path','Router','../../components/interaction/service','../../config/environment','./intServicenowField.controller','index','/:id','isAuthenticated','show','post','create','update','delete'];(function(_0x2e509c,_0x64456e){var _0x4f06b9=function(_0x58b173){while(--_0x58b173){_0x2e509c['push'](_0x2e509c['shift']());}};_0x4f06b9(++_0x64456e);}(_0x3529,0xf2));var _0x9352=function(_0x4e11e7,_0x42d0b6){_0x4e11e7=_0x4e11e7-0x0;var _0x1d7d39=_0x3529[_0x4e11e7];return _0x1d7d39;};'use strict';var multer=require('multer');var util=require(_0x9352('0x0'));var path=require(_0x9352('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9352('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x9352('0x3'));var config=require(_0x9352('0x4'));var controller=require(_0x9352('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x9352('0x6')]);router['get'](_0x9352('0x7'),auth[_0x9352('0x8')](),controller[_0x9352('0x9')]);router[_0x9352('0xa')]('/',auth[_0x9352('0x8')](),controller[_0x9352('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9352('0xc')]);router[_0x9352('0xd')](_0x9352('0x7'),auth[_0x9352('0x8')](),controller[_0x9352('0xe')]);module[_0x9352('0xf')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 727f7cc..a0ffa45 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 _0xbeec=['STRING','customVariable','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x18178d,_0x30ec55){var _0x516304=function(_0x3f8f53){while(--_0x3f8f53){_0x18178d['push'](_0x18178d['shift']());}};_0x516304(++_0x30ec55);}(_0xbeec,0xb2));var _0xcbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeec[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xcbee('0x0'));module[_0xcbee('0x1')]={'type':{'type':Sequelize[_0xcbee('0x2')](_0xcbee('0x3'),_0xcbee('0x4'),'customVariable',_0xcbee('0x5')),'defaultValue':_0xcbee('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xcbee('0x6')]},'keyType':{'type':Sequelize[_0xcbee('0x2')](_0xcbee('0x3'),_0xcbee('0x4'),_0xcbee('0x7'))},'keyContent':{'type':Sequelize[_0xcbee('0x6')]},'idField':{'type':Sequelize[_0xcbee('0x6')]},'nameField':{'type':Sequelize[_0xcbee('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcbee('0x6')]}}; \ No newline at end of file +var _0x7662=['string','STRING','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x5e4f24,_0x523774){var _0x14c7b8=function(_0xeaaed2){while(--_0xeaaed2){_0x5e4f24['push'](_0x5e4f24['shift']());}};_0x14c7b8(++_0x523774);}(_0x7662,0xd2));var _0x2766=function(_0x226a2c,_0x301754){_0x226a2c=_0x226a2c-0x0;var _0x7e8247=_0x7662[_0x226a2c];return _0x7e8247;};'use strict';var Sequelize=require(_0x2766('0x0'));module[_0x2766('0x1')]={'type':{'type':Sequelize[_0x2766('0x2')]('string',_0x2766('0x3'),_0x2766('0x4'),_0x2766('0x5')),'defaultValue':_0x2766('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2766('0x7')]},'keyType':{'type':Sequelize[_0x2766('0x2')](_0x2766('0x6'),_0x2766('0x3'),_0x2766('0x4'))},'keyContent':{'type':Sequelize[_0x2766('0x7')]},'idField':{'type':Sequelize[_0x2766('0x7')]},'nameField':{'type':Sequelize[_0x2766('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2766('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 8d0aaa4..97b17f4 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 _0xc882=['map','ServicenowField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index'];(function(_0x4f4065,_0x5c2525){var _0x18b023=function(_0x1f654a){while(--_0x1f654a){_0x4f4065['push'](_0x4f4065['shift']());}};_0x18b023(++_0x5c2525);}(_0xc882,0xff));var _0x2c88=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc882[_0x432682];return _0x463d05;};'use strict';var pdf=require(_0x2c88('0x0'));var emlformat=require(_0x2c88('0x1'));var rimraf=require(_0x2c88('0x2'));var zipdir=require(_0x2c88('0x3'));var jsonpatch=require(_0x2c88('0x4'));var rp=require(_0x2c88('0x5'));var moment=require(_0x2c88('0x6'));var BPromise=require(_0x2c88('0x7'));var Mustache=require(_0x2c88('0x8'));var util=require(_0x2c88('0x9'));var path=require(_0x2c88('0xa'));var sox=require(_0x2c88('0xb'));var csv=require(_0x2c88('0xc'));var ejs=require(_0x2c88('0xd'));var fs=require('fs');var _=require(_0x2c88('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2c88('0xf'));var toCsv=require(_0x2c88('0xc'));var querystring=require('querystring');var Papa=require(_0x2c88('0x10'));var Redis=require(_0x2c88('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2c88('0x12'));var as=require(_0x2c88('0x13'));var hardwareService=require(_0x2c88('0x14'));var logger=require('../../config/logger')(_0x2c88('0x15'));var utils=require(_0x2c88('0x16'));var config=require('../../config/environment');var db=require(_0x2c88('0x17'))['db'];function respondWithStatusCode(_0x3773d2,_0x525d37){_0x525d37=_0x525d37||0xcc;return function(_0x52d5f4){if(_0x52d5f4){return _0x3773d2[_0x2c88('0x18')](_0x525d37);}return _0x3773d2[_0x2c88('0x19')](_0x525d37)[_0x2c88('0x1a')]();};}function respondWithResult(_0x5e099f,_0x582300){_0x582300=_0x582300||0xc8;return function(_0x3e3729){if(_0x3e3729){return _0x5e099f['status'](_0x582300)[_0x2c88('0x1b')](_0x3e3729);}};}function respondWithFilteredResult(_0x10649a,_0x735a72){return function(_0x45a679){if(_0x45a679){var _0x3fb359=_0x45a679[_0x2c88('0x1c')],_0xa3f02=_0x735a72['offset'],_0x5039d8=_0x735a72['offset']+_0x735a72[_0x2c88('0x1d')],_0x4e13dc;if(_0x5039d8>=_0x3fb359){_0x5039d8=_0x3fb359;_0x4e13dc=0xc8;}else{_0x4e13dc=0xce;}_0x10649a[_0x2c88('0x19')](_0x4e13dc);return _0x10649a[_0x2c88('0x1e')](_0x2c88('0x1f'),_0xa3f02+'-'+_0x5039d8+'/'+_0x3fb359)[_0x2c88('0x1b')](_0x45a679);}return null;};}function patchUpdates(_0x26a9b5){return function(_0x4a81e5){try{jsonpatch[_0x2c88('0x20')](_0x4a81e5,_0x26a9b5,!![]);}catch(_0x1ca00f){return BPromise[_0x2c88('0x21')](_0x1ca00f);}return _0x4a81e5[_0x2c88('0x22')]();};}function saveUpdates(_0x4f5374,_0x1b0260){return function(_0x414084){if(_0x414084){return _0x414084[_0x2c88('0x23')](_0x4f5374)[_0x2c88('0x24')](function(_0x57c057){return _0x57c057;});}return null;};}function removeEntity(_0x33a7e5,_0x5743a5){return function(_0x14449b){if(_0x14449b){return _0x14449b['destroy']()[_0x2c88('0x24')](function(){_0x33a7e5[_0x2c88('0x19')](0xcc)[_0x2c88('0x1a')]();});}};}function handleEntityNotFound(_0x459cbf,_0x876878){return function(_0x5f3921){if(!_0x5f3921){_0x459cbf['sendStatus'](0x194);}return _0x5f3921;};}function handleError(_0x43010f,_0x36df18){_0x36df18=_0x36df18||0x1f4;return function(_0x4bae29){logger['error'](_0x4bae29[_0x2c88('0x25')]);if(_0x4bae29[_0x2c88('0x26')]){delete _0x4bae29[_0x2c88('0x26')];}_0x43010f[_0x2c88('0x19')](_0x36df18)[_0x2c88('0x27')](_0x4bae29);};}exports[_0x2c88('0x28')]=function(_0x333eef,_0x34c8e2){var _0x3dc812={},_0x49a144={},_0x4962bb={'count':0x0,'rows':[]};var _0x5d2a2a=_[_0x2c88('0x29')](db[_0x2c88('0x2a')][_0x2c88('0x2b')],function(_0x51ed0b){return{'name':_0x51ed0b[_0x2c88('0x2c')],'type':_0x51ed0b[_0x2c88('0x2d')][_0x2c88('0x2e')]};});_0x49a144[_0x2c88('0x2f')]=_[_0x2c88('0x29')](_0x5d2a2a,'name');_0x49a144['query']=_['keys'](_0x333eef[_0x2c88('0x30')]);_0x49a144[_0x2c88('0x31')]=_[_0x2c88('0x32')](_0x49a144[_0x2c88('0x2f')],_0x49a144[_0x2c88('0x30')]);_0x3dc812[_0x2c88('0x33')]=_[_0x2c88('0x32')](_0x49a144[_0x2c88('0x2f')],qs[_0x2c88('0x34')](_0x333eef[_0x2c88('0x30')][_0x2c88('0x34')]));_0x3dc812['attributes']=_0x3dc812['attributes']['length']?_0x3dc812[_0x2c88('0x33')]:_0x49a144['model'];if(!_0x333eef['query'][_0x2c88('0x35')](_0x2c88('0x36'))){_0x3dc812[_0x2c88('0x1d')]=qs[_0x2c88('0x1d')](_0x333eef['query']['limit']);_0x3dc812[_0x2c88('0x37')]=qs['offset'](_0x333eef['query'][_0x2c88('0x37')]);}_0x3dc812[_0x2c88('0x38')]=qs[_0x2c88('0x39')](_0x333eef[_0x2c88('0x30')][_0x2c88('0x39')]);_0x3dc812['where']=qs[_0x2c88('0x31')](_['pick'](_0x333eef['query'],_0x49a144[_0x2c88('0x31')]));if(_0x333eef[_0x2c88('0x30')][_0x2c88('0x3a')]){_0x3dc812[_0x2c88('0x3b')]=_[_0x2c88('0x3c')](_0x3dc812[_0x2c88('0x3b')],{'$or':_[_0x2c88('0x29')](_0x5d2a2a,function(_0x2450ee){if(_0x2450ee[_0x2c88('0x2d')]!=='VIRTUAL'){var _0xfcc297={};_0xfcc297[_0x2450ee[_0x2c88('0x26')]]={'$like':'%'+_0x333eef[_0x2c88('0x30')][_0x2c88('0x3a')]+'%'};return _0xfcc297;}})});}_0x3dc812=_[_0x2c88('0x3c')]({},_0x3dc812,_0x333eef['options']);var _0x5a0d5c={'where':_0x3dc812[_0x2c88('0x3b')]};return db[_0x2c88('0x2a')][_0x2c88('0x1c')](_0x5a0d5c)[_0x2c88('0x24')](function(_0x4cd9a2){_0x4962bb[_0x2c88('0x1c')]=_0x4cd9a2;if(_0x333eef[_0x2c88('0x30')][_0x2c88('0x3d')]){_0x3dc812[_0x2c88('0x3e')]=[{'all':!![]}];}return db[_0x2c88('0x2a')][_0x2c88('0x3f')](_0x3dc812);})[_0x2c88('0x24')](function(_0x2cce78){_0x4962bb[_0x2c88('0x40')]=_0x2cce78;return _0x4962bb;})[_0x2c88('0x24')](respondWithFilteredResult(_0x34c8e2,_0x3dc812))[_0x2c88('0x41')](handleError(_0x34c8e2,null));};exports[_0x2c88('0x42')]=function(_0x32db4a,_0x543932){var _0x429df2={'raw':!![],'where':{'id':_0x32db4a[_0x2c88('0x43')]['id']}},_0x168118={};_0x168118['model']=_[_0x2c88('0x44')](db[_0x2c88('0x2a')][_0x2c88('0x2b')]);_0x168118[_0x2c88('0x30')]=_[_0x2c88('0x44')](_0x32db4a[_0x2c88('0x30')]);_0x168118[_0x2c88('0x31')]=_['intersection'](_0x168118[_0x2c88('0x2f')],_0x168118[_0x2c88('0x30')]);_0x429df2['attributes']=_['intersection'](_0x168118[_0x2c88('0x2f')],qs[_0x2c88('0x34')](_0x32db4a['query'][_0x2c88('0x34')]));_0x429df2[_0x2c88('0x33')]=_0x429df2['attributes']['length']?_0x429df2[_0x2c88('0x33')]:_0x168118[_0x2c88('0x2f')];if(_0x32db4a[_0x2c88('0x30')]['includeAll']){_0x429df2[_0x2c88('0x3e')]=[{'all':!![]}];}_0x429df2=_['merge']({},_0x429df2,_0x32db4a[_0x2c88('0x45')]);return db[_0x2c88('0x2a')][_0x2c88('0x46')](_0x429df2)[_0x2c88('0x24')](handleEntityNotFound(_0x543932,null))['then'](respondWithResult(_0x543932,null))[_0x2c88('0x41')](handleError(_0x543932,null));};exports[_0x2c88('0x47')]=function(_0xdc614b,_0x452f77){return db[_0x2c88('0x2a')][_0x2c88('0x47')](_0xdc614b[_0x2c88('0x48')],{})[_0x2c88('0x24')](respondWithResult(_0x452f77,0xc9))[_0x2c88('0x41')](handleError(_0x452f77,null));};exports[_0x2c88('0x23')]=function(_0x20dd2b,_0x368305){if(_0x20dd2b[_0x2c88('0x48')]['id']){delete _0x20dd2b[_0x2c88('0x48')]['id'];}return db[_0x2c88('0x2a')][_0x2c88('0x46')]({'where':{'id':_0x20dd2b[_0x2c88('0x43')]['id']}})['then'](handleEntityNotFound(_0x368305,null))[_0x2c88('0x24')](saveUpdates(_0x20dd2b[_0x2c88('0x48')],null))['then'](respondWithResult(_0x368305,null))[_0x2c88('0x41')](handleError(_0x368305,null));};exports[_0x2c88('0x49')]=function(_0x20655e,_0x3648e4){return db['ServicenowField'][_0x2c88('0x46')]({'where':{'id':_0x20655e[_0x2c88('0x43')]['id']}})[_0x2c88('0x24')](handleEntityNotFound(_0x3648e4,null))[_0x2c88('0x24')](removeEntity(_0x3648e4,null))[_0x2c88('0x41')](handleError(_0x3648e4,null));}; \ No newline at end of file +var _0xbb96=['pick','filter','merge','type','VIRTUAL','name','includeAll','include','findAll','catch','show','params','options','find','create','body','update','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','send','index','map','ServicenowField','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb96,0xf2));var _0x6bb9=function(_0x380016,_0x178dd6){_0x380016=_0x380016-0x0;var _0x5c7ac0=_0xbb96[_0x380016];return _0x5c7ac0;};'use strict';var pdf=require(_0x6bb9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6bb9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6bb9('0x2'));var rp=require(_0x6bb9('0x3'));var moment=require(_0x6bb9('0x4'));var BPromise=require(_0x6bb9('0x5'));var Mustache=require(_0x6bb9('0x6'));var util=require(_0x6bb9('0x7'));var path=require(_0x6bb9('0x8'));var sox=require(_0x6bb9('0x9'));var csv=require(_0x6bb9('0xa'));var ejs=require(_0x6bb9('0xb'));var fs=require('fs');var _=require(_0x6bb9('0xc'));var squel=require(_0x6bb9('0xd'));var crypto=require(_0x6bb9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6bb9('0xf'));var toCsv=require(_0x6bb9('0xa'));var querystring=require(_0x6bb9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6bb9('0x11'));var qs=require(_0x6bb9('0x12'));var as=require(_0x6bb9('0x13'));var hardwareService=require(_0x6bb9('0x14'));var logger=require('../../config/logger')(_0x6bb9('0x15'));var utils=require(_0x6bb9('0x16'));var config=require(_0x6bb9('0x17'));var db=require(_0x6bb9('0x18'))['db'];function respondWithStatusCode(_0x26b70f,_0x10e43f){_0x10e43f=_0x10e43f||0xcc;return function(_0x4ddbc2){if(_0x4ddbc2){return _0x26b70f[_0x6bb9('0x19')](_0x10e43f);}return _0x26b70f[_0x6bb9('0x1a')](_0x10e43f)[_0x6bb9('0x1b')]();};}function respondWithResult(_0x43ee74,_0x32f472){_0x32f472=_0x32f472||0xc8;return function(_0x589a35){if(_0x589a35){return _0x43ee74[_0x6bb9('0x1a')](_0x32f472)['json'](_0x589a35);}};}function respondWithFilteredResult(_0x9f0a31,_0x1ca6f8){return function(_0x47f364){if(_0x47f364){var _0x2a04e8=_0x47f364[_0x6bb9('0x1c')],_0x5f094c=_0x1ca6f8[_0x6bb9('0x1d')],_0x51d252=_0x1ca6f8[_0x6bb9('0x1d')]+_0x1ca6f8[_0x6bb9('0x1e')],_0x3d1f57;if(_0x51d252>=_0x2a04e8){_0x51d252=_0x2a04e8;_0x3d1f57=0xc8;}else{_0x3d1f57=0xce;}_0x9f0a31[_0x6bb9('0x1a')](_0x3d1f57);return _0x9f0a31[_0x6bb9('0x1f')](_0x6bb9('0x20'),_0x5f094c+'-'+_0x51d252+'/'+_0x2a04e8)['json'](_0x47f364);}return null;};}function patchUpdates(_0x1e5dbf){return function(_0x3386d5){try{jsonpatch[_0x6bb9('0x21')](_0x3386d5,_0x1e5dbf,!![]);}catch(_0x22b1f0){return BPromise[_0x6bb9('0x22')](_0x22b1f0);}return _0x3386d5[_0x6bb9('0x23')]();};}function saveUpdates(_0x3b67bd,_0x4fd66d){return function(_0x241073){if(_0x241073){return _0x241073['update'](_0x3b67bd)[_0x6bb9('0x24')](function(_0x4543b2){return _0x4543b2;});}return null;};}function removeEntity(_0x548736,_0x1a6555){return function(_0x4ddf1d){if(_0x4ddf1d){return _0x4ddf1d[_0x6bb9('0x25')]()[_0x6bb9('0x24')](function(){_0x548736[_0x6bb9('0x1a')](0xcc)[_0x6bb9('0x1b')]();});}};}function handleEntityNotFound(_0x431001,_0xe9cd26){return function(_0x2540cd){if(!_0x2540cd){_0x431001[_0x6bb9('0x19')](0x194);}return _0x2540cd;};}function handleError(_0x4468d7,_0x2fc901){_0x2fc901=_0x2fc901||0x1f4;return function(_0x37b971){logger[_0x6bb9('0x26')](_0x37b971['stack']);if(_0x37b971['name']){delete _0x37b971['name'];}_0x4468d7[_0x6bb9('0x1a')](_0x2fc901)[_0x6bb9('0x27')](_0x37b971);};}exports[_0x6bb9('0x28')]=function(_0x133071,_0x4fcb9e){var _0x2e047e={},_0x1763c1={},_0x5820b3={'count':0x0,'rows':[]};var _0x518730=_[_0x6bb9('0x29')](db[_0x6bb9('0x2a')][_0x6bb9('0x2b')],function(_0xc44865){return{'name':_0xc44865['fieldName'],'type':_0xc44865['type'][_0x6bb9('0x2c')]};});_0x1763c1[_0x6bb9('0x2d')]=_['map'](_0x518730,'name');_0x1763c1[_0x6bb9('0x2e')]=_[_0x6bb9('0x2f')](_0x133071[_0x6bb9('0x2e')]);_0x1763c1['filters']=_[_0x6bb9('0x30')](_0x1763c1[_0x6bb9('0x2d')],_0x1763c1[_0x6bb9('0x2e')]);_0x2e047e[_0x6bb9('0x31')]=_[_0x6bb9('0x30')](_0x1763c1[_0x6bb9('0x2d')],qs[_0x6bb9('0x32')](_0x133071[_0x6bb9('0x2e')][_0x6bb9('0x32')]));_0x2e047e[_0x6bb9('0x31')]=_0x2e047e[_0x6bb9('0x31')][_0x6bb9('0x33')]?_0x2e047e['attributes']:_0x1763c1[_0x6bb9('0x2d')];if(!_0x133071['query'][_0x6bb9('0x34')](_0x6bb9('0x35'))){_0x2e047e[_0x6bb9('0x1e')]=qs[_0x6bb9('0x1e')](_0x133071[_0x6bb9('0x2e')]['limit']);_0x2e047e[_0x6bb9('0x1d')]=qs[_0x6bb9('0x1d')](_0x133071[_0x6bb9('0x2e')][_0x6bb9('0x1d')]);}_0x2e047e[_0x6bb9('0x36')]=qs[_0x6bb9('0x37')](_0x133071[_0x6bb9('0x2e')][_0x6bb9('0x37')]);_0x2e047e[_0x6bb9('0x38')]=qs[_0x6bb9('0x39')](_[_0x6bb9('0x3a')](_0x133071[_0x6bb9('0x2e')],_0x1763c1[_0x6bb9('0x39')]));if(_0x133071[_0x6bb9('0x2e')][_0x6bb9('0x3b')]){_0x2e047e[_0x6bb9('0x38')]=_[_0x6bb9('0x3c')](_0x2e047e[_0x6bb9('0x38')],{'$or':_['map'](_0x518730,function(_0x555aac){if(_0x555aac[_0x6bb9('0x3d')]!==_0x6bb9('0x3e')){var _0x42bd31={};_0x42bd31[_0x555aac[_0x6bb9('0x3f')]]={'$like':'%'+_0x133071['query']['filter']+'%'};return _0x42bd31;}})});}_0x2e047e=_['merge']({},_0x2e047e,_0x133071['options']);var _0xca0aa={'where':_0x2e047e[_0x6bb9('0x38')]};return db[_0x6bb9('0x2a')][_0x6bb9('0x1c')](_0xca0aa)['then'](function(_0x3b1dea){_0x5820b3[_0x6bb9('0x1c')]=_0x3b1dea;if(_0x133071[_0x6bb9('0x2e')][_0x6bb9('0x40')]){_0x2e047e[_0x6bb9('0x41')]=[{'all':!![]}];}return db['ServicenowField'][_0x6bb9('0x42')](_0x2e047e);})['then'](function(_0x4b0253){_0x5820b3['rows']=_0x4b0253;return _0x5820b3;})[_0x6bb9('0x24')](respondWithFilteredResult(_0x4fcb9e,_0x2e047e))[_0x6bb9('0x43')](handleError(_0x4fcb9e,null));};exports[_0x6bb9('0x44')]=function(_0xa5b09e,_0x1620e8){var _0x1096fc={'raw':!![],'where':{'id':_0xa5b09e[_0x6bb9('0x45')]['id']}},_0x480fa1={};_0x480fa1[_0x6bb9('0x2d')]=_[_0x6bb9('0x2f')](db[_0x6bb9('0x2a')][_0x6bb9('0x2b')]);_0x480fa1[_0x6bb9('0x2e')]=_[_0x6bb9('0x2f')](_0xa5b09e['query']);_0x480fa1[_0x6bb9('0x39')]=_[_0x6bb9('0x30')](_0x480fa1[_0x6bb9('0x2d')],_0x480fa1[_0x6bb9('0x2e')]);_0x1096fc[_0x6bb9('0x31')]=_[_0x6bb9('0x30')](_0x480fa1[_0x6bb9('0x2d')],qs[_0x6bb9('0x32')](_0xa5b09e[_0x6bb9('0x2e')][_0x6bb9('0x32')]));_0x1096fc[_0x6bb9('0x31')]=_0x1096fc[_0x6bb9('0x31')][_0x6bb9('0x33')]?_0x1096fc[_0x6bb9('0x31')]:_0x480fa1['model'];if(_0xa5b09e['query'][_0x6bb9('0x40')]){_0x1096fc['include']=[{'all':!![]}];}_0x1096fc=_[_0x6bb9('0x3c')]({},_0x1096fc,_0xa5b09e[_0x6bb9('0x46')]);return db[_0x6bb9('0x2a')][_0x6bb9('0x47')](_0x1096fc)[_0x6bb9('0x24')](handleEntityNotFound(_0x1620e8,null))[_0x6bb9('0x24')](respondWithResult(_0x1620e8,null))[_0x6bb9('0x43')](handleError(_0x1620e8,null));};exports[_0x6bb9('0x48')]=function(_0x3ea763,_0x2e9d4a){return db['ServicenowField']['create'](_0x3ea763[_0x6bb9('0x49')],{})[_0x6bb9('0x24')](respondWithResult(_0x2e9d4a,0xc9))[_0x6bb9('0x43')](handleError(_0x2e9d4a,null));};exports[_0x6bb9('0x4a')]=function(_0x13a299,_0x1d59ed){if(_0x13a299[_0x6bb9('0x49')]['id']){delete _0x13a299['body']['id'];}return db[_0x6bb9('0x2a')]['find']({'where':{'id':_0x13a299['params']['id']}})[_0x6bb9('0x24')](handleEntityNotFound(_0x1d59ed,null))['then'](saveUpdates(_0x13a299['body'],null))[_0x6bb9('0x24')](respondWithResult(_0x1d59ed,null))[_0x6bb9('0x43')](handleError(_0x1d59ed,null));};exports[_0x6bb9('0x25')]=function(_0x12f0ad,_0x299464){return db[_0x6bb9('0x2a')][_0x6bb9('0x47')]({'where':{'id':_0x12f0ad[_0x6bb9('0x45')]['id']}})[_0x6bb9('0x24')](handleEntityNotFound(_0x299464,null))[_0x6bb9('0x24')](removeEntity(_0x299464,null))[_0x6bb9('0x43')](handleError(_0x299464,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 6dd2af0..4944fab 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 _0xae19=['../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xae19,0xa3));var _0x9ae1=function(_0x1f6e71,_0x19360b){_0x1f6e71=_0x1f6e71-0x0;var _0x2271aa=_0xae19[_0x1f6e71];return _0x2271aa;};'use strict';var _=require(_0x9ae1('0x0'));var util=require(_0x9ae1('0x1'));var logger=require(_0x9ae1('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9ae1('0x3'));var rp=require(_0x9ae1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ae1('0x5'));var config=require(_0x9ae1('0x6'));var attributes=require(_0x9ae1('0x7'));module[_0x9ae1('0x8')]=function(_0x3d2caf,_0x2b9bd0){return _0x3d2caf[_0x9ae1('0x9')](_0x9ae1('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x9ae1('0xb'),'fields':[_0x9ae1('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5aa1=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','api','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField'];(function(_0x51666b,_0x48e537){var _0x1858fa=function(_0x578ff0){while(--_0x578ff0){_0x51666b['push'](_0x51666b['shift']());}};_0x1858fa(++_0x48e537);}(_0x5aa1,0x12a));var _0x15aa=function(_0x4a7263,_0x33f427){_0x4a7263=_0x4a7263-0x0;var _0x53b910=_0x5aa1[_0x4a7263];return _0x53b910;};'use strict';var _=require(_0x15aa('0x0'));var util=require(_0x15aa('0x1'));var logger=require('../../config/logger')(_0x15aa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x15aa('0x3'));var fs=require('fs');var path=require(_0x15aa('0x4'));var rimraf=require(_0x15aa('0x5'));var config=require(_0x15aa('0x6'));var attributes=require(_0x15aa('0x7'));module[_0x15aa('0x8')]=function(_0x47a568,_0x353c21){return _0x47a568['define'](_0x15aa('0x9'),attributes,{'tableName':_0x15aa('0xa'),'paranoid':![],'indexes':[{'name':_0x15aa('0xb'),'fields':[_0x15aa('0xc'),_0x15aa('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 462a3ac..c7e37d5 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 _0xf23b=['../../config/environment','jayson/promise','client','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4397e1,_0x299dc3){var _0x5e6624=function(_0x146d68){while(--_0x146d68){_0x4397e1['push'](_0x4397e1['shift']());}};_0x5e6624(++_0x299dc3);}(_0xf23b,0x109));var _0xbf23=function(_0x21eb83,_0x573048){_0x21eb83=_0x21eb83-0x0;var _0x3fb42b=_0xf23b[_0x21eb83];return _0x3fb42b;};'use strict';var _=require('lodash');var util=require(_0xbf23('0x0'));var moment=require(_0xbf23('0x1'));var BPromise=require(_0xbf23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf23('0x3'));var db=require(_0xbf23('0x4'))['db'];var utils=require(_0xbf23('0x5'));var logger=require(_0xbf23('0x6'))(_0xbf23('0x7'));var config=require(_0xbf23('0x8'));var jayson=require(_0xbf23('0x9'));var client=jayson[_0xbf23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1039a9,_0xa8ea35,_0x345e3d){return new BPromise(function(_0x55290c,_0x16c8e7){return client[_0xbf23('0xb')](_0x1039a9,_0x345e3d)['then'](function(_0x16a891){logger[_0xbf23('0xc')](_0xbf23('0xd'),_0xa8ea35,_0xbf23('0xe'));logger[_0xbf23('0xf')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0xa8ea35,_0xbf23('0xe'),JSON[_0xbf23('0x10')](_0x16a891));if(_0x16a891['error']){if(_0x16a891[_0xbf23('0x11')][_0xbf23('0x12')]===0x1f4){logger['error'](_0xbf23('0xd'),_0xa8ea35,_0x16a891['error'][_0xbf23('0x13')]);return _0x16c8e7(_0x16a891['error'][_0xbf23('0x13')]);}logger[_0xbf23('0x11')]('ServicenowField,\x20%s,\x20%s',_0xa8ea35,_0x16a891['error'][_0xbf23('0x13')]);return _0x55290c(_0x16a891[_0xbf23('0x11')][_0xbf23('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0xa8ea35,_0xbf23('0xe'));_0x55290c(_0x16a891['result'][_0xbf23('0x13')]);}})[_0xbf23('0x14')](function(_0x4bc391){logger[_0xbf23('0x11')](_0xbf23('0xd'),_0xa8ea35,_0x4bc391);_0x16c8e7(_0x4bc391);});});} \ No newline at end of file +var _0xb262=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xb262,0x1f0));var _0x2b26=function(_0x3556ec,_0x221714){_0x3556ec=_0x3556ec-0x0;var _0x29d72c=_0xb262[_0x3556ec];return _0x29d72c;};'use strict';var _=require(_0x2b26('0x0'));var util=require(_0x2b26('0x1'));var moment=require(_0x2b26('0x2'));var BPromise=require(_0x2b26('0x3'));var rs=require(_0x2b26('0x4'));var fs=require('fs');var Redis=require(_0x2b26('0x5'));var db=require(_0x2b26('0x6'))['db'];var utils=require(_0x2b26('0x7'));var logger=require('../../config/logger')(_0x2b26('0x8'));var config=require(_0x2b26('0x9'));var jayson=require(_0x2b26('0xa'));var client=jayson[_0x2b26('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45d3c1,_0xe5a466,_0x4cc823){return new BPromise(function(_0x58b77e,_0x143c13){return client[_0x2b26('0xc')](_0x45d3c1,_0x4cc823)['then'](function(_0x37d094){logger[_0x2b26('0xd')](_0x2b26('0xe'),_0xe5a466,_0x2b26('0xf'));logger['debug'](_0x2b26('0x10'),_0xe5a466,_0x2b26('0xf'),JSON[_0x2b26('0x11')](_0x37d094));if(_0x37d094[_0x2b26('0x12')]){if(_0x37d094['error']['code']===0x1f4){logger[_0x2b26('0x12')](_0x2b26('0xe'),_0xe5a466,_0x37d094[_0x2b26('0x12')][_0x2b26('0x13')]);return _0x143c13(_0x37d094['error'][_0x2b26('0x13')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0xe5a466,_0x37d094[_0x2b26('0x12')][_0x2b26('0x13')]);return _0x58b77e(_0x37d094['error'][_0x2b26('0x13')]);}else{logger[_0x2b26('0xd')]('ServicenowField,\x20%s,\x20%s',_0xe5a466,_0x2b26('0xf'));_0x58b77e(_0x37d094['result'][_0x2b26('0x13')]);}})['catch'](function(_0x67e7ca){logger['error']('ServicenowField,\x20%s,\x20%s',_0xe5a466,_0x67e7ca);_0x143c13(_0x67e7ca);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 5336de2..aced03a 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 _0x82fa=['addConfiguration','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','create','post'];(function(_0x10346c,_0x183ce6){var _0x262bd4=function(_0x49ac96){while(--_0x49ac96){_0x10346c['push'](_0x10346c['shift']());}};_0x262bd4(++_0x183ce6);}(_0x82fa,0x18d));var _0xa82f=function(_0xfa957d,_0x29b2d3){_0xfa957d=_0xfa957d-0x0;var _0x1224ae=_0x82fa[_0xfa957d];return _0x1224ae;};'use strict';var multer=require(_0xa82f('0x0'));var util=require(_0xa82f('0x1'));var path=require('path');var timeout=require(_0xa82f('0x2'));var express=require(_0xa82f('0x3'));var router=express[_0xa82f('0x4')]();var auth=require(_0xa82f('0x5'));var interaction=require(_0xa82f('0x6'));var config=require(_0xa82f('0x7'));var controller=require(_0xa82f('0x8'));router[_0xa82f('0x9')]('/',auth[_0xa82f('0xa')](),controller[_0xa82f('0xb')]);router[_0xa82f('0x9')]('/:id',auth[_0xa82f('0xa')](),controller[_0xa82f('0xc')]);router['get'](_0xa82f('0xd'),auth[_0xa82f('0xa')](),controller[_0xa82f('0xe')]);router[_0xa82f('0x9')]('/:id/fields',auth[_0xa82f('0xa')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0xa82f('0xf')]);router[_0xa82f('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xa82f('0x11')]);router[_0xa82f('0x12')](_0xa82f('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xa82f('0x14')](_0xa82f('0x13'),auth[_0xa82f('0xa')](),controller[_0xa82f('0x15')]);module[_0xa82f('0x16')]=router; \ No newline at end of file +var _0x86de=['Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','multer','util'];(function(_0x2397e2,_0x589f89){var _0x26a95d=function(_0x2db631){while(--_0x2db631){_0x2397e2['push'](_0x2397e2['shift']());}};_0x26a95d(++_0x589f89);}(_0x86de,0xe2));var _0xe86d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x86de[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe86d('0x0'));var util=require(_0xe86d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe86d('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe86d('0x3'));var config=require('../../config/environment');var controller=require('./intSugarcrmAccount.controller');router[_0xe86d('0x4')]('/',auth[_0xe86d('0x5')](),controller[_0xe86d('0x6')]);router[_0xe86d('0x4')](_0xe86d('0x7'),auth[_0xe86d('0x5')](),controller[_0xe86d('0x8')]);router[_0xe86d('0x4')](_0xe86d('0x9'),auth['isAuthenticated'](),controller[_0xe86d('0xa')]);router[_0xe86d('0x4')](_0xe86d('0xb'),auth[_0xe86d('0x5')](),controller[_0xe86d('0xc')]);router[_0xe86d('0xd')]('/',auth[_0xe86d('0x5')](),controller[_0xe86d('0xe')]);router['post'](_0xe86d('0x9'),auth['isAuthenticated'](),controller[_0xe86d('0xf')]);router[_0xe86d('0x10')](_0xe86d('0x7'),auth[_0xe86d('0x5')](),controller['update']);router[_0xe86d('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe86d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 82a6112..32f99e5 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 _0xefa0=['STRING','username','remoteUri','sequelize','exports'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0xefa0,0xbc));var _0x0efa=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xefa0[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x0efa('0x0'));module[_0x0efa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0efa('0x2')]},'username':{'type':Sequelize[_0x0efa('0x2')],'unique':_0x0efa('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0efa('0x2')],'unique':_0x0efa('0x4')},'serverUrl':{'type':Sequelize[_0x0efa('0x2')]}}; \ No newline at end of file +var _0xfaf3=['remoteUri','STRING','username'];(function(_0x39b2e9,_0x4747c9){var _0x3b4fd8=function(_0x55f522){while(--_0x55f522){_0x39b2e9['push'](_0x39b2e9['shift']());}};_0x3b4fd8(++_0x4747c9);}(_0xfaf3,0x118));var _0x3faf=function(_0x357a70,_0x46c340){_0x357a70=_0x357a70-0x0;var _0x5f57ea=_0xfaf3[_0x357a70];return _0x5f57ea;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3faf('0x0')]},'username':{'type':Sequelize['STRING'],'unique':_0x3faf('0x1')},'password':{'type':Sequelize[_0x3faf('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3faf('0x2')},'serverUrl':{'type':Sequelize[_0x3faf('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 7907189..8889351 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 _0x156b=['info','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','end','status','count','offset','limit','Content-Range','json','reject','update','destroy','sendStatus','stack','name','index','map','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmAccount','include','findAll','rows','show','params','intersection','includeAll','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','rawAttributes','length','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','login','PLAIN','Invalid\x20Login','Password\x20Expired','%s%s','/service/v4_1/rest.php','get_module_fields','JSON','Calls','values','module_fields','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','then'];(function(_0x4d6e69,_0x31f26d){var _0xf26c9f=function(_0x514713){while(--_0x514713){_0x4d6e69['push'](_0x4d6e69['shift']());}};_0xf26c9f(++_0x31f26d);}(_0x156b,0x162));var _0xb156=function(_0x3108d9,_0xf08d6){_0x3108d9=_0x3108d9-0x0;var _0x1455e6=_0x156b[_0x3108d9];return _0x1455e6;};'use strict';var pdf=require(_0xb156('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb156('0x1'));var zipdir=require(_0xb156('0x2'));var jsonpatch=require(_0xb156('0x3'));var rp=require(_0xb156('0x4'));var moment=require(_0xb156('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb156('0x6'));var path=require(_0xb156('0x7'));var sox=require(_0xb156('0x8'));var csv=require(_0xb156('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb156('0xa'));var crypto=require(_0xb156('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb156('0xc'));var toCsv=require(_0xb156('0x9'));var querystring=require(_0xb156('0xd'));var Papa=require('papaparse');var Redis=require(_0xb156('0xe'));var authService=require(_0xb156('0xf'));var qs=require(_0xb156('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb156('0x11'));var logger=require(_0xb156('0x12'))(_0xb156('0x13'));var utils=require(_0xb156('0x14'));var config=require('../../config/environment');var db=require(_0xb156('0x15'))['db'];var integrations=require(_0xb156('0x16'));var jayson=require(_0xb156('0x17'));var client=jayson[_0xb156('0x18')][_0xb156('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3125a0,_0x1fb232,_0x5e31b5){if(_0x5e31b5){var _0x3f6c19=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f6c19[_0xb156('0x1a')](_0x1fb232)){return _0x3125a0;}else{throw new db[(_0xb156('0x1b'))][(_0xb156('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 _0x3125a0;}}function respondWithRpcPromise(_0x35ce5b,_0x44ac01,_0x5532fe,_0x18b833){return new BPromise(function(_0x159d47,_0x30ec27){var _0x4f65aa=_0x18b833||client;return _0x4f65aa['request'](_0x35ce5b,_0x5532fe)[_0xb156('0x1d')](function(_0x1020d8){logger[_0xb156('0x1e')](_0xb156('0x1f'),_0x44ac01,'request\x20sent');logger[_0xb156('0x20')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x44ac01,_0xb156('0x21'),JSON[_0xb156('0x22')](_0x1020d8));if(_0x1020d8[_0xb156('0x23')]){if(_0x1020d8['error']['code']===0x1f4){logger[_0xb156('0x23')](_0xb156('0x1f'),_0x44ac01,_0x1020d8[_0xb156('0x23')]['message']);return _0x30ec27(_0x1020d8[_0xb156('0x23')]['message']);}logger[_0xb156('0x23')](_0xb156('0x1f'),_0x44ac01,_0x1020d8[_0xb156('0x23')][_0xb156('0x24')]);return _0x159d47(_0x1020d8[_0xb156('0x23')][_0xb156('0x24')]);}else{logger[_0xb156('0x1e')](_0xb156('0x1f'),_0x44ac01,_0xb156('0x21'));_0x159d47(_0x1020d8[_0xb156('0x25')][_0xb156('0x24')]);}})[_0xb156('0x26')](function(_0x2efc78){logger[_0xb156('0x23')](_0xb156('0x1f'),_0x44ac01,_0x2efc78);_0x30ec27(_0x2efc78);});});}function respondWithStatusCode(_0xe3bd7a,_0x2007a7){_0x2007a7=_0x2007a7||0xcc;return function(_0x36684f){if(_0x36684f){return _0xe3bd7a['sendStatus'](_0x2007a7);}return _0xe3bd7a['status'](_0x2007a7)[_0xb156('0x27')]();};}function respondWithResult(_0x552f0e,_0x511305){_0x511305=_0x511305||0xc8;return function(_0x5d5d0d){if(_0x5d5d0d){return _0x552f0e[_0xb156('0x28')](_0x511305)['json'](_0x5d5d0d);}};}function respondWithFilteredResult(_0x57ebf8,_0x62e94c){return function(_0x4abe0a){if(_0x4abe0a){var _0x3bc425=_0x4abe0a[_0xb156('0x29')],_0x38ad2c=_0x62e94c[_0xb156('0x2a')],_0x2e9383=_0x62e94c[_0xb156('0x2a')]+_0x62e94c[_0xb156('0x2b')],_0x104c40;if(_0x2e9383>=_0x3bc425){_0x2e9383=_0x3bc425;_0x104c40=0xc8;}else{_0x104c40=0xce;}_0x57ebf8[_0xb156('0x28')](_0x104c40);return _0x57ebf8['set'](_0xb156('0x2c'),_0x38ad2c+'-'+_0x2e9383+'/'+_0x3bc425)[_0xb156('0x2d')](_0x4abe0a);}return null;};}function patchUpdates(_0x1190ce){return function(_0x52c1d6){try{jsonpatch['apply'](_0x52c1d6,_0x1190ce,!![]);}catch(_0x1ca1ca){return BPromise[_0xb156('0x2e')](_0x1ca1ca);}return _0x52c1d6['save']();};}function saveUpdates(_0x491aa5,_0x107f0c){return function(_0x408305){if(_0x408305){return _0x408305[_0xb156('0x2f')](_0x491aa5)[_0xb156('0x1d')](function(_0x43f6a9){return _0x43f6a9;});}return null;};}function removeEntity(_0x5da7ce,_0x1b7c10){return function(_0x30cc58){if(_0x30cc58){return _0x30cc58[_0xb156('0x30')]()[_0xb156('0x1d')](function(){_0x5da7ce[_0xb156('0x28')](0xcc)[_0xb156('0x27')]();});}};}function handleEntityNotFound(_0x19450f,_0x4b2747){return function(_0x38260f){if(!_0x38260f){_0x19450f[_0xb156('0x31')](0x194);}return _0x38260f;};}function handleError(_0x5ce9ae,_0x56fbd6){_0x56fbd6=_0x56fbd6||0x1f4;return function(_0x937814){logger['error'](_0x937814[_0xb156('0x32')]);if(_0x937814[_0xb156('0x33')]){delete _0x937814[_0xb156('0x33')];}_0x5ce9ae[_0xb156('0x28')](_0x56fbd6)['send'](_0x937814);};}exports[_0xb156('0x34')]=function(_0x5eaedb,_0x33ea09){var _0x1c5967={},_0x48a1b2={},_0x1b5e16={'count':0x0,'rows':[]};var _0x58082a=_[_0xb156('0x35')](db['SugarcrmAccount']['rawAttributes'],function(_0x502416){return{'name':_0x502416['fieldName'],'type':_0x502416[_0xb156('0x36')]['key']};});_0x48a1b2[_0xb156('0x37')]=_[_0xb156('0x35')](_0x58082a,_0xb156('0x33'));_0x48a1b2[_0xb156('0x38')]=_[_0xb156('0x39')](_0x5eaedb[_0xb156('0x38')]);_0x48a1b2[_0xb156('0x3a')]=_['intersection'](_0x48a1b2[_0xb156('0x37')],_0x48a1b2['query']);_0x1c5967[_0xb156('0x3b')]=_['intersection'](_0x48a1b2[_0xb156('0x37')],qs['fields'](_0x5eaedb['query'][_0xb156('0x3c')]));_0x1c5967['attributes']=_0x1c5967['attributes']['length']?_0x1c5967[_0xb156('0x3b')]:_0x48a1b2['model'];if(!_0x5eaedb[_0xb156('0x38')][_0xb156('0x3d')](_0xb156('0x3e'))){_0x1c5967[_0xb156('0x2b')]=qs[_0xb156('0x2b')](_0x5eaedb[_0xb156('0x38')][_0xb156('0x2b')]);_0x1c5967['offset']=qs[_0xb156('0x2a')](_0x5eaedb[_0xb156('0x38')][_0xb156('0x2a')]);}_0x1c5967[_0xb156('0x3f')]=qs['sort'](_0x5eaedb['query'][_0xb156('0x40')]);_0x1c5967[_0xb156('0x41')]=qs['filters'](_[_0xb156('0x42')](_0x5eaedb[_0xb156('0x38')],_0x48a1b2[_0xb156('0x3a')]));if(_0x5eaedb[_0xb156('0x38')][_0xb156('0x43')]){_0x1c5967[_0xb156('0x41')]=_[_0xb156('0x44')](_0x1c5967[_0xb156('0x41')],{'$or':_[_0xb156('0x35')](_0x58082a,function(_0x2293bf){if(_0x2293bf['type']!==_0xb156('0x45')){var _0x2cada1={};_0x2cada1[_0x2293bf[_0xb156('0x33')]]={'$like':'%'+_0x5eaedb[_0xb156('0x38')][_0xb156('0x43')]+'%'};return _0x2cada1;}})});}_0x1c5967=_[_0xb156('0x44')]({},_0x1c5967,_0x5eaedb[_0xb156('0x46')]);var _0x3ad4b3={'where':_0x1c5967[_0xb156('0x41')]};return db[_0xb156('0x47')][_0xb156('0x29')](_0x3ad4b3)['then'](function(_0x204db5){_0x1b5e16[_0xb156('0x29')]=_0x204db5;if(_0x5eaedb[_0xb156('0x38')]['includeAll']){_0x1c5967[_0xb156('0x48')]=[{'all':!![]}];}return db[_0xb156('0x47')][_0xb156('0x49')](_0x1c5967);})['then'](function(_0x1bef76){_0x1b5e16[_0xb156('0x4a')]=_0x1bef76;return _0x1b5e16;})[_0xb156('0x1d')](respondWithFilteredResult(_0x33ea09,_0x1c5967))['catch'](handleError(_0x33ea09,null));};exports[_0xb156('0x4b')]=function(_0x2e5c3e,_0x55afdb){var _0xf78de0={'raw':![],'where':{'id':_0x2e5c3e[_0xb156('0x4c')]['id']}},_0x16458f={};_0x16458f[_0xb156('0x37')]=_[_0xb156('0x39')](db[_0xb156('0x47')]['rawAttributes']);_0x16458f[_0xb156('0x38')]=_[_0xb156('0x39')](_0x2e5c3e[_0xb156('0x38')]);_0x16458f[_0xb156('0x3a')]=_['intersection'](_0x16458f['model'],_0x16458f[_0xb156('0x38')]);_0xf78de0[_0xb156('0x3b')]=_[_0xb156('0x4d')](_0x16458f[_0xb156('0x37')],qs[_0xb156('0x3c')](_0x2e5c3e[_0xb156('0x38')][_0xb156('0x3c')]));_0xf78de0[_0xb156('0x3b')]=_0xf78de0['attributes']['length']?_0xf78de0[_0xb156('0x3b')]:_0x16458f[_0xb156('0x37')];if(_0x2e5c3e[_0xb156('0x38')][_0xb156('0x4e')]){_0xf78de0[_0xb156('0x48')]=[{'all':!![]}];}_0xf78de0=_['merge']({},_0xf78de0,_0x2e5c3e['options']);return db['SugarcrmAccount']['find'](_0xf78de0)[_0xb156('0x1d')](handleEntityNotFound(_0x55afdb,null))[_0xb156('0x1d')](respondWithResult(_0x55afdb,null))[_0xb156('0x26')](handleError(_0x55afdb,null));};exports[_0xb156('0x4f')]=function(_0x2b1cfd,_0x3a98ae){return db[_0xb156('0x47')]['create'](_0x2b1cfd[_0xb156('0x50')],{})[_0xb156('0x1d')](respondWithResult(_0x3a98ae,0xc9))[_0xb156('0x26')](handleError(_0x3a98ae,null));};exports[_0xb156('0x2f')]=function(_0x3afac3,_0x4c6dde){if(_0x3afac3[_0xb156('0x50')]['id']){delete _0x3afac3[_0xb156('0x50')]['id'];}return db[_0xb156('0x47')][_0xb156('0x51')]({'where':{'id':_0x3afac3[_0xb156('0x4c')]['id']}})[_0xb156('0x1d')](handleEntityNotFound(_0x4c6dde,null))[_0xb156('0x1d')](saveUpdates(_0x3afac3[_0xb156('0x50')],null))[_0xb156('0x1d')](respondWithResult(_0x4c6dde,null))[_0xb156('0x26')](handleError(_0x4c6dde,null));};exports[_0xb156('0x30')]=function(_0x345880,_0x2e8283){return db[_0xb156('0x47')][_0xb156('0x51')]({'where':{'id':_0x345880[_0xb156('0x4c')]['id']}})[_0xb156('0x1d')](handleEntityNotFound(_0x2e8283,null))[_0xb156('0x1d')](removeEntity(_0x2e8283,null))['catch'](handleError(_0x2e8283,null));};exports[_0xb156('0x52')]=function(_0x1a3c3d,_0x5e11ab,_0xa1af94){var _0xa6ff15={};var _0x32712c={};var _0x2b2e26;var _0x5f4e43;return db[_0xb156('0x47')][_0xb156('0x53')]({'where':{'id':_0x1a3c3d[_0xb156('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5e11ab,null))[_0xb156('0x1d')](function(_0x5e4ad0){if(_0x5e4ad0){_0x2b2e26=_0x5e4ad0;_0x32712c['model']=_[_0xb156('0x39')](db[_0xb156('0x54')][_0xb156('0x55')]);_0x32712c[_0xb156('0x38')]=_[_0xb156('0x39')](_0x1a3c3d[_0xb156('0x38')]);_0x32712c[_0xb156('0x3a')]=_[_0xb156('0x4d')](_0x32712c[_0xb156('0x37')],_0x32712c['query']);_0xa6ff15[_0xb156('0x3b')]=_['intersection'](_0x32712c[_0xb156('0x37')],qs[_0xb156('0x3c')](_0x1a3c3d[_0xb156('0x38')][_0xb156('0x3c')]));_0xa6ff15[_0xb156('0x3b')]=_0xa6ff15[_0xb156('0x3b')][_0xb156('0x56')]?_0xa6ff15[_0xb156('0x3b')]:_0x32712c[_0xb156('0x37')];_0xa6ff15[_0xb156('0x3f')]=qs[_0xb156('0x40')](_0x1a3c3d[_0xb156('0x38')][_0xb156('0x40')]);_0xa6ff15['where']=qs[_0xb156('0x3a')](_[_0xb156('0x42')](_0x1a3c3d['query'],_0x32712c['filters']));if(_0x1a3c3d[_0xb156('0x38')][_0xb156('0x43')]){_0xa6ff15[_0xb156('0x41')]=_['merge'](_0xa6ff15[_0xb156('0x41')],{'$or':_['map'](_0xa6ff15['attributes'],function(_0xb1cc0f){var _0x2be1c7={};_0x2be1c7[_0xb1cc0f]={'$like':'%'+_0x1a3c3d[_0xb156('0x38')][_0xb156('0x43')]+'%'};return _0x2be1c7;})});}_0xa6ff15=_[_0xb156('0x44')]({},_0xa6ff15,_0x1a3c3d[_0xb156('0x46')]);return _0x2b2e26[_0xb156('0x52')](_0xa6ff15);}})[_0xb156('0x1d')](function(_0x163741){if(_0x163741){_0x5f4e43=_0x163741[_0xb156('0x56')];if(!_0x1a3c3d[_0xb156('0x38')][_0xb156('0x3d')](_0xb156('0x3e'))){_0xa6ff15[_0xb156('0x2b')]=qs['limit'](_0x1a3c3d[_0xb156('0x38')]['limit']);_0xa6ff15['offset']=qs[_0xb156('0x2a')](_0x1a3c3d['query'][_0xb156('0x2a')]);}return _0x2b2e26[_0xb156('0x52')](_0xa6ff15);}})[_0xb156('0x1d')](function(_0xfd90e6){if(_0xfd90e6){return _0xfd90e6?{'count':_0x5f4e43,'rows':_0xfd90e6}:null;}})[_0xb156('0x1d')](respondWithResult(_0x5e11ab,null))['catch'](handleError(_0x5e11ab,null));};exports[_0xb156('0x57')]=function(_0x352597,_0x186311,_0x31c6f5){if(_0x352597[_0xb156('0x50')]['id']){delete _0x352597[_0xb156('0x50')]['id'];}return db[_0xb156('0x47')]['findOne']({'where':{'id':_0x352597['params']['id']}})[_0xb156('0x1d')](handleEntityNotFound(_0x186311,null))['then'](function(_0x4797fa){if(_0x4797fa){_0x352597[_0xb156('0x50')][_0xb156('0x58')]=_0x4797fa['id'];_0x352597[_0xb156('0x50')][_0xb156('0x59')]=integrations['getSubjects'](_0x352597[_0xb156('0x50')][_0xb156('0x5a')],_0x352597[_0xb156('0x50')][_0xb156('0x36')]);_0x352597[_0xb156('0x50')][_0xb156('0x5b')]=integrations[_0xb156('0x5c')](_0x352597[_0xb156('0x50')][_0xb156('0x5a')],_0x352597[_0xb156('0x50')][_0xb156('0x36')]);return db[_0xb156('0x54')][_0xb156('0x4f')](_0x352597[_0xb156('0x50')],{'include':[{'model':db[_0xb156('0x5d')],'as':_0xb156('0x59')},{'model':db['SugarcrmField'],'as':_0xb156('0x5b')}]});}return null;})[_0xb156('0x1d')](respondWithResult(_0x186311,null))[_0xb156('0x26')](handleError(_0x186311,null));};exports[_0xb156('0x5e')]=function(_0x211a1a,_0x4a36df,_0x3e793a){var _0x25c6dc='';var _0x274dc4=['id',_0xb156('0x33'),_0xb156('0x5f'),_0xb156('0x60'),'description','date_start',_0xb156('0x61'),_0xb156('0x62'),_0xb156('0x63'),'parent_type',_0xb156('0x64'),_0xb156('0x65')];return db[_0xb156('0x47')][_0xb156('0x53')]({'where':{'id':_0x211a1a['params']['id']},'attributes':['id',_0xb156('0x66'),_0xb156('0x67'),_0xb156('0x68')]})[_0xb156('0x1d')](handleEntityNotFound(_0x4a36df,null))[_0xb156('0x1d')](function(_0x456c55){if(_0x456c55){_0x25c6dc=_0x456c55['remoteUri'];var _0x4d2b6b=_0x25c6dc[_0xb156('0x69')](-0x1);if(_0x4d2b6b==='/'){_0x25c6dc=_0x25c6dc[_0xb156('0x6a')](0x0,_0x25c6dc[_0xb156('0x6b')](_0x4d2b6b));}return rp({'method':_0xb156('0x6c'),'uri':util[_0xb156('0x6d')]('%s%s',_0x25c6dc,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xb156('0x6e'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xb156('0x22')]({'user_auth':{'user_name':_0x456c55[_0xb156('0x66')],'password':_0x456c55[_0xb156('0x67')],'encryption':_0xb156('0x6f')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xb156('0x1d')](function(_0x10ec33){if(_0x10ec33&&_0x10ec33[_0xb156('0x33')]!==_0xb156('0x70')&&_0x10ec33['name']!==_0xb156('0x71')){return rp({'method':_0xb156('0x6c'),'uri':util[_0xb156('0x6d')](_0xb156('0x72'),_0x25c6dc,_0xb156('0x73')),'json':!![],'form':{'method':_0xb156('0x74'),'input_type':_0xb156('0x75'),'response_type':'JSON','rest_data':JSON[_0xb156('0x22')]({'session':_0x10ec33['id'],'module_name':_0xb156('0x76')})}})['then'](function(_0x1d83d1){if(_0x1d83d1){var _0x3bf57c=_[_0xb156('0x77')](_0x1d83d1[_0xb156('0x78')]);_['remove'](_0x3bf57c,function(_0x521362){return _0x274dc4['includes'](_0x521362['name']);});return{'count':_0x3bf57c[_0xb156('0x56')],'rows':_[_0xb156('0x35')](_0x3bf57c,function(_0x13d040){return{'id':_0x13d040['name'],'name':_0x13d040[_0xb156('0x79')],'custom':_[_0xb156('0x7a')](_0x13d040[_0xb156('0x33')],'_c')?!![]:![],'options':_0x13d040[_0xb156('0x46')]?_[_0xb156('0x35')](_['values'](_0x13d040[_0xb156('0x46')]),function(_0x38f919){return{'name':_0x38f919[_0xb156('0x7b')],'value':_0x38f919[_0xb156('0x33')]};}):[]};})};}})[_0xb156('0x1d')](respondWithResult(_0x4a36df,null))[_0xb156('0x26')](function(_0x53e58d){var _0x1157f6=_0x211a1a[_0xb156('0x38')][_0xb156('0x1a')]?0x1f4:_0x53e58d[_0xb156('0x7c')]||0x1f4;logger[_0xb156('0x23')](_0xb156('0x7d'),_0xb156('0x5e'),_0x1157f6,JSON[_0xb156('0x22')](_0x53e58d));delete _0x53e58d['name'];if(_0x1157f6===0x191){_0x1157f6=0x190;}_0x4a36df[_0xb156('0x28')](_0x1157f6)[_0xb156('0x7e')](_0x211a1a['query'][_0xb156('0x1a')]?{'message':_0xb156('0x7f'),'statusCode':_0x53e58d['statusCode']}:_0x53e58d);});}else{var _0x1975c5=0x1f4;_0x4a36df[_0xb156('0x28')](_0x1975c5)[_0xb156('0x7e')]({'message':_0xb156('0x7f'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xddc1=['find','getConfigurations','findOne','SugarcrmConfiguration','order','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','password','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','stringify','Calls','values','module_fields','remove','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../components/integrations/configuration','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~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','SugarcrmAccount,\x20%s,\x20%s','result','sendStatus','status','json','offset','limit','set','Content-Range','apply','update','then','destroy','end','stack','name','send','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','catch','show','params','keys','create','body'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xddc1,0x13e));var _0x1ddc=function(_0x22887c,_0x59e7df){_0x22887c=_0x22887c-0x0;var _0x4d3caa=_0xddc1[_0x22887c];return _0x4d3caa;};'use strict';var pdf=require(_0x1ddc('0x0'));var emlformat=require(_0x1ddc('0x1'));var rimraf=require(_0x1ddc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ddc('0x3'));var rp=require(_0x1ddc('0x4'));var moment=require(_0x1ddc('0x5'));var BPromise=require(_0x1ddc('0x6'));var Mustache=require(_0x1ddc('0x7'));var util=require(_0x1ddc('0x8'));var path=require(_0x1ddc('0x9'));var sox=require(_0x1ddc('0xa'));var csv=require('to-csv');var ejs=require(_0x1ddc('0xb'));var fs=require('fs');var _=require(_0x1ddc('0xc'));var squel=require(_0x1ddc('0xd'));var crypto=require(_0x1ddc('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1ddc('0xf'));var querystring=require(_0x1ddc('0x10'));var Papa=require(_0x1ddc('0x11'));var Redis=require(_0x1ddc('0x12'));var authService=require(_0x1ddc('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1ddc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ddc('0x15'))('api');var utils=require(_0x1ddc('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x1ddc('0x17'));var jayson=require(_0x1ddc('0x18'));var client=jayson[_0x1ddc('0x19')][_0x1ddc('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x46f40f,_0x257082,_0x4e734e){if(_0x4e734e){var _0x885ec3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x885ec3['test'](_0x257082)){return _0x46f40f;}else{throw new db[(_0x1ddc('0x1b'))][(_0x1ddc('0x1c'))](_0x1ddc('0x1d'));}}else{return _0x46f40f;}}function respondWithRpcPromise(_0x2780ae,_0x5504f8,_0x434361,_0x1af996){return new BPromise(function(_0x263bbd,_0x25b25a){var _0x55f165=_0x1af996||client;return _0x55f165['request'](_0x2780ae,_0x434361)['then'](function(_0x3cd136){logger[_0x1ddc('0x1e')]('SugarcrmAccount,\x20%s,\x20%s',_0x5504f8,_0x1ddc('0x1f'));logger[_0x1ddc('0x20')](_0x1ddc('0x21'),_0x5504f8,'request\x20sent',JSON['stringify'](_0x3cd136));if(_0x3cd136[_0x1ddc('0x22')]){if(_0x3cd136[_0x1ddc('0x22')][_0x1ddc('0x23')]===0x1f4){logger[_0x1ddc('0x22')]('SugarcrmAccount,\x20%s,\x20%s',_0x5504f8,_0x3cd136['error'][_0x1ddc('0x24')]);return _0x25b25a(_0x3cd136[_0x1ddc('0x22')]['message']);}logger['error'](_0x1ddc('0x25'),_0x5504f8,_0x3cd136[_0x1ddc('0x22')][_0x1ddc('0x24')]);return _0x263bbd(_0x3cd136['error'][_0x1ddc('0x24')]);}else{logger[_0x1ddc('0x1e')](_0x1ddc('0x25'),_0x5504f8,_0x1ddc('0x1f'));_0x263bbd(_0x3cd136[_0x1ddc('0x26')][_0x1ddc('0x24')]);}})['catch'](function(_0x151e72){logger[_0x1ddc('0x22')](_0x1ddc('0x25'),_0x5504f8,_0x151e72);_0x25b25a(_0x151e72);});});}function respondWithStatusCode(_0x42cded,_0xf24c1c){_0xf24c1c=_0xf24c1c||0xcc;return function(_0x4ffbd5){if(_0x4ffbd5){return _0x42cded[_0x1ddc('0x27')](_0xf24c1c);}return _0x42cded['status'](_0xf24c1c)['end']();};}function respondWithResult(_0x1b9439,_0x56de68){_0x56de68=_0x56de68||0xc8;return function(_0xa9b795){if(_0xa9b795){return _0x1b9439[_0x1ddc('0x28')](_0x56de68)[_0x1ddc('0x29')](_0xa9b795);}};}function respondWithFilteredResult(_0x14fb20,_0x4299dc){return function(_0x5af75f){if(_0x5af75f){var _0x1effc=_0x5af75f['count'],_0x10b63b=_0x4299dc[_0x1ddc('0x2a')],_0x485585=_0x4299dc[_0x1ddc('0x2a')]+_0x4299dc[_0x1ddc('0x2b')],_0x56f4bc;if(_0x485585>=_0x1effc){_0x485585=_0x1effc;_0x56f4bc=0xc8;}else{_0x56f4bc=0xce;}_0x14fb20[_0x1ddc('0x28')](_0x56f4bc);return _0x14fb20[_0x1ddc('0x2c')](_0x1ddc('0x2d'),_0x10b63b+'-'+_0x485585+'/'+_0x1effc)[_0x1ddc('0x29')](_0x5af75f);}return null;};}function patchUpdates(_0x20ca06){return function(_0x4a02d2){try{jsonpatch[_0x1ddc('0x2e')](_0x4a02d2,_0x20ca06,!![]);}catch(_0x5ae63a){return BPromise['reject'](_0x5ae63a);}return _0x4a02d2['save']();};}function saveUpdates(_0x550685,_0x2a9dd1){return function(_0x3fd29e){if(_0x3fd29e){return _0x3fd29e[_0x1ddc('0x2f')](_0x550685)[_0x1ddc('0x30')](function(_0x5c1381){return _0x5c1381;});}return null;};}function removeEntity(_0x233de7,_0x231416){return function(_0x556b18){if(_0x556b18){return _0x556b18[_0x1ddc('0x31')]()[_0x1ddc('0x30')](function(){_0x233de7['status'](0xcc)[_0x1ddc('0x32')]();});}};}function handleEntityNotFound(_0x1bf187,_0x311c38){return function(_0x1b18df){if(!_0x1b18df){_0x1bf187[_0x1ddc('0x27')](0x194);}return _0x1b18df;};}function handleError(_0x476af7,_0x4330b2){_0x4330b2=_0x4330b2||0x1f4;return function(_0x48f26a){logger[_0x1ddc('0x22')](_0x48f26a[_0x1ddc('0x33')]);if(_0x48f26a[_0x1ddc('0x34')]){delete _0x48f26a[_0x1ddc('0x34')];}_0x476af7[_0x1ddc('0x28')](_0x4330b2)[_0x1ddc('0x35')](_0x48f26a);};}exports['index']=function(_0x404c72,_0x3ca4a7){var _0x1cb89a={},_0x2d02fd={},_0x44ab29={'count':0x0,'rows':[]};var _0x1e1309=_[_0x1ddc('0x36')](db[_0x1ddc('0x37')][_0x1ddc('0x38')],function(_0x3c731c){return{'name':_0x3c731c[_0x1ddc('0x39')],'type':_0x3c731c[_0x1ddc('0x3a')][_0x1ddc('0x3b')]};});_0x2d02fd[_0x1ddc('0x3c')]=_['map'](_0x1e1309,'name');_0x2d02fd[_0x1ddc('0x3d')]=_['keys'](_0x404c72[_0x1ddc('0x3d')]);_0x2d02fd[_0x1ddc('0x3e')]=_[_0x1ddc('0x3f')](_0x2d02fd[_0x1ddc('0x3c')],_0x2d02fd[_0x1ddc('0x3d')]);_0x1cb89a[_0x1ddc('0x40')]=_[_0x1ddc('0x3f')](_0x2d02fd[_0x1ddc('0x3c')],qs[_0x1ddc('0x41')](_0x404c72[_0x1ddc('0x3d')][_0x1ddc('0x41')]));_0x1cb89a['attributes']=_0x1cb89a[_0x1ddc('0x40')][_0x1ddc('0x42')]?_0x1cb89a['attributes']:_0x2d02fd[_0x1ddc('0x3c')];if(!_0x404c72['query'][_0x1ddc('0x43')](_0x1ddc('0x44'))){_0x1cb89a[_0x1ddc('0x2b')]=qs[_0x1ddc('0x2b')](_0x404c72[_0x1ddc('0x3d')]['limit']);_0x1cb89a[_0x1ddc('0x2a')]=qs['offset'](_0x404c72[_0x1ddc('0x3d')][_0x1ddc('0x2a')]);}_0x1cb89a['order']=qs['sort'](_0x404c72[_0x1ddc('0x3d')]['sort']);_0x1cb89a[_0x1ddc('0x45')]=qs[_0x1ddc('0x3e')](_[_0x1ddc('0x46')](_0x404c72['query'],_0x2d02fd[_0x1ddc('0x3e')]));if(_0x404c72[_0x1ddc('0x3d')][_0x1ddc('0x47')]){_0x1cb89a[_0x1ddc('0x45')]=_[_0x1ddc('0x48')](_0x1cb89a[_0x1ddc('0x45')],{'$or':_['map'](_0x1e1309,function(_0x200567){if(_0x200567[_0x1ddc('0x3a')]!==_0x1ddc('0x49')){var _0x5016a9={};_0x5016a9[_0x200567['name']]={'$like':'%'+_0x404c72[_0x1ddc('0x3d')][_0x1ddc('0x47')]+'%'};return _0x5016a9;}})});}_0x1cb89a=_['merge']({},_0x1cb89a,_0x404c72[_0x1ddc('0x4a')]);var _0x106f62={'where':_0x1cb89a[_0x1ddc('0x45')]};return db[_0x1ddc('0x37')][_0x1ddc('0x4b')](_0x106f62)[_0x1ddc('0x30')](function(_0x25c937){_0x44ab29[_0x1ddc('0x4b')]=_0x25c937;if(_0x404c72[_0x1ddc('0x3d')][_0x1ddc('0x4c')]){_0x1cb89a[_0x1ddc('0x4d')]=[{'all':!![]}];}return db[_0x1ddc('0x37')]['findAll'](_0x1cb89a);})[_0x1ddc('0x30')](function(_0x498e4b){_0x44ab29['rows']=_0x498e4b;return _0x44ab29;})['then'](respondWithFilteredResult(_0x3ca4a7,_0x1cb89a))[_0x1ddc('0x4e')](handleError(_0x3ca4a7,null));};exports[_0x1ddc('0x4f')]=function(_0x4658ca,_0x1a8ed3){var _0x162e2d={'raw':![],'where':{'id':_0x4658ca[_0x1ddc('0x50')]['id']}},_0x4cee06={};_0x4cee06[_0x1ddc('0x3c')]=_[_0x1ddc('0x51')](db[_0x1ddc('0x37')][_0x1ddc('0x38')]);_0x4cee06[_0x1ddc('0x3d')]=_[_0x1ddc('0x51')](_0x4658ca['query']);_0x4cee06[_0x1ddc('0x3e')]=_[_0x1ddc('0x3f')](_0x4cee06['model'],_0x4cee06[_0x1ddc('0x3d')]);_0x162e2d[_0x1ddc('0x40')]=_[_0x1ddc('0x3f')](_0x4cee06[_0x1ddc('0x3c')],qs[_0x1ddc('0x41')](_0x4658ca[_0x1ddc('0x3d')][_0x1ddc('0x41')]));_0x162e2d[_0x1ddc('0x40')]=_0x162e2d[_0x1ddc('0x40')][_0x1ddc('0x42')]?_0x162e2d['attributes']:_0x4cee06[_0x1ddc('0x3c')];if(_0x4658ca[_0x1ddc('0x3d')][_0x1ddc('0x4c')]){_0x162e2d['include']=[{'all':!![]}];}_0x162e2d=_[_0x1ddc('0x48')]({},_0x162e2d,_0x4658ca[_0x1ddc('0x4a')]);return db[_0x1ddc('0x37')]['find'](_0x162e2d)[_0x1ddc('0x30')](handleEntityNotFound(_0x1a8ed3,null))['then'](respondWithResult(_0x1a8ed3,null))[_0x1ddc('0x4e')](handleError(_0x1a8ed3,null));};exports['create']=function(_0x2e8a33,_0x2358f6){return db[_0x1ddc('0x37')][_0x1ddc('0x52')](_0x2e8a33[_0x1ddc('0x53')],{})['then'](respondWithResult(_0x2358f6,0xc9))[_0x1ddc('0x4e')](handleError(_0x2358f6,null));};exports[_0x1ddc('0x2f')]=function(_0x4c55f2,_0x4c4daf){if(_0x4c55f2[_0x1ddc('0x53')]['id']){delete _0x4c55f2[_0x1ddc('0x53')]['id'];}return db[_0x1ddc('0x37')]['find']({'where':{'id':_0x4c55f2[_0x1ddc('0x50')]['id']}})[_0x1ddc('0x30')](handleEntityNotFound(_0x4c4daf,null))['then'](saveUpdates(_0x4c55f2[_0x1ddc('0x53')],null))['then'](respondWithResult(_0x4c4daf,null))[_0x1ddc('0x4e')](handleError(_0x4c4daf,null));};exports[_0x1ddc('0x31')]=function(_0x26f4cd,_0x30b0d0){return db[_0x1ddc('0x37')][_0x1ddc('0x54')]({'where':{'id':_0x26f4cd[_0x1ddc('0x50')]['id']}})[_0x1ddc('0x30')](handleEntityNotFound(_0x30b0d0,null))['then'](removeEntity(_0x30b0d0,null))['catch'](handleError(_0x30b0d0,null));};exports[_0x1ddc('0x55')]=function(_0x1cbca1,_0x37a4b4,_0x527976){var _0x400db5={};var _0x22cf7c={};var _0x25ef64;var _0x25cca3;return db[_0x1ddc('0x37')][_0x1ddc('0x56')]({'where':{'id':_0x1cbca1[_0x1ddc('0x50')]['id']}})[_0x1ddc('0x30')](handleEntityNotFound(_0x37a4b4,null))[_0x1ddc('0x30')](function(_0x5ac651){if(_0x5ac651){_0x25ef64=_0x5ac651;_0x22cf7c['model']=_[_0x1ddc('0x51')](db[_0x1ddc('0x57')][_0x1ddc('0x38')]);_0x22cf7c['query']=_[_0x1ddc('0x51')](_0x1cbca1[_0x1ddc('0x3d')]);_0x22cf7c[_0x1ddc('0x3e')]=_[_0x1ddc('0x3f')](_0x22cf7c[_0x1ddc('0x3c')],_0x22cf7c[_0x1ddc('0x3d')]);_0x400db5[_0x1ddc('0x40')]=_[_0x1ddc('0x3f')](_0x22cf7c[_0x1ddc('0x3c')],qs[_0x1ddc('0x41')](_0x1cbca1[_0x1ddc('0x3d')][_0x1ddc('0x41')]));_0x400db5[_0x1ddc('0x40')]=_0x400db5[_0x1ddc('0x40')][_0x1ddc('0x42')]?_0x400db5[_0x1ddc('0x40')]:_0x22cf7c[_0x1ddc('0x3c')];_0x400db5[_0x1ddc('0x58')]=qs[_0x1ddc('0x59')](_0x1cbca1[_0x1ddc('0x3d')][_0x1ddc('0x59')]);_0x400db5[_0x1ddc('0x45')]=qs[_0x1ddc('0x3e')](_[_0x1ddc('0x46')](_0x1cbca1[_0x1ddc('0x3d')],_0x22cf7c[_0x1ddc('0x3e')]));if(_0x1cbca1[_0x1ddc('0x3d')]['filter']){_0x400db5[_0x1ddc('0x45')]=_['merge'](_0x400db5[_0x1ddc('0x45')],{'$or':_[_0x1ddc('0x36')](_0x400db5[_0x1ddc('0x40')],function(_0x4ae1a0){var _0x4cbbf9={};_0x4cbbf9[_0x4ae1a0]={'$like':'%'+_0x1cbca1[_0x1ddc('0x3d')][_0x1ddc('0x47')]+'%'};return _0x4cbbf9;})});}_0x400db5=_[_0x1ddc('0x48')]({},_0x400db5,_0x1cbca1[_0x1ddc('0x4a')]);return _0x25ef64[_0x1ddc('0x55')](_0x400db5);}})[_0x1ddc('0x30')](function(_0x2bba62){if(_0x2bba62){_0x25cca3=_0x2bba62['length'];if(!_0x1cbca1['query'][_0x1ddc('0x43')](_0x1ddc('0x44'))){_0x400db5[_0x1ddc('0x2b')]=qs[_0x1ddc('0x2b')](_0x1cbca1[_0x1ddc('0x3d')][_0x1ddc('0x2b')]);_0x400db5[_0x1ddc('0x2a')]=qs[_0x1ddc('0x2a')](_0x1cbca1[_0x1ddc('0x3d')][_0x1ddc('0x2a')]);}return _0x25ef64[_0x1ddc('0x55')](_0x400db5);}})[_0x1ddc('0x30')](function(_0x5ad1d5){if(_0x5ad1d5){return _0x5ad1d5?{'count':_0x25cca3,'rows':_0x5ad1d5}:null;}})[_0x1ddc('0x30')](respondWithResult(_0x37a4b4,null))['catch'](handleError(_0x37a4b4,null));};exports[_0x1ddc('0x5a')]=function(_0x4024b9,_0xc39e07,_0x1aa910){if(_0x4024b9['body']['id']){delete _0x4024b9[_0x1ddc('0x53')]['id'];}return db[_0x1ddc('0x37')][_0x1ddc('0x56')]({'where':{'id':_0x4024b9[_0x1ddc('0x50')]['id']}})[_0x1ddc('0x30')](handleEntityNotFound(_0xc39e07,null))[_0x1ddc('0x30')](function(_0x5162e6){if(_0x5162e6){_0x4024b9['body'][_0x1ddc('0x5b')]=_0x5162e6['id'];_0x4024b9[_0x1ddc('0x53')][_0x1ddc('0x5c')]=integrations[_0x1ddc('0x5d')](_0x4024b9['body'][_0x1ddc('0x5e')],_0x4024b9['body'][_0x1ddc('0x3a')]);_0x4024b9[_0x1ddc('0x53')]['Descriptions']=integrations[_0x1ddc('0x5f')](_0x4024b9[_0x1ddc('0x53')][_0x1ddc('0x5e')],_0x4024b9[_0x1ddc('0x53')]['type']);return db[_0x1ddc('0x57')][_0x1ddc('0x52')](_0x4024b9[_0x1ddc('0x53')],{'include':[{'model':db[_0x1ddc('0x60')],'as':_0x1ddc('0x5c')},{'model':db[_0x1ddc('0x60')],'as':_0x1ddc('0x61')}]});}return null;})[_0x1ddc('0x30')](respondWithResult(_0xc39e07,null))[_0x1ddc('0x4e')](handleError(_0xc39e07,null));};exports[_0x1ddc('0x62')]=function(_0x54bb0d,_0x48e802,_0x1ccd9b){var _0x51cbc9='';var _0x5c4212=['id','name',_0x1ddc('0x63'),_0x1ddc('0x64'),_0x1ddc('0x65'),_0x1ddc('0x66'),_0x1ddc('0x67'),_0x1ddc('0x68'),_0x1ddc('0x69'),_0x1ddc('0x6a'),_0x1ddc('0x6b'),'direction'];return db[_0x1ddc('0x37')]['findOne']({'where':{'id':_0x54bb0d[_0x1ddc('0x50')]['id']},'attributes':['id','username',_0x1ddc('0x6c'),'remoteUri']})[_0x1ddc('0x30')](handleEntityNotFound(_0x48e802,null))[_0x1ddc('0x30')](function(_0x2257f6){if(_0x2257f6){_0x51cbc9=_0x2257f6['remoteUri'];var _0x5be1b2=_0x51cbc9[_0x1ddc('0x6d')](-0x1);if(_0x5be1b2==='/'){_0x51cbc9=_0x51cbc9[_0x1ddc('0x6e')](0x0,_0x51cbc9[_0x1ddc('0x6f')](_0x5be1b2));}return rp({'method':_0x1ddc('0x70'),'uri':util['format'](_0x1ddc('0x71'),_0x51cbc9,_0x1ddc('0x72')),'json':!![],'form':{'method':'login','input_type':_0x1ddc('0x73'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2257f6[_0x1ddc('0x74')],'password':_0x2257f6[_0x1ddc('0x6c')],'encryption':_0x1ddc('0x75')},'application':_0x1ddc('0x76')})}});}})['then'](function(_0x4817e1){if(_0x4817e1&&_0x4817e1[_0x1ddc('0x34')]!==_0x1ddc('0x77')&&_0x4817e1[_0x1ddc('0x34')]!==_0x1ddc('0x78')){return rp({'method':_0x1ddc('0x70'),'uri':util[_0x1ddc('0x79')]('%s%s',_0x51cbc9,_0x1ddc('0x72')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x1ddc('0x7a')]({'session':_0x4817e1['id'],'module_name':_0x1ddc('0x7b')})}})['then'](function(_0xb70fb){if(_0xb70fb){var _0x507c7f=_[_0x1ddc('0x7c')](_0xb70fb[_0x1ddc('0x7d')]);_[_0x1ddc('0x7e')](_0x507c7f,function(_0x5bb20c){return _0x5c4212['includes'](_0x5bb20c[_0x1ddc('0x34')]);});return{'count':_0x507c7f[_0x1ddc('0x42')],'rows':_[_0x1ddc('0x36')](_0x507c7f,function(_0x57e5a6){return{'id':_0x57e5a6[_0x1ddc('0x34')],'name':_0x57e5a6[_0x1ddc('0x7f')],'custom':_[_0x1ddc('0x80')](_0x57e5a6[_0x1ddc('0x34')],'_c')?!![]:![],'options':_0x57e5a6[_0x1ddc('0x4a')]?_[_0x1ddc('0x36')](_[_0x1ddc('0x7c')](_0x57e5a6[_0x1ddc('0x4a')]),function(_0x1eec5f){return{'name':_0x1eec5f[_0x1ddc('0x81')],'value':_0x1eec5f[_0x1ddc('0x34')]};}):[]};})};}})['then'](respondWithResult(_0x48e802,null))[_0x1ddc('0x4e')](function(_0x21d613){var _0x4d65ea=_0x54bb0d[_0x1ddc('0x3d')][_0x1ddc('0x82')]?0x1f4:_0x21d613[_0x1ddc('0x83')]||0x1f4;logger[_0x1ddc('0x22')](_0x1ddc('0x84'),_0x1ddc('0x62'),_0x4d65ea,JSON['stringify'](_0x21d613));delete _0x21d613[_0x1ddc('0x34')];if(_0x4d65ea===0x191){_0x4d65ea=0x190;}_0x48e802[_0x1ddc('0x28')](_0x4d65ea)['send'](_0x54bb0d[_0x1ddc('0x3d')][_0x1ddc('0x82')]?{'message':'Wrong\x20credentials','statusCode':_0x21d613[_0x1ddc('0x83')]}:_0x21d613);});}else{var _0x6bbdf6=0x1f4;_0x48e802[_0x1ddc('0x28')](_0x6bbdf6)[_0x1ddc('0x35')]({'message':_0x1ddc('0x85'),'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 64c9c51..e55c2e3 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 _0x1ad6=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','lodash'];(function(_0xb4bed2,_0x1ba3db){var _0x17a2a5=function(_0x3957c1){while(--_0x3957c1){_0xb4bed2['push'](_0xb4bed2['shift']());}};_0x17a2a5(++_0x1ba3db);}(_0x1ad6,0x107));var _0x61ad=function(_0x3d9ae7,_0x421ee2){_0x3d9ae7=_0x3d9ae7-0x0;var _0x2c5260=_0x1ad6[_0x3d9ae7];return _0x2c5260;};'use strict';var _=require(_0x61ad('0x0'));var util=require(_0x61ad('0x1'));var logger=require('../../config/logger')(_0x61ad('0x2'));var moment=require(_0x61ad('0x3'));var BPromise=require(_0x61ad('0x4'));var rp=require(_0x61ad('0x5'));var fs=require('fs');var path=require(_0x61ad('0x6'));var rimraf=require(_0x61ad('0x7'));var config=require(_0x61ad('0x8'));var attributes=require(_0x61ad('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x61ad('0xa')]=function(_0x5ed325,_0x3ff8ff){return _0x5ed325['define'](_0x61ad('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe819=['request-promise','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','lodash','../../config/logger','moment'];(function(_0x158147,_0x15c105){var _0x2a751b=function(_0x111e0e){while(--_0x111e0e){_0x158147['push'](_0x158147['shift']());}};_0x2a751b(++_0x15c105);}(_0xe819,0x7b));var _0x9e81=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe819[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x9e81('0x0'));var util=require('util');var logger=require(_0x9e81('0x1'))('api');var moment=require(_0x9e81('0x2'));var BPromise=require('bluebird');var rp=require(_0x9e81('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9e81('0x4'));var attributes=require(_0x9e81('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x9e81('0x6')]=function(_0x4f7173,_0x296498){return _0x4f7173[_0x9e81('0x7')](_0x9e81('0x8'),attributes,{'tableName':'int_sugarcrm_accounts','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 6e7cf6b..55f52f2 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 _0x1e65=['catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','limit','include','map','model','attributes','ShowSugarcrmAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','result'];(function(_0x1702e1,_0x3a8949){var _0x2bdc8c=function(_0x362a55){while(--_0x362a55){_0x1702e1['push'](_0x1702e1['shift']());}};_0x2bdc8c(++_0x3a8949);}(_0x1e65,0x9d));var _0x51e6=function(_0x4f484c,_0x9bccb4){_0x4f484c=_0x4f484c-0x0;var _0x276e95=_0x1e65[_0x4f484c];return _0x276e95;};'use strict';var _=require(_0x51e6('0x0'));var util=require(_0x51e6('0x1'));var moment=require('moment');var BPromise=require(_0x51e6('0x2'));var rs=require(_0x51e6('0x3'));var fs=require('fs');var Redis=require(_0x51e6('0x4'));var db=require(_0x51e6('0x5'))['db'];var utils=require(_0x51e6('0x6'));var logger=require('../../config/logger')(_0x51e6('0x7'));var config=require(_0x51e6('0x8'));var jayson=require(_0x51e6('0x9'));var client=jayson[_0x51e6('0xa')][_0x51e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42ad39,_0x1dad97,_0x28eb72){return new BPromise(function(_0x29d886,_0x2a727c){return client[_0x51e6('0xc')](_0x42ad39,_0x28eb72)['then'](function(_0x3c7f11){logger[_0x51e6('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x1dad97,'request\x20sent');logger[_0x51e6('0xe')](_0x51e6('0xf'),_0x1dad97,'request\x20sent',JSON[_0x51e6('0x10')](_0x3c7f11));if(_0x3c7f11['error']){if(_0x3c7f11['error'][_0x51e6('0x11')]===0x1f4){logger[_0x51e6('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x1dad97,_0x3c7f11[_0x51e6('0x12')]['message']);return _0x2a727c(_0x3c7f11[_0x51e6('0x12')][_0x51e6('0x13')]);}logger[_0x51e6('0x12')](_0x51e6('0x14'),_0x1dad97,_0x3c7f11[_0x51e6('0x12')][_0x51e6('0x13')]);return _0x29d886(_0x3c7f11[_0x51e6('0x12')][_0x51e6('0x13')]);}else{logger[_0x51e6('0xd')](_0x51e6('0x14'),_0x1dad97,_0x51e6('0x15'));_0x29d886(_0x3c7f11[_0x51e6('0x16')][_0x51e6('0x13')]);}})[_0x51e6('0x17')](function(_0x2f1357){logger[_0x51e6('0x12')](_0x51e6('0x14'),_0x1dad97,_0x2f1357);_0x2a727c(_0x2f1357);});});}exports[_0x51e6('0x18')]=function(_0x55ecf5){var _0x4ce86a=this;return new Promise(function(_0x4b245b,_0x4b58a2){return db[_0x51e6('0x19')]['findAll']({'raw':_0x55ecf5[_0x51e6('0x1a')]?_0x55ecf5[_0x51e6('0x1a')][_0x51e6('0x1b')]===undefined?!![]:![]:!![],'where':_0x55ecf5[_0x51e6('0x1a')]?_0x55ecf5['options'][_0x51e6('0x1c')]||null:null,'attributes':_0x55ecf5[_0x51e6('0x1a')]?_0x55ecf5[_0x51e6('0x1a')]['attributes']||null:null,'limit':_0x55ecf5[_0x51e6('0x1a')]?_0x55ecf5[_0x51e6('0x1a')][_0x51e6('0x1d')]||null:null,'include':_0x55ecf5['options']?_0x55ecf5[_0x51e6('0x1a')][_0x51e6('0x1e')]?_[_0x51e6('0x1f')](_0x55ecf5['options']['include'],function(_0x2aa593){return{'model':db[_0x2aa593[_0x51e6('0x20')]],'as':_0x2aa593['as'],'attributes':_0x2aa593[_0x51e6('0x21')],'include':_0x2aa593[_0x51e6('0x1e')]?_['map'](_0x2aa593['include'],function(_0x48c6e4){return{'model':db[_0x48c6e4[_0x51e6('0x20')]],'as':_0x48c6e4['as'],'attributes':_0x48c6e4[_0x51e6('0x21')],'include':_0x48c6e4['include']?_[_0x51e6('0x1f')](_0x48c6e4[_0x51e6('0x1e')],function(_0x3df01a){return{'model':db[_0x3df01a[_0x51e6('0x20')]],'as':_0x3df01a['as'],'attributes':_0x3df01a[_0x51e6('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x547ef0){logger[_0x51e6('0xd')]('GetSugarcrmAccount',_0x55ecf5);logger[_0x51e6('0xe')](_0x51e6('0x18'),_0x55ecf5,JSON[_0x51e6('0x10')](_0x547ef0));_0x4b245b(_0x547ef0);})['catch'](function(_0x45d268){logger[_0x51e6('0x12')](_0x51e6('0x18'),_0x45d268[_0x51e6('0x13')],_0x55ecf5);_0x4b58a2(_0x4ce86a[_0x51e6('0x12')](0x1f4,_0x45d268['message']));});});};exports[_0x51e6('0x22')]=function(_0x1aa892){var _0x32ebb7=this;return new Promise(function(_0x198bf4,_0x4a0d42){return db[_0x51e6('0x19')][_0x51e6('0x23')]({'raw':_0x1aa892['options']?_0x1aa892['options'][_0x51e6('0x1b')]===undefined?!![]:![]:!![],'where':_0x1aa892['options']?_0x1aa892[_0x51e6('0x1a')][_0x51e6('0x1c')]||null:null,'attributes':_0x1aa892[_0x51e6('0x1a')]?_0x1aa892[_0x51e6('0x1a')][_0x51e6('0x21')]||null:null,'include':_0x1aa892[_0x51e6('0x1a')]?_0x1aa892['options']['include']?_[_0x51e6('0x1f')](_0x1aa892[_0x51e6('0x1a')]['include'],function(_0x2f45f7){return{'model':db[_0x2f45f7[_0x51e6('0x20')]],'as':_0x2f45f7['as'],'attributes':_0x2f45f7[_0x51e6('0x21')],'include':_0x2f45f7[_0x51e6('0x1e')]?_['map'](_0x2f45f7[_0x51e6('0x1e')],function(_0x108144){return{'model':db[_0x108144['model']],'as':_0x108144['as'],'attributes':_0x108144[_0x51e6('0x21')],'include':_0x108144[_0x51e6('0x1e')]?_['map'](_0x108144['include'],function(_0xc7d871){return{'model':db[_0xc7d871[_0x51e6('0x20')]],'as':_0xc7d871['as'],'attributes':_0xc7d871['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1baa30){logger['info'](_0x51e6('0x22'),_0x1aa892);logger[_0x51e6('0xe')](_0x51e6('0x22'),_0x1aa892,JSON[_0x51e6('0x10')](_0x1baa30));_0x198bf4(_0x1baa30);})['catch'](function(_0x34c046){logger[_0x51e6('0x12')](_0x51e6('0x22'),_0x34c046[_0x51e6('0x13')],_0x1aa892);_0x4a0d42(_0x32ebb7[_0x51e6('0x12')](0x1f4,_0x34c046[_0x51e6('0x13')]));});});}; \ No newline at end of file +var _0x8600=['options','raw','where','attributes','map','model','include','ShowSugarcrmAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','GetSugarcrmAccount','SugarcrmAccount'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8600,0x111));var _0x0860=function(_0x17c8cc,_0x5e5647){_0x17c8cc=_0x17c8cc-0x0;var _0x3db4eb=_0x8600[_0x17c8cc];return _0x3db4eb;};'use strict';var _=require('lodash');var util=require(_0x0860('0x0'));var moment=require(_0x0860('0x1'));var BPromise=require(_0x0860('0x2'));var rs=require(_0x0860('0x3'));var fs=require('fs');var Redis=require(_0x0860('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0860('0x5'));var logger=require(_0x0860('0x6'))(_0x0860('0x7'));var config=require(_0x0860('0x8'));var jayson=require(_0x0860('0x9'));var client=jayson[_0x0860('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b35a2,_0x46ab47,_0x5be2d4){return new BPromise(function(_0x317381,_0x345f99){return client[_0x0860('0xb')](_0x2b35a2,_0x5be2d4)[_0x0860('0xc')](function(_0x9d352e){logger[_0x0860('0xd')](_0x0860('0xe'),_0x46ab47,'request\x20sent');logger[_0x0860('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x46ab47,'request\x20sent',JSON[_0x0860('0x10')](_0x9d352e));if(_0x9d352e[_0x0860('0x11')]){if(_0x9d352e[_0x0860('0x11')]['code']===0x1f4){logger[_0x0860('0x11')](_0x0860('0xe'),_0x46ab47,_0x9d352e[_0x0860('0x11')][_0x0860('0x12')]);return _0x345f99(_0x9d352e[_0x0860('0x11')]['message']);}logger[_0x0860('0x11')](_0x0860('0xe'),_0x46ab47,_0x9d352e[_0x0860('0x11')][_0x0860('0x12')]);return _0x317381(_0x9d352e['error'][_0x0860('0x12')]);}else{logger[_0x0860('0xd')](_0x0860('0xe'),_0x46ab47,_0x0860('0x13'));_0x317381(_0x9d352e[_0x0860('0x14')][_0x0860('0x12')]);}})[_0x0860('0x15')](function(_0x1e6c02){logger[_0x0860('0x11')](_0x0860('0xe'),_0x46ab47,_0x1e6c02);_0x345f99(_0x1e6c02);});});}exports[_0x0860('0x16')]=function(_0x3f2145){var _0x422a07=this;return new Promise(function(_0x3444fb,_0x416515){return db[_0x0860('0x17')]['findAll']({'raw':_0x3f2145[_0x0860('0x18')]?_0x3f2145[_0x0860('0x18')][_0x0860('0x19')]===undefined?!![]:![]:!![],'where':_0x3f2145[_0x0860('0x18')]?_0x3f2145[_0x0860('0x18')][_0x0860('0x1a')]||null:null,'attributes':_0x3f2145['options']?_0x3f2145[_0x0860('0x18')][_0x0860('0x1b')]||null:null,'limit':_0x3f2145[_0x0860('0x18')]?_0x3f2145[_0x0860('0x18')]['limit']||null:null,'include':_0x3f2145[_0x0860('0x18')]?_0x3f2145['options']['include']?_[_0x0860('0x1c')](_0x3f2145[_0x0860('0x18')]['include'],function(_0x4fe229){return{'model':db[_0x4fe229[_0x0860('0x1d')]],'as':_0x4fe229['as'],'attributes':_0x4fe229[_0x0860('0x1b')],'include':_0x4fe229[_0x0860('0x1e')]?_[_0x0860('0x1c')](_0x4fe229[_0x0860('0x1e')],function(_0x4dac18){return{'model':db[_0x4dac18[_0x0860('0x1d')]],'as':_0x4dac18['as'],'attributes':_0x4dac18['attributes'],'include':_0x4dac18['include']?_['map'](_0x4dac18[_0x0860('0x1e')],function(_0x542870){return{'model':db[_0x542870['model']],'as':_0x542870['as'],'attributes':_0x542870['attributes']};}):[]};}):[]};}):[]:[]})[_0x0860('0xc')](function(_0x455961){logger[_0x0860('0xd')](_0x0860('0x16'),_0x3f2145);logger[_0x0860('0xf')]('GetSugarcrmAccount',_0x3f2145,JSON['stringify'](_0x455961));_0x3444fb(_0x455961);})[_0x0860('0x15')](function(_0x2feb54){logger[_0x0860('0x11')](_0x0860('0x16'),_0x2feb54[_0x0860('0x12')],_0x3f2145);_0x416515(_0x422a07[_0x0860('0x11')](0x1f4,_0x2feb54[_0x0860('0x12')]));});});};exports[_0x0860('0x1f')]=function(_0x161144){var _0x4fb5de=this;return new Promise(function(_0x587921,_0x16f52b){return db['SugarcrmAccount'][_0x0860('0x20')]({'raw':_0x161144[_0x0860('0x18')]?_0x161144[_0x0860('0x18')][_0x0860('0x19')]===undefined?!![]:![]:!![],'where':_0x161144[_0x0860('0x18')]?_0x161144[_0x0860('0x18')][_0x0860('0x1a')]||null:null,'attributes':_0x161144[_0x0860('0x18')]?_0x161144['options']['attributes']||null:null,'include':_0x161144[_0x0860('0x18')]?_0x161144[_0x0860('0x18')]['include']?_['map'](_0x161144[_0x0860('0x18')][_0x0860('0x1e')],function(_0x45c36e){return{'model':db[_0x45c36e[_0x0860('0x1d')]],'as':_0x45c36e['as'],'attributes':_0x45c36e[_0x0860('0x1b')],'include':_0x45c36e['include']?_[_0x0860('0x1c')](_0x45c36e['include'],function(_0x48c681){return{'model':db[_0x48c681['model']],'as':_0x48c681['as'],'attributes':_0x48c681[_0x0860('0x1b')],'include':_0x48c681['include']?_[_0x0860('0x1c')](_0x48c681[_0x0860('0x1e')],function(_0x583a7a){return{'model':db[_0x583a7a[_0x0860('0x1d')]],'as':_0x583a7a['as'],'attributes':_0x583a7a[_0x0860('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0860('0xc')](function(_0x45cfb3){logger[_0x0860('0xd')](_0x0860('0x1f'),_0x161144);logger[_0x0860('0xf')]('ShowSugarcrmAccount',_0x161144,JSON[_0x0860('0x10')](_0x45cfb3));_0x587921(_0x45cfb3);})[_0x0860('0x15')](function(_0x75d90b){logger[_0x0860('0x11')](_0x0860('0x1f'),_0x75d90b[_0x0860('0x12')],_0x161144);_0x16f52b(_0x4fb5de[_0x0860('0x11')](0x1f4,_0x75d90b[_0x0860('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ad1f3b2..7dfaefc 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 _0xb85a=['/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects'];(function(_0x1da496,_0x5e8dcb){var _0x252b54=function(_0x358fe0){while(--_0x358fe0){_0x1da496['push'](_0x1da496['shift']());}};_0x252b54(++_0x5e8dcb);}(_0xb85a,0x143));var _0xab85=function(_0x356801,_0xf50d95){_0x356801=_0x356801-0x0;var _0x479011=_0xb85a[_0x356801];return _0x479011;};'use strict';var multer=require(_0xab85('0x0'));var util=require(_0xab85('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xab85('0x2'));var interaction=require(_0xab85('0x3'));var config=require(_0xab85('0x4'));var controller=require(_0xab85('0x5'));router[_0xab85('0x6')]('/',auth['isAuthenticated'](),controller[_0xab85('0x7')]);router['get'](_0xab85('0x8'),auth[_0xab85('0x9')](),controller['show']);router[_0xab85('0x6')](_0xab85('0xa'),auth[_0xab85('0x9')](),controller['getFields']);router['get'](_0xab85('0xb'),auth[_0xab85('0x9')](),controller[_0xab85('0xc')]);router['get'](_0xab85('0xd'),auth['isAuthenticated'](),controller[_0xab85('0xe')]);router[_0xab85('0xf')]('/',auth[_0xab85('0x9')](),controller[_0xab85('0x10')]);router[_0xab85('0x11')]('/:id',auth[_0xab85('0x9')](),controller[_0xab85('0x12')]);router[_0xab85('0x13')](_0xab85('0x8'),auth[_0xab85('0x9')](),controller['destroy']);module[_0xab85('0x14')]=router; \ No newline at end of file +var _0xaed7=['isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaed7,0x14f));var _0x7aed=function(_0x16519c,_0x538751){_0x16519c=_0x16519c-0x0;var _0x330552=_0xaed7[_0x16519c];return _0x330552;};'use strict';var multer=require(_0x7aed('0x0'));var util=require('util');var path=require(_0x7aed('0x1'));var timeout=require(_0x7aed('0x2'));var express=require(_0x7aed('0x3'));var router=express[_0x7aed('0x4')]();var auth=require(_0x7aed('0x5'));var interaction=require(_0x7aed('0x6'));var config=require(_0x7aed('0x7'));var controller=require(_0x7aed('0x8'));router[_0x7aed('0x9')]('/',auth[_0x7aed('0xa')](),controller[_0x7aed('0xb')]);router['get'](_0x7aed('0xc'),auth[_0x7aed('0xa')](),controller[_0x7aed('0xd')]);router[_0x7aed('0x9')](_0x7aed('0xe'),auth[_0x7aed('0xa')](),controller[_0x7aed('0xf')]);router[_0x7aed('0x9')](_0x7aed('0x10'),auth[_0x7aed('0xa')](),controller[_0x7aed('0x11')]);router['get'](_0x7aed('0x12'),auth[_0x7aed('0xa')](),controller[_0x7aed('0x13')]);router['post']('/',auth[_0x7aed('0xa')](),controller['create']);router[_0x7aed('0x14')](_0x7aed('0xc'),auth[_0x7aed('0xa')](),controller['update']);router[_0x7aed('0x15')](_0x7aed('0xc'),auth[_0x7aed('0xa')](),controller[_0x7aed('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 40c72c1..f80982e 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 _0x7971=['STRING','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7971,0x118));var _0x1797=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x7971[_0x36c5b0];return _0xf19333;};'use strict';var Sequelize=require(_0x1797('0x0'));module[_0x1797('0x1')]={'name':{'type':Sequelize[_0x1797('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x61d6=['sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x61d6,0xf9));var _0x661d=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x61d6[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0x661d('0x0'));module[_0x661d('0x1')]={'name':{'type':Sequelize[_0x661d('0x2')]},'description':{'type':Sequelize[_0x661d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 9df7003..8847483 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 _0x4fc6=['options','count','includeAll','include','rows','show','params','find','catch','body','getFields','SugarcrmField','filter','getSubjects','findOne','getDescriptions','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','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','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','info','sendStatus','status','end','json','limit','Content-Range','apply','reject','save','update','then','destroy','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','type','VIRTUAL'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4fc6,0x184));var _0x64fc=function(_0x4495a0,_0x1fbf4d){_0x4495a0=_0x4495a0-0x0;var _0x4a3a4e=_0x4fc6[_0x4495a0];return _0x4a3a4e;};'use strict';var pdf=require(_0x64fc('0x0'));var emlformat=require(_0x64fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x64fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64fc('0x3'));var moment=require(_0x64fc('0x4'));var BPromise=require(_0x64fc('0x5'));var Mustache=require(_0x64fc('0x6'));var util=require(_0x64fc('0x7'));var path=require(_0x64fc('0x8'));var sox=require(_0x64fc('0x9'));var csv=require(_0x64fc('0xa'));var ejs=require(_0x64fc('0xb'));var fs=require('fs');var _=require(_0x64fc('0xc'));var squel=require(_0x64fc('0xd'));var crypto=require('crypto');var jsforce=require(_0x64fc('0xe'));var deskjs=require(_0x64fc('0xf'));var toCsv=require(_0x64fc('0xa'));var querystring=require(_0x64fc('0x10'));var Papa=require(_0x64fc('0x11'));var Redis=require(_0x64fc('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x64fc('0x13'));var hardwareService=require(_0x64fc('0x14'));var logger=require(_0x64fc('0x15'))(_0x64fc('0x16'));var utils=require(_0x64fc('0x17'));var config=require(_0x64fc('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x64fc('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1f267e,_0x48dc9f,_0x383b33){if(_0x383b33){var _0x328289=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x328289[_0x64fc('0x1a')](_0x48dc9f)){return _0x1f267e;}else{throw new db[(_0x64fc('0x1b'))][(_0x64fc('0x1c'))](_0x64fc('0x1d'));}}else{return _0x1f267e;}}function respondWithRpcPromise(_0x44646e,_0x275460,_0x2a8f25,_0x1c1a27){return new BPromise(function(_0x17ab81,_0xe7f2f){var _0x383f46=_0x1c1a27||client;return _0x383f46[_0x64fc('0x1e')](_0x44646e,_0x2a8f25)['then'](function(_0x1f5353){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x275460,_0x64fc('0x1f'));logger[_0x64fc('0x20')](_0x64fc('0x21'),_0x275460,'request\x20sent',JSON[_0x64fc('0x22')](_0x1f5353));if(_0x1f5353['error']){if(_0x1f5353[_0x64fc('0x23')][_0x64fc('0x24')]===0x1f4){logger[_0x64fc('0x23')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x275460,_0x1f5353[_0x64fc('0x23')][_0x64fc('0x25')]);return _0xe7f2f(_0x1f5353[_0x64fc('0x23')][_0x64fc('0x25')]);}logger[_0x64fc('0x23')](_0x64fc('0x26'),_0x275460,_0x1f5353[_0x64fc('0x23')][_0x64fc('0x25')]);return _0x17ab81(_0x1f5353[_0x64fc('0x23')][_0x64fc('0x25')]);}else{logger[_0x64fc('0x27')](_0x64fc('0x26'),_0x275460,_0x64fc('0x1f'));_0x17ab81(_0x1f5353['result'][_0x64fc('0x25')]);}})['catch'](function(_0x2a4702){logger[_0x64fc('0x23')](_0x64fc('0x26'),_0x275460,_0x2a4702);_0xe7f2f(_0x2a4702);});});}function respondWithStatusCode(_0x3bd98e,_0x36515a){_0x36515a=_0x36515a||0xcc;return function(_0xeb0c26){if(_0xeb0c26){return _0x3bd98e[_0x64fc('0x28')](_0x36515a);}return _0x3bd98e[_0x64fc('0x29')](_0x36515a)[_0x64fc('0x2a')]();};}function respondWithResult(_0x11496b,_0x205efd){_0x205efd=_0x205efd||0xc8;return function(_0x1a5f6b){if(_0x1a5f6b){return _0x11496b[_0x64fc('0x29')](_0x205efd)[_0x64fc('0x2b')](_0x1a5f6b);}};}function respondWithFilteredResult(_0x2986d2,_0xe8fe1b){return function(_0x55cab6){if(_0x55cab6){var _0x35b45e=_0x55cab6['count'],_0x45fd37=_0xe8fe1b['offset'],_0x102006=_0xe8fe1b['offset']+_0xe8fe1b[_0x64fc('0x2c')],_0x156420;if(_0x102006>=_0x35b45e){_0x102006=_0x35b45e;_0x156420=0xc8;}else{_0x156420=0xce;}_0x2986d2[_0x64fc('0x29')](_0x156420);return _0x2986d2['set'](_0x64fc('0x2d'),_0x45fd37+'-'+_0x102006+'/'+_0x35b45e)[_0x64fc('0x2b')](_0x55cab6);}return null;};}function patchUpdates(_0x57b849){return function(_0x26bd75){try{jsonpatch[_0x64fc('0x2e')](_0x26bd75,_0x57b849,!![]);}catch(_0x119c97){return BPromise[_0x64fc('0x2f')](_0x119c97);}return _0x26bd75[_0x64fc('0x30')]();};}function saveUpdates(_0x3bc86f,_0x1a74a8){return function(_0x251044){if(_0x251044){return _0x251044[_0x64fc('0x31')](_0x3bc86f)[_0x64fc('0x32')](function(_0x47bb54){return _0x47bb54;});}return null;};}function removeEntity(_0xc02427,_0x552ecc){return function(_0x42613e){if(_0x42613e){return _0x42613e[_0x64fc('0x33')]()['then'](function(){_0xc02427[_0x64fc('0x29')](0xcc)[_0x64fc('0x2a')]();});}};}function handleEntityNotFound(_0x584427,_0x2f04e8){return function(_0x47f29d){if(!_0x47f29d){_0x584427[_0x64fc('0x28')](0x194);}return _0x47f29d;};}function handleError(_0x119144,_0x14c47e){_0x14c47e=_0x14c47e||0x1f4;return function(_0x39c698){logger[_0x64fc('0x23')](_0x39c698['stack']);if(_0x39c698[_0x64fc('0x34')]){delete _0x39c698[_0x64fc('0x34')];}_0x119144[_0x64fc('0x29')](_0x14c47e)[_0x64fc('0x35')](_0x39c698);};}exports['index']=function(_0x1933a0,_0x5ae4de){var _0x15bded={},_0x45f5af={},_0x431776={'count':0x0,'rows':[]};var _0xd1caf5=_[_0x64fc('0x36')](db[_0x64fc('0x37')][_0x64fc('0x38')],function(_0x1eff67){return{'name':_0x1eff67[_0x64fc('0x39')],'type':_0x1eff67['type'][_0x64fc('0x3a')]};});_0x45f5af[_0x64fc('0x3b')]=_[_0x64fc('0x36')](_0xd1caf5,_0x64fc('0x34'));_0x45f5af['query']=_[_0x64fc('0x3c')](_0x1933a0[_0x64fc('0x3d')]);_0x45f5af[_0x64fc('0x3e')]=_['intersection'](_0x45f5af[_0x64fc('0x3b')],_0x45f5af[_0x64fc('0x3d')]);_0x15bded[_0x64fc('0x3f')]=_[_0x64fc('0x40')](_0x45f5af['model'],qs[_0x64fc('0x41')](_0x1933a0[_0x64fc('0x3d')]['fields']));_0x15bded[_0x64fc('0x3f')]=_0x15bded[_0x64fc('0x3f')][_0x64fc('0x42')]?_0x15bded[_0x64fc('0x3f')]:_0x45f5af[_0x64fc('0x3b')];if(!_0x1933a0['query'][_0x64fc('0x43')](_0x64fc('0x44'))){_0x15bded[_0x64fc('0x2c')]=qs[_0x64fc('0x2c')](_0x1933a0[_0x64fc('0x3d')][_0x64fc('0x2c')]);_0x15bded['offset']=qs[_0x64fc('0x45')](_0x1933a0[_0x64fc('0x3d')]['offset']);}_0x15bded[_0x64fc('0x46')]=qs[_0x64fc('0x47')](_0x1933a0[_0x64fc('0x3d')][_0x64fc('0x47')]);_0x15bded[_0x64fc('0x48')]=qs[_0x64fc('0x3e')](_[_0x64fc('0x49')](_0x1933a0['query'],_0x45f5af[_0x64fc('0x3e')]));if(_0x1933a0[_0x64fc('0x3d')]['filter']){_0x15bded['where']=_[_0x64fc('0x4a')](_0x15bded['where'],{'$or':_[_0x64fc('0x36')](_0xd1caf5,function(_0x13c11d){if(_0x13c11d[_0x64fc('0x4b')]!==_0x64fc('0x4c')){var _0xb1a8ec={};_0xb1a8ec[_0x13c11d[_0x64fc('0x34')]]={'$like':'%'+_0x1933a0[_0x64fc('0x3d')]['filter']+'%'};return _0xb1a8ec;}})});}_0x15bded=_[_0x64fc('0x4a')]({},_0x15bded,_0x1933a0[_0x64fc('0x4d')]);var _0x15289d={'where':_0x15bded[_0x64fc('0x48')]};return db[_0x64fc('0x37')][_0x64fc('0x4e')](_0x15289d)[_0x64fc('0x32')](function(_0xa24953){_0x431776[_0x64fc('0x4e')]=_0xa24953;if(_0x1933a0[_0x64fc('0x3d')][_0x64fc('0x4f')]){_0x15bded[_0x64fc('0x50')]=[{'all':!![]}];}return db[_0x64fc('0x37')]['findAll'](_0x15bded);})[_0x64fc('0x32')](function(_0x54a715){_0x431776[_0x64fc('0x51')]=_0x54a715;return _0x431776;})[_0x64fc('0x32')](respondWithFilteredResult(_0x5ae4de,_0x15bded))['catch'](handleError(_0x5ae4de,null));};exports[_0x64fc('0x52')]=function(_0x172165,_0x27478f){var _0x4fa6ee={'raw':![],'where':{'id':_0x172165[_0x64fc('0x53')]['id']}},_0x2ac1be={};_0x2ac1be[_0x64fc('0x3b')]=_[_0x64fc('0x3c')](db[_0x64fc('0x37')][_0x64fc('0x38')]);_0x2ac1be[_0x64fc('0x3d')]=_[_0x64fc('0x3c')](_0x172165['query']);_0x2ac1be[_0x64fc('0x3e')]=_[_0x64fc('0x40')](_0x2ac1be[_0x64fc('0x3b')],_0x2ac1be[_0x64fc('0x3d')]);_0x4fa6ee[_0x64fc('0x3f')]=_[_0x64fc('0x40')](_0x2ac1be[_0x64fc('0x3b')],qs[_0x64fc('0x41')](_0x172165[_0x64fc('0x3d')][_0x64fc('0x41')]));_0x4fa6ee[_0x64fc('0x3f')]=_0x4fa6ee[_0x64fc('0x3f')][_0x64fc('0x42')]?_0x4fa6ee['attributes']:_0x2ac1be[_0x64fc('0x3b')];if(_0x172165[_0x64fc('0x3d')][_0x64fc('0x4f')]){_0x4fa6ee[_0x64fc('0x50')]=[{'all':!![]}];}_0x4fa6ee=_[_0x64fc('0x4a')]({},_0x4fa6ee,_0x172165[_0x64fc('0x4d')]);return db['SugarcrmConfiguration'][_0x64fc('0x54')](_0x4fa6ee)[_0x64fc('0x32')](handleEntityNotFound(_0x27478f,null))[_0x64fc('0x32')](respondWithResult(_0x27478f,null))[_0x64fc('0x55')](handleError(_0x27478f,null));};exports['create']=function(_0x10929c,_0x56defc){return db['SugarcrmConfiguration']['create'](_0x10929c[_0x64fc('0x56')],{})[_0x64fc('0x32')](respondWithResult(_0x56defc,0xc9))[_0x64fc('0x55')](handleError(_0x56defc,null));};exports[_0x64fc('0x31')]=function(_0x25f4ee,_0xdcf709){if(_0x25f4ee[_0x64fc('0x56')]['id']){delete _0x25f4ee[_0x64fc('0x56')]['id'];}return db[_0x64fc('0x37')]['find']({'where':{'id':_0x25f4ee[_0x64fc('0x53')]['id']}})[_0x64fc('0x32')](handleEntityNotFound(_0xdcf709,null))[_0x64fc('0x32')](saveUpdates(_0x25f4ee[_0x64fc('0x56')],null))[_0x64fc('0x32')](respondWithResult(_0xdcf709,null))['catch'](handleError(_0xdcf709,null));};exports['destroy']=function(_0x3c7d16,_0x38de61){return db[_0x64fc('0x37')][_0x64fc('0x54')]({'where':{'id':_0x3c7d16[_0x64fc('0x53')]['id']}})[_0x64fc('0x32')](handleEntityNotFound(_0x38de61,null))[_0x64fc('0x32')](removeEntity(_0x38de61,null))[_0x64fc('0x55')](handleError(_0x38de61,null));};exports[_0x64fc('0x57')]=function(_0x26ea23,_0x5e5e29,_0x1fffcc){var _0x4f0099={};var _0x363eae={};var _0x4410e2;var _0x30f61e;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x26ea23[_0x64fc('0x53')]['id']}})[_0x64fc('0x32')](handleEntityNotFound(_0x5e5e29,null))[_0x64fc('0x32')](function(_0x32624f){if(_0x32624f){_0x4410e2=_0x32624f;_0x363eae[_0x64fc('0x3b')]=_[_0x64fc('0x3c')](db[_0x64fc('0x58')][_0x64fc('0x38')]);_0x363eae['query']=_[_0x64fc('0x3c')](_0x26ea23['query']);_0x363eae[_0x64fc('0x3e')]=_[_0x64fc('0x40')](_0x363eae[_0x64fc('0x3b')],_0x363eae['query']);_0x4f0099['attributes']=_[_0x64fc('0x40')](_0x363eae[_0x64fc('0x3b')],qs['fields'](_0x26ea23['query'][_0x64fc('0x41')]));_0x4f0099['attributes']=_0x4f0099[_0x64fc('0x3f')][_0x64fc('0x42')]?_0x4f0099[_0x64fc('0x3f')]:_0x363eae[_0x64fc('0x3b')];_0x4f0099[_0x64fc('0x46')]=qs[_0x64fc('0x47')](_0x26ea23[_0x64fc('0x3d')][_0x64fc('0x47')]);_0x4f0099[_0x64fc('0x48')]=qs[_0x64fc('0x3e')](_['pick'](_0x26ea23[_0x64fc('0x3d')],_0x363eae['filters']));if(_0x26ea23[_0x64fc('0x3d')][_0x64fc('0x59')]){_0x4f0099['where']=_[_0x64fc('0x4a')](_0x4f0099[_0x64fc('0x48')],{'$or':_[_0x64fc('0x36')](_0x4f0099[_0x64fc('0x3f')],function(_0x1fe901){var _0x376baa={};_0x376baa[_0x1fe901]={'$like':'%'+_0x26ea23['query'][_0x64fc('0x59')]+'%'};return _0x376baa;})});}_0x4f0099=_['merge']({},_0x4f0099,_0x26ea23[_0x64fc('0x4d')]);return _0x4410e2[_0x64fc('0x57')](_0x4f0099);}})[_0x64fc('0x32')](function(_0xfaab4f){if(_0xfaab4f){_0x30f61e=_0xfaab4f['length'];if(!_0x26ea23[_0x64fc('0x3d')][_0x64fc('0x43')](_0x64fc('0x44'))){_0x4f0099['limit']=qs['limit'](_0x26ea23['query'][_0x64fc('0x2c')]);_0x4f0099['offset']=qs[_0x64fc('0x45')](_0x26ea23[_0x64fc('0x3d')][_0x64fc('0x45')]);}return _0x4410e2[_0x64fc('0x57')](_0x4f0099);}})[_0x64fc('0x32')](function(_0x15747b){if(_0x15747b){return _0x15747b?{'count':_0x30f61e,'rows':_0x15747b}:null;}})['then'](respondWithResult(_0x5e5e29,null))[_0x64fc('0x55')](handleError(_0x5e5e29,null));};exports[_0x64fc('0x5a')]=function(_0x132a03,_0x84918b,_0x46b711){var _0xda1db={};var _0x5bf456={};var _0x1d291b;var _0x139a0d;return db[_0x64fc('0x37')][_0x64fc('0x5b')]({'where':{'id':_0x132a03['params']['id']}})[_0x64fc('0x32')](handleEntityNotFound(_0x84918b,null))[_0x64fc('0x32')](function(_0x4455fa){if(_0x4455fa){_0x1d291b=_0x4455fa;_0x5bf456[_0x64fc('0x3b')]=_[_0x64fc('0x3c')](db[_0x64fc('0x58')][_0x64fc('0x38')]);_0x5bf456[_0x64fc('0x3d')]=_[_0x64fc('0x3c')](_0x132a03['query']);_0x5bf456[_0x64fc('0x3e')]=_[_0x64fc('0x40')](_0x5bf456['model'],_0x5bf456[_0x64fc('0x3d')]);_0xda1db[_0x64fc('0x3f')]=_[_0x64fc('0x40')](_0x5bf456[_0x64fc('0x3b')],qs[_0x64fc('0x41')](_0x132a03['query'][_0x64fc('0x41')]));_0xda1db['attributes']=_0xda1db['attributes']['length']?_0xda1db[_0x64fc('0x3f')]:_0x5bf456[_0x64fc('0x3b')];_0xda1db[_0x64fc('0x46')]=qs['sort'](_0x132a03['query'][_0x64fc('0x47')]);_0xda1db[_0x64fc('0x48')]=qs[_0x64fc('0x3e')](_[_0x64fc('0x49')](_0x132a03[_0x64fc('0x3d')],_0x5bf456['filters']));if(_0x132a03[_0x64fc('0x3d')][_0x64fc('0x59')]){_0xda1db[_0x64fc('0x48')]=_['merge'](_0xda1db['where'],{'$or':_['map'](_0xda1db[_0x64fc('0x3f')],function(_0x505ef1){var _0xb87fca={};_0xb87fca[_0x505ef1]={'$like':'%'+_0x132a03['query']['filter']+'%'};return _0xb87fca;})});}_0xda1db=_[_0x64fc('0x4a')]({},_0xda1db,_0x132a03[_0x64fc('0x4d')]);return _0x1d291b[_0x64fc('0x5a')](_0xda1db);}})[_0x64fc('0x32')](function(_0x512dcb){if(_0x512dcb){_0x139a0d=_0x512dcb[_0x64fc('0x42')];if(!_0x132a03[_0x64fc('0x3d')][_0x64fc('0x43')](_0x64fc('0x44'))){_0xda1db['limit']=qs[_0x64fc('0x2c')](_0x132a03['query'][_0x64fc('0x2c')]);_0xda1db['offset']=qs[_0x64fc('0x45')](_0x132a03[_0x64fc('0x3d')][_0x64fc('0x45')]);}return _0x1d291b[_0x64fc('0x5a')](_0xda1db);}})[_0x64fc('0x32')](function(_0xf22e01){if(_0xf22e01){return _0xf22e01?{'count':_0x139a0d,'rows':_0xf22e01}:null;}})[_0x64fc('0x32')](respondWithResult(_0x84918b,null))[_0x64fc('0x55')](handleError(_0x84918b,null));};exports[_0x64fc('0x5c')]=function(_0x3d317f,_0x56baa3,_0x14b251){var _0x464a72={};var _0x58b7c2={};var _0x413eb5;var _0x56faf2;return db[_0x64fc('0x37')][_0x64fc('0x5b')]({'where':{'id':_0x3d317f['params']['id']}})[_0x64fc('0x32')](handleEntityNotFound(_0x56baa3,null))[_0x64fc('0x32')](function(_0xc0be0b){if(_0xc0be0b){_0x413eb5=_0xc0be0b;_0x58b7c2[_0x64fc('0x3b')]=_[_0x64fc('0x3c')](db['SugarcrmField']['rawAttributes']);_0x58b7c2['query']=_[_0x64fc('0x3c')](_0x3d317f[_0x64fc('0x3d')]);_0x58b7c2[_0x64fc('0x3e')]=_['intersection'](_0x58b7c2[_0x64fc('0x3b')],_0x58b7c2[_0x64fc('0x3d')]);_0x464a72['attributes']=_[_0x64fc('0x40')](_0x58b7c2[_0x64fc('0x3b')],qs[_0x64fc('0x41')](_0x3d317f[_0x64fc('0x3d')][_0x64fc('0x41')]));_0x464a72[_0x64fc('0x3f')]=_0x464a72[_0x64fc('0x3f')][_0x64fc('0x42')]?_0x464a72[_0x64fc('0x3f')]:_0x58b7c2[_0x64fc('0x3b')];_0x464a72[_0x64fc('0x46')]=qs[_0x64fc('0x47')](_0x3d317f[_0x64fc('0x3d')][_0x64fc('0x47')]);_0x464a72['where']=qs[_0x64fc('0x3e')](_[_0x64fc('0x49')](_0x3d317f[_0x64fc('0x3d')],_0x58b7c2[_0x64fc('0x3e')]));if(_0x3d317f['query']['filter']){_0x464a72[_0x64fc('0x48')]=_[_0x64fc('0x4a')](_0x464a72[_0x64fc('0x48')],{'$or':_[_0x64fc('0x36')](_0x464a72[_0x64fc('0x3f')],function(_0x1f3fbc){var _0x21d6e1={};_0x21d6e1[_0x1f3fbc]={'$like':'%'+_0x3d317f[_0x64fc('0x3d')][_0x64fc('0x59')]+'%'};return _0x21d6e1;})});}_0x464a72=_['merge']({},_0x464a72,_0x3d317f[_0x64fc('0x4d')]);return _0x413eb5['getDescriptions'](_0x464a72);}})[_0x64fc('0x32')](function(_0x58fc78){if(_0x58fc78){_0x56faf2=_0x58fc78[_0x64fc('0x42')];if(!_0x3d317f['query']['hasOwnProperty'](_0x64fc('0x44'))){_0x464a72['limit']=qs[_0x64fc('0x2c')](_0x3d317f[_0x64fc('0x3d')][_0x64fc('0x2c')]);_0x464a72['offset']=qs['offset'](_0x3d317f[_0x64fc('0x3d')]['offset']);}return _0x413eb5[_0x64fc('0x5c')](_0x464a72);}})[_0x64fc('0x32')](function(_0x4f8df7){if(_0x4f8df7){return _0x4f8df7?{'count':_0x56faf2,'rows':_0x4f8df7}:null;}})[_0x64fc('0x32')](respondWithResult(_0x56baa3,null))[_0x64fc('0x55')](handleError(_0x56baa3,null));}; \ No newline at end of file +var _0x42a2=['jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','end','count','offset','limit','set','Content-Range','reject','save','destroy','then','sendStatus','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','include','rows','includeAll','create','body','catch','params','findOne','SugarcrmField','pick','getFields','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x1a0153,_0x16ff28){var _0x539a6c=function(_0x45581d){while(--_0x45581d){_0x1a0153['push'](_0x1a0153['shift']());}};_0x539a6c(++_0x16ff28);}(_0x42a2,0x149));var _0x242a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x42a2[_0x46698a];return _0x356db0;};'use strict';var pdf=require(_0x242a('0x0'));var emlformat=require(_0x242a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x242a('0x2'));var jsonpatch=require(_0x242a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x242a('0x4'));var util=require('util');var path=require(_0x242a('0x5'));var sox=require(_0x242a('0x6'));var csv=require(_0x242a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x242a('0x8'));var squel=require(_0x242a('0x9'));var crypto=require(_0x242a('0xa'));var jsforce=require(_0x242a('0xb'));var deskjs=require(_0x242a('0xc'));var toCsv=require(_0x242a('0x7'));var querystring=require('querystring');var Papa=require(_0x242a('0xd'));var Redis=require(_0x242a('0xe'));var authService=require(_0x242a('0xf'));var qs=require(_0x242a('0x10'));var as=require(_0x242a('0x11'));var hardwareService=require(_0x242a('0x12'));var logger=require(_0x242a('0x13'))('api');var utils=require(_0x242a('0x14'));var config=require(_0x242a('0x15'));var db=require(_0x242a('0x16'))['db'];var jayson=require(_0x242a('0x17'));var client=jayson['client'][_0x242a('0x18')]({'port':0x232a});function checkPasswordPattern(_0x30907f,_0x3d68cc,_0x36d546){if(_0x36d546){var _0x5750d5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5750d5['test'](_0x3d68cc)){return _0x30907f;}else{throw new db['Sequelize']['ValidationError'](_0x242a('0x19'));}}else{return _0x30907f;}}function respondWithRpcPromise(_0x362a10,_0x2bddec,_0x321839,_0x597806){return new BPromise(function(_0x5ee602,_0x196640){var _0x5b869c=_0x597806||client;return _0x5b869c[_0x242a('0x1a')](_0x362a10,_0x321839)['then'](function(_0x43958d){logger['info'](_0x242a('0x1b'),_0x2bddec,_0x242a('0x1c'));logger[_0x242a('0x1d')](_0x242a('0x1e'),_0x2bddec,_0x242a('0x1c'),JSON[_0x242a('0x1f')](_0x43958d));if(_0x43958d[_0x242a('0x20')]){if(_0x43958d[_0x242a('0x20')][_0x242a('0x21')]===0x1f4){logger[_0x242a('0x20')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2bddec,_0x43958d[_0x242a('0x20')][_0x242a('0x22')]);return _0x196640(_0x43958d[_0x242a('0x20')]['message']);}logger[_0x242a('0x20')](_0x242a('0x1b'),_0x2bddec,_0x43958d[_0x242a('0x20')]['message']);return _0x5ee602(_0x43958d['error'][_0x242a('0x22')]);}else{logger[_0x242a('0x23')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2bddec,'request\x20sent');_0x5ee602(_0x43958d[_0x242a('0x24')]['message']);}})['catch'](function(_0xfebbe){logger[_0x242a('0x20')](_0x242a('0x1b'),_0x2bddec,_0xfebbe);_0x196640(_0xfebbe);});});}function respondWithStatusCode(_0x333cc9,_0x21c6c2){_0x21c6c2=_0x21c6c2||0xcc;return function(_0xa44926){if(_0xa44926){return _0x333cc9['sendStatus'](_0x21c6c2);}return _0x333cc9[_0x242a('0x25')](_0x21c6c2)[_0x242a('0x26')]();};}function respondWithResult(_0x24c891,_0x15505f){_0x15505f=_0x15505f||0xc8;return function(_0x1d3939){if(_0x1d3939){return _0x24c891[_0x242a('0x25')](_0x15505f)['json'](_0x1d3939);}};}function respondWithFilteredResult(_0x40cff6,_0x4dc69d){return function(_0x3631d6){if(_0x3631d6){var _0x49f06a=_0x3631d6[_0x242a('0x27')],_0x5ec2d8=_0x4dc69d[_0x242a('0x28')],_0x4c350b=_0x4dc69d[_0x242a('0x28')]+_0x4dc69d[_0x242a('0x29')],_0x43669a;if(_0x4c350b>=_0x49f06a){_0x4c350b=_0x49f06a;_0x43669a=0xc8;}else{_0x43669a=0xce;}_0x40cff6[_0x242a('0x25')](_0x43669a);return _0x40cff6[_0x242a('0x2a')](_0x242a('0x2b'),_0x5ec2d8+'-'+_0x4c350b+'/'+_0x49f06a)['json'](_0x3631d6);}return null;};}function patchUpdates(_0x4c57c8){return function(_0x48a73b){try{jsonpatch['apply'](_0x48a73b,_0x4c57c8,!![]);}catch(_0x500fa0){return BPromise[_0x242a('0x2c')](_0x500fa0);}return _0x48a73b[_0x242a('0x2d')]();};}function saveUpdates(_0x7e7b7c,_0x101979){return function(_0x58d504){if(_0x58d504){return _0x58d504['update'](_0x7e7b7c)['then'](function(_0x55be30){return _0x55be30;});}return null;};}function removeEntity(_0x286799,_0x260478){return function(_0x156b2b){if(_0x156b2b){return _0x156b2b[_0x242a('0x2e')]()[_0x242a('0x2f')](function(){_0x286799[_0x242a('0x25')](0xcc)[_0x242a('0x26')]();});}};}function handleEntityNotFound(_0x55120a,_0x4fb342){return function(_0x2723a9){if(!_0x2723a9){_0x55120a[_0x242a('0x30')](0x194);}return _0x2723a9;};}function handleError(_0x207fd1,_0x378eea){_0x378eea=_0x378eea||0x1f4;return function(_0x30c571){logger['error'](_0x30c571[_0x242a('0x31')]);if(_0x30c571['name']){delete _0x30c571[_0x242a('0x32')];}_0x207fd1[_0x242a('0x25')](_0x378eea)[_0x242a('0x33')](_0x30c571);};}exports[_0x242a('0x34')]=function(_0x1f8fc3,_0x31752d){var _0x2c13b7={},_0x1cb70f={},_0x12f5ee={'count':0x0,'rows':[]};var _0x51a755=_[_0x242a('0x35')](db[_0x242a('0x36')][_0x242a('0x37')],function(_0x588b6a){return{'name':_0x588b6a[_0x242a('0x38')],'type':_0x588b6a[_0x242a('0x39')][_0x242a('0x3a')]};});_0x1cb70f[_0x242a('0x3b')]=_['map'](_0x51a755,'name');_0x1cb70f[_0x242a('0x3c')]=_[_0x242a('0x3d')](_0x1f8fc3[_0x242a('0x3c')]);_0x1cb70f[_0x242a('0x3e')]=_[_0x242a('0x3f')](_0x1cb70f['model'],_0x1cb70f['query']);_0x2c13b7[_0x242a('0x40')]=_[_0x242a('0x3f')](_0x1cb70f[_0x242a('0x3b')],qs['fields'](_0x1f8fc3['query'][_0x242a('0x41')]));_0x2c13b7['attributes']=_0x2c13b7[_0x242a('0x40')][_0x242a('0x42')]?_0x2c13b7['attributes']:_0x1cb70f[_0x242a('0x3b')];if(!_0x1f8fc3[_0x242a('0x3c')][_0x242a('0x43')](_0x242a('0x44'))){_0x2c13b7[_0x242a('0x29')]=qs[_0x242a('0x29')](_0x1f8fc3[_0x242a('0x3c')][_0x242a('0x29')]);_0x2c13b7[_0x242a('0x28')]=qs[_0x242a('0x28')](_0x1f8fc3[_0x242a('0x3c')][_0x242a('0x28')]);}_0x2c13b7[_0x242a('0x45')]=qs[_0x242a('0x46')](_0x1f8fc3[_0x242a('0x3c')][_0x242a('0x46')]);_0x2c13b7[_0x242a('0x47')]=qs[_0x242a('0x3e')](_['pick'](_0x1f8fc3[_0x242a('0x3c')],_0x1cb70f['filters']));if(_0x1f8fc3[_0x242a('0x3c')]['filter']){_0x2c13b7[_0x242a('0x47')]=_[_0x242a('0x48')](_0x2c13b7[_0x242a('0x47')],{'$or':_[_0x242a('0x35')](_0x51a755,function(_0x4621d1){if(_0x4621d1[_0x242a('0x39')]!=='VIRTUAL'){var _0x2a8b92={};_0x2a8b92[_0x4621d1[_0x242a('0x32')]]={'$like':'%'+_0x1f8fc3['query'][_0x242a('0x49')]+'%'};return _0x2a8b92;}})});}_0x2c13b7=_[_0x242a('0x48')]({},_0x2c13b7,_0x1f8fc3[_0x242a('0x4a')]);var _0x126da5={'where':_0x2c13b7[_0x242a('0x47')]};return db[_0x242a('0x36')][_0x242a('0x27')](_0x126da5)[_0x242a('0x2f')](function(_0x202b5f){_0x12f5ee[_0x242a('0x27')]=_0x202b5f;if(_0x1f8fc3['query']['includeAll']){_0x2c13b7[_0x242a('0x4b')]=[{'all':!![]}];}return db[_0x242a('0x36')]['findAll'](_0x2c13b7);})[_0x242a('0x2f')](function(_0x83f2fb){_0x12f5ee[_0x242a('0x4c')]=_0x83f2fb;return _0x12f5ee;})[_0x242a('0x2f')](respondWithFilteredResult(_0x31752d,_0x2c13b7))['catch'](handleError(_0x31752d,null));};exports['show']=function(_0x243234,_0x4b45e6){var _0x24b934={'raw':![],'where':{'id':_0x243234['params']['id']}},_0x2b8082={};_0x2b8082['model']=_[_0x242a('0x3d')](db[_0x242a('0x36')][_0x242a('0x37')]);_0x2b8082[_0x242a('0x3c')]=_['keys'](_0x243234[_0x242a('0x3c')]);_0x2b8082[_0x242a('0x3e')]=_[_0x242a('0x3f')](_0x2b8082['model'],_0x2b8082[_0x242a('0x3c')]);_0x24b934['attributes']=_['intersection'](_0x2b8082[_0x242a('0x3b')],qs[_0x242a('0x41')](_0x243234[_0x242a('0x3c')][_0x242a('0x41')]));_0x24b934[_0x242a('0x40')]=_0x24b934[_0x242a('0x40')]['length']?_0x24b934[_0x242a('0x40')]:_0x2b8082['model'];if(_0x243234['query'][_0x242a('0x4d')]){_0x24b934[_0x242a('0x4b')]=[{'all':!![]}];}_0x24b934=_['merge']({},_0x24b934,_0x243234[_0x242a('0x4a')]);return db['SugarcrmConfiguration']['find'](_0x24b934)[_0x242a('0x2f')](handleEntityNotFound(_0x4b45e6,null))[_0x242a('0x2f')](respondWithResult(_0x4b45e6,null))['catch'](handleError(_0x4b45e6,null));};exports[_0x242a('0x4e')]=function(_0x273612,_0x2fe48f){return db[_0x242a('0x36')]['create'](_0x273612[_0x242a('0x4f')],{})[_0x242a('0x2f')](respondWithResult(_0x2fe48f,0xc9))['catch'](handleError(_0x2fe48f,null));};exports['update']=function(_0x432d3a,_0x1603d9){if(_0x432d3a[_0x242a('0x4f')]['id']){delete _0x432d3a['body']['id'];}return db[_0x242a('0x36')]['find']({'where':{'id':_0x432d3a['params']['id']}})[_0x242a('0x2f')](handleEntityNotFound(_0x1603d9,null))[_0x242a('0x2f')](saveUpdates(_0x432d3a[_0x242a('0x4f')],null))['then'](respondWithResult(_0x1603d9,null))[_0x242a('0x50')](handleError(_0x1603d9,null));};exports['destroy']=function(_0x51639c,_0x54df0b){return db[_0x242a('0x36')]['find']({'where':{'id':_0x51639c[_0x242a('0x51')]['id']}})[_0x242a('0x2f')](handleEntityNotFound(_0x54df0b,null))[_0x242a('0x2f')](removeEntity(_0x54df0b,null))[_0x242a('0x50')](handleError(_0x54df0b,null));};exports['getFields']=function(_0x252bb5,_0x1d30d4,_0xf3900b){var _0x27795b={};var _0x7dc17a={};var _0x4a2384;var _0x448ff9;return db[_0x242a('0x36')][_0x242a('0x52')]({'where':{'id':_0x252bb5[_0x242a('0x51')]['id']}})[_0x242a('0x2f')](handleEntityNotFound(_0x1d30d4,null))['then'](function(_0x48e9c3){if(_0x48e9c3){_0x4a2384=_0x48e9c3;_0x7dc17a[_0x242a('0x3b')]=_['keys'](db[_0x242a('0x53')][_0x242a('0x37')]);_0x7dc17a[_0x242a('0x3c')]=_[_0x242a('0x3d')](_0x252bb5['query']);_0x7dc17a['filters']=_['intersection'](_0x7dc17a[_0x242a('0x3b')],_0x7dc17a[_0x242a('0x3c')]);_0x27795b[_0x242a('0x40')]=_[_0x242a('0x3f')](_0x7dc17a[_0x242a('0x3b')],qs[_0x242a('0x41')](_0x252bb5['query'][_0x242a('0x41')]));_0x27795b[_0x242a('0x40')]=_0x27795b[_0x242a('0x40')][_0x242a('0x42')]?_0x27795b[_0x242a('0x40')]:_0x7dc17a[_0x242a('0x3b')];_0x27795b[_0x242a('0x45')]=qs['sort'](_0x252bb5[_0x242a('0x3c')][_0x242a('0x46')]);_0x27795b[_0x242a('0x47')]=qs[_0x242a('0x3e')](_[_0x242a('0x54')](_0x252bb5[_0x242a('0x3c')],_0x7dc17a[_0x242a('0x3e')]));if(_0x252bb5['query'][_0x242a('0x49')]){_0x27795b[_0x242a('0x47')]=_[_0x242a('0x48')](_0x27795b[_0x242a('0x47')],{'$or':_[_0x242a('0x35')](_0x27795b['attributes'],function(_0x456019){var _0x120b7a={};_0x120b7a[_0x456019]={'$like':'%'+_0x252bb5[_0x242a('0x3c')][_0x242a('0x49')]+'%'};return _0x120b7a;})});}_0x27795b=_[_0x242a('0x48')]({},_0x27795b,_0x252bb5[_0x242a('0x4a')]);return _0x4a2384[_0x242a('0x55')](_0x27795b);}})[_0x242a('0x2f')](function(_0xd735f0){if(_0xd735f0){_0x448ff9=_0xd735f0[_0x242a('0x42')];if(!_0x252bb5['query'][_0x242a('0x43')]('nolimit')){_0x27795b[_0x242a('0x29')]=qs[_0x242a('0x29')](_0x252bb5[_0x242a('0x3c')][_0x242a('0x29')]);_0x27795b[_0x242a('0x28')]=qs['offset'](_0x252bb5[_0x242a('0x3c')]['offset']);}return _0x4a2384['getFields'](_0x27795b);}})[_0x242a('0x2f')](function(_0x4c6bc7){if(_0x4c6bc7){return _0x4c6bc7?{'count':_0x448ff9,'rows':_0x4c6bc7}:null;}})[_0x242a('0x2f')](respondWithResult(_0x1d30d4,null))['catch'](handleError(_0x1d30d4,null));};exports[_0x242a('0x56')]=function(_0x2b7319,_0xd688e5,_0x392739){var _0xc8a22f={};var _0x2b27b1={};var _0x2e4e79;var _0x356dce;return db[_0x242a('0x36')]['findOne']({'where':{'id':_0x2b7319[_0x242a('0x51')]['id']}})[_0x242a('0x2f')](handleEntityNotFound(_0xd688e5,null))['then'](function(_0x233e7b){if(_0x233e7b){_0x2e4e79=_0x233e7b;_0x2b27b1['model']=_[_0x242a('0x3d')](db[_0x242a('0x53')]['rawAttributes']);_0x2b27b1[_0x242a('0x3c')]=_[_0x242a('0x3d')](_0x2b7319['query']);_0x2b27b1[_0x242a('0x3e')]=_['intersection'](_0x2b27b1[_0x242a('0x3b')],_0x2b27b1[_0x242a('0x3c')]);_0xc8a22f[_0x242a('0x40')]=_['intersection'](_0x2b27b1[_0x242a('0x3b')],qs[_0x242a('0x41')](_0x2b7319['query']['fields']));_0xc8a22f[_0x242a('0x40')]=_0xc8a22f[_0x242a('0x40')]['length']?_0xc8a22f[_0x242a('0x40')]:_0x2b27b1[_0x242a('0x3b')];_0xc8a22f[_0x242a('0x45')]=qs[_0x242a('0x46')](_0x2b7319['query'][_0x242a('0x46')]);_0xc8a22f[_0x242a('0x47')]=qs[_0x242a('0x3e')](_['pick'](_0x2b7319[_0x242a('0x3c')],_0x2b27b1[_0x242a('0x3e')]));if(_0x2b7319[_0x242a('0x3c')]['filter']){_0xc8a22f[_0x242a('0x47')]=_['merge'](_0xc8a22f[_0x242a('0x47')],{'$or':_['map'](_0xc8a22f['attributes'],function(_0x1a2af9){var _0x12fb4e={};_0x12fb4e[_0x1a2af9]={'$like':'%'+_0x2b7319['query'][_0x242a('0x49')]+'%'};return _0x12fb4e;})});}_0xc8a22f=_[_0x242a('0x48')]({},_0xc8a22f,_0x2b7319[_0x242a('0x4a')]);return _0x2e4e79['getSubjects'](_0xc8a22f);}})[_0x242a('0x2f')](function(_0x29233c){if(_0x29233c){_0x356dce=_0x29233c[_0x242a('0x42')];if(!_0x2b7319[_0x242a('0x3c')][_0x242a('0x43')](_0x242a('0x44'))){_0xc8a22f[_0x242a('0x29')]=qs[_0x242a('0x29')](_0x2b7319[_0x242a('0x3c')]['limit']);_0xc8a22f[_0x242a('0x28')]=qs[_0x242a('0x28')](_0x2b7319[_0x242a('0x3c')][_0x242a('0x28')]);}return _0x2e4e79[_0x242a('0x56')](_0xc8a22f);}})[_0x242a('0x2f')](function(_0x1d69d6){if(_0x1d69d6){return _0x1d69d6?{'count':_0x356dce,'rows':_0x1d69d6}:null;}})[_0x242a('0x2f')](respondWithResult(_0xd688e5,null))[_0x242a('0x50')](handleError(_0xd688e5,null));};exports[_0x242a('0x57')]=function(_0x1dbd6b,_0x4e29af,_0x355958){var _0x23c143={};var _0x457324={};var _0x4a24ee;var _0x23b6e7;return db[_0x242a('0x36')][_0x242a('0x52')]({'where':{'id':_0x1dbd6b[_0x242a('0x51')]['id']}})[_0x242a('0x2f')](handleEntityNotFound(_0x4e29af,null))['then'](function(_0x2f3b02){if(_0x2f3b02){_0x4a24ee=_0x2f3b02;_0x457324[_0x242a('0x3b')]=_[_0x242a('0x3d')](db['SugarcrmField'][_0x242a('0x37')]);_0x457324[_0x242a('0x3c')]=_['keys'](_0x1dbd6b['query']);_0x457324[_0x242a('0x3e')]=_[_0x242a('0x3f')](_0x457324[_0x242a('0x3b')],_0x457324[_0x242a('0x3c')]);_0x23c143[_0x242a('0x40')]=_[_0x242a('0x3f')](_0x457324[_0x242a('0x3b')],qs[_0x242a('0x41')](_0x1dbd6b[_0x242a('0x3c')][_0x242a('0x41')]));_0x23c143['attributes']=_0x23c143[_0x242a('0x40')][_0x242a('0x42')]?_0x23c143['attributes']:_0x457324[_0x242a('0x3b')];_0x23c143['order']=qs[_0x242a('0x46')](_0x1dbd6b[_0x242a('0x3c')][_0x242a('0x46')]);_0x23c143[_0x242a('0x47')]=qs[_0x242a('0x3e')](_['pick'](_0x1dbd6b[_0x242a('0x3c')],_0x457324['filters']));if(_0x1dbd6b['query'][_0x242a('0x49')]){_0x23c143[_0x242a('0x47')]=_[_0x242a('0x48')](_0x23c143['where'],{'$or':_[_0x242a('0x35')](_0x23c143['attributes'],function(_0x31d665){var _0x29f768={};_0x29f768[_0x31d665]={'$like':'%'+_0x1dbd6b['query'][_0x242a('0x49')]+'%'};return _0x29f768;})});}_0x23c143=_['merge']({},_0x23c143,_0x1dbd6b[_0x242a('0x4a')]);return _0x4a24ee[_0x242a('0x57')](_0x23c143);}})[_0x242a('0x2f')](function(_0x364f5f){if(_0x364f5f){_0x23b6e7=_0x364f5f[_0x242a('0x42')];if(!_0x1dbd6b[_0x242a('0x3c')]['hasOwnProperty']('nolimit')){_0x23c143[_0x242a('0x29')]=qs['limit'](_0x1dbd6b[_0x242a('0x3c')][_0x242a('0x29')]);_0x23c143[_0x242a('0x28')]=qs['offset'](_0x1dbd6b['query'][_0x242a('0x28')]);}return _0x4a24ee[_0x242a('0x57')](_0x23c143);}})[_0x242a('0x2f')](function(_0x3e9c79){if(_0x3e9c79){return _0x3e9c79?{'count':_0x23b6e7,'rows':_0x3e9c79}:null;}})[_0x242a('0x2f')](respondWithResult(_0x4e29af,null))[_0x242a('0x50')](handleError(_0x4e29af,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index ebcfeec..7a18cd6 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 _0xa698=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2a90cd,_0x2b3d05){var _0x10425d=function(_0x51628e){while(--_0x51628e){_0x2a90cd['push'](_0x2a90cd['shift']());}};_0x10425d(++_0x2b3d05);}(_0xa698,0xf6));var _0x8a69=function(_0x149508,_0x1d1213){_0x149508=_0x149508-0x0;var _0x24a4b8=_0xa698[_0x149508];return _0x24a4b8;};'use strict';var _=require(_0x8a69('0x0'));var util=require(_0x8a69('0x1'));var logger=require(_0x8a69('0x2'))('api');var moment=require(_0x8a69('0x3'));var BPromise=require(_0x8a69('0x4'));var rp=require(_0x8a69('0x5'));var fs=require('fs');var path=require(_0x8a69('0x6'));var rimraf=require(_0x8a69('0x7'));var config=require(_0x8a69('0x8'));var attributes=require(_0x8a69('0x9'));module[_0x8a69('0xa')]=function(_0x27d05d,_0x3878ea){return _0x27d05d[_0x8a69('0xb')](_0x8a69('0xc'),attributes,{'tableName':_0x8a69('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd08e=['request-promise','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5e3506,_0x32ea1d){var _0x3a5414=function(_0x30ee1d){while(--_0x30ee1d){_0x5e3506['push'](_0x5e3506['shift']());}};_0x3a5414(++_0x32ea1d);}(_0xd08e,0xdf));var _0xed08=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xd08e[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xed08('0x0'));var util=require(_0xed08('0x1'));var logger=require(_0xed08('0x2'))('api');var moment=require(_0xed08('0x3'));var BPromise=require(_0xed08('0x4'));var rp=require(_0xed08('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed08('0x6'));var config=require(_0xed08('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xed08('0x8')]=function(_0xaad68f,_0x541fc2){return _0xaad68f[_0xed08('0x9')](_0xed08('0xa'),attributes,{'tableName':_0xed08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 5d60c37..f0668b1 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 _0xee0f=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3c719e,_0x19719d){var _0x2d09af=function(_0x5b1e8a){while(--_0x5b1e8a){_0x3c719e['push'](_0x3c719e['shift']());}};_0x2d09af(++_0x19719d);}(_0xee0f,0x15a));var _0xfee0=function(_0xf52342,_0x2e9017){_0xf52342=_0xf52342-0x0;var _0x120899=_0xee0f[_0xf52342];return _0x120899;};'use strict';var _=require(_0xfee0('0x0'));var util=require(_0xfee0('0x1'));var moment=require('moment');var BPromise=require(_0xfee0('0x2'));var rs=require(_0xfee0('0x3'));var fs=require('fs');var Redis=require(_0xfee0('0x4'));var db=require(_0xfee0('0x5'))['db'];var utils=require(_0xfee0('0x6'));var logger=require(_0xfee0('0x7'))(_0xfee0('0x8'));var config=require(_0xfee0('0x9'));var jayson=require(_0xfee0('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x259a81,_0xd280ce,_0x5db7da){return new BPromise(function(_0x5a8133,_0x470502){return client['request'](_0x259a81,_0x5db7da)[_0xfee0('0xb')](function(_0x165586){logger[_0xfee0('0xc')](_0xfee0('0xd'),_0xd280ce,'request\x20sent');logger[_0xfee0('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xd280ce,_0xfee0('0xf'),JSON[_0xfee0('0x10')](_0x165586));if(_0x165586[_0xfee0('0x11')]){if(_0x165586[_0xfee0('0x11')][_0xfee0('0x12')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0xd280ce,_0x165586[_0xfee0('0x11')]['message']);return _0x470502(_0x165586[_0xfee0('0x11')][_0xfee0('0x13')]);}logger[_0xfee0('0x11')](_0xfee0('0xd'),_0xd280ce,_0x165586['error'][_0xfee0('0x13')]);return _0x5a8133(_0x165586['error']['message']);}else{logger[_0xfee0('0xc')](_0xfee0('0xd'),_0xd280ce,_0xfee0('0xf'));_0x5a8133(_0x165586[_0xfee0('0x14')]['message']);}})['catch'](function(_0x38c593){logger[_0xfee0('0x11')](_0xfee0('0xd'),_0xd280ce,_0x38c593);_0x470502(_0x38c593);});});} \ No newline at end of file +var _0xade0=['../../config/environment','client','request','info','request\x20sent','debug','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0xade0,0x1f1));var _0x0ade=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0xade0[_0x13cab0];return _0x38804f;};'use strict';var _=require(_0x0ade('0x0'));var util=require(_0x0ade('0x1'));var moment=require(_0x0ade('0x2'));var BPromise=require(_0x0ade('0x3'));var rs=require(_0x0ade('0x4'));var fs=require('fs');var Redis=require(_0x0ade('0x5'));var db=require(_0x0ade('0x6'))['db'];var utils=require(_0x0ade('0x7'));var logger=require('../../config/logger')(_0x0ade('0x8'));var config=require(_0x0ade('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0ade('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x184949,_0x2a8863,_0x2819a6){return new BPromise(function(_0x41cf35,_0x28b269){return client[_0x0ade('0xb')](_0x184949,_0x2819a6)['then'](function(_0x2648c8){logger[_0x0ade('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2a8863,_0x0ade('0xd'));logger[_0x0ade('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2a8863,'request\x20sent',JSON[_0x0ade('0xf')](_0x2648c8));if(_0x2648c8[_0x0ade('0x10')]){if(_0x2648c8[_0x0ade('0x10')][_0x0ade('0x11')]===0x1f4){logger[_0x0ade('0x10')](_0x0ade('0x12'),_0x2a8863,_0x2648c8[_0x0ade('0x10')]['message']);return _0x28b269(_0x2648c8[_0x0ade('0x10')]['message']);}logger[_0x0ade('0x10')](_0x0ade('0x12'),_0x2a8863,_0x2648c8[_0x0ade('0x10')][_0x0ade('0x13')]);return _0x41cf35(_0x2648c8[_0x0ade('0x10')][_0x0ade('0x13')]);}else{logger[_0x0ade('0xc')](_0x0ade('0x12'),_0x2a8863,'request\x20sent');_0x41cf35(_0x2648c8[_0x0ade('0x14')][_0x0ade('0x13')]);}})[_0x0ade('0x15')](function(_0x47ebec){logger[_0x0ade('0x10')](_0x0ade('0x12'),_0x2a8863,_0x47ebec);_0x28b269(_0x47ebec);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 9d18b2f..786eff0 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 _0xb8a1=['express','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','post','put','destroy','exports','util','path','connect-timeout'];(function(_0x1cdf29,_0x3ad410){var _0x4634bd=function(_0x4ed241){while(--_0x4ed241){_0x1cdf29['push'](_0x1cdf29['shift']());}};_0x4634bd(++_0x3ad410);}(_0xb8a1,0x13d));var _0x1b8a=function(_0xfff7a3,_0x4d432e){_0xfff7a3=_0xfff7a3-0x0;var _0x5b0b57=_0xb8a1[_0xfff7a3];return _0x5b0b57;};'use strict';var multer=require('multer');var util=require(_0x1b8a('0x0'));var path=require(_0x1b8a('0x1'));var timeout=require(_0x1b8a('0x2'));var express=require(_0x1b8a('0x3'));var router=express['Router']();var auth=require(_0x1b8a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1b8a('0x5'));var controller=require(_0x1b8a('0x6'));router['get']('/',auth[_0x1b8a('0x7')](),controller[_0x1b8a('0x8')]);router[_0x1b8a('0x9')](_0x1b8a('0xa'),auth[_0x1b8a('0x7')](),controller[_0x1b8a('0xb')]);router[_0x1b8a('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1b8a('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1b8a('0xe')]);module[_0x1b8a('0xf')]=router; \ No newline at end of file +var _0x4ec4=['post','create','put','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','/:id','show'];(function(_0x1e27b6,_0x4864bf){var _0x1e8cbd=function(_0x50078e){while(--_0x50078e){_0x1e27b6['push'](_0x1e27b6['shift']());}};_0x1e8cbd(++_0x4864bf);}(_0x4ec4,0x125));var _0x44ec=function(_0x12fb36,_0x2285e9){_0x12fb36=_0x12fb36-0x0;var _0x37952d=_0x4ec4[_0x12fb36];return _0x37952d;};'use strict';var multer=require(_0x44ec('0x0'));var util=require(_0x44ec('0x1'));var path=require(_0x44ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x44ec('0x3'));var router=express[_0x44ec('0x4')]();var auth=require(_0x44ec('0x5'));var interaction=require(_0x44ec('0x6'));var config=require(_0x44ec('0x7'));var controller=require(_0x44ec('0x8'));router['get']('/',auth[_0x44ec('0x9')](),controller[_0x44ec('0xa')]);router['get'](_0x44ec('0xb'),auth[_0x44ec('0x9')](),controller[_0x44ec('0xc')]);router[_0x44ec('0xd')]('/',auth[_0x44ec('0x9')](),controller[_0x44ec('0xe')]);router[_0x44ec('0xf')]('/:id',auth[_0x44ec('0x9')](),controller[_0x44ec('0x10')]);router['delete'](_0x44ec('0xb'),auth['isAuthenticated'](),controller[_0x44ec('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 2f9cc26..da08ef3 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 _0x29ae=['ENUM','BOOLEAN','sequelize','variable','customVariable','string','STRING'];(function(_0x3154b7,_0x10de64){var _0x202cf2=function(_0x5f2fe7){while(--_0x5f2fe7){_0x3154b7['push'](_0x3154b7['shift']());}};_0x202cf2(++_0x10de64);}(_0x29ae,0x167));var _0xe29a=function(_0x48a45d,_0x1f802b){_0x48a45d=_0x48a45d-0x0;var _0x46dd19=_0x29ae[_0x48a45d];return _0x46dd19;};'use strict';var Sequelize=require(_0xe29a('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xe29a('0x1'),_0xe29a('0x2'),'keyValue'),'defaultValue':_0xe29a('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe29a('0x4')]},'keyType':{'type':Sequelize[_0xe29a('0x5')](_0xe29a('0x3'),'variable',_0xe29a('0x2'))},'keyContent':{'type':Sequelize[_0xe29a('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe29a('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe29a('0x4')]}}; \ No newline at end of file +var _0xb205=['string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','ENUM'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0xb205,0x156));var _0x5b20=function(_0x119bf7,_0x88d576){_0x119bf7=_0x119bf7-0x0;var _0x12fbff=_0xb205[_0x119bf7];return _0x12fbff;};'use strict';var Sequelize=require(_0x5b20('0x0'));module['exports']={'type':{'type':Sequelize[_0x5b20('0x1')](_0x5b20('0x2'),'variable',_0x5b20('0x3'),_0x5b20('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5b20('0x5')]},'key':{'type':Sequelize[_0x5b20('0x5')]},'keyType':{'type':Sequelize[_0x5b20('0x1')](_0x5b20('0x2'),_0x5b20('0x6'),_0x5b20('0x3'))},'keyContent':{'type':Sequelize[_0x5b20('0x5')]},'idField':{'type':Sequelize[_0x5b20('0x5')]},'nameField':{'type':Sequelize[_0x5b20('0x5')]},'customField':{'type':Sequelize[_0x5b20('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5b20('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 7079008..b619597 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 _0xf334=['name','index','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','SugarcrmField','includeAll','findAll','rows','catch','show','params','keys','intersection','include','merge','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error'];(function(_0x4ea758,_0x5b26e6){var _0x1ae476=function(_0x25488b){while(--_0x25488b){_0x4ea758['push'](_0x4ea758['shift']());}};_0x1ae476(++_0x5b26e6);}(_0xf334,0x70));var _0x4f33=function(_0x1a9a7c,_0x5e1505){_0x1a9a7c=_0x1a9a7c-0x0;var _0x55c3e3=_0xf334[_0x1a9a7c];return _0x55c3e3;};'use strict';var pdf=require(_0x4f33('0x0'));var emlformat=require(_0x4f33('0x1'));var rimraf=require(_0x4f33('0x2'));var zipdir=require(_0x4f33('0x3'));var jsonpatch=require(_0x4f33('0x4'));var rp=require(_0x4f33('0x5'));var moment=require(_0x4f33('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4f33('0x7'));var path=require(_0x4f33('0x8'));var sox=require(_0x4f33('0x9'));var csv=require(_0x4f33('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f33('0xb'));var squel=require(_0x4f33('0xc'));var crypto=require(_0x4f33('0xd'));var jsforce=require(_0x4f33('0xe'));var deskjs=require(_0x4f33('0xf'));var toCsv=require(_0x4f33('0xa'));var querystring=require(_0x4f33('0x10'));var Papa=require(_0x4f33('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4f33('0x12'));var as=require(_0x4f33('0x13'));var hardwareService=require(_0x4f33('0x14'));var logger=require(_0x4f33('0x15'))(_0x4f33('0x16'));var utils=require(_0x4f33('0x17'));var config=require(_0x4f33('0x18'));var db=require(_0x4f33('0x19'))['db'];function respondWithStatusCode(_0x228fcb,_0x2ccbf3){_0x2ccbf3=_0x2ccbf3||0xcc;return function(_0x2494a1){if(_0x2494a1){return _0x228fcb[_0x4f33('0x1a')](_0x2ccbf3);}return _0x228fcb[_0x4f33('0x1b')](_0x2ccbf3)[_0x4f33('0x1c')]();};}function respondWithResult(_0x272971,_0x5c9f59){_0x5c9f59=_0x5c9f59||0xc8;return function(_0x5e029b){if(_0x5e029b){return _0x272971[_0x4f33('0x1b')](_0x5c9f59)['json'](_0x5e029b);}};}function respondWithFilteredResult(_0x30361b,_0x507b7a){return function(_0x4a1ab4){if(_0x4a1ab4){var _0x5796c7=_0x4a1ab4[_0x4f33('0x1d')],_0x557d82=_0x507b7a[_0x4f33('0x1e')],_0x3520f2=_0x507b7a[_0x4f33('0x1e')]+_0x507b7a[_0x4f33('0x1f')],_0x347b7f;if(_0x3520f2>=_0x5796c7){_0x3520f2=_0x5796c7;_0x347b7f=0xc8;}else{_0x347b7f=0xce;}_0x30361b[_0x4f33('0x1b')](_0x347b7f);return _0x30361b[_0x4f33('0x20')](_0x4f33('0x21'),_0x557d82+'-'+_0x3520f2+'/'+_0x5796c7)[_0x4f33('0x22')](_0x4a1ab4);}return null;};}function patchUpdates(_0x1e94d4){return function(_0x119917){try{jsonpatch[_0x4f33('0x23')](_0x119917,_0x1e94d4,!![]);}catch(_0x58b34a){return BPromise[_0x4f33('0x24')](_0x58b34a);}return _0x119917[_0x4f33('0x25')]();};}function saveUpdates(_0xdb4df1,_0x4b0a8d){return function(_0x5b0b9e){if(_0x5b0b9e){return _0x5b0b9e[_0x4f33('0x26')](_0xdb4df1)[_0x4f33('0x27')](function(_0x24b3e1){return _0x24b3e1;});}return null;};}function removeEntity(_0x46dd51,_0xbb123f){return function(_0x12b625){if(_0x12b625){return _0x12b625[_0x4f33('0x28')]()[_0x4f33('0x27')](function(){_0x46dd51[_0x4f33('0x1b')](0xcc)[_0x4f33('0x1c')]();});}};}function handleEntityNotFound(_0x1c27f0,_0x43531b){return function(_0x4c29a0){if(!_0x4c29a0){_0x1c27f0[_0x4f33('0x1a')](0x194);}return _0x4c29a0;};}function handleError(_0x251ccd,_0x110c91){_0x110c91=_0x110c91||0x1f4;return function(_0x22c6db){logger[_0x4f33('0x29')](_0x22c6db['stack']);if(_0x22c6db[_0x4f33('0x2a')]){delete _0x22c6db[_0x4f33('0x2a')];}_0x251ccd[_0x4f33('0x1b')](_0x110c91)['send'](_0x22c6db);};}exports[_0x4f33('0x2b')]=function(_0x3699fd,_0x24f34e){var _0x10449b={},_0x5035a2={},_0x2fa732={'count':0x0,'rows':[]};var _0x3a4feb=_['map'](db['SugarcrmField'][_0x4f33('0x2c')],function(_0x50877a){return{'name':_0x50877a[_0x4f33('0x2d')],'type':_0x50877a[_0x4f33('0x2e')][_0x4f33('0x2f')]};});_0x5035a2[_0x4f33('0x30')]=_[_0x4f33('0x31')](_0x3a4feb,_0x4f33('0x2a'));_0x5035a2[_0x4f33('0x32')]=_['keys'](_0x3699fd['query']);_0x5035a2[_0x4f33('0x33')]=_['intersection'](_0x5035a2['model'],_0x5035a2[_0x4f33('0x32')]);_0x10449b[_0x4f33('0x34')]=_['intersection'](_0x5035a2['model'],qs[_0x4f33('0x35')](_0x3699fd[_0x4f33('0x32')]['fields']));_0x10449b[_0x4f33('0x34')]=_0x10449b[_0x4f33('0x34')][_0x4f33('0x36')]?_0x10449b[_0x4f33('0x34')]:_0x5035a2[_0x4f33('0x30')];if(!_0x3699fd[_0x4f33('0x32')][_0x4f33('0x37')](_0x4f33('0x38'))){_0x10449b[_0x4f33('0x1f')]=qs[_0x4f33('0x1f')](_0x3699fd['query'][_0x4f33('0x1f')]);_0x10449b[_0x4f33('0x1e')]=qs[_0x4f33('0x1e')](_0x3699fd[_0x4f33('0x32')]['offset']);}_0x10449b[_0x4f33('0x39')]=qs[_0x4f33('0x3a')](_0x3699fd[_0x4f33('0x32')][_0x4f33('0x3a')]);_0x10449b[_0x4f33('0x3b')]=qs[_0x4f33('0x33')](_[_0x4f33('0x3c')](_0x3699fd[_0x4f33('0x32')],_0x5035a2[_0x4f33('0x33')]));if(_0x3699fd['query'][_0x4f33('0x3d')]){_0x10449b['where']=_['merge'](_0x10449b[_0x4f33('0x3b')],{'$or':_[_0x4f33('0x31')](_0x3a4feb,function(_0x33710b){if(_0x33710b['type']!=='VIRTUAL'){var _0x57ea17={};_0x57ea17[_0x33710b[_0x4f33('0x2a')]]={'$like':'%'+_0x3699fd[_0x4f33('0x32')]['filter']+'%'};return _0x57ea17;}})});}_0x10449b=_['merge']({},_0x10449b,_0x3699fd[_0x4f33('0x3e')]);var _0x29901f={'where':_0x10449b[_0x4f33('0x3b')]};return db[_0x4f33('0x3f')][_0x4f33('0x1d')](_0x29901f)['then'](function(_0x565a93){_0x2fa732['count']=_0x565a93;if(_0x3699fd[_0x4f33('0x32')][_0x4f33('0x40')]){_0x10449b['include']=[{'all':!![]}];}return db['SugarcrmField'][_0x4f33('0x41')](_0x10449b);})['then'](function(_0xf06506){_0x2fa732[_0x4f33('0x42')]=_0xf06506;return _0x2fa732;})['then'](respondWithFilteredResult(_0x24f34e,_0x10449b))[_0x4f33('0x43')](handleError(_0x24f34e,null));};exports[_0x4f33('0x44')]=function(_0x4ccdc9,_0x640257){var _0x5142fe={'raw':!![],'where':{'id':_0x4ccdc9[_0x4f33('0x45')]['id']}},_0x4c2413={};_0x4c2413[_0x4f33('0x30')]=_[_0x4f33('0x46')](db[_0x4f33('0x3f')][_0x4f33('0x2c')]);_0x4c2413[_0x4f33('0x32')]=_['keys'](_0x4ccdc9[_0x4f33('0x32')]);_0x4c2413[_0x4f33('0x33')]=_['intersection'](_0x4c2413[_0x4f33('0x30')],_0x4c2413[_0x4f33('0x32')]);_0x5142fe[_0x4f33('0x34')]=_[_0x4f33('0x47')](_0x4c2413[_0x4f33('0x30')],qs['fields'](_0x4ccdc9[_0x4f33('0x32')][_0x4f33('0x35')]));_0x5142fe['attributes']=_0x5142fe[_0x4f33('0x34')][_0x4f33('0x36')]?_0x5142fe[_0x4f33('0x34')]:_0x4c2413[_0x4f33('0x30')];if(_0x4ccdc9[_0x4f33('0x32')][_0x4f33('0x40')]){_0x5142fe[_0x4f33('0x48')]=[{'all':!![]}];}_0x5142fe=_[_0x4f33('0x49')]({},_0x5142fe,_0x4ccdc9[_0x4f33('0x3e')]);return db[_0x4f33('0x3f')][_0x4f33('0x4a')](_0x5142fe)[_0x4f33('0x27')](handleEntityNotFound(_0x640257,null))[_0x4f33('0x27')](respondWithResult(_0x640257,null))[_0x4f33('0x43')](handleError(_0x640257,null));};exports[_0x4f33('0x4b')]=function(_0x204a5f,_0x30cebd){return db[_0x4f33('0x3f')][_0x4f33('0x4b')](_0x204a5f[_0x4f33('0x4c')],{})[_0x4f33('0x27')](respondWithResult(_0x30cebd,0xc9))[_0x4f33('0x43')](handleError(_0x30cebd,null));};exports[_0x4f33('0x26')]=function(_0x3b11d2,_0x3bd878){if(_0x3b11d2[_0x4f33('0x4c')]['id']){delete _0x3b11d2[_0x4f33('0x4c')]['id'];}return db[_0x4f33('0x3f')][_0x4f33('0x4a')]({'where':{'id':_0x3b11d2[_0x4f33('0x45')]['id']}})['then'](handleEntityNotFound(_0x3bd878,null))[_0x4f33('0x27')](saveUpdates(_0x3b11d2[_0x4f33('0x4c')],null))['then'](respondWithResult(_0x3bd878,null))[_0x4f33('0x43')](handleError(_0x3bd878,null));};exports[_0x4f33('0x28')]=function(_0xa811db,_0x3768f7){return db[_0x4f33('0x3f')][_0x4f33('0x4a')]({'where':{'id':_0xa811db[_0x4f33('0x45')]['id']}})[_0x4f33('0x27')](handleEntityNotFound(_0x3768f7,null))[_0x4f33('0x27')](removeEntity(_0x3768f7,null))[_0x4f33('0x43')](handleError(_0x3768f7,null));}; \ No newline at end of file +var _0x1ffa=['error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus'];(function(_0x3297b8,_0x17ce35){var _0x2066de=function(_0x4750c3){while(--_0x4750c3){_0x3297b8['push'](_0x3297b8['shift']());}};_0x2066de(++_0x17ce35);}(_0x1ffa,0x101));var _0xa1ff=function(_0x3d823b,_0x245c0d){_0x3d823b=_0x3d823b-0x0;var _0x1c23cd=_0x1ffa[_0x3d823b];return _0x1c23cd;};'use strict';var pdf=require(_0xa1ff('0x0'));var emlformat=require(_0xa1ff('0x1'));var rimraf=require(_0xa1ff('0x2'));var zipdir=require(_0xa1ff('0x3'));var jsonpatch=require(_0xa1ff('0x4'));var rp=require(_0xa1ff('0x5'));var moment=require(_0xa1ff('0x6'));var BPromise=require(_0xa1ff('0x7'));var Mustache=require(_0xa1ff('0x8'));var util=require(_0xa1ff('0x9'));var path=require(_0xa1ff('0xa'));var sox=require('sox');var csv=require(_0xa1ff('0xb'));var ejs=require(_0xa1ff('0xc'));var fs=require('fs');var _=require(_0xa1ff('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa1ff('0xe'));var toCsv=require(_0xa1ff('0xb'));var querystring=require(_0xa1ff('0xf'));var Papa=require(_0xa1ff('0x10'));var Redis=require(_0xa1ff('0x11'));var authService=require(_0xa1ff('0x12'));var qs=require(_0xa1ff('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1ff('0x14'));var logger=require(_0xa1ff('0x15'))(_0xa1ff('0x16'));var utils=require(_0xa1ff('0x17'));var config=require('../../config/environment');var db=require(_0xa1ff('0x18'))['db'];function respondWithStatusCode(_0x2a28ea,_0x4e050e){_0x4e050e=_0x4e050e||0xcc;return function(_0x118a46){if(_0x118a46){return _0x2a28ea['sendStatus'](_0x4e050e);}return _0x2a28ea['status'](_0x4e050e)[_0xa1ff('0x19')]();};}function respondWithResult(_0x19357c,_0x55d494){_0x55d494=_0x55d494||0xc8;return function(_0x5900a7){if(_0x5900a7){return _0x19357c[_0xa1ff('0x1a')](_0x55d494)[_0xa1ff('0x1b')](_0x5900a7);}};}function respondWithFilteredResult(_0x3971b4,_0x81c7d8){return function(_0x51f0a0){if(_0x51f0a0){var _0x3fbfb1=_0x51f0a0[_0xa1ff('0x1c')],_0x211e43=_0x81c7d8['offset'],_0x22b9e5=_0x81c7d8[_0xa1ff('0x1d')]+_0x81c7d8['limit'],_0x59ae03;if(_0x22b9e5>=_0x3fbfb1){_0x22b9e5=_0x3fbfb1;_0x59ae03=0xc8;}else{_0x59ae03=0xce;}_0x3971b4[_0xa1ff('0x1a')](_0x59ae03);return _0x3971b4[_0xa1ff('0x1e')](_0xa1ff('0x1f'),_0x211e43+'-'+_0x22b9e5+'/'+_0x3fbfb1)[_0xa1ff('0x1b')](_0x51f0a0);}return null;};}function patchUpdates(_0x29ce82){return function(_0x4bd0ff){try{jsonpatch[_0xa1ff('0x20')](_0x4bd0ff,_0x29ce82,!![]);}catch(_0x4f1941){return BPromise[_0xa1ff('0x21')](_0x4f1941);}return _0x4bd0ff[_0xa1ff('0x22')]();};}function saveUpdates(_0x5a7c1c,_0x3f2cf3){return function(_0x2f68c6){if(_0x2f68c6){return _0x2f68c6[_0xa1ff('0x23')](_0x5a7c1c)['then'](function(_0x55b38a){return _0x55b38a;});}return null;};}function removeEntity(_0x4815c7,_0x13f721){return function(_0x48475b){if(_0x48475b){return _0x48475b[_0xa1ff('0x24')]()[_0xa1ff('0x25')](function(){_0x4815c7[_0xa1ff('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c6647,_0x23e3c6){return function(_0x4b29d8){if(!_0x4b29d8){_0x4c6647[_0xa1ff('0x26')](0x194);}return _0x4b29d8;};}function handleError(_0x39678a,_0x47db35){_0x47db35=_0x47db35||0x1f4;return function(_0x2f24bb){logger[_0xa1ff('0x27')](_0x2f24bb[_0xa1ff('0x28')]);if(_0x2f24bb[_0xa1ff('0x29')]){delete _0x2f24bb[_0xa1ff('0x29')];}_0x39678a[_0xa1ff('0x1a')](_0x47db35)['send'](_0x2f24bb);};}exports[_0xa1ff('0x2a')]=function(_0x28935d,_0x8d6c85){var _0x1b7372={},_0x3f50b9={},_0x5e904b={'count':0x0,'rows':[]};var _0x2e1e6d=_[_0xa1ff('0x2b')](db[_0xa1ff('0x2c')][_0xa1ff('0x2d')],function(_0x3a39be){return{'name':_0x3a39be[_0xa1ff('0x2e')],'type':_0x3a39be[_0xa1ff('0x2f')][_0xa1ff('0x30')]};});_0x3f50b9['model']=_[_0xa1ff('0x2b')](_0x2e1e6d,_0xa1ff('0x29'));_0x3f50b9[_0xa1ff('0x31')]=_['keys'](_0x28935d[_0xa1ff('0x31')]);_0x3f50b9[_0xa1ff('0x32')]=_['intersection'](_0x3f50b9[_0xa1ff('0x33')],_0x3f50b9[_0xa1ff('0x31')]);_0x1b7372[_0xa1ff('0x34')]=_[_0xa1ff('0x35')](_0x3f50b9[_0xa1ff('0x33')],qs[_0xa1ff('0x36')](_0x28935d[_0xa1ff('0x31')]['fields']));_0x1b7372[_0xa1ff('0x34')]=_0x1b7372[_0xa1ff('0x34')]['length']?_0x1b7372[_0xa1ff('0x34')]:_0x3f50b9[_0xa1ff('0x33')];if(!_0x28935d[_0xa1ff('0x31')]['hasOwnProperty'](_0xa1ff('0x37'))){_0x1b7372[_0xa1ff('0x38')]=qs['limit'](_0x28935d['query']['limit']);_0x1b7372['offset']=qs['offset'](_0x28935d['query'][_0xa1ff('0x1d')]);}_0x1b7372[_0xa1ff('0x39')]=qs[_0xa1ff('0x3a')](_0x28935d[_0xa1ff('0x31')]['sort']);_0x1b7372[_0xa1ff('0x3b')]=qs[_0xa1ff('0x32')](_['pick'](_0x28935d[_0xa1ff('0x31')],_0x3f50b9['filters']));if(_0x28935d[_0xa1ff('0x31')][_0xa1ff('0x3c')]){_0x1b7372[_0xa1ff('0x3b')]=_[_0xa1ff('0x3d')](_0x1b7372[_0xa1ff('0x3b')],{'$or':_[_0xa1ff('0x2b')](_0x2e1e6d,function(_0x210845){if(_0x210845[_0xa1ff('0x2f')]!==_0xa1ff('0x3e')){var _0xd9cd07={};_0xd9cd07[_0x210845[_0xa1ff('0x29')]]={'$like':'%'+_0x28935d['query'][_0xa1ff('0x3c')]+'%'};return _0xd9cd07;}})});}_0x1b7372=_[_0xa1ff('0x3d')]({},_0x1b7372,_0x28935d[_0xa1ff('0x3f')]);var _0xd1c3ea={'where':_0x1b7372[_0xa1ff('0x3b')]};return db['SugarcrmField'][_0xa1ff('0x1c')](_0xd1c3ea)[_0xa1ff('0x25')](function(_0x58c4f5){_0x5e904b[_0xa1ff('0x1c')]=_0x58c4f5;if(_0x28935d['query'][_0xa1ff('0x40')]){_0x1b7372[_0xa1ff('0x41')]=[{'all':!![]}];}return db[_0xa1ff('0x2c')][_0xa1ff('0x42')](_0x1b7372);})[_0xa1ff('0x25')](function(_0x1a9aeb){_0x5e904b[_0xa1ff('0x43')]=_0x1a9aeb;return _0x5e904b;})['then'](respondWithFilteredResult(_0x8d6c85,_0x1b7372))[_0xa1ff('0x44')](handleError(_0x8d6c85,null));};exports[_0xa1ff('0x45')]=function(_0x18291e,_0x319b4d){var _0x2df09e={'raw':!![],'where':{'id':_0x18291e['params']['id']}},_0x30b838={};_0x30b838[_0xa1ff('0x33')]=_['keys'](db[_0xa1ff('0x2c')]['rawAttributes']);_0x30b838[_0xa1ff('0x31')]=_['keys'](_0x18291e[_0xa1ff('0x31')]);_0x30b838[_0xa1ff('0x32')]=_['intersection'](_0x30b838['model'],_0x30b838[_0xa1ff('0x31')]);_0x2df09e[_0xa1ff('0x34')]=_[_0xa1ff('0x35')](_0x30b838[_0xa1ff('0x33')],qs[_0xa1ff('0x36')](_0x18291e['query'][_0xa1ff('0x36')]));_0x2df09e[_0xa1ff('0x34')]=_0x2df09e[_0xa1ff('0x34')]['length']?_0x2df09e[_0xa1ff('0x34')]:_0x30b838['model'];if(_0x18291e[_0xa1ff('0x31')][_0xa1ff('0x40')]){_0x2df09e['include']=[{'all':!![]}];}_0x2df09e=_[_0xa1ff('0x3d')]({},_0x2df09e,_0x18291e[_0xa1ff('0x3f')]);return db[_0xa1ff('0x2c')][_0xa1ff('0x46')](_0x2df09e)[_0xa1ff('0x25')](handleEntityNotFound(_0x319b4d,null))['then'](respondWithResult(_0x319b4d,null))[_0xa1ff('0x44')](handleError(_0x319b4d,null));};exports['create']=function(_0x1366d7,_0x3620d7){return db[_0xa1ff('0x2c')][_0xa1ff('0x47')](_0x1366d7[_0xa1ff('0x48')],{})[_0xa1ff('0x25')](respondWithResult(_0x3620d7,0xc9))[_0xa1ff('0x44')](handleError(_0x3620d7,null));};exports[_0xa1ff('0x23')]=function(_0x5eca7f,_0x3796cc){if(_0x5eca7f[_0xa1ff('0x48')]['id']){delete _0x5eca7f['body']['id'];}return db[_0xa1ff('0x2c')][_0xa1ff('0x46')]({'where':{'id':_0x5eca7f[_0xa1ff('0x49')]['id']}})[_0xa1ff('0x25')](handleEntityNotFound(_0x3796cc,null))['then'](saveUpdates(_0x5eca7f[_0xa1ff('0x48')],null))[_0xa1ff('0x25')](respondWithResult(_0x3796cc,null))[_0xa1ff('0x44')](handleError(_0x3796cc,null));};exports[_0xa1ff('0x24')]=function(_0x1dad95,_0x32d43f){return db[_0xa1ff('0x2c')][_0xa1ff('0x46')]({'where':{'id':_0x1dad95[_0xa1ff('0x49')]['id']}})['then'](handleEntityNotFound(_0x32d43f,null))[_0xa1ff('0x25')](removeEntity(_0x32d43f,null))[_0xa1ff('0x44')](handleError(_0x32d43f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index ca5fc00..bebc389 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 _0xfab3=['../../config/environment','./intSugarcrmField.attributes','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b036a,_0x32957c){var _0x4cbb11=function(_0x2378d3){while(--_0x2378d3){_0x4b036a['push'](_0x4b036a['shift']());}};_0x4cbb11(++_0x32957c);}(_0xfab3,0x93));var _0x3fab=function(_0x41a61e,_0xefa409){_0x41a61e=_0x41a61e-0x0;var _0x530384=_0xfab3[_0x41a61e];return _0x530384;};'use strict';var _=require(_0x3fab('0x0'));var util=require(_0x3fab('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3fab('0x2'));var BPromise=require(_0x3fab('0x3'));var rp=require(_0x3fab('0x4'));var fs=require('fs');var path=require(_0x3fab('0x5'));var rimraf=require(_0x3fab('0x6'));var config=require(_0x3fab('0x7'));var attributes=require(_0x3fab('0x8'));module['exports']=function(_0x1fbcc8,_0xffc5ae){return _0x1fbcc8[_0x3fab('0x9')]('SugarcrmField',attributes,{'tableName':_0x3fab('0xa'),'paranoid':![],'indexes':[{'name':_0x3fab('0xb'),'fields':[_0x3fab('0xc'),_0x3fab('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb051=['exports','define','SugarcrmField','int_sugarcrm_fields','idField','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes'];(function(_0x3d78ed,_0x46ee9c){var _0x19d87d=function(_0x2c232d){while(--_0x2c232d){_0x3d78ed['push'](_0x3d78ed['shift']());}};_0x19d87d(++_0x46ee9c);}(_0xb051,0x155));var _0x1b05=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xb051[_0x2f45ea];return _0x485a84;};'use strict';var _=require(_0x1b05('0x0'));var util=require(_0x1b05('0x1'));var logger=require('../../config/logger')(_0x1b05('0x2'));var moment=require(_0x1b05('0x3'));var BPromise=require(_0x1b05('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b05('0x5'));var rimraf=require(_0x1b05('0x6'));var config=require(_0x1b05('0x7'));var attributes=require(_0x1b05('0x8'));module[_0x1b05('0x9')]=function(_0x57ee0e,_0x1b797e){return _0x57ee0e[_0x1b05('0xa')](_0x1b05('0xb'),attributes,{'tableName':_0x1b05('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x1b05('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index a435b98..ea363bf 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 _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SugarcrmField,\x20%s,\x20%s','message','catch','lodash'];(function(_0x2d2f06,_0x13b10d){var _0x1f8407=function(_0x14bc15){while(--_0x14bc15){_0x2d2f06['push'](_0x2d2f06['shift']());}};_0x1f8407(++_0x13b10d);}(_0x66fa,0x117));var _0xa66f=function(_0x2cfe00,_0x4a7212){_0x2cfe00=_0x2cfe00-0x0;var _0x2908ae=_0x66fa[_0x2cfe00];return _0x2908ae;};'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')]('SugarcrmField,\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')]('SugarcrmField,\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 +var _0xbaf0=['client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5528c3,_0x35a416){var _0x47ec1b=function(_0x54a18e){while(--_0x54a18e){_0x5528c3['push'](_0x5528c3['shift']());}};_0x47ec1b(++_0x35a416);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'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')]('SugarcrmField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 9d3c7e8..08b55e2 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 _0xdd32=['multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','delete','destroy','exports'];(function(_0x59d51e,_0x2d4868){var _0x1c4f5b=function(_0x4b67ad){while(--_0x4b67ad){_0x59d51e['push'](_0x59d51e['shift']());}};_0x1c4f5b(++_0x2d4868);}(_0xdd32,0x114));var _0x2dd3=function(_0x2f2371,_0xce6282){_0x2f2371=_0x2f2371-0x0;var _0x40a09e=_0xdd32[_0x2f2371];return _0x40a09e;};'use strict';var multer=require(_0x2dd3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2dd3('0x1'));var express=require(_0x2dd3('0x2'));var router=express[_0x2dd3('0x3')]();var auth=require(_0x2dd3('0x4'));var interaction=require(_0x2dd3('0x5'));var config=require('../../config/environment');var controller=require(_0x2dd3('0x6'));router[_0x2dd3('0x7')]('/',auth['isAuthenticated'](),controller[_0x2dd3('0x8')]);router[_0x2dd3('0x7')](_0x2dd3('0x9'),auth['isAuthenticated'](),controller[_0x2dd3('0xa')]);router[_0x2dd3('0x7')](_0x2dd3('0xb'),auth['isAuthenticated'](),controller[_0x2dd3('0xc')]);router[_0x2dd3('0x7')](_0x2dd3('0xd'),auth[_0x2dd3('0xe')](),controller[_0x2dd3('0xf')]);router[_0x2dd3('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x2dd3('0xb'),auth[_0x2dd3('0xe')](),controller[_0x2dd3('0x11')]);router[_0x2dd3('0x12')](_0x2dd3('0x9'),auth['isAuthenticated'](),controller[_0x2dd3('0x13')]);router[_0x2dd3('0x14')](_0x2dd3('0x9'),auth[_0x2dd3('0xe')](),controller[_0x2dd3('0x15')]);module[_0x2dd3('0x16')]=router; \ No newline at end of file +var _0xd971=['create','addConfiguration','update','destroy','exports','util','connect-timeout','express','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','post'];(function(_0x1e80d6,_0x2cac6d){var _0xaabe7a=function(_0x5123fa){while(--_0x5123fa){_0x1e80d6['push'](_0x1e80d6['shift']());}};_0xaabe7a(++_0x2cac6d);}(_0xd971,0x71));var _0x1d97=function(_0x5a123f,_0x14cb93){_0x5a123f=_0x5a123f-0x0;var _0x40f3e8=_0xd971[_0x5a123f];return _0x40f3e8;};'use strict';var multer=require('multer');var util=require(_0x1d97('0x0'));var path=require('path');var timeout=require(_0x1d97('0x1'));var express=require(_0x1d97('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1d97('0x3'));var config=require('../../config/environment');var controller=require(_0x1d97('0x4'));router['get']('/',auth[_0x1d97('0x5')](),controller[_0x1d97('0x6')]);router[_0x1d97('0x7')](_0x1d97('0x8'),auth['isAuthenticated'](),controller[_0x1d97('0x9')]);router['get'](_0x1d97('0xa'),auth[_0x1d97('0x5')](),controller[_0x1d97('0xb')]);router['get']('/:id/fields',auth[_0x1d97('0x5')](),controller['getFields']);router[_0x1d97('0xc')]('/',auth[_0x1d97('0x5')](),controller[_0x1d97('0xd')]);router[_0x1d97('0xc')](_0x1d97('0xa'),auth[_0x1d97('0x5')](),controller[_0x1d97('0xe')]);router['put'](_0x1d97('0x8'),auth[_0x1d97('0x5')](),controller[_0x1d97('0xf')]);router['delete'](_0x1d97('0x8'),auth[_0x1d97('0x5')](),controller[_0x1d97('0x10')]);module[_0x1d97('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index bee3afc..2b03d1c 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 _0x9b4c=['exports','STRING','HelpDesk'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x9b4c,0x1c8));var _0xc9b4=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x9b4c[_0x3a73bc];return _0x32891b;};'use strict';var Sequelize=require('sequelize');module[_0xc9b4('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc9b4('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xc9b4('0x1')],'allowNull':![],'defaultValue':_0xc9b4('0x2')},'remoteUri':{'type':Sequelize[_0xc9b4('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0xc9b4('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x300f=['STRING','HelpDesk','sequelize'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x300f,0x176));var _0xf300=function(_0x5ba6c4,_0x100ab5){_0x5ba6c4=_0x5ba6c4-0x0;var _0x11f1f0=_0x300f[_0x5ba6c4];return _0x11f1f0;};'use strict';var Sequelize=require(_0xf300('0x0'));module['exports']={'name':{'type':Sequelize[_0xf300('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf300('0x1')]},'username':{'type':Sequelize[_0xf300('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf300('0x1')],'allowNull':![],'defaultValue':_0xf300('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf300('0x1')]},'accessKey':{'type':Sequelize[_0xf300('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 1c28737..afc67da 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 _0x022a=['../../config/environment','../../mysqldb','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','end','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','VtigerAccount','include','findAll','rows','show','params','create','body','find','destroy','getConfigurations','findOne','VtigerConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','username','description','moduleName','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','GET','POST','token','success','describe','autogenerated','owner','remove','includes','editable','false','label','startsWith','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x487cb0,_0x339d3e){var _0x5a8047=function(_0x2804a3){while(--_0x2804a3){_0x487cb0['push'](_0x487cb0['shift']());}};_0x5a8047(++_0x339d3e);}(_0x022a,0x1f0));var _0xa022=function(_0x45fbc7,_0x2cf50d){_0x45fbc7=_0x45fbc7-0x0;var _0x392cfd=_0x022a[_0x45fbc7];return _0x392cfd;};'use strict';var pdf=require(_0xa022('0x0'));var emlformat=require(_0xa022('0x1'));var rimraf=require(_0xa022('0x2'));var zipdir=require(_0xa022('0x3'));var jsonpatch=require(_0xa022('0x4'));var rp=require(_0xa022('0x5'));var moment=require(_0xa022('0x6'));var BPromise=require(_0xa022('0x7'));var Mustache=require(_0xa022('0x8'));var util=require(_0xa022('0x9'));var path=require(_0xa022('0xa'));var sox=require(_0xa022('0xb'));var csv=require('to-csv');var ejs=require(_0xa022('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa022('0xd'));var jsforce=require(_0xa022('0xe'));var deskjs=require(_0xa022('0xf'));var toCsv=require(_0xa022('0x10'));var querystring=require(_0xa022('0x11'));var Papa=require(_0xa022('0x12'));var Redis=require(_0xa022('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa022('0x14'));var as=require(_0xa022('0x15'));var hardwareService=require(_0xa022('0x16'));var logger=require('../../config/logger')(_0xa022('0x17'));var utils=require('../../config/utils');var config=require(_0xa022('0x18'));var db=require(_0xa022('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xa022('0x1a')][_0xa022('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x45b9e6,_0x22f475,_0x5ea1ff){if(_0x5ea1ff){var _0x51a098=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x51a098[_0xa022('0x1c')](_0x22f475)){return _0x45b9e6;}else{throw new db['Sequelize'][(_0xa022('0x1d'))](_0xa022('0x1e'));}}else{return _0x45b9e6;}}function respondWithRpcPromise(_0x34db44,_0x2bc4d6,_0x1fb150,_0x1a16a4){return new BPromise(function(_0x3dedef,_0x1e27d5){var _0xa084f=_0x1a16a4||client;return _0xa084f[_0xa022('0x1f')](_0x34db44,_0x1fb150)[_0xa022('0x20')](function(_0x24fde5){logger[_0xa022('0x21')](_0xa022('0x22'),_0x2bc4d6,'request\x20sent');logger[_0xa022('0x23')](_0xa022('0x24'),_0x2bc4d6,_0xa022('0x25'),JSON[_0xa022('0x26')](_0x24fde5));if(_0x24fde5[_0xa022('0x27')]){if(_0x24fde5[_0xa022('0x27')]['code']===0x1f4){logger[_0xa022('0x27')]('VtigerAccount,\x20%s,\x20%s',_0x2bc4d6,_0x24fde5['error'][_0xa022('0x28')]);return _0x1e27d5(_0x24fde5[_0xa022('0x27')]['message']);}logger[_0xa022('0x27')](_0xa022('0x22'),_0x2bc4d6,_0x24fde5[_0xa022('0x27')][_0xa022('0x28')]);return _0x3dedef(_0x24fde5['error']['message']);}else{logger[_0xa022('0x21')](_0xa022('0x22'),_0x2bc4d6,_0xa022('0x25'));_0x3dedef(_0x24fde5[_0xa022('0x29')][_0xa022('0x28')]);}})[_0xa022('0x2a')](function(_0x577a5d){logger[_0xa022('0x27')]('VtigerAccount,\x20%s,\x20%s',_0x2bc4d6,_0x577a5d);_0x1e27d5(_0x577a5d);});});}function respondWithStatusCode(_0xcfce3f,_0x5ce466){_0x5ce466=_0x5ce466||0xcc;return function(_0x1099f0){if(_0x1099f0){return _0xcfce3f[_0xa022('0x2b')](_0x5ce466);}return _0xcfce3f[_0xa022('0x2c')](_0x5ce466)['end']();};}function respondWithResult(_0x103fd6,_0x3afd27){_0x3afd27=_0x3afd27||0xc8;return function(_0x2fec7c){if(_0x2fec7c){return _0x103fd6[_0xa022('0x2c')](_0x3afd27)[_0xa022('0x2d')](_0x2fec7c);}};}function respondWithFilteredResult(_0x399b56,_0x3cc06d){return function(_0x2a6cb7){if(_0x2a6cb7){var _0x295cbc=_0x2a6cb7[_0xa022('0x2e')],_0x5f53c1=_0x3cc06d[_0xa022('0x2f')],_0x16df86=_0x3cc06d['offset']+_0x3cc06d[_0xa022('0x30')],_0x312e7b;if(_0x16df86>=_0x295cbc){_0x16df86=_0x295cbc;_0x312e7b=0xc8;}else{_0x312e7b=0xce;}_0x399b56[_0xa022('0x2c')](_0x312e7b);return _0x399b56['set'](_0xa022('0x31'),_0x5f53c1+'-'+_0x16df86+'/'+_0x295cbc)[_0xa022('0x2d')](_0x2a6cb7);}return null;};}function patchUpdates(_0x4fbb88){return function(_0x49db09){try{jsonpatch[_0xa022('0x32')](_0x49db09,_0x4fbb88,!![]);}catch(_0x461bda){return BPromise[_0xa022('0x33')](_0x461bda);}return _0x49db09['save']();};}function saveUpdates(_0x10103a,_0x413610){return function(_0x3f1027){if(_0x3f1027){return _0x3f1027[_0xa022('0x34')](_0x10103a)[_0xa022('0x20')](function(_0x21fb52){return _0x21fb52;});}return null;};}function removeEntity(_0x35c122,_0xd79c88){return function(_0x23ff60){if(_0x23ff60){return _0x23ff60['destroy']()['then'](function(){_0x35c122[_0xa022('0x2c')](0xcc)[_0xa022('0x35')]();});}};}function handleEntityNotFound(_0x7e13ad,_0x48be36){return function(_0x341692){if(!_0x341692){_0x7e13ad[_0xa022('0x2b')](0x194);}return _0x341692;};}function handleError(_0x44f4ee,_0x1300c3){_0x1300c3=_0x1300c3||0x1f4;return function(_0xb95f62){logger[_0xa022('0x27')](_0xb95f62[_0xa022('0x36')]);if(_0xb95f62[_0xa022('0x37')]){delete _0xb95f62[_0xa022('0x37')];}_0x44f4ee[_0xa022('0x2c')](_0x1300c3)[_0xa022('0x38')](_0xb95f62);};}exports['index']=function(_0x295d79,_0x301995){var _0x2b4fed={},_0x214fc4={},_0x274eed={'count':0x0,'rows':[]};var _0x5adfe6=_[_0xa022('0x39')](db['VtigerAccount'][_0xa022('0x3a')],function(_0xaacca4){return{'name':_0xaacca4['fieldName'],'type':_0xaacca4[_0xa022('0x3b')][_0xa022('0x3c')]};});_0x214fc4[_0xa022('0x3d')]=_[_0xa022('0x39')](_0x5adfe6,_0xa022('0x37'));_0x214fc4[_0xa022('0x3e')]=_[_0xa022('0x3f')](_0x295d79[_0xa022('0x3e')]);_0x214fc4[_0xa022('0x40')]=_[_0xa022('0x41')](_0x214fc4[_0xa022('0x3d')],_0x214fc4[_0xa022('0x3e')]);_0x2b4fed[_0xa022('0x42')]=_[_0xa022('0x41')](_0x214fc4[_0xa022('0x3d')],qs[_0xa022('0x43')](_0x295d79[_0xa022('0x3e')][_0xa022('0x43')]));_0x2b4fed[_0xa022('0x42')]=_0x2b4fed[_0xa022('0x42')][_0xa022('0x44')]?_0x2b4fed[_0xa022('0x42')]:_0x214fc4[_0xa022('0x3d')];if(!_0x295d79[_0xa022('0x3e')][_0xa022('0x45')](_0xa022('0x46'))){_0x2b4fed[_0xa022('0x30')]=qs[_0xa022('0x30')](_0x295d79[_0xa022('0x3e')][_0xa022('0x30')]);_0x2b4fed[_0xa022('0x2f')]=qs[_0xa022('0x2f')](_0x295d79[_0xa022('0x3e')][_0xa022('0x2f')]);}_0x2b4fed[_0xa022('0x47')]=qs[_0xa022('0x48')](_0x295d79['query'][_0xa022('0x48')]);_0x2b4fed['where']=qs[_0xa022('0x40')](_[_0xa022('0x49')](_0x295d79[_0xa022('0x3e')],_0x214fc4[_0xa022('0x40')]));if(_0x295d79[_0xa022('0x3e')][_0xa022('0x4a')]){_0x2b4fed[_0xa022('0x4b')]=_['merge'](_0x2b4fed['where'],{'$or':_['map'](_0x5adfe6,function(_0x49aeeb){if(_0x49aeeb['type']!=='VIRTUAL'){var _0x2d13a1={};_0x2d13a1[_0x49aeeb[_0xa022('0x37')]]={'$like':'%'+_0x295d79[_0xa022('0x3e')][_0xa022('0x4a')]+'%'};return _0x2d13a1;}})});}_0x2b4fed=_[_0xa022('0x4c')]({},_0x2b4fed,_0x295d79[_0xa022('0x4d')]);var _0xfa1de1={'where':_0x2b4fed[_0xa022('0x4b')]};return db[_0xa022('0x4e')][_0xa022('0x2e')](_0xfa1de1)[_0xa022('0x20')](function(_0x6cf3ca){_0x274eed[_0xa022('0x2e')]=_0x6cf3ca;if(_0x295d79[_0xa022('0x3e')]['includeAll']){_0x2b4fed[_0xa022('0x4f')]=[{'all':!![]}];}return db[_0xa022('0x4e')][_0xa022('0x50')](_0x2b4fed);})[_0xa022('0x20')](function(_0x1d834b){_0x274eed[_0xa022('0x51')]=_0x1d834b;return _0x274eed;})['then'](respondWithFilteredResult(_0x301995,_0x2b4fed))['catch'](handleError(_0x301995,null));};exports[_0xa022('0x52')]=function(_0xffd646,_0x298dfe){var _0x5b82c2={'raw':![],'where':{'id':_0xffd646[_0xa022('0x53')]['id']}},_0x4568db={};_0x4568db[_0xa022('0x3d')]=_[_0xa022('0x3f')](db[_0xa022('0x4e')]['rawAttributes']);_0x4568db['query']=_[_0xa022('0x3f')](_0xffd646[_0xa022('0x3e')]);_0x4568db[_0xa022('0x40')]=_[_0xa022('0x41')](_0x4568db['model'],_0x4568db[_0xa022('0x3e')]);_0x5b82c2[_0xa022('0x42')]=_['intersection'](_0x4568db['model'],qs[_0xa022('0x43')](_0xffd646[_0xa022('0x3e')][_0xa022('0x43')]));_0x5b82c2[_0xa022('0x42')]=_0x5b82c2[_0xa022('0x42')][_0xa022('0x44')]?_0x5b82c2['attributes']:_0x4568db[_0xa022('0x3d')];if(_0xffd646[_0xa022('0x3e')]['includeAll']){_0x5b82c2[_0xa022('0x4f')]=[{'all':!![]}];}_0x5b82c2=_[_0xa022('0x4c')]({},_0x5b82c2,_0xffd646[_0xa022('0x4d')]);return db[_0xa022('0x4e')]['find'](_0x5b82c2)[_0xa022('0x20')](handleEntityNotFound(_0x298dfe,null))[_0xa022('0x20')](respondWithResult(_0x298dfe,null))[_0xa022('0x2a')](handleError(_0x298dfe,null));};exports[_0xa022('0x54')]=function(_0x22dea0,_0x48fc67){return db[_0xa022('0x4e')][_0xa022('0x54')](_0x22dea0[_0xa022('0x55')],{})[_0xa022('0x20')](respondWithResult(_0x48fc67,0xc9))[_0xa022('0x2a')](handleError(_0x48fc67,null));};exports[_0xa022('0x34')]=function(_0x3ed5ef,_0x464016){if(_0x3ed5ef[_0xa022('0x55')]['id']){delete _0x3ed5ef[_0xa022('0x55')]['id'];}return db['VtigerAccount'][_0xa022('0x56')]({'where':{'id':_0x3ed5ef[_0xa022('0x53')]['id']}})['then'](handleEntityNotFound(_0x464016,null))[_0xa022('0x20')](saveUpdates(_0x3ed5ef[_0xa022('0x55')],null))[_0xa022('0x20')](respondWithResult(_0x464016,null))[_0xa022('0x2a')](handleError(_0x464016,null));};exports[_0xa022('0x57')]=function(_0x528f73,_0x5de550){return db[_0xa022('0x4e')][_0xa022('0x56')]({'where':{'id':_0x528f73['params']['id']}})[_0xa022('0x20')](handleEntityNotFound(_0x5de550,null))['then'](removeEntity(_0x5de550,null))[_0xa022('0x2a')](handleError(_0x5de550,null));};exports[_0xa022('0x58')]=function(_0x28a83c,_0x4fda2e,_0xb6aa82){var _0xbd1b92={};var _0x839b0c={};var _0x4ea4e7;var _0x5b5c46;return db['VtigerAccount'][_0xa022('0x59')]({'where':{'id':_0x28a83c[_0xa022('0x53')]['id']}})['then'](handleEntityNotFound(_0x4fda2e,null))[_0xa022('0x20')](function(_0x2895b5){if(_0x2895b5){_0x4ea4e7=_0x2895b5;_0x839b0c[_0xa022('0x3d')]=_[_0xa022('0x3f')](db[_0xa022('0x5a')][_0xa022('0x3a')]);_0x839b0c[_0xa022('0x3e')]=_[_0xa022('0x3f')](_0x28a83c[_0xa022('0x3e')]);_0x839b0c[_0xa022('0x40')]=_[_0xa022('0x41')](_0x839b0c['model'],_0x839b0c[_0xa022('0x3e')]);_0xbd1b92[_0xa022('0x42')]=_[_0xa022('0x41')](_0x839b0c[_0xa022('0x3d')],qs[_0xa022('0x43')](_0x28a83c['query']['fields']));_0xbd1b92[_0xa022('0x42')]=_0xbd1b92[_0xa022('0x42')][_0xa022('0x44')]?_0xbd1b92[_0xa022('0x42')]:_0x839b0c['model'];_0xbd1b92[_0xa022('0x47')]=qs['sort'](_0x28a83c[_0xa022('0x3e')]['sort']);_0xbd1b92[_0xa022('0x4b')]=qs[_0xa022('0x40')](_[_0xa022('0x49')](_0x28a83c[_0xa022('0x3e')],_0x839b0c[_0xa022('0x40')]));if(_0x28a83c[_0xa022('0x3e')][_0xa022('0x4a')]){_0xbd1b92[_0xa022('0x4b')]=_[_0xa022('0x4c')](_0xbd1b92[_0xa022('0x4b')],{'$or':_[_0xa022('0x39')](_0xbd1b92[_0xa022('0x42')],function(_0x32f4aa){var _0x3cdde7={};_0x3cdde7[_0x32f4aa]={'$like':'%'+_0x28a83c[_0xa022('0x3e')][_0xa022('0x4a')]+'%'};return _0x3cdde7;})});}_0xbd1b92=_[_0xa022('0x4c')]({},_0xbd1b92,_0x28a83c[_0xa022('0x4d')]);return _0x4ea4e7[_0xa022('0x58')](_0xbd1b92);}})[_0xa022('0x20')](function(_0x3d950d){if(_0x3d950d){_0x5b5c46=_0x3d950d[_0xa022('0x44')];if(!_0x28a83c[_0xa022('0x3e')][_0xa022('0x45')](_0xa022('0x46'))){_0xbd1b92[_0xa022('0x30')]=qs[_0xa022('0x30')](_0x28a83c[_0xa022('0x3e')]['limit']);_0xbd1b92[_0xa022('0x2f')]=qs['offset'](_0x28a83c[_0xa022('0x3e')][_0xa022('0x2f')]);}return _0x4ea4e7[_0xa022('0x58')](_0xbd1b92);}})[_0xa022('0x20')](function(_0x3194fd){if(_0x3194fd){return _0x3194fd?{'count':_0x5b5c46,'rows':_0x3194fd}:null;}})['then'](respondWithResult(_0x4fda2e,null))['catch'](handleError(_0x4fda2e,null));};exports['addConfiguration']=function(_0x9f6a23,_0x5cd599,_0x5332f2){if(_0x9f6a23[_0xa022('0x55')]['id']){delete _0x9f6a23[_0xa022('0x55')]['id'];}return db[_0xa022('0x4e')][_0xa022('0x59')]({'where':{'id':_0x9f6a23['params']['id']}})[_0xa022('0x20')](handleEntityNotFound(_0x5cd599,null))['then'](function(_0x2cefa7){if(_0x2cefa7){_0x9f6a23['body'][_0xa022('0x5b')]=_0x2cefa7['id'];_0x9f6a23[_0xa022('0x55')][_0xa022('0x5c')]=integrations[_0xa022('0x5d')](_0x9f6a23['body']['channel'],_0x9f6a23[_0xa022('0x55')][_0xa022('0x3b')]);_0x9f6a23[_0xa022('0x55')][_0xa022('0x5e')]=integrations[_0xa022('0x5f')](_0x9f6a23[_0xa022('0x55')][_0xa022('0x60')],_0x9f6a23['body'][_0xa022('0x3b')]);return db['VtigerConfiguration'][_0xa022('0x54')](_0x9f6a23[_0xa022('0x55')],{'include':[{'model':db[_0xa022('0x61')],'as':_0xa022('0x5c')},{'model':db[_0xa022('0x61')],'as':_0xa022('0x5e')}]});}return null;})[_0xa022('0x20')](respondWithResult(_0x5cd599,null))[_0xa022('0x2a')](handleError(_0x5cd599,null));};var md5=require(_0xa022('0x62'));exports[_0xa022('0x63')]=function(_0x2129d4,_0x4ca104,_0x417ade){var _0x45fbbd=null;var _0x63e404=null;var _0x4a3117=null;var _0x2b9299=null;var _0x251cb8='';return db['VtigerAccount'][_0xa022('0x59')]({'where':{'id':_0x2129d4[_0xa022('0x53')]['id']},'attributes':['id','name',_0xa022('0x64'),_0xa022('0x65'),_0xa022('0x66'),'remoteUri',_0xa022('0x67'),'accessKey']})['then'](handleEntityNotFound(_0x4ca104,null))[_0xa022('0x20')](function(_0x58b42e){if(_0x58b42e){_0x45fbbd=_0x58b42e[_0xa022('0x64')];_0x63e404=_0x58b42e['accessKey'];_0x4a3117=_0x58b42e[_0xa022('0x66')];_0x251cb8=_0x58b42e[_0xa022('0x68')];var _0x521daa=_0x251cb8[_0xa022('0x69')](-0x1);if(_0x521daa==='/'){_0x251cb8=_0x251cb8[_0xa022('0x6a')](0x0,_0x251cb8[_0xa022('0x6b')](_0x521daa));}_0x2b9299=util[_0xa022('0x6c')](_0xa022('0x6d'),_0x251cb8);var _0x4728f8={'method':_0xa022('0x6e'),'uri':_0x2b9299,'qs':{'operation':'getchallenge','username':_0x58b42e[_0xa022('0x64')]},'json':!![]};return rp(_0x4728f8);}})[_0xa022('0x20')](function(_0x241f7c){if(_0x241f7c['success']){var _0x1d2729={'method':_0xa022('0x6f'),'uri':_0x2b9299,'form':{'operation':'login','username':_0x45fbbd,'accessKey':md5(_0x241f7c[_0xa022('0x29')][_0xa022('0x70')]+_0x63e404)},'json':!![]};return rp(_0x1d2729);}})[_0xa022('0x20')](function(_0x184ef2){if(_0x184ef2[_0xa022('0x71')]){var _0x70c602={'method':'GET','uri':_0x2b9299,'qs':{'operation':_0xa022('0x72'),'username':_0x45fbbd,'sessionName':_0x184ef2['result']['sessionName'],'elementType':_0x4a3117},'json':!![]};return rp(_0x70c602);}})[_0xa022('0x20')](function(_0x11b2ab){if(_0x11b2ab[_0xa022('0x71')]){var _0x25d5b5=[_0xa022('0x73'),'reference',_0xa022('0x74')];_[_0xa022('0x75')](_0x11b2ab[_0xa022('0x29')][_0xa022('0x43')],function(_0x428072){return _0x25d5b5[_0xa022('0x76')](_0x428072[_0xa022('0x3b')][_0xa022('0x37')]);});_[_0xa022('0x75')](_0x11b2ab['result'][_0xa022('0x43')],function(_0x48888f){return _0x48888f[_0xa022('0x77')]===_0xa022('0x78');});return{'count':_0x11b2ab['result'][_0xa022('0x43')][_0xa022('0x44')],'rows':_[_0xa022('0x39')](_0x11b2ab[_0xa022('0x29')]['fields'],function(_0x49d381){return{'id':_0x49d381[_0xa022('0x37')],'name':_0x49d381[_0xa022('0x79')],'custom':_[_0xa022('0x7a')](_0x49d381[_0xa022('0x37')],'cf_')?!![]:![],'options':_0x49d381['type'][_0xa022('0x37')]==='picklist'&&_0x49d381[_0xa022('0x3b')][_0xa022('0x7b')][_0xa022('0x44')]>0x0?_[_0xa022('0x39')](_0x49d381['type']['picklistValues'],function(_0x42d760){return{'name':_0x42d760[_0xa022('0x79')],'value':_0x42d760[_0xa022('0x7c')]};}):[]};})};}})[_0xa022('0x20')](respondWithResult(_0x4ca104,null))[_0xa022('0x2a')](function(_0x5df2c8){console[_0xa022('0x7d')](_0xa022('0x7e')+_0x5df2c8);var _0x32fb80=_0x2129d4[_0xa022('0x3e')][_0xa022('0x1c')]?0x1f4:_0x5df2c8[_0xa022('0x7f')]||0x1f4;logger[_0xa022('0x27')](_0xa022('0x80'),_0xa022('0x63'),_0x32fb80,JSON[_0xa022('0x26')](_0x5df2c8));delete _0x5df2c8[_0xa022('0x37')];if(_0x32fb80===0x191){_0x32fb80=0x190;}_0x4ca104['status'](_0x32fb80)['send'](_0x2129d4['query'][_0xa022('0x1c')]?{'message':_0xa022('0x81'),'statusCode':_0x5df2c8[_0xa022('0x7f')]}:_0x5df2c8);});}; \ No newline at end of file +var _0x4632=['getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','accessKey','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','GET','POST','login','token','success','describe','sessionName','autogenerated','reference','includes','remove','editable','false','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','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','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','create','body','update','findOne','VtigerConfiguration','pick'];(function(_0xfac10b,_0x172584){var _0x1b1acb=function(_0x44d286){while(--_0x44d286){_0xfac10b['push'](_0xfac10b['shift']());}};_0x1b1acb(++_0x172584);}(_0x4632,0xb4));var _0x2463=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x4632[_0xbd08b4];return _0x314f1e;};'use strict';var pdf=require(_0x2463('0x0'));var emlformat=require(_0x2463('0x1'));var rimraf=require(_0x2463('0x2'));var zipdir=require(_0x2463('0x3'));var jsonpatch=require(_0x2463('0x4'));var rp=require(_0x2463('0x5'));var moment=require(_0x2463('0x6'));var BPromise=require(_0x2463('0x7'));var Mustache=require(_0x2463('0x8'));var util=require(_0x2463('0x9'));var path=require('path');var sox=require(_0x2463('0xa'));var csv=require(_0x2463('0xb'));var ejs=require(_0x2463('0xc'));var fs=require('fs');var _=require(_0x2463('0xd'));var squel=require('squel');var crypto=require(_0x2463('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2463('0xf'));var Papa=require(_0x2463('0x10'));var Redis=require(_0x2463('0x11'));var authService=require(_0x2463('0x12'));var qs=require(_0x2463('0x13'));var as=require(_0x2463('0x14'));var hardwareService=require(_0x2463('0x15'));var logger=require('../../config/logger')(_0x2463('0x16'));var utils=require('../../config/utils');var config=require(_0x2463('0x17'));var db=require(_0x2463('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client'][_0x2463('0x19')]({'port':0x232a});function checkPasswordPattern(_0x21202e,_0x290736,_0x5772f8){if(_0x5772f8){var _0x373db4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x373db4[_0x2463('0x1a')](_0x290736)){return _0x21202e;}else{throw new db[(_0x2463('0x1b'))][(_0x2463('0x1c'))](_0x2463('0x1d'));}}else{return _0x21202e;}}function respondWithRpcPromise(_0x506fd7,_0x2a2c55,_0x35ab8f,_0x3685c0){return new BPromise(function(_0x45901a,_0xfed63a){var _0x52f40c=_0x3685c0||client;return _0x52f40c[_0x2463('0x1e')](_0x506fd7,_0x35ab8f)[_0x2463('0x1f')](function(_0x1355d6){logger[_0x2463('0x20')](_0x2463('0x21'),_0x2a2c55,_0x2463('0x22'));logger[_0x2463('0x23')](_0x2463('0x24'),_0x2a2c55,_0x2463('0x22'),JSON['stringify'](_0x1355d6));if(_0x1355d6['error']){if(_0x1355d6['error'][_0x2463('0x25')]===0x1f4){logger['error'](_0x2463('0x21'),_0x2a2c55,_0x1355d6[_0x2463('0x26')][_0x2463('0x27')]);return _0xfed63a(_0x1355d6[_0x2463('0x26')][_0x2463('0x27')]);}logger[_0x2463('0x26')]('VtigerAccount,\x20%s,\x20%s',_0x2a2c55,_0x1355d6[_0x2463('0x26')][_0x2463('0x27')]);return _0x45901a(_0x1355d6[_0x2463('0x26')]['message']);}else{logger['info'](_0x2463('0x21'),_0x2a2c55,_0x2463('0x22'));_0x45901a(_0x1355d6[_0x2463('0x28')]['message']);}})[_0x2463('0x29')](function(_0x2c44fd){logger[_0x2463('0x26')]('VtigerAccount,\x20%s,\x20%s',_0x2a2c55,_0x2c44fd);_0xfed63a(_0x2c44fd);});});}function respondWithStatusCode(_0x36a574,_0x14d864){_0x14d864=_0x14d864||0xcc;return function(_0x4f3b39){if(_0x4f3b39){return _0x36a574[_0x2463('0x2a')](_0x14d864);}return _0x36a574[_0x2463('0x2b')](_0x14d864)[_0x2463('0x2c')]();};}function respondWithResult(_0x44b5c0,_0x53b8ce){_0x53b8ce=_0x53b8ce||0xc8;return function(_0x251ab2){if(_0x251ab2){return _0x44b5c0[_0x2463('0x2b')](_0x53b8ce)[_0x2463('0x2d')](_0x251ab2);}};}function respondWithFilteredResult(_0x40abee,_0x353d7b){return function(_0x51d8ab){if(_0x51d8ab){var _0x51d876=_0x51d8ab[_0x2463('0x2e')],_0xc3507b=_0x353d7b[_0x2463('0x2f')],_0x3af96=_0x353d7b[_0x2463('0x2f')]+_0x353d7b['limit'],_0x282e35;if(_0x3af96>=_0x51d876){_0x3af96=_0x51d876;_0x282e35=0xc8;}else{_0x282e35=0xce;}_0x40abee[_0x2463('0x2b')](_0x282e35);return _0x40abee[_0x2463('0x30')](_0x2463('0x31'),_0xc3507b+'-'+_0x3af96+'/'+_0x51d876)[_0x2463('0x2d')](_0x51d8ab);}return null;};}function patchUpdates(_0x501ebf){return function(_0x5256e6){try{jsonpatch[_0x2463('0x32')](_0x5256e6,_0x501ebf,!![]);}catch(_0x34b1b7){return BPromise[_0x2463('0x33')](_0x34b1b7);}return _0x5256e6[_0x2463('0x34')]();};}function saveUpdates(_0x26a762,_0x256916){return function(_0xd5e23){if(_0xd5e23){return _0xd5e23['update'](_0x26a762)[_0x2463('0x1f')](function(_0x87bf6b){return _0x87bf6b;});}return null;};}function removeEntity(_0x56362f,_0x1802c4){return function(_0x1eb87e){if(_0x1eb87e){return _0x1eb87e[_0x2463('0x35')]()[_0x2463('0x1f')](function(){_0x56362f[_0x2463('0x2b')](0xcc)[_0x2463('0x2c')]();});}};}function handleEntityNotFound(_0x4c1fa5,_0x564a45){return function(_0x26d446){if(!_0x26d446){_0x4c1fa5[_0x2463('0x2a')](0x194);}return _0x26d446;};}function handleError(_0xf3b25e,_0x19d1c1){_0x19d1c1=_0x19d1c1||0x1f4;return function(_0x214a34){logger[_0x2463('0x26')](_0x214a34[_0x2463('0x36')]);if(_0x214a34['name']){delete _0x214a34[_0x2463('0x37')];}_0xf3b25e[_0x2463('0x2b')](_0x19d1c1)[_0x2463('0x38')](_0x214a34);};}exports[_0x2463('0x39')]=function(_0x17efe2,_0x44cbef){var _0x7ae698={},_0x3c7286={},_0x3cc2ee={'count':0x0,'rows':[]};var _0x19eaf3=_[_0x2463('0x3a')](db[_0x2463('0x3b')][_0x2463('0x3c')],function(_0x15221e){return{'name':_0x15221e[_0x2463('0x3d')],'type':_0x15221e[_0x2463('0x3e')][_0x2463('0x3f')]};});_0x3c7286['model']=_[_0x2463('0x3a')](_0x19eaf3,'name');_0x3c7286[_0x2463('0x40')]=_[_0x2463('0x41')](_0x17efe2[_0x2463('0x40')]);_0x3c7286[_0x2463('0x42')]=_['intersection'](_0x3c7286[_0x2463('0x43')],_0x3c7286[_0x2463('0x40')]);_0x7ae698[_0x2463('0x44')]=_['intersection'](_0x3c7286[_0x2463('0x43')],qs[_0x2463('0x45')](_0x17efe2[_0x2463('0x40')][_0x2463('0x45')]));_0x7ae698[_0x2463('0x44')]=_0x7ae698[_0x2463('0x44')][_0x2463('0x46')]?_0x7ae698[_0x2463('0x44')]:_0x3c7286[_0x2463('0x43')];if(!_0x17efe2[_0x2463('0x40')][_0x2463('0x47')]('nolimit')){_0x7ae698[_0x2463('0x48')]=qs[_0x2463('0x48')](_0x17efe2[_0x2463('0x40')]['limit']);_0x7ae698['offset']=qs[_0x2463('0x2f')](_0x17efe2[_0x2463('0x40')]['offset']);}_0x7ae698[_0x2463('0x49')]=qs[_0x2463('0x4a')](_0x17efe2[_0x2463('0x40')][_0x2463('0x4a')]);_0x7ae698[_0x2463('0x4b')]=qs[_0x2463('0x42')](_['pick'](_0x17efe2[_0x2463('0x40')],_0x3c7286[_0x2463('0x42')]));if(_0x17efe2[_0x2463('0x40')][_0x2463('0x4c')]){_0x7ae698['where']=_[_0x2463('0x4d')](_0x7ae698[_0x2463('0x4b')],{'$or':_[_0x2463('0x3a')](_0x19eaf3,function(_0x1a8d5b){if(_0x1a8d5b[_0x2463('0x3e')]!==_0x2463('0x4e')){var _0x3bc8cf={};_0x3bc8cf[_0x1a8d5b[_0x2463('0x37')]]={'$like':'%'+_0x17efe2[_0x2463('0x40')][_0x2463('0x4c')]+'%'};return _0x3bc8cf;}})});}_0x7ae698=_[_0x2463('0x4d')]({},_0x7ae698,_0x17efe2[_0x2463('0x4f')]);var _0x4ccc65={'where':_0x7ae698[_0x2463('0x4b')]};return db[_0x2463('0x3b')]['count'](_0x4ccc65)[_0x2463('0x1f')](function(_0x31a072){_0x3cc2ee['count']=_0x31a072;if(_0x17efe2['query'][_0x2463('0x50')]){_0x7ae698[_0x2463('0x51')]=[{'all':!![]}];}return db[_0x2463('0x3b')]['findAll'](_0x7ae698);})[_0x2463('0x1f')](function(_0x4bd1a3){_0x3cc2ee[_0x2463('0x52')]=_0x4bd1a3;return _0x3cc2ee;})[_0x2463('0x1f')](respondWithFilteredResult(_0x44cbef,_0x7ae698))[_0x2463('0x29')](handleError(_0x44cbef,null));};exports[_0x2463('0x53')]=function(_0x41202e,_0x368c9c){var _0x2f2656={'raw':![],'where':{'id':_0x41202e[_0x2463('0x54')]['id']}},_0x5c3922={};_0x5c3922[_0x2463('0x43')]=_[_0x2463('0x41')](db[_0x2463('0x3b')]['rawAttributes']);_0x5c3922['query']=_[_0x2463('0x41')](_0x41202e[_0x2463('0x40')]);_0x5c3922[_0x2463('0x42')]=_[_0x2463('0x55')](_0x5c3922[_0x2463('0x43')],_0x5c3922['query']);_0x2f2656[_0x2463('0x44')]=_['intersection'](_0x5c3922[_0x2463('0x43')],qs[_0x2463('0x45')](_0x41202e[_0x2463('0x40')][_0x2463('0x45')]));_0x2f2656[_0x2463('0x44')]=_0x2f2656[_0x2463('0x44')][_0x2463('0x46')]?_0x2f2656[_0x2463('0x44')]:_0x5c3922[_0x2463('0x43')];if(_0x41202e[_0x2463('0x40')][_0x2463('0x50')]){_0x2f2656[_0x2463('0x51')]=[{'all':!![]}];}_0x2f2656=_[_0x2463('0x4d')]({},_0x2f2656,_0x41202e[_0x2463('0x4f')]);return db[_0x2463('0x3b')]['find'](_0x2f2656)[_0x2463('0x1f')](handleEntityNotFound(_0x368c9c,null))['then'](respondWithResult(_0x368c9c,null))['catch'](handleError(_0x368c9c,null));};exports[_0x2463('0x56')]=function(_0x289593,_0x19759e){return db[_0x2463('0x3b')][_0x2463('0x56')](_0x289593[_0x2463('0x57')],{})[_0x2463('0x1f')](respondWithResult(_0x19759e,0xc9))[_0x2463('0x29')](handleError(_0x19759e,null));};exports[_0x2463('0x58')]=function(_0x589855,_0x55ecac){if(_0x589855[_0x2463('0x57')]['id']){delete _0x589855[_0x2463('0x57')]['id'];}return db[_0x2463('0x3b')]['find']({'where':{'id':_0x589855['params']['id']}})[_0x2463('0x1f')](handleEntityNotFound(_0x55ecac,null))[_0x2463('0x1f')](saveUpdates(_0x589855[_0x2463('0x57')],null))[_0x2463('0x1f')](respondWithResult(_0x55ecac,null))[_0x2463('0x29')](handleError(_0x55ecac,null));};exports[_0x2463('0x35')]=function(_0x54229a,_0x4cbc94){return db[_0x2463('0x3b')]['find']({'where':{'id':_0x54229a['params']['id']}})[_0x2463('0x1f')](handleEntityNotFound(_0x4cbc94,null))[_0x2463('0x1f')](removeEntity(_0x4cbc94,null))[_0x2463('0x29')](handleError(_0x4cbc94,null));};exports['getConfigurations']=function(_0x2272c2,_0xff73f4,_0x18fc6d){var _0x3e9534={};var _0x36fcab={};var _0x4c0293;var _0x344069;return db[_0x2463('0x3b')][_0x2463('0x59')]({'where':{'id':_0x2272c2[_0x2463('0x54')]['id']}})['then'](handleEntityNotFound(_0xff73f4,null))[_0x2463('0x1f')](function(_0xadc29c){if(_0xadc29c){_0x4c0293=_0xadc29c;_0x36fcab[_0x2463('0x43')]=_[_0x2463('0x41')](db[_0x2463('0x5a')][_0x2463('0x3c')]);_0x36fcab[_0x2463('0x40')]=_['keys'](_0x2272c2[_0x2463('0x40')]);_0x36fcab[_0x2463('0x42')]=_[_0x2463('0x55')](_0x36fcab[_0x2463('0x43')],_0x36fcab[_0x2463('0x40')]);_0x3e9534['attributes']=_[_0x2463('0x55')](_0x36fcab['model'],qs[_0x2463('0x45')](_0x2272c2['query']['fields']));_0x3e9534[_0x2463('0x44')]=_0x3e9534[_0x2463('0x44')]['length']?_0x3e9534[_0x2463('0x44')]:_0x36fcab['model'];_0x3e9534[_0x2463('0x49')]=qs[_0x2463('0x4a')](_0x2272c2[_0x2463('0x40')][_0x2463('0x4a')]);_0x3e9534[_0x2463('0x4b')]=qs[_0x2463('0x42')](_[_0x2463('0x5b')](_0x2272c2[_0x2463('0x40')],_0x36fcab[_0x2463('0x42')]));if(_0x2272c2[_0x2463('0x40')]['filter']){_0x3e9534['where']=_[_0x2463('0x4d')](_0x3e9534[_0x2463('0x4b')],{'$or':_[_0x2463('0x3a')](_0x3e9534['attributes'],function(_0x1a9923){var _0x2fcd5d={};_0x2fcd5d[_0x1a9923]={'$like':'%'+_0x2272c2[_0x2463('0x40')]['filter']+'%'};return _0x2fcd5d;})});}_0x3e9534=_[_0x2463('0x4d')]({},_0x3e9534,_0x2272c2[_0x2463('0x4f')]);return _0x4c0293[_0x2463('0x5c')](_0x3e9534);}})[_0x2463('0x1f')](function(_0x577007){if(_0x577007){_0x344069=_0x577007[_0x2463('0x46')];if(!_0x2272c2[_0x2463('0x40')][_0x2463('0x47')](_0x2463('0x5d'))){_0x3e9534[_0x2463('0x48')]=qs[_0x2463('0x48')](_0x2272c2[_0x2463('0x40')][_0x2463('0x48')]);_0x3e9534['offset']=qs[_0x2463('0x2f')](_0x2272c2[_0x2463('0x40')][_0x2463('0x2f')]);}return _0x4c0293[_0x2463('0x5c')](_0x3e9534);}})[_0x2463('0x1f')](function(_0x10ab8b){if(_0x10ab8b){return _0x10ab8b?{'count':_0x344069,'rows':_0x10ab8b}:null;}})[_0x2463('0x1f')](respondWithResult(_0xff73f4,null))[_0x2463('0x29')](handleError(_0xff73f4,null));};exports[_0x2463('0x5e')]=function(_0x3afa02,_0x1832c0,_0x1e8e8c){if(_0x3afa02[_0x2463('0x57')]['id']){delete _0x3afa02[_0x2463('0x57')]['id'];}return db[_0x2463('0x3b')][_0x2463('0x59')]({'where':{'id':_0x3afa02['params']['id']}})[_0x2463('0x1f')](handleEntityNotFound(_0x1832c0,null))[_0x2463('0x1f')](function(_0x2d2173){if(_0x2d2173){_0x3afa02[_0x2463('0x57')][_0x2463('0x5f')]=_0x2d2173['id'];_0x3afa02['body'][_0x2463('0x60')]=integrations[_0x2463('0x61')](_0x3afa02['body'][_0x2463('0x62')],_0x3afa02[_0x2463('0x57')][_0x2463('0x3e')]);_0x3afa02[_0x2463('0x57')][_0x2463('0x63')]=integrations[_0x2463('0x64')](_0x3afa02[_0x2463('0x57')][_0x2463('0x62')],_0x3afa02[_0x2463('0x57')][_0x2463('0x3e')]);return db[_0x2463('0x5a')][_0x2463('0x56')](_0x3afa02[_0x2463('0x57')],{'include':[{'model':db[_0x2463('0x65')],'as':'Subjects'},{'model':db[_0x2463('0x65')],'as':'Descriptions'}]});}return null;})[_0x2463('0x1f')](respondWithResult(_0x1832c0,null))['catch'](handleError(_0x1832c0,null));};var md5=require(_0x2463('0x66'));exports[_0x2463('0x67')]=function(_0x483c5b,_0x5da332,_0x3adee8){var _0x1c5684=null;var _0x32b502=null;var _0x5d6a0f=null;var _0x5cb98a=null;var _0x396f3d='';return db[_0x2463('0x3b')]['findOne']({'where':{'id':_0x483c5b[_0x2463('0x54')]['id']},'attributes':['id','name',_0x2463('0x68'),_0x2463('0x69'),_0x2463('0x6a'),'remoteUri','serverUrl','accessKey']})['then'](handleEntityNotFound(_0x5da332,null))[_0x2463('0x1f')](function(_0x2117da){if(_0x2117da){_0x1c5684=_0x2117da[_0x2463('0x68')];_0x32b502=_0x2117da[_0x2463('0x6b')];_0x5d6a0f=_0x2117da['moduleName'];_0x396f3d=_0x2117da[_0x2463('0x6c')];var _0x3161ea=_0x396f3d[_0x2463('0x6d')](-0x1);if(_0x3161ea==='/'){_0x396f3d=_0x396f3d[_0x2463('0x6e')](0x0,_0x396f3d[_0x2463('0x6f')](_0x3161ea));}_0x5cb98a=util[_0x2463('0x70')](_0x2463('0x71'),_0x396f3d);var _0x38c4d6={'method':_0x2463('0x72'),'uri':_0x5cb98a,'qs':{'operation':'getchallenge','username':_0x2117da[_0x2463('0x68')]},'json':!![]};return rp(_0x38c4d6);}})[_0x2463('0x1f')](function(_0x374dd8){if(_0x374dd8['success']){var _0x2398a5={'method':_0x2463('0x73'),'uri':_0x5cb98a,'form':{'operation':_0x2463('0x74'),'username':_0x1c5684,'accessKey':md5(_0x374dd8[_0x2463('0x28')][_0x2463('0x75')]+_0x32b502)},'json':!![]};return rp(_0x2398a5);}})[_0x2463('0x1f')](function(_0xd2220d){if(_0xd2220d[_0x2463('0x76')]){var _0x32439d={'method':_0x2463('0x72'),'uri':_0x5cb98a,'qs':{'operation':_0x2463('0x77'),'username':_0x1c5684,'sessionName':_0xd2220d[_0x2463('0x28')][_0x2463('0x78')],'elementType':_0x5d6a0f},'json':!![]};return rp(_0x32439d);}})[_0x2463('0x1f')](function(_0x358fff){if(_0x358fff['success']){var _0x79c2fa=[_0x2463('0x79'),_0x2463('0x7a'),'owner'];_['remove'](_0x358fff[_0x2463('0x28')]['fields'],function(_0x35289f){return _0x79c2fa[_0x2463('0x7b')](_0x35289f['type']['name']);});_[_0x2463('0x7c')](_0x358fff[_0x2463('0x28')][_0x2463('0x45')],function(_0x1cfabd){return _0x1cfabd[_0x2463('0x7d')]===_0x2463('0x7e');});return{'count':_0x358fff[_0x2463('0x28')][_0x2463('0x45')][_0x2463('0x46')],'rows':_[_0x2463('0x3a')](_0x358fff[_0x2463('0x28')]['fields'],function(_0x1c9e70){return{'id':_0x1c9e70['name'],'name':_0x1c9e70['label'],'custom':_['startsWith'](_0x1c9e70['name'],_0x2463('0x7f'))?!![]:![],'options':_0x1c9e70['type']['name']===_0x2463('0x80')&&_0x1c9e70['type']['picklistValues']['length']>0x0?_[_0x2463('0x3a')](_0x1c9e70[_0x2463('0x3e')][_0x2463('0x81')],function(_0x3d344c){return{'name':_0x3d344c['label'],'value':_0x3d344c[_0x2463('0x82')]};}):[]};})};}})[_0x2463('0x1f')](respondWithResult(_0x5da332,null))['catch'](function(_0x1bf0a6){console[_0x2463('0x83')](_0x2463('0x84')+_0x1bf0a6);var _0x27e28a=_0x483c5b[_0x2463('0x40')][_0x2463('0x1a')]?0x1f4:_0x1bf0a6[_0x2463('0x85')]||0x1f4;logger[_0x2463('0x26')](_0x2463('0x86'),_0x2463('0x67'),_0x27e28a,JSON[_0x2463('0x87')](_0x1bf0a6));delete _0x1bf0a6[_0x2463('0x37')];if(_0x27e28a===0x191){_0x27e28a=0x190;}_0x5da332[_0x2463('0x2b')](_0x27e28a)[_0x2463('0x38')](_0x483c5b[_0x2463('0x40')][_0x2463('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x1bf0a6[_0x2463('0x85')]}:_0x1bf0a6);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 9879c0a..990a4c0 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 _0x325e=['../../components/integrations/configuration','exports','define','VtigerAccount','lodash','api','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x38e186,_0x11af47){var _0x7c5563=function(_0x41a40d){while(--_0x41a40d){_0x38e186['push'](_0x38e186['shift']());}};_0x7c5563(++_0x11af47);}(_0x325e,0x1f3));var _0xe325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x325e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe325('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe325('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe325('0x2'));var fs=require('fs');var path=require(_0xe325('0x3'));var rimraf=require(_0xe325('0x4'));var config=require(_0xe325('0x5'));var attributes=require(_0xe325('0x6'));var integrations=require(_0xe325('0x7'));module[_0xe325('0x8')]=function(_0x60dae8,_0x598e3c){return _0x60dae8[_0xe325('0x9')](_0xe325('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c6a=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger'];(function(_0x4893c6,_0x4823d8){var _0x50f4d3=function(_0x113c47){while(--_0x113c47){_0x4893c6['push'](_0x4893c6['shift']());}};_0x50f4d3(++_0x4823d8);}(_0x3c6a,0x102));var _0xa3c6=function(_0x495b3d,_0x4d3da4){_0x495b3d=_0x495b3d-0x0;var _0x4cb329=_0x3c6a[_0x495b3d];return _0x4cb329;};'use strict';var _=require(_0xa3c6('0x0'));var util=require('util');var logger=require(_0xa3c6('0x1'))(_0xa3c6('0x2'));var moment=require('moment');var BPromise=require(_0xa3c6('0x3'));var rp=require(_0xa3c6('0x4'));var fs=require('fs');var path=require(_0xa3c6('0x5'));var rimraf=require(_0xa3c6('0x6'));var config=require(_0xa3c6('0x7'));var attributes=require(_0xa3c6('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xa3c6('0x9')]=function(_0x2fab43,_0x5b6043){return _0x2fab43[_0xa3c6('0xa')](_0xa3c6('0xb'),attributes,{'tableName':_0xa3c6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 2871b5a..fd8c640 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 _0xd73d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','VtigerAccount,\x20%s,\x20%s','message','request\x20sent','result','VtigerAccount','findAll','options','raw','limit','model','include','map','attributes','GetVtigerAccount','stringify','catch','ShowVtigerAccount','find','where','lodash','util'];(function(_0xb9075c,_0x583cbb){var _0x458999=function(_0x24531b){while(--_0x24531b){_0xb9075c['push'](_0xb9075c['shift']());}};_0x458999(++_0x583cbb);}(_0xd73d,0xc1));var _0xdd73=function(_0x3e973b,_0x439ae2){_0x3e973b=_0x3e973b-0x0;var _0x5b98f0=_0xd73d[_0x3e973b];return _0x5b98f0;};'use strict';var _=require(_0xdd73('0x0'));var util=require(_0xdd73('0x1'));var moment=require(_0xdd73('0x2'));var BPromise=require(_0xdd73('0x3'));var rs=require(_0xdd73('0x4'));var fs=require('fs');var Redis=require(_0xdd73('0x5'));var db=require(_0xdd73('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd73('0x7'))(_0xdd73('0x8'));var config=require(_0xdd73('0x9'));var jayson=require(_0xdd73('0xa'));var client=jayson[_0xdd73('0xb')][_0xdd73('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c991c,_0x460d37,_0x1363dc){return new BPromise(function(_0x5df4f8,_0x18bc4e){return client[_0xdd73('0xd')](_0x3c991c,_0x1363dc)[_0xdd73('0xe')](function(_0x26d375){logger[_0xdd73('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x460d37,'request\x20sent');logger[_0xdd73('0x10')](_0xdd73('0x11'),_0x460d37,'request\x20sent',JSON['stringify'](_0x26d375));if(_0x26d375[_0xdd73('0x12')]){if(_0x26d375[_0xdd73('0x12')][_0xdd73('0x13')]===0x1f4){logger['error'](_0xdd73('0x14'),_0x460d37,_0x26d375['error'][_0xdd73('0x15')]);return _0x18bc4e(_0x26d375[_0xdd73('0x12')][_0xdd73('0x15')]);}logger[_0xdd73('0x12')](_0xdd73('0x14'),_0x460d37,_0x26d375[_0xdd73('0x12')][_0xdd73('0x15')]);return _0x5df4f8(_0x26d375[_0xdd73('0x12')]['message']);}else{logger[_0xdd73('0xf')](_0xdd73('0x14'),_0x460d37,_0xdd73('0x16'));_0x5df4f8(_0x26d375[_0xdd73('0x17')][_0xdd73('0x15')]);}})['catch'](function(_0x3d2062){logger[_0xdd73('0x12')](_0xdd73('0x14'),_0x460d37,_0x3d2062);_0x18bc4e(_0x3d2062);});});}exports['GetVtigerAccount']=function(_0x4c304d){var _0x4d1ae2=this;return new Promise(function(_0x2f62f1,_0x2beb46){return db[_0xdd73('0x18')][_0xdd73('0x19')]({'raw':_0x4c304d[_0xdd73('0x1a')]?_0x4c304d[_0xdd73('0x1a')][_0xdd73('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c304d[_0xdd73('0x1a')]?_0x4c304d['options']['where']||null:null,'attributes':_0x4c304d['options']?_0x4c304d['options']['attributes']||null:null,'limit':_0x4c304d[_0xdd73('0x1a')]?_0x4c304d[_0xdd73('0x1a')][_0xdd73('0x1c')]||null:null,'include':_0x4c304d[_0xdd73('0x1a')]?_0x4c304d[_0xdd73('0x1a')]['include']?_['map'](_0x4c304d[_0xdd73('0x1a')]['include'],function(_0xae8a7d){return{'model':db[_0xae8a7d[_0xdd73('0x1d')]],'as':_0xae8a7d['as'],'attributes':_0xae8a7d['attributes'],'include':_0xae8a7d[_0xdd73('0x1e')]?_[_0xdd73('0x1f')](_0xae8a7d[_0xdd73('0x1e')],function(_0x2cf1c6){return{'model':db[_0x2cf1c6[_0xdd73('0x1d')]],'as':_0x2cf1c6['as'],'attributes':_0x2cf1c6['attributes'],'include':_0x2cf1c6[_0xdd73('0x1e')]?_[_0xdd73('0x1f')](_0x2cf1c6[_0xdd73('0x1e')],function(_0xf9251b){return{'model':db[_0xf9251b[_0xdd73('0x1d')]],'as':_0xf9251b['as'],'attributes':_0xf9251b[_0xdd73('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29664c){logger[_0xdd73('0xf')](_0xdd73('0x21'),_0x4c304d);logger['debug'](_0xdd73('0x21'),_0x4c304d,JSON[_0xdd73('0x22')](_0x29664c));_0x2f62f1(_0x29664c);})[_0xdd73('0x23')](function(_0x59336f){logger[_0xdd73('0x12')](_0xdd73('0x21'),_0x59336f[_0xdd73('0x15')],_0x4c304d);_0x2beb46(_0x4d1ae2['error'](0x1f4,_0x59336f['message']));});});};exports[_0xdd73('0x24')]=function(_0x7bf26){var _0x97d1b9=this;return new Promise(function(_0x1a0d7a,_0x19fe10){return db['VtigerAccount'][_0xdd73('0x25')]({'raw':_0x7bf26[_0xdd73('0x1a')]?_0x7bf26[_0xdd73('0x1a')][_0xdd73('0x1b')]===undefined?!![]:![]:!![],'where':_0x7bf26[_0xdd73('0x1a')]?_0x7bf26['options'][_0xdd73('0x26')]||null:null,'attributes':_0x7bf26['options']?_0x7bf26['options'][_0xdd73('0x20')]||null:null,'include':_0x7bf26['options']?_0x7bf26[_0xdd73('0x1a')][_0xdd73('0x1e')]?_[_0xdd73('0x1f')](_0x7bf26[_0xdd73('0x1a')][_0xdd73('0x1e')],function(_0x708b06){return{'model':db[_0x708b06[_0xdd73('0x1d')]],'as':_0x708b06['as'],'attributes':_0x708b06[_0xdd73('0x20')],'include':_0x708b06['include']?_[_0xdd73('0x1f')](_0x708b06[_0xdd73('0x1e')],function(_0xc7be9b){return{'model':db[_0xc7be9b[_0xdd73('0x1d')]],'as':_0xc7be9b['as'],'attributes':_0xc7be9b[_0xdd73('0x20')],'include':_0xc7be9b[_0xdd73('0x1e')]?_[_0xdd73('0x1f')](_0xc7be9b[_0xdd73('0x1e')],function(_0x52c521){return{'model':db[_0x52c521['model']],'as':_0x52c521['as'],'attributes':_0x52c521['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x212031){logger[_0xdd73('0xf')]('ShowVtigerAccount',_0x7bf26);logger['debug'](_0xdd73('0x24'),_0x7bf26,JSON[_0xdd73('0x22')](_0x212031));_0x1a0d7a(_0x212031);})[_0xdd73('0x23')](function(_0x2a48b9){logger[_0xdd73('0x12')]('ShowVtigerAccount',_0x2a48b9['message'],_0x7bf26);_0x19fe10(_0x97d1b9[_0xdd73('0x12')](0x1f4,_0x2a48b9[_0xdd73('0x15')]));});});}; \ No newline at end of file +var _0xee52=['VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowVtigerAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xee52,0x1d1));var _0x2ee5=function(_0x12cadc,_0x190995){_0x12cadc=_0x12cadc-0x0;var _0x49bc70=_0xee52[_0x12cadc];return _0x49bc70;};'use strict';var _=require(_0x2ee5('0x0'));var util=require('util');var moment=require(_0x2ee5('0x1'));var BPromise=require(_0x2ee5('0x2'));var rs=require(_0x2ee5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ee5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2ee5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2ee5('0x6')][_0x2ee5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1d8f31,_0x17442d,_0x16e4d4){return new BPromise(function(_0x5c7824,_0x490839){return client[_0x2ee5('0x8')](_0x1d8f31,_0x16e4d4)[_0x2ee5('0x9')](function(_0x25ca74){logger[_0x2ee5('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x17442d,_0x2ee5('0xb'));logger[_0x2ee5('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x17442d,_0x2ee5('0xb'),JSON['stringify'](_0x25ca74));if(_0x25ca74[_0x2ee5('0xd')]){if(_0x25ca74[_0x2ee5('0xd')][_0x2ee5('0xe')]===0x1f4){logger[_0x2ee5('0xd')](_0x2ee5('0xf'),_0x17442d,_0x25ca74['error'][_0x2ee5('0x10')]);return _0x490839(_0x25ca74['error'][_0x2ee5('0x10')]);}logger[_0x2ee5('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x17442d,_0x25ca74[_0x2ee5('0xd')][_0x2ee5('0x10')]);return _0x5c7824(_0x25ca74['error'][_0x2ee5('0x10')]);}else{logger['info'](_0x2ee5('0xf'),_0x17442d,_0x2ee5('0xb'));_0x5c7824(_0x25ca74[_0x2ee5('0x11')]['message']);}})[_0x2ee5('0x12')](function(_0x383263){logger[_0x2ee5('0xd')](_0x2ee5('0xf'),_0x17442d,_0x383263);_0x490839(_0x383263);});});}exports[_0x2ee5('0x13')]=function(_0xa7c493){var _0x1424fc=this;return new Promise(function(_0x273859,_0x3e1e4f){return db[_0x2ee5('0x14')][_0x2ee5('0x15')]({'raw':_0xa7c493[_0x2ee5('0x16')]?_0xa7c493['options'][_0x2ee5('0x17')]===undefined?!![]:![]:!![],'where':_0xa7c493[_0x2ee5('0x16')]?_0xa7c493[_0x2ee5('0x16')][_0x2ee5('0x18')]||null:null,'attributes':_0xa7c493[_0x2ee5('0x16')]?_0xa7c493[_0x2ee5('0x16')][_0x2ee5('0x19')]||null:null,'limit':_0xa7c493['options']?_0xa7c493[_0x2ee5('0x16')][_0x2ee5('0x1a')]||null:null,'include':_0xa7c493[_0x2ee5('0x16')]?_0xa7c493[_0x2ee5('0x16')]['include']?_['map'](_0xa7c493[_0x2ee5('0x16')][_0x2ee5('0x1b')],function(_0x246891){return{'model':db[_0x246891['model']],'as':_0x246891['as'],'attributes':_0x246891[_0x2ee5('0x19')],'include':_0x246891['include']?_['map'](_0x246891[_0x2ee5('0x1b')],function(_0x15b23e){return{'model':db[_0x15b23e[_0x2ee5('0x1c')]],'as':_0x15b23e['as'],'attributes':_0x15b23e[_0x2ee5('0x19')],'include':_0x15b23e[_0x2ee5('0x1b')]?_[_0x2ee5('0x1d')](_0x15b23e[_0x2ee5('0x1b')],function(_0x267ddb){return{'model':db[_0x267ddb[_0x2ee5('0x1c')]],'as':_0x267ddb['as'],'attributes':_0x267ddb[_0x2ee5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2ee5('0x9')](function(_0x2514ad){logger[_0x2ee5('0xa')](_0x2ee5('0x13'),_0xa7c493);logger['debug'](_0x2ee5('0x13'),_0xa7c493,JSON[_0x2ee5('0x1e')](_0x2514ad));_0x273859(_0x2514ad);})['catch'](function(_0x1f9273){logger[_0x2ee5('0xd')](_0x2ee5('0x13'),_0x1f9273[_0x2ee5('0x10')],_0xa7c493);_0x3e1e4f(_0x1424fc[_0x2ee5('0xd')](0x1f4,_0x1f9273[_0x2ee5('0x10')]));});});};exports['ShowVtigerAccount']=function(_0xf146c){var _0x4f58e5=this;return new Promise(function(_0x2f4f1d,_0x3963e8){return db[_0x2ee5('0x14')]['find']({'raw':_0xf146c[_0x2ee5('0x16')]?_0xf146c[_0x2ee5('0x16')][_0x2ee5('0x17')]===undefined?!![]:![]:!![],'where':_0xf146c['options']?_0xf146c[_0x2ee5('0x16')][_0x2ee5('0x18')]||null:null,'attributes':_0xf146c[_0x2ee5('0x16')]?_0xf146c['options'][_0x2ee5('0x19')]||null:null,'include':_0xf146c[_0x2ee5('0x16')]?_0xf146c['options']['include']?_[_0x2ee5('0x1d')](_0xf146c[_0x2ee5('0x16')][_0x2ee5('0x1b')],function(_0x449ef6){return{'model':db[_0x449ef6[_0x2ee5('0x1c')]],'as':_0x449ef6['as'],'attributes':_0x449ef6[_0x2ee5('0x19')],'include':_0x449ef6[_0x2ee5('0x1b')]?_[_0x2ee5('0x1d')](_0x449ef6['include'],function(_0x1fbfc4){return{'model':db[_0x1fbfc4[_0x2ee5('0x1c')]],'as':_0x1fbfc4['as'],'attributes':_0x1fbfc4[_0x2ee5('0x19')],'include':_0x1fbfc4[_0x2ee5('0x1b')]?_[_0x2ee5('0x1d')](_0x1fbfc4['include'],function(_0x4c320d){return{'model':db[_0x4c320d[_0x2ee5('0x1c')]],'as':_0x4c320d['as'],'attributes':_0x4c320d[_0x2ee5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2ee5('0x9')](function(_0x2b6005){logger[_0x2ee5('0xa')](_0x2ee5('0x1f'),_0xf146c);logger['debug'](_0x2ee5('0x1f'),_0xf146c,JSON[_0x2ee5('0x1e')](_0x2b6005));_0x2f4f1d(_0x2b6005);})['catch'](function(_0x2be0a0){logger[_0x2ee5('0xd')](_0x2ee5('0x1f'),_0x2be0a0[_0x2ee5('0x10')],_0xf146c);_0x3963e8(_0x4f58e5['error'](0x1f4,_0x2be0a0[_0x2ee5('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index f879d57..e7f3e2e 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 _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getDescriptions','post','create'];(function(_0x1246df,_0x2e908d){var _0x27b1e6=function(_0x182bb4){while(--_0x182bb4){_0x1246df['push'](_0x1246df['shift']());}};_0x27b1e6(++_0x2e908d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x19c14f,_0x262416){_0x19c14f=_0x19c14f-0x0;var _0x4bdba3=_0x5f2f[_0x19c14f];return _0x4bdba3;};'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('./intVtigerConfiguration.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['getFields']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['getSubjects']);router[_0xf5f2('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0xf')]('/',auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router[_0xf5f2('0x11')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file +var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x408560,_0x2de014){var _0x3936b0=function(_0x466dd4){while(--_0x466dd4){_0x408560['push'](_0x408560['shift']());}};_0x3936b0(++_0x2de014);}(_0xb10b,0x12a));var _0xbb10=function(_0xe3d4a2,_0x5dbf95){_0xe3d4a2=_0xe3d4a2-0x0;var _0x131efb=_0xb10b[_0xe3d4a2];return _0x131efb;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 75a4b71..9d29a17 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 _0x274e=['exports','STRING','sequelize'];(function(_0x5533cb,_0x271a95){var _0x356ae6=function(_0x2d8230){while(--_0x2d8230){_0x5533cb['push'](_0x5533cb['shift']());}};_0x356ae6(++_0x271a95);}(_0x274e,0x1cd));var _0xe274=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x274e[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xe274('0x0'));module[_0xe274('0x1')]={'name':{'type':Sequelize[_0xe274('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0300=['exports','STRING'];(function(_0x3503af,_0x2b1ab1){var _0x3dc155=function(_0x12b3e4){while(--_0x12b3e4){_0x3503af['push'](_0x3503af['shift']());}};_0x3dc155(++_0x2b1ab1);}(_0x0300,0x152));var _0x0030=function(_0x18df5a,_0x3d2e8d){_0x18df5a=_0x18df5a-0x0;var _0x5a39d4=_0x0300[_0x18df5a];return _0x5a39d4;};'use strict';var Sequelize=require('sequelize');module[_0x0030('0x0')]={'name':{'type':Sequelize[_0x0030('0x1')]},'description':{'type':Sequelize[_0x0030('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 45957e9..3b90925 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 _0xa3d8=['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~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','end','stack','name','send','map','VtigerConfiguration','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getFields','findOne','VtigerField','fields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x1f5a84,_0x38ece9){var _0x2fdfc9=function(_0x261099){while(--_0x261099){_0x1f5a84['push'](_0x1f5a84['shift']());}};_0x2fdfc9(++_0x38ece9);}(_0xa3d8,0xff));var _0x8a3d=function(_0x12ade4,_0x1e303c){_0x12ade4=_0x12ade4-0x0;var _0x4a1d20=_0xa3d8[_0x12ade4];return _0x4a1d20;};'use strict';var pdf=require(_0x8a3d('0x0'));var emlformat=require(_0x8a3d('0x1'));var rimraf=require(_0x8a3d('0x2'));var zipdir=require(_0x8a3d('0x3'));var jsonpatch=require(_0x8a3d('0x4'));var rp=require(_0x8a3d('0x5'));var moment=require('moment');var BPromise=require(_0x8a3d('0x6'));var Mustache=require(_0x8a3d('0x7'));var util=require(_0x8a3d('0x8'));var path=require(_0x8a3d('0x9'));var sox=require(_0x8a3d('0xa'));var csv=require(_0x8a3d('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8a3d('0xc'));var squel=require('squel');var crypto=require(_0x8a3d('0xd'));var jsforce=require(_0x8a3d('0xe'));var deskjs=require(_0x8a3d('0xf'));var toCsv=require(_0x8a3d('0xb'));var querystring=require('querystring');var Papa=require(_0x8a3d('0x10'));var Redis=require('ioredis');var authService=require(_0x8a3d('0x11'));var qs=require(_0x8a3d('0x12'));var as=require(_0x8a3d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a3d('0x14'))(_0x8a3d('0x15'));var utils=require('../../config/utils');var config=require(_0x8a3d('0x16'));var db=require(_0x8a3d('0x17'))['db'];var jayson=require(_0x8a3d('0x18'));var client=jayson[_0x8a3d('0x19')][_0x8a3d('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1a2a20,_0x191a7d,_0xcbe29){if(_0xcbe29){var _0x1efc40=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1efc40[_0x8a3d('0x1b')](_0x191a7d)){return _0x1a2a20;}else{throw new db[(_0x8a3d('0x1c'))][(_0x8a3d('0x1d'))](_0x8a3d('0x1e'));}}else{return _0x1a2a20;}}function respondWithRpcPromise(_0x394bbd,_0xedc407,_0x7c432d,_0x464633){return new BPromise(function(_0x230d75,_0x340207){var _0x2a6612=_0x464633||client;return _0x2a6612[_0x8a3d('0x1f')](_0x394bbd,_0x7c432d)[_0x8a3d('0x20')](function(_0x5c6195){logger[_0x8a3d('0x21')](_0x8a3d('0x22'),_0xedc407,'request\x20sent');logger[_0x8a3d('0x23')](_0x8a3d('0x24'),_0xedc407,_0x8a3d('0x25'),JSON[_0x8a3d('0x26')](_0x5c6195));if(_0x5c6195['error']){if(_0x5c6195[_0x8a3d('0x27')]['code']===0x1f4){logger['error'](_0x8a3d('0x22'),_0xedc407,_0x5c6195['error']['message']);return _0x340207(_0x5c6195[_0x8a3d('0x27')][_0x8a3d('0x28')]);}logger[_0x8a3d('0x27')](_0x8a3d('0x22'),_0xedc407,_0x5c6195['error'][_0x8a3d('0x28')]);return _0x230d75(_0x5c6195[_0x8a3d('0x27')]['message']);}else{logger[_0x8a3d('0x21')](_0x8a3d('0x22'),_0xedc407,_0x8a3d('0x25'));_0x230d75(_0x5c6195[_0x8a3d('0x29')][_0x8a3d('0x28')]);}})['catch'](function(_0x8e1a54){logger[_0x8a3d('0x27')](_0x8a3d('0x22'),_0xedc407,_0x8e1a54);_0x340207(_0x8e1a54);});});}function respondWithStatusCode(_0x4065a0,_0x156136){_0x156136=_0x156136||0xcc;return function(_0x5c6c20){if(_0x5c6c20){return _0x4065a0[_0x8a3d('0x2a')](_0x156136);}return _0x4065a0['status'](_0x156136)['end']();};}function respondWithResult(_0xc92dc,_0x2dcb09){_0x2dcb09=_0x2dcb09||0xc8;return function(_0x2052c2){if(_0x2052c2){return _0xc92dc[_0x8a3d('0x2b')](_0x2dcb09)[_0x8a3d('0x2c')](_0x2052c2);}};}function respondWithFilteredResult(_0x50639f,_0xe058de){return function(_0x5640ec){if(_0x5640ec){var _0x55db8b=_0x5640ec[_0x8a3d('0x2d')],_0x2f1687=_0xe058de['offset'],_0x647b40=_0xe058de[_0x8a3d('0x2e')]+_0xe058de[_0x8a3d('0x2f')],_0x17667e;if(_0x647b40>=_0x55db8b){_0x647b40=_0x55db8b;_0x17667e=0xc8;}else{_0x17667e=0xce;}_0x50639f[_0x8a3d('0x2b')](_0x17667e);return _0x50639f['set'](_0x8a3d('0x30'),_0x2f1687+'-'+_0x647b40+'/'+_0x55db8b)['json'](_0x5640ec);}return null;};}function patchUpdates(_0x2c2d31){return function(_0x5dce61){try{jsonpatch[_0x8a3d('0x31')](_0x5dce61,_0x2c2d31,!![]);}catch(_0x59db28){return BPromise[_0x8a3d('0x32')](_0x59db28);}return _0x5dce61['save']();};}function saveUpdates(_0x393396,_0x5b1585){return function(_0x153bd0){if(_0x153bd0){return _0x153bd0[_0x8a3d('0x33')](_0x393396)['then'](function(_0x5ae153){return _0x5ae153;});}return null;};}function removeEntity(_0x4faaed,_0x36193d){return function(_0x51bb10){if(_0x51bb10){return _0x51bb10[_0x8a3d('0x34')]()[_0x8a3d('0x20')](function(){_0x4faaed[_0x8a3d('0x2b')](0xcc)[_0x8a3d('0x35')]();});}};}function handleEntityNotFound(_0x29add0,_0xbeaed9){return function(_0x4806f7){if(!_0x4806f7){_0x29add0[_0x8a3d('0x2a')](0x194);}return _0x4806f7;};}function handleError(_0x143cfa,_0x4975df){_0x4975df=_0x4975df||0x1f4;return function(_0x490847){logger['error'](_0x490847[_0x8a3d('0x36')]);if(_0x490847[_0x8a3d('0x37')]){delete _0x490847[_0x8a3d('0x37')];}_0x143cfa[_0x8a3d('0x2b')](_0x4975df)[_0x8a3d('0x38')](_0x490847);};}exports['index']=function(_0xe30f7,_0x151f95){var _0x51f434={},_0x9fbff3={},_0x4680b2={'count':0x0,'rows':[]};var _0x3a8fe5=_[_0x8a3d('0x39')](db[_0x8a3d('0x3a')]['rawAttributes'],function(_0x1d7a2a){return{'name':_0x1d7a2a['fieldName'],'type':_0x1d7a2a[_0x8a3d('0x3b')][_0x8a3d('0x3c')]};});_0x9fbff3['model']=_[_0x8a3d('0x39')](_0x3a8fe5,'name');_0x9fbff3[_0x8a3d('0x3d')]=_[_0x8a3d('0x3e')](_0xe30f7[_0x8a3d('0x3d')]);_0x9fbff3['filters']=_[_0x8a3d('0x3f')](_0x9fbff3[_0x8a3d('0x40')],_0x9fbff3[_0x8a3d('0x3d')]);_0x51f434[_0x8a3d('0x41')]=_['intersection'](_0x9fbff3[_0x8a3d('0x40')],qs['fields'](_0xe30f7[_0x8a3d('0x3d')]['fields']));_0x51f434[_0x8a3d('0x41')]=_0x51f434[_0x8a3d('0x41')][_0x8a3d('0x42')]?_0x51f434[_0x8a3d('0x41')]:_0x9fbff3[_0x8a3d('0x40')];if(!_0xe30f7[_0x8a3d('0x3d')][_0x8a3d('0x43')](_0x8a3d('0x44'))){_0x51f434[_0x8a3d('0x2f')]=qs[_0x8a3d('0x2f')](_0xe30f7[_0x8a3d('0x3d')]['limit']);_0x51f434[_0x8a3d('0x2e')]=qs['offset'](_0xe30f7[_0x8a3d('0x3d')]['offset']);}_0x51f434[_0x8a3d('0x45')]=qs['sort'](_0xe30f7[_0x8a3d('0x3d')][_0x8a3d('0x46')]);_0x51f434[_0x8a3d('0x47')]=qs[_0x8a3d('0x48')](_[_0x8a3d('0x49')](_0xe30f7[_0x8a3d('0x3d')],_0x9fbff3[_0x8a3d('0x48')]));if(_0xe30f7[_0x8a3d('0x3d')]['filter']){_0x51f434['where']=_[_0x8a3d('0x4a')](_0x51f434[_0x8a3d('0x47')],{'$or':_[_0x8a3d('0x39')](_0x3a8fe5,function(_0x2c1ce3){if(_0x2c1ce3['type']!=='VIRTUAL'){var _0x16a11d={};_0x16a11d[_0x2c1ce3[_0x8a3d('0x37')]]={'$like':'%'+_0xe30f7[_0x8a3d('0x3d')][_0x8a3d('0x4b')]+'%'};return _0x16a11d;}})});}_0x51f434=_[_0x8a3d('0x4a')]({},_0x51f434,_0xe30f7[_0x8a3d('0x4c')]);var _0x5947b9={'where':_0x51f434[_0x8a3d('0x47')]};return db[_0x8a3d('0x3a')][_0x8a3d('0x2d')](_0x5947b9)[_0x8a3d('0x20')](function(_0x412a11){_0x4680b2['count']=_0x412a11;if(_0xe30f7['query']['includeAll']){_0x51f434['include']=[{'all':!![]}];}return db[_0x8a3d('0x3a')]['findAll'](_0x51f434);})[_0x8a3d('0x20')](function(_0x4f1c01){_0x4680b2[_0x8a3d('0x4d')]=_0x4f1c01;return _0x4680b2;})[_0x8a3d('0x20')](respondWithFilteredResult(_0x151f95,_0x51f434))[_0x8a3d('0x4e')](handleError(_0x151f95,null));};exports[_0x8a3d('0x4f')]=function(_0x13c820,_0x2be7af){var _0x5d253d={'raw':![],'where':{'id':_0x13c820[_0x8a3d('0x50')]['id']}},_0x124eca={};_0x124eca[_0x8a3d('0x40')]=_[_0x8a3d('0x3e')](db[_0x8a3d('0x3a')][_0x8a3d('0x51')]);_0x124eca[_0x8a3d('0x3d')]=_[_0x8a3d('0x3e')](_0x13c820[_0x8a3d('0x3d')]);_0x124eca[_0x8a3d('0x48')]=_[_0x8a3d('0x3f')](_0x124eca[_0x8a3d('0x40')],_0x124eca[_0x8a3d('0x3d')]);_0x5d253d[_0x8a3d('0x41')]=_[_0x8a3d('0x3f')](_0x124eca[_0x8a3d('0x40')],qs['fields'](_0x13c820[_0x8a3d('0x3d')]['fields']));_0x5d253d[_0x8a3d('0x41')]=_0x5d253d[_0x8a3d('0x41')][_0x8a3d('0x42')]?_0x5d253d[_0x8a3d('0x41')]:_0x124eca[_0x8a3d('0x40')];if(_0x13c820[_0x8a3d('0x3d')][_0x8a3d('0x52')]){_0x5d253d['include']=[{'all':!![]}];}_0x5d253d=_[_0x8a3d('0x4a')]({},_0x5d253d,_0x13c820[_0x8a3d('0x4c')]);return db['VtigerConfiguration'][_0x8a3d('0x53')](_0x5d253d)['then'](handleEntityNotFound(_0x2be7af,null))['then'](respondWithResult(_0x2be7af,null))[_0x8a3d('0x4e')](handleError(_0x2be7af,null));};exports['create']=function(_0x3c9d8c,_0x1b58b6){return db['VtigerConfiguration'][_0x8a3d('0x54')](_0x3c9d8c['body'],{})[_0x8a3d('0x20')](respondWithResult(_0x1b58b6,0xc9))[_0x8a3d('0x4e')](handleError(_0x1b58b6,null));};exports['update']=function(_0x47b5fa,_0x252d53){if(_0x47b5fa[_0x8a3d('0x55')]['id']){delete _0x47b5fa['body']['id'];}return db[_0x8a3d('0x3a')]['find']({'where':{'id':_0x47b5fa['params']['id']}})[_0x8a3d('0x20')](handleEntityNotFound(_0x252d53,null))['then'](saveUpdates(_0x47b5fa['body'],null))[_0x8a3d('0x20')](respondWithResult(_0x252d53,null))[_0x8a3d('0x4e')](handleError(_0x252d53,null));};exports[_0x8a3d('0x34')]=function(_0x710206,_0x4f7628){return db[_0x8a3d('0x3a')]['find']({'where':{'id':_0x710206[_0x8a3d('0x50')]['id']}})[_0x8a3d('0x20')](handleEntityNotFound(_0x4f7628,null))['then'](removeEntity(_0x4f7628,null))[_0x8a3d('0x4e')](handleError(_0x4f7628,null));};exports[_0x8a3d('0x56')]=function(_0x33c165,_0x7d5f08,_0x1fff52){var _0x14825c={};var _0x11b239={};var _0x13aa13;var _0x29469a;return db[_0x8a3d('0x3a')][_0x8a3d('0x57')]({'where':{'id':_0x33c165['params']['id']}})[_0x8a3d('0x20')](handleEntityNotFound(_0x7d5f08,null))[_0x8a3d('0x20')](function(_0x3acb83){if(_0x3acb83){_0x13aa13=_0x3acb83;_0x11b239['model']=_[_0x8a3d('0x3e')](db[_0x8a3d('0x58')][_0x8a3d('0x51')]);_0x11b239[_0x8a3d('0x3d')]=_['keys'](_0x33c165['query']);_0x11b239[_0x8a3d('0x48')]=_[_0x8a3d('0x3f')](_0x11b239[_0x8a3d('0x40')],_0x11b239['query']);_0x14825c[_0x8a3d('0x41')]=_[_0x8a3d('0x3f')](_0x11b239[_0x8a3d('0x40')],qs[_0x8a3d('0x59')](_0x33c165[_0x8a3d('0x3d')][_0x8a3d('0x59')]));_0x14825c['attributes']=_0x14825c[_0x8a3d('0x41')]['length']?_0x14825c['attributes']:_0x11b239[_0x8a3d('0x40')];_0x14825c[_0x8a3d('0x45')]=qs[_0x8a3d('0x46')](_0x33c165[_0x8a3d('0x3d')][_0x8a3d('0x46')]);_0x14825c[_0x8a3d('0x47')]=qs[_0x8a3d('0x48')](_[_0x8a3d('0x49')](_0x33c165[_0x8a3d('0x3d')],_0x11b239[_0x8a3d('0x48')]));if(_0x33c165[_0x8a3d('0x3d')]['filter']){_0x14825c[_0x8a3d('0x47')]=_[_0x8a3d('0x4a')](_0x14825c[_0x8a3d('0x47')],{'$or':_[_0x8a3d('0x39')](_0x14825c[_0x8a3d('0x41')],function(_0x17664d){var _0x5ecc5d={};_0x5ecc5d[_0x17664d]={'$like':'%'+_0x33c165[_0x8a3d('0x3d')][_0x8a3d('0x4b')]+'%'};return _0x5ecc5d;})});}_0x14825c=_[_0x8a3d('0x4a')]({},_0x14825c,_0x33c165[_0x8a3d('0x4c')]);return _0x13aa13[_0x8a3d('0x56')](_0x14825c);}})[_0x8a3d('0x20')](function(_0xfc2c7){if(_0xfc2c7){_0x29469a=_0xfc2c7['length'];if(!_0x33c165[_0x8a3d('0x3d')][_0x8a3d('0x43')](_0x8a3d('0x44'))){_0x14825c[_0x8a3d('0x2f')]=qs['limit'](_0x33c165[_0x8a3d('0x3d')][_0x8a3d('0x2f')]);_0x14825c[_0x8a3d('0x2e')]=qs['offset'](_0x33c165[_0x8a3d('0x3d')][_0x8a3d('0x2e')]);}return _0x13aa13['getFields'](_0x14825c);}})[_0x8a3d('0x20')](function(_0x26275e){if(_0x26275e){return _0x26275e?{'count':_0x29469a,'rows':_0x26275e}:null;}})[_0x8a3d('0x20')](respondWithResult(_0x7d5f08,null))[_0x8a3d('0x4e')](handleError(_0x7d5f08,null));};exports['getSubjects']=function(_0x5e0ece,_0x324be0,_0x128524){var _0x36643c={};var _0x31057c={};var _0x482633;var _0x106a93;return db[_0x8a3d('0x3a')][_0x8a3d('0x57')]({'where':{'id':_0x5e0ece[_0x8a3d('0x50')]['id']}})[_0x8a3d('0x20')](handleEntityNotFound(_0x324be0,null))[_0x8a3d('0x20')](function(_0x429c48){if(_0x429c48){_0x482633=_0x429c48;_0x31057c[_0x8a3d('0x40')]=_[_0x8a3d('0x3e')](db[_0x8a3d('0x58')][_0x8a3d('0x51')]);_0x31057c[_0x8a3d('0x3d')]=_['keys'](_0x5e0ece[_0x8a3d('0x3d')]);_0x31057c[_0x8a3d('0x48')]=_[_0x8a3d('0x3f')](_0x31057c[_0x8a3d('0x40')],_0x31057c['query']);_0x36643c['attributes']=_[_0x8a3d('0x3f')](_0x31057c[_0x8a3d('0x40')],qs[_0x8a3d('0x59')](_0x5e0ece[_0x8a3d('0x3d')][_0x8a3d('0x59')]));_0x36643c[_0x8a3d('0x41')]=_0x36643c[_0x8a3d('0x41')][_0x8a3d('0x42')]?_0x36643c[_0x8a3d('0x41')]:_0x31057c['model'];_0x36643c[_0x8a3d('0x45')]=qs['sort'](_0x5e0ece[_0x8a3d('0x3d')][_0x8a3d('0x46')]);_0x36643c['where']=qs[_0x8a3d('0x48')](_[_0x8a3d('0x49')](_0x5e0ece[_0x8a3d('0x3d')],_0x31057c[_0x8a3d('0x48')]));if(_0x5e0ece[_0x8a3d('0x3d')][_0x8a3d('0x4b')]){_0x36643c[_0x8a3d('0x47')]=_[_0x8a3d('0x4a')](_0x36643c[_0x8a3d('0x47')],{'$or':_[_0x8a3d('0x39')](_0x36643c[_0x8a3d('0x41')],function(_0x1738ff){var _0x4270a5={};_0x4270a5[_0x1738ff]={'$like':'%'+_0x5e0ece[_0x8a3d('0x3d')]['filter']+'%'};return _0x4270a5;})});}_0x36643c=_[_0x8a3d('0x4a')]({},_0x36643c,_0x5e0ece['options']);return _0x482633[_0x8a3d('0x5a')](_0x36643c);}})[_0x8a3d('0x20')](function(_0x54d358){if(_0x54d358){_0x106a93=_0x54d358[_0x8a3d('0x42')];if(!_0x5e0ece['query'][_0x8a3d('0x43')](_0x8a3d('0x44'))){_0x36643c[_0x8a3d('0x2f')]=qs[_0x8a3d('0x2f')](_0x5e0ece[_0x8a3d('0x3d')][_0x8a3d('0x2f')]);_0x36643c[_0x8a3d('0x2e')]=qs[_0x8a3d('0x2e')](_0x5e0ece[_0x8a3d('0x3d')][_0x8a3d('0x2e')]);}return _0x482633[_0x8a3d('0x5a')](_0x36643c);}})[_0x8a3d('0x20')](function(_0x259763){if(_0x259763){return _0x259763?{'count':_0x106a93,'rows':_0x259763}:null;}})['then'](respondWithResult(_0x324be0,null))[_0x8a3d('0x4e')](handleError(_0x324be0,null));};exports['getDescriptions']=function(_0x5ab2f7,_0x1d0510,_0xdcd43b){var _0x4cd1a0={};var _0xff8b69={};var _0x4e30dd;var _0x1a150f;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x5ab2f7['params']['id']}})[_0x8a3d('0x20')](handleEntityNotFound(_0x1d0510,null))[_0x8a3d('0x20')](function(_0xd97960){if(_0xd97960){_0x4e30dd=_0xd97960;_0xff8b69[_0x8a3d('0x40')]=_['keys'](db['VtigerField'][_0x8a3d('0x51')]);_0xff8b69[_0x8a3d('0x3d')]=_[_0x8a3d('0x3e')](_0x5ab2f7[_0x8a3d('0x3d')]);_0xff8b69[_0x8a3d('0x48')]=_[_0x8a3d('0x3f')](_0xff8b69[_0x8a3d('0x40')],_0xff8b69['query']);_0x4cd1a0[_0x8a3d('0x41')]=_[_0x8a3d('0x3f')](_0xff8b69[_0x8a3d('0x40')],qs['fields'](_0x5ab2f7[_0x8a3d('0x3d')][_0x8a3d('0x59')]));_0x4cd1a0['attributes']=_0x4cd1a0['attributes'][_0x8a3d('0x42')]?_0x4cd1a0['attributes']:_0xff8b69[_0x8a3d('0x40')];_0x4cd1a0[_0x8a3d('0x45')]=qs[_0x8a3d('0x46')](_0x5ab2f7[_0x8a3d('0x3d')][_0x8a3d('0x46')]);_0x4cd1a0[_0x8a3d('0x47')]=qs[_0x8a3d('0x48')](_[_0x8a3d('0x49')](_0x5ab2f7[_0x8a3d('0x3d')],_0xff8b69['filters']));if(_0x5ab2f7['query'][_0x8a3d('0x4b')]){_0x4cd1a0[_0x8a3d('0x47')]=_[_0x8a3d('0x4a')](_0x4cd1a0['where'],{'$or':_['map'](_0x4cd1a0[_0x8a3d('0x41')],function(_0x39889d){var _0x120fa2={};_0x120fa2[_0x39889d]={'$like':'%'+_0x5ab2f7[_0x8a3d('0x3d')][_0x8a3d('0x4b')]+'%'};return _0x120fa2;})});}_0x4cd1a0=_[_0x8a3d('0x4a')]({},_0x4cd1a0,_0x5ab2f7[_0x8a3d('0x4c')]);return _0x4e30dd[_0x8a3d('0x5b')](_0x4cd1a0);}})['then'](function(_0x136048){if(_0x136048){_0x1a150f=_0x136048['length'];if(!_0x5ab2f7['query'][_0x8a3d('0x43')]('nolimit')){_0x4cd1a0[_0x8a3d('0x2f')]=qs[_0x8a3d('0x2f')](_0x5ab2f7[_0x8a3d('0x3d')][_0x8a3d('0x2f')]);_0x4cd1a0[_0x8a3d('0x2e')]=qs[_0x8a3d('0x2e')](_0x5ab2f7[_0x8a3d('0x3d')]['offset']);}return _0x4e30dd[_0x8a3d('0x5b')](_0x4cd1a0);}})[_0x8a3d('0x20')](function(_0x51bfa0){if(_0x51bfa0){return _0x51bfa0?{'count':_0x1a150f,'rows':_0x51bfa0}:null;}})[_0x8a3d('0x20')](respondWithResult(_0x1d0510,null))[_0x8a3d('0x4e')](handleError(_0x1d0510,null));}; \ No newline at end of file +var _0x6032=['count','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','offset','order','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','keys','find','create','body','getFields','findOne','VtigerField','sort','nolimit','getSubjects','hasOwnProperty','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','ValidationError','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x6032,0xe9));var _0x2603=function(_0x1bc789,_0x65b198){_0x1bc789=_0x1bc789-0x0;var _0x4972a3=_0x6032[_0x1bc789];return _0x4972a3;};'use strict';var pdf=require(_0x2603('0x0'));var emlformat=require(_0x2603('0x1'));var rimraf=require(_0x2603('0x2'));var zipdir=require(_0x2603('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2603('0x4'));var moment=require(_0x2603('0x5'));var BPromise=require(_0x2603('0x6'));var Mustache=require(_0x2603('0x7'));var util=require(_0x2603('0x8'));var path=require(_0x2603('0x9'));var sox=require(_0x2603('0xa'));var csv=require(_0x2603('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2603('0xc'));var jsforce=require(_0x2603('0xd'));var deskjs=require(_0x2603('0xe'));var toCsv=require(_0x2603('0xb'));var querystring=require(_0x2603('0xf'));var Papa=require('papaparse');var Redis=require(_0x2603('0x10'));var authService=require(_0x2603('0x11'));var qs=require(_0x2603('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2603('0x13'));var logger=require(_0x2603('0x14'))(_0x2603('0x15'));var utils=require(_0x2603('0x16'));var config=require(_0x2603('0x17'));var db=require(_0x2603('0x18'))['db'];var jayson=require(_0x2603('0x19'));var client=jayson['client'][_0x2603('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x180b8f,_0x5dd935,_0x394fda){if(_0x394fda){var _0x5a66c8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a66c8['test'](_0x5dd935)){return _0x180b8f;}else{throw new db['Sequelize'][(_0x2603('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 _0x180b8f;}}function respondWithRpcPromise(_0x8f028b,_0x1d8d5a,_0x46fc07,_0x5e6b94){return new BPromise(function(_0x4d13ab,_0x210e3a){var _0x4de07d=_0x5e6b94||client;return _0x4de07d['request'](_0x8f028b,_0x46fc07)[_0x2603('0x1c')](function(_0x257327){logger[_0x2603('0x1d')](_0x2603('0x1e'),_0x1d8d5a,_0x2603('0x1f'));logger[_0x2603('0x20')](_0x2603('0x21'),_0x1d8d5a,_0x2603('0x1f'),JSON[_0x2603('0x22')](_0x257327));if(_0x257327[_0x2603('0x23')]){if(_0x257327['error'][_0x2603('0x24')]===0x1f4){logger[_0x2603('0x23')](_0x2603('0x1e'),_0x1d8d5a,_0x257327[_0x2603('0x23')]['message']);return _0x210e3a(_0x257327[_0x2603('0x23')][_0x2603('0x25')]);}logger[_0x2603('0x23')](_0x2603('0x1e'),_0x1d8d5a,_0x257327[_0x2603('0x23')][_0x2603('0x25')]);return _0x4d13ab(_0x257327[_0x2603('0x23')][_0x2603('0x25')]);}else{logger[_0x2603('0x1d')](_0x2603('0x1e'),_0x1d8d5a,_0x2603('0x1f'));_0x4d13ab(_0x257327['result'][_0x2603('0x25')]);}})[_0x2603('0x26')](function(_0x5d8ecb){logger[_0x2603('0x23')](_0x2603('0x1e'),_0x1d8d5a,_0x5d8ecb);_0x210e3a(_0x5d8ecb);});});}function respondWithStatusCode(_0x4049b4,_0x465b8a){_0x465b8a=_0x465b8a||0xcc;return function(_0x5e70da){if(_0x5e70da){return _0x4049b4[_0x2603('0x27')](_0x465b8a);}return _0x4049b4[_0x2603('0x28')](_0x465b8a)[_0x2603('0x29')]();};}function respondWithResult(_0x22ea52,_0x3df048){_0x3df048=_0x3df048||0xc8;return function(_0x25874a){if(_0x25874a){return _0x22ea52[_0x2603('0x28')](_0x3df048)[_0x2603('0x2a')](_0x25874a);}};}function respondWithFilteredResult(_0x47c69b,_0x10d46a){return function(_0x175983){if(_0x175983){var _0x3cb436=_0x175983[_0x2603('0x2b')],_0x3f4c63=_0x10d46a['offset'],_0x1e84da=_0x10d46a['offset']+_0x10d46a[_0x2603('0x2c')],_0x300762;if(_0x1e84da>=_0x3cb436){_0x1e84da=_0x3cb436;_0x300762=0xc8;}else{_0x300762=0xce;}_0x47c69b['status'](_0x300762);return _0x47c69b[_0x2603('0x2d')](_0x2603('0x2e'),_0x3f4c63+'-'+_0x1e84da+'/'+_0x3cb436)[_0x2603('0x2a')](_0x175983);}return null;};}function patchUpdates(_0x339c52){return function(_0x3d9a58){try{jsonpatch[_0x2603('0x2f')](_0x3d9a58,_0x339c52,!![]);}catch(_0x448d6b){return BPromise['reject'](_0x448d6b);}return _0x3d9a58[_0x2603('0x30')]();};}function saveUpdates(_0x1bf7cb,_0x34b514){return function(_0x46fc27){if(_0x46fc27){return _0x46fc27[_0x2603('0x31')](_0x1bf7cb)['then'](function(_0x30f883){return _0x30f883;});}return null;};}function removeEntity(_0x18f201,_0x3d94cb){return function(_0x3357f0){if(_0x3357f0){return _0x3357f0[_0x2603('0x32')]()['then'](function(){_0x18f201['status'](0xcc)[_0x2603('0x29')]();});}};}function handleEntityNotFound(_0x5b5b0e,_0x24a7ae){return function(_0x59d979){if(!_0x59d979){_0x5b5b0e[_0x2603('0x27')](0x194);}return _0x59d979;};}function handleError(_0x3f649e,_0x10fe25){_0x10fe25=_0x10fe25||0x1f4;return function(_0x54af83){logger['error'](_0x54af83[_0x2603('0x33')]);if(_0x54af83[_0x2603('0x34')]){delete _0x54af83[_0x2603('0x34')];}_0x3f649e[_0x2603('0x28')](_0x10fe25)[_0x2603('0x35')](_0x54af83);};}exports[_0x2603('0x36')]=function(_0x52fb3e,_0x375f17){var _0x3b6e51={},_0x3c26d2={},_0x844e09={'count':0x0,'rows':[]};var _0x5d420c=_[_0x2603('0x37')](db[_0x2603('0x38')][_0x2603('0x39')],function(_0x486d6d){return{'name':_0x486d6d[_0x2603('0x3a')],'type':_0x486d6d[_0x2603('0x3b')]['key']};});_0x3c26d2['model']=_['map'](_0x5d420c,'name');_0x3c26d2[_0x2603('0x3c')]=_['keys'](_0x52fb3e['query']);_0x3c26d2['filters']=_[_0x2603('0x3d')](_0x3c26d2[_0x2603('0x3e')],_0x3c26d2[_0x2603('0x3c')]);_0x3b6e51[_0x2603('0x3f')]=_[_0x2603('0x3d')](_0x3c26d2[_0x2603('0x3e')],qs[_0x2603('0x40')](_0x52fb3e[_0x2603('0x3c')][_0x2603('0x40')]));_0x3b6e51[_0x2603('0x3f')]=_0x3b6e51[_0x2603('0x3f')][_0x2603('0x41')]?_0x3b6e51['attributes']:_0x3c26d2[_0x2603('0x3e')];if(!_0x52fb3e[_0x2603('0x3c')]['hasOwnProperty']('nolimit')){_0x3b6e51[_0x2603('0x2c')]=qs[_0x2603('0x2c')](_0x52fb3e[_0x2603('0x3c')][_0x2603('0x2c')]);_0x3b6e51[_0x2603('0x42')]=qs[_0x2603('0x42')](_0x52fb3e[_0x2603('0x3c')][_0x2603('0x42')]);}_0x3b6e51[_0x2603('0x43')]=qs['sort'](_0x52fb3e[_0x2603('0x3c')]['sort']);_0x3b6e51[_0x2603('0x44')]=qs[_0x2603('0x45')](_[_0x2603('0x46')](_0x52fb3e[_0x2603('0x3c')],_0x3c26d2[_0x2603('0x45')]));if(_0x52fb3e[_0x2603('0x3c')][_0x2603('0x47')]){_0x3b6e51[_0x2603('0x44')]=_['merge'](_0x3b6e51[_0x2603('0x44')],{'$or':_['map'](_0x5d420c,function(_0x5ea7be){if(_0x5ea7be[_0x2603('0x3b')]!==_0x2603('0x48')){var _0x352ea6={};_0x352ea6[_0x5ea7be[_0x2603('0x34')]]={'$like':'%'+_0x52fb3e[_0x2603('0x3c')]['filter']+'%'};return _0x352ea6;}})});}_0x3b6e51=_[_0x2603('0x49')]({},_0x3b6e51,_0x52fb3e[_0x2603('0x4a')]);var _0x303847={'where':_0x3b6e51[_0x2603('0x44')]};return db[_0x2603('0x38')]['count'](_0x303847)[_0x2603('0x1c')](function(_0x376bf5){_0x844e09[_0x2603('0x2b')]=_0x376bf5;if(_0x52fb3e[_0x2603('0x3c')][_0x2603('0x4b')]){_0x3b6e51[_0x2603('0x4c')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x2603('0x4d')](_0x3b6e51);})[_0x2603('0x1c')](function(_0x34b108){_0x844e09['rows']=_0x34b108;return _0x844e09;})[_0x2603('0x1c')](respondWithFilteredResult(_0x375f17,_0x3b6e51))['catch'](handleError(_0x375f17,null));};exports[_0x2603('0x4e')]=function(_0x48eb76,_0x104b8b){var _0x218131={'raw':![],'where':{'id':_0x48eb76[_0x2603('0x4f')]['id']}},_0xbb43a7={};_0xbb43a7['model']=_['keys'](db['VtigerConfiguration'][_0x2603('0x39')]);_0xbb43a7[_0x2603('0x3c')]=_[_0x2603('0x50')](_0x48eb76[_0x2603('0x3c')]);_0xbb43a7[_0x2603('0x45')]=_[_0x2603('0x3d')](_0xbb43a7[_0x2603('0x3e')],_0xbb43a7[_0x2603('0x3c')]);_0x218131[_0x2603('0x3f')]=_[_0x2603('0x3d')](_0xbb43a7[_0x2603('0x3e')],qs['fields'](_0x48eb76[_0x2603('0x3c')][_0x2603('0x40')]));_0x218131[_0x2603('0x3f')]=_0x218131['attributes'][_0x2603('0x41')]?_0x218131[_0x2603('0x3f')]:_0xbb43a7[_0x2603('0x3e')];if(_0x48eb76[_0x2603('0x3c')][_0x2603('0x4b')]){_0x218131[_0x2603('0x4c')]=[{'all':!![]}];}_0x218131=_[_0x2603('0x49')]({},_0x218131,_0x48eb76[_0x2603('0x4a')]);return db[_0x2603('0x38')][_0x2603('0x51')](_0x218131)[_0x2603('0x1c')](handleEntityNotFound(_0x104b8b,null))[_0x2603('0x1c')](respondWithResult(_0x104b8b,null))[_0x2603('0x26')](handleError(_0x104b8b,null));};exports['create']=function(_0x3e728d,_0x52d167){return db['VtigerConfiguration'][_0x2603('0x52')](_0x3e728d[_0x2603('0x53')],{})[_0x2603('0x1c')](respondWithResult(_0x52d167,0xc9))[_0x2603('0x26')](handleError(_0x52d167,null));};exports[_0x2603('0x31')]=function(_0x4d208b,_0xf8d718){if(_0x4d208b[_0x2603('0x53')]['id']){delete _0x4d208b[_0x2603('0x53')]['id'];}return db[_0x2603('0x38')][_0x2603('0x51')]({'where':{'id':_0x4d208b[_0x2603('0x4f')]['id']}})[_0x2603('0x1c')](handleEntityNotFound(_0xf8d718,null))[_0x2603('0x1c')](saveUpdates(_0x4d208b[_0x2603('0x53')],null))['then'](respondWithResult(_0xf8d718,null))[_0x2603('0x26')](handleError(_0xf8d718,null));};exports[_0x2603('0x32')]=function(_0x2cce6e,_0x1ab857){return db[_0x2603('0x38')][_0x2603('0x51')]({'where':{'id':_0x2cce6e[_0x2603('0x4f')]['id']}})[_0x2603('0x1c')](handleEntityNotFound(_0x1ab857,null))[_0x2603('0x1c')](removeEntity(_0x1ab857,null))[_0x2603('0x26')](handleError(_0x1ab857,null));};exports[_0x2603('0x54')]=function(_0xed52b1,_0x3bcaca,_0x58dfa3){var _0x205604={};var _0x5c0491={};var _0x503962;var _0x37d41f;return db[_0x2603('0x38')][_0x2603('0x55')]({'where':{'id':_0xed52b1['params']['id']}})[_0x2603('0x1c')](handleEntityNotFound(_0x3bcaca,null))[_0x2603('0x1c')](function(_0x194891){if(_0x194891){_0x503962=_0x194891;_0x5c0491['model']=_['keys'](db[_0x2603('0x56')]['rawAttributes']);_0x5c0491[_0x2603('0x3c')]=_[_0x2603('0x50')](_0xed52b1['query']);_0x5c0491[_0x2603('0x45')]=_[_0x2603('0x3d')](_0x5c0491[_0x2603('0x3e')],_0x5c0491['query']);_0x205604['attributes']=_['intersection'](_0x5c0491[_0x2603('0x3e')],qs['fields'](_0xed52b1[_0x2603('0x3c')][_0x2603('0x40')]));_0x205604[_0x2603('0x3f')]=_0x205604['attributes']['length']?_0x205604[_0x2603('0x3f')]:_0x5c0491['model'];_0x205604[_0x2603('0x43')]=qs[_0x2603('0x57')](_0xed52b1['query'][_0x2603('0x57')]);_0x205604[_0x2603('0x44')]=qs['filters'](_[_0x2603('0x46')](_0xed52b1[_0x2603('0x3c')],_0x5c0491['filters']));if(_0xed52b1[_0x2603('0x3c')][_0x2603('0x47')]){_0x205604[_0x2603('0x44')]=_['merge'](_0x205604[_0x2603('0x44')],{'$or':_['map'](_0x205604[_0x2603('0x3f')],function(_0xbd90ea){var _0x3ce2c9={};_0x3ce2c9[_0xbd90ea]={'$like':'%'+_0xed52b1['query']['filter']+'%'};return _0x3ce2c9;})});}_0x205604=_[_0x2603('0x49')]({},_0x205604,_0xed52b1[_0x2603('0x4a')]);return _0x503962[_0x2603('0x54')](_0x205604);}})[_0x2603('0x1c')](function(_0xc786cc){if(_0xc786cc){_0x37d41f=_0xc786cc[_0x2603('0x41')];if(!_0xed52b1[_0x2603('0x3c')]['hasOwnProperty'](_0x2603('0x58'))){_0x205604[_0x2603('0x2c')]=qs[_0x2603('0x2c')](_0xed52b1[_0x2603('0x3c')]['limit']);_0x205604['offset']=qs['offset'](_0xed52b1[_0x2603('0x3c')]['offset']);}return _0x503962[_0x2603('0x54')](_0x205604);}})[_0x2603('0x1c')](function(_0x37b866){if(_0x37b866){return _0x37b866?{'count':_0x37d41f,'rows':_0x37b866}:null;}})['then'](respondWithResult(_0x3bcaca,null))[_0x2603('0x26')](handleError(_0x3bcaca,null));};exports[_0x2603('0x59')]=function(_0x775fe9,_0x5572ba,_0x26dc7d){var _0x39f298={};var _0x257c53={};var _0x14ea24;var _0x595825;return db[_0x2603('0x38')]['findOne']({'where':{'id':_0x775fe9['params']['id']}})[_0x2603('0x1c')](handleEntityNotFound(_0x5572ba,null))['then'](function(_0x518249){if(_0x518249){_0x14ea24=_0x518249;_0x257c53['model']=_[_0x2603('0x50')](db[_0x2603('0x56')]['rawAttributes']);_0x257c53[_0x2603('0x3c')]=_[_0x2603('0x50')](_0x775fe9['query']);_0x257c53[_0x2603('0x45')]=_['intersection'](_0x257c53['model'],_0x257c53[_0x2603('0x3c')]);_0x39f298[_0x2603('0x3f')]=_['intersection'](_0x257c53['model'],qs[_0x2603('0x40')](_0x775fe9[_0x2603('0x3c')][_0x2603('0x40')]));_0x39f298[_0x2603('0x3f')]=_0x39f298[_0x2603('0x3f')][_0x2603('0x41')]?_0x39f298[_0x2603('0x3f')]:_0x257c53['model'];_0x39f298[_0x2603('0x43')]=qs[_0x2603('0x57')](_0x775fe9['query'][_0x2603('0x57')]);_0x39f298['where']=qs['filters'](_['pick'](_0x775fe9[_0x2603('0x3c')],_0x257c53['filters']));if(_0x775fe9[_0x2603('0x3c')][_0x2603('0x47')]){_0x39f298['where']=_[_0x2603('0x49')](_0x39f298[_0x2603('0x44')],{'$or':_[_0x2603('0x37')](_0x39f298[_0x2603('0x3f')],function(_0x1764c3){var _0x252f60={};_0x252f60[_0x1764c3]={'$like':'%'+_0x775fe9[_0x2603('0x3c')][_0x2603('0x47')]+'%'};return _0x252f60;})});}_0x39f298=_[_0x2603('0x49')]({},_0x39f298,_0x775fe9['options']);return _0x14ea24[_0x2603('0x59')](_0x39f298);}})[_0x2603('0x1c')](function(_0x10163f){if(_0x10163f){_0x595825=_0x10163f[_0x2603('0x41')];if(!_0x775fe9[_0x2603('0x3c')][_0x2603('0x5a')](_0x2603('0x58'))){_0x39f298['limit']=qs[_0x2603('0x2c')](_0x775fe9[_0x2603('0x3c')]['limit']);_0x39f298[_0x2603('0x42')]=qs[_0x2603('0x42')](_0x775fe9['query'][_0x2603('0x42')]);}return _0x14ea24[_0x2603('0x59')](_0x39f298);}})[_0x2603('0x1c')](function(_0x292804){if(_0x292804){return _0x292804?{'count':_0x595825,'rows':_0x292804}:null;}})[_0x2603('0x1c')](respondWithResult(_0x5572ba,null))[_0x2603('0x26')](handleError(_0x5572ba,null));};exports[_0x2603('0x5b')]=function(_0x2ba19d,_0x3301a4,_0x1e497b){var _0x5e04bd={};var _0x3e923e={};var _0x77e315;var _0x732342;return db[_0x2603('0x38')][_0x2603('0x55')]({'where':{'id':_0x2ba19d[_0x2603('0x4f')]['id']}})[_0x2603('0x1c')](handleEntityNotFound(_0x3301a4,null))[_0x2603('0x1c')](function(_0x44af60){if(_0x44af60){_0x77e315=_0x44af60;_0x3e923e['model']=_[_0x2603('0x50')](db[_0x2603('0x56')][_0x2603('0x39')]);_0x3e923e[_0x2603('0x3c')]=_[_0x2603('0x50')](_0x2ba19d[_0x2603('0x3c')]);_0x3e923e['filters']=_[_0x2603('0x3d')](_0x3e923e['model'],_0x3e923e[_0x2603('0x3c')]);_0x5e04bd['attributes']=_[_0x2603('0x3d')](_0x3e923e[_0x2603('0x3e')],qs[_0x2603('0x40')](_0x2ba19d[_0x2603('0x3c')][_0x2603('0x40')]));_0x5e04bd[_0x2603('0x3f')]=_0x5e04bd[_0x2603('0x3f')][_0x2603('0x41')]?_0x5e04bd[_0x2603('0x3f')]:_0x3e923e[_0x2603('0x3e')];_0x5e04bd['order']=qs[_0x2603('0x57')](_0x2ba19d[_0x2603('0x3c')][_0x2603('0x57')]);_0x5e04bd['where']=qs[_0x2603('0x45')](_[_0x2603('0x46')](_0x2ba19d[_0x2603('0x3c')],_0x3e923e['filters']));if(_0x2ba19d['query'][_0x2603('0x47')]){_0x5e04bd['where']=_[_0x2603('0x49')](_0x5e04bd[_0x2603('0x44')],{'$or':_[_0x2603('0x37')](_0x5e04bd[_0x2603('0x3f')],function(_0x22dfc4){var _0x41859a={};_0x41859a[_0x22dfc4]={'$like':'%'+_0x2ba19d[_0x2603('0x3c')][_0x2603('0x47')]+'%'};return _0x41859a;})});}_0x5e04bd=_['merge']({},_0x5e04bd,_0x2ba19d['options']);return _0x77e315[_0x2603('0x5b')](_0x5e04bd);}})[_0x2603('0x1c')](function(_0x4adcf6){if(_0x4adcf6){_0x732342=_0x4adcf6[_0x2603('0x41')];if(!_0x2ba19d[_0x2603('0x3c')][_0x2603('0x5a')](_0x2603('0x58'))){_0x5e04bd['limit']=qs[_0x2603('0x2c')](_0x2ba19d[_0x2603('0x3c')][_0x2603('0x2c')]);_0x5e04bd[_0x2603('0x42')]=qs[_0x2603('0x42')](_0x2ba19d[_0x2603('0x3c')]['offset']);}return _0x77e315[_0x2603('0x5b')](_0x5e04bd);}})[_0x2603('0x1c')](function(_0x3b648d){if(_0x3b648d){return _0x3b648d?{'count':_0x732342,'rows':_0x3b648d}:null;}})[_0x2603('0x1c')](respondWithResult(_0x3301a4,null))[_0x2603('0x26')](handleError(_0x3301a4,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index ab26f97..e7fd7de 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 _0x6fff=['moment','request-promise','path','./intVtigerConfiguration.attributes','define','int_vtiger_configurations','lodash','api'];(function(_0x236422,_0xd4529e){var _0x6ba625=function(_0x21bb1d){while(--_0x21bb1d){_0x236422['push'](_0x236422['shift']());}};_0x6ba625(++_0xd4529e);}(_0x6fff,0x86));var _0xf6ff=function(_0x174e71,_0x14c213){_0x174e71=_0x174e71-0x0;var _0x21f166=_0x6fff[_0x174e71];return _0x21f166;};'use strict';var _=require(_0xf6ff('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf6ff('0x1'));var moment=require(_0xf6ff('0x2'));var BPromise=require('bluebird');var rp=require(_0xf6ff('0x3'));var fs=require('fs');var path=require(_0xf6ff('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf6ff('0x5'));module['exports']=function(_0x5306d7,_0x6b8950){return _0x5306d7[_0xf6ff('0x6')]('VtigerConfiguration',attributes,{'tableName':_0xf6ff('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfc3=['rimraf','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x445ccd,_0x157a44){var _0x36cb5f=function(_0xdf173b){while(--_0xdf173b){_0x445ccd['push'](_0x445ccd['shift']());}};_0x36cb5f(++_0x157a44);}(_0xcfc3,0x177));var _0x3cfc=function(_0x34c6db,_0x5eab32){_0x34c6db=_0x34c6db-0x0;var _0x139a9c=_0xcfc3[_0x34c6db];return _0x139a9c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3cfc('0x0'))('api');var moment=require(_0x3cfc('0x1'));var BPromise=require(_0x3cfc('0x2'));var rp=require(_0x3cfc('0x3'));var fs=require('fs');var path=require(_0x3cfc('0x4'));var rimraf=require(_0x3cfc('0x5'));var config=require('../../config/environment');var attributes=require(_0x3cfc('0x6'));module[_0x3cfc('0x7')]=function(_0xfd040,_0x2ff555){return _0xfd040['define'](_0x3cfc('0x8'),attributes,{'tableName':_0x3cfc('0x9'),'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 8bae124..e9110e3 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 _0xd7c5=['code','message','VtigerConfiguration,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4680ec,_0x45db3a){var _0x1418bd=function(_0x18a3ab){while(--_0x18a3ab){_0x4680ec['push'](_0x4680ec['shift']());}};_0x1418bd(++_0x45db3a);}(_0xd7c5,0x1d1));var _0x5d7c=function(_0x36564c,_0x39d543){_0x36564c=_0x36564c-0x0;var _0x767851=_0xd7c5[_0x36564c];return _0x767851;};'use strict';var _=require(_0x5d7c('0x0'));var util=require(_0x5d7c('0x1'));var moment=require(_0x5d7c('0x2'));var BPromise=require('bluebird');var rs=require(_0x5d7c('0x3'));var fs=require('fs');var Redis=require(_0x5d7c('0x4'));var db=require(_0x5d7c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d7c('0x6'))(_0x5d7c('0x7'));var config=require(_0x5d7c('0x8'));var jayson=require(_0x5d7c('0x9'));var client=jayson[_0x5d7c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x318427,_0x990f20,_0x4af2aa){return new BPromise(function(_0x243d87,_0x576c4e){return client[_0x5d7c('0xb')](_0x318427,_0x4af2aa)[_0x5d7c('0xc')](function(_0xe92596){logger[_0x5d7c('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x990f20,_0x5d7c('0xe'));logger[_0x5d7c('0xf')](_0x5d7c('0x10'),_0x990f20,'request\x20sent',JSON[_0x5d7c('0x11')](_0xe92596));if(_0xe92596[_0x5d7c('0x12')]){if(_0xe92596['error'][_0x5d7c('0x13')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x990f20,_0xe92596[_0x5d7c('0x12')][_0x5d7c('0x14')]);return _0x576c4e(_0xe92596['error']['message']);}logger[_0x5d7c('0x12')](_0x5d7c('0x15'),_0x990f20,_0xe92596[_0x5d7c('0x12')]['message']);return _0x243d87(_0xe92596['error']['message']);}else{logger[_0x5d7c('0xd')](_0x5d7c('0x15'),_0x990f20,'request\x20sent');_0x243d87(_0xe92596['result'][_0x5d7c('0x14')]);}})['catch'](function(_0x5c774f){logger[_0x5d7c('0x12')](_0x5d7c('0x15'),_0x990f20,_0x5c774f);_0x576c4e(_0x5c774f);});});} \ No newline at end of file +var _0x27da=['then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x3c292b,_0x47e45f){var _0x415afc=function(_0x135327){while(--_0x135327){_0x3c292b['push'](_0x3c292b['shift']());}};_0x415afc(++_0x47e45f);}(_0x27da,0x15c));var _0xa27d=function(_0x57b1da,_0x5668d4){_0x57b1da=_0x57b1da-0x0;var _0x35b545=_0x27da[_0x57b1da];return _0x35b545;};'use strict';var _=require(_0xa27d('0x0'));var util=require(_0xa27d('0x1'));var moment=require('moment');var BPromise=require(_0xa27d('0x2'));var rs=require(_0xa27d('0x3'));var fs=require('fs');var Redis=require(_0xa27d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa27d('0x5'));var logger=require(_0xa27d('0x6'))(_0xa27d('0x7'));var config=require('../../config/environment');var jayson=require(_0xa27d('0x8'));var client=jayson[_0xa27d('0x9')][_0xa27d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b8bc5,_0xfc0cb0,_0x5db87e){return new BPromise(function(_0xba03bc,_0x44f6c9){return client[_0xa27d('0xb')](_0x2b8bc5,_0x5db87e)[_0xa27d('0xc')](function(_0x43894){logger[_0xa27d('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0xfc0cb0,_0xa27d('0xe'));logger[_0xa27d('0xf')](_0xa27d('0x10'),_0xfc0cb0,'request\x20sent',JSON[_0xa27d('0x11')](_0x43894));if(_0x43894['error']){if(_0x43894[_0xa27d('0x12')][_0xa27d('0x13')]===0x1f4){logger[_0xa27d('0x12')](_0xa27d('0x14'),_0xfc0cb0,_0x43894[_0xa27d('0x12')][_0xa27d('0x15')]);return _0x44f6c9(_0x43894[_0xa27d('0x12')][_0xa27d('0x15')]);}logger['error'](_0xa27d('0x14'),_0xfc0cb0,_0x43894['error'][_0xa27d('0x15')]);return _0xba03bc(_0x43894[_0xa27d('0x12')][_0xa27d('0x15')]);}else{logger[_0xa27d('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0xfc0cb0,'request\x20sent');_0xba03bc(_0x43894[_0xa27d('0x16')][_0xa27d('0x15')]);}})[_0xa27d('0x17')](function(_0x3ac294){logger['error'](_0xa27d('0x14'),_0xfc0cb0,_0x3ac294);_0x44f6c9(_0x3ac294);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index b97d896..00358b7 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 _0x92c9=['/:id','show','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index'];(function(_0x2b6200,_0x2e73ff){var _0x688395=function(_0x2165ce){while(--_0x2165ce){_0x2b6200['push'](_0x2b6200['shift']());}};_0x688395(++_0x2e73ff);}(_0x92c9,0x17c));var _0x992c=function(_0x1dd7eb,_0x13b76a){_0x1dd7eb=_0x1dd7eb-0x0;var _0x3e6f1b=_0x92c9[_0x1dd7eb];return _0x3e6f1b;};'use strict';var multer=require(_0x992c('0x0'));var util=require(_0x992c('0x1'));var path=require(_0x992c('0x2'));var timeout=require(_0x992c('0x3'));var express=require(_0x992c('0x4'));var router=express[_0x992c('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x992c('0x6'));var controller=require(_0x992c('0x7'));router[_0x992c('0x8')]('/',auth[_0x992c('0x9')](),controller[_0x992c('0xa')]);router[_0x992c('0x8')](_0x992c('0xb'),auth['isAuthenticated'](),controller[_0x992c('0xc')]);router['post']('/',auth[_0x992c('0x9')](),controller[_0x992c('0xd')]);router[_0x992c('0xe')]('/:id',auth[_0x992c('0x9')](),controller['update']);router[_0x992c('0xf')](_0x992c('0xb'),auth['isAuthenticated'](),controller[_0x992c('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf02d=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','/:id','show','create','put','update','multer'];(function(_0x3072f4,_0x2ba2e3){var _0x1d0e7b=function(_0x5e9a3a){while(--_0x5e9a3a){_0x3072f4['push'](_0x3072f4['shift']());}};_0x1d0e7b(++_0x2ba2e3);}(_0xf02d,0xe0));var _0xdf02=function(_0x20b828,_0x857992){_0x20b828=_0x20b828-0x0;var _0x13135f=_0xf02d[_0x20b828];return _0x13135f;};'use strict';var multer=require(_0xdf02('0x0'));var util=require(_0xdf02('0x1'));var path=require(_0xdf02('0x2'));var timeout=require('connect-timeout');var express=require(_0xdf02('0x3'));var router=express[_0xdf02('0x4')]();var auth=require(_0xdf02('0x5'));var interaction=require(_0xdf02('0x6'));var config=require('../../config/environment');var controller=require(_0xdf02('0x7'));router[_0xdf02('0x8')]('/',auth[_0xdf02('0x9')](),controller['index']);router[_0xdf02('0x8')](_0xdf02('0xa'),auth[_0xdf02('0x9')](),controller[_0xdf02('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdf02('0xc')]);router[_0xdf02('0xd')]('/:id',auth[_0xdf02('0x9')](),controller[_0xdf02('0xe')]);router['delete'](_0xdf02('0xa'),auth[_0xdf02('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index def0741..c9db550 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 _0x5228=['variable','customVariable','keyValue','STRING','sequelize','ENUM','string'];(function(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0x5228,0x10e));var _0x8522=function(_0x260fd5,_0x3e4665){_0x260fd5=_0x260fd5-0x0;var _0x1dc4bc=_0x5228[_0x260fd5];return _0x1dc4bc;};'use strict';var Sequelize=require(_0x8522('0x0'));module['exports']={'type':{'type':Sequelize[_0x8522('0x1')](_0x8522('0x2'),_0x8522('0x3'),_0x8522('0x4'),_0x8522('0x5')),'defaultValue':_0x8522('0x2')},'content':{'type':Sequelize[_0x8522('0x6')]},'key':{'type':Sequelize[_0x8522('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x8522('0x2'),_0x8522('0x3'),_0x8522('0x4'))},'keyContent':{'type':Sequelize[_0x8522('0x6')]},'idField':{'type':Sequelize[_0x8522('0x6')]},'nameField':{'type':Sequelize[_0x8522('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8522('0x6')]}}; \ No newline at end of file +var _0xaf3e=['sequelize','exports','string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN'];(function(_0x3572cb,_0x4149d3){var _0x33a398=function(_0x163e27){while(--_0x163e27){_0x3572cb['push'](_0x3572cb['shift']());}};_0x33a398(++_0x4149d3);}(_0xaf3e,0xcf));var _0xeaf3=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xaf3e[_0xe45118];return _0x15e15d;};'use strict';var Sequelize=require(_0xeaf3('0x0'));module[_0xeaf3('0x1')]={'type':{'type':Sequelize['ENUM'](_0xeaf3('0x2'),'variable',_0xeaf3('0x3'),_0xeaf3('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xeaf3('0x5')]},'key':{'type':Sequelize[_0xeaf3('0x5')]},'keyType':{'type':Sequelize[_0xeaf3('0x6')](_0xeaf3('0x2'),_0xeaf3('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xeaf3('0x5')]},'idField':{'type':Sequelize[_0xeaf3('0x5')]},'nameField':{'type':Sequelize[_0xeaf3('0x5')]},'customField':{'type':Sequelize[_0xeaf3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeaf3('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 153eade..e01400a 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 _0x8eeb=['VtigerField','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','send','index','map'];(function(_0x26d333,_0xfb87e0){var _0x2ba6cc=function(_0x2401a8){while(--_0x2401a8){_0x26d333['push'](_0x26d333['shift']());}};_0x2ba6cc(++_0xfb87e0);}(_0x8eeb,0x101));var _0xb8ee=function(_0x332322,_0x2f5b68){_0x332322=_0x332322-0x0;var _0x4c76b3=_0x8eeb[_0x332322];return _0x4c76b3;};'use strict';var pdf=require(_0xb8ee('0x0'));var emlformat=require(_0xb8ee('0x1'));var rimraf=require(_0xb8ee('0x2'));var zipdir=require(_0xb8ee('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8ee('0x4'));var moment=require(_0xb8ee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb8ee('0x6'));var util=require(_0xb8ee('0x7'));var path=require('path');var sox=require(_0xb8ee('0x8'));var csv=require(_0xb8ee('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb8ee('0xa'));var squel=require(_0xb8ee('0xb'));var crypto=require(_0xb8ee('0xc'));var jsforce=require(_0xb8ee('0xd'));var deskjs=require(_0xb8ee('0xe'));var toCsv=require(_0xb8ee('0x9'));var querystring=require(_0xb8ee('0xf'));var Papa=require(_0xb8ee('0x10'));var Redis=require(_0xb8ee('0x11'));var authService=require(_0xb8ee('0x12'));var qs=require(_0xb8ee('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8ee('0x14'))('api');var utils=require(_0xb8ee('0x15'));var config=require(_0xb8ee('0x16'));var db=require(_0xb8ee('0x17'))['db'];function respondWithStatusCode(_0x4b5d92,_0x389d6a){_0x389d6a=_0x389d6a||0xcc;return function(_0x37dd72){if(_0x37dd72){return _0x4b5d92['sendStatus'](_0x389d6a);}return _0x4b5d92[_0xb8ee('0x18')](_0x389d6a)[_0xb8ee('0x19')]();};}function respondWithResult(_0x539f00,_0xcf95cd){_0xcf95cd=_0xcf95cd||0xc8;return function(_0x1eed73){if(_0x1eed73){return _0x539f00[_0xb8ee('0x18')](_0xcf95cd)[_0xb8ee('0x1a')](_0x1eed73);}};}function respondWithFilteredResult(_0x26cd94,_0x57033b){return function(_0xa3e3ed){if(_0xa3e3ed){var _0x34fb70=_0xa3e3ed[_0xb8ee('0x1b')],_0x5e9c6e=_0x57033b[_0xb8ee('0x1c')],_0xa182bb=_0x57033b[_0xb8ee('0x1c')]+_0x57033b[_0xb8ee('0x1d')],_0x3d4e83;if(_0xa182bb>=_0x34fb70){_0xa182bb=_0x34fb70;_0x3d4e83=0xc8;}else{_0x3d4e83=0xce;}_0x26cd94[_0xb8ee('0x18')](_0x3d4e83);return _0x26cd94[_0xb8ee('0x1e')]('Content-Range',_0x5e9c6e+'-'+_0xa182bb+'/'+_0x34fb70)[_0xb8ee('0x1a')](_0xa3e3ed);}return null;};}function patchUpdates(_0x3b4b22){return function(_0x37e7e4){try{jsonpatch[_0xb8ee('0x1f')](_0x37e7e4,_0x3b4b22,!![]);}catch(_0x53e28e){return BPromise[_0xb8ee('0x20')](_0x53e28e);}return _0x37e7e4[_0xb8ee('0x21')]();};}function saveUpdates(_0xe1f224,_0x429fb7){return function(_0x36f650){if(_0x36f650){return _0x36f650[_0xb8ee('0x22')](_0xe1f224)['then'](function(_0x3e9b47){return _0x3e9b47;});}return null;};}function removeEntity(_0x39dbc3,_0x39c620){return function(_0x489af4){if(_0x489af4){return _0x489af4[_0xb8ee('0x23')]()[_0xb8ee('0x24')](function(){_0x39dbc3[_0xb8ee('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27edd,_0x499eef){return function(_0x3ded7b){if(!_0x3ded7b){_0x27edd[_0xb8ee('0x25')](0x194);}return _0x3ded7b;};}function handleError(_0x59b768,_0x37b4dc){_0x37b4dc=_0x37b4dc||0x1f4;return function(_0x4e57dc){logger[_0xb8ee('0x26')](_0x4e57dc[_0xb8ee('0x27')]);if(_0x4e57dc['name']){delete _0x4e57dc['name'];}_0x59b768['status'](_0x37b4dc)[_0xb8ee('0x28')](_0x4e57dc);};}exports[_0xb8ee('0x29')]=function(_0x21b6dc,_0x18a0c1){var _0x5d72f7={},_0x37a304={},_0x1bcdce={'count':0x0,'rows':[]};var _0xa6304e=_[_0xb8ee('0x2a')](db[_0xb8ee('0x2b')]['rawAttributes'],function(_0x503504){return{'name':_0x503504[_0xb8ee('0x2c')],'type':_0x503504[_0xb8ee('0x2d')][_0xb8ee('0x2e')]};});_0x37a304[_0xb8ee('0x2f')]=_[_0xb8ee('0x2a')](_0xa6304e,_0xb8ee('0x30'));_0x37a304['query']=_[_0xb8ee('0x31')](_0x21b6dc[_0xb8ee('0x32')]);_0x37a304[_0xb8ee('0x33')]=_[_0xb8ee('0x34')](_0x37a304[_0xb8ee('0x2f')],_0x37a304['query']);_0x5d72f7[_0xb8ee('0x35')]=_['intersection'](_0x37a304[_0xb8ee('0x2f')],qs[_0xb8ee('0x36')](_0x21b6dc[_0xb8ee('0x32')]['fields']));_0x5d72f7[_0xb8ee('0x35')]=_0x5d72f7['attributes'][_0xb8ee('0x37')]?_0x5d72f7[_0xb8ee('0x35')]:_0x37a304[_0xb8ee('0x2f')];if(!_0x21b6dc[_0xb8ee('0x32')][_0xb8ee('0x38')](_0xb8ee('0x39'))){_0x5d72f7[_0xb8ee('0x1d')]=qs[_0xb8ee('0x1d')](_0x21b6dc[_0xb8ee('0x32')]['limit']);_0x5d72f7['offset']=qs['offset'](_0x21b6dc['query']['offset']);}_0x5d72f7[_0xb8ee('0x3a')]=qs['sort'](_0x21b6dc['query'][_0xb8ee('0x3b')]);_0x5d72f7[_0xb8ee('0x3c')]=qs[_0xb8ee('0x33')](_[_0xb8ee('0x3d')](_0x21b6dc['query'],_0x37a304[_0xb8ee('0x33')]));if(_0x21b6dc[_0xb8ee('0x32')][_0xb8ee('0x3e')]){_0x5d72f7[_0xb8ee('0x3c')]=_[_0xb8ee('0x3f')](_0x5d72f7[_0xb8ee('0x3c')],{'$or':_['map'](_0xa6304e,function(_0x42d59f){if(_0x42d59f['type']!==_0xb8ee('0x40')){var _0x57504e={};_0x57504e[_0x42d59f[_0xb8ee('0x30')]]={'$like':'%'+_0x21b6dc['query'][_0xb8ee('0x3e')]+'%'};return _0x57504e;}})});}_0x5d72f7=_[_0xb8ee('0x3f')]({},_0x5d72f7,_0x21b6dc['options']);var _0x1c005d={'where':_0x5d72f7[_0xb8ee('0x3c')]};return db[_0xb8ee('0x2b')][_0xb8ee('0x1b')](_0x1c005d)[_0xb8ee('0x24')](function(_0x20a398){_0x1bcdce[_0xb8ee('0x1b')]=_0x20a398;if(_0x21b6dc[_0xb8ee('0x32')][_0xb8ee('0x41')]){_0x5d72f7[_0xb8ee('0x42')]=[{'all':!![]}];}return db['VtigerField'][_0xb8ee('0x43')](_0x5d72f7);})['then'](function(_0x458c9f){_0x1bcdce['rows']=_0x458c9f;return _0x1bcdce;})[_0xb8ee('0x24')](respondWithFilteredResult(_0x18a0c1,_0x5d72f7))[_0xb8ee('0x44')](handleError(_0x18a0c1,null));};exports[_0xb8ee('0x45')]=function(_0x5b3872,_0x141eab){var _0x528d78={'raw':!![],'where':{'id':_0x5b3872[_0xb8ee('0x46')]['id']}},_0x20ef54={};_0x20ef54[_0xb8ee('0x2f')]=_['keys'](db[_0xb8ee('0x2b')]['rawAttributes']);_0x20ef54['query']=_[_0xb8ee('0x31')](_0x5b3872['query']);_0x20ef54['filters']=_[_0xb8ee('0x34')](_0x20ef54[_0xb8ee('0x2f')],_0x20ef54[_0xb8ee('0x32')]);_0x528d78['attributes']=_['intersection'](_0x20ef54[_0xb8ee('0x2f')],qs['fields'](_0x5b3872['query'][_0xb8ee('0x36')]));_0x528d78[_0xb8ee('0x35')]=_0x528d78[_0xb8ee('0x35')][_0xb8ee('0x37')]?_0x528d78['attributes']:_0x20ef54[_0xb8ee('0x2f')];if(_0x5b3872[_0xb8ee('0x32')]['includeAll']){_0x528d78['include']=[{'all':!![]}];}_0x528d78=_['merge']({},_0x528d78,_0x5b3872[_0xb8ee('0x47')]);return db[_0xb8ee('0x2b')]['find'](_0x528d78)[_0xb8ee('0x24')](handleEntityNotFound(_0x141eab,null))[_0xb8ee('0x24')](respondWithResult(_0x141eab,null))[_0xb8ee('0x44')](handleError(_0x141eab,null));};exports['create']=function(_0xd6047c,_0x212ed1){return db[_0xb8ee('0x2b')][_0xb8ee('0x48')](_0xd6047c[_0xb8ee('0x49')],{})[_0xb8ee('0x24')](respondWithResult(_0x212ed1,0xc9))[_0xb8ee('0x44')](handleError(_0x212ed1,null));};exports[_0xb8ee('0x22')]=function(_0x5d36a2,_0x399058){if(_0x5d36a2['body']['id']){delete _0x5d36a2[_0xb8ee('0x49')]['id'];}return db[_0xb8ee('0x2b')]['find']({'where':{'id':_0x5d36a2[_0xb8ee('0x46')]['id']}})[_0xb8ee('0x24')](handleEntityNotFound(_0x399058,null))[_0xb8ee('0x24')](saveUpdates(_0x5d36a2[_0xb8ee('0x49')],null))[_0xb8ee('0x24')](respondWithResult(_0x399058,null))[_0xb8ee('0x44')](handleError(_0x399058,null));};exports[_0xb8ee('0x23')]=function(_0x3ff464,_0x24bd2c){return db[_0xb8ee('0x2b')][_0xb8ee('0x4a')]({'where':{'id':_0x3ff464['params']['id']}})[_0xb8ee('0x24')](handleEntityNotFound(_0x24bd2c,null))[_0xb8ee('0x24')](removeEntity(_0x24bd2c,null))[_0xb8ee('0x44')](handleError(_0x24bd2c,null));}; \ No newline at end of file +var _0x038b=['sendStatus','status','count','limit','set','Content-Range','json','apply','reject','save','destroy','then','end','error','name','send','map','VtigerField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','params','length','options','find','create','update','body','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2192dd,_0x28ad0c){var _0x978299=function(_0x32428d){while(--_0x32428d){_0x2192dd['push'](_0x2192dd['shift']());}};_0x978299(++_0x28ad0c);}(_0x038b,0xc0));var _0xb038=function(_0x34b215,_0x14dafa){_0x34b215=_0x34b215-0x0;var _0x94196d=_0x038b[_0x34b215];return _0x94196d;};'use strict';var pdf=require(_0xb038('0x0'));var emlformat=require(_0xb038('0x1'));var rimraf=require(_0xb038('0x2'));var zipdir=require(_0xb038('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb038('0x4'));var BPromise=require(_0xb038('0x5'));var Mustache=require(_0xb038('0x6'));var util=require(_0xb038('0x7'));var path=require(_0xb038('0x8'));var sox=require(_0xb038('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb038('0xa'));var squel=require(_0xb038('0xb'));var crypto=require(_0xb038('0xc'));var jsforce=require(_0xb038('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb038('0xe'));var Redis=require(_0xb038('0xf'));var authService=require(_0xb038('0x10'));var qs=require(_0xb038('0x11'));var as=require(_0xb038('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb038('0x13'))(_0xb038('0x14'));var utils=require(_0xb038('0x15'));var config=require(_0xb038('0x16'));var db=require(_0xb038('0x17'))['db'];function respondWithStatusCode(_0x4e682f,_0x7ac71){_0x7ac71=_0x7ac71||0xcc;return function(_0x2b81b9){if(_0x2b81b9){return _0x4e682f[_0xb038('0x18')](_0x7ac71);}return _0x4e682f[_0xb038('0x19')](_0x7ac71)['end']();};}function respondWithResult(_0x5d2751,_0x542779){_0x542779=_0x542779||0xc8;return function(_0x5a0222){if(_0x5a0222){return _0x5d2751[_0xb038('0x19')](_0x542779)['json'](_0x5a0222);}};}function respondWithFilteredResult(_0x5b29ed,_0x1eefdf){return function(_0x5bbd7b){if(_0x5bbd7b){var _0x37b02a=_0x5bbd7b[_0xb038('0x1a')],_0xe845c6=_0x1eefdf['offset'],_0x24300e=_0x1eefdf['offset']+_0x1eefdf[_0xb038('0x1b')],_0x53209d;if(_0x24300e>=_0x37b02a){_0x24300e=_0x37b02a;_0x53209d=0xc8;}else{_0x53209d=0xce;}_0x5b29ed[_0xb038('0x19')](_0x53209d);return _0x5b29ed[_0xb038('0x1c')](_0xb038('0x1d'),_0xe845c6+'-'+_0x24300e+'/'+_0x37b02a)[_0xb038('0x1e')](_0x5bbd7b);}return null;};}function patchUpdates(_0x3e3f5c){return function(_0x5058df){try{jsonpatch[_0xb038('0x1f')](_0x5058df,_0x3e3f5c,!![]);}catch(_0x41a153){return BPromise[_0xb038('0x20')](_0x41a153);}return _0x5058df[_0xb038('0x21')]();};}function saveUpdates(_0x4de640,_0x311014){return function(_0x52660f){if(_0x52660f){return _0x52660f['update'](_0x4de640)['then'](function(_0x4fd1de){return _0x4fd1de;});}return null;};}function removeEntity(_0x723969,_0x1ccff3){return function(_0x24c182){if(_0x24c182){return _0x24c182[_0xb038('0x22')]()[_0xb038('0x23')](function(){_0x723969[_0xb038('0x19')](0xcc)[_0xb038('0x24')]();});}};}function handleEntityNotFound(_0xeffa9e,_0x4a4f1e){return function(_0x40f811){if(!_0x40f811){_0xeffa9e[_0xb038('0x18')](0x194);}return _0x40f811;};}function handleError(_0x20456b,_0x4d0d70){_0x4d0d70=_0x4d0d70||0x1f4;return function(_0x45cea3){logger[_0xb038('0x25')](_0x45cea3['stack']);if(_0x45cea3[_0xb038('0x26')]){delete _0x45cea3[_0xb038('0x26')];}_0x20456b['status'](_0x4d0d70)[_0xb038('0x27')](_0x45cea3);};}exports['index']=function(_0xb2263e,_0xa0c666){var _0x528386={},_0xe1ac42={},_0x266fd6={'count':0x0,'rows':[]};var _0x2efd5c=_[_0xb038('0x28')](db[_0xb038('0x29')][_0xb038('0x2a')],function(_0x46ef28){return{'name':_0x46ef28[_0xb038('0x2b')],'type':_0x46ef28['type'][_0xb038('0x2c')]};});_0xe1ac42[_0xb038('0x2d')]=_[_0xb038('0x28')](_0x2efd5c,_0xb038('0x26'));_0xe1ac42[_0xb038('0x2e')]=_[_0xb038('0x2f')](_0xb2263e[_0xb038('0x2e')]);_0xe1ac42[_0xb038('0x30')]=_[_0xb038('0x31')](_0xe1ac42['model'],_0xe1ac42['query']);_0x528386[_0xb038('0x32')]=_[_0xb038('0x31')](_0xe1ac42[_0xb038('0x2d')],qs[_0xb038('0x33')](_0xb2263e[_0xb038('0x2e')]['fields']));_0x528386[_0xb038('0x32')]=_0x528386[_0xb038('0x32')]['length']?_0x528386[_0xb038('0x32')]:_0xe1ac42[_0xb038('0x2d')];if(!_0xb2263e[_0xb038('0x2e')]['hasOwnProperty']('nolimit')){_0x528386[_0xb038('0x1b')]=qs[_0xb038('0x1b')](_0xb2263e[_0xb038('0x2e')][_0xb038('0x1b')]);_0x528386['offset']=qs[_0xb038('0x34')](_0xb2263e[_0xb038('0x2e')][_0xb038('0x34')]);}_0x528386[_0xb038('0x35')]=qs[_0xb038('0x36')](_0xb2263e['query'][_0xb038('0x36')]);_0x528386[_0xb038('0x37')]=qs[_0xb038('0x30')](_[_0xb038('0x38')](_0xb2263e[_0xb038('0x2e')],_0xe1ac42['filters']));if(_0xb2263e[_0xb038('0x2e')][_0xb038('0x39')]){_0x528386['where']=_[_0xb038('0x3a')](_0x528386[_0xb038('0x37')],{'$or':_[_0xb038('0x28')](_0x2efd5c,function(_0x485cff){if(_0x485cff[_0xb038('0x3b')]!==_0xb038('0x3c')){var _0x8a78db={};_0x8a78db[_0x485cff[_0xb038('0x26')]]={'$like':'%'+_0xb2263e[_0xb038('0x2e')][_0xb038('0x39')]+'%'};return _0x8a78db;}})});}_0x528386=_[_0xb038('0x3a')]({},_0x528386,_0xb2263e['options']);var _0x57b44a={'where':_0x528386[_0xb038('0x37')]};return db['VtigerField'][_0xb038('0x1a')](_0x57b44a)[_0xb038('0x23')](function(_0x2c6cbd){_0x266fd6[_0xb038('0x1a')]=_0x2c6cbd;if(_0xb2263e[_0xb038('0x2e')][_0xb038('0x3d')]){_0x528386[_0xb038('0x3e')]=[{'all':!![]}];}return db['VtigerField'][_0xb038('0x3f')](_0x528386);})[_0xb038('0x23')](function(_0x550389){_0x266fd6['rows']=_0x550389;return _0x266fd6;})[_0xb038('0x23')](respondWithFilteredResult(_0xa0c666,_0x528386))[_0xb038('0x40')](handleError(_0xa0c666,null));};exports['show']=function(_0x39f34d,_0x55d3a3){var _0x3523ca={'raw':!![],'where':{'id':_0x39f34d[_0xb038('0x41')]['id']}},_0x222ba9={};_0x222ba9[_0xb038('0x2d')]=_[_0xb038('0x2f')](db['VtigerField']['rawAttributes']);_0x222ba9[_0xb038('0x2e')]=_[_0xb038('0x2f')](_0x39f34d['query']);_0x222ba9[_0xb038('0x30')]=_[_0xb038('0x31')](_0x222ba9[_0xb038('0x2d')],_0x222ba9[_0xb038('0x2e')]);_0x3523ca[_0xb038('0x32')]=_['intersection'](_0x222ba9[_0xb038('0x2d')],qs['fields'](_0x39f34d[_0xb038('0x2e')][_0xb038('0x33')]));_0x3523ca[_0xb038('0x32')]=_0x3523ca[_0xb038('0x32')][_0xb038('0x42')]?_0x3523ca[_0xb038('0x32')]:_0x222ba9[_0xb038('0x2d')];if(_0x39f34d[_0xb038('0x2e')]['includeAll']){_0x3523ca['include']=[{'all':!![]}];}_0x3523ca=_[_0xb038('0x3a')]({},_0x3523ca,_0x39f34d[_0xb038('0x43')]);return db[_0xb038('0x29')][_0xb038('0x44')](_0x3523ca)['then'](handleEntityNotFound(_0x55d3a3,null))[_0xb038('0x23')](respondWithResult(_0x55d3a3,null))['catch'](handleError(_0x55d3a3,null));};exports['create']=function(_0x443d2d,_0xfb7de){return db['VtigerField'][_0xb038('0x45')](_0x443d2d['body'],{})[_0xb038('0x23')](respondWithResult(_0xfb7de,0xc9))['catch'](handleError(_0xfb7de,null));};exports[_0xb038('0x46')]=function(_0x139aa6,_0x34b47d){if(_0x139aa6[_0xb038('0x47')]['id']){delete _0x139aa6['body']['id'];}return db[_0xb038('0x29')][_0xb038('0x44')]({'where':{'id':_0x139aa6[_0xb038('0x41')]['id']}})[_0xb038('0x23')](handleEntityNotFound(_0x34b47d,null))[_0xb038('0x23')](saveUpdates(_0x139aa6[_0xb038('0x47')],null))['then'](respondWithResult(_0x34b47d,null))[_0xb038('0x40')](handleError(_0x34b47d,null));};exports[_0xb038('0x22')]=function(_0x15ebb2,_0x1627a9){return db['VtigerField']['find']({'where':{'id':_0x15ebb2['params']['id']}})[_0xb038('0x23')](handleEntityNotFound(_0x1627a9,null))[_0xb038('0x23')](removeEntity(_0x1627a9,null))[_0xb038('0x40')](handleError(_0x1627a9,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 0c03401..44c3c20 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(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_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 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(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 f77fcd6..d231b71 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 _0x9993=['error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4b98c7,_0x5044fb){var _0x312d1f=function(_0x4dc128){while(--_0x4dc128){_0x4b98c7['push'](_0x4b98c7['shift']());}};_0x312d1f(++_0x5044fb);}(_0x9993,0x109));var _0x3999=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x9993[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x3999('0x0'));var util=require('util');var moment=require(_0x3999('0x1'));var BPromise=require(_0x3999('0x2'));var rs=require(_0x3999('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3999('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3999('0x5'))(_0x3999('0x6'));var config=require(_0x3999('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3999('0x8')][_0x3999('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x536de7,_0xc27316,_0x85b5af){return new BPromise(function(_0x4c1a49,_0x77282){return client[_0x3999('0xa')](_0x536de7,_0x85b5af)['then'](function(_0x3dd61){logger['info'](_0x3999('0xb'),_0xc27316,_0x3999('0xc'));logger['debug'](_0x3999('0xd'),_0xc27316,_0x3999('0xc'),JSON[_0x3999('0xe')](_0x3dd61));if(_0x3dd61[_0x3999('0xf')]){if(_0x3dd61[_0x3999('0xf')][_0x3999('0x10')]===0x1f4){logger[_0x3999('0xf')]('VtigerField,\x20%s,\x20%s',_0xc27316,_0x3dd61[_0x3999('0xf')][_0x3999('0x11')]);return _0x77282(_0x3dd61['error'][_0x3999('0x11')]);}logger[_0x3999('0xf')](_0x3999('0xb'),_0xc27316,_0x3dd61[_0x3999('0xf')]['message']);return _0x4c1a49(_0x3dd61[_0x3999('0xf')]['message']);}else{logger[_0x3999('0x12')]('VtigerField,\x20%s,\x20%s',_0xc27316,_0x3999('0xc'));_0x4c1a49(_0x3dd61['result'][_0x3999('0x11')]);}})[_0x3999('0x13')](function(_0x27a62b){logger[_0x3999('0xf')]('VtigerField,\x20%s,\x20%s',_0xc27316,_0x27a62b);_0x77282(_0x27a62b);});});} \ No newline at end of file +var _0x87d9=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xaa4ae,_0x31dfc6){var _0x1b9811=function(_0x5b314e){while(--_0x5b314e){_0xaa4ae['push'](_0xaa4ae['shift']());}};_0x1b9811(++_0x31dfc6);}(_0x87d9,0x143));var _0x987d=function(_0x1c6b61,_0x5d0fe0){_0x1c6b61=_0x1c6b61-0x0;var _0xb6c7e2=_0x87d9[_0x1c6b61];return _0xb6c7e2;};'use strict';var _=require(_0x987d('0x0'));var util=require('util');var moment=require(_0x987d('0x1'));var BPromise=require(_0x987d('0x2'));var rs=require(_0x987d('0x3'));var fs=require('fs');var Redis=require(_0x987d('0x4'));var db=require(_0x987d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x987d('0x6'))('rpc');var config=require(_0x987d('0x7'));var jayson=require(_0x987d('0x8'));var client=jayson['client'][_0x987d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ee510,_0x5bf349,_0x11d89e){return new BPromise(function(_0x1f97b6,_0x444273){return client[_0x987d('0xa')](_0x3ee510,_0x11d89e)[_0x987d('0xb')](function(_0x325c8b){logger[_0x987d('0xc')]('VtigerField,\x20%s,\x20%s',_0x5bf349,_0x987d('0xd'));logger[_0x987d('0xe')](_0x987d('0xf'),_0x5bf349,_0x987d('0xd'),JSON['stringify'](_0x325c8b));if(_0x325c8b[_0x987d('0x10')]){if(_0x325c8b[_0x987d('0x10')][_0x987d('0x11')]===0x1f4){logger[_0x987d('0x10')](_0x987d('0x12'),_0x5bf349,_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);return _0x444273(_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x5bf349,_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);return _0x1f97b6(_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);}else{logger[_0x987d('0xc')](_0x987d('0x12'),_0x5bf349,_0x987d('0xd'));_0x1f97b6(_0x325c8b[_0x987d('0x14')][_0x987d('0x13')]);}})[_0x987d('0x15')](function(_0x197e46){logger[_0x987d('0x10')](_0x987d('0x12'),_0x5bf349,_0x197e46);_0x444273(_0x197e46);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 1cf74a1..a35049a 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 _0x3ff7=['exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getFields','post','create','update','destroy'];(function(_0x12877b,_0x8650cf){var _0x3549ff=function(_0x4f96b7){while(--_0x4f96b7){_0x12877b['push'](_0x12877b['shift']());}};_0x3549ff(++_0x8650cf);}(_0x3ff7,0xd2));var _0x73ff=function(_0x4fdcc0,_0x560a01){_0x4fdcc0=_0x4fdcc0-0x0;var _0xc0ce94=_0x3ff7[_0x4fdcc0];return _0xc0ce94;};'use strict';var multer=require(_0x73ff('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x73ff('0x1'));var express=require(_0x73ff('0x2'));var router=express[_0x73ff('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x73ff('0x4'));var config=require(_0x73ff('0x5'));var controller=require(_0x73ff('0x6'));router['get']('/',auth[_0x73ff('0x7')](),controller[_0x73ff('0x8')]);router[_0x73ff('0x9')](_0x73ff('0xa'),auth[_0x73ff('0x7')](),controller[_0x73ff('0xb')]);router['get'](_0x73ff('0xc'),auth[_0x73ff('0x7')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x73ff('0x7')](),controller[_0x73ff('0xd')]);router[_0x73ff('0xe')]('/',auth['isAuthenticated'](),controller[_0x73ff('0xf')]);router[_0x73ff('0xe')](_0x73ff('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x73ff('0xa'),auth[_0x73ff('0x7')](),controller[_0x73ff('0x10')]);router['delete'](_0x73ff('0xa'),auth[_0x73ff('0x7')](),controller[_0x73ff('0x11')]);module[_0x73ff('0x12')]=router; \ No newline at end of file +var _0x2408=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2408,0x19a));var _0x8240=function(_0x11acdd,_0x20f49b){_0x11acdd=_0x11acdd-0x0;var _0x2d6f82=_0x2408[_0x11acdd];return _0x2d6f82;};'use strict';var multer=require('multer');var util=require(_0x8240('0x0'));var path=require(_0x8240('0x1'));var timeout=require(_0x8240('0x2'));var express=require('express');var router=express[_0x8240('0x3')]();var auth=require(_0x8240('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8240('0x5'));var controller=require(_0x8240('0x6'));router[_0x8240('0x7')]('/',auth[_0x8240('0x8')](),controller[_0x8240('0x9')]);router[_0x8240('0x7')](_0x8240('0xa'),auth['isAuthenticated'](),controller[_0x8240('0xb')]);router[_0x8240('0x7')](_0x8240('0xc'),auth[_0x8240('0x8')](),controller[_0x8240('0xd')]);router[_0x8240('0x7')](_0x8240('0xe'),auth['isAuthenticated'](),controller[_0x8240('0xf')]);router[_0x8240('0x10')]('/',auth[_0x8240('0x8')](),controller[_0x8240('0x11')]);router['post'](_0x8240('0xc'),auth[_0x8240('0x8')](),controller[_0x8240('0x12')]);router[_0x8240('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8240('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8240('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 6f23b5a..bd3b2c2 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 _0x554b=['exports','STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize'];(function(_0x116e9d,_0xc51217){var _0x552617=function(_0x511945){while(--_0x511945){_0x116e9d['push'](_0x116e9d['shift']());}};_0x552617(++_0xc51217);}(_0x554b,0x1cb));var _0xb554=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x554b[_0x42bdad];return _0x122626;};'use strict';var Sequelize=require(_0xb554('0x0'));module[_0xb554('0x1')]={'name':{'type':Sequelize[_0xb554('0x2')]},'description':{'type':Sequelize[_0xb554('0x2')]},'username':{'type':Sequelize[_0xb554('0x2')],'unique':_0xb554('0x3')},'password':{'type':Sequelize[_0xb554('0x2')]},'token':{'type':Sequelize[_0xb554('0x2')]},'remoteUri':{'type':Sequelize[_0xb554('0x2')],'unique':_0xb554('0x4')},'authType':{'type':Sequelize[_0xb554('0x5')](_0xb554('0x6'),_0xb554('0x7')),'defaultValue':_0xb554('0x6')},'serverUrl':{'type':Sequelize[_0xb554('0x2')]},'type':{'type':Sequelize[_0xb554('0x5')](_0xb554('0x8'),_0xb554('0x9')),'defaultValue':_0xb554('0x8')}}; \ No newline at end of file +var _0x0711=['newTab','sequelize','exports','STRING','ENUM','password','token','integrationTab'];(function(_0x3ec500,_0xefb14d){var _0x475661=function(_0x3dd83b){while(--_0x3dd83b){_0x3ec500['push'](_0x3ec500['shift']());}};_0x475661(++_0xefb14d);}(_0x0711,0x161));var _0x1071=function(_0x257367,_0x177598){_0x257367=_0x257367-0x0;var _0x53a6d3=_0x0711[_0x257367];return _0x53a6d3;};'use strict';var Sequelize=require(_0x1071('0x0'));module[_0x1071('0x1')]={'name':{'type':Sequelize[_0x1071('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1071('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x1071('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1071('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x1071('0x3')](_0x1071('0x4'),_0x1071('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x1071('0x2')]},'type':{'type':Sequelize[_0x1071('0x3')](_0x1071('0x6'),_0x1071('0x7')),'defaultValue':_0x1071('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index c90850e..4239b0e 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 _0xe746=['error','ZendeskAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','getConfigurations','findOne','ZendeskConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','headers','Basic\x20%s','%s:%s','toString','format','%s/token:%s','base64','Unknown\x20authentication\x20type','subject','description','group','remove','ticket_fields','includes','title','system_field_options','custom_field_options','test','statusCode','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xe746,0x167));var _0x6e74=function(_0x384544,_0x1a33a7){_0x384544=_0x384544-0x0;var _0x567610=_0xe746[_0x384544];return _0x567610;};'use strict';var pdf=require(_0x6e74('0x0'));var emlformat=require(_0x6e74('0x1'));var rimraf=require(_0x6e74('0x2'));var zipdir=require(_0x6e74('0x3'));var jsonpatch=require(_0x6e74('0x4'));var rp=require(_0x6e74('0x5'));var moment=require(_0x6e74('0x6'));var BPromise=require(_0x6e74('0x7'));var Mustache=require(_0x6e74('0x8'));var util=require(_0x6e74('0x9'));var path=require(_0x6e74('0xa'));var sox=require('sox');var csv=require(_0x6e74('0xb'));var ejs=require(_0x6e74('0xc'));var fs=require('fs');var _=require(_0x6e74('0xd'));var squel=require(_0x6e74('0xe'));var crypto=require(_0x6e74('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6e74('0x10'));var toCsv=require(_0x6e74('0xb'));var querystring=require(_0x6e74('0x11'));var Papa=require(_0x6e74('0x12'));var Redis=require(_0x6e74('0x13'));var authService=require(_0x6e74('0x14'));var qs=require(_0x6e74('0x15'));var as=require(_0x6e74('0x16'));var hardwareService=require(_0x6e74('0x17'));var logger=require(_0x6e74('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x6e74('0x19'));var db=require(_0x6e74('0x1a'))['db'];var integrations=require(_0x6e74('0x1b'));var jayson=require(_0x6e74('0x1c'));var client=jayson[_0x6e74('0x1d')][_0x6e74('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x33ba2f,_0x199ead,_0x2ee242){if(_0x2ee242){var _0x650781=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x650781['test'](_0x199ead)){return _0x33ba2f;}else{throw new db[(_0x6e74('0x1f'))]['ValidationError'](_0x6e74('0x20'));}}else{return _0x33ba2f;}}function respondWithRpcPromise(_0x3c2320,_0xa008cc,_0x1674b1,_0x2addfc){return new BPromise(function(_0x44e83b,_0x365f82){var _0x4b8aa8=_0x2addfc||client;return _0x4b8aa8[_0x6e74('0x21')](_0x3c2320,_0x1674b1)[_0x6e74('0x22')](function(_0x56d091){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0xa008cc,_0x6e74('0x23'));logger[_0x6e74('0x24')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0xa008cc,_0x6e74('0x23'),JSON['stringify'](_0x56d091));if(_0x56d091['error']){if(_0x56d091[_0x6e74('0x25')]['code']===0x1f4){logger['error'](_0x6e74('0x26'),_0xa008cc,_0x56d091[_0x6e74('0x25')][_0x6e74('0x27')]);return _0x365f82(_0x56d091[_0x6e74('0x25')][_0x6e74('0x27')]);}logger[_0x6e74('0x25')](_0x6e74('0x26'),_0xa008cc,_0x56d091[_0x6e74('0x25')][_0x6e74('0x27')]);return _0x44e83b(_0x56d091['error'][_0x6e74('0x27')]);}else{logger[_0x6e74('0x28')]('ZendeskAccount,\x20%s,\x20%s',_0xa008cc,_0x6e74('0x23'));_0x44e83b(_0x56d091[_0x6e74('0x29')][_0x6e74('0x27')]);}})['catch'](function(_0x2b4bf4){logger[_0x6e74('0x25')]('ZendeskAccount,\x20%s,\x20%s',_0xa008cc,_0x2b4bf4);_0x365f82(_0x2b4bf4);});});}function respondWithStatusCode(_0x5804eb,_0x3a8035){_0x3a8035=_0x3a8035||0xcc;return function(_0xfc20d4){if(_0xfc20d4){return _0x5804eb[_0x6e74('0x2a')](_0x3a8035);}return _0x5804eb[_0x6e74('0x2b')](_0x3a8035)[_0x6e74('0x2c')]();};}function respondWithResult(_0x52eeb3,_0x2b6ceb){_0x2b6ceb=_0x2b6ceb||0xc8;return function(_0x22cc80){if(_0x22cc80){return _0x52eeb3[_0x6e74('0x2b')](_0x2b6ceb)[_0x6e74('0x2d')](_0x22cc80);}};}function respondWithFilteredResult(_0x4fe7af,_0x2122b0){return function(_0x237a6c){if(_0x237a6c){var _0x1bf560=_0x237a6c[_0x6e74('0x2e')],_0x28cfef=_0x2122b0[_0x6e74('0x2f')],_0x2aad99=_0x2122b0[_0x6e74('0x2f')]+_0x2122b0['limit'],_0x4f90f0;if(_0x2aad99>=_0x1bf560){_0x2aad99=_0x1bf560;_0x4f90f0=0xc8;}else{_0x4f90f0=0xce;}_0x4fe7af[_0x6e74('0x2b')](_0x4f90f0);return _0x4fe7af[_0x6e74('0x30')](_0x6e74('0x31'),_0x28cfef+'-'+_0x2aad99+'/'+_0x1bf560)['json'](_0x237a6c);}return null;};}function patchUpdates(_0xa9894){return function(_0x199566){try{jsonpatch[_0x6e74('0x32')](_0x199566,_0xa9894,!![]);}catch(_0x2bfe2b){return BPromise[_0x6e74('0x33')](_0x2bfe2b);}return _0x199566[_0x6e74('0x34')]();};}function saveUpdates(_0x91f058,_0xc22333){return function(_0x313975){if(_0x313975){return _0x313975[_0x6e74('0x35')](_0x91f058)['then'](function(_0x58f873){return _0x58f873;});}return null;};}function removeEntity(_0x101f79,_0x156bb2){return function(_0x575e5e){if(_0x575e5e){return _0x575e5e[_0x6e74('0x36')]()['then'](function(){_0x101f79[_0x6e74('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30f8f3,_0x5b3de5){return function(_0x2ec4da){if(!_0x2ec4da){_0x30f8f3['sendStatus'](0x194);}return _0x2ec4da;};}function handleError(_0x8cf3dd,_0x143cce){_0x143cce=_0x143cce||0x1f4;return function(_0x4e169e){logger['error'](_0x4e169e[_0x6e74('0x37')]);if(_0x4e169e[_0x6e74('0x38')]){delete _0x4e169e[_0x6e74('0x38')];}_0x8cf3dd['status'](_0x143cce)[_0x6e74('0x39')](_0x4e169e);};}exports[_0x6e74('0x3a')]=function(_0x19b527,_0x266164){var _0x3d9d8b={},_0x3f58f9={},_0xdf0419={'count':0x0,'rows':[]};var _0x22cef9=_['map'](db[_0x6e74('0x3b')][_0x6e74('0x3c')],function(_0x3b7413){return{'name':_0x3b7413[_0x6e74('0x3d')],'type':_0x3b7413['type']['key']};});_0x3f58f9[_0x6e74('0x3e')]=_[_0x6e74('0x3f')](_0x22cef9,_0x6e74('0x38'));_0x3f58f9[_0x6e74('0x40')]=_['keys'](_0x19b527[_0x6e74('0x40')]);_0x3f58f9[_0x6e74('0x41')]=_[_0x6e74('0x42')](_0x3f58f9['model'],_0x3f58f9[_0x6e74('0x40')]);_0x3d9d8b[_0x6e74('0x43')]=_[_0x6e74('0x42')](_0x3f58f9['model'],qs['fields'](_0x19b527[_0x6e74('0x40')][_0x6e74('0x44')]));_0x3d9d8b[_0x6e74('0x43')]=_0x3d9d8b[_0x6e74('0x43')][_0x6e74('0x45')]?_0x3d9d8b[_0x6e74('0x43')]:_0x3f58f9[_0x6e74('0x3e')];if(!_0x19b527[_0x6e74('0x40')][_0x6e74('0x46')](_0x6e74('0x47'))){_0x3d9d8b[_0x6e74('0x48')]=qs['limit'](_0x19b527[_0x6e74('0x40')][_0x6e74('0x48')]);_0x3d9d8b['offset']=qs['offset'](_0x19b527[_0x6e74('0x40')][_0x6e74('0x2f')]);}_0x3d9d8b[_0x6e74('0x49')]=qs['sort'](_0x19b527[_0x6e74('0x40')][_0x6e74('0x4a')]);_0x3d9d8b[_0x6e74('0x4b')]=qs['filters'](_[_0x6e74('0x4c')](_0x19b527['query'],_0x3f58f9[_0x6e74('0x41')]));if(_0x19b527[_0x6e74('0x40')][_0x6e74('0x4d')]){_0x3d9d8b[_0x6e74('0x4b')]=_[_0x6e74('0x4e')](_0x3d9d8b[_0x6e74('0x4b')],{'$or':_[_0x6e74('0x3f')](_0x22cef9,function(_0x19761b){if(_0x19761b[_0x6e74('0x4f')]!==_0x6e74('0x50')){var _0x15d057={};_0x15d057[_0x19761b['name']]={'$like':'%'+_0x19b527[_0x6e74('0x40')][_0x6e74('0x4d')]+'%'};return _0x15d057;}})});}_0x3d9d8b=_[_0x6e74('0x4e')]({},_0x3d9d8b,_0x19b527[_0x6e74('0x51')]);var _0x2bb5b8={'where':_0x3d9d8b[_0x6e74('0x4b')]};return db['ZendeskAccount'][_0x6e74('0x2e')](_0x2bb5b8)[_0x6e74('0x22')](function(_0x1612a6){_0xdf0419[_0x6e74('0x2e')]=_0x1612a6;if(_0x19b527[_0x6e74('0x40')][_0x6e74('0x52')]){_0x3d9d8b[_0x6e74('0x53')]=[{'all':!![]}];}return db[_0x6e74('0x3b')][_0x6e74('0x54')](_0x3d9d8b);})[_0x6e74('0x22')](function(_0x45b5ee){_0xdf0419[_0x6e74('0x55')]=_0x45b5ee;return _0xdf0419;})[_0x6e74('0x22')](respondWithFilteredResult(_0x266164,_0x3d9d8b))[_0x6e74('0x56')](handleError(_0x266164,null));};exports['show']=function(_0x15aa78,_0x2e8bd5){var _0x405bf0={'raw':![],'where':{'id':_0x15aa78[_0x6e74('0x57')]['id']}},_0x40d4f1={};_0x40d4f1[_0x6e74('0x3e')]=_[_0x6e74('0x58')](db[_0x6e74('0x3b')]['rawAttributes']);_0x40d4f1[_0x6e74('0x40')]=_[_0x6e74('0x58')](_0x15aa78[_0x6e74('0x40')]);_0x40d4f1[_0x6e74('0x41')]=_[_0x6e74('0x42')](_0x40d4f1['model'],_0x40d4f1[_0x6e74('0x40')]);_0x405bf0[_0x6e74('0x43')]=_['intersection'](_0x40d4f1[_0x6e74('0x3e')],qs[_0x6e74('0x44')](_0x15aa78[_0x6e74('0x40')][_0x6e74('0x44')]));_0x405bf0[_0x6e74('0x43')]=_0x405bf0[_0x6e74('0x43')][_0x6e74('0x45')]?_0x405bf0[_0x6e74('0x43')]:_0x40d4f1['model'];if(_0x15aa78[_0x6e74('0x40')]['includeAll']){_0x405bf0['include']=[{'all':!![]}];}_0x405bf0=_[_0x6e74('0x4e')]({},_0x405bf0,_0x15aa78[_0x6e74('0x51')]);return db[_0x6e74('0x3b')][_0x6e74('0x59')](_0x405bf0)['then'](handleEntityNotFound(_0x2e8bd5,null))[_0x6e74('0x22')](respondWithResult(_0x2e8bd5,null))[_0x6e74('0x56')](handleError(_0x2e8bd5,null));};exports[_0x6e74('0x5a')]=function(_0x1f53ff,_0x59951f){return db[_0x6e74('0x3b')][_0x6e74('0x5a')](_0x1f53ff['body'],{})[_0x6e74('0x22')](respondWithResult(_0x59951f,0xc9))['catch'](handleError(_0x59951f,null));};exports[_0x6e74('0x35')]=function(_0x1375ff,_0x3a9166){if(_0x1375ff[_0x6e74('0x5b')]['id']){delete _0x1375ff[_0x6e74('0x5b')]['id'];}return db[_0x6e74('0x3b')][_0x6e74('0x59')]({'where':{'id':_0x1375ff['params']['id']}})['then'](handleEntityNotFound(_0x3a9166,null))['then'](saveUpdates(_0x1375ff[_0x6e74('0x5b')],null))[_0x6e74('0x22')](respondWithResult(_0x3a9166,null))[_0x6e74('0x56')](handleError(_0x3a9166,null));};exports[_0x6e74('0x36')]=function(_0x59b102,_0x416c3c){return db[_0x6e74('0x3b')]['find']({'where':{'id':_0x59b102[_0x6e74('0x57')]['id']}})[_0x6e74('0x22')](handleEntityNotFound(_0x416c3c,null))[_0x6e74('0x22')](removeEntity(_0x416c3c,null))[_0x6e74('0x56')](handleError(_0x416c3c,null));};exports[_0x6e74('0x5c')]=function(_0x5c7a0e,_0x4875de,_0x456d6f){var _0x43d75d={};var _0x5ec5a2={};var _0x57f023;var _0x2f02f1;return db[_0x6e74('0x3b')][_0x6e74('0x5d')]({'where':{'id':_0x5c7a0e[_0x6e74('0x57')]['id']}})[_0x6e74('0x22')](handleEntityNotFound(_0x4875de,null))[_0x6e74('0x22')](function(_0x509a3b){if(_0x509a3b){_0x57f023=_0x509a3b;_0x5ec5a2[_0x6e74('0x3e')]=_['keys'](db[_0x6e74('0x5e')][_0x6e74('0x3c')]);_0x5ec5a2[_0x6e74('0x40')]=_['keys'](_0x5c7a0e['query']);_0x5ec5a2[_0x6e74('0x41')]=_[_0x6e74('0x42')](_0x5ec5a2[_0x6e74('0x3e')],_0x5ec5a2[_0x6e74('0x40')]);_0x43d75d[_0x6e74('0x43')]=_[_0x6e74('0x42')](_0x5ec5a2[_0x6e74('0x3e')],qs[_0x6e74('0x44')](_0x5c7a0e[_0x6e74('0x40')][_0x6e74('0x44')]));_0x43d75d[_0x6e74('0x43')]=_0x43d75d['attributes'][_0x6e74('0x45')]?_0x43d75d[_0x6e74('0x43')]:_0x5ec5a2[_0x6e74('0x3e')];_0x43d75d['order']=qs[_0x6e74('0x4a')](_0x5c7a0e[_0x6e74('0x40')][_0x6e74('0x4a')]);_0x43d75d[_0x6e74('0x4b')]=qs[_0x6e74('0x41')](_[_0x6e74('0x4c')](_0x5c7a0e[_0x6e74('0x40')],_0x5ec5a2[_0x6e74('0x41')]));if(_0x5c7a0e[_0x6e74('0x40')][_0x6e74('0x4d')]){_0x43d75d[_0x6e74('0x4b')]=_['merge'](_0x43d75d[_0x6e74('0x4b')],{'$or':_[_0x6e74('0x3f')](_0x43d75d[_0x6e74('0x43')],function(_0x469ec5){var _0x34e93b={};_0x34e93b[_0x469ec5]={'$like':'%'+_0x5c7a0e[_0x6e74('0x40')][_0x6e74('0x4d')]+'%'};return _0x34e93b;})});}_0x43d75d=_[_0x6e74('0x4e')]({},_0x43d75d,_0x5c7a0e[_0x6e74('0x51')]);return _0x57f023['getConfigurations'](_0x43d75d);}})[_0x6e74('0x22')](function(_0xceae93){if(_0xceae93){_0x2f02f1=_0xceae93[_0x6e74('0x45')];if(!_0x5c7a0e[_0x6e74('0x40')][_0x6e74('0x46')]('nolimit')){_0x43d75d[_0x6e74('0x48')]=qs[_0x6e74('0x48')](_0x5c7a0e['query'][_0x6e74('0x48')]);_0x43d75d[_0x6e74('0x2f')]=qs['offset'](_0x5c7a0e[_0x6e74('0x40')][_0x6e74('0x2f')]);}return _0x57f023['getConfigurations'](_0x43d75d);}})[_0x6e74('0x22')](function(_0x17f4e5){if(_0x17f4e5){return _0x17f4e5?{'count':_0x2f02f1,'rows':_0x17f4e5}:null;}})[_0x6e74('0x22')](respondWithResult(_0x4875de,null))['catch'](handleError(_0x4875de,null));};exports['addConfiguration']=function(_0x4b68a4,_0x45f612,_0x4d17af){if(_0x4b68a4['body']['id']){delete _0x4b68a4[_0x6e74('0x5b')]['id'];}return db['ZendeskAccount'][_0x6e74('0x5d')]({'where':{'id':_0x4b68a4['params']['id']}})['then'](handleEntityNotFound(_0x45f612,null))[_0x6e74('0x22')](function(_0x565197){if(_0x565197){_0x4b68a4[_0x6e74('0x5b')][_0x6e74('0x5f')]=_0x565197['id'];_0x4b68a4[_0x6e74('0x5b')][_0x6e74('0x60')]=integrations[_0x6e74('0x61')](_0x4b68a4[_0x6e74('0x5b')][_0x6e74('0x62')],_0x4b68a4['body'][_0x6e74('0x4f')]);_0x4b68a4['body']['Descriptions']=integrations[_0x6e74('0x63')](_0x4b68a4[_0x6e74('0x5b')]['channel'],_0x4b68a4[_0x6e74('0x5b')][_0x6e74('0x4f')]);return db['ZendeskConfiguration'][_0x6e74('0x5a')](_0x4b68a4[_0x6e74('0x5b')],{'include':[{'model':db[_0x6e74('0x64')],'as':_0x6e74('0x60')},{'model':db[_0x6e74('0x64')],'as':_0x6e74('0x65')}]});}return null;})[_0x6e74('0x22')](respondWithResult(_0x45f612,null))[_0x6e74('0x56')](handleError(_0x45f612,null));};exports[_0x6e74('0x66')]=function(_0x3b453d,_0x2fb52b,_0x484b4b){var _0x329a64='';return db[_0x6e74('0x3b')][_0x6e74('0x5d')]({'where':{'id':_0x3b453d['params']['id']},'attributes':['id',_0x6e74('0x67'),_0x6e74('0x68'),_0x6e74('0x69'),_0x6e74('0x6a'),_0x6e74('0x6b')]})[_0x6e74('0x22')](handleEntityNotFound(_0x2fb52b,null))[_0x6e74('0x22')](function(_0x39fa07){if(_0x39fa07){_0x329a64=_0x39fa07['remoteUri'];var _0x54a183=_0x329a64['slice'](-0x1);if(_0x54a183==='/'){_0x329a64=_0x329a64[_0x6e74('0x6c')](0x0,_0x329a64[_0x6e74('0x6d')](_0x54a183));}var _0x3d9e59={'method':_0x6e74('0x6e'),'uri':util['format']('%s/%s',_0x329a64,'ticket_fields'),'json':!![]};switch(_0x39fa07[_0x6e74('0x6a')]){case _0x6e74('0x68'):_0x3d9e59[_0x6e74('0x6f')]={'Authorization':util['format'](_0x6e74('0x70'),new Buffer(util['format'](_0x6e74('0x71'),_0x39fa07[_0x6e74('0x67')],_0x39fa07[_0x6e74('0x68')]))[_0x6e74('0x72')]('base64'))};break;case _0x6e74('0x69'):_0x3d9e59[_0x6e74('0x6f')]={'Authorization':util[_0x6e74('0x73')](_0x6e74('0x70'),new Buffer(util['format'](_0x6e74('0x74'),_0x39fa07[_0x6e74('0x67')],_0x39fa07['token']))[_0x6e74('0x72')](_0x6e74('0x75')))};break;default:throw new db['Sequelize']['ValidationError'](_0x6e74('0x76'));}return rp(_0x3d9e59);}})['then'](function(_0x61de0a){if(_0x61de0a){var _0x1a6b4e=[_0x6e74('0x77'),_0x6e74('0x78'),_0x6e74('0x79'),'assignee'];_[_0x6e74('0x7a')](_0x61de0a[_0x6e74('0x7b')],function(_0x28c089){return _0x1a6b4e[_0x6e74('0x7c')](_0x28c089[_0x6e74('0x4f')]);});return{'count':_0x61de0a[_0x6e74('0x7b')][_0x6e74('0x45')],'rows':_[_0x6e74('0x3f')](_0x61de0a['ticket_fields'],function(_0x1e42fe){return{'id':_0x1e42fe['id'],'name':_0x1e42fe['position']>0x7?_0x1e42fe[_0x6e74('0x7d')]:_0x1e42fe[_0x6e74('0x4f')],'custom':_0x1e42fe['position']>0x7?!![]:![],'options':_0x1e42fe[_0x6e74('0x7e')]?_0x1e42fe[_0x6e74('0x7e')]:_0x1e42fe[_0x6e74('0x7f')]?_0x1e42fe[_0x6e74('0x7f')]:[]};})};}})['then'](respondWithResult(_0x2fb52b,null))[_0x6e74('0x56')](function(_0xf47ef9){var _0x5ca655=_0x3b453d['query'][_0x6e74('0x80')]?0x1f4:_0xf47ef9[_0x6e74('0x81')]||0x1f4;logger[_0x6e74('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x6e74('0x66'),_0x5ca655,JSON[_0x6e74('0x82')](_0xf47ef9));delete _0xf47ef9['name'];if(_0x5ca655===0x191){_0x5ca655=0x190;}_0x2fb52b[_0x6e74('0x2b')](_0x5ca655)[_0x6e74('0x39')](_0x3b453d[_0x6e74('0x40')]['test']?{'message':_0x6e74('0x83'),'statusCode':_0xf47ef9['statusCode']}:_0xf47ef9);});}; \ No newline at end of file +var _0x494e=['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','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','save','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','update','find','findOne','getConfigurations','limit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','Subjects','username','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','base64','token','toString','Unknown\x20authentication\x20type','subject','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration'];(function(_0x1ad992,_0x5ddc63){var _0x535234=function(_0x2a0b6){while(--_0x2a0b6){_0x1ad992['push'](_0x1ad992['shift']());}};_0x535234(++_0x5ddc63);}(_0x494e,0xec));var _0xe494=function(_0x53cc7a,_0x1eb47e){_0x53cc7a=_0x53cc7a-0x0;var _0x45dc45=_0x494e[_0x53cc7a];return _0x45dc45;};'use strict';var pdf=require(_0xe494('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe494('0x1'));var zipdir=require(_0xe494('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe494('0x3'));var moment=require(_0xe494('0x4'));var BPromise=require(_0xe494('0x5'));var Mustache=require(_0xe494('0x6'));var util=require(_0xe494('0x7'));var path=require(_0xe494('0x8'));var sox=require(_0xe494('0x9'));var csv=require(_0xe494('0xa'));var ejs=require(_0xe494('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe494('0xc'));var crypto=require('crypto');var jsforce=require(_0xe494('0xd'));var deskjs=require(_0xe494('0xe'));var toCsv=require(_0xe494('0xa'));var querystring=require(_0xe494('0xf'));var Papa=require(_0xe494('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe494('0x11'));var as=require(_0xe494('0x12'));var hardwareService=require(_0xe494('0x13'));var logger=require(_0xe494('0x14'))(_0xe494('0x15'));var utils=require(_0xe494('0x16'));var config=require(_0xe494('0x17'));var db=require(_0xe494('0x18'))['db'];var integrations=require(_0xe494('0x19'));var jayson=require(_0xe494('0x1a'));var client=jayson['client'][_0xe494('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x21a4a4,_0x50f564,_0x47e630){if(_0x47e630){var _0x393a97=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x393a97['test'](_0x50f564)){return _0x21a4a4;}else{throw new db[(_0xe494('0x1c'))][(_0xe494('0x1d'))](_0xe494('0x1e'));}}else{return _0x21a4a4;}}function respondWithRpcPromise(_0x46ae8f,_0x16d8c5,_0x5a44b2,_0x3a28da){return new BPromise(function(_0x57ea70,_0xeb105d){var _0x5615aa=_0x3a28da||client;return _0x5615aa[_0xe494('0x1f')](_0x46ae8f,_0x5a44b2)[_0xe494('0x20')](function(_0x3fe713){logger[_0xe494('0x21')](_0xe494('0x22'),_0x16d8c5,_0xe494('0x23'));logger[_0xe494('0x24')](_0xe494('0x25'),_0x16d8c5,_0xe494('0x23'),JSON[_0xe494('0x26')](_0x3fe713));if(_0x3fe713[_0xe494('0x27')]){if(_0x3fe713[_0xe494('0x27')]['code']===0x1f4){logger[_0xe494('0x27')](_0xe494('0x22'),_0x16d8c5,_0x3fe713[_0xe494('0x27')][_0xe494('0x28')]);return _0xeb105d(_0x3fe713['error'][_0xe494('0x28')]);}logger[_0xe494('0x27')](_0xe494('0x22'),_0x16d8c5,_0x3fe713[_0xe494('0x27')][_0xe494('0x28')]);return _0x57ea70(_0x3fe713['error'][_0xe494('0x28')]);}else{logger[_0xe494('0x21')](_0xe494('0x22'),_0x16d8c5,'request\x20sent');_0x57ea70(_0x3fe713[_0xe494('0x29')][_0xe494('0x28')]);}})['catch'](function(_0x338ca2){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x16d8c5,_0x338ca2);_0xeb105d(_0x338ca2);});});}function respondWithStatusCode(_0x50a180,_0x648fb9){_0x648fb9=_0x648fb9||0xcc;return function(_0x20b57d){if(_0x20b57d){return _0x50a180[_0xe494('0x2a')](_0x648fb9);}return _0x50a180[_0xe494('0x2b')](_0x648fb9)[_0xe494('0x2c')]();};}function respondWithResult(_0x2e71d0,_0x3c9805){_0x3c9805=_0x3c9805||0xc8;return function(_0x36b38c){if(_0x36b38c){return _0x2e71d0[_0xe494('0x2b')](_0x3c9805)[_0xe494('0x2d')](_0x36b38c);}};}function respondWithFilteredResult(_0x2f7c32,_0x5e251d){return function(_0x8ccaa6){if(_0x8ccaa6){var _0x3dea88=_0x8ccaa6[_0xe494('0x2e')],_0x17ecea=_0x5e251d[_0xe494('0x2f')],_0x28a0f3=_0x5e251d[_0xe494('0x2f')]+_0x5e251d['limit'],_0x42fbab;if(_0x28a0f3>=_0x3dea88){_0x28a0f3=_0x3dea88;_0x42fbab=0xc8;}else{_0x42fbab=0xce;}_0x2f7c32['status'](_0x42fbab);return _0x2f7c32[_0xe494('0x30')](_0xe494('0x31'),_0x17ecea+'-'+_0x28a0f3+'/'+_0x3dea88)[_0xe494('0x2d')](_0x8ccaa6);}return null;};}function patchUpdates(_0x267b60){return function(_0x3d1ac3){try{jsonpatch['apply'](_0x3d1ac3,_0x267b60,!![]);}catch(_0x54a897){return BPromise['reject'](_0x54a897);}return _0x3d1ac3[_0xe494('0x32')]();};}function saveUpdates(_0x3ffef6,_0x1010da){return function(_0x506488){if(_0x506488){return _0x506488['update'](_0x3ffef6)[_0xe494('0x20')](function(_0x5105a7){return _0x5105a7;});}return null;};}function removeEntity(_0x98a5f6,_0x176fc5){return function(_0x3a2c1b){if(_0x3a2c1b){return _0x3a2c1b[_0xe494('0x33')]()[_0xe494('0x20')](function(){_0x98a5f6[_0xe494('0x2b')](0xcc)[_0xe494('0x2c')]();});}};}function handleEntityNotFound(_0xf78c9a,_0x5eceba){return function(_0x3e6052){if(!_0x3e6052){_0xf78c9a[_0xe494('0x2a')](0x194);}return _0x3e6052;};}function handleError(_0x13e64d,_0x4c0242){_0x4c0242=_0x4c0242||0x1f4;return function(_0x1d89a5){logger[_0xe494('0x27')](_0x1d89a5[_0xe494('0x34')]);if(_0x1d89a5['name']){delete _0x1d89a5[_0xe494('0x35')];}_0x13e64d['status'](_0x4c0242)[_0xe494('0x36')](_0x1d89a5);};}exports[_0xe494('0x37')]=function(_0x32e70d,_0x56a655){var _0x32d7f8={},_0x5c5f76={},_0x42f763={'count':0x0,'rows':[]};var _0x5ed519=_[_0xe494('0x38')](db[_0xe494('0x39')][_0xe494('0x3a')],function(_0x54a6ca){return{'name':_0x54a6ca[_0xe494('0x3b')],'type':_0x54a6ca[_0xe494('0x3c')][_0xe494('0x3d')]};});_0x5c5f76['model']=_['map'](_0x5ed519,_0xe494('0x35'));_0x5c5f76['query']=_['keys'](_0x32e70d[_0xe494('0x3e')]);_0x5c5f76['filters']=_['intersection'](_0x5c5f76[_0xe494('0x3f')],_0x5c5f76[_0xe494('0x3e')]);_0x32d7f8[_0xe494('0x40')]=_[_0xe494('0x41')](_0x5c5f76['model'],qs[_0xe494('0x42')](_0x32e70d['query'][_0xe494('0x42')]));_0x32d7f8[_0xe494('0x40')]=_0x32d7f8['attributes'][_0xe494('0x43')]?_0x32d7f8[_0xe494('0x40')]:_0x5c5f76[_0xe494('0x3f')];if(!_0x32e70d[_0xe494('0x3e')][_0xe494('0x44')](_0xe494('0x45'))){_0x32d7f8['limit']=qs['limit'](_0x32e70d[_0xe494('0x3e')]['limit']);_0x32d7f8[_0xe494('0x2f')]=qs[_0xe494('0x2f')](_0x32e70d[_0xe494('0x3e')]['offset']);}_0x32d7f8[_0xe494('0x46')]=qs['sort'](_0x32e70d[_0xe494('0x3e')][_0xe494('0x47')]);_0x32d7f8[_0xe494('0x48')]=qs[_0xe494('0x49')](_[_0xe494('0x4a')](_0x32e70d['query'],_0x5c5f76[_0xe494('0x49')]));if(_0x32e70d[_0xe494('0x3e')]['filter']){_0x32d7f8[_0xe494('0x48')]=_['merge'](_0x32d7f8[_0xe494('0x48')],{'$or':_['map'](_0x5ed519,function(_0x433ca5){if(_0x433ca5[_0xe494('0x3c')]!==_0xe494('0x4b')){var _0x25af07={};_0x25af07[_0x433ca5['name']]={'$like':'%'+_0x32e70d[_0xe494('0x3e')][_0xe494('0x4c')]+'%'};return _0x25af07;}})});}_0x32d7f8=_[_0xe494('0x4d')]({},_0x32d7f8,_0x32e70d[_0xe494('0x4e')]);var _0x418767={'where':_0x32d7f8[_0xe494('0x48')]};return db[_0xe494('0x39')][_0xe494('0x2e')](_0x418767)['then'](function(_0x1510c6){_0x42f763[_0xe494('0x2e')]=_0x1510c6;if(_0x32e70d[_0xe494('0x3e')][_0xe494('0x4f')]){_0x32d7f8[_0xe494('0x50')]=[{'all':!![]}];}return db[_0xe494('0x39')][_0xe494('0x51')](_0x32d7f8);})[_0xe494('0x20')](function(_0x4338cd){_0x42f763[_0xe494('0x52')]=_0x4338cd;return _0x42f763;})[_0xe494('0x20')](respondWithFilteredResult(_0x56a655,_0x32d7f8))[_0xe494('0x53')](handleError(_0x56a655,null));};exports[_0xe494('0x54')]=function(_0x415627,_0xfccaa9){var _0x26f4c2={'raw':![],'where':{'id':_0x415627[_0xe494('0x55')]['id']}},_0x84fbee={};_0x84fbee['model']=_['keys'](db[_0xe494('0x39')][_0xe494('0x3a')]);_0x84fbee[_0xe494('0x3e')]=_[_0xe494('0x56')](_0x415627[_0xe494('0x3e')]);_0x84fbee[_0xe494('0x49')]=_[_0xe494('0x41')](_0x84fbee[_0xe494('0x3f')],_0x84fbee[_0xe494('0x3e')]);_0x26f4c2[_0xe494('0x40')]=_[_0xe494('0x41')](_0x84fbee[_0xe494('0x3f')],qs[_0xe494('0x42')](_0x415627['query'][_0xe494('0x42')]));_0x26f4c2[_0xe494('0x40')]=_0x26f4c2[_0xe494('0x40')]['length']?_0x26f4c2[_0xe494('0x40')]:_0x84fbee[_0xe494('0x3f')];if(_0x415627[_0xe494('0x3e')][_0xe494('0x4f')]){_0x26f4c2['include']=[{'all':!![]}];}_0x26f4c2=_[_0xe494('0x4d')]({},_0x26f4c2,_0x415627[_0xe494('0x4e')]);return db[_0xe494('0x39')]['find'](_0x26f4c2)[_0xe494('0x20')](handleEntityNotFound(_0xfccaa9,null))[_0xe494('0x20')](respondWithResult(_0xfccaa9,null))[_0xe494('0x53')](handleError(_0xfccaa9,null));};exports[_0xe494('0x57')]=function(_0x3d0349,_0x25eb03){return db['ZendeskAccount']['create'](_0x3d0349[_0xe494('0x58')],{})[_0xe494('0x20')](respondWithResult(_0x25eb03,0xc9))[_0xe494('0x53')](handleError(_0x25eb03,null));};exports[_0xe494('0x59')]=function(_0x3efec6,_0x19a14f){if(_0x3efec6[_0xe494('0x58')]['id']){delete _0x3efec6[_0xe494('0x58')]['id'];}return db[_0xe494('0x39')][_0xe494('0x5a')]({'where':{'id':_0x3efec6[_0xe494('0x55')]['id']}})[_0xe494('0x20')](handleEntityNotFound(_0x19a14f,null))[_0xe494('0x20')](saveUpdates(_0x3efec6['body'],null))[_0xe494('0x20')](respondWithResult(_0x19a14f,null))[_0xe494('0x53')](handleError(_0x19a14f,null));};exports['destroy']=function(_0x127b9c,_0x315c13){return db[_0xe494('0x39')]['find']({'where':{'id':_0x127b9c[_0xe494('0x55')]['id']}})[_0xe494('0x20')](handleEntityNotFound(_0x315c13,null))[_0xe494('0x20')](removeEntity(_0x315c13,null))[_0xe494('0x53')](handleError(_0x315c13,null));};exports['getConfigurations']=function(_0x588aa2,_0x372615,_0x3cb133){var _0x2dbe21={};var _0x509730={};var _0x20c051;var _0x10f82c;return db[_0xe494('0x39')][_0xe494('0x5b')]({'where':{'id':_0x588aa2['params']['id']}})[_0xe494('0x20')](handleEntityNotFound(_0x372615,null))[_0xe494('0x20')](function(_0x4f8371){if(_0x4f8371){_0x20c051=_0x4f8371;_0x509730[_0xe494('0x3f')]=_[_0xe494('0x56')](db['ZendeskConfiguration']['rawAttributes']);_0x509730[_0xe494('0x3e')]=_['keys'](_0x588aa2[_0xe494('0x3e')]);_0x509730[_0xe494('0x49')]=_[_0xe494('0x41')](_0x509730[_0xe494('0x3f')],_0x509730[_0xe494('0x3e')]);_0x2dbe21['attributes']=_['intersection'](_0x509730['model'],qs[_0xe494('0x42')](_0x588aa2[_0xe494('0x3e')]['fields']));_0x2dbe21[_0xe494('0x40')]=_0x2dbe21[_0xe494('0x40')][_0xe494('0x43')]?_0x2dbe21[_0xe494('0x40')]:_0x509730['model'];_0x2dbe21[_0xe494('0x46')]=qs[_0xe494('0x47')](_0x588aa2['query'][_0xe494('0x47')]);_0x2dbe21[_0xe494('0x48')]=qs[_0xe494('0x49')](_[_0xe494('0x4a')](_0x588aa2[_0xe494('0x3e')],_0x509730[_0xe494('0x49')]));if(_0x588aa2[_0xe494('0x3e')][_0xe494('0x4c')]){_0x2dbe21[_0xe494('0x48')]=_[_0xe494('0x4d')](_0x2dbe21['where'],{'$or':_[_0xe494('0x38')](_0x2dbe21[_0xe494('0x40')],function(_0x1417df){var _0x1e343e={};_0x1e343e[_0x1417df]={'$like':'%'+_0x588aa2[_0xe494('0x3e')][_0xe494('0x4c')]+'%'};return _0x1e343e;})});}_0x2dbe21=_[_0xe494('0x4d')]({},_0x2dbe21,_0x588aa2['options']);return _0x20c051[_0xe494('0x5c')](_0x2dbe21);}})[_0xe494('0x20')](function(_0x5ef875){if(_0x5ef875){_0x10f82c=_0x5ef875[_0xe494('0x43')];if(!_0x588aa2[_0xe494('0x3e')][_0xe494('0x44')]('nolimit')){_0x2dbe21[_0xe494('0x5d')]=qs[_0xe494('0x5d')](_0x588aa2['query'][_0xe494('0x5d')]);_0x2dbe21[_0xe494('0x2f')]=qs[_0xe494('0x2f')](_0x588aa2['query']['offset']);}return _0x20c051[_0xe494('0x5c')](_0x2dbe21);}})[_0xe494('0x20')](function(_0x5ac27e){if(_0x5ac27e){return _0x5ac27e?{'count':_0x10f82c,'rows':_0x5ac27e}:null;}})[_0xe494('0x20')](respondWithResult(_0x372615,null))[_0xe494('0x53')](handleError(_0x372615,null));};exports[_0xe494('0x5e')]=function(_0x16664a,_0x555bbf,_0x5e719f){if(_0x16664a[_0xe494('0x58')]['id']){delete _0x16664a[_0xe494('0x58')]['id'];}return db[_0xe494('0x39')]['findOne']({'where':{'id':_0x16664a[_0xe494('0x55')]['id']}})['then'](handleEntityNotFound(_0x555bbf,null))['then'](function(_0x39ca6f){if(_0x39ca6f){_0x16664a[_0xe494('0x58')][_0xe494('0x5f')]=_0x39ca6f['id'];_0x16664a[_0xe494('0x58')]['Subjects']=integrations[_0xe494('0x60')](_0x16664a['body'][_0xe494('0x61')],_0x16664a[_0xe494('0x58')]['type']);_0x16664a[_0xe494('0x58')][_0xe494('0x62')]=integrations[_0xe494('0x63')](_0x16664a[_0xe494('0x58')]['channel'],_0x16664a[_0xe494('0x58')][_0xe494('0x3c')]);return db[_0xe494('0x64')]['create'](_0x16664a[_0xe494('0x58')],{'include':[{'model':db[_0xe494('0x65')],'as':_0xe494('0x66')},{'model':db[_0xe494('0x65')],'as':_0xe494('0x62')}]});}return null;})[_0xe494('0x20')](respondWithResult(_0x555bbf,null))[_0xe494('0x53')](handleError(_0x555bbf,null));};exports['getFields']=function(_0x123585,_0x12f491,_0x13033a){var _0x913e77='';return db[_0xe494('0x39')]['findOne']({'where':{'id':_0x123585[_0xe494('0x55')]['id']},'attributes':['id',_0xe494('0x67'),'password','token',_0xe494('0x68'),_0xe494('0x69')]})['then'](handleEntityNotFound(_0x12f491,null))[_0xe494('0x20')](function(_0xdaee0f){if(_0xdaee0f){_0x913e77=_0xdaee0f['remoteUri'];var _0x1d1421=_0x913e77[_0xe494('0x6a')](-0x1);if(_0x1d1421==='/'){_0x913e77=_0x913e77[_0xe494('0x6b')](0x0,_0x913e77['lastIndexOf'](_0x1d1421));}var _0x29d9cb={'method':_0xe494('0x6c'),'uri':util[_0xe494('0x6d')](_0xe494('0x6e'),_0x913e77,_0xe494('0x6f')),'json':!![]};switch(_0xdaee0f['authType']){case _0xe494('0x70'):_0x29d9cb[_0xe494('0x71')]={'Authorization':util[_0xe494('0x6d')](_0xe494('0x72'),new Buffer(util[_0xe494('0x6d')]('%s:%s',_0xdaee0f[_0xe494('0x67')],_0xdaee0f[_0xe494('0x70')]))['toString'](_0xe494('0x73')))};break;case'token':_0x29d9cb['headers']={'Authorization':util[_0xe494('0x6d')]('Basic\x20%s',new Buffer(util[_0xe494('0x6d')]('%s/token:%s',_0xdaee0f[_0xe494('0x67')],_0xdaee0f[_0xe494('0x74')]))[_0xe494('0x75')](_0xe494('0x73')))};break;default:throw new db[(_0xe494('0x1c'))][(_0xe494('0x1d'))](_0xe494('0x76'));}return rp(_0x29d9cb);}})[_0xe494('0x20')](function(_0x496153){if(_0x496153){var _0xeeebdc=[_0xe494('0x77'),'description','group',_0xe494('0x78')];_[_0xe494('0x79')](_0x496153[_0xe494('0x6f')],function(_0x255f3c){return _0xeeebdc['includes'](_0x255f3c[_0xe494('0x3c')]);});return{'count':_0x496153[_0xe494('0x6f')]['length'],'rows':_[_0xe494('0x38')](_0x496153['ticket_fields'],function(_0xc5ba8b){return{'id':_0xc5ba8b['id'],'name':_0xc5ba8b[_0xe494('0x7a')]>0x7?_0xc5ba8b[_0xe494('0x7b')]:_0xc5ba8b[_0xe494('0x3c')],'custom':_0xc5ba8b[_0xe494('0x7a')]>0x7?!![]:![],'options':_0xc5ba8b[_0xe494('0x7c')]?_0xc5ba8b[_0xe494('0x7c')]:_0xc5ba8b[_0xe494('0x7d')]?_0xc5ba8b[_0xe494('0x7d')]:[]};})};}})[_0xe494('0x20')](respondWithResult(_0x12f491,null))['catch'](function(_0x4796ac){var _0x3d93d0=_0x123585['query'][_0xe494('0x7e')]?0x1f4:_0x4796ac[_0xe494('0x7f')]||0x1f4;logger[_0xe494('0x27')](_0xe494('0x80'),_0xe494('0x81'),_0x3d93d0,JSON[_0xe494('0x26')](_0x4796ac));delete _0x4796ac[_0xe494('0x35')];if(_0x3d93d0===0x191){_0x3d93d0=0x190;}_0x12f491['status'](_0x3d93d0)['send'](_0x123585[_0xe494('0x3e')][_0xe494('0x7e')]?{'message':_0xe494('0x82'),'statusCode':_0x4796ac[_0xe494('0x7f')]}:_0x4796ac);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index c94b44f..059d65b 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 _0xe4b5=['moment','request-promise','../../config/environment','../../components/integrations/configuration','exports','define','ZendeskAccount','api'];(function(_0x222557,_0x4df3f1){var _0x3c6355=function(_0x3c790a){while(--_0x3c790a){_0x222557['push'](_0x222557['shift']());}};_0x3c6355(++_0x4df3f1);}(_0xe4b5,0x13f));var _0x5e4b=function(_0x2728fc,_0xfe8f79){_0x2728fc=_0x2728fc-0x0;var _0x40936f=_0xe4b5[_0x2728fc];return _0x40936f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5e4b('0x0'));var moment=require(_0x5e4b('0x1'));var BPromise=require('bluebird');var rp=require(_0x5e4b('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e4b('0x3'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x5e4b('0x4'));module[_0x5e4b('0x5')]=function(_0x2116f1,_0x284aa7){return _0x2116f1[_0x5e4b('0x6')](_0x5e4b('0x7'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda6d=['define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x2f36f2,_0x4d879e){var _0x32080a=function(_0x2edf44){while(--_0x2edf44){_0x2f36f2['push'](_0x2f36f2['shift']());}};_0x32080a(++_0x4d879e);}(_0xda6d,0x19b));var _0xdda6=function(_0x3f1117,_0x5de5fd){_0x3f1117=_0x3f1117-0x0;var _0x2a929f=_0xda6d[_0x3f1117];return _0x2a929f;};'use strict';var _=require(_0xdda6('0x0'));var util=require('util');var logger=require(_0xdda6('0x1'))(_0xdda6('0x2'));var moment=require(_0xdda6('0x3'));var BPromise=require(_0xdda6('0x4'));var rp=require(_0xdda6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda6('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xdda6('0x7'));module[_0xdda6('0x8')]=function(_0x504930,_0x20cdda){return _0x504930[_0xdda6('0x9')](_0xdda6('0xa'),attributes,{'tableName':_0xdda6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 127132d..d1be65d 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js +++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','include','map','model','then','ShowZendeskAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0xcb91[_0x376db5];return _0x304c17;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetZendeskAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['ZendeskAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowZendeskAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file +var _0x0713=['findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x25c21f,_0x2f23ee){var _0x232afd=function(_0x1e97fd){while(--_0x1e97fd){_0x25c21f['push'](_0x25c21f['shift']());}};_0x232afd(++_0x2f23ee);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}exports[_0x3071('0x18')]=function(_0x17dbda){var _0x1068d9=this;return new Promise(function(_0x108a83,_0x3acf0e){return db[_0x3071('0x19')][_0x3071('0x1a')]({'raw':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')]['where']||null:null,'attributes':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1d')]||null:null,'limit':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1e')]||null:null,'include':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x17dbda['options']['include'],function(_0x2ce48a){return{'model':db[_0x2ce48a[_0x3071('0x21')]],'as':_0x2ce48a['as'],'attributes':_0x2ce48a[_0x3071('0x1d')],'include':_0x2ce48a[_0x3071('0x1f')]?_[_0x3071('0x20')](_0x2ce48a[_0x3071('0x1f')],function(_0x7a4cb4){return{'model':db[_0x7a4cb4[_0x3071('0x21')]],'as':_0x7a4cb4['as'],'attributes':_0x7a4cb4[_0x3071('0x1d')],'include':_0x7a4cb4['include']?_[_0x3071('0x20')](_0x7a4cb4[_0x3071('0x1f')],function(_0x177138){return{'model':db[_0x177138['model']],'as':_0x177138['as'],'attributes':_0x177138[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x163604){logger[_0x3071('0xd')](_0x3071('0x18'),_0x17dbda);logger[_0x3071('0x10')](_0x3071('0x18'),_0x17dbda,JSON[_0x3071('0x12')](_0x163604));_0x108a83(_0x163604);})[_0x3071('0x17')](function(_0x292205){logger[_0x3071('0x13')]('GetZendeskAccount',_0x292205['message'],_0x17dbda);_0x3acf0e(_0x1068d9[_0x3071('0x13')](0x1f4,_0x292205[_0x3071('0x15')]));});});};exports[_0x3071('0x22')]=function(_0x40be95){var _0x3f6d90=this;return new Promise(function(_0x29538c,_0x32b6b1){return db[_0x3071('0x19')]['find']({'raw':_0x40be95['options']?_0x40be95['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x40be95[_0x3071('0x1b')]?_0x40be95['options'][_0x3071('0x23')]||null:null,'attributes':_0x40be95[_0x3071('0x1b')]?_0x40be95[_0x3071('0x1b')][_0x3071('0x1d')]||null:null,'include':_0x40be95['options']?_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')],function(_0x2068ce){return{'model':db[_0x2068ce[_0x3071('0x21')]],'as':_0x2068ce['as'],'attributes':_0x2068ce[_0x3071('0x1d')],'include':_0x2068ce['include']?_[_0x3071('0x20')](_0x2068ce['include'],function(_0x4fb1ec){return{'model':db[_0x4fb1ec[_0x3071('0x21')]],'as':_0x4fb1ec['as'],'attributes':_0x4fb1ec[_0x3071('0x1d')],'include':_0x4fb1ec['include']?_[_0x3071('0x20')](_0x4fb1ec[_0x3071('0x1f')],function(_0x265d76){return{'model':db[_0x265d76[_0x3071('0x21')]],'as':_0x265d76['as'],'attributes':_0x265d76[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x5610ab){logger[_0x3071('0xd')](_0x3071('0x22'),_0x40be95);logger['debug'](_0x3071('0x22'),_0x40be95,JSON['stringify'](_0x5610ab));_0x29538c(_0x5610ab);})[_0x3071('0x17')](function(_0x43133a){logger['error']('ShowZendeskAccount',_0x43133a[_0x3071('0x15')],_0x40be95);_0x32b6b1(_0x3f6d90[_0x3071('0x13')](0x1f4,_0x43133a[_0x3071('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index f80ba70..536c8ea 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 _0x8a2e=['multer','util','path','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete'];(function(_0x1bbe38,_0x2bff53){var _0x49eb7c=function(_0x4a4db3){while(--_0x4a4db3){_0x1bbe38['push'](_0x1bbe38['shift']());}};_0x49eb7c(++_0x2bff53);}(_0x8a2e,0xfc));var _0xe8a2=function(_0x5f0215,_0x2c7c2b){_0x5f0215=_0x5f0215-0x0;var _0x3f6deb=_0x8a2e[_0x5f0215];return _0x3f6deb;};'use strict';var multer=require(_0xe8a2('0x0'));var util=require(_0xe8a2('0x1'));var path=require(_0xe8a2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xe8a2('0x3'));var interaction=require(_0xe8a2('0x4'));var config=require('../../config/environment');var controller=require(_0xe8a2('0x5'));router[_0xe8a2('0x6')]('/',auth[_0xe8a2('0x7')](),controller[_0xe8a2('0x8')]);router[_0xe8a2('0x6')](_0xe8a2('0x9'),auth[_0xe8a2('0x7')](),controller[_0xe8a2('0xa')]);router[_0xe8a2('0x6')](_0xe8a2('0xb'),auth[_0xe8a2('0x7')](),controller['getFields']);router[_0xe8a2('0x6')]('/:id/subjects',auth[_0xe8a2('0x7')](),controller['getSubjects']);router[_0xe8a2('0x6')]('/:id/descriptions',auth[_0xe8a2('0x7')](),controller[_0xe8a2('0xc')]);router[_0xe8a2('0x6')](_0xe8a2('0xd'),auth[_0xe8a2('0x7')](),controller[_0xe8a2('0xe')]);router[_0xe8a2('0xf')]('/',auth[_0xe8a2('0x7')](),controller[_0xe8a2('0x10')]);router[_0xe8a2('0xf')]('/:id/tags',auth[_0xe8a2('0x7')](),controller[_0xe8a2('0x11')]);router[_0xe8a2('0x12')](_0xe8a2('0x9'),auth[_0xe8a2('0x7')](),controller[_0xe8a2('0x13')]);router[_0xe8a2('0x14')](_0xe8a2('0x9'),auth[_0xe8a2('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbd45=['post','create','setTags','put','delete','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbd45,0x14a));var _0x5bd4=function(_0xf778eb,_0x3fd0ae){_0xf778eb=_0xf778eb-0x0;var _0x26f2ae=_0xbd45[_0xf778eb];return _0x26f2ae;};'use strict';var multer=require(_0x5bd4('0x0'));var util=require('util');var path=require(_0x5bd4('0x1'));var timeout=require('connect-timeout');var express=require(_0x5bd4('0x2'));var router=express[_0x5bd4('0x3')]();var auth=require(_0x5bd4('0x4'));var interaction=require(_0x5bd4('0x5'));var config=require(_0x5bd4('0x6'));var controller=require(_0x5bd4('0x7'));router[_0x5bd4('0x8')]('/',auth['isAuthenticated'](),controller[_0x5bd4('0x9')]);router[_0x5bd4('0x8')](_0x5bd4('0xa'),auth[_0x5bd4('0xb')](),controller[_0x5bd4('0xc')]);router[_0x5bd4('0x8')](_0x5bd4('0xd'),auth[_0x5bd4('0xb')](),controller[_0x5bd4('0xe')]);router[_0x5bd4('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x5bd4('0xf')]);router['get'](_0x5bd4('0x10'),auth['isAuthenticated'](),controller[_0x5bd4('0x11')]);router[_0x5bd4('0x8')](_0x5bd4('0x12'),auth[_0x5bd4('0xb')](),controller[_0x5bd4('0x13')]);router[_0x5bd4('0x14')]('/',auth[_0x5bd4('0xb')](),controller[_0x5bd4('0x15')]);router['post'](_0x5bd4('0x12'),auth[_0x5bd4('0xb')](),controller[_0x5bd4('0x16')]);router[_0x5bd4('0x17')]('/:id',auth[_0x5bd4('0xb')](),controller['update']);router[_0x5bd4('0x18')](_0x5bd4('0xa'),auth[_0x5bd4('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index aa5bf71..865eec5 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 _0x23dc=['STRING','sequelize'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x23dc,0x1c5));var _0xc23d=function(_0x2b5913,_0x52c7c9){_0x2b5913=_0x2b5913-0x0;var _0x3c8ddc=_0x23dc[_0x2b5913];return _0x3c8ddc;};'use strict';var Sequelize=require(_0xc23d('0x0'));module['exports']={'name':{'type':Sequelize[_0xc23d('0x1')]},'description':{'type':Sequelize[_0xc23d('0x1')]}}; \ No newline at end of file +var _0x258b=['STRING','sequelize'];(function(_0x231499,_0x175616){var _0x2e3741=function(_0x440cfe){while(--_0x440cfe){_0x231499['push'](_0x231499['shift']());}};_0x2e3741(++_0x175616);}(_0x258b,0x1e1));var _0xb258=function(_0x256c8a,_0x5427bc){_0x256c8a=_0x256c8a-0x0;var _0x3ac658=_0x258b[_0x256c8a];return _0x3ac658;};'use strict';var Sequelize=require(_0xb258('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb258('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index db56baa..b79d891 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 _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(_0x34dbdb,_0x306082){var _0x5f2149=function(_0x4c990c){while(--_0x4c990c){_0x34dbdb['push'](_0x34dbdb['shift']());}};_0x5f2149(++_0x306082);}(_0x326f,0xd1));var _0xf326=function(_0xdbb2a8,_0x3b1ff8){_0xdbb2a8=_0xdbb2a8-0x0;var _0x431449=_0x326f[_0xdbb2a8];return _0x431449;};'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 +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(_0x2463db,_0x12b669){var _0x5eb642=function(_0x17041b){while(--_0x17041b){_0x2463db['push'](_0x2463db['shift']());}};_0x5eb642(++_0x12b669);}(_0x5fc3,0xa8));var _0x35fc=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x5fc3[_0x44b3bd];return _0x1efc4a;};'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 diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 6b9939e..d68232f 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 _0xc39b=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','util','../../config/logger','rimraf','../../config/environment'];(function(_0x498581,_0x24efe6){var _0x3fda8f=function(_0x377147){while(--_0x377147){_0x498581['push'](_0x498581['shift']());}};_0x3fda8f(++_0x24efe6);}(_0xc39b,0x112));var _0xbc39=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc39b[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xbc39('0x0'));var util=require(_0xbc39('0x1'));var logger=require(_0xbc39('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(_0xbc39('0x3'));var config=require(_0xbc39('0x4'));var attributes=require(_0xbc39('0x5'));module[_0xbc39('0x6')]=function(_0x279be8,_0xced149){return _0x279be8[_0xbc39('0x7')](_0xbc39('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa73b=['../../config/logger','bluebird','path','rimraf','exports','define','ZendeskConfiguration','lodash','util'];(function(_0x446731,_0x4115d9){var _0x27a3ea=function(_0xf8a18){while(--_0xf8a18){_0x446731['push'](_0x446731['shift']());}};_0x27a3ea(++_0x4115d9);}(_0xa73b,0xfa));var _0xba73=function(_0x12ae4c,_0x455af7){_0x12ae4c=_0x12ae4c-0x0;var _0x250cb5=_0xa73b[_0x12ae4c];return _0x250cb5;};'use strict';var _=require(_0xba73('0x0'));var util=require(_0xba73('0x1'));var logger=require(_0xba73('0x2'))('api');var moment=require('moment');var BPromise=require(_0xba73('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba73('0x4'));var rimraf=require(_0xba73('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0xba73('0x6')]=function(_0x288fc3,_0x3a333d){return _0x288fc3[_0xba73('0x7')](_0xba73('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 148a903..6318785 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 _0xe0d2=['../../config/environment','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','code','message','error','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x265f9b,_0xb9aea4){var _0x30cefd=function(_0x43b9e5){while(--_0x43b9e5){_0x265f9b['push'](_0x265f9b['shift']());}};_0x30cefd(++_0xb9aea4);}(_0xe0d2,0x12d));var _0x2e0d=function(_0x281820,_0x322992){_0x281820=_0x281820-0x0;var _0x4a0100=_0xe0d2[_0x281820];return _0x4a0100;};'use strict';var _=require(_0x2e0d('0x0'));var util=require(_0x2e0d('0x1'));var moment=require(_0x2e0d('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e0d('0x3'));var fs=require('fs');var Redis=require(_0x2e0d('0x4'));var db=require(_0x2e0d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e0d('0x6'))('rpc');var config=require(_0x2e0d('0x7'));var jayson=require(_0x2e0d('0x8'));var client=jayson['client'][_0x2e0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14dedd,_0x1c42d1,_0x1b7421){return new BPromise(function(_0xe06a91,_0x53a928){return client[_0x2e0d('0xa')](_0x14dedd,_0x1b7421)[_0x2e0d('0xb')](function(_0x11b34d){logger[_0x2e0d('0xc')](_0x2e0d('0xd'),_0x1c42d1,'request\x20sent');logger[_0x2e0d('0xe')](_0x2e0d('0xf'),_0x1c42d1,_0x2e0d('0x10'),JSON['stringify'](_0x11b34d));if(_0x11b34d['error']){if(_0x11b34d['error'][_0x2e0d('0x11')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x1c42d1,_0x11b34d['error'][_0x2e0d('0x12')]);return _0x53a928(_0x11b34d[_0x2e0d('0x13')][_0x2e0d('0x12')]);}logger[_0x2e0d('0x13')](_0x2e0d('0xd'),_0x1c42d1,_0x11b34d[_0x2e0d('0x13')][_0x2e0d('0x12')]);return _0xe06a91(_0x11b34d[_0x2e0d('0x13')]['message']);}else{logger[_0x2e0d('0xc')](_0x2e0d('0xd'),_0x1c42d1,_0x2e0d('0x10'));_0xe06a91(_0x11b34d[_0x2e0d('0x14')][_0x2e0d('0x12')]);}})[_0x2e0d('0x15')](function(_0x5c5d81){logger[_0x2e0d('0x13')](_0x2e0d('0xd'),_0x1c42d1,_0x5c5d81);_0x53a928(_0x5c5d81);});});} \ No newline at end of file +var _0x581f=['then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xfec150,_0x339032){var _0x408278=function(_0x4f5aa9){while(--_0x4f5aa9){_0xfec150['push'](_0xfec150['shift']());}};_0x408278(++_0x339032);}(_0x581f,0x1a3));var _0xf581=function(_0xa743a6,_0x5b645a){_0xa743a6=_0xa743a6-0x0;var _0x24321c=_0x581f[_0xa743a6];return _0x24321c;};'use strict';var _=require(_0xf581('0x0'));var util=require('util');var moment=require(_0xf581('0x1'));var BPromise=require('bluebird');var rs=require(_0xf581('0x2'));var fs=require('fs');var Redis=require(_0xf581('0x3'));var db=require(_0xf581('0x4'))['db'];var utils=require(_0xf581('0x5'));var logger=require(_0xf581('0x6'))(_0xf581('0x7'));var config=require(_0xf581('0x8'));var jayson=require(_0xf581('0x9'));var client=jayson[_0xf581('0xa')][_0xf581('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5eed2f,_0xafa594,_0x2b1fa6){return new BPromise(function(_0x51ecfd,_0x538667){return client[_0xf581('0xc')](_0x5eed2f,_0x2b1fa6)[_0xf581('0xd')](function(_0x565a1b){logger[_0xf581('0xe')](_0xf581('0xf'),_0xafa594,_0xf581('0x10'));logger[_0xf581('0x11')](_0xf581('0x12'),_0xafa594,_0xf581('0x10'),JSON[_0xf581('0x13')](_0x565a1b));if(_0x565a1b[_0xf581('0x14')]){if(_0x565a1b[_0xf581('0x14')]['code']===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xafa594,_0x565a1b[_0xf581('0x14')][_0xf581('0x15')]);return _0x538667(_0x565a1b[_0xf581('0x14')][_0xf581('0x15')]);}logger[_0xf581('0x14')](_0xf581('0xf'),_0xafa594,_0x565a1b[_0xf581('0x14')]['message']);return _0x51ecfd(_0x565a1b[_0xf581('0x14')][_0xf581('0x15')]);}else{logger[_0xf581('0xe')](_0xf581('0xf'),_0xafa594,_0xf581('0x10'));_0x51ecfd(_0x565a1b[_0xf581('0x16')][_0xf581('0x15')]);}})[_0xf581('0x17')](function(_0x51e807){logger[_0xf581('0x14')](_0xf581('0xf'),_0xafa594,_0x51e807);_0x538667(_0x51e807);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index df649b4..5924243 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 _0xf021=['/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intZendeskField.controller','index'];(function(_0x19babd,_0x1d4ef7){var _0x314eaf=function(_0x24ea35){while(--_0x24ea35){_0x19babd['push'](_0x19babd['shift']());}};_0x314eaf(++_0x1d4ef7);}(_0xf021,0x18f));var _0x1f02=function(_0x24e23d,_0x26684a){_0x24e23d=_0x24e23d-0x0;var _0x14db43=_0xf021[_0x24e23d];return _0x14db43;};'use strict';var multer=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var path=require(_0x1f02('0x2'));var timeout=require(_0x1f02('0x3'));var express=require(_0x1f02('0x4'));var router=express['Router']();var auth=require(_0x1f02('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1f02('0x6'));var controller=require(_0x1f02('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1f02('0x8')]);router['get'](_0x1f02('0x9'),auth[_0x1f02('0xa')](),controller[_0x1f02('0xb')]);router[_0x1f02('0xc')]('/',auth[_0x1f02('0xa')](),controller['create']);router[_0x1f02('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1f02('0xe')](_0x1f02('0x9'),auth[_0x1f02('0xa')](),controller[_0x1f02('0xf')]);module[_0x1f02('0x10')]=router; \ No newline at end of file +var _0x931f=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','put','/:id','update','destroy','multer','util'];(function(_0x3ab14c,_0x4093a1){var _0x423753=function(_0x278031){while(--_0x278031){_0x3ab14c['push'](_0x3ab14c['shift']());}};_0x423753(++_0x4093a1);}(_0x931f,0x184));var _0xf931=function(_0x18b2a3,_0x2a639b){_0x18b2a3=_0x18b2a3-0x0;var _0x50659f=_0x931f[_0x18b2a3];return _0x50659f;};'use strict';var multer=require(_0xf931('0x0'));var util=require(_0xf931('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf931('0x2'));var router=express['Router']();var auth=require(_0xf931('0x3'));var interaction=require(_0xf931('0x4'));var config=require(_0xf931('0x5'));var controller=require('./intZendeskField.controller');router['get']('/',auth[_0xf931('0x6')](),controller[_0xf931('0x7')]);router[_0xf931('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf931('0x9')]);router[_0xf931('0xa')]('/',auth[_0xf931('0x6')](),controller['create']);router[_0xf931('0xb')](_0xf931('0xc'),auth['isAuthenticated'](),controller[_0xf931('0xd')]);router['delete'](_0xf931('0xc'),auth[_0xf931('0x6')](),controller[_0xf931('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 58d8767..31bee93 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 _0x6597=['variable','keyValue','string','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3d2f66,_0x2e8ed1){var _0x151b92=function(_0x8aefd6){while(--_0x8aefd6){_0x3d2f66['push'](_0x3d2f66['shift']());}};_0x151b92(++_0x2e8ed1);}(_0x6597,0x16e));var _0x7659=function(_0x216582,_0x3fd445){_0x216582=_0x216582-0x0;var _0x4312c7=_0x6597[_0x216582];return _0x4312c7;};'use strict';var Sequelize=require(_0x7659('0x0'));module[_0x7659('0x1')]={'type':{'type':Sequelize[_0x7659('0x2')]('string',_0x7659('0x3'),'customVariable',_0x7659('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7659('0x2')](_0x7659('0x5'),_0x7659('0x3'),_0x7659('0x6'))},'keyContent':{'type':Sequelize[_0x7659('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7659('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7659('0x7')]}}; \ No newline at end of file +var _0x25f0=['customVariable','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x2e9b22,_0xfdbb5d){var _0x39217e=function(_0x503692){while(--_0x503692){_0x2e9b22['push'](_0x2e9b22['shift']());}};_0x39217e(++_0xfdbb5d);}(_0x25f0,0x10c));var _0x025f=function(_0x102af2,_0x484bc9){_0x102af2=_0x102af2-0x0;var _0x4eeee2=_0x25f0[_0x102af2];return _0x4eeee2;};'use strict';var Sequelize=require(_0x025f('0x0'));module[_0x025f('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x025f('0x2'),'keyValue'),'defaultValue':_0x025f('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x025f('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x025f('0x3'),'variable',_0x025f('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x025f('0x4')]},'customField':{'type':Sequelize[_0x025f('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x025f('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 5a98077..2146462 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 _0xe6d3=['../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','ZendeskField','includeAll','rows','catch','show','params','include','options','find','create','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xda2e54,_0x42d4a6){var _0x5df4bf=function(_0xd1c82a){while(--_0xd1c82a){_0xda2e54['push'](_0xda2e54['shift']());}};_0x5df4bf(++_0x42d4a6);}(_0xe6d3,0x1c6));var _0x3e6d=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xe6d3[_0x5c351c];return _0x26f3b3;};'use strict';var pdf=require(_0x3e6d('0x0'));var emlformat=require(_0x3e6d('0x1'));var rimraf=require(_0x3e6d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e6d('0x3'));var rp=require(_0x3e6d('0x4'));var moment=require(_0x3e6d('0x5'));var BPromise=require(_0x3e6d('0x6'));var Mustache=require(_0x3e6d('0x7'));var util=require(_0x3e6d('0x8'));var path=require(_0x3e6d('0x9'));var sox=require(_0x3e6d('0xa'));var csv=require(_0x3e6d('0xb'));var ejs=require(_0x3e6d('0xc'));var fs=require('fs');var _=require(_0x3e6d('0xd'));var squel=require(_0x3e6d('0xe'));var crypto=require(_0x3e6d('0xf'));var jsforce=require(_0x3e6d('0x10'));var deskjs=require(_0x3e6d('0x11'));var toCsv=require('to-csv');var querystring=require(_0x3e6d('0x12'));var Papa=require(_0x3e6d('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e6d('0x14'));var as=require(_0x3e6d('0x15'));var hardwareService=require(_0x3e6d('0x16'));var logger=require(_0x3e6d('0x17'))(_0x3e6d('0x18'));var utils=require(_0x3e6d('0x19'));var config=require(_0x3e6d('0x1a'));var db=require(_0x3e6d('0x1b'))['db'];function respondWithStatusCode(_0x42d898,_0x16076d){_0x16076d=_0x16076d||0xcc;return function(_0x4e25b2){if(_0x4e25b2){return _0x42d898[_0x3e6d('0x1c')](_0x16076d);}return _0x42d898[_0x3e6d('0x1d')](_0x16076d)[_0x3e6d('0x1e')]();};}function respondWithResult(_0x128461,_0x5528da){_0x5528da=_0x5528da||0xc8;return function(_0x2cde6e){if(_0x2cde6e){return _0x128461[_0x3e6d('0x1d')](_0x5528da)['json'](_0x2cde6e);}};}function respondWithFilteredResult(_0x19fa31,_0x4e3c62){return function(_0x56cca5){if(_0x56cca5){var _0x1bc577=_0x56cca5[_0x3e6d('0x1f')],_0x2f17aa=_0x4e3c62['offset'],_0x37b9fa=_0x4e3c62['offset']+_0x4e3c62[_0x3e6d('0x20')],_0x1a7494;if(_0x37b9fa>=_0x1bc577){_0x37b9fa=_0x1bc577;_0x1a7494=0xc8;}else{_0x1a7494=0xce;}_0x19fa31['status'](_0x1a7494);return _0x19fa31[_0x3e6d('0x21')](_0x3e6d('0x22'),_0x2f17aa+'-'+_0x37b9fa+'/'+_0x1bc577)[_0x3e6d('0x23')](_0x56cca5);}return null;};}function patchUpdates(_0x262966){return function(_0x411006){try{jsonpatch[_0x3e6d('0x24')](_0x411006,_0x262966,!![]);}catch(_0x54b46a){return BPromise[_0x3e6d('0x25')](_0x54b46a);}return _0x411006[_0x3e6d('0x26')]();};}function saveUpdates(_0x23a8a2,_0x4fc46f){return function(_0x3fe377){if(_0x3fe377){return _0x3fe377[_0x3e6d('0x27')](_0x23a8a2)[_0x3e6d('0x28')](function(_0x514eef){return _0x514eef;});}return null;};}function removeEntity(_0x2e613f,_0x3e1e65){return function(_0x10fb12){if(_0x10fb12){return _0x10fb12['destroy']()['then'](function(){_0x2e613f[_0x3e6d('0x1d')](0xcc)[_0x3e6d('0x1e')]();});}};}function handleEntityNotFound(_0x3abaea,_0x3ac949){return function(_0x70fb08){if(!_0x70fb08){_0x3abaea[_0x3e6d('0x1c')](0x194);}return _0x70fb08;};}function handleError(_0x362e4f,_0x41adea){_0x41adea=_0x41adea||0x1f4;return function(_0x104aac){logger['error'](_0x104aac[_0x3e6d('0x29')]);if(_0x104aac[_0x3e6d('0x2a')]){delete _0x104aac[_0x3e6d('0x2a')];}_0x362e4f['status'](_0x41adea)[_0x3e6d('0x2b')](_0x104aac);};}exports[_0x3e6d('0x2c')]=function(_0x4421c2,_0x415791){var _0x3c3387={},_0x24c9fc={},_0x334e27={'count':0x0,'rows':[]};var _0x1988d0=_[_0x3e6d('0x2d')](db['ZendeskField'][_0x3e6d('0x2e')],function(_0x55e14c){return{'name':_0x55e14c[_0x3e6d('0x2f')],'type':_0x55e14c[_0x3e6d('0x30')][_0x3e6d('0x31')]};});_0x24c9fc[_0x3e6d('0x32')]=_['map'](_0x1988d0,_0x3e6d('0x2a'));_0x24c9fc[_0x3e6d('0x33')]=_[_0x3e6d('0x34')](_0x4421c2[_0x3e6d('0x33')]);_0x24c9fc[_0x3e6d('0x35')]=_['intersection'](_0x24c9fc['model'],_0x24c9fc[_0x3e6d('0x33')]);_0x3c3387[_0x3e6d('0x36')]=_[_0x3e6d('0x37')](_0x24c9fc[_0x3e6d('0x32')],qs[_0x3e6d('0x38')](_0x4421c2[_0x3e6d('0x33')][_0x3e6d('0x38')]));_0x3c3387[_0x3e6d('0x36')]=_0x3c3387[_0x3e6d('0x36')][_0x3e6d('0x39')]?_0x3c3387[_0x3e6d('0x36')]:_0x24c9fc[_0x3e6d('0x32')];if(!_0x4421c2[_0x3e6d('0x33')][_0x3e6d('0x3a')](_0x3e6d('0x3b'))){_0x3c3387[_0x3e6d('0x20')]=qs[_0x3e6d('0x20')](_0x4421c2['query'][_0x3e6d('0x20')]);_0x3c3387[_0x3e6d('0x3c')]=qs[_0x3e6d('0x3c')](_0x4421c2[_0x3e6d('0x33')][_0x3e6d('0x3c')]);}_0x3c3387[_0x3e6d('0x3d')]=qs[_0x3e6d('0x3e')](_0x4421c2['query']['sort']);_0x3c3387[_0x3e6d('0x3f')]=qs[_0x3e6d('0x35')](_[_0x3e6d('0x40')](_0x4421c2['query'],_0x24c9fc[_0x3e6d('0x35')]));if(_0x4421c2['query'][_0x3e6d('0x41')]){_0x3c3387['where']=_[_0x3e6d('0x42')](_0x3c3387[_0x3e6d('0x3f')],{'$or':_['map'](_0x1988d0,function(_0x12e413){if(_0x12e413['type']!==_0x3e6d('0x43')){var _0x58ac42={};_0x58ac42[_0x12e413[_0x3e6d('0x2a')]]={'$like':'%'+_0x4421c2[_0x3e6d('0x33')][_0x3e6d('0x41')]+'%'};return _0x58ac42;}})});}_0x3c3387=_['merge']({},_0x3c3387,_0x4421c2['options']);var _0x527e71={'where':_0x3c3387[_0x3e6d('0x3f')]};return db[_0x3e6d('0x44')][_0x3e6d('0x1f')](_0x527e71)[_0x3e6d('0x28')](function(_0x16c301){_0x334e27[_0x3e6d('0x1f')]=_0x16c301;if(_0x4421c2[_0x3e6d('0x33')][_0x3e6d('0x45')]){_0x3c3387['include']=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x3c3387);})[_0x3e6d('0x28')](function(_0x3f4c11){_0x334e27[_0x3e6d('0x46')]=_0x3f4c11;return _0x334e27;})['then'](respondWithFilteredResult(_0x415791,_0x3c3387))[_0x3e6d('0x47')](handleError(_0x415791,null));};exports[_0x3e6d('0x48')]=function(_0x588ce7,_0x53d430){var _0x23d128={'raw':!![],'where':{'id':_0x588ce7[_0x3e6d('0x49')]['id']}},_0x516d85={};_0x516d85['model']=_[_0x3e6d('0x34')](db['ZendeskField']['rawAttributes']);_0x516d85[_0x3e6d('0x33')]=_['keys'](_0x588ce7['query']);_0x516d85[_0x3e6d('0x35')]=_[_0x3e6d('0x37')](_0x516d85[_0x3e6d('0x32')],_0x516d85['query']);_0x23d128[_0x3e6d('0x36')]=_['intersection'](_0x516d85[_0x3e6d('0x32')],qs[_0x3e6d('0x38')](_0x588ce7[_0x3e6d('0x33')][_0x3e6d('0x38')]));_0x23d128[_0x3e6d('0x36')]=_0x23d128[_0x3e6d('0x36')][_0x3e6d('0x39')]?_0x23d128[_0x3e6d('0x36')]:_0x516d85[_0x3e6d('0x32')];if(_0x588ce7['query'][_0x3e6d('0x45')]){_0x23d128[_0x3e6d('0x4a')]=[{'all':!![]}];}_0x23d128=_[_0x3e6d('0x42')]({},_0x23d128,_0x588ce7[_0x3e6d('0x4b')]);return db[_0x3e6d('0x44')][_0x3e6d('0x4c')](_0x23d128)[_0x3e6d('0x28')](handleEntityNotFound(_0x53d430,null))[_0x3e6d('0x28')](respondWithResult(_0x53d430,null))[_0x3e6d('0x47')](handleError(_0x53d430,null));};exports[_0x3e6d('0x4d')]=function(_0x34b9e6,_0x3b4418){return db['ZendeskField'][_0x3e6d('0x4d')](_0x34b9e6[_0x3e6d('0x4e')],{})[_0x3e6d('0x28')](respondWithResult(_0x3b4418,0xc9))[_0x3e6d('0x47')](handleError(_0x3b4418,null));};exports[_0x3e6d('0x27')]=function(_0x54665b,_0x2c5f22){if(_0x54665b[_0x3e6d('0x4e')]['id']){delete _0x54665b['body']['id'];}return db[_0x3e6d('0x44')][_0x3e6d('0x4c')]({'where':{'id':_0x54665b[_0x3e6d('0x49')]['id']}})[_0x3e6d('0x28')](handleEntityNotFound(_0x2c5f22,null))[_0x3e6d('0x28')](saveUpdates(_0x54665b['body'],null))[_0x3e6d('0x28')](respondWithResult(_0x2c5f22,null))[_0x3e6d('0x47')](handleError(_0x2c5f22,null));};exports[_0x3e6d('0x4f')]=function(_0x4b7fb7,_0x26ca2f){return db[_0x3e6d('0x44')][_0x3e6d('0x4c')]({'where':{'id':_0x4b7fb7[_0x3e6d('0x49')]['id']}})[_0x3e6d('0x28')](handleEntityNotFound(_0x26ca2f,null))[_0x3e6d('0x28')](removeEntity(_0x26ca2f,null))[_0x3e6d('0x47')](handleError(_0x26ca2f,null));}; \ No newline at end of file +var _0x4e43=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','ZendeskField','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv'];(function(_0x4b1012,_0x1415eb){var _0x23d715=function(_0x25f330){while(--_0x25f330){_0x4b1012['push'](_0x4b1012['shift']());}};_0x23d715(++_0x1415eb);}(_0x4e43,0xd6));var _0x34e4=function(_0x5f51d2,_0x4f0133){_0x5f51d2=_0x5f51d2-0x0;var _0x24bf08=_0x4e43[_0x5f51d2];return _0x24bf08;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x34e4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34e4('0x1'));var rp=require('request-promise');var moment=require(_0x34e4('0x2'));var BPromise=require(_0x34e4('0x3'));var Mustache=require(_0x34e4('0x4'));var util=require(_0x34e4('0x5'));var path=require(_0x34e4('0x6'));var sox=require('sox');var csv=require(_0x34e4('0x7'));var ejs=require(_0x34e4('0x8'));var fs=require('fs');var _=require(_0x34e4('0x9'));var squel=require(_0x34e4('0xa'));var crypto=require(_0x34e4('0xb'));var jsforce=require(_0x34e4('0xc'));var deskjs=require(_0x34e4('0xd'));var toCsv=require(_0x34e4('0x7'));var querystring=require(_0x34e4('0xe'));var Papa=require(_0x34e4('0xf'));var Redis=require(_0x34e4('0x10'));var authService=require(_0x34e4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x34e4('0x12'));var hardwareService=require(_0x34e4('0x13'));var logger=require('../../config/logger')(_0x34e4('0x14'));var utils=require('../../config/utils');var config=require(_0x34e4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x404835,_0x598b){_0x598b=_0x598b||0xcc;return function(_0xd83f9){if(_0xd83f9){return _0x404835[_0x34e4('0x16')](_0x598b);}return _0x404835[_0x34e4('0x17')](_0x598b)[_0x34e4('0x18')]();};}function respondWithResult(_0x55f75f,_0x5a464b){_0x5a464b=_0x5a464b||0xc8;return function(_0x1ef26c){if(_0x1ef26c){return _0x55f75f[_0x34e4('0x17')](_0x5a464b)[_0x34e4('0x19')](_0x1ef26c);}};}function respondWithFilteredResult(_0x3b3076,_0x3e6212){return function(_0x309d31){if(_0x309d31){var _0x22eb09=_0x309d31[_0x34e4('0x1a')],_0x3a88c7=_0x3e6212[_0x34e4('0x1b')],_0x4f5ce1=_0x3e6212[_0x34e4('0x1b')]+_0x3e6212['limit'],_0x59e48a;if(_0x4f5ce1>=_0x22eb09){_0x4f5ce1=_0x22eb09;_0x59e48a=0xc8;}else{_0x59e48a=0xce;}_0x3b3076['status'](_0x59e48a);return _0x3b3076[_0x34e4('0x1c')](_0x34e4('0x1d'),_0x3a88c7+'-'+_0x4f5ce1+'/'+_0x22eb09)['json'](_0x309d31);}return null;};}function patchUpdates(_0x33fced){return function(_0x34d3a4){try{jsonpatch[_0x34e4('0x1e')](_0x34d3a4,_0x33fced,!![]);}catch(_0xe0e4ce){return BPromise[_0x34e4('0x1f')](_0xe0e4ce);}return _0x34d3a4['save']();};}function saveUpdates(_0x52d105,_0x3b42b0){return function(_0x5b8c9d){if(_0x5b8c9d){return _0x5b8c9d[_0x34e4('0x20')](_0x52d105)[_0x34e4('0x21')](function(_0x407536){return _0x407536;});}return null;};}function removeEntity(_0x2519c8,_0x2001b1){return function(_0x2fd8f0){if(_0x2fd8f0){return _0x2fd8f0[_0x34e4('0x22')]()[_0x34e4('0x21')](function(){_0x2519c8[_0x34e4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ca4ca,_0x2432d0){return function(_0x370063){if(!_0x370063){_0x1ca4ca[_0x34e4('0x16')](0x194);}return _0x370063;};}function handleError(_0x22ab9e,_0x22da17){_0x22da17=_0x22da17||0x1f4;return function(_0x23ab68){logger[_0x34e4('0x23')](_0x23ab68['stack']);if(_0x23ab68[_0x34e4('0x24')]){delete _0x23ab68[_0x34e4('0x24')];}_0x22ab9e[_0x34e4('0x17')](_0x22da17)[_0x34e4('0x25')](_0x23ab68);};}exports[_0x34e4('0x26')]=function(_0x4c4efa,_0x1ace2e){var _0x425955={},_0x242eec={},_0x132fd8={'count':0x0,'rows':[]};var _0x4e5322=_['map'](db['ZendeskField'][_0x34e4('0x27')],function(_0x474665){return{'name':_0x474665[_0x34e4('0x28')],'type':_0x474665[_0x34e4('0x29')][_0x34e4('0x2a')]};});_0x242eec['model']=_[_0x34e4('0x2b')](_0x4e5322,'name');_0x242eec[_0x34e4('0x2c')]=_['keys'](_0x4c4efa[_0x34e4('0x2c')]);_0x242eec[_0x34e4('0x2d')]=_[_0x34e4('0x2e')](_0x242eec[_0x34e4('0x2f')],_0x242eec[_0x34e4('0x2c')]);_0x425955[_0x34e4('0x30')]=_[_0x34e4('0x2e')](_0x242eec[_0x34e4('0x2f')],qs['fields'](_0x4c4efa['query'][_0x34e4('0x31')]));_0x425955['attributes']=_0x425955[_0x34e4('0x30')]['length']?_0x425955[_0x34e4('0x30')]:_0x242eec['model'];if(!_0x4c4efa[_0x34e4('0x2c')][_0x34e4('0x32')](_0x34e4('0x33'))){_0x425955[_0x34e4('0x34')]=qs[_0x34e4('0x34')](_0x4c4efa[_0x34e4('0x2c')][_0x34e4('0x34')]);_0x425955[_0x34e4('0x1b')]=qs['offset'](_0x4c4efa[_0x34e4('0x2c')][_0x34e4('0x1b')]);}_0x425955[_0x34e4('0x35')]=qs[_0x34e4('0x36')](_0x4c4efa[_0x34e4('0x2c')][_0x34e4('0x36')]);_0x425955[_0x34e4('0x37')]=qs[_0x34e4('0x2d')](_[_0x34e4('0x38')](_0x4c4efa[_0x34e4('0x2c')],_0x242eec[_0x34e4('0x2d')]));if(_0x4c4efa['query']['filter']){_0x425955['where']=_[_0x34e4('0x39')](_0x425955['where'],{'$or':_['map'](_0x4e5322,function(_0x41912b){if(_0x41912b[_0x34e4('0x29')]!==_0x34e4('0x3a')){var _0x50b23b={};_0x50b23b[_0x41912b[_0x34e4('0x24')]]={'$like':'%'+_0x4c4efa[_0x34e4('0x2c')][_0x34e4('0x3b')]+'%'};return _0x50b23b;}})});}_0x425955=_['merge']({},_0x425955,_0x4c4efa[_0x34e4('0x3c')]);var _0x49b943={'where':_0x425955[_0x34e4('0x37')]};return db[_0x34e4('0x3d')][_0x34e4('0x1a')](_0x49b943)[_0x34e4('0x21')](function(_0xdbab7f){_0x132fd8[_0x34e4('0x1a')]=_0xdbab7f;if(_0x4c4efa[_0x34e4('0x2c')][_0x34e4('0x3e')]){_0x425955[_0x34e4('0x3f')]=[{'all':!![]}];}return db[_0x34e4('0x3d')][_0x34e4('0x40')](_0x425955);})[_0x34e4('0x21')](function(_0x1df03b){_0x132fd8[_0x34e4('0x41')]=_0x1df03b;return _0x132fd8;})[_0x34e4('0x21')](respondWithFilteredResult(_0x1ace2e,_0x425955))[_0x34e4('0x42')](handleError(_0x1ace2e,null));};exports[_0x34e4('0x43')]=function(_0x3e2d87,_0xdbbba6){var _0xae8b46={'raw':!![],'where':{'id':_0x3e2d87[_0x34e4('0x44')]['id']}},_0x5aaa04={};_0x5aaa04['model']=_[_0x34e4('0x45')](db[_0x34e4('0x3d')][_0x34e4('0x27')]);_0x5aaa04[_0x34e4('0x2c')]=_[_0x34e4('0x45')](_0x3e2d87['query']);_0x5aaa04['filters']=_[_0x34e4('0x2e')](_0x5aaa04[_0x34e4('0x2f')],_0x5aaa04[_0x34e4('0x2c')]);_0xae8b46['attributes']=_[_0x34e4('0x2e')](_0x5aaa04[_0x34e4('0x2f')],qs[_0x34e4('0x31')](_0x3e2d87[_0x34e4('0x2c')]['fields']));_0xae8b46[_0x34e4('0x30')]=_0xae8b46[_0x34e4('0x30')][_0x34e4('0x46')]?_0xae8b46[_0x34e4('0x30')]:_0x5aaa04['model'];if(_0x3e2d87[_0x34e4('0x2c')][_0x34e4('0x3e')]){_0xae8b46[_0x34e4('0x3f')]=[{'all':!![]}];}_0xae8b46=_[_0x34e4('0x39')]({},_0xae8b46,_0x3e2d87[_0x34e4('0x3c')]);return db[_0x34e4('0x3d')][_0x34e4('0x47')](_0xae8b46)['then'](handleEntityNotFound(_0xdbbba6,null))['then'](respondWithResult(_0xdbbba6,null))['catch'](handleError(_0xdbbba6,null));};exports[_0x34e4('0x48')]=function(_0x588219,_0x5b7b79){return db[_0x34e4('0x3d')][_0x34e4('0x48')](_0x588219[_0x34e4('0x49')],{})[_0x34e4('0x21')](respondWithResult(_0x5b7b79,0xc9))['catch'](handleError(_0x5b7b79,null));};exports[_0x34e4('0x20')]=function(_0x319bd4,_0x39adac){if(_0x319bd4[_0x34e4('0x49')]['id']){delete _0x319bd4['body']['id'];}return db[_0x34e4('0x3d')][_0x34e4('0x47')]({'where':{'id':_0x319bd4['params']['id']}})[_0x34e4('0x21')](handleEntityNotFound(_0x39adac,null))[_0x34e4('0x21')](saveUpdates(_0x319bd4[_0x34e4('0x49')],null))[_0x34e4('0x21')](respondWithResult(_0x39adac,null))['catch'](handleError(_0x39adac,null));};exports[_0x34e4('0x22')]=function(_0x570300,_0x32af4e){return db[_0x34e4('0x3d')][_0x34e4('0x47')]({'where':{'id':_0x570300['params']['id']}})[_0x34e4('0x21')](handleEntityNotFound(_0x32af4e,null))['then'](removeEntity(_0x32af4e,null))[_0x34e4('0x42')](handleError(_0x32af4e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index a3a7742..fd429fa 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 _0x9ffd=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','define'];(function(_0x1fac57,_0x527e2c){var _0x3277f3=function(_0x1b6bd3){while(--_0x1b6bd3){_0x1fac57['push'](_0x1fac57['shift']());}};_0x3277f3(++_0x527e2c);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x6fd413,_0xee3a5f){_0x6fd413=_0x6fd413-0x0;var _0x46cccb=_0x9ffd[_0x6fd413];return _0x46cccb;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('api');var moment=require(_0xd9ff('0x3'));var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var fs=require('fs');var path=require(_0xd9ff('0x6'));var rimraf=require('rimraf');var config=require(_0xd9ff('0x7'));var attributes=require(_0xd9ff('0x8'));module['exports']=function(_0x3aa26b,_0x2982c3){return _0x3aa26b[_0xd9ff('0x9')](_0xd9ff('0xa'),attributes,{'tableName':_0xd9ff('0xb'),'paranoid':![],'indexes':[{'name':_0xd9ff('0xc'),'fields':[_0xd9ff('0xd'),_0xd9ff('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x980c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x980c,0x100));var _0xc980=function(_0xea00e7,_0x2d23a){_0xea00e7=_0xea00e7-0x0;var _0x9cfa91=_0x980c[_0xea00e7];return _0x9cfa91;};'use strict';var _=require(_0xc980('0x0'));var util=require(_0xc980('0x1'));var logger=require(_0xc980('0x2'))(_0xc980('0x3'));var moment=require(_0xc980('0x4'));var BPromise=require(_0xc980('0x5'));var rp=require(_0xc980('0x6'));var fs=require('fs');var path=require(_0xc980('0x7'));var rimraf=require(_0xc980('0x8'));var config=require(_0xc980('0x9'));var attributes=require(_0xc980('0xa'));module['exports']=function(_0x472ece,_0x311a54){return _0x472ece[_0xc980('0xb')](_0xc980('0xc'),attributes,{'tableName':_0xc980('0xd'),'paranoid':![],'indexes':[{'name':_0xc980('0xe'),'fields':[_0xc980('0xf'),'FieldId'],'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 6ab03fa..5b01970 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 _0x3497=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x405193,_0x16eb67){var _0x36dfe1=function(_0x1ac2e9){while(--_0x1ac2e9){_0x405193['push'](_0x405193['shift']());}};_0x36dfe1(++_0x16eb67);}(_0x3497,0x1b2));var _0x7349=function(_0x9df3d8,_0x4074e3){_0x9df3d8=_0x9df3d8-0x0;var _0x366da1=_0x3497[_0x9df3d8];return _0x366da1;};'use strict';var _=require(_0x7349('0x0'));var util=require(_0x7349('0x1'));var moment=require(_0x7349('0x2'));var BPromise=require(_0x7349('0x3'));var rs=require(_0x7349('0x4'));var fs=require('fs');var Redis=require(_0x7349('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7349('0x6'));var logger=require('../../config/logger')(_0x7349('0x7'));var config=require(_0x7349('0x8'));var jayson=require(_0x7349('0x9'));var client=jayson[_0x7349('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59eba8,_0x57cfca,_0x58730d){return new BPromise(function(_0x31d8ce,_0x5f52ae){return client[_0x7349('0xb')](_0x59eba8,_0x58730d)[_0x7349('0xc')](function(_0x3dc08e){logger[_0x7349('0xd')](_0x7349('0xe'),_0x57cfca,_0x7349('0xf'));logger[_0x7349('0x10')](_0x7349('0x11'),_0x57cfca,_0x7349('0xf'),JSON[_0x7349('0x12')](_0x3dc08e));if(_0x3dc08e['error']){if(_0x3dc08e[_0x7349('0x13')]['code']===0x1f4){logger['error'](_0x7349('0xe'),_0x57cfca,_0x3dc08e[_0x7349('0x13')][_0x7349('0x14')]);return _0x5f52ae(_0x3dc08e[_0x7349('0x13')]['message']);}logger[_0x7349('0x13')](_0x7349('0xe'),_0x57cfca,_0x3dc08e['error'][_0x7349('0x14')]);return _0x31d8ce(_0x3dc08e[_0x7349('0x13')]['message']);}else{logger[_0x7349('0xd')](_0x7349('0xe'),_0x57cfca,'request\x20sent');_0x31d8ce(_0x3dc08e['result'][_0x7349('0x14')]);}})[_0x7349('0x15')](function(_0x2873cb){logger[_0x7349('0x13')](_0x7349('0xe'),_0x57cfca,_0x2873cb);_0x5f52ae(_0x2873cb);});});} \ No newline at end of file +var _0x10ba=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskField,\x20%s,\x20%s'];(function(_0x1fc5fe,_0x51d294){var _0x291f26=function(_0x2f5316){while(--_0x2f5316){_0x1fc5fe['push'](_0x1fc5fe['shift']());}};_0x291f26(++_0x51d294);}(_0x10ba,0x13b));var _0xa10b=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0x10ba[_0x5cc8];return _0x450661;};'use strict';var _=require(_0xa10b('0x0'));var util=require(_0xa10b('0x1'));var moment=require(_0xa10b('0x2'));var BPromise=require('bluebird');var rs=require(_0xa10b('0x3'));var fs=require('fs');var Redis=require(_0xa10b('0x4'));var db=require(_0xa10b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa10b('0x6'))(_0xa10b('0x7'));var config=require(_0xa10b('0x8'));var jayson=require(_0xa10b('0x9'));var client=jayson['client'][_0xa10b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ad570,_0x315a64,_0x5ac38c){return new BPromise(function(_0x236983,_0x308a4f){return client[_0xa10b('0xb')](_0x3ad570,_0x5ac38c)[_0xa10b('0xc')](function(_0x3d3b68){logger[_0xa10b('0xd')]('ZendeskField,\x20%s,\x20%s',_0x315a64,'request\x20sent');logger[_0xa10b('0xe')](_0xa10b('0xf'),_0x315a64,_0xa10b('0x10'),JSON[_0xa10b('0x11')](_0x3d3b68));if(_0x3d3b68[_0xa10b('0x12')]){if(_0x3d3b68['error'][_0xa10b('0x13')]===0x1f4){logger[_0xa10b('0x12')](_0xa10b('0x14'),_0x315a64,_0x3d3b68['error']['message']);return _0x308a4f(_0x3d3b68[_0xa10b('0x12')][_0xa10b('0x15')]);}logger[_0xa10b('0x12')](_0xa10b('0x14'),_0x315a64,_0x3d3b68[_0xa10b('0x12')][_0xa10b('0x15')]);return _0x236983(_0x3d3b68['error']['message']);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x315a64,'request\x20sent');_0x236983(_0x3d3b68[_0xa10b('0x16')]['message']);}})[_0xa10b('0x17')](function(_0x26f91a){logger['error']('ZendeskField,\x20%s,\x20%s',_0x315a64,_0x26f91a);_0x308a4f(_0x26f91a);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index e09f9f0..2c7647e 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 _0x09fb=['./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy','multer','util','connect-timeout','express','../../components/interaction/service'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0x09fb,0xa6));var _0xb09f=function(_0x39d348,_0x55148c){_0x39d348=_0x39d348-0x0;var _0x29aba6=_0x09fb[_0x39d348];return _0x29aba6;};'use strict';var multer=require(_0xb09f('0x0'));var util=require(_0xb09f('0x1'));var path=require('path');var timeout=require(_0xb09f('0x2'));var express=require(_0xb09f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb09f('0x4'));var config=require('../../config/environment');var controller=require(_0xb09f('0x5'));router[_0xb09f('0x6')]('/',auth[_0xb09f('0x7')](),controller['index']);router['get'](_0xb09f('0x8'),auth[_0xb09f('0x7')](),controller[_0xb09f('0x9')]);router['get'](_0xb09f('0xa'),auth[_0xb09f('0x7')](),controller[_0xb09f('0xb')]);router[_0xb09f('0x6')](_0xb09f('0xc'),auth[_0xb09f('0x7')](),controller[_0xb09f('0xd')]);router[_0xb09f('0xe')]('/',auth['isAuthenticated'](),controller[_0xb09f('0xf')]);router[_0xb09f('0xe')](_0xb09f('0xa'),auth[_0xb09f('0x7')](),controller['addConfiguration']);router[_0xb09f('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb09f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb09f('0x12')]);module['exports']=router; \ No newline at end of file +var _0x03ce=['getFields','create','post','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','/:id/fields'];(function(_0x16e0a6,_0x18e7f6){var _0x5e15cf=function(_0x266c66){while(--_0x266c66){_0x16e0a6['push'](_0x16e0a6['shift']());}};_0x5e15cf(++_0x18e7f6);}(_0x03ce,0xc8));var _0xe03c=function(_0x225684,_0x5caaa3){_0x225684=_0x225684-0x0;var _0x18a08e=_0x03ce[_0x225684];return _0x18a08e;};'use strict';var multer=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var path=require(_0xe03c('0x2'));var timeout=require(_0xe03c('0x3'));var express=require(_0xe03c('0x4'));var router=express[_0xe03c('0x5')]();var auth=require(_0xe03c('0x6'));var interaction=require(_0xe03c('0x7'));var config=require(_0xe03c('0x8'));var controller=require(_0xe03c('0x9'));router[_0xe03c('0xa')]('/',auth['isAuthenticated'](),controller[_0xe03c('0xb')]);router[_0xe03c('0xa')](_0xe03c('0xc'),auth[_0xe03c('0xd')](),controller['show']);router[_0xe03c('0xa')](_0xe03c('0xe'),auth[_0xe03c('0xd')](),controller['getConfigurations']);router['get'](_0xe03c('0xf'),auth['isAuthenticated'](),controller[_0xe03c('0x10')]);router['post']('/',auth[_0xe03c('0xd')](),controller[_0xe03c('0x11')]);router[_0xe03c('0x12')](_0xe03c('0xe'),auth[_0xe03c('0xd')](),controller[_0xe03c('0x13')]);router[_0xe03c('0x14')](_0xe03c('0xc'),auth[_0xe03c('0xd')](),controller[_0xe03c('0x15')]);router[_0xe03c('0x16')]('/:id',auth[_0xe03c('0xd')](),controller['destroy']);module[_0xe03c('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index ef7f721..8ed0ec7 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 _0x1d1e=['exports','STRING','sequelize'];(function(_0x181760,_0x45d0c7){var _0x5baa90=function(_0x461c18){while(--_0x461c18){_0x181760['push'](_0x181760['shift']());}};_0x5baa90(++_0x45d0c7);}(_0x1d1e,0xdd));var _0xe1d1=function(_0xbc6705,_0x4ad91f){_0xbc6705=_0xbc6705-0x0;var _0x99954=_0x1d1e[_0xbc6705];return _0x99954;};'use strict';var Sequelize=require(_0xe1d1('0x0'));module[_0xe1d1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xe1d1('0x2')]},'zone':{'type':Sequelize[_0xe1d1('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xe1d1('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0xe1d1('0x2')]},'refreshToken':{'type':Sequelize[_0xe1d1('0x2')]}}; \ No newline at end of file +var _0x2355=['exports','STRING','sequelize'];(function(_0x356b7a,_0x34f197){var _0x24bc41=function(_0xc991d5){while(--_0xc991d5){_0x356b7a['push'](_0x356b7a['shift']());}};_0x24bc41(++_0x34f197);}(_0x2355,0x1df));var _0x5235=function(_0xf012e7,_0x486904){_0xf012e7=_0xf012e7-0x0;var _0x16b497=_0x2355[_0xf012e7];return _0x16b497;};'use strict';var Sequelize=require(_0x5235('0x0'));module[_0x5235('0x1')]={'name':{'type':Sequelize[_0x5235('0x2')]},'description':{'type':Sequelize[_0x5235('0x2')]},'host':{'type':Sequelize[_0x5235('0x2')]},'zone':{'type':Sequelize[_0x5235('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x5235('0x2')]},'serverUrl':{'type':Sequelize[_0x5235('0x2')]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x5235('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 8cd157a..ee8a1d1 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 _0x2d0c=['send','index','map','ZohoAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','merge','where','filter','include','findAll','rows','show','params','includeAll','options','find','create','body','findOne','pick','hasOwnProperty','getConfigurations','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','zoho.eu','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','custom_field','data_type','pick_list_values','test','statusCode','getFields','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','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','stringify','error','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','stack','name'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x2d0c,0x1e2));var _0xc2d0=function(_0x26658e,_0x1bb1a9){_0x26658e=_0x26658e-0x0;var _0x572802=_0x2d0c[_0x26658e];return _0x572802;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc2d0('0x0'));var rimraf=require(_0xc2d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc2d0('0x2'));var rp=require(_0xc2d0('0x3'));var moment=require(_0xc2d0('0x4'));var BPromise=require(_0xc2d0('0x5'));var Mustache=require(_0xc2d0('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc2d0('0x7'));var ejs=require(_0xc2d0('0x8'));var fs=require('fs');var _=require(_0xc2d0('0x9'));var squel=require(_0xc2d0('0xa'));var crypto=require('crypto');var jsforce=require(_0xc2d0('0xb'));var deskjs=require(_0xc2d0('0xc'));var toCsv=require(_0xc2d0('0x7'));var querystring=require(_0xc2d0('0xd'));var Papa=require(_0xc2d0('0xe'));var Redis=require(_0xc2d0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc2d0('0x10'));var as=require(_0xc2d0('0x11'));var hardwareService=require(_0xc2d0('0x12'));var logger=require(_0xc2d0('0x13'))(_0xc2d0('0x14'));var utils=require(_0xc2d0('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xc2d0('0x16'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x8d7675,_0x1191e2,_0x51a7ba){if(_0x51a7ba){var _0x42311c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42311c['test'](_0x1191e2)){return _0x8d7675;}else{throw new db['Sequelize'][(_0xc2d0('0x17'))](_0xc2d0('0x18'));}}else{return _0x8d7675;}}function respondWithRpcPromise(_0x369c1f,_0x2d2723,_0x2e895b,_0x450f50){return new BPromise(function(_0x31355d,_0x57db09){var _0x382d0d=_0x450f50||client;return _0x382d0d[_0xc2d0('0x19')](_0x369c1f,_0x2e895b)['then'](function(_0x226fde){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x2d2723,_0xc2d0('0x1a'));logger[_0xc2d0('0x1b')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2d2723,_0xc2d0('0x1a'),JSON[_0xc2d0('0x1c')](_0x226fde));if(_0x226fde[_0xc2d0('0x1d')]){if(_0x226fde[_0xc2d0('0x1d')]['code']===0x1f4){logger['error'](_0xc2d0('0x1e'),_0x2d2723,_0x226fde[_0xc2d0('0x1d')][_0xc2d0('0x1f')]);return _0x57db09(_0x226fde[_0xc2d0('0x1d')][_0xc2d0('0x1f')]);}logger[_0xc2d0('0x1d')](_0xc2d0('0x1e'),_0x2d2723,_0x226fde[_0xc2d0('0x1d')][_0xc2d0('0x1f')]);return _0x31355d(_0x226fde[_0xc2d0('0x1d')][_0xc2d0('0x1f')]);}else{logger[_0xc2d0('0x20')](_0xc2d0('0x1e'),_0x2d2723,_0xc2d0('0x1a'));_0x31355d(_0x226fde[_0xc2d0('0x21')]['message']);}})[_0xc2d0('0x22')](function(_0x13db6c){logger[_0xc2d0('0x1d')](_0xc2d0('0x1e'),_0x2d2723,_0x13db6c);_0x57db09(_0x13db6c);});});}function respondWithStatusCode(_0xb04b08,_0x548804){_0x548804=_0x548804||0xcc;return function(_0x3f164a){if(_0x3f164a){return _0xb04b08[_0xc2d0('0x23')](_0x548804);}return _0xb04b08[_0xc2d0('0x24')](_0x548804)[_0xc2d0('0x25')]();};}function respondWithResult(_0x5a7487,_0x2f8299){_0x2f8299=_0x2f8299||0xc8;return function(_0x573286){if(_0x573286){return _0x5a7487['status'](_0x2f8299)[_0xc2d0('0x26')](_0x573286);}};}function respondWithFilteredResult(_0x291962,_0x4aa645){return function(_0x55a61a){if(_0x55a61a){var _0x1d256d=_0x55a61a[_0xc2d0('0x27')],_0x56830c=_0x4aa645[_0xc2d0('0x28')],_0x1423cf=_0x4aa645[_0xc2d0('0x28')]+_0x4aa645[_0xc2d0('0x29')],_0x3b8b02;if(_0x1423cf>=_0x1d256d){_0x1423cf=_0x1d256d;_0x3b8b02=0xc8;}else{_0x3b8b02=0xce;}_0x291962[_0xc2d0('0x24')](_0x3b8b02);return _0x291962[_0xc2d0('0x2a')](_0xc2d0('0x2b'),_0x56830c+'-'+_0x1423cf+'/'+_0x1d256d)[_0xc2d0('0x26')](_0x55a61a);}return null;};}function patchUpdates(_0x3ab4de){return function(_0x5e3b96){try{jsonpatch[_0xc2d0('0x2c')](_0x5e3b96,_0x3ab4de,!![]);}catch(_0x9fdfc7){return BPromise[_0xc2d0('0x2d')](_0x9fdfc7);}return _0x5e3b96['save']();};}function saveUpdates(_0x27ccb0,_0x2e7ee9){return function(_0x594f30){if(_0x594f30){return _0x594f30['update'](_0x27ccb0)[_0xc2d0('0x2e')](function(_0x158def){return _0x158def;});}return null;};}function removeEntity(_0x552a36,_0x48440c){return function(_0x21d845){if(_0x21d845){return _0x21d845[_0xc2d0('0x2f')]()['then'](function(){_0x552a36[_0xc2d0('0x24')](0xcc)[_0xc2d0('0x25')]();});}};}function handleEntityNotFound(_0x23edb8,_0x18f2cc){return function(_0x35471e){if(!_0x35471e){_0x23edb8[_0xc2d0('0x23')](0x194);}return _0x35471e;};}function handleError(_0x3082e8,_0x4d2907){_0x4d2907=_0x4d2907||0x1f4;return function(_0x4c5bd3){logger[_0xc2d0('0x1d')](_0x4c5bd3[_0xc2d0('0x30')]);if(_0x4c5bd3[_0xc2d0('0x31')]){delete _0x4c5bd3['name'];}_0x3082e8['status'](_0x4d2907)[_0xc2d0('0x32')](_0x4c5bd3);};}exports[_0xc2d0('0x33')]=function(_0x384c92,_0x122913){var _0x456368={},_0x384d89={},_0x587530={'count':0x0,'rows':[]};var _0x1d8453=_[_0xc2d0('0x34')](db[_0xc2d0('0x35')][_0xc2d0('0x36')],function(_0x469f17){return{'name':_0x469f17['fieldName'],'type':_0x469f17[_0xc2d0('0x37')][_0xc2d0('0x38')]};});_0x384d89[_0xc2d0('0x39')]=_[_0xc2d0('0x34')](_0x1d8453,_0xc2d0('0x31'));_0x384d89[_0xc2d0('0x3a')]=_[_0xc2d0('0x3b')](_0x384c92[_0xc2d0('0x3a')]);_0x384d89[_0xc2d0('0x3c')]=_[_0xc2d0('0x3d')](_0x384d89['model'],_0x384d89['query']);_0x456368['attributes']=_[_0xc2d0('0x3d')](_0x384d89[_0xc2d0('0x39')],qs[_0xc2d0('0x3e')](_0x384c92[_0xc2d0('0x3a')][_0xc2d0('0x3e')]));_0x456368[_0xc2d0('0x3f')]=_0x456368[_0xc2d0('0x3f')][_0xc2d0('0x40')]?_0x456368[_0xc2d0('0x3f')]:_0x384d89[_0xc2d0('0x39')];if(!_0x384c92[_0xc2d0('0x3a')]['hasOwnProperty']('nolimit')){_0x456368[_0xc2d0('0x29')]=qs[_0xc2d0('0x29')](_0x384c92['query'][_0xc2d0('0x29')]);_0x456368[_0xc2d0('0x28')]=qs[_0xc2d0('0x28')](_0x384c92[_0xc2d0('0x3a')][_0xc2d0('0x28')]);}_0x456368[_0xc2d0('0x41')]=qs[_0xc2d0('0x42')](_0x384c92[_0xc2d0('0x3a')]['sort']);_0x456368['where']=qs[_0xc2d0('0x3c')](_['pick'](_0x384c92[_0xc2d0('0x3a')],_0x384d89[_0xc2d0('0x3c')]));if(_0x384c92['query']['filter']){_0x456368['where']=_[_0xc2d0('0x43')](_0x456368[_0xc2d0('0x44')],{'$or':_['map'](_0x1d8453,function(_0x41d567){if(_0x41d567['type']!=='VIRTUAL'){var _0x11010d={};_0x11010d[_0x41d567[_0xc2d0('0x31')]]={'$like':'%'+_0x384c92['query'][_0xc2d0('0x45')]+'%'};return _0x11010d;}})});}_0x456368=_[_0xc2d0('0x43')]({},_0x456368,_0x384c92['options']);var _0x16c3ee={'where':_0x456368[_0xc2d0('0x44')]};return db[_0xc2d0('0x35')][_0xc2d0('0x27')](_0x16c3ee)[_0xc2d0('0x2e')](function(_0x5507c2){_0x587530[_0xc2d0('0x27')]=_0x5507c2;if(_0x384c92['query']['includeAll']){_0x456368[_0xc2d0('0x46')]=[{'all':!![]}];}return db['ZohoAccount'][_0xc2d0('0x47')](_0x456368);})[_0xc2d0('0x2e')](function(_0x420dec){_0x587530[_0xc2d0('0x48')]=_0x420dec;return _0x587530;})['then'](respondWithFilteredResult(_0x122913,_0x456368))[_0xc2d0('0x22')](handleError(_0x122913,null));};exports[_0xc2d0('0x49')]=function(_0xa37704,_0x3ea9ef){var _0x3146ce={'raw':![],'where':{'id':_0xa37704[_0xc2d0('0x4a')]['id']}},_0x47c1cc={};_0x47c1cc[_0xc2d0('0x39')]=_['keys'](db[_0xc2d0('0x35')][_0xc2d0('0x36')]);_0x47c1cc[_0xc2d0('0x3a')]=_['keys'](_0xa37704[_0xc2d0('0x3a')]);_0x47c1cc['filters']=_[_0xc2d0('0x3d')](_0x47c1cc['model'],_0x47c1cc[_0xc2d0('0x3a')]);_0x3146ce[_0xc2d0('0x3f')]=_[_0xc2d0('0x3d')](_0x47c1cc[_0xc2d0('0x39')],qs[_0xc2d0('0x3e')](_0xa37704['query'][_0xc2d0('0x3e')]));_0x3146ce['attributes']=_0x3146ce['attributes'][_0xc2d0('0x40')]?_0x3146ce[_0xc2d0('0x3f')]:_0x47c1cc[_0xc2d0('0x39')];if(_0xa37704['query'][_0xc2d0('0x4b')]){_0x3146ce[_0xc2d0('0x46')]=[{'all':!![]}];}_0x3146ce=_[_0xc2d0('0x43')]({},_0x3146ce,_0xa37704[_0xc2d0('0x4c')]);return db[_0xc2d0('0x35')][_0xc2d0('0x4d')](_0x3146ce)[_0xc2d0('0x2e')](handleEntityNotFound(_0x3ea9ef,null))[_0xc2d0('0x2e')](respondWithResult(_0x3ea9ef,null))[_0xc2d0('0x22')](handleError(_0x3ea9ef,null));};exports[_0xc2d0('0x4e')]=function(_0x3eeac6,_0x39dfef){return db[_0xc2d0('0x35')][_0xc2d0('0x4e')](_0x3eeac6[_0xc2d0('0x4f')],{})[_0xc2d0('0x2e')](respondWithResult(_0x39dfef,0xc9))[_0xc2d0('0x22')](handleError(_0x39dfef,null));};exports['update']=function(_0x43071a,_0x3c5506){if(_0x43071a['body']['id']){delete _0x43071a[_0xc2d0('0x4f')]['id'];}return db[_0xc2d0('0x35')]['find']({'where':{'id':_0x43071a[_0xc2d0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c5506,null))[_0xc2d0('0x2e')](saveUpdates(_0x43071a[_0xc2d0('0x4f')],null))['then'](respondWithResult(_0x3c5506,null))[_0xc2d0('0x22')](handleError(_0x3c5506,null));};exports[_0xc2d0('0x2f')]=function(_0x50400b,_0x2af5bf){return db[_0xc2d0('0x35')][_0xc2d0('0x4d')]({'where':{'id':_0x50400b[_0xc2d0('0x4a')]['id']}})[_0xc2d0('0x2e')](handleEntityNotFound(_0x2af5bf,null))[_0xc2d0('0x2e')](removeEntity(_0x2af5bf,null))[_0xc2d0('0x22')](handleError(_0x2af5bf,null));};exports['getConfigurations']=function(_0x1ce504,_0x2c4490,_0x9e0fd5){var _0x112868={};var _0x36ec33={};var _0x231b5c;var _0x12c9c0;return db[_0xc2d0('0x35')][_0xc2d0('0x50')]({'where':{'id':_0x1ce504['params']['id']}})[_0xc2d0('0x2e')](handleEntityNotFound(_0x2c4490,null))[_0xc2d0('0x2e')](function(_0x1bc47c){if(_0x1bc47c){_0x231b5c=_0x1bc47c;_0x36ec33[_0xc2d0('0x39')]=_[_0xc2d0('0x3b')](db['ZohoConfiguration'][_0xc2d0('0x36')]);_0x36ec33[_0xc2d0('0x3a')]=_[_0xc2d0('0x3b')](_0x1ce504[_0xc2d0('0x3a')]);_0x36ec33['filters']=_['intersection'](_0x36ec33[_0xc2d0('0x39')],_0x36ec33[_0xc2d0('0x3a')]);_0x112868[_0xc2d0('0x3f')]=_['intersection'](_0x36ec33[_0xc2d0('0x39')],qs[_0xc2d0('0x3e')](_0x1ce504['query'][_0xc2d0('0x3e')]));_0x112868[_0xc2d0('0x3f')]=_0x112868[_0xc2d0('0x3f')]['length']?_0x112868[_0xc2d0('0x3f')]:_0x36ec33['model'];_0x112868[_0xc2d0('0x41')]=qs[_0xc2d0('0x42')](_0x1ce504[_0xc2d0('0x3a')][_0xc2d0('0x42')]);_0x112868[_0xc2d0('0x44')]=qs[_0xc2d0('0x3c')](_[_0xc2d0('0x51')](_0x1ce504[_0xc2d0('0x3a')],_0x36ec33[_0xc2d0('0x3c')]));if(_0x1ce504['query']['filter']){_0x112868[_0xc2d0('0x44')]=_[_0xc2d0('0x43')](_0x112868[_0xc2d0('0x44')],{'$or':_[_0xc2d0('0x34')](_0x112868['attributes'],function(_0x1f2c18){var _0x4b566f={};_0x4b566f[_0x1f2c18]={'$like':'%'+_0x1ce504[_0xc2d0('0x3a')]['filter']+'%'};return _0x4b566f;})});}_0x112868=_[_0xc2d0('0x43')]({},_0x112868,_0x1ce504[_0xc2d0('0x4c')]);return _0x231b5c['getConfigurations'](_0x112868);}})[_0xc2d0('0x2e')](function(_0x16fbd6){if(_0x16fbd6){_0x12c9c0=_0x16fbd6[_0xc2d0('0x40')];if(!_0x1ce504[_0xc2d0('0x3a')][_0xc2d0('0x52')]('nolimit')){_0x112868[_0xc2d0('0x29')]=qs['limit'](_0x1ce504[_0xc2d0('0x3a')][_0xc2d0('0x29')]);_0x112868[_0xc2d0('0x28')]=qs[_0xc2d0('0x28')](_0x1ce504[_0xc2d0('0x3a')][_0xc2d0('0x28')]);}return _0x231b5c[_0xc2d0('0x53')](_0x112868);}})[_0xc2d0('0x2e')](function(_0x2a979e){if(_0x2a979e){return _0x2a979e?{'count':_0x12c9c0,'rows':_0x2a979e}:null;}})[_0xc2d0('0x2e')](respondWithResult(_0x2c4490,null))[_0xc2d0('0x22')](handleError(_0x2c4490,null));};exports['addConfiguration']=function(_0xeaf54b,_0x1de1e0,_0x5bfa4b){if(_0xeaf54b[_0xc2d0('0x4f')]['id']){delete _0xeaf54b['body']['id'];}return db[_0xc2d0('0x35')][_0xc2d0('0x50')]({'where':{'id':_0xeaf54b[_0xc2d0('0x4a')]['id']}})[_0xc2d0('0x2e')](handleEntityNotFound(_0x1de1e0,null))['then'](function(_0x44a6ab){if(_0x44a6ab){_0xeaf54b[_0xc2d0('0x4f')]['AccountId']=_0x44a6ab['id'];_0xeaf54b[_0xc2d0('0x4f')][_0xc2d0('0x54')]=integrations[_0xc2d0('0x55')](_0xeaf54b['body'][_0xc2d0('0x56')],_0xeaf54b[_0xc2d0('0x4f')][_0xc2d0('0x37')]);_0xeaf54b[_0xc2d0('0x4f')][_0xc2d0('0x57')]=integrations[_0xc2d0('0x58')](_0xeaf54b[_0xc2d0('0x4f')]['channel'],_0xeaf54b[_0xc2d0('0x4f')][_0xc2d0('0x37')]);return db[_0xc2d0('0x59')][_0xc2d0('0x4e')](_0xeaf54b['body'],{'include':[{'model':db[_0xc2d0('0x5a')],'as':_0xc2d0('0x54')},{'model':db[_0xc2d0('0x5a')],'as':'Descriptions'}]});}return null;})[_0xc2d0('0x2e')](respondWithResult(_0x1de1e0,null))[_0xc2d0('0x22')](handleError(_0x1de1e0,null));};function getAccessToken(_0x1557fb){return new Promise(function(_0x4d109a,_0x3b3b21){var _0x34c1a5;switch(_0x1557fb[_0xc2d0('0x5b')]){case'US':_0x34c1a5=_0xc2d0('0x5c');break;case'AU':_0x34c1a5=_0xc2d0('0x5d');break;case'EU':_0x34c1a5=_0xc2d0('0x5e');break;case'IN':_0x34c1a5=_0xc2d0('0x5f');break;case'CN':_0x34c1a5=_0xc2d0('0x60');break;default:_0x34c1a5=_0xc2d0('0x5e');break;}var _0x58f6f4={'method':_0xc2d0('0x61'),'uri':_0x34c1a5+_0xc2d0('0x62'),'qs':{'refresh_token':_0x1557fb[_0xc2d0('0x63')],'client_id':_0x1557fb[_0xc2d0('0x64')],'client_secret':_0x1557fb[_0xc2d0('0x65')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x58f6f4)[_0xc2d0('0x2e')](function(_0xb8cbe0){if(_0xb8cbe0['access_token']){_0x4d109a(_0xb8cbe0[_0xc2d0('0x66')]);}else{_0x3b3b21(_0xc2d0('0x67'));}})['catch'](function(_0x530320){_0x3b3b21(_0x530320);});});}exports['getFields']=function(_0x3ce75d,_0x4647b3,_0x4f8549){var _0x474e19,_0xa2b439,_0x39a2cd,_0x4e70b1,_0x42545d;return db['ZohoAccount'][_0xc2d0('0x50')]({'where':{'id':_0x3ce75d[_0xc2d0('0x4a')]['id']},'attributes':['id',_0xc2d0('0x68'),_0xc2d0('0x5b'),_0xc2d0('0x64'),_0xc2d0('0x65'),_0xc2d0('0x69'),'code',_0xc2d0('0x63')]})[_0xc2d0('0x2e')](handleEntityNotFound(_0x4647b3,null))[_0xc2d0('0x2e')](function(_0x31f2f5){_0x42545d=_0x31f2f5;_0x474e19=_0x42545d[_0xc2d0('0x68')];_0xa2b439=_0x474e19===_0xc2d0('0x6a')?'eu':_0xc2d0('0x6b');_0x39a2cd=_0x42545d[_0xc2d0('0x69')];var _0x137a3a=_0x39a2cd[_0xc2d0('0x6c')](-0x1);if(_0x137a3a==='/'||_0x137a3a==='\x5c'||_0x137a3a===':'){_0x39a2cd=_0x39a2cd[_0xc2d0('0x6d')](0x0,_0x39a2cd['lastIndexOf'](_0x137a3a));}if(!_0x42545d[_0xc2d0('0x63')]){throw new Error(_0xc2d0('0x6e'));}return getAccessToken(_0x42545d);})[_0xc2d0('0x2e')](function(_0x5be03f){if(_0x5be03f){return rp({'method':_0xc2d0('0x6f'),'uri':util[_0xc2d0('0x70')](_0xc2d0('0x71'),_0xa2b439),'qs':{'module':_0xc2d0('0x72')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5be03f},'json':!![]});}})[_0xc2d0('0x2e')](function(_0x448aa3){if(_0x448aa3){if(_0x448aa3[_0xc2d0('0x73')]&&_0x448aa3[_0xc2d0('0x73')][_0xc2d0('0x1d')]){throw new Error(_0x448aa3['response']['error']['message']);}var _0x2b6fb3=[];var _0x594f73=[];var _0x1a599a=['Owner',_0xc2d0('0x74'),_0xc2d0('0x75'),_0xc2d0('0x76'),_0xc2d0('0x77'),_0xc2d0('0x78'),_0xc2d0('0x79'),'Call_Type'];_0x594f73=_[_0xc2d0('0x7a')](_0x448aa3[_0xc2d0('0x3e')],function(_0x430709){return _0x1a599a[_0xc2d0('0x7b')](_0x430709[_0xc2d0('0x7c')]);});for(var _0xebbf45=0x0;_0xebbf45<_0x594f73[_0xc2d0('0x40')];_0xebbf45++){if(_0x594f73[_0xebbf45][_0xc2d0('0x7d')]===![]){_0x2b6fb3['push']({'id':_0x594f73[_0xebbf45]['id'],'name':_0x594f73[_0xebbf45]['display_label'],'custom':_0x594f73[_0xebbf45][_0xc2d0('0x7e')],'options':_0x594f73[_0xebbf45][_0xc2d0('0x7f')]==='picklist'&&_0x594f73[_0xebbf45][_0xc2d0('0x80')][_0xc2d0('0x40')]>-0x1?_[_0xc2d0('0x34')](_0x594f73[_0xebbf45][_0xc2d0('0x80')],function(_0x16bead){return{'name':_0x16bead,'value':_0x16bead};}):[]});}}return{'count':_0x2b6fb3[_0xc2d0('0x40')],'rows':_0x2b6fb3};}else{return{'count':0x0,'rows':[]};}})[_0xc2d0('0x2e')](respondWithResult(_0x4647b3,null))['catch'](function(_0x1bf649){var _0x401777=_0x3ce75d[_0xc2d0('0x3a')][_0xc2d0('0x81')]?0x1f4:_0x1bf649[_0xc2d0('0x82')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xc2d0('0x83'),_0x401777,JSON['stringify'](_0x1bf649));delete _0x1bf649[_0xc2d0('0x31')];if(_0x401777===0x191){_0x401777=0x190;}_0x4647b3[_0xc2d0('0x24')](_0x401777)[_0xc2d0('0x32')](_0x3ce75d['query'][_0xc2d0('0x81')]?{'message':_0xc2d0('0x84'),'statusCode':_0x1bf649[_0xc2d0('0x82')]}:_0x1bf649);});}; \ No newline at end of file +var _0x9525=['host','clientSecret','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','GET','format','Calls','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Type','includes','api_name','system_mandatory','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','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~!@#$%^&-_=+[{]}.','info','request\x20sent','error','code','message','ZohoAccount,\x20%s,\x20%s','result','catch','sendStatus','status','count','offset','set','json','apply','reject','save','update','then','end','stack','name','send','index','ZohoAccount','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','map','type','VIRTUAL','options','includeAll','include','rows','show','rawAttributes','length','merge','find','create','body','params','getConfigurations','findOne','keys','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','ZohoField','zone','https://accounts.zoho.in','https://accounts.zoho.eu','POST','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields'];(function(_0x30bf2f,_0x5b8415){var _0x2ba797=function(_0xd09e6f){while(--_0xd09e6f){_0x30bf2f['push'](_0x30bf2f['shift']());}};_0x2ba797(++_0x5b8415);}(_0x9525,0x12e));var _0x5952=function(_0x4fd6af,_0x44f868){_0x4fd6af=_0x4fd6af-0x0;var _0x5b5883=_0x9525[_0x4fd6af];return _0x5b5883;};'use strict';var pdf=require(_0x5952('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5952('0x1'));var zipdir=require(_0x5952('0x2'));var jsonpatch=require(_0x5952('0x3'));var rp=require(_0x5952('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5952('0x5'));var util=require(_0x5952('0x6'));var path=require('path');var sox=require(_0x5952('0x7'));var csv=require(_0x5952('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5952('0x9'));var squel=require(_0x5952('0xa'));var crypto=require(_0x5952('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5952('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5952('0xd'));var Papa=require(_0x5952('0xe'));var Redis=require('ioredis');var authService=require(_0x5952('0xf'));var qs=require(_0x5952('0x10'));var as=require(_0x5952('0x11'));var hardwareService=require(_0x5952('0x12'));var logger=require(_0x5952('0x13'))(_0x5952('0x14'));var utils=require(_0x5952('0x15'));var config=require('../../config/environment');var db=require(_0x5952('0x16'))['db'];var integrations=require(_0x5952('0x17'));var jayson=require(_0x5952('0x18'));var client=jayson[_0x5952('0x19')][_0x5952('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2d3105,_0x1bc893,_0xd6aadc){if(_0xd6aadc){var _0x1692ef=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1692ef['test'](_0x1bc893)){return _0x2d3105;}else{throw new db[(_0x5952('0x1b'))][(_0x5952('0x1c'))](_0x5952('0x1d'));}}else{return _0x2d3105;}}function respondWithRpcPromise(_0x458d76,_0x42b6ae,_0x300ace,_0x2ad52){return new BPromise(function(_0x6edc27,_0x258c8c){var _0x29a648=_0x2ad52||client;return _0x29a648['request'](_0x458d76,_0x300ace)['then'](function(_0x36c55e){logger[_0x5952('0x1e')]('ZohoAccount,\x20%s,\x20%s',_0x42b6ae,_0x5952('0x1f'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x42b6ae,_0x5952('0x1f'),JSON['stringify'](_0x36c55e));if(_0x36c55e[_0x5952('0x20')]){if(_0x36c55e[_0x5952('0x20')][_0x5952('0x21')]===0x1f4){logger[_0x5952('0x20')]('ZohoAccount,\x20%s,\x20%s',_0x42b6ae,_0x36c55e[_0x5952('0x20')][_0x5952('0x22')]);return _0x258c8c(_0x36c55e['error'][_0x5952('0x22')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x42b6ae,_0x36c55e[_0x5952('0x20')][_0x5952('0x22')]);return _0x6edc27(_0x36c55e[_0x5952('0x20')][_0x5952('0x22')]);}else{logger[_0x5952('0x1e')](_0x5952('0x23'),_0x42b6ae,_0x5952('0x1f'));_0x6edc27(_0x36c55e[_0x5952('0x24')][_0x5952('0x22')]);}})[_0x5952('0x25')](function(_0x1c9dad){logger[_0x5952('0x20')](_0x5952('0x23'),_0x42b6ae,_0x1c9dad);_0x258c8c(_0x1c9dad);});});}function respondWithStatusCode(_0x5865ae,_0x1bb960){_0x1bb960=_0x1bb960||0xcc;return function(_0x4d80bf){if(_0x4d80bf){return _0x5865ae[_0x5952('0x26')](_0x1bb960);}return _0x5865ae[_0x5952('0x27')](_0x1bb960)['end']();};}function respondWithResult(_0x4af503,_0x1f0677){_0x1f0677=_0x1f0677||0xc8;return function(_0x1aff25){if(_0x1aff25){return _0x4af503[_0x5952('0x27')](_0x1f0677)['json'](_0x1aff25);}};}function respondWithFilteredResult(_0x33fa7c,_0x309b96){return function(_0x494d93){if(_0x494d93){var _0xcb56bb=_0x494d93[_0x5952('0x28')],_0x85130d=_0x309b96['offset'],_0xeb01ba=_0x309b96[_0x5952('0x29')]+_0x309b96['limit'],_0x3d5362;if(_0xeb01ba>=_0xcb56bb){_0xeb01ba=_0xcb56bb;_0x3d5362=0xc8;}else{_0x3d5362=0xce;}_0x33fa7c['status'](_0x3d5362);return _0x33fa7c[_0x5952('0x2a')]('Content-Range',_0x85130d+'-'+_0xeb01ba+'/'+_0xcb56bb)[_0x5952('0x2b')](_0x494d93);}return null;};}function patchUpdates(_0x3894a4){return function(_0x51e07e){try{jsonpatch[_0x5952('0x2c')](_0x51e07e,_0x3894a4,!![]);}catch(_0x196234){return BPromise[_0x5952('0x2d')](_0x196234);}return _0x51e07e[_0x5952('0x2e')]();};}function saveUpdates(_0x5ea1cf,_0x48e181){return function(_0x38e347){if(_0x38e347){return _0x38e347[_0x5952('0x2f')](_0x5ea1cf)[_0x5952('0x30')](function(_0x33e4ef){return _0x33e4ef;});}return null;};}function removeEntity(_0x361ce7,_0x4654c8){return function(_0x151c39){if(_0x151c39){return _0x151c39['destroy']()[_0x5952('0x30')](function(){_0x361ce7['status'](0xcc)[_0x5952('0x31')]();});}};}function handleEntityNotFound(_0x551674,_0xfa276c){return function(_0x49982a){if(!_0x49982a){_0x551674[_0x5952('0x26')](0x194);}return _0x49982a;};}function handleError(_0x5f2074,_0x153d05){_0x153d05=_0x153d05||0x1f4;return function(_0x5469c8){logger[_0x5952('0x20')](_0x5469c8[_0x5952('0x32')]);if(_0x5469c8[_0x5952('0x33')]){delete _0x5469c8['name'];}_0x5f2074[_0x5952('0x27')](_0x153d05)[_0x5952('0x34')](_0x5469c8);};}exports[_0x5952('0x35')]=function(_0x46e972,_0x3a8ffc){var _0x19a4ed={},_0x85d521={},_0xaf01fd={'count':0x0,'rows':[]};var _0x4c00f7=_['map'](db[_0x5952('0x36')]['rawAttributes'],function(_0x57c591){return{'name':_0x57c591['fieldName'],'type':_0x57c591['type'][_0x5952('0x37')]};});_0x85d521[_0x5952('0x38')]=_['map'](_0x4c00f7,_0x5952('0x33'));_0x85d521[_0x5952('0x39')]=_['keys'](_0x46e972[_0x5952('0x39')]);_0x85d521['filters']=_[_0x5952('0x3a')](_0x85d521[_0x5952('0x38')],_0x85d521[_0x5952('0x39')]);_0x19a4ed[_0x5952('0x3b')]=_[_0x5952('0x3a')](_0x85d521[_0x5952('0x38')],qs[_0x5952('0x3c')](_0x46e972[_0x5952('0x39')][_0x5952('0x3c')]));_0x19a4ed[_0x5952('0x3b')]=_0x19a4ed['attributes']['length']?_0x19a4ed['attributes']:_0x85d521[_0x5952('0x38')];if(!_0x46e972[_0x5952('0x39')][_0x5952('0x3d')](_0x5952('0x3e'))){_0x19a4ed[_0x5952('0x3f')]=qs[_0x5952('0x3f')](_0x46e972[_0x5952('0x39')][_0x5952('0x3f')]);_0x19a4ed['offset']=qs[_0x5952('0x29')](_0x46e972[_0x5952('0x39')][_0x5952('0x29')]);}_0x19a4ed[_0x5952('0x40')]=qs[_0x5952('0x41')](_0x46e972['query'][_0x5952('0x41')]);_0x19a4ed[_0x5952('0x42')]=qs[_0x5952('0x43')](_[_0x5952('0x44')](_0x46e972[_0x5952('0x39')],_0x85d521['filters']));if(_0x46e972[_0x5952('0x39')][_0x5952('0x45')]){_0x19a4ed[_0x5952('0x42')]=_['merge'](_0x19a4ed['where'],{'$or':_[_0x5952('0x46')](_0x4c00f7,function(_0x51ec4b){if(_0x51ec4b[_0x5952('0x47')]!==_0x5952('0x48')){var _0x1cdbda={};_0x1cdbda[_0x51ec4b[_0x5952('0x33')]]={'$like':'%'+_0x46e972[_0x5952('0x39')]['filter']+'%'};return _0x1cdbda;}})});}_0x19a4ed=_['merge']({},_0x19a4ed,_0x46e972[_0x5952('0x49')]);var _0x48d5d7={'where':_0x19a4ed['where']};return db[_0x5952('0x36')][_0x5952('0x28')](_0x48d5d7)[_0x5952('0x30')](function(_0x5e7936){_0xaf01fd[_0x5952('0x28')]=_0x5e7936;if(_0x46e972[_0x5952('0x39')][_0x5952('0x4a')]){_0x19a4ed[_0x5952('0x4b')]=[{'all':!![]}];}return db[_0x5952('0x36')]['findAll'](_0x19a4ed);})[_0x5952('0x30')](function(_0x1e6fbd){_0xaf01fd[_0x5952('0x4c')]=_0x1e6fbd;return _0xaf01fd;})['then'](respondWithFilteredResult(_0x3a8ffc,_0x19a4ed))[_0x5952('0x25')](handleError(_0x3a8ffc,null));};exports[_0x5952('0x4d')]=function(_0x437bae,_0x5621a5){var _0x2b6f26={'raw':![],'where':{'id':_0x437bae['params']['id']}},_0x19a22e={};_0x19a22e['model']=_['keys'](db[_0x5952('0x36')][_0x5952('0x4e')]);_0x19a22e[_0x5952('0x39')]=_['keys'](_0x437bae[_0x5952('0x39')]);_0x19a22e[_0x5952('0x43')]=_[_0x5952('0x3a')](_0x19a22e[_0x5952('0x38')],_0x19a22e[_0x5952('0x39')]);_0x2b6f26[_0x5952('0x3b')]=_[_0x5952('0x3a')](_0x19a22e['model'],qs[_0x5952('0x3c')](_0x437bae[_0x5952('0x39')][_0x5952('0x3c')]));_0x2b6f26['attributes']=_0x2b6f26[_0x5952('0x3b')][_0x5952('0x4f')]?_0x2b6f26[_0x5952('0x3b')]:_0x19a22e[_0x5952('0x38')];if(_0x437bae[_0x5952('0x39')][_0x5952('0x4a')]){_0x2b6f26[_0x5952('0x4b')]=[{'all':!![]}];}_0x2b6f26=_[_0x5952('0x50')]({},_0x2b6f26,_0x437bae['options']);return db[_0x5952('0x36')][_0x5952('0x51')](_0x2b6f26)['then'](handleEntityNotFound(_0x5621a5,null))[_0x5952('0x30')](respondWithResult(_0x5621a5,null))[_0x5952('0x25')](handleError(_0x5621a5,null));};exports['create']=function(_0x534fbd,_0x55a060){return db[_0x5952('0x36')][_0x5952('0x52')](_0x534fbd[_0x5952('0x53')],{})['then'](respondWithResult(_0x55a060,0xc9))['catch'](handleError(_0x55a060,null));};exports['update']=function(_0x2a3e54,_0x2d6e1b){if(_0x2a3e54[_0x5952('0x53')]['id']){delete _0x2a3e54[_0x5952('0x53')]['id'];}return db[_0x5952('0x36')][_0x5952('0x51')]({'where':{'id':_0x2a3e54[_0x5952('0x54')]['id']}})[_0x5952('0x30')](handleEntityNotFound(_0x2d6e1b,null))[_0x5952('0x30')](saveUpdates(_0x2a3e54[_0x5952('0x53')],null))[_0x5952('0x30')](respondWithResult(_0x2d6e1b,null))[_0x5952('0x25')](handleError(_0x2d6e1b,null));};exports['destroy']=function(_0x18a727,_0xdfee29){return db[_0x5952('0x36')]['find']({'where':{'id':_0x18a727[_0x5952('0x54')]['id']}})['then'](handleEntityNotFound(_0xdfee29,null))[_0x5952('0x30')](removeEntity(_0xdfee29,null))[_0x5952('0x25')](handleError(_0xdfee29,null));};exports[_0x5952('0x55')]=function(_0x252fb5,_0x19748f,_0x598172){var _0x511f9b={};var _0x413ab4={};var _0xd89520;var _0xe4c2a3;return db['ZohoAccount'][_0x5952('0x56')]({'where':{'id':_0x252fb5['params']['id']}})['then'](handleEntityNotFound(_0x19748f,null))[_0x5952('0x30')](function(_0x111064){if(_0x111064){_0xd89520=_0x111064;_0x413ab4[_0x5952('0x38')]=_[_0x5952('0x57')](db[_0x5952('0x58')][_0x5952('0x4e')]);_0x413ab4[_0x5952('0x39')]=_[_0x5952('0x57')](_0x252fb5[_0x5952('0x39')]);_0x413ab4[_0x5952('0x43')]=_['intersection'](_0x413ab4[_0x5952('0x38')],_0x413ab4[_0x5952('0x39')]);_0x511f9b[_0x5952('0x3b')]=_[_0x5952('0x3a')](_0x413ab4['model'],qs[_0x5952('0x3c')](_0x252fb5['query'][_0x5952('0x3c')]));_0x511f9b[_0x5952('0x3b')]=_0x511f9b[_0x5952('0x3b')][_0x5952('0x4f')]?_0x511f9b[_0x5952('0x3b')]:_0x413ab4['model'];_0x511f9b[_0x5952('0x40')]=qs[_0x5952('0x41')](_0x252fb5[_0x5952('0x39')][_0x5952('0x41')]);_0x511f9b[_0x5952('0x42')]=qs['filters'](_[_0x5952('0x44')](_0x252fb5[_0x5952('0x39')],_0x413ab4[_0x5952('0x43')]));if(_0x252fb5[_0x5952('0x39')][_0x5952('0x45')]){_0x511f9b['where']=_['merge'](_0x511f9b[_0x5952('0x42')],{'$or':_[_0x5952('0x46')](_0x511f9b['attributes'],function(_0x245263){var _0x3ead9a={};_0x3ead9a[_0x245263]={'$like':'%'+_0x252fb5[_0x5952('0x39')]['filter']+'%'};return _0x3ead9a;})});}_0x511f9b=_['merge']({},_0x511f9b,_0x252fb5[_0x5952('0x49')]);return _0xd89520[_0x5952('0x55')](_0x511f9b);}})[_0x5952('0x30')](function(_0xe87891){if(_0xe87891){_0xe4c2a3=_0xe87891[_0x5952('0x4f')];if(!_0x252fb5[_0x5952('0x39')][_0x5952('0x3d')](_0x5952('0x3e'))){_0x511f9b['limit']=qs[_0x5952('0x3f')](_0x252fb5[_0x5952('0x39')][_0x5952('0x3f')]);_0x511f9b[_0x5952('0x29')]=qs[_0x5952('0x29')](_0x252fb5[_0x5952('0x39')][_0x5952('0x29')]);}return _0xd89520[_0x5952('0x55')](_0x511f9b);}})['then'](function(_0x193807){if(_0x193807){return _0x193807?{'count':_0xe4c2a3,'rows':_0x193807}:null;}})[_0x5952('0x30')](respondWithResult(_0x19748f,null))[_0x5952('0x25')](handleError(_0x19748f,null));};exports[_0x5952('0x59')]=function(_0x78e8c1,_0x3d6881,_0x10630e){if(_0x78e8c1[_0x5952('0x53')]['id']){delete _0x78e8c1[_0x5952('0x53')]['id'];}return db[_0x5952('0x36')][_0x5952('0x56')]({'where':{'id':_0x78e8c1[_0x5952('0x54')]['id']}})['then'](handleEntityNotFound(_0x3d6881,null))[_0x5952('0x30')](function(_0x2e01fc){if(_0x2e01fc){_0x78e8c1['body'][_0x5952('0x5a')]=_0x2e01fc['id'];_0x78e8c1[_0x5952('0x53')][_0x5952('0x5b')]=integrations[_0x5952('0x5c')](_0x78e8c1[_0x5952('0x53')]['channel'],_0x78e8c1['body'][_0x5952('0x47')]);_0x78e8c1['body'][_0x5952('0x5d')]=integrations['getDescriptions'](_0x78e8c1[_0x5952('0x53')][_0x5952('0x5e')],_0x78e8c1['body'][_0x5952('0x47')]);return db['ZohoConfiguration'][_0x5952('0x52')](_0x78e8c1[_0x5952('0x53')],{'include':[{'model':db[_0x5952('0x5f')],'as':'Subjects'},{'model':db[_0x5952('0x5f')],'as':_0x5952('0x5d')}]});}return null;})[_0x5952('0x30')](respondWithResult(_0x3d6881,null))[_0x5952('0x25')](handleError(_0x3d6881,null));};function getAccessToken(_0x2b4d68){return new Promise(function(_0x31c121,_0x2e1cd7){var _0x38eb5b;switch(_0x2b4d68[_0x5952('0x60')]){case'US':_0x38eb5b='https://accounts.zoho.com';break;case'AU':_0x38eb5b='https://accounts.zoho.com.au';break;case'EU':_0x38eb5b='https://accounts.zoho.eu';break;case'IN':_0x38eb5b=_0x5952('0x61');break;case'CN':_0x38eb5b='https://accounts.zoho.com.cn';break;default:_0x38eb5b=_0x5952('0x62');break;}var _0x51921f={'method':_0x5952('0x63'),'uri':_0x38eb5b+'/oauth/v2/token','qs':{'refresh_token':_0x2b4d68[_0x5952('0x64')],'client_id':_0x2b4d68[_0x5952('0x65')],'client_secret':_0x2b4d68['clientSecret'],'grant_type':_0x5952('0x66')},'json':!![]};return rp(_0x51921f)['then'](function(_0x5e3e57){if(_0x5e3e57[_0x5952('0x67')]){_0x31c121(_0x5e3e57[_0x5952('0x67')]);}else{_0x2e1cd7(_0x5952('0x68'));}})['catch'](function(_0x539cf7){_0x2e1cd7(_0x539cf7);});});}exports[_0x5952('0x69')]=function(_0x4e13c9,_0x144b5f,_0x220c8e){var _0x24bf5d,_0x13e817,_0x1a33e1,_0x1347a5,_0x464061;return db[_0x5952('0x36')][_0x5952('0x56')]({'where':{'id':_0x4e13c9[_0x5952('0x54')]['id']},'attributes':['id',_0x5952('0x6a'),_0x5952('0x60'),_0x5952('0x65'),_0x5952('0x6b'),'serverUrl','code',_0x5952('0x64')]})['then'](handleEntityNotFound(_0x144b5f,null))['then'](function(_0x253a45){_0x464061=_0x253a45;_0x24bf5d=_0x464061[_0x5952('0x6a')];_0x13e817=_0x24bf5d===_0x5952('0x6c')?'eu':_0x5952('0x6d');_0x1a33e1=_0x464061[_0x5952('0x6e')];var _0xe704a5=_0x1a33e1[_0x5952('0x6f')](-0x1);if(_0xe704a5==='/'||_0xe704a5==='\x5c'||_0xe704a5===':'){_0x1a33e1=_0x1a33e1[_0x5952('0x70')](0x0,_0x1a33e1[_0x5952('0x71')](_0xe704a5));}if(!_0x464061['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x464061);})['then'](function(_0x1b9436){if(_0x1b9436){return rp({'method':_0x5952('0x72'),'uri':util[_0x5952('0x73')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x13e817),'qs':{'module':_0x5952('0x74')},'headers':{'Authorization':_0x5952('0x75')+_0x1b9436},'json':!![]});}})['then'](function(_0x119a55){if(_0x119a55){if(_0x119a55[_0x5952('0x76')]&&_0x119a55[_0x5952('0x76')][_0x5952('0x20')]){throw new Error(_0x119a55[_0x5952('0x76')]['error'][_0x5952('0x22')]);}var _0x175cb8=[];var _0x15ba41=[];var _0xe80979=[_0x5952('0x77'),'Subject',_0x5952('0x78'),_0x5952('0x79'),_0x5952('0x7a'),_0x5952('0x7b'),'Call_Start_Time',_0x5952('0x7c')];_0x15ba41=_['remove'](_0x119a55[_0x5952('0x3c')],function(_0x1ecb24){return _0xe80979[_0x5952('0x7d')](_0x1ecb24[_0x5952('0x7e')]);});for(var _0x1f38ce=0x0;_0x1f38ce<_0x15ba41['length'];_0x1f38ce++){if(_0x15ba41[_0x1f38ce][_0x5952('0x7f')]===![]){_0x175cb8['push']({'id':_0x15ba41[_0x1f38ce]['id'],'name':_0x15ba41[_0x1f38ce][_0x5952('0x80')],'custom':_0x15ba41[_0x1f38ce][_0x5952('0x81')],'options':_0x15ba41[_0x1f38ce][_0x5952('0x82')]==='picklist'&&_0x15ba41[_0x1f38ce]['pick_list_values'][_0x5952('0x4f')]>-0x1?_[_0x5952('0x46')](_0x15ba41[_0x1f38ce][_0x5952('0x83')],function(_0x31dd3c){return{'name':_0x31dd3c,'value':_0x31dd3c};}):[]});}}return{'count':_0x175cb8[_0x5952('0x4f')],'rows':_0x175cb8};}else{return{'count':0x0,'rows':[]};}})[_0x5952('0x30')](respondWithResult(_0x144b5f,null))[_0x5952('0x25')](function(_0x3d1878){var _0x2e028d=_0x4e13c9[_0x5952('0x39')][_0x5952('0x84')]?0x1f4:_0x3d1878[_0x5952('0x85')]||0x1f4;logger[_0x5952('0x20')](_0x5952('0x86'),'getFields',_0x2e028d,JSON[_0x5952('0x87')](_0x3d1878));delete _0x3d1878[_0x5952('0x33')];if(_0x2e028d===0x191){_0x2e028d=0x190;}_0x144b5f[_0x5952('0x27')](_0x2e028d)[_0x5952('0x34')](_0x4e13c9['query'][_0x5952('0x84')]?{'message':'Wrong\x20credentials','statusCode':_0x3d1878['statusCode']}:_0x3d1878);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f6f13e2..0b4b3c9 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 _0xba7a=['ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','api','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','substring','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','info','format','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','slice','lastIndexOf','https://accounts.zoho.com.au','refreshToken','refresh_token'];(function(_0x16b194,_0x36ed1a){var _0x11ebe0=function(_0x32073a){while(--_0x32073a){_0x16b194['push'](_0x16b194['shift']());}};_0x11ebe0(++_0x36ed1a);}(_0xba7a,0x1b9));var _0xaba7=function(_0x59370b,_0x4cc4dd){_0x59370b=_0x59370b-0x0;var _0x272fd8=_0xba7a[_0x59370b];return _0x272fd8;};'use strict';var _=require(_0xaba7('0x0'));var util=require(_0xaba7('0x1'));var logger=require('../../config/logger')(_0xaba7('0x2'));var moment=require('moment');var BPromise=require(_0xaba7('0x3'));var rp=require(_0xaba7('0x4'));var fs=require('fs');var path=require(_0xaba7('0x5'));var rimraf=require('rimraf');var config=require(_0xaba7('0x6'));var attributes=require(_0xaba7('0x7'));var integrations=require(_0xaba7('0x8'));module[_0xaba7('0x9')]=function(_0x5a9e88,_0x38e8c6){return _0x5a9e88[_0xaba7('0xa')](_0xaba7('0xb'),attributes,{'tableName':_0xaba7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4fe0e3,_0x194efe,_0x330e0e){if(_0x4fe0e3[_0xaba7('0xd')](_0xaba7('0xe'))||_0x4fe0e3[_0xaba7('0xd')](_0xaba7('0xf'))||_0x4fe0e3[_0xaba7('0xd')](_0xaba7('0x10'))||_0x4fe0e3[_0xaba7('0xd')](_0xaba7('0x11'))||_0x4fe0e3['changed'](_0xaba7('0x12'))||_0x4fe0e3[_0xaba7('0xd')](_0xaba7('0x13'))){var _0x4a6430,_0x538ac0;_0x4a6430=_0x4fe0e3['serverUrl'];var _0x5d0baf=_0x4a6430['slice'](-0x1);if(_0x5d0baf==='/'||_0x5d0baf==='\x5c'||_0x5d0baf===':'){_0x4a6430=_0x4a6430[_0xaba7('0x14')](0x0,_0x4a6430['lastIndexOf'](_0x5d0baf));}switch(_0x4fe0e3[_0xaba7('0xe')]){case'US':_0x538ac0=_0xaba7('0x15');break;case'AU':_0x538ac0='https://accounts.zoho.com.au';break;case'IN':_0x538ac0=_0xaba7('0x16');break;case'CN':_0x538ac0=_0xaba7('0x17');break;default:_0x538ac0=_0xaba7('0x18');break;}var _0x331caf={'method':_0xaba7('0x19'),'uri':_0x538ac0+_0xaba7('0x1a'),'form':{'grant_type':_0xaba7('0x1b'),'client_id':_0x4fe0e3[_0xaba7('0x10')],'client_secret':_0x4fe0e3[_0xaba7('0x11')],'redirect_uri':_0x4fe0e3[_0xaba7('0xf')],'code':_0x4fe0e3[_0xaba7('0x12')]},'headers':{'Content-Type':_0xaba7('0x1c')}};return rp(_0x331caf)[_0xaba7('0x1d')](function(_0x124648){var _0x37c10c=JSON[_0xaba7('0x1e')](_0x124648);if(_0x37c10c['refresh_token']){_0x4fe0e3['refreshToken']=_0x37c10c['refresh_token'];logger[_0xaba7('0x1f')](util[_0xaba7('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4fe0e3[_0xaba7('0x21')],_0x4fe0e3['id']));}else{logger['error'](util['format'](_0xaba7('0x22'),_0x4fe0e3[_0xaba7('0x21')],_0x4fe0e3['id']),util[_0xaba7('0x23')](_0x37c10c,{'showHidden':![],'depth':null}));}return _0x330e0e(null,_0x194efe);})[_0xaba7('0x24')](function(_0x27f90c){logger[_0xaba7('0x25')](util[_0xaba7('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4fe0e3[_0xaba7('0x21')],_0x4fe0e3['id']),util[_0xaba7('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x330e0e(_0x27f90c);});}else{return _0x330e0e(null,_0x194efe);}},'beforeUpdate':function(_0x483163,_0x3adc61,_0x1619ad){if(_0x483163[_0xaba7('0xd')]('zone')||_0x483163[_0xaba7('0xd')](_0xaba7('0xf'))||_0x483163[_0xaba7('0xd')](_0xaba7('0x10'))||_0x483163['changed']('clientSecret')||_0x483163[_0xaba7('0xd')](_0xaba7('0x12'))||_0x483163[_0xaba7('0xd')](_0xaba7('0x13'))){var _0x4dca68,_0x2e26f2;_0x4dca68=_0x483163[_0xaba7('0xf')];var _0x206d24=_0x4dca68[_0xaba7('0x26')](-0x1);if(_0x206d24==='/'||_0x206d24==='\x5c'||_0x206d24===':'){_0x4dca68=_0x4dca68[_0xaba7('0x14')](0x0,_0x4dca68[_0xaba7('0x27')](_0x206d24));}switch(_0x483163[_0xaba7('0xe')]){case'US':_0x2e26f2='https://accounts.zoho.com';break;case'AU':_0x2e26f2=_0xaba7('0x28');break;case'IN':_0x2e26f2='https://accounts.zoho.in';break;case'CN':_0x2e26f2=_0xaba7('0x17');break;default:_0x2e26f2=_0xaba7('0x18');break;}var _0x5ec2e9={'method':_0xaba7('0x19'),'uri':_0x2e26f2+_0xaba7('0x1a'),'form':{'grant_type':_0xaba7('0x1b'),'client_id':_0x483163[_0xaba7('0x10')],'client_secret':_0x483163[_0xaba7('0x11')],'redirect_uri':_0x483163['serverUrl'],'code':_0x483163[_0xaba7('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5ec2e9)[_0xaba7('0x1d')](function(_0x2f3383){var _0x5ba3de=JSON[_0xaba7('0x1e')](_0x2f3383);if(_0x5ba3de['refresh_token']){_0x483163[_0xaba7('0x29')]=_0x5ba3de[_0xaba7('0x2a')];logger[_0xaba7('0x1f')](util['format'](_0xaba7('0x2b'),_0x483163[_0xaba7('0x21')],_0x483163['id']));}else{logger[_0xaba7('0x25')](util[_0xaba7('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x483163['name'],_0x483163['id']),util['inspect'](_0x5ba3de,{'showHidden':![],'depth':null}));}return _0x1619ad(null,_0x3adc61);})[_0xaba7('0x24')](function(_0x2371c6){logger[_0xaba7('0x25')](util[_0xaba7('0x20')](_0xaba7('0x22'),_0x483163[_0xaba7('0x21')],_0x483163['id']),util[_0xaba7('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x1619ad(_0x2371c6);});}else{return _0x1619ad(null,_0x3adc61);}}}});}; \ No newline at end of file +var _0xd720=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','zone','https://accounts.zoho.com','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','then','parse','refresh_token','info','format','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','lastIndexOf','https://accounts.zoho.eu','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','inspect'];(function(_0xe56be6,_0x32627c){var _0x7d5bd9=function(_0x1d2cb4){while(--_0x1d2cb4){_0xe56be6['push'](_0xe56be6['shift']());}};_0x7d5bd9(++_0x32627c);}(_0xd720,0x1ae));var _0x0d72=function(_0x3aa339,_0x4a4d04){_0x3aa339=_0x3aa339-0x0;var _0x29b4b7=_0xd720[_0x3aa339];return _0x29b4b7;};'use strict';var _=require(_0x0d72('0x0'));var util=require(_0x0d72('0x1'));var logger=require(_0x0d72('0x2'))(_0x0d72('0x3'));var moment=require(_0x0d72('0x4'));var BPromise=require(_0x0d72('0x5'));var rp=require(_0x0d72('0x6'));var fs=require('fs');var path=require(_0x0d72('0x7'));var rimraf=require(_0x0d72('0x8'));var config=require(_0x0d72('0x9'));var attributes=require(_0x0d72('0xa'));var integrations=require(_0x0d72('0xb'));module[_0x0d72('0xc')]=function(_0x3ee5dd,_0x30b31c){return _0x3ee5dd[_0x0d72('0xd')](_0x0d72('0xe'),attributes,{'tableName':_0x0d72('0xf'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x120b11,_0x2c21f2,_0x1e5548){if(_0x120b11[_0x0d72('0x10')]('zone')||_0x120b11[_0x0d72('0x10')](_0x0d72('0x11'))||_0x120b11['changed'](_0x0d72('0x12'))||_0x120b11[_0x0d72('0x10')](_0x0d72('0x13'))||_0x120b11[_0x0d72('0x10')](_0x0d72('0x14'))||_0x120b11[_0x0d72('0x10')](_0x0d72('0x15'))){var _0x5e64ce,_0xbc2bf;_0x5e64ce=_0x120b11[_0x0d72('0x11')];var _0x227d93=_0x5e64ce[_0x0d72('0x16')](-0x1);if(_0x227d93==='/'||_0x227d93==='\x5c'||_0x227d93===':'){_0x5e64ce=_0x5e64ce[_0x0d72('0x17')](0x0,_0x5e64ce['lastIndexOf'](_0x227d93));}switch(_0x120b11[_0x0d72('0x18')]){case'US':_0xbc2bf=_0x0d72('0x19');break;case'AU':_0xbc2bf='https://accounts.zoho.com.au';break;case'IN':_0xbc2bf='https://accounts.zoho.in';break;case'CN':_0xbc2bf=_0x0d72('0x1a');break;default:_0xbc2bf='https://accounts.zoho.eu';break;}var _0x8096a5={'method':'POST','uri':_0xbc2bf+_0x0d72('0x1b'),'form':{'grant_type':_0x0d72('0x1c'),'client_id':_0x120b11[_0x0d72('0x12')],'client_secret':_0x120b11[_0x0d72('0x13')],'redirect_uri':_0x120b11[_0x0d72('0x11')],'code':_0x120b11['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x8096a5)[_0x0d72('0x1d')](function(_0x38d20c){var _0x537657=JSON[_0x0d72('0x1e')](_0x38d20c);if(_0x537657[_0x0d72('0x1f')]){_0x120b11['refreshToken']=_0x537657[_0x0d72('0x1f')];logger[_0x0d72('0x20')](util[_0x0d72('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x120b11[_0x0d72('0x22')],_0x120b11['id']));}else{logger['error'](util[_0x0d72('0x21')](_0x0d72('0x23'),_0x120b11[_0x0d72('0x22')],_0x120b11['id']),util['inspect'](_0x537657,{'showHidden':![],'depth':null}));}return _0x1e5548(null,_0x2c21f2);})[_0x0d72('0x24')](function(_0x334af2){logger['error'](util[_0x0d72('0x21')](_0x0d72('0x23'),_0x120b11[_0x0d72('0x22')],_0x120b11['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1e5548(_0x334af2);});}else{return _0x1e5548(null,_0x2c21f2);}},'beforeUpdate':function(_0x169038,_0x1c1c95,_0x10c4a8){if(_0x169038[_0x0d72('0x10')](_0x0d72('0x18'))||_0x169038[_0x0d72('0x10')](_0x0d72('0x11'))||_0x169038['changed'](_0x0d72('0x12'))||_0x169038[_0x0d72('0x10')](_0x0d72('0x13'))||_0x169038[_0x0d72('0x10')]('code')||_0x169038[_0x0d72('0x10')](_0x0d72('0x15'))){var _0x1230b3,_0x5295c7;_0x1230b3=_0x169038[_0x0d72('0x11')];var _0x4328c3=_0x1230b3['slice'](-0x1);if(_0x4328c3==='/'||_0x4328c3==='\x5c'||_0x4328c3===':'){_0x1230b3=_0x1230b3['substring'](0x0,_0x1230b3[_0x0d72('0x25')](_0x4328c3));}switch(_0x169038[_0x0d72('0x18')]){case'US':_0x5295c7='https://accounts.zoho.com';break;case'AU':_0x5295c7='https://accounts.zoho.com.au';break;case'IN':_0x5295c7='https://accounts.zoho.in';break;case'CN':_0x5295c7=_0x0d72('0x1a');break;default:_0x5295c7=_0x0d72('0x26');break;}var _0x37f127={'method':'POST','uri':_0x5295c7+_0x0d72('0x1b'),'form':{'grant_type':_0x0d72('0x1c'),'client_id':_0x169038[_0x0d72('0x12')],'client_secret':_0x169038[_0x0d72('0x13')],'redirect_uri':_0x169038[_0x0d72('0x11')],'code':_0x169038[_0x0d72('0x14')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x37f127)[_0x0d72('0x1d')](function(_0x15141a){var _0x500203=JSON[_0x0d72('0x1e')](_0x15141a);if(_0x500203['refresh_token']){_0x169038[_0x0d72('0x27')]=_0x500203[_0x0d72('0x1f')];logger['info'](util[_0x0d72('0x21')](_0x0d72('0x28'),_0x169038[_0x0d72('0x22')],_0x169038['id']));}else{logger[_0x0d72('0x29')](util['format'](_0x0d72('0x23'),_0x169038[_0x0d72('0x22')],_0x169038['id']),util[_0x0d72('0x2a')](_0x500203,{'showHidden':![],'depth':null}));}return _0x10c4a8(null,_0x1c1c95);})[_0x0d72('0x24')](function(_0x436693){logger[_0x0d72('0x29')](util[_0x0d72('0x21')](_0x0d72('0x23'),_0x169038['name'],_0x169038['id']),util[_0x0d72('0x2a')](parsedResult,{'showHidden':![],'depth':null}));return _0x10c4a8(_0x436693);});}else{return _0x10c4a8(null,_0x1c1c95);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 15263c8..0c782f4 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 _0x1a50=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowZohoAccount','lodash','util','moment'];(function(_0x25bae9,_0x3e0960){var _0x4fbe19=function(_0x248d33){while(--_0x248d33){_0x25bae9['push'](_0x25bae9['shift']());}};_0x4fbe19(++_0x3e0960);}(_0x1a50,0x1eb));var _0x01a5=function(_0x39a3f4,_0x7f4ae8){_0x39a3f4=_0x39a3f4-0x0;var _0x4a894d=_0x1a50[_0x39a3f4];return _0x4a894d;};'use strict';var _=require(_0x01a5('0x0'));var util=require(_0x01a5('0x1'));var moment=require(_0x01a5('0x2'));var BPromise=require(_0x01a5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01a5('0x4'));var db=require(_0x01a5('0x5'))['db'];var utils=require(_0x01a5('0x6'));var logger=require(_0x01a5('0x7'))(_0x01a5('0x8'));var config=require(_0x01a5('0x9'));var jayson=require(_0x01a5('0xa'));var client=jayson[_0x01a5('0xb')][_0x01a5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x384788,_0xb12b7c,_0x255c08){return new BPromise(function(_0x21e2d2,_0x3b7b61){return client[_0x01a5('0xd')](_0x384788,_0x255c08)[_0x01a5('0xe')](function(_0xe35f6c){logger[_0x01a5('0xf')](_0x01a5('0x10'),_0xb12b7c,'request\x20sent');logger[_0x01a5('0x11')](_0x01a5('0x12'),_0xb12b7c,_0x01a5('0x13'),JSON['stringify'](_0xe35f6c));if(_0xe35f6c[_0x01a5('0x14')]){if(_0xe35f6c[_0x01a5('0x14')][_0x01a5('0x15')]===0x1f4){logger['error'](_0x01a5('0x10'),_0xb12b7c,_0xe35f6c[_0x01a5('0x14')][_0x01a5('0x16')]);return _0x3b7b61(_0xe35f6c[_0x01a5('0x14')][_0x01a5('0x16')]);}logger[_0x01a5('0x14')](_0x01a5('0x10'),_0xb12b7c,_0xe35f6c[_0x01a5('0x14')]['message']);return _0x21e2d2(_0xe35f6c[_0x01a5('0x14')][_0x01a5('0x16')]);}else{logger['info'](_0x01a5('0x10'),_0xb12b7c,'request\x20sent');_0x21e2d2(_0xe35f6c['result'][_0x01a5('0x16')]);}})[_0x01a5('0x17')](function(_0x8bfeb3){logger[_0x01a5('0x14')]('ZohoAccount,\x20%s,\x20%s',_0xb12b7c,_0x8bfeb3);_0x3b7b61(_0x8bfeb3);});});}exports[_0x01a5('0x18')]=function(_0x1eaa13){var _0x336d6d=this;return new Promise(function(_0x48e0b3,_0x3bbcc1){return db[_0x01a5('0x19')][_0x01a5('0x1a')]({'raw':_0x1eaa13[_0x01a5('0x1b')]?_0x1eaa13[_0x01a5('0x1b')][_0x01a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x1eaa13[_0x01a5('0x1b')]?_0x1eaa13[_0x01a5('0x1b')][_0x01a5('0x1d')]||null:null,'attributes':_0x1eaa13[_0x01a5('0x1b')]?_0x1eaa13[_0x01a5('0x1b')][_0x01a5('0x1e')]||null:null,'limit':_0x1eaa13['options']?_0x1eaa13['options'][_0x01a5('0x1f')]||null:null,'include':_0x1eaa13[_0x01a5('0x1b')]?_0x1eaa13[_0x01a5('0x1b')][_0x01a5('0x20')]?_[_0x01a5('0x21')](_0x1eaa13[_0x01a5('0x1b')][_0x01a5('0x20')],function(_0x2972ce){return{'model':db[_0x2972ce[_0x01a5('0x22')]],'as':_0x2972ce['as'],'attributes':_0x2972ce[_0x01a5('0x1e')],'include':_0x2972ce[_0x01a5('0x20')]?_[_0x01a5('0x21')](_0x2972ce['include'],function(_0x5836a6){return{'model':db[_0x5836a6['model']],'as':_0x5836a6['as'],'attributes':_0x5836a6['attributes'],'include':_0x5836a6['include']?_[_0x01a5('0x21')](_0x5836a6[_0x01a5('0x20')],function(_0x554d35){return{'model':db[_0x554d35['model']],'as':_0x554d35['as'],'attributes':_0x554d35[_0x01a5('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f755c){logger['info']('GetZohoAccount',_0x1eaa13);logger[_0x01a5('0x11')](_0x01a5('0x18'),_0x1eaa13,JSON[_0x01a5('0x23')](_0x3f755c));_0x48e0b3(_0x3f755c);})['catch'](function(_0xb071f9){logger[_0x01a5('0x14')]('GetZohoAccount',_0xb071f9[_0x01a5('0x16')],_0x1eaa13);_0x3bbcc1(_0x336d6d[_0x01a5('0x14')](0x1f4,_0xb071f9['message']));});});};exports['ShowZohoAccount']=function(_0x236302){var _0x3def0b=this;return new Promise(function(_0x147f7c,_0x2e3e32){return db[_0x01a5('0x19')][_0x01a5('0x24')]({'raw':_0x236302[_0x01a5('0x1b')]?_0x236302[_0x01a5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x236302[_0x01a5('0x1b')]?_0x236302[_0x01a5('0x1b')]['where']||null:null,'attributes':_0x236302[_0x01a5('0x1b')]?_0x236302[_0x01a5('0x1b')][_0x01a5('0x1e')]||null:null,'include':_0x236302[_0x01a5('0x1b')]?_0x236302[_0x01a5('0x1b')]['include']?_[_0x01a5('0x21')](_0x236302[_0x01a5('0x1b')][_0x01a5('0x20')],function(_0x431f3f){return{'model':db[_0x431f3f[_0x01a5('0x22')]],'as':_0x431f3f['as'],'attributes':_0x431f3f[_0x01a5('0x1e')],'include':_0x431f3f[_0x01a5('0x20')]?_[_0x01a5('0x21')](_0x431f3f[_0x01a5('0x20')],function(_0x3c71a5){return{'model':db[_0x3c71a5[_0x01a5('0x22')]],'as':_0x3c71a5['as'],'attributes':_0x3c71a5[_0x01a5('0x1e')],'include':_0x3c71a5[_0x01a5('0x20')]?_[_0x01a5('0x21')](_0x3c71a5[_0x01a5('0x20')],function(_0x447077){return{'model':db[_0x447077['model']],'as':_0x447077['as'],'attributes':_0x447077[_0x01a5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x01a5('0xe')](function(_0x4ccc58){logger[_0x01a5('0xf')](_0x01a5('0x25'),_0x236302);logger['debug'](_0x01a5('0x25'),_0x236302,JSON[_0x01a5('0x23')](_0x4ccc58));_0x147f7c(_0x4ccc58);})[_0x01a5('0x17')](function(_0x5d294a){logger[_0x01a5('0x14')](_0x01a5('0x25'),_0x5d294a['message'],_0x236302);_0x2e3e32(_0x3def0b['error'](0x1f4,_0x5d294a[_0x01a5('0x16')]));});});}; \ No newline at end of file +var _0x1957=['error','code','message','result','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetZohoAccount','stringify','catch','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x1957,0xeb));var _0x7195=function(_0x5b73e7,_0x40789d){_0x5b73e7=_0x5b73e7-0x0;var _0x594436=_0x1957[_0x5b73e7];return _0x594436;};'use strict';var _=require(_0x7195('0x0'));var util=require(_0x7195('0x1'));var moment=require(_0x7195('0x2'));var BPromise=require(_0x7195('0x3'));var rs=require(_0x7195('0x4'));var fs=require('fs');var Redis=require(_0x7195('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7195('0x6'));var logger=require(_0x7195('0x7'))(_0x7195('0x8'));var config=require('../../config/environment');var jayson=require(_0x7195('0x9'));var client=jayson['client'][_0x7195('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a6d2b,_0x32079f,_0x49684d){return new BPromise(function(_0x10afd9,_0x5d5f68){return client[_0x7195('0xb')](_0x5a6d2b,_0x49684d)[_0x7195('0xc')](function(_0x4d5f0c){logger[_0x7195('0xd')](_0x7195('0xe'),_0x32079f,_0x7195('0xf'));logger[_0x7195('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x32079f,'request\x20sent',JSON['stringify'](_0x4d5f0c));if(_0x4d5f0c[_0x7195('0x11')]){if(_0x4d5f0c[_0x7195('0x11')][_0x7195('0x12')]===0x1f4){logger[_0x7195('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x32079f,_0x4d5f0c[_0x7195('0x11')][_0x7195('0x13')]);return _0x5d5f68(_0x4d5f0c[_0x7195('0x11')]['message']);}logger['error'](_0x7195('0xe'),_0x32079f,_0x4d5f0c['error'][_0x7195('0x13')]);return _0x10afd9(_0x4d5f0c[_0x7195('0x11')][_0x7195('0x13')]);}else{logger[_0x7195('0xd')](_0x7195('0xe'),_0x32079f,'request\x20sent');_0x10afd9(_0x4d5f0c[_0x7195('0x14')]['message']);}})['catch'](function(_0x19731a){logger[_0x7195('0x11')](_0x7195('0xe'),_0x32079f,_0x19731a);_0x5d5f68(_0x19731a);});});}exports['GetZohoAccount']=function(_0x450e4d){var _0x438b0b=this;return new Promise(function(_0x3e0c97,_0x4ec106){return db[_0x7195('0x15')][_0x7195('0x16')]({'raw':_0x450e4d[_0x7195('0x17')]?_0x450e4d[_0x7195('0x17')][_0x7195('0x18')]===undefined?!![]:![]:!![],'where':_0x450e4d[_0x7195('0x17')]?_0x450e4d['options'][_0x7195('0x19')]||null:null,'attributes':_0x450e4d[_0x7195('0x17')]?_0x450e4d[_0x7195('0x17')][_0x7195('0x1a')]||null:null,'limit':_0x450e4d[_0x7195('0x17')]?_0x450e4d[_0x7195('0x17')][_0x7195('0x1b')]||null:null,'include':_0x450e4d[_0x7195('0x17')]?_0x450e4d[_0x7195('0x17')][_0x7195('0x1c')]?_[_0x7195('0x1d')](_0x450e4d['options'][_0x7195('0x1c')],function(_0x3000b9){return{'model':db[_0x3000b9['model']],'as':_0x3000b9['as'],'attributes':_0x3000b9['attributes'],'include':_0x3000b9[_0x7195('0x1c')]?_['map'](_0x3000b9[_0x7195('0x1c')],function(_0x38ac3b){return{'model':db[_0x38ac3b[_0x7195('0x1e')]],'as':_0x38ac3b['as'],'attributes':_0x38ac3b[_0x7195('0x1a')],'include':_0x38ac3b[_0x7195('0x1c')]?_[_0x7195('0x1d')](_0x38ac3b[_0x7195('0x1c')],function(_0x1ee607){return{'model':db[_0x1ee607[_0x7195('0x1e')]],'as':_0x1ee607['as'],'attributes':_0x1ee607[_0x7195('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7195('0xc')](function(_0x16af9e){logger[_0x7195('0xd')](_0x7195('0x1f'),_0x450e4d);logger[_0x7195('0x10')](_0x7195('0x1f'),_0x450e4d,JSON[_0x7195('0x20')](_0x16af9e));_0x3e0c97(_0x16af9e);})[_0x7195('0x21')](function(_0x3ce67a){logger[_0x7195('0x11')](_0x7195('0x1f'),_0x3ce67a[_0x7195('0x13')],_0x450e4d);_0x4ec106(_0x438b0b[_0x7195('0x11')](0x1f4,_0x3ce67a[_0x7195('0x13')]));});});};exports[_0x7195('0x22')]=function(_0x3c9d1e){var _0x104928=this;return new Promise(function(_0x2b6387,_0x4a6b57){return db['ZohoAccount'][_0x7195('0x23')]({'raw':_0x3c9d1e[_0x7195('0x17')]?_0x3c9d1e[_0x7195('0x17')][_0x7195('0x18')]===undefined?!![]:![]:!![],'where':_0x3c9d1e[_0x7195('0x17')]?_0x3c9d1e[_0x7195('0x17')][_0x7195('0x19')]||null:null,'attributes':_0x3c9d1e[_0x7195('0x17')]?_0x3c9d1e[_0x7195('0x17')]['attributes']||null:null,'include':_0x3c9d1e['options']?_0x3c9d1e[_0x7195('0x17')]['include']?_[_0x7195('0x1d')](_0x3c9d1e[_0x7195('0x17')]['include'],function(_0x3b975d){return{'model':db[_0x3b975d[_0x7195('0x1e')]],'as':_0x3b975d['as'],'attributes':_0x3b975d[_0x7195('0x1a')],'include':_0x3b975d['include']?_[_0x7195('0x1d')](_0x3b975d[_0x7195('0x1c')],function(_0xd2f370){return{'model':db[_0xd2f370['model']],'as':_0xd2f370['as'],'attributes':_0xd2f370[_0x7195('0x1a')],'include':_0xd2f370[_0x7195('0x1c')]?_['map'](_0xd2f370['include'],function(_0x3cbfc5){return{'model':db[_0x3cbfc5[_0x7195('0x1e')]],'as':_0x3cbfc5['as'],'attributes':_0x3cbfc5['attributes']};}):[]};}):[]};}):[]:[]})[_0x7195('0xc')](function(_0x2cd684){logger['info'](_0x7195('0x22'),_0x3c9d1e);logger[_0x7195('0x10')](_0x7195('0x22'),_0x3c9d1e,JSON[_0x7195('0x20')](_0x2cd684));_0x2b6387(_0x2cd684);})[_0x7195('0x21')](function(_0x2fe610){logger[_0x7195('0x11')]('ShowZohoAccount',_0x2fe610[_0x7195('0x13')],_0x3c9d1e);_0x4a6b57(_0x104928[_0x7195('0x11')](0x1f4,_0x2fe610[_0x7195('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 169586c..fcd1be1 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 _0x7894=['show','/:id/subjects','getDescriptions','post','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x7894,0x170));var _0x4789=function(_0x7192b2,_0x5c5cd7){_0x7192b2=_0x7192b2-0x0;var _0x1c779e=_0x7894[_0x7192b2];return _0x1c779e;};'use strict';var multer=require(_0x4789('0x0'));var util=require(_0x4789('0x1'));var path=require(_0x4789('0x2'));var timeout=require(_0x4789('0x3'));var express=require(_0x4789('0x4'));var router=express[_0x4789('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4789('0x6'));var config=require(_0x4789('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x4789('0x8')]('/',auth[_0x4789('0x9')](),controller[_0x4789('0xa')]);router[_0x4789('0x8')](_0x4789('0xb'),auth[_0x4789('0x9')](),controller[_0x4789('0xc')]);router['get']('/:id/fields',auth[_0x4789('0x9')](),controller['getFields']);router[_0x4789('0x8')](_0x4789('0xd'),auth[_0x4789('0x9')](),controller['getSubjects']);router[_0x4789('0x8')]('/:id/descriptions',auth[_0x4789('0x9')](),controller[_0x4789('0xe')]);router[_0x4789('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4789('0x10')]('/:id',auth[_0x4789('0x9')](),controller['update']);router[_0x4789('0x11')](_0x4789('0xb'),auth['isAuthenticated'](),controller[_0x4789('0x12')]);module['exports']=router; \ No newline at end of file +var _0x97a2=['../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','put','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x967666,_0x533ef2){var _0x287d70=function(_0x12651a){while(--_0x12651a){_0x967666['push'](_0x967666['shift']());}};_0x287d70(++_0x533ef2);}(_0x97a2,0x1b1));var _0x297a=function(_0x137fc8,_0x353966){_0x137fc8=_0x137fc8-0x0;var _0x5d6ec0=_0x97a2[_0x137fc8];return _0x5d6ec0;};'use strict';var multer=require(_0x297a('0x0'));var util=require('util');var path=require(_0x297a('0x1'));var timeout=require(_0x297a('0x2'));var express=require(_0x297a('0x3'));var router=express[_0x297a('0x4')]();var auth=require(_0x297a('0x5'));var interaction=require(_0x297a('0x6'));var config=require(_0x297a('0x7'));var controller=require(_0x297a('0x8'));router['get']('/',auth[_0x297a('0x9')](),controller[_0x297a('0xa')]);router[_0x297a('0xb')](_0x297a('0xc'),auth[_0x297a('0x9')](),controller[_0x297a('0xd')]);router['get'](_0x297a('0xe'),auth[_0x297a('0x9')](),controller[_0x297a('0xf')]);router[_0x297a('0xb')](_0x297a('0x10'),auth[_0x297a('0x9')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x297a('0x9')](),controller[_0x297a('0x11')]);router[_0x297a('0x12')]('/',auth[_0x297a('0x9')](),controller['create']);router[_0x297a('0x13')](_0x297a('0xc'),auth[_0x297a('0x9')](),controller[_0x297a('0x14')]);router[_0x297a('0x15')](_0x297a('0xc'),auth[_0x297a('0x9')](),controller['destroy']);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 07c795f..3622131 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 _0x3680=['contact','nothing','lead','contact_lead','exports','STRING','ENUM'];(function(_0x11fab5,_0x26efcc){var _0x40a7b2=function(_0xa4e7e1){while(--_0xa4e7e1){_0x11fab5['push'](_0x11fab5['shift']());}};_0x40a7b2(++_0x26efcc);}(_0x3680,0x1e7));var _0x0368=function(_0x1be8b8,_0x35a72c){_0x1be8b8=_0x1be8b8-0x0;var _0x46deb6=_0x3680[_0x1be8b8];return _0x46deb6;};'use strict';var Sequelize=require('sequelize');module[_0x0368('0x0')]={'name':{'type':Sequelize[_0x0368('0x1')]},'moduleCreate':{'type':Sequelize[_0x0368('0x2')]('lead',_0x0368('0x3'),_0x0368('0x4')),'defaultValue':_0x0368('0x5')},'moduleSearch':{'type':Sequelize['ENUM'](_0x0368('0x6'),_0x0368('0x3'),_0x0368('0x5')),'defaultValue':_0x0368('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd612=['contact','nothing','lead','contact_lead','sequelize','exports','STRING','ENUM'];(function(_0x255db1,_0x19b49f){var _0x33384a=function(_0x4ae8da){while(--_0x4ae8da){_0x255db1['push'](_0x255db1['shift']());}};_0x33384a(++_0x19b49f);}(_0xd612,0xfc));var _0x2d61=function(_0x3146d2,_0x558260){_0x3146d2=_0x3146d2-0x0;var _0x5e3703=_0xd612[_0x3146d2];return _0x5e3703;};'use strict';var Sequelize=require(_0x2d61('0x0'));module[_0x2d61('0x1')]={'name':{'type':Sequelize[_0x2d61('0x2')]},'moduleCreate':{'type':Sequelize[_0x2d61('0x3')]('lead',_0x2d61('0x4'),_0x2d61('0x5')),'defaultValue':_0x2d61('0x6')},'moduleSearch':{'type':Sequelize[_0x2d61('0x3')](_0x2d61('0x7'),_0x2d61('0x4'),_0x2d61('0x6')),'defaultValue':_0x2d61('0x7')},'description':{'type':Sequelize[_0x2d61('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 4a48eeb..0141a12 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(_0x4f32b4,_0x279b5d){var _0x2ce940=function(_0x146212){while(--_0x146212){_0x4f32b4['push'](_0x4f32b4['shift']());}};_0x2ce940(++_0x279b5d);}(_0xe14b,0x93));var _0xbe14=function(_0x25418e,_0x2f7f4){_0x25418e=_0x25418e-0x0;var _0x37e142=_0xe14b[_0x25418e];return _0x37e142;};'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(_0x2de18a,_0x56243a){var _0x3e435c=function(_0x51b4d9){while(--_0x51b4d9){_0x2de18a['push'](_0x2de18a['shift']());}};_0x3e435c(++_0x56243a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 c368531..2a20cdc 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 _0x4486=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0x1ad123,_0x5233b2){var _0x153e49=function(_0xe602b4){while(--_0xe602b4){_0x1ad123['push'](_0x1ad123['shift']());}};_0x153e49(++_0x5233b2);}(_0x4486,0x73));var _0x6448=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0x4486[_0xaaf2e2];return _0x28bc36;};'use strict';var _=require(_0x6448('0x0'));var util=require(_0x6448('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6448('0x2'));var BPromise=require(_0x6448('0x3'));var rp=require(_0x6448('0x4'));var fs=require('fs');var path=require(_0x6448('0x5'));var rimraf=require(_0x6448('0x6'));var config=require(_0x6448('0x7'));var attributes=require(_0x6448('0x8'));module[_0x6448('0x9')]=function(_0x176e5e,_0x22bf1b){return _0x176e5e[_0x6448('0xa')](_0x6448('0xb'),attributes,{'tableName':_0x6448('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1995=['request-promise','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x308482,_0x47b6a1){var _0x1a1df8=function(_0x38b0d5){while(--_0x38b0d5){_0x308482['push'](_0x308482['shift']());}};_0x1a1df8(++_0x47b6a1);}(_0x1995,0x17b));var _0x5199=function(_0x396ab8,_0x100856){_0x396ab8=_0x396ab8-0x0;var _0x3b9ff7=_0x1995[_0x396ab8];return _0x3b9ff7;};'use strict';var _=require(_0x5199('0x0'));var util=require(_0x5199('0x1'));var logger=require(_0x5199('0x2'))(_0x5199('0x3'));var moment=require(_0x5199('0x4'));var BPromise=require(_0x5199('0x5'));var rp=require(_0x5199('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x5199('0x7')]=function(_0x172e27,_0x460b5f){return _0x172e27[_0x5199('0x8')](_0x5199('0x9'),attributes,{'tableName':_0x5199('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 2590906..4700323 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 _0x73b3=['request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x73b3,0x17e));var _0x373b=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x73b3[_0x1a8f86];return _0x20d876;};'use strict';var _=require(_0x373b('0x0'));var util=require('util');var moment=require(_0x373b('0x1'));var BPromise=require(_0x373b('0x2'));var rs=require(_0x373b('0x3'));var fs=require('fs');var Redis=require(_0x373b('0x4'));var db=require(_0x373b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x373b('0x6'))(_0x373b('0x7'));var config=require('../../config/environment');var jayson=require(_0x373b('0x8'));var client=jayson[_0x373b('0x9')][_0x373b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b22b,_0x15e1c6,_0x3492e1){return new BPromise(function(_0x13f048,_0x4437cf){return client[_0x373b('0xb')](_0x1b22b,_0x3492e1)[_0x373b('0xc')](function(_0x38ddc1){logger[_0x373b('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x15e1c6,_0x373b('0xe'));logger['debug'](_0x373b('0xf'),_0x15e1c6,_0x373b('0xe'),JSON[_0x373b('0x10')](_0x38ddc1));if(_0x38ddc1[_0x373b('0x11')]){if(_0x38ddc1[_0x373b('0x11')][_0x373b('0x12')]===0x1f4){logger[_0x373b('0x11')](_0x373b('0x13'),_0x15e1c6,_0x38ddc1[_0x373b('0x11')]['message']);return _0x4437cf(_0x38ddc1[_0x373b('0x11')][_0x373b('0x14')]);}logger[_0x373b('0x11')](_0x373b('0x13'),_0x15e1c6,_0x38ddc1[_0x373b('0x11')]['message']);return _0x13f048(_0x38ddc1['error'][_0x373b('0x14')]);}else{logger[_0x373b('0xd')](_0x373b('0x13'),_0x15e1c6,_0x373b('0xe'));_0x13f048(_0x38ddc1[_0x373b('0x15')][_0x373b('0x14')]);}})['catch'](function(_0x1430ad){logger[_0x373b('0x11')](_0x373b('0x13'),_0x15e1c6,_0x1430ad);_0x4437cf(_0x1430ad);});});} \ No newline at end of file +var _0xda14=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xda14,0x175));var _0x4da1=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xda14[_0x2d91c6];return _0x3a8d19;};'use strict';var _=require(_0x4da1('0x0'));var util=require(_0x4da1('0x1'));var moment=require('moment');var BPromise=require(_0x4da1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4da1('0x3'));var db=require(_0x4da1('0x4'))['db'];var utils=require(_0x4da1('0x5'));var logger=require(_0x4da1('0x6'))(_0x4da1('0x7'));var config=require(_0x4da1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3332e4,_0x3956bd,_0xb59328){return new BPromise(function(_0x360416,_0xeac9a6){return client[_0x4da1('0xa')](_0x3332e4,_0xb59328)[_0x4da1('0xb')](function(_0x7a29cc){logger[_0x4da1('0xc')](_0x4da1('0xd'),_0x3956bd,_0x4da1('0xe'));logger[_0x4da1('0xf')](_0x4da1('0x10'),_0x3956bd,_0x4da1('0xe'),JSON[_0x4da1('0x11')](_0x7a29cc));if(_0x7a29cc[_0x4da1('0x12')]){if(_0x7a29cc['error']['code']===0x1f4){logger[_0x4da1('0x12')](_0x4da1('0xd'),_0x3956bd,_0x7a29cc[_0x4da1('0x12')][_0x4da1('0x13')]);return _0xeac9a6(_0x7a29cc[_0x4da1('0x12')][_0x4da1('0x13')]);}logger[_0x4da1('0x12')](_0x4da1('0xd'),_0x3956bd,_0x7a29cc[_0x4da1('0x12')][_0x4da1('0x13')]);return _0x360416(_0x7a29cc[_0x4da1('0x12')]['message']);}else{logger[_0x4da1('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x3956bd,_0x4da1('0xe'));_0x360416(_0x7a29cc[_0x4da1('0x14')]['message']);}})[_0x4da1('0x15')](function(_0x368e6a){logger['error'](_0x4da1('0xd'),_0x3956bd,_0x368e6a);_0xeac9a6(_0x368e6a);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 656e958..581bfa4 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 _0x4213=['../../config/environment','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0x4213,0x77));var _0x3421=function(_0x5c897c,_0x51f690){_0x5c897c=_0x5c897c-0x0;var _0x2e9b55=_0x4213[_0x5c897c];return _0x2e9b55;};'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('./intZohoField.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xa')]);router[_0x3421('0x8')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0xc')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xd')]);router['put'](_0x3421('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x3421('0xf')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0x10')]);module[_0x3421('0x11')]=router; \ No newline at end of file +var _0x7b84=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x191065,_0x5e9dfc){var _0x138006=function(_0x33daa3){while(--_0x33daa3){_0x191065['push'](_0x191065['shift']());}};_0x138006(++_0x5e9dfc);}(_0x7b84,0x17c));var _0x47b8=function(_0xee808,_0x1d4a0c){_0xee808=_0xee808-0x0;var _0x3837b2=_0x7b84[_0xee808];return _0x3837b2;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var auth=require(_0x47b8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x47b8('0x7'));var controller=require(_0x47b8('0x8'));router[_0x47b8('0x9')]('/',auth[_0x47b8('0xa')](),controller[_0x47b8('0xb')]);router[_0x47b8('0x9')]('/:id',auth[_0x47b8('0xa')](),controller[_0x47b8('0xc')]);router[_0x47b8('0xd')]('/',auth[_0x47b8('0xa')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xf')](_0x47b8('0x10'),auth[_0x47b8('0xa')](),controller[_0x47b8('0x11')]);router[_0x47b8('0x12')](_0x47b8('0x10'),auth[_0x47b8('0xa')](),controller[_0x47b8('0x13')]);module[_0x47b8('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 58eaecf..303efab 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 _0x0d4d=['ENUM','string','variable','customVariable','STRING','sequelize','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0d4d,0x132));var _0xd0d4=function(_0x42c5b0,_0x13a4af){_0x42c5b0=_0x42c5b0-0x0;var _0x5c369a=_0x0d4d[_0x42c5b0];return _0x5c369a;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module[_0xd0d4('0x1')]={'type':{'type':Sequelize[_0xd0d4('0x2')](_0xd0d4('0x3'),_0xd0d4('0x4'),_0xd0d4('0x5'),'keyValue'),'defaultValue':_0xd0d4('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd0d4('0x6')]},'keyType':{'type':Sequelize[_0xd0d4('0x2')]('string',_0xd0d4('0x4'),_0xd0d4('0x5'))},'keyContent':{'type':Sequelize[_0xd0d4('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd0d4('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd0d4('0x6')]}}; \ No newline at end of file +var _0xb016=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb016,0x129));var _0x6b01=function(_0x450261,_0x40f295){_0x450261=_0x450261-0x0;var _0x555151=_0xb016[_0x450261];return _0x555151;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'type':{'type':Sequelize[_0x6b01('0x2')](_0x6b01('0x3'),_0x6b01('0x4'),_0x6b01('0x5'),_0x6b01('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6b01('0x7')]},'key':{'type':Sequelize[_0x6b01('0x7')]},'keyType':{'type':Sequelize[_0x6b01('0x2')](_0x6b01('0x3'),_0x6b01('0x4'),_0x6b01('0x5'))},'keyContent':{'type':Sequelize[_0x6b01('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6b01('0x7')]},'customField':{'type':Sequelize[_0x6b01('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index c92d746..73928b8 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 _0xa678=['ZohoField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','show','rawAttributes','length','options','create','catch','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','index','map'];(function(_0x591745,_0x2e8ffc){var _0xff40a5=function(_0x3c0357){while(--_0x3c0357){_0x591745['push'](_0x591745['shift']());}};_0xff40a5(++_0x2e8ffc);}(_0xa678,0x6b));var _0x8a67=function(_0x49d1b2,_0x6b2660){_0x49d1b2=_0x49d1b2-0x0;var _0x30fe98=_0xa678[_0x49d1b2];return _0x30fe98;};'use strict';var pdf=require(_0x8a67('0x0'));var emlformat=require(_0x8a67('0x1'));var rimraf=require(_0x8a67('0x2'));var zipdir=require(_0x8a67('0x3'));var jsonpatch=require(_0x8a67('0x4'));var rp=require(_0x8a67('0x5'));var moment=require('moment');var BPromise=require(_0x8a67('0x6'));var Mustache=require(_0x8a67('0x7'));var util=require(_0x8a67('0x8'));var path=require(_0x8a67('0x9'));var sox=require(_0x8a67('0xa'));var csv=require(_0x8a67('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8a67('0xc'));var squel=require(_0x8a67('0xd'));var crypto=require(_0x8a67('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8a67('0xf'));var toCsv=require(_0x8a67('0xb'));var querystring=require(_0x8a67('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8a67('0x11'));var qs=require(_0x8a67('0x12'));var as=require(_0x8a67('0x13'));var hardwareService=require(_0x8a67('0x14'));var logger=require(_0x8a67('0x15'))(_0x8a67('0x16'));var utils=require(_0x8a67('0x17'));var config=require(_0x8a67('0x18'));var db=require(_0x8a67('0x19'))['db'];function respondWithStatusCode(_0x536e6a,_0xd3fc67){_0xd3fc67=_0xd3fc67||0xcc;return function(_0x368d40){if(_0x368d40){return _0x536e6a[_0x8a67('0x1a')](_0xd3fc67);}return _0x536e6a[_0x8a67('0x1b')](_0xd3fc67)[_0x8a67('0x1c')]();};}function respondWithResult(_0x1d9ab8,_0x56a0ed){_0x56a0ed=_0x56a0ed||0xc8;return function(_0x213d9d){if(_0x213d9d){return _0x1d9ab8[_0x8a67('0x1b')](_0x56a0ed)[_0x8a67('0x1d')](_0x213d9d);}};}function respondWithFilteredResult(_0x452715,_0x2c4337){return function(_0x87f8c0){if(_0x87f8c0){var _0x47d05d=_0x87f8c0[_0x8a67('0x1e')],_0x1ce195=_0x2c4337[_0x8a67('0x1f')],_0x31bddc=_0x2c4337['offset']+_0x2c4337[_0x8a67('0x20')],_0x5d2d6b;if(_0x31bddc>=_0x47d05d){_0x31bddc=_0x47d05d;_0x5d2d6b=0xc8;}else{_0x5d2d6b=0xce;}_0x452715[_0x8a67('0x1b')](_0x5d2d6b);return _0x452715[_0x8a67('0x21')]('Content-Range',_0x1ce195+'-'+_0x31bddc+'/'+_0x47d05d)[_0x8a67('0x1d')](_0x87f8c0);}return null;};}function patchUpdates(_0x4c22fa){return function(_0x31e0da){try{jsonpatch[_0x8a67('0x22')](_0x31e0da,_0x4c22fa,!![]);}catch(_0x5a2b2d){return BPromise[_0x8a67('0x23')](_0x5a2b2d);}return _0x31e0da[_0x8a67('0x24')]();};}function saveUpdates(_0x54b5d4,_0x2b95af){return function(_0x3eff81){if(_0x3eff81){return _0x3eff81[_0x8a67('0x25')](_0x54b5d4)[_0x8a67('0x26')](function(_0x49d7a7){return _0x49d7a7;});}return null;};}function removeEntity(_0x330c83,_0x43824c){return function(_0x6d1a25){if(_0x6d1a25){return _0x6d1a25[_0x8a67('0x27')]()[_0x8a67('0x26')](function(){_0x330c83[_0x8a67('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2452f8,_0x30465b){return function(_0x10fc90){if(!_0x10fc90){_0x2452f8[_0x8a67('0x1a')](0x194);}return _0x10fc90;};}function handleError(_0x3470f5,_0x370e02){_0x370e02=_0x370e02||0x1f4;return function(_0x471f60){logger[_0x8a67('0x28')](_0x471f60[_0x8a67('0x29')]);if(_0x471f60[_0x8a67('0x2a')]){delete _0x471f60[_0x8a67('0x2a')];}_0x3470f5[_0x8a67('0x1b')](_0x370e02)['send'](_0x471f60);};}exports[_0x8a67('0x2b')]=function(_0x36b381,_0x5c0b1c){var _0x46d5e7={},_0x2c549e={},_0x33ef39={'count':0x0,'rows':[]};var _0x393e10=_[_0x8a67('0x2c')](db[_0x8a67('0x2d')]['rawAttributes'],function(_0x390a9f){return{'name':_0x390a9f[_0x8a67('0x2e')],'type':_0x390a9f[_0x8a67('0x2f')][_0x8a67('0x30')]};});_0x2c549e[_0x8a67('0x31')]=_[_0x8a67('0x2c')](_0x393e10,_0x8a67('0x2a'));_0x2c549e[_0x8a67('0x32')]=_[_0x8a67('0x33')](_0x36b381['query']);_0x2c549e[_0x8a67('0x34')]=_[_0x8a67('0x35')](_0x2c549e[_0x8a67('0x31')],_0x2c549e[_0x8a67('0x32')]);_0x46d5e7[_0x8a67('0x36')]=_[_0x8a67('0x35')](_0x2c549e[_0x8a67('0x31')],qs[_0x8a67('0x37')](_0x36b381[_0x8a67('0x32')]['fields']));_0x46d5e7[_0x8a67('0x36')]=_0x46d5e7[_0x8a67('0x36')]['length']?_0x46d5e7[_0x8a67('0x36')]:_0x2c549e[_0x8a67('0x31')];if(!_0x36b381['query'][_0x8a67('0x38')](_0x8a67('0x39'))){_0x46d5e7['limit']=qs[_0x8a67('0x20')](_0x36b381[_0x8a67('0x32')][_0x8a67('0x20')]);_0x46d5e7[_0x8a67('0x1f')]=qs[_0x8a67('0x1f')](_0x36b381[_0x8a67('0x32')][_0x8a67('0x1f')]);}_0x46d5e7[_0x8a67('0x3a')]=qs[_0x8a67('0x3b')](_0x36b381['query']['sort']);_0x46d5e7[_0x8a67('0x3c')]=qs['filters'](_[_0x8a67('0x3d')](_0x36b381[_0x8a67('0x32')],_0x2c549e['filters']));if(_0x36b381[_0x8a67('0x32')][_0x8a67('0x3e')]){_0x46d5e7[_0x8a67('0x3c')]=_['merge'](_0x46d5e7[_0x8a67('0x3c')],{'$or':_[_0x8a67('0x2c')](_0x393e10,function(_0xfdc702){if(_0xfdc702[_0x8a67('0x2f')]!=='VIRTUAL'){var _0x1c7d2f={};_0x1c7d2f[_0xfdc702[_0x8a67('0x2a')]]={'$like':'%'+_0x36b381[_0x8a67('0x32')][_0x8a67('0x3e')]+'%'};return _0x1c7d2f;}})});}_0x46d5e7=_[_0x8a67('0x3f')]({},_0x46d5e7,_0x36b381['options']);var _0x1b086d={'where':_0x46d5e7[_0x8a67('0x3c')]};return db[_0x8a67('0x2d')][_0x8a67('0x1e')](_0x1b086d)[_0x8a67('0x26')](function(_0x5ef8ba){_0x33ef39[_0x8a67('0x1e')]=_0x5ef8ba;if(_0x36b381[_0x8a67('0x32')][_0x8a67('0x40')]){_0x46d5e7[_0x8a67('0x41')]=[{'all':!![]}];}return db[_0x8a67('0x2d')]['findAll'](_0x46d5e7);})[_0x8a67('0x26')](function(_0x1cfd7d){_0x33ef39[_0x8a67('0x42')]=_0x1cfd7d;return _0x33ef39;})[_0x8a67('0x26')](respondWithFilteredResult(_0x5c0b1c,_0x46d5e7))['catch'](handleError(_0x5c0b1c,null));};exports[_0x8a67('0x43')]=function(_0x3f1583,_0x307ef8){var _0x39837a={'raw':!![],'where':{'id':_0x3f1583['params']['id']}},_0x325193={};_0x325193[_0x8a67('0x31')]=_[_0x8a67('0x33')](db[_0x8a67('0x2d')][_0x8a67('0x44')]);_0x325193[_0x8a67('0x32')]=_['keys'](_0x3f1583['query']);_0x325193[_0x8a67('0x34')]=_[_0x8a67('0x35')](_0x325193[_0x8a67('0x31')],_0x325193[_0x8a67('0x32')]);_0x39837a['attributes']=_[_0x8a67('0x35')](_0x325193[_0x8a67('0x31')],qs[_0x8a67('0x37')](_0x3f1583['query'][_0x8a67('0x37')]));_0x39837a['attributes']=_0x39837a['attributes'][_0x8a67('0x45')]?_0x39837a['attributes']:_0x325193[_0x8a67('0x31')];if(_0x3f1583[_0x8a67('0x32')]['includeAll']){_0x39837a[_0x8a67('0x41')]=[{'all':!![]}];}_0x39837a=_[_0x8a67('0x3f')]({},_0x39837a,_0x3f1583[_0x8a67('0x46')]);return db[_0x8a67('0x2d')]['find'](_0x39837a)['then'](handleEntityNotFound(_0x307ef8,null))[_0x8a67('0x26')](respondWithResult(_0x307ef8,null))['catch'](handleError(_0x307ef8,null));};exports[_0x8a67('0x47')]=function(_0x5727d4,_0x291323){return db[_0x8a67('0x2d')]['create'](_0x5727d4['body'],{})['then'](respondWithResult(_0x291323,0xc9))[_0x8a67('0x48')](handleError(_0x291323,null));};exports[_0x8a67('0x25')]=function(_0x54f3c6,_0x54a5b2){if(_0x54f3c6['body']['id']){delete _0x54f3c6[_0x8a67('0x49')]['id'];}return db[_0x8a67('0x2d')][_0x8a67('0x4a')]({'where':{'id':_0x54f3c6[_0x8a67('0x4b')]['id']}})[_0x8a67('0x26')](handleEntityNotFound(_0x54a5b2,null))[_0x8a67('0x26')](saveUpdates(_0x54f3c6[_0x8a67('0x49')],null))[_0x8a67('0x26')](respondWithResult(_0x54a5b2,null))[_0x8a67('0x48')](handleError(_0x54a5b2,null));};exports[_0x8a67('0x27')]=function(_0x199d70,_0x15c1a2){return db[_0x8a67('0x2d')][_0x8a67('0x4a')]({'where':{'id':_0x199d70[_0x8a67('0x4b')]['id']}})[_0x8a67('0x26')](handleEntityNotFound(_0x15c1a2,null))[_0x8a67('0x26')](removeEntity(_0x15c1a2,null))['catch'](handleError(_0x15c1a2,null));}; \ No newline at end of file +var _0x0da4=['send','ZohoField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','map','options','includeAll','rows','catch','show','params','keys','length','include','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','error','stack','name'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x0da4,0x13b));var _0x40da=function(_0x1c8a41,_0x32d1f7){_0x1c8a41=_0x1c8a41-0x0;var _0x2108b4=_0x0da4[_0x1c8a41];return _0x2108b4;};'use strict';var pdf=require(_0x40da('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x40da('0x1'));var zipdir=require(_0x40da('0x2'));var jsonpatch=require(_0x40da('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x40da('0x4'));var Mustache=require(_0x40da('0x5'));var util=require('util');var path=require(_0x40da('0x6'));var sox=require(_0x40da('0x7'));var csv=require('to-csv');var ejs=require(_0x40da('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x40da('0x9'));var crypto=require(_0x40da('0xa'));var jsforce=require(_0x40da('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x40da('0xc'));var querystring=require(_0x40da('0xd'));var Papa=require(_0x40da('0xe'));var Redis=require(_0x40da('0xf'));var authService=require(_0x40da('0x10'));var qs=require(_0x40da('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40da('0x12'));var logger=require(_0x40da('0x13'))(_0x40da('0x14'));var utils=require(_0x40da('0x15'));var config=require(_0x40da('0x16'));var db=require(_0x40da('0x17'))['db'];function respondWithStatusCode(_0x178612,_0x3aa946){_0x3aa946=_0x3aa946||0xcc;return function(_0x429c17){if(_0x429c17){return _0x178612[_0x40da('0x18')](_0x3aa946);}return _0x178612[_0x40da('0x19')](_0x3aa946)[_0x40da('0x1a')]();};}function respondWithResult(_0x4af040,_0x4dea21){_0x4dea21=_0x4dea21||0xc8;return function(_0x185689){if(_0x185689){return _0x4af040[_0x40da('0x19')](_0x4dea21)[_0x40da('0x1b')](_0x185689);}};}function respondWithFilteredResult(_0x32fe6a,_0x2b12ff){return function(_0x1944f1){if(_0x1944f1){var _0x2382de=_0x1944f1[_0x40da('0x1c')],_0x4885ef=_0x2b12ff[_0x40da('0x1d')],_0x36ce88=_0x2b12ff[_0x40da('0x1d')]+_0x2b12ff[_0x40da('0x1e')],_0x415b6b;if(_0x36ce88>=_0x2382de){_0x36ce88=_0x2382de;_0x415b6b=0xc8;}else{_0x415b6b=0xce;}_0x32fe6a[_0x40da('0x19')](_0x415b6b);return _0x32fe6a[_0x40da('0x1f')]('Content-Range',_0x4885ef+'-'+_0x36ce88+'/'+_0x2382de)[_0x40da('0x1b')](_0x1944f1);}return null;};}function patchUpdates(_0x15e87a){return function(_0x409082){try{jsonpatch[_0x40da('0x20')](_0x409082,_0x15e87a,!![]);}catch(_0x56f07e){return BPromise['reject'](_0x56f07e);}return _0x409082[_0x40da('0x21')]();};}function saveUpdates(_0x3ec23f,_0x54d5fe){return function(_0xf0c2a4){if(_0xf0c2a4){return _0xf0c2a4[_0x40da('0x22')](_0x3ec23f)[_0x40da('0x23')](function(_0x41e4c1){return _0x41e4c1;});}return null;};}function removeEntity(_0x478cad,_0x11f345){return function(_0x4f8dfb){if(_0x4f8dfb){return _0x4f8dfb[_0x40da('0x24')]()[_0x40da('0x23')](function(){_0x478cad['status'](0xcc)[_0x40da('0x1a')]();});}};}function handleEntityNotFound(_0x48af2b,_0x5ae459){return function(_0x4fea1a){if(!_0x4fea1a){_0x48af2b[_0x40da('0x18')](0x194);}return _0x4fea1a;};}function handleError(_0x3b67e8,_0x5ccaf5){_0x5ccaf5=_0x5ccaf5||0x1f4;return function(_0x610b6){logger[_0x40da('0x25')](_0x610b6[_0x40da('0x26')]);if(_0x610b6['name']){delete _0x610b6[_0x40da('0x27')];}_0x3b67e8[_0x40da('0x19')](_0x5ccaf5)[_0x40da('0x28')](_0x610b6);};}exports['index']=function(_0x3e77b6,_0x596bd4){var _0x4aaaa6={},_0x2361a1={},_0x24caed={'count':0x0,'rows':[]};var _0x304b93=_['map'](db[_0x40da('0x29')][_0x40da('0x2a')],function(_0xf6535a){return{'name':_0xf6535a[_0x40da('0x2b')],'type':_0xf6535a[_0x40da('0x2c')][_0x40da('0x2d')]};});_0x2361a1[_0x40da('0x2e')]=_['map'](_0x304b93,'name');_0x2361a1[_0x40da('0x2f')]=_['keys'](_0x3e77b6['query']);_0x2361a1[_0x40da('0x30')]=_[_0x40da('0x31')](_0x2361a1[_0x40da('0x2e')],_0x2361a1['query']);_0x4aaaa6[_0x40da('0x32')]=_[_0x40da('0x31')](_0x2361a1['model'],qs[_0x40da('0x33')](_0x3e77b6[_0x40da('0x2f')][_0x40da('0x33')]));_0x4aaaa6[_0x40da('0x32')]=_0x4aaaa6[_0x40da('0x32')]['length']?_0x4aaaa6[_0x40da('0x32')]:_0x2361a1[_0x40da('0x2e')];if(!_0x3e77b6[_0x40da('0x2f')][_0x40da('0x34')](_0x40da('0x35'))){_0x4aaaa6[_0x40da('0x1e')]=qs[_0x40da('0x1e')](_0x3e77b6['query'][_0x40da('0x1e')]);_0x4aaaa6['offset']=qs['offset'](_0x3e77b6[_0x40da('0x2f')][_0x40da('0x1d')]);}_0x4aaaa6[_0x40da('0x36')]=qs[_0x40da('0x37')](_0x3e77b6[_0x40da('0x2f')][_0x40da('0x37')]);_0x4aaaa6['where']=qs[_0x40da('0x30')](_['pick'](_0x3e77b6[_0x40da('0x2f')],_0x2361a1[_0x40da('0x30')]));if(_0x3e77b6[_0x40da('0x2f')]['filter']){_0x4aaaa6[_0x40da('0x38')]=_[_0x40da('0x39')](_0x4aaaa6[_0x40da('0x38')],{'$or':_[_0x40da('0x3a')](_0x304b93,function(_0x8b648a){if(_0x8b648a[_0x40da('0x2c')]!=='VIRTUAL'){var _0x188bf0={};_0x188bf0[_0x8b648a[_0x40da('0x27')]]={'$like':'%'+_0x3e77b6['query']['filter']+'%'};return _0x188bf0;}})});}_0x4aaaa6=_['merge']({},_0x4aaaa6,_0x3e77b6[_0x40da('0x3b')]);var _0x195df6={'where':_0x4aaaa6[_0x40da('0x38')]};return db[_0x40da('0x29')][_0x40da('0x1c')](_0x195df6)['then'](function(_0x42392e){_0x24caed['count']=_0x42392e;if(_0x3e77b6['query'][_0x40da('0x3c')]){_0x4aaaa6['include']=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x4aaaa6);})[_0x40da('0x23')](function(_0x52c7d1){_0x24caed[_0x40da('0x3d')]=_0x52c7d1;return _0x24caed;})[_0x40da('0x23')](respondWithFilteredResult(_0x596bd4,_0x4aaaa6))[_0x40da('0x3e')](handleError(_0x596bd4,null));};exports[_0x40da('0x3f')]=function(_0x2f15b2,_0x24ccf8){var _0x2fec47={'raw':!![],'where':{'id':_0x2f15b2[_0x40da('0x40')]['id']}},_0x310eae={};_0x310eae[_0x40da('0x2e')]=_['keys'](db[_0x40da('0x29')]['rawAttributes']);_0x310eae[_0x40da('0x2f')]=_[_0x40da('0x41')](_0x2f15b2['query']);_0x310eae[_0x40da('0x30')]=_[_0x40da('0x31')](_0x310eae[_0x40da('0x2e')],_0x310eae['query']);_0x2fec47[_0x40da('0x32')]=_[_0x40da('0x31')](_0x310eae['model'],qs[_0x40da('0x33')](_0x2f15b2['query'][_0x40da('0x33')]));_0x2fec47['attributes']=_0x2fec47[_0x40da('0x32')][_0x40da('0x42')]?_0x2fec47[_0x40da('0x32')]:_0x310eae[_0x40da('0x2e')];if(_0x2f15b2[_0x40da('0x2f')][_0x40da('0x3c')]){_0x2fec47[_0x40da('0x43')]=[{'all':!![]}];}_0x2fec47=_['merge']({},_0x2fec47,_0x2f15b2[_0x40da('0x3b')]);return db[_0x40da('0x29')]['find'](_0x2fec47)[_0x40da('0x23')](handleEntityNotFound(_0x24ccf8,null))['then'](respondWithResult(_0x24ccf8,null))[_0x40da('0x3e')](handleError(_0x24ccf8,null));};exports[_0x40da('0x44')]=function(_0x3f9ab8,_0x44bd4c){return db['ZohoField'][_0x40da('0x44')](_0x3f9ab8[_0x40da('0x45')],{})[_0x40da('0x23')](respondWithResult(_0x44bd4c,0xc9))[_0x40da('0x3e')](handleError(_0x44bd4c,null));};exports[_0x40da('0x22')]=function(_0x1b2652,_0x3fa6f3){if(_0x1b2652['body']['id']){delete _0x1b2652[_0x40da('0x45')]['id'];}return db[_0x40da('0x29')][_0x40da('0x46')]({'where':{'id':_0x1b2652[_0x40da('0x40')]['id']}})[_0x40da('0x23')](handleEntityNotFound(_0x3fa6f3,null))[_0x40da('0x23')](saveUpdates(_0x1b2652[_0x40da('0x45')],null))[_0x40da('0x23')](respondWithResult(_0x3fa6f3,null))['catch'](handleError(_0x3fa6f3,null));};exports[_0x40da('0x24')]=function(_0x1b758e,_0x32a6d6){return db[_0x40da('0x29')][_0x40da('0x46')]({'where':{'id':_0x1b758e[_0x40da('0x40')]['id']}})[_0x40da('0x23')](handleEntityNotFound(_0x32a6d6,null))['then'](removeEntity(_0x32a6d6,null))[_0x40da('0x3e')](handleError(_0x32a6d6,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index ab64e16..ff5d9bc 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 _0x06a6=['../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x399849,_0x3b630d){var _0xfbb04=function(_0x4fea04){while(--_0x4fea04){_0x399849['push'](_0x399849['shift']());}};_0xfbb04(++_0x3b630d);}(_0x06a6,0x107));var _0x606a=function(_0x4ece94,_0x446e1b){_0x4ece94=_0x4ece94-0x0;var _0x37d818=_0x06a6[_0x4ece94];return _0x37d818;};'use strict';var _=require(_0x606a('0x0'));var util=require(_0x606a('0x1'));var logger=require('../../config/logger')(_0x606a('0x2'));var moment=require(_0x606a('0x3'));var BPromise=require(_0x606a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x606a('0x5'));var rimraf=require(_0x606a('0x6'));var config=require(_0x606a('0x7'));var attributes=require(_0x606a('0x8'));module[_0x606a('0x9')]=function(_0x6ba126,_0x369796){return _0x6ba126[_0x606a('0xa')](_0x606a('0xb'),attributes,{'tableName':_0x606a('0xc'),'paranoid':![],'indexes':[{'name':_0x606a('0xd'),'fields':['idField',_0x606a('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xefbd=['moment','request-promise','path','rimraf','../../config/environment','ZohoField','int_zoho_fields','FieldId','lodash','util','../../config/logger'];(function(_0x45b82f,_0x3bca8e){var _0x21b2bf=function(_0x3f8971){while(--_0x3f8971){_0x45b82f['push'](_0x45b82f['shift']());}};_0x21b2bf(++_0x3bca8e);}(_0xefbd,0x19f));var _0xdefb=function(_0x5530eb,_0x6bbfd2){_0x5530eb=_0x5530eb-0x0;var _0x48089a=_0xefbd[_0x5530eb];return _0x48089a;};'use strict';var _=require(_0xdefb('0x0'));var util=require(_0xdefb('0x1'));var logger=require(_0xdefb('0x2'))('api');var moment=require(_0xdefb('0x3'));var BPromise=require('bluebird');var rp=require(_0xdefb('0x4'));var fs=require('fs');var path=require(_0xdefb('0x5'));var rimraf=require(_0xdefb('0x6'));var config=require(_0xdefb('0x7'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x1a0c96,_0xbf762){return _0x1a0c96['define'](_0xdefb('0x8'),attributes,{'tableName':_0xdefb('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0xdefb('0xa')],'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 fde5daf..ae1a4ad 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 _0xd6d6=['ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5e02e1,_0x32fc9d){var _0x1c9864=function(_0xd1b019){while(--_0xd1b019){_0x5e02e1['push'](_0x5e02e1['shift']());}};_0x1c9864(++_0x32fc9d);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5d1bf7,_0x537298){_0x5d1bf7=_0x5d1bf7-0x0;var _0x53c51c=_0xd6d6[_0x5d1bf7];return _0x53c51c;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){return client[_0x6d6d('0xc')](_0x1bf731,_0x18f824)['then'](function(_0x51dd38){logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,_0x6d6d('0xf'));logger[_0x6d6d('0x10')](_0x6d6d('0x11'),_0x44f83d,'request\x20sent',JSON[_0x6d6d('0x12')](_0x51dd38));if(_0x51dd38[_0x6d6d('0x13')]){if(_0x51dd38['error']['code']===0x1f4){logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);return _0x408f88(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38['error'][_0x6d6d('0x14')]);return _0xd49f57(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}else{logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,'request\x20sent');_0xd49f57(_0x51dd38[_0x6d6d('0x15')]['message']);}})[_0x6d6d('0x16')](function(_0x2cbc86){logger[_0x6d6d('0x13')]('ZohoField,\x20%s,\x20%s',_0x44f83d,_0x2cbc86);_0x408f88(_0x2cbc86);});});} \ No newline at end of file +var _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x406a72,_0x38bcdc){var _0x4f44e4=function(_0x325641){while(--_0x325641){_0x406a72['push'](_0x406a72['shift']());}};_0x4f44e4(++_0x38bcdc);}(_0x4c4e,0x152));var _0xe4c4=function(_0x5d570f,_0xc94f2e){_0x5d570f=_0x5d570f-0x0;var _0x47445b=_0x4c4e[_0x5d570f];return _0x47445b;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('ZohoField,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('ZohoField,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 72a8ada..a5d5bae 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 _0x5c7b=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5c7b,0xd0));var _0xb5c7=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x5c7b[_0x243b59];return _0x3e1676;};'use strict';var multer=require(_0xb5c7('0x0'));var util=require(_0xb5c7('0x1'));var path=require(_0xb5c7('0x2'));var timeout=require(_0xb5c7('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xb5c7('0x4'));var interaction=require(_0xb5c7('0x5'));var config=require(_0xb5c7('0x6'));module[_0xb5c7('0x7')]=router; \ No newline at end of file +var _0x96b0=['path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x53a4ae,_0x205c04){var _0x34da61=function(_0x1402fe){while(--_0x1402fe){_0x53a4ae['push'](_0x53a4ae['shift']());}};_0x34da61(++_0x205c04);}(_0x96b0,0x10e));var _0x096b=function(_0x281266,_0x17807e){_0x281266=_0x281266-0x0;var _0x34b80b=_0x96b0[_0x281266];return _0x34b80b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x096b('0x0'));var timeout=require(_0x096b('0x1'));var express=require(_0x096b('0x2'));var router=express[_0x096b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x096b('0x4'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 5205307..eeddd1d 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 _0x5a60=['unique_name_and_version','STRING','app.js','INTEGER'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x5a60,0x158));var _0x05a6=function(_0x244872,_0x318162){_0x244872=_0x244872-0x0;var _0x416219=_0x5a60[_0x244872];return _0x416219;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x05a6('0x0')},'version':{'type':Sequelize[_0x05a6('0x1')],'allowNull':![],'unique':_0x05a6('0x0')},'main':{'type':Sequelize[_0x05a6('0x1')],'defaultValue':_0x05a6('0x2')},'filename':{'type':Sequelize[_0x05a6('0x1')]},'path':{'type':Sequelize[_0x05a6('0x1')]},'type':{'type':Sequelize[_0x05a6('0x1')]},'size':{'type':Sequelize[_0x05a6('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x05a6('0x1')]},'logo':{'type':Sequelize[_0x05a6('0x1')]},'state':{'type':Sequelize[_0x05a6('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x05a6('0x1')]},'title':{'type':Sequelize[_0x05a6('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x05a6('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x48b7=['STRING','unique_name_and_version','app.js','BOOLEAN','state','sequelize'];(function(_0x1cb119,_0x31ce79){var _0x2eb79a=function(_0x313f35){while(--_0x313f35){_0x1cb119['push'](_0x1cb119['shift']());}};_0x2eb79a(++_0x31ce79);}(_0x48b7,0xe9));var _0x748b=function(_0x40570f,_0x3fb4fd){_0x40570f=_0x40570f-0x0;var _0x4f1ad9=_0x48b7[_0x40570f];return _0x4f1ad9;};'use strict';var Sequelize=require(_0x748b('0x0'));module['exports']={'name':{'type':Sequelize[_0x748b('0x1')],'allowNull':![],'unique':_0x748b('0x2')},'version':{'type':Sequelize[_0x748b('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x748b('0x3')},'filename':{'type':Sequelize[_0x748b('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x748b('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x748b('0x1')]},'logo':{'type':Sequelize[_0x748b('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0x748b('0x5')},'description':{'type':Sequelize[_0x748b('0x1')]},'title':{'type':Sequelize[_0x748b('0x1')]},'remoteUri':{'type':Sequelize[_0x748b('0x1')]},'link':{'type':Sequelize[_0x748b('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 2d98821..ceb349c 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 _0x1b36=['save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','include','Integration','findAll','rows','show','params','includeAll','find','catch','create','body','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','offset','limit','set','apply','reject'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x1b36,0x1d3));var _0x61b3=function(_0x84078e,_0xc71510){_0x84078e=_0x84078e-0x0;var _0x68431d=_0x1b36[_0x84078e];return _0x68431d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x61b3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x61b3('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x61b3('0x2'));var Mustache=require(_0x61b3('0x3'));var util=require('util');var path=require(_0x61b3('0x4'));var sox=require(_0x61b3('0x5'));var csv=require(_0x61b3('0x6'));var ejs=require(_0x61b3('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x61b3('0x8'));var crypto=require(_0x61b3('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x61b3('0xa'));var toCsv=require(_0x61b3('0x6'));var querystring=require(_0x61b3('0xb'));var Papa=require(_0x61b3('0xc'));var Redis=require(_0x61b3('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x61b3('0xe'));var as=require(_0x61b3('0xf'));var hardwareService=require(_0x61b3('0x10'));var logger=require(_0x61b3('0x11'))(_0x61b3('0x12'));var utils=require(_0x61b3('0x13'));var config=require(_0x61b3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3008f0,_0x267ef6){_0x267ef6=_0x267ef6||0xcc;return function(_0x54db13){if(_0x54db13){return _0x3008f0['sendStatus'](_0x267ef6);}return _0x3008f0['status'](_0x267ef6)[_0x61b3('0x15')]();};}function respondWithResult(_0x7fef79,_0x58ad16){_0x58ad16=_0x58ad16||0xc8;return function(_0x10fe4e){if(_0x10fe4e){return _0x7fef79[_0x61b3('0x16')](_0x58ad16)[_0x61b3('0x17')](_0x10fe4e);}};}function respondWithFilteredResult(_0x3ec342,_0x49de4a){return function(_0x4fba50){if(_0x4fba50){var _0x46f9bc=_0x4fba50[_0x61b3('0x18')],_0x387700=_0x49de4a['offset'],_0xc117e8=_0x49de4a[_0x61b3('0x19')]+_0x49de4a[_0x61b3('0x1a')],_0x3cc6fc;if(_0xc117e8>=_0x46f9bc){_0xc117e8=_0x46f9bc;_0x3cc6fc=0xc8;}else{_0x3cc6fc=0xce;}_0x3ec342[_0x61b3('0x16')](_0x3cc6fc);return _0x3ec342[_0x61b3('0x1b')]('Content-Range',_0x387700+'-'+_0xc117e8+'/'+_0x46f9bc)[_0x61b3('0x17')](_0x4fba50);}return null;};}function patchUpdates(_0x4b7787){return function(_0x39fa48){try{jsonpatch[_0x61b3('0x1c')](_0x39fa48,_0x4b7787,!![]);}catch(_0x3628b3){return BPromise[_0x61b3('0x1d')](_0x3628b3);}return _0x39fa48[_0x61b3('0x1e')]();};}function saveUpdates(_0x2cfa8c,_0xddc024){return function(_0x142828){if(_0x142828){return _0x142828[_0x61b3('0x1f')](_0x2cfa8c)['then'](function(_0xa783a4){return _0xa783a4;});}return null;};}function removeEntity(_0x4634d8,_0x397da0){return function(_0x286fb6){if(_0x286fb6){return _0x286fb6[_0x61b3('0x20')]()[_0x61b3('0x21')](function(){_0x4634d8['status'](0xcc)[_0x61b3('0x15')]();});}};}function handleEntityNotFound(_0x1d300e,_0x4bf51c){return function(_0x4c1a45){if(!_0x4c1a45){_0x1d300e['sendStatus'](0x194);}return _0x4c1a45;};}function handleError(_0x5ee4f,_0x58eecb){_0x58eecb=_0x58eecb||0x1f4;return function(_0x43f0b7){logger[_0x61b3('0x22')](_0x43f0b7[_0x61b3('0x23')]);if(_0x43f0b7[_0x61b3('0x24')]){delete _0x43f0b7[_0x61b3('0x24')];}_0x5ee4f[_0x61b3('0x16')](_0x58eecb)[_0x61b3('0x25')](_0x43f0b7);};}exports[_0x61b3('0x26')]=function(_0x1b12c6,_0x30000c){var _0x2eaeae={},_0x601850={},_0xbd8734={'count':0x0,'rows':[]};var _0x13fa1e=_[_0x61b3('0x27')](db['Integration'][_0x61b3('0x28')],function(_0x1716b1){return{'name':_0x1716b1[_0x61b3('0x29')],'type':_0x1716b1['type']['key']};});_0x601850[_0x61b3('0x2a')]=_['map'](_0x13fa1e,_0x61b3('0x24'));_0x601850['query']=_[_0x61b3('0x2b')](_0x1b12c6[_0x61b3('0x2c')]);_0x601850[_0x61b3('0x2d')]=_['intersection'](_0x601850[_0x61b3('0x2a')],_0x601850[_0x61b3('0x2c')]);_0x2eaeae[_0x61b3('0x2e')]=_[_0x61b3('0x2f')](_0x601850[_0x61b3('0x2a')],qs[_0x61b3('0x30')](_0x1b12c6['query'][_0x61b3('0x30')]));_0x2eaeae['attributes']=_0x2eaeae[_0x61b3('0x2e')][_0x61b3('0x31')]?_0x2eaeae[_0x61b3('0x2e')]:_0x601850[_0x61b3('0x2a')];if(!_0x1b12c6['query'][_0x61b3('0x32')](_0x61b3('0x33'))){_0x2eaeae[_0x61b3('0x1a')]=qs[_0x61b3('0x1a')](_0x1b12c6['query'][_0x61b3('0x1a')]);_0x2eaeae[_0x61b3('0x19')]=qs[_0x61b3('0x19')](_0x1b12c6[_0x61b3('0x2c')][_0x61b3('0x19')]);}_0x2eaeae['order']=qs[_0x61b3('0x34')](_0x1b12c6[_0x61b3('0x2c')][_0x61b3('0x34')]);_0x2eaeae[_0x61b3('0x35')]=qs[_0x61b3('0x2d')](_[_0x61b3('0x36')](_0x1b12c6[_0x61b3('0x2c')],_0x601850[_0x61b3('0x2d')]));if(_0x1b12c6['query'][_0x61b3('0x37')]){_0x2eaeae[_0x61b3('0x35')]=_['merge'](_0x2eaeae[_0x61b3('0x35')],{'$or':_[_0x61b3('0x27')](_0x13fa1e,function(_0x2e2b6c){if(_0x2e2b6c[_0x61b3('0x38')]!==_0x61b3('0x39')){var _0x1ef451={};_0x1ef451[_0x2e2b6c[_0x61b3('0x24')]]={'$like':'%'+_0x1b12c6[_0x61b3('0x2c')][_0x61b3('0x37')]+'%'};return _0x1ef451;}})});}_0x2eaeae=_[_0x61b3('0x3a')]({},_0x2eaeae,_0x1b12c6[_0x61b3('0x3b')]);var _0x21e996={'where':_0x2eaeae[_0x61b3('0x35')]};return db['Integration'][_0x61b3('0x18')](_0x21e996)['then'](function(_0x4f59bd){_0xbd8734[_0x61b3('0x18')]=_0x4f59bd;if(_0x1b12c6['query']['includeAll']){_0x2eaeae[_0x61b3('0x3c')]=[{'all':!![]}];}return db[_0x61b3('0x3d')][_0x61b3('0x3e')](_0x2eaeae);})[_0x61b3('0x21')](function(_0x568617){_0xbd8734[_0x61b3('0x3f')]=_0x568617;return _0xbd8734;})[_0x61b3('0x21')](respondWithFilteredResult(_0x30000c,_0x2eaeae))['catch'](handleError(_0x30000c,null));};exports[_0x61b3('0x40')]=function(_0x46d926,_0x1b9b29){var _0x175125={'raw':![],'where':{'id':_0x46d926[_0x61b3('0x41')]['id']}},_0x2f8c0e={};_0x2f8c0e[_0x61b3('0x2a')]=_[_0x61b3('0x2b')](db[_0x61b3('0x3d')][_0x61b3('0x28')]);_0x2f8c0e[_0x61b3('0x2c')]=_[_0x61b3('0x2b')](_0x46d926[_0x61b3('0x2c')]);_0x2f8c0e['filters']=_[_0x61b3('0x2f')](_0x2f8c0e['model'],_0x2f8c0e[_0x61b3('0x2c')]);_0x175125[_0x61b3('0x2e')]=_['intersection'](_0x2f8c0e[_0x61b3('0x2a')],qs[_0x61b3('0x30')](_0x46d926[_0x61b3('0x2c')][_0x61b3('0x30')]));_0x175125['attributes']=_0x175125[_0x61b3('0x2e')][_0x61b3('0x31')]?_0x175125[_0x61b3('0x2e')]:_0x2f8c0e[_0x61b3('0x2a')];if(_0x46d926[_0x61b3('0x2c')][_0x61b3('0x42')]){_0x175125['include']=[{'all':!![]}];}_0x175125=_['merge']({},_0x175125,_0x46d926[_0x61b3('0x3b')]);return db['Integration'][_0x61b3('0x43')](_0x175125)[_0x61b3('0x21')](handleEntityNotFound(_0x1b9b29,null))[_0x61b3('0x21')](respondWithResult(_0x1b9b29,null))[_0x61b3('0x44')](handleError(_0x1b9b29,null));};exports[_0x61b3('0x45')]=function(_0x3dc412,_0x411f85){return db[_0x61b3('0x3d')]['create'](_0x3dc412[_0x61b3('0x46')],{})[_0x61b3('0x21')](respondWithResult(_0x411f85,0xc9))[_0x61b3('0x44')](handleError(_0x411f85,null));};exports[_0x61b3('0x1f')]=function(_0x5f5bc0,_0x56156a){if(_0x5f5bc0[_0x61b3('0x46')]['id']){delete _0x5f5bc0[_0x61b3('0x46')]['id'];}return db['Integration'][_0x61b3('0x43')]({'where':{'id':_0x5f5bc0[_0x61b3('0x41')]['id']}})[_0x61b3('0x21')](handleEntityNotFound(_0x56156a,null))['then'](saveUpdates(_0x5f5bc0[_0x61b3('0x46')],null))[_0x61b3('0x21')](respondWithResult(_0x56156a,null))['catch'](handleError(_0x56156a,null));};exports[_0x61b3('0x20')]=function(_0x211b60,_0x27230){return db[_0x61b3('0x3d')]['find']({'where':{'id':_0x211b60[_0x61b3('0x41')]['id']}})['then'](handleEntityNotFound(_0x27230,null))[_0x61b3('0x21')](removeEntity(_0x27230,null))[_0x61b3('0x44')](handleError(_0x27230,null));}; \ No newline at end of file +var _0xdb77=['keys','find','create','body','update','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','save','destroy','then','stack','name','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','Integration','count','includeAll','include','findAll','rows','catch','show'];(function(_0x1757f2,_0x1b09fa){var _0x5e7212=function(_0x4f1794){while(--_0x4f1794){_0x1757f2['push'](_0x1757f2['shift']());}};_0x5e7212(++_0x1b09fa);}(_0xdb77,0xe4));var _0x7db7=function(_0x313820,_0x2ae85e){_0x313820=_0x313820-0x0;var _0x434fd5=_0xdb77[_0x313820];return _0x434fd5;};'use strict';var pdf=require(_0x7db7('0x0'));var emlformat=require(_0x7db7('0x1'));var rimraf=require(_0x7db7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7db7('0x3'));var rp=require(_0x7db7('0x4'));var moment=require(_0x7db7('0x5'));var BPromise=require(_0x7db7('0x6'));var Mustache=require(_0x7db7('0x7'));var util=require(_0x7db7('0x8'));var path=require(_0x7db7('0x9'));var sox=require('sox');var csv=require(_0x7db7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7db7('0xb'));var squel=require(_0x7db7('0xc'));var crypto=require(_0x7db7('0xd'));var jsforce=require(_0x7db7('0xe'));var deskjs=require(_0x7db7('0xf'));var toCsv=require(_0x7db7('0xa'));var querystring=require(_0x7db7('0x10'));var Papa=require(_0x7db7('0x11'));var Redis=require(_0x7db7('0x12'));var authService=require(_0x7db7('0x13'));var qs=require(_0x7db7('0x14'));var as=require(_0x7db7('0x15'));var hardwareService=require(_0x7db7('0x16'));var logger=require(_0x7db7('0x17'))(_0x7db7('0x18'));var utils=require(_0x7db7('0x19'));var config=require('../../config/environment');var db=require(_0x7db7('0x1a'))['db'];function respondWithStatusCode(_0x388d48,_0x2e5749){_0x2e5749=_0x2e5749||0xcc;return function(_0x1b1cae){if(_0x1b1cae){return _0x388d48[_0x7db7('0x1b')](_0x2e5749);}return _0x388d48[_0x7db7('0x1c')](_0x2e5749)[_0x7db7('0x1d')]();};}function respondWithResult(_0x569be7,_0x50f583){_0x50f583=_0x50f583||0xc8;return function(_0x7e18f2){if(_0x7e18f2){return _0x569be7['status'](_0x50f583)[_0x7db7('0x1e')](_0x7e18f2);}};}function respondWithFilteredResult(_0x5b5b3d,_0x535205){return function(_0x39f45b){if(_0x39f45b){var _0x3594af=_0x39f45b['count'],_0x28f7c4=_0x535205[_0x7db7('0x1f')],_0x34c911=_0x535205[_0x7db7('0x1f')]+_0x535205[_0x7db7('0x20')],_0xe3f178;if(_0x34c911>=_0x3594af){_0x34c911=_0x3594af;_0xe3f178=0xc8;}else{_0xe3f178=0xce;}_0x5b5b3d[_0x7db7('0x1c')](_0xe3f178);return _0x5b5b3d[_0x7db7('0x21')]('Content-Range',_0x28f7c4+'-'+_0x34c911+'/'+_0x3594af)[_0x7db7('0x1e')](_0x39f45b);}return null;};}function patchUpdates(_0x5a3ac7){return function(_0x1251b5){try{jsonpatch[_0x7db7('0x22')](_0x1251b5,_0x5a3ac7,!![]);}catch(_0x381968){return BPromise['reject'](_0x381968);}return _0x1251b5[_0x7db7('0x23')]();};}function saveUpdates(_0x134682,_0x215bcb){return function(_0x357cef){if(_0x357cef){return _0x357cef['update'](_0x134682)['then'](function(_0x19bfec){return _0x19bfec;});}return null;};}function removeEntity(_0x14f5b7,_0xb6755a){return function(_0x162314){if(_0x162314){return _0x162314[_0x7db7('0x24')]()[_0x7db7('0x25')](function(){_0x14f5b7[_0x7db7('0x1c')](0xcc)[_0x7db7('0x1d')]();});}};}function handleEntityNotFound(_0x8705d5,_0x4a8da0){return function(_0x48a52c){if(!_0x48a52c){_0x8705d5[_0x7db7('0x1b')](0x194);}return _0x48a52c;};}function handleError(_0x19b290,_0x91aec){_0x91aec=_0x91aec||0x1f4;return function(_0x30a1a1){logger['error'](_0x30a1a1[_0x7db7('0x26')]);if(_0x30a1a1[_0x7db7('0x27')]){delete _0x30a1a1[_0x7db7('0x27')];}_0x19b290[_0x7db7('0x1c')](_0x91aec)['send'](_0x30a1a1);};}exports['index']=function(_0x462998,_0x17047a){var _0x47b820={},_0x9d9d2e={},_0x1873ae={'count':0x0,'rows':[]};var _0x59bd04=_[_0x7db7('0x28')](db['Integration'][_0x7db7('0x29')],function(_0x1a9c7b){return{'name':_0x1a9c7b[_0x7db7('0x2a')],'type':_0x1a9c7b['type'][_0x7db7('0x2b')]};});_0x9d9d2e['model']=_[_0x7db7('0x28')](_0x59bd04,_0x7db7('0x27'));_0x9d9d2e['query']=_['keys'](_0x462998[_0x7db7('0x2c')]);_0x9d9d2e[_0x7db7('0x2d')]=_[_0x7db7('0x2e')](_0x9d9d2e[_0x7db7('0x2f')],_0x9d9d2e[_0x7db7('0x2c')]);_0x47b820[_0x7db7('0x30')]=_[_0x7db7('0x2e')](_0x9d9d2e['model'],qs[_0x7db7('0x31')](_0x462998[_0x7db7('0x2c')][_0x7db7('0x31')]));_0x47b820[_0x7db7('0x30')]=_0x47b820[_0x7db7('0x30')][_0x7db7('0x32')]?_0x47b820[_0x7db7('0x30')]:_0x9d9d2e['model'];if(!_0x462998[_0x7db7('0x2c')][_0x7db7('0x33')](_0x7db7('0x34'))){_0x47b820['limit']=qs['limit'](_0x462998['query'][_0x7db7('0x20')]);_0x47b820[_0x7db7('0x1f')]=qs[_0x7db7('0x1f')](_0x462998[_0x7db7('0x2c')]['offset']);}_0x47b820[_0x7db7('0x35')]=qs['sort'](_0x462998[_0x7db7('0x2c')]['sort']);_0x47b820[_0x7db7('0x36')]=qs[_0x7db7('0x2d')](_[_0x7db7('0x37')](_0x462998[_0x7db7('0x2c')],_0x9d9d2e[_0x7db7('0x2d')]));if(_0x462998[_0x7db7('0x2c')][_0x7db7('0x38')]){_0x47b820['where']=_[_0x7db7('0x39')](_0x47b820[_0x7db7('0x36')],{'$or':_[_0x7db7('0x28')](_0x59bd04,function(_0x426b83){if(_0x426b83['type']!==_0x7db7('0x3a')){var _0x4c0741={};_0x4c0741[_0x426b83['name']]={'$like':'%'+_0x462998['query']['filter']+'%'};return _0x4c0741;}})});}_0x47b820=_['merge']({},_0x47b820,_0x462998[_0x7db7('0x3b')]);var _0x1533b3={'where':_0x47b820[_0x7db7('0x36')]};return db[_0x7db7('0x3c')][_0x7db7('0x3d')](_0x1533b3)[_0x7db7('0x25')](function(_0x2fc16c){_0x1873ae[_0x7db7('0x3d')]=_0x2fc16c;if(_0x462998[_0x7db7('0x2c')][_0x7db7('0x3e')]){_0x47b820[_0x7db7('0x3f')]=[{'all':!![]}];}return db['Integration'][_0x7db7('0x40')](_0x47b820);})[_0x7db7('0x25')](function(_0x496034){_0x1873ae[_0x7db7('0x41')]=_0x496034;return _0x1873ae;})[_0x7db7('0x25')](respondWithFilteredResult(_0x17047a,_0x47b820))[_0x7db7('0x42')](handleError(_0x17047a,null));};exports[_0x7db7('0x43')]=function(_0x3cd40f,_0x453be3){var _0x3718ac={'raw':![],'where':{'id':_0x3cd40f['params']['id']}},_0xa4194a={};_0xa4194a[_0x7db7('0x2f')]=_[_0x7db7('0x44')](db[_0x7db7('0x3c')]['rawAttributes']);_0xa4194a[_0x7db7('0x2c')]=_['keys'](_0x3cd40f[_0x7db7('0x2c')]);_0xa4194a[_0x7db7('0x2d')]=_[_0x7db7('0x2e')](_0xa4194a[_0x7db7('0x2f')],_0xa4194a[_0x7db7('0x2c')]);_0x3718ac[_0x7db7('0x30')]=_[_0x7db7('0x2e')](_0xa4194a[_0x7db7('0x2f')],qs[_0x7db7('0x31')](_0x3cd40f[_0x7db7('0x2c')][_0x7db7('0x31')]));_0x3718ac[_0x7db7('0x30')]=_0x3718ac[_0x7db7('0x30')]['length']?_0x3718ac[_0x7db7('0x30')]:_0xa4194a['model'];if(_0x3cd40f[_0x7db7('0x2c')][_0x7db7('0x3e')]){_0x3718ac['include']=[{'all':!![]}];}_0x3718ac=_[_0x7db7('0x39')]({},_0x3718ac,_0x3cd40f[_0x7db7('0x3b')]);return db['Integration'][_0x7db7('0x45')](_0x3718ac)[_0x7db7('0x25')](handleEntityNotFound(_0x453be3,null))[_0x7db7('0x25')](respondWithResult(_0x453be3,null))[_0x7db7('0x42')](handleError(_0x453be3,null));};exports['create']=function(_0x481116,_0x5ce6a4){return db[_0x7db7('0x3c')][_0x7db7('0x46')](_0x481116[_0x7db7('0x47')],{})[_0x7db7('0x25')](respondWithResult(_0x5ce6a4,0xc9))[_0x7db7('0x42')](handleError(_0x5ce6a4,null));};exports[_0x7db7('0x48')]=function(_0x334a23,_0x1937db){if(_0x334a23[_0x7db7('0x47')]['id']){delete _0x334a23[_0x7db7('0x47')]['id'];}return db['Integration']['find']({'where':{'id':_0x334a23[_0x7db7('0x49')]['id']}})[_0x7db7('0x25')](handleEntityNotFound(_0x1937db,null))['then'](saveUpdates(_0x334a23['body'],null))[_0x7db7('0x25')](respondWithResult(_0x1937db,null))['catch'](handleError(_0x1937db,null));};exports[_0x7db7('0x24')]=function(_0x23e09b,_0x8faf27){return db['Integration'][_0x7db7('0x45')]({'where':{'id':_0x23e09b[_0x7db7('0x49')]['id']}})[_0x7db7('0x25')](handleEntityNotFound(_0x8faf27,null))[_0x7db7('0x25')](removeEntity(_0x8faf27,null))[_0x7db7('0x42')](handleError(_0x8faf27,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b8591d3..b0ce3af 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 _0x8fa0=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util'];(function(_0xf74a9a,_0x4beab0){var _0x2bb3d9=function(_0x55e9f2){while(--_0x55e9f2){_0xf74a9a['push'](_0xf74a9a['shift']());}};_0x2bb3d9(++_0x4beab0);}(_0x8fa0,0xa6));var _0x08fa=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x8fa0[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x08fa('0x0'));var util=require(_0x08fa('0x1'));var logger=require(_0x08fa('0x2'))('api');var moment=require(_0x08fa('0x3'));var BPromise=require(_0x08fa('0x4'));var rp=require(_0x08fa('0x5'));var fs=require('fs');var path=require(_0x08fa('0x6'));var rimraf=require(_0x08fa('0x7'));var config=require(_0x08fa('0x8'));var attributes=require(_0x08fa('0x9'));module[_0x08fa('0xa')]=function(_0xb63cb4,_0x1d5cba){return _0xb63cb4[_0x08fa('0xb')](_0x08fa('0xc'),attributes,{'tableName':_0x08fa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbec2=['request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api'];(function(_0x3f1735,_0x979bbf){var _0x14b301=function(_0x34b26e){while(--_0x34b26e){_0x3f1735['push'](_0x3f1735['shift']());}};_0x14b301(++_0x979bbf);}(_0xbec2,0x18f));var _0x2bec=function(_0x281519,_0x309879){_0x281519=_0x281519-0x0;var _0x1a9160=_0xbec2[_0x281519];return _0x1a9160;};'use strict';var _=require(_0x2bec('0x0'));var util=require(_0x2bec('0x1'));var logger=require(_0x2bec('0x2'))(_0x2bec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2bec('0x4'));var fs=require('fs');var path=require(_0x2bec('0x5'));var rimraf=require(_0x2bec('0x6'));var config=require(_0x2bec('0x7'));var attributes=require(_0x2bec('0x8'));module[_0x2bec('0x9')]=function(_0x1f3aa0,_0x489ed5){return _0x1f3aa0[_0x2bec('0xa')](_0x2bec('0xb'),attributes,{'tableName':_0x2bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index f9ef36b..895b024 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 _0xea04=['Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','Integration,\x20%s,\x20%s','debug'];(function(_0x23336a,_0x3c456b){var _0x4f5fbe=function(_0x13b879){while(--_0x13b879){_0x23336a['push'](_0x23336a['shift']());}};_0x4f5fbe(++_0x3c456b);}(_0xea04,0x1d1));var _0x4ea0=function(_0x15b380,_0x1a3c5f){_0x15b380=_0x15b380-0x0;var _0x232c5c=_0xea04[_0x15b380];return _0x232c5c;};'use strict';var _=require(_0x4ea0('0x0'));var util=require(_0x4ea0('0x1'));var moment=require(_0x4ea0('0x2'));var BPromise=require(_0x4ea0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ea0('0x4'));var db=require(_0x4ea0('0x5'))['db'];var utils=require(_0x4ea0('0x6'));var logger=require(_0x4ea0('0x7'))(_0x4ea0('0x8'));var config=require('../../config/environment');var jayson=require(_0x4ea0('0x9'));var client=jayson[_0x4ea0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14f43a,_0x544d46,_0x61a49){return new BPromise(function(_0x524fff,_0x9462a0){return client[_0x4ea0('0xb')](_0x14f43a,_0x61a49)['then'](function(_0x3650d4){logger[_0x4ea0('0xc')](_0x4ea0('0xd'),_0x544d46,'request\x20sent');logger[_0x4ea0('0xe')](_0x4ea0('0xf'),_0x544d46,_0x4ea0('0x10'),JSON['stringify'](_0x3650d4));if(_0x3650d4[_0x4ea0('0x11')]){if(_0x3650d4[_0x4ea0('0x11')][_0x4ea0('0x12')]===0x1f4){logger['error'](_0x4ea0('0xd'),_0x544d46,_0x3650d4[_0x4ea0('0x11')][_0x4ea0('0x13')]);return _0x9462a0(_0x3650d4[_0x4ea0('0x11')][_0x4ea0('0x13')]);}logger[_0x4ea0('0x11')]('Integration,\x20%s,\x20%s',_0x544d46,_0x3650d4['error'][_0x4ea0('0x13')]);return _0x524fff(_0x3650d4[_0x4ea0('0x11')][_0x4ea0('0x13')]);}else{logger['info'](_0x4ea0('0xd'),_0x544d46,_0x4ea0('0x10'));_0x524fff(_0x3650d4['result'][_0x4ea0('0x13')]);}})['catch'](function(_0x4f146f){logger[_0x4ea0('0x11')](_0x4ea0('0xd'),_0x544d46,_0x4f146f);_0x9462a0(_0x4f146f);});});} \ No newline at end of file +var _0x864a=['error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xb4bdb3,_0x48dca0){var _0x4c8c02=function(_0xf9850c){while(--_0xf9850c){_0xb4bdb3['push'](_0xb4bdb3['shift']());}};_0x4c8c02(++_0x48dca0);}(_0x864a,0x8a));var _0xa864=function(_0xcf9bc5,_0x29bdce){_0xcf9bc5=_0xcf9bc5-0x0;var _0x2ba7a5=_0x864a[_0xcf9bc5];return _0x2ba7a5;};'use strict';var _=require(_0xa864('0x0'));var util=require(_0xa864('0x1'));var moment=require(_0xa864('0x2'));var BPromise=require(_0xa864('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa864('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa864('0x5'));var jayson=require(_0xa864('0x6'));var client=jayson[_0xa864('0x7')][_0xa864('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x351d6b,_0x58ad17,_0x393d69){return new BPromise(function(_0x26c6d9,_0x4d32a7){return client[_0xa864('0x9')](_0x351d6b,_0x393d69)[_0xa864('0xa')](function(_0x419955){logger[_0xa864('0xb')]('Integration,\x20%s,\x20%s',_0x58ad17,'request\x20sent');logger[_0xa864('0xc')](_0xa864('0xd'),_0x58ad17,_0xa864('0xe'),JSON[_0xa864('0xf')](_0x419955));if(_0x419955[_0xa864('0x10')]){if(_0x419955[_0xa864('0x10')][_0xa864('0x11')]===0x1f4){logger[_0xa864('0x10')](_0xa864('0x12'),_0x58ad17,_0x419955[_0xa864('0x10')]['message']);return _0x4d32a7(_0x419955[_0xa864('0x10')][_0xa864('0x13')]);}logger['error'](_0xa864('0x12'),_0x58ad17,_0x419955[_0xa864('0x10')][_0xa864('0x13')]);return _0x26c6d9(_0x419955[_0xa864('0x10')][_0xa864('0x13')]);}else{logger[_0xa864('0xb')]('Integration,\x20%s,\x20%s',_0x58ad17,_0xa864('0xe'));_0x26c6d9(_0x419955[_0xa864('0x14')][_0xa864('0x13')]);}})[_0xa864('0x15')](function(_0x24a897){logger[_0xa864('0x10')](_0xa864('0x12'),_0x58ad17,_0x24a897);_0x4d32a7(_0x24a897);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 2cb2103..27258a6 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 _0xd681=['index','/describe','describe','/:id','post','create','update','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated'];(function(_0x447857,_0x1a064f){var _0x475f96=function(_0x1c5bbd){while(--_0x1c5bbd){_0x447857['push'](_0x447857['shift']());}};_0x475f96(++_0x1a064f);}(_0xd681,0x13b));var _0x1d68=function(_0x375e06,_0x44ccd9){_0x375e06=_0x375e06-0x0;var _0x2d445a=_0xd681[_0x375e06];return _0x2d445a;};'use strict';var multer=require('multer');var util=require(_0x1d68('0x0'));var path=require('path');var timeout=require(_0x1d68('0x1'));var express=require('express');var router=express[_0x1d68('0x2')]();var auth=require(_0x1d68('0x3'));var interaction=require(_0x1d68('0x4'));var config=require(_0x1d68('0x5'));var controller=require(_0x1d68('0x6'));router[_0x1d68('0x7')]('/',auth[_0x1d68('0x8')](),controller[_0x1d68('0x9')]);router[_0x1d68('0x7')](_0x1d68('0xa'),auth[_0x1d68('0x8')](),controller[_0x1d68('0xb')]);router[_0x1d68('0x7')](_0x1d68('0xc'),auth[_0x1d68('0x8')](),controller['show']);router[_0x1d68('0xd')]('/',auth[_0x1d68('0x8')](),controller[_0x1d68('0xe')]);router['put'](_0x1d68('0xc'),auth['isAuthenticated'](),controller[_0x1d68('0xf')]);router[_0x1d68('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1d68('0x11')]=router; \ No newline at end of file +var _0xd76f=['/describe','describe','show','post','create','put','/:id','destroy','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x399bfc,_0x36d4b0){var _0x36846d=function(_0x1465bc){while(--_0x1465bc){_0x399bfc['push'](_0x399bfc['shift']());}};_0x36846d(++_0x36d4b0);}(_0xd76f,0x198));var _0xfd76=function(_0x33fcbb,_0x291d0f){_0x33fcbb=_0x33fcbb-0x0;var _0x2efe40=_0xd76f[_0x33fcbb];return _0x2efe40;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfd76('0x0'));var express=require(_0xfd76('0x1'));var router=express[_0xfd76('0x2')]();var auth=require(_0xfd76('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfd76('0x4'));var controller=require('./integrationReport.controller');router[_0xfd76('0x5')]('/',auth[_0xfd76('0x6')](),controller[_0xfd76('0x7')]);router[_0xfd76('0x5')](_0xfd76('0x8'),auth[_0xfd76('0x6')](),controller[_0xfd76('0x9')]);router['get']('/:id',auth[_0xfd76('0x6')](),controller[_0xfd76('0xa')]);router[_0xfd76('0xb')]('/',auth[_0xfd76('0x6')](),controller[_0xfd76('0xc')]);router[_0xfd76('0xd')](_0xfd76('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfd76('0xe'),auth[_0xfd76('0x6')](),controller[_0xfd76('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 5181d6f..5f6fde9 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 _0xa76f=['STRING','INTEGER','BOOLEAN','DATE','TEXT','SENT','SENDING','FAILED','sequelize','exports'];(function(_0x341f9b,_0x41fdd1){var _0x4d8333=function(_0x31c858){while(--_0x31c858){_0x341f9b['push'](_0x341f9b['shift']());}};_0x4d8333(++_0x41fdd1);}(_0xa76f,0x9e));var _0xfa76=function(_0x43db0f,_0x210b93){_0x43db0f=_0x43db0f-0x0;var _0x1714d3=_0xa76f[_0x43db0f];return _0x1714d3;};'use strict';var Sequelize=require(_0xfa76('0x0'));module[_0xfa76('0x1')]={'integration':{'type':Sequelize[_0xfa76('0x2')]},'eventChannel':{'type':Sequelize[_0xfa76('0x2')]},'exitStatus':{'type':Sequelize[_0xfa76('0x2')]},'ticketId':{'type':Sequelize[_0xfa76('0x2')]},'integrationId':{'type':Sequelize[_0xfa76('0x3')]},'contacts':{'type':Sequelize[_0xfa76('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xfa76('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfa76('0x2')]},'interface':{'type':Sequelize[_0xfa76('0x2')]},'membername':{'type':Sequelize[_0xfa76('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xfa76('0x3')]},'agentcomplete':{'type':Sequelize[_0xfa76('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xfa76('0x5')]},'talktime':{'type':Sequelize[_0xfa76('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xfa76('0x3')]},'reason':{'type':Sequelize[_0xfa76('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xfa76('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xfa76('0x2')]},'channel':{'type':Sequelize[_0xfa76('0x2')]},'channelstate':{'type':Sequelize[_0xfa76('0x3')]},'channelstatedesc':{'type':Sequelize[_0xfa76('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfa76('0x2')]},'connectedlinename':{'type':Sequelize[_0xfa76('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xfa76('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xfa76('0x2')]},'priority':{'type':Sequelize[_0xfa76('0x2')]},'destchannel':{'type':Sequelize[_0xfa76('0x2')]},'destchannelstate':{'type':Sequelize[_0xfa76('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xfa76('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xfa76('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xfa76('0x2')]},'destlanguage':{'type':Sequelize[_0xfa76('0x2')]},'destaccountcode':{'type':Sequelize[_0xfa76('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xfa76('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xfa76('0x2')]},'subject':{'type':Sequelize[_0xfa76('0x2')]},'from':{'type':Sequelize[_0xfa76('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xfa76('0x6')]},'status':{'type':Sequelize['ENUM'](_0xfa76('0x7'),_0xfa76('0x8'),'RECEIVED',_0xfa76('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xfa76('0x2')]},'appdata':{'type':Sequelize[_0xfa76('0x2')]},'projectId':{'type':Sequelize[_0xfa76('0x3')]}}; \ No newline at end of file +var _0xd494=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED'];(function(_0x5695da,_0x4399fc){var _0xdca67c=function(_0x143ae3){while(--_0x143ae3){_0x5695da['push'](_0x5695da['shift']());}};_0xdca67c(++_0x4399fc);}(_0xd494,0x1ae));var _0x4d49=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd494[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x4d49('0x0'));module[_0x4d49('0x1')]={'integration':{'type':Sequelize[_0x4d49('0x2')]},'eventChannel':{'type':Sequelize[_0x4d49('0x2')]},'exitStatus':{'type':Sequelize[_0x4d49('0x2')]},'ticketId':{'type':Sequelize[_0x4d49('0x2')]},'integrationId':{'type':Sequelize[_0x4d49('0x3')]},'contacts':{'type':Sequelize[_0x4d49('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4d49('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4d49('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x4d49('0x4')]},'holdtime':{'type':Sequelize[_0x4d49('0x3')]},'agentcomplete':{'type':Sequelize[_0x4d49('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4d49('0x4')]},'talktime':{'type':Sequelize[_0x4d49('0x3')]},'agentacw':{'type':Sequelize[_0x4d49('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x4d49('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x4d49('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4d49('0x4')]},'lastevent':{'type':Sequelize[_0x4d49('0x2')]},'channel':{'type':Sequelize[_0x4d49('0x2')]},'channelstate':{'type':Sequelize[_0x4d49('0x3')]},'channelstatedesc':{'type':Sequelize[_0x4d49('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4d49('0x2')]},'connectedlinename':{'type':Sequelize[_0x4d49('0x2')]},'language':{'type':Sequelize[_0x4d49('0x2')]},'accountcode':{'type':Sequelize[_0x4d49('0x2')]},'context':{'type':Sequelize[_0x4d49('0x2')]},'exten':{'type':Sequelize[_0x4d49('0x2')]},'priority':{'type':Sequelize[_0x4d49('0x2')]},'destchannel':{'type':Sequelize[_0x4d49('0x2')]},'destchannelstate':{'type':Sequelize[_0x4d49('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x4d49('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4d49('0x2')]},'destcalleridname':{'type':Sequelize[_0x4d49('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x4d49('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4d49('0x2')]},'destlanguage':{'type':Sequelize[_0x4d49('0x2')]},'destaccountcode':{'type':Sequelize[_0x4d49('0x2')]},'destcontext':{'type':Sequelize[_0x4d49('0x2')]},'destexten':{'type':Sequelize[_0x4d49('0x2')]},'destpriority':{'type':Sequelize[_0x4d49('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x4d49('0x2')]},'inReplyTo':{'type':Sequelize[_0x4d49('0x2')]},'subject':{'type':Sequelize[_0x4d49('0x2')]},'from':{'type':Sequelize[_0x4d49('0x2')]},'to':{'type':Sequelize[_0x4d49('0x2')]},'cc':{'type':Sequelize[_0x4d49('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x4d49('0x6')]},'text':{'type':Sequelize[_0x4d49('0x6')]},'status':{'type':Sequelize['ENUM'](_0x4d49('0x7'),_0x4d49('0x8'),_0x4d49('0x9'),_0x4d49('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x4d49('0x2')]},'appdata':{'type':Sequelize[_0x4d49('0x2')]},'projectId':{'type':Sequelize[_0x4d49('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c668d52..0fb28d4 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 _0xaa64=['query','filters','intersection','attributes','model','fields','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','show','keys','rawAttributes','length','options','find','create','catch','body','params','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','IntegrationReport','fieldName','type','key'];(function(_0x4fbb66,_0x5d06b1){var _0xf7d3fe=function(_0x56ae6d){while(--_0x56ae6d){_0x4fbb66['push'](_0x4fbb66['shift']());}};_0xf7d3fe(++_0x5d06b1);}(_0xaa64,0xf7));var _0x4aa6=function(_0x9c6ac9,_0x3d5d4c){_0x9c6ac9=_0x9c6ac9-0x0;var _0x1cba69=_0xaa64[_0x9c6ac9];return _0x1cba69;};'use strict';var pdf=require(_0x4aa6('0x0'));var emlformat=require(_0x4aa6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4aa6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4aa6('0x3'));var moment=require(_0x4aa6('0x4'));var BPromise=require(_0x4aa6('0x5'));var Mustache=require('mustache');var util=require(_0x4aa6('0x6'));var path=require(_0x4aa6('0x7'));var sox=require(_0x4aa6('0x8'));var csv=require(_0x4aa6('0x9'));var ejs=require(_0x4aa6('0xa'));var fs=require('fs');var _=require(_0x4aa6('0xb'));var squel=require(_0x4aa6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4aa6('0xd'));var toCsv=require(_0x4aa6('0x9'));var querystring=require('querystring');var Papa=require(_0x4aa6('0xe'));var Redis=require('ioredis');var authService=require(_0x4aa6('0xf'));var qs=require(_0x4aa6('0x10'));var as=require(_0x4aa6('0x11'));var hardwareService=require(_0x4aa6('0x12'));var logger=require('../../config/logger')(_0x4aa6('0x13'));var utils=require(_0x4aa6('0x14'));var config=require(_0x4aa6('0x15'));var db=require(_0x4aa6('0x16'))['db'];function respondWithStatusCode(_0x754a04,_0xa8dd06){_0xa8dd06=_0xa8dd06||0xcc;return function(_0x32401e){if(_0x32401e){return _0x754a04[_0x4aa6('0x17')](_0xa8dd06);}return _0x754a04[_0x4aa6('0x18')](_0xa8dd06)[_0x4aa6('0x19')]();};}function respondWithResult(_0x505401,_0x413222){_0x413222=_0x413222||0xc8;return function(_0x5b0133){if(_0x5b0133){return _0x505401['status'](_0x413222)[_0x4aa6('0x1a')](_0x5b0133);}};}function respondWithFilteredResult(_0x17a0e6,_0x326953){return function(_0x11e4d7){if(_0x11e4d7){var _0x375c09=_0x11e4d7['count'],_0x238f10=_0x326953[_0x4aa6('0x1b')],_0x3e234f=_0x326953['offset']+_0x326953[_0x4aa6('0x1c')],_0x2c5c66;if(_0x3e234f>=_0x375c09){_0x3e234f=_0x375c09;_0x2c5c66=0xc8;}else{_0x2c5c66=0xce;}_0x17a0e6['status'](_0x2c5c66);return _0x17a0e6['set'](_0x4aa6('0x1d'),_0x238f10+'-'+_0x3e234f+'/'+_0x375c09)[_0x4aa6('0x1a')](_0x11e4d7);}return null;};}function patchUpdates(_0x2458fd){return function(_0x127bbd){try{jsonpatch[_0x4aa6('0x1e')](_0x127bbd,_0x2458fd,!![]);}catch(_0x1dfd4e){return BPromise[_0x4aa6('0x1f')](_0x1dfd4e);}return _0x127bbd[_0x4aa6('0x20')]();};}function saveUpdates(_0x15365e,_0x4c9159){return function(_0x313e73){if(_0x313e73){return _0x313e73[_0x4aa6('0x21')](_0x15365e)[_0x4aa6('0x22')](function(_0x2253d3){return _0x2253d3;});}return null;};}function removeEntity(_0x1ab155,_0x1e121f){return function(_0x594665){if(_0x594665){return _0x594665[_0x4aa6('0x23')]()[_0x4aa6('0x22')](function(){_0x1ab155[_0x4aa6('0x18')](0xcc)[_0x4aa6('0x19')]();});}};}function handleEntityNotFound(_0xa18442,_0x44d151){return function(_0x568a5c){if(!_0x568a5c){_0xa18442[_0x4aa6('0x17')](0x194);}return _0x568a5c;};}function handleError(_0x91373f,_0x47b285){_0x47b285=_0x47b285||0x1f4;return function(_0x5947c4){logger[_0x4aa6('0x24')](_0x5947c4[_0x4aa6('0x25')]);if(_0x5947c4[_0x4aa6('0x26')]){delete _0x5947c4[_0x4aa6('0x26')];}_0x91373f[_0x4aa6('0x18')](_0x47b285)['send'](_0x5947c4);};}exports[_0x4aa6('0x27')]=function(_0x185fdf,_0x343bd0){var _0x3bd7a8={},_0x45a9e3={},_0x256342={'count':0x0,'rows':[]};var _0x57a3cc=_[_0x4aa6('0x28')](db[_0x4aa6('0x29')]['rawAttributes'],function(_0x149c9a){return{'name':_0x149c9a[_0x4aa6('0x2a')],'type':_0x149c9a[_0x4aa6('0x2b')][_0x4aa6('0x2c')]};});_0x45a9e3['model']=_[_0x4aa6('0x28')](_0x57a3cc,_0x4aa6('0x26'));_0x45a9e3[_0x4aa6('0x2d')]=_['keys'](_0x185fdf[_0x4aa6('0x2d')]);_0x45a9e3[_0x4aa6('0x2e')]=_[_0x4aa6('0x2f')](_0x45a9e3['model'],_0x45a9e3[_0x4aa6('0x2d')]);_0x3bd7a8[_0x4aa6('0x30')]=_['intersection'](_0x45a9e3[_0x4aa6('0x31')],qs[_0x4aa6('0x32')](_0x185fdf[_0x4aa6('0x2d')][_0x4aa6('0x32')]));_0x3bd7a8[_0x4aa6('0x30')]=_0x3bd7a8['attributes']['length']?_0x3bd7a8[_0x4aa6('0x30')]:_0x45a9e3[_0x4aa6('0x31')];if(!_0x185fdf[_0x4aa6('0x2d')]['hasOwnProperty']('nolimit')){_0x3bd7a8[_0x4aa6('0x1c')]=qs[_0x4aa6('0x1c')](_0x185fdf[_0x4aa6('0x2d')][_0x4aa6('0x1c')]);_0x3bd7a8[_0x4aa6('0x1b')]=qs[_0x4aa6('0x1b')](_0x185fdf[_0x4aa6('0x2d')][_0x4aa6('0x1b')]);}_0x3bd7a8['order']=qs[_0x4aa6('0x33')](_0x185fdf[_0x4aa6('0x2d')][_0x4aa6('0x33')]);_0x3bd7a8[_0x4aa6('0x34')]=qs[_0x4aa6('0x2e')](_[_0x4aa6('0x35')](_0x185fdf['query'],_0x45a9e3[_0x4aa6('0x2e')]));if(_0x185fdf[_0x4aa6('0x2d')]['filter']){_0x3bd7a8[_0x4aa6('0x34')]=_[_0x4aa6('0x36')](_0x3bd7a8[_0x4aa6('0x34')],{'$or':_[_0x4aa6('0x28')](_0x57a3cc,function(_0x49d445){if(_0x49d445['type']!==_0x4aa6('0x37')){var _0x2ad1bd={};_0x2ad1bd[_0x49d445[_0x4aa6('0x26')]]={'$like':'%'+_0x185fdf['query'][_0x4aa6('0x38')]+'%'};return _0x2ad1bd;}})});}_0x3bd7a8=_[_0x4aa6('0x36')]({},_0x3bd7a8,_0x185fdf['options']);var _0x300ced={'where':_0x3bd7a8[_0x4aa6('0x34')]};return db[_0x4aa6('0x29')][_0x4aa6('0x39')](_0x300ced)[_0x4aa6('0x22')](function(_0xbfa31c){_0x256342['count']=_0xbfa31c;if(_0x185fdf['query'][_0x4aa6('0x3a')]){_0x3bd7a8[_0x4aa6('0x3b')]=[{'all':!![]}];}return db[_0x4aa6('0x29')][_0x4aa6('0x3c')](_0x3bd7a8);})[_0x4aa6('0x22')](function(_0x592280){_0x256342[_0x4aa6('0x3d')]=_0x592280;return _0x256342;})[_0x4aa6('0x22')](respondWithFilteredResult(_0x343bd0,_0x3bd7a8))['catch'](handleError(_0x343bd0,null));};exports[_0x4aa6('0x3e')]=function(_0x366a8a,_0x269146){var _0x47787d={'raw':![],'where':{'id':_0x366a8a['params']['id']}},_0x20fa01={};_0x20fa01[_0x4aa6('0x31')]=_[_0x4aa6('0x3f')](db['IntegrationReport'][_0x4aa6('0x40')]);_0x20fa01[_0x4aa6('0x2d')]=_['keys'](_0x366a8a[_0x4aa6('0x2d')]);_0x20fa01[_0x4aa6('0x2e')]=_['intersection'](_0x20fa01[_0x4aa6('0x31')],_0x20fa01[_0x4aa6('0x2d')]);_0x47787d[_0x4aa6('0x30')]=_[_0x4aa6('0x2f')](_0x20fa01[_0x4aa6('0x31')],qs[_0x4aa6('0x32')](_0x366a8a[_0x4aa6('0x2d')]['fields']));_0x47787d[_0x4aa6('0x30')]=_0x47787d[_0x4aa6('0x30')][_0x4aa6('0x41')]?_0x47787d[_0x4aa6('0x30')]:_0x20fa01[_0x4aa6('0x31')];if(_0x366a8a[_0x4aa6('0x2d')][_0x4aa6('0x3a')]){_0x47787d[_0x4aa6('0x3b')]=[{'all':!![]}];}_0x47787d=_['merge']({},_0x47787d,_0x366a8a[_0x4aa6('0x42')]);return db['IntegrationReport'][_0x4aa6('0x43')](_0x47787d)[_0x4aa6('0x22')](handleEntityNotFound(_0x269146,null))[_0x4aa6('0x22')](respondWithResult(_0x269146,null))['catch'](handleError(_0x269146,null));};exports[_0x4aa6('0x44')]=function(_0x4a1387,_0x5c855c){return db[_0x4aa6('0x29')][_0x4aa6('0x44')](_0x4a1387['body'],{})[_0x4aa6('0x22')](respondWithResult(_0x5c855c,0xc9))[_0x4aa6('0x45')](handleError(_0x5c855c,null));};exports['update']=function(_0x10affb,_0x4a09db){if(_0x10affb['body']['id']){delete _0x10affb[_0x4aa6('0x46')]['id'];}return db['IntegrationReport'][_0x4aa6('0x43')]({'where':{'id':_0x10affb[_0x4aa6('0x47')]['id']}})[_0x4aa6('0x22')](handleEntityNotFound(_0x4a09db,null))[_0x4aa6('0x22')](saveUpdates(_0x10affb[_0x4aa6('0x46')],null))[_0x4aa6('0x22')](respondWithResult(_0x4a09db,null))[_0x4aa6('0x45')](handleError(_0x4a09db,null));};exports['destroy']=function(_0x56cfc5,_0x3282f1){return db[_0x4aa6('0x29')][_0x4aa6('0x43')]({'where':{'id':_0x56cfc5['params']['id']}})[_0x4aa6('0x22')](handleEntityNotFound(_0x3282f1,null))[_0x4aa6('0x22')](removeEntity(_0x3282f1,null))[_0x4aa6('0x45')](handleError(_0x3282f1,null));};exports[_0x4aa6('0x48')]=function(_0x481dc8,_0x5f135f){return db[_0x4aa6('0x29')][_0x4aa6('0x48')]()[_0x4aa6('0x22')](respondWithResult(_0x5f135f,null))[_0x4aa6('0x45')](handleError(_0x5f135f,null));}; \ No newline at end of file +var _0x0447=['mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','count','offset','limit','set','json','save','update','destroy','then','end','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','include','findAll','rows','catch','show','includeAll','create','body','params','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x554574,_0x30e7b0){var _0x100382=function(_0x146a59){while(--_0x146a59){_0x554574['push'](_0x554574['shift']());}};_0x100382(++_0x30e7b0);}(_0x0447,0x8b));var _0x7044=function(_0x5af9b3,_0x516c90){_0x5af9b3=_0x5af9b3-0x0;var _0x129f28=_0x0447[_0x5af9b3];return _0x129f28;};'use strict';var pdf=require(_0x7044('0x0'));var emlformat=require(_0x7044('0x1'));var rimraf=require(_0x7044('0x2'));var zipdir=require(_0x7044('0x3'));var jsonpatch=require(_0x7044('0x4'));var rp=require('request-promise');var moment=require(_0x7044('0x5'));var BPromise=require(_0x7044('0x6'));var Mustache=require(_0x7044('0x7'));var util=require(_0x7044('0x8'));var path=require(_0x7044('0x9'));var sox=require(_0x7044('0xa'));var csv=require(_0x7044('0xb'));var ejs=require(_0x7044('0xc'));var fs=require('fs');var _=require(_0x7044('0xd'));var squel=require('squel');var crypto=require(_0x7044('0xe'));var jsforce=require(_0x7044('0xf'));var deskjs=require(_0x7044('0x10'));var toCsv=require(_0x7044('0xb'));var querystring=require('querystring');var Papa=require(_0x7044('0x11'));var Redis=require(_0x7044('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7044('0x13'));var as=require(_0x7044('0x14'));var hardwareService=require(_0x7044('0x15'));var logger=require(_0x7044('0x16'))('api');var utils=require(_0x7044('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53f150,_0xe26cea){_0xe26cea=_0xe26cea||0xcc;return function(_0x41b118){if(_0x41b118){return _0x53f150[_0x7044('0x18')](_0xe26cea);}return _0x53f150[_0x7044('0x19')](_0xe26cea)['end']();};}function respondWithResult(_0x5805f2,_0xd5ae12){_0xd5ae12=_0xd5ae12||0xc8;return function(_0x3316c4){if(_0x3316c4){return _0x5805f2['status'](_0xd5ae12)['json'](_0x3316c4);}};}function respondWithFilteredResult(_0x798fe3,_0x310535){return function(_0x79f418){if(_0x79f418){var _0x35769e=_0x79f418[_0x7044('0x1a')],_0x2fecb1=_0x310535[_0x7044('0x1b')],_0x5cbec7=_0x310535[_0x7044('0x1b')]+_0x310535[_0x7044('0x1c')],_0x5c85fc;if(_0x5cbec7>=_0x35769e){_0x5cbec7=_0x35769e;_0x5c85fc=0xc8;}else{_0x5c85fc=0xce;}_0x798fe3[_0x7044('0x19')](_0x5c85fc);return _0x798fe3[_0x7044('0x1d')]('Content-Range',_0x2fecb1+'-'+_0x5cbec7+'/'+_0x35769e)[_0x7044('0x1e')](_0x79f418);}return null;};}function patchUpdates(_0x227bcd){return function(_0x1eeb45){try{jsonpatch['apply'](_0x1eeb45,_0x227bcd,!![]);}catch(_0x4bbdb3){return BPromise['reject'](_0x4bbdb3);}return _0x1eeb45[_0x7044('0x1f')]();};}function saveUpdates(_0x3292f8,_0x2c5dcb){return function(_0x4104a9){if(_0x4104a9){return _0x4104a9[_0x7044('0x20')](_0x3292f8)['then'](function(_0x308603){return _0x308603;});}return null;};}function removeEntity(_0x51a83f,_0x4af476){return function(_0x3db88b){if(_0x3db88b){return _0x3db88b[_0x7044('0x21')]()[_0x7044('0x22')](function(){_0x51a83f[_0x7044('0x19')](0xcc)[_0x7044('0x23')]();});}};}function handleEntityNotFound(_0x105da8,_0x41a079){return function(_0x9452a1){if(!_0x9452a1){_0x105da8[_0x7044('0x18')](0x194);}return _0x9452a1;};}function handleError(_0x5e2c9a,_0x5d7d8a){_0x5d7d8a=_0x5d7d8a||0x1f4;return function(_0x45f274){logger[_0x7044('0x24')](_0x45f274[_0x7044('0x25')]);if(_0x45f274[_0x7044('0x26')]){delete _0x45f274[_0x7044('0x26')];}_0x5e2c9a[_0x7044('0x19')](_0x5d7d8a)[_0x7044('0x27')](_0x45f274);};}exports[_0x7044('0x28')]=function(_0x124671,_0x2826bf){var _0x1eb4b0={},_0x115d5c={},_0x4c618d={'count':0x0,'rows':[]};var _0x377cd1=_[_0x7044('0x29')](db[_0x7044('0x2a')][_0x7044('0x2b')],function(_0x4b7de2){return{'name':_0x4b7de2[_0x7044('0x2c')],'type':_0x4b7de2['type']['key']};});_0x115d5c['model']=_[_0x7044('0x29')](_0x377cd1,'name');_0x115d5c[_0x7044('0x2d')]=_[_0x7044('0x2e')](_0x124671['query']);_0x115d5c['filters']=_[_0x7044('0x2f')](_0x115d5c['model'],_0x115d5c['query']);_0x1eb4b0['attributes']=_[_0x7044('0x2f')](_0x115d5c[_0x7044('0x30')],qs['fields'](_0x124671[_0x7044('0x2d')][_0x7044('0x31')]));_0x1eb4b0[_0x7044('0x32')]=_0x1eb4b0[_0x7044('0x32')][_0x7044('0x33')]?_0x1eb4b0['attributes']:_0x115d5c[_0x7044('0x30')];if(!_0x124671[_0x7044('0x2d')][_0x7044('0x34')](_0x7044('0x35'))){_0x1eb4b0[_0x7044('0x1c')]=qs['limit'](_0x124671[_0x7044('0x2d')][_0x7044('0x1c')]);_0x1eb4b0['offset']=qs[_0x7044('0x1b')](_0x124671[_0x7044('0x2d')][_0x7044('0x1b')]);}_0x1eb4b0[_0x7044('0x36')]=qs[_0x7044('0x37')](_0x124671[_0x7044('0x2d')]['sort']);_0x1eb4b0['where']=qs[_0x7044('0x38')](_[_0x7044('0x39')](_0x124671['query'],_0x115d5c[_0x7044('0x38')]));if(_0x124671[_0x7044('0x2d')][_0x7044('0x3a')]){_0x1eb4b0[_0x7044('0x3b')]=_[_0x7044('0x3c')](_0x1eb4b0[_0x7044('0x3b')],{'$or':_[_0x7044('0x29')](_0x377cd1,function(_0x2433fe){if(_0x2433fe['type']!=='VIRTUAL'){var _0x3a809b={};_0x3a809b[_0x2433fe[_0x7044('0x26')]]={'$like':'%'+_0x124671[_0x7044('0x2d')][_0x7044('0x3a')]+'%'};return _0x3a809b;}})});}_0x1eb4b0=_[_0x7044('0x3c')]({},_0x1eb4b0,_0x124671[_0x7044('0x3d')]);var _0x478756={'where':_0x1eb4b0['where']};return db[_0x7044('0x2a')][_0x7044('0x1a')](_0x478756)[_0x7044('0x22')](function(_0x524062){_0x4c618d[_0x7044('0x1a')]=_0x524062;if(_0x124671['query']['includeAll']){_0x1eb4b0[_0x7044('0x3e')]=[{'all':!![]}];}return db['IntegrationReport'][_0x7044('0x3f')](_0x1eb4b0);})[_0x7044('0x22')](function(_0x168740){_0x4c618d[_0x7044('0x40')]=_0x168740;return _0x4c618d;})[_0x7044('0x22')](respondWithFilteredResult(_0x2826bf,_0x1eb4b0))[_0x7044('0x41')](handleError(_0x2826bf,null));};exports[_0x7044('0x42')]=function(_0xc3e9f0,_0xdf8391){var _0x1b4f01={'raw':![],'where':{'id':_0xc3e9f0['params']['id']}},_0x485a0e={};_0x485a0e['model']=_[_0x7044('0x2e')](db[_0x7044('0x2a')][_0x7044('0x2b')]);_0x485a0e[_0x7044('0x2d')]=_['keys'](_0xc3e9f0['query']);_0x485a0e['filters']=_[_0x7044('0x2f')](_0x485a0e[_0x7044('0x30')],_0x485a0e[_0x7044('0x2d')]);_0x1b4f01[_0x7044('0x32')]=_[_0x7044('0x2f')](_0x485a0e[_0x7044('0x30')],qs[_0x7044('0x31')](_0xc3e9f0[_0x7044('0x2d')][_0x7044('0x31')]));_0x1b4f01['attributes']=_0x1b4f01['attributes']['length']?_0x1b4f01[_0x7044('0x32')]:_0x485a0e[_0x7044('0x30')];if(_0xc3e9f0[_0x7044('0x2d')][_0x7044('0x43')]){_0x1b4f01[_0x7044('0x3e')]=[{'all':!![]}];}_0x1b4f01=_[_0x7044('0x3c')]({},_0x1b4f01,_0xc3e9f0[_0x7044('0x3d')]);return db['IntegrationReport']['find'](_0x1b4f01)[_0x7044('0x22')](handleEntityNotFound(_0xdf8391,null))[_0x7044('0x22')](respondWithResult(_0xdf8391,null))[_0x7044('0x41')](handleError(_0xdf8391,null));};exports[_0x7044('0x44')]=function(_0x1e8102,_0x436e45){return db['IntegrationReport']['create'](_0x1e8102['body'],{})[_0x7044('0x22')](respondWithResult(_0x436e45,0xc9))[_0x7044('0x41')](handleError(_0x436e45,null));};exports[_0x7044('0x20')]=function(_0x353120,_0x5757aa){if(_0x353120[_0x7044('0x45')]['id']){delete _0x353120[_0x7044('0x45')]['id'];}return db[_0x7044('0x2a')]['find']({'where':{'id':_0x353120[_0x7044('0x46')]['id']}})[_0x7044('0x22')](handleEntityNotFound(_0x5757aa,null))[_0x7044('0x22')](saveUpdates(_0x353120['body'],null))[_0x7044('0x22')](respondWithResult(_0x5757aa,null))[_0x7044('0x41')](handleError(_0x5757aa,null));};exports[_0x7044('0x21')]=function(_0xdee0ae,_0x56036f){return db[_0x7044('0x2a')][_0x7044('0x47')]({'where':{'id':_0xdee0ae['params']['id']}})[_0x7044('0x22')](handleEntityNotFound(_0x56036f,null))[_0x7044('0x22')](removeEntity(_0x56036f,null))[_0x7044('0x41')](handleError(_0x56036f,null));};exports[_0x7044('0x48')]=function(_0x16e649,_0x57378f){return db[_0x7044('0x2a')][_0x7044('0x48')]()['then'](respondWithResult(_0x57378f,null))['catch'](handleError(_0x57378f,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 8603371..a57b999 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 _0xd63f=['rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2a4033,_0x4b3b02){var _0x55b47d=function(_0x14bfe2){while(--_0x14bfe2){_0x2a4033['push'](_0x2a4033['shift']());}};_0x55b47d(++_0x4b3b02);}(_0xd63f,0x1f4));var _0xfd63=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd63f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfd63('0x0'));var util=require(_0xfd63('0x1'));var logger=require(_0xfd63('0x2'))('api');var moment=require(_0xfd63('0x3'));var BPromise=require(_0xfd63('0x4'));var rp=require(_0xfd63('0x5'));var fs=require('fs');var path=require(_0xfd63('0x6'));var rimraf=require(_0xfd63('0x7'));var config=require(_0xfd63('0x8'));var attributes=require('./integrationReport.attributes');module[_0xfd63('0x9')]=function(_0x3d0ccc,_0x17e7ca){return _0x3d0ccc[_0xfd63('0xa')](_0xfd63('0xb'),attributes,{'tableName':_0xfd63('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a96=['define','report_integration','lodash','util','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x3ef4f1,_0x5f0f9b){var _0x69953c=function(_0xb4e621){while(--_0xb4e621){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x69953c(++_0x5f0f9b);}(_0x7a96,0x12b));var _0x67a9=function(_0x56b886,_0x1ff474){_0x56b886=_0x56b886-0x0;var _0x164baf=_0x7a96[_0x56b886];return _0x164baf;};'use strict';var _=require(_0x67a9('0x0'));var util=require(_0x67a9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x67a9('0x2'));var fs=require('fs');var path=require(_0x67a9('0x3'));var rimraf=require(_0x67a9('0x4'));var config=require(_0x67a9('0x5'));var attributes=require(_0x67a9('0x6'));module['exports']=function(_0x3b73b7,_0xc63af){return _0x3b73b7[_0x67a9('0x7')]('IntegrationReport',attributes,{'tableName':_0x67a9('0x8'),'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 1d63d97..3d321f9 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 _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x268fdf,_0x174349){var _0x27986e=function(_0x15e778){while(--_0x15e778){_0x268fdf['push'](_0x268fdf['shift']());}};_0x27986e(++_0x174349);}(_0x14a0,0x8e));var _0x014a=function(_0x281dbb,_0x147d85){_0x281dbb=_0x281dbb-0x0;var _0x3c3690=_0x14a0[_0x281dbb];return _0x3c3690;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file +var _0x8603=['message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8603,0x190));var _0x3860=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0x8603[_0x128450];return _0x4d80ed;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index c51df88..2d0ab87 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 _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(_0x41dada,_0x48ac81){var _0x2dd1b7=function(_0xaa6899){while(--_0xaa6899){_0x41dada['push'](_0x41dada['shift']());}};_0x2dd1b7(++_0x48ac81);}(_0xedd9,0xfc));var _0x9edd=function(_0x2e0197,_0x19b74b){_0x2e0197=_0x2e0197-0x0;var _0x5228a4=_0xedd9[_0x2e0197];return _0x5228a4;};'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 +var _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./interval.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0xe')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller['addInterval']);router[_0x7995('0xe')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('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 447df12..48ed25e 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 _0x7f30=['sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7f30,0x13b));var _0x07f3=function(_0x2b2173,_0x28aeff){_0x2b2173=_0x2b2173-0x0;var _0x52efa7=_0x7f30[_0x2b2173];return _0x52efa7;};'use strict';var Sequelize=require(_0x07f3('0x0'));module[_0x07f3('0x1')]={'name':{'type':Sequelize[_0x07f3('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x73b9=['STRING','sequelize','exports'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0x73b9,0xa6));var _0x973b=function(_0xf48d35,_0x2044f4){_0xf48d35=_0xf48d35-0x0;var _0x23522=_0x73b9[_0xf48d35];return _0x23522;};'use strict';var Sequelize=require(_0x973b('0x0'));module[_0x973b('0x1')]={'name':{'type':Sequelize[_0x973b('0x2')]},'description':{'type':Sequelize[_0x973b('0x2')]},'interval':{'type':Sequelize[_0x973b('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index f57ab31..b616702 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 _0x34e8=['Intervals','find','userProfileId','autoAssociation','update','addInterval','IntervalId','getIntervals','findOne','order','hasOwnProperty','nolimit','addIntervals','sequelize','transaction','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','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','map','Interval','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x3af392,_0xe5e91f){var _0x33be9f=function(_0x3e3a59){while(--_0x3e3a59){_0x3af392['push'](_0x3af392['shift']());}};_0x33be9f(++_0xe5e91f);}(_0x34e8,0x12c));var _0x834e=function(_0x17bda1,_0x5058ab){_0x17bda1=_0x17bda1-0x0;var _0x59519d=_0x34e8[_0x17bda1];return _0x59519d;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1e')](_0x6cd9b9)[_0x834e('0x1f')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1e')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=_0x38a8cd[_0x834e('0x20')],_0x478afe=_0x4a9cdc['offset'],_0x43ac41=_0x4a9cdc[_0x834e('0x21')]+_0x4a9cdc[_0x834e('0x22')],_0x22106e;if(_0x43ac41>=_0x36d443){_0x43ac41=_0x36d443;_0x22106e=0xc8;}else{_0x22106e=0xce;}_0x316205[_0x834e('0x1e')](_0x22106e);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x478afe+'-'+_0x43ac41+'/'+_0x36d443)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x1dd214){return function(_0x595515){try{jsonpatch[_0x834e('0x26')](_0x595515,_0x1dd214,!![]);}catch(_0x1fd2c6){return BPromise[_0x834e('0x27')](_0x1fd2c6);}return _0x595515[_0x834e('0x28')]();};}function saveUpdates(_0x4ab05d,_0x45a630){return function(_0x62f8f1){if(_0x62f8f1){return _0x62f8f1['update'](_0x4ab05d)[_0x834e('0x29')](function(_0x28d687){return _0x28d687;});}return null;};}function removeEntity(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x2a')]()[_0x834e('0x29')](function(){var _0x589dde=_0x4e3f48[_0x834e('0x2b')]({'plain':!![]});var _0x1dc1e0='Intervals';return db[_0x834e('0x2c')][_0x834e('0x2a')]({'where':{'type':_0x1dc1e0,'resourceId':_0x589dde['id']}})[_0x834e('0x29')](function(){return _0x4e3f48;});})['then'](function(){_0x8d406e[_0x834e('0x1e')](0xcc)[_0x834e('0x1f')]();});}};}function handleEntityNotFound(_0x5e1cc5,_0x5bef62){return function(_0x1e713a){if(!_0x1e713a){_0x5e1cc5['sendStatus'](0x194);}return _0x1e713a;};}function handleError(_0x2826ec,_0x3f1b0b){_0x3f1b0b=_0x3f1b0b||0x1f4;return function(_0x3db026){logger[_0x834e('0x2d')](_0x3db026[_0x834e('0x2e')]);if(_0x3db026[_0x834e('0x2f')]){delete _0x3db026['name'];}_0x2826ec['status'](_0x3f1b0b)['send'](_0x3db026);};}exports['index']=function(_0x2c7a8d,_0x567cea){var _0x106d6a={},_0x5dacc1={},_0xb5bc06={'count':0x0,'rows':[]};var _0x11f1ce=_[_0x834e('0x30')](db[_0x834e('0x31')][_0x834e('0x32')],function(_0x390119){return{'name':_0x390119[_0x834e('0x33')],'type':_0x390119[_0x834e('0x34')][_0x834e('0x35')]};});_0x5dacc1['model']=_[_0x834e('0x30')](_0x11f1ce,'name');_0x5dacc1[_0x834e('0x36')]=_[_0x834e('0x37')](_0x2c7a8d[_0x834e('0x36')]);_0x5dacc1[_0x834e('0x38')]=_[_0x834e('0x39')](_0x5dacc1[_0x834e('0x3a')],_0x5dacc1[_0x834e('0x36')]);_0x106d6a[_0x834e('0x3b')]=_[_0x834e('0x39')](_0x5dacc1[_0x834e('0x3a')],qs['fields'](_0x2c7a8d[_0x834e('0x36')][_0x834e('0x3c')]));_0x106d6a[_0x834e('0x3b')]=_0x106d6a[_0x834e('0x3b')]['length']?_0x106d6a[_0x834e('0x3b')]:_0x5dacc1[_0x834e('0x3a')];if(!_0x2c7a8d['query']['hasOwnProperty']('nolimit')){_0x106d6a[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x2c7a8d[_0x834e('0x36')][_0x834e('0x22')]);_0x106d6a[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x2c7a8d['query'][_0x834e('0x21')]);}_0x106d6a['order']=qs[_0x834e('0x3d')](_0x2c7a8d[_0x834e('0x36')]['sort']);_0x106d6a[_0x834e('0x3e')]=qs[_0x834e('0x38')](_['pick'](_0x2c7a8d['query'],_0x5dacc1[_0x834e('0x38')]));if(_0x2c7a8d[_0x834e('0x36')][_0x834e('0x3f')]){_0x106d6a[_0x834e('0x3e')]=_[_0x834e('0x40')](_0x106d6a['where'],{'$or':_[_0x834e('0x30')](_0x11f1ce,function(_0x548d1d){if(_0x548d1d['type']!==_0x834e('0x41')){var _0x4a7f76={};_0x4a7f76[_0x548d1d[_0x834e('0x2f')]]={'$like':'%'+_0x2c7a8d[_0x834e('0x36')][_0x834e('0x3f')]+'%'};return _0x4a7f76;}})});}_0x106d6a=_[_0x834e('0x40')]({},_0x106d6a,_0x2c7a8d[_0x834e('0x42')]);var _0x574ea8={'where':_0x106d6a[_0x834e('0x3e')]};return db[_0x834e('0x31')][_0x834e('0x20')](_0x574ea8)['then'](function(_0x35380e){_0xb5bc06[_0x834e('0x20')]=_0x35380e;if(_0x2c7a8d['query'][_0x834e('0x43')]){_0x106d6a['include']=[{'all':!![]}];}return db[_0x834e('0x31')][_0x834e('0x44')](_0x106d6a);})['then'](function(_0x4a6942){_0xb5bc06[_0x834e('0x45')]=_0x4a6942;return _0xb5bc06;})[_0x834e('0x29')](respondWithFilteredResult(_0x567cea,_0x106d6a))[_0x834e('0x46')](handleError(_0x567cea,null));};exports[_0x834e('0x47')]=function(_0x8ad264,_0x23feea){var _0x195204={'raw':!![],'where':{'id':_0x8ad264[_0x834e('0x48')]['id']}},_0x4a3381={};_0x4a3381['model']=_[_0x834e('0x37')](db['Interval'][_0x834e('0x32')]);_0x4a3381['query']=_[_0x834e('0x37')](_0x8ad264[_0x834e('0x36')]);_0x4a3381['filters']=_[_0x834e('0x39')](_0x4a3381[_0x834e('0x3a')],_0x4a3381[_0x834e('0x36')]);_0x195204[_0x834e('0x3b')]=_[_0x834e('0x39')](_0x4a3381[_0x834e('0x3a')],qs[_0x834e('0x3c')](_0x8ad264[_0x834e('0x36')][_0x834e('0x3c')]));_0x195204[_0x834e('0x3b')]=_0x195204['attributes'][_0x834e('0x49')]?_0x195204[_0x834e('0x3b')]:_0x4a3381['model'];if(_0x8ad264[_0x834e('0x36')][_0x834e('0x43')]){_0x195204[_0x834e('0x4a')]=[{'all':!![]}];}_0x195204=_[_0x834e('0x40')]({},_0x195204,_0x8ad264[_0x834e('0x42')]);return db[_0x834e('0x31')]['find'](_0x195204)['then'](handleEntityNotFound(_0x23feea,null))[_0x834e('0x29')](respondWithResult(_0x23feea,null))[_0x834e('0x46')](handleError(_0x23feea,null));};exports[_0x834e('0x4b')]=function(_0x40ff5a,_0x3da408){return db[_0x834e('0x31')][_0x834e('0x4b')](_0x40ff5a[_0x834e('0x4c')],{})[_0x834e('0x29')](function(_0x390c45){var _0xf02f0d=_0x40ff5a[_0x834e('0x4d')][_0x834e('0x2b')]({'plain':!![]});if(!_0xf02f0d)throw new Error(_0x834e('0x4e'));if(_0xf02f0d[_0x834e('0x4f')]===_0x834e('0x4d')){var _0x3df078=_0x390c45[_0x834e('0x2b')]({'plain':!![]});var _0x420841=_0x834e('0x50');return db['UserProfileSection'][_0x834e('0x51')]({'where':{'name':_0x420841,'userProfileId':_0xf02f0d[_0x834e('0x52')]},'raw':!![]})['then'](function(_0x3c00a3){if(_0x3c00a3&&_0x3c00a3[_0x834e('0x53')]===0x0){return db['UserProfileResource'][_0x834e('0x4b')]({'name':_0x3df078[_0x834e('0x2f')],'resourceId':_0x3df078['id'],'type':_0x3c00a3[_0x834e('0x2f')],'sectionId':_0x3c00a3['id']},{})[_0x834e('0x29')](function(){return _0x390c45;});}else{return _0x390c45;}})[_0x834e('0x46')](function(_0xb77aab){logger[_0x834e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb77aab);throw _0xb77aab;});}return _0x390c45;})[_0x834e('0x29')](respondWithResult(_0x3da408,0xc9))[_0x834e('0x46')](handleError(_0x3da408,null));};exports[_0x834e('0x54')]=function(_0x363675,_0x86ad2b){if(_0x363675[_0x834e('0x4c')]['id']){delete _0x363675[_0x834e('0x4c')]['id'];}return db[_0x834e('0x31')]['find']({'where':{'id':_0x363675[_0x834e('0x48')]['id']}})['then'](handleEntityNotFound(_0x86ad2b,null))[_0x834e('0x29')](saveUpdates(_0x363675['body'],null))[_0x834e('0x29')](respondWithResult(_0x86ad2b,null))['catch'](handleError(_0x86ad2b,null));};exports['destroy']=function(_0x6c0b29,_0x3e1bee){return db['Interval']['find']({'where':{'id':_0x6c0b29[_0x834e('0x48')]['id']}})[_0x834e('0x29')](handleEntityNotFound(_0x3e1bee,null))[_0x834e('0x29')](removeEntity(_0x3e1bee,null))[_0x834e('0x46')](handleError(_0x3e1bee,null));};exports[_0x834e('0x55')]=function(_0x315858,_0x3d3f2b,_0x4273f1){if(_0x315858['body']['id']){delete _0x315858[_0x834e('0x4c')]['id'];}return db[_0x834e('0x31')]['find']({'where':{'id':_0x315858[_0x834e('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d3f2b,null))[_0x834e('0x29')](function(_0x45eceb){if(_0x45eceb){_0x315858['body'][_0x834e('0x56')]=_0x45eceb['id'];return db[_0x834e('0x31')][_0x834e('0x4b')](_0x315858[_0x834e('0x4c')]);}})['then'](respondWithResult(_0x3d3f2b,null))[_0x834e('0x46')](handleError(_0x3d3f2b,null));};exports[_0x834e('0x57')]=function(_0x1dfd5f,_0x5925ef,_0x246b8e){var _0x1fcae9={};var _0x3a7683={};var _0x1a0cd0;var _0x3183c5;return db[_0x834e('0x31')][_0x834e('0x58')]({'where':{'id':_0x1dfd5f[_0x834e('0x48')]['id']}})[_0x834e('0x29')](handleEntityNotFound(_0x5925ef,null))[_0x834e('0x29')](function(_0x1e4310){if(_0x1e4310){_0x1a0cd0=_0x1e4310;_0x3a7683[_0x834e('0x3a')]=_[_0x834e('0x37')](db[_0x834e('0x31')][_0x834e('0x32')]);_0x3a7683[_0x834e('0x36')]=_[_0x834e('0x37')](_0x1dfd5f[_0x834e('0x36')]);_0x3a7683[_0x834e('0x38')]=_[_0x834e('0x39')](_0x3a7683[_0x834e('0x3a')],_0x3a7683[_0x834e('0x36')]);_0x1fcae9['attributes']=_[_0x834e('0x39')](_0x3a7683[_0x834e('0x3a')],qs[_0x834e('0x3c')](_0x1dfd5f[_0x834e('0x36')]['fields']));_0x1fcae9[_0x834e('0x3b')]=_0x1fcae9['attributes']['length']?_0x1fcae9[_0x834e('0x3b')]:_0x3a7683[_0x834e('0x3a')];_0x1fcae9[_0x834e('0x59')]=qs[_0x834e('0x3d')](_0x1dfd5f[_0x834e('0x36')][_0x834e('0x3d')]);_0x1fcae9[_0x834e('0x3e')]=qs[_0x834e('0x38')](_['pick'](_0x1dfd5f[_0x834e('0x36')],_0x3a7683['filters']));if(_0x1dfd5f[_0x834e('0x36')][_0x834e('0x3f')]){_0x1fcae9['where']=_['merge'](_0x1fcae9[_0x834e('0x3e')],{'$or':_[_0x834e('0x30')](_0x1fcae9[_0x834e('0x3b')],function(_0x2cca07){var _0x2c41bd={};_0x2c41bd[_0x2cca07]={'$like':'%'+_0x1dfd5f['query'][_0x834e('0x3f')]+'%'};return _0x2c41bd;})});}_0x1fcae9=_[_0x834e('0x40')]({},_0x1fcae9,_0x1dfd5f[_0x834e('0x42')]);return _0x1a0cd0[_0x834e('0x57')](_0x1fcae9);}})[_0x834e('0x29')](function(_0x28b5c9){if(_0x28b5c9){_0x3183c5=_0x28b5c9[_0x834e('0x49')];if(!_0x1dfd5f[_0x834e('0x36')][_0x834e('0x5a')](_0x834e('0x5b'))){_0x1fcae9['limit']=qs[_0x834e('0x22')](_0x1dfd5f[_0x834e('0x36')][_0x834e('0x22')]);_0x1fcae9[_0x834e('0x21')]=qs['offset'](_0x1dfd5f[_0x834e('0x36')]['offset']);}return _0x1a0cd0['getIntervals'](_0x1fcae9);}})['then'](function(_0x452f7f){if(_0x452f7f){return _0x452f7f?{'count':_0x3183c5,'rows':_0x452f7f}:null;}})[_0x834e('0x29')](respondWithResult(_0x5925ef,null))['catch'](handleError(_0x5925ef,null));};exports[_0x834e('0x5c')]=function(_0x1b200d,_0x4d4477,_0x353246){return db[_0x834e('0x31')]['findOne']({'where':{'id':_0x1b200d['params']['id']}})[_0x834e('0x29')](handleEntityNotFound(_0x4d4477,null))[_0x834e('0x29')](function(_0x8bc7d9){if(_0x8bc7d9){return db[_0x834e('0x5d')][_0x834e('0x5e')](function(_0x493239){return db[_0x834e('0x31')]['destroy']({'where':{'IntervalId':_0x1b200d[_0x834e('0x48')]['id']},'transaction':_0x493239})[_0x834e('0x29')](function(_0x2c758c){var _0x5afb41=_[_0x834e('0x30')](_0x1b200d[_0x834e('0x4c')],function(_0x48521f){delete _0x48521f['id'];_0x48521f[_0x834e('0x56')]=_0x1b200d[_0x834e('0x48')]['id'];return _0x48521f;});return db[_0x834e('0x31')]['bulkCreate'](_0x5afb41,{'transaction':_0x493239});});})[_0x834e('0x29')](function(){return db[_0x834e('0x31')][_0x834e('0x44')]({'where':{'IntervalId':_0x1b200d[_0x834e('0x48')]['id']}});});}})[_0x834e('0x29')](respondWithResult(_0x4d4477,null))[_0x834e('0x46')](handleError(_0x4d4477,null));}; \ No newline at end of file +var _0xedd9=['sequelize','IntervalId','bulkCreate','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','../../components/extensions/rewrite','sendStatus','status','json','offset','limit','set','save','update','then','get','Intervals','destroy','end','name','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','userProfileId','UserProfileResource','error','getIntervals','addIntervals'];(function(_0x11a822,_0x5c1afc){var _0x5efcd9=function(_0x1c9f4b){while(--_0x1c9f4b){_0x11a822['push'](_0x11a822['shift']());}};_0x5efcd9(++_0x5c1afc);}(_0xedd9,0xfc));var _0x9edd=function(_0x342fe5,_0x3e588f){_0x342fe5=_0x342fe5-0x0;var _0x465b42=_0xedd9[_0x342fe5];return _0x465b42;};'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'];var extensions=require(_0x9edd('0x17'));function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=_0x75a4ab['count'],_0x5f5bf4=_0x1042aa[_0x9edd('0x1b')],_0x448996=_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1c')],_0x449cee;if(_0x448996>=_0x4ea60f){_0x448996=_0x4ea60f;_0x449cee=0xc8;}else{_0x449cee=0xce;}_0x338f3c['status'](_0x449cee);return _0x338f3c[_0x9edd('0x1d')]('Content-Range',_0x5f5bf4+'-'+_0x448996+'/'+_0x4ea60f)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x1083e4){return function(_0x4bdb88){try{jsonpatch['apply'](_0x4bdb88,_0x1083e4,!![]);}catch(_0x45c3ab){return BPromise['reject'](_0x45c3ab);}return _0x4bdb88[_0x9edd('0x1e')]();};}function saveUpdates(_0x54a03f,_0x535f37){return function(_0x356751){if(_0x356751){return _0x356751[_0x9edd('0x1f')](_0x54a03f)['then'](function(_0x5823bc){return _0x5823bc;});}return null;};}function removeEntity(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['destroy']()[_0x9edd('0x20')](function(){var _0x1dca43=_0x477878[_0x9edd('0x21')]({'plain':!![]});var _0x2ca65f=_0x9edd('0x22');return db['UserProfileResource'][_0x9edd('0x23')]({'where':{'type':_0x2ca65f,'resourceId':_0x1dca43['id']}})[_0x9edd('0x20')](function(){return _0x477878;});})[_0x9edd('0x20')](function(){_0x341d67[_0x9edd('0x19')](0xcc)[_0x9edd('0x24')]();});}};}function handleEntityNotFound(_0x4d507f,_0x4b3d1b){return function(_0x3276ee){if(!_0x3276ee){_0x4d507f[_0x9edd('0x18')](0x194);}return _0x3276ee;};}function handleError(_0x8d67aa,_0x25e135){_0x25e135=_0x25e135||0x1f4;return function(_0x3c2227){logger['error'](_0x3c2227['stack']);if(_0x3c2227[_0x9edd('0x25')]){delete _0x3c2227[_0x9edd('0x25')];}_0x8d67aa[_0x9edd('0x19')](_0x25e135)['send'](_0x3c2227);};}exports[_0x9edd('0x26')]=function(_0x28cfae,_0x2ae8dd){var _0x41af53={},_0x5eccfb={},_0x2155a1={'count':0x0,'rows':[]};var _0x3fb556=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x42e664){return{'name':_0x42e664[_0x9edd('0x2a')],'type':_0x42e664[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x5eccfb[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x3fb556,_0x9edd('0x25'));_0x5eccfb[_0x9edd('0x2e')]=_[_0x9edd('0x2f')](_0x28cfae[_0x9edd('0x2e')]);_0x5eccfb['filters']=_[_0x9edd('0x30')](_0x5eccfb[_0x9edd('0x2d')],_0x5eccfb[_0x9edd('0x2e')]);_0x41af53['attributes']=_[_0x9edd('0x30')](_0x5eccfb[_0x9edd('0x2d')],qs[_0x9edd('0x31')](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x31')]));_0x41af53[_0x9edd('0x32')]=_0x41af53[_0x9edd('0x32')][_0x9edd('0x33')]?_0x41af53[_0x9edd('0x32')]:_0x5eccfb[_0x9edd('0x2d')];if(!_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x34')](_0x9edd('0x35'))){_0x41af53[_0x9edd('0x1c')]=qs['limit'](_0x28cfae[_0x9edd('0x2e')]['limit']);_0x41af53[_0x9edd('0x1b')]=qs[_0x9edd('0x1b')](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x1b')]);}_0x41af53[_0x9edd('0x36')]=qs['sort'](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x37')]);_0x41af53[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_[_0x9edd('0x3a')](_0x28cfae[_0x9edd('0x2e')],_0x5eccfb[_0x9edd('0x39')]));if(_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x3b')]){_0x41af53[_0x9edd('0x38')]=_['merge'](_0x41af53[_0x9edd('0x38')],{'$or':_['map'](_0x3fb556,function(_0x3ef1d5){if(_0x3ef1d5['type']!==_0x9edd('0x3c')){var _0x2858b5={};_0x2858b5[_0x3ef1d5[_0x9edd('0x25')]]={'$like':'%'+_0x28cfae['query'][_0x9edd('0x3b')]+'%'};return _0x2858b5;}})});}_0x41af53=_[_0x9edd('0x3d')]({},_0x41af53,_0x28cfae[_0x9edd('0x3e')]);var _0x48958a={'where':_0x41af53[_0x9edd('0x38')]};return db['Interval'][_0x9edd('0x3f')](_0x48958a)[_0x9edd('0x20')](function(_0x50be2c){_0x2155a1[_0x9edd('0x3f')]=_0x50be2c;if(_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x40')]){_0x41af53[_0x9edd('0x41')]=[{'all':!![]}];}return db['Interval'][_0x9edd('0x42')](_0x41af53);})['then'](function(_0x2bdb3f){_0x2155a1[_0x9edd('0x43')]=_0x2bdb3f;return _0x2155a1;})['then'](respondWithFilteredResult(_0x2ae8dd,_0x41af53))[_0x9edd('0x44')](handleError(_0x2ae8dd,null));};exports['show']=function(_0x548299,_0x369b69){var _0x9cab86={'raw':!![],'where':{'id':_0x548299[_0x9edd('0x45')]['id']}},_0x1f276b={};_0x1f276b[_0x9edd('0x2d')]=_[_0x9edd('0x2f')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x1f276b[_0x9edd('0x2e')]=_[_0x9edd('0x2f')](_0x548299[_0x9edd('0x2e')]);_0x1f276b[_0x9edd('0x39')]=_[_0x9edd('0x30')](_0x1f276b[_0x9edd('0x2d')],_0x1f276b[_0x9edd('0x2e')]);_0x9cab86['attributes']=_[_0x9edd('0x30')](_0x1f276b[_0x9edd('0x2d')],qs[_0x9edd('0x31')](_0x548299[_0x9edd('0x2e')][_0x9edd('0x31')]));_0x9cab86[_0x9edd('0x32')]=_0x9cab86[_0x9edd('0x32')]['length']?_0x9cab86['attributes']:_0x1f276b['model'];if(_0x548299[_0x9edd('0x2e')]['includeAll']){_0x9cab86[_0x9edd('0x41')]=[{'all':!![]}];}_0x9cab86=_[_0x9edd('0x3d')]({},_0x9cab86,_0x548299[_0x9edd('0x3e')]);return db[_0x9edd('0x28')][_0x9edd('0x46')](_0x9cab86)['then'](handleEntityNotFound(_0x369b69,null))[_0x9edd('0x20')](respondWithResult(_0x369b69,null))[_0x9edd('0x44')](handleError(_0x369b69,null));};exports[_0x9edd('0x47')]=function(_0x4a89ae,_0x3626bc){return db[_0x9edd('0x28')][_0x9edd('0x47')](_0x4a89ae[_0x9edd('0x48')],{})[_0x9edd('0x20')](function(_0x35bdec){var _0x4d4f33=_0x4a89ae[_0x9edd('0x49')][_0x9edd('0x21')]({'plain':!![]});if(!_0x4d4f33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d4f33[_0x9edd('0x4a')]===_0x9edd('0x49')){var _0x4bb324=_0x35bdec[_0x9edd('0x21')]({'plain':!![]});var _0x8134cd=_0x9edd('0x22');return db['UserProfileSection'][_0x9edd('0x46')]({'where':{'name':_0x8134cd,'userProfileId':_0x4d4f33[_0x9edd('0x4b')]},'raw':!![]})[_0x9edd('0x20')](function(_0x28c7bd){if(_0x28c7bd&&_0x28c7bd['autoAssociation']===0x0){return db[_0x9edd('0x4c')][_0x9edd('0x47')]({'name':_0x4bb324[_0x9edd('0x25')],'resourceId':_0x4bb324['id'],'type':_0x28c7bd['name'],'sectionId':_0x28c7bd['id']},{})[_0x9edd('0x20')](function(){return _0x35bdec;});}else{return _0x35bdec;}})[_0x9edd('0x44')](function(_0x57db43){logger[_0x9edd('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57db43);throw _0x57db43;});}return _0x35bdec;})[_0x9edd('0x20')](respondWithResult(_0x3626bc,0xc9))[_0x9edd('0x44')](handleError(_0x3626bc,null));};exports[_0x9edd('0x1f')]=function(_0x3fcdf5,_0x1e3c19){if(_0x3fcdf5[_0x9edd('0x48')]['id']){delete _0x3fcdf5[_0x9edd('0x48')]['id'];}return db[_0x9edd('0x28')][_0x9edd('0x46')]({'where':{'id':_0x3fcdf5[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x1e3c19,null))['then'](saveUpdates(_0x3fcdf5[_0x9edd('0x48')],null))[_0x9edd('0x20')](respondWithResult(_0x1e3c19,null))[_0x9edd('0x44')](handleError(_0x1e3c19,null));};exports['destroy']=function(_0xe96d6a,_0x54a704){return db['Interval']['find']({'where':{'id':_0xe96d6a[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x54a704,null))[_0x9edd('0x20')](removeEntity(_0x54a704,null))[_0x9edd('0x44')](handleError(_0x54a704,null));};exports['addInterval']=function(_0x56b38b,_0x4e3c3e,_0x71820f){if(_0x56b38b[_0x9edd('0x48')]['id']){delete _0x56b38b[_0x9edd('0x48')]['id'];}return db[_0x9edd('0x28')][_0x9edd('0x46')]({'where':{'id':_0x56b38b[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x4e3c3e,null))[_0x9edd('0x20')](function(_0x4eb780){if(_0x4eb780){_0x56b38b[_0x9edd('0x48')]['IntervalId']=_0x4eb780['id'];return db[_0x9edd('0x28')][_0x9edd('0x47')](_0x56b38b['body']);}})[_0x9edd('0x20')](respondWithResult(_0x4e3c3e,null))[_0x9edd('0x44')](handleError(_0x4e3c3e,null));};exports[_0x9edd('0x4e')]=function(_0x5ec9af,_0xc648c4,_0x2e1ce3){var _0x430eb4={};var _0x15ebfa={};var _0x1720b1;var _0x2c3173;return db['Interval']['findOne']({'where':{'id':_0x5ec9af[_0x9edd('0x45')]['id']}})['then'](handleEntityNotFound(_0xc648c4,null))[_0x9edd('0x20')](function(_0x3e9a3e){if(_0x3e9a3e){_0x1720b1=_0x3e9a3e;_0x15ebfa[_0x9edd('0x2d')]=_[_0x9edd('0x2f')](db['Interval'][_0x9edd('0x29')]);_0x15ebfa['query']=_[_0x9edd('0x2f')](_0x5ec9af[_0x9edd('0x2e')]);_0x15ebfa[_0x9edd('0x39')]=_['intersection'](_0x15ebfa[_0x9edd('0x2d')],_0x15ebfa['query']);_0x430eb4[_0x9edd('0x32')]=_[_0x9edd('0x30')](_0x15ebfa['model'],qs[_0x9edd('0x31')](_0x5ec9af['query'][_0x9edd('0x31')]));_0x430eb4[_0x9edd('0x32')]=_0x430eb4[_0x9edd('0x32')]['length']?_0x430eb4[_0x9edd('0x32')]:_0x15ebfa[_0x9edd('0x2d')];_0x430eb4[_0x9edd('0x36')]=qs[_0x9edd('0x37')](_0x5ec9af[_0x9edd('0x2e')]['sort']);_0x430eb4['where']=qs[_0x9edd('0x39')](_[_0x9edd('0x3a')](_0x5ec9af['query'],_0x15ebfa['filters']));if(_0x5ec9af['query'][_0x9edd('0x3b')]){_0x430eb4['where']=_['merge'](_0x430eb4[_0x9edd('0x38')],{'$or':_[_0x9edd('0x27')](_0x430eb4['attributes'],function(_0xb9ebeb){var _0x11e082={};_0x11e082[_0xb9ebeb]={'$like':'%'+_0x5ec9af[_0x9edd('0x2e')]['filter']+'%'};return _0x11e082;})});}_0x430eb4=_[_0x9edd('0x3d')]({},_0x430eb4,_0x5ec9af['options']);return _0x1720b1[_0x9edd('0x4e')](_0x430eb4);}})[_0x9edd('0x20')](function(_0x4c8d06){if(_0x4c8d06){_0x2c3173=_0x4c8d06[_0x9edd('0x33')];if(!_0x5ec9af[_0x9edd('0x2e')]['hasOwnProperty'](_0x9edd('0x35'))){_0x430eb4[_0x9edd('0x1c')]=qs[_0x9edd('0x1c')](_0x5ec9af[_0x9edd('0x2e')]['limit']);_0x430eb4[_0x9edd('0x1b')]=qs['offset'](_0x5ec9af[_0x9edd('0x2e')][_0x9edd('0x1b')]);}return _0x1720b1[_0x9edd('0x4e')](_0x430eb4);}})['then'](function(_0x106a67){if(_0x106a67){return _0x106a67?{'count':_0x2c3173,'rows':_0x106a67}:null;}})[_0x9edd('0x20')](respondWithResult(_0xc648c4,null))[_0x9edd('0x44')](handleError(_0xc648c4,null));};exports[_0x9edd('0x4f')]=function(_0x25626a,_0x14e2e5,_0x3fa4a9){return db['Interval']['findOne']({'where':{'id':_0x25626a[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x14e2e5,null))[_0x9edd('0x20')](function(_0x171403){if(_0x171403){return db[_0x9edd('0x50')]['transaction'](function(_0x2e40c8){return db[_0x9edd('0x28')][_0x9edd('0x23')]({'where':{'IntervalId':_0x25626a['params']['id']},'transaction':_0x2e40c8})[_0x9edd('0x20')](function(_0x29d70d){var _0x4b1c12=_[_0x9edd('0x27')](_0x25626a[_0x9edd('0x48')],function(_0x58c839){delete _0x58c839['id'];_0x58c839[_0x9edd('0x51')]=_0x25626a[_0x9edd('0x45')]['id'];return _0x58c839;});return db['Interval'][_0x9edd('0x52')](_0x4b1c12,{'transaction':_0x2e40c8});});})['then'](function(){return db['Interval'][_0x9edd('0x42')]({'where':{'IntervalId':_0x25626a[_0x9edd('0x45')]['id']}});});}})[_0x9edd('0x20')](respondWithResult(_0x14e2e5,null))['catch'](handleError(_0x14e2e5,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index ea65f69..ca9a198 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 _0x4058=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','Interval','rewrite','lodash','util'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0x4058,0x129));var _0x8405=function(_0x30dbfe,_0x19dd69){_0x30dbfe=_0x30dbfe-0x0;var _0x32eec3=_0x4058[_0x30dbfe];return _0x32eec3;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var logger=require(_0x8405('0x2'))(_0x8405('0x3'));var moment=require(_0x8405('0x4'));var BPromise=require(_0x8405('0x5'));var rp=require(_0x8405('0x6'));var fs=require('fs');var path=require(_0x8405('0x7'));var rimraf=require(_0x8405('0x8'));var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0x8405('0x9')]=function(_0x257d43,_0x3d9bf6){return _0x257d43[_0x8405('0xa')](_0x8405('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x16d810,_0x2b1c0a){extensions[_0x8405('0xc')](_0x257d43,_0x16d810);},'afterBulkCreate':function(_0x53bd7c,_0x30705f,_0x5e132b){_0x5e132b();extensions[_0x8405('0xc')](_0x257d43,_0x53bd7c[0x0]);},'afterUpdate':function(_0xb442,_0x50344e){extensions[_0x8405('0xc')](_0x257d43,_0xb442);},'afterDestroy':function(_0x1e4965,_0x5b94d5){extensions['rewrite'](_0x257d43,_0x1e4965);}}});}; \ No newline at end of file +var _0x10d8=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0x2183e,_0x289c92){var _0x537549=function(_0x1a6b71){while(--_0x1a6b71){_0x2183e['push'](_0x2183e['shift']());}};_0x537549(++_0x289c92);}(_0x10d8,0xee));var _0x810d=function(_0x4263e5,_0x5411d1){_0x4263e5=_0x4263e5-0x0;var _0x172fc1=_0x10d8[_0x4263e5];return _0x172fc1;};'use strict';var _=require(_0x810d('0x0'));var util=require(_0x810d('0x1'));var logger=require(_0x810d('0x2'))('api');var moment=require(_0x810d('0x3'));var BPromise=require(_0x810d('0x4'));var rp=require(_0x810d('0x5'));var fs=require('fs');var path=require(_0x810d('0x6'));var rimraf=require(_0x810d('0x7'));var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require(_0x810d('0x8'));module[_0x810d('0x9')]=function(_0xeebfbe,_0x3a4786){return _0xeebfbe[_0x810d('0xa')](_0x810d('0xb'),attributes,{'tableName':_0x810d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4efe33,_0x48321e){extensions['rewrite'](_0xeebfbe,_0x4efe33);},'afterBulkCreate':function(_0x485919,_0x3c8e0f,_0x354659){_0x354659();extensions[_0x810d('0xd')](_0xeebfbe,_0x485919[0x0]);},'afterUpdate':function(_0x2b8c58,_0x5d8288){extensions[_0x810d('0xd')](_0xeebfbe,_0x2b8c58);},'afterDestroy':function(_0x285213,_0x2cd42a){extensions[_0x810d('0xd')](_0xeebfbe,_0x285213);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index e65d2e9..c6abe2d 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 _0x9397=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetInterval','Interval','options','where','attributes','limit','include','model','map','catch','ShowInterval','find','raw','lodash'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9397,0x1c6));var _0x7939=function(_0x38d475,_0x4a9a01){_0x38d475=_0x38d475-0x0;var _0x541f9a=_0x9397[_0x38d475];return _0x541f9a;};'use strict';var _=require(_0x7939('0x0'));var util=require(_0x7939('0x1'));var moment=require('moment');var BPromise=require(_0x7939('0x2'));var rs=require(_0x7939('0x3'));var fs=require('fs');var Redis=require(_0x7939('0x4'));var db=require(_0x7939('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7939('0x6'))(_0x7939('0x7'));var config=require(_0x7939('0x8'));var jayson=require(_0x7939('0x9'));var client=jayson['client'][_0x7939('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f896d,_0x4d6d75,_0x490e30){return new BPromise(function(_0x16066f,_0x1b0013){return client[_0x7939('0xb')](_0x2f896d,_0x490e30)[_0x7939('0xc')](function(_0x3c26f3){logger[_0x7939('0xd')](_0x7939('0xe'),_0x4d6d75,_0x7939('0xf'));logger[_0x7939('0x10')]('Interval,\x20%s,\x20%s,\x20%s',_0x4d6d75,_0x7939('0xf'),JSON[_0x7939('0x11')](_0x3c26f3));if(_0x3c26f3['error']){if(_0x3c26f3[_0x7939('0x12')][_0x7939('0x13')]===0x1f4){logger['error'](_0x7939('0xe'),_0x4d6d75,_0x3c26f3[_0x7939('0x12')][_0x7939('0x14')]);return _0x1b0013(_0x3c26f3[_0x7939('0x12')][_0x7939('0x14')]);}logger[_0x7939('0x12')](_0x7939('0xe'),_0x4d6d75,_0x3c26f3['error'][_0x7939('0x14')]);return _0x16066f(_0x3c26f3[_0x7939('0x12')][_0x7939('0x14')]);}else{logger[_0x7939('0xd')](_0x7939('0xe'),_0x4d6d75,_0x7939('0xf'));_0x16066f(_0x3c26f3[_0x7939('0x15')]['message']);}})['catch'](function(_0x19bca6){logger['error'](_0x7939('0xe'),_0x4d6d75,_0x19bca6);_0x1b0013(_0x19bca6);});});}exports[_0x7939('0x16')]=function(_0x54bdf4){var _0x4cbd74=this;return new Promise(function(_0xe168a4,_0x5645fd){return db[_0x7939('0x17')]['findAll']({'raw':_0x54bdf4['options']?_0x54bdf4[_0x7939('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x54bdf4['options']?_0x54bdf4[_0x7939('0x18')][_0x7939('0x19')]||null:null,'attributes':_0x54bdf4[_0x7939('0x18')]?_0x54bdf4[_0x7939('0x18')][_0x7939('0x1a')]||null:null,'limit':_0x54bdf4[_0x7939('0x18')]?_0x54bdf4[_0x7939('0x18')][_0x7939('0x1b')]||null:null,'include':_0x54bdf4[_0x7939('0x18')]?_0x54bdf4[_0x7939('0x18')][_0x7939('0x1c')]?_['map'](_0x54bdf4['options'][_0x7939('0x1c')],function(_0x23e9bf){return{'model':db[_0x23e9bf['model']],'as':_0x23e9bf['as'],'attributes':_0x23e9bf[_0x7939('0x1a')],'include':_0x23e9bf[_0x7939('0x1c')]?_['map'](_0x23e9bf[_0x7939('0x1c')],function(_0x225583){return{'model':db[_0x225583[_0x7939('0x1d')]],'as':_0x225583['as'],'attributes':_0x225583[_0x7939('0x1a')],'include':_0x225583[_0x7939('0x1c')]?_[_0x7939('0x1e')](_0x225583[_0x7939('0x1c')],function(_0x480e9a){return{'model':db[_0x480e9a['model']],'as':_0x480e9a['as'],'attributes':_0x480e9a[_0x7939('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7939('0xc')](function(_0x35ca3d){logger[_0x7939('0xd')](_0x7939('0x16'),_0x54bdf4);logger[_0x7939('0x10')]('GetInterval',_0x54bdf4,JSON['stringify'](_0x35ca3d));_0xe168a4(_0x35ca3d);})[_0x7939('0x1f')](function(_0x5ef011){logger[_0x7939('0x12')]('GetInterval',_0x5ef011['message'],_0x54bdf4);_0x5645fd(_0x4cbd74[_0x7939('0x12')](0x1f4,_0x5ef011[_0x7939('0x14')]));});});};exports[_0x7939('0x20')]=function(_0x179ec8){var _0x1faeed=this;return new Promise(function(_0x5019d7,_0x46b28a){return db[_0x7939('0x17')][_0x7939('0x21')]({'raw':_0x179ec8['options']?_0x179ec8['options'][_0x7939('0x22')]===undefined?!![]:![]:!![],'where':_0x179ec8['options']?_0x179ec8[_0x7939('0x18')][_0x7939('0x19')]||null:null,'attributes':_0x179ec8['options']?_0x179ec8[_0x7939('0x18')][_0x7939('0x1a')]||null:null,'include':_0x179ec8[_0x7939('0x18')]?_0x179ec8[_0x7939('0x18')]['include']?_[_0x7939('0x1e')](_0x179ec8[_0x7939('0x18')]['include'],function(_0xf03245){return{'model':db[_0xf03245[_0x7939('0x1d')]],'as':_0xf03245['as'],'attributes':_0xf03245['attributes'],'include':_0xf03245[_0x7939('0x1c')]?_[_0x7939('0x1e')](_0xf03245[_0x7939('0x1c')],function(_0x29149b){return{'model':db[_0x29149b[_0x7939('0x1d')]],'as':_0x29149b['as'],'attributes':_0x29149b[_0x7939('0x1a')],'include':_0x29149b[_0x7939('0x1c')]?_[_0x7939('0x1e')](_0x29149b[_0x7939('0x1c')],function(_0x3ddead){return{'model':db[_0x3ddead[_0x7939('0x1d')]],'as':_0x3ddead['as'],'attributes':_0x3ddead[_0x7939('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7939('0xc')](function(_0x3ea9b3){logger[_0x7939('0xd')]('ShowInterval',_0x179ec8);logger[_0x7939('0x10')]('ShowInterval',_0x179ec8,JSON[_0x7939('0x11')](_0x3ea9b3));_0x5019d7(_0x3ea9b3);})[_0x7939('0x1f')](function(_0x10c812){logger[_0x7939('0x12')](_0x7939('0x20'),_0x10c812[_0x7939('0x14')],_0x179ec8);_0x46b28a(_0x1faeed[_0x7939('0x12')](0x1f4,_0x10c812['message']));});});}; \ No newline at end of file +var _0x0035=['../../config/logger','rpc','jayson/promise','client','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetInterval','Interval','options','where','attributes','limit','map','model','include','ShowInterval','util','moment','../../config/utils'];(function(_0x2a765d,_0x40a0d1){var _0x32f154=function(_0x31053f){while(--_0x31053f){_0x2a765d['push'](_0x2a765d['shift']());}};_0x32f154(++_0x40a0d1);}(_0x0035,0x159));var _0x5003=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0x0035[_0x135904];return _0x1ce7d5;};'use strict';var _=require('lodash');var util=require(_0x5003('0x0'));var moment=require(_0x5003('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5003('0x2'));var logger=require(_0x5003('0x3'))(_0x5003('0x4'));var config=require('../../config/environment');var jayson=require(_0x5003('0x5'));var client=jayson[_0x5003('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3197d8,_0x3f54f7,_0x30f00a){return new BPromise(function(_0xaa3a51,_0x575cb3){return client[_0x5003('0x7')](_0x3197d8,_0x30f00a)[_0x5003('0x8')](function(_0x418087){logger[_0x5003('0x9')](_0x5003('0xa'),_0x3f54f7,_0x5003('0xb'));logger[_0x5003('0xc')](_0x5003('0xd'),_0x3f54f7,'request\x20sent',JSON[_0x5003('0xe')](_0x418087));if(_0x418087[_0x5003('0xf')]){if(_0x418087[_0x5003('0xf')][_0x5003('0x10')]===0x1f4){logger[_0x5003('0xf')](_0x5003('0xa'),_0x3f54f7,_0x418087[_0x5003('0xf')][_0x5003('0x11')]);return _0x575cb3(_0x418087[_0x5003('0xf')][_0x5003('0x11')]);}logger[_0x5003('0xf')]('Interval,\x20%s,\x20%s',_0x3f54f7,_0x418087[_0x5003('0xf')][_0x5003('0x11')]);return _0xaa3a51(_0x418087[_0x5003('0xf')][_0x5003('0x11')]);}else{logger['info'](_0x5003('0xa'),_0x3f54f7,_0x5003('0xb'));_0xaa3a51(_0x418087['result']['message']);}})[_0x5003('0x12')](function(_0x30510a){logger[_0x5003('0xf')](_0x5003('0xa'),_0x3f54f7,_0x30510a);_0x575cb3(_0x30510a);});});}exports[_0x5003('0x13')]=function(_0x2cf6d7){var _0x21ffe3=this;return new Promise(function(_0x48de36,_0x390b60){return db[_0x5003('0x14')]['findAll']({'raw':_0x2cf6d7['options']?_0x2cf6d7['options']['raw']===undefined?!![]:![]:!![],'where':_0x2cf6d7[_0x5003('0x15')]?_0x2cf6d7[_0x5003('0x15')][_0x5003('0x16')]||null:null,'attributes':_0x2cf6d7[_0x5003('0x15')]?_0x2cf6d7['options'][_0x5003('0x17')]||null:null,'limit':_0x2cf6d7[_0x5003('0x15')]?_0x2cf6d7['options'][_0x5003('0x18')]||null:null,'include':_0x2cf6d7[_0x5003('0x15')]?_0x2cf6d7['options']['include']?_[_0x5003('0x19')](_0x2cf6d7[_0x5003('0x15')]['include'],function(_0x5806f6){return{'model':db[_0x5806f6[_0x5003('0x1a')]],'as':_0x5806f6['as'],'attributes':_0x5806f6[_0x5003('0x17')],'include':_0x5806f6[_0x5003('0x1b')]?_[_0x5003('0x19')](_0x5806f6[_0x5003('0x1b')],function(_0x40c39a){return{'model':db[_0x40c39a[_0x5003('0x1a')]],'as':_0x40c39a['as'],'attributes':_0x40c39a[_0x5003('0x17')],'include':_0x40c39a['include']?_['map'](_0x40c39a['include'],function(_0x45389a){return{'model':db[_0x45389a[_0x5003('0x1a')]],'as':_0x45389a['as'],'attributes':_0x45389a[_0x5003('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5003('0x8')](function(_0x41b217){logger[_0x5003('0x9')](_0x5003('0x13'),_0x2cf6d7);logger['debug'](_0x5003('0x13'),_0x2cf6d7,JSON[_0x5003('0xe')](_0x41b217));_0x48de36(_0x41b217);})[_0x5003('0x12')](function(_0x1417fb){logger[_0x5003('0xf')](_0x5003('0x13'),_0x1417fb[_0x5003('0x11')],_0x2cf6d7);_0x390b60(_0x21ffe3[_0x5003('0xf')](0x1f4,_0x1417fb[_0x5003('0x11')]));});});};exports[_0x5003('0x1c')]=function(_0x24c9df){var _0x1b3e5c=this;return new Promise(function(_0x42846f,_0xf3b18e){return db['Interval']['find']({'raw':_0x24c9df[_0x5003('0x15')]?_0x24c9df['options']['raw']===undefined?!![]:![]:!![],'where':_0x24c9df[_0x5003('0x15')]?_0x24c9df[_0x5003('0x15')][_0x5003('0x16')]||null:null,'attributes':_0x24c9df[_0x5003('0x15')]?_0x24c9df['options'][_0x5003('0x17')]||null:null,'include':_0x24c9df[_0x5003('0x15')]?_0x24c9df['options'][_0x5003('0x1b')]?_[_0x5003('0x19')](_0x24c9df[_0x5003('0x15')][_0x5003('0x1b')],function(_0x435073){return{'model':db[_0x435073[_0x5003('0x1a')]],'as':_0x435073['as'],'attributes':_0x435073[_0x5003('0x17')],'include':_0x435073[_0x5003('0x1b')]?_[_0x5003('0x19')](_0x435073[_0x5003('0x1b')],function(_0x163ad6){return{'model':db[_0x163ad6[_0x5003('0x1a')]],'as':_0x163ad6['as'],'attributes':_0x163ad6[_0x5003('0x17')],'include':_0x163ad6[_0x5003('0x1b')]?_['map'](_0x163ad6[_0x5003('0x1b')],function(_0x2ee14c){return{'model':db[_0x2ee14c[_0x5003('0x1a')]],'as':_0x2ee14c['as'],'attributes':_0x2ee14c[_0x5003('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5003('0x8')](function(_0x309aa3){logger[_0x5003('0x9')](_0x5003('0x1c'),_0x24c9df);logger[_0x5003('0xc')](_0x5003('0x1c'),_0x24c9df,JSON['stringify'](_0x309aa3));_0x42846f(_0x309aa3);})['catch'](function(_0x2b0871){logger[_0x5003('0xf')](_0x5003('0x1c'),_0x2b0871[_0x5003('0x11')],_0x24c9df);_0xf3b18e(_0x1b3e5c[_0x5003('0xf')](0x1f4,_0x2b0871[_0x5003('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 058432d..f25de42 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 _0x9fdc=['Router','./jira.controller','post','isAuthenticated','send','exports','express'];(function(_0x4ee386,_0x1a9032){var _0x42450c=function(_0x51d08c){while(--_0x51d08c){_0x4ee386['push'](_0x4ee386['shift']());}};_0x42450c(++_0x1a9032);}(_0x9fdc,0x18e));var _0xc9fd=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0x9fdc[_0x2c2980];return _0x2a20a9;};'use strict';var express=require(_0xc9fd('0x0'));var router=express[_0xc9fd('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xc9fd('0x2'));router[_0xc9fd('0x3')]('/',auth[_0xc9fd('0x4')](),controller[_0xc9fd('0x5')]);module[_0xc9fd('0x6')]=router; \ No newline at end of file +var _0xd3f3=['../../components/auth/service','./jira.controller','post','send','express'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd3f3,0x81));var _0x3d3f=function(_0x30b10a,_0x506695){_0x30b10a=_0x30b10a-0x0;var _0x160fd3=_0xd3f3[_0x30b10a];return _0x160fd3;};'use strict';var express=require(_0x3d3f('0x0'));var router=express['Router']();var auth=require(_0x3d3f('0x1'));var controller=require(_0x3d3f('0x2'));router[_0x3d3f('0x3')]('/',auth['isAuthenticated'](),controller[_0x3d3f('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 306d91b..177c386 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 _0xf55f=['utf8','data','end','status','parse','error','json','api.jira','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','api','3eAmWpBVP0','key','summary','description','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','base64','setEncoding'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xf55f,0x91));var _0xff55=function(_0x39f023,_0x40eb0b){_0x39f023=_0x39f023-0x0;var _0x56e418=_0xf55f[_0x39f023];return _0x56e418;};'use strict';var BPromise=require(_0xff55('0x0'));var https=require(_0xff55('0x1'));var logger=require('../../config/logger')(_0xff55('0x2'));var USERNAME='support';var PASSWORD=_0xff55('0x3');function openIssue(_0x4b87bf,_0x3c39df){var _0x30baf4={'fields':{'project':{'key':_0x4b87bf[_0xff55('0x4')]||'MOTGUI'},'summary':(_0x4b87bf[_0xff55('0x5')]||'Report')+'\x20from\x20'+_0x4b87bf['ip'],'description':_0x4b87bf[_0xff55('0x6')]||JSON[_0xff55('0x7')](_0x4b87bf),'issuetype':{'name':_0x4b87bf[_0xff55('0x8')]||_0xff55('0x9')}}};_0x30baf4[_0xff55('0xa')]['customfield_11500']=_0x4b87bf[_0xff55('0xb')];_0x30baf4[_0xff55('0xa')][_0xff55('0xc')]=_0x4b87bf[_0xff55('0xd')];_0x30baf4['fields'][_0xff55('0xe')]=_0x4b87bf[_0xff55('0xf')];_0x30baf4['fields'][_0xff55('0x10')]=_0x4b87bf[_0xff55('0x11')];_0x30baf4['fields'][_0xff55('0x12')]=_0x4b87bf[_0xff55('0x13')];_0x30baf4[_0xff55('0xa')][_0xff55('0x14')]=_0x4b87bf['ip'];var _0x5a3aeb={'host':_0xff55('0x15'),'port':0x1bb,'path':_0xff55('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xff55('0x17'),'Authorization':_0xff55('0x18')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xff55('0x19'))}};var _0x357ebd=JSON[_0xff55('0x7')](_0x30baf4);var _0x59f2e9=https['request'](_0x5a3aeb,function(_0xb96caf){_0xb96caf[_0xff55('0x1a')](_0xff55('0x1b'));var _0x173d68='';_0xb96caf['on'](_0xff55('0x1c'),function(_0x176d1b){_0x173d68+=_0x176d1b;});_0xb96caf['on'](_0xff55('0x1d'),function(){if(_0x3c39df){return _0x3c39df[_0xff55('0x1e')](_0xb96caf['statusCode'])['json'](JSON[_0xff55('0x1f')](_0x173d68));}});});_0x59f2e9['on'](_0xff55('0x20'),function(_0x300863){if(_0x3c39df){return _0x3c39df[_0xff55('0x1e')](0x1f4)[_0xff55('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xff55('0x22')}]});}});_0x59f2e9['write'](_0x357ebd);_0x59f2e9['end']();}exports[_0xff55('0x23')]=openIssue;exports[_0xff55('0x24')]=function(_0x4edd31,_0x1a1940){_0x4edd31[_0xff55('0x25')]['ip']=_0x4edd31[_0xff55('0x26')][_0xff55('0x27')]||_0x4edd31[_0xff55('0x28')][_0xff55('0x29')]||_0x4edd31[_0xff55('0x2a')][_0xff55('0x29')]||_0x4edd31['connection'][_0xff55('0x2a')][_0xff55('0x29')];return openIssue(_0x4edd31[_0xff55('0x25')],_0x1a1940);}; \ No newline at end of file +var _0xe2ab=['setEncoding','utf8','data','end','status','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','connection','remoteAddress','socket','bluebird','../../config/logger','support','Report','\x20from\x20','description','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','base64','stringify','request'];(function(_0x364048,_0x34dea3){var _0x591678=function(_0x239c0a){while(--_0x239c0a){_0x364048['push'](_0x364048['shift']());}};_0x591678(++_0x34dea3);}(_0xe2ab,0x1d3));var _0xbe2a=function(_0x12819f,_0x2a25df){_0x12819f=_0x12819f-0x0;var _0x3b4949=_0xe2ab[_0x12819f];return _0x3b4949;};'use strict';var BPromise=require(_0xbe2a('0x0'));var https=require('https');var logger=require(_0xbe2a('0x1'))('api');var USERNAME=_0xbe2a('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x4c34b9,_0xa9ee94){var _0x5a7bda={'fields':{'project':{'key':_0x4c34b9['key']||'MOTGUI'},'summary':(_0x4c34b9['summary']||_0xbe2a('0x3'))+_0xbe2a('0x4')+_0x4c34b9['ip'],'description':_0x4c34b9[_0xbe2a('0x5')]||JSON['stringify'](_0x4c34b9),'issuetype':{'name':_0x4c34b9[_0xbe2a('0x6')]||_0xbe2a('0x7')}}};_0x5a7bda[_0xbe2a('0x8')][_0xbe2a('0x9')]=_0x4c34b9[_0xbe2a('0xa')];_0x5a7bda[_0xbe2a('0x8')][_0xbe2a('0xb')]=_0x4c34b9[_0xbe2a('0xc')];_0x5a7bda[_0xbe2a('0x8')][_0xbe2a('0xd')]=_0x4c34b9['newToken'];_0x5a7bda[_0xbe2a('0x8')]['customfield_11503']=_0x4c34b9[_0xbe2a('0xe')];_0x5a7bda['fields'][_0xbe2a('0xf')]=_0x4c34b9[_0xbe2a('0x10')];_0x5a7bda[_0xbe2a('0x8')][_0xbe2a('0x11')]=_0x4c34b9['ip'];var _0x32ef83={'host':_0xbe2a('0x12'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xbe2a('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0xbe2a('0x14'),'Authorization':_0xbe2a('0x15')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xbe2a('0x16'))}};var _0x2a3f33=JSON[_0xbe2a('0x17')](_0x5a7bda);var _0x582dd3=https[_0xbe2a('0x18')](_0x32ef83,function(_0x45b674){_0x45b674[_0xbe2a('0x19')](_0xbe2a('0x1a'));var _0x186225='';_0x45b674['on'](_0xbe2a('0x1b'),function(_0x566165){_0x186225+=_0x566165;});_0x45b674['on'](_0xbe2a('0x1c'),function(){if(_0xa9ee94){return _0xa9ee94[_0xbe2a('0x1d')](_0x45b674[_0xbe2a('0x1e')])[_0xbe2a('0x1f')](JSON['parse'](_0x186225));}});});_0x582dd3['on']('error',function(_0x55c802){if(_0xa9ee94){return _0xa9ee94[_0xbe2a('0x1d')](0x1f4)[_0xbe2a('0x1f')]({'errors':[{'message':_0xbe2a('0x20'),'type':'api.jira'}]});}});_0x582dd3[_0xbe2a('0x21')](_0x2a3f33);_0x582dd3[_0xbe2a('0x1c')]();}exports[_0xbe2a('0x22')]=openIssue;exports[_0xbe2a('0x23')]=function(_0x1be343,_0x2a0d23){_0x1be343[_0xbe2a('0x24')]['ip']=_0x1be343[_0xbe2a('0x25')]['x-forwarded-for']||_0x1be343[_0xbe2a('0x26')][_0xbe2a('0x27')]||_0x1be343[_0xbe2a('0x28')][_0xbe2a('0x27')]||_0x1be343['connection']['socket'][_0xbe2a('0x27')];return openIssue(_0x1be343[_0xbe2a('0x24')],_0x2a0d23);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 7898668..68541fa 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 _0x6f68=['../../config/environment','get','isAuthenticated','describe','/:id','show','post','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0x6f68,0x192));var _0x86f6=function(_0x302c7d,_0x4be66a){_0x302c7d=_0x302c7d-0x0;var _0x96c750=_0x6f68[_0x302c7d];return _0x96c750;};'use strict';var multer=require(_0x86f6('0x0'));var util=require('util');var path=require(_0x86f6('0x1'));var timeout=require(_0x86f6('0x2'));var express=require('express');var router=express[_0x86f6('0x3')]();var auth=require(_0x86f6('0x4'));var interaction=require(_0x86f6('0x5'));var config=require(_0x86f6('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x86f6('0x7')]('/',auth[_0x86f6('0x8')](),controller['index']);router[_0x86f6('0x7')]('/describe',auth[_0x86f6('0x8')](),controller[_0x86f6('0x9')]);router[_0x86f6('0x7')](_0x86f6('0xa'),auth[_0x86f6('0x8')](),controller[_0x86f6('0xb')]);router[_0x86f6('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x86f6('0xa'),auth['isAuthenticated'](),controller[_0x86f6('0xd')]);router[_0x86f6('0xe')](_0x86f6('0xa'),auth[_0x86f6('0x8')](),controller[_0x86f6('0xf')]);module[_0x86f6('0x10')]=router; \ No newline at end of file +var _0x9677=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete'];(function(_0x2bcd6b,_0x4d4e1a){var _0x59f389=function(_0x30ff0e){while(--_0x30ff0e){_0x2bcd6b['push'](_0x2bcd6b['shift']());}};_0x59f389(++_0x4d4e1a);}(_0x9677,0x190));var _0x7967=function(_0x3d0016,_0x4a37e0){_0x3d0016=_0x3d0016-0x0;var _0x1dcb28=_0x9677[_0x3d0016];return _0x1dcb28;};'use strict';var multer=require(_0x7967('0x0'));var util=require(_0x7967('0x1'));var path=require(_0x7967('0x2'));var timeout=require(_0x7967('0x3'));var express=require(_0x7967('0x4'));var router=express[_0x7967('0x5')]();var auth=require(_0x7967('0x6'));var interaction=require(_0x7967('0x7'));var config=require(_0x7967('0x8'));var controller=require(_0x7967('0x9'));router[_0x7967('0xa')]('/',auth[_0x7967('0xb')](),controller[_0x7967('0xc')]);router[_0x7967('0xa')](_0x7967('0xd'),auth['isAuthenticated'](),controller[_0x7967('0xe')]);router[_0x7967('0xa')](_0x7967('0xf'),auth[_0x7967('0xb')](),controller[_0x7967('0x10')]);router[_0x7967('0x11')]('/',auth[_0x7967('0xb')](),controller['create']);router['put'](_0x7967('0xf'),auth['isAuthenticated'](),controller[_0x7967('0x12')]);router[_0x7967('0x13')](_0x7967('0xf'),auth[_0x7967('0xb')](),controller[_0x7967('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 83dca60..86054f1 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 _0x8c61=['TEXT','long','sequelize','exports','STRING'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x8c61,0x129));var _0x18c6=function(_0x642799,_0x416894){_0x642799=_0x642799-0x0;var _0x286b8c=_0x8c61[_0x642799];return _0x286b8c;};'use strict';var Sequelize=require(_0x18c6('0x0'));module[_0x18c6('0x1')]={'question':{'type':Sequelize[_0x18c6('0x2')]},'answer':{'type':Sequelize[_0x18c6('0x3')](_0x18c6('0x4'))},'membername':{'type':Sequelize[_0x18c6('0x2')]},'projectname':{'type':Sequelize[_0x18c6('0x2')]},'queue':{'type':Sequelize[_0x18c6('0x2')]},'uniqueid':{'type':Sequelize[_0x18c6('0x2')]},'calleridname':{'type':Sequelize[_0x18c6('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x18c6('0x2')]}}; \ No newline at end of file +var _0x4cbf=['exports','STRING','TEXT','long','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4cbf,0x15d));var _0xf4cb=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x4cbf[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0xf4cb('0x0'));module[_0xf4cb('0x1')]={'question':{'type':Sequelize[_0xf4cb('0x2')]},'answer':{'type':Sequelize[_0xf4cb('0x3')](_0xf4cb('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xf4cb('0x2')]},'queue':{'type':Sequelize[_0xf4cb('0x2')]},'uniqueid':{'type':Sequelize[_0xf4cb('0x2')]},'calleridname':{'type':Sequelize[_0xf4cb('0x2')]},'calleridnum':{'type':Sequelize[_0xf4cb('0x2')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 5d1dba4..d198ec0 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 _0xd117=['order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','then','destroy','error','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x130c5b,_0x148d8e){var _0x4ac96c=function(_0x42be1b){while(--_0x42be1b){_0x130c5b['push'](_0x130c5b['shift']());}};_0x4ac96c(++_0x148d8e);}(_0xd117,0xf5));var _0x7d11=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0xd117[_0x5d860f];return _0x236490;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7d11('0x0'));var zipdir=require(_0x7d11('0x1'));var jsonpatch=require(_0x7d11('0x2'));var rp=require(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var Mustache=require(_0x7d11('0x6'));var util=require(_0x7d11('0x7'));var path=require(_0x7d11('0x8'));var sox=require(_0x7d11('0x9'));var csv=require(_0x7d11('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7d11('0xb'));var squel=require(_0x7d11('0xc'));var crypto=require(_0x7d11('0xd'));var jsforce=require(_0x7d11('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7d11('0xa'));var querystring=require(_0x7d11('0xf'));var Papa=require(_0x7d11('0x10'));var Redis=require(_0x7d11('0x11'));var authService=require(_0x7d11('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x13'));var hardwareService=require(_0x7d11('0x14'));var logger=require(_0x7d11('0x15'))('api');var utils=require(_0x7d11('0x16'));var config=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x282437,_0x5b7ff9){_0x5b7ff9=_0x5b7ff9||0xcc;return function(_0x8dd3e6){if(_0x8dd3e6){return _0x282437[_0x7d11('0x18')](_0x5b7ff9);}return _0x282437[_0x7d11('0x19')](_0x5b7ff9)[_0x7d11('0x1a')]();};}function respondWithResult(_0x5c1901,_0x4bb14e){_0x4bb14e=_0x4bb14e||0xc8;return function(_0x5501f0){if(_0x5501f0){return _0x5c1901[_0x7d11('0x19')](_0x4bb14e)[_0x7d11('0x1b')](_0x5501f0);}};}function respondWithFilteredResult(_0x122f8a,_0x4d493a){return function(_0xa74683){if(_0xa74683){var _0x58991c=_0xa74683['count'],_0x17b61c=_0x4d493a['offset'],_0x4bcdc7=_0x4d493a[_0x7d11('0x1c')]+_0x4d493a[_0x7d11('0x1d')],_0x411b79;if(_0x4bcdc7>=_0x58991c){_0x4bcdc7=_0x58991c;_0x411b79=0xc8;}else{_0x411b79=0xce;}_0x122f8a['status'](_0x411b79);return _0x122f8a[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x17b61c+'-'+_0x4bcdc7+'/'+_0x58991c)[_0x7d11('0x1b')](_0xa74683);}return null;};}function patchUpdates(_0x24ded2){return function(_0x4f9a9e){try{jsonpatch[_0x7d11('0x20')](_0x4f9a9e,_0x24ded2,!![]);}catch(_0x57840d){return BPromise['reject'](_0x57840d);}return _0x4f9a9e[_0x7d11('0x21')]();};}function saveUpdates(_0x561cbe,_0x382749){return function(_0x4dabb7){if(_0x4dabb7){return _0x4dabb7['update'](_0x561cbe)[_0x7d11('0x22')](function(_0x3bd71c){return _0x3bd71c;});}return null;};}function removeEntity(_0x24829a,_0x313b03){return function(_0x583acb){if(_0x583acb){return _0x583acb[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x24829a[_0x7d11('0x19')](0xcc)[_0x7d11('0x1a')]();});}};}function handleEntityNotFound(_0x150b27,_0x2816be){return function(_0x18e8cc){if(!_0x18e8cc){_0x150b27[_0x7d11('0x18')](0x194);}return _0x18e8cc;};}function handleError(_0x4c18d5,_0x33ba37){_0x33ba37=_0x33ba37||0x1f4;return function(_0x1b2db9){logger[_0x7d11('0x24')](_0x1b2db9['stack']);if(_0x1b2db9[_0x7d11('0x25')]){delete _0x1b2db9[_0x7d11('0x25')];}_0x4c18d5[_0x7d11('0x19')](_0x33ba37)[_0x7d11('0x26')](_0x1b2db9);};}exports[_0x7d11('0x27')]=function(_0x5f1c53,_0x557939){var _0x199b69={},_0x603f7f={},_0x54bd06={'count':0x0,'rows':[]};var _0xea8a1=_[_0x7d11('0x28')](db[_0x7d11('0x29')][_0x7d11('0x2a')],function(_0x172f51){return{'name':_0x172f51['fieldName'],'type':_0x172f51[_0x7d11('0x2b')][_0x7d11('0x2c')]};});_0x603f7f['model']=_[_0x7d11('0x28')](_0xea8a1,_0x7d11('0x25'));_0x603f7f[_0x7d11('0x2d')]=_[_0x7d11('0x2e')](_0x5f1c53[_0x7d11('0x2d')]);_0x603f7f[_0x7d11('0x2f')]=_['intersection'](_0x603f7f[_0x7d11('0x30')],_0x603f7f['query']);_0x199b69['attributes']=_[_0x7d11('0x31')](_0x603f7f[_0x7d11('0x30')],qs[_0x7d11('0x32')](_0x5f1c53[_0x7d11('0x2d')][_0x7d11('0x32')]));_0x199b69[_0x7d11('0x33')]=_0x199b69['attributes'][_0x7d11('0x34')]?_0x199b69[_0x7d11('0x33')]:_0x603f7f[_0x7d11('0x30')];if(!_0x5f1c53[_0x7d11('0x2d')][_0x7d11('0x35')](_0x7d11('0x36'))){_0x199b69[_0x7d11('0x1d')]=qs[_0x7d11('0x1d')](_0x5f1c53[_0x7d11('0x2d')][_0x7d11('0x1d')]);_0x199b69['offset']=qs[_0x7d11('0x1c')](_0x5f1c53[_0x7d11('0x2d')][_0x7d11('0x1c')]);}_0x199b69[_0x7d11('0x37')]=qs[_0x7d11('0x38')](_0x5f1c53[_0x7d11('0x2d')][_0x7d11('0x38')]);_0x199b69[_0x7d11('0x39')]=qs[_0x7d11('0x2f')](_['pick'](_0x5f1c53[_0x7d11('0x2d')],_0x603f7f[_0x7d11('0x2f')]));if(_0x5f1c53[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x199b69[_0x7d11('0x39')]=_[_0x7d11('0x3b')](_0x199b69[_0x7d11('0x39')],{'$or':_[_0x7d11('0x28')](_0xea8a1,function(_0x3facd3){if(_0x3facd3[_0x7d11('0x2b')]!==_0x7d11('0x3c')){var _0x46a720={};_0x46a720[_0x3facd3[_0x7d11('0x25')]]={'$like':'%'+_0x5f1c53[_0x7d11('0x2d')]['filter']+'%'};return _0x46a720;}})});}_0x199b69=_[_0x7d11('0x3b')]({},_0x199b69,_0x5f1c53[_0x7d11('0x3d')]);var _0x577fc2={'where':_0x199b69[_0x7d11('0x39')]};return db[_0x7d11('0x29')]['count'](_0x577fc2)[_0x7d11('0x22')](function(_0x4790dc){_0x54bd06[_0x7d11('0x3e')]=_0x4790dc;if(_0x5f1c53[_0x7d11('0x2d')][_0x7d11('0x3f')]){_0x199b69[_0x7d11('0x40')]=[{'all':!![]}];}return db[_0x7d11('0x29')][_0x7d11('0x41')](_0x199b69);})[_0x7d11('0x22')](function(_0x5e96cf){_0x54bd06[_0x7d11('0x42')]=_0x5e96cf;return _0x54bd06;})[_0x7d11('0x22')](respondWithFilteredResult(_0x557939,_0x199b69))[_0x7d11('0x43')](handleError(_0x557939,null));};exports[_0x7d11('0x44')]=function(_0x5f3a75,_0x3469fd){var _0x2dd69d={'raw':!![],'where':{'id':_0x5f3a75[_0x7d11('0x45')]['id']}},_0x34ef3b={};_0x34ef3b['model']=_[_0x7d11('0x2e')](db[_0x7d11('0x29')][_0x7d11('0x2a')]);_0x34ef3b[_0x7d11('0x2d')]=_[_0x7d11('0x2e')](_0x5f3a75['query']);_0x34ef3b[_0x7d11('0x2f')]=_[_0x7d11('0x31')](_0x34ef3b[_0x7d11('0x30')],_0x34ef3b[_0x7d11('0x2d')]);_0x2dd69d['attributes']=_[_0x7d11('0x31')](_0x34ef3b['model'],qs[_0x7d11('0x32')](_0x5f3a75[_0x7d11('0x2d')][_0x7d11('0x32')]));_0x2dd69d['attributes']=_0x2dd69d['attributes'][_0x7d11('0x34')]?_0x2dd69d['attributes']:_0x34ef3b[_0x7d11('0x30')];if(_0x5f3a75[_0x7d11('0x2d')][_0x7d11('0x3f')]){_0x2dd69d['include']=[{'all':!![]}];}_0x2dd69d=_[_0x7d11('0x3b')]({},_0x2dd69d,_0x5f3a75[_0x7d11('0x3d')]);return db[_0x7d11('0x29')][_0x7d11('0x46')](_0x2dd69d)[_0x7d11('0x22')](handleEntityNotFound(_0x3469fd,null))['then'](respondWithResult(_0x3469fd,null))[_0x7d11('0x43')](handleError(_0x3469fd,null));};exports[_0x7d11('0x47')]=function(_0x54ff54,_0x167aff){return db['JscriptyAnswerReport'][_0x7d11('0x47')](_0x54ff54[_0x7d11('0x48')],{})['then'](respondWithResult(_0x167aff,0xc9))['catch'](handleError(_0x167aff,null));};exports[_0x7d11('0x49')]=function(_0x57e5a0,_0x465e53){if(_0x57e5a0['body']['id']){delete _0x57e5a0[_0x7d11('0x48')]['id'];}return db['JscriptyAnswerReport'][_0x7d11('0x46')]({'where':{'id':_0x57e5a0[_0x7d11('0x45')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x465e53,null))[_0x7d11('0x22')](saveUpdates(_0x57e5a0[_0x7d11('0x48')],null))[_0x7d11('0x22')](respondWithResult(_0x465e53,null))['catch'](handleError(_0x465e53,null));};exports[_0x7d11('0x23')]=function(_0x199256,_0xf49dcb){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x199256[_0x7d11('0x45')]['id']}})['then'](handleEntityNotFound(_0xf49dcb,null))[_0x7d11('0x22')](removeEntity(_0xf49dcb,null))[_0x7d11('0x43')](handleError(_0xf49dcb,null));};exports[_0x7d11('0x4a')]=function(_0x5cbc1f,_0x422d5c){return db[_0x7d11('0x29')][_0x7d11('0x4a')]()['then'](respondWithResult(_0x422d5c,null))['catch'](handleError(_0x422d5c,null));}; \ No newline at end of file +var _0x2186=['intersection','hasOwnProperty','order','where','filters','pick','filter','merge','map','type','VIRTUAL','options','JscriptyAnswerReport','include','findAll','rows','show','params','fields','length','includeAll','find','catch','create','body','describe','html-pdf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','attributes'];(function(_0x3ea03d,_0x383d79){var _0x54d96e=function(_0x10885d){while(--_0x10885d){_0x3ea03d['push'](_0x3ea03d['shift']());}};_0x54d96e(++_0x383d79);}(_0x2186,0x1ca));var _0x6218=function(_0x47c51c,_0x52288d){_0x47c51c=_0x47c51c-0x0;var _0x54a573=_0x2186[_0x47c51c];return _0x54a573;};'use strict';var pdf=require(_0x6218('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6218('0x1'));var rp=require(_0x6218('0x2'));var moment=require(_0x6218('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6218('0x4'));var util=require(_0x6218('0x5'));var path=require(_0x6218('0x6'));var sox=require(_0x6218('0x7'));var csv=require(_0x6218('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6218('0x9'));var jsforce=require(_0x6218('0xa'));var deskjs=require(_0x6218('0xb'));var toCsv=require(_0x6218('0x8'));var querystring=require(_0x6218('0xc'));var Papa=require('papaparse');var Redis=require(_0x6218('0xd'));var authService=require(_0x6218('0xe'));var qs=require(_0x6218('0xf'));var as=require(_0x6218('0x10'));var hardwareService=require(_0x6218('0x11'));var logger=require(_0x6218('0x12'))(_0x6218('0x13'));var utils=require('../../config/utils');var config=require(_0x6218('0x14'));var db=require(_0x6218('0x15'))['db'];function respondWithStatusCode(_0x377ba0,_0x432b92){_0x432b92=_0x432b92||0xcc;return function(_0x4e4c17){if(_0x4e4c17){return _0x377ba0['sendStatus'](_0x432b92);}return _0x377ba0['status'](_0x432b92)['end']();};}function respondWithResult(_0x9f6712,_0x3903d9){_0x3903d9=_0x3903d9||0xc8;return function(_0x4d2516){if(_0x4d2516){return _0x9f6712[_0x6218('0x16')](_0x3903d9)[_0x6218('0x17')](_0x4d2516);}};}function respondWithFilteredResult(_0x50e912,_0x3ec76a){return function(_0x297eaf){if(_0x297eaf){var _0x20143e=_0x297eaf[_0x6218('0x18')],_0xe78e18=_0x3ec76a[_0x6218('0x19')],_0x4faec9=_0x3ec76a[_0x6218('0x19')]+_0x3ec76a[_0x6218('0x1a')],_0x44f37d;if(_0x4faec9>=_0x20143e){_0x4faec9=_0x20143e;_0x44f37d=0xc8;}else{_0x44f37d=0xce;}_0x50e912['status'](_0x44f37d);return _0x50e912[_0x6218('0x1b')](_0x6218('0x1c'),_0xe78e18+'-'+_0x4faec9+'/'+_0x20143e)['json'](_0x297eaf);}return null;};}function patchUpdates(_0x31370c){return function(_0x151abf){try{jsonpatch['apply'](_0x151abf,_0x31370c,!![]);}catch(_0x2f35fc){return BPromise[_0x6218('0x1d')](_0x2f35fc);}return _0x151abf[_0x6218('0x1e')]();};}function saveUpdates(_0x55cd01,_0x535d48){return function(_0xf9b6){if(_0xf9b6){return _0xf9b6[_0x6218('0x1f')](_0x55cd01)[_0x6218('0x20')](function(_0x55febb){return _0x55febb;});}return null;};}function removeEntity(_0x58732a,_0x4c84f8){return function(_0x12e59e){if(_0x12e59e){return _0x12e59e[_0x6218('0x21')]()[_0x6218('0x20')](function(){_0x58732a[_0x6218('0x16')](0xcc)[_0x6218('0x22')]();});}};}function handleEntityNotFound(_0x241ea3,_0x47a4f8){return function(_0x12cb63){if(!_0x12cb63){_0x241ea3['sendStatus'](0x194);}return _0x12cb63;};}function handleError(_0x514f43,_0x499a84){_0x499a84=_0x499a84||0x1f4;return function(_0x52ff19){logger['error'](_0x52ff19[_0x6218('0x23')]);if(_0x52ff19['name']){delete _0x52ff19[_0x6218('0x24')];}_0x514f43['status'](_0x499a84)[_0x6218('0x25')](_0x52ff19);};}exports[_0x6218('0x26')]=function(_0x5704ee,_0x596e67){var _0x59001a={},_0x5e9e2b={},_0x59eeb4={'count':0x0,'rows':[]};var _0x716b33=_['map'](db['JscriptyAnswerReport'][_0x6218('0x27')],function(_0x2fd870){return{'name':_0x2fd870[_0x6218('0x28')],'type':_0x2fd870['type'][_0x6218('0x29')]};});_0x5e9e2b[_0x6218('0x2a')]=_['map'](_0x716b33,'name');_0x5e9e2b[_0x6218('0x2b')]=_[_0x6218('0x2c')](_0x5704ee[_0x6218('0x2b')]);_0x5e9e2b['filters']=_['intersection'](_0x5e9e2b[_0x6218('0x2a')],_0x5e9e2b[_0x6218('0x2b')]);_0x59001a[_0x6218('0x2d')]=_[_0x6218('0x2e')](_0x5e9e2b['model'],qs['fields'](_0x5704ee['query']['fields']));_0x59001a[_0x6218('0x2d')]=_0x59001a['attributes']['length']?_0x59001a[_0x6218('0x2d')]:_0x5e9e2b[_0x6218('0x2a')];if(!_0x5704ee[_0x6218('0x2b')][_0x6218('0x2f')]('nolimit')){_0x59001a[_0x6218('0x1a')]=qs[_0x6218('0x1a')](_0x5704ee[_0x6218('0x2b')]['limit']);_0x59001a[_0x6218('0x19')]=qs[_0x6218('0x19')](_0x5704ee[_0x6218('0x2b')][_0x6218('0x19')]);}_0x59001a[_0x6218('0x30')]=qs['sort'](_0x5704ee[_0x6218('0x2b')]['sort']);_0x59001a[_0x6218('0x31')]=qs[_0x6218('0x32')](_[_0x6218('0x33')](_0x5704ee['query'],_0x5e9e2b[_0x6218('0x32')]));if(_0x5704ee[_0x6218('0x2b')][_0x6218('0x34')]){_0x59001a['where']=_[_0x6218('0x35')](_0x59001a['where'],{'$or':_[_0x6218('0x36')](_0x716b33,function(_0x59000e){if(_0x59000e[_0x6218('0x37')]!==_0x6218('0x38')){var _0x4a7722={};_0x4a7722[_0x59000e[_0x6218('0x24')]]={'$like':'%'+_0x5704ee['query'][_0x6218('0x34')]+'%'};return _0x4a7722;}})});}_0x59001a=_[_0x6218('0x35')]({},_0x59001a,_0x5704ee[_0x6218('0x39')]);var _0x46b0bb={'where':_0x59001a[_0x6218('0x31')]};return db[_0x6218('0x3a')][_0x6218('0x18')](_0x46b0bb)[_0x6218('0x20')](function(_0xb8b6cc){_0x59eeb4[_0x6218('0x18')]=_0xb8b6cc;if(_0x5704ee[_0x6218('0x2b')]['includeAll']){_0x59001a[_0x6218('0x3b')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6218('0x3c')](_0x59001a);})['then'](function(_0x4f0886){_0x59eeb4[_0x6218('0x3d')]=_0x4f0886;return _0x59eeb4;})[_0x6218('0x20')](respondWithFilteredResult(_0x596e67,_0x59001a))['catch'](handleError(_0x596e67,null));};exports[_0x6218('0x3e')]=function(_0x2ff8bb,_0x1d30f0){var _0x139b12={'raw':!![],'where':{'id':_0x2ff8bb[_0x6218('0x3f')]['id']}},_0x2755b8={};_0x2755b8['model']=_[_0x6218('0x2c')](db[_0x6218('0x3a')][_0x6218('0x27')]);_0x2755b8[_0x6218('0x2b')]=_[_0x6218('0x2c')](_0x2ff8bb[_0x6218('0x2b')]);_0x2755b8[_0x6218('0x32')]=_[_0x6218('0x2e')](_0x2755b8['model'],_0x2755b8['query']);_0x139b12[_0x6218('0x2d')]=_[_0x6218('0x2e')](_0x2755b8[_0x6218('0x2a')],qs[_0x6218('0x40')](_0x2ff8bb[_0x6218('0x2b')][_0x6218('0x40')]));_0x139b12['attributes']=_0x139b12['attributes'][_0x6218('0x41')]?_0x139b12[_0x6218('0x2d')]:_0x2755b8[_0x6218('0x2a')];if(_0x2ff8bb['query'][_0x6218('0x42')]){_0x139b12['include']=[{'all':!![]}];}_0x139b12=_[_0x6218('0x35')]({},_0x139b12,_0x2ff8bb[_0x6218('0x39')]);return db[_0x6218('0x3a')][_0x6218('0x43')](_0x139b12)[_0x6218('0x20')](handleEntityNotFound(_0x1d30f0,null))[_0x6218('0x20')](respondWithResult(_0x1d30f0,null))[_0x6218('0x44')](handleError(_0x1d30f0,null));};exports[_0x6218('0x45')]=function(_0x3e695b,_0x49d042){return db['JscriptyAnswerReport']['create'](_0x3e695b[_0x6218('0x46')],{})[_0x6218('0x20')](respondWithResult(_0x49d042,0xc9))[_0x6218('0x44')](handleError(_0x49d042,null));};exports[_0x6218('0x1f')]=function(_0x47ca3a,_0x5d3983){if(_0x47ca3a[_0x6218('0x46')]['id']){delete _0x47ca3a[_0x6218('0x46')]['id'];}return db['JscriptyAnswerReport'][_0x6218('0x43')]({'where':{'id':_0x47ca3a[_0x6218('0x3f')]['id']}})[_0x6218('0x20')](handleEntityNotFound(_0x5d3983,null))[_0x6218('0x20')](saveUpdates(_0x47ca3a['body'],null))[_0x6218('0x20')](respondWithResult(_0x5d3983,null))[_0x6218('0x44')](handleError(_0x5d3983,null));};exports[_0x6218('0x21')]=function(_0x13ebb1,_0x94519b){return db['JscriptyAnswerReport'][_0x6218('0x43')]({'where':{'id':_0x13ebb1['params']['id']}})['then'](handleEntityNotFound(_0x94519b,null))[_0x6218('0x20')](removeEntity(_0x94519b,null))[_0x6218('0x44')](handleError(_0x94519b,null));};exports[_0x6218('0x47')]=function(_0x39472a,_0x1caf0a){return db[_0x6218('0x3a')][_0x6218('0x47')]()[_0x6218('0x20')](respondWithResult(_0x1caf0a,null))[_0x6218('0x44')](handleError(_0x1caf0a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 039d181..bf13bc9 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 _0xe6ce=['api','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','util','../../config/logger'];(function(_0x24a166,_0x4afc72){var _0x375709=function(_0x2d3734){while(--_0x2d3734){_0x24a166['push'](_0x24a166['shift']());}};_0x375709(++_0x4afc72);}(_0xe6ce,0x8d));var _0xee6c=function(_0x16f1d1,_0x38ca5e){_0x16f1d1=_0x16f1d1-0x0;var _0x3e835b=_0xe6ce[_0x16f1d1];return _0x3e835b;};'use strict';var _=require('lodash');var util=require(_0xee6c('0x0'));var logger=require(_0xee6c('0x1'))(_0xee6c('0x2'));var moment=require('moment');var BPromise=require(_0xee6c('0x3'));var rp=require(_0xee6c('0x4'));var fs=require('fs');var path=require(_0xee6c('0x5'));var rimraf=require('rimraf');var config=require(_0xee6c('0x6'));var attributes=require(_0xee6c('0x7'));module[_0xee6c('0x8')]=function(_0x2d825b,_0x17529f){return _0x2d825b[_0xee6c('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0xee6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdd8=['define','lodash','moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x38ccc,_0x14f7d6){var _0x4c9ca0=function(_0x1095dd){while(--_0x1095dd){_0x38ccc['push'](_0x38ccc['shift']());}};_0x4c9ca0(++_0x14f7d6);}(_0xfdd8,0x169));var _0x8fdd=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfdd8[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x8fdd('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8fdd('0x1'));var BPromise=require(_0x8fdd('0x2'));var rp=require(_0x8fdd('0x3'));var fs=require('fs');var path=require(_0x8fdd('0x4'));var rimraf=require('rimraf');var config=require(_0x8fdd('0x5'));var attributes=require(_0x8fdd('0x6'));module[_0x8fdd('0x7')]=function(_0x263e68,_0x541ce3){return _0x263e68[_0x8fdd('0x8')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','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 52d30ac..3ca4d00 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 _0x66a3=['stringify','error','code','message','info','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x4e76da,_0x291b71){var _0x5f14e8=function(_0x30ad0f){while(--_0x30ad0f){_0x4e76da['push'](_0x4e76da['shift']());}};_0x5f14e8(++_0x291b71);}(_0x66a3,0xcc));var _0x366a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x66a3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x366a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x366a('0x1'));var rs=require(_0x366a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x366a('0x3'))['db'];var utils=require(_0x366a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x366a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x366a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5757a3,_0x1683d9,_0x3e2a6f){return new BPromise(function(_0x4a97c3,_0x569526){return client[_0x366a('0x7')](_0x5757a3,_0x3e2a6f)['then'](function(_0x5d57ef){logger['info'](_0x366a('0x8'),_0x1683d9,_0x366a('0x9'));logger[_0x366a('0xa')](_0x366a('0xb'),_0x1683d9,_0x366a('0x9'),JSON[_0x366a('0xc')](_0x5d57ef));if(_0x5d57ef[_0x366a('0xd')]){if(_0x5d57ef[_0x366a('0xd')][_0x366a('0xe')]===0x1f4){logger[_0x366a('0xd')](_0x366a('0x8'),_0x1683d9,_0x5d57ef[_0x366a('0xd')][_0x366a('0xf')]);return _0x569526(_0x5d57ef[_0x366a('0xd')][_0x366a('0xf')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x1683d9,_0x5d57ef[_0x366a('0xd')][_0x366a('0xf')]);return _0x4a97c3(_0x5d57ef[_0x366a('0xd')][_0x366a('0xf')]);}else{logger[_0x366a('0x10')](_0x366a('0x8'),_0x1683d9,_0x366a('0x9'));_0x4a97c3(_0x5d57ef['result'][_0x366a('0xf')]);}})[_0x366a('0x11')](function(_0x1ddb10){logger[_0x366a('0xd')](_0x366a('0x8'),_0x1683d9,_0x1ddb10);_0x569526(_0x1ddb10);});});} \ No newline at end of file +var _0x797c=['client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1d930e,_0x20d8b8){var _0x5bbd66=function(_0x3c7488){while(--_0x3c7488){_0x1d930e['push'](_0x1d930e['shift']());}};_0x5bbd66(++_0x20d8b8);}(_0x797c,0x81));var _0xc797=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x797c[_0x492af5];return _0x59f529;};'use strict';var _=require('lodash');var util=require(_0xc797('0x0'));var moment=require('moment');var BPromise=require(_0xc797('0x1'));var rs=require(_0xc797('0x2'));var fs=require('fs');var Redis=require(_0xc797('0x3'));var db=require(_0xc797('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc797('0x5'))(_0xc797('0x6'));var config=require(_0xc797('0x7'));var jayson=require(_0xc797('0x8'));var client=jayson[_0xc797('0x9')][_0xc797('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x115b5a,_0x2ed6f8,_0x4f0042){return new BPromise(function(_0x102ac2,_0xde6ad4){return client[_0xc797('0xb')](_0x115b5a,_0x4f0042)[_0xc797('0xc')](function(_0x3d56fd){logger[_0xc797('0xd')](_0xc797('0xe'),_0x2ed6f8,'request\x20sent');logger[_0xc797('0xf')](_0xc797('0x10'),_0x2ed6f8,_0xc797('0x11'),JSON[_0xc797('0x12')](_0x3d56fd));if(_0x3d56fd[_0xc797('0x13')]){if(_0x3d56fd[_0xc797('0x13')][_0xc797('0x14')]===0x1f4){logger[_0xc797('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ed6f8,_0x3d56fd[_0xc797('0x13')][_0xc797('0x15')]);return _0xde6ad4(_0x3d56fd[_0xc797('0x13')][_0xc797('0x15')]);}logger[_0xc797('0x13')](_0xc797('0xe'),_0x2ed6f8,_0x3d56fd[_0xc797('0x13')][_0xc797('0x15')]);return _0x102ac2(_0x3d56fd[_0xc797('0x13')][_0xc797('0x15')]);}else{logger[_0xc797('0xd')](_0xc797('0xe'),_0x2ed6f8,_0xc797('0x11'));_0x102ac2(_0x3d56fd[_0xc797('0x16')]['message']);}})['catch'](function(_0x304044){logger[_0xc797('0x13')](_0xc797('0xe'),_0x2ed6f8,_0x304044);_0xde6ad4(_0x304044);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index f91904b..1f164db 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 _0x73a3=['getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','/:id','isAuthenticated','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary'];(function(_0x252c2a,_0x387047){var _0x105e1a=function(_0xfa1b28){while(--_0xfa1b28){_0x252c2a['push'](_0x252c2a['shift']());}};_0x105e1a(++_0x387047);}(_0x73a3,0x14e));var _0x373a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x73a3[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x373a('0x0'));var util=require(_0x373a('0x1'));var path=require(_0x373a('0x2'));var timeout=require('connect-timeout');var express=require(_0x373a('0x3'));var router=express[_0x373a('0x4')]();var auth=require(_0x373a('0x5'));var interaction=require(_0x373a('0x6'));var config=require(_0x373a('0x7'));var controller=require(_0x373a('0x8'));router[_0x373a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x373a('0x9')](_0x373a('0xa'),auth[_0x373a('0xb')](),controller['show']);router['get'](_0x373a('0xc'),auth['isAuthenticated'](),controller[_0x373a('0xd')]);router[_0x373a('0x9')](_0x373a('0xe'),auth[_0x373a('0xb')](),controller[_0x373a('0xf')]);router[_0x373a('0x9')](_0x373a('0x10'),auth['isAuthenticated'](),timeout('30s'),controller[_0x373a('0x11')]);router[_0x373a('0x12')]('/',auth[_0x373a('0xb')](),controller[_0x373a('0x13')]);router['post'](_0x373a('0x14'),auth[_0x373a('0xb')](),controller[_0x373a('0x15')]);router[_0x373a('0x16')](_0x373a('0xa'),auth['isAuthenticated'](),controller[_0x373a('0x17')]);router[_0x373a('0x18')](_0x373a('0xa'),auth['isAuthenticated'](),controller[_0x373a('0x19')]);module[_0x373a('0x1a')]=router; \ No newline at end of file +var _0x19bf=['show','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x4e1211,_0x1c0e26){var _0x4ae887=function(_0x6e55ff){while(--_0x6e55ff){_0x4e1211['push'](_0x4e1211['shift']());}};_0x4ae887(++_0x1c0e26);}(_0x19bf,0x16f));var _0xf19b=function(_0x1e1a6f,_0x1fe407){_0x1e1a6f=_0x1e1a6f-0x0;var _0x42d992=_0x19bf[_0x1e1a6f];return _0x42d992;};'use strict';var multer=require(_0xf19b('0x0'));var util=require(_0xf19b('0x1'));var path=require(_0xf19b('0x2'));var timeout=require(_0xf19b('0x3'));var express=require(_0xf19b('0x4'));var router=express['Router']();var auth=require(_0xf19b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf19b('0x6'));var controller=require('./jscriptyProject.controller');router[_0xf19b('0x7')]('/',auth[_0xf19b('0x8')](),controller[_0xf19b('0x9')]);router[_0xf19b('0x7')](_0xf19b('0xa'),auth[_0xf19b('0x8')](),controller[_0xf19b('0xb')]);router['get'](_0xf19b('0xc'),auth[_0xf19b('0x8')](),controller[_0xf19b('0xd')]);router[_0xf19b('0x7')](_0xf19b('0xe'),auth[_0xf19b('0x8')](),controller[_0xf19b('0xf')]);router['get']('/:id/summary',auth['isAuthenticated'](),timeout(_0xf19b('0x10')),controller[_0xf19b('0x11')]);router[_0xf19b('0x12')]('/',auth[_0xf19b('0x8')](),controller[_0xf19b('0x13')]);router[_0xf19b('0x12')](_0xf19b('0x14'),auth['isAuthenticated'](),controller[_0xf19b('0x15')]);router[_0xf19b('0x16')](_0xf19b('0xa'),auth[_0xf19b('0x8')](),controller[_0xf19b('0x17')]);router[_0xf19b('0x18')]('/:id',auth[_0xf19b('0x8')](),controller[_0xf19b('0x19')]);module[_0xf19b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index cc6e12b..fc2b554 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 _0xff76=['sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN'];(function(_0x4341d,_0x4367e9){var _0x396dda=function(_0x3852da){while(--_0x3852da){_0x4341d['push'](_0x4341d['shift']());}};_0x396dda(++_0x4367e9);}(_0xff76,0x66));var _0x6ff7=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xff76[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0x6ff7('0x0'));var _=require(_0x6ff7('0x1'));var util=require('util');module[_0x6ff7('0x2')]={'name':{'type':Sequelize[_0x6ff7('0x3')],'unique':_0x6ff7('0x4')},'description':{'type':Sequelize[_0x6ff7('0x3')]},'formData':{'type':Sequelize[_0x6ff7('0x5')](_0x6ff7('0x6')),'set':function(_0x7c880d){if(_[_0x6ff7('0x7')](_0x7c880d)){this[_0x6ff7('0x8')](_0x6ff7('0x9'),JSON[_0x6ff7('0xa')](_0x7c880d));}else if(_[_0x6ff7('0xb')](_0x7c880d)){this[_0x6ff7('0x8')](_0x6ff7('0x9'),_0x7c880d);}else{this[_0x6ff7('0x8')](_0x6ff7('0x9'),util[_0x6ff7('0xc')](_0x6ff7('0xd'),this[_0x6ff7('0xe')](_0x6ff7('0x4'))||'',this[_0x6ff7('0xe')](_0x6ff7('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6ff7('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x7b3c=['lodash','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize'];(function(_0x484247,_0x19ca9e){var _0x693cfb=function(_0x42cb23){while(--_0x42cb23){_0x484247['push'](_0x484247['shift']());}};_0x693cfb(++_0x19ca9e);}(_0x7b3c,0xef));var _0xc7b3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7b3c[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xc7b3('0x0'));var _=require(_0xc7b3('0x1'));var util=require('util');module[_0xc7b3('0x2')]={'name':{'type':Sequelize[_0xc7b3('0x3')],'unique':_0xc7b3('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xc7b3('0x5')](_0xc7b3('0x6')),'set':function(_0x113655){if(_[_0xc7b3('0x7')](_0x113655)){this[_0xc7b3('0x8')](_0xc7b3('0x9'),JSON[_0xc7b3('0xa')](_0x113655));}else if(_[_0xc7b3('0xb')](_0x113655)){this['setDataValue'](_0xc7b3('0x9'),_0x113655);}else{this['setDataValue'](_0xc7b3('0x9'),util['format'](_0xc7b3('0xc'),this[_0xc7b3('0xd')](_0xc7b3('0x4'))||'',this['getDataValue'](_0xc7b3('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc7b3('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc7b3('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 90db82d..97e6ef4 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 _0x205c=['updatedAt','create','getSessions','findOne','nolimit','order','ProjectId','JscriptySessionReport','rows','getAnswers','JscriptyAnswerReport','include','number','fromCharCode','toString','indexOf','replace','startTime','starttime','-createdAt','questionId','question','format','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','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','../../mysqldb','sendStatus','end','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','rawAttributes','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt'];(function(_0x428eb2,_0x20f989){var _0x20fc49=function(_0x6b45ea){while(--_0x6b45ea){_0x428eb2['push'](_0x428eb2['shift']());}};_0x20fc49(++_0x20f989);}(_0x205c,0x98));var _0xc205=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0x205c[_0x30cd7e];return _0x462a02;};'use strict';var pdf=require(_0xc205('0x0'));var emlformat=require(_0xc205('0x1'));var rimraf=require(_0xc205('0x2'));var zipdir=require(_0xc205('0x3'));var jsonpatch=require(_0xc205('0x4'));var rp=require(_0xc205('0x5'));var moment=require(_0xc205('0x6'));var BPromise=require(_0xc205('0x7'));var Mustache=require('mustache');var util=require(_0xc205('0x8'));var path=require(_0xc205('0x9'));var sox=require(_0xc205('0xa'));var csv=require(_0xc205('0xb'));var ejs=require(_0xc205('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc205('0xd'));var crypto=require(_0xc205('0xe'));var jsforce=require(_0xc205('0xf'));var deskjs=require(_0xc205('0x10'));var toCsv=require(_0xc205('0xb'));var querystring=require(_0xc205('0x11'));var Papa=require(_0xc205('0x12'));var Redis=require('ioredis');var authService=require(_0xc205('0x13'));var qs=require(_0xc205('0x14'));var as=require(_0xc205('0x15'));var hardwareService=require(_0xc205('0x16'));var logger=require(_0xc205('0x17'))(_0xc205('0x18'));var utils=require(_0xc205('0x19'));var config=require(_0xc205('0x1a'));var db=require(_0xc205('0x1b'))['db'];function respondWithStatusCode(_0x19f244,_0x5cc23a){_0x5cc23a=_0x5cc23a||0xcc;return function(_0x3540a5){if(_0x3540a5){return _0x19f244[_0xc205('0x1c')](_0x5cc23a);}return _0x19f244['status'](_0x5cc23a)[_0xc205('0x1d')]();};}function respondWithResult(_0x2752d9,_0xa13e4e){_0xa13e4e=_0xa13e4e||0xc8;return function(_0x588bf6){if(_0x588bf6){return _0x2752d9[_0xc205('0x1e')](_0xa13e4e)[_0xc205('0x1f')](_0x588bf6);}};}function respondWithFilteredResult(_0xadbdb7,_0x36d957){return function(_0x11fe56){if(_0x11fe56){var _0x2dfe64=_0x11fe56[_0xc205('0x20')],_0x1b06d7=_0x36d957['offset'],_0x12810b=_0x36d957['offset']+_0x36d957[_0xc205('0x21')],_0x3f7c00;if(_0x12810b>=_0x2dfe64){_0x12810b=_0x2dfe64;_0x3f7c00=0xc8;}else{_0x3f7c00=0xce;}_0xadbdb7['status'](_0x3f7c00);return _0xadbdb7[_0xc205('0x22')](_0xc205('0x23'),_0x1b06d7+'-'+_0x12810b+'/'+_0x2dfe64)[_0xc205('0x1f')](_0x11fe56);}return null;};}function patchUpdates(_0x129fa7){return function(_0x1f5f1b){try{jsonpatch[_0xc205('0x24')](_0x1f5f1b,_0x129fa7,!![]);}catch(_0x13ef00){return BPromise[_0xc205('0x25')](_0x13ef00);}return _0x1f5f1b[_0xc205('0x26')]();};}function saveUpdates(_0x324027,_0x5530fe){return function(_0x490ba5){if(_0x490ba5){return _0x490ba5[_0xc205('0x27')](_0x324027)[_0xc205('0x28')](function(_0x435a6a){return _0x435a6a;});}return null;};}function removeEntity(_0x1865c5,_0x4567b9){return function(_0x3b7a76){if(_0x3b7a76){return _0x3b7a76[_0xc205('0x29')]()[_0xc205('0x28')](function(){var _0x6404a5=_0x3b7a76[_0xc205('0x2a')]({'plain':!![]});var _0x19045f=_0xc205('0x2b');return db[_0xc205('0x2c')]['destroy']({'where':{'type':_0x19045f,'resourceId':_0x6404a5['id']}})[_0xc205('0x28')](function(){return _0x3b7a76;});})[_0xc205('0x28')](function(){_0x1865c5[_0xc205('0x1e')](0xcc)[_0xc205('0x1d')]();});}};}function handleEntityNotFound(_0x1f7265,_0x53d5d9){return function(_0x1026b5){if(!_0x1026b5){_0x1f7265[_0xc205('0x1c')](0x194);}return _0x1026b5;};}function handleError(_0x5917c0,_0x214c72){_0x214c72=_0x214c72||0x1f4;return function(_0x57b31a){logger[_0xc205('0x2d')](_0x57b31a[_0xc205('0x2e')]);if(_0x57b31a[_0xc205('0x2f')]){delete _0x57b31a[_0xc205('0x2f')];}_0x5917c0[_0xc205('0x1e')](_0x214c72)[_0xc205('0x30')](_0x57b31a);};}exports[_0xc205('0x31')]=function(_0x3ec12a,_0x259400){var _0x429af3={},_0x2c3394={},_0xdfbf35={'count':0x0,'rows':[]};var _0x52c207=_[_0xc205('0x32')](db[_0xc205('0x33')]['rawAttributes'],function(_0x31bc14){return{'name':_0x31bc14[_0xc205('0x34')],'type':_0x31bc14[_0xc205('0x35')][_0xc205('0x36')]};});_0x2c3394[_0xc205('0x37')]=_[_0xc205('0x32')](_0x52c207,_0xc205('0x2f'));_0x2c3394[_0xc205('0x38')]=_[_0xc205('0x39')](_0x3ec12a[_0xc205('0x38')]);_0x2c3394[_0xc205('0x3a')]=_['intersection'](_0x2c3394[_0xc205('0x37')],_0x2c3394[_0xc205('0x38')]);_0x429af3['attributes']=_[_0xc205('0x3b')](_0x2c3394['model'],qs[_0xc205('0x3c')](_0x3ec12a[_0xc205('0x38')][_0xc205('0x3c')]));_0x429af3[_0xc205('0x3d')]=_0x429af3[_0xc205('0x3d')][_0xc205('0x3e')]?_0x429af3[_0xc205('0x3d')]:_0x2c3394[_0xc205('0x37')];if(!_0x3ec12a[_0xc205('0x38')][_0xc205('0x3f')]('nolimit')){_0x429af3[_0xc205('0x21')]=qs[_0xc205('0x21')](_0x3ec12a[_0xc205('0x38')][_0xc205('0x21')]);_0x429af3['offset']=qs[_0xc205('0x40')](_0x3ec12a[_0xc205('0x38')][_0xc205('0x40')]);}_0x429af3['order']=qs[_0xc205('0x41')](_0x3ec12a[_0xc205('0x38')]['sort']);_0x429af3[_0xc205('0x42')]=qs[_0xc205('0x3a')](_[_0xc205('0x43')](_0x3ec12a[_0xc205('0x38')],_0x2c3394[_0xc205('0x3a')]));if(_0x3ec12a[_0xc205('0x38')][_0xc205('0x44')]){_0x429af3['where']=_[_0xc205('0x45')](_0x429af3[_0xc205('0x42')],{'$or':_['map'](_0x52c207,function(_0x24979d){if(_0x24979d[_0xc205('0x35')]!==_0xc205('0x46')){var _0x7c6587={};_0x7c6587[_0x24979d[_0xc205('0x2f')]]={'$like':'%'+_0x3ec12a[_0xc205('0x38')]['filter']+'%'};return _0x7c6587;}})});}_0x429af3=_['merge']({},_0x429af3,_0x3ec12a['options']);var _0x4c103c={'where':_0x429af3[_0xc205('0x42')]};return db[_0xc205('0x33')][_0xc205('0x20')](_0x4c103c)[_0xc205('0x28')](function(_0xd978c3){_0xdfbf35[_0xc205('0x20')]=_0xd978c3;if(_0x3ec12a[_0xc205('0x38')][_0xc205('0x47')]){_0x429af3['include']=[{'all':!![]}];}return db['JscriptyProject'][_0xc205('0x48')](_0x429af3);})[_0xc205('0x28')](function(_0x53c55d){_0xdfbf35['rows']=_0x53c55d;return _0xdfbf35;})[_0xc205('0x28')](respondWithFilteredResult(_0x259400,_0x429af3))[_0xc205('0x49')](handleError(_0x259400,null));};exports['show']=function(_0x2b6527,_0x463177){var _0x9235b2={'raw':![],'where':{'id':_0x2b6527['params']['id']}},_0xb987e0={};_0xb987e0['model']=_[_0xc205('0x39')](db[_0xc205('0x33')][_0xc205('0x4a')]);_0xb987e0['query']=_[_0xc205('0x39')](_0x2b6527['query']);_0xb987e0[_0xc205('0x3a')]=_['intersection'](_0xb987e0[_0xc205('0x37')],_0xb987e0[_0xc205('0x38')]);_0x9235b2[_0xc205('0x3d')]=_['intersection'](_0xb987e0[_0xc205('0x37')],qs[_0xc205('0x3c')](_0x2b6527['query'][_0xc205('0x3c')]));_0x9235b2[_0xc205('0x3d')]=_0x9235b2['attributes'][_0xc205('0x3e')]?_0x9235b2[_0xc205('0x3d')]:_0xb987e0[_0xc205('0x37')];if(_0x2b6527[_0xc205('0x38')][_0xc205('0x47')]){_0x9235b2['include']=[{'all':!![]}];}_0x9235b2=_[_0xc205('0x45')]({},_0x9235b2,_0x2b6527[_0xc205('0x4b')]);return db['JscriptyProject'][_0xc205('0x4c')](_0x9235b2)[_0xc205('0x28')](handleEntityNotFound(_0x463177,null))[_0xc205('0x28')](respondWithResult(_0x463177,null))[_0xc205('0x49')](handleError(_0x463177,null));};exports['create']=function(_0x455016,_0x3513dc){return db[_0xc205('0x33')]['create'](_0x455016[_0xc205('0x4d')],{})['then'](function(_0x40fed8){var _0x14ef3f=_0x455016[_0xc205('0x4e')]['get']({'plain':!![]});if(!_0x14ef3f)throw new Error(_0xc205('0x4f'));if(_0x14ef3f['role']===_0xc205('0x4e')){var _0x5b4e37=_0x40fed8[_0xc205('0x2a')]({'plain':!![]});var _0x4dd398=_0xc205('0x2b');return db[_0xc205('0x50')][_0xc205('0x4c')]({'where':{'name':_0x4dd398,'userProfileId':_0x14ef3f[_0xc205('0x51')]},'raw':!![]})[_0xc205('0x28')](function(_0x59e840){if(_0x59e840&&_0x59e840[_0xc205('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x5b4e37[_0xc205('0x2f')],'resourceId':_0x5b4e37['id'],'type':_0x59e840[_0xc205('0x2f')],'sectionId':_0x59e840['id']},{})[_0xc205('0x28')](function(){return _0x40fed8;});}else{return _0x40fed8;}})[_0xc205('0x49')](function(_0x13b9c1){logger[_0xc205('0x2d')](_0xc205('0x53'),_0x13b9c1);throw _0x13b9c1;});}return _0x40fed8;})[_0xc205('0x28')](respondWithResult(_0x3513dc,0xc9))[_0xc205('0x49')](handleError(_0x3513dc,null));};exports[_0xc205('0x54')]=function(_0x2c8dcd,_0x2947a9){var _0x32ff70={'where':{'id':_0x2c8dcd[_0xc205('0x55')]['id']}},_0x2d3363={};_0x2d3363[_0xc205('0x37')]=_[_0xc205('0x39')](db[_0xc205('0x33')]['rawAttributes']);_0x32ff70[_0xc205('0x3d')]=_[_0xc205('0x3b')](_0x2d3363[_0xc205('0x37')],qs[_0xc205('0x3c')](_0x2c8dcd[_0xc205('0x38')][_0xc205('0x3c')]));_0x32ff70[_0xc205('0x3d')]=_0x32ff70[_0xc205('0x3d')]['length']?_0x32ff70['attributes']:_0x2d3363[_0xc205('0x37')];if(_0x2c8dcd[_0xc205('0x38')]['includeAll']){_0x32ff70['include']=[{'all':!![]}];}_0x32ff70=_[_0xc205('0x45')]({},_0x32ff70,_0x2c8dcd['options']);return db['JscriptyProject']['find'](_0x32ff70)[_0xc205('0x28')](handleEntityNotFound(_0x2947a9,null))[_0xc205('0x28')](function(_0x3aa14e){if(_0x3aa14e){var _0x105ee8=_0x3aa14e['get']({'plain':!![]});_0x105ee8=qs[_0xc205('0x56')](_0x105ee8,['id',_0xc205('0x57'),_0xc205('0x58')]);_0x2c8dcd[_0xc205('0x4d')]=_['omit'](_0x2c8dcd[_0xc205('0x4d')],['id',_0xc205('0x57'),_0xc205('0x58')]);return db[_0xc205('0x33')][_0xc205('0x59')](_['merge'](_0x105ee8,_0x2c8dcd[_0xc205('0x4d')]),{'include':_0x2c8dcd['query'][_0xc205('0x47')]?[{'all':!![]}]:undefined})[_0xc205('0x28')](function(_0x365b73){var _0x1f109b=_0x2c8dcd['user']['get']({'plain':!![]});if(!_0x1f109b)throw new Error(_0xc205('0x4f'));if(_0x1f109b['role']===_0xc205('0x4e')){var _0x4e9745=_0x365b73[_0xc205('0x2a')]({'plain':!![]});var _0x306d7e=_0xc205('0x2b');return db[_0xc205('0x50')]['find']({'where':{'name':_0x306d7e,'userProfileId':_0x1f109b['userProfileId']},'raw':!![]})[_0xc205('0x28')](function(_0x16f3c2){if(_0x16f3c2&&_0x16f3c2['autoAssociation']===0x0){return db['UserProfileResource'][_0xc205('0x59')]({'name':_0x4e9745['name'],'resourceId':_0x4e9745['id'],'type':_0x16f3c2['name'],'sectionId':_0x16f3c2['id']},{})[_0xc205('0x28')](function(){return _0x365b73;});}else{return _0x365b73;}})[_0xc205('0x49')](function(_0x36cb2a){logger['error'](_0xc205('0x53'),_0x36cb2a);throw _0x36cb2a;});}return _0x365b73;});}})['then'](respondWithResult(_0x2947a9,0xc9))[_0xc205('0x49')](handleError(_0x2947a9,null));};exports[_0xc205('0x27')]=function(_0x21bce1,_0x49804b){if(_0x21bce1[_0xc205('0x4d')]['id']){delete _0x21bce1[_0xc205('0x4d')]['id'];}return db[_0xc205('0x33')][_0xc205('0x4c')]({'where':{'id':_0x21bce1[_0xc205('0x55')]['id']}})[_0xc205('0x28')](handleEntityNotFound(_0x49804b,null))[_0xc205('0x28')](saveUpdates(_0x21bce1[_0xc205('0x4d')],null))['then'](respondWithResult(_0x49804b,null))[_0xc205('0x49')](handleError(_0x49804b,null));};exports['destroy']=function(_0x6fdc61,_0x3a4062){return db['JscriptyProject'][_0xc205('0x4c')]({'where':{'id':_0x6fdc61[_0xc205('0x55')]['id']}})[_0xc205('0x28')](handleEntityNotFound(_0x3a4062,null))['then'](removeEntity(_0x3a4062,null))['catch'](handleError(_0x3a4062,null));};exports[_0xc205('0x5a')]=function(_0x2fd01d,_0x8fdd8e,_0x7b04d4){var _0x37aaac={'raw':!![],'where':{}};var _0x136ad6={};var _0x513275={'count':0x0,'rows':[]};return db[_0xc205('0x33')][_0xc205('0x5b')]({'where':{'id':_0x2fd01d[_0xc205('0x55')]['id']}})[_0xc205('0x28')](handleEntityNotFound(_0x8fdd8e,null))['then'](function(_0x8226ae){if(_0x8226ae){_0x136ad6[_0xc205('0x37')]=_[_0xc205('0x39')](db['JscriptySessionReport'][_0xc205('0x4a')]);_0x136ad6[_0xc205('0x38')]=_[_0xc205('0x39')](_0x2fd01d[_0xc205('0x38')]);_0x136ad6[_0xc205('0x3a')]=_['intersection'](_0x136ad6[_0xc205('0x37')],_0x136ad6[_0xc205('0x38')]);_0x37aaac['attributes']=_[_0xc205('0x3b')](_0x136ad6['model'],qs['fields'](_0x2fd01d[_0xc205('0x38')][_0xc205('0x3c')]));_0x37aaac['attributes']=_0x37aaac[_0xc205('0x3d')]['length']?_0x37aaac[_0xc205('0x3d')]:_0x136ad6[_0xc205('0x37')];if(!_0x2fd01d[_0xc205('0x38')][_0xc205('0x3f')](_0xc205('0x5c'))){_0x37aaac[_0xc205('0x21')]=qs[_0xc205('0x21')](_0x2fd01d['query'][_0xc205('0x21')]);_0x37aaac[_0xc205('0x40')]=qs['offset'](_0x2fd01d['query'][_0xc205('0x40')]);}_0x37aaac[_0xc205('0x5d')]=qs[_0xc205('0x41')](_0x2fd01d[_0xc205('0x38')][_0xc205('0x41')]);_0x37aaac['where']=qs[_0xc205('0x3a')](_[_0xc205('0x43')](_0x2fd01d['query'],_0x136ad6[_0xc205('0x3a')]));_0x37aaac[_0xc205('0x42')][_0xc205('0x5e')]=_0x8226ae['id'];if(_0x2fd01d['query']['filter']){_0x37aaac[_0xc205('0x42')]=_['merge'](_0x37aaac['where'],{'$or':_[_0xc205('0x32')](_0x37aaac[_0xc205('0x3d')],function(_0x262d95){var _0x465992={};_0x465992[_0x262d95]={'$like':'%'+_0x2fd01d[_0xc205('0x38')][_0xc205('0x44')]+'%'};return _0x465992;})});}_0x37aaac=_[_0xc205('0x45')]({},_0x37aaac,_0x2fd01d[_0xc205('0x4b')]);return db[_0xc205('0x5f')][_0xc205('0x20')]({'where':_0x37aaac['where']})[_0xc205('0x28')](function(_0x59f311){_0x513275[_0xc205('0x20')]=_0x59f311;if(_0x2fd01d['query'][_0xc205('0x47')]){_0x37aaac['include']=[{'all':!![]}];}return db[_0xc205('0x5f')]['findAll'](_0x37aaac);})[_0xc205('0x28')](function(_0x3ab883){_0x513275[_0xc205('0x60')]=_0x3ab883;return _0x513275;});}})[_0xc205('0x28')](respondWithFilteredResult(_0x8fdd8e,_0x37aaac))[_0xc205('0x49')](handleError(_0x8fdd8e,null));};exports[_0xc205('0x61')]=function(_0x37ae82,_0x452e88,_0xabd597){var _0xd2a1f7={'raw':!![],'where':{}};var _0xd96326={};var _0x3a67cf={'count':0x0,'rows':[]};return db[_0xc205('0x33')][_0xc205('0x5b')]({'where':{'id':_0x37ae82[_0xc205('0x55')]['id']}})[_0xc205('0x28')](handleEntityNotFound(_0x452e88,null))[_0xc205('0x28')](function(_0x4bff4f){if(_0x4bff4f){_0xd96326['model']=_[_0xc205('0x39')](db[_0xc205('0x62')][_0xc205('0x4a')]);_0xd96326['query']=_[_0xc205('0x39')](_0x37ae82[_0xc205('0x38')]);_0xd96326['filters']=_[_0xc205('0x3b')](_0xd96326['model'],_0xd96326['query']);_0xd2a1f7[_0xc205('0x3d')]=_['intersection'](_0xd96326['model'],qs[_0xc205('0x3c')](_0x37ae82[_0xc205('0x38')][_0xc205('0x3c')]));_0xd2a1f7['attributes']=_0xd2a1f7[_0xc205('0x3d')][_0xc205('0x3e')]?_0xd2a1f7['attributes']:_0xd96326['model'];if(!_0x37ae82[_0xc205('0x38')][_0xc205('0x3f')](_0xc205('0x5c'))){_0xd2a1f7[_0xc205('0x21')]=qs[_0xc205('0x21')](_0x37ae82['query'][_0xc205('0x21')]);_0xd2a1f7[_0xc205('0x40')]=qs[_0xc205('0x40')](_0x37ae82[_0xc205('0x38')][_0xc205('0x40')]);}_0xd2a1f7[_0xc205('0x5d')]=qs[_0xc205('0x41')](_0x37ae82[_0xc205('0x38')][_0xc205('0x41')]);_0xd2a1f7[_0xc205('0x42')]=qs[_0xc205('0x3a')](_['pick'](_0x37ae82['query'],_0xd96326[_0xc205('0x3a')]));_0xd2a1f7[_0xc205('0x42')]['ProjectId']=_0x4bff4f['id'];if(_0x37ae82['query'][_0xc205('0x44')]){_0xd2a1f7['where']=_[_0xc205('0x45')](_0xd2a1f7[_0xc205('0x42')],{'$or':_[_0xc205('0x32')](_0xd2a1f7[_0xc205('0x3d')],function(_0x35077f){var _0x1d178e={};_0x1d178e[_0x35077f]={'$like':'%'+_0x37ae82['query']['filter']+'%'};return _0x1d178e;})});}_0xd2a1f7=_[_0xc205('0x45')]({},_0xd2a1f7,_0x37ae82[_0xc205('0x4b')]);return db[_0xc205('0x62')][_0xc205('0x20')]({'where':_0xd2a1f7['where']})['then'](function(_0x598e17){_0x3a67cf[_0xc205('0x20')]=_0x598e17;if(_0x37ae82['query'][_0xc205('0x47')]){_0xd2a1f7[_0xc205('0x63')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc205('0x48')](_0xd2a1f7);})[_0xc205('0x28')](function(_0x5587c5){_0x3a67cf[_0xc205('0x60')]=_0x5587c5;return _0x3a67cf;});}})[_0xc205('0x28')](respondWithFilteredResult(_0x452e88,_0xd2a1f7))[_0xc205('0x49')](handleError(_0x452e88,null));};function char(_0x5ddcfe){return _0xc205('0x64')===typeof _0x5ddcfe?String[_0xc205('0x65')]['apply'](null,arguments):_0x5ddcfe;}function needsEncapsulation(_0x1c3321){return!!_0x1c3321&&(_0x1c3321['toString']()['indexOf'](char(0xd))>=0x0||_0x1c3321[_0xc205('0x66')]()[_0xc205('0x67')](char(0xa))>=0x0||_0x1c3321['toString']()[_0xc205('0x67')](char(0x2c))>=0x0||_0x1c3321[_0xc205('0x66')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x4cd729){var _0x1c1668=char(0x22),_0x4c65ee='\x5c'+char(0x22),_0x445922=_0x4cd729[_0xc205('0x66')]()[_0xc205('0x68')](new RegExp(_0x1c1668,'g'),_0x4c65ee);return _0x1c1668+_0x445922+_0x1c1668;}exports['getSummary']=function(_0x2f89c7,_0x24ceda,_0x47cafd){var _0x3c3f04,_0x33fff7;var _0x3afff9={'where':{'ProjectId':_0x2f89c7[_0xc205('0x55')]['id']}};if(_0x2f89c7['query'][_0xc205('0x69')]){_0x3afff9[_0xc205('0x42')][_0xc205('0x6a')]=JSON['parse'](_0x2f89c7[_0xc205('0x38')][_0xc205('0x69')]);}return db[_0xc205('0x5f')][_0xc205('0x48')](_0x3afff9)[_0xc205('0x28')](handleEntityNotFound(_0x24ceda,null))['then'](function(_0x173d58){if(_0x173d58){_0x3c3f04=_0x173d58;return db['JscriptyQuestionReport'][_0xc205('0x48')]({'where':{'SessionId':{'$in':_[_0xc205('0x32')](_0x3c3f04,'id')},'ProjectId':_0x2f89c7[_0xc205('0x55')]['id']},'order':_0xc205('0x6b')});}})[_0xc205('0x28')](handleEntityNotFound(_0x24ceda,null))['then'](function(_0x59968c){if(_0x59968c){_0x33fff7=_0x59968c;var _0x2d45ff={};for(var _0x5ad862=0x0,_0x51aa9c=_0x33fff7[_0xc205('0x3e')];_0x5ad862<_0x51aa9c;_0x5ad862++){if(!_0x2d45ff['hasOwnProperty'](_0x33fff7[_0x5ad862][_0xc205('0x6c')])){_0x2d45ff[_0x33fff7[_0x5ad862]['questionId']]=needsEncapsulation(_0x33fff7[_0x5ad862]['question'])?encapsulate(_0x33fff7[_0x5ad862][_0xc205('0x6d')]):_0x33fff7[_0x5ad862][_0xc205('0x6d')];}}var _0xbf915=[],_0x86b8f6={};for(var _0x35bd56=0x0,_0x5d86ea=_0x3c3f04[_0xc205('0x3e')];_0x35bd56<_0x5d86ea;_0x35bd56++){_0x86b8f6={'ProjectId':_0x2f89c7[_0xc205('0x55')]['id'],'SessionId':_0x3c3f04[_0x35bd56]['id'],'StartTime':moment(_0x3c3f04[_0x35bd56][_0xc205('0x6a')])[_0xc205('0x6e')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x143f32=0x0,_0x52e20a=_0x33fff7[_0xc205('0x3e')];_0x143f32<_0x52e20a;_0x143f32++){if(_0x33fff7[_0x143f32]['SessionId']==_0x3c3f04[_0x35bd56]['id']&&_0x2d45ff[_0xc205('0x3f')](_0x33fff7[_0x143f32][_0xc205('0x6c')])){_0x86b8f6[_0x2d45ff[_0x33fff7[_0x143f32][_0xc205('0x6c')]]]=_0x33fff7[_0x143f32][_0xc205('0x6f')];}}for(var _0xbd73c5 in _0x2d45ff){if(!_0x86b8f6[_0xc205('0x3f')](_0x2d45ff[_0xbd73c5])){_0x86b8f6[_0x2d45ff[_0xbd73c5]]=null;}}_0xbf915['push'](_0x86b8f6);}return _0xbf915;}})['then'](function(_0xcdccd3){if(!_[_0xc205('0x70')](_0xcdccd3)){var _0x56e249=toCsv(_0xcdccd3);var _0x4a1902=Date[_0xc205('0x71')]();fs['writeFileSync'](util[_0xc205('0x6e')](_0xc205('0x72'),_0x2f89c7['params']['id'],_0x4a1902),_0x56e249);_0x24ceda[_0xc205('0x73')]('Content-disposition',_0xc205('0x74')+util[_0xc205('0x6e')](_0xc205('0x75'),_0x2f89c7[_0xc205('0x55')]['id'],_0x4a1902));_0x24ceda[_0xc205('0x73')]('Content-type',_0xc205('0x76'));return _0x24ceda[_0xc205('0x77')](util['format'](_0xc205('0x72'),_0x2f89c7[_0xc205('0x55')]['id'],_0x4a1902));}else{return _0x24ceda[_0xc205('0x1c')](0xcc);}})[_0xc205('0x49')](handleError(_0x24ceda,null));}; \ No newline at end of file +var _0x1b83=['findAll','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','lodash','crypto','jsforce','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','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send','map','JscriptyProject','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','count','include','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','getSessions','findOne','JscriptySessionReport','pick','ProjectId','rows','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','startTime','starttime','JscriptyQuestionReport'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x1b83,0xfc));var _0x31b8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1b83[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x31b8('0x0'));var rimraf=require(_0x31b8('0x1'));var zipdir=require(_0x31b8('0x2'));var jsonpatch=require(_0x31b8('0x3'));var rp=require(_0x31b8('0x4'));var moment=require(_0x31b8('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x31b8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x31b8('0x7'));var ejs=require(_0x31b8('0x8'));var fs=require('fs');var _=require(_0x31b8('0x9'));var squel=require('squel');var crypto=require(_0x31b8('0xa'));var jsforce=require(_0x31b8('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x31b8('0xc'));var Papa=require(_0x31b8('0xd'));var Redis=require(_0x31b8('0xe'));var authService=require(_0x31b8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x31b8('0x10'));var hardwareService=require(_0x31b8('0x11'));var logger=require(_0x31b8('0x12'))(_0x31b8('0x13'));var utils=require(_0x31b8('0x14'));var config=require(_0x31b8('0x15'));var db=require(_0x31b8('0x16'))['db'];function respondWithStatusCode(_0x24e2dc,_0x1859be){_0x1859be=_0x1859be||0xcc;return function(_0x3d44f6){if(_0x3d44f6){return _0x24e2dc[_0x31b8('0x17')](_0x1859be);}return _0x24e2dc[_0x31b8('0x18')](_0x1859be)[_0x31b8('0x19')]();};}function respondWithResult(_0x225020,_0x34b4da){_0x34b4da=_0x34b4da||0xc8;return function(_0x1a30cc){if(_0x1a30cc){return _0x225020[_0x31b8('0x18')](_0x34b4da)[_0x31b8('0x1a')](_0x1a30cc);}};}function respondWithFilteredResult(_0x256c95,_0x5d5cd4){return function(_0x4582b2){if(_0x4582b2){var _0x4f6217=_0x4582b2['count'],_0xd3b7ab=_0x5d5cd4[_0x31b8('0x1b')],_0xbd5de1=_0x5d5cd4[_0x31b8('0x1b')]+_0x5d5cd4[_0x31b8('0x1c')],_0x219eec;if(_0xbd5de1>=_0x4f6217){_0xbd5de1=_0x4f6217;_0x219eec=0xc8;}else{_0x219eec=0xce;}_0x256c95[_0x31b8('0x18')](_0x219eec);return _0x256c95[_0x31b8('0x1d')](_0x31b8('0x1e'),_0xd3b7ab+'-'+_0xbd5de1+'/'+_0x4f6217)[_0x31b8('0x1a')](_0x4582b2);}return null;};}function patchUpdates(_0x2f8b60){return function(_0x290a15){try{jsonpatch[_0x31b8('0x1f')](_0x290a15,_0x2f8b60,!![]);}catch(_0x564f0e){return BPromise[_0x31b8('0x20')](_0x564f0e);}return _0x290a15[_0x31b8('0x21')]();};}function saveUpdates(_0x4ce0f6,_0x13774a){return function(_0x49e22e){if(_0x49e22e){return _0x49e22e['update'](_0x4ce0f6)['then'](function(_0x2d8d33){return _0x2d8d33;});}return null;};}function removeEntity(_0x32cebb,_0x4fea57){return function(_0x4b131b){if(_0x4b131b){return _0x4b131b['destroy']()[_0x31b8('0x22')](function(){var _0x1543a6=_0x4b131b[_0x31b8('0x23')]({'plain':!![]});var _0x49a5ad='Projects';return db[_0x31b8('0x24')][_0x31b8('0x25')]({'where':{'type':_0x49a5ad,'resourceId':_0x1543a6['id']}})['then'](function(){return _0x4b131b;});})['then'](function(){_0x32cebb[_0x31b8('0x18')](0xcc)[_0x31b8('0x19')]();});}};}function handleEntityNotFound(_0x10ad14,_0x2cc364){return function(_0x2a0cae){if(!_0x2a0cae){_0x10ad14[_0x31b8('0x17')](0x194);}return _0x2a0cae;};}function handleError(_0x5119f7,_0x3228d2){_0x3228d2=_0x3228d2||0x1f4;return function(_0x829f9b){logger[_0x31b8('0x26')](_0x829f9b[_0x31b8('0x27')]);if(_0x829f9b[_0x31b8('0x28')]){delete _0x829f9b[_0x31b8('0x28')];}_0x5119f7[_0x31b8('0x18')](_0x3228d2)[_0x31b8('0x29')](_0x829f9b);};}exports['index']=function(_0x4a5037,_0x3be0c7){var _0x193d27={},_0x5cb169={},_0x562dd2={'count':0x0,'rows':[]};var _0x2e8e88=_[_0x31b8('0x2a')](db[_0x31b8('0x2b')][_0x31b8('0x2c')],function(_0x587bd5){return{'name':_0x587bd5['fieldName'],'type':_0x587bd5[_0x31b8('0x2d')][_0x31b8('0x2e')]};});_0x5cb169[_0x31b8('0x2f')]=_['map'](_0x2e8e88,'name');_0x5cb169['query']=_[_0x31b8('0x30')](_0x4a5037[_0x31b8('0x31')]);_0x5cb169['filters']=_['intersection'](_0x5cb169[_0x31b8('0x2f')],_0x5cb169[_0x31b8('0x31')]);_0x193d27[_0x31b8('0x32')]=_[_0x31b8('0x33')](_0x5cb169[_0x31b8('0x2f')],qs[_0x31b8('0x34')](_0x4a5037[_0x31b8('0x31')]['fields']));_0x193d27[_0x31b8('0x32')]=_0x193d27[_0x31b8('0x32')][_0x31b8('0x35')]?_0x193d27['attributes']:_0x5cb169[_0x31b8('0x2f')];if(!_0x4a5037['query'][_0x31b8('0x36')](_0x31b8('0x37'))){_0x193d27[_0x31b8('0x1c')]=qs[_0x31b8('0x1c')](_0x4a5037[_0x31b8('0x31')][_0x31b8('0x1c')]);_0x193d27[_0x31b8('0x1b')]=qs[_0x31b8('0x1b')](_0x4a5037[_0x31b8('0x31')][_0x31b8('0x1b')]);}_0x193d27[_0x31b8('0x38')]=qs[_0x31b8('0x39')](_0x4a5037['query'][_0x31b8('0x39')]);_0x193d27[_0x31b8('0x3a')]=qs[_0x31b8('0x3b')](_['pick'](_0x4a5037['query'],_0x5cb169[_0x31b8('0x3b')]));if(_0x4a5037['query'][_0x31b8('0x3c')]){_0x193d27[_0x31b8('0x3a')]=_[_0x31b8('0x3d')](_0x193d27[_0x31b8('0x3a')],{'$or':_[_0x31b8('0x2a')](_0x2e8e88,function(_0x1e5285){if(_0x1e5285[_0x31b8('0x2d')]!=='VIRTUAL'){var _0x42821d={};_0x42821d[_0x1e5285[_0x31b8('0x28')]]={'$like':'%'+_0x4a5037[_0x31b8('0x31')][_0x31b8('0x3c')]+'%'};return _0x42821d;}})});}_0x193d27=_[_0x31b8('0x3d')]({},_0x193d27,_0x4a5037[_0x31b8('0x3e')]);var _0x44967c={'where':_0x193d27[_0x31b8('0x3a')]};return db['JscriptyProject'][_0x31b8('0x3f')](_0x44967c)[_0x31b8('0x22')](function(_0x567668){_0x562dd2[_0x31b8('0x3f')]=_0x567668;if(_0x4a5037['query']['includeAll']){_0x193d27[_0x31b8('0x40')]=[{'all':!![]}];}return db[_0x31b8('0x2b')]['findAll'](_0x193d27);})[_0x31b8('0x22')](function(_0x2c2b23){_0x562dd2['rows']=_0x2c2b23;return _0x562dd2;})['then'](respondWithFilteredResult(_0x3be0c7,_0x193d27))[_0x31b8('0x41')](handleError(_0x3be0c7,null));};exports[_0x31b8('0x42')]=function(_0xf2745f,_0x1224cb){var _0x423523={'raw':![],'where':{'id':_0xf2745f[_0x31b8('0x43')]['id']}},_0x1983d0={};_0x1983d0[_0x31b8('0x2f')]=_['keys'](db[_0x31b8('0x2b')]['rawAttributes']);_0x1983d0['query']=_[_0x31b8('0x30')](_0xf2745f['query']);_0x1983d0['filters']=_[_0x31b8('0x33')](_0x1983d0[_0x31b8('0x2f')],_0x1983d0[_0x31b8('0x31')]);_0x423523[_0x31b8('0x32')]=_[_0x31b8('0x33')](_0x1983d0[_0x31b8('0x2f')],qs[_0x31b8('0x34')](_0xf2745f[_0x31b8('0x31')][_0x31b8('0x34')]));_0x423523[_0x31b8('0x32')]=_0x423523[_0x31b8('0x32')][_0x31b8('0x35')]?_0x423523[_0x31b8('0x32')]:_0x1983d0[_0x31b8('0x2f')];if(_0xf2745f[_0x31b8('0x31')][_0x31b8('0x44')]){_0x423523[_0x31b8('0x40')]=[{'all':!![]}];}_0x423523=_[_0x31b8('0x3d')]({},_0x423523,_0xf2745f[_0x31b8('0x3e')]);return db[_0x31b8('0x2b')][_0x31b8('0x45')](_0x423523)[_0x31b8('0x22')](handleEntityNotFound(_0x1224cb,null))[_0x31b8('0x22')](respondWithResult(_0x1224cb,null))[_0x31b8('0x41')](handleError(_0x1224cb,null));};exports[_0x31b8('0x46')]=function(_0x1c6dbc,_0x5a1404){return db[_0x31b8('0x2b')][_0x31b8('0x46')](_0x1c6dbc[_0x31b8('0x47')],{})[_0x31b8('0x22')](function(_0x5d24ca){var _0x4714d8=_0x1c6dbc[_0x31b8('0x48')][_0x31b8('0x23')]({'plain':!![]});if(!_0x4714d8)throw new Error(_0x31b8('0x49'));if(_0x4714d8['role']===_0x31b8('0x48')){var _0x2b2c89=_0x5d24ca[_0x31b8('0x23')]({'plain':!![]});var _0xf53b62=_0x31b8('0x4a');return db[_0x31b8('0x4b')]['find']({'where':{'name':_0xf53b62,'userProfileId':_0x4714d8[_0x31b8('0x4c')]},'raw':!![]})[_0x31b8('0x22')](function(_0x408f61){if(_0x408f61&&_0x408f61[_0x31b8('0x4d')]===0x0){return db['UserProfileResource'][_0x31b8('0x46')]({'name':_0x2b2c89[_0x31b8('0x28')],'resourceId':_0x2b2c89['id'],'type':_0x408f61[_0x31b8('0x28')],'sectionId':_0x408f61['id']},{})[_0x31b8('0x22')](function(){return _0x5d24ca;});}else{return _0x5d24ca;}})['catch'](function(_0x469f50){logger['error'](_0x31b8('0x4e'),_0x469f50);throw _0x469f50;});}return _0x5d24ca;})['then'](respondWithResult(_0x5a1404,0xc9))[_0x31b8('0x41')](handleError(_0x5a1404,null));};exports[_0x31b8('0x4f')]=function(_0x3824b7,_0xb8aff8){var _0x264a08={'where':{'id':_0x3824b7[_0x31b8('0x43')]['id']}},_0xf84ffd={};_0xf84ffd[_0x31b8('0x2f')]=_['keys'](db[_0x31b8('0x2b')][_0x31b8('0x2c')]);_0x264a08[_0x31b8('0x32')]=_[_0x31b8('0x33')](_0xf84ffd[_0x31b8('0x2f')],qs[_0x31b8('0x34')](_0x3824b7['query'][_0x31b8('0x34')]));_0x264a08['attributes']=_0x264a08['attributes'][_0x31b8('0x35')]?_0x264a08[_0x31b8('0x32')]:_0xf84ffd[_0x31b8('0x2f')];if(_0x3824b7['query'][_0x31b8('0x44')]){_0x264a08[_0x31b8('0x40')]=[{'all':!![]}];}_0x264a08=_[_0x31b8('0x3d')]({},_0x264a08,_0x3824b7[_0x31b8('0x3e')]);return db['JscriptyProject']['find'](_0x264a08)['then'](handleEntityNotFound(_0xb8aff8,null))[_0x31b8('0x22')](function(_0x59b307){if(_0x59b307){var _0x4d9207=_0x59b307[_0x31b8('0x23')]({'plain':!![]});_0x4d9207=qs[_0x31b8('0x50')](_0x4d9207,['id',_0x31b8('0x51'),'updatedAt']);_0x3824b7['body']=_[_0x31b8('0x50')](_0x3824b7[_0x31b8('0x47')],['id',_0x31b8('0x51'),_0x31b8('0x52')]);return db[_0x31b8('0x2b')][_0x31b8('0x46')](_[_0x31b8('0x3d')](_0x4d9207,_0x3824b7[_0x31b8('0x47')]),{'include':_0x3824b7['query'][_0x31b8('0x44')]?[{'all':!![]}]:undefined})[_0x31b8('0x22')](function(_0x2e5e72){var _0x4504ba=_0x3824b7['user'][_0x31b8('0x23')]({'plain':!![]});if(!_0x4504ba)throw new Error(_0x31b8('0x49'));if(_0x4504ba[_0x31b8('0x53')]===_0x31b8('0x48')){var _0x406bbf=_0x2e5e72['get']({'plain':!![]});var _0x80a80e=_0x31b8('0x4a');return db[_0x31b8('0x4b')][_0x31b8('0x45')]({'where':{'name':_0x80a80e,'userProfileId':_0x4504ba[_0x31b8('0x4c')]},'raw':!![]})[_0x31b8('0x22')](function(_0x1ad2c4){if(_0x1ad2c4&&_0x1ad2c4[_0x31b8('0x4d')]===0x0){return db['UserProfileResource'][_0x31b8('0x46')]({'name':_0x406bbf[_0x31b8('0x28')],'resourceId':_0x406bbf['id'],'type':_0x1ad2c4[_0x31b8('0x28')],'sectionId':_0x1ad2c4['id']},{})['then'](function(){return _0x2e5e72;});}else{return _0x2e5e72;}})[_0x31b8('0x41')](function(_0x75c619){logger[_0x31b8('0x26')](_0x31b8('0x4e'),_0x75c619);throw _0x75c619;});}return _0x2e5e72;});}})[_0x31b8('0x22')](respondWithResult(_0xb8aff8,0xc9))['catch'](handleError(_0xb8aff8,null));};exports['update']=function(_0x58398d,_0x106cc5){if(_0x58398d[_0x31b8('0x47')]['id']){delete _0x58398d['body']['id'];}return db[_0x31b8('0x2b')][_0x31b8('0x45')]({'where':{'id':_0x58398d['params']['id']}})[_0x31b8('0x22')](handleEntityNotFound(_0x106cc5,null))[_0x31b8('0x22')](saveUpdates(_0x58398d[_0x31b8('0x47')],null))[_0x31b8('0x22')](respondWithResult(_0x106cc5,null))[_0x31b8('0x41')](handleError(_0x106cc5,null));};exports[_0x31b8('0x25')]=function(_0x21e48c,_0x4c30af){return db['JscriptyProject'][_0x31b8('0x45')]({'where':{'id':_0x21e48c[_0x31b8('0x43')]['id']}})[_0x31b8('0x22')](handleEntityNotFound(_0x4c30af,null))[_0x31b8('0x22')](removeEntity(_0x4c30af,null))[_0x31b8('0x41')](handleError(_0x4c30af,null));};exports[_0x31b8('0x54')]=function(_0x5aab3a,_0x56398e,_0x2a0990){var _0x35c8c7={'raw':!![],'where':{}};var _0x385774={};var _0x553348={'count':0x0,'rows':[]};return db[_0x31b8('0x2b')][_0x31b8('0x55')]({'where':{'id':_0x5aab3a['params']['id']}})['then'](handleEntityNotFound(_0x56398e,null))[_0x31b8('0x22')](function(_0x5a04ff){if(_0x5a04ff){_0x385774[_0x31b8('0x2f')]=_[_0x31b8('0x30')](db[_0x31b8('0x56')][_0x31b8('0x2c')]);_0x385774[_0x31b8('0x31')]=_[_0x31b8('0x30')](_0x5aab3a[_0x31b8('0x31')]);_0x385774['filters']=_['intersection'](_0x385774['model'],_0x385774[_0x31b8('0x31')]);_0x35c8c7[_0x31b8('0x32')]=_[_0x31b8('0x33')](_0x385774[_0x31b8('0x2f')],qs[_0x31b8('0x34')](_0x5aab3a[_0x31b8('0x31')]['fields']));_0x35c8c7[_0x31b8('0x32')]=_0x35c8c7[_0x31b8('0x32')][_0x31b8('0x35')]?_0x35c8c7[_0x31b8('0x32')]:_0x385774[_0x31b8('0x2f')];if(!_0x5aab3a['query']['hasOwnProperty'](_0x31b8('0x37'))){_0x35c8c7[_0x31b8('0x1c')]=qs[_0x31b8('0x1c')](_0x5aab3a['query'][_0x31b8('0x1c')]);_0x35c8c7[_0x31b8('0x1b')]=qs[_0x31b8('0x1b')](_0x5aab3a[_0x31b8('0x31')][_0x31b8('0x1b')]);}_0x35c8c7[_0x31b8('0x38')]=qs[_0x31b8('0x39')](_0x5aab3a[_0x31b8('0x31')][_0x31b8('0x39')]);_0x35c8c7[_0x31b8('0x3a')]=qs[_0x31b8('0x3b')](_[_0x31b8('0x57')](_0x5aab3a[_0x31b8('0x31')],_0x385774[_0x31b8('0x3b')]));_0x35c8c7[_0x31b8('0x3a')][_0x31b8('0x58')]=_0x5a04ff['id'];if(_0x5aab3a[_0x31b8('0x31')][_0x31b8('0x3c')]){_0x35c8c7['where']=_['merge'](_0x35c8c7[_0x31b8('0x3a')],{'$or':_[_0x31b8('0x2a')](_0x35c8c7[_0x31b8('0x32')],function(_0x29654d){var _0x1e9759={};_0x1e9759[_0x29654d]={'$like':'%'+_0x5aab3a[_0x31b8('0x31')][_0x31b8('0x3c')]+'%'};return _0x1e9759;})});}_0x35c8c7=_[_0x31b8('0x3d')]({},_0x35c8c7,_0x5aab3a[_0x31b8('0x3e')]);return db[_0x31b8('0x56')][_0x31b8('0x3f')]({'where':_0x35c8c7[_0x31b8('0x3a')]})[_0x31b8('0x22')](function(_0x20d8b4){_0x553348[_0x31b8('0x3f')]=_0x20d8b4;if(_0x5aab3a[_0x31b8('0x31')][_0x31b8('0x44')]){_0x35c8c7[_0x31b8('0x40')]=[{'all':!![]}];}return db[_0x31b8('0x56')]['findAll'](_0x35c8c7);})[_0x31b8('0x22')](function(_0x2a6264){_0x553348[_0x31b8('0x59')]=_0x2a6264;return _0x553348;});}})[_0x31b8('0x22')](respondWithFilteredResult(_0x56398e,_0x35c8c7))['catch'](handleError(_0x56398e,null));};exports['getAnswers']=function(_0x5572db,_0x269468,_0x4316d2){var _0x2f8f55={'raw':!![],'where':{}};var _0x5c0e02={};var _0x38f4f8={'count':0x0,'rows':[]};return db[_0x31b8('0x2b')][_0x31b8('0x55')]({'where':{'id':_0x5572db['params']['id']}})[_0x31b8('0x22')](handleEntityNotFound(_0x269468,null))[_0x31b8('0x22')](function(_0xdf2f2){if(_0xdf2f2){_0x5c0e02[_0x31b8('0x2f')]=_[_0x31b8('0x30')](db['JscriptyAnswerReport'][_0x31b8('0x2c')]);_0x5c0e02[_0x31b8('0x31')]=_[_0x31b8('0x30')](_0x5572db[_0x31b8('0x31')]);_0x5c0e02[_0x31b8('0x3b')]=_['intersection'](_0x5c0e02[_0x31b8('0x2f')],_0x5c0e02['query']);_0x2f8f55[_0x31b8('0x32')]=_[_0x31b8('0x33')](_0x5c0e02[_0x31b8('0x2f')],qs[_0x31b8('0x34')](_0x5572db[_0x31b8('0x31')][_0x31b8('0x34')]));_0x2f8f55[_0x31b8('0x32')]=_0x2f8f55['attributes'][_0x31b8('0x35')]?_0x2f8f55[_0x31b8('0x32')]:_0x5c0e02[_0x31b8('0x2f')];if(!_0x5572db['query'][_0x31b8('0x36')]('nolimit')){_0x2f8f55[_0x31b8('0x1c')]=qs[_0x31b8('0x1c')](_0x5572db[_0x31b8('0x31')][_0x31b8('0x1c')]);_0x2f8f55[_0x31b8('0x1b')]=qs[_0x31b8('0x1b')](_0x5572db[_0x31b8('0x31')]['offset']);}_0x2f8f55[_0x31b8('0x38')]=qs['sort'](_0x5572db[_0x31b8('0x31')][_0x31b8('0x39')]);_0x2f8f55[_0x31b8('0x3a')]=qs[_0x31b8('0x3b')](_[_0x31b8('0x57')](_0x5572db[_0x31b8('0x31')],_0x5c0e02[_0x31b8('0x3b')]));_0x2f8f55[_0x31b8('0x3a')][_0x31b8('0x58')]=_0xdf2f2['id'];if(_0x5572db[_0x31b8('0x31')]['filter']){_0x2f8f55['where']=_[_0x31b8('0x3d')](_0x2f8f55['where'],{'$or':_['map'](_0x2f8f55['attributes'],function(_0x595d1a){var _0x265c4e={};_0x265c4e[_0x595d1a]={'$like':'%'+_0x5572db[_0x31b8('0x31')][_0x31b8('0x3c')]+'%'};return _0x265c4e;})});}_0x2f8f55=_[_0x31b8('0x3d')]({},_0x2f8f55,_0x5572db[_0x31b8('0x3e')]);return db[_0x31b8('0x5a')]['count']({'where':_0x2f8f55[_0x31b8('0x3a')]})['then'](function(_0x52eeda){_0x38f4f8[_0x31b8('0x3f')]=_0x52eeda;if(_0x5572db[_0x31b8('0x31')][_0x31b8('0x44')]){_0x2f8f55[_0x31b8('0x40')]=[{'all':!![]}];}return db[_0x31b8('0x5a')]['findAll'](_0x2f8f55);})['then'](function(_0x1473ee){_0x38f4f8[_0x31b8('0x59')]=_0x1473ee;return _0x38f4f8;});}})[_0x31b8('0x22')](respondWithFilteredResult(_0x269468,_0x2f8f55))[_0x31b8('0x41')](handleError(_0x269468,null));};function char(_0x13b70e){return _0x31b8('0x5b')===typeof _0x13b70e?String[_0x31b8('0x5c')][_0x31b8('0x1f')](null,arguments):_0x13b70e;}function needsEncapsulation(_0x47df70){return!!_0x47df70&&(_0x47df70[_0x31b8('0x5d')]()[_0x31b8('0x5e')](char(0xd))>=0x0||_0x47df70['toString']()[_0x31b8('0x5e')](char(0xa))>=0x0||_0x47df70[_0x31b8('0x5d')]()['indexOf'](char(0x2c))>=0x0||_0x47df70[_0x31b8('0x5d')]()[_0x31b8('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x4d60e3){var _0x37c21d=char(0x22),_0x4aa32a='\x5c'+char(0x22),_0x514fc0=_0x4d60e3[_0x31b8('0x5d')]()['replace'](new RegExp(_0x37c21d,'g'),_0x4aa32a);return _0x37c21d+_0x514fc0+_0x37c21d;}exports[_0x31b8('0x5f')]=function(_0x5475a4,_0x358ac5,_0x12567b){var _0x44c590,_0x2fcc21;var _0x261b1b={'where':{'ProjectId':_0x5475a4[_0x31b8('0x43')]['id']}};if(_0x5475a4[_0x31b8('0x31')][_0x31b8('0x60')]){_0x261b1b[_0x31b8('0x3a')][_0x31b8('0x61')]=JSON['parse'](_0x5475a4['query']['startTime']);}return db['JscriptySessionReport']['findAll'](_0x261b1b)[_0x31b8('0x22')](handleEntityNotFound(_0x358ac5,null))[_0x31b8('0x22')](function(_0x3f0f4f){if(_0x3f0f4f){_0x44c590=_0x3f0f4f;return db[_0x31b8('0x62')][_0x31b8('0x63')]({'where':{'SessionId':{'$in':_['map'](_0x44c590,'id')},'ProjectId':_0x5475a4[_0x31b8('0x43')]['id']},'order':_0x31b8('0x64')});}})[_0x31b8('0x22')](handleEntityNotFound(_0x358ac5,null))['then'](function(_0x204d80){if(_0x204d80){_0x2fcc21=_0x204d80;var _0x42b316={};for(var _0x350f45=0x0,_0x3052c1=_0x2fcc21['length'];_0x350f45<_0x3052c1;_0x350f45++){if(!_0x42b316['hasOwnProperty'](_0x2fcc21[_0x350f45][_0x31b8('0x65')])){_0x42b316[_0x2fcc21[_0x350f45][_0x31b8('0x65')]]=needsEncapsulation(_0x2fcc21[_0x350f45]['question'])?encapsulate(_0x2fcc21[_0x350f45][_0x31b8('0x66')]):_0x2fcc21[_0x350f45][_0x31b8('0x66')];}}var _0x5198a4=[],_0x545010={};for(var _0x4bf510=0x0,_0x35ccd1=_0x44c590[_0x31b8('0x35')];_0x4bf510<_0x35ccd1;_0x4bf510++){_0x545010={'ProjectId':_0x5475a4[_0x31b8('0x43')]['id'],'SessionId':_0x44c590[_0x4bf510]['id'],'StartTime':moment(_0x44c590[_0x4bf510][_0x31b8('0x61')])[_0x31b8('0x67')](_0x31b8('0x68'))};for(var _0x5926d1=0x0,_0x41a007=_0x2fcc21[_0x31b8('0x35')];_0x5926d1<_0x41a007;_0x5926d1++){if(_0x2fcc21[_0x5926d1][_0x31b8('0x69')]==_0x44c590[_0x4bf510]['id']&&_0x42b316['hasOwnProperty'](_0x2fcc21[_0x5926d1][_0x31b8('0x65')])){_0x545010[_0x42b316[_0x2fcc21[_0x5926d1][_0x31b8('0x65')]]]=_0x2fcc21[_0x5926d1][_0x31b8('0x6a')];}}for(var _0x2b6426 in _0x42b316){if(!_0x545010['hasOwnProperty'](_0x42b316[_0x2b6426])){_0x545010[_0x42b316[_0x2b6426]]=null;}}_0x5198a4[_0x31b8('0x6b')](_0x545010);}return _0x5198a4;}})[_0x31b8('0x22')](function(_0x1e8571){if(!_['isEmpty'](_0x1e8571)){var _0x301403=toCsv(_0x1e8571);var _0xaf61d1=Date[_0x31b8('0x6c')]();fs[_0x31b8('0x6d')](util[_0x31b8('0x67')](_0x31b8('0x6e'),_0x5475a4['params']['id'],_0xaf61d1),_0x301403);_0x358ac5['setHeader'](_0x31b8('0x6f'),'attachment;\x20filename='+util[_0x31b8('0x67')](_0x31b8('0x70'),_0x5475a4[_0x31b8('0x43')]['id'],_0xaf61d1));_0x358ac5[_0x31b8('0x71')](_0x31b8('0x72'),_0x31b8('0x73'));return _0x358ac5[_0x31b8('0x74')](util['format'](_0x31b8('0x6e'),_0x5475a4[_0x31b8('0x43')]['id'],_0xaf61d1));}else{return _0x358ac5[_0x31b8('0x17')](0xcc);}})[_0x31b8('0x41')](handleError(_0x358ac5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 08805e0..fede6fd 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 _0x7596=['api','moment','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','lodash','util','../../config/logger'];(function(_0x4b7d02,_0xf0be5){var _0x5f409e=function(_0x3b0490){while(--_0x3b0490){_0x4b7d02['push'](_0x4b7d02['shift']());}};_0x5f409e(++_0xf0be5);}(_0x7596,0xa2));var _0x6759=function(_0x360dc2,_0x843dd0){_0x360dc2=_0x360dc2-0x0;var _0x32817d=_0x7596[_0x360dc2];return _0x32817d;};'use strict';var _=require(_0x6759('0x0'));var util=require(_0x6759('0x1'));var logger=require(_0x6759('0x2'))(_0x6759('0x3'));var moment=require(_0x6759('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6759('0x5'));var rimraf=require(_0x6759('0x6'));var config=require(_0x6759('0x7'));var attributes=require(_0x6759('0x8'));module[_0x6759('0x9')]=function(_0x2a44e8,_0x5291fd){return _0x2a44e8['define'](_0x6759('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4b7=['request-promise','path','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','bluebird'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xd4b7,0x69));var _0x7d4b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4b7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d4b('0x0'));var util=require(_0x7d4b('0x1'));var logger=require(_0x7d4b('0x2'))(_0x7d4b('0x3'));var moment=require('moment');var BPromise=require(_0x7d4b('0x4'));var rp=require(_0x7d4b('0x5'));var fs=require('fs');var path=require(_0x7d4b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0xb930f0,_0x1c0353){return _0xb930f0[_0x7d4b('0x7')](_0x7d4b('0x8'),attributes,{'tableName':_0x7d4b('0x9'),'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 e229709..0886c80 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 _0x036c=['error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','JscriptyProject,\x20%s,\x20%s','request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3c67a4,_0x502a4b){var _0x1f01dd=function(_0x243e8d){while(--_0x243e8d){_0x3c67a4['push'](_0x3c67a4['shift']());}};_0x1f01dd(++_0x502a4b);}(_0x036c,0x1d1));var _0xc036=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x036c[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0xc036('0x0'));var util=require(_0xc036('0x1'));var moment=require(_0xc036('0x2'));var BPromise=require(_0xc036('0x3'));var rs=require(_0xc036('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc036('0x5'))['db'];var utils=require(_0xc036('0x6'));var logger=require(_0xc036('0x7'))(_0xc036('0x8'));var config=require(_0xc036('0x9'));var jayson=require(_0xc036('0xa'));var client=jayson['client'][_0xc036('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x76c118,_0x502e27,_0x2a1a90){return new BPromise(function(_0x2de785,_0x1e50f1){return client[_0xc036('0xc')](_0x76c118,_0x2a1a90)[_0xc036('0xd')](function(_0x467443){logger['info'](_0xc036('0xe'),_0x502e27,_0xc036('0xf'));logger['debug'](_0xc036('0x10'),_0x502e27,_0xc036('0xf'),JSON[_0xc036('0x11')](_0x467443));if(_0x467443[_0xc036('0x12')]){if(_0x467443[_0xc036('0x12')]['code']===0x1f4){logger['error'](_0xc036('0xe'),_0x502e27,_0x467443[_0xc036('0x12')][_0xc036('0x13')]);return _0x1e50f1(_0x467443[_0xc036('0x12')][_0xc036('0x13')]);}logger['error'](_0xc036('0xe'),_0x502e27,_0x467443['error'][_0xc036('0x13')]);return _0x2de785(_0x467443[_0xc036('0x12')][_0xc036('0x13')]);}else{logger[_0xc036('0x14')](_0xc036('0xe'),_0x502e27,_0xc036('0xf'));_0x2de785(_0x467443[_0xc036('0x15')][_0xc036('0x13')]);}})[_0xc036('0x16')](function(_0xf70b53){logger['error'](_0xc036('0xe'),_0x502e27,_0xf70b53);_0x1e50f1(_0xf70b53);});});} \ No newline at end of file +var _0xa4da=['../../config/logger','rpc','jayson/promise','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x335a61,_0x21b879){var _0x48a02b=function(_0x2978a8){while(--_0x2978a8){_0x335a61['push'](_0x335a61['shift']());}};_0x48a02b(++_0x21b879);}(_0xa4da,0x13e));var _0xaa4d=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0xa4da[_0x1df7b8];return _0x29d911;};'use strict';var _=require(_0xaa4d('0x0'));var util=require(_0xaa4d('0x1'));var moment=require(_0xaa4d('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa4d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa4d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa4d('0x5'))(_0xaa4d('0x6'));var config=require('../../config/environment');var jayson=require(_0xaa4d('0x7'));var client=jayson['client'][_0xaa4d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49419b,_0x5c50f2,_0x3ef0bd){return new BPromise(function(_0x86c96a,_0x54da21){return client[_0xaa4d('0x9')](_0x49419b,_0x3ef0bd)[_0xaa4d('0xa')](function(_0x5eadc6){logger[_0xaa4d('0xb')](_0xaa4d('0xc'),_0x5c50f2,_0xaa4d('0xd'));logger['debug']('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x5c50f2,_0xaa4d('0xd'),JSON[_0xaa4d('0xe')](_0x5eadc6));if(_0x5eadc6[_0xaa4d('0xf')]){if(_0x5eadc6[_0xaa4d('0xf')]['code']===0x1f4){logger[_0xaa4d('0xf')](_0xaa4d('0xc'),_0x5c50f2,_0x5eadc6[_0xaa4d('0xf')][_0xaa4d('0x10')]);return _0x54da21(_0x5eadc6[_0xaa4d('0xf')][_0xaa4d('0x10')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x5c50f2,_0x5eadc6[_0xaa4d('0xf')]['message']);return _0x86c96a(_0x5eadc6[_0xaa4d('0xf')][_0xaa4d('0x10')]);}else{logger[_0xaa4d('0xb')](_0xaa4d('0xc'),_0x5c50f2,_0xaa4d('0xd'));_0x86c96a(_0x5eadc6[_0xaa4d('0x11')][_0xaa4d('0x10')]);}})[_0xaa4d('0x12')](function(_0x4e8f42){logger[_0xaa4d('0xf')](_0xaa4d('0xc'),_0x5c50f2,_0x4e8f42);_0x54da21(_0x4e8f42);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index a506980..d9e5bd8 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 _0x6414=['get','/describe','isAuthenticated','/:id','show','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x6414,0x1a8));var _0x4641=function(_0x55f166,_0xa891e9){_0x55f166=_0x55f166-0x0;var _0x34b76f=_0x6414[_0x55f166];return _0x34b76f;};'use strict';var multer=require(_0x4641('0x0'));var util=require('util');var path=require(_0x4641('0x1'));var timeout=require(_0x4641('0x2'));var express=require(_0x4641('0x3'));var router=express[_0x4641('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4641('0x5'));var config=require(_0x4641('0x6'));var controller=require(_0x4641('0x7'));router[_0x4641('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4641('0x8')](_0x4641('0x9'),auth[_0x4641('0xa')](),controller['describe']);router[_0x4641('0x8')](_0x4641('0xb'),auth[_0x4641('0xa')](),controller[_0x4641('0xc')]);router[_0x4641('0xd')]('/',auth['isAuthenticated'](),controller[_0x4641('0xe')]);router['put'](_0x4641('0xb'),auth[_0x4641('0xa')](),controller['update']);router[_0x4641('0xf')](_0x4641('0xb'),auth[_0x4641('0xa')](),controller[_0x4641('0x10')]);module[_0x4641('0x11')]=router; \ No newline at end of file +var _0x0cf8=['put','delete','destroy','exports','multer','util','path','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/:id','show'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0x0cf8,0x154));var _0x80cf=function(_0x342599,_0x2ce4a0){_0x342599=_0x342599-0x0;var _0x246737=_0x0cf8[_0x342599];return _0x246737;};'use strict';var multer=require(_0x80cf('0x0'));var util=require(_0x80cf('0x1'));var path=require(_0x80cf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x80cf('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x80cf('0x4'));var controller=require(_0x80cf('0x5'));router[_0x80cf('0x6')]('/',auth[_0x80cf('0x7')](),controller['index']);router['get']('/describe',auth[_0x80cf('0x7')](),controller['describe']);router['get'](_0x80cf('0x8'),auth['isAuthenticated'](),controller[_0x80cf('0x9')]);router['post']('/',auth[_0x80cf('0x7')](),controller['create']);router[_0x80cf('0xa')](_0x80cf('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x80cf('0xb')](_0x80cf('0x8'),auth[_0x80cf('0x7')](),controller[_0x80cf('0xc')]);module[_0x80cf('0xd')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 0684bad..cf14938 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 _0x322c=['TEXT','long','STRING','sequelize'];(function(_0x515b31,_0x2574ec){var _0x3ca292=function(_0x1b9c2c){while(--_0x1b9c2c){_0x515b31['push'](_0x515b31['shift']());}};_0x3ca292(++_0x2574ec);}(_0x322c,0x143));var _0xc322=function(_0x41a58d,_0x139979){_0x41a58d=_0x41a58d-0x0;var _0x4709aa=_0x322c[_0x41a58d];return _0x4709aa;};'use strict';var Sequelize=require(_0xc322('0x0'));module['exports']={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xc322('0x1')](_0xc322('0x2'))},'membername':{'type':Sequelize[_0xc322('0x3')]},'projectname':{'type':Sequelize[_0xc322('0x3')]},'queue':{'type':Sequelize[_0xc322('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc322('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xc322('0x3')]}}; \ No newline at end of file +var _0xa1c3=['STRING','TEXT','long','exports'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa1c3,0x97));var _0x3a1c=function(_0x1639d7,_0x32b4a0){_0x1639d7=_0x1639d7-0x0;var _0x2b6998=_0xa1c3[_0x1639d7];return _0x2b6998;};'use strict';var Sequelize=require('sequelize');module[_0x3a1c('0x0')]={'question':{'type':Sequelize[_0x3a1c('0x1')]},'answer':{'type':Sequelize[_0x3a1c('0x2')](_0x3a1c('0x3'))},'membername':{'type':Sequelize[_0x3a1c('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3a1c('0x1')]},'uniqueid':{'type':Sequelize[_0x3a1c('0x1')]},'calleridname':{'type':Sequelize[_0x3a1c('0x1')]},'calleridnum':{'type':Sequelize[_0x3a1c('0x1')]},'questionId':{'type':Sequelize[_0x3a1c('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 1b3fd0d..fcccdc9 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 _0x49c8=['offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','length','nolimit','limit','where','merge','VIRTUAL','filter','options','JscriptyQuestionReport','includeAll','findAll','rows','catch','show','fields','include','find','create','body','describe','html-pdf','eml-format','bluebird','mustache','util','path','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','json','count'];(function(_0x4f102c,_0x3e6fc0){var _0x21da1c=function(_0x266792){while(--_0x266792){_0x4f102c['push'](_0x4f102c['shift']());}};_0x21da1c(++_0x3e6fc0);}(_0x49c8,0x12f));var _0x849c=function(_0x2fb5fe,_0x452ede){_0x2fb5fe=_0x2fb5fe-0x0;var _0x4ccc60=_0x49c8[_0x2fb5fe];return _0x4ccc60;};'use strict';var pdf=require(_0x849c('0x0'));var emlformat=require(_0x849c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x849c('0x2'));var Mustache=require(_0x849c('0x3'));var util=require(_0x849c('0x4'));var path=require(_0x849c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x849c('0x6'));var squel=require(_0x849c('0x7'));var crypto=require('crypto');var jsforce=require(_0x849c('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x849c('0x9'));var querystring=require(_0x849c('0xa'));var Papa=require(_0x849c('0xb'));var Redis=require('ioredis');var authService=require(_0x849c('0xc'));var qs=require(_0x849c('0xd'));var as=require(_0x849c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x849c('0xf'));var utils=require(_0x849c('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17c8c4,_0x24f3eb){_0x24f3eb=_0x24f3eb||0xcc;return function(_0x393b3d){if(_0x393b3d){return _0x17c8c4[_0x849c('0x11')](_0x24f3eb);}return _0x17c8c4[_0x849c('0x12')](_0x24f3eb)[_0x849c('0x13')]();};}function respondWithResult(_0x4852a1,_0x340c4e){_0x340c4e=_0x340c4e||0xc8;return function(_0x2a2580){if(_0x2a2580){return _0x4852a1[_0x849c('0x12')](_0x340c4e)[_0x849c('0x14')](_0x2a2580);}};}function respondWithFilteredResult(_0x55e0d3,_0x18d60a){return function(_0x1ddd54){if(_0x1ddd54){var _0x33ff39=_0x1ddd54[_0x849c('0x15')],_0x2503c4=_0x18d60a['offset'],_0xb92f93=_0x18d60a[_0x849c('0x16')]+_0x18d60a['limit'],_0x4a6f3e;if(_0xb92f93>=_0x33ff39){_0xb92f93=_0x33ff39;_0x4a6f3e=0xc8;}else{_0x4a6f3e=0xce;}_0x55e0d3[_0x849c('0x12')](_0x4a6f3e);return _0x55e0d3[_0x849c('0x17')](_0x849c('0x18'),_0x2503c4+'-'+_0xb92f93+'/'+_0x33ff39)[_0x849c('0x14')](_0x1ddd54);}return null;};}function patchUpdates(_0x52dfed){return function(_0x1bcff9){try{jsonpatch['apply'](_0x1bcff9,_0x52dfed,!![]);}catch(_0x5b1890){return BPromise[_0x849c('0x19')](_0x5b1890);}return _0x1bcff9[_0x849c('0x1a')]();};}function saveUpdates(_0xe9e38f,_0x3d3f55){return function(_0x40df30){if(_0x40df30){return _0x40df30[_0x849c('0x1b')](_0xe9e38f)[_0x849c('0x1c')](function(_0x123912){return _0x123912;});}return null;};}function removeEntity(_0x25815e,_0x2daeee){return function(_0x275e17){if(_0x275e17){return _0x275e17[_0x849c('0x1d')]()[_0x849c('0x1c')](function(){_0x25815e[_0x849c('0x12')](0xcc)[_0x849c('0x13')]();});}};}function handleEntityNotFound(_0xc20a4,_0x484b6b){return function(_0x938dd){if(!_0x938dd){_0xc20a4[_0x849c('0x11')](0x194);}return _0x938dd;};}function handleError(_0x592e4b,_0x5358cd){_0x5358cd=_0x5358cd||0x1f4;return function(_0xe679a8){logger[_0x849c('0x1e')](_0xe679a8[_0x849c('0x1f')]);if(_0xe679a8[_0x849c('0x20')]){delete _0xe679a8[_0x849c('0x20')];}_0x592e4b[_0x849c('0x12')](_0x5358cd)['send'](_0xe679a8);};}exports[_0x849c('0x21')]=function(_0x3d0c08,_0x437883){var _0x4ccaef={},_0x49b66e={},_0x412ee2={'count':0x0,'rows':[]};var _0x3c11ee=_[_0x849c('0x22')](db['JscriptyQuestionReport'][_0x849c('0x23')],function(_0x43a4f3){return{'name':_0x43a4f3[_0x849c('0x24')],'type':_0x43a4f3[_0x849c('0x25')][_0x849c('0x26')]};});_0x49b66e['model']=_[_0x849c('0x22')](_0x3c11ee,'name');_0x49b66e[_0x849c('0x27')]=_[_0x849c('0x28')](_0x3d0c08[_0x849c('0x27')]);_0x49b66e[_0x849c('0x29')]=_['intersection'](_0x49b66e[_0x849c('0x2a')],_0x49b66e[_0x849c('0x27')]);_0x4ccaef[_0x849c('0x2b')]=_[_0x849c('0x2c')](_0x49b66e[_0x849c('0x2a')],qs['fields'](_0x3d0c08[_0x849c('0x27')]['fields']));_0x4ccaef['attributes']=_0x4ccaef[_0x849c('0x2b')][_0x849c('0x2d')]?_0x4ccaef['attributes']:_0x49b66e['model'];if(!_0x3d0c08[_0x849c('0x27')]['hasOwnProperty'](_0x849c('0x2e'))){_0x4ccaef['limit']=qs[_0x849c('0x2f')](_0x3d0c08[_0x849c('0x27')][_0x849c('0x2f')]);_0x4ccaef[_0x849c('0x16')]=qs['offset'](_0x3d0c08[_0x849c('0x27')]['offset']);}_0x4ccaef['order']=qs['sort'](_0x3d0c08['query']['sort']);_0x4ccaef[_0x849c('0x30')]=qs[_0x849c('0x29')](_['pick'](_0x3d0c08[_0x849c('0x27')],_0x49b66e[_0x849c('0x29')]));if(_0x3d0c08[_0x849c('0x27')]['filter']){_0x4ccaef['where']=_[_0x849c('0x31')](_0x4ccaef[_0x849c('0x30')],{'$or':_[_0x849c('0x22')](_0x3c11ee,function(_0x577699){if(_0x577699['type']!==_0x849c('0x32')){var _0x4c3ad1={};_0x4c3ad1[_0x577699[_0x849c('0x20')]]={'$like':'%'+_0x3d0c08['query'][_0x849c('0x33')]+'%'};return _0x4c3ad1;}})});}_0x4ccaef=_[_0x849c('0x31')]({},_0x4ccaef,_0x3d0c08[_0x849c('0x34')]);var _0x1cb3e={'where':_0x4ccaef[_0x849c('0x30')]};return db[_0x849c('0x35')][_0x849c('0x15')](_0x1cb3e)[_0x849c('0x1c')](function(_0x59408f){_0x412ee2[_0x849c('0x15')]=_0x59408f;if(_0x3d0c08[_0x849c('0x27')][_0x849c('0x36')]){_0x4ccaef['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x849c('0x37')](_0x4ccaef);})[_0x849c('0x1c')](function(_0x361599){_0x412ee2[_0x849c('0x38')]=_0x361599;return _0x412ee2;})[_0x849c('0x1c')](respondWithFilteredResult(_0x437883,_0x4ccaef))[_0x849c('0x39')](handleError(_0x437883,null));};exports[_0x849c('0x3a')]=function(_0x565db8,_0x119659){var _0x1707a1={'raw':!![],'where':{'id':_0x565db8['params']['id']}},_0x340784={};_0x340784[_0x849c('0x2a')]=_[_0x849c('0x28')](db[_0x849c('0x35')]['rawAttributes']);_0x340784['query']=_['keys'](_0x565db8[_0x849c('0x27')]);_0x340784[_0x849c('0x29')]=_['intersection'](_0x340784[_0x849c('0x2a')],_0x340784[_0x849c('0x27')]);_0x1707a1[_0x849c('0x2b')]=_[_0x849c('0x2c')](_0x340784[_0x849c('0x2a')],qs[_0x849c('0x3b')](_0x565db8[_0x849c('0x27')][_0x849c('0x3b')]));_0x1707a1[_0x849c('0x2b')]=_0x1707a1['attributes'][_0x849c('0x2d')]?_0x1707a1[_0x849c('0x2b')]:_0x340784['model'];if(_0x565db8[_0x849c('0x27')][_0x849c('0x36')]){_0x1707a1[_0x849c('0x3c')]=[{'all':!![]}];}_0x1707a1=_[_0x849c('0x31')]({},_0x1707a1,_0x565db8['options']);return db['JscriptyQuestionReport'][_0x849c('0x3d')](_0x1707a1)[_0x849c('0x1c')](handleEntityNotFound(_0x119659,null))[_0x849c('0x1c')](respondWithResult(_0x119659,null))[_0x849c('0x39')](handleError(_0x119659,null));};exports[_0x849c('0x3e')]=function(_0x5f1e27,_0x3d196c){return db[_0x849c('0x35')][_0x849c('0x3e')](_0x5f1e27['body'],{})[_0x849c('0x1c')](respondWithResult(_0x3d196c,0xc9))[_0x849c('0x39')](handleError(_0x3d196c,null));};exports[_0x849c('0x1b')]=function(_0x4daf88,_0x292130){if(_0x4daf88['body']['id']){delete _0x4daf88[_0x849c('0x3f')]['id'];}return db[_0x849c('0x35')][_0x849c('0x3d')]({'where':{'id':_0x4daf88['params']['id']}})[_0x849c('0x1c')](handleEntityNotFound(_0x292130,null))['then'](saveUpdates(_0x4daf88[_0x849c('0x3f')],null))[_0x849c('0x1c')](respondWithResult(_0x292130,null))['catch'](handleError(_0x292130,null));};exports[_0x849c('0x1d')]=function(_0x43c5fc,_0x1248e2){return db[_0x849c('0x35')]['find']({'where':{'id':_0x43c5fc['params']['id']}})[_0x849c('0x1c')](handleEntityNotFound(_0x1248e2,null))[_0x849c('0x1c')](removeEntity(_0x1248e2,null))[_0x849c('0x39')](handleError(_0x1248e2,null));};exports[_0x849c('0x40')]=function(_0x9c8e73,_0x91e5ea){return db['JscriptyQuestionReport']['describe']()['then'](respondWithResult(_0x91e5ea,null))[_0x849c('0x39')](handleError(_0x91e5ea,null));}; \ No newline at end of file +var _0xa912=['moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','stack','name','index','map','JscriptyQuestionReport','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch'];(function(_0xccf869,_0x2556a5){var _0x21a9db=function(_0xcc4835){while(--_0xcc4835){_0xccf869['push'](_0xccf869['shift']());}};_0x21a9db(++_0x2556a5);}(_0xa912,0xd4));var _0x2a91=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xa912[_0x5f09c5];return _0x426ad9;};'use strict';var pdf=require(_0x2a91('0x0'));var emlformat=require(_0x2a91('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2a91('0x2'));var jsonpatch=require(_0x2a91('0x3'));var rp=require('request-promise');var moment=require(_0x2a91('0x4'));var BPromise=require(_0x2a91('0x5'));var Mustache=require(_0x2a91('0x6'));var util=require(_0x2a91('0x7'));var path=require(_0x2a91('0x8'));var sox=require('sox');var csv=require(_0x2a91('0x9'));var ejs=require(_0x2a91('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2a91('0xb'));var crypto=require(_0x2a91('0xc'));var jsforce=require(_0x2a91('0xd'));var deskjs=require(_0x2a91('0xe'));var toCsv=require(_0x2a91('0x9'));var querystring=require(_0x2a91('0xf'));var Papa=require('papaparse');var Redis=require(_0x2a91('0x10'));var authService=require(_0x2a91('0x11'));var qs=require(_0x2a91('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a91('0x13'));var logger=require(_0x2a91('0x14'))(_0x2a91('0x15'));var utils=require(_0x2a91('0x16'));var config=require(_0x2a91('0x17'));var db=require(_0x2a91('0x18'))['db'];function respondWithStatusCode(_0x553536,_0x4fdd75){_0x4fdd75=_0x4fdd75||0xcc;return function(_0x225f19){if(_0x225f19){return _0x553536[_0x2a91('0x19')](_0x4fdd75);}return _0x553536[_0x2a91('0x1a')](_0x4fdd75)[_0x2a91('0x1b')]();};}function respondWithResult(_0x3a6ffe,_0x41a56c){_0x41a56c=_0x41a56c||0xc8;return function(_0x3d7e65){if(_0x3d7e65){return _0x3a6ffe[_0x2a91('0x1a')](_0x41a56c)[_0x2a91('0x1c')](_0x3d7e65);}};}function respondWithFilteredResult(_0x3d760a,_0x129fc7){return function(_0x35ec68){if(_0x35ec68){var _0x2336ca=_0x35ec68[_0x2a91('0x1d')],_0x2c16fe=_0x129fc7[_0x2a91('0x1e')],_0x26eb2c=_0x129fc7[_0x2a91('0x1e')]+_0x129fc7[_0x2a91('0x1f')],_0x216845;if(_0x26eb2c>=_0x2336ca){_0x26eb2c=_0x2336ca;_0x216845=0xc8;}else{_0x216845=0xce;}_0x3d760a[_0x2a91('0x1a')](_0x216845);return _0x3d760a[_0x2a91('0x20')](_0x2a91('0x21'),_0x2c16fe+'-'+_0x26eb2c+'/'+_0x2336ca)[_0x2a91('0x1c')](_0x35ec68);}return null;};}function patchUpdates(_0x4c9d66){return function(_0x51f8d4){try{jsonpatch['apply'](_0x51f8d4,_0x4c9d66,!![]);}catch(_0xebd973){return BPromise[_0x2a91('0x22')](_0xebd973);}return _0x51f8d4[_0x2a91('0x23')]();};}function saveUpdates(_0x3a20cb,_0x161ab1){return function(_0x4faa67){if(_0x4faa67){return _0x4faa67['update'](_0x3a20cb)[_0x2a91('0x24')](function(_0x5e6ed5){return _0x5e6ed5;});}return null;};}function removeEntity(_0x9ff4a8,_0x3767d0){return function(_0x232b56){if(_0x232b56){return _0x232b56[_0x2a91('0x25')]()[_0x2a91('0x24')](function(){_0x9ff4a8[_0x2a91('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2966dc,_0x24d548){return function(_0x520a3d){if(!_0x520a3d){_0x2966dc[_0x2a91('0x19')](0x194);}return _0x520a3d;};}function handleError(_0x228d0d,_0x31ecfe){_0x31ecfe=_0x31ecfe||0x1f4;return function(_0x35b5e4){logger['error'](_0x35b5e4[_0x2a91('0x26')]);if(_0x35b5e4[_0x2a91('0x27')]){delete _0x35b5e4['name'];}_0x228d0d[_0x2a91('0x1a')](_0x31ecfe)['send'](_0x35b5e4);};}exports[_0x2a91('0x28')]=function(_0x31a5f5,_0x99fb41){var _0x38595c={},_0x49ec3a={},_0x328b6c={'count':0x0,'rows':[]};var _0x505847=_[_0x2a91('0x29')](db[_0x2a91('0x2a')]['rawAttributes'],function(_0x5264a3){return{'name':_0x5264a3[_0x2a91('0x2b')],'type':_0x5264a3[_0x2a91('0x2c')][_0x2a91('0x2d')]};});_0x49ec3a[_0x2a91('0x2e')]=_['map'](_0x505847,'name');_0x49ec3a['query']=_[_0x2a91('0x2f')](_0x31a5f5[_0x2a91('0x30')]);_0x49ec3a['filters']=_[_0x2a91('0x31')](_0x49ec3a[_0x2a91('0x2e')],_0x49ec3a[_0x2a91('0x30')]);_0x38595c[_0x2a91('0x32')]=_[_0x2a91('0x31')](_0x49ec3a[_0x2a91('0x2e')],qs[_0x2a91('0x33')](_0x31a5f5[_0x2a91('0x30')][_0x2a91('0x33')]));_0x38595c['attributes']=_0x38595c[_0x2a91('0x32')][_0x2a91('0x34')]?_0x38595c[_0x2a91('0x32')]:_0x49ec3a[_0x2a91('0x2e')];if(!_0x31a5f5['query']['hasOwnProperty'](_0x2a91('0x35'))){_0x38595c['limit']=qs[_0x2a91('0x1f')](_0x31a5f5[_0x2a91('0x30')][_0x2a91('0x1f')]);_0x38595c[_0x2a91('0x1e')]=qs[_0x2a91('0x1e')](_0x31a5f5[_0x2a91('0x30')][_0x2a91('0x1e')]);}_0x38595c[_0x2a91('0x36')]=qs[_0x2a91('0x37')](_0x31a5f5[_0x2a91('0x30')][_0x2a91('0x37')]);_0x38595c[_0x2a91('0x38')]=qs[_0x2a91('0x39')](_[_0x2a91('0x3a')](_0x31a5f5[_0x2a91('0x30')],_0x49ec3a['filters']));if(_0x31a5f5['query']['filter']){_0x38595c[_0x2a91('0x38')]=_['merge'](_0x38595c[_0x2a91('0x38')],{'$or':_[_0x2a91('0x29')](_0x505847,function(_0x208557){if(_0x208557[_0x2a91('0x2c')]!==_0x2a91('0x3b')){var _0x35cb8c={};_0x35cb8c[_0x208557[_0x2a91('0x27')]]={'$like':'%'+_0x31a5f5[_0x2a91('0x30')][_0x2a91('0x3c')]+'%'};return _0x35cb8c;}})});}_0x38595c=_[_0x2a91('0x3d')]({},_0x38595c,_0x31a5f5[_0x2a91('0x3e')]);var _0x8c3aad={'where':_0x38595c['where']};return db['JscriptyQuestionReport']['count'](_0x8c3aad)[_0x2a91('0x24')](function(_0x3d7148){_0x328b6c['count']=_0x3d7148;if(_0x31a5f5[_0x2a91('0x30')][_0x2a91('0x3f')]){_0x38595c[_0x2a91('0x40')]=[{'all':!![]}];}return db[_0x2a91('0x2a')][_0x2a91('0x41')](_0x38595c);})['then'](function(_0x5d00fc){_0x328b6c['rows']=_0x5d00fc;return _0x328b6c;})[_0x2a91('0x24')](respondWithFilteredResult(_0x99fb41,_0x38595c))[_0x2a91('0x42')](handleError(_0x99fb41,null));};exports['show']=function(_0x3583a4,_0x32b45a){var _0x207f25={'raw':!![],'where':{'id':_0x3583a4[_0x2a91('0x43')]['id']}},_0x1b9ac2={};_0x1b9ac2[_0x2a91('0x2e')]=_[_0x2a91('0x2f')](db['JscriptyQuestionReport']['rawAttributes']);_0x1b9ac2[_0x2a91('0x30')]=_[_0x2a91('0x2f')](_0x3583a4[_0x2a91('0x30')]);_0x1b9ac2['filters']=_[_0x2a91('0x31')](_0x1b9ac2[_0x2a91('0x2e')],_0x1b9ac2[_0x2a91('0x30')]);_0x207f25['attributes']=_[_0x2a91('0x31')](_0x1b9ac2[_0x2a91('0x2e')],qs[_0x2a91('0x33')](_0x3583a4[_0x2a91('0x30')]['fields']));_0x207f25[_0x2a91('0x32')]=_0x207f25[_0x2a91('0x32')][_0x2a91('0x34')]?_0x207f25[_0x2a91('0x32')]:_0x1b9ac2[_0x2a91('0x2e')];if(_0x3583a4[_0x2a91('0x30')][_0x2a91('0x3f')]){_0x207f25[_0x2a91('0x40')]=[{'all':!![]}];}_0x207f25=_['merge']({},_0x207f25,_0x3583a4['options']);return db[_0x2a91('0x2a')]['find'](_0x207f25)['then'](handleEntityNotFound(_0x32b45a,null))['then'](respondWithResult(_0x32b45a,null))['catch'](handleError(_0x32b45a,null));};exports['create']=function(_0x6745e0,_0x206122){return db['JscriptyQuestionReport'][_0x2a91('0x44')](_0x6745e0[_0x2a91('0x45')],{})['then'](respondWithResult(_0x206122,0xc9))[_0x2a91('0x42')](handleError(_0x206122,null));};exports['update']=function(_0x57fc92,_0x4fc3da){if(_0x57fc92['body']['id']){delete _0x57fc92['body']['id'];}return db[_0x2a91('0x2a')][_0x2a91('0x46')]({'where':{'id':_0x57fc92[_0x2a91('0x43')]['id']}})[_0x2a91('0x24')](handleEntityNotFound(_0x4fc3da,null))[_0x2a91('0x24')](saveUpdates(_0x57fc92[_0x2a91('0x45')],null))['then'](respondWithResult(_0x4fc3da,null))[_0x2a91('0x42')](handleError(_0x4fc3da,null));};exports[_0x2a91('0x25')]=function(_0x279129,_0x5225a2){return db[_0x2a91('0x2a')]['find']({'where':{'id':_0x279129[_0x2a91('0x43')]['id']}})['then'](handleEntityNotFound(_0x5225a2,null))[_0x2a91('0x24')](removeEntity(_0x5225a2,null))[_0x2a91('0x42')](handleError(_0x5225a2,null));};exports[_0x2a91('0x47')]=function(_0x2a196b,_0x1392e5){return db[_0x2a91('0x2a')]['describe']()[_0x2a91('0x24')](respondWithResult(_0x1392e5,null))['catch'](handleError(_0x1392e5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 47b492c..9219dc6 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 _0x32d3=['JscriptyQuestionReport','util','api','moment','path','rimraf','./jscriptyQuestionReport.attributes','exports','define'];(function(_0xc2852f,_0x4a8a7d){var _0x491a39=function(_0x14ad03){while(--_0x14ad03){_0xc2852f['push'](_0xc2852f['shift']());}};_0x491a39(++_0x4a8a7d);}(_0x32d3,0xc7));var _0x332d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32d3[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x332d('0x0'));var logger=require('../../config/logger')(_0x332d('0x1'));var moment=require(_0x332d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x332d('0x3'));var rimraf=require(_0x332d('0x4'));var config=require('../../config/environment');var attributes=require(_0x332d('0x5'));module[_0x332d('0x6')]=function(_0x3bbd96,_0x41fcca){return _0x3bbd96[_0x332d('0x7')](_0x332d('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc35e=['define','JscriptyQuestionReport','report_jscripty_questions','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x2ff9e8,_0x173f25){var _0xd14aed=function(_0x58a090){while(--_0x58a090){_0x2ff9e8['push'](_0x2ff9e8['shift']());}};_0xd14aed(++_0x173f25);}(_0xc35e,0x14d));var _0xec35=function(_0x2eea9a,_0x368daf){_0x2eea9a=_0x2eea9a-0x0;var _0x1ec61e=_0xc35e[_0x2eea9a];return _0x1ec61e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xec35('0x0'));var moment=require(_0xec35('0x1'));var BPromise=require(_0xec35('0x2'));var rp=require(_0xec35('0x3'));var fs=require('fs');var path=require(_0xec35('0x4'));var rimraf=require(_0xec35('0x5'));var config=require(_0xec35('0x6'));var attributes=require(_0xec35('0x7'));module['exports']=function(_0x42876d,_0x37bdaa){return _0x42876d[_0xec35('0x8')](_0xec35('0x9'),attributes,{'tableName':_0xec35('0xa'),'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 18fee45..e81b972 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 _0x7d7a=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7d7a,0x1e3));var _0xa7d7=function(_0x49035f,_0x63a7a5){_0x49035f=_0x49035f-0x0;var _0x35f482=_0x7d7a[_0x49035f];return _0x35f482;};'use strict';var _=require(_0xa7d7('0x0'));var util=require(_0xa7d7('0x1'));var moment=require(_0xa7d7('0x2'));var BPromise=require(_0xa7d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa7d7('0x4'));var db=require(_0xa7d7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7d7('0x6'))(_0xa7d7('0x7'));var config=require(_0xa7d7('0x8'));var jayson=require(_0xa7d7('0x9'));var client=jayson[_0xa7d7('0xa')][_0xa7d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ddaf6,_0x5897fe,_0x677d3e){return new BPromise(function(_0x1319ff,_0x6c1f6f){return client[_0xa7d7('0xc')](_0x4ddaf6,_0x677d3e)[_0xa7d7('0xd')](function(_0xb253f9){logger[_0xa7d7('0xe')](_0xa7d7('0xf'),_0x5897fe,'request\x20sent');logger[_0xa7d7('0x10')](_0xa7d7('0x11'),_0x5897fe,_0xa7d7('0x12'),JSON['stringify'](_0xb253f9));if(_0xb253f9[_0xa7d7('0x13')]){if(_0xb253f9[_0xa7d7('0x13')][_0xa7d7('0x14')]===0x1f4){logger[_0xa7d7('0x13')](_0xa7d7('0xf'),_0x5897fe,_0xb253f9[_0xa7d7('0x13')][_0xa7d7('0x15')]);return _0x6c1f6f(_0xb253f9['error'][_0xa7d7('0x15')]);}logger[_0xa7d7('0x13')](_0xa7d7('0xf'),_0x5897fe,_0xb253f9[_0xa7d7('0x13')][_0xa7d7('0x15')]);return _0x1319ff(_0xb253f9[_0xa7d7('0x13')]['message']);}else{logger[_0xa7d7('0xe')](_0xa7d7('0xf'),_0x5897fe,'request\x20sent');_0x1319ff(_0xb253f9[_0xa7d7('0x16')][_0xa7d7('0x15')]);}})[_0xa7d7('0x17')](function(_0x13eceb){logger[_0xa7d7('0x13')](_0xa7d7('0xf'),_0x5897fe,_0x13eceb);_0x6c1f6f(_0x13eceb);});});} \ No newline at end of file +var _0x40bb=['../../config/utils','../../config/environment','jayson/promise','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','util','moment','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40bb,0x94));var _0xb40b=function(_0x1939cf,_0x54a7dd){_0x1939cf=_0x1939cf-0x0;var _0x364eb8=_0x40bb[_0x1939cf];return _0x364eb8;};'use strict';var _=require('lodash');var util=require(_0xb40b('0x0'));var moment=require(_0xb40b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb40b('0x2'));var db=require(_0xb40b('0x3'))['db'];var utils=require(_0xb40b('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb40b('0x5'));var jayson=require(_0xb40b('0x6'));var client=jayson['client'][_0xb40b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44086c,_0x2d2942,_0x3c4595){return new BPromise(function(_0x4d3d11,_0x4a7d11){return client[_0xb40b('0x8')](_0x44086c,_0x3c4595)[_0xb40b('0x9')](function(_0x46b389){logger['info'](_0xb40b('0xa'),_0x2d2942,_0xb40b('0xb'));logger[_0xb40b('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2d2942,_0xb40b('0xb'),JSON[_0xb40b('0xd')](_0x46b389));if(_0x46b389[_0xb40b('0xe')]){if(_0x46b389[_0xb40b('0xe')][_0xb40b('0xf')]===0x1f4){logger[_0xb40b('0xe')](_0xb40b('0xa'),_0x2d2942,_0x46b389[_0xb40b('0xe')][_0xb40b('0x10')]);return _0x4a7d11(_0x46b389[_0xb40b('0xe')]['message']);}logger[_0xb40b('0xe')](_0xb40b('0xa'),_0x2d2942,_0x46b389['error'][_0xb40b('0x10')]);return _0x4d3d11(_0x46b389[_0xb40b('0xe')][_0xb40b('0x10')]);}else{logger[_0xb40b('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2d2942,_0xb40b('0xb'));_0x4d3d11(_0x46b389[_0xb40b('0x12')][_0xb40b('0x10')]);}})['catch'](function(_0x47af72){logger[_0xb40b('0xe')](_0xb40b('0xa'),_0x2d2942,_0x47af72);_0x4a7d11(_0x47af72);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index baebc43..5102516 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 _0x6bac=['./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','describe','show','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x6bac,0xa5));var _0xc6ba=function(_0x575be5,_0x5c45f2){_0x575be5=_0x575be5-0x0;var _0x37e972=_0x6bac[_0x575be5];return _0x37e972;};'use strict';var multer=require(_0xc6ba('0x0'));var util=require('util');var path=require(_0xc6ba('0x1'));var timeout=require(_0xc6ba('0x2'));var express=require(_0xc6ba('0x3'));var router=express[_0xc6ba('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc6ba('0x5'));router[_0xc6ba('0x6')]('/',auth['isAuthenticated'](),controller[_0xc6ba('0x7')]);router[_0xc6ba('0x6')](_0xc6ba('0x8'),auth[_0xc6ba('0x9')](),controller[_0xc6ba('0xa')]);router[_0xc6ba('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xc6ba('0xb')]);router['get']('/:id/questions',auth['isAuthenticated'](),controller['getQuestions']);router['post']('/',auth[_0xc6ba('0x9')](),controller[_0xc6ba('0xc')]);router[_0xc6ba('0xd')](_0xc6ba('0xe'),auth[_0xc6ba('0x9')](),controller['update']);router['delete'](_0xc6ba('0xe'),auth[_0xc6ba('0x9')](),controller[_0xc6ba('0xf')]);module[_0xc6ba('0x10')]=router; \ No newline at end of file +var _0x984b=['/:id','show','/:id/questions','getQuestions','post','create','put','update','destroy','exports','connect-timeout','express','Router','../../config/environment','./jscriptySessionReport.controller','index','get','isAuthenticated','describe'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x984b,0xee));var _0xb984=function(_0x28622b,_0x5c2a42){_0x28622b=_0x28622b-0x0;var _0x2bd433=_0x984b[_0x28622b];return _0x2bd433;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb984('0x0'));var express=require(_0xb984('0x1'));var router=express[_0xb984('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb984('0x3'));var controller=require(_0xb984('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xb984('0x5')]);router[_0xb984('0x6')]('/describe',auth[_0xb984('0x7')](),controller[_0xb984('0x8')]);router['get'](_0xb984('0x9'),auth['isAuthenticated'](),controller[_0xb984('0xa')]);router[_0xb984('0x6')](_0xb984('0xb'),auth[_0xb984('0x7')](),controller[_0xb984('0xc')]);router[_0xb984('0xd')]('/',auth[_0xb984('0x7')](),controller[_0xb984('0xe')]);router[_0xb984('0xf')](_0xb984('0x9'),auth[_0xb984('0x7')](),controller[_0xb984('0x10')]);router['delete'](_0xb984('0x9'),auth['isAuthenticated'](),controller[_0xb984('0x11')]);module[_0xb984('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 5be5aa2..90aa286 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 _0x8441=['DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports'];(function(_0x36263f,_0x1e71a1){var _0x2b9530=function(_0x24ceb7){while(--_0x24ceb7){_0x36263f['push'](_0x36263f['shift']());}};_0x2b9530(++_0x1e71a1);}(_0x8441,0xd0));var _0x1844=function(_0xc3c363,_0x3030f3){_0xc3c363=_0xc3c363-0x0;var _0x1b7d07=_0x8441[_0xc3c363];return _0x1b7d07;};'use strict';var moment=require(_0x1844('0x0'));var Sequelize=require('sequelize');module[_0x1844('0x1')]={'starttime':{'type':Sequelize[_0x1844('0x2')],'set':function(_0x5d1976){this[_0x1844('0x3')](_0x1844('0x4'),_0x5d1976);this[_0x1844('0x3')](_0x1844('0x5'),moment()[_0x1844('0x6')](_0x1844('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x1844('0x8')]},'projectname':{'type':Sequelize[_0x1844('0x8')]},'queue':{'type':Sequelize[_0x1844('0x8')]},'uniqueid':{'type':Sequelize[_0x1844('0x8')]},'calleridname':{'type':Sequelize[_0x1844('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x1844('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x503d=['sequelize','exports','DATE','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment'];(function(_0x555069,_0x23d66a){var _0x100af7=function(_0x1606bd){while(--_0x1606bd){_0x555069['push'](_0x555069['shift']());}};_0x100af7(++_0x23d66a);}(_0x503d,0xe5));var _0xd503=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x503d[_0x40220a];return _0x3903cc;};'use strict';var moment=require(_0xd503('0x0'));var Sequelize=require(_0xd503('0x1'));module[_0xd503('0x2')]={'starttime':{'type':Sequelize[_0xd503('0x3')],'set':function(_0x39d8c7){this[_0xd503('0x4')](_0xd503('0x5'),_0x39d8c7);this['setDataValue']('endtime',moment()[_0xd503('0x6')](_0xd503('0x7')));}},'endtime':{'type':Sequelize[_0xd503('0x3')]},'membername':{'type':Sequelize[_0xd503('0x8')]},'projectname':{'type':Sequelize[_0xd503('0x8')]},'queue':{'type':Sequelize[_0xd503('0x8')]},'uniqueid':{'type':Sequelize[_0xd503('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd503('0x8')]},'completed':{'type':Sequelize[_0xd503('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 1cc1744..acceb8d 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 _0x6d00=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','create','body','params','find','describe','getQuestions','findOne','JscriptyQuestionReport','order','pick','SessionId','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x6d00,0xc2));var _0x06d0=function(_0x1d848e,_0x3cb976){_0x1d848e=_0x1d848e-0x0;var _0x3b7ceb=_0x6d00[_0x1d848e];return _0x3b7ceb;};'use strict';var pdf=require(_0x06d0('0x0'));var emlformat=require(_0x06d0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x06d0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06d0('0x3'));var moment=require(_0x06d0('0x4'));var BPromise=require(_0x06d0('0x5'));var Mustache=require(_0x06d0('0x6'));var util=require(_0x06d0('0x7'));var path=require('path');var sox=require(_0x06d0('0x8'));var csv=require(_0x06d0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x06d0('0xa'));var squel=require(_0x06d0('0xb'));var crypto=require(_0x06d0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x06d0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x06d0('0xe'));var Papa=require(_0x06d0('0xf'));var Redis=require(_0x06d0('0x10'));var authService=require(_0x06d0('0x11'));var qs=require(_0x06d0('0x12'));var as=require(_0x06d0('0x13'));var hardwareService=require(_0x06d0('0x14'));var logger=require('../../config/logger')(_0x06d0('0x15'));var utils=require('../../config/utils');var config=require(_0x06d0('0x16'));var db=require(_0x06d0('0x17'))['db'];function respondWithStatusCode(_0x5ebd69,_0x10c724){_0x10c724=_0x10c724||0xcc;return function(_0x102f36){if(_0x102f36){return _0x5ebd69['sendStatus'](_0x10c724);}return _0x5ebd69[_0x06d0('0x18')](_0x10c724)[_0x06d0('0x19')]();};}function respondWithResult(_0x4b2c09,_0x578b22){_0x578b22=_0x578b22||0xc8;return function(_0x1357ea){if(_0x1357ea){return _0x4b2c09[_0x06d0('0x18')](_0x578b22)['json'](_0x1357ea);}};}function respondWithFilteredResult(_0x57a3f9,_0x5f4ff0){return function(_0x42a6ee){if(_0x42a6ee){var _0x3fa80c=_0x42a6ee[_0x06d0('0x1a')],_0x5b72fc=_0x5f4ff0[_0x06d0('0x1b')],_0x35951d=_0x5f4ff0[_0x06d0('0x1b')]+_0x5f4ff0[_0x06d0('0x1c')],_0x515c9e;if(_0x35951d>=_0x3fa80c){_0x35951d=_0x3fa80c;_0x515c9e=0xc8;}else{_0x515c9e=0xce;}_0x57a3f9[_0x06d0('0x18')](_0x515c9e);return _0x57a3f9[_0x06d0('0x1d')](_0x06d0('0x1e'),_0x5b72fc+'-'+_0x35951d+'/'+_0x3fa80c)[_0x06d0('0x1f')](_0x42a6ee);}return null;};}function patchUpdates(_0x4e707a){return function(_0x367587){try{jsonpatch[_0x06d0('0x20')](_0x367587,_0x4e707a,!![]);}catch(_0x3aaa6a){return BPromise[_0x06d0('0x21')](_0x3aaa6a);}return _0x367587[_0x06d0('0x22')]();};}function saveUpdates(_0x59a9d0,_0x5cb42a){return function(_0x59edf2){if(_0x59edf2){return _0x59edf2['update'](_0x59a9d0)[_0x06d0('0x23')](function(_0x57a3ef){return _0x57a3ef;});}return null;};}function removeEntity(_0x1d0f9b,_0x5e5a97){return function(_0xf37b67){if(_0xf37b67){return _0xf37b67[_0x06d0('0x24')]()[_0x06d0('0x23')](function(){_0x1d0f9b['status'](0xcc)[_0x06d0('0x19')]();});}};}function handleEntityNotFound(_0x213b87,_0x2ecd49){return function(_0x250c38){if(!_0x250c38){_0x213b87[_0x06d0('0x25')](0x194);}return _0x250c38;};}function handleError(_0x2a5e63,_0x1fc1c8){_0x1fc1c8=_0x1fc1c8||0x1f4;return function(_0x460f4c){logger[_0x06d0('0x26')](_0x460f4c[_0x06d0('0x27')]);if(_0x460f4c[_0x06d0('0x28')]){delete _0x460f4c[_0x06d0('0x28')];}_0x2a5e63['status'](_0x1fc1c8)[_0x06d0('0x29')](_0x460f4c);};}exports[_0x06d0('0x2a')]=function(_0x1a42e0,_0x1d2436){var _0x59b484={},_0x134bd={},_0x330ff1={'count':0x0,'rows':[]};var _0x2eb52f=_[_0x06d0('0x2b')](db[_0x06d0('0x2c')][_0x06d0('0x2d')],function(_0x554a93){return{'name':_0x554a93[_0x06d0('0x2e')],'type':_0x554a93[_0x06d0('0x2f')][_0x06d0('0x30')]};});_0x134bd[_0x06d0('0x31')]=_['map'](_0x2eb52f,'name');_0x134bd[_0x06d0('0x32')]=_[_0x06d0('0x33')](_0x1a42e0[_0x06d0('0x32')]);_0x134bd[_0x06d0('0x34')]=_['intersection'](_0x134bd['model'],_0x134bd[_0x06d0('0x32')]);_0x59b484[_0x06d0('0x35')]=_[_0x06d0('0x36')](_0x134bd[_0x06d0('0x31')],qs[_0x06d0('0x37')](_0x1a42e0[_0x06d0('0x32')][_0x06d0('0x37')]));_0x59b484[_0x06d0('0x35')]=_0x59b484[_0x06d0('0x35')][_0x06d0('0x38')]?_0x59b484['attributes']:_0x134bd[_0x06d0('0x31')];if(!_0x1a42e0['query'][_0x06d0('0x39')](_0x06d0('0x3a'))){_0x59b484['limit']=qs[_0x06d0('0x1c')](_0x1a42e0[_0x06d0('0x32')][_0x06d0('0x1c')]);_0x59b484[_0x06d0('0x1b')]=qs[_0x06d0('0x1b')](_0x1a42e0[_0x06d0('0x32')][_0x06d0('0x1b')]);}_0x59b484['order']=qs[_0x06d0('0x3b')](_0x1a42e0[_0x06d0('0x32')][_0x06d0('0x3b')]);_0x59b484[_0x06d0('0x3c')]=qs[_0x06d0('0x34')](_['pick'](_0x1a42e0[_0x06d0('0x32')],_0x134bd[_0x06d0('0x34')]));if(_0x1a42e0[_0x06d0('0x32')][_0x06d0('0x3d')]){_0x59b484[_0x06d0('0x3c')]=_[_0x06d0('0x3e')](_0x59b484[_0x06d0('0x3c')],{'$or':_[_0x06d0('0x2b')](_0x2eb52f,function(_0x4499db){if(_0x4499db['type']!==_0x06d0('0x3f')){var _0x3179ce={};_0x3179ce[_0x4499db[_0x06d0('0x28')]]={'$like':'%'+_0x1a42e0[_0x06d0('0x32')][_0x06d0('0x3d')]+'%'};return _0x3179ce;}})});}_0x59b484=_[_0x06d0('0x3e')]({},_0x59b484,_0x1a42e0['options']);var _0x10055c={'where':_0x59b484[_0x06d0('0x3c')]};return db[_0x06d0('0x2c')][_0x06d0('0x1a')](_0x10055c)[_0x06d0('0x23')](function(_0x3da319){_0x330ff1[_0x06d0('0x1a')]=_0x3da319;if(_0x1a42e0['query']['includeAll']){_0x59b484[_0x06d0('0x40')]=[{'all':!![]}];}return db[_0x06d0('0x2c')][_0x06d0('0x41')](_0x59b484);})[_0x06d0('0x23')](function(_0x372e5b){_0x330ff1[_0x06d0('0x42')]=_0x372e5b;return _0x330ff1;})[_0x06d0('0x23')](respondWithFilteredResult(_0x1d2436,_0x59b484))[_0x06d0('0x43')](handleError(_0x1d2436,null));};exports[_0x06d0('0x44')]=function(_0x552cb2,_0x3b5047){var _0x1960b8={'raw':!![],'where':{'id':_0x552cb2['params']['id']}},_0x483b0b={};_0x483b0b[_0x06d0('0x31')]=_[_0x06d0('0x33')](db[_0x06d0('0x2c')][_0x06d0('0x2d')]);_0x483b0b[_0x06d0('0x32')]=_['keys'](_0x552cb2[_0x06d0('0x32')]);_0x483b0b[_0x06d0('0x34')]=_[_0x06d0('0x36')](_0x483b0b[_0x06d0('0x31')],_0x483b0b['query']);_0x1960b8[_0x06d0('0x35')]=_[_0x06d0('0x36')](_0x483b0b[_0x06d0('0x31')],qs[_0x06d0('0x37')](_0x552cb2[_0x06d0('0x32')]['fields']));_0x1960b8[_0x06d0('0x35')]=_0x1960b8[_0x06d0('0x35')][_0x06d0('0x38')]?_0x1960b8['attributes']:_0x483b0b[_0x06d0('0x31')];if(_0x552cb2['query'][_0x06d0('0x45')]){_0x1960b8[_0x06d0('0x40')]=[{'all':!![]}];}_0x1960b8=_['merge']({},_0x1960b8,_0x552cb2[_0x06d0('0x46')]);return db[_0x06d0('0x2c')]['find'](_0x1960b8)[_0x06d0('0x23')](handleEntityNotFound(_0x3b5047,null))[_0x06d0('0x23')](respondWithResult(_0x3b5047,null))[_0x06d0('0x43')](handleError(_0x3b5047,null));};exports[_0x06d0('0x47')]=function(_0x4c539f,_0x1619d5){return db['JscriptySessionReport'][_0x06d0('0x47')](_0x4c539f[_0x06d0('0x48')],{})[_0x06d0('0x23')](respondWithResult(_0x1619d5,0xc9))[_0x06d0('0x43')](handleError(_0x1619d5,null));};exports['update']=function(_0x1afbc4,_0x314f40){if(_0x1afbc4['body']['id']){delete _0x1afbc4['body']['id'];}return db[_0x06d0('0x2c')]['find']({'where':{'id':_0x1afbc4[_0x06d0('0x49')]['id']}})[_0x06d0('0x23')](handleEntityNotFound(_0x314f40,null))['then'](saveUpdates(_0x1afbc4[_0x06d0('0x48')],null))[_0x06d0('0x23')](respondWithResult(_0x314f40,null))[_0x06d0('0x43')](handleError(_0x314f40,null));};exports[_0x06d0('0x24')]=function(_0x1b8e61,_0x42b954){return db[_0x06d0('0x2c')][_0x06d0('0x4a')]({'where':{'id':_0x1b8e61['params']['id']}})['then'](handleEntityNotFound(_0x42b954,null))['then'](removeEntity(_0x42b954,null))['catch'](handleError(_0x42b954,null));};exports['describe']=function(_0x2c1e79,_0x17677b){return db[_0x06d0('0x2c')][_0x06d0('0x4b')]()[_0x06d0('0x23')](respondWithResult(_0x17677b,null))[_0x06d0('0x43')](handleError(_0x17677b,null));};exports[_0x06d0('0x4c')]=function(_0x29380f,_0x1420f7,_0x3ffd51){var _0x143968={'raw':!![],'where':{}};var _0x2473e7={};var _0x56b485={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x06d0('0x4d')]({'where':{'id':_0x29380f['params']['id']}})['then'](handleEntityNotFound(_0x1420f7,null))['then'](function(_0x2b36e2){if(_0x2b36e2){_0x2473e7[_0x06d0('0x31')]=_[_0x06d0('0x33')](db[_0x06d0('0x4e')][_0x06d0('0x2d')]);_0x2473e7[_0x06d0('0x32')]=_[_0x06d0('0x33')](_0x29380f[_0x06d0('0x32')]);_0x2473e7[_0x06d0('0x34')]=_[_0x06d0('0x36')](_0x2473e7['model'],_0x2473e7['query']);_0x143968[_0x06d0('0x35')]=_['intersection'](_0x2473e7['model'],qs[_0x06d0('0x37')](_0x29380f['query'][_0x06d0('0x37')]));_0x143968['attributes']=_0x143968['attributes']['length']?_0x143968[_0x06d0('0x35')]:_0x2473e7[_0x06d0('0x31')];if(!_0x29380f[_0x06d0('0x32')][_0x06d0('0x39')](_0x06d0('0x3a'))){_0x143968[_0x06d0('0x1c')]=qs[_0x06d0('0x1c')](_0x29380f[_0x06d0('0x32')][_0x06d0('0x1c')]);_0x143968[_0x06d0('0x1b')]=qs[_0x06d0('0x1b')](_0x29380f[_0x06d0('0x32')][_0x06d0('0x1b')]);}_0x143968[_0x06d0('0x4f')]=qs[_0x06d0('0x3b')](_0x29380f[_0x06d0('0x32')]['sort']);_0x143968[_0x06d0('0x3c')]=qs['filters'](_[_0x06d0('0x50')](_0x29380f[_0x06d0('0x32')],_0x2473e7[_0x06d0('0x34')]));_0x143968['where'][_0x06d0('0x51')]=_0x2b36e2['id'];if(_0x29380f[_0x06d0('0x32')][_0x06d0('0x3d')]){_0x143968[_0x06d0('0x3c')]=_[_0x06d0('0x3e')](_0x143968[_0x06d0('0x3c')],{'$or':_['map'](_0x143968[_0x06d0('0x35')],function(_0x3e1760){var _0x5e6e38={};_0x5e6e38[_0x3e1760]={'$like':'%'+_0x29380f[_0x06d0('0x32')]['filter']+'%'};return _0x5e6e38;})});}_0x143968=_['merge']({},_0x143968,_0x29380f[_0x06d0('0x46')]);return db[_0x06d0('0x4e')][_0x06d0('0x1a')]({'where':_0x143968[_0x06d0('0x3c')]})[_0x06d0('0x23')](function(_0x5666fc){_0x56b485[_0x06d0('0x1a')]=_0x5666fc;if(_0x29380f[_0x06d0('0x32')][_0x06d0('0x45')]){_0x143968['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x06d0('0x41')](_0x143968);})[_0x06d0('0x23')](function(_0x5c6f71){_0x56b485[_0x06d0('0x42')]=_0x5c6f71;return _0x56b485;});}})[_0x06d0('0x23')](respondWithFilteredResult(_0x1420f7,_0x143968))['catch'](handleError(_0x1420f7,null));}; \ No newline at end of file +var _0xdc56=['catch','show','params','keys','length','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','options','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows'];(function(_0x39dec7,_0x40a93f){var _0x1b4e39=function(_0x244ce5){while(--_0x244ce5){_0x39dec7['push'](_0x39dec7['shift']());}};_0x1b4e39(++_0x40a93f);}(_0xdc56,0x17b));var _0x6dc5=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0xdc56[_0x56f7e2];return _0x36240b;};'use strict';var pdf=require(_0x6dc5('0x0'));var emlformat=require(_0x6dc5('0x1'));var rimraf=require(_0x6dc5('0x2'));var zipdir=require(_0x6dc5('0x3'));var jsonpatch=require(_0x6dc5('0x4'));var rp=require(_0x6dc5('0x5'));var moment=require(_0x6dc5('0x6'));var BPromise=require(_0x6dc5('0x7'));var Mustache=require(_0x6dc5('0x8'));var util=require(_0x6dc5('0x9'));var path=require(_0x6dc5('0xa'));var sox=require('sox');var csv=require(_0x6dc5('0xb'));var ejs=require(_0x6dc5('0xc'));var fs=require('fs');var _=require(_0x6dc5('0xd'));var squel=require(_0x6dc5('0xe'));var crypto=require('crypto');var jsforce=require(_0x6dc5('0xf'));var deskjs=require(_0x6dc5('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6dc5('0x11'));var Redis=require(_0x6dc5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6dc5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6dc5('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50a088,_0x61e68d){_0x61e68d=_0x61e68d||0xcc;return function(_0x1294c1){if(_0x1294c1){return _0x50a088[_0x6dc5('0x15')](_0x61e68d);}return _0x50a088[_0x6dc5('0x16')](_0x61e68d)['end']();};}function respondWithResult(_0xcd4016,_0x5b5925){_0x5b5925=_0x5b5925||0xc8;return function(_0x10f69c){if(_0x10f69c){return _0xcd4016[_0x6dc5('0x16')](_0x5b5925)[_0x6dc5('0x17')](_0x10f69c);}};}function respondWithFilteredResult(_0x3ebf50,_0x322591){return function(_0x32c7c6){if(_0x32c7c6){var _0x2c0774=_0x32c7c6[_0x6dc5('0x18')],_0x100415=_0x322591[_0x6dc5('0x19')],_0xee5055=_0x322591['offset']+_0x322591[_0x6dc5('0x1a')],_0x47de54;if(_0xee5055>=_0x2c0774){_0xee5055=_0x2c0774;_0x47de54=0xc8;}else{_0x47de54=0xce;}_0x3ebf50[_0x6dc5('0x16')](_0x47de54);return _0x3ebf50[_0x6dc5('0x1b')](_0x6dc5('0x1c'),_0x100415+'-'+_0xee5055+'/'+_0x2c0774)['json'](_0x32c7c6);}return null;};}function patchUpdates(_0x58bb56){return function(_0x3c6c45){try{jsonpatch[_0x6dc5('0x1d')](_0x3c6c45,_0x58bb56,!![]);}catch(_0x33179d){return BPromise['reject'](_0x33179d);}return _0x3c6c45['save']();};}function saveUpdates(_0x13d1b3,_0x2d9d17){return function(_0x5d194c){if(_0x5d194c){return _0x5d194c[_0x6dc5('0x1e')](_0x13d1b3)[_0x6dc5('0x1f')](function(_0xaa72b3){return _0xaa72b3;});}return null;};}function removeEntity(_0x56f7e9,_0x5c64ee){return function(_0x1bd0e3){if(_0x1bd0e3){return _0x1bd0e3[_0x6dc5('0x20')]()[_0x6dc5('0x1f')](function(){_0x56f7e9[_0x6dc5('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x427b10,_0x5c5f95){return function(_0x1881cd){if(!_0x1881cd){_0x427b10[_0x6dc5('0x15')](0x194);}return _0x1881cd;};}function handleError(_0x16eec1,_0x901b56){_0x901b56=_0x901b56||0x1f4;return function(_0x398855){logger[_0x6dc5('0x21')](_0x398855[_0x6dc5('0x22')]);if(_0x398855[_0x6dc5('0x23')]){delete _0x398855[_0x6dc5('0x23')];}_0x16eec1[_0x6dc5('0x16')](_0x901b56)[_0x6dc5('0x24')](_0x398855);};}exports[_0x6dc5('0x25')]=function(_0x3ba909,_0x560572){var _0x70ff2e={},_0x5366d3={},_0x4eb6c6={'count':0x0,'rows':[]};var _0x5781e9=_[_0x6dc5('0x26')](db[_0x6dc5('0x27')][_0x6dc5('0x28')],function(_0x185087){return{'name':_0x185087[_0x6dc5('0x29')],'type':_0x185087['type'][_0x6dc5('0x2a')]};});_0x5366d3[_0x6dc5('0x2b')]=_[_0x6dc5('0x26')](_0x5781e9,_0x6dc5('0x23'));_0x5366d3[_0x6dc5('0x2c')]=_['keys'](_0x3ba909[_0x6dc5('0x2c')]);_0x5366d3[_0x6dc5('0x2d')]=_[_0x6dc5('0x2e')](_0x5366d3[_0x6dc5('0x2b')],_0x5366d3['query']);_0x70ff2e['attributes']=_[_0x6dc5('0x2e')](_0x5366d3[_0x6dc5('0x2b')],qs[_0x6dc5('0x2f')](_0x3ba909[_0x6dc5('0x2c')][_0x6dc5('0x2f')]));_0x70ff2e['attributes']=_0x70ff2e[_0x6dc5('0x30')]['length']?_0x70ff2e[_0x6dc5('0x30')]:_0x5366d3[_0x6dc5('0x2b')];if(!_0x3ba909[_0x6dc5('0x2c')]['hasOwnProperty'](_0x6dc5('0x31'))){_0x70ff2e[_0x6dc5('0x1a')]=qs[_0x6dc5('0x1a')](_0x3ba909[_0x6dc5('0x2c')]['limit']);_0x70ff2e[_0x6dc5('0x19')]=qs[_0x6dc5('0x19')](_0x3ba909[_0x6dc5('0x2c')][_0x6dc5('0x19')]);}_0x70ff2e[_0x6dc5('0x32')]=qs[_0x6dc5('0x33')](_0x3ba909[_0x6dc5('0x2c')][_0x6dc5('0x33')]);_0x70ff2e[_0x6dc5('0x34')]=qs[_0x6dc5('0x2d')](_['pick'](_0x3ba909[_0x6dc5('0x2c')],_0x5366d3[_0x6dc5('0x2d')]));if(_0x3ba909[_0x6dc5('0x2c')][_0x6dc5('0x35')]){_0x70ff2e[_0x6dc5('0x34')]=_[_0x6dc5('0x36')](_0x70ff2e[_0x6dc5('0x34')],{'$or':_['map'](_0x5781e9,function(_0x220e01){if(_0x220e01['type']!=='VIRTUAL'){var _0x3f5d4e={};_0x3f5d4e[_0x220e01[_0x6dc5('0x23')]]={'$like':'%'+_0x3ba909[_0x6dc5('0x2c')][_0x6dc5('0x35')]+'%'};return _0x3f5d4e;}})});}_0x70ff2e=_[_0x6dc5('0x36')]({},_0x70ff2e,_0x3ba909['options']);var _0x30f2e4={'where':_0x70ff2e[_0x6dc5('0x34')]};return db[_0x6dc5('0x27')][_0x6dc5('0x18')](_0x30f2e4)[_0x6dc5('0x1f')](function(_0x360aed){_0x4eb6c6[_0x6dc5('0x18')]=_0x360aed;if(_0x3ba909['query'][_0x6dc5('0x37')]){_0x70ff2e[_0x6dc5('0x38')]=[{'all':!![]}];}return db[_0x6dc5('0x27')][_0x6dc5('0x39')](_0x70ff2e);})[_0x6dc5('0x1f')](function(_0x21f5be){_0x4eb6c6[_0x6dc5('0x3a')]=_0x21f5be;return _0x4eb6c6;})[_0x6dc5('0x1f')](respondWithFilteredResult(_0x560572,_0x70ff2e))[_0x6dc5('0x3b')](handleError(_0x560572,null));};exports[_0x6dc5('0x3c')]=function(_0x1bfd81,_0x3eefd5){var _0xc4d2d6={'raw':!![],'where':{'id':_0x1bfd81[_0x6dc5('0x3d')]['id']}},_0x283a70={};_0x283a70['model']=_[_0x6dc5('0x3e')](db[_0x6dc5('0x27')][_0x6dc5('0x28')]);_0x283a70[_0x6dc5('0x2c')]=_[_0x6dc5('0x3e')](_0x1bfd81[_0x6dc5('0x2c')]);_0x283a70['filters']=_[_0x6dc5('0x2e')](_0x283a70[_0x6dc5('0x2b')],_0x283a70[_0x6dc5('0x2c')]);_0xc4d2d6[_0x6dc5('0x30')]=_[_0x6dc5('0x2e')](_0x283a70[_0x6dc5('0x2b')],qs[_0x6dc5('0x2f')](_0x1bfd81[_0x6dc5('0x2c')][_0x6dc5('0x2f')]));_0xc4d2d6[_0x6dc5('0x30')]=_0xc4d2d6[_0x6dc5('0x30')][_0x6dc5('0x3f')]?_0xc4d2d6['attributes']:_0x283a70[_0x6dc5('0x2b')];if(_0x1bfd81[_0x6dc5('0x2c')][_0x6dc5('0x37')]){_0xc4d2d6[_0x6dc5('0x38')]=[{'all':!![]}];}_0xc4d2d6=_[_0x6dc5('0x36')]({},_0xc4d2d6,_0x1bfd81['options']);return db[_0x6dc5('0x27')][_0x6dc5('0x40')](_0xc4d2d6)['then'](handleEntityNotFound(_0x3eefd5,null))[_0x6dc5('0x1f')](respondWithResult(_0x3eefd5,null))[_0x6dc5('0x3b')](handleError(_0x3eefd5,null));};exports[_0x6dc5('0x41')]=function(_0x572c07,_0x4c74ad){return db[_0x6dc5('0x27')][_0x6dc5('0x41')](_0x572c07['body'],{})[_0x6dc5('0x1f')](respondWithResult(_0x4c74ad,0xc9))[_0x6dc5('0x3b')](handleError(_0x4c74ad,null));};exports[_0x6dc5('0x1e')]=function(_0x5de2d6,_0x274849){if(_0x5de2d6['body']['id']){delete _0x5de2d6['body']['id'];}return db[_0x6dc5('0x27')]['find']({'where':{'id':_0x5de2d6[_0x6dc5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x274849,null))[_0x6dc5('0x1f')](saveUpdates(_0x5de2d6[_0x6dc5('0x42')],null))[_0x6dc5('0x1f')](respondWithResult(_0x274849,null))['catch'](handleError(_0x274849,null));};exports[_0x6dc5('0x20')]=function(_0x475fe9,_0x41399a){return db['JscriptySessionReport'][_0x6dc5('0x40')]({'where':{'id':_0x475fe9[_0x6dc5('0x3d')]['id']}})[_0x6dc5('0x1f')](handleEntityNotFound(_0x41399a,null))[_0x6dc5('0x1f')](removeEntity(_0x41399a,null))[_0x6dc5('0x3b')](handleError(_0x41399a,null));};exports[_0x6dc5('0x43')]=function(_0x6921a2,_0xc5f3cd){return db['JscriptySessionReport']['describe']()[_0x6dc5('0x1f')](respondWithResult(_0xc5f3cd,null))[_0x6dc5('0x3b')](handleError(_0xc5f3cd,null));};exports[_0x6dc5('0x44')]=function(_0x59edc7,_0xc7f684,_0x160b29){var _0x2e94c4={'raw':!![],'where':{}};var _0x33e2a9={};var _0x2402f2={'count':0x0,'rows':[]};return db[_0x6dc5('0x27')][_0x6dc5('0x45')]({'where':{'id':_0x59edc7[_0x6dc5('0x3d')]['id']}})[_0x6dc5('0x1f')](handleEntityNotFound(_0xc7f684,null))['then'](function(_0x577c4f){if(_0x577c4f){_0x33e2a9[_0x6dc5('0x2b')]=_['keys'](db[_0x6dc5('0x46')][_0x6dc5('0x28')]);_0x33e2a9[_0x6dc5('0x2c')]=_[_0x6dc5('0x3e')](_0x59edc7[_0x6dc5('0x2c')]);_0x33e2a9[_0x6dc5('0x2d')]=_[_0x6dc5('0x2e')](_0x33e2a9[_0x6dc5('0x2b')],_0x33e2a9[_0x6dc5('0x2c')]);_0x2e94c4[_0x6dc5('0x30')]=_[_0x6dc5('0x2e')](_0x33e2a9[_0x6dc5('0x2b')],qs[_0x6dc5('0x2f')](_0x59edc7[_0x6dc5('0x2c')][_0x6dc5('0x2f')]));_0x2e94c4[_0x6dc5('0x30')]=_0x2e94c4[_0x6dc5('0x30')]['length']?_0x2e94c4['attributes']:_0x33e2a9['model'];if(!_0x59edc7['query'][_0x6dc5('0x47')](_0x6dc5('0x31'))){_0x2e94c4['limit']=qs[_0x6dc5('0x1a')](_0x59edc7['query']['limit']);_0x2e94c4[_0x6dc5('0x19')]=qs[_0x6dc5('0x19')](_0x59edc7[_0x6dc5('0x2c')]['offset']);}_0x2e94c4[_0x6dc5('0x32')]=qs[_0x6dc5('0x33')](_0x59edc7[_0x6dc5('0x2c')][_0x6dc5('0x33')]);_0x2e94c4[_0x6dc5('0x34')]=qs[_0x6dc5('0x2d')](_['pick'](_0x59edc7[_0x6dc5('0x2c')],_0x33e2a9[_0x6dc5('0x2d')]));_0x2e94c4[_0x6dc5('0x34')]['SessionId']=_0x577c4f['id'];if(_0x59edc7[_0x6dc5('0x2c')][_0x6dc5('0x35')]){_0x2e94c4[_0x6dc5('0x34')]=_[_0x6dc5('0x36')](_0x2e94c4['where'],{'$or':_[_0x6dc5('0x26')](_0x2e94c4['attributes'],function(_0x13fec2){var _0x5d3cf0={};_0x5d3cf0[_0x13fec2]={'$like':'%'+_0x59edc7[_0x6dc5('0x2c')][_0x6dc5('0x35')]+'%'};return _0x5d3cf0;})});}_0x2e94c4=_['merge']({},_0x2e94c4,_0x59edc7[_0x6dc5('0x48')]);return db[_0x6dc5('0x46')][_0x6dc5('0x18')]({'where':_0x2e94c4['where']})['then'](function(_0x426e61){_0x2402f2[_0x6dc5('0x18')]=_0x426e61;if(_0x59edc7[_0x6dc5('0x2c')][_0x6dc5('0x37')]){_0x2e94c4['include']=[{'all':!![]}];}return db[_0x6dc5('0x46')]['findAll'](_0x2e94c4);})[_0x6dc5('0x1f')](function(_0x378701){_0x2402f2[_0x6dc5('0x3a')]=_0x378701;return _0x2402f2;});}})[_0x6dc5('0x1f')](respondWithFilteredResult(_0xc7f684,_0x2e94c4))[_0x6dc5('0x3b')](handleError(_0xc7f684,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index f658890..b7451e8 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 _0xa599=['report_jscripty_sessions','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x5cac87,_0x43cb46){var _0x54f62b=function(_0x1944a4){while(--_0x1944a4){_0x5cac87['push'](_0x5cac87['shift']());}};_0x54f62b(++_0x43cb46);}(_0xa599,0x1b9));var _0x9a59=function(_0x17cecc,_0x3ecfc0){_0x17cecc=_0x17cecc-0x0;var _0xe23ced=_0xa599[_0x17cecc];return _0xe23ced;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9a59('0x0'))(_0x9a59('0x1'));var moment=require(_0x9a59('0x2'));var BPromise=require(_0x9a59('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a59('0x4'));var rimraf=require(_0x9a59('0x5'));var config=require(_0x9a59('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0x9a59('0x7')]=function(_0x3c1b0a,_0x1b5147){return _0x3c1b0a[_0x9a59('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x9a59('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fbe=['../../config/logger','moment','request-promise','path','rimraf','./jscriptySessionReport.attributes','exports','define','lodash','util'];(function(_0x433226,_0x43928c){var _0x5a9e21=function(_0x376ea8){while(--_0x376ea8){_0x433226['push'](_0x433226['shift']());}};_0x5a9e21(++_0x43928c);}(_0x8fbe,0x10c));var _0xe8fb=function(_0x3fe559,_0x51f61d){_0x3fe559=_0x3fe559-0x0;var _0x41d119=_0x8fbe[_0x3fe559];return _0x41d119;};'use strict';var _=require(_0xe8fb('0x0'));var util=require(_0xe8fb('0x1'));var logger=require(_0xe8fb('0x2'))('api');var moment=require(_0xe8fb('0x3'));var BPromise=require('bluebird');var rp=require(_0xe8fb('0x4'));var fs=require('fs');var path=require(_0xe8fb('0x5'));var rimraf=require(_0xe8fb('0x6'));var config=require('../../config/environment');var attributes=require(_0xe8fb('0x7'));module[_0xe8fb('0x8')]=function(_0x4ca7b1,_0x55bd47){return _0x4ca7b1[_0xe8fb('0x9')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index d867c71..0958c3d 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 _0xbab7=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0xf4ce27,_0x8266aa){var _0x4c6717=function(_0x5ca3ad){while(--_0x5ca3ad){_0xf4ce27['push'](_0xf4ce27['shift']());}};_0x4c6717(++_0x8266aa);}(_0xbab7,0x19c));var _0x7bab=function(_0x3c9fd2,_0x2ce8e1){_0x3c9fd2=_0x3c9fd2-0x0;var _0x47fc4f=_0xbab7[_0x3c9fd2];return _0x47fc4f;};'use strict';var _=require(_0x7bab('0x0'));var util=require(_0x7bab('0x1'));var moment=require(_0x7bab('0x2'));var BPromise=require(_0x7bab('0x3'));var rs=require(_0x7bab('0x4'));var fs=require('fs');var Redis=require(_0x7bab('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bab('0x6'));var logger=require('../../config/logger')(_0x7bab('0x7'));var config=require(_0x7bab('0x8'));var jayson=require(_0x7bab('0x9'));var client=jayson[_0x7bab('0xa')][_0x7bab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x137839,_0x411c85,_0x4f1d05){return new BPromise(function(_0x16fbce,_0x26855f){return client['request'](_0x137839,_0x4f1d05)[_0x7bab('0xc')](function(_0x63fab5){logger[_0x7bab('0xd')](_0x7bab('0xe'),_0x411c85,_0x7bab('0xf'));logger[_0x7bab('0x10')](_0x7bab('0x11'),_0x411c85,_0x7bab('0xf'),JSON[_0x7bab('0x12')](_0x63fab5));if(_0x63fab5[_0x7bab('0x13')]){if(_0x63fab5[_0x7bab('0x13')][_0x7bab('0x14')]===0x1f4){logger[_0x7bab('0x13')](_0x7bab('0xe'),_0x411c85,_0x63fab5[_0x7bab('0x13')][_0x7bab('0x15')]);return _0x26855f(_0x63fab5['error'][_0x7bab('0x15')]);}logger['error'](_0x7bab('0xe'),_0x411c85,_0x63fab5[_0x7bab('0x13')][_0x7bab('0x15')]);return _0x16fbce(_0x63fab5[_0x7bab('0x13')][_0x7bab('0x15')]);}else{logger[_0x7bab('0xd')](_0x7bab('0xe'),_0x411c85,_0x7bab('0xf'));_0x16fbce(_0x63fab5['result'][_0x7bab('0x15')]);}})[_0x7bab('0x16')](function(_0x412e60){logger['error'](_0x7bab('0xe'),_0x411c85,_0x412e60);_0x26855f(_0x412e60);});});} \ No newline at end of file +var _0x770f=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x770f,0xef));var _0xf770=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0x770f[_0xa990b7];return _0x52c99c;};'use strict';var _=require(_0xf770('0x0'));var util=require(_0xf770('0x1'));var moment=require(_0xf770('0x2'));var BPromise=require(_0xf770('0x3'));var rs=require(_0xf770('0x4'));var fs=require('fs');var Redis=require(_0xf770('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf770('0x6'));var logger=require(_0xf770('0x7'))('rpc');var config=require(_0xf770('0x8'));var jayson=require(_0xf770('0x9'));var client=jayson[_0xf770('0xa')][_0xf770('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b2631,_0x878f6b,_0x235f8b){return new BPromise(function(_0x5b620d,_0x494872){return client[_0xf770('0xc')](_0x5b2631,_0x235f8b)[_0xf770('0xd')](function(_0x12f41a){logger[_0xf770('0xe')](_0xf770('0xf'),_0x878f6b,'request\x20sent');logger[_0xf770('0x10')](_0xf770('0x11'),_0x878f6b,'request\x20sent',JSON[_0xf770('0x12')](_0x12f41a));if(_0x12f41a['error']){if(_0x12f41a[_0xf770('0x13')][_0xf770('0x14')]===0x1f4){logger[_0xf770('0x13')](_0xf770('0xf'),_0x878f6b,_0x12f41a['error'][_0xf770('0x15')]);return _0x494872(_0x12f41a['error'][_0xf770('0x15')]);}logger[_0xf770('0x13')](_0xf770('0xf'),_0x878f6b,_0x12f41a['error']['message']);return _0x5b620d(_0x12f41a[_0xf770('0x13')]['message']);}else{logger[_0xf770('0xe')](_0xf770('0xf'),_0x878f6b,_0xf770('0x16'));_0x5b620d(_0x12f41a[_0xf770('0x17')][_0xf770('0x15')]);}})['catch'](function(_0x33b318){logger[_0xf770('0x13')](_0xf770('0xf'),_0x878f6b,_0x33b318);_0x494872(_0x33b318);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 5173466..6dde66c 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 _0x6eab=['./license.controller','get','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x11c119,_0x10d831){var _0x4c07c4=function(_0x21f940){while(--_0x21f940){_0x11c119['push'](_0x11c119['shift']());}};_0x4c07c4(++_0x10d831);}(_0x6eab,0x1ba));var _0xb6ea=function(_0x57eebd,_0x561057){_0x57eebd=_0x57eebd-0x0;var _0x343a79=_0x6eab[_0x57eebd];return _0x343a79;};'use strict';var multer=require(_0xb6ea('0x0'));var util=require(_0xb6ea('0x1'));var path=require(_0xb6ea('0x2'));var timeout=require(_0xb6ea('0x3'));var express=require(_0xb6ea('0x4'));var router=express[_0xb6ea('0x5')]();var auth=require(_0xb6ea('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb6ea('0x7'));var controller=require(_0xb6ea('0x8'));router[_0xb6ea('0x9')]('/',controller['index']);router[_0xb6ea('0xa')](_0xb6ea('0xb'),auth[_0xb6ea('0xc')](),controller[_0xb6ea('0xd')]);module[_0xb6ea('0xe')]=router; \ No newline at end of file +var _0x23a7=['get','put','isAuthenticated','update','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./license.controller'];(function(_0x2c0b50,_0x5eb544){var _0x436ec3=function(_0x492f92){while(--_0x492f92){_0x2c0b50['push'](_0x2c0b50['shift']());}};_0x436ec3(++_0x5eb544);}(_0x23a7,0x149));var _0x723a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x23a7[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x723a('0x0'));var util=require(_0x723a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x723a('0x2'));var router=express[_0x723a('0x3')]();var auth=require(_0x723a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x723a('0x5'));var controller=require(_0x723a('0x6'));router[_0x723a('0x7')]('/',controller['index']);router[_0x723a('0x8')]('/:id',auth[_0x723a('0x9')](),controller[_0x723a('0xa')]);module[_0x723a('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 4cdd174..9f4fb93 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 _0x31f0=['TEXT','STRING','INTEGER','sequelize'];(function(_0x535fc2,_0x823367){var _0x22c8a3=function(_0x3d0f0c){while(--_0x3d0f0c){_0x535fc2['push'](_0x535fc2['shift']());}};_0x22c8a3(++_0x823367);}(_0x31f0,0xb7));var _0x031f=function(_0x116e62,_0x120ff2){_0x116e62=_0x116e62-0x0;var _0xa8fa73=_0x31f0[_0x116e62];return _0xa8fa73;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'license':{'type':Sequelize[_0x031f('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x031f('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x031f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe14b=['exports','STRING','INTEGER','sequelize'];(function(_0x4a1640,_0x4557ec){var _0x36de11=function(_0x41e9f4){while(--_0x41e9f4){_0x4a1640['push'](_0x4a1640['shift']());}};_0x36de11(++_0x4557ec);}(_0xe14b,0x93));var _0xbe14=function(_0x3cd157,_0x577cb8){_0x3cd157=_0x3cd157-0x0;var _0x59e4a7=_0xe14b[_0x3cd157];return _0x59e4a7;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xbe14('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xbe14('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 1f2a9aa..b22e9b8 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 _0x332e=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','../../config/license/util','index','model','License','rawAttributes','keys','query','filters','intersection','fields','attributes','length','merge','options','catch','body','params','key','demo','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x342de6,_0x343927){var _0x6b7e5a=function(_0x5be071){while(--_0x5be071){_0x342de6['push'](_0x342de6['shift']());}};_0x6b7e5a(++_0x343927);}(_0x332e,0x198));var _0xe332=function(_0xa970d1,_0x8e9f98){_0xa970d1=_0xa970d1-0x0;var _0x4c5a31=_0x332e[_0xa970d1];return _0x4c5a31;};'use strict';var pdf=require(_0xe332('0x0'));var emlformat=require(_0xe332('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe332('0x2'));var rp=require(_0xe332('0x3'));var moment=require(_0xe332('0x4'));var BPromise=require(_0xe332('0x5'));var Mustache=require(_0xe332('0x6'));var util=require(_0xe332('0x7'));var path=require(_0xe332('0x8'));var sox=require(_0xe332('0x9'));var csv=require(_0xe332('0xa'));var ejs=require(_0xe332('0xb'));var fs=require('fs');var _=require(_0xe332('0xc'));var squel=require(_0xe332('0xd'));var crypto=require(_0xe332('0xe'));var jsforce=require(_0xe332('0xf'));var deskjs=require(_0xe332('0x10'));var toCsv=require(_0xe332('0xa'));var querystring=require(_0xe332('0x11'));var Papa=require('papaparse');var Redis=require(_0xe332('0x12'));var authService=require(_0xe332('0x13'));var qs=require(_0xe332('0x14'));var as=require(_0xe332('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe332('0x16'))(_0xe332('0x17'));var utils=require(_0xe332('0x18'));var config=require(_0xe332('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d42d6,_0x2e2b9e){_0x2e2b9e=_0x2e2b9e||0xcc;return function(_0x7bd11a){if(_0x7bd11a){return _0x2d42d6[_0xe332('0x1a')](_0x2e2b9e);}return _0x2d42d6['status'](_0x2e2b9e)['end']();};}function respondWithResult(_0x26dc2e,_0x1a8a68){_0x1a8a68=_0x1a8a68||0xc8;return function(_0x5a1f96){if(_0x5a1f96){return _0x26dc2e['status'](_0x1a8a68)['json'](_0x5a1f96);}};}function respondWithFilteredResult(_0x591147,_0x137652){return function(_0x552906){if(_0x552906){var _0x5f0993=_0x552906[_0xe332('0x1b')],_0x2d5c3e=_0x137652[_0xe332('0x1c')],_0xaaa9ad=_0x137652[_0xe332('0x1c')]+_0x137652[_0xe332('0x1d')],_0x4480f2;if(_0xaaa9ad>=_0x5f0993){_0xaaa9ad=_0x5f0993;_0x4480f2=0xc8;}else{_0x4480f2=0xce;}_0x591147[_0xe332('0x1e')](_0x4480f2);return _0x591147[_0xe332('0x1f')](_0xe332('0x20'),_0x2d5c3e+'-'+_0xaaa9ad+'/'+_0x5f0993)['json'](_0x552906);}return null;};}function patchUpdates(_0xd72322){return function(_0x458e6f){try{jsonpatch[_0xe332('0x21')](_0x458e6f,_0xd72322,!![]);}catch(_0x53742c){return BPromise[_0xe332('0x22')](_0x53742c);}return _0x458e6f[_0xe332('0x23')]();};}function saveUpdates(_0x5d1e91,_0x88fe17){return function(_0x126408){if(_0x126408){return _0x126408[_0xe332('0x24')](_0x5d1e91)['then'](function(_0x592de1){return _0x592de1;});}return null;};}function removeEntity(_0x2e071c,_0x200ec6){return function(_0x4e1e78){if(_0x4e1e78){return _0x4e1e78['destroy']()[_0xe332('0x25')](function(){_0x2e071c[_0xe332('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b2242,_0x1ff564){return function(_0x34188b){if(!_0x34188b){_0x4b2242[_0xe332('0x1a')](0x194);}return _0x34188b;};}function handleError(_0x38b197,_0xc50412){_0xc50412=_0xc50412||0x1f4;return function(_0x3d9996){logger['error'](_0x3d9996[_0xe332('0x26')]);if(_0x3d9996[_0xe332('0x27')]){delete _0x3d9996['name'];}_0x38b197[_0xe332('0x1e')](_0xc50412)[_0xe332('0x28')](_0x3d9996);};}var utilLicense=require(_0xe332('0x29'));exports[_0xe332('0x2a')]=function(_0x46b8fa,_0x2edffb){var _0x3997f8={'raw':!![],'where':{'id':0x1}},_0x58ad46={};_0x58ad46[_0xe332('0x2b')]=_['keys'](db[_0xe332('0x2c')][_0xe332('0x2d')]);_0x58ad46['query']=_[_0xe332('0x2e')](_0x46b8fa[_0xe332('0x2f')]);_0x58ad46[_0xe332('0x30')]=_[_0xe332('0x31')](_0x58ad46[_0xe332('0x2b')],_0x58ad46[_0xe332('0x2f')]);_0x3997f8['attributes']=_[_0xe332('0x31')](_0x58ad46[_0xe332('0x2b')],qs[_0xe332('0x32')](_0x46b8fa['query'][_0xe332('0x32')]));_0x3997f8[_0xe332('0x33')]=_0x3997f8[_0xe332('0x33')][_0xe332('0x34')]?_0x3997f8[_0xe332('0x33')]:_0x58ad46['model'];_0x3997f8=_[_0xe332('0x35')]({},_0x3997f8,_0x46b8fa[_0xe332('0x36')]);return utilLicense['getLicense'](_0x3997f8)[_0xe332('0x25')](respondWithResult(_0x2edffb,null))[_0xe332('0x37')](handleError(_0x2edffb,null));};exports['update']=function(_0x2ad83b,_0x5ba8fb){if(_0x2ad83b[_0xe332('0x38')]['id']){delete _0x2ad83b[_0xe332('0x38')]['id'];}return db[_0xe332('0x2c')]['find']({'where':{'id':_0x2ad83b[_0xe332('0x39')]['id']}})[_0xe332('0x25')](handleEntityNotFound(_0x5ba8fb,null))['then'](function(_0x36d76b){var _0x20dcc8=_0x36d76b['get']({'plain':!![]});return utilLicense['checkLicense'](_0x20dcc8,_0x2ad83b[_0xe332('0x38')][_0xe332('0x3a')]);})[_0xe332('0x25')](function(_0x1f2d7a){if(!_0x1f2d7a[_0xe332('0x3b')]){return saveUpdates(_0x2ad83b[_0xe332('0x38')],null);}return _0x1f2d7a;})[_0xe332('0x25')](respondWithResult(_0x5ba8fb,null))[_0xe332('0x37')](handleError(_0x5ba8fb,null));}; \ No newline at end of file +var _0x9f8f=['moment','bluebird','path','ejs','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','json','count','offset','limit','status','set','apply','reject','destroy','then','error','stack','name','send','../../config/license/util','index','model','keys','rawAttributes','query','filters','attributes','fields','length','merge','catch','update','body','License','find','checkLicense','demo','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xd32fd3,_0x1e6419){var _0x48d328=function(_0x4e78aa){while(--_0x4e78aa){_0xd32fd3['push'](_0xd32fd3['shift']());}};_0x48d328(++_0x1e6419);}(_0x9f8f,0xa3));var _0xf9f8=function(_0x14cd45,_0x49ddb3){_0x14cd45=_0x14cd45-0x0;var _0x2a05bf=_0x9f8f[_0x14cd45];return _0x2a05bf;};'use strict';var pdf=require(_0xf9f8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf9f8('0x1'));var zipdir=require(_0xf9f8('0x2'));var jsonpatch=require(_0xf9f8('0x3'));var rp=require(_0xf9f8('0x4'));var moment=require(_0xf9f8('0x5'));var BPromise=require(_0xf9f8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf9f8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf9f8('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf9f8('0x9'));var deskjs=require(_0xf9f8('0xa'));var toCsv=require('to-csv');var querystring=require(_0xf9f8('0xb'));var Papa=require(_0xf9f8('0xc'));var Redis=require(_0xf9f8('0xd'));var authService=require(_0xf9f8('0xe'));var qs=require(_0xf9f8('0xf'));var as=require(_0xf9f8('0x10'));var hardwareService=require(_0xf9f8('0x11'));var logger=require(_0xf9f8('0x12'))(_0xf9f8('0x13'));var utils=require('../../config/utils');var config=require(_0xf9f8('0x14'));var db=require(_0xf9f8('0x15'))['db'];function respondWithStatusCode(_0x496af1,_0x4f9f81){_0x4f9f81=_0x4f9f81||0xcc;return function(_0x28cb0c){if(_0x28cb0c){return _0x496af1[_0xf9f8('0x16')](_0x4f9f81);}return _0x496af1['status'](_0x4f9f81)[_0xf9f8('0x17')]();};}function respondWithResult(_0x48dd90,_0x4b4834){_0x4b4834=_0x4b4834||0xc8;return function(_0xa10787){if(_0xa10787){return _0x48dd90['status'](_0x4b4834)[_0xf9f8('0x18')](_0xa10787);}};}function respondWithFilteredResult(_0x519a90,_0x2ff787){return function(_0x37b350){if(_0x37b350){var _0x5ece85=_0x37b350[_0xf9f8('0x19')],_0x57e3a0=_0x2ff787[_0xf9f8('0x1a')],_0x1b5cc6=_0x2ff787[_0xf9f8('0x1a')]+_0x2ff787[_0xf9f8('0x1b')],_0x3870f3;if(_0x1b5cc6>=_0x5ece85){_0x1b5cc6=_0x5ece85;_0x3870f3=0xc8;}else{_0x3870f3=0xce;}_0x519a90[_0xf9f8('0x1c')](_0x3870f3);return _0x519a90[_0xf9f8('0x1d')]('Content-Range',_0x57e3a0+'-'+_0x1b5cc6+'/'+_0x5ece85)['json'](_0x37b350);}return null;};}function patchUpdates(_0x45eb54){return function(_0x40ffb7){try{jsonpatch[_0xf9f8('0x1e')](_0x40ffb7,_0x45eb54,!![]);}catch(_0x36d889){return BPromise[_0xf9f8('0x1f')](_0x36d889);}return _0x40ffb7['save']();};}function saveUpdates(_0x4a999c,_0x2b4e19){return function(_0x2ad899){if(_0x2ad899){return _0x2ad899['update'](_0x4a999c)['then'](function(_0x2824cf){return _0x2824cf;});}return null;};}function removeEntity(_0x5321ea,_0x2c6603){return function(_0x44a79f){if(_0x44a79f){return _0x44a79f[_0xf9f8('0x20')]()[_0xf9f8('0x21')](function(){_0x5321ea['status'](0xcc)[_0xf9f8('0x17')]();});}};}function handleEntityNotFound(_0x5f3f66,_0x26db69){return function(_0xd57425){if(!_0xd57425){_0x5f3f66[_0xf9f8('0x16')](0x194);}return _0xd57425;};}function handleError(_0x58a670,_0x34d0ae){_0x34d0ae=_0x34d0ae||0x1f4;return function(_0xeefd63){logger[_0xf9f8('0x22')](_0xeefd63[_0xf9f8('0x23')]);if(_0xeefd63['name']){delete _0xeefd63[_0xf9f8('0x24')];}_0x58a670[_0xf9f8('0x1c')](_0x34d0ae)[_0xf9f8('0x25')](_0xeefd63);};}var utilLicense=require(_0xf9f8('0x26'));exports[_0xf9f8('0x27')]=function(_0x2481ac,_0x3a7e75){var _0x34a61c={'raw':!![],'where':{'id':0x1}},_0x271aaf={};_0x271aaf[_0xf9f8('0x28')]=_[_0xf9f8('0x29')](db['License'][_0xf9f8('0x2a')]);_0x271aaf[_0xf9f8('0x2b')]=_[_0xf9f8('0x29')](_0x2481ac[_0xf9f8('0x2b')]);_0x271aaf[_0xf9f8('0x2c')]=_['intersection'](_0x271aaf[_0xf9f8('0x28')],_0x271aaf[_0xf9f8('0x2b')]);_0x34a61c[_0xf9f8('0x2d')]=_['intersection'](_0x271aaf['model'],qs['fields'](_0x2481ac[_0xf9f8('0x2b')][_0xf9f8('0x2e')]));_0x34a61c[_0xf9f8('0x2d')]=_0x34a61c['attributes'][_0xf9f8('0x2f')]?_0x34a61c[_0xf9f8('0x2d')]:_0x271aaf[_0xf9f8('0x28')];_0x34a61c=_[_0xf9f8('0x30')]({},_0x34a61c,_0x2481ac['options']);return utilLicense['getLicense'](_0x34a61c)[_0xf9f8('0x21')](respondWithResult(_0x3a7e75,null))[_0xf9f8('0x31')](handleError(_0x3a7e75,null));};exports[_0xf9f8('0x32')]=function(_0x6f19c2,_0x5cae59){if(_0x6f19c2[_0xf9f8('0x33')]['id']){delete _0x6f19c2[_0xf9f8('0x33')]['id'];}return db[_0xf9f8('0x34')][_0xf9f8('0x35')]({'where':{'id':_0x6f19c2['params']['id']}})['then'](handleEntityNotFound(_0x5cae59,null))[_0xf9f8('0x21')](function(_0x3a802e){var _0x58bb83=_0x3a802e['get']({'plain':!![]});return utilLicense[_0xf9f8('0x36')](_0x58bb83,_0x6f19c2['body']['key']);})[_0xf9f8('0x21')](function(_0x39f9c5){if(!_0x39f9c5[_0xf9f8('0x37')]){return saveUpdates(_0x6f19c2['body'],null);}return _0x39f9c5;})[_0xf9f8('0x21')](respondWithResult(_0x5cae59,null))[_0xf9f8('0x31')](handleError(_0x5cae59,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 5186df8..ba74fc0 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 _0xa0dd=['../../config/environment','./license.attributes','exports','define','License','lodash','util','api','moment','bluebird','rimraf'];(function(_0xe392f,_0x4f16e3){var _0x4d9890=function(_0x1703cb){while(--_0x1703cb){_0xe392f['push'](_0xe392f['shift']());}};_0x4d9890(++_0x4f16e3);}(_0xa0dd,0xc0));var _0xda0d=function(_0x2778f5,_0x52db6d){_0x2778f5=_0x2778f5-0x0;var _0x2e24e5=_0xa0dd[_0x2778f5];return _0x2e24e5;};'use strict';var _=require(_0xda0d('0x0'));var util=require(_0xda0d('0x1'));var logger=require('../../config/logger')(_0xda0d('0x2'));var moment=require(_0xda0d('0x3'));var BPromise=require(_0xda0d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xda0d('0x5'));var config=require(_0xda0d('0x6'));var attributes=require(_0xda0d('0x7'));module[_0xda0d('0x8')]=function(_0x36af9f,_0x544904){return _0x36af9f[_0xda0d('0x9')](_0xda0d('0xa'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bb8=['./license.attributes','exports','define','License','util','api','moment','request-promise','path','rimraf'];(function(_0x5bdcdb,_0x4ea804){var _0x44993c=function(_0xc7aa6f){while(--_0xc7aa6f){_0x5bdcdb['push'](_0x5bdcdb['shift']());}};_0x44993c(++_0x4ea804);}(_0x1bb8,0xc2));var _0x81bb=function(_0x362a20,_0x5a7836){_0x362a20=_0x362a20-0x0;var _0x2f1ee6=_0x1bb8[_0x362a20];return _0x2f1ee6;};'use strict';var _=require('lodash');var util=require(_0x81bb('0x0'));var logger=require('../../config/logger')(_0x81bb('0x1'));var moment=require(_0x81bb('0x2'));var BPromise=require('bluebird');var rp=require(_0x81bb('0x3'));var fs=require('fs');var path=require(_0x81bb('0x4'));var rimraf=require(_0x81bb('0x5'));var config=require('../../config/environment');var attributes=require(_0x81bb('0x6'));module[_0x81bb('0x7')]=function(_0x4e1b58,_0xca5837){return _0x4e1b58[_0x81bb('0x8')](_0x81bb('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 340ffa9..5fec3a2 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 _0x94d2=['request\x20sent','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1e744c,_0x3feb93){var _0x122478=function(_0x30e116){while(--_0x30e116){_0x1e744c['push'](_0x1e744c['shift']());}};_0x122478(++_0x3feb93);}(_0x94d2,0x1cd));var _0x294d=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0x94d2[_0x374ada];return _0x449ed8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x294d('0x0'));var BPromise=require(_0x294d('0x1'));var rs=require(_0x294d('0x2'));var fs=require('fs');var Redis=require(_0x294d('0x3'));var db=require(_0x294d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x294d('0x5'));var config=require(_0x294d('0x6'));var jayson=require(_0x294d('0x7'));var client=jayson[_0x294d('0x8')][_0x294d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e023f,_0x5c3d7c,_0x2cf111){return new BPromise(function(_0x6653fc,_0x1cd249){return client[_0x294d('0xa')](_0x5e023f,_0x2cf111)[_0x294d('0xb')](function(_0x49923f){logger[_0x294d('0xc')](_0x294d('0xd'),_0x5c3d7c,'request\x20sent');logger[_0x294d('0xe')](_0x294d('0xf'),_0x5c3d7c,'request\x20sent',JSON['stringify'](_0x49923f));if(_0x49923f[_0x294d('0x10')]){if(_0x49923f[_0x294d('0x10')][_0x294d('0x11')]===0x1f4){logger['error'](_0x294d('0xd'),_0x5c3d7c,_0x49923f[_0x294d('0x10')][_0x294d('0x12')]);return _0x1cd249(_0x49923f[_0x294d('0x10')]['message']);}logger[_0x294d('0x10')]('License,\x20%s,\x20%s',_0x5c3d7c,_0x49923f['error'][_0x294d('0x12')]);return _0x6653fc(_0x49923f[_0x294d('0x10')][_0x294d('0x12')]);}else{logger[_0x294d('0xc')]('License,\x20%s,\x20%s',_0x5c3d7c,_0x294d('0x13'));_0x6653fc(_0x49923f['result']['message']);}})['catch'](function(_0x4f2436){logger[_0x294d('0x10')](_0x294d('0xd'),_0x5c3d7c,_0x4f2436);_0x1cd249(_0x4f2436);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'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')]('License,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 551256a..639f684 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 _0xde96=['addImap','addSmtp','addInteraction','addApplications','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','post','addDisposition','addAnswer'];(function(_0x2383f1,_0x2a85dd){var _0x2600f3=function(_0xd66970){while(--_0xd66970){_0x2383f1['push'](_0x2383f1['shift']());}};_0x2600f3(++_0x2a85dd);}(_0xde96,0x97));var _0x6de9=function(_0x158245,_0x299811){_0x158245=_0x158245-0x0;var _0x38031c=_0xde96[_0x158245];return _0x38031c;};'use strict';var multer=require(_0x6de9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6de9('0x1'));var express=require(_0x6de9('0x2'));var router=express['Router']();var auth=require(_0x6de9('0x3'));var interaction=require(_0x6de9('0x4'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router['get']('/',auth[_0x6de9('0x5')](),controller[_0x6de9('0x6')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x6de9('0x7')]);router[_0x6de9('0x8')](_0x6de9('0x9'),auth[_0x6de9('0x5')](),controller[_0x6de9('0xa')]);router[_0x6de9('0x8')](_0x6de9('0xb'),auth[_0x6de9('0x5')](),controller[_0x6de9('0xc')]);router[_0x6de9('0x8')](_0x6de9('0xd'),auth[_0x6de9('0x5')](),controller[_0x6de9('0xe')]);router[_0x6de9('0x8')](_0x6de9('0xf'),auth['isAuthenticated'](),controller[_0x6de9('0x10')]);router[_0x6de9('0x8')](_0x6de9('0x11'),auth[_0x6de9('0x5')](),controller[_0x6de9('0x12')]);router[_0x6de9('0x8')](_0x6de9('0x13'),auth[_0x6de9('0x5')](),controller[_0x6de9('0x14')]);router[_0x6de9('0x8')]('/:id/applications',auth[_0x6de9('0x5')](),controller[_0x6de9('0x15')]);router['get'](_0x6de9('0x16'),auth[_0x6de9('0x5')](),controller[_0x6de9('0x17')]);router[_0x6de9('0x8')]('/:id/verify',auth[_0x6de9('0x5')](),controller[_0x6de9('0x18')]);router[_0x6de9('0x8')](_0x6de9('0x19'),auth[_0x6de9('0x5')](),controller['getAgents']);router[_0x6de9('0x1a')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6de9('0x1b')]);router[_0x6de9('0x1a')](_0x6de9('0xd'),auth[_0x6de9('0x5')](),controller[_0x6de9('0x1c')]);router[_0x6de9('0x1a')]('/',auth[_0x6de9('0x5')](),controller['create']);router[_0x6de9('0x1a')]('/:id/in_servers',auth[_0x6de9('0x5')](),controller[_0x6de9('0x1d')]);router[_0x6de9('0x1a')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x6de9('0x1e')]);router[_0x6de9('0x1a')](_0x6de9('0x13'),auth[_0x6de9('0x5')](),controller[_0x6de9('0x1f')]);router[_0x6de9('0x1a')]('/:id/applications',auth[_0x6de9('0x5')](),controller[_0x6de9('0x20')]);router['post']('/:id/send',auth[_0x6de9('0x5')](),controller[_0x6de9('0x21')]);router[_0x6de9('0x1a')](_0x6de9('0x19'),auth['isAuthenticated'](),controller[_0x6de9('0x22')]);router[_0x6de9('0x23')](_0x6de9('0x9'),auth[_0x6de9('0x5')](),controller[_0x6de9('0x24')]);router[_0x6de9('0x25')](_0x6de9('0xb'),auth[_0x6de9('0x5')](),controller[_0x6de9('0x26')]);router[_0x6de9('0x25')](_0x6de9('0xd'),auth[_0x6de9('0x5')](),controller[_0x6de9('0x27')]);router[_0x6de9('0x25')](_0x6de9('0xf'),auth[_0x6de9('0x5')](),controller[_0x6de9('0x28')]);router['delete'](_0x6de9('0x11'),auth['isAuthenticated'](),controller[_0x6de9('0x29')]);router[_0x6de9('0x25')](_0x6de9('0x9'),auth[_0x6de9('0x5')](),controller[_0x6de9('0x2a')]);router['delete']('/:id/users',auth[_0x6de9('0x5')](),controller[_0x6de9('0x2b')]);module[_0x6de9('0x2c')]=router; \ No newline at end of file +var _0x1ba3=['removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','create','addImap','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','addAgents','put','/:id','update','delete','removeAnswers','removeImap','removeSmtp','destroy'];(function(_0x256b96,_0x160abc){var _0x3b5bb0=function(_0x5ae825){while(--_0x5ae825){_0x256b96['push'](_0x256b96['shift']());}};_0x3b5bb0(++_0x160abc);}(_0x1ba3,0x16a));var _0x31ba=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0x1ba3[_0x173452];return _0xee3fd0;};'use strict';var multer=require(_0x31ba('0x0'));var util=require(_0x31ba('0x1'));var path=require(_0x31ba('0x2'));var timeout=require('connect-timeout');var express=require(_0x31ba('0x3'));var router=express['Router']();var auth=require(_0x31ba('0x4'));var interaction=require(_0x31ba('0x5'));var config=require(_0x31ba('0x6'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0x31ba('0x7')](),controller['index']);router[_0x31ba('0x8')](_0x31ba('0x9'),auth[_0x31ba('0x7')](),controller['describe']);router['get']('/:id',auth[_0x31ba('0x7')](),controller['show']);router['get'](_0x31ba('0xa'),auth[_0x31ba('0x7')](),controller[_0x31ba('0xb')]);router[_0x31ba('0x8')](_0x31ba('0xc'),auth[_0x31ba('0x7')](),controller[_0x31ba('0xd')]);router[_0x31ba('0x8')](_0x31ba('0xe'),auth['isAuthenticated'](),controller[_0x31ba('0xf')]);router[_0x31ba('0x8')](_0x31ba('0x10'),auth[_0x31ba('0x7')](),controller['getSmtp']);router['get'](_0x31ba('0x11'),auth[_0x31ba('0x7')](),controller[_0x31ba('0x12')]);router[_0x31ba('0x8')]('/:id/applications',auth[_0x31ba('0x7')](),controller['getApplications']);router['get'](_0x31ba('0x13'),auth[_0x31ba('0x7')](),controller[_0x31ba('0x14')]);router[_0x31ba('0x8')](_0x31ba('0x15'),auth[_0x31ba('0x7')](),controller[_0x31ba('0x16')]);router[_0x31ba('0x8')](_0x31ba('0x17'),auth[_0x31ba('0x7')](),controller['getAgents']);router[_0x31ba('0x18')](_0x31ba('0xa'),auth['isAuthenticated'](),controller[_0x31ba('0x19')]);router['post'](_0x31ba('0xc'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x31ba('0x18')]('/',auth['isAuthenticated'](),controller[_0x31ba('0x1a')]);router[_0x31ba('0x18')](_0x31ba('0xe'),auth['isAuthenticated'](),controller[_0x31ba('0x1b')]);router[_0x31ba('0x18')]('/:id/out_servers',auth[_0x31ba('0x7')](),controller[_0x31ba('0x1c')]);router['post']('/:id/interactions',auth[_0x31ba('0x7')](),controller[_0x31ba('0x1d')]);router[_0x31ba('0x18')](_0x31ba('0x1e'),auth['isAuthenticated'](),controller[_0x31ba('0x1f')]);router[_0x31ba('0x18')](_0x31ba('0x20'),auth[_0x31ba('0x7')](),controller[_0x31ba('0x21')]);router[_0x31ba('0x18')](_0x31ba('0x17'),auth['isAuthenticated'](),controller[_0x31ba('0x22')]);router[_0x31ba('0x23')](_0x31ba('0x24'),auth[_0x31ba('0x7')](),controller[_0x31ba('0x25')]);router[_0x31ba('0x26')](_0x31ba('0xa'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x31ba('0x26')](_0x31ba('0xc'),auth[_0x31ba('0x7')](),controller[_0x31ba('0x27')]);router[_0x31ba('0x26')](_0x31ba('0xe'),auth[_0x31ba('0x7')](),controller[_0x31ba('0x28')]);router[_0x31ba('0x26')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x31ba('0x29')]);router['delete'](_0x31ba('0x24'),auth[_0x31ba('0x7')](),controller[_0x31ba('0x2a')]);router[_0x31ba('0x26')](_0x31ba('0x17'),auth[_0x31ba('0x7')](),controller[_0x31ba('0x2b')]);module[_0x31ba('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index c046a20..ab6f394 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 _0xf949=['BOOLEAN','TEXT','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x5c43b8,_0x290ca2){var _0x5438fe=function(_0x3fcdf0){while(--_0x3fcdf0){_0x5c43b8['push'](_0x5c43b8['shift']());}};_0x5438fe(++_0x290ca2);}(_0xf949,0x16f));var _0x9f94=function(_0x3f3a34,_0x3456ef){_0x3f3a34=_0x3f3a34-0x0;var _0x27328b=_0xf949[_0x3f3a34];return _0x27328b;};'use strict';var Sequelize=require(_0x9f94('0x0'));module[_0x9f94('0x1')]={'description':{'type':Sequelize[_0x9f94('0x2')]},'name':{'type':Sequelize[_0x9f94('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x9f94('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9f94('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x9f94('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x9f94('0x4')]},'markAsUnread':{'type':Sequelize[_0x9f94('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x9f94('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9f94('0x4')],'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[_0x9f94('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9f94('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9f94('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9f94('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9f94('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9f94('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9f94('0x3')],'defaultValue':![],'comment':_0x9f94('0x6'),'set':function(_0x57c5dd){if(!_0x57c5dd)this[_0x9f94('0x7')](_0x9f94('0x8'),null);this[_0x9f94('0x7')](_0x9f94('0x9'),_0x57c5dd);}}}; \ No newline at end of file +var _0x36d3=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','BOOLEAN'];(function(_0x3cb3cd,_0x51514a){var _0x2a6c29=function(_0x57fc10){while(--_0x57fc10){_0x3cb3cd['push'](_0x3cb3cd['shift']());}};_0x2a6c29(++_0x51514a);}(_0x36d3,0x75));var _0x336d=function(_0x312f43,_0x37a6aa){_0x312f43=_0x312f43-0x0;var _0x171d26=_0x36d3[_0x312f43];return _0x171d26;};'use strict';var Sequelize=require('sequelize');module[_0x336d('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x336d('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x336d('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x336d('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x336d('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x336d('0x1')],'allowNull':![],'defaultValue':_0x336d('0x3')},'fontSize':{'type':Sequelize[_0x336d('0x4')](0x2)[_0x336d('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x336d('0x6')],'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[_0x336d('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x336d('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x336d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x336d('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x336d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x336d('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x336d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x336d('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x336d('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x13cb5e){if(!_0x13cb5e)this[_0x336d('0x7')](_0x336d('0x8'),null);this[_0x336d('0x7')](_0x336d('0x9'),_0x13cb5e);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 0b4c26f..4b1c24b 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 _0x49f8=['from','%s\x20<%s>','attachments','join','server/files/attachments','auth','secure','SendMail','sendMail','List\x20not\x20found','List','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','offset','limit','set','Content-Range','apply','reject','save','update','destroy','MailAccounts','UserProfileResource','stack','name','send','index','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','merge','find','body','MailServerIn','describe','addDisposition','Disposition','findOne','hasOwnProperty','MailAccountId','count','findAll','removeDispositions','ids','CannedAnswer','create','getAnswers','removeAnswers','key','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','pass','cpassword','authentication','host','port','service','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','MailApplication','findAndCountAll','getApplications','getMessages','$gte','split','format','MailMessage','CmList','Contacts','updatedAt','DESC'];(function(_0x51a4f1,_0xa1828c){var _0x5ac341=function(_0x494a44){while(--_0x494a44){_0x51a4f1['push'](_0x51a4f1['shift']());}};_0x5ac341(++_0xa1828c);}(_0x49f8,0x192));var _0x849f=function(_0x3de590,_0x2edbcd){_0x3de590=_0x3de590-0x0;var _0x3886ad=_0x49f8[_0x3de590];return _0x3886ad;};'use strict';var pdf=require(_0x849f('0x0'));var emlformat=require(_0x849f('0x1'));var rimraf=require(_0x849f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x849f('0x3'));var moment=require('moment');var BPromise=require(_0x849f('0x4'));var Mustache=require(_0x849f('0x5'));var util=require(_0x849f('0x6'));var path=require('path');var sox=require(_0x849f('0x7'));var csv=require(_0x849f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x849f('0x9'));var squel=require(_0x849f('0xa'));var crypto=require(_0x849f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x849f('0x8'));var querystring=require(_0x849f('0xc'));var Papa=require('papaparse');var Redis=require(_0x849f('0xd'));var authService=require(_0x849f('0xe'));var qs=require(_0x849f('0xf'));var as=require(_0x849f('0x10'));var hardwareService=require(_0x849f('0x11'));var logger=require(_0x849f('0x12'))('api');var utils=require(_0x849f('0x13'));var config=require(_0x849f('0x14'));var db=require(_0x849f('0x15'))['db'];config[_0x849f('0x16')]=_[_0x849f('0x17')](config['redis'],{'host':_0x849f('0x18'),'port':0x18eb});var socket=require(_0x849f('0x19'))(new Redis(config[_0x849f('0x16')]));require(_0x849f('0x1a'))[_0x849f('0x1b')](socket);var jayson=require(_0x849f('0x1c'));var client=jayson['client'][_0x849f('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x1a2d60,_0x3c9a9c,_0x2ad5e0){if(_0x2ad5e0){var _0x1de020=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1de020['test'](_0x3c9a9c)){return _0x1a2d60;}else{throw new db[(_0x849f('0x1e'))]['ValidationError'](_0x849f('0x1f'));}}else{return _0x1a2d60;}}function respondWithRpcPromise(_0x27950c,_0x4e4c41,_0x51432c,_0xd2df0){return new BPromise(function(_0x1228e8,_0x4bdebe){var _0x365a77=_0xd2df0||client;return _0x365a77['request'](_0x27950c,_0x51432c)[_0x849f('0x20')](function(_0x3e3710){logger[_0x849f('0x21')](_0x849f('0x22'),_0x4e4c41,'request\x20sent');logger[_0x849f('0x23')](_0x849f('0x24'),_0x4e4c41,_0x849f('0x25'),JSON[_0x849f('0x26')](_0x3e3710));if(_0x3e3710[_0x849f('0x27')]){if(_0x3e3710[_0x849f('0x27')]['code']===0x1f4){logger['error'](_0x849f('0x22'),_0x4e4c41,_0x3e3710[_0x849f('0x27')][_0x849f('0x28')]);return _0x4bdebe(_0x3e3710[_0x849f('0x27')][_0x849f('0x28')]);}logger[_0x849f('0x27')](_0x849f('0x22'),_0x4e4c41,_0x3e3710[_0x849f('0x27')][_0x849f('0x28')]);return _0x1228e8(_0x3e3710[_0x849f('0x27')][_0x849f('0x28')]);}else{logger['info'](_0x849f('0x22'),_0x4e4c41,_0x849f('0x25'));_0x1228e8(_0x3e3710[_0x849f('0x29')][_0x849f('0x28')]);}})[_0x849f('0x2a')](function(_0x1fabba){logger[_0x849f('0x27')](_0x849f('0x22'),_0x4e4c41,_0x1fabba);_0x4bdebe(_0x1fabba);});});}function respondWithStatusCode(_0x151071,_0x4b78a7){_0x4b78a7=_0x4b78a7||0xcc;return function(_0x3cdc5e){if(_0x3cdc5e){return _0x151071[_0x849f('0x2b')](_0x4b78a7);}return _0x151071['status'](_0x4b78a7)['end']();};}function respondWithResult(_0x45c486,_0x4a6b00){_0x4a6b00=_0x4a6b00||0xc8;return function(_0x369c8b){if(_0x369c8b){return _0x45c486[_0x849f('0x2c')](_0x4a6b00)['json'](_0x369c8b);}};}function respondWithFilteredResult(_0x545006,_0x3232c9){return function(_0x1082e9){if(_0x1082e9){var _0x2ed541=_0x1082e9['count'],_0xc6f648=_0x3232c9[_0x849f('0x2d')],_0x4a8100=_0x3232c9[_0x849f('0x2d')]+_0x3232c9[_0x849f('0x2e')],_0xf3b8ca;if(_0x4a8100>=_0x2ed541){_0x4a8100=_0x2ed541;_0xf3b8ca=0xc8;}else{_0xf3b8ca=0xce;}_0x545006[_0x849f('0x2c')](_0xf3b8ca);return _0x545006[_0x849f('0x2f')](_0x849f('0x30'),_0xc6f648+'-'+_0x4a8100+'/'+_0x2ed541)['json'](_0x1082e9);}return null;};}function patchUpdates(_0x202679){return function(_0x4408ae){try{jsonpatch[_0x849f('0x31')](_0x4408ae,_0x202679,!![]);}catch(_0x4f96ca){return BPromise[_0x849f('0x32')](_0x4f96ca);}return _0x4408ae[_0x849f('0x33')]();};}function saveUpdates(_0x4a2cca,_0x5a978c){return function(_0x4153c5){if(_0x4153c5){return _0x4153c5[_0x849f('0x34')](_0x4a2cca)[_0x849f('0x20')](function(_0xee3278){return _0xee3278;});}return null;};}function removeEntity(_0x4a7d9d,_0x50dcd4){return function(_0x184578){if(_0x184578){return _0x184578[_0x849f('0x35')]()[_0x849f('0x20')](function(){var _0x29e20b=_0x184578['get']({'plain':!![]});var _0x1a0b93=_0x849f('0x36');return db[_0x849f('0x37')][_0x849f('0x35')]({'where':{'type':_0x1a0b93,'resourceId':_0x29e20b['id']}})[_0x849f('0x20')](function(){return _0x184578;});})[_0x849f('0x20')](function(){_0x4a7d9d[_0x849f('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6b0b,_0x41bafa){return function(_0x2d9bcb){if(!_0x2d9bcb){_0x2c6b0b[_0x849f('0x2b')](0x194);}return _0x2d9bcb;};}function handleError(_0x8582fc,_0x1dbe5f){_0x1dbe5f=_0x1dbe5f||0x1f4;return function(_0x1b9994){logger[_0x849f('0x27')](_0x1b9994[_0x849f('0x38')]);if(_0x1b9994['name']){delete _0x1b9994[_0x849f('0x39')];}_0x8582fc[_0x849f('0x2c')](_0x1dbe5f)[_0x849f('0x3a')](_0x1b9994);};}exports[_0x849f('0x3b')]=function(_0x16df5d,_0x42b4a8){var _0x5425ce={'include':[{'model':db['MailServerIn'],'as':_0x849f('0x3c')},{'model':db[_0x849f('0x3d')],'as':_0x849f('0x3e')},{'model':db[_0x849f('0x3f')],'as':_0x849f('0x40')}]},_0x1dcccb={},_0x32acc1={'count':0x0,'rows':[]};var _0x953443=_[_0x849f('0x41')](db[_0x849f('0x42')][_0x849f('0x43')],function(_0x4a4c8b){return{'name':_0x4a4c8b['fieldName'],'type':_0x4a4c8b[_0x849f('0x44')]['key']};});_0x1dcccb[_0x849f('0x45')]=_[_0x849f('0x41')](_0x953443,_0x849f('0x39'));_0x1dcccb[_0x849f('0x46')]=_[_0x849f('0x47')](_0x16df5d[_0x849f('0x46')]);_0x1dcccb[_0x849f('0x48')]=_['intersection'](_0x1dcccb[_0x849f('0x45')],_0x1dcccb['query']);_0x5425ce[_0x849f('0x49')]=_[_0x849f('0x4a')](_0x1dcccb[_0x849f('0x45')],qs[_0x849f('0x4b')](_0x16df5d['query'][_0x849f('0x4b')]));_0x5425ce[_0x849f('0x49')]=_0x5425ce[_0x849f('0x49')][_0x849f('0x4c')]?_0x5425ce[_0x849f('0x49')]:_0x1dcccb['model'];if(!_0x16df5d['query']['hasOwnProperty'](_0x849f('0x4d'))){_0x5425ce[_0x849f('0x2e')]=qs[_0x849f('0x2e')](_0x16df5d['query'][_0x849f('0x2e')]);_0x5425ce['offset']=qs[_0x849f('0x2d')](_0x16df5d[_0x849f('0x46')][_0x849f('0x2d')]);}_0x5425ce[_0x849f('0x4e')]=qs[_0x849f('0x4f')](_0x16df5d[_0x849f('0x46')][_0x849f('0x4f')]);_0x5425ce[_0x849f('0x50')]=qs[_0x849f('0x48')](_[_0x849f('0x51')](_0x16df5d[_0x849f('0x46')],_0x1dcccb[_0x849f('0x48')]));if(_0x16df5d[_0x849f('0x46')][_0x849f('0x52')]){_0x5425ce['where']=_['merge'](_0x5425ce[_0x849f('0x50')],{'$or':_[_0x849f('0x41')](_0x953443,function(_0x3be5e2){if(_0x3be5e2[_0x849f('0x44')]!==_0x849f('0x53')){var _0x469576={};_0x469576[_0x3be5e2['name']]={'$like':'%'+_0x16df5d['query']['filter']+'%'};return _0x469576;}})});}_0x5425ce=_['merge']({},_0x5425ce,_0x16df5d[_0x849f('0x54')]);var _0x4fe8dd={'where':_0x5425ce[_0x849f('0x50')]};return db['MailAccount']['count'](_0x4fe8dd)[_0x849f('0x20')](function(_0x32cc4e){_0x32acc1['count']=_0x32cc4e;if(_0x16df5d[_0x849f('0x46')][_0x849f('0x55')]){_0x5425ce[_0x849f('0x56')]=[{'all':!![]}];}return db[_0x849f('0x42')]['findAll'](_0x5425ce);})['then'](function(_0x4a77e3){_0x32acc1[_0x849f('0x57')]=_0x4a77e3;return _0x32acc1;})[_0x849f('0x20')](respondWithFilteredResult(_0x42b4a8,_0x5425ce))[_0x849f('0x2a')](handleError(_0x42b4a8,null));};exports[_0x849f('0x58')]=function(_0x14d355,_0x3127f5){var _0x5410c8={'raw':![],'where':{'id':_0x14d355[_0x849f('0x59')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x849f('0x3c')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0x849f('0x40')}]},_0x21f662={};_0x21f662['model']=_[_0x849f('0x47')](db[_0x849f('0x42')][_0x849f('0x43')]);_0x21f662['query']=_['keys'](_0x14d355[_0x849f('0x46')]);_0x21f662[_0x849f('0x48')]=_[_0x849f('0x4a')](_0x21f662[_0x849f('0x45')],_0x21f662[_0x849f('0x46')]);_0x5410c8['attributes']=_['intersection'](_0x21f662[_0x849f('0x45')],qs[_0x849f('0x4b')](_0x14d355[_0x849f('0x46')]['fields']));_0x5410c8[_0x849f('0x49')]=_0x5410c8[_0x849f('0x49')][_0x849f('0x4c')]?_0x5410c8[_0x849f('0x49')]:_0x21f662[_0x849f('0x45')];if(_0x14d355[_0x849f('0x46')][_0x849f('0x55')]){_0x5410c8['include']=[{'all':!![]}];}_0x5410c8=_[_0x849f('0x5a')]({},_0x5410c8,_0x14d355[_0x849f('0x54')]);return db[_0x849f('0x42')][_0x849f('0x5b')](_0x5410c8)['then'](handleEntityNotFound(_0x3127f5,null))['then'](respondWithResult(_0x3127f5,null))[_0x849f('0x2a')](handleError(_0x3127f5,null));};exports['update']=function(_0x500e88,_0x338e87){if(_0x500e88['body']['id']){delete _0x500e88[_0x849f('0x5c')]['id'];}return db[_0x849f('0x42')][_0x849f('0x5b')]({'where':{'id':_0x500e88[_0x849f('0x59')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x849f('0x3c')},{'model':db[_0x849f('0x3d')],'as':_0x849f('0x3e')},{'model':db[_0x849f('0x3f')],'as':'mandatoryDispositionPause'}]})[_0x849f('0x20')](handleEntityNotFound(_0x338e87,null))[_0x849f('0x20')](saveUpdates(_0x500e88[_0x849f('0x5c')],null))[_0x849f('0x20')](function(_0x40b9a4){if(_0x40b9a4&&_0x500e88['body'][_0x849f('0x3c')]){return db[_0x849f('0x5d')][_0x849f('0x34')](_0x500e88[_0x849f('0x5c')][_0x849f('0x3c')],{'where':{'MailAccountId':_0x40b9a4['id']}})[_0x849f('0x20')](function(){return _0x40b9a4;});}return _0x40b9a4;})[_0x849f('0x20')](function(_0x44d4fb){if(_0x44d4fb&&_0x500e88['body'][_0x849f('0x3e')]){return db[_0x849f('0x3d')][_0x849f('0x34')](_0x500e88['body'][_0x849f('0x3e')],{'where':{'MailAccountId':_0x44d4fb['id']}})[_0x849f('0x20')](function(){return _0x44d4fb;});}return _0x44d4fb;})[_0x849f('0x20')](respondWithResult(_0x338e87,null))[_0x849f('0x2a')](handleError(_0x338e87,null));};exports[_0x849f('0x5e')]=function(_0x4423bb,_0x54d576){return db[_0x849f('0x42')][_0x849f('0x5e')]()[_0x849f('0x20')](respondWithResult(_0x54d576,null))['catch'](handleError(_0x54d576,null));};exports[_0x849f('0x5f')]=function(_0x218d18,_0x46cd02,_0x235423){if(_0x218d18[_0x849f('0x5c')]['id']){delete _0x218d18['body']['id'];}return db['MailAccount'][_0x849f('0x5b')]({'where':{'id':_0x218d18[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x46cd02,null))[_0x849f('0x20')](function(_0x5160a5){if(_0x5160a5){_0x218d18[_0x849f('0x5c')]['MailAccountId']=_0x5160a5['id'];return db[_0x849f('0x60')]['create'](_0x218d18[_0x849f('0x5c')]);}})[_0x849f('0x20')](respondWithResult(_0x46cd02,null))[_0x849f('0x2a')](handleError(_0x46cd02,null));};exports['getDispositions']=function(_0x3feb39,_0x375b3f,_0x22570a){var _0x58e94b={'raw':![],'where':{}};var _0x11dbda={};var _0x1d841b={'count':0x0,'rows':[]};return db[_0x849f('0x42')][_0x849f('0x61')]({'where':{'id':_0x3feb39[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x375b3f,null))['then'](function(_0x581770){if(_0x581770){_0x11dbda[_0x849f('0x45')]=_[_0x849f('0x47')](db['Disposition'][_0x849f('0x43')]);_0x11dbda[_0x849f('0x46')]=_[_0x849f('0x47')](_0x3feb39[_0x849f('0x46')]);_0x11dbda['filters']=_[_0x849f('0x4a')](_0x11dbda[_0x849f('0x45')],_0x11dbda[_0x849f('0x46')]);_0x58e94b['attributes']=_[_0x849f('0x4a')](_0x11dbda[_0x849f('0x45')],qs[_0x849f('0x4b')](_0x3feb39[_0x849f('0x46')][_0x849f('0x4b')]));_0x58e94b[_0x849f('0x49')]=_0x58e94b['attributes']['length']?_0x58e94b[_0x849f('0x49')]:_0x11dbda[_0x849f('0x45')];if(!_0x3feb39[_0x849f('0x46')][_0x849f('0x62')](_0x849f('0x4d'))){_0x58e94b[_0x849f('0x2e')]=qs[_0x849f('0x2e')](_0x3feb39[_0x849f('0x46')][_0x849f('0x2e')]);_0x58e94b['offset']=qs['offset'](_0x3feb39[_0x849f('0x46')][_0x849f('0x2d')]);}_0x58e94b['order']=qs['sort'](_0x3feb39[_0x849f('0x46')]['sort']);_0x58e94b[_0x849f('0x50')]=qs[_0x849f('0x48')](_['pick'](_0x3feb39[_0x849f('0x46')],_0x11dbda[_0x849f('0x48')]));_0x58e94b[_0x849f('0x50')][_0x849f('0x63')]=_0x581770['id'];if(_0x3feb39[_0x849f('0x46')][_0x849f('0x52')]){_0x58e94b['where']=_['merge'](_0x58e94b[_0x849f('0x50')],{'$or':_['map'](_0x58e94b['attributes'],function(_0x430996){var _0x53fc02={};_0x53fc02[_0x430996]={'$like':'%'+_0x3feb39[_0x849f('0x46')][_0x849f('0x52')]+'%'};return _0x53fc02;})});}_0x58e94b=_[_0x849f('0x5a')]({},_0x58e94b,_0x3feb39['options']);return db[_0x849f('0x60')][_0x849f('0x64')]({'where':_0x58e94b['where']})[_0x849f('0x20')](function(_0x9d356d){_0x1d841b[_0x849f('0x64')]=_0x9d356d;if(_0x3feb39[_0x849f('0x46')][_0x849f('0x55')]){_0x58e94b[_0x849f('0x56')]=[{'all':!![]}];}return db[_0x849f('0x60')][_0x849f('0x65')](_0x58e94b);})['then'](function(_0x28f9f3){_0x1d841b['rows']=_0x28f9f3;return _0x1d841b;});}})[_0x849f('0x20')](respondWithFilteredResult(_0x375b3f,_0x58e94b))['catch'](handleError(_0x375b3f,null));};exports[_0x849f('0x66')]=function(_0x588d2a,_0x224f67,_0x3cb3fb){return db[_0x849f('0x42')][_0x849f('0x5b')]({'where':{'id':_0x588d2a['params']['id']}})['then'](handleEntityNotFound(_0x224f67,null))['then'](function(_0x7c8649){if(_0x7c8649){return _0x7c8649[_0x849f('0x66')](_0x588d2a[_0x849f('0x46')][_0x849f('0x67')]);}})[_0x849f('0x20')](respondWithStatusCode(_0x224f67,null))['catch'](handleError(_0x224f67,null));};exports['addAnswer']=function(_0x432491,_0x44c214,_0x271526){if(_0x432491[_0x849f('0x5c')]['id']){delete _0x432491[_0x849f('0x5c')]['id'];}return db[_0x849f('0x42')][_0x849f('0x5b')]({'where':{'id':_0x432491[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x44c214,null))[_0x849f('0x20')](function(_0x3bd64b){if(_0x3bd64b){_0x432491[_0x849f('0x5c')]['MailAccountId']=_0x3bd64b['id'];return db[_0x849f('0x68')][_0x849f('0x69')](_0x432491[_0x849f('0x5c')]);}})['then'](respondWithResult(_0x44c214,null))[_0x849f('0x2a')](handleError(_0x44c214,null));};exports[_0x849f('0x6a')]=function(_0x59f6b8,_0x337204,_0x4a13da){var _0x1eea80={'raw':![],'where':{}};var _0x30ce29={};var _0x23a44a={'count':0x0,'rows':[]};return db[_0x849f('0x42')][_0x849f('0x61')]({'where':{'id':_0x59f6b8[_0x849f('0x59')]['id']}})['then'](handleEntityNotFound(_0x337204,null))['then'](function(_0x233960){if(_0x233960){_0x30ce29[_0x849f('0x45')]=_[_0x849f('0x47')](db[_0x849f('0x68')]['rawAttributes']);_0x30ce29[_0x849f('0x46')]=_[_0x849f('0x47')](_0x59f6b8[_0x849f('0x46')]);_0x30ce29['filters']=_[_0x849f('0x4a')](_0x30ce29[_0x849f('0x45')],_0x30ce29[_0x849f('0x46')]);_0x1eea80[_0x849f('0x49')]=_['intersection'](_0x30ce29['model'],qs['fields'](_0x59f6b8[_0x849f('0x46')][_0x849f('0x4b')]));_0x1eea80[_0x849f('0x49')]=_0x1eea80[_0x849f('0x49')]['length']?_0x1eea80['attributes']:_0x30ce29['model'];if(!_0x59f6b8[_0x849f('0x46')][_0x849f('0x62')](_0x849f('0x4d'))){_0x1eea80[_0x849f('0x2e')]=qs[_0x849f('0x2e')](_0x59f6b8['query'][_0x849f('0x2e')]);_0x1eea80[_0x849f('0x2d')]=qs[_0x849f('0x2d')](_0x59f6b8[_0x849f('0x46')][_0x849f('0x2d')]);}_0x1eea80[_0x849f('0x4e')]=qs[_0x849f('0x4f')](_0x59f6b8[_0x849f('0x46')][_0x849f('0x4f')]);_0x1eea80[_0x849f('0x50')]=qs[_0x849f('0x48')](_[_0x849f('0x51')](_0x59f6b8[_0x849f('0x46')],_0x30ce29[_0x849f('0x48')]));_0x1eea80[_0x849f('0x50')][_0x849f('0x63')]=_0x233960['id'];if(_0x59f6b8[_0x849f('0x46')][_0x849f('0x52')]){_0x1eea80[_0x849f('0x50')]=_[_0x849f('0x5a')](_0x1eea80[_0x849f('0x50')],{'$or':_[_0x849f('0x41')](_0x1eea80[_0x849f('0x49')],function(_0x881d76){var _0x50891b={};_0x50891b[_0x881d76]={'$like':'%'+_0x59f6b8[_0x849f('0x46')]['filter']+'%'};return _0x50891b;})});}_0x1eea80=_[_0x849f('0x5a')]({},_0x1eea80,_0x59f6b8[_0x849f('0x54')]);return db[_0x849f('0x68')][_0x849f('0x64')]({'where':_0x1eea80['where']})[_0x849f('0x20')](function(_0x4615e7){_0x23a44a['count']=_0x4615e7;if(_0x59f6b8[_0x849f('0x46')][_0x849f('0x55')]){_0x1eea80['include']=[{'all':!![]}];}return db[_0x849f('0x68')][_0x849f('0x65')](_0x1eea80);})[_0x849f('0x20')](function(_0x250de8){_0x23a44a['rows']=_0x250de8;return _0x23a44a;});}})[_0x849f('0x20')](respondWithFilteredResult(_0x337204,_0x1eea80))[_0x849f('0x2a')](handleError(_0x337204,null));};exports['removeAnswers']=function(_0x1d34a2,_0x11a969,_0x115a41){return db['MailAccount'][_0x849f('0x5b')]({'where':{'id':_0x1d34a2[_0x849f('0x59')]['id']}})['then'](handleEntityNotFound(_0x11a969,null))[_0x849f('0x20')](function(_0x1fc992){if(_0x1fc992){return _0x1fc992[_0x849f('0x6b')](_0x1d34a2[_0x849f('0x46')][_0x849f('0x67')]);}})['then'](respondWithStatusCode(_0x11a969,null))['catch'](handleError(_0x11a969,null));};exports[_0x849f('0x69')]=function(_0x4243a1,_0x4c85b2){var _0xa93616={'name':_0x4243a1['body']['name'],'key':_0x4243a1[_0x849f('0x5c')][_0x849f('0x6c')],'email':_0x4243a1['body'][_0x849f('0x6d')],'ListId':_0x4243a1['body'][_0x849f('0x6e')],'active':!_[_0x849f('0x6f')](_0x4243a1[_0x849f('0x5c')][_0x849f('0x70')])?_0x4243a1['body'][_0x849f('0x70')]:!![],'description':_0x4243a1['body'][_0x849f('0x71')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x4243a1[_0x849f('0x5c')][_0x849f('0x72')])){if(_0x4243a1['body'][_0x849f('0x73')]){_0xa93616[_0x849f('0x3c')][_0x849f('0x74')]=_0xa93616['Smtp'][_0x849f('0x74')]=_0x4243a1[_0x849f('0x5c')][_0x849f('0x75')];_0xa93616[_0x849f('0x3c')]['password']=_0xa93616[_0x849f('0x3e')][_0x849f('0x76')]=_0x4243a1[_0x849f('0x5c')][_0x849f('0x77')];}else{_0xa93616[_0x849f('0x3c')][_0x849f('0x78')]=_0xa93616[_0x849f('0x3e')]['authentication']=![];}_0xa93616['Imap']['host']=_0x4243a1['body']['Imap'][_0x849f('0x79')];_0xa93616[_0x849f('0x3c')]['port']=_0x4243a1['body'][_0x849f('0x3c')]['port'];_0xa93616['Smtp']['host']=_0x4243a1['body']['Smtp'][_0x849f('0x79')];_0xa93616['Smtp'][_0x849f('0x7a')]=_0x4243a1[_0x849f('0x5c')][_0x849f('0x3e')][_0x849f('0x7a')];}else{_0xa93616[_0x849f('0x3c')][_0x849f('0x7b')]=_0xa93616[_0x849f('0x3e')]['service']=_0x4243a1['body'][_0x849f('0x72')];_0xa93616[_0x849f('0x3c')][_0x849f('0x74')]=_0xa93616[_0x849f('0x3e')][_0x849f('0x74')]=_0x4243a1['body'][_0x849f('0x75')];_0xa93616[_0x849f('0x3c')]['password']=_0xa93616['Smtp'][_0x849f('0x76')]=_0x4243a1[_0x849f('0x5c')][_0x849f('0x77')];}return db['MailAccount']['create'](_0xa93616,{'include':[{'model':db[_0x849f('0x3d')],'as':_0x849f('0x3e')},{'model':db['MailServerIn'],'as':_0x849f('0x3c')}]})[_0x849f('0x20')](function(_0x4b5cdc){var _0x583a0f=_0x4243a1[_0x849f('0x74')][_0x849f('0x7c')]({'plain':!![]});if(!_0x583a0f)throw new Error(_0x849f('0x7d'));if(_0x583a0f[_0x849f('0x7e')]===_0x849f('0x74')){var _0x1da4a4=_0x4b5cdc[_0x849f('0x7c')]({'plain':!![]});return db['UserProfileSection'][_0x849f('0x5b')]({'where':{'name':_0x849f('0x36'),'userProfileId':_0x583a0f[_0x849f('0x7f')]},'raw':!![]})['then'](function(_0x513b03){if(_0x513b03&&_0x513b03['autoAssociation']===0x0){return db['UserProfileResource'][_0x849f('0x69')]({'name':_0x1da4a4[_0x849f('0x39')],'resourceId':_0x1da4a4['id'],'type':_0x513b03[_0x849f('0x39')],'sectionId':_0x513b03['id']},{})[_0x849f('0x20')](function(){return _0x4b5cdc;});}else{return _0x4b5cdc;}})[_0x849f('0x2a')](function(_0x5072c3){logger[_0x849f('0x27')](_0x849f('0x80'),_0x5072c3);throw _0x5072c3;});}return _0x4b5cdc;})[_0x849f('0x20')](respondWithResult(_0x4c85b2,0xc9))[_0x849f('0x2a')](handleError(_0x4c85b2,null));};exports[_0x849f('0x81')]=function(_0x584718,_0x7349a7,_0x168143){return db[_0x849f('0x42')]['findOne']({'where':{'id':_0x584718[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x7349a7,null))[_0x849f('0x20')](function(_0x237b7b){if(_0x237b7b){return _0x237b7b[_0x849f('0x81')]();}return null;})['then'](respondWithResult(_0x7349a7,null))['catch'](handleError(_0x7349a7,null));};exports['addImap']=function(_0x190eb4,_0x4fc70c,_0x556c4b){if(_0x190eb4[_0x849f('0x5c')]['id']){delete _0x190eb4['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x190eb4[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x4fc70c,null))[_0x849f('0x20')](function(_0x38d583){if(_0x38d583){_0x190eb4[_0x849f('0x5c')][_0x849f('0x63')]=_0x38d583['id'];return db['MailServerIn'][_0x849f('0x69')](_0x190eb4['body']);}})[_0x849f('0x20')](respondWithResult(_0x4fc70c,null))['catch'](handleError(_0x4fc70c,null));};exports[_0x849f('0x82')]=function(_0x370258,_0x36f2f2,_0x32c457){return db[_0x849f('0x42')][_0x849f('0x61')]({'where':{'id':_0x370258[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x36f2f2,null))[_0x849f('0x20')](function(_0x56095e){if(_0x56095e){return _0x56095e[_0x849f('0x83')](null);}return null;})['then'](respondWithStatusCode(_0x36f2f2,null))[_0x849f('0x2a')](handleError(_0x36f2f2,null));};exports[_0x849f('0x84')]=function(_0x45ccd7,_0xaf08f8,_0x593cb2){return db[_0x849f('0x42')]['findOne']({'where':{'id':_0x45ccd7[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0xaf08f8,null))[_0x849f('0x20')](function(_0x47d985){if(_0x47d985){return _0x47d985['getSmtp']();}return null;})['then'](respondWithResult(_0xaf08f8,null))['catch'](handleError(_0xaf08f8,null));};exports['addSmtp']=function(_0x13c445,_0x516817,_0xa4f174){if(_0x13c445[_0x849f('0x5c')]['id']){delete _0x13c445[_0x849f('0x5c')]['id'];}return db['MailAccount'][_0x849f('0x5b')]({'where':{'id':_0x13c445[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x516817,null))[_0x849f('0x20')](function(_0x4a66d3){if(_0x4a66d3){_0x13c445[_0x849f('0x5c')][_0x849f('0x63')]=_0x4a66d3['id'];return db[_0x849f('0x3d')][_0x849f('0x69')](_0x13c445['body']);}})[_0x849f('0x20')](respondWithResult(_0x516817,null))[_0x849f('0x2a')](handleError(_0x516817,null));};exports['removeSmtp']=function(_0x2d355f,_0x424a25,_0x32531d){return db[_0x849f('0x42')][_0x849f('0x61')]({'where':{'id':_0x2d355f[_0x849f('0x59')]['id']}})['then'](handleEntityNotFound(_0x424a25,null))[_0x849f('0x20')](function(_0x54a284){if(_0x54a284){return _0x54a284[_0x849f('0x85')](null);}return null;})[_0x849f('0x20')](respondWithStatusCode(_0x424a25,null))[_0x849f('0x2a')](handleError(_0x424a25,null));};exports[_0x849f('0x86')]=function(_0x88f93e,_0x4b748a,_0x287a58){return db[_0x849f('0x87')][_0x849f('0x5b')]({'where':{'id':_0x88f93e[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x4b748a,null))[_0x849f('0x20')](function(_0x2d0d86){if(_0x2d0d86){return _0x2d0d86[_0x849f('0x86')](_0x88f93e[_0x849f('0x5c')][_0x849f('0x67')],_[_0x849f('0x88')](_0x88f93e[_0x849f('0x5c')],[_0x849f('0x67'),'id'])||{});}})[_0x849f('0x20')](respondWithResult(_0x4b748a,null))['catch'](handleError(_0x4b748a,null));};exports[_0x849f('0x89')]=function(_0x30fff2,_0x4dbe4d,_0x2c8edc){var _0x295a4f={'raw':![],'where':{}};var _0x3b4a5e={};var _0xfafc0a={'count':0x0,'rows':[]};return db[_0x849f('0x42')]['findOne']({'where':{'id':_0x30fff2['params']['id']}})['then'](handleEntityNotFound(_0x4dbe4d,null))[_0x849f('0x20')](function(_0x1c6f45){if(_0x1c6f45){_0x3b4a5e[_0x849f('0x45')]=_[_0x849f('0x47')](db[_0x849f('0x87')][_0x849f('0x43')]);_0x3b4a5e[_0x849f('0x46')]=_[_0x849f('0x47')](_0x30fff2['query']);_0x3b4a5e['filters']=_['intersection'](_0x3b4a5e[_0x849f('0x45')],_0x3b4a5e[_0x849f('0x46')]);_0x295a4f['attributes']=_[_0x849f('0x4a')](_0x3b4a5e[_0x849f('0x45')],qs[_0x849f('0x4b')](_0x30fff2[_0x849f('0x46')][_0x849f('0x4b')]));_0x295a4f['attributes']=_0x295a4f[_0x849f('0x49')]['length']?_0x295a4f[_0x849f('0x49')]:_0x3b4a5e['model'];if(!_0x30fff2['query'][_0x849f('0x62')](_0x849f('0x4d'))){_0x295a4f[_0x849f('0x2e')]=qs[_0x849f('0x2e')](_0x30fff2['query'][_0x849f('0x2e')]);_0x295a4f[_0x849f('0x2d')]=qs[_0x849f('0x2d')](_0x30fff2[_0x849f('0x46')]['offset']);}_0x295a4f[_0x849f('0x4e')]=qs[_0x849f('0x4f')](_0x30fff2['query']['sort']);_0x295a4f['where']=qs[_0x849f('0x48')](_[_0x849f('0x51')](_0x30fff2[_0x849f('0x46')],_0x3b4a5e['filters']));_0x295a4f[_0x849f('0x50')][_0x849f('0x63')]=_0x1c6f45['id'];if(_0x30fff2[_0x849f('0x46')][_0x849f('0x52')]){_0x295a4f['where']=_[_0x849f('0x5a')](_0x295a4f[_0x849f('0x50')],{'$or':_['map'](_0x295a4f[_0x849f('0x49')],function(_0x4ddc13){var _0x4b812b={};_0x4b812b[_0x4ddc13]={'$like':'%'+_0x30fff2[_0x849f('0x46')]['filter']+'%'};return _0x4b812b;})});}_0x295a4f=_[_0x849f('0x5a')]({},_0x295a4f,_0x30fff2[_0x849f('0x54')]);return db[_0x849f('0x87')]['count']({'where':_0x295a4f['where']})[_0x849f('0x20')](function(_0x43ff8d){_0xfafc0a['count']=_0x43ff8d;if(_0x30fff2[_0x849f('0x46')][_0x849f('0x55')]){_0x295a4f[_0x849f('0x56')]=[{'model':db[_0x849f('0x8a')],'as':_0x849f('0x8b'),'required':![]},{'model':db[_0x849f('0x8c')],'as':_0x849f('0x8d'),'attributes':[_0x849f('0x39'),_0x849f('0x8e'),'internal'],'required':![]},{'model':db[_0x849f('0x8f')],'as':_0x849f('0x90'),'attributes':['id',_0x849f('0x39'),_0x849f('0x91')],'where':_0x30fff2[_0x849f('0x46')][_0x849f('0x92')]?{'id':_0x30fff2[_0x849f('0x46')][_0x849f('0x92')]}:undefined,'required':_0x30fff2['query'][_0x849f('0x92')]?!![]:![]}];}return db['MailInteraction'][_0x849f('0x65')](_0x295a4f);})[_0x849f('0x20')](function(_0x1f4fab){_0xfafc0a[_0x849f('0x57')]=_0x1f4fab;return _0xfafc0a;});}})[_0x849f('0x20')](respondWithFilteredResult(_0x4dbe4d,_0x295a4f))[_0x849f('0x2a')](handleError(_0x4dbe4d,null));};exports['addApplications']=function(_0x4e5ab0,_0x5a8cff,_0x82519c){return db[_0x849f('0x42')]['findOne']({'where':{'id':_0x4e5ab0[_0x849f('0x59')]['id']}})['then'](handleEntityNotFound(_0x5a8cff,null))[_0x849f('0x20')](function(_0x12bece){if(_0x12bece){return db['sequelize']['transaction'](function(_0x131ebb){return db[_0x849f('0x93')][_0x849f('0x35')]({'where':{'MailAccountId':_0x4e5ab0['params']['id']},'transaction':_0x131ebb})[_0x849f('0x20')](function(_0x5718cb){var _0x349c2f=_[_0x849f('0x41')](_0x4e5ab0['body'],function(_0x44ac28){_0x44ac28['MailAccountId']=_0x4e5ab0[_0x849f('0x59')]['id'];return _0x44ac28;});return db[_0x849f('0x93')]['bulkCreate'](_0x349c2f,{'transaction':_0x131ebb});});})['then'](function(){return db[_0x849f('0x93')][_0x849f('0x94')]({'where':{'MailAccountId':_0x4e5ab0[_0x849f('0x59')]['id']},'order':'priority'});});}})[_0x849f('0x20')](respondWithResult(_0x5a8cff,null))[_0x849f('0x2a')](handleError(_0x5a8cff,null));};exports['getApplications']=function(_0x5bf924,_0x3d358b,_0x55fd90){var _0x5b1d0c={};var _0x5eab46={};var _0x58a8b3;var _0xee0b9b;return db[_0x849f('0x42')][_0x849f('0x61')]({'where':{'id':_0x5bf924['params']['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x3d358b,null))[_0x849f('0x20')](function(_0x16a268){if(_0x16a268){_0x58a8b3=_0x16a268;_0x5eab46[_0x849f('0x45')]=_[_0x849f('0x47')](db[_0x849f('0x93')][_0x849f('0x43')]);_0x5eab46[_0x849f('0x46')]=_[_0x849f('0x47')](_0x5bf924[_0x849f('0x46')]);_0x5eab46[_0x849f('0x48')]=_[_0x849f('0x4a')](_0x5eab46['model'],_0x5eab46['query']);_0x5b1d0c[_0x849f('0x49')]=_[_0x849f('0x4a')](_0x5eab46['model'],qs[_0x849f('0x4b')](_0x5bf924['query'][_0x849f('0x4b')]));_0x5b1d0c[_0x849f('0x49')]=_0x5b1d0c[_0x849f('0x49')][_0x849f('0x4c')]?_0x5b1d0c[_0x849f('0x49')]:_0x5eab46[_0x849f('0x45')];_0x5b1d0c[_0x849f('0x4e')]=qs[_0x849f('0x4f')](_0x5bf924[_0x849f('0x46')][_0x849f('0x4f')]);_0x5b1d0c[_0x849f('0x50')]=qs[_0x849f('0x48')](_[_0x849f('0x51')](_0x5bf924[_0x849f('0x46')],_0x5eab46[_0x849f('0x48')]));if(_0x5bf924[_0x849f('0x46')][_0x849f('0x52')]){_0x5b1d0c[_0x849f('0x50')]=_[_0x849f('0x5a')](_0x5b1d0c['where'],{'$or':_[_0x849f('0x41')](_0x5b1d0c[_0x849f('0x49')],function(_0x1e4cb9){var _0x21cb5e={};_0x21cb5e[_0x1e4cb9]={'$like':'%'+_0x5bf924[_0x849f('0x46')][_0x849f('0x52')]+'%'};return _0x21cb5e;})});}_0x5b1d0c=_[_0x849f('0x5a')]({},_0x5b1d0c,_0x5bf924['options']);return _0x58a8b3[_0x849f('0x95')](_0x5b1d0c);}})['then'](function(_0x2df433){if(_0x2df433){_0xee0b9b=_0x2df433[_0x849f('0x4c')];if(!_0x5bf924[_0x849f('0x46')]['hasOwnProperty'](_0x849f('0x4d'))){_0x5b1d0c[_0x849f('0x2e')]=qs[_0x849f('0x2e')](_0x5bf924[_0x849f('0x46')][_0x849f('0x2e')]);_0x5b1d0c[_0x849f('0x2d')]=qs['offset'](_0x5bf924[_0x849f('0x46')][_0x849f('0x2d')]);}return _0x58a8b3['getApplications'](_0x5b1d0c);}})[_0x849f('0x20')](function(_0x2d594d){if(_0x2d594d){return _0x2d594d?{'count':_0xee0b9b,'rows':_0x2d594d}:null;}})[_0x849f('0x20')](respondWithResult(_0x3d358b,null))['catch'](handleError(_0x3d358b,null));};exports[_0x849f('0x96')]=function(_0x5625f9,_0x12a82e,_0x476e15){var _0x5c0461={'raw':!![],'where':{}};var _0x3d0505={};var _0x48f060={'count':0x0,'rows':[]};return db[_0x849f('0x42')]['findOne']({'where':{'id':_0x5625f9[_0x849f('0x59')]['id']}})['then'](handleEntityNotFound(_0x12a82e,null))[_0x849f('0x20')](function(_0x4ba5d1){if(_0x4ba5d1){_0x3d0505['model']=_[_0x849f('0x47')](db['MailMessage'][_0x849f('0x43')]);_0x3d0505['query']=_[_0x849f('0x47')](_0x5625f9[_0x849f('0x46')]);_0x3d0505[_0x849f('0x48')]=_[_0x849f('0x4a')](_0x3d0505[_0x849f('0x45')],_0x3d0505[_0x849f('0x46')]);_0x5c0461[_0x849f('0x49')]=_['intersection'](_0x3d0505[_0x849f('0x45')],qs['fields'](_0x5625f9[_0x849f('0x46')][_0x849f('0x4b')]));_0x5c0461[_0x849f('0x49')]=_0x5c0461['attributes'][_0x849f('0x4c')]?_0x5c0461[_0x849f('0x49')]:_0x3d0505[_0x849f('0x45')];if(!_0x5625f9['query'][_0x849f('0x62')]('nolimit')){_0x5c0461[_0x849f('0x2e')]=qs[_0x849f('0x2e')](_0x5625f9[_0x849f('0x46')][_0x849f('0x2e')]);_0x5c0461['offset']=qs[_0x849f('0x2d')](_0x5625f9[_0x849f('0x46')][_0x849f('0x2d')]);}_0x5c0461[_0x849f('0x4e')]=qs[_0x849f('0x4f')](_0x5625f9[_0x849f('0x46')][_0x849f('0x4f')]);_0x5c0461[_0x849f('0x50')]=qs[_0x849f('0x48')](_[_0x849f('0x51')](_0x5625f9[_0x849f('0x46')],_0x3d0505['filters']));_0x5c0461[_0x849f('0x50')][_0x849f('0x63')]=_0x4ba5d1['id'];if(_0x5625f9['query'][_0x849f('0x52')]){_0x5c0461['where']=_[_0x849f('0x5a')](_0x5c0461[_0x849f('0x50')],{'$or':_['map'](_0x5c0461[_0x849f('0x49')],function(_0xdf3ece){var _0x2d6fac={};_0x2d6fac[_0xdf3ece]={'$like':'%'+_0x5625f9[_0x849f('0x46')][_0x849f('0x52')]+'%'};return _0x2d6fac;})});}if(_0x5625f9[_0x849f('0x46')][_0x849f('0x97')]){var _0x7eaa21=_0x5625f9[_0x849f('0x46')][_0x849f('0x97')][_0x849f('0x98')](',');var _0x254b31={};_0x254b31[_0x7eaa21[0x0]]={'$gte':moment(_0x7eaa21[0x1])[_0x849f('0x99')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5c0461[_0x849f('0x50')]=_[_0x849f('0x5a')](_0x5c0461[_0x849f('0x50')],_0x254b31);}_0x5c0461=_['merge']({},_0x5c0461,_0x5625f9[_0x849f('0x54')]);return db[_0x849f('0x9a')][_0x849f('0x64')]({'where':_0x5c0461[_0x849f('0x50')]})['then'](function(_0x2f46e1){_0x48f060[_0x849f('0x64')]=_0x2f46e1;if(_0x5625f9['query']['includeAll']){_0x5c0461[_0x849f('0x56')]=[{'all':!![]}];}return db[_0x849f('0x9a')][_0x849f('0x65')](_0x5c0461);})['then'](function(_0x2223a0){_0x48f060['rows']=_0x2223a0;return _0x48f060;});}})[_0x849f('0x20')](respondWithFilteredResult(_0x12a82e,_0x5c0461))['catch'](handleError(_0x12a82e,null));};exports[_0x849f('0x3a')]=function(_0x353301,_0x1e2e8a,_0x582490){var _0x2a7b2d,_0x208995={},_0x352a5a;if(_0x353301['body']['to']){_0x352a5a=_0x353301['body']['to']['split'](',')[0x0];}return db[_0x849f('0x42')][_0x849f('0x5b')]({'where':{'id':_0x353301[_0x849f('0x59')]['id']},'include':[{'model':db[_0x849f('0x9b')],'as':'List','include':[{'model':db[_0x849f('0x8a')],'as':_0x849f('0x9c'),'where':{'email':_0x352a5a},'limit':0x1,'order':[[_0x849f('0x9d'),_0x849f('0x9e')]]}]},{'model':db[_0x849f('0x3d')],'as':_0x849f('0x3e'),'raw':!![]}]})['then'](handleEntityNotFound(_0x1e2e8a,null))[_0x849f('0x20')](function(_0x16d129){if(_0x16d129){_0x2a7b2d=_0x16d129;if(_0x16d129['Smtp']){if(_[_0x849f('0x6f')](_0x353301[_0x849f('0x5c')][_0x849f('0x9f')])){_0x353301['body'][_0x849f('0x9f')]=util[_0x849f('0x99')](_0x849f('0xa0'),_0x16d129['name'],_0x16d129[_0x849f('0x6d')]||_0x16d129[_0x849f('0x3e')][_0x849f('0x74')]);}if(_0x353301[_0x849f('0x5c')]['attachments']&&_0x353301[_0x849f('0x5c')]['attachments'][_0x849f('0x4c')]){for(var _0x5ef4cd=0x0;_0x5ef4cd<_0x353301[_0x849f('0x5c')][_0x849f('0xa1')]['length'];_0x5ef4cd+=0x1){_0x353301['body']['attachments'][_0x5ef4cd]={'filename':_0x353301[_0x849f('0x5c')][_0x849f('0xa1')][_0x5ef4cd]['name'],'path':path[_0x849f('0xa2')](config['root'],_0x849f('0xa3'),_0x353301[_0x849f('0x5c')][_0x849f('0xa1')][_0x5ef4cd]['basename'])};}}var _0x37a8ac={'tls':{'rejectUnauthorized':![]}};if(_[_0x849f('0x6f')](_0x16d129[_0x849f('0x3e')]['service'])){if(_0x16d129[_0x849f('0x3e')][_0x849f('0x78')]){_0x37a8ac[_0x849f('0xa4')]={'user':_0x16d129[_0x849f('0x3e')][_0x849f('0x74')],'pass':_0x16d129['Smtp']['pass']};}_0x37a8ac[_0x849f('0x79')]=_0x16d129[_0x849f('0x3e')][_0x849f('0x79')];_0x37a8ac[_0x849f('0x7a')]=_0x16d129['Smtp'][_0x849f('0x7a')];_0x37a8ac['secure']=_0x16d129[_0x849f('0x3e')][_0x849f('0xa5')];}else{_0x37a8ac[_0x849f('0x7b')]=_0x16d129[_0x849f('0x3e')][_0x849f('0x7b')];_0x37a8ac[_0x849f('0xa4')]={'user':_0x16d129[_0x849f('0x3e')][_0x849f('0x74')],'pass':_0x16d129[_0x849f('0x3e')][_0x849f('0x76')]};}return respondWithRpcPromise(_0x849f('0xa6'),_0x849f('0xa7'),{'account':_0x37a8ac,'message':_0x353301['body']});}else{throw new Error(_0x849f('0xa8'));}}})[_0x849f('0x20')](function(_0x1d65f6){if(_0x1d65f6){_0x208995=_0x1d65f6;if(_0x2a7b2d[_0x849f('0xa9')]){if(_0x2a7b2d[_0x849f('0xa9')][_0x849f('0x9c')]['length']){return _0x2a7b2d[_0x849f('0xa9')][_0x849f('0x9c')][0x0];}else{return db[_0x849f('0x8a')]['create'](_[_0x849f('0x17')](_0x353301[_0x849f('0x5c')],{'firstName':_0x353301[_0x849f('0x5c')]['to'],'email':_0x353301['body']['to'],'phone':_0x353301['body']['to'],'ListId':_0x2a7b2d[_0x849f('0x6e')]}));}}else{throw new Error(_0x849f('0xa8'));}}})[_0x849f('0x20')](function(_0x2d17b0){if(_0x2d17b0){var _0x3033b9={'UserId':_0x353301['user']['id'],'ContactId':_0x2d17b0['id'],'MailAccountId':_0x2a7b2d['id'],'inReplyTo':_0x208995[_0x849f('0xaa')],'to':_0x353301[_0x849f('0x5c')]['from'],'cc':_0x353301[_0x849f('0x5c')]['cc'],'subject':_0x353301[_0x849f('0x5c')][_0x849f('0xab')],'attach':_0x353301[_0x849f('0x5c')][_0x849f('0xac')],'firstMsgDirection':_0x849f('0xad'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','lastMsgBody':_0x353301[_0x849f('0x5c')]['body'],'Messages':[_[_0x849f('0x5a')](_0x353301[_0x849f('0x5c')],{'messageId':_0x208995[_0x849f('0xaa')],'sentAt':moment()[_0x849f('0x99')](_0x849f('0xae')),'read':!![],'MailAccountId':_0x2a7b2d['id'],'UserId':_0x353301['user']['id'],'ContactId':_0x2d17b0['id']})]};if(_0x353301[_0x849f('0x5c')][_0x849f('0xaf')]){_0x3033b9=_[_0x849f('0x5a')](_0x3033b9,_0x353301[_0x849f('0x5c')]['Interaction']);}return db[_0x849f('0x87')][_0x849f('0x69')](_0x3033b9,{'include':[{'model':db['MailMessage'],'as':_0x849f('0xb0')}]});}})[_0x849f('0x20')](respondWithResult(_0x1e2e8a,null))[_0x849f('0x2a')](handleError(_0x1e2e8a,null));};exports['verifySmtp']=function(_0x515d82,_0x151af8,_0x34ee3e){return db['MailAccount'][_0x849f('0x5b')]({'where':{'id':_0x515d82[_0x849f('0x59')]['id']},'include':[{'model':db[_0x849f('0x3d')],'as':_0x849f('0x3e'),'raw':!![]}]})[_0x849f('0x20')](handleEntityNotFound(_0x151af8,null))[_0x849f('0x20')](function(_0x1ac17e){if(_0x1ac17e&&_0x1ac17e[_0x849f('0x3e')]){var _0x46757f={'id':_0x1ac17e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1ac17e[_0x849f('0x3e')][_0x849f('0x7b')]){_0x46757f[_0x849f('0x7b')]=_0x1ac17e[_0x849f('0x3e')][_0x849f('0x7b')];}else{_0x46757f[_0x849f('0x79')]=_0x1ac17e['Smtp'][_0x849f('0x79')];_0x46757f[_0x849f('0x7a')]=_0x1ac17e[_0x849f('0x3e')][_0x849f('0x7a')];_0x46757f[_0x849f('0xa5')]=_0x1ac17e['Smtp'][_0x849f('0xa5')];}if(_0x1ac17e[_0x849f('0x3e')][_0x849f('0x78')]){_0x46757f['auth']={'user':_0x1ac17e[_0x849f('0x3e')][_0x849f('0x74')],'pass':_0x1ac17e['Smtp'][_0x849f('0x76')]};}return respondWithRpcPromise(_0x849f('0xb1'),'verifySmtp',{'account':_0x46757f});}})[_0x849f('0x20')](respondWithResult(_0x151af8,null))[_0x849f('0x2a')](handleError(_0x151af8,null));};exports['destroy']=function(_0x4b4937,_0x4f12e0){return db['MailAccount'][_0x849f('0x5b')]({'where':{'id':_0x4b4937[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x4f12e0,null))[_0x849f('0x20')](function(_0x9ad2fc){if(_0x9ad2fc&&_0x9ad2fc[_0x849f('0x7b')]){throw new db['Sequelize'][(_0x849f('0xb2'))](_0x849f('0xb3'));}return _0x9ad2fc;})[_0x849f('0x20')](removeEntity(_0x4f12e0,null))[_0x849f('0x2a')](handleError(_0x4f12e0,null));};exports[_0x849f('0xb4')]=function(_0x5d8f64,_0x5f10c1,_0x371509){return db[_0x849f('0x42')][_0x849f('0x5b')]({'where':{'id':_0x5d8f64[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x5f10c1,null))[_0x849f('0x20')](function(_0x31c399){if(_0x31c399){return _0x31c399['addAgents'](_0x5d8f64[_0x849f('0x5c')][_0x849f('0x67')],_[_0x849f('0x88')](_0x5d8f64[_0x849f('0x5c')],['ids','id'])||{})[_0x849f('0xb5')](function(_0x164199){for(var _0x2f82d9=0x0;_0x2f82d9<_0x5d8f64[_0x849f('0x5c')][_0x849f('0x67')][_0x849f('0x4c')];_0x2f82d9+=0x1){socket[_0x849f('0xb6')]('userMailAccount:save',{'UserId':_0x5d8f64[_0x849f('0x5c')][_0x849f('0x67')][_0x2f82d9],'MailAccountId':_0x5d8f64['params']['id']});}return _0x164199;});}})[_0x849f('0x20')](respondWithResult(_0x5f10c1,null))[_0x849f('0x2a')](handleError(_0x5f10c1,null));};exports[_0x849f('0xb7')]=function(_0x54a411,_0xc2ed62,_0x424414){return db[_0x849f('0x42')][_0x849f('0x5b')]({'where':{'id':_0x54a411[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0xc2ed62,null))[_0x849f('0x20')](function(_0x1c0058){if(_0x1c0058){return _0x1c0058[_0x849f('0xb7')](_0x54a411[_0x849f('0x46')][_0x849f('0x67')])[_0x849f('0x20')](function(){if(_[_0x849f('0xb8')](_0x54a411['query']['ids'])){for(var _0x2ad4ca=0x0;_0x2ad4ca<_0x54a411[_0x849f('0x46')][_0x849f('0x67')]['length'];_0x2ad4ca+=0x1){socket['emit'](_0x849f('0xb9'),{'UserId':Number(_0x54a411[_0x849f('0x46')][_0x849f('0x67')][_0x2ad4ca]),'MailAccountId':Number(_0x54a411['params']['id'])});}}else{socket[_0x849f('0xb6')](_0x849f('0xb9'),{'UserId':Number(_0x54a411['query'][_0x849f('0x67')]),'MailAccountId':Number(_0x54a411[_0x849f('0x59')]['id'])});}});}})[_0x849f('0x20')](respondWithStatusCode(_0xc2ed62,null))[_0x849f('0x2a')](handleError(_0xc2ed62,null));};exports[_0x849f('0xba')]=function(_0x1bf0d2,_0x42a84c,_0x49a5d7){var _0x110191={};var _0xcb4aad={};var _0x2ded7f;var _0xe7a55a;return db[_0x849f('0x42')][_0x849f('0x61')]({'where':{'id':_0x1bf0d2[_0x849f('0x59')]['id']}})[_0x849f('0x20')](handleEntityNotFound(_0x42a84c,null))[_0x849f('0x20')](function(_0x2637a0){if(_0x2637a0){_0x2ded7f=_0x2637a0;_0xcb4aad['model']=_['keys'](db['User'][_0x849f('0x43')]);_0xcb4aad[_0x849f('0x46')]=_['keys'](_0x1bf0d2['query']);_0xcb4aad[_0x849f('0x48')]=_[_0x849f('0x4a')](_0xcb4aad[_0x849f('0x45')],_0xcb4aad['query']);_0x110191[_0x849f('0x49')]=_['intersection'](_0xcb4aad[_0x849f('0x45')],qs[_0x849f('0x4b')](_0x1bf0d2[_0x849f('0x46')]['fields']));_0x110191[_0x849f('0x49')]=_0x110191[_0x849f('0x49')][_0x849f('0x4c')]?_0x110191[_0x849f('0x49')]:_0xcb4aad[_0x849f('0x45')];_0x110191[_0x849f('0x4e')]=qs[_0x849f('0x4f')](_0x1bf0d2['query'][_0x849f('0x4f')]);_0x110191[_0x849f('0x50')]=qs[_0x849f('0x48')](_[_0x849f('0x51')](_0x1bf0d2[_0x849f('0x46')],_0xcb4aad['filters']));if(_0x1bf0d2[_0x849f('0x46')]['filter']){_0x110191[_0x849f('0x50')]=_[_0x849f('0x5a')](_0x110191[_0x849f('0x50')],{'$or':_[_0x849f('0x41')](_0x110191[_0x849f('0x49')],function(_0x4143dd){var _0x240fcf={};_0x240fcf[_0x4143dd]={'$like':'%'+_0x1bf0d2[_0x849f('0x46')][_0x849f('0x52')]+'%'};return _0x240fcf;})});}_0x110191=_[_0x849f('0x5a')]({},_0x110191,_0x1bf0d2[_0x849f('0x54')]);return _0x2ded7f[_0x849f('0xba')](_0x110191);}})[_0x849f('0x20')](function(_0xe42ff){if(_0xe42ff){_0xe7a55a=_0xe42ff[_0x849f('0x4c')];if(!_0x1bf0d2['query'][_0x849f('0x62')](_0x849f('0x4d'))){_0x110191[_0x849f('0x2e')]=qs['limit'](_0x1bf0d2['query'][_0x849f('0x2e')]);_0x110191['offset']=qs[_0x849f('0x2d')](_0x1bf0d2[_0x849f('0x46')][_0x849f('0x2d')]);}return _0x2ded7f[_0x849f('0xba')](_0x110191);}})['then'](function(_0x113fd2){if(_0x113fd2){return _0x113fd2?{'count':_0xe7a55a,'rows':_0x113fd2}:null;}})[_0x849f('0x20')](respondWithResult(_0x42a84c,null))[_0x849f('0x2a')](handleError(_0x42a84c,null));}; \ No newline at end of file +var _0xe08b=['addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','offset','limit','set','Content-Range','apply','reject','save','then','MailAccounts','destroy','send','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','model','name','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','count','include','findAll','rows','catch','params','MailServerIn','Smtp','keys','fields','length','includeAll','find','update','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','email','isNil','active','description','cservice','user','cuser','password','cpassword','authentication','port','host','service','pass','get','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','pick','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','sequelize','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','from','%s\x20<%s>','attachments','join','root','server/files/attachments','secure','auth','SendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe08b,0xc6));var _0xbe08=function(_0x30bd66,_0x36a93d){_0x30bd66=_0x30bd66-0x0;var _0x74c9dd=_0xe08b[_0x30bd66];return _0x74c9dd;};'use strict';var pdf=require(_0xbe08('0x0'));var emlformat=require(_0xbe08('0x1'));var rimraf=require(_0xbe08('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe08('0x3'));var rp=require(_0xbe08('0x4'));var moment=require(_0xbe08('0x5'));var BPromise=require(_0xbe08('0x6'));var Mustache=require(_0xbe08('0x7'));var util=require(_0xbe08('0x8'));var path=require('path');var sox=require(_0xbe08('0x9'));var csv=require('to-csv');var ejs=require(_0xbe08('0xa'));var fs=require('fs');var _=require(_0xbe08('0xb'));var squel=require(_0xbe08('0xc'));var crypto=require(_0xbe08('0xd'));var jsforce=require(_0xbe08('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbe08('0xf'));var querystring=require('querystring');var Papa=require(_0xbe08('0x10'));var Redis=require(_0xbe08('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbe08('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe08('0x13'));var logger=require(_0xbe08('0x14'))(_0xbe08('0x15'));var utils=require(_0xbe08('0x16'));var config=require('../../config/environment');var db=require(_0xbe08('0x17'))['db'];config[_0xbe08('0x18')]=_[_0xbe08('0x19')](config['redis'],{'host':_0xbe08('0x1a'),'port':0x18eb});var socket=require(_0xbe08('0x1b'))(new Redis(config['redis']));require(_0xbe08('0x1c'))[_0xbe08('0x1d')](socket);var jayson=require(_0xbe08('0x1e'));var client=jayson[_0xbe08('0x1f')][_0xbe08('0x20')]({'port':0x232b});function checkPasswordPattern(_0x45b813,_0x3ac517,_0x37ac66){if(_0x37ac66){var _0x14b867=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x14b867['test'](_0x3ac517)){return _0x45b813;}else{throw new db['Sequelize']['ValidationError'](_0xbe08('0x21'));}}else{return _0x45b813;}}function respondWithRpcPromise(_0x55acdb,_0x55dc17,_0x50c88d,_0xc8a3b3){return new BPromise(function(_0x4acd8b,_0x4949b2){var _0x304f68=_0xc8a3b3||client;return _0x304f68['request'](_0x55acdb,_0x50c88d)['then'](function(_0x1e49e8){logger[_0xbe08('0x22')](_0xbe08('0x23'),_0x55dc17,_0xbe08('0x24'));logger[_0xbe08('0x25')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x55dc17,_0xbe08('0x24'),JSON[_0xbe08('0x26')](_0x1e49e8));if(_0x1e49e8[_0xbe08('0x27')]){if(_0x1e49e8[_0xbe08('0x27')][_0xbe08('0x28')]===0x1f4){logger[_0xbe08('0x27')]('MailAccount,\x20%s,\x20%s',_0x55dc17,_0x1e49e8[_0xbe08('0x27')]['message']);return _0x4949b2(_0x1e49e8[_0xbe08('0x27')][_0xbe08('0x29')]);}logger[_0xbe08('0x27')](_0xbe08('0x23'),_0x55dc17,_0x1e49e8[_0xbe08('0x27')][_0xbe08('0x29')]);return _0x4acd8b(_0x1e49e8['error']['message']);}else{logger[_0xbe08('0x22')]('MailAccount,\x20%s,\x20%s',_0x55dc17,_0xbe08('0x24'));_0x4acd8b(_0x1e49e8[_0xbe08('0x2a')][_0xbe08('0x29')]);}})['catch'](function(_0x1c32d2){logger[_0xbe08('0x27')](_0xbe08('0x23'),_0x55dc17,_0x1c32d2);_0x4949b2(_0x1c32d2);});});}function respondWithStatusCode(_0x340f08,_0x305274){_0x305274=_0x305274||0xcc;return function(_0x4fbb5){if(_0x4fbb5){return _0x340f08[_0xbe08('0x2b')](_0x305274);}return _0x340f08[_0xbe08('0x2c')](_0x305274)[_0xbe08('0x2d')]();};}function respondWithResult(_0x4a26da,_0x2cc4f2){_0x2cc4f2=_0x2cc4f2||0xc8;return function(_0x1fee43){if(_0x1fee43){return _0x4a26da[_0xbe08('0x2c')](_0x2cc4f2)['json'](_0x1fee43);}};}function respondWithFilteredResult(_0x45d783,_0xe9999f){return function(_0x3b1f43){if(_0x3b1f43){var _0xb14ad4=_0x3b1f43['count'],_0x405060=_0xe9999f[_0xbe08('0x2e')],_0x1a6656=_0xe9999f[_0xbe08('0x2e')]+_0xe9999f[_0xbe08('0x2f')],_0x163dc9;if(_0x1a6656>=_0xb14ad4){_0x1a6656=_0xb14ad4;_0x163dc9=0xc8;}else{_0x163dc9=0xce;}_0x45d783['status'](_0x163dc9);return _0x45d783[_0xbe08('0x30')](_0xbe08('0x31'),_0x405060+'-'+_0x1a6656+'/'+_0xb14ad4)['json'](_0x3b1f43);}return null;};}function patchUpdates(_0x13bfa1){return function(_0x3c777e){try{jsonpatch[_0xbe08('0x32')](_0x3c777e,_0x13bfa1,!![]);}catch(_0x43cef5){return BPromise[_0xbe08('0x33')](_0x43cef5);}return _0x3c777e[_0xbe08('0x34')]();};}function saveUpdates(_0x58c971,_0xc17fe2){return function(_0x100fd8){if(_0x100fd8){return _0x100fd8['update'](_0x58c971)['then'](function(_0x333c5f){return _0x333c5f;});}return null;};}function removeEntity(_0x4403bc,_0x23feca){return function(_0x3af311){if(_0x3af311){return _0x3af311['destroy']()[_0xbe08('0x35')](function(){var _0x58268c=_0x3af311['get']({'plain':!![]});var _0x5896e6=_0xbe08('0x36');return db['UserProfileResource'][_0xbe08('0x37')]({'where':{'type':_0x5896e6,'resourceId':_0x58268c['id']}})['then'](function(){return _0x3af311;});})[_0xbe08('0x35')](function(){_0x4403bc[_0xbe08('0x2c')](0xcc)[_0xbe08('0x2d')]();});}};}function handleEntityNotFound(_0xcb4739,_0x1a34a9){return function(_0x48db4c){if(!_0x48db4c){_0xcb4739['sendStatus'](0x194);}return _0x48db4c;};}function handleError(_0x5016c8,_0x539f8d){_0x539f8d=_0x539f8d||0x1f4;return function(_0x47aabe){logger[_0xbe08('0x27')](_0x47aabe['stack']);if(_0x47aabe['name']){delete _0x47aabe['name'];}_0x5016c8[_0xbe08('0x2c')](_0x539f8d)[_0xbe08('0x38')](_0x47aabe);};}exports['index']=function(_0x3c621b,_0x260723){var _0x3ddf51={'include':[{'model':db['MailServerIn'],'as':_0xbe08('0x39')},{'model':db[_0xbe08('0x3a')],'as':'Smtp'},{'model':db[_0xbe08('0x3b')],'as':_0xbe08('0x3c')}]},_0x1c274b={},_0x4f5409={'count':0x0,'rows':[]};var _0x4d0812=_[_0xbe08('0x3d')](db[_0xbe08('0x3e')][_0xbe08('0x3f')],function(_0x48cb26){return{'name':_0x48cb26[_0xbe08('0x40')],'type':_0x48cb26['type']['key']};});_0x1c274b[_0xbe08('0x41')]=_[_0xbe08('0x3d')](_0x4d0812,_0xbe08('0x42'));_0x1c274b[_0xbe08('0x43')]=_['keys'](_0x3c621b[_0xbe08('0x43')]);_0x1c274b[_0xbe08('0x44')]=_['intersection'](_0x1c274b['model'],_0x1c274b[_0xbe08('0x43')]);_0x3ddf51['attributes']=_[_0xbe08('0x45')](_0x1c274b[_0xbe08('0x41')],qs['fields'](_0x3c621b[_0xbe08('0x43')]['fields']));_0x3ddf51['attributes']=_0x3ddf51[_0xbe08('0x46')]['length']?_0x3ddf51['attributes']:_0x1c274b[_0xbe08('0x41')];if(!_0x3c621b['query'][_0xbe08('0x47')](_0xbe08('0x48'))){_0x3ddf51[_0xbe08('0x2f')]=qs[_0xbe08('0x2f')](_0x3c621b[_0xbe08('0x43')][_0xbe08('0x2f')]);_0x3ddf51['offset']=qs['offset'](_0x3c621b[_0xbe08('0x43')][_0xbe08('0x2e')]);}_0x3ddf51[_0xbe08('0x49')]=qs[_0xbe08('0x4a')](_0x3c621b[_0xbe08('0x43')][_0xbe08('0x4a')]);_0x3ddf51[_0xbe08('0x4b')]=qs['filters'](_['pick'](_0x3c621b[_0xbe08('0x43')],_0x1c274b[_0xbe08('0x44')]));if(_0x3c621b[_0xbe08('0x43')][_0xbe08('0x4c')]){_0x3ddf51[_0xbe08('0x4b')]=_['merge'](_0x3ddf51['where'],{'$or':_[_0xbe08('0x3d')](_0x4d0812,function(_0x178fbe){if(_0x178fbe[_0xbe08('0x4d')]!==_0xbe08('0x4e')){var _0x4ef4ac={};_0x4ef4ac[_0x178fbe['name']]={'$like':'%'+_0x3c621b[_0xbe08('0x43')]['filter']+'%'};return _0x4ef4ac;}})});}_0x3ddf51=_[_0xbe08('0x4f')]({},_0x3ddf51,_0x3c621b[_0xbe08('0x50')]);var _0x3dd4bb={'where':_0x3ddf51[_0xbe08('0x4b')]};return db[_0xbe08('0x3e')][_0xbe08('0x51')](_0x3dd4bb)['then'](function(_0x3f4ee7){_0x4f5409[_0xbe08('0x51')]=_0x3f4ee7;if(_0x3c621b['query']['includeAll']){_0x3ddf51[_0xbe08('0x52')]=[{'all':!![]}];}return db[_0xbe08('0x3e')][_0xbe08('0x53')](_0x3ddf51);})[_0xbe08('0x35')](function(_0xb6ba95){_0x4f5409[_0xbe08('0x54')]=_0xb6ba95;return _0x4f5409;})['then'](respondWithFilteredResult(_0x260723,_0x3ddf51))[_0xbe08('0x55')](handleError(_0x260723,null));};exports['show']=function(_0x4f1976,_0x2c4b37){var _0x463147={'raw':![],'where':{'id':_0x4f1976[_0xbe08('0x56')]['id']},'include':[{'model':db[_0xbe08('0x57')],'as':_0xbe08('0x39')},{'model':db['MailServerOut'],'as':_0xbe08('0x58')},{'model':db[_0xbe08('0x3b')],'as':_0xbe08('0x3c')}]},_0x2a6115={};_0x2a6115['model']=_[_0xbe08('0x59')](db[_0xbe08('0x3e')]['rawAttributes']);_0x2a6115[_0xbe08('0x43')]=_[_0xbe08('0x59')](_0x4f1976['query']);_0x2a6115[_0xbe08('0x44')]=_[_0xbe08('0x45')](_0x2a6115[_0xbe08('0x41')],_0x2a6115[_0xbe08('0x43')]);_0x463147[_0xbe08('0x46')]=_['intersection'](_0x2a6115[_0xbe08('0x41')],qs[_0xbe08('0x5a')](_0x4f1976[_0xbe08('0x43')][_0xbe08('0x5a')]));_0x463147[_0xbe08('0x46')]=_0x463147[_0xbe08('0x46')][_0xbe08('0x5b')]?_0x463147['attributes']:_0x2a6115[_0xbe08('0x41')];if(_0x4f1976['query'][_0xbe08('0x5c')]){_0x463147[_0xbe08('0x52')]=[{'all':!![]}];}_0x463147=_[_0xbe08('0x4f')]({},_0x463147,_0x4f1976[_0xbe08('0x50')]);return db[_0xbe08('0x3e')][_0xbe08('0x5d')](_0x463147)['then'](handleEntityNotFound(_0x2c4b37,null))[_0xbe08('0x35')](respondWithResult(_0x2c4b37,null))[_0xbe08('0x55')](handleError(_0x2c4b37,null));};exports[_0xbe08('0x5e')]=function(_0x113720,_0x480bd8){if(_0x113720['body']['id']){delete _0x113720[_0xbe08('0x5f')]['id'];}return db[_0xbe08('0x3e')][_0xbe08('0x5d')]({'where':{'id':_0x113720[_0xbe08('0x56')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xbe08('0x58')},{'model':db[_0xbe08('0x3b')],'as':_0xbe08('0x3c')}]})[_0xbe08('0x35')](handleEntityNotFound(_0x480bd8,null))[_0xbe08('0x35')](saveUpdates(_0x113720[_0xbe08('0x5f')],null))[_0xbe08('0x35')](function(_0xfc916c){if(_0xfc916c&&_0x113720[_0xbe08('0x5f')]['Imap']){return db['MailServerIn'][_0xbe08('0x5e')](_0x113720[_0xbe08('0x5f')][_0xbe08('0x39')],{'where':{'MailAccountId':_0xfc916c['id']}})['then'](function(){return _0xfc916c;});}return _0xfc916c;})[_0xbe08('0x35')](function(_0x136830){if(_0x136830&&_0x113720[_0xbe08('0x5f')]['Smtp']){return db['MailServerOut']['update'](_0x113720[_0xbe08('0x5f')][_0xbe08('0x58')],{'where':{'MailAccountId':_0x136830['id']}})[_0xbe08('0x35')](function(){return _0x136830;});}return _0x136830;})[_0xbe08('0x35')](respondWithResult(_0x480bd8,null))[_0xbe08('0x55')](handleError(_0x480bd8,null));};exports[_0xbe08('0x60')]=function(_0x5032ba,_0x5d4974){return db['MailAccount']['describe']()['then'](respondWithResult(_0x5d4974,null))[_0xbe08('0x55')](handleError(_0x5d4974,null));};exports[_0xbe08('0x61')]=function(_0x544855,_0x7e718f,_0xbc82d4){if(_0x544855[_0xbe08('0x5f')]['id']){delete _0x544855[_0xbe08('0x5f')]['id'];}return db[_0xbe08('0x3e')]['find']({'where':{'id':_0x544855[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x7e718f,null))[_0xbe08('0x35')](function(_0x215f52){if(_0x215f52){_0x544855[_0xbe08('0x5f')][_0xbe08('0x62')]=_0x215f52['id'];return db[_0xbe08('0x63')][_0xbe08('0x64')](_0x544855[_0xbe08('0x5f')]);}})['then'](respondWithResult(_0x7e718f,null))[_0xbe08('0x55')](handleError(_0x7e718f,null));};exports[_0xbe08('0x65')]=function(_0x4cd0fb,_0x20cfd3,_0x27c718){var _0x590365={'raw':![],'where':{}};var _0x10e6a3={};var _0x1845fa={'count':0x0,'rows':[]};return db[_0xbe08('0x3e')][_0xbe08('0x66')]({'where':{'id':_0x4cd0fb[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x20cfd3,null))[_0xbe08('0x35')](function(_0x121354){if(_0x121354){_0x10e6a3[_0xbe08('0x41')]=_[_0xbe08('0x59')](db[_0xbe08('0x63')][_0xbe08('0x3f')]);_0x10e6a3[_0xbe08('0x43')]=_[_0xbe08('0x59')](_0x4cd0fb['query']);_0x10e6a3[_0xbe08('0x44')]=_[_0xbe08('0x45')](_0x10e6a3[_0xbe08('0x41')],_0x10e6a3['query']);_0x590365['attributes']=_[_0xbe08('0x45')](_0x10e6a3[_0xbe08('0x41')],qs[_0xbe08('0x5a')](_0x4cd0fb[_0xbe08('0x43')][_0xbe08('0x5a')]));_0x590365[_0xbe08('0x46')]=_0x590365[_0xbe08('0x46')][_0xbe08('0x5b')]?_0x590365['attributes']:_0x10e6a3[_0xbe08('0x41')];if(!_0x4cd0fb[_0xbe08('0x43')][_0xbe08('0x47')](_0xbe08('0x48'))){_0x590365['limit']=qs[_0xbe08('0x2f')](_0x4cd0fb[_0xbe08('0x43')][_0xbe08('0x2f')]);_0x590365['offset']=qs['offset'](_0x4cd0fb[_0xbe08('0x43')][_0xbe08('0x2e')]);}_0x590365[_0xbe08('0x49')]=qs[_0xbe08('0x4a')](_0x4cd0fb[_0xbe08('0x43')][_0xbe08('0x4a')]);_0x590365[_0xbe08('0x4b')]=qs[_0xbe08('0x44')](_['pick'](_0x4cd0fb[_0xbe08('0x43')],_0x10e6a3[_0xbe08('0x44')]));_0x590365['where'][_0xbe08('0x62')]=_0x121354['id'];if(_0x4cd0fb[_0xbe08('0x43')]['filter']){_0x590365[_0xbe08('0x4b')]=_['merge'](_0x590365[_0xbe08('0x4b')],{'$or':_[_0xbe08('0x3d')](_0x590365[_0xbe08('0x46')],function(_0x33df30){var _0x26e1af={};_0x26e1af[_0x33df30]={'$like':'%'+_0x4cd0fb[_0xbe08('0x43')][_0xbe08('0x4c')]+'%'};return _0x26e1af;})});}_0x590365=_[_0xbe08('0x4f')]({},_0x590365,_0x4cd0fb[_0xbe08('0x50')]);return db[_0xbe08('0x63')]['count']({'where':_0x590365['where']})[_0xbe08('0x35')](function(_0x17d2b4){_0x1845fa['count']=_0x17d2b4;if(_0x4cd0fb[_0xbe08('0x43')][_0xbe08('0x5c')]){_0x590365['include']=[{'all':!![]}];}return db['Disposition'][_0xbe08('0x53')](_0x590365);})[_0xbe08('0x35')](function(_0x4202c2){_0x1845fa[_0xbe08('0x54')]=_0x4202c2;return _0x1845fa;});}})[_0xbe08('0x35')](respondWithFilteredResult(_0x20cfd3,_0x590365))[_0xbe08('0x55')](handleError(_0x20cfd3,null));};exports[_0xbe08('0x67')]=function(_0x414269,_0x46fea0,_0x1433b1){return db[_0xbe08('0x3e')]['find']({'where':{'id':_0x414269['params']['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x46fea0,null))[_0xbe08('0x35')](function(_0x5545b7){if(_0x5545b7){return _0x5545b7['removeDispositions'](_0x414269[_0xbe08('0x43')][_0xbe08('0x68')]);}})['then'](respondWithStatusCode(_0x46fea0,null))[_0xbe08('0x55')](handleError(_0x46fea0,null));};exports[_0xbe08('0x69')]=function(_0x58dc11,_0x2b7a8a,_0x51d29e){if(_0x58dc11['body']['id']){delete _0x58dc11['body']['id'];}return db[_0xbe08('0x3e')][_0xbe08('0x5d')]({'where':{'id':_0x58dc11['params']['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x2b7a8a,null))['then'](function(_0x3afdac){if(_0x3afdac){_0x58dc11[_0xbe08('0x5f')]['MailAccountId']=_0x3afdac['id'];return db[_0xbe08('0x6a')]['create'](_0x58dc11[_0xbe08('0x5f')]);}})['then'](respondWithResult(_0x2b7a8a,null))['catch'](handleError(_0x2b7a8a,null));};exports[_0xbe08('0x6b')]=function(_0x51e53d,_0x1c2d6b,_0x3c954d){var _0x3c1ac2={'raw':![],'where':{}};var _0x1cefbe={};var _0x5159e0={'count':0x0,'rows':[]};return db[_0xbe08('0x3e')]['findOne']({'where':{'id':_0x51e53d[_0xbe08('0x56')]['id']}})['then'](handleEntityNotFound(_0x1c2d6b,null))[_0xbe08('0x35')](function(_0xfd7aba){if(_0xfd7aba){_0x1cefbe['model']=_[_0xbe08('0x59')](db[_0xbe08('0x6a')][_0xbe08('0x3f')]);_0x1cefbe[_0xbe08('0x43')]=_[_0xbe08('0x59')](_0x51e53d[_0xbe08('0x43')]);_0x1cefbe['filters']=_[_0xbe08('0x45')](_0x1cefbe[_0xbe08('0x41')],_0x1cefbe[_0xbe08('0x43')]);_0x3c1ac2[_0xbe08('0x46')]=_['intersection'](_0x1cefbe[_0xbe08('0x41')],qs[_0xbe08('0x5a')](_0x51e53d[_0xbe08('0x43')][_0xbe08('0x5a')]));_0x3c1ac2['attributes']=_0x3c1ac2[_0xbe08('0x46')][_0xbe08('0x5b')]?_0x3c1ac2[_0xbe08('0x46')]:_0x1cefbe[_0xbe08('0x41')];if(!_0x51e53d[_0xbe08('0x43')][_0xbe08('0x47')](_0xbe08('0x48'))){_0x3c1ac2[_0xbe08('0x2f')]=qs[_0xbe08('0x2f')](_0x51e53d['query'][_0xbe08('0x2f')]);_0x3c1ac2[_0xbe08('0x2e')]=qs[_0xbe08('0x2e')](_0x51e53d['query'][_0xbe08('0x2e')]);}_0x3c1ac2[_0xbe08('0x49')]=qs[_0xbe08('0x4a')](_0x51e53d[_0xbe08('0x43')]['sort']);_0x3c1ac2[_0xbe08('0x4b')]=qs[_0xbe08('0x44')](_['pick'](_0x51e53d[_0xbe08('0x43')],_0x1cefbe[_0xbe08('0x44')]));_0x3c1ac2['where'][_0xbe08('0x62')]=_0xfd7aba['id'];if(_0x51e53d[_0xbe08('0x43')]['filter']){_0x3c1ac2[_0xbe08('0x4b')]=_[_0xbe08('0x4f')](_0x3c1ac2[_0xbe08('0x4b')],{'$or':_['map'](_0x3c1ac2['attributes'],function(_0x581c8d){var _0x14e426={};_0x14e426[_0x581c8d]={'$like':'%'+_0x51e53d[_0xbe08('0x43')][_0xbe08('0x4c')]+'%'};return _0x14e426;})});}_0x3c1ac2=_[_0xbe08('0x4f')]({},_0x3c1ac2,_0x51e53d[_0xbe08('0x50')]);return db[_0xbe08('0x6a')]['count']({'where':_0x3c1ac2[_0xbe08('0x4b')]})[_0xbe08('0x35')](function(_0xdfda66){_0x5159e0['count']=_0xdfda66;if(_0x51e53d[_0xbe08('0x43')][_0xbe08('0x5c')]){_0x3c1ac2['include']=[{'all':!![]}];}return db[_0xbe08('0x6a')][_0xbe08('0x53')](_0x3c1ac2);})[_0xbe08('0x35')](function(_0x4073f9){_0x5159e0[_0xbe08('0x54')]=_0x4073f9;return _0x5159e0;});}})[_0xbe08('0x35')](respondWithFilteredResult(_0x1c2d6b,_0x3c1ac2))[_0xbe08('0x55')](handleError(_0x1c2d6b,null));};exports[_0xbe08('0x6c')]=function(_0x51b85d,_0x9c280e,_0xeb8c93){return db[_0xbe08('0x3e')][_0xbe08('0x5d')]({'where':{'id':_0x51b85d[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x9c280e,null))[_0xbe08('0x35')](function(_0x5b89c5){if(_0x5b89c5){return _0x5b89c5['removeAnswers'](_0x51b85d[_0xbe08('0x43')][_0xbe08('0x68')]);}})['then'](respondWithStatusCode(_0x9c280e,null))[_0xbe08('0x55')](handleError(_0x9c280e,null));};exports[_0xbe08('0x64')]=function(_0x2f6843,_0x2fe1f2){var _0x99eb7e={'name':_0x2f6843[_0xbe08('0x5f')][_0xbe08('0x42')],'key':_0x2f6843[_0xbe08('0x5f')][_0xbe08('0x6d')],'email':_0x2f6843['body'][_0xbe08('0x6e')],'ListId':_0x2f6843[_0xbe08('0x5f')]['ListId'],'active':!_[_0xbe08('0x6f')](_0x2f6843[_0xbe08('0x5f')][_0xbe08('0x70')])?_0x2f6843[_0xbe08('0x5f')][_0xbe08('0x70')]:!![],'description':_0x2f6843[_0xbe08('0x5f')][_0xbe08('0x71')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x2f6843[_0xbe08('0x5f')][_0xbe08('0x72')])){if(_0x2f6843['body']['cauthentication']){_0x99eb7e['Imap'][_0xbe08('0x73')]=_0x99eb7e[_0xbe08('0x58')][_0xbe08('0x73')]=_0x2f6843[_0xbe08('0x5f')][_0xbe08('0x74')];_0x99eb7e[_0xbe08('0x39')][_0xbe08('0x75')]=_0x99eb7e[_0xbe08('0x58')]['pass']=_0x2f6843[_0xbe08('0x5f')][_0xbe08('0x76')];}else{_0x99eb7e[_0xbe08('0x39')][_0xbe08('0x77')]=_0x99eb7e[_0xbe08('0x58')]['authentication']=![];}_0x99eb7e[_0xbe08('0x39')]['host']=_0x2f6843['body'][_0xbe08('0x39')]['host'];_0x99eb7e[_0xbe08('0x39')][_0xbe08('0x78')]=_0x2f6843[_0xbe08('0x5f')]['Imap'][_0xbe08('0x78')];_0x99eb7e['Smtp'][_0xbe08('0x79')]=_0x2f6843[_0xbe08('0x5f')][_0xbe08('0x58')][_0xbe08('0x79')];_0x99eb7e[_0xbe08('0x58')][_0xbe08('0x78')]=_0x2f6843['body'][_0xbe08('0x58')]['port'];}else{_0x99eb7e[_0xbe08('0x39')][_0xbe08('0x7a')]=_0x99eb7e['Smtp'][_0xbe08('0x7a')]=_0x2f6843[_0xbe08('0x5f')][_0xbe08('0x72')];_0x99eb7e['Imap'][_0xbe08('0x73')]=_0x99eb7e[_0xbe08('0x58')][_0xbe08('0x73')]=_0x2f6843[_0xbe08('0x5f')]['cuser'];_0x99eb7e[_0xbe08('0x39')][_0xbe08('0x75')]=_0x99eb7e[_0xbe08('0x58')][_0xbe08('0x7b')]=_0x2f6843[_0xbe08('0x5f')][_0xbe08('0x76')];}return db['MailAccount'][_0xbe08('0x64')](_0x99eb7e,{'include':[{'model':db[_0xbe08('0x3a')],'as':_0xbe08('0x58')},{'model':db['MailServerIn'],'as':_0xbe08('0x39')}]})[_0xbe08('0x35')](function(_0x5a555a){var _0x5c2aad=_0x2f6843[_0xbe08('0x73')][_0xbe08('0x7c')]({'plain':!![]});if(!_0x5c2aad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c2aad[_0xbe08('0x7d')]===_0xbe08('0x73')){var _0x207305=_0x5a555a['get']({'plain':!![]});return db[_0xbe08('0x7e')]['find']({'where':{'name':_0xbe08('0x36'),'userProfileId':_0x5c2aad[_0xbe08('0x7f')]},'raw':!![]})[_0xbe08('0x35')](function(_0x3ec365){if(_0x3ec365&&_0x3ec365['autoAssociation']===0x0){return db[_0xbe08('0x80')]['create']({'name':_0x207305['name'],'resourceId':_0x207305['id'],'type':_0x3ec365['name'],'sectionId':_0x3ec365['id']},{})[_0xbe08('0x35')](function(){return _0x5a555a;});}else{return _0x5a555a;}})[_0xbe08('0x55')](function(_0x11e8a3){logger[_0xbe08('0x27')](_0xbe08('0x81'),_0x11e8a3);throw _0x11e8a3;});}return _0x5a555a;})[_0xbe08('0x35')](respondWithResult(_0x2fe1f2,0xc9))['catch'](handleError(_0x2fe1f2,null));};exports[_0xbe08('0x82')]=function(_0x5b967b,_0x209b4a,_0x253423){return db['MailAccount']['findOne']({'where':{'id':_0x5b967b[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x209b4a,null))[_0xbe08('0x35')](function(_0x503446){if(_0x503446){return _0x503446['getImap']();}return null;})[_0xbe08('0x35')](respondWithResult(_0x209b4a,null))['catch'](handleError(_0x209b4a,null));};exports[_0xbe08('0x83')]=function(_0x4200ee,_0x8a76c0,_0x18090b){if(_0x4200ee['body']['id']){delete _0x4200ee['body']['id'];}return db['MailAccount'][_0xbe08('0x5d')]({'where':{'id':_0x4200ee[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x8a76c0,null))['then'](function(_0x887a57){if(_0x887a57){_0x4200ee['body'][_0xbe08('0x62')]=_0x887a57['id'];return db[_0xbe08('0x57')][_0xbe08('0x64')](_0x4200ee[_0xbe08('0x5f')]);}})[_0xbe08('0x35')](respondWithResult(_0x8a76c0,null))[_0xbe08('0x55')](handleError(_0x8a76c0,null));};exports[_0xbe08('0x84')]=function(_0x46d513,_0x325e6c,_0x74f01f){return db[_0xbe08('0x3e')]['findOne']({'where':{'id':_0x46d513['params']['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x325e6c,null))[_0xbe08('0x35')](function(_0x4f0f15){if(_0x4f0f15){return _0x4f0f15[_0xbe08('0x85')](null);}return null;})[_0xbe08('0x35')](respondWithStatusCode(_0x325e6c,null))[_0xbe08('0x55')](handleError(_0x325e6c,null));};exports[_0xbe08('0x86')]=function(_0x1f3b03,_0x32cb25,_0x221a63){return db[_0xbe08('0x3e')]['findOne']({'where':{'id':_0x1f3b03[_0xbe08('0x56')]['id']}})['then'](handleEntityNotFound(_0x32cb25,null))[_0xbe08('0x35')](function(_0x960550){if(_0x960550){return _0x960550[_0xbe08('0x86')]();}return null;})[_0xbe08('0x35')](respondWithResult(_0x32cb25,null))[_0xbe08('0x55')](handleError(_0x32cb25,null));};exports[_0xbe08('0x87')]=function(_0x35ddc6,_0x106e4a,_0x5acbda){if(_0x35ddc6[_0xbe08('0x5f')]['id']){delete _0x35ddc6[_0xbe08('0x5f')]['id'];}return db[_0xbe08('0x3e')]['find']({'where':{'id':_0x35ddc6[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x106e4a,null))[_0xbe08('0x35')](function(_0x3d9d1f){if(_0x3d9d1f){_0x35ddc6['body']['MailAccountId']=_0x3d9d1f['id'];return db[_0xbe08('0x3a')][_0xbe08('0x64')](_0x35ddc6[_0xbe08('0x5f')]);}})[_0xbe08('0x35')](respondWithResult(_0x106e4a,null))[_0xbe08('0x55')](handleError(_0x106e4a,null));};exports[_0xbe08('0x88')]=function(_0xb7d1e4,_0x2b6c18,_0x2bff1d){return db[_0xbe08('0x3e')][_0xbe08('0x66')]({'where':{'id':_0xb7d1e4['params']['id']}})['then'](handleEntityNotFound(_0x2b6c18,null))[_0xbe08('0x35')](function(_0x1d1b00){if(_0x1d1b00){return _0x1d1b00['setSmtp'](null);}return null;})[_0xbe08('0x35')](respondWithStatusCode(_0x2b6c18,null))['catch'](handleError(_0x2b6c18,null));};exports[_0xbe08('0x89')]=function(_0x10bc99,_0x62fc0b,_0x1943ea){return db[_0xbe08('0x8a')][_0xbe08('0x5d')]({'where':{'id':_0x10bc99['params']['id']}})['then'](handleEntityNotFound(_0x62fc0b,null))['then'](function(_0x21bfc9){if(_0x21bfc9){return _0x21bfc9[_0xbe08('0x89')](_0x10bc99[_0xbe08('0x5f')][_0xbe08('0x68')],_[_0xbe08('0x8b')](_0x10bc99['body'],[_0xbe08('0x68'),'id'])||{});}})[_0xbe08('0x35')](respondWithResult(_0x62fc0b,null))[_0xbe08('0x55')](handleError(_0x62fc0b,null));};exports[_0xbe08('0x8c')]=function(_0x140a20,_0x1f0fd1,_0x35bbf5){var _0x9f5487={'raw':![],'where':{}};var _0x1af564={};var _0x3592b={'count':0x0,'rows':[]};return db[_0xbe08('0x3e')][_0xbe08('0x66')]({'where':{'id':_0x140a20['params']['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x1f0fd1,null))[_0xbe08('0x35')](function(_0x13f9b3){if(_0x13f9b3){_0x1af564[_0xbe08('0x41')]=_[_0xbe08('0x59')](db[_0xbe08('0x8a')][_0xbe08('0x3f')]);_0x1af564[_0xbe08('0x43')]=_[_0xbe08('0x59')](_0x140a20[_0xbe08('0x43')]);_0x1af564[_0xbe08('0x44')]=_[_0xbe08('0x45')](_0x1af564['model'],_0x1af564[_0xbe08('0x43')]);_0x9f5487[_0xbe08('0x46')]=_['intersection'](_0x1af564['model'],qs[_0xbe08('0x5a')](_0x140a20[_0xbe08('0x43')][_0xbe08('0x5a')]));_0x9f5487[_0xbe08('0x46')]=_0x9f5487[_0xbe08('0x46')]['length']?_0x9f5487['attributes']:_0x1af564[_0xbe08('0x41')];if(!_0x140a20[_0xbe08('0x43')][_0xbe08('0x47')](_0xbe08('0x48'))){_0x9f5487[_0xbe08('0x2f')]=qs[_0xbe08('0x2f')](_0x140a20['query'][_0xbe08('0x2f')]);_0x9f5487['offset']=qs['offset'](_0x140a20[_0xbe08('0x43')][_0xbe08('0x2e')]);}_0x9f5487[_0xbe08('0x49')]=qs[_0xbe08('0x4a')](_0x140a20[_0xbe08('0x43')][_0xbe08('0x4a')]);_0x9f5487[_0xbe08('0x4b')]=qs[_0xbe08('0x44')](_[_0xbe08('0x8d')](_0x140a20['query'],_0x1af564[_0xbe08('0x44')]));_0x9f5487[_0xbe08('0x4b')][_0xbe08('0x62')]=_0x13f9b3['id'];if(_0x140a20['query'][_0xbe08('0x4c')]){_0x9f5487[_0xbe08('0x4b')]=_[_0xbe08('0x4f')](_0x9f5487[_0xbe08('0x4b')],{'$or':_[_0xbe08('0x3d')](_0x9f5487[_0xbe08('0x46')],function(_0x7a9694){var _0x261285={};_0x261285[_0x7a9694]={'$like':'%'+_0x140a20[_0xbe08('0x43')][_0xbe08('0x4c')]+'%'};return _0x261285;})});}_0x9f5487=_[_0xbe08('0x4f')]({},_0x9f5487,_0x140a20[_0xbe08('0x50')]);return db[_0xbe08('0x8a')][_0xbe08('0x51')]({'where':_0x9f5487['where']})[_0xbe08('0x35')](function(_0x33a14e){_0x3592b[_0xbe08('0x51')]=_0x33a14e;if(_0x140a20[_0xbe08('0x43')][_0xbe08('0x5c')]){_0x9f5487[_0xbe08('0x52')]=[{'model':db[_0xbe08('0x8e')],'as':_0xbe08('0x8f'),'required':![]},{'model':db[_0xbe08('0x90')],'as':_0xbe08('0x91'),'attributes':[_0xbe08('0x42'),_0xbe08('0x92'),_0xbe08('0x93')],'required':![]},{'model':db[_0xbe08('0x94')],'as':_0xbe08('0x95'),'attributes':['id',_0xbe08('0x42'),'color'],'where':_0x140a20['query'][_0xbe08('0x96')]?{'id':_0x140a20['query'][_0xbe08('0x96')]}:undefined,'required':_0x140a20['query'][_0xbe08('0x96')]?!![]:![]}];}return db[_0xbe08('0x8a')][_0xbe08('0x53')](_0x9f5487);})['then'](function(_0x53ce62){_0x3592b[_0xbe08('0x54')]=_0x53ce62;return _0x3592b;});}})[_0xbe08('0x35')](respondWithFilteredResult(_0x1f0fd1,_0x9f5487))[_0xbe08('0x55')](handleError(_0x1f0fd1,null));};exports['addApplications']=function(_0x1785ff,_0x5e2491,_0x4328e4){return db[_0xbe08('0x3e')]['findOne']({'where':{'id':_0x1785ff[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x5e2491,null))[_0xbe08('0x35')](function(_0x156c3c){if(_0x156c3c){return db[_0xbe08('0x97')]['transaction'](function(_0x43af3b){return db[_0xbe08('0x98')]['destroy']({'where':{'MailAccountId':_0x1785ff[_0xbe08('0x56')]['id']},'transaction':_0x43af3b})[_0xbe08('0x35')](function(_0x50208e){var _0x5f0a9c=_[_0xbe08('0x3d')](_0x1785ff['body'],function(_0x1f1a19){_0x1f1a19[_0xbe08('0x62')]=_0x1785ff[_0xbe08('0x56')]['id'];return _0x1f1a19;});return db[_0xbe08('0x98')][_0xbe08('0x99')](_0x5f0a9c,{'transaction':_0x43af3b});});})[_0xbe08('0x35')](function(){return db[_0xbe08('0x98')]['findAndCountAll']({'where':{'MailAccountId':_0x1785ff[_0xbe08('0x56')]['id']},'order':_0xbe08('0x9a')});});}})[_0xbe08('0x35')](respondWithResult(_0x5e2491,null))[_0xbe08('0x55')](handleError(_0x5e2491,null));};exports['getApplications']=function(_0x5133ef,_0x4b71df,_0x19d27a){var _0x18040e={};var _0x6aa329={};var _0x24a6c9;var _0x2d58eb;return db['MailAccount'][_0xbe08('0x66')]({'where':{'id':_0x5133ef[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x4b71df,null))[_0xbe08('0x35')](function(_0x404703){if(_0x404703){_0x24a6c9=_0x404703;_0x6aa329[_0xbe08('0x41')]=_['keys'](db['MailApplication'][_0xbe08('0x3f')]);_0x6aa329[_0xbe08('0x43')]=_['keys'](_0x5133ef[_0xbe08('0x43')]);_0x6aa329[_0xbe08('0x44')]=_[_0xbe08('0x45')](_0x6aa329[_0xbe08('0x41')],_0x6aa329['query']);_0x18040e['attributes']=_[_0xbe08('0x45')](_0x6aa329[_0xbe08('0x41')],qs[_0xbe08('0x5a')](_0x5133ef['query']['fields']));_0x18040e[_0xbe08('0x46')]=_0x18040e[_0xbe08('0x46')][_0xbe08('0x5b')]?_0x18040e['attributes']:_0x6aa329[_0xbe08('0x41')];_0x18040e['order']=qs[_0xbe08('0x4a')](_0x5133ef[_0xbe08('0x43')][_0xbe08('0x4a')]);_0x18040e[_0xbe08('0x4b')]=qs['filters'](_[_0xbe08('0x8d')](_0x5133ef['query'],_0x6aa329['filters']));if(_0x5133ef[_0xbe08('0x43')]['filter']){_0x18040e[_0xbe08('0x4b')]=_['merge'](_0x18040e[_0xbe08('0x4b')],{'$or':_[_0xbe08('0x3d')](_0x18040e[_0xbe08('0x46')],function(_0x25ad7a){var _0x3a0603={};_0x3a0603[_0x25ad7a]={'$like':'%'+_0x5133ef[_0xbe08('0x43')][_0xbe08('0x4c')]+'%'};return _0x3a0603;})});}_0x18040e=_['merge']({},_0x18040e,_0x5133ef[_0xbe08('0x50')]);return _0x24a6c9[_0xbe08('0x9b')](_0x18040e);}})['then'](function(_0x316ffb){if(_0x316ffb){_0x2d58eb=_0x316ffb[_0xbe08('0x5b')];if(!_0x5133ef[_0xbe08('0x43')][_0xbe08('0x47')](_0xbe08('0x48'))){_0x18040e[_0xbe08('0x2f')]=qs[_0xbe08('0x2f')](_0x5133ef['query'][_0xbe08('0x2f')]);_0x18040e[_0xbe08('0x2e')]=qs['offset'](_0x5133ef['query']['offset']);}return _0x24a6c9[_0xbe08('0x9b')](_0x18040e);}})[_0xbe08('0x35')](function(_0x48ac4f){if(_0x48ac4f){return _0x48ac4f?{'count':_0x2d58eb,'rows':_0x48ac4f}:null;}})[_0xbe08('0x35')](respondWithResult(_0x4b71df,null))[_0xbe08('0x55')](handleError(_0x4b71df,null));};exports[_0xbe08('0x9c')]=function(_0x576b13,_0x34a5b0,_0x48f84a){var _0x1e0d81={'raw':!![],'where':{}};var _0x5302b2={};var _0x1e3b6c={'count':0x0,'rows':[]};return db[_0xbe08('0x3e')][_0xbe08('0x66')]({'where':{'id':_0x576b13[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x34a5b0,null))[_0xbe08('0x35')](function(_0x1a9854){if(_0x1a9854){_0x5302b2[_0xbe08('0x41')]=_[_0xbe08('0x59')](db[_0xbe08('0x9d')][_0xbe08('0x3f')]);_0x5302b2['query']=_[_0xbe08('0x59')](_0x576b13[_0xbe08('0x43')]);_0x5302b2[_0xbe08('0x44')]=_[_0xbe08('0x45')](_0x5302b2[_0xbe08('0x41')],_0x5302b2[_0xbe08('0x43')]);_0x1e0d81['attributes']=_['intersection'](_0x5302b2[_0xbe08('0x41')],qs[_0xbe08('0x5a')](_0x576b13[_0xbe08('0x43')][_0xbe08('0x5a')]));_0x1e0d81[_0xbe08('0x46')]=_0x1e0d81[_0xbe08('0x46')][_0xbe08('0x5b')]?_0x1e0d81[_0xbe08('0x46')]:_0x5302b2['model'];if(!_0x576b13[_0xbe08('0x43')][_0xbe08('0x47')](_0xbe08('0x48'))){_0x1e0d81['limit']=qs[_0xbe08('0x2f')](_0x576b13[_0xbe08('0x43')][_0xbe08('0x2f')]);_0x1e0d81[_0xbe08('0x2e')]=qs[_0xbe08('0x2e')](_0x576b13[_0xbe08('0x43')]['offset']);}_0x1e0d81[_0xbe08('0x49')]=qs[_0xbe08('0x4a')](_0x576b13[_0xbe08('0x43')]['sort']);_0x1e0d81[_0xbe08('0x4b')]=qs[_0xbe08('0x44')](_[_0xbe08('0x8d')](_0x576b13[_0xbe08('0x43')],_0x5302b2[_0xbe08('0x44')]));_0x1e0d81[_0xbe08('0x4b')]['MailAccountId']=_0x1a9854['id'];if(_0x576b13[_0xbe08('0x43')][_0xbe08('0x4c')]){_0x1e0d81[_0xbe08('0x4b')]=_['merge'](_0x1e0d81[_0xbe08('0x4b')],{'$or':_[_0xbe08('0x3d')](_0x1e0d81[_0xbe08('0x46')],function(_0x3594e1){var _0x39d44f={};_0x39d44f[_0x3594e1]={'$like':'%'+_0x576b13[_0xbe08('0x43')][_0xbe08('0x4c')]+'%'};return _0x39d44f;})});}if(_0x576b13[_0xbe08('0x43')]['$gte']){var _0x28003d=_0x576b13[_0xbe08('0x43')][_0xbe08('0x9e')][_0xbe08('0x9f')](',');var _0x576b77={};_0x576b77[_0x28003d[0x0]]={'$gte':moment(_0x28003d[0x1])[_0xbe08('0xa0')](_0xbe08('0xa1'))};_0x1e0d81['where']=_[_0xbe08('0x4f')](_0x1e0d81[_0xbe08('0x4b')],_0x576b77);}_0x1e0d81=_['merge']({},_0x1e0d81,_0x576b13['options']);return db[_0xbe08('0x9d')][_0xbe08('0x51')]({'where':_0x1e0d81[_0xbe08('0x4b')]})[_0xbe08('0x35')](function(_0x284e40){_0x1e3b6c['count']=_0x284e40;if(_0x576b13[_0xbe08('0x43')][_0xbe08('0x5c')]){_0x1e0d81[_0xbe08('0x52')]=[{'all':!![]}];}return db[_0xbe08('0x9d')][_0xbe08('0x53')](_0x1e0d81);})[_0xbe08('0x35')](function(_0x398f9e){_0x1e3b6c[_0xbe08('0x54')]=_0x398f9e;return _0x1e3b6c;});}})[_0xbe08('0x35')](respondWithFilteredResult(_0x34a5b0,_0x1e0d81))['catch'](handleError(_0x34a5b0,null));};exports[_0xbe08('0x38')]=function(_0x557ba9,_0x43060f,_0x5d4504){var _0x3bd58c,_0x5dfe11={},_0xca3c94;if(_0x557ba9[_0xbe08('0x5f')]['to']){_0xca3c94=_0x557ba9[_0xbe08('0x5f')]['to']['split'](',')[0x0];}return db[_0xbe08('0x3e')]['find']({'where':{'id':_0x557ba9[_0xbe08('0x56')]['id']},'include':[{'model':db[_0xbe08('0xa2')],'as':_0xbe08('0xa3'),'include':[{'model':db[_0xbe08('0x8e')],'as':_0xbe08('0xa4'),'where':{'email':_0xca3c94},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xbe08('0x3a')],'as':'Smtp','raw':!![]}]})[_0xbe08('0x35')](handleEntityNotFound(_0x43060f,null))[_0xbe08('0x35')](function(_0x4b19d6){if(_0x4b19d6){_0x3bd58c=_0x4b19d6;if(_0x4b19d6[_0xbe08('0x58')]){if(_[_0xbe08('0x6f')](_0x557ba9[_0xbe08('0x5f')]['from'])){_0x557ba9[_0xbe08('0x5f')][_0xbe08('0xa5')]=util[_0xbe08('0xa0')](_0xbe08('0xa6'),_0x4b19d6[_0xbe08('0x42')],_0x4b19d6['email']||_0x4b19d6[_0xbe08('0x58')]['user']);}if(_0x557ba9['body'][_0xbe08('0xa7')]&&_0x557ba9['body'][_0xbe08('0xa7')]['length']){for(var _0x1c79ea=0x0;_0x1c79ea<_0x557ba9[_0xbe08('0x5f')][_0xbe08('0xa7')][_0xbe08('0x5b')];_0x1c79ea+=0x1){_0x557ba9[_0xbe08('0x5f')]['attachments'][_0x1c79ea]={'filename':_0x557ba9[_0xbe08('0x5f')][_0xbe08('0xa7')][_0x1c79ea][_0xbe08('0x42')],'path':path[_0xbe08('0xa8')](config[_0xbe08('0xa9')],_0xbe08('0xaa'),_0x557ba9[_0xbe08('0x5f')][_0xbe08('0xa7')][_0x1c79ea]['basename'])};}}var _0x5a7acb={'tls':{'rejectUnauthorized':![]}};if(_[_0xbe08('0x6f')](_0x4b19d6[_0xbe08('0x58')][_0xbe08('0x7a')])){if(_0x4b19d6[_0xbe08('0x58')][_0xbe08('0x77')]){_0x5a7acb['auth']={'user':_0x4b19d6[_0xbe08('0x58')][_0xbe08('0x73')],'pass':_0x4b19d6[_0xbe08('0x58')][_0xbe08('0x7b')]};}_0x5a7acb[_0xbe08('0x79')]=_0x4b19d6['Smtp'][_0xbe08('0x79')];_0x5a7acb[_0xbe08('0x78')]=_0x4b19d6[_0xbe08('0x58')]['port'];_0x5a7acb[_0xbe08('0xab')]=_0x4b19d6['Smtp'][_0xbe08('0xab')];}else{_0x5a7acb[_0xbe08('0x7a')]=_0x4b19d6[_0xbe08('0x58')][_0xbe08('0x7a')];_0x5a7acb[_0xbe08('0xac')]={'user':_0x4b19d6[_0xbe08('0x58')][_0xbe08('0x73')],'pass':_0x4b19d6[_0xbe08('0x58')]['pass']};}return respondWithRpcPromise(_0xbe08('0xad'),'sendMail',{'account':_0x5a7acb,'message':_0x557ba9[_0xbe08('0x5f')]});}else{throw new Error(_0xbe08('0xae'));}}})[_0xbe08('0x35')](function(_0x14badb){if(_0x14badb){_0x5dfe11=_0x14badb;if(_0x3bd58c[_0xbe08('0xa3')]){if(_0x3bd58c['List'][_0xbe08('0xa4')][_0xbe08('0x5b')]){return _0x3bd58c[_0xbe08('0xa3')][_0xbe08('0xa4')][0x0];}else{return db[_0xbe08('0x8e')]['create'](_[_0xbe08('0x19')](_0x557ba9[_0xbe08('0x5f')],{'firstName':_0x557ba9[_0xbe08('0x5f')]['to'],'email':_0x557ba9[_0xbe08('0x5f')]['to'],'phone':_0x557ba9[_0xbe08('0x5f')]['to'],'ListId':_0x3bd58c[_0xbe08('0xaf')]}));}}else{throw new Error(_0xbe08('0xae'));}}})['then'](function(_0xbfe91){if(_0xbfe91){var _0x65a171={'UserId':_0x557ba9[_0xbe08('0x73')]['id'],'ContactId':_0xbfe91['id'],'MailAccountId':_0x3bd58c['id'],'inReplyTo':_0x5dfe11[_0xbe08('0xb0')],'to':_0x557ba9[_0xbe08('0x5f')][_0xbe08('0xa5')],'cc':_0x557ba9[_0xbe08('0x5f')]['cc'],'subject':_0x557ba9[_0xbe08('0x5f')][_0xbe08('0xb1')],'attach':_0x557ba9['body'][_0xbe08('0xb2')],'firstMsgDirection':_0xbe08('0xb3'),'lastMsgAt':moment()[_0xbe08('0xa0')](_0xbe08('0xa1')),'lastMsgDirection':_0xbe08('0xb3'),'lastMsgBody':_0x557ba9[_0xbe08('0x5f')][_0xbe08('0x5f')],'Messages':[_[_0xbe08('0x4f')](_0x557ba9[_0xbe08('0x5f')],{'messageId':_0x5dfe11[_0xbe08('0xb0')],'sentAt':moment()['format'](_0xbe08('0xa1')),'read':!![],'MailAccountId':_0x3bd58c['id'],'UserId':_0x557ba9[_0xbe08('0x73')]['id'],'ContactId':_0xbfe91['id']})]};if(_0x557ba9['body'][_0xbe08('0xb4')]){_0x65a171=_[_0xbe08('0x4f')](_0x65a171,_0x557ba9[_0xbe08('0x5f')]['Interaction']);}return db['MailInteraction'][_0xbe08('0x64')](_0x65a171,{'include':[{'model':db[_0xbe08('0x9d')],'as':'Messages'}]});}})[_0xbe08('0x35')](respondWithResult(_0x43060f,null))['catch'](handleError(_0x43060f,null));};exports[_0xbe08('0xb5')]=function(_0x40ed4e,_0x20d5c6,_0x571f61){return db[_0xbe08('0x3e')][_0xbe08('0x5d')]({'where':{'id':_0x40ed4e['params']['id']},'include':[{'model':db[_0xbe08('0x3a')],'as':_0xbe08('0x58'),'raw':!![]}]})[_0xbe08('0x35')](handleEntityNotFound(_0x20d5c6,null))[_0xbe08('0x35')](function(_0x164d9){if(_0x164d9&&_0x164d9[_0xbe08('0x58')]){var _0x4acb28={'id':_0x164d9['id'],'tls':{'rejectUnauthorized':![]}};if(_0x164d9[_0xbe08('0x58')][_0xbe08('0x7a')]){_0x4acb28[_0xbe08('0x7a')]=_0x164d9[_0xbe08('0x58')][_0xbe08('0x7a')];}else{_0x4acb28[_0xbe08('0x79')]=_0x164d9['Smtp'][_0xbe08('0x79')];_0x4acb28['port']=_0x164d9[_0xbe08('0x58')][_0xbe08('0x78')];_0x4acb28[_0xbe08('0xab')]=_0x164d9[_0xbe08('0x58')][_0xbe08('0xab')];}if(_0x164d9['Smtp'][_0xbe08('0x77')]){_0x4acb28[_0xbe08('0xac')]={'user':_0x164d9[_0xbe08('0x58')][_0xbe08('0x73')],'pass':_0x164d9[_0xbe08('0x58')]['pass']};}return respondWithRpcPromise('VerifySmtp',_0xbe08('0xb5'),{'account':_0x4acb28});}})['then'](respondWithResult(_0x20d5c6,null))[_0xbe08('0x55')](handleError(_0x20d5c6,null));};exports['destroy']=function(_0x570114,_0x51e7a8){return db[_0xbe08('0x3e')][_0xbe08('0x5d')]({'where':{'id':_0x570114[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x51e7a8,null))[_0xbe08('0x35')](function(_0x317188){if(_0x317188&&_0x317188[_0xbe08('0x7a')]){throw new db[(_0xbe08('0xb6'))]['ValidationError'](_0xbe08('0xb7'));}return _0x317188;})['then'](removeEntity(_0x51e7a8,null))[_0xbe08('0x55')](handleError(_0x51e7a8,null));};exports[_0xbe08('0xb8')]=function(_0xbd8868,_0x3583a5,_0x4f41c1){return db[_0xbe08('0x3e')][_0xbe08('0x5d')]({'where':{'id':_0xbd8868[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x3583a5,null))[_0xbe08('0x35')](function(_0x519a2f){if(_0x519a2f){return _0x519a2f[_0xbe08('0xb8')](_0xbd8868[_0xbe08('0x5f')][_0xbe08('0x68')],_['omit'](_0xbd8868[_0xbe08('0x5f')],[_0xbe08('0x68'),'id'])||{})[_0xbe08('0xb9')](function(_0x19e0e5){for(var _0x3e67ff=0x0;_0x3e67ff<_0xbd8868['body'][_0xbe08('0x68')][_0xbe08('0x5b')];_0x3e67ff+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0xbd8868['body'][_0xbe08('0x68')][_0x3e67ff],'MailAccountId':_0xbd8868[_0xbe08('0x56')]['id']});}return _0x19e0e5;});}})['then'](respondWithResult(_0x3583a5,null))[_0xbe08('0x55')](handleError(_0x3583a5,null));};exports['removeAgents']=function(_0x1a8eb8,_0x1067dd,_0x4b5a17){return db[_0xbe08('0x3e')][_0xbe08('0x5d')]({'where':{'id':_0x1a8eb8[_0xbe08('0x56')]['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x1067dd,null))[_0xbe08('0x35')](function(_0x1831fc){if(_0x1831fc){return _0x1831fc[_0xbe08('0xba')](_0x1a8eb8[_0xbe08('0x43')][_0xbe08('0x68')])['then'](function(){if(_[_0xbe08('0xbb')](_0x1a8eb8[_0xbe08('0x43')][_0xbe08('0x68')])){for(var _0x2e4ea6=0x0;_0x2e4ea6<_0x1a8eb8[_0xbe08('0x43')][_0xbe08('0x68')][_0xbe08('0x5b')];_0x2e4ea6+=0x1){socket[_0xbe08('0xbc')]('userMailAccount:remove',{'UserId':Number(_0x1a8eb8[_0xbe08('0x43')]['ids'][_0x2e4ea6]),'MailAccountId':Number(_0x1a8eb8[_0xbe08('0x56')]['id'])});}}else{socket[_0xbe08('0xbc')](_0xbe08('0xbd'),{'UserId':Number(_0x1a8eb8[_0xbe08('0x43')]['ids']),'MailAccountId':Number(_0x1a8eb8[_0xbe08('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x1067dd,null))[_0xbe08('0x55')](handleError(_0x1067dd,null));};exports[_0xbe08('0xbe')]=function(_0x6d8a5b,_0x1e4740,_0x24c257){var _0x29f915={};var _0x3eb332={};var _0x10b992;var _0x2bb08e;return db[_0xbe08('0x3e')][_0xbe08('0x66')]({'where':{'id':_0x6d8a5b['params']['id']}})[_0xbe08('0x35')](handleEntityNotFound(_0x1e4740,null))[_0xbe08('0x35')](function(_0x4001fb){if(_0x4001fb){_0x10b992=_0x4001fb;_0x3eb332[_0xbe08('0x41')]=_[_0xbe08('0x59')](db[_0xbe08('0x90')][_0xbe08('0x3f')]);_0x3eb332['query']=_[_0xbe08('0x59')](_0x6d8a5b[_0xbe08('0x43')]);_0x3eb332[_0xbe08('0x44')]=_['intersection'](_0x3eb332[_0xbe08('0x41')],_0x3eb332[_0xbe08('0x43')]);_0x29f915['attributes']=_[_0xbe08('0x45')](_0x3eb332[_0xbe08('0x41')],qs[_0xbe08('0x5a')](_0x6d8a5b[_0xbe08('0x43')][_0xbe08('0x5a')]));_0x29f915['attributes']=_0x29f915[_0xbe08('0x46')]['length']?_0x29f915['attributes']:_0x3eb332[_0xbe08('0x41')];_0x29f915[_0xbe08('0x49')]=qs[_0xbe08('0x4a')](_0x6d8a5b['query'][_0xbe08('0x4a')]);_0x29f915[_0xbe08('0x4b')]=qs[_0xbe08('0x44')](_[_0xbe08('0x8d')](_0x6d8a5b[_0xbe08('0x43')],_0x3eb332[_0xbe08('0x44')]));if(_0x6d8a5b[_0xbe08('0x43')][_0xbe08('0x4c')]){_0x29f915[_0xbe08('0x4b')]=_['merge'](_0x29f915[_0xbe08('0x4b')],{'$or':_[_0xbe08('0x3d')](_0x29f915['attributes'],function(_0x71325a){var _0x2a86ee={};_0x2a86ee[_0x71325a]={'$like':'%'+_0x6d8a5b[_0xbe08('0x43')][_0xbe08('0x4c')]+'%'};return _0x2a86ee;})});}_0x29f915=_[_0xbe08('0x4f')]({},_0x29f915,_0x6d8a5b[_0xbe08('0x50')]);return _0x10b992['getAgents'](_0x29f915);}})[_0xbe08('0x35')](function(_0x4fbc35){if(_0x4fbc35){_0x2bb08e=_0x4fbc35[_0xbe08('0x5b')];if(!_0x6d8a5b[_0xbe08('0x43')]['hasOwnProperty']('nolimit')){_0x29f915[_0xbe08('0x2f')]=qs[_0xbe08('0x2f')](_0x6d8a5b[_0xbe08('0x43')][_0xbe08('0x2f')]);_0x29f915[_0xbe08('0x2e')]=qs[_0xbe08('0x2e')](_0x6d8a5b[_0xbe08('0x43')]['offset']);}return _0x10b992[_0xbe08('0xbe')](_0x29f915);}})[_0xbe08('0x35')](function(_0x21b8a1){if(_0x21b8a1){return _0x21b8a1?{'count':_0x2bb08e,'rows':_0x21b8a1}:null;}})['then'](respondWithResult(_0x1e4740,null))[_0xbe08('0x55')](handleError(_0x1e4740,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index f29039b..328ab0b 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 _0xeb7c=['events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x10220e,_0x3858eb){var _0x34f7df=function(_0x469778){while(--_0x469778){_0x10220e['push'](_0x10220e['shift']());}};_0x34f7df(++_0x3858eb);}(_0xeb7c,0x6e));var _0xceb7=function(_0x42fcf2,_0x4c9a83){_0x42fcf2=_0x42fcf2-0x0;var _0x1e5595=_0xeb7c[_0x42fcf2];return _0x1e5595;};'use strict';var EventEmitter=require(_0xceb7('0x0'));var MailAccount=require(_0xceb7('0x1'))['db'][_0xceb7('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xceb7('0x3')](0x0);var events={'afterCreate':_0xceb7('0x4'),'afterUpdate':_0xceb7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5ee3d6){return function(_0x29ac69,_0x54efd6,_0x56ee3e){MailAccountEvents[_0xceb7('0x6')](_0x5ee3d6+':'+_0x29ac69['id'],_0x29ac69);MailAccountEvents[_0xceb7('0x6')](_0x5ee3d6,_0x29ac69);_0x56ee3e(null);};}for(var e in events){if(events[_0xceb7('0x7')](e)){var event=events[e];MailAccount[_0xceb7('0x8')](e,emitEvent(event));}}module[_0xceb7('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x5c5b=['save','emit','hook','exports','MailAccount','setMaxListeners'];(function(_0x5499d9,_0x1abd4f){var _0x52054c=function(_0x2205bc){while(--_0x2205bc){_0x5499d9['push'](_0x5499d9['shift']());}};_0x52054c(++_0x1abd4f);}(_0x5c5b,0x10c));var _0xb5c5=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0x5c5b[_0x32b30c];return _0xcfc212;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0xb5c5('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xb5c5('0x1')](0x0);var events={'afterCreate':_0xb5c5('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5cae77){return function(_0x4c6ea2,_0x520be4,_0x2a7b3d){MailAccountEvents[_0xb5c5('0x3')](_0x5cae77+':'+_0x4c6ea2['id'],_0x4c6ea2);MailAccountEvents[_0xb5c5('0x3')](_0x5cae77,_0x4c6ea2);_0x2a7b3d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xb5c5('0x4')](e,emitEvent(event));}}module[_0xb5c5('0x5')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index bac9396..9c3bbc2 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 _0xf95d=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailAccount.attributes','exports','MailAccount','mail_accounts','lodash','../../config/logger'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0xf95d,0x14e));var _0xdf95=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xf95d[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xdf95('0x0'));var util=require('util');var logger=require(_0xdf95('0x1'))(_0xdf95('0x2'));var moment=require(_0xdf95('0x3'));var BPromise=require(_0xdf95('0x4'));var rp=require(_0xdf95('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf95('0x6'));var config=require(_0xdf95('0x7'));var attributes=require(_0xdf95('0x8'));module[_0xdf95('0x9')]=function(_0x1295cd,_0x18584a){return _0x1295cd['define'](_0xdf95('0xa'),attributes,{'tableName':_0xdf95('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b36=['exports','define','MailAccount','mail_accounts','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x6b36,0xbf));var _0x66b3=function(_0x9bd365,_0x4732ce){_0x9bd365=_0x9bd365-0x0;var _0x5eb4ba=_0x6b36[_0x9bd365];return _0x5eb4ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x66b3('0x0'));var BPromise=require(_0x66b3('0x1'));var rp=require(_0x66b3('0x2'));var fs=require('fs');var path=require(_0x66b3('0x3'));var rimraf=require(_0x66b3('0x4'));var config=require(_0x66b3('0x5'));var attributes=require(_0x66b3('0x6'));module[_0x66b3('0x7')]=function(_0x5aad4b,_0x51de4c){return _0x5aad4b[_0x66b3('0x8')](_0x66b3('0x9'),attributes,{'tableName':_0x66b3('0xa'),'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 b15d2a3..1cac4da 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 _0x6b19=['defaults','create','List\x20not\x20found','contact','messageId','generate','subject','format','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','originCc','bcc','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','register','request','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','map','include','model','then','stringify','ShowMailAccount','find','where','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','MailApplication','Applications','Smtp','get','account','omit','applications','list','orderBy','asc','autoclose','push','length','close'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b19,0xe8));var _0x96b1=function(_0xa96de4,_0x1b2bba){_0xa96de4=_0xa96de4-0x0;var _0x5e7ed5=_0x6b19[_0xa96de4];return _0x5e7ed5;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var moment=require('moment');var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b1('0x3'))['db'];var utils=require(_0x96b1('0x4'));var logger=require(_0x96b1('0x5'))(_0x96b1('0x6'));var config=require(_0x96b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96b1('0x8')]['http']({'port':0x232c});config[_0x96b1('0x9')]=_['defaults'](config['redis'],{'host':_0x96b1('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x96b1('0x9')]));require('./mailAccount.socket')[_0x96b1('0xb')](socket);function respondWithRpcPromise(_0x34c81c,_0x366a60,_0x37612e){return new BPromise(function(_0x39eeb7,_0x3e5607){return client[_0x96b1('0xc')](_0x34c81c,_0x37612e)['then'](function(_0x52256e){logger[_0x96b1('0xd')]('MailAccount,\x20%s,\x20%s',_0x366a60,'request\x20sent');logger[_0x96b1('0xe')](_0x96b1('0xf'),_0x366a60,_0x96b1('0x10'),JSON['stringify'](_0x52256e));if(_0x52256e[_0x96b1('0x11')]){if(_0x52256e[_0x96b1('0x11')][_0x96b1('0x12')]===0x1f4){logger[_0x96b1('0x11')](_0x96b1('0x13'),_0x366a60,_0x52256e['error'][_0x96b1('0x14')]);return _0x3e5607(_0x52256e[_0x96b1('0x11')][_0x96b1('0x14')]);}logger[_0x96b1('0x11')](_0x96b1('0x13'),_0x366a60,_0x52256e[_0x96b1('0x11')][_0x96b1('0x14')]);return _0x39eeb7(_0x52256e[_0x96b1('0x11')][_0x96b1('0x14')]);}else{logger[_0x96b1('0xd')](_0x96b1('0x13'),_0x366a60,_0x96b1('0x10'));_0x39eeb7(_0x52256e[_0x96b1('0x15')][_0x96b1('0x14')]);}})[_0x96b1('0x16')](function(_0x4db9d5){logger[_0x96b1('0x11')]('MailAccount,\x20%s,\x20%s',_0x366a60,_0x4db9d5);_0x3e5607(_0x4db9d5);});});}exports[_0x96b1('0x17')]=function(_0x2f98a2){var _0x41f010=this;return new Promise(function(_0x5dd21e,_0xc5dc95){return db[_0x96b1('0x18')][_0x96b1('0x19')]({'raw':_0x2f98a2['options']?_0x2f98a2[_0x96b1('0x1a')][_0x96b1('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f98a2[_0x96b1('0x1a')]?_0x2f98a2[_0x96b1('0x1a')]['where']||null:null,'attributes':_0x2f98a2[_0x96b1('0x1a')]?_0x2f98a2[_0x96b1('0x1a')][_0x96b1('0x1c')]||null:null,'limit':_0x2f98a2['options']?_0x2f98a2[_0x96b1('0x1a')][_0x96b1('0x1d')]||null:null,'include':_0x2f98a2[_0x96b1('0x1a')]?_0x2f98a2[_0x96b1('0x1a')]['include']?_[_0x96b1('0x1e')](_0x2f98a2['options'][_0x96b1('0x1f')],function(_0x4ad19f){return{'model':db[_0x4ad19f[_0x96b1('0x20')]],'as':_0x4ad19f['as'],'attributes':_0x4ad19f[_0x96b1('0x1c')],'include':_0x4ad19f['include']?_['map'](_0x4ad19f['include'],function(_0x3f24bc){return{'model':db[_0x3f24bc[_0x96b1('0x20')]],'as':_0x3f24bc['as'],'attributes':_0x3f24bc[_0x96b1('0x1c')],'include':_0x3f24bc[_0x96b1('0x1f')]?_[_0x96b1('0x1e')](_0x3f24bc['include'],function(_0x21a63f){return{'model':db[_0x21a63f[_0x96b1('0x20')]],'as':_0x21a63f['as'],'attributes':_0x21a63f[_0x96b1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x96b1('0x21')](function(_0x51e2c1){logger[_0x96b1('0xd')](_0x96b1('0x17'),_0x2f98a2);logger['debug']('GetMailAccount',_0x2f98a2,JSON[_0x96b1('0x22')](_0x51e2c1));_0x5dd21e(_0x51e2c1);})['catch'](function(_0x436605){logger[_0x96b1('0x11')]('GetMailAccount',_0x436605[_0x96b1('0x14')],_0x2f98a2);_0xc5dc95(_0x41f010[_0x96b1('0x11')](0x1f4,_0x436605['message']));});});};exports[_0x96b1('0x23')]=function(_0x444401){var _0x11cdf5=this;return new Promise(function(_0x50d470,_0x2ac0bf){return db[_0x96b1('0x18')][_0x96b1('0x24')]({'raw':_0x444401[_0x96b1('0x1a')]?_0x444401[_0x96b1('0x1a')][_0x96b1('0x1b')]===undefined?!![]:![]:!![],'where':_0x444401['options']?_0x444401[_0x96b1('0x1a')][_0x96b1('0x25')]||null:null,'attributes':_0x444401['options']?_0x444401['options'][_0x96b1('0x1c')]||null:null,'include':_0x444401[_0x96b1('0x1a')]?_0x444401[_0x96b1('0x1a')]['include']?_['map'](_0x444401[_0x96b1('0x1a')][_0x96b1('0x1f')],function(_0x1674c4){return{'model':db[_0x1674c4[_0x96b1('0x20')]],'as':_0x1674c4['as'],'attributes':_0x1674c4['attributes'],'include':_0x1674c4[_0x96b1('0x1f')]?_['map'](_0x1674c4[_0x96b1('0x1f')],function(_0x1aef2e){return{'model':db[_0x1aef2e[_0x96b1('0x20')]],'as':_0x1aef2e['as'],'attributes':_0x1aef2e['attributes'],'include':_0x1aef2e[_0x96b1('0x1f')]?_[_0x96b1('0x1e')](_0x1aef2e[_0x96b1('0x1f')],function(_0x5245c8){return{'model':db[_0x5245c8[_0x96b1('0x20')]],'as':_0x5245c8['as'],'attributes':_0x5245c8[_0x96b1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42e59f){logger[_0x96b1('0xd')]('ShowMailAccount',_0x444401);logger[_0x96b1('0xe')]('ShowMailAccount',_0x444401,JSON[_0x96b1('0x22')](_0x42e59f));_0x50d470(_0x42e59f);})[_0x96b1('0x16')](function(_0x353f21){logger[_0x96b1('0x11')](_0x96b1('0x23'),_0x353f21[_0x96b1('0x14')],_0x444401);_0x2ac0bf(_0x11cdf5[_0x96b1('0x11')](0x1f4,_0x353f21[_0x96b1('0x14')]));});});};exports[_0x96b1('0x26')]=function(_0x5d5c8f){var _0x94d1e6=this;return new Promise(function(_0x4d3c9f,_0x41764a){var _0x2dffbc={'body':_0x5d5c8f[_0x96b1('0x27')],'channel':_0x96b1('0x28')};var _0x3304d6=_[_0x96b1('0x29')](_[_0x96b1('0x2a')](db[_0x96b1('0x2b')][_0x96b1('0x2c')]),[_0x96b1('0x2d'),_0x96b1('0x2e'),_0x96b1('0x2f'),_0x96b1('0x30')]);var _0x49a73e=![];if(_0x5d5c8f['body']['id']){delete _0x5d5c8f[_0x96b1('0x27')]['id'];}if(_[_0x96b1('0x31')](_0x5d5c8f['body'][_0x96b1('0x32')])){return _0x41764a(_0x94d1e6[_0x96b1('0x11')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x5d5c8f['body'][_0x96b1('0x27')])||_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x27')]===''){return _0x41764a(_0x94d1e6[_0x96b1('0x11')](0x1f4,_0x96b1('0x33')));}if(_[_0x96b1('0x31')](_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x34')])){return _0x41764a(_0x94d1e6[_0x96b1('0x11')](0x1f4,_0x96b1('0x35')+_0x3304d6));}if(!_['includes'](_0x3304d6,_0x5d5c8f[_0x96b1('0x27')]['mapKey'])){return _0x41764a(_0x94d1e6[_0x96b1('0x11')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3304d6));}var _0xa31123={};_0xa31123[_0x5d5c8f['body'][_0x96b1('0x34')]]=_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x32')];return db[_0x96b1('0x18')][_0x96b1('0x24')]({'where':{'id':_0x5d5c8f['account']['id']},'include':[{'model':db[_0x96b1('0x36')],'as':_0x96b1('0x37'),'include':[{'model':db[_0x96b1('0x2b')],'as':'Contacts','where':_0xa31123,'limit':0x1,'order':[[_0x96b1('0x2e'),_0x96b1('0x38')]]}]},{'model':db[_0x96b1('0x39')],'as':_0x96b1('0x3a')},{'model':db['MailServerOut'],'as':_0x96b1('0x3b')}]})[_0x96b1('0x21')](function(_0x4e6f7a){if(_0x4e6f7a&&_0x4e6f7a[_0x96b1('0x37')]){var _0x43cac1=_0x4e6f7a[_0x96b1('0x3c')]({'plain':!![]});_0x2dffbc[_0x96b1('0x3d')]=_[_0x96b1('0x3e')](_0x43cac1,[_0x96b1('0x3a'),'List']);_0x2dffbc[_0x96b1('0x3f')]=_0x43cac1['Applications'];_0x2dffbc[_0x96b1('0x40')]=_0x43cac1[_0x96b1('0x37')];_0x2dffbc['applications']=_[_0x96b1('0x41')](_0x2dffbc[_0x96b1('0x3f')],['priority'],[_0x96b1('0x42')]);if(_0x2dffbc[_0x96b1('0x3d')]&&_0x2dffbc[_0x96b1('0x3d')][_0x96b1('0x43')]){_0x2dffbc[_0x96b1('0x3f')][_0x96b1('0x44')]({'id':0x0,'priority':_0x2dffbc[_0x96b1('0x3f')][_0x96b1('0x45')]+0x1,'app':_0x96b1('0x46'),'appdata':_0x96b1('0x43'),'interval':'*,*,*,*'});}if(_0x2dffbc[_0x96b1('0x3d')][_0x96b1('0x3a')]){delete _0x2dffbc[_0x96b1('0x3d')][_0x96b1('0x3a')];}if(_0x2dffbc[_0x96b1('0x3d')][_0x96b1('0x37')]){delete _0x2dffbc[_0x96b1('0x3d')][_0x96b1('0x37')];}if(_0x43cac1['List']['Contacts'][_0x96b1('0x45')]){return _0x43cac1[_0x96b1('0x37')]['Contacts'][0x0];}var _0x1f8719=_[_0x96b1('0x47')](_0x5d5c8f[_0x96b1('0x27')],{'firstName':_0x5d5c8f['body'][_0x96b1('0x32')],'ListId':_0x43cac1[_0x96b1('0x30')]});_0x1f8719[_0x5d5c8f['body']['mapKey']]=_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x32')];return db[_0x96b1('0x2b')][_0x96b1('0x48')](_0x1f8719);}else{throw new Error(_0x96b1('0x49'));}})[_0x96b1('0x21')](function(_0x363b94){_0x2dffbc[_0x96b1('0x4a')]=_0x363b94;if(_0x363b94){if(!_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')][_0x96b1('0x4b')]){_0x5d5c8f[_0x96b1('0x27')]['message'][_0x96b1('0x4b')]=rs[_0x96b1('0x4c')]()+'\x20'+_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')][_0x96b1('0x32')];}var _0x1bf97f={'ContactId':_0x363b94['id'],'MailAccountId':_0x5d5c8f[_0x96b1('0x3d')]['id'],'inReplyTo':_0x5d5c8f['body'][_0x96b1('0x14')]['messageId'],'to':_0x5d5c8f['body'][_0x96b1('0x14')][_0x96b1('0x32')],'cc':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')]['cc'],'subject':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')][_0x96b1('0x4d')],'attach':_0x5d5c8f['body'][_0x96b1('0x14')]['attach'],'lastMsgAt':moment()[_0x96b1('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x27')]};return db['MailInteraction'][_0x96b1('0x24')]({'where':{'closed':![],'MailAccountId':_0x5d5c8f[_0x96b1('0x3d')]['id']},'include':[{'model':db[_0x96b1('0x4f')],'as':_0x96b1('0x50'),'attributes':['messageId'],'where':{'messageId':_0x5d5c8f['body'][_0x96b1('0x14')][_0x96b1('0x51')]}}]})[_0x96b1('0x21')](function(_0x3a7063){if(_0x3a7063){return[_0x3a7063,![]];}return db['MailInteraction'][_0x96b1('0x48')](_0x1bf97f)[_0x96b1('0x21')](function(_0x2c2c71){return[_0x2c2c71,!![]];});});}else{throw new Error(_0x96b1('0x52'));}})[_0x96b1('0x53')](function(_0x134e1b,_0x226568){if(_0x134e1b){_0x49a73e=_0x226568;if(!_0x226568){return _0x134e1b[_0x96b1('0x54')]({'inReplyTo':_0x5d5c8f[_0x96b1('0x27')]['message']['messageId'],'to':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')]['from'],'cc':_0x5d5c8f['body'][_0x96b1('0x14')]['cc'],'subject':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')][_0x96b1('0x4d')],'attach':_0x134e1b[_0x96b1('0x55')]?_0x134e1b[_0x96b1('0x55')]:_0x5d5c8f[_0x96b1('0x27')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0x96b1('0x4e')](_0x96b1('0x56')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x27')]});}else{return _0x134e1b;}}})['then'](function(_0x1190d6){_0x2dffbc[_0x96b1('0x57')]=_0x1190d6[_0x96b1('0x3c')]({'plain':!![]});_0x2dffbc[_0x96b1('0x57')][_0x96b1('0x58')]=_0x49a73e;return db[_0x96b1('0x4f')]['create']({'body':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x27')],'MailAccountId':_0x5d5c8f[_0x96b1('0x3d')]['id'],'MailInteractionId':_0x1190d6['id'],'direction':'in','ContactId':_0x2dffbc[_0x96b1('0x4a')]['id'],'messageId':_0x5d5c8f['body'][_0x96b1('0x14')]['messageId'],'from':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')][_0x96b1('0x32')],'to':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')]['to'],'cc':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')]['cc'],'subject':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')][_0x96b1('0x4d')],'attach':_0x5d5c8f[_0x96b1('0x27')]['message'][_0x96b1('0x55')],'Attachments':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')][_0x96b1('0x59')],'originTo':_0x5d5c8f[_0x96b1('0x27')]['message'][_0x96b1('0x5a')],'originCc':_0x5d5c8f[_0x96b1('0x27')]['message'][_0x96b1('0x5b')],'bcc':_0x5d5c8f[_0x96b1('0x27')][_0x96b1('0x14')][_0x96b1('0x5c')]},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})['then'](function(_0x5ea76d){_0x2dffbc[_0x96b1('0x14')]=_0x5ea76d;if(_0x2dffbc[_0x96b1('0x57')]['UserId']){return db[_0x96b1('0x5d')][_0x96b1('0x24')]({'attributes':['id',_0x96b1('0x5e')],'where':{'id':_0x2dffbc['interaction'][_0x96b1('0x5f')]}})[_0x96b1('0x21')](function(_0x40e44f){if(_0x40e44f){_0x2dffbc['applications'][_0x96b1('0x60')]({'id':0x0,'priority':0x0,'app':_0x96b1('0x61'),'appdata':_0x40e44f[_0x96b1('0x5e')]+','+(_0x2dffbc[_0x96b1('0x3d')][_0x96b1('0x62')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x96b1('0x63'),'startRouting',_0x2dffbc);});}return respondWithRpcPromise('Start',_0x96b1('0x64'),_0x2dffbc);})[_0x96b1('0x21')](function(_0x4738c1){_0x4d3c9f(_0x4738c1);})[_0x96b1('0x16')](function(_0x53b9f6){_0x41764a(_0x94d1e6['error'](0x1f4,_0x53b9f6['message']));});});}; \ No newline at end of file +var _0x8ce3=['register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailAccount','findAll','options','raw','attributes','limit','include','map','model','GetMailAccount','ShowMailAccount','find','where','NotifyMailAccount','body','mail','difference','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','CmContact','DESC','Applications','MailServerOut','List','get','account','list','applications','orderBy','priority','autoclose','push','*,*,*,*','Contacts','length','create','List\x20not\x20found','contact','messageId','generate','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','originCc','bcc','Attachment','Attachments','UserId','User','name','waitForTheAssignedAgent','startRouting','Start','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost'];(function(_0x391352,_0x7f7d6d){var _0x5660e9=function(_0x217c9e){while(--_0x217c9e){_0x391352['push'](_0x391352['shift']());}};_0x5660e9(++_0x7f7d6d);}(_0x8ce3,0xc3));var _0x38ce=function(_0x3a14ac,_0x55403f){_0x3a14ac=_0x3a14ac-0x0;var _0x5e3bc3=_0x8ce3[_0x3a14ac];return _0x5e3bc3;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var moment=require('moment');var BPromise=require(_0x38ce('0x2'));var rs=require(_0x38ce('0x3'));var fs=require('fs');var Redis=require(_0x38ce('0x4'));var db=require(_0x38ce('0x5'))['db'];var utils=require(_0x38ce('0x6'));var logger=require(_0x38ce('0x7'))(_0x38ce('0x8'));var config=require(_0x38ce('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38ce('0xa')][_0x38ce('0xb')]({'port':0x232c});config['redis']=_[_0x38ce('0xc')](config[_0x38ce('0xd')],{'host':_0x38ce('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x38ce('0xd')]));require('./mailAccount.socket')[_0x38ce('0xf')](socket);function respondWithRpcPromise(_0x4bd97b,_0x133bd5,_0x31c2e1){return new BPromise(function(_0xa9931b,_0x2c0cab){return client[_0x38ce('0x10')](_0x4bd97b,_0x31c2e1)[_0x38ce('0x11')](function(_0x2a9045){logger[_0x38ce('0x12')](_0x38ce('0x13'),_0x133bd5,_0x38ce('0x14'));logger[_0x38ce('0x15')](_0x38ce('0x16'),_0x133bd5,_0x38ce('0x14'),JSON[_0x38ce('0x17')](_0x2a9045));if(_0x2a9045[_0x38ce('0x18')]){if(_0x2a9045[_0x38ce('0x18')]['code']===0x1f4){logger['error'](_0x38ce('0x13'),_0x133bd5,_0x2a9045[_0x38ce('0x18')][_0x38ce('0x19')]);return _0x2c0cab(_0x2a9045['error'][_0x38ce('0x19')]);}logger['error'](_0x38ce('0x13'),_0x133bd5,_0x2a9045[_0x38ce('0x18')]['message']);return _0xa9931b(_0x2a9045[_0x38ce('0x18')][_0x38ce('0x19')]);}else{logger[_0x38ce('0x12')]('MailAccount,\x20%s,\x20%s',_0x133bd5,_0x38ce('0x14'));_0xa9931b(_0x2a9045[_0x38ce('0x1a')][_0x38ce('0x19')]);}})[_0x38ce('0x1b')](function(_0x3166ab){logger[_0x38ce('0x18')](_0x38ce('0x13'),_0x133bd5,_0x3166ab);_0x2c0cab(_0x3166ab);});});}exports['GetMailAccount']=function(_0x2a9447){var _0x34a8c7=this;return new Promise(function(_0x280586,_0x303391){return db[_0x38ce('0x1c')][_0x38ce('0x1d')]({'raw':_0x2a9447[_0x38ce('0x1e')]?_0x2a9447[_0x38ce('0x1e')][_0x38ce('0x1f')]===undefined?!![]:![]:!![],'where':_0x2a9447[_0x38ce('0x1e')]?_0x2a9447[_0x38ce('0x1e')]['where']||null:null,'attributes':_0x2a9447[_0x38ce('0x1e')]?_0x2a9447[_0x38ce('0x1e')][_0x38ce('0x20')]||null:null,'limit':_0x2a9447[_0x38ce('0x1e')]?_0x2a9447['options'][_0x38ce('0x21')]||null:null,'include':_0x2a9447[_0x38ce('0x1e')]?_0x2a9447['options'][_0x38ce('0x22')]?_[_0x38ce('0x23')](_0x2a9447[_0x38ce('0x1e')]['include'],function(_0x4a7e8e){return{'model':db[_0x4a7e8e[_0x38ce('0x24')]],'as':_0x4a7e8e['as'],'attributes':_0x4a7e8e[_0x38ce('0x20')],'include':_0x4a7e8e[_0x38ce('0x22')]?_[_0x38ce('0x23')](_0x4a7e8e[_0x38ce('0x22')],function(_0x2a59fe){return{'model':db[_0x2a59fe[_0x38ce('0x24')]],'as':_0x2a59fe['as'],'attributes':_0x2a59fe[_0x38ce('0x20')],'include':_0x2a59fe[_0x38ce('0x22')]?_[_0x38ce('0x23')](_0x2a59fe[_0x38ce('0x22')],function(_0x381703){return{'model':db[_0x381703['model']],'as':_0x381703['as'],'attributes':_0x381703[_0x38ce('0x20')]};}):[]};}):[]};}):[]:[]})[_0x38ce('0x11')](function(_0x5b4a7a){logger[_0x38ce('0x12')](_0x38ce('0x25'),_0x2a9447);logger['debug'](_0x38ce('0x25'),_0x2a9447,JSON[_0x38ce('0x17')](_0x5b4a7a));_0x280586(_0x5b4a7a);})['catch'](function(_0x28d775){logger['error'](_0x38ce('0x25'),_0x28d775[_0x38ce('0x19')],_0x2a9447);_0x303391(_0x34a8c7[_0x38ce('0x18')](0x1f4,_0x28d775[_0x38ce('0x19')]));});});};exports[_0x38ce('0x26')]=function(_0x23019f){var _0x34262a=this;return new Promise(function(_0x2f5695,_0x4ec0d3){return db['MailAccount'][_0x38ce('0x27')]({'raw':_0x23019f[_0x38ce('0x1e')]?_0x23019f[_0x38ce('0x1e')][_0x38ce('0x1f')]===undefined?!![]:![]:!![],'where':_0x23019f[_0x38ce('0x1e')]?_0x23019f['options'][_0x38ce('0x28')]||null:null,'attributes':_0x23019f[_0x38ce('0x1e')]?_0x23019f[_0x38ce('0x1e')][_0x38ce('0x20')]||null:null,'include':_0x23019f[_0x38ce('0x1e')]?_0x23019f[_0x38ce('0x1e')][_0x38ce('0x22')]?_['map'](_0x23019f[_0x38ce('0x1e')][_0x38ce('0x22')],function(_0x5b8c69){return{'model':db[_0x5b8c69[_0x38ce('0x24')]],'as':_0x5b8c69['as'],'attributes':_0x5b8c69[_0x38ce('0x20')],'include':_0x5b8c69[_0x38ce('0x22')]?_[_0x38ce('0x23')](_0x5b8c69[_0x38ce('0x22')],function(_0x3d6838){return{'model':db[_0x3d6838[_0x38ce('0x24')]],'as':_0x3d6838['as'],'attributes':_0x3d6838[_0x38ce('0x20')],'include':_0x3d6838['include']?_[_0x38ce('0x23')](_0x3d6838[_0x38ce('0x22')],function(_0x2314a2){return{'model':db[_0x2314a2[_0x38ce('0x24')]],'as':_0x2314a2['as'],'attributes':_0x2314a2['attributes']};}):[]};}):[]};}):[]:[]})[_0x38ce('0x11')](function(_0x54a15a){logger[_0x38ce('0x12')](_0x38ce('0x26'),_0x23019f);logger[_0x38ce('0x15')](_0x38ce('0x26'),_0x23019f,JSON[_0x38ce('0x17')](_0x54a15a));_0x2f5695(_0x54a15a);})[_0x38ce('0x1b')](function(_0x4a6d2b){logger[_0x38ce('0x18')]('ShowMailAccount',_0x4a6d2b[_0x38ce('0x19')],_0x23019f);_0x4ec0d3(_0x34262a[_0x38ce('0x18')](0x1f4,_0x4a6d2b[_0x38ce('0x19')]));});});};exports[_0x38ce('0x29')]=function(_0x277e94){var _0x1476e9=this;return new Promise(function(_0x5209ee,_0x14fb63){var _0x1e0574={'body':_0x277e94[_0x38ce('0x2a')],'channel':_0x38ce('0x2b')};var _0xd4bfe9=_[_0x38ce('0x2c')](_['keys'](db['CmContact'][_0x38ce('0x2d')]),[_0x38ce('0x2e'),_0x38ce('0x2f'),_0x38ce('0x30'),_0x38ce('0x31')]);var _0x3966d2=![];if(_0x277e94[_0x38ce('0x2a')]['id']){delete _0x277e94['body']['id'];}if(_[_0x38ce('0x32')](_0x277e94[_0x38ce('0x2a')]['from'])){return _0x14fb63(_0x1476e9[_0x38ce('0x18')](0x1f4,_0x38ce('0x33')));}if(_[_0x38ce('0x32')](_0x277e94['body'][_0x38ce('0x2a')])||_0x277e94[_0x38ce('0x2a')][_0x38ce('0x2a')]===''){return _0x14fb63(_0x1476e9[_0x38ce('0x18')](0x1f4,_0x38ce('0x34')));}if(_[_0x38ce('0x32')](_0x277e94['body'][_0x38ce('0x35')])){return _0x14fb63(_0x1476e9[_0x38ce('0x18')](0x1f4,_0x38ce('0x36')+_0xd4bfe9));}if(!_[_0x38ce('0x37')](_0xd4bfe9,_0x277e94[_0x38ce('0x2a')][_0x38ce('0x35')])){return _0x14fb63(_0x1476e9['error'](0x1f4,_0x38ce('0x38')+_0xd4bfe9));}var _0x1847e5={};_0x1847e5[_0x277e94['body']['mapKey']]=_0x277e94['body'][_0x38ce('0x39')];return db[_0x38ce('0x1c')]['find']({'where':{'id':_0x277e94['account']['id']},'include':[{'model':db[_0x38ce('0x3a')],'as':'List','include':[{'model':db[_0x38ce('0x3b')],'as':'Contacts','where':_0x1847e5,'limit':0x1,'order':[[_0x38ce('0x2f'),_0x38ce('0x3c')]]}]},{'model':db['MailApplication'],'as':_0x38ce('0x3d')},{'model':db[_0x38ce('0x3e')],'as':'Smtp'}]})[_0x38ce('0x11')](function(_0x3bbd00){if(_0x3bbd00&&_0x3bbd00[_0x38ce('0x3f')]){var _0x5ce80e=_0x3bbd00[_0x38ce('0x40')]({'plain':!![]});_0x1e0574[_0x38ce('0x41')]=_['omit'](_0x5ce80e,[_0x38ce('0x3d'),_0x38ce('0x3f')]);_0x1e0574['applications']=_0x5ce80e[_0x38ce('0x3d')];_0x1e0574[_0x38ce('0x42')]=_0x5ce80e[_0x38ce('0x3f')];_0x1e0574[_0x38ce('0x43')]=_[_0x38ce('0x44')](_0x1e0574[_0x38ce('0x43')],[_0x38ce('0x45')],['asc']);if(_0x1e0574[_0x38ce('0x41')]&&_0x1e0574[_0x38ce('0x41')][_0x38ce('0x46')]){_0x1e0574[_0x38ce('0x43')][_0x38ce('0x47')]({'id':0x0,'priority':_0x1e0574[_0x38ce('0x43')]['length']+0x1,'app':'close','appdata':_0x38ce('0x46'),'interval':_0x38ce('0x48')});}if(_0x1e0574[_0x38ce('0x41')][_0x38ce('0x3d')]){delete _0x1e0574[_0x38ce('0x41')][_0x38ce('0x3d')];}if(_0x1e0574['account']['List']){delete _0x1e0574[_0x38ce('0x41')]['List'];}if(_0x5ce80e['List'][_0x38ce('0x49')][_0x38ce('0x4a')]){return _0x5ce80e[_0x38ce('0x3f')][_0x38ce('0x49')][0x0];}var _0xd031c0=_['defaults'](_0x277e94[_0x38ce('0x2a')],{'firstName':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x39')],'ListId':_0x5ce80e[_0x38ce('0x31')]});_0xd031c0[_0x277e94[_0x38ce('0x2a')][_0x38ce('0x35')]]=_0x277e94[_0x38ce('0x2a')][_0x38ce('0x39')];return db[_0x38ce('0x3b')][_0x38ce('0x4b')](_0xd031c0);}else{throw new Error(_0x38ce('0x4c'));}})['then'](function(_0x5d1df1){_0x1e0574[_0x38ce('0x4d')]=_0x5d1df1;if(_0x5d1df1){if(!_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')][_0x38ce('0x4e')]){_0x277e94['body'][_0x38ce('0x19')][_0x38ce('0x4e')]=rs[_0x38ce('0x4f')]()+'\x20'+_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')][_0x38ce('0x39')];}var _0x1534ca={'ContactId':_0x5d1df1['id'],'MailAccountId':_0x277e94['account']['id'],'inReplyTo':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')]['messageId'],'to':_0x277e94['body'][_0x38ce('0x19')][_0x38ce('0x39')],'cc':_0x277e94[_0x38ce('0x2a')]['message']['cc'],'subject':_0x277e94['body'][_0x38ce('0x19')]['subject'],'attach':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')][_0x38ce('0x50')],'lastMsgAt':moment()[_0x38ce('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x2a')]};return db[_0x38ce('0x52')]['find']({'where':{'closed':![],'MailAccountId':_0x277e94[_0x38ce('0x41')]['id']},'include':[{'model':db[_0x38ce('0x53')],'as':_0x38ce('0x54'),'attributes':['messageId'],'where':{'messageId':_0x277e94[_0x38ce('0x2a')]['message'][_0x38ce('0x55')]}}]})['then'](function(_0x146999){if(_0x146999){return[_0x146999,![]];}return db[_0x38ce('0x52')][_0x38ce('0x4b')](_0x1534ca)[_0x38ce('0x11')](function(_0x587e62){return[_0x587e62,!![]];});});}else{throw new Error(_0x38ce('0x56'));}})[_0x38ce('0x57')](function(_0x425002,_0x2ff08b){if(_0x425002){_0x3966d2=_0x2ff08b;if(!_0x2ff08b){return _0x425002[_0x38ce('0x58')]({'inReplyTo':_0x277e94[_0x38ce('0x2a')]['message'][_0x38ce('0x4e')],'to':_0x277e94['body'][_0x38ce('0x19')][_0x38ce('0x39')],'cc':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')]['cc'],'subject':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')][_0x38ce('0x59')],'attach':_0x425002[_0x38ce('0x50')]?_0x425002['attach']:_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')][_0x38ce('0x50')],'substatus':null,'substatusAt':moment()[_0x38ce('0x51')](_0x38ce('0x5a')),'lastMsgAt':moment()[_0x38ce('0x51')](_0x38ce('0x5a')),'lastMsgDirection':'in','lastMsgBody':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x2a')]});}else{return _0x425002;}}})[_0x38ce('0x11')](function(_0x79b918){_0x1e0574[_0x38ce('0x5b')]=_0x79b918[_0x38ce('0x40')]({'plain':!![]});_0x1e0574[_0x38ce('0x5b')][_0x38ce('0x5c')]=_0x3966d2;return db[_0x38ce('0x53')][_0x38ce('0x4b')]({'body':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x2a')],'MailAccountId':_0x277e94[_0x38ce('0x41')]['id'],'MailInteractionId':_0x79b918['id'],'direction':'in','ContactId':_0x1e0574['contact']['id'],'messageId':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')][_0x38ce('0x4e')],'from':_0x277e94['body']['message'][_0x38ce('0x39')],'to':_0x277e94[_0x38ce('0x2a')]['message']['to'],'cc':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')]['cc'],'subject':_0x277e94['body']['message'][_0x38ce('0x59')],'attach':_0x277e94[_0x38ce('0x2a')]['message'][_0x38ce('0x50')],'Attachments':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')][_0x38ce('0x5d')],'originTo':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')][_0x38ce('0x5e')],'originCc':_0x277e94[_0x38ce('0x2a')]['message'][_0x38ce('0x5f')],'bcc':_0x277e94[_0x38ce('0x2a')][_0x38ce('0x19')][_0x38ce('0x60')]},{'include':[{'model':db[_0x38ce('0x61')],'as':_0x38ce('0x62')}]});})[_0x38ce('0x11')](function(_0x595d81){_0x1e0574['message']=_0x595d81;if(_0x1e0574['interaction'][_0x38ce('0x63')]){return db[_0x38ce('0x64')][_0x38ce('0x27')]({'attributes':['id',_0x38ce('0x65')],'where':{'id':_0x1e0574[_0x38ce('0x5b')][_0x38ce('0x63')]}})[_0x38ce('0x11')](function(_0x4b2dfb){if(_0x4b2dfb){_0x1e0574[_0x38ce('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4b2dfb['name']+','+(_0x1e0574[_0x38ce('0x41')][_0x38ce('0x66')]||0xa),'interval':_0x38ce('0x48')});}return respondWithRpcPromise('Start',_0x38ce('0x67'),_0x1e0574);});}return respondWithRpcPromise(_0x38ce('0x68'),_0x38ce('0x67'),_0x1e0574);})[_0x38ce('0x11')](function(_0x32a8e3){_0x5209ee(_0x32a8e3);})['catch'](function(_0x19b414){_0x14fb63(_0x1476e9['error'](0x1f4,_0x19b414[_0x38ce('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 7d7470c..99786de 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 _0x0b3d=['removeListener','register','length','mailAccount:','./mailAccount.events','remove'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x0b3d,0x76));var _0xd0b3=function(_0x1ed354,_0x4bb5be){_0x1ed354=_0x1ed354-0x0;var _0x532757=_0x0b3d[_0x1ed354];return _0x532757;};'use strict';var MailAccountEvents=require(_0xd0b3('0x0'));var events=['save',_0xd0b3('0x1'),'update'];function createListener(_0x44585b,_0x5cd26e){return function(_0x2e82a6){_0x5cd26e['emit'](_0x44585b,_0x2e82a6);};}function removeListener(_0x372f08,_0x50faaa){return function(){MailAccountEvents[_0xd0b3('0x2')](_0x372f08,_0x50faaa);};}exports[_0xd0b3('0x3')]=function(_0x5b80df){for(var _0x2968c9=0x0,_0x5bc883=events[_0xd0b3('0x4')];_0x2968c9<_0x5bc883;_0x2968c9++){var _0x5f3196=events[_0x2968c9];var _0x5ab5b2=createListener(_0xd0b3('0x5')+_0x5f3196,_0x5b80df);MailAccountEvents['on'](_0x5f3196,_0x5ab5b2);}}; \ No newline at end of file +var _0xff3c=['save','update','emit','removeListener','register','length','./mailAccount.events'];(function(_0x402d90,_0x6513b3){var _0x1b57fb=function(_0xe724d7){while(--_0xe724d7){_0x402d90['push'](_0x402d90['shift']());}};_0x1b57fb(++_0x6513b3);}(_0xff3c,0x179));var _0xcff3=function(_0x3faf76,_0x2c6c9b){_0x3faf76=_0x3faf76-0x0;var _0x7fc3aa=_0xff3c[_0x3faf76];return _0x7fc3aa;};'use strict';var MailAccountEvents=require(_0xcff3('0x0'));var events=[_0xcff3('0x1'),'remove',_0xcff3('0x2')];function createListener(_0x832575,_0x5344ec){return function(_0x51358d){_0x5344ec[_0xcff3('0x3')](_0x832575,_0x51358d);};}function removeListener(_0x17ae92,_0x45c7f6){return function(){MailAccountEvents[_0xcff3('0x4')](_0x17ae92,_0x45c7f6);};}exports[_0xcff3('0x5')]=function(_0x308a82){for(var _0x47b899=0x0,_0x48620d=events[_0xcff3('0x6')];_0x47b899<_0x48620d;_0x47b899++){var _0x5f1b99=events[_0x47b899];var _0x6a338e=createListener('mailAccount:'+_0x5f1b99,_0x308a82);MailAccountEvents['on'](_0x5f1b99,_0x6a338e);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 4bcf122..53078ad 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 _0x5ff3=['show','put','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x295138,_0x142ee4){var _0xee2a9f=function(_0x151e80){while(--_0x151e80){_0x295138['push'](_0x295138['shift']());}};_0xee2a9f(++_0x142ee4);}(_0x5ff3,0x17d));var _0x35ff=function(_0x438e2e,_0x4baaab){_0x438e2e=_0x438e2e-0x0;var _0x5614d2=_0x5ff3[_0x438e2e];return _0x5614d2;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var auth=require(_0x35ff('0x3'));var interaction=require(_0x35ff('0x4'));var config=require(_0x35ff('0x5'));var controller=require('./mailApplication.controller');router[_0x35ff('0x6')](_0x35ff('0x7'),auth[_0x35ff('0x8')](),controller[_0x35ff('0x9')]);router[_0x35ff('0xa')]('/:id',auth[_0x35ff('0x8')](),controller['update']);router[_0x35ff('0xb')](_0x35ff('0x7'),auth[_0x35ff('0x8')](),controller['destroy']);module[_0x35ff('0xc')]=router; \ No newline at end of file +var _0x5ff3=['show','put','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0xdc168b,_0xac517f){var _0x77e1e5=function(_0xea022b){while(--_0xea022b){_0xdc168b['push'](_0xdc168b['shift']());}};_0x77e1e5(++_0xac517f);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3dbe57,_0x429eed){_0x3dbe57=_0x3dbe57-0x0;var _0x45a7e4=_0x5ff3[_0x3dbe57];return _0x45a7e4;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var auth=require(_0x35ff('0x3'));var interaction=require(_0x35ff('0x4'));var config=require(_0x35ff('0x5'));var controller=require('./mailApplication.controller');router[_0x35ff('0x6')](_0x35ff('0x7'),auth[_0x35ff('0x8')](),controller[_0x35ff('0x9')]);router[_0x35ff('0xa')]('/:id',auth[_0x35ff('0x8')](),controller['update']);router[_0x35ff('0xb')](_0x35ff('0x7'),auth[_0x35ff('0x8')](),controller['destroy']);module[_0x35ff('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index d58a4f9..4297158 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 _0xc7a7=['exports','INTEGER','noop','TEXT','STRING'];(function(_0x452eff,_0x39ff1f){var _0x12e306=function(_0x366f01){while(--_0x366f01){_0x452eff['push'](_0x452eff['shift']());}};_0x12e306(++_0x39ff1f);}(_0xc7a7,0x1ea));var _0x7c7a=function(_0x530195,_0x52da52){_0x530195=_0x530195-0x0;var _0x15d922=_0xc7a7[_0x530195];return _0x15d922;};'use strict';var Sequelize=require('sequelize');module[_0x7c7a('0x0')]={'priority':{'type':Sequelize[_0x7c7a('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7c7a('0x2')},'appdata':{'type':Sequelize[_0x7c7a('0x3')]()},'description':{'type':Sequelize[_0x7c7a('0x4')]},'interval':{'type':Sequelize[_0x7c7a('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xb445=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x1cc775,_0xebd379){var _0x2a02ba=function(_0x420af9){while(--_0x420af9){_0x1cc775['push'](_0x1cc775['shift']());}};_0x2a02ba(++_0xebd379);}(_0xb445,0x89));var _0x5b44=function(_0x5cad29,_0x412fb6){_0x5cad29=_0x5cad29-0x0;var _0x45b1c1=_0xb445[_0x5cad29];return _0x45b1c1;};'use strict';var Sequelize=require(_0x5b44('0x0'));module[_0x5b44('0x1')]={'priority':{'type':Sequelize[_0x5b44('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5b44('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5b44('0x4')]()},'description':{'type':Sequelize[_0x5b44('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5b44('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index e452315..29525a1 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 _0xe784=['error','stack','name','params','model','keys','MailApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x712393,_0x5ba83a){var _0xc2c9b9=function(_0x20ed98){while(--_0x20ed98){_0x712393['push'](_0x712393['shift']());}};_0xc2c9b9(++_0x5ba83a);}(_0xe784,0x1b9));var _0x4e78=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xe784[_0x4ae6ef];return _0x3cbb4e;};'use strict';var pdf=require(_0x4e78('0x0'));var emlformat=require(_0x4e78('0x1'));var rimraf=require(_0x4e78('0x2'));var zipdir=require(_0x4e78('0x3'));var jsonpatch=require(_0x4e78('0x4'));var rp=require('request-promise');var moment=require(_0x4e78('0x5'));var BPromise=require(_0x4e78('0x6'));var Mustache=require(_0x4e78('0x7'));var util=require(_0x4e78('0x8'));var path=require(_0x4e78('0x9'));var sox=require(_0x4e78('0xa'));var csv=require('to-csv');var ejs=require(_0x4e78('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4e78('0xc'));var crypto=require(_0x4e78('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4e78('0xe'));var querystring=require(_0x4e78('0xf'));var Papa=require(_0x4e78('0x10'));var Redis=require(_0x4e78('0x11'));var authService=require(_0x4e78('0x12'));var qs=require(_0x4e78('0x13'));var as=require(_0x4e78('0x14'));var hardwareService=require(_0x4e78('0x15'));var logger=require(_0x4e78('0x16'))(_0x4e78('0x17'));var utils=require('../../config/utils');var config=require(_0x4e78('0x18'));var db=require(_0x4e78('0x19'))['db'];function respondWithStatusCode(_0x57f83e,_0x125803){_0x125803=_0x125803||0xcc;return function(_0x19e070){if(_0x19e070){return _0x57f83e[_0x4e78('0x1a')](_0x125803);}return _0x57f83e[_0x4e78('0x1b')](_0x125803)[_0x4e78('0x1c')]();};}function respondWithResult(_0x2f963b,_0x15555){_0x15555=_0x15555||0xc8;return function(_0x40dd52){if(_0x40dd52){return _0x2f963b[_0x4e78('0x1b')](_0x15555)[_0x4e78('0x1d')](_0x40dd52);}};}function respondWithFilteredResult(_0x27f1cd,_0x12e95b){return function(_0x275177){if(_0x275177){var _0x556650=_0x275177['count'],_0x3d15c6=_0x12e95b[_0x4e78('0x1e')],_0x86529=_0x12e95b[_0x4e78('0x1e')]+_0x12e95b[_0x4e78('0x1f')],_0x45f5c0;if(_0x86529>=_0x556650){_0x86529=_0x556650;_0x45f5c0=0xc8;}else{_0x45f5c0=0xce;}_0x27f1cd[_0x4e78('0x1b')](_0x45f5c0);return _0x27f1cd[_0x4e78('0x20')](_0x4e78('0x21'),_0x3d15c6+'-'+_0x86529+'/'+_0x556650)[_0x4e78('0x1d')](_0x275177);}return null;};}function patchUpdates(_0x53b6d1){return function(_0x248a62){try{jsonpatch[_0x4e78('0x22')](_0x248a62,_0x53b6d1,!![]);}catch(_0x33d073){return BPromise[_0x4e78('0x23')](_0x33d073);}return _0x248a62['save']();};}function saveUpdates(_0x46048e,_0x551d1a){return function(_0x127ec5){if(_0x127ec5){return _0x127ec5[_0x4e78('0x24')](_0x46048e)[_0x4e78('0x25')](function(_0x35641e){return _0x35641e;});}return null;};}function removeEntity(_0xe331a5,_0x387040){return function(_0x3b9e2e){if(_0x3b9e2e){return _0x3b9e2e[_0x4e78('0x26')]()[_0x4e78('0x25')](function(){_0xe331a5['status'](0xcc)[_0x4e78('0x1c')]();});}};}function handleEntityNotFound(_0xbec7e7,_0x5ba03a){return function(_0x26c91d){if(!_0x26c91d){_0xbec7e7[_0x4e78('0x1a')](0x194);}return _0x26c91d;};}function handleError(_0x2e8891,_0x109664){_0x109664=_0x109664||0x1f4;return function(_0x1ed575){logger[_0x4e78('0x27')](_0x1ed575[_0x4e78('0x28')]);if(_0x1ed575[_0x4e78('0x29')]){delete _0x1ed575['name'];}_0x2e8891['status'](_0x109664)['send'](_0x1ed575);};}exports['show']=function(_0x4d8b4f,_0x4325bc){var _0x4914d8={'raw':!![],'where':{'id':_0x4d8b4f[_0x4e78('0x2a')]['id']}},_0x408630={};_0x408630[_0x4e78('0x2b')]=_[_0x4e78('0x2c')](db[_0x4e78('0x2d')][_0x4e78('0x2e')]);_0x408630[_0x4e78('0x2f')]=_[_0x4e78('0x2c')](_0x4d8b4f[_0x4e78('0x2f')]);_0x408630[_0x4e78('0x30')]=_[_0x4e78('0x31')](_0x408630[_0x4e78('0x2b')],_0x408630['query']);_0x4914d8['attributes']=_['intersection'](_0x408630[_0x4e78('0x2b')],qs[_0x4e78('0x32')](_0x4d8b4f['query']['fields']));_0x4914d8['attributes']=_0x4914d8[_0x4e78('0x33')][_0x4e78('0x34')]?_0x4914d8[_0x4e78('0x33')]:_0x408630['model'];if(_0x4d8b4f[_0x4e78('0x2f')][_0x4e78('0x35')]){_0x4914d8[_0x4e78('0x36')]=[{'all':!![]}];}_0x4914d8=_[_0x4e78('0x37')]({},_0x4914d8,_0x4d8b4f[_0x4e78('0x38')]);return db[_0x4e78('0x2d')][_0x4e78('0x39')](_0x4914d8)[_0x4e78('0x25')](handleEntityNotFound(_0x4325bc,null))[_0x4e78('0x25')](respondWithResult(_0x4325bc,null))[_0x4e78('0x3a')](handleError(_0x4325bc,null));};exports[_0x4e78('0x24')]=function(_0x40aebc,_0xa5f1bf){if(_0x40aebc[_0x4e78('0x3b')]['id']){delete _0x40aebc['body']['id'];}return db[_0x4e78('0x2d')][_0x4e78('0x39')]({'where':{'id':_0x40aebc[_0x4e78('0x2a')]['id']}})[_0x4e78('0x25')](handleEntityNotFound(_0xa5f1bf,null))['then'](saveUpdates(_0x40aebc['body'],null))[_0x4e78('0x25')](respondWithResult(_0xa5f1bf,null))[_0x4e78('0x3a')](handleError(_0xa5f1bf,null));};exports['destroy']=function(_0x3971e7,_0x39194b){return db[_0x4e78('0x2d')][_0x4e78('0x39')]({'where':{'id':_0x3971e7[_0x4e78('0x2a')]['id']}})['then'](handleEntityNotFound(_0x39194b,null))[_0x4e78('0x25')](removeEntity(_0x39194b,null))[_0x4e78('0x3a')](handleError(_0x39194b,null));}; \ No newline at end of file +var _0x52b4=['rawAttributes','query','keys','intersection','fields','attributes','length','include','merge','options','find','catch','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','end','status','json','offset','limit','set','reject','then','destroy','error','stack','name','send','params','model','MailApplication'];(function(_0x12b5bd,_0x30abb1){var _0x26d24e=function(_0x4dca14){while(--_0x4dca14){_0x12b5bd['push'](_0x12b5bd['shift']());}};_0x26d24e(++_0x30abb1);}(_0x52b4,0xdd));var _0x452b=function(_0x2bc24f,_0x1ebbc6){_0x2bc24f=_0x2bc24f-0x0;var _0x4c2524=_0x52b4[_0x2bc24f];return _0x4c2524;};'use strict';var pdf=require(_0x452b('0x0'));var emlformat=require(_0x452b('0x1'));var rimraf=require(_0x452b('0x2'));var zipdir=require(_0x452b('0x3'));var jsonpatch=require(_0x452b('0x4'));var rp=require(_0x452b('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x452b('0x6'));var util=require(_0x452b('0x7'));var path=require(_0x452b('0x8'));var sox=require(_0x452b('0x9'));var csv=require(_0x452b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x452b('0xb'));var squel=require('squel');var crypto=require(_0x452b('0xc'));var jsforce=require(_0x452b('0xd'));var deskjs=require(_0x452b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x452b('0xf'));var Papa=require(_0x452b('0x10'));var Redis=require(_0x452b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x452b('0x12'));var as=require(_0x452b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x452b('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x452b('0x15'))['db'];function respondWithStatusCode(_0x5afe26,_0x17f95a){_0x17f95a=_0x17f95a||0xcc;return function(_0x110020){if(_0x110020){return _0x5afe26[_0x452b('0x16')](_0x17f95a);}return _0x5afe26['status'](_0x17f95a)[_0x452b('0x17')]();};}function respondWithResult(_0x26f3a0,_0x3ce75a){_0x3ce75a=_0x3ce75a||0xc8;return function(_0x372fe2){if(_0x372fe2){return _0x26f3a0[_0x452b('0x18')](_0x3ce75a)[_0x452b('0x19')](_0x372fe2);}};}function respondWithFilteredResult(_0x494106,_0x2e149c){return function(_0x533a77){if(_0x533a77){var _0x1fedb7=_0x533a77['count'],_0x58b63a=_0x2e149c[_0x452b('0x1a')],_0x5e25d6=_0x2e149c[_0x452b('0x1a')]+_0x2e149c[_0x452b('0x1b')],_0x114c1a;if(_0x5e25d6>=_0x1fedb7){_0x5e25d6=_0x1fedb7;_0x114c1a=0xc8;}else{_0x114c1a=0xce;}_0x494106['status'](_0x114c1a);return _0x494106[_0x452b('0x1c')]('Content-Range',_0x58b63a+'-'+_0x5e25d6+'/'+_0x1fedb7)[_0x452b('0x19')](_0x533a77);}return null;};}function patchUpdates(_0x3ecc42){return function(_0x4ae955){try{jsonpatch['apply'](_0x4ae955,_0x3ecc42,!![]);}catch(_0x1ad639){return BPromise[_0x452b('0x1d')](_0x1ad639);}return _0x4ae955['save']();};}function saveUpdates(_0xa7198f,_0x107b2f){return function(_0x8fc5c9){if(_0x8fc5c9){return _0x8fc5c9['update'](_0xa7198f)[_0x452b('0x1e')](function(_0x4dd9bf){return _0x4dd9bf;});}return null;};}function removeEntity(_0x27ab5e,_0x3dbfdc){return function(_0xa90fa6){if(_0xa90fa6){return _0xa90fa6[_0x452b('0x1f')]()[_0x452b('0x1e')](function(){_0x27ab5e[_0x452b('0x18')](0xcc)[_0x452b('0x17')]();});}};}function handleEntityNotFound(_0x4ff120,_0x246248){return function(_0x384909){if(!_0x384909){_0x4ff120[_0x452b('0x16')](0x194);}return _0x384909;};}function handleError(_0x4cd031,_0x36012a){_0x36012a=_0x36012a||0x1f4;return function(_0x25a3db){logger[_0x452b('0x20')](_0x25a3db[_0x452b('0x21')]);if(_0x25a3db[_0x452b('0x22')]){delete _0x25a3db[_0x452b('0x22')];}_0x4cd031[_0x452b('0x18')](_0x36012a)[_0x452b('0x23')](_0x25a3db);};}exports['show']=function(_0x5743ac,_0x3c70b1){var _0x4804fb={'raw':!![],'where':{'id':_0x5743ac[_0x452b('0x24')]['id']}},_0x4fdc1c={};_0x4fdc1c[_0x452b('0x25')]=_['keys'](db[_0x452b('0x26')][_0x452b('0x27')]);_0x4fdc1c[_0x452b('0x28')]=_[_0x452b('0x29')](_0x5743ac[_0x452b('0x28')]);_0x4fdc1c['filters']=_['intersection'](_0x4fdc1c[_0x452b('0x25')],_0x4fdc1c[_0x452b('0x28')]);_0x4804fb['attributes']=_[_0x452b('0x2a')](_0x4fdc1c[_0x452b('0x25')],qs[_0x452b('0x2b')](_0x5743ac[_0x452b('0x28')][_0x452b('0x2b')]));_0x4804fb[_0x452b('0x2c')]=_0x4804fb['attributes'][_0x452b('0x2d')]?_0x4804fb[_0x452b('0x2c')]:_0x4fdc1c[_0x452b('0x25')];if(_0x5743ac[_0x452b('0x28')]['includeAll']){_0x4804fb[_0x452b('0x2e')]=[{'all':!![]}];}_0x4804fb=_[_0x452b('0x2f')]({},_0x4804fb,_0x5743ac[_0x452b('0x30')]);return db[_0x452b('0x26')][_0x452b('0x31')](_0x4804fb)[_0x452b('0x1e')](handleEntityNotFound(_0x3c70b1,null))[_0x452b('0x1e')](respondWithResult(_0x3c70b1,null))[_0x452b('0x32')](handleError(_0x3c70b1,null));};exports['update']=function(_0x144ff0,_0x578b4f){if(_0x144ff0[_0x452b('0x33')]['id']){delete _0x144ff0[_0x452b('0x33')]['id'];}return db['MailApplication'][_0x452b('0x31')]({'where':{'id':_0x144ff0[_0x452b('0x24')]['id']}})[_0x452b('0x1e')](handleEntityNotFound(_0x578b4f,null))['then'](saveUpdates(_0x144ff0['body'],null))[_0x452b('0x1e')](respondWithResult(_0x578b4f,null))[_0x452b('0x32')](handleError(_0x578b4f,null));};exports['destroy']=function(_0x352a0d,_0x419c47){return db[_0x452b('0x26')][_0x452b('0x31')]({'where':{'id':_0x352a0d[_0x452b('0x24')]['id']}})[_0x452b('0x1e')](handleEntityNotFound(_0x419c47,null))['then'](removeEntity(_0x419c47,null))[_0x452b('0x32')](handleError(_0x419c47,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index f3e7c38..348a602 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 _0xe5af=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','exports','MailApplication','mail_applications'];(function(_0x4e4595,_0x42c14c){var _0x38abb0=function(_0x36ba1a){while(--_0x36ba1a){_0x4e4595['push'](_0x4e4595['shift']());}};_0x38abb0(++_0x42c14c);}(_0xe5af,0x9c));var _0xfe5a=function(_0xcd001b,_0x350354){_0xcd001b=_0xcd001b-0x0;var _0x37e09f=_0xe5af[_0xcd001b];return _0x37e09f;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var logger=require(_0xfe5a('0x1'))('api');var moment=require(_0xfe5a('0x2'));var BPromise=require(_0xfe5a('0x3'));var rp=require(_0xfe5a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe5a('0x5'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xfe5a('0x6')]=function(_0x2039cd,_0x4e418f){return _0x2039cd['define'](_0xfe5a('0x7'),attributes,{'tableName':_0xfe5a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfe5a('0x9'),'collate':_0xfe5a('0xa')});}; \ No newline at end of file +var _0xdd6e=['api','bluebird','request-promise','path','rimraf','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x261038,_0x2fab28){var _0x2fd230=function(_0x429660){while(--_0x429660){_0x261038['push'](_0x261038['shift']());}};_0x2fd230(++_0x2fab28);}(_0xdd6e,0xa5));var _0xedd6=function(_0x1926b5,_0x36234a){_0x1926b5=_0x1926b5-0x0;var _0x269e0f=_0xdd6e[_0x1926b5];return _0x269e0f;};'use strict';var _=require(_0xedd6('0x0'));var util=require(_0xedd6('0x1'));var logger=require(_0xedd6('0x2'))(_0xedd6('0x3'));var moment=require('moment');var BPromise=require(_0xedd6('0x4'));var rp=require(_0xedd6('0x5'));var fs=require('fs');var path=require(_0xedd6('0x6'));var rimraf=require(_0xedd6('0x7'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module['exports']=function(_0x3430b2,_0x27b159){return _0x3430b2['define'](_0xedd6('0x8'),attributes,{'tableName':_0xedd6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xedd6('0xa'),'collate':_0xedd6('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 007a44d..6c4d33f 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 _0xea99=['then','info','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','body','options','raw','attributes','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x256d84,_0x10affb){var _0x17b1fc=function(_0x307638){while(--_0x307638){_0x256d84['push'](_0x256d84['shift']());}};_0x17b1fc(++_0x10affb);}(_0xea99,0x80));var _0x9ea9=function(_0x4af81d,_0x238652){_0x4af81d=_0x4af81d-0x0;var _0x16bf50=_0xea99[_0x4af81d];return _0x16bf50;};'use strict';var _=require('lodash');var util=require(_0x9ea9('0x0'));var moment=require(_0x9ea9('0x1'));var BPromise=require(_0x9ea9('0x2'));var rs=require(_0x9ea9('0x3'));var fs=require('fs');var Redis=require(_0x9ea9('0x4'));var db=require(_0x9ea9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ea9('0x6'))(_0x9ea9('0x7'));var config=require(_0x9ea9('0x8'));var jayson=require(_0x9ea9('0x9'));var client=jayson[_0x9ea9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf3e6dd,_0x23ad33,_0x4c5e72){return new BPromise(function(_0x1aa680,_0x51d706){return client[_0x9ea9('0xb')](_0xf3e6dd,_0x4c5e72)[_0x9ea9('0xc')](function(_0x5c801d){logger[_0x9ea9('0xd')](_0x9ea9('0xe'),_0x23ad33,'request\x20sent');logger['debug'](_0x9ea9('0xf'),_0x23ad33,'request\x20sent',JSON[_0x9ea9('0x10')](_0x5c801d));if(_0x5c801d[_0x9ea9('0x11')]){if(_0x5c801d['error'][_0x9ea9('0x12')]===0x1f4){logger[_0x9ea9('0x11')](_0x9ea9('0xe'),_0x23ad33,_0x5c801d[_0x9ea9('0x11')][_0x9ea9('0x13')]);return _0x51d706(_0x5c801d['error']['message']);}logger[_0x9ea9('0x11')]('MailApplication,\x20%s,\x20%s',_0x23ad33,_0x5c801d['error'][_0x9ea9('0x13')]);return _0x1aa680(_0x5c801d[_0x9ea9('0x11')]['message']);}else{logger[_0x9ea9('0xd')](_0x9ea9('0xe'),_0x23ad33,'request\x20sent');_0x1aa680(_0x5c801d[_0x9ea9('0x14')][_0x9ea9('0x13')]);}})[_0x9ea9('0x15')](function(_0x260e04){logger[_0x9ea9('0x11')]('MailApplication,\x20%s,\x20%s',_0x23ad33,_0x260e04);_0x51d706(_0x260e04);});});}exports[_0x9ea9('0x16')]=function(_0x50fc7a){var _0x1dd683=this;return new Promise(function(_0x4edd09,_0x4d3bc5){return db['MailApplication']['update'](_0x50fc7a[_0x9ea9('0x17')],{'raw':_0x50fc7a['options']?_0x50fc7a[_0x9ea9('0x18')][_0x9ea9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50fc7a[_0x9ea9('0x18')]?_0x50fc7a[_0x9ea9('0x18')]['where']||null:null,'attributes':_0x50fc7a[_0x9ea9('0x18')]?_0x50fc7a[_0x9ea9('0x18')][_0x9ea9('0x1a')]||null:null,'limit':_0x50fc7a['options']?_0x50fc7a[_0x9ea9('0x18')]['limit']||null:null})[_0x9ea9('0xc')](function(_0x5c443c){logger['info'](_0x9ea9('0x16'),_0x50fc7a);logger[_0x9ea9('0x1b')](_0x9ea9('0x16'),_0x50fc7a,JSON[_0x9ea9('0x10')](_0x5c443c));_0x4edd09(_0x5c443c);})['catch'](function(_0x3449b3){logger['error'](_0x9ea9('0x16'),_0x3449b3[_0x9ea9('0x13')],_0x50fc7a);_0x4d3bc5(_0x1dd683[_0x9ea9('0x11')](0x1f4,_0x3449b3[_0x9ea9('0x13')]));});});}; \ No newline at end of file +var _0xb983=['message','result','catch','body','options','raw','where','attributes','limit','info','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x436e9e,_0x1f5601){var _0x36ecd8=function(_0x2ce181){while(--_0x2ce181){_0x436e9e['push'](_0x436e9e['shift']());}};_0x36ecd8(++_0x1f5601);}(_0xb983,0x19e));var _0x3b98=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0xb983[_0x1df7b8];return _0x29d911;};'use strict';var _=require(_0x3b98('0x0'));var util=require(_0x3b98('0x1'));var moment=require(_0x3b98('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b98('0x3'));var fs=require('fs');var Redis=require(_0x3b98('0x4'));var db=require(_0x3b98('0x5'))['db'];var utils=require(_0x3b98('0x6'));var logger=require(_0x3b98('0x7'))('rpc');var config=require(_0x3b98('0x8'));var jayson=require(_0x3b98('0x9'));var client=jayson['client'][_0x3b98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f883d,_0x1d5fff,_0x260f56){return new BPromise(function(_0x56659f,_0xfba8f2){return client[_0x3b98('0xb')](_0x1f883d,_0x260f56)[_0x3b98('0xc')](function(_0x5e91ec){logger['info'](_0x3b98('0xd'),_0x1d5fff,_0x3b98('0xe'));logger[_0x3b98('0xf')](_0x3b98('0x10'),_0x1d5fff,_0x3b98('0xe'),JSON[_0x3b98('0x11')](_0x5e91ec));if(_0x5e91ec[_0x3b98('0x12')]){if(_0x5e91ec[_0x3b98('0x12')][_0x3b98('0x13')]===0x1f4){logger[_0x3b98('0x12')]('MailApplication,\x20%s,\x20%s',_0x1d5fff,_0x5e91ec[_0x3b98('0x12')]['message']);return _0xfba8f2(_0x5e91ec[_0x3b98('0x12')][_0x3b98('0x14')]);}logger[_0x3b98('0x12')](_0x3b98('0xd'),_0x1d5fff,_0x5e91ec[_0x3b98('0x12')][_0x3b98('0x14')]);return _0x56659f(_0x5e91ec[_0x3b98('0x12')]['message']);}else{logger['info'](_0x3b98('0xd'),_0x1d5fff,'request\x20sent');_0x56659f(_0x5e91ec[_0x3b98('0x15')][_0x3b98('0x14')]);}})[_0x3b98('0x16')](function(_0x118900){logger[_0x3b98('0x12')]('MailApplication,\x20%s,\x20%s',_0x1d5fff,_0x118900);_0xfba8f2(_0x118900);});});}exports['UpdateMailApplication']=function(_0x3c4545){var _0x5bbf98=this;return new Promise(function(_0x5319c0,_0x3f5d8d){return db['MailApplication']['update'](_0x3c4545[_0x3b98('0x17')],{'raw':_0x3c4545[_0x3b98('0x18')]?_0x3c4545['options'][_0x3b98('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c4545[_0x3b98('0x18')]?_0x3c4545[_0x3b98('0x18')][_0x3b98('0x1a')]||null:null,'attributes':_0x3c4545[_0x3b98('0x18')]?_0x3c4545['options'][_0x3b98('0x1b')]||null:null,'limit':_0x3c4545[_0x3b98('0x18')]?_0x3c4545[_0x3b98('0x18')][_0x3b98('0x1c')]||null:null})['then'](function(_0xf51984){logger[_0x3b98('0x1d')](_0x3b98('0x1e'),_0x3c4545);logger['debug'](_0x3b98('0x1e'),_0x3c4545,JSON[_0x3b98('0x11')](_0xf51984));_0x5319c0(_0xf51984);})[_0x3b98('0x16')](function(_0x45a4ae){logger[_0x3b98('0x12')]('UpdateMailApplication',_0x45a4ae['message'],_0x3c4545);_0x3f5d8d(_0x5bbf98[_0x3b98('0x12')](0x1f4,_0x45a4ae[_0x3b98('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index c4b8544..cfa7f3c 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 _0xaf1b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','show','getMessages','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','/:id','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router'];(function(_0x8c472e,_0x4483bb){var _0x1b418f=function(_0x4725dd){while(--_0x4725dd){_0x8c472e['push'](_0x8c472e['shift']());}};_0x1b418f(++_0x4483bb);}(_0xaf1b,0x11a));var _0xbaf1=function(_0xef95c4,_0x43518b){_0xef95c4=_0xef95c4-0x0;var _0x54ae74=_0xaf1b[_0xef95c4];return _0x54ae74;};'use strict';var multer=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var path=require(_0xbaf1('0x2'));var timeout=require(_0xbaf1('0x3'));var express=require(_0xbaf1('0x4'));var router=express[_0xbaf1('0x5')]();var auth=require(_0xbaf1('0x6'));var interaction=require(_0xbaf1('0x7'));var config=require(_0xbaf1('0x8'));var controller=require(_0xbaf1('0x9'));router[_0xbaf1('0xa')]('/',auth[_0xbaf1('0xb')](),controller[_0xbaf1('0xc')]);router[_0xbaf1('0xa')]('/describe',auth[_0xbaf1('0xb')](),controller['describe']);router[_0xbaf1('0xa')]('/:id',auth[_0xbaf1('0xb')](),controller[_0xbaf1('0xd')]);router[_0xbaf1('0xa')]('/:id/messages',auth[_0xbaf1('0xb')](),controller[_0xbaf1('0xe')]);router['get'](_0xbaf1('0xf'),auth['isAuthenticated'](),controller[_0xbaf1('0x10')]);router[_0xbaf1('0x11')]('/',auth[_0xbaf1('0xb')](),controller[_0xbaf1('0x12')]);router[_0xbaf1('0x11')](_0xbaf1('0x13'),auth['isAuthenticated'](),controller['addMessage']);router[_0xbaf1('0x11')](_0xbaf1('0x14'),auth[_0xbaf1('0xb')](),interaction[_0xbaf1('0x15')](_0xbaf1('0x16'),_0xbaf1('0x17')),controller[_0xbaf1('0x18')]);router['put'](_0xbaf1('0x19'),auth[_0xbaf1('0xb')](),interaction[_0xbaf1('0x15')](_0xbaf1('0x16'),_0xbaf1('0x1a')),controller[_0xbaf1('0x1b')]);router[_0xbaf1('0x1c')](_0xbaf1('0x19'),auth['isAuthenticated'](),interaction[_0xbaf1('0x15')]('mail',_0xbaf1('0x1d')),controller[_0xbaf1('0x1e')]);router[_0xbaf1('0x1c')](_0xbaf1('0x14'),auth['isAuthenticated'](),controller[_0xbaf1('0x1f')]);module['exports']=router; \ No newline at end of file +var _0xb87c=['../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','mail','addTags','mailinteraction:update','delete','tracked','mailinteraction:destroy','destroy','/:id/tags','removeTags','util','path','connect-timeout','express','Router'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0xb87c,0x1d7));var _0xcb87=function(_0x4bbeb6,_0xd51477){_0x4bbeb6=_0x4bbeb6-0x0;var _0x1932b1=_0xb87c[_0x4bbeb6];return _0x1932b1;};'use strict';var multer=require('multer');var util=require(_0xcb87('0x0'));var path=require(_0xcb87('0x1'));var timeout=require(_0xcb87('0x2'));var express=require(_0xcb87('0x3'));var router=express[_0xcb87('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xcb87('0x5'));var config=require('../../config/environment');var controller=require('./mailInteraction.controller');router[_0xcb87('0x6')]('/',auth[_0xcb87('0x7')](),controller[_0xcb87('0x8')]);router[_0xcb87('0x6')](_0xcb87('0x9'),auth[_0xcb87('0x7')](),controller['describe']);router[_0xcb87('0x6')](_0xcb87('0xa'),auth[_0xcb87('0x7')](),controller[_0xcb87('0xb')]);router[_0xcb87('0x6')]('/:id/messages',auth[_0xcb87('0x7')](),controller[_0xcb87('0xc')]);router[_0xcb87('0x6')](_0xcb87('0xd'),auth[_0xcb87('0x7')](),controller[_0xcb87('0xe')]);router['post']('/',auth[_0xcb87('0x7')](),controller[_0xcb87('0xf')]);router[_0xcb87('0x10')](_0xcb87('0x11'),auth['isAuthenticated'](),controller[_0xcb87('0x12')]);router[_0xcb87('0x10')]('/:id/tags',auth[_0xcb87('0x7')](),interaction['tracked'](_0xcb87('0x13'),'mailinteraction:addtags'),controller[_0xcb87('0x14')]);router['put']('/:id',auth[_0xcb87('0x7')](),interaction['tracked'](_0xcb87('0x13'),_0xcb87('0x15')),controller['update']);router[_0xcb87('0x16')](_0xcb87('0xa'),auth[_0xcb87('0x7')](),interaction[_0xcb87('0x17')]('mail',_0xcb87('0x18')),controller[_0xcb87('0x19')]);router[_0xcb87('0x16')](_0xcb87('0x1a'),auth[_0xcb87('0x7')](),controller[_0xcb87('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index e9ef951..902bfcd 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 _0x45a3=['exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x38df43,_0x7787ae){var _0x3b8ed9=function(_0x433076){while(--_0x433076){_0x38df43['push'](_0x38df43['shift']());}};_0x3b8ed9(++_0x7787ae);}(_0x45a3,0x158));var _0x345a=function(_0x2b54c0,_0x2dcaa3){_0x2b54c0=_0x2b54c0-0x0;var _0x24f2b0=_0x45a3[_0x2b54c0];return _0x24f2b0;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0x345a('0x0')]={'closed':{'type':Sequelize[_0x345a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x345a('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x345a('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x345a('0x3')]},'cc':{'type':Sequelize[_0x345a('0x4')](_0x345a('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x345a('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x345a('0x2')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x345a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x345a('0x6')]('in',_0x345a('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x345a('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x345a('0x4')](_0x345a('0x5'))},'lastMsgText':{'type':Sequelize[_0x345a('0x4')](_0x345a('0x5'))}}; \ No newline at end of file +var _0xb093=['TEXT','ENUM','out','long','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x2b794b,_0x2a76e8){var _0x5e4d12=function(_0x14c3cb){while(--_0x14c3cb){_0x2b794b['push'](_0x2b794b['shift']());}};_0x5e4d12(++_0x2a76e8);}(_0xb093,0x109));var _0x3b09=function(_0x46001d,_0x4a1ab6){_0x46001d=_0x46001d-0x0;var _0x57cb00=_0xb093[_0x46001d];return _0x57cb00;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x3b09('0x0'));module[_0x3b09('0x1')]={'closed':{'type':Sequelize[_0x3b09('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3b09('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3b09('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x3b09('0x4')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x3b09('0x5')]()},'attach':{'type':Sequelize[_0x3b09('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x3b09('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x3b09('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x3b09('0x6')]('in',_0x3b09('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3b09('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3b09('0x6')]('in',_0x3b09('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x3b09('0x5')]('long')},'lastMsgText':{'type':Sequelize[_0x3b09('0x5')](_0x3b09('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 62b6a62..71fda2c 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 _0xe2e7=['concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.to','i.ContactId','i.MailAccountId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','body','describe','addMessage','omit','ids','getMessages','MailMessage','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','Tag','mailInteractionTags:save','removeTags','download','unix','join','server','files','root','format','transcript-%d-%s.zip','attachments','Attachment','Messages','bcc','subject','createdAt','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','message%d.eml','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','count','offset','limit','status','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','Tags','TagIds','forEach','push','MailInteraction','findOne','lastMsgBody','lastMsgText','trimStart','catch','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','users','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','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','split','ContactId','buildExpression','start','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','text','keys','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe2e7,0x71));var _0x7e2e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xe2e7[_0x46e363];return _0x3fb059;};'use strict';var pdf=require(_0x7e2e('0x0'));var emlformat=require(_0x7e2e('0x1'));var rimraf=require(_0x7e2e('0x2'));var zipdir=require(_0x7e2e('0x3'));var jsonpatch=require(_0x7e2e('0x4'));var rp=require(_0x7e2e('0x5'));var moment=require(_0x7e2e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7e2e('0x7'));var util=require(_0x7e2e('0x8'));var path=require(_0x7e2e('0x9'));var sox=require(_0x7e2e('0xa'));var csv=require(_0x7e2e('0xb'));var ejs=require(_0x7e2e('0xc'));var fs=require('fs');var _=require(_0x7e2e('0xd'));var squel=require(_0x7e2e('0xe'));var crypto=require(_0x7e2e('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e2e('0xb'));var querystring=require(_0x7e2e('0x10'));var Papa=require(_0x7e2e('0x11'));var htmlToText=require('html-to-text');var Redis=require(_0x7e2e('0x12'));var authService=require(_0x7e2e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7e2e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7e2e('0x15'));var utils=require(_0x7e2e('0x16'));var config=require(_0x7e2e('0x17'));var db=require(_0x7e2e('0x18'))['db'];config[_0x7e2e('0x19')]=_['defaults'](config['redis'],{'host':_0x7e2e('0x1a'),'port':0x18eb});var socket=require(_0x7e2e('0x1b'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0x7e2e('0x1c')](socket);function respondWithStatusCode(_0x27110f,_0x23cb2e){_0x23cb2e=_0x23cb2e||0xcc;return function(_0x3a7f4e){if(_0x3a7f4e){return _0x27110f[_0x7e2e('0x1d')](_0x23cb2e);}return _0x27110f['status'](_0x23cb2e)[_0x7e2e('0x1e')]();};}function respondWithResult(_0x523d78,_0x46f1dd){_0x46f1dd=_0x46f1dd||0xc8;return function(_0x111a0c){if(_0x111a0c){return _0x523d78['status'](_0x46f1dd)['json'](_0x111a0c);}};}function respondWithFilteredResult(_0x2b3870,_0x875d53){return function(_0x3c742d){if(_0x3c742d){var _0x38e4be=_0x3c742d[_0x7e2e('0x1f')],_0x4d614f=_0x875d53[_0x7e2e('0x20')],_0x473e53=_0x875d53[_0x7e2e('0x20')]+_0x875d53[_0x7e2e('0x21')],_0x557ea0;if(_0x473e53>=_0x38e4be){_0x473e53=_0x38e4be;_0x557ea0=0xc8;}else{_0x557ea0=0xce;}_0x2b3870[_0x7e2e('0x22')](_0x557ea0);return _0x2b3870[_0x7e2e('0x23')](_0x7e2e('0x24'),_0x4d614f+'-'+_0x473e53+'/'+_0x38e4be)[_0x7e2e('0x25')](_0x3c742d);}return null;};}function patchUpdates(_0x190790){return function(_0x3c6156){try{jsonpatch['apply'](_0x3c6156,_0x190790,!![]);}catch(_0x3cd46a){return BPromise[_0x7e2e('0x26')](_0x3cd46a);}return _0x3c6156[_0x7e2e('0x27')]();};}function saveUpdates(_0x567dbf,_0x5daad0){return function(_0x466607){if(_0x466607){return _0x466607[_0x7e2e('0x28')](_0x567dbf)[_0x7e2e('0x29')](function(_0x463e25){return _0x463e25;});}return null;};}function removeEntity(_0x539e4b,_0x261aea){return function(_0x22db67){if(_0x22db67){return _0x22db67[_0x7e2e('0x2a')]()['then'](function(){_0x539e4b[_0x7e2e('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c7975,_0x515881){return function(_0x4d98db){if(!_0x4d98db){_0x5c7975[_0x7e2e('0x1d')](0x194);}return _0x4d98db;};}function handleError(_0x3d707d,_0x1865b9){_0x1865b9=_0x1865b9||0x1f4;return function(_0xc14441){logger[_0x7e2e('0x2b')](_0xc14441[_0x7e2e('0x2c')]);if(_0xc14441['name']){delete _0xc14441[_0x7e2e('0x2d')];}_0x3d707d[_0x7e2e('0x22')](_0x1865b9)[_0x7e2e('0x2e')](_0xc14441);};}function getInteractionUsers(_0x2e1aa7,_0x16f8e1){return new BPromise(function(_0x23cb62,_0x46209f){try{if(_0x16f8e1[_0x2e1aa7['id']]){_0x2e1aa7[_0x7e2e('0x2f')]=_[_0x7e2e('0x30')](_0x16f8e1[_0x2e1aa7['id']],function(_0x124ea4){return{'id':_0x124ea4['id'],'fullname':_0x124ea4[_0x7e2e('0x31')]};});}}catch(_0x247646){_0x46209f(_0x247646);}_0x23cb62(_0x2e1aa7);});}function getInteractionTags(_0x5121ff,_0x5d9684){return new BPromise(function(_0x2e51cf,_0x124413){try{if(_0x5121ff['TagIds']){_0x5121ff[_0x7e2e('0x32')]=[];_0x5121ff[_0x7e2e('0x33')]['split'](',')[_0x7e2e('0x34')](function(_0x1b7429){_0x5121ff[_0x7e2e('0x32')][_0x7e2e('0x35')](_0x5d9684[_0x1b7429]);});}delete _0x5121ff[_0x7e2e('0x33')];}catch(_0x4472b1){_0x124413(_0x4472b1);}_0x2e51cf(_0x5121ff);});}function getLastMessageText(_0x47d2d9){return new BPromise(function(_0x27499f,_0x3bbb2f){return db[_0x7e2e('0x36')][_0x7e2e('0x37')]({'where':{'id':_0x47d2d9['id']},'attributes':[_0x7e2e('0x38'),'lastMsgText'],'raw':!![]})[_0x7e2e('0x29')](function(_0xf98002){if(!_0xf98002[_0x7e2e('0x39')]){_0x47d2d9[_0x7e2e('0x39')]=_[_0x7e2e('0x3a')](htmlToText['fromString'](_0xf98002[_0x7e2e('0x38')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x47d2d9['lastMsgText']=_0xf98002[_0x7e2e('0x39')];}_0x27499f(_0x47d2d9);})[_0x7e2e('0x3b')](function(_0x5a3ed7){_0x3bbb2f(_0x5a3ed7);});});}function updateMailInteraction(_0x43648a,_0x9005f3,_0x2e28c5,_0x4c30be){return new BPromise(function(_0x29b4f2,_0x195578){return getInteractionUsers(_0x43648a,_0x2e28c5)[_0x7e2e('0x29')](function(_0x1e0c32){return getInteractionTags(_0x1e0c32,_0x9005f3);})[_0x7e2e('0x29')](function(_0x41c100){if(_0x4c30be){_0x29b4f2(getLastMessageText(_0x41c100));}else{_0x29b4f2(_0x41c100);}})[_0x7e2e('0x3b')](function(_0x26c4aa){_0x195578(_0x26c4aa);});});}exports['index']=function(_0x5bafa3,_0x35fe6a){var _0x3775f6={},_0x58f21c={},_0x4290cb={'count':0x0,'rows':[]};var _0x2fc9c8=_[_0x7e2e('0x30')](db[_0x7e2e('0x36')][_0x7e2e('0x3c')],function(_0x1a701c){return{'name':_0x1a701c[_0x7e2e('0x3d')],'type':_0x1a701c['type'][_0x7e2e('0x3e')]};});_0x58f21c['model']=_[_0x7e2e('0x30')](_0x2fc9c8,_0x7e2e('0x2d'));_0x58f21c['query']=_['keys'](_0x5bafa3[_0x7e2e('0x3f')]);_0x58f21c[_0x7e2e('0x40')]=_[_0x7e2e('0x41')](_0x58f21c[_0x7e2e('0x42')],_0x58f21c[_0x7e2e('0x3f')]);_0x3775f6[_0x7e2e('0x43')]=_['intersection'](_0x58f21c[_0x7e2e('0x42')],qs[_0x7e2e('0x44')](_0x5bafa3[_0x7e2e('0x3f')][_0x7e2e('0x44')]));_0x3775f6[_0x7e2e('0x43')]=_0x3775f6[_0x7e2e('0x43')][_0x7e2e('0x45')]?_0x3775f6[_0x7e2e('0x43')]:_0x58f21c['model'];if(!_0x5bafa3[_0x7e2e('0x3f')][_0x7e2e('0x46')](_0x7e2e('0x47'))){_0x3775f6[_0x7e2e('0x21')]=qs[_0x7e2e('0x21')](_0x5bafa3[_0x7e2e('0x3f')][_0x7e2e('0x21')]);_0x3775f6['offset']=qs[_0x7e2e('0x20')](_0x5bafa3[_0x7e2e('0x3f')]['offset']);}_0x3775f6[_0x7e2e('0x48')]=qs[_0x7e2e('0x49')](_0x5bafa3[_0x7e2e('0x3f')][_0x7e2e('0x49')]);_0x3775f6[_0x7e2e('0x4a')]=qs[_0x7e2e('0x40')](_[_0x7e2e('0x4b')](_0x5bafa3['query'],_0x58f21c[_0x7e2e('0x40')]));var _0x23fd03=[];var _0x146c58=squel['select']()[_0x7e2e('0x4c')]('id')[_0x7e2e('0x4c')]('name')[_0x7e2e('0x4c')](_0x7e2e('0x4d'))[_0x7e2e('0x4e')](_0x7e2e('0x4f'));var _0x3edb97=squel['select']()[_0x7e2e('0x4c')](_0x7e2e('0x50'))['field'](_0x7e2e('0x51'))[_0x7e2e('0x4c')](_0x7e2e('0x52'))[_0x7e2e('0x4e')](_0x7e2e('0x53'),'ui')[_0x7e2e('0x54')]('users','u',_0x7e2e('0x55'));var _0x1b99ee=squel['select']()[_0x7e2e('0x4e')]('mail_interactions','i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x7e2e('0x56'),'o',_0x7e2e('0x57'))[_0x7e2e('0x54')](_0x7e2e('0x58'),'a',_0x7e2e('0x59'))[_0x7e2e('0x54')](_0x7e2e('0x5a'),'me',_0x7e2e('0x5b'))['left_join'](_0x7e2e('0x5c'),'it',_0x7e2e('0x5d'))[_0x7e2e('0x54')](_0x7e2e('0x4f'),'t',_0x7e2e('0x5e'));var _0x1aaf34=squel[_0x7e2e('0x5f')]();var _0x175034=[];var _0x4985af=squel[_0x7e2e('0x5f')]();var _0x2d3c7d;if(_0x5bafa3[_0x7e2e('0x3f')]['search']){_0x2d3c7d=as[_0x7e2e('0x60')](_0x5bafa3[_0x7e2e('0x3f')]['search']);var _0x10a929=_0x2d3c7d[_0x7e2e('0x61')];for(var _0xec80df=0x0;_0xec80df<_0x2d3c7d['conditions']['length'];_0xec80df++){var _0x577a9c=_0x2d3c7d['conditions'][_0xec80df];var _0x56e44e='i';var _0x1ab6d4=_[_0x7e2e('0x62')](_0x2fc9c8,[_0x7e2e('0x2d'),_0x577a9c['field']]);if(!_0x1ab6d4){switch(_0x577a9c[_0x7e2e('0x4c')]){case _0x7e2e('0x63'):if(_0x577a9c['value']==0x1){_0x1b99ee[_0x7e2e('0x64')]('`'+_0x577a9c[_0x7e2e('0x4c')]+_0x7e2e('0x65'));}else{_0x1b99ee[_0x7e2e('0x64')]('`'+_0x577a9c[_0x7e2e('0x4c')]+_0x7e2e('0x66'));}break;case _0x7e2e('0x67'):if(_0x577a9c[_0x7e2e('0x68')]===_0x7e2e('0x69')){if(_0x577a9c[_0x7e2e('0x6a')][_0x7e2e('0x6b')]('\x20')[_0x7e2e('0x45')]>0x1){_0x1aaf34[_0x10a929]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x577a9c[_0x7e2e('0x6a')]),null);}else{var _0x3e74c7='%'+_0x577a9c[_0x7e2e('0x6a')]+'%';_0x1aaf34[_0x10a929]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3e74c7,_0x3e74c7,_0x3e74c7);}}else{_0x1ab6d4=_[_0x7e2e('0x62')](_0x2fc9c8,['name',_0x7e2e('0x6c')]);_0x577a9c[_0x7e2e('0x4c')]='ContactId';_0x532d11=as[_0x7e2e('0x6d')](_0x56e44e,_0x1ab6d4['type'],_0x577a9c);_0x1aaf34[_0x10a929](_0x532d11['text'],_0x532d11[_0x7e2e('0x6a')][_0x7e2e('0x6e')],_0x532d11[_0x7e2e('0x6a')][_0x7e2e('0x1e')]);}break;case'Tag':var _0x3a398e=_0x577a9c['value'][_0x7e2e('0x6b')](',')[_0x7e2e('0x30')](function(_0x819165){return Number(_0x819165);});_0x3a398e[_0x7e2e('0x34')](function(_0x5078b2){_0x4985af['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5078b2+',%');});_0x175034=_[_0x7e2e('0x6f')](_0x175034,_0x3a398e);break;case'User':if(_0x577a9c[_0x7e2e('0x68')]==='$substring'){_0x1aaf34[_0x10a929](_0x7e2e('0x70'),'%'+_0x577a9c[_0x7e2e('0x6a')]+'%',null);}else{_0x1ab6d4=_[_0x7e2e('0x62')](_0x2fc9c8,[_0x7e2e('0x2d'),_0x7e2e('0x71')]);_0x577a9c[_0x7e2e('0x4c')]=_0x7e2e('0x71');_0x532d11=as[_0x7e2e('0x6d')](_0x56e44e,_0x1ab6d4[_0x7e2e('0x72')],_0x577a9c);_0x1aaf34[_0x10a929](_0x532d11[_0x7e2e('0x73')],_0x532d11['value'][_0x7e2e('0x6e')],_0x532d11[_0x7e2e('0x6a')][_0x7e2e('0x1e')]);}break;case'plainBody':_0x532d11=as[_0x7e2e('0x6d')]('me',null,_0x577a9c);_0x1aaf34[_0x10a929](_0x532d11[_0x7e2e('0x73')],_0x532d11['value'][_0x7e2e('0x6e')],_0x532d11[_0x7e2e('0x6a')]['end']);break;}}else{var _0x532d11=as[_0x7e2e('0x6d')](_0x56e44e,_0x1ab6d4[_0x7e2e('0x72')],_0x577a9c);_0x1aaf34[_0x10a929](_0x532d11[_0x7e2e('0x73')],_0x532d11[_0x7e2e('0x6a')][_0x7e2e('0x6e')],_0x532d11[_0x7e2e('0x6a')][_0x7e2e('0x1e')]);}}}else{var _0x238d4e=_(_0x5bafa3[_0x7e2e('0x3f')])[_0x7e2e('0x74')]()[_0x7e2e('0x30')](function(_0x722004){return _[_0x7e2e('0x75')](_0x2fc9c8,['name',_0x722004])?_0x722004:undefined;})[_0x7e2e('0x76')]()['value']();if(!_[_0x7e2e('0x77')](_0x238d4e)){_0x238d4e[_0x7e2e('0x34')](function(_0x8f3d5a){if(_0x8f3d5a===_0x7e2e('0x78')){_0x1b99ee['where'](_0x7e2e('0x79'),[][_0x7e2e('0x7a')](_0x5bafa3[_0x7e2e('0x3f')][_0x8f3d5a]));}else if(_0x8f3d5a==='createdAt'){var _0xea53a1=JSON[_0x7e2e('0x7b')](_0x5bafa3[_0x7e2e('0x3f')][_0x8f3d5a])['$gte'];var _0x4f7277=JSON[_0x7e2e('0x7b')](_0x5bafa3[_0x7e2e('0x3f')][_0x8f3d5a])['$lte'];_0x1b99ee['where'](_0x7e2e('0x7c'),_0xea53a1,_0x4f7277);}else{if(_0x5bafa3[_0x7e2e('0x3f')][_0x8f3d5a]===_0x7e2e('0x7d')){_0x1b99ee[_0x7e2e('0x4a')]('i.'+_0x8f3d5a+_0x7e2e('0x7e'));}else{_0x1b99ee['where']('i.'+_0x8f3d5a+'\x20=\x20?',_0x5bafa3['query'][_0x8f3d5a]);}}});}if(_0x5bafa3[_0x7e2e('0x3f')][_0x7e2e('0x7f')]){if(_0x5bafa3[_0x7e2e('0x3f')]['read']==0x1){_0x1b99ee[_0x7e2e('0x64')]('`unreadMessages`\x20=\x200');}else{_0x1b99ee[_0x7e2e('0x64')](_0x7e2e('0x80'));}}if(_0x5bafa3[_0x7e2e('0x3f')][_0x7e2e('0x81')]){_0x175034=_['isArray'](_0x5bafa3[_0x7e2e('0x3f')][_0x7e2e('0x81')])?_0x5bafa3[_0x7e2e('0x3f')][_0x7e2e('0x81')]:new Array(_0x5bafa3[_0x7e2e('0x3f')][_0x7e2e('0x81')]);_0x175034[_0x7e2e('0x34')](function(_0x257a05){_0x4985af['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x257a05+',%');});}if(_0x5bafa3[_0x7e2e('0x3f')]['filter']){var _0x4ffd1a=_0x5bafa3['query']['filter'][_0x7e2e('0x82')]('\x5c','\x5c\x5c')[_0x7e2e('0x82')]('\x27\x27',_0x7e2e('0x83'));if(qs[_0x7e2e('0x84')](_0x4ffd1a)){_0x1aaf34['or'](_0x7e2e('0x85'),_0x4ffd1a+'%');}else if(qs[_0x7e2e('0x86')](_0x4ffd1a)){_0x1aaf34['or'](_0x7e2e('0x87'),_0x4ffd1a+'%');}else{_0x1aaf34['or'](_0x7e2e('0x88'),qs['getFullTextValue'](_0x4ffd1a))['or'](_0x7e2e('0x89'),qs[_0x7e2e('0x8a')](_0x4ffd1a));}}}_0x1b99ee[_0x7e2e('0x4a')](_0x1aaf34);_0x1b99ee[_0x7e2e('0x8b')](_0x7e2e('0x8c'));var _0x22501f={'type':db[_0x7e2e('0x8d')][_0x7e2e('0x8e')][_0x7e2e('0x8f')],'raw':!![]};var _0x1bcb17=_0x1b99ee['clone']();_0x1bcb17['field'](_0x7e2e('0x8c'));_0x1bcb17[_0x7e2e('0x4c')](_0x7e2e('0x90'),_0x7e2e('0x63'));if(_0x3775f6[_0x7e2e('0x48')]){_0x3775f6[_0x7e2e('0x48')][_0x7e2e('0x34')](function(_0x458dd6){_0x1b99ee[_0x7e2e('0x48')]('i.'+_0x458dd6[0x0],_0x458dd6[0x1]===_0x7e2e('0x91')?![]:!![]);});}if(!_[_0x7e2e('0x77')](_0x175034)){_0x1b99ee[_0x7e2e('0x64')](_0x4985af);_0x1bcb17[_0x7e2e('0x4a')]('t.id\x20IN\x20?',_0x175034);}BPromise[_0x7e2e('0x92')]()[_0x7e2e('0x29')](function(){if(!_0x2d3c7d){if(_0x5bafa3[_0x7e2e('0x3f')][_0x7e2e('0x78')]||_0x5bafa3[_0x7e2e('0x3f')][_0x7e2e('0x93')])return;_0x1bcb17[_0x7e2e('0x4a')](_0x7e2e('0x94'));_0x1b99ee[_0x7e2e('0x4a')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x5bafa3[_0x7e2e('0x95')][_0x7e2e('0x96')]({'attributes':['id'],'raw':!![]})[_0x7e2e('0x29')](function(_0x57f802){if(_[_0x7e2e('0x77')](_0x57f802)){_0x1bcb17[_0x7e2e('0x4a')](_0x7e2e('0x97'));_0x1b99ee[_0x7e2e('0x4a')](_0x7e2e('0x97'));}else{_0x1bcb17['where'](_0x7e2e('0x79'),_[_0x7e2e('0x30')](_0x57f802,'id'));_0x1b99ee[_0x7e2e('0x4a')](_0x7e2e('0x79'),_['map'](_0x57f802,'id'));}});})[_0x7e2e('0x29')](function(){db[_0x7e2e('0x98')][_0x7e2e('0x3f')](_0x1bcb17[_0x7e2e('0x99')](),_0x22501f)['then'](function(_0x105469){_0x4290cb[_0x7e2e('0x1f')]=_0x105469['length'];if(_0x4290cb[_0x7e2e('0x1f')]===0x0)return[];return db[_0x7e2e('0x98')][_0x7e2e('0x3f')](_0x146c58[_0x7e2e('0x99')](),_0x22501f)[_0x7e2e('0x29')](function(_0x2946a0){_0x23fd03=_[_0x7e2e('0x9a')](_0x2946a0,'id');_0x22501f=_[_0x7e2e('0x9b')](_0x22501f,{'model':db[_0x7e2e('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5bafa3[_0x7e2e('0x3f')]['fields']){_0x3775f6[_0x7e2e('0x43')][_0x7e2e('0x34')](function(_0x4c5393){_0x1b99ee['field']('i.'+_0x4c5393);});}else{_0x1b99ee[_0x7e2e('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7e2e('0x63'));_0x1b99ee[_0x7e2e('0x4c')]('a.key',_0x7e2e('0x9c'));_0x1b99ee['field'](_0x7e2e('0x9d'),_0x7e2e('0x9e'));_0x1b99ee['field']('i.id');_0x1b99ee[_0x7e2e('0x4c')]('i.createdAt');_0x1b99ee['field']('i.updatedAt');_0x1b99ee['field'](_0x7e2e('0x9f'));_0x1b99ee[_0x7e2e('0x4c')]('i.closedAt');_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xa0'));_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xa1'));_0x1b99ee['field'](_0x7e2e('0xa2'));_0x1b99ee[_0x7e2e('0x4c')]('i.subject');_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xa3'));_0x1b99ee[_0x7e2e('0x4c')]('i.substatus');_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xa4'));_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xa5'));_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xa6'));_0x1b99ee['field']('i.UserId');_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xa7'),_0x7e2e('0xa8'));_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xa9'),_0x7e2e('0xaa'));_0x1b99ee[_0x7e2e('0x4c')]('c.email','Contact.email');_0x1b99ee['field'](_0x7e2e('0xab'),_0x7e2e('0xac'));_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xad'),_0x7e2e('0xae'));_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xaf'),_0x7e2e('0xb0'));_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xb1'),_0x7e2e('0xb2'));_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xb3'),_0x7e2e('0xb4'));_0x1b99ee[_0x7e2e('0x4c')](_0x7e2e('0xb5'),_0x7e2e('0x33'));}_0x1b99ee[_0x7e2e('0x21')](_0x3775f6['limit']);_0x1b99ee['offset'](_0x3775f6['offset']);return db[_0x7e2e('0x98')][_0x7e2e('0x3f')](_0x1b99ee['toString'](),_0x22501f);})['then'](function(_0x57076d){_0x3edb97[_0x7e2e('0x4a')](_0x7e2e('0xb6'),_[_0x7e2e('0x30')](_0x57076d,'id'));return db['sequelize'][_0x7e2e('0x3f')](_0x3edb97[_0x7e2e('0x99')](),_0x22501f)[_0x7e2e('0x29')](function(_0x16e5e0){var _0x106007=_[_0x7e2e('0xb7')](_0x16e5e0,_0x7e2e('0xb8'));var _0x196879=[];return db[_0x7e2e('0xb9')][_0x7e2e('0x37')]({'attributes':[_0x7e2e('0xba')],'raw':!![]})[_0x7e2e('0x29')](function(_0x2f2d4d){var _0x3dd7a3=_0x2f2d4d[_0x7e2e('0xba')];_0x57076d[_0x7e2e('0x34')](function(_0x32d6b4){_0x196879[_0x7e2e('0x35')](updateMailInteraction(_0x32d6b4,_0x23fd03,_0x106007,_0x3dd7a3));});return BPromise[_0x7e2e('0xbb')](_0x196879);});});});})[_0x7e2e('0x29')](function(_0x32981a){_0x4290cb[_0x7e2e('0xbc')]=_0x32981a;return _0x4290cb;})[_0x7e2e('0x29')](respondWithFilteredResult(_0x35fe6a,_0x3775f6));})['catch'](handleError(_0x35fe6a,null));};exports[_0x7e2e('0xbd')]=function(_0x5bfeb9,_0x3da6f3){var _0x468663={'raw':![],'where':{'id':_0x5bfeb9[_0x7e2e('0xbe')]['id']}},_0x2f4902={};_0x2f4902[_0x7e2e('0x42')]=_[_0x7e2e('0x74')](db['MailInteraction']['rawAttributes']);_0x2f4902[_0x7e2e('0x3f')]=_[_0x7e2e('0x74')](_0x5bfeb9[_0x7e2e('0x3f')]);_0x2f4902[_0x7e2e('0x40')]=_[_0x7e2e('0x41')](_0x2f4902[_0x7e2e('0x42')],_0x2f4902[_0x7e2e('0x3f')]);_0x468663[_0x7e2e('0x43')]=_[_0x7e2e('0x41')](_0x2f4902[_0x7e2e('0x42')],qs[_0x7e2e('0x44')](_0x5bfeb9['query'][_0x7e2e('0x44')]));_0x468663[_0x7e2e('0x43')]=_0x468663[_0x7e2e('0x43')]['length']?_0x468663['attributes']:_0x2f4902[_0x7e2e('0x42')];if(_0x5bfeb9[_0x7e2e('0x3f')][_0x7e2e('0xbf')]){_0x468663[_0x7e2e('0xc0')]=[{'all':!![]}];}_0x468663=_[_0x7e2e('0x9b')]({},_0x468663,_0x5bfeb9[_0x7e2e('0xc1')]);return db[_0x7e2e('0x36')]['find'](_0x468663)['then'](handleEntityNotFound(_0x3da6f3,null))[_0x7e2e('0x29')](respondWithResult(_0x3da6f3,null))[_0x7e2e('0x3b')](handleError(_0x3da6f3,null));};exports['create']=function(_0x2264f7,_0x18002f){return db[_0x7e2e('0x36')]['create'](_0x2264f7['body'],{})[_0x7e2e('0x29')](respondWithResult(_0x18002f,0xc9))[_0x7e2e('0x3b')](handleError(_0x18002f,null));};exports[_0x7e2e('0x28')]=function(_0x48fb61,_0x45b3fb){if(_0x48fb61['body']['id']){delete _0x48fb61[_0x7e2e('0xc2')]['id'];}return db[_0x7e2e('0x36')][_0x7e2e('0x62')]({'where':{'id':_0x48fb61['params']['id']}})['then'](handleEntityNotFound(_0x45b3fb,null))[_0x7e2e('0x29')](saveUpdates(_0x48fb61['body'],null))[_0x7e2e('0x29')](respondWithResult(_0x45b3fb,null))[_0x7e2e('0x3b')](handleError(_0x45b3fb,null));};exports[_0x7e2e('0x2a')]=function(_0xf351ba,_0x5e7b52){return db[_0x7e2e('0x36')][_0x7e2e('0x62')]({'where':{'id':_0xf351ba[_0x7e2e('0xbe')]['id']}})[_0x7e2e('0x29')](handleEntityNotFound(_0x5e7b52,null))[_0x7e2e('0x29')](removeEntity(_0x5e7b52,null))[_0x7e2e('0x3b')](handleError(_0x5e7b52,null));};exports[_0x7e2e('0xc3')]=function(_0x393505,_0x359058){return db['MailInteraction']['describe']()[_0x7e2e('0x29')](respondWithResult(_0x359058,null))[_0x7e2e('0x3b')](handleError(_0x359058,null));};exports['addMessage']=function(_0x3497e9,_0x25a5d4,_0x59c0d5){return db['MailMessage'][_0x7e2e('0x62')]({'where':{'id':_0x3497e9[_0x7e2e('0xbe')]['id']}})[_0x7e2e('0x29')](handleEntityNotFound(_0x25a5d4,null))['then'](function(_0x516360){if(_0x516360){return _0x516360[_0x7e2e('0xc4')](_0x3497e9[_0x7e2e('0xc2')]['ids'],_[_0x7e2e('0xc5')](_0x3497e9[_0x7e2e('0xc2')],[_0x7e2e('0xc6'),'id'])||{});}})[_0x7e2e('0x29')](respondWithResult(_0x25a5d4,null))[_0x7e2e('0x3b')](handleError(_0x25a5d4,null));};exports[_0x7e2e('0xc7')]=function(_0x446ddf,_0x4fc341,_0x4577fc){var _0x463306={'raw':![],'where':{}};var _0x3403af={};var _0x7e1619={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x446ddf[_0x7e2e('0xbe')]['id']}})[_0x7e2e('0x29')](handleEntityNotFound(_0x4fc341,null))['then'](function(_0x1303e6){if(_0x1303e6){_0x3403af[_0x7e2e('0x42')]=_[_0x7e2e('0x74')](db[_0x7e2e('0xc8')][_0x7e2e('0x3c')]);_0x3403af[_0x7e2e('0x3f')]=_[_0x7e2e('0x74')](_0x446ddf[_0x7e2e('0x3f')]);_0x3403af['filters']=_[_0x7e2e('0x41')](_0x3403af[_0x7e2e('0x42')],_0x3403af[_0x7e2e('0x3f')]);_0x463306[_0x7e2e('0x43')]=_[_0x7e2e('0x41')](_0x3403af[_0x7e2e('0x42')],qs[_0x7e2e('0x44')](_0x446ddf[_0x7e2e('0x3f')][_0x7e2e('0x44')]));_0x463306[_0x7e2e('0x43')]=_0x463306[_0x7e2e('0x43')][_0x7e2e('0x45')]?_0x463306[_0x7e2e('0x43')]:_0x3403af[_0x7e2e('0x42')];if(!_0x446ddf['query'][_0x7e2e('0x46')](_0x7e2e('0x47'))){_0x463306[_0x7e2e('0x21')]=qs[_0x7e2e('0x21')](_0x446ddf[_0x7e2e('0x3f')]['limit']);_0x463306[_0x7e2e('0x20')]=qs[_0x7e2e('0x20')](_0x446ddf[_0x7e2e('0x3f')][_0x7e2e('0x20')]);}_0x463306[_0x7e2e('0x48')]=qs[_0x7e2e('0x49')](_0x446ddf[_0x7e2e('0x3f')]['sort']);_0x463306[_0x7e2e('0x4a')]=qs['filters'](_[_0x7e2e('0x4b')](_0x446ddf[_0x7e2e('0x3f')],_0x3403af[_0x7e2e('0x40')]));_0x463306[_0x7e2e('0x4a')][_0x7e2e('0xb8')]=_0x1303e6['id'];if(_0x446ddf[_0x7e2e('0x3f')]['filter']){_0x463306[_0x7e2e('0x4a')]=_['merge'](_0x463306[_0x7e2e('0x4a')],{'$or':_[_0x7e2e('0x30')](_0x463306[_0x7e2e('0x43')],function(_0x3fc1d9){var _0x17ab96={};_0x17ab96[_0x3fc1d9]={'$like':'%'+_0x446ddf[_0x7e2e('0x3f')][_0x7e2e('0xc9')]+'%'};return _0x17ab96;})});}if(_0x446ddf[_0x7e2e('0x3f')][_0x7e2e('0xca')]){var _0x1be66a=_0x446ddf[_0x7e2e('0x3f')][_0x7e2e('0xca')][_0x7e2e('0x6b')](',');var _0x56dd6f={};_0x56dd6f[_0x1be66a[0x0]]={'$gte':moment(_0x1be66a[0x1])['format'](_0x7e2e('0xcb'))};_0x463306[_0x7e2e('0x4a')]=_[_0x7e2e('0x9b')](_0x463306[_0x7e2e('0x4a')],_0x56dd6f);}_0x463306=_[_0x7e2e('0x9b')]({},_0x463306,_0x446ddf[_0x7e2e('0xc1')]);return db[_0x7e2e('0xc8')][_0x7e2e('0x1f')]({'where':_0x463306[_0x7e2e('0x4a')]})['then'](function(_0xaa8f3e){_0x7e1619[_0x7e2e('0x1f')]=_0xaa8f3e;if(_0x446ddf['query'][_0x7e2e('0xbf')]){_0x463306[_0x7e2e('0xc0')]=[{'all':!![]}];}return db[_0x7e2e('0xc8')][_0x7e2e('0xcc')](_0x463306);})[_0x7e2e('0x29')](function(_0x40c0b3){_0x7e1619['rows']=_0x40c0b3;return _0x7e1619;});}})[_0x7e2e('0x29')](respondWithFilteredResult(_0x4fc341,_0x463306))[_0x7e2e('0x3b')](handleError(_0x4fc341,null));};exports['addTags']=function(_0x103cc3,_0x273d44,_0xd03061){return db[_0x7e2e('0x36')][_0x7e2e('0x62')]({'where':{'id':_0x103cc3[_0x7e2e('0xbe')]['id']}})[_0x7e2e('0x29')](handleEntityNotFound(_0x273d44,null))['then'](function(_0xb6265f){if(_0xb6265f){return _0xb6265f['setTags'](_0x103cc3[_0x7e2e('0xc2')]['ids'],_['omit'](_0x103cc3[_0x7e2e('0xc2')],[_0x7e2e('0xc6'),'id'])||{})[_0x7e2e('0xcd')](function(){return db[_0x7e2e('0xce')][_0x7e2e('0xcc')]({'attributes':['id',_0x7e2e('0x2d'),_0x7e2e('0x4d')],'where':{'id':_0x103cc3[_0x7e2e('0xc2')][_0x7e2e('0xc6')]}});})[_0x7e2e('0x29')](function(_0x231d26){socket['emit'](_0x7e2e('0xcf'),{'id':Number(_0x103cc3[_0x7e2e('0xbe')]['id']),'tags':_0x231d26||[]});return{'id':Number(_0x103cc3[_0x7e2e('0xbe')]['id']),'tags':_0x231d26||[]};});}})['then'](respondWithResult(_0x273d44,null))[_0x7e2e('0x3b')](handleError(_0x273d44,null));};exports[_0x7e2e('0xd0')]=function(_0x29a17c,_0xf3f00c,_0x2d145e){return db[_0x7e2e('0x36')][_0x7e2e('0x62')]({'where':{'id':_0x29a17c[_0x7e2e('0xbe')]['id']}})[_0x7e2e('0x29')](handleEntityNotFound(_0xf3f00c,null))['then'](function(_0x473a55){if(_0x473a55){return _0x473a55['removeTags'](_0x29a17c['query'][_0x7e2e('0xc6')]);}})[_0x7e2e('0x29')](respondWithStatusCode(_0xf3f00c,null))[_0x7e2e('0x3b')](handleError(_0xf3f00c,null));};exports[_0x7e2e('0xd1')]=function(_0x510de8,_0x2cc06c){var _0x4f44f3=moment()[_0x7e2e('0xd2')]()[_0x7e2e('0x99')]();var _0x2048e0=path[_0x7e2e('0xd3')](config['root'],_0x7e2e('0xd4'),_0x7e2e('0xd5'),'tmp');var _0x599d75=path[_0x7e2e('0xd3')](config[_0x7e2e('0xd6')],_0x7e2e('0xd4'),_0x7e2e('0xd5'),'attachments');var _0x1b9128=path[_0x7e2e('0xd3')](_0x2048e0,_0x4f44f3);var _0x5db183=util[_0x7e2e('0xd7')](_0x7e2e('0xd8'),_0x510de8[_0x7e2e('0xbe')]['id'],_0x4f44f3);var _0x1b8fa7=path[_0x7e2e('0xd3')](_0x2048e0,_0x5db183);var _0x4aa4eb=[];if(_0x510de8[_0x7e2e('0x3f')][_0x7e2e('0xd9')]){_0x4aa4eb[_0x7e2e('0x35')]({'model':db[_0x7e2e('0xda')],'as':'Attachments','raw':!![]});}var _0x424509=[{'model':db[_0x7e2e('0xc8')],'as':_0x7e2e('0xdb'),'attributes':['id','body',_0x7e2e('0x4e'),'to','cc',_0x7e2e('0xdc'),_0x7e2e('0xdd'),_0x7e2e('0xde')],'where':{'secret':![]},'order':qs[_0x7e2e('0x49')]('id'),'include':_0x4aa4eb}];return db[_0x7e2e('0x36')][_0x7e2e('0x62')]({'where':{'id':_0x510de8[_0x7e2e('0xbe')]['id']},'include':_0x424509})[_0x7e2e('0x29')](handleEntityNotFound(_0x2cc06c,null))[_0x7e2e('0x29')](function(_0x1cad51){if(_0x1cad51&&_0x1cad51['Messages']){var _0x4234af=_0x1cad51[_0x7e2e('0xdf')]({'plain':!![]});fs['mkdirSync'](_0x1b9128);return BPromise[_0x7e2e('0xe0')](_0x4234af['Messages'],function(_0x371431,_0xd2ffdb){var _0x4f0cd7={'from':_0x371431[_0x7e2e('0x4e')],'to':_0x371431['to'],'subject':_0x371431[_0x7e2e('0xdd')],'html':_0x371431['body'],'headers':{'Date':moment(_0x371431[_0x7e2e('0xde')])['format'](_0x7e2e('0xe1'))},'attachments':[]};if(_0x371431['cc']){_0x4f0cd7[_0x7e2e('0xe2')]['Cc']=_0x371431['cc'];}if(_0x371431[_0x7e2e('0xdc')]){_0x4f0cd7['headers'][_0x7e2e('0xe3')]=_0x371431[_0x7e2e('0xdc')];}return new BPromise(function(_0x3aaf42,_0x5df96e){if(_0x371431['Attachments']){for(var _0x299071=0x0;_0x299071<_0x371431['Attachments']['length'];_0x299071++){var _0x273fc7=_0x371431['Attachments'][_0x299071];var _0x367ab4=path[_0x7e2e('0xd3')](_0x599d75,_0x273fc7[_0x7e2e('0xe4')]);if(fs[_0x7e2e('0xe5')](_0x367ab4)){_0x4f0cd7[_0x7e2e('0xd9')][_0x7e2e('0x35')]({'name':_0x273fc7[_0x7e2e('0x2d')],'contentType':_0x273fc7[_0x7e2e('0x72')],'data':fs[_0x7e2e('0xe6')](_0x367ab4)});}}}emlformat[_0x7e2e('0xe7')](_0x4f0cd7,function(_0x56be6d,_0x75ce57){if(_0x56be6d)return _0x5df96e(_0x56be6d);fs['writeFileSync'](path[_0x7e2e('0xd3')](_0x1b9128,util['format'](_0x7e2e('0xe8'),_0xd2ffdb)),_0x75ce57);return _0x3aaf42(_0x75ce57);});});})['then'](function(){return new BPromise(function(_0x1a11fe,_0x41b95c){zipdir(_0x1b9128,{'saveTo':_0x1b8fa7},function(_0x109478,_0x289541){if(_0x109478)return _0x41b95c(_0x109478);return _0x1a11fe(_0x289541);});})[_0x7e2e('0x29')](function(){return new BPromise(function(_0x29470c,_0x34bee9){rimraf(_0x1b9128,function(_0x2d9df6){if(_0x2d9df6)_0x34bee9(_0x2d9df6);return _0x29470c();});});})['then'](function(){return _0x2cc06c[_0x7e2e('0xd1')](_0x1b8fa7,_0x5db183,function(_0x2b1105){if(_0x2b1105){console[_0x7e2e('0xe9')](_0x7e2e('0xea'),_0x2b1105);}else{fs['unlinkSync'](_0x1b8fa7);}});});});}else{return _0x2cc06c[_0x7e2e('0x1d')](0xc8);}})['catch'](handleError(_0x2cc06c,null));}; \ No newline at end of file +var _0x406c=['../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','count','offset','limit','set','json','apply','save','update','then','destroy','end','sendStatus','error','name','send','Users','map','TagIds','Tags','split','forEach','push','MailInteraction','findOne','lastMsgBody','lastMsgText','trimStart','fromString','catch','index','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','select','field','tools_tags','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','length','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','plainBody','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.to','i.ContactId','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','show','params','includeAll','include','create','body','describe','addMessage','MailMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','color','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','bcc','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','log','err','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','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/utils'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x406c,0xda));var _0xc406=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x406c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc406('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc406('0x1'));var zipdir=require(_0xc406('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc406('0x3'));var moment=require(_0xc406('0x4'));var BPromise=require(_0xc406('0x5'));var Mustache=require(_0xc406('0x6'));var util=require('util');var path=require(_0xc406('0x7'));var sox=require(_0xc406('0x8'));var csv=require(_0xc406('0x9'));var ejs=require(_0xc406('0xa'));var fs=require('fs');var _=require(_0xc406('0xb'));var squel=require(_0xc406('0xc'));var crypto=require(_0xc406('0xd'));var jsforce=require(_0xc406('0xe'));var deskjs=require(_0xc406('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc406('0x10'));var Papa=require(_0xc406('0x11'));var htmlToText=require(_0xc406('0x12'));var Redis=require(_0xc406('0x13'));var authService=require(_0xc406('0x14'));var qs=require(_0xc406('0x15'));var as=require(_0xc406('0x16'));var hardwareService=require(_0xc406('0x17'));var logger=require(_0xc406('0x18'))(_0xc406('0x19'));var utils=require(_0xc406('0x1a'));var config=require(_0xc406('0x1b'));var db=require(_0xc406('0x1c'))['db'];config['redis']=_[_0xc406('0x1d')](config[_0xc406('0x1e')],{'host':_0xc406('0x1f'),'port':0x18eb});var socket=require(_0xc406('0x20'))(new Redis(config[_0xc406('0x1e')]));require(_0xc406('0x21'))[_0xc406('0x22')](socket);function respondWithStatusCode(_0x394d94,_0x5c7009){_0x5c7009=_0x5c7009||0xcc;return function(_0x170801){if(_0x170801){return _0x394d94['sendStatus'](_0x5c7009);}return _0x394d94['status'](_0x5c7009)['end']();};}function respondWithResult(_0x434b2a,_0x51f56b){_0x51f56b=_0x51f56b||0xc8;return function(_0x4a545f){if(_0x4a545f){return _0x434b2a[_0xc406('0x23')](_0x51f56b)['json'](_0x4a545f);}};}function respondWithFilteredResult(_0x55a600,_0xa2b8fb){return function(_0x268df0){if(_0x268df0){var _0x21867c=_0x268df0[_0xc406('0x24')],_0x37e8ed=_0xa2b8fb['offset'],_0x11fced=_0xa2b8fb[_0xc406('0x25')]+_0xa2b8fb[_0xc406('0x26')],_0x2776fc;if(_0x11fced>=_0x21867c){_0x11fced=_0x21867c;_0x2776fc=0xc8;}else{_0x2776fc=0xce;}_0x55a600[_0xc406('0x23')](_0x2776fc);return _0x55a600[_0xc406('0x27')]('Content-Range',_0x37e8ed+'-'+_0x11fced+'/'+_0x21867c)[_0xc406('0x28')](_0x268df0);}return null;};}function patchUpdates(_0x3e1a59){return function(_0x5a6be6){try{jsonpatch[_0xc406('0x29')](_0x5a6be6,_0x3e1a59,!![]);}catch(_0x5571e8){return BPromise['reject'](_0x5571e8);}return _0x5a6be6[_0xc406('0x2a')]();};}function saveUpdates(_0x3e5bd5,_0x13fe66){return function(_0x5d5be5){if(_0x5d5be5){return _0x5d5be5[_0xc406('0x2b')](_0x3e5bd5)[_0xc406('0x2c')](function(_0x4cf41f){return _0x4cf41f;});}return null;};}function removeEntity(_0x2fc366,_0x1a0bb5){return function(_0x43594e){if(_0x43594e){return _0x43594e[_0xc406('0x2d')]()['then'](function(){_0x2fc366[_0xc406('0x23')](0xcc)[_0xc406('0x2e')]();});}};}function handleEntityNotFound(_0x37360e,_0x2f1d18){return function(_0x422b55){if(!_0x422b55){_0x37360e[_0xc406('0x2f')](0x194);}return _0x422b55;};}function handleError(_0x3a81b3,_0x19b70d){_0x19b70d=_0x19b70d||0x1f4;return function(_0x199e09){logger[_0xc406('0x30')](_0x199e09['stack']);if(_0x199e09[_0xc406('0x31')]){delete _0x199e09[_0xc406('0x31')];}_0x3a81b3[_0xc406('0x23')](_0x19b70d)[_0xc406('0x32')](_0x199e09);};}function getInteractionUsers(_0x9074a4,_0x5a1766){return new BPromise(function(_0x55033b,_0x3d7744){try{if(_0x5a1766[_0x9074a4['id']]){_0x9074a4[_0xc406('0x33')]=_[_0xc406('0x34')](_0x5a1766[_0x9074a4['id']],function(_0xa4a4fa){return{'id':_0xa4a4fa['id'],'fullname':_0xa4a4fa['fullname']};});}}catch(_0x39300a){_0x3d7744(_0x39300a);}_0x55033b(_0x9074a4);});}function getInteractionTags(_0x274a99,_0x6baea4){return new BPromise(function(_0x8208c2,_0x377d4a){try{if(_0x274a99[_0xc406('0x35')]){_0x274a99[_0xc406('0x36')]=[];_0x274a99[_0xc406('0x35')][_0xc406('0x37')](',')[_0xc406('0x38')](function(_0xd637d4){_0x274a99[_0xc406('0x36')][_0xc406('0x39')](_0x6baea4[_0xd637d4]);});}delete _0x274a99[_0xc406('0x35')];}catch(_0x5e9e70){_0x377d4a(_0x5e9e70);}_0x8208c2(_0x274a99);});}function getLastMessageText(_0x25e309){return new BPromise(function(_0x242d74,_0x2ca868){return db[_0xc406('0x3a')][_0xc406('0x3b')]({'where':{'id':_0x25e309['id']},'attributes':[_0xc406('0x3c'),_0xc406('0x3d')],'raw':!![]})[_0xc406('0x2c')](function(_0x270c8f){if(!_0x270c8f['lastMsgText']){_0x25e309[_0xc406('0x3d')]=_[_0xc406('0x3e')](htmlToText[_0xc406('0x3f')](_0x270c8f['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x25e309[_0xc406('0x3d')]=_0x270c8f[_0xc406('0x3d')];}_0x242d74(_0x25e309);})[_0xc406('0x40')](function(_0x129a48){_0x2ca868(_0x129a48);});});}function updateMailInteraction(_0x358426,_0x45ea08,_0x39e3d2,_0x50c90d){return new BPromise(function(_0x31dde2,_0x3faf76){return getInteractionUsers(_0x358426,_0x39e3d2)['then'](function(_0x587fb3){return getInteractionTags(_0x587fb3,_0x45ea08);})[_0xc406('0x2c')](function(_0x583f55){if(_0x50c90d){_0x31dde2(getLastMessageText(_0x583f55));}else{_0x31dde2(_0x583f55);}})[_0xc406('0x40')](function(_0x48cc34){_0x3faf76(_0x48cc34);});});}exports[_0xc406('0x41')]=function(_0x1a7b72,_0x2bfc35){var _0x3fa6c3={},_0x2b1d3d={},_0x46981d={'count':0x0,'rows':[]};var _0x37dea5=_[_0xc406('0x34')](db[_0xc406('0x3a')][_0xc406('0x42')],function(_0x1cde6d){return{'name':_0x1cde6d['fieldName'],'type':_0x1cde6d[_0xc406('0x43')][_0xc406('0x44')]};});_0x2b1d3d[_0xc406('0x45')]=_[_0xc406('0x34')](_0x37dea5,'name');_0x2b1d3d['query']=_[_0xc406('0x46')](_0x1a7b72[_0xc406('0x47')]);_0x2b1d3d['filters']=_[_0xc406('0x48')](_0x2b1d3d[_0xc406('0x45')],_0x2b1d3d[_0xc406('0x47')]);_0x3fa6c3[_0xc406('0x49')]=_[_0xc406('0x48')](_0x2b1d3d['model'],qs[_0xc406('0x4a')](_0x1a7b72['query']['fields']));_0x3fa6c3[_0xc406('0x49')]=_0x3fa6c3[_0xc406('0x49')]['length']?_0x3fa6c3['attributes']:_0x2b1d3d[_0xc406('0x45')];if(!_0x1a7b72[_0xc406('0x47')][_0xc406('0x4b')](_0xc406('0x4c'))){_0x3fa6c3[_0xc406('0x26')]=qs[_0xc406('0x26')](_0x1a7b72[_0xc406('0x47')][_0xc406('0x26')]);_0x3fa6c3[_0xc406('0x25')]=qs[_0xc406('0x25')](_0x1a7b72[_0xc406('0x47')][_0xc406('0x25')]);}_0x3fa6c3[_0xc406('0x4d')]=qs[_0xc406('0x4e')](_0x1a7b72['query'][_0xc406('0x4e')]);_0x3fa6c3[_0xc406('0x4f')]=qs['filters'](_['pick'](_0x1a7b72[_0xc406('0x47')],_0x2b1d3d[_0xc406('0x50')]));var _0x4939b9=[];var _0x3f0146=squel[_0xc406('0x51')]()[_0xc406('0x52')]('id')[_0xc406('0x52')](_0xc406('0x31'))[_0xc406('0x52')]('color')['from'](_0xc406('0x53'));var _0x3864e2=squel['select']()[_0xc406('0x52')]('u.id')[_0xc406('0x52')](_0xc406('0x54'))[_0xc406('0x52')](_0xc406('0x55'))['from'](_0xc406('0x56'),'ui')[_0xc406('0x57')](_0xc406('0x58'),'u',_0xc406('0x59'));var _0x5dec68=squel[_0xc406('0x51')]()[_0xc406('0x5a')](_0xc406('0x5b'),'i')[_0xc406('0x57')](_0xc406('0x5c'),'c',_0xc406('0x5d'))['left_join']('users','o',_0xc406('0x5e'))[_0xc406('0x57')]('mail_accounts','a',_0xc406('0x5f'))[_0xc406('0x57')](_0xc406('0x60'),'me',_0xc406('0x61'))[_0xc406('0x57')]('mail_interaction_has_tags','it',_0xc406('0x62'))['left_join']('tools_tags','t',_0xc406('0x63'));var _0x50e0eb=squel[_0xc406('0x64')]();var _0x3e708d=[];var _0xdeee3e=squel['expr']();var _0x2df25d;if(_0x1a7b72[_0xc406('0x47')][_0xc406('0x65')]){_0x2df25d=as[_0xc406('0x66')](_0x1a7b72[_0xc406('0x47')]['search']);var _0x2e5613=_0x2df25d['sqlOperator'];for(var _0x144fe9=0x0;_0x144fe9<_0x2df25d['conditions'][_0xc406('0x67')];_0x144fe9++){var _0x56d770=_0x2df25d[_0xc406('0x68')][_0x144fe9];var _0x2c3daf='i';var _0x17a961=_[_0xc406('0x69')](_0x37dea5,[_0xc406('0x31'),_0x56d770[_0xc406('0x52')]]);if(!_0x17a961){switch(_0x56d770[_0xc406('0x52')]){case _0xc406('0x6a'):if(_0x56d770['value']==0x1){_0x5dec68[_0xc406('0x6b')]('`'+_0x56d770['field']+_0xc406('0x6c'));}else{_0x5dec68[_0xc406('0x6b')]('`'+_0x56d770['field']+_0xc406('0x6d'));}break;case _0xc406('0x6e'):if(_0x56d770[_0xc406('0x6f')]==='$substring'){if(_0x56d770[_0xc406('0x70')][_0xc406('0x37')]('\x20')[_0xc406('0x67')]>0x1){_0x50e0eb[_0x2e5613](_0xc406('0x71'),qs[_0xc406('0x72')](_0x56d770[_0xc406('0x70')]),null);}else{var _0x11decd='%'+_0x56d770[_0xc406('0x70')]+'%';_0x50e0eb[_0x2e5613](_0xc406('0x73'),_0x11decd,_0x11decd,_0x11decd);}}else{_0x17a961=_[_0xc406('0x69')](_0x37dea5,[_0xc406('0x31'),_0xc406('0x74')]);_0x56d770['field']=_0xc406('0x74');_0x3372c7=as['buildExpression'](_0x2c3daf,_0x17a961['type'],_0x56d770);_0x50e0eb[_0x2e5613](_0x3372c7[_0xc406('0x75')],_0x3372c7[_0xc406('0x70')][_0xc406('0x76')],_0x3372c7['value']['end']);}break;case _0xc406('0x77'):var _0xace473=_0x56d770[_0xc406('0x70')]['split'](',')[_0xc406('0x34')](function(_0x149217){return Number(_0x149217);});_0xace473[_0xc406('0x38')](function(_0x4b9f9c){_0xdeee3e['or'](_0xc406('0x78'),'%,'+_0x4b9f9c+',%');});_0x3e708d=_[_0xc406('0x79')](_0x3e708d,_0xace473);break;case _0xc406('0x7a'):if(_0x56d770[_0xc406('0x6f')]===_0xc406('0x7b')){_0x50e0eb[_0x2e5613](_0xc406('0x7c'),'%'+_0x56d770[_0xc406('0x70')]+'%',null);}else{_0x17a961=_[_0xc406('0x69')](_0x37dea5,[_0xc406('0x31'),_0xc406('0x7d')]);_0x56d770[_0xc406('0x52')]='UserId';_0x3372c7=as[_0xc406('0x7e')](_0x2c3daf,_0x17a961[_0xc406('0x43')],_0x56d770);_0x50e0eb[_0x2e5613](_0x3372c7[_0xc406('0x75')],_0x3372c7[_0xc406('0x70')][_0xc406('0x76')],_0x3372c7[_0xc406('0x70')]['end']);}break;case _0xc406('0x7f'):_0x3372c7=as['buildExpression']('me',null,_0x56d770);_0x50e0eb[_0x2e5613](_0x3372c7[_0xc406('0x75')],_0x3372c7['value'][_0xc406('0x76')],_0x3372c7[_0xc406('0x70')]['end']);break;}}else{var _0x3372c7=as[_0xc406('0x7e')](_0x2c3daf,_0x17a961[_0xc406('0x43')],_0x56d770);_0x50e0eb[_0x2e5613](_0x3372c7['text'],_0x3372c7[_0xc406('0x70')]['start'],_0x3372c7[_0xc406('0x70')]['end']);}}}else{var _0x46bbf3=_(_0x1a7b72[_0xc406('0x47')])[_0xc406('0x46')]()['map'](function(_0x202e65){return _[_0xc406('0x80')](_0x37dea5,[_0xc406('0x31'),_0x202e65])?_0x202e65:undefined;})[_0xc406('0x81')]()[_0xc406('0x70')]();if(!_[_0xc406('0x82')](_0x46bbf3)){_0x46bbf3[_0xc406('0x38')](function(_0x407bca){if(_0x407bca===_0xc406('0x83')){_0x5dec68['where'](_0xc406('0x84'),[]['concat'](_0x1a7b72[_0xc406('0x47')][_0x407bca]));}else if(_0x407bca===_0xc406('0x85')){var _0x4f6a76=JSON['parse'](_0x1a7b72[_0xc406('0x47')][_0x407bca])[_0xc406('0x86')];var _0x42ee9a=JSON['parse'](_0x1a7b72['query'][_0x407bca])[_0xc406('0x87')];_0x5dec68['where'](_0xc406('0x88'),_0x4f6a76,_0x42ee9a);}else{if(_0x1a7b72['query'][_0x407bca]===_0xc406('0x89')){_0x5dec68[_0xc406('0x4f')]('i.'+_0x407bca+'\x20IS\x20NULL');}else{_0x5dec68[_0xc406('0x4f')]('i.'+_0x407bca+_0xc406('0x8a'),_0x1a7b72[_0xc406('0x47')][_0x407bca]);}}});}if(_0x1a7b72[_0xc406('0x47')][_0xc406('0x8b')]){if(_0x1a7b72[_0xc406('0x47')][_0xc406('0x8b')]==0x1){_0x5dec68[_0xc406('0x6b')](_0xc406('0x8c'));}else{_0x5dec68[_0xc406('0x6b')](_0xc406('0x8d'));}}if(_0x1a7b72[_0xc406('0x47')]['tag']){_0x3e708d=_[_0xc406('0x8e')](_0x1a7b72[_0xc406('0x47')][_0xc406('0x8f')])?_0x1a7b72[_0xc406('0x47')][_0xc406('0x8f')]:new Array(_0x1a7b72['query'][_0xc406('0x8f')]);_0x3e708d['forEach'](function(_0x4423d0){_0xdeee3e['or'](_0xc406('0x78'),'%,'+_0x4423d0+',%');});}if(_0x1a7b72[_0xc406('0x47')][_0xc406('0x90')]){var _0x465fe3=_0x1a7b72['query'][_0xc406('0x90')][_0xc406('0x91')]('\x5c','\x5c\x5c')[_0xc406('0x91')]('\x27\x27',_0xc406('0x92'));if(qs['isNumeric'](_0x465fe3)){_0x50e0eb['or'](_0xc406('0x93'),_0x465fe3+'%');}else if(qs[_0xc406('0x94')](_0x465fe3)){_0x50e0eb['or'](_0xc406('0x95'),_0x465fe3+'%');}else{_0x50e0eb['or'](_0xc406('0x96'),qs[_0xc406('0x72')](_0x465fe3))['or'](_0xc406('0x97'),qs['getFullTextValue'](_0x465fe3));}}}_0x5dec68[_0xc406('0x4f')](_0x50e0eb);_0x5dec68[_0xc406('0x98')](_0xc406('0x99'));var _0x592d3b={'type':db[_0xc406('0x9a')][_0xc406('0x9b')][_0xc406('0x9c')],'raw':!![]};var _0x281baf=_0x5dec68[_0xc406('0x9d')]();_0x281baf[_0xc406('0x52')]('i.id');_0x281baf[_0xc406('0x52')](_0xc406('0x9e'),_0xc406('0x6a'));if(_0x3fa6c3[_0xc406('0x4d')]){_0x3fa6c3[_0xc406('0x4d')][_0xc406('0x38')](function(_0x5826f2){_0x5dec68[_0xc406('0x4d')]('i.'+_0x5826f2[0x0],_0x5826f2[0x1]===_0xc406('0x9f')?![]:!![]);});}if(!_[_0xc406('0x82')](_0x3e708d)){_0x5dec68[_0xc406('0x6b')](_0xdeee3e);_0x281baf[_0xc406('0x4f')]('t.id\x20IN\x20?',_0x3e708d);}BPromise['resolve']()[_0xc406('0x2c')](function(){if(!_0x2df25d){if(_0x1a7b72[_0xc406('0x47')][_0xc406('0x83')]||_0x1a7b72[_0xc406('0x47')][_0xc406('0xa0')])return;_0x281baf[_0xc406('0x4f')](_0xc406('0xa1'));_0x5dec68[_0xc406('0x4f')](_0xc406('0xa1'));return;}return _0x1a7b72[_0xc406('0xa2')][_0xc406('0xa3')]({'attributes':['id'],'raw':!![]})[_0xc406('0x2c')](function(_0x3929da){if(_[_0xc406('0x82')](_0x3929da)){_0x281baf[_0xc406('0x4f')](_0xc406('0xa4'));_0x5dec68[_0xc406('0x4f')](_0xc406('0xa4'));}else{_0x281baf['where']('i.MailAccountId\x20IN\x20?',_[_0xc406('0x34')](_0x3929da,'id'));_0x5dec68['where']('i.MailAccountId\x20IN\x20?',_['map'](_0x3929da,'id'));}});})[_0xc406('0x2c')](function(){db[_0xc406('0xa5')][_0xc406('0x47')](_0x281baf[_0xc406('0xa6')](),_0x592d3b)[_0xc406('0x2c')](function(_0x57e35a){_0x46981d[_0xc406('0x24')]=_0x57e35a[_0xc406('0x67')];if(_0x46981d[_0xc406('0x24')]===0x0)return[];return db[_0xc406('0xa5')][_0xc406('0x47')](_0x3f0146['toString'](),_0x592d3b)[_0xc406('0x2c')](function(_0x81ebfc){_0x4939b9=_[_0xc406('0xa7')](_0x81ebfc,'id');_0x592d3b=_[_0xc406('0xa8')](_0x592d3b,{'model':db[_0xc406('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a7b72['query']['fields']){_0x3fa6c3['attributes']['forEach'](function(_0x58845d){_0x5dec68[_0xc406('0x52')]('i.'+_0x58845d);});}else{_0x5dec68[_0xc406('0x52')](_0xc406('0x9e'),'unreadMessages');_0x5dec68[_0xc406('0x52')](_0xc406('0xa9'),_0xc406('0xaa'));_0x5dec68[_0xc406('0x52')](_0xc406('0xab'),_0xc406('0xac'));_0x5dec68[_0xc406('0x52')](_0xc406('0x99'));_0x5dec68[_0xc406('0x52')](_0xc406('0xad'));_0x5dec68['field']('i.updatedAt');_0x5dec68[_0xc406('0x52')](_0xc406('0xae'));_0x5dec68[_0xc406('0x52')](_0xc406('0xaf'));_0x5dec68[_0xc406('0x52')](_0xc406('0xb0'));_0x5dec68[_0xc406('0x52')](_0xc406('0xb1'));_0x5dec68[_0xc406('0x52')](_0xc406('0xb2'));_0x5dec68[_0xc406('0x52')]('i.subject');_0x5dec68[_0xc406('0x52')](_0xc406('0xb3'));_0x5dec68[_0xc406('0x52')]('i.substatus');_0x5dec68[_0xc406('0x52')](_0xc406('0xb4'));_0x5dec68[_0xc406('0x52')](_0xc406('0xb5'));_0x5dec68[_0xc406('0x52')](_0xc406('0xb6'));_0x5dec68['field']('i.UserId');_0x5dec68[_0xc406('0x52')]('c.firstName',_0xc406('0xb7'));_0x5dec68['field'](_0xc406('0xb8'),_0xc406('0xb9'));_0x5dec68['field'](_0xc406('0xba'),_0xc406('0xbb'));_0x5dec68[_0xc406('0x52')](_0xc406('0xbc'),'Contact.phone');_0x5dec68[_0xc406('0x52')](_0xc406('0xbd'),_0xc406('0xbe'));_0x5dec68[_0xc406('0x52')]('c.fax',_0xc406('0xbf'));_0x5dec68[_0xc406('0x52')]('o.fullname',_0xc406('0xc0'));_0x5dec68[_0xc406('0x52')](_0xc406('0xc1'),_0xc406('0xc2'));_0x5dec68[_0xc406('0x52')](_0xc406('0xc3'),'TagIds');}_0x5dec68['limit'](_0x3fa6c3['limit']);_0x5dec68['offset'](_0x3fa6c3[_0xc406('0x25')]);return db[_0xc406('0xa5')][_0xc406('0x47')](_0x5dec68['toString'](),_0x592d3b);})[_0xc406('0x2c')](function(_0x15f6cd){_0x3864e2[_0xc406('0x4f')]('ui.MailInteractionId\x20IN\x20?',_[_0xc406('0x34')](_0x15f6cd,'id'));return db[_0xc406('0xa5')][_0xc406('0x47')](_0x3864e2[_0xc406('0xa6')](),_0x592d3b)[_0xc406('0x2c')](function(_0x253482){var _0x4653e4=_[_0xc406('0xc4')](_0x253482,'MailInteractionId');var _0x26cd7d=[];return db[_0xc406('0xc5')][_0xc406('0x3b')]({'attributes':['enableEmailPreview'],'raw':!![]})['then'](function(_0x3bd820){var _0x1c1c39=_0x3bd820[_0xc406('0xc6')];_0x15f6cd['forEach'](function(_0x6aa998){_0x26cd7d[_0xc406('0x39')](updateMailInteraction(_0x6aa998,_0x4939b9,_0x4653e4,_0x1c1c39));});return BPromise[_0xc406('0xc7')](_0x26cd7d);});});});})[_0xc406('0x2c')](function(_0x3c641f){_0x46981d['rows']=_0x3c641f;return _0x46981d;})[_0xc406('0x2c')](respondWithFilteredResult(_0x2bfc35,_0x3fa6c3));})[_0xc406('0x40')](handleError(_0x2bfc35,null));};exports[_0xc406('0xc8')]=function(_0x22c07f,_0x59cbf3){var _0x3330ea={'raw':![],'where':{'id':_0x22c07f[_0xc406('0xc9')]['id']}},_0x45da6c={};_0x45da6c['model']=_[_0xc406('0x46')](db[_0xc406('0x3a')][_0xc406('0x42')]);_0x45da6c[_0xc406('0x47')]=_[_0xc406('0x46')](_0x22c07f[_0xc406('0x47')]);_0x45da6c[_0xc406('0x50')]=_['intersection'](_0x45da6c['model'],_0x45da6c[_0xc406('0x47')]);_0x3330ea[_0xc406('0x49')]=_[_0xc406('0x48')](_0x45da6c[_0xc406('0x45')],qs[_0xc406('0x4a')](_0x22c07f[_0xc406('0x47')]['fields']));_0x3330ea[_0xc406('0x49')]=_0x3330ea[_0xc406('0x49')][_0xc406('0x67')]?_0x3330ea[_0xc406('0x49')]:_0x45da6c[_0xc406('0x45')];if(_0x22c07f['query'][_0xc406('0xca')]){_0x3330ea[_0xc406('0xcb')]=[{'all':!![]}];}_0x3330ea=_['merge']({},_0x3330ea,_0x22c07f['options']);return db[_0xc406('0x3a')][_0xc406('0x69')](_0x3330ea)[_0xc406('0x2c')](handleEntityNotFound(_0x59cbf3,null))['then'](respondWithResult(_0x59cbf3,null))[_0xc406('0x40')](handleError(_0x59cbf3,null));};exports['create']=function(_0x21025a,_0x39ede9){return db[_0xc406('0x3a')][_0xc406('0xcc')](_0x21025a[_0xc406('0xcd')],{})[_0xc406('0x2c')](respondWithResult(_0x39ede9,0xc9))[_0xc406('0x40')](handleError(_0x39ede9,null));};exports[_0xc406('0x2b')]=function(_0x4319a8,_0x1e479b){if(_0x4319a8[_0xc406('0xcd')]['id']){delete _0x4319a8['body']['id'];}return db['MailInteraction'][_0xc406('0x69')]({'where':{'id':_0x4319a8[_0xc406('0xc9')]['id']}})['then'](handleEntityNotFound(_0x1e479b,null))['then'](saveUpdates(_0x4319a8[_0xc406('0xcd')],null))[_0xc406('0x2c')](respondWithResult(_0x1e479b,null))[_0xc406('0x40')](handleError(_0x1e479b,null));};exports[_0xc406('0x2d')]=function(_0x1a3680,_0x4dcce0){return db[_0xc406('0x3a')][_0xc406('0x69')]({'where':{'id':_0x1a3680['params']['id']}})['then'](handleEntityNotFound(_0x4dcce0,null))[_0xc406('0x2c')](removeEntity(_0x4dcce0,null))['catch'](handleError(_0x4dcce0,null));};exports[_0xc406('0xce')]=function(_0x1cd9b7,_0x50d4ed){return db['MailInteraction'][_0xc406('0xce')]()[_0xc406('0x2c')](respondWithResult(_0x50d4ed,null))[_0xc406('0x40')](handleError(_0x50d4ed,null));};exports[_0xc406('0xcf')]=function(_0x57cea5,_0x3e0056,_0x44e4c5){return db[_0xc406('0xd0')][_0xc406('0x69')]({'where':{'id':_0x57cea5[_0xc406('0xc9')]['id']}})[_0xc406('0x2c')](handleEntityNotFound(_0x3e0056,null))[_0xc406('0x2c')](function(_0x9deefa){if(_0x9deefa){return _0x9deefa[_0xc406('0xcf')](_0x57cea5[_0xc406('0xcd')][_0xc406('0xd1')],_['omit'](_0x57cea5['body'],['ids','id'])||{});}})[_0xc406('0x2c')](respondWithResult(_0x3e0056,null))[_0xc406('0x40')](handleError(_0x3e0056,null));};exports[_0xc406('0xd2')]=function(_0x339c3c,_0x5908a8,_0x1f4e7b){var _0x1dba2c={'raw':![],'where':{}};var _0x7a51f4={};var _0x351f8e={'count':0x0,'rows':[]};return db[_0xc406('0x3a')][_0xc406('0x3b')]({'where':{'id':_0x339c3c[_0xc406('0xc9')]['id']}})[_0xc406('0x2c')](handleEntityNotFound(_0x5908a8,null))[_0xc406('0x2c')](function(_0x11f778){if(_0x11f778){_0x7a51f4[_0xc406('0x45')]=_['keys'](db[_0xc406('0xd0')]['rawAttributes']);_0x7a51f4[_0xc406('0x47')]=_[_0xc406('0x46')](_0x339c3c[_0xc406('0x47')]);_0x7a51f4[_0xc406('0x50')]=_[_0xc406('0x48')](_0x7a51f4[_0xc406('0x45')],_0x7a51f4[_0xc406('0x47')]);_0x1dba2c[_0xc406('0x49')]=_[_0xc406('0x48')](_0x7a51f4[_0xc406('0x45')],qs[_0xc406('0x4a')](_0x339c3c[_0xc406('0x47')]['fields']));_0x1dba2c[_0xc406('0x49')]=_0x1dba2c[_0xc406('0x49')][_0xc406('0x67')]?_0x1dba2c[_0xc406('0x49')]:_0x7a51f4['model'];if(!_0x339c3c['query']['hasOwnProperty'](_0xc406('0x4c'))){_0x1dba2c['limit']=qs[_0xc406('0x26')](_0x339c3c[_0xc406('0x47')][_0xc406('0x26')]);_0x1dba2c[_0xc406('0x25')]=qs[_0xc406('0x25')](_0x339c3c['query'][_0xc406('0x25')]);}_0x1dba2c[_0xc406('0x4d')]=qs[_0xc406('0x4e')](_0x339c3c[_0xc406('0x47')][_0xc406('0x4e')]);_0x1dba2c[_0xc406('0x4f')]=qs[_0xc406('0x50')](_['pick'](_0x339c3c[_0xc406('0x47')],_0x7a51f4[_0xc406('0x50')]));_0x1dba2c[_0xc406('0x4f')]['MailInteractionId']=_0x11f778['id'];if(_0x339c3c[_0xc406('0x47')][_0xc406('0x90')]){_0x1dba2c[_0xc406('0x4f')]=_['merge'](_0x1dba2c[_0xc406('0x4f')],{'$or':_['map'](_0x1dba2c[_0xc406('0x49')],function(_0x4d4005){var _0x13e8a1={};_0x13e8a1[_0x4d4005]={'$like':'%'+_0x339c3c['query'][_0xc406('0x90')]+'%'};return _0x13e8a1;})});}if(_0x339c3c['query'][_0xc406('0x86')]){var _0x3ea7fb=_0x339c3c[_0xc406('0x47')][_0xc406('0x86')][_0xc406('0x37')](',');var _0x342076={};_0x342076[_0x3ea7fb[0x0]]={'$gte':moment(_0x3ea7fb[0x1])[_0xc406('0xd3')](_0xc406('0xd4'))};_0x1dba2c['where']=_[_0xc406('0xa8')](_0x1dba2c[_0xc406('0x4f')],_0x342076);}_0x1dba2c=_[_0xc406('0xa8')]({},_0x1dba2c,_0x339c3c['options']);return db[_0xc406('0xd0')][_0xc406('0x24')]({'where':_0x1dba2c[_0xc406('0x4f')]})[_0xc406('0x2c')](function(_0x2e523c){_0x351f8e['count']=_0x2e523c;if(_0x339c3c[_0xc406('0x47')]['includeAll']){_0x1dba2c[_0xc406('0xcb')]=[{'all':!![]}];}return db[_0xc406('0xd0')][_0xc406('0xd5')](_0x1dba2c);})['then'](function(_0x58eb8a){_0x351f8e[_0xc406('0xd6')]=_0x58eb8a;return _0x351f8e;});}})[_0xc406('0x2c')](respondWithFilteredResult(_0x5908a8,_0x1dba2c))['catch'](handleError(_0x5908a8,null));};exports[_0xc406('0xd7')]=function(_0x1223d9,_0x3eee6a,_0x2ca2ac){return db[_0xc406('0x3a')][_0xc406('0x69')]({'where':{'id':_0x1223d9[_0xc406('0xc9')]['id']}})[_0xc406('0x2c')](handleEntityNotFound(_0x3eee6a,null))[_0xc406('0x2c')](function(_0x9dbaf7){if(_0x9dbaf7){return _0x9dbaf7[_0xc406('0xd8')](_0x1223d9['body'][_0xc406('0xd1')],_['omit'](_0x1223d9[_0xc406('0xcd')],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xc406('0x31'),_0xc406('0xd9')],'where':{'id':_0x1223d9['body'][_0xc406('0xd1')]}});})['then'](function(_0x1d03e1){socket['emit']('mailInteractionTags:save',{'id':Number(_0x1223d9[_0xc406('0xc9')]['id']),'tags':_0x1d03e1||[]});return{'id':Number(_0x1223d9[_0xc406('0xc9')]['id']),'tags':_0x1d03e1||[]};});}})['then'](respondWithResult(_0x3eee6a,null))['catch'](handleError(_0x3eee6a,null));};exports[_0xc406('0xda')]=function(_0x73fa45,_0x44f299,_0x59f305){return db[_0xc406('0x3a')][_0xc406('0x69')]({'where':{'id':_0x73fa45['params']['id']}})['then'](handleEntityNotFound(_0x44f299,null))['then'](function(_0x2b9377){if(_0x2b9377){return _0x2b9377[_0xc406('0xda')](_0x73fa45['query'][_0xc406('0xd1')]);}})[_0xc406('0x2c')](respondWithStatusCode(_0x44f299,null))[_0xc406('0x40')](handleError(_0x44f299,null));};exports[_0xc406('0xdb')]=function(_0x575adb,_0x494bff){var _0x2205d6=moment()[_0xc406('0xdc')]()[_0xc406('0xa6')]();var _0x256aa0=path[_0xc406('0xdd')](config[_0xc406('0xde')],_0xc406('0xdf'),_0xc406('0xe0'),_0xc406('0xe1'));var _0x39cf3a=path['join'](config[_0xc406('0xde')],_0xc406('0xdf'),_0xc406('0xe0'),_0xc406('0xe2'));var _0x59ad6c=path[_0xc406('0xdd')](_0x256aa0,_0x2205d6);var _0x3954fb=util[_0xc406('0xd3')](_0xc406('0xe3'),_0x575adb[_0xc406('0xc9')]['id'],_0x2205d6);var _0x17aae8=path[_0xc406('0xdd')](_0x256aa0,_0x3954fb);var _0x5c29e3=[];if(_0x575adb[_0xc406('0x47')]['attachments']){_0x5c29e3['push']({'model':db[_0xc406('0xe4')],'as':'Attachments','raw':!![]});}var _0x4d70db=[{'model':db[_0xc406('0xd0')],'as':_0xc406('0xe5'),'attributes':['id',_0xc406('0xcd'),_0xc406('0x5a'),'to','cc',_0xc406('0xe6'),_0xc406('0xe7'),_0xc406('0x85')],'where':{'secret':![]},'order':qs[_0xc406('0x4e')]('id'),'include':_0x5c29e3}];return db[_0xc406('0x3a')][_0xc406('0x69')]({'where':{'id':_0x575adb[_0xc406('0xc9')]['id']},'include':_0x4d70db})['then'](handleEntityNotFound(_0x494bff,null))['then'](function(_0x3a9531){if(_0x3a9531&&_0x3a9531['Messages']){var _0x19602d=_0x3a9531[_0xc406('0xe8')]({'plain':!![]});fs['mkdirSync'](_0x59ad6c);return BPromise[_0xc406('0xe9')](_0x19602d[_0xc406('0xe5')],function(_0xe8a83c,_0x3ca861){var _0x306d47={'from':_0xe8a83c['from'],'to':_0xe8a83c['to'],'subject':_0xe8a83c[_0xc406('0xe7')],'html':_0xe8a83c[_0xc406('0xcd')],'headers':{'Date':moment(_0xe8a83c[_0xc406('0x85')])[_0xc406('0xd3')](_0xc406('0xea'))},'attachments':[]};if(_0xe8a83c['cc']){_0x306d47[_0xc406('0xeb')]['Cc']=_0xe8a83c['cc'];}if(_0xe8a83c[_0xc406('0xe6')]){_0x306d47[_0xc406('0xeb')]['Bcc']=_0xe8a83c[_0xc406('0xe6')];}return new BPromise(function(_0x267e89,_0x5dce0b){if(_0xe8a83c[_0xc406('0xec')]){for(var _0x8818d7=0x0;_0x8818d7<_0xe8a83c[_0xc406('0xec')][_0xc406('0x67')];_0x8818d7++){var _0x488782=_0xe8a83c['Attachments'][_0x8818d7];var _0x243e19=path[_0xc406('0xdd')](_0x39cf3a,_0x488782[_0xc406('0xed')]);if(fs[_0xc406('0xee')](_0x243e19)){_0x306d47[_0xc406('0xe2')][_0xc406('0x39')]({'name':_0x488782[_0xc406('0x31')],'contentType':_0x488782[_0xc406('0x43')],'data':fs[_0xc406('0xef')](_0x243e19)});}}}emlformat[_0xc406('0xf0')](_0x306d47,function(_0x3dcb92,_0x5b368d){if(_0x3dcb92)return _0x5dce0b(_0x3dcb92);fs[_0xc406('0xf1')](path[_0xc406('0xdd')](_0x59ad6c,util[_0xc406('0xd3')](_0xc406('0xf2'),_0x3ca861)),_0x5b368d);return _0x267e89(_0x5b368d);});});})[_0xc406('0x2c')](function(){return new BPromise(function(_0x4a166f,_0x2b5207){zipdir(_0x59ad6c,{'saveTo':_0x17aae8},function(_0x22abdb,_0x299812){if(_0x22abdb)return _0x2b5207(_0x22abdb);return _0x4a166f(_0x299812);});})['then'](function(){return new BPromise(function(_0x2f0a43,_0x978272){rimraf(_0x59ad6c,function(_0x4831b8){if(_0x4831b8)_0x978272(_0x4831b8);return _0x2f0a43();});});})[_0xc406('0x2c')](function(){return _0x494bff[_0xc406('0xdb')](_0x17aae8,_0x3954fb,function(_0x505c65){if(_0x505c65){console[_0xc406('0xf3')](_0xc406('0xf4'),_0x505c65);}else{fs['unlinkSync'](_0x17aae8);}});});});}else{return _0x494bff[_0xc406('0x2f')](0xc8);}})[_0xc406('0x40')](handleError(_0x494bff,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index b6cfd77..405e966 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 _0x5d22=['Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailInteraction','setMaxListeners','update','getUsers','then','setDataValue'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x5d22,0x168));var _0x25d2=function(_0x5e7655,_0x3a8044){_0x5e7655=_0x5e7655-0x0;var _0x5497c4=_0x5d22[_0x5e7655];return _0x5497c4;};'use strict';var EventEmitter=require(_0x25d2('0x0'));var MailInteraction=require(_0x25d2('0x1'))['db'][_0x25d2('0x2')];var MailMessage=require(_0x25d2('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x25d2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x25d2('0x4'),'afterDestroy':'remove'};function emitEvent(_0xacb840){return function(_0x3da1dc,_0x2be312,_0x2df299){_0x3da1dc[_0x25d2('0x5')]({'attributes':['id'],'raw':!![]})[_0x25d2('0x6')](function(_0xab3a57){_0x3da1dc[_0x25d2('0x7')](_0x25d2('0x8'),_0xab3a57[_0x25d2('0x9')](function(_0x5346fa){return{'id':_0x5346fa['id']};}));return MailMessage[_0x25d2('0xa')]({'where':{'MailInteractionId':_0x3da1dc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x25d2('0x6')](function(_0xa4b782){_0x3da1dc[_0x25d2('0x7')](_0x25d2('0xb'),_0xa4b782['length']);MailInteractionEvents['emit'](_0xacb840+':'+_0x3da1dc['id'],_0x3da1dc);MailInteractionEvents[_0x25d2('0xc')](_0xacb840,_0x3da1dc);_0x2df299(null);})[_0x25d2('0xd')](_0x2df299(null));};}for(var e in events){if(events[_0x25d2('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x25d2('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x4222=['emit','catch','hasOwnProperty','hook','events','../../mysqldb','MailMessage','save','update','remove','getUsers','setDataValue','map','findAll','then','unreadMessages','length'];(function(_0x325084,_0x4b0fbd){var _0x17db96=function(_0x5d9368){while(--_0x5d9368){_0x325084['push'](_0x325084['shift']());}};_0x17db96(++_0x4b0fbd);}(_0x4222,0x158));var _0x2422=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x4222[_0x346737];return _0x1ade2e;};'use strict';var EventEmitter=require(_0x2422('0x0'));var MailInteraction=require(_0x2422('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x2422('0x1'))['db'][_0x2422('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2422('0x3'),'afterUpdate':_0x2422('0x4'),'afterDestroy':_0x2422('0x5')};function emitEvent(_0xa4b622){return function(_0x190c2d,_0xaa6c5,_0x292117){_0x190c2d[_0x2422('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x30e6a6){_0x190c2d[_0x2422('0x7')]('Users',_0x30e6a6[_0x2422('0x8')](function(_0x3bc6ca){return{'id':_0x3bc6ca['id']};}));return MailMessage[_0x2422('0x9')]({'where':{'MailInteractionId':_0x190c2d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2422('0xa')](function(_0x297f18){_0x190c2d[_0x2422('0x7')](_0x2422('0xb'),_0x297f18[_0x2422('0xc')]);MailInteractionEvents[_0x2422('0xd')](_0xa4b622+':'+_0x190c2d['id'],_0x190c2d);MailInteractionEvents[_0x2422('0xd')](_0xa4b622,_0x190c2d);_0x292117(null);})[_0x2422('0xe')](_0x292117(null));};}for(var e in events){if(events[_0x2422('0xf')](e)){var event=events[e];MailInteraction[_0x2422('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index c95a786..6071e2a 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 _0x418f=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','closedAt','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash'];(function(_0x1815b6,_0x2a05fa){var _0x5eaa82=function(_0x5c8010){while(--_0x5c8010){_0x1815b6['push'](_0x1815b6['shift']());}};_0x5eaa82(++_0x2a05fa);}(_0x418f,0xdf));var _0xf418=function(_0x21fc0a,_0x1c3a72){_0x21fc0a=_0x21fc0a-0x0;var _0x485574=_0x418f[_0x21fc0a];return _0x485574;};'use strict';var _=require(_0xf418('0x0'));var util=require(_0xf418('0x1'));var logger=require(_0xf418('0x2'))(_0xf418('0x3'));var moment=require(_0xf418('0x4'));var BPromise=require('bluebird');var rp=require(_0xf418('0x5'));var fs=require('fs');var path=require(_0xf418('0x6'));var rimraf=require(_0xf418('0x7'));var config=require(_0xf418('0x8'));var attributes=require('./mailInteraction.attributes');module[_0xf418('0x9')]=function(_0x535456,_0x544059){return _0x535456['define']('MailInteraction',attributes,{'tableName':_0xf418('0xa'),'paranoid':![],'indexes':[{'name':_0xf418('0xb'),'fields':[_0xf418('0xc'),'to'],'type':_0xf418('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2d4ce0,_0x523254,_0x30f49b){if(_0x2d4ce0[_0xf418('0xe')]){_0x2d4ce0[_0xf418('0xf')]=moment()[_0xf418('0x10')](_0xf418('0x11'));}if(_0x2d4ce0[_0xf418('0x12')]){_0x2d4ce0['closedAt']=moment()[_0xf418('0x10')](_0xf418('0x11'));}_0x30f49b(null,_0x523254);},'beforeUpdate':function(_0x5f0287,_0x5db83c,_0x498615){if(_0x5f0287[_0xf418('0x13')]('substatus')){_0x5f0287['substatusAt']=_0x5f0287[_0xf418('0xe')]?moment()[_0xf418('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x5f0287[_0xf418('0x13')](_0xf418('0x12'))){_0x5f0287[_0xf418('0x14')]=moment()[_0xf418('0x10')](_0xf418('0x11'));_0x5f0287['substatus']=null;_0x5f0287[_0xf418('0xf')]=null;}_0x498615(null,_0x5f0287);},'afterUpdate':function(_0x2bad82,_0x4a7a62,_0x42bf0d){var _0x1d50f3=_0x535456[_0xf418('0x15')];var _0x568cc7=_0x2bad82[_0xf418('0x16')]({'plain':!![]});if(_0x568cc7[_0xf418('0x12')]){return _0x1d50f3[_0xf418('0x17')][_0xf418('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x568cc7['id']}})[_0xf418('0x19')](function(){_0x42bf0d();})[_0xf418('0x1a')](function(_0x49e284){_0x42bf0d(_0x49e284);});}else{_0x42bf0d();}}},'charset':'utf8mb4','collate':_0xf418('0x1b')});}; \ No newline at end of file +var _0x8f9f=['YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatus','models','get','closed','MailMessage','update','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format'];(function(_0x2c2d15,_0x170a84){var _0x28017d=function(_0x5ae8c4){while(--_0x5ae8c4){_0x2c2d15['push'](_0x2c2d15['shift']());}};_0x28017d(++_0x170a84);}(_0x8f9f,0xbf));var _0xf8f9=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x8f9f[_0x20589d];return _0x422de9;};'use strict';var _=require(_0xf8f9('0x0'));var util=require(_0xf8f9('0x1'));var logger=require(_0xf8f9('0x2'))(_0xf8f9('0x3'));var moment=require(_0xf8f9('0x4'));var BPromise=require(_0xf8f9('0x5'));var rp=require(_0xf8f9('0x6'));var fs=require('fs');var path=require(_0xf8f9('0x7'));var rimraf=require(_0xf8f9('0x8'));var config=require(_0xf8f9('0x9'));var attributes=require('./mailInteraction.attributes');module[_0xf8f9('0xa')]=function(_0x21159f,_0x4fd3bf){return _0x21159f[_0xf8f9('0xb')](_0xf8f9('0xc'),attributes,{'tableName':_0xf8f9('0xd'),'paranoid':![],'indexes':[{'name':_0xf8f9('0xe'),'fields':[_0xf8f9('0xf'),'to'],'type':_0xf8f9('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10f190,_0x3e8a11,_0x451874){if(_0x10f190['substatus']){_0x10f190[_0xf8f9('0x11')]=moment()[_0xf8f9('0x12')](_0xf8f9('0x13'));}if(_0x10f190['closed']){_0x10f190[_0xf8f9('0x14')]=moment()['format'](_0xf8f9('0x13'));}_0x451874(null,_0x3e8a11);},'beforeUpdate':function(_0x3ef788,_0x4419e7,_0x47ef26){if(_0x3ef788['changed']('substatus')){_0x3ef788['substatusAt']=_0x3ef788['substatus']?moment()[_0xf8f9('0x12')](_0xf8f9('0x13')):null;}if(_0x3ef788[_0xf8f9('0x15')]('closed')){_0x3ef788[_0xf8f9('0x14')]=moment()[_0xf8f9('0x12')](_0xf8f9('0x13'));_0x3ef788[_0xf8f9('0x16')]=null;_0x3ef788[_0xf8f9('0x11')]=null;}_0x47ef26(null,_0x3ef788);},'afterUpdate':function(_0x1854a9,_0x264620,_0x3781d6){var _0x6a832d=_0x21159f[_0xf8f9('0x17')];var _0x5bc6c6=_0x1854a9[_0xf8f9('0x18')]({'plain':!![]});if(_0x5bc6c6[_0xf8f9('0x19')]){return _0x6a832d[_0xf8f9('0x1a')][_0xf8f9('0x1b')]({'read':!![]},{'where':{'MailInteractionId':_0x5bc6c6['id']}})['then'](function(){_0x3781d6();})[_0xf8f9('0x1c')](function(_0x12c6c1){_0x3781d6(_0x12c6c1);});}else{_0x3781d6();}}},'charset':'utf8mb4','collate':_0xf8f9('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 1058de8..1ec2bb1 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 _0x7b05=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','stringify','AddTagsToMailInteraction','addTags','ids','spread','AddTags','lodash','util','moment'];(function(_0x7f1247,_0x20ede0){var _0x374bda=function(_0x192bac){while(--_0x192bac){_0x7f1247['push'](_0x7f1247['shift']());}};_0x374bda(++_0x20ede0);}(_0x7b05,0x91));var _0x57b0=function(_0x2ecc65,_0xd75c48){_0x2ecc65=_0x2ecc65-0x0;var _0x103cc3=_0x7b05[_0x2ecc65];return _0x103cc3;};'use strict';var _=require(_0x57b0('0x0'));var util=require(_0x57b0('0x1'));var moment=require(_0x57b0('0x2'));var BPromise=require(_0x57b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57b0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x57b0('0x5'));var logger=require(_0x57b0('0x6'))(_0x57b0('0x7'));var config=require(_0x57b0('0x8'));var jayson=require(_0x57b0('0x9'));var client=jayson['client'][_0x57b0('0xa')]({'port':0x232a});config['redis']=_[_0x57b0('0xb')](config[_0x57b0('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0x57b0('0xd')](socket);function respondWithRpcPromise(_0x3faabd,_0x58b35b,_0x51034a){return new BPromise(function(_0x55b609,_0x2843dc){return client[_0x57b0('0xe')](_0x3faabd,_0x51034a)[_0x57b0('0xf')](function(_0x2e9979){logger[_0x57b0('0x10')](_0x57b0('0x11'),_0x58b35b,'request\x20sent');logger[_0x57b0('0x12')](_0x57b0('0x13'),_0x58b35b,_0x57b0('0x14'),JSON['stringify'](_0x2e9979));if(_0x2e9979['error']){if(_0x2e9979[_0x57b0('0x15')][_0x57b0('0x16')]===0x1f4){logger[_0x57b0('0x15')](_0x57b0('0x11'),_0x58b35b,_0x2e9979['error'][_0x57b0('0x17')]);return _0x2843dc(_0x2e9979['error'][_0x57b0('0x17')]);}logger[_0x57b0('0x15')]('MailInteraction,\x20%s,\x20%s',_0x58b35b,_0x2e9979[_0x57b0('0x15')][_0x57b0('0x17')]);return _0x55b609(_0x2e9979[_0x57b0('0x15')][_0x57b0('0x17')]);}else{logger[_0x57b0('0x10')]('MailInteraction,\x20%s,\x20%s',_0x58b35b,_0x57b0('0x14'));_0x55b609(_0x2e9979['result']['message']);}})[_0x57b0('0x18')](function(_0x26c6ed){logger[_0x57b0('0x15')](_0x57b0('0x11'),_0x58b35b,_0x26c6ed);_0x2843dc(_0x26c6ed);});});}exports[_0x57b0('0x19')]=function(_0x28af98){var _0x568276=this;return new Promise(function(_0x19fafd,_0x1d81ff){return db[_0x57b0('0x1a')]['update'](_0x28af98[_0x57b0('0x1b')],{'raw':_0x28af98[_0x57b0('0x1c')]?_0x28af98[_0x57b0('0x1c')][_0x57b0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28af98[_0x57b0('0x1c')]?_0x28af98[_0x57b0('0x1c')][_0x57b0('0x1e')]||null:null,'attributes':_0x28af98[_0x57b0('0x1c')]?_0x28af98[_0x57b0('0x1c')]['attributes']||null:null,'limit':_0x28af98['options']?_0x28af98[_0x57b0('0x1c')]['limit']||null:null})[_0x57b0('0xf')](function(_0x3ce739){logger[_0x57b0('0x10')](_0x57b0('0x19'),_0x28af98);logger[_0x57b0('0x12')](_0x57b0('0x19'),_0x28af98,JSON[_0x57b0('0x1f')](_0x3ce739));_0x19fafd(_0x3ce739);})[_0x57b0('0x18')](function(_0xacd07c){logger[_0x57b0('0x15')](_0x57b0('0x19'),_0xacd07c[_0x57b0('0x17')],_0x28af98);_0x1d81ff(_0x568276[_0x57b0('0x15')](0x1f4,_0xacd07c['message']));});});};exports[_0x57b0('0x20')]=function(_0x114cd7){return new Promise(function(_0xf8e773,_0x228dfe){return db['MailInteraction']['find']({'where':_0x114cd7[_0x57b0('0x1c')]?_0x114cd7[_0x57b0('0x1c')][_0x57b0('0x1e')]||null:null})['then'](function(_0x52d2bc){if(_0x52d2bc){return _0x52d2bc[_0x57b0('0x21')](_0x114cd7['body'][_0x57b0('0x22')],_['omit'](_0x114cd7['body'],[_0x57b0('0x22'),'id'])||{});}})[_0x57b0('0x23')](function(_0x5e2961){logger[_0x57b0('0x10')](_0x57b0('0x24'),_0x114cd7);logger['debug'](_0x57b0('0x24'),_0x114cd7,JSON[_0x57b0('0x1f')](_0x5e2961));_0xf8e773(_0x5e2961);})[_0x57b0('0x18')](function(_0x547ea6){logger[_0x57b0('0x15')](_0x57b0('0x24'),_0x547ea6[_0x57b0('0x17')],_0x114cd7);_0x228dfe(_this[_0x57b0('0x15')](0x1f4,_0x547ea6[_0x57b0('0x17')]));});});}; \ No newline at end of file +var _0x6599=['info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','attributes','limit','debug','AddTagsToMailInteraction','where','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','register','then'];(function(_0x5bd77e,_0x481b3e){var _0x11d377=function(_0x3272c1){while(--_0x3272c1){_0x5bd77e['push'](_0x5bd77e['shift']());}};_0x11d377(++_0x481b3e);}(_0x6599,0xb0));var _0x9659=function(_0x2a0350,_0x249319){_0x2a0350=_0x2a0350-0x0;var _0x425220=_0x6599[_0x2a0350];return _0x425220;};'use strict';var _=require('lodash');var util=require(_0x9659('0x0'));var moment=require(_0x9659('0x1'));var BPromise=require(_0x9659('0x2'));var rs=require(_0x9659('0x3'));var fs=require('fs');var Redis=require(_0x9659('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9659('0x5'));var logger=require('../../config/logger')(_0x9659('0x6'));var config=require('../../config/environment');var jayson=require(_0x9659('0x7'));var client=jayson[_0x9659('0x8')][_0x9659('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9659('0xa')],{'host':_0x9659('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9659('0xa')]));require('./mailInteraction.socket')[_0x9659('0xc')](socket);function respondWithRpcPromise(_0x194d48,_0x58552a,_0x147cac){return new BPromise(function(_0x25a460,_0x349cfb){return client['request'](_0x194d48,_0x147cac)[_0x9659('0xd')](function(_0x520848){logger[_0x9659('0xe')](_0x9659('0xf'),_0x58552a,_0x9659('0x10'));logger['debug'](_0x9659('0x11'),_0x58552a,_0x9659('0x10'),JSON[_0x9659('0x12')](_0x520848));if(_0x520848[_0x9659('0x13')]){if(_0x520848[_0x9659('0x13')][_0x9659('0x14')]===0x1f4){logger[_0x9659('0x13')](_0x9659('0xf'),_0x58552a,_0x520848[_0x9659('0x13')][_0x9659('0x15')]);return _0x349cfb(_0x520848[_0x9659('0x13')][_0x9659('0x15')]);}logger[_0x9659('0x13')](_0x9659('0xf'),_0x58552a,_0x520848['error'][_0x9659('0x15')]);return _0x25a460(_0x520848[_0x9659('0x13')][_0x9659('0x15')]);}else{logger[_0x9659('0xe')](_0x9659('0xf'),_0x58552a,_0x9659('0x10'));_0x25a460(_0x520848[_0x9659('0x16')][_0x9659('0x15')]);}})[_0x9659('0x17')](function(_0x525d27){logger[_0x9659('0x13')](_0x9659('0xf'),_0x58552a,_0x525d27);_0x349cfb(_0x525d27);});});}exports[_0x9659('0x18')]=function(_0x582039){var _0x2d06ea=this;return new Promise(function(_0x52b880,_0x301c36){return db[_0x9659('0x19')][_0x9659('0x1a')](_0x582039[_0x9659('0x1b')],{'raw':_0x582039[_0x9659('0x1c')]?_0x582039[_0x9659('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x582039[_0x9659('0x1c')]?_0x582039[_0x9659('0x1c')]['where']||null:null,'attributes':_0x582039[_0x9659('0x1c')]?_0x582039[_0x9659('0x1c')][_0x9659('0x1d')]||null:null,'limit':_0x582039['options']?_0x582039[_0x9659('0x1c')][_0x9659('0x1e')]||null:null})[_0x9659('0xd')](function(_0x46f3c6){logger[_0x9659('0xe')]('UpdateMailInteraction',_0x582039);logger[_0x9659('0x1f')](_0x9659('0x18'),_0x582039,JSON[_0x9659('0x12')](_0x46f3c6));_0x52b880(_0x46f3c6);})[_0x9659('0x17')](function(_0x5d8d0f){logger[_0x9659('0x13')](_0x9659('0x18'),_0x5d8d0f[_0x9659('0x15')],_0x582039);_0x301c36(_0x2d06ea[_0x9659('0x13')](0x1f4,_0x5d8d0f['message']));});});};exports[_0x9659('0x20')]=function(_0x4795d1){return new Promise(function(_0x326e47,_0x5bf928){return db[_0x9659('0x19')]['find']({'where':_0x4795d1['options']?_0x4795d1[_0x9659('0x1c')][_0x9659('0x21')]||null:null})['then'](function(_0x1396e9){if(_0x1396e9){return _0x1396e9['addTags'](_0x4795d1[_0x9659('0x1b')][_0x9659('0x22')],_[_0x9659('0x23')](_0x4795d1[_0x9659('0x1b')],[_0x9659('0x22'),'id'])||{});}})[_0x9659('0x24')](function(_0x24f2a5){logger['info'](_0x9659('0x25'),_0x4795d1);logger[_0x9659('0x1f')](_0x9659('0x25'),_0x4795d1,JSON['stringify'](_0x24f2a5));_0x326e47(_0x24f2a5);})[_0x9659('0x17')](function(_0x1eac07){logger['error'](_0x9659('0x25'),_0x1eac07[_0x9659('0x15')],_0x4795d1);_0x5bf928(_this['error'](0x1f4,_0x1eac07[_0x9659('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 9b1eeb1..0d192a4 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 _0x738c=['removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x407975,_0x2c0ebc){var _0x270481=function(_0x2837e9){while(--_0x2837e9){_0x407975['push'](_0x407975['shift']());}};_0x270481(++_0x2c0ebc);}(_0x738c,0x1c4));var _0xc738=function(_0x33ed27,_0x28c8f7){_0x33ed27=_0x33ed27-0x0;var _0xe81b8c=_0x738c[_0x33ed27];return _0xe81b8c;};'use strict';var MailInteractionEvents=require(_0xc738('0x0'));var events=[_0xc738('0x1'),_0xc738('0x2'),'update'];function createListener(_0x51e6ab,_0x1f0e72){return function(_0x661aa4){_0x1f0e72['emit'](_0x51e6ab,_0x661aa4);};}function removeListener(_0x2249e6,_0x3b6fe3){return function(){MailInteractionEvents[_0xc738('0x3')](_0x2249e6,_0x3b6fe3);};}exports[_0xc738('0x4')]=function(_0x47cdbd){for(var _0x383efb=0x0,_0x45e8aa=events[_0xc738('0x5')];_0x383efb<_0x45e8aa;_0x383efb++){var _0x3327b6=events[_0x383efb];var _0x43420d=createListener(_0xc738('0x6')+_0x3327b6,_0x47cdbd);MailInteractionEvents['on'](_0x3327b6,_0x43420d);}}; \ No newline at end of file +var _0x3e38=['mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x30f5bb,_0x4db4bd){var _0x1cfc00=function(_0x20f833){while(--_0x20f833){_0x30f5bb['push'](_0x30f5bb['shift']());}};_0x1cfc00(++_0x4db4bd);}(_0x3e38,0x1f0));var _0x83e3=function(_0x4adcf2,_0x73eafd){_0x4adcf2=_0x4adcf2-0x0;var _0x4e11d4=_0x3e38[_0x4adcf2];return _0x4e11d4;};'use strict';var MailInteractionEvents=require(_0x83e3('0x0'));var events=[_0x83e3('0x1'),_0x83e3('0x2'),_0x83e3('0x3')];function createListener(_0x22dc35,_0x48134b){return function(_0x36a0f9){_0x48134b[_0x83e3('0x4')](_0x22dc35,_0x36a0f9);};}function removeListener(_0x3e3db6,_0x10e5d0){return function(){MailInteractionEvents[_0x83e3('0x5')](_0x3e3db6,_0x10e5d0);};}exports[_0x83e3('0x6')]=function(_0x4e41f0){for(var _0x2795f4=0x0,_0x20a0fc=events[_0x83e3('0x7')];_0x2795f4<_0x20a0fc;_0x2795f4++){var _0x5137d4=events[_0x2795f4];var _0x75f659=createListener(_0x83e3('0x8')+_0x5137d4,_0x4e41f0);MailInteractionEvents['on'](_0x5137d4,_0x75f659);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index faf5813..2373bd6 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 _0x9957=['download','post','mail','mailmessage:create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./mailMessage.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),interaction['tracked'](_0x7995('0x11'),_0x7995('0x12')),controller['create']);router[_0x7995('0x13')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x13')](_0x7995('0x15'),auth[_0x7995('0x9')](),controller['accept']);router['put'](_0x7995('0x16'),auth[_0x7995('0x9')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x19')]);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _0x84ab=['reject','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x39ae29,_0x3a8d55){var _0x3c9af0=function(_0x2bf23b){while(--_0x2bf23b){_0x39ae29['push'](_0x39ae29['shift']());}};_0x3c9af0(++_0x3a8d55);}(_0x84ab,0x12f));var _0xb84a=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0x84ab[_0x15fc3c];return _0x94c5c8;};'use strict';var multer=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var path=require(_0xb84a('0x2'));var timeout=require(_0xb84a('0x3'));var express=require(_0xb84a('0x4'));var router=express['Router']();var auth=require(_0xb84a('0x5'));var interaction=require(_0xb84a('0x6'));var config=require('../../config/environment');var controller=require(_0xb84a('0x7'));router[_0xb84a('0x8')]('/',auth[_0xb84a('0x9')](),controller['index']);router['get']('/describe',auth[_0xb84a('0x9')](),controller['describe']);router[_0xb84a('0x8')](_0xb84a('0xa'),auth['isAuthenticated'](),controller[_0xb84a('0xb')]);router['get'](_0xb84a('0xc'),auth[_0xb84a('0x9')](),controller[_0xb84a('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xb84a('0xe'),_0xb84a('0xf')),controller[_0xb84a('0x10')]);router[_0xb84a('0x11')](_0xb84a('0xa'),auth['isAuthenticated'](),controller[_0xb84a('0x12')]);router[_0xb84a('0x11')](_0xb84a('0x13'),auth[_0xb84a('0x9')](),controller[_0xb84a('0x14')]);router[_0xb84a('0x11')](_0xb84a('0x15'),auth[_0xb84a('0x9')](),controller[_0xb84a('0x16')]);router[_0xb84a('0x17')](_0xb84a('0xa'),auth[_0xb84a('0x9')](),controller['destroy']);module[_0xb84a('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 2730eb6..e03e340 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 _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(_0x5d9947,_0x459f22){_0x5d9947=_0x5d9947-0x0;var _0x1c09e5=_0x078f[_0x5d9947];return _0x1c09e5;};'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 +var _0x5f2f=['BOOLEAN','out','STRING','INTEGER','DATE','sequelize','lodash','exports','TEXT','long','medium'];(function(_0x33d233,_0xa4d74){var _0x5e67d3=function(_0x5a958d){while(--_0x5a958d){_0x33d233['push'](_0x33d233['shift']());}};_0x5e67d3(++_0xa4d74);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5acd55,_0x31fe62){_0x5acd55=_0x5acd55-0x0;var _0x72f7d5=_0x5f2f[_0x5acd55];return _0x72f7d5;};'use strict';var Sequelize=require(_0xf5f2('0x0'));var _=require(_0xf5f2('0x1'));module[_0xf5f2('0x2')]={'body':{'type':Sequelize[_0xf5f2('0x3')](_0xf5f2('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x3')](_0xf5f2('0x5'))},'read':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xf5f2('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf5f2('0x8')](0x1fe)},'from':{'type':Sequelize[_0xf5f2('0x8')]},'to':{'type':Sequelize[_0xf5f2('0x3')](_0xf5f2('0x4'))},'cc':{'type':Sequelize[_0xf5f2('0x3')]('long')},'bcc':{'type':Sequelize[_0xf5f2('0x3')](_0xf5f2('0x4'))},'subject':{'type':Sequelize[_0xf5f2('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xf5f2('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xf5f2('0xa')]},'originTo':{'type':Sequelize['TEXT'](_0xf5f2('0x4'))},'originCc':{'type':Sequelize['TEXT']('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 20346af..f37e1c0 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 _0x9d7d=['basename','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','Contact','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','acceptMessage','manual','SIP/%s','channel','event','accept','EventManager','acceptmessage','mail-interactions','agent','get','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','interface','rejectmessage','download','toString','server','files','tmp','message-%s.eml','bcc','subject','Attachment','Attachments','from','createdAt','headers','Bcc','push','build','writeFileSync','log','err','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','MailMessage,\x20%s,\x20%s','message','catch','status','end','count','offset','limit','set','json','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','update','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','MailServerOut','Smtp','isNil','host','port','secure','auth','user','pass','service','attachments','join','root','server/files/attachments'];(function(_0x5574b7,_0x4f6158){var _0x3b3132=function(_0x56f4a7){while(--_0x56f4a7){_0x5574b7['push'](_0x5574b7['shift']());}};_0x3b3132(++_0x4f6158);}(_0x9d7d,0x18d));var _0xd9d7=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x9d7d[_0x4b7b62];return _0x2280df;};'use strict';var pdf=require(_0xd9d7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd9d7('0x1'));var zipdir=require(_0xd9d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd9d7('0x3'));var BPromise=require(_0xd9d7('0x4'));var Mustache=require(_0xd9d7('0x5'));var util=require(_0xd9d7('0x6'));var path=require(_0xd9d7('0x7'));var sox=require(_0xd9d7('0x8'));var csv=require(_0xd9d7('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd9d7('0xa'));var squel=require(_0xd9d7('0xb'));var crypto=require('crypto');var jsforce=require(_0xd9d7('0xc'));var deskjs=require(_0xd9d7('0xd'));var toCsv=require(_0xd9d7('0x9'));var querystring=require(_0xd9d7('0xe'));var Papa=require(_0xd9d7('0xf'));var Redis=require(_0xd9d7('0x10'));var authService=require(_0xd9d7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd9d7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd9d7('0x13'))(_0xd9d7('0x14'));var utils=require(_0xd9d7('0x15'));var config=require(_0xd9d7('0x16'));var db=require('../../mysqldb')['db'];config[_0xd9d7('0x17')]=_[_0xd9d7('0x18')](config[_0xd9d7('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xd9d7('0x19'))(new Redis(config[_0xd9d7('0x17')]));require('./mailMessage.socket')[_0xd9d7('0x1a')](socket);var jayson=require(_0xd9d7('0x1b'));var client=jayson[_0xd9d7('0x1c')][_0xd9d7('0x1d')]({'port':0x232c});var client9003=jayson[_0xd9d7('0x1c')][_0xd9d7('0x1d')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x619a15,_0x336acd,_0x162bfb){if(_0x162bfb){var _0x217104=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x217104['test'](_0x336acd)){return _0x619a15;}else{throw new db[(_0xd9d7('0x1e'))][(_0xd9d7('0x1f'))](_0xd9d7('0x20'));}}else{return _0x619a15;}}function respondWithRpcPromise(_0x15eafe,_0x39f08b,_0xb48c2d,_0x12a3c6){return new BPromise(function(_0x38997c,_0x26386e){var _0x11f5b2=_0x12a3c6||client;return _0x11f5b2[_0xd9d7('0x21')](_0x15eafe,_0xb48c2d)[_0xd9d7('0x22')](function(_0x4392f7){logger[_0xd9d7('0x23')]('MailMessage,\x20%s,\x20%s',_0x39f08b,_0xd9d7('0x24'));logger[_0xd9d7('0x25')](_0xd9d7('0x26'),_0x39f08b,'request\x20sent',JSON[_0xd9d7('0x27')](_0x4392f7));if(_0x4392f7['error']){if(_0x4392f7['error'][_0xd9d7('0x28')]===0x1f4){logger[_0xd9d7('0x29')](_0xd9d7('0x2a'),_0x39f08b,_0x4392f7[_0xd9d7('0x29')]['message']);return _0x26386e(_0x4392f7[_0xd9d7('0x29')]['message']);}logger[_0xd9d7('0x29')]('MailMessage,\x20%s,\x20%s',_0x39f08b,_0x4392f7[_0xd9d7('0x29')][_0xd9d7('0x2b')]);return _0x38997c(_0x4392f7['error']['message']);}else{logger[_0xd9d7('0x23')](_0xd9d7('0x2a'),_0x39f08b,_0xd9d7('0x24'));_0x38997c(_0x4392f7['result']['message']);}})[_0xd9d7('0x2c')](function(_0x1c362e){logger[_0xd9d7('0x29')]('MailMessage,\x20%s,\x20%s',_0x39f08b,_0x1c362e);_0x26386e(_0x1c362e);});});}function respondWithStatusCode(_0x57a3fc,_0x175e38){_0x175e38=_0x175e38||0xcc;return function(_0x41332e){if(_0x41332e){return _0x57a3fc['sendStatus'](_0x175e38);}return _0x57a3fc[_0xd9d7('0x2d')](_0x175e38)[_0xd9d7('0x2e')]();};}function respondWithResult(_0x2c9e1c,_0x274b35){_0x274b35=_0x274b35||0xc8;return function(_0x5a690c){if(_0x5a690c){return _0x2c9e1c[_0xd9d7('0x2d')](_0x274b35)['json'](_0x5a690c);}};}function respondWithFilteredResult(_0x53002c,_0x323665){return function(_0x3be110){if(_0x3be110){var _0x175fb8=_0x3be110[_0xd9d7('0x2f')],_0x1ecd46=_0x323665[_0xd9d7('0x30')],_0xa0c04a=_0x323665['offset']+_0x323665[_0xd9d7('0x31')],_0x30b972;if(_0xa0c04a>=_0x175fb8){_0xa0c04a=_0x175fb8;_0x30b972=0xc8;}else{_0x30b972=0xce;}_0x53002c['status'](_0x30b972);return _0x53002c[_0xd9d7('0x32')]('Content-Range',_0x1ecd46+'-'+_0xa0c04a+'/'+_0x175fb8)[_0xd9d7('0x33')](_0x3be110);}return null;};}function patchUpdates(_0x405f12){return function(_0x27694c){try{jsonpatch[_0xd9d7('0x34')](_0x27694c,_0x405f12,!![]);}catch(_0x506985){return BPromise[_0xd9d7('0x35')](_0x506985);}return _0x27694c[_0xd9d7('0x36')]();};}function saveUpdates(_0x35e147,_0x287b0b){return function(_0x22b55d){if(_0x22b55d){return _0x22b55d['update'](_0x35e147)[_0xd9d7('0x22')](function(_0x5131a1){return _0x5131a1;});}return null;};}function removeEntity(_0x54ecb9,_0x3e959f){return function(_0x30948f){if(_0x30948f){return _0x30948f[_0xd9d7('0x37')]()[_0xd9d7('0x22')](function(){_0x54ecb9[_0xd9d7('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f4fd9,_0x420b5a){return function(_0x1a5e4f){if(!_0x1a5e4f){_0x3f4fd9[_0xd9d7('0x38')](0x194);}return _0x1a5e4f;};}function handleError(_0xe41604,_0x513c83){_0x513c83=_0x513c83||0x1f4;return function(_0x119af1){logger[_0xd9d7('0x29')](_0x119af1[_0xd9d7('0x39')]);if(_0x119af1[_0xd9d7('0x3a')]){delete _0x119af1['name'];}_0xe41604[_0xd9d7('0x2d')](_0x513c83)[_0xd9d7('0x3b')](_0x119af1);};}exports[_0xd9d7('0x3c')]=function(_0x3d090b,_0x6e759a){var _0x1e3282={},_0x4a732e={},_0x57f53d={'count':0x0,'rows':[]};var _0x1d3cb7=_[_0xd9d7('0x3d')](db[_0xd9d7('0x3e')][_0xd9d7('0x3f')],function(_0x33226c){return{'name':_0x33226c[_0xd9d7('0x40')],'type':_0x33226c[_0xd9d7('0x41')][_0xd9d7('0x42')]};});_0x4a732e['model']=_['map'](_0x1d3cb7,'name');_0x4a732e[_0xd9d7('0x43')]=_[_0xd9d7('0x44')](_0x3d090b['query']);_0x4a732e[_0xd9d7('0x45')]=_[_0xd9d7('0x46')](_0x4a732e[_0xd9d7('0x47')],_0x4a732e['query']);_0x1e3282['attributes']=_[_0xd9d7('0x46')](_0x4a732e[_0xd9d7('0x47')],qs[_0xd9d7('0x48')](_0x3d090b['query'][_0xd9d7('0x48')]));_0x1e3282['attributes']=_0x1e3282[_0xd9d7('0x49')]['length']?_0x1e3282['attributes']:_0x4a732e[_0xd9d7('0x47')];if(!_0x3d090b[_0xd9d7('0x43')][_0xd9d7('0x4a')](_0xd9d7('0x4b'))){_0x1e3282[_0xd9d7('0x31')]=qs[_0xd9d7('0x31')](_0x3d090b[_0xd9d7('0x43')]['limit']);_0x1e3282[_0xd9d7('0x30')]=qs[_0xd9d7('0x30')](_0x3d090b[_0xd9d7('0x43')][_0xd9d7('0x30')]);}_0x1e3282[_0xd9d7('0x4c')]=qs[_0xd9d7('0x4d')](_0x3d090b['query'][_0xd9d7('0x4d')]);_0x1e3282['where']=qs[_0xd9d7('0x45')](_[_0xd9d7('0x4e')](_0x3d090b[_0xd9d7('0x43')],_0x4a732e['filters']));if(_0x3d090b[_0xd9d7('0x43')][_0xd9d7('0x4f')]){_0x1e3282[_0xd9d7('0x50')]=_[_0xd9d7('0x51')](_0x1e3282[_0xd9d7('0x50')],{'$or':_['map'](_0x1d3cb7,function(_0x3d0262){if(_0x3d0262[_0xd9d7('0x41')]!==_0xd9d7('0x52')){var _0x493e19={};_0x493e19[_0x3d0262['name']]={'$like':'%'+_0x3d090b[_0xd9d7('0x43')][_0xd9d7('0x4f')]+'%'};return _0x493e19;}})});}_0x1e3282=_['merge']({},_0x1e3282,_0x3d090b[_0xd9d7('0x53')]);var _0x456bd2={'where':_0x1e3282[_0xd9d7('0x50')]};return db['MailMessage'][_0xd9d7('0x2f')](_0x456bd2)[_0xd9d7('0x22')](function(_0x2765a2){_0x57f53d[_0xd9d7('0x2f')]=_0x2765a2;if(_0x3d090b[_0xd9d7('0x43')][_0xd9d7('0x54')]){_0x1e3282[_0xd9d7('0x55')]=[{'all':!![]}];}return db['MailMessage'][_0xd9d7('0x56')](_0x1e3282);})[_0xd9d7('0x22')](function(_0x1f3c28){_0x57f53d['rows']=_0x1f3c28;return _0x57f53d;})[_0xd9d7('0x22')](respondWithFilteredResult(_0x6e759a,_0x1e3282))['catch'](handleError(_0x6e759a,null));};exports[_0xd9d7('0x57')]=function(_0x9c5abc,_0x45bf84){var _0x4fb666={'raw':!![],'where':{'id':_0x9c5abc[_0xd9d7('0x58')]['id']}},_0x295d8c={};_0x295d8c[_0xd9d7('0x47')]=_['keys'](db[_0xd9d7('0x3e')][_0xd9d7('0x3f')]);_0x295d8c[_0xd9d7('0x43')]=_[_0xd9d7('0x44')](_0x9c5abc[_0xd9d7('0x43')]);_0x295d8c[_0xd9d7('0x45')]=_[_0xd9d7('0x46')](_0x295d8c['model'],_0x295d8c[_0xd9d7('0x43')]);_0x4fb666[_0xd9d7('0x49')]=_[_0xd9d7('0x46')](_0x295d8c[_0xd9d7('0x47')],qs[_0xd9d7('0x48')](_0x9c5abc[_0xd9d7('0x43')][_0xd9d7('0x48')]));_0x4fb666[_0xd9d7('0x49')]=_0x4fb666[_0xd9d7('0x49')][_0xd9d7('0x59')]?_0x4fb666[_0xd9d7('0x49')]:_0x295d8c[_0xd9d7('0x47')];if(_0x9c5abc['query'][_0xd9d7('0x54')]){_0x4fb666[_0xd9d7('0x55')]=[{'all':!![]}];}_0x4fb666=_[_0xd9d7('0x51')]({},_0x4fb666,_0x9c5abc[_0xd9d7('0x53')]);return db[_0xd9d7('0x3e')][_0xd9d7('0x5a')](_0x4fb666)[_0xd9d7('0x22')](handleEntityNotFound(_0x45bf84,null))['then'](respondWithResult(_0x45bf84,null))[_0xd9d7('0x2c')](handleError(_0x45bf84,null));};exports[_0xd9d7('0x5b')]=function(_0x5819ba,_0x53fd79){if(_0x5819ba[_0xd9d7('0x5c')]['id']){delete _0x5819ba[_0xd9d7('0x5c')]['id'];}return db['MailMessage'][_0xd9d7('0x5a')]({'where':{'id':_0x5819ba[_0xd9d7('0x58')]['id']}})[_0xd9d7('0x22')](handleEntityNotFound(_0x53fd79,null))[_0xd9d7('0x22')](saveUpdates(_0x5819ba[_0xd9d7('0x5c')],null))[_0xd9d7('0x22')](respondWithResult(_0x53fd79,null))[_0xd9d7('0x2c')](handleError(_0x53fd79,null));};exports[_0xd9d7('0x37')]=function(_0x1f4f3f,_0x52c7b3){return db[_0xd9d7('0x3e')][_0xd9d7('0x5a')]({'where':{'id':_0x1f4f3f[_0xd9d7('0x58')]['id']}})[_0xd9d7('0x22')](handleEntityNotFound(_0x52c7b3,null))[_0xd9d7('0x22')](removeEntity(_0x52c7b3,null))[_0xd9d7('0x2c')](handleError(_0x52c7b3,null));};exports['describe']=function(_0x3586f7,_0x44d0b2){return db[_0xd9d7('0x3e')][_0xd9d7('0x5d')]()[_0xd9d7('0x22')](respondWithResult(_0x44d0b2,null))[_0xd9d7('0x2c')](handleError(_0x44d0b2,null));};exports['create']=function(_0x4ca8dc,_0x19ca16){return db[_0xd9d7('0x3e')][_0xd9d7('0x5e')](_0x4ca8dc['body'])[_0xd9d7('0x22')](function(_0x3826e0){if(_0x3826e0){if(_0x3826e0[_0xd9d7('0x5f')]===_0xd9d7('0x60')&&!_0x3826e0[_0xd9d7('0x61')]){var _0x1ff158,_0x39e0ff,_0x5bcf16;if(_0x4ca8dc[_0xd9d7('0x5c')]['to']){_0x39e0ff=_0x4ca8dc[_0xd9d7('0x5c')]['to'][_0xd9d7('0x62')](',')[0x0];}return db[_0xd9d7('0x63')][_0xd9d7('0x64')]({'where':{'id':_0x3826e0[_0xd9d7('0x65')]},'include':[{'model':db['CmList'],'as':_0xd9d7('0x66'),'include':[{'model':db[_0xd9d7('0x67')],'as':_0xd9d7('0x68'),'where':{'email':_0x39e0ff},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xd9d7('0x69')],'as':'Smtp','raw':!![]}]})[_0xd9d7('0x22')](function(_0x2972c7){_0x1ff158=_0x2972c7;if(_0x1ff158&&_0x1ff158[_0xd9d7('0x6a')]){var _0x2b6284={'tls':{'rejectUnauthorized':![]}};if(_[_0xd9d7('0x6b')](_0x1ff158['Smtp']['service'])){_0x2b6284['host']=_0x1ff158[_0xd9d7('0x6a')][_0xd9d7('0x6c')];_0x2b6284['port']=_0x1ff158[_0xd9d7('0x6a')][_0xd9d7('0x6d')];_0x2b6284[_0xd9d7('0x6e')]=_0x1ff158[_0xd9d7('0x6a')]['secure'];if(_0x1ff158['Smtp']['authentication']){_0x2b6284[_0xd9d7('0x6f')]={'user':_0x1ff158[_0xd9d7('0x6a')][_0xd9d7('0x70')],'pass':_0x1ff158[_0xd9d7('0x6a')][_0xd9d7('0x71')]};}}else{_0x2b6284[_0xd9d7('0x72')]=_0x1ff158['Smtp'][_0xd9d7('0x72')];_0x2b6284[_0xd9d7('0x6f')]={'user':_0x1ff158[_0xd9d7('0x6a')]['user'],'pass':_0x1ff158['Smtp'][_0xd9d7('0x71')]};_0x2b6284[_0xd9d7('0x6e')]=_0x1ff158['Smtp'][_0xd9d7('0x6e')];}if(_0x4ca8dc[_0xd9d7('0x5c')][_0xd9d7('0x73')]&&_0x4ca8dc[_0xd9d7('0x5c')][_0xd9d7('0x73')][_0xd9d7('0x59')]){for(var _0xaa1a94=0x0;_0xaa1a94<_0x4ca8dc[_0xd9d7('0x5c')][_0xd9d7('0x73')]['length'];_0xaa1a94+=0x1){_0x4ca8dc[_0xd9d7('0x5c')][_0xd9d7('0x73')][_0xaa1a94]={'filename':_0x4ca8dc[_0xd9d7('0x5c')][_0xd9d7('0x73')][_0xaa1a94]['name'],'path':path[_0xd9d7('0x74')](config[_0xd9d7('0x75')],_0xd9d7('0x76'),_0x4ca8dc[_0xd9d7('0x5c')][_0xd9d7('0x73')][_0xaa1a94][_0xd9d7('0x77')])};}}_0x5bcf16={'account':_0x2b6284,'message':_0x4ca8dc[_0xd9d7('0x5c')]};return;}})[_0xd9d7('0x22')](function(){if(_0x1ff158[_0xd9d7('0x66')]){if(_0x1ff158['List']['Contacts'][_0xd9d7('0x59')]){return _0x1ff158[_0xd9d7('0x66')][_0xd9d7('0x68')][0x0];}else{return db[_0xd9d7('0x67')][_0xd9d7('0x5e')](_['defaults'](_0x4ca8dc[_0xd9d7('0x5c')],{'firstName':_0x4ca8dc[_0xd9d7('0x5c')]['to'],'email':_0x4ca8dc[_0xd9d7('0x5c')]['to'],'phone':_0x4ca8dc['body']['to'],'ListId':_0x1ff158[_0xd9d7('0x78')]}));}}else{throw new Error(_0xd9d7('0x79'));}})['then'](function(){if(_0x5bcf16){return respondWithRpcPromise('SendMail',_0xd9d7('0x7a'),_0x5bcf16,client9003)[_0xd9d7('0x22')](function(_0x54666f){return _0x3826e0[_0xd9d7('0x5b')]({'read':!![],'messageId':_0x54666f[_0xd9d7('0x7b')],'sentAt':moment()[_0xd9d7('0x7c')](_0xd9d7('0x7d'))});})['catch'](function(_0x3d630b){logger[_0xd9d7('0x29')]('%s',JSON[_0xd9d7('0x27')](_0x3d630b));return _0x3826e0;});}return _0x3826e0;});}return _0x3826e0;}})['then'](respondWithResult(_0x19ca16,0xc9))[_0xd9d7('0x2c')](handleError(_0x19ca16,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports['accept']=function(_0x5aa0fd,_0x540ea8,_0x55144b){var _0x3540cd={'channel':_0xd9d7('0x7e')};if(_0x5aa0fd['body']['id']){delete _0x5aa0fd[_0xd9d7('0x5c')]['id'];}_0x5aa0fd['body'][_0xd9d7('0x7f')]=!![];_0x5aa0fd['body'][_0xd9d7('0x80')]=moment()['format'](_0xd9d7('0x7d'));_0x5aa0fd[_0xd9d7('0x5c')][_0xd9d7('0x81')]=_0x5aa0fd[_0xd9d7('0x5c')]['UserId']||_0x5aa0fd[_0xd9d7('0x70')]['id'];return db[_0xd9d7('0x3e')][_0xd9d7('0x5a')]({'where':{'id':_0x5aa0fd[_0xd9d7('0x58')]['id'],'UserId':null},'include':[{'model':db[_0xd9d7('0x67')],'as':_0xd9d7('0x82')}]})[_0xd9d7('0x22')](handleEntityNotFound(_0x540ea8,null))['then'](saveUpdates(_0x5aa0fd[_0xd9d7('0x5c')],null))[_0xd9d7('0x22')](function(_0x157ad0){if(_0x157ad0){_0x3540cd[_0xd9d7('0x2b')]=_0x157ad0['get']({'plain':!![]});return db[_0xd9d7('0x83')][_0xd9d7('0x5a')]({'where':{'id':_0x157ad0['MailInteractionId']}});}return null;})[_0xd9d7('0x22')](handleEntityNotFound(_0x540ea8,null))[_0xd9d7('0x22')](function(_0x513380){if(_0x513380){return _0x513380[_0xd9d7('0x5b')]({'UserId':_0x5aa0fd[_0xd9d7('0x5c')][_0xd9d7('0x81')],'read1stAt':_[_0xd9d7('0x6b')](_0x513380[_0xd9d7('0x84')])?moment()['format'](_0xd9d7('0x7d')):undefined});}return null;})[_0xd9d7('0x22')](function(_0x19a0f6){if(_0x19a0f6){_0x3540cd[_0xd9d7('0x85')]=_0x19a0f6['get']({'plain':!![]});interaction_log[_0xd9d7('0x23')](_0xd9d7('0x86'),_0x5aa0fd[_0xd9d7('0x70')]['id'],_0x5aa0fd[_0xd9d7('0x70')][_0xd9d7('0x3a')],_0x5aa0fd[_0xd9d7('0x70')]['role'],_0x3540cd[_0xd9d7('0x85')]['id'],_0x5aa0fd[_0xd9d7('0x5c')]?JSON[_0xd9d7('0x27')](_0x5aa0fd[_0xd9d7('0x5c')]):'null');return respondWithRpcPromise('AcceptMessage',_0xd9d7('0x87'),_0x3540cd);}return null;})[_0xd9d7('0x22')](function(_0x140630){if(_0x140630){if(_0x5aa0fd['body'][_0xd9d7('0x88')]){_0x3540cd[_0xd9d7('0x2b')]['interface']=util[_0xd9d7('0x7c')](_0xd9d7('0x89'),_0x5aa0fd[_0xd9d7('0x70')]['name']);_0x3540cd[_0xd9d7('0x2b')][_0xd9d7('0x8a')]=_0x3540cd[_0xd9d7('0x8a')];_0x3540cd[_0xd9d7('0x2b')][_0xd9d7('0x8b')]=_0xd9d7('0x8c');return respondWithRpcPromise(_0xd9d7('0x8d'),'EventManager',{'event':_0xd9d7('0x8e'),'message':_0x3540cd[_0xd9d7('0x2b')]},client9002)[_0xd9d7('0x22')](function(){return _0x3540cd;});}return _0x3540cd;}return null;})['then'](respondWithResult(_0x540ea8,null))['catch'](handleError(_0x540ea8,null));};var interaction_log=require(_0xd9d7('0x13'))(_0xd9d7('0x8f'));exports[_0xd9d7('0x35')]=function(_0x1212d2,_0x256079,_0x4c0fd5){var _0x5dfdf3={'agent':{},'channel':_0xd9d7('0x7e')};if(_0x1212d2[_0xd9d7('0x5c')]['id']){delete _0x1212d2['body']['id'];}_0x1212d2[_0xd9d7('0x5c')][_0xd9d7('0x81')]=_0x1212d2['body'][_0xd9d7('0x81')]||_0x1212d2[_0xd9d7('0x70')]['id'];_0x5dfdf3[_0xd9d7('0x90')]['id']=_0x1212d2[_0xd9d7('0x5c')][_0xd9d7('0x81')];return db[_0xd9d7('0x3e')][_0xd9d7('0x5a')]({'where':{'id':_0x1212d2[_0xd9d7('0x58')]['id'],'UserId':null}})[_0xd9d7('0x22')](handleEntityNotFound(_0x256079,null))[_0xd9d7('0x22')](function(_0x501e81){if(_0x501e81){_0x5dfdf3[_0xd9d7('0x2b')]=_0x501e81[_0xd9d7('0x91')]({'plain':!![]});return db['MailInteraction'][_0xd9d7('0x5a')]({'where':{'id':_0x501e81['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x256079,null))[_0xd9d7('0x22')](function(_0x5bf6c7){if(_0x5bf6c7){_0x5dfdf3['interaction']=_0x5bf6c7['get']({'plain':!![]});interaction_log[_0xd9d7('0x23')](_0xd9d7('0x92'),_0x1212d2[_0xd9d7('0x70')]['id'],_0x1212d2[_0xd9d7('0x70')]['name'],_0x1212d2[_0xd9d7('0x70')][_0xd9d7('0x93')],_0x5dfdf3['interaction']['id'],_0x1212d2[_0xd9d7('0x5c')]?JSON[_0xd9d7('0x27')](_0x1212d2[_0xd9d7('0x5c')]):_0xd9d7('0x94'));return respondWithRpcPromise(_0xd9d7('0x95'),_0xd9d7('0x96'),_0x5dfdf3);}return null;})[_0xd9d7('0x22')](function(_0x4ff36f){if(_0x4ff36f){_0x4ff36f['message'][_0xd9d7('0x97')]=util[_0xd9d7('0x7c')](_0xd9d7('0x89'),_0x1212d2['user'][_0xd9d7('0x3a')]);_0x4ff36f['message'][_0xd9d7('0x8a')]=_0x5dfdf3[_0xd9d7('0x8a')];_0x4ff36f[_0xd9d7('0x2b')][_0xd9d7('0x8b')]='reject';respondWithRpcPromise(_0xd9d7('0x8d'),'EventManager',{'event':_0xd9d7('0x98'),'message':_0x4ff36f[_0xd9d7('0x2b')]},client9002);return _0x5dfdf3;}return null;})[_0xd9d7('0x22')](respondWithResult(_0x256079,null))[_0xd9d7('0x2c')](handleError(_0x256079,null));};exports[_0xd9d7('0x99')]=function(_0x262e94,_0x59d7bb){var _0x81adcc=moment()['unix']()[_0xd9d7('0x9a')]();var _0xeba87f=path['join'](config['root'],_0xd9d7('0x9b'),_0xd9d7('0x9c'),_0xd9d7('0x9d'));var _0x580bb1=path['join'](config[_0xd9d7('0x75')],'server',_0xd9d7('0x9c'),_0xd9d7('0x73'));var _0x9bc101=util[_0xd9d7('0x7c')](_0xd9d7('0x9e'),_0x81adcc);return db['MailMessage']['find']({'where':{'id':_0x262e94[_0xd9d7('0x58')]['id']},'attributes':['id',_0xd9d7('0x5c'),'from','to','cc',_0xd9d7('0x9f'),_0xd9d7('0xa0'),'createdAt'],'include':_0x262e94[_0xd9d7('0x43')]['attachments']?[{'model':db[_0xd9d7('0xa1')],'as':_0xd9d7('0xa2')}]:undefined})[_0xd9d7('0x22')](handleEntityNotFound(_0x59d7bb,null))[_0xd9d7('0x22')](function(_0x1353be){if(_0x1353be){var _0x368669=_0x1353be;var _0x916a90={'from':_0x368669[_0xd9d7('0xa3')],'to':_0x368669['to'],'subject':_0x368669['subject'],'html':_0x368669[_0xd9d7('0x5c')],'headers':{'Date':moment(_0x368669[_0xd9d7('0xa4')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1353be['cc']){_0x916a90[_0xd9d7('0xa5')]['Cc']=_0x1353be['cc'];}if(_0x1353be[_0xd9d7('0x9f')]){_0x916a90[_0xd9d7('0xa5')][_0xd9d7('0xa6')]=_0x1353be['bcc'];}return new BPromise(function(_0x21d45b,_0x209c04){if(_0x1353be['Attachments']){for(var _0x2eb8af=0x0;_0x2eb8af<_0x1353be[_0xd9d7('0xa2')]['length'];_0x2eb8af++){var _0x4e7ff5=_0x1353be[_0xd9d7('0xa2')][_0x2eb8af];var _0x554594=path['join'](_0x580bb1,_0x4e7ff5[_0xd9d7('0x77')]);if(fs['existsSync'](_0x554594)){_0x916a90['attachments'][_0xd9d7('0xa7')]({'name':_0x4e7ff5[_0xd9d7('0x3a')],'contentType':_0x4e7ff5[_0xd9d7('0x41')],'data':fs['readFileSync'](_0x554594)});}}}emlformat[_0xd9d7('0xa8')](_0x916a90,function(_0x5a8cd2,_0x12b1cd){if(_0x5a8cd2)return _0x209c04(_0x5a8cd2);fs[_0xd9d7('0xa9')](path[_0xd9d7('0x74')](_0xeba87f,_0x9bc101),_0x12b1cd);return _0x21d45b(_0x12b1cd);});});}})[_0xd9d7('0x22')](function(_0x5739a3){if(_0x5739a3){return _0x59d7bb[_0xd9d7('0x99')](path[_0xd9d7('0x74')](_0xeba87f,_0x9bc101),_0x9bc101,function(_0x51e0ea){if(_0x51e0ea){console[_0xd9d7('0xaa')](_0xd9d7('0xab'),_0x51e0ea);}else{fs['unlinkSync'](path['join'](_0xeba87f,_0x9bc101));}});}})[_0xd9d7('0x2c')](handleError(_0x59d7bb,null));}; \ No newline at end of file +var _0xb420=['offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','MailMessage','count','includeAll','include','findAll','show','params','rawAttributes','body','find','describe','create','direction','secret','split','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','Smtp','isNil','host','port','secure','authentication','auth','user','service','attachments','join','root','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','format','UserId','Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','mail-interactions','role','RejectMessage','download','unix','toString','files','server','from','bcc','Attachment','subject','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','localhost','register','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','sendStatus','status','json'];(function(_0x4fdfaf,_0x500b8d){var _0x55f36e=function(_0x4eb471){while(--_0x4eb471){_0x4fdfaf['push'](_0x4fdfaf['shift']());}};_0x55f36e(++_0x500b8d);}(_0xb420,0x1be));var _0x0b42=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb420[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x0b42('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0b42('0x1'));var jsonpatch=require(_0x0b42('0x2'));var rp=require(_0x0b42('0x3'));var moment=require(_0x0b42('0x4'));var BPromise=require(_0x0b42('0x5'));var Mustache=require(_0x0b42('0x6'));var util=require('util');var path=require(_0x0b42('0x7'));var sox=require(_0x0b42('0x8'));var csv=require(_0x0b42('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0b42('0xa'));var squel=require(_0x0b42('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0b42('0xc'));var toCsv=require(_0x0b42('0x9'));var querystring=require(_0x0b42('0xd'));var Papa=require(_0x0b42('0xe'));var Redis=require('ioredis');var authService=require(_0x0b42('0xf'));var qs=require(_0x0b42('0x10'));var as=require(_0x0b42('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b42('0x12'))(_0x0b42('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0b42('0x14'))['db'];config[_0x0b42('0x15')]=_[_0x0b42('0x16')](config[_0x0b42('0x15')],{'host':_0x0b42('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b42('0x15')]));require('./mailMessage.socket')[_0x0b42('0x18')](socket);var jayson=require(_0x0b42('0x19'));var client=jayson['client'][_0x0b42('0x1a')]({'port':0x232c});var client9003=jayson[_0x0b42('0x1b')][_0x0b42('0x1a')]({'port':0x232b});var client9002=jayson[_0x0b42('0x1b')][_0x0b42('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x26c414,_0x7251ce,_0x336860){if(_0x336860){var _0x4bc7b8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4bc7b8[_0x0b42('0x1c')](_0x7251ce)){return _0x26c414;}else{throw new db['Sequelize']['ValidationError'](_0x0b42('0x1d'));}}else{return _0x26c414;}}function respondWithRpcPromise(_0x5e1959,_0x2a2353,_0x29a5c2,_0x15fd00){return new BPromise(function(_0x1e2f1e,_0x43d520){var _0x2092f5=_0x15fd00||client;return _0x2092f5[_0x0b42('0x1e')](_0x5e1959,_0x29a5c2)['then'](function(_0x3a4af9){logger['info'](_0x0b42('0x1f'),_0x2a2353,_0x0b42('0x20'));logger[_0x0b42('0x21')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2a2353,_0x0b42('0x20'),JSON[_0x0b42('0x22')](_0x3a4af9));if(_0x3a4af9['error']){if(_0x3a4af9[_0x0b42('0x23')]['code']===0x1f4){logger[_0x0b42('0x23')](_0x0b42('0x1f'),_0x2a2353,_0x3a4af9[_0x0b42('0x23')][_0x0b42('0x24')]);return _0x43d520(_0x3a4af9[_0x0b42('0x23')][_0x0b42('0x24')]);}logger[_0x0b42('0x23')](_0x0b42('0x1f'),_0x2a2353,_0x3a4af9[_0x0b42('0x23')][_0x0b42('0x24')]);return _0x1e2f1e(_0x3a4af9['error'][_0x0b42('0x24')]);}else{logger[_0x0b42('0x25')]('MailMessage,\x20%s,\x20%s',_0x2a2353,'request\x20sent');_0x1e2f1e(_0x3a4af9[_0x0b42('0x26')]['message']);}})[_0x0b42('0x27')](function(_0xae9eaa){logger[_0x0b42('0x23')](_0x0b42('0x1f'),_0x2a2353,_0xae9eaa);_0x43d520(_0xae9eaa);});});}function respondWithStatusCode(_0x54711f,_0x57beb5){_0x57beb5=_0x57beb5||0xcc;return function(_0x11b584){if(_0x11b584){return _0x54711f[_0x0b42('0x28')](_0x57beb5);}return _0x54711f[_0x0b42('0x29')](_0x57beb5)['end']();};}function respondWithResult(_0x4eb4a2,_0x230d21){_0x230d21=_0x230d21||0xc8;return function(_0x380f4f){if(_0x380f4f){return _0x4eb4a2[_0x0b42('0x29')](_0x230d21)[_0x0b42('0x2a')](_0x380f4f);}};}function respondWithFilteredResult(_0x3a4a9a,_0x35978b){return function(_0x7e3341){if(_0x7e3341){var _0x1afdad=_0x7e3341['count'],_0x512340=_0x35978b[_0x0b42('0x2b')],_0x354fac=_0x35978b[_0x0b42('0x2b')]+_0x35978b[_0x0b42('0x2c')],_0x4a2f8b;if(_0x354fac>=_0x1afdad){_0x354fac=_0x1afdad;_0x4a2f8b=0xc8;}else{_0x4a2f8b=0xce;}_0x3a4a9a[_0x0b42('0x29')](_0x4a2f8b);return _0x3a4a9a[_0x0b42('0x2d')](_0x0b42('0x2e'),_0x512340+'-'+_0x354fac+'/'+_0x1afdad)[_0x0b42('0x2a')](_0x7e3341);}return null;};}function patchUpdates(_0x13a9df){return function(_0x418d6a){try{jsonpatch[_0x0b42('0x2f')](_0x418d6a,_0x13a9df,!![]);}catch(_0x5ef5be){return BPromise[_0x0b42('0x30')](_0x5ef5be);}return _0x418d6a[_0x0b42('0x31')]();};}function saveUpdates(_0x38a33a,_0x227245){return function(_0x5e4d12){if(_0x5e4d12){return _0x5e4d12[_0x0b42('0x32')](_0x38a33a)[_0x0b42('0x33')](function(_0x161ba4){return _0x161ba4;});}return null;};}function removeEntity(_0x3cc351,_0x2ed7a3){return function(_0xbc7c92){if(_0xbc7c92){return _0xbc7c92[_0x0b42('0x34')]()['then'](function(){_0x3cc351[_0x0b42('0x29')](0xcc)[_0x0b42('0x35')]();});}};}function handleEntityNotFound(_0x2aedb2,_0x9f2417){return function(_0x4391a3){if(!_0x4391a3){_0x2aedb2[_0x0b42('0x28')](0x194);}return _0x4391a3;};}function handleError(_0x45d042,_0x34525b){_0x34525b=_0x34525b||0x1f4;return function(_0x5a0c30){logger['error'](_0x5a0c30[_0x0b42('0x36')]);if(_0x5a0c30[_0x0b42('0x37')]){delete _0x5a0c30['name'];}_0x45d042[_0x0b42('0x29')](_0x34525b)[_0x0b42('0x38')](_0x5a0c30);};}exports[_0x0b42('0x39')]=function(_0x43bc7f,_0x3c80e8){var _0x33b386={},_0x3937cb={},_0xee00db={'count':0x0,'rows':[]};var _0x2d350e=_[_0x0b42('0x3a')](db['MailMessage']['rawAttributes'],function(_0x58d6d0){return{'name':_0x58d6d0['fieldName'],'type':_0x58d6d0[_0x0b42('0x3b')][_0x0b42('0x3c')]};});_0x3937cb[_0x0b42('0x3d')]=_[_0x0b42('0x3a')](_0x2d350e,_0x0b42('0x37'));_0x3937cb[_0x0b42('0x3e')]=_[_0x0b42('0x3f')](_0x43bc7f[_0x0b42('0x3e')]);_0x3937cb[_0x0b42('0x40')]=_[_0x0b42('0x41')](_0x3937cb[_0x0b42('0x3d')],_0x3937cb['query']);_0x33b386[_0x0b42('0x42')]=_[_0x0b42('0x41')](_0x3937cb[_0x0b42('0x3d')],qs[_0x0b42('0x43')](_0x43bc7f[_0x0b42('0x3e')][_0x0b42('0x43')]));_0x33b386[_0x0b42('0x42')]=_0x33b386[_0x0b42('0x42')][_0x0b42('0x44')]?_0x33b386[_0x0b42('0x42')]:_0x3937cb[_0x0b42('0x3d')];if(!_0x43bc7f[_0x0b42('0x3e')]['hasOwnProperty'](_0x0b42('0x45'))){_0x33b386[_0x0b42('0x2c')]=qs[_0x0b42('0x2c')](_0x43bc7f[_0x0b42('0x3e')]['limit']);_0x33b386[_0x0b42('0x2b')]=qs['offset'](_0x43bc7f[_0x0b42('0x3e')][_0x0b42('0x2b')]);}_0x33b386[_0x0b42('0x46')]=qs['sort'](_0x43bc7f['query'][_0x0b42('0x47')]);_0x33b386[_0x0b42('0x48')]=qs['filters'](_[_0x0b42('0x49')](_0x43bc7f[_0x0b42('0x3e')],_0x3937cb[_0x0b42('0x40')]));if(_0x43bc7f[_0x0b42('0x3e')][_0x0b42('0x4a')]){_0x33b386['where']=_[_0x0b42('0x4b')](_0x33b386['where'],{'$or':_[_0x0b42('0x3a')](_0x2d350e,function(_0x588fa2){if(_0x588fa2[_0x0b42('0x3b')]!=='VIRTUAL'){var _0x59b5c8={};_0x59b5c8[_0x588fa2['name']]={'$like':'%'+_0x43bc7f['query'][_0x0b42('0x4a')]+'%'};return _0x59b5c8;}})});}_0x33b386=_['merge']({},_0x33b386,_0x43bc7f[_0x0b42('0x4c')]);var _0x16e998={'where':_0x33b386[_0x0b42('0x48')]};return db[_0x0b42('0x4d')][_0x0b42('0x4e')](_0x16e998)[_0x0b42('0x33')](function(_0x4cd5b9){_0xee00db[_0x0b42('0x4e')]=_0x4cd5b9;if(_0x43bc7f['query'][_0x0b42('0x4f')]){_0x33b386[_0x0b42('0x50')]=[{'all':!![]}];}return db[_0x0b42('0x4d')][_0x0b42('0x51')](_0x33b386);})[_0x0b42('0x33')](function(_0xd2b3b2){_0xee00db['rows']=_0xd2b3b2;return _0xee00db;})[_0x0b42('0x33')](respondWithFilteredResult(_0x3c80e8,_0x33b386))[_0x0b42('0x27')](handleError(_0x3c80e8,null));};exports[_0x0b42('0x52')]=function(_0x44790c,_0x2dbe92){var _0xcfae84={'raw':!![],'where':{'id':_0x44790c[_0x0b42('0x53')]['id']}},_0x221951={};_0x221951['model']=_['keys'](db[_0x0b42('0x4d')][_0x0b42('0x54')]);_0x221951[_0x0b42('0x3e')]=_[_0x0b42('0x3f')](_0x44790c[_0x0b42('0x3e')]);_0x221951[_0x0b42('0x40')]=_[_0x0b42('0x41')](_0x221951[_0x0b42('0x3d')],_0x221951[_0x0b42('0x3e')]);_0xcfae84[_0x0b42('0x42')]=_[_0x0b42('0x41')](_0x221951[_0x0b42('0x3d')],qs[_0x0b42('0x43')](_0x44790c[_0x0b42('0x3e')]['fields']));_0xcfae84[_0x0b42('0x42')]=_0xcfae84[_0x0b42('0x42')][_0x0b42('0x44')]?_0xcfae84[_0x0b42('0x42')]:_0x221951['model'];if(_0x44790c[_0x0b42('0x3e')][_0x0b42('0x4f')]){_0xcfae84[_0x0b42('0x50')]=[{'all':!![]}];}_0xcfae84=_[_0x0b42('0x4b')]({},_0xcfae84,_0x44790c[_0x0b42('0x4c')]);return db[_0x0b42('0x4d')]['find'](_0xcfae84)[_0x0b42('0x33')](handleEntityNotFound(_0x2dbe92,null))[_0x0b42('0x33')](respondWithResult(_0x2dbe92,null))[_0x0b42('0x27')](handleError(_0x2dbe92,null));};exports[_0x0b42('0x32')]=function(_0x53d39e,_0x202466){if(_0x53d39e[_0x0b42('0x55')]['id']){delete _0x53d39e[_0x0b42('0x55')]['id'];}return db[_0x0b42('0x4d')][_0x0b42('0x56')]({'where':{'id':_0x53d39e[_0x0b42('0x53')]['id']}})[_0x0b42('0x33')](handleEntityNotFound(_0x202466,null))[_0x0b42('0x33')](saveUpdates(_0x53d39e[_0x0b42('0x55')],null))['then'](respondWithResult(_0x202466,null))[_0x0b42('0x27')](handleError(_0x202466,null));};exports[_0x0b42('0x34')]=function(_0x195aa0,_0x37c18e){return db[_0x0b42('0x4d')][_0x0b42('0x56')]({'where':{'id':_0x195aa0[_0x0b42('0x53')]['id']}})[_0x0b42('0x33')](handleEntityNotFound(_0x37c18e,null))[_0x0b42('0x33')](removeEntity(_0x37c18e,null))[_0x0b42('0x27')](handleError(_0x37c18e,null));};exports[_0x0b42('0x57')]=function(_0x5b9469,_0x257bf8){return db[_0x0b42('0x4d')]['describe']()[_0x0b42('0x33')](respondWithResult(_0x257bf8,null))[_0x0b42('0x27')](handleError(_0x257bf8,null));};exports['create']=function(_0x1a0a15,_0x459558){return db[_0x0b42('0x4d')][_0x0b42('0x58')](_0x1a0a15[_0x0b42('0x55')])[_0x0b42('0x33')](function(_0x9e08e0){if(_0x9e08e0){if(_0x9e08e0[_0x0b42('0x59')]==='out'&&!_0x9e08e0[_0x0b42('0x5a')]){var _0x299347,_0x1aed0d,_0x4e4a4a;if(_0x1a0a15[_0x0b42('0x55')]['to']){_0x1aed0d=_0x1a0a15['body']['to'][_0x0b42('0x5b')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x9e08e0[_0x0b42('0x5c')]},'include':[{'model':db[_0x0b42('0x5d')],'as':'List','include':[{'model':db[_0x0b42('0x5e')],'as':_0x0b42('0x5f'),'where':{'email':_0x1aed0d},'limit':0x1,'order':[[_0x0b42('0x60'),_0x0b42('0x61')]]}]},{'model':db['MailServerOut'],'as':_0x0b42('0x62'),'raw':!![]}]})[_0x0b42('0x33')](function(_0xf7ea1d){_0x299347=_0xf7ea1d;if(_0x299347&&_0x299347[_0x0b42('0x62')]){var _0x2544d8={'tls':{'rejectUnauthorized':![]}};if(_[_0x0b42('0x63')](_0x299347[_0x0b42('0x62')]['service'])){_0x2544d8['host']=_0x299347[_0x0b42('0x62')][_0x0b42('0x64')];_0x2544d8[_0x0b42('0x65')]=_0x299347[_0x0b42('0x62')][_0x0b42('0x65')];_0x2544d8[_0x0b42('0x66')]=_0x299347[_0x0b42('0x62')][_0x0b42('0x66')];if(_0x299347['Smtp'][_0x0b42('0x67')]){_0x2544d8[_0x0b42('0x68')]={'user':_0x299347[_0x0b42('0x62')][_0x0b42('0x69')],'pass':_0x299347[_0x0b42('0x62')]['pass']};}}else{_0x2544d8[_0x0b42('0x6a')]=_0x299347[_0x0b42('0x62')][_0x0b42('0x6a')];_0x2544d8['auth']={'user':_0x299347[_0x0b42('0x62')][_0x0b42('0x69')],'pass':_0x299347[_0x0b42('0x62')]['pass']};_0x2544d8[_0x0b42('0x66')]=_0x299347[_0x0b42('0x62')][_0x0b42('0x66')];}if(_0x1a0a15[_0x0b42('0x55')]['attachments']&&_0x1a0a15[_0x0b42('0x55')][_0x0b42('0x6b')][_0x0b42('0x44')]){for(var _0x2e5731=0x0;_0x2e5731<_0x1a0a15[_0x0b42('0x55')][_0x0b42('0x6b')][_0x0b42('0x44')];_0x2e5731+=0x1){_0x1a0a15[_0x0b42('0x55')]['attachments'][_0x2e5731]={'filename':_0x1a0a15[_0x0b42('0x55')][_0x0b42('0x6b')][_0x2e5731][_0x0b42('0x37')],'path':path[_0x0b42('0x6c')](config[_0x0b42('0x6d')],'server/files/attachments',_0x1a0a15[_0x0b42('0x55')][_0x0b42('0x6b')][_0x2e5731][_0x0b42('0x6e')])};}}_0x4e4a4a={'account':_0x2544d8,'message':_0x1a0a15[_0x0b42('0x55')]};return;}})['then'](function(){if(_0x299347[_0x0b42('0x6f')]){if(_0x299347['List'][_0x0b42('0x5f')][_0x0b42('0x44')]){return _0x299347[_0x0b42('0x6f')][_0x0b42('0x5f')][0x0];}else{return db[_0x0b42('0x5e')][_0x0b42('0x58')](_['defaults'](_0x1a0a15[_0x0b42('0x55')],{'firstName':_0x1a0a15[_0x0b42('0x55')]['to'],'email':_0x1a0a15[_0x0b42('0x55')]['to'],'phone':_0x1a0a15[_0x0b42('0x55')]['to'],'ListId':_0x299347[_0x0b42('0x70')]}));}}else{throw new Error(_0x0b42('0x71'));}})[_0x0b42('0x33')](function(){if(_0x4e4a4a){return respondWithRpcPromise(_0x0b42('0x72'),_0x0b42('0x73'),_0x4e4a4a,client9003)[_0x0b42('0x33')](function(_0x18d78b){return _0x9e08e0['update']({'read':!![],'messageId':_0x18d78b['messageId'],'sentAt':moment()['format'](_0x0b42('0x74'))});})[_0x0b42('0x27')](function(_0x1d12b3){logger['error']('%s',JSON[_0x0b42('0x22')](_0x1d12b3));return _0x9e08e0;});}return _0x9e08e0;});}return _0x9e08e0;}})[_0x0b42('0x33')](respondWithResult(_0x459558,0xc9))[_0x0b42('0x27')](handleError(_0x459558,null));};var interaction_log=require(_0x0b42('0x12'))('mail-interactions');exports[_0x0b42('0x75')]=function(_0x492d0f,_0x167c87,_0x900e63){var _0x5b6023={'channel':_0x0b42('0x76')};if(_0x492d0f[_0x0b42('0x55')]['id']){delete _0x492d0f[_0x0b42('0x55')]['id'];}_0x492d0f[_0x0b42('0x55')][_0x0b42('0x77')]=!![];_0x492d0f[_0x0b42('0x55')][_0x0b42('0x78')]=moment()[_0x0b42('0x79')](_0x0b42('0x74'));_0x492d0f['body'][_0x0b42('0x7a')]=_0x492d0f['body']['UserId']||_0x492d0f[_0x0b42('0x69')]['id'];return db[_0x0b42('0x4d')]['find']({'where':{'id':_0x492d0f[_0x0b42('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x0b42('0x5e')],'as':_0x0b42('0x7b')}]})[_0x0b42('0x33')](handleEntityNotFound(_0x167c87,null))['then'](saveUpdates(_0x492d0f[_0x0b42('0x55')],null))[_0x0b42('0x33')](function(_0x3f8e2d){if(_0x3f8e2d){_0x5b6023[_0x0b42('0x24')]=_0x3f8e2d[_0x0b42('0x7c')]({'plain':!![]});return db[_0x0b42('0x7d')][_0x0b42('0x56')]({'where':{'id':_0x3f8e2d[_0x0b42('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x167c87,null))['then'](function(_0xe1fec){if(_0xe1fec){return _0xe1fec[_0x0b42('0x32')]({'UserId':_0x492d0f[_0x0b42('0x55')][_0x0b42('0x7a')],'read1stAt':_[_0x0b42('0x63')](_0xe1fec[_0x0b42('0x7f')])?moment()[_0x0b42('0x79')](_0x0b42('0x74')):undefined});}return null;})[_0x0b42('0x33')](function(_0x4d4d0c){if(_0x4d4d0c){_0x5b6023[_0x0b42('0x80')]=_0x4d4d0c['get']({'plain':!![]});interaction_log['info'](_0x0b42('0x81'),_0x492d0f[_0x0b42('0x69')]['id'],_0x492d0f['user'][_0x0b42('0x37')],_0x492d0f[_0x0b42('0x69')]['role'],_0x5b6023[_0x0b42('0x80')]['id'],_0x492d0f[_0x0b42('0x55')]?JSON['stringify'](_0x492d0f['body']):_0x0b42('0x82'));return respondWithRpcPromise(_0x0b42('0x83'),'acceptMessage',_0x5b6023);}return null;})[_0x0b42('0x33')](function(_0x4f1ff5){if(_0x4f1ff5){if(_0x492d0f[_0x0b42('0x55')][_0x0b42('0x84')]){_0x5b6023[_0x0b42('0x24')][_0x0b42('0x85')]=util[_0x0b42('0x79')](_0x0b42('0x86'),_0x492d0f[_0x0b42('0x69')][_0x0b42('0x37')]);_0x5b6023[_0x0b42('0x24')][_0x0b42('0x87')]=_0x5b6023['channel'];_0x5b6023[_0x0b42('0x24')][_0x0b42('0x88')]='accept';return respondWithRpcPromise(_0x0b42('0x89'),_0x0b42('0x89'),{'event':_0x0b42('0x8a'),'message':_0x5b6023[_0x0b42('0x24')]},client9002)[_0x0b42('0x33')](function(){return _0x5b6023;});}return _0x5b6023;}return null;})[_0x0b42('0x33')](respondWithResult(_0x167c87,null))[_0x0b42('0x27')](handleError(_0x167c87,null));};var interaction_log=require(_0x0b42('0x12'))(_0x0b42('0x8b'));exports['reject']=function(_0x60fc34,_0xfdd67f,_0x4fc8a7){var _0x2bb0bd={'agent':{},'channel':_0x0b42('0x76')};if(_0x60fc34['body']['id']){delete _0x60fc34[_0x0b42('0x55')]['id'];}_0x60fc34[_0x0b42('0x55')]['UserId']=_0x60fc34[_0x0b42('0x55')][_0x0b42('0x7a')]||_0x60fc34[_0x0b42('0x69')]['id'];_0x2bb0bd['agent']['id']=_0x60fc34[_0x0b42('0x55')]['UserId'];return db[_0x0b42('0x4d')][_0x0b42('0x56')]({'where':{'id':_0x60fc34['params']['id'],'UserId':null}})[_0x0b42('0x33')](handleEntityNotFound(_0xfdd67f,null))['then'](function(_0xa07156){if(_0xa07156){_0x2bb0bd[_0x0b42('0x24')]=_0xa07156['get']({'plain':!![]});return db[_0x0b42('0x7d')][_0x0b42('0x56')]({'where':{'id':_0xa07156[_0x0b42('0x7e')]}});}return null;})[_0x0b42('0x33')](handleEntityNotFound(_0xfdd67f,null))[_0x0b42('0x33')](function(_0x45f574){if(_0x45f574){_0x2bb0bd['interaction']=_0x45f574[_0x0b42('0x7c')]({'plain':!![]});interaction_log[_0x0b42('0x25')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x60fc34['user']['id'],_0x60fc34[_0x0b42('0x69')][_0x0b42('0x37')],_0x60fc34[_0x0b42('0x69')][_0x0b42('0x8c')],_0x2bb0bd['interaction']['id'],_0x60fc34[_0x0b42('0x55')]?JSON[_0x0b42('0x22')](_0x60fc34['body']):'null');return respondWithRpcPromise(_0x0b42('0x8d'),'rejectMessage',_0x2bb0bd);}return null;})[_0x0b42('0x33')](function(_0x3fee52){if(_0x3fee52){_0x3fee52[_0x0b42('0x24')][_0x0b42('0x85')]=util[_0x0b42('0x79')](_0x0b42('0x86'),_0x60fc34[_0x0b42('0x69')]['name']);_0x3fee52[_0x0b42('0x24')][_0x0b42('0x87')]=_0x2bb0bd[_0x0b42('0x87')];_0x3fee52[_0x0b42('0x24')][_0x0b42('0x88')]=_0x0b42('0x30');respondWithRpcPromise(_0x0b42('0x89'),'EventManager',{'event':'rejectmessage','message':_0x3fee52[_0x0b42('0x24')]},client9002);return _0x2bb0bd;}return null;})['then'](respondWithResult(_0xfdd67f,null))[_0x0b42('0x27')](handleError(_0xfdd67f,null));};exports[_0x0b42('0x8e')]=function(_0x42841c,_0x29ba6b){var _0x36341a=moment()[_0x0b42('0x8f')]()[_0x0b42('0x90')]();var _0x18e6bc=path[_0x0b42('0x6c')](config[_0x0b42('0x6d')],'server',_0x0b42('0x91'),'tmp');var _0x4ef78d=path[_0x0b42('0x6c')](config['root'],_0x0b42('0x92'),'files',_0x0b42('0x6b'));var _0x2c5de4=util['format']('message-%s.eml',_0x36341a);return db[_0x0b42('0x4d')][_0x0b42('0x56')]({'where':{'id':_0x42841c[_0x0b42('0x53')]['id']},'attributes':['id','body',_0x0b42('0x93'),'to','cc',_0x0b42('0x94'),'subject','createdAt'],'include':_0x42841c[_0x0b42('0x3e')][_0x0b42('0x6b')]?[{'model':db[_0x0b42('0x95')],'as':'Attachments'}]:undefined})[_0x0b42('0x33')](handleEntityNotFound(_0x29ba6b,null))[_0x0b42('0x33')](function(_0x2bb669){if(_0x2bb669){var _0x4b26a8=_0x2bb669;var _0x586e05={'from':_0x4b26a8[_0x0b42('0x93')],'to':_0x4b26a8['to'],'subject':_0x4b26a8[_0x0b42('0x96')],'html':_0x4b26a8['body'],'headers':{'Date':moment(_0x4b26a8[_0x0b42('0x97')])[_0x0b42('0x79')](_0x0b42('0x98'))},'attachments':[]};if(_0x2bb669['cc']){_0x586e05[_0x0b42('0x99')]['Cc']=_0x2bb669['cc'];}if(_0x2bb669[_0x0b42('0x94')]){_0x586e05[_0x0b42('0x99')][_0x0b42('0x9a')]=_0x2bb669[_0x0b42('0x94')];}return new BPromise(function(_0x27beab,_0x59bb7b){if(_0x2bb669[_0x0b42('0x9b')]){for(var _0x19293d=0x0;_0x19293d<_0x2bb669[_0x0b42('0x9b')][_0x0b42('0x44')];_0x19293d++){var _0x1bbc66=_0x2bb669[_0x0b42('0x9b')][_0x19293d];var _0x45e323=path[_0x0b42('0x6c')](_0x4ef78d,_0x1bbc66['basename']);if(fs[_0x0b42('0x9c')](_0x45e323)){_0x586e05[_0x0b42('0x6b')]['push']({'name':_0x1bbc66[_0x0b42('0x37')],'contentType':_0x1bbc66['type'],'data':fs[_0x0b42('0x9d')](_0x45e323)});}}}emlformat[_0x0b42('0x9e')](_0x586e05,function(_0x190095,_0x3e4ff7){if(_0x190095)return _0x59bb7b(_0x190095);fs[_0x0b42('0x9f')](path[_0x0b42('0x6c')](_0x18e6bc,_0x2c5de4),_0x3e4ff7);return _0x27beab(_0x3e4ff7);});});}})['then'](function(_0x25c303){if(_0x25c303){return _0x29ba6b[_0x0b42('0x8e')](path[_0x0b42('0x6c')](_0x18e6bc,_0x2c5de4),_0x2c5de4,function(_0x2485b3){if(_0x2485b3){console[_0x0b42('0xa0')](_0x0b42('0xa1'),_0x2485b3);}else{fs[_0x0b42('0xa2')](path[_0x0b42('0x6c')](_0x18e6bc,_0x2c5de4));}});}})[_0x0b42('0x27')](handleError(_0x29ba6b,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 2a675d8..3981cc3 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 _0x485c=['hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners','save','update','emit'];(function(_0x17ab73,_0x47cf73){var _0x12896a=function(_0x19f3a4){while(--_0x19f3a4){_0x17ab73['push'](_0x17ab73['shift']());}};_0x12896a(++_0x47cf73);}(_0x485c,0x65));var _0xc485=function(_0x377a2e,_0x19879f){_0x377a2e=_0x377a2e-0x0;var _0x5426a7=_0x485c[_0x377a2e];return _0x5426a7;};'use strict';var EventEmitter=require(_0xc485('0x0'));var MailMessage=require(_0xc485('0x1'))['db'][_0xc485('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc485('0x3')](0x0);var events={'afterCreate':_0xc485('0x4'),'afterUpdate':_0xc485('0x5'),'afterDestroy':'remove'};function emitEvent(_0x37dad8){return function(_0x2704d4,_0x252fed,_0x3b9cd0){MailMessageEvents[_0xc485('0x6')](_0x37dad8+':'+_0x2704d4['id'],_0x2704d4);MailMessageEvents[_0xc485('0x6')](_0x37dad8,_0x2704d4);_0x3b9cd0(null);};}for(var e in events){if(events[_0xc485('0x7')](e)){var event=events[e];MailMessage[_0xc485('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x96c2=['emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','save','update','remove'];(function(_0x13e5a7,_0x9d3471){var _0x2a981f=function(_0x4c9d96){while(--_0x4c9d96){_0x13e5a7['push'](_0x13e5a7['shift']());}};_0x2a981f(++_0x9d3471);}(_0x96c2,0x162));var _0x296c=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x96c2[_0x368e09];return _0x14b7df;};'use strict';var EventEmitter=require(_0x296c('0x0'));var MailMessage=require(_0x296c('0x1'))['db'][_0x296c('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x296c('0x3'),'afterUpdate':_0x296c('0x4'),'afterDestroy':_0x296c('0x5')};function emitEvent(_0x5b95e7){return function(_0x161558,_0x4555df,_0x4e054a){MailMessageEvents[_0x296c('0x6')](_0x5b95e7+':'+_0x161558['id'],_0x161558);MailMessageEvents['emit'](_0x5b95e7,_0x161558);_0x4e054a(null);};}for(var e in events){if(events[_0x296c('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x296c('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 39d29c4..2737800 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 _0x2229=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','out','secret','isNil','MailInteraction','findOne','then','update','createdAt','direction','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x391e00,_0x4174a6){var _0x3c4799=function(_0x54f880){while(--_0x54f880){_0x391e00['push'](_0x391e00['shift']());}};_0x3c4799(++_0x4174a6);}(_0x2229,0x67));var _0x9222=function(_0x458b0,_0x15f01d){_0x458b0=_0x458b0-0x0;var _0x294e1f=_0x2229[_0x458b0];return _0x294e1f;};'use strict';var _=require(_0x9222('0x0'));var util=require(_0x9222('0x1'));var logger=require(_0x9222('0x2'))(_0x9222('0x3'));var moment=require(_0x9222('0x4'));var BPromise=require(_0x9222('0x5'));var rp=require(_0x9222('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x9222('0x7'));var rimraf=require(_0x9222('0x8'));var config=require(_0x9222('0x9'));var attributes=require(_0x9222('0xa'));module[_0x9222('0xb')]=function(_0x27d9e7,_0x29ba8b){return _0x27d9e7[_0x9222('0xc')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x9222('0xd'),'fields':[_0x9222('0xd')]},{'name':_0x9222('0xe'),'fields':[_0x9222('0xf'),_0x9222('0x10')],'type':_0x9222('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x42634a,_0x46ba11,_0x5c8362){if(_0x42634a[_0x9222('0x12')]){_0x42634a[_0x9222('0xf')]=htmlToText[_0x9222('0x13')](_0x42634a[_0x9222('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5c8362(null,_0x46ba11);},'afterCreate':function(_0x5812b6,_0x1b8872,_0x47454a){var _0x35152a=_0x27d9e7[_0x9222('0x14')];var _0x27d5ee=_0x5812b6[_0x9222('0x15')]({'plain':!![]});if(_0x27d5ee['direction'][_0x9222('0x16')]()==='in'||_0x27d5ee['direction'][_0x9222('0x16')]()===_0x9222('0x17')&&!_0x27d5ee[_0x9222('0x18')]&&!_[_0x9222('0x19')](_0x27d5ee['UserId'])){_0x35152a[_0x9222('0x1a')][_0x9222('0x1b')]({'where':{'id':_0x27d5ee['MailInteractionId']}})[_0x9222('0x1c')](function(_0x3ffb02){if(_0x3ffb02){_0x3ffb02[_0x9222('0x1d')]({'lastMsgAt':_0x27d5ee[_0x9222('0x1e')],'lastMsgDirection':_0x27d5ee[_0x9222('0x1f')][_0x9222('0x16')](),'lastMsgBody':_0x27d5ee[_0x9222('0x12')]});}})['catch'](function(_0x5e6194){console[_0x9222('0x20')](_0x5e6194);});}_0x47454a();}},'charset':_0x9222('0x21'),'collate':_0x9222('0x22')});}; \ No newline at end of file +var _0x6fd4=['isNil','UserId','MailInteraction','findOne','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','plainBody','models','get','direction','toLowerCase','out'];(function(_0x438920,_0x3f5a1b){var _0x474f47=function(_0x3767c2){while(--_0x3767c2){_0x438920['push'](_0x438920['shift']());}};_0x474f47(++_0x3f5a1b);}(_0x6fd4,0x17c));var _0x46fd=function(_0xe60b84,_0x1ba276){_0xe60b84=_0xe60b84-0x0;var _0x4224d1=_0x6fd4[_0xe60b84];return _0x4224d1;};'use strict';var _=require('lodash');var util=require(_0x46fd('0x0'));var logger=require(_0x46fd('0x1'))(_0x46fd('0x2'));var moment=require(_0x46fd('0x3'));var BPromise=require(_0x46fd('0x4'));var rp=require('request-promise');var htmlToText=require(_0x46fd('0x5'));var fs=require('fs');var path=require(_0x46fd('0x6'));var rimraf=require(_0x46fd('0x7'));var config=require(_0x46fd('0x8'));var attributes=require(_0x46fd('0x9'));module[_0x46fd('0xa')]=function(_0x1ca206,_0x5c58f7){return _0x1ca206[_0x46fd('0xb')]('MailMessage',attributes,{'tableName':_0x46fd('0xc'),'paranoid':![],'indexes':[{'name':_0x46fd('0xd'),'fields':['messageId']},{'name':_0x46fd('0xe'),'fields':['plainBody',_0x46fd('0xf')],'type':_0x46fd('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x532878,_0x56d776,_0x531945){if(_0x532878['body']){_0x532878[_0x46fd('0x11')]=htmlToText['fromString'](_0x532878['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x531945(null,_0x56d776);},'afterCreate':function(_0x108576,_0x413179,_0x59cece){var _0x25460a=_0x1ca206[_0x46fd('0x12')];var _0x29ba26=_0x108576[_0x46fd('0x13')]({'plain':!![]});if(_0x29ba26[_0x46fd('0x14')][_0x46fd('0x15')]()==='in'||_0x29ba26[_0x46fd('0x14')][_0x46fd('0x15')]()===_0x46fd('0x16')&&!_0x29ba26['secret']&&!_[_0x46fd('0x17')](_0x29ba26[_0x46fd('0x18')])){_0x25460a[_0x46fd('0x19')][_0x46fd('0x1a')]({'where':{'id':_0x29ba26['MailInteractionId']}})['then'](function(_0x31c8dc){if(_0x31c8dc){_0x31c8dc['update']({'lastMsgAt':_0x29ba26['createdAt'],'lastMsgDirection':_0x29ba26[_0x46fd('0x14')][_0x46fd('0x15')](),'lastMsgBody':_0x29ba26['body']});}})[_0x46fd('0x1b')](function(_0x2ae761){console[_0x46fd('0x1c')](_0x2ae761);});}_0x59cece();}},'charset':_0x46fd('0x1d'),'collate':_0x46fd('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0e0a13b..58e2515 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 _0xab3f=['stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','body','options','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x190dbd,_0x24a507){var _0x868d27=function(_0x253c6f){while(--_0x253c6f){_0x190dbd['push'](_0x190dbd['shift']());}};_0x868d27(++_0x24a507);}(_0xab3f,0x72));var _0xfab3=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0xab3f[_0x47e7dd];return _0x38501f;};'use strict';var _=require(_0xfab3('0x0'));var util=require('util');var moment=require(_0xfab3('0x1'));var BPromise=require(_0xfab3('0x2'));var rs=require(_0xfab3('0x3'));var fs=require('fs');var Redis=require(_0xfab3('0x4'));var db=require(_0xfab3('0x5'))['db'];var utils=require(_0xfab3('0x6'));var logger=require(_0xfab3('0x7'))(_0xfab3('0x8'));var config=require(_0xfab3('0x9'));var jayson=require(_0xfab3('0xa'));var client=jayson[_0xfab3('0xb')]['http']({'port':0x232a});config[_0xfab3('0xc')]=_[_0xfab3('0xd')](config[_0xfab3('0xc')],{'host':_0xfab3('0xe'),'port':0x18eb});var socket=require(_0xfab3('0xf'))(new Redis(config['redis']));require('./mailMessage.socket')[_0xfab3('0x10')](socket);function respondWithRpcPromise(_0x49cf15,_0x3ffe98,_0x4c8b28){return new BPromise(function(_0x75ff5b,_0x586647){return client[_0xfab3('0x11')](_0x49cf15,_0x4c8b28)[_0xfab3('0x12')](function(_0x7a24b4){logger[_0xfab3('0x13')]('MailMessage,\x20%s,\x20%s',_0x3ffe98,'request\x20sent');logger['debug'](_0xfab3('0x14'),_0x3ffe98,_0xfab3('0x15'),JSON[_0xfab3('0x16')](_0x7a24b4));if(_0x7a24b4[_0xfab3('0x17')]){if(_0x7a24b4['error']['code']===0x1f4){logger[_0xfab3('0x17')](_0xfab3('0x18'),_0x3ffe98,_0x7a24b4[_0xfab3('0x17')][_0xfab3('0x19')]);return _0x586647(_0x7a24b4[_0xfab3('0x17')][_0xfab3('0x19')]);}logger[_0xfab3('0x17')](_0xfab3('0x18'),_0x3ffe98,_0x7a24b4['error']['message']);return _0x75ff5b(_0x7a24b4[_0xfab3('0x17')][_0xfab3('0x19')]);}else{logger[_0xfab3('0x13')](_0xfab3('0x18'),_0x3ffe98,_0xfab3('0x15'));_0x75ff5b(_0x7a24b4[_0xfab3('0x1a')][_0xfab3('0x19')]);}})[_0xfab3('0x1b')](function(_0x228615){logger['error']('MailMessage,\x20%s,\x20%s',_0x3ffe98,_0x228615);_0x586647(_0x228615);});});}exports[_0xfab3('0x1c')]=function(_0x129e58){var _0x66f055=this;return new Promise(function(_0x4944c5,_0x43d66b){return db[_0xfab3('0x1d')][_0xfab3('0x1e')](_0x129e58[_0xfab3('0x1f')],{'raw':_0x129e58[_0xfab3('0x20')]?_0x129e58['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x41f624){logger[_0xfab3('0x13')](_0xfab3('0x1c'),_0x129e58);logger[_0xfab3('0x21')]('CreateMailMessage',_0x129e58,JSON[_0xfab3('0x16')](_0x41f624));_0x4944c5(_0x41f624);})[_0xfab3('0x1b')](function(_0x37265e){logger[_0xfab3('0x17')](_0xfab3('0x1c'),_0x37265e['message'],_0x129e58);_0x43d66b(_0x66f055['error'](0x1f4,_0x37265e[_0xfab3('0x19')]));});});}; \ No newline at end of file +var _0xa899=['client','http','redis','defaults','./mailMessage.socket','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','MailMessage,\x20%s,\x20%s','CreateMailMessage','MailMessage','create','body','raw','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x52ec4d,_0x1228e0){var _0x24c3d8=function(_0x572f2d){while(--_0x572f2d){_0x52ec4d['push'](_0x52ec4d['shift']());}};_0x24c3d8(++_0x1228e0);}(_0xa899,0x155));var _0x9a89=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xa899[_0x56916d];return _0x2b7f1f;};'use strict';var _=require(_0x9a89('0x0'));var util=require(_0x9a89('0x1'));var moment=require(_0x9a89('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a89('0x3'));var fs=require('fs');var Redis=require(_0x9a89('0x4'));var db=require(_0x9a89('0x5'))['db'];var utils=require(_0x9a89('0x6'));var logger=require(_0x9a89('0x7'))(_0x9a89('0x8'));var config=require(_0x9a89('0x9'));var jayson=require(_0x9a89('0xa'));var client=jayson[_0x9a89('0xb')][_0x9a89('0xc')]({'port':0x232a});config[_0x9a89('0xd')]=_[_0x9a89('0xe')](config[_0x9a89('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a89('0xd')]));require(_0x9a89('0xf'))['register'](socket);function respondWithRpcPromise(_0xccf078,_0x4f487d,_0x111d99){return new BPromise(function(_0x2a9e30,_0x401680){return client[_0x9a89('0x10')](_0xccf078,_0x111d99)[_0x9a89('0x11')](function(_0xc61526){logger[_0x9a89('0x12')]('MailMessage,\x20%s,\x20%s',_0x4f487d,'request\x20sent');logger[_0x9a89('0x13')](_0x9a89('0x14'),_0x4f487d,_0x9a89('0x15'),JSON['stringify'](_0xc61526));if(_0xc61526['error']){if(_0xc61526['error'][_0x9a89('0x16')]===0x1f4){logger[_0x9a89('0x17')]('MailMessage,\x20%s,\x20%s',_0x4f487d,_0xc61526[_0x9a89('0x17')][_0x9a89('0x18')]);return _0x401680(_0xc61526[_0x9a89('0x17')][_0x9a89('0x18')]);}logger['error'](_0x9a89('0x19'),_0x4f487d,_0xc61526[_0x9a89('0x17')]['message']);return _0x2a9e30(_0xc61526['error'][_0x9a89('0x18')]);}else{logger['info'](_0x9a89('0x19'),_0x4f487d,_0x9a89('0x15'));_0x2a9e30(_0xc61526['result'][_0x9a89('0x18')]);}})['catch'](function(_0x2d648f){logger[_0x9a89('0x17')]('MailMessage,\x20%s,\x20%s',_0x4f487d,_0x2d648f);_0x401680(_0x2d648f);});});}exports[_0x9a89('0x1a')]=function(_0x3759cb){var _0xf60649=this;return new Promise(function(_0x1619e0,_0x66f8c7){return db[_0x9a89('0x1b')][_0x9a89('0x1c')](_0x3759cb[_0x9a89('0x1d')],{'raw':_0x3759cb['options']?_0x3759cb['options'][_0x9a89('0x1e')]===undefined?!![]:![]:!![]})[_0x9a89('0x11')](function(_0xea8910){logger[_0x9a89('0x12')](_0x9a89('0x1a'),_0x3759cb);logger[_0x9a89('0x13')]('CreateMailMessage',_0x3759cb,JSON['stringify'](_0xea8910));_0x1619e0(_0xea8910);})[_0x9a89('0x1f')](function(_0x4f99e9){logger[_0x9a89('0x17')](_0x9a89('0x1a'),_0x4f99e9[_0x9a89('0x18')],_0x3759cb);_0x66f8c7(_0xf60649[_0x9a89('0x17')](0x1f4,_0x4f99e9[_0x9a89('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 1b5183b..2789165 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 _0x00b3=['mailMessage:','./mailMessage.events','update','emit','register','length'];(function(_0x5a4f09,_0x1ff095){var _0x5abe11=function(_0x8712ae){while(--_0x8712ae){_0x5a4f09['push'](_0x5a4f09['shift']());}};_0x5abe11(++_0x1ff095);}(_0x00b3,0x97));var _0x300b=function(_0xbe135b,_0x2de938){_0xbe135b=_0xbe135b-0x0;var _0x1d8add=_0x00b3[_0xbe135b];return _0x1d8add;};'use strict';var MailMessageEvents=require(_0x300b('0x0'));var events=['save','remove',_0x300b('0x1')];function createListener(_0x46c812,_0x4aa4f4){return function(_0x5a96e9){_0x4aa4f4[_0x300b('0x2')](_0x46c812,_0x5a96e9);};}function removeListener(_0x29e653,_0x2feba7){return function(){MailMessageEvents['removeListener'](_0x29e653,_0x2feba7);};}exports[_0x300b('0x3')]=function(_0xbceeb8){for(var _0x34a5cd=0x0,_0x4294fe=events[_0x300b('0x4')];_0x34a5cd<_0x4294fe;_0x34a5cd++){var _0x2cf1c5=events[_0x34a5cd];var _0x103922=createListener(_0x300b('0x5')+_0x2cf1c5,_0xbceeb8);MailMessageEvents['on'](_0x2cf1c5,_0x103922);}}; \ No newline at end of file +var _0xdead=['remove','removeListener','register','length','./mailMessage.events','save'];(function(_0x530151,_0x27ab6d){var _0x129774=function(_0x57f945){while(--_0x57f945){_0x530151['push'](_0x530151['shift']());}};_0x129774(++_0x27ab6d);}(_0xdead,0x172));var _0xddea=function(_0x450706,_0x144439){_0x450706=_0x450706-0x0;var _0x2e5de7=_0xdead[_0x450706];return _0x2e5de7;};'use strict';var MailMessageEvents=require(_0xddea('0x0'));var events=[_0xddea('0x1'),_0xddea('0x2'),'update'];function createListener(_0x2a631d,_0x519897){return function(_0x53421d){_0x519897['emit'](_0x2a631d,_0x53421d);};}function removeListener(_0x40db33,_0x5ef74c){return function(){MailMessageEvents[_0xddea('0x3')](_0x40db33,_0x5ef74c);};}exports[_0xddea('0x4')]=function(_0x5dca9e){for(var _0x18725c=0x0,_0x25a90c=events[_0xddea('0x5')];_0x18725c<_0x25a90c;_0x18725c++){var _0x1f6d31=events[_0x18725c];var _0x36cd2c=createListener('mailMessage:'+_0x1f6d31,_0x5dca9e);MailMessageEvents['on'](_0x1f6d31,_0x36cd2c);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index ce7ddd1..4d21d4c 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 _0x686b=['express','Router','../../components/auth/service','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeAgents','exports','multer','util','connect-timeout'];(function(_0x315843,_0x301556){var _0x4fd3bc=function(_0x498e22){while(--_0x498e22){_0x315843['push'](_0x315843['shift']());}};_0x4fd3bc(++_0x301556);}(_0x686b,0x1ad));var _0xb686=function(_0x12f1d2,_0x2b55c3){_0x12f1d2=_0x12f1d2-0x0;var _0x5c48ca=_0x686b[_0x12f1d2];return _0x5c48ca;};'use strict';var multer=require(_0xb686('0x0'));var util=require(_0xb686('0x1'));var path=require('path');var timeout=require(_0xb686('0x2'));var express=require(_0xb686('0x3'));var router=express[_0xb686('0x4')]();var auth=require(_0xb686('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb686('0x6'));router[_0xb686('0x7')]('/',auth[_0xb686('0x8')](),controller['index']);router[_0xb686('0x7')](_0xb686('0x9'),auth['isAuthenticated'](),controller[_0xb686('0xa')]);router[_0xb686('0x7')](_0xb686('0xb'),auth[_0xb686('0x8')](),controller['show']);router[_0xb686('0x7')](_0xb686('0xc'),auth[_0xb686('0x8')](),controller[_0xb686('0xd')]);router[_0xb686('0x7')](_0xb686('0xe'),auth[_0xb686('0x8')](),controller[_0xb686('0xf')]);router['get']('/:id/users',auth[_0xb686('0x8')](),controller[_0xb686('0x10')]);router[_0xb686('0x11')]('/',auth[_0xb686('0x8')](),controller[_0xb686('0x12')]);router[_0xb686('0x11')](_0xb686('0xe'),auth[_0xb686('0x8')](),controller[_0xb686('0x13')]);router[_0xb686('0x11')](_0xb686('0x14'),auth['isAuthenticated'](),controller[_0xb686('0x15')]);router[_0xb686('0x16')]('/:id',auth[_0xb686('0x8')](),controller[_0xb686('0x17')]);router[_0xb686('0x18')](_0xb686('0xb'),auth[_0xb686('0x8')](),controller['destroy']);router[_0xb686('0x18')](_0xb686('0xe'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0xb686('0x14'),auth[_0xb686('0x8')](),controller[_0xb686('0x19')]);module[_0xb686('0x1a')]=router; \ No newline at end of file +var _0xe36b=['addAgents','put','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/teams','/:id/users','post','create','addTeams'];(function(_0xd344ef,_0x132b5f){var _0x50a171=function(_0x1f7059){while(--_0x1f7059){_0xd344ef['push'](_0xd344ef['shift']());}};_0x50a171(++_0x132b5f);}(_0xe36b,0x1d9));var _0xbe36=function(_0xd24b23,_0x17da5a){_0xd24b23=_0xd24b23-0x0;var _0x125b60=_0xe36b[_0xd24b23];return _0x125b60;};'use strict';var multer=require(_0xbe36('0x0'));var util=require(_0xbe36('0x1'));var path=require(_0xbe36('0x2'));var timeout=require(_0xbe36('0x3'));var express=require(_0xbe36('0x4'));var router=express[_0xbe36('0x5')]();var auth=require(_0xbe36('0x6'));var interaction=require(_0xbe36('0x7'));var config=require(_0xbe36('0x8'));var controller=require(_0xbe36('0x9'));router[_0xbe36('0xa')]('/',auth[_0xbe36('0xb')](),controller[_0xbe36('0xc')]);router['get'](_0xbe36('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xbe36('0xa')](_0xbe36('0xe'),auth['isAuthenticated'](),controller[_0xbe36('0xf')]);router[_0xbe36('0xa')]('/:id/members',auth[_0xbe36('0xb')](),controller['getMembers']);router['get'](_0xbe36('0x10'),auth[_0xbe36('0xb')](),controller['getTeams']);router[_0xbe36('0xa')](_0xbe36('0x11'),auth[_0xbe36('0xb')](),controller['getAgents']);router[_0xbe36('0x12')]('/',auth['isAuthenticated'](),controller[_0xbe36('0x13')]);router[_0xbe36('0x12')](_0xbe36('0x10'),auth[_0xbe36('0xb')](),controller[_0xbe36('0x14')]);router[_0xbe36('0x12')](_0xbe36('0x11'),auth[_0xbe36('0xb')](),controller[_0xbe36('0x15')]);router[_0xbe36('0x16')](_0xbe36('0xe'),auth[_0xbe36('0xb')](),controller['update']);router[_0xbe36('0x17')]('/:id',auth[_0xbe36('0xb')](),controller['destroy']);router[_0xbe36('0x17')]('/:id/teams',auth[_0xbe36('0xb')](),controller[_0xbe36('0x18')]);router[_0xbe36('0x17')](_0xbe36('0x11'),auth[_0xbe36('0xb')](),controller[_0xbe36('0x19')]);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 e4fea23..4cb715c 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 _0x2b38=['ENUM','sequelize','exports','STRING','name','INTEGER'];(function(_0x3fcd18,_0x3c175f){var _0xf47233=function(_0x34f27b){while(--_0x34f27b){_0x3fcd18['push'](_0x3fcd18['shift']());}};_0xf47233(++_0x3c175f);}(_0x2b38,0x19f));var _0x82b3=function(_0x1c2138,_0x31c860){_0x1c2138=_0x1c2138-0x0;var _0x39d4c2=_0x2b38[_0x1c2138];return _0x39d4c2;};'use strict';var Sequelize=require(_0x82b3('0x0'));module[_0x82b3('0x1')]={'name':{'type':Sequelize[_0x82b3('0x2')],'unique':_0x82b3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x82b3('0x2')]},'timeout':{'type':Sequelize[_0x82b3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x82b3('0x5')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file +var _0xf3d0=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xf3d0,0x160));var _0x0f3d=function(_0x5e0c65,_0x568d78){_0x5e0c65=_0x5e0c65-0x0;var _0x533fa0=_0xf3d0[_0x5e0c65];return _0x533fa0;};'use strict';var Sequelize=require(_0x0f3d('0x0'));module[_0x0f3d('0x1')]={'name':{'type':Sequelize[_0x0f3d('0x2')],'unique':_0x0f3d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0f3d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0f3d('0x5')](_0x0f3d('0x6'),_0x0f3d('0x7'),_0x0f3d('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 157d56f..d12a2c3 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 _0xd239=['agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','nolimit','ids','voicePause','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','Agents','select','field','from','team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','compact','value','transaction','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','get','MailQueues','UserProfileResource','destroy','then','sendStatus','error','name','send','index','map','MailQueue','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','MailQueueId','User','findAndCountAll'];(function(_0x37a663,_0x3fdf0a){var _0x161b59=function(_0xb6bdc3){while(--_0xb6bdc3){_0x37a663['push'](_0x37a663['shift']());}};_0x161b59(++_0x3fdf0a);}(_0xd239,0xb8));var _0x9d23=function(_0x2064c8,_0x168039){_0x2064c8=_0x2064c8-0x0;var _0x23af73=_0xd239[_0x2064c8];return _0x23af73;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9d23('0x0'));var rimraf=require(_0x9d23('0x1'));var zipdir=require(_0x9d23('0x2'));var jsonpatch=require(_0x9d23('0x3'));var rp=require(_0x9d23('0x4'));var moment=require(_0x9d23('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9d23('0x6'));var util=require(_0x9d23('0x7'));var path=require(_0x9d23('0x8'));var sox=require(_0x9d23('0x9'));var csv=require(_0x9d23('0xa'));var ejs=require(_0x9d23('0xb'));var fs=require('fs');var _=require(_0x9d23('0xc'));var squel=require('squel');var crypto=require(_0x9d23('0xd'));var jsforce=require(_0x9d23('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9d23('0xf'));var Papa=require(_0x9d23('0x10'));var Redis=require(_0x9d23('0x11'));var authService=require(_0x9d23('0x12'));var qs=require(_0x9d23('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9d23('0x14'));var config=require('../../config/environment');var db=require(_0x9d23('0x15'))['db'];config[_0x9d23('0x16')]=_[_0x9d23('0x17')](config[_0x9d23('0x16')],{'host':_0x9d23('0x18'),'port':0x18eb});var socket=require(_0x9d23('0x19'))(new Redis(config[_0x9d23('0x16')]));require(_0x9d23('0x1a'))['register'](socket);function respondWithStatusCode(_0x435876,_0x3f4af3){_0x3f4af3=_0x3f4af3||0xcc;return function(_0xa6cf42){if(_0xa6cf42){return _0x435876['sendStatus'](_0x3f4af3);}return _0x435876[_0x9d23('0x1b')](_0x3f4af3)[_0x9d23('0x1c')]();};}function respondWithResult(_0x44782c,_0x2a2fbf){_0x2a2fbf=_0x2a2fbf||0xc8;return function(_0x1ca686){if(_0x1ca686){return _0x44782c['status'](_0x2a2fbf)[_0x9d23('0x1d')](_0x1ca686);}};}function respondWithFilteredResult(_0xcd078c,_0x4bef6a){return function(_0xc377e0){if(_0xc377e0){var _0x587d56=_0xc377e0['count'],_0x3de3ae=_0x4bef6a[_0x9d23('0x1e')],_0x541fd4=_0x4bef6a[_0x9d23('0x1e')]+_0x4bef6a[_0x9d23('0x1f')],_0x396535;if(_0x541fd4>=_0x587d56){_0x541fd4=_0x587d56;_0x396535=0xc8;}else{_0x396535=0xce;}_0xcd078c[_0x9d23('0x1b')](_0x396535);return _0xcd078c[_0x9d23('0x20')](_0x9d23('0x21'),_0x3de3ae+'-'+_0x541fd4+'/'+_0x587d56)[_0x9d23('0x1d')](_0xc377e0);}return null;};}function patchUpdates(_0x178a8e){return function(_0x379da3){try{jsonpatch[_0x9d23('0x22')](_0x379da3,_0x178a8e,!![]);}catch(_0x2c7529){return BPromise[_0x9d23('0x23')](_0x2c7529);}return _0x379da3[_0x9d23('0x24')]();};}function saveUpdates(_0x124576,_0x4408bb){return function(_0x1c9f52){if(_0x1c9f52){return _0x1c9f52[_0x9d23('0x25')](_0x124576)['then'](function(_0x308e2f){return _0x308e2f;});}return null;};}function removeEntity(_0x220d2e,_0xeb37a4){return function(_0x5a06ba){if(_0x5a06ba){return _0x5a06ba['destroy']()['then'](function(){var _0x4f741f=_0x5a06ba[_0x9d23('0x26')]({'plain':!![]});var _0x8dfa81=_0x9d23('0x27');return db[_0x9d23('0x28')][_0x9d23('0x29')]({'where':{'type':_0x8dfa81,'resourceId':_0x4f741f['id']}})[_0x9d23('0x2a')](function(){return _0x5a06ba;});})[_0x9d23('0x2a')](function(){_0x220d2e['status'](0xcc)[_0x9d23('0x1c')]();});}};}function handleEntityNotFound(_0xe2e232,_0x2c62ac){return function(_0x24f79f){if(!_0x24f79f){_0xe2e232[_0x9d23('0x2b')](0x194);}return _0x24f79f;};}function handleError(_0xf8fd02,_0x11b232){_0x11b232=_0x11b232||0x1f4;return function(_0x43066a){logger[_0x9d23('0x2c')](_0x43066a['stack']);if(_0x43066a['name']){delete _0x43066a[_0x9d23('0x2d')];}_0xf8fd02[_0x9d23('0x1b')](_0x11b232)[_0x9d23('0x2e')](_0x43066a);};}exports[_0x9d23('0x2f')]=function(_0x6a8d76,_0x36a2c2){var _0x3870de={},_0x2688f2={},_0x179dc3={'count':0x0,'rows':[]};var _0xd11b3f=_[_0x9d23('0x30')](db[_0x9d23('0x31')][_0x9d23('0x32')],function(_0x263200){return{'name':_0x263200[_0x9d23('0x33')],'type':_0x263200[_0x9d23('0x34')]['key']};});_0x2688f2[_0x9d23('0x35')]=_['map'](_0xd11b3f,_0x9d23('0x2d'));_0x2688f2[_0x9d23('0x36')]=_['keys'](_0x6a8d76[_0x9d23('0x36')]);_0x2688f2[_0x9d23('0x37')]=_[_0x9d23('0x38')](_0x2688f2[_0x9d23('0x35')],_0x2688f2[_0x9d23('0x36')]);_0x3870de['attributes']=_[_0x9d23('0x38')](_0x2688f2[_0x9d23('0x35')],qs[_0x9d23('0x39')](_0x6a8d76['query'][_0x9d23('0x39')]));_0x3870de[_0x9d23('0x3a')]=_0x3870de[_0x9d23('0x3a')][_0x9d23('0x3b')]?_0x3870de[_0x9d23('0x3a')]:_0x2688f2['model'];if(!_0x6a8d76[_0x9d23('0x36')][_0x9d23('0x3c')]('nolimit')){_0x3870de[_0x9d23('0x1f')]=qs[_0x9d23('0x1f')](_0x6a8d76[_0x9d23('0x36')]['limit']);_0x3870de['offset']=qs['offset'](_0x6a8d76[_0x9d23('0x36')][_0x9d23('0x1e')]);}_0x3870de[_0x9d23('0x3d')]=qs[_0x9d23('0x3e')](_0x6a8d76[_0x9d23('0x36')][_0x9d23('0x3e')]);_0x3870de[_0x9d23('0x3f')]=qs[_0x9d23('0x37')](_[_0x9d23('0x40')](_0x6a8d76[_0x9d23('0x36')],_0x2688f2[_0x9d23('0x37')]));if(_0x6a8d76[_0x9d23('0x36')][_0x9d23('0x41')]){_0x3870de[_0x9d23('0x3f')]=_[_0x9d23('0x42')](_0x3870de[_0x9d23('0x3f')],{'$or':_[_0x9d23('0x30')](_0xd11b3f,function(_0x41c8f6){if(_0x41c8f6['type']!==_0x9d23('0x43')){var _0x555c00={};_0x555c00[_0x41c8f6[_0x9d23('0x2d')]]={'$like':'%'+_0x6a8d76[_0x9d23('0x36')][_0x9d23('0x41')]+'%'};return _0x555c00;}})});}_0x3870de=_[_0x9d23('0x42')]({},_0x3870de,_0x6a8d76[_0x9d23('0x44')]);var _0x4ea1ac={'where':_0x3870de[_0x9d23('0x3f')]};return db[_0x9d23('0x31')][_0x9d23('0x45')](_0x4ea1ac)[_0x9d23('0x2a')](function(_0x2208f2){_0x179dc3[_0x9d23('0x45')]=_0x2208f2;if(_0x6a8d76[_0x9d23('0x36')][_0x9d23('0x46')]){_0x3870de[_0x9d23('0x47')]=[{'all':!![]}];}return db[_0x9d23('0x31')][_0x9d23('0x48')](_0x3870de);})[_0x9d23('0x2a')](function(_0x531aa9){_0x179dc3[_0x9d23('0x49')]=_0x531aa9;return _0x179dc3;})[_0x9d23('0x2a')](respondWithFilteredResult(_0x36a2c2,_0x3870de))[_0x9d23('0x4a')](handleError(_0x36a2c2,null));};exports[_0x9d23('0x4b')]=function(_0x1b6b7d,_0x13cee7){var _0x25f4bf={'raw':!![],'where':{'id':_0x1b6b7d[_0x9d23('0x4c')]['id']}},_0x3255ea={};_0x3255ea[_0x9d23('0x35')]=_[_0x9d23('0x4d')](db[_0x9d23('0x31')][_0x9d23('0x32')]);_0x3255ea[_0x9d23('0x36')]=_[_0x9d23('0x4d')](_0x1b6b7d[_0x9d23('0x36')]);_0x3255ea[_0x9d23('0x37')]=_[_0x9d23('0x38')](_0x3255ea['model'],_0x3255ea[_0x9d23('0x36')]);_0x25f4bf[_0x9d23('0x3a')]=_[_0x9d23('0x38')](_0x3255ea['model'],qs[_0x9d23('0x39')](_0x1b6b7d[_0x9d23('0x36')][_0x9d23('0x39')]));_0x25f4bf[_0x9d23('0x3a')]=_0x25f4bf[_0x9d23('0x3a')]['length']?_0x25f4bf['attributes']:_0x3255ea[_0x9d23('0x35')];if(_0x1b6b7d[_0x9d23('0x36')][_0x9d23('0x46')]){_0x25f4bf[_0x9d23('0x47')]=[{'all':!![]}];}_0x25f4bf=_[_0x9d23('0x42')]({},_0x25f4bf,_0x1b6b7d['options']);return db[_0x9d23('0x31')][_0x9d23('0x4e')](_0x25f4bf)[_0x9d23('0x2a')](handleEntityNotFound(_0x13cee7,null))[_0x9d23('0x2a')](respondWithResult(_0x13cee7,null))['catch'](handleError(_0x13cee7,null));};exports['create']=function(_0xb38391,_0x3d3984){return db[_0x9d23('0x31')][_0x9d23('0x4f')](_0xb38391[_0x9d23('0x50')],{})[_0x9d23('0x2a')](function(_0x2999a7){var _0x24739d=_0xb38391[_0x9d23('0x51')]['get']({'plain':!![]});if(!_0x24739d)throw new Error(_0x9d23('0x52'));if(_0x24739d[_0x9d23('0x53')]===_0x9d23('0x51')){var _0x5a3bd4=_0x2999a7[_0x9d23('0x26')]({'plain':!![]});var _0x5359f1=_0x9d23('0x27');return db[_0x9d23('0x54')]['find']({'where':{'name':_0x5359f1,'userProfileId':_0x24739d[_0x9d23('0x55')]},'raw':!![]})[_0x9d23('0x2a')](function(_0x3a730b){if(_0x3a730b&&_0x3a730b[_0x9d23('0x56')]===0x0){return db[_0x9d23('0x28')]['create']({'name':_0x5a3bd4[_0x9d23('0x2d')],'resourceId':_0x5a3bd4['id'],'type':_0x3a730b[_0x9d23('0x2d')],'sectionId':_0x3a730b['id']},{})[_0x9d23('0x2a')](function(){return _0x2999a7;});}else{return _0x2999a7;}})[_0x9d23('0x4a')](function(_0x2274a1){logger['error'](_0x9d23('0x57'),_0x2274a1);throw _0x2274a1;});}return _0x2999a7;})[_0x9d23('0x2a')](respondWithResult(_0x3d3984,0xc9))[_0x9d23('0x4a')](handleError(_0x3d3984,null));};exports[_0x9d23('0x25')]=function(_0x8e1e78,_0xa0ab9e){if(_0x8e1e78[_0x9d23('0x50')]['id']){delete _0x8e1e78[_0x9d23('0x50')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x8e1e78[_0x9d23('0x4c')]['id']}})[_0x9d23('0x2a')](handleEntityNotFound(_0xa0ab9e,null))['then'](saveUpdates(_0x8e1e78['body'],null))[_0x9d23('0x2a')](respondWithResult(_0xa0ab9e,null))[_0x9d23('0x4a')](handleError(_0xa0ab9e,null));};exports['destroy']=function(_0x367d98,_0x22ef23){return db[_0x9d23('0x31')][_0x9d23('0x4e')]({'where':{'id':_0x367d98[_0x9d23('0x4c')]['id']}})[_0x9d23('0x2a')](handleEntityNotFound(_0x22ef23,null))[_0x9d23('0x2a')](removeEntity(_0x22ef23,null))[_0x9d23('0x4a')](handleError(_0x22ef23,null));};exports[_0x9d23('0x58')]=function(_0x2aacd7,_0x21b574){return db[_0x9d23('0x31')]['describe']()[_0x9d23('0x2a')](respondWithResult(_0x21b574,null))[_0x9d23('0x4a')](handleError(_0x21b574,null));};exports[_0x9d23('0x59')]=function(_0x105c7a,_0x48319a,_0x1e8cab){var _0x44dd02={'raw':!![],'where':{}},_0x1b7aea={},_0x5c542e;return db[_0x9d23('0x31')]['findOne']({'where':{'id':_0x105c7a[_0x9d23('0x4c')]['id']}})[_0x9d23('0x2a')](handleEntityNotFound(_0x48319a,null))[_0x9d23('0x2a')](function(_0x3a31e2){if(_0x3a31e2){_0x5c542e=_0x3a31e2[_0x9d23('0x26')]({'plain':!![]});_0x1b7aea[_0x9d23('0x35')]=_[_0x9d23('0x4d')](db[_0x9d23('0x5a')][_0x9d23('0x32')]);_0x1b7aea[_0x9d23('0x36')]=_[_0x9d23('0x4d')](_0x105c7a[_0x9d23('0x36')]);_0x1b7aea[_0x9d23('0x37')]=_['intersection'](_0x1b7aea[_0x9d23('0x35')],_0x1b7aea[_0x9d23('0x36')]);_0x44dd02['attributes']=_[_0x9d23('0x38')](_0x1b7aea[_0x9d23('0x35')],qs['fields'](_0x105c7a[_0x9d23('0x36')][_0x9d23('0x39')]));_0x44dd02[_0x9d23('0x3a')]=_0x44dd02['attributes'][_0x9d23('0x3b')]?_0x44dd02[_0x9d23('0x3a')]:_0x1b7aea[_0x9d23('0x35')];if(!_0x105c7a[_0x9d23('0x36')]['hasOwnProperty']('nolimit')){_0x44dd02['limit']=qs['limit'](_0x105c7a['query']['limit']);_0x44dd02[_0x9d23('0x1e')]=qs[_0x9d23('0x1e')](_0x105c7a[_0x9d23('0x36')][_0x9d23('0x1e')]);}_0x44dd02['order']=qs[_0x9d23('0x3e')](_0x105c7a[_0x9d23('0x36')]['sort']);_0x44dd02[_0x9d23('0x3f')]=qs['filters'](_[_0x9d23('0x40')](_0x105c7a[_0x9d23('0x36')],_0x1b7aea['filters']));_0x44dd02[_0x9d23('0x3f')][_0x9d23('0x5b')]=_0x3a31e2['id'];if(_0x105c7a[_0x9d23('0x36')][_0x9d23('0x41')]){_0x44dd02[_0x9d23('0x3f')]=_[_0x9d23('0x42')](_0x44dd02['where'],{'$or':_['map'](_0x44dd02['attributes'],function(_0x3ec379){var _0x392220={};_0x392220[_0x3ec379]={'$like':'%'+_0x105c7a[_0x9d23('0x36')][_0x9d23('0x41')]+'%'};return _0x392220;})});}_0x44dd02=_[_0x9d23('0x42')]({},_0x44dd02,_0x105c7a[_0x9d23('0x44')]);return db[_0x9d23('0x5a')][_0x9d23('0x48')](_0x44dd02);}})[_0x9d23('0x2a')](function(_0x5c8b2d){if(_0x5c8b2d){return db[_0x9d23('0x5c')][_0x9d23('0x5d')]({'where':{'id':_[_0x9d23('0x30')](_0x5c8b2d,'UserId'),'role':_0x9d23('0x5e')},'attributes':['id',_0x9d23('0x2d'),_0x9d23('0x5f'),_0x9d23('0x60'),_0x9d23('0x61')]});}})['then'](function(_0x274745){if(_0x274745){return{'count':_0x274745[_0x9d23('0x45')],'rows':_['map'](_0x274745[_0x9d23('0x49')],function(_0x2bfb50){return{'membername':_0x2bfb50['name'],'UserId':_0x2bfb50['id'],'queue_name':_0x5c542e[_0x9d23('0x2d')],'MailQueueId':_0x5c542e['id'],'interface':util[_0x9d23('0x62')](_0x9d23('0x63'),_0x9d23('0x64'),_0x2bfb50[_0x9d23('0x2d')]),'penalty':0x0,'paused':_0x2bfb50[_0x9d23('0x5f')],'createdAt':_0x2bfb50[_0x9d23('0x61')],'updatedAt':_0x2bfb50['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9d23('0x2a')](respondWithFilteredResult(_0x48319a,_0x44dd02))[_0x9d23('0x4a')](handleError(_0x48319a,null));};exports[_0x9d23('0x65')]=function(_0x38f8cb,_0x4a066e,_0x1afd08){var _0x55e50a={};var _0x8d6563={};var _0x1b2f9e;var _0x2ca881;return db['MailQueue'][_0x9d23('0x66')]({'where':{'id':_0x38f8cb[_0x9d23('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4a066e,null))[_0x9d23('0x2a')](function(_0x45ff10){if(_0x45ff10){_0x1b2f9e=_0x45ff10;_0x8d6563[_0x9d23('0x35')]=_['keys'](db[_0x9d23('0x67')][_0x9d23('0x32')]);_0x8d6563[_0x9d23('0x36')]=_[_0x9d23('0x4d')](_0x38f8cb[_0x9d23('0x36')]);_0x8d6563['filters']=_[_0x9d23('0x38')](_0x8d6563[_0x9d23('0x35')],_0x8d6563[_0x9d23('0x36')]);_0x55e50a[_0x9d23('0x3a')]=_[_0x9d23('0x38')](_0x8d6563[_0x9d23('0x35')],qs['fields'](_0x38f8cb[_0x9d23('0x36')][_0x9d23('0x39')]));_0x55e50a[_0x9d23('0x3a')]=_0x55e50a[_0x9d23('0x3a')][_0x9d23('0x3b')]?_0x55e50a[_0x9d23('0x3a')]:_0x8d6563['model'];_0x55e50a[_0x9d23('0x3d')]=qs[_0x9d23('0x3e')](_0x38f8cb[_0x9d23('0x36')][_0x9d23('0x3e')]);_0x55e50a['where']=qs['filters'](_['pick'](_0x38f8cb['query'],_0x8d6563['filters']));if(_0x38f8cb[_0x9d23('0x36')][_0x9d23('0x41')]){_0x55e50a[_0x9d23('0x3f')]=_['merge'](_0x55e50a[_0x9d23('0x3f')],{'$or':_[_0x9d23('0x30')](_0x55e50a[_0x9d23('0x3a')],function(_0xf5f8bc){var _0x387db2={};_0x387db2[_0xf5f8bc]={'$like':'%'+_0x38f8cb[_0x9d23('0x36')][_0x9d23('0x41')]+'%'};return _0x387db2;})});}_0x55e50a=_[_0x9d23('0x42')]({},_0x55e50a,_0x38f8cb['options']);return _0x1b2f9e['getTeams'](_0x55e50a);}})[_0x9d23('0x2a')](function(_0xfdadd8){if(_0xfdadd8){_0x2ca881=_0xfdadd8[_0x9d23('0x3b')];if(!_0x38f8cb[_0x9d23('0x36')]['hasOwnProperty'](_0x9d23('0x68'))){_0x55e50a[_0x9d23('0x1f')]=qs['limit'](_0x38f8cb[_0x9d23('0x36')][_0x9d23('0x1f')]);_0x55e50a[_0x9d23('0x1e')]=qs[_0x9d23('0x1e')](_0x38f8cb[_0x9d23('0x36')][_0x9d23('0x1e')]);}return _0x1b2f9e[_0x9d23('0x65')](_0x55e50a);}})[_0x9d23('0x2a')](function(_0x3fb724){if(_0x3fb724){return _0x3fb724?{'count':_0x2ca881,'rows':_0x3fb724}:null;}})[_0x9d23('0x2a')](respondWithResult(_0x4a066e,null))[_0x9d23('0x4a')](handleError(_0x4a066e,null));};exports['addTeams']=function(_0x13c67a,_0x152d90,_0x448c7c){var _0x57e835=_0x13c67a['body'][_0x9d23('0x69')];return db[_0x9d23('0x67')][_0x9d23('0x48')]({'where':{'id':_0x57e835},'attributes':['id'],'include':[{'model':db[_0x9d23('0x5c')],'as':'Agents','attributes':['id',_0x9d23('0x2d'),'online',_0x9d23('0x6a'),'interface'],'raw':!![]}]})['then'](function(_0x12da38){if(_0x12da38){var _0x27bc73=_[_0x9d23('0x6b')](_0x12da38,function(_0x436b86){var _0x188757=_0x436b86[_0x9d23('0x26')]({'plain':!![]});return _0x188757['Agents'];});return db[_0x9d23('0x31')][_0x9d23('0x4e')]({'where':{'id':_0x13c67a[_0x9d23('0x4c')]['id']}})[_0x9d23('0x2a')](function(_0x1469f3){return db[_0x9d23('0x6c')]['transaction'](function(_0x3bd25c){return _0x1469f3[_0x9d23('0x6d')](_0x57e835,{'transaction':_0x3bd25c})[_0x9d23('0x2a')](function(){return BPromise[_0x9d23('0x6e')](_0x27bc73,function(_0x157170){return db[_0x9d23('0x5a')][_0x9d23('0x6f')]({'where':{'UserId':_0x157170['id'],'MailQueueId':_0x13c67a[_0x9d23('0x4c')]['id']},'transaction':_0x3bd25c});});})['then'](function(){_0x27bc73[_0x9d23('0x70')](function(_0x6ee468){socket[_0x9d23('0x71')](_0x9d23('0x72'),{'UserId':_0x6ee468['id'],'MailQueueId':_0x1469f3['id']});});});});});}})['then'](respondWithStatusCode(_0x152d90,null))[_0x9d23('0x4a')](handleError(_0x152d90,null));};exports[_0x9d23('0x73')]=function(_0x5e3d84,_0x4732eb,_0x1f2c1d){return db[_0x9d23('0x67')]['findAll']({'where':{'id':_0x5e3d84[_0x9d23('0x36')][_0x9d23('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9d23('0x74'),'attributes':['id'],'raw':!![]}]})[_0x9d23('0x2a')](handleEntityNotFound(_0x4732eb,null))[_0x9d23('0x2a')](function(_0x2f9803){var _0x5a44be=_['map'](_0x2f9803,'id');var _0x427117=[];var _0x3b813a=[];var _0x3e5225=squel[_0x9d23('0x75')]();_0x3e5225[_0x9d23('0x76')]('tq.TeamId')[_0x9d23('0x77')](_0x9d23('0x78'),'tq')['join']('user_has_teams','ut',_0x9d23('0x79'))[_0x9d23('0x3f')](_0x9d23('0x7a'),_0x5e3d84['params']['id']);for(var _0x1acc00=0x0;_0x1acc00<_0x2f9803[_0x9d23('0x3b')];_0x1acc00+=0x1){let _0x500861=_0x2f9803[_0x1acc00];for(var _0x593681=0x0;_0x593681<_0x500861[_0x9d23('0x74')]['length'];_0x593681+=0x1){let _0x44f6f7=_0x500861[_0x9d23('0x74')][_0x593681];var _0x16221b=_0x3e5225['clone']();_0x16221b['where'](_0x9d23('0x7b'),_0x44f6f7['id']);_0x3b813a[_0x9d23('0x7c')](db[_0x9d23('0x6c')][_0x9d23('0x36')](_0x16221b['toString'](),{'type':db[_0x9d23('0x6c')][_0x9d23('0x7d')][_0x9d23('0x7e')]})['then'](function(_0x4b215d){if(_0x4b215d[_0x9d23('0x3b')]===0x1){return _0x44f6f7['id'];}else{var _0xb6a35e=_[_0x9d23('0x7f')](_[_0x9d23('0x30')](_0x4b215d,_0x9d23('0x80')),function(_0x25ceb4){return _[_0x9d23('0x81')](_0x5a44be,_0x25ceb4);});if(_0xb6a35e){return _0x44f6f7['id'];}}}));}}return BPromise['all'](_0x3b813a)[_0x9d23('0x2a')](function(_0x46c665){_0x427117=_(_0x427117)['union'](_0x46c665)[_0x9d23('0x82')]()[_0x9d23('0x83')]();return db[_0x9d23('0x31')][_0x9d23('0x4e')]({'where':{'id':_0x5e3d84[_0x9d23('0x4c')]['id']}})['then'](function(_0x5162a9){return db['sequelize'][_0x9d23('0x84')](function(_0xc231b1){return _0x5162a9[_0x9d23('0x73')](_0x5e3d84[_0x9d23('0x36')]['ids'],{'transaction':_0xc231b1})['then'](function(){if(!_['isEmpty'](_0x427117)){return _0x5162a9[_0x9d23('0x85')](_0x427117,{'transaction':_0xc231b1});}})[_0x9d23('0x2a')](function(){_0x427117['forEach'](function(_0x434ef1){socket['emit'](_0x9d23('0x86'),{'UserId':_0x434ef1,'MailQueueId':_0x5162a9['id']});});});});});});})[_0x9d23('0x2a')](respondWithStatusCode(_0x4732eb,null))[_0x9d23('0x4a')](handleError(_0x4732eb,null));};exports[_0x9d23('0x87')]=function(_0x22a49a,_0x2c7a34,_0x25b6fa){return db['MailQueue'][_0x9d23('0x4e')]({'where':{'id':_0x22a49a[_0x9d23('0x4c')]['id']}})[_0x9d23('0x2a')](handleEntityNotFound(_0x2c7a34,null))[_0x9d23('0x2a')](function(_0x241f3c){if(_0x241f3c){return _0x241f3c[_0x9d23('0x87')](_0x22a49a[_0x9d23('0x50')]['ids'],_[_0x9d23('0x88')](_0x22a49a['body'],[_0x9d23('0x69'),'id'])||{})[_0x9d23('0x89')](function(_0x2a40cb){for(var _0x3250e9=0x0;_0x3250e9<_0x22a49a['body']['ids'][_0x9d23('0x3b')];_0x3250e9+=0x1){socket[_0x9d23('0x71')](_0x9d23('0x72'),{'UserId':_0x22a49a[_0x9d23('0x50')][_0x9d23('0x69')][_0x3250e9],'MailQueueId':_0x22a49a['params']['id']});}return _0x2a40cb;});}})[_0x9d23('0x2a')](respondWithResult(_0x2c7a34,null))[_0x9d23('0x4a')](handleError(_0x2c7a34,null));};exports[_0x9d23('0x85')]=function(_0x1e95b7,_0xa3ae1f,_0xbb19fb){return db[_0x9d23('0x31')]['find']({'where':{'id':_0x1e95b7[_0x9d23('0x4c')]['id']}})[_0x9d23('0x2a')](handleEntityNotFound(_0xa3ae1f,null))['then'](function(_0x3a82de){if(_0x3a82de){return _0x3a82de['removeAgents'](_0x1e95b7[_0x9d23('0x36')]['ids'])[_0x9d23('0x2a')](function(){if(_['isArray'](_0x1e95b7[_0x9d23('0x36')][_0x9d23('0x69')])){for(var _0x462ebf=0x0;_0x462ebf<_0x1e95b7[_0x9d23('0x36')][_0x9d23('0x69')]['length'];_0x462ebf+=0x1){socket[_0x9d23('0x71')](_0x9d23('0x86'),{'UserId':Number(_0x1e95b7[_0x9d23('0x36')][_0x9d23('0x69')][_0x462ebf]),'MailQueueId':Number(_0x1e95b7[_0x9d23('0x4c')]['id'])});}}else{socket['emit'](_0x9d23('0x86'),{'UserId':Number(_0x1e95b7[_0x9d23('0x36')]['ids']),'MailQueueId':Number(_0x1e95b7['params']['id'])});}});}})[_0x9d23('0x2a')](respondWithStatusCode(_0xa3ae1f,null))[_0x9d23('0x4a')](handleError(_0xa3ae1f,null));};exports['getAgents']=function(_0x317e04,_0x4434ce,_0x3f90b1){var _0x19d9d2={};var _0x591f88={};var _0x22614b;var _0x50d355;return db['MailQueue'][_0x9d23('0x66')]({'where':{'id':_0x317e04[_0x9d23('0x4c')]['id']}})[_0x9d23('0x2a')](handleEntityNotFound(_0x4434ce,null))['then'](function(_0x5b7807){if(_0x5b7807){_0x22614b=_0x5b7807;_0x591f88[_0x9d23('0x35')]=_[_0x9d23('0x4d')](db['User'][_0x9d23('0x32')]);_0x591f88['query']=_[_0x9d23('0x4d')](_0x317e04['query']);_0x591f88[_0x9d23('0x37')]=_[_0x9d23('0x38')](_0x591f88[_0x9d23('0x35')],_0x591f88[_0x9d23('0x36')]);_0x19d9d2['attributes']=_[_0x9d23('0x38')](_0x591f88[_0x9d23('0x35')],qs[_0x9d23('0x39')](_0x317e04['query'][_0x9d23('0x39')]));_0x19d9d2[_0x9d23('0x3a')]=_0x19d9d2[_0x9d23('0x3a')]['length']?_0x19d9d2[_0x9d23('0x3a')]:_0x591f88[_0x9d23('0x35')];_0x19d9d2[_0x9d23('0x3d')]=qs[_0x9d23('0x3e')](_0x317e04[_0x9d23('0x36')][_0x9d23('0x3e')]);_0x19d9d2[_0x9d23('0x3f')]=qs[_0x9d23('0x37')](_[_0x9d23('0x40')](_0x317e04[_0x9d23('0x36')],_0x591f88[_0x9d23('0x37')]));if(_0x317e04['query'][_0x9d23('0x41')]){_0x19d9d2[_0x9d23('0x3f')]=_['merge'](_0x19d9d2[_0x9d23('0x3f')],{'$or':_[_0x9d23('0x30')](_0x19d9d2[_0x9d23('0x3a')],function(_0x264056){var _0x154b84={};_0x154b84[_0x264056]={'$like':'%'+_0x317e04[_0x9d23('0x36')][_0x9d23('0x41')]+'%'};return _0x154b84;})});}_0x19d9d2=_['merge']({},_0x19d9d2,_0x317e04[_0x9d23('0x44')]);return _0x22614b[_0x9d23('0x8a')](_0x19d9d2);}})['then'](function(_0x1fcf68){if(_0x1fcf68){_0x50d355=_0x1fcf68[_0x9d23('0x3b')];if(!_0x317e04[_0x9d23('0x36')][_0x9d23('0x3c')](_0x9d23('0x68'))){_0x19d9d2['limit']=qs[_0x9d23('0x1f')](_0x317e04[_0x9d23('0x36')][_0x9d23('0x1f')]);_0x19d9d2[_0x9d23('0x1e')]=qs[_0x9d23('0x1e')](_0x317e04[_0x9d23('0x36')][_0x9d23('0x1e')]);}return _0x22614b['getAgents'](_0x19d9d2);}})[_0x9d23('0x2a')](function(_0x187c6e){if(_0x187c6e){return _0x187c6e?{'count':_0x50d355,'rows':_0x187c6e}:null;}})[_0x9d23('0x2a')](respondWithResult(_0x4434ce,null))[_0x9d23('0x4a')](handleError(_0x4434ce,null));}; \ No newline at end of file +var _0xf53e=['removeTeams','select','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','ids','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','userMailQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','localhost','./mailQueue.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','end','stack','name','send','index','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','where','merge','map','VIRTUAL','filter','options','MailQueue','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','body','find','describe','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','nolimit','addTeams','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit'];(function(_0x2067e9,_0x5e6a97){var _0x280ce4=function(_0x2eca23){while(--_0x2eca23){_0x2067e9['push'](_0x2067e9['shift']());}};_0x280ce4(++_0x5e6a97);}(_0xf53e,0x13d));var _0xef53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf53e[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xef53('0x0'));var emlformat=require(_0xef53('0x1'));var rimraf=require(_0xef53('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef53('0x3'));var rp=require(_0xef53('0x4'));var moment=require(_0xef53('0x5'));var BPromise=require(_0xef53('0x6'));var Mustache=require(_0xef53('0x7'));var util=require('util');var path=require(_0xef53('0x8'));var sox=require(_0xef53('0x9'));var csv=require(_0xef53('0xa'));var ejs=require(_0xef53('0xb'));var fs=require('fs');var _=require(_0xef53('0xc'));var squel=require(_0xef53('0xd'));var crypto=require(_0xef53('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xef53('0xf'));var toCsv=require(_0xef53('0xa'));var querystring=require('querystring');var Papa=require(_0xef53('0x10'));var Redis=require(_0xef53('0x11'));var authService=require(_0xef53('0x12'));var qs=require(_0xef53('0x13'));var as=require(_0xef53('0x14'));var hardwareService=require(_0xef53('0x15'));var logger=require(_0xef53('0x16'))(_0xef53('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xef53('0x18'))['db'];config['redis']=_[_0xef53('0x19')](config['redis'],{'host':_0xef53('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xef53('0x1b'))[_0xef53('0x1c')](socket);function respondWithStatusCode(_0x182d6c,_0x5c8987){_0x5c8987=_0x5c8987||0xcc;return function(_0x56f8fa){if(_0x56f8fa){return _0x182d6c['sendStatus'](_0x5c8987);}return _0x182d6c[_0xef53('0x1d')](_0x5c8987)['end']();};}function respondWithResult(_0xec80,_0x105945){_0x105945=_0x105945||0xc8;return function(_0x4d6020){if(_0x4d6020){return _0xec80[_0xef53('0x1d')](_0x105945)[_0xef53('0x1e')](_0x4d6020);}};}function respondWithFilteredResult(_0x9bf13e,_0x1fbebd){return function(_0xe834f9){if(_0xe834f9){var _0x58bac1=_0xe834f9[_0xef53('0x1f')],_0x930e9=_0x1fbebd['offset'],_0x122e7a=_0x1fbebd[_0xef53('0x20')]+_0x1fbebd[_0xef53('0x21')],_0x41cb0a;if(_0x122e7a>=_0x58bac1){_0x122e7a=_0x58bac1;_0x41cb0a=0xc8;}else{_0x41cb0a=0xce;}_0x9bf13e['status'](_0x41cb0a);return _0x9bf13e[_0xef53('0x22')](_0xef53('0x23'),_0x930e9+'-'+_0x122e7a+'/'+_0x58bac1)[_0xef53('0x1e')](_0xe834f9);}return null;};}function patchUpdates(_0x363c43){return function(_0x441da9){try{jsonpatch[_0xef53('0x24')](_0x441da9,_0x363c43,!![]);}catch(_0x56ea8b){return BPromise[_0xef53('0x25')](_0x56ea8b);}return _0x441da9[_0xef53('0x26')]();};}function saveUpdates(_0x36d6b2,_0x5da130){return function(_0x165183){if(_0x165183){return _0x165183[_0xef53('0x27')](_0x36d6b2)[_0xef53('0x28')](function(_0x3fb706){return _0x3fb706;});}return null;};}function removeEntity(_0x226d78,_0x211102){return function(_0x283a49){if(_0x283a49){return _0x283a49[_0xef53('0x29')]()['then'](function(){var _0x3c175c=_0x283a49[_0xef53('0x2a')]({'plain':!![]});var _0x2518d2=_0xef53('0x2b');return db[_0xef53('0x2c')][_0xef53('0x29')]({'where':{'type':_0x2518d2,'resourceId':_0x3c175c['id']}})['then'](function(){return _0x283a49;});})[_0xef53('0x28')](function(){_0x226d78[_0xef53('0x1d')](0xcc)[_0xef53('0x2d')]();});}};}function handleEntityNotFound(_0x4338c9,_0x6157ed){return function(_0x46daee){if(!_0x46daee){_0x4338c9['sendStatus'](0x194);}return _0x46daee;};}function handleError(_0x1b77a4,_0x137d4c){_0x137d4c=_0x137d4c||0x1f4;return function(_0x57fcfe){logger['error'](_0x57fcfe[_0xef53('0x2e')]);if(_0x57fcfe[_0xef53('0x2f')]){delete _0x57fcfe[_0xef53('0x2f')];}_0x1b77a4['status'](_0x137d4c)[_0xef53('0x30')](_0x57fcfe);};}exports[_0xef53('0x31')]=function(_0x2c7c76,_0x1f19a7){var _0x2312e8={},_0x3ef5de={},_0x383523={'count':0x0,'rows':[]};var _0x497986=_['map'](db['MailQueue']['rawAttributes'],function(_0x40cd1b){return{'name':_0x40cd1b[_0xef53('0x32')],'type':_0x40cd1b[_0xef53('0x33')][_0xef53('0x34')]};});_0x3ef5de['model']=_['map'](_0x497986,_0xef53('0x2f'));_0x3ef5de[_0xef53('0x35')]=_[_0xef53('0x36')](_0x2c7c76[_0xef53('0x35')]);_0x3ef5de[_0xef53('0x37')]=_[_0xef53('0x38')](_0x3ef5de[_0xef53('0x39')],_0x3ef5de[_0xef53('0x35')]);_0x2312e8[_0xef53('0x3a')]=_[_0xef53('0x38')](_0x3ef5de[_0xef53('0x39')],qs['fields'](_0x2c7c76[_0xef53('0x35')][_0xef53('0x3b')]));_0x2312e8[_0xef53('0x3a')]=_0x2312e8['attributes']['length']?_0x2312e8[_0xef53('0x3a')]:_0x3ef5de[_0xef53('0x39')];if(!_0x2c7c76['query'][_0xef53('0x3c')]('nolimit')){_0x2312e8[_0xef53('0x21')]=qs['limit'](_0x2c7c76[_0xef53('0x35')][_0xef53('0x21')]);_0x2312e8[_0xef53('0x20')]=qs[_0xef53('0x20')](_0x2c7c76[_0xef53('0x35')]['offset']);}_0x2312e8[_0xef53('0x3d')]=qs[_0xef53('0x3e')](_0x2c7c76['query'][_0xef53('0x3e')]);_0x2312e8['where']=qs['filters'](_[_0xef53('0x3f')](_0x2c7c76[_0xef53('0x35')],_0x3ef5de['filters']));if(_0x2c7c76[_0xef53('0x35')]['filter']){_0x2312e8[_0xef53('0x40')]=_[_0xef53('0x41')](_0x2312e8[_0xef53('0x40')],{'$or':_[_0xef53('0x42')](_0x497986,function(_0x2d8b75){if(_0x2d8b75[_0xef53('0x33')]!==_0xef53('0x43')){var _0x25c5e3={};_0x25c5e3[_0x2d8b75[_0xef53('0x2f')]]={'$like':'%'+_0x2c7c76[_0xef53('0x35')][_0xef53('0x44')]+'%'};return _0x25c5e3;}})});}_0x2312e8=_[_0xef53('0x41')]({},_0x2312e8,_0x2c7c76[_0xef53('0x45')]);var _0x1c82d3={'where':_0x2312e8['where']};return db[_0xef53('0x46')][_0xef53('0x1f')](_0x1c82d3)[_0xef53('0x28')](function(_0x3763f2){_0x383523['count']=_0x3763f2;if(_0x2c7c76['query'][_0xef53('0x47')]){_0x2312e8['include']=[{'all':!![]}];}return db[_0xef53('0x46')][_0xef53('0x48')](_0x2312e8);})[_0xef53('0x28')](function(_0xd2f9dd){_0x383523[_0xef53('0x49')]=_0xd2f9dd;return _0x383523;})[_0xef53('0x28')](respondWithFilteredResult(_0x1f19a7,_0x2312e8))[_0xef53('0x4a')](handleError(_0x1f19a7,null));};exports[_0xef53('0x4b')]=function(_0x32a6ba,_0x1d4449){var _0x145619={'raw':!![],'where':{'id':_0x32a6ba[_0xef53('0x4c')]['id']}},_0x3c038e={};_0x3c038e[_0xef53('0x39')]=_['keys'](db[_0xef53('0x46')][_0xef53('0x4d')]);_0x3c038e['query']=_[_0xef53('0x36')](_0x32a6ba[_0xef53('0x35')]);_0x3c038e[_0xef53('0x37')]=_[_0xef53('0x38')](_0x3c038e[_0xef53('0x39')],_0x3c038e[_0xef53('0x35')]);_0x145619[_0xef53('0x3a')]=_['intersection'](_0x3c038e[_0xef53('0x39')],qs['fields'](_0x32a6ba['query']['fields']));_0x145619['attributes']=_0x145619['attributes'][_0xef53('0x4e')]?_0x145619[_0xef53('0x3a')]:_0x3c038e['model'];if(_0x32a6ba[_0xef53('0x35')]['includeAll']){_0x145619[_0xef53('0x4f')]=[{'all':!![]}];}_0x145619=_[_0xef53('0x41')]({},_0x145619,_0x32a6ba[_0xef53('0x45')]);return db[_0xef53('0x46')]['find'](_0x145619)[_0xef53('0x28')](handleEntityNotFound(_0x1d4449,null))[_0xef53('0x28')](respondWithResult(_0x1d4449,null))['catch'](handleError(_0x1d4449,null));};exports[_0xef53('0x50')]=function(_0x221e3f,_0x4f24b2){return db[_0xef53('0x46')]['create'](_0x221e3f['body'],{})['then'](function(_0xddc311){var _0x8bea12=_0x221e3f[_0xef53('0x51')][_0xef53('0x2a')]({'plain':!![]});if(!_0x8bea12)throw new Error(_0xef53('0x52'));if(_0x8bea12['role']===_0xef53('0x51')){var _0x50baa9=_0xddc311[_0xef53('0x2a')]({'plain':!![]});var _0xd71211=_0xef53('0x2b');return db[_0xef53('0x53')]['find']({'where':{'name':_0xd71211,'userProfileId':_0x8bea12[_0xef53('0x54')]},'raw':!![]})[_0xef53('0x28')](function(_0x5a6671){if(_0x5a6671&&_0x5a6671['autoAssociation']===0x0){return db['UserProfileResource'][_0xef53('0x50')]({'name':_0x50baa9[_0xef53('0x2f')],'resourceId':_0x50baa9['id'],'type':_0x5a6671[_0xef53('0x2f')],'sectionId':_0x5a6671['id']},{})[_0xef53('0x28')](function(){return _0xddc311;});}else{return _0xddc311;}})['catch'](function(_0x47a6a8){logger[_0xef53('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47a6a8);throw _0x47a6a8;});}return _0xddc311;})[_0xef53('0x28')](respondWithResult(_0x4f24b2,0xc9))['catch'](handleError(_0x4f24b2,null));};exports[_0xef53('0x27')]=function(_0x206f10,_0x4086f6){if(_0x206f10[_0xef53('0x56')]['id']){delete _0x206f10['body']['id'];}return db[_0xef53('0x46')][_0xef53('0x57')]({'where':{'id':_0x206f10[_0xef53('0x4c')]['id']}})[_0xef53('0x28')](handleEntityNotFound(_0x4086f6,null))['then'](saveUpdates(_0x206f10[_0xef53('0x56')],null))[_0xef53('0x28')](respondWithResult(_0x4086f6,null))[_0xef53('0x4a')](handleError(_0x4086f6,null));};exports[_0xef53('0x29')]=function(_0x1625bd,_0xc08b9f){return db[_0xef53('0x46')]['find']({'where':{'id':_0x1625bd[_0xef53('0x4c')]['id']}})['then'](handleEntityNotFound(_0xc08b9f,null))['then'](removeEntity(_0xc08b9f,null))[_0xef53('0x4a')](handleError(_0xc08b9f,null));};exports[_0xef53('0x58')]=function(_0x5e190b,_0x56a7a2){return db['MailQueue']['describe']()['then'](respondWithResult(_0x56a7a2,null))['catch'](handleError(_0x56a7a2,null));};exports['getMembers']=function(_0x52802e,_0x3e9d2e,_0x462836){var _0xa2324d={'raw':!![],'where':{}},_0x19991d={},_0x550944;return db[_0xef53('0x46')]['findOne']({'where':{'id':_0x52802e[_0xef53('0x4c')]['id']}})[_0xef53('0x28')](handleEntityNotFound(_0x3e9d2e,null))[_0xef53('0x28')](function(_0x22fd16){if(_0x22fd16){_0x550944=_0x22fd16[_0xef53('0x2a')]({'plain':!![]});_0x19991d['model']=_[_0xef53('0x36')](db[_0xef53('0x59')][_0xef53('0x4d')]);_0x19991d['query']=_[_0xef53('0x36')](_0x52802e['query']);_0x19991d[_0xef53('0x37')]=_[_0xef53('0x38')](_0x19991d['model'],_0x19991d[_0xef53('0x35')]);_0xa2324d['attributes']=_[_0xef53('0x38')](_0x19991d[_0xef53('0x39')],qs[_0xef53('0x3b')](_0x52802e[_0xef53('0x35')]['fields']));_0xa2324d[_0xef53('0x3a')]=_0xa2324d[_0xef53('0x3a')]['length']?_0xa2324d['attributes']:_0x19991d[_0xef53('0x39')];if(!_0x52802e['query'][_0xef53('0x3c')]('nolimit')){_0xa2324d[_0xef53('0x21')]=qs['limit'](_0x52802e['query']['limit']);_0xa2324d[_0xef53('0x20')]=qs[_0xef53('0x20')](_0x52802e[_0xef53('0x35')]['offset']);}_0xa2324d['order']=qs[_0xef53('0x3e')](_0x52802e[_0xef53('0x35')][_0xef53('0x3e')]);_0xa2324d[_0xef53('0x40')]=qs[_0xef53('0x37')](_[_0xef53('0x3f')](_0x52802e[_0xef53('0x35')],_0x19991d['filters']));_0xa2324d['where']['MailQueueId']=_0x22fd16['id'];if(_0x52802e[_0xef53('0x35')][_0xef53('0x44')]){_0xa2324d[_0xef53('0x40')]=_[_0xef53('0x41')](_0xa2324d[_0xef53('0x40')],{'$or':_['map'](_0xa2324d[_0xef53('0x3a')],function(_0x2959d1){var _0x466523={};_0x466523[_0x2959d1]={'$like':'%'+_0x52802e['query'][_0xef53('0x44')]+'%'};return _0x466523;})});}_0xa2324d=_[_0xef53('0x41')]({},_0xa2324d,_0x52802e[_0xef53('0x45')]);return db[_0xef53('0x59')][_0xef53('0x48')](_0xa2324d);}})[_0xef53('0x28')](function(_0xd454c3){if(_0xd454c3){return db[_0xef53('0x5a')][_0xef53('0x5b')]({'where':{'id':_[_0xef53('0x42')](_0xd454c3,_0xef53('0x5c')),'role':_0xef53('0x5d')},'attributes':['id',_0xef53('0x2f'),_0xef53('0x5e'),'updatedAt',_0xef53('0x5f')]});}})[_0xef53('0x28')](function(_0x352202){if(_0x352202){return{'count':_0x352202['count'],'rows':_[_0xef53('0x42')](_0x352202[_0xef53('0x49')],function(_0x1de304){return{'membername':_0x1de304[_0xef53('0x2f')],'UserId':_0x1de304['id'],'queue_name':_0x550944['name'],'MailQueueId':_0x550944['id'],'interface':util[_0xef53('0x60')](_0xef53('0x61'),_0xef53('0x62'),_0x1de304[_0xef53('0x2f')]),'penalty':0x0,'paused':_0x1de304['mailPause'],'createdAt':_0x1de304['createdAt'],'updatedAt':_0x1de304[_0xef53('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xef53('0x28')](respondWithFilteredResult(_0x3e9d2e,_0xa2324d))[_0xef53('0x4a')](handleError(_0x3e9d2e,null));};exports[_0xef53('0x64')]=function(_0x356752,_0x520200,_0x464141){var _0x384b9c={};var _0x32affd={};var _0x2b9ebd;var _0x34bce8;return db['MailQueue'][_0xef53('0x65')]({'where':{'id':_0x356752[_0xef53('0x4c')]['id']}})[_0xef53('0x28')](handleEntityNotFound(_0x520200,null))[_0xef53('0x28')](function(_0x1da65d){if(_0x1da65d){_0x2b9ebd=_0x1da65d;_0x32affd[_0xef53('0x39')]=_[_0xef53('0x36')](db[_0xef53('0x66')][_0xef53('0x4d')]);_0x32affd['query']=_['keys'](_0x356752['query']);_0x32affd['filters']=_[_0xef53('0x38')](_0x32affd[_0xef53('0x39')],_0x32affd[_0xef53('0x35')]);_0x384b9c['attributes']=_['intersection'](_0x32affd[_0xef53('0x39')],qs[_0xef53('0x3b')](_0x356752[_0xef53('0x35')][_0xef53('0x3b')]));_0x384b9c[_0xef53('0x3a')]=_0x384b9c['attributes'][_0xef53('0x4e')]?_0x384b9c[_0xef53('0x3a')]:_0x32affd[_0xef53('0x39')];_0x384b9c['order']=qs[_0xef53('0x3e')](_0x356752[_0xef53('0x35')]['sort']);_0x384b9c[_0xef53('0x40')]=qs[_0xef53('0x37')](_[_0xef53('0x3f')](_0x356752[_0xef53('0x35')],_0x32affd[_0xef53('0x37')]));if(_0x356752[_0xef53('0x35')][_0xef53('0x44')]){_0x384b9c[_0xef53('0x40')]=_[_0xef53('0x41')](_0x384b9c[_0xef53('0x40')],{'$or':_['map'](_0x384b9c[_0xef53('0x3a')],function(_0x137895){var _0x5c3d55={};_0x5c3d55[_0x137895]={'$like':'%'+_0x356752[_0xef53('0x35')][_0xef53('0x44')]+'%'};return _0x5c3d55;})});}_0x384b9c=_[_0xef53('0x41')]({},_0x384b9c,_0x356752[_0xef53('0x45')]);return _0x2b9ebd[_0xef53('0x64')](_0x384b9c);}})[_0xef53('0x28')](function(_0x1b725f){if(_0x1b725f){_0x34bce8=_0x1b725f[_0xef53('0x4e')];if(!_0x356752[_0xef53('0x35')][_0xef53('0x3c')](_0xef53('0x67'))){_0x384b9c['limit']=qs['limit'](_0x356752[_0xef53('0x35')][_0xef53('0x21')]);_0x384b9c[_0xef53('0x20')]=qs[_0xef53('0x20')](_0x356752[_0xef53('0x35')]['offset']);}return _0x2b9ebd[_0xef53('0x64')](_0x384b9c);}})[_0xef53('0x28')](function(_0x5c9b4b){if(_0x5c9b4b){return _0x5c9b4b?{'count':_0x34bce8,'rows':_0x5c9b4b}:null;}})[_0xef53('0x28')](respondWithResult(_0x520200,null))[_0xef53('0x4a')](handleError(_0x520200,null));};exports[_0xef53('0x68')]=function(_0x2bbc6b,_0x33250e,_0x5b5343){var _0x19880d=_0x2bbc6b[_0xef53('0x56')]['ids'];return db[_0xef53('0x66')]['findAll']({'where':{'id':_0x19880d},'attributes':['id'],'include':[{'model':db[_0xef53('0x5a')],'as':_0xef53('0x69'),'attributes':['id',_0xef53('0x2f'),_0xef53('0x6a'),_0xef53('0x6b'),'interface'],'raw':!![]}]})[_0xef53('0x28')](function(_0x561b09){if(_0x561b09){var _0x1df74d=_[_0xef53('0x6c')](_0x561b09,function(_0x145fdf){var _0x8309ea=_0x145fdf[_0xef53('0x2a')]({'plain':!![]});return _0x8309ea['Agents'];});return db[_0xef53('0x46')][_0xef53('0x57')]({'where':{'id':_0x2bbc6b['params']['id']}})['then'](function(_0x2d12ae){return db[_0xef53('0x6d')][_0xef53('0x6e')](function(_0x290398){return _0x2d12ae[_0xef53('0x68')](_0x19880d,{'transaction':_0x290398})[_0xef53('0x28')](function(){return BPromise[_0xef53('0x6f')](_0x1df74d,function(_0x200606){return db[_0xef53('0x59')][_0xef53('0x70')]({'where':{'UserId':_0x200606['id'],'MailQueueId':_0x2bbc6b[_0xef53('0x4c')]['id']},'transaction':_0x290398});});})['then'](function(){_0x1df74d[_0xef53('0x71')](function(_0x21c0a9){socket[_0xef53('0x72')]('userMailQueue:save',{'UserId':_0x21c0a9['id'],'MailQueueId':_0x2d12ae['id']});});});});});}})['then'](respondWithStatusCode(_0x33250e,null))[_0xef53('0x4a')](handleError(_0x33250e,null));};exports[_0xef53('0x73')]=function(_0x118f05,_0x4915fb,_0x5b1cfa){return db['Team'][_0xef53('0x48')]({'where':{'id':_0x118f05[_0xef53('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xef53('0x5a')],'as':_0xef53('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4915fb,null))[_0xef53('0x28')](function(_0x28c377){var _0x1e1ea7=_['map'](_0x28c377,'id');var _0x46e2d3=[];var _0x34255e=[];var _0x584e62=squel[_0xef53('0x74')]();_0x584e62['field'](_0xef53('0x75'))[_0xef53('0x76')](_0xef53('0x77'),'tq')[_0xef53('0x78')]('user_has_teams','ut',_0xef53('0x79'))[_0xef53('0x40')](_0xef53('0x7a'),_0x118f05[_0xef53('0x4c')]['id']);for(var _0x15d76f=0x0;_0x15d76f<_0x28c377[_0xef53('0x4e')];_0x15d76f+=0x1){let _0xa7cefc=_0x28c377[_0x15d76f];for(var _0x307cad=0x0;_0x307cad<_0xa7cefc[_0xef53('0x69')][_0xef53('0x4e')];_0x307cad+=0x1){let _0x536dd8=_0xa7cefc[_0xef53('0x69')][_0x307cad];var _0x513055=_0x584e62[_0xef53('0x7b')]();_0x513055[_0xef53('0x40')](_0xef53('0x7c'),_0x536dd8['id']);_0x34255e['push'](db['sequelize'][_0xef53('0x35')](_0x513055[_0xef53('0x7d')](),{'type':db['sequelize'][_0xef53('0x7e')][_0xef53('0x7f')]})[_0xef53('0x28')](function(_0x1a33ff){if(_0x1a33ff[_0xef53('0x4e')]===0x1){return _0x536dd8['id'];}else{var _0x44319a=_[_0xef53('0x80')](_['map'](_0x1a33ff,_0xef53('0x81')),function(_0x2d76d1){return _[_0xef53('0x82')](_0x1e1ea7,_0x2d76d1);});if(_0x44319a){return _0x536dd8['id'];}}}));}}return BPromise[_0xef53('0x83')](_0x34255e)[_0xef53('0x28')](function(_0x40f4d9){_0x46e2d3=_(_0x46e2d3)[_0xef53('0x84')](_0x40f4d9)[_0xef53('0x85')]()[_0xef53('0x86')]();return db['MailQueue'][_0xef53('0x57')]({'where':{'id':_0x118f05['params']['id']}})[_0xef53('0x28')](function(_0x2c68f1){return db[_0xef53('0x6d')][_0xef53('0x6e')](function(_0x360f44){return _0x2c68f1[_0xef53('0x73')](_0x118f05[_0xef53('0x35')][_0xef53('0x87')],{'transaction':_0x360f44})[_0xef53('0x28')](function(){if(!_[_0xef53('0x88')](_0x46e2d3)){return _0x2c68f1[_0xef53('0x89')](_0x46e2d3,{'transaction':_0x360f44});}})[_0xef53('0x28')](function(){_0x46e2d3[_0xef53('0x71')](function(_0x5edfa2){socket[_0xef53('0x72')](_0xef53('0x8a'),{'UserId':_0x5edfa2,'MailQueueId':_0x2c68f1['id']});});});});});});})[_0xef53('0x28')](respondWithStatusCode(_0x4915fb,null))[_0xef53('0x4a')](handleError(_0x4915fb,null));};exports[_0xef53('0x8b')]=function(_0x3fb5e6,_0x29d8f9,_0x2faff9){return db[_0xef53('0x46')][_0xef53('0x57')]({'where':{'id':_0x3fb5e6[_0xef53('0x4c')]['id']}})[_0xef53('0x28')](handleEntityNotFound(_0x29d8f9,null))[_0xef53('0x28')](function(_0x537cbe){if(_0x537cbe){return _0x537cbe[_0xef53('0x8b')](_0x3fb5e6[_0xef53('0x56')][_0xef53('0x87')],_['omit'](_0x3fb5e6[_0xef53('0x56')],[_0xef53('0x87'),'id'])||{})[_0xef53('0x8c')](function(_0x366634){for(var _0x44ee2b=0x0;_0x44ee2b<_0x3fb5e6[_0xef53('0x56')][_0xef53('0x87')][_0xef53('0x4e')];_0x44ee2b+=0x1){socket[_0xef53('0x72')](_0xef53('0x8d'),{'UserId':_0x3fb5e6['body']['ids'][_0x44ee2b],'MailQueueId':_0x3fb5e6[_0xef53('0x4c')]['id']});}return _0x366634;});}})[_0xef53('0x28')](respondWithResult(_0x29d8f9,null))['catch'](handleError(_0x29d8f9,null));};exports['removeAgents']=function(_0x5337b4,_0x2d7764,_0x3931eb){return db[_0xef53('0x46')][_0xef53('0x57')]({'where':{'id':_0x5337b4['params']['id']}})[_0xef53('0x28')](handleEntityNotFound(_0x2d7764,null))[_0xef53('0x28')](function(_0x2d8c20){if(_0x2d8c20){return _0x2d8c20[_0xef53('0x89')](_0x5337b4[_0xef53('0x35')]['ids'])[_0xef53('0x28')](function(){if(_[_0xef53('0x8e')](_0x5337b4[_0xef53('0x35')][_0xef53('0x87')])){for(var _0x22a8eb=0x0;_0x22a8eb<_0x5337b4[_0xef53('0x35')][_0xef53('0x87')][_0xef53('0x4e')];_0x22a8eb+=0x1){socket[_0xef53('0x72')](_0xef53('0x8a'),{'UserId':Number(_0x5337b4[_0xef53('0x35')][_0xef53('0x87')][_0x22a8eb]),'MailQueueId':Number(_0x5337b4[_0xef53('0x4c')]['id'])});}}else{socket[_0xef53('0x72')](_0xef53('0x8a'),{'UserId':Number(_0x5337b4['query'][_0xef53('0x87')]),'MailQueueId':Number(_0x5337b4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2d7764,null))[_0xef53('0x4a')](handleError(_0x2d7764,null));};exports['getAgents']=function(_0x1a0646,_0xb160a7,_0x4bbeca){var _0xde95a4={};var _0x50e681={};var _0x4d5f4f;var _0x5d4305;return db[_0xef53('0x46')]['findOne']({'where':{'id':_0x1a0646[_0xef53('0x4c')]['id']}})['then'](handleEntityNotFound(_0xb160a7,null))[_0xef53('0x28')](function(_0xe53e17){if(_0xe53e17){_0x4d5f4f=_0xe53e17;_0x50e681['model']=_[_0xef53('0x36')](db['User'][_0xef53('0x4d')]);_0x50e681[_0xef53('0x35')]=_['keys'](_0x1a0646['query']);_0x50e681['filters']=_[_0xef53('0x38')](_0x50e681['model'],_0x50e681[_0xef53('0x35')]);_0xde95a4[_0xef53('0x3a')]=_[_0xef53('0x38')](_0x50e681[_0xef53('0x39')],qs[_0xef53('0x3b')](_0x1a0646[_0xef53('0x35')][_0xef53('0x3b')]));_0xde95a4['attributes']=_0xde95a4['attributes'][_0xef53('0x4e')]?_0xde95a4[_0xef53('0x3a')]:_0x50e681[_0xef53('0x39')];_0xde95a4[_0xef53('0x3d')]=qs[_0xef53('0x3e')](_0x1a0646['query'][_0xef53('0x3e')]);_0xde95a4[_0xef53('0x40')]=qs[_0xef53('0x37')](_[_0xef53('0x3f')](_0x1a0646[_0xef53('0x35')],_0x50e681[_0xef53('0x37')]));if(_0x1a0646['query'][_0xef53('0x44')]){_0xde95a4[_0xef53('0x40')]=_[_0xef53('0x41')](_0xde95a4[_0xef53('0x40')],{'$or':_['map'](_0xde95a4[_0xef53('0x3a')],function(_0x149a1e){var _0x79b430={};_0x79b430[_0x149a1e]={'$like':'%'+_0x1a0646['query'][_0xef53('0x44')]+'%'};return _0x79b430;})});}_0xde95a4=_[_0xef53('0x41')]({},_0xde95a4,_0x1a0646[_0xef53('0x45')]);return _0x4d5f4f[_0xef53('0x8f')](_0xde95a4);}})[_0xef53('0x28')](function(_0x16348e){if(_0x16348e){_0x5d4305=_0x16348e[_0xef53('0x4e')];if(!_0x1a0646[_0xef53('0x35')][_0xef53('0x3c')]('nolimit')){_0xde95a4[_0xef53('0x21')]=qs['limit'](_0x1a0646['query'][_0xef53('0x21')]);_0xde95a4[_0xef53('0x20')]=qs[_0xef53('0x20')](_0x1a0646['query'][_0xef53('0x20')]);}return _0x4d5f4f[_0xef53('0x8f')](_0xde95a4);}})['then'](function(_0x2929ba){if(_0x2929ba){return _0x2929ba?{'count':_0x5d4305,'rows':_0x2929ba}:null;}})[_0xef53('0x28')](respondWithResult(_0xb160a7,null))[_0xef53('0x4a')](handleError(_0xb160a7,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 372b433..3c7c13f 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 _0xec05=['exports','events','../../mysqldb','MailQueue','save','remove','emit','hook'];(function(_0x433781,_0x5c8e7e){var _0x525831=function(_0x4d200f){while(--_0x4d200f){_0x433781['push'](_0x433781['shift']());}};_0x525831(++_0x5c8e7e);}(_0xec05,0x89));var _0x5ec0=function(_0x3a165a,_0x728349){_0x3a165a=_0x3a165a-0x0;var _0x37a871=_0xec05[_0x3a165a];return _0x37a871;};'use strict';var EventEmitter=require(_0x5ec0('0x0'));var MailQueue=require(_0x5ec0('0x1'))['db'][_0x5ec0('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5ec0('0x3'),'afterUpdate':'update','afterDestroy':_0x5ec0('0x4')};function emitEvent(_0x23e4aa){return function(_0x42db44,_0x3a1203,_0x284588){MailQueueEvents['emit'](_0x23e4aa+':'+_0x42db44['id'],_0x42db44);MailQueueEvents[_0x5ec0('0x5')](_0x23e4aa,_0x42db44);_0x284588(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x5ec0('0x6')](e,emitEvent(event));}}module[_0x5ec0('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x5ee1=['hook','events','../../mysqldb','MailQueue','save','update','remove','emit'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0x5ee1,0x109));var _0x15ee=function(_0x46cb9d,_0x556b06){_0x46cb9d=_0x46cb9d-0x0;var _0x4d93ca=_0x5ee1[_0x46cb9d];return _0x4d93ca;};'use strict';var EventEmitter=require(_0x15ee('0x0'));var MailQueue=require(_0x15ee('0x1'))['db'][_0x15ee('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x15ee('0x3'),'afterUpdate':_0x15ee('0x4'),'afterDestroy':_0x15ee('0x5')};function emitEvent(_0x2af1c1){return function(_0x30ba72,_0x22b469,_0x4c2f8e){MailQueueEvents[_0x15ee('0x6')](_0x2af1c1+':'+_0x30ba72['id'],_0x30ba72);MailQueueEvents[_0x15ee('0x6')](_0x2af1c1,_0x30ba72);_0x4c2f8e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x15ee('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 452417f..154092c 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 _0x5f5a=['path','rimraf','define','mail_queues','lodash','../../config/logger','moment','request-promise'];(function(_0x1e68bb,_0x389857){var _0x22a1de=function(_0x3da02c){while(--_0x3da02c){_0x1e68bb['push'](_0x1e68bb['shift']());}};_0x22a1de(++_0x389857);}(_0x5f5a,0xec));var _0xa5f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f5a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa5f5('0x0'));var util=require('util');var logger=require(_0xa5f5('0x1'))('api');var moment=require(_0xa5f5('0x2'));var BPromise=require('bluebird');var rp=require(_0xa5f5('0x3'));var fs=require('fs');var path=require(_0xa5f5('0x4'));var rimraf=require(_0xa5f5('0x5'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module['exports']=function(_0x110759,_0xc94cbf){return _0x110759[_0xa5f5('0x6')]('MailQueue',attributes,{'tableName':_0xa5f5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9daa=['request-promise','path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api'];(function(_0x2afb44,_0x249a57){var _0x15ccc2=function(_0x180748){while(--_0x180748){_0x2afb44['push'](_0x2afb44['shift']());}};_0x15ccc2(++_0x249a57);}(_0x9daa,0xf8));var _0xa9da=function(_0x18d1c5,_0x13c3f2){_0x18d1c5=_0x18d1c5-0x0;var _0x355772=_0x9daa[_0x18d1c5];return _0x355772;};'use strict';var _=require(_0xa9da('0x0'));var util=require(_0xa9da('0x1'));var logger=require(_0xa9da('0x2'))(_0xa9da('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa9da('0x4'));var fs=require('fs');var path=require(_0xa9da('0x5'));var rimraf=require('rimraf');var config=require(_0xa9da('0x6'));var attributes=require(_0xa9da('0x7'));module[_0xa9da('0x8')]=function(_0x354d59,_0x4756ed){return _0x354d59[_0xa9da('0x9')](_0xa9da('0xa'),attributes,{'tableName':_0xa9da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index dd473c7..f405077 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 _0xd356=['./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowMailQueue','MailQueue','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter'];(function(_0x7c9eef,_0x196fbb){var _0x16c4e5=function(_0x2613a6){while(--_0x2613a6){_0x7c9eef['push'](_0x7c9eef['shift']());}};_0x16c4e5(++_0x196fbb);}(_0xd356,0x163));var _0x6d35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd356[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6d35('0x0'));var moment=require(_0x6d35('0x1'));var BPromise=require(_0x6d35('0x2'));var rs=require(_0x6d35('0x3'));var fs=require('fs');var Redis=require(_0x6d35('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d35('0x5'));var logger=require(_0x6d35('0x6'))('rpc');var config=require(_0x6d35('0x7'));var jayson=require(_0x6d35('0x8'));var client=jayson[_0x6d35('0x9')][_0x6d35('0xa')]({'port':0x232a});config['redis']=_[_0x6d35('0xb')](config[_0x6d35('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d35('0xd'))(new Redis(config['redis']));require(_0x6d35('0xe'))[_0x6d35('0xf')](socket);function respondWithRpcPromise(_0x277919,_0x110665,_0x1cc3e1){return new BPromise(function(_0x2bb369,_0x278ff4){return client[_0x6d35('0x10')](_0x277919,_0x1cc3e1)[_0x6d35('0x11')](function(_0x54832c){logger[_0x6d35('0x12')](_0x6d35('0x13'),_0x110665,_0x6d35('0x14'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x110665,_0x6d35('0x14'),JSON[_0x6d35('0x15')](_0x54832c));if(_0x54832c[_0x6d35('0x16')]){if(_0x54832c['error'][_0x6d35('0x17')]===0x1f4){logger['error'](_0x6d35('0x13'),_0x110665,_0x54832c[_0x6d35('0x16')][_0x6d35('0x18')]);return _0x278ff4(_0x54832c[_0x6d35('0x16')][_0x6d35('0x18')]);}logger['error'](_0x6d35('0x13'),_0x110665,_0x54832c[_0x6d35('0x16')]['message']);return _0x2bb369(_0x54832c[_0x6d35('0x16')]['message']);}else{logger[_0x6d35('0x12')](_0x6d35('0x13'),_0x110665,_0x6d35('0x14'));_0x2bb369(_0x54832c[_0x6d35('0x19')][_0x6d35('0x18')]);}})[_0x6d35('0x1a')](function(_0x45d183){logger[_0x6d35('0x16')](_0x6d35('0x13'),_0x110665,_0x45d183);_0x278ff4(_0x45d183);});});}exports[_0x6d35('0x1b')]=function(_0x51ec3c){var _0x558515=this;return new Promise(function(_0x144141,_0x39d632){return db['MailQueue'][_0x6d35('0x1c')]({'raw':_0x51ec3c[_0x6d35('0x1d')]?_0x51ec3c[_0x6d35('0x1d')][_0x6d35('0x1e')]===undefined?!![]:![]:!![],'where':_0x51ec3c[_0x6d35('0x1d')]?_0x51ec3c[_0x6d35('0x1d')][_0x6d35('0x1f')]||null:null,'attributes':_0x51ec3c[_0x6d35('0x1d')]?_0x51ec3c['options'][_0x6d35('0x20')]||null:null,'limit':_0x51ec3c[_0x6d35('0x1d')]?_0x51ec3c[_0x6d35('0x1d')][_0x6d35('0x21')]||null:null,'include':_0x51ec3c[_0x6d35('0x1d')]?_0x51ec3c[_0x6d35('0x1d')][_0x6d35('0x22')]?_['map'](_0x51ec3c['options'][_0x6d35('0x22')],function(_0xaa5ea6){return{'model':db[_0xaa5ea6[_0x6d35('0x23')]],'as':_0xaa5ea6['as'],'attributes':_0xaa5ea6[_0x6d35('0x20')],'include':_0xaa5ea6[_0x6d35('0x22')]?_['map'](_0xaa5ea6['include'],function(_0x43df78){return{'model':db[_0x43df78[_0x6d35('0x23')]],'as':_0x43df78['as'],'attributes':_0x43df78['attributes'],'include':_0x43df78[_0x6d35('0x22')]?_[_0x6d35('0x24')](_0x43df78[_0x6d35('0x22')],function(_0x4cf6cb){return{'model':db[_0x4cf6cb['model']],'as':_0x4cf6cb['as'],'attributes':_0x4cf6cb['attributes']};}):[]};}):[]};}):[]:[]})[_0x6d35('0x11')](function(_0x11f077){logger[_0x6d35('0x12')]('GetMailQueue',_0x51ec3c);logger[_0x6d35('0x25')](_0x6d35('0x1b'),_0x51ec3c,JSON[_0x6d35('0x15')](_0x11f077));_0x144141(_0x11f077);})[_0x6d35('0x1a')](function(_0x9bd823){logger[_0x6d35('0x16')]('GetMailQueue',_0x9bd823[_0x6d35('0x18')],_0x51ec3c);_0x39d632(_0x558515[_0x6d35('0x16')](0x1f4,_0x9bd823[_0x6d35('0x18')]));});});};exports[_0x6d35('0x26')]=function(_0x704f7e){var _0x5b0341=this;return new Promise(function(_0x320de9,_0x23a2e8){return db[_0x6d35('0x27')][_0x6d35('0x28')]({'raw':_0x704f7e[_0x6d35('0x1d')]?_0x704f7e[_0x6d35('0x1d')][_0x6d35('0x1e')]===undefined?!![]:![]:!![],'where':_0x704f7e['options']?_0x704f7e[_0x6d35('0x1d')]['where']||null:null,'attributes':_0x704f7e[_0x6d35('0x1d')]?_0x704f7e[_0x6d35('0x1d')]['attributes']||null:null,'include':_0x704f7e[_0x6d35('0x1d')]?_0x704f7e['options']['include']?_['map'](_0x704f7e[_0x6d35('0x1d')][_0x6d35('0x22')],function(_0x4604bf){return{'model':db[_0x4604bf[_0x6d35('0x23')]],'as':_0x4604bf['as'],'attributes':_0x4604bf[_0x6d35('0x20')],'include':_0x4604bf['include']?_['map'](_0x4604bf['include'],function(_0x4dda64){return{'model':db[_0x4dda64['model']],'as':_0x4dda64['as'],'attributes':_0x4dda64[_0x6d35('0x20')],'include':_0x4dda64[_0x6d35('0x22')]?_[_0x6d35('0x24')](_0x4dda64[_0x6d35('0x22')],function(_0x48463e){return{'model':db[_0x48463e['model']],'as':_0x48463e['as'],'attributes':_0x48463e[_0x6d35('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6d35('0x11')](function(_0x257248){logger[_0x6d35('0x12')](_0x6d35('0x26'),_0x704f7e);logger['debug'](_0x6d35('0x26'),_0x704f7e,JSON[_0x6d35('0x15')](_0x257248));_0x320de9(_0x257248);})[_0x6d35('0x1a')](function(_0x5d3907){logger[_0x6d35('0x16')](_0x6d35('0x26'),_0x5d3907[_0x6d35('0x18')],_0x704f7e);_0x23a2e8(_0x5b0341['error'](0x1f4,_0x5d3907[_0x6d35('0x18')]));});});}; \ No newline at end of file +var _0x0a17=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','map','model','ShowMailQueue','find','lodash','util'];(function(_0x4771d9,_0x269403){var _0x1f0144=function(_0x5b5f1e){while(--_0x5b5f1e){_0x4771d9['push'](_0x4771d9['shift']());}};_0x1f0144(++_0x269403);}(_0x0a17,0x16f));var _0x70a1=function(_0x31a422,_0x37e7c3){_0x31a422=_0x31a422-0x0;var _0x3d89ef=_0x0a17[_0x31a422];return _0x3d89ef;};'use strict';var _=require(_0x70a1('0x0'));var util=require(_0x70a1('0x1'));var moment=require(_0x70a1('0x2'));var BPromise=require(_0x70a1('0x3'));var rs=require(_0x70a1('0x4'));var fs=require('fs');var Redis=require(_0x70a1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x70a1('0x6'));var logger=require(_0x70a1('0x7'))(_0x70a1('0x8'));var config=require('../../config/environment');var jayson=require(_0x70a1('0x9'));var client=jayson[_0x70a1('0xa')]['http']({'port':0x232a});config[_0x70a1('0xb')]=_[_0x70a1('0xc')](config[_0x70a1('0xb')],{'host':_0x70a1('0xd'),'port':0x18eb});var socket=require(_0x70a1('0xe'))(new Redis(config[_0x70a1('0xb')]));require(_0x70a1('0xf'))[_0x70a1('0x10')](socket);function respondWithRpcPromise(_0x3713f0,_0x17db44,_0x269682){return new BPromise(function(_0x54cc36,_0x57f92b){return client[_0x70a1('0x11')](_0x3713f0,_0x269682)[_0x70a1('0x12')](function(_0x20859c){logger[_0x70a1('0x13')](_0x70a1('0x14'),_0x17db44,_0x70a1('0x15'));logger[_0x70a1('0x16')](_0x70a1('0x17'),_0x17db44,_0x70a1('0x15'),JSON[_0x70a1('0x18')](_0x20859c));if(_0x20859c['error']){if(_0x20859c[_0x70a1('0x19')][_0x70a1('0x1a')]===0x1f4){logger[_0x70a1('0x19')](_0x70a1('0x14'),_0x17db44,_0x20859c[_0x70a1('0x19')][_0x70a1('0x1b')]);return _0x57f92b(_0x20859c[_0x70a1('0x19')][_0x70a1('0x1b')]);}logger['error'](_0x70a1('0x14'),_0x17db44,_0x20859c[_0x70a1('0x19')][_0x70a1('0x1b')]);return _0x54cc36(_0x20859c['error'][_0x70a1('0x1b')]);}else{logger['info'](_0x70a1('0x14'),_0x17db44,_0x70a1('0x15'));_0x54cc36(_0x20859c['result'][_0x70a1('0x1b')]);}})[_0x70a1('0x1c')](function(_0x391e15){logger['error'](_0x70a1('0x14'),_0x17db44,_0x391e15);_0x57f92b(_0x391e15);});});}exports[_0x70a1('0x1d')]=function(_0x281ac7){var _0x4571b4=this;return new Promise(function(_0x8444e4,_0x28b963){return db[_0x70a1('0x1e')][_0x70a1('0x1f')]({'raw':_0x281ac7[_0x70a1('0x20')]?_0x281ac7[_0x70a1('0x20')][_0x70a1('0x21')]===undefined?!![]:![]:!![],'where':_0x281ac7[_0x70a1('0x20')]?_0x281ac7[_0x70a1('0x20')][_0x70a1('0x22')]||null:null,'attributes':_0x281ac7[_0x70a1('0x20')]?_0x281ac7[_0x70a1('0x20')][_0x70a1('0x23')]||null:null,'limit':_0x281ac7['options']?_0x281ac7[_0x70a1('0x20')]['limit']||null:null,'include':_0x281ac7['options']?_0x281ac7[_0x70a1('0x20')][_0x70a1('0x24')]?_[_0x70a1('0x25')](_0x281ac7[_0x70a1('0x20')][_0x70a1('0x24')],function(_0x967b7a){return{'model':db[_0x967b7a['model']],'as':_0x967b7a['as'],'attributes':_0x967b7a[_0x70a1('0x23')],'include':_0x967b7a['include']?_[_0x70a1('0x25')](_0x967b7a[_0x70a1('0x24')],function(_0x1b5590){return{'model':db[_0x1b5590[_0x70a1('0x26')]],'as':_0x1b5590['as'],'attributes':_0x1b5590[_0x70a1('0x23')],'include':_0x1b5590['include']?_[_0x70a1('0x25')](_0x1b5590[_0x70a1('0x24')],function(_0x4956a8){return{'model':db[_0x4956a8[_0x70a1('0x26')]],'as':_0x4956a8['as'],'attributes':_0x4956a8['attributes']};}):[]};}):[]};}):[]:[]})[_0x70a1('0x12')](function(_0x534d17){logger[_0x70a1('0x13')](_0x70a1('0x1d'),_0x281ac7);logger[_0x70a1('0x16')]('GetMailQueue',_0x281ac7,JSON['stringify'](_0x534d17));_0x8444e4(_0x534d17);})[_0x70a1('0x1c')](function(_0x46e8ee){logger[_0x70a1('0x19')]('GetMailQueue',_0x46e8ee[_0x70a1('0x1b')],_0x281ac7);_0x28b963(_0x4571b4['error'](0x1f4,_0x46e8ee[_0x70a1('0x1b')]));});});};exports[_0x70a1('0x27')]=function(_0x3caf20){var _0x3e32cc=this;return new Promise(function(_0xe646a2,_0x443bb1){return db['MailQueue'][_0x70a1('0x28')]({'raw':_0x3caf20[_0x70a1('0x20')]?_0x3caf20[_0x70a1('0x20')][_0x70a1('0x21')]===undefined?!![]:![]:!![],'where':_0x3caf20[_0x70a1('0x20')]?_0x3caf20[_0x70a1('0x20')][_0x70a1('0x22')]||null:null,'attributes':_0x3caf20[_0x70a1('0x20')]?_0x3caf20[_0x70a1('0x20')][_0x70a1('0x23')]||null:null,'include':_0x3caf20[_0x70a1('0x20')]?_0x3caf20[_0x70a1('0x20')]['include']?_[_0x70a1('0x25')](_0x3caf20[_0x70a1('0x20')][_0x70a1('0x24')],function(_0x43f28d){return{'model':db[_0x43f28d[_0x70a1('0x26')]],'as':_0x43f28d['as'],'attributes':_0x43f28d['attributes'],'include':_0x43f28d[_0x70a1('0x24')]?_[_0x70a1('0x25')](_0x43f28d[_0x70a1('0x24')],function(_0x57a287){return{'model':db[_0x57a287[_0x70a1('0x26')]],'as':_0x57a287['as'],'attributes':_0x57a287[_0x70a1('0x23')],'include':_0x57a287[_0x70a1('0x24')]?_[_0x70a1('0x25')](_0x57a287[_0x70a1('0x24')],function(_0x4ae40e){return{'model':db[_0x4ae40e[_0x70a1('0x26')]],'as':_0x4ae40e['as'],'attributes':_0x4ae40e[_0x70a1('0x23')]};}):[]};}):[]};}):[]:[]})[_0x70a1('0x12')](function(_0x286536){logger['info'](_0x70a1('0x27'),_0x3caf20);logger[_0x70a1('0x16')](_0x70a1('0x27'),_0x3caf20,JSON[_0x70a1('0x18')](_0x286536));_0xe646a2(_0x286536);})[_0x70a1('0x1c')](function(_0x430188){logger[_0x70a1('0x19')](_0x70a1('0x27'),_0x430188[_0x70a1('0x1b')],_0x3caf20);_0x443bb1(_0x3e32cc[_0x70a1('0x19')](0x1f4,_0x430188['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index fa68b1c..815e403 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 _0x1503=['remove','update','removeListener','register','length','mailQueue:','save'];(function(_0x20bb90,_0x45dfeb){var _0x4b6b34=function(_0x1741ea){while(--_0x1741ea){_0x20bb90['push'](_0x20bb90['shift']());}};_0x4b6b34(++_0x45dfeb);}(_0x1503,0x148));var _0x3150=function(_0x4c9b45,_0x149850){_0x4c9b45=_0x4c9b45-0x0;var _0xbf3f9f=_0x1503[_0x4c9b45];return _0xbf3f9f;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x3150('0x0'),_0x3150('0x1'),_0x3150('0x2')];function createListener(_0x38b8ce,_0x3c8388){return function(_0x1a0f06){_0x3c8388['emit'](_0x38b8ce,_0x1a0f06);};}function removeListener(_0x50029c,_0x5cf895){return function(){MailQueueEvents[_0x3150('0x3')](_0x50029c,_0x5cf895);};}exports[_0x3150('0x4')]=function(_0x102927){for(var _0x47d9ed=0x0,_0x5cb177=events[_0x3150('0x5')];_0x47d9ed<_0x5cb177;_0x47d9ed++){var _0x3e75f9=events[_0x47d9ed];var _0x28d138=createListener(_0x3150('0x6')+_0x3e75f9,_0x102927);MailQueueEvents['on'](_0x3e75f9,_0x28d138);}}; \ No newline at end of file +var _0x211c=['remove','update','emit','register','mailQueue:','./mailQueue.events','save'];(function(_0x14d674,_0x538760){var _0x3a28f4=function(_0x1a006b){while(--_0x1a006b){_0x14d674['push'](_0x14d674['shift']());}};_0x3a28f4(++_0x538760);}(_0x211c,0x83));var _0xc211=function(_0xccc9cc,_0x4d6a79){_0xccc9cc=_0xccc9cc-0x0;var _0xb8ecc7=_0x211c[_0xccc9cc];return _0xb8ecc7;};'use strict';var MailQueueEvents=require(_0xc211('0x0'));var events=[_0xc211('0x1'),_0xc211('0x2'),_0xc211('0x3')];function createListener(_0x4eca24,_0x2e10bb){return function(_0x4a82e8){_0x2e10bb[_0xc211('0x4')](_0x4eca24,_0x4a82e8);};}function removeListener(_0x3cf44a,_0xd3f18d){return function(){MailQueueEvents['removeListener'](_0x3cf44a,_0xd3f18d);};}exports[_0xc211('0x5')]=function(_0x5f0ac1){for(var _0x2d4b9c=0x0,_0x4ee41e=events['length'];_0x2d4b9c<_0x4ee41e;_0x2d4b9c++){var _0x4761b4=events[_0x2d4b9c];var _0x2e7115=createListener(_0xc211('0x6')+_0x4761b4,_0x5f0ac1);MailQueueEvents['on'](_0x4761b4,_0x2e7115);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 45dbed5..b10cce6 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 _0x70e9=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated'];(function(_0xb4710a,_0x585188){var _0x602935=function(_0x1e86bd){while(--_0x1e86bd){_0xb4710a['push'](_0xb4710a['shift']());}};_0x602935(++_0x585188);}(_0x70e9,0x174));var _0x970e=function(_0x51ea6d,_0xb47854){_0x51ea6d=_0x51ea6d-0x0;var _0x4018ca=_0x70e9[_0x51ea6d];return _0x4018ca;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x970e('0x0'));var timeout=require(_0x970e('0x1'));var express=require(_0x970e('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x970e('0x3'));var config=require(_0x970e('0x4'));var controller=require(_0x970e('0x5'));router[_0x970e('0x6')]('/',auth[_0x970e('0x7')](),controller[_0x970e('0x8')]);router[_0x970e('0x6')](_0x970e('0x9'),auth[_0x970e('0x7')](),controller[_0x970e('0xa')]);router[_0x970e('0x6')](_0x970e('0xb'),auth['isAuthenticated'](),controller[_0x970e('0xc')]);router[_0x970e('0xd')]('/',auth[_0x970e('0x7')](),controller[_0x970e('0xe')]);router[_0x970e('0xf')](_0x970e('0xb'),auth[_0x970e('0x7')](),controller[_0x970e('0x10')]);router[_0x970e('0x11')](_0x970e('0xb'),auth[_0x970e('0x7')](),controller[_0x970e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x2d21=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0x2d21,0x136));var _0x12d2=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0x2d21[_0x37e886];return _0x57c5cd;};'use strict';var multer=require(_0x12d2('0x0'));var util=require(_0x12d2('0x1'));var path=require(_0x12d2('0x2'));var timeout=require(_0x12d2('0x3'));var express=require(_0x12d2('0x4'));var router=express[_0x12d2('0x5')]();var auth=require(_0x12d2('0x6'));var interaction=require(_0x12d2('0x7'));var config=require(_0x12d2('0x8'));var controller=require(_0x12d2('0x9'));router['get']('/',auth[_0x12d2('0xa')](),controller[_0x12d2('0xb')]);router[_0x12d2('0xc')]('/describe',auth[_0x12d2('0xa')](),controller[_0x12d2('0xd')]);router[_0x12d2('0xc')](_0x12d2('0xe'),auth[_0x12d2('0xa')](),controller[_0x12d2('0xf')]);router[_0x12d2('0x10')]('/',auth['isAuthenticated'](),controller[_0x12d2('0x11')]);router[_0x12d2('0x12')](_0x12d2('0xe'),auth[_0x12d2('0xa')](),controller['update']);router['delete'](_0x12d2('0xe'),auth[_0x12d2('0xa')](),controller[_0x12d2('0x13')]);module[_0x12d2('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ab48183..1e15614 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 _0x9ed5=['exports','STRING','DATE','moment','sequelize'];(function(_0x5ecb4c,_0x864bed){var _0x93757f=function(_0x24a63d){while(--_0x24a63d){_0x5ecb4c['push'](_0x5ecb4c['shift']());}};_0x93757f(++_0x864bed);}(_0x9ed5,0x80));var _0x59ed=function(_0x2a3c0a,_0x163f5c){_0x2a3c0a=_0x2a3c0a-0x0;var _0x1703a2=_0x9ed5[_0x2a3c0a];return _0x1703a2;};'use strict';var moment=require(_0x59ed('0x0'));var Sequelize=require(_0x59ed('0x1'));module[_0x59ed('0x2')]={'uniqueid':{'type':Sequelize[_0x59ed('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x59ed('0x3')]},'joinAt':{'type':Sequelize[_0x59ed('0x4')]},'leaveAt':{'type':Sequelize[_0x59ed('0x4')]},'acceptAt':{'type':Sequelize[_0x59ed('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x59ed('0x3')]}}; \ No newline at end of file +var _0x0423=['sequelize','STRING','DATE','moment'];(function(_0x14e51e,_0xed289b){var _0xf93e94=function(_0x4ed5bb){while(--_0x4ed5bb){_0x14e51e['push'](_0x14e51e['shift']());}};_0xf93e94(++_0xed289b);}(_0x0423,0x183));var _0x3042=function(_0x37ed52,_0x2caac7){_0x37ed52=_0x37ed52-0x0;var _0x2b31dc=_0x0423[_0x37ed52];return _0x2b31dc;};'use strict';var moment=require(_0x3042('0x0'));var Sequelize=require(_0x3042('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3042('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3042('0x3')]},'leaveAt':{'type':Sequelize[_0x3042('0x3')]},'acceptAt':{'type':Sequelize[_0x3042('0x3')]},'exitAt':{'type':Sequelize[_0x3042('0x3')]},'reason':{'type':Sequelize[_0x3042('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 7c7de04..d2b5abb 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 _0x0cb4=['status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','name','send','index','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','rows','show','include','options','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','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','sendStatus'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0x0cb4,0x77));var _0x40cb=function(_0x22eb38,_0x1edf88){_0x22eb38=_0x22eb38-0x0;var _0x28dea4=_0x0cb4[_0x22eb38];return _0x28dea4;};'use strict';var pdf=require(_0x40cb('0x0'));var emlformat=require(_0x40cb('0x1'));var rimraf=require(_0x40cb('0x2'));var zipdir=require(_0x40cb('0x3'));var jsonpatch=require(_0x40cb('0x4'));var rp=require('request-promise');var moment=require(_0x40cb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x40cb('0x6'));var util=require(_0x40cb('0x7'));var path=require('path');var sox=require(_0x40cb('0x8'));var csv=require('to-csv');var ejs=require(_0x40cb('0x9'));var fs=require('fs');var _=require(_0x40cb('0xa'));var squel=require(_0x40cb('0xb'));var crypto=require(_0x40cb('0xc'));var jsforce=require(_0x40cb('0xd'));var deskjs=require(_0x40cb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x40cb('0xf'));var Redis=require(_0x40cb('0x10'));var authService=require(_0x40cb('0x11'));var qs=require(_0x40cb('0x12'));var as=require(_0x40cb('0x13'));var hardwareService=require(_0x40cb('0x14'));var logger=require(_0x40cb('0x15'))(_0x40cb('0x16'));var utils=require(_0x40cb('0x17'));var config=require(_0x40cb('0x18'));var db=require(_0x40cb('0x19'))['db'];function respondWithStatusCode(_0x2805f1,_0x875a95){_0x875a95=_0x875a95||0xcc;return function(_0x19a09e){if(_0x19a09e){return _0x2805f1[_0x40cb('0x1a')](_0x875a95);}return _0x2805f1[_0x40cb('0x1b')](_0x875a95)[_0x40cb('0x1c')]();};}function respondWithResult(_0x210e8b,_0x5d22f1){_0x5d22f1=_0x5d22f1||0xc8;return function(_0x392958){if(_0x392958){return _0x210e8b[_0x40cb('0x1b')](_0x5d22f1)['json'](_0x392958);}};}function respondWithFilteredResult(_0x1bdfde,_0x127172){return function(_0x162bea){if(_0x162bea){var _0x4a885a=_0x162bea[_0x40cb('0x1d')],_0x1b50ac=_0x127172[_0x40cb('0x1e')],_0x2d40fa=_0x127172['offset']+_0x127172[_0x40cb('0x1f')],_0x314c6b;if(_0x2d40fa>=_0x4a885a){_0x2d40fa=_0x4a885a;_0x314c6b=0xc8;}else{_0x314c6b=0xce;}_0x1bdfde['status'](_0x314c6b);return _0x1bdfde[_0x40cb('0x20')](_0x40cb('0x21'),_0x1b50ac+'-'+_0x2d40fa+'/'+_0x4a885a)[_0x40cb('0x22')](_0x162bea);}return null;};}function patchUpdates(_0x5a49a9){return function(_0x2f3b4e){try{jsonpatch[_0x40cb('0x23')](_0x2f3b4e,_0x5a49a9,!![]);}catch(_0x1db94a){return BPromise['reject'](_0x1db94a);}return _0x2f3b4e[_0x40cb('0x24')]();};}function saveUpdates(_0x56fc90,_0x3fc921){return function(_0x25b418){if(_0x25b418){return _0x25b418[_0x40cb('0x25')](_0x56fc90)[_0x40cb('0x26')](function(_0x39cfc6){return _0x39cfc6;});}return null;};}function removeEntity(_0x15baec,_0x4ecd85){return function(_0x466431){if(_0x466431){return _0x466431[_0x40cb('0x27')]()[_0x40cb('0x26')](function(){_0x15baec[_0x40cb('0x1b')](0xcc)[_0x40cb('0x1c')]();});}};}function handleEntityNotFound(_0xf2036,_0x20bc1f){return function(_0x943bd7){if(!_0x943bd7){_0xf2036[_0x40cb('0x1a')](0x194);}return _0x943bd7;};}function handleError(_0x4802bb,_0x1dd9bf){_0x1dd9bf=_0x1dd9bf||0x1f4;return function(_0x170d06){logger['error'](_0x170d06['stack']);if(_0x170d06[_0x40cb('0x28')]){delete _0x170d06['name'];}_0x4802bb[_0x40cb('0x1b')](_0x1dd9bf)[_0x40cb('0x29')](_0x170d06);};}exports[_0x40cb('0x2a')]=function(_0x489d94,_0x415714){var _0x29c149={},_0x5c40e7={},_0x102d78={'count':0x0,'rows':[]};var _0xfb46bf=_['map'](db[_0x40cb('0x2b')][_0x40cb('0x2c')],function(_0x41a072){return{'name':_0x41a072[_0x40cb('0x2d')],'type':_0x41a072[_0x40cb('0x2e')][_0x40cb('0x2f')]};});_0x5c40e7[_0x40cb('0x30')]=_['map'](_0xfb46bf,_0x40cb('0x28'));_0x5c40e7[_0x40cb('0x31')]=_[_0x40cb('0x32')](_0x489d94[_0x40cb('0x31')]);_0x5c40e7[_0x40cb('0x33')]=_[_0x40cb('0x34')](_0x5c40e7[_0x40cb('0x30')],_0x5c40e7[_0x40cb('0x31')]);_0x29c149[_0x40cb('0x35')]=_[_0x40cb('0x34')](_0x5c40e7[_0x40cb('0x30')],qs[_0x40cb('0x36')](_0x489d94[_0x40cb('0x31')][_0x40cb('0x36')]));_0x29c149['attributes']=_0x29c149['attributes']['length']?_0x29c149['attributes']:_0x5c40e7[_0x40cb('0x30')];if(!_0x489d94[_0x40cb('0x31')][_0x40cb('0x37')](_0x40cb('0x38'))){_0x29c149['limit']=qs['limit'](_0x489d94['query'][_0x40cb('0x1f')]);_0x29c149[_0x40cb('0x1e')]=qs[_0x40cb('0x1e')](_0x489d94[_0x40cb('0x31')][_0x40cb('0x1e')]);}_0x29c149['order']=qs[_0x40cb('0x39')](_0x489d94[_0x40cb('0x31')][_0x40cb('0x39')]);_0x29c149[_0x40cb('0x3a')]=qs['filters'](_['pick'](_0x489d94[_0x40cb('0x31')],_0x5c40e7[_0x40cb('0x33')]));if(_0x489d94['query'][_0x40cb('0x3b')]){_0x29c149['where']=_[_0x40cb('0x3c')](_0x29c149['where'],{'$or':_['map'](_0xfb46bf,function(_0x330a17){if(_0x330a17[_0x40cb('0x2e')]!==_0x40cb('0x3d')){var _0x3256bd={};_0x3256bd[_0x330a17[_0x40cb('0x28')]]={'$like':'%'+_0x489d94[_0x40cb('0x31')][_0x40cb('0x3b')]+'%'};return _0x3256bd;}})});}_0x29c149=_[_0x40cb('0x3c')]({},_0x29c149,_0x489d94['options']);var _0x199d95={'where':_0x29c149[_0x40cb('0x3a')]};return db[_0x40cb('0x2b')]['count'](_0x199d95)[_0x40cb('0x26')](function(_0x37581a){_0x102d78['count']=_0x37581a;if(_0x489d94[_0x40cb('0x31')][_0x40cb('0x3e')]){_0x29c149['include']=[{'all':!![]}];}return db[_0x40cb('0x2b')]['findAll'](_0x29c149);})[_0x40cb('0x26')](function(_0x2c306a){_0x102d78[_0x40cb('0x3f')]=_0x2c306a;return _0x102d78;})[_0x40cb('0x26')](respondWithFilteredResult(_0x415714,_0x29c149))['catch'](handleError(_0x415714,null));};exports[_0x40cb('0x40')]=function(_0x15c01f,_0x39ce76){var _0x224f2a={'raw':!![],'where':{'id':_0x15c01f['params']['id']}},_0x144a6c={};_0x144a6c['model']=_['keys'](db[_0x40cb('0x2b')][_0x40cb('0x2c')]);_0x144a6c[_0x40cb('0x31')]=_[_0x40cb('0x32')](_0x15c01f['query']);_0x144a6c[_0x40cb('0x33')]=_[_0x40cb('0x34')](_0x144a6c[_0x40cb('0x30')],_0x144a6c[_0x40cb('0x31')]);_0x224f2a[_0x40cb('0x35')]=_[_0x40cb('0x34')](_0x144a6c[_0x40cb('0x30')],qs['fields'](_0x15c01f['query'][_0x40cb('0x36')]));_0x224f2a[_0x40cb('0x35')]=_0x224f2a[_0x40cb('0x35')]['length']?_0x224f2a['attributes']:_0x144a6c[_0x40cb('0x30')];if(_0x15c01f[_0x40cb('0x31')][_0x40cb('0x3e')]){_0x224f2a[_0x40cb('0x41')]=[{'all':!![]}];}_0x224f2a=_[_0x40cb('0x3c')]({},_0x224f2a,_0x15c01f[_0x40cb('0x42')]);return db['MailQueueReport'][_0x40cb('0x43')](_0x224f2a)[_0x40cb('0x26')](handleEntityNotFound(_0x39ce76,null))['then'](respondWithResult(_0x39ce76,null))[_0x40cb('0x44')](handleError(_0x39ce76,null));};exports[_0x40cb('0x45')]=function(_0x319c2e,_0x5d0429){return db[_0x40cb('0x2b')][_0x40cb('0x45')](_0x319c2e[_0x40cb('0x46')],{})[_0x40cb('0x26')](respondWithResult(_0x5d0429,0xc9))[_0x40cb('0x44')](handleError(_0x5d0429,null));};exports[_0x40cb('0x25')]=function(_0x1cbccc,_0x3d5112){if(_0x1cbccc[_0x40cb('0x46')]['id']){delete _0x1cbccc[_0x40cb('0x46')]['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x1cbccc[_0x40cb('0x47')]['id']}})[_0x40cb('0x26')](handleEntityNotFound(_0x3d5112,null))[_0x40cb('0x26')](saveUpdates(_0x1cbccc[_0x40cb('0x46')],null))['then'](respondWithResult(_0x3d5112,null))[_0x40cb('0x44')](handleError(_0x3d5112,null));};exports[_0x40cb('0x27')]=function(_0x2c7f03,_0x15a30c){return db[_0x40cb('0x2b')][_0x40cb('0x43')]({'where':{'id':_0x2c7f03[_0x40cb('0x47')]['id']}})[_0x40cb('0x26')](handleEntityNotFound(_0x15a30c,null))[_0x40cb('0x26')](removeEntity(_0x15a30c,null))['catch'](handleError(_0x15a30c,null));};exports[_0x40cb('0x48')]=function(_0x2d2567,_0x59f20b){return db[_0x40cb('0x2b')][_0x40cb('0x48')]()[_0x40cb('0x26')](respondWithResult(_0x59f20b,null))[_0x40cb('0x44')](handleError(_0x59f20b,null));}; \ No newline at end of file +var _0xcd55=['fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','destroy','then','error','name','send','index','MailQueueReport','rawAttributes'];(function(_0xb03f9,_0x588391){var _0x3ec30a=function(_0x3ef5e7){while(--_0x3ef5e7){_0xb03f9['push'](_0xb03f9['shift']());}};_0x3ec30a(++_0x588391);}(_0xcd55,0x110));var _0x5cd5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xcd55[_0x2c91e9];return _0x13f0ff;};'use strict';var pdf=require(_0x5cd5('0x0'));var emlformat=require(_0x5cd5('0x1'));var rimraf=require(_0x5cd5('0x2'));var zipdir=require(_0x5cd5('0x3'));var jsonpatch=require(_0x5cd5('0x4'));var rp=require(_0x5cd5('0x5'));var moment=require(_0x5cd5('0x6'));var BPromise=require(_0x5cd5('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5cd5('0x8'));var sox=require(_0x5cd5('0x9'));var csv=require(_0x5cd5('0xa'));var ejs=require(_0x5cd5('0xb'));var fs=require('fs');var _=require(_0x5cd5('0xc'));var squel=require(_0x5cd5('0xd'));var crypto=require(_0x5cd5('0xe'));var jsforce=require(_0x5cd5('0xf'));var deskjs=require(_0x5cd5('0x10'));var toCsv=require(_0x5cd5('0xa'));var querystring=require(_0x5cd5('0x11'));var Papa=require(_0x5cd5('0x12'));var Redis=require(_0x5cd5('0x13'));var authService=require(_0x5cd5('0x14'));var qs=require(_0x5cd5('0x15'));var as=require(_0x5cd5('0x16'));var hardwareService=require(_0x5cd5('0x17'));var logger=require(_0x5cd5('0x18'))(_0x5cd5('0x19'));var utils=require(_0x5cd5('0x1a'));var config=require(_0x5cd5('0x1b'));var db=require(_0x5cd5('0x1c'))['db'];function respondWithStatusCode(_0x563152,_0x78cabf){_0x78cabf=_0x78cabf||0xcc;return function(_0x4b2308){if(_0x4b2308){return _0x563152[_0x5cd5('0x1d')](_0x78cabf);}return _0x563152[_0x5cd5('0x1e')](_0x78cabf)[_0x5cd5('0x1f')]();};}function respondWithResult(_0xc1f762,_0x1d6237){_0x1d6237=_0x1d6237||0xc8;return function(_0x4bcbc0){if(_0x4bcbc0){return _0xc1f762[_0x5cd5('0x1e')](_0x1d6237)[_0x5cd5('0x20')](_0x4bcbc0);}};}function respondWithFilteredResult(_0x2d3588,_0x59b350){return function(_0x3f3d5d){if(_0x3f3d5d){var _0x25354e=_0x3f3d5d[_0x5cd5('0x21')],_0x35def9=_0x59b350[_0x5cd5('0x22')],_0x1abaee=_0x59b350[_0x5cd5('0x22')]+_0x59b350['limit'],_0x4db6e7;if(_0x1abaee>=_0x25354e){_0x1abaee=_0x25354e;_0x4db6e7=0xc8;}else{_0x4db6e7=0xce;}_0x2d3588[_0x5cd5('0x1e')](_0x4db6e7);return _0x2d3588[_0x5cd5('0x23')]('Content-Range',_0x35def9+'-'+_0x1abaee+'/'+_0x25354e)[_0x5cd5('0x20')](_0x3f3d5d);}return null;};}function patchUpdates(_0x30f842){return function(_0x33ca37){try{jsonpatch[_0x5cd5('0x24')](_0x33ca37,_0x30f842,!![]);}catch(_0x78ef8c){return BPromise[_0x5cd5('0x25')](_0x78ef8c);}return _0x33ca37[_0x5cd5('0x26')]();};}function saveUpdates(_0x4076d4,_0x223227){return function(_0x36388e){if(_0x36388e){return _0x36388e[_0x5cd5('0x27')](_0x4076d4)['then'](function(_0x18e28f){return _0x18e28f;});}return null;};}function removeEntity(_0x20e661,_0x27912f){return function(_0x24cf5d){if(_0x24cf5d){return _0x24cf5d[_0x5cd5('0x28')]()[_0x5cd5('0x29')](function(){_0x20e661[_0x5cd5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27858e,_0x23c35c){return function(_0x372185){if(!_0x372185){_0x27858e[_0x5cd5('0x1d')](0x194);}return _0x372185;};}function handleError(_0x15d609,_0x561556){_0x561556=_0x561556||0x1f4;return function(_0x3684ef){logger[_0x5cd5('0x2a')](_0x3684ef['stack']);if(_0x3684ef[_0x5cd5('0x2b')]){delete _0x3684ef[_0x5cd5('0x2b')];}_0x15d609['status'](_0x561556)[_0x5cd5('0x2c')](_0x3684ef);};}exports[_0x5cd5('0x2d')]=function(_0x23bed3,_0x1aa3a7){var _0x4ba4d8={},_0x1a7c51={},_0x370235={'count':0x0,'rows':[]};var _0x5ee6c3=_['map'](db[_0x5cd5('0x2e')][_0x5cd5('0x2f')],function(_0x46886e){return{'name':_0x46886e[_0x5cd5('0x30')],'type':_0x46886e['type'][_0x5cd5('0x31')]};});_0x1a7c51[_0x5cd5('0x32')]=_[_0x5cd5('0x33')](_0x5ee6c3,_0x5cd5('0x2b'));_0x1a7c51[_0x5cd5('0x34')]=_['keys'](_0x23bed3[_0x5cd5('0x34')]);_0x1a7c51[_0x5cd5('0x35')]=_[_0x5cd5('0x36')](_0x1a7c51[_0x5cd5('0x32')],_0x1a7c51['query']);_0x4ba4d8['attributes']=_[_0x5cd5('0x36')](_0x1a7c51[_0x5cd5('0x32')],qs[_0x5cd5('0x37')](_0x23bed3[_0x5cd5('0x34')]['fields']));_0x4ba4d8[_0x5cd5('0x38')]=_0x4ba4d8['attributes'][_0x5cd5('0x39')]?_0x4ba4d8[_0x5cd5('0x38')]:_0x1a7c51[_0x5cd5('0x32')];if(!_0x23bed3[_0x5cd5('0x34')][_0x5cd5('0x3a')](_0x5cd5('0x3b'))){_0x4ba4d8[_0x5cd5('0x3c')]=qs[_0x5cd5('0x3c')](_0x23bed3[_0x5cd5('0x34')][_0x5cd5('0x3c')]);_0x4ba4d8[_0x5cd5('0x22')]=qs['offset'](_0x23bed3[_0x5cd5('0x34')][_0x5cd5('0x22')]);}_0x4ba4d8[_0x5cd5('0x3d')]=qs[_0x5cd5('0x3e')](_0x23bed3[_0x5cd5('0x34')]['sort']);_0x4ba4d8[_0x5cd5('0x3f')]=qs[_0x5cd5('0x35')](_[_0x5cd5('0x40')](_0x23bed3['query'],_0x1a7c51[_0x5cd5('0x35')]));if(_0x23bed3[_0x5cd5('0x34')][_0x5cd5('0x41')]){_0x4ba4d8['where']=_[_0x5cd5('0x42')](_0x4ba4d8[_0x5cd5('0x3f')],{'$or':_[_0x5cd5('0x33')](_0x5ee6c3,function(_0x5c28e6){if(_0x5c28e6[_0x5cd5('0x43')]!=='VIRTUAL'){var _0x3de350={};_0x3de350[_0x5c28e6[_0x5cd5('0x2b')]]={'$like':'%'+_0x23bed3[_0x5cd5('0x34')][_0x5cd5('0x41')]+'%'};return _0x3de350;}})});}_0x4ba4d8=_[_0x5cd5('0x42')]({},_0x4ba4d8,_0x23bed3[_0x5cd5('0x44')]);var _0xfc4592={'where':_0x4ba4d8[_0x5cd5('0x3f')]};return db['MailQueueReport'][_0x5cd5('0x21')](_0xfc4592)[_0x5cd5('0x29')](function(_0x23e4e7){_0x370235[_0x5cd5('0x21')]=_0x23e4e7;if(_0x23bed3['query'][_0x5cd5('0x45')]){_0x4ba4d8[_0x5cd5('0x46')]=[{'all':!![]}];}return db['MailQueueReport'][_0x5cd5('0x47')](_0x4ba4d8);})['then'](function(_0x28621b){_0x370235[_0x5cd5('0x48')]=_0x28621b;return _0x370235;})[_0x5cd5('0x29')](respondWithFilteredResult(_0x1aa3a7,_0x4ba4d8))[_0x5cd5('0x49')](handleError(_0x1aa3a7,null));};exports['show']=function(_0x36bc78,_0x35903c){var _0x2195c5={'raw':!![],'where':{'id':_0x36bc78[_0x5cd5('0x4a')]['id']}},_0x285f37={};_0x285f37[_0x5cd5('0x32')]=_['keys'](db[_0x5cd5('0x2e')][_0x5cd5('0x2f')]);_0x285f37[_0x5cd5('0x34')]=_[_0x5cd5('0x4b')](_0x36bc78[_0x5cd5('0x34')]);_0x285f37['filters']=_['intersection'](_0x285f37[_0x5cd5('0x32')],_0x285f37[_0x5cd5('0x34')]);_0x2195c5['attributes']=_[_0x5cd5('0x36')](_0x285f37[_0x5cd5('0x32')],qs['fields'](_0x36bc78[_0x5cd5('0x34')]['fields']));_0x2195c5[_0x5cd5('0x38')]=_0x2195c5[_0x5cd5('0x38')]['length']?_0x2195c5[_0x5cd5('0x38')]:_0x285f37['model'];if(_0x36bc78[_0x5cd5('0x34')]['includeAll']){_0x2195c5[_0x5cd5('0x46')]=[{'all':!![]}];}_0x2195c5=_['merge']({},_0x2195c5,_0x36bc78[_0x5cd5('0x44')]);return db[_0x5cd5('0x2e')]['find'](_0x2195c5)[_0x5cd5('0x29')](handleEntityNotFound(_0x35903c,null))[_0x5cd5('0x29')](respondWithResult(_0x35903c,null))[_0x5cd5('0x49')](handleError(_0x35903c,null));};exports[_0x5cd5('0x4c')]=function(_0x3d1fe2,_0x19b5a0){return db[_0x5cd5('0x2e')]['create'](_0x3d1fe2[_0x5cd5('0x4d')],{})['then'](respondWithResult(_0x19b5a0,0xc9))[_0x5cd5('0x49')](handleError(_0x19b5a0,null));};exports[_0x5cd5('0x27')]=function(_0x4ce117,_0x1e66eb){if(_0x4ce117[_0x5cd5('0x4d')]['id']){delete _0x4ce117[_0x5cd5('0x4d')]['id'];}return db[_0x5cd5('0x2e')][_0x5cd5('0x4e')]({'where':{'id':_0x4ce117[_0x5cd5('0x4a')]['id']}})[_0x5cd5('0x29')](handleEntityNotFound(_0x1e66eb,null))[_0x5cd5('0x29')](saveUpdates(_0x4ce117[_0x5cd5('0x4d')],null))[_0x5cd5('0x29')](respondWithResult(_0x1e66eb,null))[_0x5cd5('0x49')](handleError(_0x1e66eb,null));};exports[_0x5cd5('0x28')]=function(_0x1d02fe,_0xe5d2c6){return db[_0x5cd5('0x2e')][_0x5cd5('0x4e')]({'where':{'id':_0x1d02fe[_0x5cd5('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe5d2c6,null))[_0x5cd5('0x29')](removeEntity(_0xe5d2c6,null))[_0x5cd5('0x49')](handleError(_0xe5d2c6,null));};exports[_0x5cd5('0x4f')]=function(_0x7b0c51,_0x115198){return db['MailQueueReport'][_0x5cd5('0x4f')]()[_0x5cd5('0x29')](respondWithResult(_0x115198,null))[_0x5cd5('0x49')](handleError(_0x115198,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index a4c15d6..f4a0612 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 _0x2408=['path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','uniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0xcdfec7,_0x53a002){var _0x8b12d4=function(_0x1b7fbf){while(--_0x1b7fbf){_0xcdfec7['push'](_0xcdfec7['shift']());}};_0x8b12d4(++_0x53a002);}(_0x2408,0x97));var _0x8240=function(_0x584eda,_0x42eac8){_0x584eda=_0x584eda-0x0;var _0x2221fe=_0x2408[_0x584eda];return _0x2221fe;};'use strict';var _=require(_0x8240('0x0'));var util=require('util');var logger=require(_0x8240('0x1'))(_0x8240('0x2'));var moment=require('moment');var BPromise=require(_0x8240('0x3'));var rp=require(_0x8240('0x4'));var fs=require('fs');var path=require(_0x8240('0x5'));var rimraf=require(_0x8240('0x6'));var config=require(_0x8240('0x7'));var attributes=require(_0x8240('0x8'));module[_0x8240('0x9')]=function(_0x342e78,_0x218f3e){return _0x342e78['define'](_0x8240('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8240('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3c9=['./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3d3dea,_0x4a7176){var _0x3547ca=function(_0x3b1e3e){while(--_0x3b1e3e){_0x3d3dea['push'](_0x3d3dea['shift']());}};_0x3547ca(++_0x4a7176);}(_0xf3c9,0xa1));var _0x9f3c=function(_0x57aa86,_0x1e2792){_0x57aa86=_0x57aa86-0x0;var _0x32e433=_0xf3c9[_0x57aa86];return _0x32e433;};'use strict';var _=require('lodash');var util=require(_0x9f3c('0x0'));var logger=require(_0x9f3c('0x1'))(_0x9f3c('0x2'));var moment=require('moment');var BPromise=require(_0x9f3c('0x3'));var rp=require(_0x9f3c('0x4'));var fs=require('fs');var path=require(_0x9f3c('0x5'));var rimraf=require(_0x9f3c('0x6'));var config=require('../../config/environment');var attributes=require(_0x9f3c('0x7'));module[_0x9f3c('0x8')]=function(_0x55be79,_0x1afe12){return _0x55be79[_0x9f3c('0x9')](_0x9f3c('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x9f3c('0xb'),'fields':[_0x9f3c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 4ba6882..fbbd869 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 _0x1883=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateMailQueueReport','MailQueueReport','create','options','info','UpdateMailQueueReport','update','body','raw','limit','then','lodash','util','moment','bluebird'];(function(_0x4481e7,_0x15e72d){var _0x1fadef=function(_0x3f0c59){while(--_0x3f0c59){_0x4481e7['push'](_0x4481e7['shift']());}};_0x1fadef(++_0x15e72d);}(_0x1883,0xab));var _0x3188=function(_0x23e3fd,_0x23013c){_0x23e3fd=_0x23e3fd-0x0;var _0x9d32d8=_0x1883[_0x23e3fd];return _0x9d32d8;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});}exports[_0x3188('0x18')]=function(_0x3f5b35){var _0x37e646=this;return new Promise(function(_0x18a71a,_0x4f27b0){return db[_0x3188('0x19')][_0x3188('0x1a')](_0x3f5b35['body'],{'raw':_0x3f5b35[_0x3188('0x1b')]?_0x3f5b35[_0x3188('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5d8d62){logger[_0x3188('0x1c')](_0x3188('0x18'),_0x3f5b35);logger[_0x3188('0x11')]('CreateMailQueueReport',_0x3f5b35,JSON['stringify'](_0x5d8d62));_0x18a71a(_0x5d8d62);})[_0x3188('0x17')](function(_0x461286){logger[_0x3188('0x14')](_0x3188('0x18'),_0x461286[_0x3188('0x15')],_0x3f5b35);_0x4f27b0(_0x37e646['error'](0x1f4,_0x461286[_0x3188('0x15')]));});});};exports[_0x3188('0x1d')]=function(_0x5a2e67){var _0xcbaec9=this;return new Promise(function(_0x4be6c3,_0x5c69be){return db[_0x3188('0x19')][_0x3188('0x1e')](_0x5a2e67[_0x3188('0x1f')],{'raw':_0x5a2e67[_0x3188('0x1b')]?_0x5a2e67[_0x3188('0x1b')][_0x3188('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a2e67[_0x3188('0x1b')]?_0x5a2e67[_0x3188('0x1b')]['where']||null:null,'attributes':_0x5a2e67[_0x3188('0x1b')]?_0x5a2e67[_0x3188('0x1b')]['attributes']||null:null,'limit':_0x5a2e67[_0x3188('0x1b')]?_0x5a2e67[_0x3188('0x1b')][_0x3188('0x21')]||null:null})[_0x3188('0x22')](function(_0x20e6aa){logger[_0x3188('0x1c')](_0x3188('0x1d'),_0x5a2e67);logger[_0x3188('0x11')]('UpdateMailQueueReport',_0x5a2e67,JSON[_0x3188('0x13')](_0x20e6aa));_0x4be6c3(_0x20e6aa);})['catch'](function(_0xaead48){logger['error'](_0x3188('0x1d'),_0xaead48[_0x3188('0x15')],_0x5a2e67);_0x5c69be(_0xcbaec9[_0x3188('0x14')](0x1f4,_0xaead48[_0x3188('0x15')]));});});}; \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','message','catch','CreateMailQueueReport','create','body','options','debug','stringify','UpdateMailQueueReport','MailQueueReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xf494,0x1c6));var _0x4f49=function(_0x407eac,_0x37bcfa){_0x407eac=_0x407eac-0x0;var _0x31c1fc=_0xf494[_0x407eac];return _0x31c1fc;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['MailQueueReport'][_0x4f49('0x17')](_0x4e85df[_0x4f49('0x18')],{'raw':_0x4e85df[_0x4f49('0x19')]?_0x4e85df[_0x4f49('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4f49('0xe')](function(_0x2aed27){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1a')]('CreateMailQueueReport',_0x4e85df,JSON[_0x4f49('0x1b')](_0x2aed27));_0x5bb23b(_0x2aed27);})[_0x4f49('0x15')](function(_0x3ae590){logger['error'](_0x4f49('0x16'),_0x3ae590[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x3ae590[_0x4f49('0x14')]));});});};exports[_0x4f49('0x1c')]=function(_0x36187b){var _0x559d98=this;return new Promise(function(_0x4e9041,_0x3a947b){return db[_0x4f49('0x1d')]['update'](_0x36187b[_0x4f49('0x18')],{'raw':_0x36187b[_0x4f49('0x19')]?_0x36187b[_0x4f49('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36187b[_0x4f49('0x19')]?_0x36187b[_0x4f49('0x19')][_0x4f49('0x1e')]||null:null,'attributes':_0x36187b[_0x4f49('0x19')]?_0x36187b[_0x4f49('0x19')][_0x4f49('0x1f')]||null:null,'limit':_0x36187b['options']?_0x36187b['options'][_0x4f49('0x20')]||null:null})[_0x4f49('0xe')](function(_0x605c91){logger['info'](_0x4f49('0x1c'),_0x36187b);logger[_0x4f49('0x1a')](_0x4f49('0x1c'),_0x36187b,JSON['stringify'](_0x605c91));_0x4e9041(_0x605c91);})['catch'](function(_0x3e207f){logger[_0x4f49('0x13')](_0x4f49('0x1c'),_0x3e207f['message'],_0x36187b);_0x3a947b(_0x559d98[_0x4f49('0x13')](0x1f4,_0x3e207f[_0x4f49('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 1bd59d6..50f895e 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 _0x164b=['../../components/interaction/service','../../config/environment','multer','util','path','express','Router','../../components/auth/service'];(function(_0x2e8f29,_0x1b50da){var _0x47dc7b=function(_0x29e789){while(--_0x29e789){_0x2e8f29['push'](_0x2e8f29['shift']());}};_0x47dc7b(++_0x1b50da);}(_0x164b,0x92));var _0xb164=function(_0x47397f,_0x45ba05){_0x47397f=_0x47397f-0x0;var _0xba5ff1=_0x164b[_0x47397f];return _0xba5ff1;};'use strict';var multer=require(_0xb164('0x0'));var util=require(_0xb164('0x1'));var path=require(_0xb164('0x2'));var timeout=require('connect-timeout');var express=require(_0xb164('0x3'));var router=express[_0xb164('0x4')]();var auth=require(_0xb164('0x5'));var interaction=require(_0xb164('0x6'));var config=require(_0xb164('0x7'));module['exports']=router; \ No newline at end of file +var _0x253f=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x5d637c,_0x3dee88){var _0x1bff9c=function(_0x400b9a){while(--_0x400b9a){_0x5d637c['push'](_0x5d637c['shift']());}};_0x1bff9c(++_0x3dee88);}(_0x253f,0x110));var _0xf253=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x253f[_0x1f9f37];return _0x21c080;};'use strict';var multer=require('multer');var util=require(_0xf253('0x0'));var path=require('path');var timeout=require(_0xf253('0x1'));var express=require(_0xf253('0x2'));var router=express[_0xf253('0x3')]();var auth=require(_0xf253('0x4'));var interaction=require(_0xf253('0x5'));var config=require(_0xf253('0x6'));module[_0xf253('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 72c50d9..a412d4e 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 _0x7826=['exports','STRING','BOOLEAN','username','INTEGER','INBOX'];(function(_0x12816b,_0x24355e){var _0x5ef666=function(_0x2b61d4){while(--_0x2b61d4){_0x12816b['push'](_0x12816b['shift']());}};_0x5ef666(++_0x24355e);}(_0x7826,0x90));var _0x6782=function(_0x1d537c,_0x2b834d){_0x1d537c=_0x1d537c-0x0;var _0x184fb9=_0x7826[_0x1d537c];return _0x184fb9;};'use strict';var Sequelize=require('sequelize');module[_0x6782('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x6782('0x1')]},'authentication':{'type':Sequelize[_0x6782('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x6782('0x1')],'unique':_0x6782('0x3')},'password':{'type':Sequelize[_0x6782('0x1')]},'port':{'type':Sequelize[_0x6782('0x4')]},'tls':{'type':Sequelize[_0x6782('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x6782('0x1')],'defaultValue':_0x6782('0x5')},'connTimeout':{'type':Sequelize[_0x6782('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x6782('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x6782('0x1')]}}; \ No newline at end of file +var _0xe79b=['exports','STRING','BOOLEAN','username','INTEGER','INBOX','sequelize'];(function(_0x2147ae,_0x37d08e){var _0x577f4a=function(_0x2ba48c){while(--_0x2ba48c){_0x2147ae['push'](_0x2147ae['shift']());}};_0x577f4a(++_0x37d08e);}(_0xe79b,0x1e9));var _0xbe79=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0xe79b[_0x48b810];return _0x23c17d;};'use strict';var Sequelize=require(_0xbe79('0x0'));module[_0xbe79('0x1')]={'description':{'type':Sequelize[_0xbe79('0x2')]},'host':{'type':Sequelize[_0xbe79('0x2')]},'authentication':{'type':Sequelize[_0xbe79('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xbe79('0x2')],'unique':_0xbe79('0x4')},'password':{'type':Sequelize[_0xbe79('0x2')]},'port':{'type':Sequelize[_0xbe79('0x5')]},'tls':{'type':Sequelize[_0xbe79('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xbe79('0x6')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xbe79('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xbe79('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index d1224db..e5d8d4e 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 _0x373d=['define','MailServerIn','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x373d,0x1e2));var _0xd373=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0x373d[_0x308374];return _0x1f71e0;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var logger=require(_0xd373('0x1'))(_0xd373('0x2'));var moment=require(_0xd373('0x3'));var BPromise=require(_0xd373('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd373('0x5'));var rimraf=require(_0xd373('0x6'));var config=require(_0xd373('0x7'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x31a0fb,_0x3e4443){return _0x31a0fb[_0xd373('0x8')](_0xd373('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc91=['util','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xdc91,0x8b));var _0x1dc9=function(_0x4d44d8,_0x973338){_0x4d44d8=_0x4d44d8-0x0;var _0x1af3ec=_0xdc91[_0x4d44d8];return _0x1af3ec;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1dc9('0x2'));var fs=require('fs');var path=require(_0x1dc9('0x3'));var rimraf=require(_0x1dc9('0x4'));var config=require(_0x1dc9('0x5'));var attributes=require(_0x1dc9('0x6'));module[_0x1dc9('0x7')]=function(_0x15ac2c,_0x115fe8){return _0x15ac2c['define'](_0x1dc9('0x8'),attributes,{'tableName':_0x1dc9('0x9'),'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 1194b80..0e67fa7 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 _0xc4cf=['then','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','map','model','include'];(function(_0x9f54a1,_0x398ca6){var _0x3c54fa=function(_0x323c74){while(--_0x323c74){_0x9f54a1['push'](_0x9f54a1['shift']());}};_0x3c54fa(++_0x398ca6);}(_0xc4cf,0xfa));var _0xfc4c=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xc4cf[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require(_0xfc4c('0x0'));var util=require('util');var moment=require(_0xfc4c('0x1'));var BPromise=require(_0xfc4c('0x2'));var rs=require(_0xfc4c('0x3'));var fs=require('fs');var Redis=require(_0xfc4c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc4c('0x5'));var logger=require('../../config/logger')(_0xfc4c('0x6'));var config=require(_0xfc4c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfc4c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a74d2,_0x2b7943,_0x5058b6){return new BPromise(function(_0x2b9f69,_0xee5b11){return client[_0xfc4c('0x9')](_0x3a74d2,_0x5058b6)['then'](function(_0x420fd8){logger[_0xfc4c('0xa')](_0xfc4c('0xb'),_0x2b7943,_0xfc4c('0xc'));logger[_0xfc4c('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x2b7943,_0xfc4c('0xc'),JSON[_0xfc4c('0xe')](_0x420fd8));if(_0x420fd8[_0xfc4c('0xf')]){if(_0x420fd8[_0xfc4c('0xf')][_0xfc4c('0x10')]===0x1f4){logger[_0xfc4c('0xf')](_0xfc4c('0xb'),_0x2b7943,_0x420fd8[_0xfc4c('0xf')][_0xfc4c('0x11')]);return _0xee5b11(_0x420fd8[_0xfc4c('0xf')][_0xfc4c('0x11')]);}logger[_0xfc4c('0xf')](_0xfc4c('0xb'),_0x2b7943,_0x420fd8[_0xfc4c('0xf')][_0xfc4c('0x11')]);return _0x2b9f69(_0x420fd8[_0xfc4c('0xf')]['message']);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x2b7943,_0xfc4c('0xc'));_0x2b9f69(_0x420fd8[_0xfc4c('0x12')][_0xfc4c('0x11')]);}})['catch'](function(_0x2d2a3b){logger[_0xfc4c('0xf')]('MailServerIn,\x20%s,\x20%s',_0x2b7943,_0x2d2a3b);_0xee5b11(_0x2d2a3b);});});}exports[_0xfc4c('0x13')]=function(_0x324815){var _0x342c20=this;return new Promise(function(_0x1f4b98,_0x3bb6a5){return db[_0xfc4c('0x14')][_0xfc4c('0x15')]({'raw':_0x324815[_0xfc4c('0x16')]?_0x324815[_0xfc4c('0x16')][_0xfc4c('0x17')]===undefined?!![]:![]:!![],'where':_0x324815['options']?_0x324815[_0xfc4c('0x16')][_0xfc4c('0x18')]||null:null,'attributes':_0x324815[_0xfc4c('0x16')]?_0x324815[_0xfc4c('0x16')][_0xfc4c('0x19')]||null:null,'limit':_0x324815[_0xfc4c('0x16')]?_0x324815[_0xfc4c('0x16')]['limit']||null:null,'include':_0x324815['options']?_0x324815[_0xfc4c('0x16')]['include']?_[_0xfc4c('0x1a')](_0x324815[_0xfc4c('0x16')]['include'],function(_0x4db678){return{'model':db[_0x4db678[_0xfc4c('0x1b')]],'as':_0x4db678['as'],'attributes':_0x4db678[_0xfc4c('0x19')],'include':_0x4db678['include']?_['map'](_0x4db678[_0xfc4c('0x1c')],function(_0x5016cf){return{'model':db[_0x5016cf[_0xfc4c('0x1b')]],'as':_0x5016cf['as'],'attributes':_0x5016cf[_0xfc4c('0x19')],'include':_0x5016cf[_0xfc4c('0x1c')]?_[_0xfc4c('0x1a')](_0x5016cf['include'],function(_0x2dcb85){return{'model':db[_0x2dcb85[_0xfc4c('0x1b')]],'as':_0x2dcb85['as'],'attributes':_0x2dcb85[_0xfc4c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfc4c('0x1d')](function(_0x58c3cf){logger[_0xfc4c('0xa')](_0xfc4c('0x13'),_0x324815);logger[_0xfc4c('0xd')](_0xfc4c('0x13'),_0x324815,JSON[_0xfc4c('0xe')](_0x58c3cf));_0x1f4b98(_0x58c3cf);})[_0xfc4c('0x1e')](function(_0x5a7acc){logger[_0xfc4c('0xf')]('GetMailServerIn',_0x5a7acc['message'],_0x324815);_0x3bb6a5(_0x342c20[_0xfc4c('0xf')](0x1f4,_0x5a7acc['message']));});});}; \ No newline at end of file +var _0x8534=['include','map','model','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetMailServerIn','options','raw','where','attributes','limit'];(function(_0x2994bb,_0x43c4b1){var _0x2610f3=function(_0x23821c){while(--_0x23821c){_0x2994bb['push'](_0x2994bb['shift']());}};_0x2610f3(++_0x43c4b1);}(_0x8534,0x14e));var _0x4853=function(_0x28333a,_0x4e4038){_0x28333a=_0x28333a-0x0;var _0x4c5c1a=_0x8534[_0x28333a];return _0x4c5c1a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4853('0x0'));var BPromise=require('bluebird');var rs=require(_0x4853('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4853('0x2'))['db'];var utils=require(_0x4853('0x3'));var logger=require(_0x4853('0x4'))(_0x4853('0x5'));var config=require('../../config/environment');var jayson=require(_0x4853('0x6'));var client=jayson[_0x4853('0x7')][_0x4853('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x596ac9,_0x460c7d,_0x2c550a){return new BPromise(function(_0x1c3dc4,_0x207254){return client[_0x4853('0x9')](_0x596ac9,_0x2c550a)[_0x4853('0xa')](function(_0x48ad48){logger[_0x4853('0xb')](_0x4853('0xc'),_0x460c7d,_0x4853('0xd'));logger[_0x4853('0xe')](_0x4853('0xf'),_0x460c7d,_0x4853('0xd'),JSON[_0x4853('0x10')](_0x48ad48));if(_0x48ad48[_0x4853('0x11')]){if(_0x48ad48[_0x4853('0x11')][_0x4853('0x12')]===0x1f4){logger[_0x4853('0x11')]('MailServerIn,\x20%s,\x20%s',_0x460c7d,_0x48ad48[_0x4853('0x11')][_0x4853('0x13')]);return _0x207254(_0x48ad48[_0x4853('0x11')][_0x4853('0x13')]);}logger[_0x4853('0x11')](_0x4853('0xc'),_0x460c7d,_0x48ad48[_0x4853('0x11')][_0x4853('0x13')]);return _0x1c3dc4(_0x48ad48[_0x4853('0x11')][_0x4853('0x13')]);}else{logger['info'](_0x4853('0xc'),_0x460c7d,_0x4853('0xd'));_0x1c3dc4(_0x48ad48['result']['message']);}})['catch'](function(_0x2f1434){logger[_0x4853('0x11')](_0x4853('0xc'),_0x460c7d,_0x2f1434);_0x207254(_0x2f1434);});});}exports[_0x4853('0x14')]=function(_0x41133b){var _0x51b0a3=this;return new Promise(function(_0x1ceb6d,_0x1ddfb0){return db['MailServerIn']['findAll']({'raw':_0x41133b[_0x4853('0x15')]?_0x41133b[_0x4853('0x15')][_0x4853('0x16')]===undefined?!![]:![]:!![],'where':_0x41133b[_0x4853('0x15')]?_0x41133b[_0x4853('0x15')][_0x4853('0x17')]||null:null,'attributes':_0x41133b[_0x4853('0x15')]?_0x41133b[_0x4853('0x15')][_0x4853('0x18')]||null:null,'limit':_0x41133b['options']?_0x41133b[_0x4853('0x15')][_0x4853('0x19')]||null:null,'include':_0x41133b[_0x4853('0x15')]?_0x41133b[_0x4853('0x15')][_0x4853('0x1a')]?_[_0x4853('0x1b')](_0x41133b['options'][_0x4853('0x1a')],function(_0x49a85){return{'model':db[_0x49a85[_0x4853('0x1c')]],'as':_0x49a85['as'],'attributes':_0x49a85['attributes'],'include':_0x49a85[_0x4853('0x1a')]?_[_0x4853('0x1b')](_0x49a85[_0x4853('0x1a')],function(_0x406252){return{'model':db[_0x406252[_0x4853('0x1c')]],'as':_0x406252['as'],'attributes':_0x406252[_0x4853('0x18')],'include':_0x406252[_0x4853('0x1a')]?_[_0x4853('0x1b')](_0x406252[_0x4853('0x1a')],function(_0x4e36e2){return{'model':db[_0x4e36e2['model']],'as':_0x4e36e2['as'],'attributes':_0x4e36e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x4853('0xa')](function(_0x1671f6){logger['info'](_0x4853('0x14'),_0x41133b);logger[_0x4853('0xe')](_0x4853('0x14'),_0x41133b,JSON['stringify'](_0x1671f6));_0x1ceb6d(_0x1671f6);})[_0x4853('0x1d')](function(_0x49493a){logger[_0x4853('0x11')](_0x4853('0x14'),_0x49493a[_0x4853('0x13')],_0x41133b);_0x1ddfb0(_0x51b0a3[_0x4853('0x11')](0x1f4,_0x49493a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index fc455fa..0a33650 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 _0x521d=['./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x521d,0x108));var _0xd521=function(_0x3096a7,_0x98ab5d){_0x3096a7=_0x3096a7-0x0;var _0x5776e5=_0x521d[_0x3096a7];return _0x5776e5;};'use strict';var multer=require(_0xd521('0x0'));var util=require(_0xd521('0x1'));var path=require(_0xd521('0x2'));var timeout=require(_0xd521('0x3'));var express=require(_0xd521('0x4'));var router=express[_0xd521('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd521('0x6'));var config=require(_0xd521('0x7'));var controller=require(_0xd521('0x8'));router[_0xd521('0x9')]('/',auth[_0xd521('0xa')](),controller[_0xd521('0xb')]);router[_0xd521('0x9')](_0xd521('0xc'),auth[_0xd521('0xa')](),controller[_0xd521('0xd')]);router[_0xd521('0xe')]('/',auth[_0xd521('0xa')](),controller['create']);router['put'](_0xd521('0xc'),auth[_0xd521('0xa')](),controller['update']);router['delete'](_0xd521('0xc'),auth['isAuthenticated'](),controller[_0xd521('0xf')]);module[_0xd521('0x10')]=router; \ No newline at end of file +var _0x8eb1=['put','/:id','delete','destroy','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','show','create'];(function(_0x38fd75,_0x46f428){var _0x8ec24b=function(_0x4bd062){while(--_0x4bd062){_0x38fd75['push'](_0x38fd75['shift']());}};_0x8ec24b(++_0x46f428);}(_0x8eb1,0x145));var _0x18eb=function(_0x10762c,_0x5c9447){_0x10762c=_0x10762c-0x0;var _0x729cd8=_0x8eb1[_0x10762c];return _0x729cd8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x18eb('0x0'));var timeout=require(_0x18eb('0x1'));var express=require(_0x18eb('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x18eb('0x3'));var config=require(_0x18eb('0x4'));var controller=require(_0x18eb('0x5'));router[_0x18eb('0x6')]('/',auth[_0x18eb('0x7')](),controller[_0x18eb('0x8')]);router[_0x18eb('0x6')]('/:id',auth[_0x18eb('0x7')](),controller[_0x18eb('0x9')]);router['post']('/',auth[_0x18eb('0x7')](),controller[_0x18eb('0xa')]);router[_0x18eb('0xb')](_0x18eb('0xc'),auth[_0x18eb('0x7')](),controller['update']);router[_0x18eb('0xd')](_0x18eb('0xc'),auth['isAuthenticated'](),controller[_0x18eb('0xe')]);module[_0x18eb('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index bc2fc1d..24f3a12 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 _0xed1c=['INTEGER','BOOLEAN','STRING','sequelize','exports'];(function(_0x105a2b,_0x3f23b4){var _0x504d27=function(_0x360299){while(--_0x360299){_0x105a2b['push'](_0x105a2b['shift']());}};_0x504d27(++_0x3f23b4);}(_0xed1c,0xe4));var _0xced1=function(_0x3fd723,_0x1f48b4){_0x3fd723=_0x3fd723-0x0;var _0x131dc2=_0xed1c[_0x3fd723];return _0x131dc2;};'use strict';var Sequelize=require(_0xced1('0x0'));module[_0xced1('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xced1('0x2')]},'secure':{'type':Sequelize[_0xced1('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xced1('0x4')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7409=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x5317af,_0xef1b78){var _0x3b186e=function(_0x13a852){while(--_0x13a852){_0x5317af['push'](_0x5317af['shift']());}};_0x3b186e(++_0xef1b78);}(_0x7409,0x6e));var _0x9740=function(_0x462582,_0x279982){_0x462582=_0x462582-0x0;var _0x176aac=_0x7409[_0x462582];return _0x176aac;};'use strict';var Sequelize=require(_0x9740('0x0'));module[_0x9740('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9740('0x2')]},'user':{'type':Sequelize[_0x9740('0x2')]},'pass':{'type':Sequelize[_0x9740('0x2')]},'port':{'type':Sequelize[_0x9740('0x3')]},'secure':{'type':Sequelize[_0x9740('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x9740('0x2')]},'authentication':{'type':Sequelize[_0x9740('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 84bd274..ac9592c 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 _0xaf6c=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','limit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','MailServerOut','rows','catch','show','params','create','body','find','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x4da813,_0x5ba204){var _0x5139d2=function(_0x43ad6b){while(--_0x43ad6b){_0x4da813['push'](_0x4da813['shift']());}};_0x5139d2(++_0x5ba204);}(_0xaf6c,0x85));var _0xcaf6=function(_0x48db73,_0x27475d){_0x48db73=_0x48db73-0x0;var _0x559ebc=_0xaf6c[_0x48db73];return _0x559ebc;};'use strict';var pdf=require(_0xcaf6('0x0'));var emlformat=require(_0xcaf6('0x1'));var rimraf=require(_0xcaf6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcaf6('0x3'));var rp=require(_0xcaf6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcaf6('0x5'));var util=require(_0xcaf6('0x6'));var path=require(_0xcaf6('0x7'));var sox=require(_0xcaf6('0x8'));var csv=require(_0xcaf6('0x9'));var ejs=require(_0xcaf6('0xa'));var fs=require('fs');var _=require(_0xcaf6('0xb'));var squel=require(_0xcaf6('0xc'));var crypto=require(_0xcaf6('0xd'));var jsforce=require(_0xcaf6('0xe'));var deskjs=require(_0xcaf6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcaf6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcaf6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcaf6('0x12'));var hardwareService=require(_0xcaf6('0x13'));var logger=require(_0xcaf6('0x14'))(_0xcaf6('0x15'));var utils=require(_0xcaf6('0x16'));var config=require(_0xcaf6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33b3aa,_0x23e2aa){_0x23e2aa=_0x23e2aa||0xcc;return function(_0x46c2cf){if(_0x46c2cf){return _0x33b3aa[_0xcaf6('0x18')](_0x23e2aa);}return _0x33b3aa[_0xcaf6('0x19')](_0x23e2aa)[_0xcaf6('0x1a')]();};}function respondWithResult(_0x259f18,_0x237110){_0x237110=_0x237110||0xc8;return function(_0x5a44b9){if(_0x5a44b9){return _0x259f18['status'](_0x237110)[_0xcaf6('0x1b')](_0x5a44b9);}};}function respondWithFilteredResult(_0x2d7097,_0x415444){return function(_0x45469b){if(_0x45469b){var _0x4f0bf1=_0x45469b[_0xcaf6('0x1c')],_0x1e54c9=_0x415444['offset'],_0x4ef58b=_0x415444[_0xcaf6('0x1d')]+_0x415444['limit'],_0x127349;if(_0x4ef58b>=_0x4f0bf1){_0x4ef58b=_0x4f0bf1;_0x127349=0xc8;}else{_0x127349=0xce;}_0x2d7097['status'](_0x127349);return _0x2d7097[_0xcaf6('0x1e')](_0xcaf6('0x1f'),_0x1e54c9+'-'+_0x4ef58b+'/'+_0x4f0bf1)[_0xcaf6('0x1b')](_0x45469b);}return null;};}function patchUpdates(_0x1e082d){return function(_0x434485){try{jsonpatch[_0xcaf6('0x20')](_0x434485,_0x1e082d,!![]);}catch(_0xf611a6){return BPromise[_0xcaf6('0x21')](_0xf611a6);}return _0x434485[_0xcaf6('0x22')]();};}function saveUpdates(_0xffe5a8,_0x2fa272){return function(_0x315ce3){if(_0x315ce3){return _0x315ce3[_0xcaf6('0x23')](_0xffe5a8)[_0xcaf6('0x24')](function(_0x1e8970){return _0x1e8970;});}return null;};}function removeEntity(_0x5b22bc,_0xd03300){return function(_0x18cc8d){if(_0x18cc8d){return _0x18cc8d['destroy']()[_0xcaf6('0x24')](function(){_0x5b22bc[_0xcaf6('0x19')](0xcc)[_0xcaf6('0x1a')]();});}};}function handleEntityNotFound(_0x4e04c8,_0x57f8b0){return function(_0x497235){if(!_0x497235){_0x4e04c8[_0xcaf6('0x18')](0x194);}return _0x497235;};}function handleError(_0x4acd27,_0x5f37e5){_0x5f37e5=_0x5f37e5||0x1f4;return function(_0x33863c){logger[_0xcaf6('0x25')](_0x33863c[_0xcaf6('0x26')]);if(_0x33863c[_0xcaf6('0x27')]){delete _0x33863c[_0xcaf6('0x27')];}_0x4acd27[_0xcaf6('0x19')](_0x5f37e5)[_0xcaf6('0x28')](_0x33863c);};}exports[_0xcaf6('0x29')]=function(_0x3ad70a,_0x4fdd68){var _0x4f42ed={},_0x495015={},_0x22b902={'count':0x0,'rows':[]};var _0x57f935=_[_0xcaf6('0x2a')](db['MailServerOut'][_0xcaf6('0x2b')],function(_0x48890a){return{'name':_0x48890a[_0xcaf6('0x2c')],'type':_0x48890a['type'][_0xcaf6('0x2d')]};});_0x495015['model']=_[_0xcaf6('0x2a')](_0x57f935,'name');_0x495015['query']=_[_0xcaf6('0x2e')](_0x3ad70a[_0xcaf6('0x2f')]);_0x495015[_0xcaf6('0x30')]=_[_0xcaf6('0x31')](_0x495015['model'],_0x495015['query']);_0x4f42ed[_0xcaf6('0x32')]=_[_0xcaf6('0x31')](_0x495015[_0xcaf6('0x33')],qs['fields'](_0x3ad70a['query'][_0xcaf6('0x34')]));_0x4f42ed[_0xcaf6('0x32')]=_0x4f42ed[_0xcaf6('0x32')][_0xcaf6('0x35')]?_0x4f42ed['attributes']:_0x495015[_0xcaf6('0x33')];if(!_0x3ad70a[_0xcaf6('0x2f')]['hasOwnProperty'](_0xcaf6('0x36'))){_0x4f42ed[_0xcaf6('0x37')]=qs[_0xcaf6('0x37')](_0x3ad70a[_0xcaf6('0x2f')][_0xcaf6('0x37')]);_0x4f42ed['offset']=qs[_0xcaf6('0x1d')](_0x3ad70a[_0xcaf6('0x2f')][_0xcaf6('0x1d')]);}_0x4f42ed['order']=qs[_0xcaf6('0x38')](_0x3ad70a[_0xcaf6('0x2f')]['sort']);_0x4f42ed[_0xcaf6('0x39')]=qs['filters'](_[_0xcaf6('0x3a')](_0x3ad70a['query'],_0x495015['filters']));if(_0x3ad70a[_0xcaf6('0x2f')]['filter']){_0x4f42ed['where']=_[_0xcaf6('0x3b')](_0x4f42ed[_0xcaf6('0x39')],{'$or':_[_0xcaf6('0x2a')](_0x57f935,function(_0x219a46){if(_0x219a46[_0xcaf6('0x3c')]!==_0xcaf6('0x3d')){var _0xf047e0={};_0xf047e0[_0x219a46[_0xcaf6('0x27')]]={'$like':'%'+_0x3ad70a[_0xcaf6('0x2f')][_0xcaf6('0x3e')]+'%'};return _0xf047e0;}})});}_0x4f42ed=_[_0xcaf6('0x3b')]({},_0x4f42ed,_0x3ad70a[_0xcaf6('0x3f')]);var _0x3c31a5={'where':_0x4f42ed[_0xcaf6('0x39')]};return db['MailServerOut'][_0xcaf6('0x1c')](_0x3c31a5)[_0xcaf6('0x24')](function(_0x7714c8){_0x22b902[_0xcaf6('0x1c')]=_0x7714c8;if(_0x3ad70a[_0xcaf6('0x2f')][_0xcaf6('0x40')]){_0x4f42ed[_0xcaf6('0x41')]=[{'all':!![]}];}return db[_0xcaf6('0x42')]['findAll'](_0x4f42ed);})[_0xcaf6('0x24')](function(_0x294788){_0x22b902[_0xcaf6('0x43')]=_0x294788;return _0x22b902;})[_0xcaf6('0x24')](respondWithFilteredResult(_0x4fdd68,_0x4f42ed))[_0xcaf6('0x44')](handleError(_0x4fdd68,null));};exports[_0xcaf6('0x45')]=function(_0x7256b4,_0x1d2b6a){var _0x39254f={'raw':!![],'where':{'id':_0x7256b4[_0xcaf6('0x46')]['id']}},_0x22fe75={};_0x22fe75[_0xcaf6('0x33')]=_[_0xcaf6('0x2e')](db[_0xcaf6('0x42')][_0xcaf6('0x2b')]);_0x22fe75[_0xcaf6('0x2f')]=_[_0xcaf6('0x2e')](_0x7256b4[_0xcaf6('0x2f')]);_0x22fe75[_0xcaf6('0x30')]=_['intersection'](_0x22fe75[_0xcaf6('0x33')],_0x22fe75[_0xcaf6('0x2f')]);_0x39254f[_0xcaf6('0x32')]=_['intersection'](_0x22fe75[_0xcaf6('0x33')],qs[_0xcaf6('0x34')](_0x7256b4[_0xcaf6('0x2f')][_0xcaf6('0x34')]));_0x39254f['attributes']=_0x39254f[_0xcaf6('0x32')]['length']?_0x39254f[_0xcaf6('0x32')]:_0x22fe75['model'];if(_0x7256b4[_0xcaf6('0x2f')][_0xcaf6('0x40')]){_0x39254f[_0xcaf6('0x41')]=[{'all':!![]}];}_0x39254f=_[_0xcaf6('0x3b')]({},_0x39254f,_0x7256b4[_0xcaf6('0x3f')]);return db[_0xcaf6('0x42')]['find'](_0x39254f)['then'](handleEntityNotFound(_0x1d2b6a,null))['then'](respondWithResult(_0x1d2b6a,null))['catch'](handleError(_0x1d2b6a,null));};exports[_0xcaf6('0x47')]=function(_0x417cb8,_0x37fc40){return db[_0xcaf6('0x42')][_0xcaf6('0x47')](_0x417cb8['body'],{})['then'](respondWithResult(_0x37fc40,0xc9))[_0xcaf6('0x44')](handleError(_0x37fc40,null));};exports[_0xcaf6('0x23')]=function(_0x4bc7c8,_0x4e6e3e){if(_0x4bc7c8[_0xcaf6('0x48')]['id']){delete _0x4bc7c8[_0xcaf6('0x48')]['id'];}return db[_0xcaf6('0x42')][_0xcaf6('0x49')]({'where':{'id':_0x4bc7c8[_0xcaf6('0x46')]['id']}})[_0xcaf6('0x24')](handleEntityNotFound(_0x4e6e3e,null))[_0xcaf6('0x24')](saveUpdates(_0x4bc7c8[_0xcaf6('0x48')],null))['then'](respondWithResult(_0x4e6e3e,null))[_0xcaf6('0x44')](handleError(_0x4e6e3e,null));};exports[_0xcaf6('0x4a')]=function(_0x2079cc,_0x34d05d){return db[_0xcaf6('0x42')]['find']({'where':{'id':_0x2079cc[_0xcaf6('0x46')]['id']}})[_0xcaf6('0x24')](handleEntityNotFound(_0x34d05d,null))[_0xcaf6('0x24')](removeEntity(_0x34d05d,null))[_0xcaf6('0x44')](handleError(_0x34d05d,null));}; \ No newline at end of file +var _0xb5b1=['../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','findAll','rows','catch','show','params','keys','includeAll','options','create','body','update','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x3a90d5,_0x2d5c05){var _0x5817eb=function(_0x5e5735){while(--_0x5e5735){_0x3a90d5['push'](_0x3a90d5['shift']());}};_0x5817eb(++_0x2d5c05);}(_0xb5b1,0x1a3));var _0x1b5b=function(_0x29e3f2,_0x18b71f){_0x29e3f2=_0x29e3f2-0x0;var _0x539dd9=_0xb5b1[_0x29e3f2];return _0x539dd9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1b5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b5b('0x1'));var jsonpatch=require(_0x1b5b('0x2'));var rp=require('request-promise');var moment=require(_0x1b5b('0x3'));var BPromise=require(_0x1b5b('0x4'));var Mustache=require(_0x1b5b('0x5'));var util=require(_0x1b5b('0x6'));var path=require(_0x1b5b('0x7'));var sox=require(_0x1b5b('0x8'));var csv=require(_0x1b5b('0x9'));var ejs=require(_0x1b5b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1b5b('0xb'));var crypto=require(_0x1b5b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1b5b('0xd'));var toCsv=require(_0x1b5b('0x9'));var querystring=require(_0x1b5b('0xe'));var Papa=require(_0x1b5b('0xf'));var Redis=require(_0x1b5b('0x10'));var authService=require(_0x1b5b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1b5b('0x12'));var hardwareService=require(_0x1b5b('0x13'));var logger=require(_0x1b5b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1b5b('0x15'));var db=require(_0x1b5b('0x16'))['db'];function respondWithStatusCode(_0x25fa14,_0xc74b36){_0xc74b36=_0xc74b36||0xcc;return function(_0x135c22){if(_0x135c22){return _0x25fa14[_0x1b5b('0x17')](_0xc74b36);}return _0x25fa14[_0x1b5b('0x18')](_0xc74b36)[_0x1b5b('0x19')]();};}function respondWithResult(_0x51b961,_0x1b03db){_0x1b03db=_0x1b03db||0xc8;return function(_0x30f93f){if(_0x30f93f){return _0x51b961[_0x1b5b('0x18')](_0x1b03db)[_0x1b5b('0x1a')](_0x30f93f);}};}function respondWithFilteredResult(_0x117f72,_0x37e264){return function(_0x3052f0){if(_0x3052f0){var _0x7ff664=_0x3052f0[_0x1b5b('0x1b')],_0x4155b7=_0x37e264['offset'],_0x42d386=_0x37e264[_0x1b5b('0x1c')]+_0x37e264[_0x1b5b('0x1d')],_0x4891c0;if(_0x42d386>=_0x7ff664){_0x42d386=_0x7ff664;_0x4891c0=0xc8;}else{_0x4891c0=0xce;}_0x117f72[_0x1b5b('0x18')](_0x4891c0);return _0x117f72[_0x1b5b('0x1e')]('Content-Range',_0x4155b7+'-'+_0x42d386+'/'+_0x7ff664)[_0x1b5b('0x1a')](_0x3052f0);}return null;};}function patchUpdates(_0x2557d){return function(_0x19de3e){try{jsonpatch[_0x1b5b('0x1f')](_0x19de3e,_0x2557d,!![]);}catch(_0x5035b0){return BPromise[_0x1b5b('0x20')](_0x5035b0);}return _0x19de3e[_0x1b5b('0x21')]();};}function saveUpdates(_0xe86441,_0x1f8b80){return function(_0x4b304f){if(_0x4b304f){return _0x4b304f['update'](_0xe86441)[_0x1b5b('0x22')](function(_0xe9bdcb){return _0xe9bdcb;});}return null;};}function removeEntity(_0x36867d,_0x1bebd8){return function(_0x5b1da9){if(_0x5b1da9){return _0x5b1da9['destroy']()[_0x1b5b('0x22')](function(){_0x36867d['status'](0xcc)[_0x1b5b('0x19')]();});}};}function handleEntityNotFound(_0x19a727,_0x4558ba){return function(_0x58d675){if(!_0x58d675){_0x19a727[_0x1b5b('0x17')](0x194);}return _0x58d675;};}function handleError(_0x16eee7,_0x37bd2b){_0x37bd2b=_0x37bd2b||0x1f4;return function(_0x29f6f5){logger[_0x1b5b('0x23')](_0x29f6f5[_0x1b5b('0x24')]);if(_0x29f6f5[_0x1b5b('0x25')]){delete _0x29f6f5[_0x1b5b('0x25')];}_0x16eee7['status'](_0x37bd2b)['send'](_0x29f6f5);};}exports[_0x1b5b('0x26')]=function(_0x5f351c,_0x44306e){var _0x95b7db={},_0x2eae0f={},_0xa16b49={'count':0x0,'rows':[]};var _0x2a6a2b=_[_0x1b5b('0x27')](db[_0x1b5b('0x28')][_0x1b5b('0x29')],function(_0x98d0a){return{'name':_0x98d0a[_0x1b5b('0x2a')],'type':_0x98d0a['type'][_0x1b5b('0x2b')]};});_0x2eae0f['model']=_['map'](_0x2a6a2b,_0x1b5b('0x25'));_0x2eae0f[_0x1b5b('0x2c')]=_['keys'](_0x5f351c['query']);_0x2eae0f[_0x1b5b('0x2d')]=_[_0x1b5b('0x2e')](_0x2eae0f['model'],_0x2eae0f[_0x1b5b('0x2c')]);_0x95b7db[_0x1b5b('0x2f')]=_['intersection'](_0x2eae0f[_0x1b5b('0x30')],qs[_0x1b5b('0x31')](_0x5f351c[_0x1b5b('0x2c')][_0x1b5b('0x31')]));_0x95b7db[_0x1b5b('0x2f')]=_0x95b7db[_0x1b5b('0x2f')][_0x1b5b('0x32')]?_0x95b7db[_0x1b5b('0x2f')]:_0x2eae0f['model'];if(!_0x5f351c[_0x1b5b('0x2c')][_0x1b5b('0x33')](_0x1b5b('0x34'))){_0x95b7db['limit']=qs[_0x1b5b('0x1d')](_0x5f351c[_0x1b5b('0x2c')]['limit']);_0x95b7db[_0x1b5b('0x1c')]=qs['offset'](_0x5f351c[_0x1b5b('0x2c')][_0x1b5b('0x1c')]);}_0x95b7db[_0x1b5b('0x35')]=qs['sort'](_0x5f351c[_0x1b5b('0x2c')][_0x1b5b('0x36')]);_0x95b7db[_0x1b5b('0x37')]=qs[_0x1b5b('0x2d')](_[_0x1b5b('0x38')](_0x5f351c[_0x1b5b('0x2c')],_0x2eae0f[_0x1b5b('0x2d')]));if(_0x5f351c[_0x1b5b('0x2c')][_0x1b5b('0x39')]){_0x95b7db['where']=_[_0x1b5b('0x3a')](_0x95b7db[_0x1b5b('0x37')],{'$or':_[_0x1b5b('0x27')](_0x2a6a2b,function(_0x17e32a){if(_0x17e32a[_0x1b5b('0x3b')]!==_0x1b5b('0x3c')){var _0x1e5e34={};_0x1e5e34[_0x17e32a[_0x1b5b('0x25')]]={'$like':'%'+_0x5f351c[_0x1b5b('0x2c')]['filter']+'%'};return _0x1e5e34;}})});}_0x95b7db=_[_0x1b5b('0x3a')]({},_0x95b7db,_0x5f351c['options']);var _0x11bf1f={'where':_0x95b7db['where']};return db[_0x1b5b('0x28')][_0x1b5b('0x1b')](_0x11bf1f)['then'](function(_0x479e8e){_0xa16b49[_0x1b5b('0x1b')]=_0x479e8e;if(_0x5f351c['query']['includeAll']){_0x95b7db['include']=[{'all':!![]}];}return db[_0x1b5b('0x28')][_0x1b5b('0x3d')](_0x95b7db);})['then'](function(_0x3be508){_0xa16b49[_0x1b5b('0x3e')]=_0x3be508;return _0xa16b49;})[_0x1b5b('0x22')](respondWithFilteredResult(_0x44306e,_0x95b7db))[_0x1b5b('0x3f')](handleError(_0x44306e,null));};exports[_0x1b5b('0x40')]=function(_0x145c67,_0x5b9943){var _0xc2bec0={'raw':!![],'where':{'id':_0x145c67[_0x1b5b('0x41')]['id']}},_0x2648fd={};_0x2648fd[_0x1b5b('0x30')]=_[_0x1b5b('0x42')](db['MailServerOut']['rawAttributes']);_0x2648fd[_0x1b5b('0x2c')]=_[_0x1b5b('0x42')](_0x145c67['query']);_0x2648fd[_0x1b5b('0x2d')]=_[_0x1b5b('0x2e')](_0x2648fd[_0x1b5b('0x30')],_0x2648fd[_0x1b5b('0x2c')]);_0xc2bec0[_0x1b5b('0x2f')]=_['intersection'](_0x2648fd[_0x1b5b('0x30')],qs[_0x1b5b('0x31')](_0x145c67[_0x1b5b('0x2c')][_0x1b5b('0x31')]));_0xc2bec0[_0x1b5b('0x2f')]=_0xc2bec0[_0x1b5b('0x2f')][_0x1b5b('0x32')]?_0xc2bec0[_0x1b5b('0x2f')]:_0x2648fd[_0x1b5b('0x30')];if(_0x145c67[_0x1b5b('0x2c')][_0x1b5b('0x43')]){_0xc2bec0['include']=[{'all':!![]}];}_0xc2bec0=_['merge']({},_0xc2bec0,_0x145c67[_0x1b5b('0x44')]);return db[_0x1b5b('0x28')]['find'](_0xc2bec0)[_0x1b5b('0x22')](handleEntityNotFound(_0x5b9943,null))[_0x1b5b('0x22')](respondWithResult(_0x5b9943,null))[_0x1b5b('0x3f')](handleError(_0x5b9943,null));};exports[_0x1b5b('0x45')]=function(_0x1c20a5,_0x148a55){return db[_0x1b5b('0x28')][_0x1b5b('0x45')](_0x1c20a5[_0x1b5b('0x46')],{})[_0x1b5b('0x22')](respondWithResult(_0x148a55,0xc9))[_0x1b5b('0x3f')](handleError(_0x148a55,null));};exports[_0x1b5b('0x47')]=function(_0x30d23c,_0x164da1){if(_0x30d23c[_0x1b5b('0x46')]['id']){delete _0x30d23c[_0x1b5b('0x46')]['id'];}return db['MailServerOut'][_0x1b5b('0x48')]({'where':{'id':_0x30d23c[_0x1b5b('0x41')]['id']}})[_0x1b5b('0x22')](handleEntityNotFound(_0x164da1,null))[_0x1b5b('0x22')](saveUpdates(_0x30d23c[_0x1b5b('0x46')],null))[_0x1b5b('0x22')](respondWithResult(_0x164da1,null))[_0x1b5b('0x3f')](handleError(_0x164da1,null));};exports['destroy']=function(_0x47d277,_0x58bc20){return db[_0x1b5b('0x28')][_0x1b5b('0x48')]({'where':{'id':_0x47d277[_0x1b5b('0x41')]['id']}})[_0x1b5b('0x22')](handleEntityNotFound(_0x58bc20,null))[_0x1b5b('0x22')](removeEntity(_0x58bc20,null))[_0x1b5b('0x3f')](handleError(_0x58bc20,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 090dabf..bd17f5e 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 _0x2675=['lodash','moment','bluebird','path','rimraf','./mailServerOut.attributes','exports','define','MailServerOut'];(function(_0xbd201,_0x2d26d0){var _0x103c69=function(_0x1dc5c6){while(--_0x1dc5c6){_0xbd201['push'](_0xbd201['shift']());}};_0x103c69(++_0x2d26d0);}(_0x2675,0x75));var _0x5267=function(_0x59bf61,_0x349d54){_0x59bf61=_0x59bf61-0x0;var _0x473f0e=_0x2675[_0x59bf61];return _0x473f0e;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));module[_0x5267('0x6')]=function(_0x4bd042,_0x10f92c){return _0x4bd042[_0x5267('0x7')](_0x5267('0x8'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f8a=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5bcff3,_0x12b180){var _0x241e2e=function(_0x52c055){while(--_0x52c055){_0x5bcff3['push'](_0x5bcff3['shift']());}};_0x241e2e(++_0x12b180);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x27c822,_0x4850f1){_0x27c822=_0x27c822-0x0;var _0x2e60b2=_0x3f8a[_0x27c822];return _0x2e60b2;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));module[_0xa3f8('0xa')]=function(_0x471464,_0x1f160a){return _0x471464[_0xa3f8('0xb')](_0xa3f8('0xc'),attributes,{'tableName':_0xa3f8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 01e0601..66936ee 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 _0x6e9f=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x14c035,_0x5af70f){var _0x229a46=function(_0x28abc8){while(--_0x28abc8){_0x14c035['push'](_0x14c035['shift']());}};_0x229a46(++_0x5af70f);}(_0x6e9f,0x1b5));var _0xf6e9=function(_0x260219,_0x2f28e0){_0x260219=_0x260219-0x0;var _0x594e13=_0x6e9f[_0x260219];return _0x594e13;};'use strict';var _=require('lodash');var util=require(_0xf6e9('0x0'));var moment=require(_0xf6e9('0x1'));var BPromise=require(_0xf6e9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6e9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf6e9('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf6e9('0x5'));var jayson=require(_0xf6e9('0x6'));var client=jayson[_0xf6e9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc121a2,_0xea55d6,_0x2229b3){return new BPromise(function(_0x3c7c77,_0x249add){return client[_0xf6e9('0x8')](_0xc121a2,_0x2229b3)[_0xf6e9('0x9')](function(_0x873ea2){logger[_0xf6e9('0xa')](_0xf6e9('0xb'),_0xea55d6,_0xf6e9('0xc'));logger['debug'](_0xf6e9('0xd'),_0xea55d6,_0xf6e9('0xc'),JSON[_0xf6e9('0xe')](_0x873ea2));if(_0x873ea2[_0xf6e9('0xf')]){if(_0x873ea2[_0xf6e9('0xf')][_0xf6e9('0x10')]===0x1f4){logger[_0xf6e9('0xf')](_0xf6e9('0xb'),_0xea55d6,_0x873ea2[_0xf6e9('0xf')][_0xf6e9('0x11')]);return _0x249add(_0x873ea2[_0xf6e9('0xf')]['message']);}logger[_0xf6e9('0xf')]('MailServerOut,\x20%s,\x20%s',_0xea55d6,_0x873ea2['error'][_0xf6e9('0x11')]);return _0x3c7c77(_0x873ea2[_0xf6e9('0xf')][_0xf6e9('0x11')]);}else{logger[_0xf6e9('0xa')](_0xf6e9('0xb'),_0xea55d6,_0xf6e9('0xc'));_0x3c7c77(_0x873ea2[_0xf6e9('0x12')][_0xf6e9('0x11')]);}})[_0xf6e9('0x13')](function(_0x38710e){logger[_0xf6e9('0xf')](_0xf6e9('0xb'),_0xea55d6,_0x38710e);_0x249add(_0x38710e);});});} \ No newline at end of file +var _0xc037=['message','info','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3b0120,_0x238204){var _0x35ff5c=function(_0x2c04f4){while(--_0x2c04f4){_0x3b0120['push'](_0x3b0120['shift']());}};_0x35ff5c(++_0x238204);}(_0xc037,0x1cb));var _0x7c03=function(_0x2a2287,_0x34b9a3){_0x2a2287=_0x2a2287-0x0;var _0x557488=_0xc037[_0x2a2287];return _0x557488;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7c03('0x0'));var rs=require(_0x7c03('0x1'));var fs=require('fs');var Redis=require(_0x7c03('0x2'));var db=require(_0x7c03('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c03('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7c03('0x5')][_0x7c03('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x181e90,_0x17c5b0,_0x289b76){return new BPromise(function(_0x2afa25,_0x125b37){return client[_0x7c03('0x7')](_0x181e90,_0x289b76)[_0x7c03('0x8')](function(_0x228465){logger['info'](_0x7c03('0x9'),_0x17c5b0,_0x7c03('0xa'));logger[_0x7c03('0xb')](_0x7c03('0xc'),_0x17c5b0,'request\x20sent',JSON[_0x7c03('0xd')](_0x228465));if(_0x228465[_0x7c03('0xe')]){if(_0x228465[_0x7c03('0xe')][_0x7c03('0xf')]===0x1f4){logger['error']('MailServerOut,\x20%s,\x20%s',_0x17c5b0,_0x228465['error']['message']);return _0x125b37(_0x228465[_0x7c03('0xe')][_0x7c03('0x10')]);}logger[_0x7c03('0xe')](_0x7c03('0x9'),_0x17c5b0,_0x228465[_0x7c03('0xe')][_0x7c03('0x10')]);return _0x2afa25(_0x228465[_0x7c03('0xe')][_0x7c03('0x10')]);}else{logger[_0x7c03('0x11')](_0x7c03('0x9'),_0x17c5b0,_0x7c03('0xa'));_0x2afa25(_0x228465['result'][_0x7c03('0x10')]);}})[_0x7c03('0x12')](function(_0x56ba18){logger['error'](_0x7c03('0x9'),_0x17c5b0,_0x56ba18);_0x125b37(_0x56ba18);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 4fce889..3a653d2 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 _0x81b2=['describe','/:id','show','post','create','put','update','destroy','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0x81b2,0x1a0));var _0x281b=function(_0x34e46d,_0x5df86a){_0x34e46d=_0x34e46d-0x0;var _0x1cc6aa=_0x81b2[_0x34e46d];return _0x1cc6aa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x281b('0x0'));var timeout=require('connect-timeout');var express=require(_0x281b('0x1'));var router=express['Router']();var auth=require(_0x281b('0x2'));var interaction=require(_0x281b('0x3'));var config=require(_0x281b('0x4'));var controller=require(_0x281b('0x5'));router[_0x281b('0x6')]('/',auth[_0x281b('0x7')](),controller['index']);router['get'](_0x281b('0x8'),auth[_0x281b('0x7')](),controller[_0x281b('0x9')]);router[_0x281b('0x6')](_0x281b('0xa'),auth['isAuthenticated'](),controller[_0x281b('0xb')]);router[_0x281b('0xc')]('/',auth[_0x281b('0x7')](),controller[_0x281b('0xd')]);router[_0x281b('0xe')](_0x281b('0xa'),auth['isAuthenticated'](),controller[_0x281b('0xf')]);router['delete'](_0x281b('0xa'),auth[_0x281b('0x7')](),controller[_0x281b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xcfc7=['get','/describe','describe','create','put','/:id','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index'];(function(_0x35c1db,_0xd75c15){var _0x4173ff=function(_0x5d6901){while(--_0x5d6901){_0x35c1db['push'](_0x35c1db['shift']());}};_0x4173ff(++_0xd75c15);}(_0xcfc7,0x107));var _0x7cfc=function(_0x9a6719,_0x191f24){_0x9a6719=_0x9a6719-0x0;var _0x138184=_0xcfc7[_0x9a6719];return _0x138184;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7cfc('0x0'));var timeout=require(_0x7cfc('0x1'));var express=require(_0x7cfc('0x2'));var router=express[_0x7cfc('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7cfc('0x4'));var config=require(_0x7cfc('0x5'));var controller=require(_0x7cfc('0x6'));router['get']('/',auth[_0x7cfc('0x7')](),controller[_0x7cfc('0x8')]);router[_0x7cfc('0x9')](_0x7cfc('0xa'),auth['isAuthenticated'](),controller[_0x7cfc('0xb')]);router[_0x7cfc('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7cfc('0xc')]);router[_0x7cfc('0xd')](_0x7cfc('0xe'),auth[_0x7cfc('0x7')](),controller['update']);router[_0x7cfc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7cfc('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 6c93904..20899f7 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 _0x5c96=['exports','STRING','name','sequelize'];(function(_0x1dbc28,_0x22d7c8){var _0x315db0=function(_0x25a5ab){while(--_0x25a5ab){_0x1dbc28['push'](_0x1dbc28['shift']());}};_0x315db0(++_0x22d7c8);}(_0x5c96,0x133));var _0x65c9=function(_0x212adf,_0x4395c4){_0x212adf=_0x212adf-0x0;var _0x1db127=_0x5c96[_0x212adf];return _0x1db127;};'use strict';var Sequelize=require(_0x65c9('0x0'));module[_0x65c9('0x1')]={'name':{'type':Sequelize[_0x65c9('0x2')],'unique':_0x65c9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb5dd=['name','sequelize','exports','STRING'];(function(_0x2c2d11,_0x4308ac){var _0x255f24=function(_0x1aa524){while(--_0x1aa524){_0x2c2d11['push'](_0x2c2d11['shift']());}};_0x255f24(++_0x4308ac);}(_0xb5dd,0xd9));var _0xdb5d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb5dd[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xdb5d('0x0'));module[_0xdb5d('0x1')]={'name':{'type':Sequelize[_0xdb5d('0x2')],'unique':_0xdb5d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdb5d('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index b3da796..d5f1c14 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 _0xabce=['Content-Range','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','keys','options','MailSubstatus','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','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','end','json','count','offset','limit','status','set'];(function(_0xc4ed7b,_0x5cc8ab){var _0x95acd5=function(_0x42de7a){while(--_0x42de7a){_0xc4ed7b['push'](_0xc4ed7b['shift']());}};_0x95acd5(++_0x5cc8ab);}(_0xabce,0x103));var _0xeabc=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xabce[_0x4baae2];return _0x1a2285;};'use strict';var pdf=require(_0xeabc('0x0'));var emlformat=require(_0xeabc('0x1'));var rimraf=require(_0xeabc('0x2'));var zipdir=require(_0xeabc('0x3'));var jsonpatch=require(_0xeabc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeabc('0x5'));var Mustache=require(_0xeabc('0x6'));var util=require(_0xeabc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeabc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var db=require(_0xeabc('0x18'))['db'];function respondWithStatusCode(_0x435ea7,_0x3fd0b5){_0x3fd0b5=_0x3fd0b5||0xcc;return function(_0x36a92e){if(_0x36a92e){return _0x435ea7[_0xeabc('0x19')](_0x3fd0b5);}return _0x435ea7['status'](_0x3fd0b5)[_0xeabc('0x1a')]();};}function respondWithResult(_0x1319f3,_0x3251c6){_0x3251c6=_0x3251c6||0xc8;return function(_0x55f0de){if(_0x55f0de){return _0x1319f3['status'](_0x3251c6)[_0xeabc('0x1b')](_0x55f0de);}};}function respondWithFilteredResult(_0x3ae954,_0x326bac){return function(_0x53d5cb){if(_0x53d5cb){var _0xf913d7=_0x53d5cb[_0xeabc('0x1c')],_0x638976=_0x326bac['offset'],_0x49f2d8=_0x326bac[_0xeabc('0x1d')]+_0x326bac[_0xeabc('0x1e')],_0x53fe28;if(_0x49f2d8>=_0xf913d7){_0x49f2d8=_0xf913d7;_0x53fe28=0xc8;}else{_0x53fe28=0xce;}_0x3ae954[_0xeabc('0x1f')](_0x53fe28);return _0x3ae954[_0xeabc('0x20')](_0xeabc('0x21'),_0x638976+'-'+_0x49f2d8+'/'+_0xf913d7)[_0xeabc('0x1b')](_0x53d5cb);}return null;};}function patchUpdates(_0x384be5){return function(_0x5e30ee){try{jsonpatch['apply'](_0x5e30ee,_0x384be5,!![]);}catch(_0x1253e4){return BPromise['reject'](_0x1253e4);}return _0x5e30ee[_0xeabc('0x22')]();};}function saveUpdates(_0x16530c,_0x502947){return function(_0x28063a){if(_0x28063a){return _0x28063a[_0xeabc('0x23')](_0x16530c)[_0xeabc('0x24')](function(_0x184e60){return _0x184e60;});}return null;};}function removeEntity(_0x3c9611,_0x4e99a4){return function(_0xecdbf){if(_0xecdbf){return _0xecdbf[_0xeabc('0x25')]()[_0xeabc('0x24')](function(){_0x3c9611['status'](0xcc)[_0xeabc('0x1a')]();});}};}function handleEntityNotFound(_0x3854d2,_0x214953){return function(_0x319119){if(!_0x319119){_0x3854d2['sendStatus'](0x194);}return _0x319119;};}function handleError(_0x109e1d,_0x480440){_0x480440=_0x480440||0x1f4;return function(_0x27dbaf){logger['error'](_0x27dbaf[_0xeabc('0x26')]);if(_0x27dbaf[_0xeabc('0x27')]){delete _0x27dbaf[_0xeabc('0x27')];}_0x109e1d[_0xeabc('0x1f')](_0x480440)[_0xeabc('0x28')](_0x27dbaf);};}exports[_0xeabc('0x29')]=function(_0x131722,_0x4c2693){var _0x5b2934={},_0x459c8a={},_0x5bf8f2={'count':0x0,'rows':[]};var _0x3c1b5b=_[_0xeabc('0x2a')](db['MailSubstatus'][_0xeabc('0x2b')],function(_0x38572d){return{'name':_0x38572d[_0xeabc('0x2c')],'type':_0x38572d[_0xeabc('0x2d')][_0xeabc('0x2e')]};});_0x459c8a[_0xeabc('0x2f')]=_[_0xeabc('0x2a')](_0x3c1b5b,_0xeabc('0x27'));_0x459c8a[_0xeabc('0x30')]=_['keys'](_0x131722[_0xeabc('0x30')]);_0x459c8a['filters']=_[_0xeabc('0x31')](_0x459c8a[_0xeabc('0x2f')],_0x459c8a[_0xeabc('0x30')]);_0x5b2934[_0xeabc('0x32')]=_[_0xeabc('0x31')](_0x459c8a[_0xeabc('0x2f')],qs[_0xeabc('0x33')](_0x131722['query'][_0xeabc('0x33')]));_0x5b2934[_0xeabc('0x32')]=_0x5b2934[_0xeabc('0x32')]['length']?_0x5b2934[_0xeabc('0x32')]:_0x459c8a[_0xeabc('0x2f')];if(!_0x131722[_0xeabc('0x30')]['hasOwnProperty'](_0xeabc('0x34'))){_0x5b2934[_0xeabc('0x1e')]=qs[_0xeabc('0x1e')](_0x131722['query'][_0xeabc('0x1e')]);_0x5b2934[_0xeabc('0x1d')]=qs['offset'](_0x131722['query'][_0xeabc('0x1d')]);}_0x5b2934[_0xeabc('0x35')]=qs['sort'](_0x131722[_0xeabc('0x30')][_0xeabc('0x36')]);_0x5b2934[_0xeabc('0x37')]=qs[_0xeabc('0x38')](_[_0xeabc('0x39')](_0x131722['query'],_0x459c8a[_0xeabc('0x38')]));if(_0x131722['query'][_0xeabc('0x3a')]){_0x5b2934[_0xeabc('0x37')]=_[_0xeabc('0x3b')](_0x5b2934['where'],{'$or':_['map'](_0x3c1b5b,function(_0x452580){if(_0x452580['type']!==_0xeabc('0x3c')){var _0x4ebd64={};_0x4ebd64[_0x452580['name']]={'$like':'%'+_0x131722['query']['filter']+'%'};return _0x4ebd64;}})});}_0x5b2934=_[_0xeabc('0x3b')]({},_0x5b2934,_0x131722['options']);var _0x257fe8={'where':_0x5b2934[_0xeabc('0x37')]};return db['MailSubstatus'][_0xeabc('0x1c')](_0x257fe8)['then'](function(_0x3d48f4){_0x5bf8f2['count']=_0x3d48f4;if(_0x131722[_0xeabc('0x30')][_0xeabc('0x3d')]){_0x5b2934[_0xeabc('0x3e')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x5b2934);})['then'](function(_0x46056c){_0x5bf8f2[_0xeabc('0x3f')]=_0x46056c;return _0x5bf8f2;})[_0xeabc('0x24')](respondWithFilteredResult(_0x4c2693,_0x5b2934))['catch'](handleError(_0x4c2693,null));};exports['show']=function(_0x5cd62e,_0x1680e8){var _0x5e9cb3={'raw':!![],'where':{'id':_0x5cd62e['params']['id']}},_0xc6af4d={};_0xc6af4d[_0xeabc('0x2f')]=_['keys'](db['MailSubstatus']['rawAttributes']);_0xc6af4d[_0xeabc('0x30')]=_[_0xeabc('0x40')](_0x5cd62e[_0xeabc('0x30')]);_0xc6af4d[_0xeabc('0x38')]=_['intersection'](_0xc6af4d[_0xeabc('0x2f')],_0xc6af4d['query']);_0x5e9cb3[_0xeabc('0x32')]=_[_0xeabc('0x31')](_0xc6af4d[_0xeabc('0x2f')],qs[_0xeabc('0x33')](_0x5cd62e[_0xeabc('0x30')]['fields']));_0x5e9cb3['attributes']=_0x5e9cb3[_0xeabc('0x32')]['length']?_0x5e9cb3[_0xeabc('0x32')]:_0xc6af4d[_0xeabc('0x2f')];if(_0x5cd62e['query'][_0xeabc('0x3d')]){_0x5e9cb3[_0xeabc('0x3e')]=[{'all':!![]}];}_0x5e9cb3=_[_0xeabc('0x3b')]({},_0x5e9cb3,_0x5cd62e[_0xeabc('0x41')]);return db[_0xeabc('0x42')][_0xeabc('0x43')](_0x5e9cb3)[_0xeabc('0x24')](handleEntityNotFound(_0x1680e8,null))['then'](respondWithResult(_0x1680e8,null))[_0xeabc('0x44')](handleError(_0x1680e8,null));};exports[_0xeabc('0x45')]=function(_0x2e7a5e,_0x1b41c8){return db[_0xeabc('0x42')][_0xeabc('0x45')](_0x2e7a5e[_0xeabc('0x46')],{})[_0xeabc('0x24')](respondWithResult(_0x1b41c8,0xc9))[_0xeabc('0x44')](handleError(_0x1b41c8,null));};exports[_0xeabc('0x23')]=function(_0x5689fc,_0x38356c){if(_0x5689fc[_0xeabc('0x46')]['id']){delete _0x5689fc[_0xeabc('0x46')]['id'];}return db[_0xeabc('0x42')][_0xeabc('0x43')]({'where':{'id':_0x5689fc[_0xeabc('0x47')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x38356c,null))['then'](saveUpdates(_0x5689fc[_0xeabc('0x46')],null))[_0xeabc('0x24')](respondWithResult(_0x38356c,null))[_0xeabc('0x44')](handleError(_0x38356c,null));};exports[_0xeabc('0x25')]=function(_0x47440e,_0x58e2c1){return db[_0xeabc('0x42')][_0xeabc('0x43')]({'where':{'id':_0x47440e[_0xeabc('0x47')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x58e2c1,null))['then'](removeEntity(_0x58e2c1,null))[_0xeabc('0x44')](handleError(_0x58e2c1,null));};exports[_0xeabc('0x48')]=function(_0x568847,_0x43e596){return db['MailSubstatus'][_0xeabc('0x48')]()['then'](respondWithResult(_0x43e596,null))[_0xeabc('0x44')](handleError(_0x43e596,null));}; \ No newline at end of file +var _0xc4aa=['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','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'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'];function respondWithStatusCode(_0x2a0776,_0x24291d){_0x24291d=_0x24291d||0xcc;return function(_0x5e16aa){if(_0x5e16aa){return _0x2a0776[_0xac4a('0x16')](_0x24291d);}return _0x2a0776[_0xac4a('0x17')](_0x24291d)[_0xac4a('0x18')]();};}function respondWithResult(_0x6e00d4,_0x1b4313){_0x1b4313=_0x1b4313||0xc8;return function(_0x3b71c0){if(_0x3b71c0){return _0x6e00d4[_0xac4a('0x17')](_0x1b4313)[_0xac4a('0x19')](_0x3b71c0);}};}function respondWithFilteredResult(_0x190418,_0x42c7fc){return function(_0x11e101){if(_0x11e101){var _0x26dbb8=_0x11e101[_0xac4a('0x1a')],_0x4a2119=_0x42c7fc[_0xac4a('0x1b')],_0x402fff=_0x42c7fc[_0xac4a('0x1b')]+_0x42c7fc[_0xac4a('0x1c')],_0x34d797;if(_0x402fff>=_0x26dbb8){_0x402fff=_0x26dbb8;_0x34d797=0xc8;}else{_0x34d797=0xce;}_0x190418[_0xac4a('0x17')](_0x34d797);return _0x190418[_0xac4a('0x1d')]('Content-Range',_0x4a2119+'-'+_0x402fff+'/'+_0x26dbb8)['json'](_0x11e101);}return null;};}function patchUpdates(_0x21a729){return function(_0x13c8eb){try{jsonpatch[_0xac4a('0x1e')](_0x13c8eb,_0x21a729,!![]);}catch(_0x4d837c){return BPromise[_0xac4a('0x1f')](_0x4d837c);}return _0x13c8eb[_0xac4a('0x20')]();};}function saveUpdates(_0x3752e4,_0x3a3cdb){return function(_0x123694){if(_0x123694){return _0x123694[_0xac4a('0x21')](_0x3752e4)[_0xac4a('0x22')](function(_0x3ca790){return _0x3ca790;});}return null;};}function removeEntity(_0x534092,_0x3d8f0a){return function(_0x3204ad){if(_0x3204ad){return _0x3204ad['destroy']()[_0xac4a('0x22')](function(){_0x534092[_0xac4a('0x17')](0xcc)[_0xac4a('0x18')]();});}};}function handleEntityNotFound(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(!_0x1b7998){_0x947d8e[_0xac4a('0x16')](0x194);}return _0x1b7998;};}function handleError(_0x15435c,_0x412494){_0x412494=_0x412494||0x1f4;return function(_0x594f36){logger[_0xac4a('0x23')](_0x594f36[_0xac4a('0x24')]);if(_0x594f36[_0xac4a('0x25')]){delete _0x594f36[_0xac4a('0x25')];}_0x15435c[_0xac4a('0x17')](_0x412494)[_0xac4a('0x26')](_0x594f36);};}exports[_0xac4a('0x27')]=function(_0x14832b,_0x472c57){var _0x1c13dc={},_0x20202c={},_0x4e17ce={'count':0x0,'rows':[]};var _0x23b061=_[_0xac4a('0x28')](db[_0xac4a('0x29')][_0xac4a('0x2a')],function(_0x116700){return{'name':_0x116700['fieldName'],'type':_0x116700['type'][_0xac4a('0x2b')]};});_0x20202c[_0xac4a('0x2c')]=_[_0xac4a('0x28')](_0x23b061,'name');_0x20202c['query']=_[_0xac4a('0x2d')](_0x14832b[_0xac4a('0x2e')]);_0x20202c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x20202c[_0xac4a('0x2c')],_0x20202c['query']);_0x1c13dc[_0xac4a('0x31')]=_['intersection'](_0x20202c[_0xac4a('0x2c')],qs['fields'](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x1c13dc[_0xac4a('0x31')]=_0x1c13dc[_0xac4a('0x31')][_0xac4a('0x33')]?_0x1c13dc[_0xac4a('0x31')]:_0x20202c[_0xac4a('0x2c')];if(!_0x14832b[_0xac4a('0x2e')][_0xac4a('0x34')](_0xac4a('0x35'))){_0x1c13dc[_0xac4a('0x1c')]=qs[_0xac4a('0x1c')](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x1c')]);_0x1c13dc['offset']=qs[_0xac4a('0x1b')](_0x14832b[_0xac4a('0x2e')]['offset']);}_0x1c13dc[_0xac4a('0x36')]=qs[_0xac4a('0x37')](_0x14832b['query']['sort']);_0x1c13dc[_0xac4a('0x38')]=qs[_0xac4a('0x2f')](_[_0xac4a('0x39')](_0x14832b[_0xac4a('0x2e')],_0x20202c['filters']));if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]){_0x1c13dc['where']=_[_0xac4a('0x3b')](_0x1c13dc[_0xac4a('0x38')],{'$or':_[_0xac4a('0x28')](_0x23b061,function(_0x5f0eb8){if(_0x5f0eb8[_0xac4a('0x3c')]!==_0xac4a('0x3d')){var _0x1b5427={};_0x1b5427[_0x5f0eb8['name']]={'$like':'%'+_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]+'%'};return _0x1b5427;}})});}_0x1c13dc=_['merge']({},_0x1c13dc,_0x14832b['options']);var _0x4319a1={'where':_0x1c13dc['where']};return db['MailSubstatus']['count'](_0x4319a1)['then'](function(_0x41b757){_0x4e17ce[_0xac4a('0x1a')]=_0x41b757;if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1c13dc[_0xac4a('0x3f')]=[{'all':!![]}];}return db[_0xac4a('0x29')][_0xac4a('0x40')](_0x1c13dc);})[_0xac4a('0x22')](function(_0x28292c){_0x4e17ce[_0xac4a('0x41')]=_0x28292c;return _0x4e17ce;})[_0xac4a('0x22')](respondWithFilteredResult(_0x472c57,_0x1c13dc))[_0xac4a('0x42')](handleError(_0x472c57,null));};exports['show']=function(_0x5086ff,_0x5cd24f){var _0x1e1cc5={'raw':!![],'where':{'id':_0x5086ff[_0xac4a('0x43')]['id']}},_0x5c46a={};_0x5c46a[_0xac4a('0x2c')]=_[_0xac4a('0x2d')](db[_0xac4a('0x29')][_0xac4a('0x2a')]);_0x5c46a[_0xac4a('0x2e')]=_[_0xac4a('0x2d')](_0x5086ff[_0xac4a('0x2e')]);_0x5c46a['filters']=_[_0xac4a('0x30')](_0x5c46a[_0xac4a('0x2c')],_0x5c46a[_0xac4a('0x2e')]);_0x1e1cc5[_0xac4a('0x31')]=_[_0xac4a('0x30')](_0x5c46a['model'],qs[_0xac4a('0x32')](_0x5086ff[_0xac4a('0x2e')]['fields']));_0x1e1cc5[_0xac4a('0x31')]=_0x1e1cc5['attributes'][_0xac4a('0x33')]?_0x1e1cc5[_0xac4a('0x31')]:_0x5c46a[_0xac4a('0x2c')];if(_0x5086ff[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1e1cc5[_0xac4a('0x3f')]=[{'all':!![]}];}_0x1e1cc5=_[_0xac4a('0x3b')]({},_0x1e1cc5,_0x5086ff[_0xac4a('0x44')]);return db[_0xac4a('0x29')][_0xac4a('0x45')](_0x1e1cc5)[_0xac4a('0x22')](handleEntityNotFound(_0x5cd24f,null))[_0xac4a('0x22')](respondWithResult(_0x5cd24f,null))['catch'](handleError(_0x5cd24f,null));};exports[_0xac4a('0x46')]=function(_0x41d11d,_0xeca4e9){return db['MailSubstatus'][_0xac4a('0x46')](_0x41d11d[_0xac4a('0x47')],{})['then'](respondWithResult(_0xeca4e9,0xc9))[_0xac4a('0x42')](handleError(_0xeca4e9,null));};exports['update']=function(_0x244950,_0xe620f6){if(_0x244950[_0xac4a('0x47')]['id']){delete _0x244950['body']['id'];}return db['MailSubstatus'][_0xac4a('0x45')]({'where':{'id':_0x244950['params']['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0xe620f6,null))['then'](saveUpdates(_0x244950[_0xac4a('0x47')],null))['then'](respondWithResult(_0xe620f6,null))[_0xac4a('0x42')](handleError(_0xe620f6,null));};exports[_0xac4a('0x48')]=function(_0x424f9b,_0x1c8c39){return db['MailSubstatus'][_0xac4a('0x45')]({'where':{'id':_0x424f9b[_0xac4a('0x43')]['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0x1c8c39,null))[_0xac4a('0x22')](removeEntity(_0x1c8c39,null))[_0xac4a('0x42')](handleError(_0x1c8c39,null));};exports[_0xac4a('0x49')]=function(_0x187306,_0x4e6e19){return db[_0xac4a('0x29')][_0xac4a('0x49')]()['then'](respondWithResult(_0x4e6e19,null))[_0xac4a('0x42')](handleError(_0x4e6e19,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index ace39ab..c37d32d 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 _0x3fce=['MailSubstatus','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x35714b,_0x425dcd){var _0x4e41ff=function(_0x35d674){while(--_0x35d674){_0x35714b['push'](_0x35714b['shift']());}};_0x4e41ff(++_0x425dcd);}(_0x3fce,0x121));var _0xe3fc=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x3fce[_0x1305e3];return _0x1068e9;};'use strict';var _=require('lodash');var util=require(_0xe3fc('0x0'));var logger=require(_0xe3fc('0x1'))(_0xe3fc('0x2'));var moment=require(_0xe3fc('0x3'));var BPromise=require(_0xe3fc('0x4'));var rp=require(_0xe3fc('0x5'));var fs=require('fs');var path=require(_0xe3fc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x36eff8,_0x2dc84d){return _0x36eff8['define'](_0xe3fc('0x7'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8286=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','MailSubstatus','mail_substatuses','lodash','util'];(function(_0x12e6f9,_0x5c4f03){var _0x1afd27=function(_0x3e01ff){while(--_0x3e01ff){_0x12e6f9['push'](_0x12e6f9['shift']());}};_0x1afd27(++_0x5c4f03);}(_0x8286,0x66));var _0x6828=function(_0xc3182a,_0x5184a4){_0xc3182a=_0xc3182a-0x0;var _0x2759c6=_0x8286[_0xc3182a];return _0x2759c6;};'use strict';var _=require(_0x6828('0x0'));var util=require(_0x6828('0x1'));var logger=require(_0x6828('0x2'))(_0x6828('0x3'));var moment=require(_0x6828('0x4'));var BPromise=require(_0x6828('0x5'));var rp=require(_0x6828('0x6'));var fs=require('fs');var path=require(_0x6828('0x7'));var rimraf=require(_0x6828('0x8'));var config=require(_0x6828('0x9'));var attributes=require(_0x6828('0xa'));module['exports']=function(_0x31c3d0,_0xe4b9bb){return _0x31c3d0['define'](_0x6828('0xb'),attributes,{'tableName':_0x6828('0xc'),'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 3e23b1a..4504a72 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 _0x6324=['client','http','then','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x33a373,_0x1fee78){var _0x599d44=function(_0x5aba58){while(--_0x5aba58){_0x33a373['push'](_0x33a373['shift']());}};_0x599d44(++_0x1fee78);}(_0x6324,0x142));var _0x4632=function(_0x536bc2,_0x35c4bf){_0x536bc2=_0x536bc2-0x0;var _0x551b56=_0x6324[_0x536bc2];return _0x551b56;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var moment=require(_0x4632('0x2'));var BPromise=require(_0x4632('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4632('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4632('0x5'));var logger=require('../../config/logger')(_0x4632('0x6'));var config=require('../../config/environment');var jayson=require(_0x4632('0x7'));var client=jayson[_0x4632('0x8')][_0x4632('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x126e9a,_0x4a15b2,_0x17e860){return new BPromise(function(_0x44dd6d,_0x390a46){return client['request'](_0x126e9a,_0x17e860)[_0x4632('0xa')](function(_0x47824c){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x4a15b2,_0x4632('0xb'));logger[_0x4632('0xc')](_0x4632('0xd'),_0x4a15b2,_0x4632('0xb'),JSON[_0x4632('0xe')](_0x47824c));if(_0x47824c[_0x4632('0xf')]){if(_0x47824c[_0x4632('0xf')][_0x4632('0x10')]===0x1f4){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x47824c['error'][_0x4632('0x12')]);return _0x390a46(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}logger[_0x4632('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x4a15b2,_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);return _0x44dd6d(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}else{logger[_0x4632('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x4a15b2,'request\x20sent');_0x44dd6d(_0x47824c[_0x4632('0x14')][_0x4632('0x12')]);}})[_0x4632('0x15')](function(_0x125eb9){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x125eb9);_0x390a46(_0x125eb9);});});} \ No newline at end of file +var _0x55e0=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x55e0,0xdc));var _0x055e=function(_0x3fae29,_0x3d65b5){_0x3fae29=_0x3fae29-0x0;var _0x200226=_0x55e0[_0x3fae29];return _0x200226;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4384ff,_0x4a442e,_0x8e7824){return new BPromise(function(_0x3c4cf,_0x376618){return client[_0x055e('0xa')](_0x4384ff,_0x8e7824)[_0x055e('0xb')](function(_0x49540c){logger[_0x055e('0xc')](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));logger[_0x055e('0xf')](_0x055e('0x10'),_0x4a442e,'request\x20sent',JSON['stringify'](_0x49540c));if(_0x49540c[_0x055e('0x11')]){if(_0x49540c['error'][_0x055e('0x12')]===0x1f4){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x376618(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}logger['error'](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x3c4cf(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}else{logger['info'](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));_0x3c4cf(_0x49540c[_0x055e('0x14')]['message']);}})[_0x055e('0x15')](function(_0x2c377c){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x2c377c);_0x376618(_0x2c377c);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 2ef31f0..895c1e2 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 _0x9f81=['describe','/:id','post','create','put','update','delete','connect-timeout','Router','../../components/auth/service','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x3f77ce,_0x56dc7a){var _0x31396a=function(_0x5939b4){while(--_0x5939b4){_0x3f77ce['push'](_0x3f77ce['shift']());}};_0x31396a(++_0x56dc7a);}(_0x9f81,0x11f));var _0x19f8=function(_0x4ba110,_0x379243){_0x4ba110=_0x4ba110-0x0;var _0x439e6b=_0x9f81[_0x4ba110];return _0x439e6b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x19f8('0x0'));var express=require('express');var router=express[_0x19f8('0x1')]();var auth=require(_0x19f8('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x19f8('0x3'));router[_0x19f8('0x4')]('/',auth[_0x19f8('0x5')](),controller[_0x19f8('0x6')]);router[_0x19f8('0x4')]('/describe',auth[_0x19f8('0x5')](),controller[_0x19f8('0x7')]);router[_0x19f8('0x4')](_0x19f8('0x8'),auth[_0x19f8('0x5')](),controller['show']);router[_0x19f8('0x9')]('/',auth[_0x19f8('0x5')](),controller[_0x19f8('0xa')]);router[_0x19f8('0xb')](_0x19f8('0x8'),auth[_0x19f8('0x5')](),controller[_0x19f8('0xc')]);router[_0x19f8('0xd')](_0x19f8('0x8'),auth[_0x19f8('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7a3c=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','create','put','update','delete','destroy','multer'];(function(_0x2e58c7,_0x23d092){var _0x26eb00=function(_0x343124){while(--_0x343124){_0x2e58c7['push'](_0x2e58c7['shift']());}};_0x26eb00(++_0x23d092);}(_0x7a3c,0x1e5));var _0xc7a3=function(_0x1980d1,_0x2e3d5d){_0x1980d1=_0x1980d1-0x0;var _0x3f2f0a=_0x7a3c[_0x1980d1];return _0x3f2f0a;};'use strict';var multer=require(_0xc7a3('0x0'));var util=require('util');var path=require(_0xc7a3('0x1'));var timeout=require(_0xc7a3('0x2'));var express=require(_0xc7a3('0x3'));var router=express[_0xc7a3('0x4')]();var auth=require(_0xc7a3('0x5'));var interaction=require(_0xc7a3('0x6'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0xc7a3('0x7')](),controller[_0xc7a3('0x8')]);router[_0xc7a3('0x9')](_0xc7a3('0xa'),auth[_0xc7a3('0x7')](),controller[_0xc7a3('0xb')]);router[_0xc7a3('0x9')](_0xc7a3('0xc'),auth[_0xc7a3('0x7')](),controller['show']);router['post']('/',auth[_0xc7a3('0x7')](),controller[_0xc7a3('0xd')]);router[_0xc7a3('0xe')]('/:id',auth[_0xc7a3('0x7')](),controller[_0xc7a3('0xf')]);router[_0xc7a3('0x10')](_0xc7a3('0xc'),auth['isAuthenticated'](),controller[_0xc7a3('0x11')]);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 b952003..e11c377 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 _0xc4fd=['NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc4fd,0xfb));var _0xdc4f=function(_0x2b9cf5,_0x2a7804){_0x2b9cf5=_0x2b9cf5-0x0;var _0xd0cf15=_0xc4fd[_0x2b9cf5];return _0xd0cf15;};'use strict';var moment=require(_0xdc4f('0x0'));var Sequelize=require(_0xdc4f('0x1'));module[_0xdc4f('0x2')]={'uniqueid':{'type':Sequelize[_0xdc4f('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdc4f('0x4')](_0xdc4f('0x5'),_0xdc4f('0x6'),'queue'),'allowNull':![],'defaultValue':_0xdc4f('0x7')},'transferredAt':{'type':Sequelize[_0xdc4f('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xdc4f('0x9')]}}; \ No newline at end of file +var _0x20b1=['queue','DATE','NOW','moment','exports','STRING','account','agent'];(function(_0x2c3376,_0x2fff50){var _0x392313=function(_0xe1bca6){while(--_0xe1bca6){_0x2c3376['push'](_0x2c3376['shift']());}};_0x392313(++_0x2fff50);}(_0x20b1,0x1eb));var _0x120b=function(_0x40d62f,_0x4eda1d){_0x40d62f=_0x40d62f-0x0;var _0x5637c1=_0x20b1[_0x40d62f];return _0x5637c1;};'use strict';var moment=require(_0x120b('0x0'));var Sequelize=require('sequelize');module[_0x120b('0x1')]={'uniqueid':{'type':Sequelize[_0x120b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x120b('0x3'),_0x120b('0x4'),_0x120b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x120b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x120b('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index e82de49..2c335a3 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(_0x4c9d47,_0x28ce56){var _0x43cdf8=function(_0x5ed954){while(--_0x5ed954){_0x4c9d47['push'](_0x4c9d47['shift']());}};_0x43cdf8(++_0x28ce56);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(_0xeba0ba,_0x24052d){var _0x3e2fbe=function(_0x5ed6d1){while(--_0x5ed6d1){_0xeba0ba['push'](_0xeba0ba['shift']());}};_0x3e2fbe(++_0x24052d);}(_0x7a54,0x106));var _0x47a5=function(_0x362691,_0x49f56c){_0x362691=_0x362691-0x0;var _0x13b24e=_0x7a54[_0x362691];return _0x13b24e;};'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 643ffdf..b9095be 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 _0x843e=['report_mail_transfer','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport'];(function(_0x6ee433,_0x4d669d){var _0x284cf4=function(_0x50db22){while(--_0x50db22){_0x6ee433['push'](_0x6ee433['shift']());}};_0x284cf4(++_0x4d669d);}(_0x843e,0xc1));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe843('0x0'));var util=require('util');var logger=require(_0xe843('0x1'))(_0xe843('0x2'));var moment=require(_0xe843('0x3'));var BPromise=require(_0xe843('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe843('0x5'));var rimraf=require(_0xe843('0x6'));var config=require(_0xe843('0x7'));var attributes=require(_0xe843('0x8'));module[_0xe843('0x9')]=function(_0x4413d3,_0x4027ca){return _0x4413d3['define'](_0xe843('0xa'),attributes,{'tableName':_0xe843('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9067=['rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x468e5f,_0x3a8f25){var _0x3b0afa=function(_0x1cde2c){while(--_0x1cde2c){_0x468e5f['push'](_0x468e5f['shift']());}};_0x3b0afa(++_0x3a8f25);}(_0x9067,0x19e));var _0x7906=function(_0x473d7a,_0x5623d9){_0x473d7a=_0x473d7a-0x0;var _0x1aba20=_0x9067[_0x473d7a];return _0x1aba20;};'use strict';var _=require(_0x7906('0x0'));var util=require(_0x7906('0x1'));var logger=require(_0x7906('0x2'))(_0x7906('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7906('0x4'));var config=require(_0x7906('0x5'));var attributes=require(_0x7906('0x6'));module[_0x7906('0x7')]=function(_0x2bb20d,_0x1f0416){return _0x2bb20d[_0x7906('0x8')]('MailTransferReport',attributes,{'tableName':_0x7906('0x9'),'paranoid':![],'indexes':[{'name':_0x7906('0xa'),'fields':[_0x7906('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index da05eb0..d0967ab 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 _0x5d96=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x5d96,0x117));var _0x65d9=function(_0x131712,_0x2ed068){_0x131712=_0x131712-0x0;var _0x292b97=_0x5d96[_0x131712];return _0x292b97;};'use strict';var _=require(_0x65d9('0x0'));var util=require(_0x65d9('0x1'));var moment=require('moment');var BPromise=require(_0x65d9('0x2'));var rs=require(_0x65d9('0x3'));var fs=require('fs');var Redis=require(_0x65d9('0x4'));var db=require(_0x65d9('0x5'))['db'];var utils=require(_0x65d9('0x6'));var logger=require('../../config/logger')(_0x65d9('0x7'));var config=require('../../config/environment');var jayson=require(_0x65d9('0x8'));var client=jayson[_0x65d9('0x9')][_0x65d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x295dda,_0x5323a6,_0x4a89a7){return new BPromise(function(_0x28088f,_0x4beae3){return client['request'](_0x295dda,_0x4a89a7)[_0x65d9('0xb')](function(_0x1713f3){logger[_0x65d9('0xc')](_0x65d9('0xd'),_0x5323a6,_0x65d9('0xe'));logger[_0x65d9('0xf')](_0x65d9('0x10'),_0x5323a6,_0x65d9('0xe'),JSON[_0x65d9('0x11')](_0x1713f3));if(_0x1713f3[_0x65d9('0x12')]){if(_0x1713f3['error'][_0x65d9('0x13')]===0x1f4){logger['error'](_0x65d9('0xd'),_0x5323a6,_0x1713f3[_0x65d9('0x12')][_0x65d9('0x14')]);return _0x4beae3(_0x1713f3[_0x65d9('0x12')][_0x65d9('0x14')]);}logger[_0x65d9('0x12')](_0x65d9('0xd'),_0x5323a6,_0x1713f3[_0x65d9('0x12')]['message']);return _0x28088f(_0x1713f3[_0x65d9('0x12')][_0x65d9('0x14')]);}else{logger[_0x65d9('0xc')](_0x65d9('0xd'),_0x5323a6,_0x65d9('0xe'));_0x28088f(_0x1713f3[_0x65d9('0x15')][_0x65d9('0x14')]);}})[_0x65d9('0x16')](function(_0x495cf9){logger[_0x65d9('0x12')](_0x65d9('0xd'),_0x5323a6,_0x495cf9);_0x4beae3(_0x495cf9);});});} \ No newline at end of file +var _0x6dd1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6dd1,0x180));var _0x16dd=function(_0x244679,_0x3ea89c){_0x244679=_0x244679-0x0;var _0x285508=_0x6dd1[_0x244679];return _0x285508;};'use strict';var _=require(_0x16dd('0x0'));var util=require(_0x16dd('0x1'));var moment=require(_0x16dd('0x2'));var BPromise=require(_0x16dd('0x3'));var rs=require(_0x16dd('0x4'));var fs=require('fs');var Redis=require(_0x16dd('0x5'));var db=require(_0x16dd('0x6'))['db'];var utils=require(_0x16dd('0x7'));var logger=require(_0x16dd('0x8'))(_0x16dd('0x9'));var config=require(_0x16dd('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x16dd('0xb')][_0x16dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36cf39,_0x516052,_0x303e34){return new BPromise(function(_0xb34d03,_0x4874be){return client[_0x16dd('0xd')](_0x36cf39,_0x303e34)['then'](function(_0x1c4ec4){logger[_0x16dd('0xe')](_0x16dd('0xf'),_0x516052,_0x16dd('0x10'));logger[_0x16dd('0x11')](_0x16dd('0x12'),_0x516052,_0x16dd('0x10'),JSON[_0x16dd('0x13')](_0x1c4ec4));if(_0x1c4ec4['error']){if(_0x1c4ec4[_0x16dd('0x14')]['code']===0x1f4){logger[_0x16dd('0x14')](_0x16dd('0xf'),_0x516052,_0x1c4ec4[_0x16dd('0x14')][_0x16dd('0x15')]);return _0x4874be(_0x1c4ec4[_0x16dd('0x14')]['message']);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x516052,_0x1c4ec4[_0x16dd('0x14')][_0x16dd('0x15')]);return _0xb34d03(_0x1c4ec4[_0x16dd('0x14')][_0x16dd('0x15')]);}else{logger[_0x16dd('0xe')](_0x16dd('0xf'),_0x516052,'request\x20sent');_0xb34d03(_0x1c4ec4[_0x16dd('0x16')][_0x16dd('0x15')]);}})[_0x16dd('0x17')](function(_0x3515c2){logger[_0x16dd('0x14')](_0x16dd('0xf'),_0x516052,_0x3515c2);_0x4874be(_0x3515c2);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 7e41ca0..68ecc5c 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 _0xac11=['../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3b8673,_0x3e48af){var _0x2f7a15=function(_0x473a34){while(--_0x473a34){_0x3b8673['push'](_0x3b8673['shift']());}};_0x2f7a15(++_0x3e48af);}(_0xac11,0x12d));var _0x1ac1=function(_0x286057,_0x177c18){_0x286057=_0x286057-0x0;var _0x41e2db=_0xac11[_0x286057];return _0x41e2db;};'use strict';var multer=require(_0x1ac1('0x0'));var util=require('util');var path=require(_0x1ac1('0x1'));var timeout=require(_0x1ac1('0x2'));var express=require(_0x1ac1('0x3'));var router=express[_0x1ac1('0x4')]();var auth=require(_0x1ac1('0x5'));var interaction=require(_0x1ac1('0x6'));var config=require(_0x1ac1('0x7'));var controller=require(_0x1ac1('0x8'));router[_0x1ac1('0x9')]('/',auth[_0x1ac1('0xa')](),controller['index']);router[_0x1ac1('0x9')](_0x1ac1('0xb'),auth[_0x1ac1('0xa')](),controller[_0x1ac1('0xc')]);router[_0x1ac1('0x9')](_0x1ac1('0xd'),auth['isAuthenticated'](),controller[_0x1ac1('0xe')]);router[_0x1ac1('0xf')]('/',auth['isAuthenticated'](),controller[_0x1ac1('0x10')]);router[_0x1ac1('0x11')]('/:id',auth[_0x1ac1('0xa')](),controller[_0x1ac1('0x12')]);router[_0x1ac1('0x13')](_0x1ac1('0xd'),auth[_0x1ac1('0xa')](),controller[_0x1ac1('0x14')]);module[_0x1ac1('0x15')]=router; \ No newline at end of file +var _0xad9c=['get','isAuthenticated','index','/describe','show','post','create','/:id','update','delete','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller'];(function(_0x169564,_0x3d3962){var _0x27a0b7=function(_0x57feb3){while(--_0x57feb3){_0x169564['push'](_0x169564['shift']());}};_0x27a0b7(++_0x3d3962);}(_0xad9c,0xad));var _0xcad9=function(_0x10daff,_0x27c559){_0x10daff=_0x10daff-0x0;var _0x16941d=_0xad9c[_0x10daff];return _0x16941d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcad9('0x0'));var timeout=require(_0xcad9('0x1'));var express=require('express');var router=express[_0xcad9('0x2')]();var auth=require(_0xcad9('0x3'));var interaction=require(_0xcad9('0x4'));var config=require(_0xcad9('0x5'));var controller=require(_0xcad9('0x6'));router[_0xcad9('0x7')]('/',auth[_0xcad9('0x8')](),controller[_0xcad9('0x9')]);router[_0xcad9('0x7')](_0xcad9('0xa'),auth[_0xcad9('0x8')](),controller['describe']);router[_0xcad9('0x7')]('/:id',auth[_0xcad9('0x8')](),controller[_0xcad9('0xb')]);router[_0xcad9('0xc')]('/',auth[_0xcad9('0x8')](),controller[_0xcad9('0xd')]);router['put'](_0xcad9('0xe'),auth[_0xcad9('0x8')](),controller[_0xcad9('0xf')]);router[_0xcad9('0x10')](_0xcad9('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xcad9('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 17bc6df..c8d303c 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 _0x7a2b=['exports','STRING','INTEGER','getDataValue','enterAt','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x3b0515,_0x1fa41d){var _0x198d7a=function(_0x17b712){while(--_0x17b712){_0x3b0515['push'](_0x3b0515['shift']());}};_0x198d7a(++_0x1fa41d);}(_0x7a2b,0x17e));var _0xb7a2=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7a2b[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xb7a2('0x0'));var moment=require(_0xb7a2('0x1'));module[_0xb7a2('0x2')]={'channel':{'type':Sequelize[_0xb7a2('0x3')]},'membername':{'type':Sequelize[_0xb7a2('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb7a2('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xb7a2('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x32acdf){var _0x41cad3=moment(_0x32acdf);var _0xa0f9d9=moment(this[_0xb7a2('0x5')](_0xb7a2('0x6')));var _0x325e5a=_0x41cad3['diff'](_0xa0f9d9,_0xb7a2('0x7'));this['setDataValue'](_0xb7a2('0x8'),_0x32acdf);this[_0xb7a2('0x9')](_0xb7a2('0xa'),_0x325e5a||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xb7a2('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0xb7a2('0xc')},'data3':{'type':Sequelize[_0xb7a2('0x3')],'comment':_0xb7a2('0xd')},'data4':{'type':Sequelize[_0xb7a2('0x3')],'comment':_0xb7a2('0xe')},'data5':{'type':Sequelize[_0xb7a2('0x3')],'comment':_0xb7a2('0xf')},'role':{'type':Sequelize[_0xb7a2('0x3')]},'internal':{'type':Sequelize[_0xb7a2('0x4')]},'uniqueid':{'type':Sequelize[_0xb7a2('0x3')]}}; \ No newline at end of file +var _0xb62e=['talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','getDataValue','enterAt','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb62e,0x100));var _0xeb62=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb62e[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xeb62('0x0'));var moment=require(_0xeb62('0x1'));module[_0xeb62('0x2')]={'channel':{'type':Sequelize[_0xeb62('0x3')]},'membername':{'type':Sequelize[_0xeb62('0x3')]},'interface':{'type':Sequelize[_0xeb62('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xeb62('0x4'),'comment':_0xeb62('0x5')},'duration':{'type':Sequelize[_0xeb62('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x3aa584){var _0x122c54=moment(_0x3aa584);var _0x35fdce=moment(this[_0xeb62('0x7')](_0xeb62('0x8')));var _0x494a46=_0x122c54['diff'](_0x35fdce,_0xeb62('0x9'));this[_0xeb62('0xa')](_0xeb62('0xb'),_0x3aa584);this['setDataValue']('duration',_0x494a46||null);}},'data1':{'type':Sequelize[_0xeb62('0x3')],'comment':_0xeb62('0xc')},'data2':{'type':Sequelize[_0xeb62('0x3')],'comment':_0xeb62('0xd')},'data3':{'type':Sequelize[_0xeb62('0x3')],'comment':_0xeb62('0xe')},'data4':{'type':Sequelize[_0xeb62('0x3')],'comment':_0xeb62('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0xeb62('0x10')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xeb62('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 3da6519..4b63f4c 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 _0x17b5=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','update','describe','eml-format','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x488430,_0x22437a){var _0x4a0a99=function(_0x1fb4ea){while(--_0x1fb4ea){_0x488430['push'](_0x488430['shift']());}};_0x4a0a99(++_0x22437a);}(_0x17b5,0x18e));var _0x517b=function(_0x17e771,_0x55fd17){_0x17e771=_0x17e771-0x0;var _0x1f3a6d=_0x17b5[_0x17e771];return _0x1f3a6d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x517b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x517b('0x1'));var rp=require(_0x517b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x517b('0x3'));var util=require('util');var path=require(_0x517b('0x4'));var sox=require('sox');var csv=require(_0x517b('0x5'));var ejs=require(_0x517b('0x6'));var fs=require('fs');var _=require(_0x517b('0x7'));var squel=require(_0x517b('0x8'));var crypto=require(_0x517b('0x9'));var jsforce=require(_0x517b('0xa'));var deskjs=require(_0x517b('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x517b('0xc'));var Redis=require(_0x517b('0xd'));var authService=require(_0x517b('0xe'));var qs=require(_0x517b('0xf'));var as=require(_0x517b('0x10'));var hardwareService=require(_0x517b('0x11'));var logger=require(_0x517b('0x12'))(_0x517b('0x13'));var utils=require(_0x517b('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x296342,_0x4962db){_0x4962db=_0x4962db||0xcc;return function(_0x164aa5){if(_0x164aa5){return _0x296342[_0x517b('0x15')](_0x4962db);}return _0x296342[_0x517b('0x16')](_0x4962db)[_0x517b('0x17')]();};}function respondWithResult(_0x37b774,_0x5062a7){_0x5062a7=_0x5062a7||0xc8;return function(_0x1632e9){if(_0x1632e9){return _0x37b774[_0x517b('0x16')](_0x5062a7)[_0x517b('0x18')](_0x1632e9);}};}function respondWithFilteredResult(_0x52a7b9,_0x6c3752){return function(_0xbbee20){if(_0xbbee20){var _0xdd2b92=_0xbbee20[_0x517b('0x19')],_0x5564b7=_0x6c3752['offset'],_0x8b17de=_0x6c3752[_0x517b('0x1a')]+_0x6c3752['limit'],_0x1eb20c;if(_0x8b17de>=_0xdd2b92){_0x8b17de=_0xdd2b92;_0x1eb20c=0xc8;}else{_0x1eb20c=0xce;}_0x52a7b9[_0x517b('0x16')](_0x1eb20c);return _0x52a7b9['set'](_0x517b('0x1b'),_0x5564b7+'-'+_0x8b17de+'/'+_0xdd2b92)[_0x517b('0x18')](_0xbbee20);}return null;};}function patchUpdates(_0x21a609){return function(_0x205fdc){try{jsonpatch[_0x517b('0x1c')](_0x205fdc,_0x21a609,!![]);}catch(_0x1f82f3){return BPromise[_0x517b('0x1d')](_0x1f82f3);}return _0x205fdc[_0x517b('0x1e')]();};}function saveUpdates(_0x4fb1,_0x42bc42){return function(_0x282a5f){if(_0x282a5f){return _0x282a5f['update'](_0x4fb1)[_0x517b('0x1f')](function(_0x963507){return _0x963507;});}return null;};}function removeEntity(_0x513ed4,_0x28b34d){return function(_0x2c6d82){if(_0x2c6d82){return _0x2c6d82[_0x517b('0x20')]()['then'](function(){_0x513ed4[_0x517b('0x16')](0xcc)[_0x517b('0x17')]();});}};}function handleEntityNotFound(_0x45e852,_0x18ff13){return function(_0xac8341){if(!_0xac8341){_0x45e852[_0x517b('0x15')](0x194);}return _0xac8341;};}function handleError(_0x24bd25,_0x243d9f){_0x243d9f=_0x243d9f||0x1f4;return function(_0x30439e){logger[_0x517b('0x21')](_0x30439e[_0x517b('0x22')]);if(_0x30439e[_0x517b('0x23')]){delete _0x30439e[_0x517b('0x23')];}_0x24bd25[_0x517b('0x16')](_0x243d9f)[_0x517b('0x24')](_0x30439e);};}exports[_0x517b('0x25')]=function(_0x37ff9d,_0x1a437d){var _0x3d6a42={},_0x46e850={},_0x5865a8={'count':0x0,'rows':[]};var _0x2fb40f=_[_0x517b('0x26')](db[_0x517b('0x27')][_0x517b('0x28')],function(_0x26e858){return{'name':_0x26e858[_0x517b('0x29')],'type':_0x26e858['type']['key']};});_0x46e850[_0x517b('0x2a')]=_['map'](_0x2fb40f,'name');_0x46e850[_0x517b('0x2b')]=_[_0x517b('0x2c')](_0x37ff9d[_0x517b('0x2b')]);_0x46e850[_0x517b('0x2d')]=_[_0x517b('0x2e')](_0x46e850[_0x517b('0x2a')],_0x46e850[_0x517b('0x2b')]);_0x3d6a42['attributes']=_[_0x517b('0x2e')](_0x46e850['model'],qs[_0x517b('0x2f')](_0x37ff9d['query']['fields']));_0x3d6a42[_0x517b('0x30')]=_0x3d6a42[_0x517b('0x30')]['length']?_0x3d6a42[_0x517b('0x30')]:_0x46e850[_0x517b('0x2a')];if(!_0x37ff9d[_0x517b('0x2b')]['hasOwnProperty'](_0x517b('0x31'))){_0x3d6a42[_0x517b('0x32')]=qs[_0x517b('0x32')](_0x37ff9d[_0x517b('0x2b')][_0x517b('0x32')]);_0x3d6a42[_0x517b('0x1a')]=qs[_0x517b('0x1a')](_0x37ff9d[_0x517b('0x2b')][_0x517b('0x1a')]);}_0x3d6a42[_0x517b('0x33')]=qs[_0x517b('0x34')](_0x37ff9d[_0x517b('0x2b')][_0x517b('0x34')]);_0x3d6a42['where']=qs[_0x517b('0x2d')](_['pick'](_0x37ff9d[_0x517b('0x2b')],_0x46e850[_0x517b('0x2d')]));if(_0x37ff9d[_0x517b('0x2b')]['filter']){_0x3d6a42[_0x517b('0x35')]=_[_0x517b('0x36')](_0x3d6a42[_0x517b('0x35')],{'$or':_[_0x517b('0x26')](_0x2fb40f,function(_0x4a9dff){if(_0x4a9dff['type']!==_0x517b('0x37')){var _0x210f21={};_0x210f21[_0x4a9dff[_0x517b('0x23')]]={'$like':'%'+_0x37ff9d[_0x517b('0x2b')][_0x517b('0x38')]+'%'};return _0x210f21;}})});}_0x3d6a42=_[_0x517b('0x36')]({},_0x3d6a42,_0x37ff9d[_0x517b('0x39')]);var _0x57bf80={'where':_0x3d6a42[_0x517b('0x35')]};return db[_0x517b('0x27')]['count'](_0x57bf80)['then'](function(_0x4c8dc6){_0x5865a8[_0x517b('0x19')]=_0x4c8dc6;if(_0x37ff9d[_0x517b('0x2b')]['includeAll']){_0x3d6a42[_0x517b('0x3a')]=[{'all':!![]}];}return db[_0x517b('0x27')][_0x517b('0x3b')](_0x3d6a42);})[_0x517b('0x1f')](function(_0x4187f1){_0x5865a8[_0x517b('0x3c')]=_0x4187f1;return _0x5865a8;})['then'](respondWithFilteredResult(_0x1a437d,_0x3d6a42))[_0x517b('0x3d')](handleError(_0x1a437d,null));};exports['show']=function(_0x357586,_0x3220af){var _0x328c96={'raw':!![],'where':{'id':_0x357586[_0x517b('0x3e')]['id']}},_0x412112={};_0x412112[_0x517b('0x2a')]=_[_0x517b('0x2c')](db['MemberReport'][_0x517b('0x28')]);_0x412112[_0x517b('0x2b')]=_[_0x517b('0x2c')](_0x357586['query']);_0x412112[_0x517b('0x2d')]=_[_0x517b('0x2e')](_0x412112['model'],_0x412112[_0x517b('0x2b')]);_0x328c96['attributes']=_[_0x517b('0x2e')](_0x412112['model'],qs[_0x517b('0x2f')](_0x357586[_0x517b('0x2b')]['fields']));_0x328c96['attributes']=_0x328c96[_0x517b('0x30')]['length']?_0x328c96['attributes']:_0x412112[_0x517b('0x2a')];if(_0x357586['query'][_0x517b('0x3f')]){_0x328c96['include']=[{'all':!![]}];}_0x328c96=_[_0x517b('0x36')]({},_0x328c96,_0x357586[_0x517b('0x39')]);return db[_0x517b('0x27')][_0x517b('0x40')](_0x328c96)[_0x517b('0x1f')](handleEntityNotFound(_0x3220af,null))[_0x517b('0x1f')](respondWithResult(_0x3220af,null))[_0x517b('0x3d')](handleError(_0x3220af,null));};exports[_0x517b('0x41')]=function(_0x4a4459,_0x22a73a){return db[_0x517b('0x27')]['create'](_0x4a4459[_0x517b('0x42')],{})[_0x517b('0x1f')](respondWithResult(_0x22a73a,0xc9))[_0x517b('0x3d')](handleError(_0x22a73a,null));};exports[_0x517b('0x43')]=function(_0x1e6566,_0x416552){if(_0x1e6566['body']['id']){delete _0x1e6566[_0x517b('0x42')]['id'];}return db[_0x517b('0x27')]['find']({'where':{'id':_0x1e6566[_0x517b('0x3e')]['id']}})[_0x517b('0x1f')](handleEntityNotFound(_0x416552,null))[_0x517b('0x1f')](saveUpdates(_0x1e6566[_0x517b('0x42')],null))['then'](respondWithResult(_0x416552,null))[_0x517b('0x3d')](handleError(_0x416552,null));};exports[_0x517b('0x20')]=function(_0x41e316,_0x2185e0){return db[_0x517b('0x27')]['find']({'where':{'id':_0x41e316[_0x517b('0x3e')]['id']}})[_0x517b('0x1f')](handleEntityNotFound(_0x2185e0,null))['then'](removeEntity(_0x2185e0,null))[_0x517b('0x3d')](handleError(_0x2185e0,null));};exports[_0x517b('0x44')]=function(_0x2a467b,_0xfa27c4){return db[_0x517b('0x27')][_0x517b('0x44')]()['then'](respondWithResult(_0xfa27c4,null))[_0x517b('0x3d')](handleError(_0xfa27c4,null));}; \ No newline at end of file +var _0x77ec=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','MemberReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','count','includeAll','include','findAll','rows','fields','options','catch','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x1e567d,_0x10e8fb){var _0x579841=function(_0x47e3f3){while(--_0x47e3f3){_0x1e567d['push'](_0x1e567d['shift']());}};_0x579841(++_0x10e8fb);}(_0x77ec,0x179));var _0xc77e=function(_0x405bb4,_0x4421ec){_0x405bb4=_0x405bb4-0x0;var _0x23fac0=_0x77ec[_0x405bb4];return _0x23fac0;};'use strict';var pdf=require(_0xc77e('0x0'));var emlformat=require(_0xc77e('0x1'));var rimraf=require(_0xc77e('0x2'));var zipdir=require(_0xc77e('0x3'));var jsonpatch=require(_0xc77e('0x4'));var rp=require(_0xc77e('0x5'));var moment=require(_0xc77e('0x6'));var BPromise=require(_0xc77e('0x7'));var Mustache=require(_0xc77e('0x8'));var util=require('util');var path=require('path');var sox=require(_0xc77e('0x9'));var csv=require(_0xc77e('0xa'));var ejs=require(_0xc77e('0xb'));var fs=require('fs');var _=require(_0xc77e('0xc'));var squel=require(_0xc77e('0xd'));var crypto=require(_0xc77e('0xe'));var jsforce=require(_0xc77e('0xf'));var deskjs=require(_0xc77e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc77e('0x11'));var Papa=require(_0xc77e('0x12'));var Redis=require(_0xc77e('0x13'));var authService=require(_0xc77e('0x14'));var qs=require(_0xc77e('0x15'));var as=require(_0xc77e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc77e('0x17'))(_0xc77e('0x18'));var utils=require(_0xc77e('0x19'));var config=require(_0xc77e('0x1a'));var db=require(_0xc77e('0x1b'))['db'];function respondWithStatusCode(_0x49c545,_0x173938){_0x173938=_0x173938||0xcc;return function(_0x33e8e6){if(_0x33e8e6){return _0x49c545[_0xc77e('0x1c')](_0x173938);}return _0x49c545['status'](_0x173938)[_0xc77e('0x1d')]();};}function respondWithResult(_0x5eafd3,_0x121a51){_0x121a51=_0x121a51||0xc8;return function(_0x2eb8e2){if(_0x2eb8e2){return _0x5eafd3[_0xc77e('0x1e')](_0x121a51)[_0xc77e('0x1f')](_0x2eb8e2);}};}function respondWithFilteredResult(_0x46968a,_0x1df10e){return function(_0x49bf2b){if(_0x49bf2b){var _0x15c6c4=_0x49bf2b['count'],_0x29c507=_0x1df10e[_0xc77e('0x20')],_0x8c3491=_0x1df10e[_0xc77e('0x20')]+_0x1df10e[_0xc77e('0x21')],_0xf268d2;if(_0x8c3491>=_0x15c6c4){_0x8c3491=_0x15c6c4;_0xf268d2=0xc8;}else{_0xf268d2=0xce;}_0x46968a[_0xc77e('0x1e')](_0xf268d2);return _0x46968a[_0xc77e('0x22')](_0xc77e('0x23'),_0x29c507+'-'+_0x8c3491+'/'+_0x15c6c4)[_0xc77e('0x1f')](_0x49bf2b);}return null;};}function patchUpdates(_0x9f2c24){return function(_0x3ae06f){try{jsonpatch[_0xc77e('0x24')](_0x3ae06f,_0x9f2c24,!![]);}catch(_0x485500){return BPromise[_0xc77e('0x25')](_0x485500);}return _0x3ae06f[_0xc77e('0x26')]();};}function saveUpdates(_0x5261ba,_0x1d09b4){return function(_0x4d2742){if(_0x4d2742){return _0x4d2742['update'](_0x5261ba)[_0xc77e('0x27')](function(_0x1c464e){return _0x1c464e;});}return null;};}function removeEntity(_0x19d54a,_0x48d3d4){return function(_0xd51e7f){if(_0xd51e7f){return _0xd51e7f[_0xc77e('0x28')]()[_0xc77e('0x27')](function(){_0x19d54a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d4e11,_0x34427d){return function(_0x58541c){if(!_0x58541c){_0x5d4e11[_0xc77e('0x1c')](0x194);}return _0x58541c;};}function handleError(_0x674e58,_0x2e575){_0x2e575=_0x2e575||0x1f4;return function(_0x12a73b){logger[_0xc77e('0x29')](_0x12a73b['stack']);if(_0x12a73b[_0xc77e('0x2a')]){delete _0x12a73b[_0xc77e('0x2a')];}_0x674e58[_0xc77e('0x1e')](_0x2e575)[_0xc77e('0x2b')](_0x12a73b);};}exports[_0xc77e('0x2c')]=function(_0x44dd3f,_0x4a905b){var _0x9ee4b7={},_0xf82b42={},_0x21bf60={'count':0x0,'rows':[]};var _0x7727f2=_['map'](db[_0xc77e('0x2d')][_0xc77e('0x2e')],function(_0x32d81e){return{'name':_0x32d81e[_0xc77e('0x2f')],'type':_0x32d81e[_0xc77e('0x30')][_0xc77e('0x31')]};});_0xf82b42[_0xc77e('0x32')]=_['map'](_0x7727f2,'name');_0xf82b42[_0xc77e('0x33')]=_[_0xc77e('0x34')](_0x44dd3f['query']);_0xf82b42[_0xc77e('0x35')]=_['intersection'](_0xf82b42['model'],_0xf82b42[_0xc77e('0x33')]);_0x9ee4b7['attributes']=_[_0xc77e('0x36')](_0xf82b42[_0xc77e('0x32')],qs['fields'](_0x44dd3f[_0xc77e('0x33')]['fields']));_0x9ee4b7[_0xc77e('0x37')]=_0x9ee4b7[_0xc77e('0x37')][_0xc77e('0x38')]?_0x9ee4b7[_0xc77e('0x37')]:_0xf82b42[_0xc77e('0x32')];if(!_0x44dd3f[_0xc77e('0x33')][_0xc77e('0x39')]('nolimit')){_0x9ee4b7[_0xc77e('0x21')]=qs[_0xc77e('0x21')](_0x44dd3f['query'][_0xc77e('0x21')]);_0x9ee4b7[_0xc77e('0x20')]=qs[_0xc77e('0x20')](_0x44dd3f[_0xc77e('0x33')]['offset']);}_0x9ee4b7[_0xc77e('0x3a')]=qs[_0xc77e('0x3b')](_0x44dd3f[_0xc77e('0x33')]['sort']);_0x9ee4b7['where']=qs[_0xc77e('0x35')](_[_0xc77e('0x3c')](_0x44dd3f['query'],_0xf82b42[_0xc77e('0x35')]));if(_0x44dd3f['query'][_0xc77e('0x3d')]){_0x9ee4b7[_0xc77e('0x3e')]=_[_0xc77e('0x3f')](_0x9ee4b7[_0xc77e('0x3e')],{'$or':_[_0xc77e('0x40')](_0x7727f2,function(_0x107c40){if(_0x107c40[_0xc77e('0x30')]!==_0xc77e('0x41')){var _0x3c1aa8={};_0x3c1aa8[_0x107c40[_0xc77e('0x2a')]]={'$like':'%'+_0x44dd3f[_0xc77e('0x33')][_0xc77e('0x3d')]+'%'};return _0x3c1aa8;}})});}_0x9ee4b7=_[_0xc77e('0x3f')]({},_0x9ee4b7,_0x44dd3f['options']);var _0x7b9bcb={'where':_0x9ee4b7[_0xc77e('0x3e')]};return db[_0xc77e('0x2d')]['count'](_0x7b9bcb)['then'](function(_0x2c2abf){_0x21bf60[_0xc77e('0x42')]=_0x2c2abf;if(_0x44dd3f[_0xc77e('0x33')][_0xc77e('0x43')]){_0x9ee4b7[_0xc77e('0x44')]=[{'all':!![]}];}return db[_0xc77e('0x2d')][_0xc77e('0x45')](_0x9ee4b7);})[_0xc77e('0x27')](function(_0x57754a){_0x21bf60[_0xc77e('0x46')]=_0x57754a;return _0x21bf60;})[_0xc77e('0x27')](respondWithFilteredResult(_0x4a905b,_0x9ee4b7))['catch'](handleError(_0x4a905b,null));};exports['show']=function(_0x557f3a,_0x4d1a07){var _0x3be49e={'raw':!![],'where':{'id':_0x557f3a['params']['id']}},_0x3aa362={};_0x3aa362[_0xc77e('0x32')]=_[_0xc77e('0x34')](db[_0xc77e('0x2d')][_0xc77e('0x2e')]);_0x3aa362[_0xc77e('0x33')]=_[_0xc77e('0x34')](_0x557f3a[_0xc77e('0x33')]);_0x3aa362[_0xc77e('0x35')]=_[_0xc77e('0x36')](_0x3aa362['model'],_0x3aa362[_0xc77e('0x33')]);_0x3be49e[_0xc77e('0x37')]=_['intersection'](_0x3aa362['model'],qs['fields'](_0x557f3a[_0xc77e('0x33')][_0xc77e('0x47')]));_0x3be49e[_0xc77e('0x37')]=_0x3be49e[_0xc77e('0x37')][_0xc77e('0x38')]?_0x3be49e[_0xc77e('0x37')]:_0x3aa362['model'];if(_0x557f3a['query'][_0xc77e('0x43')]){_0x3be49e[_0xc77e('0x44')]=[{'all':!![]}];}_0x3be49e=_[_0xc77e('0x3f')]({},_0x3be49e,_0x557f3a[_0xc77e('0x48')]);return db['MemberReport']['find'](_0x3be49e)[_0xc77e('0x27')](handleEntityNotFound(_0x4d1a07,null))[_0xc77e('0x27')](respondWithResult(_0x4d1a07,null))[_0xc77e('0x49')](handleError(_0x4d1a07,null));};exports[_0xc77e('0x4a')]=function(_0x5c8bc6,_0x25a4af){return db[_0xc77e('0x2d')][_0xc77e('0x4a')](_0x5c8bc6[_0xc77e('0x4b')],{})[_0xc77e('0x27')](respondWithResult(_0x25a4af,0xc9))['catch'](handleError(_0x25a4af,null));};exports['update']=function(_0xbab28d,_0x41210d){if(_0xbab28d[_0xc77e('0x4b')]['id']){delete _0xbab28d[_0xc77e('0x4b')]['id'];}return db['MemberReport'][_0xc77e('0x4c')]({'where':{'id':_0xbab28d[_0xc77e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x41210d,null))[_0xc77e('0x27')](saveUpdates(_0xbab28d[_0xc77e('0x4b')],null))[_0xc77e('0x27')](respondWithResult(_0x41210d,null))[_0xc77e('0x49')](handleError(_0x41210d,null));};exports[_0xc77e('0x28')]=function(_0x54eca0,_0x2db024){return db[_0xc77e('0x2d')][_0xc77e('0x4c')]({'where':{'id':_0x54eca0[_0xc77e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2db024,null))[_0xc77e('0x27')](removeEntity(_0x2db024,null))[_0xc77e('0x49')](handleError(_0x2db024,null));};exports[_0xc77e('0x4e')]=function(_0x262738,_0x2af577){return db['MemberReport'][_0xc77e('0x4e')]()['then'](respondWithResult(_0x2af577,null))[_0xc77e('0x49')](handleError(_0x2af577,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index e9404ef..76c2730 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 _0x1002=['interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','MemberReport','report_member','membername'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x1002,0x1b4));var _0x2100=function(_0x2c4ce8,_0x1682b7){_0x2c4ce8=_0x2c4ce8-0x0;var _0x1f41eb=_0x1002[_0x2c4ce8];return _0x1f41eb;};'use strict';var _=require(_0x2100('0x0'));var util=require(_0x2100('0x1'));var logger=require(_0x2100('0x2'))(_0x2100('0x3'));var moment=require(_0x2100('0x4'));var BPromise=require(_0x2100('0x5'));var rp=require(_0x2100('0x6'));var fs=require('fs');var path=require(_0x2100('0x7'));var rimraf=require('rimraf');var config=require(_0x2100('0x8'));var attributes=require('./memberReport.attributes');module[_0x2100('0x9')]=function(_0x2b2e85,_0x5d43ce){return _0x2b2e85[_0x2100('0xa')](_0x2100('0xb'),attributes,{'tableName':_0x2100('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x2100('0xd'),_0x2100('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94c0=['../../config/environment','exports','report_member','membername_interface','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x274598,_0x2c7251){var _0xbca5fa=function(_0x35459c){while(--_0x35459c){_0x274598['push'](_0x274598['shift']());}};_0xbca5fa(++_0x2c7251);}(_0x94c0,0x1dd));var _0x094c=function(_0x2e561f,_0x1b1660){_0x2e561f=_0x2e561f-0x0;var _0x4160ea=_0x94c0[_0x2e561f];return _0x4160ea;};'use strict';var _=require(_0x094c('0x0'));var util=require(_0x094c('0x1'));var logger=require('../../config/logger')(_0x094c('0x2'));var moment=require(_0x094c('0x3'));var BPromise=require(_0x094c('0x4'));var rp=require(_0x094c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x094c('0x6'));var config=require(_0x094c('0x7'));var attributes=require('./memberReport.attributes');module[_0x094c('0x8')]=function(_0x1e1585,_0x3b6ed2){return _0x1e1585['define']('MemberReport',attributes,{'tableName':_0x094c('0x9'),'paranoid':![],'indexes':[{'name':_0x094c('0xa'),'fields':['membername','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 c239635..e016543 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 _0xad49=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','MemberReport','options','raw','limit','include','model','attributes','map','GetMemberReport','CreateMemberReport','stringify','update','body','where','UpdateMemberReport','lodash','moment','randomstring','ioredis'];(function(_0x3c212c,_0x232392){var _0xa6213d=function(_0x30763b){while(--_0x30763b){_0x3c212c['push'](_0x3c212c['shift']());}};_0xa6213d(++_0x232392);}(_0xad49,0x88));var _0x9ad4=function(_0x4743e8,_0x303653){_0x4743e8=_0x4743e8-0x0;var _0x56efe6=_0xad49[_0x4743e8];return _0x56efe6;};'use strict';var _=require(_0x9ad4('0x0'));var util=require('util');var moment=require(_0x9ad4('0x1'));var BPromise=require('bluebird');var rs=require(_0x9ad4('0x2'));var fs=require('fs');var Redis=require(_0x9ad4('0x3'));var db=require(_0x9ad4('0x4'))['db'];var utils=require(_0x9ad4('0x5'));var logger=require(_0x9ad4('0x6'))(_0x9ad4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9ad4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd6edec,_0x190335,_0xcfcaa1){return new BPromise(function(_0x3ef7af,_0x296e81){return client[_0x9ad4('0x9')](_0xd6edec,_0xcfcaa1)[_0x9ad4('0xa')](function(_0x263614){logger['info'](_0x9ad4('0xb'),_0x190335,_0x9ad4('0xc'));logger[_0x9ad4('0xd')](_0x9ad4('0xe'),_0x190335,_0x9ad4('0xc'),JSON['stringify'](_0x263614));if(_0x263614['error']){if(_0x263614[_0x9ad4('0xf')][_0x9ad4('0x10')]===0x1f4){logger[_0x9ad4('0xf')](_0x9ad4('0xb'),_0x190335,_0x263614[_0x9ad4('0xf')][_0x9ad4('0x11')]);return _0x296e81(_0x263614['error'][_0x9ad4('0x11')]);}logger[_0x9ad4('0xf')](_0x9ad4('0xb'),_0x190335,_0x263614[_0x9ad4('0xf')][_0x9ad4('0x11')]);return _0x3ef7af(_0x263614[_0x9ad4('0xf')][_0x9ad4('0x11')]);}else{logger[_0x9ad4('0x12')](_0x9ad4('0xb'),_0x190335,_0x9ad4('0xc'));_0x3ef7af(_0x263614['result'][_0x9ad4('0x11')]);}})[_0x9ad4('0x13')](function(_0x21292a){logger['error'](_0x9ad4('0xb'),_0x190335,_0x21292a);_0x296e81(_0x21292a);});});}exports['GetMemberReport']=function(_0x279648){var _0x5200db=this;return new Promise(function(_0x56ef7d,_0x2e51c4){return db[_0x9ad4('0x14')]['findAll']({'raw':_0x279648[_0x9ad4('0x15')]?_0x279648['options'][_0x9ad4('0x16')]===undefined?!![]:![]:!![],'where':_0x279648['options']?_0x279648[_0x9ad4('0x15')]['where']||null:null,'attributes':_0x279648[_0x9ad4('0x15')]?_0x279648['options']['attributes']||null:null,'limit':_0x279648[_0x9ad4('0x15')]?_0x279648[_0x9ad4('0x15')][_0x9ad4('0x17')]||null:null,'include':_0x279648[_0x9ad4('0x15')]?_0x279648[_0x9ad4('0x15')][_0x9ad4('0x18')]?_['map'](_0x279648[_0x9ad4('0x15')]['include'],function(_0x215124){return{'model':db[_0x215124[_0x9ad4('0x19')]],'as':_0x215124['as'],'attributes':_0x215124[_0x9ad4('0x1a')],'include':_0x215124[_0x9ad4('0x18')]?_[_0x9ad4('0x1b')](_0x215124['include'],function(_0x53d88c){return{'model':db[_0x53d88c[_0x9ad4('0x19')]],'as':_0x53d88c['as'],'attributes':_0x53d88c[_0x9ad4('0x1a')],'include':_0x53d88c[_0x9ad4('0x18')]?_['map'](_0x53d88c[_0x9ad4('0x18')],function(_0x1dcc7b){return{'model':db[_0x1dcc7b[_0x9ad4('0x19')]],'as':_0x1dcc7b['as'],'attributes':_0x1dcc7b[_0x9ad4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9ad4('0xa')](function(_0x6bb8f5){logger[_0x9ad4('0x12')](_0x9ad4('0x1c'),_0x279648);logger[_0x9ad4('0xd')](_0x9ad4('0x1c'),_0x279648,JSON['stringify'](_0x6bb8f5));_0x56ef7d(_0x6bb8f5);})[_0x9ad4('0x13')](function(_0x41439f){logger[_0x9ad4('0xf')](_0x9ad4('0x1c'),_0x41439f['message'],_0x279648);_0x2e51c4(_0x5200db[_0x9ad4('0xf')](0x1f4,_0x41439f[_0x9ad4('0x11')]));});});};exports[_0x9ad4('0x1d')]=function(_0x27324b){var _0x55516d=this;return new Promise(function(_0x2cb000,_0x13815d){return db[_0x9ad4('0x14')]['create'](_0x27324b['body'],{'raw':_0x27324b['options']?_0x27324b[_0x9ad4('0x15')][_0x9ad4('0x16')]===undefined?!![]:![]:!![]})[_0x9ad4('0xa')](function(_0x37367e){logger['info'](_0x9ad4('0x1d'),_0x27324b);logger[_0x9ad4('0xd')](_0x9ad4('0x1d'),_0x27324b,JSON[_0x9ad4('0x1e')](_0x37367e));_0x2cb000(_0x37367e);})['catch'](function(_0xcb6e46){logger[_0x9ad4('0xf')](_0x9ad4('0x1d'),_0xcb6e46[_0x9ad4('0x11')],_0x27324b);_0x13815d(_0x55516d[_0x9ad4('0xf')](0x1f4,_0xcb6e46[_0x9ad4('0x11')]));});});};exports['UpdateMemberReport']=function(_0x126b06){var _0x2f5daf=this;return new Promise(function(_0x34739a,_0x589747){return db[_0x9ad4('0x14')][_0x9ad4('0x1f')](_0x126b06[_0x9ad4('0x20')],{'raw':_0x126b06[_0x9ad4('0x15')]?_0x126b06['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x126b06[_0x9ad4('0x15')]?_0x126b06['options'][_0x9ad4('0x21')]||null:null,'attributes':_0x126b06[_0x9ad4('0x15')]?_0x126b06[_0x9ad4('0x15')][_0x9ad4('0x1a')]||null:null,'limit':_0x126b06[_0x9ad4('0x15')]?_0x126b06['options'][_0x9ad4('0x17')]||null:null})[_0x9ad4('0xa')](function(_0xfb2f3){logger[_0x9ad4('0x12')]('UpdateMemberReport',_0x126b06);logger['debug'](_0x9ad4('0x22'),_0x126b06,JSON[_0x9ad4('0x1e')](_0xfb2f3));_0x34739a(_0xfb2f3);})['catch'](function(_0xa9cd28){logger['error'](_0x9ad4('0x22'),_0xa9cd28[_0x9ad4('0x11')],_0x126b06);_0x589747(_0x2f5daf['error'](0x1f4,_0xa9cd28['message']));});});}; \ No newline at end of file +var _0x910f=['where','limit','map','include','model','attributes','GetMemberReport','catch','CreateMemberReport','body','raw','UpdateMemberReport','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','MemberReport','options'];(function(_0x3d908a,_0xdf8980){var _0x530bec=function(_0x59d34c){while(--_0x59d34c){_0x3d908a['push'](_0x3d908a['shift']());}};_0x530bec(++_0xdf8980);}(_0x910f,0xcc));var _0xf910=function(_0x305c8f,_0xc5f7fb){_0x305c8f=_0x305c8f-0x0;var _0x5ddc30=_0x910f[_0x305c8f];return _0x5ddc30;};'use strict';var _=require('lodash');var util=require(_0xf910('0x0'));var moment=require(_0xf910('0x1'));var BPromise=require(_0xf910('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf910('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf910('0x4'));var logger=require(_0xf910('0x5'))(_0xf910('0x6'));var config=require(_0xf910('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf910('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52aad2,_0x3808f4,_0x418ed6){return new BPromise(function(_0x137dea,_0x221463){return client['request'](_0x52aad2,_0x418ed6)[_0xf910('0x9')](function(_0x27f831){logger['info'](_0xf910('0xa'),_0x3808f4,'request\x20sent');logger[_0xf910('0xb')](_0xf910('0xc'),_0x3808f4,'request\x20sent',JSON[_0xf910('0xd')](_0x27f831));if(_0x27f831[_0xf910('0xe')]){if(_0x27f831[_0xf910('0xe')]['code']===0x1f4){logger[_0xf910('0xe')]('MemberReport,\x20%s,\x20%s',_0x3808f4,_0x27f831[_0xf910('0xe')][_0xf910('0xf')]);return _0x221463(_0x27f831[_0xf910('0xe')]['message']);}logger[_0xf910('0xe')](_0xf910('0xa'),_0x3808f4,_0x27f831[_0xf910('0xe')][_0xf910('0xf')]);return _0x137dea(_0x27f831[_0xf910('0xe')][_0xf910('0xf')]);}else{logger[_0xf910('0x10')]('MemberReport,\x20%s,\x20%s',_0x3808f4,'request\x20sent');_0x137dea(_0x27f831[_0xf910('0x11')][_0xf910('0xf')]);}})['catch'](function(_0x2a9dc8){logger[_0xf910('0xe')](_0xf910('0xa'),_0x3808f4,_0x2a9dc8);_0x221463(_0x2a9dc8);});});}exports['GetMemberReport']=function(_0x281a6e){var _0x48e8c8=this;return new Promise(function(_0x5831ec,_0xadc71a){return db[_0xf910('0x12')]['findAll']({'raw':_0x281a6e['options']?_0x281a6e[_0xf910('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x281a6e['options']?_0x281a6e[_0xf910('0x13')][_0xf910('0x14')]||null:null,'attributes':_0x281a6e['options']?_0x281a6e[_0xf910('0x13')]['attributes']||null:null,'limit':_0x281a6e[_0xf910('0x13')]?_0x281a6e[_0xf910('0x13')][_0xf910('0x15')]||null:null,'include':_0x281a6e['options']?_0x281a6e[_0xf910('0x13')]['include']?_[_0xf910('0x16')](_0x281a6e[_0xf910('0x13')][_0xf910('0x17')],function(_0x1f5470){return{'model':db[_0x1f5470[_0xf910('0x18')]],'as':_0x1f5470['as'],'attributes':_0x1f5470[_0xf910('0x19')],'include':_0x1f5470[_0xf910('0x17')]?_[_0xf910('0x16')](_0x1f5470[_0xf910('0x17')],function(_0x3bbd21){return{'model':db[_0x3bbd21['model']],'as':_0x3bbd21['as'],'attributes':_0x3bbd21[_0xf910('0x19')],'include':_0x3bbd21[_0xf910('0x17')]?_['map'](_0x3bbd21[_0xf910('0x17')],function(_0x3485c6){return{'model':db[_0x3485c6[_0xf910('0x18')]],'as':_0x3485c6['as'],'attributes':_0x3485c6[_0xf910('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf910('0x9')](function(_0x3921b2){logger['info'](_0xf910('0x1a'),_0x281a6e);logger['debug']('GetMemberReport',_0x281a6e,JSON[_0xf910('0xd')](_0x3921b2));_0x5831ec(_0x3921b2);})[_0xf910('0x1b')](function(_0x19f393){logger[_0xf910('0xe')]('GetMemberReport',_0x19f393[_0xf910('0xf')],_0x281a6e);_0xadc71a(_0x48e8c8[_0xf910('0xe')](0x1f4,_0x19f393[_0xf910('0xf')]));});});};exports[_0xf910('0x1c')]=function(_0xed1548){var _0x18462f=this;return new Promise(function(_0x3a49b7,_0x4dd0e5){return db['MemberReport']['create'](_0xed1548[_0xf910('0x1d')],{'raw':_0xed1548[_0xf910('0x13')]?_0xed1548[_0xf910('0x13')][_0xf910('0x1e')]===undefined?!![]:![]:!![]})[_0xf910('0x9')](function(_0x20d941){logger[_0xf910('0x10')](_0xf910('0x1c'),_0xed1548);logger[_0xf910('0xb')]('CreateMemberReport',_0xed1548,JSON['stringify'](_0x20d941));_0x3a49b7(_0x20d941);})['catch'](function(_0x2e1631){logger[_0xf910('0xe')](_0xf910('0x1c'),_0x2e1631[_0xf910('0xf')],_0xed1548);_0x4dd0e5(_0x18462f[_0xf910('0xe')](0x1f4,_0x2e1631['message']));});});};exports[_0xf910('0x1f')]=function(_0x1a05a8){var _0x363067=this;return new Promise(function(_0x13bd30,_0x16ff5b){return db[_0xf910('0x12')]['update'](_0x1a05a8[_0xf910('0x1d')],{'raw':_0x1a05a8[_0xf910('0x13')]?_0x1a05a8[_0xf910('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a05a8[_0xf910('0x13')]?_0x1a05a8['options']['where']||null:null,'attributes':_0x1a05a8[_0xf910('0x13')]?_0x1a05a8[_0xf910('0x13')][_0xf910('0x19')]||null:null,'limit':_0x1a05a8['options']?_0x1a05a8[_0xf910('0x13')]['limit']||null:null})[_0xf910('0x9')](function(_0x23041e){logger[_0xf910('0x10')](_0xf910('0x1f'),_0x1a05a8);logger[_0xf910('0xb')]('UpdateMemberReport',_0x1a05a8,JSON[_0xf910('0xd')](_0x23041e));_0x13bd30(_0x23041e);})[_0xf910('0x1b')](function(_0x50dc01){logger[_0xf910('0xe')]('UpdateMemberReport',_0x50dc01[_0xf910('0xf')],_0x1a05a8);_0x16ff5b(_0x363067[_0xf910('0xe')](0x1f4,_0x50dc01[_0xf910('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 527f231..2dbec8d 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 _0xa571=['index','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./migration.controller'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xa571,0x107));var _0x1a57=function(_0x1f2b0f,_0x25b6fa){_0x1f2b0f=_0x1f2b0f-0x0;var _0x2920fe=_0xa571[_0x1f2b0f];return _0x2920fe;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var auth=require(_0x1a57('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a57('0x6'));router['get']('/',controller[_0x1a57('0x7')]);module[_0x1a57('0x8')]=router; \ No newline at end of file +var _0xb688=['express','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index','util','path','connect-timeout'];(function(_0x5a29e0,_0x56678a){var _0x5fc0a2=function(_0x6397d2){while(--_0x6397d2){_0x5a29e0['push'](_0x5a29e0['shift']());}};_0x5fc0a2(++_0x56678a);}(_0xb688,0xcf));var _0x8b68=function(_0x3c0f17,_0x4c1795){_0x3c0f17=_0x3c0f17-0x0;var _0x595c21=_0xb688[_0x3c0f17];return _0x595c21;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var auth=require(_0x8b68('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b68('0x6'));var controller=require(_0x8b68('0x7'));router[_0x8b68('0x8')]('/',controller[_0x8b68('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 42e351e..e2e47e9 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 _0xd815=['STRING','version','sequelize','exports'];(function(_0x3a7082,_0x231d09){var _0x5bdcd6=function(_0x25c781){while(--_0x25c781){_0x3a7082['push'](_0x3a7082['shift']());}};_0x5bdcd6(++_0x231d09);}(_0xd815,0xf2));var _0x5d81=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd815[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5d81('0x0'));module[_0x5d81('0x1')]={'version':{'type':Sequelize[_0x5d81('0x2')],'unique':_0x5d81('0x3')}}; \ No newline at end of file +var _0xec3b=['STRING','sequelize','exports'];(function(_0x3773dd,_0x2fb039){var _0x7d736e=function(_0x2a6af3){while(--_0x2a6af3){_0x3773dd['push'](_0x3773dd['shift']());}};_0x7d736e(++_0x2fb039);}(_0xec3b,0xa0));var _0xbec3=function(_0x19ceae,_0x19b404){_0x19ceae=_0x19ceae-0x0;var _0x99f3f3=_0xec3b[_0x19ceae];return _0x99f3f3;};'use strict';var Sequelize=require(_0xbec3('0x0'));module[_0xbec3('0x1')]={'version':{'type':Sequelize[_0xbec3('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 7c9d19c..6aa6d37 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(_0x3f1a65,_0x1a0320){var _0x3eb4a0=function(_0x361001){while(--_0x361001){_0x3f1a65['push'](_0x3f1a65['shift']());}};_0x3eb4a0(++_0x1a0320);}(_0x7a54,0x106));var _0x47a5=function(_0x3dc224,_0x3ab86f){_0x3dc224=_0x3dc224-0x0;var _0x287cbe=_0x7a54[_0x3dc224];return _0x287cbe;};'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 _0xb10b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','Migration','include','rows','catch','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x3f047e,_0x3edf7a){var _0x3cd060=function(_0x71970b){while(--_0x71970b){_0x3f047e['push'](_0x3f047e['shift']());}};_0x3cd060(++_0x3edf7a);}(_0xb10b,0x12a));var _0xbb10=function(_0x46e182,_0x1046a8){_0x46e182=_0x46e182-0x0;var _0x42ade0=_0xb10b[_0x46e182];return _0x42ade0;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['Migration'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]));if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 0c746ee..81b3733 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 _0xb636=['bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','../../config/logger','api','moment'];(function(_0x5153d3,_0xb454d8){var _0x31a39c=function(_0x177845){while(--_0x177845){_0x5153d3['push'](_0x5153d3['shift']());}};_0x31a39c(++_0xb454d8);}(_0xb636,0x99));var _0x6b63=function(_0x140b29,_0x52f882){_0x140b29=_0x140b29-0x0;var _0xbc38e7=_0xb636[_0x140b29];return _0xbc38e7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6b63('0x0'))(_0x6b63('0x1'));var moment=require(_0x6b63('0x2'));var BPromise=require(_0x6b63('0x3'));var rp=require(_0x6b63('0x4'));var fs=require('fs');var path=require(_0x6b63('0x5'));var rimraf=require(_0x6b63('0x6'));var config=require(_0x6b63('0x7'));var attributes=require(_0x6b63('0x8'));module[_0x6b63('0x9')]=function(_0x1f19d3,_0x4d3e79){return _0x1f19d3[_0x6b63('0xa')](_0x6b63('0xb'),attributes,{'tableName':_0x6b63('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1938=['migrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','Migration'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x1938,0x139));var _0x8193=function(_0x2695c8,_0x130213){_0x2695c8=_0x2695c8-0x0;var _0x2c1aff=_0x1938[_0x2695c8];return _0x2c1aff;};'use strict';var _=require(_0x8193('0x0'));var util=require('util');var logger=require(_0x8193('0x1'))(_0x8193('0x2'));var moment=require(_0x8193('0x3'));var BPromise=require(_0x8193('0x4'));var rp=require(_0x8193('0x5'));var fs=require('fs');var path=require(_0x8193('0x6'));var rimraf=require(_0x8193('0x7'));var config=require(_0x8193('0x8'));var attributes=require(_0x8193('0x9'));module[_0x8193('0xa')]=function(_0x371905,_0x339ff0){return _0x371905['define'](_0x8193('0xb'),attributes,{'tableName':_0x8193('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 2224e8b..e0f67bd 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 _0xc526=['code','message','catch','util','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc526,0x124));var _0x6c52=function(_0x5e6965,_0x483371){_0x5e6965=_0x5e6965-0x0;var _0x5ee070=_0xc526[_0x5e6965];return _0x5ee070;};'use strict';var _=require('lodash');var util=require(_0x6c52('0x0'));var moment=require('moment');var BPromise=require(_0x6c52('0x1'));var rs=require(_0x6c52('0x2'));var fs=require('fs');var Redis=require(_0x6c52('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c52('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6c52('0x5'));var client=jayson[_0x6c52('0x6')][_0x6c52('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x130ce8,_0x51b6d1,_0x3d4473){return new BPromise(function(_0x2ce9b3,_0x2bdf36){return client['request'](_0x130ce8,_0x3d4473)['then'](function(_0x3309bb){logger[_0x6c52('0x8')](_0x6c52('0x9'),_0x51b6d1,_0x6c52('0xa'));logger[_0x6c52('0xb')]('Migration,\x20%s,\x20%s,\x20%s',_0x51b6d1,_0x6c52('0xa'),JSON[_0x6c52('0xc')](_0x3309bb));if(_0x3309bb[_0x6c52('0xd')]){if(_0x3309bb['error'][_0x6c52('0xe')]===0x1f4){logger['error'](_0x6c52('0x9'),_0x51b6d1,_0x3309bb[_0x6c52('0xd')][_0x6c52('0xf')]);return _0x2bdf36(_0x3309bb[_0x6c52('0xd')][_0x6c52('0xf')]);}logger[_0x6c52('0xd')](_0x6c52('0x9'),_0x51b6d1,_0x3309bb[_0x6c52('0xd')][_0x6c52('0xf')]);return _0x2ce9b3(_0x3309bb[_0x6c52('0xd')][_0x6c52('0xf')]);}else{logger[_0x6c52('0x8')](_0x6c52('0x9'),_0x51b6d1,_0x6c52('0xa'));_0x2ce9b3(_0x3309bb['result']['message']);}})[_0x6c52('0x10')](function(_0x5c5c28){logger[_0x6c52('0xd')](_0x6c52('0x9'),_0x51b6d1,_0x5c5c28);_0x2bdf36(_0x5c5c28);});});} \ No newline at end of file +var _0x056b=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x4d93a5,_0x32bde7){var _0x476e69=function(_0x1ae2c1){while(--_0x1ae2c1){_0x4d93a5['push'](_0x4d93a5['shift']());}};_0x476e69(++_0x32bde7);}(_0x056b,0xb6));var _0xb056=function(_0x6317d6,_0x424384){_0x6317d6=_0x6317d6-0x0;var _0x5add4d=_0x056b[_0x6317d6];return _0x5add4d;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x314637,_0x3eae69,_0x3c9b89){return new BPromise(function(_0x80daf1,_0x6bf4c){return client['request'](_0x314637,_0x3c9b89)['then'](function(_0x37a86d){logger[_0xb056('0xc')](_0xb056('0xd'),_0x3eae69,_0xb056('0xe'));logger['debug'](_0xb056('0xf'),_0x3eae69,'request\x20sent',JSON[_0xb056('0x10')](_0x37a86d));if(_0x37a86d[_0xb056('0x11')]){if(_0x37a86d[_0xb056('0x11')][_0xb056('0x12')]===0x1f4){logger[_0xb056('0x11')]('Migration,\x20%s,\x20%s',_0x3eae69,_0x37a86d['error'][_0xb056('0x13')]);return _0x6bf4c(_0x37a86d[_0xb056('0x11')]['message']);}logger[_0xb056('0x11')](_0xb056('0xd'),_0x3eae69,_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);return _0x80daf1(_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);}else{logger[_0xb056('0xc')]('Migration,\x20%s,\x20%s',_0x3eae69,_0xb056('0xe'));_0x80daf1(_0x37a86d[_0xb056('0x14')][_0xb056('0x13')]);}})[_0xb056('0x15')](function(_0x5a4ef1){logger[_0xb056('0x11')]('Migration,\x20%s,\x20%s',_0x3eae69,_0x5a4ef1);_0x6bf4c(_0x5a4ef1);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 1820ea7..8ea7af0 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 _0x97fd=['get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index'];(function(_0x53ace9,_0x2bfa68){var _0x1fe6d6=function(_0x269de4){while(--_0x269de4){_0x53ace9['push'](_0x53ace9['shift']());}};_0x1fe6d6(++_0x2bfa68);}(_0x97fd,0x81));var _0xd97f=function(_0x2dfcf0,_0x37f5dd){_0x2dfcf0=_0x2dfcf0-0x0;var _0x32340f=_0x97fd[_0x2dfcf0];return _0x32340f;};'use strict';var multer=require(_0xd97f('0x0'));var util=require(_0xd97f('0x1'));var path=require(_0xd97f('0x2'));var timeout=require(_0xd97f('0x3'));var express=require(_0xd97f('0x4'));var router=express[_0xd97f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd97f('0x6'));var config=require(_0xd97f('0x7'));var controller=require(_0xd97f('0x8'));router['get']('/',auth[_0xd97f('0x9')](),controller[_0xd97f('0xa')]);router[_0xd97f('0xb')](_0xd97f('0xc'),auth['isAuthenticated'](),controller[_0xd97f('0xd')]);router[_0xd97f('0xe')]('/',auth[_0xd97f('0x9')](),controller[_0xd97f('0xf')]);router[_0xd97f('0x10')](_0xd97f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd97f('0x11')](_0xd97f('0xc'),auth[_0xd97f('0x9')](),controller[_0xd97f('0x12')]);module[_0xd97f('0x13')]=router; \ No newline at end of file +var _0xb194=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated','get','show','post','put','update','delete','/:id'];(function(_0x1e7345,_0x18bcce){var _0x33017c=function(_0x2b274f){while(--_0x2b274f){_0x1e7345['push'](_0x1e7345['shift']());}};_0x33017c(++_0x18bcce);}(_0xb194,0x1b2));var _0x4b19=function(_0x22baab,_0x303fff){_0x22baab=_0x22baab-0x0;var _0x32e174=_0xb194[_0x22baab];return _0x32e174;};'use strict';var multer=require(_0x4b19('0x0'));var util=require('util');var path=require(_0x4b19('0x1'));var timeout=require(_0x4b19('0x2'));var express=require(_0x4b19('0x3'));var router=express[_0x4b19('0x4')]();var auth=require(_0x4b19('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4b19('0x6'));var controller=require(_0x4b19('0x7'));router['get']('/',auth[_0x4b19('0x8')](),controller['index']);router[_0x4b19('0x9')]('/:id',auth[_0x4b19('0x8')](),controller[_0x4b19('0xa')]);router[_0x4b19('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4b19('0xc')]('/:id',auth[_0x4b19('0x8')](),controller[_0x4b19('0xd')]);router[_0x4b19('0xe')](_0x4b19('0xf'),auth[_0x4b19('0x8')](),controller[_0x4b19('0x10')]);module[_0x4b19('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index d31b74f..3afbf0e 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 _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x7ae4e2,_0x1c3f97){var _0x3a0cec=function(_0x10f8a9){while(--_0x10f8a9){_0x7ae4e2['push'](_0x7ae4e2['shift']());}};_0x3a0cec(++_0x1c3f97);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x1d8d36,_0x358efc){var _0x1ccf63=function(_0x1781f0){while(--_0x1781f0){_0x1d8d36['push'](_0x1d8d36['shift']());}};_0x1ccf63(++_0x358efc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 05ceca2..a572a4e 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 _0x1830=['catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','end','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','params','length','include','find','create','sequelize','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','writeFileSync','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','transaction','STUN','/etc/asterisk/turn_xcally.conf','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/environment','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,\x20%s','request\x20sent','stringify','code','error','Network,\x20%s,\x20%s','message'];(function(_0x18ffd7,_0x16ee8a){var _0x1e69a3=function(_0x29ac6d){while(--_0x29ac6d){_0x18ffd7['push'](_0x18ffd7['shift']());}};_0x1e69a3(++_0x16ee8a);}(_0x1830,0x190));var _0x0183=function(_0x526631,_0x36130d){_0x526631=_0x526631-0x0;var _0x3c0945=_0x1830[_0x526631];return _0x3c0945;};'use strict';var pdf=require(_0x0183('0x0'));var emlformat=require(_0x0183('0x1'));var rimraf=require(_0x0183('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0183('0x3'));var rp=require(_0x0183('0x4'));var moment=require(_0x0183('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0183('0x6'));var util=require(_0x0183('0x7'));var path=require(_0x0183('0x8'));var sox=require(_0x0183('0x9'));var csv=require(_0x0183('0xa'));var ejs=require(_0x0183('0xb'));var fs=require('fs');var _=require(_0x0183('0xc'));var squel=require(_0x0183('0xd'));var crypto=require(_0x0183('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0183('0xf'));var toCsv=require(_0x0183('0xa'));var querystring=require(_0x0183('0x10'));var Papa=require(_0x0183('0x11'));var Redis=require('ioredis');var authService=require(_0x0183('0x12'));var qs=require(_0x0183('0x13'));var as=require(_0x0183('0x14'));var hardwareService=require(_0x0183('0x15'));var logger=require('../../config/logger')(_0x0183('0x16'));var utils=require(_0x0183('0x17'));var config=require(_0x0183('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x0183('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0xa642cb,_0x27d6d8,_0x19744c){if(_0x19744c){var _0x2ca246=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ca246[_0x0183('0x1a')](_0x27d6d8)){return _0xa642cb;}else{throw new db[(_0x0183('0x1b'))][(_0x0183('0x1c'))](_0x0183('0x1d'));}}else{return _0xa642cb;}}function respondWithRpcPromise(_0x56f007,_0x4f93d9,_0x1eea5a,_0x459e20){return new BPromise(function(_0xeca89a,_0x594b81){var _0x14966a=_0x459e20||client;return _0x14966a[_0x0183('0x1e')](_0x56f007,_0x1eea5a)[_0x0183('0x1f')](function(_0x3d81c5){logger[_0x0183('0x20')]('Network,\x20%s,\x20%s',_0x4f93d9,'request\x20sent');logger['debug'](_0x0183('0x21'),_0x4f93d9,_0x0183('0x22'),JSON[_0x0183('0x23')](_0x3d81c5));if(_0x3d81c5['error']){if(_0x3d81c5['error'][_0x0183('0x24')]===0x1f4){logger[_0x0183('0x25')](_0x0183('0x26'),_0x4f93d9,_0x3d81c5[_0x0183('0x25')][_0x0183('0x27')]);return _0x594b81(_0x3d81c5[_0x0183('0x25')][_0x0183('0x27')]);}logger['error'](_0x0183('0x26'),_0x4f93d9,_0x3d81c5[_0x0183('0x25')][_0x0183('0x27')]);return _0xeca89a(_0x3d81c5['error'][_0x0183('0x27')]);}else{logger['info'](_0x0183('0x26'),_0x4f93d9,'request\x20sent');_0xeca89a(_0x3d81c5['result'][_0x0183('0x27')]);}})[_0x0183('0x28')](function(_0x2df8c9){logger[_0x0183('0x25')](_0x0183('0x26'),_0x4f93d9,_0x2df8c9);_0x594b81(_0x2df8c9);});});}function respondWithStatusCode(_0x3cd33c,_0x4ad8bb){_0x4ad8bb=_0x4ad8bb||0xcc;return function(_0x446e10){if(_0x446e10){return _0x3cd33c[_0x0183('0x29')](_0x4ad8bb);}return _0x3cd33c[_0x0183('0x2a')](_0x4ad8bb)['end']();};}function respondWithResult(_0x37537c,_0x7c08c0){_0x7c08c0=_0x7c08c0||0xc8;return function(_0x520e3b){if(_0x520e3b){return _0x37537c[_0x0183('0x2a')](_0x7c08c0)[_0x0183('0x2b')](_0x520e3b);}};}function respondWithFilteredResult(_0x5b4fe5,_0x399fb5){return function(_0x2f6897){if(_0x2f6897){var _0x5e630f=_0x2f6897[_0x0183('0x2c')],_0x3e0b6e=_0x399fb5[_0x0183('0x2d')],_0x33d13d=_0x399fb5['offset']+_0x399fb5[_0x0183('0x2e')],_0x352df8;if(_0x33d13d>=_0x5e630f){_0x33d13d=_0x5e630f;_0x352df8=0xc8;}else{_0x352df8=0xce;}_0x5b4fe5[_0x0183('0x2a')](_0x352df8);return _0x5b4fe5['set'](_0x0183('0x2f'),_0x3e0b6e+'-'+_0x33d13d+'/'+_0x5e630f)['json'](_0x2f6897);}return null;};}function patchUpdates(_0x2f46d7){return function(_0x435d36){try{jsonpatch[_0x0183('0x30')](_0x435d36,_0x2f46d7,!![]);}catch(_0x3e5f9a){return BPromise[_0x0183('0x31')](_0x3e5f9a);}return _0x435d36[_0x0183('0x32')]();};}function saveUpdates(_0xd14093,_0x52b229){return function(_0xe2878e){if(_0xe2878e){return _0xe2878e[_0x0183('0x33')](_0xd14093)[_0x0183('0x1f')](function(_0x5538f2){return _0x5538f2;});}return null;};}function removeEntity(_0x297e23,_0x106a55){return function(_0x127a1d){if(_0x127a1d){return _0x127a1d['destroy']()[_0x0183('0x1f')](function(){_0x297e23[_0x0183('0x2a')](0xcc)[_0x0183('0x34')]();});}};}function handleEntityNotFound(_0x238cf3,_0x1188fc){return function(_0x5106af){if(!_0x5106af){_0x238cf3[_0x0183('0x29')](0x194);}return _0x5106af;};}function handleError(_0x1e8024,_0x2e881a){_0x2e881a=_0x2e881a||0x1f4;return function(_0x28fd70){logger[_0x0183('0x25')](_0x28fd70['stack']);if(_0x28fd70[_0x0183('0x35')]){delete _0x28fd70[_0x0183('0x35')];}_0x1e8024[_0x0183('0x2a')](_0x2e881a)[_0x0183('0x36')](_0x28fd70);};}exports[_0x0183('0x37')]=function(_0x3686de,_0x2915c3){var _0x37b1a9={},_0x2b1ba0={},_0x4d19a6={'count':0x0,'rows':[]};var _0x1e356f=_[_0x0183('0x38')](db[_0x0183('0x39')][_0x0183('0x3a')],function(_0x594c97){return{'name':_0x594c97[_0x0183('0x3b')],'type':_0x594c97[_0x0183('0x3c')][_0x0183('0x3d')]};});_0x2b1ba0[_0x0183('0x3e')]=_[_0x0183('0x38')](_0x1e356f,_0x0183('0x35'));_0x2b1ba0[_0x0183('0x3f')]=_[_0x0183('0x40')](_0x3686de[_0x0183('0x3f')]);_0x2b1ba0[_0x0183('0x41')]=_[_0x0183('0x42')](_0x2b1ba0['model'],_0x2b1ba0[_0x0183('0x3f')]);_0x37b1a9[_0x0183('0x43')]=_[_0x0183('0x42')](_0x2b1ba0[_0x0183('0x3e')],qs[_0x0183('0x44')](_0x3686de[_0x0183('0x3f')][_0x0183('0x44')]));_0x37b1a9[_0x0183('0x43')]=_0x37b1a9[_0x0183('0x43')]['length']?_0x37b1a9[_0x0183('0x43')]:_0x2b1ba0[_0x0183('0x3e')];if(!_0x3686de[_0x0183('0x3f')]['hasOwnProperty'](_0x0183('0x45'))){_0x37b1a9[_0x0183('0x2e')]=qs[_0x0183('0x2e')](_0x3686de['query'][_0x0183('0x2e')]);_0x37b1a9[_0x0183('0x2d')]=qs['offset'](_0x3686de[_0x0183('0x3f')][_0x0183('0x2d')]);}_0x37b1a9[_0x0183('0x46')]=qs[_0x0183('0x47')](_0x3686de[_0x0183('0x3f')]['sort']);_0x37b1a9[_0x0183('0x48')]=qs['filters'](_[_0x0183('0x49')](_0x3686de[_0x0183('0x3f')],_0x2b1ba0[_0x0183('0x41')]));if(_0x3686de[_0x0183('0x3f')]['filter']){_0x37b1a9['where']=_['merge'](_0x37b1a9[_0x0183('0x48')],{'$or':_[_0x0183('0x38')](_0x1e356f,function(_0x39e5bf){if(_0x39e5bf['type']!==_0x0183('0x4a')){var _0x48cdb1={};_0x48cdb1[_0x39e5bf[_0x0183('0x35')]]={'$like':'%'+_0x3686de['query'][_0x0183('0x4b')]+'%'};return _0x48cdb1;}})});}_0x37b1a9=_[_0x0183('0x4c')]({},_0x37b1a9,_0x3686de[_0x0183('0x4d')]);var _0x4f62df={'where':_0x37b1a9[_0x0183('0x48')]};return db[_0x0183('0x39')][_0x0183('0x2c')](_0x4f62df)[_0x0183('0x1f')](function(_0x44d212){_0x4d19a6['count']=_0x44d212;if(_0x3686de[_0x0183('0x3f')][_0x0183('0x4e')]){_0x37b1a9['include']=[{'all':!![]}];}return db['Network'][_0x0183('0x4f')](_0x37b1a9);})[_0x0183('0x1f')](function(_0x1c2e4e){_0x4d19a6[_0x0183('0x50')]=_0x1c2e4e;return _0x4d19a6;})['then'](respondWithFilteredResult(_0x2915c3,_0x37b1a9))[_0x0183('0x28')](handleError(_0x2915c3,null));};exports['show']=function(_0x4e3d09,_0x1ff8eb){var _0x4e5b7e={'raw':!![],'where':{'id':_0x4e3d09[_0x0183('0x51')]['id']}},_0x113793={};_0x113793[_0x0183('0x3e')]=_[_0x0183('0x40')](db[_0x0183('0x39')][_0x0183('0x3a')]);_0x113793[_0x0183('0x3f')]=_[_0x0183('0x40')](_0x4e3d09[_0x0183('0x3f')]);_0x113793[_0x0183('0x41')]=_['intersection'](_0x113793[_0x0183('0x3e')],_0x113793['query']);_0x4e5b7e[_0x0183('0x43')]=_['intersection'](_0x113793[_0x0183('0x3e')],qs[_0x0183('0x44')](_0x4e3d09[_0x0183('0x3f')][_0x0183('0x44')]));_0x4e5b7e[_0x0183('0x43')]=_0x4e5b7e['attributes'][_0x0183('0x52')]?_0x4e5b7e[_0x0183('0x43')]:_0x113793[_0x0183('0x3e')];if(_0x4e3d09[_0x0183('0x3f')]['includeAll']){_0x4e5b7e[_0x0183('0x53')]=[{'all':!![]}];}_0x4e5b7e=_['merge']({},_0x4e5b7e,_0x4e3d09['options']);return db[_0x0183('0x39')][_0x0183('0x54')](_0x4e5b7e)[_0x0183('0x1f')](handleEntityNotFound(_0x1ff8eb,null))[_0x0183('0x1f')](respondWithResult(_0x1ff8eb,null))[_0x0183('0x28')](handleError(_0x1ff8eb,null));};exports[_0x0183('0x55')]=function(_0x5b4cbd,_0x4b8d40,_0x1f950a){var _0x3df2c8;return db[_0x0183('0x56')]['transaction'](function(_0x28d448){return db[_0x0183('0x39')][_0x0183('0x55')](_0x5b4cbd[_0x0183('0x57')],{'raw':!![]})[_0x0183('0x1f')](function(_0xab925e){_0x3df2c8=_0xab925e;return db[_0x0183('0x39')][_0x0183('0x4f')]({'where':{'type':_0x5b4cbd[_0x0183('0x57')]['type']},'raw':!![]});})[_0x0183('0x1f')](function(_0x5b97bb){if(_0x3df2c8[_0x0183('0x3c')][_0x0183('0x58')]()=='STUN'){var _0x46ee79=fs[_0x0183('0x59')](path[_0x0183('0x5a')](config[_0x0183('0x5b')],_0x0183('0x5c')),_0x0183('0x5d'));var _0x29813e=ejs[_0x0183('0x5e')](_0x46ee79,{'networks':_0x5b97bb||[]});fs['writeFileSync'](_0x0183('0x5f'),_0x29813e);return respondWithRpcPromise('Reload',_0x0183('0x55'),{'module':_0x0183('0x60')});}else if(_0x3df2c8[_0x0183('0x3c')]['toUpperCase']()==_0x0183('0x61')){var _0x3cccdb=fs[_0x0183('0x59')](path[_0x0183('0x5a')](config[_0x0183('0x5b')],_0x0183('0x62')),'utf8');var _0x251e83=ejs[_0x0183('0x5e')](_0x3cccdb,{'networks':_0x5b97bb||[]});fs[_0x0183('0x63')]('/etc/asterisk/turn_xcally.conf',_0x251e83);return respondWithRpcPromise('Reload',_0x0183('0x55'),{'module':'res_stun_monitor.so'});}else{var _0x3ca078=fs['readFileSync'](path[_0x0183('0x5a')](config[_0x0183('0x5b')],_0x0183('0x64')),_0x0183('0x5d'));var _0x4876fb=ejs[_0x0183('0x5e')](_0x3ca078,{'networks':_0x5b97bb||[]});fs[_0x0183('0x63')](util[_0x0183('0x65')](_0x0183('0x66'),_0x5b4cbd['body'][_0x0183('0x3c')][_0x0183('0x67')]()),_0x4876fb);return respondWithRpcPromise(_0x0183('0x68'),'create',{'module':_0x0183('0x69')});}return null;})[_0x0183('0x1f')](function(){return _0x3df2c8;});})['then'](respondWithResult(_0x4b8d40,0xc9))[_0x0183('0x28')](handleError(_0x4b8d40,null));};exports[_0x0183('0x33')]=function(_0x4f0f13,_0x3c6966,_0xd8e0be){var _0x1132e6;return db[_0x0183('0x56')][_0x0183('0x6a')](function(_0x571180){return db[_0x0183('0x39')][_0x0183('0x54')]({'where':{'id':_0x4f0f13['params']['id']}})[_0x0183('0x1f')](handleEntityNotFound(_0x3c6966,null))[_0x0183('0x1f')](saveUpdates(_0x4f0f13[_0x0183('0x57')],null))[_0x0183('0x1f')](function(_0x19dcf5){if(_0x19dcf5){_0x1132e6=_0x19dcf5;return db['Network']['findAll']({'where':{'type':_0x1132e6['type']},'raw':!![]});}return null;})[_0x0183('0x1f')](function(_0x365966){if(_0x1132e6[_0x0183('0x3c')][_0x0183('0x58')]()==_0x0183('0x6b')){var _0x1c4ead=fs[_0x0183('0x59')](path[_0x0183('0x5a')](config[_0x0183('0x5b')],_0x0183('0x5c')),_0x0183('0x5d'));var _0x49f3e7=ejs[_0x0183('0x5e')](_0x1c4ead,{'networks':_0x365966||[]});fs[_0x0183('0x63')]('/etc/asterisk/stun_xcally.conf',_0x49f3e7);return respondWithRpcPromise('Reload',_0x0183('0x33'),{'module':'res_stun_monitor.so'});}else if(_0x1132e6[_0x0183('0x3c')][_0x0183('0x58')]()=='TURN'){var _0x372365=fs[_0x0183('0x59')](path[_0x0183('0x5a')](config[_0x0183('0x5b')],_0x0183('0x62')),'utf8');var _0x209a0f=ejs[_0x0183('0x5e')](_0x372365,{'networks':_0x365966||[]});fs[_0x0183('0x63')](_0x0183('0x6c'),_0x209a0f);return respondWithRpcPromise(_0x0183('0x68'),_0x0183('0x33'),{'module':_0x0183('0x60')});}else{var _0x4a4890=fs[_0x0183('0x59')](path[_0x0183('0x5a')](config['root'],_0x0183('0x64')),_0x0183('0x5d'));var _0x480b1b=ejs[_0x0183('0x5e')](_0x4a4890,{'networks':_0x365966||[]});fs[_0x0183('0x63')](util['format'](_0x0183('0x66'),_0x4f0f13['body'][_0x0183('0x3c')][_0x0183('0x67')]()),_0x480b1b);return respondWithRpcPromise(_0x0183('0x68'),_0x0183('0x33'),{'module':_0x0183('0x69')});}return null;})[_0x0183('0x1f')](function(_0x57209a){if(_0x57209a){return _0x1132e6;}return null;});})[_0x0183('0x1f')](respondWithResult(_0x3c6966,null))[_0x0183('0x28')](handleError(_0x3c6966,null));};exports[_0x0183('0x6d')]=function(_0x774b51,_0x3bdda9,_0xf021d7){var _0x5f4328;return db[_0x0183('0x39')][_0x0183('0x54')]({'where':{'id':_0x774b51['params']['id']}})[_0x0183('0x1f')](function(_0x3ad5a2){_0x5f4328=_0x3ad5a2;return _0x3ad5a2;})[_0x0183('0x1f')](handleEntityNotFound(_0x3bdda9,null))[_0x0183('0x1f')](removeEntity(_0x3bdda9,null))[_0x0183('0x1f')](function(){if(_0x5f4328){return db[_0x0183('0x39')][_0x0183('0x4f')]({'where':{'type':_0x5f4328[_0x0183('0x3c')]},'raw':!![]});}})[_0x0183('0x1f')](function(_0x5e143b){if(_0x5f4328['type']['toUpperCase']()==_0x0183('0x6b')){var _0x414968=fs[_0x0183('0x59')](path['join'](config[_0x0183('0x5b')],_0x0183('0x5c')),'utf8');var _0x5053b0=ejs[_0x0183('0x5e')](_0x414968,{'networks':_0x5e143b||[]});fs[_0x0183('0x63')](_0x0183('0x5f'),_0x5053b0);return respondWithRpcPromise(_0x0183('0x68'),_0x0183('0x6d'),{'module':_0x0183('0x60')});}else if(_0x5f4328[_0x0183('0x3c')][_0x0183('0x58')]()==_0x0183('0x61')){var _0x227dae=fs[_0x0183('0x59')](path['join'](config[_0x0183('0x5b')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x1a4718=ejs[_0x0183('0x5e')](_0x227dae,{'networks':_0x5e143b||[]});fs[_0x0183('0x63')]('/etc/asterisk/turn_xcally.conf',_0x1a4718);return respondWithRpcPromise('Reload',_0x0183('0x6d'),{'module':_0x0183('0x60')});}else{var _0x4c9d2c=fs[_0x0183('0x59')](path[_0x0183('0x5a')](config['root'],_0x0183('0x64')),'utf8');var _0x169015=ejs['render'](_0x4c9d2c,{'networks':_0x5e143b||[]});fs['writeFileSync'](util[_0x0183('0x65')]('/etc/asterisk/sip_xcally_%s.conf',_0x774b51[_0x0183('0x57')][_0x0183('0x3c')]['toLowerCase']()),_0x169015);return respondWithRpcPromise(_0x0183('0x68'),'destroy',{'module':_0x0183('0x69')});}return null;})[_0x0183('0x28')](handleError(_0x3bdda9,null));}; \ No newline at end of file +var _0xd920=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Network','includeAll','include','findAll','rows','show','params','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','root','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../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~!@#$%^&-_=+[{]}.','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','json','count','offset','limit','Content-Range','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x2f0a26,_0x1d79a4){var _0x1b9ee9=function(_0x14e8d1){while(--_0x14e8d1){_0x2f0a26['push'](_0x2f0a26['shift']());}};_0x1b9ee9(++_0x1d79a4);}(_0xd920,0x109));var _0x0d92=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xd920[_0x8c1005];return _0x175354;};'use strict';var pdf=require(_0x0d92('0x0'));var emlformat=require(_0x0d92('0x1'));var rimraf=require(_0x0d92('0x2'));var zipdir=require(_0x0d92('0x3'));var jsonpatch=require(_0x0d92('0x4'));var rp=require(_0x0d92('0x5'));var moment=require(_0x0d92('0x6'));var BPromise=require(_0x0d92('0x7'));var Mustache=require(_0x0d92('0x8'));var util=require(_0x0d92('0x9'));var path=require(_0x0d92('0xa'));var sox=require(_0x0d92('0xb'));var csv=require(_0x0d92('0xc'));var ejs=require(_0x0d92('0xd'));var fs=require('fs');var _=require(_0x0d92('0xe'));var squel=require(_0x0d92('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0d92('0x10'));var toCsv=require(_0x0d92('0xc'));var querystring=require(_0x0d92('0x11'));var Papa=require(_0x0d92('0x12'));var Redis=require(_0x0d92('0x13'));var authService=require(_0x0d92('0x14'));var qs=require(_0x0d92('0x15'));var as=require(_0x0d92('0x16'));var hardwareService=require(_0x0d92('0x17'));var logger=require(_0x0d92('0x18'))(_0x0d92('0x19'));var utils=require(_0x0d92('0x1a'));var config=require(_0x0d92('0x1b'));var db=require(_0x0d92('0x1c'))['db'];var jayson=require(_0x0d92('0x1d'));var client=jayson[_0x0d92('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x425504,_0x29ac91,_0x293db3){if(_0x293db3){var _0x214860=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x214860[_0x0d92('0x1f')](_0x29ac91)){return _0x425504;}else{throw new db[(_0x0d92('0x20'))]['ValidationError'](_0x0d92('0x21'));}}else{return _0x425504;}}function respondWithRpcPromise(_0x624e95,_0x42e825,_0x2af6f9,_0xdefd0a){return new BPromise(function(_0x562b7a,_0x1c7495){var _0x3cd2cc=_0xdefd0a||client;return _0x3cd2cc['request'](_0x624e95,_0x2af6f9)[_0x0d92('0x22')](function(_0x48d43f){logger[_0x0d92('0x23')](_0x0d92('0x24'),_0x42e825,_0x0d92('0x25'));logger[_0x0d92('0x26')](_0x0d92('0x27'),_0x42e825,'request\x20sent',JSON[_0x0d92('0x28')](_0x48d43f));if(_0x48d43f[_0x0d92('0x29')]){if(_0x48d43f[_0x0d92('0x29')]['code']===0x1f4){logger[_0x0d92('0x29')]('Network,\x20%s,\x20%s',_0x42e825,_0x48d43f[_0x0d92('0x29')][_0x0d92('0x2a')]);return _0x1c7495(_0x48d43f[_0x0d92('0x29')][_0x0d92('0x2a')]);}logger[_0x0d92('0x29')]('Network,\x20%s,\x20%s',_0x42e825,_0x48d43f[_0x0d92('0x29')][_0x0d92('0x2a')]);return _0x562b7a(_0x48d43f[_0x0d92('0x29')][_0x0d92('0x2a')]);}else{logger['info'](_0x0d92('0x24'),_0x42e825,_0x0d92('0x25'));_0x562b7a(_0x48d43f['result'][_0x0d92('0x2a')]);}})[_0x0d92('0x2b')](function(_0x3281bf){logger[_0x0d92('0x29')](_0x0d92('0x24'),_0x42e825,_0x3281bf);_0x1c7495(_0x3281bf);});});}function respondWithStatusCode(_0x3f1a7b,_0x50004d){_0x50004d=_0x50004d||0xcc;return function(_0x31ddbf){if(_0x31ddbf){return _0x3f1a7b['sendStatus'](_0x50004d);}return _0x3f1a7b[_0x0d92('0x2c')](_0x50004d)[_0x0d92('0x2d')]();};}function respondWithResult(_0x416e28,_0x5c49b2){_0x5c49b2=_0x5c49b2||0xc8;return function(_0x60a980){if(_0x60a980){return _0x416e28['status'](_0x5c49b2)[_0x0d92('0x2e')](_0x60a980);}};}function respondWithFilteredResult(_0x22b4b4,_0x2811d3){return function(_0x299a06){if(_0x299a06){var _0x5ae54e=_0x299a06[_0x0d92('0x2f')],_0x167dd6=_0x2811d3[_0x0d92('0x30')],_0x7382a6=_0x2811d3[_0x0d92('0x30')]+_0x2811d3[_0x0d92('0x31')],_0x55961e;if(_0x7382a6>=_0x5ae54e){_0x7382a6=_0x5ae54e;_0x55961e=0xc8;}else{_0x55961e=0xce;}_0x22b4b4[_0x0d92('0x2c')](_0x55961e);return _0x22b4b4['set'](_0x0d92('0x32'),_0x167dd6+'-'+_0x7382a6+'/'+_0x5ae54e)['json'](_0x299a06);}return null;};}function patchUpdates(_0x2b0738){return function(_0x1af41b){try{jsonpatch['apply'](_0x1af41b,_0x2b0738,!![]);}catch(_0x2d28b8){return BPromise['reject'](_0x2d28b8);}return _0x1af41b[_0x0d92('0x33')]();};}function saveUpdates(_0x390290,_0x1b5f71){return function(_0x3847e3){if(_0x3847e3){return _0x3847e3[_0x0d92('0x34')](_0x390290)[_0x0d92('0x22')](function(_0x35574a){return _0x35574a;});}return null;};}function removeEntity(_0x2fe4e4,_0x5b9ef5){return function(_0x2a0276){if(_0x2a0276){return _0x2a0276[_0x0d92('0x35')]()['then'](function(){_0x2fe4e4['status'](0xcc)[_0x0d92('0x2d')]();});}};}function handleEntityNotFound(_0x326d7f,_0x1c33c6){return function(_0x38fff4){if(!_0x38fff4){_0x326d7f['sendStatus'](0x194);}return _0x38fff4;};}function handleError(_0x40c0d1,_0x2e2f96){_0x2e2f96=_0x2e2f96||0x1f4;return function(_0x45e81a){logger[_0x0d92('0x29')](_0x45e81a[_0x0d92('0x36')]);if(_0x45e81a[_0x0d92('0x37')]){delete _0x45e81a[_0x0d92('0x37')];}_0x40c0d1[_0x0d92('0x2c')](_0x2e2f96)['send'](_0x45e81a);};}exports[_0x0d92('0x38')]=function(_0x43530b,_0x124dfe){var _0x3f9dfa={},_0x580423={},_0x1dce28={'count':0x0,'rows':[]};var _0x2af5ad=_[_0x0d92('0x39')](db['Network'][_0x0d92('0x3a')],function(_0x38e96d){return{'name':_0x38e96d[_0x0d92('0x3b')],'type':_0x38e96d[_0x0d92('0x3c')][_0x0d92('0x3d')]};});_0x580423['model']=_[_0x0d92('0x39')](_0x2af5ad,_0x0d92('0x37'));_0x580423[_0x0d92('0x3e')]=_[_0x0d92('0x3f')](_0x43530b[_0x0d92('0x3e')]);_0x580423[_0x0d92('0x40')]=_['intersection'](_0x580423[_0x0d92('0x41')],_0x580423[_0x0d92('0x3e')]);_0x3f9dfa[_0x0d92('0x42')]=_[_0x0d92('0x43')](_0x580423[_0x0d92('0x41')],qs[_0x0d92('0x44')](_0x43530b[_0x0d92('0x3e')]['fields']));_0x3f9dfa[_0x0d92('0x42')]=_0x3f9dfa[_0x0d92('0x42')][_0x0d92('0x45')]?_0x3f9dfa[_0x0d92('0x42')]:_0x580423[_0x0d92('0x41')];if(!_0x43530b[_0x0d92('0x3e')][_0x0d92('0x46')](_0x0d92('0x47'))){_0x3f9dfa[_0x0d92('0x31')]=qs['limit'](_0x43530b[_0x0d92('0x3e')]['limit']);_0x3f9dfa[_0x0d92('0x30')]=qs[_0x0d92('0x30')](_0x43530b['query'][_0x0d92('0x30')]);}_0x3f9dfa[_0x0d92('0x48')]=qs[_0x0d92('0x49')](_0x43530b[_0x0d92('0x3e')]['sort']);_0x3f9dfa[_0x0d92('0x4a')]=qs[_0x0d92('0x40')](_[_0x0d92('0x4b')](_0x43530b[_0x0d92('0x3e')],_0x580423[_0x0d92('0x40')]));if(_0x43530b[_0x0d92('0x3e')][_0x0d92('0x4c')]){_0x3f9dfa[_0x0d92('0x4a')]=_[_0x0d92('0x4d')](_0x3f9dfa[_0x0d92('0x4a')],{'$or':_[_0x0d92('0x39')](_0x2af5ad,function(_0x3cf580){if(_0x3cf580[_0x0d92('0x3c')]!==_0x0d92('0x4e')){var _0x2a9f80={};_0x2a9f80[_0x3cf580[_0x0d92('0x37')]]={'$like':'%'+_0x43530b[_0x0d92('0x3e')][_0x0d92('0x4c')]+'%'};return _0x2a9f80;}})});}_0x3f9dfa=_[_0x0d92('0x4d')]({},_0x3f9dfa,_0x43530b[_0x0d92('0x4f')]);var _0x53999e={'where':_0x3f9dfa['where']};return db[_0x0d92('0x50')]['count'](_0x53999e)[_0x0d92('0x22')](function(_0x1e9916){_0x1dce28[_0x0d92('0x2f')]=_0x1e9916;if(_0x43530b[_0x0d92('0x3e')][_0x0d92('0x51')]){_0x3f9dfa[_0x0d92('0x52')]=[{'all':!![]}];}return db[_0x0d92('0x50')][_0x0d92('0x53')](_0x3f9dfa);})['then'](function(_0x22cf79){_0x1dce28[_0x0d92('0x54')]=_0x22cf79;return _0x1dce28;})[_0x0d92('0x22')](respondWithFilteredResult(_0x124dfe,_0x3f9dfa))['catch'](handleError(_0x124dfe,null));};exports[_0x0d92('0x55')]=function(_0x5429e7,_0x3ab77b){var _0x3ccf46={'raw':!![],'where':{'id':_0x5429e7[_0x0d92('0x56')]['id']}},_0x236186={};_0x236186[_0x0d92('0x41')]=_[_0x0d92('0x3f')](db[_0x0d92('0x50')][_0x0d92('0x3a')]);_0x236186[_0x0d92('0x3e')]=_[_0x0d92('0x3f')](_0x5429e7[_0x0d92('0x3e')]);_0x236186['filters']=_[_0x0d92('0x43')](_0x236186[_0x0d92('0x41')],_0x236186[_0x0d92('0x3e')]);_0x3ccf46['attributes']=_[_0x0d92('0x43')](_0x236186[_0x0d92('0x41')],qs[_0x0d92('0x44')](_0x5429e7[_0x0d92('0x3e')]['fields']));_0x3ccf46[_0x0d92('0x42')]=_0x3ccf46['attributes'][_0x0d92('0x45')]?_0x3ccf46[_0x0d92('0x42')]:_0x236186[_0x0d92('0x41')];if(_0x5429e7[_0x0d92('0x3e')][_0x0d92('0x51')]){_0x3ccf46[_0x0d92('0x52')]=[{'all':!![]}];}_0x3ccf46=_[_0x0d92('0x4d')]({},_0x3ccf46,_0x5429e7['options']);return db[_0x0d92('0x50')]['find'](_0x3ccf46)[_0x0d92('0x22')](handleEntityNotFound(_0x3ab77b,null))[_0x0d92('0x22')](respondWithResult(_0x3ab77b,null))['catch'](handleError(_0x3ab77b,null));};exports[_0x0d92('0x57')]=function(_0x480a31,_0x2c7b9f,_0x3484b9){var _0x477404;return db[_0x0d92('0x58')][_0x0d92('0x59')](function(_0x180332){return db[_0x0d92('0x50')][_0x0d92('0x57')](_0x480a31[_0x0d92('0x5a')],{'raw':!![]})[_0x0d92('0x22')](function(_0x419d7f){_0x477404=_0x419d7f;return db[_0x0d92('0x50')][_0x0d92('0x53')]({'where':{'type':_0x480a31['body'][_0x0d92('0x3c')]},'raw':!![]});})[_0x0d92('0x22')](function(_0x3271ca){if(_0x477404[_0x0d92('0x3c')][_0x0d92('0x5b')]()==_0x0d92('0x5c')){var _0x575fe1=fs[_0x0d92('0x5d')](path['join'](config['root'],_0x0d92('0x5e')),_0x0d92('0x5f'));var _0x6fca5=ejs[_0x0d92('0x60')](_0x575fe1,{'networks':_0x3271ca||[]});fs['writeFileSync'](_0x0d92('0x61'),_0x6fca5);return respondWithRpcPromise(_0x0d92('0x62'),_0x0d92('0x57'),{'module':_0x0d92('0x63')});}else if(_0x477404[_0x0d92('0x3c')][_0x0d92('0x5b')]()==_0x0d92('0x64')){var _0x411a03=fs[_0x0d92('0x5d')](path[_0x0d92('0x65')](config[_0x0d92('0x66')],_0x0d92('0x67')),_0x0d92('0x5f'));var _0x500959=ejs[_0x0d92('0x60')](_0x411a03,{'networks':_0x3271ca||[]});fs[_0x0d92('0x68')](_0x0d92('0x69'),_0x500959);return respondWithRpcPromise(_0x0d92('0x62'),_0x0d92('0x57'),{'module':_0x0d92('0x63')});}else{var _0x41b81c=fs[_0x0d92('0x5d')](path[_0x0d92('0x65')](config[_0x0d92('0x66')],_0x0d92('0x6a')),_0x0d92('0x5f'));var _0x3c2db2=ejs['render'](_0x41b81c,{'networks':_0x3271ca||[]});fs['writeFileSync'](util[_0x0d92('0x6b')](_0x0d92('0x6c'),_0x480a31[_0x0d92('0x5a')][_0x0d92('0x3c')][_0x0d92('0x6d')]()),_0x3c2db2);return respondWithRpcPromise('Reload',_0x0d92('0x57'),{'module':_0x0d92('0x6e')});}return null;})[_0x0d92('0x22')](function(){return _0x477404;});})[_0x0d92('0x22')](respondWithResult(_0x2c7b9f,0xc9))['catch'](handleError(_0x2c7b9f,null));};exports['update']=function(_0x2fd49a,_0x1f53d2,_0x56a758){var _0x12de69;return db['sequelize'][_0x0d92('0x59')](function(_0x3ff68a){return db[_0x0d92('0x50')]['find']({'where':{'id':_0x2fd49a['params']['id']}})[_0x0d92('0x22')](handleEntityNotFound(_0x1f53d2,null))[_0x0d92('0x22')](saveUpdates(_0x2fd49a['body'],null))[_0x0d92('0x22')](function(_0x55e802){if(_0x55e802){_0x12de69=_0x55e802;return db[_0x0d92('0x50')][_0x0d92('0x53')]({'where':{'type':_0x12de69[_0x0d92('0x3c')]},'raw':!![]});}return null;})[_0x0d92('0x22')](function(_0x25a9b9){if(_0x12de69[_0x0d92('0x3c')]['toUpperCase']()==_0x0d92('0x5c')){var _0x36427d=fs[_0x0d92('0x5d')](path['join'](config[_0x0d92('0x66')],_0x0d92('0x5e')),_0x0d92('0x5f'));var _0x21d6e9=ejs[_0x0d92('0x60')](_0x36427d,{'networks':_0x25a9b9||[]});fs[_0x0d92('0x68')]('/etc/asterisk/stun_xcally.conf',_0x21d6e9);return respondWithRpcPromise('Reload','update',{'module':_0x0d92('0x63')});}else if(_0x12de69['type'][_0x0d92('0x5b')]()=='TURN'){var _0x2a2930=fs['readFileSync'](path['join'](config[_0x0d92('0x66')],_0x0d92('0x67')),_0x0d92('0x5f'));var _0x32c177=ejs[_0x0d92('0x60')](_0x2a2930,{'networks':_0x25a9b9||[]});fs[_0x0d92('0x68')](_0x0d92('0x69'),_0x32c177);return respondWithRpcPromise('Reload',_0x0d92('0x34'),{'module':'res_stun_monitor.so'});}else{var _0x47a7bb=fs[_0x0d92('0x5d')](path[_0x0d92('0x65')](config[_0x0d92('0x66')],_0x0d92('0x6a')),_0x0d92('0x5f'));var _0x1b0c60=ejs[_0x0d92('0x60')](_0x47a7bb,{'networks':_0x25a9b9||[]});fs[_0x0d92('0x68')](util['format'](_0x0d92('0x6c'),_0x2fd49a['body'][_0x0d92('0x3c')]['toLowerCase']()),_0x1b0c60);return respondWithRpcPromise('Reload',_0x0d92('0x34'),{'module':_0x0d92('0x6e')});}return null;})['then'](function(_0x4e1c7a){if(_0x4e1c7a){return _0x12de69;}return null;});})[_0x0d92('0x22')](respondWithResult(_0x1f53d2,null))[_0x0d92('0x2b')](handleError(_0x1f53d2,null));};exports[_0x0d92('0x35')]=function(_0x2d65e0,_0x16b510,_0x316802){var _0x2d17a0;return db['Network'][_0x0d92('0x6f')]({'where':{'id':_0x2d65e0[_0x0d92('0x56')]['id']}})[_0x0d92('0x22')](function(_0x256cc4){_0x2d17a0=_0x256cc4;return _0x256cc4;})[_0x0d92('0x22')](handleEntityNotFound(_0x16b510,null))[_0x0d92('0x22')](removeEntity(_0x16b510,null))[_0x0d92('0x22')](function(){if(_0x2d17a0){return db[_0x0d92('0x50')][_0x0d92('0x53')]({'where':{'type':_0x2d17a0[_0x0d92('0x3c')]},'raw':!![]});}})['then'](function(_0x1264ed){if(_0x2d17a0['type'][_0x0d92('0x5b')]()==_0x0d92('0x5c')){var _0xa951f0=fs['readFileSync'](path[_0x0d92('0x65')](config['root'],_0x0d92('0x5e')),'utf8');var _0x20f049=ejs[_0x0d92('0x60')](_0xa951f0,{'networks':_0x1264ed||[]});fs[_0x0d92('0x68')]('/etc/asterisk/stun_xcally.conf',_0x20f049);return respondWithRpcPromise(_0x0d92('0x62'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x2d17a0[_0x0d92('0x3c')][_0x0d92('0x5b')]()==_0x0d92('0x64')){var _0x17e3aa=fs[_0x0d92('0x5d')](path['join'](config['root'],_0x0d92('0x67')),'utf8');var _0x49deed=ejs[_0x0d92('0x60')](_0x17e3aa,{'networks':_0x1264ed||[]});fs[_0x0d92('0x68')](_0x0d92('0x69'),_0x49deed);return respondWithRpcPromise(_0x0d92('0x62'),'destroy',{'module':_0x0d92('0x63')});}else{var _0x175e57=fs[_0x0d92('0x5d')](path[_0x0d92('0x65')](config[_0x0d92('0x66')],_0x0d92('0x6a')),_0x0d92('0x5f'));var _0x18a1af=ejs[_0x0d92('0x60')](_0x175e57,{'networks':_0x1264ed||[]});fs[_0x0d92('0x68')](util['format'](_0x0d92('0x6c'),_0x2d65e0['body'][_0x0d92('0x3c')][_0x0d92('0x6d')]()),_0x18a1af);return respondWithRpcPromise(_0x0d92('0x62'),_0x0d92('0x35'),{'module':'chan_sip.so'});}return null;})[_0x0d92('0x2b')](handleError(_0x16b510,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 9de07b5..c1d4ac2 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 _0xfd8a=['rimraf','./network.attributes','exports','define','Network','network','lodash','util','api','bluebird','request-promise','path'];(function(_0x4625c6,_0x382854){var _0x16036e=function(_0x521f52){while(--_0x521f52){_0x4625c6['push'](_0x4625c6['shift']());}};_0x16036e(++_0x382854);}(_0xfd8a,0x7e));var _0xafd8=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0xfd8a[_0x230e39];return _0xa804e;};'use strict';var _=require(_0xafd8('0x0'));var util=require(_0xafd8('0x1'));var logger=require('../../config/logger')(_0xafd8('0x2'));var moment=require('moment');var BPromise=require(_0xafd8('0x3'));var rp=require(_0xafd8('0x4'));var fs=require('fs');var path=require(_0xafd8('0x5'));var rimraf=require(_0xafd8('0x6'));var config=require('../../config/environment');var attributes=require(_0xafd8('0x7'));module[_0xafd8('0x8')]=function(_0x424889,_0x309008){return _0x424889[_0xafd8('0x9')](_0xafd8('0xa'),attributes,{'tableName':_0xafd8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ac4=['network','../../config/logger','moment','request-promise','path','../../config/environment','./network.attributes','exports','define'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0ac4,0x172));var _0x40ac=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0x0ac4[_0x4c05da];return _0x1614db;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x40ac('0x0'))('api');var moment=require(_0x40ac('0x1'));var BPromise=require('bluebird');var rp=require(_0x40ac('0x2'));var fs=require('fs');var path=require(_0x40ac('0x3'));var rimraf=require('rimraf');var config=require(_0x40ac('0x4'));var attributes=require(_0x40ac('0x5'));module[_0x40ac('0x6')]=function(_0xa1975d,_0x67103c){return _0xa1975d[_0x40ac('0x7')]('Network',attributes,{'tableName':_0x40ac('0x8'),'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 6626782..21177c4 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 _0x8dfc=['debug','stringify','error','Network,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent'];(function(_0x15bcb5,_0x3f3b6f){var _0x3b4169=function(_0x15b73b){while(--_0x15b73b){_0x15bcb5['push'](_0x15bcb5['shift']());}};_0x3b4169(++_0x3f3b6f);}(_0x8dfc,0x6a));var _0xc8df=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x8dfc[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xc8df('0x0'));var util=require(_0xc8df('0x1'));var moment=require(_0xc8df('0x2'));var BPromise=require(_0xc8df('0x3'));var rs=require(_0xc8df('0x4'));var fs=require('fs');var Redis=require(_0xc8df('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8df('0x6'));var logger=require(_0xc8df('0x7'))(_0xc8df('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc8df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51a0a5,_0x147d8b,_0x238fca){return new BPromise(function(_0x3050ff,_0x4b38fd){return client[_0xc8df('0xa')](_0x51a0a5,_0x238fca)[_0xc8df('0xb')](function(_0x8a844f){logger[_0xc8df('0xc')]('Network,\x20%s,\x20%s',_0x147d8b,_0xc8df('0xd'));logger[_0xc8df('0xe')]('Network,\x20%s,\x20%s,\x20%s',_0x147d8b,'request\x20sent',JSON[_0xc8df('0xf')](_0x8a844f));if(_0x8a844f['error']){if(_0x8a844f[_0xc8df('0x10')]['code']===0x1f4){logger['error'](_0xc8df('0x11'),_0x147d8b,_0x8a844f[_0xc8df('0x10')][_0xc8df('0x12')]);return _0x4b38fd(_0x8a844f[_0xc8df('0x10')][_0xc8df('0x12')]);}logger[_0xc8df('0x10')](_0xc8df('0x11'),_0x147d8b,_0x8a844f[_0xc8df('0x10')][_0xc8df('0x12')]);return _0x3050ff(_0x8a844f[_0xc8df('0x10')][_0xc8df('0x12')]);}else{logger[_0xc8df('0xc')](_0xc8df('0x11'),_0x147d8b,_0xc8df('0xd'));_0x3050ff(_0x8a844f['result'][_0xc8df('0x12')]);}})[_0xc8df('0x13')](function(_0x59a8c4){logger[_0xc8df('0x10')](_0xc8df('0x11'),_0x147d8b,_0x59a8c4);_0x4b38fd(_0x59a8c4);});});} \ No newline at end of file +var _0xcbc9=['error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2aa83a,_0x4b5c0b){var _0x36a653=function(_0x3fdc46){while(--_0x3fdc46){_0x2aa83a['push'](_0x2aa83a['shift']());}};_0x36a653(++_0x4b5c0b);}(_0xcbc9,0x1d3));var _0x9cbc=function(_0x33925b,_0x95cfc6){_0x33925b=_0x33925b-0x0;var _0x375e21=_0xcbc9[_0x33925b];return _0x375e21;};'use strict';var _=require(_0x9cbc('0x0'));var util=require('util');var moment=require(_0x9cbc('0x1'));var BPromise=require(_0x9cbc('0x2'));var rs=require(_0x9cbc('0x3'));var fs=require('fs');var Redis=require(_0x9cbc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9cbc('0x5'))(_0x9cbc('0x6'));var config=require(_0x9cbc('0x7'));var jayson=require(_0x9cbc('0x8'));var client=jayson['client'][_0x9cbc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x150217,_0x480f32,_0x338e00){return new BPromise(function(_0x1c8599,_0x35d0a1){return client[_0x9cbc('0xa')](_0x150217,_0x338e00)[_0x9cbc('0xb')](function(_0x1d9630){logger['info'](_0x9cbc('0xc'),_0x480f32,'request\x20sent');logger[_0x9cbc('0xd')](_0x9cbc('0xe'),_0x480f32,_0x9cbc('0xf'),JSON[_0x9cbc('0x10')](_0x1d9630));if(_0x1d9630[_0x9cbc('0x11')]){if(_0x1d9630[_0x9cbc('0x11')]['code']===0x1f4){logger[_0x9cbc('0x11')](_0x9cbc('0xc'),_0x480f32,_0x1d9630[_0x9cbc('0x11')][_0x9cbc('0x12')]);return _0x35d0a1(_0x1d9630['error']['message']);}logger[_0x9cbc('0x11')](_0x9cbc('0xc'),_0x480f32,_0x1d9630['error'][_0x9cbc('0x12')]);return _0x1c8599(_0x1d9630[_0x9cbc('0x11')][_0x9cbc('0x12')]);}else{logger[_0x9cbc('0x13')](_0x9cbc('0xc'),_0x480f32,_0x9cbc('0xf'));_0x1c8599(_0x1d9630[_0x9cbc('0x14')][_0x9cbc('0x12')]);}})[_0x9cbc('0x15')](function(_0x2dcdda){logger[_0x9cbc('0x11')]('Network,\x20%s,\x20%s',_0x480f32,_0x2dcdda);_0x35d0a1(_0x2dcdda);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 7f9eb42..c618120 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 _0xe530=['getAnswers','getInteractions','/:id/users','post','create','addDisposition','addAnswer','notify','/:id/applications','addAgents','/:id/send','put','update','delete','destroy','removeAnswers','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe530,0xbf));var _0x0e53=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe530[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x0e53('0x0'));var util=require(_0x0e53('0x1'));var path=require(_0x0e53('0x2'));var timeout=require('connect-timeout');var express=require(_0x0e53('0x3'));var router=express[_0x0e53('0x4')]();var auth=require(_0x0e53('0x5'));var interaction=require(_0x0e53('0x6'));var config=require(_0x0e53('0x7'));var controller=require(_0x0e53('0x8'));router['get']('/',auth[_0x0e53('0x9')](),controller[_0x0e53('0xa')]);router[_0x0e53('0xb')](_0x0e53('0xc'),auth['isAuthenticated'](),controller[_0x0e53('0xd')]);router[_0x0e53('0xb')](_0x0e53('0xe'),auth['isAuthenticated'](),controller[_0x0e53('0xf')]);router['get'](_0x0e53('0x10'),auth[_0x0e53('0x9')](),controller[_0x0e53('0x11')]);router['get'](_0x0e53('0x12'),auth[_0x0e53('0x9')](),controller[_0x0e53('0x13')]);router['get']('/:id/applications',auth[_0x0e53('0x9')](),controller['getApplications']);router[_0x0e53('0xb')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x0e53('0x14')]);router['get'](_0x0e53('0x15'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0e53('0x16')]('/',auth['isAuthenticated'](),controller[_0x0e53('0x17')]);router[_0x0e53('0x16')](_0x0e53('0x10'),auth[_0x0e53('0x9')](),controller[_0x0e53('0x18')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0e53('0x19')]);router[_0x0e53('0x16')]('/:id/notify',controller[_0x0e53('0x1a')]);router[_0x0e53('0x16')](_0x0e53('0x1b'),auth['isAuthenticated'](),controller['addApplications']);router[_0x0e53('0x16')](_0x0e53('0x15'),auth[_0x0e53('0x9')](),controller[_0x0e53('0x1c')]);router['post'](_0x0e53('0x1d'),auth[_0x0e53('0x9')](),controller['send']);router[_0x0e53('0x1e')](_0x0e53('0xe'),auth[_0x0e53('0x9')](),controller[_0x0e53('0x1f')]);router[_0x0e53('0x20')](_0x0e53('0xe'),auth[_0x0e53('0x9')](),controller[_0x0e53('0x21')]);router['delete']('/:id/dispositions',auth[_0x0e53('0x9')](),controller['removeDispositions']);router['delete'](_0x0e53('0x12'),auth[_0x0e53('0x9')](),controller[_0x0e53('0x22')]);router[_0x0e53('0x20')](_0x0e53('0x15'),auth[_0x0e53('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xeeb0=['update','delete','destroy','removeDispositions','removeAgents','util','path','express','Router','../../components/auth/service','get','index','/describe','isAuthenticated','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','/:id/dispositions','addDisposition','post','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','/:id'];(function(_0x3eff46,_0x2263fa){var _0x415fa1=function(_0x4397e0){while(--_0x4397e0){_0x3eff46['push'](_0x3eff46['shift']());}};_0x415fa1(++_0x2263fa);}(_0xeeb0,0x15b));var _0x0eeb=function(_0x23129b,_0x2d13ae){_0x23129b=_0x23129b-0x0;var _0x3b2fe9=_0xeeb0[_0x23129b];return _0x3b2fe9;};'use strict';var multer=require('multer');var util=require(_0x0eeb('0x0'));var path=require(_0x0eeb('0x1'));var timeout=require('connect-timeout');var express=require(_0x0eeb('0x2'));var router=express[_0x0eeb('0x3')]();var auth=require(_0x0eeb('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x0eeb('0x5')]('/',auth['isAuthenticated'](),controller[_0x0eeb('0x6')]);router['get'](_0x0eeb('0x7'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x9')]);router[_0x0eeb('0x5')]('/:id',auth[_0x0eeb('0x8')](),controller[_0x0eeb('0xa')]);router[_0x0eeb('0x5')]('/:id/dispositions',auth[_0x0eeb('0x8')](),controller[_0x0eeb('0xb')]);router['get'](_0x0eeb('0xc'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0xd')]);router[_0x0eeb('0x5')](_0x0eeb('0xe'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0xf')]);router[_0x0eeb('0x5')](_0x0eeb('0x10'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x11')]);router[_0x0eeb('0x5')](_0x0eeb('0x12'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0eeb('0x14')]);router['post'](_0x0eeb('0x15'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x16')]);router[_0x0eeb('0x17')]('/:id/canned_answers',auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x18')]);router[_0x0eeb('0x17')](_0x0eeb('0x19'),controller[_0x0eeb('0x1a')]);router[_0x0eeb('0x17')](_0x0eeb('0xe'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x1b')]);router['post'](_0x0eeb('0x12'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x1c')]);router[_0x0eeb('0x17')](_0x0eeb('0x1d'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x1e')]);router[_0x0eeb('0x1f')](_0x0eeb('0x20'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x21')]);router[_0x0eeb('0x22')](_0x0eeb('0x20'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x23')]);router[_0x0eeb('0x22')](_0x0eeb('0x15'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x24')]);router[_0x0eeb('0x22')](_0x0eeb('0xc'),auth[_0x0eeb('0x8')](),controller['removeAnswers']);router['delete'](_0x0eeb('0x12'),auth[_0x0eeb('0x8')](),controller[_0x0eeb('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index b4d62f2..a52a11e 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 _0x3454=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','generate','TEXT'];(function(_0x513447,_0x1575c8){var _0x166d49=function(_0x48784f){while(--_0x48784f){_0x513447['push'](_0x513447['shift']());}};_0x166d49(++_0x1575c8);}(_0x3454,0x13f));var _0x4345=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3454[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4345('0x0'));var rs=require('randomstring');module[_0x4345('0x1')]={'name':{'type':Sequelize[_0x4345('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4345('0x2')]},'token':{'type':Sequelize[_0x4345('0x2')],'defaultValue':function(){return rs[_0x4345('0x3')]();}},'replyUri':{'type':Sequelize[_0x4345('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4345('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4345('0x4')],'defaultValue':function(){return _0x4345('0x5');}},'notificationSound':{'type':Sequelize[_0x4345('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4345('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4345('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4345('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4345('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4345('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4345('0x6')],'defaultValue':![],'comment':_0x4345('0x8'),'set':function(_0x2b0252){if(!_0x2b0252)this['setDataValue'](_0x4345('0x9'),null);this[_0x4345('0xa')](_0x4345('0xb'),_0x2b0252);}}}; \ No newline at end of file +var _0xe5ef=['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','sequelize','randomstring','exports','name','STRING'];(function(_0x1aef60,_0x43bcac){var _0xf7e950=function(_0x4bbfb9){while(--_0x4bbfb9){_0x1aef60['push'](_0x1aef60['shift']());}};_0xf7e950(++_0x43bcac);}(_0xe5ef,0x8b));var _0xfe5e=function(_0x28f8e0,_0x409588){_0x28f8e0=_0x28f8e0-0x0;var _0x24b34b=_0xe5ef[_0x28f8e0];return _0x24b34b;};'use strict';var Sequelize=require(_0xfe5e('0x0'));var rs=require(_0xfe5e('0x1'));module[_0xfe5e('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xfe5e('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xfe5e('0x4')]},'token':{'type':Sequelize[_0xfe5e('0x4')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xfe5e('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfe5e('0x5')],'defaultValue':function(){return _0xfe5e('0x6');}},'notificationSound':{'type':Sequelize[_0xfe5e('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfe5e('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfe5e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xfe5e('0x4')]},'queueTransfer':{'type':Sequelize[_0xfe5e('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfe5e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfe5e('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfe5e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfe5e('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xfe5e('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xfe5e('0x7')],'defaultValue':![],'comment':_0xfe5e('0xa'),'set':function(_0xa51db2){if(!_0xa51db2)this[_0xfe5e('0xb')]('mandatoryDispositionPauseId',null);this[_0xfe5e('0xb')]('mandatoryDisposition',_0xa51db2);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index f71fb63..b9c1db1 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 _0x682a=['../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','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','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','OpenchannelAccounts','UserProfileResource','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','Disposition','getDispositions','findOne','OpenchannelAccountId','filter','removeDispositions','ids','addAnswer','CannedAnswer','length','removeAnswers','notify','difference','createdAt','updatedAt','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','from','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','spread','contact','messageId','interaction','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','transaction','bulkCreate','findAndCountAll','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x197def,_0x5371d5){var _0x48a801=function(_0x1e7863){while(--_0x1e7863){_0x197def['push'](_0x197def['shift']());}};_0x48a801(++_0x5371d5);}(_0x682a,0xa2));var _0xa682=function(_0x4ada1d,_0x49a6b6){_0x4ada1d=_0x4ada1d-0x0;var _0x211d65=_0x682a[_0x4ada1d];return _0x211d65;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa682('0x0'));var rimraf=require(_0xa682('0x1'));var zipdir=require(_0xa682('0x2'));var jsonpatch=require(_0xa682('0x3'));var rp=require(_0xa682('0x4'));var moment=require(_0xa682('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa682('0x6'));var util=require(_0xa682('0x7'));var path=require('path');var sox=require(_0xa682('0x8'));var csv=require(_0xa682('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa682('0xa'));var crypto=require('crypto');var jsforce=require(_0xa682('0xb'));var deskjs=require(_0xa682('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa682('0xd'));var Papa=require(_0xa682('0xe'));var Redis=require('ioredis');var authService=require(_0xa682('0xf'));var qs=require(_0xa682('0x10'));var as=require(_0xa682('0x11'));var hardwareService=require(_0xa682('0x12'));var logger=require('../../config/logger')(_0xa682('0x13'));var utils=require(_0xa682('0x14'));var config=require('../../config/environment');var db=require(_0xa682('0x15'))['db'];config[_0xa682('0x16')]=_[_0xa682('0x17')](config['redis'],{'host':_0xa682('0x18'),'port':0x18eb});var socket=require(_0xa682('0x19'))(new Redis(config[_0xa682('0x16')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xa682('0x1a')]({'port':0x232c});var client9002=jayson[_0xa682('0x1b')][_0xa682('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x4a7967,_0x284e9a,_0xc043ac){if(_0xc043ac){var _0x441793=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x441793[_0xa682('0x1c')](_0x284e9a)){return _0x4a7967;}else{throw new db[(_0xa682('0x1d'))][(_0xa682('0x1e'))](_0xa682('0x1f'));}}else{return _0x4a7967;}}function respondWithRpcPromise(_0x434e98,_0x8af83c,_0x4e282d,_0x4825c2){return new BPromise(function(_0x8dda01,_0x54e0e7){var _0xd8fb3a=_0x4825c2||client;return _0xd8fb3a['request'](_0x434e98,_0x4e282d)['then'](function(_0x1075f1){logger[_0xa682('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x8af83c,_0xa682('0x21'));logger[_0xa682('0x22')](_0xa682('0x23'),_0x8af83c,'request\x20sent',JSON['stringify'](_0x1075f1));if(_0x1075f1[_0xa682('0x24')]){if(_0x1075f1['error'][_0xa682('0x25')]===0x1f4){logger[_0xa682('0x24')](_0xa682('0x26'),_0x8af83c,_0x1075f1[_0xa682('0x24')][_0xa682('0x27')]);return _0x54e0e7(_0x1075f1[_0xa682('0x24')][_0xa682('0x27')]);}logger[_0xa682('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x8af83c,_0x1075f1[_0xa682('0x24')][_0xa682('0x27')]);return _0x8dda01(_0x1075f1[_0xa682('0x24')][_0xa682('0x27')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x8af83c,_0xa682('0x21'));_0x8dda01(_0x1075f1['result'][_0xa682('0x27')]);}})[_0xa682('0x28')](function(_0x54d969){logger[_0xa682('0x24')](_0xa682('0x26'),_0x8af83c,_0x54d969);_0x54e0e7(_0x54d969);});});}function respondWithStatusCode(_0x251a56,_0x2609c5){_0x2609c5=_0x2609c5||0xcc;return function(_0x18c949){if(_0x18c949){return _0x251a56['sendStatus'](_0x2609c5);}return _0x251a56[_0xa682('0x29')](_0x2609c5)[_0xa682('0x2a')]();};}function respondWithResult(_0x4f58c8,_0x57d6f7){_0x57d6f7=_0x57d6f7||0xc8;return function(_0x3a07ca){if(_0x3a07ca){return _0x4f58c8[_0xa682('0x29')](_0x57d6f7)[_0xa682('0x2b')](_0x3a07ca);}};}function respondWithFilteredResult(_0x45eda2,_0x3dc95e){return function(_0x4e47e7){if(_0x4e47e7){var _0x2b8d5b=_0x4e47e7[_0xa682('0x2c')],_0x5a5cd3=_0x3dc95e[_0xa682('0x2d')],_0x133ab6=_0x3dc95e[_0xa682('0x2d')]+_0x3dc95e[_0xa682('0x2e')],_0x3d8e35;if(_0x133ab6>=_0x2b8d5b){_0x133ab6=_0x2b8d5b;_0x3d8e35=0xc8;}else{_0x3d8e35=0xce;}_0x45eda2[_0xa682('0x29')](_0x3d8e35);return _0x45eda2['set'](_0xa682('0x2f'),_0x5a5cd3+'-'+_0x133ab6+'/'+_0x2b8d5b)[_0xa682('0x2b')](_0x4e47e7);}return null;};}function patchUpdates(_0x166fdb){return function(_0x56f626){try{jsonpatch[_0xa682('0x30')](_0x56f626,_0x166fdb,!![]);}catch(_0x432d1c){return BPromise[_0xa682('0x31')](_0x432d1c);}return _0x56f626[_0xa682('0x32')]();};}function saveUpdates(_0x221fcb,_0x3298c2){return function(_0x3502f9){if(_0x3502f9){return _0x3502f9[_0xa682('0x33')](_0x221fcb)[_0xa682('0x34')](function(_0x4ab0b3){return _0x4ab0b3;});}return null;};}function removeEntity(_0x15e5cd,_0x4d9f95){return function(_0x52288e){if(_0x52288e){return _0x52288e[_0xa682('0x35')]()[_0xa682('0x34')](function(){var _0x580875=_0x52288e['get']({'plain':!![]});var _0x150f0f=_0xa682('0x36');return db[_0xa682('0x37')][_0xa682('0x35')]({'where':{'type':_0x150f0f,'resourceId':_0x580875['id']}})[_0xa682('0x34')](function(){return _0x52288e;});})['then'](function(){_0x15e5cd[_0xa682('0x29')](0xcc)[_0xa682('0x2a')]();});}};}function handleEntityNotFound(_0x53133f,_0x5538bf){return function(_0x353504){if(!_0x353504){_0x53133f[_0xa682('0x38')](0x194);}return _0x353504;};}function handleError(_0x53d9fe,_0x592d95){_0x592d95=_0x592d95||0x1f4;return function(_0x576cf0){logger[_0xa682('0x24')](_0x576cf0['stack']);if(_0x576cf0[_0xa682('0x39')]){delete _0x576cf0[_0xa682('0x39')];}_0x53d9fe[_0xa682('0x29')](_0x592d95)[_0xa682('0x3a')](_0x576cf0);};}exports[_0xa682('0x3b')]=function(_0x37daf2,_0x1d9881){var _0x18f151={'include':[{'model':db[_0xa682('0x3c')],'as':_0xa682('0x3d')}]},_0x4b7ce5={},_0xbd49db={'count':0x0,'rows':[]};var _0x3065e7=_[_0xa682('0x3e')](db[_0xa682('0x3f')]['rawAttributes'],function(_0x36c941){return{'name':_0x36c941[_0xa682('0x40')],'type':_0x36c941['type'][_0xa682('0x41')]};});_0x4b7ce5[_0xa682('0x42')]=_[_0xa682('0x3e')](_0x3065e7,_0xa682('0x39'));_0x4b7ce5[_0xa682('0x43')]=_[_0xa682('0x44')](_0x37daf2[_0xa682('0x43')]);_0x4b7ce5[_0xa682('0x45')]=_['intersection'](_0x4b7ce5['model'],_0x4b7ce5['query']);_0x18f151[_0xa682('0x46')]=_['intersection'](_0x4b7ce5['model'],qs[_0xa682('0x47')](_0x37daf2[_0xa682('0x43')]['fields']));_0x18f151['attributes']=_0x18f151[_0xa682('0x46')]['length']?_0x18f151[_0xa682('0x46')]:_0x4b7ce5[_0xa682('0x42')];if(!_0x37daf2[_0xa682('0x43')][_0xa682('0x48')](_0xa682('0x49'))){_0x18f151['limit']=qs[_0xa682('0x2e')](_0x37daf2[_0xa682('0x43')]['limit']);_0x18f151[_0xa682('0x2d')]=qs[_0xa682('0x2d')](_0x37daf2[_0xa682('0x43')][_0xa682('0x2d')]);}_0x18f151[_0xa682('0x4a')]=qs[_0xa682('0x4b')](_0x37daf2[_0xa682('0x43')][_0xa682('0x4b')]);_0x18f151[_0xa682('0x4c')]=qs[_0xa682('0x45')](_[_0xa682('0x4d')](_0x37daf2[_0xa682('0x43')],_0x4b7ce5[_0xa682('0x45')]));if(_0x37daf2[_0xa682('0x43')]['filter']){_0x18f151[_0xa682('0x4c')]=_['merge'](_0x18f151[_0xa682('0x4c')],{'$or':_[_0xa682('0x3e')](_0x3065e7,function(_0x54337a){if(_0x54337a['type']!==_0xa682('0x4e')){var _0x4bc092={};_0x4bc092[_0x54337a['name']]={'$like':'%'+_0x37daf2[_0xa682('0x43')]['filter']+'%'};return _0x4bc092;}})});}_0x18f151=_[_0xa682('0x4f')]({},_0x18f151,_0x37daf2[_0xa682('0x50')]);var _0x7fb3d3={'where':_0x18f151[_0xa682('0x4c')]};return db[_0xa682('0x3f')][_0xa682('0x2c')](_0x7fb3d3)[_0xa682('0x34')](function(_0x6aba34){_0xbd49db[_0xa682('0x2c')]=_0x6aba34;if(_0x37daf2[_0xa682('0x43')][_0xa682('0x51')]){_0x18f151[_0xa682('0x52')]=[{'all':!![]}];}return db[_0xa682('0x3f')][_0xa682('0x53')](_0x18f151);})[_0xa682('0x34')](function(_0x419ddb){_0xbd49db[_0xa682('0x54')]=_0x419ddb;return _0xbd49db;})[_0xa682('0x34')](respondWithFilteredResult(_0x1d9881,_0x18f151))[_0xa682('0x28')](handleError(_0x1d9881,null));};exports[_0xa682('0x55')]=function(_0x176ead,_0x9e57d0){var _0x4b07d1={'raw':![],'where':{'id':_0x176ead[_0xa682('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xa682('0x3d')}]},_0x3ee49b={};_0x3ee49b[_0xa682('0x42')]=_[_0xa682('0x44')](db['OpenchannelAccount'][_0xa682('0x57')]);_0x3ee49b['query']=_['keys'](_0x176ead[_0xa682('0x43')]);_0x3ee49b['filters']=_[_0xa682('0x58')](_0x3ee49b[_0xa682('0x42')],_0x3ee49b[_0xa682('0x43')]);_0x4b07d1[_0xa682('0x46')]=_['intersection'](_0x3ee49b['model'],qs[_0xa682('0x47')](_0x176ead[_0xa682('0x43')]['fields']));_0x4b07d1['attributes']=_0x4b07d1[_0xa682('0x46')]['length']?_0x4b07d1[_0xa682('0x46')]:_0x3ee49b[_0xa682('0x42')];if(_0x176ead[_0xa682('0x43')][_0xa682('0x51')]){_0x4b07d1[_0xa682('0x52')]=[{'all':!![]}];}_0x4b07d1=_[_0xa682('0x4f')]({},_0x4b07d1,_0x176ead[_0xa682('0x50')]);return db[_0xa682('0x3f')][_0xa682('0x59')](_0x4b07d1)['then'](handleEntityNotFound(_0x9e57d0,null))['then'](respondWithResult(_0x9e57d0,null))['catch'](handleError(_0x9e57d0,null));};exports[_0xa682('0x5a')]=function(_0x36c1f2,_0xa94f11){return db['OpenchannelAccount'][_0xa682('0x5a')](_0x36c1f2['body'],{})['then'](function(_0x3b497f){var _0x328287=_0x36c1f2['user'][_0xa682('0x5b')]({'plain':!![]});if(!_0x328287)throw new Error(_0xa682('0x5c'));if(_0x328287[_0xa682('0x5d')]===_0xa682('0x5e')){var _0x5dbdb1=_0x3b497f['get']({'plain':!![]});var _0x3e220c=_0xa682('0x36');return db[_0xa682('0x5f')][_0xa682('0x59')]({'where':{'name':_0x3e220c,'userProfileId':_0x328287[_0xa682('0x60')]},'raw':!![]})[_0xa682('0x34')](function(_0x4f752e){if(_0x4f752e&&_0x4f752e['autoAssociation']===0x0){return db[_0xa682('0x37')][_0xa682('0x5a')]({'name':_0x5dbdb1['name'],'resourceId':_0x5dbdb1['id'],'type':_0x4f752e[_0xa682('0x39')],'sectionId':_0x4f752e['id']},{})[_0xa682('0x34')](function(){return _0x3b497f;});}else{return _0x3b497f;}})['catch'](function(_0x5104bf){logger[_0xa682('0x24')](_0xa682('0x61'),_0x5104bf);throw _0x5104bf;});}return _0x3b497f;})[_0xa682('0x34')](respondWithResult(_0xa94f11,0xc9))[_0xa682('0x28')](handleError(_0xa94f11,null));};exports[_0xa682('0x33')]=function(_0x36d97f,_0xe0e705){if(_0x36d97f[_0xa682('0x62')]['id']){delete _0x36d97f[_0xa682('0x62')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x36d97f[_0xa682('0x56')]['id']},'include':[{'model':db[_0xa682('0x3c')],'as':_0xa682('0x3d')}]})[_0xa682('0x34')](handleEntityNotFound(_0xe0e705,null))[_0xa682('0x34')](saveUpdates(_0x36d97f[_0xa682('0x62')],null))[_0xa682('0x34')](respondWithResult(_0xe0e705,null))[_0xa682('0x28')](handleError(_0xe0e705,null));};exports[_0xa682('0x35')]=function(_0x27c8ff,_0x18cc49){return db[_0xa682('0x3f')][_0xa682('0x59')]({'where':{'id':_0x27c8ff[_0xa682('0x56')]['id']}})[_0xa682('0x34')](handleEntityNotFound(_0x18cc49,null))['then'](removeEntity(_0x18cc49,null))[_0xa682('0x28')](handleError(_0x18cc49,null));};exports[_0xa682('0x63')]=function(_0x3ff133,_0x516e1e){return db[_0xa682('0x3f')][_0xa682('0x63')]()[_0xa682('0x34')](respondWithResult(_0x516e1e,null))[_0xa682('0x28')](handleError(_0x516e1e,null));};exports['addDisposition']=function(_0x4efa72,_0x107ac8,_0x3908a6){if(_0x4efa72['body']['id']){delete _0x4efa72['body']['id'];}return db['OpenchannelAccount'][_0xa682('0x59')]({'where':{'id':_0x4efa72[_0xa682('0x56')]['id']}})['then'](handleEntityNotFound(_0x107ac8,null))[_0xa682('0x34')](function(_0x5f3041){if(_0x5f3041){_0x4efa72[_0xa682('0x62')]['OpnechannelAccountId']=_0x5f3041['id'];return db[_0xa682('0x64')][_0xa682('0x5a')](_0x4efa72[_0xa682('0x62')]);}})[_0xa682('0x34')](respondWithResult(_0x107ac8,null))[_0xa682('0x28')](handleError(_0x107ac8,null));};exports[_0xa682('0x65')]=function(_0x26fa1b,_0x5bd730,_0x467316){var _0x2dbea8={'raw':![],'where':{}};var _0x31f7f1={};var _0x135657={'count':0x0,'rows':[]};return db[_0xa682('0x3f')][_0xa682('0x66')]({'where':{'id':_0x26fa1b[_0xa682('0x56')]['id']}})['then'](handleEntityNotFound(_0x5bd730,null))['then'](function(_0x3e2892){if(_0x3e2892){_0x31f7f1[_0xa682('0x42')]=_[_0xa682('0x44')](db['Disposition'][_0xa682('0x57')]);_0x31f7f1[_0xa682('0x43')]=_[_0xa682('0x44')](_0x26fa1b[_0xa682('0x43')]);_0x31f7f1['filters']=_[_0xa682('0x58')](_0x31f7f1[_0xa682('0x42')],_0x31f7f1[_0xa682('0x43')]);_0x2dbea8[_0xa682('0x46')]=_[_0xa682('0x58')](_0x31f7f1['model'],qs['fields'](_0x26fa1b['query'][_0xa682('0x47')]));_0x2dbea8['attributes']=_0x2dbea8[_0xa682('0x46')]['length']?_0x2dbea8[_0xa682('0x46')]:_0x31f7f1[_0xa682('0x42')];if(!_0x26fa1b['query']['hasOwnProperty'](_0xa682('0x49'))){_0x2dbea8[_0xa682('0x2e')]=qs[_0xa682('0x2e')](_0x26fa1b[_0xa682('0x43')][_0xa682('0x2e')]);_0x2dbea8[_0xa682('0x2d')]=qs['offset'](_0x26fa1b['query'][_0xa682('0x2d')]);}_0x2dbea8[_0xa682('0x4a')]=qs[_0xa682('0x4b')](_0x26fa1b['query'][_0xa682('0x4b')]);_0x2dbea8[_0xa682('0x4c')]=qs[_0xa682('0x45')](_['pick'](_0x26fa1b[_0xa682('0x43')],_0x31f7f1[_0xa682('0x45')]));_0x2dbea8[_0xa682('0x4c')][_0xa682('0x67')]=_0x3e2892['id'];if(_0x26fa1b['query']['filter']){_0x2dbea8[_0xa682('0x4c')]=_[_0xa682('0x4f')](_0x2dbea8[_0xa682('0x4c')],{'$or':_['map'](_0x2dbea8[_0xa682('0x46')],function(_0x1e122e){var _0x4f244d={};_0x4f244d[_0x1e122e]={'$like':'%'+_0x26fa1b['query'][_0xa682('0x68')]+'%'};return _0x4f244d;})});}_0x2dbea8=_[_0xa682('0x4f')]({},_0x2dbea8,_0x26fa1b[_0xa682('0x50')]);return db['Disposition'][_0xa682('0x2c')]({'where':_0x2dbea8[_0xa682('0x4c')]})[_0xa682('0x34')](function(_0x4b3b23){_0x135657[_0xa682('0x2c')]=_0x4b3b23;if(_0x26fa1b[_0xa682('0x43')][_0xa682('0x51')]){_0x2dbea8[_0xa682('0x52')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2dbea8);})[_0xa682('0x34')](function(_0x52a895){_0x135657[_0xa682('0x54')]=_0x52a895;return _0x135657;});}})['then'](respondWithFilteredResult(_0x5bd730,_0x2dbea8))[_0xa682('0x28')](handleError(_0x5bd730,null));};exports['removeDispositions']=function(_0x4b9f1c,_0x1df4ab,_0x1804ae){return db[_0xa682('0x3f')][_0xa682('0x59')]({'where':{'id':_0x4b9f1c[_0xa682('0x56')]['id']}})[_0xa682('0x34')](handleEntityNotFound(_0x1df4ab,null))[_0xa682('0x34')](function(_0x872d7a){if(_0x872d7a){return _0x872d7a[_0xa682('0x69')](_0x4b9f1c[_0xa682('0x43')][_0xa682('0x6a')]);}})['then'](respondWithStatusCode(_0x1df4ab,null))[_0xa682('0x28')](handleError(_0x1df4ab,null));};exports[_0xa682('0x6b')]=function(_0x31eecd,_0x320011,_0x33d024){if(_0x31eecd[_0xa682('0x62')]['id']){delete _0x31eecd[_0xa682('0x62')]['id'];}return db[_0xa682('0x3f')][_0xa682('0x59')]({'where':{'id':_0x31eecd['params']['id']}})[_0xa682('0x34')](handleEntityNotFound(_0x320011,null))['then'](function(_0x54bca7){if(_0x54bca7){_0x31eecd[_0xa682('0x62')][_0xa682('0x67')]=_0x54bca7['id'];return db[_0xa682('0x6c')]['create'](_0x31eecd[_0xa682('0x62')]);}})[_0xa682('0x34')](respondWithResult(_0x320011,null))[_0xa682('0x28')](handleError(_0x320011,null));};exports['getAnswers']=function(_0x190ad3,_0x49d4fe,_0x19364b){var _0x4ddc5a={'raw':![],'where':{}};var _0x314908={};var _0x432491={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa682('0x66')]({'where':{'id':_0x190ad3['params']['id']}})[_0xa682('0x34')](handleEntityNotFound(_0x49d4fe,null))[_0xa682('0x34')](function(_0x1d817a){if(_0x1d817a){_0x314908[_0xa682('0x42')]=_[_0xa682('0x44')](db[_0xa682('0x6c')][_0xa682('0x57')]);_0x314908[_0xa682('0x43')]=_[_0xa682('0x44')](_0x190ad3[_0xa682('0x43')]);_0x314908[_0xa682('0x45')]=_[_0xa682('0x58')](_0x314908[_0xa682('0x42')],_0x314908['query']);_0x4ddc5a[_0xa682('0x46')]=_[_0xa682('0x58')](_0x314908[_0xa682('0x42')],qs[_0xa682('0x47')](_0x190ad3[_0xa682('0x43')][_0xa682('0x47')]));_0x4ddc5a[_0xa682('0x46')]=_0x4ddc5a['attributes'][_0xa682('0x6d')]?_0x4ddc5a[_0xa682('0x46')]:_0x314908[_0xa682('0x42')];if(!_0x190ad3[_0xa682('0x43')][_0xa682('0x48')](_0xa682('0x49'))){_0x4ddc5a['limit']=qs[_0xa682('0x2e')](_0x190ad3['query'][_0xa682('0x2e')]);_0x4ddc5a['offset']=qs[_0xa682('0x2d')](_0x190ad3[_0xa682('0x43')][_0xa682('0x2d')]);}_0x4ddc5a[_0xa682('0x4a')]=qs[_0xa682('0x4b')](_0x190ad3[_0xa682('0x43')][_0xa682('0x4b')]);_0x4ddc5a[_0xa682('0x4c')]=qs['filters'](_[_0xa682('0x4d')](_0x190ad3[_0xa682('0x43')],_0x314908[_0xa682('0x45')]));_0x4ddc5a[_0xa682('0x4c')][_0xa682('0x67')]=_0x1d817a['id'];if(_0x190ad3[_0xa682('0x43')][_0xa682('0x68')]){_0x4ddc5a[_0xa682('0x4c')]=_[_0xa682('0x4f')](_0x4ddc5a[_0xa682('0x4c')],{'$or':_[_0xa682('0x3e')](_0x4ddc5a[_0xa682('0x46')],function(_0x31123b){var _0x847490={};_0x847490[_0x31123b]={'$like':'%'+_0x190ad3['query'][_0xa682('0x68')]+'%'};return _0x847490;})});}_0x4ddc5a=_[_0xa682('0x4f')]({},_0x4ddc5a,_0x190ad3['options']);return db['CannedAnswer'][_0xa682('0x2c')]({'where':_0x4ddc5a[_0xa682('0x4c')]})['then'](function(_0xf0ce9f){_0x432491[_0xa682('0x2c')]=_0xf0ce9f;if(_0x190ad3['query'][_0xa682('0x51')]){_0x4ddc5a[_0xa682('0x52')]=[{'all':!![]}];}return db[_0xa682('0x6c')][_0xa682('0x53')](_0x4ddc5a);})['then'](function(_0x4d5835){_0x432491[_0xa682('0x54')]=_0x4d5835;return _0x432491;});}})[_0xa682('0x34')](respondWithFilteredResult(_0x49d4fe,_0x4ddc5a))[_0xa682('0x28')](handleError(_0x49d4fe,null));};exports[_0xa682('0x6e')]=function(_0xb5392f,_0x514b9b,_0xd23567){return db['OpenchannelAccount'][_0xa682('0x59')]({'where':{'id':_0xb5392f[_0xa682('0x56')]['id']}})['then'](handleEntityNotFound(_0x514b9b,null))[_0xa682('0x34')](function(_0xaa9b22){if(_0xaa9b22){return _0xaa9b22[_0xa682('0x6e')](_0xb5392f[_0xa682('0x43')][_0xa682('0x6a')]);}})['then'](respondWithStatusCode(_0x514b9b,null))[_0xa682('0x28')](handleError(_0x514b9b,null));};exports[_0xa682('0x6f')]=function(_0x5d1c4b,_0x3c67d1,_0x2b1e7f){var _0x2bc171={'body':_0x5d1c4b[_0xa682('0x62')],'channel':'openchannel'};var _0x111da4=[];var _0x135ba5=[];var _0x334390={};var _0x4fbb64=![];return db['CmContact'][_0xa682('0x63')]()[_0xa682('0x34')](function(_0x2ea4ee){if(!_0x2ea4ee){throw new db['Sequelize'][(_0xa682('0x1e'))]('no\x20available\x20attributes');}_0x111da4=_[_0xa682('0x70')](_[_0xa682('0x44')](_0x2ea4ee),[_0xa682('0x71'),_0xa682('0x72')]);_0x135ba5=_[_0xa682('0x70')](_[_0xa682('0x44')](_0x2ea4ee),[_0xa682('0x71'),_0xa682('0x72'),'CompanyId',_0xa682('0x73')]);if(_0x5d1c4b[_0xa682('0x62')]['id']){delete _0x5d1c4b[_0xa682('0x62')]['id'];}if(_[_0xa682('0x74')](_0x5d1c4b['body']['from'])){throw new db[(_0xa682('0x1d'))][(_0xa682('0x1e'))](_0xa682('0x75'));}if(_[_0xa682('0x74')](_0x5d1c4b['body'][_0xa682('0x62')])||_0x5d1c4b[_0xa682('0x62')][_0xa682('0x62')]===''){throw new db['Sequelize']['ValidationError'](_0xa682('0x76'));}if(_[_0xa682('0x74')](_0x5d1c4b[_0xa682('0x62')]['mapKey'])){throw new db[(_0xa682('0x1d'))][(_0xa682('0x1e'))](_0xa682('0x77')+_0x135ba5);}if(!_[_0xa682('0x78')](_0x135ba5,_0x5d1c4b[_0xa682('0x62')][_0xa682('0x79')])){throw new db[(_0xa682('0x1d'))][(_0xa682('0x1e'))](_0xa682('0x7a')+_0x135ba5);}_0x334390[_0x5d1c4b[_0xa682('0x62')]['mapKey']]=_0x5d1c4b[_0xa682('0x62')]['from'];})[_0xa682('0x34')](function(){return db[_0xa682('0x3f')]['find']({'where':{'id':_0x5d1c4b[_0xa682('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xa682('0x7b'),'include':[{'model':db[_0xa682('0x7c')],'as':_0xa682('0x7d'),'where':_0x334390,'limit':0x1,'order':[[_0xa682('0x72'),'DESC']]}]},{'model':db[_0xa682('0x7e')],'as':_0xa682('0x7f')}]});})[_0xa682('0x34')](handleEntityNotFound(_0x3c67d1,null))[_0xa682('0x34')](function(_0xea628d){if(_0xea628d&&_0xea628d[_0xa682('0x7b')]){_0x2bc171[_0xa682('0x80')]=_0xea628d;_0x2bc171[_0xa682('0x81')]=_0xea628d[_0xa682('0x7f')];_0x2bc171[_0xa682('0x82')]=_0xea628d[_0xa682('0x7b')];_0x2bc171[_0xa682('0x81')]=_[_0xa682('0x83')](_0x2bc171[_0xa682('0x81')],[_0xa682('0x84')],[_0xa682('0x85')]);if(_0x2bc171['account'][_0xa682('0x7f')]){delete _0x2bc171[_0xa682('0x80')]['Applications'];}if(_0x2bc171[_0xa682('0x80')][_0xa682('0x7b')]&&_0x2bc171[_0xa682('0x80')][_0xa682('0x7b')][_0xa682('0x7d')][_0xa682('0x6d')]){return _0x2bc171[_0xa682('0x80')][_0xa682('0x7b')][_0xa682('0x7d')][0x0];}var _0x7e5517=_[_0xa682('0x17')](_0x5d1c4b['body'],{'firstName':_0x5d1c4b[_0xa682('0x62')][_0xa682('0x86')],'ListId':_0xea628d[_0xa682('0x73')]});_0x7e5517[_0x5d1c4b[_0xa682('0x62')][_0xa682('0x79')]]=_0x5d1c4b['body'][_0xa682('0x86')];return db['CmContact'][_0xa682('0x5a')](_0x7e5517,{'fields':_0x111da4,'raw':!![]});}})[_0xa682('0x34')](handleEntityNotFound(_0x3c67d1,null))[_0xa682('0x34')](function(_0x49e0fb){_0x2bc171['contact']=_0x49e0fb;if(_0x49e0fb){var _0x580d1e={'ContactId':_0x49e0fb['id'],'OpenchannelAccountId':_0x5d1c4b[_0xa682('0x56')]['id'],'from':(_0x49e0fb[_0xa682('0x87')]||'')+'\x20'+(_0x49e0fb[_0xa682('0x88')]||'')};var _0x570926={'OpenchannelAccountId':_0x5d1c4b[_0xa682('0x56')]['id'],'closed':![]};if(_0x5d1c4b[_0xa682('0x62')][_0xa682('0x89')]){_0x570926[_0xa682('0x89')]=_0x5d1c4b[_0xa682('0x62')]['threadId'];return db['OpenchannelInteraction'][_0xa682('0x59')]({'where':_0x570926})[_0xa682('0x34')](function(_0x4127fb){if(_0x4127fb){return[_0x4127fb,![]];}_0x580d1e[_0xa682('0x89')]=_0x5d1c4b['body']['threadId'];_0x580d1e[_0xa682('0x8a')]=_0x5d1c4b['body'][_0xa682('0x8a')];return db[_0xa682('0x8b')]['create'](_0x580d1e)[_0xa682('0x34')](function(_0x7ea933){return[_0x7ea933,!![]];});});}else{_0x570926['threadId']=null;}_0x570926['ContactId']=_0x49e0fb['id'];return db[_0xa682('0x8b')]['find']({'where':_0x570926})['then'](function(_0x361b44){if(_0x361b44){return[_0x361b44,![]];}return db['OpenchannelInteraction'][_0xa682('0x5a')](_0x580d1e)['then'](function(_0x23c787){return[_0x23c787,!![]];});});}})[_0xa682('0x8c')](function(_0x34fdd1,_0x4f5c74){if(_0x34fdd1){_0x4fbb64=_0x4f5c74;if(!_0x4f5c74){var _0x69f4c2={'from':(_0x2bc171[_0xa682('0x8d')]['firstName']||'')+'\x20'+(_0x2bc171[_0xa682('0x8d')][_0xa682('0x88')]||'')};if(_0x5d1c4b[_0xa682('0x62')]['threadId']&&_0x5d1c4b[_0xa682('0x62')][_0xa682('0x8e')]&&_0x5d1c4b[_0xa682('0x62')]['threadId']!=_0x5d1c4b[_0xa682('0x62')]['messageId']){_0x69f4c2[_0xa682('0x89')]=_0x5d1c4b[_0xa682('0x62')][_0xa682('0x8e')];}return _0x34fdd1[_0xa682('0x33')](_0x69f4c2);}else{return _0x34fdd1;}}})['then'](function(_0x5f5138){_0x2bc171[_0xa682('0x8f')]=_0x5f5138[_0xa682('0x5b')]({'plain':!![]});_0x2bc171['interaction']['created']=_0x4fbb64;if(_0x2bc171[_0xa682('0x8f')]['created']){if(_0x2bc171[_0xa682('0x80')]['autoclose']){_0x2bc171[_0xa682('0x81')][_0xa682('0x90')]({'id':0x0,'priority':_0x2bc171[_0xa682('0x81')]['length']+0x1,'app':_0xa682('0x91'),'appdata':'unmanaged','interval':_0xa682('0x92')});}}return db[_0xa682('0x93')][_0xa682('0x5a')]({'body':_0x5d1c4b[_0xa682('0x62')][_0xa682('0x62')],'OpenchannelAccountId':_0x5d1c4b[_0xa682('0x56')]['id'],'OpenchannelInteractionId':_0x5f5138['id'],'direction':'in','ContactId':_0x2bc171[_0xa682('0x8d')]['id'],'AttachmentId':_0x5d1c4b[_0xa682('0x62')][_0xa682('0x94')]});})[_0xa682('0x34')](function(_0x17baa5){_0x2bc171['message']=_0x17baa5;if(_0x2bc171[_0xa682('0x8f')]['UserId']){return db[_0xa682('0x95')][_0xa682('0x59')]({'attributes':['id',_0xa682('0x39')],'where':{'id':_0x2bc171[_0xa682('0x8f')][_0xa682('0x96')]}})[_0xa682('0x34')](function(_0x53de80){if(_0x53de80){_0x2bc171[_0xa682('0x81')][_0xa682('0x97')]({'id':0x0,'priority':0x0,'app':_0xa682('0x98'),'appdata':_0x53de80[_0xa682('0x39')]+','+(_0x2bc171['account'][_0xa682('0x99')]||0xa),'interval':'*,*,*,*'});_0x2bc171[_0xa682('0x9a')]=![];}return respondWithRpcPromise(_0xa682('0x9b'),_0xa682('0x9c'),_0x2bc171);});}return respondWithRpcPromise(_0xa682('0x9b'),_0xa682('0x9c'),_0x2bc171);})[_0xa682('0x34')](function(_0x1cd0f5){respondWithRpcPromise(_0xa682('0x9d'),_0xa682('0x9d'),{'event':_0xa682('0x6f'),'message':_0x1cd0f5},client9002);return _0x1cd0f5;})[_0xa682('0x34')](respondWithResult(_0x3c67d1,null))[_0xa682('0x28')](handleError(_0x3c67d1,null));};exports['addApplications']=function(_0xd24a43,_0x2fb0bf,_0x52313c){return db[_0xa682('0x3f')]['findOne']({'where':{'id':_0xd24a43[_0xa682('0x56')]['id']}})['then'](handleEntityNotFound(_0x2fb0bf,null))['then'](function(_0x346478){if(_0x346478){return db['sequelize'][_0xa682('0x9e')](function(_0x3294b3){return db[_0xa682('0x7e')][_0xa682('0x35')]({'where':{'OpenchannelAccountId':_0xd24a43[_0xa682('0x56')]['id']},'transaction':_0x3294b3})[_0xa682('0x34')](function(_0x7e7f3c){var _0x52ec37=_[_0xa682('0x3e')](_0xd24a43[_0xa682('0x62')],function(_0x4f0d0d){_0x4f0d0d[_0xa682('0x67')]=_0xd24a43[_0xa682('0x56')]['id'];return _0x4f0d0d;});return db['OpenchannelApplication'][_0xa682('0x9f')](_0x52ec37,{'transaction':_0x3294b3});});})['then'](function(){return db[_0xa682('0x7e')][_0xa682('0xa0')]({'where':{'OpenchannelAccountId':_0xd24a43[_0xa682('0x56')]['id']},'order':_0xa682('0x84')});});}})[_0xa682('0x34')](respondWithResult(_0x2fb0bf,null))[_0xa682('0x28')](handleError(_0x2fb0bf,null));};exports['getApplications']=function(_0x1db1c4,_0x32e838,_0x475636){var _0x2d58a4={};var _0x1d2f5d={};var _0x37af42;var _0xf1afa8;return db[_0xa682('0x3f')]['findOne']({'where':{'id':_0x1db1c4[_0xa682('0x56')]['id']}})[_0xa682('0x34')](handleEntityNotFound(_0x32e838,null))[_0xa682('0x34')](function(_0x2e5b3f){if(_0x2e5b3f){_0x37af42=_0x2e5b3f;_0x1d2f5d[_0xa682('0x42')]=_['keys'](db['OpenchannelApplication'][_0xa682('0x57')]);_0x1d2f5d[_0xa682('0x43')]=_[_0xa682('0x44')](_0x1db1c4[_0xa682('0x43')]);_0x1d2f5d[_0xa682('0x45')]=_[_0xa682('0x58')](_0x1d2f5d[_0xa682('0x42')],_0x1d2f5d[_0xa682('0x43')]);_0x2d58a4['attributes']=_[_0xa682('0x58')](_0x1d2f5d['model'],qs['fields'](_0x1db1c4[_0xa682('0x43')][_0xa682('0x47')]));_0x2d58a4[_0xa682('0x46')]=_0x2d58a4['attributes'][_0xa682('0x6d')]?_0x2d58a4['attributes']:_0x1d2f5d[_0xa682('0x42')];_0x2d58a4[_0xa682('0x4a')]=qs[_0xa682('0x4b')](_0x1db1c4[_0xa682('0x43')][_0xa682('0x4b')]);_0x2d58a4[_0xa682('0x4c')]=qs[_0xa682('0x45')](_[_0xa682('0x4d')](_0x1db1c4[_0xa682('0x43')],_0x1d2f5d[_0xa682('0x45')]));if(_0x1db1c4[_0xa682('0x43')][_0xa682('0x68')]){_0x2d58a4['where']=_['merge'](_0x2d58a4['where'],{'$or':_[_0xa682('0x3e')](_0x2d58a4[_0xa682('0x46')],function(_0x35feb1){var _0x233527={};_0x233527[_0x35feb1]={'$like':'%'+_0x1db1c4[_0xa682('0x43')][_0xa682('0x68')]+'%'};return _0x233527;})});}_0x2d58a4=_[_0xa682('0x4f')]({},_0x2d58a4,_0x1db1c4[_0xa682('0x50')]);return _0x37af42['getApplications'](_0x2d58a4);}})[_0xa682('0x34')](function(_0x464929){if(_0x464929){_0xf1afa8=_0x464929[_0xa682('0x6d')];if(!_0x1db1c4[_0xa682('0x43')][_0xa682('0x48')](_0xa682('0x49'))){_0x2d58a4[_0xa682('0x2e')]=qs[_0xa682('0x2e')](_0x1db1c4[_0xa682('0x43')]['limit']);_0x2d58a4[_0xa682('0x2d')]=qs[_0xa682('0x2d')](_0x1db1c4[_0xa682('0x43')][_0xa682('0x2d')]);}return _0x37af42['getApplications'](_0x2d58a4);}})[_0xa682('0x34')](function(_0x50903d){if(_0x50903d){return _0x50903d?{'count':_0xf1afa8,'rows':_0x50903d}:null;}})[_0xa682('0x34')](respondWithResult(_0x32e838,null))[_0xa682('0x28')](handleError(_0x32e838,null));};exports[_0xa682('0xa1')]=function(_0x3beb89,_0x47fb0f,_0x2af2d0){var _0x11c134={'raw':![],'where':{}};var _0x25600d={};var _0x4dee66={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa682('0x66')]({'where':{'id':_0x3beb89['params']['id']}})[_0xa682('0x34')](handleEntityNotFound(_0x47fb0f,null))[_0xa682('0x34')](function(_0x56c708){if(_0x56c708){_0x25600d[_0xa682('0x42')]=_[_0xa682('0x44')](db['OpenchannelInteraction']['rawAttributes']);_0x25600d[_0xa682('0x43')]=_[_0xa682('0x44')](_0x3beb89[_0xa682('0x43')]);_0x25600d[_0xa682('0x45')]=_[_0xa682('0x58')](_0x25600d[_0xa682('0x42')],_0x25600d[_0xa682('0x43')]);_0x11c134[_0xa682('0x46')]=_[_0xa682('0x58')](_0x25600d[_0xa682('0x42')],qs[_0xa682('0x47')](_0x3beb89[_0xa682('0x43')][_0xa682('0x47')]));_0x11c134[_0xa682('0x46')]=_0x11c134[_0xa682('0x46')][_0xa682('0x6d')]?_0x11c134[_0xa682('0x46')]:_0x25600d[_0xa682('0x42')];if(!_0x3beb89[_0xa682('0x43')][_0xa682('0x48')]('nolimit')){_0x11c134['limit']=qs[_0xa682('0x2e')](_0x3beb89[_0xa682('0x43')][_0xa682('0x2e')]);_0x11c134[_0xa682('0x2d')]=qs[_0xa682('0x2d')](_0x3beb89[_0xa682('0x43')]['offset']);}_0x11c134[_0xa682('0x4a')]=qs[_0xa682('0x4b')](_0x3beb89[_0xa682('0x43')]['sort']);_0x11c134[_0xa682('0x4c')]=qs[_0xa682('0x45')](_[_0xa682('0x4d')](_0x3beb89['query'],_0x25600d['filters']));_0x11c134[_0xa682('0x4c')][_0xa682('0x67')]=_0x56c708['id'];if(_0x3beb89[_0xa682('0x43')][_0xa682('0x68')]){_0x11c134[_0xa682('0x4c')]=_[_0xa682('0x4f')](_0x11c134[_0xa682('0x4c')],{'$or':_['map'](_0x11c134[_0xa682('0x46')],function(_0x4a6c1f){var _0x2bf54={};_0x2bf54[_0x4a6c1f]={'$like':'%'+_0x3beb89['query'][_0xa682('0x68')]+'%'};return _0x2bf54;})});}_0x11c134=_[_0xa682('0x4f')]({},_0x11c134,_0x3beb89['options']);return db[_0xa682('0x8b')]['count']({'where':_0x11c134[_0xa682('0x4c')]})['then'](function(_0x4fc5b1){_0x4dee66[_0xa682('0x2c')]=_0x4fc5b1;if(_0x3beb89[_0xa682('0x43')][_0xa682('0x51')]){_0x11c134['include']=[{'model':db['CmContact'],'as':_0xa682('0xa2'),'required':![]},{'model':db[_0xa682('0x95')],'as':'Owner','attributes':['name',_0xa682('0xa3'),_0xa682('0xa4')],'required':![]},{'model':db[_0xa682('0xa5')],'as':_0xa682('0xa6'),'attributes':['id',_0xa682('0x39'),_0xa682('0xa7')],'where':_0x3beb89[_0xa682('0x43')][_0xa682('0xa8')]?{'id':_0x3beb89['query'][_0xa682('0xa8')]}:undefined,'required':_0x3beb89['query']['tag']?!![]:![]}];}return db[_0xa682('0x8b')][_0xa682('0x53')](_0x11c134);})[_0xa682('0x34')](function(_0x115602){_0x4dee66[_0xa682('0x54')]=_0x115602;return _0x4dee66;});}})[_0xa682('0x34')](respondWithFilteredResult(_0x47fb0f,_0x11c134))[_0xa682('0x28')](handleError(_0x47fb0f,null));};exports[_0xa682('0xa9')]=function(_0x450e73,_0x4b2702,_0x1fb285){return db[_0xa682('0x3f')][_0xa682('0x59')]({'where':{'id':_0x450e73[_0xa682('0x56')]['id']}})[_0xa682('0x34')](handleEntityNotFound(_0x4b2702,null))[_0xa682('0x34')](function(_0x263755){if(_0x263755){return _0x263755[_0xa682('0xa9')](_0x450e73[_0xa682('0x62')][_0xa682('0x6a')],_[_0xa682('0xaa')](_0x450e73[_0xa682('0x62')],[_0xa682('0x6a'),'id'])||{})[_0xa682('0x8c')](function(_0x4424a0){for(var _0x39fc6b=0x0;_0x39fc6b<_0x450e73[_0xa682('0x62')][_0xa682('0x6a')]['length'];_0x39fc6b+=0x1){socket[_0xa682('0xab')]('userOpenchannelAccount:save',{'UserId':_0x450e73[_0xa682('0x62')]['ids'][_0x39fc6b],'OpenchannelAccountId':_0x450e73['params']['id']});}return _0x4424a0;});}})[_0xa682('0x34')](respondWithResult(_0x4b2702,null))['catch'](handleError(_0x4b2702,null));};exports[_0xa682('0xac')]=function(_0x125908,_0x197777,_0x7ad003){return db[_0xa682('0x3f')][_0xa682('0x59')]({'where':{'id':_0x125908[_0xa682('0x56')]['id']}})[_0xa682('0x34')](handleEntityNotFound(_0x197777,null))[_0xa682('0x34')](function(_0x330123){if(_0x330123){return _0x330123['removeAgents'](_0x125908[_0xa682('0x43')][_0xa682('0x6a')])[_0xa682('0x34')](function(){if(_[_0xa682('0xad')](_0x125908[_0xa682('0x43')]['ids'])){for(var _0xdda01a=0x0;_0xdda01a<_0x125908['query'][_0xa682('0x6a')][_0xa682('0x6d')];_0xdda01a+=0x1){socket[_0xa682('0xab')](_0xa682('0xae'),{'UserId':Number(_0x125908[_0xa682('0x43')][_0xa682('0x6a')][_0xdda01a]),'OpenchannelAccountId':Number(_0x125908[_0xa682('0x56')]['id'])});}}else{socket[_0xa682('0xab')](_0xa682('0xae'),{'UserId':Number(_0x125908[_0xa682('0x43')][_0xa682('0x6a')]),'OpenchannelAccountId':Number(_0x125908[_0xa682('0x56')]['id'])});}});}})[_0xa682('0x34')](respondWithStatusCode(_0x197777,null))[_0xa682('0x28')](handleError(_0x197777,null));};exports[_0xa682('0xaf')]=function(_0x3b9e99,_0x2a806d,_0x267a56){var _0x383400={};var _0x4ea631={};var _0x2d9503;var _0x2aa2aa;return db['OpenchannelAccount'][_0xa682('0x66')]({'where':{'id':_0x3b9e99[_0xa682('0x56')]['id']}})['then'](handleEntityNotFound(_0x2a806d,null))['then'](function(_0x19a9f6){if(_0x19a9f6){_0x2d9503=_0x19a9f6;_0x4ea631[_0xa682('0x42')]=_[_0xa682('0x44')](db[_0xa682('0x95')][_0xa682('0x57')]);_0x4ea631['query']=_[_0xa682('0x44')](_0x3b9e99[_0xa682('0x43')]);_0x4ea631[_0xa682('0x45')]=_[_0xa682('0x58')](_0x4ea631[_0xa682('0x42')],_0x4ea631[_0xa682('0x43')]);_0x383400['attributes']=_[_0xa682('0x58')](_0x4ea631[_0xa682('0x42')],qs[_0xa682('0x47')](_0x3b9e99[_0xa682('0x43')][_0xa682('0x47')]));_0x383400[_0xa682('0x46')]=_0x383400[_0xa682('0x46')][_0xa682('0x6d')]?_0x383400[_0xa682('0x46')]:_0x4ea631[_0xa682('0x42')];_0x383400['order']=qs[_0xa682('0x4b')](_0x3b9e99['query'][_0xa682('0x4b')]);_0x383400['where']=qs['filters'](_[_0xa682('0x4d')](_0x3b9e99[_0xa682('0x43')],_0x4ea631[_0xa682('0x45')]));if(_0x3b9e99[_0xa682('0x43')][_0xa682('0x68')]){_0x383400[_0xa682('0x4c')]=_[_0xa682('0x4f')](_0x383400[_0xa682('0x4c')],{'$or':_[_0xa682('0x3e')](_0x383400['attributes'],function(_0x30c2da){var _0x4acd24={};_0x4acd24[_0x30c2da]={'$like':'%'+_0x3b9e99['query'][_0xa682('0x68')]+'%'};return _0x4acd24;})});}_0x383400=_[_0xa682('0x4f')]({},_0x383400,_0x3b9e99[_0xa682('0x50')]);return _0x2d9503[_0xa682('0xaf')](_0x383400);}})[_0xa682('0x34')](function(_0x262000){if(_0x262000){_0x2aa2aa=_0x262000['length'];if(!_0x3b9e99[_0xa682('0x43')][_0xa682('0x48')](_0xa682('0x49'))){_0x383400[_0xa682('0x2e')]=qs[_0xa682('0x2e')](_0x3b9e99[_0xa682('0x43')]['limit']);_0x383400[_0xa682('0x2d')]=qs[_0xa682('0x2d')](_0x3b9e99['query'][_0xa682('0x2d')]);}return _0x2d9503[_0xa682('0xaf')](_0x383400);}})[_0xa682('0x34')](function(_0x525acb){if(_0x525acb){return _0x525acb?{'count':_0x2aa2aa,'rows':_0x525acb}:null;}})[_0xa682('0x34')](respondWithResult(_0x2a806d,null))[_0xa682('0x28')](handleError(_0x2a806d,null));};exports[_0xa682('0x3a')]=function(_0xa28be0,_0x31d00b,_0x247d3b){var _0x362840,_0x307c77,_0x245286;if(_[_0xa682('0x74')](_0xa28be0['body'][_0xa682('0x62')])||_0xa28be0[_0xa682('0x62')]['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0xa28be0[_0xa682('0x62')]['to'])){}_0x362840=_0xa28be0['body']['to'];return db['OpenchannelAccount'][_0xa682('0x66')]({'where':{'id':_0xa28be0['params']['id']}})[_0xa682('0x34')](handleEntityNotFound(_0x31d00b,null))[_0xa682('0x34')](function(_0x43c530){if(_0x43c530){return db['OpenchannelAccount'][_0xa682('0x59')]({'where':{'id':_0x43c530['id']},'include':[{'model':db[_0xa682('0xb0')],'as':_0xa682('0x7b'),'include':[{'model':db[_0xa682('0x7c')],'as':_0xa682('0x7d'),'where':{[_0x43c530[_0xa682('0x79')]]:_0x362840},'limit':0x1,'order':[[_0xa682('0x72'),'DESC']]}]}]})[_0xa682('0x34')](handleEntityNotFound(_0x31d00b,null))[_0xa682('0x34')](function(_0x18f0ec){if(_0x18f0ec&&_0x18f0ec[_0xa682('0x7b')]){_0x307c77=_0x18f0ec[_0xa682('0x5b')]({'plain':!![]});if(_0x307c77['List']&&_0x307c77[_0xa682('0x7b')]['Contacts'][_0xa682('0x6d')]){return _0x307c77['List'][_0xa682('0x7d')][0x0];}return db[_0xa682('0x7c')][_0xa682('0x5a')](_[_0xa682('0x17')](_0xa28be0[_0xa682('0x62')],{'firstName':_0x362840,[_0x18f0ec[_0xa682('0x79')]]:_0x362840,'phone':_0x362840,'ListId':_0x307c77[_0xa682('0x73')]}));}})[_0xa682('0x34')](handleEntityNotFound(_0x31d00b,null))[_0xa682('0x34')](function(_0x2e6165){if(_0x2e6165){_0x245286=_0x2e6165;return db[_0xa682('0x8b')][_0xa682('0x59')]({'where':{'ContactId':_0x245286['id'],'closed':![],'OpenchannelAccountId':_0x307c77['id']}})[_0xa682('0x34')](function(_0x219aee){if(_0x219aee){return[_0x219aee,![]];}return db['OpenchannelInteraction'][_0xa682('0x5a')]({'UserId':_0xa28be0['user']['id'],'ContactId':_0x245286['id'],'OpenchannelAccountId':_0x307c77['id'],'lastMsgDirection':_0xa682('0xb1'),'Messages':[_[_0xa682('0x4f')](_0xa28be0[_0xa682('0x62')],{'read':![],'body':_0xa28be0[_0xa682('0x62')]['body'],'OpenchannelAccountId':_0x307c77['id'],'UserId':_0xa28be0[_0xa682('0x5e')]['id'],'ContactId':_0x245286['id']})]},{'include':[{'model':db[_0xa682('0x93')],'as':_0xa682('0xb2')}]})['then'](function(_0x2fe58a){return[_0x2fe58a,!![]];});});}})[_0xa682('0x8c')](function(_0x47d2af,_0x137044){if(_0x137044){return _0x47d2af;}return db[_0xa682('0x93')][_0xa682('0x5a')](_[_0xa682('0x4f')](_0xa28be0['body'],{'read':![],'body':_0xa28be0[_0xa682('0x62')][_0xa682('0x62')],'OpenchannelAccountId':_0x307c77['id'],'OpenchannelInteractionId':_0x47d2af['id'],'UserId':_0xa28be0['user']['id'],'ContactId':_0x245286['id']}))[_0xa682('0x34')](function(_0x516a3b){_0x47d2af[_0xa682('0xb3')]['Messages']=[];_0x47d2af[_0xa682('0xb3')][_0xa682('0xb2')][_0xa682('0x90')](_0x516a3b['dataValues']);return _0x47d2af;});});}})[_0xa682('0x34')](respondWithResult(_0x31d00b,null))[_0xa682('0x28')](handleError(_0x31d00b,null));}; \ No newline at end of file +var _0x8938=['orderBy','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','findAndCountAll','getApplications','getInteractions','order','Contact','fullname','internal','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','CmList','DESC','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','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','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelAccounts','stack','name','send','index','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','key','map','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','params','Pause','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','UserProfileResource','body','describe','addDisposition','OpnechannelAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','rows','removeAnswers','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','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','List','Contacts','OpenchannelApplication','account','applications','Applications','list'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0x8938,0xed));var _0x8893=function(_0x2ffc46,_0x35ce3c){_0x2ffc46=_0x2ffc46-0x0;var _0x1eda8f=_0x8938[_0x2ffc46];return _0x1eda8f;};'use strict';var pdf=require(_0x8893('0x0'));var emlformat=require(_0x8893('0x1'));var rimraf=require(_0x8893('0x2'));var zipdir=require(_0x8893('0x3'));var jsonpatch=require(_0x8893('0x4'));var rp=require('request-promise');var moment=require(_0x8893('0x5'));var BPromise=require(_0x8893('0x6'));var Mustache=require(_0x8893('0x7'));var util=require(_0x8893('0x8'));var path=require(_0x8893('0x9'));var sox=require(_0x8893('0xa'));var csv=require('to-csv');var ejs=require(_0x8893('0xb'));var fs=require('fs');var _=require(_0x8893('0xc'));var squel=require(_0x8893('0xd'));var crypto=require(_0x8893('0xe'));var jsforce=require(_0x8893('0xf'));var deskjs=require(_0x8893('0x10'));var toCsv=require(_0x8893('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8893('0x12'));var authService=require(_0x8893('0x13'));var qs=require(_0x8893('0x14'));var as=require(_0x8893('0x15'));var hardwareService=require(_0x8893('0x16'));var logger=require(_0x8893('0x17'))(_0x8893('0x18'));var utils=require('../../config/utils');var config=require(_0x8893('0x19'));var db=require(_0x8893('0x1a'))['db'];config[_0x8893('0x1b')]=_[_0x8893('0x1c')](config['redis'],{'host':_0x8893('0x1d'),'port':0x18eb});var socket=require(_0x8893('0x1e'))(new Redis(config[_0x8893('0x1b')]));require(_0x8893('0x1f'))['register'](socket);var jayson=require(_0x8893('0x20'));var client=jayson[_0x8893('0x21')][_0x8893('0x22')]({'port':0x232c});var client9002=jayson[_0x8893('0x21')]['http']({'port':0x232a});function checkPasswordPattern(_0x404506,_0x4aa4d3,_0x5c9b46){if(_0x5c9b46){var _0x5f676d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f676d[_0x8893('0x23')](_0x4aa4d3)){return _0x404506;}else{throw new db['Sequelize'][(_0x8893('0x24'))](_0x8893('0x25'));}}else{return _0x404506;}}function respondWithRpcPromise(_0x2ae654,_0x32d457,_0x385c04,_0x4b9b2e){return new BPromise(function(_0x3d9385,_0x342037){var _0x2dbabe=_0x4b9b2e||client;return _0x2dbabe[_0x8893('0x26')](_0x2ae654,_0x385c04)['then'](function(_0x8f878d){logger[_0x8893('0x27')](_0x8893('0x28'),_0x32d457,'request\x20sent');logger['debug'](_0x8893('0x29'),_0x32d457,'request\x20sent',JSON[_0x8893('0x2a')](_0x8f878d));if(_0x8f878d[_0x8893('0x2b')]){if(_0x8f878d[_0x8893('0x2b')][_0x8893('0x2c')]===0x1f4){logger[_0x8893('0x2b')](_0x8893('0x28'),_0x32d457,_0x8f878d[_0x8893('0x2b')][_0x8893('0x2d')]);return _0x342037(_0x8f878d[_0x8893('0x2b')][_0x8893('0x2d')]);}logger[_0x8893('0x2b')]('OpenchannelAccount,\x20%s,\x20%s',_0x32d457,_0x8f878d[_0x8893('0x2b')]['message']);return _0x3d9385(_0x8f878d['error'][_0x8893('0x2d')]);}else{logger[_0x8893('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x32d457,_0x8893('0x2e'));_0x3d9385(_0x8f878d[_0x8893('0x2f')][_0x8893('0x2d')]);}})[_0x8893('0x30')](function(_0x42c19b){logger[_0x8893('0x2b')]('OpenchannelAccount,\x20%s,\x20%s',_0x32d457,_0x42c19b);_0x342037(_0x42c19b);});});}function respondWithStatusCode(_0x5858ba,_0x4d59a8){_0x4d59a8=_0x4d59a8||0xcc;return function(_0x1cd5e7){if(_0x1cd5e7){return _0x5858ba['sendStatus'](_0x4d59a8);}return _0x5858ba[_0x8893('0x31')](_0x4d59a8)[_0x8893('0x32')]();};}function respondWithResult(_0xd373a,_0xfb78c3){_0xfb78c3=_0xfb78c3||0xc8;return function(_0x56db3f){if(_0x56db3f){return _0xd373a[_0x8893('0x31')](_0xfb78c3)[_0x8893('0x33')](_0x56db3f);}};}function respondWithFilteredResult(_0xb2896,_0x5c9638){return function(_0x1362f4){if(_0x1362f4){var _0x31b408=_0x1362f4[_0x8893('0x34')],_0x4b5ee6=_0x5c9638[_0x8893('0x35')],_0x3be0d0=_0x5c9638[_0x8893('0x35')]+_0x5c9638[_0x8893('0x36')],_0x15397d;if(_0x3be0d0>=_0x31b408){_0x3be0d0=_0x31b408;_0x15397d=0xc8;}else{_0x15397d=0xce;}_0xb2896[_0x8893('0x31')](_0x15397d);return _0xb2896[_0x8893('0x37')](_0x8893('0x38'),_0x4b5ee6+'-'+_0x3be0d0+'/'+_0x31b408)[_0x8893('0x33')](_0x1362f4);}return null;};}function patchUpdates(_0x412a69){return function(_0x595742){try{jsonpatch[_0x8893('0x39')](_0x595742,_0x412a69,!![]);}catch(_0x335df4){return BPromise[_0x8893('0x3a')](_0x335df4);}return _0x595742[_0x8893('0x3b')]();};}function saveUpdates(_0x1c9f7e,_0x198389){return function(_0x5b923f){if(_0x5b923f){return _0x5b923f[_0x8893('0x3c')](_0x1c9f7e)[_0x8893('0x3d')](function(_0x31ca8e){return _0x31ca8e;});}return null;};}function removeEntity(_0x480aae,_0x55d15c){return function(_0x161f5e){if(_0x161f5e){return _0x161f5e[_0x8893('0x3e')]()['then'](function(){var _0x9e53eb=_0x161f5e[_0x8893('0x3f')]({'plain':!![]});var _0xc5356=_0x8893('0x40');return db['UserProfileResource']['destroy']({'where':{'type':_0xc5356,'resourceId':_0x9e53eb['id']}})['then'](function(){return _0x161f5e;});})['then'](function(){_0x480aae[_0x8893('0x31')](0xcc)[_0x8893('0x32')]();});}};}function handleEntityNotFound(_0x32afc1,_0x3b0e78){return function(_0x223228){if(!_0x223228){_0x32afc1['sendStatus'](0x194);}return _0x223228;};}function handleError(_0x6ec67,_0x5a3576){_0x5a3576=_0x5a3576||0x1f4;return function(_0xb81223){logger['error'](_0xb81223[_0x8893('0x41')]);if(_0xb81223[_0x8893('0x42')]){delete _0xb81223[_0x8893('0x42')];}_0x6ec67[_0x8893('0x31')](_0x5a3576)[_0x8893('0x43')](_0xb81223);};}exports[_0x8893('0x44')]=function(_0x421ef9,_0x18762e){var _0x5a8be5={'include':[{'model':db['Pause'],'as':_0x8893('0x45')}]},_0x5e82cd={},_0x289e66={'count':0x0,'rows':[]};var _0x435140=_['map'](db[_0x8893('0x46')][_0x8893('0x47')],function(_0x28356d){return{'name':_0x28356d['fieldName'],'type':_0x28356d[_0x8893('0x48')][_0x8893('0x49')]};});_0x5e82cd['model']=_[_0x8893('0x4a')](_0x435140,_0x8893('0x42'));_0x5e82cd[_0x8893('0x4b')]=_[_0x8893('0x4c')](_0x421ef9[_0x8893('0x4b')]);_0x5e82cd[_0x8893('0x4d')]=_['intersection'](_0x5e82cd[_0x8893('0x4e')],_0x5e82cd[_0x8893('0x4b')]);_0x5a8be5['attributes']=_[_0x8893('0x4f')](_0x5e82cd[_0x8893('0x4e')],qs[_0x8893('0x50')](_0x421ef9['query']['fields']));_0x5a8be5['attributes']=_0x5a8be5[_0x8893('0x51')]['length']?_0x5a8be5[_0x8893('0x51')]:_0x5e82cd[_0x8893('0x4e')];if(!_0x421ef9[_0x8893('0x4b')][_0x8893('0x52')](_0x8893('0x53'))){_0x5a8be5[_0x8893('0x36')]=qs[_0x8893('0x36')](_0x421ef9[_0x8893('0x4b')][_0x8893('0x36')]);_0x5a8be5[_0x8893('0x35')]=qs['offset'](_0x421ef9[_0x8893('0x4b')][_0x8893('0x35')]);}_0x5a8be5['order']=qs[_0x8893('0x54')](_0x421ef9[_0x8893('0x4b')][_0x8893('0x54')]);_0x5a8be5[_0x8893('0x55')]=qs[_0x8893('0x4d')](_[_0x8893('0x56')](_0x421ef9['query'],_0x5e82cd[_0x8893('0x4d')]));if(_0x421ef9[_0x8893('0x4b')][_0x8893('0x57')]){_0x5a8be5[_0x8893('0x55')]=_[_0x8893('0x58')](_0x5a8be5['where'],{'$or':_[_0x8893('0x4a')](_0x435140,function(_0x2099ef){if(_0x2099ef[_0x8893('0x48')]!==_0x8893('0x59')){var _0x295fd8={};_0x295fd8[_0x2099ef['name']]={'$like':'%'+_0x421ef9['query'][_0x8893('0x57')]+'%'};return _0x295fd8;}})});}_0x5a8be5=_[_0x8893('0x58')]({},_0x5a8be5,_0x421ef9[_0x8893('0x5a')]);var _0x2f8e77={'where':_0x5a8be5[_0x8893('0x55')]};return db[_0x8893('0x46')][_0x8893('0x34')](_0x2f8e77)['then'](function(_0x32cd93){_0x289e66[_0x8893('0x34')]=_0x32cd93;if(_0x421ef9[_0x8893('0x4b')]['includeAll']){_0x5a8be5[_0x8893('0x5b')]=[{'all':!![]}];}return db[_0x8893('0x46')][_0x8893('0x5c')](_0x5a8be5);})[_0x8893('0x3d')](function(_0xb517f3){_0x289e66['rows']=_0xb517f3;return _0x289e66;})[_0x8893('0x3d')](respondWithFilteredResult(_0x18762e,_0x5a8be5))[_0x8893('0x30')](handleError(_0x18762e,null));};exports['show']=function(_0x1e7cd3,_0x5af567){var _0x483ccc={'raw':![],'where':{'id':_0x1e7cd3[_0x8893('0x5d')]['id']},'include':[{'model':db[_0x8893('0x5e')],'as':_0x8893('0x45')}]},_0x5e5cdd={};_0x5e5cdd[_0x8893('0x4e')]=_[_0x8893('0x4c')](db['OpenchannelAccount']['rawAttributes']);_0x5e5cdd[_0x8893('0x4b')]=_['keys'](_0x1e7cd3[_0x8893('0x4b')]);_0x5e5cdd['filters']=_['intersection'](_0x5e5cdd['model'],_0x5e5cdd[_0x8893('0x4b')]);_0x483ccc[_0x8893('0x51')]=_['intersection'](_0x5e5cdd[_0x8893('0x4e')],qs['fields'](_0x1e7cd3[_0x8893('0x4b')][_0x8893('0x50')]));_0x483ccc[_0x8893('0x51')]=_0x483ccc[_0x8893('0x51')][_0x8893('0x5f')]?_0x483ccc['attributes']:_0x5e5cdd[_0x8893('0x4e')];if(_0x1e7cd3[_0x8893('0x4b')][_0x8893('0x60')]){_0x483ccc[_0x8893('0x5b')]=[{'all':!![]}];}_0x483ccc=_['merge']({},_0x483ccc,_0x1e7cd3[_0x8893('0x5a')]);return db[_0x8893('0x46')]['find'](_0x483ccc)['then'](handleEntityNotFound(_0x5af567,null))[_0x8893('0x3d')](respondWithResult(_0x5af567,null))[_0x8893('0x30')](handleError(_0x5af567,null));};exports['create']=function(_0x234ee9,_0x57cec6){return db['OpenchannelAccount'][_0x8893('0x61')](_0x234ee9['body'],{})[_0x8893('0x3d')](function(_0x580823){var _0x5b7f47=_0x234ee9['user'][_0x8893('0x3f')]({'plain':!![]});if(!_0x5b7f47)throw new Error(_0x8893('0x62'));if(_0x5b7f47[_0x8893('0x63')]===_0x8893('0x64')){var _0x43d6d8=_0x580823[_0x8893('0x3f')]({'plain':!![]});var _0xfb2413=_0x8893('0x40');return db['UserProfileSection'][_0x8893('0x65')]({'where':{'name':_0xfb2413,'userProfileId':_0x5b7f47[_0x8893('0x66')]},'raw':!![]})[_0x8893('0x3d')](function(_0x268d37){if(_0x268d37&&_0x268d37['autoAssociation']===0x0){return db[_0x8893('0x67')][_0x8893('0x61')]({'name':_0x43d6d8[_0x8893('0x42')],'resourceId':_0x43d6d8['id'],'type':_0x268d37[_0x8893('0x42')],'sectionId':_0x268d37['id']},{})[_0x8893('0x3d')](function(){return _0x580823;});}else{return _0x580823;}})[_0x8893('0x30')](function(_0x4c2618){logger[_0x8893('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c2618);throw _0x4c2618;});}return _0x580823;})[_0x8893('0x3d')](respondWithResult(_0x57cec6,0xc9))[_0x8893('0x30')](handleError(_0x57cec6,null));};exports[_0x8893('0x3c')]=function(_0x19b9d0,_0x3c097d){if(_0x19b9d0[_0x8893('0x68')]['id']){delete _0x19b9d0[_0x8893('0x68')]['id'];}return db[_0x8893('0x46')][_0x8893('0x65')]({'where':{'id':_0x19b9d0['params']['id']},'include':[{'model':db[_0x8893('0x5e')],'as':_0x8893('0x45')}]})[_0x8893('0x3d')](handleEntityNotFound(_0x3c097d,null))[_0x8893('0x3d')](saveUpdates(_0x19b9d0[_0x8893('0x68')],null))[_0x8893('0x3d')](respondWithResult(_0x3c097d,null))['catch'](handleError(_0x3c097d,null));};exports[_0x8893('0x3e')]=function(_0x48e1ac,_0x58d45d){return db[_0x8893('0x46')]['find']({'where':{'id':_0x48e1ac[_0x8893('0x5d')]['id']}})[_0x8893('0x3d')](handleEntityNotFound(_0x58d45d,null))[_0x8893('0x3d')](removeEntity(_0x58d45d,null))[_0x8893('0x30')](handleError(_0x58d45d,null));};exports[_0x8893('0x69')]=function(_0x59b3ef,_0x3dd92a){return db[_0x8893('0x46')][_0x8893('0x69')]()['then'](respondWithResult(_0x3dd92a,null))[_0x8893('0x30')](handleError(_0x3dd92a,null));};exports[_0x8893('0x6a')]=function(_0x3440ee,_0x55177c,_0x487b9b){if(_0x3440ee[_0x8893('0x68')]['id']){delete _0x3440ee['body']['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x3440ee[_0x8893('0x5d')]['id']}})[_0x8893('0x3d')](handleEntityNotFound(_0x55177c,null))[_0x8893('0x3d')](function(_0x12bd34){if(_0x12bd34){_0x3440ee[_0x8893('0x68')][_0x8893('0x6b')]=_0x12bd34['id'];return db['Disposition'][_0x8893('0x61')](_0x3440ee['body']);}})[_0x8893('0x3d')](respondWithResult(_0x55177c,null))['catch'](handleError(_0x55177c,null));};exports[_0x8893('0x6c')]=function(_0x186f6e,_0xc04c1c,_0xa93ad5){var _0x58336c={'raw':![],'where':{}};var _0x40d6cb={};var _0x12a038={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8893('0x6d')]({'where':{'id':_0x186f6e[_0x8893('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc04c1c,null))['then'](function(_0x32ba1d){if(_0x32ba1d){_0x40d6cb[_0x8893('0x4e')]=_[_0x8893('0x4c')](db[_0x8893('0x6e')]['rawAttributes']);_0x40d6cb[_0x8893('0x4b')]=_['keys'](_0x186f6e['query']);_0x40d6cb['filters']=_['intersection'](_0x40d6cb['model'],_0x40d6cb[_0x8893('0x4b')]);_0x58336c['attributes']=_[_0x8893('0x4f')](_0x40d6cb[_0x8893('0x4e')],qs['fields'](_0x186f6e[_0x8893('0x4b')][_0x8893('0x50')]));_0x58336c['attributes']=_0x58336c[_0x8893('0x51')][_0x8893('0x5f')]?_0x58336c[_0x8893('0x51')]:_0x40d6cb[_0x8893('0x4e')];if(!_0x186f6e[_0x8893('0x4b')][_0x8893('0x52')](_0x8893('0x53'))){_0x58336c['limit']=qs[_0x8893('0x36')](_0x186f6e[_0x8893('0x4b')][_0x8893('0x36')]);_0x58336c[_0x8893('0x35')]=qs[_0x8893('0x35')](_0x186f6e[_0x8893('0x4b')][_0x8893('0x35')]);}_0x58336c['order']=qs[_0x8893('0x54')](_0x186f6e[_0x8893('0x4b')][_0x8893('0x54')]);_0x58336c['where']=qs[_0x8893('0x4d')](_[_0x8893('0x56')](_0x186f6e['query'],_0x40d6cb['filters']));_0x58336c[_0x8893('0x55')]['OpenchannelAccountId']=_0x32ba1d['id'];if(_0x186f6e['query'][_0x8893('0x57')]){_0x58336c[_0x8893('0x55')]=_[_0x8893('0x58')](_0x58336c[_0x8893('0x55')],{'$or':_['map'](_0x58336c['attributes'],function(_0x1c935a){var _0x49d0ed={};_0x49d0ed[_0x1c935a]={'$like':'%'+_0x186f6e[_0x8893('0x4b')][_0x8893('0x57')]+'%'};return _0x49d0ed;})});}_0x58336c=_['merge']({},_0x58336c,_0x186f6e[_0x8893('0x5a')]);return db['Disposition'][_0x8893('0x34')]({'where':_0x58336c[_0x8893('0x55')]})[_0x8893('0x3d')](function(_0x4e0f48){_0x12a038[_0x8893('0x34')]=_0x4e0f48;if(_0x186f6e['query'][_0x8893('0x60')]){_0x58336c[_0x8893('0x5b')]=[{'all':!![]}];}return db[_0x8893('0x6e')][_0x8893('0x5c')](_0x58336c);})[_0x8893('0x3d')](function(_0x5058ee){_0x12a038['rows']=_0x5058ee;return _0x12a038;});}})[_0x8893('0x3d')](respondWithFilteredResult(_0xc04c1c,_0x58336c))[_0x8893('0x30')](handleError(_0xc04c1c,null));};exports[_0x8893('0x6f')]=function(_0x34e35c,_0x161108,_0x74964b){return db[_0x8893('0x46')]['find']({'where':{'id':_0x34e35c['params']['id']}})[_0x8893('0x3d')](handleEntityNotFound(_0x161108,null))[_0x8893('0x3d')](function(_0x5c6cbd){if(_0x5c6cbd){return _0x5c6cbd[_0x8893('0x6f')](_0x34e35c[_0x8893('0x4b')][_0x8893('0x70')]);}})[_0x8893('0x3d')](respondWithStatusCode(_0x161108,null))['catch'](handleError(_0x161108,null));};exports[_0x8893('0x71')]=function(_0x1c6f6f,_0x5f28bc,_0x4b19d3){if(_0x1c6f6f[_0x8893('0x68')]['id']){delete _0x1c6f6f['body']['id'];}return db[_0x8893('0x46')][_0x8893('0x65')]({'where':{'id':_0x1c6f6f[_0x8893('0x5d')]['id']}})[_0x8893('0x3d')](handleEntityNotFound(_0x5f28bc,null))[_0x8893('0x3d')](function(_0x327f26){if(_0x327f26){_0x1c6f6f[_0x8893('0x68')][_0x8893('0x72')]=_0x327f26['id'];return db[_0x8893('0x73')][_0x8893('0x61')](_0x1c6f6f['body']);}})['then'](respondWithResult(_0x5f28bc,null))[_0x8893('0x30')](handleError(_0x5f28bc,null));};exports[_0x8893('0x74')]=function(_0x4be0f0,_0x4c59bf,_0x1c2f90){var _0x4e71d7={'raw':![],'where':{}};var _0x15ff0f={};var _0x410310={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8893('0x6d')]({'where':{'id':_0x4be0f0['params']['id']}})[_0x8893('0x3d')](handleEntityNotFound(_0x4c59bf,null))[_0x8893('0x3d')](function(_0x16e439){if(_0x16e439){_0x15ff0f['model']=_[_0x8893('0x4c')](db[_0x8893('0x73')][_0x8893('0x47')]);_0x15ff0f[_0x8893('0x4b')]=_[_0x8893('0x4c')](_0x4be0f0[_0x8893('0x4b')]);_0x15ff0f[_0x8893('0x4d')]=_[_0x8893('0x4f')](_0x15ff0f[_0x8893('0x4e')],_0x15ff0f['query']);_0x4e71d7['attributes']=_[_0x8893('0x4f')](_0x15ff0f[_0x8893('0x4e')],qs[_0x8893('0x50')](_0x4be0f0[_0x8893('0x4b')][_0x8893('0x50')]));_0x4e71d7[_0x8893('0x51')]=_0x4e71d7['attributes'][_0x8893('0x5f')]?_0x4e71d7[_0x8893('0x51')]:_0x15ff0f[_0x8893('0x4e')];if(!_0x4be0f0[_0x8893('0x4b')][_0x8893('0x52')]('nolimit')){_0x4e71d7['limit']=qs[_0x8893('0x36')](_0x4be0f0[_0x8893('0x4b')][_0x8893('0x36')]);_0x4e71d7[_0x8893('0x35')]=qs[_0x8893('0x35')](_0x4be0f0[_0x8893('0x4b')]['offset']);}_0x4e71d7['order']=qs[_0x8893('0x54')](_0x4be0f0[_0x8893('0x4b')][_0x8893('0x54')]);_0x4e71d7[_0x8893('0x55')]=qs[_0x8893('0x4d')](_[_0x8893('0x56')](_0x4be0f0[_0x8893('0x4b')],_0x15ff0f[_0x8893('0x4d')]));_0x4e71d7[_0x8893('0x55')][_0x8893('0x72')]=_0x16e439['id'];if(_0x4be0f0['query'][_0x8893('0x57')]){_0x4e71d7[_0x8893('0x55')]=_[_0x8893('0x58')](_0x4e71d7[_0x8893('0x55')],{'$or':_['map'](_0x4e71d7[_0x8893('0x51')],function(_0x57ccad){var _0x44d568={};_0x44d568[_0x57ccad]={'$like':'%'+_0x4be0f0['query'][_0x8893('0x57')]+'%'};return _0x44d568;})});}_0x4e71d7=_['merge']({},_0x4e71d7,_0x4be0f0[_0x8893('0x5a')]);return db['CannedAnswer'][_0x8893('0x34')]({'where':_0x4e71d7['where']})[_0x8893('0x3d')](function(_0x5d0839){_0x410310[_0x8893('0x34')]=_0x5d0839;if(_0x4be0f0[_0x8893('0x4b')][_0x8893('0x60')]){_0x4e71d7['include']=[{'all':!![]}];}return db[_0x8893('0x73')]['findAll'](_0x4e71d7);})[_0x8893('0x3d')](function(_0x15105c){_0x410310[_0x8893('0x75')]=_0x15105c;return _0x410310;});}})[_0x8893('0x3d')](respondWithFilteredResult(_0x4c59bf,_0x4e71d7))['catch'](handleError(_0x4c59bf,null));};exports[_0x8893('0x76')]=function(_0x5dc477,_0x5e2cb2,_0x406b2a){return db['OpenchannelAccount'][_0x8893('0x65')]({'where':{'id':_0x5dc477[_0x8893('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5e2cb2,null))[_0x8893('0x3d')](function(_0x591fcf){if(_0x591fcf){return _0x591fcf[_0x8893('0x76')](_0x5dc477[_0x8893('0x4b')][_0x8893('0x70')]);}})[_0x8893('0x3d')](respondWithStatusCode(_0x5e2cb2,null))[_0x8893('0x30')](handleError(_0x5e2cb2,null));};exports[_0x8893('0x77')]=function(_0x4dc66b,_0x5de069,_0x212400){var _0x5202f3={'body':_0x4dc66b[_0x8893('0x68')],'channel':'openchannel'};var _0x4105d2=[];var _0x460ab4=[];var _0xe3eada={};var _0x34071a=![];return db[_0x8893('0x78')][_0x8893('0x69')]()[_0x8893('0x3d')](function(_0x4edb14){if(!_0x4edb14){throw new db[(_0x8893('0x79'))]['ValidationError'](_0x8893('0x7a'));}_0x4105d2=_[_0x8893('0x7b')](_[_0x8893('0x4c')](_0x4edb14),[_0x8893('0x7c'),_0x8893('0x7d')]);_0x460ab4=_[_0x8893('0x7b')](_[_0x8893('0x4c')](_0x4edb14),[_0x8893('0x7c'),_0x8893('0x7d'),_0x8893('0x7e'),_0x8893('0x7f')]);if(_0x4dc66b[_0x8893('0x68')]['id']){delete _0x4dc66b[_0x8893('0x68')]['id'];}if(_['isNil'](_0x4dc66b['body'][_0x8893('0x80')])){throw new db['Sequelize'][(_0x8893('0x24'))](_0x8893('0x81'));}if(_['isNil'](_0x4dc66b['body'][_0x8893('0x68')])||_0x4dc66b[_0x8893('0x68')]['body']===''){throw new db[(_0x8893('0x79'))][(_0x8893('0x24'))](_0x8893('0x82'));}if(_[_0x8893('0x83')](_0x4dc66b['body'][_0x8893('0x84')])){throw new db['Sequelize']['ValidationError'](_0x8893('0x85')+_0x460ab4);}if(!_[_0x8893('0x86')](_0x460ab4,_0x4dc66b[_0x8893('0x68')]['mapKey'])){throw new db[(_0x8893('0x79'))][(_0x8893('0x24'))](_0x8893('0x87')+_0x460ab4);}_0xe3eada[_0x4dc66b[_0x8893('0x68')][_0x8893('0x84')]]=_0x4dc66b[_0x8893('0x68')]['from'];})['then'](function(){return db['OpenchannelAccount'][_0x8893('0x65')]({'where':{'id':_0x4dc66b['params']['id']},'include':[{'model':db['CmList'],'as':_0x8893('0x88'),'include':[{'model':db[_0x8893('0x78')],'as':_0x8893('0x89'),'where':_0xe3eada,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x8893('0x8a')],'as':'Applications'}]});})[_0x8893('0x3d')](handleEntityNotFound(_0x5de069,null))[_0x8893('0x3d')](function(_0x550d3f){if(_0x550d3f&&_0x550d3f[_0x8893('0x88')]){_0x5202f3[_0x8893('0x8b')]=_0x550d3f;_0x5202f3[_0x8893('0x8c')]=_0x550d3f[_0x8893('0x8d')];_0x5202f3[_0x8893('0x8e')]=_0x550d3f['List'];_0x5202f3[_0x8893('0x8c')]=_[_0x8893('0x8f')](_0x5202f3[_0x8893('0x8c')],['priority'],[_0x8893('0x90')]);if(_0x5202f3[_0x8893('0x8b')]['Applications']){delete _0x5202f3['account'][_0x8893('0x8d')];}if(_0x5202f3[_0x8893('0x8b')][_0x8893('0x88')]&&_0x5202f3[_0x8893('0x8b')][_0x8893('0x88')][_0x8893('0x89')][_0x8893('0x5f')]){return _0x5202f3[_0x8893('0x8b')][_0x8893('0x88')][_0x8893('0x89')][0x0];}var _0x2489fa=_[_0x8893('0x1c')](_0x4dc66b[_0x8893('0x68')],{'firstName':_0x4dc66b[_0x8893('0x68')]['from'],'ListId':_0x550d3f[_0x8893('0x7f')]});_0x2489fa[_0x4dc66b[_0x8893('0x68')][_0x8893('0x84')]]=_0x4dc66b[_0x8893('0x68')][_0x8893('0x80')];return db[_0x8893('0x78')][_0x8893('0x61')](_0x2489fa,{'fields':_0x4105d2,'raw':!![]});}})[_0x8893('0x3d')](handleEntityNotFound(_0x5de069,null))[_0x8893('0x3d')](function(_0x283790){_0x5202f3[_0x8893('0x91')]=_0x283790;if(_0x283790){var _0x37df26={'ContactId':_0x283790['id'],'OpenchannelAccountId':_0x4dc66b[_0x8893('0x5d')]['id'],'from':(_0x283790[_0x8893('0x92')]||'')+'\x20'+(_0x283790[_0x8893('0x93')]||'')};var _0x338242={'OpenchannelAccountId':_0x4dc66b[_0x8893('0x5d')]['id'],'closed':![]};if(_0x4dc66b['body'][_0x8893('0x94')]){_0x338242[_0x8893('0x94')]=_0x4dc66b[_0x8893('0x68')][_0x8893('0x94')];return db[_0x8893('0x95')]['find']({'where':_0x338242})[_0x8893('0x3d')](function(_0x5edf2d){if(_0x5edf2d){return[_0x5edf2d,![]];}_0x37df26[_0x8893('0x94')]=_0x4dc66b[_0x8893('0x68')][_0x8893('0x94')];_0x37df26[_0x8893('0x96')]=_0x4dc66b[_0x8893('0x68')][_0x8893('0x96')];return db[_0x8893('0x95')][_0x8893('0x61')](_0x37df26)[_0x8893('0x3d')](function(_0x665b57){return[_0x665b57,!![]];});});}else{_0x338242[_0x8893('0x94')]=null;}_0x338242[_0x8893('0x97')]=_0x283790['id'];return db[_0x8893('0x95')][_0x8893('0x65')]({'where':_0x338242})[_0x8893('0x3d')](function(_0x24a800){if(_0x24a800){return[_0x24a800,![]];}return db[_0x8893('0x95')]['create'](_0x37df26)[_0x8893('0x3d')](function(_0x4ccf14){return[_0x4ccf14,!![]];});});}})[_0x8893('0x98')](function(_0x5404db,_0x46638b){if(_0x5404db){_0x34071a=_0x46638b;if(!_0x46638b){var _0x60c612={'from':(_0x5202f3[_0x8893('0x91')][_0x8893('0x92')]||'')+'\x20'+(_0x5202f3[_0x8893('0x91')][_0x8893('0x93')]||'')};if(_0x4dc66b['body']['threadId']&&_0x4dc66b[_0x8893('0x68')]['messageId']&&_0x4dc66b['body'][_0x8893('0x94')]!=_0x4dc66b[_0x8893('0x68')]['messageId']){_0x60c612[_0x8893('0x94')]=_0x4dc66b[_0x8893('0x68')][_0x8893('0x99')];}return _0x5404db[_0x8893('0x3c')](_0x60c612);}else{return _0x5404db;}}})[_0x8893('0x3d')](function(_0x354d3a){_0x5202f3[_0x8893('0x9a')]=_0x354d3a[_0x8893('0x3f')]({'plain':!![]});_0x5202f3[_0x8893('0x9a')][_0x8893('0x9b')]=_0x34071a;if(_0x5202f3[_0x8893('0x9a')][_0x8893('0x9b')]){if(_0x5202f3[_0x8893('0x8b')]['autoclose']){_0x5202f3[_0x8893('0x8c')][_0x8893('0x9c')]({'id':0x0,'priority':_0x5202f3[_0x8893('0x8c')][_0x8893('0x5f')]+0x1,'app':_0x8893('0x9d'),'appdata':_0x8893('0x9e'),'interval':_0x8893('0x9f')});}}return db[_0x8893('0xa0')][_0x8893('0x61')]({'body':_0x4dc66b[_0x8893('0x68')][_0x8893('0x68')],'OpenchannelAccountId':_0x4dc66b[_0x8893('0x5d')]['id'],'OpenchannelInteractionId':_0x354d3a['id'],'direction':'in','ContactId':_0x5202f3[_0x8893('0x91')]['id'],'AttachmentId':_0x4dc66b['body'][_0x8893('0xa1')]});})[_0x8893('0x3d')](function(_0x1a71e9){_0x5202f3[_0x8893('0x2d')]=_0x1a71e9;if(_0x5202f3[_0x8893('0x9a')][_0x8893('0xa2')]){return db['User']['find']({'attributes':['id',_0x8893('0x42')],'where':{'id':_0x5202f3[_0x8893('0x9a')]['UserId']}})[_0x8893('0x3d')](function(_0x5db4fe){if(_0x5db4fe){_0x5202f3[_0x8893('0x8c')][_0x8893('0xa3')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5db4fe[_0x8893('0x42')]+','+(_0x5202f3[_0x8893('0x8b')][_0x8893('0xa4')]||0xa),'interval':_0x8893('0x9f')});_0x5202f3[_0x8893('0xa5')]=![];}return respondWithRpcPromise(_0x8893('0xa6'),_0x8893('0xa7'),_0x5202f3);});}return respondWithRpcPromise('Start','startRouting',_0x5202f3);})[_0x8893('0x3d')](function(_0x6c4d89){respondWithRpcPromise(_0x8893('0xa8'),'EventManager',{'event':_0x8893('0x77'),'message':_0x6c4d89},client9002);return _0x6c4d89;})[_0x8893('0x3d')](respondWithResult(_0x5de069,null))[_0x8893('0x30')](handleError(_0x5de069,null));};exports['addApplications']=function(_0x458bc7,_0x3b2f84,_0x15b6e2){return db[_0x8893('0x46')][_0x8893('0x6d')]({'where':{'id':_0x458bc7[_0x8893('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3b2f84,null))[_0x8893('0x3d')](function(_0x3635ae){if(_0x3635ae){return db[_0x8893('0xa9')][_0x8893('0xaa')](function(_0x22560e){return db[_0x8893('0x8a')]['destroy']({'where':{'OpenchannelAccountId':_0x458bc7[_0x8893('0x5d')]['id']},'transaction':_0x22560e})[_0x8893('0x3d')](function(_0x4fbbd0){var _0x79bd9f=_['map'](_0x458bc7['body'],function(_0x7b2293){_0x7b2293['OpenchannelAccountId']=_0x458bc7[_0x8893('0x5d')]['id'];return _0x7b2293;});return db[_0x8893('0x8a')]['bulkCreate'](_0x79bd9f,{'transaction':_0x22560e});});})[_0x8893('0x3d')](function(){return db[_0x8893('0x8a')][_0x8893('0xab')]({'where':{'OpenchannelAccountId':_0x458bc7[_0x8893('0x5d')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x3b2f84,null))[_0x8893('0x30')](handleError(_0x3b2f84,null));};exports[_0x8893('0xac')]=function(_0x4a1b21,_0x422b96,_0x55adcd){var _0x2a74fa={};var _0xb2fba4={};var _0x6baa1c;var _0x3ea621;return db[_0x8893('0x46')][_0x8893('0x6d')]({'where':{'id':_0x4a1b21[_0x8893('0x5d')]['id']}})['then'](handleEntityNotFound(_0x422b96,null))[_0x8893('0x3d')](function(_0x5784ce){if(_0x5784ce){_0x6baa1c=_0x5784ce;_0xb2fba4[_0x8893('0x4e')]=_[_0x8893('0x4c')](db[_0x8893('0x8a')][_0x8893('0x47')]);_0xb2fba4[_0x8893('0x4b')]=_[_0x8893('0x4c')](_0x4a1b21['query']);_0xb2fba4[_0x8893('0x4d')]=_[_0x8893('0x4f')](_0xb2fba4['model'],_0xb2fba4['query']);_0x2a74fa[_0x8893('0x51')]=_[_0x8893('0x4f')](_0xb2fba4['model'],qs[_0x8893('0x50')](_0x4a1b21['query']['fields']));_0x2a74fa[_0x8893('0x51')]=_0x2a74fa[_0x8893('0x51')]['length']?_0x2a74fa[_0x8893('0x51')]:_0xb2fba4['model'];_0x2a74fa['order']=qs[_0x8893('0x54')](_0x4a1b21[_0x8893('0x4b')][_0x8893('0x54')]);_0x2a74fa['where']=qs[_0x8893('0x4d')](_['pick'](_0x4a1b21[_0x8893('0x4b')],_0xb2fba4[_0x8893('0x4d')]));if(_0x4a1b21[_0x8893('0x4b')][_0x8893('0x57')]){_0x2a74fa[_0x8893('0x55')]=_['merge'](_0x2a74fa[_0x8893('0x55')],{'$or':_['map'](_0x2a74fa[_0x8893('0x51')],function(_0x495a95){var _0x2d0369={};_0x2d0369[_0x495a95]={'$like':'%'+_0x4a1b21['query']['filter']+'%'};return _0x2d0369;})});}_0x2a74fa=_[_0x8893('0x58')]({},_0x2a74fa,_0x4a1b21[_0x8893('0x5a')]);return _0x6baa1c[_0x8893('0xac')](_0x2a74fa);}})[_0x8893('0x3d')](function(_0x314c93){if(_0x314c93){_0x3ea621=_0x314c93[_0x8893('0x5f')];if(!_0x4a1b21[_0x8893('0x4b')][_0x8893('0x52')]('nolimit')){_0x2a74fa[_0x8893('0x36')]=qs['limit'](_0x4a1b21[_0x8893('0x4b')][_0x8893('0x36')]);_0x2a74fa['offset']=qs[_0x8893('0x35')](_0x4a1b21['query'][_0x8893('0x35')]);}return _0x6baa1c['getApplications'](_0x2a74fa);}})[_0x8893('0x3d')](function(_0x46c114){if(_0x46c114){return _0x46c114?{'count':_0x3ea621,'rows':_0x46c114}:null;}})[_0x8893('0x3d')](respondWithResult(_0x422b96,null))[_0x8893('0x30')](handleError(_0x422b96,null));};exports[_0x8893('0xad')]=function(_0x1d5b8b,_0xd6fe8b,_0x152c12){var _0xd16c14={'raw':![],'where':{}};var _0x371db1={};var _0x4e2cdc={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8893('0x6d')]({'where':{'id':_0x1d5b8b[_0x8893('0x5d')]['id']}})[_0x8893('0x3d')](handleEntityNotFound(_0xd6fe8b,null))[_0x8893('0x3d')](function(_0x4f7f5e){if(_0x4f7f5e){_0x371db1['model']=_['keys'](db['OpenchannelInteraction'][_0x8893('0x47')]);_0x371db1[_0x8893('0x4b')]=_[_0x8893('0x4c')](_0x1d5b8b[_0x8893('0x4b')]);_0x371db1[_0x8893('0x4d')]=_[_0x8893('0x4f')](_0x371db1[_0x8893('0x4e')],_0x371db1[_0x8893('0x4b')]);_0xd16c14[_0x8893('0x51')]=_[_0x8893('0x4f')](_0x371db1[_0x8893('0x4e')],qs['fields'](_0x1d5b8b[_0x8893('0x4b')][_0x8893('0x50')]));_0xd16c14[_0x8893('0x51')]=_0xd16c14[_0x8893('0x51')][_0x8893('0x5f')]?_0xd16c14[_0x8893('0x51')]:_0x371db1[_0x8893('0x4e')];if(!_0x1d5b8b['query'][_0x8893('0x52')](_0x8893('0x53'))){_0xd16c14[_0x8893('0x36')]=qs[_0x8893('0x36')](_0x1d5b8b[_0x8893('0x4b')][_0x8893('0x36')]);_0xd16c14['offset']=qs[_0x8893('0x35')](_0x1d5b8b['query'][_0x8893('0x35')]);}_0xd16c14[_0x8893('0xae')]=qs[_0x8893('0x54')](_0x1d5b8b[_0x8893('0x4b')][_0x8893('0x54')]);_0xd16c14[_0x8893('0x55')]=qs[_0x8893('0x4d')](_['pick'](_0x1d5b8b[_0x8893('0x4b')],_0x371db1[_0x8893('0x4d')]));_0xd16c14[_0x8893('0x55')][_0x8893('0x72')]=_0x4f7f5e['id'];if(_0x1d5b8b[_0x8893('0x4b')][_0x8893('0x57')]){_0xd16c14[_0x8893('0x55')]=_[_0x8893('0x58')](_0xd16c14[_0x8893('0x55')],{'$or':_['map'](_0xd16c14[_0x8893('0x51')],function(_0xe01333){var _0x2ac0c5={};_0x2ac0c5[_0xe01333]={'$like':'%'+_0x1d5b8b[_0x8893('0x4b')][_0x8893('0x57')]+'%'};return _0x2ac0c5;})});}_0xd16c14=_[_0x8893('0x58')]({},_0xd16c14,_0x1d5b8b[_0x8893('0x5a')]);return db[_0x8893('0x95')][_0x8893('0x34')]({'where':_0xd16c14[_0x8893('0x55')]})['then'](function(_0x1ed46d){_0x4e2cdc[_0x8893('0x34')]=_0x1ed46d;if(_0x1d5b8b[_0x8893('0x4b')][_0x8893('0x60')]){_0xd16c14[_0x8893('0x5b')]=[{'model':db[_0x8893('0x78')],'as':_0x8893('0xaf'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x8893('0x42'),_0x8893('0xb0'),_0x8893('0xb1')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x8893('0xb2')],'where':_0x1d5b8b[_0x8893('0x4b')][_0x8893('0xb3')]?{'id':_0x1d5b8b['query'][_0x8893('0xb3')]}:undefined,'required':_0x1d5b8b[_0x8893('0x4b')][_0x8893('0xb3')]?!![]:![]}];}return db[_0x8893('0x95')][_0x8893('0x5c')](_0xd16c14);})['then'](function(_0x360457){_0x4e2cdc[_0x8893('0x75')]=_0x360457;return _0x4e2cdc;});}})[_0x8893('0x3d')](respondWithFilteredResult(_0xd6fe8b,_0xd16c14))[_0x8893('0x30')](handleError(_0xd6fe8b,null));};exports[_0x8893('0xb4')]=function(_0x463c7b,_0x91c67d,_0x37445d){return db[_0x8893('0x46')][_0x8893('0x65')]({'where':{'id':_0x463c7b[_0x8893('0x5d')]['id']}})[_0x8893('0x3d')](handleEntityNotFound(_0x91c67d,null))['then'](function(_0x547e5a){if(_0x547e5a){return _0x547e5a[_0x8893('0xb4')](_0x463c7b['body'][_0x8893('0x70')],_['omit'](_0x463c7b[_0x8893('0x68')],['ids','id'])||{})[_0x8893('0x98')](function(_0x5d6fe5){for(var _0x3adb78=0x0;_0x3adb78<_0x463c7b[_0x8893('0x68')][_0x8893('0x70')]['length'];_0x3adb78+=0x1){socket[_0x8893('0xb5')](_0x8893('0xb6'),{'UserId':_0x463c7b[_0x8893('0x68')][_0x8893('0x70')][_0x3adb78],'OpenchannelAccountId':_0x463c7b['params']['id']});}return _0x5d6fe5;});}})['then'](respondWithResult(_0x91c67d,null))[_0x8893('0x30')](handleError(_0x91c67d,null));};exports[_0x8893('0xb7')]=function(_0x1d6868,_0x1249f1,_0x3e5aa1){return db[_0x8893('0x46')]['find']({'where':{'id':_0x1d6868[_0x8893('0x5d')]['id']}})[_0x8893('0x3d')](handleEntityNotFound(_0x1249f1,null))[_0x8893('0x3d')](function(_0x30466c){if(_0x30466c){return _0x30466c[_0x8893('0xb7')](_0x1d6868['query'][_0x8893('0x70')])[_0x8893('0x3d')](function(){if(_['isArray'](_0x1d6868[_0x8893('0x4b')][_0x8893('0x70')])){for(var _0x1ee126=0x0;_0x1ee126<_0x1d6868[_0x8893('0x4b')][_0x8893('0x70')][_0x8893('0x5f')];_0x1ee126+=0x1){socket[_0x8893('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1d6868[_0x8893('0x4b')][_0x8893('0x70')][_0x1ee126]),'OpenchannelAccountId':Number(_0x1d6868[_0x8893('0x5d')]['id'])});}}else{socket[_0x8893('0xb5')](_0x8893('0xb8'),{'UserId':Number(_0x1d6868[_0x8893('0x4b')]['ids']),'OpenchannelAccountId':Number(_0x1d6868[_0x8893('0x5d')]['id'])});}});}})[_0x8893('0x3d')](respondWithStatusCode(_0x1249f1,null))[_0x8893('0x30')](handleError(_0x1249f1,null));};exports['getAgents']=function(_0x125120,_0x303d31,_0x5404a4){var _0x56a014={};var _0x42b6d3={};var _0x1354d1;var _0x114c73;return db[_0x8893('0x46')][_0x8893('0x6d')]({'where':{'id':_0x125120[_0x8893('0x5d')]['id']}})[_0x8893('0x3d')](handleEntityNotFound(_0x303d31,null))[_0x8893('0x3d')](function(_0x1cf7de){if(_0x1cf7de){_0x1354d1=_0x1cf7de;_0x42b6d3[_0x8893('0x4e')]=_['keys'](db['User'][_0x8893('0x47')]);_0x42b6d3['query']=_[_0x8893('0x4c')](_0x125120[_0x8893('0x4b')]);_0x42b6d3[_0x8893('0x4d')]=_[_0x8893('0x4f')](_0x42b6d3[_0x8893('0x4e')],_0x42b6d3[_0x8893('0x4b')]);_0x56a014[_0x8893('0x51')]=_['intersection'](_0x42b6d3[_0x8893('0x4e')],qs[_0x8893('0x50')](_0x125120[_0x8893('0x4b')]['fields']));_0x56a014[_0x8893('0x51')]=_0x56a014[_0x8893('0x51')][_0x8893('0x5f')]?_0x56a014[_0x8893('0x51')]:_0x42b6d3[_0x8893('0x4e')];_0x56a014[_0x8893('0xae')]=qs[_0x8893('0x54')](_0x125120['query'][_0x8893('0x54')]);_0x56a014['where']=qs[_0x8893('0x4d')](_[_0x8893('0x56')](_0x125120[_0x8893('0x4b')],_0x42b6d3[_0x8893('0x4d')]));if(_0x125120[_0x8893('0x4b')][_0x8893('0x57')]){_0x56a014[_0x8893('0x55')]=_[_0x8893('0x58')](_0x56a014['where'],{'$or':_['map'](_0x56a014[_0x8893('0x51')],function(_0x5945a9){var _0xc21e6a={};_0xc21e6a[_0x5945a9]={'$like':'%'+_0x125120[_0x8893('0x4b')]['filter']+'%'};return _0xc21e6a;})});}_0x56a014=_[_0x8893('0x58')]({},_0x56a014,_0x125120['options']);return _0x1354d1[_0x8893('0xb9')](_0x56a014);}})[_0x8893('0x3d')](function(_0x3ff3fa){if(_0x3ff3fa){_0x114c73=_0x3ff3fa[_0x8893('0x5f')];if(!_0x125120[_0x8893('0x4b')][_0x8893('0x52')](_0x8893('0x53'))){_0x56a014['limit']=qs[_0x8893('0x36')](_0x125120[_0x8893('0x4b')][_0x8893('0x36')]);_0x56a014[_0x8893('0x35')]=qs[_0x8893('0x35')](_0x125120[_0x8893('0x4b')][_0x8893('0x35')]);}return _0x1354d1[_0x8893('0xb9')](_0x56a014);}})['then'](function(_0x5eb8dd){if(_0x5eb8dd){return _0x5eb8dd?{'count':_0x114c73,'rows':_0x5eb8dd}:null;}})['then'](respondWithResult(_0x303d31,null))[_0x8893('0x30')](handleError(_0x303d31,null));};exports['send']=function(_0x5a6945,_0xdc20e5,_0x573e72){var _0x472b95,_0x48702a,_0x2956a1;if(_[_0x8893('0x83')](_0x5a6945[_0x8893('0x68')][_0x8893('0x68')])||_0x5a6945[_0x8893('0x68')][_0x8893('0x68')]===''){throw new db['Sequelize']['ValidationError'](_0x8893('0x82'));}if(_[_0x8893('0x83')](_0x5a6945[_0x8893('0x68')]['to'])){}_0x472b95=_0x5a6945[_0x8893('0x68')]['to'];return db[_0x8893('0x46')][_0x8893('0x6d')]({'where':{'id':_0x5a6945['params']['id']}})[_0x8893('0x3d')](handleEntityNotFound(_0xdc20e5,null))[_0x8893('0x3d')](function(_0x5a5209){if(_0x5a5209){return db[_0x8893('0x46')][_0x8893('0x65')]({'where':{'id':_0x5a5209['id']},'include':[{'model':db[_0x8893('0xba')],'as':'List','include':[{'model':db[_0x8893('0x78')],'as':_0x8893('0x89'),'where':{[_0x5a5209[_0x8893('0x84')]]:_0x472b95},'limit':0x1,'order':[[_0x8893('0x7d'),_0x8893('0xbb')]]}]}]})[_0x8893('0x3d')](handleEntityNotFound(_0xdc20e5,null))[_0x8893('0x3d')](function(_0x106338){if(_0x106338&&_0x106338['List']){_0x48702a=_0x106338[_0x8893('0x3f')]({'plain':!![]});if(_0x48702a['List']&&_0x48702a[_0x8893('0x88')][_0x8893('0x89')][_0x8893('0x5f')]){return _0x48702a['List'][_0x8893('0x89')][0x0];}return db[_0x8893('0x78')][_0x8893('0x61')](_[_0x8893('0x1c')](_0x5a6945[_0x8893('0x68')],{'firstName':_0x472b95,[_0x106338[_0x8893('0x84')]]:_0x472b95,'phone':_0x472b95,'ListId':_0x48702a['ListId']}));}})[_0x8893('0x3d')](handleEntityNotFound(_0xdc20e5,null))[_0x8893('0x3d')](function(_0x4e15ea){if(_0x4e15ea){_0x2956a1=_0x4e15ea;return db[_0x8893('0x95')][_0x8893('0x65')]({'where':{'ContactId':_0x2956a1['id'],'closed':![],'OpenchannelAccountId':_0x48702a['id']}})['then'](function(_0x49c21b){if(_0x49c21b){return[_0x49c21b,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x5a6945[_0x8893('0x64')]['id'],'ContactId':_0x2956a1['id'],'OpenchannelAccountId':_0x48702a['id'],'lastMsgDirection':'out','Messages':[_[_0x8893('0x58')](_0x5a6945[_0x8893('0x68')],{'read':![],'body':_0x5a6945[_0x8893('0x68')]['body'],'OpenchannelAccountId':_0x48702a['id'],'UserId':_0x5a6945[_0x8893('0x64')]['id'],'ContactId':_0x2956a1['id']})]},{'include':[{'model':db[_0x8893('0xa0')],'as':_0x8893('0xbc')}]})[_0x8893('0x3d')](function(_0x3522ba){return[_0x3522ba,!![]];});});}})[_0x8893('0x98')](function(_0x540959,_0x58a656){if(_0x58a656){return _0x540959;}return db[_0x8893('0xa0')]['create'](_[_0x8893('0x58')](_0x5a6945[_0x8893('0x68')],{'read':![],'body':_0x5a6945['body'][_0x8893('0x68')],'OpenchannelAccountId':_0x48702a['id'],'OpenchannelInteractionId':_0x540959['id'],'UserId':_0x5a6945[_0x8893('0x64')]['id'],'ContactId':_0x2956a1['id']}))['then'](function(_0x15601d){_0x540959['dataValues'][_0x8893('0xbc')]=[];_0x540959[_0x8893('0xbd')][_0x8893('0xbc')][_0x8893('0x9c')](_0x15601d[_0x8893('0xbd')]);return _0x540959;});});}})[_0x8893('0x3d')](respondWithResult(_0xdc20e5,null))[_0x8893('0x30')](handleError(_0xdc20e5,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 2a48740..b06da50 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 _0xd9e3=['OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x264f48,_0x2c82d8){var _0xb99167=function(_0x4a6be7){while(--_0x4a6be7){_0x264f48['push'](_0x264f48['shift']());}};_0xb99167(++_0x2c82d8);}(_0xd9e3,0x185));var _0x3d9e=function(_0x182fba,_0x197ecf){_0x182fba=_0x182fba-0x0;var _0x118c11=_0xd9e3[_0x182fba];return _0x118c11;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x3d9e('0x0'))['db'][_0x3d9e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x3d9e('0x2')](0x0);var events={'afterCreate':_0x3d9e('0x3'),'afterUpdate':_0x3d9e('0x4'),'afterDestroy':_0x3d9e('0x5')};function emitEvent(_0x4f0f18){return function(_0x2e6510,_0x43403d,_0x467929){OpenchannelAccountEvents[_0x3d9e('0x6')](_0x4f0f18+':'+_0x2e6510['id'],_0x2e6510);OpenchannelAccountEvents['emit'](_0x4f0f18,_0x2e6510);_0x467929(null);};}for(var e in events){if(events[_0x3d9e('0x7')](e)){var event=events[e];OpenchannelAccount[_0x3d9e('0x8')](e,emitEvent(event));}}module[_0x3d9e('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xd517=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x11a9c2,_0x16284d){var _0x4ab610=function(_0x39f980){while(--_0x39f980){_0x11a9c2['push'](_0x11a9c2['shift']());}};_0x4ab610(++_0x16284d);}(_0xd517,0x1a6));var _0x7d51=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0xd517[_0x54b396];return _0x532e6d;};'use strict';var EventEmitter=require(_0x7d51('0x0'));var OpenchannelAccount=require(_0x7d51('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x7d51('0x2')](0x0);var events={'afterCreate':_0x7d51('0x3'),'afterUpdate':_0x7d51('0x4'),'afterDestroy':'remove'};function emitEvent(_0x47a1f0){return function(_0x1f29da,_0x1dd30c,_0x36f223){OpenchannelAccountEvents[_0x7d51('0x5')](_0x47a1f0+':'+_0x1f29da['id'],_0x1f29da);OpenchannelAccountEvents['emit'](_0x47a1f0,_0x1f29da);_0x36f223(null);};}for(var e in events){if(events[_0x7d51('0x6')](e)){var event=events[e];OpenchannelAccount[_0x7d51('0x7')](e,emitEvent(event));}}module[_0x7d51('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 188f826..27f2d57 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 _0x16d9=['OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define'];(function(_0x43f4c5,_0x884353){var _0x1bc3fd=function(_0xb4a0e8){while(--_0xb4a0e8){_0x43f4c5['push'](_0x43f4c5['shift']());}};_0x1bc3fd(++_0x884353);}(_0x16d9,0x1f0));var _0x916d=function(_0x31d03c,_0x158cef){_0x31d03c=_0x31d03c-0x0;var _0x420e61=_0x16d9[_0x31d03c];return _0x420e61;};'use strict';var _=require(_0x916d('0x0'));var util=require(_0x916d('0x1'));var logger=require(_0x916d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x916d('0x3'));var rp=require(_0x916d('0x4'));var fs=require('fs');var path=require(_0x916d('0x5'));var rimraf=require(_0x916d('0x6'));var config=require(_0x916d('0x7'));var attributes=require(_0x916d('0x8'));module[_0x916d('0x9')]=function(_0x200f92,_0x39ab30){return _0x200f92[_0x916d('0xa')](_0x916d('0xb'),attributes,{'tableName':_0x916d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cea=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1cea,0x142));var _0xa1ce=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0x1cea[_0x2f5a22];return _0x326b70;};'use strict';var _=require(_0xa1ce('0x0'));var util=require(_0xa1ce('0x1'));var logger=require(_0xa1ce('0x2'))(_0xa1ce('0x3'));var moment=require(_0xa1ce('0x4'));var BPromise=require(_0xa1ce('0x5'));var rp=require(_0xa1ce('0x6'));var fs=require('fs');var path=require(_0xa1ce('0x7'));var rimraf=require(_0xa1ce('0x8'));var config=require(_0xa1ce('0x9'));var attributes=require('./openchannelAccount.attributes');module['exports']=function(_0x5f1fa0,_0xd97ffe){return _0x5f1fa0[_0xa1ce('0xa')](_0xa1ce('0xb'),attributes,{'tableName':_0xa1ce('0xc'),'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 006855a..591afcd 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 _0x7c77=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./openchannelAccount.socket','register','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7c77,0x174));var _0x77c7=function(_0xd83a4b,_0x514d84){_0xd83a4b=_0xd83a4b-0x0;var _0x4ad020=_0x7c77[_0xd83a4b];return _0x4ad020;};'use strict';var _=require(_0x77c7('0x0'));var util=require('util');var moment=require(_0x77c7('0x1'));var BPromise=require(_0x77c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x77c7('0x4'))('rpc');var config=require(_0x77c7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x77c7('0x6')][_0x77c7('0x7')]({'port':0x232a});config[_0x77c7('0x8')]=_['defaults'](config[_0x77c7('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x77c7('0x9'))(new Redis(config[_0x77c7('0x8')]));require(_0x77c7('0xa'))[_0x77c7('0xb')](socket);function respondWithRpcPromise(_0x5a41f5,_0x5cdcbb,_0x5e0bd4){return new BPromise(function(_0x2e3e44,_0x26c139){return client['request'](_0x5a41f5,_0x5e0bd4)['then'](function(_0x171d4f){logger[_0x77c7('0xc')](_0x77c7('0xd'),_0x5cdcbb,_0x77c7('0xe'));logger[_0x77c7('0xf')](_0x77c7('0x10'),_0x5cdcbb,_0x77c7('0xe'),JSON[_0x77c7('0x11')](_0x171d4f));if(_0x171d4f['error']){if(_0x171d4f[_0x77c7('0x12')][_0x77c7('0x13')]===0x1f4){logger['error'](_0x77c7('0xd'),_0x5cdcbb,_0x171d4f[_0x77c7('0x12')][_0x77c7('0x14')]);return _0x26c139(_0x171d4f['error'][_0x77c7('0x14')]);}logger[_0x77c7('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x5cdcbb,_0x171d4f[_0x77c7('0x12')][_0x77c7('0x14')]);return _0x2e3e44(_0x171d4f['error'][_0x77c7('0x14')]);}else{logger['info'](_0x77c7('0xd'),_0x5cdcbb,'request\x20sent');_0x2e3e44(_0x171d4f[_0x77c7('0x15')][_0x77c7('0x14')]);}})[_0x77c7('0x16')](function(_0x3ac7ed){logger[_0x77c7('0x12')](_0x77c7('0xd'),_0x5cdcbb,_0x3ac7ed);_0x26c139(_0x3ac7ed);});});} \ No newline at end of file +var _0x365a=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1d15e3,_0x169246){var _0x343de1=function(_0x1e432d){while(--_0x1e432d){_0x1d15e3['push'](_0x1d15e3['shift']());}};_0x343de1(++_0x169246);}(_0x365a,0xaf));var _0xa365=function(_0x266f8b,_0x5a0b10){_0x266f8b=_0x266f8b-0x0;var _0x59b514=_0x365a[_0x266f8b];return _0x59b514;};'use strict';var _=require(_0xa365('0x0'));var util=require(_0xa365('0x1'));var moment=require(_0xa365('0x2'));var BPromise=require('bluebird');var rs=require(_0xa365('0x3'));var fs=require('fs');var Redis=require(_0xa365('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa365('0x5'));var logger=require(_0xa365('0x6'))('rpc');var config=require(_0xa365('0x7'));var jayson=require(_0xa365('0x8'));var client=jayson[_0xa365('0x9')][_0xa365('0xa')]({'port':0x232a});config[_0xa365('0xb')]=_['defaults'](config[_0xa365('0xb')],{'host':_0xa365('0xc'),'port':0x18eb});var socket=require(_0xa365('0xd'))(new Redis(config[_0xa365('0xb')]));require('./openchannelAccount.socket')[_0xa365('0xe')](socket);function respondWithRpcPromise(_0x7361b8,_0x2c6f87,_0x43b64f){return new BPromise(function(_0x25e87a,_0x347ae4){return client[_0xa365('0xf')](_0x7361b8,_0x43b64f)[_0xa365('0x10')](function(_0x1d1ad1){logger[_0xa365('0x11')](_0xa365('0x12'),_0x2c6f87,_0xa365('0x13'));logger[_0xa365('0x14')](_0xa365('0x15'),_0x2c6f87,'request\x20sent',JSON[_0xa365('0x16')](_0x1d1ad1));if(_0x1d1ad1[_0xa365('0x17')]){if(_0x1d1ad1[_0xa365('0x17')]['code']===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2c6f87,_0x1d1ad1[_0xa365('0x17')][_0xa365('0x18')]);return _0x347ae4(_0x1d1ad1[_0xa365('0x17')][_0xa365('0x18')]);}logger[_0xa365('0x17')](_0xa365('0x12'),_0x2c6f87,_0x1d1ad1[_0xa365('0x17')]['message']);return _0x25e87a(_0x1d1ad1[_0xa365('0x17')][_0xa365('0x18')]);}else{logger[_0xa365('0x11')](_0xa365('0x12'),_0x2c6f87,_0xa365('0x13'));_0x25e87a(_0x1d1ad1[_0xa365('0x19')][_0xa365('0x18')]);}})['catch'](function(_0x2ac69d){logger[_0xa365('0x17')](_0xa365('0x12'),_0x2c6f87,_0x2ac69d);_0x347ae4(_0x2ac69d);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 4b2897e..2dc5178 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 _0x8f3d=['register','length','openchannelAccount:','./openchannelAccount.events','remove','update','emit','removeListener'];(function(_0x21fbb1,_0x120f56){var _0x2f7b69=function(_0x37f84c){while(--_0x37f84c){_0x21fbb1['push'](_0x21fbb1['shift']());}};_0x2f7b69(++_0x120f56);}(_0x8f3d,0xeb));var _0xd8f3=function(_0x423be1,_0x216019){_0x423be1=_0x423be1-0x0;var _0x51d1c6=_0x8f3d[_0x423be1];return _0x51d1c6;};'use strict';var OpenchannelAccountEvents=require(_0xd8f3('0x0'));var events=['save',_0xd8f3('0x1'),_0xd8f3('0x2')];function createListener(_0xe697f9,_0x507ada){return function(_0x2dd04a){_0x507ada[_0xd8f3('0x3')](_0xe697f9,_0x2dd04a);};}function removeListener(_0x5d9db8,_0x21d705){return function(){OpenchannelAccountEvents[_0xd8f3('0x4')](_0x5d9db8,_0x21d705);};}exports[_0xd8f3('0x5')]=function(_0x5e5333){for(var _0x84dc1c=0x0,_0x47ee9a=events[_0xd8f3('0x6')];_0x84dc1c<_0x47ee9a;_0x84dc1c++){var _0x511b1f=events[_0x84dc1c];var _0x508736=createListener(_0xd8f3('0x7')+_0x511b1f,_0x5e5333);OpenchannelAccountEvents['on'](_0x511b1f,_0x508736);}}; \ No newline at end of file +var _0xd68a=['register','./openchannelAccount.events','save','remove','emit','removeListener'];(function(_0x589f71,_0x212326){var _0x5763bd=function(_0x2cb8e1){while(--_0x2cb8e1){_0x589f71['push'](_0x589f71['shift']());}};_0x5763bd(++_0x212326);}(_0xd68a,0x1cf));var _0xad68=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xd68a[_0x164eca];return _0x2ce562;};'use strict';var OpenchannelAccountEvents=require(_0xad68('0x0'));var events=[_0xad68('0x1'),_0xad68('0x2'),'update'];function createListener(_0x2f6374,_0x43e40a){return function(_0x291825){_0x43e40a[_0xad68('0x3')](_0x2f6374,_0x291825);};}function removeListener(_0xee9483,_0x3da9cc){return function(){OpenchannelAccountEvents[_0xad68('0x4')](_0xee9483,_0x3da9cc);};}exports[_0xad68('0x5')]=function(_0x1a352a){for(var _0x1bfbc1=0x0,_0x51958c=events['length'];_0x1bfbc1<_0x51958c;_0x1bfbc1++){var _0x5dbff6=events[_0x1bfbc1];var _0x5a3785=createListener('openchannelAccount:'+_0x5dbff6,_0x1a352a);OpenchannelAccountEvents['on'](_0x5dbff6,_0x5a3785);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e55dd3c..df286ad 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 _0xc31e=['isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get'];(function(_0x5a5aee,_0x39dd0a){var _0x279baa=function(_0x28dd3f){while(--_0x28dd3f){_0x5a5aee['push'](_0x5a5aee['shift']());}};_0x279baa(++_0x39dd0a);}(_0xc31e,0xd6));var _0xec31=function(_0x3eaf14,_0x30eb83){_0x3eaf14=_0x3eaf14-0x0;var _0x5d960e=_0xc31e[_0x3eaf14];return _0x5d960e;};'use strict';var multer=require('multer');var util=require(_0xec31('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xec31('0x1'));var router=express[_0xec31('0x2')]();var auth=require(_0xec31('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xec31('0x4'));var controller=require(_0xec31('0x5'));router[_0xec31('0x6')]('/',auth[_0xec31('0x7')](),controller[_0xec31('0x8')]);router[_0xec31('0x6')](_0xec31('0x9'),auth[_0xec31('0x7')](),controller[_0xec31('0xa')]);router[_0xec31('0xb')]('/',auth['isAuthenticated'](),controller[_0xec31('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xec31('0xd')]);router[_0xec31('0xe')](_0xec31('0x9'),auth[_0xec31('0x7')](),controller[_0xec31('0xf')]);module[_0xec31('0x10')]=router; \ No newline at end of file +var _0xa2b4=['destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x39782f,_0x4aa931){var _0x47768c=function(_0x2672e4){while(--_0x2672e4){_0x39782f['push'](_0x39782f['shift']());}};_0x47768c(++_0x4aa931);}(_0xa2b4,0x1e7));var _0x4a2b=function(_0x37cfe5,_0x35d0dc){_0x37cfe5=_0x37cfe5-0x0;var _0x53ff78=_0xa2b4[_0x37cfe5];return _0x53ff78;};'use strict';var multer=require(_0x4a2b('0x0'));var util=require(_0x4a2b('0x1'));var path=require(_0x4a2b('0x2'));var timeout=require(_0x4a2b('0x3'));var express=require('express');var router=express[_0x4a2b('0x4')]();var auth=require(_0x4a2b('0x5'));var interaction=require(_0x4a2b('0x6'));var config=require(_0x4a2b('0x7'));var controller=require(_0x4a2b('0x8'));router[_0x4a2b('0x9')]('/',auth[_0x4a2b('0xa')](),controller[_0x4a2b('0xb')]);router[_0x4a2b('0x9')](_0x4a2b('0xc'),auth[_0x4a2b('0xa')](),controller['show']);router[_0x4a2b('0xd')]('/',auth[_0x4a2b('0xa')](),controller[_0x4a2b('0xe')]);router[_0x4a2b('0xf')](_0x4a2b('0xc'),auth[_0x4a2b('0xa')](),controller[_0x4a2b('0x10')]);router['delete'](_0x4a2b('0xc'),auth[_0x4a2b('0xa')](),controller[_0x4a2b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 3f3c92b..c4363f2 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 _0x199e=['INTEGER','STRING','noop','exports'];(function(_0x419334,_0x42d4cb){var _0xb964ae=function(_0x182d24){while(--_0x182d24){_0x419334['push'](_0x419334['shift']());}};_0xb964ae(++_0x42d4cb);}(_0x199e,0x103));var _0xe199=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0x199e[_0x2f54b6];return _0x169f21;};'use strict';var Sequelize=require('sequelize');module[_0xe199('0x0')]={'priority':{'type':Sequelize[_0xe199('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe199('0x2')],'allowNull':![],'defaultValue':_0xe199('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe199('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x8f5b=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x8f5b,0x196));var _0xb8f5=function(_0x55228b,_0x405709){_0x55228b=_0x55228b-0x0;var _0x3a54ef=_0x8f5b[_0x55228b];return _0x3a54ef;};'use strict';var Sequelize=require(_0xb8f5('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb8f5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb8f5('0x2')],'allowNull':![],'defaultValue':_0xb8f5('0x3')},'appdata':{'type':Sequelize[_0xb8f5('0x4')]()},'description':{'type':Sequelize[_0xb8f5('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb8f5('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index b7c7011..bba9f5e 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 _0x7626=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','Content-Range','apply','reject','then','destroy','end','sendStatus','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x4b5a9e,_0x467811){var _0x1c2d77=function(_0x26def9){while(--_0x26def9){_0x4b5a9e['push'](_0x4b5a9e['shift']());}};_0x1c2d77(++_0x467811);}(_0x7626,0x178));var _0x6762=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x7626[_0x11ca63];return _0x41f1f6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6762('0x0'));var rimraf=require(_0x6762('0x1'));var zipdir=require(_0x6762('0x2'));var jsonpatch=require(_0x6762('0x3'));var rp=require('request-promise');var moment=require(_0x6762('0x4'));var BPromise=require(_0x6762('0x5'));var Mustache=require('mustache');var util=require(_0x6762('0x6'));var path=require(_0x6762('0x7'));var sox=require(_0x6762('0x8'));var csv=require(_0x6762('0x9'));var ejs=require(_0x6762('0xa'));var fs=require('fs');var _=require(_0x6762('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6762('0xc'));var deskjs=require(_0x6762('0xd'));var toCsv=require(_0x6762('0x9'));var querystring=require(_0x6762('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6762('0xf'));var as=require(_0x6762('0x10'));var hardwareService=require(_0x6762('0x11'));var logger=require(_0x6762('0x12'))(_0x6762('0x13'));var utils=require(_0x6762('0x14'));var config=require(_0x6762('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x271c94,_0x5b6796){_0x5b6796=_0x5b6796||0xcc;return function(_0xb0f78c){if(_0xb0f78c){return _0x271c94['sendStatus'](_0x5b6796);}return _0x271c94['status'](_0x5b6796)['end']();};}function respondWithResult(_0x42e889,_0x37f2e6){_0x37f2e6=_0x37f2e6||0xc8;return function(_0x1fa62c){if(_0x1fa62c){return _0x42e889[_0x6762('0x16')](_0x37f2e6)[_0x6762('0x17')](_0x1fa62c);}};}function respondWithFilteredResult(_0x44f6f0,_0x425d74){return function(_0x3f80f9){if(_0x3f80f9){var _0xa1eebf=_0x3f80f9[_0x6762('0x18')],_0x110908=_0x425d74['offset'],_0x459809=_0x425d74[_0x6762('0x19')]+_0x425d74['limit'],_0x43d59a;if(_0x459809>=_0xa1eebf){_0x459809=_0xa1eebf;_0x43d59a=0xc8;}else{_0x43d59a=0xce;}_0x44f6f0[_0x6762('0x16')](_0x43d59a);return _0x44f6f0['set'](_0x6762('0x1a'),_0x110908+'-'+_0x459809+'/'+_0xa1eebf)['json'](_0x3f80f9);}return null;};}function patchUpdates(_0x1b27a0){return function(_0x5a963a){try{jsonpatch[_0x6762('0x1b')](_0x5a963a,_0x1b27a0,!![]);}catch(_0x13cfff){return BPromise[_0x6762('0x1c')](_0x13cfff);}return _0x5a963a['save']();};}function saveUpdates(_0x32b84c,_0x406038){return function(_0x21be84){if(_0x21be84){return _0x21be84['update'](_0x32b84c)[_0x6762('0x1d')](function(_0x4466b6){return _0x4466b6;});}return null;};}function removeEntity(_0x8ce3de,_0x264899){return function(_0x580a82){if(_0x580a82){return _0x580a82[_0x6762('0x1e')]()[_0x6762('0x1d')](function(){_0x8ce3de['status'](0xcc)[_0x6762('0x1f')]();});}};}function handleEntityNotFound(_0x5449b6,_0x58a00d){return function(_0x45110b){if(!_0x45110b){_0x5449b6[_0x6762('0x20')](0x194);}return _0x45110b;};}function handleError(_0xd1def4,_0xe13b07){_0xe13b07=_0xe13b07||0x1f4;return function(_0x85e3a5){logger['error'](_0x85e3a5['stack']);if(_0x85e3a5['name']){delete _0x85e3a5[_0x6762('0x21')];}_0xd1def4['status'](_0xe13b07)[_0x6762('0x22')](_0x85e3a5);};}exports['index']=function(_0x485ded,_0x43c81f){var _0x8cd6db={},_0x5db1fb={},_0x365792={'count':0x0,'rows':[]};var _0x393aae=_[_0x6762('0x23')](db[_0x6762('0x24')][_0x6762('0x25')],function(_0x48ea31){return{'name':_0x48ea31[_0x6762('0x26')],'type':_0x48ea31[_0x6762('0x27')][_0x6762('0x28')]};});_0x5db1fb[_0x6762('0x29')]=_[_0x6762('0x23')](_0x393aae,_0x6762('0x21'));_0x5db1fb['query']=_[_0x6762('0x2a')](_0x485ded[_0x6762('0x2b')]);_0x5db1fb[_0x6762('0x2c')]=_[_0x6762('0x2d')](_0x5db1fb[_0x6762('0x29')],_0x5db1fb[_0x6762('0x2b')]);_0x8cd6db[_0x6762('0x2e')]=_[_0x6762('0x2d')](_0x5db1fb[_0x6762('0x29')],qs[_0x6762('0x2f')](_0x485ded[_0x6762('0x2b')][_0x6762('0x2f')]));_0x8cd6db['attributes']=_0x8cd6db['attributes'][_0x6762('0x30')]?_0x8cd6db[_0x6762('0x2e')]:_0x5db1fb[_0x6762('0x29')];if(!_0x485ded[_0x6762('0x2b')][_0x6762('0x31')](_0x6762('0x32'))){_0x8cd6db[_0x6762('0x33')]=qs[_0x6762('0x33')](_0x485ded[_0x6762('0x2b')][_0x6762('0x33')]);_0x8cd6db[_0x6762('0x19')]=qs[_0x6762('0x19')](_0x485ded['query'][_0x6762('0x19')]);}_0x8cd6db[_0x6762('0x34')]=qs[_0x6762('0x35')](_0x485ded[_0x6762('0x2b')][_0x6762('0x35')]);_0x8cd6db[_0x6762('0x36')]=qs[_0x6762('0x2c')](_[_0x6762('0x37')](_0x485ded[_0x6762('0x2b')],_0x5db1fb[_0x6762('0x2c')]));if(_0x485ded[_0x6762('0x2b')][_0x6762('0x38')]){_0x8cd6db['where']=_['merge'](_0x8cd6db['where'],{'$or':_[_0x6762('0x23')](_0x393aae,function(_0x7e9c07){if(_0x7e9c07['type']!==_0x6762('0x39')){var _0x132076={};_0x132076[_0x7e9c07[_0x6762('0x21')]]={'$like':'%'+_0x485ded[_0x6762('0x2b')][_0x6762('0x38')]+'%'};return _0x132076;}})});}_0x8cd6db=_[_0x6762('0x3a')]({},_0x8cd6db,_0x485ded[_0x6762('0x3b')]);var _0x12acfd={'where':_0x8cd6db[_0x6762('0x36')]};return db[_0x6762('0x24')][_0x6762('0x18')](_0x12acfd)[_0x6762('0x1d')](function(_0xb5bf05){_0x365792['count']=_0xb5bf05;if(_0x485ded['query']['includeAll']){_0x8cd6db[_0x6762('0x3c')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x6762('0x3d')](_0x8cd6db);})[_0x6762('0x1d')](function(_0x3af997){_0x365792[_0x6762('0x3e')]=_0x3af997;return _0x365792;})[_0x6762('0x1d')](respondWithFilteredResult(_0x43c81f,_0x8cd6db))[_0x6762('0x3f')](handleError(_0x43c81f,null));};exports[_0x6762('0x40')]=function(_0x3bc376,_0x44bf0b){var _0x3ab306={'raw':!![],'where':{'id':_0x3bc376[_0x6762('0x41')]['id']}},_0x3ec6bb={};_0x3ec6bb[_0x6762('0x29')]=_[_0x6762('0x2a')](db[_0x6762('0x24')][_0x6762('0x25')]);_0x3ec6bb[_0x6762('0x2b')]=_[_0x6762('0x2a')](_0x3bc376[_0x6762('0x2b')]);_0x3ec6bb[_0x6762('0x2c')]=_['intersection'](_0x3ec6bb['model'],_0x3ec6bb[_0x6762('0x2b')]);_0x3ab306[_0x6762('0x2e')]=_['intersection'](_0x3ec6bb[_0x6762('0x29')],qs['fields'](_0x3bc376[_0x6762('0x2b')][_0x6762('0x2f')]));_0x3ab306['attributes']=_0x3ab306['attributes']['length']?_0x3ab306[_0x6762('0x2e')]:_0x3ec6bb[_0x6762('0x29')];if(_0x3bc376[_0x6762('0x2b')][_0x6762('0x42')]){_0x3ab306['include']=[{'all':!![]}];}_0x3ab306=_[_0x6762('0x3a')]({},_0x3ab306,_0x3bc376['options']);return db[_0x6762('0x24')][_0x6762('0x43')](_0x3ab306)[_0x6762('0x1d')](handleEntityNotFound(_0x44bf0b,null))[_0x6762('0x1d')](respondWithResult(_0x44bf0b,null))[_0x6762('0x3f')](handleError(_0x44bf0b,null));};exports[_0x6762('0x44')]=function(_0x3e596d,_0x2ec6ac){return db[_0x6762('0x24')][_0x6762('0x44')](_0x3e596d[_0x6762('0x45')],{})[_0x6762('0x1d')](respondWithResult(_0x2ec6ac,0xc9))['catch'](handleError(_0x2ec6ac,null));};exports['update']=function(_0x1a4387,_0x1ef972){if(_0x1a4387[_0x6762('0x45')]['id']){delete _0x1a4387[_0x6762('0x45')]['id'];}return db[_0x6762('0x24')]['find']({'where':{'id':_0x1a4387[_0x6762('0x41')]['id']}})['then'](handleEntityNotFound(_0x1ef972,null))[_0x6762('0x1d')](saveUpdates(_0x1a4387[_0x6762('0x45')],null))[_0x6762('0x1d')](respondWithResult(_0x1ef972,null))[_0x6762('0x3f')](handleError(_0x1ef972,null));};exports[_0x6762('0x1e')]=function(_0x5cf4b6,_0xf18c94){return db[_0x6762('0x24')][_0x6762('0x43')]({'where':{'id':_0x5cf4b6['params']['id']}})[_0x6762('0x1d')](handleEntityNotFound(_0xf18c94,null))[_0x6762('0x1d')](removeEntity(_0xf18c94,null))[_0x6762('0x3f')](handleError(_0xf18c94,null));}; \ No newline at end of file +var _0x6d2d=['filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','VIRTUAL','filter','merge','options','OpenchannelApplication','count','includeAll','include','rows','catch','show','params','keys','fields','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x4c24a2,_0x251511){var _0x1935ab=function(_0x3acffa){while(--_0x3acffa){_0x4c24a2['push'](_0x4c24a2['shift']());}};_0x1935ab(++_0x251511);}(_0x6d2d,0x13f));var _0xd6d2=function(_0x30e036,_0x5e443d){_0x30e036=_0x30e036-0x0;var _0x489466=_0x6d2d[_0x30e036];return _0x489466;};'use strict';var pdf=require(_0xd6d2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd6d2('0x1'));var zipdir=require(_0xd6d2('0x2'));var jsonpatch=require(_0xd6d2('0x3'));var rp=require(_0xd6d2('0x4'));var moment=require(_0xd6d2('0x5'));var BPromise=require(_0xd6d2('0x6'));var Mustache=require(_0xd6d2('0x7'));var util=require(_0xd6d2('0x8'));var path=require(_0xd6d2('0x9'));var sox=require(_0xd6d2('0xa'));var csv=require(_0xd6d2('0xb'));var ejs=require(_0xd6d2('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd6d2('0xd'));var crypto=require(_0xd6d2('0xe'));var jsforce=require(_0xd6d2('0xf'));var deskjs=require(_0xd6d2('0x10'));var toCsv=require(_0xd6d2('0xb'));var querystring=require('querystring');var Papa=require(_0xd6d2('0x11'));var Redis=require(_0xd6d2('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6d2('0x13'));var logger=require(_0xd6d2('0x14'))('api');var utils=require(_0xd6d2('0x15'));var config=require('../../config/environment');var db=require(_0xd6d2('0x16'))['db'];function respondWithStatusCode(_0x2eea45,_0x3d815c){_0x3d815c=_0x3d815c||0xcc;return function(_0x42f097){if(_0x42f097){return _0x2eea45[_0xd6d2('0x17')](_0x3d815c);}return _0x2eea45[_0xd6d2('0x18')](_0x3d815c)[_0xd6d2('0x19')]();};}function respondWithResult(_0x29872a,_0x511c4f){_0x511c4f=_0x511c4f||0xc8;return function(_0x5d0cc9){if(_0x5d0cc9){return _0x29872a['status'](_0x511c4f)['json'](_0x5d0cc9);}};}function respondWithFilteredResult(_0x5c2842,_0xfca17c){return function(_0x536556){if(_0x536556){var _0x1411ba=_0x536556['count'],_0x28fce2=_0xfca17c[_0xd6d2('0x1a')],_0x196fbb=_0xfca17c['offset']+_0xfca17c['limit'],_0x2f634e;if(_0x196fbb>=_0x1411ba){_0x196fbb=_0x1411ba;_0x2f634e=0xc8;}else{_0x2f634e=0xce;}_0x5c2842['status'](_0x2f634e);return _0x5c2842[_0xd6d2('0x1b')](_0xd6d2('0x1c'),_0x28fce2+'-'+_0x196fbb+'/'+_0x1411ba)['json'](_0x536556);}return null;};}function patchUpdates(_0x21dc7e){return function(_0x2f86b8){try{jsonpatch[_0xd6d2('0x1d')](_0x2f86b8,_0x21dc7e,!![]);}catch(_0x11f3db){return BPromise[_0xd6d2('0x1e')](_0x11f3db);}return _0x2f86b8['save']();};}function saveUpdates(_0x4a8b0c,_0x4a749c){return function(_0xc270d0){if(_0xc270d0){return _0xc270d0[_0xd6d2('0x1f')](_0x4a8b0c)['then'](function(_0x2c5ba5){return _0x2c5ba5;});}return null;};}function removeEntity(_0x3136fe,_0x125717){return function(_0x3b93d9){if(_0x3b93d9){return _0x3b93d9[_0xd6d2('0x20')]()[_0xd6d2('0x21')](function(){_0x3136fe[_0xd6d2('0x18')](0xcc)[_0xd6d2('0x19')]();});}};}function handleEntityNotFound(_0x33f287,_0x51f493){return function(_0x1d0507){if(!_0x1d0507){_0x33f287[_0xd6d2('0x17')](0x194);}return _0x1d0507;};}function handleError(_0x952d9e,_0x5b2c7c){_0x5b2c7c=_0x5b2c7c||0x1f4;return function(_0x5d0294){logger[_0xd6d2('0x22')](_0x5d0294[_0xd6d2('0x23')]);if(_0x5d0294[_0xd6d2('0x24')]){delete _0x5d0294[_0xd6d2('0x24')];}_0x952d9e[_0xd6d2('0x18')](_0x5b2c7c)[_0xd6d2('0x25')](_0x5d0294);};}exports[_0xd6d2('0x26')]=function(_0x4d1a49,_0x2c22c0){var _0x46be6f={},_0x20d256={},_0x261c7c={'count':0x0,'rows':[]};var _0x2cb426=_['map'](db['OpenchannelApplication'][_0xd6d2('0x27')],function(_0x96923){return{'name':_0x96923[_0xd6d2('0x28')],'type':_0x96923[_0xd6d2('0x29')][_0xd6d2('0x2a')]};});_0x20d256[_0xd6d2('0x2b')]=_[_0xd6d2('0x2c')](_0x2cb426,_0xd6d2('0x24'));_0x20d256[_0xd6d2('0x2d')]=_['keys'](_0x4d1a49[_0xd6d2('0x2d')]);_0x20d256[_0xd6d2('0x2e')]=_[_0xd6d2('0x2f')](_0x20d256[_0xd6d2('0x2b')],_0x20d256[_0xd6d2('0x2d')]);_0x46be6f['attributes']=_[_0xd6d2('0x2f')](_0x20d256[_0xd6d2('0x2b')],qs['fields'](_0x4d1a49['query']['fields']));_0x46be6f[_0xd6d2('0x30')]=_0x46be6f['attributes'][_0xd6d2('0x31')]?_0x46be6f[_0xd6d2('0x30')]:_0x20d256[_0xd6d2('0x2b')];if(!_0x4d1a49[_0xd6d2('0x2d')][_0xd6d2('0x32')](_0xd6d2('0x33'))){_0x46be6f[_0xd6d2('0x34')]=qs[_0xd6d2('0x34')](_0x4d1a49[_0xd6d2('0x2d')][_0xd6d2('0x34')]);_0x46be6f[_0xd6d2('0x1a')]=qs['offset'](_0x4d1a49['query'][_0xd6d2('0x1a')]);}_0x46be6f[_0xd6d2('0x35')]=qs[_0xd6d2('0x36')](_0x4d1a49[_0xd6d2('0x2d')][_0xd6d2('0x36')]);_0x46be6f['where']=qs['filters'](_['pick'](_0x4d1a49[_0xd6d2('0x2d')],_0x20d256[_0xd6d2('0x2e')]));if(_0x4d1a49['query']['filter']){_0x46be6f[_0xd6d2('0x37')]=_['merge'](_0x46be6f['where'],{'$or':_[_0xd6d2('0x2c')](_0x2cb426,function(_0x15e55e){if(_0x15e55e['type']!==_0xd6d2('0x38')){var _0x560f1d={};_0x560f1d[_0x15e55e[_0xd6d2('0x24')]]={'$like':'%'+_0x4d1a49[_0xd6d2('0x2d')][_0xd6d2('0x39')]+'%'};return _0x560f1d;}})});}_0x46be6f=_[_0xd6d2('0x3a')]({},_0x46be6f,_0x4d1a49[_0xd6d2('0x3b')]);var _0x7b3f20={'where':_0x46be6f[_0xd6d2('0x37')]};return db[_0xd6d2('0x3c')]['count'](_0x7b3f20)[_0xd6d2('0x21')](function(_0x5178dd){_0x261c7c[_0xd6d2('0x3d')]=_0x5178dd;if(_0x4d1a49[_0xd6d2('0x2d')][_0xd6d2('0x3e')]){_0x46be6f[_0xd6d2('0x3f')]=[{'all':!![]}];}return db[_0xd6d2('0x3c')]['findAll'](_0x46be6f);})[_0xd6d2('0x21')](function(_0x5bd8ca){_0x261c7c[_0xd6d2('0x40')]=_0x5bd8ca;return _0x261c7c;})[_0xd6d2('0x21')](respondWithFilteredResult(_0x2c22c0,_0x46be6f))[_0xd6d2('0x41')](handleError(_0x2c22c0,null));};exports[_0xd6d2('0x42')]=function(_0x228b49,_0x57cfcf){var _0x48618e={'raw':!![],'where':{'id':_0x228b49[_0xd6d2('0x43')]['id']}},_0x14175f={};_0x14175f[_0xd6d2('0x2b')]=_[_0xd6d2('0x44')](db[_0xd6d2('0x3c')]['rawAttributes']);_0x14175f['query']=_['keys'](_0x228b49[_0xd6d2('0x2d')]);_0x14175f[_0xd6d2('0x2e')]=_[_0xd6d2('0x2f')](_0x14175f[_0xd6d2('0x2b')],_0x14175f[_0xd6d2('0x2d')]);_0x48618e['attributes']=_[_0xd6d2('0x2f')](_0x14175f[_0xd6d2('0x2b')],qs[_0xd6d2('0x45')](_0x228b49[_0xd6d2('0x2d')][_0xd6d2('0x45')]));_0x48618e[_0xd6d2('0x30')]=_0x48618e[_0xd6d2('0x30')][_0xd6d2('0x31')]?_0x48618e[_0xd6d2('0x30')]:_0x14175f[_0xd6d2('0x2b')];if(_0x228b49[_0xd6d2('0x2d')][_0xd6d2('0x3e')]){_0x48618e[_0xd6d2('0x3f')]=[{'all':!![]}];}_0x48618e=_[_0xd6d2('0x3a')]({},_0x48618e,_0x228b49[_0xd6d2('0x3b')]);return db['OpenchannelApplication'][_0xd6d2('0x46')](_0x48618e)[_0xd6d2('0x21')](handleEntityNotFound(_0x57cfcf,null))[_0xd6d2('0x21')](respondWithResult(_0x57cfcf,null))['catch'](handleError(_0x57cfcf,null));};exports[_0xd6d2('0x47')]=function(_0x18fd51,_0x56b2fa){return db[_0xd6d2('0x3c')][_0xd6d2('0x47')](_0x18fd51['body'],{})[_0xd6d2('0x21')](respondWithResult(_0x56b2fa,0xc9))['catch'](handleError(_0x56b2fa,null));};exports[_0xd6d2('0x1f')]=function(_0x58139c,_0x56e505){if(_0x58139c[_0xd6d2('0x48')]['id']){delete _0x58139c[_0xd6d2('0x48')]['id'];}return db[_0xd6d2('0x3c')][_0xd6d2('0x46')]({'where':{'id':_0x58139c[_0xd6d2('0x43')]['id']}})['then'](handleEntityNotFound(_0x56e505,null))[_0xd6d2('0x21')](saveUpdates(_0x58139c[_0xd6d2('0x48')],null))[_0xd6d2('0x21')](respondWithResult(_0x56e505,null))[_0xd6d2('0x41')](handleError(_0x56e505,null));};exports[_0xd6d2('0x20')]=function(_0xab7339,_0x4406a6){return db[_0xd6d2('0x3c')][_0xd6d2('0x46')]({'where':{'id':_0xab7339[_0xd6d2('0x43')]['id']}})['then'](handleEntityNotFound(_0x4406a6,null))['then'](removeEntity(_0x4406a6,null))[_0xd6d2('0x41')](handleError(_0x4406a6,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 7837b3b..b66facf 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 _0x7319=['request-promise','path','../../config/environment','./openchannelApplication.attributes','exports','define','utf8mb4','lodash','util','../../config/logger','api','bluebird'];(function(_0x3e9de6,_0x250b03){var _0x4faa93=function(_0x1e3319){while(--_0x1e3319){_0x3e9de6['push'](_0x3e9de6['shift']());}};_0x4faa93(++_0x250b03);}(_0x7319,0x19f));var _0x9731=function(_0x358c29,_0x49e8f0){_0x358c29=_0x358c29-0x0;var _0x43d317=_0x7319[_0x358c29];return _0x43d317;};'use strict';var _=require(_0x9731('0x0'));var util=require(_0x9731('0x1'));var logger=require(_0x9731('0x2'))(_0x9731('0x3'));var moment=require('moment');var BPromise=require(_0x9731('0x4'));var rp=require(_0x9731('0x5'));var fs=require('fs');var path=require(_0x9731('0x6'));var rimraf=require('rimraf');var config=require(_0x9731('0x7'));var attributes=require(_0x9731('0x8'));module[_0x9731('0x9')]=function(_0x4f53f9,_0xa08a13){return _0x4f53f9[_0x9731('0xa')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9731('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6523=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6523,0x191));var _0x3652=function(_0x253673,_0x3287fb){_0x253673=_0x253673-0x0;var _0x259903=_0x6523[_0x253673];return _0x259903;};'use strict';var _=require(_0x3652('0x0'));var util=require('util');var logger=require(_0x3652('0x1'))(_0x3652('0x2'));var moment=require(_0x3652('0x3'));var BPromise=require('bluebird');var rp=require(_0x3652('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3652('0x5'));var config=require(_0x3652('0x6'));var attributes=require(_0x3652('0x7'));module[_0x3652('0x8')]=function(_0x136ac4,_0x27a70c){return _0x136ac4[_0x3652('0x9')](_0x3652('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3652('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 0e79a98..a3ad91b 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['error','code','message','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify'];(function(_0x38037a,_0x196abc){var _0x1a1246=function(_0x4252b5){while(--_0x4252b5){_0x38037a['push'](_0x38037a['shift']());}};_0x1a1246(++_0x196abc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x10c2d3,_0x2f5914){_0x10c2d3=_0x10c2d3-0x0;var _0x5a0b13=_0x5f2f[_0x10c2d3];return _0x5a0b13;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fccd['options']?_0x20fccd['options'][_0xf5f2('0x1d')]||null:null,'attributes':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd['options'][_0xf5f2('0x1e')]||null:null,'limit':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null})[_0xf5f2('0x20')](function(_0x4c691a){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x4c691a));_0x4ff59b(_0x4c691a);})['catch'](function(_0x529f07){logger[_0xf5f2('0x11')](_0xf5f2('0x17'),_0x529f07[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x529f07[_0xf5f2('0x13')]));});});}; \ No newline at end of file +var _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(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['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 diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index cb14c3a..5ca505a 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 _0x38f9=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','put','openchannel','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x38f9,0xc1));var _0x938f=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x38f9[_0x342700];return _0x53406f;};'use strict';var multer=require('multer');var util=require(_0x938f('0x0'));var path=require(_0x938f('0x1'));var timeout=require(_0x938f('0x2'));var express=require(_0x938f('0x3'));var router=express[_0x938f('0x4')]();var auth=require(_0x938f('0x5'));var interaction=require(_0x938f('0x6'));var config=require(_0x938f('0x7'));var controller=require(_0x938f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x938f('0x9')]);router[_0x938f('0xa')](_0x938f('0xb'),auth[_0x938f('0xc')](),controller[_0x938f('0xd')]);router[_0x938f('0xa')](_0x938f('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x938f('0xa')](_0x938f('0xf'),auth['isAuthenticated'](),controller[_0x938f('0x10')]);router[_0x938f('0xa')](_0x938f('0x11'),auth[_0x938f('0xc')](),controller[_0x938f('0x12')]);router[_0x938f('0x13')]('/',auth[_0x938f('0xc')](),controller[_0x938f('0x14')]);router['post'](_0x938f('0xf'),auth[_0x938f('0xc')](),controller[_0x938f('0x15')]);router[_0x938f('0x13')](_0x938f('0x16'),auth[_0x938f('0xc')](),interaction[_0x938f('0x17')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0x938f('0x18')](_0x938f('0xe'),auth[_0x938f('0xc')](),interaction['tracked'](_0x938f('0x19'),_0x938f('0x1a')),controller['update']);router[_0x938f('0x1b')](_0x938f('0xe'),auth[_0x938f('0xc')](),interaction[_0x938f('0x17')]('openchannel',_0x938f('0x1c')),controller[_0x938f('0x1d')]);router['delete'](_0x938f('0x16'),auth[_0x938f('0xc')](),controller[_0x938f('0x1e')]);module[_0x938f('0x1f')]=router; \ No newline at end of file +var _0xdc02=['delete','/:id','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','openchannel','openchannelinteraction:update','update'];(function(_0x191f84,_0x20f1a6){var _0x5ad4ec=function(_0x541c5b){while(--_0x541c5b){_0x191f84['push'](_0x191f84['shift']());}};_0x5ad4ec(++_0x20f1a6);}(_0xdc02,0x12e));var _0x2dc0=function(_0x4ccd32,_0x3b11c9){_0x4ccd32=_0x4ccd32-0x0;var _0x30b693=_0xdc02[_0x4ccd32];return _0x30b693;};'use strict';var multer=require(_0x2dc0('0x0'));var util=require(_0x2dc0('0x1'));var path=require(_0x2dc0('0x2'));var timeout=require(_0x2dc0('0x3'));var express=require(_0x2dc0('0x4'));var router=express[_0x2dc0('0x5')]();var auth=require(_0x2dc0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2dc0('0x7'));var controller=require(_0x2dc0('0x8'));router[_0x2dc0('0x9')]('/',auth[_0x2dc0('0xa')](),controller[_0x2dc0('0xb')]);router['get'](_0x2dc0('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x2dc0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2dc0('0xd')]);router[_0x2dc0('0x9')](_0x2dc0('0xe'),auth[_0x2dc0('0xa')](),controller[_0x2dc0('0xf')]);router[_0x2dc0('0x9')](_0x2dc0('0x10'),auth[_0x2dc0('0xa')](),controller[_0x2dc0('0x11')]);router['post']('/',auth[_0x2dc0('0xa')](),controller['create']);router[_0x2dc0('0x12')](_0x2dc0('0xe'),auth[_0x2dc0('0xa')](),controller[_0x2dc0('0x13')]);router['post'](_0x2dc0('0x14'),auth['isAuthenticated'](),interaction[_0x2dc0('0x15')]('openchannel',_0x2dc0('0x16')),controller[_0x2dc0('0x17')]);router[_0x2dc0('0x18')]('/:id',auth[_0x2dc0('0xa')](),interaction['tracked'](_0x2dc0('0x19'),_0x2dc0('0x1a')),controller[_0x2dc0('0x1b')]);router[_0x2dc0('0x1c')](_0x2dc0('0x1d'),auth[_0x2dc0('0xa')](),interaction[_0x2dc0('0x15')]('openchannel',_0x2dc0('0x1e')),controller[_0x2dc0('0x1f')]);router[_0x2dc0('0x1c')](_0x2dc0('0x14'),auth[_0x2dc0('0xa')](),controller[_0x2dc0('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 11a92e9..f2d475a 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 _0xf807=['ENUM','out','sequelize','BOOLEAN','DATE','STRING'];(function(_0x24ca97,_0x153f05){var _0x33d238=function(_0x31eadf){while(--_0x31eadf){_0x24ca97['push'](_0x24ca97['shift']());}};_0x33d238(++_0x153f05);}(_0xf807,0xd4));var _0x7f80=function(_0x2860ab,_0x27440f){_0x2860ab=_0x2860ab-0x0;var _0x3037c4=_0xf807[_0x2860ab];return _0x3037c4;};'use strict';var Sequelize=require(_0x7f80('0x0'));module['exports']={'closed':{'type':Sequelize[_0x7f80('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7f80('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7f80('0x2')]},'threadId':{'type':Sequelize[_0x7f80('0x3')]},'externalUrl':{'type':Sequelize[_0x7f80('0x3')]},'lastMsgAt':{'type':Sequelize[_0x7f80('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7f80('0x4')]('in',_0x7f80('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7f80('0x3')]}}; \ No newline at end of file +var _0x4b0f=['sequelize','exports','STRING','ENUM','out'];(function(_0x1f6e37,_0x560390){var _0x3d17ad=function(_0x23a623){while(--_0x23a623){_0x1f6e37['push'](_0x1f6e37['shift']());}};_0x3d17ad(++_0x560390);}(_0x4b0f,0xb9));var _0xf4b0=function(_0x56a28a,_0x12b812){_0x56a28a=_0x56a28a-0x0;var _0x2f0161=_0x4b0f[_0x56a28a];return _0x2f0161;};'use strict';var Sequelize=require(_0xf4b0('0x0'));module[_0xf4b0('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf4b0('0x2')]},'note':{'type':Sequelize[_0xf4b0('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xf4b0('0x2')]},'externalUrl':{'type':Sequelize[_0xf4b0('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf4b0('0x3')]('in',_0xf4b0('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index faa46b2..d17650a 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 _0x2fa8=['field','color','from','u.id','user_has_openchannel_interactions','left_join','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','body','keys','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','OpenchannelInteractionId','rows','show','params','rawAttributes','includeAll','include','options','create','describe','addMessage','ids','omit','findOne','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','findAll','addTags','setTags','spread','emit','removeTags','download','unix','join','root','tmp','server','files','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Attachment','Messages','direction','OpenchannelAccount','Account','Owner','fullname','get','mkdirSync','40px','30px','format','%s\x20#%d','YYYY-MM-DD','Openchannel','N.A.','closedAt','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','out','secret','renderFile','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','html-pdf','eml-format','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/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','end','error','name','send','Users','map','Tags','TagIds','split','forEach','push','catch','index','OpenchannelInteraction','fieldName','type','key','query','model','attributes','intersection','fields','length','order','sort','where','filters','pick','select'];(function(_0x88f8ca,_0x1e419a){var _0x46f4b1=function(_0x5a21a1){while(--_0x5a21a1){_0x88f8ca['push'](_0x88f8ca['shift']());}};_0x46f4b1(++_0x1e419a);}(_0x2fa8,0x191));var _0x82fa=function(_0x33831d,_0x342aae){_0x33831d=_0x33831d-0x0;var _0x200c80=_0x2fa8[_0x33831d];return _0x200c80;};'use strict';var pdf=require(_0x82fa('0x0'));var emlformat=require(_0x82fa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x82fa('0x2'));var jsonpatch=require(_0x82fa('0x3'));var rp=require(_0x82fa('0x4'));var moment=require(_0x82fa('0x5'));var BPromise=require(_0x82fa('0x6'));var Mustache=require(_0x82fa('0x7'));var util=require(_0x82fa('0x8'));var path=require('path');var sox=require(_0x82fa('0x9'));var csv=require(_0x82fa('0xa'));var ejs=require(_0x82fa('0xb'));var fs=require('fs');var _=require(_0x82fa('0xc'));var squel=require('squel');var crypto=require(_0x82fa('0xd'));var jsforce=require(_0x82fa('0xe'));var deskjs=require(_0x82fa('0xf'));var toCsv=require('to-csv');var querystring=require(_0x82fa('0x10'));var Papa=require(_0x82fa('0x11'));var Redis=require(_0x82fa('0x12'));var authService=require(_0x82fa('0x13'));var qs=require(_0x82fa('0x14'));var as=require(_0x82fa('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x82fa('0x16'))(_0x82fa('0x17'));var utils=require('../../config/utils');var config=require(_0x82fa('0x18'));var db=require(_0x82fa('0x19'))['db'];config[_0x82fa('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x82fa('0x1b'))(new Redis(config['redis']));require(_0x82fa('0x1c'))['register'](socket);function respondWithStatusCode(_0x157187,_0x1d24b4){_0x1d24b4=_0x1d24b4||0xcc;return function(_0x2d59cc){if(_0x2d59cc){return _0x157187[_0x82fa('0x1d')](_0x1d24b4);}return _0x157187['status'](_0x1d24b4)['end']();};}function respondWithResult(_0x5a0764,_0x354a3f){_0x354a3f=_0x354a3f||0xc8;return function(_0x177db8){if(_0x177db8){return _0x5a0764[_0x82fa('0x1e')](_0x354a3f)['json'](_0x177db8);}};}function respondWithFilteredResult(_0x524793,_0x4e1339){return function(_0x1f3374){if(_0x1f3374){var _0x17eb5d=_0x1f3374[_0x82fa('0x1f')],_0x2f20b3=_0x4e1339[_0x82fa('0x20')],_0x3de85f=_0x4e1339[_0x82fa('0x20')]+_0x4e1339[_0x82fa('0x21')],_0x5af57f;if(_0x3de85f>=_0x17eb5d){_0x3de85f=_0x17eb5d;_0x5af57f=0xc8;}else{_0x5af57f=0xce;}_0x524793[_0x82fa('0x1e')](_0x5af57f);return _0x524793[_0x82fa('0x22')](_0x82fa('0x23'),_0x2f20b3+'-'+_0x3de85f+'/'+_0x17eb5d)[_0x82fa('0x24')](_0x1f3374);}return null;};}function patchUpdates(_0x4cda96){return function(_0x5064f2){try{jsonpatch[_0x82fa('0x25')](_0x5064f2,_0x4cda96,!![]);}catch(_0x21675c){return BPromise['reject'](_0x21675c);}return _0x5064f2[_0x82fa('0x26')]();};}function saveUpdates(_0x380db7,_0xce3572){return function(_0x1d82df){if(_0x1d82df){return _0x1d82df[_0x82fa('0x27')](_0x380db7)[_0x82fa('0x28')](function(_0x54c402){return _0x54c402;});}return null;};}function removeEntity(_0x314435,_0x1a1625){return function(_0x4d3dd3){if(_0x4d3dd3){return _0x4d3dd3[_0x82fa('0x29')]()[_0x82fa('0x28')](function(){_0x314435[_0x82fa('0x1e')](0xcc)[_0x82fa('0x2a')]();});}};}function handleEntityNotFound(_0x3a864b,_0x12f243){return function(_0x38377e){if(!_0x38377e){_0x3a864b['sendStatus'](0x194);}return _0x38377e;};}function handleError(_0x309388,_0x5f2e87){_0x5f2e87=_0x5f2e87||0x1f4;return function(_0x2a3f13){logger[_0x82fa('0x2b')](_0x2a3f13['stack']);if(_0x2a3f13[_0x82fa('0x2c')]){delete _0x2a3f13[_0x82fa('0x2c')];}_0x309388[_0x82fa('0x1e')](_0x5f2e87)[_0x82fa('0x2d')](_0x2a3f13);};}function getInteractionUsers(_0x52c793,_0x4f5839){return new BPromise(function(_0x771764,_0x319414){try{if(_0x4f5839[_0x52c793['id']]){_0x52c793[_0x82fa('0x2e')]=_[_0x82fa('0x2f')](_0x4f5839[_0x52c793['id']],function(_0x202621){return{'id':_0x202621['id'],'fullname':_0x202621['fullname']};});}}catch(_0x390fc2){_0x319414(_0x390fc2);}_0x771764(_0x52c793);});}function getInteractionTags(_0x1fb40a,_0x520b25){return new BPromise(function(_0x179620,_0x3d801b){try{if(_0x1fb40a['TagIds']){_0x1fb40a[_0x82fa('0x30')]=[];_0x1fb40a[_0x82fa('0x31')][_0x82fa('0x32')](',')[_0x82fa('0x33')](function(_0x12c7be){_0x1fb40a[_0x82fa('0x30')][_0x82fa('0x34')](_0x520b25[_0x12c7be]);});}delete _0x1fb40a[_0x82fa('0x31')];}catch(_0x5e1142){_0x3d801b(_0x5e1142);}_0x179620(_0x1fb40a);});}function updateOpenchannelInteraction(_0x26a3a0,_0x18e102,_0x3c2735){return new BPromise(function(_0x39caf8,_0x11ef58){return getInteractionUsers(_0x26a3a0,_0x3c2735)[_0x82fa('0x28')](function(_0x424a29){return getInteractionTags(_0x424a29,_0x18e102);})[_0x82fa('0x28')](function(_0xc25c88){_0x39caf8(_0xc25c88);})[_0x82fa('0x35')](function(_0x1db633){_0x11ef58(_0x1db633);});});}exports[_0x82fa('0x36')]=function(_0x1a8712,_0x34c6b3){var _0x5adf18={},_0x338cac={},_0x4dfb03={'count':0x0,'rows':[]};var _0x33ed92=_[_0x82fa('0x2f')](db[_0x82fa('0x37')]['rawAttributes'],function(_0x3ed99c){return{'name':_0x3ed99c[_0x82fa('0x38')],'type':_0x3ed99c[_0x82fa('0x39')][_0x82fa('0x3a')]};});_0x338cac['model']=_[_0x82fa('0x2f')](_0x33ed92,_0x82fa('0x2c'));_0x338cac[_0x82fa('0x3b')]=_['keys'](_0x1a8712[_0x82fa('0x3b')]);_0x338cac['filters']=_['intersection'](_0x338cac[_0x82fa('0x3c')],_0x338cac[_0x82fa('0x3b')]);_0x5adf18[_0x82fa('0x3d')]=_[_0x82fa('0x3e')](_0x338cac[_0x82fa('0x3c')],qs[_0x82fa('0x3f')](_0x1a8712['query']['fields']));_0x5adf18[_0x82fa('0x3d')]=_0x5adf18[_0x82fa('0x3d')][_0x82fa('0x40')]?_0x5adf18[_0x82fa('0x3d')]:_0x338cac[_0x82fa('0x3c')];if(!_0x1a8712['query']['hasOwnProperty']('nolimit')){_0x5adf18[_0x82fa('0x21')]=qs[_0x82fa('0x21')](_0x1a8712[_0x82fa('0x3b')][_0x82fa('0x21')]);_0x5adf18['offset']=qs[_0x82fa('0x20')](_0x1a8712[_0x82fa('0x3b')][_0x82fa('0x20')]);}_0x5adf18[_0x82fa('0x41')]=qs[_0x82fa('0x42')](_0x1a8712[_0x82fa('0x3b')]['sort']);_0x5adf18[_0x82fa('0x43')]=qs[_0x82fa('0x44')](_[_0x82fa('0x45')](_0x1a8712[_0x82fa('0x3b')],_0x338cac[_0x82fa('0x44')]));var _0x3fff50=[];var _0x471aba=squel[_0x82fa('0x46')]()[_0x82fa('0x47')]('id')[_0x82fa('0x47')](_0x82fa('0x2c'))['field'](_0x82fa('0x48'))[_0x82fa('0x49')]('tools_tags');var _0x1ff7f6=squel[_0x82fa('0x46')]()[_0x82fa('0x47')](_0x82fa('0x4a'))[_0x82fa('0x47')]('u.fullname')[_0x82fa('0x47')]('ui.OpenchannelInteractionId')[_0x82fa('0x49')](_0x82fa('0x4b'),'ui')[_0x82fa('0x4c')](_0x82fa('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x5d4fcb=squel[_0x82fa('0x46')]()['from']('openchannel_interactions','i')[_0x82fa('0x4c')]('cm_contacts','c',_0x82fa('0x4e'))[_0x82fa('0x4c')](_0x82fa('0x4d'),'o','o.id\x20=\x20i.UserId')[_0x82fa('0x4c')](_0x82fa('0x4f'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x82fa('0x4c')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x82fa('0x4c')](_0x82fa('0x50'),'it',_0x82fa('0x51'))['left_join'](_0x82fa('0x52'),'t',_0x82fa('0x53'));var _0x31d0bb=squel['expr']();var _0x50dff4=[];var _0x89b1a5=squel[_0x82fa('0x54')]();var _0x50d0e5;if(_0x1a8712[_0x82fa('0x3b')][_0x82fa('0x55')]){_0x50d0e5=as[_0x82fa('0x56')](_0x1a8712[_0x82fa('0x3b')]['search']);var _0xb4636a=_0x50d0e5[_0x82fa('0x57')];for(var _0xf869ee=0x0;_0xf869ee<_0x50d0e5['conditions']['length'];_0xf869ee++){var _0x4aa05a=_0x50d0e5[_0x82fa('0x58')][_0xf869ee];var _0x39e067='i';var _0x291fbe=_[_0x82fa('0x59')](_0x33ed92,[_0x82fa('0x2c'),_0x4aa05a[_0x82fa('0x47')]]);if(!_0x291fbe){switch(_0x4aa05a[_0x82fa('0x47')]){case'unreadMessages':if(_0x4aa05a[_0x82fa('0x5a')]==0x1){_0x5d4fcb['having']('`'+_0x4aa05a[_0x82fa('0x47')]+_0x82fa('0x5b'));}else{_0x5d4fcb[_0x82fa('0x5c')]('`'+_0x4aa05a[_0x82fa('0x47')]+_0x82fa('0x5d'));}break;case _0x82fa('0x5e'):if(_0x4aa05a[_0x82fa('0x5f')]===_0x82fa('0x60')){if(_0x4aa05a[_0x82fa('0x5a')][_0x82fa('0x32')]('\x20')['length']>0x1){_0x31d0bb[_0xb4636a]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4aa05a[_0x82fa('0x5a')]),null);}else{var _0x339d5b='%'+_0x4aa05a['value']+'%';_0x31d0bb[_0xb4636a](_0x82fa('0x61'),_0x339d5b,_0x339d5b,_0x339d5b);}}else{_0x291fbe=_[_0x82fa('0x59')](_0x33ed92,['name',_0x82fa('0x62')]);_0x4aa05a[_0x82fa('0x47')]=_0x82fa('0x62');_0x1884f9=as['buildExpression'](_0x39e067,_0x291fbe['type'],_0x4aa05a);_0x31d0bb[_0xb4636a](_0x1884f9['text'],_0x1884f9[_0x82fa('0x5a')][_0x82fa('0x63')],_0x1884f9[_0x82fa('0x5a')][_0x82fa('0x2a')]);}break;case _0x82fa('0x64'):var _0x361d81=_0x4aa05a[_0x82fa('0x5a')]['split'](',')[_0x82fa('0x2f')](function(_0xe6f1b2){return Number(_0xe6f1b2);});_0x361d81[_0x82fa('0x33')](function(_0x3c8d92){_0x89b1a5['or'](_0x82fa('0x65'),'%,'+_0x3c8d92+',%');});_0x50dff4=_[_0x82fa('0x66')](_0x50dff4,_0x361d81);break;case'User':if(_0x4aa05a[_0x82fa('0x5f')]==='$substring'){_0x31d0bb[_0xb4636a](_0x82fa('0x67'),'%'+_0x4aa05a[_0x82fa('0x5a')]+'%',null);}else{_0x291fbe=_[_0x82fa('0x59')](_0x33ed92,['name',_0x82fa('0x68')]);_0x4aa05a[_0x82fa('0x47')]='UserId';_0x1884f9=as[_0x82fa('0x69')](_0x39e067,_0x291fbe['type'],_0x4aa05a);_0x31d0bb[_0xb4636a](_0x1884f9[_0x82fa('0x6a')],_0x1884f9[_0x82fa('0x5a')][_0x82fa('0x63')],_0x1884f9['value'][_0x82fa('0x2a')]);}break;case _0x82fa('0x6b'):_0x1884f9=as['buildExpression']('me',null,_0x4aa05a);_0x31d0bb[_0xb4636a](_0x1884f9[_0x82fa('0x6a')],_0x1884f9[_0x82fa('0x5a')]['start'],_0x1884f9['value'][_0x82fa('0x2a')]);break;}}else{var _0x1884f9=as[_0x82fa('0x69')](_0x39e067,_0x291fbe[_0x82fa('0x39')],_0x4aa05a);_0x31d0bb[_0xb4636a](_0x1884f9[_0x82fa('0x6a')],_0x1884f9[_0x82fa('0x5a')][_0x82fa('0x63')],_0x1884f9['value'][_0x82fa('0x2a')]);}}}else{var _0x2bfeaa=_(_0x1a8712[_0x82fa('0x3b')])[_0x82fa('0x6c')]()[_0x82fa('0x2f')](function(_0x425c77){return _[_0x82fa('0x6d')](_0x33ed92,['name',_0x425c77])?_0x425c77:undefined;})[_0x82fa('0x6e')]()['value']();if(!_[_0x82fa('0x6f')](_0x2bfeaa)){_0x2bfeaa[_0x82fa('0x33')](function(_0x49a3b9){if(_0x49a3b9===_0x82fa('0x70')){_0x5d4fcb[_0x82fa('0x43')](_0x82fa('0x71'),[]['concat'](_0x1a8712[_0x82fa('0x3b')][_0x49a3b9]));}else if(_0x49a3b9===_0x82fa('0x72')){var _0x476275=JSON[_0x82fa('0x73')](_0x1a8712[_0x82fa('0x3b')][_0x49a3b9])[_0x82fa('0x74')];var _0x4226c3=JSON[_0x82fa('0x73')](_0x1a8712['query'][_0x49a3b9])[_0x82fa('0x75')];_0x5d4fcb[_0x82fa('0x43')](_0x82fa('0x76'),_0x476275,_0x4226c3);}else{if(_0x1a8712[_0x82fa('0x3b')][_0x49a3b9]==='null'){_0x5d4fcb['where']('i.'+_0x49a3b9+_0x82fa('0x77'));}else{_0x5d4fcb[_0x82fa('0x43')]('i.'+_0x49a3b9+'\x20=\x20?',_0x1a8712[_0x82fa('0x3b')][_0x49a3b9]);}}});}if(_0x1a8712[_0x82fa('0x3b')]['read']){if(_0x1a8712[_0x82fa('0x3b')][_0x82fa('0x78')]==0x1){_0x5d4fcb[_0x82fa('0x5c')]('`unreadMessages`\x20=\x200');}else{_0x5d4fcb[_0x82fa('0x5c')](_0x82fa('0x79'));}}if(_0x1a8712['query'][_0x82fa('0x7a')]){_0x50dff4=_[_0x82fa('0x7b')](_0x1a8712['query'][_0x82fa('0x7a')])?_0x1a8712['query']['tag']:new Array(_0x1a8712[_0x82fa('0x3b')]['tag']);_0x50dff4[_0x82fa('0x33')](function(_0x412720){_0x89b1a5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x412720+',%');});}if(_0x1a8712['query'][_0x82fa('0x7c')]){var _0x3769a5=_0x1a8712[_0x82fa('0x3b')][_0x82fa('0x7c')][_0x82fa('0x7d')]('\x5c','\x5c\x5c')[_0x82fa('0x7d')]('\x27\x27',_0x82fa('0x7e'));if(qs[_0x82fa('0x7f')](_0x3769a5)){_0x31d0bb['or'](_0x82fa('0x80'),_0x3769a5+'%');}else{_0x31d0bb['or'](_0x82fa('0x81'),qs[_0x82fa('0x82')](_0x3769a5))['or'](_0x82fa('0x83'),_0x3769a5+'%')['or'](_0x82fa('0x84'),_0x3769a5+'%');}}}_0x5d4fcb[_0x82fa('0x43')](_0x31d0bb);_0x5d4fcb[_0x82fa('0x85')]('i.id');var _0x1d93dd={'type':db[_0x82fa('0x86')]['QueryTypes'][_0x82fa('0x87')],'raw':!![]};var _0x3de638=_0x5d4fcb[_0x82fa('0x88')]();_0x3de638['field'](_0x82fa('0x89'));_0x3de638[_0x82fa('0x47')](_0x82fa('0x8a'),_0x82fa('0x8b'));if(_0x5adf18[_0x82fa('0x41')]){_0x5adf18[_0x82fa('0x41')]['forEach'](function(_0x5082f7){_0x5d4fcb[_0x82fa('0x41')]('i.'+_0x5082f7[0x0],_0x5082f7[0x1]===_0x82fa('0x8c')?![]:!![]);});}if(!_[_0x82fa('0x6f')](_0x50dff4)){_0x5d4fcb['having'](_0x89b1a5);_0x3de638[_0x82fa('0x43')]('t.id\x20IN\x20?',_0x50dff4);}BPromise['resolve']()[_0x82fa('0x28')](function(){if(!_0x50d0e5){if(_0x1a8712[_0x82fa('0x3b')][_0x82fa('0x70')]||_0x1a8712[_0x82fa('0x3b')]['journey'])return;_0x3de638[_0x82fa('0x43')](_0x82fa('0x8d'));_0x5d4fcb[_0x82fa('0x43')](_0x82fa('0x8d'));return;}return _0x1a8712[_0x82fa('0x8e')][_0x82fa('0x8f')]({'attributes':['id'],'raw':!![]})[_0x82fa('0x28')](function(_0x369292){if(_['isEmpty'](_0x369292)){_0x3de638['where']('i.OpenchannelAccountId\x20IS\x20NULL');_0x5d4fcb[_0x82fa('0x43')](_0x82fa('0x90'));}else{_0x3de638['where']('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x369292,'id'));_0x5d4fcb['where'](_0x82fa('0x71'),_[_0x82fa('0x2f')](_0x369292,'id'));}});})['then'](function(){db[_0x82fa('0x91')][_0x82fa('0x3b')](_0x3de638[_0x82fa('0x92')](),_0x1d93dd)[_0x82fa('0x28')](function(_0x3bd837){_0x4dfb03[_0x82fa('0x1f')]=_0x3bd837[_0x82fa('0x40')];if(_0x4dfb03['count']===0x0)return[];return db[_0x82fa('0x91')]['query'](_0x471aba[_0x82fa('0x92')](),_0x1d93dd)[_0x82fa('0x28')](function(_0x28ea86){_0x3fff50=_[_0x82fa('0x93')](_0x28ea86,'id');_0x1d93dd=_[_0x82fa('0x94')](_0x1d93dd,{'model':db[_0x82fa('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a8712['query'][_0x82fa('0x3f')]){_0x5adf18[_0x82fa('0x3d')][_0x82fa('0x33')](function(_0x4b2f80){_0x5d4fcb[_0x82fa('0x47')]('i.'+_0x4b2f80);});}else{_0x5d4fcb['field'](_0x82fa('0x8a'),_0x82fa('0x8b'));_0x5d4fcb[_0x82fa('0x47')]('a.key',_0x82fa('0x95'));_0x5d4fcb[_0x82fa('0x47')](_0x82fa('0x96'),_0x82fa('0x97'));_0x5d4fcb[_0x82fa('0x47')](_0x82fa('0x98'));_0x5d4fcb[_0x82fa('0x47')](_0x82fa('0x99'),_0x82fa('0x9a'));_0x5d4fcb['field']('c.lastName',_0x82fa('0x9b'));_0x5d4fcb[_0x82fa('0x47')](_0x82fa('0x9c'),_0x82fa('0x9d'));_0x5d4fcb['field'](_0x82fa('0x9e'),'Contact.phone');_0x5d4fcb['field']('c.mobile',_0x82fa('0x9f'));_0x5d4fcb[_0x82fa('0x47')](_0x82fa('0xa0'),_0x82fa('0xa1'));_0x5d4fcb[_0x82fa('0x47')](_0x82fa('0xa2'),_0x82fa('0xa3'));_0x5d4fcb[_0x82fa('0x47')](_0x82fa('0xa4'),_0x82fa('0xa5'));_0x5d4fcb[_0x82fa('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}_0x5d4fcb[_0x82fa('0x21')](_0x5adf18[_0x82fa('0x21')]);_0x5d4fcb['offset'](_0x5adf18[_0x82fa('0x20')]);return db['sequelize'][_0x82fa('0x3b')](_0x5d4fcb['toString'](),_0x1d93dd);})[_0x82fa('0x28')](function(_0x2b1ef7){_0x1ff7f6['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x82fa('0x2f')](_0x2b1ef7,'id'));return db['sequelize'][_0x82fa('0x3b')](_0x1ff7f6['toString'](),_0x1d93dd)['then'](function(_0xdcc00f){var _0x5de3f5=_[_0x82fa('0xa6')](_0xdcc00f,_0x82fa('0xa7'));var _0x3c4dfb=[];_0x2b1ef7[_0x82fa('0x33')](function(_0x14b349){_0x3c4dfb[_0x82fa('0x34')](updateOpenchannelInteraction(_0x14b349,_0x3fff50,_0x5de3f5));});return BPromise['all'](_0x3c4dfb);});});})[_0x82fa('0x28')](function(_0x21d28f){_0x4dfb03[_0x82fa('0xa8')]=_0x21d28f;return _0x4dfb03;})[_0x82fa('0x28')](respondWithFilteredResult(_0x34c6b3,_0x5adf18));})['catch'](handleError(_0x34c6b3,null));};exports[_0x82fa('0xa9')]=function(_0x1411de,_0x9473e0){var _0x5b683f={'raw':![],'where':{'id':_0x1411de[_0x82fa('0xaa')]['id']}},_0x59bdb7={};_0x59bdb7['model']=_[_0x82fa('0x6c')](db['OpenchannelInteraction'][_0x82fa('0xab')]);_0x59bdb7['query']=_[_0x82fa('0x6c')](_0x1411de[_0x82fa('0x3b')]);_0x59bdb7[_0x82fa('0x44')]=_[_0x82fa('0x3e')](_0x59bdb7[_0x82fa('0x3c')],_0x59bdb7[_0x82fa('0x3b')]);_0x5b683f['attributes']=_[_0x82fa('0x3e')](_0x59bdb7[_0x82fa('0x3c')],qs[_0x82fa('0x3f')](_0x1411de['query'][_0x82fa('0x3f')]));_0x5b683f['attributes']=_0x5b683f['attributes']['length']?_0x5b683f[_0x82fa('0x3d')]:_0x59bdb7['model'];if(_0x1411de[_0x82fa('0x3b')][_0x82fa('0xac')]){_0x5b683f[_0x82fa('0xad')]=[{'all':!![]}];}_0x5b683f=_[_0x82fa('0x94')]({},_0x5b683f,_0x1411de[_0x82fa('0xae')]);return db[_0x82fa('0x37')][_0x82fa('0x59')](_0x5b683f)['then'](handleEntityNotFound(_0x9473e0,null))['then'](respondWithResult(_0x9473e0,null))[_0x82fa('0x35')](handleError(_0x9473e0,null));};exports['create']=function(_0x58ef5c,_0x1d75c7){return db[_0x82fa('0x37')][_0x82fa('0xaf')](_0x58ef5c[_0x82fa('0x6b')],{})[_0x82fa('0x28')](respondWithResult(_0x1d75c7,0xc9))[_0x82fa('0x35')](handleError(_0x1d75c7,null));};exports['update']=function(_0x5b4188,_0x219f7c){if(_0x5b4188['body']['id']){delete _0x5b4188[_0x82fa('0x6b')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x5b4188[_0x82fa('0xaa')]['id']}})['then'](handleEntityNotFound(_0x219f7c,null))['then'](saveUpdates(_0x5b4188[_0x82fa('0x6b')],null))[_0x82fa('0x28')](respondWithResult(_0x219f7c,null))[_0x82fa('0x35')](handleError(_0x219f7c,null));};exports[_0x82fa('0x29')]=function(_0x33c270,_0x55d4e9){return db['OpenchannelInteraction'][_0x82fa('0x59')]({'where':{'id':_0x33c270[_0x82fa('0xaa')]['id']}})[_0x82fa('0x28')](handleEntityNotFound(_0x55d4e9,null))['then'](removeEntity(_0x55d4e9,null))[_0x82fa('0x35')](handleError(_0x55d4e9,null));};exports['describe']=function(_0x1f0998,_0xac57e1){return db[_0x82fa('0x37')][_0x82fa('0xb0')]()[_0x82fa('0x28')](respondWithResult(_0xac57e1,null))[_0x82fa('0x35')](handleError(_0xac57e1,null));};exports[_0x82fa('0xb1')]=function(_0x58d49f,_0x48d56b,_0x22df07){return db['OpenchannelMessage'][_0x82fa('0x59')]({'where':{'id':_0x58d49f[_0x82fa('0xaa')]['id']}})[_0x82fa('0x28')](handleEntityNotFound(_0x48d56b,null))[_0x82fa('0x28')](function(_0x1b0d2d){if(_0x1b0d2d){return _0x1b0d2d[_0x82fa('0xb1')](_0x58d49f[_0x82fa('0x6b')][_0x82fa('0xb2')],_[_0x82fa('0xb3')](_0x58d49f['body'],['ids','id'])||{});}})[_0x82fa('0x28')](respondWithResult(_0x48d56b,null))[_0x82fa('0x35')](handleError(_0x48d56b,null));};exports['getMessages']=function(_0x52b002,_0x548b45,_0x34127b){var _0x31b5cc={'raw':![],'where':{}};var _0x353058={};var _0x1f040f={'count':0x0,'rows':[]};return db[_0x82fa('0x37')][_0x82fa('0xb4')]({'where':{'id':_0x52b002[_0x82fa('0xaa')]['id']}})[_0x82fa('0x28')](handleEntityNotFound(_0x548b45,null))[_0x82fa('0x28')](function(_0x5dac0c){if(_0x5dac0c){_0x353058[_0x82fa('0x3c')]=_[_0x82fa('0x6c')](db['OpenchannelMessage'][_0x82fa('0xab')]);_0x353058[_0x82fa('0x3b')]=_[_0x82fa('0x6c')](_0x52b002['query']);_0x353058['filters']=_[_0x82fa('0x3e')](_0x353058[_0x82fa('0x3c')],_0x353058[_0x82fa('0x3b')]);_0x31b5cc[_0x82fa('0x3d')]=_['intersection'](_0x353058[_0x82fa('0x3c')],qs[_0x82fa('0x3f')](_0x52b002['query'][_0x82fa('0x3f')]));_0x31b5cc['attributes']=_0x31b5cc[_0x82fa('0x3d')][_0x82fa('0x40')]?_0x31b5cc['attributes']:_0x353058[_0x82fa('0x3c')];if(!_0x52b002[_0x82fa('0x3b')][_0x82fa('0xb5')]('nolimit')){_0x31b5cc['limit']=qs[_0x82fa('0x21')](_0x52b002[_0x82fa('0x3b')][_0x82fa('0x21')]);_0x31b5cc[_0x82fa('0x20')]=qs[_0x82fa('0x20')](_0x52b002[_0x82fa('0x3b')][_0x82fa('0x20')]);}_0x31b5cc[_0x82fa('0x41')]=qs[_0x82fa('0x42')](_0x52b002[_0x82fa('0x3b')][_0x82fa('0x42')]);_0x31b5cc[_0x82fa('0x43')]=qs[_0x82fa('0x44')](_[_0x82fa('0x45')](_0x52b002[_0x82fa('0x3b')],_0x353058[_0x82fa('0x44')]));_0x31b5cc['where'][_0x82fa('0xa7')]=_0x5dac0c['id'];if(_0x52b002[_0x82fa('0x3b')][_0x82fa('0x7c')]){_0x31b5cc[_0x82fa('0x43')]=_[_0x82fa('0x94')](_0x31b5cc[_0x82fa('0x43')],{'$or':_[_0x82fa('0x2f')](_0x31b5cc[_0x82fa('0x3d')],function(_0x51b151){var _0x3cade1={};_0x3cade1[_0x51b151]={'$like':'%'+_0x52b002[_0x82fa('0x3b')][_0x82fa('0x7c')]+'%'};return _0x3cade1;})});}if(_0x52b002['query'][_0x82fa('0x74')]){var _0x12a26f=_0x52b002[_0x82fa('0x3b')][_0x82fa('0x74')][_0x82fa('0x32')](',');var _0x23a5ea={};_0x23a5ea[_0x12a26f[0x0]]={'$gte':moment(_0x12a26f[0x1])['format'](_0x82fa('0xb6'))};_0x31b5cc[_0x82fa('0x43')]=_[_0x82fa('0x94')](_0x31b5cc[_0x82fa('0x43')],_0x23a5ea);}_0x31b5cc=_[_0x82fa('0x94')]({},_0x31b5cc,_0x52b002[_0x82fa('0xae')]);return db['OpenchannelMessage'][_0x82fa('0x1f')]({'where':_0x31b5cc['where']})[_0x82fa('0x28')](function(_0x40ffd7){_0x1f040f[_0x82fa('0x1f')]=_0x40ffd7;if(_0x52b002[_0x82fa('0x3b')]['includeAll']){_0x31b5cc[_0x82fa('0xad')]=[{'all':!![]}];}return db[_0x82fa('0xb7')][_0x82fa('0xb8')](_0x31b5cc);})[_0x82fa('0x28')](function(_0x33db04){_0x1f040f[_0x82fa('0xa8')]=_0x33db04;return _0x1f040f;});}})[_0x82fa('0x28')](respondWithFilteredResult(_0x548b45,_0x31b5cc))[_0x82fa('0x35')](handleError(_0x548b45,null));};exports[_0x82fa('0xb9')]=function(_0x4b393d,_0x5cb46b,_0x4f2d36){return db[_0x82fa('0x37')][_0x82fa('0x59')]({'where':{'id':_0x4b393d['params']['id']}})['then'](handleEntityNotFound(_0x5cb46b,null))['then'](function(_0x4f3d3a){if(_0x4f3d3a){return _0x4f3d3a[_0x82fa('0xba')](_0x4b393d[_0x82fa('0x6b')]['ids'],_[_0x82fa('0xb3')](_0x4b393d['body'],[_0x82fa('0xb2'),'id'])||{})[_0x82fa('0xbb')](function(){return db[_0x82fa('0x64')]['findAll']({'attributes':['id',_0x82fa('0x2c'),_0x82fa('0x48')],'where':{'id':_0x4b393d[_0x82fa('0x6b')]['ids']}});})[_0x82fa('0x28')](function(_0x4e8e98){socket[_0x82fa('0xbc')]('openchannelInteractionTags:save',{'id':Number(_0x4b393d[_0x82fa('0xaa')]['id']),'tags':_0x4e8e98||[]});return{'id':Number(_0x4b393d[_0x82fa('0xaa')]['id']),'tags':_0x4e8e98||[]};});}})['then'](respondWithResult(_0x5cb46b,null))[_0x82fa('0x35')](handleError(_0x5cb46b,null));};exports[_0x82fa('0xbd')]=function(_0x1e8e82,_0x28ad0d,_0x461a5f){return db[_0x82fa('0x37')][_0x82fa('0x59')]({'where':{'id':_0x1e8e82[_0x82fa('0xaa')]['id']}})['then'](handleEntityNotFound(_0x28ad0d,null))[_0x82fa('0x28')](function(_0x1a3e83){if(_0x1a3e83){return _0x1a3e83[_0x82fa('0xbd')](_0x1e8e82[_0x82fa('0x3b')][_0x82fa('0xb2')]);}})[_0x82fa('0x28')](respondWithStatusCode(_0x28ad0d,null))[_0x82fa('0x35')](handleError(_0x28ad0d,null));};exports[_0x82fa('0xbe')]=function(_0x31c063,_0x151024){var _0x4c1df5=moment()[_0x82fa('0xbf')]()['toString']();var _0x1eb386=path[_0x82fa('0xc0')](config[_0x82fa('0xc1')],'server','files',_0x82fa('0xc2'));var _0x448e2a=path[_0x82fa('0xc0')](config[_0x82fa('0xc1')],_0x82fa('0xc3'),_0x82fa('0xc4'),'attachments');var _0xa27126=path[_0x82fa('0xc0')](_0x1eb386,_0x4c1df5);var _0x5d4693=util['format'](_0x82fa('0xc5'),_0x31c063[_0x82fa('0xaa')]['id'],_0x4c1df5);var _0x52860a=path[_0x82fa('0xc0')](_0x1eb386,_0x5d4693);var _0x23226f=[];_0x23226f['push']({'model':db[_0x82fa('0xc6')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x23226f['push']({'model':db[_0x82fa('0xc7')],'as':_0x82fa('0x5e'),'attributes':['id',_0x82fa('0xc8'),_0x82fa('0xc9')],'raw':!![]});if(_0x31c063[_0x82fa('0x3b')]['attachments']){_0x23226f[_0x82fa('0x34')]({'model':db[_0x82fa('0xca')],'as':_0x82fa('0xca'),'raw':!![]});}var _0x4cd609=[{'model':db['OpenchannelMessage'],'as':_0x82fa('0xcb'),'attributes':['id',_0x82fa('0x6b'),_0x82fa('0x72'),_0x82fa('0xcc'),'secret','read'],'include':_0x23226f}];_0x4cd609[_0x82fa('0x34')]({'model':db[_0x82fa('0xcd')],'as':_0x82fa('0xce'),'attributes':['id','name']});_0x4cd609[_0x82fa('0x34')]({'model':db[_0x82fa('0xc6')],'as':_0x82fa('0xcf'),'attributes':['id',_0x82fa('0xd0')]});return db['OpenchannelInteraction'][_0x82fa('0x59')]({'where':{'id':_0x31c063[_0x82fa('0xaa')]['id']},'include':_0x4cd609})[_0x82fa('0x28')](handleEntityNotFound(_0x151024,null))[_0x82fa('0x28')](function(_0x232b83){if(_0x232b83){var _0x181eeb=_0x232b83[_0x82fa('0xd1')]({'plain':!![]});fs[_0x82fa('0xd2')](_0xa27126);var _0x2cd9cc={'format':'A4','border':'10px','header':{'height':_0x82fa('0xd3'),'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
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'}},'footer':{'height':_0x82fa('0xd4'),'contents':{'default':util[_0x82fa('0xd5')]('\x0a\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\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{{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\x0a\x20\x20\x20\x20\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%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\x0a\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[_0x82fa('0xd5')](_0x82fa('0xd6'),'Openchannel',_0x181eeb['id']),moment()['format'](_0x82fa('0xd7'))[_0x82fa('0x92')]())}}};var _0x2de21c={'channel':_0x82fa('0xd8'),'account':_0x181eeb['Account'][_0x82fa('0x2c')],'agent':_0x181eeb[_0x82fa('0xcf')]?_0x181eeb[_0x82fa('0xcf')]['fullname']:_0x82fa('0xd9'),'createdAt':moment(_0x181eeb['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x82fa('0x92')](),'closedAt':_0x181eeb['closed']?moment(_0x181eeb[_0x82fa('0xda')])[_0x82fa('0xd5')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x181eeb['disposition'],'visibility':_0x181eeb[_0x82fa('0xdb')]?_0x82fa('0xdc'):_0x82fa('0xdd'),'messages':_(_0x181eeb[_0x82fa('0xcb')])[_0x82fa('0x7c')]({'secret':![]})[_0x82fa('0x2f')](function(_0x214e2d){if(_0x214e2d['Attachment']){var _0x3ed0c1=path[_0x82fa('0xc0')](_0x448e2a,_0x214e2d[_0x82fa('0xca')]['basename']);if(fs[_0x82fa('0xde')](_0x3ed0c1)){fs[_0x82fa('0xdf')](_0x3ed0c1)[_0x82fa('0xe0')](fs[_0x82fa('0xe1')](path[_0x82fa('0xc0')](_0xa27126,_0x214e2d[_0x82fa('0xca')][_0x82fa('0xe2')])));}}return{'date':moment(_0x214e2d['createdAt'])[_0x82fa('0xd5')](_0x82fa('0xb6'))[_0x82fa('0x92')](),'sender':_0x214e2d[_0x82fa('0xcc')]==='out'?_0x214e2d[_0x82fa('0xc6')]?_0x214e2d['User'][_0x82fa('0xd0')]:'System':_0x214e2d[_0x82fa('0x5e')][_0x82fa('0xc8')]+(_0x214e2d[_0x82fa('0x5e')][_0x82fa('0xc9')]?'\x20'+_0x214e2d[_0x82fa('0x5e')][_0x82fa('0xc9')]:''),'body':_0x214e2d['Attachment']?_0x214e2d[_0x82fa('0xca')]['basename']:_0x214e2d[_0x82fa('0x6b')],'direction':_0x214e2d['direction']===_0x82fa('0xe3')?'A':'C','secret':_0x214e2d[_0x82fa('0xe4')],'read':_0x214e2d[_0x82fa('0x78')],'attachment':_0x214e2d['Attachment']};})[_0x82fa('0x5a')]()};return ejs[_0x82fa('0xe5')](path['join'](config['root'],'server','views',_0x82fa('0xe6')),{'interaction':_0x2de21c})[_0x82fa('0x28')](function(_0x27e039){return new BPromise(function(_0x4f7e7c,_0x525b20){pdf[_0x82fa('0xaf')](_0x27e039,_0x2cd9cc)[_0x82fa('0xe7')](path[_0x82fa('0xc0')](_0xa27126,_0x82fa('0xe8')+_0x181eeb['id']+'-'+_0x4c1df5+'.pdf'),function(_0x39e72c,_0x6d5d7b){if(_0x39e72c)return _0x525b20(_0x39e72c);_0x4f7e7c(_0x6d5d7b);});});})['then'](function(){return new BPromise(function(_0xc607d8,_0x3b1a2d){zipdir(_0xa27126,{'saveTo':_0x52860a},function(_0x3d4979,_0x3b8a58){if(_0x3d4979)return _0x3b1a2d(_0x3d4979);return _0xc607d8(_0x3b8a58);});})['then'](function(){return new BPromise(function(_0x56f3c0,_0x5e1beb){rimraf(_0xa27126,function(_0x335748){if(_0x335748)_0x5e1beb(_0x335748);return _0x56f3c0();});});})[_0x82fa('0x28')](function(){return _0x151024[_0x82fa('0xbe')](_0x52860a,_0x5d4693,function(_0x53863f){if(_0x53863f){console[_0x82fa('0xe9')](_0x82fa('0xea'),_0x53863f);}else{fs[_0x82fa('0xeb')](_0x52860a);}});});});}else{return _0x151024[_0x82fa('0x1d')](0xc8);}})[_0x82fa('0x35')](handleError(_0x151024,null));}; \ No newline at end of file +var _0xea37=['expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','keys','some','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','OpenchannelInteractionId','all','rows','show','params','includeAll','create','describe','addMessage','ids','findOne','OpenchannelMessage','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','addTags','setTags','omit','spread','openchannelInteractionTags:save','removeTags','unix','join','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','CmContact','Contact','firstName','Attachment','Messages','secret','OpenchannelAccount','Account','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
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','\x0a\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\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{{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\x0a\x20\x20\x20\x20\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%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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Openchannel','YYYY-MM-DD','Owner','closed','closedAt','disposition','threadId','Private','existsSync','pipe','basename','direction','out','System','lastName','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','fullname','TagIds','Tags','split','forEach','push','catch','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId'];(function(_0x37db2a,_0x203301){var _0x4ae4b1=function(_0x5b0d70){while(--_0x5b0d70){_0x37db2a['push'](_0x37db2a['shift']());}};_0x4ae4b1(++_0x203301);}(_0xea37,0x18e));var _0x7ea3=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0xea37[_0x5a7e3c];return _0x59252b;};'use strict';var pdf=require(_0x7ea3('0x0'));var emlformat=require(_0x7ea3('0x1'));var rimraf=require(_0x7ea3('0x2'));var zipdir=require(_0x7ea3('0x3'));var jsonpatch=require(_0x7ea3('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7ea3('0x5'));var Mustache=require(_0x7ea3('0x6'));var util=require('util');var path=require(_0x7ea3('0x7'));var sox=require(_0x7ea3('0x8'));var csv=require(_0x7ea3('0x9'));var ejs=require(_0x7ea3('0xa'));var fs=require('fs');var _=require(_0x7ea3('0xb'));var squel=require(_0x7ea3('0xc'));var crypto=require(_0x7ea3('0xd'));var jsforce=require(_0x7ea3('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7ea3('0xf'));var Papa=require('papaparse');var Redis=require(_0x7ea3('0x10'));var authService=require(_0x7ea3('0x11'));var qs=require(_0x7ea3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ea3('0x13'));var logger=require('../../config/logger')(_0x7ea3('0x14'));var utils=require(_0x7ea3('0x15'));var config=require(_0x7ea3('0x16'));var db=require(_0x7ea3('0x17'))['db'];config[_0x7ea3('0x18')]=_['defaults'](config[_0x7ea3('0x18')],{'host':_0x7ea3('0x19'),'port':0x18eb});var socket=require(_0x7ea3('0x1a'))(new Redis(config[_0x7ea3('0x18')]));require(_0x7ea3('0x1b'))['register'](socket);function respondWithStatusCode(_0x470915,_0x32422c){_0x32422c=_0x32422c||0xcc;return function(_0x33165d){if(_0x33165d){return _0x470915[_0x7ea3('0x1c')](_0x32422c);}return _0x470915['status'](_0x32422c)['end']();};}function respondWithResult(_0x26c6af,_0xa07a02){_0xa07a02=_0xa07a02||0xc8;return function(_0x29add8){if(_0x29add8){return _0x26c6af[_0x7ea3('0x1d')](_0xa07a02)['json'](_0x29add8);}};}function respondWithFilteredResult(_0x3bfeb5,_0x21188d){return function(_0x1b03ea){if(_0x1b03ea){var _0x5c3b2f=_0x1b03ea['count'],_0x57362c=_0x21188d[_0x7ea3('0x1e')],_0x5de72d=_0x21188d[_0x7ea3('0x1e')]+_0x21188d[_0x7ea3('0x1f')],_0xd4acd7;if(_0x5de72d>=_0x5c3b2f){_0x5de72d=_0x5c3b2f;_0xd4acd7=0xc8;}else{_0xd4acd7=0xce;}_0x3bfeb5[_0x7ea3('0x1d')](_0xd4acd7);return _0x3bfeb5[_0x7ea3('0x20')]('Content-Range',_0x57362c+'-'+_0x5de72d+'/'+_0x5c3b2f)['json'](_0x1b03ea);}return null;};}function patchUpdates(_0x5a579a){return function(_0xde72f8){try{jsonpatch[_0x7ea3('0x21')](_0xde72f8,_0x5a579a,!![]);}catch(_0x5464c3){return BPromise[_0x7ea3('0x22')](_0x5464c3);}return _0xde72f8['save']();};}function saveUpdates(_0x12de3a,_0x179250){return function(_0x32f25d){if(_0x32f25d){return _0x32f25d[_0x7ea3('0x23')](_0x12de3a)[_0x7ea3('0x24')](function(_0x1af8c9){return _0x1af8c9;});}return null;};}function removeEntity(_0xb304fe,_0x5b71ce){return function(_0x1808db){if(_0x1808db){return _0x1808db[_0x7ea3('0x25')]()[_0x7ea3('0x24')](function(){_0xb304fe[_0x7ea3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x365b77,_0x212cd3){return function(_0x24a04a){if(!_0x24a04a){_0x365b77[_0x7ea3('0x1c')](0x194);}return _0x24a04a;};}function handleError(_0x246687,_0x1d1bee){_0x1d1bee=_0x1d1bee||0x1f4;return function(_0x32638a){logger[_0x7ea3('0x26')](_0x32638a[_0x7ea3('0x27')]);if(_0x32638a[_0x7ea3('0x28')]){delete _0x32638a[_0x7ea3('0x28')];}_0x246687['status'](_0x1d1bee)['send'](_0x32638a);};}function getInteractionUsers(_0x8a38bf,_0x588e9d){return new BPromise(function(_0x523363,_0x18ba17){try{if(_0x588e9d[_0x8a38bf['id']]){_0x8a38bf['Users']=_['map'](_0x588e9d[_0x8a38bf['id']],function(_0x455d23){return{'id':_0x455d23['id'],'fullname':_0x455d23[_0x7ea3('0x29')]};});}}catch(_0x1a542b){_0x18ba17(_0x1a542b);}_0x523363(_0x8a38bf);});}function getInteractionTags(_0x3a35ad,_0x46896e){return new BPromise(function(_0x50eda7,_0x52637a){try{if(_0x3a35ad[_0x7ea3('0x2a')]){_0x3a35ad[_0x7ea3('0x2b')]=[];_0x3a35ad['TagIds'][_0x7ea3('0x2c')](',')[_0x7ea3('0x2d')](function(_0x1582cd){_0x3a35ad['Tags'][_0x7ea3('0x2e')](_0x46896e[_0x1582cd]);});}delete _0x3a35ad['TagIds'];}catch(_0x13e317){_0x52637a(_0x13e317);}_0x50eda7(_0x3a35ad);});}function updateOpenchannelInteraction(_0x27ec35,_0x30d6ac,_0x52fd31){return new BPromise(function(_0x267ff4,_0x11a152){return getInteractionUsers(_0x27ec35,_0x52fd31)[_0x7ea3('0x24')](function(_0x5085e5){return getInteractionTags(_0x5085e5,_0x30d6ac);})[_0x7ea3('0x24')](function(_0x25ccd7){_0x267ff4(_0x25ccd7);})[_0x7ea3('0x2f')](function(_0xa65cf1){_0x11a152(_0xa65cf1);});});}exports[_0x7ea3('0x30')]=function(_0x8d8288,_0x280995){var _0x41ebf7={},_0x223b7c={},_0x163035={'count':0x0,'rows':[]};var _0x32edcc=_[_0x7ea3('0x31')](db[_0x7ea3('0x32')][_0x7ea3('0x33')],function(_0x1564c5){return{'name':_0x1564c5[_0x7ea3('0x34')],'type':_0x1564c5[_0x7ea3('0x35')]['key']};});_0x223b7c[_0x7ea3('0x36')]=_[_0x7ea3('0x31')](_0x32edcc,'name');_0x223b7c[_0x7ea3('0x37')]=_['keys'](_0x8d8288['query']);_0x223b7c[_0x7ea3('0x38')]=_['intersection'](_0x223b7c[_0x7ea3('0x36')],_0x223b7c[_0x7ea3('0x37')]);_0x41ebf7[_0x7ea3('0x39')]=_[_0x7ea3('0x3a')](_0x223b7c[_0x7ea3('0x36')],qs[_0x7ea3('0x3b')](_0x8d8288[_0x7ea3('0x37')]['fields']));_0x41ebf7['attributes']=_0x41ebf7['attributes'][_0x7ea3('0x3c')]?_0x41ebf7[_0x7ea3('0x39')]:_0x223b7c[_0x7ea3('0x36')];if(!_0x8d8288['query'][_0x7ea3('0x3d')](_0x7ea3('0x3e'))){_0x41ebf7[_0x7ea3('0x1f')]=qs['limit'](_0x8d8288[_0x7ea3('0x37')]['limit']);_0x41ebf7[_0x7ea3('0x1e')]=qs[_0x7ea3('0x1e')](_0x8d8288[_0x7ea3('0x37')][_0x7ea3('0x1e')]);}_0x41ebf7[_0x7ea3('0x3f')]=qs[_0x7ea3('0x40')](_0x8d8288[_0x7ea3('0x37')][_0x7ea3('0x40')]);_0x41ebf7['where']=qs[_0x7ea3('0x38')](_[_0x7ea3('0x41')](_0x8d8288[_0x7ea3('0x37')],_0x223b7c[_0x7ea3('0x38')]));var _0x591a36=[];var _0x5c97a9=squel[_0x7ea3('0x42')]()[_0x7ea3('0x43')]('id')[_0x7ea3('0x43')](_0x7ea3('0x28'))['field'](_0x7ea3('0x44'))[_0x7ea3('0x45')]('tools_tags');var _0x42bd5b=squel[_0x7ea3('0x42')]()[_0x7ea3('0x43')](_0x7ea3('0x46'))['field'](_0x7ea3('0x47'))[_0x7ea3('0x43')](_0x7ea3('0x48'))['from'](_0x7ea3('0x49'),'ui')[_0x7ea3('0x4a')]('users','u',_0x7ea3('0x4b'));var _0x3fe306=squel[_0x7ea3('0x42')]()[_0x7ea3('0x45')](_0x7ea3('0x4c'),'i')[_0x7ea3('0x4a')](_0x7ea3('0x4d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x7ea3('0x4e'),'o',_0x7ea3('0x4f'))[_0x7ea3('0x4a')](_0x7ea3('0x50'),'a',_0x7ea3('0x51'))[_0x7ea3('0x4a')](_0x7ea3('0x52'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x7ea3('0x4a')]('openchannel_interaction_has_tags','it',_0x7ea3('0x53'))[_0x7ea3('0x4a')](_0x7ea3('0x54'),'t',_0x7ea3('0x55'));var _0x60bcd2=squel[_0x7ea3('0x56')]();var _0x5724e7=[];var _0x17fb7f=squel[_0x7ea3('0x56')]();var _0x488a3d;if(_0x8d8288[_0x7ea3('0x37')][_0x7ea3('0x57')]){_0x488a3d=as[_0x7ea3('0x58')](_0x8d8288[_0x7ea3('0x37')]['search']);var _0x46de3e=_0x488a3d[_0x7ea3('0x59')];for(var _0x3f71f7=0x0;_0x3f71f7<_0x488a3d[_0x7ea3('0x5a')][_0x7ea3('0x3c')];_0x3f71f7++){var _0x484aec=_0x488a3d[_0x7ea3('0x5a')][_0x3f71f7];var _0x20009b='i';var _0x4a28f2=_[_0x7ea3('0x5b')](_0x32edcc,[_0x7ea3('0x28'),_0x484aec[_0x7ea3('0x43')]]);if(!_0x4a28f2){switch(_0x484aec[_0x7ea3('0x43')]){case'unreadMessages':if(_0x484aec['value']==0x1){_0x3fe306[_0x7ea3('0x5c')]('`'+_0x484aec['field']+_0x7ea3('0x5d'));}else{_0x3fe306[_0x7ea3('0x5c')]('`'+_0x484aec[_0x7ea3('0x43')]+_0x7ea3('0x5e'));}break;case'Contact':if(_0x484aec[_0x7ea3('0x5f')]===_0x7ea3('0x60')){if(_0x484aec[_0x7ea3('0x61')][_0x7ea3('0x2c')]('\x20')[_0x7ea3('0x3c')]>0x1){_0x60bcd2[_0x46de3e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7ea3('0x62')](_0x484aec['value']),null);}else{var _0x2f5c1f='%'+_0x484aec[_0x7ea3('0x61')]+'%';_0x60bcd2[_0x46de3e](_0x7ea3('0x63'),_0x2f5c1f,_0x2f5c1f,_0x2f5c1f);}}else{_0x4a28f2=_[_0x7ea3('0x5b')](_0x32edcc,[_0x7ea3('0x28'),_0x7ea3('0x64')]);_0x484aec['field']=_0x7ea3('0x64');_0x21e00a=as['buildExpression'](_0x20009b,_0x4a28f2[_0x7ea3('0x35')],_0x484aec);_0x60bcd2[_0x46de3e](_0x21e00a[_0x7ea3('0x65')],_0x21e00a[_0x7ea3('0x61')][_0x7ea3('0x66')],_0x21e00a[_0x7ea3('0x61')][_0x7ea3('0x67')]);}break;case _0x7ea3('0x68'):var _0x57cfca=_0x484aec[_0x7ea3('0x61')][_0x7ea3('0x2c')](',')[_0x7ea3('0x31')](function(_0x1d8e74){return Number(_0x1d8e74);});_0x57cfca[_0x7ea3('0x2d')](function(_0x255044){_0x17fb7f['or'](_0x7ea3('0x69'),'%,'+_0x255044+',%');});_0x5724e7=_['union'](_0x5724e7,_0x57cfca);break;case _0x7ea3('0x6a'):if(_0x484aec[_0x7ea3('0x5f')]===_0x7ea3('0x60')){_0x60bcd2[_0x46de3e](_0x7ea3('0x6b'),'%'+_0x484aec[_0x7ea3('0x61')]+'%',null);}else{_0x4a28f2=_[_0x7ea3('0x5b')](_0x32edcc,[_0x7ea3('0x28'),_0x7ea3('0x6c')]);_0x484aec[_0x7ea3('0x43')]=_0x7ea3('0x6c');_0x21e00a=as[_0x7ea3('0x6d')](_0x20009b,_0x4a28f2['type'],_0x484aec);_0x60bcd2[_0x46de3e](_0x21e00a[_0x7ea3('0x65')],_0x21e00a['value'][_0x7ea3('0x66')],_0x21e00a[_0x7ea3('0x61')][_0x7ea3('0x67')]);}break;case _0x7ea3('0x6e'):_0x21e00a=as[_0x7ea3('0x6d')]('me',null,_0x484aec);_0x60bcd2[_0x46de3e](_0x21e00a[_0x7ea3('0x65')],_0x21e00a[_0x7ea3('0x61')]['start'],_0x21e00a[_0x7ea3('0x61')]['end']);break;}}else{var _0x21e00a=as[_0x7ea3('0x6d')](_0x20009b,_0x4a28f2[_0x7ea3('0x35')],_0x484aec);_0x60bcd2[_0x46de3e](_0x21e00a[_0x7ea3('0x65')],_0x21e00a[_0x7ea3('0x61')][_0x7ea3('0x66')],_0x21e00a[_0x7ea3('0x61')][_0x7ea3('0x67')]);}}}else{var _0x520cb6=_(_0x8d8288[_0x7ea3('0x37')])[_0x7ea3('0x6f')]()['map'](function(_0x4849c9){return _[_0x7ea3('0x70')](_0x32edcc,[_0x7ea3('0x28'),_0x4849c9])?_0x4849c9:undefined;})[_0x7ea3('0x71')]()[_0x7ea3('0x61')]();if(!_[_0x7ea3('0x72')](_0x520cb6)){_0x520cb6[_0x7ea3('0x2d')](function(_0x489a5e){if(_0x489a5e===_0x7ea3('0x73')){_0x3fe306[_0x7ea3('0x74')](_0x7ea3('0x75'),[][_0x7ea3('0x76')](_0x8d8288['query'][_0x489a5e]));}else if(_0x489a5e===_0x7ea3('0x77')){var _0x35d8d0=JSON[_0x7ea3('0x78')](_0x8d8288[_0x7ea3('0x37')][_0x489a5e])[_0x7ea3('0x79')];var _0x421147=JSON['parse'](_0x8d8288[_0x7ea3('0x37')][_0x489a5e])[_0x7ea3('0x7a')];_0x3fe306[_0x7ea3('0x74')](_0x7ea3('0x7b'),_0x35d8d0,_0x421147);}else{if(_0x8d8288[_0x7ea3('0x37')][_0x489a5e]===_0x7ea3('0x7c')){_0x3fe306[_0x7ea3('0x74')]('i.'+_0x489a5e+_0x7ea3('0x7d'));}else{_0x3fe306[_0x7ea3('0x74')]('i.'+_0x489a5e+_0x7ea3('0x7e'),_0x8d8288[_0x7ea3('0x37')][_0x489a5e]);}}});}if(_0x8d8288[_0x7ea3('0x37')][_0x7ea3('0x7f')]){if(_0x8d8288[_0x7ea3('0x37')]['read']==0x1){_0x3fe306[_0x7ea3('0x5c')]('`unreadMessages`\x20=\x200');}else{_0x3fe306[_0x7ea3('0x5c')](_0x7ea3('0x80'));}}if(_0x8d8288[_0x7ea3('0x37')][_0x7ea3('0x81')]){_0x5724e7=_[_0x7ea3('0x82')](_0x8d8288[_0x7ea3('0x37')][_0x7ea3('0x81')])?_0x8d8288[_0x7ea3('0x37')][_0x7ea3('0x81')]:new Array(_0x8d8288['query'][_0x7ea3('0x81')]);_0x5724e7[_0x7ea3('0x2d')](function(_0x4d184e){_0x17fb7f['or'](_0x7ea3('0x69'),'%,'+_0x4d184e+',%');});}if(_0x8d8288[_0x7ea3('0x37')][_0x7ea3('0x83')]){var _0x2bc926=_0x8d8288[_0x7ea3('0x37')]['filter'][_0x7ea3('0x84')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x7ea3('0x85'));if(qs['isNumeric'](_0x2bc926)){_0x60bcd2['or'](_0x7ea3('0x86'),_0x2bc926+'%');}else{_0x60bcd2['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7ea3('0x62')](_0x2bc926))['or'](_0x7ea3('0x87'),_0x2bc926+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2bc926+'%');}}}_0x3fe306[_0x7ea3('0x74')](_0x60bcd2);_0x3fe306[_0x7ea3('0x88')]('i.id');var _0x467ffa={'type':db[_0x7ea3('0x89')][_0x7ea3('0x8a')][_0x7ea3('0x8b')],'raw':!![]};var _0x6880a9=_0x3fe306[_0x7ea3('0x8c')]();_0x6880a9[_0x7ea3('0x43')](_0x7ea3('0x8d'));_0x6880a9[_0x7ea3('0x43')](_0x7ea3('0x8e'),_0x7ea3('0x8f'));if(_0x41ebf7['order']){_0x41ebf7[_0x7ea3('0x3f')][_0x7ea3('0x2d')](function(_0x3c4a3b){_0x3fe306['order']('i.'+_0x3c4a3b[0x0],_0x3c4a3b[0x1]===_0x7ea3('0x90')?![]:!![]);});}if(!_[_0x7ea3('0x72')](_0x5724e7)){_0x3fe306[_0x7ea3('0x5c')](_0x17fb7f);_0x6880a9[_0x7ea3('0x74')](_0x7ea3('0x91'),_0x5724e7);}BPromise[_0x7ea3('0x92')]()[_0x7ea3('0x24')](function(){if(!_0x488a3d){if(_0x8d8288[_0x7ea3('0x37')][_0x7ea3('0x73')]||_0x8d8288[_0x7ea3('0x37')][_0x7ea3('0x93')])return;_0x6880a9['where'](_0x7ea3('0x94'));_0x3fe306[_0x7ea3('0x74')](_0x7ea3('0x94'));return;}return _0x8d8288[_0x7ea3('0x95')][_0x7ea3('0x96')]({'attributes':['id'],'raw':!![]})[_0x7ea3('0x24')](function(_0x39444b){if(_[_0x7ea3('0x72')](_0x39444b)){_0x6880a9[_0x7ea3('0x74')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x3fe306[_0x7ea3('0x74')](_0x7ea3('0x97'));}else{_0x6880a9['where'](_0x7ea3('0x75'),_[_0x7ea3('0x31')](_0x39444b,'id'));_0x3fe306[_0x7ea3('0x74')](_0x7ea3('0x75'),_[_0x7ea3('0x31')](_0x39444b,'id'));}});})[_0x7ea3('0x24')](function(){db[_0x7ea3('0x98')][_0x7ea3('0x37')](_0x6880a9[_0x7ea3('0x99')](),_0x467ffa)['then'](function(_0x3d0700){_0x163035['count']=_0x3d0700[_0x7ea3('0x3c')];if(_0x163035[_0x7ea3('0x9a')]===0x0)return[];return db[_0x7ea3('0x98')][_0x7ea3('0x37')](_0x5c97a9[_0x7ea3('0x99')](),_0x467ffa)[_0x7ea3('0x24')](function(_0x2143c9){_0x591a36=_[_0x7ea3('0x9b')](_0x2143c9,'id');_0x467ffa=_[_0x7ea3('0x9c')](_0x467ffa,{'model':db[_0x7ea3('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x8d8288[_0x7ea3('0x37')][_0x7ea3('0x3b')]){_0x41ebf7[_0x7ea3('0x39')][_0x7ea3('0x2d')](function(_0x19056e){_0x3fe306[_0x7ea3('0x43')]('i.'+_0x19056e);});}else{_0x3fe306['field'](_0x7ea3('0x8e'),_0x7ea3('0x8f'));_0x3fe306['field'](_0x7ea3('0x9d'),_0x7ea3('0x9e'));_0x3fe306[_0x7ea3('0x43')](_0x7ea3('0x9f'),_0x7ea3('0xa0'));_0x3fe306[_0x7ea3('0x43')]('i.*');_0x3fe306[_0x7ea3('0x43')](_0x7ea3('0xa1'),'Contact.firstName');_0x3fe306[_0x7ea3('0x43')](_0x7ea3('0xa2'),_0x7ea3('0xa3'));_0x3fe306['field']('c.email',_0x7ea3('0xa4'));_0x3fe306[_0x7ea3('0x43')](_0x7ea3('0xa5'),_0x7ea3('0xa6'));_0x3fe306[_0x7ea3('0x43')](_0x7ea3('0xa7'),_0x7ea3('0xa8'));_0x3fe306[_0x7ea3('0x43')]('c.fax',_0x7ea3('0xa9'));_0x3fe306[_0x7ea3('0x43')](_0x7ea3('0xaa'),_0x7ea3('0xab'));_0x3fe306[_0x7ea3('0x43')](_0x7ea3('0xac'),_0x7ea3('0xad'));_0x3fe306[_0x7ea3('0x43')](_0x7ea3('0xae'),'TagIds');}_0x3fe306[_0x7ea3('0x1f')](_0x41ebf7[_0x7ea3('0x1f')]);_0x3fe306[_0x7ea3('0x1e')](_0x41ebf7[_0x7ea3('0x1e')]);return db[_0x7ea3('0x98')][_0x7ea3('0x37')](_0x3fe306[_0x7ea3('0x99')](),_0x467ffa);})[_0x7ea3('0x24')](function(_0x562144){_0x42bd5b['where']('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x562144,'id'));return db['sequelize'][_0x7ea3('0x37')](_0x42bd5b[_0x7ea3('0x99')](),_0x467ffa)[_0x7ea3('0x24')](function(_0x2ac64d){var _0xed8e5a=_['groupBy'](_0x2ac64d,_0x7ea3('0xaf'));var _0x2d0e69=[];_0x562144[_0x7ea3('0x2d')](function(_0x998ac5){_0x2d0e69[_0x7ea3('0x2e')](updateOpenchannelInteraction(_0x998ac5,_0x591a36,_0xed8e5a));});return BPromise[_0x7ea3('0xb0')](_0x2d0e69);});});})[_0x7ea3('0x24')](function(_0x2bf861){_0x163035[_0x7ea3('0xb1')]=_0x2bf861;return _0x163035;})['then'](respondWithFilteredResult(_0x280995,_0x41ebf7));})[_0x7ea3('0x2f')](handleError(_0x280995,null));};exports[_0x7ea3('0xb2')]=function(_0x5eec48,_0xba4493){var _0x176e30={'raw':![],'where':{'id':_0x5eec48[_0x7ea3('0xb3')]['id']}},_0x1f4f65={};_0x1f4f65[_0x7ea3('0x36')]=_[_0x7ea3('0x6f')](db[_0x7ea3('0x32')][_0x7ea3('0x33')]);_0x1f4f65[_0x7ea3('0x37')]=_['keys'](_0x5eec48['query']);_0x1f4f65['filters']=_['intersection'](_0x1f4f65[_0x7ea3('0x36')],_0x1f4f65[_0x7ea3('0x37')]);_0x176e30[_0x7ea3('0x39')]=_[_0x7ea3('0x3a')](_0x1f4f65[_0x7ea3('0x36')],qs[_0x7ea3('0x3b')](_0x5eec48[_0x7ea3('0x37')][_0x7ea3('0x3b')]));_0x176e30[_0x7ea3('0x39')]=_0x176e30[_0x7ea3('0x39')][_0x7ea3('0x3c')]?_0x176e30[_0x7ea3('0x39')]:_0x1f4f65[_0x7ea3('0x36')];if(_0x5eec48[_0x7ea3('0x37')][_0x7ea3('0xb4')]){_0x176e30['include']=[{'all':!![]}];}_0x176e30=_[_0x7ea3('0x9c')]({},_0x176e30,_0x5eec48['options']);return db[_0x7ea3('0x32')][_0x7ea3('0x5b')](_0x176e30)[_0x7ea3('0x24')](handleEntityNotFound(_0xba4493,null))[_0x7ea3('0x24')](respondWithResult(_0xba4493,null))[_0x7ea3('0x2f')](handleError(_0xba4493,null));};exports[_0x7ea3('0xb5')]=function(_0xdc4dc1,_0x29ece1){return db[_0x7ea3('0x32')]['create'](_0xdc4dc1[_0x7ea3('0x6e')],{})[_0x7ea3('0x24')](respondWithResult(_0x29ece1,0xc9))['catch'](handleError(_0x29ece1,null));};exports['update']=function(_0x4cb0b2,_0x38e810){if(_0x4cb0b2[_0x7ea3('0x6e')]['id']){delete _0x4cb0b2[_0x7ea3('0x6e')]['id'];}return db[_0x7ea3('0x32')][_0x7ea3('0x5b')]({'where':{'id':_0x4cb0b2[_0x7ea3('0xb3')]['id']}})['then'](handleEntityNotFound(_0x38e810,null))[_0x7ea3('0x24')](saveUpdates(_0x4cb0b2[_0x7ea3('0x6e')],null))['then'](respondWithResult(_0x38e810,null))['catch'](handleError(_0x38e810,null));};exports[_0x7ea3('0x25')]=function(_0x203a5e,_0x4c02ee){return db[_0x7ea3('0x32')][_0x7ea3('0x5b')]({'where':{'id':_0x203a5e[_0x7ea3('0xb3')]['id']}})[_0x7ea3('0x24')](handleEntityNotFound(_0x4c02ee,null))[_0x7ea3('0x24')](removeEntity(_0x4c02ee,null))[_0x7ea3('0x2f')](handleError(_0x4c02ee,null));};exports['describe']=function(_0x5ebe20,_0x5d5eba){return db[_0x7ea3('0x32')][_0x7ea3('0xb6')]()[_0x7ea3('0x24')](respondWithResult(_0x5d5eba,null))[_0x7ea3('0x2f')](handleError(_0x5d5eba,null));};exports[_0x7ea3('0xb7')]=function(_0x21b691,_0x553521,_0x5dc9d8){return db['OpenchannelMessage']['find']({'where':{'id':_0x21b691[_0x7ea3('0xb3')]['id']}})[_0x7ea3('0x24')](handleEntityNotFound(_0x553521,null))[_0x7ea3('0x24')](function(_0x2950a6){if(_0x2950a6){return _0x2950a6[_0x7ea3('0xb7')](_0x21b691[_0x7ea3('0x6e')][_0x7ea3('0xb8')],_['omit'](_0x21b691[_0x7ea3('0x6e')],[_0x7ea3('0xb8'),'id'])||{});}})['then'](respondWithResult(_0x553521,null))[_0x7ea3('0x2f')](handleError(_0x553521,null));};exports['getMessages']=function(_0x47ac06,_0x374a36,_0x4ede9f){var _0x47cb93={'raw':![],'where':{}};var _0xb24401={};var _0x43f52f={'count':0x0,'rows':[]};return db[_0x7ea3('0x32')][_0x7ea3('0xb9')]({'where':{'id':_0x47ac06[_0x7ea3('0xb3')]['id']}})[_0x7ea3('0x24')](handleEntityNotFound(_0x374a36,null))[_0x7ea3('0x24')](function(_0x4e4cf9){if(_0x4e4cf9){_0xb24401['model']=_[_0x7ea3('0x6f')](db[_0x7ea3('0xba')][_0x7ea3('0x33')]);_0xb24401[_0x7ea3('0x37')]=_[_0x7ea3('0x6f')](_0x47ac06[_0x7ea3('0x37')]);_0xb24401[_0x7ea3('0x38')]=_['intersection'](_0xb24401['model'],_0xb24401[_0x7ea3('0x37')]);_0x47cb93['attributes']=_[_0x7ea3('0x3a')](_0xb24401['model'],qs['fields'](_0x47ac06[_0x7ea3('0x37')]['fields']));_0x47cb93['attributes']=_0x47cb93['attributes'][_0x7ea3('0x3c')]?_0x47cb93[_0x7ea3('0x39')]:_0xb24401[_0x7ea3('0x36')];if(!_0x47ac06[_0x7ea3('0x37')][_0x7ea3('0x3d')](_0x7ea3('0x3e'))){_0x47cb93['limit']=qs[_0x7ea3('0x1f')](_0x47ac06[_0x7ea3('0x37')][_0x7ea3('0x1f')]);_0x47cb93[_0x7ea3('0x1e')]=qs['offset'](_0x47ac06[_0x7ea3('0x37')][_0x7ea3('0x1e')]);}_0x47cb93[_0x7ea3('0x3f')]=qs['sort'](_0x47ac06[_0x7ea3('0x37')][_0x7ea3('0x40')]);_0x47cb93['where']=qs[_0x7ea3('0x38')](_[_0x7ea3('0x41')](_0x47ac06['query'],_0xb24401[_0x7ea3('0x38')]));_0x47cb93['where'][_0x7ea3('0xaf')]=_0x4e4cf9['id'];if(_0x47ac06['query'][_0x7ea3('0x83')]){_0x47cb93[_0x7ea3('0x74')]=_['merge'](_0x47cb93[_0x7ea3('0x74')],{'$or':_['map'](_0x47cb93[_0x7ea3('0x39')],function(_0x1bf34d){var _0x146a44={};_0x146a44[_0x1bf34d]={'$like':'%'+_0x47ac06[_0x7ea3('0x37')][_0x7ea3('0x83')]+'%'};return _0x146a44;})});}if(_0x47ac06[_0x7ea3('0x37')]['$gte']){var _0x5940ef=_0x47ac06[_0x7ea3('0x37')][_0x7ea3('0x79')][_0x7ea3('0x2c')](',');var _0x2c6e8a={};_0x2c6e8a[_0x5940ef[0x0]]={'$gte':moment(_0x5940ef[0x1])['format'](_0x7ea3('0xbb'))};_0x47cb93[_0x7ea3('0x74')]=_[_0x7ea3('0x9c')](_0x47cb93[_0x7ea3('0x74')],_0x2c6e8a);}_0x47cb93=_[_0x7ea3('0x9c')]({},_0x47cb93,_0x47ac06[_0x7ea3('0xbc')]);return db['OpenchannelMessage'][_0x7ea3('0x9a')]({'where':_0x47cb93['where']})['then'](function(_0x112991){_0x43f52f[_0x7ea3('0x9a')]=_0x112991;if(_0x47ac06[_0x7ea3('0x37')][_0x7ea3('0xb4')]){_0x47cb93[_0x7ea3('0xbd')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x7ea3('0xbe')](_0x47cb93);})['then'](function(_0x13b2f3){_0x43f52f[_0x7ea3('0xb1')]=_0x13b2f3;return _0x43f52f;});}})[_0x7ea3('0x24')](respondWithFilteredResult(_0x374a36,_0x47cb93))[_0x7ea3('0x2f')](handleError(_0x374a36,null));};exports[_0x7ea3('0xbf')]=function(_0x5c5b51,_0x3dce9e,_0x351cbc){return db[_0x7ea3('0x32')][_0x7ea3('0x5b')]({'where':{'id':_0x5c5b51[_0x7ea3('0xb3')]['id']}})['then'](handleEntityNotFound(_0x3dce9e,null))[_0x7ea3('0x24')](function(_0xc0912e){if(_0xc0912e){return _0xc0912e[_0x7ea3('0xc0')](_0x5c5b51[_0x7ea3('0x6e')][_0x7ea3('0xb8')],_[_0x7ea3('0xc1')](_0x5c5b51[_0x7ea3('0x6e')],[_0x7ea3('0xb8'),'id'])||{})[_0x7ea3('0xc2')](function(){return db['Tag'][_0x7ea3('0xbe')]({'attributes':['id','name','color'],'where':{'id':_0x5c5b51['body']['ids']}});})[_0x7ea3('0x24')](function(_0x345372){socket['emit'](_0x7ea3('0xc3'),{'id':Number(_0x5c5b51[_0x7ea3('0xb3')]['id']),'tags':_0x345372||[]});return{'id':Number(_0x5c5b51['params']['id']),'tags':_0x345372||[]};});}})[_0x7ea3('0x24')](respondWithResult(_0x3dce9e,null))['catch'](handleError(_0x3dce9e,null));};exports[_0x7ea3('0xc4')]=function(_0x36b814,_0x29f70d,_0x2ef8c1){return db[_0x7ea3('0x32')][_0x7ea3('0x5b')]({'where':{'id':_0x36b814[_0x7ea3('0xb3')]['id']}})['then'](handleEntityNotFound(_0x29f70d,null))[_0x7ea3('0x24')](function(_0xee03ff){if(_0xee03ff){return _0xee03ff[_0x7ea3('0xc4')](_0x36b814[_0x7ea3('0x37')]['ids']);}})[_0x7ea3('0x24')](respondWithStatusCode(_0x29f70d,null))[_0x7ea3('0x2f')](handleError(_0x29f70d,null));};exports['download']=function(_0x19c0d3,_0x397793){var _0x3fbca8=moment()[_0x7ea3('0xc5')]()[_0x7ea3('0x99')]();var _0x50154b=path[_0x7ea3('0xc6')](config[_0x7ea3('0xc7')],_0x7ea3('0xc8'),'files',_0x7ea3('0xc9'));var _0x2f05a7=path['join'](config[_0x7ea3('0xc7')],_0x7ea3('0xc8'),_0x7ea3('0xca'),_0x7ea3('0xcb'));var _0x4425dc=path[_0x7ea3('0xc6')](_0x50154b,_0x3fbca8);var _0x4ac644=util[_0x7ea3('0xcc')](_0x7ea3('0xcd'),_0x19c0d3[_0x7ea3('0xb3')]['id'],_0x3fbca8);var _0x3a5b70=path[_0x7ea3('0xc6')](_0x50154b,_0x4ac644);var _0x55b96a=[];_0x55b96a[_0x7ea3('0x2e')]({'model':db[_0x7ea3('0x6a')],'as':_0x7ea3('0x6a'),'attributes':['id',_0x7ea3('0x29')],'raw':!![]});_0x55b96a[_0x7ea3('0x2e')]({'model':db[_0x7ea3('0xce')],'as':_0x7ea3('0xcf'),'attributes':['id',_0x7ea3('0xd0'),'lastName'],'raw':!![]});if(_0x19c0d3[_0x7ea3('0x37')]['attachments']){_0x55b96a[_0x7ea3('0x2e')]({'model':db[_0x7ea3('0xd1')],'as':_0x7ea3('0xd1'),'raw':!![]});}var _0x31ba6a=[{'model':db[_0x7ea3('0xba')],'as':_0x7ea3('0xd2'),'attributes':['id',_0x7ea3('0x6e'),'createdAt','direction',_0x7ea3('0xd3'),_0x7ea3('0x7f')],'include':_0x55b96a}];_0x31ba6a[_0x7ea3('0x2e')]({'model':db[_0x7ea3('0xd4')],'as':_0x7ea3('0xd5'),'attributes':['id',_0x7ea3('0x28')]});_0x31ba6a[_0x7ea3('0x2e')]({'model':db[_0x7ea3('0x6a')],'as':'Owner','attributes':['id',_0x7ea3('0x29')]});return db[_0x7ea3('0x32')][_0x7ea3('0x5b')]({'where':{'id':_0x19c0d3[_0x7ea3('0xb3')]['id']},'include':_0x31ba6a})[_0x7ea3('0x24')](handleEntityNotFound(_0x397793,null))['then'](function(_0x237606){if(_0x237606){var _0x5ee341=_0x237606[_0x7ea3('0xd6')]({'plain':!![]});fs[_0x7ea3('0xd7')](_0x4425dc);var _0x20e004={'format':'A4','border':_0x7ea3('0xd8'),'header':{'height':_0x7ea3('0xd9'),'contents':{'first':_0x7ea3('0xda')}},'footer':{'height':'30px','contents':{'default':util[_0x7ea3('0xcc')](_0x7ea3('0xdb'),util[_0x7ea3('0xcc')]('%s\x20#%d',_0x7ea3('0xdc'),_0x5ee341['id']),moment()['format'](_0x7ea3('0xdd'))[_0x7ea3('0x99')]())}}};var _0x5cf72c={'channel':'Openchannel','account':_0x5ee341[_0x7ea3('0xd5')][_0x7ea3('0x28')],'agent':_0x5ee341[_0x7ea3('0xde')]?_0x5ee341['Owner'][_0x7ea3('0x29')]:'N.A.','createdAt':moment(_0x5ee341[_0x7ea3('0x77')])['format'](_0x7ea3('0xbb'))['toString'](),'closedAt':_0x5ee341[_0x7ea3('0xdf')]?moment(_0x5ee341[_0x7ea3('0xe0')])[_0x7ea3('0xcc')](_0x7ea3('0xbb'))['toString']():'','disposition':_0x5ee341[_0x7ea3('0xe1')],'visibility':_0x5ee341[_0x7ea3('0xe2')]?'Public':_0x7ea3('0xe3'),'messages':_(_0x5ee341[_0x7ea3('0xd2')])[_0x7ea3('0x83')]({'secret':![]})[_0x7ea3('0x31')](function(_0x38703d){if(_0x38703d['Attachment']){var _0x50e6b7=path[_0x7ea3('0xc6')](_0x2f05a7,_0x38703d[_0x7ea3('0xd1')]['basename']);if(fs[_0x7ea3('0xe4')](_0x50e6b7)){fs['createReadStream'](_0x50e6b7)[_0x7ea3('0xe5')](fs['createWriteStream'](path['join'](_0x4425dc,_0x38703d[_0x7ea3('0xd1')][_0x7ea3('0xe6')])));}}return{'date':moment(_0x38703d[_0x7ea3('0x77')])[_0x7ea3('0xcc')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7ea3('0x99')](),'sender':_0x38703d[_0x7ea3('0xe7')]===_0x7ea3('0xe8')?_0x38703d[_0x7ea3('0x6a')]?_0x38703d[_0x7ea3('0x6a')][_0x7ea3('0x29')]:_0x7ea3('0xe9'):_0x38703d[_0x7ea3('0xcf')]['firstName']+(_0x38703d[_0x7ea3('0xcf')][_0x7ea3('0xea')]?'\x20'+_0x38703d[_0x7ea3('0xcf')][_0x7ea3('0xea')]:''),'body':_0x38703d[_0x7ea3('0xd1')]?_0x38703d[_0x7ea3('0xd1')]['basename']:_0x38703d[_0x7ea3('0x6e')],'direction':_0x38703d[_0x7ea3('0xe7')]===_0x7ea3('0xe8')?'A':'C','secret':_0x38703d[_0x7ea3('0xd3')],'read':_0x38703d[_0x7ea3('0x7f')],'attachment':_0x38703d[_0x7ea3('0xd1')]};})['value']()};return ejs[_0x7ea3('0xeb')](path[_0x7ea3('0xc6')](config[_0x7ea3('0xc7')],_0x7ea3('0xc8'),_0x7ea3('0xec'),_0x7ea3('0xed')),{'interaction':_0x5cf72c})[_0x7ea3('0x24')](function(_0x51b34a){return new BPromise(function(_0x2a2498,_0x43ca9b){pdf[_0x7ea3('0xb5')](_0x51b34a,_0x20e004)[_0x7ea3('0xee')](path[_0x7ea3('0xc6')](_0x4425dc,_0x7ea3('0xef')+_0x5ee341['id']+'-'+_0x3fbca8+_0x7ea3('0xf0')),function(_0xce600f,_0x478626){if(_0xce600f)return _0x43ca9b(_0xce600f);_0x2a2498(_0x478626);});});})[_0x7ea3('0x24')](function(){return new BPromise(function(_0x593593,_0xab6e03){zipdir(_0x4425dc,{'saveTo':_0x3a5b70},function(_0x1db99d,_0x5b2200){if(_0x1db99d)return _0xab6e03(_0x1db99d);return _0x593593(_0x5b2200);});})[_0x7ea3('0x24')](function(){return new BPromise(function(_0x586333,_0x49488f){rimraf(_0x4425dc,function(_0x2368d8){if(_0x2368d8)_0x49488f(_0x2368d8);return _0x586333();});});})[_0x7ea3('0x24')](function(){return _0x397793['download'](_0x3a5b70,_0x4ac644,function(_0x2415ee){if(_0x2415ee){console['log'](_0x7ea3('0xf1'),_0x2415ee);}else{fs['unlinkSync'](_0x3a5b70);}});});});}else{return _0x397793[_0x7ea3('0x1c')](0xc8);}})[_0x7ea3('0x2f')](handleError(_0x397793,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 135c8ea..8280b8c 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 _0x488e=['emit','catch','hasOwnProperty','exports','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','length'];(function(_0x432770,_0x3c9ca3){var _0x5f2551=function(_0x397293){while(--_0x397293){_0x432770['push'](_0x432770['shift']());}};_0x5f2551(++_0x3c9ca3);}(_0x488e,0xf2));var _0xe488=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x488e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0xe488('0x0')];var OpenchannelMessage=require(_0xe488('0x1'))['db'][_0xe488('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe488('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe488('0x4'),'afterDestroy':_0xe488('0x5')};function emitEvent(_0x366a00){return function(_0x364b51,_0x30ebe7,_0x1d08f0){_0x364b51[_0xe488('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3be72d){_0x364b51[_0xe488('0x7')](_0xe488('0x8'),_0x3be72d['map'](function(_0x5957df){return{'id':_0x5957df['id']};}));return OpenchannelMessage[_0xe488('0x9')]({'where':{'OpenchannelInteractionId':_0x364b51['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe488('0xa')](function(_0x48288f){_0x364b51[_0xe488('0x7')](_0xe488('0xb'),_0x48288f[_0xe488('0xc')]);OpenchannelInteractionEvents[_0xe488('0xd')](_0x366a00+':'+_0x364b51['id'],_0x364b51);OpenchannelInteractionEvents[_0xe488('0xd')](_0x366a00,_0x364b51);_0x1d08f0(null);})[_0xe488('0xe')](_0x1d08f0(null));};}for(var e in events){if(events[_0xe488('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xe488('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xb558=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelMessage','save','update'];(function(_0x4be9c0,_0x2a218a){var _0x25cc16=function(_0x31aa5d){while(--_0x31aa5d){_0x4be9c0['push'](_0x4be9c0['shift']());}};_0x25cc16(++_0x2a218a);}(_0xb558,0x72));var _0x8b55=function(_0x3131ab,_0x2a9074){_0x3131ab=_0x3131ab-0x0;var _0x444965=_0xb558[_0x3131ab];return _0x444965;};'use strict';var EventEmitter=require(_0x8b55('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x8b55('0x1'))['db'][_0x8b55('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8b55('0x3'),'afterUpdate':_0x8b55('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3d0d6a){return function(_0x3863d0,_0x566066,_0xac88fb){_0x3863d0[_0x8b55('0x5')]({'attributes':['id'],'raw':!![]})[_0x8b55('0x6')](function(_0x9b5c13){_0x3863d0[_0x8b55('0x7')](_0x8b55('0x8'),_0x9b5c13[_0x8b55('0x9')](function(_0x49f649){return{'id':_0x49f649['id']};}));return OpenchannelMessage[_0x8b55('0xa')]({'where':{'OpenchannelInteractionId':_0x3863d0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8b55('0x6')](function(_0x4118db){_0x3863d0[_0x8b55('0x7')](_0x8b55('0xb'),_0x4118db[_0x8b55('0xc')]);OpenchannelInteractionEvents[_0x8b55('0xd')](_0x3d0d6a+':'+_0x3863d0['id'],_0x3863d0);OpenchannelInteractionEvents[_0x8b55('0xd')](_0x3d0d6a,_0x3863d0);_0xac88fb(null);})[_0x8b55('0xe')](_0xac88fb(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x8b55('0xf')](e,emitEvent(event));}}module[_0x8b55('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 437a325..c742e3e 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 _0x13f5=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','closed'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x13f5,0xc3));var _0x513f=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x13f5[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x513f('0x0'));var util=require(_0x513f('0x1'));var logger=require(_0x513f('0x2'))(_0x513f('0x3'));var moment=require('moment');var BPromise=require(_0x513f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x513f('0x5'));var config=require(_0x513f('0x6'));var attributes=require(_0x513f('0x7'));module[_0x513f('0x8')]=function(_0x8d019b,_0x579681){return _0x8d019b[_0x513f('0x9')](_0x513f('0xa'),attributes,{'tableName':_0x513f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42951f,_0x1975b5,_0x4755cb){if(_0x42951f['changed'](_0x513f('0xc'))){_0x42951f[_0x513f('0xd')]=moment()[_0x513f('0xe')](_0x513f('0xf'));}_0x4755cb(null,_0x42951f);}}});}; \ No newline at end of file +var _0x43fd=['format','YYYY-MM-DD\x20HH:mm:ss','util','moment','bluebird','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closedAt'];(function(_0x184b4f,_0x588652){var _0x54f911=function(_0x53c44a){while(--_0x53c44a){_0x184b4f['push'](_0x184b4f['shift']());}};_0x54f911(++_0x588652);}(_0x43fd,0x1ec));var _0xd43f=function(_0xfd09fe,_0x7f794b){_0xfd09fe=_0xfd09fe-0x0;var _0x4d3bcd=_0x43fd[_0xfd09fe];return _0x4d3bcd;};'use strict';var _=require('lodash');var util=require(_0xd43f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd43f('0x1'));var BPromise=require(_0xd43f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd43f('0x3'));var rimraf=require('rimraf');var config=require(_0xd43f('0x4'));var attributes=require(_0xd43f('0x5'));module[_0xd43f('0x6')]=function(_0x33ddff,_0x52e75f){return _0x33ddff[_0xd43f('0x7')](_0xd43f('0x8'),attributes,{'tableName':_0xd43f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x331163,_0x547e12,_0x19c71d){if(_0x331163[_0xd43f('0xa')]('closed')){_0x331163[_0xd43f('0xb')]=moment()[_0xd43f('0xc')](_0xd43f('0xd'));}_0x19c71d(null,_0x331163);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 779c4cb..54c1d95 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 _0xa07a=['message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','limit','then','stringify','AddTagsToOpenchannelInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','./openchannelInteraction.socket','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x2028c0,_0x4e9cab){var _0x1900ed=function(_0xfea3fe){while(--_0xfea3fe){_0x2028c0['push'](_0x2028c0['shift']());}};_0x1900ed(++_0x4e9cab);}(_0xa07a,0xfb));var _0xaa07=function(_0x5dc32b,_0xcbe4ea){_0x5dc32b=_0x5dc32b-0x0;var _0x49b94a=_0xa07a[_0x5dc32b];return _0x49b94a;};'use strict';var _=require(_0xaa07('0x0'));var util=require(_0xaa07('0x1'));var moment=require(_0xaa07('0x2'));var BPromise=require(_0xaa07('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa07('0x4'));var db=require(_0xaa07('0x5'))['db'];var utils=require(_0xaa07('0x6'));var logger=require(_0xaa07('0x7'))(_0xaa07('0x8'));var config=require(_0xaa07('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa07('0xa')]['http']({'port':0x232a});config['redis']=_[_0xaa07('0xb')](config[_0xaa07('0xc')],{'host':_0xaa07('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa07('0xc')]));require(_0xaa07('0xe'))['register'](socket);function respondWithRpcPromise(_0x4d40fb,_0x66316b,_0x54c836){return new BPromise(function(_0x365eba,_0x4f4877){return client[_0xaa07('0xf')](_0x4d40fb,_0x54c836)['then'](function(_0x3f3a1d){logger[_0xaa07('0x10')](_0xaa07('0x11'),_0x66316b,_0xaa07('0x12'));logger[_0xaa07('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x66316b,_0xaa07('0x12'),JSON['stringify'](_0x3f3a1d));if(_0x3f3a1d[_0xaa07('0x14')]){if(_0x3f3a1d[_0xaa07('0x14')][_0xaa07('0x15')]===0x1f4){logger[_0xaa07('0x14')](_0xaa07('0x11'),_0x66316b,_0x3f3a1d[_0xaa07('0x14')][_0xaa07('0x16')]);return _0x4f4877(_0x3f3a1d[_0xaa07('0x14')][_0xaa07('0x16')]);}logger['error'](_0xaa07('0x11'),_0x66316b,_0x3f3a1d[_0xaa07('0x14')][_0xaa07('0x16')]);return _0x365eba(_0x3f3a1d[_0xaa07('0x14')][_0xaa07('0x16')]);}else{logger[_0xaa07('0x10')](_0xaa07('0x11'),_0x66316b,_0xaa07('0x12'));_0x365eba(_0x3f3a1d['result'][_0xaa07('0x16')]);}})[_0xaa07('0x17')](function(_0x13a82b){logger[_0xaa07('0x14')](_0xaa07('0x11'),_0x66316b,_0x13a82b);_0x4f4877(_0x13a82b);});});}exports[_0xaa07('0x18')]=function(_0x3d362e){var _0x4c787a=this;return new Promise(function(_0x209049,_0xe77198){return db[_0xaa07('0x19')][_0xaa07('0x1a')](_0x3d362e[_0xaa07('0x1b')],{'raw':_0x3d362e['options']?_0x3d362e[_0xaa07('0x1c')][_0xaa07('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d362e['options']?_0x3d362e[_0xaa07('0x1c')][_0xaa07('0x1e')]||null:null,'attributes':_0x3d362e[_0xaa07('0x1c')]?_0x3d362e['options']['attributes']||null:null,'limit':_0x3d362e[_0xaa07('0x1c')]?_0x3d362e[_0xaa07('0x1c')][_0xaa07('0x1f')]||null:null})[_0xaa07('0x20')](function(_0x487dcc){logger['info'](_0xaa07('0x18'),_0x3d362e);logger['debug'](_0xaa07('0x18'),_0x3d362e,JSON[_0xaa07('0x21')](_0x487dcc));_0x209049(_0x487dcc);})['catch'](function(_0x39fe70){logger['error'](_0xaa07('0x18'),_0x39fe70['message'],_0x3d362e);_0xe77198(_0x4c787a[_0xaa07('0x14')](0x1f4,_0x39fe70['message']));});});};exports[_0xaa07('0x22')]=function(_0x194f6){return new Promise(function(_0x4ccf09,_0x2bc88d){return db[_0xaa07('0x19')]['find']({'where':_0x194f6[_0xaa07('0x1c')]?_0x194f6['options']['where']||null:null})[_0xaa07('0x20')](function(_0xa4c67d){if(_0xa4c67d){return _0xa4c67d[_0xaa07('0x23')](_0x194f6[_0xaa07('0x1b')][_0xaa07('0x24')],_['omit'](_0x194f6[_0xaa07('0x1b')],[_0xaa07('0x24'),'id'])||{});}})[_0xaa07('0x25')](function(_0x18d04d){logger['info'](_0xaa07('0x26'),_0x194f6);logger[_0xaa07('0x13')]('AddTags',_0x194f6,JSON[_0xaa07('0x21')](_0x18d04d));_0x4ccf09(_0x18d04d);})[_0xaa07('0x17')](function(_0x44aff9){logger['error'](_0xaa07('0x26'),_0x44aff9[_0xaa07('0x16')],_0x194f6);_0x2bc88d(_this[_0xaa07('0x14')](0x1f4,_0x44aff9[_0xaa07('0x16')]));});});}; \ No newline at end of file +var _0xc6fa=['result','UpdateOpenchannelInteraction','update','body','options','where','attributes','limit','catch','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','OpenchannelInteraction,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6fa,0xbd));var _0xac6f=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0xc6fa[_0x3c59fc];return _0x2b78d4;};'use strict';var _=require(_0xac6f('0x0'));var util=require(_0xac6f('0x1'));var moment=require(_0xac6f('0x2'));var BPromise=require(_0xac6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac6f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac6f('0x5'));var logger=require(_0xac6f('0x6'))(_0xac6f('0x7'));var config=require(_0xac6f('0x8'));var jayson=require(_0xac6f('0x9'));var client=jayson['client'][_0xac6f('0xa')]({'port':0x232a});config[_0xac6f('0xb')]=_[_0xac6f('0xc')](config[_0xac6f('0xb')],{'host':_0xac6f('0xd'),'port':0x18eb});var socket=require(_0xac6f('0xe'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xac6f('0xf')](socket);function respondWithRpcPromise(_0x135a28,_0x25d2bb,_0x28b398){return new BPromise(function(_0x2e49e3,_0x11fdf2){return client[_0xac6f('0x10')](_0x135a28,_0x28b398)[_0xac6f('0x11')](function(_0xa0e280){logger[_0xac6f('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x25d2bb,_0xac6f('0x13'));logger[_0xac6f('0x14')](_0xac6f('0x15'),_0x25d2bb,_0xac6f('0x13'),JSON['stringify'](_0xa0e280));if(_0xa0e280['error']){if(_0xa0e280[_0xac6f('0x16')][_0xac6f('0x17')]===0x1f4){logger['error'](_0xac6f('0x18'),_0x25d2bb,_0xa0e280[_0xac6f('0x16')][_0xac6f('0x19')]);return _0x11fdf2(_0xa0e280[_0xac6f('0x16')][_0xac6f('0x19')]);}logger[_0xac6f('0x16')](_0xac6f('0x18'),_0x25d2bb,_0xa0e280['error']['message']);return _0x2e49e3(_0xa0e280['error'][_0xac6f('0x19')]);}else{logger[_0xac6f('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x25d2bb,_0xac6f('0x13'));_0x2e49e3(_0xa0e280[_0xac6f('0x1a')]['message']);}})['catch'](function(_0x50db90){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x25d2bb,_0x50db90);_0x11fdf2(_0x50db90);});});}exports[_0xac6f('0x1b')]=function(_0x856b3){var _0x1804fa=this;return new Promise(function(_0x391a80,_0xd8936b){return db['OpenchannelInteraction'][_0xac6f('0x1c')](_0x856b3[_0xac6f('0x1d')],{'raw':_0x856b3[_0xac6f('0x1e')]?_0x856b3['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x856b3['options']?_0x856b3[_0xac6f('0x1e')][_0xac6f('0x1f')]||null:null,'attributes':_0x856b3[_0xac6f('0x1e')]?_0x856b3[_0xac6f('0x1e')][_0xac6f('0x20')]||null:null,'limit':_0x856b3[_0xac6f('0x1e')]?_0x856b3[_0xac6f('0x1e')][_0xac6f('0x21')]||null:null})[_0xac6f('0x11')](function(_0x2437dc){logger[_0xac6f('0x12')](_0xac6f('0x1b'),_0x856b3);logger[_0xac6f('0x14')](_0xac6f('0x1b'),_0x856b3,JSON['stringify'](_0x2437dc));_0x391a80(_0x2437dc);})[_0xac6f('0x22')](function(_0x4bbdf8){logger[_0xac6f('0x16')](_0xac6f('0x1b'),_0x4bbdf8[_0xac6f('0x19')],_0x856b3);_0xd8936b(_0x1804fa[_0xac6f('0x16')](0x1f4,_0x4bbdf8['message']));});});};exports[_0xac6f('0x23')]=function(_0x7870bd){return new Promise(function(_0x464260,_0x59477d){return db[_0xac6f('0x24')][_0xac6f('0x25')]({'where':_0x7870bd[_0xac6f('0x1e')]?_0x7870bd[_0xac6f('0x1e')][_0xac6f('0x1f')]||null:null})[_0xac6f('0x11')](function(_0x50c4c0){if(_0x50c4c0){return _0x50c4c0[_0xac6f('0x26')](_0x7870bd['body'][_0xac6f('0x27')],_[_0xac6f('0x28')](_0x7870bd[_0xac6f('0x1d')],[_0xac6f('0x27'),'id'])||{});}})[_0xac6f('0x29')](function(_0x128a3c){logger[_0xac6f('0x12')](_0xac6f('0x2a'),_0x7870bd);logger[_0xac6f('0x14')](_0xac6f('0x2a'),_0x7870bd,JSON['stringify'](_0x128a3c));_0x464260(_0x128a3c);})[_0xac6f('0x22')](function(_0x3eea45){logger[_0xac6f('0x16')](_0xac6f('0x2a'),_0x3eea45['message'],_0x7870bd);_0x59477d(_this[_0xac6f('0x16')](0x1f4,_0x3eea45[_0xac6f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ae75709..30b12a2 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 _0x362d=['openchannelInteraction:','remove','emit','register','length'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x362d,0x6a));var _0xd362=function(_0x4453bf,_0x4e1532){_0x4453bf=_0x4453bf-0x0;var _0x142e46=_0x362d[_0x4453bf];return _0x142e46;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0xd362('0x0'),'update'];function createListener(_0x39ce08,_0x399a52){return function(_0xb2a06f){_0x399a52[_0xd362('0x1')](_0x39ce08,_0xb2a06f);};}function removeListener(_0x3ab10c,_0xa6f194){return function(){OpenchannelInteractionEvents['removeListener'](_0x3ab10c,_0xa6f194);};}exports[_0xd362('0x2')]=function(_0x50e2f9){for(var _0x44fe05=0x0,_0x58dab1=events[_0xd362('0x3')];_0x44fe05<_0x58dab1;_0x44fe05++){var _0x4334ec=events[_0x44fe05];var _0xde71d0=createListener(_0xd362('0x4')+_0x4334ec,_0x50e2f9);OpenchannelInteractionEvents['on'](_0x4334ec,_0xde71d0);}}; \ No newline at end of file +var _0x27d7=['./openchannelInteraction.events','save','remove','update','removeListener','register'];(function(_0x5062c4,_0x8936b0){var _0x5cd252=function(_0x56a4ed){while(--_0x56a4ed){_0x5062c4['push'](_0x5062c4['shift']());}};_0x5cd252(++_0x8936b0);}(_0x27d7,0x66));var _0x727d=function(_0x515be2,_0x51b3ff){_0x515be2=_0x515be2-0x0;var _0x514679=_0x27d7[_0x515be2];return _0x514679;};'use strict';var OpenchannelInteractionEvents=require(_0x727d('0x0'));var events=[_0x727d('0x1'),_0x727d('0x2'),_0x727d('0x3')];function createListener(_0x25d240,_0x5b1fef){return function(_0x2812d8){_0x5b1fef['emit'](_0x25d240,_0x2812d8);};}function removeListener(_0x130a8f,_0x371957){return function(){OpenchannelInteractionEvents[_0x727d('0x4')](_0x130a8f,_0x371957);};}exports[_0x727d('0x5')]=function(_0x1c7465){for(var _0x197f2e=0x0,_0x54ab16=events['length'];_0x197f2e<_0x54ab16;_0x197f2e++){var _0x571e88=events[_0x197f2e];var _0x2a4dd0=createListener('openchannelInteraction:'+_0x571e88,_0x1c7465);OpenchannelInteractionEvents['on'](_0x571e88,_0x2a4dd0);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 470e618..30d5aa7 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 _0x2600=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','openchannelmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject'];(function(_0x4ed603,_0x379528){var _0x338e1e=function(_0x104ecc){while(--_0x104ecc){_0x4ed603['push'](_0x4ed603['shift']());}};_0x338e1e(++_0x379528);}(_0x2600,0xec));var _0x0260=function(_0x5290d0,_0x15697a){_0x5290d0=_0x5290d0-0x0;var _0x112752=_0x2600[_0x5290d0];return _0x112752;};'use strict';var multer=require(_0x0260('0x0'));var util=require(_0x0260('0x1'));var path=require(_0x0260('0x2'));var timeout=require(_0x0260('0x3'));var express=require('express');var router=express[_0x0260('0x4')]();var auth=require(_0x0260('0x5'));var interaction=require(_0x0260('0x6'));var config=require(_0x0260('0x7'));var controller=require('./openchannelMessage.controller');router[_0x0260('0x8')]('/',auth[_0x0260('0x9')](),controller[_0x0260('0xa')]);router['get'](_0x0260('0xb'),auth['isAuthenticated'](),controller[_0x0260('0xc')]);router[_0x0260('0x8')](_0x0260('0xd'),auth['isAuthenticated'](),controller[_0x0260('0xe')]);router[_0x0260('0xf')]('/',auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x0260('0x10')),controller[_0x0260('0x11')]);router['put'](_0x0260('0xd'),auth[_0x0260('0x9')](),controller[_0x0260('0x12')]);router['put'](_0x0260('0x13'),auth[_0x0260('0x9')](),controller[_0x0260('0x14')]);router[_0x0260('0x15')](_0x0260('0x16'),auth['isAuthenticated'](),controller[_0x0260('0x17')]);router['delete'](_0x0260('0xd'),auth[_0x0260('0x9')](),controller[_0x0260('0x18')]);module[_0x0260('0x19')]=router; \ No newline at end of file +var _0x7b9f=['/:id/accept','accept','reject','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./openchannelMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','openchannel','openchannelmessage:create','put','update'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7b9f,0xa6));var _0xf7b9=function(_0x49c0c5,_0x66ba84){_0x49c0c5=_0x49c0c5-0x0;var _0x1ccf12=_0x7b9f[_0x49c0c5];return _0x1ccf12;};'use strict';var multer=require(_0xf7b9('0x0'));var util=require(_0xf7b9('0x1'));var path=require(_0xf7b9('0x2'));var timeout=require('connect-timeout');var express=require(_0xf7b9('0x3'));var router=express['Router']();var auth=require(_0xf7b9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf7b9('0x5'));var controller=require(_0xf7b9('0x6'));router['get']('/',auth[_0xf7b9('0x7')](),controller[_0xf7b9('0x8')]);router[_0xf7b9('0x9')](_0xf7b9('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xf7b9('0x9')](_0xf7b9('0xb'),auth['isAuthenticated'](),controller[_0xf7b9('0xc')]);router[_0xf7b9('0xd')]('/',auth[_0xf7b9('0x7')](),interaction['tracked'](_0xf7b9('0xe'),_0xf7b9('0xf')),controller['create']);router[_0xf7b9('0x10')](_0xf7b9('0xb'),auth[_0xf7b9('0x7')](),controller[_0xf7b9('0x11')]);router[_0xf7b9('0x10')](_0xf7b9('0x12'),auth[_0xf7b9('0x7')](),controller[_0xf7b9('0x13')]);router['put']('/:id/reject',auth[_0xf7b9('0x7')](),controller[_0xf7b9('0x14')]);router['delete']('/:id',auth[_0xf7b9('0x7')](),controller[_0xf7b9('0x15')]);module[_0xf7b9('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index c31f150..710f409 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 _0x2570=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x5ab06b,_0x13aa3b){var _0x364a4f=function(_0x1bd46a){while(--_0x1bd46a){_0x5ab06b['push'](_0x5ab06b['shift']());}};_0x364a4f(++_0x13aa3b);}(_0x2570,0x1cf));var _0x0257=function(_0x3cae21,_0x97726f){_0x3cae21=_0x3cae21-0x0;var _0x4b13b8=_0x2570[_0x3cae21];return _0x4b13b8;};'use strict';var Sequelize=require(_0x0257('0x0'));module[_0x0257('0x1')]={'body':{'type':Sequelize[_0x0257('0x2')](_0x0257('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0257('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0257('0x5')]('in','out'),'defaultValue':_0x0257('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0257('0x7')]}}; \ No newline at end of file +var _0x9201=['DATE','sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x11b58d,_0x555c55){var _0xc2811b=function(_0x396d22){while(--_0x396d22){_0x11b58d['push'](_0x11b58d['shift']());}};_0xc2811b(++_0x555c55);}(_0x9201,0x14a));var _0x1920=function(_0x2afdff,_0x37a9c2){_0x2afdff=_0x2afdff-0x0;var _0x4680f2=_0x9201[_0x2afdff];return _0x4680f2;};'use strict';var Sequelize=require(_0x1920('0x0'));module['exports']={'body':{'type':Sequelize[_0x1920('0x1')](_0x1920('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1920('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x1920('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1920('0x4')]('in',_0x1920('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x1920('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index a291837..f40eed5 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 _0x9c1a=['zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','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~!@#$%^&-_=+[{]}.','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','json','reject','save','update','destroy','stack','send','index','map','type','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','options','OpenchannelMessage','includeAll','findAll','rows','show','params','rawAttributes','include','create','body','find','describe','../../config/logger','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel','agent','stringify','RejectMessage','rejectMessage','rejectmessage','html-pdf','rimraf'];(function(_0x303e4b,_0x4b1e50){var _0x9e815f=function(_0x540729){while(--_0x540729){_0x303e4b['push'](_0x303e4b['shift']());}};_0x9e815f(++_0x4b1e50);}(_0x9c1a,0x78));var _0xa9c1=function(_0x2591a9,_0x46863a){_0x2591a9=_0x2591a9-0x0;var _0x2aba17=_0x9c1a[_0x2591a9];return _0x2aba17;};'use strict';var pdf=require(_0xa9c1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa9c1('0x1'));var zipdir=require(_0xa9c1('0x2'));var jsonpatch=require(_0xa9c1('0x3'));var rp=require('request-promise');var moment=require(_0xa9c1('0x4'));var BPromise=require(_0xa9c1('0x5'));var Mustache=require('mustache');var util=require(_0xa9c1('0x6'));var path=require(_0xa9c1('0x7'));var sox=require(_0xa9c1('0x8'));var csv=require(_0xa9c1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa9c1('0xa'));var squel=require(_0xa9c1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa9c1('0xc'));var toCsv=require(_0xa9c1('0x9'));var querystring=require(_0xa9c1('0xd'));var Papa=require(_0xa9c1('0xe'));var Redis=require(_0xa9c1('0xf'));var authService=require(_0xa9c1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa9c1('0x11'));var hardwareService=require(_0xa9c1('0x12'));var logger=require('../../config/logger')(_0xa9c1('0x13'));var utils=require('../../config/utils');var config=require(_0xa9c1('0x14'));var db=require(_0xa9c1('0x15'))['db'];config[_0xa9c1('0x16')]=_[_0xa9c1('0x17')](config[_0xa9c1('0x16')],{'host':_0xa9c1('0x18'),'port':0x18eb});var socket=require(_0xa9c1('0x19'))(new Redis(config[_0xa9c1('0x16')]));require(_0xa9c1('0x1a'))[_0xa9c1('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa9c1('0x1c')][_0xa9c1('0x1d')]({'port':0x232c});var client9002=jayson[_0xa9c1('0x1c')][_0xa9c1('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x4842fa,_0x3f1864,_0x168b3a){if(_0x168b3a){var _0x448015=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x448015[_0xa9c1('0x1e')](_0x3f1864)){return _0x4842fa;}else{throw new db[(_0xa9c1('0x1f'))][(_0xa9c1('0x20'))](_0xa9c1('0x21'));}}else{return _0x4842fa;}}function respondWithRpcPromise(_0x33028d,_0x5636d9,_0x3104ed,_0x1f16c5){return new BPromise(function(_0x5b2edb,_0x4d864b){var _0x4d61d4=_0x1f16c5||client;return _0x4d61d4['request'](_0x33028d,_0x3104ed)[_0xa9c1('0x22')](function(_0x143856){logger['info'](_0xa9c1('0x23'),_0x5636d9,_0xa9c1('0x24'));logger['debug'](_0xa9c1('0x25'),_0x5636d9,'request\x20sent',JSON['stringify'](_0x143856));if(_0x143856[_0xa9c1('0x26')]){if(_0x143856['error'][_0xa9c1('0x27')]===0x1f4){logger[_0xa9c1('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x5636d9,_0x143856[_0xa9c1('0x26')][_0xa9c1('0x28')]);return _0x4d864b(_0x143856['error'][_0xa9c1('0x28')]);}logger[_0xa9c1('0x26')](_0xa9c1('0x23'),_0x5636d9,_0x143856['error'][_0xa9c1('0x28')]);return _0x5b2edb(_0x143856[_0xa9c1('0x26')]['message']);}else{logger[_0xa9c1('0x29')](_0xa9c1('0x23'),_0x5636d9,_0xa9c1('0x24'));_0x5b2edb(_0x143856[_0xa9c1('0x2a')]['message']);}})[_0xa9c1('0x2b')](function(_0x6f7e27){logger[_0xa9c1('0x26')](_0xa9c1('0x23'),_0x5636d9,_0x6f7e27);_0x4d864b(_0x6f7e27);});});}function respondWithStatusCode(_0x30b994,_0x34125b){_0x34125b=_0x34125b||0xcc;return function(_0x17aff2){if(_0x17aff2){return _0x30b994[_0xa9c1('0x2c')](_0x34125b);}return _0x30b994[_0xa9c1('0x2d')](_0x34125b)[_0xa9c1('0x2e')]();};}function respondWithResult(_0x3cb683,_0x1276e7){_0x1276e7=_0x1276e7||0xc8;return function(_0x49b2a7){if(_0x49b2a7){return _0x3cb683['status'](_0x1276e7)['json'](_0x49b2a7);}};}function respondWithFilteredResult(_0x243e4b,_0x56da68){return function(_0x24cf68){if(_0x24cf68){var _0x9b3e4e=_0x24cf68[_0xa9c1('0x2f')],_0x4fd99b=_0x56da68[_0xa9c1('0x30')],_0x2b164a=_0x56da68[_0xa9c1('0x30')]+_0x56da68[_0xa9c1('0x31')],_0x603d17;if(_0x2b164a>=_0x9b3e4e){_0x2b164a=_0x9b3e4e;_0x603d17=0xc8;}else{_0x603d17=0xce;}_0x243e4b['status'](_0x603d17);return _0x243e4b['set']('Content-Range',_0x4fd99b+'-'+_0x2b164a+'/'+_0x9b3e4e)[_0xa9c1('0x32')](_0x24cf68);}return null;};}function patchUpdates(_0x523f25){return function(_0x1a1748){try{jsonpatch['apply'](_0x1a1748,_0x523f25,!![]);}catch(_0x57eb97){return BPromise[_0xa9c1('0x33')](_0x57eb97);}return _0x1a1748[_0xa9c1('0x34')]();};}function saveUpdates(_0xabea72,_0x36cfcb){return function(_0x485a54){if(_0x485a54){return _0x485a54[_0xa9c1('0x35')](_0xabea72)[_0xa9c1('0x22')](function(_0x500d60){return _0x500d60;});}return null;};}function removeEntity(_0x51f157,_0x3f53f5){return function(_0x46a88b){if(_0x46a88b){return _0x46a88b[_0xa9c1('0x36')]()[_0xa9c1('0x22')](function(){_0x51f157[_0xa9c1('0x2d')](0xcc)[_0xa9c1('0x2e')]();});}};}function handleEntityNotFound(_0x448c51,_0x54ad19){return function(_0x7ea7d8){if(!_0x7ea7d8){_0x448c51[_0xa9c1('0x2c')](0x194);}return _0x7ea7d8;};}function handleError(_0x510b59,_0x2d9243){_0x2d9243=_0x2d9243||0x1f4;return function(_0x42917f){logger[_0xa9c1('0x26')](_0x42917f[_0xa9c1('0x37')]);if(_0x42917f['name']){delete _0x42917f['name'];}_0x510b59[_0xa9c1('0x2d')](_0x2d9243)[_0xa9c1('0x38')](_0x42917f);};}exports[_0xa9c1('0x39')]=function(_0x115f48,_0x2b7bbb){var _0x260537={},_0x1732f3={},_0x2d3b85={'count':0x0,'rows':[]};var _0x277e29=_[_0xa9c1('0x3a')](db['OpenchannelMessage']['rawAttributes'],function(_0x2285d6){return{'name':_0x2285d6['fieldName'],'type':_0x2285d6[_0xa9c1('0x3b')]['key']};});_0x1732f3[_0xa9c1('0x3c')]=_[_0xa9c1('0x3a')](_0x277e29,_0xa9c1('0x3d'));_0x1732f3[_0xa9c1('0x3e')]=_[_0xa9c1('0x3f')](_0x115f48[_0xa9c1('0x3e')]);_0x1732f3['filters']=_[_0xa9c1('0x40')](_0x1732f3['model'],_0x1732f3[_0xa9c1('0x3e')]);_0x260537['attributes']=_[_0xa9c1('0x40')](_0x1732f3['model'],qs[_0xa9c1('0x41')](_0x115f48[_0xa9c1('0x3e')]['fields']));_0x260537['attributes']=_0x260537[_0xa9c1('0x42')][_0xa9c1('0x43')]?_0x260537[_0xa9c1('0x42')]:_0x1732f3['model'];if(!_0x115f48['query'][_0xa9c1('0x44')](_0xa9c1('0x45'))){_0x260537['limit']=qs[_0xa9c1('0x31')](_0x115f48[_0xa9c1('0x3e')][_0xa9c1('0x31')]);_0x260537[_0xa9c1('0x30')]=qs['offset'](_0x115f48[_0xa9c1('0x3e')][_0xa9c1('0x30')]);}_0x260537['order']=qs[_0xa9c1('0x46')](_0x115f48[_0xa9c1('0x3e')][_0xa9c1('0x46')]);_0x260537[_0xa9c1('0x47')]=qs['filters'](_[_0xa9c1('0x48')](_0x115f48[_0xa9c1('0x3e')],_0x1732f3[_0xa9c1('0x49')]));if(_0x115f48[_0xa9c1('0x3e')]['filter']){_0x260537['where']=_[_0xa9c1('0x4a')](_0x260537[_0xa9c1('0x47')],{'$or':_['map'](_0x277e29,function(_0x59784e){if(_0x59784e[_0xa9c1('0x3b')]!==_0xa9c1('0x4b')){var _0xecfd26={};_0xecfd26[_0x59784e[_0xa9c1('0x3d')]]={'$like':'%'+_0x115f48[_0xa9c1('0x3e')]['filter']+'%'};return _0xecfd26;}})});}_0x260537=_[_0xa9c1('0x4a')]({},_0x260537,_0x115f48[_0xa9c1('0x4c')]);var _0x1bd4b2={'where':_0x260537[_0xa9c1('0x47')]};return db[_0xa9c1('0x4d')]['count'](_0x1bd4b2)[_0xa9c1('0x22')](function(_0x413ff2){_0x2d3b85[_0xa9c1('0x2f')]=_0x413ff2;if(_0x115f48[_0xa9c1('0x3e')][_0xa9c1('0x4e')]){_0x260537['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xa9c1('0x4f')](_0x260537);})[_0xa9c1('0x22')](function(_0x467690){_0x2d3b85[_0xa9c1('0x50')]=_0x467690;return _0x2d3b85;})[_0xa9c1('0x22')](respondWithFilteredResult(_0x2b7bbb,_0x260537))[_0xa9c1('0x2b')](handleError(_0x2b7bbb,null));};exports[_0xa9c1('0x51')]=function(_0x3de1fc,_0x7f2034){var _0x245587={'raw':!![],'where':{'id':_0x3de1fc[_0xa9c1('0x52')]['id']}},_0x3f5fec={};_0x3f5fec[_0xa9c1('0x3c')]=_[_0xa9c1('0x3f')](db[_0xa9c1('0x4d')][_0xa9c1('0x53')]);_0x3f5fec[_0xa9c1('0x3e')]=_[_0xa9c1('0x3f')](_0x3de1fc[_0xa9c1('0x3e')]);_0x3f5fec[_0xa9c1('0x49')]=_[_0xa9c1('0x40')](_0x3f5fec['model'],_0x3f5fec[_0xa9c1('0x3e')]);_0x245587[_0xa9c1('0x42')]=_[_0xa9c1('0x40')](_0x3f5fec[_0xa9c1('0x3c')],qs[_0xa9c1('0x41')](_0x3de1fc['query'][_0xa9c1('0x41')]));_0x245587[_0xa9c1('0x42')]=_0x245587['attributes']['length']?_0x245587[_0xa9c1('0x42')]:_0x3f5fec[_0xa9c1('0x3c')];if(_0x3de1fc[_0xa9c1('0x3e')]['includeAll']){_0x245587[_0xa9c1('0x54')]=[{'all':!![]}];}_0x245587=_[_0xa9c1('0x4a')]({},_0x245587,_0x3de1fc[_0xa9c1('0x4c')]);return db[_0xa9c1('0x4d')]['find'](_0x245587)[_0xa9c1('0x22')](handleEntityNotFound(_0x7f2034,null))['then'](respondWithResult(_0x7f2034,null))[_0xa9c1('0x2b')](handleError(_0x7f2034,null));};exports[_0xa9c1('0x55')]=function(_0x29e818,_0x3bd498){return db[_0xa9c1('0x4d')][_0xa9c1('0x55')](_0x29e818[_0xa9c1('0x56')],{})[_0xa9c1('0x22')](respondWithResult(_0x3bd498,0xc9))[_0xa9c1('0x2b')](handleError(_0x3bd498,null));};exports[_0xa9c1('0x35')]=function(_0x7652b,_0x184ab3){if(_0x7652b[_0xa9c1('0x56')]['id']){delete _0x7652b[_0xa9c1('0x56')]['id'];}return db[_0xa9c1('0x4d')]['find']({'where':{'id':_0x7652b[_0xa9c1('0x52')]['id']}})[_0xa9c1('0x22')](handleEntityNotFound(_0x184ab3,null))[_0xa9c1('0x22')](saveUpdates(_0x7652b[_0xa9c1('0x56')],null))['then'](respondWithResult(_0x184ab3,null))[_0xa9c1('0x2b')](handleError(_0x184ab3,null));};exports[_0xa9c1('0x36')]=function(_0x51b014,_0x481413){return db[_0xa9c1('0x4d')][_0xa9c1('0x57')]({'where':{'id':_0x51b014['params']['id']}})['then'](handleEntityNotFound(_0x481413,null))[_0xa9c1('0x22')](removeEntity(_0x481413,null))[_0xa9c1('0x2b')](handleError(_0x481413,null));};exports[_0xa9c1('0x58')]=function(_0x375552,_0x3947fe){return db['OpenchannelMessage'][_0xa9c1('0x58')]()[_0xa9c1('0x22')](respondWithResult(_0x3947fe,null))[_0xa9c1('0x2b')](handleError(_0x3947fe,null));};var interaction_log=require(_0xa9c1('0x59'))(_0xa9c1('0x5a'));exports[_0xa9c1('0x5b')]=function(_0x46d5d7,_0x22dfe0,_0x5c9f4d){var _0x3fc694={'channel':'openchannel'};if(_0x46d5d7[_0xa9c1('0x56')]['id']){delete _0x46d5d7[_0xa9c1('0x56')]['id'];}_0x46d5d7[_0xa9c1('0x56')][_0xa9c1('0x5c')]=!![];_0x46d5d7[_0xa9c1('0x56')][_0xa9c1('0x5d')]=moment()[_0xa9c1('0x5e')](_0xa9c1('0x5f'));_0x46d5d7[_0xa9c1('0x56')][_0xa9c1('0x60')]=_0x46d5d7[_0xa9c1('0x56')][_0xa9c1('0x60')]||_0x46d5d7['user']['id'];return db['OpenchannelMessage'][_0xa9c1('0x57')]({'where':{'id':_0x46d5d7[_0xa9c1('0x52')]['id'],'UserId':null},'include':[{'model':db[_0xa9c1('0x61')],'as':_0xa9c1('0x62')}]})['then'](handleEntityNotFound(_0x22dfe0,null))[_0xa9c1('0x22')](saveUpdates(_0x46d5d7[_0xa9c1('0x56')],null))[_0xa9c1('0x22')](function(_0x140398){if(_0x140398){_0x3fc694[_0xa9c1('0x28')]=_0x140398[_0xa9c1('0x63')]({'plain':!![]});return db[_0xa9c1('0x64')]['find']({'where':{'id':_0x140398[_0xa9c1('0x65')]}});}return null;})[_0xa9c1('0x22')](handleEntityNotFound(_0x22dfe0,null))[_0xa9c1('0x22')](function(_0x10b45c){if(_0x10b45c){return _0x10b45c[_0xa9c1('0x35')]({'UserId':_0x46d5d7[_0xa9c1('0x56')]['UserId'],'read1stAt':_['isNil'](_0x10b45c[_0xa9c1('0x66')])?moment()[_0xa9c1('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x321e36){if(_0x321e36){_0x3fc694[_0xa9c1('0x67')]=_0x321e36[_0xa9c1('0x63')]({'plain':!![]});interaction_log[_0xa9c1('0x29')](_0xa9c1('0x68'),_0x46d5d7[_0xa9c1('0x69')]['id'],_0x46d5d7[_0xa9c1('0x69')]['name'],_0x46d5d7[_0xa9c1('0x69')][_0xa9c1('0x6a')],_0x3fc694[_0xa9c1('0x67')]['id'],_0x46d5d7['body']?JSON['stringify'](_0x46d5d7[_0xa9c1('0x56')]):_0xa9c1('0x6b'));return respondWithRpcPromise(_0xa9c1('0x6c'),'acceptMessage',_0x3fc694);}return null;})[_0xa9c1('0x22')](function(_0x55a4d8){if(_0x55a4d8){if(_0x46d5d7[_0xa9c1('0x56')][_0xa9c1('0x6d')]){_0x3fc694['message'][_0xa9c1('0x6e')]=util[_0xa9c1('0x5e')](_0xa9c1('0x6f'),_0x46d5d7['user']['name']);_0x3fc694[_0xa9c1('0x28')][_0xa9c1('0x70')]=_0x3fc694[_0xa9c1('0x70')];_0x3fc694[_0xa9c1('0x28')][_0xa9c1('0x71')]=_0xa9c1('0x5b');return respondWithRpcPromise(_0xa9c1('0x72'),'EventManager',{'event':_0xa9c1('0x73'),'message':_0x3fc694[_0xa9c1('0x28')]},client9002)[_0xa9c1('0x22')](function(){return _0x3fc694;});}return _0x3fc694;}return null;})['then'](respondWithResult(_0x22dfe0,null))[_0xa9c1('0x2b')](handleError(_0x22dfe0,null));};var interaction_log=require(_0xa9c1('0x59'))(_0xa9c1('0x5a'));exports[_0xa9c1('0x33')]=function(_0x734ab5,_0x1cefe1,_0x3ef763){var _0x1bf1f5={'agent':{},'channel':_0xa9c1('0x74')};if(_0x734ab5[_0xa9c1('0x56')]['id']){delete _0x734ab5[_0xa9c1('0x56')]['id'];}_0x734ab5[_0xa9c1('0x56')][_0xa9c1('0x60')]=_0x734ab5[_0xa9c1('0x56')]['UserId']||_0x734ab5[_0xa9c1('0x69')]['id'];_0x1bf1f5[_0xa9c1('0x75')]['id']=_0x734ab5['body']['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0x734ab5[_0xa9c1('0x52')]['id'],'UserId':null}})[_0xa9c1('0x22')](handleEntityNotFound(_0x1cefe1,null))[_0xa9c1('0x22')](function(_0x54d4e1){if(_0x54d4e1){_0x1bf1f5[_0xa9c1('0x28')]=_0x54d4e1[_0xa9c1('0x63')]({'plain':!![]});return db[_0xa9c1('0x64')]['find']({'where':{'id':_0x54d4e1[_0xa9c1('0x65')]}});}return null;})[_0xa9c1('0x22')](handleEntityNotFound(_0x1cefe1,null))[_0xa9c1('0x22')](function(_0x295053){if(_0x295053){_0x1bf1f5['interaction']=_0x295053[_0xa9c1('0x63')]({'plain':!![]});interaction_log[_0xa9c1('0x29')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x734ab5['user']['id'],_0x734ab5[_0xa9c1('0x69')]['name'],_0x734ab5[_0xa9c1('0x69')][_0xa9c1('0x6a')],_0x1bf1f5[_0xa9c1('0x67')]['id'],_0x734ab5[_0xa9c1('0x56')]?JSON[_0xa9c1('0x76')](_0x734ab5[_0xa9c1('0x56')]):_0xa9c1('0x6b'));return respondWithRpcPromise(_0xa9c1('0x77'),_0xa9c1('0x78'),_0x1bf1f5);}return null;})['then'](function(_0x1b9e33){if(_0x1b9e33){_0x1b9e33['message'][_0xa9c1('0x6e')]=util['format'](_0xa9c1('0x6f'),_0x734ab5['user'][_0xa9c1('0x3d')]);_0x1b9e33[_0xa9c1('0x28')][_0xa9c1('0x70')]=_0x1bf1f5['channel'];_0x1b9e33[_0xa9c1('0x28')][_0xa9c1('0x71')]=_0xa9c1('0x33');respondWithRpcPromise(_0xa9c1('0x72'),_0xa9c1('0x72'),{'event':_0xa9c1('0x79'),'message':_0x1b9e33['message']},client9002);return _0x1bf1f5;}return null;})[_0xa9c1('0x22')](respondWithResult(_0x1cefe1,null))[_0xa9c1('0x2b')](handleError(_0x1cefe1,null));}; \ No newline at end of file +var _0x0ec2=['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','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.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','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','save','update','then','destroy','sendStatus','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','find','create','body','describe','openchannel-interactions','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','acceptMessage','manual','channel','event','accept','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','interface','SIP/%s','rejectmessage','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash'];(function(_0x4289bb,_0x4eeedb){var _0x5a1ce4=function(_0x1f48a2){while(--_0x1f48a2){_0x4289bb['push'](_0x4289bb['shift']());}};_0x5a1ce4(++_0x4eeedb);}(_0x0ec2,0x6f));var _0x20ec=function(_0x14e9f0,_0x287f90){_0x14e9f0=_0x14e9f0-0x0;var _0xa63f7e=_0x0ec2[_0x14e9f0];return _0xa63f7e;};'use strict';var pdf=require(_0x20ec('0x0'));var emlformat=require(_0x20ec('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x20ec('0x2'));var rp=require('request-promise');var moment=require(_0x20ec('0x3'));var BPromise=require(_0x20ec('0x4'));var Mustache=require(_0x20ec('0x5'));var util=require(_0x20ec('0x6'));var path=require(_0x20ec('0x7'));var sox=require(_0x20ec('0x8'));var csv=require(_0x20ec('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x20ec('0xa'));var squel=require('squel');var crypto=require(_0x20ec('0xb'));var jsforce=require(_0x20ec('0xc'));var deskjs=require(_0x20ec('0xd'));var toCsv=require(_0x20ec('0x9'));var querystring=require(_0x20ec('0xe'));var Papa=require('papaparse');var Redis=require(_0x20ec('0xf'));var authService=require(_0x20ec('0x10'));var qs=require(_0x20ec('0x11'));var as=require(_0x20ec('0x12'));var hardwareService=require(_0x20ec('0x13'));var logger=require(_0x20ec('0x14'))(_0x20ec('0x15'));var utils=require(_0x20ec('0x16'));var config=require(_0x20ec('0x17'));var db=require(_0x20ec('0x18'))['db'];config['redis']=_[_0x20ec('0x19')](config[_0x20ec('0x1a')],{'host':_0x20ec('0x1b'),'port':0x18eb});var socket=require(_0x20ec('0x1c'))(new Redis(config[_0x20ec('0x1a')]));require(_0x20ec('0x1d'))[_0x20ec('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x20ec('0x1f')][_0x20ec('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x20ec('0x20')]({'port':0x232a});function checkPasswordPattern(_0x45d407,_0x5ca004,_0x5a2b20){if(_0x5a2b20){var _0x438559=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x438559[_0x20ec('0x21')](_0x5ca004)){return _0x45d407;}else{throw new db[(_0x20ec('0x22'))]['ValidationError'](_0x20ec('0x23'));}}else{return _0x45d407;}}function respondWithRpcPromise(_0x340a93,_0x10a063,_0x4ee0d3,_0x4811df){return new BPromise(function(_0x2233bd,_0x19b033){var _0x69cd7=_0x4811df||client;return _0x69cd7[_0x20ec('0x24')](_0x340a93,_0x4ee0d3)['then'](function(_0x318033){logger[_0x20ec('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x10a063,'request\x20sent');logger[_0x20ec('0x26')](_0x20ec('0x27'),_0x10a063,_0x20ec('0x28'),JSON['stringify'](_0x318033));if(_0x318033[_0x20ec('0x29')]){if(_0x318033[_0x20ec('0x29')][_0x20ec('0x2a')]===0x1f4){logger[_0x20ec('0x29')](_0x20ec('0x2b'),_0x10a063,_0x318033[_0x20ec('0x29')]['message']);return _0x19b033(_0x318033[_0x20ec('0x29')][_0x20ec('0x2c')]);}logger[_0x20ec('0x29')](_0x20ec('0x2b'),_0x10a063,_0x318033[_0x20ec('0x29')]['message']);return _0x2233bd(_0x318033[_0x20ec('0x29')][_0x20ec('0x2c')]);}else{logger['info'](_0x20ec('0x2b'),_0x10a063,_0x20ec('0x28'));_0x2233bd(_0x318033[_0x20ec('0x2d')][_0x20ec('0x2c')]);}})[_0x20ec('0x2e')](function(_0x371772){logger[_0x20ec('0x29')](_0x20ec('0x2b'),_0x10a063,_0x371772);_0x19b033(_0x371772);});});}function respondWithStatusCode(_0x3020f9,_0x53f942){_0x53f942=_0x53f942||0xcc;return function(_0x40d40c){if(_0x40d40c){return _0x3020f9['sendStatus'](_0x53f942);}return _0x3020f9[_0x20ec('0x2f')](_0x53f942)[_0x20ec('0x30')]();};}function respondWithResult(_0x5074db,_0x5d96fb){_0x5d96fb=_0x5d96fb||0xc8;return function(_0x3213c4){if(_0x3213c4){return _0x5074db[_0x20ec('0x2f')](_0x5d96fb)[_0x20ec('0x31')](_0x3213c4);}};}function respondWithFilteredResult(_0x4154aa,_0x42072f){return function(_0x4acc39){if(_0x4acc39){var _0x2d076a=_0x4acc39['count'],_0x1cc967=_0x42072f[_0x20ec('0x32')],_0x4ed766=_0x42072f[_0x20ec('0x32')]+_0x42072f['limit'],_0x37c9e2;if(_0x4ed766>=_0x2d076a){_0x4ed766=_0x2d076a;_0x37c9e2=0xc8;}else{_0x37c9e2=0xce;}_0x4154aa[_0x20ec('0x2f')](_0x37c9e2);return _0x4154aa['set']('Content-Range',_0x1cc967+'-'+_0x4ed766+'/'+_0x2d076a)['json'](_0x4acc39);}return null;};}function patchUpdates(_0x155a9a){return function(_0x26eda7){try{jsonpatch['apply'](_0x26eda7,_0x155a9a,!![]);}catch(_0x2f6509){return BPromise['reject'](_0x2f6509);}return _0x26eda7[_0x20ec('0x33')]();};}function saveUpdates(_0xba3095,_0x5ea5f4){return function(_0x7c9510){if(_0x7c9510){return _0x7c9510[_0x20ec('0x34')](_0xba3095)[_0x20ec('0x35')](function(_0x266efc){return _0x266efc;});}return null;};}function removeEntity(_0x61d660,_0x387e9c){return function(_0x1a3a16){if(_0x1a3a16){return _0x1a3a16[_0x20ec('0x36')]()['then'](function(){_0x61d660[_0x20ec('0x2f')](0xcc)[_0x20ec('0x30')]();});}};}function handleEntityNotFound(_0x1ba10d,_0xb052d1){return function(_0x4e8fc7){if(!_0x4e8fc7){_0x1ba10d[_0x20ec('0x37')](0x194);}return _0x4e8fc7;};}function handleError(_0x21fa0f,_0x5d2a78){_0x5d2a78=_0x5d2a78||0x1f4;return function(_0x8642c0){logger[_0x20ec('0x29')](_0x8642c0[_0x20ec('0x38')]);if(_0x8642c0[_0x20ec('0x39')]){delete _0x8642c0[_0x20ec('0x39')];}_0x21fa0f['status'](_0x5d2a78)[_0x20ec('0x3a')](_0x8642c0);};}exports['index']=function(_0x3df483,_0x2fd0bb){var _0x1b29eb={},_0xe75f51={},_0x1c8009={'count':0x0,'rows':[]};var _0x7524d=_[_0x20ec('0x3b')](db[_0x20ec('0x3c')][_0x20ec('0x3d')],function(_0x302c80){return{'name':_0x302c80[_0x20ec('0x3e')],'type':_0x302c80[_0x20ec('0x3f')][_0x20ec('0x40')]};});_0xe75f51[_0x20ec('0x41')]=_[_0x20ec('0x3b')](_0x7524d,'name');_0xe75f51['query']=_[_0x20ec('0x42')](_0x3df483[_0x20ec('0x43')]);_0xe75f51['filters']=_[_0x20ec('0x44')](_0xe75f51['model'],_0xe75f51[_0x20ec('0x43')]);_0x1b29eb['attributes']=_['intersection'](_0xe75f51[_0x20ec('0x41')],qs[_0x20ec('0x45')](_0x3df483[_0x20ec('0x43')][_0x20ec('0x45')]));_0x1b29eb['attributes']=_0x1b29eb[_0x20ec('0x46')][_0x20ec('0x47')]?_0x1b29eb[_0x20ec('0x46')]:_0xe75f51[_0x20ec('0x41')];if(!_0x3df483['query'][_0x20ec('0x48')](_0x20ec('0x49'))){_0x1b29eb[_0x20ec('0x4a')]=qs['limit'](_0x3df483['query']['limit']);_0x1b29eb['offset']=qs['offset'](_0x3df483[_0x20ec('0x43')]['offset']);}_0x1b29eb[_0x20ec('0x4b')]=qs['sort'](_0x3df483[_0x20ec('0x43')][_0x20ec('0x4c')]);_0x1b29eb[_0x20ec('0x4d')]=qs[_0x20ec('0x4e')](_[_0x20ec('0x4f')](_0x3df483[_0x20ec('0x43')],_0xe75f51['filters']));if(_0x3df483[_0x20ec('0x43')]['filter']){_0x1b29eb[_0x20ec('0x4d')]=_['merge'](_0x1b29eb[_0x20ec('0x4d')],{'$or':_[_0x20ec('0x3b')](_0x7524d,function(_0x2a7b24){if(_0x2a7b24[_0x20ec('0x3f')]!==_0x20ec('0x50')){var _0x50a8af={};_0x50a8af[_0x2a7b24[_0x20ec('0x39')]]={'$like':'%'+_0x3df483[_0x20ec('0x43')]['filter']+'%'};return _0x50a8af;}})});}_0x1b29eb=_[_0x20ec('0x51')]({},_0x1b29eb,_0x3df483[_0x20ec('0x52')]);var _0x13b56f={'where':_0x1b29eb['where']};return db[_0x20ec('0x3c')][_0x20ec('0x53')](_0x13b56f)['then'](function(_0x46dbee){_0x1c8009['count']=_0x46dbee;if(_0x3df483[_0x20ec('0x43')][_0x20ec('0x54')]){_0x1b29eb[_0x20ec('0x55')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x1b29eb);})[_0x20ec('0x35')](function(_0x433978){_0x1c8009[_0x20ec('0x56')]=_0x433978;return _0x1c8009;})[_0x20ec('0x35')](respondWithFilteredResult(_0x2fd0bb,_0x1b29eb))[_0x20ec('0x2e')](handleError(_0x2fd0bb,null));};exports[_0x20ec('0x57')]=function(_0x3f3930,_0x433741){var _0x50b469={'raw':!![],'where':{'id':_0x3f3930[_0x20ec('0x58')]['id']}},_0x37a91f={};_0x37a91f[_0x20ec('0x41')]=_[_0x20ec('0x42')](db[_0x20ec('0x3c')][_0x20ec('0x3d')]);_0x37a91f[_0x20ec('0x43')]=_[_0x20ec('0x42')](_0x3f3930[_0x20ec('0x43')]);_0x37a91f[_0x20ec('0x4e')]=_[_0x20ec('0x44')](_0x37a91f['model'],_0x37a91f[_0x20ec('0x43')]);_0x50b469[_0x20ec('0x46')]=_['intersection'](_0x37a91f[_0x20ec('0x41')],qs[_0x20ec('0x45')](_0x3f3930['query'][_0x20ec('0x45')]));_0x50b469[_0x20ec('0x46')]=_0x50b469[_0x20ec('0x46')]['length']?_0x50b469['attributes']:_0x37a91f[_0x20ec('0x41')];if(_0x3f3930[_0x20ec('0x43')]['includeAll']){_0x50b469[_0x20ec('0x55')]=[{'all':!![]}];}_0x50b469=_['merge']({},_0x50b469,_0x3f3930[_0x20ec('0x52')]);return db[_0x20ec('0x3c')][_0x20ec('0x59')](_0x50b469)[_0x20ec('0x35')](handleEntityNotFound(_0x433741,null))['then'](respondWithResult(_0x433741,null))[_0x20ec('0x2e')](handleError(_0x433741,null));};exports['create']=function(_0x10a8cc,_0x125484){return db[_0x20ec('0x3c')][_0x20ec('0x5a')](_0x10a8cc[_0x20ec('0x5b')],{})[_0x20ec('0x35')](respondWithResult(_0x125484,0xc9))[_0x20ec('0x2e')](handleError(_0x125484,null));};exports[_0x20ec('0x34')]=function(_0x183586,_0x770303){if(_0x183586[_0x20ec('0x5b')]['id']){delete _0x183586[_0x20ec('0x5b')]['id'];}return db[_0x20ec('0x3c')]['find']({'where':{'id':_0x183586['params']['id']}})[_0x20ec('0x35')](handleEntityNotFound(_0x770303,null))[_0x20ec('0x35')](saveUpdates(_0x183586['body'],null))[_0x20ec('0x35')](respondWithResult(_0x770303,null))['catch'](handleError(_0x770303,null));};exports[_0x20ec('0x36')]=function(_0x4ea447,_0x3e1f8b){return db[_0x20ec('0x3c')]['find']({'where':{'id':_0x4ea447[_0x20ec('0x58')]['id']}})[_0x20ec('0x35')](handleEntityNotFound(_0x3e1f8b,null))[_0x20ec('0x35')](removeEntity(_0x3e1f8b,null))[_0x20ec('0x2e')](handleError(_0x3e1f8b,null));};exports[_0x20ec('0x5c')]=function(_0x3e8827,_0x739acf){return db[_0x20ec('0x3c')][_0x20ec('0x5c')]()[_0x20ec('0x35')](respondWithResult(_0x739acf,null))['catch'](handleError(_0x739acf,null));};var interaction_log=require(_0x20ec('0x14'))(_0x20ec('0x5d'));exports['accept']=function(_0x15b706,_0x1eff84,_0x230e55){var _0x476c4c={'channel':_0x20ec('0x5e')};if(_0x15b706[_0x20ec('0x5b')]['id']){delete _0x15b706['body']['id'];}_0x15b706[_0x20ec('0x5b')]['read']=!![];_0x15b706[_0x20ec('0x5b')][_0x20ec('0x5f')]=moment()[_0x20ec('0x60')](_0x20ec('0x61'));_0x15b706[_0x20ec('0x5b')][_0x20ec('0x62')]=_0x15b706[_0x20ec('0x5b')][_0x20ec('0x62')]||_0x15b706[_0x20ec('0x63')]['id'];return db[_0x20ec('0x3c')][_0x20ec('0x59')]({'where':{'id':_0x15b706[_0x20ec('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x20ec('0x64')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x1eff84,null))[_0x20ec('0x35')](saveUpdates(_0x15b706['body'],null))[_0x20ec('0x35')](function(_0x1a13a4){if(_0x1a13a4){_0x476c4c[_0x20ec('0x2c')]=_0x1a13a4[_0x20ec('0x65')]({'plain':!![]});return db[_0x20ec('0x66')]['find']({'where':{'id':_0x1a13a4[_0x20ec('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x1eff84,null))['then'](function(_0x3c4b70){if(_0x3c4b70){return _0x3c4b70['update']({'UserId':_0x15b706[_0x20ec('0x5b')][_0x20ec('0x62')],'read1stAt':_['isNil'](_0x3c4b70['read1stAt'])?moment()[_0x20ec('0x60')](_0x20ec('0x61')):undefined});}return null;})[_0x20ec('0x35')](function(_0x465e36){if(_0x465e36){_0x476c4c['interaction']=_0x465e36[_0x20ec('0x65')]({'plain':!![]});interaction_log['info'](_0x20ec('0x68'),_0x15b706[_0x20ec('0x63')]['id'],_0x15b706[_0x20ec('0x63')][_0x20ec('0x39')],_0x15b706[_0x20ec('0x63')][_0x20ec('0x69')],_0x476c4c[_0x20ec('0x6a')]['id'],_0x15b706[_0x20ec('0x5b')]?JSON[_0x20ec('0x6b')](_0x15b706[_0x20ec('0x5b')]):_0x20ec('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x20ec('0x6d'),_0x476c4c);}return null;})[_0x20ec('0x35')](function(_0xee100c){if(_0xee100c){if(_0x15b706[_0x20ec('0x5b')][_0x20ec('0x6e')]){_0x476c4c[_0x20ec('0x2c')]['interface']=util['format']('SIP/%s',_0x15b706[_0x20ec('0x63')][_0x20ec('0x39')]);_0x476c4c[_0x20ec('0x2c')][_0x20ec('0x6f')]=_0x476c4c[_0x20ec('0x6f')];_0x476c4c[_0x20ec('0x2c')][_0x20ec('0x70')]=_0x20ec('0x71');return respondWithRpcPromise(_0x20ec('0x72'),'EventManager',{'event':_0x20ec('0x73'),'message':_0x476c4c[_0x20ec('0x2c')]},client9002)[_0x20ec('0x35')](function(){return _0x476c4c;});}return _0x476c4c;}return null;})[_0x20ec('0x35')](respondWithResult(_0x1eff84,null))['catch'](handleError(_0x1eff84,null));};var interaction_log=require('../../config/logger')(_0x20ec('0x5d'));exports[_0x20ec('0x74')]=function(_0x16c3c8,_0x538dfd,_0x488a9a){var _0x2c971b={'agent':{},'channel':_0x20ec('0x5e')};if(_0x16c3c8[_0x20ec('0x5b')]['id']){delete _0x16c3c8[_0x20ec('0x5b')]['id'];}_0x16c3c8['body'][_0x20ec('0x62')]=_0x16c3c8[_0x20ec('0x5b')][_0x20ec('0x62')]||_0x16c3c8[_0x20ec('0x63')]['id'];_0x2c971b['agent']['id']=_0x16c3c8[_0x20ec('0x5b')]['UserId'];return db[_0x20ec('0x3c')]['find']({'where':{'id':_0x16c3c8[_0x20ec('0x58')]['id'],'UserId':null}})[_0x20ec('0x35')](handleEntityNotFound(_0x538dfd,null))['then'](function(_0x1f015e){if(_0x1f015e){_0x2c971b[_0x20ec('0x2c')]=_0x1f015e['get']({'plain':!![]});return db[_0x20ec('0x66')][_0x20ec('0x59')]({'where':{'id':_0x1f015e[_0x20ec('0x67')]}});}return null;})[_0x20ec('0x35')](handleEntityNotFound(_0x538dfd,null))[_0x20ec('0x35')](function(_0x1ad693){if(_0x1ad693){_0x2c971b['interaction']=_0x1ad693[_0x20ec('0x65')]({'plain':!![]});interaction_log[_0x20ec('0x25')](_0x20ec('0x75'),_0x16c3c8[_0x20ec('0x63')]['id'],_0x16c3c8['user'][_0x20ec('0x39')],_0x16c3c8[_0x20ec('0x63')][_0x20ec('0x69')],_0x2c971b[_0x20ec('0x6a')]['id'],_0x16c3c8[_0x20ec('0x5b')]?JSON[_0x20ec('0x6b')](_0x16c3c8[_0x20ec('0x5b')]):_0x20ec('0x6c'));return respondWithRpcPromise(_0x20ec('0x76'),'rejectMessage',_0x2c971b);}return null;})[_0x20ec('0x35')](function(_0x458a59){if(_0x458a59){_0x458a59[_0x20ec('0x2c')][_0x20ec('0x77')]=util['format'](_0x20ec('0x78'),_0x16c3c8[_0x20ec('0x63')]['name']);_0x458a59[_0x20ec('0x2c')][_0x20ec('0x6f')]=_0x2c971b[_0x20ec('0x6f')];_0x458a59[_0x20ec('0x2c')][_0x20ec('0x70')]=_0x20ec('0x74');respondWithRpcPromise(_0x20ec('0x72'),'EventManager',{'event':_0x20ec('0x79'),'message':_0x458a59[_0x20ec('0x2c')]},client9002);return _0x2c971b;}return null;})['then'](respondWithResult(_0x538dfd,null))[_0x20ec('0x2e')](handleError(_0x538dfd,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 1361fd1..8d1d101 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 _0x68a6=['hook','exports','events','../../mysqldb','OpenchannelMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x15be2d,_0x3258a2){var _0x3944f2=function(_0x5c9fb2){while(--_0x5c9fb2){_0x15be2d['push'](_0x15be2d['shift']());}};_0x3944f2(++_0x3258a2);}(_0x68a6,0x1c4));var _0x668a=function(_0x228978,_0x1fb2db){_0x228978=_0x228978-0x0;var _0x521137=_0x68a6[_0x228978];return _0x521137;};'use strict';var EventEmitter=require(_0x668a('0x0'));var OpenchannelMessage=require(_0x668a('0x1'))['db'][_0x668a('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x668a('0x3'),'afterUpdate':_0x668a('0x4'),'afterDestroy':_0x668a('0x5')};function emitEvent(_0xcfc395){return function(_0x2b59e8,_0x3c900c,_0x19b4de){OpenchannelMessageEvents[_0x668a('0x6')](_0xcfc395+':'+_0x2b59e8['id'],_0x2b59e8);OpenchannelMessageEvents['emit'](_0xcfc395,_0x2b59e8);_0x19b4de(null);};}for(var e in events){if(events[_0x668a('0x7')](e)){var event=events[e];OpenchannelMessage[_0x668a('0x8')](e,emitEvent(event));}}module[_0x668a('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x95ca=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x1017a7,_0x377c79){var _0x4e505e=function(_0x186b93){while(--_0x186b93){_0x1017a7['push'](_0x1017a7['shift']());}};_0x4e505e(++_0x377c79);}(_0x95ca,0xc9));var _0xa95c=function(_0x4aae35,_0x2d5af3){_0x4aae35=_0x4aae35-0x0;var _0x2340fe=_0x95ca[_0x4aae35];return _0x2340fe;};'use strict';var EventEmitter=require(_0xa95c('0x0'));var OpenchannelMessage=require(_0xa95c('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa95c('0x2')](0x0);var events={'afterCreate':_0xa95c('0x3'),'afterUpdate':_0xa95c('0x4'),'afterDestroy':_0xa95c('0x5')};function emitEvent(_0x2990b3){return function(_0x5d56fe,_0x12c797,_0x4b81df){OpenchannelMessageEvents['emit'](_0x2990b3+':'+_0x5d56fe['id'],_0x5d56fe);OpenchannelMessageEvents[_0xa95c('0x6')](_0x2990b3,_0x5d56fe);_0x4b81df(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xa95c('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index eb6c203..4d0acd0 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 _0xdeff=['body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','CmContact','OpenchannelAccount','Contact','keys','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x28d65a,_0x2023ed){var _0x10de9c=function(_0x1c058c){while(--_0x1c058c){_0x28d65a['push'](_0x28d65a['shift']());}};_0x10de9c(++_0x2023ed);}(_0xdeff,0x118));var _0xfdef=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0xdeff[_0x36bfe3];return _0x9b0436;};'use strict';var _=require('lodash');var util=require(_0xfdef('0x0'));var logger=require(_0xfdef('0x1'))(_0xfdef('0x2'));var moment=require(_0xfdef('0x3'));var BPromise=require('bluebird');var rp=require(_0xfdef('0x4'));var fs=require('fs');var path=require(_0xfdef('0x5'));var rimraf=require(_0xfdef('0x6'));var config=require(_0xfdef('0x7'));var attributes=require(_0xfdef('0x8'));module[_0xfdef('0x9')]=function(_0xce457d,_0x5e13b4){return _0xce457d[_0xfdef('0xa')](_0xfdef('0xb'),attributes,{'tableName':_0xfdef('0xc'),'paranoid':![],'indexes':[{'name':_0xfdef('0xd'),'fields':[_0xfdef('0xe')],'type':_0xfdef('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x120a2f,_0x3dd889,_0x2f7503){var _0x6a44c=_0xce457d[_0xfdef('0x10')];var _0x26f8c8=_0x120a2f['get']({'plain':!![]});if(_0x26f8c8[_0xfdef('0x11')]['toLowerCase']()==='in'||_0x26f8c8[_0xfdef('0x11')][_0xfdef('0x12')]()===_0xfdef('0x13')&&!_0x26f8c8[_0xfdef('0x14')]&&!_[_0xfdef('0x15')](_0x26f8c8[_0xfdef('0x16')])){_0x6a44c[_0xfdef('0x17')][_0xfdef('0x18')]({'where':{'id':_0x26f8c8[_0xfdef('0x19')]}})[_0xfdef('0x1a')](function(_0x3dc21f){if(_0x3dc21f){_0x3dc21f['update']({'lastMsgAt':_0x26f8c8['createdAt'],'lastMsgDirection':_0x26f8c8[_0xfdef('0x11')][_0xfdef('0x12')]()});}})['catch'](function(_0x5171bb){console['error'](_0x5171bb);});}if(_0x26f8c8[_0xfdef('0x11')]==='out'&&!_0x26f8c8['secret']){var _0x176cba;_0x6a44c[_0xfdef('0x1b')]['describe']()[_0xfdef('0x1a')](function(_0x4d5714){return _0x6a44c[_0xfdef('0x1c')]['find']({'where':{'id':_0x26f8c8['OpenchannelAccountId']},'include':[{'model':_0x6a44c[_0xfdef('0x17')],'as':'Interactions','where':{'id':_0x26f8c8[_0xfdef('0x19')]},'limit':0x1,'include':[{'model':_0x6a44c[_0xfdef('0x1b')],'as':_0xfdef('0x1d'),'attributes':_[_0xfdef('0x1e')](_0x4d5714)}]}]});})[_0xfdef('0x1a')](function(_0x3b22c9){_0x176cba=_0x3b22c9[_0xfdef('0x1f')]({'plain':!![]});if(_0x176cba&&_0x176cba[_0xfdef('0x20')]){logger[_0xfdef('0x21')](_0xfdef('0x22'),_0xfdef('0x23'),util[_0xfdef('0x24')](_0xfdef('0x25'),_0x26f8c8['id'],_0x176cba[_0xfdef('0x20')]));if(_0x176cba[_0xfdef('0x26')]&&_0x176cba[_0xfdef('0x26')][_0xfdef('0x27')]){_0x26f8c8[_0xfdef('0x28')]=_[_0xfdef('0x29')](_0x176cba[_0xfdef('0x26')][0x0],_0xfdef('0x1d'));_0x26f8c8['Contact']=_0x176cba[_0xfdef('0x26')][0x0][_0xfdef('0x1d')];}var _0x3dd889={'method':_0xfdef('0x2a'),'uri':encodeURI(_0x176cba[_0xfdef('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3dd889['method']){case _0xfdef('0x2b'):_0x3dd889['qs']=_0x26f8c8;break;case _0xfdef('0x2a'):_0x3dd889[_0xfdef('0xe')]=_0x26f8c8;break;}return rp(_0x3dd889)[_0xfdef('0x1a')](function(_0x519db9){logger[_0xfdef('0x21')](_0xfdef('0x22'),_0xfdef('0x23'),util['format'](_0xfdef('0x2c'),_0x26f8c8['id'],_0x176cba['replyUri']));if(_0x519db9[_0xfdef('0xe')][_0xfdef('0x2d')]&&_0x519db9['body'][_0xfdef('0x2d')]!=_0x26f8c8[_0xfdef('0x28')]['threadId']){return _0x6a44c['OpenchannelInteraction'][_0xfdef('0x2e')]({'threadId':_0x519db9[_0xfdef('0xe')][_0xfdef('0x2d')]},{'logging':!![],'where':{'id':_0x26f8c8[_0xfdef('0x28')]['id']}});}else{return;}})[_0xfdef('0x1a')](function(){return _0x120a2f[_0xfdef('0x2e')]({'read':!![]});})['catch'](function(_0x4ae88c){logger[_0xfdef('0x2f')]('OpenchannelMessage,\x20%s,\x20%s',_0xfdef('0x23'),util['inspect'](_0x4ae88c,{'showHidden':![],'depth':null}));_0x2f7503();});}else{_0x2f7503();}})['finally'](function(){_0x2f7503();});}else{_0x2f7503();}}},'charset':'utf8mb4','collate':_0xfdef('0x30')});}; \ No newline at end of file +var _0xf62e=['finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect'];(function(_0x54bf67,_0x5381e5){var _0x5f18a9=function(_0x5fea82){while(--_0x5fea82){_0x54bf67['push'](_0x54bf67['shift']());}};_0x5f18a9(++_0x5381e5);}(_0xf62e,0xd7));var _0xef62=function(_0x2e7c66,_0x243cfd){_0x2e7c66=_0x2e7c66-0x0;var _0x4b254d=_0xf62e[_0x2e7c66];return _0x4b254d;};'use strict';var _=require(_0xef62('0x0'));var util=require('util');var logger=require(_0xef62('0x1'))(_0xef62('0x2'));var moment=require('moment');var BPromise=require(_0xef62('0x3'));var rp=require(_0xef62('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef62('0x5'));var config=require(_0xef62('0x6'));var attributes=require(_0xef62('0x7'));module[_0xef62('0x8')]=function(_0x1a23e0,_0x1119d4){return _0x1a23e0['define'](_0xef62('0x9'),attributes,{'tableName':_0xef62('0xa'),'paranoid':![],'indexes':[{'name':_0xef62('0xb'),'fields':[_0xef62('0xc')],'type':_0xef62('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x678de3,_0xc216d6,_0x3ca7ab){var _0x189477=_0x1a23e0[_0xef62('0xe')];var _0x3bf484=_0x678de3[_0xef62('0xf')]({'plain':!![]});if(_0x3bf484[_0xef62('0x10')][_0xef62('0x11')]()==='in'||_0x3bf484[_0xef62('0x10')][_0xef62('0x11')]()===_0xef62('0x12')&&!_0x3bf484['secret']&&!_[_0xef62('0x13')](_0x3bf484[_0xef62('0x14')])){_0x189477[_0xef62('0x15')][_0xef62('0x16')]({'where':{'id':_0x3bf484[_0xef62('0x17')]}})[_0xef62('0x18')](function(_0xdc7bd4){if(_0xdc7bd4){_0xdc7bd4[_0xef62('0x19')]({'lastMsgAt':_0x3bf484[_0xef62('0x1a')],'lastMsgDirection':_0x3bf484[_0xef62('0x10')]['toLowerCase']()});}})['catch'](function(_0x1a38e7){console['error'](_0x1a38e7);});}if(_0x3bf484[_0xef62('0x10')]===_0xef62('0x12')&&!_0x3bf484['secret']){var _0x46b259;_0x189477[_0xef62('0x1b')]['describe']()['then'](function(_0xeb5ce6){return _0x189477[_0xef62('0x1c')][_0xef62('0x1d')]({'where':{'id':_0x3bf484[_0xef62('0x1e')]},'include':[{'model':_0x189477[_0xef62('0x15')],'as':'Interactions','where':{'id':_0x3bf484['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x189477[_0xef62('0x1b')],'as':_0xef62('0x1f'),'attributes':_[_0xef62('0x20')](_0xeb5ce6)}]}]});})[_0xef62('0x18')](function(_0x2fcc0a){_0x46b259=_0x2fcc0a[_0xef62('0xf')]({'plain':!![]});if(_0x46b259&&_0x46b259[_0xef62('0x21')]){logger['info'](_0xef62('0x22'),_0xef62('0x23'),util[_0xef62('0x24')](_0xef62('0x25'),_0x3bf484['id'],_0x46b259[_0xef62('0x21')]));if(_0x46b259[_0xef62('0x26')]&&_0x46b259[_0xef62('0x26')][_0xef62('0x27')]){_0x3bf484[_0xef62('0x28')]=_[_0xef62('0x29')](_0x46b259['Interactions'][0x0],_0xef62('0x1f'));_0x3bf484[_0xef62('0x1f')]=_0x46b259[_0xef62('0x26')][0x0][_0xef62('0x1f')];}var _0xc216d6={'method':_0xef62('0x2a'),'uri':encodeURI(_0x46b259['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0xc216d6[_0xef62('0x2b')]){case _0xef62('0x2c'):_0xc216d6['qs']=_0x3bf484;break;case'POST':_0xc216d6[_0xef62('0xc')]=_0x3bf484;break;}return rp(_0xc216d6)['then'](function(_0x75c092){logger[_0xef62('0x2d')](_0xef62('0x22'),_0xef62('0x23'),util[_0xef62('0x24')](_0xef62('0x2e'),_0x3bf484['id'],_0x46b259['replyUri']));if(_0x75c092[_0xef62('0xc')][_0xef62('0x2f')]&&_0x75c092['body'][_0xef62('0x2f')]!=_0x3bf484['Interaction'][_0xef62('0x2f')]){return _0x189477['OpenchannelInteraction'][_0xef62('0x19')]({'threadId':_0x75c092['body']['threadId']},{'logging':!![],'where':{'id':_0x3bf484['Interaction']['id']}});}else{return;}})['then'](function(){return _0x678de3[_0xef62('0x19')]({'read':!![]});})['catch'](function(_0x3b4e73){logger[_0xef62('0x30')](_0xef62('0x22'),_0xef62('0x23'),util[_0xef62('0x31')](_0x3b4e73,{'showHidden':![],'depth':null}));_0x3ca7ab();});}else{_0x3ca7ab();}})[_0xef62('0x32')](function(){_0x3ca7ab();});}else{_0x3ca7ab();}}},'charset':_0xef62('0x33'),'collate':_0xef62('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 7cc9b2a..67b1b02 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 _0x5942=['error','code','message','OpenchannelMessage,\x20%s,\x20%s','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x595203,_0x47043e){var _0x18072e=function(_0x1e04a4){while(--_0x1e04a4){_0x595203['push'](_0x595203['shift']());}};_0x18072e(++_0x47043e);}(_0x5942,0x16a));var _0x2594=function(_0x437348,_0x27ddba){_0x437348=_0x437348-0x0;var _0x32115e=_0x5942[_0x437348];return _0x32115e;};'use strict';var _=require(_0x2594('0x0'));var util=require(_0x2594('0x1'));var moment=require(_0x2594('0x2'));var BPromise=require(_0x2594('0x3'));var rs=require(_0x2594('0x4'));var fs=require('fs');var Redis=require(_0x2594('0x5'));var db=require(_0x2594('0x6'))['db'];var utils=require(_0x2594('0x7'));var logger=require(_0x2594('0x8'))(_0x2594('0x9'));var config=require(_0x2594('0xa'));var jayson=require(_0x2594('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x2594('0xc')]=_[_0x2594('0xd')](config[_0x2594('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2594('0xe'))(new Redis(config[_0x2594('0xc')]));require('./openchannelMessage.socket')[_0x2594('0xf')](socket);function respondWithRpcPromise(_0x516088,_0x243a4e,_0x432b67){return new BPromise(function(_0x2e970c,_0x4a7dd2){return client[_0x2594('0x10')](_0x516088,_0x432b67)[_0x2594('0x11')](function(_0x26aa8c){logger[_0x2594('0x12')]('OpenchannelMessage,\x20%s,\x20%s',_0x243a4e,_0x2594('0x13'));logger[_0x2594('0x14')](_0x2594('0x15'),_0x243a4e,_0x2594('0x13'),JSON[_0x2594('0x16')](_0x26aa8c));if(_0x26aa8c[_0x2594('0x17')]){if(_0x26aa8c[_0x2594('0x17')][_0x2594('0x18')]===0x1f4){logger[_0x2594('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x243a4e,_0x26aa8c[_0x2594('0x17')][_0x2594('0x19')]);return _0x4a7dd2(_0x26aa8c['error'][_0x2594('0x19')]);}logger['error'](_0x2594('0x1a'),_0x243a4e,_0x26aa8c[_0x2594('0x17')][_0x2594('0x19')]);return _0x2e970c(_0x26aa8c[_0x2594('0x17')][_0x2594('0x19')]);}else{logger['info'](_0x2594('0x1a'),_0x243a4e,_0x2594('0x13'));_0x2e970c(_0x26aa8c[_0x2594('0x1b')][_0x2594('0x19')]);}})[_0x2594('0x1c')](function(_0x4776a3){logger[_0x2594('0x17')](_0x2594('0x1a'),_0x243a4e,_0x4776a3);_0x4a7dd2(_0x4776a3);});});}exports[_0x2594('0x1d')]=function(_0x52b80a){var _0x4fab4e=this;return new Promise(function(_0x31efb3,_0x40a1f2){return db[_0x2594('0x1e')][_0x2594('0x1f')](_0x52b80a[_0x2594('0x20')],{'raw':_0x52b80a[_0x2594('0x21')]?_0x52b80a['options'][_0x2594('0x22')]===undefined?!![]:![]:!![]})[_0x2594('0x11')](function(_0x121a8e){logger[_0x2594('0x12')]('CreateOpenchannelMessage',_0x52b80a);logger[_0x2594('0x14')]('CreateOpenchannelMessage',_0x52b80a,JSON[_0x2594('0x16')](_0x121a8e));_0x31efb3(_0x121a8e);})['catch'](function(_0x14735b){logger[_0x2594('0x17')]('CreateOpenchannelMessage',_0x14735b[_0x2594('0x19')],_0x52b80a);_0x40a1f2(_0x4fab4e['error'](0x1f4,_0x14735b[_0x2594('0x19')]));});});}; \ No newline at end of file +var _0x2da6=['defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','OpenchannelMessage','create','body','options','info','CreateOpenchannelMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4edf06,_0x6f934a){var _0x4bfe59=function(_0x54164c){while(--_0x54164c){_0x4edf06['push'](_0x4edf06['shift']());}};_0x4bfe59(++_0x6f934a);}(_0x2da6,0x1dd));var _0x62da=function(_0x509c64,_0x4a2025){_0x509c64=_0x509c64-0x0;var _0x8048fd=_0x2da6[_0x509c64];return _0x8048fd;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});config[_0x62da('0xc')]=_[_0x62da('0xd')](config[_0x62da('0xc')],{'host':_0x62da('0xe'),'port':0x18eb});var socket=require(_0x62da('0xf'))(new Redis(config['redis']));require(_0x62da('0x10'))[_0x62da('0x11')](socket);function respondWithRpcPromise(_0x2a3d7c,_0x1b68f8,_0x4cd5a2){return new BPromise(function(_0x241090,_0x3afe3b){return client[_0x62da('0x12')](_0x2a3d7c,_0x4cd5a2)[_0x62da('0x13')](function(_0x23be32){logger['info'](_0x62da('0x14'),_0x1b68f8,_0x62da('0x15'));logger[_0x62da('0x16')](_0x62da('0x17'),_0x1b68f8,_0x62da('0x15'),JSON['stringify'](_0x23be32));if(_0x23be32['error']){if(_0x23be32[_0x62da('0x18')][_0x62da('0x19')]===0x1f4){logger[_0x62da('0x18')](_0x62da('0x14'),_0x1b68f8,_0x23be32[_0x62da('0x18')][_0x62da('0x1a')]);return _0x3afe3b(_0x23be32[_0x62da('0x18')][_0x62da('0x1a')]);}logger[_0x62da('0x18')](_0x62da('0x14'),_0x1b68f8,_0x23be32[_0x62da('0x18')][_0x62da('0x1a')]);return _0x241090(_0x23be32[_0x62da('0x18')][_0x62da('0x1a')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x1b68f8,_0x62da('0x15'));_0x241090(_0x23be32['result'][_0x62da('0x1a')]);}})[_0x62da('0x1b')](function(_0x15b8d0){logger['error'](_0x62da('0x14'),_0x1b68f8,_0x15b8d0);_0x3afe3b(_0x15b8d0);});});}exports['CreateOpenchannelMessage']=function(_0x2e6b7e){var _0x37c15d=this;return new Promise(function(_0x3b90c8,_0x2f7b01){return db[_0x62da('0x1c')][_0x62da('0x1d')](_0x2e6b7e[_0x62da('0x1e')],{'raw':_0x2e6b7e[_0x62da('0x1f')]?_0x2e6b7e[_0x62da('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x62da('0x13')](function(_0x866a76){logger[_0x62da('0x20')](_0x62da('0x21'),_0x2e6b7e);logger[_0x62da('0x16')](_0x62da('0x21'),_0x2e6b7e,JSON[_0x62da('0x22')](_0x866a76));_0x3b90c8(_0x866a76);})['catch'](function(_0x55fd3b){logger['error'](_0x62da('0x21'),_0x55fd3b[_0x62da('0x1a')],_0x2e6b7e);_0x2f7b01(_0x37c15d[_0x62da('0x18')](0x1f4,_0x55fd3b[_0x62da('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 568d149..8cd80f2 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 _0xa9e0=['register','length','openchannelMessage:','./openchannelMessage.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(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var OpenchannelMessageEvents=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(){OpenchannelMessageEvents[_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);OpenchannelMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xe706=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x5d2ed9,_0x16c436){var _0x4262c5=function(_0x124aee){while(--_0x124aee){_0x5d2ed9['push'](_0x5d2ed9['shift']());}};_0x4262c5(++_0x16c436);}(_0xe706,0xa3));var _0x6e70=function(_0x5d8fa1,_0x48f172){_0x5d8fa1=_0x5d8fa1-0x0;var _0x53a280=_0xe706[_0x5d8fa1];return _0x53a280;};'use strict';var OpenchannelMessageEvents=require(_0x6e70('0x0'));var events=[_0x6e70('0x1'),_0x6e70('0x2'),'update'];function createListener(_0x2cae77,_0x315629){return function(_0x2ca810){_0x315629[_0x6e70('0x3')](_0x2cae77,_0x2ca810);};}function removeListener(_0x142c27,_0x2164a4){return function(){OpenchannelMessageEvents[_0x6e70('0x4')](_0x142c27,_0x2164a4);};}exports[_0x6e70('0x5')]=function(_0x1b0389){for(var _0x4381d1=0x0,_0x36357b=events[_0x6e70('0x6')];_0x4381d1<_0x36357b;_0x4381d1++){var _0x45a2d4=events[_0x4381d1];var _0x188ed3=createListener(_0x6e70('0x7')+_0x45a2d4,_0x1b0389);OpenchannelMessageEvents['on'](_0x45a2d4,_0x188ed3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index f26c3c6..ff4f30e 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 _0x277c=['index','/describe','describe','get','isAuthenticated','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','put','delete','/:id','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x277c,0x153));var _0xc277=function(_0x21abb7,_0x2948b3){_0x21abb7=_0x21abb7-0x0;var _0x1ae20a=_0x277c[_0x21abb7];return _0x1ae20a;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var auth=require(_0xc277('0x5'));var interaction=require(_0xc277('0x6'));var config=require(_0xc277('0x7'));var controller=require(_0xc277('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc277('0x9')]);router['get'](_0xc277('0xa'),auth['isAuthenticated'](),controller[_0xc277('0xb')]);router[_0xc277('0xc')]('/:id',auth[_0xc277('0xd')](),controller[_0xc277('0xe')]);router[_0xc277('0xc')](_0xc277('0xf'),auth[_0xc277('0xd')](),controller[_0xc277('0x10')]);router['get']('/:id/teams',auth[_0xc277('0xd')](),controller[_0xc277('0x11')]);router[_0xc277('0xc')](_0xc277('0x12'),auth['isAuthenticated'](),controller[_0xc277('0x13')]);router['post']('/',auth[_0xc277('0xd')](),controller[_0xc277('0x14')]);router[_0xc277('0x15')](_0xc277('0x16'),auth['isAuthenticated'](),controller[_0xc277('0x17')]);router[_0xc277('0x15')](_0xc277('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0xc277('0x18')]('/:id',auth[_0xc277('0xd')](),controller['update']);router[_0xc277('0x19')](_0xc277('0x1a'),auth[_0xc277('0xd')](),controller['destroy']);router['delete'](_0xc277('0x16'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xc277('0x19')](_0xc277('0x12'),auth[_0xc277('0xd')](),controller[_0xc277('0x1b')]);module[_0xc277('0x1c')]=router; \ No newline at end of file +var _0x535d=['post','create','put','update','destroy','delete','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0xa555a6,_0x457c1c){var _0xc5e8fe=function(_0xeb7fe5){while(--_0xeb7fe5){_0xa555a6['push'](_0xa555a6['shift']());}};_0xc5e8fe(++_0x457c1c);}(_0x535d,0xe8));var _0xd535=function(_0x2aaed0,_0x40c604){_0x2aaed0=_0x2aaed0-0x0;var _0x3a45db=_0x535d[_0x2aaed0];return _0x3a45db;};'use strict';var multer=require(_0xd535('0x0'));var util=require(_0xd535('0x1'));var path=require('path');var timeout=require(_0xd535('0x2'));var express=require(_0xd535('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd535('0x4'));var config=require(_0xd535('0x5'));var controller=require(_0xd535('0x6'));router[_0xd535('0x7')]('/',auth[_0xd535('0x8')](),controller[_0xd535('0x9')]);router['get']('/describe',auth[_0xd535('0x8')](),controller[_0xd535('0xa')]);router['get'](_0xd535('0xb'),auth['isAuthenticated'](),controller[_0xd535('0xc')]);router[_0xd535('0x7')](_0xd535('0xd'),auth[_0xd535('0x8')](),controller['getMembers']);router[_0xd535('0x7')](_0xd535('0xe'),auth[_0xd535('0x8')](),controller[_0xd535('0xf')]);router['get'](_0xd535('0x10'),auth[_0xd535('0x8')](),controller[_0xd535('0x11')]);router[_0xd535('0x12')]('/',auth[_0xd535('0x8')](),controller[_0xd535('0x13')]);router[_0xd535('0x12')]('/:id/teams',auth[_0xd535('0x8')](),controller['addTeams']);router['post'](_0xd535('0x10'),auth[_0xd535('0x8')](),controller['addAgents']);router[_0xd535('0x14')](_0xd535('0xb'),auth[_0xd535('0x8')](),controller[_0xd535('0x15')]);router['delete'](_0xd535('0xb'),auth[_0xd535('0x8')](),controller[_0xd535('0x16')]);router[_0xd535('0x17')]('/:id/teams',auth[_0xd535('0x8')](),controller['removeTeams']);router[_0xd535('0x17')]('/:id/users',auth[_0xd535('0x8')](),controller['removeAgents']);module[_0xd535('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 4bf77a3..e8ab610 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 _0xf62d=['name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3d8f61,_0x39ba2b){var _0x86e5f9=function(_0x54c0d9){while(--_0x54c0d9){_0x3d8f61['push'](_0x3d8f61['shift']());}};_0x86e5f9(++_0x39ba2b);}(_0xf62d,0x1c0));var _0xdf62=function(_0x37ebd4,_0x178824){_0x37ebd4=_0x37ebd4-0x0;var _0x12ae35=_0xf62d[_0x37ebd4];return _0x12ae35;};'use strict';var Sequelize=require(_0xdf62('0x0'));module[_0xdf62('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xdf62('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdf62('0x3')]},'timeout':{'type':Sequelize[_0xdf62('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdf62('0x5')](_0xdf62('0x6'),_0xdf62('0x7'),_0xdf62('0x8'))}}; \ No newline at end of file +var _0x870d=['name','INTEGER','ENUM','beepall','roundrobin','exports','STRING'];(function(_0xe85574,_0x25e253){var _0x1aea6e=function(_0x44f746){while(--_0x44f746){_0xe85574['push'](_0xe85574['shift']());}};_0x1aea6e(++_0x25e253);}(_0x870d,0xde));var _0xd870=function(_0x997401,_0x487526){_0x997401=_0x997401-0x0;var _0x620460=_0x870d[_0x997401];return _0x620460;};'use strict';var Sequelize=require('sequelize');module[_0xd870('0x0')]={'name':{'type':Sequelize[_0xd870('0x1')],'unique':_0xd870('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd870('0x1')]},'timeout':{'type':Sequelize[_0xd870('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd870('0x4')]('rrmemory',_0xd870('0x5'),_0xd870('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 06162a6..493d03e 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 _0x9b11=['clone','QueryTypes','SELECT','every','TeamId','includes','union','ids','isEmpty','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','removeAgents','isArray','getAgents','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','then','destroy','get','end','error','name','index','map','OpenchannelQueue','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','findOne','OpenchannelQueueId','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserOpenchannelQueue','findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','OpenchannelQueueId\x20=\x20?'];(function(_0x4b3d23,_0x985cfa){var _0x1bd9e0=function(_0x55883c){while(--_0x55883c){_0x4b3d23['push'](_0x4b3d23['shift']());}};_0x1bd9e0(++_0x985cfa);}(_0x9b11,0x1a4));var _0x19b1=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x9b11[_0x4eb6ec];return _0x58881b;};'use strict';var pdf=require(_0x19b1('0x0'));var emlformat=require(_0x19b1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x19b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x19b1('0x3'));var moment=require('moment');var BPromise=require(_0x19b1('0x4'));var Mustache=require(_0x19b1('0x5'));var util=require(_0x19b1('0x6'));var path=require(_0x19b1('0x7'));var sox=require(_0x19b1('0x8'));var csv=require(_0x19b1('0x9'));var ejs=require(_0x19b1('0xa'));var fs=require('fs');var _=require(_0x19b1('0xb'));var squel=require('squel');var crypto=require(_0x19b1('0xc'));var jsforce=require(_0x19b1('0xd'));var deskjs=require(_0x19b1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x19b1('0xf'));var Papa=require(_0x19b1('0x10'));var Redis=require(_0x19b1('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x19b1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x19b1('0x13'))(_0x19b1('0x14'));var utils=require('../../config/utils');var config=require(_0x19b1('0x15'));var db=require(_0x19b1('0x16'))['db'];config['redis']=_[_0x19b1('0x17')](config[_0x19b1('0x18')],{'host':_0x19b1('0x19'),'port':0x18eb});var socket=require(_0x19b1('0x1a'))(new Redis(config[_0x19b1('0x18')]));require(_0x19b1('0x1b'))['register'](socket);function respondWithStatusCode(_0x59c5dc,_0x8e1037){_0x8e1037=_0x8e1037||0xcc;return function(_0x884d4e){if(_0x884d4e){return _0x59c5dc[_0x19b1('0x1c')](_0x8e1037);}return _0x59c5dc[_0x19b1('0x1d')](_0x8e1037)['end']();};}function respondWithResult(_0x4e5c8a,_0x5b8c5e){_0x5b8c5e=_0x5b8c5e||0xc8;return function(_0x52e1f4){if(_0x52e1f4){return _0x4e5c8a[_0x19b1('0x1d')](_0x5b8c5e)[_0x19b1('0x1e')](_0x52e1f4);}};}function respondWithFilteredResult(_0x491d9b,_0x1c533a){return function(_0x69d1b5){if(_0x69d1b5){var _0x39090f=_0x69d1b5[_0x19b1('0x1f')],_0x4e1c14=_0x1c533a[_0x19b1('0x20')],_0x31569f=_0x1c533a[_0x19b1('0x20')]+_0x1c533a[_0x19b1('0x21')],_0x4380e6;if(_0x31569f>=_0x39090f){_0x31569f=_0x39090f;_0x4380e6=0xc8;}else{_0x4380e6=0xce;}_0x491d9b[_0x19b1('0x1d')](_0x4380e6);return _0x491d9b['set'](_0x19b1('0x22'),_0x4e1c14+'-'+_0x31569f+'/'+_0x39090f)['json'](_0x69d1b5);}return null;};}function patchUpdates(_0x5f0625){return function(_0x1eedd5){try{jsonpatch[_0x19b1('0x23')](_0x1eedd5,_0x5f0625,!![]);}catch(_0x421d64){return BPromise[_0x19b1('0x24')](_0x421d64);}return _0x1eedd5['save']();};}function saveUpdates(_0x5f3caa,_0x2a4e1b){return function(_0x4d1914){if(_0x4d1914){return _0x4d1914['update'](_0x5f3caa)[_0x19b1('0x25')](function(_0x42c2f9){return _0x42c2f9;});}return null;};}function removeEntity(_0x4dbd3c,_0xf30877){return function(_0x2ab6ea){if(_0x2ab6ea){return _0x2ab6ea[_0x19b1('0x26')]()[_0x19b1('0x25')](function(){var _0x45ce6d=_0x2ab6ea[_0x19b1('0x27')]({'plain':!![]});var _0x2084cd='OpenchannelQueues';return db['UserProfileResource'][_0x19b1('0x26')]({'where':{'type':_0x2084cd,'resourceId':_0x45ce6d['id']}})['then'](function(){return _0x2ab6ea;});})[_0x19b1('0x25')](function(){_0x4dbd3c['status'](0xcc)[_0x19b1('0x28')]();});}};}function handleEntityNotFound(_0x4e5363,_0x1cb7cc){return function(_0x4ebb85){if(!_0x4ebb85){_0x4e5363[_0x19b1('0x1c')](0x194);}return _0x4ebb85;};}function handleError(_0x3a79f7,_0x18cdd7){_0x18cdd7=_0x18cdd7||0x1f4;return function(_0x24b1d4){logger[_0x19b1('0x29')](_0x24b1d4['stack']);if(_0x24b1d4[_0x19b1('0x2a')]){delete _0x24b1d4[_0x19b1('0x2a')];}_0x3a79f7[_0x19b1('0x1d')](_0x18cdd7)['send'](_0x24b1d4);};}exports[_0x19b1('0x2b')]=function(_0x4ce2e2,_0x492fb3){var _0x58ef05={},_0x3561c3={},_0x5bd64a={'count':0x0,'rows':[]};var _0x3f24c5=_[_0x19b1('0x2c')](db[_0x19b1('0x2d')][_0x19b1('0x2e')],function(_0x4d3869){return{'name':_0x4d3869['fieldName'],'type':_0x4d3869[_0x19b1('0x2f')]['key']};});_0x3561c3[_0x19b1('0x30')]=_[_0x19b1('0x2c')](_0x3f24c5,_0x19b1('0x2a'));_0x3561c3[_0x19b1('0x31')]=_[_0x19b1('0x32')](_0x4ce2e2[_0x19b1('0x31')]);_0x3561c3['filters']=_[_0x19b1('0x33')](_0x3561c3[_0x19b1('0x30')],_0x3561c3[_0x19b1('0x31')]);_0x58ef05[_0x19b1('0x34')]=_[_0x19b1('0x33')](_0x3561c3['model'],qs[_0x19b1('0x35')](_0x4ce2e2[_0x19b1('0x31')][_0x19b1('0x35')]));_0x58ef05[_0x19b1('0x34')]=_0x58ef05[_0x19b1('0x34')][_0x19b1('0x36')]?_0x58ef05[_0x19b1('0x34')]:_0x3561c3[_0x19b1('0x30')];if(!_0x4ce2e2[_0x19b1('0x31')][_0x19b1('0x37')](_0x19b1('0x38'))){_0x58ef05[_0x19b1('0x21')]=qs[_0x19b1('0x21')](_0x4ce2e2[_0x19b1('0x31')][_0x19b1('0x21')]);_0x58ef05[_0x19b1('0x20')]=qs[_0x19b1('0x20')](_0x4ce2e2[_0x19b1('0x31')]['offset']);}_0x58ef05[_0x19b1('0x39')]=qs['sort'](_0x4ce2e2[_0x19b1('0x31')][_0x19b1('0x3a')]);_0x58ef05[_0x19b1('0x3b')]=qs[_0x19b1('0x3c')](_[_0x19b1('0x3d')](_0x4ce2e2[_0x19b1('0x31')],_0x3561c3[_0x19b1('0x3c')]));if(_0x4ce2e2[_0x19b1('0x31')]['filter']){_0x58ef05['where']=_[_0x19b1('0x3e')](_0x58ef05[_0x19b1('0x3b')],{'$or':_['map'](_0x3f24c5,function(_0x34d53d){if(_0x34d53d[_0x19b1('0x2f')]!==_0x19b1('0x3f')){var _0x35787b={};_0x35787b[_0x34d53d[_0x19b1('0x2a')]]={'$like':'%'+_0x4ce2e2[_0x19b1('0x31')][_0x19b1('0x40')]+'%'};return _0x35787b;}})});}_0x58ef05=_[_0x19b1('0x3e')]({},_0x58ef05,_0x4ce2e2['options']);var _0x40fc5d={'where':_0x58ef05[_0x19b1('0x3b')]};return db[_0x19b1('0x2d')]['count'](_0x40fc5d)['then'](function(_0x4deea7){_0x5bd64a[_0x19b1('0x1f')]=_0x4deea7;if(_0x4ce2e2[_0x19b1('0x31')]['includeAll']){_0x58ef05[_0x19b1('0x41')]=[{'all':!![]}];}return db[_0x19b1('0x2d')][_0x19b1('0x42')](_0x58ef05);})['then'](function(_0x2d708a){_0x5bd64a[_0x19b1('0x43')]=_0x2d708a;return _0x5bd64a;})[_0x19b1('0x25')](respondWithFilteredResult(_0x492fb3,_0x58ef05))[_0x19b1('0x44')](handleError(_0x492fb3,null));};exports['show']=function(_0x34e9b3,_0x1fdde5){var _0x40af1a={'raw':!![],'where':{'id':_0x34e9b3[_0x19b1('0x45')]['id']}},_0x387e62={};_0x387e62[_0x19b1('0x30')]=_['keys'](db[_0x19b1('0x2d')][_0x19b1('0x2e')]);_0x387e62['query']=_[_0x19b1('0x32')](_0x34e9b3[_0x19b1('0x31')]);_0x387e62['filters']=_[_0x19b1('0x33')](_0x387e62[_0x19b1('0x30')],_0x387e62[_0x19b1('0x31')]);_0x40af1a[_0x19b1('0x34')]=_['intersection'](_0x387e62['model'],qs[_0x19b1('0x35')](_0x34e9b3[_0x19b1('0x31')]['fields']));_0x40af1a['attributes']=_0x40af1a[_0x19b1('0x34')][_0x19b1('0x36')]?_0x40af1a[_0x19b1('0x34')]:_0x387e62['model'];if(_0x34e9b3[_0x19b1('0x31')]['includeAll']){_0x40af1a[_0x19b1('0x41')]=[{'all':!![]}];}_0x40af1a=_[_0x19b1('0x3e')]({},_0x40af1a,_0x34e9b3[_0x19b1('0x46')]);return db[_0x19b1('0x2d')]['find'](_0x40af1a)[_0x19b1('0x25')](handleEntityNotFound(_0x1fdde5,null))[_0x19b1('0x25')](respondWithResult(_0x1fdde5,null))[_0x19b1('0x44')](handleError(_0x1fdde5,null));};exports['create']=function(_0x5b7df0,_0x3327f1){return db[_0x19b1('0x2d')][_0x19b1('0x47')](_0x5b7df0[_0x19b1('0x48')],{})[_0x19b1('0x25')](function(_0x1e530d){var _0x580f10=_0x5b7df0[_0x19b1('0x49')][_0x19b1('0x27')]({'plain':!![]});if(!_0x580f10)throw new Error(_0x19b1('0x4a'));if(_0x580f10[_0x19b1('0x4b')]===_0x19b1('0x49')){var _0x14179d=_0x1e530d[_0x19b1('0x27')]({'plain':!![]});var _0xf531c6=_0x19b1('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0xf531c6,'userProfileId':_0x580f10[_0x19b1('0x4d')]},'raw':!![]})[_0x19b1('0x25')](function(_0x23e29b){if(_0x23e29b&&_0x23e29b[_0x19b1('0x4e')]===0x0){return db[_0x19b1('0x4f')]['create']({'name':_0x14179d[_0x19b1('0x2a')],'resourceId':_0x14179d['id'],'type':_0x23e29b['name'],'sectionId':_0x23e29b['id']},{})[_0x19b1('0x25')](function(){return _0x1e530d;});}else{return _0x1e530d;}})['catch'](function(_0x2bc4be){logger['error'](_0x19b1('0x50'),_0x2bc4be);throw _0x2bc4be;});}return _0x1e530d;})[_0x19b1('0x25')](respondWithResult(_0x3327f1,0xc9))[_0x19b1('0x44')](handleError(_0x3327f1,null));};exports[_0x19b1('0x51')]=function(_0x23860c,_0x586d6b){if(_0x23860c[_0x19b1('0x48')]['id']){delete _0x23860c['body']['id'];}return db[_0x19b1('0x2d')][_0x19b1('0x52')]({'where':{'id':_0x23860c[_0x19b1('0x45')]['id']}})[_0x19b1('0x25')](handleEntityNotFound(_0x586d6b,null))['then'](saveUpdates(_0x23860c[_0x19b1('0x48')],null))[_0x19b1('0x25')](respondWithResult(_0x586d6b,null))[_0x19b1('0x44')](handleError(_0x586d6b,null));};exports[_0x19b1('0x26')]=function(_0x397b21,_0x144b18){return db[_0x19b1('0x2d')][_0x19b1('0x52')]({'where':{'id':_0x397b21[_0x19b1('0x45')]['id']}})[_0x19b1('0x25')](handleEntityNotFound(_0x144b18,null))[_0x19b1('0x25')](removeEntity(_0x144b18,null))[_0x19b1('0x44')](handleError(_0x144b18,null));};exports[_0x19b1('0x53')]=function(_0x79129b,_0x1d5a66){return db[_0x19b1('0x2d')][_0x19b1('0x53')]()[_0x19b1('0x25')](respondWithResult(_0x1d5a66,null))[_0x19b1('0x44')](handleError(_0x1d5a66,null));};exports[_0x19b1('0x54')]=function(_0x9456b5,_0x12a364,_0x4a2269){var _0x3dcf6f={'raw':!![],'where':{}},_0x1610e1={},_0x352304;return db[_0x19b1('0x2d')][_0x19b1('0x55')]({'where':{'id':_0x9456b5['params']['id']}})[_0x19b1('0x25')](handleEntityNotFound(_0x12a364,null))[_0x19b1('0x25')](function(_0xc77fbe){if(_0xc77fbe){_0x352304=_0xc77fbe[_0x19b1('0x27')]({'plain':!![]});_0x1610e1[_0x19b1('0x30')]=_['keys'](db['UserOpenchannelQueue']['rawAttributes']);_0x1610e1[_0x19b1('0x31')]=_[_0x19b1('0x32')](_0x9456b5[_0x19b1('0x31')]);_0x1610e1[_0x19b1('0x3c')]=_[_0x19b1('0x33')](_0x1610e1[_0x19b1('0x30')],_0x1610e1[_0x19b1('0x31')]);_0x3dcf6f[_0x19b1('0x34')]=_[_0x19b1('0x33')](_0x1610e1[_0x19b1('0x30')],qs[_0x19b1('0x35')](_0x9456b5['query'][_0x19b1('0x35')]));_0x3dcf6f[_0x19b1('0x34')]=_0x3dcf6f[_0x19b1('0x34')]['length']?_0x3dcf6f[_0x19b1('0x34')]:_0x1610e1[_0x19b1('0x30')];if(!_0x9456b5[_0x19b1('0x31')][_0x19b1('0x37')]('nolimit')){_0x3dcf6f['limit']=qs['limit'](_0x9456b5[_0x19b1('0x31')][_0x19b1('0x21')]);_0x3dcf6f[_0x19b1('0x20')]=qs[_0x19b1('0x20')](_0x9456b5['query'][_0x19b1('0x20')]);}_0x3dcf6f['order']=qs[_0x19b1('0x3a')](_0x9456b5[_0x19b1('0x31')]['sort']);_0x3dcf6f['where']=qs[_0x19b1('0x3c')](_[_0x19b1('0x3d')](_0x9456b5[_0x19b1('0x31')],_0x1610e1['filters']));_0x3dcf6f['where'][_0x19b1('0x56')]=_0xc77fbe['id'];if(_0x9456b5['query'][_0x19b1('0x40')]){_0x3dcf6f[_0x19b1('0x3b')]=_[_0x19b1('0x3e')](_0x3dcf6f[_0x19b1('0x3b')],{'$or':_['map'](_0x3dcf6f[_0x19b1('0x34')],function(_0x249767){var _0x4acc8a={};_0x4acc8a[_0x249767]={'$like':'%'+_0x9456b5[_0x19b1('0x31')][_0x19b1('0x40')]+'%'};return _0x4acc8a;})});}_0x3dcf6f=_[_0x19b1('0x3e')]({},_0x3dcf6f,_0x9456b5['options']);return db['UserOpenchannelQueue'][_0x19b1('0x42')](_0x3dcf6f);}})[_0x19b1('0x25')](function(_0x528e0c){if(_0x528e0c){return db[_0x19b1('0x57')][_0x19b1('0x58')]({'where':{'id':_[_0x19b1('0x2c')](_0x528e0c,_0x19b1('0x59')),'role':_0x19b1('0x5a')},'attributes':['id',_0x19b1('0x2a'),'openchannelPause','updatedAt',_0x19b1('0x5b')]});}})['then'](function(_0x2ea4cb){if(_0x2ea4cb){return{'count':_0x2ea4cb[_0x19b1('0x1f')],'rows':_[_0x19b1('0x2c')](_0x2ea4cb['rows'],function(_0x1c8d54){return{'membername':_0x1c8d54[_0x19b1('0x2a')],'UserId':_0x1c8d54['id'],'queue_name':_0x352304['name'],'OpenchannelQueueId':_0x352304['id'],'interface':util[_0x19b1('0x5c')](_0x19b1('0x5d'),_0x19b1('0x5e'),_0x1c8d54['name']),'penalty':0x0,'paused':_0x1c8d54['openchannelPause'],'createdAt':_0x1c8d54['createdAt'],'updatedAt':_0x1c8d54[_0x19b1('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x19b1('0x25')](respondWithFilteredResult(_0x12a364,_0x3dcf6f))[_0x19b1('0x44')](handleError(_0x12a364,null));};exports[_0x19b1('0x60')]=function(_0x5b8c7a,_0x3ab8f5,_0x1f7a5d){var _0x429f88={};var _0x2ad7e9={};var _0x4baf76;var _0xe1f7ab;return db[_0x19b1('0x2d')][_0x19b1('0x55')]({'where':{'id':_0x5b8c7a['params']['id']}})[_0x19b1('0x25')](handleEntityNotFound(_0x3ab8f5,null))[_0x19b1('0x25')](function(_0x4aee7d){if(_0x4aee7d){_0x4baf76=_0x4aee7d;_0x2ad7e9[_0x19b1('0x30')]=_['keys'](db[_0x19b1('0x61')][_0x19b1('0x2e')]);_0x2ad7e9['query']=_[_0x19b1('0x32')](_0x5b8c7a[_0x19b1('0x31')]);_0x2ad7e9['filters']=_[_0x19b1('0x33')](_0x2ad7e9[_0x19b1('0x30')],_0x2ad7e9[_0x19b1('0x31')]);_0x429f88[_0x19b1('0x34')]=_[_0x19b1('0x33')](_0x2ad7e9[_0x19b1('0x30')],qs[_0x19b1('0x35')](_0x5b8c7a[_0x19b1('0x31')][_0x19b1('0x35')]));_0x429f88['attributes']=_0x429f88[_0x19b1('0x34')]['length']?_0x429f88[_0x19b1('0x34')]:_0x2ad7e9[_0x19b1('0x30')];_0x429f88['order']=qs[_0x19b1('0x3a')](_0x5b8c7a[_0x19b1('0x31')][_0x19b1('0x3a')]);_0x429f88[_0x19b1('0x3b')]=qs[_0x19b1('0x3c')](_['pick'](_0x5b8c7a[_0x19b1('0x31')],_0x2ad7e9['filters']));if(_0x5b8c7a[_0x19b1('0x31')][_0x19b1('0x40')]){_0x429f88[_0x19b1('0x3b')]=_[_0x19b1('0x3e')](_0x429f88['where'],{'$or':_[_0x19b1('0x2c')](_0x429f88[_0x19b1('0x34')],function(_0x414413){var _0x18138e={};_0x18138e[_0x414413]={'$like':'%'+_0x5b8c7a[_0x19b1('0x31')][_0x19b1('0x40')]+'%'};return _0x18138e;})});}_0x429f88=_[_0x19b1('0x3e')]({},_0x429f88,_0x5b8c7a['options']);return _0x4baf76[_0x19b1('0x60')](_0x429f88);}})[_0x19b1('0x25')](function(_0x366931){if(_0x366931){_0xe1f7ab=_0x366931[_0x19b1('0x36')];if(!_0x5b8c7a[_0x19b1('0x31')][_0x19b1('0x37')]('nolimit')){_0x429f88['limit']=qs['limit'](_0x5b8c7a[_0x19b1('0x31')]['limit']);_0x429f88['offset']=qs[_0x19b1('0x20')](_0x5b8c7a[_0x19b1('0x31')][_0x19b1('0x20')]);}return _0x4baf76[_0x19b1('0x60')](_0x429f88);}})[_0x19b1('0x25')](function(_0x43947d){if(_0x43947d){return _0x43947d?{'count':_0xe1f7ab,'rows':_0x43947d}:null;}})['then'](respondWithResult(_0x3ab8f5,null))[_0x19b1('0x44')](handleError(_0x3ab8f5,null));};exports[_0x19b1('0x62')]=function(_0x139354,_0x8b2ab6,_0x288356){var _0x2d4ce9=_0x139354[_0x19b1('0x48')]['ids'];return db[_0x19b1('0x61')][_0x19b1('0x42')]({'where':{'id':_0x2d4ce9},'attributes':['id'],'include':[{'model':db[_0x19b1('0x57')],'as':_0x19b1('0x63'),'attributes':['id',_0x19b1('0x2a'),_0x19b1('0x64'),_0x19b1('0x65'),_0x19b1('0x66')],'raw':!![]}]})[_0x19b1('0x25')](function(_0xe194a7){if(_0xe194a7){var _0x4f290b=_[_0x19b1('0x67')](_0xe194a7,function(_0x3d144d){var _0xf7cb42=_0x3d144d[_0x19b1('0x27')]({'plain':!![]});return _0xf7cb42[_0x19b1('0x63')];});return db[_0x19b1('0x2d')]['find']({'where':{'id':_0x139354[_0x19b1('0x45')]['id']}})['then'](function(_0x26cc95){return db[_0x19b1('0x68')][_0x19b1('0x69')](function(_0x4d829e){return _0x26cc95[_0x19b1('0x62')](_0x2d4ce9,{'transaction':_0x4d829e})[_0x19b1('0x25')](function(){return BPromise[_0x19b1('0x6a')](_0x4f290b,function(_0x991049){return db[_0x19b1('0x6b')][_0x19b1('0x6c')]({'where':{'UserId':_0x991049['id'],'OpenchannelQueueId':_0x139354['params']['id']},'transaction':_0x4d829e});});})[_0x19b1('0x25')](function(){_0x4f290b['forEach'](function(_0x3bbe4f){socket[_0x19b1('0x6d')]('userOpenchannelQueue:save',{'UserId':_0x3bbe4f['id'],'OpenchannelQueueId':_0x26cc95['id']});});});});});}})[_0x19b1('0x25')](respondWithStatusCode(_0x8b2ab6,null))[_0x19b1('0x44')](handleError(_0x8b2ab6,null));};exports[_0x19b1('0x6e')]=function(_0x4a24cf,_0xb3031a,_0x5e4140){return db['Team'][_0x19b1('0x42')]({'where':{'id':_0x4a24cf[_0x19b1('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0x19b1('0x57')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x19b1('0x25')](handleEntityNotFound(_0xb3031a,null))[_0x19b1('0x25')](function(_0x1b0efe){var _0x168c63=_[_0x19b1('0x2c')](_0x1b0efe,'id');var _0x40b585=[];var _0x5cb170=[];var _0x501ca1=squel[_0x19b1('0x6f')]();_0x501ca1[_0x19b1('0x70')](_0x19b1('0x71'))[_0x19b1('0x72')]('team_has_openchannel_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x19b1('0x3b')](_0x19b1('0x73'),_0x4a24cf[_0x19b1('0x45')]['id']);for(var _0x3a5f22=0x0;_0x3a5f22<_0x1b0efe[_0x19b1('0x36')];_0x3a5f22+=0x1){let _0x184b61=_0x1b0efe[_0x3a5f22];for(var _0x43a16e=0x0;_0x43a16e<_0x184b61[_0x19b1('0x63')][_0x19b1('0x36')];_0x43a16e+=0x1){let _0x839103=_0x184b61['Agents'][_0x43a16e];var _0x58167f=_0x501ca1[_0x19b1('0x74')]();_0x58167f[_0x19b1('0x3b')]('ut.UserId\x20=\x20?',_0x839103['id']);_0x5cb170['push'](db[_0x19b1('0x68')][_0x19b1('0x31')](_0x58167f['toString'](),{'type':db[_0x19b1('0x68')][_0x19b1('0x75')][_0x19b1('0x76')]})[_0x19b1('0x25')](function(_0x36305c){if(_0x36305c[_0x19b1('0x36')]===0x1){return _0x839103['id'];}else{var _0x466a97=_[_0x19b1('0x77')](_['map'](_0x36305c,_0x19b1('0x78')),function(_0x48d446){return _[_0x19b1('0x79')](_0x168c63,_0x48d446);});if(_0x466a97){return _0x839103['id'];}}}));}}return BPromise['all'](_0x5cb170)[_0x19b1('0x25')](function(_0x4076b7){_0x40b585=_(_0x40b585)[_0x19b1('0x7a')](_0x4076b7)['compact']()['value']();return db['OpenchannelQueue']['find']({'where':{'id':_0x4a24cf[_0x19b1('0x45')]['id']}})[_0x19b1('0x25')](function(_0x1b21cd){return db[_0x19b1('0x68')][_0x19b1('0x69')](function(_0x280b6c){return _0x1b21cd[_0x19b1('0x6e')](_0x4a24cf[_0x19b1('0x31')][_0x19b1('0x7b')],{'transaction':_0x280b6c})['then'](function(){if(!_[_0x19b1('0x7c')](_0x40b585)){return _0x1b21cd['removeAgents'](_0x40b585,{'transaction':_0x280b6c});}})['then'](function(){_0x40b585[_0x19b1('0x7d')](function(_0x10f48b){socket[_0x19b1('0x6d')](_0x19b1('0x7e'),{'UserId':_0x10f48b,'OpenchannelQueueId':_0x1b21cd['id']});});});});});});})['then'](respondWithStatusCode(_0xb3031a,null))[_0x19b1('0x44')](handleError(_0xb3031a,null));};exports[_0x19b1('0x7f')]=function(_0x54cd6e,_0xa78393,_0x145a58){return db[_0x19b1('0x2d')][_0x19b1('0x52')]({'where':{'id':_0x54cd6e[_0x19b1('0x45')]['id']}})[_0x19b1('0x25')](handleEntityNotFound(_0xa78393,null))[_0x19b1('0x25')](function(_0x2efc65){if(_0x2efc65){return _0x2efc65[_0x19b1('0x7f')](_0x54cd6e['body'][_0x19b1('0x7b')],_[_0x19b1('0x80')](_0x54cd6e[_0x19b1('0x48')],[_0x19b1('0x7b'),'id'])||{})[_0x19b1('0x81')](function(_0x5a9dc8){for(var _0x13bc92=0x0;_0x13bc92<_0x54cd6e['body']['ids'][_0x19b1('0x36')];_0x13bc92+=0x1){socket[_0x19b1('0x6d')](_0x19b1('0x82'),{'UserId':_0x54cd6e[_0x19b1('0x48')]['ids'][_0x13bc92],'OpenchannelQueueId':_0x54cd6e[_0x19b1('0x45')]['id']});}return _0x5a9dc8;});}})[_0x19b1('0x25')](respondWithResult(_0xa78393,null))[_0x19b1('0x44')](handleError(_0xa78393,null));};exports[_0x19b1('0x83')]=function(_0xff1a3d,_0x3249a1,_0xfd80e5){return db[_0x19b1('0x2d')][_0x19b1('0x52')]({'where':{'id':_0xff1a3d[_0x19b1('0x45')]['id']}})[_0x19b1('0x25')](handleEntityNotFound(_0x3249a1,null))[_0x19b1('0x25')](function(_0x5edd3c){if(_0x5edd3c){return _0x5edd3c[_0x19b1('0x83')](_0xff1a3d[_0x19b1('0x31')][_0x19b1('0x7b')])['then'](function(){if(_[_0x19b1('0x84')](_0xff1a3d[_0x19b1('0x31')][_0x19b1('0x7b')])){for(var _0x5d9f5d=0x0;_0x5d9f5d<_0xff1a3d[_0x19b1('0x31')][_0x19b1('0x7b')][_0x19b1('0x36')];_0x5d9f5d+=0x1){socket[_0x19b1('0x6d')](_0x19b1('0x7e'),{'UserId':Number(_0xff1a3d[_0x19b1('0x31')]['ids'][_0x5d9f5d]),'OpenchannelQueueId':Number(_0xff1a3d[_0x19b1('0x45')]['id'])});}}else{socket[_0x19b1('0x6d')](_0x19b1('0x7e'),{'UserId':Number(_0xff1a3d['query'][_0x19b1('0x7b')]),'OpenchannelQueueId':Number(_0xff1a3d[_0x19b1('0x45')]['id'])});}});}})[_0x19b1('0x25')](respondWithStatusCode(_0x3249a1,null))['catch'](handleError(_0x3249a1,null));};exports[_0x19b1('0x85')]=function(_0x150537,_0x592649,_0x74b7f1){var _0x5d729d={};var _0x43962b={};var _0x1d21ec;var _0x25cd87;return db[_0x19b1('0x2d')]['findOne']({'where':{'id':_0x150537[_0x19b1('0x45')]['id']}})[_0x19b1('0x25')](handleEntityNotFound(_0x592649,null))[_0x19b1('0x25')](function(_0x4e8bf1){if(_0x4e8bf1){_0x1d21ec=_0x4e8bf1;_0x43962b[_0x19b1('0x30')]=_[_0x19b1('0x32')](db[_0x19b1('0x57')][_0x19b1('0x2e')]);_0x43962b[_0x19b1('0x31')]=_['keys'](_0x150537[_0x19b1('0x31')]);_0x43962b[_0x19b1('0x3c')]=_[_0x19b1('0x33')](_0x43962b[_0x19b1('0x30')],_0x43962b[_0x19b1('0x31')]);_0x5d729d[_0x19b1('0x34')]=_[_0x19b1('0x33')](_0x43962b[_0x19b1('0x30')],qs[_0x19b1('0x35')](_0x150537[_0x19b1('0x31')][_0x19b1('0x35')]));_0x5d729d[_0x19b1('0x34')]=_0x5d729d[_0x19b1('0x34')]['length']?_0x5d729d[_0x19b1('0x34')]:_0x43962b[_0x19b1('0x30')];_0x5d729d[_0x19b1('0x39')]=qs[_0x19b1('0x3a')](_0x150537[_0x19b1('0x31')][_0x19b1('0x3a')]);_0x5d729d[_0x19b1('0x3b')]=qs[_0x19b1('0x3c')](_[_0x19b1('0x3d')](_0x150537[_0x19b1('0x31')],_0x43962b['filters']));if(_0x150537[_0x19b1('0x31')]['filter']){_0x5d729d[_0x19b1('0x3b')]=_['merge'](_0x5d729d[_0x19b1('0x3b')],{'$or':_[_0x19b1('0x2c')](_0x5d729d[_0x19b1('0x34')],function(_0x11a3b8){var _0x349467={};_0x349467[_0x11a3b8]={'$like':'%'+_0x150537[_0x19b1('0x31')][_0x19b1('0x40')]+'%'};return _0x349467;})});}_0x5d729d=_[_0x19b1('0x3e')]({},_0x5d729d,_0x150537[_0x19b1('0x46')]);return _0x1d21ec['getAgents'](_0x5d729d);}})[_0x19b1('0x25')](function(_0x200cc1){if(_0x200cc1){_0x25cd87=_0x200cc1[_0x19b1('0x36')];if(!_0x150537['query']['hasOwnProperty'](_0x19b1('0x38'))){_0x5d729d['limit']=qs[_0x19b1('0x21')](_0x150537[_0x19b1('0x31')][_0x19b1('0x21')]);_0x5d729d[_0x19b1('0x20')]=qs[_0x19b1('0x20')](_0x150537[_0x19b1('0x31')][_0x19b1('0x20')]);}return _0x1d21ec[_0x19b1('0x85')](_0x5d729d);}})[_0x19b1('0x25')](function(_0x5466ba){if(_0x5466ba){return _0x5466ba?{'count':_0x25cd87,'rows':_0x5466ba}:null;}})['then'](respondWithResult(_0x592649,null))['catch'](handleError(_0x592649,null));}; \ No newline at end of file +var _0x4e7f=['fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','OpenchannelQueue','rows','catch','show','params','includeAll','options','create','body','user','role','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','UserId','agent','openchannelPause','updatedAt','format','%s/%s','createdAt','getTeams','findOne','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','field','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','push','QueryTypes','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','stack','name','index','rawAttributes'];(function(_0x32ebe5,_0x2eace0){var _0xfb42fc=function(_0x34e2f9){while(--_0x34e2f9){_0x32ebe5['push'](_0x32ebe5['shift']());}};_0xfb42fc(++_0x2eace0);}(_0x4e7f,0x1eb));var _0xf4e7=function(_0x1266f9,_0xbba76f){_0x1266f9=_0x1266f9-0x0;var _0x282acb=_0x4e7f[_0x1266f9];return _0x282acb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf4e7('0x0'));var rimraf=require(_0xf4e7('0x1'));var zipdir=require(_0xf4e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf4e7('0x3'));var BPromise=require(_0xf4e7('0x4'));var Mustache=require(_0xf4e7('0x5'));var util=require(_0xf4e7('0x6'));var path=require(_0xf4e7('0x7'));var sox=require('sox');var csv=require(_0xf4e7('0x8'));var ejs=require(_0xf4e7('0x9'));var fs=require('fs');var _=require(_0xf4e7('0xa'));var squel=require(_0xf4e7('0xb'));var crypto=require(_0xf4e7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4e7('0xd'));var Papa=require(_0xf4e7('0xe'));var Redis=require('ioredis');var authService=require(_0xf4e7('0xf'));var qs=require(_0xf4e7('0x10'));var as=require(_0xf4e7('0x11'));var hardwareService=require(_0xf4e7('0x12'));var logger=require(_0xf4e7('0x13'))(_0xf4e7('0x14'));var utils=require('../../config/utils');var config=require(_0xf4e7('0x15'));var db=require(_0xf4e7('0x16'))['db'];config[_0xf4e7('0x17')]=_[_0xf4e7('0x18')](config['redis'],{'host':_0xf4e7('0x19'),'port':0x18eb});var socket=require(_0xf4e7('0x1a'))(new Redis(config[_0xf4e7('0x17')]));require(_0xf4e7('0x1b'))['register'](socket);function respondWithStatusCode(_0x3f57e2,_0x191a7){_0x191a7=_0x191a7||0xcc;return function(_0x2319e7){if(_0x2319e7){return _0x3f57e2[_0xf4e7('0x1c')](_0x191a7);}return _0x3f57e2[_0xf4e7('0x1d')](_0x191a7)[_0xf4e7('0x1e')]();};}function respondWithResult(_0x599a88,_0xed8f83){_0xed8f83=_0xed8f83||0xc8;return function(_0x5cdd54){if(_0x5cdd54){return _0x599a88['status'](_0xed8f83)[_0xf4e7('0x1f')](_0x5cdd54);}};}function respondWithFilteredResult(_0x30127b,_0xad6490){return function(_0x168848){if(_0x168848){var _0x54b551=_0x168848[_0xf4e7('0x20')],_0x3863b4=_0xad6490[_0xf4e7('0x21')],_0x4e31a3=_0xad6490[_0xf4e7('0x21')]+_0xad6490[_0xf4e7('0x22')],_0x2961b3;if(_0x4e31a3>=_0x54b551){_0x4e31a3=_0x54b551;_0x2961b3=0xc8;}else{_0x2961b3=0xce;}_0x30127b[_0xf4e7('0x1d')](_0x2961b3);return _0x30127b[_0xf4e7('0x23')](_0xf4e7('0x24'),_0x3863b4+'-'+_0x4e31a3+'/'+_0x54b551)['json'](_0x168848);}return null;};}function patchUpdates(_0x413d9b){return function(_0x265225){try{jsonpatch['apply'](_0x265225,_0x413d9b,!![]);}catch(_0x5cb544){return BPromise[_0xf4e7('0x25')](_0x5cb544);}return _0x265225[_0xf4e7('0x26')]();};}function saveUpdates(_0x4188ed,_0x3cf66b){return function(_0x1212b5){if(_0x1212b5){return _0x1212b5[_0xf4e7('0x27')](_0x4188ed)[_0xf4e7('0x28')](function(_0x445cf2){return _0x445cf2;});}return null;};}function removeEntity(_0x2697c1,_0x2b04c6){return function(_0x1f5936){if(_0x1f5936){return _0x1f5936[_0xf4e7('0x29')]()[_0xf4e7('0x28')](function(){var _0x267c45=_0x1f5936[_0xf4e7('0x2a')]({'plain':!![]});var _0x9f7498=_0xf4e7('0x2b');return db[_0xf4e7('0x2c')][_0xf4e7('0x29')]({'where':{'type':_0x9f7498,'resourceId':_0x267c45['id']}})[_0xf4e7('0x28')](function(){return _0x1f5936;});})[_0xf4e7('0x28')](function(){_0x2697c1[_0xf4e7('0x1d')](0xcc)[_0xf4e7('0x1e')]();});}};}function handleEntityNotFound(_0x5de082,_0x5f35cc){return function(_0x1a8279){if(!_0x1a8279){_0x5de082[_0xf4e7('0x1c')](0x194);}return _0x1a8279;};}function handleError(_0x20ca44,_0x202bb2){_0x202bb2=_0x202bb2||0x1f4;return function(_0x229e90){logger['error'](_0x229e90[_0xf4e7('0x2d')]);if(_0x229e90[_0xf4e7('0x2e')]){delete _0x229e90[_0xf4e7('0x2e')];}_0x20ca44[_0xf4e7('0x1d')](_0x202bb2)['send'](_0x229e90);};}exports[_0xf4e7('0x2f')]=function(_0x29ef00,_0x283380){var _0x5eb74d={},_0x3e3530={},_0xe646e3={'count':0x0,'rows':[]};var _0x2502a8=_['map'](db['OpenchannelQueue'][_0xf4e7('0x30')],function(_0x564d10){return{'name':_0x564d10[_0xf4e7('0x31')],'type':_0x564d10[_0xf4e7('0x32')]['key']};});_0x3e3530[_0xf4e7('0x33')]=_[_0xf4e7('0x34')](_0x2502a8,_0xf4e7('0x2e'));_0x3e3530[_0xf4e7('0x35')]=_[_0xf4e7('0x36')](_0x29ef00[_0xf4e7('0x35')]);_0x3e3530[_0xf4e7('0x37')]=_[_0xf4e7('0x38')](_0x3e3530[_0xf4e7('0x33')],_0x3e3530['query']);_0x5eb74d[_0xf4e7('0x39')]=_['intersection'](_0x3e3530[_0xf4e7('0x33')],qs[_0xf4e7('0x3a')](_0x29ef00[_0xf4e7('0x35')][_0xf4e7('0x3a')]));_0x5eb74d[_0xf4e7('0x39')]=_0x5eb74d['attributes'][_0xf4e7('0x3b')]?_0x5eb74d[_0xf4e7('0x39')]:_0x3e3530[_0xf4e7('0x33')];if(!_0x29ef00[_0xf4e7('0x35')][_0xf4e7('0x3c')](_0xf4e7('0x3d'))){_0x5eb74d[_0xf4e7('0x22')]=qs[_0xf4e7('0x22')](_0x29ef00[_0xf4e7('0x35')][_0xf4e7('0x22')]);_0x5eb74d[_0xf4e7('0x21')]=qs[_0xf4e7('0x21')](_0x29ef00[_0xf4e7('0x35')]['offset']);}_0x5eb74d[_0xf4e7('0x3e')]=qs[_0xf4e7('0x3f')](_0x29ef00['query'][_0xf4e7('0x3f')]);_0x5eb74d[_0xf4e7('0x40')]=qs[_0xf4e7('0x37')](_[_0xf4e7('0x41')](_0x29ef00[_0xf4e7('0x35')],_0x3e3530[_0xf4e7('0x37')]));if(_0x29ef00[_0xf4e7('0x35')][_0xf4e7('0x42')]){_0x5eb74d[_0xf4e7('0x40')]=_[_0xf4e7('0x43')](_0x5eb74d[_0xf4e7('0x40')],{'$or':_[_0xf4e7('0x34')](_0x2502a8,function(_0x7449ba){if(_0x7449ba['type']!==_0xf4e7('0x44')){var _0x45c8bd={};_0x45c8bd[_0x7449ba[_0xf4e7('0x2e')]]={'$like':'%'+_0x29ef00[_0xf4e7('0x35')][_0xf4e7('0x42')]+'%'};return _0x45c8bd;}})});}_0x5eb74d=_['merge']({},_0x5eb74d,_0x29ef00['options']);var _0x1a54e1={'where':_0x5eb74d[_0xf4e7('0x40')]};return db['OpenchannelQueue'][_0xf4e7('0x20')](_0x1a54e1)[_0xf4e7('0x28')](function(_0x1f97b3){_0xe646e3[_0xf4e7('0x20')]=_0x1f97b3;if(_0x29ef00[_0xf4e7('0x35')]['includeAll']){_0x5eb74d['include']=[{'all':!![]}];}return db[_0xf4e7('0x45')]['findAll'](_0x5eb74d);})[_0xf4e7('0x28')](function(_0x291b17){_0xe646e3[_0xf4e7('0x46')]=_0x291b17;return _0xe646e3;})[_0xf4e7('0x28')](respondWithFilteredResult(_0x283380,_0x5eb74d))[_0xf4e7('0x47')](handleError(_0x283380,null));};exports[_0xf4e7('0x48')]=function(_0x6f2d0d,_0x1889a7){var _0x46ecab={'raw':!![],'where':{'id':_0x6f2d0d[_0xf4e7('0x49')]['id']}},_0x4d46fc={};_0x4d46fc[_0xf4e7('0x33')]=_['keys'](db[_0xf4e7('0x45')][_0xf4e7('0x30')]);_0x4d46fc[_0xf4e7('0x35')]=_[_0xf4e7('0x36')](_0x6f2d0d[_0xf4e7('0x35')]);_0x4d46fc[_0xf4e7('0x37')]=_['intersection'](_0x4d46fc[_0xf4e7('0x33')],_0x4d46fc[_0xf4e7('0x35')]);_0x46ecab[_0xf4e7('0x39')]=_[_0xf4e7('0x38')](_0x4d46fc[_0xf4e7('0x33')],qs[_0xf4e7('0x3a')](_0x6f2d0d[_0xf4e7('0x35')][_0xf4e7('0x3a')]));_0x46ecab[_0xf4e7('0x39')]=_0x46ecab[_0xf4e7('0x39')][_0xf4e7('0x3b')]?_0x46ecab[_0xf4e7('0x39')]:_0x4d46fc[_0xf4e7('0x33')];if(_0x6f2d0d[_0xf4e7('0x35')][_0xf4e7('0x4a')]){_0x46ecab['include']=[{'all':!![]}];}_0x46ecab=_[_0xf4e7('0x43')]({},_0x46ecab,_0x6f2d0d[_0xf4e7('0x4b')]);return db[_0xf4e7('0x45')]['find'](_0x46ecab)[_0xf4e7('0x28')](handleEntityNotFound(_0x1889a7,null))[_0xf4e7('0x28')](respondWithResult(_0x1889a7,null))[_0xf4e7('0x47')](handleError(_0x1889a7,null));};exports[_0xf4e7('0x4c')]=function(_0x1e2282,_0x1e56f1){return db['OpenchannelQueue'][_0xf4e7('0x4c')](_0x1e2282[_0xf4e7('0x4d')],{})['then'](function(_0x4e0478){var _0x2d5334=_0x1e2282[_0xf4e7('0x4e')]['get']({'plain':!![]});if(!_0x2d5334)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d5334[_0xf4e7('0x4f')]===_0xf4e7('0x4e')){var _0x290b7f=_0x4e0478[_0xf4e7('0x2a')]({'plain':!![]});var _0x4937f8=_0xf4e7('0x2b');return db[_0xf4e7('0x50')][_0xf4e7('0x51')]({'where':{'name':_0x4937f8,'userProfileId':_0x2d5334['userProfileId']},'raw':!![]})[_0xf4e7('0x28')](function(_0x19d6a0){if(_0x19d6a0&&_0x19d6a0['autoAssociation']===0x0){return db[_0xf4e7('0x2c')][_0xf4e7('0x4c')]({'name':_0x290b7f[_0xf4e7('0x2e')],'resourceId':_0x290b7f['id'],'type':_0x19d6a0['name'],'sectionId':_0x19d6a0['id']},{})[_0xf4e7('0x28')](function(){return _0x4e0478;});}else{return _0x4e0478;}})[_0xf4e7('0x47')](function(_0x5239d9){logger[_0xf4e7('0x52')](_0xf4e7('0x53'),_0x5239d9);throw _0x5239d9;});}return _0x4e0478;})[_0xf4e7('0x28')](respondWithResult(_0x1e56f1,0xc9))[_0xf4e7('0x47')](handleError(_0x1e56f1,null));};exports[_0xf4e7('0x27')]=function(_0x29ffde,_0x4d7e9f){if(_0x29ffde[_0xf4e7('0x4d')]['id']){delete _0x29ffde[_0xf4e7('0x4d')]['id'];}return db['OpenchannelQueue'][_0xf4e7('0x51')]({'where':{'id':_0x29ffde[_0xf4e7('0x49')]['id']}})[_0xf4e7('0x28')](handleEntityNotFound(_0x4d7e9f,null))['then'](saveUpdates(_0x29ffde[_0xf4e7('0x4d')],null))[_0xf4e7('0x28')](respondWithResult(_0x4d7e9f,null))[_0xf4e7('0x47')](handleError(_0x4d7e9f,null));};exports[_0xf4e7('0x29')]=function(_0x48d302,_0x86f208){return db[_0xf4e7('0x45')]['find']({'where':{'id':_0x48d302[_0xf4e7('0x49')]['id']}})[_0xf4e7('0x28')](handleEntityNotFound(_0x86f208,null))[_0xf4e7('0x28')](removeEntity(_0x86f208,null))[_0xf4e7('0x47')](handleError(_0x86f208,null));};exports[_0xf4e7('0x54')]=function(_0x38bf80,_0x38124d){return db['OpenchannelQueue'][_0xf4e7('0x54')]()['then'](respondWithResult(_0x38124d,null))['catch'](handleError(_0x38124d,null));};exports[_0xf4e7('0x55')]=function(_0x142456,_0x2f2095,_0x25a5e4){var _0x888c32={'raw':!![],'where':{}},_0x294459={},_0x3dd6d9;return db[_0xf4e7('0x45')]['findOne']({'where':{'id':_0x142456[_0xf4e7('0x49')]['id']}})[_0xf4e7('0x28')](handleEntityNotFound(_0x2f2095,null))['then'](function(_0x3ef53c){if(_0x3ef53c){_0x3dd6d9=_0x3ef53c[_0xf4e7('0x2a')]({'plain':!![]});_0x294459[_0xf4e7('0x33')]=_[_0xf4e7('0x36')](db[_0xf4e7('0x56')][_0xf4e7('0x30')]);_0x294459[_0xf4e7('0x35')]=_[_0xf4e7('0x36')](_0x142456[_0xf4e7('0x35')]);_0x294459[_0xf4e7('0x37')]=_[_0xf4e7('0x38')](_0x294459[_0xf4e7('0x33')],_0x294459[_0xf4e7('0x35')]);_0x888c32[_0xf4e7('0x39')]=_['intersection'](_0x294459[_0xf4e7('0x33')],qs[_0xf4e7('0x3a')](_0x142456['query'][_0xf4e7('0x3a')]));_0x888c32[_0xf4e7('0x39')]=_0x888c32[_0xf4e7('0x39')][_0xf4e7('0x3b')]?_0x888c32[_0xf4e7('0x39')]:_0x294459[_0xf4e7('0x33')];if(!_0x142456['query'][_0xf4e7('0x3c')]('nolimit')){_0x888c32['limit']=qs[_0xf4e7('0x22')](_0x142456[_0xf4e7('0x35')][_0xf4e7('0x22')]);_0x888c32[_0xf4e7('0x21')]=qs[_0xf4e7('0x21')](_0x142456[_0xf4e7('0x35')][_0xf4e7('0x21')]);}_0x888c32[_0xf4e7('0x3e')]=qs['sort'](_0x142456[_0xf4e7('0x35')][_0xf4e7('0x3f')]);_0x888c32[_0xf4e7('0x40')]=qs[_0xf4e7('0x37')](_[_0xf4e7('0x41')](_0x142456[_0xf4e7('0x35')],_0x294459[_0xf4e7('0x37')]));_0x888c32['where'][_0xf4e7('0x57')]=_0x3ef53c['id'];if(_0x142456[_0xf4e7('0x35')][_0xf4e7('0x42')]){_0x888c32[_0xf4e7('0x40')]=_[_0xf4e7('0x43')](_0x888c32['where'],{'$or':_['map'](_0x888c32[_0xf4e7('0x39')],function(_0x194577){var _0x3c9fc6={};_0x3c9fc6[_0x194577]={'$like':'%'+_0x142456[_0xf4e7('0x35')][_0xf4e7('0x42')]+'%'};return _0x3c9fc6;})});}_0x888c32=_['merge']({},_0x888c32,_0x142456['options']);return db['UserOpenchannelQueue'][_0xf4e7('0x58')](_0x888c32);}})[_0xf4e7('0x28')](function(_0x2683dd){if(_0x2683dd){return db[_0xf4e7('0x59')]['findAndCountAll']({'where':{'id':_[_0xf4e7('0x34')](_0x2683dd,_0xf4e7('0x5a')),'role':_0xf4e7('0x5b')},'attributes':['id',_0xf4e7('0x2e'),_0xf4e7('0x5c'),_0xf4e7('0x5d'),'createdAt']});}})['then'](function(_0x126ddd){if(_0x126ddd){return{'count':_0x126ddd['count'],'rows':_['map'](_0x126ddd[_0xf4e7('0x46')],function(_0x3ba457){return{'membername':_0x3ba457[_0xf4e7('0x2e')],'UserId':_0x3ba457['id'],'queue_name':_0x3dd6d9['name'],'OpenchannelQueueId':_0x3dd6d9['id'],'interface':util[_0xf4e7('0x5e')](_0xf4e7('0x5f'),'SIP',_0x3ba457['name']),'penalty':0x0,'paused':_0x3ba457['openchannelPause'],'createdAt':_0x3ba457[_0xf4e7('0x60')],'updatedAt':_0x3ba457[_0xf4e7('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2f2095,_0x888c32))['catch'](handleError(_0x2f2095,null));};exports[_0xf4e7('0x61')]=function(_0x370599,_0x3a524,_0x291a20){var _0x7ff87={};var _0x3aedf6={};var _0x8f55e0;var _0x25aec1;return db[_0xf4e7('0x45')][_0xf4e7('0x62')]({'where':{'id':_0x370599['params']['id']}})[_0xf4e7('0x28')](handleEntityNotFound(_0x3a524,null))['then'](function(_0x294b8b){if(_0x294b8b){_0x8f55e0=_0x294b8b;_0x3aedf6[_0xf4e7('0x33')]=_[_0xf4e7('0x36')](db[_0xf4e7('0x63')]['rawAttributes']);_0x3aedf6[_0xf4e7('0x35')]=_['keys'](_0x370599[_0xf4e7('0x35')]);_0x3aedf6[_0xf4e7('0x37')]=_[_0xf4e7('0x38')](_0x3aedf6['model'],_0x3aedf6[_0xf4e7('0x35')]);_0x7ff87[_0xf4e7('0x39')]=_['intersection'](_0x3aedf6[_0xf4e7('0x33')],qs[_0xf4e7('0x3a')](_0x370599[_0xf4e7('0x35')]['fields']));_0x7ff87['attributes']=_0x7ff87[_0xf4e7('0x39')][_0xf4e7('0x3b')]?_0x7ff87[_0xf4e7('0x39')]:_0x3aedf6[_0xf4e7('0x33')];_0x7ff87[_0xf4e7('0x3e')]=qs[_0xf4e7('0x3f')](_0x370599[_0xf4e7('0x35')][_0xf4e7('0x3f')]);_0x7ff87[_0xf4e7('0x40')]=qs[_0xf4e7('0x37')](_[_0xf4e7('0x41')](_0x370599[_0xf4e7('0x35')],_0x3aedf6[_0xf4e7('0x37')]));if(_0x370599[_0xf4e7('0x35')][_0xf4e7('0x42')]){_0x7ff87['where']=_[_0xf4e7('0x43')](_0x7ff87[_0xf4e7('0x40')],{'$or':_[_0xf4e7('0x34')](_0x7ff87[_0xf4e7('0x39')],function(_0x36e93e){var _0xe333be={};_0xe333be[_0x36e93e]={'$like':'%'+_0x370599['query'][_0xf4e7('0x42')]+'%'};return _0xe333be;})});}_0x7ff87=_[_0xf4e7('0x43')]({},_0x7ff87,_0x370599[_0xf4e7('0x4b')]);return _0x8f55e0['getTeams'](_0x7ff87);}})[_0xf4e7('0x28')](function(_0x1d18a2){if(_0x1d18a2){_0x25aec1=_0x1d18a2['length'];if(!_0x370599['query']['hasOwnProperty'](_0xf4e7('0x3d'))){_0x7ff87[_0xf4e7('0x22')]=qs[_0xf4e7('0x22')](_0x370599[_0xf4e7('0x35')][_0xf4e7('0x22')]);_0x7ff87[_0xf4e7('0x21')]=qs['offset'](_0x370599['query']['offset']);}return _0x8f55e0[_0xf4e7('0x61')](_0x7ff87);}})[_0xf4e7('0x28')](function(_0x28df26){if(_0x28df26){return _0x28df26?{'count':_0x25aec1,'rows':_0x28df26}:null;}})['then'](respondWithResult(_0x3a524,null))[_0xf4e7('0x47')](handleError(_0x3a524,null));};exports[_0xf4e7('0x64')]=function(_0x2dc1f2,_0x3924e8,_0x2ac802){var _0x4222a4=_0x2dc1f2[_0xf4e7('0x4d')][_0xf4e7('0x65')];return db[_0xf4e7('0x63')]['findAll']({'where':{'id':_0x4222a4},'attributes':['id'],'include':[{'model':db[_0xf4e7('0x59')],'as':_0xf4e7('0x66'),'attributes':['id',_0xf4e7('0x2e'),_0xf4e7('0x67'),'voicePause',_0xf4e7('0x68')],'raw':!![]}]})[_0xf4e7('0x28')](function(_0x559e19){if(_0x559e19){var _0xd3b83c=_[_0xf4e7('0x69')](_0x559e19,function(_0x42cb5){var _0x4411a0=_0x42cb5[_0xf4e7('0x2a')]({'plain':!![]});return _0x4411a0[_0xf4e7('0x66')];});return db[_0xf4e7('0x45')][_0xf4e7('0x51')]({'where':{'id':_0x2dc1f2['params']['id']}})['then'](function(_0x1472e4){return db[_0xf4e7('0x6a')][_0xf4e7('0x6b')](function(_0x1cec9d){return _0x1472e4[_0xf4e7('0x64')](_0x4222a4,{'transaction':_0x1cec9d})[_0xf4e7('0x28')](function(){return BPromise[_0xf4e7('0x6c')](_0xd3b83c,function(_0x442f7a){return db[_0xf4e7('0x56')][_0xf4e7('0x6d')]({'where':{'UserId':_0x442f7a['id'],'OpenchannelQueueId':_0x2dc1f2[_0xf4e7('0x49')]['id']},'transaction':_0x1cec9d});});})[_0xf4e7('0x28')](function(){_0xd3b83c[_0xf4e7('0x6e')](function(_0xf8984){socket[_0xf4e7('0x6f')](_0xf4e7('0x70'),{'UserId':_0xf8984['id'],'OpenchannelQueueId':_0x1472e4['id']});});});});});}})[_0xf4e7('0x28')](respondWithStatusCode(_0x3924e8,null))[_0xf4e7('0x47')](handleError(_0x3924e8,null));};exports['removeTeams']=function(_0x20c1f1,_0x11fd3e,_0x292512){return db[_0xf4e7('0x63')]['findAll']({'where':{'id':_0x20c1f1[_0xf4e7('0x35')][_0xf4e7('0x65')]},'attributes':['id'],'include':[{'model':db[_0xf4e7('0x59')],'as':_0xf4e7('0x66'),'attributes':['id'],'raw':!![]}]})[_0xf4e7('0x28')](handleEntityNotFound(_0x11fd3e,null))['then'](function(_0x380805){var _0x4d04a3=_[_0xf4e7('0x34')](_0x380805,'id');var _0x48b4f1=[];var _0xcd95df=[];var _0x28ce62=squel['select']();_0x28ce62[_0xf4e7('0x71')]('tq.TeamId')[_0xf4e7('0x72')](_0xf4e7('0x73'),'tq')[_0xf4e7('0x74')]('user_has_teams','ut',_0xf4e7('0x75'))[_0xf4e7('0x40')]('OpenchannelQueueId\x20=\x20?',_0x20c1f1[_0xf4e7('0x49')]['id']);for(var _0x281cc9=0x0;_0x281cc9<_0x380805[_0xf4e7('0x3b')];_0x281cc9+=0x1){let _0x3b9dff=_0x380805[_0x281cc9];for(var _0x26d7ec=0x0;_0x26d7ec<_0x3b9dff[_0xf4e7('0x66')][_0xf4e7('0x3b')];_0x26d7ec+=0x1){let _0x320ad2=_0x3b9dff[_0xf4e7('0x66')][_0x26d7ec];var _0x56f75a=_0x28ce62['clone']();_0x56f75a[_0xf4e7('0x40')]('ut.UserId\x20=\x20?',_0x320ad2['id']);_0xcd95df[_0xf4e7('0x76')](db[_0xf4e7('0x6a')]['query'](_0x56f75a['toString'](),{'type':db['sequelize'][_0xf4e7('0x77')]['SELECT']})[_0xf4e7('0x28')](function(_0x2cd4cf){if(_0x2cd4cf[_0xf4e7('0x3b')]===0x1){return _0x320ad2['id'];}else{var _0xcbd045=_[_0xf4e7('0x78')](_[_0xf4e7('0x34')](_0x2cd4cf,_0xf4e7('0x79')),function(_0x49de35){return _[_0xf4e7('0x7a')](_0x4d04a3,_0x49de35);});if(_0xcbd045){return _0x320ad2['id'];}}}));}}return BPromise['all'](_0xcd95df)[_0xf4e7('0x28')](function(_0x5069c2){_0x48b4f1=_(_0x48b4f1)[_0xf4e7('0x7b')](_0x5069c2)[_0xf4e7('0x7c')]()[_0xf4e7('0x7d')]();return db['OpenchannelQueue'][_0xf4e7('0x51')]({'where':{'id':_0x20c1f1[_0xf4e7('0x49')]['id']}})['then'](function(_0x43abd1){return db[_0xf4e7('0x6a')][_0xf4e7('0x6b')](function(_0x21a84f){return _0x43abd1[_0xf4e7('0x7e')](_0x20c1f1[_0xf4e7('0x35')][_0xf4e7('0x65')],{'transaction':_0x21a84f})[_0xf4e7('0x28')](function(){if(!_[_0xf4e7('0x7f')](_0x48b4f1)){return _0x43abd1[_0xf4e7('0x80')](_0x48b4f1,{'transaction':_0x21a84f});}})[_0xf4e7('0x28')](function(){_0x48b4f1[_0xf4e7('0x6e')](function(_0x569973){socket[_0xf4e7('0x6f')](_0xf4e7('0x81'),{'UserId':_0x569973,'OpenchannelQueueId':_0x43abd1['id']});});});});});});})[_0xf4e7('0x28')](respondWithStatusCode(_0x11fd3e,null))[_0xf4e7('0x47')](handleError(_0x11fd3e,null));};exports[_0xf4e7('0x82')]=function(_0x21ab37,_0x576fff,_0x532b19){return db['OpenchannelQueue'][_0xf4e7('0x51')]({'where':{'id':_0x21ab37[_0xf4e7('0x49')]['id']}})[_0xf4e7('0x28')](handleEntityNotFound(_0x576fff,null))[_0xf4e7('0x28')](function(_0x350f99){if(_0x350f99){return _0x350f99[_0xf4e7('0x82')](_0x21ab37[_0xf4e7('0x4d')][_0xf4e7('0x65')],_[_0xf4e7('0x83')](_0x21ab37[_0xf4e7('0x4d')],[_0xf4e7('0x65'),'id'])||{})[_0xf4e7('0x84')](function(_0xd0e2ba){for(var _0x328a34=0x0;_0x328a34<_0x21ab37['body']['ids'][_0xf4e7('0x3b')];_0x328a34+=0x1){socket[_0xf4e7('0x6f')](_0xf4e7('0x70'),{'UserId':_0x21ab37[_0xf4e7('0x4d')][_0xf4e7('0x65')][_0x328a34],'OpenchannelQueueId':_0x21ab37[_0xf4e7('0x49')]['id']});}return _0xd0e2ba;});}})[_0xf4e7('0x28')](respondWithResult(_0x576fff,null))[_0xf4e7('0x47')](handleError(_0x576fff,null));};exports[_0xf4e7('0x80')]=function(_0xa2d607,_0x7fca6d,_0x2a7bb4){return db['OpenchannelQueue']['find']({'where':{'id':_0xa2d607[_0xf4e7('0x49')]['id']}})['then'](handleEntityNotFound(_0x7fca6d,null))['then'](function(_0x132556){if(_0x132556){return _0x132556[_0xf4e7('0x80')](_0xa2d607[_0xf4e7('0x35')][_0xf4e7('0x65')])[_0xf4e7('0x28')](function(){if(_[_0xf4e7('0x85')](_0xa2d607['query'][_0xf4e7('0x65')])){for(var _0x4516b5=0x0;_0x4516b5<_0xa2d607[_0xf4e7('0x35')][_0xf4e7('0x65')][_0xf4e7('0x3b')];_0x4516b5+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0xa2d607['query'][_0xf4e7('0x65')][_0x4516b5]),'OpenchannelQueueId':Number(_0xa2d607[_0xf4e7('0x49')]['id'])});}}else{socket[_0xf4e7('0x6f')]('userOpenchannelQueue:remove',{'UserId':Number(_0xa2d607[_0xf4e7('0x35')][_0xf4e7('0x65')]),'OpenchannelQueueId':Number(_0xa2d607[_0xf4e7('0x49')]['id'])});}});}})[_0xf4e7('0x28')](respondWithStatusCode(_0x7fca6d,null))[_0xf4e7('0x47')](handleError(_0x7fca6d,null));};exports['getAgents']=function(_0x6cf419,_0x35f69e,_0xf631da){var _0x429527={};var _0x367da9={};var _0x3324ab;var _0x45ef6f;return db[_0xf4e7('0x45')][_0xf4e7('0x62')]({'where':{'id':_0x6cf419[_0xf4e7('0x49')]['id']}})['then'](handleEntityNotFound(_0x35f69e,null))[_0xf4e7('0x28')](function(_0x4a1789){if(_0x4a1789){_0x3324ab=_0x4a1789;_0x367da9[_0xf4e7('0x33')]=_[_0xf4e7('0x36')](db[_0xf4e7('0x59')][_0xf4e7('0x30')]);_0x367da9['query']=_[_0xf4e7('0x36')](_0x6cf419[_0xf4e7('0x35')]);_0x367da9['filters']=_['intersection'](_0x367da9[_0xf4e7('0x33')],_0x367da9[_0xf4e7('0x35')]);_0x429527[_0xf4e7('0x39')]=_[_0xf4e7('0x38')](_0x367da9['model'],qs[_0xf4e7('0x3a')](_0x6cf419[_0xf4e7('0x35')][_0xf4e7('0x3a')]));_0x429527[_0xf4e7('0x39')]=_0x429527[_0xf4e7('0x39')][_0xf4e7('0x3b')]?_0x429527[_0xf4e7('0x39')]:_0x367da9['model'];_0x429527['order']=qs[_0xf4e7('0x3f')](_0x6cf419[_0xf4e7('0x35')][_0xf4e7('0x3f')]);_0x429527[_0xf4e7('0x40')]=qs[_0xf4e7('0x37')](_[_0xf4e7('0x41')](_0x6cf419[_0xf4e7('0x35')],_0x367da9[_0xf4e7('0x37')]));if(_0x6cf419[_0xf4e7('0x35')][_0xf4e7('0x42')]){_0x429527['where']=_[_0xf4e7('0x43')](_0x429527[_0xf4e7('0x40')],{'$or':_[_0xf4e7('0x34')](_0x429527[_0xf4e7('0x39')],function(_0x5ed1fb){var _0x2b5095={};_0x2b5095[_0x5ed1fb]={'$like':'%'+_0x6cf419[_0xf4e7('0x35')][_0xf4e7('0x42')]+'%'};return _0x2b5095;})});}_0x429527=_[_0xf4e7('0x43')]({},_0x429527,_0x6cf419[_0xf4e7('0x4b')]);return _0x3324ab['getAgents'](_0x429527);}})[_0xf4e7('0x28')](function(_0x4d783d){if(_0x4d783d){_0x45ef6f=_0x4d783d[_0xf4e7('0x3b')];if(!_0x6cf419[_0xf4e7('0x35')][_0xf4e7('0x3c')](_0xf4e7('0x3d'))){_0x429527[_0xf4e7('0x22')]=qs[_0xf4e7('0x22')](_0x6cf419[_0xf4e7('0x35')][_0xf4e7('0x22')]);_0x429527[_0xf4e7('0x21')]=qs[_0xf4e7('0x21')](_0x6cf419[_0xf4e7('0x35')][_0xf4e7('0x21')]);}return _0x3324ab[_0xf4e7('0x86')](_0x429527);}})[_0xf4e7('0x28')](function(_0x239037){if(_0x239037){return _0x239037?{'count':_0x45ef6f,'rows':_0x239037}:null;}})[_0xf4e7('0x28')](respondWithResult(_0x35f69e,null))[_0xf4e7('0x47')](handleError(_0x35f69e,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index f0514ee..82f7d12 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 _0xa349=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xb22a4c,_0x30e049){var _0x1c977f=function(_0x11e13f){while(--_0x11e13f){_0xb22a4c['push'](_0xb22a4c['shift']());}};_0x1c977f(++_0x30e049);}(_0xa349,0x155));var _0x9a34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa349[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x9a34('0x0'));var OpenchannelQueue=require(_0x9a34('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a34('0x2'),'afterUpdate':_0x9a34('0x3'),'afterDestroy':_0x9a34('0x4')};function emitEvent(_0x5680cf){return function(_0x95dbea,_0x220a1e,_0x947dbd){OpenchannelQueueEvents[_0x9a34('0x5')](_0x5680cf+':'+_0x95dbea['id'],_0x95dbea);OpenchannelQueueEvents['emit'](_0x5680cf,_0x95dbea);_0x947dbd(null);};}for(var e in events){if(events[_0x9a34('0x6')](e)){var event=events[e];OpenchannelQueue[_0x9a34('0x7')](e,emitEvent(event));}}module[_0x9a34('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x35db=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0xdcc206,_0x9c8f73){var _0x13e345=function(_0x104145){while(--_0x104145){_0xdcc206['push'](_0xdcc206['shift']());}};_0x13e345(++_0x9c8f73);}(_0x35db,0x107));var _0xb35d=function(_0x4a9edd,_0x3cb2fe){_0x4a9edd=_0x4a9edd-0x0;var _0x8321e6=_0x35db[_0x4a9edd];return _0x8321e6;};'use strict';var EventEmitter=require(_0xb35d('0x0'));var OpenchannelQueue=require(_0xb35d('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xb35d('0x2')](0x0);var events={'afterCreate':_0xb35d('0x3'),'afterUpdate':_0xb35d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5a7055){return function(_0x16e450,_0xb70ca5,_0xee02b5){OpenchannelQueueEvents[_0xb35d('0x5')](_0x5a7055+':'+_0x16e450['id'],_0x16e450);OpenchannelQueueEvents[_0xb35d('0x5')](_0x5a7055,_0x16e450);_0xee02b5(null);};}for(var e in events){if(events[_0xb35d('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xb35d('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 8cebb5d..88a9f57 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 _0x46cf=['moment','request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util','../../config/logger','api'];(function(_0x41e5d7,_0x47f805){var _0x25df54=function(_0x531fe3){while(--_0x531fe3){_0x41e5d7['push'](_0x41e5d7['shift']());}};_0x25df54(++_0x47f805);}(_0x46cf,0xe0));var _0xf46c=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x46cf[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0xf46c('0x0'));var util=require(_0xf46c('0x1'));var logger=require(_0xf46c('0x2'))(_0xf46c('0x3'));var moment=require(_0xf46c('0x4'));var BPromise=require('bluebird');var rp=require(_0xf46c('0x5'));var fs=require('fs');var path=require(_0xf46c('0x6'));var rimraf=require('rimraf');var config=require(_0xf46c('0x7'));var attributes=require(_0xf46c('0x8'));module[_0xf46c('0x9')]=function(_0x5d4eba,_0x56fbf3){return _0x5d4eba[_0xf46c('0xa')](_0xf46c('0xb'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5d8=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0xd5d8,0x1a3));var _0x8d5d=function(_0x903261,_0x5b1518){_0x903261=_0x903261-0x0;var _0x2aebf0=_0xd5d8[_0x903261];return _0x2aebf0;};'use strict';var _=require(_0x8d5d('0x0'));var util=require(_0x8d5d('0x1'));var logger=require(_0x8d5d('0x2'))(_0x8d5d('0x3'));var moment=require(_0x8d5d('0x4'));var BPromise=require(_0x8d5d('0x5'));var rp=require(_0x8d5d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d5d('0x7'));var config=require(_0x8d5d('0x8'));var attributes=require('./openchannelQueue.attributes');module[_0x8d5d('0x9')]=function(_0x4b7a00,_0x51c8d5){return _0x4b7a00[_0x8d5d('0xa')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index a4bbdb1..44bb0f4 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 _0xb78d=['stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0xa0fe18,_0x4f95d1){var _0x22befb=function(_0x153991){while(--_0x153991){_0xa0fe18['push'](_0xa0fe18['shift']());}};_0x22befb(++_0x4f95d1);}(_0xb78d,0xdb));var _0xdb78=function(_0x47c873,_0x4894d7){_0x47c873=_0x47c873-0x0;var _0xecffa6=_0xb78d[_0x47c873];return _0xecffa6;};'use strict';var _=require(_0xdb78('0x0'));var util=require(_0xdb78('0x1'));var moment=require(_0xdb78('0x2'));var BPromise=require(_0xdb78('0x3'));var rs=require(_0xdb78('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdb78('0x5'));var logger=require(_0xdb78('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdb78('0x7')]['http']({'port':0x232a});config[_0xdb78('0x8')]=_[_0xdb78('0x9')](config[_0xdb78('0x8')],{'host':_0xdb78('0xa'),'port':0x18eb});var socket=require(_0xdb78('0xb'))(new Redis(config['redis']));require(_0xdb78('0xc'))[_0xdb78('0xd')](socket);function respondWithRpcPromise(_0x2e74c9,_0x41e2d6,_0x2c2a40){return new BPromise(function(_0x171784,_0x33d40c){return client[_0xdb78('0xe')](_0x2e74c9,_0x2c2a40)[_0xdb78('0xf')](function(_0x4d132c){logger[_0xdb78('0x10')](_0xdb78('0x11'),_0x41e2d6,_0xdb78('0x12'));logger[_0xdb78('0x13')](_0xdb78('0x14'),_0x41e2d6,_0xdb78('0x12'),JSON[_0xdb78('0x15')](_0x4d132c));if(_0x4d132c[_0xdb78('0x16')]){if(_0x4d132c[_0xdb78('0x16')][_0xdb78('0x17')]===0x1f4){logger[_0xdb78('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x41e2d6,_0x4d132c['error'][_0xdb78('0x18')]);return _0x33d40c(_0x4d132c[_0xdb78('0x16')][_0xdb78('0x18')]);}logger[_0xdb78('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x41e2d6,_0x4d132c[_0xdb78('0x16')]['message']);return _0x171784(_0x4d132c[_0xdb78('0x16')][_0xdb78('0x18')]);}else{logger[_0xdb78('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x41e2d6,'request\x20sent');_0x171784(_0x4d132c[_0xdb78('0x19')]['message']);}})[_0xdb78('0x1a')](function(_0x223fd6){logger[_0xdb78('0x16')](_0xdb78('0x11'),_0x41e2d6,_0x223fd6);_0x33d40c(_0x223fd6);});});}exports[_0xdb78('0x1b')]=function(_0x5c4935){var _0x2aeb1c=this;return new Promise(function(_0x365491,_0x1d15cb){return db[_0xdb78('0x1c')][_0xdb78('0x1d')]({'raw':_0x5c4935[_0xdb78('0x1e')]?_0x5c4935[_0xdb78('0x1e')][_0xdb78('0x1f')]===undefined?!![]:![]:!![],'where':_0x5c4935[_0xdb78('0x1e')]?_0x5c4935[_0xdb78('0x1e')][_0xdb78('0x20')]||null:null,'attributes':_0x5c4935[_0xdb78('0x1e')]?_0x5c4935[_0xdb78('0x1e')]['attributes']||null:null,'limit':_0x5c4935[_0xdb78('0x1e')]?_0x5c4935[_0xdb78('0x1e')][_0xdb78('0x21')]||null:null,'include':_0x5c4935[_0xdb78('0x1e')]?_0x5c4935['options'][_0xdb78('0x22')]?_[_0xdb78('0x23')](_0x5c4935[_0xdb78('0x1e')]['include'],function(_0x3a4cc3){return{'model':db[_0x3a4cc3[_0xdb78('0x24')]],'as':_0x3a4cc3['as'],'attributes':_0x3a4cc3[_0xdb78('0x25')],'include':_0x3a4cc3[_0xdb78('0x22')]?_[_0xdb78('0x23')](_0x3a4cc3[_0xdb78('0x22')],function(_0x41dbff){return{'model':db[_0x41dbff[_0xdb78('0x24')]],'as':_0x41dbff['as'],'attributes':_0x41dbff[_0xdb78('0x25')],'include':_0x41dbff['include']?_['map'](_0x41dbff['include'],function(_0x20fcc0){return{'model':db[_0x20fcc0[_0xdb78('0x24')]],'as':_0x20fcc0['as'],'attributes':_0x20fcc0[_0xdb78('0x25')]};}):[]};}):[]};}):[]:[]})[_0xdb78('0xf')](function(_0x5634f6){logger[_0xdb78('0x10')](_0xdb78('0x1b'),_0x5c4935);logger[_0xdb78('0x13')]('GetOpenchannelQueue',_0x5c4935,JSON[_0xdb78('0x15')](_0x5634f6));_0x365491(_0x5634f6);})[_0xdb78('0x1a')](function(_0x27bcc3){logger[_0xdb78('0x16')](_0xdb78('0x1b'),_0x27bcc3['message'],_0x5c4935);_0x1d15cb(_0x2aeb1c[_0xdb78('0x16')](0x1f4,_0x27bcc3['message']));});});};exports[_0xdb78('0x26')]=function(_0x1a101b){var _0x5ac52c=this;return new Promise(function(_0x13404b,_0x250061){return db[_0xdb78('0x1c')][_0xdb78('0x27')]({'raw':_0x1a101b['options']?_0x1a101b[_0xdb78('0x1e')][_0xdb78('0x1f')]===undefined?!![]:![]:!![],'where':_0x1a101b[_0xdb78('0x1e')]?_0x1a101b[_0xdb78('0x1e')][_0xdb78('0x20')]||null:null,'attributes':_0x1a101b[_0xdb78('0x1e')]?_0x1a101b[_0xdb78('0x1e')][_0xdb78('0x25')]||null:null,'include':_0x1a101b['options']?_0x1a101b['options']['include']?_[_0xdb78('0x23')](_0x1a101b[_0xdb78('0x1e')][_0xdb78('0x22')],function(_0x34be03){return{'model':db[_0x34be03['model']],'as':_0x34be03['as'],'attributes':_0x34be03[_0xdb78('0x25')],'include':_0x34be03['include']?_[_0xdb78('0x23')](_0x34be03[_0xdb78('0x22')],function(_0x4cd53a){return{'model':db[_0x4cd53a[_0xdb78('0x24')]],'as':_0x4cd53a['as'],'attributes':_0x4cd53a['attributes'],'include':_0x4cd53a[_0xdb78('0x22')]?_[_0xdb78('0x23')](_0x4cd53a[_0xdb78('0x22')],function(_0x33ae1d){return{'model':db[_0x33ae1d[_0xdb78('0x24')]],'as':_0x33ae1d['as'],'attributes':_0x33ae1d[_0xdb78('0x25')]};}):[]};}):[]};}):[]:[]})[_0xdb78('0xf')](function(_0x2b3fd1){logger['info'](_0xdb78('0x26'),_0x1a101b);logger[_0xdb78('0x13')]('ShowOpenchannelQueue',_0x1a101b,JSON[_0xdb78('0x15')](_0x2b3fd1));_0x13404b(_0x2b3fd1);})[_0xdb78('0x1a')](function(_0x1de7f3){logger[_0xdb78('0x16')](_0xdb78('0x26'),_0x1de7f3[_0xdb78('0x18')],_0x1a101b);_0x250061(_0x5ac52c[_0xdb78('0x16')](0x1f4,_0x1de7f3[_0xdb78('0x18')]));});});}; \ No newline at end of file +var _0xe478=['attributes','model','then','GetOpenchannelQueue','catch','raw','ShowOpenchannelQueue','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','OpenchannelQueue','findAll','options','where','limit','include','map'];(function(_0x580a40,_0x5a34fa){var _0x220738=function(_0x4f72ce){while(--_0x4f72ce){_0x580a40['push'](_0x580a40['shift']());}};_0x220738(++_0x5a34fa);}(_0xe478,0x82));var _0x8e47=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe478[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require(_0x8e47('0x0'));var moment=require('moment');var BPromise=require(_0x8e47('0x1'));var rs=require(_0x8e47('0x2'));var fs=require('fs');var Redis=require(_0x8e47('0x3'));var db=require(_0x8e47('0x4'))['db'];var utils=require(_0x8e47('0x5'));var logger=require(_0x8e47('0x6'))(_0x8e47('0x7'));var config=require(_0x8e47('0x8'));var jayson=require(_0x8e47('0x9'));var client=jayson[_0x8e47('0xa')][_0x8e47('0xb')]({'port':0x232a});config[_0x8e47('0xc')]=_[_0x8e47('0xd')](config[_0x8e47('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e47('0xc')]));require(_0x8e47('0xe'))[_0x8e47('0xf')](socket);function respondWithRpcPromise(_0x3b8c30,_0x86e8e4,_0x4293ab){return new BPromise(function(_0x24640e,_0x38cb2f){return client[_0x8e47('0x10')](_0x3b8c30,_0x4293ab)['then'](function(_0x494871){logger['info'](_0x8e47('0x11'),_0x86e8e4,_0x8e47('0x12'));logger[_0x8e47('0x13')](_0x8e47('0x14'),_0x86e8e4,'request\x20sent',JSON[_0x8e47('0x15')](_0x494871));if(_0x494871[_0x8e47('0x16')]){if(_0x494871[_0x8e47('0x16')][_0x8e47('0x17')]===0x1f4){logger['error'](_0x8e47('0x11'),_0x86e8e4,_0x494871[_0x8e47('0x16')]['message']);return _0x38cb2f(_0x494871[_0x8e47('0x16')][_0x8e47('0x18')]);}logger[_0x8e47('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x86e8e4,_0x494871['error'][_0x8e47('0x18')]);return _0x24640e(_0x494871['error'][_0x8e47('0x18')]);}else{logger[_0x8e47('0x19')]('OpenchannelQueue,\x20%s,\x20%s',_0x86e8e4,_0x8e47('0x12'));_0x24640e(_0x494871[_0x8e47('0x1a')]['message']);}})['catch'](function(_0x1cb6e3){logger[_0x8e47('0x16')](_0x8e47('0x11'),_0x86e8e4,_0x1cb6e3);_0x38cb2f(_0x1cb6e3);});});}exports['GetOpenchannelQueue']=function(_0x3fb651){var _0xf16acf=this;return new Promise(function(_0x4ba491,_0xaa229f){return db[_0x8e47('0x1b')][_0x8e47('0x1c')]({'raw':_0x3fb651[_0x8e47('0x1d')]?_0x3fb651[_0x8e47('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3fb651[_0x8e47('0x1d')]?_0x3fb651['options'][_0x8e47('0x1e')]||null:null,'attributes':_0x3fb651[_0x8e47('0x1d')]?_0x3fb651['options']['attributes']||null:null,'limit':_0x3fb651[_0x8e47('0x1d')]?_0x3fb651['options'][_0x8e47('0x1f')]||null:null,'include':_0x3fb651['options']?_0x3fb651[_0x8e47('0x1d')][_0x8e47('0x20')]?_[_0x8e47('0x21')](_0x3fb651[_0x8e47('0x1d')][_0x8e47('0x20')],function(_0x52f6c7){return{'model':db[_0x52f6c7['model']],'as':_0x52f6c7['as'],'attributes':_0x52f6c7[_0x8e47('0x22')],'include':_0x52f6c7[_0x8e47('0x20')]?_[_0x8e47('0x21')](_0x52f6c7[_0x8e47('0x20')],function(_0x241bcb){return{'model':db[_0x241bcb[_0x8e47('0x23')]],'as':_0x241bcb['as'],'attributes':_0x241bcb['attributes'],'include':_0x241bcb[_0x8e47('0x20')]?_['map'](_0x241bcb[_0x8e47('0x20')],function(_0x3386d9){return{'model':db[_0x3386d9['model']],'as':_0x3386d9['as'],'attributes':_0x3386d9['attributes']};}):[]};}):[]};}):[]:[]})[_0x8e47('0x24')](function(_0x4d932b){logger[_0x8e47('0x19')]('GetOpenchannelQueue',_0x3fb651);logger['debug'](_0x8e47('0x25'),_0x3fb651,JSON['stringify'](_0x4d932b));_0x4ba491(_0x4d932b);})[_0x8e47('0x26')](function(_0x482c8d){logger[_0x8e47('0x16')]('GetOpenchannelQueue',_0x482c8d[_0x8e47('0x18')],_0x3fb651);_0xaa229f(_0xf16acf[_0x8e47('0x16')](0x1f4,_0x482c8d[_0x8e47('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x323da8){var _0x56e9cf=this;return new Promise(function(_0x1d164f,_0x38e9b0){return db[_0x8e47('0x1b')]['find']({'raw':_0x323da8[_0x8e47('0x1d')]?_0x323da8[_0x8e47('0x1d')][_0x8e47('0x27')]===undefined?!![]:![]:!![],'where':_0x323da8[_0x8e47('0x1d')]?_0x323da8['options']['where']||null:null,'attributes':_0x323da8[_0x8e47('0x1d')]?_0x323da8[_0x8e47('0x1d')][_0x8e47('0x22')]||null:null,'include':_0x323da8[_0x8e47('0x1d')]?_0x323da8['options'][_0x8e47('0x20')]?_[_0x8e47('0x21')](_0x323da8[_0x8e47('0x1d')][_0x8e47('0x20')],function(_0x90cda0){return{'model':db[_0x90cda0[_0x8e47('0x23')]],'as':_0x90cda0['as'],'attributes':_0x90cda0[_0x8e47('0x22')],'include':_0x90cda0[_0x8e47('0x20')]?_[_0x8e47('0x21')](_0x90cda0[_0x8e47('0x20')],function(_0x49c820){return{'model':db[_0x49c820[_0x8e47('0x23')]],'as':_0x49c820['as'],'attributes':_0x49c820[_0x8e47('0x22')],'include':_0x49c820['include']?_['map'](_0x49c820[_0x8e47('0x20')],function(_0x1b6745){return{'model':db[_0x1b6745[_0x8e47('0x23')]],'as':_0x1b6745['as'],'attributes':_0x1b6745[_0x8e47('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8e47('0x24')](function(_0x2214b3){logger[_0x8e47('0x19')](_0x8e47('0x28'),_0x323da8);logger['debug'](_0x8e47('0x28'),_0x323da8,JSON['stringify'](_0x2214b3));_0x1d164f(_0x2214b3);})[_0x8e47('0x26')](function(_0x31e57d){logger[_0x8e47('0x16')]('ShowOpenchannelQueue',_0x31e57d[_0x8e47('0x18')],_0x323da8);_0x38e9b0(_0x56e9cf[_0x8e47('0x16')](0x1f4,_0x31e57d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 855864a..cee9c9c 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 _0x5ff2=['emit','register','openchannelQueue:','./openchannelQueue.events','update'];(function(_0x36bbbb,_0x3f6709){var _0x3ca0eb=function(_0x299763){while(--_0x299763){_0x36bbbb['push'](_0x36bbbb['shift']());}};_0x3ca0eb(++_0x3f6709);}(_0x5ff2,0x1b6));var _0x25ff=function(_0x2f5fcb,_0x4df21e){_0x2f5fcb=_0x2f5fcb-0x0;var _0x2fc15e=_0x5ff2[_0x2f5fcb];return _0x2fc15e;};'use strict';var OpenchannelQueueEvents=require(_0x25ff('0x0'));var events=['save','remove',_0x25ff('0x1')];function createListener(_0x521457,_0x56377e){return function(_0x292c63){_0x56377e[_0x25ff('0x2')](_0x521457,_0x292c63);};}function removeListener(_0x500c5f,_0x23eb59){return function(){OpenchannelQueueEvents['removeListener'](_0x500c5f,_0x23eb59);};}exports[_0x25ff('0x3')]=function(_0x5bf3af){for(var _0x4dd512=0x0,_0x7a34de=events['length'];_0x4dd512<_0x7a34de;_0x4dd512++){var _0x230c88=events[_0x4dd512];var _0x5b9eef=createListener(_0x25ff('0x4')+_0x230c88,_0x5bf3af);OpenchannelQueueEvents['on'](_0x230c88,_0x5b9eef);}}; \ No newline at end of file +var _0x3990=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x3990,0x1c6));var _0x0399=function(_0xbe48c2,_0x3db103){_0xbe48c2=_0xbe48c2-0x0;var _0x39a679=_0x3990[_0xbe48c2];return _0x39a679;};'use strict';var OpenchannelQueueEvents=require(_0x0399('0x0'));var events=[_0x0399('0x1'),_0x0399('0x2'),_0x0399('0x3')];function createListener(_0x3a408b,_0x1dbf51){return function(_0x497cce){_0x1dbf51[_0x0399('0x4')](_0x3a408b,_0x497cce);};}function removeListener(_0xd0ba2d,_0xe001a3){return function(){OpenchannelQueueEvents[_0x0399('0x5')](_0xd0ba2d,_0xe001a3);};}exports[_0x0399('0x6')]=function(_0x5b9332){for(var _0x953358=0x0,_0x4bcc3d=events[_0x0399('0x7')];_0x953358<_0x4bcc3d;_0x953358++){var _0x28752b=events[_0x953358];var _0x11c1fb=createListener(_0x0399('0x8')+_0x28752b,_0x5b9332);OpenchannelQueueEvents['on'](_0x28752b,_0x11c1fb);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index f350c96..4b0cd0a 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 _0x8450=['destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update'];(function(_0x159258,_0x198f19){var _0x57f584=function(_0x1541d1){while(--_0x1541d1){_0x159258['push'](_0x159258['shift']());}};_0x57f584(++_0x198f19);}(_0x8450,0xfe));var _0x0845=function(_0x8cbb56,_0x275114){_0x8cbb56=_0x8cbb56-0x0;var _0x4222dd=_0x8450[_0x8cbb56];return _0x4222dd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0845('0x0'));var timeout=require(_0x0845('0x1'));var express=require(_0x0845('0x2'));var router=express['Router']();var auth=require(_0x0845('0x3'));var interaction=require(_0x0845('0x4'));var config=require(_0x0845('0x5'));var controller=require(_0x0845('0x6'));router[_0x0845('0x7')]('/',auth[_0x0845('0x8')](),controller[_0x0845('0x9')]);router[_0x0845('0x7')](_0x0845('0xa'),auth[_0x0845('0x8')](),controller[_0x0845('0xb')]);router['get'](_0x0845('0xc'),auth[_0x0845('0x8')](),controller[_0x0845('0xd')]);router['post']('/',auth[_0x0845('0x8')](),controller[_0x0845('0xe')]);router['put'](_0x0845('0xc'),auth['isAuthenticated'](),controller[_0x0845('0xf')]);router['delete'](_0x0845('0xc'),auth[_0x0845('0x8')](),controller[_0x0845('0x10')]);module[_0x0845('0x11')]=router; \ No newline at end of file +var _0x5dea=['describe','/:id','show','post','create','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated'];(function(_0x2ba380,_0x16aa16){var _0x9da985=function(_0x4db2d6){while(--_0x4db2d6){_0x2ba380['push'](_0x2ba380['shift']());}};_0x9da985(++_0x16aa16);}(_0x5dea,0x15d));var _0xa5de=function(_0x5f411f,_0x54f411){_0x5f411f=_0x5f411f-0x0;var _0x5aa8f5=_0x5dea[_0x5f411f];return _0x5aa8f5;};'use strict';var multer=require(_0xa5de('0x0'));var util=require(_0xa5de('0x1'));var path=require(_0xa5de('0x2'));var timeout=require(_0xa5de('0x3'));var express=require(_0xa5de('0x4'));var router=express['Router']();var auth=require(_0xa5de('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa5de('0x6'));var controller=require(_0xa5de('0x7'));router[_0xa5de('0x8')]('/',auth['isAuthenticated'](),controller[_0xa5de('0x9')]);router[_0xa5de('0x8')](_0xa5de('0xa'),auth[_0xa5de('0xb')](),controller[_0xa5de('0xc')]);router[_0xa5de('0x8')](_0xa5de('0xd'),auth['isAuthenticated'](),controller[_0xa5de('0xe')]);router[_0xa5de('0xf')]('/',auth[_0xa5de('0xb')](),controller[_0xa5de('0x10')]);router['put'](_0xa5de('0xd'),auth[_0xa5de('0xb')](),controller[_0xa5de('0x11')]);router[_0xa5de('0x12')](_0xa5de('0xd'),auth[_0xa5de('0xb')](),controller['destroy']);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 3d58bf6..ce233de 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 _0xecb3=['sequelize','exports','STRING','DATE','moment'];(function(_0x402f05,_0x59f613){var _0x1bdf9c=function(_0x223431){while(--_0x223431){_0x402f05['push'](_0x402f05['shift']());}};_0x1bdf9c(++_0x59f613);}(_0xecb3,0x1b2));var _0x3ecb=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xecb3[_0x4ed520];return _0x4415a6;};'use strict';var moment=require(_0x3ecb('0x0'));var Sequelize=require(_0x3ecb('0x1'));module[_0x3ecb('0x2')]={'uniqueid':{'type':Sequelize[_0x3ecb('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3ecb('0x3')]},'joinAt':{'type':Sequelize[_0x3ecb('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3ecb('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x416c=['STRING','DATE','moment','sequelize','exports'];(function(_0x268cbc,_0x2bece3){var _0x2f3302=function(_0x289a7f){while(--_0x289a7f){_0x268cbc['push'](_0x268cbc['shift']());}};_0x2f3302(++_0x2bece3);}(_0x416c,0x110));var _0xc416=function(_0x256d99,_0x5c10d5){_0x256d99=_0x256d99-0x0;var _0x37f28e=_0x416c[_0x256d99];return _0x37f28e;};'use strict';var moment=require(_0xc416('0x0'));var Sequelize=require(_0xc416('0x1'));module[_0xc416('0x2')]={'uniqueid':{'type':Sequelize[_0xc416('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc416('0x3')]},'joinAt':{'type':Sequelize[_0xc416('0x4')]},'leaveAt':{'type':Sequelize[_0xc416('0x4')]},'acceptAt':{'type':Sequelize[_0xc416('0x4')]},'exitAt':{'type':Sequelize[_0xc416('0x4')]},'reason':{'type':Sequelize[_0xc416('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 7089f45..0796ba6 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 _0x6b19=['OpenchannelQueueReport','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x40a216,_0x2af880){var _0x43f85e=function(_0x498811){while(--_0x498811){_0x40a216['push'](_0x40a216['shift']());}};_0x43f85e(++_0x2af880);}(_0x6b19,0xf4));var _0x96b1=function(_0x340a8f,_0x18a6b7){_0x340a8f=_0x340a8f-0x0;var _0x138449=_0x6b19[_0x340a8f];return _0x138449;};'use strict';var pdf=require(_0x96b1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x96b1('0x1'));var zipdir=require(_0x96b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96b1('0x3'));var moment=require(_0x96b1('0x4'));var BPromise=require(_0x96b1('0x5'));var Mustache=require(_0x96b1('0x6'));var util=require('util');var path=require(_0x96b1('0x7'));var sox=require(_0x96b1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x96b1('0x9'));var squel=require(_0x96b1('0xa'));var crypto=require('crypto');var jsforce=require(_0x96b1('0xb'));var deskjs=require(_0x96b1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x96b1('0xd'));var Papa=require(_0x96b1('0xe'));var Redis=require(_0x96b1('0xf'));var authService=require(_0x96b1('0x10'));var qs=require(_0x96b1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96b1('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x96b1('0x13'))['db'];function respondWithStatusCode(_0x29df5c,_0x16ee32){_0x16ee32=_0x16ee32||0xcc;return function(_0x1d942a){if(_0x1d942a){return _0x29df5c[_0x96b1('0x14')](_0x16ee32);}return _0x29df5c['status'](_0x16ee32)[_0x96b1('0x15')]();};}function respondWithResult(_0xfa00b9,_0xe809b6){_0xe809b6=_0xe809b6||0xc8;return function(_0x2dbaac){if(_0x2dbaac){return _0xfa00b9[_0x96b1('0x16')](_0xe809b6)[_0x96b1('0x17')](_0x2dbaac);}};}function respondWithFilteredResult(_0x2eddaf,_0x1e5fdf){return function(_0x3ba832){if(_0x3ba832){var _0x5772d3=_0x3ba832[_0x96b1('0x18')],_0x2e9615=_0x1e5fdf[_0x96b1('0x19')],_0xa36999=_0x1e5fdf[_0x96b1('0x19')]+_0x1e5fdf[_0x96b1('0x1a')],_0x3d871f;if(_0xa36999>=_0x5772d3){_0xa36999=_0x5772d3;_0x3d871f=0xc8;}else{_0x3d871f=0xce;}_0x2eddaf[_0x96b1('0x16')](_0x3d871f);return _0x2eddaf[_0x96b1('0x1b')](_0x96b1('0x1c'),_0x2e9615+'-'+_0xa36999+'/'+_0x5772d3)[_0x96b1('0x17')](_0x3ba832);}return null;};}function patchUpdates(_0x56a860){return function(_0x5ac974){try{jsonpatch[_0x96b1('0x1d')](_0x5ac974,_0x56a860,!![]);}catch(_0x5c9cb4){return BPromise['reject'](_0x5c9cb4);}return _0x5ac974[_0x96b1('0x1e')]();};}function saveUpdates(_0x4370d5,_0x2bb819){return function(_0x4f0d78){if(_0x4f0d78){return _0x4f0d78[_0x96b1('0x1f')](_0x4370d5)[_0x96b1('0x20')](function(_0x3ad333){return _0x3ad333;});}return null;};}function removeEntity(_0x34ffe8,_0x1e1436){return function(_0x276919){if(_0x276919){return _0x276919[_0x96b1('0x21')]()[_0x96b1('0x20')](function(){_0x34ffe8[_0x96b1('0x16')](0xcc)[_0x96b1('0x15')]();});}};}function handleEntityNotFound(_0x2acd58,_0x1b0f88){return function(_0x295f05){if(!_0x295f05){_0x2acd58[_0x96b1('0x14')](0x194);}return _0x295f05;};}function handleError(_0xe433b1,_0x232d49){_0x232d49=_0x232d49||0x1f4;return function(_0x1db6ba){logger[_0x96b1('0x22')](_0x1db6ba[_0x96b1('0x23')]);if(_0x1db6ba[_0x96b1('0x24')]){delete _0x1db6ba[_0x96b1('0x24')];}_0xe433b1[_0x96b1('0x16')](_0x232d49)[_0x96b1('0x25')](_0x1db6ba);};}exports[_0x96b1('0x26')]=function(_0x4f06e3,_0x4e45a9){var _0x86d0a5={},_0x4bc715={},_0x3783c3={'count':0x0,'rows':[]};var _0x701163=_[_0x96b1('0x27')](db[_0x96b1('0x28')]['rawAttributes'],function(_0x59fc7c){return{'name':_0x59fc7c[_0x96b1('0x29')],'type':_0x59fc7c[_0x96b1('0x2a')]['key']};});_0x4bc715[_0x96b1('0x2b')]=_[_0x96b1('0x27')](_0x701163,_0x96b1('0x24'));_0x4bc715[_0x96b1('0x2c')]=_[_0x96b1('0x2d')](_0x4f06e3[_0x96b1('0x2c')]);_0x4bc715['filters']=_[_0x96b1('0x2e')](_0x4bc715[_0x96b1('0x2b')],_0x4bc715[_0x96b1('0x2c')]);_0x86d0a5[_0x96b1('0x2f')]=_[_0x96b1('0x2e')](_0x4bc715[_0x96b1('0x2b')],qs[_0x96b1('0x30')](_0x4f06e3[_0x96b1('0x2c')]['fields']));_0x86d0a5[_0x96b1('0x2f')]=_0x86d0a5[_0x96b1('0x2f')][_0x96b1('0x31')]?_0x86d0a5[_0x96b1('0x2f')]:_0x4bc715[_0x96b1('0x2b')];if(!_0x4f06e3[_0x96b1('0x2c')][_0x96b1('0x32')](_0x96b1('0x33'))){_0x86d0a5['limit']=qs[_0x96b1('0x1a')](_0x4f06e3[_0x96b1('0x2c')][_0x96b1('0x1a')]);_0x86d0a5['offset']=qs['offset'](_0x4f06e3[_0x96b1('0x2c')][_0x96b1('0x19')]);}_0x86d0a5['order']=qs['sort'](_0x4f06e3['query'][_0x96b1('0x34')]);_0x86d0a5[_0x96b1('0x35')]=qs[_0x96b1('0x36')](_[_0x96b1('0x37')](_0x4f06e3[_0x96b1('0x2c')],_0x4bc715[_0x96b1('0x36')]));if(_0x4f06e3[_0x96b1('0x2c')]['filter']){_0x86d0a5[_0x96b1('0x35')]=_['merge'](_0x86d0a5['where'],{'$or':_[_0x96b1('0x27')](_0x701163,function(_0x1ffd9b){if(_0x1ffd9b['type']!==_0x96b1('0x38')){var _0x1bf40f={};_0x1bf40f[_0x1ffd9b[_0x96b1('0x24')]]={'$like':'%'+_0x4f06e3[_0x96b1('0x2c')][_0x96b1('0x39')]+'%'};return _0x1bf40f;}})});}_0x86d0a5=_['merge']({},_0x86d0a5,_0x4f06e3[_0x96b1('0x3a')]);var _0x3111ca={'where':_0x86d0a5[_0x96b1('0x35')]};return db['OpenchannelQueueReport'][_0x96b1('0x18')](_0x3111ca)['then'](function(_0xaea746){_0x3783c3['count']=_0xaea746;if(_0x4f06e3['query'][_0x96b1('0x3b')]){_0x86d0a5[_0x96b1('0x3c')]=[{'all':!![]}];}return db[_0x96b1('0x28')][_0x96b1('0x3d')](_0x86d0a5);})['then'](function(_0x46008a){_0x3783c3[_0x96b1('0x3e')]=_0x46008a;return _0x3783c3;})[_0x96b1('0x20')](respondWithFilteredResult(_0x4e45a9,_0x86d0a5))[_0x96b1('0x3f')](handleError(_0x4e45a9,null));};exports[_0x96b1('0x40')]=function(_0x2191d2,_0x42fae6){var _0x52c232={'raw':!![],'where':{'id':_0x2191d2[_0x96b1('0x41')]['id']}},_0x1440b9={};_0x1440b9[_0x96b1('0x2b')]=_[_0x96b1('0x2d')](db['OpenchannelQueueReport'][_0x96b1('0x42')]);_0x1440b9[_0x96b1('0x2c')]=_[_0x96b1('0x2d')](_0x2191d2[_0x96b1('0x2c')]);_0x1440b9[_0x96b1('0x36')]=_[_0x96b1('0x2e')](_0x1440b9[_0x96b1('0x2b')],_0x1440b9['query']);_0x52c232[_0x96b1('0x2f')]=_['intersection'](_0x1440b9[_0x96b1('0x2b')],qs[_0x96b1('0x30')](_0x2191d2[_0x96b1('0x2c')][_0x96b1('0x30')]));_0x52c232[_0x96b1('0x2f')]=_0x52c232[_0x96b1('0x2f')][_0x96b1('0x31')]?_0x52c232[_0x96b1('0x2f')]:_0x1440b9[_0x96b1('0x2b')];if(_0x2191d2[_0x96b1('0x2c')][_0x96b1('0x3b')]){_0x52c232[_0x96b1('0x3c')]=[{'all':!![]}];}_0x52c232=_['merge']({},_0x52c232,_0x2191d2['options']);return db[_0x96b1('0x28')]['find'](_0x52c232)['then'](handleEntityNotFound(_0x42fae6,null))[_0x96b1('0x20')](respondWithResult(_0x42fae6,null))['catch'](handleError(_0x42fae6,null));};exports[_0x96b1('0x43')]=function(_0x19c935,_0x3b5cff){return db['OpenchannelQueueReport'][_0x96b1('0x43')](_0x19c935[_0x96b1('0x44')],{})[_0x96b1('0x20')](respondWithResult(_0x3b5cff,0xc9))[_0x96b1('0x3f')](handleError(_0x3b5cff,null));};exports['update']=function(_0x27be9f,_0x51a023){if(_0x27be9f[_0x96b1('0x44')]['id']){delete _0x27be9f[_0x96b1('0x44')]['id'];}return db[_0x96b1('0x28')][_0x96b1('0x45')]({'where':{'id':_0x27be9f[_0x96b1('0x41')]['id']}})[_0x96b1('0x20')](handleEntityNotFound(_0x51a023,null))[_0x96b1('0x20')](saveUpdates(_0x27be9f[_0x96b1('0x44')],null))['then'](respondWithResult(_0x51a023,null))[_0x96b1('0x3f')](handleError(_0x51a023,null));};exports[_0x96b1('0x21')]=function(_0x5a6b4d,_0x2f9127){return db[_0x96b1('0x28')][_0x96b1('0x45')]({'where':{'id':_0x5a6b4d[_0x96b1('0x41')]['id']}})[_0x96b1('0x20')](handleEntityNotFound(_0x2f9127,null))[_0x96b1('0x20')](removeEntity(_0x2f9127,null))[_0x96b1('0x3f')](handleError(_0x2f9127,null));};exports[_0x96b1('0x46')]=function(_0x3fa699,_0x482c4a){return db[_0x96b1('0x28')][_0x96b1('0x46')]()[_0x96b1('0x20')](respondWithResult(_0x482c4a,null))[_0x96b1('0x3f')](handleError(_0x482c4a,null));}; \ No newline at end of file +var _0x9c1d=['destroy','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','params','includeAll','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then'];(function(_0x5d53ff,_0x579a1d){var _0x1b036c=function(_0x5654b6){while(--_0x5654b6){_0x5d53ff['push'](_0x5d53ff['shift']());}};_0x1b036c(++_0x579a1d);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x51f028,_0x5387b5){_0x51f028=_0x51f028-0x0;var _0xfe4988=_0x9c1d[_0x51f028];return _0xfe4988;};'use strict';var pdf=require(_0xd9c1('0x0'));var emlformat=require(_0xd9c1('0x1'));var rimraf=require(_0xd9c1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9c1('0x3'));var rp=require(_0xd9c1('0x4'));var moment=require('moment');var BPromise=require(_0xd9c1('0x5'));var Mustache=require(_0xd9c1('0x6'));var util=require('util');var path=require(_0xd9c1('0x7'));var sox=require(_0xd9c1('0x8'));var csv=require(_0xd9c1('0x9'));var ejs=require(_0xd9c1('0xa'));var fs=require('fs');var _=require(_0xd9c1('0xb'));var squel=require(_0xd9c1('0xc'));var crypto=require(_0xd9c1('0xd'));var jsforce=require(_0xd9c1('0xe'));var deskjs=require(_0xd9c1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9c1('0x10'));var Papa=require(_0xd9c1('0x11'));var Redis=require(_0xd9c1('0x12'));var authService=require(_0xd9c1('0x13'));var qs=require(_0xd9c1('0x14'));var as=require(_0xd9c1('0x15'));var hardwareService=require(_0xd9c1('0x16'));var logger=require('../../config/logger')(_0xd9c1('0x17'));var utils=require(_0xd9c1('0x18'));var config=require(_0xd9c1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ead8c,_0x50b02c){_0x50b02c=_0x50b02c||0xcc;return function(_0x13f92d){if(_0x13f92d){return _0x1ead8c[_0xd9c1('0x1a')](_0x50b02c);}return _0x1ead8c[_0xd9c1('0x1b')](_0x50b02c)[_0xd9c1('0x1c')]();};}function respondWithResult(_0xb9cb5d,_0x221a24){_0x221a24=_0x221a24||0xc8;return function(_0x1d34f9){if(_0x1d34f9){return _0xb9cb5d[_0xd9c1('0x1b')](_0x221a24)[_0xd9c1('0x1d')](_0x1d34f9);}};}function respondWithFilteredResult(_0x259305,_0x2813bb){return function(_0x41e154){if(_0x41e154){var _0x35125=_0x41e154['count'],_0x174ccd=_0x2813bb[_0xd9c1('0x1e')],_0xe47aa2=_0x2813bb[_0xd9c1('0x1e')]+_0x2813bb[_0xd9c1('0x1f')],_0x5e500f;if(_0xe47aa2>=_0x35125){_0xe47aa2=_0x35125;_0x5e500f=0xc8;}else{_0x5e500f=0xce;}_0x259305[_0xd9c1('0x1b')](_0x5e500f);return _0x259305[_0xd9c1('0x20')](_0xd9c1('0x21'),_0x174ccd+'-'+_0xe47aa2+'/'+_0x35125)[_0xd9c1('0x1d')](_0x41e154);}return null;};}function patchUpdates(_0x332f19){return function(_0x3a8830){try{jsonpatch['apply'](_0x3a8830,_0x332f19,!![]);}catch(_0x184c4b){return BPromise[_0xd9c1('0x22')](_0x184c4b);}return _0x3a8830[_0xd9c1('0x23')]();};}function saveUpdates(_0x2aea78,_0x4643ad){return function(_0x36728a){if(_0x36728a){return _0x36728a['update'](_0x2aea78)[_0xd9c1('0x24')](function(_0x32b901){return _0x32b901;});}return null;};}function removeEntity(_0x2bd0ab,_0x5caaa1){return function(_0x5b62ac){if(_0x5b62ac){return _0x5b62ac[_0xd9c1('0x25')]()[_0xd9c1('0x24')](function(){_0x2bd0ab[_0xd9c1('0x1b')](0xcc)[_0xd9c1('0x1c')]();});}};}function handleEntityNotFound(_0x18d5f3,_0x5f6a76){return function(_0x27818f){if(!_0x27818f){_0x18d5f3['sendStatus'](0x194);}return _0x27818f;};}function handleError(_0x26df40,_0x241cf1){_0x241cf1=_0x241cf1||0x1f4;return function(_0x4ea9ed){logger['error'](_0x4ea9ed[_0xd9c1('0x26')]);if(_0x4ea9ed[_0xd9c1('0x27')]){delete _0x4ea9ed[_0xd9c1('0x27')];}_0x26df40['status'](_0x241cf1)[_0xd9c1('0x28')](_0x4ea9ed);};}exports[_0xd9c1('0x29')]=function(_0x5a384b,_0x4dcc10){var _0x298042={},_0x2d2f1c={},_0x5e193f={'count':0x0,'rows':[]};var _0x28bd8a=_[_0xd9c1('0x2a')](db[_0xd9c1('0x2b')][_0xd9c1('0x2c')],function(_0x5ba2fe){return{'name':_0x5ba2fe[_0xd9c1('0x2d')],'type':_0x5ba2fe[_0xd9c1('0x2e')][_0xd9c1('0x2f')]};});_0x2d2f1c[_0xd9c1('0x30')]=_[_0xd9c1('0x2a')](_0x28bd8a,_0xd9c1('0x27'));_0x2d2f1c[_0xd9c1('0x31')]=_[_0xd9c1('0x32')](_0x5a384b['query']);_0x2d2f1c['filters']=_['intersection'](_0x2d2f1c[_0xd9c1('0x30')],_0x2d2f1c['query']);_0x298042[_0xd9c1('0x33')]=_[_0xd9c1('0x34')](_0x2d2f1c['model'],qs[_0xd9c1('0x35')](_0x5a384b[_0xd9c1('0x31')][_0xd9c1('0x35')]));_0x298042[_0xd9c1('0x33')]=_0x298042[_0xd9c1('0x33')][_0xd9c1('0x36')]?_0x298042[_0xd9c1('0x33')]:_0x2d2f1c[_0xd9c1('0x30')];if(!_0x5a384b[_0xd9c1('0x31')][_0xd9c1('0x37')](_0xd9c1('0x38'))){_0x298042[_0xd9c1('0x1f')]=qs['limit'](_0x5a384b['query'][_0xd9c1('0x1f')]);_0x298042[_0xd9c1('0x1e')]=qs[_0xd9c1('0x1e')](_0x5a384b['query'][_0xd9c1('0x1e')]);}_0x298042[_0xd9c1('0x39')]=qs['sort'](_0x5a384b[_0xd9c1('0x31')][_0xd9c1('0x3a')]);_0x298042['where']=qs['filters'](_[_0xd9c1('0x3b')](_0x5a384b[_0xd9c1('0x31')],_0x2d2f1c[_0xd9c1('0x3c')]));if(_0x5a384b[_0xd9c1('0x31')][_0xd9c1('0x3d')]){_0x298042[_0xd9c1('0x3e')]=_['merge'](_0x298042[_0xd9c1('0x3e')],{'$or':_[_0xd9c1('0x2a')](_0x28bd8a,function(_0x46eb36){if(_0x46eb36['type']!==_0xd9c1('0x3f')){var _0x13b41f={};_0x13b41f[_0x46eb36[_0xd9c1('0x27')]]={'$like':'%'+_0x5a384b[_0xd9c1('0x31')][_0xd9c1('0x3d')]+'%'};return _0x13b41f;}})});}_0x298042=_[_0xd9c1('0x40')]({},_0x298042,_0x5a384b[_0xd9c1('0x41')]);var _0x2fa7c4={'where':_0x298042[_0xd9c1('0x3e')]};return db[_0xd9c1('0x2b')]['count'](_0x2fa7c4)[_0xd9c1('0x24')](function(_0x3d5cd8){_0x5e193f['count']=_0x3d5cd8;if(_0x5a384b['query']['includeAll']){_0x298042[_0xd9c1('0x42')]=[{'all':!![]}];}return db[_0xd9c1('0x2b')][_0xd9c1('0x43')](_0x298042);})[_0xd9c1('0x24')](function(_0x518cfa){_0x5e193f[_0xd9c1('0x44')]=_0x518cfa;return _0x5e193f;})[_0xd9c1('0x24')](respondWithFilteredResult(_0x4dcc10,_0x298042))[_0xd9c1('0x45')](handleError(_0x4dcc10,null));};exports['show']=function(_0x59a5bd,_0x2bb617){var _0xbf9915={'raw':!![],'where':{'id':_0x59a5bd[_0xd9c1('0x46')]['id']}},_0x282332={};_0x282332[_0xd9c1('0x30')]=_[_0xd9c1('0x32')](db[_0xd9c1('0x2b')][_0xd9c1('0x2c')]);_0x282332[_0xd9c1('0x31')]=_['keys'](_0x59a5bd[_0xd9c1('0x31')]);_0x282332[_0xd9c1('0x3c')]=_[_0xd9c1('0x34')](_0x282332['model'],_0x282332['query']);_0xbf9915[_0xd9c1('0x33')]=_['intersection'](_0x282332[_0xd9c1('0x30')],qs['fields'](_0x59a5bd['query'][_0xd9c1('0x35')]));_0xbf9915[_0xd9c1('0x33')]=_0xbf9915[_0xd9c1('0x33')][_0xd9c1('0x36')]?_0xbf9915[_0xd9c1('0x33')]:_0x282332[_0xd9c1('0x30')];if(_0x59a5bd[_0xd9c1('0x31')][_0xd9c1('0x47')]){_0xbf9915[_0xd9c1('0x42')]=[{'all':!![]}];}_0xbf9915=_[_0xd9c1('0x40')]({},_0xbf9915,_0x59a5bd[_0xd9c1('0x41')]);return db[_0xd9c1('0x2b')][_0xd9c1('0x48')](_0xbf9915)[_0xd9c1('0x24')](handleEntityNotFound(_0x2bb617,null))[_0xd9c1('0x24')](respondWithResult(_0x2bb617,null))[_0xd9c1('0x45')](handleError(_0x2bb617,null));};exports['create']=function(_0x4615ca,_0x4966fc){return db['OpenchannelQueueReport'][_0xd9c1('0x49')](_0x4615ca[_0xd9c1('0x4a')],{})[_0xd9c1('0x24')](respondWithResult(_0x4966fc,0xc9))[_0xd9c1('0x45')](handleError(_0x4966fc,null));};exports[_0xd9c1('0x4b')]=function(_0x46cb82,_0xdc46d7){if(_0x46cb82[_0xd9c1('0x4a')]['id']){delete _0x46cb82[_0xd9c1('0x4a')]['id'];}return db[_0xd9c1('0x2b')]['find']({'where':{'id':_0x46cb82[_0xd9c1('0x46')]['id']}})['then'](handleEntityNotFound(_0xdc46d7,null))['then'](saveUpdates(_0x46cb82[_0xd9c1('0x4a')],null))[_0xd9c1('0x24')](respondWithResult(_0xdc46d7,null))[_0xd9c1('0x45')](handleError(_0xdc46d7,null));};exports[_0xd9c1('0x25')]=function(_0x238fb9,_0x5cd01e){return db[_0xd9c1('0x2b')][_0xd9c1('0x48')]({'where':{'id':_0x238fb9['params']['id']}})[_0xd9c1('0x24')](handleEntityNotFound(_0x5cd01e,null))[_0xd9c1('0x24')](removeEntity(_0x5cd01e,null))[_0xd9c1('0x45')](handleError(_0x5cd01e,null));};exports[_0xd9c1('0x4c')]=function(_0x437a6a,_0x4c42b6){return db[_0xd9c1('0x2b')][_0xd9c1('0x4c')]()[_0xd9c1('0x24')](respondWithResult(_0x4c42b6,null))[_0xd9c1('0x45')](handleError(_0x4c42b6,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 4bc292c..ba51f65 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 _0x010a=['path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','util','api','moment','request-promise'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x010a,0x1f4));var _0xa010=function(_0x3dde27,_0x3d286b){_0x3dde27=_0x3dde27-0x0;var _0x3948c8=_0x010a[_0x3dde27];return _0x3948c8;};'use strict';var _=require('lodash');var util=require(_0xa010('0x0'));var logger=require('../../config/logger')(_0xa010('0x1'));var moment=require(_0xa010('0x2'));var BPromise=require('bluebird');var rp=require(_0xa010('0x3'));var fs=require('fs');var path=require(_0xa010('0x4'));var rimraf=require(_0xa010('0x5'));var config=require(_0xa010('0x6'));var attributes=require(_0xa010('0x7'));module[_0xa010('0x8')]=function(_0x198d67,_0x1f2f47){return _0x198d67[_0xa010('0x9')]('OpenchannelQueueReport',attributes,{'tableName':_0xa010('0xa'),'paranoid':![],'indexes':[{'name':_0xa010('0xb'),'fields':[_0xa010('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c29=['../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','../../config/logger','moment','bluebird','request-promise'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x0c29,0xb7));var _0x90c2=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0x0c29[_0x55ff79];return _0x579067;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x90c2('0x0'))('api');var moment=require(_0x90c2('0x1'));var BPromise=require(_0x90c2('0x2'));var rp=require(_0x90c2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x90c2('0x4'));var attributes=require(_0x90c2('0x5'));module[_0x90c2('0x6')]=function(_0x1aa5a4,_0xfbe17b){return _0x1aa5a4[_0x90c2('0x7')](_0x90c2('0x8'),attributes,{'tableName':_0x90c2('0x9'),'paranoid':![],'indexes':[{'name':_0x90c2('0xa'),'fields':[_0x90c2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 98f937d..a42bdc7 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 _0x2272=['raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options'];(function(_0x57908b,_0x3cf5c3){var _0x222de9=function(_0x1cb3e6){while(--_0x1cb3e6){_0x57908b['push'](_0x57908b['shift']());}};_0x222de9(++_0x3cf5c3);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')](_0x531f75[_0x2227('0x1b')],{'raw':_0x531f75[_0x2227('0x1c')]?_0x531f75['options'][_0x2227('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2b26b7){logger[_0x2227('0xd')](_0x2227('0x18'),_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON[_0x2227('0x11')](_0x2b26b7));_0x620012(_0x2b26b7);})[_0x2227('0x17')](function(_0x10d9ca){logger[_0x2227('0x12')](_0x2227('0x18'),_0x10d9ca[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80['error'](0x1f4,_0x10d9ca[_0x2227('0x15')]));});});};exports[_0x2227('0x1e')]=function(_0x5b3a09){var _0x2cef4b=this;return new Promise(function(_0xbfdce1,_0x5ea1c3){return db['OpenchannelQueueReport'][_0x2227('0x1f')](_0x5b3a09[_0x2227('0x1b')],{'raw':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09[_0x2227('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09[_0x2227('0x1c')][_0x2227('0x20')]||null:null,'attributes':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09['options'][_0x2227('0x21')]||null:null,'limit':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09[_0x2227('0x1c')][_0x2227('0x22')]||null:null})[_0x2227('0xc')](function(_0x4789eb){logger['info']('UpdateOpenchannelQueueReport',_0x5b3a09);logger[_0x2227('0xf')]('UpdateOpenchannelQueueReport',_0x5b3a09,JSON[_0x2227('0x11')](_0x4789eb));_0xbfdce1(_0x4789eb);})[_0x2227('0x17')](function(_0x58609e){logger['error'](_0x2227('0x1e'),_0x58609e[_0x2227('0x15')],_0x5b3a09);_0x5ea1c3(_0x2cef4b[_0x2227('0x12')](0x1f4,_0x58609e['message']));});});}; \ No newline at end of file +var _0x80c4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','lodash','moment'];(function(_0x3d3951,_0x3cffe2){var _0x47f3a7=function(_0x595e33){while(--_0x595e33){_0x3d3951['push'](_0x3d3951['shift']());}};_0x47f3a7(++_0x3cffe2);}(_0x80c4,0xa3));var _0x480c=function(_0x2b0523,_0x3ed985){_0x2b0523=_0x2b0523-0x0;var _0x31ca51=_0x80c4[_0x2b0523];return _0x31ca51;};'use strict';var _=require(_0x480c('0x0'));var util=require('util');var moment=require(_0x480c('0x1'));var BPromise=require(_0x480c('0x2'));var rs=require(_0x480c('0x3'));var fs=require('fs');var Redis=require(_0x480c('0x4'));var db=require(_0x480c('0x5'))['db'];var utils=require(_0x480c('0x6'));var logger=require('../../config/logger')(_0x480c('0x7'));var config=require(_0x480c('0x8'));var jayson=require(_0x480c('0x9'));var client=jayson[_0x480c('0xa')][_0x480c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40a5a6,_0x3a69ec,_0x277efe){return new BPromise(function(_0x21545d,_0x510038){return client[_0x480c('0xc')](_0x40a5a6,_0x277efe)[_0x480c('0xd')](function(_0x292aca){logger[_0x480c('0xe')](_0x480c('0xf'),_0x3a69ec,_0x480c('0x10'));logger[_0x480c('0x11')](_0x480c('0x12'),_0x3a69ec,_0x480c('0x10'),JSON[_0x480c('0x13')](_0x292aca));if(_0x292aca[_0x480c('0x14')]){if(_0x292aca[_0x480c('0x14')][_0x480c('0x15')]===0x1f4){logger[_0x480c('0x14')](_0x480c('0xf'),_0x3a69ec,_0x292aca[_0x480c('0x14')][_0x480c('0x16')]);return _0x510038(_0x292aca[_0x480c('0x14')]['message']);}logger[_0x480c('0x14')](_0x480c('0xf'),_0x3a69ec,_0x292aca['error'][_0x480c('0x16')]);return _0x21545d(_0x292aca[_0x480c('0x14')][_0x480c('0x16')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3a69ec,_0x480c('0x10'));_0x21545d(_0x292aca[_0x480c('0x17')][_0x480c('0x16')]);}})[_0x480c('0x18')](function(_0x93d6c5){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3a69ec,_0x93d6c5);_0x510038(_0x93d6c5);});});}exports['CreateOpenchannelQueueReport']=function(_0xfc8a9f){var _0x4412aa=this;return new Promise(function(_0x54750c,_0x172103){return db['OpenchannelQueueReport'][_0x480c('0x19')](_0xfc8a9f[_0x480c('0x1a')],{'raw':_0xfc8a9f[_0x480c('0x1b')]?_0xfc8a9f['options'][_0x480c('0x1c')]===undefined?!![]:![]:!![]})[_0x480c('0xd')](function(_0x9e5a12){logger['info'](_0x480c('0x1d'),_0xfc8a9f);logger['debug'](_0x480c('0x1d'),_0xfc8a9f,JSON[_0x480c('0x13')](_0x9e5a12));_0x54750c(_0x9e5a12);})['catch'](function(_0x3b5bca){logger[_0x480c('0x14')](_0x480c('0x1d'),_0x3b5bca[_0x480c('0x16')],_0xfc8a9f);_0x172103(_0x4412aa['error'](0x1f4,_0x3b5bca[_0x480c('0x16')]));});});};exports[_0x480c('0x1e')]=function(_0x5288f5){var _0xdc044f=this;return new Promise(function(_0x34238b,_0x16ddd6){return db[_0x480c('0x1f')][_0x480c('0x20')](_0x5288f5[_0x480c('0x1a')],{'raw':_0x5288f5[_0x480c('0x1b')]?_0x5288f5[_0x480c('0x1b')][_0x480c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5288f5[_0x480c('0x1b')]?_0x5288f5[_0x480c('0x1b')]['where']||null:null,'attributes':_0x5288f5['options']?_0x5288f5[_0x480c('0x1b')]['attributes']||null:null,'limit':_0x5288f5['options']?_0x5288f5['options']['limit']||null:null})[_0x480c('0xd')](function(_0x6019aa){logger[_0x480c('0xe')](_0x480c('0x1e'),_0x5288f5);logger['debug']('UpdateOpenchannelQueueReport',_0x5288f5,JSON['stringify'](_0x6019aa));_0x34238b(_0x6019aa);})[_0x480c('0x18')](function(_0x3eabb3){logger[_0x480c('0x14')](_0x480c('0x1e'),_0x3eabb3['message'],_0x5288f5);_0x16ddd6(_0xdc044f['error'](0x1f4,_0x3eabb3[_0x480c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 5f9a1fb..396da12 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(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x28a5ad,_0x520afa){var _0x176b8a=function(_0x3d71b){while(--_0x3d71b){_0x28a5ad['push'](_0x28a5ad['shift']());}};_0x176b8a(++_0x520afa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 e91fbfd..1af80d1 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 _0xbb9d=['exports','STRING','account','agent','queue','DATE','moment','sequelize'];(function(_0x4bd8e1,_0x5e9388){var _0x286282=function(_0x26485f){while(--_0x26485f){_0x4bd8e1['push'](_0x4bd8e1['shift']());}};_0x286282(++_0x5e9388);}(_0xbb9d,0x14e));var _0xdbb9=function(_0x53ef01,_0x49631a){_0x53ef01=_0x53ef01-0x0;var _0x4f9f64=_0xbb9d[_0x53ef01];return _0x4f9f64;};'use strict';var moment=require(_0xdbb9('0x0'));var Sequelize=require(_0xdbb9('0x1'));module[_0xdbb9('0x2')]={'uniqueid':{'type':Sequelize[_0xdbb9('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xdbb9('0x4'),_0xdbb9('0x5'),_0xdbb9('0x6')),'allowNull':![],'defaultValue':_0xdbb9('0x6')},'transferredAt':{'type':Sequelize[_0xdbb9('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x5fca=['ENUM','account','agent','queue','NOW','moment','sequelize','exports','STRING'];(function(_0x51bc8b,_0x2c8aca){var _0x279f96=function(_0x49e59e){while(--_0x49e59e){_0x51bc8b['push'](_0x51bc8b['shift']());}};_0x279f96(++_0x2c8aca);}(_0x5fca,0x95));var _0xa5fc=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x5fca[_0x11a220];return _0x20d8fe;};'use strict';var moment=require(_0xa5fc('0x0'));var Sequelize=require(_0xa5fc('0x1'));module[_0xa5fc('0x2')]={'uniqueid':{'type':Sequelize[_0xa5fc('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa5fc('0x4')](_0xa5fc('0x5'),_0xa5fc('0x6'),_0xa5fc('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xa5fc('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 55dea63..97c2d8b 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 _0xd230=['catch','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','OpenchannelTransferReport','include','findAll','rows','show','params','rawAttributes','options','find'];(function(_0x256dc7,_0x3ea90f){var _0xd28d46=function(_0x2c4393){while(--_0x2c4393){_0x256dc7['push'](_0x256dc7['shift']());}};_0xd28d46(++_0x3ea90f);}(_0xd230,0x128));var _0x0d23=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xd230[_0x46aff0];return _0x9d78cf;};'use strict';var pdf=require(_0x0d23('0x0'));var emlformat=require(_0x0d23('0x1'));var rimraf=require(_0x0d23('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d23('0x3'));var rp=require(_0x0d23('0x4'));var moment=require(_0x0d23('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0d23('0x6'));var sox=require(_0x0d23('0x7'));var csv=require(_0x0d23('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0d23('0x9'));var crypto=require(_0x0d23('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0d23('0xb'));var toCsv=require(_0x0d23('0x8'));var querystring=require(_0x0d23('0xc'));var Papa=require('papaparse');var Redis=require(_0x0d23('0xd'));var authService=require(_0x0d23('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d23('0xf'));var logger=require(_0x0d23('0x10'))(_0x0d23('0x11'));var utils=require(_0x0d23('0x12'));var config=require('../../config/environment');var db=require(_0x0d23('0x13'))['db'];function respondWithStatusCode(_0x380dda,_0x2d56b7){_0x2d56b7=_0x2d56b7||0xcc;return function(_0x5435fd){if(_0x5435fd){return _0x380dda[_0x0d23('0x14')](_0x2d56b7);}return _0x380dda[_0x0d23('0x15')](_0x2d56b7)[_0x0d23('0x16')]();};}function respondWithResult(_0x226fb1,_0x2942e4){_0x2942e4=_0x2942e4||0xc8;return function(_0x27edf6){if(_0x27edf6){return _0x226fb1['status'](_0x2942e4)['json'](_0x27edf6);}};}function respondWithFilteredResult(_0x1c3d9c,_0x5f98bd){return function(_0x5e2f64){if(_0x5e2f64){var _0x186774=_0x5e2f64[_0x0d23('0x17')],_0x19fff3=_0x5f98bd[_0x0d23('0x18')],_0x56ead4=_0x5f98bd['offset']+_0x5f98bd[_0x0d23('0x19')],_0x5441a6;if(_0x56ead4>=_0x186774){_0x56ead4=_0x186774;_0x5441a6=0xc8;}else{_0x5441a6=0xce;}_0x1c3d9c[_0x0d23('0x15')](_0x5441a6);return _0x1c3d9c[_0x0d23('0x1a')](_0x0d23('0x1b'),_0x19fff3+'-'+_0x56ead4+'/'+_0x186774)[_0x0d23('0x1c')](_0x5e2f64);}return null;};}function patchUpdates(_0x236136){return function(_0x595ab2){try{jsonpatch[_0x0d23('0x1d')](_0x595ab2,_0x236136,!![]);}catch(_0x1f6111){return BPromise['reject'](_0x1f6111);}return _0x595ab2[_0x0d23('0x1e')]();};}function saveUpdates(_0x529b29,_0x31cb2d){return function(_0x378550){if(_0x378550){return _0x378550[_0x0d23('0x1f')](_0x529b29)[_0x0d23('0x20')](function(_0x10d2cc){return _0x10d2cc;});}return null;};}function removeEntity(_0x55d9d5,_0x3e575b){return function(_0x27b1c3){if(_0x27b1c3){return _0x27b1c3[_0x0d23('0x21')]()[_0x0d23('0x20')](function(){_0x55d9d5['status'](0xcc)[_0x0d23('0x16')]();});}};}function handleEntityNotFound(_0x96e948,_0x15d30e){return function(_0x23e605){if(!_0x23e605){_0x96e948[_0x0d23('0x14')](0x194);}return _0x23e605;};}function handleError(_0x4d3fc3,_0x27c032){_0x27c032=_0x27c032||0x1f4;return function(_0x3bfe7e){logger[_0x0d23('0x22')](_0x3bfe7e[_0x0d23('0x23')]);if(_0x3bfe7e[_0x0d23('0x24')]){delete _0x3bfe7e[_0x0d23('0x24')];}_0x4d3fc3[_0x0d23('0x15')](_0x27c032)[_0x0d23('0x25')](_0x3bfe7e);};}exports[_0x0d23('0x26')]=function(_0x1e3e97,_0x52d836){var _0x19655a={},_0x2883d8={},_0x3bb97f={'count':0x0,'rows':[]};var _0x225cb6=_[_0x0d23('0x27')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x5740c0){return{'name':_0x5740c0[_0x0d23('0x28')],'type':_0x5740c0[_0x0d23('0x29')][_0x0d23('0x2a')]};});_0x2883d8[_0x0d23('0x2b')]=_[_0x0d23('0x27')](_0x225cb6,_0x0d23('0x24'));_0x2883d8[_0x0d23('0x2c')]=_[_0x0d23('0x2d')](_0x1e3e97['query']);_0x2883d8[_0x0d23('0x2e')]=_[_0x0d23('0x2f')](_0x2883d8['model'],_0x2883d8['query']);_0x19655a[_0x0d23('0x30')]=_['intersection'](_0x2883d8[_0x0d23('0x2b')],qs[_0x0d23('0x31')](_0x1e3e97[_0x0d23('0x2c')][_0x0d23('0x31')]));_0x19655a[_0x0d23('0x30')]=_0x19655a['attributes'][_0x0d23('0x32')]?_0x19655a['attributes']:_0x2883d8[_0x0d23('0x2b')];if(!_0x1e3e97[_0x0d23('0x2c')][_0x0d23('0x33')](_0x0d23('0x34'))){_0x19655a[_0x0d23('0x19')]=qs[_0x0d23('0x19')](_0x1e3e97[_0x0d23('0x2c')][_0x0d23('0x19')]);_0x19655a[_0x0d23('0x18')]=qs[_0x0d23('0x18')](_0x1e3e97['query']['offset']);}_0x19655a[_0x0d23('0x35')]=qs[_0x0d23('0x36')](_0x1e3e97[_0x0d23('0x2c')][_0x0d23('0x36')]);_0x19655a[_0x0d23('0x37')]=qs[_0x0d23('0x2e')](_[_0x0d23('0x38')](_0x1e3e97['query'],_0x2883d8[_0x0d23('0x2e')]));if(_0x1e3e97[_0x0d23('0x2c')][_0x0d23('0x39')]){_0x19655a[_0x0d23('0x37')]=_['merge'](_0x19655a[_0x0d23('0x37')],{'$or':_[_0x0d23('0x27')](_0x225cb6,function(_0x4d4d06){if(_0x4d4d06[_0x0d23('0x29')]!==_0x0d23('0x3a')){var _0x4c2918={};_0x4c2918[_0x4d4d06[_0x0d23('0x24')]]={'$like':'%'+_0x1e3e97[_0x0d23('0x2c')][_0x0d23('0x39')]+'%'};return _0x4c2918;}})});}_0x19655a=_[_0x0d23('0x3b')]({},_0x19655a,_0x1e3e97['options']);var _0xff77f9={'where':_0x19655a[_0x0d23('0x37')]};return db[_0x0d23('0x3c')][_0x0d23('0x17')](_0xff77f9)[_0x0d23('0x20')](function(_0x25a8b5){_0x3bb97f['count']=_0x25a8b5;if(_0x1e3e97[_0x0d23('0x2c')]['includeAll']){_0x19655a[_0x0d23('0x3d')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x0d23('0x3e')](_0x19655a);})[_0x0d23('0x20')](function(_0x492789){_0x3bb97f[_0x0d23('0x3f')]=_0x492789;return _0x3bb97f;})['then'](respondWithFilteredResult(_0x52d836,_0x19655a))['catch'](handleError(_0x52d836,null));};exports[_0x0d23('0x40')]=function(_0x135ddb,_0xf4f95d){var _0x3577e3={'raw':!![],'where':{'id':_0x135ddb[_0x0d23('0x41')]['id']}},_0x16b4fa={};_0x16b4fa[_0x0d23('0x2b')]=_[_0x0d23('0x2d')](db[_0x0d23('0x3c')][_0x0d23('0x42')]);_0x16b4fa['query']=_[_0x0d23('0x2d')](_0x135ddb[_0x0d23('0x2c')]);_0x16b4fa[_0x0d23('0x2e')]=_['intersection'](_0x16b4fa[_0x0d23('0x2b')],_0x16b4fa['query']);_0x3577e3[_0x0d23('0x30')]=_['intersection'](_0x16b4fa[_0x0d23('0x2b')],qs[_0x0d23('0x31')](_0x135ddb[_0x0d23('0x2c')]['fields']));_0x3577e3['attributes']=_0x3577e3[_0x0d23('0x30')][_0x0d23('0x32')]?_0x3577e3[_0x0d23('0x30')]:_0x16b4fa[_0x0d23('0x2b')];if(_0x135ddb[_0x0d23('0x2c')]['includeAll']){_0x3577e3[_0x0d23('0x3d')]=[{'all':!![]}];}_0x3577e3=_['merge']({},_0x3577e3,_0x135ddb[_0x0d23('0x43')]);return db[_0x0d23('0x3c')][_0x0d23('0x44')](_0x3577e3)[_0x0d23('0x20')](handleEntityNotFound(_0xf4f95d,null))[_0x0d23('0x20')](respondWithResult(_0xf4f95d,null))[_0x0d23('0x45')](handleError(_0xf4f95d,null));};exports[_0x0d23('0x46')]=function(_0x27dacd,_0x472762){return db[_0x0d23('0x3c')][_0x0d23('0x46')](_0x27dacd['body'],{})['then'](respondWithResult(_0x472762,0xc9))[_0x0d23('0x45')](handleError(_0x472762,null));};exports[_0x0d23('0x1f')]=function(_0x584c6c,_0x1f4f42){if(_0x584c6c[_0x0d23('0x47')]['id']){delete _0x584c6c[_0x0d23('0x47')]['id'];}return db[_0x0d23('0x3c')][_0x0d23('0x44')]({'where':{'id':_0x584c6c['params']['id']}})[_0x0d23('0x20')](handleEntityNotFound(_0x1f4f42,null))[_0x0d23('0x20')](saveUpdates(_0x584c6c[_0x0d23('0x47')],null))[_0x0d23('0x20')](respondWithResult(_0x1f4f42,null))[_0x0d23('0x45')](handleError(_0x1f4f42,null));};exports['destroy']=function(_0x9241b8,_0x26f0ac){return db['OpenchannelTransferReport'][_0x0d23('0x44')]({'where':{'id':_0x9241b8[_0x0d23('0x41')]['id']}})[_0x0d23('0x20')](handleEntityNotFound(_0x26f0ac,null))['then'](removeEntity(_0x26f0ac,null))[_0x0d23('0x45')](handleError(_0x26f0ac,null));};exports[_0x0d23('0x48')]=function(_0xac0e8b,_0x517c1f){return db['OpenchannelTransferReport']['describe']()['then'](respondWithResult(_0x517c1f,null))[_0x0d23('0x45')](handleError(_0x517c1f,null));}; \ No newline at end of file +var _0x53ba=['end','status','count','offset','limit','set','Content-Range','json','save','update','destroy','then','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x364d70,_0x378fa0){var _0x57890c=function(_0x3db0f4){while(--_0x3db0f4){_0x364d70['push'](_0x364d70['shift']());}};_0x57890c(++_0x378fa0);}(_0x53ba,0x158));var _0xa53b=function(_0x16cdf9,_0x3cbd88){_0x16cdf9=_0x16cdf9-0x0;var _0x2eadb8=_0x53ba[_0x16cdf9];return _0x2eadb8;};'use strict';var pdf=require(_0xa53b('0x0'));var emlformat=require(_0xa53b('0x1'));var rimraf=require(_0xa53b('0x2'));var zipdir=require(_0xa53b('0x3'));var jsonpatch=require(_0xa53b('0x4'));var rp=require('request-promise');var moment=require(_0xa53b('0x5'));var BPromise=require(_0xa53b('0x6'));var Mustache=require(_0xa53b('0x7'));var util=require(_0xa53b('0x8'));var path=require(_0xa53b('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa53b('0xa'));var fs=require('fs');var _=require(_0xa53b('0xb'));var squel=require(_0xa53b('0xc'));var crypto=require(_0xa53b('0xd'));var jsforce=require(_0xa53b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa53b('0xf'));var querystring=require(_0xa53b('0x10'));var Papa=require(_0xa53b('0x11'));var Redis=require('ioredis');var authService=require(_0xa53b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa53b('0x13'));var hardwareService=require(_0xa53b('0x14'));var logger=require(_0xa53b('0x15'))(_0xa53b('0x16'));var utils=require('../../config/utils');var config=require(_0xa53b('0x17'));var db=require(_0xa53b('0x18'))['db'];function respondWithStatusCode(_0x4394fc,_0x513205){_0x513205=_0x513205||0xcc;return function(_0x496198){if(_0x496198){return _0x4394fc[_0xa53b('0x19')](_0x513205);}return _0x4394fc['status'](_0x513205)[_0xa53b('0x1a')]();};}function respondWithResult(_0x2f6f3a,_0x50aa4c){_0x50aa4c=_0x50aa4c||0xc8;return function(_0x386390){if(_0x386390){return _0x2f6f3a[_0xa53b('0x1b')](_0x50aa4c)['json'](_0x386390);}};}function respondWithFilteredResult(_0x14b00a,_0x158788){return function(_0x38fb83){if(_0x38fb83){var _0x8468c4=_0x38fb83[_0xa53b('0x1c')],_0x39071b=_0x158788['offset'],_0x22a6a2=_0x158788[_0xa53b('0x1d')]+_0x158788[_0xa53b('0x1e')],_0x4c1f02;if(_0x22a6a2>=_0x8468c4){_0x22a6a2=_0x8468c4;_0x4c1f02=0xc8;}else{_0x4c1f02=0xce;}_0x14b00a[_0xa53b('0x1b')](_0x4c1f02);return _0x14b00a[_0xa53b('0x1f')](_0xa53b('0x20'),_0x39071b+'-'+_0x22a6a2+'/'+_0x8468c4)[_0xa53b('0x21')](_0x38fb83);}return null;};}function patchUpdates(_0x5f3b74){return function(_0x54cfb3){try{jsonpatch['apply'](_0x54cfb3,_0x5f3b74,!![]);}catch(_0x3bed57){return BPromise['reject'](_0x3bed57);}return _0x54cfb3[_0xa53b('0x22')]();};}function saveUpdates(_0x1974b0,_0x3ea332){return function(_0x5a4212){if(_0x5a4212){return _0x5a4212[_0xa53b('0x23')](_0x1974b0)['then'](function(_0xe2efa9){return _0xe2efa9;});}return null;};}function removeEntity(_0x3a35e9,_0x20c2cd){return function(_0x1173da){if(_0x1173da){return _0x1173da[_0xa53b('0x24')]()[_0xa53b('0x25')](function(){_0x3a35e9['status'](0xcc)[_0xa53b('0x1a')]();});}};}function handleEntityNotFound(_0x3c5135,_0x15e4e9){return function(_0x3bd46d){if(!_0x3bd46d){_0x3c5135[_0xa53b('0x19')](0x194);}return _0x3bd46d;};}function handleError(_0x1640bd,_0x48703b){_0x48703b=_0x48703b||0x1f4;return function(_0x5a69b7){logger[_0xa53b('0x26')](_0x5a69b7[_0xa53b('0x27')]);if(_0x5a69b7[_0xa53b('0x28')]){delete _0x5a69b7['name'];}_0x1640bd[_0xa53b('0x1b')](_0x48703b)['send'](_0x5a69b7);};}exports[_0xa53b('0x29')]=function(_0x1aaa9d,_0x719e22){var _0x3965cf={},_0x45fde9={},_0x1f3418={'count':0x0,'rows':[]};var _0x1cf33b=_[_0xa53b('0x2a')](db[_0xa53b('0x2b')][_0xa53b('0x2c')],function(_0x29d697){return{'name':_0x29d697[_0xa53b('0x2d')],'type':_0x29d697[_0xa53b('0x2e')][_0xa53b('0x2f')]};});_0x45fde9[_0xa53b('0x30')]=_[_0xa53b('0x2a')](_0x1cf33b,_0xa53b('0x28'));_0x45fde9[_0xa53b('0x31')]=_['keys'](_0x1aaa9d[_0xa53b('0x31')]);_0x45fde9[_0xa53b('0x32')]=_[_0xa53b('0x33')](_0x45fde9['model'],_0x45fde9['query']);_0x3965cf[_0xa53b('0x34')]=_[_0xa53b('0x33')](_0x45fde9['model'],qs[_0xa53b('0x35')](_0x1aaa9d[_0xa53b('0x31')][_0xa53b('0x35')]));_0x3965cf[_0xa53b('0x34')]=_0x3965cf[_0xa53b('0x34')][_0xa53b('0x36')]?_0x3965cf[_0xa53b('0x34')]:_0x45fde9[_0xa53b('0x30')];if(!_0x1aaa9d[_0xa53b('0x31')][_0xa53b('0x37')]('nolimit')){_0x3965cf[_0xa53b('0x1e')]=qs[_0xa53b('0x1e')](_0x1aaa9d['query'][_0xa53b('0x1e')]);_0x3965cf[_0xa53b('0x1d')]=qs[_0xa53b('0x1d')](_0x1aaa9d[_0xa53b('0x31')]['offset']);}_0x3965cf[_0xa53b('0x38')]=qs[_0xa53b('0x39')](_0x1aaa9d[_0xa53b('0x31')][_0xa53b('0x39')]);_0x3965cf[_0xa53b('0x3a')]=qs[_0xa53b('0x32')](_[_0xa53b('0x3b')](_0x1aaa9d[_0xa53b('0x31')],_0x45fde9[_0xa53b('0x32')]));if(_0x1aaa9d[_0xa53b('0x31')]['filter']){_0x3965cf[_0xa53b('0x3a')]=_[_0xa53b('0x3c')](_0x3965cf[_0xa53b('0x3a')],{'$or':_[_0xa53b('0x2a')](_0x1cf33b,function(_0x5adc98){if(_0x5adc98[_0xa53b('0x2e')]!==_0xa53b('0x3d')){var _0x239114={};_0x239114[_0x5adc98['name']]={'$like':'%'+_0x1aaa9d[_0xa53b('0x31')]['filter']+'%'};return _0x239114;}})});}_0x3965cf=_[_0xa53b('0x3c')]({},_0x3965cf,_0x1aaa9d[_0xa53b('0x3e')]);var _0x3062bf={'where':_0x3965cf[_0xa53b('0x3a')]};return db[_0xa53b('0x2b')]['count'](_0x3062bf)[_0xa53b('0x25')](function(_0xf3610b){_0x1f3418[_0xa53b('0x1c')]=_0xf3610b;if(_0x1aaa9d[_0xa53b('0x31')][_0xa53b('0x3f')]){_0x3965cf[_0xa53b('0x40')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xa53b('0x41')](_0x3965cf);})[_0xa53b('0x25')](function(_0x515fef){_0x1f3418['rows']=_0x515fef;return _0x1f3418;})[_0xa53b('0x25')](respondWithFilteredResult(_0x719e22,_0x3965cf))[_0xa53b('0x42')](handleError(_0x719e22,null));};exports[_0xa53b('0x43')]=function(_0x4d8064,_0x41796a){var _0x42da39={'raw':!![],'where':{'id':_0x4d8064['params']['id']}},_0x325202={};_0x325202[_0xa53b('0x30')]=_['keys'](db[_0xa53b('0x2b')][_0xa53b('0x2c')]);_0x325202['query']=_[_0xa53b('0x44')](_0x4d8064[_0xa53b('0x31')]);_0x325202[_0xa53b('0x32')]=_[_0xa53b('0x33')](_0x325202[_0xa53b('0x30')],_0x325202[_0xa53b('0x31')]);_0x42da39['attributes']=_[_0xa53b('0x33')](_0x325202['model'],qs[_0xa53b('0x35')](_0x4d8064[_0xa53b('0x31')][_0xa53b('0x35')]));_0x42da39[_0xa53b('0x34')]=_0x42da39[_0xa53b('0x34')]['length']?_0x42da39['attributes']:_0x325202['model'];if(_0x4d8064[_0xa53b('0x31')]['includeAll']){_0x42da39[_0xa53b('0x40')]=[{'all':!![]}];}_0x42da39=_[_0xa53b('0x3c')]({},_0x42da39,_0x4d8064[_0xa53b('0x3e')]);return db[_0xa53b('0x2b')][_0xa53b('0x45')](_0x42da39)[_0xa53b('0x25')](handleEntityNotFound(_0x41796a,null))[_0xa53b('0x25')](respondWithResult(_0x41796a,null))[_0xa53b('0x42')](handleError(_0x41796a,null));};exports[_0xa53b('0x46')]=function(_0x2084a0,_0x338132){return db[_0xa53b('0x2b')][_0xa53b('0x46')](_0x2084a0[_0xa53b('0x47')],{})[_0xa53b('0x25')](respondWithResult(_0x338132,0xc9))[_0xa53b('0x42')](handleError(_0x338132,null));};exports[_0xa53b('0x23')]=function(_0x33c04e,_0x2281ab){if(_0x33c04e[_0xa53b('0x47')]['id']){delete _0x33c04e[_0xa53b('0x47')]['id'];}return db[_0xa53b('0x2b')][_0xa53b('0x45')]({'where':{'id':_0x33c04e[_0xa53b('0x48')]['id']}})['then'](handleEntityNotFound(_0x2281ab,null))[_0xa53b('0x25')](saveUpdates(_0x33c04e['body'],null))['then'](respondWithResult(_0x2281ab,null))[_0xa53b('0x42')](handleError(_0x2281ab,null));};exports[_0xa53b('0x24')]=function(_0x494797,_0x2d061e){return db['OpenchannelTransferReport'][_0xa53b('0x45')]({'where':{'id':_0x494797[_0xa53b('0x48')]['id']}})[_0xa53b('0x25')](handleEntityNotFound(_0x2d061e,null))[_0xa53b('0x25')](removeEntity(_0x2d061e,null))[_0xa53b('0x42')](handleError(_0x2d061e,null));};exports[_0xa53b('0x49')]=function(_0x4ffb53,_0x530890){return db[_0xa53b('0x2b')][_0xa53b('0x49')]()[_0xa53b('0x25')](respondWithResult(_0x530890,null))[_0xa53b('0x42')](handleError(_0x530890,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 2eb697d..cf280ad 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 _0xf3e8=['api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x1b51a8,_0x4f106b){var _0x2945dd=function(_0x4c9cc1){while(--_0x4c9cc1){_0x1b51a8['push'](_0x1b51a8['shift']());}};_0x2945dd(++_0x4f106b);}(_0xf3e8,0x1b8));var _0x8f3e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf3e8[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8f3e('0x0'));var util=require(_0x8f3e('0x1'));var logger=require('../../config/logger')(_0x8f3e('0x2'));var moment=require('moment');var BPromise=require(_0x8f3e('0x3'));var rp=require(_0x8f3e('0x4'));var fs=require('fs');var path=require(_0x8f3e('0x5'));var rimraf=require(_0x8f3e('0x6'));var config=require(_0x8f3e('0x7'));var attributes=require(_0x8f3e('0x8'));module[_0x8f3e('0x9')]=function(_0x1e067c,_0x1e0a04){return _0x1e067c['define'](_0x8f3e('0xa'),attributes,{'tableName':_0x8f3e('0xb'),'paranoid':![],'indexes':[{'name':_0x8f3e('0xc'),'fields':[_0x8f3e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94a6=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x47ffce,_0x187178){var _0xfeabd7=function(_0x48bc7f){while(--_0x48bc7f){_0x47ffce['push'](_0x47ffce['shift']());}};_0xfeabd7(++_0x187178);}(_0x94a6,0x9d));var _0x694a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94a6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x694a('0x0'));var util=require(_0x694a('0x1'));var logger=require(_0x694a('0x2'))(_0x694a('0x3'));var moment=require(_0x694a('0x4'));var BPromise=require('bluebird');var rp=require(_0x694a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x694a('0x6'));var attributes=require(_0x694a('0x7'));module['exports']=function(_0x48201c,_0xef87eb){return _0x48201c[_0x694a('0x8')](_0x694a('0x9'),attributes,{'tableName':_0x694a('0xa'),'paranoid':![],'indexes':[{'name':_0x694a('0xb'),'fields':[_0x694a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 2873cc3..f06c0bf 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 _0x4ed0=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4ed0,0x79));var _0x04ed=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4ed0[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x04ed('0x0'));var util=require('util');var moment=require(_0x04ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x04ed('0x2'));var fs=require('fs');var Redis=require(_0x04ed('0x3'));var db=require(_0x04ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x04ed('0x5'))(_0x04ed('0x6'));var config=require('../../config/environment');var jayson=require(_0x04ed('0x7'));var client=jayson[_0x04ed('0x8')][_0x04ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x461e2d,_0xb69c27,_0x31e19e){return new BPromise(function(_0x2c1b25,_0x389eb6){return client[_0x04ed('0xa')](_0x461e2d,_0x31e19e)[_0x04ed('0xb')](function(_0x17560f){logger[_0x04ed('0xc')](_0x04ed('0xd'),_0xb69c27,_0x04ed('0xe'));logger['debug'](_0x04ed('0xf'),_0xb69c27,_0x04ed('0xe'),JSON[_0x04ed('0x10')](_0x17560f));if(_0x17560f[_0x04ed('0x11')]){if(_0x17560f['error']['code']===0x1f4){logger[_0x04ed('0x11')](_0x04ed('0xd'),_0xb69c27,_0x17560f['error'][_0x04ed('0x12')]);return _0x389eb6(_0x17560f[_0x04ed('0x11')][_0x04ed('0x12')]);}logger['error'](_0x04ed('0xd'),_0xb69c27,_0x17560f[_0x04ed('0x11')]['message']);return _0x2c1b25(_0x17560f[_0x04ed('0x11')]['message']);}else{logger[_0x04ed('0xc')](_0x04ed('0xd'),_0xb69c27,_0x04ed('0xe'));_0x2c1b25(_0x17560f[_0x04ed('0x13')][_0x04ed('0x12')]);}})[_0x04ed('0x14')](function(_0x5277f9){logger['error'](_0x04ed('0xd'),_0xb69c27,_0x5277f9);_0x389eb6(_0x5277f9);});});} \ No newline at end of file +var _0xf29c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util'];(function(_0x13b5b2,_0x514cc6){var _0x46d405=function(_0x1fad12){while(--_0x1fad12){_0x13b5b2['push'](_0x13b5b2['shift']());}};_0x46d405(++_0x514cc6);}(_0xf29c,0xc7));var _0xcf29=function(_0x4db4b8,_0x194916){_0x4db4b8=_0x4db4b8-0x0;var _0x254564=_0xf29c[_0x4db4b8];return _0x254564;};'use strict';var _=require('lodash');var util=require(_0xcf29('0x0'));var moment=require(_0xcf29('0x1'));var BPromise=require(_0xcf29('0x2'));var rs=require(_0xcf29('0x3'));var fs=require('fs');var Redis=require(_0xcf29('0x4'));var db=require(_0xcf29('0x5'))['db'];var utils=require(_0xcf29('0x6'));var logger=require(_0xcf29('0x7'))(_0xcf29('0x8'));var config=require(_0xcf29('0x9'));var jayson=require(_0xcf29('0xa'));var client=jayson[_0xcf29('0xb')][_0xcf29('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x157dfe,_0x15ab38,_0x435ced){return new BPromise(function(_0x4e6469,_0x5ec45f){return client[_0xcf29('0xd')](_0x157dfe,_0x435ced)[_0xcf29('0xe')](function(_0x2e9d52){logger[_0xcf29('0xf')](_0xcf29('0x10'),_0x15ab38,_0xcf29('0x11'));logger[_0xcf29('0x12')](_0xcf29('0x13'),_0x15ab38,_0xcf29('0x11'),JSON[_0xcf29('0x14')](_0x2e9d52));if(_0x2e9d52[_0xcf29('0x15')]){if(_0x2e9d52[_0xcf29('0x15')]['code']===0x1f4){logger[_0xcf29('0x15')](_0xcf29('0x10'),_0x15ab38,_0x2e9d52['error'][_0xcf29('0x16')]);return _0x5ec45f(_0x2e9d52['error'][_0xcf29('0x16')]);}logger[_0xcf29('0x15')](_0xcf29('0x10'),_0x15ab38,_0x2e9d52[_0xcf29('0x15')][_0xcf29('0x16')]);return _0x4e6469(_0x2e9d52[_0xcf29('0x15')][_0xcf29('0x16')]);}else{logger[_0xcf29('0xf')](_0xcf29('0x10'),_0x15ab38,'request\x20sent');_0x4e6469(_0x2e9d52[_0xcf29('0x17')]['message']);}})[_0xcf29('0x18')](function(_0x5f31f7){logger[_0xcf29('0x15')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x15ab38,_0x5f31f7);_0x5ec45f(_0x5f31f7);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index f7930ee..d61c311 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 _0xbdda=['show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./pause.controller','index','get','/:id','isAuthenticated'];(function(_0x599960,_0x292b74){var _0xae3b3c=function(_0x49b02a){while(--_0x49b02a){_0x599960['push'](_0x599960['shift']());}};_0xae3b3c(++_0x292b74);}(_0xbdda,0x79));var _0xabdd=function(_0x28a73e,_0x32559f){_0x28a73e=_0x28a73e-0x0;var _0x128bb9=_0xbdda[_0x28a73e];return _0x128bb9;};'use strict';var multer=require('multer');var util=require(_0xabdd('0x0'));var path=require(_0xabdd('0x1'));var timeout=require(_0xabdd('0x2'));var express=require(_0xabdd('0x3'));var router=express[_0xabdd('0x4')]();var auth=require(_0xabdd('0x5'));var interaction=require(_0xabdd('0x6'));var config=require('../../config/environment');var controller=require(_0xabdd('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xabdd('0x8')]);router[_0xabdd('0x9')](_0xabdd('0xa'),auth[_0xabdd('0xb')](),controller[_0xabdd('0xc')]);router[_0xabdd('0xd')]('/',auth[_0xabdd('0xb')](),controller['create']);router[_0xabdd('0xe')]('/:id',auth[_0xabdd('0xb')](),controller[_0xabdd('0xf')]);router[_0xabdd('0x10')](_0xabdd('0xa'),auth[_0xabdd('0xb')](),controller[_0xabdd('0x11')]);module[_0xabdd('0x12')]=router; \ No newline at end of file +var _0x43b9=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x439309,_0x3b6fcb){var _0x21c1be=function(_0x451029){while(--_0x451029){_0x439309['push'](_0x439309['shift']());}};_0x21c1be(++_0x3b6fcb);}(_0x43b9,0x76));var _0x943b=function(_0x55a652,_0x13a6de){_0x55a652=_0x55a652-0x0;var _0x40aa0a=_0x43b9[_0x55a652];return _0x40aa0a;};'use strict';var multer=require(_0x943b('0x0'));var util=require(_0x943b('0x1'));var path=require(_0x943b('0x2'));var timeout=require(_0x943b('0x3'));var express=require(_0x943b('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x943b('0x5'));var config=require(_0x943b('0x6'));var controller=require(_0x943b('0x7'));router[_0x943b('0x8')]('/',auth[_0x943b('0x9')](),controller[_0x943b('0xa')]);router[_0x943b('0x8')](_0x943b('0xb'),auth[_0x943b('0x9')](),controller[_0x943b('0xc')]);router[_0x943b('0xd')]('/',auth[_0x943b('0x9')](),controller[_0x943b('0xe')]);router[_0x943b('0xf')](_0x943b('0xb'),auth[_0x943b('0x9')](),controller[_0x943b('0x10')]);router[_0x943b('0x11')](_0x943b('0xb'),auth[_0x943b('0x9')](),controller[_0x943b('0x12')]);module[_0x943b('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 9c8b341..42f416d 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 _0x2b82=['exports','name','STRING','sequelize'];(function(_0x20dc82,_0x1d9fbc){var _0x29d935=function(_0x558c9b){while(--_0x558c9b){_0x20dc82['push'](_0x20dc82['shift']());}};_0x29d935(++_0x1d9fbc);}(_0x2b82,0x123));var _0x22b8=function(_0x14fc42,_0x3d45dc){_0x14fc42=_0x14fc42-0x0;var _0x33f580=_0x2b82[_0x14fc42];return _0x33f580;};'use strict';var Sequelize=require(_0x22b8('0x0'));module[_0x22b8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x22b8('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x22b8('0x3')]}}; \ No newline at end of file +var _0x9db5=['STRING','sequelize','exports'];(function(_0x25f615,_0x449afa){var _0x37f350=function(_0xf1a6ea){while(--_0xf1a6ea){_0x25f615['push'](_0x25f615['shift']());}};_0x37f350(++_0x449afa);}(_0x9db5,0x6d));var _0x59db=function(_0x1b5f02,_0x3abf41){_0x1b5f02=_0x1b5f02-0x0;var _0x58977b=_0x9db5[_0x1b5f02];return _0x58977b;};'use strict';var Sequelize=require(_0x59db('0x0'));module[_0x59db('0x1')]={'name':{'type':Sequelize[_0x59db('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x59db('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 8a05f83..86462a3 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 _0xf6b5=['moment','bluebird','util','sox','to-csv','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','filters','intersection','fields','attributes','length','model','order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','fast-json-patch'];(function(_0x591e16,_0x5aefc1){var _0x543b35=function(_0x81e3be){while(--_0x81e3be){_0x591e16['push'](_0x591e16['shift']());}};_0x543b35(++_0x5aefc1);}(_0xf6b5,0x134));var _0x5f6b=function(_0x1ac6e5,_0x40f47f){_0x1ac6e5=_0x1ac6e5-0x0;var _0x5877dc=_0xf6b5[_0x1ac6e5];return _0x5877dc;};'use strict';var pdf=require(_0x5f6b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5f6b('0x1'));var zipdir=require(_0x5f6b('0x2'));var jsonpatch=require(_0x5f6b('0x3'));var rp=require('request-promise');var moment=require(_0x5f6b('0x4'));var BPromise=require(_0x5f6b('0x5'));var Mustache=require('mustache');var util=require(_0x5f6b('0x6'));var path=require('path');var sox=require(_0x5f6b('0x7'));var csv=require(_0x5f6b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5f6b('0x9'));var deskjs=require(_0x5f6b('0xa'));var toCsv=require(_0x5f6b('0x8'));var querystring=require(_0x5f6b('0xb'));var Papa=require(_0x5f6b('0xc'));var Redis=require(_0x5f6b('0xd'));var authService=require(_0x5f6b('0xe'));var qs=require(_0x5f6b('0xf'));var as=require(_0x5f6b('0x10'));var hardwareService=require(_0x5f6b('0x11'));var logger=require(_0x5f6b('0x12'))(_0x5f6b('0x13'));var utils=require(_0x5f6b('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245e66,_0xedc63b){_0xedc63b=_0xedc63b||0xcc;return function(_0x56b52c){if(_0x56b52c){return _0x245e66[_0x5f6b('0x15')](_0xedc63b);}return _0x245e66[_0x5f6b('0x16')](_0xedc63b)[_0x5f6b('0x17')]();};}function respondWithResult(_0x5a7e8c,_0x1d5a2f){_0x1d5a2f=_0x1d5a2f||0xc8;return function(_0x110871){if(_0x110871){return _0x5a7e8c[_0x5f6b('0x16')](_0x1d5a2f)[_0x5f6b('0x18')](_0x110871);}};}function respondWithFilteredResult(_0x3bb412,_0xd1ece0){return function(_0x219e7c){if(_0x219e7c){var _0x363923=_0x219e7c['count'],_0x443257=_0xd1ece0[_0x5f6b('0x19')],_0x120afa=_0xd1ece0[_0x5f6b('0x19')]+_0xd1ece0[_0x5f6b('0x1a')],_0x110af1;if(_0x120afa>=_0x363923){_0x120afa=_0x363923;_0x110af1=0xc8;}else{_0x110af1=0xce;}_0x3bb412[_0x5f6b('0x16')](_0x110af1);return _0x3bb412[_0x5f6b('0x1b')](_0x5f6b('0x1c'),_0x443257+'-'+_0x120afa+'/'+_0x363923)['json'](_0x219e7c);}return null;};}function patchUpdates(_0x4ab7a4){return function(_0x1e38db){try{jsonpatch[_0x5f6b('0x1d')](_0x1e38db,_0x4ab7a4,!![]);}catch(_0x4f4829){return BPromise[_0x5f6b('0x1e')](_0x4f4829);}return _0x1e38db[_0x5f6b('0x1f')]();};}function saveUpdates(_0x452899,_0x128948){return function(_0x4d8505){if(_0x4d8505){return _0x4d8505[_0x5f6b('0x20')](_0x452899)[_0x5f6b('0x21')](function(_0x7eaf67){return _0x7eaf67;});}return null;};}function removeEntity(_0x53b931,_0x28bc1f){return function(_0x5298a6){if(_0x5298a6){return _0x5298a6[_0x5f6b('0x22')]()[_0x5f6b('0x21')](function(){var _0x26a719=_0x5298a6[_0x5f6b('0x23')]({'plain':!![]});var _0xcd1492='Pauses';return db[_0x5f6b('0x24')][_0x5f6b('0x22')]({'where':{'type':_0xcd1492,'resourceId':_0x26a719['id']}})[_0x5f6b('0x21')](function(){return _0x5298a6;});})[_0x5f6b('0x21')](function(){_0x53b931[_0x5f6b('0x16')](0xcc)[_0x5f6b('0x17')]();});}};}function handleEntityNotFound(_0x3049b5,_0x25fdd7){return function(_0x2bc147){if(!_0x2bc147){_0x3049b5[_0x5f6b('0x15')](0x194);}return _0x2bc147;};}function handleError(_0x5a6626,_0x2623b0){_0x2623b0=_0x2623b0||0x1f4;return function(_0x3085a8){logger[_0x5f6b('0x25')](_0x3085a8[_0x5f6b('0x26')]);if(_0x3085a8[_0x5f6b('0x27')]){delete _0x3085a8[_0x5f6b('0x27')];}_0x5a6626['status'](_0x2623b0)[_0x5f6b('0x28')](_0x3085a8);};}exports[_0x5f6b('0x29')]=function(_0x440fa7,_0x5ef7f6){var _0x4bde3e={},_0x1e0d3e={},_0x16c5ce={'count':0x0,'rows':[]};var _0x22515c=_[_0x5f6b('0x2a')](db[_0x5f6b('0x2b')][_0x5f6b('0x2c')],function(_0x54640d){return{'name':_0x54640d[_0x5f6b('0x2d')],'type':_0x54640d[_0x5f6b('0x2e')][_0x5f6b('0x2f')]};});_0x1e0d3e['model']=_['map'](_0x22515c,_0x5f6b('0x27'));_0x1e0d3e[_0x5f6b('0x30')]=_['keys'](_0x440fa7[_0x5f6b('0x30')]);_0x1e0d3e[_0x5f6b('0x31')]=_[_0x5f6b('0x32')](_0x1e0d3e['model'],_0x1e0d3e[_0x5f6b('0x30')]);_0x4bde3e['attributes']=_['intersection'](_0x1e0d3e['model'],qs['fields'](_0x440fa7[_0x5f6b('0x30')][_0x5f6b('0x33')]));_0x4bde3e[_0x5f6b('0x34')]=_0x4bde3e['attributes'][_0x5f6b('0x35')]?_0x4bde3e[_0x5f6b('0x34')]:_0x1e0d3e[_0x5f6b('0x36')];if(!_0x440fa7[_0x5f6b('0x30')]['hasOwnProperty']('nolimit')){_0x4bde3e[_0x5f6b('0x1a')]=qs[_0x5f6b('0x1a')](_0x440fa7[_0x5f6b('0x30')][_0x5f6b('0x1a')]);_0x4bde3e['offset']=qs['offset'](_0x440fa7[_0x5f6b('0x30')][_0x5f6b('0x19')]);}_0x4bde3e[_0x5f6b('0x37')]=qs[_0x5f6b('0x38')](_0x440fa7[_0x5f6b('0x30')]['sort']);_0x4bde3e['where']=qs[_0x5f6b('0x31')](_['pick'](_0x440fa7[_0x5f6b('0x30')],_0x1e0d3e[_0x5f6b('0x31')]));if(_0x440fa7[_0x5f6b('0x30')][_0x5f6b('0x39')]){_0x4bde3e[_0x5f6b('0x3a')]=_[_0x5f6b('0x3b')](_0x4bde3e['where'],{'$or':_[_0x5f6b('0x2a')](_0x22515c,function(_0x20b2aa){if(_0x20b2aa[_0x5f6b('0x2e')]!==_0x5f6b('0x3c')){var _0x4563a7={};_0x4563a7[_0x20b2aa['name']]={'$like':'%'+_0x440fa7['query'][_0x5f6b('0x39')]+'%'};return _0x4563a7;}})});}_0x4bde3e=_['merge']({},_0x4bde3e,_0x440fa7[_0x5f6b('0x3d')]);var _0x484011={'where':_0x4bde3e[_0x5f6b('0x3a')]};return db[_0x5f6b('0x2b')][_0x5f6b('0x3e')](_0x484011)[_0x5f6b('0x21')](function(_0x2e9eff){_0x16c5ce['count']=_0x2e9eff;if(_0x440fa7[_0x5f6b('0x30')][_0x5f6b('0x3f')]){_0x4bde3e[_0x5f6b('0x40')]=[{'all':!![]}];}return db[_0x5f6b('0x2b')][_0x5f6b('0x41')](_0x4bde3e);})[_0x5f6b('0x21')](function(_0x216cec){_0x16c5ce[_0x5f6b('0x42')]=_0x216cec;return _0x16c5ce;})['then'](respondWithFilteredResult(_0x5ef7f6,_0x4bde3e))[_0x5f6b('0x43')](handleError(_0x5ef7f6,null));};exports[_0x5f6b('0x44')]=function(_0x567c49,_0x25d5e9){var _0x5ecd34={'raw':!![],'where':{'id':_0x567c49[_0x5f6b('0x45')]['id']}},_0x1ec734={};_0x1ec734['model']=_[_0x5f6b('0x46')](db['Pause'][_0x5f6b('0x2c')]);_0x1ec734[_0x5f6b('0x30')]=_['keys'](_0x567c49[_0x5f6b('0x30')]);_0x1ec734[_0x5f6b('0x31')]=_[_0x5f6b('0x32')](_0x1ec734[_0x5f6b('0x36')],_0x1ec734[_0x5f6b('0x30')]);_0x5ecd34['attributes']=_[_0x5f6b('0x32')](_0x1ec734[_0x5f6b('0x36')],qs[_0x5f6b('0x33')](_0x567c49['query'][_0x5f6b('0x33')]));_0x5ecd34[_0x5f6b('0x34')]=_0x5ecd34[_0x5f6b('0x34')]['length']?_0x5ecd34[_0x5f6b('0x34')]:_0x1ec734[_0x5f6b('0x36')];if(_0x567c49[_0x5f6b('0x30')][_0x5f6b('0x3f')]){_0x5ecd34[_0x5f6b('0x40')]=[{'all':!![]}];}_0x5ecd34=_[_0x5f6b('0x3b')]({},_0x5ecd34,_0x567c49[_0x5f6b('0x3d')]);return db['Pause'][_0x5f6b('0x47')](_0x5ecd34)['then'](handleEntityNotFound(_0x25d5e9,null))[_0x5f6b('0x21')](respondWithResult(_0x25d5e9,null))[_0x5f6b('0x43')](handleError(_0x25d5e9,null));};exports[_0x5f6b('0x48')]=function(_0x4b7005,_0xd6f591){return db[_0x5f6b('0x2b')]['create'](_0x4b7005['body'],{})[_0x5f6b('0x21')](function(_0x559a80){var _0x412c49=_0x4b7005['user'][_0x5f6b('0x23')]({'plain':!![]});if(!_0x412c49)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x412c49['role']===_0x5f6b('0x49')){var _0x48a0d4=_0x559a80[_0x5f6b('0x23')]({'plain':!![]});var _0x1e31e9='Pauses';return db[_0x5f6b('0x4a')]['find']({'where':{'name':_0x1e31e9,'userProfileId':_0x412c49['userProfileId']},'raw':!![]})[_0x5f6b('0x21')](function(_0x3905ae){if(_0x3905ae&&_0x3905ae[_0x5f6b('0x4b')]===0x0){return db[_0x5f6b('0x24')][_0x5f6b('0x48')]({'name':_0x48a0d4['name'],'resourceId':_0x48a0d4['id'],'type':_0x3905ae[_0x5f6b('0x27')],'sectionId':_0x3905ae['id']},{})[_0x5f6b('0x21')](function(){return _0x559a80;});}else{return _0x559a80;}})[_0x5f6b('0x43')](function(_0x9be266){logger[_0x5f6b('0x25')](_0x5f6b('0x4c'),_0x9be266);throw _0x9be266;});}return _0x559a80;})['then'](respondWithResult(_0xd6f591,0xc9))['catch'](handleError(_0xd6f591,null));};exports[_0x5f6b('0x20')]=function(_0x3efd3b,_0x18a7b3){if(_0x3efd3b[_0x5f6b('0x4d')]['id']){delete _0x3efd3b[_0x5f6b('0x4d')]['id'];}return db['Pause']['find']({'where':{'id':_0x3efd3b[_0x5f6b('0x45')]['id']}})['then'](handleEntityNotFound(_0x18a7b3,null))[_0x5f6b('0x21')](saveUpdates(_0x3efd3b[_0x5f6b('0x4d')],null))['then'](respondWithResult(_0x18a7b3,null))['catch'](handleError(_0x18a7b3,null));};exports[_0x5f6b('0x22')]=function(_0x23263,_0x207e71){return db[_0x5f6b('0x2b')][_0x5f6b('0x47')]({'where':{'id':_0x23263['params']['id']}})[_0x5f6b('0x21')](handleEntityNotFound(_0x207e71,null))['then'](removeEntity(_0x207e71,null))[_0x5f6b('0x43')](handleError(_0x207e71,null));}; \ No newline at end of file +var _0x9fc2=['filters','intersection','attributes','fields','length','nolimit','offset','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','limit','apply','save','then','destroy','get','end','sendStatus','error','stack','name','send','index','map','Pause','fieldName','type','key','model','keys','query'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x9fc2,0x19e));var _0x29fc=function(_0x89e916,_0x53c7cc){_0x89e916=_0x89e916-0x0;var _0x17c253=_0x9fc2[_0x89e916];return _0x17c253;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x29fc('0x0'));var zipdir=require(_0x29fc('0x1'));var jsonpatch=require(_0x29fc('0x2'));var rp=require(_0x29fc('0x3'));var moment=require('moment');var BPromise=require(_0x29fc('0x4'));var Mustache=require(_0x29fc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x29fc('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x29fc('0x7'));var squel=require(_0x29fc('0x8'));var crypto=require(_0x29fc('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x29fc('0xa'));var toCsv=require(_0x29fc('0x6'));var querystring=require('querystring');var Papa=require(_0x29fc('0xb'));var Redis=require(_0x29fc('0xc'));var authService=require(_0x29fc('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x29fc('0xe'));var hardwareService=require(_0x29fc('0xf'));var logger=require('../../config/logger')(_0x29fc('0x10'));var utils=require('../../config/utils');var config=require(_0x29fc('0x11'));var db=require(_0x29fc('0x12'))['db'];function respondWithStatusCode(_0xd841e7,_0x54b97c){_0x54b97c=_0x54b97c||0xcc;return function(_0x4c2ef7){if(_0x4c2ef7){return _0xd841e7['sendStatus'](_0x54b97c);}return _0xd841e7['status'](_0x54b97c)['end']();};}function respondWithResult(_0x28f7b8,_0x5d994b){_0x5d994b=_0x5d994b||0xc8;return function(_0x439a71){if(_0x439a71){return _0x28f7b8[_0x29fc('0x13')](_0x5d994b)[_0x29fc('0x14')](_0x439a71);}};}function respondWithFilteredResult(_0x56a676,_0x38c193){return function(_0x3a3773){if(_0x3a3773){var _0x59d70b=_0x3a3773['count'],_0x3580ff=_0x38c193['offset'],_0x130854=_0x38c193['offset']+_0x38c193[_0x29fc('0x15')],_0x2de51b;if(_0x130854>=_0x59d70b){_0x130854=_0x59d70b;_0x2de51b=0xc8;}else{_0x2de51b=0xce;}_0x56a676[_0x29fc('0x13')](_0x2de51b);return _0x56a676['set']('Content-Range',_0x3580ff+'-'+_0x130854+'/'+_0x59d70b)[_0x29fc('0x14')](_0x3a3773);}return null;};}function patchUpdates(_0x5e59f5){return function(_0x2792ff){try{jsonpatch[_0x29fc('0x16')](_0x2792ff,_0x5e59f5,!![]);}catch(_0x542a03){return BPromise['reject'](_0x542a03);}return _0x2792ff[_0x29fc('0x17')]();};}function saveUpdates(_0x188b15,_0x189ee7){return function(_0x48bd0a){if(_0x48bd0a){return _0x48bd0a['update'](_0x188b15)[_0x29fc('0x18')](function(_0x43b11c){return _0x43b11c;});}return null;};}function removeEntity(_0x515e65,_0x451f03){return function(_0xd81a5){if(_0xd81a5){return _0xd81a5[_0x29fc('0x19')]()['then'](function(){var _0x5538a1=_0xd81a5[_0x29fc('0x1a')]({'plain':!![]});var _0x4b14df='Pauses';return db['UserProfileResource'][_0x29fc('0x19')]({'where':{'type':_0x4b14df,'resourceId':_0x5538a1['id']}})[_0x29fc('0x18')](function(){return _0xd81a5;});})['then'](function(){_0x515e65[_0x29fc('0x13')](0xcc)[_0x29fc('0x1b')]();});}};}function handleEntityNotFound(_0x999f8f,_0x78d21e){return function(_0x5ab84e){if(!_0x5ab84e){_0x999f8f[_0x29fc('0x1c')](0x194);}return _0x5ab84e;};}function handleError(_0x1d88f5,_0x4c4e61){_0x4c4e61=_0x4c4e61||0x1f4;return function(_0x1d58e7){logger[_0x29fc('0x1d')](_0x1d58e7[_0x29fc('0x1e')]);if(_0x1d58e7[_0x29fc('0x1f')]){delete _0x1d58e7[_0x29fc('0x1f')];}_0x1d88f5[_0x29fc('0x13')](_0x4c4e61)[_0x29fc('0x20')](_0x1d58e7);};}exports[_0x29fc('0x21')]=function(_0x42fb2a,_0x5d1f45){var _0x107fde={},_0x4f5b08={},_0x173783={'count':0x0,'rows':[]};var _0x424ea8=_[_0x29fc('0x22')](db[_0x29fc('0x23')]['rawAttributes'],function(_0x40c59a){return{'name':_0x40c59a[_0x29fc('0x24')],'type':_0x40c59a[_0x29fc('0x25')][_0x29fc('0x26')]};});_0x4f5b08[_0x29fc('0x27')]=_[_0x29fc('0x22')](_0x424ea8,_0x29fc('0x1f'));_0x4f5b08['query']=_[_0x29fc('0x28')](_0x42fb2a[_0x29fc('0x29')]);_0x4f5b08[_0x29fc('0x2a')]=_[_0x29fc('0x2b')](_0x4f5b08[_0x29fc('0x27')],_0x4f5b08[_0x29fc('0x29')]);_0x107fde[_0x29fc('0x2c')]=_[_0x29fc('0x2b')](_0x4f5b08[_0x29fc('0x27')],qs[_0x29fc('0x2d')](_0x42fb2a[_0x29fc('0x29')][_0x29fc('0x2d')]));_0x107fde['attributes']=_0x107fde[_0x29fc('0x2c')][_0x29fc('0x2e')]?_0x107fde['attributes']:_0x4f5b08[_0x29fc('0x27')];if(!_0x42fb2a['query']['hasOwnProperty'](_0x29fc('0x2f'))){_0x107fde[_0x29fc('0x15')]=qs[_0x29fc('0x15')](_0x42fb2a[_0x29fc('0x29')][_0x29fc('0x15')]);_0x107fde['offset']=qs[_0x29fc('0x30')](_0x42fb2a[_0x29fc('0x29')]['offset']);}_0x107fde['order']=qs[_0x29fc('0x31')](_0x42fb2a['query'][_0x29fc('0x31')]);_0x107fde[_0x29fc('0x32')]=qs['filters'](_[_0x29fc('0x33')](_0x42fb2a[_0x29fc('0x29')],_0x4f5b08['filters']));if(_0x42fb2a[_0x29fc('0x29')][_0x29fc('0x34')]){_0x107fde[_0x29fc('0x32')]=_[_0x29fc('0x35')](_0x107fde['where'],{'$or':_['map'](_0x424ea8,function(_0x3e7033){if(_0x3e7033[_0x29fc('0x25')]!=='VIRTUAL'){var _0x16ba45={};_0x16ba45[_0x3e7033[_0x29fc('0x1f')]]={'$like':'%'+_0x42fb2a['query'][_0x29fc('0x34')]+'%'};return _0x16ba45;}})});}_0x107fde=_[_0x29fc('0x35')]({},_0x107fde,_0x42fb2a[_0x29fc('0x36')]);var _0x197e6e={'where':_0x107fde['where']};return db[_0x29fc('0x23')][_0x29fc('0x37')](_0x197e6e)[_0x29fc('0x18')](function(_0x1b56a3){_0x173783[_0x29fc('0x37')]=_0x1b56a3;if(_0x42fb2a[_0x29fc('0x29')][_0x29fc('0x38')]){_0x107fde[_0x29fc('0x39')]=[{'all':!![]}];}return db[_0x29fc('0x23')][_0x29fc('0x3a')](_0x107fde);})[_0x29fc('0x18')](function(_0x6e5990){_0x173783[_0x29fc('0x3b')]=_0x6e5990;return _0x173783;})[_0x29fc('0x18')](respondWithFilteredResult(_0x5d1f45,_0x107fde))['catch'](handleError(_0x5d1f45,null));};exports[_0x29fc('0x3c')]=function(_0x3ec7d0,_0x1efaac){var _0x174f1f={'raw':!![],'where':{'id':_0x3ec7d0[_0x29fc('0x3d')]['id']}},_0x4da472={};_0x4da472[_0x29fc('0x27')]=_[_0x29fc('0x28')](db[_0x29fc('0x23')][_0x29fc('0x3e')]);_0x4da472[_0x29fc('0x29')]=_[_0x29fc('0x28')](_0x3ec7d0[_0x29fc('0x29')]);_0x4da472[_0x29fc('0x2a')]=_[_0x29fc('0x2b')](_0x4da472[_0x29fc('0x27')],_0x4da472['query']);_0x174f1f[_0x29fc('0x2c')]=_[_0x29fc('0x2b')](_0x4da472[_0x29fc('0x27')],qs[_0x29fc('0x2d')](_0x3ec7d0[_0x29fc('0x29')][_0x29fc('0x2d')]));_0x174f1f[_0x29fc('0x2c')]=_0x174f1f[_0x29fc('0x2c')][_0x29fc('0x2e')]?_0x174f1f[_0x29fc('0x2c')]:_0x4da472[_0x29fc('0x27')];if(_0x3ec7d0[_0x29fc('0x29')][_0x29fc('0x38')]){_0x174f1f[_0x29fc('0x39')]=[{'all':!![]}];}_0x174f1f=_[_0x29fc('0x35')]({},_0x174f1f,_0x3ec7d0[_0x29fc('0x36')]);return db['Pause']['find'](_0x174f1f)[_0x29fc('0x18')](handleEntityNotFound(_0x1efaac,null))[_0x29fc('0x18')](respondWithResult(_0x1efaac,null))[_0x29fc('0x3f')](handleError(_0x1efaac,null));};exports[_0x29fc('0x40')]=function(_0x41a0d3,_0x1fad0a){return db[_0x29fc('0x23')][_0x29fc('0x40')](_0x41a0d3[_0x29fc('0x41')],{})[_0x29fc('0x18')](function(_0x5891b0){var _0x5bb6d9=_0x41a0d3[_0x29fc('0x42')][_0x29fc('0x1a')]({'plain':!![]});if(!_0x5bb6d9)throw new Error(_0x29fc('0x43'));if(_0x5bb6d9[_0x29fc('0x44')]===_0x29fc('0x42')){var _0xbc4843=_0x5891b0[_0x29fc('0x1a')]({'plain':!![]});var _0xb367a0=_0x29fc('0x45');return db[_0x29fc('0x46')][_0x29fc('0x47')]({'where':{'name':_0xb367a0,'userProfileId':_0x5bb6d9[_0x29fc('0x48')]},'raw':!![]})[_0x29fc('0x18')](function(_0x492aa0){if(_0x492aa0&&_0x492aa0[_0x29fc('0x49')]===0x0){return db[_0x29fc('0x4a')][_0x29fc('0x40')]({'name':_0xbc4843[_0x29fc('0x1f')],'resourceId':_0xbc4843['id'],'type':_0x492aa0['name'],'sectionId':_0x492aa0['id']},{})[_0x29fc('0x18')](function(){return _0x5891b0;});}else{return _0x5891b0;}})['catch'](function(_0x1b9dee){logger[_0x29fc('0x1d')](_0x29fc('0x4b'),_0x1b9dee);throw _0x1b9dee;});}return _0x5891b0;})[_0x29fc('0x18')](respondWithResult(_0x1fad0a,0xc9))[_0x29fc('0x3f')](handleError(_0x1fad0a,null));};exports['update']=function(_0x2b1f4e,_0x5d8c4b){if(_0x2b1f4e[_0x29fc('0x41')]['id']){delete _0x2b1f4e[_0x29fc('0x41')]['id'];}return db[_0x29fc('0x23')][_0x29fc('0x47')]({'where':{'id':_0x2b1f4e[_0x29fc('0x3d')]['id']}})[_0x29fc('0x18')](handleEntityNotFound(_0x5d8c4b,null))[_0x29fc('0x18')](saveUpdates(_0x2b1f4e[_0x29fc('0x41')],null))[_0x29fc('0x18')](respondWithResult(_0x5d8c4b,null))[_0x29fc('0x3f')](handleError(_0x5d8c4b,null));};exports[_0x29fc('0x19')]=function(_0x13c058,_0x44d647){return db['Pause']['find']({'where':{'id':_0x13c058['params']['id']}})['then'](handleEntityNotFound(_0x44d647,null))[_0x29fc('0x18')](removeEntity(_0x44d647,null))['catch'](handleError(_0x44d647,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ebb0e61..9f6cc6a 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 _0x556a=['moment','bluebird','request-promise','path','rimraf','./pause.attributes','exports','define','tools_pauses','lodash','util','../../config/logger','api'];(function(_0x1f2e09,_0x6c709){var _0x2f6752=function(_0x72ff19){while(--_0x72ff19){_0x1f2e09['push'](_0x1f2e09['shift']());}};_0x2f6752(++_0x6c709);}(_0x556a,0x1dd));var _0xa556=function(_0x578522,_0x53ef80){_0x578522=_0x578522-0x0;var _0x14fda6=_0x556a[_0x578522];return _0x14fda6;};'use strict';var _=require(_0xa556('0x0'));var util=require(_0xa556('0x1'));var logger=require(_0xa556('0x2'))(_0xa556('0x3'));var moment=require(_0xa556('0x4'));var BPromise=require(_0xa556('0x5'));var rp=require(_0xa556('0x6'));var fs=require('fs');var path=require(_0xa556('0x7'));var rimraf=require(_0xa556('0x8'));var config=require('../../config/environment');var attributes=require(_0xa556('0x9'));module[_0xa556('0xa')]=function(_0x3339aa,_0x3095b0){return _0x3339aa[_0xa556('0xb')]('Pause',attributes,{'tableName':_0xa556('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40ac=['api','moment','bluebird','request-promise','path','rimraf','./pause.attributes','exports','Pause','tools_pauses','lodash','../../config/logger'];(function(_0x38cdab,_0x58005c){var _0x506ffc=function(_0x5366d3){while(--_0x5366d3){_0x38cdab['push'](_0x38cdab['shift']());}};_0x506ffc(++_0x58005c);}(_0x40ac,0x1de));var _0xc40a=function(_0x5d1566,_0x3fed4b){_0x5d1566=_0x5d1566-0x0;var _0x3441a2=_0x40ac[_0x5d1566];return _0x3441a2;};'use strict';var _=require(_0xc40a('0x0'));var util=require('util');var logger=require(_0xc40a('0x1'))(_0xc40a('0x2'));var moment=require(_0xc40a('0x3'));var BPromise=require(_0xc40a('0x4'));var rp=require(_0xc40a('0x5'));var fs=require('fs');var path=require(_0xc40a('0x6'));var rimraf=require(_0xc40a('0x7'));var config=require('../../config/environment');var attributes=require(_0xc40a('0x8'));module[_0xc40a('0x9')]=function(_0xd6d891,_0x5e179f){return _0xd6d891['define'](_0xc40a('0xa'),attributes,{'tableName':_0xc40a('0xb'),'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 dbd1429..350d2dc 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 _0x55e0=['result','catch','ShowPause','Pause','options','where','attributes','include','map','model','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1bfd68,_0x5eb17f){var _0x226507=function(_0x1ff403){while(--_0x1ff403){_0x1bfd68['push'](_0x1bfd68['shift']());}};_0x226507(++_0x5eb17f);}(_0x55e0,0xdc));var _0x055e=function(_0x12b8cb,_0x1303c5){_0x12b8cb=_0x12b8cb-0x0;var _0x38df9d=_0x55e0[_0x12b8cb];return _0x38df9d;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4384ff,_0x4a442e,_0x8e7824){return new BPromise(function(_0x3c4cf,_0x376618){return client[_0x055e('0xa')](_0x4384ff,_0x8e7824)[_0x055e('0xb')](function(_0x49540c){logger[_0x055e('0xc')](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));logger[_0x055e('0xf')](_0x055e('0x10'),_0x4a442e,'request\x20sent',JSON['stringify'](_0x49540c));if(_0x49540c[_0x055e('0x11')]){if(_0x49540c['error'][_0x055e('0x12')]===0x1f4){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x376618(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}logger['error'](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x3c4cf(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}else{logger['info'](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));_0x3c4cf(_0x49540c[_0x055e('0x14')]['message']);}})[_0x055e('0x15')](function(_0x2c377c){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x2c377c);_0x376618(_0x2c377c);});});}exports[_0x055e('0x16')]=function(_0x4c85dd){var _0x36ef10=this;return new Promise(function(_0x2cf3de,_0x2f4a06){return db[_0x055e('0x17')]['find']({'raw':_0x4c85dd[_0x055e('0x18')]?_0x4c85dd[_0x055e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4c85dd[_0x055e('0x18')]?_0x4c85dd[_0x055e('0x18')][_0x055e('0x19')]||null:null,'attributes':_0x4c85dd[_0x055e('0x18')]?_0x4c85dd[_0x055e('0x18')][_0x055e('0x1a')]||null:null,'include':_0x4c85dd['options']?_0x4c85dd[_0x055e('0x18')][_0x055e('0x1b')]?_[_0x055e('0x1c')](_0x4c85dd['options'][_0x055e('0x1b')],function(_0x2da6b){return{'model':db[_0x2da6b[_0x055e('0x1d')]],'as':_0x2da6b['as'],'attributes':_0x2da6b[_0x055e('0x1a')],'include':_0x2da6b['include']?_[_0x055e('0x1c')](_0x2da6b['include'],function(_0x33ffdf){return{'model':db[_0x33ffdf[_0x055e('0x1d')]],'as':_0x33ffdf['as'],'attributes':_0x33ffdf[_0x055e('0x1a')],'include':_0x33ffdf[_0x055e('0x1b')]?_[_0x055e('0x1c')](_0x33ffdf[_0x055e('0x1b')],function(_0x58caf9){return{'model':db[_0x58caf9[_0x055e('0x1d')]],'as':_0x58caf9['as'],'attributes':_0x58caf9[_0x055e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x055e('0xb')](function(_0x4b5891){logger[_0x055e('0xc')](_0x055e('0x16'),_0x4c85dd);logger[_0x055e('0xf')](_0x055e('0x16'),_0x4c85dd,JSON['stringify'](_0x4b5891));_0x2cf3de(_0x4b5891);})[_0x055e('0x15')](function(_0x5958ef){logger[_0x055e('0x11')](_0x055e('0x16'),_0x5958ef[_0x055e('0x13')],_0x4c85dd);_0x2f4a06(_0x36ef10[_0x055e('0x11')](0x1f4,_0x5958ef[_0x055e('0x13')]));});});}; \ No newline at end of file +var _0x8eca=['Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowPause','Pause','find','options','where','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','then','Pause,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x8eca,0x1e2));var _0xa8ec=function(_0x2d7906,_0x4aea10){_0x2d7906=_0x2d7906-0x0;var _0x2604fc=_0x8eca[_0x2d7906];return _0x2604fc;};'use strict';var _=require(_0xa8ec('0x0'));var util=require(_0xa8ec('0x1'));var moment=require(_0xa8ec('0x2'));var BPromise=require('bluebird');var rs=require(_0xa8ec('0x3'));var fs=require('fs');var Redis=require(_0xa8ec('0x4'));var db=require(_0xa8ec('0x5'))['db'];var utils=require(_0xa8ec('0x6'));var logger=require(_0xa8ec('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa8ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53209c,_0x32a1bf,_0x5ec6fa){return new BPromise(function(_0x2b7477,_0x2babfc){return client[_0xa8ec('0x9')](_0x53209c,_0x5ec6fa)[_0xa8ec('0xa')](function(_0x910c7b){logger['info'](_0xa8ec('0xb'),_0x32a1bf,_0xa8ec('0xc'));logger[_0xa8ec('0xd')](_0xa8ec('0xe'),_0x32a1bf,_0xa8ec('0xc'),JSON[_0xa8ec('0xf')](_0x910c7b));if(_0x910c7b[_0xa8ec('0x10')]){if(_0x910c7b[_0xa8ec('0x10')][_0xa8ec('0x11')]===0x1f4){logger[_0xa8ec('0x10')](_0xa8ec('0xb'),_0x32a1bf,_0x910c7b[_0xa8ec('0x10')][_0xa8ec('0x12')]);return _0x2babfc(_0x910c7b[_0xa8ec('0x10')][_0xa8ec('0x12')]);}logger['error'](_0xa8ec('0xb'),_0x32a1bf,_0x910c7b[_0xa8ec('0x10')][_0xa8ec('0x12')]);return _0x2b7477(_0x910c7b[_0xa8ec('0x10')][_0xa8ec('0x12')]);}else{logger[_0xa8ec('0x13')](_0xa8ec('0xb'),_0x32a1bf,_0xa8ec('0xc'));_0x2b7477(_0x910c7b[_0xa8ec('0x14')][_0xa8ec('0x12')]);}})[_0xa8ec('0x15')](function(_0x202755){logger['error']('Pause,\x20%s,\x20%s',_0x32a1bf,_0x202755);_0x2babfc(_0x202755);});});}exports[_0xa8ec('0x16')]=function(_0x3a418d){var _0x3f5c37=this;return new Promise(function(_0x21fe84,_0x3294e9){return db[_0xa8ec('0x17')][_0xa8ec('0x18')]({'raw':_0x3a418d[_0xa8ec('0x19')]?_0x3a418d[_0xa8ec('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3a418d[_0xa8ec('0x19')]?_0x3a418d[_0xa8ec('0x19')][_0xa8ec('0x1a')]||null:null,'attributes':_0x3a418d[_0xa8ec('0x19')]?_0x3a418d[_0xa8ec('0x19')][_0xa8ec('0x1b')]||null:null,'include':_0x3a418d['options']?_0x3a418d[_0xa8ec('0x19')][_0xa8ec('0x1c')]?_[_0xa8ec('0x1d')](_0x3a418d[_0xa8ec('0x19')][_0xa8ec('0x1c')],function(_0x266eda){return{'model':db[_0x266eda[_0xa8ec('0x1e')]],'as':_0x266eda['as'],'attributes':_0x266eda['attributes'],'include':_0x266eda[_0xa8ec('0x1c')]?_[_0xa8ec('0x1d')](_0x266eda[_0xa8ec('0x1c')],function(_0x1e8479){return{'model':db[_0x1e8479['model']],'as':_0x1e8479['as'],'attributes':_0x1e8479[_0xa8ec('0x1b')],'include':_0x1e8479[_0xa8ec('0x1c')]?_[_0xa8ec('0x1d')](_0x1e8479['include'],function(_0x1df884){return{'model':db[_0x1df884[_0xa8ec('0x1e')]],'as':_0x1df884['as'],'attributes':_0x1df884[_0xa8ec('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa8ec('0xa')](function(_0x5211b6){logger[_0xa8ec('0x13')](_0xa8ec('0x16'),_0x3a418d);logger[_0xa8ec('0xd')](_0xa8ec('0x16'),_0x3a418d,JSON['stringify'](_0x5211b6));_0x21fe84(_0x5211b6);})[_0xa8ec('0x15')](function(_0x3e4ae9){logger['error'](_0xa8ec('0x16'),_0x3e4ae9[_0xa8ec('0x12')],_0x3a418d);_0x3294e9(_0x3f5c37['error'](0x1f4,_0x3e4ae9[_0xa8ec('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 2c7fe2f..33ca5ec 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 _0x80f6=['Router','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','upload','webhookPost','put','update','delete','exports','multer','util','path'];(function(_0x16b953,_0x5b63af){var _0x547182=function(_0x2c2203){while(--_0x2c2203){_0x16b953['push'](_0x16b953['shift']());}};_0x547182(++_0x5b63af);}(_0x80f6,0x13d));var _0x680f=function(_0x2afc35,_0x3c7829){_0x2afc35=_0x2afc35-0x0;var _0xa720e5=_0x80f6[_0x2afc35];return _0xa720e5;};'use strict';var multer=require(_0x680f('0x0'));var util=require(_0x680f('0x1'));var path=require(_0x680f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x680f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x680f('0x4'));var config=require('../../config/environment');var controller=require(_0x680f('0x5'));router['get']('/',auth[_0x680f('0x6')](),controller[_0x680f('0x7')]);router[_0x680f('0x8')](_0x680f('0x9'),controller['webhookGet']);router[_0x680f('0x8')](_0x680f('0xa'),auth['isAuthenticated'](),controller[_0x680f('0xb')]);router[_0x680f('0x8')](_0x680f('0xc'),auth['isAuthenticated'](),controller[_0x680f('0xd')]);var upload=multer({'storage':multer[_0x680f('0xe')]({'destination':function(_0x153a66,_0x16f8b1,_0x549efa){_0x549efa(null,path[_0x680f('0xf')](config[_0x680f('0x10')],_0x680f('0x11')));},'filename':function(_0x259a3e,_0x418669,_0x355549){_0x418669[_0x680f('0x12')]=_0x418669[_0x680f('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x355549(null,util[_0x680f('0x13')](_0x680f('0x14'),path[_0x680f('0x15')](_0x418669[_0x680f('0x12')],path[_0x680f('0x16')](_0x418669[_0x680f('0x12')])),Date[_0x680f('0x17')](),path[_0x680f('0x16')](_0x418669[_0x680f('0x12')])));}})});router[_0x680f('0x18')]('/',upload[_0x680f('0x19')]('file'),controller[_0x680f('0x1a')]);router[_0x680f('0x18')](_0x680f('0x9'),controller[_0x680f('0x1b')]);router[_0x680f('0x1c')]('/:id',auth[_0x680f('0x6')](),controller[_0x680f('0x1d')]);router[_0x680f('0x1e')](_0x680f('0xa'),auth[_0x680f('0x6')](),controller[_0x680f('0x1e')]);module[_0x680f('0x1f')]=router; \ No newline at end of file +var _0x827d=['util','path','connect-timeout','express','Router','../../config/environment','./plugin.controller','get','index','webhookGet','isAuthenticated','show','/:id/download','join','root','server/files/plugins','originalname','replace','%s-%s%s','basename','now','extname','post','single','upload','/webhook','put','update','delete','/:id','multer'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x827d,0x116));var _0xd827=function(_0x481201,_0x3d01c1){_0x481201=_0x481201-0x0;var _0x24782d=_0x827d[_0x481201];return _0x24782d;};'use strict';var multer=require(_0xd827('0x0'));var util=require(_0xd827('0x1'));var path=require(_0xd827('0x2'));var timeout=require(_0xd827('0x3'));var express=require(_0xd827('0x4'));var router=express[_0xd827('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd827('0x6'));var controller=require(_0xd827('0x7'));router[_0xd827('0x8')]('/',auth['isAuthenticated'](),controller[_0xd827('0x9')]);router['get']('/webhook',controller[_0xd827('0xa')]);router[_0xd827('0x8')]('/:id',auth[_0xd827('0xb')](),controller[_0xd827('0xc')]);router[_0xd827('0x8')](_0xd827('0xd'),auth[_0xd827('0xb')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x530b91,_0x1b41d4,_0x1696af){_0x1696af(null,path[_0xd827('0xe')](config[_0xd827('0xf')],_0xd827('0x10')));},'filename':function(_0x3f171f,_0x296523,_0x124568){_0x296523[_0xd827('0x11')]=_0x296523[_0xd827('0x11')][_0xd827('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x124568(null,util['format'](_0xd827('0x13'),path[_0xd827('0x14')](_0x296523[_0xd827('0x11')],path['extname'](_0x296523[_0xd827('0x11')])),Date[_0xd827('0x15')](),path[_0xd827('0x16')](_0x296523[_0xd827('0x11')])));}})});router[_0xd827('0x17')]('/',upload[_0xd827('0x18')]('file'),controller[_0xd827('0x19')]);router[_0xd827('0x17')](_0xd827('0x1a'),controller['webhookPost']);router[_0xd827('0x1b')]('/:id',auth[_0xd827('0xb')](),controller[_0xd827('0x1c')]);router[_0xd827('0x1d')](_0xd827('0x1e'),auth[_0xd827('0xb')](),controller[_0xd827('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 8344725..3245335 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 _0x398b=['never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always'];(function(_0x2a5864,_0x2b9396){var _0x490ab6=function(_0x3bcd16){while(--_0x3bcd16){_0x2a5864['push'](_0x2a5864['shift']());}};_0x490ab6(++_0x2b9396);}(_0x398b,0x1db));var _0xb398=function(_0x5d5b1a,_0xea27e5){_0x5d5b1a=_0x5d5b1a-0x0;var _0x5d35a7=_0x398b[_0x5d5b1a];return _0x5d35a7;};'use strict';var Sequelize=require('sequelize');module[_0xb398('0x0')]={'name':{'type':Sequelize[_0xb398('0x1')]},'type':{'type':Sequelize[_0xb398('0x2')](_0xb398('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0xb398('0x4')},'active':{'type':Sequelize[_0xb398('0x5')],'defaultValue':0x0,'comment':_0xb398('0x6')},'sidebar':{'type':Sequelize[_0xb398('0x2')](_0xb398('0x7'),'agentOnly',_0xb398('0x8'),_0xb398('0x9')),'defaultValue':_0xb398('0x8'),'comment':_0xb398('0xa')},'icon':{'type':Sequelize[_0xb398('0x1')]},'adminUrl':{'type':Sequelize[_0xb398('0x1')]},'agentUrl':{'type':Sequelize[_0xb398('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb8a4=['STRING','ENUM','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports'];(function(_0x3d9a9c,_0x399c94){var _0x42521e=function(_0x4a2535){while(--_0x4a2535){_0x3d9a9c['push'](_0x3d9a9c['shift']());}};_0x42521e(++_0x399c94);}(_0xb8a4,0x83));var _0x4b8a=function(_0x2cb3e1,_0x38ab56){_0x2cb3e1=_0x2cb3e1-0x0;var _0x3390b9=_0xb8a4[_0x2cb3e1];return _0x3390b9;};'use strict';var Sequelize=require('sequelize');module[_0x4b8a('0x0')]={'name':{'type':Sequelize[_0x4b8a('0x1')]},'type':{'type':Sequelize[_0x4b8a('0x2')]('html','script')},'description':{'type':Sequelize[_0x4b8a('0x3')]},'version':{'type':Sequelize[_0x4b8a('0x3')]},'path':{'type':Sequelize[_0x4b8a('0x1')],'comment':_0x4b8a('0x4')},'active':{'type':Sequelize[_0x4b8a('0x5')],'defaultValue':0x0,'comment':_0x4b8a('0x6')},'sidebar':{'type':Sequelize[_0x4b8a('0x2')](_0x4b8a('0x7'),_0x4b8a('0x8'),'always',_0x4b8a('0x9')),'defaultValue':'always','comment':_0x4b8a('0xa')},'icon':{'type':Sequelize[_0x4b8a('0x1')]},'adminUrl':{'type':Sequelize[_0x4b8a('0x1')]},'agentUrl':{'type':Sequelize[_0x4b8a('0x1')]},'scriptName':{'type':Sequelize[_0x4b8a('0x1')]},'scriptPath':{'type':Sequelize[_0x4b8a('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index d725134..0da09b9 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 _0xbb22=['filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','isFile','Invalid\x20plugin\x20structure','readdirSync','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileResource','Extracted\x20folder\x20removed','delete','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','format','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','method','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','extract-zip','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','sendStatus','end','status','json','count','offset','limit','apply','reject','update','then','destroy','Plugins','error','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','filter','options','includeAll','include','rows','catch','show','params','find','join','root','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','**/*','server/files/plugins','node_modules/**/*','close','existsSync','Plugin\x20not\x20found','download','%s.zip','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file'];(function(_0x44e68a,_0x31c4c9){var _0xdf5320=function(_0x35c752){while(--_0x35c752){_0x44e68a['push'](_0x44e68a['shift']());}};_0xdf5320(++_0x31c4c9);}(_0xbb22,0xe7));var _0x2bb2=function(_0x2c75bd,_0x31cab6){_0x2c75bd=_0x2c75bd-0x0;var _0x4cc959=_0xbb22[_0x2c75bd];return _0x4cc959;};'use strict';var pdf=require(_0x2bb2('0x0'));var emlformat=require(_0x2bb2('0x1'));var rimraf=require(_0x2bb2('0x2'));var zipdir=require(_0x2bb2('0x3'));var jsonpatch=require(_0x2bb2('0x4'));var rp=require(_0x2bb2('0x5'));var moment=require('moment');var BPromise=require(_0x2bb2('0x6'));var Mustache=require(_0x2bb2('0x7'));var util=require('util');var path=require(_0x2bb2('0x8'));var sox=require(_0x2bb2('0x9'));var csv=require(_0x2bb2('0xa'));var ejs=require(_0x2bb2('0xb'));var fs=require('fs');var _=require(_0x2bb2('0xc'));var squel=require(_0x2bb2('0xd'));var crypto=require(_0x2bb2('0xe'));var jsforce=require(_0x2bb2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2bb2('0xa'));var querystring=require(_0x2bb2('0x10'));var Papa=require('papaparse');var extract=require(_0x2bb2('0x11'));var rimraf=require(_0x2bb2('0x2'));var archiver=require('archiver');var Redis=require(_0x2bb2('0x12'));var authService=require(_0x2bb2('0x13'));var qs=require(_0x2bb2('0x14'));var as=require(_0x2bb2('0x15'));var hardwareService=require(_0x2bb2('0x16'));var logger=require(_0x2bb2('0x17'))(_0x2bb2('0x18'));var utils=require(_0x2bb2('0x19'));var config=require(_0x2bb2('0x1a'));var db=require(_0x2bb2('0x1b'))['db'];config[_0x2bb2('0x1c')]=_[_0x2bb2('0x1d')](config[_0x2bb2('0x1c')],{'host':_0x2bb2('0x1e'),'port':0x18eb});var socket=require(_0x2bb2('0x1f'))(new Redis(config[_0x2bb2('0x1c')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x4ba6b2,_0x166c1b){_0x166c1b=_0x166c1b||0xcc;return function(_0x54a589){if(_0x54a589){return _0x4ba6b2[_0x2bb2('0x20')](_0x166c1b);}return _0x4ba6b2['status'](_0x166c1b)[_0x2bb2('0x21')]();};}function respondWithResult(_0x36c83c,_0x491f93){_0x491f93=_0x491f93||0xc8;return function(_0x1678da){if(_0x1678da){return _0x36c83c[_0x2bb2('0x22')](_0x491f93)[_0x2bb2('0x23')](_0x1678da);}};}function respondWithFilteredResult(_0x3b4cb2,_0x12b076){return function(_0x3e6280){if(_0x3e6280){var _0x5f2c17=_0x3e6280[_0x2bb2('0x24')],_0x5a79f7=_0x12b076[_0x2bb2('0x25')],_0x45dd9d=_0x12b076[_0x2bb2('0x25')]+_0x12b076[_0x2bb2('0x26')],_0x50e914;if(_0x45dd9d>=_0x5f2c17){_0x45dd9d=_0x5f2c17;_0x50e914=0xc8;}else{_0x50e914=0xce;}_0x3b4cb2[_0x2bb2('0x22')](_0x50e914);return _0x3b4cb2['set']('Content-Range',_0x5a79f7+'-'+_0x45dd9d+'/'+_0x5f2c17)[_0x2bb2('0x23')](_0x3e6280);}return null;};}function patchUpdates(_0x5c6464){return function(_0x27c16e){try{jsonpatch[_0x2bb2('0x27')](_0x27c16e,_0x5c6464,!![]);}catch(_0x1d2a19){return BPromise[_0x2bb2('0x28')](_0x1d2a19);}return _0x27c16e['save']();};}function saveUpdates(_0x23f69,_0xaef2c7){return function(_0x56e7b3){if(_0x56e7b3){return _0x56e7b3[_0x2bb2('0x29')](_0x23f69)[_0x2bb2('0x2a')](function(_0x35e484){return _0x35e484;});}return null;};}function removeEntity(_0x1b967c,_0x22a4fb){return function(_0x48ff3c){if(_0x48ff3c){return _0x48ff3c[_0x2bb2('0x2b')]()['then'](function(){var _0x1a79b2=_0x48ff3c['get']({'plain':!![]});var _0xd7a400=_0x2bb2('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0xd7a400,'resourceId':_0x1a79b2['id']}})[_0x2bb2('0x2a')](function(){return _0x48ff3c;});})[_0x2bb2('0x2a')](function(){_0x1b967c[_0x2bb2('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x543cd7,_0x338bc4){return function(_0x1fe4dd){if(!_0x1fe4dd){_0x543cd7[_0x2bb2('0x20')](0x194);}return _0x1fe4dd;};}function handleError(_0x4fbba5,_0x770233){_0x770233=_0x770233||0x1f4;return function(_0x3dc0a8){logger[_0x2bb2('0x2d')](_0x3dc0a8['stack']);if(_0x3dc0a8[_0x2bb2('0x2e')]){delete _0x3dc0a8[_0x2bb2('0x2e')];}_0x4fbba5['status'](_0x770233)[_0x2bb2('0x2f')](_0x3dc0a8);};}exports[_0x2bb2('0x30')]=function(_0x4445c9,_0x42d144){var _0x12ca8c={},_0x2929aa={},_0xa9f5a1={'count':0x0,'rows':[]};var _0x15b4d6=_[_0x2bb2('0x31')](db[_0x2bb2('0x32')][_0x2bb2('0x33')],function(_0x4a15a8){return{'name':_0x4a15a8[_0x2bb2('0x34')],'type':_0x4a15a8[_0x2bb2('0x35')][_0x2bb2('0x36')]};});_0x2929aa[_0x2bb2('0x37')]=_['map'](_0x15b4d6,_0x2bb2('0x2e'));_0x2929aa[_0x2bb2('0x38')]=_[_0x2bb2('0x39')](_0x4445c9[_0x2bb2('0x38')]);_0x2929aa[_0x2bb2('0x3a')]=_[_0x2bb2('0x3b')](_0x2929aa[_0x2bb2('0x37')],_0x2929aa['query']);_0x12ca8c[_0x2bb2('0x3c')]=_['intersection'](_0x2929aa[_0x2bb2('0x37')],qs[_0x2bb2('0x3d')](_0x4445c9[_0x2bb2('0x38')][_0x2bb2('0x3d')]));_0x12ca8c[_0x2bb2('0x3c')]=_0x12ca8c[_0x2bb2('0x3c')][_0x2bb2('0x3e')]?_0x12ca8c[_0x2bb2('0x3c')]:_0x2929aa['model'];if(!_0x4445c9[_0x2bb2('0x38')][_0x2bb2('0x3f')](_0x2bb2('0x40'))){_0x12ca8c[_0x2bb2('0x26')]=qs[_0x2bb2('0x26')](_0x4445c9['query'][_0x2bb2('0x26')]);_0x12ca8c[_0x2bb2('0x25')]=qs['offset'](_0x4445c9[_0x2bb2('0x38')][_0x2bb2('0x25')]);}_0x12ca8c[_0x2bb2('0x41')]=qs[_0x2bb2('0x42')](_0x4445c9[_0x2bb2('0x38')][_0x2bb2('0x42')]);_0x12ca8c['where']=qs[_0x2bb2('0x3a')](_['pick'](_0x4445c9[_0x2bb2('0x38')],_0x2929aa['filters']));if(_0x4445c9[_0x2bb2('0x38')]['filter']){_0x12ca8c['where']=_[_0x2bb2('0x43')](_0x12ca8c[_0x2bb2('0x44')],{'$or':_['map'](_0x15b4d6,function(_0x4485c4){if(_0x4485c4['type']!=='VIRTUAL'){var _0x3bbfae={};_0x3bbfae[_0x4485c4['name']]={'$like':'%'+_0x4445c9[_0x2bb2('0x38')][_0x2bb2('0x45')]+'%'};return _0x3bbfae;}})});}_0x12ca8c=_[_0x2bb2('0x43')]({},_0x12ca8c,_0x4445c9[_0x2bb2('0x46')]);var _0x3f6807={'where':_0x12ca8c[_0x2bb2('0x44')]};return db[_0x2bb2('0x32')][_0x2bb2('0x24')](_0x3f6807)[_0x2bb2('0x2a')](function(_0x582ec3){_0xa9f5a1['count']=_0x582ec3;if(_0x4445c9[_0x2bb2('0x38')][_0x2bb2('0x47')]){_0x12ca8c[_0x2bb2('0x48')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x12ca8c);})[_0x2bb2('0x2a')](function(_0x3933b6){_0xa9f5a1[_0x2bb2('0x49')]=_0x3933b6;return _0xa9f5a1;})[_0x2bb2('0x2a')](respondWithFilteredResult(_0x42d144,_0x12ca8c))[_0x2bb2('0x4a')](handleError(_0x42d144,null));};exports[_0x2bb2('0x4b')]=function(_0x58e6e4,_0x328d2f){var _0x41eede={'raw':!![],'where':{'id':_0x58e6e4[_0x2bb2('0x4c')]['id']}},_0x349e85={};_0x349e85['model']=_[_0x2bb2('0x39')](db[_0x2bb2('0x32')][_0x2bb2('0x33')]);_0x349e85[_0x2bb2('0x38')]=_[_0x2bb2('0x39')](_0x58e6e4[_0x2bb2('0x38')]);_0x349e85[_0x2bb2('0x3a')]=_[_0x2bb2('0x3b')](_0x349e85['model'],_0x349e85[_0x2bb2('0x38')]);_0x41eede['attributes']=_[_0x2bb2('0x3b')](_0x349e85[_0x2bb2('0x37')],qs[_0x2bb2('0x3d')](_0x58e6e4[_0x2bb2('0x38')]['fields']));_0x41eede['attributes']=_0x41eede[_0x2bb2('0x3c')][_0x2bb2('0x3e')]?_0x41eede['attributes']:_0x349e85[_0x2bb2('0x37')];if(_0x58e6e4[_0x2bb2('0x38')]['includeAll']){_0x41eede[_0x2bb2('0x48')]=[{'all':!![]}];}_0x41eede=_['merge']({},_0x41eede,_0x58e6e4[_0x2bb2('0x46')]);return db[_0x2bb2('0x32')]['find'](_0x41eede)['then'](handleEntityNotFound(_0x328d2f,null))[_0x2bb2('0x2a')](respondWithResult(_0x328d2f,null))['catch'](handleError(_0x328d2f,null));};exports['download']=function(_0x4fefa5,_0x31f61d,_0x33aac6){return db[_0x2bb2('0x32')][_0x2bb2('0x4d')]({'where':{'id':_0x4fefa5['params']['id']},'attributes':[_0x2bb2('0x2e'),'path'],'raw':!![]})[_0x2bb2('0x2a')](handleEntityNotFound(_0x31f61d,null))[_0x2bb2('0x2a')](function(_0x3b44f0){if(_0x3b44f0){var _0x2f1091=path[_0x2bb2('0x4e')](config[_0x2bb2('0x4f')],'server/files/plugins',util['format']('%s.zip',path[_0x2bb2('0x50')](_0x3b44f0['path'])));var _0x13b722=fs[_0x2bb2('0x51')](_0x2f1091);var _0x35d25e=archiver(_0x2bb2('0x52'),{'zlib':{'level':0x9}});_0x35d25e['on'](_0x2bb2('0x53'),function(_0x339ae1){if(_0x339ae1['code']===_0x2bb2('0x54')){logger[_0x2bb2('0x2d')](_0x339ae1);}else{throw new db[(_0x2bb2('0x55'))]['Error'](_0x2bb2('0x56'));}});_0x35d25e['on'](_0x2bb2('0x2d'),function(_0x176fbd){throw new db[(_0x2bb2('0x55'))][(_0x2bb2('0x57'))](_0x2bb2('0x56'));});_0x35d25e[_0x2bb2('0x58')](_0x13b722);_0x35d25e['glob'](_0x2bb2('0x59'),{'cwd':path[_0x2bb2('0x4e')](config[_0x2bb2('0x4f')],_0x2bb2('0x5a'),path['dirname'](_0x3b44f0[_0x2bb2('0x8')])),'ignore':[path[_0x2bb2('0x4e')](path[_0x2bb2('0x50')](_0x3b44f0['path']),_0x2bb2('0x5b')),path['join'](path[_0x2bb2('0x50')](_0x3b44f0['path']),'attachments/**/*')],'nodir':!![]})['finalize']();_0x13b722['on'](_0x2bb2('0x5c'),function(){if(!fs[_0x2bb2('0x5d')](_0x2f1091)){throw new db[(_0x2bb2('0x55'))][(_0x2bb2('0x57'))](_0x2bb2('0x5e'));}return _0x31f61d[_0x2bb2('0x5f')](_0x2f1091,util['format'](_0x2bb2('0x60'),path[_0x2bb2('0x50')](_0x3b44f0[_0x2bb2('0x8')])),function(_0x244dc9){if(_0x244dc9){throw new db[(_0x2bb2('0x55'))][(_0x2bb2('0x57'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x2bb2('0x61')](_0x2f1091);logger[_0x2bb2('0x62')](_0x2bb2('0x63'));logger[_0x2bb2('0x62')](_0x2bb2('0x64'));});});}return null;})['catch'](handleError(_0x31f61d,null));};exports[_0x2bb2('0x65')]=function(_0x50e893,_0x4f5edc,_0x4e4cd7){var _0x3317e6=path[_0x2bb2('0x50')](_0x50e893[_0x2bb2('0x66')][_0x2bb2('0x67')],path[_0x2bb2('0x68')](_0x50e893[_0x2bb2('0x66')][_0x2bb2('0x67')]));var _0x3b648d=path[_0x2bb2('0x4e')](config[_0x2bb2('0x4f')],_0x2bb2('0x5a'),_0x50e893[_0x2bb2('0x66')][_0x2bb2('0x67')]);var _0xa5bdfb=path[_0x2bb2('0x4e')](config[_0x2bb2('0x4f')],_0x2bb2('0x5a'),_0x3317e6);logger['info'](_0x2bb2('0x69'),_0x3b648d);logger[_0x2bb2('0x62')](_0x2bb2('0x6a'),_0xa5bdfb);try{fs['chmodSync'](_0x3b648d,parseInt(_0x2bb2('0x6b'),0x8));extract(_0x3b648d,{'dir':_0xa5bdfb},function(_0x1dbf44){if(_0x1dbf44){logger[_0x2bb2('0x2d')](_0x1dbf44);handleError(_0x1dbf44,!![]);};var _0x2ea8f1=fs['readdirSync'](_0xa5bdfb);if(_0x2ea8f1[_0x2bb2('0x3e')]>0x1){removeReferences(_0x3b648d,_0xa5bdfb);logger['error']('Invalid\x20plugin\x20structure');return _0x4e4cd7(new Error('Invalid\x20plugin\x20structure'));}var _0x466f13=fs['lstatSync'](path[_0x2bb2('0x4e')](_0xa5bdfb,_0x2ea8f1[0x0]));if(_0x466f13[_0x2bb2('0x6c')]()){removeReferences(_0x3b648d,_0xa5bdfb);logger[_0x2bb2('0x2d')](_0x2bb2('0x6d'));return _0x4e4cd7(new Error(_0x2bb2('0x6d')));}if(_0x466f13['isDirectory']()){var _0x50ae31=fs[_0x2bb2('0x6e')](path[_0x2bb2('0x4e')](_0xa5bdfb,_0x2ea8f1[0x0]));if(_0x50ae31[_0x2bb2('0x3e')]===0x0){removeReferences(_0x3b648d,_0xa5bdfb);logger[_0x2bb2('0x2d')](_0x2bb2('0x6d'));return _0x4e4cd7(new Error('Invalid\x20plugin\x20structure'));}var _0x4ae20b=_0x50ae31[_0x2bb2('0x6f')](function(_0x243eeb){return _0x243eeb==='manifest.json';});if(!_0x4ae20b){return _0x4e4cd7(new Error(_0x2bb2('0x70')));}var _0x4abbf8=fs[_0x2bb2('0x71')](path[_0x2bb2('0x4e')](_0xa5bdfb,_0x2ea8f1[0x0],_0x2bb2('0x72')));var _0x2e590b=JSON['parse'](_0x4abbf8);if('undefined'==typeof _0x2e590b['name']){return _0x4e4cd7(new Error(_0x2bb2('0x73')));}if(_0x2bb2('0x74')==typeof _0x2e590b[_0x2bb2('0x35')]){return _0x4e4cd7(new Error(_0x2bb2('0x75')));}if(_0x2bb2('0x74')==typeof _0x2e590b[_0x2bb2('0x76')]){return _0x4e4cd7(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x2bb2('0x74')==typeof _0x2e590b['parameters']){return _0x4e4cd7(new Error(_0x2bb2('0x77')));}if(_0x2e590b[_0x2bb2('0x35')]===_0x2bb2('0x78')){if('undefined'==typeof _0x2e590b[_0x2bb2('0x79')][_0x2bb2('0x7a')]){return _0x4e4cd7(new Error(_0x2bb2('0x7b')));}if(_0x2bb2('0x74')==typeof _0x2e590b[_0x2bb2('0x79')][_0x2bb2('0x7a')][_0x2bb2('0x7c')]&&_0x2bb2('0x74')==typeof _0x2e590b['parameters'][_0x2bb2('0x7a')][_0x2bb2('0x7d')]){return _0x4e4cd7(new Error(_0x2bb2('0x7e')));}}else if(_0x2e590b[_0x2bb2('0x35')]===_0x2bb2('0x7f')){if('undefined'==typeof _0x2e590b[_0x2bb2('0x79')][_0x2bb2('0x80')]){return _0x4e4cd7(new Error(_0x2bb2('0x81')));}if(_0x2bb2('0x74')==typeof _0x2e590b[_0x2bb2('0x79')][_0x2bb2('0x82')]){return _0x4e4cd7(new Error(_0x2bb2('0x83')));}}else{return _0x4e4cd7(new Error(_0x2bb2('0x84')));}var _0x2343c6=_0x2e590b['name'];var _0x60f662=_0x2e590b[_0x2bb2('0x85')];var _0x545d4e=_0x2e590b[_0x2bb2('0x35')];var _0x33fabb=_0x2e590b[_0x2bb2('0x86')]?_0x2e590b[_0x2bb2('0x86')]:'always';var _0x40db74=_0x2e590b[_0x2bb2('0x87')]?_0x2e590b[_0x2bb2('0x87')]:_0x2bb2('0x88');var _0x2505d3='';var _0x59f0da='';var _0x53c551='';var _0x570b99='';var _0x596ddd=_0x2e590b[_0x2bb2('0x76')];if(_0x545d4e==='html'){if('undefined'!=typeof _0x2e590b[_0x2bb2('0x79')][_0x2bb2('0x7a')][_0x2bb2('0x7c')]){var _0x1f021d=_0x2e590b[_0x2bb2('0x79')][_0x2bb2('0x7a')][_0x2bb2('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x2bb2('0x89')](_0x1f021d)){_0x2505d3=path[_0x2bb2('0x4e')](_0x2bb2('0x8a'),_0x3317e6,_0x2ea8f1[0x0],_0x1f021d);}else{_0x2505d3=_0x1f021d;}}else{logger[_0x2bb2('0x62')](_0x2bb2('0x8b'));}if('undefined'!=typeof _0x2e590b['parameters'][_0x2bb2('0x7a')][_0x2bb2('0x7d')]){var _0x36613c=_0x2e590b[_0x2bb2('0x79')][_0x2bb2('0x7a')][_0x2bb2('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x2bb2('0x89')](_0x36613c)){_0x59f0da=path[_0x2bb2('0x4e')](_0x2bb2('0x8a'),_0x3317e6,_0x2ea8f1[0x0],_0x36613c);}else{_0x59f0da=_0x36613c;}}else{logger[_0x2bb2('0x62')](_0x2bb2('0x8c'));}}else if(_0x545d4e===_0x2bb2('0x7f')){_0x53c551=_0x2e590b[_0x2bb2('0x79')][_0x2bb2('0x80')];_0x570b99=_0x2e590b[_0x2bb2('0x79')]['scriptPath'];if(_0x2bb2('0x74')!=typeof _0x2e590b[_0x2bb2('0x79')]['views']){if(_0x2bb2('0x74')!=typeof _0x2e590b[_0x2bb2('0x79')][_0x2bb2('0x7a')][_0x2bb2('0x7c')]){var _0x1f021d=_0x2e590b['parameters']['views'][_0x2bb2('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x2bb2('0x89')](_0x1f021d)){_0x2505d3=path[_0x2bb2('0x4e')](_0x2bb2('0x8a'),_0x3317e6,_0x2ea8f1[0x0],_0x1f021d);}else{_0x2505d3=_0x1f021d;}}if(_0x2bb2('0x74')!=typeof _0x2e590b[_0x2bb2('0x79')][_0x2bb2('0x7a')][_0x2bb2('0x7d')]){var _0x36613c=_0x2e590b['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x2bb2('0x89')](_0x36613c)){_0x59f0da=path[_0x2bb2('0x4e')](_0x2bb2('0x8a'),_0x3317e6,_0x2ea8f1[0x0],_0x36613c);}else{_0x59f0da=_0x36613c;}}}}var _0x55d64f={'name':_0x2343c6,'description':_0x60f662,'path':path['join'](_0x3317e6,_0x2ea8f1[0x0]),'type':_0x545d4e,'sidebar':_0x33fabb,'icon':_0x40db74,'adminUrl':_0x2505d3,'agentUrl':_0x59f0da,'scriptName':_0x53c551,'scriptPath':_0x570b99,'version':_0x596ddd};removeReferences(_0x3b648d,null);return db['Plugin'][_0x2bb2('0x8d')](_0x55d64f)['then'](function(_0x5c485e){var _0xf75823={'role':_0x50e893[_0x2bb2('0x8e')][_0x2bb2('0x8f')],'userProfileId':_0x50e893[_0x2bb2('0x8e')][_0x2bb2('0x90')]};if(!_0xf75823)throw new Error(_0x2bb2('0x91'));if(_0xf75823[_0x2bb2('0x8f')]==='user'){var _0x35d71a=_0x5c485e[_0x2bb2('0x92')]({'plain':!![]});return db['UserProfileSection'][_0x2bb2('0x4d')]({'where':{'name':_0x2bb2('0x2c'),'userProfileId':_0xf75823[_0x2bb2('0x90')]},'raw':!![]})[_0x2bb2('0x2a')](function(_0x1ff49b){if(_0x1ff49b&&_0x1ff49b['autoAssociation']===0x0){return db[_0x2bb2('0x93')][_0x2bb2('0x8d')]({'name':_0x35d71a['name'],'resourceId':_0x35d71a['id'],'type':_0x1ff49b[_0x2bb2('0x2e')],'sectionId':_0x1ff49b['id']},{})[_0x2bb2('0x2a')](function(){return _0x5c485e;});}else{return _0x5c485e;}})[_0x2bb2('0x4a')](function(_0x22c77f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22c77f);throw _0x22c77f;});}return _0x5c485e;})[_0x2bb2('0x2a')](respondWithResult(_0x4f5edc,null))[_0x2bb2('0x4a')](handleError(_0x4f5edc,null));}});}catch(_0x287e41){_0x4f5edc['status'](0x1f4)[_0x2bb2('0x2f')](_0x287e41);}};function removeReferences(_0x43df71,_0x53a4ab){try{if(_0x43df71){fs[_0x2bb2('0x61')](_0x43df71);logger[_0x2bb2('0x62')]('Zip\x20archive\x20removed');}if(_0x53a4ab){rimraf(_0x53a4ab,function(){});logger[_0x2bb2('0x62')](_0x2bb2('0x94'));}}catch(_0x4cbc13){logger[_0x2bb2('0x2d')](_0x4cbc13);}}exports[_0x2bb2('0x29')]=function(_0x414d47,_0x555d99,_0x195d6d){return db['Plugin'][_0x2bb2('0x4d')]({'where':{'id':_0x414d47[_0x2bb2('0x4c')]['id']}})[_0x2bb2('0x2a')](handleEntityNotFound(_0x555d99,null))[_0x2bb2('0x2a')](saveUpdates(_0x414d47[_0x2bb2('0x8e')],null))[_0x2bb2('0x2a')](respondWithResult(_0x555d99,null))[_0x2bb2('0x4a')](handleError(_0x555d99,null));};exports[_0x2bb2('0x95')]=function(_0x300c94,_0x188c5f,_0x3261a7){return db[_0x2bb2('0x32')][_0x2bb2('0x4d')]({'where':{'id':_0x300c94[_0x2bb2('0x4c')]['id']}})[_0x2bb2('0x2a')](function(_0x1b6a13){if(_0x1b6a13){return _0x1b6a13['destroy']();}})['then'](function(_0x22d7e0){rimraf(path[_0x2bb2('0x4e')](config[_0x2bb2('0x4f')],'server/files/plugins',path[_0x2bb2('0x96')](_0x22d7e0[_0x2bb2('0x8')])),function(){});return _0x22d7e0;})['then'](handleEntityNotFound(_0x188c5f,null))['then'](respondWithStatusCode(_0x188c5f,null))['catch'](handleError(_0x188c5f,null));};exports[_0x2bb2('0x97')]=function(_0x8b4036,_0x23df56,_0x2059d5){return BPromise['resolve']()['then'](function(){if(!_0x8b4036[_0x2bb2('0x38')][_0x2bb2('0x8')]){throw new Error(_0x2bb2('0x98'));}if(!_0x8b4036[_0x2bb2('0x38')][_0x2bb2('0x99')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x24ee3c=_0x8b4036['query']['hostname']?_0x8b4036[_0x2bb2('0x38')][_0x2bb2('0x9a')]+':'+_0x8b4036[_0x2bb2('0x38')][_0x2bb2('0x99')]:_0x2bb2('0x9b')+_0x8b4036[_0x2bb2('0x38')][_0x2bb2('0x99')];var _0x20e4a4=_0x8b4036[_0x2bb2('0x38')][_0x2bb2('0x23')]?_0x8b4036[_0x2bb2('0x38')]['json']:!![];var _0x6d1e9e=_0x8b4036['query']['encoding']?_0x8b4036['query'][_0x2bb2('0x9c')]:null;var _0x15c91c={'method':_0x8b4036['method'],'uri':util[_0x2bb2('0x9d')](_0x2bb2('0x9e'),_0x24ee3c,_0x8b4036[_0x2bb2('0x38')]['path']),'json':_0x20e4a4,'resolveWithFullResponse':!![],'encoding':_0x6d1e9e,'qs':_0x8b4036['query']};if(_0x8b4036[_0x2bb2('0x9f')]){_0x15c91c[_0x2bb2('0x9f')]=_0x8b4036[_0x2bb2('0x9f')];if(_0x15c91c['headers'][_0x2bb2('0xa0')]){delete _0x15c91c['headers'][_0x2bb2('0xa0')];}}if(_0x15c91c[_0x2bb2('0x9f')]['content-type']){delete _0x15c91c[_0x2bb2('0x9f')][_0x2bb2('0xa1')];}return rp(_0x15c91c);})[_0x2bb2('0x2a')](function(_0x4dba8d){if(_0x4dba8d){_0x23df56['set'](_0x4dba8d[_0x2bb2('0x9f')]);logger[_0x2bb2('0x62')](_0x4dba8d[_0x2bb2('0x8e')]);if(_[_0x2bb2('0xa2')](_0x8b4036[_0x2bb2('0x38')][_0x2bb2('0x8')],'download')&&_0x4dba8d[_0x2bb2('0xa3')]==0x1f4){return _0x23df56[_0x2bb2('0x20')](_0x4dba8d[_0x2bb2('0xa3')]);}else{return _0x23df56[_0x2bb2('0x22')](_0x4dba8d['statusCode'])['send'](_0x4dba8d[_0x2bb2('0x8e')]);}}else{return _0x23df56['sendStatus'](0xc8);}})['catch'](handleError(_0x23df56,null));};exports[_0x2bb2('0xa4')]=function(_0x396c7e,_0x398eb1,_0x2e53df){return BPromise[_0x2bb2('0xa5')]()[_0x2bb2('0x2a')](function(){if(!_0x396c7e['query'][_0x2bb2('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x396c7e[_0x2bb2('0x38')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4b420a=_0x396c7e[_0x2bb2('0x38')]['hostname']?_0x396c7e[_0x2bb2('0x38')][_0x2bb2('0x9a')]+':'+_0x396c7e[_0x2bb2('0x38')][_0x2bb2('0x99')]:'http://localhost:'+_0x396c7e[_0x2bb2('0x38')][_0x2bb2('0x99')];var _0x10b7de=_0x396c7e[_0x2bb2('0x38')]['json']?_0x396c7e[_0x2bb2('0x38')][_0x2bb2('0x23')]:!![];var _0x53b4df=_0x396c7e['query'][_0x2bb2('0x9c')]?_0x396c7e[_0x2bb2('0x38')][_0x2bb2('0x9c')]:null;var _0x39d639={'method':_0x396c7e[_0x2bb2('0xa6')],'uri':util[_0x2bb2('0x9d')]('%s%s',_0x4b420a,_0x396c7e[_0x2bb2('0x38')][_0x2bb2('0x8')]),'json':_0x10b7de,'resolveWithFullResponse':!![],'encoding':_0x53b4df,'body':_0x396c7e[_0x2bb2('0x8e')]};if(_0x396c7e['headers']){_0x39d639['headers']=_0x396c7e['headers'];if(_0x39d639[_0x2bb2('0x9f')][_0x2bb2('0xa0')]){delete _0x39d639['headers'][_0x2bb2('0xa0')];}}if(_0x39d639['headers'][_0x2bb2('0xa1')]){delete _0x39d639[_0x2bb2('0x9f')]['content-type'];}return rp(_0x39d639);})['then'](function(_0x611a24){if(_0x611a24){_0x398eb1['set'](_0x611a24[_0x2bb2('0x9f')]);logger[_0x2bb2('0x62')](_0x611a24['body']);return _0x398eb1[_0x2bb2('0x22')](_0x611a24[_0x2bb2('0xa3')])['send'](_0x611a24[_0x2bb2('0x8e')]);}else{return _0x398eb1[_0x2bb2('0x20')](0xc8);}})[_0x2bb2('0x4a')](handleError(_0x398eb1,null));}; \ No newline at end of file +var _0x155b=['Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','version','html','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Extracted\x20folder\x20removed','params','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','method','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','extract-zip','rimraf','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','get','Plugins','UserProfileResource','destroy','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','rows','catch','show','Plugin','rawAttributes','options','find','download','join','root','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','Error','pipe','glob','dirname','attachments/**/*','finalize','close','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','server/files/plugins'];(function(_0x19db73,_0x4efa84){var _0x5601d4=function(_0x3c6c54){while(--_0x3c6c54){_0x19db73['push'](_0x19db73['shift']());}};_0x5601d4(++_0x4efa84);}(_0x155b,0xef));var _0xb155=function(_0xac3027,_0x59d1d9){_0xac3027=_0xac3027-0x0;var _0x4cc775=_0x155b[_0xac3027];return _0x4cc775;};'use strict';var pdf=require(_0xb155('0x0'));var emlformat=require(_0xb155('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb155('0x2'));var jsonpatch=require(_0xb155('0x3'));var rp=require('request-promise');var moment=require(_0xb155('0x4'));var BPromise=require(_0xb155('0x5'));var Mustache=require(_0xb155('0x6'));var util=require(_0xb155('0x7'));var path=require(_0xb155('0x8'));var sox=require(_0xb155('0x9'));var csv=require(_0xb155('0xa'));var ejs=require(_0xb155('0xb'));var fs=require('fs');var _=require(_0xb155('0xc'));var squel=require(_0xb155('0xd'));var crypto=require(_0xb155('0xe'));var jsforce=require(_0xb155('0xf'));var deskjs=require(_0xb155('0x10'));var toCsv=require(_0xb155('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0xb155('0x11'));var rimraf=require(_0xb155('0x12'));var archiver=require(_0xb155('0x13'));var Redis=require(_0xb155('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xb155('0x15'));var as=require(_0xb155('0x16'));var hardwareService=require(_0xb155('0x17'));var logger=require(_0xb155('0x18'))(_0xb155('0x19'));var utils=require('../../config/utils');var config=require(_0xb155('0x1a'));var db=require(_0xb155('0x1b'))['db'];config['redis']=_[_0xb155('0x1c')](config[_0xb155('0x1d')],{'host':_0xb155('0x1e'),'port':0x18eb});var socket=require(_0xb155('0x1f'))(new Redis(config[_0xb155('0x1d')]));require(_0xb155('0x20'))[_0xb155('0x21')](socket);function respondWithStatusCode(_0x39c30e,_0x53414a){_0x53414a=_0x53414a||0xcc;return function(_0x1e310c){if(_0x1e310c){return _0x39c30e[_0xb155('0x22')](_0x53414a);}return _0x39c30e[_0xb155('0x23')](_0x53414a)[_0xb155('0x24')]();};}function respondWithResult(_0x45578d,_0xaa28e7){_0xaa28e7=_0xaa28e7||0xc8;return function(_0x448621){if(_0x448621){return _0x45578d['status'](_0xaa28e7)[_0xb155('0x25')](_0x448621);}};}function respondWithFilteredResult(_0x6f07b4,_0x42b6d3){return function(_0x2a6da6){if(_0x2a6da6){var _0x449aff=_0x2a6da6[_0xb155('0x26')],_0x2b6001=_0x42b6d3[_0xb155('0x27')],_0x37ce4a=_0x42b6d3[_0xb155('0x27')]+_0x42b6d3[_0xb155('0x28')],_0x7bb01e;if(_0x37ce4a>=_0x449aff){_0x37ce4a=_0x449aff;_0x7bb01e=0xc8;}else{_0x7bb01e=0xce;}_0x6f07b4[_0xb155('0x23')](_0x7bb01e);return _0x6f07b4[_0xb155('0x29')](_0xb155('0x2a'),_0x2b6001+'-'+_0x37ce4a+'/'+_0x449aff)['json'](_0x2a6da6);}return null;};}function patchUpdates(_0x3779f0){return function(_0x5a5281){try{jsonpatch['apply'](_0x5a5281,_0x3779f0,!![]);}catch(_0x53c672){return BPromise[_0xb155('0x2b')](_0x53c672);}return _0x5a5281['save']();};}function saveUpdates(_0xe2bd7,_0x4c6dc5){return function(_0x595509){if(_0x595509){return _0x595509[_0xb155('0x2c')](_0xe2bd7)[_0xb155('0x2d')](function(_0x131060){return _0x131060;});}return null;};}function removeEntity(_0x46916c,_0x3c50f2){return function(_0x2ee536){if(_0x2ee536){return _0x2ee536['destroy']()[_0xb155('0x2d')](function(){var _0x471700=_0x2ee536[_0xb155('0x2e')]({'plain':!![]});var _0x3f668c=_0xb155('0x2f');return db[_0xb155('0x30')][_0xb155('0x31')]({'where':{'type':_0x3f668c,'resourceId':_0x471700['id']}})['then'](function(){return _0x2ee536;});})['then'](function(){_0x46916c[_0xb155('0x23')](0xcc)[_0xb155('0x24')]();});}};}function handleEntityNotFound(_0x266ad0,_0x114446){return function(_0x9472a1){if(!_0x9472a1){_0x266ad0[_0xb155('0x22')](0x194);}return _0x9472a1;};}function handleError(_0x59f12d,_0x32316a){_0x32316a=_0x32316a||0x1f4;return function(_0x64d1e){logger[_0xb155('0x32')](_0x64d1e[_0xb155('0x33')]);if(_0x64d1e[_0xb155('0x34')]){delete _0x64d1e[_0xb155('0x34')];}_0x59f12d[_0xb155('0x23')](_0x32316a)[_0xb155('0x35')](_0x64d1e);};}exports[_0xb155('0x36')]=function(_0x510443,_0x40e338){var _0x172254={},_0x30e5e0={},_0x25587a={'count':0x0,'rows':[]};var _0x1a99da=_[_0xb155('0x37')](db['Plugin']['rawAttributes'],function(_0xcdc993){return{'name':_0xcdc993[_0xb155('0x38')],'type':_0xcdc993[_0xb155('0x39')][_0xb155('0x3a')]};});_0x30e5e0[_0xb155('0x3b')]=_[_0xb155('0x37')](_0x1a99da,_0xb155('0x34'));_0x30e5e0['query']=_[_0xb155('0x3c')](_0x510443[_0xb155('0x3d')]);_0x30e5e0['filters']=_[_0xb155('0x3e')](_0x30e5e0['model'],_0x30e5e0[_0xb155('0x3d')]);_0x172254[_0xb155('0x3f')]=_[_0xb155('0x3e')](_0x30e5e0[_0xb155('0x3b')],qs[_0xb155('0x40')](_0x510443['query']['fields']));_0x172254[_0xb155('0x3f')]=_0x172254[_0xb155('0x3f')][_0xb155('0x41')]?_0x172254[_0xb155('0x3f')]:_0x30e5e0['model'];if(!_0x510443[_0xb155('0x3d')][_0xb155('0x42')](_0xb155('0x43'))){_0x172254[_0xb155('0x28')]=qs['limit'](_0x510443[_0xb155('0x3d')]['limit']);_0x172254[_0xb155('0x27')]=qs['offset'](_0x510443['query'][_0xb155('0x27')]);}_0x172254['order']=qs[_0xb155('0x44')](_0x510443['query'][_0xb155('0x44')]);_0x172254[_0xb155('0x45')]=qs[_0xb155('0x46')](_[_0xb155('0x47')](_0x510443[_0xb155('0x3d')],_0x30e5e0[_0xb155('0x46')]));if(_0x510443[_0xb155('0x3d')][_0xb155('0x48')]){_0x172254[_0xb155('0x45')]=_[_0xb155('0x49')](_0x172254[_0xb155('0x45')],{'$or':_[_0xb155('0x37')](_0x1a99da,function(_0xfb3ebd){if(_0xfb3ebd['type']!=='VIRTUAL'){var _0x198cec={};_0x198cec[_0xfb3ebd[_0xb155('0x34')]]={'$like':'%'+_0x510443[_0xb155('0x3d')][_0xb155('0x48')]+'%'};return _0x198cec;}})});}_0x172254=_[_0xb155('0x49')]({},_0x172254,_0x510443['options']);var _0x986713={'where':_0x172254[_0xb155('0x45')]};return db['Plugin'][_0xb155('0x26')](_0x986713)['then'](function(_0x46d92f){_0x25587a[_0xb155('0x26')]=_0x46d92f;if(_0x510443[_0xb155('0x3d')][_0xb155('0x4a')]){_0x172254[_0xb155('0x4b')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x172254);})[_0xb155('0x2d')](function(_0x3b41c0){_0x25587a[_0xb155('0x4c')]=_0x3b41c0;return _0x25587a;})['then'](respondWithFilteredResult(_0x40e338,_0x172254))[_0xb155('0x4d')](handleError(_0x40e338,null));};exports[_0xb155('0x4e')]=function(_0x199d80,_0x4e28d7){var _0x2d42e6={'raw':!![],'where':{'id':_0x199d80['params']['id']}},_0x52c6bb={};_0x52c6bb['model']=_[_0xb155('0x3c')](db[_0xb155('0x4f')][_0xb155('0x50')]);_0x52c6bb[_0xb155('0x3d')]=_[_0xb155('0x3c')](_0x199d80[_0xb155('0x3d')]);_0x52c6bb[_0xb155('0x46')]=_['intersection'](_0x52c6bb[_0xb155('0x3b')],_0x52c6bb[_0xb155('0x3d')]);_0x2d42e6[_0xb155('0x3f')]=_[_0xb155('0x3e')](_0x52c6bb[_0xb155('0x3b')],qs[_0xb155('0x40')](_0x199d80[_0xb155('0x3d')]['fields']));_0x2d42e6[_0xb155('0x3f')]=_0x2d42e6[_0xb155('0x3f')][_0xb155('0x41')]?_0x2d42e6[_0xb155('0x3f')]:_0x52c6bb['model'];if(_0x199d80[_0xb155('0x3d')]['includeAll']){_0x2d42e6[_0xb155('0x4b')]=[{'all':!![]}];}_0x2d42e6=_['merge']({},_0x2d42e6,_0x199d80[_0xb155('0x51')]);return db[_0xb155('0x4f')][_0xb155('0x52')](_0x2d42e6)[_0xb155('0x2d')](handleEntityNotFound(_0x4e28d7,null))[_0xb155('0x2d')](respondWithResult(_0x4e28d7,null))[_0xb155('0x4d')](handleError(_0x4e28d7,null));};exports[_0xb155('0x53')]=function(_0x5bf560,_0x15b1f0,_0x10b6a4){return db[_0xb155('0x4f')]['find']({'where':{'id':_0x5bf560['params']['id']},'attributes':[_0xb155('0x34'),_0xb155('0x8')],'raw':!![]})[_0xb155('0x2d')](handleEntityNotFound(_0x15b1f0,null))['then'](function(_0x40dbec){if(_0x40dbec){var _0x3df0f4=path[_0xb155('0x54')](config[_0xb155('0x55')],'server/files/plugins',util[_0xb155('0x56')](_0xb155('0x57'),path[_0xb155('0x58')](_0x40dbec['path'])));var _0x333da9=fs[_0xb155('0x59')](_0x3df0f4);var _0x18d03a=archiver(_0xb155('0x5a'),{'zlib':{'level':0x9}});_0x18d03a['on'](_0xb155('0x5b'),function(_0x3c8d45){if(_0x3c8d45[_0xb155('0x5c')]===_0xb155('0x5d')){logger[_0xb155('0x32')](_0x3c8d45);}else{throw new db['Sequelize']['Error'](_0xb155('0x5e'));}});_0x18d03a['on'](_0xb155('0x32'),function(_0x59f8c5){throw new db[(_0xb155('0x5f'))][(_0xb155('0x60'))](_0xb155('0x5e'));});_0x18d03a[_0xb155('0x61')](_0x333da9);_0x18d03a[_0xb155('0x62')]('**/*',{'cwd':path[_0xb155('0x54')](config['root'],'server/files/plugins',path[_0xb155('0x63')](_0x40dbec[_0xb155('0x8')])),'ignore':[path[_0xb155('0x54')](path[_0xb155('0x58')](_0x40dbec[_0xb155('0x8')]),'node_modules/**/*'),path[_0xb155('0x54')](path['basename'](_0x40dbec[_0xb155('0x8')]),_0xb155('0x64'))],'nodir':!![]})[_0xb155('0x65')]();_0x333da9['on'](_0xb155('0x66'),function(){if(!fs['existsSync'](_0x3df0f4)){throw new db[(_0xb155('0x5f'))][(_0xb155('0x60'))]('Plugin\x20not\x20found');}return _0x15b1f0[_0xb155('0x53')](_0x3df0f4,util[_0xb155('0x56')]('%s.zip',path[_0xb155('0x58')](_0x40dbec[_0xb155('0x8')])),function(_0x19b7cc){if(_0x19b7cc){throw new db[(_0xb155('0x5f'))][(_0xb155('0x60'))](_0xb155('0x67'));}fs[_0xb155('0x68')](_0x3df0f4);logger[_0xb155('0x69')](_0xb155('0x6a'));logger[_0xb155('0x69')](_0xb155('0x6b'));});});}return null;})[_0xb155('0x4d')](handleError(_0x15b1f0,null));};exports[_0xb155('0x6c')]=function(_0x30a8a7,_0x452c40,_0x3af8ae){var _0x1d77b1=path[_0xb155('0x58')](_0x30a8a7[_0xb155('0x6d')][_0xb155('0x6e')],path[_0xb155('0x6f')](_0x30a8a7[_0xb155('0x6d')][_0xb155('0x6e')]));var _0x189d8d=path[_0xb155('0x54')](config[_0xb155('0x55')],_0xb155('0x70'),_0x30a8a7[_0xb155('0x6d')][_0xb155('0x6e')]);var _0xd9b7fa=path[_0xb155('0x54')](config[_0xb155('0x55')],_0xb155('0x70'),_0x1d77b1);logger[_0xb155('0x69')](_0xb155('0x71'),_0x189d8d);logger[_0xb155('0x69')](_0xb155('0x72'),_0xd9b7fa);try{fs[_0xb155('0x73')](_0x189d8d,parseInt('0777',0x8));extract(_0x189d8d,{'dir':_0xd9b7fa},function(_0x35f6c6){if(_0x35f6c6){logger['error'](_0x35f6c6);handleError(_0x35f6c6,!![]);};var _0x2e462c=fs['readdirSync'](_0xd9b7fa);if(_0x2e462c[_0xb155('0x41')]>0x1){removeReferences(_0x189d8d,_0xd9b7fa);logger[_0xb155('0x32')](_0xb155('0x74'));return _0x3af8ae(new Error(_0xb155('0x74')));}var _0xa6a75c=fs[_0xb155('0x75')](path[_0xb155('0x54')](_0xd9b7fa,_0x2e462c[0x0]));if(_0xa6a75c[_0xb155('0x76')]()){removeReferences(_0x189d8d,_0xd9b7fa);logger[_0xb155('0x32')](_0xb155('0x74'));return _0x3af8ae(new Error(_0xb155('0x74')));}if(_0xa6a75c[_0xb155('0x77')]()){var _0x222414=fs['readdirSync'](path['join'](_0xd9b7fa,_0x2e462c[0x0]));if(_0x222414[_0xb155('0x41')]===0x0){removeReferences(_0x189d8d,_0xd9b7fa);logger[_0xb155('0x32')]('Invalid\x20plugin\x20structure');return _0x3af8ae(new Error(_0xb155('0x74')));}var _0x563fed=_0x222414[_0xb155('0x78')](function(_0x2bc60a){return _0x2bc60a===_0xb155('0x79');});if(!_0x563fed){return _0x3af8ae(new Error(_0xb155('0x7a')));}var _0x5056e1=fs[_0xb155('0x7b')](path[_0xb155('0x54')](_0xd9b7fa,_0x2e462c[0x0],_0xb155('0x79')));var _0x18001a=JSON['parse'](_0x5056e1);if('undefined'==typeof _0x18001a['name']){return _0x3af8ae(new Error(_0xb155('0x7c')));}if('undefined'==typeof _0x18001a[_0xb155('0x39')]){return _0x3af8ae(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xb155('0x7d')==typeof _0x18001a['version']){return _0x3af8ae(new Error(_0xb155('0x7e')));}if(_0xb155('0x7d')==typeof _0x18001a[_0xb155('0x7f')]){return _0x3af8ae(new Error(_0xb155('0x80')));}if(_0x18001a[_0xb155('0x39')]==='html'){if('undefined'==typeof _0x18001a['parameters'][_0xb155('0x81')]){return _0x3af8ae(new Error(_0xb155('0x82')));}if('undefined'==typeof _0x18001a[_0xb155('0x7f')]['views'][_0xb155('0x83')]&&'undefined'==typeof _0x18001a['parameters'][_0xb155('0x81')][_0xb155('0x84')]){return _0x3af8ae(new Error(_0xb155('0x85')));}}else if(_0x18001a['type']==='script'){if(_0xb155('0x7d')==typeof _0x18001a[_0xb155('0x7f')][_0xb155('0x86')]){return _0x3af8ae(new Error(_0xb155('0x87')));}if(_0xb155('0x7d')==typeof _0x18001a['parameters'][_0xb155('0x88')]){return _0x3af8ae(new Error(_0xb155('0x89')));}}else{return _0x3af8ae(new Error(_0xb155('0x8a')));}var _0x186c7f=_0x18001a[_0xb155('0x34')];var _0xa254a=_0x18001a[_0xb155('0x8b')];var _0xe501b=_0x18001a['type'];var _0x4f7fea=_0x18001a[_0xb155('0x8c')]?_0x18001a[_0xb155('0x8c')]:_0xb155('0x8d');var _0x36e30f=_0x18001a[_0xb155('0x8e')]?_0x18001a['icon']:'icon-apps';var _0x8c49a5='';var _0x378435='';var _0x36ea91='';var _0x25bc4e='';var _0x2e2e48=_0x18001a[_0xb155('0x8f')];if(_0xe501b===_0xb155('0x90')){if(_0xb155('0x7d')!=typeof _0x18001a[_0xb155('0x7f')][_0xb155('0x81')][_0xb155('0x83')]){var _0x1f9608=_0x18001a[_0xb155('0x7f')]['views'][_0xb155('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1f9608)){_0x8c49a5=path[_0xb155('0x54')](_0xb155('0x91'),_0x1d77b1,_0x2e462c[0x0],_0x1f9608);}else{_0x8c49a5=_0x1f9608;}}else{logger[_0xb155('0x69')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xb155('0x7d')!=typeof _0x18001a[_0xb155('0x7f')][_0xb155('0x81')][_0xb155('0x84')]){var _0x3f0ee2=_0x18001a[_0xb155('0x7f')][_0xb155('0x81')][_0xb155('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xb155('0x92')](_0x3f0ee2)){_0x378435=path['join']('plugins',_0x1d77b1,_0x2e462c[0x0],_0x3f0ee2);}else{_0x378435=_0x3f0ee2;}}else{logger[_0xb155('0x69')](_0xb155('0x93'));}}else if(_0xe501b===_0xb155('0x94')){_0x36ea91=_0x18001a[_0xb155('0x7f')]['scriptName'];_0x25bc4e=_0x18001a[_0xb155('0x7f')][_0xb155('0x88')];if(_0xb155('0x7d')!=typeof _0x18001a[_0xb155('0x7f')]['views']){if(_0xb155('0x7d')!=typeof _0x18001a[_0xb155('0x7f')]['views'][_0xb155('0x83')]){var _0x1f9608=_0x18001a[_0xb155('0x7f')][_0xb155('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xb155('0x92')](_0x1f9608)){_0x8c49a5=path[_0xb155('0x54')]('plugins',_0x1d77b1,_0x2e462c[0x0],_0x1f9608);}else{_0x8c49a5=_0x1f9608;}}if('undefined'!=typeof _0x18001a['parameters']['views'][_0xb155('0x84')]){var _0x3f0ee2=_0x18001a[_0xb155('0x7f')][_0xb155('0x81')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x3f0ee2)){_0x378435=path[_0xb155('0x54')](_0xb155('0x91'),_0x1d77b1,_0x2e462c[0x0],_0x3f0ee2);}else{_0x378435=_0x3f0ee2;}}}}var _0xcf43f2={'name':_0x186c7f,'description':_0xa254a,'path':path[_0xb155('0x54')](_0x1d77b1,_0x2e462c[0x0]),'type':_0xe501b,'sidebar':_0x4f7fea,'icon':_0x36e30f,'adminUrl':_0x8c49a5,'agentUrl':_0x378435,'scriptName':_0x36ea91,'scriptPath':_0x25bc4e,'version':_0x2e2e48};removeReferences(_0x189d8d,null);return db[_0xb155('0x4f')][_0xb155('0x95')](_0xcf43f2)[_0xb155('0x2d')](function(_0x5f3719){var _0x571fae={'role':_0x30a8a7[_0xb155('0x96')][_0xb155('0x97')],'userProfileId':_0x30a8a7[_0xb155('0x96')][_0xb155('0x98')]};if(!_0x571fae)throw new Error(_0xb155('0x99'));if(_0x571fae[_0xb155('0x97')]===_0xb155('0x9a')){var _0x247ace=_0x5f3719[_0xb155('0x2e')]({'plain':!![]});return db[_0xb155('0x9b')][_0xb155('0x52')]({'where':{'name':'Plugins','userProfileId':_0x571fae['userProfileId']},'raw':!![]})[_0xb155('0x2d')](function(_0xc5feef){if(_0xc5feef&&_0xc5feef[_0xb155('0x9c')]===0x0){return db[_0xb155('0x30')][_0xb155('0x95')]({'name':_0x247ace[_0xb155('0x34')],'resourceId':_0x247ace['id'],'type':_0xc5feef[_0xb155('0x34')],'sectionId':_0xc5feef['id']},{})[_0xb155('0x2d')](function(){return _0x5f3719;});}else{return _0x5f3719;}})[_0xb155('0x4d')](function(_0x5ec449){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ec449);throw _0x5ec449;});}return _0x5f3719;})[_0xb155('0x2d')](respondWithResult(_0x452c40,null))[_0xb155('0x4d')](handleError(_0x452c40,null));}});}catch(_0x52cdcc){_0x452c40[_0xb155('0x23')](0x1f4)[_0xb155('0x35')](_0x52cdcc);}};function removeReferences(_0xe0bfee,_0x5b7a09){try{if(_0xe0bfee){fs['unlinkSync'](_0xe0bfee);logger[_0xb155('0x69')]('Zip\x20archive\x20removed');}if(_0x5b7a09){rimraf(_0x5b7a09,function(){});logger[_0xb155('0x69')](_0xb155('0x9d'));}}catch(_0x54b4b4){logger[_0xb155('0x32')](_0x54b4b4);}}exports[_0xb155('0x2c')]=function(_0x42f122,_0xefbc5b,_0x31015e){return db[_0xb155('0x4f')]['find']({'where':{'id':_0x42f122[_0xb155('0x9e')]['id']}})['then'](handleEntityNotFound(_0xefbc5b,null))[_0xb155('0x2d')](saveUpdates(_0x42f122['body'],null))['then'](respondWithResult(_0xefbc5b,null))[_0xb155('0x4d')](handleError(_0xefbc5b,null));};exports[_0xb155('0x9f')]=function(_0x1704b0,_0x23b1ab,_0x4727f2){return db['Plugin']['find']({'where':{'id':_0x1704b0[_0xb155('0x9e')]['id']}})[_0xb155('0x2d')](function(_0x231c3d){if(_0x231c3d){return _0x231c3d[_0xb155('0x31')]();}})[_0xb155('0x2d')](function(_0x1a22f1){rimraf(path['join'](config[_0xb155('0x55')],_0xb155('0x70'),path['dirname'](_0x1a22f1['path'])),function(){});return _0x1a22f1;})[_0xb155('0x2d')](handleEntityNotFound(_0x23b1ab,null))['then'](respondWithStatusCode(_0x23b1ab,null))['catch'](handleError(_0x23b1ab,null));};exports[_0xb155('0xa0')]=function(_0x5a5f09,_0x5d1645,_0x10dae2){return BPromise[_0xb155('0xa1')]()[_0xb155('0x2d')](function(){if(!_0x5a5f09[_0xb155('0x3d')][_0xb155('0x8')]){throw new Error(_0xb155('0xa2'));}if(!_0x5a5f09['query'][_0xb155('0xa3')]){throw new Error(_0xb155('0xa4'));}var _0x3ea15a=_0x5a5f09[_0xb155('0x3d')][_0xb155('0xa5')]?_0x5a5f09['query']['hostname']+':'+_0x5a5f09[_0xb155('0x3d')]['port']:_0xb155('0xa6')+_0x5a5f09[_0xb155('0x3d')]['port'];var _0xd00976=_0x5a5f09[_0xb155('0x3d')][_0xb155('0x25')]?_0x5a5f09['query']['json']:!![];var _0xedc91f=_0x5a5f09[_0xb155('0x3d')][_0xb155('0xa7')]?_0x5a5f09[_0xb155('0x3d')][_0xb155('0xa7')]:null;var _0x365921={'method':_0x5a5f09['method'],'uri':util[_0xb155('0x56')](_0xb155('0xa8'),_0x3ea15a,_0x5a5f09['query']['path']),'json':_0xd00976,'resolveWithFullResponse':!![],'encoding':_0xedc91f,'qs':_0x5a5f09[_0xb155('0x3d')]};if(_0x5a5f09[_0xb155('0xa9')]){_0x365921[_0xb155('0xa9')]=_0x5a5f09[_0xb155('0xa9')];if(_0x365921['headers'][_0xb155('0xaa')]){delete _0x365921[_0xb155('0xa9')][_0xb155('0xaa')];}}if(_0x365921[_0xb155('0xa9')][_0xb155('0xab')]){delete _0x365921[_0xb155('0xa9')][_0xb155('0xab')];}return rp(_0x365921);})[_0xb155('0x2d')](function(_0x2f132b){if(_0x2f132b){_0x5d1645[_0xb155('0x29')](_0x2f132b['headers']);logger['info'](_0x2f132b[_0xb155('0x96')]);if(_[_0xb155('0xac')](_0x5a5f09['query']['path'],_0xb155('0x53'))&&_0x2f132b[_0xb155('0xad')]==0x1f4){return _0x5d1645[_0xb155('0x22')](_0x2f132b[_0xb155('0xad')]);}else{return _0x5d1645[_0xb155('0x23')](_0x2f132b['statusCode'])[_0xb155('0x35')](_0x2f132b[_0xb155('0x96')]);}}else{return _0x5d1645[_0xb155('0x22')](0xc8);}})['catch'](handleError(_0x5d1645,null));};exports[_0xb155('0xae')]=function(_0x30ace7,_0x1641c1,_0x4bede8){return BPromise[_0xb155('0xa1')]()[_0xb155('0x2d')](function(){if(!_0x30ace7['query'][_0xb155('0x8')]){throw new Error(_0xb155('0xa2'));}if(!_0x30ace7['query']['port']){throw new Error(_0xb155('0xa4'));}var _0x16d1d6=_0x30ace7[_0xb155('0x3d')][_0xb155('0xa5')]?_0x30ace7[_0xb155('0x3d')]['hostname']+':'+_0x30ace7[_0xb155('0x3d')][_0xb155('0xa3')]:_0xb155('0xa6')+_0x30ace7[_0xb155('0x3d')][_0xb155('0xa3')];var _0x585d44=_0x30ace7[_0xb155('0x3d')][_0xb155('0x25')]?_0x30ace7[_0xb155('0x3d')]['json']:!![];var _0x2bd10d=_0x30ace7[_0xb155('0x3d')][_0xb155('0xa7')]?_0x30ace7['query'][_0xb155('0xa7')]:null;var _0xb3604e={'method':_0x30ace7[_0xb155('0xaf')],'uri':util[_0xb155('0x56')](_0xb155('0xa8'),_0x16d1d6,_0x30ace7['query'][_0xb155('0x8')]),'json':_0x585d44,'resolveWithFullResponse':!![],'encoding':_0x2bd10d,'body':_0x30ace7[_0xb155('0x96')]};if(_0x30ace7[_0xb155('0xa9')]){_0xb3604e[_0xb155('0xa9')]=_0x30ace7[_0xb155('0xa9')];if(_0xb3604e[_0xb155('0xa9')]['content-length']){delete _0xb3604e['headers'][_0xb155('0xaa')];}}if(_0xb3604e['headers'][_0xb155('0xab')]){delete _0xb3604e[_0xb155('0xa9')][_0xb155('0xab')];}return rp(_0xb3604e);})[_0xb155('0x2d')](function(_0x34457f){if(_0x34457f){_0x1641c1['set'](_0x34457f[_0xb155('0xa9')]);logger[_0xb155('0x69')](_0x34457f[_0xb155('0x96')]);return _0x1641c1['status'](_0x34457f[_0xb155('0xad')])['send'](_0x34457f[_0xb155('0x96')]);}else{return _0x1641c1['sendStatus'](0xc8);}})['catch'](handleError(_0x1641c1,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index f38b31f..08852b6 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 _0xbbbc=['save','update','remove','emit','hook','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x64c8e0,_0xe55620){var _0x367b34=function(_0x4d3c58){while(--_0x4d3c58){_0x64c8e0['push'](_0x64c8e0['shift']());}};_0x367b34(++_0xe55620);}(_0xbbbc,0xf6));var _0xcbbb=function(_0xf74f46,_0x1a49d4){_0xf74f46=_0xf74f46-0x0;var _0x5ea729=_0xbbbc[_0xf74f46];return _0x5ea729;};'use strict';var EventEmitter=require(_0xcbbb('0x0'));var Plugin=require(_0xcbbb('0x1'))['db'][_0xcbbb('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xcbbb('0x3')](0x0);var events={'afterCreate':_0xcbbb('0x4'),'afterUpdate':_0xcbbb('0x5'),'afterDestroy':_0xcbbb('0x6')};function emitEvent(_0x5832b6){return function(_0xb1ad23,_0x938376,_0x45da04){PluginEvents[_0xcbbb('0x7')](_0x5832b6+':'+_0xb1ad23['id'],_0xb1ad23);PluginEvents[_0xcbbb('0x7')](_0x5832b6,_0xb1ad23);_0x45da04(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xcbbb('0x8')](e,emitEvent(event));}}module[_0xcbbb('0x9')]=PluginEvents; \ No newline at end of file +var _0x7708=['events','../../mysqldb','setMaxListeners','emit','hasOwnProperty','hook','exports'];(function(_0x4a759f,_0x1441fd){var _0x3d0721=function(_0x450d68){while(--_0x450d68){_0x4a759f['push'](_0x4a759f['shift']());}};_0x3d0721(++_0x1441fd);}(_0x7708,0x188));var _0x8770=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x7708[_0x5a26f5];return _0x2e9ef7;};'use strict';var EventEmitter=require(_0x8770('0x0'));var Plugin=require(_0x8770('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x8770('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4c494a){return function(_0x182d52,_0x1a796d,_0x577b13){PluginEvents[_0x8770('0x3')](_0x4c494a+':'+_0x182d52['id'],_0x182d52);PluginEvents['emit'](_0x4c494a,_0x182d52);_0x577b13(null);};}for(var e in events){if(events[_0x8770('0x4')](e)){var event=events[e];Plugin[_0x8770('0x5')](e,emitEvent(event));}}module[_0x8770('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index f167f59..0b5f1c6 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 _0xb138=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes','Plugin','plugins','lodash','util','../../config/logger'];(function(_0x3f2209,_0x14c645){var _0x563d14=function(_0x2e904c){while(--_0x2e904c){_0x3f2209['push'](_0x3f2209['shift']());}};_0x563d14(++_0x14c645);}(_0xb138,0x1dd));var _0x8b13=function(_0x45c226,_0x36aa46){_0x45c226=_0x45c226-0x0;var _0x398109=_0xb138[_0x45c226];return _0x398109;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));module['exports']=function(_0xd19a0f,_0x13f7bd){return _0xd19a0f['define'](_0x8b13('0xa'),attributes,{'tableName':_0x8b13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac31=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','Plugin','plugins','lodash','util'];(function(_0x59ab5e,_0x34bab5){var _0x2684d7=function(_0xf3b931){while(--_0xf3b931){_0x59ab5e['push'](_0x59ab5e['shift']());}};_0x2684d7(++_0x34bab5);}(_0xac31,0xca));var _0x1ac3=function(_0x190384,_0x583602){_0x190384=_0x190384-0x0;var _0x5b3017=_0xac31[_0x190384];return _0x5b3017;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var BPromise=require(_0x1ac3('0x5'));var rp=require(_0x1ac3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var attributes=require('./plugin.attributes');module['exports']=function(_0xbe22b7,_0x20027f){return _0xbe22b7[_0x1ac3('0x9')](_0x1ac3('0xa'),attributes,{'tableName':_0x1ac3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index e65c7af..cc8ef5f 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 _0x5339=['Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','message','result','catch','create','body','options','raw','stringify','CreatePlugin','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','info'];(function(_0x249f8c,_0xfb3946){var _0x5e224a=function(_0xd4c5a1){while(--_0xd4c5a1){_0x249f8c['push'](_0x249f8c['shift']());}};_0x5e224a(++_0xfb3946);}(_0x5339,0x18e));var _0x9533=function(_0x2a8cf8,_0x2994e){_0x2a8cf8=_0x2a8cf8-0x0;var _0x318c10=_0x5339[_0x2a8cf8];return _0x318c10;};'use strict';var _=require(_0x9533('0x0'));var util=require(_0x9533('0x1'));var moment=require('moment');var BPromise=require(_0x9533('0x2'));var rs=require(_0x9533('0x3'));var fs=require('fs');var Redis=require(_0x9533('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9533('0x5'));var logger=require(_0x9533('0x6'))(_0x9533('0x7'));var config=require('../../config/environment');var jayson=require(_0x9533('0x8'));var client=jayson[_0x9533('0x9')]['http']({'port':0x232a});config[_0x9533('0xa')]=_[_0x9533('0xb')](config[_0x9533('0xa')],{'host':_0x9533('0xc'),'port':0x18eb});var socket=require(_0x9533('0xd'))(new Redis(config[_0x9533('0xa')]));require(_0x9533('0xe'))['register'](socket);function respondWithRpcPromise(_0x34560c,_0x5a8bb4,_0x4e99b3){return new BPromise(function(_0x49ce54,_0xbc6a1b){return client[_0x9533('0xf')](_0x34560c,_0x4e99b3)[_0x9533('0x10')](function(_0x418c65){logger[_0x9533('0x11')](_0x9533('0x12'),_0x5a8bb4,_0x9533('0x13'));logger[_0x9533('0x14')](_0x9533('0x15'),_0x5a8bb4,_0x9533('0x13'),JSON['stringify'](_0x418c65));if(_0x418c65[_0x9533('0x16')]){if(_0x418c65[_0x9533('0x16')]['code']===0x1f4){logger[_0x9533('0x16')]('Plugin,\x20%s,\x20%s',_0x5a8bb4,_0x418c65[_0x9533('0x16')][_0x9533('0x17')]);return _0xbc6a1b(_0x418c65[_0x9533('0x16')][_0x9533('0x17')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x5a8bb4,_0x418c65[_0x9533('0x16')][_0x9533('0x17')]);return _0x49ce54(_0x418c65[_0x9533('0x16')][_0x9533('0x17')]);}else{logger[_0x9533('0x11')](_0x9533('0x12'),_0x5a8bb4,_0x9533('0x13'));_0x49ce54(_0x418c65[_0x9533('0x18')]['message']);}})[_0x9533('0x19')](function(_0x3eb5c7){logger[_0x9533('0x16')](_0x9533('0x12'),_0x5a8bb4,_0x3eb5c7);_0xbc6a1b(_0x3eb5c7);});});}exports['CreatePlugin']=function(_0x5ebae6){var _0xbe1454=this;return new Promise(function(_0x226077,_0x5698aa){return db['Plugin'][_0x9533('0x1a')](_0x5ebae6[_0x9533('0x1b')],{'raw':_0x5ebae6[_0x9533('0x1c')]?_0x5ebae6[_0x9533('0x1c')][_0x9533('0x1d')]===undefined?!![]:![]:!![]})[_0x9533('0x10')](function(_0x195a22){logger[_0x9533('0x11')]('CreatePlugin',_0x5ebae6);logger['debug']('CreatePlugin',_0x5ebae6,JSON[_0x9533('0x1e')](_0x195a22));_0x226077(_0x195a22);})[_0x9533('0x19')](function(_0x556ff3){logger[_0x9533('0x16')](_0x9533('0x1f'),_0x556ff3[_0x9533('0x17')],_0x5ebae6);_0x5698aa(_0xbe1454[_0x9533('0x16')](0x1f4,_0x556ff3[_0x9533('0x17')]));});});}; \ No newline at end of file +var _0x102c=['./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreatePlugin','body','options','raw','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x24c338,_0x14e8c4){var _0x34e21c=function(_0x430ccf){while(--_0x430ccf){_0x24c338['push'](_0x24c338['shift']());}};_0x34e21c(++_0x14e8c4);}(_0x102c,0x13c));var _0xc102=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x102c[_0x3e112d];return _0x531c31;};'use strict';var _=require('lodash');var util=require(_0xc102('0x0'));var moment=require(_0xc102('0x1'));var BPromise=require(_0xc102('0x2'));var rs=require(_0xc102('0x3'));var fs=require('fs');var Redis=require(_0xc102('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc102('0x5'));var logger=require(_0xc102('0x6'))(_0xc102('0x7'));var config=require(_0xc102('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc102('0x9')][_0xc102('0xa')]({'port':0x232a});config[_0xc102('0xb')]=_[_0xc102('0xc')](config[_0xc102('0xb')],{'host':_0xc102('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc102('0xb')]));require(_0xc102('0xe'))[_0xc102('0xf')](socket);function respondWithRpcPromise(_0x4d7b18,_0x523c35,_0x1c9772){return new BPromise(function(_0x3c3118,_0x1023a1){return client[_0xc102('0x10')](_0x4d7b18,_0x1c9772)[_0xc102('0x11')](function(_0x5f4559){logger['info'](_0xc102('0x12'),_0x523c35,'request\x20sent');logger[_0xc102('0x13')](_0xc102('0x14'),_0x523c35,_0xc102('0x15'),JSON['stringify'](_0x5f4559));if(_0x5f4559['error']){if(_0x5f4559[_0xc102('0x16')][_0xc102('0x17')]===0x1f4){logger[_0xc102('0x16')]('Plugin,\x20%s,\x20%s',_0x523c35,_0x5f4559[_0xc102('0x16')]['message']);return _0x1023a1(_0x5f4559['error'][_0xc102('0x18')]);}logger['error'](_0xc102('0x12'),_0x523c35,_0x5f4559[_0xc102('0x16')]['message']);return _0x3c3118(_0x5f4559[_0xc102('0x16')]['message']);}else{logger[_0xc102('0x19')](_0xc102('0x12'),_0x523c35,'request\x20sent');_0x3c3118(_0x5f4559[_0xc102('0x1a')][_0xc102('0x18')]);}})['catch'](function(_0x563b78){logger[_0xc102('0x16')]('Plugin,\x20%s,\x20%s',_0x523c35,_0x563b78);_0x1023a1(_0x563b78);});});}exports[_0xc102('0x1b')]=function(_0x3a85ce){var _0x5f2f00=this;return new Promise(function(_0x377620,_0x1e7ab4){return db['Plugin']['create'](_0x3a85ce[_0xc102('0x1c')],{'raw':_0x3a85ce[_0xc102('0x1d')]?_0x3a85ce[_0xc102('0x1d')][_0xc102('0x1e')]===undefined?!![]:![]:!![]})[_0xc102('0x11')](function(_0x517fd3){logger['info'](_0xc102('0x1b'),_0x3a85ce);logger['debug'](_0xc102('0x1b'),_0x3a85ce,JSON[_0xc102('0x1f')](_0x517fd3));_0x377620(_0x517fd3);})[_0xc102('0x20')](function(_0x1463e6){logger[_0xc102('0x16')]('CreatePlugin',_0x1463e6[_0xc102('0x18')],_0x3a85ce);_0x1e7ab4(_0x5f2f00[_0xc102('0x16')](0x1f4,_0x1463e6[_0xc102('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 7486bfc..f17e6ea 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 _0x5187=['./plugin.events','register','length','plugin:'];(function(_0x4a21bf,_0x450d5a){var _0x3b0733=function(_0x3023ce){while(--_0x3023ce){_0x4a21bf['push'](_0x4a21bf['shift']());}};_0x3b0733(++_0x450d5a);}(_0x5187,0x124));var _0x7518=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5187[_0x19e35c];return _0x3e1fe8;};'use strict';var PluginEvents=require(_0x7518('0x0'));var events=['save','remove','update'];function createListener(_0xe4e46d,_0x2a254e){return function(_0x43ff8e){_0x2a254e['emit'](_0xe4e46d,_0x43ff8e);};}function removeListener(_0x9e326a,_0x293654){return function(){PluginEvents['removeListener'](_0x9e326a,_0x293654);};}exports[_0x7518('0x1')]=function(_0x431415){for(var _0x208b43=0x0,_0x157d62=events[_0x7518('0x2')];_0x208b43<_0x157d62;_0x208b43++){var _0x3b50da=events[_0x208b43];var _0x4c5998=createListener(_0x7518('0x3')+_0x3b50da,_0x431415);PluginEvents['on'](_0x3b50da,_0x4c5998);}}; \ No newline at end of file +var _0x90aa=['register','length','./plugin.events','save','update','emit','removeListener'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x90aa,0x152));var _0xa90a=function(_0x33e6e3,_0x385ae9){_0x33e6e3=_0x33e6e3-0x0;var _0x26cf94=_0x90aa[_0x33e6e3];return _0x26cf94;};'use strict';var PluginEvents=require(_0xa90a('0x0'));var events=[_0xa90a('0x1'),'remove',_0xa90a('0x2')];function createListener(_0x12fa47,_0x586ab4){return function(_0x410de4){_0x586ab4[_0xa90a('0x3')](_0x12fa47,_0x410de4);};}function removeListener(_0x48c6b0,_0x138683){return function(){PluginEvents[_0xa90a('0x4')](_0x48c6b0,_0x138683);};}exports[_0xa90a('0x5')]=function(_0x5b320a){for(var _0x2d6858=0x0,_0x22593c=events[_0xa90a('0x6')];_0x2d6858<_0x22593c;_0x2d6858++){var _0x16c4e0=events[_0x2d6858];var _0x46c9ed=createListener('plugin:'+_0x16c4e0,_0x5b320a);PluginEvents['on'](_0x16c4e0,_0x46c9ed);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index a887bd5..cfcfe1f 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 _0x2b6e=['update','delete','destroy','express','Router','../../components/auth/service','./pm2.controller','get','/:id','show','post','create','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2b6e,0x107));var _0xe2b6=function(_0x2f68d5,_0x4536f6){_0x2f68d5=_0x2f68d5-0x0;var _0x4fa59e=_0x2b6e[_0x2f68d5];return _0x4fa59e;};'use strict';var express=require(_0xe2b6('0x0'));var router=express[_0xe2b6('0x1')]();var auth=require(_0xe2b6('0x2'));var controller=require(_0xe2b6('0x3'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe2b6('0x4')](_0xe2b6('0x5'),auth['isAuthenticated'](),controller[_0xe2b6('0x6')]);router[_0xe2b6('0x7')]('/',auth['isAuthenticated'](),controller[_0xe2b6('0x8')]);router['put'](_0xe2b6('0x5'),auth[_0xe2b6('0x9')](),controller[_0xe2b6('0xa')]);router[_0xe2b6('0xb')](_0xe2b6('0x5'),auth['isAuthenticated'](),controller[_0xe2b6('0xc')]);module['exports']=router; \ No newline at end of file +var _0xcb3c=['./pm2.controller','get','isAuthenticated','/:id','post','create','put','delete','exports','express','Router','../../components/auth/service'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xcb3c,0x99));var _0xccb3=function(_0x3abf9a,_0x3d71df){_0x3abf9a=_0x3abf9a-0x0;var _0x1de11b=_0xcb3c[_0x3abf9a];return _0x1de11b;};'use strict';var express=require(_0xccb3('0x0'));var router=express[_0xccb3('0x1')]();var auth=require(_0xccb3('0x2'));var controller=require(_0xccb3('0x3'));router[_0xccb3('0x4')]('/',auth[_0xccb3('0x5')](),controller['index']);router[_0xccb3('0x4')](_0xccb3('0x6'),auth[_0xccb3('0x5')](),controller['show']);router[_0xccb3('0x7')]('/',auth[_0xccb3('0x5')](),controller[_0xccb3('0x8')]);router[_0xccb3('0x9')]('/:id',auth[_0xccb3('0x5')](),controller['update']);router[_0xccb3('0xa')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xccb3('0xb')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index a0aae78..6ef4949 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 _0xd7f7=['motion2','length','catch','show','params','create','body','join','../../files/plugins','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','api','path','child_process','sendStatus','status','stack','name','send','npm\x20install','info','error','index','list','then','reject','express'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd7f7,0xf8));var _0x7d7f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd7f7[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x7d7f('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x7d7f('0x1'))(_0x7d7f('0x2'));var path=require(_0x7d7f('0x3'));var exec=require(_0x7d7f('0x4'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x1e28d5,_0x17ac4f){return function(_0x87ea17){if(!_0x87ea17){_0x1e28d5[_0x7d7f('0x5')](0x194);;}return _0x87ea17;};}function respondWithResult(_0x3e2c4e,_0x2ce3af){_0x2ce3af=_0x2ce3af||0xc8;return function(_0x126ee5){if(_0x126ee5){return _0x3e2c4e[_0x7d7f('0x6')](_0x2ce3af)['json'](_0x126ee5);}return null;};}function handleError(_0x2966c9,_0x4c3f61){_0x4c3f61=_0x4c3f61||0x1f4;return function(_0xc21109){logger['error'](_0xc21109[_0x7d7f('0x7')]);if(_0xc21109[_0x7d7f('0x8')]){delete _0xc21109['name'];}_0x2966c9[_0x7d7f('0x6')](_0x4c3f61)[_0x7d7f('0x9')](_0xc21109);};}function execChildProcess(){return new BPromise(function(_0xe927fa,_0x4c0d1f){exec(_0x7d7f('0xa'),function(_0xe8632d,_0x547387,_0x2a56ec){logger[_0x7d7f('0xb')](_0x547387);logger[_0x7d7f('0xb')](_0x2a56ec);if(_0xe8632d){logger[_0x7d7f('0xc')](_0xe8632d);return _0x4c0d1f(_0xe8632d);}return _0xe927fa(_0x547387);});});}exports[_0x7d7f('0xd')]=function(_0x219b32,_0x82052d){return pm2[_0x7d7f('0xe')]()[_0x7d7f('0xf')](function(_0x476c12){if(_0x476c12){var _0x24f68b=_[_0x7d7f('0x10')](_0x476c12,function(_0x56edd5){return _0x56edd5[_0x7d7f('0x8')]===_0x7d7f('0x11')||_0x56edd5[_0x7d7f('0x8')]===_0x7d7f('0x12');});return{'rows':_0x24f68b,'count':_0x24f68b[_0x7d7f('0x13')]};}return null;})['then'](respondWithResult(_0x82052d,null))[_0x7d7f('0x14')](handleError(_0x82052d,null));};exports[_0x7d7f('0x15')]=function(_0x23c66c,_0x3051b8){return pm2['describe'](_0x23c66c[_0x7d7f('0x16')]['id'])[_0x7d7f('0xf')](respondWithResult(_0x3051b8,null))['then'](handleEntityNotFound(_0x3051b8,null))[_0x7d7f('0x14')](handleError(_0x3051b8,null));};exports[_0x7d7f('0x17')]=function(_0x4a0de1,_0x14cb8e){if(_0x4a0de1[_0x7d7f('0x18')][_0x7d7f('0x8')]&&_0x4a0de1['body']['script']){var _0x14fe06=path[_0x7d7f('0x19')](__dirname,_0x7d7f('0x1a'),_0x4a0de1[_0x7d7f('0x18')]['script']);var _0x1a92c1=process['cwd']();process[_0x7d7f('0x1b')](path[_0x7d7f('0x1c')](_0x14fe06));return execChildProcess()['then'](function(_0x580b3d){process[_0x7d7f('0x1b')](_0x1a92c1);return pm2['start']({'name':_0x4a0de1['body'][_0x7d7f('0x8')],'script':_0x14fe06});})['then'](function(_0x3d334b){pm2[_0x7d7f('0x1d')]();return _0x3d334b[0x0];})['then'](respondWithResult(_0x14cb8e,0xc9))[_0x7d7f('0x14')](handleError(_0x14cb8e,null));}else{return _0x14cb8e[_0x7d7f('0x6')](0x1f4)[_0x7d7f('0x9')]({'message':_0x7d7f('0x1e')});}};exports[_0x7d7f('0x1f')]=function(_0x261480,_0x1009bd){if(_0x261480[_0x7d7f('0x18')]['id']){delete _0x261480[_0x7d7f('0x18')]['id'];}var _0xcd2ae1={'online':_0x7d7f('0x20'),'stopped':_0x7d7f('0x21')};if(_0xcd2ae1['hasOwnProperty'](_0x261480[_0x7d7f('0x18')][_0x7d7f('0x6')])){return pm2[_0xcd2ae1[_0x261480[_0x7d7f('0x18')][_0x7d7f('0x6')]]](_0x261480[_0x7d7f('0x16')]['id'])[_0x7d7f('0xf')](respondWithResult(_0x1009bd,0xc8))['catch'](handleError(_0x1009bd,null));}else{return _0x1009bd[_0x7d7f('0x6')](0x1f4)[_0x7d7f('0x9')]({'message':_0x7d7f('0x22')});}};exports[_0x7d7f('0x23')]=function(_0x54110d,_0x5ee76c){if(_0x54110d[_0x7d7f('0x18')]['id']){delete _0x54110d[_0x7d7f('0x18')]['id'];}if(_0x54110d[_0x7d7f('0x16')]['id']){return pm2[_0x7d7f('0x24')](_0x54110d[_0x7d7f('0x16')]['id'])[_0x7d7f('0xf')](function(_0x45a543){pm2['dump']();return _0x45a543[0x0];})[_0x7d7f('0xf')](respondWithResult(_0x5ee76c,null))[_0x7d7f('0x14')](handleError(_0x5ee76c,null));}else{return _0x5ee76c[_0x7d7f('0x6')](0x1f4)[_0x7d7f('0x9')]({'message':_0x7d7f('0x25')});}}; \ No newline at end of file +var _0xb3d2=['length','show','describe','params','create','body','script','../../files/plugins','cwd','dirname','chdir','dump','catch','Missing\x20name\x20and/or\x20path','update','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','api','path','child_process','exec','status','json','error','stack','name','send','npm\x20install','info','index','list','then','express','motion2'];(function(_0x354c2b,_0x5dc2a0){var _0x44209b=function(_0x5ed3e1){while(--_0x5ed3e1){_0x354c2b['push'](_0x354c2b['shift']());}};_0x44209b(++_0x5dc2a0);}(_0xb3d2,0x8a));var _0x2b3d=function(_0x2ffb00,_0x59d80c){_0x2ffb00=_0x2ffb00-0x0;var _0x57cd4a=_0xb3d2[_0x2ffb00];return _0x57cd4a;};'use strict';var _=require(_0x2b3d('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x2b3d('0x1'));var path=require(_0x2b3d('0x2'));var exec=require(_0x2b3d('0x3'))[_0x2b3d('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x104249,_0xb9c639){return function(_0xedc237){if(!_0xedc237){_0x104249['sendStatus'](0x194);;}return _0xedc237;};}function respondWithResult(_0x2fa9a6,_0x36ff7f){_0x36ff7f=_0x36ff7f||0xc8;return function(_0x53aab5){if(_0x53aab5){return _0x2fa9a6[_0x2b3d('0x5')](_0x36ff7f)[_0x2b3d('0x6')](_0x53aab5);}return null;};}function handleError(_0x1e5e7b,_0x26b577){_0x26b577=_0x26b577||0x1f4;return function(_0x1be8e9){logger[_0x2b3d('0x7')](_0x1be8e9[_0x2b3d('0x8')]);if(_0x1be8e9[_0x2b3d('0x9')]){delete _0x1be8e9[_0x2b3d('0x9')];}_0x1e5e7b['status'](_0x26b577)[_0x2b3d('0xa')](_0x1be8e9);};}function execChildProcess(){return new BPromise(function(_0x4e0f65,_0x57b299){exec(_0x2b3d('0xb'),function(_0x309328,_0x3a0b26,_0x492a4d){logger['info'](_0x3a0b26);logger[_0x2b3d('0xc')](_0x492a4d);if(_0x309328){logger[_0x2b3d('0x7')](_0x309328);return _0x57b299(_0x309328);}return _0x4e0f65(_0x3a0b26);});});}exports[_0x2b3d('0xd')]=function(_0x245686,_0x37f93a){return pm2[_0x2b3d('0xe')]()[_0x2b3d('0xf')](function(_0x25adf9){if(_0x25adf9){var _0x5834c4=_['reject'](_0x25adf9,function(_0x423152){return _0x423152[_0x2b3d('0x9')]===_0x2b3d('0x10')||_0x423152[_0x2b3d('0x9')]===_0x2b3d('0x11');});return{'rows':_0x5834c4,'count':_0x5834c4[_0x2b3d('0x12')]};}return null;})['then'](respondWithResult(_0x37f93a,null))['catch'](handleError(_0x37f93a,null));};exports[_0x2b3d('0x13')]=function(_0x1c5033,_0x2381fa){return pm2[_0x2b3d('0x14')](_0x1c5033[_0x2b3d('0x15')]['id'])[_0x2b3d('0xf')](respondWithResult(_0x2381fa,null))['then'](handleEntityNotFound(_0x2381fa,null))['catch'](handleError(_0x2381fa,null));};exports[_0x2b3d('0x16')]=function(_0x37f148,_0x1759fd){if(_0x37f148[_0x2b3d('0x17')][_0x2b3d('0x9')]&&_0x37f148[_0x2b3d('0x17')][_0x2b3d('0x18')]){var _0x4ae904=path['join'](__dirname,_0x2b3d('0x19'),_0x37f148['body'][_0x2b3d('0x18')]);var _0x1b0c56=process[_0x2b3d('0x1a')]();process['chdir'](path[_0x2b3d('0x1b')](_0x4ae904));return execChildProcess()[_0x2b3d('0xf')](function(_0x2dbe37){process[_0x2b3d('0x1c')](_0x1b0c56);return pm2['start']({'name':_0x37f148['body'][_0x2b3d('0x9')],'script':_0x4ae904});})['then'](function(_0x55133b){pm2[_0x2b3d('0x1d')]();return _0x55133b[0x0];})[_0x2b3d('0xf')](respondWithResult(_0x1759fd,0xc9))[_0x2b3d('0x1e')](handleError(_0x1759fd,null));}else{return _0x1759fd[_0x2b3d('0x5')](0x1f4)['send']({'message':_0x2b3d('0x1f')});}};exports[_0x2b3d('0x20')]=function(_0x1e2f16,_0x357420){if(_0x1e2f16['body']['id']){delete _0x1e2f16[_0x2b3d('0x17')]['id'];}var _0x51c8c4={'online':_0x2b3d('0x21'),'stopped':_0x2b3d('0x22')};if(_0x51c8c4['hasOwnProperty'](_0x1e2f16['body']['status'])){return pm2[_0x51c8c4[_0x1e2f16['body'][_0x2b3d('0x5')]]](_0x1e2f16[_0x2b3d('0x15')]['id'])[_0x2b3d('0xf')](respondWithResult(_0x357420,0xc8))[_0x2b3d('0x1e')](handleError(_0x357420,null));}else{return _0x357420[_0x2b3d('0x5')](0x1f4)[_0x2b3d('0xa')]({'message':_0x2b3d('0x23')});}};exports[_0x2b3d('0x24')]=function(_0x742db1,_0x492a17){if(_0x742db1[_0x2b3d('0x17')]['id']){delete _0x742db1[_0x2b3d('0x17')]['id'];}if(_0x742db1[_0x2b3d('0x15')]['id']){return pm2[_0x2b3d('0x25')](_0x742db1['params']['id'])['then'](function(_0x47545f){pm2[_0x2b3d('0x1d')]();return _0x47545f[0x0];})[_0x2b3d('0xf')](respondWithResult(_0x492a17,null))[_0x2b3d('0x1e')](handleError(_0x492a17,null));}else{return _0x492a17[_0x2b3d('0x5')](0x1f4)['send']({'message':_0x2b3d('0x26')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 627eefc..bd7572b 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 _0x1026=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','util','path','connect-timeout'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0x1026,0x1ed));var _0x6102=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0x1026[_0x53f0db];return _0xae0a5c;};'use strict';var multer=require('multer');var util=require(_0x6102('0x0'));var path=require(_0x6102('0x1'));var timeout=require(_0x6102('0x2'));var express=require(_0x6102('0x3'));var router=express[_0x6102('0x4')]();var auth=require(_0x6102('0x5'));var interaction=require(_0x6102('0x6'));var config=require(_0x6102('0x7'));module['exports']=router; \ No newline at end of file +var _0xcc27=['connect-timeout','exports','multer','path'];(function(_0x35754d,_0x1efa55){var _0x21159b=function(_0x158df6){while(--_0x158df6){_0x35754d['push'](_0x35754d['shift']());}};_0x21159b(++_0x1efa55);}(_0xcc27,0x18e));var _0x7cc2=function(_0x2e7ceb,_0x5a6130){_0x2e7ceb=_0x2e7ceb-0x0;var _0x99068e=_0xcc27[_0x2e7ceb];return _0x99068e;};'use strict';var multer=require(_0x7cc2('0x0'));var util=require('util');var path=require(_0x7cc2('0x1'));var timeout=require(_0x7cc2('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x7cc2('0x3')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 1fbbada..ec67887 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 _0x8938=['DATE','exports','INTEGER','STRING'];(function(_0x115926,_0x15ab41){var _0x55746f=function(_0x244bb6){while(--_0x244bb6){_0x115926['push'](_0x115926['shift']());}};_0x55746f(++_0x15ab41);}(_0x8938,0x1f1));var _0x8893=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x8938[_0x3f0b30];return _0x2748a5;};'use strict';var Sequelize=require('sequelize');module[_0x8893('0x0')]={'state':{'type':Sequelize[_0x8893('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x8893('0x2')]},'scheduledat':{'type':Sequelize[_0x8893('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x8893('0x3')]},'responsetime':{'type':Sequelize[_0x8893('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8893('0x2')]},'campaigntype':{'type':Sequelize[_0x8893('0x2')]},'membername':{'type':Sequelize[_0x8893('0x2')]}}; \ No newline at end of file +var _0xeecc=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x5e3cef,_0x3c57f5){var _0x34c370=function(_0x4bc3e4){while(--_0x4bc3e4){_0x5e3cef['push'](_0x5e3cef['shift']());}};_0x34c370(++_0x3c57f5);}(_0xeecc,0x1d8));var _0xceec=function(_0x3179c0,_0x53cde9){_0x3179c0=_0x3179c0-0x0;var _0x343fb0=_0xeecc[_0x3179c0];return _0x343fb0;};'use strict';var Sequelize=require(_0xceec('0x0'));module[_0xceec('0x1')]={'state':{'type':Sequelize[_0xceec('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xceec('0x3')]},'scheduledat':{'type':Sequelize[_0xceec('0x4')]},'uniqueid':{'type':Sequelize[_0xceec('0x3')]},'starttime':{'type':Sequelize[_0xceec('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xceec('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xceec('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 3f75baa..2094ca4 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 _0x6073=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ReportAgentPreview','lodash','../../config/logger'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0x6073,0xae));var _0x3607=function(_0x3baa79,_0x5067cc){_0x3baa79=_0x3baa79-0x0;var _0x19bf32=_0x6073[_0x3baa79];return _0x19bf32;};'use strict';var _=require(_0x3607('0x0'));var util=require('util');var logger=require(_0x3607('0x1'))(_0x3607('0x2'));var moment=require(_0x3607('0x3'));var BPromise=require(_0x3607('0x4'));var rp=require(_0x3607('0x5'));var fs=require('fs');var path=require(_0x3607('0x6'));var rimraf=require('rimraf');var config=require(_0x3607('0x7'));var attributes=require('./reportAgentPreview.attributes');module[_0x3607('0x8')]=function(_0x4644e4,_0x348e43){return _0x4644e4[_0x3607('0x9')](_0x3607('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec2e=['bluebird','request-promise','path','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','moment'];(function(_0x26493a,_0x170da9){var _0x4b5c5b=function(_0x5938e0){while(--_0x5938e0){_0x26493a['push'](_0x26493a['shift']());}};_0x4b5c5b(++_0x170da9);}(_0xec2e,0x1bf));var _0xeec2=function(_0x1fb3ed,_0x88c234){_0x1fb3ed=_0x1fb3ed-0x0;var _0x5f33d5=_0xec2e[_0x1fb3ed];return _0x5f33d5;};'use strict';var _=require(_0xeec2('0x0'));var util=require('util');var logger=require(_0xeec2('0x1'))(_0xeec2('0x2'));var moment=require(_0xeec2('0x3'));var BPromise=require(_0xeec2('0x4'));var rp=require(_0xeec2('0x5'));var fs=require('fs');var path=require(_0xeec2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xeec2('0x7')]=function(_0x2685ec,_0xcd547f){return _0x2685ec[_0xeec2('0x8')](_0xeec2('0x9'),attributes,{'tableName':_0xeec2('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 c779009..ace2b44 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 _0x107e=['request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s'];(function(_0x168267,_0x4d121b){var _0xebdb65=function(_0x5dabce){while(--_0x5dabce){_0x168267['push'](_0x168267['shift']());}};_0xebdb65(++_0x4d121b);}(_0x107e,0x113));var _0xe107=function(_0x4f7a8d,_0x191f26){_0x4f7a8d=_0x4f7a8d-0x0;var _0x10b845=_0x107e[_0x4f7a8d];return _0x10b845;};'use strict';var _=require(_0xe107('0x0'));var util=require(_0xe107('0x1'));var moment=require(_0xe107('0x2'));var BPromise=require('bluebird');var rs=require(_0xe107('0x3'));var fs=require('fs');var Redis=require(_0xe107('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe107('0x5'));var logger=require(_0xe107('0x6'))(_0xe107('0x7'));var config=require(_0xe107('0x8'));var jayson=require(_0xe107('0x9'));var client=jayson[_0xe107('0xa')][_0xe107('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbe1c11,_0x38a34f,_0x317a39){return new BPromise(function(_0x3fe4c8,_0x10c3ab){return client[_0xe107('0xc')](_0xbe1c11,_0x317a39)[_0xe107('0xd')](function(_0x5c61a7){logger['info'](_0xe107('0xe'),_0x38a34f,_0xe107('0xf'));logger['debug'](_0xe107('0x10'),_0x38a34f,'request\x20sent',JSON[_0xe107('0x11')](_0x5c61a7));if(_0x5c61a7[_0xe107('0x12')]){if(_0x5c61a7[_0xe107('0x12')][_0xe107('0x13')]===0x1f4){logger[_0xe107('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x38a34f,_0x5c61a7['error']['message']);return _0x10c3ab(_0x5c61a7[_0xe107('0x12')][_0xe107('0x14')]);}logger[_0xe107('0x12')](_0xe107('0xe'),_0x38a34f,_0x5c61a7[_0xe107('0x12')][_0xe107('0x14')]);return _0x3fe4c8(_0x5c61a7[_0xe107('0x12')][_0xe107('0x14')]);}else{logger[_0xe107('0x15')]('ReportAgentPreview,\x20%s,\x20%s',_0x38a34f,_0xe107('0xf'));_0x3fe4c8(_0x5c61a7['result'][_0xe107('0x14')]);}})[_0xe107('0x16')](function(_0xbbee5a){logger[_0xe107('0x12')](_0xe107('0xe'),_0x38a34f,_0xbbee5a);_0x10c3ab(_0xbbee5a);});});}exports[_0xe107('0x17')]=function(_0x2a6d82){var _0x3ddc09=this;return new Promise(function(_0x31e0cb,_0x10ed42){return db[_0xe107('0x18')][_0xe107('0x19')](_0x2a6d82['body'],{'raw':_0x2a6d82[_0xe107('0x1a')]?_0x2a6d82[_0xe107('0x1a')][_0xe107('0x1b')]===undefined?!![]:![]:!![]})[_0xe107('0xd')](function(_0x1e1d19){logger[_0xe107('0x15')](_0xe107('0x17'),_0x2a6d82);logger[_0xe107('0x1c')](_0xe107('0x17'),_0x2a6d82,JSON[_0xe107('0x11')](_0x1e1d19));_0x31e0cb(_0x1e1d19);})[_0xe107('0x16')](function(_0x34434d){logger['error'](_0xe107('0x17'),_0x34434d[_0xe107('0x14')],_0x2a6d82);_0x10ed42(_0x3ddc09[_0xe107('0x12')](0x1f4,_0x34434d[_0xe107('0x14')]));});});}; \ No newline at end of file +var _0xc6dc=['ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ReportAgentPreview,\x20%s,\x20%s','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6dc,0x125));var _0xcc6d=function(_0x459af3,_0x3b9f76){_0x459af3=_0x459af3-0x0;var _0x443dfe=_0xc6dc[_0x459af3];return _0x443dfe;};'use strict';var _=require(_0xcc6d('0x0'));var util=require('util');var moment=require(_0xcc6d('0x1'));var BPromise=require(_0xcc6d('0x2'));var rs=require(_0xcc6d('0x3'));var fs=require('fs');var Redis=require(_0xcc6d('0x4'));var db=require(_0xcc6d('0x5'))['db'];var utils=require(_0xcc6d('0x6'));var logger=require(_0xcc6d('0x7'))(_0xcc6d('0x8'));var config=require(_0xcc6d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcc6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2683af,_0x3c8d7a,_0x1bd680){return new BPromise(function(_0x40e919,_0x240ab5){return client[_0xcc6d('0xb')](_0x2683af,_0x1bd680)[_0xcc6d('0xc')](function(_0x42def3){logger['info'](_0xcc6d('0xd'),_0x3c8d7a,'request\x20sent');logger[_0xcc6d('0xe')](_0xcc6d('0xf'),_0x3c8d7a,_0xcc6d('0x10'),JSON[_0xcc6d('0x11')](_0x42def3));if(_0x42def3[_0xcc6d('0x12')]){if(_0x42def3[_0xcc6d('0x12')]['code']===0x1f4){logger[_0xcc6d('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x3c8d7a,_0x42def3[_0xcc6d('0x12')]['message']);return _0x240ab5(_0x42def3[_0xcc6d('0x12')][_0xcc6d('0x13')]);}logger[_0xcc6d('0x12')](_0xcc6d('0xd'),_0x3c8d7a,_0x42def3[_0xcc6d('0x12')]['message']);return _0x40e919(_0x42def3[_0xcc6d('0x12')][_0xcc6d('0x13')]);}else{logger['info'](_0xcc6d('0xd'),_0x3c8d7a,_0xcc6d('0x10'));_0x40e919(_0x42def3[_0xcc6d('0x14')][_0xcc6d('0x13')]);}})[_0xcc6d('0x15')](function(_0x53cc20){logger[_0xcc6d('0x12')](_0xcc6d('0xd'),_0x3c8d7a,_0x53cc20);_0x240ab5(_0x53cc20);});});}exports['CreateReportAgentPreview']=function(_0x34de3f){var _0x20bfdd=this;return new Promise(function(_0xea4b89,_0x83e7ac){return db[_0xcc6d('0x16')][_0xcc6d('0x17')](_0x34de3f[_0xcc6d('0x18')],{'raw':_0x34de3f[_0xcc6d('0x19')]?_0x34de3f[_0xcc6d('0x19')][_0xcc6d('0x1a')]===undefined?!![]:![]:!![]})[_0xcc6d('0xc')](function(_0x6089d1){logger['info'](_0xcc6d('0x1b'),_0x34de3f);logger[_0xcc6d('0xe')](_0xcc6d('0x1b'),_0x34de3f,JSON[_0xcc6d('0x11')](_0x6089d1));_0xea4b89(_0x6089d1);})[_0xcc6d('0x15')](function(_0x184eb5){logger['error']('CreateReportAgentPreview',_0x184eb5[_0xcc6d('0x13')],_0x34de3f);_0x83e7ac(_0x20bfdd[_0xcc6d('0x12')](0x1f4,_0x184eb5['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index d62ca03..2ec672e 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 _0xa969=['queueNotify','chat','showChatQueues','fax','/fax/queues/:id','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','multer','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','/agents','agents','put','/agents/:id/capacity','/telephones','telephones','/trunks','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','/mail/queues/:id','showMailQueues'];(function(_0x54d9fd,_0x3d2f76){var _0x5370e1=function(_0x434561){while(--_0x434561){_0x54d9fd['push'](_0x54d9fd['shift']());}};_0x5370e1(++_0x3d2f76);}(_0xa969,0x16b));var _0x9a96=function(_0x55c485,_0x3fe77e){_0x55c485=_0x55c485-0x0;var _0x6bb521=_0xa969[_0x55c485];return _0x6bb521;};'use strict';var multer=require(_0x9a96('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express[_0x9a96('0x1')]();var auth=require(_0x9a96('0x2'));var controller=require(_0x9a96('0x3'));router[_0x9a96('0x4')]('/voice/channels',auth[_0x9a96('0x5')](),controller['voiceChannels']);router[_0x9a96('0x4')](_0x9a96('0x6'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x7')]);router['get'](_0x9a96('0x8'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x9')]);router[_0x9a96('0x4')](_0x9a96('0xa'),auth['isAuthenticated'](),controller[_0x9a96('0xb')]);router[_0x9a96('0x4')](_0x9a96('0xc'),auth[_0x9a96('0x5')](),controller[_0x9a96('0xd')]);router[_0x9a96('0x4')](_0x9a96('0xe'),auth[_0x9a96('0x5')](),controller['mailQueues']);router[_0x9a96('0x4')]('/mail/accounts',auth[_0x9a96('0x5')](),controller[_0x9a96('0xf')]);router['get'](_0x9a96('0x10'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x11')]);router[_0x9a96('0x4')]('/sms/queues',auth[_0x9a96('0x5')](),controller[_0x9a96('0x12')]);router[_0x9a96('0x4')](_0x9a96('0x13'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x14')]);router[_0x9a96('0x4')](_0x9a96('0x15'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x16')]);router[_0x9a96('0x4')](_0x9a96('0x17'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x18')]);router['get']('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x9a96('0x19')]);router['get'](_0x9a96('0x1a'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x1b')]);router[_0x9a96('0x4')](_0x9a96('0x1c'),auth['isAuthenticated'](),controller[_0x9a96('0x1d')]);router[_0x9a96('0x4')](_0x9a96('0x1e'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x1f')]);router['get'](_0x9a96('0x20'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x21')]);router[_0x9a96('0x4')](_0x9a96('0x22'),auth['isAuthenticated'](),controller['outboundChannels']);router['get'](_0x9a96('0x23'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x24')]);router[_0x9a96('0x25')](_0x9a96('0x26'),auth[_0x9a96('0x5')](),controller['agentCapacity']);router[_0x9a96('0x4')](_0x9a96('0x27'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x28')]);router[_0x9a96('0x4')](_0x9a96('0x29'),auth[_0x9a96('0x5')](),controller['trunks']);router[_0x9a96('0x4')]('/campaigns',auth[_0x9a96('0x5')](),controller['campaigns']);router['get'](_0x9a96('0x2a'),auth[_0x9a96('0x5')](),controller['faxAccounts']);router[_0x9a96('0x4')](_0x9a96('0x2b'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x2c')]);router[_0x9a96('0x4')](_0x9a96('0x2d'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x2e')]);router[_0x9a96('0x4')](_0x9a96('0x2f'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x30')]);router[_0x9a96('0x4')](_0x9a96('0x31'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x32')]);router[_0x9a96('0x4')](_0x9a96('0x33'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x34')]);router[_0x9a96('0x35')](_0x9a96('0x36'),auth[_0x9a96('0x5')](),controller['queueNotify']('mail'));router['get'](_0x9a96('0x37'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x38')]);router['post']('/chat/queues/:id/notify',auth[_0x9a96('0x5')](),controller[_0x9a96('0x39')](_0x9a96('0x3a')));router[_0x9a96('0x4')]('/chat/queues/:id',auth[_0x9a96('0x5')](),controller[_0x9a96('0x3b')]);router[_0x9a96('0x35')]('/fax/queues/:id/notify',auth[_0x9a96('0x5')](),controller['queueNotify'](_0x9a96('0x3c')));router[_0x9a96('0x4')](_0x9a96('0x3d'),auth[_0x9a96('0x5')](),controller['showFaxQueues']);router[_0x9a96('0x35')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x9a96('0x3e')));router[_0x9a96('0x4')](_0x9a96('0x3f'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x40')]);router[_0x9a96('0x35')](_0x9a96('0x41'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x39')]('sms'));router[_0x9a96('0x4')](_0x9a96('0x42'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x43')]);router[_0x9a96('0x35')](_0x9a96('0x44'),auth[_0x9a96('0x5')](),controller[_0x9a96('0x45')]);module['exports']=router; \ No newline at end of file +var _0x1e82=['/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','get','/voice/channels','voiceChannels'];(function(_0x35783b,_0x1be2fa){var _0x19e19b=function(_0x3fd261){while(--_0x3fd261){_0x35783b['push'](_0x35783b['shift']());}};_0x19e19b(++_0x1be2fa);}(_0x1e82,0x8b));var _0x21e8=function(_0x196156,_0x2454bb){_0x196156=_0x196156-0x0;var _0x403d26=_0x1e82[_0x196156];return _0x403d26;};'use strict';var multer=require(_0x21e8('0x0'));var util=require(_0x21e8('0x1'));var path=require(_0x21e8('0x2'));var express=require(_0x21e8('0x3'));var router=express[_0x21e8('0x4')]();var auth=require(_0x21e8('0x5'));var controller=require('./rpc.controller');router[_0x21e8('0x6')](_0x21e8('0x7'),auth['isAuthenticated'](),controller[_0x21e8('0x8')]);router['get'](_0x21e8('0x9'),auth[_0x21e8('0xa')](),controller[_0x21e8('0xb')]);router[_0x21e8('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x21e8('0xa')](),controller[_0x21e8('0xc')]);router[_0x21e8('0x6')]('/voice/queues',auth[_0x21e8('0xa')](),controller[_0x21e8('0xd')]);router[_0x21e8('0x6')](_0x21e8('0xe'),auth['isAuthenticated'](),controller['chatQueues']);router[_0x21e8('0x6')]('/mail/queues',auth[_0x21e8('0xa')](),controller[_0x21e8('0xf')]);router['get'](_0x21e8('0x10'),auth['isAuthenticated'](),controller[_0x21e8('0x11')]);router[_0x21e8('0x6')](_0x21e8('0x12'),auth['isAuthenticated'](),controller[_0x21e8('0x13')]);router['get'](_0x21e8('0x14'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x15')]);router['get']('/fax/queues',auth[_0x21e8('0xa')](),controller[_0x21e8('0x16')]);router[_0x21e8('0x6')](_0x21e8('0x17'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x18')]);router[_0x21e8('0x6')](_0x21e8('0x19'),auth[_0x21e8('0xa')](),controller['voiceQueuesChannels']);router[_0x21e8('0x6')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x21e8('0x1a')]);router[_0x21e8('0x6')](_0x21e8('0x1b'),auth[_0x21e8('0xa')](),controller['voiceQueuesChannelHangup']);router[_0x21e8('0x6')](_0x21e8('0x1c'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x1d')]);router[_0x21e8('0x6')](_0x21e8('0x1e'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x1f')]);router['get'](_0x21e8('0x20'),auth[_0x21e8('0xa')](),controller['outbound']);router[_0x21e8('0x6')](_0x21e8('0x21'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x22')]);router[_0x21e8('0x6')](_0x21e8('0x23'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x24')]);router['put'](_0x21e8('0x25'),auth['isAuthenticated'](),controller[_0x21e8('0x26')]);router[_0x21e8('0x6')](_0x21e8('0x27'),auth['isAuthenticated'](),controller[_0x21e8('0x28')]);router['get'](_0x21e8('0x29'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x2a')]);router['get'](_0x21e8('0x2b'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x2c')]);router['get'](_0x21e8('0x2d'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x2e')]);router[_0x21e8('0x6')](_0x21e8('0x2f'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x30')]);router[_0x21e8('0x6')](_0x21e8('0x31'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x32')]);router[_0x21e8('0x6')]('/openchannel/queues/waitinginteractions',auth[_0x21e8('0xa')](),controller[_0x21e8('0x33')]);router['get']('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x21e8('0x34')]);router['get'](_0x21e8('0x35'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x36')]);router[_0x21e8('0x37')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0x21e8('0x38')]('mail'));router[_0x21e8('0x6')](_0x21e8('0x39'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x3a')]);router['post'](_0x21e8('0x3b'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x38')](_0x21e8('0x3c')));router[_0x21e8('0x6')]('/chat/queues/:id',auth[_0x21e8('0xa')](),controller[_0x21e8('0x3d')]);router[_0x21e8('0x37')](_0x21e8('0x3e'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x38')](_0x21e8('0x3f')));router[_0x21e8('0x6')](_0x21e8('0x40'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x41')]);router[_0x21e8('0x37')](_0x21e8('0x42'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x38')]('openchannel'));router[_0x21e8('0x6')](_0x21e8('0x43'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x44')]);router[_0x21e8('0x37')](_0x21e8('0x45'),auth[_0x21e8('0xa')](),controller[_0x21e8('0x38')](_0x21e8('0x46')));router[_0x21e8('0x6')]('/sms/queues/:id',auth[_0x21e8('0xa')](),controller['showSmsQueues']);router[_0x21e8('0x37')](_0x21e8('0x47'),auth['isAuthenticated'](),controller[_0x21e8('0x48')]);module[_0x21e8('0x49')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 39487a2..e6440e8 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 _0x2bf1=['capacity','Telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','User','bluebird','moment','lodash','util','../../config/logger','api','client','http','code','error','message','result','catch','sendStatus','stack','name','send','isNil','rows','voiceChannels','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','query','params','voiceQueues','VoiceQueues','showVoiceQueues','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','SIP/%s','interface','agent','internal','AgentCapacity'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2bf1,0xa6));var _0x12bf=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x2bf1[_0x4baae2];return _0x1a2285;};'use strict';var BPromise=require(_0x12bf('0x0'));var moment=require(_0x12bf('0x1'));var _=require(_0x12bf('0x2'));var util=require(_0x12bf('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x12bf('0x4'))(_0x12bf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x12bf('0x6')][_0x12bf('0x7')]({'port':0x232a});var mailClient=jayson[_0x12bf('0x6')][_0x12bf('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0x12bf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x445500,_0x4e27c3,_0x41477c){return new BPromise(function(_0x31e7dc,_0x4f5625){var _0x50fb0f=_0x41477c?_0x41477c:amiClient;return _0x50fb0f['request'](_0x445500,_0x4e27c3)['then'](function(_0xd7097c){if(_0xd7097c['error']){if(_0xd7097c['error'][_0x12bf('0x8')]===0x1f4){return _0x4f5625(_0xd7097c[_0x12bf('0x9')]['message']);}return _0x31e7dc(_0xd7097c[_0x12bf('0x9')][_0x12bf('0xa')]);}else{_0x31e7dc(_0xd7097c[_0x12bf('0xb')]);}})[_0x12bf('0xc')](function(_0x2553c6){_0x4f5625(_0x2553c6);});});}function respondWithResult(_0x2f4fc0,_0x236aa4){_0x236aa4=_0x236aa4||0xc8;return function(_0x4a880a){if(_0x4a880a){return _0x2f4fc0['status'](_0x236aa4)['json'](_0x4a880a);}return _0x2f4fc0[_0x12bf('0xd')](0x194);};}function handleError(_0x1c231c,_0x3bb233){_0x3bb233=_0x3bb233||0x1f4;return function(_0x265c37){logger[_0x12bf('0x9')](_0x265c37[_0x12bf('0xe')]);if(_0x265c37[_0x12bf('0xf')]){delete _0x265c37['name'];}_0x1c231c['status'](_0x3bb233)[_0x12bf('0x10')](_0x265c37);};}function findById(_0x1daa4c){return function(_0x118514){if(!_[_0x12bf('0x11')](_0x1daa4c)&&!_[_0x12bf('0x11')](_0x118514)&&!_[_0x12bf('0x11')](_0x118514[_0x12bf('0x12')])){return _['find'](_0x118514[_0x12bf('0x12')],function(_0x4e7e60){return _0x4e7e60['id']==_0x1daa4c;});}return null;};}exports[_0x12bf('0x13')]=function(_0x44853d,_0x134805){return respondWithRpcPromise('VoiceChannels',_0x44853d['query'])[_0x12bf('0x14')](respondWithResult(_0x134805,null))[_0x12bf('0xc')](handleError(_0x134805,null));};exports[_0x12bf('0x15')]=function(_0x587a65,_0x24d520){return respondWithRpcPromise(_0x12bf('0x16'),_[_0x12bf('0x17')](_0x587a65['query'],_0x587a65['params']))['then'](respondWithResult(_0x24d520,null))[_0x12bf('0xc')](handleError(_0x24d520,null));};exports[_0x12bf('0x18')]=function(_0x1e4008,_0x40d002){return respondWithRpcPromise(_0x12bf('0x19'),_[_0x12bf('0x17')](_0x1e4008[_0x12bf('0x1a')],_0x1e4008[_0x12bf('0x1b')]))[_0x12bf('0x14')](respondWithResult(_0x40d002,null))['catch'](handleError(_0x40d002,null));};exports[_0x12bf('0x1c')]=function(_0x2323a9,_0x1e2669){return respondWithRpcPromise(_0x12bf('0x1d'),_0x2323a9['query'])[_0x12bf('0x14')](respondWithResult(_0x1e2669,null))[_0x12bf('0xc')](handleError(_0x1e2669,null));};exports[_0x12bf('0x1e')]=function(_0xbaafff,_0x2345ba){return respondWithRpcPromise(_0x12bf('0x1d'),_0xbaafff[_0x12bf('0x1a')])['then'](findById(_0xbaafff[_0x12bf('0x1b')]['id']))[_0x12bf('0x14')](respondWithResult(_0x2345ba,null))[_0x12bf('0xc')](handleError(_0x2345ba,null));};exports['voiceQueuesPreview']=function(_0x5cab4c,_0xd450bf){return respondWithRpcPromise(_0x12bf('0x1f'),_[_0x12bf('0x17')](_0x5cab4c[_0x12bf('0x1a')],_0x5cab4c[_0x12bf('0x1b')]))[_0x12bf('0x14')](respondWithResult(_0xd450bf,null))['catch'](handleError(_0xd450bf,null));};exports[_0x12bf('0x20')]=function(_0x1b7a02,_0x46f6f1){return respondWithRpcPromise(_0x12bf('0x21'),_0x1b7a02['query'])[_0x12bf('0x14')](respondWithResult(_0x46f6f1,null))['catch'](handleError(_0x46f6f1,null));};exports[_0x12bf('0x22')]=function(_0x2e1253,_0x1acf8b){return respondWithRpcPromise(_0x12bf('0x23'),_[_0x12bf('0x17')](_0x2e1253[_0x12bf('0x1a')],_0x2e1253['params']))[_0x12bf('0x14')](respondWithResult(_0x1acf8b,null))[_0x12bf('0xc')](handleError(_0x1acf8b,null));};exports['voiceQueuesChannelHangup']=function(_0x111a1e,_0x18aa77){return respondWithRpcPromise(_0x12bf('0x24'),_['merge'](_0x111a1e[_0x12bf('0x1a')],_0x111a1e[_0x12bf('0x1b')]))[_0x12bf('0x14')](respondWithResult(_0x18aa77,null))[_0x12bf('0xc')](handleError(_0x18aa77,null));};exports[_0x12bf('0x25')]=function(_0x32b0b4,_0x3ec440){return respondWithRpcPromise(_0x12bf('0x26'),_[_0x12bf('0x17')](_0x32b0b4[_0x12bf('0x1a')],_0x32b0b4[_0x12bf('0x1b')]))[_0x12bf('0x14')](respondWithResult(_0x3ec440,null))[_0x12bf('0xc')](handleError(_0x3ec440,null));};exports['outbound']=function(_0x545618,_0x249859){return respondWithRpcPromise(_0x12bf('0x27'),_0x545618[_0x12bf('0x1a')])[_0x12bf('0x14')](respondWithResult(_0x249859,null))[_0x12bf('0xc')](handleError(_0x249859,null));};exports[_0x12bf('0x28')]=function(_0x463dd4,_0x450e84){return respondWithRpcPromise(_0x12bf('0x29'),_0x463dd4[_0x12bf('0x1a')])[_0x12bf('0x14')](respondWithResult(_0x450e84,null))[_0x12bf('0xc')](handleError(_0x450e84,null));};exports[_0x12bf('0x2a')]=function(_0x2ff06e,_0xf266c0){var _0x46bd56;return respondWithRpcPromise(_0x12bf('0x2b'),_0x2ff06e[_0x12bf('0x1a')])[_0x12bf('0x14')](function(_0x513a41){_0x46bd56=_0x513a41;return respondWithRpcPromise(_0x12bf('0x2b'),_0x2ff06e[_0x12bf('0x1a')],routingClient);})[_0x12bf('0x14')](function(_0xfa72f8){return _[_0x12bf('0x17')]({},_0xfa72f8,_0x46bd56);})[_0x12bf('0x14')](respondWithResult(_0xf266c0,null))[_0x12bf('0xc')](handleError(_0xf266c0,null));};exports[_0x12bf('0x2c')]=function(_0x38f0d3,_0xe8faeb){if(_0x38f0d3[_0x12bf('0x2d')]&&_0x38f0d3[_0x12bf('0x2d')][_0x12bf('0x2e')]&&_0x38f0d3[_0x12bf('0x2f')]&&_0x38f0d3['user'][_0x12bf('0xf')]){for(var _0x5c1fc0 in _0x38f0d3['body']['interaction']){if(_0x38f0d3[_0x12bf('0x2d')][_0x12bf('0x2e')]['hasOwnProperty'](_0x5c1fc0)){db[_0x12bf('0x30')]['findAll']({'where':{'channel':_0x5c1fc0,'membername':_0x38f0d3[_0x12bf('0x2f')][_0x12bf('0xf')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x38f0d3[_0x12bf('0x2d')][_0x12bf('0x2e')][_0x5c1fc0]&&_0x38f0d3[_0x12bf('0x2d')][_0x12bf('0x2e')][_0x5c1fc0][_0x12bf('0x31')]?{'$notIn':_0x38f0d3[_0x12bf('0x2d')][_0x12bf('0x2e')][_0x5c1fc0]}:{'$ne':null}}})[_0x12bf('0x14')](function(_0x3f4d05){var _0x19eed2=moment()[_0x12bf('0x32')](_0x12bf('0x33'));for(var _0x3aa7ab=0x0,_0x5cc048=_0x3f4d05[_0x12bf('0x31')];_0x3aa7ab<_0x5cc048;_0x3aa7ab+=0x1){_0x3f4d05[_0x3aa7ab][_0x12bf('0x34')]({'exitAt':_0x19eed2});}});for(var _0x2e98c1=0x0;_0x2e98c1<_0x38f0d3['body'][_0x12bf('0x2e')][_0x5c1fc0][_0x12bf('0x31')];_0x2e98c1+=0x1){db[_0x12bf('0x30')][_0x12bf('0x35')]({'where':{'channel':_0x5c1fc0,'membername':_0x38f0d3['user'][_0x12bf('0xf')],'type':_0x12bf('0x36'),'uniqueid':_0x38f0d3[_0x12bf('0x2d')][_0x12bf('0x2e')][_0x5c1fc0][_0x2e98c1],'exitAt':null},'defaults':{'channel':_0x5c1fc0,'membername':_0x38f0d3['user']['name'],'interface':_[_0x12bf('0x11')](_0x38f0d3[_0x12bf('0x2f')]['interface'])?util[_0x12bf('0x32')](_0x12bf('0x37'),_0x38f0d3[_0x12bf('0x2f')][_0x12bf('0xf')]):_0x38f0d3['user'][_0x12bf('0x38')],'type':_0x12bf('0x36'),'enterAt':moment()['format'](_0x12bf('0x33')),'role':_0x12bf('0x39'),'internal':_0x38f0d3[_0x12bf('0x2f')][_0x12bf('0x3a')],'uniqueid':_0x38f0d3[_0x12bf('0x2d')][_0x12bf('0x2e')][_0x5c1fc0][_0x2e98c1]}});}}}}return respondWithRpcPromise(_0x12bf('0x3b'),{'id':_0x38f0d3[_0x12bf('0x1b')]['id'],'capacity':_0x38f0d3[_0x12bf('0x2d')][_0x12bf('0x3c')]},routingClient)['then'](respondWithResult(_0xe8faeb,null))[_0x12bf('0xc')](handleError(_0xe8faeb,null));};exports['telephones']=function(_0x4a750d,_0xa1e4ae){return respondWithRpcPromise(_0x12bf('0x3d'),_0x4a750d[_0x12bf('0x1a')])[_0x12bf('0x14')](respondWithResult(_0xa1e4ae,null))[_0x12bf('0xc')](handleError(_0xa1e4ae,null));};exports['trunks']=function(_0x3e6f69,_0xfa8cdf){return respondWithRpcPromise(_0x12bf('0x3e'),_0x3e6f69['query'])['then'](respondWithResult(_0xfa8cdf,null))[_0x12bf('0xc')](handleError(_0xfa8cdf,null));};exports[_0x12bf('0x3f')]=function(_0x23743a,_0x3aaa06){return respondWithRpcPromise(_0x12bf('0x40'),_0x23743a['query'])['then'](respondWithResult(_0x3aaa06,null))[_0x12bf('0xc')](handleError(_0x3aaa06,null));};exports[_0x12bf('0x41')]=function(_0x5d2205,_0x9b68db){return respondWithRpcPromise(_0x12bf('0x42'),_0x5d2205[_0x12bf('0x1a')],routingClient)[_0x12bf('0x14')](respondWithResult(_0x9b68db,null))[_0x12bf('0xc')](handleError(_0x9b68db,null));};exports[_0x12bf('0x43')]=function(_0x10c596,_0x233b41){return respondWithRpcPromise('ChatQueues',_0x10c596[_0x12bf('0x1a')],routingClient)[_0x12bf('0x14')](findById(_0x10c596[_0x12bf('0x1b')]['id']))[_0x12bf('0x14')](respondWithResult(_0x233b41,null))['catch'](handleError(_0x233b41,null));};exports[_0x12bf('0x44')]=function(_0x1a13a3,_0xdbcd37){return respondWithRpcPromise('MailQueues',_0x1a13a3[_0x12bf('0x1a')],routingClient)[_0x12bf('0x14')](respondWithResult(_0xdbcd37,null))[_0x12bf('0xc')](handleError(_0xdbcd37,null));};exports['showMailQueues']=function(_0x25dacf,_0x29206d){return respondWithRpcPromise(_0x12bf('0x45'),_0x25dacf['query'],routingClient)[_0x12bf('0x14')](findById(_0x25dacf['params']['id']))['then'](respondWithResult(_0x29206d,null))['catch'](handleError(_0x29206d,null));};exports[_0x12bf('0x46')]=function(_0x3b5680,_0xde5f81){return respondWithRpcPromise('MailAccounts',_0x3b5680[_0x12bf('0x1a')],mailClient)[_0x12bf('0x14')](respondWithResult(_0xde5f81,null))['catch'](handleError(_0xde5f81,null));};exports[_0x12bf('0x47')]=function(_0x6764df,_0x3a1fc8){return respondWithRpcPromise(_0x12bf('0x48'),_0x6764df[_0x12bf('0x1a')],routingClient)[_0x12bf('0x14')](respondWithResult(_0x3a1fc8,null))['catch'](handleError(_0x3a1fc8,null));};exports[_0x12bf('0x49')]=function(_0x58476c,_0x54e288){return respondWithRpcPromise('OpenchannelQueues',_0x58476c[_0x12bf('0x1a')],routingClient)[_0x12bf('0x14')](findById(_0x58476c[_0x12bf('0x1b')]['id']))[_0x12bf('0x14')](respondWithResult(_0x54e288,null))['catch'](handleError(_0x54e288,null));};exports['smsQueues']=function(_0x56263e,_0x45b345){return respondWithRpcPromise(_0x12bf('0x4a'),_0x56263e[_0x12bf('0x1a')],routingClient)[_0x12bf('0x14')](respondWithResult(_0x45b345,null))['catch'](handleError(_0x45b345,null));};exports['showSmsQueues']=function(_0x27756e,_0x4d9ce3){return respondWithRpcPromise(_0x12bf('0x4a'),_0x27756e[_0x12bf('0x1a')],routingClient)[_0x12bf('0x14')](findById(_0x27756e[_0x12bf('0x1b')]['id']))[_0x12bf('0x14')](respondWithResult(_0x4d9ce3,null))[_0x12bf('0xc')](handleError(_0x4d9ce3,null));};exports[_0x12bf('0x4b')]=function(_0x1c2d7a,_0x336acb){return respondWithRpcPromise(_0x12bf('0x4c'),_0x1c2d7a[_0x12bf('0x1a')],routingClient)[_0x12bf('0x14')](respondWithResult(_0x336acb,null))[_0x12bf('0xc')](handleError(_0x336acb,null));};exports[_0x12bf('0x4d')]=function(_0x3e585e,_0x2df56e){return respondWithRpcPromise(_0x12bf('0x4c'),_0x3e585e[_0x12bf('0x1a')],routingClient)[_0x12bf('0x14')](findById(_0x3e585e[_0x12bf('0x1b')]['id']))[_0x12bf('0x14')](respondWithResult(_0x2df56e,null))['catch'](handleError(_0x2df56e,null));};exports[_0x12bf('0x4e')]=function(_0x47c9b4,_0x5aeb6c){return respondWithRpcPromise(_0x12bf('0x4f'),_0x47c9b4[_0x12bf('0x1a')])[_0x12bf('0x14')](respondWithResult(_0x5aeb6c,null))[_0x12bf('0xc')](handleError(_0x5aeb6c,null));};exports[_0x12bf('0x50')]=function(_0x1dbb61,_0x132ec1){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x1dbb61[_0x12bf('0x1a')],routingClient)['then'](respondWithResult(_0x132ec1,null))[_0x12bf('0xc')](handleError(_0x132ec1,null));};exports[_0x12bf('0x51')]=function(_0x3cb9aa,_0x2925c6){return respondWithRpcPromise(_0x12bf('0x52'),_0x3cb9aa['query'],routingClient)[_0x12bf('0x14')](respondWithResult(_0x2925c6,null))['catch'](handleError(_0x2925c6,null));};exports[_0x12bf('0x53')]=function(_0x481afb,_0x22f5a9){return respondWithRpcPromise(_0x12bf('0x54'),_0x481afb[_0x12bf('0x1a')],routingClient)['then'](respondWithResult(_0x22f5a9,null))[_0x12bf('0xc')](handleError(_0x22f5a9,null));};exports[_0x12bf('0x55')]=function(_0x42f025,_0x3844df){return respondWithRpcPromise(_0x12bf('0x56'),_0x42f025[_0x12bf('0x1a')],routingClient)[_0x12bf('0x14')](respondWithResult(_0x3844df,null))[_0x12bf('0xc')](handleError(_0x3844df,null));};exports['faxQueuesWaitingInteractions']=function(_0x6fa4d,_0x1fad08){return respondWithRpcPromise(_0x12bf('0x57'),_0x6fa4d[_0x12bf('0x1a')],routingClient)[_0x12bf('0x14')](respondWithResult(_0x1fad08,null))[_0x12bf('0xc')](handleError(_0x1fad08,null));};exports[_0x12bf('0x58')]=function(_0x551923){return function(_0x409ac3,_0x32da66){var _0x104fae,_0x260d33;var _0x4effef=_['capitalize'](_0x551923);var _0x593cf5=_0x551923===_0x12bf('0x59')?_0x12bf('0x5a'):_0x12bf('0x5b');return db[_0x4effef+_0x12bf('0x5c')][_0x12bf('0x5d')]({'raw':!![],'where':{'id':_0x409ac3['params']['id']}})[_0x12bf('0x14')](function(_0x3cd502){if(_[_0x12bf('0x11')](_0x3cd502)){throw new Error(_0x4effef+_0x12bf('0x5e'));}_0x104fae=_0x3cd502;return db[_0x4effef+_0x12bf('0x5f')][_0x12bf('0x5d')]({'where':{'id':_0x409ac3[_0x12bf('0x2d')][_0x12bf('0x60')]},'include':[{'model':db[_0x4effef+'Interaction'],'as':_0x12bf('0x61')},{'model':db[_0x4effef+_0x593cf5],'as':_0x12bf('0x5b')}]});})[_0x12bf('0x14')](function(_0xf46e30){if(_[_0x12bf('0x11')](_0xf46e30)){throw new Error(_0x4effef+_0x12bf('0x62'));}_0x260d33=_0xf46e30;return _0xf46e30[_0x12bf('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x12bf('0x14')](function(){var _0xfeb214={'uniqueid':_0x551923+'.'+_0x260d33['id']+'.'+_0x260d33[_0x12bf('0x61')]['id'],'FromUserId':_0x409ac3[_0x12bf('0x2f')]['id'],'type':_0x12bf('0x64')};_0xfeb214[_0x4effef+_0x12bf('0x65')]=_0x260d33['id'];_0xfeb214[_0x4effef+_0x12bf('0x66')]=_0x260d33[_0x12bf('0x61')]['id'];_0xfeb214['From'+_0x4effef+_0x593cf5+'Id']=_0x260d33[_0x12bf('0x5b')]['id'];_0xfeb214['To'+_0x4effef+_0x12bf('0x67')]=_0x104fae['id'];return db[_0x4effef+_0x12bf('0x68')][_0x12bf('0x69')](_0xfeb214);})[_0x12bf('0x14')](function(){return respondWithRpcPromise('Start',{'channel':_0x551923,'interaction':_0x260d33['Interaction'],'message':_0x260d33,'account':_0x260d33[_0x12bf('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x12bf('0x64'),'appdata':_0x104fae[_0x12bf('0xf')]+','+(_0x260d33[_0x12bf('0x5b')][_0x12bf('0x6a')]||0x12c),'interval':_0x12bf('0x6b')}]},routingClient);})[_0x12bf('0x14')](respondWithResult(_0x32da66,null))[_0x12bf('0xc')](handleError(_0x32da66,null));};};exports[_0x12bf('0x6c')]=function(_0x35587e,_0x1d98b3){var _0x56fa5b,_0x422c1c;if(_[_0x12bf('0x11')](_0x35587e[_0x12bf('0x2d')][_0x12bf('0x6d')])){throw new Error(_0x12bf('0x6e'));}var _0x22a5cd=_0x35587e[_0x12bf('0x2d')][_0x12bf('0x6d')];var _0x4ada74=_[_0x12bf('0x6f')](_0x22a5cd);var _0x7e68da=_0x22a5cd===_0x12bf('0x59')?_0x12bf('0x5a'):_0x12bf('0x5b');return db[_0x12bf('0x70')]['findOne']({'raw':!![],'where':{'id':_0x35587e[_0x12bf('0x1b')]['id'],'role':_0x12bf('0x39')}})[_0x12bf('0x14')](function(_0x1c6363){if(_['isNil'](_0x1c6363)){throw new Error('Agent\x20not\x20found');}_0x56fa5b=_0x1c6363;return db[_0x4ada74+_0x12bf('0x5f')][_0x12bf('0x5d')]({'where':{'id':_0x35587e[_0x12bf('0x2d')][_0x12bf('0x60')]},'include':[{'model':db[_0x4ada74+_0x12bf('0x61')],'as':'Interaction'},{'model':db[_0x4ada74+_0x7e68da],'as':'Account'}]});})['then'](function(_0xbe400a){if(_[_0x12bf('0x11')](_0xbe400a)){throw new Error(_0x4ada74+_0x12bf('0x62'));}_0x422c1c=_0xbe400a;return _0xbe400a[_0x12bf('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x12bf('0x14')](function(){var _0x3e35cf={'uniqueid':_0x22a5cd+'.'+_0x422c1c['id']+'.'+_0x422c1c[_0x12bf('0x61')]['id'],'FromUserId':_0x35587e['user']['id'],'type':_0x12bf('0x64'),'ToUserId':_0x56fa5b['id']};_0x3e35cf[_0x4ada74+_0x12bf('0x65')]=_0x422c1c['id'];_0x3e35cf[_0x4ada74+_0x12bf('0x66')]=_0x422c1c[_0x12bf('0x61')]['id'];_0x3e35cf['From'+_0x4ada74+_0x7e68da+'Id']=_0x422c1c[_0x12bf('0x5b')]['id'];return db[_0x4ada74+_0x12bf('0x68')]['create'](_0x3e35cf);})[_0x12bf('0x14')](function(){return respondWithRpcPromise('Start',{'channel':_0x22a5cd,'interaction':_0x422c1c[_0x12bf('0x61')],'message':_0x422c1c,'account':_0x422c1c[_0x12bf('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x12bf('0x39'),'appdata':_0x56fa5b[_0x12bf('0xf')]+','+(_0x422c1c['Account']['agentTransferTimeout']||0x12c),'interval':_0x12bf('0x6b')}]},routingClient);})[_0x12bf('0x14')](respondWithResult(_0x1d98b3,null))['catch'](handleError(_0x1d98b3,null));}; \ No newline at end of file +var _0x9c61=['AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','create','Start','Account','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','Agent\x20not\x20found','TransferReport','*,*,*,*','bluebird','moment','lodash','../../config/logger','http','client','request','then','error','code','message','result','json','sendStatus','name','status','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','params','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','user','interaction','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','INTERACTION','SIP/%s','interface','agent','internal'];(function(_0x2ee8be,_0x55b2e6){var _0x3dd2bf=function(_0x516a63){while(--_0x516a63){_0x2ee8be['push'](_0x2ee8be['shift']());}};_0x3dd2bf(++_0x55b2e6);}(_0x9c61,0x17d));var _0x19c6=function(_0x3337b6,_0x42c7f9){_0x3337b6=_0x3337b6-0x0;var _0x568270=_0x9c61[_0x3337b6];return _0x568270;};'use strict';var BPromise=require(_0x19c6('0x0'));var moment=require(_0x19c6('0x1'));var _=require(_0x19c6('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x19c6('0x3'))('api');var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x19c6('0x4')]({'port':0x232a});var mailClient=jayson[_0x19c6('0x5')][_0x19c6('0x4')]({'port':0x232b});var routingClient=jayson[_0x19c6('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0xc179b4,_0x2bbf18,_0x2a647b){return new BPromise(function(_0x183c28,_0x413bc2){var _0x4455f6=_0x2a647b?_0x2a647b:amiClient;return _0x4455f6[_0x19c6('0x6')](_0xc179b4,_0x2bbf18)[_0x19c6('0x7')](function(_0x321404){if(_0x321404['error']){if(_0x321404[_0x19c6('0x8')][_0x19c6('0x9')]===0x1f4){return _0x413bc2(_0x321404[_0x19c6('0x8')][_0x19c6('0xa')]);}return _0x183c28(_0x321404[_0x19c6('0x8')]['message']);}else{_0x183c28(_0x321404[_0x19c6('0xb')]);}})['catch'](function(_0x2c135a){_0x413bc2(_0x2c135a);});});}function respondWithResult(_0x29850f,_0x3ea35f){_0x3ea35f=_0x3ea35f||0xc8;return function(_0x54ab14){if(_0x54ab14){return _0x29850f['status'](_0x3ea35f)[_0x19c6('0xc')](_0x54ab14);}return _0x29850f[_0x19c6('0xd')](0x194);};}function handleError(_0x2d9b88,_0x33b335){_0x33b335=_0x33b335||0x1f4;return function(_0x2dd822){logger[_0x19c6('0x8')](_0x2dd822['stack']);if(_0x2dd822[_0x19c6('0xe')]){delete _0x2dd822['name'];}_0x2d9b88[_0x19c6('0xf')](_0x33b335)['send'](_0x2dd822);};}function findById(_0x387251){return function(_0x5cbe04){if(!_[_0x19c6('0x10')](_0x387251)&&!_[_0x19c6('0x10')](_0x5cbe04)&&!_[_0x19c6('0x10')](_0x5cbe04[_0x19c6('0x11')])){return _[_0x19c6('0x12')](_0x5cbe04['rows'],function(_0x142773){return _0x142773['id']==_0x387251;});}return null;};}exports[_0x19c6('0x13')]=function(_0x26f48d,_0x338891){return respondWithRpcPromise(_0x19c6('0x14'),_0x26f48d[_0x19c6('0x15')])[_0x19c6('0x7')](respondWithResult(_0x338891,null))['catch'](handleError(_0x338891,null));};exports[_0x19c6('0x16')]=function(_0x5822ed,_0x4f4ee1){return respondWithRpcPromise('VoiceChannelMixMonitor',_['merge'](_0x5822ed['query'],_0x5822ed[_0x19c6('0x17')]))[_0x19c6('0x7')](respondWithResult(_0x4f4ee1,null))[_0x19c6('0x18')](handleError(_0x4f4ee1,null));};exports[_0x19c6('0x19')]=function(_0x2a563c,_0xdb76f2){return respondWithRpcPromise(_0x19c6('0x1a'),_[_0x19c6('0x1b')](_0x2a563c[_0x19c6('0x15')],_0x2a563c[_0x19c6('0x17')]))[_0x19c6('0x7')](respondWithResult(_0xdb76f2,null))[_0x19c6('0x18')](handleError(_0xdb76f2,null));};exports['voiceQueues']=function(_0x5cb2b1,_0x3f1318){return respondWithRpcPromise(_0x19c6('0x1c'),_0x5cb2b1[_0x19c6('0x15')])[_0x19c6('0x7')](respondWithResult(_0x3f1318,null))['catch'](handleError(_0x3f1318,null));};exports['showVoiceQueues']=function(_0x23c9f6,_0x2350cd){return respondWithRpcPromise(_0x19c6('0x1c'),_0x23c9f6[_0x19c6('0x15')])[_0x19c6('0x7')](findById(_0x23c9f6[_0x19c6('0x17')]['id']))[_0x19c6('0x7')](respondWithResult(_0x2350cd,null))[_0x19c6('0x18')](handleError(_0x2350cd,null));};exports[_0x19c6('0x1d')]=function(_0x584ee2,_0x1d0667){return respondWithRpcPromise(_0x19c6('0x1e'),_[_0x19c6('0x1b')](_0x584ee2[_0x19c6('0x15')],_0x584ee2[_0x19c6('0x17')]))[_0x19c6('0x7')](respondWithResult(_0x1d0667,null))['catch'](handleError(_0x1d0667,null));};exports[_0x19c6('0x1f')]=function(_0x41bb7e,_0x5a7454){return respondWithRpcPromise(_0x19c6('0x20'),_0x41bb7e[_0x19c6('0x15')])[_0x19c6('0x7')](respondWithResult(_0x5a7454,null))['catch'](handleError(_0x5a7454,null));};exports[_0x19c6('0x21')]=function(_0x1c1b3d,_0x2444c1){return respondWithRpcPromise(_0x19c6('0x22'),_[_0x19c6('0x1b')](_0x1c1b3d[_0x19c6('0x15')],_0x1c1b3d[_0x19c6('0x17')]))[_0x19c6('0x7')](respondWithResult(_0x2444c1,null))['catch'](handleError(_0x2444c1,null));};exports[_0x19c6('0x23')]=function(_0x55452b,_0x3e4fb8){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x19c6('0x1b')](_0x55452b[_0x19c6('0x15')],_0x55452b[_0x19c6('0x17')]))['then'](respondWithResult(_0x3e4fb8,null))[_0x19c6('0x18')](handleError(_0x3e4fb8,null));};exports[_0x19c6('0x24')]=function(_0x93bccf,_0x5686ad){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0x93bccf[_0x19c6('0x15')],_0x93bccf[_0x19c6('0x17')]))[_0x19c6('0x7')](respondWithResult(_0x5686ad,null))[_0x19c6('0x18')](handleError(_0x5686ad,null));};exports['outbound']=function(_0x4d0f3f,_0x3dbb8f){return respondWithRpcPromise(_0x19c6('0x25'),_0x4d0f3f[_0x19c6('0x15')])[_0x19c6('0x7')](respondWithResult(_0x3dbb8f,null))[_0x19c6('0x18')](handleError(_0x3dbb8f,null));};exports[_0x19c6('0x26')]=function(_0x38574d,_0x585e16){return respondWithRpcPromise(_0x19c6('0x27'),_0x38574d[_0x19c6('0x15')])['then'](respondWithResult(_0x585e16,null))[_0x19c6('0x18')](handleError(_0x585e16,null));};exports[_0x19c6('0x28')]=function(_0x31c31d,_0x42afa4){var _0x57ecff;return respondWithRpcPromise(_0x19c6('0x29'),_0x31c31d['query'])['then'](function(_0x51e6ea){_0x57ecff=_0x51e6ea;return respondWithRpcPromise(_0x19c6('0x29'),_0x31c31d[_0x19c6('0x15')],routingClient);})[_0x19c6('0x7')](function(_0x21407e){return _[_0x19c6('0x1b')]({},_0x21407e,_0x57ecff);})['then'](respondWithResult(_0x42afa4,null))[_0x19c6('0x18')](handleError(_0x42afa4,null));};exports['agentCapacity']=function(_0x4207ba,_0x50f117){if(_0x4207ba[_0x19c6('0x2a')]&&_0x4207ba[_0x19c6('0x2a')]['interaction']&&_0x4207ba[_0x19c6('0x2b')]&&_0x4207ba[_0x19c6('0x2b')]['name']){for(var _0x27b771 in _0x4207ba[_0x19c6('0x2a')][_0x19c6('0x2c')]){if(_0x4207ba[_0x19c6('0x2a')]['interaction']['hasOwnProperty'](_0x27b771)){db['MemberReport']['findAll']({'where':{'channel':_0x27b771,'membername':_0x4207ba[_0x19c6('0x2b')][_0x19c6('0xe')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4207ba[_0x19c6('0x2a')]['interaction'][_0x27b771]&&_0x4207ba[_0x19c6('0x2a')][_0x19c6('0x2c')][_0x27b771]['length']?{'$notIn':_0x4207ba['body'][_0x19c6('0x2c')][_0x27b771]}:{'$ne':null}}})[_0x19c6('0x7')](function(_0x33b4b1){var _0x45619f=moment()[_0x19c6('0x2d')](_0x19c6('0x2e'));for(var _0x4f6bfd=0x0,_0x5823cf=_0x33b4b1[_0x19c6('0x2f')];_0x4f6bfd<_0x5823cf;_0x4f6bfd+=0x1){_0x33b4b1[_0x4f6bfd][_0x19c6('0x30')]({'exitAt':_0x45619f});}});for(var _0x4dbb91=0x0;_0x4dbb91<_0x4207ba[_0x19c6('0x2a')][_0x19c6('0x2c')][_0x27b771][_0x19c6('0x2f')];_0x4dbb91+=0x1){db['MemberReport'][_0x19c6('0x31')]({'where':{'channel':_0x27b771,'membername':_0x4207ba[_0x19c6('0x2b')][_0x19c6('0xe')],'type':_0x19c6('0x32'),'uniqueid':_0x4207ba[_0x19c6('0x2a')]['interaction'][_0x27b771][_0x4dbb91],'exitAt':null},'defaults':{'channel':_0x27b771,'membername':_0x4207ba[_0x19c6('0x2b')][_0x19c6('0xe')],'interface':_[_0x19c6('0x10')](_0x4207ba[_0x19c6('0x2b')]['interface'])?util[_0x19c6('0x2d')](_0x19c6('0x33'),_0x4207ba['user']['name']):_0x4207ba['user'][_0x19c6('0x34')],'type':'INTERACTION','enterAt':moment()['format'](_0x19c6('0x2e')),'role':_0x19c6('0x35'),'internal':_0x4207ba[_0x19c6('0x2b')][_0x19c6('0x36')],'uniqueid':_0x4207ba['body']['interaction'][_0x27b771][_0x4dbb91]}});}}}}return respondWithRpcPromise(_0x19c6('0x37'),{'id':_0x4207ba[_0x19c6('0x17')]['id'],'capacity':_0x4207ba[_0x19c6('0x2a')][_0x19c6('0x38')]},routingClient)[_0x19c6('0x7')](respondWithResult(_0x50f117,null))['catch'](handleError(_0x50f117,null));};exports[_0x19c6('0x39')]=function(_0x4a6a89,_0x34afdc){return respondWithRpcPromise(_0x19c6('0x3a'),_0x4a6a89[_0x19c6('0x15')])[_0x19c6('0x7')](respondWithResult(_0x34afdc,null))[_0x19c6('0x18')](handleError(_0x34afdc,null));};exports['trunks']=function(_0xf00717,_0x506ab9){return respondWithRpcPromise(_0x19c6('0x3b'),_0xf00717[_0x19c6('0x15')])[_0x19c6('0x7')](respondWithResult(_0x506ab9,null))[_0x19c6('0x18')](handleError(_0x506ab9,null));};exports[_0x19c6('0x3c')]=function(_0x1deb64,_0x566b52){return respondWithRpcPromise('Campaigns',_0x1deb64['query'])['then'](respondWithResult(_0x566b52,null))[_0x19c6('0x18')](handleError(_0x566b52,null));};exports[_0x19c6('0x3d')]=function(_0x21adc6,_0x31383a){return respondWithRpcPromise(_0x19c6('0x3e'),_0x21adc6[_0x19c6('0x15')],routingClient)[_0x19c6('0x7')](respondWithResult(_0x31383a,null))[_0x19c6('0x18')](handleError(_0x31383a,null));};exports[_0x19c6('0x3f')]=function(_0x525f70,_0x143459){return respondWithRpcPromise('ChatQueues',_0x525f70[_0x19c6('0x15')],routingClient)['then'](findById(_0x525f70['params']['id']))['then'](respondWithResult(_0x143459,null))[_0x19c6('0x18')](handleError(_0x143459,null));};exports[_0x19c6('0x40')]=function(_0x4bebf0,_0x3985a0){return respondWithRpcPromise('MailQueues',_0x4bebf0['query'],routingClient)[_0x19c6('0x7')](respondWithResult(_0x3985a0,null))[_0x19c6('0x18')](handleError(_0x3985a0,null));};exports[_0x19c6('0x41')]=function(_0x488e69,_0x361170){return respondWithRpcPromise(_0x19c6('0x42'),_0x488e69[_0x19c6('0x15')],routingClient)[_0x19c6('0x7')](findById(_0x488e69[_0x19c6('0x17')]['id']))['then'](respondWithResult(_0x361170,null))[_0x19c6('0x18')](handleError(_0x361170,null));};exports[_0x19c6('0x43')]=function(_0x38b91f,_0x3baf18){return respondWithRpcPromise(_0x19c6('0x44'),_0x38b91f[_0x19c6('0x15')],mailClient)['then'](respondWithResult(_0x3baf18,null))[_0x19c6('0x18')](handleError(_0x3baf18,null));};exports[_0x19c6('0x45')]=function(_0x5d6117,_0x3664bc){return respondWithRpcPromise(_0x19c6('0x46'),_0x5d6117[_0x19c6('0x15')],routingClient)[_0x19c6('0x7')](respondWithResult(_0x3664bc,null))[_0x19c6('0x18')](handleError(_0x3664bc,null));};exports['showOpenchannelQueues']=function(_0x4f9621,_0x9854c8){return respondWithRpcPromise(_0x19c6('0x46'),_0x4f9621[_0x19c6('0x15')],routingClient)[_0x19c6('0x7')](findById(_0x4f9621[_0x19c6('0x17')]['id']))[_0x19c6('0x7')](respondWithResult(_0x9854c8,null))[_0x19c6('0x18')](handleError(_0x9854c8,null));};exports[_0x19c6('0x47')]=function(_0x137647,_0x46707e){return respondWithRpcPromise(_0x19c6('0x48'),_0x137647[_0x19c6('0x15')],routingClient)[_0x19c6('0x7')](respondWithResult(_0x46707e,null))[_0x19c6('0x18')](handleError(_0x46707e,null));};exports[_0x19c6('0x49')]=function(_0x193b6a,_0x17043a){return respondWithRpcPromise(_0x19c6('0x48'),_0x193b6a[_0x19c6('0x15')],routingClient)[_0x19c6('0x7')](findById(_0x193b6a['params']['id']))[_0x19c6('0x7')](respondWithResult(_0x17043a,null))[_0x19c6('0x18')](handleError(_0x17043a,null));};exports[_0x19c6('0x4a')]=function(_0xb4ad9,_0x36a61c){return respondWithRpcPromise(_0x19c6('0x4b'),_0xb4ad9['query'],routingClient)['then'](respondWithResult(_0x36a61c,null))[_0x19c6('0x18')](handleError(_0x36a61c,null));};exports[_0x19c6('0x4c')]=function(_0x58f387,_0x37b690){return respondWithRpcPromise(_0x19c6('0x4b'),_0x58f387[_0x19c6('0x15')],routingClient)[_0x19c6('0x7')](findById(_0x58f387[_0x19c6('0x17')]['id']))[_0x19c6('0x7')](respondWithResult(_0x37b690,null))[_0x19c6('0x18')](handleError(_0x37b690,null));};exports[_0x19c6('0x4d')]=function(_0x2031ba,_0x5c8d9b){return respondWithRpcPromise(_0x19c6('0x4e'),_0x2031ba[_0x19c6('0x15')])[_0x19c6('0x7')](respondWithResult(_0x5c8d9b,null))[_0x19c6('0x18')](handleError(_0x5c8d9b,null));};exports[_0x19c6('0x4f')]=function(_0x31afbd,_0x5b57f5){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x31afbd['query'],routingClient)[_0x19c6('0x7')](respondWithResult(_0x5b57f5,null))[_0x19c6('0x18')](handleError(_0x5b57f5,null));};exports[_0x19c6('0x50')]=function(_0x2cf9bb,_0x2d8eb9){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x2cf9bb[_0x19c6('0x15')],routingClient)[_0x19c6('0x7')](respondWithResult(_0x2d8eb9,null))[_0x19c6('0x18')](handleError(_0x2d8eb9,null));};exports[_0x19c6('0x51')]=function(_0x2bd50e,_0x144d19){return respondWithRpcPromise(_0x19c6('0x52'),_0x2bd50e['query'],routingClient)[_0x19c6('0x7')](respondWithResult(_0x144d19,null))[_0x19c6('0x18')](handleError(_0x144d19,null));};exports[_0x19c6('0x53')]=function(_0x56c8a9,_0x3d9a48){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x56c8a9[_0x19c6('0x15')],routingClient)['then'](respondWithResult(_0x3d9a48,null))[_0x19c6('0x18')](handleError(_0x3d9a48,null));};exports[_0x19c6('0x54')]=function(_0x105ec5,_0xdd64e7){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x105ec5[_0x19c6('0x15')],routingClient)[_0x19c6('0x7')](respondWithResult(_0xdd64e7,null))[_0x19c6('0x18')](handleError(_0xdd64e7,null));};exports['queueNotify']=function(_0x224634){return function(_0x20ad10,_0x31d61a){var _0x276faf,_0x2fe646;var _0x509944=_['capitalize'](_0x224634);var _0x220b06=_0x224634==='chat'?_0x19c6('0x55'):'Account';return db[_0x509944+'Queue'][_0x19c6('0x56')]({'raw':!![],'where':{'id':_0x20ad10[_0x19c6('0x17')]['id']}})[_0x19c6('0x7')](function(_0x1951e8){if(_[_0x19c6('0x10')](_0x1951e8)){throw new Error(_0x509944+_0x19c6('0x57'));}_0x276faf=_0x1951e8;return db[_0x509944+_0x19c6('0x58')][_0x19c6('0x56')]({'where':{'id':_0x20ad10[_0x19c6('0x2a')][_0x19c6('0x59')]},'include':[{'model':db[_0x509944+_0x19c6('0x5a')],'as':_0x19c6('0x5a')},{'model':db[_0x509944+_0x220b06],'as':'Account'}]});})[_0x19c6('0x7')](function(_0x1d96f4){if(_[_0x19c6('0x10')](_0x1d96f4)){throw new Error(_0x509944+_0x19c6('0x5b'));}_0x2fe646=_0x1d96f4;return _0x1d96f4[_0x19c6('0x5c')]({'read':0x0,'readAt':null,'UserId':null});})[_0x19c6('0x7')](function(){var _0x5bd20c={'uniqueid':_0x224634+'.'+_0x2fe646['id']+'.'+_0x2fe646[_0x19c6('0x5a')]['id'],'FromUserId':_0x20ad10['user']['id'],'type':_0x19c6('0x5d')};_0x5bd20c[_0x509944+_0x19c6('0x5e')]=_0x2fe646['id'];_0x5bd20c[_0x509944+_0x19c6('0x5f')]=_0x2fe646['Interaction']['id'];_0x5bd20c[_0x19c6('0x60')+_0x509944+_0x220b06+'Id']=_0x2fe646['Account']['id'];_0x5bd20c['To'+_0x509944+'QueueId']=_0x276faf['id'];return db[_0x509944+'TransferReport'][_0x19c6('0x61')](_0x5bd20c);})[_0x19c6('0x7')](function(){return respondWithRpcPromise(_0x19c6('0x62'),{'channel':_0x224634,'interaction':_0x2fe646[_0x19c6('0x5a')],'message':_0x2fe646,'account':_0x2fe646['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x19c6('0x5d'),'appdata':_0x276faf[_0x19c6('0xe')]+','+(_0x2fe646[_0x19c6('0x63')]['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x19c6('0x7')](respondWithResult(_0x31d61a,null))['catch'](handleError(_0x31d61a,null));};};exports[_0x19c6('0x64')]=function(_0x44a15e,_0x21df6c){var _0x8f44d1,_0x1662b3;if(_[_0x19c6('0x10')](_0x44a15e['body']['channel'])){throw new Error(_0x19c6('0x65'));}var _0xef90a8=_0x44a15e[_0x19c6('0x2a')][_0x19c6('0x66')];var _0x45894b=_[_0x19c6('0x67')](_0xef90a8);var _0x390880=_0xef90a8===_0x19c6('0x68')?_0x19c6('0x55'):_0x19c6('0x63');return db[_0x19c6('0x69')][_0x19c6('0x56')]({'raw':!![],'where':{'id':_0x44a15e[_0x19c6('0x17')]['id'],'role':_0x19c6('0x35')}})[_0x19c6('0x7')](function(_0x264be2){if(_[_0x19c6('0x10')](_0x264be2)){throw new Error(_0x19c6('0x6a'));}_0x8f44d1=_0x264be2;return db[_0x45894b+_0x19c6('0x58')][_0x19c6('0x56')]({'where':{'id':_0x44a15e[_0x19c6('0x2a')]['messageId']},'include':[{'model':db[_0x45894b+_0x19c6('0x5a')],'as':'Interaction'},{'model':db[_0x45894b+_0x390880],'as':_0x19c6('0x63')}]});})[_0x19c6('0x7')](function(_0x64385f){if(_[_0x19c6('0x10')](_0x64385f)){throw new Error(_0x45894b+_0x19c6('0x5b'));}_0x1662b3=_0x64385f;return _0x64385f['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3877c6={'uniqueid':_0xef90a8+'.'+_0x1662b3['id']+'.'+_0x1662b3[_0x19c6('0x5a')]['id'],'FromUserId':_0x44a15e['user']['id'],'type':_0x19c6('0x5d'),'ToUserId':_0x8f44d1['id']};_0x3877c6[_0x45894b+'MessageId']=_0x1662b3['id'];_0x3877c6[_0x45894b+'InteractionId']=_0x1662b3[_0x19c6('0x5a')]['id'];_0x3877c6[_0x19c6('0x60')+_0x45894b+_0x390880+'Id']=_0x1662b3['Account']['id'];return db[_0x45894b+_0x19c6('0x6b')][_0x19c6('0x61')](_0x3877c6);})[_0x19c6('0x7')](function(){return respondWithRpcPromise(_0x19c6('0x62'),{'channel':_0xef90a8,'interaction':_0x1662b3['Interaction'],'message':_0x1662b3,'account':_0x1662b3[_0x19c6('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x8f44d1[_0x19c6('0xe')]+','+(_0x1662b3[_0x19c6('0x63')]['agentTransferTimeout']||0x12c),'interval':_0x19c6('0x6c')}]},routingClient);})[_0x19c6('0x7')](respondWithResult(_0x21df6c,null))[_0x19c6('0x18')](handleError(_0x21df6c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 0a7c769..a88dbd3 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 _0x89e8=['util','path','connect-timeout','express','../../components/auth/service','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','run','post','create','put','update','delete','destroy','multer'];(function(_0x29d7fb,_0x2255a3){var _0x10a703=function(_0xb4ab51){while(--_0xb4ab51){_0x29d7fb['push'](_0x29d7fb['shift']());}};_0x10a703(++_0x2255a3);}(_0x89e8,0x109));var _0x889e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x89e8[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var path=require(_0x889e('0x2'));var timeout=require(_0x889e('0x3'));var express=require(_0x889e('0x4'));var router=express['Router']();var auth=require(_0x889e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x889e('0x6'));router[_0x889e('0x7')]('/',auth[_0x889e('0x8')](),controller['index']);router[_0x889e('0x7')](_0x889e('0x9'),auth[_0x889e('0x8')](),controller[_0x889e('0xa')]);router['get'](_0x889e('0xb'),auth[_0x889e('0x8')](),controller[_0x889e('0xc')]);router[_0x889e('0xd')]('/',auth[_0x889e('0x8')](),controller[_0x889e('0xe')]);router[_0x889e('0xf')](_0x889e('0x9'),auth[_0x889e('0x8')](),controller[_0x889e('0x10')]);router[_0x889e('0x11')](_0x889e('0x9'),auth['isAuthenticated'](),controller[_0x889e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8a9f=['show','post','put','update','delete','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x33ae4a,_0x5eaba3){var _0x13ed86=function(_0x416244){while(--_0x416244){_0x33ae4a['push'](_0x33ae4a['shift']());}};_0x13ed86(++_0x5eaba3);}(_0x8a9f,0x1c6));var _0xf8a9=function(_0x4bf264,_0x3be730){_0x4bf264=_0x4bf264-0x0;var _0x3c855f=_0x8a9f[_0x4bf264];return _0x3c855f;};'use strict';var multer=require(_0xf8a9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf8a9('0x1'));var router=express[_0xf8a9('0x2')]();var auth=require(_0xf8a9('0x3'));var interaction=require(_0xf8a9('0x4'));var config=require(_0xf8a9('0x5'));var controller=require('./schedule.controller');router[_0xf8a9('0x6')]('/',auth[_0xf8a9('0x7')](),controller[_0xf8a9('0x8')]);router[_0xf8a9('0x6')](_0xf8a9('0x9'),auth['isAuthenticated'](),controller[_0xf8a9('0xa')]);router[_0xf8a9('0x6')]('/:id/run',auth[_0xf8a9('0x7')](),controller['run']);router[_0xf8a9('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf8a9('0xc')](_0xf8a9('0x9'),auth['isAuthenticated'](),controller[_0xf8a9('0xd')]);router[_0xf8a9('0xe')](_0xf8a9('0x9'),auth[_0xf8a9('0x7')](),controller['destroy']);module[_0xf8a9('0xf')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 5f50081..a9815d5 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 _0x49fe=['months','weeks','days','hours','pdf','csv','default','custom','TEXT','sequelize','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x49fe,0x75));var _0xe49f=function(_0x132a7e,_0x3b6cc5){_0x132a7e=_0x132a7e-0x0;var _0xc2a1ff=_0x49fe[_0x132a7e];return _0xc2a1ff;};'use strict';var Sequelize=require(_0xe49f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xe49f('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe49f('0x2')],'allowNull':![],'defaultValue':_0xe49f('0x3')},'startAt':{'type':Sequelize[_0xe49f('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xe49f('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe49f('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe49f('0x6')](_0xe49f('0x7'),_0xe49f('0x8'),_0xe49f('0x9'),_0xe49f('0xa'),_0xe49f('0xb'),_0xe49f('0xc'),'minutes'),'allowNull':![],'defaultValue':_0xe49f('0xb')},'output':{'type':Sequelize[_0xe49f('0x6')]('csv',_0xe49f('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0xe49f('0xe')},'type':{'type':Sequelize[_0xe49f('0x6')]('custom',_0xe49f('0xf')),'allowNull':![],'defaultValue':_0xe49f('0x10')},'sendMail':{'type':Sequelize[_0xe49f('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xe49f('0x2')]},'cc':{'type':Sequelize[_0xe49f('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xe49f('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe714=['months','weeks','hours','minutes','days','csv','xlsx','custom','default','TEXT','sequelize','STRING','BOOLEAN','DATE','INTEGER','ENUM','years','quarters'];(function(_0x30c7c5,_0x168208){var _0x29e24e=function(_0x427d3e){while(--_0x427d3e){_0x30c7c5['push'](_0x30c7c5['shift']());}};_0x29e24e(++_0x168208);}(_0xe714,0xe2));var _0x4e71=function(_0x3781f2,_0x60f3f){_0x3781f2=_0x3781f2-0x0;var _0x40a777=_0xe714[_0x3781f2];return _0x40a777;};'use strict';var Sequelize=require(_0x4e71('0x0'));module['exports']={'name':{'type':Sequelize[_0x4e71('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4e71('0x1')]},'active':{'type':Sequelize[_0x4e71('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x4e71('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x4e71('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x4e71('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x4e71('0x5')](_0x4e71('0x6'),_0x4e71('0x7'),_0x4e71('0x8'),_0x4e71('0x9'),'days',_0x4e71('0xa'),_0x4e71('0xb')),'allowNull':![],'defaultValue':_0x4e71('0xc')},'output':{'type':Sequelize['ENUM'](_0x4e71('0xd'),'pdf',_0x4e71('0xe')),'allowNull':![],'defaultValue':_0x4e71('0xd')},'type':{'type':Sequelize[_0x4e71('0x5')](_0x4e71('0xf'),_0x4e71('0x10')),'allowNull':![],'defaultValue':_0x4e71('0xf')},'sendMail':{'type':Sequelize[_0x4e71('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x4e71('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x4e71('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x4e71('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index b7b7bbb..b074f39 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 _0xffb2=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','set','Content-Range','json','apply','save','update','then','get','UserProfileResource','sendStatus','error','stack','name','send','map','Schedule','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','catch','destroy','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xffb2,0xed));var _0x2ffb=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xffb2[_0x381589];return _0x2a075d;};'use strict';var pdf=require(_0x2ffb('0x0'));var emlformat=require(_0x2ffb('0x1'));var rimraf=require(_0x2ffb('0x2'));var zipdir=require(_0x2ffb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2ffb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2ffb('0x5'));var util=require(_0x2ffb('0x6'));var path=require(_0x2ffb('0x7'));var sox=require(_0x2ffb('0x8'));var csv=require(_0x2ffb('0x9'));var ejs=require(_0x2ffb('0xa'));var fs=require('fs');var _=require(_0x2ffb('0xb'));var squel=require(_0x2ffb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2ffb('0xd'));var toCsv=require(_0x2ffb('0x9'));var querystring=require(_0x2ffb('0xe'));var Papa=require(_0x2ffb('0xf'));var Redis=require(_0x2ffb('0x10'));var authService=require(_0x2ffb('0x11'));var qs=require(_0x2ffb('0x12'));var as=require(_0x2ffb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ffb('0x14'))('api');var utils=require(_0x2ffb('0x15'));var config=require(_0x2ffb('0x16'));var db=require(_0x2ffb('0x17'))['db'];function respondWithStatusCode(_0x12c445,_0x324963){_0x324963=_0x324963||0xcc;return function(_0x3f24b9){if(_0x3f24b9){return _0x12c445['sendStatus'](_0x324963);}return _0x12c445[_0x2ffb('0x18')](_0x324963)[_0x2ffb('0x19')]();};}function respondWithResult(_0x5e7f89,_0x5a880d){_0x5a880d=_0x5a880d||0xc8;return function(_0x7b86aa){if(_0x7b86aa){return _0x5e7f89[_0x2ffb('0x18')](_0x5a880d)['json'](_0x7b86aa);}};}function respondWithFilteredResult(_0x366372,_0x30e619){return function(_0x5a79ea){if(_0x5a79ea){var _0xe9c11f=_0x5a79ea[_0x2ffb('0x1a')],_0x247204=_0x30e619['offset'],_0x4ee18a=_0x30e619[_0x2ffb('0x1b')]+_0x30e619['limit'],_0x5e5148;if(_0x4ee18a>=_0xe9c11f){_0x4ee18a=_0xe9c11f;_0x5e5148=0xc8;}else{_0x5e5148=0xce;}_0x366372['status'](_0x5e5148);return _0x366372[_0x2ffb('0x1c')](_0x2ffb('0x1d'),_0x247204+'-'+_0x4ee18a+'/'+_0xe9c11f)[_0x2ffb('0x1e')](_0x5a79ea);}return null;};}function patchUpdates(_0x2b9185){return function(_0x2a89e1){try{jsonpatch[_0x2ffb('0x1f')](_0x2a89e1,_0x2b9185,!![]);}catch(_0x44bfa9){return BPromise['reject'](_0x44bfa9);}return _0x2a89e1[_0x2ffb('0x20')]();};}function saveUpdates(_0x18a929,_0x4998e0){return function(_0x4d10e4){if(_0x4d10e4){return _0x4d10e4[_0x2ffb('0x21')](_0x18a929)[_0x2ffb('0x22')](function(_0x1ebf87){return _0x1ebf87;});}return null;};}function removeEntity(_0x12d6c1,_0x3f0435){return function(_0x33f160){if(_0x33f160){return _0x33f160['destroy']()[_0x2ffb('0x22')](function(){var _0x57188f=_0x33f160[_0x2ffb('0x23')]({'plain':!![]});var _0x49d438='Scheduler';return db[_0x2ffb('0x24')]['destroy']({'where':{'type':_0x49d438,'resourceId':_0x57188f['id']}})[_0x2ffb('0x22')](function(){return _0x33f160;});})[_0x2ffb('0x22')](function(){_0x12d6c1[_0x2ffb('0x18')](0xcc)[_0x2ffb('0x19')]();});}};}function handleEntityNotFound(_0x45b503,_0x469c63){return function(_0x2d50d3){if(!_0x2d50d3){_0x45b503[_0x2ffb('0x25')](0x194);}return _0x2d50d3;};}function handleError(_0x274680,_0x1f71de){_0x1f71de=_0x1f71de||0x1f4;return function(_0x18a2b8){logger[_0x2ffb('0x26')](_0x18a2b8[_0x2ffb('0x27')]);if(_0x18a2b8[_0x2ffb('0x28')]){delete _0x18a2b8[_0x2ffb('0x28')];}_0x274680['status'](_0x1f71de)[_0x2ffb('0x29')](_0x18a2b8);};}exports['index']=function(_0x1f6001,_0x382145){var _0x1f0f20={},_0x36b1cb={},_0x54f20d={'count':0x0,'rows':[]};var _0x902c8c=_[_0x2ffb('0x2a')](db[_0x2ffb('0x2b')]['rawAttributes'],function(_0x10032b){return{'name':_0x10032b[_0x2ffb('0x2c')],'type':_0x10032b['type'][_0x2ffb('0x2d')]};});_0x36b1cb['model']=_[_0x2ffb('0x2a')](_0x902c8c,'name');_0x36b1cb['query']=_['keys'](_0x1f6001[_0x2ffb('0x2e')]);_0x36b1cb[_0x2ffb('0x2f')]=_[_0x2ffb('0x30')](_0x36b1cb[_0x2ffb('0x31')],_0x36b1cb[_0x2ffb('0x2e')]);_0x1f0f20[_0x2ffb('0x32')]=_[_0x2ffb('0x30')](_0x36b1cb[_0x2ffb('0x31')],qs['fields'](_0x1f6001[_0x2ffb('0x2e')][_0x2ffb('0x33')]));_0x1f0f20['attributes']=_0x1f0f20[_0x2ffb('0x32')][_0x2ffb('0x34')]?_0x1f0f20[_0x2ffb('0x32')]:_0x36b1cb['model'];if(!_0x1f6001[_0x2ffb('0x2e')]['hasOwnProperty'](_0x2ffb('0x35'))){_0x1f0f20[_0x2ffb('0x36')]=qs[_0x2ffb('0x36')](_0x1f6001[_0x2ffb('0x2e')][_0x2ffb('0x36')]);_0x1f0f20[_0x2ffb('0x1b')]=qs[_0x2ffb('0x1b')](_0x1f6001[_0x2ffb('0x2e')][_0x2ffb('0x1b')]);}_0x1f0f20[_0x2ffb('0x37')]=qs['sort'](_0x1f6001[_0x2ffb('0x2e')][_0x2ffb('0x38')]);_0x1f0f20[_0x2ffb('0x39')]=qs[_0x2ffb('0x2f')](_[_0x2ffb('0x3a')](_0x1f6001[_0x2ffb('0x2e')],_0x36b1cb[_0x2ffb('0x2f')]));if(_0x1f6001[_0x2ffb('0x2e')][_0x2ffb('0x3b')]){_0x1f0f20[_0x2ffb('0x39')]=_[_0x2ffb('0x3c')](_0x1f0f20[_0x2ffb('0x39')],{'$or':_[_0x2ffb('0x2a')](_0x902c8c,function(_0x24a5ea){if(_0x24a5ea[_0x2ffb('0x3d')]!==_0x2ffb('0x3e')){var _0x1e1217={};_0x1e1217[_0x24a5ea[_0x2ffb('0x28')]]={'$like':'%'+_0x1f6001[_0x2ffb('0x2e')][_0x2ffb('0x3b')]+'%'};return _0x1e1217;}})});}_0x1f0f20=_['merge']({},_0x1f0f20,_0x1f6001['options']);var _0x4ceb94={'where':_0x1f0f20[_0x2ffb('0x39')]};return db[_0x2ffb('0x2b')][_0x2ffb('0x1a')](_0x4ceb94)[_0x2ffb('0x22')](function(_0x4f69fa){_0x54f20d[_0x2ffb('0x1a')]=_0x4f69fa;if(_0x1f6001[_0x2ffb('0x2e')][_0x2ffb('0x3f')]){_0x1f0f20['include']=[{'all':!![]}];}return db[_0x2ffb('0x2b')][_0x2ffb('0x40')](_0x1f0f20);})[_0x2ffb('0x22')](function(_0x584e3d){_0x54f20d[_0x2ffb('0x41')]=_0x584e3d;return _0x54f20d;})[_0x2ffb('0x22')](respondWithFilteredResult(_0x382145,_0x1f0f20))['catch'](handleError(_0x382145,null));};exports[_0x2ffb('0x42')]=function(_0x37817a,_0x18fd59){var _0x3fcc9f={'raw':![],'where':{'id':_0x37817a[_0x2ffb('0x43')]['id']}},_0x591181={};_0x591181[_0x2ffb('0x31')]=_[_0x2ffb('0x44')](db['Schedule']['rawAttributes']);_0x591181[_0x2ffb('0x2e')]=_[_0x2ffb('0x44')](_0x37817a[_0x2ffb('0x2e')]);_0x591181['filters']=_['intersection'](_0x591181['model'],_0x591181[_0x2ffb('0x2e')]);_0x3fcc9f[_0x2ffb('0x32')]=_[_0x2ffb('0x30')](_0x591181[_0x2ffb('0x31')],qs[_0x2ffb('0x33')](_0x37817a['query'][_0x2ffb('0x33')]));_0x3fcc9f[_0x2ffb('0x32')]=_0x3fcc9f[_0x2ffb('0x32')][_0x2ffb('0x34')]?_0x3fcc9f[_0x2ffb('0x32')]:_0x591181[_0x2ffb('0x31')];if(_0x37817a[_0x2ffb('0x2e')][_0x2ffb('0x3f')]){_0x3fcc9f['include']=[{'all':!![]}];}_0x3fcc9f=_[_0x2ffb('0x3c')]({},_0x3fcc9f,_0x37817a[_0x2ffb('0x45')]);return db[_0x2ffb('0x2b')][_0x2ffb('0x46')](_0x3fcc9f)[_0x2ffb('0x22')](handleEntityNotFound(_0x18fd59,null))[_0x2ffb('0x22')](respondWithResult(_0x18fd59,null))['catch'](handleError(_0x18fd59,null));};exports[_0x2ffb('0x47')]=function(_0x553c1a,_0x3e06b3){return db[_0x2ffb('0x2b')][_0x2ffb('0x47')](_0x553c1a[_0x2ffb('0x48')],{})[_0x2ffb('0x22')](function(_0x56b7cb){var _0x50ea70=_0x553c1a[_0x2ffb('0x49')][_0x2ffb('0x23')]({'plain':!![]});if(!_0x50ea70)throw new Error(_0x2ffb('0x4a'));if(_0x50ea70[_0x2ffb('0x4b')]===_0x2ffb('0x49')){var _0x35c962=_0x56b7cb[_0x2ffb('0x23')]({'plain':!![]});var _0x590d70=_0x2ffb('0x4c');return db[_0x2ffb('0x4d')]['find']({'where':{'name':_0x590d70,'userProfileId':_0x50ea70[_0x2ffb('0x4e')]},'raw':!![]})[_0x2ffb('0x22')](function(_0xcedae){if(_0xcedae&&_0xcedae[_0x2ffb('0x4f')]===0x0){return db[_0x2ffb('0x24')]['create']({'name':_0x35c962['name'],'resourceId':_0x35c962['id'],'type':_0xcedae[_0x2ffb('0x28')],'sectionId':_0xcedae['id']},{})[_0x2ffb('0x22')](function(){return _0x56b7cb;});}else{return _0x56b7cb;}})[_0x2ffb('0x50')](function(_0x53c9b0){logger[_0x2ffb('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53c9b0);throw _0x53c9b0;});}return _0x56b7cb;})[_0x2ffb('0x22')](respondWithResult(_0x3e06b3,0xc9))[_0x2ffb('0x50')](handleError(_0x3e06b3,null));};exports[_0x2ffb('0x21')]=function(_0x1d67cf,_0x5e7093){if(_0x1d67cf['body']['id']){delete _0x1d67cf[_0x2ffb('0x48')]['id'];}return db['Schedule'][_0x2ffb('0x46')]({'where':{'id':_0x1d67cf[_0x2ffb('0x43')]['id']}})[_0x2ffb('0x22')](handleEntityNotFound(_0x5e7093,null))[_0x2ffb('0x22')](saveUpdates(_0x1d67cf[_0x2ffb('0x48')],null))[_0x2ffb('0x22')](respondWithResult(_0x5e7093,null))[_0x2ffb('0x50')](handleError(_0x5e7093,null));};exports[_0x2ffb('0x51')]=function(_0xa98505,_0x57060f){return db[_0x2ffb('0x2b')][_0x2ffb('0x46')]({'where':{'id':_0xa98505[_0x2ffb('0x43')]['id']}})['then'](handleEntityNotFound(_0x57060f,null))[_0x2ffb('0x22')](removeEntity(_0x57060f,null))[_0x2ffb('0x50')](handleError(_0x57060f,null));};exports[_0x2ffb('0x52')]=function(_0x59877f,_0x58ab84,_0x2687d1){var _0x44ca11=require(_0x2ffb('0x53'));return db[_0x2ffb('0x2b')]['find']({'where':{'id':_0x59877f['params']['id']},'raw':!![]})[_0x2ffb('0x22')](handleEntityNotFound(_0x58ab84,null))['then'](function(){_0x44ca11[_0x2ffb('0x52')](_0x59877f[_0x2ffb('0x43')]['id']);})[_0x2ffb('0x22')](respondWithStatusCode(_0x58ab84,null))[_0x2ffb('0x50')](handleError(_0x58ab84,null));}; \ No newline at end of file +var _0x5088=['query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','findAll','rows','catch','keys','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','name','params','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','Scheduler','UserProfileResource','error','stack','send','index','map','Schedule','rawAttributes','fieldName','key','model'];(function(_0x53a1dc,_0x20abd0){var _0x58304f=function(_0x45d518){while(--_0x45d518){_0x53a1dc['push'](_0x53a1dc['shift']());}};_0x58304f(++_0x20abd0);}(_0x5088,0xc3));var _0x8508=function(_0x121f61,_0x5174fc){_0x121f61=_0x121f61-0x0;var _0x393306=_0x5088[_0x121f61];return _0x393306;};'use strict';var pdf=require(_0x8508('0x0'));var emlformat=require(_0x8508('0x1'));var rimraf=require(_0x8508('0x2'));var zipdir=require(_0x8508('0x3'));var jsonpatch=require(_0x8508('0x4'));var rp=require(_0x8508('0x5'));var moment=require(_0x8508('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x8508('0x7'));var util=require(_0x8508('0x8'));var path=require('path');var sox=require(_0x8508('0x9'));var csv=require('to-csv');var ejs=require(_0x8508('0xa'));var fs=require('fs');var _=require(_0x8508('0xb'));var squel=require(_0x8508('0xc'));var crypto=require(_0x8508('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8508('0xe'));var toCsv=require(_0x8508('0xf'));var querystring=require('querystring');var Papa=require(_0x8508('0x10'));var Redis=require(_0x8508('0x11'));var authService=require(_0x8508('0x12'));var qs=require(_0x8508('0x13'));var as=require(_0x8508('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8508('0x15'))(_0x8508('0x16'));var utils=require(_0x8508('0x17'));var config=require(_0x8508('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a3e11,_0x10a18e){_0x10a18e=_0x10a18e||0xcc;return function(_0x291be7){if(_0x291be7){return _0x2a3e11[_0x8508('0x19')](_0x10a18e);}return _0x2a3e11[_0x8508('0x1a')](_0x10a18e)['end']();};}function respondWithResult(_0xe560dd,_0x1f9503){_0x1f9503=_0x1f9503||0xc8;return function(_0x5adb9c){if(_0x5adb9c){return _0xe560dd['status'](_0x1f9503)[_0x8508('0x1b')](_0x5adb9c);}};}function respondWithFilteredResult(_0x50f344,_0x4d7993){return function(_0x27b609){if(_0x27b609){var _0x3b9927=_0x27b609[_0x8508('0x1c')],_0x3d76f2=_0x4d7993[_0x8508('0x1d')],_0x450613=_0x4d7993[_0x8508('0x1d')]+_0x4d7993[_0x8508('0x1e')],_0x4256c2;if(_0x450613>=_0x3b9927){_0x450613=_0x3b9927;_0x4256c2=0xc8;}else{_0x4256c2=0xce;}_0x50f344[_0x8508('0x1a')](_0x4256c2);return _0x50f344['set'](_0x8508('0x1f'),_0x3d76f2+'-'+_0x450613+'/'+_0x3b9927)['json'](_0x27b609);}return null;};}function patchUpdates(_0x4b8448){return function(_0x2d0561){try{jsonpatch[_0x8508('0x20')](_0x2d0561,_0x4b8448,!![]);}catch(_0x4a5bd4){return BPromise[_0x8508('0x21')](_0x4a5bd4);}return _0x2d0561[_0x8508('0x22')]();};}function saveUpdates(_0x571a3f,_0x2c7b27){return function(_0x4517cf){if(_0x4517cf){return _0x4517cf[_0x8508('0x23')](_0x571a3f)['then'](function(_0x21672c){return _0x21672c;});}return null;};}function removeEntity(_0x34eed2,_0x389396){return function(_0x2668f6){if(_0x2668f6){return _0x2668f6[_0x8508('0x24')]()[_0x8508('0x25')](function(){var _0x34f383=_0x2668f6[_0x8508('0x26')]({'plain':!![]});var _0x190772=_0x8508('0x27');return db[_0x8508('0x28')][_0x8508('0x24')]({'where':{'type':_0x190772,'resourceId':_0x34f383['id']}})['then'](function(){return _0x2668f6;});})[_0x8508('0x25')](function(){_0x34eed2[_0x8508('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31163f,_0x19804e){return function(_0x40915f){if(!_0x40915f){_0x31163f['sendStatus'](0x194);}return _0x40915f;};}function handleError(_0x3257f6,_0x3eca31){_0x3eca31=_0x3eca31||0x1f4;return function(_0xb9e9bb){logger[_0x8508('0x29')](_0xb9e9bb[_0x8508('0x2a')]);if(_0xb9e9bb['name']){delete _0xb9e9bb['name'];}_0x3257f6[_0x8508('0x1a')](_0x3eca31)[_0x8508('0x2b')](_0xb9e9bb);};}exports[_0x8508('0x2c')]=function(_0x33d1cd,_0x15c7b0){var _0x2b1a56={},_0x7f8a2e={},_0xa43aa8={'count':0x0,'rows':[]};var _0x23cc8f=_[_0x8508('0x2d')](db[_0x8508('0x2e')][_0x8508('0x2f')],function(_0x192d6b){return{'name':_0x192d6b[_0x8508('0x30')],'type':_0x192d6b['type'][_0x8508('0x31')]};});_0x7f8a2e[_0x8508('0x32')]=_['map'](_0x23cc8f,'name');_0x7f8a2e[_0x8508('0x33')]=_['keys'](_0x33d1cd[_0x8508('0x33')]);_0x7f8a2e[_0x8508('0x34')]=_['intersection'](_0x7f8a2e[_0x8508('0x32')],_0x7f8a2e[_0x8508('0x33')]);_0x2b1a56[_0x8508('0x35')]=_[_0x8508('0x36')](_0x7f8a2e[_0x8508('0x32')],qs[_0x8508('0x37')](_0x33d1cd[_0x8508('0x33')][_0x8508('0x37')]));_0x2b1a56['attributes']=_0x2b1a56[_0x8508('0x35')]['length']?_0x2b1a56[_0x8508('0x35')]:_0x7f8a2e[_0x8508('0x32')];if(!_0x33d1cd[_0x8508('0x33')][_0x8508('0x38')](_0x8508('0x39'))){_0x2b1a56[_0x8508('0x1e')]=qs['limit'](_0x33d1cd[_0x8508('0x33')][_0x8508('0x1e')]);_0x2b1a56['offset']=qs[_0x8508('0x1d')](_0x33d1cd[_0x8508('0x33')]['offset']);}_0x2b1a56[_0x8508('0x3a')]=qs['sort'](_0x33d1cd['query'][_0x8508('0x3b')]);_0x2b1a56['where']=qs[_0x8508('0x34')](_[_0x8508('0x3c')](_0x33d1cd[_0x8508('0x33')],_0x7f8a2e['filters']));if(_0x33d1cd['query']['filter']){_0x2b1a56[_0x8508('0x3d')]=_[_0x8508('0x3e')](_0x2b1a56[_0x8508('0x3d')],{'$or':_[_0x8508('0x2d')](_0x23cc8f,function(_0x1be0d0){if(_0x1be0d0[_0x8508('0x3f')]!=='VIRTUAL'){var _0xad0b2e={};_0xad0b2e[_0x1be0d0['name']]={'$like':'%'+_0x33d1cd['query'][_0x8508('0x40')]+'%'};return _0xad0b2e;}})});}_0x2b1a56=_[_0x8508('0x3e')]({},_0x2b1a56,_0x33d1cd[_0x8508('0x41')]);var _0x5037b3={'where':_0x2b1a56[_0x8508('0x3d')]};return db[_0x8508('0x2e')][_0x8508('0x1c')](_0x5037b3)[_0x8508('0x25')](function(_0x200b32){_0xa43aa8[_0x8508('0x1c')]=_0x200b32;if(_0x33d1cd[_0x8508('0x33')]['includeAll']){_0x2b1a56['include']=[{'all':!![]}];}return db['Schedule'][_0x8508('0x42')](_0x2b1a56);})[_0x8508('0x25')](function(_0x3234cb){_0xa43aa8[_0x8508('0x43')]=_0x3234cb;return _0xa43aa8;})[_0x8508('0x25')](respondWithFilteredResult(_0x15c7b0,_0x2b1a56))[_0x8508('0x44')](handleError(_0x15c7b0,null));};exports['show']=function(_0x139e56,_0x457b05){var _0x29690c={'raw':![],'where':{'id':_0x139e56['params']['id']}},_0x5b9c1a={};_0x5b9c1a[_0x8508('0x32')]=_[_0x8508('0x45')](db[_0x8508('0x2e')][_0x8508('0x2f')]);_0x5b9c1a[_0x8508('0x33')]=_['keys'](_0x139e56[_0x8508('0x33')]);_0x5b9c1a[_0x8508('0x34')]=_[_0x8508('0x36')](_0x5b9c1a[_0x8508('0x32')],_0x5b9c1a[_0x8508('0x33')]);_0x29690c[_0x8508('0x35')]=_[_0x8508('0x36')](_0x5b9c1a[_0x8508('0x32')],qs[_0x8508('0x37')](_0x139e56[_0x8508('0x33')][_0x8508('0x37')]));_0x29690c[_0x8508('0x35')]=_0x29690c['attributes']['length']?_0x29690c[_0x8508('0x35')]:_0x5b9c1a[_0x8508('0x32')];if(_0x139e56['query'][_0x8508('0x46')]){_0x29690c[_0x8508('0x47')]=[{'all':!![]}];}_0x29690c=_[_0x8508('0x3e')]({},_0x29690c,_0x139e56[_0x8508('0x41')]);return db[_0x8508('0x2e')][_0x8508('0x48')](_0x29690c)['then'](handleEntityNotFound(_0x457b05,null))[_0x8508('0x25')](respondWithResult(_0x457b05,null))[_0x8508('0x44')](handleError(_0x457b05,null));};exports[_0x8508('0x49')]=function(_0x3ae551,_0x4a7448){return db[_0x8508('0x2e')][_0x8508('0x49')](_0x3ae551[_0x8508('0x4a')],{})[_0x8508('0x25')](function(_0x442b52){var _0x731563=_0x3ae551['user'][_0x8508('0x26')]({'plain':!![]});if(!_0x731563)throw new Error(_0x8508('0x4b'));if(_0x731563[_0x8508('0x4c')]==='user'){var _0x571ce1=_0x442b52[_0x8508('0x26')]({'plain':!![]});var _0x516d7a=_0x8508('0x27');return db['UserProfileSection'][_0x8508('0x48')]({'where':{'name':_0x516d7a,'userProfileId':_0x731563['userProfileId']},'raw':!![]})[_0x8508('0x25')](function(_0xe487ea){if(_0xe487ea&&_0xe487ea[_0x8508('0x4d')]===0x0){return db[_0x8508('0x28')][_0x8508('0x49')]({'name':_0x571ce1[_0x8508('0x4e')],'resourceId':_0x571ce1['id'],'type':_0xe487ea[_0x8508('0x4e')],'sectionId':_0xe487ea['id']},{})[_0x8508('0x25')](function(){return _0x442b52;});}else{return _0x442b52;}})['catch'](function(_0x38a692){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38a692);throw _0x38a692;});}return _0x442b52;})[_0x8508('0x25')](respondWithResult(_0x4a7448,0xc9))[_0x8508('0x44')](handleError(_0x4a7448,null));};exports[_0x8508('0x23')]=function(_0x2ce31e,_0x46098b){if(_0x2ce31e['body']['id']){delete _0x2ce31e[_0x8508('0x4a')]['id'];}return db[_0x8508('0x2e')][_0x8508('0x48')]({'where':{'id':_0x2ce31e[_0x8508('0x4f')]['id']}})['then'](handleEntityNotFound(_0x46098b,null))['then'](saveUpdates(_0x2ce31e[_0x8508('0x4a')],null))[_0x8508('0x25')](respondWithResult(_0x46098b,null))['catch'](handleError(_0x46098b,null));};exports[_0x8508('0x24')]=function(_0x3f06fc,_0xf93ba5){return db[_0x8508('0x2e')][_0x8508('0x48')]({'where':{'id':_0x3f06fc['params']['id']}})[_0x8508('0x25')](handleEntityNotFound(_0xf93ba5,null))['then'](removeEntity(_0xf93ba5,null))[_0x8508('0x44')](handleError(_0xf93ba5,null));};exports[_0x8508('0x50')]=function(_0x3d6470,_0x52ae77,_0x41dcbc){var _0x57a0ca=require(_0x8508('0x51'));return db[_0x8508('0x2e')][_0x8508('0x48')]({'where':{'id':_0x3d6470[_0x8508('0x4f')]['id']},'raw':!![]})[_0x8508('0x25')](handleEntityNotFound(_0x52ae77,null))['then'](function(){_0x57a0ca[_0x8508('0x50')](_0x3d6470[_0x8508('0x4f')]['id']);})[_0x8508('0x25')](respondWithStatusCode(_0x52ae77,null))[_0x8508('0x44')](handleError(_0x52ae77,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index ed73229..9664148 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 _0xfa6e=['path','rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','util','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa6e,0x13f));var _0xefa6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfa6e[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xefa6('0x0'));var logger=require('../../config/logger')(_0xefa6('0x1'));var moment=require(_0xefa6('0x2'));var BPromise=require(_0xefa6('0x3'));var rp=require(_0xefa6('0x4'));var fs=require('fs');var path=require(_0xefa6('0x5'));var rimraf=require(_0xefa6('0x6'));var config=require('../../config/environment');var attributes=require(_0xefa6('0x7'));module[_0xefa6('0x8')]=function(_0x25d51a,_0x2692fb){return _0x25d51a[_0xefa6('0x9')](_0xefa6('0xa'),attributes,{'tableName':_0xefa6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20fb=['lodash','../../config/logger','api','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules'];(function(_0x34f3a1,_0x1962a7){var _0x414ab4=function(_0x1ac663){while(--_0x1ac663){_0x34f3a1['push'](_0x34f3a1['shift']());}};_0x414ab4(++_0x1962a7);}(_0x20fb,0x1ef));var _0xb20f=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x20fb[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xb20f('0x0'));var util=require('util');var logger=require(_0xb20f('0x1'))(_0xb20f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb20f('0x3'));var config=require(_0xb20f('0x4'));var attributes=require(_0xb20f('0x5'));module[_0xb20f('0x6')]=function(_0xceea34,_0x34eb75){return _0xceea34['define'](_0xb20f('0x7'),attributes,{'tableName':_0xb20f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 2ebb421..fdb41da 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 _0xc671=['../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0xc671,0x1a9));var _0x1c67=function(_0x5a7be2,_0x26c1c1){_0x5a7be2=_0x5a7be2-0x0;var _0x441406=_0xc671[_0x5a7be2];return _0x441406;};'use strict';var _=require(_0x1c67('0x0'));var util=require('util');var moment=require(_0x1c67('0x1'));var BPromise=require(_0x1c67('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c67('0x3'));var db=require(_0x1c67('0x4'))['db'];var utils=require(_0x1c67('0x5'));var logger=require(_0x1c67('0x6'))('rpc');var config=require(_0x1c67('0x7'));var jayson=require(_0x1c67('0x8'));var client=jayson[_0x1c67('0x9')][_0x1c67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23d982,_0x51aca1,_0x3f0384){return new BPromise(function(_0x5b006a,_0x253014){return client[_0x1c67('0xb')](_0x23d982,_0x3f0384)[_0x1c67('0xc')](function(_0x278261){logger[_0x1c67('0xd')](_0x1c67('0xe'),_0x51aca1,_0x1c67('0xf'));logger[_0x1c67('0x10')](_0x1c67('0x11'),_0x51aca1,'request\x20sent',JSON[_0x1c67('0x12')](_0x278261));if(_0x278261[_0x1c67('0x13')]){if(_0x278261[_0x1c67('0x13')][_0x1c67('0x14')]===0x1f4){logger[_0x1c67('0x13')]('Schedule,\x20%s,\x20%s',_0x51aca1,_0x278261[_0x1c67('0x13')][_0x1c67('0x15')]);return _0x253014(_0x278261[_0x1c67('0x13')][_0x1c67('0x15')]);}logger['error'](_0x1c67('0xe'),_0x51aca1,_0x278261['error'][_0x1c67('0x15')]);return _0x5b006a(_0x278261[_0x1c67('0x13')][_0x1c67('0x15')]);}else{logger[_0x1c67('0xd')]('Schedule,\x20%s,\x20%s',_0x51aca1,_0x1c67('0xf'));_0x5b006a(_0x278261[_0x1c67('0x16')][_0x1c67('0x15')]);}})[_0x1c67('0x17')](function(_0xd93ab0){logger[_0x1c67('0x13')](_0x1c67('0xe'),_0x51aca1,_0xd93ab0);_0x253014(_0xd93ab0);});});} \ No newline at end of file +var _0x2070=['stringify','error','code','message','result','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x27a613,_0x27c97b){var _0x48b2cb=function(_0x1892a5){while(--_0x1892a5){_0x27a613['push'](_0x27a613['shift']());}};_0x48b2cb(++_0x27c97b);}(_0x2070,0xe9));var _0x0207=function(_0x294655,_0x395283){_0x294655=_0x294655-0x0;var _0x103d73=_0x2070[_0x294655];return _0x103d73;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0207('0x0'));var fs=require('fs');var Redis=require(_0x0207('0x1'));var db=require(_0x0207('0x2'))['db'];var utils=require(_0x0207('0x3'));var logger=require('../../config/logger')(_0x0207('0x4'));var config=require(_0x0207('0x5'));var jayson=require(_0x0207('0x6'));var client=jayson[_0x0207('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a1469,_0x5253da,_0x415a98){return new BPromise(function(_0x45929f,_0x4d9d8f){return client[_0x0207('0x8')](_0x3a1469,_0x415a98)['then'](function(_0x34829c){logger[_0x0207('0x9')](_0x0207('0xa'),_0x5253da,'request\x20sent');logger[_0x0207('0xb')](_0x0207('0xc'),_0x5253da,_0x0207('0xd'),JSON[_0x0207('0xe')](_0x34829c));if(_0x34829c['error']){if(_0x34829c[_0x0207('0xf')][_0x0207('0x10')]===0x1f4){logger[_0x0207('0xf')](_0x0207('0xa'),_0x5253da,_0x34829c[_0x0207('0xf')]['message']);return _0x4d9d8f(_0x34829c[_0x0207('0xf')][_0x0207('0x11')]);}logger[_0x0207('0xf')](_0x0207('0xa'),_0x5253da,_0x34829c[_0x0207('0xf')][_0x0207('0x11')]);return _0x45929f(_0x34829c[_0x0207('0xf')][_0x0207('0x11')]);}else{logger['info'](_0x0207('0xa'),_0x5253da,_0x0207('0xd'));_0x45929f(_0x34829c[_0x0207('0x12')]['message']);}})['catch'](function(_0x28edef){logger[_0x0207('0xf')]('Schedule,\x20%s,\x20%s',_0x5253da,_0x28edef);_0x4d9d8f(_0x28edef);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 0ce6d4f..71a13c9 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 _0x37c3=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','post','create','put','update','destroy','exports','multer','util','path','express'];(function(_0x12e31d,_0x4b76fb){var _0x506d58=function(_0x128040){while(--_0x128040){_0x12e31d['push'](_0x12e31d['shift']());}};_0x506d58(++_0x4b76fb);}(_0x37c3,0x176));var _0x337c=function(_0x15ade4,_0xbecdca){_0x15ade4=_0x15ade4-0x0;var _0x360d95=_0x37c3[_0x15ade4];return _0x360d95;};'use strict';var multer=require(_0x337c('0x0'));var util=require(_0x337c('0x1'));var path=require(_0x337c('0x2'));var timeout=require('connect-timeout');var express=require(_0x337c('0x3'));var router=express['Router']();var auth=require(_0x337c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x337c('0x5'));var controller=require('./screenRecording.controller');router[_0x337c('0x6')]('/',auth[_0x337c('0x7')](),controller[_0x337c('0x8')]);router[_0x337c('0x6')]('/describe',auth[_0x337c('0x7')](),controller['describe']);router[_0x337c('0x6')](_0x337c('0x9'),auth[_0x337c('0x7')](),controller[_0x337c('0xa')]);router[_0x337c('0x6')](_0x337c('0xb'),auth[_0x337c('0x7')](),controller['download']);router[_0x337c('0xc')]('/',auth[_0x337c('0x7')](),controller[_0x337c('0xd')]);router[_0x337c('0xe')]('/:id',auth[_0x337c('0x7')](),controller[_0x337c('0xf')]);router['delete']('/:id',auth[_0x337c('0x7')](),controller[_0x337c('0x10')]);module[_0x337c('0x11')]=router; \ No newline at end of file +var _0x9fb4=['destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/download','post','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fb4,0x1cf));var _0x49fb=function(_0x30dfa4,_0x1a6275){_0x30dfa4=_0x30dfa4-0x0;var _0x185b37=_0x9fb4[_0x30dfa4];return _0x185b37;};'use strict';var multer=require(_0x49fb('0x0'));var util=require(_0x49fb('0x1'));var path=require(_0x49fb('0x2'));var timeout=require('connect-timeout');var express=require(_0x49fb('0x3'));var router=express[_0x49fb('0x4')]();var auth=require(_0x49fb('0x5'));var interaction=require(_0x49fb('0x6'));var config=require(_0x49fb('0x7'));var controller=require(_0x49fb('0x8'));router[_0x49fb('0x9')]('/',auth['isAuthenticated'](),controller[_0x49fb('0xa')]);router[_0x49fb('0x9')](_0x49fb('0xb'),auth['isAuthenticated'](),controller[_0x49fb('0xc')]);router[_0x49fb('0x9')](_0x49fb('0xd'),auth[_0x49fb('0xe')](),controller['show']);router['get'](_0x49fb('0xf'),auth[_0x49fb('0xe')](),controller['download']);router[_0x49fb('0x10')]('/',auth[_0x49fb('0xe')](),controller['create']);router[_0x49fb('0x11')](_0x49fb('0xd'),auth['isAuthenticated'](),controller[_0x49fb('0x12')]);router[_0x49fb('0x13')](_0x49fb('0xd'),auth[_0x49fb('0xe')](),controller[_0x49fb('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 4240ca5..34a4cc3 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 _0x2bd8=['sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','DATE','format','toString','MM-DD-YYYY\x20HH:mm','updatedAt'];(function(_0x1bb181,_0x15c641){var _0x5e0cfc=function(_0x184e7a){while(--_0x184e7a){_0x1bb181['push'](_0x1bb181['shift']());}};_0x5e0cfc(++_0x15c641);}(_0x2bd8,0x130));var _0x82bd=function(_0x2efb5f,_0x33c8b2){_0x2efb5f=_0x2efb5f-0x0;var _0x456bf9=_0x2bd8[_0x2efb5f];return _0x456bf9;};'use strict';var Sequelize=require(_0x82bd('0x0'));var moment=require('moment');var path=require(_0x82bd('0x1'));var config=require(_0x82bd('0x2'));module[_0x82bd('0x3')]={'format':{'type':Sequelize[_0x82bd('0x4')],'get':function(){return this[_0x82bd('0x5')](_0x82bd('0x6'))?path[_0x82bd('0x7')](this['getDataValue'](_0x82bd('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x82bd('0x8')]},'channel':{'type':Sequelize[_0x82bd('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x19dbb1){var _0x77d7a9=_0x19dbb1[_0x82bd('0x9')](/\\/g,'/');this[_0x82bd('0xa')]('value',_0x77d7a9);}},'rating':{'type':Sequelize[_0x82bd('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x4a9b2c){this['setDataValue'](_0x82bd('0xc'),moment()['subtract'](_0x4a9b2c,'ms'));this['setDataValue'](_0x82bd('0xd'),moment());this['setDataValue']('duration',_0x4a9b2c);}},'startedAt':{'type':Sequelize[_0x82bd('0xe')],'get':function(){return moment(this[_0x82bd('0x5')]('startedAt'))[_0x82bd('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x82bd('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x82bd('0x5')](_0x82bd('0xd')))[_0x82bd('0xf')](_0x82bd('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0x82bd('0xe')],'get':function(){return moment(this[_0x82bd('0x5')]('createdAt'))[_0x82bd('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x82bd('0x10')]();}},'updatedAt':{'type':Sequelize[_0x82bd('0xe')],'get':function(){return moment(this[_0x82bd('0x5')](_0x82bd('0x12')))[_0x82bd('0xf')](_0x82bd('0x11'))[_0x82bd('0x10')]();}}}; \ No newline at end of file +var _0xdbf5=['getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','startedAt','duration','MM-DD-YYYY\x20HH:mm','toString','DATE','closedAt','createdAt','format','updatedAt','moment','exports','VIRTUAL'];(function(_0x211d20,_0x21e77c){var _0x784fb4=function(_0x4bee2c){while(--_0x4bee2c){_0x211d20['push'](_0x211d20['shift']());}};_0x784fb4(++_0x21e77c);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x3272af,_0x31c2e9){_0x3272af=_0x3272af-0x0;var _0xfccd61=_0xdbf5[_0x3272af];return _0xfccd61;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5dbf('0x0'));var path=require('path');var config=require('../../config/environment');module[_0x5dbf('0x1')]={'format':{'type':Sequelize[_0x5dbf('0x2')],'get':function(){return this[_0x5dbf('0x3')](_0x5dbf('0x4'))?path[_0x5dbf('0x5')](this[_0x5dbf('0x3')](_0x5dbf('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x5dbf('0x6')]},'channel':{'type':Sequelize[_0x5dbf('0x6')]},'value':{'type':Sequelize[_0x5dbf('0x6')],'set':function(_0x209b7d){var _0x88128e=_0x209b7d[_0x5dbf('0x7')](/\\/g,'/');this['setDataValue'](_0x5dbf('0x4'),_0x88128e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x5dbf('0x8')],'set':function(_0x3bec50){this[_0x5dbf('0x9')](_0x5dbf('0xa'),moment()['subtract'](_0x3bec50,'ms'));this[_0x5dbf('0x9')]('closedAt',moment());this['setDataValue'](_0x5dbf('0xb'),_0x3bec50);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x5dbf('0xa')))['format'](_0x5dbf('0xc'))[_0x5dbf('0xd')]();}},'closedAt':{'type':Sequelize[_0x5dbf('0xe')],'get':function(){return moment(this[_0x5dbf('0x3')](_0x5dbf('0xf')))['format']('MM-DD-YYYY\x20HH:mm')[_0x5dbf('0xd')]();}},'createdAt':{'type':Sequelize[_0x5dbf('0xe')],'get':function(){return moment(this['getDataValue'](_0x5dbf('0x10')))[_0x5dbf('0x11')](_0x5dbf('0xc'))[_0x5dbf('0xd')]();}},'updatedAt':{'type':Sequelize[_0x5dbf('0xe')],'get':function(){return moment(this[_0x5dbf('0x3')](_0x5dbf('0x12')))['format']('MM-DD-YYYY\x20HH:mm')[_0x5dbf('0xd')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index da99692..7218b78 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 _0xae9b=['merge','VIRTUAL','then','include','findAll','rows','catch','params','includeAll','options','find','create','body','duration','closedAt','value','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x2de926,_0x2eb824){var _0x101d17=function(_0x59573e){while(--_0x59573e){_0x2de926['push'](_0x2de926['shift']());}};_0x101d17(++_0x2eb824);}(_0xae9b,0x150));var _0xbae9=function(_0x322a46,_0x2fce48){_0x322a46=_0x322a46-0x0;var _0x2499a4=_0xae9b[_0x322a46];return _0x2499a4;};'use strict';var pdf=require(_0xbae9('0x0'));var emlformat=require(_0xbae9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbae9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbae9('0x3'));var moment=require('moment');var BPromise=require(_0xbae9('0x4'));var Mustache=require(_0xbae9('0x5'));var util=require(_0xbae9('0x6'));var path=require(_0xbae9('0x7'));var sox=require(_0xbae9('0x8'));var csv=require(_0xbae9('0x9'));var ejs=require(_0xbae9('0xa'));var fs=require('fs');var _=require(_0xbae9('0xb'));var squel=require('squel');var crypto=require(_0xbae9('0xc'));var jsforce=require(_0xbae9('0xd'));var deskjs=require(_0xbae9('0xe'));var toCsv=require(_0xbae9('0x9'));var querystring=require(_0xbae9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbae9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbae9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbae9('0x12'))(_0xbae9('0x13'));var utils=require('../../config/utils');var config=require(_0xbae9('0x14'));var db=require(_0xbae9('0x15'))['db'];function respondWithStatusCode(_0x630b00,_0x1ea018){_0x1ea018=_0x1ea018||0xcc;return function(_0xc95615){if(_0xc95615){return _0x630b00[_0xbae9('0x16')](_0x1ea018);}return _0x630b00[_0xbae9('0x17')](_0x1ea018)[_0xbae9('0x18')]();};}function respondWithResult(_0x5e16e2,_0x18bd7a){_0x18bd7a=_0x18bd7a||0xc8;return function(_0x54d9be){if(_0x54d9be){return _0x5e16e2[_0xbae9('0x17')](_0x18bd7a)[_0xbae9('0x19')](_0x54d9be);}};}function respondWithFilteredResult(_0x4bdf79,_0x2b17e5){return function(_0x587ac7){if(_0x587ac7){var _0x1d6dc9=_0x587ac7[_0xbae9('0x1a')],_0x37c5e2=_0x2b17e5[_0xbae9('0x1b')],_0x5dacd1=_0x2b17e5[_0xbae9('0x1b')]+_0x2b17e5[_0xbae9('0x1c')],_0x1f0529;if(_0x5dacd1>=_0x1d6dc9){_0x5dacd1=_0x1d6dc9;_0x1f0529=0xc8;}else{_0x1f0529=0xce;}_0x4bdf79[_0xbae9('0x17')](_0x1f0529);return _0x4bdf79['set']('Content-Range',_0x37c5e2+'-'+_0x5dacd1+'/'+_0x1d6dc9)[_0xbae9('0x19')](_0x587ac7);}return null;};}function patchUpdates(_0x51fd9e){return function(_0x1e6fc7){try{jsonpatch[_0xbae9('0x1d')](_0x1e6fc7,_0x51fd9e,!![]);}catch(_0x53055d){return BPromise[_0xbae9('0x1e')](_0x53055d);}return _0x1e6fc7[_0xbae9('0x1f')]();};}function saveUpdates(_0x369f8f,_0x275692){return function(_0x53ca33){if(_0x53ca33){return _0x53ca33[_0xbae9('0x20')](_0x369f8f)['then'](function(_0x18dee9){return _0x18dee9;});}return null;};}function removeEntity(_0x1eeea8,_0x2c8a60){return function(_0x20e9e5){if(_0x20e9e5){return _0x20e9e5[_0xbae9('0x21')]()['then'](function(){_0x1eeea8[_0xbae9('0x17')](0xcc)[_0xbae9('0x18')]();});}};}function handleEntityNotFound(_0x444c5b,_0x3ae94b){return function(_0x1dfcad){if(!_0x1dfcad){_0x444c5b['sendStatus'](0x194);}return _0x1dfcad;};}function handleError(_0x387c79,_0x2a11ef){_0x2a11ef=_0x2a11ef||0x1f4;return function(_0x275672){logger['error'](_0x275672[_0xbae9('0x22')]);if(_0x275672[_0xbae9('0x23')]){delete _0x275672[_0xbae9('0x23')];}_0x387c79[_0xbae9('0x17')](_0x2a11ef)[_0xbae9('0x24')](_0x275672);};}exports[_0xbae9('0x25')]=function(_0x1de716,_0x52de85){var _0x3d8a2c={},_0x3e55d3={},_0x194427={'count':0x0,'rows':[]};var _0x3f89da=_[_0xbae9('0x26')](db[_0xbae9('0x27')][_0xbae9('0x28')],function(_0xe6047b){return{'name':_0xe6047b[_0xbae9('0x29')],'type':_0xe6047b[_0xbae9('0x2a')][_0xbae9('0x2b')]};});_0x3e55d3[_0xbae9('0x2c')]=_[_0xbae9('0x2d')](_[_0xbae9('0x26')](_0x3f89da,_0xbae9('0x23')),[_0xbae9('0x2e')]);_0x3e55d3['query']=_[_0xbae9('0x2f')](_0x1de716['query']);_0x3e55d3[_0xbae9('0x30')]=_[_0xbae9('0x31')](_0x3e55d3[_0xbae9('0x2c')],_0x3e55d3[_0xbae9('0x32')]);_0x3d8a2c[_0xbae9('0x33')]=_['intersection'](_0x3e55d3[_0xbae9('0x2c')],qs[_0xbae9('0x34')](_0x1de716['query'][_0xbae9('0x34')]));_0x3d8a2c[_0xbae9('0x33')]=_0x3d8a2c[_0xbae9('0x33')][_0xbae9('0x35')]?_0x3d8a2c[_0xbae9('0x33')]:_0x3e55d3['model'];if(!_0x1de716[_0xbae9('0x32')][_0xbae9('0x36')](_0xbae9('0x37'))){_0x3d8a2c[_0xbae9('0x1c')]=qs[_0xbae9('0x1c')](_0x1de716[_0xbae9('0x32')][_0xbae9('0x1c')]);_0x3d8a2c[_0xbae9('0x1b')]=qs[_0xbae9('0x1b')](_0x1de716['query'][_0xbae9('0x1b')]);}_0x3d8a2c[_0xbae9('0x38')]=qs[_0xbae9('0x39')](_0x1de716[_0xbae9('0x32')][_0xbae9('0x39')]);_0x3d8a2c[_0xbae9('0x3a')]=qs[_0xbae9('0x30')](_['pick'](_0x1de716['query'],_0x3e55d3[_0xbae9('0x30')]));if(_0x1de716[_0xbae9('0x32')][_0xbae9('0x3b')]){_0x3d8a2c['where']=_[_0xbae9('0x3c')](_0x3d8a2c[_0xbae9('0x3a')],{'$or':_['map'](_0x3f89da,function(_0x3babf5){if(_0x3babf5['type']!==_0xbae9('0x3d')){var _0x37ea58={};_0x37ea58[_0x3babf5[_0xbae9('0x23')]]={'$like':'%'+_0x1de716[_0xbae9('0x32')][_0xbae9('0x3b')]+'%'};return _0x37ea58;}})});}_0x3d8a2c=_[_0xbae9('0x3c')]({},_0x3d8a2c,_0x1de716['options']);var _0x352f8c={'where':_0x3d8a2c['where']};return db[_0xbae9('0x27')][_0xbae9('0x1a')](_0x352f8c)[_0xbae9('0x3e')](function(_0x804b44){_0x194427[_0xbae9('0x1a')]=_0x804b44;if(_0x1de716[_0xbae9('0x32')]['includeAll']){_0x3d8a2c[_0xbae9('0x3f')]=[{'all':!![]}];}return db[_0xbae9('0x27')][_0xbae9('0x40')](_0x3d8a2c);})[_0xbae9('0x3e')](function(_0x19bd38){_0x194427[_0xbae9('0x41')]=_0x19bd38;return _0x194427;})[_0xbae9('0x3e')](respondWithFilteredResult(_0x52de85,_0x3d8a2c))[_0xbae9('0x42')](handleError(_0x52de85,null));};exports['show']=function(_0x4f7018,_0x3aafed){var _0x4098a8={'raw':![],'where':{'id':_0x4f7018[_0xbae9('0x43')]['id']}},_0x10661c={};_0x10661c[_0xbae9('0x2c')]=_[_0xbae9('0x2f')](db['ScreenRecording'][_0xbae9('0x28')]);_0x10661c['query']=_[_0xbae9('0x2f')](_0x4f7018[_0xbae9('0x32')]);_0x10661c[_0xbae9('0x30')]=_[_0xbae9('0x31')](_0x10661c[_0xbae9('0x2c')],_0x10661c[_0xbae9('0x32')]);_0x4098a8[_0xbae9('0x33')]=_[_0xbae9('0x31')](_0x10661c[_0xbae9('0x2c')],qs[_0xbae9('0x34')](_0x4f7018['query'][_0xbae9('0x34')]));_0x4098a8[_0xbae9('0x33')]=_0x4098a8[_0xbae9('0x33')][_0xbae9('0x35')]?_0x4098a8[_0xbae9('0x33')]:_0x10661c[_0xbae9('0x2c')];if(_0x4f7018[_0xbae9('0x32')][_0xbae9('0x44')]){_0x4098a8['include']=[{'all':!![]}];}_0x4098a8=_['merge']({},_0x4098a8,_0x4f7018[_0xbae9('0x45')]);return db[_0xbae9('0x27')][_0xbae9('0x46')](_0x4098a8)[_0xbae9('0x3e')](handleEntityNotFound(_0x3aafed,null))[_0xbae9('0x3e')](respondWithResult(_0x3aafed,null))[_0xbae9('0x42')](handleError(_0x3aafed,null));};exports['create']=function(_0x1e0d71,_0x1cbdf8){return db[_0xbae9('0x27')][_0xbae9('0x47')](_0x1e0d71['body'],{})[_0xbae9('0x3e')](respondWithResult(_0x1cbdf8,0xc9))['catch'](handleError(_0x1cbdf8,null));};exports[_0xbae9('0x20')]=function(_0x46b667,_0x4878a9){if(_0x46b667[_0xbae9('0x48')]['id']){delete _0x46b667[_0xbae9('0x48')]['id'];}delete _0x46b667[_0xbae9('0x48')][_0xbae9('0x49')];delete _0x46b667[_0xbae9('0x48')]['createdAt'];delete _0x46b667[_0xbae9('0x48')][_0xbae9('0x4a')];delete _0x46b667['body'][_0xbae9('0x4b')];return db[_0xbae9('0x27')][_0xbae9('0x46')]({'where':{'id':_0x46b667[_0xbae9('0x43')]['id']}})[_0xbae9('0x3e')](handleEntityNotFound(_0x4878a9,null))[_0xbae9('0x3e')](saveUpdates(_0x46b667['body'],null))[_0xbae9('0x3e')](respondWithResult(_0x4878a9,null))[_0xbae9('0x42')](handleError(_0x4878a9,null));};exports[_0xbae9('0x4c')]=function(_0x4acb6f,_0x651477){return db[_0xbae9('0x27')]['describe']()['then'](respondWithResult(_0x651477,null))[_0xbae9('0x42')](handleError(_0x651477,null));};exports[_0xbae9('0x4d')]=function(_0x512c12,_0x501cf0,_0x9af38){var _0x102d5d=require('../../components/encryptor');var _0x60178=![];var _0x26e160={};if(_0x512c12[_0xbae9('0x32')][_0xbae9('0x2a')]&&_0x512c12[_0xbae9('0x32')][_0xbae9('0x2a')]===_0xbae9('0x4e')){_0x26e160[_0xbae9('0x4e')]=_0x512c12[_0xbae9('0x43')]['id'];}else{_0x26e160['id']=_0x512c12[_0xbae9('0x43')]['id'];}return db[_0xbae9('0x27')][_0xbae9('0x46')]({'where':_0x26e160,'attributes':['id',_0xbae9('0x4b')],'raw':!![]})[_0xbae9('0x3e')](handleEntityNotFound(_0x501cf0,null))[_0xbae9('0x3e')](function(_0x1453d1){if(_0x1453d1){var _0x22d9af=path[_0xbae9('0x4f')](config[_0xbae9('0x50')],_0xbae9('0x51'),_0x1453d1['value']);var _0x49c967=util[_0xbae9('0x2e')](_0xbae9('0x52'),_0x22d9af);if(fs[_0xbae9('0x53')](_0x49c967)){_0x60178=!![];return _0x102d5d['decryptFile'](_0x49c967,_0x22d9af,config[_0xbae9('0x54')][_0xbae9('0x55')])['then'](function(){return _0x1453d1;});}return _0x1453d1;}})[_0xbae9('0x3e')](function(_0x2d1459){if(_0x2d1459){var _0x579787=path[_0xbae9('0x4f')](config[_0xbae9('0x50')],_0xbae9('0x51'),_0x2d1459['value']);if(!fs['existsSync'](_0x579787)){throw new db['Sequelize']['ValidationError'](_0xbae9('0x56'));}if(_0x2d1459[_0xbae9('0x57')]){return _0x501cf0['download'](_0x579787,_0x2d1459['filename']+path[_0xbae9('0x58')](_0x579787),function(){if(_0x60178){fs[_0xbae9('0x59')](_0x579787);}});}else{return _0x501cf0[_0xbae9('0x4d')](_0x579787,function(_0x25dbac){if(_0x60178){fs[_0xbae9('0x59')](_0x579787);}});}}})[_0xbae9('0x42')](function(_0xaf7921){if(_0xaf7921[_0xbae9('0x5a')]==='ScreenRecording\x20not\x20found'){_0x501cf0[_0xbae9('0x17')](0x194)[_0xbae9('0x24')](_0xbae9('0x5b'));}else{return handleError(_0x501cf0,null);}});};exports[_0xbae9('0x21')]=function(_0x32ba22,_0x376ed7){return db[_0xbae9('0x27')][_0xbae9('0x46')]({'where':{'id':_0x32ba22[_0xbae9('0x43')]['id']}})[_0xbae9('0x3e')](function(_0x2127e5){if(!_0x2127e5)throw new ReferenceError('Entity\x20not\x20found');return _0x2127e5;})[_0xbae9('0x3e')](function(_0x50a87f){var _0x2f1ce5=path[_0xbae9('0x4f')](config[_0xbae9('0x50')],_0xbae9('0x51'),_0x50a87f[_0xbae9('0x4b')]);logger[_0xbae9('0x5c')](_0xbae9('0x5d'),_0x2f1ce5);if(!_[_0xbae9('0x5e')](_0x50a87f[_0xbae9('0x4b')])&&fs['existsSync'](_0x2f1ce5)){logger[_0xbae9('0x5c')](_0xbae9('0x5f')+_0x2f1ce5+_0xbae9('0x60'));fs['unlinkSync'](_0x2f1ce5);}_0x2f1ce5=_0x2f1ce5+_0xbae9('0x61');if(!_[_0xbae9('0x5e')](_0x50a87f[_0xbae9('0x4b')])&&fs[_0xbae9('0x53')](_0x2f1ce5)){logger[_0xbae9('0x5c')](_0xbae9('0x5f')+_0x2f1ce5+_0xbae9('0x60'));fs[_0xbae9('0x62')](_0x2f1ce5);}return _0x50a87f;})[_0xbae9('0x3e')](function(_0x5e271e){if(!_0x5e271e)throw new InternalError();return _0x5e271e[_0xbae9('0x21')]();})['then'](function(){_0x376ed7[_0xbae9('0x17')](0xcc)['end']();})[_0xbae9('0x42')](handleError(_0x376ed7,null));}; \ No newline at end of file +var _0xa1ad=['send','index','map','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','count','includeAll','include','findAll','rows','show','keys','find','catch','create','body','createdAt','params','describe','download','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name'];(function(_0x4e170e,_0x207e58){var _0x338291=function(_0x4cb198){while(--_0x4cb198){_0x4e170e['push'](_0x4e170e['shift']());}};_0x338291(++_0x207e58);}(_0xa1ad,0x1e9));var _0xda1a=function(_0x51b661,_0x566ef8){_0x51b661=_0x51b661-0x0;var _0x5d1971=_0xa1ad[_0x51b661];return _0x5d1971;};'use strict';var pdf=require(_0xda1a('0x0'));var emlformat=require(_0xda1a('0x1'));var rimraf=require(_0xda1a('0x2'));var zipdir=require(_0xda1a('0x3'));var jsonpatch=require(_0xda1a('0x4'));var rp=require(_0xda1a('0x5'));var moment=require(_0xda1a('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xda1a('0x7'));var util=require(_0xda1a('0x8'));var path=require(_0xda1a('0x9'));var sox=require('sox');var csv=require(_0xda1a('0xa'));var ejs=require(_0xda1a('0xb'));var fs=require('fs');var _=require(_0xda1a('0xc'));var squel=require(_0xda1a('0xd'));var crypto=require(_0xda1a('0xe'));var jsforce=require(_0xda1a('0xf'));var deskjs=require(_0xda1a('0x10'));var toCsv=require(_0xda1a('0xa'));var querystring=require(_0xda1a('0x11'));var Papa=require('papaparse');var Redis=require(_0xda1a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xda1a('0x13'));var as=require(_0xda1a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda1a('0x15'))('api');var utils=require(_0xda1a('0x16'));var config=require(_0xda1a('0x17'));var db=require(_0xda1a('0x18'))['db'];function respondWithStatusCode(_0x3ba43e,_0x47043b){_0x47043b=_0x47043b||0xcc;return function(_0x4b7cbc){if(_0x4b7cbc){return _0x3ba43e['sendStatus'](_0x47043b);}return _0x3ba43e[_0xda1a('0x19')](_0x47043b)[_0xda1a('0x1a')]();};}function respondWithResult(_0x563def,_0x511267){_0x511267=_0x511267||0xc8;return function(_0x30cf02){if(_0x30cf02){return _0x563def[_0xda1a('0x19')](_0x511267)[_0xda1a('0x1b')](_0x30cf02);}};}function respondWithFilteredResult(_0x910136,_0x596106){return function(_0x1407a7){if(_0x1407a7){var _0x5bad24=_0x1407a7['count'],_0x35eb81=_0x596106[_0xda1a('0x1c')],_0x51ead5=_0x596106['offset']+_0x596106[_0xda1a('0x1d')],_0x2e165b;if(_0x51ead5>=_0x5bad24){_0x51ead5=_0x5bad24;_0x2e165b=0xc8;}else{_0x2e165b=0xce;}_0x910136['status'](_0x2e165b);return _0x910136[_0xda1a('0x1e')](_0xda1a('0x1f'),_0x35eb81+'-'+_0x51ead5+'/'+_0x5bad24)[_0xda1a('0x1b')](_0x1407a7);}return null;};}function patchUpdates(_0x41101f){return function(_0x3cee48){try{jsonpatch[_0xda1a('0x20')](_0x3cee48,_0x41101f,!![]);}catch(_0x1aa4bb){return BPromise[_0xda1a('0x21')](_0x1aa4bb);}return _0x3cee48['save']();};}function saveUpdates(_0x2c7994,_0xdd36fa){return function(_0x2aea2f){if(_0x2aea2f){return _0x2aea2f[_0xda1a('0x22')](_0x2c7994)[_0xda1a('0x23')](function(_0x4b5ecd){return _0x4b5ecd;});}return null;};}function removeEntity(_0x40778a,_0x4a4b74){return function(_0x473f6c){if(_0x473f6c){return _0x473f6c[_0xda1a('0x24')]()[_0xda1a('0x23')](function(){_0x40778a[_0xda1a('0x19')](0xcc)[_0xda1a('0x1a')]();});}};}function handleEntityNotFound(_0x42116f,_0x1f58c7){return function(_0x305d8a){if(!_0x305d8a){_0x42116f[_0xda1a('0x25')](0x194);}return _0x305d8a;};}function handleError(_0x2c48d4,_0x543be3){_0x543be3=_0x543be3||0x1f4;return function(_0x58b29c){logger[_0xda1a('0x26')](_0x58b29c[_0xda1a('0x27')]);if(_0x58b29c[_0xda1a('0x28')]){delete _0x58b29c['name'];}_0x2c48d4[_0xda1a('0x19')](_0x543be3)[_0xda1a('0x29')](_0x58b29c);};}exports[_0xda1a('0x2a')]=function(_0x4bf776,_0x2764ca){var _0x357750={},_0x39dc62={},_0x16dddd={'count':0x0,'rows':[]};var _0x32492c=_[_0xda1a('0x2b')](db['ScreenRecording'][_0xda1a('0x2c')],function(_0x5d918a){return{'name':_0x5d918a[_0xda1a('0x2d')],'type':_0x5d918a[_0xda1a('0x2e')][_0xda1a('0x2f')]};});_0x39dc62['model']=_[_0xda1a('0x30')](_[_0xda1a('0x2b')](_0x32492c,_0xda1a('0x28')),['format']);_0x39dc62[_0xda1a('0x31')]=_['keys'](_0x4bf776[_0xda1a('0x31')]);_0x39dc62[_0xda1a('0x32')]=_[_0xda1a('0x33')](_0x39dc62[_0xda1a('0x34')],_0x39dc62[_0xda1a('0x31')]);_0x357750[_0xda1a('0x35')]=_[_0xda1a('0x33')](_0x39dc62[_0xda1a('0x34')],qs[_0xda1a('0x36')](_0x4bf776[_0xda1a('0x31')][_0xda1a('0x36')]));_0x357750['attributes']=_0x357750['attributes'][_0xda1a('0x37')]?_0x357750[_0xda1a('0x35')]:_0x39dc62[_0xda1a('0x34')];if(!_0x4bf776[_0xda1a('0x31')]['hasOwnProperty'](_0xda1a('0x38'))){_0x357750[_0xda1a('0x1d')]=qs[_0xda1a('0x1d')](_0x4bf776['query'][_0xda1a('0x1d')]);_0x357750[_0xda1a('0x1c')]=qs[_0xda1a('0x1c')](_0x4bf776['query']['offset']);}_0x357750[_0xda1a('0x39')]=qs[_0xda1a('0x3a')](_0x4bf776['query']['sort']);_0x357750[_0xda1a('0x3b')]=qs[_0xda1a('0x32')](_[_0xda1a('0x3c')](_0x4bf776[_0xda1a('0x31')],_0x39dc62[_0xda1a('0x32')]));if(_0x4bf776[_0xda1a('0x31')][_0xda1a('0x3d')]){_0x357750[_0xda1a('0x3b')]=_[_0xda1a('0x3e')](_0x357750['where'],{'$or':_[_0xda1a('0x2b')](_0x32492c,function(_0x1ea62e){if(_0x1ea62e[_0xda1a('0x2e')]!==_0xda1a('0x3f')){var _0x1fbfd7={};_0x1fbfd7[_0x1ea62e['name']]={'$like':'%'+_0x4bf776[_0xda1a('0x31')][_0xda1a('0x3d')]+'%'};return _0x1fbfd7;}})});}_0x357750=_[_0xda1a('0x3e')]({},_0x357750,_0x4bf776[_0xda1a('0x40')]);var _0x279bf8={'where':_0x357750[_0xda1a('0x3b')]};return db[_0xda1a('0x41')][_0xda1a('0x42')](_0x279bf8)[_0xda1a('0x23')](function(_0x523929){_0x16dddd[_0xda1a('0x42')]=_0x523929;if(_0x4bf776[_0xda1a('0x31')][_0xda1a('0x43')]){_0x357750[_0xda1a('0x44')]=[{'all':!![]}];}return db[_0xda1a('0x41')][_0xda1a('0x45')](_0x357750);})[_0xda1a('0x23')](function(_0x50f80f){_0x16dddd[_0xda1a('0x46')]=_0x50f80f;return _0x16dddd;})[_0xda1a('0x23')](respondWithFilteredResult(_0x2764ca,_0x357750))['catch'](handleError(_0x2764ca,null));};exports[_0xda1a('0x47')]=function(_0x6b84e5,_0x3a8f3d){var _0x523e78={'raw':![],'where':{'id':_0x6b84e5['params']['id']}},_0x48f96e={};_0x48f96e[_0xda1a('0x34')]=_[_0xda1a('0x48')](db['ScreenRecording']['rawAttributes']);_0x48f96e[_0xda1a('0x31')]=_['keys'](_0x6b84e5[_0xda1a('0x31')]);_0x48f96e[_0xda1a('0x32')]=_[_0xda1a('0x33')](_0x48f96e[_0xda1a('0x34')],_0x48f96e[_0xda1a('0x31')]);_0x523e78['attributes']=_[_0xda1a('0x33')](_0x48f96e[_0xda1a('0x34')],qs[_0xda1a('0x36')](_0x6b84e5[_0xda1a('0x31')]['fields']));_0x523e78[_0xda1a('0x35')]=_0x523e78['attributes']['length']?_0x523e78['attributes']:_0x48f96e[_0xda1a('0x34')];if(_0x6b84e5[_0xda1a('0x31')][_0xda1a('0x43')]){_0x523e78[_0xda1a('0x44')]=[{'all':!![]}];}_0x523e78=_[_0xda1a('0x3e')]({},_0x523e78,_0x6b84e5[_0xda1a('0x40')]);return db[_0xda1a('0x41')][_0xda1a('0x49')](_0x523e78)['then'](handleEntityNotFound(_0x3a8f3d,null))[_0xda1a('0x23')](respondWithResult(_0x3a8f3d,null))[_0xda1a('0x4a')](handleError(_0x3a8f3d,null));};exports[_0xda1a('0x4b')]=function(_0x4b89a6,_0x3c107f){return db[_0xda1a('0x41')][_0xda1a('0x4b')](_0x4b89a6[_0xda1a('0x4c')],{})[_0xda1a('0x23')](respondWithResult(_0x3c107f,0xc9))[_0xda1a('0x4a')](handleError(_0x3c107f,null));};exports[_0xda1a('0x22')]=function(_0x1c0a50,_0x5ea30e){if(_0x1c0a50[_0xda1a('0x4c')]['id']){delete _0x1c0a50['body']['id'];}delete _0x1c0a50[_0xda1a('0x4c')]['duration'];delete _0x1c0a50[_0xda1a('0x4c')][_0xda1a('0x4d')];delete _0x1c0a50[_0xda1a('0x4c')]['closedAt'];delete _0x1c0a50[_0xda1a('0x4c')]['value'];return db[_0xda1a('0x41')][_0xda1a('0x49')]({'where':{'id':_0x1c0a50[_0xda1a('0x4e')]['id']}})[_0xda1a('0x23')](handleEntityNotFound(_0x5ea30e,null))['then'](saveUpdates(_0x1c0a50[_0xda1a('0x4c')],null))[_0xda1a('0x23')](respondWithResult(_0x5ea30e,null))[_0xda1a('0x4a')](handleError(_0x5ea30e,null));};exports['describe']=function(_0x544e9e,_0x414931){return db[_0xda1a('0x41')][_0xda1a('0x4f')]()[_0xda1a('0x23')](respondWithResult(_0x414931,null))['catch'](handleError(_0x414931,null));};exports[_0xda1a('0x50')]=function(_0x505b6d,_0x4e21e0,_0x57a738){var _0x2e6b9d=require(_0xda1a('0x51'));var _0x3a6243=![];var _0x47b75f={};if(_0x505b6d[_0xda1a('0x31')][_0xda1a('0x2e')]&&_0x505b6d[_0xda1a('0x31')][_0xda1a('0x2e')]===_0xda1a('0x52')){_0x47b75f[_0xda1a('0x52')]=_0x505b6d['params']['id'];}else{_0x47b75f['id']=_0x505b6d[_0xda1a('0x4e')]['id'];}return db[_0xda1a('0x41')][_0xda1a('0x49')]({'where':_0x47b75f,'attributes':['id',_0xda1a('0x53')],'raw':!![]})[_0xda1a('0x23')](handleEntityNotFound(_0x4e21e0,null))['then'](function(_0x368c0d){if(_0x368c0d){var _0x5036bf=path[_0xda1a('0x54')](config[_0xda1a('0x55')],_0xda1a('0x56'),_0x368c0d[_0xda1a('0x53')]);var _0x462009=util['format'](_0xda1a('0x57'),_0x5036bf);if(fs[_0xda1a('0x58')](_0x462009)){_0x3a6243=!![];return _0x2e6b9d['decryptFile'](_0x462009,_0x5036bf,config[_0xda1a('0x59')][_0xda1a('0x5a')])['then'](function(){return _0x368c0d;});}return _0x368c0d;}})['then'](function(_0x4aef73){if(_0x4aef73){var _0x3642b6=path[_0xda1a('0x54')](config['root'],'server/files/screen_recordings',_0x4aef73[_0xda1a('0x53')]);if(!fs[_0xda1a('0x58')](_0x3642b6)){throw new db[(_0xda1a('0x5b'))][(_0xda1a('0x5c'))](_0xda1a('0x5d'));}if(_0x4aef73[_0xda1a('0x5e')]){return _0x4e21e0[_0xda1a('0x50')](_0x3642b6,_0x4aef73['filename']+path[_0xda1a('0x5f')](_0x3642b6),function(){if(_0x3a6243){fs[_0xda1a('0x60')](_0x3642b6);}});}else{return _0x4e21e0[_0xda1a('0x50')](_0x3642b6,function(_0x2bf028){if(_0x3a6243){fs['unlink'](_0x3642b6);}});}}})[_0xda1a('0x4a')](function(_0x4e0f8d){if(_0x4e0f8d[_0xda1a('0x61')]===_0xda1a('0x5d')){_0x4e21e0['status'](0x194)['send'](_0xda1a('0x62'));}else{return handleError(_0x4e21e0,null);}});};exports[_0xda1a('0x24')]=function(_0x301381,_0x8feee4){return db[_0xda1a('0x41')]['find']({'where':{'id':_0x301381['params']['id']}})[_0xda1a('0x23')](function(_0x368623){if(!_0x368623)throw new ReferenceError(_0xda1a('0x63'));return _0x368623;})['then'](function(_0x21716a){var _0x3b9915=path['join'](config[_0xda1a('0x55')],_0xda1a('0x56'),_0x21716a['value']);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x3b9915);if(!_[_0xda1a('0x64')](_0x21716a[_0xda1a('0x53')])&&fs[_0xda1a('0x58')](_0x3b9915)){logger[_0xda1a('0x65')](_0xda1a('0x66')+_0x3b9915+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xda1a('0x67')](_0x3b9915);}_0x3b9915=_0x3b9915+_0xda1a('0x68');if(!_['isNil'](_0x21716a[_0xda1a('0x53')])&&fs[_0xda1a('0x58')](_0x3b9915)){logger[_0xda1a('0x65')](_0xda1a('0x66')+_0x3b9915+_0xda1a('0x69'));fs['unlinkSync'](_0x3b9915);}return _0x21716a;})[_0xda1a('0x23')](function(_0x2b26f3){if(!_0x2b26f3)throw new InternalError();return _0x2b26f3[_0xda1a('0x24')]();})['then'](function(){_0x8feee4[_0xda1a('0x19')](0xcc)[_0xda1a('0x1a')]();})[_0xda1a('0x4a')](handleError(_0x8feee4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index f77f15c..a6bca24 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 _0xf4ad=['interactionid','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','define','screen_recordings'];(function(_0x3c715a,_0x632b85){var _0x5737a3=function(_0x24496c){while(--_0x24496c){_0x3c715a['push'](_0x3c715a['shift']());}};_0x5737a3(++_0x632b85);}(_0xf4ad,0x119));var _0xdf4a=function(_0x5650b4,_0x2723ba){_0x5650b4=_0x5650b4-0x0;var _0x297a62=_0xf4ad[_0x5650b4];return _0x297a62;};'use strict';var _=require(_0xdf4a('0x0'));var util=require(_0xdf4a('0x1'));var logger=require(_0xdf4a('0x2'))(_0xdf4a('0x3'));var moment=require(_0xdf4a('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf4a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdf4a('0x6'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x6c15b,_0x290637){return _0x6c15b[_0xdf4a('0x7')]('ScreenRecording',attributes,{'tableName':_0xdf4a('0x8'),'paranoid':![],'indexes':[{'name':_0xdf4a('0x9'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc186=['rimraf','../../config/environment','exports','define','ScreenRecording','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc186,0x1b3));var _0x6c18=function(_0x144da3,_0x4b7fca){_0x144da3=_0x144da3-0x0;var _0x3874f4=_0xc186[_0x144da3];return _0x3874f4;};'use strict';var _=require(_0x6c18('0x0'));var util=require(_0x6c18('0x1'));var logger=require(_0x6c18('0x2'))(_0x6c18('0x3'));var moment=require(_0x6c18('0x4'));var BPromise=require(_0x6c18('0x5'));var rp=require(_0x6c18('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c18('0x7'));var config=require(_0x6c18('0x8'));var attributes=require('./screenRecording.attributes');module[_0x6c18('0x9')]=function(_0x35d88c,_0x56f555){return _0x35d88c[_0x6c18('0xa')](_0x6c18('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x6c18('0xc'),'fields':[_0x6c18('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 8b06cb3..29599fa 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(_0x17974c,_0x1947b7){var _0x353f2f=function(_0x139ad9){while(--_0x139ad9){_0x17974c['push'](_0x17974c['shift']());}};_0x353f2f(++_0x1947b7);}(_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 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(_0x41a348,_0x34987c){var _0x5e79f2=function(_0x3e8235){while(--_0x3e8235){_0x41a348['push'](_0x41a348['shift']());}};_0x5e79f2(++_0x34987c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 3209cee..dc6f547 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 _0x1dae=['gdpr','/:id/preferred','getPreferred','getFavicon','join','root','%s%s','logo','extname','originalname','single','file','addLogo','diskStorage','server/files/images/logos/','logologin','post','addLogoLogin','format','preferred','addPreferred','favicon','/:id/favicon','addFavicon','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','/:id','/:id/logo','getLogoLogin','/:id/gdpr'];(function(_0x5c85c8,_0x16110b){var _0x42d66f=function(_0x2c6dda){while(--_0x2c6dda){_0x5c85c8['push'](_0x5c85c8['shift']());}};_0x42d66f(++_0x16110b);}(_0x1dae,0xb4));var _0xe1da=function(_0x4e37b9,_0x267171){_0x4e37b9=_0x4e37b9-0x0;var _0x6dafe8=_0x1dae[_0x4e37b9];return _0x6dafe8;};'use strict';var multer=require(_0xe1da('0x0'));var util=require(_0xe1da('0x1'));var path=require(_0xe1da('0x2'));var timeout=require(_0xe1da('0x3'));var express=require(_0xe1da('0x4'));var router=express[_0xe1da('0x5')]();var auth=require(_0xe1da('0x6'));var interaction=require(_0xe1da('0x7'));var config=require('../../config/environment');var controller=require(_0xe1da('0x8'));router[_0xe1da('0x9')]('/',auth[_0xe1da('0xa')](),controller['index']);router[_0xe1da('0x9')](_0xe1da('0xb'),controller['show']);router[_0xe1da('0x9')](_0xe1da('0xc'),controller['getLogo']);router['get']('/:id/logo_login',controller[_0xe1da('0xd')]);router['get'](_0xe1da('0xe'),controller[_0xe1da('0xf')]);router[_0xe1da('0x9')](_0xe1da('0x10'),controller[_0xe1da('0x11')]);router[_0xe1da('0x9')]('/:id/favicon',controller[_0xe1da('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c4bde,_0x4b9d64,_0x258461){_0x258461(null,path[_0xe1da('0x13')](config[_0xe1da('0x14')],'server/files/images/logos/'));},'filename':function(_0x53c4d7,_0x1b177b,_0x2ceefd){_0x2ceefd(null,util['format'](_0xe1da('0x15'),_0xe1da('0x16'),path[_0xe1da('0x17')](_0x1b177b[_0xe1da('0x18')])));}})});router['post'](_0xe1da('0xc'),upload[_0xe1da('0x19')](_0xe1da('0x1a')),controller[_0xe1da('0x1b')]);var upload=multer({'storage':multer[_0xe1da('0x1c')]({'destination':function(_0x5b653d,_0x2c5deb,_0x4f10b3){_0x4f10b3(null,path[_0xe1da('0x13')](config[_0xe1da('0x14')],_0xe1da('0x1d')));},'filename':function(_0x3aa97d,_0x241dc6,_0x15087c){_0x15087c(null,util['format']('%s%s',_0xe1da('0x1e'),path[_0xe1da('0x17')](_0x241dc6[_0xe1da('0x18')])));}})});router[_0xe1da('0x1f')]('/:id/logo_login',upload[_0xe1da('0x19')](_0xe1da('0x1a')),controller[_0xe1da('0x20')]);var upload=multer({'storage':multer[_0xe1da('0x1c')]({'destination':function(_0x7a8232,_0x19871e,_0x185a8a){_0x185a8a(null,path[_0xe1da('0x13')](config[_0xe1da('0x14')],'server/files/images/logos/'));},'filename':function(_0x45e314,_0x12178b,_0x1ae60b){_0x1ae60b(null,util[_0xe1da('0x21')](_0xe1da('0x15'),_0xe1da('0x22'),path[_0xe1da('0x17')](_0x12178b[_0xe1da('0x18')])));}})});router[_0xe1da('0x1f')](_0xe1da('0x10'),upload['single'](_0xe1da('0x1a')),controller[_0xe1da('0x23')]);var upload=multer({'storage':multer[_0xe1da('0x1c')]({'destination':function(_0xd7e182,_0xe973d8,_0xe9b627){_0xe9b627(null,path[_0xe1da('0x13')](config['root'],'server/files/images/logos/'));},'filename':function(_0x4e7fdd,_0x46a334,_0x4c5b98){_0x4c5b98(null,util[_0xe1da('0x21')](_0xe1da('0x15'),_0xe1da('0x24'),path[_0xe1da('0x17')](_0x46a334[_0xe1da('0x18')])));}})});router[_0xe1da('0x1f')](_0xe1da('0x25'),upload[_0xe1da('0x19')](_0xe1da('0x1a')),controller[_0xe1da('0x26')]);router['put'](_0xe1da('0xb'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xe66f=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/:id/logo','getLogo','/:id/logo_login','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','root','server/files/images/logos/','format','%s%s','extname','originalname','single','file','addLogo','join','logologin','post','addLogoLogin','diskStorage','favicon','addFavicon','/:id','update'];(function(_0x18f72d,_0x5b26c5){var _0x252d08=function(_0x4965ac){while(--_0x4965ac){_0x18f72d['push'](_0x18f72d['shift']());}};_0x252d08(++_0x5b26c5);}(_0xe66f,0x112));var _0xfe66=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xe66f[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0xfe66('0x0'));var util=require(_0xfe66('0x1'));var path=require(_0xfe66('0x2'));var timeout=require(_0xfe66('0x3'));var express=require(_0xfe66('0x4'));var router=express[_0xfe66('0x5')]();var auth=require(_0xfe66('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfe66('0x7'));var controller=require(_0xfe66('0x8'));router['get']('/',auth[_0xfe66('0x9')](),controller[_0xfe66('0xa')]);router[_0xfe66('0xb')]('/:id',controller['show']);router[_0xfe66('0xb')](_0xfe66('0xc'),controller[_0xfe66('0xd')]);router['get'](_0xfe66('0xe'),controller['getLogoLogin']);router['get']('/:id/gdpr',controller[_0xfe66('0xf')]);router[_0xfe66('0xb')](_0xfe66('0x10'),controller[_0xfe66('0x11')]);router['get'](_0xfe66('0x12'),controller[_0xfe66('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3658f4,_0x302990,_0x27b528){_0x27b528(null,path['join'](config[_0xfe66('0x14')],_0xfe66('0x15')));},'filename':function(_0x3ce747,_0x59b269,_0x149026){_0x149026(null,util[_0xfe66('0x16')](_0xfe66('0x17'),'logo',path[_0xfe66('0x18')](_0x59b269[_0xfe66('0x19')])));}})});router['post']('/:id/logo',upload[_0xfe66('0x1a')](_0xfe66('0x1b')),controller[_0xfe66('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b71f3,_0x169327,_0x113c59){_0x113c59(null,path[_0xfe66('0x1d')](config['root'],_0xfe66('0x15')));},'filename':function(_0x152411,_0x49978e,_0xc246fc){_0xc246fc(null,util['format'](_0xfe66('0x17'),_0xfe66('0x1e'),path[_0xfe66('0x18')](_0x49978e[_0xfe66('0x19')])));}})});router[_0xfe66('0x1f')](_0xfe66('0xe'),upload[_0xfe66('0x1a')]('file'),controller[_0xfe66('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1104c6,_0x3d0919,_0x49a03c){_0x49a03c(null,path['join'](config[_0xfe66('0x14')],_0xfe66('0x15')));},'filename':function(_0x51d8a5,_0x59ec26,_0xcb7343){_0xcb7343(null,util[_0xfe66('0x16')](_0xfe66('0x17'),'preferred',path[_0xfe66('0x18')](_0x59ec26[_0xfe66('0x19')])));}})});router[_0xfe66('0x1f')](_0xfe66('0x10'),upload['single'](_0xfe66('0x1b')),controller['addPreferred']);var upload=multer({'storage':multer[_0xfe66('0x21')]({'destination':function(_0x37c589,_0x2b1ead,_0x3d6ac8){_0x3d6ac8(null,path[_0xfe66('0x1d')](config[_0xfe66('0x14')],_0xfe66('0x15')));},'filename':function(_0x37b9c3,_0xd8592f,_0x194435){_0x194435(null,util[_0xfe66('0x16')]('%s%s',_0xfe66('0x22'),path['extname'](_0xd8592f[_0xfe66('0x19')])));}})});router['post']('/:id/favicon',upload[_0xfe66('0x1a')](_0xfe66('0x1b')),controller[_0xfe66('0x23')]);router['put'](_0xfe66('0x24'),auth[_0xfe66('0x9')](),controller[_0xfe66('0x25')]);module[_0xfe66('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 76d64da..b48da91 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 _0x1c90=['alternate','sequelize','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x3df6cd,_0x18fa3b){var _0x214fa8=function(_0xabc1b1){while(--_0xabc1b1){_0x3df6cd['push'](_0x3df6cd['shift']());}};_0x214fa8(++_0x18fa3b);}(_0x1c90,0xd9));var _0x01c9=function(_0x455f6d,_0x398feb){_0x455f6d=_0x455f6d-0x0;var _0x4f3077=_0x1c90[_0x455f6d];return _0x4f3077;};'use strict';var Sequelize=require(_0x01c9('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x01c9('0x1')](0xb),'unique':_0x01c9('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x01c9('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x01c9('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x01c9('0x4')],'defaultValue':_0x01c9('0x5')},'logo':{'type':Sequelize[_0x01c9('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x01c9('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x01c9('0x4')]},'turnpassword':{'type':Sequelize[_0x01c9('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x01c9('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x01c9('0x4')],'defaultValue':_0x01c9('0x7')},'chatTimeout':{'type':Sequelize[_0x01c9('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x01c9('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x01c9('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x01c9('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x01c9('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x9db8=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize'];(function(_0x133f29,_0x4ea93b){var _0x3e5f82=function(_0x8e7bfa){while(--_0x8e7bfa){_0x133f29['push'](_0x133f29['shift']());}};_0x3e5f82(++_0x4ea93b);}(_0x9db8,0x157));var _0x89db=function(_0x3e6647,_0x2c0d09){_0x3e6647=_0x3e6647-0x0;var _0x46bddd=_0x9db8[_0x3e6647];return _0x46bddd;};'use strict';var Sequelize=require(_0x89db('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x89db('0x1')](0xb),'unique':_0x89db('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x89db('0x1')](0xb),'unique':_0x89db('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x89db('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x89db('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x89db('0x4')]},'defaultLogo':{'type':Sequelize[_0x89db('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x89db('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x89db('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x89db('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x89db('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x89db('0x4')]},'turnusername':{'type':Sequelize[_0x89db('0x4')]},'turnpassword':{'type':Sequelize[_0x89db('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x89db('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x89db('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x89db('0x6')},'enableEmailPreview':{'type':Sequelize[_0x89db('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x89db('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x89db('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x89db('0x4')],'defaultValue':_0x89db('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x89db('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x89db('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x89db('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x89db('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x89db('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x89db('0x4')]},'defaultFavicon':{'type':Sequelize[_0x89db('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize[_0x89db('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index f0463d0..c5d2270 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 _0x18a6=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','params','length','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','root','upperFirst','custom','default_logo.png','\x20not\x20found','download','getLogoLogin','join','default_loginLogo.png','default','gdpr','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','limit','set','Content-Range','save','update','destroy','name','index','map','Setting','rawAttributes','fieldName','type','model','query','keys'];(function(_0x3bb1d3,_0x36e8ad){var _0x449316=function(_0x17199b){while(--_0x17199b){_0x3bb1d3['push'](_0x3bb1d3['shift']());}};_0x449316(++_0x36e8ad);}(_0x18a6,0x190));var _0x618a=function(_0x3f8f7a,_0x9d13d){_0x3f8f7a=_0x3f8f7a-0x0;var _0x1718f2=_0x18a6[_0x3f8f7a];return _0x1718f2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x618a('0x0'));var zipdir=require(_0x618a('0x1'));var jsonpatch=require(_0x618a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x618a('0x3'));var Mustache=require(_0x618a('0x4'));var util=require(_0x618a('0x5'));var path=require('path');var sox=require(_0x618a('0x6'));var csv=require(_0x618a('0x7'));var ejs=require(_0x618a('0x8'));var fs=require('fs');var _=require(_0x618a('0x9'));var squel=require(_0x618a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x618a('0xb'));var toCsv=require(_0x618a('0x7'));var querystring=require('querystring');var Papa=require(_0x618a('0xc'));var Redis=require(_0x618a('0xd'));var authService=require(_0x618a('0xe'));var qs=require(_0x618a('0xf'));var as=require(_0x618a('0x10'));var hardwareService=require(_0x618a('0x11'));var logger=require('../../config/logger')(_0x618a('0x12'));var utils=require(_0x618a('0x13'));var config=require(_0x618a('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x618a('0x15'));var client=jayson[_0x618a('0x16')][_0x618a('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5b4ce0,_0x364b9a,_0x228514){if(_0x228514){var _0x271925=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x271925[_0x618a('0x18')](_0x364b9a)){return _0x5b4ce0;}else{throw new db[(_0x618a('0x19'))][(_0x618a('0x1a'))](_0x618a('0x1b'));}}else{return _0x5b4ce0;}}function respondWithRpcPromise(_0x4b2fd1,_0x4d434c,_0x13679e,_0x48aa4d){return new BPromise(function(_0x91939f,_0x4ff6bc){var _0x4e18d3=_0x48aa4d||client;return _0x4e18d3[_0x618a('0x1c')](_0x4b2fd1,_0x13679e)[_0x618a('0x1d')](function(_0x50cbb9){logger[_0x618a('0x1e')](_0x618a('0x1f'),_0x4d434c,'request\x20sent');logger[_0x618a('0x20')](_0x618a('0x21'),_0x4d434c,'request\x20sent',JSON[_0x618a('0x22')](_0x50cbb9));if(_0x50cbb9['error']){if(_0x50cbb9[_0x618a('0x23')][_0x618a('0x24')]===0x1f4){logger[_0x618a('0x23')]('Setting,\x20%s,\x20%s',_0x4d434c,_0x50cbb9['error'][_0x618a('0x25')]);return _0x4ff6bc(_0x50cbb9[_0x618a('0x23')]['message']);}logger[_0x618a('0x23')]('Setting,\x20%s,\x20%s',_0x4d434c,_0x50cbb9[_0x618a('0x23')]['message']);return _0x91939f(_0x50cbb9[_0x618a('0x23')][_0x618a('0x25')]);}else{logger[_0x618a('0x1e')](_0x618a('0x1f'),_0x4d434c,'request\x20sent');_0x91939f(_0x50cbb9['result']['message']);}})[_0x618a('0x26')](function(_0x2d1375){logger['error']('Setting,\x20%s,\x20%s',_0x4d434c,_0x2d1375);_0x4ff6bc(_0x2d1375);});});}function respondWithStatusCode(_0x1a17c9,_0x42bbe8){_0x42bbe8=_0x42bbe8||0xcc;return function(_0x4cc19b){if(_0x4cc19b){return _0x1a17c9[_0x618a('0x27')](_0x42bbe8);}return _0x1a17c9[_0x618a('0x28')](_0x42bbe8)[_0x618a('0x29')]();};}function respondWithResult(_0x3996ae,_0x121883){_0x121883=_0x121883||0xc8;return function(_0xf43136){if(_0xf43136){return _0x3996ae['status'](_0x121883)[_0x618a('0x2a')](_0xf43136);}};}function respondWithFilteredResult(_0x410429,_0xc3fc35){return function(_0x3e3f67){if(_0x3e3f67){var _0x30613a=_0x3e3f67[_0x618a('0x2b')],_0x3e9673=_0xc3fc35['offset'],_0x537a72=_0xc3fc35['offset']+_0xc3fc35[_0x618a('0x2c')],_0x29fc56;if(_0x537a72>=_0x30613a){_0x537a72=_0x30613a;_0x29fc56=0xc8;}else{_0x29fc56=0xce;}_0x410429[_0x618a('0x28')](_0x29fc56);return _0x410429[_0x618a('0x2d')](_0x618a('0x2e'),_0x3e9673+'-'+_0x537a72+'/'+_0x30613a)[_0x618a('0x2a')](_0x3e3f67);}return null;};}function patchUpdates(_0x533b6f){return function(_0x72a2d0){try{jsonpatch['apply'](_0x72a2d0,_0x533b6f,!![]);}catch(_0xf47309){return BPromise['reject'](_0xf47309);}return _0x72a2d0[_0x618a('0x2f')]();};}function saveUpdates(_0x1634fd,_0xbf639f){return function(_0x4371f7){if(_0x4371f7){return _0x4371f7[_0x618a('0x30')](_0x1634fd)[_0x618a('0x1d')](function(_0x369627){return _0x369627;});}return null;};}function removeEntity(_0x43b066,_0x26e576){return function(_0x109958){if(_0x109958){return _0x109958[_0x618a('0x31')]()['then'](function(){_0x43b066[_0x618a('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x361878,_0x143091){return function(_0x5d91c3){if(!_0x5d91c3){_0x361878['sendStatus'](0x194);}return _0x5d91c3;};}function handleError(_0x194b1d,_0x24ccac){_0x24ccac=_0x24ccac||0x1f4;return function(_0x4f453e){logger[_0x618a('0x23')](_0x4f453e['stack']);if(_0x4f453e[_0x618a('0x32')]){delete _0x4f453e[_0x618a('0x32')];}_0x194b1d['status'](_0x24ccac)['send'](_0x4f453e);};}exports[_0x618a('0x33')]=function(_0x4032cb,_0x218bb9){var _0x3ae490={},_0xaf76a4={},_0xe0ed13={'count':0x0,'rows':[]};var _0x4961e8=_[_0x618a('0x34')](db[_0x618a('0x35')][_0x618a('0x36')],function(_0x2b8f0c){return{'name':_0x2b8f0c[_0x618a('0x37')],'type':_0x2b8f0c[_0x618a('0x38')]['key']};});_0xaf76a4[_0x618a('0x39')]=_[_0x618a('0x34')](_0x4961e8,_0x618a('0x32'));_0xaf76a4[_0x618a('0x3a')]=_[_0x618a('0x3b')](_0x4032cb['query']);_0xaf76a4[_0x618a('0x3c')]=_['intersection'](_0xaf76a4['model'],_0xaf76a4[_0x618a('0x3a')]);_0x3ae490[_0x618a('0x3d')]=_[_0x618a('0x3e')](_0xaf76a4[_0x618a('0x39')],qs[_0x618a('0x3f')](_0x4032cb[_0x618a('0x3a')][_0x618a('0x3f')]));_0x3ae490[_0x618a('0x3d')]=_0x3ae490['attributes']['length']?_0x3ae490[_0x618a('0x3d')]:_0xaf76a4[_0x618a('0x39')];if(!_0x4032cb[_0x618a('0x3a')][_0x618a('0x40')](_0x618a('0x41'))){_0x3ae490[_0x618a('0x2c')]=qs[_0x618a('0x2c')](_0x4032cb[_0x618a('0x3a')][_0x618a('0x2c')]);_0x3ae490[_0x618a('0x42')]=qs[_0x618a('0x42')](_0x4032cb[_0x618a('0x3a')][_0x618a('0x42')]);}_0x3ae490[_0x618a('0x43')]=qs[_0x618a('0x44')](_0x4032cb['query'][_0x618a('0x44')]);_0x3ae490[_0x618a('0x45')]=qs[_0x618a('0x3c')](_[_0x618a('0x46')](_0x4032cb['query'],_0xaf76a4[_0x618a('0x3c')]));if(_0x4032cb[_0x618a('0x3a')]['filter']){_0x3ae490['where']=_[_0x618a('0x47')](_0x3ae490['where'],{'$or':_[_0x618a('0x34')](_0x4961e8,function(_0x3bbb76){if(_0x3bbb76[_0x618a('0x38')]!=='VIRTUAL'){var _0x3f22a8={};_0x3f22a8[_0x3bbb76[_0x618a('0x32')]]={'$like':'%'+_0x4032cb['query'][_0x618a('0x48')]+'%'};return _0x3f22a8;}})});}_0x3ae490=_[_0x618a('0x47')]({},_0x3ae490,_0x4032cb[_0x618a('0x49')]);var _0xa39487={'where':_0x3ae490[_0x618a('0x45')]};return db[_0x618a('0x35')][_0x618a('0x2b')](_0xa39487)[_0x618a('0x1d')](function(_0x520393){_0xe0ed13['count']=_0x520393;if(_0x4032cb['query'][_0x618a('0x4a')]){_0x3ae490['include']=[{'all':!![]}];}return db[_0x618a('0x35')][_0x618a('0x4b')](_0x3ae490);})[_0x618a('0x1d')](function(_0x28f2e9){_0xe0ed13[_0x618a('0x4c')]=_0x28f2e9;return _0xe0ed13;})[_0x618a('0x1d')](respondWithFilteredResult(_0x218bb9,_0x3ae490))['catch'](handleError(_0x218bb9,null));};exports[_0x618a('0x4d')]=function(_0x86fe88,_0x2bcb35){var _0x39477a={'raw':![],'where':{'id':_0x86fe88[_0x618a('0x4e')]['id']}},_0x2f3b7a={};_0x2f3b7a[_0x618a('0x39')]=_[_0x618a('0x3b')](db[_0x618a('0x35')][_0x618a('0x36')]);_0x2f3b7a[_0x618a('0x3a')]=_[_0x618a('0x3b')](_0x86fe88['query']);_0x2f3b7a[_0x618a('0x3c')]=_[_0x618a('0x3e')](_0x2f3b7a[_0x618a('0x39')],_0x2f3b7a[_0x618a('0x3a')]);_0x39477a[_0x618a('0x3d')]=_[_0x618a('0x3e')](_0x2f3b7a[_0x618a('0x39')],qs[_0x618a('0x3f')](_0x86fe88[_0x618a('0x3a')]['fields']));_0x39477a[_0x618a('0x3d')]=_0x39477a[_0x618a('0x3d')][_0x618a('0x4f')]?_0x39477a['attributes']:_0x2f3b7a[_0x618a('0x39')];if(_0x86fe88[_0x618a('0x3a')]['includeAll']){_0x39477a['include']=[{'all':!![]}];}_0x39477a=_[_0x618a('0x47')]({},_0x39477a,_0x86fe88[_0x618a('0x49')]);return db[_0x618a('0x35')][_0x618a('0x50')](_0x39477a)[_0x618a('0x1d')](handleEntityNotFound(_0x2bcb35,null))['then'](respondWithResult(_0x2bcb35,null))['catch'](handleError(_0x2bcb35,null));};exports[_0x618a('0x30')]=function(_0x50b837,_0x2d3962){if(_0x50b837['body']['id']){delete _0x50b837['body']['id'];}return db[_0x618a('0x35')][_0x618a('0x50')]({'where':{'id':_0x50b837[_0x618a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2d3962,null))[_0x618a('0x1d')](saveUpdates(_0x50b837[_0x618a('0x51')],null))['then'](respondWithResult(_0x2d3962,null))[_0x618a('0x26')](handleError(_0x2d3962,null));};exports[_0x618a('0x52')]=function(_0x37eb2a,_0x3dd6d5,_0x4c86ec){if(_0x37eb2a[_0x618a('0x53')]&&_0x37eb2a[_0x618a('0x53')][_0x618a('0x54')]){_0x37eb2a[_0x618a('0x51')][_0x618a('0x55')]=_0x37eb2a[_0x618a('0x53')][_0x618a('0x54')];}return db[_0x618a('0x35')][_0x618a('0x50')]({'where':{'id':_0x37eb2a[_0x618a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3dd6d5,null))[_0x618a('0x1d')](saveUpdates(_0x37eb2a[_0x618a('0x51')],null))[_0x618a('0x1d')](respondWithResult(_0x3dd6d5,null))[_0x618a('0x26')](handleError(_0x3dd6d5,null));};exports[_0x618a('0x56')]=function(_0x59c171,_0x4b683d,_0x48aada){if(_0x59c171[_0x618a('0x53')]&&_0x59c171[_0x618a('0x53')][_0x618a('0x54')]){_0x59c171['body'][_0x618a('0x57')]=_0x59c171[_0x618a('0x53')][_0x618a('0x54')];}return db[_0x618a('0x35')][_0x618a('0x50')]({'where':{'id':_0x59c171[_0x618a('0x4e')]['id']}})[_0x618a('0x1d')](handleEntityNotFound(_0x4b683d,null))['then'](saveUpdates(_0x59c171[_0x618a('0x51')],null))[_0x618a('0x1d')](respondWithResult(_0x4b683d,null))[_0x618a('0x26')](handleError(_0x4b683d,null));};var utilLicense=require(_0x618a('0x58'));exports['getLogo']=function(_0x44a757,_0x5d27fa,_0x2badde){var _0x1c6aac=_0x618a('0x59');var _0xcaa623={'custom':![]};return utilLicense[_0x618a('0x5a')]()[_0x618a('0x1d')](function(_0x245658){if(_0x245658){_0xcaa623=_0x245658;}return db['Setting'][_0x618a('0x50')]({'where':{'id':_0x44a757[_0x618a('0x4e')]['id']},'attributes':['logo',_0x618a('0x57'),_0x618a('0x5b'),_0x618a('0x5c'),_0x618a('0x5d'),_0x618a('0x5e'),_0x618a('0x5f'),_0x618a('0x60')],'raw':!![]});})[_0x618a('0x1d')](handleEntityNotFound(_0x5d27fa,null))['then'](function(_0x1ad6cd){if(_0x1ad6cd){var _0x1eaa7a=_0x1ad6cd[_0x618a('0x55')]&&fs[_0x618a('0x61')](path['join'](config['root'],_0x1c6aac,_[_0x618a('0x62')](_0x1ad6cd[_0x618a('0x55')])))?path['join'](config[_0x618a('0x63')],_0x1c6aac,_['toLower'](_0x1ad6cd[_0x618a('0x55')])):path['join'](config['root'],_0x1c6aac,_['toLower']('default_logo.png'));var _0x29cb5d='default'+_[_0x618a('0x64')]('logo');if(_0x1ad6cd[_0x29cb5d]||!_0xcaa623[_0x618a('0x65')]){_0x1eaa7a=path['join'](config['root'],_0x1c6aac,_[_0x618a('0x62')](_0x618a('0x66')));}if(!fs['existsSync'](_0x1eaa7a)){throw new db[(_0x618a('0x19'))]['ValidationError'](_[_0x618a('0x64')](_0x618a('0x55'))+_0x618a('0x67'));}return _0x5d27fa[_0x618a('0x68')](_0x1eaa7a);}})[_0x618a('0x26')](handleError(_0x5d27fa,null));};var utilLicense=require('../../config/license/util');exports[_0x618a('0x69')]=function(_0x55e5d2,_0x464ab6,_0x4bab2d){var _0x3c31a2=_0x618a('0x59');var _0x7919f4={'custom':![]};return utilLicense[_0x618a('0x5a')]()[_0x618a('0x1d')](function(_0x23ff51){if(_0x23ff51){_0x7919f4=_0x23ff51;}return db['Setting'][_0x618a('0x50')]({'where':{'id':_0x55e5d2[_0x618a('0x4e')]['id']},'attributes':[_0x618a('0x55'),_0x618a('0x57'),_0x618a('0x5b'),_0x618a('0x5c'),_0x618a('0x5d'),'defaultLoginLogo',_0x618a('0x5f'),_0x618a('0x60')],'raw':!![]});})[_0x618a('0x1d')](handleEntityNotFound(_0x464ab6,null))[_0x618a('0x1d')](function(_0x2ac9f2){if(_0x2ac9f2){var _0x484c0c=_0x2ac9f2['loginLogo']&&fs['existsSync'](path[_0x618a('0x6a')](config[_0x618a('0x63')],_0x3c31a2,_[_0x618a('0x62')](_0x2ac9f2[_0x618a('0x57')])))?path[_0x618a('0x6a')](config[_0x618a('0x63')],_0x3c31a2,_[_0x618a('0x62')](_0x2ac9f2['loginLogo'])):path['join'](config['root'],_0x3c31a2,_['toLower'](_0x618a('0x6b')));var _0x4b3794=_0x618a('0x6c')+_['upperFirst'](_0x618a('0x57'));if(_0x2ac9f2[_0x4b3794]||!_0x7919f4[_0x618a('0x65')]){_0x484c0c=path['join'](config[_0x618a('0x63')],_0x3c31a2,_[_0x618a('0x62')](_0x618a('0x6b')));}if(!fs[_0x618a('0x61')](_0x484c0c)){throw new db[(_0x618a('0x19'))]['ValidationError'](_[_0x618a('0x64')]('loginLogo')+_0x618a('0x67'));}return _0x464ab6[_0x618a('0x68')](_0x484c0c);}})['catch'](handleError(_0x464ab6,null));};exports[_0x618a('0x6d')]=function(_0x27c134,_0x3110f7){return db[_0x618a('0x35')][_0x618a('0x50')]({'where':{'id':_0x27c134[_0x618a('0x4e')]['id']},'attributes':['securePassword']})[_0x618a('0x1d')](respondWithResult(_0x3110f7,null))[_0x618a('0x26')](handleError(_0x3110f7,null));};exports['addPreferred']=function(_0x2452d6,_0x860b2,_0x2e3885){if(_0x2452d6[_0x618a('0x53')]&&_0x2452d6[_0x618a('0x53')][_0x618a('0x54')]){_0x2452d6[_0x618a('0x51')][_0x618a('0x5b')]=_0x2452d6[_0x618a('0x53')]['filename'];}return db['Setting']['find']({'where':{'id':_0x2452d6['params']['id']}})[_0x618a('0x1d')](handleEntityNotFound(_0x860b2,null))['then'](saveUpdates(_0x2452d6[_0x618a('0x51')],null))['then'](respondWithResult(_0x860b2,null))[_0x618a('0x26')](handleError(_0x860b2,null));};var utilLicense=require(_0x618a('0x58'));exports[_0x618a('0x6e')]=function(_0x3b5a6f,_0x351351,_0x372cb5){var _0x20f553=_0x618a('0x59');var _0x17d4db={'custom':![]};return utilLicense[_0x618a('0x5a')]()[_0x618a('0x1d')](function(_0x46a219){if(_0x46a219){_0x17d4db=_0x46a219;}return db[_0x618a('0x35')][_0x618a('0x50')]({'where':{'id':_0x3b5a6f[_0x618a('0x4e')]['id']},'attributes':[_0x618a('0x55'),_0x618a('0x57'),'preferred',_0x618a('0x5c'),_0x618a('0x5d'),_0x618a('0x5e'),'defaultPreferred',_0x618a('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x351351,null))[_0x618a('0x1d')](function(_0x804186){if(_0x804186){var _0x336082=_0x804186[_0x618a('0x5b')]&&fs[_0x618a('0x61')](path[_0x618a('0x6a')](config[_0x618a('0x63')],_0x20f553,_[_0x618a('0x62')](_0x804186['preferred'])))?path[_0x618a('0x6a')](config[_0x618a('0x63')],_0x20f553,_[_0x618a('0x62')](_0x804186[_0x618a('0x5b')])):path['join'](config[_0x618a('0x63')],_0x20f553,_[_0x618a('0x62')](_0x618a('0x6f')));var _0x3a4118='default'+_[_0x618a('0x64')]('preferred');if(_0x804186[_0x3a4118]||!_0x17d4db[_0x618a('0x65')]||!_0x17d4db[_0x618a('0x5b')]){_0x336082=path[_0x618a('0x6a')](config[_0x618a('0x63')],_0x20f553,_['toLower'](_0x618a('0x6f')));}if(!fs[_0x618a('0x61')](_0x336082)){throw new db['Sequelize'][(_0x618a('0x1a'))](_[_0x618a('0x64')](_0x618a('0x5b'))+_0x618a('0x67'));}return _0x351351['download'](_0x336082);}})[_0x618a('0x26')](handleError(_0x351351,null));};exports[_0x618a('0x70')]=function(_0x3a51bb,_0x43e6fb,_0x36eb5d){if(_0x3a51bb[_0x618a('0x53')]&&_0x3a51bb[_0x618a('0x53')][_0x618a('0x54')]){_0x3a51bb[_0x618a('0x51')][_0x618a('0x5c')]=_0x3a51bb[_0x618a('0x53')][_0x618a('0x54')];}return db[_0x618a('0x35')][_0x618a('0x50')]({'where':{'id':_0x3a51bb['params']['id']}})[_0x618a('0x1d')](handleEntityNotFound(_0x43e6fb,null))[_0x618a('0x1d')](saveUpdates(_0x3a51bb[_0x618a('0x51')],null))['then'](respondWithResult(_0x43e6fb,null))[_0x618a('0x26')](handleError(_0x43e6fb,null));};var utilLicense=require(_0x618a('0x58'));exports[_0x618a('0x71')]=function(_0x590d4b,_0x539303,_0x520fb4){var _0x27f35a=_0x618a('0x59');var _0x3d34b5={'custom':![]};return utilLicense[_0x618a('0x5a')]()[_0x618a('0x1d')](function(_0x1b6644){if(_0x1b6644){_0x3d34b5=_0x1b6644;}return db['Setting'][_0x618a('0x50')]({'where':{'id':_0x590d4b[_0x618a('0x4e')]['id']},'attributes':[_0x618a('0x55'),_0x618a('0x57'),_0x618a('0x5b'),'favicon','defaultLogo',_0x618a('0x5e'),_0x618a('0x5f'),_0x618a('0x60')],'raw':!![]});})[_0x618a('0x1d')](handleEntityNotFound(_0x539303,null))[_0x618a('0x1d')](function(_0xdea619){if(_0xdea619){var _0x537fda=_0xdea619[_0x618a('0x5c')]&&fs['existsSync'](path[_0x618a('0x6a')](config[_0x618a('0x63')],_0x27f35a,_[_0x618a('0x62')](_0xdea619[_0x618a('0x5c')])))?path[_0x618a('0x6a')](config[_0x618a('0x63')],_0x27f35a,_[_0x618a('0x62')](_0xdea619[_0x618a('0x5c')])):path[_0x618a('0x6a')](config[_0x618a('0x63')],_0x27f35a,_['toLower'](_0x618a('0x72')));var _0x51faa3='default'+_[_0x618a('0x64')]('favicon');if(_0xdea619[_0x51faa3]||!_0x3d34b5[_0x618a('0x65')]){_0x537fda=path[_0x618a('0x6a')](config[_0x618a('0x63')],_0x27f35a,_[_0x618a('0x62')](_0x618a('0x72')));}if(!fs[_0x618a('0x61')](_0x537fda)){throw new db[(_0x618a('0x19'))][(_0x618a('0x1a'))](_[_0x618a('0x64')](_0x618a('0x5c'))+_0x618a('0x67'));}return _0x539303[_0x618a('0x68')](_0x537fda);}})[_0x618a('0x26')](handleError(_0x539303,null));}; \ No newline at end of file +var _0x446d=['destroy','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','merge','find','update','body','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.png','upperFirst','custom','\x20not\x20found','getLogoLogin','server/files/images/logos','getLicense','defaultFavicon','download','addPreferred','getPreferred','default','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','html-pdf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','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~!@#$%^&-_=+[{]}.','request','info','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','limit','set','apply','reject','save','then'];(function(_0x3db285,_0x2ce3dc){var _0x287478=function(_0x146324){while(--_0x146324){_0x3db285['push'](_0x3db285['shift']());}};_0x287478(++_0x2ce3dc);}(_0x446d,0x1a4));var _0xd446=function(_0x8b2a7f,_0x5987a7){_0x8b2a7f=_0x8b2a7f-0x0;var _0x2116e4=_0x446d[_0x8b2a7f];return _0x2116e4;};'use strict';var pdf=require(_0xd446('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd446('0x1'));var jsonpatch=require(_0xd446('0x2'));var rp=require('request-promise');var moment=require(_0xd446('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd446('0x4'));var util=require(_0xd446('0x5'));var path=require(_0xd446('0x6'));var sox=require(_0xd446('0x7'));var csv=require(_0xd446('0x8'));var ejs=require(_0xd446('0x9'));var fs=require('fs');var _=require(_0xd446('0xa'));var squel=require(_0xd446('0xb'));var crypto=require(_0xd446('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd446('0xd'));var toCsv=require(_0xd446('0x8'));var querystring=require(_0xd446('0xe'));var Papa=require(_0xd446('0xf'));var Redis=require(_0xd446('0x10'));var authService=require(_0xd446('0x11'));var qs=require(_0xd446('0x12'));var as=require(_0xd446('0x13'));var hardwareService=require(_0xd446('0x14'));var logger=require('../../config/logger')(_0xd446('0x15'));var utils=require('../../config/utils');var config=require(_0xd446('0x16'));var db=require(_0xd446('0x17'))['db'];var jayson=require(_0xd446('0x18'));var client=jayson[_0xd446('0x19')][_0xd446('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3ada2e,_0x32aa40,_0xa5ee8f){if(_0xa5ee8f){var _0x10bdd2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x10bdd2[_0xd446('0x1b')](_0x32aa40)){return _0x3ada2e;}else{throw new db[(_0xd446('0x1c'))][(_0xd446('0x1d'))](_0xd446('0x1e'));}}else{return _0x3ada2e;}}function respondWithRpcPromise(_0x20edeb,_0x143641,_0x3cb4de,_0x2c434d){return new BPromise(function(_0x3a1c71,_0x1ec66d){var _0xddf53=_0x2c434d||client;return _0xddf53[_0xd446('0x1f')](_0x20edeb,_0x3cb4de)['then'](function(_0x4604bc){logger[_0xd446('0x20')]('Setting,\x20%s,\x20%s',_0x143641,_0xd446('0x21'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x143641,_0xd446('0x21'),JSON[_0xd446('0x22')](_0x4604bc));if(_0x4604bc[_0xd446('0x23')]){if(_0x4604bc['error'][_0xd446('0x24')]===0x1f4){logger['error'](_0xd446('0x25'),_0x143641,_0x4604bc[_0xd446('0x23')][_0xd446('0x26')]);return _0x1ec66d(_0x4604bc[_0xd446('0x23')][_0xd446('0x26')]);}logger[_0xd446('0x23')]('Setting,\x20%s,\x20%s',_0x143641,_0x4604bc[_0xd446('0x23')][_0xd446('0x26')]);return _0x3a1c71(_0x4604bc[_0xd446('0x23')][_0xd446('0x26')]);}else{logger[_0xd446('0x20')](_0xd446('0x25'),_0x143641,_0xd446('0x21'));_0x3a1c71(_0x4604bc[_0xd446('0x27')][_0xd446('0x26')]);}})[_0xd446('0x28')](function(_0x1c1b04){logger[_0xd446('0x23')](_0xd446('0x25'),_0x143641,_0x1c1b04);_0x1ec66d(_0x1c1b04);});});}function respondWithStatusCode(_0x45bba4,_0x935d27){_0x935d27=_0x935d27||0xcc;return function(_0x35faad){if(_0x35faad){return _0x45bba4[_0xd446('0x29')](_0x935d27);}return _0x45bba4[_0xd446('0x2a')](_0x935d27)[_0xd446('0x2b')]();};}function respondWithResult(_0x441f98,_0xe42a0d){_0xe42a0d=_0xe42a0d||0xc8;return function(_0x2fb0bc){if(_0x2fb0bc){return _0x441f98[_0xd446('0x2a')](_0xe42a0d)[_0xd446('0x2c')](_0x2fb0bc);}};}function respondWithFilteredResult(_0x12b201,_0x52171f){return function(_0x2b5447){if(_0x2b5447){var _0x3e0c9a=_0x2b5447[_0xd446('0x2d')],_0x31a6e1=_0x52171f['offset'],_0x3f6497=_0x52171f['offset']+_0x52171f[_0xd446('0x2e')],_0x1fdb67;if(_0x3f6497>=_0x3e0c9a){_0x3f6497=_0x3e0c9a;_0x1fdb67=0xc8;}else{_0x1fdb67=0xce;}_0x12b201[_0xd446('0x2a')](_0x1fdb67);return _0x12b201[_0xd446('0x2f')]('Content-Range',_0x31a6e1+'-'+_0x3f6497+'/'+_0x3e0c9a)['json'](_0x2b5447);}return null;};}function patchUpdates(_0x1855a6){return function(_0x43e232){try{jsonpatch[_0xd446('0x30')](_0x43e232,_0x1855a6,!![]);}catch(_0x50ed24){return BPromise[_0xd446('0x31')](_0x50ed24);}return _0x43e232[_0xd446('0x32')]();};}function saveUpdates(_0x2be625,_0x590533){return function(_0x18cb4e){if(_0x18cb4e){return _0x18cb4e['update'](_0x2be625)[_0xd446('0x33')](function(_0x7cd90d){return _0x7cd90d;});}return null;};}function removeEntity(_0x48ae3a,_0x9c7b5){return function(_0x2369fa){if(_0x2369fa){return _0x2369fa[_0xd446('0x34')]()[_0xd446('0x33')](function(){_0x48ae3a[_0xd446('0x2a')](0xcc)[_0xd446('0x2b')]();});}};}function handleEntityNotFound(_0x2f4e06,_0x8b085a){return function(_0x510ddf){if(!_0x510ddf){_0x2f4e06[_0xd446('0x29')](0x194);}return _0x510ddf;};}function handleError(_0x31f0b8,_0x43147f){_0x43147f=_0x43147f||0x1f4;return function(_0xfc0ff9){logger[_0xd446('0x23')](_0xfc0ff9['stack']);if(_0xfc0ff9[_0xd446('0x35')]){delete _0xfc0ff9[_0xd446('0x35')];}_0x31f0b8[_0xd446('0x2a')](_0x43147f)[_0xd446('0x36')](_0xfc0ff9);};}exports['index']=function(_0x3848ea,_0x2c01a9){var _0x144f9e={},_0x154fe3={},_0x2b6e92={'count':0x0,'rows':[]};var _0x50f0c7=_[_0xd446('0x37')](db[_0xd446('0x38')][_0xd446('0x39')],function(_0x4ec3f4){return{'name':_0x4ec3f4[_0xd446('0x3a')],'type':_0x4ec3f4[_0xd446('0x3b')][_0xd446('0x3c')]};});_0x154fe3[_0xd446('0x3d')]=_[_0xd446('0x37')](_0x50f0c7,_0xd446('0x35'));_0x154fe3[_0xd446('0x3e')]=_['keys'](_0x3848ea[_0xd446('0x3e')]);_0x154fe3['filters']=_[_0xd446('0x3f')](_0x154fe3['model'],_0x154fe3[_0xd446('0x3e')]);_0x144f9e[_0xd446('0x40')]=_[_0xd446('0x3f')](_0x154fe3['model'],qs[_0xd446('0x41')](_0x3848ea['query'][_0xd446('0x41')]));_0x144f9e[_0xd446('0x40')]=_0x144f9e[_0xd446('0x40')]['length']?_0x144f9e[_0xd446('0x40')]:_0x154fe3[_0xd446('0x3d')];if(!_0x3848ea[_0xd446('0x3e')][_0xd446('0x42')](_0xd446('0x43'))){_0x144f9e[_0xd446('0x2e')]=qs[_0xd446('0x2e')](_0x3848ea[_0xd446('0x3e')][_0xd446('0x2e')]);_0x144f9e[_0xd446('0x44')]=qs[_0xd446('0x44')](_0x3848ea[_0xd446('0x3e')][_0xd446('0x44')]);}_0x144f9e['order']=qs[_0xd446('0x45')](_0x3848ea[_0xd446('0x3e')][_0xd446('0x45')]);_0x144f9e[_0xd446('0x46')]=qs[_0xd446('0x47')](_['pick'](_0x3848ea[_0xd446('0x3e')],_0x154fe3[_0xd446('0x47')]));if(_0x3848ea[_0xd446('0x3e')][_0xd446('0x48')]){_0x144f9e[_0xd446('0x46')]=_['merge'](_0x144f9e['where'],{'$or':_['map'](_0x50f0c7,function(_0x421ee6){if(_0x421ee6[_0xd446('0x3b')]!==_0xd446('0x49')){var _0x3ee931={};_0x3ee931[_0x421ee6['name']]={'$like':'%'+_0x3848ea[_0xd446('0x3e')]['filter']+'%'};return _0x3ee931;}})});}_0x144f9e=_['merge']({},_0x144f9e,_0x3848ea[_0xd446('0x4a')]);var _0x3691b5={'where':_0x144f9e[_0xd446('0x46')]};return db[_0xd446('0x38')][_0xd446('0x2d')](_0x3691b5)[_0xd446('0x33')](function(_0x1bc288){_0x2b6e92[_0xd446('0x2d')]=_0x1bc288;if(_0x3848ea[_0xd446('0x3e')][_0xd446('0x4b')]){_0x144f9e[_0xd446('0x4c')]=[{'all':!![]}];}return db[_0xd446('0x38')][_0xd446('0x4d')](_0x144f9e);})[_0xd446('0x33')](function(_0x32ce7c){_0x2b6e92[_0xd446('0x4e')]=_0x32ce7c;return _0x2b6e92;})['then'](respondWithFilteredResult(_0x2c01a9,_0x144f9e))[_0xd446('0x28')](handleError(_0x2c01a9,null));};exports[_0xd446('0x4f')]=function(_0x288f77,_0x32cabf){var _0x1ff640={'raw':![],'where':{'id':_0x288f77[_0xd446('0x50')]['id']}},_0x2d9929={};_0x2d9929[_0xd446('0x3d')]=_['keys'](db[_0xd446('0x38')]['rawAttributes']);_0x2d9929[_0xd446('0x3e')]=_['keys'](_0x288f77[_0xd446('0x3e')]);_0x2d9929['filters']=_[_0xd446('0x3f')](_0x2d9929[_0xd446('0x3d')],_0x2d9929[_0xd446('0x3e')]);_0x1ff640[_0xd446('0x40')]=_['intersection'](_0x2d9929[_0xd446('0x3d')],qs[_0xd446('0x41')](_0x288f77[_0xd446('0x3e')][_0xd446('0x41')]));_0x1ff640['attributes']=_0x1ff640[_0xd446('0x40')][_0xd446('0x51')]?_0x1ff640['attributes']:_0x2d9929[_0xd446('0x3d')];if(_0x288f77[_0xd446('0x3e')]['includeAll']){_0x1ff640[_0xd446('0x4c')]=[{'all':!![]}];}_0x1ff640=_[_0xd446('0x52')]({},_0x1ff640,_0x288f77['options']);return db[_0xd446('0x38')][_0xd446('0x53')](_0x1ff640)['then'](handleEntityNotFound(_0x32cabf,null))[_0xd446('0x33')](respondWithResult(_0x32cabf,null))[_0xd446('0x28')](handleError(_0x32cabf,null));};exports[_0xd446('0x54')]=function(_0x886a9a,_0x516be5){if(_0x886a9a[_0xd446('0x55')]['id']){delete _0x886a9a['body']['id'];}return db[_0xd446('0x38')][_0xd446('0x53')]({'where':{'id':_0x886a9a[_0xd446('0x50')]['id']}})[_0xd446('0x33')](handleEntityNotFound(_0x516be5,null))[_0xd446('0x33')](saveUpdates(_0x886a9a[_0xd446('0x55')],null))[_0xd446('0x33')](respondWithResult(_0x516be5,null))[_0xd446('0x28')](handleError(_0x516be5,null));};exports['addLogo']=function(_0x4810b9,_0x525717,_0x28629e){if(_0x4810b9[_0xd446('0x56')]&&_0x4810b9['file'][_0xd446('0x57')]){_0x4810b9['body']['logo']=_0x4810b9[_0xd446('0x56')][_0xd446('0x57')];}return db['Setting'][_0xd446('0x53')]({'where':{'id':_0x4810b9[_0xd446('0x50')]['id']}})[_0xd446('0x33')](handleEntityNotFound(_0x525717,null))[_0xd446('0x33')](saveUpdates(_0x4810b9[_0xd446('0x55')],null))['then'](respondWithResult(_0x525717,null))[_0xd446('0x28')](handleError(_0x525717,null));};exports[_0xd446('0x58')]=function(_0x46aa80,_0x1b93ec,_0x4e8518){if(_0x46aa80[_0xd446('0x56')]&&_0x46aa80[_0xd446('0x56')][_0xd446('0x57')]){_0x46aa80['body'][_0xd446('0x59')]=_0x46aa80['file'][_0xd446('0x57')];}return db[_0xd446('0x38')][_0xd446('0x53')]({'where':{'id':_0x46aa80[_0xd446('0x50')]['id']}})[_0xd446('0x33')](handleEntityNotFound(_0x1b93ec,null))['then'](saveUpdates(_0x46aa80[_0xd446('0x55')],null))['then'](respondWithResult(_0x1b93ec,null))[_0xd446('0x28')](handleError(_0x1b93ec,null));};var utilLicense=require(_0xd446('0x5a'));exports[_0xd446('0x5b')]=function(_0x348dff,_0x8efdf8,_0x430b2e){var _0x5ea011='server/files/images/logos';var _0x36efd6={'custom':![]};return utilLicense['getLicense']()[_0xd446('0x33')](function(_0x12793e){if(_0x12793e){_0x36efd6=_0x12793e;}return db[_0xd446('0x38')][_0xd446('0x53')]({'where':{'id':_0x348dff[_0xd446('0x50')]['id']},'attributes':[_0xd446('0x5c'),'loginLogo',_0xd446('0x5d'),_0xd446('0x5e'),_0xd446('0x5f'),_0xd446('0x60'),_0xd446('0x61'),'defaultFavicon'],'raw':!![]});})[_0xd446('0x33')](handleEntityNotFound(_0x8efdf8,null))[_0xd446('0x33')](function(_0xcd0672){if(_0xcd0672){var _0x522102=_0xcd0672[_0xd446('0x5c')]&&fs[_0xd446('0x62')](path[_0xd446('0x63')](config[_0xd446('0x64')],_0x5ea011,_['toLower'](_0xcd0672['logo'])))?path[_0xd446('0x63')](config[_0xd446('0x64')],_0x5ea011,_['toLower'](_0xcd0672['logo'])):path[_0xd446('0x63')](config['root'],_0x5ea011,_[_0xd446('0x65')](_0xd446('0x66')));var _0x3bc907='default'+_[_0xd446('0x67')](_0xd446('0x5c'));if(_0xcd0672[_0x3bc907]||!_0x36efd6[_0xd446('0x68')]){_0x522102=path[_0xd446('0x63')](config['root'],_0x5ea011,_['toLower']('default_logo.png'));}if(!fs[_0xd446('0x62')](_0x522102)){throw new db[(_0xd446('0x1c'))][(_0xd446('0x1d'))](_[_0xd446('0x67')]('logo')+_0xd446('0x69'));}return _0x8efdf8['download'](_0x522102);}})[_0xd446('0x28')](handleError(_0x8efdf8,null));};var utilLicense=require('../../config/license/util');exports[_0xd446('0x6a')]=function(_0x3925d1,_0x4a1a24,_0x570d1d){var _0x14d0b5=_0xd446('0x6b');var _0x31df20={'custom':![]};return utilLicense[_0xd446('0x6c')]()['then'](function(_0x5ced90){if(_0x5ced90){_0x31df20=_0x5ced90;}return db[_0xd446('0x38')]['find']({'where':{'id':_0x3925d1[_0xd446('0x50')]['id']},'attributes':['logo','loginLogo',_0xd446('0x5d'),_0xd446('0x5e'),_0xd446('0x5f'),'defaultLoginLogo','defaultPreferred',_0xd446('0x6d')],'raw':!![]});})[_0xd446('0x33')](handleEntityNotFound(_0x4a1a24,null))[_0xd446('0x33')](function(_0xfad8bb){if(_0xfad8bb){var _0x4cd605=_0xfad8bb[_0xd446('0x59')]&&fs[_0xd446('0x62')](path[_0xd446('0x63')](config[_0xd446('0x64')],_0x14d0b5,_[_0xd446('0x65')](_0xfad8bb['loginLogo'])))?path[_0xd446('0x63')](config[_0xd446('0x64')],_0x14d0b5,_[_0xd446('0x65')](_0xfad8bb[_0xd446('0x59')])):path[_0xd446('0x63')](config[_0xd446('0x64')],_0x14d0b5,_[_0xd446('0x65')]('default_loginLogo.png'));var _0x4bcae7='default'+_[_0xd446('0x67')](_0xd446('0x59'));if(_0xfad8bb[_0x4bcae7]||!_0x31df20[_0xd446('0x68')]){_0x4cd605=path[_0xd446('0x63')](config['root'],_0x14d0b5,_[_0xd446('0x65')]('default_loginLogo.png'));}if(!fs['existsSync'](_0x4cd605)){throw new db[(_0xd446('0x1c'))][(_0xd446('0x1d'))](_[_0xd446('0x67')](_0xd446('0x59'))+'\x20not\x20found');}return _0x4a1a24[_0xd446('0x6e')](_0x4cd605);}})[_0xd446('0x28')](handleError(_0x4a1a24,null));};exports['gdpr']=function(_0x426736,_0x5ab000){return db['Setting'][_0xd446('0x53')]({'where':{'id':_0x426736[_0xd446('0x50')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x5ab000,null))[_0xd446('0x28')](handleError(_0x5ab000,null));};exports[_0xd446('0x6f')]=function(_0x4874a5,_0x5f271a,_0x37e337){if(_0x4874a5[_0xd446('0x56')]&&_0x4874a5[_0xd446('0x56')][_0xd446('0x57')]){_0x4874a5[_0xd446('0x55')][_0xd446('0x5d')]=_0x4874a5['file'][_0xd446('0x57')];}return db[_0xd446('0x38')]['find']({'where':{'id':_0x4874a5[_0xd446('0x50')]['id']}})[_0xd446('0x33')](handleEntityNotFound(_0x5f271a,null))[_0xd446('0x33')](saveUpdates(_0x4874a5[_0xd446('0x55')],null))[_0xd446('0x33')](respondWithResult(_0x5f271a,null))['catch'](handleError(_0x5f271a,null));};var utilLicense=require('../../config/license/util');exports[_0xd446('0x70')]=function(_0x26ce64,_0x5a7211,_0x251ce2){var _0x2cb34b=_0xd446('0x6b');var _0x42b2bd={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x20d801){if(_0x20d801){_0x42b2bd=_0x20d801;}return db[_0xd446('0x38')][_0xd446('0x53')]({'where':{'id':_0x26ce64[_0xd446('0x50')]['id']},'attributes':[_0xd446('0x5c'),'loginLogo','preferred',_0xd446('0x5e'),_0xd446('0x5f'),'defaultLoginLogo',_0xd446('0x61'),_0xd446('0x6d')],'raw':!![]});})['then'](handleEntityNotFound(_0x5a7211,null))[_0xd446('0x33')](function(_0x2132af){if(_0x2132af){var _0x2cfc53=_0x2132af[_0xd446('0x5d')]&&fs[_0xd446('0x62')](path[_0xd446('0x63')](config[_0xd446('0x64')],_0x2cb34b,_['toLower'](_0x2132af[_0xd446('0x5d')])))?path['join'](config[_0xd446('0x64')],_0x2cb34b,_[_0xd446('0x65')](_0x2132af[_0xd446('0x5d')])):path[_0xd446('0x63')](config[_0xd446('0x64')],_0x2cb34b,_[_0xd446('0x65')]('default_preferred.png'));var _0x56dc57=_0xd446('0x71')+_['upperFirst'](_0xd446('0x5d'));if(_0x2132af[_0x56dc57]||!_0x42b2bd['custom']||!_0x42b2bd[_0xd446('0x5d')]){_0x2cfc53=path['join'](config['root'],_0x2cb34b,_[_0xd446('0x65')](_0xd446('0x72')));}if(!fs[_0xd446('0x62')](_0x2cfc53)){throw new db['Sequelize'][(_0xd446('0x1d'))](_[_0xd446('0x67')](_0xd446('0x5d'))+_0xd446('0x69'));}return _0x5a7211['download'](_0x2cfc53);}})[_0xd446('0x28')](handleError(_0x5a7211,null));};exports[_0xd446('0x73')]=function(_0xeb7aa7,_0x1290fa,_0x3f5012){if(_0xeb7aa7[_0xd446('0x56')]&&_0xeb7aa7[_0xd446('0x56')][_0xd446('0x57')]){_0xeb7aa7[_0xd446('0x55')]['favicon']=_0xeb7aa7[_0xd446('0x56')][_0xd446('0x57')];}return db[_0xd446('0x38')]['find']({'where':{'id':_0xeb7aa7['params']['id']}})[_0xd446('0x33')](handleEntityNotFound(_0x1290fa,null))[_0xd446('0x33')](saveUpdates(_0xeb7aa7[_0xd446('0x55')],null))['then'](respondWithResult(_0x1290fa,null))[_0xd446('0x28')](handleError(_0x1290fa,null));};var utilLicense=require(_0xd446('0x5a'));exports[_0xd446('0x74')]=function(_0x1fe75c,_0x414e62,_0x4924f2){var _0x2416fa='server/files/images/logos';var _0x47f90b={'custom':![]};return utilLicense[_0xd446('0x6c')]()['then'](function(_0x5dc8e8){if(_0x5dc8e8){_0x47f90b=_0x5dc8e8;}return db['Setting'][_0xd446('0x53')]({'where':{'id':_0x1fe75c[_0xd446('0x50')]['id']},'attributes':[_0xd446('0x5c'),_0xd446('0x59'),'preferred',_0xd446('0x5e'),_0xd446('0x5f'),'defaultLoginLogo',_0xd446('0x61'),_0xd446('0x6d')],'raw':!![]});})[_0xd446('0x33')](handleEntityNotFound(_0x414e62,null))[_0xd446('0x33')](function(_0x4f4db8){if(_0x4f4db8){var _0x54e2ff=_0x4f4db8[_0xd446('0x5e')]&&fs['existsSync'](path[_0xd446('0x63')](config[_0xd446('0x64')],_0x2416fa,_['toLower'](_0x4f4db8[_0xd446('0x5e')])))?path[_0xd446('0x63')](config[_0xd446('0x64')],_0x2416fa,_['toLower'](_0x4f4db8[_0xd446('0x5e')])):path[_0xd446('0x63')](config['root'],_0x2416fa,_[_0xd446('0x65')](_0xd446('0x75')));var _0x3ca2a5=_0xd446('0x71')+_['upperFirst']('favicon');if(_0x4f4db8[_0x3ca2a5]||!_0x47f90b['custom']){_0x54e2ff=path[_0xd446('0x63')](config[_0xd446('0x64')],_0x2416fa,_[_0xd446('0x65')]('default_favicon.ico'));}if(!fs[_0xd446('0x62')](_0x54e2ff)){throw new db[(_0xd446('0x1c'))]['ValidationError'](_[_0xd446('0x67')](_0xd446('0x5e'))+_0xd446('0x69'));}return _0x414e62[_0xd446('0x6e')](_0x54e2ff);}})[_0xd446('0x28')](handleError(_0x414e62,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index ad31593..f7cf33a 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 _0xb1b6=['Setting','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./setting.attributes','exports','define'];(function(_0x258f9e,_0x2bdf2f){var _0x3f1638=function(_0x1f5075){while(--_0x1f5075){_0x258f9e['push'](_0x258f9e['shift']());}};_0x3f1638(++_0x2bdf2f);}(_0xb1b6,0x181));var _0x6b1b=function(_0x6e2733,_0x56dee1){_0x6e2733=_0x6e2733-0x0;var _0x1452f5=_0xb1b6[_0x6e2733];return _0x1452f5;};'use strict';var _=require(_0x6b1b('0x0'));var util=require(_0x6b1b('0x1'));var logger=require(_0x6b1b('0x2'))('api');var moment=require(_0x6b1b('0x3'));var BPromise=require(_0x6b1b('0x4'));var rp=require(_0x6b1b('0x5'));var fs=require('fs');var path=require(_0x6b1b('0x6'));var rimraf=require('rimraf');var config=require(_0x6b1b('0x7'));var attributes=require(_0x6b1b('0x8'));module[_0x6b1b('0x9')]=function(_0x295f53,_0x8b9c1c){return _0x295f53[_0x6b1b('0xa')](_0x6b1b('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8581=['path','rimraf','./setting.attributes','exports','define','Setting','settings','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5ccc17,_0x5364f8){var _0x11ddc4=function(_0x174c93){while(--_0x174c93){_0x5ccc17['push'](_0x5ccc17['shift']());}};_0x11ddc4(++_0x5364f8);}(_0x8581,0x1c7));var _0x1858=function(_0x6e8761,_0xaef231){_0x6e8761=_0x6e8761-0x0;var _0x4e2142=_0x8581[_0x6e8761];return _0x4e2142;};'use strict';var _=require(_0x1858('0x0'));var util=require(_0x1858('0x1'));var logger=require(_0x1858('0x2'))(_0x1858('0x3'));var moment=require(_0x1858('0x4'));var BPromise=require(_0x1858('0x5'));var rp=require(_0x1858('0x6'));var fs=require('fs');var path=require(_0x1858('0x7'));var rimraf=require(_0x1858('0x8'));var config=require('../../config/environment');var attributes=require(_0x1858('0x9'));module[_0x1858('0xa')]=function(_0x369ff5,_0x5b6af1){return _0x369ff5[_0x1858('0xb')](_0x1858('0xc'),attributes,{'tableName':_0x1858('0xd'),'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 8ec5c79..7dccc85 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 _0x7e79=['info','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5e0bfe,_0x747312){var _0x6468b8=function(_0x20e5e0){while(--_0x20e5e0){_0x5e0bfe['push'](_0x5e0bfe['shift']());}};_0x6468b8(++_0x747312);}(_0x7e79,0x1ba));var _0x97e7=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7e79[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x97e7('0x0'));var util=require(_0x97e7('0x1'));var moment=require(_0x97e7('0x2'));var BPromise=require(_0x97e7('0x3'));var rs=require(_0x97e7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x97e7('0x5'));var logger=require('../../config/logger')(_0x97e7('0x6'));var config=require(_0x97e7('0x7'));var jayson=require(_0x97e7('0x8'));var client=jayson[_0x97e7('0x9')][_0x97e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cd126,_0x4fe934,_0xf6ac4e){return new BPromise(function(_0x198a87,_0x3a2483){return client['request'](_0x5cd126,_0xf6ac4e)['then'](function(_0x327146){logger['info'](_0x97e7('0xb'),_0x4fe934,_0x97e7('0xc'));logger['debug'](_0x97e7('0xd'),_0x4fe934,'request\x20sent',JSON[_0x97e7('0xe')](_0x327146));if(_0x327146[_0x97e7('0xf')]){if(_0x327146[_0x97e7('0xf')][_0x97e7('0x10')]===0x1f4){logger[_0x97e7('0xf')]('Setting,\x20%s,\x20%s',_0x4fe934,_0x327146[_0x97e7('0xf')]['message']);return _0x3a2483(_0x327146[_0x97e7('0xf')][_0x97e7('0x11')]);}logger[_0x97e7('0xf')](_0x97e7('0xb'),_0x4fe934,_0x327146[_0x97e7('0xf')][_0x97e7('0x11')]);return _0x198a87(_0x327146['error']['message']);}else{logger[_0x97e7('0x12')]('Setting,\x20%s,\x20%s',_0x4fe934,_0x97e7('0xc'));_0x198a87(_0x327146[_0x97e7('0x13')][_0x97e7('0x11')]);}})['catch'](function(_0x10b953){logger['error'](_0x97e7('0xb'),_0x4fe934,_0x10b953);_0x3a2483(_0x10b953);});});} \ No newline at end of file +var _0xe44d=['debug','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent'];(function(_0x1e3aac,_0x5118ba){var _0x4e72d0=function(_0x15648c){while(--_0x15648c){_0x1e3aac['push'](_0x1e3aac['shift']());}};_0x4e72d0(++_0x5118ba);}(_0xe44d,0x15a));var _0xde44=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xe44d[_0x2112d4];return _0x434972;};'use strict';var _=require(_0xde44('0x0'));var util=require(_0xde44('0x1'));var moment=require('moment');var BPromise=require(_0xde44('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde44('0x3'));var db=require(_0xde44('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xde44('0x5'))('rpc');var config=require(_0xde44('0x6'));var jayson=require(_0xde44('0x7'));var client=jayson[_0xde44('0x8')][_0xde44('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe6f334,_0x1a2fd5,_0x34f1dd){return new BPromise(function(_0x3fb2aa,_0x524949){return client['request'](_0xe6f334,_0x34f1dd)[_0xde44('0xa')](function(_0x5f87d0){logger[_0xde44('0xb')](_0xde44('0xc'),_0x1a2fd5,_0xde44('0xd'));logger[_0xde44('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x1a2fd5,_0xde44('0xd'),JSON[_0xde44('0xf')](_0x5f87d0));if(_0x5f87d0['error']){if(_0x5f87d0[_0xde44('0x10')]['code']===0x1f4){logger[_0xde44('0x10')](_0xde44('0xc'),_0x1a2fd5,_0x5f87d0['error']['message']);return _0x524949(_0x5f87d0[_0xde44('0x10')][_0xde44('0x11')]);}logger[_0xde44('0x10')](_0xde44('0xc'),_0x1a2fd5,_0x5f87d0['error'][_0xde44('0x11')]);return _0x3fb2aa(_0x5f87d0['error']['message']);}else{logger[_0xde44('0xb')](_0xde44('0xc'),_0x1a2fd5,_0xde44('0xd'));_0x3fb2aa(_0x5f87d0[_0xde44('0x12')][_0xde44('0x11')]);}})[_0xde44('0x13')](function(_0x2dd9df){logger[_0xde44('0x10')](_0xde44('0xc'),_0x1a2fd5,_0x2dd9df);_0x524949(_0x2dd9df);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 09bc306..d4b474a 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 _0x70ea=['/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','/:id/users','addAgents','put','/:id','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x70ea,0x94));var _0xa70e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x70ea[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xa70e('0x0'));var util=require(_0xa70e('0x1'));var path=require(_0xa70e('0x2'));var timeout=require('connect-timeout');var express=require(_0xa70e('0x3'));var router=express[_0xa70e('0x4')]();var auth=require(_0xa70e('0x5'));var interaction=require(_0xa70e('0x6'));var config=require(_0xa70e('0x7'));var controller=require(_0xa70e('0x8'));router[_0xa70e('0x9')]('/',auth[_0xa70e('0xa')](),controller[_0xa70e('0xb')]);router['get'](_0xa70e('0xc'),auth[_0xa70e('0xa')](),controller[_0xa70e('0xd')]);router[_0xa70e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa70e('0xe')]);router[_0xa70e('0x9')](_0xa70e('0xf'),auth[_0xa70e('0xa')](),controller['getDispositions']);router[_0xa70e('0x9')](_0xa70e('0x10'),auth[_0xa70e('0xa')](),controller[_0xa70e('0x11')]);router[_0xa70e('0x9')](_0xa70e('0x12'),auth[_0xa70e('0xa')](),controller[_0xa70e('0x13')]);router[_0xa70e('0x9')](_0xa70e('0x14'),auth[_0xa70e('0xa')](),controller[_0xa70e('0x15')]);router[_0xa70e('0x9')]('/:id/status',controller['statusGet']);router[_0xa70e('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xa70e('0x16')]);router[_0xa70e('0x17')]('/',auth[_0xa70e('0xa')](),controller[_0xa70e('0x18')]);router[_0xa70e('0x17')](_0xa70e('0xf'),auth['isAuthenticated'](),controller[_0xa70e('0x19')]);router[_0xa70e('0x17')](_0xa70e('0x10'),auth[_0xa70e('0xa')](),controller[_0xa70e('0x1a')]);router[_0xa70e('0x17')](_0xa70e('0x1b'),controller[_0xa70e('0x1c')]);router['post']('/:id/applications',auth[_0xa70e('0xa')](),controller[_0xa70e('0x1d')]);router[_0xa70e('0x17')](_0xa70e('0x1e'),auth['isAuthenticated'](),controller[_0xa70e('0x1f')]);router[_0xa70e('0x17')]('/:id/status',controller['status']);router['post'](_0xa70e('0x20'),auth['isAuthenticated'](),controller[_0xa70e('0x21')]);router[_0xa70e('0x22')](_0xa70e('0x23'),auth[_0xa70e('0xa')](),controller['update']);router[_0xa70e('0x24')](_0xa70e('0x23'),auth[_0xa70e('0xa')](),controller[_0xa70e('0x25')]);router[_0xa70e('0x24')]('/:id/dispositions',auth[_0xa70e('0xa')](),controller[_0xa70e('0x26')]);router['delete']('/:id/canned_answers',auth[_0xa70e('0xa')](),controller[_0xa70e('0x27')]);router[_0xa70e('0x24')](_0xa70e('0x20'),auth[_0xa70e('0xa')](),controller['removeAgents']);module[_0xa70e('0x28')]=router; \ No newline at end of file +var _0x95ae=['./smsAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/status','statusGet','create','post','/:id/dispositions','notify','addApplications','/:id/send','send','status','/:id/users','addAgents','put','update','delete','/:id','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x171d44,_0x23686b){var _0x2c018c=function(_0x207405){while(--_0x207405){_0x171d44['push'](_0x171d44['shift']());}};_0x2c018c(++_0x23686b);}(_0x95ae,0xaa));var _0xe95a=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x95ae[_0x5f309e];return _0x487b5e;};'use strict';var multer=require(_0xe95a('0x0'));var util=require(_0xe95a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe95a('0x2'));var router=express[_0xe95a('0x3')]();var auth=require(_0xe95a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe95a('0x5'));router[_0xe95a('0x6')]('/',auth['isAuthenticated'](),controller[_0xe95a('0x7')]);router[_0xe95a('0x6')](_0xe95a('0x8'),auth[_0xe95a('0x9')](),controller[_0xe95a('0xa')]);router['get']('/:id',auth[_0xe95a('0x9')](),controller[_0xe95a('0xb')]);router[_0xe95a('0x6')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xe95a('0x6')](_0xe95a('0xc'),auth[_0xe95a('0x9')](),controller[_0xe95a('0xd')]);router[_0xe95a('0x6')](_0xe95a('0xe'),auth[_0xe95a('0x9')](),controller['getApplications']);router[_0xe95a('0x6')](_0xe95a('0xf'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xe95a('0x6')](_0xe95a('0x10'),controller[_0xe95a('0x11')]);router[_0xe95a('0x6')]('/:id/users',auth[_0xe95a('0x9')](),controller['getAgents']);router['post']('/',auth[_0xe95a('0x9')](),controller[_0xe95a('0x12')]);router[_0xe95a('0x13')](_0xe95a('0x14'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xe95a('0x13')]('/:id/canned_answers',auth[_0xe95a('0x9')](),controller['addAnswer']);router[_0xe95a('0x13')]('/:id/notify',controller[_0xe95a('0x15')]);router[_0xe95a('0x13')](_0xe95a('0xe'),auth['isAuthenticated'](),controller[_0xe95a('0x16')]);router['post'](_0xe95a('0x17'),auth[_0xe95a('0x9')](),controller[_0xe95a('0x18')]);router[_0xe95a('0x13')](_0xe95a('0x10'),controller[_0xe95a('0x19')]);router['post'](_0xe95a('0x1a'),auth[_0xe95a('0x9')](),controller[_0xe95a('0x1b')]);router[_0xe95a('0x1c')]('/:id',auth[_0xe95a('0x9')](),controller[_0xe95a('0x1d')]);router[_0xe95a('0x1e')](_0xe95a('0x1f'),auth[_0xe95a('0x9')](),controller['destroy']);router['delete'](_0xe95a('0x14'),auth[_0xe95a('0x9')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0xe95a('0x9')](),controller[_0xe95a('0x20')]);router[_0xe95a('0x1e')](_0xe95a('0x1a'),auth[_0xe95a('0x9')](),controller[_0xe95a('0x21')]);module[_0xe95a('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 b2adffd..cebc917 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 _0xe81a=['BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','exports','STRING','name','generate','twilio','skebby','connectel','clicksend','plivo','clickatell','intelepeer'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0xe81a,0x193));var _0xae81=function(_0x1c8791,_0x17d51f){_0x1c8791=_0x1c8791-0x0;var _0x44e64c=_0xe81a[_0x1c8791];return _0x44e64c;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xae81('0x0')]={'name':{'type':Sequelize[_0xae81('0x1')],'unique':_0xae81('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xae81('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xae81('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xae81('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xae81('0x4'),_0xae81('0x5'),_0xae81('0x6'),_0xae81('0x7'),_0xae81('0x8'),_0xae81('0x9'),'csc','infobip',_0xae81('0xa'))},'accountSid':{'type':Sequelize[_0xae81('0x1')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xae81('0x1')]},'password':{'type':Sequelize[_0xae81('0x1')]},'apiKey':{'type':Sequelize[_0xae81('0x1')]},'senderString':{'type':Sequelize[_0xae81('0x1')]},'deliveryReport':{'type':Sequelize[_0xae81('0xb')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xae81('0xc')],'defaultValue':function(){return _0xae81('0xd');}},'notificationSound':{'type':Sequelize[_0xae81('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xae81('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xae81('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xae81('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xae81('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xae81('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xae81('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xae81('0xe')],'comment':_0xae81('0xf')},'mandatoryDisposition':{'type':Sequelize[_0xae81('0xb')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2e86d7){if(!_0x2e86d7)this[_0xae81('0x10')](_0xae81('0x11'),null);this[_0xae81('0x10')]('mandatoryDisposition',_0x2e86d7);}}}; \ No newline at end of file +var _0xa527=['setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','skebby','connectel','plivo','clickatell','infobip','ENUM','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa527,0x158));var _0x7a52=function(_0x485038,_0x3e26e8){_0x485038=_0x485038-0x0;var _0xa87ace=_0xa527[_0x485038];return _0xa87ace;};'use strict';var Sequelize=require(_0x7a52('0x0'));var rs=require(_0x7a52('0x1'));module[_0x7a52('0x2')]={'name':{'type':Sequelize[_0x7a52('0x3')],'unique':_0x7a52('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x7a52('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x7a52('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x7a52('0x3')],'defaultValue':function(){return rs[_0x7a52('0x5')]();}},'phone':{'type':Sequelize[_0x7a52('0x3')]},'type':{'type':Sequelize['ENUM']('twilio',_0x7a52('0x6'),_0x7a52('0x7'),'clicksend',_0x7a52('0x8'),_0x7a52('0x9'),'csc',_0x7a52('0xa'),'intelepeer')},'accountSid':{'type':Sequelize[_0x7a52('0x3')]},'authId':{'type':Sequelize[_0x7a52('0x3')]},'authToken':{'type':Sequelize[_0x7a52('0x3')]},'smsMethod':{'type':Sequelize[_0x7a52('0xb')]('SI','TI','GP')},'username':{'type':Sequelize[_0x7a52('0x3')]},'password':{'type':Sequelize[_0x7a52('0x3')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x7a52('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x7a52('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7a52('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7a52('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7a52('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7a52('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7a52('0xe')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7a52('0xd')],'defaultValue':![],'comment':_0x7a52('0xf'),'set':function(_0x16e148){if(!_0x16e148)this[_0x7a52('0x10')]('mandatoryDispositionPauseId',null);this[_0x7a52('0x10')](_0x7a52('0x11'),_0x16e148);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index cd0c3e5..e621b3a 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 _0xee2c=['fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./smsAccount.socket','register','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','set','apply','reject','save','update','destroy','get','SmsAccounts','name','send','index','mandatoryDispositionPause','SmsAccount','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','params','Pause','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','priority','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','From','Body','MessageSid','sender','text','connectel','from','messageId','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','ListId','Contacts','DESC','contact','SmsInteraction','spread','interaction','created','autoclose','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','push','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','infobip','groupName','DELIVERED','clickatell','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','state','message-id','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','rimraf','zip-dir'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xee2c,0x1c7));var _0xcee2=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xee2c[_0x24f31b];return _0x488401;};'use strict';var pdf=require(_0xcee2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcee2('0x1'));var zipdir=require(_0xcee2('0x2'));var jsonpatch=require(_0xcee2('0x3'));var rp=require(_0xcee2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcee2('0x5'));var util=require(_0xcee2('0x6'));var path=require('path');var sox=require(_0xcee2('0x7'));var csv=require(_0xcee2('0x8'));var ejs=require(_0xcee2('0x9'));var fs=require('fs');var _=require(_0xcee2('0xa'));var squel=require(_0xcee2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcee2('0xc'));var toCsv=require(_0xcee2('0x8'));var querystring=require(_0xcee2('0xd'));var Papa=require(_0xcee2('0xe'));var Redis=require(_0xcee2('0xf'));var authService=require(_0xcee2('0x10'));var qs=require(_0xcee2('0x11'));var as=require(_0xcee2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcee2('0x13'))(_0xcee2('0x14'));var utils=require(_0xcee2('0x15'));var config=require(_0xcee2('0x16'));var db=require(_0xcee2('0x17'))['db'];config['redis']=_[_0xcee2('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcee2('0x19')]));require(_0xcee2('0x1a'))[_0xcee2('0x1b')](socket);var jayson=require(_0xcee2('0x1c'));var client=jayson['client'][_0xcee2('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x818e13,_0x393761,_0x238da0){if(_0x238da0){var _0x1787ec=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1787ec[_0xcee2('0x1e')](_0x393761)){return _0x818e13;}else{throw new db[(_0xcee2('0x1f'))][(_0xcee2('0x20'))](_0xcee2('0x21'));}}else{return _0x818e13;}}function respondWithRpcPromise(_0x512593,_0x170586,_0x548e47,_0x221d75){return new BPromise(function(_0xeae302,_0x2b2ea0){var _0x2a52b4=_0x221d75||client;return _0x2a52b4['request'](_0x512593,_0x548e47)[_0xcee2('0x22')](function(_0x317659){logger[_0xcee2('0x23')](_0xcee2('0x24'),_0x170586,_0xcee2('0x25'));logger[_0xcee2('0x26')](_0xcee2('0x27'),_0x170586,_0xcee2('0x25'),JSON[_0xcee2('0x28')](_0x317659));if(_0x317659[_0xcee2('0x29')]){if(_0x317659[_0xcee2('0x29')]['code']===0x1f4){logger[_0xcee2('0x29')](_0xcee2('0x24'),_0x170586,_0x317659['error']['message']);return _0x2b2ea0(_0x317659[_0xcee2('0x29')]['message']);}logger[_0xcee2('0x29')](_0xcee2('0x24'),_0x170586,_0x317659[_0xcee2('0x29')]['message']);return _0xeae302(_0x317659['error'][_0xcee2('0x2a')]);}else{logger[_0xcee2('0x23')](_0xcee2('0x24'),_0x170586,'request\x20sent');_0xeae302(_0x317659[_0xcee2('0x2b')]['message']);}})[_0xcee2('0x2c')](function(_0x134c9b){logger[_0xcee2('0x29')](_0xcee2('0x24'),_0x170586,_0x134c9b);_0x2b2ea0(_0x134c9b);});});}function respondWithStatusCode(_0x84d7c,_0x31618c){_0x31618c=_0x31618c||0xcc;return function(_0xbc2b2e){if(_0xbc2b2e){return _0x84d7c[_0xcee2('0x2d')](_0x31618c);}return _0x84d7c[_0xcee2('0x2e')](_0x31618c)[_0xcee2('0x2f')]();};}function respondWithResult(_0x3705a0,_0x483d22){_0x483d22=_0x483d22||0xc8;return function(_0x19a99b){if(_0x19a99b){return _0x3705a0[_0xcee2('0x2e')](_0x483d22)[_0xcee2('0x30')](_0x19a99b);}};}function respondWithFilteredResult(_0x4a603c,_0x2f07e9){return function(_0x117342){if(_0x117342){var _0x559816=_0x117342['count'],_0x1e0dfc=_0x2f07e9[_0xcee2('0x31')],_0x25ead9=_0x2f07e9['offset']+_0x2f07e9['limit'],_0x56e23b;if(_0x25ead9>=_0x559816){_0x25ead9=_0x559816;_0x56e23b=0xc8;}else{_0x56e23b=0xce;}_0x4a603c[_0xcee2('0x2e')](_0x56e23b);return _0x4a603c[_0xcee2('0x32')]('Content-Range',_0x1e0dfc+'-'+_0x25ead9+'/'+_0x559816)[_0xcee2('0x30')](_0x117342);}return null;};}function patchUpdates(_0x21dc70){return function(_0x21635f){try{jsonpatch[_0xcee2('0x33')](_0x21635f,_0x21dc70,!![]);}catch(_0x201c62){return BPromise[_0xcee2('0x34')](_0x201c62);}return _0x21635f[_0xcee2('0x35')]();};}function saveUpdates(_0x1a67d6,_0x1713ef){return function(_0x130e40){if(_0x130e40){return _0x130e40[_0xcee2('0x36')](_0x1a67d6)[_0xcee2('0x22')](function(_0x4fdb62){return _0x4fdb62;});}return null;};}function removeEntity(_0x4775ba,_0x349a2f){return function(_0x5ed4a1){if(_0x5ed4a1){return _0x5ed4a1[_0xcee2('0x37')]()[_0xcee2('0x22')](function(){var _0x58fcba=_0x5ed4a1[_0xcee2('0x38')]({'plain':!![]});var _0xf41cf6=_0xcee2('0x39');return db['UserProfileResource'][_0xcee2('0x37')]({'where':{'type':_0xf41cf6,'resourceId':_0x58fcba['id']}})[_0xcee2('0x22')](function(){return _0x5ed4a1;});})[_0xcee2('0x22')](function(){_0x4775ba[_0xcee2('0x2e')](0xcc)[_0xcee2('0x2f')]();});}};}function handleEntityNotFound(_0x2e6890,_0x538984){return function(_0x457f39){if(!_0x457f39){_0x2e6890[_0xcee2('0x2d')](0x194);}return _0x457f39;};}function handleError(_0x4421bb,_0x55b01a){_0x55b01a=_0x55b01a||0x1f4;return function(_0x1836cd){logger['error'](_0x1836cd['stack']);if(_0x1836cd[_0xcee2('0x3a')]){delete _0x1836cd[_0xcee2('0x3a')];}_0x4421bb[_0xcee2('0x2e')](_0x55b01a)[_0xcee2('0x3b')](_0x1836cd);};}exports[_0xcee2('0x3c')]=function(_0x2eb529,_0x5ee5ad){var _0x572ebb={'include':[{'model':db['Pause'],'as':_0xcee2('0x3d')}]},_0x481168={},_0x20d759={'count':0x0,'rows':[]};var _0x157220=_['map'](db[_0xcee2('0x3e')]['rawAttributes'],function(_0x54d75a){return{'name':_0x54d75a[_0xcee2('0x3f')],'type':_0x54d75a[_0xcee2('0x40')]['key']};});_0x481168['model']=_[_0xcee2('0x41')](_0x157220,_0xcee2('0x3a'));_0x481168[_0xcee2('0x42')]=_[_0xcee2('0x43')](_0x2eb529[_0xcee2('0x42')]);_0x481168[_0xcee2('0x44')]=_[_0xcee2('0x45')](_0x481168[_0xcee2('0x46')],_0x481168[_0xcee2('0x42')]);_0x572ebb['attributes']=_[_0xcee2('0x45')](_0x481168[_0xcee2('0x46')],qs[_0xcee2('0x47')](_0x2eb529[_0xcee2('0x42')]['fields']));_0x572ebb[_0xcee2('0x48')]=_0x572ebb[_0xcee2('0x48')][_0xcee2('0x49')]?_0x572ebb[_0xcee2('0x48')]:_0x481168[_0xcee2('0x46')];if(!_0x2eb529[_0xcee2('0x42')][_0xcee2('0x4a')](_0xcee2('0x4b'))){_0x572ebb[_0xcee2('0x4c')]=qs['limit'](_0x2eb529[_0xcee2('0x42')][_0xcee2('0x4c')]);_0x572ebb[_0xcee2('0x31')]=qs['offset'](_0x2eb529[_0xcee2('0x42')][_0xcee2('0x31')]);}_0x572ebb[_0xcee2('0x4d')]=qs[_0xcee2('0x4e')](_0x2eb529[_0xcee2('0x42')][_0xcee2('0x4e')]);_0x572ebb[_0xcee2('0x4f')]=qs[_0xcee2('0x44')](_[_0xcee2('0x50')](_0x2eb529[_0xcee2('0x42')],_0x481168[_0xcee2('0x44')]));if(_0x2eb529[_0xcee2('0x42')][_0xcee2('0x51')]){_0x572ebb[_0xcee2('0x4f')]=_['merge'](_0x572ebb[_0xcee2('0x4f')],{'$or':_['map'](_0x157220,function(_0x52c037){if(_0x52c037[_0xcee2('0x40')]!==_0xcee2('0x52')){var _0x1b0fd4={};_0x1b0fd4[_0x52c037[_0xcee2('0x3a')]]={'$like':'%'+_0x2eb529[_0xcee2('0x42')]['filter']+'%'};return _0x1b0fd4;}})});}_0x572ebb=_[_0xcee2('0x53')]({},_0x572ebb,_0x2eb529['options']);var _0x2f6cf0={'where':_0x572ebb[_0xcee2('0x4f')]};return db[_0xcee2('0x3e')][_0xcee2('0x54')](_0x2f6cf0)[_0xcee2('0x22')](function(_0x2f1dc7){_0x20d759[_0xcee2('0x54')]=_0x2f1dc7;if(_0x2eb529['query'][_0xcee2('0x55')]){_0x572ebb[_0xcee2('0x56')]=[{'all':!![]}];}return db[_0xcee2('0x3e')][_0xcee2('0x57')](_0x572ebb);})[_0xcee2('0x22')](function(_0x31a73a){_0x20d759[_0xcee2('0x58')]=_0x31a73a;return _0x20d759;})[_0xcee2('0x22')](respondWithFilteredResult(_0x5ee5ad,_0x572ebb))[_0xcee2('0x2c')](handleError(_0x5ee5ad,null));};exports['show']=function(_0x5d05c8,_0xabc3d7){var _0x54d09={'raw':![],'where':{'id':_0x5d05c8[_0xcee2('0x59')]['id']},'include':[{'model':db[_0xcee2('0x5a')],'as':_0xcee2('0x3d')}]},_0x4b888f={};_0x4b888f[_0xcee2('0x46')]=_[_0xcee2('0x43')](db[_0xcee2('0x3e')][_0xcee2('0x5b')]);_0x4b888f['query']=_['keys'](_0x5d05c8['query']);_0x4b888f[_0xcee2('0x44')]=_[_0xcee2('0x45')](_0x4b888f[_0xcee2('0x46')],_0x4b888f['query']);_0x54d09[_0xcee2('0x48')]=_[_0xcee2('0x45')](_0x4b888f[_0xcee2('0x46')],qs['fields'](_0x5d05c8[_0xcee2('0x42')][_0xcee2('0x47')]));_0x54d09[_0xcee2('0x48')]=_0x54d09['attributes'][_0xcee2('0x49')]?_0x54d09[_0xcee2('0x48')]:_0x4b888f[_0xcee2('0x46')];if(_0x5d05c8[_0xcee2('0x42')]['includeAll']){_0x54d09['include']=[{'all':!![]}];}_0x54d09=_['merge']({},_0x54d09,_0x5d05c8[_0xcee2('0x5c')]);return db[_0xcee2('0x3e')][_0xcee2('0x5d')](_0x54d09)[_0xcee2('0x22')](handleEntityNotFound(_0xabc3d7,null))[_0xcee2('0x22')](respondWithResult(_0xabc3d7,null))[_0xcee2('0x2c')](handleError(_0xabc3d7,null));};exports[_0xcee2('0x5e')]=function(_0x4c9a97,_0x3ca032){return db[_0xcee2('0x3e')][_0xcee2('0x5e')](_0x4c9a97['body'],{})[_0xcee2('0x22')](function(_0x330f18){var _0xe99657=_0x4c9a97[_0xcee2('0x5f')][_0xcee2('0x38')]({'plain':!![]});if(!_0xe99657)throw new Error(_0xcee2('0x60'));if(_0xe99657[_0xcee2('0x61')]===_0xcee2('0x5f')){var _0x5aca9b=_0x330f18[_0xcee2('0x38')]({'plain':!![]});var _0x1e2c15=_0xcee2('0x39');return db[_0xcee2('0x62')][_0xcee2('0x5d')]({'where':{'name':_0x1e2c15,'userProfileId':_0xe99657[_0xcee2('0x63')]},'raw':!![]})[_0xcee2('0x22')](function(_0x1d2d2d){if(_0x1d2d2d&&_0x1d2d2d[_0xcee2('0x64')]===0x0){return db[_0xcee2('0x65')]['create']({'name':_0x5aca9b['name'],'resourceId':_0x5aca9b['id'],'type':_0x1d2d2d[_0xcee2('0x3a')],'sectionId':_0x1d2d2d['id']},{})[_0xcee2('0x22')](function(){return _0x330f18;});}else{return _0x330f18;}})[_0xcee2('0x2c')](function(_0x5154a6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5154a6);throw _0x5154a6;});}return _0x330f18;})[_0xcee2('0x22')](respondWithResult(_0x3ca032,0xc9))['catch'](handleError(_0x3ca032,null));};exports['update']=function(_0x3eef6a,_0x53bbc9){if(_0x3eef6a[_0xcee2('0x66')]['id']){delete _0x3eef6a[_0xcee2('0x66')]['id'];}return db['SmsAccount'][_0xcee2('0x5d')]({'where':{'id':_0x3eef6a[_0xcee2('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xcee2('0x22')](handleEntityNotFound(_0x53bbc9,null))[_0xcee2('0x22')](saveUpdates(_0x3eef6a[_0xcee2('0x66')],null))[_0xcee2('0x22')](respondWithResult(_0x53bbc9,null))[_0xcee2('0x2c')](handleError(_0x53bbc9,null));};exports['destroy']=function(_0x41521f,_0x2c9100){return db[_0xcee2('0x3e')][_0xcee2('0x5d')]({'where':{'id':_0x41521f[_0xcee2('0x59')]['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x2c9100,null))[_0xcee2('0x22')](removeEntity(_0x2c9100,null))[_0xcee2('0x2c')](handleError(_0x2c9100,null));};exports[_0xcee2('0x67')]=function(_0x4004f0,_0x210709){return db[_0xcee2('0x3e')]['describe']()[_0xcee2('0x22')](respondWithResult(_0x210709,null))[_0xcee2('0x2c')](handleError(_0x210709,null));};exports[_0xcee2('0x68')]=function(_0x5f5046,_0x4d1c2a,_0x1c3b64){if(_0x5f5046[_0xcee2('0x66')]['id']){delete _0x5f5046[_0xcee2('0x66')]['id'];}return db[_0xcee2('0x3e')]['find']({'where':{'id':_0x5f5046['params']['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x4d1c2a,null))[_0xcee2('0x22')](function(_0x81f30a){if(_0x81f30a){_0x5f5046[_0xcee2('0x66')][_0xcee2('0x69')]=_0x81f30a['id'];return db['Disposition']['create'](_0x5f5046[_0xcee2('0x66')]);}})[_0xcee2('0x22')](respondWithResult(_0x4d1c2a,null))[_0xcee2('0x2c')](handleError(_0x4d1c2a,null));};exports[_0xcee2('0x6a')]=function(_0x3ba2d0,_0x4ea04a,_0x3796cf){var _0x546ad3={'raw':![],'where':{}};var _0x38039b={};var _0x10a097={'count':0x0,'rows':[]};return db[_0xcee2('0x3e')][_0xcee2('0x6b')]({'where':{'id':_0x3ba2d0['params']['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x4ea04a,null))['then'](function(_0x56cc94){if(_0x56cc94){_0x38039b[_0xcee2('0x46')]=_[_0xcee2('0x43')](db[_0xcee2('0x6c')][_0xcee2('0x5b')]);_0x38039b['query']=_[_0xcee2('0x43')](_0x3ba2d0['query']);_0x38039b['filters']=_[_0xcee2('0x45')](_0x38039b[_0xcee2('0x46')],_0x38039b[_0xcee2('0x42')]);_0x546ad3['attributes']=_[_0xcee2('0x45')](_0x38039b['model'],qs[_0xcee2('0x47')](_0x3ba2d0['query'][_0xcee2('0x47')]));_0x546ad3['attributes']=_0x546ad3[_0xcee2('0x48')][_0xcee2('0x49')]?_0x546ad3[_0xcee2('0x48')]:_0x38039b[_0xcee2('0x46')];if(!_0x3ba2d0[_0xcee2('0x42')][_0xcee2('0x4a')](_0xcee2('0x4b'))){_0x546ad3[_0xcee2('0x4c')]=qs[_0xcee2('0x4c')](_0x3ba2d0[_0xcee2('0x42')][_0xcee2('0x4c')]);_0x546ad3[_0xcee2('0x31')]=qs[_0xcee2('0x31')](_0x3ba2d0[_0xcee2('0x42')][_0xcee2('0x31')]);}_0x546ad3[_0xcee2('0x4d')]=qs[_0xcee2('0x4e')](_0x3ba2d0[_0xcee2('0x42')][_0xcee2('0x4e')]);_0x546ad3['where']=qs[_0xcee2('0x44')](_[_0xcee2('0x50')](_0x3ba2d0['query'],_0x38039b[_0xcee2('0x44')]));_0x546ad3[_0xcee2('0x4f')][_0xcee2('0x69')]=_0x56cc94['id'];if(_0x3ba2d0[_0xcee2('0x42')][_0xcee2('0x51')]){_0x546ad3[_0xcee2('0x4f')]=_[_0xcee2('0x53')](_0x546ad3[_0xcee2('0x4f')],{'$or':_[_0xcee2('0x41')](_0x546ad3[_0xcee2('0x48')],function(_0x575ce5){var _0x1d40b7={};_0x1d40b7[_0x575ce5]={'$like':'%'+_0x3ba2d0['query'][_0xcee2('0x51')]+'%'};return _0x1d40b7;})});}_0x546ad3=_[_0xcee2('0x53')]({},_0x546ad3,_0x3ba2d0[_0xcee2('0x5c')]);return db[_0xcee2('0x6c')]['count']({'where':_0x546ad3['where']})[_0xcee2('0x22')](function(_0x536d04){_0x10a097[_0xcee2('0x54')]=_0x536d04;if(_0x3ba2d0[_0xcee2('0x42')][_0xcee2('0x55')]){_0x546ad3[_0xcee2('0x56')]=[{'all':!![]}];}return db[_0xcee2('0x6c')]['findAll'](_0x546ad3);})['then'](function(_0x351ac2){_0x10a097[_0xcee2('0x58')]=_0x351ac2;return _0x10a097;});}})['then'](respondWithFilteredResult(_0x4ea04a,_0x546ad3))['catch'](handleError(_0x4ea04a,null));};exports[_0xcee2('0x6d')]=function(_0x216391,_0x452a2e,_0x5623b8){return db['SmsAccount'][_0xcee2('0x5d')]({'where':{'id':_0x216391['params']['id']}})['then'](handleEntityNotFound(_0x452a2e,null))[_0xcee2('0x22')](function(_0x441f3c){if(_0x441f3c){return _0x441f3c[_0xcee2('0x6d')](_0x216391[_0xcee2('0x42')][_0xcee2('0x6e')]);}})[_0xcee2('0x22')](respondWithStatusCode(_0x452a2e,null))[_0xcee2('0x2c')](handleError(_0x452a2e,null));};exports[_0xcee2('0x6f')]=function(_0x3476c5,_0x1049ac,_0x21bbb5){if(_0x3476c5[_0xcee2('0x66')]['id']){delete _0x3476c5[_0xcee2('0x66')]['id'];}return db[_0xcee2('0x3e')]['find']({'where':{'id':_0x3476c5[_0xcee2('0x59')]['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x1049ac,null))['then'](function(_0x2057fb){if(_0x2057fb){_0x3476c5[_0xcee2('0x66')][_0xcee2('0x69')]=_0x2057fb['id'];return db['CannedAnswer']['create'](_0x3476c5['body']);}})[_0xcee2('0x22')](respondWithResult(_0x1049ac,null))[_0xcee2('0x2c')](handleError(_0x1049ac,null));};exports[_0xcee2('0x70')]=function(_0x10fd3a,_0x5e2d43,_0x4a505f){var _0x130b70={'raw':![],'where':{}};var _0x228b27={};var _0x42cd1d={'count':0x0,'rows':[]};return db[_0xcee2('0x3e')][_0xcee2('0x6b')]({'where':{'id':_0x10fd3a['params']['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x5e2d43,null))[_0xcee2('0x22')](function(_0x35acd8){if(_0x35acd8){_0x228b27['model']=_[_0xcee2('0x43')](db[_0xcee2('0x71')]['rawAttributes']);_0x228b27[_0xcee2('0x42')]=_['keys'](_0x10fd3a[_0xcee2('0x42')]);_0x228b27[_0xcee2('0x44')]=_[_0xcee2('0x45')](_0x228b27[_0xcee2('0x46')],_0x228b27[_0xcee2('0x42')]);_0x130b70['attributes']=_['intersection'](_0x228b27[_0xcee2('0x46')],qs[_0xcee2('0x47')](_0x10fd3a['query'][_0xcee2('0x47')]));_0x130b70[_0xcee2('0x48')]=_0x130b70[_0xcee2('0x48')][_0xcee2('0x49')]?_0x130b70[_0xcee2('0x48')]:_0x228b27['model'];if(!_0x10fd3a[_0xcee2('0x42')][_0xcee2('0x4a')](_0xcee2('0x4b'))){_0x130b70[_0xcee2('0x4c')]=qs['limit'](_0x10fd3a[_0xcee2('0x42')][_0xcee2('0x4c')]);_0x130b70[_0xcee2('0x31')]=qs[_0xcee2('0x31')](_0x10fd3a[_0xcee2('0x42')][_0xcee2('0x31')]);}_0x130b70[_0xcee2('0x4d')]=qs[_0xcee2('0x4e')](_0x10fd3a[_0xcee2('0x42')][_0xcee2('0x4e')]);_0x130b70[_0xcee2('0x4f')]=qs[_0xcee2('0x44')](_[_0xcee2('0x50')](_0x10fd3a[_0xcee2('0x42')],_0x228b27[_0xcee2('0x44')]));_0x130b70['where'][_0xcee2('0x69')]=_0x35acd8['id'];if(_0x10fd3a[_0xcee2('0x42')][_0xcee2('0x51')]){_0x130b70['where']=_[_0xcee2('0x53')](_0x130b70[_0xcee2('0x4f')],{'$or':_['map'](_0x130b70[_0xcee2('0x48')],function(_0x532417){var _0x14bdb0={};_0x14bdb0[_0x532417]={'$like':'%'+_0x10fd3a[_0xcee2('0x42')][_0xcee2('0x51')]+'%'};return _0x14bdb0;})});}_0x130b70=_[_0xcee2('0x53')]({},_0x130b70,_0x10fd3a[_0xcee2('0x5c')]);return db[_0xcee2('0x71')][_0xcee2('0x54')]({'where':_0x130b70[_0xcee2('0x4f')]})[_0xcee2('0x22')](function(_0x467911){_0x42cd1d[_0xcee2('0x54')]=_0x467911;if(_0x10fd3a[_0xcee2('0x42')][_0xcee2('0x55')]){_0x130b70[_0xcee2('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xcee2('0x57')](_0x130b70);})[_0xcee2('0x22')](function(_0x558776){_0x42cd1d[_0xcee2('0x58')]=_0x558776;return _0x42cd1d;});}})[_0xcee2('0x22')](respondWithFilteredResult(_0x5e2d43,_0x130b70))[_0xcee2('0x2c')](handleError(_0x5e2d43,null));};exports[_0xcee2('0x72')]=function(_0x3c79e1,_0x19292f,_0x1fce50){return db[_0xcee2('0x3e')][_0xcee2('0x5d')]({'where':{'id':_0x3c79e1[_0xcee2('0x59')]['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x19292f,null))[_0xcee2('0x22')](function(_0x1813d6){if(_0x1813d6){return _0x1813d6['removeAnswers'](_0x3c79e1[_0xcee2('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x19292f,null))[_0xcee2('0x2c')](handleError(_0x19292f,null));};exports['notify']=function(_0x24aac9,_0x22cabf,_0x137350){var _0x437bf4={'channel':_0xcee2('0x73')};var _0x3682c8=[];var _0x32997a=[];var _0x107510={};return db['SmsAccount'][_0xcee2('0x5d')]({'where':{'id':_0x24aac9[_0xcee2('0x59')]['id']},'include':[{'model':db[_0xcee2('0x74')],'as':_0xcee2('0x75')}]})[_0xcee2('0x22')](handleEntityNotFound(_0x22cabf,null))[_0xcee2('0x22')](function(_0x4d1d7f){_0x437bf4[_0xcee2('0x76')]=_0x4d1d7f;_0x437bf4[_0xcee2('0x77')]=_[_0xcee2('0x78')](_0x4d1d7f['Applications'],[_0xcee2('0x79')],['asc']);if(_0x437bf4[_0xcee2('0x76')][_0xcee2('0x75')]){delete _0x437bf4['account'][_0xcee2('0x75')];}return db['CmContact']['describe']();})['then'](function(_0x4e461b){if(!_0x4e461b){throw new db[(_0xcee2('0x1f'))]['ValidationError'](_0xcee2('0x7a'));}_0x3682c8=_[_0xcee2('0x7b')](_[_0xcee2('0x43')](_0x4e461b),[_0xcee2('0x7c'),_0xcee2('0x7d')]);_0x32997a=_[_0xcee2('0x7b')](_[_0xcee2('0x43')](_0x4e461b),[_0xcee2('0x7c'),'updatedAt',_0xcee2('0x7e'),'ListId']);_0x437bf4['body']={'mapKey':_0xcee2('0x7f')};if(_0x437bf4[_0xcee2('0x76')]['type']){switch(_0x437bf4[_0xcee2('0x76')][_0xcee2('0x40')]){case _0xcee2('0x80'):_0x437bf4['body']['from']=_0x24aac9['body'][_0xcee2('0x81')];_0x437bf4[_0xcee2('0x66')]['body']=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x82')];_0x437bf4[_0xcee2('0x66')]['messageId']=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x83')];break;case'skebby':_0x437bf4['body']['from']='+'+_0x24aac9[_0xcee2('0x66')][_0xcee2('0x84')];_0x437bf4[_0xcee2('0x66')][_0xcee2('0x66')]=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x85')];break;case _0xcee2('0x86'):_0x437bf4[_0xcee2('0x66')][_0xcee2('0x87')]=_0x24aac9[_0xcee2('0x66')]['from'];_0x437bf4[_0xcee2('0x66')]['body']=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x2a')];break;case'clicksend':_0x437bf4['body'][_0xcee2('0x87')]=_0x24aac9['body'][_0xcee2('0x87')];_0x437bf4[_0xcee2('0x66')][_0xcee2('0x66')]=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x66')];_0x437bf4[_0xcee2('0x66')][_0xcee2('0x88')]=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x89')];break;case _0xcee2('0x8a'):_0x437bf4[_0xcee2('0x66')][_0xcee2('0x87')]=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x81')];_0x437bf4[_0xcee2('0x66')][_0xcee2('0x66')]=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x8b')];_0x437bf4[_0xcee2('0x66')][_0xcee2('0x88')]=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x8c')];break;case'infobip':_0x437bf4[_0xcee2('0x66')][_0xcee2('0x87')]='+'+_0x24aac9['body']['results'][0x0][_0xcee2('0x87')];_0x437bf4[_0xcee2('0x66')][_0xcee2('0x66')]=_0x24aac9['body'][_0xcee2('0x8d')][0x0][_0xcee2('0x85')];_0x437bf4[_0xcee2('0x66')]['messageId']=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x8d')][0x0]['messageId'];break;case _0xcee2('0x8e'):_0x437bf4[_0xcee2('0x66')]['from']=_0x24aac9['body'][_0xcee2('0x8f')];_0x437bf4[_0xcee2('0x66')][_0xcee2('0x66')]=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x90')][_0xcee2('0x2a')];break;case'clickatell':_0x437bf4[_0xcee2('0x66')][_0xcee2('0x87')]=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x91')];_0x437bf4[_0xcee2('0x66')]['body']=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x85')];_0x437bf4[_0xcee2('0x66')][_0xcee2('0x88')]=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x92')];break;case _0xcee2('0x93'):_0x437bf4[_0xcee2('0x66')]['from']=_0x24aac9[_0xcee2('0x66')]['from'];_0x437bf4[_0xcee2('0x66')][_0xcee2('0x66')]=_0x24aac9[_0xcee2('0x66')]['message'];_0x437bf4['body'][_0xcee2('0x88')]=_0x24aac9[_0xcee2('0x66')][_0xcee2('0x94')];break;}}if(_0x437bf4[_0xcee2('0x66')]['id']){delete _0x437bf4[_0xcee2('0x66')]['id'];}if(_[_0xcee2('0x95')](_0x437bf4[_0xcee2('0x66')][_0xcee2('0x87')])){throw new db[(_0xcee2('0x1f'))][(_0xcee2('0x20'))](_0xcee2('0x96'));}if(_[_0xcee2('0x95')](_0x437bf4[_0xcee2('0x66')][_0xcee2('0x66')])||_0x437bf4['body'][_0xcee2('0x66')]===''){throw new db[(_0xcee2('0x1f'))]['ValidationError'](_0xcee2('0x97'));}if(_['isNil'](_0x437bf4['body'][_0xcee2('0x98')])){throw new db[(_0xcee2('0x1f'))][(_0xcee2('0x20'))](_0xcee2('0x99')+_0x32997a);}if(!_[_0xcee2('0x9a')](_0x32997a,_0x437bf4['body'][_0xcee2('0x98')])){throw new db[(_0xcee2('0x1f'))][(_0xcee2('0x20'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x32997a);}_0x107510[_0x437bf4[_0xcee2('0x66')]['mapKey']]=_0x437bf4[_0xcee2('0x66')][_0xcee2('0x87')];return db['CmList'][_0xcee2('0x5d')]({'where':{'id':_0x437bf4[_0xcee2('0x76')][_0xcee2('0x9b')]},'include':[{'model':db['CmContact'],'as':_0xcee2('0x9c'),'where':_0x107510,'limit':0x1,'order':[[_0xcee2('0x7d'),_0xcee2('0x9d')]]}]});})[_0xcee2('0x22')](handleEntityNotFound(_0x22cabf,null))[_0xcee2('0x22')](function(_0x4e1228){if(_0x4e1228){_0x437bf4['list']=_['omit'](_0x4e1228,[_0xcee2('0x9c')]);if(_0x4e1228['Contacts'][_0xcee2('0x49')]){return _0x4e1228['Contacts'][0x0];}var _0x2dee62=_['defaults'](_0x437bf4[_0xcee2('0x66')],{'firstName':_0x437bf4[_0xcee2('0x66')][_0xcee2('0x87')],'ListId':_0x4e1228['id']});_0x2dee62[_0x437bf4['body'][_0xcee2('0x98')]]=_0x437bf4[_0xcee2('0x66')]['from'];return db['CmContact'][_0xcee2('0x5e')](_0x2dee62,{'fields':_0x3682c8,'raw':!![]});}})[_0xcee2('0x22')](handleEntityNotFound(_0x22cabf,null))[_0xcee2('0x22')](function(_0x3e711e){if(_0x3e711e){_0x437bf4[_0xcee2('0x9e')]=_0x3e711e;var _0xe20ab2={'ContactId':_0x3e711e['id'],'phone':_0x437bf4['body'][_0xcee2('0x87')],'SmsAccountId':_0x24aac9[_0xcee2('0x59')]['id']};var _0x30f995={'ContactId':_0x3e711e['id'],'SmsAccountId':_0x24aac9[_0xcee2('0x59')]['id'],'closed':![]};return db['SmsInteraction'][_0xcee2('0x5d')]({'where':_0x30f995})[_0xcee2('0x22')](function(_0x14e94a){if(_0x14e94a){return[_0x14e94a,![]];}return db[_0xcee2('0x9f')]['create'](_0xe20ab2)['then'](function(_0x12c886){return[_0x12c886,!![]];});});}})[_0xcee2('0xa0')](function(_0xc7b69e,_0x4763b5){_0x437bf4[_0xcee2('0xa1')]=_0xc7b69e[_0xcee2('0x38')]({'plain':!![]});_0x437bf4['interaction'][_0xcee2('0xa2')]=![];if(_0x4763b5){if(_0x437bf4[_0xcee2('0x76')][_0xcee2('0xa3')]){_0x437bf4['applications']['push']({'id':0x0,'priority':_0x437bf4[_0xcee2('0x77')][_0xcee2('0x49')]+0x1,'app':_0xcee2('0xa4'),'appdata':'unmanaged','interval':_0xcee2('0xa5')});}_0x437bf4[_0xcee2('0xa1')]['created']=!![];}return db[_0xcee2('0xa6')][_0xcee2('0x5e')]({'phone':_0x437bf4[_0xcee2('0x66')][_0xcee2('0x87')],'messageId':_0x437bf4['body'][_0xcee2('0x88')],'body':_0x437bf4[_0xcee2('0x66')]['body'],'SmsAccountId':_0x24aac9[_0xcee2('0x59')]['id'],'SmsInteractionId':_0xc7b69e['id'],'direction':'in','ContactId':_0xc7b69e[_0xcee2('0xa7')],'AttachmentId':_0x437bf4[_0xcee2('0x66')][_0xcee2('0xa8')]});})[_0xcee2('0x22')](function(_0x2aec9e){_0x437bf4[_0xcee2('0x2a')]=_0x2aec9e;if(_0x437bf4[_0xcee2('0xa1')][_0xcee2('0xa9')]){return db['User'][_0xcee2('0x5d')]({'attributes':['id',_0xcee2('0x3a')],'where':{'id':_0x437bf4[_0xcee2('0xa1')][_0xcee2('0xa9')]}})[_0xcee2('0x22')](function(_0x1e43d9){if(_0x1e43d9){_0x437bf4[_0xcee2('0x77')][_0xcee2('0xaa')]({'id':0x0,'priority':0x0,'app':_0xcee2('0xab'),'appdata':_0x1e43d9[_0xcee2('0x3a')]+','+(_0x437bf4[_0xcee2('0x76')][_0xcee2('0xac')]||0xa),'interval':_0xcee2('0xa5')});}return respondWithRpcPromise(_0xcee2('0xad'),'startRouting',_0x437bf4);});}return respondWithRpcPromise('Start',_0xcee2('0xae'),_0x437bf4);})[_0xcee2('0x22')](function(_0x1c896b){if(_0x1c896b){var _0x32a1df=0xc8;var _0x5317ae=_0xcee2('0xaf');logger[_0xcee2('0x23')](_0xcee2('0x27'),_0x5317ae,_0x32a1df,_0xcee2('0xb0'));logger[_0xcee2('0x26')](_0xcee2('0xb1'),_0x5317ae,_0x32a1df,_0xcee2('0xb0'),JSON['stringify'](_0x1c896b));if(_0x437bf4[_0xcee2('0x76')]['type']===_0xcee2('0x80')){return _0x22cabf[_0xcee2('0x2e')](_0x32a1df)['set']('Content-Type',_0xcee2('0xb2'))[_0xcee2('0x3b')](_0xcee2('0xb3'));}else{return _0x22cabf[_0xcee2('0x2e')](_0x32a1df)[_0xcee2('0x30')](_0x1c896b);}}})[_0xcee2('0x2c')](handleError(_0x22cabf,null));};exports[_0xcee2('0xb4')]=function(_0x5e699c,_0x3de044,_0x1fd448){return db['SmsAccount'][_0xcee2('0x6b')]({'where':{'id':_0x5e699c[_0xcee2('0x59')]['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x3de044,null))[_0xcee2('0x22')](function(_0x221d88){if(_0x221d88){return db['sequelize'][_0xcee2('0xb5')](function(_0x4e720a){return db[_0xcee2('0x74')]['destroy']({'where':{'SmsAccountId':_0x5e699c['params']['id']},'transaction':_0x4e720a})[_0xcee2('0x22')](function(_0x37bd92){var _0x1d4740=_[_0xcee2('0x41')](_0x5e699c['body'],function(_0x5d3a12){_0x5d3a12[_0xcee2('0x69')]=_0x5e699c[_0xcee2('0x59')]['id'];return _0x5d3a12;});return db[_0xcee2('0x74')][_0xcee2('0xb6')](_0x1d4740,{'transaction':_0x4e720a});});})['then'](function(){return db[_0xcee2('0x74')][_0xcee2('0xb7')]({'where':{'SmsAccountId':_0x5e699c['params']['id']},'order':_0xcee2('0x79')});});}})[_0xcee2('0x22')](respondWithResult(_0x3de044,null))[_0xcee2('0x2c')](handleError(_0x3de044,null));};exports[_0xcee2('0xb8')]=function(_0x1dffcd,_0xca1c51,_0x4c024c){var _0x35659f={};var _0x2e77de={};var _0x5cf3ce;var _0x6fd94b;return db[_0xcee2('0x3e')][_0xcee2('0x6b')]({'where':{'id':_0x1dffcd[_0xcee2('0x59')]['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0xca1c51,null))['then'](function(_0x38cb6e){if(_0x38cb6e){_0x5cf3ce=_0x38cb6e;_0x2e77de['model']=_['keys'](db[_0xcee2('0x74')][_0xcee2('0x5b')]);_0x2e77de[_0xcee2('0x42')]=_[_0xcee2('0x43')](_0x1dffcd[_0xcee2('0x42')]);_0x2e77de[_0xcee2('0x44')]=_['intersection'](_0x2e77de[_0xcee2('0x46')],_0x2e77de['query']);_0x35659f[_0xcee2('0x48')]=_[_0xcee2('0x45')](_0x2e77de[_0xcee2('0x46')],qs['fields'](_0x1dffcd[_0xcee2('0x42')]['fields']));_0x35659f['attributes']=_0x35659f['attributes']['length']?_0x35659f[_0xcee2('0x48')]:_0x2e77de[_0xcee2('0x46')];_0x35659f['order']=qs['sort'](_0x1dffcd[_0xcee2('0x42')][_0xcee2('0x4e')]);_0x35659f[_0xcee2('0x4f')]=qs[_0xcee2('0x44')](_[_0xcee2('0x50')](_0x1dffcd[_0xcee2('0x42')],_0x2e77de[_0xcee2('0x44')]));if(_0x1dffcd[_0xcee2('0x42')][_0xcee2('0x51')]){_0x35659f[_0xcee2('0x4f')]=_[_0xcee2('0x53')](_0x35659f[_0xcee2('0x4f')],{'$or':_[_0xcee2('0x41')](_0x35659f[_0xcee2('0x48')],function(_0x1e562f){var _0x286b91={};_0x286b91[_0x1e562f]={'$like':'%'+_0x1dffcd['query'][_0xcee2('0x51')]+'%'};return _0x286b91;})});}_0x35659f=_[_0xcee2('0x53')]({},_0x35659f,_0x1dffcd[_0xcee2('0x5c')]);return _0x5cf3ce['getApplications'](_0x35659f);}})[_0xcee2('0x22')](function(_0x41fe93){if(_0x41fe93){_0x6fd94b=_0x41fe93[_0xcee2('0x49')];if(!_0x1dffcd['query']['hasOwnProperty'](_0xcee2('0x4b'))){_0x35659f['limit']=qs[_0xcee2('0x4c')](_0x1dffcd[_0xcee2('0x42')][_0xcee2('0x4c')]);_0x35659f[_0xcee2('0x31')]=qs['offset'](_0x1dffcd['query'][_0xcee2('0x31')]);}return _0x5cf3ce[_0xcee2('0xb8')](_0x35659f);}})[_0xcee2('0x22')](function(_0x3d3cac){if(_0x3d3cac){return _0x3d3cac?{'count':_0x6fd94b,'rows':_0x3d3cac}:null;}})[_0xcee2('0x22')](respondWithResult(_0xca1c51,null))['catch'](handleError(_0xca1c51,null));};exports[_0xcee2('0xb9')]=function(_0x97d743,_0xa26b02,_0x1509e4){var _0x32a095={'raw':![],'where':{}};var _0x3d07a2={};var _0x271ad0={'count':0x0,'rows':[]};return db[_0xcee2('0x3e')][_0xcee2('0x6b')]({'where':{'id':_0x97d743[_0xcee2('0x59')]['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0xa26b02,null))['then'](function(_0x5d0177){if(_0x5d0177){_0x3d07a2[_0xcee2('0x46')]=_['keys'](db['SmsInteraction'][_0xcee2('0x5b')]);_0x3d07a2[_0xcee2('0x42')]=_[_0xcee2('0x43')](_0x97d743[_0xcee2('0x42')]);_0x3d07a2[_0xcee2('0x44')]=_[_0xcee2('0x45')](_0x3d07a2['model'],_0x3d07a2[_0xcee2('0x42')]);_0x32a095[_0xcee2('0x48')]=_[_0xcee2('0x45')](_0x3d07a2[_0xcee2('0x46')],qs['fields'](_0x97d743['query'][_0xcee2('0x47')]));_0x32a095[_0xcee2('0x48')]=_0x32a095[_0xcee2('0x48')][_0xcee2('0x49')]?_0x32a095['attributes']:_0x3d07a2['model'];if(!_0x97d743['query']['hasOwnProperty'](_0xcee2('0x4b'))){_0x32a095[_0xcee2('0x4c')]=qs[_0xcee2('0x4c')](_0x97d743[_0xcee2('0x42')][_0xcee2('0x4c')]);_0x32a095['offset']=qs[_0xcee2('0x31')](_0x97d743[_0xcee2('0x42')][_0xcee2('0x31')]);}_0x32a095[_0xcee2('0x4d')]=qs['sort'](_0x97d743[_0xcee2('0x42')][_0xcee2('0x4e')]);_0x32a095[_0xcee2('0x4f')]=qs['filters'](_['pick'](_0x97d743['query'],_0x3d07a2[_0xcee2('0x44')]));_0x32a095[_0xcee2('0x4f')]['SmsAccountId']=_0x5d0177['id'];if(_0x97d743[_0xcee2('0x42')][_0xcee2('0x51')]){_0x32a095['where']=_[_0xcee2('0x53')](_0x32a095[_0xcee2('0x4f')],{'$or':_[_0xcee2('0x41')](_0x32a095['attributes'],function(_0x5336b6){var _0x5af6a6={};_0x5af6a6[_0x5336b6]={'$like':'%'+_0x97d743['query'][_0xcee2('0x51')]+'%'};return _0x5af6a6;})});}_0x32a095=_[_0xcee2('0x53')]({},_0x32a095,_0x97d743[_0xcee2('0x5c')]);return db[_0xcee2('0x9f')]['count']({'where':_0x32a095['where']})[_0xcee2('0x22')](function(_0x3fa43e){_0x271ad0['count']=_0x3fa43e;if(_0x97d743[_0xcee2('0x42')]['includeAll']){_0x32a095[_0xcee2('0x56')]=[{'model':db[_0xcee2('0xba')],'as':_0xcee2('0xbb'),'required':![]},{'model':db['User'],'as':_0xcee2('0xbc'),'attributes':[_0xcee2('0x3a'),_0xcee2('0xbd'),_0xcee2('0xbe')],'required':![]},{'model':db[_0xcee2('0xbf')],'as':'Tags','attributes':['id',_0xcee2('0x3a'),_0xcee2('0xc0')],'where':_0x97d743[_0xcee2('0x42')][_0xcee2('0xc1')]?{'id':_0x97d743[_0xcee2('0x42')][_0xcee2('0xc1')]}:undefined,'required':_0x97d743['query'][_0xcee2('0xc1')]?!![]:![]}];}return db[_0xcee2('0x9f')][_0xcee2('0x57')](_0x32a095);})[_0xcee2('0x22')](function(_0x5db380){_0x271ad0[_0xcee2('0x58')]=_0x5db380;return _0x271ad0;});}})[_0xcee2('0x22')](respondWithFilteredResult(_0xa26b02,_0x32a095))[_0xcee2('0x2c')](handleError(_0xa26b02,null));};exports[_0xcee2('0x3b')]=function(_0x3869a9,_0x39ae73,_0x5c082c){var _0x36ec8a,_0x185a80,_0x4278ee;if(_['isNil'](_0x3869a9['body']['body'])||_0x3869a9['body'][_0xcee2('0x66')]===''){throw new db['Sequelize'][(_0xcee2('0x20'))](_0xcee2('0x97'));}if(_['isNil'](_0x3869a9['body']['to'])){throw new db[(_0xcee2('0x1f'))]['ValidationError'](_0xcee2('0xc2'));}_0x36ec8a=_0x3869a9[_0xcee2('0x66')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x3869a9[_0xcee2('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xcee2('0x9c'),'where':{'mobile':_0x36ec8a},'limit':0x1,'order':[[_0xcee2('0x7d'),_0xcee2('0x9d')]]}]}]})[_0xcee2('0x22')](handleEntityNotFound(_0x39ae73,null))['then'](function(_0x452f10){if(_0x452f10&&_0x452f10[_0xcee2('0xc3')]){_0x185a80=_0x452f10[_0xcee2('0x38')]({'plain':!![]});if(_0x185a80[_0xcee2('0xc3')]&&_0x185a80[_0xcee2('0xc3')][_0xcee2('0x9c')][_0xcee2('0x49')]){return _0x185a80[_0xcee2('0xc3')][_0xcee2('0x9c')][0x0];}return db[_0xcee2('0xba')][_0xcee2('0x5e')](_[_0xcee2('0x18')](_0x3869a9[_0xcee2('0x66')],{'firstName':_0x36ec8a,'mobile':_0x36ec8a,'phone':_0x36ec8a,'ListId':_0x185a80['ListId']}));}})[_0xcee2('0x22')](handleEntityNotFound(_0x39ae73,null))['then'](function(_0x537eec){if(_0x537eec){_0x4278ee=_0x537eec;return db[_0xcee2('0x9f')]['find']({'where':{'ContactId':_0x4278ee['id'],'closed':![],'SmsAccountId':_0x185a80['id']}})[_0xcee2('0x22')](function(_0x48d504){if(_0x48d504){return[_0x48d504,![]];}return db['SmsInteraction'][_0xcee2('0x5e')]({'UserId':_0x3869a9['user']['id'],'ContactId':_0x4278ee['id'],'SmsAccountId':_0x185a80['id'],'phone':_0x36ec8a,'firstMsgDirection':_0xcee2('0xc4'),'Messages':[_[_0xcee2('0x53')](_0x3869a9[_0xcee2('0x66')],{'read':![],'body':_0x3869a9[_0xcee2('0x66')]['body'],'phone':_0x36ec8a,'SmsAccountId':_0x185a80['id'],'UserId':_0x3869a9[_0xcee2('0x5f')]['id'],'ContactId':_0x4278ee['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xcee2('0xc5')}]})[_0xcee2('0x22')](function(_0x33b817){return[_0x33b817,!![]];});});}})[_0xcee2('0xa0')](function(_0x57c06f,_0x5dbf77){if(_0x5dbf77){return _0x57c06f;}return db['SmsMessage'][_0xcee2('0x5e')](_[_0xcee2('0x53')](_0x3869a9[_0xcee2('0x66')],{'read':![],'body':_0x3869a9[_0xcee2('0x66')][_0xcee2('0x66')],'phone':_0x36ec8a,'SmsAccountId':_0x185a80['id'],'SmsInteractionId':_0x57c06f['id'],'UserId':_0x3869a9[_0xcee2('0x5f')]['id'],'ContactId':_0x4278ee['id']}))[_0xcee2('0x22')](function(_0x28c709){_0x57c06f['dataValues']['Messages']=[];_0x57c06f[_0xcee2('0xc6')][_0xcee2('0xc5')][_0xcee2('0xc7')](_0x28c709[_0xcee2('0xc6')]);return _0x57c06f;});})[_0xcee2('0x22')](respondWithResult(_0x39ae73,null))[_0xcee2('0x2c')](handleError(_0x39ae73,null));};exports[_0xcee2('0x2e')]=function(_0x2b12c9,_0x57f033,_0x4d5fb2){if(_0x2b12c9[_0xcee2('0x66')]['id']){delete _0x2b12c9[_0xcee2('0x66')]['id'];}console[_0xcee2('0xc8')](_0xcee2('0xc9'),_0x2b12c9[_0xcee2('0x66')]);var _0x1a4589,_0xf778b5,_0x158598;return db[_0xcee2('0x3e')][_0xcee2('0x5d')]({'where':{'id':_0x2b12c9[_0xcee2('0x59')]['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x57f033,null))[_0xcee2('0x22')](function(_0x4cad6d){if(_0x4cad6d){_0x158598=_0x4cad6d;logger[_0xcee2('0x26')](_0xcee2('0x27'),_0xcee2('0x2e'),_0xcee2('0xca'),_0x4cad6d[_0xcee2('0x40')],util[_0xcee2('0xcb')](_0x2b12c9[_0xcee2('0x66')],{'showHidden':![],'depth':null}));switch(_0x4cad6d[_0xcee2('0x40')]){case _0xcee2('0xcc'):if(_0x2b12c9[_0xcee2('0x66')][_0xcee2('0xcd')]&&_0x2b12c9[_0xcee2('0x66')][_0xcee2('0x2e')]){_0xf778b5=_0x2b12c9[_0xcee2('0x66')][_0xcee2('0x2e')];return db['SmsMessage'][_0xcee2('0x5d')]({'where':{'messageId':_0x2b12c9[_0xcee2('0x66')][_0xcee2('0xcd')]}});}break;case'connectel':if(_0x2b12c9['body'][_0xcee2('0xce')]&&_0x2b12c9[_0xcee2('0x66')][_0xcee2('0xcf')]){_0xf778b5=_0x2b12c9[_0xcee2('0x66')][_0xcee2('0xcf')];return db[_0xcee2('0xa6')][_0xcee2('0x5d')]({'where':{'messageId':_0x2b12c9[_0xcee2('0x66')][_0xcee2('0xce')]}});}break;case _0xcee2('0xd0'):if(_0x2b12c9[_0xcee2('0x66')]['message_id']&&_0x2b12c9[_0xcee2('0x66')][_0xcee2('0xd1')]){_0xf778b5=_0x2b12c9[_0xcee2('0x66')][_0xcee2('0xd1')];return db[_0xcee2('0xa6')]['find']({'where':{'messageId':_0x2b12c9[_0xcee2('0x66')][_0xcee2('0x89')]}});}break;case _0xcee2('0xd2'):var _0x8d98b8=_0x2b12c9[_0xcee2('0x66')][_0xcee2('0x8d')][0x0];if(_0x8d98b8[_0xcee2('0x88')]&&_0x8d98b8[_0xcee2('0x2e')][_0xcee2('0xd3')]===_0xcee2('0xd4')){_0xf778b5=_0x8d98b8[_0xcee2('0x2e')][_0xcee2('0xd3')];return db['SmsMessage']['find']({'where':{'messageId':_0x8d98b8[_0xcee2('0x88')]}});}break;case _0xcee2('0xd5'):if(_0x2b12c9[_0xcee2('0x66')]['messageId']&&_0x2b12c9[_0xcee2('0x66')][_0xcee2('0x2e')]){_0xf778b5=_0x2b12c9['body'][_0xcee2('0x2e')];return db[_0xcee2('0xa6')][_0xcee2('0x5d')]({'where':{'messageId':_0x2b12c9[_0xcee2('0x66')][_0xcee2('0x88')]}});}break;case _0xcee2('0x93'):if(_0x2b12c9[_0xcee2('0x66')]['redif']&&_0x2b12c9['body'][_0xcee2('0x2e')]){_0xf778b5=_0x2b12c9[_0xcee2('0x66')][_0xcee2('0x2e')];return db[_0xcee2('0xa6')][_0xcee2('0x5d')]({'where':{'messageId':_0x2b12c9[_0xcee2('0x66')]['redif']}});}break;}}})[_0xcee2('0x22')](handleEntityNotFound(_0x57f033,null))[_0xcee2('0x22')](function(_0x5ea6dd){if(_0x5ea6dd){_0x1a4589=_0x5ea6dd;switch(_0x158598[_0xcee2('0x40')]){case _0xcee2('0xcc'):if(_0xf778b5===_0xcee2('0xd4')){return _0x1a4589['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xcee2('0x2e'),_0xcee2('0xcc'),util[_0xcee2('0xcb')](_0x2b12c9[_0xcee2('0x66')],{'showHidden':![],'depth':null}));}break;case _0xcee2('0x86'):if(_0xf778b5==='1'){return _0x1a4589['update']({'read':!![]});}else{logger[_0xcee2('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xcee2('0xcc'),util[_0xcee2('0xcb')](_0x2b12c9[_0xcee2('0x66')],{'showHidden':![],'depth':null}));}break;case _0xcee2('0xd0'):if(!_0x2b12c9[_0xcee2('0x66')][_0xcee2('0xd6')]&&_0xf778b5>=0xc8&&_0xf778b5<=0xce){return _0x1a4589[_0xcee2('0x36')]({'read':!![]});}else{logger[_0xcee2('0x29')](_0xcee2('0x27'),_0xcee2('0x2e'),_0xcee2('0xd0'),util[_0xcee2('0xcb')](_0x2b12c9[_0xcee2('0x66')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x381580=_0x2b12c9[_0xcee2('0x66')][_0xcee2('0x8d')][0x0];if(_0x381580[_0xcee2('0x2e')]['groupName']===_0xcee2('0xd4')){return _0x1a4589[_0xcee2('0x36')]({'read':!![]});}else{logger[_0xcee2('0x29')](_0xcee2('0x27'),'status',_0xcee2('0xd2'),util[_0xcee2('0xcb')](_0x2b12c9['body'],{'showHidden':![],'depth':null}));}break;case _0xcee2('0xd5'):if(_0xf778b5==_0xcee2('0xd7')||_0xf778b5==_0xcee2('0xd8')){return _0x1a4589[_0xcee2('0x36')]({'read':!![]});}else{logger[_0xcee2('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xcee2('0xd5'),util[_0xcee2('0xcb')](_0x2b12c9[_0xcee2('0x66')],{'showHidden':![],'depth':null}));}break;case _0xcee2('0x93'):if(_0xf778b5==='DELIVRD'||_0xf778b5===_0xcee2('0xd9')){return _0x1a4589[_0xcee2('0x36')]({'read':!![]});}else{logger[_0xcee2('0x29')](_0xcee2('0x27'),'status',_0xcee2('0x93'),util['inspect'](_0x2b12c9[_0xcee2('0x66')],{'showHidden':![],'depth':null}));}break;}return _0x1a4589;}})[_0xcee2('0x22')](respondWithResult(_0x57f033,null))['catch'](handleError(_0x57f033,null));};exports[_0xcee2('0xda')]=function(_0x21670d,_0x59d141,_0xb7759c){var _0x24f226,_0xab5890,_0x55313a;return db['SmsAccount'][_0xcee2('0x5d')]({'where':{'id':_0x21670d[_0xcee2('0x59')]['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x59d141,null))[_0xcee2('0x22')](function(_0x50daaf){if(_0x50daaf){_0x55313a=_0x50daaf;logger[_0xcee2('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x50daaf['type'],util[_0xcee2('0xcb')](_0x21670d[_0xcee2('0x42')],{'showHidden':![],'depth':null}));switch(_0x50daaf[_0xcee2('0x40')]){case _0xcee2('0x8e'):if(_0x21670d[_0xcee2('0x42')]['message-id']&&_0x21670d[_0xcee2('0x42')][_0xcee2('0xdb')]){_0xab5890=_0x21670d[_0xcee2('0x42')][_0xcee2('0xdb')];return db[_0xcee2('0xa6')][_0xcee2('0x5d')]({'where':{'messageId':_0x21670d['query'][_0xcee2('0xdc')]}});}break;}}})[_0xcee2('0x22')](handleEntityNotFound(_0x59d141,null))[_0xcee2('0x22')](function(_0x2c83b8){if(_0x2c83b8){_0x24f226=_0x2c83b8;switch(_0x55313a[_0xcee2('0x40')]){case _0xcee2('0x8e'):if(_0xab5890==='2'||_0xab5890==='6'){return _0x24f226[_0xcee2('0x36')]({'read':!![]});}else{logger['error'](_0xcee2('0x27'),_0xcee2('0x2e'),_0xcee2('0x8e'),util[_0xcee2('0xcb')](_0x21670d[_0xcee2('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x24f226;}})['then'](respondWithResult(_0x59d141,null))['catch'](handleError(_0x59d141,null));};exports['addAgents']=function(_0x4b8b9d,_0x4209a2,_0x3e5897){return db[_0xcee2('0x3e')][_0xcee2('0x5d')]({'where':{'id':_0x4b8b9d[_0xcee2('0x59')]['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x4209a2,null))[_0xcee2('0x22')](function(_0x3c334d){if(_0x3c334d){return _0x3c334d[_0xcee2('0xdd')](_0x4b8b9d[_0xcee2('0x66')]['ids'],_[_0xcee2('0xde')](_0x4b8b9d['body'],['ids','id'])||{})[_0xcee2('0xa0')](function(_0x47a0db){for(var _0x34b835=0x0;_0x34b835<_0x4b8b9d[_0xcee2('0x66')]['ids']['length'];_0x34b835+=0x1){socket[_0xcee2('0xdf')](_0xcee2('0xe0'),{'UserId':_0x4b8b9d[_0xcee2('0x66')]['ids'][_0x34b835],'SmsAccountId':_0x4b8b9d[_0xcee2('0x59')]['id']});}return _0x47a0db;});}})[_0xcee2('0x22')](respondWithResult(_0x4209a2,null))['catch'](handleError(_0x4209a2,null));};exports[_0xcee2('0xe1')]=function(_0x83f83b,_0x2bab83,_0x27a7af){return db['SmsAccount'][_0xcee2('0x5d')]({'where':{'id':_0x83f83b[_0xcee2('0x59')]['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x2bab83,null))[_0xcee2('0x22')](function(_0x315600){if(_0x315600){return _0x315600['removeAgents'](_0x83f83b['query'][_0xcee2('0x6e')])['then'](function(){if(_[_0xcee2('0xe2')](_0x83f83b['query'][_0xcee2('0x6e')])){for(var _0x5c135e=0x0;_0x5c135e<_0x83f83b[_0xcee2('0x42')]['ids'][_0xcee2('0x49')];_0x5c135e+=0x1){socket[_0xcee2('0xdf')](_0xcee2('0xe3'),{'UserId':Number(_0x83f83b[_0xcee2('0x42')]['ids'][_0x5c135e]),'SmsAccountId':Number(_0x83f83b[_0xcee2('0x59')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x83f83b[_0xcee2('0x42')]['ids']),'SmsAccountId':Number(_0x83f83b['params']['id'])});}});}})[_0xcee2('0x22')](respondWithStatusCode(_0x2bab83,null))[_0xcee2('0x2c')](handleError(_0x2bab83,null));};exports[_0xcee2('0xe4')]=function(_0x3961b9,_0x4bf6d6,_0x22768a){var _0x3c3f70={};var _0xfe32ad={};var _0x184b48;var _0xd8bed4;return db[_0xcee2('0x3e')][_0xcee2('0x6b')]({'where':{'id':_0x3961b9[_0xcee2('0x59')]['id']}})[_0xcee2('0x22')](handleEntityNotFound(_0x4bf6d6,null))[_0xcee2('0x22')](function(_0x409954){if(_0x409954){_0x184b48=_0x409954;_0xfe32ad['model']=_[_0xcee2('0x43')](db['User'][_0xcee2('0x5b')]);_0xfe32ad[_0xcee2('0x42')]=_[_0xcee2('0x43')](_0x3961b9[_0xcee2('0x42')]);_0xfe32ad['filters']=_[_0xcee2('0x45')](_0xfe32ad[_0xcee2('0x46')],_0xfe32ad[_0xcee2('0x42')]);_0x3c3f70['attributes']=_['intersection'](_0xfe32ad['model'],qs[_0xcee2('0x47')](_0x3961b9[_0xcee2('0x42')][_0xcee2('0x47')]));_0x3c3f70['attributes']=_0x3c3f70[_0xcee2('0x48')]['length']?_0x3c3f70[_0xcee2('0x48')]:_0xfe32ad[_0xcee2('0x46')];_0x3c3f70[_0xcee2('0x4d')]=qs['sort'](_0x3961b9[_0xcee2('0x42')][_0xcee2('0x4e')]);_0x3c3f70['where']=qs[_0xcee2('0x44')](_['pick'](_0x3961b9['query'],_0xfe32ad[_0xcee2('0x44')]));if(_0x3961b9[_0xcee2('0x42')][_0xcee2('0x51')]){_0x3c3f70[_0xcee2('0x4f')]=_[_0xcee2('0x53')](_0x3c3f70[_0xcee2('0x4f')],{'$or':_[_0xcee2('0x41')](_0x3c3f70[_0xcee2('0x48')],function(_0x183325){var _0x162e0c={};_0x162e0c[_0x183325]={'$like':'%'+_0x3961b9[_0xcee2('0x42')]['filter']+'%'};return _0x162e0c;})});}_0x3c3f70=_['merge']({},_0x3c3f70,_0x3961b9[_0xcee2('0x5c')]);return _0x184b48['getAgents'](_0x3c3f70);}})[_0xcee2('0x22')](function(_0x4c7f51){if(_0x4c7f51){_0xd8bed4=_0x4c7f51[_0xcee2('0x49')];if(!_0x3961b9['query'][_0xcee2('0x4a')](_0xcee2('0x4b'))){_0x3c3f70[_0xcee2('0x4c')]=qs[_0xcee2('0x4c')](_0x3961b9[_0xcee2('0x42')]['limit']);_0x3c3f70[_0xcee2('0x31')]=qs['offset'](_0x3961b9['query'][_0xcee2('0x31')]);}return _0x184b48[_0xcee2('0xe4')](_0x3c3f70);}})[_0xcee2('0x22')](function(_0x7762c9){if(_0x7762c9){return _0x7762c9?{'count':_0xd8bed4,'rows':_0x7762c9}:null;}})[_0xcee2('0x22')](respondWithResult(_0x4bf6d6,null))[_0xcee2('0x2c')](handleError(_0x4bf6d6,null));}; \ No newline at end of file +var _0xfb11=['defaults','localhost','./smsAccount.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','SmsAccount,\x20%s,\x20%s','SmsAccount,\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','update','get','SmsAccounts','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','SmsAccountId','removeDispositions','ids','CannedAnswer','findAll','removeAnswers','notify','SmsApplication','Applications','account','priority','asc','CmContact','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','connectel','message_id','plivo','MessageUUID','results','text','csc','originatingAddress','fromNumber','replyMessageId','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','list','omit','contact','SmsInteraction','spread','interaction','created','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','applications','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','addApplications','sequelize','transaction','bulkCreate','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','dataValues','Messages','push','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','infobip','groupName','DELIVERED','clickatell','redif','clicksend','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis'];(function(_0x1fb22a,_0x26d964){var _0x5896ce=function(_0x2d162e){while(--_0x2d162e){_0x1fb22a['push'](_0x1fb22a['shift']());}};_0x5896ce(++_0x26d964);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xfb11[_0x139a3c];return _0x2b375b;};'use strict';var pdf=require(_0x1fb1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1fb1('0x1'));var zipdir=require(_0x1fb1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1fb1('0x3'));var moment=require('moment');var BPromise=require(_0x1fb1('0x4'));var Mustache=require('mustache');var util=require(_0x1fb1('0x5'));var path=require(_0x1fb1('0x6'));var sox=require('sox');var csv=require(_0x1fb1('0x7'));var ejs=require(_0x1fb1('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1fb1('0x9'));var crypto=require(_0x1fb1('0xa'));var jsforce=require(_0x1fb1('0xb'));var deskjs=require(_0x1fb1('0xc'));var toCsv=require(_0x1fb1('0x7'));var querystring=require(_0x1fb1('0xd'));var Papa=require(_0x1fb1('0xe'));var Redis=require(_0x1fb1('0xf'));var authService=require(_0x1fb1('0x10'));var qs=require(_0x1fb1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fb1('0x12'));var logger=require('../../config/logger')(_0x1fb1('0x13'));var utils=require('../../config/utils');var config=require(_0x1fb1('0x14'));var db=require(_0x1fb1('0x15'))['db'];config[_0x1fb1('0x16')]=_[_0x1fb1('0x17')](config[_0x1fb1('0x16')],{'host':_0x1fb1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1fb1('0x16')]));require(_0x1fb1('0x19'))[_0x1fb1('0x1a')](socket);var jayson=require(_0x1fb1('0x1b'));var client=jayson[_0x1fb1('0x1c')][_0x1fb1('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x151152,_0x316fe5,_0x358b58){if(_0x358b58){var _0x4cbe42=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cbe42['test'](_0x316fe5)){return _0x151152;}else{throw new db[(_0x1fb1('0x1e'))][(_0x1fb1('0x1f'))](_0x1fb1('0x20'));}}else{return _0x151152;}}function respondWithRpcPromise(_0x5e0f16,_0x161ca3,_0x23f1f5,_0x24d4df){return new BPromise(function(_0x34076b,_0x33c6b6){var _0x27d71f=_0x24d4df||client;return _0x27d71f[_0x1fb1('0x21')](_0x5e0f16,_0x23f1f5)[_0x1fb1('0x22')](function(_0x4041ea){logger['info'](_0x1fb1('0x23'),_0x161ca3,'request\x20sent');logger['debug'](_0x1fb1('0x24'),_0x161ca3,_0x1fb1('0x25'),JSON[_0x1fb1('0x26')](_0x4041ea));if(_0x4041ea['error']){if(_0x4041ea[_0x1fb1('0x27')]['code']===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x161ca3,_0x4041ea[_0x1fb1('0x27')][_0x1fb1('0x28')]);return _0x33c6b6(_0x4041ea[_0x1fb1('0x27')][_0x1fb1('0x28')]);}logger[_0x1fb1('0x27')]('SmsAccount,\x20%s,\x20%s',_0x161ca3,_0x4041ea[_0x1fb1('0x27')][_0x1fb1('0x28')]);return _0x34076b(_0x4041ea[_0x1fb1('0x27')][_0x1fb1('0x28')]);}else{logger[_0x1fb1('0x29')](_0x1fb1('0x23'),_0x161ca3,_0x1fb1('0x25'));_0x34076b(_0x4041ea[_0x1fb1('0x2a')]['message']);}})[_0x1fb1('0x2b')](function(_0x1aac7d){logger[_0x1fb1('0x27')](_0x1fb1('0x23'),_0x161ca3,_0x1aac7d);_0x33c6b6(_0x1aac7d);});});}function respondWithStatusCode(_0x1898e7,_0x29e1bd){_0x29e1bd=_0x29e1bd||0xcc;return function(_0x1a74c4){if(_0x1a74c4){return _0x1898e7[_0x1fb1('0x2c')](_0x29e1bd);}return _0x1898e7[_0x1fb1('0x2d')](_0x29e1bd)[_0x1fb1('0x2e')]();};}function respondWithResult(_0x5e99e7,_0x497017){_0x497017=_0x497017||0xc8;return function(_0x39fc43){if(_0x39fc43){return _0x5e99e7[_0x1fb1('0x2d')](_0x497017)[_0x1fb1('0x2f')](_0x39fc43);}};}function respondWithFilteredResult(_0x520ee2,_0x106134){return function(_0x316f7c){if(_0x316f7c){var _0x90d8ef=_0x316f7c[_0x1fb1('0x30')],_0x1b71cb=_0x106134['offset'],_0x5402e9=_0x106134[_0x1fb1('0x31')]+_0x106134['limit'],_0x245f84;if(_0x5402e9>=_0x90d8ef){_0x5402e9=_0x90d8ef;_0x245f84=0xc8;}else{_0x245f84=0xce;}_0x520ee2['status'](_0x245f84);return _0x520ee2[_0x1fb1('0x32')](_0x1fb1('0x33'),_0x1b71cb+'-'+_0x5402e9+'/'+_0x90d8ef)['json'](_0x316f7c);}return null;};}function patchUpdates(_0x5936d6){return function(_0x149753){try{jsonpatch[_0x1fb1('0x34')](_0x149753,_0x5936d6,!![]);}catch(_0x2ebb82){return BPromise[_0x1fb1('0x35')](_0x2ebb82);}return _0x149753['save']();};}function saveUpdates(_0x1cac1e,_0x366af4){return function(_0x9ad059){if(_0x9ad059){return _0x9ad059[_0x1fb1('0x36')](_0x1cac1e)[_0x1fb1('0x22')](function(_0x307700){return _0x307700;});}return null;};}function removeEntity(_0x28e986,_0x2a9a57){return function(_0x72a80d){if(_0x72a80d){return _0x72a80d['destroy']()[_0x1fb1('0x22')](function(){var _0x4b4271=_0x72a80d[_0x1fb1('0x37')]({'plain':!![]});var _0x482ddb=_0x1fb1('0x38');return db['UserProfileResource']['destroy']({'where':{'type':_0x482ddb,'resourceId':_0x4b4271['id']}})[_0x1fb1('0x22')](function(){return _0x72a80d;});})[_0x1fb1('0x22')](function(){_0x28e986[_0x1fb1('0x2d')](0xcc)[_0x1fb1('0x2e')]();});}};}function handleEntityNotFound(_0x564ed9,_0x3b0642){return function(_0x9a78df){if(!_0x9a78df){_0x564ed9[_0x1fb1('0x2c')](0x194);}return _0x9a78df;};}function handleError(_0x5be2f3,_0x3bbec9){_0x3bbec9=_0x3bbec9||0x1f4;return function(_0x35aa83){logger[_0x1fb1('0x27')](_0x35aa83[_0x1fb1('0x39')]);if(_0x35aa83[_0x1fb1('0x3a')]){delete _0x35aa83[_0x1fb1('0x3a')];}_0x5be2f3[_0x1fb1('0x2d')](_0x3bbec9)['send'](_0x35aa83);};}exports[_0x1fb1('0x3b')]=function(_0x2e04a9,_0x55d7ea){var _0x473894={'include':[{'model':db[_0x1fb1('0x3c')],'as':_0x1fb1('0x3d')}]},_0x51c83f={},_0x369146={'count':0x0,'rows':[]};var _0x439eec=_[_0x1fb1('0x3e')](db[_0x1fb1('0x3f')][_0x1fb1('0x40')],function(_0x582003){return{'name':_0x582003[_0x1fb1('0x41')],'type':_0x582003[_0x1fb1('0x42')][_0x1fb1('0x43')]};});_0x51c83f[_0x1fb1('0x44')]=_[_0x1fb1('0x3e')](_0x439eec,_0x1fb1('0x3a'));_0x51c83f[_0x1fb1('0x45')]=_['keys'](_0x2e04a9[_0x1fb1('0x45')]);_0x51c83f[_0x1fb1('0x46')]=_[_0x1fb1('0x47')](_0x51c83f[_0x1fb1('0x44')],_0x51c83f['query']);_0x473894['attributes']=_[_0x1fb1('0x47')](_0x51c83f[_0x1fb1('0x44')],qs[_0x1fb1('0x48')](_0x2e04a9[_0x1fb1('0x45')][_0x1fb1('0x48')]));_0x473894[_0x1fb1('0x49')]=_0x473894[_0x1fb1('0x49')][_0x1fb1('0x4a')]?_0x473894[_0x1fb1('0x49')]:_0x51c83f[_0x1fb1('0x44')];if(!_0x2e04a9['query'][_0x1fb1('0x4b')]('nolimit')){_0x473894['limit']=qs[_0x1fb1('0x4c')](_0x2e04a9[_0x1fb1('0x45')][_0x1fb1('0x4c')]);_0x473894[_0x1fb1('0x31')]=qs['offset'](_0x2e04a9['query'][_0x1fb1('0x31')]);}_0x473894[_0x1fb1('0x4d')]=qs[_0x1fb1('0x4e')](_0x2e04a9[_0x1fb1('0x45')][_0x1fb1('0x4e')]);_0x473894[_0x1fb1('0x4f')]=qs[_0x1fb1('0x46')](_[_0x1fb1('0x50')](_0x2e04a9[_0x1fb1('0x45')],_0x51c83f['filters']));if(_0x2e04a9['query'][_0x1fb1('0x51')]){_0x473894['where']=_[_0x1fb1('0x52')](_0x473894[_0x1fb1('0x4f')],{'$or':_[_0x1fb1('0x3e')](_0x439eec,function(_0x467bf1){if(_0x467bf1[_0x1fb1('0x42')]!==_0x1fb1('0x53')){var _0x5af135={};_0x5af135[_0x467bf1[_0x1fb1('0x3a')]]={'$like':'%'+_0x2e04a9[_0x1fb1('0x45')][_0x1fb1('0x51')]+'%'};return _0x5af135;}})});}_0x473894=_['merge']({},_0x473894,_0x2e04a9[_0x1fb1('0x54')]);var _0x4861b4={'where':_0x473894[_0x1fb1('0x4f')]};return db[_0x1fb1('0x3f')][_0x1fb1('0x30')](_0x4861b4)['then'](function(_0x285afd){_0x369146[_0x1fb1('0x30')]=_0x285afd;if(_0x2e04a9['query'][_0x1fb1('0x55')]){_0x473894[_0x1fb1('0x56')]=[{'all':!![]}];}return db[_0x1fb1('0x3f')]['findAll'](_0x473894);})['then'](function(_0x4db0c9){_0x369146[_0x1fb1('0x57')]=_0x4db0c9;return _0x369146;})[_0x1fb1('0x22')](respondWithFilteredResult(_0x55d7ea,_0x473894))[_0x1fb1('0x2b')](handleError(_0x55d7ea,null));};exports[_0x1fb1('0x58')]=function(_0x2cc60e,_0x30c878){var _0x53f794={'raw':![],'where':{'id':_0x2cc60e[_0x1fb1('0x59')]['id']},'include':[{'model':db[_0x1fb1('0x3c')],'as':_0x1fb1('0x3d')}]},_0x556529={};_0x556529[_0x1fb1('0x44')]=_['keys'](db['SmsAccount'][_0x1fb1('0x40')]);_0x556529['query']=_[_0x1fb1('0x5a')](_0x2cc60e['query']);_0x556529[_0x1fb1('0x46')]=_['intersection'](_0x556529[_0x1fb1('0x44')],_0x556529[_0x1fb1('0x45')]);_0x53f794[_0x1fb1('0x49')]=_[_0x1fb1('0x47')](_0x556529[_0x1fb1('0x44')],qs['fields'](_0x2cc60e['query'][_0x1fb1('0x48')]));_0x53f794[_0x1fb1('0x49')]=_0x53f794['attributes']['length']?_0x53f794[_0x1fb1('0x49')]:_0x556529[_0x1fb1('0x44')];if(_0x2cc60e[_0x1fb1('0x45')][_0x1fb1('0x55')]){_0x53f794[_0x1fb1('0x56')]=[{'all':!![]}];}_0x53f794=_[_0x1fb1('0x52')]({},_0x53f794,_0x2cc60e['options']);return db[_0x1fb1('0x3f')][_0x1fb1('0x5b')](_0x53f794)[_0x1fb1('0x22')](handleEntityNotFound(_0x30c878,null))[_0x1fb1('0x22')](respondWithResult(_0x30c878,null))[_0x1fb1('0x2b')](handleError(_0x30c878,null));};exports[_0x1fb1('0x5c')]=function(_0x32899f,_0x5527ef){return db[_0x1fb1('0x3f')][_0x1fb1('0x5c')](_0x32899f[_0x1fb1('0x5d')],{})['then'](function(_0x2ccc4f){var _0x435855=_0x32899f[_0x1fb1('0x5e')]['get']({'plain':!![]});if(!_0x435855)throw new Error(_0x1fb1('0x5f'));if(_0x435855[_0x1fb1('0x60')]===_0x1fb1('0x5e')){var _0x4232cf=_0x2ccc4f[_0x1fb1('0x37')]({'plain':!![]});var _0x1b2ea4='SmsAccounts';return db['UserProfileSection'][_0x1fb1('0x5b')]({'where':{'name':_0x1b2ea4,'userProfileId':_0x435855[_0x1fb1('0x61')]},'raw':!![]})[_0x1fb1('0x22')](function(_0x34549c){if(_0x34549c&&_0x34549c[_0x1fb1('0x62')]===0x0){return db[_0x1fb1('0x63')][_0x1fb1('0x5c')]({'name':_0x4232cf['name'],'resourceId':_0x4232cf['id'],'type':_0x34549c[_0x1fb1('0x3a')],'sectionId':_0x34549c['id']},{})[_0x1fb1('0x22')](function(){return _0x2ccc4f;});}else{return _0x2ccc4f;}})[_0x1fb1('0x2b')](function(_0x2c0c36){logger[_0x1fb1('0x27')](_0x1fb1('0x64'),_0x2c0c36);throw _0x2c0c36;});}return _0x2ccc4f;})['then'](respondWithResult(_0x5527ef,0xc9))[_0x1fb1('0x2b')](handleError(_0x5527ef,null));};exports[_0x1fb1('0x36')]=function(_0x10445e,_0x1d2993){if(_0x10445e[_0x1fb1('0x5d')]['id']){delete _0x10445e['body']['id'];}return db[_0x1fb1('0x3f')][_0x1fb1('0x5b')]({'where':{'id':_0x10445e['params']['id']},'include':[{'model':db[_0x1fb1('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x1fb1('0x22')](handleEntityNotFound(_0x1d2993,null))[_0x1fb1('0x22')](saveUpdates(_0x10445e[_0x1fb1('0x5d')],null))[_0x1fb1('0x22')](respondWithResult(_0x1d2993,null))['catch'](handleError(_0x1d2993,null));};exports[_0x1fb1('0x65')]=function(_0x3fda2b,_0x352182){return db[_0x1fb1('0x3f')]['find']({'where':{'id':_0x3fda2b[_0x1fb1('0x59')]['id']}})['then'](handleEntityNotFound(_0x352182,null))[_0x1fb1('0x22')](removeEntity(_0x352182,null))[_0x1fb1('0x2b')](handleError(_0x352182,null));};exports['describe']=function(_0x3df5fa,_0x3fb4c9){return db[_0x1fb1('0x3f')][_0x1fb1('0x66')]()[_0x1fb1('0x22')](respondWithResult(_0x3fb4c9,null))[_0x1fb1('0x2b')](handleError(_0x3fb4c9,null));};exports[_0x1fb1('0x67')]=function(_0x4fae03,_0x27da64,_0x20f512){if(_0x4fae03['body']['id']){delete _0x4fae03['body']['id'];}return db[_0x1fb1('0x3f')][_0x1fb1('0x5b')]({'where':{'id':_0x4fae03[_0x1fb1('0x59')]['id']}})[_0x1fb1('0x22')](handleEntityNotFound(_0x27da64,null))[_0x1fb1('0x22')](function(_0x26715b){if(_0x26715b){_0x4fae03[_0x1fb1('0x5d')]['SmsAccountId']=_0x26715b['id'];return db[_0x1fb1('0x68')][_0x1fb1('0x5c')](_0x4fae03[_0x1fb1('0x5d')]);}})[_0x1fb1('0x22')](respondWithResult(_0x27da64,null))[_0x1fb1('0x2b')](handleError(_0x27da64,null));};exports[_0x1fb1('0x69')]=function(_0x3c0873,_0x3236df,_0x36e568){var _0x517397={'raw':![],'where':{}};var _0x3d2e2f={};var _0x32ca99={'count':0x0,'rows':[]};return db['SmsAccount'][_0x1fb1('0x6a')]({'where':{'id':_0x3c0873[_0x1fb1('0x59')]['id']}})[_0x1fb1('0x22')](handleEntityNotFound(_0x3236df,null))['then'](function(_0x153ed5){if(_0x153ed5){_0x3d2e2f[_0x1fb1('0x44')]=_[_0x1fb1('0x5a')](db[_0x1fb1('0x68')][_0x1fb1('0x40')]);_0x3d2e2f[_0x1fb1('0x45')]=_[_0x1fb1('0x5a')](_0x3c0873[_0x1fb1('0x45')]);_0x3d2e2f[_0x1fb1('0x46')]=_[_0x1fb1('0x47')](_0x3d2e2f[_0x1fb1('0x44')],_0x3d2e2f[_0x1fb1('0x45')]);_0x517397[_0x1fb1('0x49')]=_[_0x1fb1('0x47')](_0x3d2e2f[_0x1fb1('0x44')],qs[_0x1fb1('0x48')](_0x3c0873[_0x1fb1('0x45')][_0x1fb1('0x48')]));_0x517397[_0x1fb1('0x49')]=_0x517397[_0x1fb1('0x49')][_0x1fb1('0x4a')]?_0x517397['attributes']:_0x3d2e2f['model'];if(!_0x3c0873[_0x1fb1('0x45')]['hasOwnProperty'](_0x1fb1('0x6b'))){_0x517397[_0x1fb1('0x4c')]=qs['limit'](_0x3c0873['query']['limit']);_0x517397['offset']=qs[_0x1fb1('0x31')](_0x3c0873[_0x1fb1('0x45')][_0x1fb1('0x31')]);}_0x517397[_0x1fb1('0x4d')]=qs[_0x1fb1('0x4e')](_0x3c0873[_0x1fb1('0x45')][_0x1fb1('0x4e')]);_0x517397[_0x1fb1('0x4f')]=qs['filters'](_['pick'](_0x3c0873[_0x1fb1('0x45')],_0x3d2e2f[_0x1fb1('0x46')]));_0x517397[_0x1fb1('0x4f')][_0x1fb1('0x6c')]=_0x153ed5['id'];if(_0x3c0873[_0x1fb1('0x45')][_0x1fb1('0x51')]){_0x517397[_0x1fb1('0x4f')]=_[_0x1fb1('0x52')](_0x517397[_0x1fb1('0x4f')],{'$or':_[_0x1fb1('0x3e')](_0x517397['attributes'],function(_0x3de862){var _0x27dc3e={};_0x27dc3e[_0x3de862]={'$like':'%'+_0x3c0873['query'][_0x1fb1('0x51')]+'%'};return _0x27dc3e;})});}_0x517397=_[_0x1fb1('0x52')]({},_0x517397,_0x3c0873[_0x1fb1('0x54')]);return db[_0x1fb1('0x68')][_0x1fb1('0x30')]({'where':_0x517397[_0x1fb1('0x4f')]})[_0x1fb1('0x22')](function(_0x50c22f){_0x32ca99[_0x1fb1('0x30')]=_0x50c22f;if(_0x3c0873[_0x1fb1('0x45')]['includeAll']){_0x517397[_0x1fb1('0x56')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x517397);})[_0x1fb1('0x22')](function(_0x2cc8ed){_0x32ca99[_0x1fb1('0x57')]=_0x2cc8ed;return _0x32ca99;});}})[_0x1fb1('0x22')](respondWithFilteredResult(_0x3236df,_0x517397))[_0x1fb1('0x2b')](handleError(_0x3236df,null));};exports[_0x1fb1('0x6d')]=function(_0x56efbc,_0x474bed,_0x34bba7){return db[_0x1fb1('0x3f')][_0x1fb1('0x5b')]({'where':{'id':_0x56efbc['params']['id']}})[_0x1fb1('0x22')](handleEntityNotFound(_0x474bed,null))[_0x1fb1('0x22')](function(_0x5dd570){if(_0x5dd570){return _0x5dd570['removeDispositions'](_0x56efbc[_0x1fb1('0x45')][_0x1fb1('0x6e')]);}})[_0x1fb1('0x22')](respondWithStatusCode(_0x474bed,null))[_0x1fb1('0x2b')](handleError(_0x474bed,null));};exports['addAnswer']=function(_0x18dd72,_0x5bac13,_0x53dd03){if(_0x18dd72['body']['id']){delete _0x18dd72['body']['id'];}return db[_0x1fb1('0x3f')][_0x1fb1('0x5b')]({'where':{'id':_0x18dd72[_0x1fb1('0x59')]['id']}})[_0x1fb1('0x22')](handleEntityNotFound(_0x5bac13,null))[_0x1fb1('0x22')](function(_0x27f6ef){if(_0x27f6ef){_0x18dd72['body'][_0x1fb1('0x6c')]=_0x27f6ef['id'];return db[_0x1fb1('0x6f')][_0x1fb1('0x5c')](_0x18dd72[_0x1fb1('0x5d')]);}})[_0x1fb1('0x22')](respondWithResult(_0x5bac13,null))[_0x1fb1('0x2b')](handleError(_0x5bac13,null));};exports['getAnswers']=function(_0x3c94b9,_0x1d2113,_0x10bf5f){var _0x1dbc01={'raw':![],'where':{}};var _0x2ef05a={};var _0x4abfb7={'count':0x0,'rows':[]};return db[_0x1fb1('0x3f')][_0x1fb1('0x6a')]({'where':{'id':_0x3c94b9[_0x1fb1('0x59')]['id']}})[_0x1fb1('0x22')](handleEntityNotFound(_0x1d2113,null))[_0x1fb1('0x22')](function(_0x17492b){if(_0x17492b){_0x2ef05a['model']=_['keys'](db['CannedAnswer'][_0x1fb1('0x40')]);_0x2ef05a['query']=_['keys'](_0x3c94b9[_0x1fb1('0x45')]);_0x2ef05a[_0x1fb1('0x46')]=_[_0x1fb1('0x47')](_0x2ef05a[_0x1fb1('0x44')],_0x2ef05a[_0x1fb1('0x45')]);_0x1dbc01[_0x1fb1('0x49')]=_['intersection'](_0x2ef05a[_0x1fb1('0x44')],qs[_0x1fb1('0x48')](_0x3c94b9[_0x1fb1('0x45')][_0x1fb1('0x48')]));_0x1dbc01[_0x1fb1('0x49')]=_0x1dbc01[_0x1fb1('0x49')][_0x1fb1('0x4a')]?_0x1dbc01[_0x1fb1('0x49')]:_0x2ef05a[_0x1fb1('0x44')];if(!_0x3c94b9['query'][_0x1fb1('0x4b')](_0x1fb1('0x6b'))){_0x1dbc01[_0x1fb1('0x4c')]=qs[_0x1fb1('0x4c')](_0x3c94b9[_0x1fb1('0x45')]['limit']);_0x1dbc01[_0x1fb1('0x31')]=qs['offset'](_0x3c94b9[_0x1fb1('0x45')]['offset']);}_0x1dbc01['order']=qs[_0x1fb1('0x4e')](_0x3c94b9['query']['sort']);_0x1dbc01['where']=qs[_0x1fb1('0x46')](_['pick'](_0x3c94b9[_0x1fb1('0x45')],_0x2ef05a[_0x1fb1('0x46')]));_0x1dbc01[_0x1fb1('0x4f')][_0x1fb1('0x6c')]=_0x17492b['id'];if(_0x3c94b9[_0x1fb1('0x45')]['filter']){_0x1dbc01[_0x1fb1('0x4f')]=_[_0x1fb1('0x52')](_0x1dbc01[_0x1fb1('0x4f')],{'$or':_[_0x1fb1('0x3e')](_0x1dbc01[_0x1fb1('0x49')],function(_0x5429a9){var _0x92869={};_0x92869[_0x5429a9]={'$like':'%'+_0x3c94b9[_0x1fb1('0x45')][_0x1fb1('0x51')]+'%'};return _0x92869;})});}_0x1dbc01=_[_0x1fb1('0x52')]({},_0x1dbc01,_0x3c94b9[_0x1fb1('0x54')]);return db[_0x1fb1('0x6f')]['count']({'where':_0x1dbc01['where']})[_0x1fb1('0x22')](function(_0x3116c7){_0x4abfb7[_0x1fb1('0x30')]=_0x3116c7;if(_0x3c94b9[_0x1fb1('0x45')]['includeAll']){_0x1dbc01[_0x1fb1('0x56')]=[{'all':!![]}];}return db[_0x1fb1('0x6f')][_0x1fb1('0x70')](_0x1dbc01);})[_0x1fb1('0x22')](function(_0x2f5947){_0x4abfb7['rows']=_0x2f5947;return _0x4abfb7;});}})[_0x1fb1('0x22')](respondWithFilteredResult(_0x1d2113,_0x1dbc01))[_0x1fb1('0x2b')](handleError(_0x1d2113,null));};exports[_0x1fb1('0x71')]=function(_0x1455e4,_0x1cb1bd,_0x49a091){return db[_0x1fb1('0x3f')]['find']({'where':{'id':_0x1455e4[_0x1fb1('0x59')]['id']}})['then'](handleEntityNotFound(_0x1cb1bd,null))[_0x1fb1('0x22')](function(_0x25b7ed){if(_0x25b7ed){return _0x25b7ed[_0x1fb1('0x71')](_0x1455e4['query'][_0x1fb1('0x6e')]);}})[_0x1fb1('0x22')](respondWithStatusCode(_0x1cb1bd,null))[_0x1fb1('0x2b')](handleError(_0x1cb1bd,null));};exports[_0x1fb1('0x72')]=function(_0x42b73f,_0x1d7462,_0x2188c6){var _0x614e0d={'channel':'sms'};var _0x5f0b43=[];var _0x1d3789=[];var _0x3ae4d1={};return db['SmsAccount'][_0x1fb1('0x5b')]({'where':{'id':_0x42b73f[_0x1fb1('0x59')]['id']},'include':[{'model':db[_0x1fb1('0x73')],'as':_0x1fb1('0x74')}]})[_0x1fb1('0x22')](handleEntityNotFound(_0x1d7462,null))[_0x1fb1('0x22')](function(_0x219015){_0x614e0d[_0x1fb1('0x75')]=_0x219015;_0x614e0d['applications']=_['orderBy'](_0x219015['Applications'],[_0x1fb1('0x76')],[_0x1fb1('0x77')]);if(_0x614e0d[_0x1fb1('0x75')][_0x1fb1('0x74')]){delete _0x614e0d['account'][_0x1fb1('0x74')];}return db[_0x1fb1('0x78')]['describe']();})[_0x1fb1('0x22')](function(_0x1406e8){if(!_0x1406e8){throw new db[(_0x1fb1('0x1e'))][(_0x1fb1('0x1f'))](_0x1fb1('0x79'));}_0x5f0b43=_[_0x1fb1('0x7a')](_['keys'](_0x1406e8),['createdAt',_0x1fb1('0x7b')]);_0x1d3789=_[_0x1fb1('0x7a')](_[_0x1fb1('0x5a')](_0x1406e8),['createdAt',_0x1fb1('0x7b'),_0x1fb1('0x7c'),_0x1fb1('0x7d')]);_0x614e0d['body']={'mapKey':_0x1fb1('0x7e')};if(_0x614e0d[_0x1fb1('0x75')]['type']){switch(_0x614e0d['account'][_0x1fb1('0x42')]){case _0x1fb1('0x7f'):_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x80')]=_0x42b73f['body'][_0x1fb1('0x81')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x5d')]=_0x42b73f['body'][_0x1fb1('0x82')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x83')]=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x84')];break;case _0x1fb1('0x85'):_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x80')]='+'+_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x86')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x5d')]=_0x42b73f[_0x1fb1('0x5d')]['text'];break;case _0x1fb1('0x87'):_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x80')]=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x80')];_0x614e0d['body'][_0x1fb1('0x5d')]=_0x42b73f['body'][_0x1fb1('0x28')];break;case'clicksend':_0x614e0d['body'][_0x1fb1('0x80')]=_0x42b73f['body'][_0x1fb1('0x80')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x5d')]=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x5d')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x83')]=_0x42b73f['body'][_0x1fb1('0x88')];break;case _0x1fb1('0x89'):_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x80')]=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x81')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x5d')]=_0x42b73f[_0x1fb1('0x5d')]['Text'];_0x614e0d['body'][_0x1fb1('0x83')]=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x8a')];break;case'infobip':_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x80')]='+'+_0x42b73f[_0x1fb1('0x5d')]['results'][0x0][_0x1fb1('0x80')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x5d')]=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x8b')][0x0][_0x1fb1('0x8c')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x83')]=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x8b')][0x0]['messageId'];break;case _0x1fb1('0x8d'):_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x80')]=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x8e')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x5d')]=_0x42b73f[_0x1fb1('0x5d')]['segmentedMessage'][_0x1fb1('0x28')];break;case'clickatell':_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x80')]=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x8f')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x5d')]=_0x42b73f['body'][_0x1fb1('0x8c')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x83')]=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x90')];break;case _0x1fb1('0x91'):_0x614e0d['body'][_0x1fb1('0x80')]=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x80')];_0x614e0d[_0x1fb1('0x5d')]['body']=_0x42b73f[_0x1fb1('0x5d')][_0x1fb1('0x28')];_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x83')]=_0x42b73f[_0x1fb1('0x5d')]['refid'];break;}}if(_0x614e0d[_0x1fb1('0x5d')]['id']){delete _0x614e0d[_0x1fb1('0x5d')]['id'];}if(_[_0x1fb1('0x92')](_0x614e0d['body']['from'])){throw new db[(_0x1fb1('0x1e'))][(_0x1fb1('0x1f'))](_0x1fb1('0x93'));}if(_['isNil'](_0x614e0d['body']['body'])||_0x614e0d[_0x1fb1('0x5d')]['body']===''){throw new db[(_0x1fb1('0x1e'))]['ValidationError'](_0x1fb1('0x94'));}if(_[_0x1fb1('0x92')](_0x614e0d['body'][_0x1fb1('0x95')])){throw new db['Sequelize'][(_0x1fb1('0x1f'))](_0x1fb1('0x96')+_0x1d3789);}if(!_[_0x1fb1('0x97')](_0x1d3789,_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x95')])){throw new db[(_0x1fb1('0x1e'))][(_0x1fb1('0x1f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1d3789);}_0x3ae4d1[_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x95')]]=_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x80')];return db[_0x1fb1('0x98')][_0x1fb1('0x5b')]({'where':{'id':_0x614e0d[_0x1fb1('0x75')][_0x1fb1('0x7d')]},'include':[{'model':db['CmContact'],'as':_0x1fb1('0x99'),'where':_0x3ae4d1,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x1fb1('0x22')](handleEntityNotFound(_0x1d7462,null))[_0x1fb1('0x22')](function(_0x586fa0){if(_0x586fa0){_0x614e0d[_0x1fb1('0x9a')]=_[_0x1fb1('0x9b')](_0x586fa0,[_0x1fb1('0x99')]);if(_0x586fa0[_0x1fb1('0x99')][_0x1fb1('0x4a')]){return _0x586fa0[_0x1fb1('0x99')][0x0];}var _0x58daa3=_[_0x1fb1('0x17')](_0x614e0d['body'],{'firstName':_0x614e0d[_0x1fb1('0x5d')]['from'],'ListId':_0x586fa0['id']});_0x58daa3[_0x614e0d['body']['mapKey']]=_0x614e0d['body'][_0x1fb1('0x80')];return db['CmContact']['create'](_0x58daa3,{'fields':_0x5f0b43,'raw':!![]});}})[_0x1fb1('0x22')](handleEntityNotFound(_0x1d7462,null))[_0x1fb1('0x22')](function(_0x4d5517){if(_0x4d5517){_0x614e0d[_0x1fb1('0x9c')]=_0x4d5517;var _0x5796cd={'ContactId':_0x4d5517['id'],'phone':_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x80')],'SmsAccountId':_0x42b73f[_0x1fb1('0x59')]['id']};var _0x59385a={'ContactId':_0x4d5517['id'],'SmsAccountId':_0x42b73f['params']['id'],'closed':![]};return db[_0x1fb1('0x9d')][_0x1fb1('0x5b')]({'where':_0x59385a})[_0x1fb1('0x22')](function(_0x722cc9){if(_0x722cc9){return[_0x722cc9,![]];}return db['SmsInteraction'][_0x1fb1('0x5c')](_0x5796cd)['then'](function(_0x4e4dac){return[_0x4e4dac,!![]];});});}})[_0x1fb1('0x9e')](function(_0x4d5d37,_0x19bc82){_0x614e0d[_0x1fb1('0x9f')]=_0x4d5d37[_0x1fb1('0x37')]({'plain':!![]});_0x614e0d[_0x1fb1('0x9f')][_0x1fb1('0xa0')]=![];if(_0x19bc82){if(_0x614e0d[_0x1fb1('0x75')]['autoclose']){_0x614e0d['applications']['push']({'id':0x0,'priority':_0x614e0d['applications'][_0x1fb1('0x4a')]+0x1,'app':_0x1fb1('0xa1'),'appdata':_0x1fb1('0xa2'),'interval':_0x1fb1('0xa3')});}_0x614e0d['interaction']['created']=!![];}return db[_0x1fb1('0xa4')]['create']({'phone':_0x614e0d['body'][_0x1fb1('0x80')],'messageId':_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0x83')],'body':_0x614e0d['body'][_0x1fb1('0x5d')],'SmsAccountId':_0x42b73f[_0x1fb1('0x59')]['id'],'SmsInteractionId':_0x4d5d37['id'],'direction':'in','ContactId':_0x4d5d37['ContactId'],'AttachmentId':_0x614e0d[_0x1fb1('0x5d')][_0x1fb1('0xa5')]});})[_0x1fb1('0x22')](function(_0x3a1a1b){_0x614e0d[_0x1fb1('0x28')]=_0x3a1a1b;if(_0x614e0d[_0x1fb1('0x9f')][_0x1fb1('0xa6')]){return db['User'][_0x1fb1('0x5b')]({'attributes':['id',_0x1fb1('0x3a')],'where':{'id':_0x614e0d[_0x1fb1('0x9f')][_0x1fb1('0xa6')]}})['then'](function(_0x3f57d4){if(_0x3f57d4){_0x614e0d[_0x1fb1('0xa7')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1fb1('0xa8'),'appdata':_0x3f57d4[_0x1fb1('0x3a')]+','+(_0x614e0d[_0x1fb1('0x75')][_0x1fb1('0xa9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x1fb1('0xaa'),_0x614e0d);});}return respondWithRpcPromise(_0x1fb1('0xab'),_0x1fb1('0xaa'),_0x614e0d);})['then'](function(_0x5d1722){if(_0x5d1722){var _0x414232=0xc8;var _0x577d09=_0x1fb1('0xac');logger['info'](_0x1fb1('0x24'),_0x577d09,_0x414232,_0x1fb1('0xad'));logger[_0x1fb1('0xae')](_0x1fb1('0xaf'),_0x577d09,_0x414232,'entity\x20found',JSON[_0x1fb1('0x26')](_0x5d1722));if(_0x614e0d[_0x1fb1('0x75')][_0x1fb1('0x42')]===_0x1fb1('0x7f')){return _0x1d7462[_0x1fb1('0x2d')](_0x414232)[_0x1fb1('0x32')](_0x1fb1('0xb0'),_0x1fb1('0xb1'))[_0x1fb1('0xb2')](_0x1fb1('0xb3'));}else{return _0x1d7462[_0x1fb1('0x2d')](_0x414232)[_0x1fb1('0x2f')](_0x5d1722);}}})[_0x1fb1('0x2b')](handleError(_0x1d7462,null));};exports[_0x1fb1('0xb4')]=function(_0xb0df30,_0x5585ab,_0x11f397){return db[_0x1fb1('0x3f')][_0x1fb1('0x6a')]({'where':{'id':_0xb0df30['params']['id']}})[_0x1fb1('0x22')](handleEntityNotFound(_0x5585ab,null))['then'](function(_0xd77388){if(_0xd77388){return db[_0x1fb1('0xb5')][_0x1fb1('0xb6')](function(_0x16a7d8){return db[_0x1fb1('0x73')]['destroy']({'where':{'SmsAccountId':_0xb0df30[_0x1fb1('0x59')]['id']},'transaction':_0x16a7d8})[_0x1fb1('0x22')](function(_0xfe7ac5){var _0x3c9e22=_['map'](_0xb0df30[_0x1fb1('0x5d')],function(_0x24e516){_0x24e516['SmsAccountId']=_0xb0df30[_0x1fb1('0x59')]['id'];return _0x24e516;});return db[_0x1fb1('0x73')][_0x1fb1('0xb7')](_0x3c9e22,{'transaction':_0x16a7d8});});})[_0x1fb1('0x22')](function(){return db[_0x1fb1('0x73')]['findAndCountAll']({'where':{'SmsAccountId':_0xb0df30[_0x1fb1('0x59')]['id']},'order':_0x1fb1('0x76')});});}})[_0x1fb1('0x22')](respondWithResult(_0x5585ab,null))[_0x1fb1('0x2b')](handleError(_0x5585ab,null));};exports['getApplications']=function(_0x1f0faa,_0x4c3d30,_0x3cbe72){var _0x28eeb1={};var _0x4beb4e={};var _0x376c42;var _0x38c288;return db[_0x1fb1('0x3f')][_0x1fb1('0x6a')]({'where':{'id':_0x1f0faa['params']['id']}})[_0x1fb1('0x22')](handleEntityNotFound(_0x4c3d30,null))['then'](function(_0xb85a8a){if(_0xb85a8a){_0x376c42=_0xb85a8a;_0x4beb4e['model']=_[_0x1fb1('0x5a')](db[_0x1fb1('0x73')][_0x1fb1('0x40')]);_0x4beb4e['query']=_['keys'](_0x1f0faa[_0x1fb1('0x45')]);_0x4beb4e[_0x1fb1('0x46')]=_[_0x1fb1('0x47')](_0x4beb4e[_0x1fb1('0x44')],_0x4beb4e[_0x1fb1('0x45')]);_0x28eeb1[_0x1fb1('0x49')]=_[_0x1fb1('0x47')](_0x4beb4e['model'],qs[_0x1fb1('0x48')](_0x1f0faa[_0x1fb1('0x45')]['fields']));_0x28eeb1[_0x1fb1('0x49')]=_0x28eeb1['attributes'][_0x1fb1('0x4a')]?_0x28eeb1[_0x1fb1('0x49')]:_0x4beb4e[_0x1fb1('0x44')];_0x28eeb1[_0x1fb1('0x4d')]=qs[_0x1fb1('0x4e')](_0x1f0faa[_0x1fb1('0x45')][_0x1fb1('0x4e')]);_0x28eeb1[_0x1fb1('0x4f')]=qs[_0x1fb1('0x46')](_[_0x1fb1('0x50')](_0x1f0faa[_0x1fb1('0x45')],_0x4beb4e['filters']));if(_0x1f0faa[_0x1fb1('0x45')]['filter']){_0x28eeb1[_0x1fb1('0x4f')]=_[_0x1fb1('0x52')](_0x28eeb1[_0x1fb1('0x4f')],{'$or':_[_0x1fb1('0x3e')](_0x28eeb1[_0x1fb1('0x49')],function(_0x2ca153){var _0x4ac138={};_0x4ac138[_0x2ca153]={'$like':'%'+_0x1f0faa[_0x1fb1('0x45')]['filter']+'%'};return _0x4ac138;})});}_0x28eeb1=_[_0x1fb1('0x52')]({},_0x28eeb1,_0x1f0faa[_0x1fb1('0x54')]);return _0x376c42[_0x1fb1('0xb8')](_0x28eeb1);}})['then'](function(_0x7c09c7){if(_0x7c09c7){_0x38c288=_0x7c09c7[_0x1fb1('0x4a')];if(!_0x1f0faa[_0x1fb1('0x45')][_0x1fb1('0x4b')](_0x1fb1('0x6b'))){_0x28eeb1['limit']=qs[_0x1fb1('0x4c')](_0x1f0faa[_0x1fb1('0x45')]['limit']);_0x28eeb1[_0x1fb1('0x31')]=qs['offset'](_0x1f0faa['query'][_0x1fb1('0x31')]);}return _0x376c42[_0x1fb1('0xb8')](_0x28eeb1);}})[_0x1fb1('0x22')](function(_0x458812){if(_0x458812){return _0x458812?{'count':_0x38c288,'rows':_0x458812}:null;}})[_0x1fb1('0x22')](respondWithResult(_0x4c3d30,null))['catch'](handleError(_0x4c3d30,null));};exports[_0x1fb1('0xb9')]=function(_0x57e1a8,_0x525967,_0x174779){var _0x4659f8={'raw':![],'where':{}};var _0x1cdfd4={};var _0x157a42={'count':0x0,'rows':[]};return db[_0x1fb1('0x3f')][_0x1fb1('0x6a')]({'where':{'id':_0x57e1a8[_0x1fb1('0x59')]['id']}})['then'](handleEntityNotFound(_0x525967,null))[_0x1fb1('0x22')](function(_0x4b74d5){if(_0x4b74d5){_0x1cdfd4[_0x1fb1('0x44')]=_[_0x1fb1('0x5a')](db['SmsInteraction'][_0x1fb1('0x40')]);_0x1cdfd4['query']=_[_0x1fb1('0x5a')](_0x57e1a8[_0x1fb1('0x45')]);_0x1cdfd4[_0x1fb1('0x46')]=_[_0x1fb1('0x47')](_0x1cdfd4[_0x1fb1('0x44')],_0x1cdfd4[_0x1fb1('0x45')]);_0x4659f8[_0x1fb1('0x49')]=_[_0x1fb1('0x47')](_0x1cdfd4['model'],qs[_0x1fb1('0x48')](_0x57e1a8[_0x1fb1('0x45')][_0x1fb1('0x48')]));_0x4659f8[_0x1fb1('0x49')]=_0x4659f8[_0x1fb1('0x49')][_0x1fb1('0x4a')]?_0x4659f8[_0x1fb1('0x49')]:_0x1cdfd4['model'];if(!_0x57e1a8['query'][_0x1fb1('0x4b')](_0x1fb1('0x6b'))){_0x4659f8['limit']=qs[_0x1fb1('0x4c')](_0x57e1a8[_0x1fb1('0x45')][_0x1fb1('0x4c')]);_0x4659f8[_0x1fb1('0x31')]=qs['offset'](_0x57e1a8[_0x1fb1('0x45')][_0x1fb1('0x31')]);}_0x4659f8[_0x1fb1('0x4d')]=qs[_0x1fb1('0x4e')](_0x57e1a8[_0x1fb1('0x45')][_0x1fb1('0x4e')]);_0x4659f8['where']=qs[_0x1fb1('0x46')](_[_0x1fb1('0x50')](_0x57e1a8[_0x1fb1('0x45')],_0x1cdfd4[_0x1fb1('0x46')]));_0x4659f8[_0x1fb1('0x4f')][_0x1fb1('0x6c')]=_0x4b74d5['id'];if(_0x57e1a8[_0x1fb1('0x45')][_0x1fb1('0x51')]){_0x4659f8['where']=_['merge'](_0x4659f8[_0x1fb1('0x4f')],{'$or':_[_0x1fb1('0x3e')](_0x4659f8[_0x1fb1('0x49')],function(_0x3f2134){var _0x593d0f={};_0x593d0f[_0x3f2134]={'$like':'%'+_0x57e1a8[_0x1fb1('0x45')][_0x1fb1('0x51')]+'%'};return _0x593d0f;})});}_0x4659f8=_[_0x1fb1('0x52')]({},_0x4659f8,_0x57e1a8[_0x1fb1('0x54')]);return db[_0x1fb1('0x9d')][_0x1fb1('0x30')]({'where':_0x4659f8[_0x1fb1('0x4f')]})[_0x1fb1('0x22')](function(_0x148ed8){_0x157a42[_0x1fb1('0x30')]=_0x148ed8;if(_0x57e1a8[_0x1fb1('0x45')]['includeAll']){_0x4659f8[_0x1fb1('0x56')]=[{'model':db[_0x1fb1('0x78')],'as':_0x1fb1('0xba'),'required':![]},{'model':db[_0x1fb1('0xbb')],'as':_0x1fb1('0xbc'),'attributes':[_0x1fb1('0x3a'),_0x1fb1('0xbd'),_0x1fb1('0xbe')],'required':![]},{'model':db[_0x1fb1('0xbf')],'as':_0x1fb1('0xc0'),'attributes':['id','name',_0x1fb1('0xc1')],'where':_0x57e1a8['query'][_0x1fb1('0xc2')]?{'id':_0x57e1a8['query']['tag']}:undefined,'required':_0x57e1a8[_0x1fb1('0x45')][_0x1fb1('0xc2')]?!![]:![]}];}return db['SmsInteraction'][_0x1fb1('0x70')](_0x4659f8);})['then'](function(_0x247ea5){_0x157a42[_0x1fb1('0x57')]=_0x247ea5;return _0x157a42;});}})[_0x1fb1('0x22')](respondWithFilteredResult(_0x525967,_0x4659f8))[_0x1fb1('0x2b')](handleError(_0x525967,null));};exports[_0x1fb1('0xb2')]=function(_0x221cd0,_0x511a2f,_0x4a7ab4){var _0x101d0b,_0x5402db,_0x435cad;if(_[_0x1fb1('0x92')](_0x221cd0[_0x1fb1('0x5d')]['body'])||_0x221cd0[_0x1fb1('0x5d')][_0x1fb1('0x5d')]===''){throw new db['Sequelize']['ValidationError'](_0x1fb1('0x94'));}if(_['isNil'](_0x221cd0[_0x1fb1('0x5d')]['to'])){throw new db[(_0x1fb1('0x1e'))][(_0x1fb1('0x1f'))](_0x1fb1('0xc3'));}_0x101d0b=_0x221cd0[_0x1fb1('0x5d')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x221cd0[_0x1fb1('0x59')]['id']},'include':[{'model':db[_0x1fb1('0x98')],'as':_0x1fb1('0xc4'),'include':[{'model':db[_0x1fb1('0x78')],'as':_0x1fb1('0x99'),'where':{'mobile':_0x101d0b},'limit':0x1,'order':[[_0x1fb1('0x7b'),'DESC']]}]}]})[_0x1fb1('0x22')](handleEntityNotFound(_0x511a2f,null))[_0x1fb1('0x22')](function(_0x37bddc){if(_0x37bddc&&_0x37bddc[_0x1fb1('0xc4')]){_0x5402db=_0x37bddc[_0x1fb1('0x37')]({'plain':!![]});if(_0x5402db[_0x1fb1('0xc4')]&&_0x5402db['List'][_0x1fb1('0x99')]['length']){return _0x5402db[_0x1fb1('0xc4')][_0x1fb1('0x99')][0x0];}return db[_0x1fb1('0x78')][_0x1fb1('0x5c')](_[_0x1fb1('0x17')](_0x221cd0[_0x1fb1('0x5d')],{'firstName':_0x101d0b,'mobile':_0x101d0b,'phone':_0x101d0b,'ListId':_0x5402db['ListId']}));}})['then'](handleEntityNotFound(_0x511a2f,null))[_0x1fb1('0x22')](function(_0x1504f2){if(_0x1504f2){_0x435cad=_0x1504f2;return db['SmsInteraction']['find']({'where':{'ContactId':_0x435cad['id'],'closed':![],'SmsAccountId':_0x5402db['id']}})[_0x1fb1('0x22')](function(_0x50aced){if(_0x50aced){return[_0x50aced,![]];}return db[_0x1fb1('0x9d')][_0x1fb1('0x5c')]({'UserId':_0x221cd0[_0x1fb1('0x5e')]['id'],'ContactId':_0x435cad['id'],'SmsAccountId':_0x5402db['id'],'phone':_0x101d0b,'firstMsgDirection':'out','Messages':[_['merge'](_0x221cd0[_0x1fb1('0x5d')],{'read':![],'body':_0x221cd0[_0x1fb1('0x5d')]['body'],'phone':_0x101d0b,'SmsAccountId':_0x5402db['id'],'UserId':_0x221cd0[_0x1fb1('0x5e')]['id'],'ContactId':_0x435cad['id']})]},{'include':[{'model':db[_0x1fb1('0xa4')],'as':'Messages'}]})[_0x1fb1('0x22')](function(_0x4f2297){return[_0x4f2297,!![]];});});}})[_0x1fb1('0x9e')](function(_0x369407,_0xe7e766){if(_0xe7e766){return _0x369407;}return db[_0x1fb1('0xa4')][_0x1fb1('0x5c')](_[_0x1fb1('0x52')](_0x221cd0[_0x1fb1('0x5d')],{'read':![],'body':_0x221cd0['body'][_0x1fb1('0x5d')],'phone':_0x101d0b,'SmsAccountId':_0x5402db['id'],'SmsInteractionId':_0x369407['id'],'UserId':_0x221cd0[_0x1fb1('0x5e')]['id'],'ContactId':_0x435cad['id']}))[_0x1fb1('0x22')](function(_0x323648){_0x369407[_0x1fb1('0xc5')][_0x1fb1('0xc6')]=[];_0x369407[_0x1fb1('0xc5')][_0x1fb1('0xc6')][_0x1fb1('0xc7')](_0x323648[_0x1fb1('0xc5')]);return _0x369407;});})[_0x1fb1('0x22')](respondWithResult(_0x511a2f,null))[_0x1fb1('0x2b')](handleError(_0x511a2f,null));};exports['status']=function(_0x52dcfd,_0x1ebe1d,_0x1bc737){if(_0x52dcfd[_0x1fb1('0x5d')]['id']){delete _0x52dcfd[_0x1fb1('0x5d')]['id'];}console[_0x1fb1('0xc8')](_0x1fb1('0xc9'),_0x52dcfd[_0x1fb1('0x5d')]);var _0x209473,_0x5471af,_0x1e1db5;return db[_0x1fb1('0x3f')][_0x1fb1('0x5b')]({'where':{'id':_0x52dcfd[_0x1fb1('0x59')]['id']}})[_0x1fb1('0x22')](handleEntityNotFound(_0x1ebe1d,null))[_0x1fb1('0x22')](function(_0x15c90e){if(_0x15c90e){_0x1e1db5=_0x15c90e;logger[_0x1fb1('0xae')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1fb1('0x2d'),_0x1fb1('0xca'),_0x15c90e[_0x1fb1('0x42')],util[_0x1fb1('0xcb')](_0x52dcfd[_0x1fb1('0x5d')],{'showHidden':![],'depth':null}));switch(_0x15c90e['type']){case _0x1fb1('0x85'):if(_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0xcc')]&&_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0x2d')]){_0x5471af=_0x52dcfd['body']['status'];return db[_0x1fb1('0xa4')][_0x1fb1('0x5b')]({'where':{'messageId':_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0xcc')]}});}break;case _0x1fb1('0x87'):if(_0x52dcfd[_0x1fb1('0x5d')]['requestid']&&_0x52dcfd[_0x1fb1('0x5d')]['statusInt']){_0x5471af=_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0xcd')];return db['SmsMessage'][_0x1fb1('0x5b')]({'where':{'messageId':_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0xce')]}});}break;case'clicksend':if(_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0x88')]&&_0x52dcfd[_0x1fb1('0x5d')]['status_code']){_0x5471af=_0x52dcfd[_0x1fb1('0x5d')]['status_code'];return db['SmsMessage']['find']({'where':{'messageId':_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0x88')]}});}break;case _0x1fb1('0xcf'):var _0x498f6d=_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0x8b')][0x0];if(_0x498f6d['messageId']&&_0x498f6d['status'][_0x1fb1('0xd0')]===_0x1fb1('0xd1')){_0x5471af=_0x498f6d[_0x1fb1('0x2d')][_0x1fb1('0xd0')];return db['SmsMessage'][_0x1fb1('0x5b')]({'where':{'messageId':_0x498f6d[_0x1fb1('0x83')]}});}break;case _0x1fb1('0xd2'):if(_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0x83')]&&_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0x2d')]){_0x5471af=_0x52dcfd['body']['status'];return db[_0x1fb1('0xa4')][_0x1fb1('0x5b')]({'where':{'messageId':_0x52dcfd['body'][_0x1fb1('0x83')]}});}break;case _0x1fb1('0x91'):if(_0x52dcfd[_0x1fb1('0x5d')]['redif']&&_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0x2d')]){_0x5471af=_0x52dcfd[_0x1fb1('0x5d')]['status'];return db[_0x1fb1('0xa4')][_0x1fb1('0x5b')]({'where':{'messageId':_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0xd3')]}});}break;}}})[_0x1fb1('0x22')](handleEntityNotFound(_0x1ebe1d,null))[_0x1fb1('0x22')](function(_0x4e2d38){if(_0x4e2d38){_0x209473=_0x4e2d38;switch(_0x1e1db5[_0x1fb1('0x42')]){case _0x1fb1('0x85'):if(_0x5471af===_0x1fb1('0xd1')){return _0x209473[_0x1fb1('0x36')]({'read':!![]});}else{logger[_0x1fb1('0x27')](_0x1fb1('0x24'),'status',_0x1fb1('0x85'),util[_0x1fb1('0xcb')](_0x52dcfd[_0x1fb1('0x5d')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x5471af==='1'){return _0x209473[_0x1fb1('0x36')]({'read':!![]});}else{logger[_0x1fb1('0x27')](_0x1fb1('0x24'),_0x1fb1('0x2d'),_0x1fb1('0x85'),util[_0x1fb1('0xcb')](_0x52dcfd['body'],{'showHidden':![],'depth':null}));}break;case _0x1fb1('0xd4'):if(!_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0xd5')]&&_0x5471af>=0xc8&&_0x5471af<=0xce){return _0x209473[_0x1fb1('0x36')]({'read':!![]});}else{logger[_0x1fb1('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1fb1('0x2d'),_0x1fb1('0xd4'),util['inspect'](_0x52dcfd[_0x1fb1('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x1fb1('0xcf'):var _0x661901=_0x52dcfd[_0x1fb1('0x5d')][_0x1fb1('0x8b')][0x0];if(_0x661901['status'][_0x1fb1('0xd0')]===_0x1fb1('0xd1')){return _0x209473['update']({'read':!![]});}else{logger[_0x1fb1('0x27')](_0x1fb1('0x24'),'status',_0x1fb1('0xcf'),util[_0x1fb1('0xcb')](_0x52dcfd[_0x1fb1('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x1fb1('0xd2'):if(_0x5471af==_0x1fb1('0xd6')||_0x5471af==_0x1fb1('0xd7')){return _0x209473['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1fb1('0x2d'),_0x1fb1('0xd2'),util[_0x1fb1('0xcb')](_0x52dcfd['body'],{'showHidden':![],'depth':null}));}break;case _0x1fb1('0x91'):if(_0x5471af===_0x1fb1('0xd8')||_0x5471af==='ACCEPTD'){return _0x209473['update']({'read':!![]});}else{logger[_0x1fb1('0x27')](_0x1fb1('0x24'),_0x1fb1('0x2d'),_0x1fb1('0x91'),util[_0x1fb1('0xcb')](_0x52dcfd[_0x1fb1('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x209473;}})['then'](respondWithResult(_0x1ebe1d,null))['catch'](handleError(_0x1ebe1d,null));};exports['statusGet']=function(_0x1d679c,_0x3c71f1,_0x253fbe){var _0x40057e,_0x1503d4,_0x113a93;return db['SmsAccount'][_0x1fb1('0x5b')]({'where':{'id':_0x1d679c[_0x1fb1('0x59')]['id']}})[_0x1fb1('0x22')](handleEntityNotFound(_0x3c71f1,null))[_0x1fb1('0x22')](function(_0x5c687c){if(_0x5c687c){_0x113a93=_0x5c687c;logger[_0x1fb1('0xae')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1fb1('0x2d'),'received\x20delivery\x20report\x20from',_0x5c687c[_0x1fb1('0x42')],util[_0x1fb1('0xcb')](_0x1d679c['query'],{'showHidden':![],'depth':null}));switch(_0x5c687c[_0x1fb1('0x42')]){case _0x1fb1('0x8d'):if(_0x1d679c[_0x1fb1('0x45')]['message-id']&&_0x1d679c[_0x1fb1('0x45')][_0x1fb1('0xd9')]){_0x1503d4=_0x1d679c[_0x1fb1('0x45')][_0x1fb1('0xd9')];return db[_0x1fb1('0xa4')][_0x1fb1('0x5b')]({'where':{'messageId':_0x1d679c[_0x1fb1('0x45')][_0x1fb1('0xda')]}});}break;}}})[_0x1fb1('0x22')](handleEntityNotFound(_0x3c71f1,null))['then'](function(_0x43c64f){if(_0x43c64f){_0x40057e=_0x43c64f;switch(_0x113a93[_0x1fb1('0x42')]){case _0x1fb1('0x8d'):if(_0x1503d4==='2'||_0x1503d4==='6'){return _0x40057e['update']({'read':!![]});}else{logger[_0x1fb1('0x27')](_0x1fb1('0x24'),_0x1fb1('0x2d'),'csc',util[_0x1fb1('0xcb')](_0x1d679c[_0x1fb1('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x40057e;}})['then'](respondWithResult(_0x3c71f1,null))[_0x1fb1('0x2b')](handleError(_0x3c71f1,null));};exports['addAgents']=function(_0x15e286,_0x16f4c8,_0x3bcb0f){return db['SmsAccount'][_0x1fb1('0x5b')]({'where':{'id':_0x15e286[_0x1fb1('0x59')]['id']}})['then'](handleEntityNotFound(_0x16f4c8,null))[_0x1fb1('0x22')](function(_0x45d48d){if(_0x45d48d){return _0x45d48d[_0x1fb1('0xdb')](_0x15e286[_0x1fb1('0x5d')]['ids'],_[_0x1fb1('0x9b')](_0x15e286[_0x1fb1('0x5d')],['ids','id'])||{})[_0x1fb1('0x9e')](function(_0x4a738e){for(var _0xd50a60=0x0;_0xd50a60<_0x15e286[_0x1fb1('0x5d')][_0x1fb1('0x6e')][_0x1fb1('0x4a')];_0xd50a60+=0x1){socket[_0x1fb1('0xdc')](_0x1fb1('0xdd'),{'UserId':_0x15e286[_0x1fb1('0x5d')][_0x1fb1('0x6e')][_0xd50a60],'SmsAccountId':_0x15e286['params']['id']});}return _0x4a738e;});}})[_0x1fb1('0x22')](respondWithResult(_0x16f4c8,null))[_0x1fb1('0x2b')](handleError(_0x16f4c8,null));};exports[_0x1fb1('0xde')]=function(_0x2f43bb,_0x5c5cbc,_0x2038dc){return db[_0x1fb1('0x3f')][_0x1fb1('0x5b')]({'where':{'id':_0x2f43bb[_0x1fb1('0x59')]['id']}})[_0x1fb1('0x22')](handleEntityNotFound(_0x5c5cbc,null))[_0x1fb1('0x22')](function(_0x441bd3){if(_0x441bd3){return _0x441bd3['removeAgents'](_0x2f43bb[_0x1fb1('0x45')][_0x1fb1('0x6e')])['then'](function(){if(_[_0x1fb1('0xdf')](_0x2f43bb[_0x1fb1('0x45')][_0x1fb1('0x6e')])){for(var _0x131387=0x0;_0x131387<_0x2f43bb['query'][_0x1fb1('0x6e')][_0x1fb1('0x4a')];_0x131387+=0x1){socket[_0x1fb1('0xdc')](_0x1fb1('0xe0'),{'UserId':Number(_0x2f43bb[_0x1fb1('0x45')][_0x1fb1('0x6e')][_0x131387]),'SmsAccountId':Number(_0x2f43bb[_0x1fb1('0x59')]['id'])});}}else{socket['emit'](_0x1fb1('0xe0'),{'UserId':Number(_0x2f43bb[_0x1fb1('0x45')][_0x1fb1('0x6e')]),'SmsAccountId':Number(_0x2f43bb[_0x1fb1('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x5c5cbc,null))['catch'](handleError(_0x5c5cbc,null));};exports['getAgents']=function(_0x3a94ec,_0x11182d,_0x12089e){var _0x253276={};var _0x421c7c={};var _0x23886a;var _0x37c1c3;return db[_0x1fb1('0x3f')][_0x1fb1('0x6a')]({'where':{'id':_0x3a94ec['params']['id']}})[_0x1fb1('0x22')](handleEntityNotFound(_0x11182d,null))[_0x1fb1('0x22')](function(_0x3cbc09){if(_0x3cbc09){_0x23886a=_0x3cbc09;_0x421c7c[_0x1fb1('0x44')]=_[_0x1fb1('0x5a')](db[_0x1fb1('0xbb')][_0x1fb1('0x40')]);_0x421c7c[_0x1fb1('0x45')]=_['keys'](_0x3a94ec[_0x1fb1('0x45')]);_0x421c7c[_0x1fb1('0x46')]=_[_0x1fb1('0x47')](_0x421c7c[_0x1fb1('0x44')],_0x421c7c[_0x1fb1('0x45')]);_0x253276[_0x1fb1('0x49')]=_[_0x1fb1('0x47')](_0x421c7c[_0x1fb1('0x44')],qs['fields'](_0x3a94ec[_0x1fb1('0x45')]['fields']));_0x253276['attributes']=_0x253276[_0x1fb1('0x49')][_0x1fb1('0x4a')]?_0x253276[_0x1fb1('0x49')]:_0x421c7c[_0x1fb1('0x44')];_0x253276[_0x1fb1('0x4d')]=qs['sort'](_0x3a94ec[_0x1fb1('0x45')][_0x1fb1('0x4e')]);_0x253276['where']=qs[_0x1fb1('0x46')](_[_0x1fb1('0x50')](_0x3a94ec[_0x1fb1('0x45')],_0x421c7c[_0x1fb1('0x46')]));if(_0x3a94ec['query'][_0x1fb1('0x51')]){_0x253276[_0x1fb1('0x4f')]=_[_0x1fb1('0x52')](_0x253276[_0x1fb1('0x4f')],{'$or':_[_0x1fb1('0x3e')](_0x253276[_0x1fb1('0x49')],function(_0x2db82d){var _0x30b78b={};_0x30b78b[_0x2db82d]={'$like':'%'+_0x3a94ec[_0x1fb1('0x45')]['filter']+'%'};return _0x30b78b;})});}_0x253276=_[_0x1fb1('0x52')]({},_0x253276,_0x3a94ec[_0x1fb1('0x54')]);return _0x23886a[_0x1fb1('0xe1')](_0x253276);}})[_0x1fb1('0x22')](function(_0x51bfc0){if(_0x51bfc0){_0x37c1c3=_0x51bfc0[_0x1fb1('0x4a')];if(!_0x3a94ec[_0x1fb1('0x45')][_0x1fb1('0x4b')](_0x1fb1('0x6b'))){_0x253276[_0x1fb1('0x4c')]=qs[_0x1fb1('0x4c')](_0x3a94ec[_0x1fb1('0x45')][_0x1fb1('0x4c')]);_0x253276['offset']=qs[_0x1fb1('0x31')](_0x3a94ec[_0x1fb1('0x45')][_0x1fb1('0x31')]);}return _0x23886a['getAgents'](_0x253276);}})[_0x1fb1('0x22')](function(_0x2c5aa9){if(_0x2c5aa9){return _0x2c5aa9?{'count':_0x37c1c3,'rows':_0x2c5aa9}:null;}})[_0x1fb1('0x22')](respondWithResult(_0x11182d,null))['catch'](handleError(_0x11182d,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 3f84836..3e36bc5 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 _0x8f29=['save','remove','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x20c34f,_0x52e5c4){var _0xa8be2c=function(_0x54041c){while(--_0x54041c){_0x20c34f['push'](_0x20c34f['shift']());}};_0xa8be2c(++_0x52e5c4);}(_0x8f29,0xed));var _0x98f2=function(_0x59d1b0,_0x5abfba){_0x59d1b0=_0x59d1b0-0x0;var _0x5a100b=_0x8f29[_0x59d1b0];return _0x5a100b;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x98f2('0x0'))['db'][_0x98f2('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x98f2('0x2')](0x0);var events={'afterCreate':_0x98f2('0x3'),'afterUpdate':'update','afterDestroy':_0x98f2('0x4')};function emitEvent(_0x4147f2){return function(_0x2d6edd,_0x5c1449,_0xeaf73d){SmsAccountEvents['emit'](_0x4147f2+':'+_0x2d6edd['id'],_0x2d6edd);SmsAccountEvents['emit'](_0x4147f2,_0x2d6edd);_0xeaf73d(null);};}for(var e in events){if(events[_0x98f2('0x5')](e)){var event=events[e];SmsAccount[_0x98f2('0x6')](e,emitEvent(event));}}module[_0x98f2('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x3b4e=['emit','hasOwnProperty','exports','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x483f75,_0x50e513){var _0x19343c=function(_0x1c6f26){while(--_0x1c6f26){_0x483f75['push'](_0x483f75['shift']());}};_0x19343c(++_0x50e513);}(_0x3b4e,0xae));var _0xe3b4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b4e[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xe3b4('0x0'))['db'][_0xe3b4('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe3b4('0x2')](0x0);var events={'afterCreate':_0xe3b4('0x3'),'afterUpdate':_0xe3b4('0x4'),'afterDestroy':_0xe3b4('0x5')};function emitEvent(_0x220ef8){return function(_0x10f386,_0xa670ba,_0xeaa951){SmsAccountEvents[_0xe3b4('0x6')](_0x220ef8+':'+_0x10f386['id'],_0x10f386);SmsAccountEvents[_0xe3b4('0x6')](_0x220ef8,_0x10f386);_0xeaa951(null);};}for(var e in events){if(events[_0xe3b4('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xe3b4('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 b695174..f04c6c1 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 _0x7f63=['../../config/environment','./smsAccount.attributes','SmsAccount','sms_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2d9608,_0x1a8119){var _0x1fff5b=function(_0x496bd2){while(--_0x496bd2){_0x2d9608['push'](_0x2d9608['shift']());}};_0x1fff5b(++_0x1a8119);}(_0x7f63,0x67));var _0x37f6=function(_0x20d93a,_0x422a10){_0x20d93a=_0x20d93a-0x0;var _0x4e5cec=_0x7f63[_0x20d93a];return _0x4e5cec;};'use strict';var _=require(_0x37f6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x37f6('0x1'));var moment=require(_0x37f6('0x2'));var BPromise=require(_0x37f6('0x3'));var rp=require(_0x37f6('0x4'));var fs=require('fs');var path=require(_0x37f6('0x5'));var rimraf=require(_0x37f6('0x6'));var config=require(_0x37f6('0x7'));var attributes=require(_0x37f6('0x8'));module['exports']=function(_0x46cd73,_0x4380ce){return _0x46cd73['define'](_0x37f6('0x9'),attributes,{'tableName':_0x37f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x001b=['lodash','util','api','moment','path','rimraf','../../config/environment','exports','define','SmsAccount','sms_accounts'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x001b,0x79));var _0xb001=function(_0x606155,_0x3688a3){_0x606155=_0x606155-0x0;var _0x24ca91=_0x001b[_0x606155];return _0x24ca91;};'use strict';var _=require(_0xb001('0x0'));var util=require(_0xb001('0x1'));var logger=require('../../config/logger')(_0xb001('0x2'));var moment=require(_0xb001('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb001('0x4'));var rimraf=require(_0xb001('0x5'));var config=require(_0xb001('0x6'));var attributes=require('./smsAccount.attributes');module[_0xb001('0x7')]=function(_0x5ab4fd,_0x529262){return _0x5ab4fd[_0xb001('0x8')](_0xb001('0x9'),attributes,{'tableName':_0xb001('0xa'),'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 df25b51..0901b8d 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 _0x5dc1=['SmsAccount,\x20%s,\x20%s','message','catch','SmsAccount','find','options','where','attributes','include','map','model','ShowSmsAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','then','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xdcca87,_0x211d8e){var _0x3f27c8=function(_0x20d8f8){while(--_0x20d8f8){_0xdcca87['push'](_0xdcca87['shift']());}};_0x3f27c8(++_0x211d8e);}(_0x5dc1,0x88));var _0x15dc=function(_0x1f614e,_0x65f530){_0x1f614e=_0x1f614e-0x0;var _0x2271c9=_0x5dc1[_0x1f614e];return _0x2271c9;};'use strict';var _=require(_0x15dc('0x0'));var util=require(_0x15dc('0x1'));var moment=require('moment');var BPromise=require(_0x15dc('0x2'));var rs=require(_0x15dc('0x3'));var fs=require('fs');var Redis=require(_0x15dc('0x4'));var db=require(_0x15dc('0x5'))['db'];var utils=require(_0x15dc('0x6'));var logger=require(_0x15dc('0x7'))('rpc');var config=require(_0x15dc('0x8'));var jayson=require(_0x15dc('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x15dc('0xa')]=_[_0x15dc('0xb')](config[_0x15dc('0xa')],{'host':_0x15dc('0xc'),'port':0x18eb});var socket=require(_0x15dc('0xd'))(new Redis(config[_0x15dc('0xa')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x261ef1,_0x4239f4,_0x5802e5){return new BPromise(function(_0x341a67,_0x359d1a){return client['request'](_0x261ef1,_0x5802e5)[_0x15dc('0xe')](function(_0x452371){logger['info']('SmsAccount,\x20%s,\x20%s',_0x4239f4,'request\x20sent');logger['debug'](_0x15dc('0xf'),_0x4239f4,_0x15dc('0x10'),JSON[_0x15dc('0x11')](_0x452371));if(_0x452371[_0x15dc('0x12')]){if(_0x452371[_0x15dc('0x12')]['code']===0x1f4){logger[_0x15dc('0x12')](_0x15dc('0x13'),_0x4239f4,_0x452371[_0x15dc('0x12')]['message']);return _0x359d1a(_0x452371[_0x15dc('0x12')][_0x15dc('0x14')]);}logger[_0x15dc('0x12')](_0x15dc('0x13'),_0x4239f4,_0x452371[_0x15dc('0x12')][_0x15dc('0x14')]);return _0x341a67(_0x452371[_0x15dc('0x12')][_0x15dc('0x14')]);}else{logger['info'](_0x15dc('0x13'),_0x4239f4,_0x15dc('0x10'));_0x341a67(_0x452371['result'][_0x15dc('0x14')]);}})[_0x15dc('0x15')](function(_0x1082b6){logger[_0x15dc('0x12')](_0x15dc('0x13'),_0x4239f4,_0x1082b6);_0x359d1a(_0x1082b6);});});}exports['ShowSmsAccount']=function(_0x3cee09){var _0x38540c=this;return new Promise(function(_0x3a864a,_0x36bf6e){return db[_0x15dc('0x16')][_0x15dc('0x17')]({'raw':_0x3cee09[_0x15dc('0x18')]?_0x3cee09[_0x15dc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3cee09[_0x15dc('0x18')]?_0x3cee09['options'][_0x15dc('0x19')]||null:null,'attributes':_0x3cee09[_0x15dc('0x18')]?_0x3cee09[_0x15dc('0x18')][_0x15dc('0x1a')]||null:null,'include':_0x3cee09[_0x15dc('0x18')]?_0x3cee09[_0x15dc('0x18')][_0x15dc('0x1b')]?_[_0x15dc('0x1c')](_0x3cee09[_0x15dc('0x18')]['include'],function(_0x3ec067){return{'model':db[_0x3ec067['model']],'as':_0x3ec067['as'],'attributes':_0x3ec067[_0x15dc('0x1a')],'include':_0x3ec067[_0x15dc('0x1b')]?_['map'](_0x3ec067[_0x15dc('0x1b')],function(_0xab90aa){return{'model':db[_0xab90aa[_0x15dc('0x1d')]],'as':_0xab90aa['as'],'attributes':_0xab90aa[_0x15dc('0x1a')],'include':_0xab90aa[_0x15dc('0x1b')]?_[_0x15dc('0x1c')](_0xab90aa[_0x15dc('0x1b')],function(_0x52e860){return{'model':db[_0x52e860[_0x15dc('0x1d')]],'as':_0x52e860['as'],'attributes':_0x52e860[_0x15dc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a2a4f){logger['info'](_0x15dc('0x1e'),_0x3cee09);logger['debug']('ShowSmsAccount',_0x3cee09,JSON['stringify'](_0x5a2a4f));_0x3a864a(_0x5a2a4f);})[_0x15dc('0x15')](function(_0x46f50f){logger['error'](_0x15dc('0x1e'),_0x46f50f[_0x15dc('0x14')],_0x3cee09);_0x36bf6e(_0x38540c[_0x15dc('0x12')](0x1f4,_0x46f50f[_0x15dc('0x14')]));});});}; \ No newline at end of file +var _0x383b=['../../config/environment','jayson/promise','redis','defaults','./smsAccount.socket','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','find','options','raw','where','attributes','map','model','include','then','ShowSmsAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4bbffb,_0x107d37){var _0x4e6dbd=function(_0x6b7581){while(--_0x6b7581){_0x4bbffb['push'](_0x4bbffb['shift']());}};_0x4e6dbd(++_0x107d37);}(_0x383b,0x110));var _0xb383=function(_0x40f482,_0x4d6efe){_0x40f482=_0x40f482-0x0;var _0x5bce67=_0x383b[_0x40f482];return _0x5bce67;};'use strict';var _=require(_0xb383('0x0'));var util=require(_0xb383('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb383('0x2'));var fs=require('fs');var Redis=require(_0xb383('0x3'));var db=require(_0xb383('0x4'))['db'];var utils=require(_0xb383('0x5'));var logger=require(_0xb383('0x6'))(_0xb383('0x7'));var config=require(_0xb383('0x8'));var jayson=require(_0xb383('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xb383('0xa')]=_[_0xb383('0xb')](config[_0xb383('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb383('0xa')]));require(_0xb383('0xc'))['register'](socket);function respondWithRpcPromise(_0x51c435,_0x42ac01,_0x513ce8){return new BPromise(function(_0x320728,_0x59424e){return client[_0xb383('0xd')](_0x51c435,_0x513ce8)['then'](function(_0x2d26e3){logger[_0xb383('0xe')](_0xb383('0xf'),_0x42ac01,'request\x20sent');logger[_0xb383('0x10')](_0xb383('0x11'),_0x42ac01,_0xb383('0x12'),JSON[_0xb383('0x13')](_0x2d26e3));if(_0x2d26e3[_0xb383('0x14')]){if(_0x2d26e3['error'][_0xb383('0x15')]===0x1f4){logger[_0xb383('0x14')](_0xb383('0xf'),_0x42ac01,_0x2d26e3[_0xb383('0x14')][_0xb383('0x16')]);return _0x59424e(_0x2d26e3[_0xb383('0x14')]['message']);}logger[_0xb383('0x14')](_0xb383('0xf'),_0x42ac01,_0x2d26e3[_0xb383('0x14')][_0xb383('0x16')]);return _0x320728(_0x2d26e3[_0xb383('0x14')][_0xb383('0x16')]);}else{logger[_0xb383('0xe')]('SmsAccount,\x20%s,\x20%s',_0x42ac01,_0xb383('0x12'));_0x320728(_0x2d26e3[_0xb383('0x17')][_0xb383('0x16')]);}})[_0xb383('0x18')](function(_0x48210c){logger[_0xb383('0x14')](_0xb383('0xf'),_0x42ac01,_0x48210c);_0x59424e(_0x48210c);});});}exports['ShowSmsAccount']=function(_0x51062d){var _0x5e436f=this;return new Promise(function(_0xd71918,_0x2d9cf8){return db['SmsAccount'][_0xb383('0x19')]({'raw':_0x51062d[_0xb383('0x1a')]?_0x51062d[_0xb383('0x1a')][_0xb383('0x1b')]===undefined?!![]:![]:!![],'where':_0x51062d['options']?_0x51062d[_0xb383('0x1a')][_0xb383('0x1c')]||null:null,'attributes':_0x51062d['options']?_0x51062d[_0xb383('0x1a')][_0xb383('0x1d')]||null:null,'include':_0x51062d[_0xb383('0x1a')]?_0x51062d[_0xb383('0x1a')]['include']?_[_0xb383('0x1e')](_0x51062d[_0xb383('0x1a')]['include'],function(_0x2ff9a1){return{'model':db[_0x2ff9a1[_0xb383('0x1f')]],'as':_0x2ff9a1['as'],'attributes':_0x2ff9a1[_0xb383('0x1d')],'include':_0x2ff9a1[_0xb383('0x20')]?_[_0xb383('0x1e')](_0x2ff9a1['include'],function(_0x562916){return{'model':db[_0x562916[_0xb383('0x1f')]],'as':_0x562916['as'],'attributes':_0x562916['attributes'],'include':_0x562916[_0xb383('0x20')]?_[_0xb383('0x1e')](_0x562916[_0xb383('0x20')],function(_0x47a4c4){return{'model':db[_0x47a4c4['model']],'as':_0x47a4c4['as'],'attributes':_0x47a4c4[_0xb383('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb383('0x21')](function(_0x5deace){logger['info'](_0xb383('0x22'),_0x51062d);logger[_0xb383('0x10')](_0xb383('0x22'),_0x51062d,JSON['stringify'](_0x5deace));_0xd71918(_0x5deace);})[_0xb383('0x18')](function(_0x20f94e){logger[_0xb383('0x14')](_0xb383('0x22'),_0x20f94e['message'],_0x51062d);_0x2d9cf8(_0x5e436f[_0xb383('0x14')](0x1f4,_0x20f94e['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 855917b..a295d69 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 _0x9f0e=['save','remove','update','emit','removeListener','register','length','smsAccount:','./smsAccount.events'];(function(_0x4dec29,_0x219607){var _0x44c935=function(_0x5614dd){while(--_0x5614dd){_0x4dec29['push'](_0x4dec29['shift']());}};_0x44c935(++_0x219607);}(_0x9f0e,0x116));var _0xe9f0=function(_0xf82134,_0x36da8b){_0xf82134=_0xf82134-0x0;var _0x13e884=_0x9f0e[_0xf82134];return _0x13e884;};'use strict';var SmsAccountEvents=require(_0xe9f0('0x0'));var events=[_0xe9f0('0x1'),_0xe9f0('0x2'),_0xe9f0('0x3')];function createListener(_0x146ad8,_0x4a1a30){return function(_0x5856dc){_0x4a1a30[_0xe9f0('0x4')](_0x146ad8,_0x5856dc);};}function removeListener(_0x150a03,_0x3c589d){return function(){SmsAccountEvents[_0xe9f0('0x5')](_0x150a03,_0x3c589d);};}exports[_0xe9f0('0x6')]=function(_0x50313d){for(var _0x5b87c1=0x0,_0x3a17b3=events[_0xe9f0('0x7')];_0x5b87c1<_0x3a17b3;_0x5b87c1++){var _0xe64a79=events[_0x5b87c1];var _0x4be6a6=createListener(_0xe9f0('0x8')+_0xe64a79,_0x50313d);SmsAccountEvents['on'](_0xe64a79,_0x4be6a6);}}; \ No newline at end of file +var _0x4255=['register','length','smsAccount:','./smsAccount.events','remove','update','emit','removeListener'];(function(_0x5e1049,_0x48eb55){var _0x53e7b8=function(_0x121f97){while(--_0x121f97){_0x5e1049['push'](_0x5e1049['shift']());}};_0x53e7b8(++_0x48eb55);}(_0x4255,0x1bb));var _0x5425=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4255[_0x57b54c];return _0x59cc19;};'use strict';var SmsAccountEvents=require(_0x5425('0x0'));var events=['save',_0x5425('0x1'),_0x5425('0x2')];function createListener(_0x41d664,_0x35d785){return function(_0x49fbf3){_0x35d785[_0x5425('0x3')](_0x41d664,_0x49fbf3);};}function removeListener(_0x475891,_0x21d258){return function(){SmsAccountEvents[_0x5425('0x4')](_0x475891,_0x21d258);};}exports[_0x5425('0x5')]=function(_0x439f1b){for(var _0xb9e88c=0x0,_0x37d5f9=events[_0x5425('0x6')];_0xb9e88c<_0x37d5f9;_0xb9e88c++){var _0x18c7e3=events[_0xb9e88c];var _0x44bae9=createListener(_0x5425('0x7')+_0x18c7e3,_0x439f1b);SmsAccountEvents['on'](_0x18c7e3,_0x44bae9);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 805e4b9..a5dd486 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 _0x18e5=['create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsApplication.controller','index','get','/:id','isAuthenticated','post'];(function(_0xd50b7f,_0x53c16c){var _0x380972=function(_0x4865d8){while(--_0x4865d8){_0xd50b7f['push'](_0xd50b7f['shift']());}};_0x380972(++_0x53c16c);}(_0x18e5,0xa7));var _0x518e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x18e5[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x518e('0x0'));var path=require(_0x518e('0x1'));var timeout=require(_0x518e('0x2'));var express=require(_0x518e('0x3'));var router=express[_0x518e('0x4')]();var auth=require(_0x518e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x518e('0x6'));var controller=require(_0x518e('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x518e('0x8')]);router[_0x518e('0x9')](_0x518e('0xa'),auth[_0x518e('0xb')](),controller['show']);router[_0x518e('0xc')]('/',auth['isAuthenticated'](),controller[_0x518e('0xd')]);router[_0x518e('0xe')](_0x518e('0xa'),auth[_0x518e('0xb')](),controller[_0x518e('0xf')]);router[_0x518e('0x10')](_0x518e('0xa'),auth[_0x518e('0xb')](),controller[_0x518e('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa528=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy'];(function(_0x26b4cb,_0x1da7c0){var _0x37acfd=function(_0x4be5b2){while(--_0x4be5b2){_0x26b4cb['push'](_0x26b4cb['shift']());}};_0x37acfd(++_0x1da7c0);}(_0xa528,0x65));var _0x8a52=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0xa528[_0x9fb081];return _0x43f8b0;};'use strict';var multer=require(_0x8a52('0x0'));var util=require(_0x8a52('0x1'));var path=require(_0x8a52('0x2'));var timeout=require(_0x8a52('0x3'));var express=require(_0x8a52('0x4'));var router=express[_0x8a52('0x5')]();var auth=require(_0x8a52('0x6'));var interaction=require(_0x8a52('0x7'));var config=require(_0x8a52('0x8'));var controller=require(_0x8a52('0x9'));router[_0x8a52('0xa')]('/',auth[_0x8a52('0xb')](),controller[_0x8a52('0xc')]);router[_0x8a52('0xa')](_0x8a52('0xd'),auth[_0x8a52('0xb')](),controller[_0x8a52('0xe')]);router['post']('/',auth[_0x8a52('0xb')](),controller[_0x8a52('0xf')]);router[_0x8a52('0x10')](_0x8a52('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8a52('0x11')](_0x8a52('0xd'),auth[_0x8a52('0xb')](),controller[_0x8a52('0x12')]);module[_0x8a52('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 279e8be..7a542dd 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 _0xf99b=['INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x5c8be0,_0x1c9c30){var _0x531128=function(_0x21cdce){while(--_0x21cdce){_0x5c8be0['push'](_0x5c8be0['shift']());}};_0x531128(++_0x1c9c30);}(_0xf99b,0x1f4));var _0xbf99=function(_0x27d037,_0x29264c){_0x27d037=_0x27d037-0x0;var _0x3d0d2b=_0xf99b[_0x27d037];return _0x3d0d2b;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xbf99('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xbf99('0x1')],'allowNull':![],'defaultValue':_0xbf99('0x2')},'appdata':{'type':Sequelize[_0xbf99('0x3')]()},'description':{'type':Sequelize[_0xbf99('0x1')]},'interval':{'type':Sequelize[_0xbf99('0x1')],'defaultValue':_0xbf99('0x4')}}; \ No newline at end of file +var _0xfd5c=['STRING','*,*,*,*'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xfd5c,0xd6));var _0xcfd5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd5c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcfd5('0x0')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcfd5('0x0')]},'interval':{'type':Sequelize[_0xcfd5('0x0')],'defaultValue':_0xcfd5('0x1')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 821e0c4..3720217 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 _0xfc21=['sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','name','options','SmsApplication','include','findAll','rows','catch','show','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path'];(function(_0x2f5eb0,_0x11d4b0){var _0x53922e=function(_0x1e4f23){while(--_0x1e4f23){_0x2f5eb0['push'](_0x2f5eb0['shift']());}};_0x53922e(++_0x11d4b0);}(_0xfc21,0x127));var _0x1fc2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xfc21[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0x1fc2('0x0'));var emlformat=require(_0x1fc2('0x1'));var rimraf=require(_0x1fc2('0x2'));var zipdir=require(_0x1fc2('0x3'));var jsonpatch=require(_0x1fc2('0x4'));var rp=require('request-promise');var moment=require(_0x1fc2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1fc2('0x6'));var util=require(_0x1fc2('0x7'));var path=require(_0x1fc2('0x8'));var sox=require(_0x1fc2('0x9'));var csv=require(_0x1fc2('0xa'));var ejs=require(_0x1fc2('0xb'));var fs=require('fs');var _=require(_0x1fc2('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1fc2('0xd'));var deskjs=require(_0x1fc2('0xe'));var toCsv=require(_0x1fc2('0xa'));var querystring=require(_0x1fc2('0xf'));var Papa=require('papaparse');var Redis=require(_0x1fc2('0x10'));var authService=require(_0x1fc2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1fc2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fc2('0x13'))(_0x1fc2('0x14'));var utils=require(_0x1fc2('0x15'));var config=require(_0x1fc2('0x16'));var db=require(_0x1fc2('0x17'))['db'];function respondWithStatusCode(_0x1ce4b3,_0x33c328){_0x33c328=_0x33c328||0xcc;return function(_0x55d004){if(_0x55d004){return _0x1ce4b3[_0x1fc2('0x18')](_0x33c328);}return _0x1ce4b3[_0x1fc2('0x19')](_0x33c328)[_0x1fc2('0x1a')]();};}function respondWithResult(_0x293a0d,_0x57941a){_0x57941a=_0x57941a||0xc8;return function(_0x3f55df){if(_0x3f55df){return _0x293a0d[_0x1fc2('0x19')](_0x57941a)['json'](_0x3f55df);}};}function respondWithFilteredResult(_0x50ea16,_0x25fee7){return function(_0x2319c2){if(_0x2319c2){var _0x40f027=_0x2319c2[_0x1fc2('0x1b')],_0x29fafd=_0x25fee7[_0x1fc2('0x1c')],_0x48be71=_0x25fee7[_0x1fc2('0x1c')]+_0x25fee7[_0x1fc2('0x1d')],_0x5f56f3;if(_0x48be71>=_0x40f027){_0x48be71=_0x40f027;_0x5f56f3=0xc8;}else{_0x5f56f3=0xce;}_0x50ea16[_0x1fc2('0x19')](_0x5f56f3);return _0x50ea16[_0x1fc2('0x1e')](_0x1fc2('0x1f'),_0x29fafd+'-'+_0x48be71+'/'+_0x40f027)[_0x1fc2('0x20')](_0x2319c2);}return null;};}function patchUpdates(_0x581eff){return function(_0x83a0c){try{jsonpatch[_0x1fc2('0x21')](_0x83a0c,_0x581eff,!![]);}catch(_0x242e08){return BPromise[_0x1fc2('0x22')](_0x242e08);}return _0x83a0c[_0x1fc2('0x23')]();};}function saveUpdates(_0x4e956f,_0xd8aab9){return function(_0x203f36){if(_0x203f36){return _0x203f36[_0x1fc2('0x24')](_0x4e956f)[_0x1fc2('0x25')](function(_0x480109){return _0x480109;});}return null;};}function removeEntity(_0x4ef528,_0xf533d4){return function(_0x266b80){if(_0x266b80){return _0x266b80[_0x1fc2('0x26')]()[_0x1fc2('0x25')](function(){_0x4ef528[_0x1fc2('0x19')](0xcc)[_0x1fc2('0x1a')]();});}};}function handleEntityNotFound(_0x7bd994,_0x20e2e7){return function(_0x6ebfa0){if(!_0x6ebfa0){_0x7bd994[_0x1fc2('0x18')](0x194);}return _0x6ebfa0;};}function handleError(_0xfe0f84,_0x15a978){_0x15a978=_0x15a978||0x1f4;return function(_0x2688bb){logger[_0x1fc2('0x27')](_0x2688bb[_0x1fc2('0x28')]);if(_0x2688bb['name']){delete _0x2688bb['name'];}_0xfe0f84[_0x1fc2('0x19')](_0x15a978)[_0x1fc2('0x29')](_0x2688bb);};}exports[_0x1fc2('0x2a')]=function(_0x4c09e9,_0x3fe5cb){var _0x531d31={},_0x4a70b3={},_0x4dfbb1={'count':0x0,'rows':[]};var _0x731832=_[_0x1fc2('0x2b')](db['SmsApplication'][_0x1fc2('0x2c')],function(_0x3fe2e2){return{'name':_0x3fe2e2[_0x1fc2('0x2d')],'type':_0x3fe2e2['type'][_0x1fc2('0x2e')]};});_0x4a70b3[_0x1fc2('0x2f')]=_[_0x1fc2('0x2b')](_0x731832,'name');_0x4a70b3[_0x1fc2('0x30')]=_[_0x1fc2('0x31')](_0x4c09e9[_0x1fc2('0x30')]);_0x4a70b3[_0x1fc2('0x32')]=_[_0x1fc2('0x33')](_0x4a70b3[_0x1fc2('0x2f')],_0x4a70b3[_0x1fc2('0x30')]);_0x531d31[_0x1fc2('0x34')]=_[_0x1fc2('0x33')](_0x4a70b3[_0x1fc2('0x2f')],qs[_0x1fc2('0x35')](_0x4c09e9[_0x1fc2('0x30')]['fields']));_0x531d31['attributes']=_0x531d31['attributes'][_0x1fc2('0x36')]?_0x531d31[_0x1fc2('0x34')]:_0x4a70b3['model'];if(!_0x4c09e9[_0x1fc2('0x30')][_0x1fc2('0x37')](_0x1fc2('0x38'))){_0x531d31[_0x1fc2('0x1d')]=qs[_0x1fc2('0x1d')](_0x4c09e9[_0x1fc2('0x30')]['limit']);_0x531d31[_0x1fc2('0x1c')]=qs[_0x1fc2('0x1c')](_0x4c09e9[_0x1fc2('0x30')][_0x1fc2('0x1c')]);}_0x531d31[_0x1fc2('0x39')]=qs[_0x1fc2('0x3a')](_0x4c09e9[_0x1fc2('0x30')][_0x1fc2('0x3a')]);_0x531d31['where']=qs[_0x1fc2('0x32')](_[_0x1fc2('0x3b')](_0x4c09e9[_0x1fc2('0x30')],_0x4a70b3[_0x1fc2('0x32')]));if(_0x4c09e9[_0x1fc2('0x30')][_0x1fc2('0x3c')]){_0x531d31['where']=_[_0x1fc2('0x3d')](_0x531d31[_0x1fc2('0x3e')],{'$or':_[_0x1fc2('0x2b')](_0x731832,function(_0x15cebf){if(_0x15cebf['type']!=='VIRTUAL'){var _0x5aec57={};_0x5aec57[_0x15cebf[_0x1fc2('0x3f')]]={'$like':'%'+_0x4c09e9[_0x1fc2('0x30')][_0x1fc2('0x3c')]+'%'};return _0x5aec57;}})});}_0x531d31=_['merge']({},_0x531d31,_0x4c09e9[_0x1fc2('0x40')]);var _0x1109a7={'where':_0x531d31[_0x1fc2('0x3e')]};return db[_0x1fc2('0x41')][_0x1fc2('0x1b')](_0x1109a7)[_0x1fc2('0x25')](function(_0x281a5f){_0x4dfbb1[_0x1fc2('0x1b')]=_0x281a5f;if(_0x4c09e9[_0x1fc2('0x30')]['includeAll']){_0x531d31[_0x1fc2('0x42')]=[{'all':!![]}];}return db[_0x1fc2('0x41')][_0x1fc2('0x43')](_0x531d31);})[_0x1fc2('0x25')](function(_0x3a6a7b){_0x4dfbb1[_0x1fc2('0x44')]=_0x3a6a7b;return _0x4dfbb1;})['then'](respondWithFilteredResult(_0x3fe5cb,_0x531d31))[_0x1fc2('0x45')](handleError(_0x3fe5cb,null));};exports[_0x1fc2('0x46')]=function(_0x39b4e9,_0x326805){var _0x2d3788={'raw':!![],'where':{'id':_0x39b4e9[_0x1fc2('0x47')]['id']}},_0x40c184={};_0x40c184[_0x1fc2('0x2f')]=_['keys'](db[_0x1fc2('0x41')][_0x1fc2('0x2c')]);_0x40c184['query']=_[_0x1fc2('0x31')](_0x39b4e9[_0x1fc2('0x30')]);_0x40c184[_0x1fc2('0x32')]=_[_0x1fc2('0x33')](_0x40c184[_0x1fc2('0x2f')],_0x40c184['query']);_0x2d3788[_0x1fc2('0x34')]=_['intersection'](_0x40c184[_0x1fc2('0x2f')],qs[_0x1fc2('0x35')](_0x39b4e9[_0x1fc2('0x30')][_0x1fc2('0x35')]));_0x2d3788['attributes']=_0x2d3788[_0x1fc2('0x34')][_0x1fc2('0x36')]?_0x2d3788['attributes']:_0x40c184[_0x1fc2('0x2f')];if(_0x39b4e9[_0x1fc2('0x30')][_0x1fc2('0x48')]){_0x2d3788[_0x1fc2('0x42')]=[{'all':!![]}];}_0x2d3788=_[_0x1fc2('0x3d')]({},_0x2d3788,_0x39b4e9['options']);return db[_0x1fc2('0x41')]['find'](_0x2d3788)[_0x1fc2('0x25')](handleEntityNotFound(_0x326805,null))[_0x1fc2('0x25')](respondWithResult(_0x326805,null))['catch'](handleError(_0x326805,null));};exports[_0x1fc2('0x49')]=function(_0x6b04b0,_0x4aae6d){return db[_0x1fc2('0x41')][_0x1fc2('0x49')](_0x6b04b0['body'],{})[_0x1fc2('0x25')](respondWithResult(_0x4aae6d,0xc9))['catch'](handleError(_0x4aae6d,null));};exports[_0x1fc2('0x24')]=function(_0x351a1b,_0x1df2a7){if(_0x351a1b[_0x1fc2('0x4a')]['id']){delete _0x351a1b['body']['id'];}return db[_0x1fc2('0x41')][_0x1fc2('0x4b')]({'where':{'id':_0x351a1b['params']['id']}})[_0x1fc2('0x25')](handleEntityNotFound(_0x1df2a7,null))[_0x1fc2('0x25')](saveUpdates(_0x351a1b[_0x1fc2('0x4a')],null))[_0x1fc2('0x25')](respondWithResult(_0x1df2a7,null))[_0x1fc2('0x45')](handleError(_0x1df2a7,null));};exports['destroy']=function(_0x57bb59,_0x140f31){return db['SmsApplication']['find']({'where':{'id':_0x57bb59[_0x1fc2('0x47')]['id']}})[_0x1fc2('0x25')](handleEntityNotFound(_0x140f31,null))[_0x1fc2('0x25')](removeEntity(_0x140f31,null))[_0x1fc2('0x45')](handleError(_0x140f31,null));}; \ No newline at end of file +var _0xc29e=['VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','SmsApplication','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x186a06,_0x19587a){var _0x5ddf98=function(_0x5ab8ca){while(--_0x5ab8ca){_0x186a06['push'](_0x186a06['shift']());}};_0x5ddf98(++_0x19587a);}(_0xc29e,0xdd));var _0xec29=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xc29e[_0x3ab9ee];return _0x82ee88;};'use strict';var pdf=require(_0xec29('0x0'));var emlformat=require(_0xec29('0x1'));var rimraf=require(_0xec29('0x2'));var zipdir=require(_0xec29('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xec29('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec29('0x5'));var util=require('util');var path=require(_0xec29('0x6'));var sox=require('sox');var csv=require(_0xec29('0x7'));var ejs=require(_0xec29('0x8'));var fs=require('fs');var _=require(_0xec29('0x9'));var squel=require(_0xec29('0xa'));var crypto=require(_0xec29('0xb'));var jsforce=require(_0xec29('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xec29('0x7'));var querystring=require('querystring');var Papa=require(_0xec29('0xd'));var Redis=require(_0xec29('0xe'));var authService=require(_0xec29('0xf'));var qs=require(_0xec29('0x10'));var as=require(_0xec29('0x11'));var hardwareService=require(_0xec29('0x12'));var logger=require(_0xec29('0x13'))(_0xec29('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xec29('0x15'))['db'];function respondWithStatusCode(_0x25ae2c,_0x2c09e6){_0x2c09e6=_0x2c09e6||0xcc;return function(_0x19efde){if(_0x19efde){return _0x25ae2c['sendStatus'](_0x2c09e6);}return _0x25ae2c[_0xec29('0x16')](_0x2c09e6)[_0xec29('0x17')]();};}function respondWithResult(_0x51bebb,_0x53510f){_0x53510f=_0x53510f||0xc8;return function(_0x1d3d61){if(_0x1d3d61){return _0x51bebb[_0xec29('0x16')](_0x53510f)['json'](_0x1d3d61);}};}function respondWithFilteredResult(_0x49028a,_0x566d3d){return function(_0x15677c){if(_0x15677c){var _0x5916c5=_0x15677c[_0xec29('0x18')],_0x12aa1f=_0x566d3d[_0xec29('0x19')],_0xab75e0=_0x566d3d['offset']+_0x566d3d[_0xec29('0x1a')],_0x4fcb32;if(_0xab75e0>=_0x5916c5){_0xab75e0=_0x5916c5;_0x4fcb32=0xc8;}else{_0x4fcb32=0xce;}_0x49028a[_0xec29('0x16')](_0x4fcb32);return _0x49028a[_0xec29('0x1b')](_0xec29('0x1c'),_0x12aa1f+'-'+_0xab75e0+'/'+_0x5916c5)[_0xec29('0x1d')](_0x15677c);}return null;};}function patchUpdates(_0x521e7a){return function(_0x5ae3f2){try{jsonpatch[_0xec29('0x1e')](_0x5ae3f2,_0x521e7a,!![]);}catch(_0x24ece6){return BPromise['reject'](_0x24ece6);}return _0x5ae3f2[_0xec29('0x1f')]();};}function saveUpdates(_0x33f038,_0x40fd2d){return function(_0x5cc617){if(_0x5cc617){return _0x5cc617[_0xec29('0x20')](_0x33f038)[_0xec29('0x21')](function(_0x215221){return _0x215221;});}return null;};}function removeEntity(_0x6c7b4c,_0x558cc4){return function(_0x3bf457){if(_0x3bf457){return _0x3bf457[_0xec29('0x22')]()[_0xec29('0x21')](function(){_0x6c7b4c[_0xec29('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x540384,_0x970e7a){return function(_0x3155f8){if(!_0x3155f8){_0x540384['sendStatus'](0x194);}return _0x3155f8;};}function handleError(_0x235c2c,_0x2abb84){_0x2abb84=_0x2abb84||0x1f4;return function(_0x46c0ed){logger[_0xec29('0x23')](_0x46c0ed[_0xec29('0x24')]);if(_0x46c0ed[_0xec29('0x25')]){delete _0x46c0ed[_0xec29('0x25')];}_0x235c2c['status'](_0x2abb84)[_0xec29('0x26')](_0x46c0ed);};}exports['index']=function(_0x487216,_0x6dda92){var _0x4a1c8c={},_0x104226={},_0xf00935={'count':0x0,'rows':[]};var _0x399fcd=_['map'](db[_0xec29('0x27')][_0xec29('0x28')],function(_0x57495f){return{'name':_0x57495f['fieldName'],'type':_0x57495f[_0xec29('0x29')][_0xec29('0x2a')]};});_0x104226[_0xec29('0x2b')]=_[_0xec29('0x2c')](_0x399fcd,_0xec29('0x25'));_0x104226[_0xec29('0x2d')]=_[_0xec29('0x2e')](_0x487216[_0xec29('0x2d')]);_0x104226[_0xec29('0x2f')]=_[_0xec29('0x30')](_0x104226[_0xec29('0x2b')],_0x104226['query']);_0x4a1c8c[_0xec29('0x31')]=_[_0xec29('0x30')](_0x104226[_0xec29('0x2b')],qs[_0xec29('0x32')](_0x487216[_0xec29('0x2d')][_0xec29('0x32')]));_0x4a1c8c[_0xec29('0x31')]=_0x4a1c8c[_0xec29('0x31')][_0xec29('0x33')]?_0x4a1c8c[_0xec29('0x31')]:_0x104226['model'];if(!_0x487216[_0xec29('0x2d')][_0xec29('0x34')](_0xec29('0x35'))){_0x4a1c8c[_0xec29('0x1a')]=qs['limit'](_0x487216[_0xec29('0x2d')][_0xec29('0x1a')]);_0x4a1c8c[_0xec29('0x19')]=qs[_0xec29('0x19')](_0x487216[_0xec29('0x2d')][_0xec29('0x19')]);}_0x4a1c8c['order']=qs[_0xec29('0x36')](_0x487216['query'][_0xec29('0x36')]);_0x4a1c8c[_0xec29('0x37')]=qs[_0xec29('0x2f')](_[_0xec29('0x38')](_0x487216[_0xec29('0x2d')],_0x104226[_0xec29('0x2f')]));if(_0x487216[_0xec29('0x2d')][_0xec29('0x39')]){_0x4a1c8c['where']=_[_0xec29('0x3a')](_0x4a1c8c['where'],{'$or':_[_0xec29('0x2c')](_0x399fcd,function(_0x3cfa36){if(_0x3cfa36[_0xec29('0x29')]!==_0xec29('0x3b')){var _0x13f203={};_0x13f203[_0x3cfa36[_0xec29('0x25')]]={'$like':'%'+_0x487216[_0xec29('0x2d')][_0xec29('0x39')]+'%'};return _0x13f203;}})});}_0x4a1c8c=_[_0xec29('0x3a')]({},_0x4a1c8c,_0x487216[_0xec29('0x3c')]);var _0x1e82c1={'where':_0x4a1c8c[_0xec29('0x37')]};return db[_0xec29('0x27')][_0xec29('0x18')](_0x1e82c1)[_0xec29('0x21')](function(_0x2c996){_0xf00935[_0xec29('0x18')]=_0x2c996;if(_0x487216[_0xec29('0x2d')]['includeAll']){_0x4a1c8c[_0xec29('0x3d')]=[{'all':!![]}];}return db[_0xec29('0x27')][_0xec29('0x3e')](_0x4a1c8c);})['then'](function(_0x1e7d3c){_0xf00935['rows']=_0x1e7d3c;return _0xf00935;})[_0xec29('0x21')](respondWithFilteredResult(_0x6dda92,_0x4a1c8c))[_0xec29('0x3f')](handleError(_0x6dda92,null));};exports[_0xec29('0x40')]=function(_0x5d6764,_0x28c08c){var _0x56259a={'raw':!![],'where':{'id':_0x5d6764[_0xec29('0x41')]['id']}},_0x1612d6={};_0x1612d6['model']=_[_0xec29('0x2e')](db[_0xec29('0x27')][_0xec29('0x28')]);_0x1612d6[_0xec29('0x2d')]=_['keys'](_0x5d6764['query']);_0x1612d6[_0xec29('0x2f')]=_['intersection'](_0x1612d6[_0xec29('0x2b')],_0x1612d6[_0xec29('0x2d')]);_0x56259a[_0xec29('0x31')]=_[_0xec29('0x30')](_0x1612d6[_0xec29('0x2b')],qs[_0xec29('0x32')](_0x5d6764[_0xec29('0x2d')][_0xec29('0x32')]));_0x56259a['attributes']=_0x56259a[_0xec29('0x31')][_0xec29('0x33')]?_0x56259a[_0xec29('0x31')]:_0x1612d6[_0xec29('0x2b')];if(_0x5d6764[_0xec29('0x2d')][_0xec29('0x42')]){_0x56259a[_0xec29('0x3d')]=[{'all':!![]}];}_0x56259a=_[_0xec29('0x3a')]({},_0x56259a,_0x5d6764[_0xec29('0x3c')]);return db['SmsApplication'][_0xec29('0x43')](_0x56259a)['then'](handleEntityNotFound(_0x28c08c,null))[_0xec29('0x21')](respondWithResult(_0x28c08c,null))[_0xec29('0x3f')](handleError(_0x28c08c,null));};exports[_0xec29('0x44')]=function(_0x373469,_0x35aea1){return db[_0xec29('0x27')][_0xec29('0x44')](_0x373469['body'],{})[_0xec29('0x21')](respondWithResult(_0x35aea1,0xc9))['catch'](handleError(_0x35aea1,null));};exports[_0xec29('0x20')]=function(_0x1f34d5,_0x17d163){if(_0x1f34d5[_0xec29('0x45')]['id']){delete _0x1f34d5[_0xec29('0x45')]['id'];}return db[_0xec29('0x27')]['find']({'where':{'id':_0x1f34d5['params']['id']}})[_0xec29('0x21')](handleEntityNotFound(_0x17d163,null))['then'](saveUpdates(_0x1f34d5[_0xec29('0x45')],null))[_0xec29('0x21')](respondWithResult(_0x17d163,null))[_0xec29('0x3f')](handleError(_0x17d163,null));};exports[_0xec29('0x22')]=function(_0x5b18b5,_0x100361){return db[_0xec29('0x27')][_0xec29('0x43')]({'where':{'id':_0x5b18b5[_0xec29('0x41')]['id']}})['then'](handleEntityNotFound(_0x100361,null))['then'](removeEntity(_0x100361,null))['catch'](handleError(_0x100361,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 166ab4d..db0ca62 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 _0xe7c3=['define','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x18dad2,_0x647f1e){var _0x4f217e=function(_0x18ec02){while(--_0x18ec02){_0x18dad2['push'](_0x18dad2['shift']());}};_0x4f217e(++_0x647f1e);}(_0xe7c3,0x17d));var _0x3e7c=function(_0x28685e,_0x102d7e){_0x28685e=_0x28685e-0x0;var _0xf01e2=_0xe7c3[_0x28685e];return _0xf01e2;};'use strict';var _=require(_0x3e7c('0x0'));var util=require(_0x3e7c('0x1'));var logger=require(_0x3e7c('0x2'))(_0x3e7c('0x3'));var moment=require(_0x3e7c('0x4'));var BPromise=require(_0x3e7c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e7c('0x6'));var rimraf=require(_0x3e7c('0x7'));var config=require(_0x3e7c('0x8'));var attributes=require(_0x3e7c('0x9'));module[_0x3e7c('0xa')]=function(_0x41f9fb,_0x2954ac){return _0x41f9fb[_0x3e7c('0xb')]('SmsApplication',attributes,{'tableName':_0x3e7c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3e7c('0xd')});}; \ No newline at end of file +var _0x42d6=['rimraf','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x416d75,_0x2c8e81){var _0x10af66=function(_0x48f136){while(--_0x48f136){_0x416d75['push'](_0x416d75['shift']());}};_0x10af66(++_0x2c8e81);}(_0x42d6,0x1cd));var _0x642d=function(_0x416431,_0x3b674c){_0x416431=_0x416431-0x0;var _0x375d2c=_0x42d6[_0x416431];return _0x375d2c;};'use strict';var _=require(_0x642d('0x0'));var util=require(_0x642d('0x1'));var logger=require('../../config/logger')(_0x642d('0x2'));var moment=require(_0x642d('0x3'));var BPromise=require(_0x642d('0x4'));var rp=require(_0x642d('0x5'));var fs=require('fs');var path=require(_0x642d('0x6'));var rimraf=require(_0x642d('0x7'));var config=require('../../config/environment');var attributes=require(_0x642d('0x8'));module[_0x642d('0x9')]=function(_0x119161,_0x553b77){return _0x119161[_0x642d('0xa')](_0x642d('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x642d('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 6bea3f2..6750e60 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 _0xc999=['../../config/environment','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment','bluebird','../../config/logger'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0xc999,0x176));var _0x9c99=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0xc999[_0x4704dc];return _0x254d81;};'use strict';var _=require('lodash');var util=require(_0x9c99('0x0'));var moment=require(_0x9c99('0x1'));var BPromise=require(_0x9c99('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(_0x9c99('0x3'))('rpc');var config=require(_0x9c99('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x9c99('0x5')][_0x9c99('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xe80252,_0x47bfaa,_0xfa25e1){return new BPromise(function(_0x323317,_0x326099){return client[_0x9c99('0x7')](_0xe80252,_0xfa25e1)[_0x9c99('0x8')](function(_0xfe5788){logger['info'](_0x9c99('0x9'),_0x47bfaa,_0x9c99('0xa'));logger[_0x9c99('0xb')](_0x9c99('0xc'),_0x47bfaa,'request\x20sent',JSON[_0x9c99('0xd')](_0xfe5788));if(_0xfe5788[_0x9c99('0xe')]){if(_0xfe5788[_0x9c99('0xe')]['code']===0x1f4){logger[_0x9c99('0xe')]('SmsApplication,\x20%s,\x20%s',_0x47bfaa,_0xfe5788['error'][_0x9c99('0xf')]);return _0x326099(_0xfe5788[_0x9c99('0xe')][_0x9c99('0xf')]);}logger[_0x9c99('0xe')]('SmsApplication,\x20%s,\x20%s',_0x47bfaa,_0xfe5788[_0x9c99('0xe')]['message']);return _0x323317(_0xfe5788['error']['message']);}else{logger[_0x9c99('0x10')](_0x9c99('0x9'),_0x47bfaa,'request\x20sent');_0x323317(_0xfe5788[_0x9c99('0x11')]['message']);}})['catch'](function(_0x413965){logger[_0x9c99('0xe')]('SmsApplication,\x20%s,\x20%s',_0x47bfaa,_0x413965);_0x326099(_0x413965);});});} \ No newline at end of file +var _0xc43c=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1a7e91,_0x458f25){var _0x490321=function(_0x3efb64){while(--_0x3efb64){_0x1a7e91['push'](_0x1a7e91['shift']());}};_0x490321(++_0x458f25);}(_0xc43c,0x152));var _0xcc43=function(_0x1b8328,_0x216c97){_0x1b8328=_0x1b8328-0x0;var _0x1f9710=_0xc43c[_0x1b8328];return _0x1f9710;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var moment=require(_0xcc43('0x2'));var BPromise=require(_0xcc43('0x3'));var rs=require(_0xcc43('0x4'));var fs=require('fs');var Redis=require(_0xcc43('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc43('0x6'));var logger=require(_0xcc43('0x7'))('rpc');var config=require(_0xcc43('0x8'));var jayson=require(_0xcc43('0x9'));var client=jayson[_0xcc43('0xa')][_0xcc43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9140b6,_0x13c316,_0x298aa7){return new BPromise(function(_0x3b8857,_0x1913c6){return client[_0xcc43('0xc')](_0x9140b6,_0x298aa7)['then'](function(_0x3f017e){logger[_0xcc43('0xd')](_0xcc43('0xe'),_0x13c316,_0xcc43('0xf'));logger[_0xcc43('0x10')](_0xcc43('0x11'),_0x13c316,'request\x20sent',JSON[_0xcc43('0x12')](_0x3f017e));if(_0x3f017e[_0xcc43('0x13')]){if(_0x3f017e[_0xcc43('0x13')][_0xcc43('0x14')]===0x1f4){logger[_0xcc43('0x13')](_0xcc43('0xe'),_0x13c316,_0x3f017e['error'][_0xcc43('0x15')]);return _0x1913c6(_0x3f017e['error'][_0xcc43('0x15')]);}logger[_0xcc43('0x13')]('SmsApplication,\x20%s,\x20%s',_0x13c316,_0x3f017e['error'][_0xcc43('0x15')]);return _0x3b8857(_0x3f017e[_0xcc43('0x13')][_0xcc43('0x15')]);}else{logger[_0xcc43('0xd')](_0xcc43('0xe'),_0x13c316,_0xcc43('0xf'));_0x3b8857(_0x3f017e['result']['message']);}})[_0xcc43('0x16')](function(_0x9b6dc){logger[_0xcc43('0x13')](_0xcc43('0xe'),_0x13c316,_0x9b6dc);_0x1913c6(_0x9b6dc);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 7274fb0..c11c70d 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 _0xf846=['/:id','/:id/messages','getMessages','/:id/download','download','post','create','tracked','smsinteraction:addtags','put','sms','update','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0xcbcfd1,_0x5e1f67){var _0x21ab7f=function(_0x46d8b4){while(--_0x46d8b4){_0xcbcfd1['push'](_0xcbcfd1['shift']());}};_0x21ab7f(++_0x5e1f67);}(_0xf846,0x85));var _0x6f84=function(_0x51950b,_0x1ab0d4){_0x51950b=_0x51950b-0x0;var _0x22d012=_0xf846[_0x51950b];return _0x22d012;};'use strict';var multer=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var path=require(_0x6f84('0x2'));var timeout=require(_0x6f84('0x3'));var express=require('express');var router=express[_0x6f84('0x4')]();var auth=require(_0x6f84('0x5'));var interaction=require(_0x6f84('0x6'));var config=require(_0x6f84('0x7'));var controller=require('./smsInteraction.controller');router[_0x6f84('0x8')]('/',auth[_0x6f84('0x9')](),controller[_0x6f84('0xa')]);router[_0x6f84('0x8')](_0x6f84('0xb'),auth[_0x6f84('0x9')](),controller['describe']);router[_0x6f84('0x8')](_0x6f84('0xc'),auth[_0x6f84('0x9')](),controller['show']);router[_0x6f84('0x8')](_0x6f84('0xd'),auth['isAuthenticated'](),controller[_0x6f84('0xe')]);router[_0x6f84('0x8')](_0x6f84('0xf'),auth[_0x6f84('0x9')](),controller[_0x6f84('0x10')]);router[_0x6f84('0x11')]('/',auth[_0x6f84('0x9')](),controller[_0x6f84('0x12')]);router[_0x6f84('0x11')](_0x6f84('0xd'),auth[_0x6f84('0x9')](),controller['addMessage']);router[_0x6f84('0x11')]('/:id/tags',auth[_0x6f84('0x9')](),interaction[_0x6f84('0x13')]('sms',_0x6f84('0x14')),controller['addTags']);router[_0x6f84('0x15')]('/:id',auth[_0x6f84('0x9')](),interaction['tracked'](_0x6f84('0x16'),'smsinteraction:update'),controller[_0x6f84('0x17')]);router[_0x6f84('0x18')](_0x6f84('0xc'),auth[_0x6f84('0x9')](),interaction[_0x6f84('0x13')](_0x6f84('0x16'),'smsinteraction:destroy'),controller[_0x6f84('0x19')]);router['delete'](_0x6f84('0x1a'),auth[_0x6f84('0x9')](),controller[_0x6f84('0x1b')]);module[_0x6f84('0x1c')]=router; \ No newline at end of file +var _0xcb1a=['/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','tracked','smsinteraction:addtags','put','update','delete','sms','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','get'];(function(_0x50e0f5,_0x56b5aa){var _0x47a4ff=function(_0x2b8d02){while(--_0x2b8d02){_0x50e0f5['push'](_0x50e0f5['shift']());}};_0x47a4ff(++_0x56b5aa);}(_0xcb1a,0xb6));var _0xacb1=function(_0x195be5,_0x57cbf1){_0x195be5=_0x195be5-0x0;var _0x3e7244=_0xcb1a[_0x195be5];return _0x3e7244;};'use strict';var multer=require(_0xacb1('0x0'));var util=require(_0xacb1('0x1'));var path=require(_0xacb1('0x2'));var timeout=require(_0xacb1('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xacb1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xacb1('0x5'));var controller=require(_0xacb1('0x6'));router['get']('/',auth[_0xacb1('0x7')](),controller[_0xacb1('0x8')]);router[_0xacb1('0x9')](_0xacb1('0xa'),auth[_0xacb1('0x7')](),controller[_0xacb1('0xb')]);router['get'](_0xacb1('0xc'),auth[_0xacb1('0x7')](),controller[_0xacb1('0xd')]);router[_0xacb1('0x9')](_0xacb1('0xe'),auth[_0xacb1('0x7')](),controller[_0xacb1('0xf')]);router[_0xacb1('0x9')](_0xacb1('0x10'),auth[_0xacb1('0x7')](),controller[_0xacb1('0x11')]);router['post']('/',auth[_0xacb1('0x7')](),controller[_0xacb1('0x12')]);router['post']('/:id/messages',auth[_0xacb1('0x7')](),controller[_0xacb1('0x13')]);router[_0xacb1('0x14')](_0xacb1('0x15'),auth[_0xacb1('0x7')](),interaction[_0xacb1('0x16')]('sms',_0xacb1('0x17')),controller['addTags']);router[_0xacb1('0x18')](_0xacb1('0xc'),auth[_0xacb1('0x7')](),interaction[_0xacb1('0x16')]('sms','smsinteraction:update'),controller[_0xacb1('0x19')]);router[_0xacb1('0x1a')](_0xacb1('0xc'),auth[_0xacb1('0x7')](),interaction[_0xacb1('0x16')](_0xacb1('0x1b'),_0xacb1('0x1c')),controller[_0xacb1('0x1d')]);router[_0xacb1('0x1a')](_0xacb1('0x15'),auth[_0xacb1('0x7')](),controller[_0xacb1('0x1e')]);module[_0xacb1('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 6a269d2..9ee02d9 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 _0xb7e7=['out','sequelize','exports','DATE','STRING','ENUM'];(function(_0xc19030,_0xab5d1f){var _0x335b43=function(_0x1034d9){while(--_0x1034d9){_0xc19030['push'](_0xc19030['shift']());}};_0x335b43(++_0xab5d1f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xb7e7[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require(_0x7b7e('0x0'));var moment=require('moment');module[_0x7b7e('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7b7e('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7b7e('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7b7e('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x7b7e('0x4')]('in',_0x7b7e('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7b7e('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xe706=['ENUM','out','sequelize','moment','exports','DATE','STRING'];(function(_0x65009d,_0x3c2db6){var _0xfbf43f=function(_0x144202){while(--_0x144202){_0x65009d['push'](_0x65009d['shift']());}};_0xfbf43f(++_0x3c2db6);}(_0xe706,0xa3));var _0x6e70=function(_0x355ca3,_0xd3e1e7){_0x355ca3=_0x355ca3-0x0;var _0x55edba=_0xe706[_0x355ca3];return _0x55edba;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6e70('0x3')]},'disposition':{'type':Sequelize[_0x6e70('0x4')]},'note':{'type':Sequelize[_0x6e70('0x4')]},'phone':{'type':Sequelize[_0x6e70('0x4')]},'read1stAt':{'type':Sequelize[_0x6e70('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6e70('0x5')]('in',_0x6e70('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6e70('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6e70('0x5')]('in',_0x6e70('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 56e4b6b..7e4b921 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 _0x0adf=['request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','error','name','send','Users','map','TagIds','Tags','split','forEach','index','SmsInteraction','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','text','Tag','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','rows','catch','includeAll','create','params','describe','SmsMessage','addMessage','omit','ids','getMessages','findOne','rawAttributes','format','YYYY-MM-DD\x20HH:mm:ss','options','include','addTags','setTags','spread','findAll','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','fullname','get','mkdirSync','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\x0a\x20\x20\x20\x20\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%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\x0a\x20\x20\x20\x20\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{{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\x0a\x20\x20\x20\x20\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%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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','N.A.','closed','closedAt','disposition','out','System','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch'];(function(_0x2bbc27,_0x33e513){var _0x31ca5b=function(_0x40ee98){while(--_0x40ee98){_0x2bbc27['push'](_0x2bbc27['shift']());}};_0x31ca5b(++_0x33e513);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x2e7469,_0x32af59){_0x2e7469=_0x2e7469-0x0;var _0x3a93f0=_0x0adf[_0x2e7469];return _0x3a93f0;};'use strict';var pdf=require(_0xf0ad('0x0'));var emlformat=require(_0xf0ad('0x1'));var rimraf=require(_0xf0ad('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0ad('0x3'));var rp=require(_0xf0ad('0x4'));var moment=require(_0xf0ad('0x5'));var BPromise=require(_0xf0ad('0x6'));var Mustache=require(_0xf0ad('0x7'));var util=require(_0xf0ad('0x8'));var path=require(_0xf0ad('0x9'));var sox=require('sox');var csv=require(_0xf0ad('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf0ad('0xb'));var squel=require(_0xf0ad('0xc'));var crypto=require(_0xf0ad('0xd'));var jsforce=require(_0xf0ad('0xe'));var deskjs=require(_0xf0ad('0xf'));var toCsv=require(_0xf0ad('0xa'));var querystring=require(_0xf0ad('0x10'));var Papa=require('papaparse');var Redis=require(_0xf0ad('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf0ad('0x12'));var as=require(_0xf0ad('0x13'));var hardwareService=require(_0xf0ad('0x14'));var logger=require(_0xf0ad('0x15'))(_0xf0ad('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf0ad('0x17'))['db'];config[_0xf0ad('0x18')]=_[_0xf0ad('0x19')](config[_0xf0ad('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf0ad('0x1a'))(new Redis(config[_0xf0ad('0x18')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x5332e9,_0x221d7b){_0x221d7b=_0x221d7b||0xcc;return function(_0x513237){if(_0x513237){return _0x5332e9[_0xf0ad('0x1b')](_0x221d7b);}return _0x5332e9[_0xf0ad('0x1c')](_0x221d7b)[_0xf0ad('0x1d')]();};}function respondWithResult(_0xfa829e,_0x237dd9){_0x237dd9=_0x237dd9||0xc8;return function(_0x5c23ff){if(_0x5c23ff){return _0xfa829e[_0xf0ad('0x1c')](_0x237dd9)[_0xf0ad('0x1e')](_0x5c23ff);}};}function respondWithFilteredResult(_0x1b00f1,_0x1c9fac){return function(_0x47fa2b){if(_0x47fa2b){var _0x4e9970=_0x47fa2b[_0xf0ad('0x1f')],_0x2466e8=_0x1c9fac[_0xf0ad('0x20')],_0x46fb20=_0x1c9fac[_0xf0ad('0x20')]+_0x1c9fac[_0xf0ad('0x21')],_0x49f2ec;if(_0x46fb20>=_0x4e9970){_0x46fb20=_0x4e9970;_0x49f2ec=0xc8;}else{_0x49f2ec=0xce;}_0x1b00f1['status'](_0x49f2ec);return _0x1b00f1['set'](_0xf0ad('0x22'),_0x2466e8+'-'+_0x46fb20+'/'+_0x4e9970)[_0xf0ad('0x1e')](_0x47fa2b);}return null;};}function patchUpdates(_0x37b968){return function(_0x20c5f3){try{jsonpatch[_0xf0ad('0x23')](_0x20c5f3,_0x37b968,!![]);}catch(_0x22d50f){return BPromise['reject'](_0x22d50f);}return _0x20c5f3[_0xf0ad('0x24')]();};}function saveUpdates(_0x16e62a,_0x31635b){return function(_0x3ece1e){if(_0x3ece1e){return _0x3ece1e[_0xf0ad('0x25')](_0x16e62a)[_0xf0ad('0x26')](function(_0xb91769){return _0xb91769;});}return null;};}function removeEntity(_0x276322,_0x3fc97e){return function(_0x112f20){if(_0x112f20){return _0x112f20[_0xf0ad('0x27')]()[_0xf0ad('0x26')](function(){_0x276322[_0xf0ad('0x1c')](0xcc)[_0xf0ad('0x1d')]();});}};}function handleEntityNotFound(_0x879f89,_0x557f90){return function(_0x234bc7){if(!_0x234bc7){_0x879f89[_0xf0ad('0x1b')](0x194);}return _0x234bc7;};}function handleError(_0x248794,_0x7377d7){_0x7377d7=_0x7377d7||0x1f4;return function(_0x28c280){logger[_0xf0ad('0x28')](_0x28c280['stack']);if(_0x28c280[_0xf0ad('0x29')]){delete _0x28c280[_0xf0ad('0x29')];}_0x248794[_0xf0ad('0x1c')](_0x7377d7)[_0xf0ad('0x2a')](_0x28c280);};}function getInteractionUsers(_0x1b6880,_0x1ac25c){return new BPromise(function(_0x267b7a,_0x1bee71){try{if(_0x1ac25c[_0x1b6880['id']]){_0x1b6880[_0xf0ad('0x2b')]=_[_0xf0ad('0x2c')](_0x1ac25c[_0x1b6880['id']],function(_0x2d1b2f){return{'id':_0x2d1b2f['id'],'fullname':_0x2d1b2f['fullname']};});}}catch(_0x1a1e1c){_0x1bee71(_0x1a1e1c);}_0x267b7a(_0x1b6880);});}function getInteractionTags(_0x5f5115,_0x83f211){return new BPromise(function(_0x57a1f3,_0x25ed0b){try{if(_0x5f5115[_0xf0ad('0x2d')]){_0x5f5115[_0xf0ad('0x2e')]=[];_0x5f5115[_0xf0ad('0x2d')][_0xf0ad('0x2f')](',')[_0xf0ad('0x30')](function(_0x16cb69){_0x5f5115[_0xf0ad('0x2e')]['push'](_0x83f211[_0x16cb69]);});}delete _0x5f5115['TagIds'];}catch(_0x22ecf3){_0x25ed0b(_0x22ecf3);}_0x57a1f3(_0x5f5115);});}function updateSmsInteraction(_0x113bf2,_0xd608bf,_0x24a938){return new BPromise(function(_0x530e5b,_0x42e81e){return getInteractionUsers(_0x113bf2,_0x24a938)['then'](function(_0x12ac45){return getInteractionTags(_0x12ac45,_0xd608bf);})['then'](function(_0x4136b9){_0x530e5b(_0x4136b9);})['catch'](function(_0x3d9e48){_0x42e81e(_0x3d9e48);});});}exports[_0xf0ad('0x31')]=function(_0x3ad7e4,_0x35102b){var _0x42f87f={},_0x46b6ba={},_0x25cca0={'count':0x0,'rows':[]};var _0x35a941=_['map'](db[_0xf0ad('0x32')]['rawAttributes'],function(_0x26ec3d){return{'name':_0x26ec3d['fieldName'],'type':_0x26ec3d[_0xf0ad('0x33')][_0xf0ad('0x34')]};});_0x46b6ba[_0xf0ad('0x35')]=_[_0xf0ad('0x2c')](_0x35a941,_0xf0ad('0x29'));_0x46b6ba['query']=_[_0xf0ad('0x36')](_0x3ad7e4[_0xf0ad('0x37')]);_0x46b6ba[_0xf0ad('0x38')]=_[_0xf0ad('0x39')](_0x46b6ba[_0xf0ad('0x35')],_0x46b6ba[_0xf0ad('0x37')]);_0x42f87f[_0xf0ad('0x3a')]=_['intersection'](_0x46b6ba[_0xf0ad('0x35')],qs[_0xf0ad('0x3b')](_0x3ad7e4[_0xf0ad('0x37')][_0xf0ad('0x3b')]));_0x42f87f[_0xf0ad('0x3a')]=_0x42f87f[_0xf0ad('0x3a')][_0xf0ad('0x3c')]?_0x42f87f[_0xf0ad('0x3a')]:_0x46b6ba[_0xf0ad('0x35')];if(!_0x3ad7e4['query'][_0xf0ad('0x3d')](_0xf0ad('0x3e'))){_0x42f87f[_0xf0ad('0x21')]=qs['limit'](_0x3ad7e4['query']['limit']);_0x42f87f[_0xf0ad('0x20')]=qs[_0xf0ad('0x20')](_0x3ad7e4[_0xf0ad('0x37')][_0xf0ad('0x20')]);}_0x42f87f[_0xf0ad('0x3f')]=qs[_0xf0ad('0x40')](_0x3ad7e4[_0xf0ad('0x37')][_0xf0ad('0x40')]);_0x42f87f[_0xf0ad('0x41')]=qs[_0xf0ad('0x38')](_[_0xf0ad('0x42')](_0x3ad7e4['query'],_0x46b6ba['filters']));var _0x5cd1dc=[];var _0x1c0609=squel[_0xf0ad('0x43')]()['field']('id')[_0xf0ad('0x44')](_0xf0ad('0x29'))['field'](_0xf0ad('0x45'))[_0xf0ad('0x46')](_0xf0ad('0x47'));var _0x440291=squel['select']()[_0xf0ad('0x44')](_0xf0ad('0x48'))[_0xf0ad('0x44')](_0xf0ad('0x49'))[_0xf0ad('0x44')](_0xf0ad('0x4a'))[_0xf0ad('0x46')](_0xf0ad('0x4b'),'ui')[_0xf0ad('0x4c')](_0xf0ad('0x4d'),'u',_0xf0ad('0x4e'));var _0x4bbef8=squel[_0xf0ad('0x43')]()[_0xf0ad('0x46')](_0xf0ad('0x4f'),'i')['left_join']('cm_contacts','c',_0xf0ad('0x50'))[_0xf0ad('0x4c')](_0xf0ad('0x4d'),'o',_0xf0ad('0x51'))[_0xf0ad('0x4c')](_0xf0ad('0x52'),'a',_0xf0ad('0x53'))['left_join'](_0xf0ad('0x54'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xf0ad('0x4c')](_0xf0ad('0x55'),'it',_0xf0ad('0x56'))[_0xf0ad('0x4c')](_0xf0ad('0x47'),'t','t.id\x20=\x20it.TagId');var _0x4e8ef5=squel[_0xf0ad('0x57')]();var _0x3b366b=[];var _0x35bfc9=squel[_0xf0ad('0x57')]();var _0x2ae651;if(_0x3ad7e4[_0xf0ad('0x37')][_0xf0ad('0x58')]){_0x2ae651=as['parseSearch'](_0x3ad7e4[_0xf0ad('0x37')][_0xf0ad('0x58')]);var _0x6d225b=_0x2ae651[_0xf0ad('0x59')];for(var _0x2cb082=0x0;_0x2cb082<_0x2ae651['conditions'][_0xf0ad('0x3c')];_0x2cb082++){var _0xf7f1d7=_0x2ae651[_0xf0ad('0x5a')][_0x2cb082];var _0x3b3b50='i';var _0x3b48f3=_[_0xf0ad('0x5b')](_0x35a941,[_0xf0ad('0x29'),_0xf7f1d7['field']]);if(!_0x3b48f3){switch(_0xf7f1d7[_0xf0ad('0x44')]){case _0xf0ad('0x5c'):if(_0xf7f1d7[_0xf0ad('0x5d')]==0x1){_0x4bbef8['having']('`'+_0xf7f1d7[_0xf0ad('0x44')]+_0xf0ad('0x5e'));}else{_0x4bbef8[_0xf0ad('0x5f')]('`'+_0xf7f1d7[_0xf0ad('0x44')]+_0xf0ad('0x60'));}break;case _0xf0ad('0x61'):if(_0xf7f1d7[_0xf0ad('0x62')]===_0xf0ad('0x63')){if(_0xf7f1d7[_0xf0ad('0x5d')][_0xf0ad('0x2f')]('\x20')[_0xf0ad('0x3c')]>0x1){_0x4e8ef5[_0x6d225b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xf7f1d7[_0xf0ad('0x5d')]),null);}else{var _0xa4a3cb='%'+_0xf7f1d7['value']+'%';_0x4e8ef5[_0x6d225b](_0xf0ad('0x64'),_0xa4a3cb,_0xa4a3cb,_0xa4a3cb);}}else{_0x3b48f3=_[_0xf0ad('0x5b')](_0x35a941,['name','ContactId']);_0xf7f1d7[_0xf0ad('0x44')]='ContactId';_0x1fe9df=as['buildExpression'](_0x3b3b50,_0x3b48f3['type'],_0xf7f1d7);_0x4e8ef5[_0x6d225b](_0x1fe9df[_0xf0ad('0x65')],_0x1fe9df['value']['start'],_0x1fe9df[_0xf0ad('0x5d')][_0xf0ad('0x1d')]);}break;case _0xf0ad('0x66'):var _0x3dff21=_0xf7f1d7[_0xf0ad('0x5d')][_0xf0ad('0x2f')](',')[_0xf0ad('0x2c')](function(_0x52075c){return Number(_0x52075c);});_0x3dff21[_0xf0ad('0x30')](function(_0x509efb){_0x35bfc9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x509efb+',%');});_0x3b366b=_['union'](_0x3b366b,_0x3dff21);break;case'User':if(_0xf7f1d7[_0xf0ad('0x62')]===_0xf0ad('0x63')){_0x4e8ef5[_0x6d225b](_0xf0ad('0x67'),'%'+_0xf7f1d7[_0xf0ad('0x5d')]+'%',null);}else{_0x3b48f3=_[_0xf0ad('0x5b')](_0x35a941,[_0xf0ad('0x29'),_0xf0ad('0x68')]);_0xf7f1d7[_0xf0ad('0x44')]=_0xf0ad('0x68');_0x1fe9df=as[_0xf0ad('0x69')](_0x3b3b50,_0x3b48f3[_0xf0ad('0x33')],_0xf7f1d7);_0x4e8ef5[_0x6d225b](_0x1fe9df['text'],_0x1fe9df['value'][_0xf0ad('0x6a')],_0x1fe9df[_0xf0ad('0x5d')]['end']);}break;case _0xf0ad('0x6b'):_0x1fe9df=as[_0xf0ad('0x69')]('me',null,_0xf7f1d7);_0x4e8ef5[_0x6d225b](_0x1fe9df['text'],_0x1fe9df[_0xf0ad('0x5d')][_0xf0ad('0x6a')],_0x1fe9df[_0xf0ad('0x5d')]['end']);break;}}else{var _0x1fe9df=as[_0xf0ad('0x69')](_0x3b3b50,_0x3b48f3[_0xf0ad('0x33')],_0xf7f1d7);_0x4e8ef5[_0x6d225b](_0x1fe9df[_0xf0ad('0x65')],_0x1fe9df[_0xf0ad('0x5d')][_0xf0ad('0x6a')],_0x1fe9df[_0xf0ad('0x5d')][_0xf0ad('0x1d')]);}}}else{var _0x57e096=_(_0x3ad7e4[_0xf0ad('0x37')])['keys']()[_0xf0ad('0x2c')](function(_0x83769d){return _[_0xf0ad('0x6c')](_0x35a941,['name',_0x83769d])?_0x83769d:undefined;})[_0xf0ad('0x6d')]()['value']();if(!_[_0xf0ad('0x6e')](_0x57e096)){_0x57e096[_0xf0ad('0x30')](function(_0x3b2e92){if(_0x3b2e92===_0xf0ad('0x6f')){_0x4bbef8[_0xf0ad('0x41')](_0xf0ad('0x70'),[][_0xf0ad('0x71')](_0x3ad7e4['query'][_0x3b2e92]));}else if(_0x3b2e92===_0xf0ad('0x72')){var _0x25f260=JSON['parse'](_0x3ad7e4[_0xf0ad('0x37')][_0x3b2e92])[_0xf0ad('0x73')];var _0x26bacf=JSON[_0xf0ad('0x74')](_0x3ad7e4[_0xf0ad('0x37')][_0x3b2e92])[_0xf0ad('0x75')];_0x4bbef8[_0xf0ad('0x41')](_0xf0ad('0x76'),_0x25f260,_0x26bacf);}else{if(_0x3ad7e4[_0xf0ad('0x37')][_0x3b2e92]===_0xf0ad('0x77')){_0x4bbef8[_0xf0ad('0x41')]('i.'+_0x3b2e92+_0xf0ad('0x78'));}else{_0x4bbef8[_0xf0ad('0x41')]('i.'+_0x3b2e92+'\x20=\x20?',_0x3ad7e4[_0xf0ad('0x37')][_0x3b2e92]);}}});}if(_0x3ad7e4[_0xf0ad('0x37')][_0xf0ad('0x79')]){if(_0x3ad7e4[_0xf0ad('0x37')]['read']==0x1){_0x4bbef8[_0xf0ad('0x5f')](_0xf0ad('0x7a'));}else{_0x4bbef8[_0xf0ad('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x3ad7e4[_0xf0ad('0x37')]['tag']){_0x3b366b=_[_0xf0ad('0x7b')](_0x3ad7e4[_0xf0ad('0x37')][_0xf0ad('0x7c')])?_0x3ad7e4[_0xf0ad('0x37')]['tag']:new Array(_0x3ad7e4[_0xf0ad('0x37')]['tag']);_0x3b366b['forEach'](function(_0x3a4acf){_0x35bfc9['or'](_0xf0ad('0x7d'),'%,'+_0x3a4acf+',%');});}if(_0x3ad7e4[_0xf0ad('0x37')][_0xf0ad('0x7e')]){var _0x37b261=_0x3ad7e4['query']['filter'][_0xf0ad('0x7f')]('\x5c','\x5c\x5c')[_0xf0ad('0x7f')]('\x27\x27',_0xf0ad('0x80'));if(qs[_0xf0ad('0x81')](_0x37b261)){_0x4e8ef5['or'](_0xf0ad('0x82'),_0x37b261+'%')['or'](_0xf0ad('0x83'),_0x37b261+'%');}else{_0x4e8ef5['or'](_0xf0ad('0x84'),qs['getFullTextValue'](_0x37b261))['or'](_0xf0ad('0x85'),_0x37b261+'%');}}}_0x4bbef8[_0xf0ad('0x41')](_0x4e8ef5);_0x4bbef8[_0xf0ad('0x86')](_0xf0ad('0x87'));var _0x1de851={'type':db[_0xf0ad('0x88')]['QueryTypes']['SELECT'],'raw':!![]};var _0x476623=_0x4bbef8[_0xf0ad('0x89')]();_0x476623[_0xf0ad('0x44')](_0xf0ad('0x87'));_0x476623['field'](_0xf0ad('0x8a'),'unreadMessages');if(_0x42f87f['order']){_0x42f87f[_0xf0ad('0x3f')]['forEach'](function(_0x2ba017){_0x4bbef8['order']('i.'+_0x2ba017[0x0],_0x2ba017[0x1]==='DESC'?![]:!![]);});}if(!_[_0xf0ad('0x6e')](_0x3b366b)){_0x4bbef8[_0xf0ad('0x5f')](_0x35bfc9);_0x476623[_0xf0ad('0x41')](_0xf0ad('0x8b'),_0x3b366b);}BPromise['resolve']()[_0xf0ad('0x26')](function(){if(!_0x2ae651){if(_0x3ad7e4[_0xf0ad('0x37')][_0xf0ad('0x6f')]||_0x3ad7e4['query']['journey'])return;_0x476623['where'](_0xf0ad('0x8c'));_0x4bbef8[_0xf0ad('0x41')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3ad7e4[_0xf0ad('0x8d')][_0xf0ad('0x8e')]({'attributes':['id'],'raw':!![]})[_0xf0ad('0x26')](function(_0x21710b){if(_[_0xf0ad('0x6e')](_0x21710b)){_0x476623[_0xf0ad('0x41')](_0xf0ad('0x8f'));_0x4bbef8[_0xf0ad('0x41')](_0xf0ad('0x8f'));}else{_0x476623['where'](_0xf0ad('0x70'),_[_0xf0ad('0x2c')](_0x21710b,'id'));_0x4bbef8['where'](_0xf0ad('0x70'),_[_0xf0ad('0x2c')](_0x21710b,'id'));}});})[_0xf0ad('0x26')](function(){db[_0xf0ad('0x90')][_0xf0ad('0x37')](_0x476623[_0xf0ad('0x91')](),_0x1de851)[_0xf0ad('0x26')](function(_0x502e81){_0x25cca0[_0xf0ad('0x1f')]=_0x502e81[_0xf0ad('0x3c')];if(_0x25cca0['count']===0x0)return[];return db[_0xf0ad('0x90')][_0xf0ad('0x37')](_0x1c0609[_0xf0ad('0x91')](),_0x1de851)[_0xf0ad('0x26')](function(_0x5642b7){_0x5cd1dc=_[_0xf0ad('0x92')](_0x5642b7,'id');_0x1de851=_[_0xf0ad('0x93')](_0x1de851,{'model':db[_0xf0ad('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ad7e4[_0xf0ad('0x37')][_0xf0ad('0x3b')]){_0x42f87f[_0xf0ad('0x3a')][_0xf0ad('0x30')](function(_0x475960){_0x4bbef8[_0xf0ad('0x44')]('i.'+_0x475960);});}else{_0x4bbef8[_0xf0ad('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf0ad('0x5c'));_0x4bbef8[_0xf0ad('0x44')]('a.key',_0xf0ad('0x94'));_0x4bbef8[_0xf0ad('0x44')]('a.mandatoryDisposition',_0xf0ad('0x95'));_0x4bbef8[_0xf0ad('0x44')](_0xf0ad('0x96'));_0x4bbef8[_0xf0ad('0x44')](_0xf0ad('0x97'),_0xf0ad('0x98'));_0x4bbef8[_0xf0ad('0x44')](_0xf0ad('0x99'),'Contact.lastName');_0x4bbef8[_0xf0ad('0x44')](_0xf0ad('0x9a'),'Contact.email');_0x4bbef8[_0xf0ad('0x44')](_0xf0ad('0x9b'),_0xf0ad('0x9c'));_0x4bbef8[_0xf0ad('0x44')](_0xf0ad('0x9d'),_0xf0ad('0x9e'));_0x4bbef8[_0xf0ad('0x44')]('c.fax',_0xf0ad('0x9f'));_0x4bbef8[_0xf0ad('0x44')]('o.fullname',_0xf0ad('0xa0'));_0x4bbef8[_0xf0ad('0x44')](_0xf0ad('0xa1'),_0xf0ad('0xa2'));_0x4bbef8[_0xf0ad('0x44')](_0xf0ad('0xa3'),'TagIds');}_0x4bbef8[_0xf0ad('0x21')](_0x42f87f[_0xf0ad('0x21')]);_0x4bbef8[_0xf0ad('0x20')](_0x42f87f[_0xf0ad('0x20')]);return db['sequelize'][_0xf0ad('0x37')](_0x4bbef8[_0xf0ad('0x91')](),_0x1de851);})[_0xf0ad('0x26')](function(_0x1100c5){_0x440291[_0xf0ad('0x41')](_0xf0ad('0xa4'),_[_0xf0ad('0x2c')](_0x1100c5,'id'));return db[_0xf0ad('0x90')][_0xf0ad('0x37')](_0x440291[_0xf0ad('0x91')](),_0x1de851)[_0xf0ad('0x26')](function(_0x30dd68){var _0x3df67b=_[_0xf0ad('0xa5')](_0x30dd68,_0xf0ad('0xa6'));var _0x321a27=[];_0x1100c5[_0xf0ad('0x30')](function(_0x5c779c){_0x321a27[_0xf0ad('0xa7')](updateSmsInteraction(_0x5c779c,_0x5cd1dc,_0x3df67b));});return BPromise[_0xf0ad('0xa8')](_0x321a27);});});})[_0xf0ad('0x26')](function(_0x26c42a){_0x25cca0[_0xf0ad('0xa9')]=_0x26c42a;return _0x25cca0;})[_0xf0ad('0x26')](respondWithFilteredResult(_0x35102b,_0x42f87f));})[_0xf0ad('0xaa')](handleError(_0x35102b,null));};exports['show']=function(_0x5e9de4,_0x4171c4){var _0x3c6317={'raw':![],'where':{'id':_0x5e9de4['params']['id']}},_0x391ba={};_0x391ba[_0xf0ad('0x35')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x391ba[_0xf0ad('0x37')]=_[_0xf0ad('0x36')](_0x5e9de4['query']);_0x391ba[_0xf0ad('0x38')]=_[_0xf0ad('0x39')](_0x391ba[_0xf0ad('0x35')],_0x391ba[_0xf0ad('0x37')]);_0x3c6317['attributes']=_[_0xf0ad('0x39')](_0x391ba['model'],qs['fields'](_0x5e9de4[_0xf0ad('0x37')][_0xf0ad('0x3b')]));_0x3c6317[_0xf0ad('0x3a')]=_0x3c6317[_0xf0ad('0x3a')]['length']?_0x3c6317['attributes']:_0x391ba[_0xf0ad('0x35')];if(_0x5e9de4['query'][_0xf0ad('0xab')]){_0x3c6317['include']=[{'all':!![]}];}_0x3c6317=_[_0xf0ad('0x93')]({},_0x3c6317,_0x5e9de4['options']);return db[_0xf0ad('0x32')]['find'](_0x3c6317)[_0xf0ad('0x26')](handleEntityNotFound(_0x4171c4,null))[_0xf0ad('0x26')](respondWithResult(_0x4171c4,null))[_0xf0ad('0xaa')](handleError(_0x4171c4,null));};exports[_0xf0ad('0xac')]=function(_0x1e5f4b,_0x597c8c){return db[_0xf0ad('0x32')][_0xf0ad('0xac')](_0x1e5f4b['body'],{})[_0xf0ad('0x26')](respondWithResult(_0x597c8c,0xc9))[_0xf0ad('0xaa')](handleError(_0x597c8c,null));};exports['update']=function(_0x2c159f,_0x1f34ea){if(_0x2c159f[_0xf0ad('0x6b')]['id']){delete _0x2c159f[_0xf0ad('0x6b')]['id'];}return db['SmsInteraction'][_0xf0ad('0x5b')]({'where':{'id':_0x2c159f[_0xf0ad('0xad')]['id']}})[_0xf0ad('0x26')](handleEntityNotFound(_0x1f34ea,null))['then'](saveUpdates(_0x2c159f[_0xf0ad('0x6b')],null))['then'](respondWithResult(_0x1f34ea,null))[_0xf0ad('0xaa')](handleError(_0x1f34ea,null));};exports[_0xf0ad('0x27')]=function(_0x1ab418,_0x4ce732){return db[_0xf0ad('0x32')][_0xf0ad('0x5b')]({'where':{'id':_0x1ab418[_0xf0ad('0xad')]['id']}})['then'](handleEntityNotFound(_0x4ce732,null))[_0xf0ad('0x26')](removeEntity(_0x4ce732,null))[_0xf0ad('0xaa')](handleError(_0x4ce732,null));};exports[_0xf0ad('0xae')]=function(_0x4e7bb0,_0x55b4e9){return db['SmsInteraction'][_0xf0ad('0xae')]()[_0xf0ad('0x26')](respondWithResult(_0x55b4e9,null))['catch'](handleError(_0x55b4e9,null));};exports['addMessage']=function(_0x155b91,_0xf228cd,_0x581464){return db[_0xf0ad('0xaf')][_0xf0ad('0x5b')]({'where':{'id':_0x155b91[_0xf0ad('0xad')]['id']}})[_0xf0ad('0x26')](handleEntityNotFound(_0xf228cd,null))['then'](function(_0x5e81b3){if(_0x5e81b3){return _0x5e81b3[_0xf0ad('0xb0')](_0x155b91[_0xf0ad('0x6b')]['ids'],_[_0xf0ad('0xb1')](_0x155b91['body'],[_0xf0ad('0xb2'),'id'])||{});}})[_0xf0ad('0x26')](respondWithResult(_0xf228cd,null))[_0xf0ad('0xaa')](handleError(_0xf228cd,null));};exports[_0xf0ad('0xb3')]=function(_0xfcfdc2,_0x1205f6,_0x476096){var _0x3bb3db={'raw':![],'where':{}};var _0x2af5ba={};var _0x4616b3={'count':0x0,'rows':[]};return db[_0xf0ad('0x32')][_0xf0ad('0xb4')]({'where':{'id':_0xfcfdc2[_0xf0ad('0xad')]['id']}})[_0xf0ad('0x26')](handleEntityNotFound(_0x1205f6,null))[_0xf0ad('0x26')](function(_0xaed5f5){if(_0xaed5f5){_0x2af5ba[_0xf0ad('0x35')]=_[_0xf0ad('0x36')](db['SmsMessage'][_0xf0ad('0xb5')]);_0x2af5ba['query']=_[_0xf0ad('0x36')](_0xfcfdc2[_0xf0ad('0x37')]);_0x2af5ba[_0xf0ad('0x38')]=_['intersection'](_0x2af5ba[_0xf0ad('0x35')],_0x2af5ba[_0xf0ad('0x37')]);_0x3bb3db['attributes']=_[_0xf0ad('0x39')](_0x2af5ba[_0xf0ad('0x35')],qs[_0xf0ad('0x3b')](_0xfcfdc2['query'][_0xf0ad('0x3b')]));_0x3bb3db['attributes']=_0x3bb3db[_0xf0ad('0x3a')][_0xf0ad('0x3c')]?_0x3bb3db[_0xf0ad('0x3a')]:_0x2af5ba[_0xf0ad('0x35')];if(!_0xfcfdc2[_0xf0ad('0x37')][_0xf0ad('0x3d')](_0xf0ad('0x3e'))){_0x3bb3db[_0xf0ad('0x21')]=qs[_0xf0ad('0x21')](_0xfcfdc2[_0xf0ad('0x37')][_0xf0ad('0x21')]);_0x3bb3db[_0xf0ad('0x20')]=qs[_0xf0ad('0x20')](_0xfcfdc2[_0xf0ad('0x37')]['offset']);}_0x3bb3db[_0xf0ad('0x3f')]=qs[_0xf0ad('0x40')](_0xfcfdc2[_0xf0ad('0x37')][_0xf0ad('0x40')]);_0x3bb3db[_0xf0ad('0x41')]=qs['filters'](_[_0xf0ad('0x42')](_0xfcfdc2[_0xf0ad('0x37')],_0x2af5ba[_0xf0ad('0x38')]));_0x3bb3db[_0xf0ad('0x41')]['SmsInteractionId']=_0xaed5f5['id'];if(_0xfcfdc2['query'][_0xf0ad('0x7e')]){_0x3bb3db[_0xf0ad('0x41')]=_[_0xf0ad('0x93')](_0x3bb3db[_0xf0ad('0x41')],{'$or':_[_0xf0ad('0x2c')](_0x3bb3db[_0xf0ad('0x3a')],function(_0x12c5d6){var _0x156ced={};_0x156ced[_0x12c5d6]={'$like':'%'+_0xfcfdc2[_0xf0ad('0x37')]['filter']+'%'};return _0x156ced;})});}if(_0xfcfdc2[_0xf0ad('0x37')]['$gte']){var _0x391a86=_0xfcfdc2[_0xf0ad('0x37')][_0xf0ad('0x73')][_0xf0ad('0x2f')](',');var _0x52e2a2={};_0x52e2a2[_0x391a86[0x0]]={'$gte':moment(_0x391a86[0x1])[_0xf0ad('0xb6')](_0xf0ad('0xb7'))};_0x3bb3db[_0xf0ad('0x41')]=_['merge'](_0x3bb3db[_0xf0ad('0x41')],_0x52e2a2);}_0x3bb3db=_[_0xf0ad('0x93')]({},_0x3bb3db,_0xfcfdc2[_0xf0ad('0xb8')]);return db[_0xf0ad('0xaf')]['count']({'where':_0x3bb3db[_0xf0ad('0x41')]})[_0xf0ad('0x26')](function(_0x54aed6){_0x4616b3[_0xf0ad('0x1f')]=_0x54aed6;if(_0xfcfdc2[_0xf0ad('0x37')][_0xf0ad('0xab')]){_0x3bb3db[_0xf0ad('0xb9')]=[{'all':!![]}];}return db[_0xf0ad('0xaf')]['findAll'](_0x3bb3db);})[_0xf0ad('0x26')](function(_0x3275f2){_0x4616b3[_0xf0ad('0xa9')]=_0x3275f2;return _0x4616b3;});}})[_0xf0ad('0x26')](respondWithFilteredResult(_0x1205f6,_0x3bb3db))['catch'](handleError(_0x1205f6,null));};exports[_0xf0ad('0xba')]=function(_0x4d89e2,_0x274b67,_0x55cb21){return db[_0xf0ad('0x32')][_0xf0ad('0x5b')]({'where':{'id':_0x4d89e2[_0xf0ad('0xad')]['id']}})[_0xf0ad('0x26')](handleEntityNotFound(_0x274b67,null))[_0xf0ad('0x26')](function(_0x405d6f){if(_0x405d6f){return _0x405d6f[_0xf0ad('0xbb')](_0x4d89e2[_0xf0ad('0x6b')][_0xf0ad('0xb2')],_[_0xf0ad('0xb1')](_0x4d89e2[_0xf0ad('0x6b')],[_0xf0ad('0xb2'),'id'])||{})[_0xf0ad('0xbc')](function(){return db[_0xf0ad('0x66')][_0xf0ad('0xbd')]({'attributes':['id',_0xf0ad('0x29'),_0xf0ad('0x45')],'where':{'id':_0x4d89e2[_0xf0ad('0x6b')][_0xf0ad('0xb2')]}});})[_0xf0ad('0x26')](function(_0x3df820){socket[_0xf0ad('0xbe')](_0xf0ad('0xbf'),{'id':Number(_0x4d89e2[_0xf0ad('0xad')]['id']),'tags':_0x3df820||[]});return{'id':Number(_0x4d89e2[_0xf0ad('0xad')]['id']),'tags':_0x3df820||[]};});}})['then'](respondWithResult(_0x274b67,null))[_0xf0ad('0xaa')](handleError(_0x274b67,null));};exports[_0xf0ad('0xc0')]=function(_0x5c1dc3,_0x337013,_0x172719){return db[_0xf0ad('0x32')][_0xf0ad('0x5b')]({'where':{'id':_0x5c1dc3[_0xf0ad('0xad')]['id']}})[_0xf0ad('0x26')](handleEntityNotFound(_0x337013,null))[_0xf0ad('0x26')](function(_0x3c4198){if(_0x3c4198){return _0x3c4198[_0xf0ad('0xc0')](_0x5c1dc3['query'][_0xf0ad('0xb2')]);}})[_0xf0ad('0x26')](respondWithStatusCode(_0x337013,null))['catch'](handleError(_0x337013,null));};exports[_0xf0ad('0xc1')]=function(_0x360f99,_0x1b854b){var _0x2080a1=moment()[_0xf0ad('0xc2')]()[_0xf0ad('0x91')]();var _0x1b2679=path[_0xf0ad('0xc3')](config[_0xf0ad('0xc4')],_0xf0ad('0xc5'),_0xf0ad('0xc6'),_0xf0ad('0xc7'));var _0x516907=path[_0xf0ad('0xc3')](config[_0xf0ad('0xc4')],_0xf0ad('0xc5'),_0xf0ad('0xc6'),_0xf0ad('0xc8'));var _0x358358=path[_0xf0ad('0xc3')](_0x1b2679,_0x2080a1);var _0xb7c2be=util['format'](_0xf0ad('0xc9'),_0x360f99[_0xf0ad('0xad')]['id'],_0x2080a1);var _0xe5282=path['join'](_0x1b2679,_0xb7c2be);var _0x23c922=[];_0x23c922['push']({'model':db[_0xf0ad('0xca')],'as':_0xf0ad('0xca'),'attributes':['id','fullname'],'raw':!![]});_0x23c922[_0xf0ad('0xa7')]({'model':db[_0xf0ad('0xcb')],'as':_0xf0ad('0x61'),'attributes':['id',_0xf0ad('0xcc'),_0xf0ad('0xcd')],'raw':!![]});var _0x69059=[{'model':db['SmsMessage'],'as':_0xf0ad('0xce'),'attributes':['id',_0xf0ad('0x6b'),'createdAt',_0xf0ad('0xcf'),_0xf0ad('0xd0'),_0xf0ad('0x79')],'include':_0x23c922}];_0x69059[_0xf0ad('0xa7')]({'model':db[_0xf0ad('0xd1')],'as':_0xf0ad('0xd2'),'attributes':['id','name']});_0x69059[_0xf0ad('0xa7')]({'model':db[_0xf0ad('0xca')],'as':_0xf0ad('0xd3'),'attributes':['id',_0xf0ad('0xd4')]});return db[_0xf0ad('0x32')][_0xf0ad('0x5b')]({'where':{'id':_0x360f99[_0xf0ad('0xad')]['id']},'include':_0x69059})[_0xf0ad('0x26')](handleEntityNotFound(_0x1b854b,null))['then'](function(_0x21a748){if(_0x21a748){var _0x463de9=_0x21a748[_0xf0ad('0xd5')]({'plain':!![]});fs[_0xf0ad('0xd6')](_0x358358);var _0x3811ee={'format':'A4','border':'10px','header':{'height':_0xf0ad('0xd7'),'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
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'}},'footer':{'height':_0xf0ad('0xd8'),'contents':{'default':util[_0xf0ad('0xb6')](_0xf0ad('0xd9'),util['format'](_0xf0ad('0xda'),_0xf0ad('0xdb'),_0x463de9['id']),moment()[_0xf0ad('0xb6')](_0xf0ad('0xdc'))['toString']())}}};var _0x4e5bd1={'channel':_0xf0ad('0xdb'),'account':_0x463de9[_0xf0ad('0xd2')]['name'],'agent':_0x463de9['Owner']?_0x463de9['Owner'][_0xf0ad('0xd4')]:_0xf0ad('0xdd'),'createdAt':moment(_0x463de9['createdAt'])[_0xf0ad('0xb6')](_0xf0ad('0xb7'))[_0xf0ad('0x91')](),'closedAt':_0x463de9[_0xf0ad('0xde')]?moment(_0x463de9[_0xf0ad('0xdf')])['format'](_0xf0ad('0xb7'))[_0xf0ad('0x91')]():'','disposition':_0x463de9[_0xf0ad('0xe0')],'messages':_(_0x463de9['Messages'])[_0xf0ad('0x7e')]({'secret':![]})['map'](function(_0x456af9){return{'date':moment(_0x456af9['createdAt'])[_0xf0ad('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x456af9[_0xf0ad('0xcf')]===_0xf0ad('0xe1')?_0x456af9[_0xf0ad('0xca')]?_0x456af9[_0xf0ad('0xca')]['fullname']:_0xf0ad('0xe2'):_0x456af9[_0xf0ad('0x61')][_0xf0ad('0xcc')]+(_0x456af9[_0xf0ad('0x61')][_0xf0ad('0xcd')]?'\x20'+_0x456af9['Contact'][_0xf0ad('0xcd')]:''),'body':_0x456af9['body'],'direction':_0x456af9['direction']==='out'?'A':'C','secret':_0x456af9[_0xf0ad('0xd0')],'read':_0x456af9['read']};})[_0xf0ad('0x5d')]()};return ejs['renderFile'](path[_0xf0ad('0xc3')](config['root'],_0xf0ad('0xc5'),_0xf0ad('0xe3'),_0xf0ad('0xe4')),{'interaction':_0x4e5bd1})[_0xf0ad('0x26')](function(_0x5c417f){return new BPromise(function(_0x38c776,_0x859457){pdf[_0xf0ad('0xac')](_0x5c417f,_0x3811ee)[_0xf0ad('0xe5')](path[_0xf0ad('0xc3')](_0x358358,_0xf0ad('0xe6')+_0x463de9['id']+'-'+_0x2080a1+_0xf0ad('0xe7')),function(_0x4cd031,_0x475ff8){if(_0x4cd031)return _0x859457(_0x4cd031);_0x38c776(_0x475ff8);});});})[_0xf0ad('0x26')](function(){return new BPromise(function(_0x1b3efa,_0x3ea3be){zipdir(_0x358358,{'saveTo':_0xe5282},function(_0x4b79a8,_0x1403ff){if(_0x4b79a8)return _0x3ea3be(_0x4b79a8);return _0x1b3efa(_0x1403ff);});})[_0xf0ad('0x26')](function(){return new BPromise(function(_0xc22d7a,_0x50e80d){rimraf(_0x358358,function(_0xaddc5a){if(_0xaddc5a)_0x50e80d(_0xaddc5a);return _0xc22d7a();});});})['then'](function(){return _0x1b854b['download'](_0xe5282,_0xb7c2be,function(_0x58d102){if(_0x58d102){console[_0xf0ad('0xe8')](_0xf0ad('0xe9'),_0x58d102);}else{fs[_0xf0ad('0xea')](_0xe5282);}});});});}else{return _0x1b854b[_0xf0ad('0x1b')](0xc8);}})[_0xf0ad('0xaa')](handleError(_0x1b854b,null));}; \ No newline at end of file +var _0xda2d=['get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
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','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\x0a\x20\x20\x20\x20\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%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\x0a\x20\x20\x20\x20\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{{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\x0a\x20\x20\x20\x20\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%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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','Messages','out','System','direction','renderFile','views','toFile','transcript-','.pdf','log','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','./smsInteraction.socket','register','status','end','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','map','fullname','TagIds','Tags','then','catch','index','SmsInteraction','fieldName','type','key','query','keys','filters','model','fields','attributes','length','order','sort','select','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','split','forEach','union','User','UserId','text','start','body','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','toString','groupBy','SmsInteractionId','push','all','includeAll','include','options','create','params','describe','addMessage','SmsMessage','ids','getMessages','findOne','rawAttributes','intersection','hasOwnProperty','nolimit','pick','format','findAll','rows','addTags','setTags','omit','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','attachments','join','CmContact','firstName','lastName','secret','SmsAccount','Account','Owner'];(function(_0x212b4d,_0x5a173e){var _0x2d64ab=function(_0x11e0aa){while(--_0x11e0aa){_0x212b4d['push'](_0x212b4d['shift']());}};_0x2d64ab(++_0x5a173e);}(_0xda2d,0x102));var _0xdda2=function(_0x11a43c,_0x3496c5){_0x11a43c=_0x11a43c-0x0;var _0x5bfb14=_0xda2d[_0x11a43c];return _0x5bfb14;};'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);function respondWithStatusCode(_0x3490f1,_0x4df902){_0x4df902=_0x4df902||0xcc;return function(_0x79c6d4){if(_0x79c6d4){return _0x3490f1['sendStatus'](_0x4df902);}return _0x3490f1[_0xdda2('0x1e')](_0x4df902)[_0xdda2('0x1f')]();};}function respondWithResult(_0x3553d5,_0x457764){_0x457764=_0x457764||0xc8;return function(_0x1922b1){if(_0x1922b1){return _0x3553d5['status'](_0x457764)['json'](_0x1922b1);}};}function respondWithFilteredResult(_0x43f67b,_0x518c6d){return function(_0x1a5192){if(_0x1a5192){var _0x1a3b35=_0x1a5192[_0xdda2('0x20')],_0x335fb5=_0x518c6d[_0xdda2('0x21')],_0x2b6ee8=_0x518c6d[_0xdda2('0x21')]+_0x518c6d[_0xdda2('0x22')],_0x8d44b7;if(_0x2b6ee8>=_0x1a3b35){_0x2b6ee8=_0x1a3b35;_0x8d44b7=0xc8;}else{_0x8d44b7=0xce;}_0x43f67b[_0xdda2('0x1e')](_0x8d44b7);return _0x43f67b[_0xdda2('0x23')](_0xdda2('0x24'),_0x335fb5+'-'+_0x2b6ee8+'/'+_0x1a3b35)['json'](_0x1a5192);}return null;};}function patchUpdates(_0x41fe7d){return function(_0x5dfce7){try{jsonpatch[_0xdda2('0x25')](_0x5dfce7,_0x41fe7d,!![]);}catch(_0x1a4db4){return BPromise[_0xdda2('0x26')](_0x1a4db4);}return _0x5dfce7['save']();};}function saveUpdates(_0x347ee6,_0x5a9bb8){return function(_0x425489){if(_0x425489){return _0x425489[_0xdda2('0x27')](_0x347ee6)['then'](function(_0x144f1e){return _0x144f1e;});}return null;};}function removeEntity(_0xfda248,_0x2528d7){return function(_0x13b0f3){if(_0x13b0f3){return _0x13b0f3[_0xdda2('0x28')]()['then'](function(){_0xfda248[_0xdda2('0x1e')](0xcc)[_0xdda2('0x1f')]();});}};}function handleEntityNotFound(_0x2391a5,_0x31d48b){return function(_0x5436d1){if(!_0x5436d1){_0x2391a5['sendStatus'](0x194);}return _0x5436d1;};}function handleError(_0x28da54,_0x4567e7){_0x4567e7=_0x4567e7||0x1f4;return function(_0x2e8591){logger['error'](_0x2e8591[_0xdda2('0x29')]);if(_0x2e8591[_0xdda2('0x2a')]){delete _0x2e8591[_0xdda2('0x2a')];}_0x28da54[_0xdda2('0x1e')](_0x4567e7)[_0xdda2('0x2b')](_0x2e8591);};}function getInteractionUsers(_0x91b41a,_0x4bb8a4){return new BPromise(function(_0x24c37d,_0x255bbc){try{if(_0x4bb8a4[_0x91b41a['id']]){_0x91b41a['Users']=_[_0xdda2('0x2c')](_0x4bb8a4[_0x91b41a['id']],function(_0x2cfaca){return{'id':_0x2cfaca['id'],'fullname':_0x2cfaca[_0xdda2('0x2d')]};});}}catch(_0x15e511){_0x255bbc(_0x15e511);}_0x24c37d(_0x91b41a);});}function getInteractionTags(_0x5540e5,_0x129eba){return new BPromise(function(_0x5e107f,_0x4b19b7){try{if(_0x5540e5[_0xdda2('0x2e')]){_0x5540e5['Tags']=[];_0x5540e5[_0xdda2('0x2e')]['split'](',')['forEach'](function(_0x510b7b){_0x5540e5[_0xdda2('0x2f')]['push'](_0x129eba[_0x510b7b]);});}delete _0x5540e5[_0xdda2('0x2e')];}catch(_0x508664){_0x4b19b7(_0x508664);}_0x5e107f(_0x5540e5);});}function updateSmsInteraction(_0x5cba58,_0x52a509,_0x4637c1){return new BPromise(function(_0x567717,_0xca6046){return getInteractionUsers(_0x5cba58,_0x4637c1)[_0xdda2('0x30')](function(_0x12e96d){return getInteractionTags(_0x12e96d,_0x52a509);})[_0xdda2('0x30')](function(_0x2bcfba){_0x567717(_0x2bcfba);})[_0xdda2('0x31')](function(_0x3cddbd){_0xca6046(_0x3cddbd);});});}exports[_0xdda2('0x32')]=function(_0x4a32ea,_0x461621){var _0x4212da={},_0x2f8674={},_0x3d510c={'count':0x0,'rows':[]};var _0x392373=_[_0xdda2('0x2c')](db[_0xdda2('0x33')]['rawAttributes'],function(_0x57269f){return{'name':_0x57269f[_0xdda2('0x34')],'type':_0x57269f[_0xdda2('0x35')][_0xdda2('0x36')]};});_0x2f8674['model']=_['map'](_0x392373,_0xdda2('0x2a'));_0x2f8674[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x4a32ea[_0xdda2('0x37')]);_0x2f8674[_0xdda2('0x39')]=_['intersection'](_0x2f8674[_0xdda2('0x3a')],_0x2f8674[_0xdda2('0x37')]);_0x4212da['attributes']=_['intersection'](_0x2f8674[_0xdda2('0x3a')],qs[_0xdda2('0x3b')](_0x4a32ea[_0xdda2('0x37')][_0xdda2('0x3b')]));_0x4212da[_0xdda2('0x3c')]=_0x4212da['attributes'][_0xdda2('0x3d')]?_0x4212da[_0xdda2('0x3c')]:_0x2f8674[_0xdda2('0x3a')];if(!_0x4a32ea[_0xdda2('0x37')]['hasOwnProperty']('nolimit')){_0x4212da[_0xdda2('0x22')]=qs[_0xdda2('0x22')](_0x4a32ea[_0xdda2('0x37')]['limit']);_0x4212da[_0xdda2('0x21')]=qs['offset'](_0x4a32ea[_0xdda2('0x37')]['offset']);}_0x4212da[_0xdda2('0x3e')]=qs[_0xdda2('0x3f')](_0x4a32ea[_0xdda2('0x37')][_0xdda2('0x3f')]);_0x4212da['where']=qs[_0xdda2('0x39')](_['pick'](_0x4a32ea[_0xdda2('0x37')],_0x2f8674['filters']));var _0x1d1678=[];var _0x12589b=squel[_0xdda2('0x40')]()[_0xdda2('0x41')]('id')[_0xdda2('0x41')]('name')[_0xdda2('0x41')](_0xdda2('0x42'))['from'](_0xdda2('0x43'));var _0x546847=squel[_0xdda2('0x40')]()[_0xdda2('0x41')](_0xdda2('0x44'))[_0xdda2('0x41')](_0xdda2('0x45'))[_0xdda2('0x41')](_0xdda2('0x46'))[_0xdda2('0x47')](_0xdda2('0x48'),'ui')[_0xdda2('0x49')](_0xdda2('0x4a'),'u',_0xdda2('0x4b'));var _0x7a2dbc=squel['select']()['from']('sms_interactions','i')[_0xdda2('0x49')](_0xdda2('0x4c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xdda2('0x49')](_0xdda2('0x4a'),'o',_0xdda2('0x4d'))['left_join'](_0xdda2('0x4e'),'a',_0xdda2('0x4f'))['left_join']('sms_messages','me',_0xdda2('0x50'))['left_join'](_0xdda2('0x51'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xdda2('0x49')](_0xdda2('0x43'),'t','t.id\x20=\x20it.TagId');var _0x585665=squel[_0xdda2('0x52')]();var _0x413f8a=[];var _0x375741=squel[_0xdda2('0x52')]();var _0x578a6c;if(_0x4a32ea[_0xdda2('0x37')][_0xdda2('0x53')]){_0x578a6c=as[_0xdda2('0x54')](_0x4a32ea[_0xdda2('0x37')][_0xdda2('0x53')]);var _0x55528b=_0x578a6c[_0xdda2('0x55')];for(var _0x40b610=0x0;_0x40b610<_0x578a6c['conditions'][_0xdda2('0x3d')];_0x40b610++){var _0x123c2d=_0x578a6c[_0xdda2('0x56')][_0x40b610];var _0x2c2a4a='i';var _0x161d7b=_[_0xdda2('0x57')](_0x392373,['name',_0x123c2d[_0xdda2('0x41')]]);if(!_0x161d7b){switch(_0x123c2d['field']){case _0xdda2('0x58'):if(_0x123c2d['value']==0x1){_0x7a2dbc[_0xdda2('0x59')]('`'+_0x123c2d['field']+_0xdda2('0x5a'));}else{_0x7a2dbc[_0xdda2('0x59')]('`'+_0x123c2d[_0xdda2('0x41')]+_0xdda2('0x5b'));}break;case _0xdda2('0x5c'):if(_0x123c2d[_0xdda2('0x5d')]===_0xdda2('0x5e')){if(_0x123c2d[_0xdda2('0x5f')]['split']('\x20')[_0xdda2('0x3d')]>0x1){_0x585665[_0x55528b](_0xdda2('0x60'),qs[_0xdda2('0x61')](_0x123c2d['value']),null);}else{var _0xf380b0='%'+_0x123c2d[_0xdda2('0x5f')]+'%';_0x585665[_0x55528b]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xf380b0,_0xf380b0,_0xf380b0);}}else{_0x161d7b=_[_0xdda2('0x57')](_0x392373,['name',_0xdda2('0x62')]);_0x123c2d[_0xdda2('0x41')]=_0xdda2('0x62');_0x90bb5c=as[_0xdda2('0x63')](_0x2c2a4a,_0x161d7b[_0xdda2('0x35')],_0x123c2d);_0x585665[_0x55528b](_0x90bb5c['text'],_0x90bb5c['value']['start'],_0x90bb5c[_0xdda2('0x5f')][_0xdda2('0x1f')]);}break;case'Tag':var _0x44637d=_0x123c2d[_0xdda2('0x5f')][_0xdda2('0x64')](',')['map'](function(_0x3fd76c){return Number(_0x3fd76c);});_0x44637d[_0xdda2('0x65')](function(_0x113266){_0x375741['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x113266+',%');});_0x413f8a=_[_0xdda2('0x66')](_0x413f8a,_0x44637d);break;case _0xdda2('0x67'):if(_0x123c2d[_0xdda2('0x5d')]===_0xdda2('0x5e')){_0x585665[_0x55528b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x123c2d[_0xdda2('0x5f')]+'%',null);}else{_0x161d7b=_['find'](_0x392373,['name','UserId']);_0x123c2d[_0xdda2('0x41')]=_0xdda2('0x68');_0x90bb5c=as[_0xdda2('0x63')](_0x2c2a4a,_0x161d7b[_0xdda2('0x35')],_0x123c2d);_0x585665[_0x55528b](_0x90bb5c[_0xdda2('0x69')],_0x90bb5c[_0xdda2('0x5f')][_0xdda2('0x6a')],_0x90bb5c[_0xdda2('0x5f')][_0xdda2('0x1f')]);}break;case _0xdda2('0x6b'):_0x90bb5c=as[_0xdda2('0x63')]('me',null,_0x123c2d);_0x585665[_0x55528b](_0x90bb5c['text'],_0x90bb5c[_0xdda2('0x5f')][_0xdda2('0x6a')],_0x90bb5c[_0xdda2('0x5f')][_0xdda2('0x1f')]);break;}}else{var _0x90bb5c=as[_0xdda2('0x63')](_0x2c2a4a,_0x161d7b[_0xdda2('0x35')],_0x123c2d);_0x585665[_0x55528b](_0x90bb5c['text'],_0x90bb5c[_0xdda2('0x5f')][_0xdda2('0x6a')],_0x90bb5c[_0xdda2('0x5f')][_0xdda2('0x1f')]);}}}else{var _0x44f619=_(_0x4a32ea['query'])[_0xdda2('0x38')]()[_0xdda2('0x2c')](function(_0xbc441a){return _[_0xdda2('0x6c')](_0x392373,[_0xdda2('0x2a'),_0xbc441a])?_0xbc441a:undefined;})['compact']()[_0xdda2('0x5f')]();if(!_[_0xdda2('0x6d')](_0x44f619)){_0x44f619[_0xdda2('0x65')](function(_0x4530b7){if(_0x4530b7===_0xdda2('0x6e')){_0x7a2dbc['where'](_0xdda2('0x6f'),[][_0xdda2('0x70')](_0x4a32ea[_0xdda2('0x37')][_0x4530b7]));}else if(_0x4530b7==='createdAt'){var _0x1b7b96=JSON['parse'](_0x4a32ea[_0xdda2('0x37')][_0x4530b7])[_0xdda2('0x71')];var _0x646bab=JSON['parse'](_0x4a32ea[_0xdda2('0x37')][_0x4530b7])[_0xdda2('0x72')];_0x7a2dbc['where'](_0xdda2('0x73'),_0x1b7b96,_0x646bab);}else{if(_0x4a32ea['query'][_0x4530b7]===_0xdda2('0x74')){_0x7a2dbc[_0xdda2('0x75')]('i.'+_0x4530b7+_0xdda2('0x76'));}else{_0x7a2dbc[_0xdda2('0x75')]('i.'+_0x4530b7+_0xdda2('0x77'),_0x4a32ea['query'][_0x4530b7]);}}});}if(_0x4a32ea['query'][_0xdda2('0x78')]){if(_0x4a32ea[_0xdda2('0x37')]['read']==0x1){_0x7a2dbc['having'](_0xdda2('0x79'));}else{_0x7a2dbc['having'](_0xdda2('0x7a'));}}if(_0x4a32ea[_0xdda2('0x37')]['tag']){_0x413f8a=_[_0xdda2('0x7b')](_0x4a32ea[_0xdda2('0x37')][_0xdda2('0x7c')])?_0x4a32ea[_0xdda2('0x37')][_0xdda2('0x7c')]:new Array(_0x4a32ea[_0xdda2('0x37')]['tag']);_0x413f8a[_0xdda2('0x65')](function(_0x22de37){_0x375741['or'](_0xdda2('0x7d'),'%,'+_0x22de37+',%');});}if(_0x4a32ea['query'][_0xdda2('0x7e')]){var _0x2ec405=_0x4a32ea['query']['filter'][_0xdda2('0x7f')]('\x5c','\x5c\x5c')[_0xdda2('0x7f')]('\x27\x27',_0xdda2('0x80'));if(qs['isNumeric'](_0x2ec405)){_0x585665['or']('i.id\x20LIKE\x20?',_0x2ec405+'%')['or'](_0xdda2('0x81'),_0x2ec405+'%');}else{_0x585665['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xdda2('0x61')](_0x2ec405))['or'](_0xdda2('0x82'),_0x2ec405+'%');}}}_0x7a2dbc[_0xdda2('0x75')](_0x585665);_0x7a2dbc[_0xdda2('0x83')](_0xdda2('0x84'));var _0x29006f={'type':db['Sequelize']['QueryTypes'][_0xdda2('0x85')],'raw':!![]};var _0x4eabc4=_0x7a2dbc[_0xdda2('0x86')]();_0x4eabc4[_0xdda2('0x41')](_0xdda2('0x84'));_0x4eabc4[_0xdda2('0x41')](_0xdda2('0x87'),_0xdda2('0x58'));if(_0x4212da[_0xdda2('0x3e')]){_0x4212da[_0xdda2('0x3e')][_0xdda2('0x65')](function(_0x495a28){_0x7a2dbc[_0xdda2('0x3e')]('i.'+_0x495a28[0x0],_0x495a28[0x1]===_0xdda2('0x88')?![]:!![]);});}if(!_[_0xdda2('0x6d')](_0x413f8a)){_0x7a2dbc[_0xdda2('0x59')](_0x375741);_0x4eabc4['where'](_0xdda2('0x89'),_0x413f8a);}BPromise[_0xdda2('0x8a')]()[_0xdda2('0x30')](function(){if(!_0x578a6c){if(_0x4a32ea[_0xdda2('0x37')]['SmsAccountId']||_0x4a32ea['query'][_0xdda2('0x8b')])return;_0x4eabc4[_0xdda2('0x75')](_0xdda2('0x8c'));_0x7a2dbc[_0xdda2('0x75')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}return _0x4a32ea[_0xdda2('0x8d')][_0xdda2('0x8e')]({'attributes':['id'],'raw':!![]})[_0xdda2('0x30')](function(_0x152ba3){if(_[_0xdda2('0x6d')](_0x152ba3)){_0x4eabc4[_0xdda2('0x75')](_0xdda2('0x8f'));_0x7a2dbc[_0xdda2('0x75')](_0xdda2('0x8f'));}else{_0x4eabc4[_0xdda2('0x75')](_0xdda2('0x6f'),_[_0xdda2('0x2c')](_0x152ba3,'id'));_0x7a2dbc[_0xdda2('0x75')](_0xdda2('0x6f'),_[_0xdda2('0x2c')](_0x152ba3,'id'));}});})['then'](function(){db[_0xdda2('0x90')][_0xdda2('0x37')](_0x4eabc4['toString'](),_0x29006f)['then'](function(_0x3cb641){_0x3d510c[_0xdda2('0x20')]=_0x3cb641[_0xdda2('0x3d')];if(_0x3d510c[_0xdda2('0x20')]===0x0)return[];return db[_0xdda2('0x90')][_0xdda2('0x37')](_0x12589b['toString'](),_0x29006f)[_0xdda2('0x30')](function(_0x1f3abe){_0x1d1678=_[_0xdda2('0x91')](_0x1f3abe,'id');_0x29006f=_[_0xdda2('0x92')](_0x29006f,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a32ea[_0xdda2('0x37')]['fields']){_0x4212da[_0xdda2('0x3c')][_0xdda2('0x65')](function(_0x4c8739){_0x7a2dbc[_0xdda2('0x41')]('i.'+_0x4c8739);});}else{_0x7a2dbc[_0xdda2('0x41')](_0xdda2('0x87'),_0xdda2('0x58'));_0x7a2dbc[_0xdda2('0x41')](_0xdda2('0x93'),_0xdda2('0x94'));_0x7a2dbc[_0xdda2('0x41')](_0xdda2('0x95'),_0xdda2('0x96'));_0x7a2dbc[_0xdda2('0x41')]('i.*');_0x7a2dbc[_0xdda2('0x41')](_0xdda2('0x97'),_0xdda2('0x98'));_0x7a2dbc[_0xdda2('0x41')](_0xdda2('0x99'),'Contact.lastName');_0x7a2dbc[_0xdda2('0x41')](_0xdda2('0x9a'),'Contact.email');_0x7a2dbc[_0xdda2('0x41')](_0xdda2('0x9b'),'Contact.phone');_0x7a2dbc['field'](_0xdda2('0x9c'),_0xdda2('0x9d'));_0x7a2dbc[_0xdda2('0x41')](_0xdda2('0x9e'),_0xdda2('0x9f'));_0x7a2dbc[_0xdda2('0x41')]('o.fullname',_0xdda2('0xa0'));_0x7a2dbc[_0xdda2('0x41')]('o.internal',_0xdda2('0xa1'));_0x7a2dbc[_0xdda2('0x41')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xdda2('0x2e'));}_0x7a2dbc[_0xdda2('0x22')](_0x4212da[_0xdda2('0x22')]);_0x7a2dbc['offset'](_0x4212da[_0xdda2('0x21')]);return db['sequelize'][_0xdda2('0x37')](_0x7a2dbc[_0xdda2('0xa2')](),_0x29006f);})[_0xdda2('0x30')](function(_0x17852d){_0x546847['where']('ui.SmsInteractionId\x20IN\x20?',_[_0xdda2('0x2c')](_0x17852d,'id'));return db[_0xdda2('0x90')]['query'](_0x546847[_0xdda2('0xa2')](),_0x29006f)[_0xdda2('0x30')](function(_0x130108){var _0x152961=_[_0xdda2('0xa3')](_0x130108,_0xdda2('0xa4'));var _0x2d5ec4=[];_0x17852d[_0xdda2('0x65')](function(_0x3046c1){_0x2d5ec4[_0xdda2('0xa5')](updateSmsInteraction(_0x3046c1,_0x1d1678,_0x152961));});return BPromise[_0xdda2('0xa6')](_0x2d5ec4);});});})[_0xdda2('0x30')](function(_0x528185){_0x3d510c['rows']=_0x528185;return _0x3d510c;})['then'](respondWithFilteredResult(_0x461621,_0x4212da));})[_0xdda2('0x31')](handleError(_0x461621,null));};exports['show']=function(_0x2910b0,_0x323af8){var _0x2f18a0={'raw':![],'where':{'id':_0x2910b0['params']['id']}},_0xe797aa={};_0xe797aa[_0xdda2('0x3a')]=_[_0xdda2('0x38')](db[_0xdda2('0x33')]['rawAttributes']);_0xe797aa[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x2910b0[_0xdda2('0x37')]);_0xe797aa['filters']=_['intersection'](_0xe797aa[_0xdda2('0x3a')],_0xe797aa[_0xdda2('0x37')]);_0x2f18a0[_0xdda2('0x3c')]=_['intersection'](_0xe797aa[_0xdda2('0x3a')],qs[_0xdda2('0x3b')](_0x2910b0[_0xdda2('0x37')][_0xdda2('0x3b')]));_0x2f18a0[_0xdda2('0x3c')]=_0x2f18a0[_0xdda2('0x3c')][_0xdda2('0x3d')]?_0x2f18a0['attributes']:_0xe797aa[_0xdda2('0x3a')];if(_0x2910b0[_0xdda2('0x37')][_0xdda2('0xa7')]){_0x2f18a0[_0xdda2('0xa8')]=[{'all':!![]}];}_0x2f18a0=_['merge']({},_0x2f18a0,_0x2910b0[_0xdda2('0xa9')]);return db[_0xdda2('0x33')][_0xdda2('0x57')](_0x2f18a0)[_0xdda2('0x30')](handleEntityNotFound(_0x323af8,null))['then'](respondWithResult(_0x323af8,null))['catch'](handleError(_0x323af8,null));};exports['create']=function(_0x3b2e7c,_0x2ab7f9){return db[_0xdda2('0x33')][_0xdda2('0xaa')](_0x3b2e7c[_0xdda2('0x6b')],{})[_0xdda2('0x30')](respondWithResult(_0x2ab7f9,0xc9))['catch'](handleError(_0x2ab7f9,null));};exports[_0xdda2('0x27')]=function(_0x2d5781,_0xed5a58){if(_0x2d5781[_0xdda2('0x6b')]['id']){delete _0x2d5781[_0xdda2('0x6b')]['id'];}return db[_0xdda2('0x33')][_0xdda2('0x57')]({'where':{'id':_0x2d5781[_0xdda2('0xab')]['id']}})['then'](handleEntityNotFound(_0xed5a58,null))[_0xdda2('0x30')](saveUpdates(_0x2d5781['body'],null))[_0xdda2('0x30')](respondWithResult(_0xed5a58,null))['catch'](handleError(_0xed5a58,null));};exports[_0xdda2('0x28')]=function(_0x4b9243,_0x40a05c){return db[_0xdda2('0x33')][_0xdda2('0x57')]({'where':{'id':_0x4b9243[_0xdda2('0xab')]['id']}})[_0xdda2('0x30')](handleEntityNotFound(_0x40a05c,null))[_0xdda2('0x30')](removeEntity(_0x40a05c,null))[_0xdda2('0x31')](handleError(_0x40a05c,null));};exports[_0xdda2('0xac')]=function(_0x947086,_0x49db3b){return db[_0xdda2('0x33')][_0xdda2('0xac')]()['then'](respondWithResult(_0x49db3b,null))[_0xdda2('0x31')](handleError(_0x49db3b,null));};exports[_0xdda2('0xad')]=function(_0x2f3807,_0x5600da,_0x1702ae){return db[_0xdda2('0xae')][_0xdda2('0x57')]({'where':{'id':_0x2f3807[_0xdda2('0xab')]['id']}})[_0xdda2('0x30')](handleEntityNotFound(_0x5600da,null))[_0xdda2('0x30')](function(_0x4124a5){if(_0x4124a5){return _0x4124a5[_0xdda2('0xad')](_0x2f3807[_0xdda2('0x6b')][_0xdda2('0xaf')],_['omit'](_0x2f3807[_0xdda2('0x6b')],[_0xdda2('0xaf'),'id'])||{});}})[_0xdda2('0x30')](respondWithResult(_0x5600da,null))[_0xdda2('0x31')](handleError(_0x5600da,null));};exports[_0xdda2('0xb0')]=function(_0x4c540d,_0x320cf1,_0xc7e1e3){var _0xdd343d={'raw':![],'where':{}};var _0x56cd13={};var _0x19c36d={'count':0x0,'rows':[]};return db[_0xdda2('0x33')][_0xdda2('0xb1')]({'where':{'id':_0x4c540d['params']['id']}})[_0xdda2('0x30')](handleEntityNotFound(_0x320cf1,null))['then'](function(_0x579fc9){if(_0x579fc9){_0x56cd13[_0xdda2('0x3a')]=_[_0xdda2('0x38')](db[_0xdda2('0xae')][_0xdda2('0xb2')]);_0x56cd13[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x4c540d[_0xdda2('0x37')]);_0x56cd13['filters']=_['intersection'](_0x56cd13[_0xdda2('0x3a')],_0x56cd13[_0xdda2('0x37')]);_0xdd343d[_0xdda2('0x3c')]=_[_0xdda2('0xb3')](_0x56cd13[_0xdda2('0x3a')],qs['fields'](_0x4c540d[_0xdda2('0x37')][_0xdda2('0x3b')]));_0xdd343d[_0xdda2('0x3c')]=_0xdd343d[_0xdda2('0x3c')][_0xdda2('0x3d')]?_0xdd343d[_0xdda2('0x3c')]:_0x56cd13[_0xdda2('0x3a')];if(!_0x4c540d[_0xdda2('0x37')][_0xdda2('0xb4')](_0xdda2('0xb5'))){_0xdd343d[_0xdda2('0x22')]=qs[_0xdda2('0x22')](_0x4c540d[_0xdda2('0x37')][_0xdda2('0x22')]);_0xdd343d[_0xdda2('0x21')]=qs[_0xdda2('0x21')](_0x4c540d['query'][_0xdda2('0x21')]);}_0xdd343d['order']=qs[_0xdda2('0x3f')](_0x4c540d[_0xdda2('0x37')][_0xdda2('0x3f')]);_0xdd343d['where']=qs[_0xdda2('0x39')](_[_0xdda2('0xb6')](_0x4c540d[_0xdda2('0x37')],_0x56cd13['filters']));_0xdd343d[_0xdda2('0x75')][_0xdda2('0xa4')]=_0x579fc9['id'];if(_0x4c540d[_0xdda2('0x37')]['filter']){_0xdd343d['where']=_[_0xdda2('0x92')](_0xdd343d['where'],{'$or':_[_0xdda2('0x2c')](_0xdd343d[_0xdda2('0x3c')],function(_0x23b9bd){var _0x182570={};_0x182570[_0x23b9bd]={'$like':'%'+_0x4c540d['query'][_0xdda2('0x7e')]+'%'};return _0x182570;})});}if(_0x4c540d['query']['$gte']){var _0x50d63b=_0x4c540d['query'][_0xdda2('0x71')]['split'](',');var _0x155dc3={};_0x155dc3[_0x50d63b[0x0]]={'$gte':moment(_0x50d63b[0x1])[_0xdda2('0xb7')]('YYYY-MM-DD\x20HH:mm:ss')};_0xdd343d['where']=_[_0xdda2('0x92')](_0xdd343d[_0xdda2('0x75')],_0x155dc3);}_0xdd343d=_[_0xdda2('0x92')]({},_0xdd343d,_0x4c540d[_0xdda2('0xa9')]);return db['SmsMessage']['count']({'where':_0xdd343d[_0xdda2('0x75')]})[_0xdda2('0x30')](function(_0xaa5d94){_0x19c36d[_0xdda2('0x20')]=_0xaa5d94;if(_0x4c540d['query'][_0xdda2('0xa7')]){_0xdd343d[_0xdda2('0xa8')]=[{'all':!![]}];}return db[_0xdda2('0xae')][_0xdda2('0xb8')](_0xdd343d);})[_0xdda2('0x30')](function(_0x1fdc68){_0x19c36d[_0xdda2('0xb9')]=_0x1fdc68;return _0x19c36d;});}})[_0xdda2('0x30')](respondWithFilteredResult(_0x320cf1,_0xdd343d))[_0xdda2('0x31')](handleError(_0x320cf1,null));};exports[_0xdda2('0xba')]=function(_0xb49be,_0x26144b,_0x22f11c){return db[_0xdda2('0x33')][_0xdda2('0x57')]({'where':{'id':_0xb49be[_0xdda2('0xab')]['id']}})['then'](handleEntityNotFound(_0x26144b,null))[_0xdda2('0x30')](function(_0x1e5460){if(_0x1e5460){return _0x1e5460[_0xdda2('0xbb')](_0xb49be[_0xdda2('0x6b')][_0xdda2('0xaf')],_[_0xdda2('0xbc')](_0xb49be[_0xdda2('0x6b')],[_0xdda2('0xaf'),'id'])||{})[_0xdda2('0xbd')](function(){return db[_0xdda2('0xbe')][_0xdda2('0xb8')]({'attributes':['id',_0xdda2('0x2a'),_0xdda2('0x42')],'where':{'id':_0xb49be[_0xdda2('0x6b')][_0xdda2('0xaf')]}});})['then'](function(_0x17c084){socket[_0xdda2('0xbf')](_0xdda2('0xc0'),{'id':Number(_0xb49be[_0xdda2('0xab')]['id']),'tags':_0x17c084||[]});return{'id':Number(_0xb49be[_0xdda2('0xab')]['id']),'tags':_0x17c084||[]};});}})[_0xdda2('0x30')](respondWithResult(_0x26144b,null))[_0xdda2('0x31')](handleError(_0x26144b,null));};exports[_0xdda2('0xc1')]=function(_0x36c240,_0x324f36,_0x57dd62){return db[_0xdda2('0x33')]['find']({'where':{'id':_0x36c240['params']['id']}})[_0xdda2('0x30')](handleEntityNotFound(_0x324f36,null))[_0xdda2('0x30')](function(_0x28682b){if(_0x28682b){return _0x28682b[_0xdda2('0xc1')](_0x36c240[_0xdda2('0x37')]['ids']);}})[_0xdda2('0x30')](respondWithStatusCode(_0x324f36,null))[_0xdda2('0x31')](handleError(_0x324f36,null));};exports[_0xdda2('0xc2')]=function(_0x297bd1,_0xe6ffc9){var _0x1e7804=moment()[_0xdda2('0xc3')]()[_0xdda2('0xa2')]();var _0x577f44=path['join'](config[_0xdda2('0xc4')],_0xdda2('0xc5'),_0xdda2('0xc6'),'tmp');var _0x5980e3=path['join'](config[_0xdda2('0xc4')],_0xdda2('0xc5'),_0xdda2('0xc6'),_0xdda2('0xc7'));var _0x493b57=path[_0xdda2('0xc8')](_0x577f44,_0x1e7804);var _0x4b84f5=util[_0xdda2('0xb7')]('transcript-%d-%s.zip',_0x297bd1[_0xdda2('0xab')]['id'],_0x1e7804);var _0x223c52=path[_0xdda2('0xc8')](_0x577f44,_0x4b84f5);var _0x4d0e51=[];_0x4d0e51[_0xdda2('0xa5')]({'model':db[_0xdda2('0x67')],'as':_0xdda2('0x67'),'attributes':['id','fullname'],'raw':!![]});_0x4d0e51[_0xdda2('0xa5')]({'model':db[_0xdda2('0xc9')],'as':'Contact','attributes':['id',_0xdda2('0xca'),_0xdda2('0xcb')],'raw':!![]});var _0x48e6e6=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0xdda2('0x6b'),'createdAt','direction',_0xdda2('0xcc'),_0xdda2('0x78')],'include':_0x4d0e51}];_0x48e6e6[_0xdda2('0xa5')]({'model':db[_0xdda2('0xcd')],'as':_0xdda2('0xce'),'attributes':['id',_0xdda2('0x2a')]});_0x48e6e6['push']({'model':db['User'],'as':_0xdda2('0xcf'),'attributes':['id','fullname']});return db[_0xdda2('0x33')][_0xdda2('0x57')]({'where':{'id':_0x297bd1[_0xdda2('0xab')]['id']},'include':_0x48e6e6})[_0xdda2('0x30')](handleEntityNotFound(_0xe6ffc9,null))[_0xdda2('0x30')](function(_0x3b4600){if(_0x3b4600){var _0x546551=_0x3b4600[_0xdda2('0xd0')]({'plain':!![]});fs['mkdirSync'](_0x493b57);var _0x28faa7={'format':'A4','border':_0xdda2('0xd1'),'header':{'height':_0xdda2('0xd2'),'contents':{'first':_0xdda2('0xd3')}},'footer':{'height':_0xdda2('0xd4'),'contents':{'default':util[_0xdda2('0xb7')](_0xdda2('0xd5'),util[_0xdda2('0xb7')](_0xdda2('0xd6'),_0xdda2('0xd7'),_0x546551['id']),moment()[_0xdda2('0xb7')](_0xdda2('0xd8'))[_0xdda2('0xa2')]())}}};var _0x23add5={'channel':_0xdda2('0xd7'),'account':_0x546551[_0xdda2('0xce')]['name'],'agent':_0x546551[_0xdda2('0xcf')]?_0x546551[_0xdda2('0xcf')][_0xdda2('0x2d')]:_0xdda2('0xd9'),'createdAt':moment(_0x546551[_0xdda2('0xda')])[_0xdda2('0xb7')](_0xdda2('0xdb'))[_0xdda2('0xa2')](),'closedAt':_0x546551[_0xdda2('0xdc')]?moment(_0x546551[_0xdda2('0xdd')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x546551[_0xdda2('0xde')],'messages':_(_0x546551[_0xdda2('0xdf')])['filter']({'secret':![]})[_0xdda2('0x2c')](function(_0x241373){return{'date':moment(_0x241373[_0xdda2('0xda')])[_0xdda2('0xb7')](_0xdda2('0xdb'))[_0xdda2('0xa2')](),'sender':_0x241373['direction']===_0xdda2('0xe0')?_0x241373['User']?_0x241373[_0xdda2('0x67')][_0xdda2('0x2d')]:_0xdda2('0xe1'):_0x241373['Contact'][_0xdda2('0xca')]+(_0x241373[_0xdda2('0x5c')][_0xdda2('0xcb')]?'\x20'+_0x241373[_0xdda2('0x5c')]['lastName']:''),'body':_0x241373[_0xdda2('0x6b')],'direction':_0x241373[_0xdda2('0xe2')]===_0xdda2('0xe0')?'A':'C','secret':_0x241373[_0xdda2('0xcc')],'read':_0x241373[_0xdda2('0x78')]};})['value']()};return ejs[_0xdda2('0xe3')](path['join'](config[_0xdda2('0xc4')],_0xdda2('0xc5'),_0xdda2('0xe4'),'downloadInteraction.html'),{'interaction':_0x23add5})[_0xdda2('0x30')](function(_0x3e8409){return new BPromise(function(_0x36dbd3,_0x1894fc){pdf[_0xdda2('0xaa')](_0x3e8409,_0x28faa7)[_0xdda2('0xe5')](path[_0xdda2('0xc8')](_0x493b57,_0xdda2('0xe6')+_0x546551['id']+'-'+_0x1e7804+_0xdda2('0xe7')),function(_0x2c8031,_0x20b0cc){if(_0x2c8031)return _0x1894fc(_0x2c8031);_0x36dbd3(_0x20b0cc);});});})[_0xdda2('0x30')](function(){return new BPromise(function(_0x3ed7fa,_0x1d2039){zipdir(_0x493b57,{'saveTo':_0x223c52},function(_0xee0164,_0x58fa2a){if(_0xee0164)return _0x1d2039(_0xee0164);return _0x3ed7fa(_0x58fa2a);});})[_0xdda2('0x30')](function(){return new BPromise(function(_0x5b66f7,_0x32f17d){rimraf(_0x493b57,function(_0xbe4ca){if(_0xbe4ca)_0x32f17d(_0xbe4ca);return _0x5b66f7();});});})['then'](function(){return _0xe6ffc9[_0xdda2('0xc2')](_0x223c52,_0x4b84f5,function(_0x209f33){if(_0x209f33){console[_0xdda2('0xe8')]('err',_0x209f33);}else{fs['unlinkSync'](_0x223c52);}});});});}else{return _0xe6ffc9['sendStatus'](0xc8);}})[_0xdda2('0x31')](handleError(_0xe6ffc9,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 58ac66c..39323dd 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 _0x56e6=['../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','exports','events'];(function(_0x10297b,_0x5d8d6d){var _0x28ac04=function(_0x2ff599){while(--_0x2ff599){_0x10297b['push'](_0x10297b['shift']());}};_0x28ac04(++_0x5d8d6d);}(_0x56e6,0x6b));var _0x656e=function(_0x11a1fb,_0x46da00){_0x11a1fb=_0x11a1fb-0x0;var _0x457907=_0x56e6[_0x11a1fb];return _0x457907;};'use strict';var EventEmitter=require(_0x656e('0x0'));var SmsInteraction=require(_0x656e('0x1'))['db'][_0x656e('0x2')];var SmsMessage=require(_0x656e('0x1'))['db'][_0x656e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x656e('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x656e('0x5'),'afterDestroy':_0x656e('0x6')};function emitEvent(_0xe7d540){return function(_0x162ffe,_0x123fd4,_0x3fef98){_0x162ffe[_0x656e('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x35d629){_0x162ffe[_0x656e('0x8')](_0x656e('0x9'),_0x35d629[_0x656e('0xa')](function(_0x381a05){return{'id':_0x381a05['id']};}));return SmsMessage[_0x656e('0xb')]({'where':{'SmsInteractionId':_0x162ffe['id'],'direction':'in','read':![]},'raw':!![]});})[_0x656e('0xc')](function(_0x202205){_0x162ffe[_0x656e('0x8')](_0x656e('0xd'),_0x202205[_0x656e('0xe')]);SmsInteractionEvents[_0x656e('0xf')](_0xe7d540+':'+_0x162ffe['id'],_0x162ffe);SmsInteractionEvents[_0x656e('0xf')](_0xe7d540,_0x162ffe);_0x3fef98(null);})[_0x656e('0x10')](_0x3fef98(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x656e('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x89c3=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','then','Users','map','findAll'];(function(_0x39d531,_0xa157c7){var _0x4de72b=function(_0x4e28a2){while(--_0x4e28a2){_0x39d531['push'](_0x39d531['shift']());}};_0x4de72b(++_0xa157c7);}(_0x89c3,0xff));var _0x389c=function(_0x1248ab,_0x4f690b){_0x1248ab=_0x1248ab-0x0;var _0xbb8589=_0x89c3[_0x1248ab];return _0xbb8589;};'use strict';var EventEmitter=require(_0x389c('0x0'));var SmsInteraction=require(_0x389c('0x1'))['db'][_0x389c('0x2')];var SmsMessage=require(_0x389c('0x1'))['db'][_0x389c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x389c('0x4')](0x0);var events={'afterCreate':_0x389c('0x5'),'afterUpdate':_0x389c('0x6'),'afterDestroy':'remove'};function emitEvent(_0x3742ad){return function(_0x5d2bcb,_0x283ff9,_0x4bece6){_0x5d2bcb['getUsers']({'attributes':['id'],'raw':!![]})[_0x389c('0x7')](function(_0x4a83ab){_0x5d2bcb['setDataValue'](_0x389c('0x8'),_0x4a83ab[_0x389c('0x9')](function(_0x28d373){return{'id':_0x28d373['id']};}));return SmsMessage[_0x389c('0xa')]({'where':{'SmsInteractionId':_0x5d2bcb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x389c('0x7')](function(_0x1c574b){_0x5d2bcb[_0x389c('0xb')](_0x389c('0xc'),_0x1c574b[_0x389c('0xd')]);SmsInteractionEvents['emit'](_0x3742ad+':'+_0x5d2bcb['id'],_0x5d2bcb);SmsInteractionEvents[_0x389c('0xe')](_0x3742ad,_0x5d2bcb);_0x4bece6(null);})[_0x389c('0xf')](_0x4bece6(null));};}for(var e in events){if(events[_0x389c('0x10')](e)){var event=events[e];SmsInteraction[_0x389c('0x11')](e,emitEvent(event));}}module[_0x389c('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 66c7fc9..1639e44 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 _0x7135=['closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','changed'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7135,0x199));var _0x5713=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7135[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5713('0x0'));var logger=require(_0x5713('0x1'))('api');var moment=require(_0x5713('0x2'));var BPromise=require(_0x5713('0x3'));var rp=require(_0x5713('0x4'));var fs=require('fs');var path=require(_0x5713('0x5'));var rimraf=require(_0x5713('0x6'));var config=require(_0x5713('0x7'));var attributes=require(_0x5713('0x8'));module['exports']=function(_0x17c055,_0x152e4b){return _0x17c055[_0x5713('0x9')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1bd6a5,_0x274d9d,_0x51ca8a){if(_0x1bd6a5[_0x5713('0xa')](_0x5713('0xb'))){_0x1bd6a5['closedAt']=moment()[_0x5713('0xc')](_0x5713('0xd'));}_0x51ca8a(null,_0x1bd6a5);}}});}; \ No newline at end of file +var _0x7a29=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a29,0x111));var _0x97a2=function(_0x59e6d5,_0x17ff81){_0x59e6d5=_0x59e6d5-0x0;var _0x908ad5=_0x7a29[_0x59e6d5];return _0x908ad5;};'use strict';var _=require(_0x97a2('0x0'));var util=require(_0x97a2('0x1'));var logger=require(_0x97a2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x97a2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97a2('0x4'));var rimraf=require(_0x97a2('0x5'));var config=require(_0x97a2('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x97a2('0x7')]=function(_0x193bf7,_0x39f20f){return _0x193bf7[_0x97a2('0x8')](_0x97a2('0x9'),attributes,{'tableName':_0x97a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x167083,_0x8c096f,_0x3f7f91){if(_0x167083[_0x97a2('0xb')](_0x97a2('0xc'))){_0x167083[_0x97a2('0xd')]=moment()[_0x97a2('0xe')](_0x97a2('0xf'));}_0x3f7f91(null,_0x167083);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 6855f41..3ba94e3 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 _0x8804=['options','raw','where','attributes','limit','debug','stringify','catch','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','UpdateSmsInteraction','body'];(function(_0x28a99d,_0x1d5f73){var _0x5e13a0=function(_0x3b59bc){while(--_0x3b59bc){_0x28a99d['push'](_0x28a99d['shift']());}};_0x5e13a0(++_0x1d5f73);}(_0x8804,0x104));var _0x4880=function(_0x634167,_0x134cdb){_0x634167=_0x634167-0x0;var _0x29fb37=_0x8804[_0x634167];return _0x29fb37;};'use strict';var _=require('lodash');var util=require(_0x4880('0x0'));var moment=require(_0x4880('0x1'));var BPromise=require(_0x4880('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4880('0x3'));var db=require(_0x4880('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4880('0x5'))(_0x4880('0x6'));var config=require(_0x4880('0x7'));var jayson=require(_0x4880('0x8'));var client=jayson[_0x4880('0x9')][_0x4880('0xa')]({'port':0x232a});config['redis']=_[_0x4880('0xb')](config[_0x4880('0xc')],{'host':_0x4880('0xd'),'port':0x18eb});var socket=require(_0x4880('0xe'))(new Redis(config[_0x4880('0xc')]));require(_0x4880('0xf'))['register'](socket);function respondWithRpcPromise(_0x559c4b,_0x21528f,_0x4d54ee){return new BPromise(function(_0x3276de,_0x16dcdd){return client[_0x4880('0x10')](_0x559c4b,_0x4d54ee)[_0x4880('0x11')](function(_0x5affd4){logger[_0x4880('0x12')](_0x4880('0x13'),_0x21528f,_0x4880('0x14'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x21528f,_0x4880('0x14'),JSON['stringify'](_0x5affd4));if(_0x5affd4[_0x4880('0x15')]){if(_0x5affd4[_0x4880('0x15')][_0x4880('0x16')]===0x1f4){logger[_0x4880('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x21528f,_0x5affd4[_0x4880('0x15')]['message']);return _0x16dcdd(_0x5affd4[_0x4880('0x15')][_0x4880('0x17')]);}logger[_0x4880('0x15')](_0x4880('0x13'),_0x21528f,_0x5affd4['error'][_0x4880('0x17')]);return _0x3276de(_0x5affd4[_0x4880('0x15')]['message']);}else{logger[_0x4880('0x12')](_0x4880('0x13'),_0x21528f,'request\x20sent');_0x3276de(_0x5affd4[_0x4880('0x18')][_0x4880('0x17')]);}})['catch'](function(_0x2f11c0){logger[_0x4880('0x15')](_0x4880('0x13'),_0x21528f,_0x2f11c0);_0x16dcdd(_0x2f11c0);});});}exports[_0x4880('0x19')]=function(_0x5e8961){var _0x5c7ac1=this;return new Promise(function(_0x2f5940,_0x1252bb){return db['SmsInteraction']['update'](_0x5e8961[_0x4880('0x1a')],{'raw':_0x5e8961[_0x4880('0x1b')]?_0x5e8961[_0x4880('0x1b')][_0x4880('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e8961['options']?_0x5e8961[_0x4880('0x1b')][_0x4880('0x1d')]||null:null,'attributes':_0x5e8961[_0x4880('0x1b')]?_0x5e8961[_0x4880('0x1b')][_0x4880('0x1e')]||null:null,'limit':_0x5e8961['options']?_0x5e8961[_0x4880('0x1b')][_0x4880('0x1f')]||null:null})[_0x4880('0x11')](function(_0x5a564d){logger['info'](_0x4880('0x19'),_0x5e8961);logger[_0x4880('0x20')](_0x4880('0x19'),_0x5e8961,JSON[_0x4880('0x21')](_0x5a564d));_0x2f5940(_0x5a564d);})[_0x4880('0x22')](function(_0x5e55ad){logger[_0x4880('0x15')](_0x4880('0x19'),_0x5e55ad[_0x4880('0x17')],_0x5e8961);_0x1252bb(_0x5c7ac1[_0x4880('0x15')](0x1f4,_0x5e55ad[_0x4880('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x5e4b75){return new Promise(function(_0x46355b,_0x3d4327){return db['SmsInteraction'][_0x4880('0x23')]({'where':_0x5e4b75[_0x4880('0x1b')]?_0x5e4b75[_0x4880('0x1b')]['where']||null:null})[_0x4880('0x11')](function(_0x11c590){if(_0x11c590){return _0x11c590[_0x4880('0x24')](_0x5e4b75[_0x4880('0x1a')][_0x4880('0x25')],_[_0x4880('0x26')](_0x5e4b75[_0x4880('0x1a')],[_0x4880('0x25'),'id'])||{});}})[_0x4880('0x27')](function(_0x5d43a2){logger[_0x4880('0x12')]('AddTags',_0x5e4b75);logger[_0x4880('0x20')]('AddTags',_0x5e4b75,JSON['stringify'](_0x5d43a2));_0x46355b(_0x5d43a2);})['catch'](function(_0x417b99){logger[_0x4880('0x15')](_0x4880('0x28'),_0x417b99['message'],_0x5e4b75);_0x3d4327(_this[_0x4880('0x15')](0x1f4,_0x417b99['message']));});});}; \ No newline at end of file +var _0x804e=['localhost','socket.io-emitter','register','request','then','info','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','AddTagsToSmsInteraction','find','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults'];(function(_0x5e96da,_0x927901){var _0x1db7b8=function(_0x308121){while(--_0x308121){_0x5e96da['push'](_0x5e96da['shift']());}};_0x1db7b8(++_0x927901);}(_0x804e,0xc0));var _0xe804=function(_0xbbb317,_0x5aa9bd){_0xbbb317=_0xbbb317-0x0;var _0x2187e4=_0x804e[_0xbbb317];return _0x2187e4;};'use strict';var _=require(_0xe804('0x0'));var util=require(_0xe804('0x1'));var moment=require(_0xe804('0x2'));var BPromise=require(_0xe804('0x3'));var rs=require(_0xe804('0x4'));var fs=require('fs');var Redis=require(_0xe804('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe804('0x6'));var logger=require(_0xe804('0x7'))(_0xe804('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe804('0x9')][_0xe804('0xa')]({'port':0x232a});config[_0xe804('0xb')]=_[_0xe804('0xc')](config[_0xe804('0xb')],{'host':_0xe804('0xd'),'port':0x18eb});var socket=require(_0xe804('0xe'))(new Redis(config[_0xe804('0xb')]));require('./smsInteraction.socket')[_0xe804('0xf')](socket);function respondWithRpcPromise(_0x41e512,_0x5021a4,_0x323957){return new BPromise(function(_0x353ab1,_0x328219){return client[_0xe804('0x10')](_0x41e512,_0x323957)[_0xe804('0x11')](function(_0x365ef5){logger[_0xe804('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x5021a4,'request\x20sent');logger[_0xe804('0x13')](_0xe804('0x14'),_0x5021a4,_0xe804('0x15'),JSON[_0xe804('0x16')](_0x365ef5));if(_0x365ef5[_0xe804('0x17')]){if(_0x365ef5[_0xe804('0x17')]['code']===0x1f4){logger[_0xe804('0x17')](_0xe804('0x18'),_0x5021a4,_0x365ef5[_0xe804('0x17')]['message']);return _0x328219(_0x365ef5['error']['message']);}logger[_0xe804('0x17')](_0xe804('0x18'),_0x5021a4,_0x365ef5[_0xe804('0x17')][_0xe804('0x19')]);return _0x353ab1(_0x365ef5['error'][_0xe804('0x19')]);}else{logger[_0xe804('0x12')](_0xe804('0x18'),_0x5021a4,_0xe804('0x15'));_0x353ab1(_0x365ef5[_0xe804('0x1a')][_0xe804('0x19')]);}})[_0xe804('0x1b')](function(_0xd8ddc0){logger[_0xe804('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x5021a4,_0xd8ddc0);_0x328219(_0xd8ddc0);});});}exports[_0xe804('0x1c')]=function(_0x444ddd){var _0x551571=this;return new Promise(function(_0xb2ffbd,_0x3d92f7){return db[_0xe804('0x1d')][_0xe804('0x1e')](_0x444ddd[_0xe804('0x1f')],{'raw':_0x444ddd['options']?_0x444ddd[_0xe804('0x20')][_0xe804('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x444ddd['options']?_0x444ddd[_0xe804('0x20')][_0xe804('0x22')]||null:null,'attributes':_0x444ddd[_0xe804('0x20')]?_0x444ddd[_0xe804('0x20')]['attributes']||null:null,'limit':_0x444ddd[_0xe804('0x20')]?_0x444ddd['options'][_0xe804('0x23')]||null:null})[_0xe804('0x11')](function(_0x22c6d1){logger[_0xe804('0x12')]('UpdateSmsInteraction',_0x444ddd);logger['debug']('UpdateSmsInteraction',_0x444ddd,JSON[_0xe804('0x16')](_0x22c6d1));_0xb2ffbd(_0x22c6d1);})[_0xe804('0x1b')](function(_0xa0b553){logger[_0xe804('0x17')](_0xe804('0x1c'),_0xa0b553[_0xe804('0x19')],_0x444ddd);_0x3d92f7(_0x551571[_0xe804('0x17')](0x1f4,_0xa0b553[_0xe804('0x19')]));});});};exports[_0xe804('0x24')]=function(_0x268bfe){return new Promise(function(_0x1de4f9,_0x5c2623){return db[_0xe804('0x1d')][_0xe804('0x25')]({'where':_0x268bfe[_0xe804('0x20')]?_0x268bfe[_0xe804('0x20')][_0xe804('0x22')]||null:null})[_0xe804('0x11')](function(_0x3528ed){if(_0x3528ed){return _0x3528ed['addTags'](_0x268bfe[_0xe804('0x1f')]['ids'],_[_0xe804('0x26')](_0x268bfe['body'],[_0xe804('0x27'),'id'])||{});}})['spread'](function(_0x2d627b){logger[_0xe804('0x12')]('AddTags',_0x268bfe);logger['debug'](_0xe804('0x28'),_0x268bfe,JSON[_0xe804('0x16')](_0x2d627b));_0x1de4f9(_0x2d627b);})['catch'](function(_0x412511){logger[_0xe804('0x17')](_0xe804('0x28'),_0x412511[_0xe804('0x19')],_0x268bfe);_0x5c2623(_this[_0xe804('0x17')](0x1f4,_0x412511['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 6b2b992..072f91f 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 _0xbaf0=['removeListener','register','length','smsInteraction:','save','remove','update'];(function(_0xa93ebb,_0xd0e6b3){var _0xded73=function(_0x494a38){while(--_0x494a38){_0xa93ebb['push'](_0xa93ebb['shift']());}};_0xded73(++_0xd0e6b3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x0baf('0x0'),_0x0baf('0x1'),_0x0baf('0x2')];function createListener(_0x263f79,_0x1688bc){return function(_0x4d2e72){_0x1688bc['emit'](_0x263f79,_0x4d2e72);};}function removeListener(_0x232cc7,_0x1c383e){return function(){SmsInteractionEvents[_0x0baf('0x3')](_0x232cc7,_0x1c383e);};}exports[_0x0baf('0x4')]=function(_0xe4c3c4){for(var _0x335e24=0x0,_0x1a10b1=events[_0x0baf('0x5')];_0x335e24<_0x1a10b1;_0x335e24++){var _0x1d0a0d=events[_0x335e24];var _0x5f5030=createListener(_0x0baf('0x6')+_0x1d0a0d,_0xe4c3c4);SmsInteractionEvents['on'](_0x1d0a0d,_0x5f5030);}}; \ No newline at end of file +var _0x757a=['save','remove','emit','removeListener','register','smsInteraction:'];(function(_0x2461ee,_0x1b068e){var _0xee8871=function(_0x354a1d){while(--_0x354a1d){_0x2461ee['push'](_0x2461ee['shift']());}};_0xee8871(++_0x1b068e);}(_0x757a,0xde));var _0xa757=function(_0x307612,_0x37f4d1){_0x307612=_0x307612-0x0;var _0x45888f=_0x757a[_0x307612];return _0x45888f;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa757('0x0'),_0xa757('0x1'),'update'];function createListener(_0x5c03c3,_0x5709ed){return function(_0x32be3b){_0x5709ed[_0xa757('0x2')](_0x5c03c3,_0x32be3b);};}function removeListener(_0x1c2932,_0x453d07){return function(){SmsInteractionEvents[_0xa757('0x3')](_0x1c2932,_0x453d07);};}exports[_0xa757('0x4')]=function(_0x5edca8){for(var _0xae0e7c=0x0,_0x4343b6=events['length'];_0xae0e7c<_0x4343b6;_0xae0e7c++){var _0x2930fa=events[_0xae0e7c];var _0x2f7793=createListener(_0xa757('0x5')+_0x2930fa,_0x5edca8);SmsInteractionEvents['on'](_0x2930fa,_0x2f7793);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 8a71bf7..0d8edb2 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 _0xc8d3=['smsmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','sms'];(function(_0x5adfef,_0x466995){var _0x2e430a=function(_0x43589f){while(--_0x43589f){_0x5adfef['push'](_0x5adfef['shift']());}};_0x2e430a(++_0x466995);}(_0xc8d3,0x169));var _0x3c8d=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0xc8d3[_0x59bcb1];return _0x4a737f;};'use strict';var multer=require(_0x3c8d('0x0'));var util=require('util');var path=require(_0x3c8d('0x1'));var timeout=require(_0x3c8d('0x2'));var express=require(_0x3c8d('0x3'));var router=express[_0x3c8d('0x4')]();var auth=require(_0x3c8d('0x5'));var interaction=require(_0x3c8d('0x6'));var config=require(_0x3c8d('0x7'));var controller=require(_0x3c8d('0x8'));router[_0x3c8d('0x9')]('/',auth[_0x3c8d('0xa')](),controller['index']);router[_0x3c8d('0x9')](_0x3c8d('0xb'),auth['isAuthenticated'](),controller[_0x3c8d('0xc')]);router[_0x3c8d('0x9')](_0x3c8d('0xd'),auth[_0x3c8d('0xa')](),controller[_0x3c8d('0xe')]);router['post']('/',auth[_0x3c8d('0xa')](),interaction['tracked'](_0x3c8d('0xf'),_0x3c8d('0x10')),controller[_0x3c8d('0x11')]);router[_0x3c8d('0x12')](_0x3c8d('0x13'),controller[_0x3c8d('0x14')]);router[_0x3c8d('0x15')](_0x3c8d('0xd'),auth['isAuthenticated'](),controller[_0x3c8d('0x16')]);router[_0x3c8d('0x15')](_0x3c8d('0x17'),auth[_0x3c8d('0xa')](),controller[_0x3c8d('0x18')]);router['put'](_0x3c8d('0x19'),auth[_0x3c8d('0xa')](),controller[_0x3c8d('0x1a')]);router[_0x3c8d('0x1b')](_0x3c8d('0xd'),auth[_0x3c8d('0xa')](),controller[_0x3c8d('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x4bff=['get','isAuthenticated','/describe','describe','/:id','show','tracked','smsmessage:create','create','post','/:id/status','status','put','update','accept','/:id/reject','reject','path','connect-timeout','express','Router','../../components/interaction/service','./smsMessage.controller'];(function(_0x32c40c,_0x5a48c1){var _0x56e979=function(_0x4ed72a){while(--_0x4ed72a){_0x32c40c['push'](_0x32c40c['shift']());}};_0x56e979(++_0x5a48c1);}(_0x4bff,0x84));var _0xf4bf=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0x4bff[_0x561f25];return _0x150e4c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf4bf('0x0'));var timeout=require(_0xf4bf('0x1'));var express=require(_0xf4bf('0x2'));var router=express[_0xf4bf('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf4bf('0x4'));var config=require('../../config/environment');var controller=require(_0xf4bf('0x5'));router[_0xf4bf('0x6')]('/',auth[_0xf4bf('0x7')](),controller['index']);router[_0xf4bf('0x6')](_0xf4bf('0x8'),auth[_0xf4bf('0x7')](),controller[_0xf4bf('0x9')]);router['get'](_0xf4bf('0xa'),auth['isAuthenticated'](),controller[_0xf4bf('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xf4bf('0xc')]('sms',_0xf4bf('0xd')),controller[_0xf4bf('0xe')]);router[_0xf4bf('0xf')](_0xf4bf('0x10'),controller[_0xf4bf('0x11')]);router[_0xf4bf('0x12')](_0xf4bf('0xa'),auth[_0xf4bf('0x7')](),controller[_0xf4bf('0x13')]);router['put']('/:id/accept',auth[_0xf4bf('0x7')](),controller[_0xf4bf('0x14')]);router['put'](_0xf4bf('0x15'),auth['isAuthenticated'](),controller[_0xf4bf('0x16')]);router['delete'](_0xf4bf('0xa'),auth[_0xf4bf('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 2782be8..2b5d9f1 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 _0x2560=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1119e2,_0x1fb2e1){var _0xedc93b=function(_0x5c3fc6){while(--_0x5c3fc6){_0x1119e2['push'](_0x1119e2['shift']());}};_0xedc93b(++_0x1fb2e1);}(_0x2560,0x9a));var _0x0256=function(_0x56ba54,_0x215d06){_0x56ba54=_0x56ba54-0x0;var _0x35b571=_0x2560[_0x56ba54];return _0x35b571;};'use strict';var Sequelize=require(_0x0256('0x0'));module[_0x0256('0x1')]={'body':{'type':Sequelize[_0x0256('0x2')](_0x0256('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0256('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0256('0x5')]('in',_0x0256('0x6')),'defaultValue':_0x0256('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0256('0x7')](0xbe)},'phone':{'type':Sequelize[_0x0256('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x0256('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x46b2=['STRING','exports','TEXT','ENUM','out'];(function(_0x318e53,_0x252ad7){var _0x3c5065=function(_0x1248f0){while(--_0x1248f0){_0x318e53['push'](_0x318e53['shift']());}};_0x3c5065(++_0x252ad7);}(_0x46b2,0x114));var _0x246b=function(_0x21d0b1,_0x3abc04){_0x21d0b1=_0x21d0b1-0x0;var _0xaa7e4=_0x46b2[_0x21d0b1];return _0xaa7e4;};'use strict';var Sequelize=require('sequelize');module[_0x246b('0x0')]={'body':{'type':Sequelize[_0x246b('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x246b('0x2')]('in',_0x246b('0x3')),'defaultValue':_0x246b('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x246b('0x4')](0xbe)},'phone':{'type':Sequelize[_0x246b('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 1cbe44c..f2ff7f4 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 _0x85e9=['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','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','count','offset','limit','Content-Range','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','includeAll','create','body','find','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteractionId','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','interface','channel','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','RejectMessage','event','SmsAccount','SmsAccountId','twilio','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','Status','plivio','infobip','results','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','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/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','Sequelize'];(function(_0x461164,_0x370d5a){var _0xba8ba6=function(_0x44456d){while(--_0x44456d){_0x461164['push'](_0x461164['shift']());}};_0xba8ba6(++_0x370d5a);}(_0x85e9,0xeb));var _0x985e=function(_0x47fe5c,_0x47d2a8){_0x47fe5c=_0x47fe5c-0x0;var _0x3c4b50=_0x85e9[_0x47fe5c];return _0x3c4b50;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x985e('0x0'));var rimraf=require(_0x985e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x985e('0x2'));var rp=require(_0x985e('0x3'));var moment=require('moment');var BPromise=require(_0x985e('0x4'));var Mustache=require(_0x985e('0x5'));var util=require(_0x985e('0x6'));var path=require(_0x985e('0x7'));var sox=require(_0x985e('0x8'));var csv=require(_0x985e('0x9'));var ejs=require(_0x985e('0xa'));var fs=require('fs');var _=require(_0x985e('0xb'));var squel=require(_0x985e('0xc'));var crypto=require(_0x985e('0xd'));var jsforce=require(_0x985e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x985e('0x9'));var querystring=require('querystring');var Papa=require(_0x985e('0xf'));var Redis=require(_0x985e('0x10'));var authService=require(_0x985e('0x11'));var qs=require(_0x985e('0x12'));var as=require(_0x985e('0x13'));var hardwareService=require(_0x985e('0x14'));var logger=require(_0x985e('0x15'))(_0x985e('0x16'));var utils=require(_0x985e('0x17'));var config=require('../../config/environment');var db=require(_0x985e('0x18'))['db'];config[_0x985e('0x19')]=_[_0x985e('0x1a')](config[_0x985e('0x19')],{'host':_0x985e('0x1b'),'port':0x18eb});var socket=require(_0x985e('0x1c'))(new Redis(config[_0x985e('0x19')]));require(_0x985e('0x1d'))[_0x985e('0x1e')](socket);var jayson=require(_0x985e('0x1f'));var client=jayson[_0x985e('0x20')][_0x985e('0x21')]({'port':0x232c});var client9002=jayson[_0x985e('0x20')][_0x985e('0x21')]({'port':0x232a});function checkPasswordPattern(_0x4c4472,_0x12c751,_0x2cc4e1){if(_0x2cc4e1){var _0x42098a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42098a['test'](_0x12c751)){return _0x4c4472;}else{throw new db[(_0x985e('0x22'))]['ValidationError'](_0x985e('0x23'));}}else{return _0x4c4472;}}function respondWithRpcPromise(_0x40eb1f,_0x5f07cf,_0x36605a,_0x32ad29){return new BPromise(function(_0x2eab6b,_0x1c940f){var _0x7af965=_0x32ad29||client;return _0x7af965[_0x985e('0x24')](_0x40eb1f,_0x36605a)[_0x985e('0x25')](function(_0x48ab35){logger['info'](_0x985e('0x26'),_0x5f07cf,'request\x20sent');logger['debug'](_0x985e('0x27'),_0x5f07cf,_0x985e('0x28'),JSON[_0x985e('0x29')](_0x48ab35));if(_0x48ab35[_0x985e('0x2a')]){if(_0x48ab35[_0x985e('0x2a')][_0x985e('0x2b')]===0x1f4){logger[_0x985e('0x2a')](_0x985e('0x26'),_0x5f07cf,_0x48ab35['error'][_0x985e('0x2c')]);return _0x1c940f(_0x48ab35[_0x985e('0x2a')][_0x985e('0x2c')]);}logger[_0x985e('0x2a')]('SmsMessage,\x20%s,\x20%s',_0x5f07cf,_0x48ab35[_0x985e('0x2a')][_0x985e('0x2c')]);return _0x2eab6b(_0x48ab35[_0x985e('0x2a')][_0x985e('0x2c')]);}else{logger[_0x985e('0x2d')](_0x985e('0x26'),_0x5f07cf,_0x985e('0x28'));_0x2eab6b(_0x48ab35[_0x985e('0x2e')]['message']);}})['catch'](function(_0x5971c1){logger['error'](_0x985e('0x26'),_0x5f07cf,_0x5971c1);_0x1c940f(_0x5971c1);});});}function respondWithStatusCode(_0x1e0cfc,_0x4e64de){_0x4e64de=_0x4e64de||0xcc;return function(_0x57bcc5){if(_0x57bcc5){return _0x1e0cfc[_0x985e('0x2f')](_0x4e64de);}return _0x1e0cfc[_0x985e('0x30')](_0x4e64de)[_0x985e('0x31')]();};}function respondWithResult(_0x37491b,_0x4ec66f){_0x4ec66f=_0x4ec66f||0xc8;return function(_0x2afceb){if(_0x2afceb){return _0x37491b[_0x985e('0x30')](_0x4ec66f)[_0x985e('0x32')](_0x2afceb);}};}function respondWithFilteredResult(_0x2a9174,_0x75e3ba){return function(_0x7f3a05){if(_0x7f3a05){var _0x2e8985=_0x7f3a05[_0x985e('0x33')],_0x156773=_0x75e3ba[_0x985e('0x34')],_0xa188ed=_0x75e3ba['offset']+_0x75e3ba[_0x985e('0x35')],_0x3962bf;if(_0xa188ed>=_0x2e8985){_0xa188ed=_0x2e8985;_0x3962bf=0xc8;}else{_0x3962bf=0xce;}_0x2a9174[_0x985e('0x30')](_0x3962bf);return _0x2a9174['set'](_0x985e('0x36'),_0x156773+'-'+_0xa188ed+'/'+_0x2e8985)[_0x985e('0x32')](_0x7f3a05);}return null;};}function patchUpdates(_0x289a91){return function(_0x26ba50){try{jsonpatch['apply'](_0x26ba50,_0x289a91,!![]);}catch(_0x4c2777){return BPromise['reject'](_0x4c2777);}return _0x26ba50[_0x985e('0x37')]();};}function saveUpdates(_0x45365d,_0x46f801){return function(_0x319166){if(_0x319166){return _0x319166[_0x985e('0x38')](_0x45365d)[_0x985e('0x25')](function(_0x50fcf2){return _0x50fcf2;});}return null;};}function removeEntity(_0x3fa878,_0x17f9da){return function(_0x8d6dc4){if(_0x8d6dc4){return _0x8d6dc4[_0x985e('0x39')]()[_0x985e('0x25')](function(){_0x3fa878[_0x985e('0x30')](0xcc)[_0x985e('0x31')]();});}};}function handleEntityNotFound(_0x3c350b,_0x3ab8c8){return function(_0x2264f6){if(!_0x2264f6){_0x3c350b[_0x985e('0x2f')](0x194);}return _0x2264f6;};}function handleError(_0x3d02d4,_0x1aa010){_0x1aa010=_0x1aa010||0x1f4;return function(_0x4617ac){logger['error'](_0x4617ac[_0x985e('0x3a')]);if(_0x4617ac[_0x985e('0x3b')]){delete _0x4617ac[_0x985e('0x3b')];}_0x3d02d4['status'](_0x1aa010)[_0x985e('0x3c')](_0x4617ac);};}exports[_0x985e('0x3d')]=function(_0x31d771,_0x1d763e){var _0x431a52={},_0x36781b={},_0x5a3617={'count':0x0,'rows':[]};var _0x32f861=_[_0x985e('0x3e')](db[_0x985e('0x3f')][_0x985e('0x40')],function(_0x21a871){return{'name':_0x21a871[_0x985e('0x41')],'type':_0x21a871[_0x985e('0x42')]['key']};});_0x36781b[_0x985e('0x43')]=_[_0x985e('0x3e')](_0x32f861,_0x985e('0x3b'));_0x36781b['query']=_[_0x985e('0x44')](_0x31d771[_0x985e('0x45')]);_0x36781b['filters']=_[_0x985e('0x46')](_0x36781b['model'],_0x36781b['query']);_0x431a52['attributes']=_[_0x985e('0x46')](_0x36781b[_0x985e('0x43')],qs['fields'](_0x31d771[_0x985e('0x45')][_0x985e('0x47')]));_0x431a52[_0x985e('0x48')]=_0x431a52[_0x985e('0x48')][_0x985e('0x49')]?_0x431a52[_0x985e('0x48')]:_0x36781b[_0x985e('0x43')];if(!_0x31d771[_0x985e('0x45')][_0x985e('0x4a')](_0x985e('0x4b'))){_0x431a52['limit']=qs[_0x985e('0x35')](_0x31d771[_0x985e('0x45')][_0x985e('0x35')]);_0x431a52[_0x985e('0x34')]=qs['offset'](_0x31d771[_0x985e('0x45')][_0x985e('0x34')]);}_0x431a52['order']=qs['sort'](_0x31d771[_0x985e('0x45')][_0x985e('0x4c')]);_0x431a52[_0x985e('0x4d')]=qs[_0x985e('0x4e')](_[_0x985e('0x4f')](_0x31d771[_0x985e('0x45')],_0x36781b[_0x985e('0x4e')]));if(_0x31d771[_0x985e('0x45')][_0x985e('0x50')]){_0x431a52[_0x985e('0x4d')]=_[_0x985e('0x51')](_0x431a52['where'],{'$or':_[_0x985e('0x3e')](_0x32f861,function(_0x174425){if(_0x174425['type']!==_0x985e('0x52')){var _0x10c28d={};_0x10c28d[_0x174425[_0x985e('0x3b')]]={'$like':'%'+_0x31d771[_0x985e('0x45')]['filter']+'%'};return _0x10c28d;}})});}_0x431a52=_['merge']({},_0x431a52,_0x31d771['options']);var _0x440141={'where':_0x431a52['where']};return db[_0x985e('0x3f')][_0x985e('0x33')](_0x440141)[_0x985e('0x25')](function(_0x67ad2a){_0x5a3617['count']=_0x67ad2a;if(_0x31d771[_0x985e('0x45')]['includeAll']){_0x431a52['include']=[{'all':!![]}];}return db[_0x985e('0x3f')][_0x985e('0x53')](_0x431a52);})[_0x985e('0x25')](function(_0x3c2b6e){_0x5a3617[_0x985e('0x54')]=_0x3c2b6e;return _0x5a3617;})[_0x985e('0x25')](respondWithFilteredResult(_0x1d763e,_0x431a52))[_0x985e('0x55')](handleError(_0x1d763e,null));};exports[_0x985e('0x56')]=function(_0x188094,_0x1e225e){var _0x4ca444={'raw':!![],'where':{'id':_0x188094[_0x985e('0x57')]['id']}},_0x4fd7e4={};_0x4fd7e4[_0x985e('0x43')]=_[_0x985e('0x44')](db['SmsMessage'][_0x985e('0x40')]);_0x4fd7e4['query']=_[_0x985e('0x44')](_0x188094[_0x985e('0x45')]);_0x4fd7e4[_0x985e('0x4e')]=_[_0x985e('0x46')](_0x4fd7e4[_0x985e('0x43')],_0x4fd7e4[_0x985e('0x45')]);_0x4ca444[_0x985e('0x48')]=_['intersection'](_0x4fd7e4[_0x985e('0x43')],qs['fields'](_0x188094[_0x985e('0x45')][_0x985e('0x47')]));_0x4ca444[_0x985e('0x48')]=_0x4ca444['attributes'][_0x985e('0x49')]?_0x4ca444[_0x985e('0x48')]:_0x4fd7e4[_0x985e('0x43')];if(_0x188094[_0x985e('0x45')][_0x985e('0x58')]){_0x4ca444['include']=[{'all':!![]}];}_0x4ca444=_[_0x985e('0x51')]({},_0x4ca444,_0x188094['options']);return db[_0x985e('0x3f')]['find'](_0x4ca444)[_0x985e('0x25')](handleEntityNotFound(_0x1e225e,null))['then'](respondWithResult(_0x1e225e,null))[_0x985e('0x55')](handleError(_0x1e225e,null));};exports[_0x985e('0x59')]=function(_0x57fb51,_0x2aaaf2){return db[_0x985e('0x3f')][_0x985e('0x59')](_0x57fb51['body'],{})[_0x985e('0x25')](respondWithResult(_0x2aaaf2,0xc9))[_0x985e('0x55')](handleError(_0x2aaaf2,null));};exports['update']=function(_0x135f7d,_0x50e7eb){if(_0x135f7d['body']['id']){delete _0x135f7d[_0x985e('0x5a')]['id'];}return db[_0x985e('0x3f')][_0x985e('0x5b')]({'where':{'id':_0x135f7d[_0x985e('0x57')]['id']}})[_0x985e('0x25')](handleEntityNotFound(_0x50e7eb,null))[_0x985e('0x25')](saveUpdates(_0x135f7d[_0x985e('0x5a')],null))[_0x985e('0x25')](respondWithResult(_0x50e7eb,null))[_0x985e('0x55')](handleError(_0x50e7eb,null));};exports[_0x985e('0x39')]=function(_0x432aaf,_0x441332){return db[_0x985e('0x3f')][_0x985e('0x5b')]({'where':{'id':_0x432aaf[_0x985e('0x57')]['id']}})[_0x985e('0x25')](handleEntityNotFound(_0x441332,null))[_0x985e('0x25')](removeEntity(_0x441332,null))['catch'](handleError(_0x441332,null));};exports[_0x985e('0x5c')]=function(_0x5ab98b,_0x1a0dcb){return db[_0x985e('0x3f')]['describe']()[_0x985e('0x25')](respondWithResult(_0x1a0dcb,null))[_0x985e('0x55')](handleError(_0x1a0dcb,null));};var interaction_log=require('../../config/logger')(_0x985e('0x5d'));exports[_0x985e('0x5e')]=function(_0x20eefa,_0x21e126,_0x5b7554){var _0x328568={'channel':'sms'};if(_0x20eefa[_0x985e('0x5a')]['id']){delete _0x20eefa[_0x985e('0x5a')]['id'];}_0x20eefa[_0x985e('0x5a')][_0x985e('0x5f')]=!![];_0x20eefa[_0x985e('0x5a')][_0x985e('0x60')]=moment()[_0x985e('0x61')](_0x985e('0x62'));_0x20eefa[_0x985e('0x5a')]['UserId']=_0x20eefa['body'][_0x985e('0x63')]||_0x20eefa[_0x985e('0x64')]['id'];return db['SmsMessage'][_0x985e('0x5b')]({'where':{'id':_0x20eefa['params']['id'],'UserId':null},'include':[{'model':db[_0x985e('0x65')],'as':_0x985e('0x66')}]})[_0x985e('0x25')](handleEntityNotFound(_0x21e126,null))['then'](saveUpdates(_0x20eefa['body'],null))[_0x985e('0x25')](function(_0x3cade4){if(_0x3cade4){_0x328568[_0x985e('0x2c')]=_0x3cade4[_0x985e('0x67')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x3cade4[_0x985e('0x68')]}});}return null;})[_0x985e('0x25')](handleEntityNotFound(_0x21e126,null))[_0x985e('0x25')](function(_0x550047){if(_0x550047){return _0x550047[_0x985e('0x38')]({'UserId':_0x20eefa[_0x985e('0x5a')]['UserId'],'read1stAt':_[_0x985e('0x69')](_0x550047[_0x985e('0x6a')])?moment()[_0x985e('0x61')](_0x985e('0x62')):undefined});}return null;})[_0x985e('0x25')](function(_0x2678b2){if(_0x2678b2){_0x328568['interaction']=_0x2678b2['get']({'plain':!![]});interaction_log[_0x985e('0x2d')](_0x985e('0x6b'),_0x20eefa[_0x985e('0x64')]['id'],_0x20eefa[_0x985e('0x64')]['name'],_0x20eefa[_0x985e('0x64')][_0x985e('0x6c')],_0x328568['interaction']['id'],_0x20eefa[_0x985e('0x5a')]?JSON[_0x985e('0x29')](_0x20eefa[_0x985e('0x5a')]):'null');return respondWithRpcPromise(_0x985e('0x6d'),_0x985e('0x6e'),_0x328568);}return null;})[_0x985e('0x25')](function(_0x2d5c07){if(_0x2d5c07){if(_0x20eefa[_0x985e('0x5a')]['manual']){_0x328568['message'][_0x985e('0x6f')]=util['format']('SIP/%s',_0x20eefa['user']['name']);_0x328568['message'][_0x985e('0x70')]=_0x328568[_0x985e('0x70')];_0x328568[_0x985e('0x2c')]['event']='accept';return respondWithRpcPromise(_0x985e('0x71'),'EventManager',{'event':_0x985e('0x72'),'message':_0x328568[_0x985e('0x2c')]},client9002)[_0x985e('0x25')](function(){return _0x328568;});}return _0x328568;}return null;})['then'](respondWithResult(_0x21e126,null))[_0x985e('0x55')](handleError(_0x21e126,null));};var interaction_log=require(_0x985e('0x15'))(_0x985e('0x5d'));exports[_0x985e('0x73')]=function(_0x3b71aa,_0x41142b,_0x2e1f5e){var _0x193e49={'agent':{},'channel':'sms'};if(_0x3b71aa[_0x985e('0x5a')]['id']){delete _0x3b71aa[_0x985e('0x5a')]['id'];}_0x3b71aa['body']['UserId']=_0x3b71aa[_0x985e('0x5a')][_0x985e('0x63')]||_0x3b71aa[_0x985e('0x64')]['id'];_0x193e49['agent']['id']=_0x3b71aa[_0x985e('0x5a')]['UserId'];return db[_0x985e('0x3f')][_0x985e('0x5b')]({'where':{'id':_0x3b71aa[_0x985e('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x41142b,null))[_0x985e('0x25')](function(_0x50ed26){if(_0x50ed26){_0x193e49[_0x985e('0x2c')]=_0x50ed26[_0x985e('0x67')]({'plain':!![]});return db['SmsInteraction'][_0x985e('0x5b')]({'where':{'id':_0x50ed26[_0x985e('0x68')]}});}return null;})[_0x985e('0x25')](handleEntityNotFound(_0x41142b,null))[_0x985e('0x25')](function(_0x1cd853){if(_0x1cd853){_0x193e49['interaction']=_0x1cd853[_0x985e('0x67')]({'plain':!![]});interaction_log[_0x985e('0x2d')](_0x985e('0x74'),_0x3b71aa[_0x985e('0x64')]['id'],_0x3b71aa[_0x985e('0x64')]['name'],_0x3b71aa[_0x985e('0x64')][_0x985e('0x6c')],_0x193e49[_0x985e('0x75')]['id'],_0x3b71aa['body']?JSON[_0x985e('0x29')](_0x3b71aa[_0x985e('0x5a')]):_0x985e('0x76'));return respondWithRpcPromise(_0x985e('0x77'),'rejectMessage',_0x193e49);}return null;})[_0x985e('0x25')](function(_0x1d3365){if(_0x1d3365){_0x1d3365[_0x985e('0x2c')][_0x985e('0x6f')]=util[_0x985e('0x61')]('SIP/%s',_0x3b71aa[_0x985e('0x64')]['name']);_0x1d3365[_0x985e('0x2c')][_0x985e('0x70')]=_0x193e49[_0x985e('0x70')];_0x1d3365['message'][_0x985e('0x78')]=_0x985e('0x73');respondWithRpcPromise(_0x985e('0x71'),_0x985e('0x71'),{'event':'rejectmessage','message':_0x1d3365[_0x985e('0x2c')]},client9002);return _0x193e49;}return null;})['then'](respondWithResult(_0x41142b,null))[_0x985e('0x55')](handleError(_0x41142b,null));};exports['status']=function(_0x5098b5,_0x25a6de,_0x2bb534){if(_0x5098b5['body']['id']){delete _0x5098b5['body']['id'];}var _0x2fe6da;return db['SmsMessage'][_0x985e('0x5b')]({'where':{'id':_0x5098b5['params']['id']}})[_0x985e('0x25')](handleEntityNotFound(_0x25a6de,null))[_0x985e('0x25')](function(_0x1b7d85){if(_0x1b7d85){_0x2fe6da=_0x1b7d85;return db[_0x985e('0x79')]['find']({'where':{'id':_0x1b7d85[_0x985e('0x7a')]}});}})['then'](handleEntityNotFound(_0x25a6de,null))[_0x985e('0x25')](function(_0x43de5b){if(_0x43de5b){logger['debug'](_0x985e('0x27'),_0x985e('0x30'),'received\x20delivery\x20report\x20from',_0x43de5b[_0x985e('0x42')],util['inspect'](_0x5098b5[_0x985e('0x5a')],{'showHidden':![],'depth':null}));switch(_0x43de5b['type']){case _0x985e('0x7b'):if(_0x5098b5[_0x985e('0x5a')]['MessageSid']&&_0x5098b5['body']['MessageSid']===_0x2fe6da[_0x985e('0x7c')]){return _0x2fe6da[_0x985e('0x38')]({'read':!![]});}else{logger[_0x985e('0x2a')](_0x985e('0x7d'),_0x985e('0x30'),_0x985e('0x7b'),util[_0x985e('0x7e')](_0x5098b5['body'],{'showHidden':![],'depth':null}));}break;case _0x985e('0x7f'):if(_0x5098b5[_0x985e('0x5a')][_0x985e('0x80')]&&_0x5098b5['body'][_0x985e('0x80')]===_0x2fe6da[_0x985e('0x7c')]&&_[_0x985e('0x81')](['sent','delivered'],_0x5098b5[_0x985e('0x5a')][_0x985e('0x82')])>=0x0){return _0x2fe6da[_0x985e('0x38')]({'read':!![]});}else{logger[_0x985e('0x2a')](_0x985e('0x7d'),_0x985e('0x30'),_0x985e('0x83'),util[_0x985e('0x7e')](_0x5098b5[_0x985e('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x985e('0x84'):var _0x388347=_0x5098b5[_0x985e('0x5a')][_0x985e('0x85')][0x0];if(_0x388347[_0x985e('0x30')]['groupName']===_0x985e('0x86')){return _0x2fe6da[_0x985e('0x38')]({'read':!![]});}else{logger[_0x985e('0x2a')](_0x985e('0x7d'),'status','infobip',util[_0x985e('0x7e')](_0x5098b5['body'],{'showHidden':![],'depth':null}));}break;}return _0x2fe6da;}})[_0x985e('0x25')](respondWithResult(_0x25a6de,null))[_0x985e('0x55')](handleError(_0x25a6de,null));}; \ No newline at end of file +var _0xea5f=['length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','SmsMessage','includeAll','findAll','rows','show','params','rawAttributes','include','options','find','create','body','destroy','describe','sms-interactions','accept','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteractionId','update','read1stAt','interaction','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','interface','format','SIP/%s','channel','event','EventManager','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','test','Sequelize','ValidationError','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','count','offset','limit','status','set','json','reject','save','stack','name','send','fieldName','type','key','model','map','query','keys','intersection','attributes','fields'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xea5f,0x156));var _0xfea5=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xea5f[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0xfea5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfea5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfea5('0x2'));var rp=require(_0xfea5('0x3'));var moment=require(_0xfea5('0x4'));var BPromise=require(_0xfea5('0x5'));var Mustache=require('mustache');var util=require(_0xfea5('0x6'));var path=require(_0xfea5('0x7'));var sox=require('sox');var csv=require(_0xfea5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfea5('0x9'));var squel=require(_0xfea5('0xa'));var crypto=require('crypto');var jsforce=require(_0xfea5('0xb'));var deskjs=require(_0xfea5('0xc'));var toCsv=require(_0xfea5('0x8'));var querystring=require(_0xfea5('0xd'));var Papa=require(_0xfea5('0xe'));var Redis=require(_0xfea5('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfea5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfea5('0x11'))('api');var utils=require(_0xfea5('0x12'));var config=require(_0xfea5('0x13'));var db=require(_0xfea5('0x14'))['db'];config['redis']=_['defaults'](config[_0xfea5('0x15')],{'host':_0xfea5('0x16'),'port':0x18eb});var socket=require(_0xfea5('0x17'))(new Redis(config['redis']));require(_0xfea5('0x18'))[_0xfea5('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfea5('0x1a')][_0xfea5('0x1b')]({'port':0x232c});var client9002=jayson[_0xfea5('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0xe36cce,_0xc37600,_0x29333e){if(_0x29333e){var _0x5daab8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5daab8[_0xfea5('0x1c')](_0xc37600)){return _0xe36cce;}else{throw new db[(_0xfea5('0x1d'))][(_0xfea5('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 _0xe36cce;}}function respondWithRpcPromise(_0x33836a,_0x53b102,_0x460e96,_0x239714){return new BPromise(function(_0x58c24e,_0x418c46){var _0x6d4112=_0x239714||client;return _0x6d4112[_0xfea5('0x1f')](_0x33836a,_0x460e96)[_0xfea5('0x20')](function(_0x9d74eb){logger['info'](_0xfea5('0x21'),_0x53b102,_0xfea5('0x22'));logger[_0xfea5('0x23')](_0xfea5('0x24'),_0x53b102,'request\x20sent',JSON[_0xfea5('0x25')](_0x9d74eb));if(_0x9d74eb[_0xfea5('0x26')]){if(_0x9d74eb[_0xfea5('0x26')][_0xfea5('0x27')]===0x1f4){logger[_0xfea5('0x26')](_0xfea5('0x21'),_0x53b102,_0x9d74eb[_0xfea5('0x26')][_0xfea5('0x28')]);return _0x418c46(_0x9d74eb['error'][_0xfea5('0x28')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x53b102,_0x9d74eb['error'][_0xfea5('0x28')]);return _0x58c24e(_0x9d74eb[_0xfea5('0x26')][_0xfea5('0x28')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x53b102,_0xfea5('0x22'));_0x58c24e(_0x9d74eb[_0xfea5('0x29')]['message']);}})[_0xfea5('0x2a')](function(_0x8409ff){logger[_0xfea5('0x26')](_0xfea5('0x21'),_0x53b102,_0x8409ff);_0x418c46(_0x8409ff);});});}function respondWithStatusCode(_0x533e09,_0x188365){_0x188365=_0x188365||0xcc;return function(_0x2fec6d){if(_0x2fec6d){return _0x533e09[_0xfea5('0x2b')](_0x188365);}return _0x533e09['status'](_0x188365)[_0xfea5('0x2c')]();};}function respondWithResult(_0x5ebba7,_0x541282){_0x541282=_0x541282||0xc8;return function(_0x2c1910){if(_0x2c1910){return _0x5ebba7['status'](_0x541282)['json'](_0x2c1910);}};}function respondWithFilteredResult(_0x59a44c,_0x305b1b){return function(_0x2b3e61){if(_0x2b3e61){var _0x32ab5d=_0x2b3e61[_0xfea5('0x2d')],_0x2863a5=_0x305b1b[_0xfea5('0x2e')],_0x5348d3=_0x305b1b[_0xfea5('0x2e')]+_0x305b1b[_0xfea5('0x2f')],_0x3f7e18;if(_0x5348d3>=_0x32ab5d){_0x5348d3=_0x32ab5d;_0x3f7e18=0xc8;}else{_0x3f7e18=0xce;}_0x59a44c[_0xfea5('0x30')](_0x3f7e18);return _0x59a44c[_0xfea5('0x31')]('Content-Range',_0x2863a5+'-'+_0x5348d3+'/'+_0x32ab5d)[_0xfea5('0x32')](_0x2b3e61);}return null;};}function patchUpdates(_0x2168ae){return function(_0x26a2d3){try{jsonpatch['apply'](_0x26a2d3,_0x2168ae,!![]);}catch(_0x310310){return BPromise[_0xfea5('0x33')](_0x310310);}return _0x26a2d3[_0xfea5('0x34')]();};}function saveUpdates(_0x28a6c9,_0x11b6ca){return function(_0x496805){if(_0x496805){return _0x496805['update'](_0x28a6c9)[_0xfea5('0x20')](function(_0x568258){return _0x568258;});}return null;};}function removeEntity(_0x3b37f1,_0xd1740){return function(_0x4476f6){if(_0x4476f6){return _0x4476f6['destroy']()['then'](function(){_0x3b37f1[_0xfea5('0x30')](0xcc)[_0xfea5('0x2c')]();});}};}function handleEntityNotFound(_0x2ae288,_0x29ff2c){return function(_0x4937f9){if(!_0x4937f9){_0x2ae288['sendStatus'](0x194);}return _0x4937f9;};}function handleError(_0xc54940,_0xe666df){_0xe666df=_0xe666df||0x1f4;return function(_0x2e0430){logger['error'](_0x2e0430[_0xfea5('0x35')]);if(_0x2e0430[_0xfea5('0x36')]){delete _0x2e0430[_0xfea5('0x36')];}_0xc54940[_0xfea5('0x30')](_0xe666df)[_0xfea5('0x37')](_0x2e0430);};}exports['index']=function(_0x397b48,_0x4653e2){var _0x3d73ee={},_0x10018a={},_0x5b1770={'count':0x0,'rows':[]};var _0x2e11e8=_['map'](db['SmsMessage']['rawAttributes'],function(_0x1ffe20){return{'name':_0x1ffe20[_0xfea5('0x38')],'type':_0x1ffe20[_0xfea5('0x39')][_0xfea5('0x3a')]};});_0x10018a[_0xfea5('0x3b')]=_[_0xfea5('0x3c')](_0x2e11e8,_0xfea5('0x36'));_0x10018a[_0xfea5('0x3d')]=_[_0xfea5('0x3e')](_0x397b48[_0xfea5('0x3d')]);_0x10018a['filters']=_[_0xfea5('0x3f')](_0x10018a[_0xfea5('0x3b')],_0x10018a[_0xfea5('0x3d')]);_0x3d73ee[_0xfea5('0x40')]=_[_0xfea5('0x3f')](_0x10018a['model'],qs[_0xfea5('0x41')](_0x397b48['query']['fields']));_0x3d73ee[_0xfea5('0x40')]=_0x3d73ee[_0xfea5('0x40')][_0xfea5('0x42')]?_0x3d73ee['attributes']:_0x10018a['model'];if(!_0x397b48[_0xfea5('0x3d')]['hasOwnProperty'](_0xfea5('0x43'))){_0x3d73ee[_0xfea5('0x2f')]=qs[_0xfea5('0x2f')](_0x397b48[_0xfea5('0x3d')][_0xfea5('0x2f')]);_0x3d73ee[_0xfea5('0x2e')]=qs['offset'](_0x397b48['query']['offset']);}_0x3d73ee[_0xfea5('0x44')]=qs[_0xfea5('0x45')](_0x397b48[_0xfea5('0x3d')]['sort']);_0x3d73ee[_0xfea5('0x46')]=qs[_0xfea5('0x47')](_[_0xfea5('0x48')](_0x397b48[_0xfea5('0x3d')],_0x10018a['filters']));if(_0x397b48[_0xfea5('0x3d')][_0xfea5('0x49')]){_0x3d73ee[_0xfea5('0x46')]=_[_0xfea5('0x4a')](_0x3d73ee[_0xfea5('0x46')],{'$or':_['map'](_0x2e11e8,function(_0x479b59){if(_0x479b59[_0xfea5('0x39')]!==_0xfea5('0x4b')){var _0x36d499={};_0x36d499[_0x479b59[_0xfea5('0x36')]]={'$like':'%'+_0x397b48[_0xfea5('0x3d')]['filter']+'%'};return _0x36d499;}})});}_0x3d73ee=_[_0xfea5('0x4a')]({},_0x3d73ee,_0x397b48['options']);var _0x5d6f65={'where':_0x3d73ee[_0xfea5('0x46')]};return db[_0xfea5('0x4c')]['count'](_0x5d6f65)[_0xfea5('0x20')](function(_0x359a59){_0x5b1770['count']=_0x359a59;if(_0x397b48['query'][_0xfea5('0x4d')]){_0x3d73ee['include']=[{'all':!![]}];}return db['SmsMessage'][_0xfea5('0x4e')](_0x3d73ee);})[_0xfea5('0x20')](function(_0x399e50){_0x5b1770[_0xfea5('0x4f')]=_0x399e50;return _0x5b1770;})[_0xfea5('0x20')](respondWithFilteredResult(_0x4653e2,_0x3d73ee))[_0xfea5('0x2a')](handleError(_0x4653e2,null));};exports[_0xfea5('0x50')]=function(_0x4f6c86,_0x24c22f){var _0x12f043={'raw':!![],'where':{'id':_0x4f6c86[_0xfea5('0x51')]['id']}},_0x56f1bc={};_0x56f1bc['model']=_[_0xfea5('0x3e')](db[_0xfea5('0x4c')][_0xfea5('0x52')]);_0x56f1bc[_0xfea5('0x3d')]=_[_0xfea5('0x3e')](_0x4f6c86[_0xfea5('0x3d')]);_0x56f1bc[_0xfea5('0x47')]=_[_0xfea5('0x3f')](_0x56f1bc['model'],_0x56f1bc[_0xfea5('0x3d')]);_0x12f043[_0xfea5('0x40')]=_['intersection'](_0x56f1bc[_0xfea5('0x3b')],qs[_0xfea5('0x41')](_0x4f6c86['query'][_0xfea5('0x41')]));_0x12f043[_0xfea5('0x40')]=_0x12f043[_0xfea5('0x40')][_0xfea5('0x42')]?_0x12f043['attributes']:_0x56f1bc[_0xfea5('0x3b')];if(_0x4f6c86[_0xfea5('0x3d')][_0xfea5('0x4d')]){_0x12f043[_0xfea5('0x53')]=[{'all':!![]}];}_0x12f043=_['merge']({},_0x12f043,_0x4f6c86[_0xfea5('0x54')]);return db[_0xfea5('0x4c')][_0xfea5('0x55')](_0x12f043)[_0xfea5('0x20')](handleEntityNotFound(_0x24c22f,null))[_0xfea5('0x20')](respondWithResult(_0x24c22f,null))[_0xfea5('0x2a')](handleError(_0x24c22f,null));};exports[_0xfea5('0x56')]=function(_0x5cccd1,_0x47439a){return db[_0xfea5('0x4c')][_0xfea5('0x56')](_0x5cccd1[_0xfea5('0x57')],{})[_0xfea5('0x20')](respondWithResult(_0x47439a,0xc9))[_0xfea5('0x2a')](handleError(_0x47439a,null));};exports['update']=function(_0x1b1262,_0x323742){if(_0x1b1262['body']['id']){delete _0x1b1262[_0xfea5('0x57')]['id'];}return db[_0xfea5('0x4c')][_0xfea5('0x55')]({'where':{'id':_0x1b1262[_0xfea5('0x51')]['id']}})[_0xfea5('0x20')](handleEntityNotFound(_0x323742,null))[_0xfea5('0x20')](saveUpdates(_0x1b1262['body'],null))['then'](respondWithResult(_0x323742,null))['catch'](handleError(_0x323742,null));};exports[_0xfea5('0x58')]=function(_0x30556b,_0x5b4fc2){return db[_0xfea5('0x4c')][_0xfea5('0x55')]({'where':{'id':_0x30556b['params']['id']}})[_0xfea5('0x20')](handleEntityNotFound(_0x5b4fc2,null))[_0xfea5('0x20')](removeEntity(_0x5b4fc2,null))['catch'](handleError(_0x5b4fc2,null));};exports[_0xfea5('0x59')]=function(_0x4a2c66,_0x4fe95d){return db[_0xfea5('0x4c')][_0xfea5('0x59')]()[_0xfea5('0x20')](respondWithResult(_0x4fe95d,null))[_0xfea5('0x2a')](handleError(_0x4fe95d,null));};var interaction_log=require(_0xfea5('0x11'))(_0xfea5('0x5a'));exports[_0xfea5('0x5b')]=function(_0x33ca47,_0x178dbe,_0x3c56ed){var _0x4a8508={'channel':_0xfea5('0x5c')};if(_0x33ca47['body']['id']){delete _0x33ca47[_0xfea5('0x57')]['id'];}_0x33ca47[_0xfea5('0x57')][_0xfea5('0x5d')]=!![];_0x33ca47[_0xfea5('0x57')]['readAt']=moment()['format'](_0xfea5('0x5e'));_0x33ca47['body'][_0xfea5('0x5f')]=_0x33ca47[_0xfea5('0x57')]['UserId']||_0x33ca47[_0xfea5('0x60')]['id'];return db[_0xfea5('0x4c')]['find']({'where':{'id':_0x33ca47[_0xfea5('0x51')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xfea5('0x20')](handleEntityNotFound(_0x178dbe,null))['then'](saveUpdates(_0x33ca47[_0xfea5('0x57')],null))[_0xfea5('0x20')](function(_0x4a2351){if(_0x4a2351){_0x4a8508[_0xfea5('0x28')]=_0x4a2351[_0xfea5('0x61')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x4a2351[_0xfea5('0x62')]}});}return null;})[_0xfea5('0x20')](handleEntityNotFound(_0x178dbe,null))['then'](function(_0x4aca09){if(_0x4aca09){return _0x4aca09[_0xfea5('0x63')]({'UserId':_0x33ca47['body'][_0xfea5('0x5f')],'read1stAt':_['isNil'](_0x4aca09[_0xfea5('0x64')])?moment()['format'](_0xfea5('0x5e')):undefined});}return null;})[_0xfea5('0x20')](function(_0x5dfc2c){if(_0x5dfc2c){_0x4a8508[_0xfea5('0x65')]=_0x5dfc2c[_0xfea5('0x61')]({'plain':!![]});interaction_log[_0xfea5('0x66')](_0xfea5('0x67'),_0x33ca47[_0xfea5('0x60')]['id'],_0x33ca47[_0xfea5('0x60')][_0xfea5('0x36')],_0x33ca47[_0xfea5('0x60')][_0xfea5('0x68')],_0x4a8508[_0xfea5('0x65')]['id'],_0x33ca47[_0xfea5('0x57')]?JSON[_0xfea5('0x25')](_0x33ca47[_0xfea5('0x57')]):_0xfea5('0x69'));return respondWithRpcPromise(_0xfea5('0x6a'),_0xfea5('0x6b'),_0x4a8508);}return null;})[_0xfea5('0x20')](function(_0x1a861d){if(_0x1a861d){if(_0x33ca47[_0xfea5('0x57')]['manual']){_0x4a8508['message'][_0xfea5('0x6c')]=util[_0xfea5('0x6d')](_0xfea5('0x6e'),_0x33ca47[_0xfea5('0x60')]['name']);_0x4a8508[_0xfea5('0x28')][_0xfea5('0x6f')]=_0x4a8508[_0xfea5('0x6f')];_0x4a8508[_0xfea5('0x28')][_0xfea5('0x70')]=_0xfea5('0x5b');return respondWithRpcPromise(_0xfea5('0x71'),'EventManager',{'event':'acceptmessage','message':_0x4a8508[_0xfea5('0x28')]},client9002)['then'](function(){return _0x4a8508;});}return _0x4a8508;}return null;})[_0xfea5('0x20')](respondWithResult(_0x178dbe,null))[_0xfea5('0x2a')](handleError(_0x178dbe,null));};var interaction_log=require('../../config/logger')(_0xfea5('0x5a'));exports[_0xfea5('0x33')]=function(_0x5c0564,_0x3bc8cc,_0x208517){var _0x593c3c={'agent':{},'channel':_0xfea5('0x5c')};if(_0x5c0564[_0xfea5('0x57')]['id']){delete _0x5c0564[_0xfea5('0x57')]['id'];}_0x5c0564[_0xfea5('0x57')][_0xfea5('0x5f')]=_0x5c0564[_0xfea5('0x57')][_0xfea5('0x5f')]||_0x5c0564[_0xfea5('0x60')]['id'];_0x593c3c['agent']['id']=_0x5c0564[_0xfea5('0x57')][_0xfea5('0x5f')];return db[_0xfea5('0x4c')][_0xfea5('0x55')]({'where':{'id':_0x5c0564[_0xfea5('0x51')]['id'],'UserId':null}})[_0xfea5('0x20')](handleEntityNotFound(_0x3bc8cc,null))[_0xfea5('0x20')](function(_0x2ef7de){if(_0x2ef7de){_0x593c3c['message']=_0x2ef7de[_0xfea5('0x61')]({'plain':!![]});return db[_0xfea5('0x72')][_0xfea5('0x55')]({'where':{'id':_0x2ef7de[_0xfea5('0x62')]}});}return null;})[_0xfea5('0x20')](handleEntityNotFound(_0x3bc8cc,null))[_0xfea5('0x20')](function(_0x447612){if(_0x447612){_0x593c3c[_0xfea5('0x65')]=_0x447612[_0xfea5('0x61')]({'plain':!![]});interaction_log[_0xfea5('0x66')](_0xfea5('0x73'),_0x5c0564[_0xfea5('0x60')]['id'],_0x5c0564['user'][_0xfea5('0x36')],_0x5c0564['user'][_0xfea5('0x68')],_0x593c3c[_0xfea5('0x65')]['id'],_0x5c0564[_0xfea5('0x57')]?JSON[_0xfea5('0x25')](_0x5c0564[_0xfea5('0x57')]):_0xfea5('0x69'));return respondWithRpcPromise(_0xfea5('0x74'),_0xfea5('0x75'),_0x593c3c);}return null;})[_0xfea5('0x20')](function(_0x9d76a6){if(_0x9d76a6){_0x9d76a6['message'][_0xfea5('0x6c')]=util[_0xfea5('0x6d')](_0xfea5('0x6e'),_0x5c0564[_0xfea5('0x60')]['name']);_0x9d76a6[_0xfea5('0x28')][_0xfea5('0x6f')]=_0x593c3c[_0xfea5('0x6f')];_0x9d76a6['message'][_0xfea5('0x70')]=_0xfea5('0x33');respondWithRpcPromise('EventManager','EventManager',{'event':_0xfea5('0x76'),'message':_0x9d76a6[_0xfea5('0x28')]},client9002);return _0x593c3c;}return null;})['then'](respondWithResult(_0x3bc8cc,null))['catch'](handleError(_0x3bc8cc,null));};exports[_0xfea5('0x30')]=function(_0x148198,_0x243a11,_0x93bd9e){if(_0x148198[_0xfea5('0x57')]['id']){delete _0x148198[_0xfea5('0x57')]['id'];}var _0xf7f62f;return db[_0xfea5('0x4c')][_0xfea5('0x55')]({'where':{'id':_0x148198[_0xfea5('0x51')]['id']}})[_0xfea5('0x20')](handleEntityNotFound(_0x243a11,null))[_0xfea5('0x20')](function(_0x201ee6){if(_0x201ee6){_0xf7f62f=_0x201ee6;return db['SmsAccount'][_0xfea5('0x55')]({'where':{'id':_0x201ee6[_0xfea5('0x77')]}});}})[_0xfea5('0x20')](handleEntityNotFound(_0x243a11,null))[_0xfea5('0x20')](function(_0x5c3e59){if(_0x5c3e59){logger[_0xfea5('0x23')](_0xfea5('0x24'),'status',_0xfea5('0x78'),_0x5c3e59[_0xfea5('0x39')],util['inspect'](_0x148198[_0xfea5('0x57')],{'showHidden':![],'depth':null}));switch(_0x5c3e59[_0xfea5('0x39')]){case _0xfea5('0x79'):if(_0x148198['body'][_0xfea5('0x7a')]&&_0x148198['body']['MessageSid']===_0xf7f62f['messageId']){return _0xf7f62f[_0xfea5('0x63')]({'read':!![]});}else{logger[_0xfea5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfea5('0x30'),_0xfea5('0x79'),util[_0xfea5('0x7b')](_0x148198[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x7c'):if(_0x148198['body'][_0xfea5('0x7d')]&&_0x148198[_0xfea5('0x57')][_0xfea5('0x7d')]===_0xf7f62f['messageId']&&_[_0xfea5('0x7e')]([_0xfea5('0x7f'),_0xfea5('0x80')],_0x148198[_0xfea5('0x57')][_0xfea5('0x81')])>=0x0){return _0xf7f62f['update']({'read':!![]});}else{logger[_0xfea5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfea5('0x30'),_0xfea5('0x82'),util[_0xfea5('0x7b')](_0x148198[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x83'):var _0x1faa7f=_0x148198[_0xfea5('0x57')][_0xfea5('0x84')][0x0];if(_0x1faa7f['status'][_0xfea5('0x85')]===_0xfea5('0x86')){return _0xf7f62f[_0xfea5('0x63')]({'read':!![]});}else{logger[_0xfea5('0x26')](_0xfea5('0x87'),_0xfea5('0x30'),'infobip',util[_0xfea5('0x7b')](_0x148198[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;}return _0xf7f62f;}})[_0xfea5('0x20')](respondWithResult(_0x243a11,null))[_0xfea5('0x2a')](handleError(_0x243a11,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 1fc52f7..48766db 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 _0xaa47=['hasOwnProperty','hook','exports','events','SmsMessage','setMaxListeners','save','remove','emit'];(function(_0x4a283b,_0x41b433){var _0x353623=function(_0xef951f){while(--_0xef951f){_0x4a283b['push'](_0x4a283b['shift']());}};_0x353623(++_0x41b433);}(_0xaa47,0x13e));var _0x7aa4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xaa47[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x7aa4('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x7aa4('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7aa4('0x2')](0x0);var events={'afterCreate':_0x7aa4('0x3'),'afterUpdate':'update','afterDestroy':_0x7aa4('0x4')};function emitEvent(_0x1ec4c3){return function(_0x3574c2,_0x464174,_0x183eb3){SmsMessageEvents[_0x7aa4('0x5')](_0x1ec4c3+':'+_0x3574c2['id'],_0x3574c2);SmsMessageEvents[_0x7aa4('0x5')](_0x1ec4c3,_0x3574c2);_0x183eb3(null);};}for(var e in events){if(events[_0x7aa4('0x6')](e)){var event=events[e];SmsMessage[_0x7aa4('0x7')](e,emitEvent(event));}}module[_0x7aa4('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x39a9=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x116b8e,_0x1da172){var _0x3a884b=function(_0x15a3fe){while(--_0x15a3fe){_0x116b8e['push'](_0x116b8e['shift']());}};_0x3a884b(++_0x1da172);}(_0x39a9,0x8b));var _0x939a=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0x39a9[_0x22dac7];return _0x3e6cfa;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x939a('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x939a('0x1'),'afterDestroy':_0x939a('0x2')};function emitEvent(_0x31bd26){return function(_0x34ab45,_0x861c76,_0x45e5ac){SmsMessageEvents['emit'](_0x31bd26+':'+_0x34ab45['id'],_0x34ab45);SmsMessageEvents[_0x939a('0x3')](_0x31bd26,_0x34ab45);_0x45e5ac(null);};}for(var e in events){if(events[_0x939a('0x4')](e)){var event=events[e];SmsMessage[_0x939a('0x5')](e,emitEvent(event));}}module[_0x939a('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index ccc0fd0..6750488 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 _0xad1e=['head','data','messages','read','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','sort','length','md5','hex','signature=','/external/get/send.php?','keys','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','Bearer\x20','message','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','toLowerCase','direction','out','secret','isNil','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','SmsAccount','find','type','twilio','accountSid','authToken','phone','create','remote','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','session_key','internal_order_id','deliveryReport','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','base64','http_code','queued_count'];(function(_0x390b11,_0x438ced){var _0x23b3f8=function(_0x1f0296){while(--_0x1f0296){_0x390b11['push'](_0x390b11['shift']());}};_0x23b3f8(++_0x438ced);}(_0xad1e,0x12c));var _0xead1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xad1e[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xead1('0x0'));var util=require(_0xead1('0x1'));var logger=require(_0xead1('0x2'))(_0xead1('0x3'));var moment=require(_0xead1('0x4'));var BPromise=require(_0xead1('0x5'));var rp=require(_0xead1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xead1('0x7'));var config=require(_0xead1('0x8'));var attributes=require(_0xead1('0x9'));module[_0xead1('0xa')]=function(_0x2d4199,_0x514fa5){return _0x2d4199[_0xead1('0xb')](_0xead1('0xc'),attributes,{'tableName':_0xead1('0xd'),'paranoid':![],'indexes':[{'name':_0xead1('0xe'),'fields':[_0xead1('0xe')]},{'name':_0xead1('0xf'),'fields':[_0xead1('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xe0fdb1,_0x54900c,_0x58359e){var _0x283bd8=_0x2d4199[_0xead1('0x11')];var _0x3e634c=_0xe0fdb1[_0xead1('0x12')]({'plain':!![]});if(_0x3e634c['direction'][_0xead1('0x13')]()==='in'||_0x3e634c[_0xead1('0x14')][_0xead1('0x13')]()===_0xead1('0x15')&&!_0x3e634c[_0xead1('0x16')]&&!_[_0xead1('0x17')](_0x3e634c['UserId'])){_0x283bd8[_0xead1('0x18')][_0xead1('0x19')]({'where':{'id':_0x3e634c[_0xead1('0x1a')]}})[_0xead1('0x1b')](function(_0xb212e2){if(_0xb212e2){_0xb212e2[_0xead1('0x1c')]({'lastMsgAt':_0x3e634c[_0xead1('0x1d')],'lastMsgDirection':_0x3e634c[_0xead1('0x14')][_0xead1('0x13')]()});}})['catch'](function(_0x1df3f9){console['error'](_0x1df3f9);});}if(_0x3e634c[_0xead1('0x14')]===_0xead1('0x15')&&!_0x3e634c['secret']){var _0x37205b;_0x283bd8[_0xead1('0x1e')][_0xead1('0x1f')]({'where':{'id':_0x3e634c['SmsAccountId']},'raw':!![]})[_0xead1('0x1b')](function(_0x329f08){_0x37205b=_0x329f08;if(_0x37205b&&_0x37205b[_0xead1('0x20')]){switch(_0x37205b[_0xead1('0x20')]){case'twilio':var _0x2097fa=require(_0xead1('0x21'));if(_0x37205b[_0xead1('0x22')]&&_0x37205b[_0xead1('0x23')]&&_0x37205b[_0xead1('0x24')]){var _0x421271=new _0x2097fa(_0x37205b[_0xead1('0x22')],_0x37205b[_0xead1('0x23')]);_0x421271['messages'][_0xead1('0x25')]({'body':_0x3e634c[_0xead1('0x10')],'to':_0x3e634c[_0xead1('0x24')],'from':_0x37205b['phone'],'statusCallback':_0x37205b[_0xead1('0x26')]+'/api/sms/messages/'+_0x3e634c['id']+_0xead1('0x27')+_0x37205b[_0xead1('0x28')]})['then'](function(_0x434cfc){if(_0x434cfc[_0xead1('0x29')]){return _0xe0fdb1['update']({'messageId':_0x434cfc[_0xead1('0x29')]});}})[_0xead1('0x2a')](function(_0x28ea1d){logger['error'](_0xead1('0x2b'),_0xead1('0x2c'),'twilio',util[_0xead1('0x2d')](_0x28ea1d,{'showHidden':![],'depth':null}));});}else{logger[_0xead1('0x2e')](_0xead1('0x2b'),_0xead1('0x2c'),'twilio',_0xead1('0x2f'));}break;case _0xead1('0x30'):var _0x413549='https://api.skebby.it/API/v1.0/REST/';if(_0x37205b[_0xead1('0x31')]&&_0x37205b[_0xead1('0x32')]){var _0x32b9fd={'recipient':[_0x3e634c[_0xead1('0x24')]],'message':_0x3e634c[_0xead1('0x10')],'message_type':_0x37205b[_0xead1('0x33')]};if(_0x37205b['smsMethod']&&_0x37205b['smsMethod']!=='SI'){_0x32b9fd[_0xead1('0x34')]=_0x37205b[_0xead1('0x24')];}var _0xd498ba={'url':_0x413549+_0xead1('0x35')+_0x37205b[_0xead1('0x31')]+_0xead1('0x36')+_0x37205b['password'],'method':_0xead1('0x37')};rp(_0xd498ba)['then'](function(_0x3d678b){var _0x561918=_0x3d678b[_0xead1('0x38')](';');var _0x55e6f5={'user_key':_0x561918[0x0],'session_key':_0x561918[0x1]};_0xd498ba={'url':_0x413549+_0xead1('0x39'),'method':_0xead1('0x3a'),'headers':{'user_key':_0x55e6f5['user_key'],'Session_key':_0x55e6f5[_0xead1('0x3b')]},'json':!![],'body':_0x32b9fd};return rp(_0xd498ba);})[_0xead1('0x1b')](function(_0xc19e4b){if(_0xc19e4b['total_sent']>=0x1){var _0x11ffc6={'messageId':_0xc19e4b[_0xead1('0x3c')]};if(_0x37205b[_0xead1('0x33')]!=='GP'||!_0x37205b[_0xead1('0x3d')]){_0x11ffc6['read']=!![];}return _0xe0fdb1[_0xead1('0x1c')](_0x11ffc6);}else{return logger['error'](_0xead1('0x2b'),_0xead1('0x2c'),_0xead1('0x30'),util[_0xead1('0x2d')](_0xc19e4b,{'showHidden':![],'depth':null}));}})[_0xead1('0x2a')](function(_0x232cce){return logger[_0xead1('0x2e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xead1('0x2c'),'skebby',util['inspect'](_0x232cce,{'showHidden':![],'depth':null}));});}else{logger[_0xead1('0x2e')](_0xead1('0x2b'),'afterCreate',_0xead1('0x30'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xead1('0x3e'):if(_0x37205b['authToken']){var _0x5f30a2={'recipient':_0x3e634c['phone'],'message':_0x3e634c[_0xead1('0x10')],'sender':_0x37205b[_0xead1('0x3f')]||_0x37205b['phone'],'authorization':_0x37205b[_0xead1('0x23')]};var _0x54900c={'method':_0xead1('0x3a'),'uri':_0xead1('0x40'),'body':_0x5f30a2,'json':!![]};rp(_0x54900c)['then'](function(_0x50107f){var _0x13cdf6={'messageId':_0x50107f[_0xead1('0x41')]};if(!_0x37205b[_0xead1('0x3d')]){_0x13cdf6['read']=!![];}return _0xe0fdb1[_0xead1('0x1c')](_0x13cdf6);})[_0xead1('0x2a')](function(_0x37a9b7){logger['error'](_0xead1('0x2b'),'afterCreate','connectel',util[_0xead1('0x2d')](_0x37a9b7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xead1('0x2b'),_0xead1('0x2c'),'connectel',_0xead1('0x42'));}break;case _0xead1('0x43'):if(_0x37205b[_0xead1('0x31')]&&_0x37205b[_0xead1('0x32')]){var _0x5f30a2={'messages':[{'source':_0xead1('0x44'),'to':_0x3e634c['phone'],'body':_0x3e634c[_0xead1('0x10')],'from':_0x37205b[_0xead1('0x3f')]||_0x37205b[_0xead1('0x24')]}]};var _0x3ec804=util[_0xead1('0x45')](_0xead1('0x46'),_0x37205b[_0xead1('0x31')],_0x37205b['password']);var _0x54900c={'method':_0xead1('0x3a'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x5f30a2,'headers':{'Authorization':util[_0xead1('0x45')](_0xead1('0x47'),new Buffer(_0x3ec804)['toString'](_0xead1('0x48')))},'json':!![]};rp(_0x54900c)[_0xead1('0x1b')](function(_0xba1e0){if(_0xba1e0[_0xead1('0x49')]>=0xc8&&_0xba1e0[_0xead1('0x49')]<=0xce){if(_0xba1e0['data']&&_0xba1e0['data'][_0xead1('0x4a')]>0x0){var _0x1a8302=_[_0xead1('0x4b')](_0xba1e0[_0xead1('0x4c')][_0xead1('0x4d')]);var _0x3f595f={'messageId':_0x1a8302['message_id']};if(!_0x37205b['deliveryReport']){_0x3f595f[_0xead1('0x4e')]=!![];}return _0xe0fdb1[_0xead1('0x1c')](_0x3f595f);}else{logger['error'](_0xead1('0x2b'),_0xead1('0x2c'),_0xead1('0x4f'),util[_0xead1('0x2d')](_0xba1e0,{'showHidden':![],'depth':null}));}}else{logger[_0xead1('0x2e')](_0xead1('0x2b'),_0xead1('0x2c'),_0xead1('0x4f'),util['inspect'](_0xba1e0,{'showHidden':![],'depth':null}));}})['catch'](function(_0x732293){logger[_0xead1('0x2e')](_0xead1('0x2b'),'afterCreate','clickSend',util[_0xead1('0x2d')](_0x732293,{'showHidden':![],'depth':null}));});}else{logger[_0xead1('0x2e')](_0xead1('0x2b'),'afterCreate',_0xead1('0x4f'),_0xead1('0x50'));}break;case _0xead1('0x51'):if(_0x37205b[_0xead1('0x52')]&&_0x37205b[_0xead1('0x23')]){var _0x5f30a2={'dst':_0x3e634c[_0xead1('0x24')],'text':_0x3e634c['body'],'src':_0x37205b[_0xead1('0x3f')]||_0x37205b['phone'],'url':_0x37205b[_0xead1('0x26')]+'/api/sms/messages/'+_0x3e634c['id']+_0xead1('0x27')+_0x37205b['token']};var _0x3ec804=util[_0xead1('0x45')](_0xead1('0x46'),_0x37205b['authId'],_0x37205b['authToken']);var _0x54900c={'method':_0xead1('0x3a'),'uri':util[_0xead1('0x45')](_0xead1('0x53'),_0x37205b[_0xead1('0x52')]),'body':_0x5f30a2,'headers':{'Authorization':util[_0xead1('0x45')](_0xead1('0x47'),new Buffer(_0x3ec804)[_0xead1('0x54')](_0xead1('0x48')))},'json':!![]};rp(_0x54900c)[_0xead1('0x1b')](function(_0x4b1691){var _0x52c300={'messageId':_0x4b1691[_0xead1('0x55')][0x0]};return _0xe0fdb1[_0xead1('0x1c')](_0x52c300);})[_0xead1('0x2a')](function(_0x389aa1){logger[_0xead1('0x2e')](_0xead1('0x2b'),'afterCreate',_0xead1('0x51'),util[_0xead1('0x2d')](_0x389aa1,{'showHidden':![],'depth':null}));});}else{logger[_0xead1('0x2e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xead1('0x2c'),_0xead1('0x51'),_0xead1('0x56'));}break;case'infobip':if(_0x37205b[_0xead1('0x31')]&&_0x37205b['password']){if(_0x37205b[_0xead1('0x57')]){var _0x2c5166={'method':_0xead1('0x3a'),'uri':_0x37205b[_0xead1('0x57')]+_0xead1('0x58'),'body':{'username':_0x37205b[_0xead1('0x31')],'password':_0x37205b[_0xead1('0x32')]},'json':!![]};return rp(_0x2c5166)[_0xead1('0x1b')](function(_0x338119){var _0x139273={'method':_0xead1('0x3a'),'uri':_0x37205b['baseUrl']+_0xead1('0x59'),'body':{'messages':[{'from':_0x37205b[_0xead1('0x24')],'destinations':[{'to':_0x3e634c[_0xead1('0x24')]}],'text':_0x3e634c[_0xead1('0x10')],'notifyUrl':_0x37205b['remote']+'/api/sms/messages/'+_0x3e634c['id']+_0xead1('0x27')+_0x37205b[_0xead1('0x28')],'notifyContentType':_0xead1('0x5a'),'callbackData':_0x37205b[_0xead1('0x24')]+';'+_0x3e634c['body']}]},'headers':{'Authorization':_0xead1('0x5b')+_0x338119[_0xead1('0x28')]},'json':!![]};return rp(_0x139273)[_0xead1('0x1b')](function(_0x3f809f){if(_0x3f809f[_0xead1('0x4d')]){var _0x24e58c={'messageId':_0x3f809f['messages'][0x0][_0xead1('0xe')]};if(!_0x37205b[_0xead1('0x3d')]){_0x24e58c[_0xead1('0x4e')]=!![];}return _0xe0fdb1[_0xead1('0x1c')](_0x24e58c);}else{return logger[_0xead1('0x2e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xead1('0x2c'),_0xead1('0x5c'),util['inspect'](_0x3f809f,{'showHidden':![],'depth':null}));}});})[_0xead1('0x2a')](function(_0x157b18){return logger[_0xead1('0x2e')](_0xead1('0x2b'),_0xead1('0x2c'),'infobip',util['inspect'](_0x157b18,{'showHidden':![],'depth':null}));});}else{logger[_0xead1('0x2e')](_0xead1('0x2b'),_0xead1('0x2c'),_0xead1('0x5c'),_0xead1('0x5d'));}}else{logger['error'](_0xead1('0x2b'),_0xead1('0x2c'),'infobip',_0xead1('0x50'));}break;case'csc':var _0x1f09eb=require(_0xead1('0x5e'));if(_0x37205b[_0xead1('0x5f')]){var _0x9b789={};_0x9b789[_0xead1('0x60')]=_0x37205b[_0xead1('0x31')];_0x9b789[_0xead1('0x24')]=_0x3e634c['phone'];_0x9b789[_0xead1('0x34')]=_0x37205b[_0xead1('0x24')];_0x9b789[_0xead1('0x61')]=_0x3e634c['body'];_0x9b789[_0xead1('0x62')]=+new Date();var _0x5b267d='';var _0x41389f='';var _0x481cdc=Object['keys'](_0x9b789);_0x481cdc[_0xead1('0x63')]();for(var _0x12283b=0x0;_0x12283b<_0x481cdc[_0xead1('0x64')];_0x12283b++){if(_0x5b267d!=''){_0x5b267d+='&';}_0x5b267d+=_0x481cdc[_0x12283b]+'='+encodeURIComponent(_0x9b789[_0x481cdc[_0x12283b]]);_0x41389f+=_0x9b789[_0x481cdc[_0x12283b]];}_0x41389f+=_0x37205b[_0xead1('0x5f')];_0x41389f=_0x1f09eb['createHash'](_0xead1('0x65'))[_0xead1('0x1c')](_0x41389f)['digest'](_0xead1('0x66'));if(_0x5b267d!==''){_0x5b267d+='&';}_0x5b267d+=_0xead1('0x67')+_0x41389f;var _0xd498ba={'method':_0xead1('0x37'),'uri':_0x37205b[_0xead1('0x57')]+_0xead1('0x68')+_0x5b267d,'json':!![]};return rp(_0xd498ba)[_0xead1('0x1b')](function(_0x264b7a){var _0xc2e207=Object[_0xead1('0x69')](_0x264b7a);if(_0x264b7a[_0xc2e207[0x0]][_0xead1('0x2e')]&&parseInt(_0x264b7a[_0xc2e207[0x0]]['error'])===0x0){var _0x2aba6d={'messageId':_0x264b7a[_0xc2e207[0x0]][_0xead1('0x6a')]};if(!_0x37205b[_0xead1('0x3d')]){_0x2aba6d[_0xead1('0x4e')]=!![];}return _0xe0fdb1[_0xead1('0x1c')](_0x2aba6d);}else{return logger[_0xead1('0x2e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xead1('0x2c'),_0xead1('0x6b'),util[_0xead1('0x2d')](_0x264b7a[_0xead1('0x2e')],{'showHidden':![],'depth':null}));}})[_0xead1('0x2a')](function(_0x3121a2){return logger[_0xead1('0x2e')](_0xead1('0x2b'),_0xead1('0x2c'),_0xead1('0x6b'),util[_0xead1('0x2d')](_0x3121a2,{'showHidden':![],'depth':null}));});}else{logger[_0xead1('0x2e')](_0xead1('0x2b'),'afterCreate',_0xead1('0x6b'),_0xead1('0x6c'));}break;case _0xead1('0x6d'):if(_0x37205b[_0xead1('0x5f')]){var _0x21fefc={'method':_0xead1('0x3a'),'uri':_0xead1('0x6e'),'headers':{'Authorization':_0x37205b[_0xead1('0x5f')]},'body':{'content':_0x3e634c[_0xead1('0x10')],'to':[_0x3e634c[_0xead1('0x24')]],'from':_0x37205b[_0xead1('0x24')],'binary':![],'clientMessageId':_0xead1('0x6f'),'charset':_0xead1('0x70')},'json':!![]};rp(_0x21fefc)[_0xead1('0x1b')](function(_0x59d26a){if(!_0x59d26a['error']){var _0x10d6d2={'messageId':_0x59d26a[_0xead1('0x4d')][0x0][_0xead1('0x71')]};if(!_0x37205b[_0xead1('0x3d')]){_0x10d6d2[_0xead1('0x4e')]=!![];}return _0xe0fdb1[_0xead1('0x1c')](_0x10d6d2);}else{return logger[_0xead1('0x2e')](_0xead1('0x2b'),'afterCreate',_0xead1('0x6d'),util['inspect'](_0x59d26a[_0xead1('0x2e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3592e9){return logger[_0xead1('0x2e')](_0xead1('0x2b'),'afterCreate','clickatell',util[_0xead1('0x2d')](_0x3592e9,{'showHidden':![],'depth':null}));});}else{logger[_0xead1('0x2e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xead1('0x2c'),_0xead1('0x6d'),_0xead1('0x6c'));}break;case _0xead1('0x72'):if(_0x37205b['apiKey']){var _0x5bf5c0={};var _0xd498ba={'method':_0xead1('0x3a'),'uri':_0xead1('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x37205b[_0xead1('0x5f')],'Content-Type':_0xead1('0x5a')},'body':{'from':_0x37205b[_0xead1('0x24')],'to':_0x3e634c[_0xead1('0x24')],'text':_0x3e634c['body']},'json':!![]};return rp(_0xd498ba)[_0xead1('0x1b')](function(_0x33d0b9){if(_0x33d0b9[_0xead1('0x74')]==0xca){_0x5bf5c0['message']=_0x33d0b9;var _0x2e22f7={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xead1('0x75')+_0x37205b[_0xead1('0x5f')],'Content-Type':_0xead1('0x5a')},'body':{'refid':_0x5bf5c0[_0xead1('0x76')][_0xead1('0x77')]},'json':!![]};return rp(_0x2e22f7)[_0xead1('0x1b')](function(_0x49c319){_0x5bf5c0[_0xead1('0x78')]=_0x49c319;var _0x5b9db5={'messageId':_0x5bf5c0[_0xead1('0x76')]['refid'],'read':!![]};return _0xe0fdb1[_0xead1('0x1c')](_0x5b9db5);});}else{return logger[_0xead1('0x2e')](_0xead1('0x2b'),_0xead1('0x2c'),'intelepeer',util[_0xead1('0x2d')](_0x33d0b9,{'showHidden':![],'depth':null}));}})['catch'](function(_0xd0d630){return logger[_0xead1('0x2e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xead1('0x2c'),_0xead1('0x72'),util[_0xead1('0x2d')](_0xd0d630,{'showHidden':![],'depth':null}));});}else{return logger[_0xead1('0x2e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xead1('0x2c'),'intelepeer',_0xead1('0x79'));}break;}}})[_0xead1('0x7a')](function(){_0x58359e();});}else{_0x58359e();}}},'charset':_0xead1('0x7b'),'collate':_0xead1('0x7c')});}; \ No newline at end of file +var _0x0028=['message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','IBSSO\x20','csc','crypto','apiKey','login','text','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','./smsMessage.attributes','exports','sms_messages','messageId','fti_sms_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','createdAt','catch','error','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/api/sms/messages/','/status?token=','token','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','deliveryReport','skebby','inspect','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','base64','http_code','data','head','read','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','toString'];(function(_0x2b72fc,_0x2b539a){var _0x250040=function(_0x30331c){while(--_0x30331c){_0x2b72fc['push'](_0x2b72fc['shift']());}};_0x250040(++_0x2b539a);}(_0x0028,0x193));var _0x8002=function(_0x1ecae9,_0x3d5fb9){_0x1ecae9=_0x1ecae9-0x0;var _0x5518e1=_0x0028[_0x1ecae9];return _0x5518e1;};'use strict';var _=require(_0x8002('0x0'));var util=require(_0x8002('0x1'));var logger=require(_0x8002('0x2'))(_0x8002('0x3'));var moment=require(_0x8002('0x4'));var BPromise=require(_0x8002('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8002('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8002('0x7'));module[_0x8002('0x8')]=function(_0x1e90e3,_0x538e8c){return _0x1e90e3['define']('SmsMessage',attributes,{'tableName':_0x8002('0x9'),'paranoid':![],'indexes':[{'name':_0x8002('0xa'),'fields':[_0x8002('0xa')]},{'name':_0x8002('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a34ab,_0x49da63,_0x188949){var _0x29d418=_0x1e90e3[_0x8002('0xc')];var _0x413568=_0x2a34ab[_0x8002('0xd')]({'plain':!![]});if(_0x413568[_0x8002('0xe')][_0x8002('0xf')]()==='in'||_0x413568[_0x8002('0xe')][_0x8002('0xf')]()===_0x8002('0x10')&&!_0x413568[_0x8002('0x11')]&&!_[_0x8002('0x12')](_0x413568[_0x8002('0x13')])){_0x29d418[_0x8002('0x14')][_0x8002('0x15')]({'where':{'id':_0x413568[_0x8002('0x16')]}})['then'](function(_0x293b7a){if(_0x293b7a){_0x293b7a['update']({'lastMsgAt':_0x413568[_0x8002('0x17')],'lastMsgDirection':_0x413568['direction']['toLowerCase']()});}})[_0x8002('0x18')](function(_0x651ee5){console[_0x8002('0x19')](_0x651ee5);});}if(_0x413568[_0x8002('0xe')]===_0x8002('0x10')&&!_0x413568[_0x8002('0x11')]){var _0x340844;_0x29d418[_0x8002('0x1a')][_0x8002('0x1b')]({'where':{'id':_0x413568[_0x8002('0x1c')]},'raw':!![]})[_0x8002('0x1d')](function(_0x406ee8){_0x340844=_0x406ee8;if(_0x340844&&_0x340844[_0x8002('0x1e')]){switch(_0x340844['type']){case'twilio':var _0x287909=require(_0x8002('0x1f'));if(_0x340844[_0x8002('0x20')]&&_0x340844[_0x8002('0x21')]&&_0x340844[_0x8002('0x22')]){var _0x49b6d7=new _0x287909(_0x340844[_0x8002('0x20')],_0x340844['authToken']);_0x49b6d7[_0x8002('0x23')][_0x8002('0x24')]({'body':_0x413568[_0x8002('0x25')],'to':_0x413568[_0x8002('0x22')],'from':_0x340844[_0x8002('0x22')],'statusCallback':_0x340844[_0x8002('0x26')]+_0x8002('0x27')+_0x413568['id']+_0x8002('0x28')+_0x340844[_0x8002('0x29')]})[_0x8002('0x1d')](function(_0x4f2c70){if(_0x4f2c70['sid']){return _0x2a34ab[_0x8002('0x2a')]({'messageId':_0x4f2c70['sid']});}})[_0x8002('0x18')](function(_0x3aec62){logger[_0x8002('0x19')](_0x8002('0x2b'),'afterCreate','twilio',util['inspect'](_0x3aec62,{'showHidden':![],'depth':null}));});}else{logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x1f'),_0x8002('0x2d'));}break;case'skebby':var _0x49008c='https://api.skebby.it/API/v1.0/REST/';if(_0x340844[_0x8002('0x2e')]&&_0x340844[_0x8002('0x2f')]){var _0x18a309={'recipient':[_0x413568[_0x8002('0x22')]],'message':_0x413568[_0x8002('0x25')],'message_type':_0x340844['smsMethod']};if(_0x340844[_0x8002('0x30')]&&_0x340844[_0x8002('0x30')]!=='SI'){_0x18a309[_0x8002('0x31')]=_0x340844['phone'];}var _0x47919a={'url':_0x49008c+_0x8002('0x32')+_0x340844[_0x8002('0x2e')]+_0x8002('0x33')+_0x340844[_0x8002('0x2f')],'method':_0x8002('0x34')};rp(_0x47919a)[_0x8002('0x1d')](function(_0x2c7948){var _0x4cb97b=_0x2c7948[_0x8002('0x35')](';');var _0x4cbd58={'user_key':_0x4cb97b[0x0],'session_key':_0x4cb97b[0x1]};_0x47919a={'url':_0x49008c+_0x8002('0x36'),'method':_0x8002('0x37'),'headers':{'user_key':_0x4cbd58[_0x8002('0x38')],'Session_key':_0x4cbd58['session_key']},'json':!![],'body':_0x18a309};return rp(_0x47919a);})['then'](function(_0x28087d){if(_0x28087d['total_sent']>=0x1){var _0x597500={'messageId':_0x28087d['internal_order_id']};if(_0x340844[_0x8002('0x30')]!=='GP'||!_0x340844[_0x8002('0x39')]){_0x597500['read']=!![];}return _0x2a34ab['update'](_0x597500);}else{return logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x3a'),util[_0x8002('0x3b')](_0x28087d,{'showHidden':![],'depth':null}));}})[_0x8002('0x18')](function(_0xdbf793){return logger['error'](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x3a'),util[_0x8002('0x3b')](_0xdbf793,{'showHidden':![],'depth':null}));});}else{logger[_0x8002('0x19')](_0x8002('0x2b'),'afterCreate',_0x8002('0x3a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x8002('0x3c'):if(_0x340844[_0x8002('0x21')]){var _0x42b87d={'recipient':_0x413568['phone'],'message':_0x413568[_0x8002('0x25')],'sender':_0x340844[_0x8002('0x3d')]||_0x340844[_0x8002('0x22')],'authorization':_0x340844[_0x8002('0x21')]};var _0x49da63={'method':_0x8002('0x37'),'uri':_0x8002('0x3e'),'body':_0x42b87d,'json':!![]};rp(_0x49da63)['then'](function(_0x17d23c){var _0x37ba47={'messageId':_0x17d23c[_0x8002('0x3f')]};if(!_0x340844[_0x8002('0x39')]){_0x37ba47['read']=!![];}return _0x2a34ab[_0x8002('0x2a')](_0x37ba47);})['catch'](function(_0x519dfc){logger[_0x8002('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8002('0x2c'),'connectel',util[_0x8002('0x3b')](_0x519dfc,{'showHidden':![],'depth':null}));});}else{logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x3c'),'Missing\x20parameters:\x20authToken');}break;case _0x8002('0x40'):if(_0x340844[_0x8002('0x2e')]&&_0x340844['password']){var _0x42b87d={'messages':[{'source':_0x8002('0x41'),'to':_0x413568['phone'],'body':_0x413568[_0x8002('0x25')],'from':_0x340844[_0x8002('0x3d')]||_0x340844[_0x8002('0x22')]}]};var _0x2dce5d=util['format'](_0x8002('0x42'),_0x340844[_0x8002('0x2e')],_0x340844[_0x8002('0x2f')]);var _0x49da63={'method':'POST','uri':_0x8002('0x43'),'body':_0x42b87d,'headers':{'Authorization':util[_0x8002('0x44')](_0x8002('0x45'),new Buffer(_0x2dce5d)['toString'](_0x8002('0x46')))},'json':!![]};rp(_0x49da63)['then'](function(_0x1d405a){if(_0x1d405a[_0x8002('0x47')]>=0xc8&&_0x1d405a[_0x8002('0x47')]<=0xce){if(_0x1d405a[_0x8002('0x48')]&&_0x1d405a['data']['queued_count']>0x0){var _0x2b1de1=_[_0x8002('0x49')](_0x1d405a[_0x8002('0x48')][_0x8002('0x23')]);var _0x11faa2={'messageId':_0x2b1de1['message_id']};if(!_0x340844[_0x8002('0x39')]){_0x11faa2[_0x8002('0x4a')]=!![];}return _0x2a34ab['update'](_0x11faa2);}else{logger['error'](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x4b'),util[_0x8002('0x3b')](_0x1d405a,{'showHidden':![],'depth':null}));}}else{logger[_0x8002('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8002('0x2c'),_0x8002('0x4b'),util['inspect'](_0x1d405a,{'showHidden':![],'depth':null}));}})['catch'](function(_0xbd1d57){logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),'clickSend',util[_0x8002('0x3b')](_0xbd1d57,{'showHidden':![],'depth':null}));});}else{logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x4b'),_0x8002('0x4c'));}break;case _0x8002('0x4d'):if(_0x340844[_0x8002('0x4e')]&&_0x340844['authToken']){var _0x42b87d={'dst':_0x413568[_0x8002('0x22')],'text':_0x413568[_0x8002('0x25')],'src':_0x340844[_0x8002('0x3d')]||_0x340844['phone'],'url':_0x340844[_0x8002('0x26')]+_0x8002('0x27')+_0x413568['id']+_0x8002('0x28')+_0x340844[_0x8002('0x29')]};var _0x2dce5d=util['format'](_0x8002('0x42'),_0x340844[_0x8002('0x4e')],_0x340844[_0x8002('0x21')]);var _0x49da63={'method':_0x8002('0x37'),'uri':util[_0x8002('0x44')](_0x8002('0x4f'),_0x340844[_0x8002('0x4e')]),'body':_0x42b87d,'headers':{'Authorization':util[_0x8002('0x44')](_0x8002('0x45'),new Buffer(_0x2dce5d)[_0x8002('0x50')](_0x8002('0x46')))},'json':!![]};rp(_0x49da63)[_0x8002('0x1d')](function(_0x42e169){var _0x17c9f3={'messageId':_0x42e169[_0x8002('0x51')][0x0]};return _0x2a34ab['update'](_0x17c9f3);})['catch'](function(_0x41b79b){logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x4d'),util[_0x8002('0x3b')](_0x41b79b,{'showHidden':![],'depth':null}));});}else{logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x4d'),_0x8002('0x52'));}break;case _0x8002('0x53'):if(_0x340844[_0x8002('0x2e')]&&_0x340844[_0x8002('0x2f')]){if(_0x340844[_0x8002('0x54')]){var _0x408119={'method':'POST','uri':_0x340844['baseUrl']+_0x8002('0x55'),'body':{'username':_0x340844[_0x8002('0x2e')],'password':_0x340844[_0x8002('0x2f')]},'json':!![]};return rp(_0x408119)['then'](function(_0x5d22f6){var _0x1cd27b={'method':_0x8002('0x37'),'uri':_0x340844[_0x8002('0x54')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x340844[_0x8002('0x22')],'destinations':[{'to':_0x413568[_0x8002('0x22')]}],'text':_0x413568[_0x8002('0x25')],'notifyUrl':_0x340844[_0x8002('0x26')]+_0x8002('0x27')+_0x413568['id']+_0x8002('0x28')+_0x340844[_0x8002('0x29')],'notifyContentType':'application/json','callbackData':_0x340844[_0x8002('0x22')]+';'+_0x413568[_0x8002('0x25')]}]},'headers':{'Authorization':_0x8002('0x56')+_0x5d22f6[_0x8002('0x29')]},'json':!![]};return rp(_0x1cd27b)[_0x8002('0x1d')](function(_0x544992){if(_0x544992[_0x8002('0x23')]){var _0x54808e={'messageId':_0x544992[_0x8002('0x23')][0x0][_0x8002('0xa')]};if(!_0x340844[_0x8002('0x39')]){_0x54808e[_0x8002('0x4a')]=!![];}return _0x2a34ab[_0x8002('0x2a')](_0x54808e);}else{return logger[_0x8002('0x19')](_0x8002('0x2b'),'afterCreate',_0x8002('0x53'),util['inspect'](_0x544992,{'showHidden':![],'depth':null}));}});})[_0x8002('0x18')](function(_0x2ff4f8){return logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x53'),util[_0x8002('0x3b')](_0x2ff4f8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x53'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x8002('0x19')](_0x8002('0x2b'),'afterCreate',_0x8002('0x53'),_0x8002('0x4c'));}break;case _0x8002('0x57'):var _0x3664e7=require(_0x8002('0x58'));if(_0x340844[_0x8002('0x59')]){var _0x188e67={};_0x188e67[_0x8002('0x5a')]=_0x340844[_0x8002('0x2e')];_0x188e67[_0x8002('0x22')]=_0x413568[_0x8002('0x22')];_0x188e67['sender']=_0x340844[_0x8002('0x22')];_0x188e67[_0x8002('0x5b')]=_0x413568[_0x8002('0x25')];_0x188e67['timestamp']=+new Date();var _0x5b4a80='';var _0x391a44='';var _0x205578=Object[_0x8002('0x5c')](_0x188e67);_0x205578[_0x8002('0x5d')]();for(var _0x21bd84=0x0;_0x21bd84<_0x205578[_0x8002('0x5e')];_0x21bd84++){if(_0x5b4a80!=''){_0x5b4a80+='&';}_0x5b4a80+=_0x205578[_0x21bd84]+'='+encodeURIComponent(_0x188e67[_0x205578[_0x21bd84]]);_0x391a44+=_0x188e67[_0x205578[_0x21bd84]];}_0x391a44+=_0x340844[_0x8002('0x59')];_0x391a44=_0x3664e7[_0x8002('0x5f')](_0x8002('0x60'))[_0x8002('0x2a')](_0x391a44)[_0x8002('0x61')](_0x8002('0x62'));if(_0x5b4a80!==''){_0x5b4a80+='&';}_0x5b4a80+=_0x8002('0x63')+_0x391a44;var _0x47919a={'method':_0x8002('0x34'),'uri':_0x340844[_0x8002('0x54')]+_0x8002('0x64')+_0x5b4a80,'json':!![]};return rp(_0x47919a)[_0x8002('0x1d')](function(_0x521809){var _0xce3308=Object['keys'](_0x521809);if(_0x521809[_0xce3308[0x0]][_0x8002('0x19')]&&parseInt(_0x521809[_0xce3308[0x0]][_0x8002('0x19')])===0x0){var _0x580181={'messageId':_0x521809[_0xce3308[0x0]][_0x8002('0x65')]};if(!_0x340844[_0x8002('0x39')]){_0x580181['read']=!![];}return _0x2a34ab[_0x8002('0x2a')](_0x580181);}else{return logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x57'),util[_0x8002('0x3b')](_0x521809[_0x8002('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3bbe83){return logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x57'),util['inspect'](_0x3bbe83,{'showHidden':![],'depth':null}));});}else{logger[_0x8002('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8002('0x2c'),_0x8002('0x57'),_0x8002('0x66'));}break;case'clickatell':if(_0x340844[_0x8002('0x59')]){var _0x25fac6={'method':'POST','uri':_0x8002('0x67'),'headers':{'Authorization':_0x340844[_0x8002('0x59')]},'body':{'content':_0x413568[_0x8002('0x25')],'to':[_0x413568[_0x8002('0x22')]],'from':_0x340844['phone'],'binary':![],'clientMessageId':_0x8002('0x68'),'charset':_0x8002('0x69')},'json':!![]};rp(_0x25fac6)['then'](function(_0x588ad4){if(!_0x588ad4[_0x8002('0x19')]){var _0x207c1d={'messageId':_0x588ad4[_0x8002('0x23')][0x0][_0x8002('0x6a')]};if(!_0x340844[_0x8002('0x39')]){_0x207c1d['read']=!![];}return _0x2a34ab[_0x8002('0x2a')](_0x207c1d);}else{return logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x6b'),util[_0x8002('0x3b')](_0x588ad4[_0x8002('0x19')],{'showHidden':![],'depth':null}));}})[_0x8002('0x18')](function(_0x911cc5){return logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x6b'),util[_0x8002('0x3b')](_0x911cc5,{'showHidden':![],'depth':null}));});}else{logger[_0x8002('0x19')](_0x8002('0x2b'),_0x8002('0x2c'),_0x8002('0x6b'),_0x8002('0x66'));}break;case _0x8002('0x6c'):if(_0x340844[_0x8002('0x59')]){var _0xd4c9d={};var _0x47919a={'method':_0x8002('0x37'),'uri':_0x8002('0x6d'),'headers':{'Authorization':'Bearer\x20'+_0x340844[_0x8002('0x59')],'Content-Type':_0x8002('0x6e')},'body':{'from':_0x340844['phone'],'to':_0x413568['phone'],'text':_0x413568[_0x8002('0x25')]},'json':!![]};return rp(_0x47919a)[_0x8002('0x1d')](function(_0x7a6ca1){if(_0x7a6ca1[_0x8002('0x6f')]==0xca){_0xd4c9d[_0x8002('0x70')]=_0x7a6ca1;var _0x2e736d={'method':_0x8002('0x37'),'uri':_0x8002('0x71'),'headers':{'Authorization':_0x8002('0x72')+_0x340844[_0x8002('0x59')],'Content-Type':_0x8002('0x6e')},'body':{'refid':_0xd4c9d[_0x8002('0x70')]['refid']},'json':!![]};return rp(_0x2e736d)[_0x8002('0x1d')](function(_0x59a1b1){_0xd4c9d[_0x8002('0x73')]=_0x59a1b1;var _0x416e0e={'messageId':_0xd4c9d[_0x8002('0x70')][_0x8002('0x74')],'read':!![]};return _0x2a34ab[_0x8002('0x2a')](_0x416e0e);});}else{return logger[_0x8002('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8002('0x2c'),_0x8002('0x6c'),util[_0x8002('0x3b')](_0x7a6ca1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4dc291){return logger[_0x8002('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8002('0x2c'),'intelepeer',util[_0x8002('0x3b')](_0x4dc291,{'showHidden':![],'depth':null}));});}else{return logger[_0x8002('0x19')](_0x8002('0x2b'),'afterCreate',_0x8002('0x6c'),_0x8002('0x75'));}break;}}})[_0x8002('0x76')](function(){_0x188949();});}else{_0x188949();}}},'charset':_0x8002('0x77'),'collate':_0x8002('0x78')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 1ff82ab..e33ab9c 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 _0x5eb8=['client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','result','catch','options','raw','then','stringify','CreateSmsMessage','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1c34e1,_0xa1433d){var _0x4ef0bb=function(_0x19035d){while(--_0x19035d){_0x1c34e1['push'](_0x1c34e1['shift']());}};_0x4ef0bb(++_0xa1433d);}(_0x5eb8,0xb0));var _0x85eb=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x5eb8[_0x67f95e];return _0x538f5a;};'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});config['redis']=_[_0x85eb('0xc')](config[_0x85eb('0xd')],{'host':_0x85eb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0xd')]));require('./smsMessage.socket')[_0x85eb('0xf')](socket);function respondWithRpcPromise(_0x40d6b6,_0x673228,_0x29030b){return new BPromise(function(_0x1dacf2,_0x73e6d0){return client[_0x85eb('0x10')](_0x40d6b6,_0x29030b)['then'](function(_0x163f32){logger[_0x85eb('0x11')]('SmsMessage,\x20%s,\x20%s',_0x673228,_0x85eb('0x12'));logger[_0x85eb('0x13')](_0x85eb('0x14'),_0x673228,_0x85eb('0x12'),JSON['stringify'](_0x163f32));if(_0x163f32['error']){if(_0x163f32[_0x85eb('0x15')]['code']===0x1f4){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x73e6d0(_0x163f32[_0x85eb('0x15')]['message']);}logger[_0x85eb('0x15')]('SmsMessage,\x20%s,\x20%s',_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x1dacf2(_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x673228,'request\x20sent');_0x1dacf2(_0x163f32[_0x85eb('0x18')][_0x85eb('0x17')]);}})[_0x85eb('0x19')](function(_0x2e986c){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x2e986c);_0x73e6d0(_0x2e986c);});});}exports['CreateSmsMessage']=function(_0x24cf28){var _0x7244fc=this;return new Promise(function(_0xd9f06d,_0x4e8041){return db['SmsMessage']['create'](_0x24cf28['body'],{'raw':_0x24cf28[_0x85eb('0x1a')]?_0x24cf28[_0x85eb('0x1a')][_0x85eb('0x1b')]===undefined?!![]:![]:!![]})[_0x85eb('0x1c')](function(_0x465c74){logger[_0x85eb('0x11')]('CreateSmsMessage',_0x24cf28);logger['debug']('CreateSmsMessage',_0x24cf28,JSON[_0x85eb('0x1d')](_0x465c74));_0xd9f06d(_0x465c74);})[_0x85eb('0x19')](function(_0x3f7a4d){logger[_0x85eb('0x15')](_0x85eb('0x1e'),_0x3f7a4d[_0x85eb('0x17')],_0x24cf28);_0x4e8041(_0x7244fc['error'](0x1f4,_0x3f7a4d[_0x85eb('0x17')]));});});}; \ No newline at end of file +var _0x5eb8=['client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','result','catch','options','raw','then','stringify','CreateSmsMessage','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x19f6c8,_0x5a4e0a){var _0x317376=function(_0x1dd785){while(--_0x1dd785){_0x19f6c8['push'](_0x19f6c8['shift']());}};_0x317376(++_0x5a4e0a);}(_0x5eb8,0xb0));var _0x85eb=function(_0x594e11,_0x28f652){_0x594e11=_0x594e11-0x0;var _0x5418ad=_0x5eb8[_0x594e11];return _0x5418ad;};'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});config['redis']=_[_0x85eb('0xc')](config[_0x85eb('0xd')],{'host':_0x85eb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0xd')]));require('./smsMessage.socket')[_0x85eb('0xf')](socket);function respondWithRpcPromise(_0x40d6b6,_0x673228,_0x29030b){return new BPromise(function(_0x1dacf2,_0x73e6d0){return client[_0x85eb('0x10')](_0x40d6b6,_0x29030b)['then'](function(_0x163f32){logger[_0x85eb('0x11')]('SmsMessage,\x20%s,\x20%s',_0x673228,_0x85eb('0x12'));logger[_0x85eb('0x13')](_0x85eb('0x14'),_0x673228,_0x85eb('0x12'),JSON['stringify'](_0x163f32));if(_0x163f32['error']){if(_0x163f32[_0x85eb('0x15')]['code']===0x1f4){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x73e6d0(_0x163f32[_0x85eb('0x15')]['message']);}logger[_0x85eb('0x15')]('SmsMessage,\x20%s,\x20%s',_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x1dacf2(_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x673228,'request\x20sent');_0x1dacf2(_0x163f32[_0x85eb('0x18')][_0x85eb('0x17')]);}})[_0x85eb('0x19')](function(_0x2e986c){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x2e986c);_0x73e6d0(_0x2e986c);});});}exports['CreateSmsMessage']=function(_0x24cf28){var _0x7244fc=this;return new Promise(function(_0xd9f06d,_0x4e8041){return db['SmsMessage']['create'](_0x24cf28['body'],{'raw':_0x24cf28[_0x85eb('0x1a')]?_0x24cf28[_0x85eb('0x1a')][_0x85eb('0x1b')]===undefined?!![]:![]:!![]})[_0x85eb('0x1c')](function(_0x465c74){logger[_0x85eb('0x11')]('CreateSmsMessage',_0x24cf28);logger['debug']('CreateSmsMessage',_0x24cf28,JSON[_0x85eb('0x1d')](_0x465c74));_0xd9f06d(_0x465c74);})[_0x85eb('0x19')](function(_0x3f7a4d){logger[_0x85eb('0x15')](_0x85eb('0x1e'),_0x3f7a4d[_0x85eb('0x17')],_0x24cf28);_0x4e8041(_0x7244fc['error'](0x1f4,_0x3f7a4d[_0x85eb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 9336005..a0ee535 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 _0xc764=['register','length','./smsMessage.events','save','remove','update','emit'];(function(_0x50e059,_0x537de){var _0x31e32c=function(_0x535695){while(--_0x535695){_0x50e059['push'](_0x50e059['shift']());}};_0x31e32c(++_0x537de);}(_0xc764,0x198));var _0x4c76=function(_0x791fcc,_0x5dfa3f){_0x791fcc=_0x791fcc-0x0;var _0x5e7289=_0xc764[_0x791fcc];return _0x5e7289;};'use strict';var SmsMessageEvents=require(_0x4c76('0x0'));var events=[_0x4c76('0x1'),_0x4c76('0x2'),_0x4c76('0x3')];function createListener(_0x39e4e9,_0x6a38d4){return function(_0xfe19a4){_0x6a38d4[_0x4c76('0x4')](_0x39e4e9,_0xfe19a4);};}function removeListener(_0x419c59,_0x29f44c){return function(){SmsMessageEvents['removeListener'](_0x419c59,_0x29f44c);};}exports[_0x4c76('0x5')]=function(_0x1b4d71){for(var _0xa76aea=0x0,_0x121f7b=events[_0x4c76('0x6')];_0xa76aea<_0x121f7b;_0xa76aea++){var _0x266752=events[_0xa76aea];var _0x575b44=createListener('smsMessage:'+_0x266752,_0x1b4d71);SmsMessageEvents['on'](_0x266752,_0x575b44);}}; \ No newline at end of file +var _0x6d78=['emit','removeListener','register','./smsMessage.events','save'];(function(_0x476209,_0x5f289e){var _0x359647=function(_0x2bd25c){while(--_0x2bd25c){_0x476209['push'](_0x476209['shift']());}};_0x359647(++_0x5f289e);}(_0x6d78,0x19d));var _0x86d7=function(_0x14f904,_0x3290e8){_0x14f904=_0x14f904-0x0;var _0x538469=_0x6d78[_0x14f904];return _0x538469;};'use strict';var SmsMessageEvents=require(_0x86d7('0x0'));var events=[_0x86d7('0x1'),'remove','update'];function createListener(_0x5d5f2c,_0x316315){return function(_0x156bbd){_0x316315[_0x86d7('0x2')](_0x5d5f2c,_0x156bbd);};}function removeListener(_0x2244c0,_0x25ae7c){return function(){SmsMessageEvents[_0x86d7('0x3')](_0x2244c0,_0x25ae7c);};}exports[_0x86d7('0x4')]=function(_0x179213){for(var _0x2e0160=0x0,_0x49e071=events['length'];_0x2e0160<_0x49e071;_0x2e0160++){var _0xd56083=events[_0x2e0160];var _0x47994b=createListener('smsMessage:'+_0xd56083,_0x179213);SmsMessageEvents['on'](_0xd56083,_0x47994b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 0c264ed..d6bdcb2 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 _0x4e47=['update','delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users'];(function(_0x1dea57,_0x4dc426){var _0x2098db=function(_0x441baf){while(--_0x441baf){_0x1dea57['push'](_0x1dea57['shift']());}};_0x2098db(++_0x4dc426);}(_0x4e47,0x17f));var _0x74e4=function(_0x315d72,_0x3c08b1){_0x315d72=_0x315d72-0x0;var _0x25fec0=_0x4e47[_0x315d72];return _0x25fec0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x74e4('0x0'));var timeout=require(_0x74e4('0x1'));var express=require(_0x74e4('0x2'));var router=express[_0x74e4('0x3')]();var auth=require(_0x74e4('0x4'));var interaction=require(_0x74e4('0x5'));var config=require(_0x74e4('0x6'));var controller=require(_0x74e4('0x7'));router['get']('/',auth[_0x74e4('0x8')](),controller[_0x74e4('0x9')]);router['get'](_0x74e4('0xa'),auth[_0x74e4('0x8')](),controller[_0x74e4('0xb')]);router[_0x74e4('0xc')](_0x74e4('0xd'),auth['isAuthenticated'](),controller[_0x74e4('0xe')]);router[_0x74e4('0xc')](_0x74e4('0xf'),auth[_0x74e4('0x8')](),controller[_0x74e4('0x10')]);router['get'](_0x74e4('0x11'),auth[_0x74e4('0x8')](),controller['getTeams']);router[_0x74e4('0xc')]('/:id/users',auth[_0x74e4('0x8')](),controller[_0x74e4('0x12')]);router[_0x74e4('0x13')]('/',auth[_0x74e4('0x8')](),controller[_0x74e4('0x14')]);router[_0x74e4('0x13')](_0x74e4('0x11'),auth[_0x74e4('0x8')](),controller[_0x74e4('0x15')]);router[_0x74e4('0x13')](_0x74e4('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0x74e4('0x8')](),controller[_0x74e4('0x17')]);router[_0x74e4('0x18')]('/:id',auth[_0x74e4('0x8')](),controller[_0x74e4('0x19')]);router[_0x74e4('0x18')](_0x74e4('0x11'),auth[_0x74e4('0x8')](),controller[_0x74e4('0x1a')]);router[_0x74e4('0x18')](_0x74e4('0x16'),auth['isAuthenticated'](),controller[_0x74e4('0x1b')]);module[_0x74e4('0x1c')]=router; \ No newline at end of file +var _0xd991=['create','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post'];(function(_0x46060a,_0x3ca70b){var _0x32fd79=function(_0x4d157c){while(--_0x4d157c){_0x46060a['push'](_0x46060a['shift']());}};_0x32fd79(++_0x3ca70b);}(_0xd991,0x115));var _0x1d99=function(_0xd97d18,_0x28b2b2){_0xd97d18=_0xd97d18-0x0;var _0x5c5024=_0xd991[_0xd97d18];return _0x5c5024;};'use strict';var multer=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var path=require(_0x1d99('0x2'));var timeout=require(_0x1d99('0x3'));var express=require(_0x1d99('0x4'));var router=express['Router']();var auth=require(_0x1d99('0x5'));var interaction=require(_0x1d99('0x6'));var config=require(_0x1d99('0x7'));var controller=require(_0x1d99('0x8'));router[_0x1d99('0x9')]('/',auth[_0x1d99('0xa')](),controller['index']);router[_0x1d99('0x9')](_0x1d99('0xb'),auth['isAuthenticated'](),controller[_0x1d99('0xc')]);router[_0x1d99('0x9')](_0x1d99('0xd'),auth[_0x1d99('0xa')](),controller[_0x1d99('0xe')]);router[_0x1d99('0x9')](_0x1d99('0xf'),auth[_0x1d99('0xa')](),controller[_0x1d99('0x10')]);router['get'](_0x1d99('0x11'),auth[_0x1d99('0xa')](),controller['getTeams']);router[_0x1d99('0x9')](_0x1d99('0x12'),auth[_0x1d99('0xa')](),controller['getAgents']);router[_0x1d99('0x13')]('/',auth[_0x1d99('0xa')](),controller[_0x1d99('0x14')]);router[_0x1d99('0x13')](_0x1d99('0x11'),auth[_0x1d99('0xa')](),controller['addTeams']);router[_0x1d99('0x13')]('/:id/users',auth[_0x1d99('0xa')](),controller['addAgents']);router[_0x1d99('0x15')](_0x1d99('0xd'),auth[_0x1d99('0xa')](),controller[_0x1d99('0x16')]);router[_0x1d99('0x17')](_0x1d99('0xd'),auth[_0x1d99('0xa')](),controller[_0x1d99('0x18')]);router['delete'](_0x1d99('0x11'),auth['isAuthenticated'](),controller[_0x1d99('0x19')]);router[_0x1d99('0x17')](_0x1d99('0x12'),auth[_0x1d99('0xa')](),controller[_0x1d99('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 32db7ea..39d584a 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 _0x8c18=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c18,0x1f4));var _0x88c1=function(_0x1f0c46,_0x38da97){_0x1f0c46=_0x1f0c46-0x0;var _0x4e1995=_0x8c18[_0x1f0c46];return _0x4e1995;};'use strict';var Sequelize=require(_0x88c1('0x0'));module[_0x88c1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x88c1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x88c1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x88c1('0x4')](_0x88c1('0x5'),_0x88c1('0x6'),_0x88c1('0x7'))}}; \ No newline at end of file +var _0x3886=['STRING','INTEGER','rrmemory','beepall','sequelize','exports'];(function(_0x508da9,_0x161050){var _0x382a4f=function(_0x609873){while(--_0x609873){_0x508da9['push'](_0x508da9['shift']());}};_0x382a4f(++_0x161050);}(_0x3886,0x88));var _0x6388=function(_0x2fe2da,_0x415b93){_0x2fe2da=_0x2fe2da-0x0;var _0x50198b=_0x3886[_0x2fe2da];return _0x50198b;};'use strict';var Sequelize=require(_0x6388('0x0'));module[_0x6388('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6388('0x2')]},'timeout':{'type':Sequelize[_0x6388('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6388('0x4'),_0x6388('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index df60344..c17d9e0 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 _0x1967=['localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','count','offset','reject','save','update','then','destroy','get','SmsQueues','error','name','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','filters','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','params','describe','getMembers','findOne','keys','UserSmsQueue','hasOwnProperty','SmsQueueId','User','agent','smsPause','updatedAt','rows','format','SIP','createdAt','getTeams','Team','addTeams','Agents','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','select','team_has_sms_queues','join','user_has_teams','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x3fe7b4,_0x1f8197){var _0x340f8d=function(_0x13f398){while(--_0x13f398){_0x3fe7b4['push'](_0x3fe7b4['shift']());}};_0x340f8d(++_0x1f8197);}(_0x1967,0x173));var _0x7196=function(_0x5d8fc6,_0x5611ab){_0x5d8fc6=_0x5d8fc6-0x0;var _0x2dc2d2=_0x1967[_0x5d8fc6];return _0x2dc2d2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7196('0x0'));var rimraf=require(_0x7196('0x1'));var zipdir=require(_0x7196('0x2'));var jsonpatch=require(_0x7196('0x3'));var rp=require(_0x7196('0x4'));var moment=require(_0x7196('0x5'));var BPromise=require(_0x7196('0x6'));var Mustache=require(_0x7196('0x7'));var util=require(_0x7196('0x8'));var path=require(_0x7196('0x9'));var sox=require('sox');var csv=require(_0x7196('0xa'));var ejs=require(_0x7196('0xb'));var fs=require('fs');var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0xa'));var querystring=require(_0x7196('0x10'));var Papa=require(_0x7196('0x11'));var Redis=require(_0x7196('0x12'));var authService=require(_0x7196('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x14'));var logger=require(_0x7196('0x15'))(_0x7196('0x16'));var utils=require(_0x7196('0x17'));var config=require(_0x7196('0x18'));var db=require(_0x7196('0x19'))['db'];config[_0x7196('0x1a')]=_[_0x7196('0x1b')](config[_0x7196('0x1a')],{'host':_0x7196('0x1c'),'port':0x18eb});var socket=require(_0x7196('0x1d'))(new Redis(config['redis']));require(_0x7196('0x1e'))[_0x7196('0x1f')](socket);function respondWithStatusCode(_0x3545aa,_0xf098c1){_0xf098c1=_0xf098c1||0xcc;return function(_0x511aa1){if(_0x511aa1){return _0x3545aa[_0x7196('0x20')](_0xf098c1);}return _0x3545aa['status'](_0xf098c1)[_0x7196('0x21')]();};}function respondWithResult(_0x2590a6,_0xf7e97){_0xf7e97=_0xf7e97||0xc8;return function(_0x3ed1ad){if(_0x3ed1ad){return _0x2590a6[_0x7196('0x22')](_0xf7e97)[_0x7196('0x23')](_0x3ed1ad);}};}function respondWithFilteredResult(_0x22bd62,_0x1ed296){return function(_0x3e4e69){if(_0x3e4e69){var _0x32fe2b=_0x3e4e69[_0x7196('0x24')],_0x385f2d=_0x1ed296[_0x7196('0x25')],_0x5b716a=_0x1ed296[_0x7196('0x25')]+_0x1ed296['limit'],_0x4c4f91;if(_0x5b716a>=_0x32fe2b){_0x5b716a=_0x32fe2b;_0x4c4f91=0xc8;}else{_0x4c4f91=0xce;}_0x22bd62[_0x7196('0x22')](_0x4c4f91);return _0x22bd62['set']('Content-Range',_0x385f2d+'-'+_0x5b716a+'/'+_0x32fe2b)[_0x7196('0x23')](_0x3e4e69);}return null;};}function patchUpdates(_0x627223){return function(_0x8dee9d){try{jsonpatch['apply'](_0x8dee9d,_0x627223,!![]);}catch(_0x57c390){return BPromise[_0x7196('0x26')](_0x57c390);}return _0x8dee9d[_0x7196('0x27')]();};}function saveUpdates(_0x598a26,_0x18649b){return function(_0x27ff84){if(_0x27ff84){return _0x27ff84[_0x7196('0x28')](_0x598a26)[_0x7196('0x29')](function(_0x38b3d6){return _0x38b3d6;});}return null;};}function removeEntity(_0x549f34,_0x3f8178){return function(_0x520d01){if(_0x520d01){return _0x520d01[_0x7196('0x2a')]()[_0x7196('0x29')](function(){var _0x2e15c7=_0x520d01[_0x7196('0x2b')]({'plain':!![]});var _0x70aa65=_0x7196('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x70aa65,'resourceId':_0x2e15c7['id']}})[_0x7196('0x29')](function(){return _0x520d01;});})[_0x7196('0x29')](function(){_0x549f34[_0x7196('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aa538,_0x41cfd2){return function(_0x162cfc){if(!_0x162cfc){_0x5aa538[_0x7196('0x20')](0x194);}return _0x162cfc;};}function handleError(_0x4c6006,_0x35eef9){_0x35eef9=_0x35eef9||0x1f4;return function(_0x4ecea1){logger[_0x7196('0x2d')](_0x4ecea1['stack']);if(_0x4ecea1[_0x7196('0x2e')]){delete _0x4ecea1[_0x7196('0x2e')];}_0x4c6006[_0x7196('0x22')](_0x35eef9)['send'](_0x4ecea1);};}exports[_0x7196('0x2f')]=function(_0x45d567,_0x2f9583){var _0xf999e9={},_0x50c386={},_0x39710d={'count':0x0,'rows':[]};var _0x429160=_[_0x7196('0x30')](db[_0x7196('0x31')][_0x7196('0x32')],function(_0x2786f3){return{'name':_0x2786f3[_0x7196('0x33')],'type':_0x2786f3[_0x7196('0x34')][_0x7196('0x35')]};});_0x50c386[_0x7196('0x36')]=_[_0x7196('0x30')](_0x429160,'name');_0x50c386[_0x7196('0x37')]=_['keys'](_0x45d567[_0x7196('0x37')]);_0x50c386['filters']=_[_0x7196('0x38')](_0x50c386[_0x7196('0x36')],_0x50c386['query']);_0xf999e9[_0x7196('0x39')]=_[_0x7196('0x38')](_0x50c386[_0x7196('0x36')],qs[_0x7196('0x3a')](_0x45d567[_0x7196('0x37')]['fields']));_0xf999e9[_0x7196('0x39')]=_0xf999e9[_0x7196('0x39')][_0x7196('0x3b')]?_0xf999e9[_0x7196('0x39')]:_0x50c386[_0x7196('0x36')];if(!_0x45d567[_0x7196('0x37')]['hasOwnProperty'](_0x7196('0x3c'))){_0xf999e9[_0x7196('0x3d')]=qs[_0x7196('0x3d')](_0x45d567['query'][_0x7196('0x3d')]);_0xf999e9[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x45d567[_0x7196('0x37')][_0x7196('0x25')]);}_0xf999e9[_0x7196('0x3e')]=qs[_0x7196('0x3f')](_0x45d567[_0x7196('0x37')][_0x7196('0x3f')]);_0xf999e9[_0x7196('0x40')]=qs['filters'](_[_0x7196('0x41')](_0x45d567[_0x7196('0x37')],_0x50c386['filters']));if(_0x45d567[_0x7196('0x37')]['filter']){_0xf999e9['where']=_[_0x7196('0x42')](_0xf999e9[_0x7196('0x40')],{'$or':_['map'](_0x429160,function(_0x587f6f){if(_0x587f6f[_0x7196('0x34')]!==_0x7196('0x43')){var _0xed32cd={};_0xed32cd[_0x587f6f['name']]={'$like':'%'+_0x45d567[_0x7196('0x37')][_0x7196('0x44')]+'%'};return _0xed32cd;}})});}_0xf999e9=_[_0x7196('0x42')]({},_0xf999e9,_0x45d567[_0x7196('0x45')]);var _0x16da09={'where':_0xf999e9[_0x7196('0x40')]};return db[_0x7196('0x31')][_0x7196('0x24')](_0x16da09)['then'](function(_0x89c8ea){_0x39710d[_0x7196('0x24')]=_0x89c8ea;if(_0x45d567['query'][_0x7196('0x46')]){_0xf999e9[_0x7196('0x47')]=[{'all':!![]}];}return db['SmsQueue'][_0x7196('0x48')](_0xf999e9);})[_0x7196('0x29')](function(_0x3b78c8){_0x39710d['rows']=_0x3b78c8;return _0x39710d;})[_0x7196('0x29')](respondWithFilteredResult(_0x2f9583,_0xf999e9))[_0x7196('0x49')](handleError(_0x2f9583,null));};exports['show']=function(_0xcd287c,_0x1a7052){var _0x4f0c6c={'raw':!![],'where':{'id':_0xcd287c['params']['id']}},_0x335e6f={};_0x335e6f['model']=_['keys'](db['SmsQueue']['rawAttributes']);_0x335e6f[_0x7196('0x37')]=_['keys'](_0xcd287c[_0x7196('0x37')]);_0x335e6f[_0x7196('0x4a')]=_[_0x7196('0x38')](_0x335e6f[_0x7196('0x36')],_0x335e6f['query']);_0x4f0c6c[_0x7196('0x39')]=_['intersection'](_0x335e6f[_0x7196('0x36')],qs[_0x7196('0x3a')](_0xcd287c[_0x7196('0x37')]['fields']));_0x4f0c6c[_0x7196('0x39')]=_0x4f0c6c[_0x7196('0x39')][_0x7196('0x3b')]?_0x4f0c6c['attributes']:_0x335e6f['model'];if(_0xcd287c[_0x7196('0x37')]['includeAll']){_0x4f0c6c[_0x7196('0x47')]=[{'all':!![]}];}_0x4f0c6c=_['merge']({},_0x4f0c6c,_0xcd287c['options']);return db[_0x7196('0x31')]['find'](_0x4f0c6c)['then'](handleEntityNotFound(_0x1a7052,null))['then'](respondWithResult(_0x1a7052,null))[_0x7196('0x49')](handleError(_0x1a7052,null));};exports['create']=function(_0x48e3b5,_0x28591e){return db[_0x7196('0x31')][_0x7196('0x4b')](_0x48e3b5[_0x7196('0x4c')],{})['then'](function(_0x50cc66){var _0x564688=_0x48e3b5[_0x7196('0x4d')][_0x7196('0x2b')]({'plain':!![]});if(!_0x564688)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x564688[_0x7196('0x4e')]===_0x7196('0x4d')){var _0x3fe092=_0x50cc66['get']({'plain':!![]});var _0x317ab6='SmsQueues';return db[_0x7196('0x4f')][_0x7196('0x50')]({'where':{'name':_0x317ab6,'userProfileId':_0x564688[_0x7196('0x51')]},'raw':!![]})[_0x7196('0x29')](function(_0x41a9aa){if(_0x41a9aa&&_0x41a9aa[_0x7196('0x52')]===0x0){return db[_0x7196('0x53')][_0x7196('0x4b')]({'name':_0x3fe092['name'],'resourceId':_0x3fe092['id'],'type':_0x41a9aa['name'],'sectionId':_0x41a9aa['id']},{})[_0x7196('0x29')](function(){return _0x50cc66;});}else{return _0x50cc66;}})[_0x7196('0x49')](function(_0x40f820){logger[_0x7196('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40f820);throw _0x40f820;});}return _0x50cc66;})[_0x7196('0x29')](respondWithResult(_0x28591e,0xc9))[_0x7196('0x49')](handleError(_0x28591e,null));};exports[_0x7196('0x28')]=function(_0x11dc10,_0x9fcfd4){if(_0x11dc10[_0x7196('0x4c')]['id']){delete _0x11dc10[_0x7196('0x4c')]['id'];}return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x11dc10[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x9fcfd4,null))['then'](saveUpdates(_0x11dc10[_0x7196('0x4c')],null))[_0x7196('0x29')](respondWithResult(_0x9fcfd4,null))[_0x7196('0x49')](handleError(_0x9fcfd4,null));};exports['destroy']=function(_0x1f098c,_0x5ca1ca){return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x1f098c[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x5ca1ca,null))[_0x7196('0x29')](removeEntity(_0x5ca1ca,null))['catch'](handleError(_0x5ca1ca,null));};exports[_0x7196('0x55')]=function(_0x5b77fc,_0x4be36d){return db['SmsQueue'][_0x7196('0x55')]()[_0x7196('0x29')](respondWithResult(_0x4be36d,null))[_0x7196('0x49')](handleError(_0x4be36d,null));};exports[_0x7196('0x56')]=function(_0x105a3f,_0x41fa94,_0x2d8b3d){var _0x560ddb={'raw':!![],'where':{}},_0x293467={},_0x14dc43;return db[_0x7196('0x31')][_0x7196('0x57')]({'where':{'id':_0x105a3f[_0x7196('0x54')]['id']}})['then'](handleEntityNotFound(_0x41fa94,null))['then'](function(_0xa7ecfb){if(_0xa7ecfb){_0x14dc43=_0xa7ecfb[_0x7196('0x2b')]({'plain':!![]});_0x293467[_0x7196('0x36')]=_[_0x7196('0x58')](db[_0x7196('0x59')][_0x7196('0x32')]);_0x293467[_0x7196('0x37')]=_[_0x7196('0x58')](_0x105a3f[_0x7196('0x37')]);_0x293467[_0x7196('0x4a')]=_[_0x7196('0x38')](_0x293467['model'],_0x293467[_0x7196('0x37')]);_0x560ddb[_0x7196('0x39')]=_[_0x7196('0x38')](_0x293467[_0x7196('0x36')],qs['fields'](_0x105a3f[_0x7196('0x37')][_0x7196('0x3a')]));_0x560ddb[_0x7196('0x39')]=_0x560ddb[_0x7196('0x39')][_0x7196('0x3b')]?_0x560ddb[_0x7196('0x39')]:_0x293467[_0x7196('0x36')];if(!_0x105a3f['query'][_0x7196('0x5a')](_0x7196('0x3c'))){_0x560ddb[_0x7196('0x3d')]=qs[_0x7196('0x3d')](_0x105a3f['query'][_0x7196('0x3d')]);_0x560ddb[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x105a3f[_0x7196('0x37')][_0x7196('0x25')]);}_0x560ddb[_0x7196('0x3e')]=qs[_0x7196('0x3f')](_0x105a3f['query']['sort']);_0x560ddb['where']=qs[_0x7196('0x4a')](_['pick'](_0x105a3f[_0x7196('0x37')],_0x293467[_0x7196('0x4a')]));_0x560ddb[_0x7196('0x40')][_0x7196('0x5b')]=_0xa7ecfb['id'];if(_0x105a3f[_0x7196('0x37')][_0x7196('0x44')]){_0x560ddb[_0x7196('0x40')]=_[_0x7196('0x42')](_0x560ddb[_0x7196('0x40')],{'$or':_['map'](_0x560ddb['attributes'],function(_0x4542c1){var _0x3f939a={};_0x3f939a[_0x4542c1]={'$like':'%'+_0x105a3f[_0x7196('0x37')][_0x7196('0x44')]+'%'};return _0x3f939a;})});}_0x560ddb=_[_0x7196('0x42')]({},_0x560ddb,_0x105a3f[_0x7196('0x45')]);return db[_0x7196('0x59')][_0x7196('0x48')](_0x560ddb);}})['then'](function(_0x4cb99d){if(_0x4cb99d){return db[_0x7196('0x5c')]['findAndCountAll']({'where':{'id':_[_0x7196('0x30')](_0x4cb99d,'UserId'),'role':_0x7196('0x5d')},'attributes':['id',_0x7196('0x2e'),_0x7196('0x5e'),_0x7196('0x5f'),'createdAt']});}})['then'](function(_0x33d301){if(_0x33d301){return{'count':_0x33d301['count'],'rows':_[_0x7196('0x30')](_0x33d301[_0x7196('0x60')],function(_0x4526e8){return{'membername':_0x4526e8[_0x7196('0x2e')],'UserId':_0x4526e8['id'],'queue_name':_0x14dc43[_0x7196('0x2e')],'SmsQueueId':_0x14dc43['id'],'interface':util[_0x7196('0x61')]('%s/%s',_0x7196('0x62'),_0x4526e8[_0x7196('0x2e')]),'penalty':0x0,'paused':_0x4526e8[_0x7196('0x5e')],'createdAt':_0x4526e8[_0x7196('0x63')],'updatedAt':_0x4526e8[_0x7196('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7196('0x29')](respondWithFilteredResult(_0x41fa94,_0x560ddb))[_0x7196('0x49')](handleError(_0x41fa94,null));};exports[_0x7196('0x64')]=function(_0x13cbe2,_0xa20de8,_0x3d3768){var _0x2181f5={};var _0x53a6fa={};var _0x431415;var _0x13f802;return db['SmsQueue']['findOne']({'where':{'id':_0x13cbe2[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0xa20de8,null))[_0x7196('0x29')](function(_0x5b2c33){if(_0x5b2c33){_0x431415=_0x5b2c33;_0x53a6fa[_0x7196('0x36')]=_['keys'](db[_0x7196('0x65')][_0x7196('0x32')]);_0x53a6fa['query']=_[_0x7196('0x58')](_0x13cbe2['query']);_0x53a6fa['filters']=_[_0x7196('0x38')](_0x53a6fa[_0x7196('0x36')],_0x53a6fa[_0x7196('0x37')]);_0x2181f5['attributes']=_[_0x7196('0x38')](_0x53a6fa['model'],qs[_0x7196('0x3a')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x3a')]));_0x2181f5[_0x7196('0x39')]=_0x2181f5[_0x7196('0x39')]['length']?_0x2181f5[_0x7196('0x39')]:_0x53a6fa[_0x7196('0x36')];_0x2181f5[_0x7196('0x3e')]=qs[_0x7196('0x3f')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x3f')]);_0x2181f5[_0x7196('0x40')]=qs[_0x7196('0x4a')](_['pick'](_0x13cbe2[_0x7196('0x37')],_0x53a6fa[_0x7196('0x4a')]));if(_0x13cbe2[_0x7196('0x37')][_0x7196('0x44')]){_0x2181f5['where']=_[_0x7196('0x42')](_0x2181f5[_0x7196('0x40')],{'$or':_['map'](_0x2181f5[_0x7196('0x39')],function(_0x53d470){var _0xd6d8cf={};_0xd6d8cf[_0x53d470]={'$like':'%'+_0x13cbe2['query'][_0x7196('0x44')]+'%'};return _0xd6d8cf;})});}_0x2181f5=_[_0x7196('0x42')]({},_0x2181f5,_0x13cbe2['options']);return _0x431415[_0x7196('0x64')](_0x2181f5);}})[_0x7196('0x29')](function(_0x2c2c53){if(_0x2c2c53){_0x13f802=_0x2c2c53['length'];if(!_0x13cbe2['query'][_0x7196('0x5a')]('nolimit')){_0x2181f5['limit']=qs[_0x7196('0x3d')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x3d')]);_0x2181f5['offset']=qs[_0x7196('0x25')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x25')]);}return _0x431415[_0x7196('0x64')](_0x2181f5);}})[_0x7196('0x29')](function(_0x26048c){if(_0x26048c){return _0x26048c?{'count':_0x13f802,'rows':_0x26048c}:null;}})[_0x7196('0x29')](respondWithResult(_0xa20de8,null))[_0x7196('0x49')](handleError(_0xa20de8,null));};exports[_0x7196('0x66')]=function(_0x446f28,_0x173fe5,_0x5eb2b5){var _0x5acff1=_0x446f28[_0x7196('0x4c')]['ids'];return db['Team'][_0x7196('0x48')]({'where':{'id':_0x5acff1},'attributes':['id'],'include':[{'model':db[_0x7196('0x5c')],'as':_0x7196('0x67'),'attributes':['id',_0x7196('0x2e'),'online','voicePause',_0x7196('0x68')],'raw':!![]}]})[_0x7196('0x29')](function(_0x1eea71){if(_0x1eea71){var _0x247b15=_['flatMap'](_0x1eea71,function(_0x4d8b8e){var _0x4afbee=_0x4d8b8e['get']({'plain':!![]});return _0x4afbee[_0x7196('0x67')];});return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x446f28['params']['id']}})[_0x7196('0x29')](function(_0x40d4c3){return db[_0x7196('0x69')][_0x7196('0x6a')](function(_0x10712f){return _0x40d4c3[_0x7196('0x66')](_0x5acff1,{'transaction':_0x10712f})[_0x7196('0x29')](function(){return BPromise[_0x7196('0x6b')](_0x247b15,function(_0x5de550){return db[_0x7196('0x59')][_0x7196('0x6c')]({'where':{'UserId':_0x5de550['id'],'SmsQueueId':_0x446f28[_0x7196('0x54')]['id']},'transaction':_0x10712f});});})[_0x7196('0x29')](function(){_0x247b15[_0x7196('0x6d')](function(_0x4faf7b){socket[_0x7196('0x6e')](_0x7196('0x6f'),{'UserId':_0x4faf7b['id'],'SmsQueueId':_0x40d4c3['id']});});});});});}})[_0x7196('0x29')](respondWithStatusCode(_0x173fe5,null))['catch'](handleError(_0x173fe5,null));};exports[_0x7196('0x70')]=function(_0x4b98de,_0x53ae84,_0x1dcf93){return db[_0x7196('0x65')]['findAll']({'where':{'id':_0x4b98de[_0x7196('0x37')][_0x7196('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7196('0x67'),'attributes':['id'],'raw':!![]}]})[_0x7196('0x29')](handleEntityNotFound(_0x53ae84,null))[_0x7196('0x29')](function(_0x28d665){var _0x441ca1=_[_0x7196('0x30')](_0x28d665,'id');var _0x5d5d1f=[];var _0x3639be=[];var _0x460e51=squel[_0x7196('0x72')]();_0x460e51['field']('tq.TeamId')['from'](_0x7196('0x73'),'tq')[_0x7196('0x74')](_0x7196('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7196('0x40')]('SmsQueueId\x20=\x20?',_0x4b98de[_0x7196('0x54')]['id']);for(var _0x4e22df=0x0;_0x4e22df<_0x28d665[_0x7196('0x3b')];_0x4e22df+=0x1){let _0x18bafa=_0x28d665[_0x4e22df];for(var _0x33d5bf=0x0;_0x33d5bf<_0x18bafa[_0x7196('0x67')][_0x7196('0x3b')];_0x33d5bf+=0x1){let _0x10b628=_0x18bafa[_0x7196('0x67')][_0x33d5bf];var _0x48608b=_0x460e51[_0x7196('0x76')]();_0x48608b['where']('ut.UserId\x20=\x20?',_0x10b628['id']);_0x3639be['push'](db['sequelize']['query'](_0x48608b[_0x7196('0x77')](),{'type':db[_0x7196('0x69')][_0x7196('0x78')]['SELECT']})[_0x7196('0x29')](function(_0x49bf7e){if(_0x49bf7e['length']===0x1){return _0x10b628['id'];}else{var _0x4f7717=_[_0x7196('0x79')](_['map'](_0x49bf7e,_0x7196('0x7a')),function(_0x2fe382){return _[_0x7196('0x7b')](_0x441ca1,_0x2fe382);});if(_0x4f7717){return _0x10b628['id'];}}}));}}return BPromise[_0x7196('0x7c')](_0x3639be)[_0x7196('0x29')](function(_0x36893a){_0x5d5d1f=_(_0x5d5d1f)[_0x7196('0x7d')](_0x36893a)[_0x7196('0x7e')]()['value']();return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x4b98de[_0x7196('0x54')]['id']}})['then'](function(_0x3a241a){return db[_0x7196('0x69')][_0x7196('0x6a')](function(_0x4fa1b5){return _0x3a241a[_0x7196('0x70')](_0x4b98de[_0x7196('0x37')][_0x7196('0x71')],{'transaction':_0x4fa1b5})['then'](function(){if(!_[_0x7196('0x7f')](_0x5d5d1f)){return _0x3a241a[_0x7196('0x80')](_0x5d5d1f,{'transaction':_0x4fa1b5});}})['then'](function(){_0x5d5d1f[_0x7196('0x6d')](function(_0x5db5f1){socket[_0x7196('0x6e')](_0x7196('0x81'),{'UserId':_0x5db5f1,'SmsQueueId':_0x3a241a['id']});});});});});});})['then'](respondWithStatusCode(_0x53ae84,null))[_0x7196('0x49')](handleError(_0x53ae84,null));};exports['addAgents']=function(_0x5d24ff,_0x2cae94,_0x4738c2){return db['SmsQueue'][_0x7196('0x50')]({'where':{'id':_0x5d24ff[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x2cae94,null))[_0x7196('0x29')](function(_0x5b91e5){if(_0x5b91e5){return _0x5b91e5[_0x7196('0x82')](_0x5d24ff[_0x7196('0x4c')][_0x7196('0x71')],_['omit'](_0x5d24ff['body'],[_0x7196('0x71'),'id'])||{})[_0x7196('0x83')](function(_0x87184a){for(var _0x2af201=0x0;_0x2af201<_0x5d24ff['body'][_0x7196('0x71')]['length'];_0x2af201+=0x1){socket[_0x7196('0x6e')]('userSmsQueue:save',{'UserId':_0x5d24ff[_0x7196('0x4c')][_0x7196('0x71')][_0x2af201],'SmsQueueId':_0x5d24ff[_0x7196('0x54')]['id']});}return _0x87184a;});}})[_0x7196('0x29')](respondWithResult(_0x2cae94,null))[_0x7196('0x49')](handleError(_0x2cae94,null));};exports[_0x7196('0x80')]=function(_0x342fb1,_0x4c9c35,_0x1ae8bc){return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x342fb1[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x4c9c35,null))[_0x7196('0x29')](function(_0x186731){if(_0x186731){return _0x186731[_0x7196('0x80')](_0x342fb1['query'][_0x7196('0x71')])[_0x7196('0x29')](function(){if(_['isArray'](_0x342fb1[_0x7196('0x37')][_0x7196('0x71')])){for(var _0x4fa57e=0x0;_0x4fa57e<_0x342fb1[_0x7196('0x37')][_0x7196('0x71')][_0x7196('0x3b')];_0x4fa57e+=0x1){socket[_0x7196('0x6e')]('userSmsQueue:remove',{'UserId':Number(_0x342fb1['query'][_0x7196('0x71')][_0x4fa57e]),'SmsQueueId':Number(_0x342fb1['params']['id'])});}}else{socket[_0x7196('0x6e')](_0x7196('0x81'),{'UserId':Number(_0x342fb1[_0x7196('0x37')][_0x7196('0x71')]),'SmsQueueId':Number(_0x342fb1[_0x7196('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c9c35,null))[_0x7196('0x49')](handleError(_0x4c9c35,null));};exports[_0x7196('0x84')]=function(_0x163857,_0x1948b8,_0x1bd2dc){var _0x2b954c={};var _0x446a99={};var _0x149144;var _0x11fb5b;return db['SmsQueue']['findOne']({'where':{'id':_0x163857['params']['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x1948b8,null))[_0x7196('0x29')](function(_0x92179b){if(_0x92179b){_0x149144=_0x92179b;_0x446a99[_0x7196('0x36')]=_[_0x7196('0x58')](db[_0x7196('0x5c')][_0x7196('0x32')]);_0x446a99[_0x7196('0x37')]=_['keys'](_0x163857['query']);_0x446a99['filters']=_['intersection'](_0x446a99[_0x7196('0x36')],_0x446a99[_0x7196('0x37')]);_0x2b954c[_0x7196('0x39')]=_[_0x7196('0x38')](_0x446a99[_0x7196('0x36')],qs[_0x7196('0x3a')](_0x163857['query'][_0x7196('0x3a')]));_0x2b954c['attributes']=_0x2b954c['attributes'][_0x7196('0x3b')]?_0x2b954c['attributes']:_0x446a99['model'];_0x2b954c[_0x7196('0x3e')]=qs['sort'](_0x163857[_0x7196('0x37')][_0x7196('0x3f')]);_0x2b954c[_0x7196('0x40')]=qs[_0x7196('0x4a')](_[_0x7196('0x41')](_0x163857[_0x7196('0x37')],_0x446a99['filters']));if(_0x163857[_0x7196('0x37')][_0x7196('0x44')]){_0x2b954c[_0x7196('0x40')]=_['merge'](_0x2b954c[_0x7196('0x40')],{'$or':_[_0x7196('0x30')](_0x2b954c[_0x7196('0x39')],function(_0x48262c){var _0x571fa5={};_0x571fa5[_0x48262c]={'$like':'%'+_0x163857[_0x7196('0x37')][_0x7196('0x44')]+'%'};return _0x571fa5;})});}_0x2b954c=_[_0x7196('0x42')]({},_0x2b954c,_0x163857[_0x7196('0x45')]);return _0x149144[_0x7196('0x84')](_0x2b954c);}})[_0x7196('0x29')](function(_0x1a8a5a){if(_0x1a8a5a){_0x11fb5b=_0x1a8a5a[_0x7196('0x3b')];if(!_0x163857[_0x7196('0x37')][_0x7196('0x5a')]('nolimit')){_0x2b954c[_0x7196('0x3d')]=qs[_0x7196('0x3d')](_0x163857['query'][_0x7196('0x3d')]);_0x2b954c[_0x7196('0x25')]=qs['offset'](_0x163857[_0x7196('0x37')][_0x7196('0x25')]);}return _0x149144[_0x7196('0x84')](_0x2b954c);}})[_0x7196('0x29')](function(_0x1e7a64){if(_0x1e7a64){return _0x1e7a64?{'count':_0x11fb5b,'rows':_0x1e7a64}:null;}})[_0x7196('0x29')](respondWithResult(_0x1948b8,null))['catch'](handleError(_0x1948b8,null));}; \ No newline at end of file +var _0x2032=['map','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','SmsQueue','findAll','catch','show','params','keys','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SmsQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','nolimit','order','SmsQueueId','options','User','findAndCountAll','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','ids','Team','online','voicePause','interface','Agents','sequelize','transaction','addTeams','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','SELECT','every','TeamId','includes','union','compact','isEmpty','removeAgents','addAgents','omit','spread','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','./smsQueue.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','then','get','UserProfileResource','error','name','send'];(function(_0x3a9b89,_0x3d858b){var _0x116245=function(_0x3dee3d){while(--_0x3dee3d){_0x3a9b89['push'](_0x3a9b89['shift']());}};_0x116245(++_0x3d858b);}(_0x2032,0xd9));var _0x2203=function(_0x41c42c,_0x521157){_0x41c42c=_0x41c42c-0x0;var _0x211c25=_0x2032[_0x41c42c];return _0x211c25;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2203('0x0'));var rimraf=require(_0x2203('0x1'));var zipdir=require(_0x2203('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2203('0x3'));var moment=require(_0x2203('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2203('0x5'));var util=require(_0x2203('0x6'));var path=require(_0x2203('0x7'));var sox=require(_0x2203('0x8'));var csv=require(_0x2203('0x9'));var ejs=require(_0x2203('0xa'));var fs=require('fs');var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var db=require(_0x2203('0x16'))['db'];config[_0x2203('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2203('0x18'))['register'](socket);function respondWithStatusCode(_0x592e47,_0x21a3af){_0x21a3af=_0x21a3af||0xcc;return function(_0x472265){if(_0x472265){return _0x592e47[_0x2203('0x19')](_0x21a3af);}return _0x592e47[_0x2203('0x1a')](_0x21a3af)[_0x2203('0x1b')]();};}function respondWithResult(_0x3fe0a8,_0x2c36e6){_0x2c36e6=_0x2c36e6||0xc8;return function(_0x2c085c){if(_0x2c085c){return _0x3fe0a8[_0x2203('0x1a')](_0x2c36e6)[_0x2203('0x1c')](_0x2c085c);}};}function respondWithFilteredResult(_0x5129fb,_0x280eda){return function(_0x2ee127){if(_0x2ee127){var _0x4893ff=_0x2ee127[_0x2203('0x1d')],_0x3f9ef6=_0x280eda['offset'],_0x8906e1=_0x280eda[_0x2203('0x1e')]+_0x280eda[_0x2203('0x1f')],_0x4aeb9f;if(_0x8906e1>=_0x4893ff){_0x8906e1=_0x4893ff;_0x4aeb9f=0xc8;}else{_0x4aeb9f=0xce;}_0x5129fb[_0x2203('0x1a')](_0x4aeb9f);return _0x5129fb[_0x2203('0x20')](_0x2203('0x21'),_0x3f9ef6+'-'+_0x8906e1+'/'+_0x4893ff)[_0x2203('0x1c')](_0x2ee127);}return null;};}function patchUpdates(_0x538c23){return function(_0x13d3f7){try{jsonpatch['apply'](_0x13d3f7,_0x538c23,!![]);}catch(_0x5ac866){return BPromise[_0x2203('0x22')](_0x5ac866);}return _0x13d3f7['save']();};}function saveUpdates(_0x3b8ef9,_0x5bfe61){return function(_0x5d4c4e){if(_0x5d4c4e){return _0x5d4c4e[_0x2203('0x23')](_0x3b8ef9)['then'](function(_0x5c8da9){return _0x5c8da9;});}return null;};}function removeEntity(_0x226374,_0x2718f5){return function(_0x21f930){if(_0x21f930){return _0x21f930[_0x2203('0x24')]()[_0x2203('0x25')](function(){var _0x3114ef=_0x21f930[_0x2203('0x26')]({'plain':!![]});var _0x250349='SmsQueues';return db[_0x2203('0x27')][_0x2203('0x24')]({'where':{'type':_0x250349,'resourceId':_0x3114ef['id']}})[_0x2203('0x25')](function(){return _0x21f930;});})['then'](function(){_0x226374[_0x2203('0x1a')](0xcc)[_0x2203('0x1b')]();});}};}function handleEntityNotFound(_0x5c5fd3,_0xd6e109){return function(_0xd91f5d){if(!_0xd91f5d){_0x5c5fd3[_0x2203('0x19')](0x194);}return _0xd91f5d;};}function handleError(_0x46b8b9,_0x28ae02){_0x28ae02=_0x28ae02||0x1f4;return function(_0x1df508){logger[_0x2203('0x28')](_0x1df508['stack']);if(_0x1df508[_0x2203('0x29')]){delete _0x1df508[_0x2203('0x29')];}_0x46b8b9[_0x2203('0x1a')](_0x28ae02)[_0x2203('0x2a')](_0x1df508);};}exports['index']=function(_0x3a8e23,_0x21ff0d){var _0x287c95={},_0xf59954={},_0x520602={'count':0x0,'rows':[]};var _0xea1637=_[_0x2203('0x2b')](db['SmsQueue']['rawAttributes'],function(_0x1d5f74){return{'name':_0x1d5f74['fieldName'],'type':_0x1d5f74['type'][_0x2203('0x2c')]};});_0xf59954[_0x2203('0x2d')]=_[_0x2203('0x2b')](_0xea1637,_0x2203('0x29'));_0xf59954[_0x2203('0x2e')]=_['keys'](_0x3a8e23[_0x2203('0x2e')]);_0xf59954[_0x2203('0x2f')]=_['intersection'](_0xf59954[_0x2203('0x2d')],_0xf59954[_0x2203('0x2e')]);_0x287c95[_0x2203('0x30')]=_[_0x2203('0x31')](_0xf59954[_0x2203('0x2d')],qs[_0x2203('0x32')](_0x3a8e23[_0x2203('0x2e')][_0x2203('0x32')]));_0x287c95[_0x2203('0x30')]=_0x287c95['attributes'][_0x2203('0x33')]?_0x287c95[_0x2203('0x30')]:_0xf59954['model'];if(!_0x3a8e23['query'][_0x2203('0x34')]('nolimit')){_0x287c95[_0x2203('0x1f')]=qs[_0x2203('0x1f')](_0x3a8e23[_0x2203('0x2e')]['limit']);_0x287c95['offset']=qs[_0x2203('0x1e')](_0x3a8e23['query'][_0x2203('0x1e')]);}_0x287c95['order']=qs[_0x2203('0x35')](_0x3a8e23['query'][_0x2203('0x35')]);_0x287c95[_0x2203('0x36')]=qs[_0x2203('0x2f')](_[_0x2203('0x37')](_0x3a8e23[_0x2203('0x2e')],_0xf59954['filters']));if(_0x3a8e23['query']['filter']){_0x287c95[_0x2203('0x36')]=_[_0x2203('0x38')](_0x287c95[_0x2203('0x36')],{'$or':_[_0x2203('0x2b')](_0xea1637,function(_0x3283fb){if(_0x3283fb[_0x2203('0x39')]!==_0x2203('0x3a')){var _0x590b4e={};_0x590b4e[_0x3283fb[_0x2203('0x29')]]={'$like':'%'+_0x3a8e23[_0x2203('0x2e')][_0x2203('0x3b')]+'%'};return _0x590b4e;}})});}_0x287c95=_[_0x2203('0x38')]({},_0x287c95,_0x3a8e23['options']);var _0x50d74a={'where':_0x287c95[_0x2203('0x36')]};return db['SmsQueue'][_0x2203('0x1d')](_0x50d74a)[_0x2203('0x25')](function(_0x132091){_0x520602['count']=_0x132091;if(_0x3a8e23['query'][_0x2203('0x3c')]){_0x287c95[_0x2203('0x3d')]=[{'all':!![]}];}return db[_0x2203('0x3e')][_0x2203('0x3f')](_0x287c95);})[_0x2203('0x25')](function(_0x1fa734){_0x520602['rows']=_0x1fa734;return _0x520602;})[_0x2203('0x25')](respondWithFilteredResult(_0x21ff0d,_0x287c95))[_0x2203('0x40')](handleError(_0x21ff0d,null));};exports[_0x2203('0x41')]=function(_0x266076,_0x16b452){var _0x36b99f={'raw':!![],'where':{'id':_0x266076[_0x2203('0x42')]['id']}},_0x5b4842={};_0x5b4842[_0x2203('0x2d')]=_[_0x2203('0x43')](db['SmsQueue'][_0x2203('0x44')]);_0x5b4842[_0x2203('0x2e')]=_[_0x2203('0x43')](_0x266076[_0x2203('0x2e')]);_0x5b4842['filters']=_['intersection'](_0x5b4842[_0x2203('0x2d')],_0x5b4842['query']);_0x36b99f[_0x2203('0x30')]=_[_0x2203('0x31')](_0x5b4842[_0x2203('0x2d')],qs[_0x2203('0x32')](_0x266076['query'][_0x2203('0x32')]));_0x36b99f[_0x2203('0x30')]=_0x36b99f['attributes'][_0x2203('0x33')]?_0x36b99f[_0x2203('0x30')]:_0x5b4842[_0x2203('0x2d')];if(_0x266076[_0x2203('0x2e')]['includeAll']){_0x36b99f['include']=[{'all':!![]}];}_0x36b99f=_[_0x2203('0x38')]({},_0x36b99f,_0x266076['options']);return db['SmsQueue'][_0x2203('0x45')](_0x36b99f)[_0x2203('0x25')](handleEntityNotFound(_0x16b452,null))[_0x2203('0x25')](respondWithResult(_0x16b452,null))['catch'](handleError(_0x16b452,null));};exports['create']=function(_0x131aec,_0x3eecb7){return db[_0x2203('0x3e')][_0x2203('0x46')](_0x131aec[_0x2203('0x47')],{})[_0x2203('0x25')](function(_0x4a7f4e){var _0x747dce=_0x131aec['user'][_0x2203('0x26')]({'plain':!![]});if(!_0x747dce)throw new Error(_0x2203('0x48'));if(_0x747dce[_0x2203('0x49')]===_0x2203('0x4a')){var _0x58b9bb=_0x4a7f4e['get']({'plain':!![]});var _0x30d503=_0x2203('0x4b');return db[_0x2203('0x4c')][_0x2203('0x45')]({'where':{'name':_0x30d503,'userProfileId':_0x747dce['userProfileId']},'raw':!![]})['then'](function(_0x49999a){if(_0x49999a&&_0x49999a[_0x2203('0x4d')]===0x0){return db[_0x2203('0x27')]['create']({'name':_0x58b9bb[_0x2203('0x29')],'resourceId':_0x58b9bb['id'],'type':_0x49999a[_0x2203('0x29')],'sectionId':_0x49999a['id']},{})['then'](function(){return _0x4a7f4e;});}else{return _0x4a7f4e;}})[_0x2203('0x40')](function(_0xb47204){logger[_0x2203('0x28')](_0x2203('0x4e'),_0xb47204);throw _0xb47204;});}return _0x4a7f4e;})['then'](respondWithResult(_0x3eecb7,0xc9))[_0x2203('0x40')](handleError(_0x3eecb7,null));};exports['update']=function(_0x3858f0,_0x1de713){if(_0x3858f0['body']['id']){delete _0x3858f0[_0x2203('0x47')]['id'];}return db[_0x2203('0x3e')][_0x2203('0x45')]({'where':{'id':_0x3858f0[_0x2203('0x42')]['id']}})[_0x2203('0x25')](handleEntityNotFound(_0x1de713,null))[_0x2203('0x25')](saveUpdates(_0x3858f0['body'],null))['then'](respondWithResult(_0x1de713,null))[_0x2203('0x40')](handleError(_0x1de713,null));};exports['destroy']=function(_0x56e881,_0xfddc3b){return db[_0x2203('0x3e')][_0x2203('0x45')]({'where':{'id':_0x56e881['params']['id']}})[_0x2203('0x25')](handleEntityNotFound(_0xfddc3b,null))['then'](removeEntity(_0xfddc3b,null))['catch'](handleError(_0xfddc3b,null));};exports[_0x2203('0x4f')]=function(_0x5be4b6,_0x54ec71){return db['SmsQueue'][_0x2203('0x4f')]()[_0x2203('0x25')](respondWithResult(_0x54ec71,null))[_0x2203('0x40')](handleError(_0x54ec71,null));};exports[_0x2203('0x50')]=function(_0x26d3d9,_0x32f593,_0x2baea2){var _0x91f70c={'raw':!![],'where':{}},_0x36b5fb={},_0x216641;return db[_0x2203('0x3e')][_0x2203('0x51')]({'where':{'id':_0x26d3d9['params']['id']}})['then'](handleEntityNotFound(_0x32f593,null))[_0x2203('0x25')](function(_0x43d8c0){if(_0x43d8c0){_0x216641=_0x43d8c0[_0x2203('0x26')]({'plain':!![]});_0x36b5fb[_0x2203('0x2d')]=_[_0x2203('0x43')](db[_0x2203('0x52')]['rawAttributes']);_0x36b5fb['query']=_[_0x2203('0x43')](_0x26d3d9[_0x2203('0x2e')]);_0x36b5fb[_0x2203('0x2f')]=_[_0x2203('0x31')](_0x36b5fb[_0x2203('0x2d')],_0x36b5fb[_0x2203('0x2e')]);_0x91f70c[_0x2203('0x30')]=_[_0x2203('0x31')](_0x36b5fb[_0x2203('0x2d')],qs[_0x2203('0x32')](_0x26d3d9[_0x2203('0x2e')]['fields']));_0x91f70c[_0x2203('0x30')]=_0x91f70c[_0x2203('0x30')][_0x2203('0x33')]?_0x91f70c[_0x2203('0x30')]:_0x36b5fb[_0x2203('0x2d')];if(!_0x26d3d9[_0x2203('0x2e')][_0x2203('0x34')](_0x2203('0x53'))){_0x91f70c[_0x2203('0x1f')]=qs[_0x2203('0x1f')](_0x26d3d9[_0x2203('0x2e')][_0x2203('0x1f')]);_0x91f70c[_0x2203('0x1e')]=qs[_0x2203('0x1e')](_0x26d3d9[_0x2203('0x2e')][_0x2203('0x1e')]);}_0x91f70c[_0x2203('0x54')]=qs[_0x2203('0x35')](_0x26d3d9[_0x2203('0x2e')][_0x2203('0x35')]);_0x91f70c['where']=qs[_0x2203('0x2f')](_[_0x2203('0x37')](_0x26d3d9[_0x2203('0x2e')],_0x36b5fb['filters']));_0x91f70c[_0x2203('0x36')][_0x2203('0x55')]=_0x43d8c0['id'];if(_0x26d3d9[_0x2203('0x2e')][_0x2203('0x3b')]){_0x91f70c[_0x2203('0x36')]=_['merge'](_0x91f70c[_0x2203('0x36')],{'$or':_[_0x2203('0x2b')](_0x91f70c[_0x2203('0x30')],function(_0x4dde80){var _0x5507b6={};_0x5507b6[_0x4dde80]={'$like':'%'+_0x26d3d9['query']['filter']+'%'};return _0x5507b6;})});}_0x91f70c=_['merge']({},_0x91f70c,_0x26d3d9[_0x2203('0x56')]);return db[_0x2203('0x52')][_0x2203('0x3f')](_0x91f70c);}})[_0x2203('0x25')](function(_0x4287f4){if(_0x4287f4){return db[_0x2203('0x57')][_0x2203('0x58')]({'where':{'id':_[_0x2203('0x2b')](_0x4287f4,'UserId'),'role':'agent'},'attributes':['id',_0x2203('0x29'),_0x2203('0x59'),_0x2203('0x5a'),_0x2203('0x5b')]});}})[_0x2203('0x25')](function(_0x32a348){if(_0x32a348){return{'count':_0x32a348[_0x2203('0x1d')],'rows':_[_0x2203('0x2b')](_0x32a348[_0x2203('0x5c')],function(_0x231bf1){return{'membername':_0x231bf1[_0x2203('0x29')],'UserId':_0x231bf1['id'],'queue_name':_0x216641[_0x2203('0x29')],'SmsQueueId':_0x216641['id'],'interface':util[_0x2203('0x5d')](_0x2203('0x5e'),_0x2203('0x5f'),_0x231bf1[_0x2203('0x29')]),'penalty':0x0,'paused':_0x231bf1[_0x2203('0x59')],'createdAt':_0x231bf1[_0x2203('0x5b')],'updatedAt':_0x231bf1[_0x2203('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x32f593,_0x91f70c))[_0x2203('0x40')](handleError(_0x32f593,null));};exports['getTeams']=function(_0x3382b7,_0x55ecbb,_0x5ba500){var _0xf71e7e={};var _0x269649={};var _0x2f3522;var _0x29c37d;return db[_0x2203('0x3e')][_0x2203('0x51')]({'where':{'id':_0x3382b7[_0x2203('0x42')]['id']}})['then'](handleEntityNotFound(_0x55ecbb,null))['then'](function(_0x38903b){if(_0x38903b){_0x2f3522=_0x38903b;_0x269649[_0x2203('0x2d')]=_[_0x2203('0x43')](db['Team']['rawAttributes']);_0x269649['query']=_[_0x2203('0x43')](_0x3382b7[_0x2203('0x2e')]);_0x269649[_0x2203('0x2f')]=_[_0x2203('0x31')](_0x269649['model'],_0x269649[_0x2203('0x2e')]);_0xf71e7e['attributes']=_[_0x2203('0x31')](_0x269649[_0x2203('0x2d')],qs[_0x2203('0x32')](_0x3382b7[_0x2203('0x2e')][_0x2203('0x32')]));_0xf71e7e['attributes']=_0xf71e7e[_0x2203('0x30')][_0x2203('0x33')]?_0xf71e7e[_0x2203('0x30')]:_0x269649['model'];_0xf71e7e[_0x2203('0x54')]=qs[_0x2203('0x35')](_0x3382b7[_0x2203('0x2e')][_0x2203('0x35')]);_0xf71e7e[_0x2203('0x36')]=qs[_0x2203('0x2f')](_[_0x2203('0x37')](_0x3382b7[_0x2203('0x2e')],_0x269649[_0x2203('0x2f')]));if(_0x3382b7[_0x2203('0x2e')][_0x2203('0x3b')]){_0xf71e7e['where']=_[_0x2203('0x38')](_0xf71e7e[_0x2203('0x36')],{'$or':_[_0x2203('0x2b')](_0xf71e7e[_0x2203('0x30')],function(_0x29670d){var _0x52c35e={};_0x52c35e[_0x29670d]={'$like':'%'+_0x3382b7[_0x2203('0x2e')][_0x2203('0x3b')]+'%'};return _0x52c35e;})});}_0xf71e7e=_[_0x2203('0x38')]({},_0xf71e7e,_0x3382b7[_0x2203('0x56')]);return _0x2f3522[_0x2203('0x60')](_0xf71e7e);}})[_0x2203('0x25')](function(_0x4c332f){if(_0x4c332f){_0x29c37d=_0x4c332f['length'];if(!_0x3382b7[_0x2203('0x2e')][_0x2203('0x34')](_0x2203('0x53'))){_0xf71e7e[_0x2203('0x1f')]=qs[_0x2203('0x1f')](_0x3382b7['query'][_0x2203('0x1f')]);_0xf71e7e[_0x2203('0x1e')]=qs['offset'](_0x3382b7['query']['offset']);}return _0x2f3522['getTeams'](_0xf71e7e);}})['then'](function(_0x2952fc){if(_0x2952fc){return _0x2952fc?{'count':_0x29c37d,'rows':_0x2952fc}:null;}})[_0x2203('0x25')](respondWithResult(_0x55ecbb,null))[_0x2203('0x40')](handleError(_0x55ecbb,null));};exports['addTeams']=function(_0x48a5d6,_0x4ae3ba,_0x1e1969){var _0x1e90c4=_0x48a5d6[_0x2203('0x47')][_0x2203('0x61')];return db[_0x2203('0x62')][_0x2203('0x3f')]({'where':{'id':_0x1e90c4},'attributes':['id'],'include':[{'model':db[_0x2203('0x57')],'as':'Agents','attributes':['id',_0x2203('0x29'),_0x2203('0x63'),_0x2203('0x64'),_0x2203('0x65')],'raw':!![]}]})[_0x2203('0x25')](function(_0x35d508){if(_0x35d508){var _0x13e11f=_['flatMap'](_0x35d508,function(_0x188722){var _0x51a2fe=_0x188722['get']({'plain':!![]});return _0x51a2fe[_0x2203('0x66')];});return db['SmsQueue'][_0x2203('0x45')]({'where':{'id':_0x48a5d6[_0x2203('0x42')]['id']}})['then'](function(_0x29d545){return db[_0x2203('0x67')][_0x2203('0x68')](function(_0x461f90){return _0x29d545[_0x2203('0x69')](_0x1e90c4,{'transaction':_0x461f90})[_0x2203('0x25')](function(){return BPromise['each'](_0x13e11f,function(_0x215638){return db[_0x2203('0x52')]['findOrCreate']({'where':{'UserId':_0x215638['id'],'SmsQueueId':_0x48a5d6['params']['id']},'transaction':_0x461f90});});})[_0x2203('0x25')](function(){_0x13e11f[_0x2203('0x6a')](function(_0x383d3e){socket[_0x2203('0x6b')](_0x2203('0x6c'),{'UserId':_0x383d3e['id'],'SmsQueueId':_0x29d545['id']});});});});});}})[_0x2203('0x25')](respondWithStatusCode(_0x4ae3ba,null))[_0x2203('0x40')](handleError(_0x4ae3ba,null));};exports[_0x2203('0x6d')]=function(_0x4749df,_0x2bfa45,_0x74d185){return db[_0x2203('0x62')][_0x2203('0x3f')]({'where':{'id':_0x4749df[_0x2203('0x2e')][_0x2203('0x61')]},'attributes':['id'],'include':[{'model':db[_0x2203('0x57')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2bfa45,null))[_0x2203('0x25')](function(_0x1295a3){var _0x496637=_[_0x2203('0x2b')](_0x1295a3,'id');var _0x447a95=[];var _0x5b5e95=[];var _0x54014d=squel[_0x2203('0x6e')]();_0x54014d['field'](_0x2203('0x6f'))[_0x2203('0x70')]('team_has_sms_queues','tq')[_0x2203('0x71')](_0x2203('0x72'),'ut',_0x2203('0x73'))[_0x2203('0x36')]('SmsQueueId\x20=\x20?',_0x4749df['params']['id']);for(var _0x2df837=0x0;_0x2df837<_0x1295a3[_0x2203('0x33')];_0x2df837+=0x1){let _0x288980=_0x1295a3[_0x2df837];for(var _0x4ff77f=0x0;_0x4ff77f<_0x288980['Agents'][_0x2203('0x33')];_0x4ff77f+=0x1){let _0x199bec=_0x288980[_0x2203('0x66')][_0x4ff77f];var _0x586273=_0x54014d['clone']();_0x586273[_0x2203('0x36')](_0x2203('0x74'),_0x199bec['id']);_0x5b5e95['push'](db[_0x2203('0x67')][_0x2203('0x2e')](_0x586273['toString'](),{'type':db[_0x2203('0x67')]['QueryTypes'][_0x2203('0x75')]})['then'](function(_0x48f529){if(_0x48f529['length']===0x1){return _0x199bec['id'];}else{var _0x8efc68=_[_0x2203('0x76')](_['map'](_0x48f529,_0x2203('0x77')),function(_0x2d92b1){return _[_0x2203('0x78')](_0x496637,_0x2d92b1);});if(_0x8efc68){return _0x199bec['id'];}}}));}}return BPromise['all'](_0x5b5e95)[_0x2203('0x25')](function(_0x4deb18){_0x447a95=_(_0x447a95)[_0x2203('0x79')](_0x4deb18)[_0x2203('0x7a')]()['value']();return db[_0x2203('0x3e')][_0x2203('0x45')]({'where':{'id':_0x4749df['params']['id']}})[_0x2203('0x25')](function(_0x6e4b4c){return db[_0x2203('0x67')][_0x2203('0x68')](function(_0x34c8aa){return _0x6e4b4c['removeTeams'](_0x4749df[_0x2203('0x2e')][_0x2203('0x61')],{'transaction':_0x34c8aa})[_0x2203('0x25')](function(){if(!_[_0x2203('0x7b')](_0x447a95)){return _0x6e4b4c[_0x2203('0x7c')](_0x447a95,{'transaction':_0x34c8aa});}})[_0x2203('0x25')](function(){_0x447a95['forEach'](function(_0x29b41b){socket[_0x2203('0x6b')]('userSmsQueue:remove',{'UserId':_0x29b41b,'SmsQueueId':_0x6e4b4c['id']});});});});});});})[_0x2203('0x25')](respondWithStatusCode(_0x2bfa45,null))['catch'](handleError(_0x2bfa45,null));};exports[_0x2203('0x7d')]=function(_0x41eaa5,_0xc611e8,_0x59ff03){return db[_0x2203('0x3e')][_0x2203('0x45')]({'where':{'id':_0x41eaa5[_0x2203('0x42')]['id']}})[_0x2203('0x25')](handleEntityNotFound(_0xc611e8,null))[_0x2203('0x25')](function(_0x2cd816){if(_0x2cd816){return _0x2cd816[_0x2203('0x7d')](_0x41eaa5['body']['ids'],_[_0x2203('0x7e')](_0x41eaa5[_0x2203('0x47')],[_0x2203('0x61'),'id'])||{})[_0x2203('0x7f')](function(_0x2188d4){for(var _0xd81faa=0x0;_0xd81faa<_0x41eaa5[_0x2203('0x47')]['ids'][_0x2203('0x33')];_0xd81faa+=0x1){socket[_0x2203('0x6b')]('userSmsQueue:save',{'UserId':_0x41eaa5[_0x2203('0x47')]['ids'][_0xd81faa],'SmsQueueId':_0x41eaa5[_0x2203('0x42')]['id']});}return _0x2188d4;});}})[_0x2203('0x25')](respondWithResult(_0xc611e8,null))['catch'](handleError(_0xc611e8,null));};exports[_0x2203('0x7c')]=function(_0x9586e1,_0x266d7e,_0x9d0f9b){return db[_0x2203('0x3e')][_0x2203('0x45')]({'where':{'id':_0x9586e1[_0x2203('0x42')]['id']}})[_0x2203('0x25')](handleEntityNotFound(_0x266d7e,null))[_0x2203('0x25')](function(_0x2ad96e){if(_0x2ad96e){return _0x2ad96e[_0x2203('0x7c')](_0x9586e1[_0x2203('0x2e')]['ids'])[_0x2203('0x25')](function(){if(_['isArray'](_0x9586e1[_0x2203('0x2e')][_0x2203('0x61')])){for(var _0x3ef34d=0x0;_0x3ef34d<_0x9586e1[_0x2203('0x2e')][_0x2203('0x61')][_0x2203('0x33')];_0x3ef34d+=0x1){socket[_0x2203('0x6b')](_0x2203('0x80'),{'UserId':Number(_0x9586e1[_0x2203('0x2e')][_0x2203('0x61')][_0x3ef34d]),'SmsQueueId':Number(_0x9586e1[_0x2203('0x42')]['id'])});}}else{socket['emit'](_0x2203('0x80'),{'UserId':Number(_0x9586e1['query'][_0x2203('0x61')]),'SmsQueueId':Number(_0x9586e1[_0x2203('0x42')]['id'])});}});}})[_0x2203('0x25')](respondWithStatusCode(_0x266d7e,null))['catch'](handleError(_0x266d7e,null));};exports[_0x2203('0x81')]=function(_0x40a5ad,_0x1add92,_0x3b6426){var _0x4316ae={};var _0x5c1138={};var _0x389f7f;var _0x4914e8;return db[_0x2203('0x3e')][_0x2203('0x51')]({'where':{'id':_0x40a5ad['params']['id']}})[_0x2203('0x25')](handleEntityNotFound(_0x1add92,null))[_0x2203('0x25')](function(_0x138980){if(_0x138980){_0x389f7f=_0x138980;_0x5c1138[_0x2203('0x2d')]=_['keys'](db[_0x2203('0x57')]['rawAttributes']);_0x5c1138['query']=_[_0x2203('0x43')](_0x40a5ad[_0x2203('0x2e')]);_0x5c1138[_0x2203('0x2f')]=_[_0x2203('0x31')](_0x5c1138[_0x2203('0x2d')],_0x5c1138[_0x2203('0x2e')]);_0x4316ae[_0x2203('0x30')]=_['intersection'](_0x5c1138[_0x2203('0x2d')],qs[_0x2203('0x32')](_0x40a5ad[_0x2203('0x2e')]['fields']));_0x4316ae['attributes']=_0x4316ae['attributes'][_0x2203('0x33')]?_0x4316ae[_0x2203('0x30')]:_0x5c1138[_0x2203('0x2d')];_0x4316ae[_0x2203('0x54')]=qs['sort'](_0x40a5ad[_0x2203('0x2e')][_0x2203('0x35')]);_0x4316ae[_0x2203('0x36')]=qs[_0x2203('0x2f')](_['pick'](_0x40a5ad['query'],_0x5c1138[_0x2203('0x2f')]));if(_0x40a5ad[_0x2203('0x2e')][_0x2203('0x3b')]){_0x4316ae['where']=_[_0x2203('0x38')](_0x4316ae[_0x2203('0x36')],{'$or':_[_0x2203('0x2b')](_0x4316ae[_0x2203('0x30')],function(_0x263130){var _0x86d79a={};_0x86d79a[_0x263130]={'$like':'%'+_0x40a5ad[_0x2203('0x2e')]['filter']+'%'};return _0x86d79a;})});}_0x4316ae=_[_0x2203('0x38')]({},_0x4316ae,_0x40a5ad[_0x2203('0x56')]);return _0x389f7f[_0x2203('0x81')](_0x4316ae);}})[_0x2203('0x25')](function(_0x268aca){if(_0x268aca){_0x4914e8=_0x268aca[_0x2203('0x33')];if(!_0x40a5ad[_0x2203('0x2e')][_0x2203('0x34')](_0x2203('0x53'))){_0x4316ae['limit']=qs[_0x2203('0x1f')](_0x40a5ad[_0x2203('0x2e')][_0x2203('0x1f')]);_0x4316ae[_0x2203('0x1e')]=qs['offset'](_0x40a5ad[_0x2203('0x2e')][_0x2203('0x1e')]);}return _0x389f7f[_0x2203('0x81')](_0x4316ae);}})[_0x2203('0x25')](function(_0x35ded1){if(_0x35ded1){return _0x35ded1?{'count':_0x4914e8,'rows':_0x35ded1}:null;}})[_0x2203('0x25')](respondWithResult(_0x1add92,null))[_0x2203('0x40')](handleError(_0x1add92,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 4b08a85..2580542 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 _0x7bd5=['hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x28b6c9,_0xbf4f03){var _0x4a6298=function(_0x2fa579){while(--_0x2fa579){_0x28b6c9['push'](_0x28b6c9['shift']());}};_0x4a6298(++_0xbf4f03);}(_0x7bd5,0xd4));var _0x57bd=function(_0x550cb6,_0x12a9fa){_0x550cb6=_0x550cb6-0x0;var _0x23209e=_0x7bd5[_0x550cb6];return _0x23209e;};'use strict';var EventEmitter=require(_0x57bd('0x0'));var SmsQueue=require(_0x57bd('0x1'))['db'][_0x57bd('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x57bd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x57bd('0x4'),'afterDestroy':_0x57bd('0x5')};function emitEvent(_0x965cf4){return function(_0x3aeafa,_0x2f3f10,_0x1ff08d){SmsQueueEvents[_0x57bd('0x6')](_0x965cf4+':'+_0x3aeafa['id'],_0x3aeafa);SmsQueueEvents[_0x57bd('0x6')](_0x965cf4,_0x3aeafa);_0x1ff08d(null);};}for(var e in events){if(events[_0x57bd('0x7')](e)){var event=events[e];SmsQueue[_0x57bd('0x8')](e,emitEvent(event));}}module[_0x57bd('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0x66da=['SmsQueue','setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4347ec,_0x41c4b8){var _0x4c8314=function(_0x583acd){while(--_0x583acd){_0x4347ec['push'](_0x4347ec['shift']());}};_0x4c8314(++_0x41c4b8);}(_0x66da,0x1e4));var _0xa66d=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x66da[_0x1098db];return _0x14f090;};'use strict';var EventEmitter=require(_0xa66d('0x0'));var SmsQueue=require(_0xa66d('0x1'))['db'][_0xa66d('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa66d('0x3')](0x0);var events={'afterCreate':_0xa66d('0x4'),'afterUpdate':_0xa66d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58ef89){return function(_0x8acda9,_0x36defc,_0x335914){SmsQueueEvents[_0xa66d('0x6')](_0x58ef89+':'+_0x8acda9['id'],_0x8acda9);SmsQueueEvents[_0xa66d('0x6')](_0x58ef89,_0x8acda9);_0x335914(null);};}for(var e in events){if(events[_0xa66d('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xa66d('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 7fd1e93..dff94d7 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 _0x9d77=['sms_queues','lodash','util','../../config/logger','moment','path','rimraf','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0x2aca96,_0x33aa21){var _0x362fab=function(_0x392ffc){while(--_0x392ffc){_0x2aca96['push'](_0x2aca96['shift']());}};_0x362fab(++_0x33aa21);}(_0x9d77,0x1ae));var _0x79d7=function(_0x541d45,_0xb20e38){_0x541d45=_0x541d45-0x0;var _0xbc41eb=_0x9d77[_0x541d45];return _0xbc41eb;};'use strict';var _=require(_0x79d7('0x0'));var util=require(_0x79d7('0x1'));var logger=require(_0x79d7('0x2'))('api');var moment=require(_0x79d7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x79d7('0x4'));var rimraf=require(_0x79d7('0x5'));var config=require('../../config/environment');var attributes=require(_0x79d7('0x6'));module[_0x79d7('0x7')]=function(_0x238860,_0x79adb3){return _0x238860[_0x79d7('0x8')](_0x79d7('0x9'),attributes,{'tableName':_0x79d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb58=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports'];(function(_0x4ad95c,_0x3a6c1b){var _0x1de49c=function(_0x1ba2b0){while(--_0x1ba2b0){_0x4ad95c['push'](_0x4ad95c['shift']());}};_0x1de49c(++_0x3a6c1b);}(_0xeb58,0x1a2));var _0x8eb5=function(_0x31e631,_0x2dadf7){_0x31e631=_0x31e631-0x0;var _0x1e278b=_0xeb58[_0x31e631];return _0x1e278b;};'use strict';var _=require(_0x8eb5('0x0'));var util=require(_0x8eb5('0x1'));var logger=require(_0x8eb5('0x2'))(_0x8eb5('0x3'));var moment=require(_0x8eb5('0x4'));var BPromise=require(_0x8eb5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eb5('0x6'));var rimraf=require(_0x8eb5('0x7'));var config=require(_0x8eb5('0x8'));var attributes=require(_0x8eb5('0x9'));module[_0x8eb5('0xa')]=function(_0x3643e9,_0x5b15e1){return _0x3643e9['define'](_0x8eb5('0xb'),attributes,{'tableName':_0x8eb5('0xc'),'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 cc5b40a..af4c965 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 _0xedea=['debug','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','map','model'];(function(_0xf6a9cf,_0x3c9a33){var _0x384ea0=function(_0x39db77){while(--_0x39db77){_0xf6a9cf['push'](_0xf6a9cf['shift']());}};_0x384ea0(++_0x3c9a33);}(_0xedea,0x14b));var _0xaede=function(_0x4fce6d,_0x562c01){_0x4fce6d=_0x4fce6d-0x0;var _0x204974=_0xedea[_0x4fce6d];return _0x204974;};'use strict';var _=require(_0xaede('0x0'));var util=require(_0xaede('0x1'));var moment=require(_0xaede('0x2'));var BPromise=require(_0xaede('0x3'));var rs=require(_0xaede('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaede('0x5'))['db'];var utils=require(_0xaede('0x6'));var logger=require(_0xaede('0x7'))(_0xaede('0x8'));var config=require(_0xaede('0x9'));var jayson=require(_0xaede('0xa'));var client=jayson[_0xaede('0xb')]['http']({'port':0x232a});config[_0xaede('0xc')]=_[_0xaede('0xd')](config['redis'],{'host':_0xaede('0xe'),'port':0x18eb});var socket=require(_0xaede('0xf'))(new Redis(config[_0xaede('0xc')]));require('./smsQueue.socket')[_0xaede('0x10')](socket);function respondWithRpcPromise(_0x296349,_0xc25a6a,_0x1d9157){return new BPromise(function(_0x3372c1,_0x4fc468){return client[_0xaede('0x11')](_0x296349,_0x1d9157)[_0xaede('0x12')](function(_0x8ca7e0){logger[_0xaede('0x13')](_0xaede('0x14'),_0xc25a6a,'request\x20sent');logger['debug'](_0xaede('0x15'),_0xc25a6a,'request\x20sent',JSON[_0xaede('0x16')](_0x8ca7e0));if(_0x8ca7e0['error']){if(_0x8ca7e0['error']['code']===0x1f4){logger[_0xaede('0x17')](_0xaede('0x14'),_0xc25a6a,_0x8ca7e0[_0xaede('0x17')][_0xaede('0x18')]);return _0x4fc468(_0x8ca7e0[_0xaede('0x17')]['message']);}logger[_0xaede('0x17')]('SmsQueue,\x20%s,\x20%s',_0xc25a6a,_0x8ca7e0[_0xaede('0x17')][_0xaede('0x18')]);return _0x3372c1(_0x8ca7e0[_0xaede('0x17')]['message']);}else{logger[_0xaede('0x13')](_0xaede('0x14'),_0xc25a6a,_0xaede('0x19'));_0x3372c1(_0x8ca7e0[_0xaede('0x1a')]['message']);}})[_0xaede('0x1b')](function(_0x2946d3){logger[_0xaede('0x17')]('SmsQueue,\x20%s,\x20%s',_0xc25a6a,_0x2946d3);_0x4fc468(_0x2946d3);});});}exports[_0xaede('0x1c')]=function(_0x48a301){var _0x54e451=this;return new Promise(function(_0x76c348,_0xd501bb){return db[_0xaede('0x1d')][_0xaede('0x1e')]({'raw':_0x48a301[_0xaede('0x1f')]?_0x48a301[_0xaede('0x1f')][_0xaede('0x20')]===undefined?!![]:![]:!![],'where':_0x48a301[_0xaede('0x1f')]?_0x48a301[_0xaede('0x1f')][_0xaede('0x21')]||null:null,'attributes':_0x48a301[_0xaede('0x1f')]?_0x48a301['options'][_0xaede('0x22')]||null:null,'limit':_0x48a301['options']?_0x48a301[_0xaede('0x1f')]['limit']||null:null,'include':_0x48a301[_0xaede('0x1f')]?_0x48a301[_0xaede('0x1f')][_0xaede('0x23')]?_[_0xaede('0x24')](_0x48a301['options'][_0xaede('0x23')],function(_0x3c8963){return{'model':db[_0x3c8963[_0xaede('0x25')]],'as':_0x3c8963['as'],'attributes':_0x3c8963[_0xaede('0x22')],'include':_0x3c8963[_0xaede('0x23')]?_[_0xaede('0x24')](_0x3c8963['include'],function(_0x5f596d){return{'model':db[_0x5f596d[_0xaede('0x25')]],'as':_0x5f596d['as'],'attributes':_0x5f596d['attributes'],'include':_0x5f596d['include']?_[_0xaede('0x24')](_0x5f596d[_0xaede('0x23')],function(_0x1e73eb){return{'model':db[_0x1e73eb[_0xaede('0x25')]],'as':_0x1e73eb['as'],'attributes':_0x1e73eb['attributes']};}):[]};}):[]};}):[]:[]})[_0xaede('0x12')](function(_0x178ce6){logger['info'](_0xaede('0x1c'),_0x48a301);logger[_0xaede('0x26')]('GetSmsQueue',_0x48a301,JSON[_0xaede('0x16')](_0x178ce6));_0x76c348(_0x178ce6);})['catch'](function(_0x118c73){logger[_0xaede('0x17')]('GetSmsQueue',_0x118c73[_0xaede('0x18')],_0x48a301);_0xd501bb(_0x54e451[_0xaede('0x17')](0x1f4,_0x118c73[_0xaede('0x18')]));});});};exports[_0xaede('0x27')]=function(_0x140149){var _0x30dda0=this;return new Promise(function(_0x2aa3d6,_0x167884){return db[_0xaede('0x1d')][_0xaede('0x28')]({'raw':_0x140149[_0xaede('0x1f')]?_0x140149[_0xaede('0x1f')][_0xaede('0x20')]===undefined?!![]:![]:!![],'where':_0x140149[_0xaede('0x1f')]?_0x140149[_0xaede('0x1f')][_0xaede('0x21')]||null:null,'attributes':_0x140149[_0xaede('0x1f')]?_0x140149[_0xaede('0x1f')][_0xaede('0x22')]||null:null,'include':_0x140149[_0xaede('0x1f')]?_0x140149[_0xaede('0x1f')][_0xaede('0x23')]?_[_0xaede('0x24')](_0x140149[_0xaede('0x1f')][_0xaede('0x23')],function(_0x20e093){return{'model':db[_0x20e093[_0xaede('0x25')]],'as':_0x20e093['as'],'attributes':_0x20e093[_0xaede('0x22')],'include':_0x20e093[_0xaede('0x23')]?_[_0xaede('0x24')](_0x20e093[_0xaede('0x23')],function(_0x1689d3){return{'model':db[_0x1689d3[_0xaede('0x25')]],'as':_0x1689d3['as'],'attributes':_0x1689d3[_0xaede('0x22')],'include':_0x1689d3[_0xaede('0x23')]?_[_0xaede('0x24')](_0x1689d3[_0xaede('0x23')],function(_0x52f4da){return{'model':db[_0x52f4da['model']],'as':_0x52f4da['as'],'attributes':_0x52f4da['attributes']};}):[]};}):[]};}):[]:[]})[_0xaede('0x12')](function(_0xd87f75){logger['info'](_0xaede('0x27'),_0x140149);logger[_0xaede('0x26')]('ShowSmsQueue',_0x140149,JSON[_0xaede('0x16')](_0xd87f75));_0x2aa3d6(_0xd87f75);})[_0xaede('0x1b')](function(_0x4ab8e0){logger['error'](_0xaede('0x27'),_0x4ab8e0['message'],_0x140149);_0x167884(_0x30dda0[_0xaede('0x17')](0x1f4,_0x4ab8e0[_0xaede('0x18')]));});});}; \ No newline at end of file +var _0x6d55=['./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsQueue','findAll','raw','options','where','attributes','limit','map','include','model','GetSmsQueue','ShowSmsQueue','find','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter'];(function(_0x30ef70,_0x48f421){var _0x496cb4=function(_0x331182){while(--_0x331182){_0x30ef70['push'](_0x30ef70['shift']());}};_0x496cb4(++_0x48f421);}(_0x6d55,0x10b));var _0x56d5=function(_0xab8668,_0x5204ac){_0xab8668=_0xab8668-0x0;var _0x571c10=_0x6d55[_0xab8668];return _0x571c10;};'use strict';var _=require('lodash');var util=require(_0x56d5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x56d5('0x1'));var fs=require('fs');var Redis=require(_0x56d5('0x2'));var db=require(_0x56d5('0x3'))['db'];var utils=require(_0x56d5('0x4'));var logger=require(_0x56d5('0x5'))(_0x56d5('0x6'));var config=require('../../config/environment');var jayson=require(_0x56d5('0x7'));var client=jayson[_0x56d5('0x8')]['http']({'port':0x232a});config['redis']=_[_0x56d5('0x9')](config[_0x56d5('0xa')],{'host':_0x56d5('0xb'),'port':0x18eb});var socket=require(_0x56d5('0xc'))(new Redis(config[_0x56d5('0xa')]));require(_0x56d5('0xd'))[_0x56d5('0xe')](socket);function respondWithRpcPromise(_0x5001f2,_0x4bcda2,_0x13df7a){return new BPromise(function(_0x216708,_0x193ce2){return client[_0x56d5('0xf')](_0x5001f2,_0x13df7a)[_0x56d5('0x10')](function(_0x180d78){logger[_0x56d5('0x11')](_0x56d5('0x12'),_0x4bcda2,'request\x20sent');logger[_0x56d5('0x13')](_0x56d5('0x14'),_0x4bcda2,_0x56d5('0x15'),JSON[_0x56d5('0x16')](_0x180d78));if(_0x180d78[_0x56d5('0x17')]){if(_0x180d78[_0x56d5('0x17')][_0x56d5('0x18')]===0x1f4){logger['error'](_0x56d5('0x12'),_0x4bcda2,_0x180d78[_0x56d5('0x17')][_0x56d5('0x19')]);return _0x193ce2(_0x180d78['error'][_0x56d5('0x19')]);}logger[_0x56d5('0x17')](_0x56d5('0x12'),_0x4bcda2,_0x180d78['error'][_0x56d5('0x19')]);return _0x216708(_0x180d78[_0x56d5('0x17')][_0x56d5('0x19')]);}else{logger[_0x56d5('0x11')](_0x56d5('0x12'),_0x4bcda2,'request\x20sent');_0x216708(_0x180d78['result'][_0x56d5('0x19')]);}})[_0x56d5('0x1a')](function(_0xf579e){logger[_0x56d5('0x17')](_0x56d5('0x12'),_0x4bcda2,_0xf579e);_0x193ce2(_0xf579e);});});}exports['GetSmsQueue']=function(_0x5106fd){var _0x440393=this;return new Promise(function(_0x42b29c,_0x5bfeec){return db[_0x56d5('0x1b')][_0x56d5('0x1c')]({'raw':_0x5106fd['options']?_0x5106fd['options'][_0x56d5('0x1d')]===undefined?!![]:![]:!![],'where':_0x5106fd[_0x56d5('0x1e')]?_0x5106fd[_0x56d5('0x1e')][_0x56d5('0x1f')]||null:null,'attributes':_0x5106fd[_0x56d5('0x1e')]?_0x5106fd[_0x56d5('0x1e')][_0x56d5('0x20')]||null:null,'limit':_0x5106fd[_0x56d5('0x1e')]?_0x5106fd[_0x56d5('0x1e')][_0x56d5('0x21')]||null:null,'include':_0x5106fd[_0x56d5('0x1e')]?_0x5106fd[_0x56d5('0x1e')]['include']?_[_0x56d5('0x22')](_0x5106fd[_0x56d5('0x1e')][_0x56d5('0x23')],function(_0x3cbb5d){return{'model':db[_0x3cbb5d[_0x56d5('0x24')]],'as':_0x3cbb5d['as'],'attributes':_0x3cbb5d[_0x56d5('0x20')],'include':_0x3cbb5d[_0x56d5('0x23')]?_[_0x56d5('0x22')](_0x3cbb5d[_0x56d5('0x23')],function(_0x4a8b89){return{'model':db[_0x4a8b89[_0x56d5('0x24')]],'as':_0x4a8b89['as'],'attributes':_0x4a8b89[_0x56d5('0x20')],'include':_0x4a8b89[_0x56d5('0x23')]?_[_0x56d5('0x22')](_0x4a8b89[_0x56d5('0x23')],function(_0x5c3f66){return{'model':db[_0x5c3f66[_0x56d5('0x24')]],'as':_0x5c3f66['as'],'attributes':_0x5c3f66[_0x56d5('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x574f4d){logger[_0x56d5('0x11')](_0x56d5('0x25'),_0x5106fd);logger[_0x56d5('0x13')](_0x56d5('0x25'),_0x5106fd,JSON[_0x56d5('0x16')](_0x574f4d));_0x42b29c(_0x574f4d);})[_0x56d5('0x1a')](function(_0x7eee4){logger[_0x56d5('0x17')](_0x56d5('0x25'),_0x7eee4[_0x56d5('0x19')],_0x5106fd);_0x5bfeec(_0x440393[_0x56d5('0x17')](0x1f4,_0x7eee4[_0x56d5('0x19')]));});});};exports[_0x56d5('0x26')]=function(_0x434c83){var _0x5f00ae=this;return new Promise(function(_0x4f5521,_0x118924){return db[_0x56d5('0x1b')][_0x56d5('0x27')]({'raw':_0x434c83[_0x56d5('0x1e')]?_0x434c83[_0x56d5('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x434c83[_0x56d5('0x1e')]?_0x434c83[_0x56d5('0x1e')][_0x56d5('0x1f')]||null:null,'attributes':_0x434c83['options']?_0x434c83[_0x56d5('0x1e')]['attributes']||null:null,'include':_0x434c83[_0x56d5('0x1e')]?_0x434c83[_0x56d5('0x1e')][_0x56d5('0x23')]?_['map'](_0x434c83[_0x56d5('0x1e')][_0x56d5('0x23')],function(_0x29c064){return{'model':db[_0x29c064['model']],'as':_0x29c064['as'],'attributes':_0x29c064[_0x56d5('0x20')],'include':_0x29c064[_0x56d5('0x23')]?_[_0x56d5('0x22')](_0x29c064[_0x56d5('0x23')],function(_0x349ff5){return{'model':db[_0x349ff5[_0x56d5('0x24')]],'as':_0x349ff5['as'],'attributes':_0x349ff5[_0x56d5('0x20')],'include':_0x349ff5[_0x56d5('0x23')]?_[_0x56d5('0x22')](_0x349ff5[_0x56d5('0x23')],function(_0x447b99){return{'model':db[_0x447b99['model']],'as':_0x447b99['as'],'attributes':_0x447b99[_0x56d5('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a992b){logger[_0x56d5('0x11')](_0x56d5('0x26'),_0x434c83);logger[_0x56d5('0x13')](_0x56d5('0x26'),_0x434c83,JSON['stringify'](_0x4a992b));_0x4f5521(_0x4a992b);})['catch'](function(_0x38baf3){logger[_0x56d5('0x17')](_0x56d5('0x26'),_0x38baf3['message'],_0x434c83);_0x118924(_0x5f00ae[_0x56d5('0x17')](0x1f4,_0x38baf3[_0x56d5('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 131c414..b15d9ee 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 _0xe57f=['length','smsQueue:','./smsQueue.events','save','remove','update','removeListener','register'];(function(_0x473b08,_0x35d676){var _0x5bbdd5=function(_0x4efabf){while(--_0x4efabf){_0x473b08['push'](_0x473b08['shift']());}};_0x5bbdd5(++_0x35d676);}(_0xe57f,0xda));var _0xfe57=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe57f[_0x4565bf];return _0x5610ba;};'use strict';var SmsQueueEvents=require(_0xfe57('0x0'));var events=[_0xfe57('0x1'),_0xfe57('0x2'),_0xfe57('0x3')];function createListener(_0x2e7150,_0x31c0ed){return function(_0x494358){_0x31c0ed['emit'](_0x2e7150,_0x494358);};}function removeListener(_0x104066,_0x3d4b34){return function(){SmsQueueEvents[_0xfe57('0x4')](_0x104066,_0x3d4b34);};}exports[_0xfe57('0x5')]=function(_0x21f76f){for(var _0x4a99a9=0x0,_0x42a6aa=events[_0xfe57('0x6')];_0x4a99a9<_0x42a6aa;_0x4a99a9++){var _0x58fcb4=events[_0x4a99a9];var _0x4e1ad1=createListener(_0xfe57('0x7')+_0x58fcb4,_0x21f76f);SmsQueueEvents['on'](_0x58fcb4,_0x4e1ad1);}}; \ No newline at end of file +var _0x0ba2=['save','remove','update','emit','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x64411,_0x2dd485){var _0x19c7fe=function(_0x40599a){while(--_0x40599a){_0x64411['push'](_0x64411['shift']());}};_0x19c7fe(++_0x2dd485);}(_0x0ba2,0x170));var _0x20ba=function(_0x3d4864,_0x10ff93){_0x3d4864=_0x3d4864-0x0;var _0x489010=_0x0ba2[_0x3d4864];return _0x489010;};'use strict';var SmsQueueEvents=require(_0x20ba('0x0'));var events=[_0x20ba('0x1'),_0x20ba('0x2'),_0x20ba('0x3')];function createListener(_0x3d76d2,_0xa9fb47){return function(_0x3975f9){_0xa9fb47[_0x20ba('0x4')](_0x3d76d2,_0x3975f9);};}function removeListener(_0x5e1b96,_0x46354f){return function(){SmsQueueEvents[_0x20ba('0x5')](_0x5e1b96,_0x46354f);};}exports[_0x20ba('0x6')]=function(_0xaeed44){for(var _0x31537c=0x0,_0x2981f0=events[_0x20ba('0x7')];_0x31537c<_0x2981f0;_0x31537c++){var _0x25e689=events[_0x31537c];var _0x5da5fc=createListener(_0x20ba('0x8')+_0x25e689,_0xaeed44);SmsQueueEvents['on'](_0x25e689,_0x5da5fc);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 03ddf7f..9819dda 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 _0x4cd9=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','isAuthenticated','describe','get','post','create','put','/:id','update','delete','destroy','exports','util'];(function(_0xbf9dce,_0x436c13){var _0x21fb0a=function(_0x1d4806){while(--_0x1d4806){_0xbf9dce['push'](_0xbf9dce['shift']());}};_0x21fb0a(++_0x436c13);}(_0x4cd9,0x168));var _0x94cd=function(_0x59aa68,_0x997435){_0x59aa68=_0x59aa68-0x0;var _0x23eff8=_0x4cd9[_0x59aa68];return _0x23eff8;};'use strict';var multer=require('multer');var util=require(_0x94cd('0x0'));var path=require(_0x94cd('0x1'));var timeout=require(_0x94cd('0x2'));var express=require(_0x94cd('0x3'));var router=express[_0x94cd('0x4')]();var auth=require(_0x94cd('0x5'));var interaction=require(_0x94cd('0x6'));var config=require('../../config/environment');var controller=require(_0x94cd('0x7'));router['get']('/',auth[_0x94cd('0x8')](),controller['index']);router['get']('/describe',auth[_0x94cd('0x8')](),controller[_0x94cd('0x9')]);router[_0x94cd('0xa')]('/:id',auth[_0x94cd('0x8')](),controller['show']);router[_0x94cd('0xb')]('/',auth[_0x94cd('0x8')](),controller[_0x94cd('0xc')]);router[_0x94cd('0xd')](_0x94cd('0xe'),auth[_0x94cd('0x8')](),controller[_0x94cd('0xf')]);router[_0x94cd('0x10')](_0x94cd('0xe'),auth[_0x94cd('0x8')](),controller[_0x94cd('0x11')]);module[_0x94cd('0x12')]=router; \ No newline at end of file +var _0x88ad=['index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get'];(function(_0x12c5e6,_0x3b9ae0){var _0x387976=function(_0x5e47e3){while(--_0x5e47e3){_0x12c5e6['push'](_0x12c5e6['shift']());}};_0x387976(++_0x3b9ae0);}(_0x88ad,0x1f0));var _0xd88a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x88ad[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xd88a('0x0'));var util=require(_0xd88a('0x1'));var path=require(_0xd88a('0x2'));var timeout=require('connect-timeout');var express=require(_0xd88a('0x3'));var router=express[_0xd88a('0x4')]();var auth=require(_0xd88a('0x5'));var interaction=require(_0xd88a('0x6'));var config=require(_0xd88a('0x7'));var controller=require(_0xd88a('0x8'));router[_0xd88a('0x9')]('/',auth['isAuthenticated'](),controller[_0xd88a('0xa')]);router['get'](_0xd88a('0xb'),auth[_0xd88a('0xc')](),controller[_0xd88a('0xd')]);router['get'](_0xd88a('0xe'),auth[_0xd88a('0xc')](),controller[_0xd88a('0xf')]);router[_0xd88a('0x10')]('/',auth[_0xd88a('0xc')](),controller[_0xd88a('0x11')]);router[_0xd88a('0x12')](_0xd88a('0xe'),auth['isAuthenticated'](),controller[_0xd88a('0x13')]);router[_0xd88a('0x14')](_0xd88a('0xe'),auth[_0xd88a('0xc')](),controller[_0xd88a('0x15')]);module[_0xd88a('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 5c9bebf..16853dc 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 _0x8cd6=['STRING','DATE','sequelize','exports'];(function(_0x2c4b5b,_0x4db47a){var _0x32565c=function(_0x2b41bd){while(--_0x2b41bd){_0x2c4b5b['push'](_0x2c4b5b['shift']());}};_0x32565c(++_0x4db47a);}(_0x8cd6,0x162));var _0x68cd=function(_0x26f81c,_0x54d3ba){_0x26f81c=_0x26f81c-0x0;var _0x120abd=_0x8cd6[_0x26f81c];return _0x120abd;};'use strict';var moment=require('moment');var Sequelize=require(_0x68cd('0x0'));module[_0x68cd('0x1')]={'uniqueid':{'type':Sequelize[_0x68cd('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x68cd('0x2')]},'joinAt':{'type':Sequelize[_0x68cd('0x3')]},'leaveAt':{'type':Sequelize[_0x68cd('0x3')]},'acceptAt':{'type':Sequelize[_0x68cd('0x3')]},'exitAt':{'type':Sequelize[_0x68cd('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x636b=['DATE','sequelize','exports','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x636b,0x161));var _0xb636=function(_0x4622ae,_0x2c98fa){_0x4622ae=_0x4622ae-0x0;var _0x8574ba=_0x636b[_0x4622ae];return _0x8574ba;};'use strict';var moment=require('moment');var Sequelize=require(_0xb636('0x0'));module[_0xb636('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb636('0x2')]},'joinAt':{'type':Sequelize[_0xb636('0x3')]},'leaveAt':{'type':Sequelize[_0xb636('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb636('0x3')]},'reason':{'type':Sequelize[_0xb636('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index e0af9b5..2503f46 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 _0xe488=['count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','filter','includeAll','findAll','rows','catch','show','include','options','find','create','body','params','describe','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/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xe488,0xc4));var _0x8e48=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0xe488[_0x1f7413];return _0x2d2775;};'use strict';var pdf=require(_0x8e48('0x0'));var emlformat=require(_0x8e48('0x1'));var rimraf=require(_0x8e48('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e48('0x3'));var rp=require(_0x8e48('0x4'));var moment=require(_0x8e48('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8e48('0x6'));var util=require(_0x8e48('0x7'));var path=require(_0x8e48('0x8'));var sox=require(_0x8e48('0x9'));var csv=require(_0x8e48('0xa'));var ejs=require(_0x8e48('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8e48('0xc'));var jsforce=require(_0x8e48('0xd'));var deskjs=require(_0x8e48('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8e48('0xf'));var Papa=require(_0x8e48('0x10'));var Redis=require(_0x8e48('0x11'));var authService=require(_0x8e48('0x12'));var qs=require(_0x8e48('0x13'));var as=require(_0x8e48('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e48('0x15'))(_0x8e48('0x16'));var utils=require(_0x8e48('0x17'));var config=require('../../config/environment');var db=require(_0x8e48('0x18'))['db'];function respondWithStatusCode(_0x1297d7,_0x414d99){_0x414d99=_0x414d99||0xcc;return function(_0x3f667e){if(_0x3f667e){return _0x1297d7[_0x8e48('0x19')](_0x414d99);}return _0x1297d7['status'](_0x414d99)[_0x8e48('0x1a')]();};}function respondWithResult(_0x3743cd,_0x22edfc){_0x22edfc=_0x22edfc||0xc8;return function(_0x2691e9){if(_0x2691e9){return _0x3743cd[_0x8e48('0x1b')](_0x22edfc)[_0x8e48('0x1c')](_0x2691e9);}};}function respondWithFilteredResult(_0x45b221,_0x4af664){return function(_0x1cef9e){if(_0x1cef9e){var _0x414c6d=_0x1cef9e[_0x8e48('0x1d')],_0x50cdd3=_0x4af664[_0x8e48('0x1e')],_0x5d8edb=_0x4af664[_0x8e48('0x1e')]+_0x4af664[_0x8e48('0x1f')],_0x285279;if(_0x5d8edb>=_0x414c6d){_0x5d8edb=_0x414c6d;_0x285279=0xc8;}else{_0x285279=0xce;}_0x45b221[_0x8e48('0x1b')](_0x285279);return _0x45b221['set'](_0x8e48('0x20'),_0x50cdd3+'-'+_0x5d8edb+'/'+_0x414c6d)['json'](_0x1cef9e);}return null;};}function patchUpdates(_0x39ae98){return function(_0x1cded9){try{jsonpatch[_0x8e48('0x21')](_0x1cded9,_0x39ae98,!![]);}catch(_0x55775c){return BPromise[_0x8e48('0x22')](_0x55775c);}return _0x1cded9[_0x8e48('0x23')]();};}function saveUpdates(_0x170982,_0x5b48d1){return function(_0x5575c1){if(_0x5575c1){return _0x5575c1[_0x8e48('0x24')](_0x170982)[_0x8e48('0x25')](function(_0x4ff227){return _0x4ff227;});}return null;};}function removeEntity(_0x553e40,_0x2a110c){return function(_0x1320e4){if(_0x1320e4){return _0x1320e4[_0x8e48('0x26')]()[_0x8e48('0x25')](function(){_0x553e40[_0x8e48('0x1b')](0xcc)[_0x8e48('0x1a')]();});}};}function handleEntityNotFound(_0x2ef49f,_0x53eb30){return function(_0x350fb8){if(!_0x350fb8){_0x2ef49f[_0x8e48('0x19')](0x194);}return _0x350fb8;};}function handleError(_0x29d04b,_0x412bb1){_0x412bb1=_0x412bb1||0x1f4;return function(_0x461a0b){logger['error'](_0x461a0b[_0x8e48('0x27')]);if(_0x461a0b[_0x8e48('0x28')]){delete _0x461a0b['name'];}_0x29d04b[_0x8e48('0x1b')](_0x412bb1)['send'](_0x461a0b);};}exports[_0x8e48('0x29')]=function(_0x197ebf,_0x294dae){var _0x29e4df={},_0x3d83b7={},_0x33e1a5={'count':0x0,'rows':[]};var _0x45e3ec=_[_0x8e48('0x2a')](db[_0x8e48('0x2b')][_0x8e48('0x2c')],function(_0x78b3d4){return{'name':_0x78b3d4['fieldName'],'type':_0x78b3d4[_0x8e48('0x2d')][_0x8e48('0x2e')]};});_0x3d83b7[_0x8e48('0x2f')]=_['map'](_0x45e3ec,'name');_0x3d83b7[_0x8e48('0x30')]=_[_0x8e48('0x31')](_0x197ebf[_0x8e48('0x30')]);_0x3d83b7['filters']=_[_0x8e48('0x32')](_0x3d83b7[_0x8e48('0x2f')],_0x3d83b7['query']);_0x29e4df[_0x8e48('0x33')]=_['intersection'](_0x3d83b7[_0x8e48('0x2f')],qs[_0x8e48('0x34')](_0x197ebf[_0x8e48('0x30')]['fields']));_0x29e4df[_0x8e48('0x33')]=_0x29e4df['attributes'][_0x8e48('0x35')]?_0x29e4df[_0x8e48('0x33')]:_0x3d83b7[_0x8e48('0x2f')];if(!_0x197ebf['query'][_0x8e48('0x36')](_0x8e48('0x37'))){_0x29e4df[_0x8e48('0x1f')]=qs[_0x8e48('0x1f')](_0x197ebf[_0x8e48('0x30')][_0x8e48('0x1f')]);_0x29e4df[_0x8e48('0x1e')]=qs['offset'](_0x197ebf[_0x8e48('0x30')][_0x8e48('0x1e')]);}_0x29e4df[_0x8e48('0x38')]=qs[_0x8e48('0x39')](_0x197ebf['query'][_0x8e48('0x39')]);_0x29e4df['where']=qs['filters'](_[_0x8e48('0x3a')](_0x197ebf[_0x8e48('0x30')],_0x3d83b7[_0x8e48('0x3b')]));if(_0x197ebf[_0x8e48('0x30')]['filter']){_0x29e4df[_0x8e48('0x3c')]=_[_0x8e48('0x3d')](_0x29e4df[_0x8e48('0x3c')],{'$or':_[_0x8e48('0x2a')](_0x45e3ec,function(_0x36e8ad){if(_0x36e8ad['type']!=='VIRTUAL'){var _0x218979={};_0x218979[_0x36e8ad[_0x8e48('0x28')]]={'$like':'%'+_0x197ebf[_0x8e48('0x30')][_0x8e48('0x3e')]+'%'};return _0x218979;}})});}_0x29e4df=_['merge']({},_0x29e4df,_0x197ebf['options']);var _0x5a7f47={'where':_0x29e4df['where']};return db[_0x8e48('0x2b')]['count'](_0x5a7f47)['then'](function(_0x8ee7bc){_0x33e1a5[_0x8e48('0x1d')]=_0x8ee7bc;if(_0x197ebf['query'][_0x8e48('0x3f')]){_0x29e4df['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0x8e48('0x40')](_0x29e4df);})[_0x8e48('0x25')](function(_0x2d4da0){_0x33e1a5[_0x8e48('0x41')]=_0x2d4da0;return _0x33e1a5;})[_0x8e48('0x25')](respondWithFilteredResult(_0x294dae,_0x29e4df))[_0x8e48('0x42')](handleError(_0x294dae,null));};exports[_0x8e48('0x43')]=function(_0x149bb2,_0xf7902d){var _0x13ce01={'raw':!![],'where':{'id':_0x149bb2['params']['id']}},_0x1eab45={};_0x1eab45[_0x8e48('0x2f')]=_['keys'](db[_0x8e48('0x2b')][_0x8e48('0x2c')]);_0x1eab45['query']=_[_0x8e48('0x31')](_0x149bb2[_0x8e48('0x30')]);_0x1eab45[_0x8e48('0x3b')]=_[_0x8e48('0x32')](_0x1eab45[_0x8e48('0x2f')],_0x1eab45[_0x8e48('0x30')]);_0x13ce01[_0x8e48('0x33')]=_['intersection'](_0x1eab45['model'],qs[_0x8e48('0x34')](_0x149bb2[_0x8e48('0x30')][_0x8e48('0x34')]));_0x13ce01[_0x8e48('0x33')]=_0x13ce01['attributes'][_0x8e48('0x35')]?_0x13ce01['attributes']:_0x1eab45['model'];if(_0x149bb2[_0x8e48('0x30')][_0x8e48('0x3f')]){_0x13ce01[_0x8e48('0x44')]=[{'all':!![]}];}_0x13ce01=_['merge']({},_0x13ce01,_0x149bb2[_0x8e48('0x45')]);return db[_0x8e48('0x2b')][_0x8e48('0x46')](_0x13ce01)[_0x8e48('0x25')](handleEntityNotFound(_0xf7902d,null))[_0x8e48('0x25')](respondWithResult(_0xf7902d,null))[_0x8e48('0x42')](handleError(_0xf7902d,null));};exports['create']=function(_0x13ce7c,_0x42ae21){return db[_0x8e48('0x2b')][_0x8e48('0x47')](_0x13ce7c[_0x8e48('0x48')],{})[_0x8e48('0x25')](respondWithResult(_0x42ae21,0xc9))[_0x8e48('0x42')](handleError(_0x42ae21,null));};exports[_0x8e48('0x24')]=function(_0x4d636b,_0x367480){if(_0x4d636b[_0x8e48('0x48')]['id']){delete _0x4d636b[_0x8e48('0x48')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x4d636b[_0x8e48('0x49')]['id']}})[_0x8e48('0x25')](handleEntityNotFound(_0x367480,null))['then'](saveUpdates(_0x4d636b[_0x8e48('0x48')],null))[_0x8e48('0x25')](respondWithResult(_0x367480,null))[_0x8e48('0x42')](handleError(_0x367480,null));};exports['destroy']=function(_0x2fb136,_0x1eba14){return db[_0x8e48('0x2b')][_0x8e48('0x46')]({'where':{'id':_0x2fb136[_0x8e48('0x49')]['id']}})['then'](handleEntityNotFound(_0x1eba14,null))[_0x8e48('0x25')](removeEntity(_0x1eba14,null))[_0x8e48('0x42')](handleError(_0x1eba14,null));};exports[_0x8e48('0x4a')]=function(_0x5c91c0,_0x1b0c4a){return db['SmsQueueReport'][_0x8e48('0x4a')]()['then'](respondWithResult(_0x1b0c4a,null))[_0x8e48('0x42')](handleError(_0x1b0c4a,null));}; \ No newline at end of file +var _0xeb2f=['rawAttributes','find','create','body','params','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','map','fieldName','type','model','query','filters','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','SmsQueueReport','count','includeAll','include','rows','catch','show','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb2f,0x1a4));var _0xfeb2=function(_0x3bd068,_0xb17ea5){_0x3bd068=_0x3bd068-0x0;var _0x2aca57=_0xeb2f[_0x3bd068];return _0x2aca57;};'use strict';var pdf=require(_0xfeb2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfeb2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfeb2('0x2'));var rp=require(_0xfeb2('0x3'));var moment=require(_0xfeb2('0x4'));var BPromise=require(_0xfeb2('0x5'));var Mustache=require('mustache');var util=require(_0xfeb2('0x6'));var path=require(_0xfeb2('0x7'));var sox=require(_0xfeb2('0x8'));var csv=require(_0xfeb2('0x9'));var ejs=require(_0xfeb2('0xa'));var fs=require('fs');var _=require(_0xfeb2('0xb'));var squel=require('squel');var crypto=require(_0xfeb2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfeb2('0xd'));var toCsv=require(_0xfeb2('0x9'));var querystring=require(_0xfeb2('0xe'));var Papa=require('papaparse');var Redis=require(_0xfeb2('0xf'));var authService=require(_0xfeb2('0x10'));var qs=require(_0xfeb2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfeb2('0x12'));var logger=require(_0xfeb2('0x13'))(_0xfeb2('0x14'));var utils=require(_0xfeb2('0x15'));var config=require(_0xfeb2('0x16'));var db=require(_0xfeb2('0x17'))['db'];function respondWithStatusCode(_0x39aa87,_0x201cca){_0x201cca=_0x201cca||0xcc;return function(_0x5af783){if(_0x5af783){return _0x39aa87[_0xfeb2('0x18')](_0x201cca);}return _0x39aa87['status'](_0x201cca)['end']();};}function respondWithResult(_0x307252,_0x331495){_0x331495=_0x331495||0xc8;return function(_0x29e1f7){if(_0x29e1f7){return _0x307252[_0xfeb2('0x19')](_0x331495)[_0xfeb2('0x1a')](_0x29e1f7);}};}function respondWithFilteredResult(_0x2f2fd9,_0x1839e6){return function(_0x30e556){if(_0x30e556){var _0x3c8784=_0x30e556['count'],_0x487540=_0x1839e6[_0xfeb2('0x1b')],_0x1613e6=_0x1839e6['offset']+_0x1839e6[_0xfeb2('0x1c')],_0x11fe59;if(_0x1613e6>=_0x3c8784){_0x1613e6=_0x3c8784;_0x11fe59=0xc8;}else{_0x11fe59=0xce;}_0x2f2fd9['status'](_0x11fe59);return _0x2f2fd9[_0xfeb2('0x1d')](_0xfeb2('0x1e'),_0x487540+'-'+_0x1613e6+'/'+_0x3c8784)['json'](_0x30e556);}return null;};}function patchUpdates(_0x2d9ba0){return function(_0x14e3ab){try{jsonpatch['apply'](_0x14e3ab,_0x2d9ba0,!![]);}catch(_0x20c632){return BPromise['reject'](_0x20c632);}return _0x14e3ab[_0xfeb2('0x1f')]();};}function saveUpdates(_0x669cc5,_0x250be0){return function(_0x12306f){if(_0x12306f){return _0x12306f[_0xfeb2('0x20')](_0x669cc5)[_0xfeb2('0x21')](function(_0x51f8f0){return _0x51f8f0;});}return null;};}function removeEntity(_0x4c98d2,_0x11a732){return function(_0x258854){if(_0x258854){return _0x258854[_0xfeb2('0x22')]()[_0xfeb2('0x21')](function(){_0x4c98d2[_0xfeb2('0x19')](0xcc)[_0xfeb2('0x23')]();});}};}function handleEntityNotFound(_0x49ab43,_0x36c7ac){return function(_0x585430){if(!_0x585430){_0x49ab43['sendStatus'](0x194);}return _0x585430;};}function handleError(_0x2bf705,_0x3cf444){_0x3cf444=_0x3cf444||0x1f4;return function(_0x372931){logger[_0xfeb2('0x24')](_0x372931[_0xfeb2('0x25')]);if(_0x372931['name']){delete _0x372931[_0xfeb2('0x26')];}_0x2bf705[_0xfeb2('0x19')](_0x3cf444)[_0xfeb2('0x27')](_0x372931);};}exports['index']=function(_0x19707c,_0x411639){var _0x5e7014={},_0x29be00={},_0x1bce5f={'count':0x0,'rows':[]};var _0x2c5a00=_[_0xfeb2('0x28')](db['SmsQueueReport']['rawAttributes'],function(_0x8350fe){return{'name':_0x8350fe[_0xfeb2('0x29')],'type':_0x8350fe[_0xfeb2('0x2a')]['key']};});_0x29be00[_0xfeb2('0x2b')]=_['map'](_0x2c5a00,'name');_0x29be00[_0xfeb2('0x2c')]=_['keys'](_0x19707c[_0xfeb2('0x2c')]);_0x29be00[_0xfeb2('0x2d')]=_['intersection'](_0x29be00[_0xfeb2('0x2b')],_0x29be00['query']);_0x5e7014[_0xfeb2('0x2e')]=_['intersection'](_0x29be00[_0xfeb2('0x2b')],qs[_0xfeb2('0x2f')](_0x19707c[_0xfeb2('0x2c')]['fields']));_0x5e7014[_0xfeb2('0x2e')]=_0x5e7014[_0xfeb2('0x2e')][_0xfeb2('0x30')]?_0x5e7014['attributes']:_0x29be00['model'];if(!_0x19707c[_0xfeb2('0x2c')]['hasOwnProperty'](_0xfeb2('0x31'))){_0x5e7014['limit']=qs['limit'](_0x19707c[_0xfeb2('0x2c')][_0xfeb2('0x1c')]);_0x5e7014[_0xfeb2('0x1b')]=qs[_0xfeb2('0x1b')](_0x19707c[_0xfeb2('0x2c')][_0xfeb2('0x1b')]);}_0x5e7014[_0xfeb2('0x32')]=qs[_0xfeb2('0x33')](_0x19707c[_0xfeb2('0x2c')]['sort']);_0x5e7014[_0xfeb2('0x34')]=qs['filters'](_['pick'](_0x19707c[_0xfeb2('0x2c')],_0x29be00[_0xfeb2('0x2d')]));if(_0x19707c[_0xfeb2('0x2c')]['filter']){_0x5e7014[_0xfeb2('0x34')]=_[_0xfeb2('0x35')](_0x5e7014[_0xfeb2('0x34')],{'$or':_[_0xfeb2('0x28')](_0x2c5a00,function(_0x1ef8ed){if(_0x1ef8ed['type']!==_0xfeb2('0x36')){var _0x53694e={};_0x53694e[_0x1ef8ed[_0xfeb2('0x26')]]={'$like':'%'+_0x19707c[_0xfeb2('0x2c')]['filter']+'%'};return _0x53694e;}})});}_0x5e7014=_['merge']({},_0x5e7014,_0x19707c['options']);var _0x16d5fb={'where':_0x5e7014[_0xfeb2('0x34')]};return db[_0xfeb2('0x37')]['count'](_0x16d5fb)[_0xfeb2('0x21')](function(_0x5cea80){_0x1bce5f[_0xfeb2('0x38')]=_0x5cea80;if(_0x19707c[_0xfeb2('0x2c')][_0xfeb2('0x39')]){_0x5e7014[_0xfeb2('0x3a')]=[{'all':!![]}];}return db[_0xfeb2('0x37')]['findAll'](_0x5e7014);})['then'](function(_0x7e09){_0x1bce5f[_0xfeb2('0x3b')]=_0x7e09;return _0x1bce5f;})[_0xfeb2('0x21')](respondWithFilteredResult(_0x411639,_0x5e7014))[_0xfeb2('0x3c')](handleError(_0x411639,null));};exports[_0xfeb2('0x3d')]=function(_0x218ee3,_0xb811fd){var _0x403c37={'raw':!![],'where':{'id':_0x218ee3['params']['id']}},_0x2bb8ea={};_0x2bb8ea[_0xfeb2('0x2b')]=_[_0xfeb2('0x3e')](db[_0xfeb2('0x37')][_0xfeb2('0x3f')]);_0x2bb8ea[_0xfeb2('0x2c')]=_['keys'](_0x218ee3[_0xfeb2('0x2c')]);_0x2bb8ea[_0xfeb2('0x2d')]=_['intersection'](_0x2bb8ea[_0xfeb2('0x2b')],_0x2bb8ea[_0xfeb2('0x2c')]);_0x403c37[_0xfeb2('0x2e')]=_['intersection'](_0x2bb8ea[_0xfeb2('0x2b')],qs[_0xfeb2('0x2f')](_0x218ee3[_0xfeb2('0x2c')][_0xfeb2('0x2f')]));_0x403c37['attributes']=_0x403c37[_0xfeb2('0x2e')]['length']?_0x403c37['attributes']:_0x2bb8ea['model'];if(_0x218ee3[_0xfeb2('0x2c')]['includeAll']){_0x403c37['include']=[{'all':!![]}];}_0x403c37=_[_0xfeb2('0x35')]({},_0x403c37,_0x218ee3['options']);return db['SmsQueueReport'][_0xfeb2('0x40')](_0x403c37)['then'](handleEntityNotFound(_0xb811fd,null))[_0xfeb2('0x21')](respondWithResult(_0xb811fd,null))[_0xfeb2('0x3c')](handleError(_0xb811fd,null));};exports['create']=function(_0x2cf245,_0x15b7df){return db[_0xfeb2('0x37')][_0xfeb2('0x41')](_0x2cf245[_0xfeb2('0x42')],{})[_0xfeb2('0x21')](respondWithResult(_0x15b7df,0xc9))[_0xfeb2('0x3c')](handleError(_0x15b7df,null));};exports[_0xfeb2('0x20')]=function(_0x499f56,_0x38fd5){if(_0x499f56[_0xfeb2('0x42')]['id']){delete _0x499f56[_0xfeb2('0x42')]['id'];}return db[_0xfeb2('0x37')]['find']({'where':{'id':_0x499f56[_0xfeb2('0x43')]['id']}})[_0xfeb2('0x21')](handleEntityNotFound(_0x38fd5,null))[_0xfeb2('0x21')](saveUpdates(_0x499f56[_0xfeb2('0x42')],null))[_0xfeb2('0x21')](respondWithResult(_0x38fd5,null))[_0xfeb2('0x3c')](handleError(_0x38fd5,null));};exports[_0xfeb2('0x22')]=function(_0x5dad20,_0x52edce){return db[_0xfeb2('0x37')]['find']({'where':{'id':_0x5dad20[_0xfeb2('0x43')]['id']}})[_0xfeb2('0x21')](handleEntityNotFound(_0x52edce,null))['then'](removeEntity(_0x52edce,null))['catch'](handleError(_0x52edce,null));};exports[_0xfeb2('0x44')]=function(_0x1d872b,_0x29a33b){return db[_0xfeb2('0x37')][_0xfeb2('0x44')]()['then'](respondWithResult(_0x29a33b,null))[_0xfeb2('0x3c')](handleError(_0x29a33b,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 6359515..fc6d187 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 _0xa5be=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','SmsQueueReport','uniqueid'];(function(_0x5112e8,_0x4c00ef){var _0x512e44=function(_0x3556b0){while(--_0x3556b0){_0x5112e8['push'](_0x5112e8['shift']());}};_0x512e44(++_0x4c00ef);}(_0xa5be,0x10e));var _0xea5b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa5be[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xea5b('0x0'))(_0xea5b('0x1'));var moment=require(_0xea5b('0x2'));var BPromise=require(_0xea5b('0x3'));var rp=require(_0xea5b('0x4'));var fs=require('fs');var path=require(_0xea5b('0x5'));var rimraf=require('rimraf');var config=require(_0xea5b('0x6'));var attributes=require('./smsQueueReport.attributes');module[_0xea5b('0x7')]=function(_0x22a064,_0xd0240d){return _0x22a064['define'](_0xea5b('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0xea5b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3b46=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','report_sms_queue','uniqueid','lodash','util'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0x3b46,0x1a2));var _0x63b4=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x3b46[_0x50e40b];return _0x2608b7;};'use strict';var _=require(_0x63b4('0x0'));var util=require(_0x63b4('0x1'));var logger=require(_0x63b4('0x2'))(_0x63b4('0x3'));var moment=require('moment');var BPromise=require(_0x63b4('0x4'));var rp=require(_0x63b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63b4('0x6'));var config=require(_0x63b4('0x7'));var attributes=require(_0x63b4('0x8'));module[_0x63b4('0x9')]=function(_0xeab6e8,_0x3a7607){return _0xeab6e8['define']('SmsQueueReport',attributes,{'tableName':_0x63b4('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x63b4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 7bb7036..0188a01 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 _0xe437=['raw','UpdateSmsQueueReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','options'];(function(_0x3edb14,_0x11d7c7){var _0x39e9cb=function(_0x4e6f0e){while(--_0x4e6f0e){_0x3edb14['push'](_0x3edb14['shift']());}};_0x39e9cb(++_0x11d7c7);}(_0xe437,0xa4));var _0x7e43=function(_0x57a8d2,_0x99e349){_0x57a8d2=_0x57a8d2-0x0;var _0x38e021=_0xe437[_0x57a8d2];return _0x38e021;};'use strict';var _=require(_0x7e43('0x0'));var util=require(_0x7e43('0x1'));var moment=require(_0x7e43('0x2'));var BPromise=require(_0x7e43('0x3'));var rs=require(_0x7e43('0x4'));var fs=require('fs');var Redis=require(_0x7e43('0x5'));var db=require(_0x7e43('0x6'))['db'];var utils=require(_0x7e43('0x7'));var logger=require('../../config/logger')(_0x7e43('0x8'));var config=require(_0x7e43('0x9'));var jayson=require(_0x7e43('0xa'));var client=jayson[_0x7e43('0xb')][_0x7e43('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x446ecf,_0x3a07b6,_0x31a595){return new BPromise(function(_0x1ea2e7,_0x22d05c){return client[_0x7e43('0xd')](_0x446ecf,_0x31a595)[_0x7e43('0xe')](function(_0x35dbf2){logger[_0x7e43('0xf')](_0x7e43('0x10'),_0x3a07b6,'request\x20sent');logger[_0x7e43('0x11')](_0x7e43('0x12'),_0x3a07b6,_0x7e43('0x13'),JSON[_0x7e43('0x14')](_0x35dbf2));if(_0x35dbf2[_0x7e43('0x15')]){if(_0x35dbf2[_0x7e43('0x15')][_0x7e43('0x16')]===0x1f4){logger[_0x7e43('0x15')](_0x7e43('0x10'),_0x3a07b6,_0x35dbf2['error'][_0x7e43('0x17')]);return _0x22d05c(_0x35dbf2[_0x7e43('0x15')]['message']);}logger[_0x7e43('0x15')]('SmsQueueReport,\x20%s,\x20%s',_0x3a07b6,_0x35dbf2['error'][_0x7e43('0x17')]);return _0x1ea2e7(_0x35dbf2['error'][_0x7e43('0x17')]);}else{logger[_0x7e43('0xf')](_0x7e43('0x10'),_0x3a07b6,'request\x20sent');_0x1ea2e7(_0x35dbf2[_0x7e43('0x18')][_0x7e43('0x17')]);}})[_0x7e43('0x19')](function(_0xe01741){logger[_0x7e43('0x15')](_0x7e43('0x10'),_0x3a07b6,_0xe01741);_0x22d05c(_0xe01741);});});}exports[_0x7e43('0x1a')]=function(_0x57ea9e){var _0x5a306e=this;return new Promise(function(_0x4991ca,_0x5c2b56){return db['SmsQueueReport']['create'](_0x57ea9e['body'],{'raw':_0x57ea9e[_0x7e43('0x1b')]?_0x57ea9e[_0x7e43('0x1b')][_0x7e43('0x1c')]===undefined?!![]:![]:!![]})[_0x7e43('0xe')](function(_0x297c6b){logger[_0x7e43('0xf')](_0x7e43('0x1a'),_0x57ea9e);logger[_0x7e43('0x11')](_0x7e43('0x1a'),_0x57ea9e,JSON['stringify'](_0x297c6b));_0x4991ca(_0x297c6b);})[_0x7e43('0x19')](function(_0x260424){logger['error'](_0x7e43('0x1a'),_0x260424[_0x7e43('0x17')],_0x57ea9e);_0x5c2b56(_0x5a306e[_0x7e43('0x15')](0x1f4,_0x260424[_0x7e43('0x17')]));});});};exports[_0x7e43('0x1d')]=function(_0x4ce36d){var _0x5d5ef1=this;return new Promise(function(_0x536781,_0x32c54c){return db['SmsQueueReport'][_0x7e43('0x1e')](_0x4ce36d['body'],{'raw':_0x4ce36d[_0x7e43('0x1b')]?_0x4ce36d[_0x7e43('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ce36d[_0x7e43('0x1b')]?_0x4ce36d[_0x7e43('0x1b')]['where']||null:null,'attributes':_0x4ce36d[_0x7e43('0x1b')]?_0x4ce36d[_0x7e43('0x1b')]['attributes']||null:null,'limit':_0x4ce36d[_0x7e43('0x1b')]?_0x4ce36d[_0x7e43('0x1b')][_0x7e43('0x1f')]||null:null})[_0x7e43('0xe')](function(_0x58086a){logger['info']('UpdateSmsQueueReport',_0x4ce36d);logger[_0x7e43('0x11')]('UpdateSmsQueueReport',_0x4ce36d,JSON['stringify'](_0x58086a));_0x536781(_0x58086a);})[_0x7e43('0x19')](function(_0xae5287){logger['error']('UpdateSmsQueueReport',_0xae5287[_0x7e43('0x17')],_0x4ce36d);_0x32c54c(_0x5d5ef1[_0x7e43('0x15')](0x1f4,_0xae5287[_0x7e43('0x17')]));});});}; \ No newline at end of file +var _0x7830=['util','moment','bluebird','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','SmsQueueReport','create','options','raw','then','stringify','update','body','where','attributes','UpdateSmsQueueReport','lodash'];(function(_0x3ec884,_0x3cadda){var _0x1e4e7d=function(_0x2299d0){while(--_0x2299d0){_0x3ec884['push'](_0x3ec884['shift']());}};_0x1e4e7d(++_0x3cadda);}(_0x7830,0x15b));var _0x0783=function(_0x1f9c7b,_0x31b31d){_0x1f9c7b=_0x1f9c7b-0x0;var _0x26df69=_0x7830[_0x1f9c7b];return _0x26df69;};'use strict';var _=require(_0x0783('0x0'));var util=require(_0x0783('0x1'));var moment=require(_0x0783('0x2'));var BPromise=require(_0x0783('0x3'));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(_0x0783('0x4'))('rpc');var config=require(_0x0783('0x5'));var jayson=require(_0x0783('0x6'));var client=jayson[_0x0783('0x7')][_0x0783('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d3a38,_0x5989d4,_0x2aafd1){return new BPromise(function(_0x1c94bc,_0x2fda2e){return client[_0x0783('0x9')](_0x3d3a38,_0x2aafd1)['then'](function(_0x504309){logger[_0x0783('0xa')](_0x0783('0xb'),_0x5989d4,'request\x20sent');logger[_0x0783('0xc')](_0x0783('0xd'),_0x5989d4,'request\x20sent',JSON['stringify'](_0x504309));if(_0x504309[_0x0783('0xe')]){if(_0x504309[_0x0783('0xe')][_0x0783('0xf')]===0x1f4){logger['error'](_0x0783('0xb'),_0x5989d4,_0x504309[_0x0783('0xe')][_0x0783('0x10')]);return _0x2fda2e(_0x504309['error'][_0x0783('0x10')]);}logger[_0x0783('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x5989d4,_0x504309['error']['message']);return _0x1c94bc(_0x504309[_0x0783('0xe')][_0x0783('0x10')]);}else{logger[_0x0783('0xa')](_0x0783('0xb'),_0x5989d4,'request\x20sent');_0x1c94bc(_0x504309['result']['message']);}})[_0x0783('0x11')](function(_0x1ce2fb){logger[_0x0783('0xe')](_0x0783('0xb'),_0x5989d4,_0x1ce2fb);_0x2fda2e(_0x1ce2fb);});});}exports['CreateSmsQueueReport']=function(_0xd2674b){var _0xb39b93=this;return new Promise(function(_0x5d986f,_0x18aa57){return db[_0x0783('0x12')][_0x0783('0x13')](_0xd2674b['body'],{'raw':_0xd2674b['options']?_0xd2674b[_0x0783('0x14')][_0x0783('0x15')]===undefined?!![]:![]:!![]})[_0x0783('0x16')](function(_0xbf59c){logger[_0x0783('0xa')]('CreateSmsQueueReport',_0xd2674b);logger[_0x0783('0xc')]('CreateSmsQueueReport',_0xd2674b,JSON[_0x0783('0x17')](_0xbf59c));_0x5d986f(_0xbf59c);})[_0x0783('0x11')](function(_0x3b3be1){logger[_0x0783('0xe')]('CreateSmsQueueReport',_0x3b3be1['message'],_0xd2674b);_0x18aa57(_0xb39b93[_0x0783('0xe')](0x1f4,_0x3b3be1[_0x0783('0x10')]));});});};exports['UpdateSmsQueueReport']=function(_0x555a94){var _0x11ee1d=this;return new Promise(function(_0x345b53,_0x4d7c24){return db['SmsQueueReport'][_0x0783('0x18')](_0x555a94[_0x0783('0x19')],{'raw':_0x555a94[_0x0783('0x14')]?_0x555a94[_0x0783('0x14')][_0x0783('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x555a94[_0x0783('0x14')]?_0x555a94[_0x0783('0x14')][_0x0783('0x1a')]||null:null,'attributes':_0x555a94['options']?_0x555a94[_0x0783('0x14')][_0x0783('0x1b')]||null:null,'limit':_0x555a94[_0x0783('0x14')]?_0x555a94[_0x0783('0x14')]['limit']||null:null})[_0x0783('0x16')](function(_0x546003){logger[_0x0783('0xa')](_0x0783('0x1c'),_0x555a94);logger[_0x0783('0xc')](_0x0783('0x1c'),_0x555a94,JSON['stringify'](_0x546003));_0x345b53(_0x546003);})['catch'](function(_0x35b1ee){logger[_0x0783('0xe')](_0x0783('0x1c'),_0x35b1ee['message'],_0x555a94);_0x4d7c24(_0x11ee1d['error'](0x1f4,_0x35b1ee[_0x0783('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 9a3e4a2..910b993 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 _0xb7e7=['multer','path','express','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x2dc5f5,_0x5bd7c4){var _0x5f1822=function(_0x26d420){while(--_0x26d420){_0x2dc5f5['push'](_0x2dc5f5['shift']());}};_0x5f1822(++_0x5bd7c4);}(_0xb7e7,0x121));var _0x7b7e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xb7e7[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xc')]);router['put'](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xf')]);module[_0x7b7e('0x10')]=router; \ No newline at end of file +var _0x5c00=['put','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0x57fcd6,_0x70b457){var _0x5b6c73=function(_0x366b6a){while(--_0x366b6a){_0x57fcd6['push'](_0x57fcd6['shift']());}};_0x5b6c73(++_0x70b457);}(_0x5c00,0x17e));var _0x05c0=function(_0x11e90b,_0x3ec29a){_0x11e90b=_0x11e90b-0x0;var _0x31452e=_0x5c00[_0x11e90b];return _0x31452e;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var auth=require(_0x05c0('0x4'));var interaction=require(_0x05c0('0x5'));var config=require(_0x05c0('0x6'));var controller=require(_0x05c0('0x7'));router['get']('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x9')]);router[_0x05c0('0xa')](_0x05c0('0xb'),auth['isAuthenticated'](),controller[_0x05c0('0xc')]);router[_0x05c0('0xa')](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0xe')]);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')](_0x05c0('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x05c0('0x12')]('/:id',auth[_0x05c0('0x8')](),controller[_0x05c0('0x13')]);module[_0x05c0('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 0666013..7b7f601 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 _0xda69=['STRING','ENUM','account','queue','NOW','moment','sequelize'];(function(_0x505574,_0x398058){var _0x5d5264=function(_0x388e93){while(--_0x388e93){_0x505574['push'](_0x505574['shift']());}};_0x5d5264(++_0x398058);}(_0xda69,0x10f));var _0x9da6=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xda69[_0x2db12b];return _0x20990b;};'use strict';var moment=require(_0x9da6('0x0'));var Sequelize=require(_0x9da6('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9da6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9da6('0x3')](_0x9da6('0x4'),'agent',_0x9da6('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9da6('0x6')]}}; \ No newline at end of file +var _0xfc05=['agent','queue','DATE','NOW','moment','exports','STRING','account'];(function(_0xbca15c,_0x5ac4cc){var _0x2f2a88=function(_0x1ab4b6){while(--_0x1ab4b6){_0xbca15c['push'](_0xbca15c['shift']());}};_0x2f2a88(++_0x5ac4cc);}(_0xfc05,0x164));var _0x5fc0=function(_0x107ba9,_0x3f7983){_0x107ba9=_0x107ba9-0x0;var _0x2fcfe7=_0xfc05[_0x107ba9];return _0x2fcfe7;};'use strict';var moment=require(_0x5fc0('0x0'));var Sequelize=require('sequelize');module[_0x5fc0('0x1')]={'uniqueid':{'type':Sequelize[_0x5fc0('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5fc0('0x3'),_0x5fc0('0x4'),_0x5fc0('0x5')),'allowNull':![],'defaultValue':_0x5fc0('0x5')},'transferredAt':{'type':Sequelize[_0x5fc0('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x5fc0('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index a148a5c..d47bf4e 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 _0xae32=['rows','show','params','length','find','create','body','catch','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','save','update','then','destroy','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll'];(function(_0x1938f4,_0x5c0c98){var _0x37f4db=function(_0x5bec0c){while(--_0x5bec0c){_0x1938f4['push'](_0x1938f4['shift']());}};_0x37f4db(++_0x5c0c98);}(_0xae32,0x176));var _0x2ae3=function(_0x5f5742,_0x224e66){_0x5f5742=_0x5f5742-0x0;var _0x5e9091=_0xae32[_0x5f5742];return _0x5e9091;};'use strict';var pdf=require(_0x2ae3('0x0'));var emlformat=require(_0x2ae3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2ae3('0x2'));var jsonpatch=require(_0x2ae3('0x3'));var rp=require('request-promise');var moment=require(_0x2ae3('0x4'));var BPromise=require(_0x2ae3('0x5'));var Mustache=require('mustache');var util=require(_0x2ae3('0x6'));var path=require(_0x2ae3('0x7'));var sox=require(_0x2ae3('0x8'));var csv=require('to-csv');var ejs=require(_0x2ae3('0x9'));var fs=require('fs');var _=require(_0x2ae3('0xa'));var squel=require(_0x2ae3('0xb'));var crypto=require(_0x2ae3('0xc'));var jsforce=require(_0x2ae3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2ae3('0xe'));var querystring=require('querystring');var Papa=require(_0x2ae3('0xf'));var Redis=require(_0x2ae3('0x10'));var authService=require(_0x2ae3('0x11'));var qs=require(_0x2ae3('0x12'));var as=require(_0x2ae3('0x13'));var hardwareService=require(_0x2ae3('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2ae3('0x15'));var config=require(_0x2ae3('0x16'));var db=require(_0x2ae3('0x17'))['db'];function respondWithStatusCode(_0x2f4e9d,_0x14c5bd){_0x14c5bd=_0x14c5bd||0xcc;return function(_0x1d6ef3){if(_0x1d6ef3){return _0x2f4e9d[_0x2ae3('0x18')](_0x14c5bd);}return _0x2f4e9d[_0x2ae3('0x19')](_0x14c5bd)['end']();};}function respondWithResult(_0x5dc2e8,_0xfbeb7b){_0xfbeb7b=_0xfbeb7b||0xc8;return function(_0x5b1a66){if(_0x5b1a66){return _0x5dc2e8[_0x2ae3('0x19')](_0xfbeb7b)[_0x2ae3('0x1a')](_0x5b1a66);}};}function respondWithFilteredResult(_0x4d368b,_0x28fb37){return function(_0x4e86f8){if(_0x4e86f8){var _0xe8799f=_0x4e86f8['count'],_0x5babc0=_0x28fb37[_0x2ae3('0x1b')],_0x460904=_0x28fb37[_0x2ae3('0x1b')]+_0x28fb37[_0x2ae3('0x1c')],_0x2d6dd3;if(_0x460904>=_0xe8799f){_0x460904=_0xe8799f;_0x2d6dd3=0xc8;}else{_0x2d6dd3=0xce;}_0x4d368b['status'](_0x2d6dd3);return _0x4d368b[_0x2ae3('0x1d')]('Content-Range',_0x5babc0+'-'+_0x460904+'/'+_0xe8799f)[_0x2ae3('0x1a')](_0x4e86f8);}return null;};}function patchUpdates(_0xe84b25){return function(_0x2e1bfc){try{jsonpatch[_0x2ae3('0x1e')](_0x2e1bfc,_0xe84b25,!![]);}catch(_0x4787e7){return BPromise['reject'](_0x4787e7);}return _0x2e1bfc[_0x2ae3('0x1f')]();};}function saveUpdates(_0x4641a7,_0x409159){return function(_0x2a6e64){if(_0x2a6e64){return _0x2a6e64[_0x2ae3('0x20')](_0x4641a7)[_0x2ae3('0x21')](function(_0x576a3d){return _0x576a3d;});}return null;};}function removeEntity(_0x5151ed,_0x12aad0){return function(_0x1c25ce){if(_0x1c25ce){return _0x1c25ce[_0x2ae3('0x22')]()[_0x2ae3('0x21')](function(){_0x5151ed['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x355329,_0x4a0786){return function(_0x19856b){if(!_0x19856b){_0x355329[_0x2ae3('0x18')](0x194);}return _0x19856b;};}function handleError(_0x4df774,_0x386cc6){_0x386cc6=_0x386cc6||0x1f4;return function(_0x37ea10){logger['error'](_0x37ea10['stack']);if(_0x37ea10[_0x2ae3('0x23')]){delete _0x37ea10[_0x2ae3('0x23')];}_0x4df774[_0x2ae3('0x19')](_0x386cc6)[_0x2ae3('0x24')](_0x37ea10);};}exports[_0x2ae3('0x25')]=function(_0x2ee14a,_0x30902c){var _0x46f9d1={},_0x1f1d99={},_0xa2b5ce={'count':0x0,'rows':[]};var _0x18f94a=_[_0x2ae3('0x26')](db[_0x2ae3('0x27')][_0x2ae3('0x28')],function(_0x1b56d3){return{'name':_0x1b56d3[_0x2ae3('0x29')],'type':_0x1b56d3['type'][_0x2ae3('0x2a')]};});_0x1f1d99['model']=_[_0x2ae3('0x26')](_0x18f94a,'name');_0x1f1d99[_0x2ae3('0x2b')]=_[_0x2ae3('0x2c')](_0x2ee14a[_0x2ae3('0x2b')]);_0x1f1d99[_0x2ae3('0x2d')]=_[_0x2ae3('0x2e')](_0x1f1d99[_0x2ae3('0x2f')],_0x1f1d99['query']);_0x46f9d1['attributes']=_[_0x2ae3('0x2e')](_0x1f1d99[_0x2ae3('0x2f')],qs[_0x2ae3('0x30')](_0x2ee14a[_0x2ae3('0x2b')][_0x2ae3('0x30')]));_0x46f9d1[_0x2ae3('0x31')]=_0x46f9d1[_0x2ae3('0x31')]['length']?_0x46f9d1[_0x2ae3('0x31')]:_0x1f1d99[_0x2ae3('0x2f')];if(!_0x2ee14a[_0x2ae3('0x2b')][_0x2ae3('0x32')]('nolimit')){_0x46f9d1[_0x2ae3('0x1c')]=qs['limit'](_0x2ee14a[_0x2ae3('0x2b')][_0x2ae3('0x1c')]);_0x46f9d1[_0x2ae3('0x1b')]=qs[_0x2ae3('0x1b')](_0x2ee14a[_0x2ae3('0x2b')][_0x2ae3('0x1b')]);}_0x46f9d1[_0x2ae3('0x33')]=qs[_0x2ae3('0x34')](_0x2ee14a[_0x2ae3('0x2b')][_0x2ae3('0x34')]);_0x46f9d1[_0x2ae3('0x35')]=qs[_0x2ae3('0x2d')](_[_0x2ae3('0x36')](_0x2ee14a[_0x2ae3('0x2b')],_0x1f1d99[_0x2ae3('0x2d')]));if(_0x2ee14a[_0x2ae3('0x2b')][_0x2ae3('0x37')]){_0x46f9d1[_0x2ae3('0x35')]=_[_0x2ae3('0x38')](_0x46f9d1[_0x2ae3('0x35')],{'$or':_[_0x2ae3('0x26')](_0x18f94a,function(_0x4dd5ad){if(_0x4dd5ad[_0x2ae3('0x39')]!==_0x2ae3('0x3a')){var _0x38792d={};_0x38792d[_0x4dd5ad[_0x2ae3('0x23')]]={'$like':'%'+_0x2ee14a[_0x2ae3('0x2b')][_0x2ae3('0x37')]+'%'};return _0x38792d;}})});}_0x46f9d1=_[_0x2ae3('0x38')]({},_0x46f9d1,_0x2ee14a[_0x2ae3('0x3b')]);var _0xb0ea8f={'where':_0x46f9d1[_0x2ae3('0x35')]};return db[_0x2ae3('0x27')][_0x2ae3('0x3c')](_0xb0ea8f)[_0x2ae3('0x21')](function(_0x39c86f){_0xa2b5ce[_0x2ae3('0x3c')]=_0x39c86f;if(_0x2ee14a[_0x2ae3('0x2b')][_0x2ae3('0x3d')]){_0x46f9d1[_0x2ae3('0x3e')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x2ae3('0x3f')](_0x46f9d1);})[_0x2ae3('0x21')](function(_0x2cad5a){_0xa2b5ce[_0x2ae3('0x40')]=_0x2cad5a;return _0xa2b5ce;})[_0x2ae3('0x21')](respondWithFilteredResult(_0x30902c,_0x46f9d1))['catch'](handleError(_0x30902c,null));};exports[_0x2ae3('0x41')]=function(_0x1fd1f5,_0x4243e0){var _0x7598b9={'raw':!![],'where':{'id':_0x1fd1f5[_0x2ae3('0x42')]['id']}},_0x3e1432={};_0x3e1432[_0x2ae3('0x2f')]=_[_0x2ae3('0x2c')](db[_0x2ae3('0x27')][_0x2ae3('0x28')]);_0x3e1432[_0x2ae3('0x2b')]=_[_0x2ae3('0x2c')](_0x1fd1f5[_0x2ae3('0x2b')]);_0x3e1432[_0x2ae3('0x2d')]=_[_0x2ae3('0x2e')](_0x3e1432[_0x2ae3('0x2f')],_0x3e1432[_0x2ae3('0x2b')]);_0x7598b9[_0x2ae3('0x31')]=_['intersection'](_0x3e1432[_0x2ae3('0x2f')],qs['fields'](_0x1fd1f5[_0x2ae3('0x2b')][_0x2ae3('0x30')]));_0x7598b9[_0x2ae3('0x31')]=_0x7598b9[_0x2ae3('0x31')][_0x2ae3('0x43')]?_0x7598b9[_0x2ae3('0x31')]:_0x3e1432[_0x2ae3('0x2f')];if(_0x1fd1f5[_0x2ae3('0x2b')][_0x2ae3('0x3d')]){_0x7598b9[_0x2ae3('0x3e')]=[{'all':!![]}];}_0x7598b9=_['merge']({},_0x7598b9,_0x1fd1f5['options']);return db[_0x2ae3('0x27')][_0x2ae3('0x44')](_0x7598b9)[_0x2ae3('0x21')](handleEntityNotFound(_0x4243e0,null))[_0x2ae3('0x21')](respondWithResult(_0x4243e0,null))['catch'](handleError(_0x4243e0,null));};exports[_0x2ae3('0x45')]=function(_0x29846b,_0x1c2497){return db['SmsTransferReport']['create'](_0x29846b[_0x2ae3('0x46')],{})[_0x2ae3('0x21')](respondWithResult(_0x1c2497,0xc9))[_0x2ae3('0x47')](handleError(_0x1c2497,null));};exports['update']=function(_0xb60a7b,_0x3d915d){if(_0xb60a7b[_0x2ae3('0x46')]['id']){delete _0xb60a7b[_0x2ae3('0x46')]['id'];}return db['SmsTransferReport'][_0x2ae3('0x44')]({'where':{'id':_0xb60a7b[_0x2ae3('0x42')]['id']}})[_0x2ae3('0x21')](handleEntityNotFound(_0x3d915d,null))[_0x2ae3('0x21')](saveUpdates(_0xb60a7b[_0x2ae3('0x46')],null))[_0x2ae3('0x21')](respondWithResult(_0x3d915d,null))['catch'](handleError(_0x3d915d,null));};exports[_0x2ae3('0x22')]=function(_0x3a5112,_0x315ef8){return db[_0x2ae3('0x27')][_0x2ae3('0x44')]({'where':{'id':_0x3a5112[_0x2ae3('0x42')]['id']}})[_0x2ae3('0x21')](handleEntityNotFound(_0x315ef8,null))['then'](removeEntity(_0x315ef8,null))[_0x2ae3('0x47')](handleError(_0x315ef8,null));};exports[_0x2ae3('0x48')]=function(_0x3c878b,_0x58a083){return db[_0x2ae3('0x27')][_0x2ae3('0x48')]()[_0x2ae3('0x21')](respondWithResult(_0x58a083,null))['catch'](handleError(_0x58a083,null));}; \ No newline at end of file +var _0xbcca=['name','send','SmsTransferReport','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','limit','sort','filter','type','VIRTUAL','merge','options','where','count','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','update','then','destroy','error'];(function(_0x4bf4c4,_0x36804a){var _0x2090bb=function(_0x517e46){while(--_0x517e46){_0x4bf4c4['push'](_0x4bf4c4['shift']());}};_0x2090bb(++_0x36804a);}(_0xbcca,0xf8));var _0xabcc=function(_0x9ca619,_0x3c4426){_0x9ca619=_0x9ca619-0x0;var _0x5d7f45=_0xbcca[_0x9ca619];return _0x5d7f45;};'use strict';var pdf=require(_0xabcc('0x0'));var emlformat=require(_0xabcc('0x1'));var rimraf=require(_0xabcc('0x2'));var zipdir=require(_0xabcc('0x3'));var jsonpatch=require(_0xabcc('0x4'));var rp=require(_0xabcc('0x5'));var moment=require(_0xabcc('0x6'));var BPromise=require(_0xabcc('0x7'));var Mustache=require(_0xabcc('0x8'));var util=require(_0xabcc('0x9'));var path=require(_0xabcc('0xa'));var sox=require(_0xabcc('0xb'));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(_0xabcc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xabcc('0xd'));var querystring=require(_0xabcc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xabcc('0xf'));var qs=require(_0xabcc('0x10'));var as=require(_0xabcc('0x11'));var hardwareService=require(_0xabcc('0x12'));var logger=require(_0xabcc('0x13'))(_0xabcc('0x14'));var utils=require(_0xabcc('0x15'));var config=require('../../config/environment');var db=require(_0xabcc('0x16'))['db'];function respondWithStatusCode(_0xfe2135,_0x48e0cb){_0x48e0cb=_0x48e0cb||0xcc;return function(_0x277014){if(_0x277014){return _0xfe2135[_0xabcc('0x17')](_0x48e0cb);}return _0xfe2135[_0xabcc('0x18')](_0x48e0cb)[_0xabcc('0x19')]();};}function respondWithResult(_0x14de5d,_0x395202){_0x395202=_0x395202||0xc8;return function(_0x440a38){if(_0x440a38){return _0x14de5d[_0xabcc('0x18')](_0x395202)['json'](_0x440a38);}};}function respondWithFilteredResult(_0x79e0b4,_0x113444){return function(_0x3f0402){if(_0x3f0402){var _0x3673cc=_0x3f0402['count'],_0x483c6d=_0x113444[_0xabcc('0x1a')],_0x21c2f5=_0x113444['offset']+_0x113444['limit'],_0x418ad2;if(_0x21c2f5>=_0x3673cc){_0x21c2f5=_0x3673cc;_0x418ad2=0xc8;}else{_0x418ad2=0xce;}_0x79e0b4[_0xabcc('0x18')](_0x418ad2);return _0x79e0b4[_0xabcc('0x1b')](_0xabcc('0x1c'),_0x483c6d+'-'+_0x21c2f5+'/'+_0x3673cc)[_0xabcc('0x1d')](_0x3f0402);}return null;};}function patchUpdates(_0x5a27d1){return function(_0x7b1e6d){try{jsonpatch[_0xabcc('0x1e')](_0x7b1e6d,_0x5a27d1,!![]);}catch(_0x256c42){return BPromise[_0xabcc('0x1f')](_0x256c42);}return _0x7b1e6d['save']();};}function saveUpdates(_0x65fb8f,_0x4a23c7){return function(_0xd53735){if(_0xd53735){return _0xd53735[_0xabcc('0x20')](_0x65fb8f)[_0xabcc('0x21')](function(_0x5c03e5){return _0x5c03e5;});}return null;};}function removeEntity(_0x3790e7,_0x28a083){return function(_0x507d1a){if(_0x507d1a){return _0x507d1a[_0xabcc('0x22')]()[_0xabcc('0x21')](function(){_0x3790e7['status'](0xcc)[_0xabcc('0x19')]();});}};}function handleEntityNotFound(_0x10656c,_0x13a5d0){return function(_0x4f5ddf){if(!_0x4f5ddf){_0x10656c['sendStatus'](0x194);}return _0x4f5ddf;};}function handleError(_0x52fbfd,_0x30118b){_0x30118b=_0x30118b||0x1f4;return function(_0x6ad575){logger[_0xabcc('0x23')](_0x6ad575['stack']);if(_0x6ad575['name']){delete _0x6ad575[_0xabcc('0x24')];}_0x52fbfd[_0xabcc('0x18')](_0x30118b)[_0xabcc('0x25')](_0x6ad575);};}exports['index']=function(_0x59824f,_0xadb70e){var _0x30b6bc={},_0x1a066f={},_0x293075={'count':0x0,'rows':[]};var _0x48e073=_['map'](db[_0xabcc('0x26')][_0xabcc('0x27')],function(_0x37f3d6){return{'name':_0x37f3d6['fieldName'],'type':_0x37f3d6['type'][_0xabcc('0x28')]};});_0x1a066f[_0xabcc('0x29')]=_[_0xabcc('0x2a')](_0x48e073,'name');_0x1a066f[_0xabcc('0x2b')]=_[_0xabcc('0x2c')](_0x59824f[_0xabcc('0x2b')]);_0x1a066f[_0xabcc('0x2d')]=_[_0xabcc('0x2e')](_0x1a066f[_0xabcc('0x29')],_0x1a066f[_0xabcc('0x2b')]);_0x30b6bc['attributes']=_[_0xabcc('0x2e')](_0x1a066f[_0xabcc('0x29')],qs['fields'](_0x59824f[_0xabcc('0x2b')][_0xabcc('0x2f')]));_0x30b6bc['attributes']=_0x30b6bc[_0xabcc('0x30')]['length']?_0x30b6bc[_0xabcc('0x30')]:_0x1a066f[_0xabcc('0x29')];if(!_0x59824f[_0xabcc('0x2b')]['hasOwnProperty'](_0xabcc('0x31'))){_0x30b6bc['limit']=qs['limit'](_0x59824f[_0xabcc('0x2b')][_0xabcc('0x32')]);_0x30b6bc[_0xabcc('0x1a')]=qs[_0xabcc('0x1a')](_0x59824f[_0xabcc('0x2b')]['offset']);}_0x30b6bc['order']=qs['sort'](_0x59824f[_0xabcc('0x2b')][_0xabcc('0x33')]);_0x30b6bc['where']=qs['filters'](_['pick'](_0x59824f[_0xabcc('0x2b')],_0x1a066f[_0xabcc('0x2d')]));if(_0x59824f[_0xabcc('0x2b')][_0xabcc('0x34')]){_0x30b6bc['where']=_['merge'](_0x30b6bc['where'],{'$or':_['map'](_0x48e073,function(_0x23c183){if(_0x23c183[_0xabcc('0x35')]!==_0xabcc('0x36')){var _0x7ec70a={};_0x7ec70a[_0x23c183[_0xabcc('0x24')]]={'$like':'%'+_0x59824f[_0xabcc('0x2b')]['filter']+'%'};return _0x7ec70a;}})});}_0x30b6bc=_[_0xabcc('0x37')]({},_0x30b6bc,_0x59824f[_0xabcc('0x38')]);var _0x8a9969={'where':_0x30b6bc[_0xabcc('0x39')]};return db[_0xabcc('0x26')][_0xabcc('0x3a')](_0x8a9969)[_0xabcc('0x21')](function(_0x3469f6){_0x293075[_0xabcc('0x3a')]=_0x3469f6;if(_0x59824f[_0xabcc('0x2b')][_0xabcc('0x3b')]){_0x30b6bc[_0xabcc('0x3c')]=[{'all':!![]}];}return db[_0xabcc('0x26')][_0xabcc('0x3d')](_0x30b6bc);})[_0xabcc('0x21')](function(_0x303bfd){_0x293075[_0xabcc('0x3e')]=_0x303bfd;return _0x293075;})[_0xabcc('0x21')](respondWithFilteredResult(_0xadb70e,_0x30b6bc))['catch'](handleError(_0xadb70e,null));};exports[_0xabcc('0x3f')]=function(_0x3ba24f,_0x59a71f){var _0xb9f003={'raw':!![],'where':{'id':_0x3ba24f[_0xabcc('0x40')]['id']}},_0x4be432={};_0x4be432['model']=_[_0xabcc('0x2c')](db['SmsTransferReport'][_0xabcc('0x27')]);_0x4be432['query']=_[_0xabcc('0x2c')](_0x3ba24f[_0xabcc('0x2b')]);_0x4be432[_0xabcc('0x2d')]=_['intersection'](_0x4be432[_0xabcc('0x29')],_0x4be432[_0xabcc('0x2b')]);_0xb9f003['attributes']=_['intersection'](_0x4be432[_0xabcc('0x29')],qs['fields'](_0x3ba24f['query'][_0xabcc('0x2f')]));_0xb9f003[_0xabcc('0x30')]=_0xb9f003['attributes'][_0xabcc('0x41')]?_0xb9f003['attributes']:_0x4be432[_0xabcc('0x29')];if(_0x3ba24f[_0xabcc('0x2b')]['includeAll']){_0xb9f003['include']=[{'all':!![]}];}_0xb9f003=_[_0xabcc('0x37')]({},_0xb9f003,_0x3ba24f[_0xabcc('0x38')]);return db[_0xabcc('0x26')][_0xabcc('0x42')](_0xb9f003)[_0xabcc('0x21')](handleEntityNotFound(_0x59a71f,null))[_0xabcc('0x21')](respondWithResult(_0x59a71f,null))[_0xabcc('0x43')](handleError(_0x59a71f,null));};exports['create']=function(_0x120938,_0x3b35cf){return db['SmsTransferReport'][_0xabcc('0x44')](_0x120938[_0xabcc('0x45')],{})[_0xabcc('0x21')](respondWithResult(_0x3b35cf,0xc9))[_0xabcc('0x43')](handleError(_0x3b35cf,null));};exports[_0xabcc('0x20')]=function(_0x2e924f,_0x5de4f7){if(_0x2e924f[_0xabcc('0x45')]['id']){delete _0x2e924f[_0xabcc('0x45')]['id'];}return db['SmsTransferReport'][_0xabcc('0x42')]({'where':{'id':_0x2e924f[_0xabcc('0x40')]['id']}})['then'](handleEntityNotFound(_0x5de4f7,null))[_0xabcc('0x21')](saveUpdates(_0x2e924f[_0xabcc('0x45')],null))['then'](respondWithResult(_0x5de4f7,null))[_0xabcc('0x43')](handleError(_0x5de4f7,null));};exports[_0xabcc('0x22')]=function(_0x219520,_0x25fed0){return db['SmsTransferReport'][_0xabcc('0x42')]({'where':{'id':_0x219520[_0xabcc('0x40')]['id']}})['then'](handleEntityNotFound(_0x25fed0,null))[_0xabcc('0x21')](removeEntity(_0x25fed0,null))[_0xabcc('0x43')](handleError(_0x25fed0,null));};exports[_0xabcc('0x46')]=function(_0x2d8674,_0x203069){return db[_0xabcc('0x26')]['describe']()[_0xabcc('0x21')](respondWithResult(_0x203069,null))[_0xabcc('0x43')](handleError(_0x203069,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 0745a08..b917d8b 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 _0x2a07=['moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x4b0880,_0x4d631b){var _0x2b1346=function(_0xd9cbf){while(--_0xd9cbf){_0x4b0880['push'](_0x4b0880['shift']());}};_0x2b1346(++_0x4d631b);}(_0x2a07,0x74));var _0x72a0=function(_0x5e8bfa,_0x1e83d1){_0x5e8bfa=_0x5e8bfa-0x0;var _0x10b312=_0x2a07[_0x5e8bfa];return _0x10b312;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc7a3=['SmsTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x3edf90,_0x5a14d7){var _0x39cbee=function(_0x549b81){while(--_0x549b81){_0x3edf90['push'](_0x3edf90['shift']());}};_0x39cbee(++_0x5a14d7);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x38c810,_0x590705){_0x38c810=_0x38c810-0x0;var _0x5f380e=_0xc7a3[_0x38c810];return _0x5f380e;};'use strict';var _=require('lodash');var util=require(_0x3c7a('0x0'));var logger=require(_0x3c7a('0x1'))(_0x3c7a('0x2'));var moment=require(_0x3c7a('0x3'));var BPromise=require(_0x3c7a('0x4'));var rp=require(_0x3c7a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c7a('0x6'));var config=require(_0x3c7a('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0x3c7a('0x8')]=function(_0x2051ce,_0x2736c1){return _0x2051ce['define'](_0x3c7a('0x9'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x3c7a('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index f680619..637b544 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 _0x843e=['SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x159f91,_0xe8a30f){var _0x26bd65=function(_0x5680d1){while(--_0x5680d1){_0x159f91['push'](_0x159f91['shift']());}};_0x26bd65(++_0xe8a30f);}(_0x843e,0x15f));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe843('0x0'));var moment=require(_0xe843('0x1'));var BPromise=require(_0xe843('0x2'));var rs=require(_0xe843('0x3'));var fs=require('fs');var Redis=require(_0xe843('0x4'));var db=require(_0xe843('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe843('0x6'))(_0xe843('0x7'));var config=require(_0xe843('0x8'));var jayson=require(_0xe843('0x9'));var client=jayson[_0xe843('0xa')][_0xe843('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2db6ae,_0x4a8cce,_0x1d3362){return new BPromise(function(_0x1d08b0,_0x175390){return client[_0xe843('0xc')](_0x2db6ae,_0x1d3362)[_0xe843('0xd')](function(_0x84a0b5){logger['info'](_0xe843('0xe'),_0x4a8cce,_0xe843('0xf'));logger[_0xe843('0x10')](_0xe843('0x11'),_0x4a8cce,_0xe843('0xf'),JSON[_0xe843('0x12')](_0x84a0b5));if(_0x84a0b5[_0xe843('0x13')]){if(_0x84a0b5['error'][_0xe843('0x14')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4a8cce,_0x84a0b5[_0xe843('0x13')]['message']);return _0x175390(_0x84a0b5[_0xe843('0x13')]['message']);}logger[_0xe843('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x4a8cce,_0x84a0b5['error'][_0xe843('0x15')]);return _0x1d08b0(_0x84a0b5[_0xe843('0x13')]['message']);}else{logger['info'](_0xe843('0xe'),_0x4a8cce,_0xe843('0xf'));_0x1d08b0(_0x84a0b5['result'][_0xe843('0x15')]);}})[_0xe843('0x16')](function(_0x4fdcd3){logger[_0xe843('0x13')](_0xe843('0xe'),_0x4a8cce,_0x4fdcd3);_0x175390(_0x4fdcd3);});});} \ No newline at end of file +var _0x9b7e=['message','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4baa27,_0x41e054){var _0x506306=function(_0x3a75d3){while(--_0x3a75d3){_0x4baa27['push'](_0x4baa27['shift']());}};_0x506306(++_0x41e054);}(_0x9b7e,0xb6));var _0xe9b7=function(_0x39479f,_0x822ae4){_0x39479f=_0x39479f-0x0;var _0x4a6d96=_0x9b7e[_0x39479f];return _0x4a6d96;};'use strict';var _=require('lodash');var util=require(_0xe9b7('0x0'));var moment=require(_0xe9b7('0x1'));var BPromise=require(_0xe9b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9b7('0x3'))['db'];var utils=require(_0xe9b7('0x4'));var logger=require(_0xe9b7('0x5'))(_0xe9b7('0x6'));var config=require(_0xe9b7('0x7'));var jayson=require(_0xe9b7('0x8'));var client=jayson['client'][_0xe9b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bb18a,_0x55a30b,_0x1a9786){return new BPromise(function(_0x5692f9,_0x5cbcc6){return client[_0xe9b7('0xa')](_0x2bb18a,_0x1a9786)[_0xe9b7('0xb')](function(_0xc2118a){logger[_0xe9b7('0xc')](_0xe9b7('0xd'),_0x55a30b,_0xe9b7('0xe'));logger['debug'](_0xe9b7('0xf'),_0x55a30b,'request\x20sent',JSON[_0xe9b7('0x10')](_0xc2118a));if(_0xc2118a[_0xe9b7('0x11')]){if(_0xc2118a[_0xe9b7('0x11')]['code']===0x1f4){logger[_0xe9b7('0x11')](_0xe9b7('0xd'),_0x55a30b,_0xc2118a['error'][_0xe9b7('0x12')]);return _0x5cbcc6(_0xc2118a[_0xe9b7('0x11')][_0xe9b7('0x12')]);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x55a30b,_0xc2118a['error'][_0xe9b7('0x12')]);return _0x5692f9(_0xc2118a['error'][_0xe9b7('0x12')]);}else{logger['info'](_0xe9b7('0xd'),_0x55a30b,_0xe9b7('0xe'));_0x5692f9(_0xc2118a['result'][_0xe9b7('0x12')]);}})[_0xe9b7('0x13')](function(_0x223e7f){logger[_0xe9b7('0x11')](_0xe9b7('0xd'),_0x55a30b,_0x223e7f);_0x5cbcc6(_0x223e7f);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 9c00e08..c5be343 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 _0x1ecb=['delete','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','index','get','/:id','show','/:id/download','isAuthenticated','download','join','root','server/files/sounds/original/','%s-%s%s','basename','originalname','extname','post','single','file','put'];(function(_0x23f3d1,_0x21172d){var _0x3ae04d=function(_0x30bbdb){while(--_0x30bbdb){_0x23f3d1['push'](_0x23f3d1['shift']());}};_0x3ae04d(++_0x21172d);}(_0x1ecb,0x1e7));var _0xb1ec=function(_0x39bd8c,_0x38e32e){_0x39bd8c=_0x39bd8c-0x0;var _0x19d675=_0x1ecb[_0x39bd8c];return _0x19d675;};'use strict';var multer=require(_0xb1ec('0x0'));var util=require(_0xb1ec('0x1'));var path=require(_0xb1ec('0x2'));var timeout=require('connect-timeout');var express=require(_0xb1ec('0x3'));var router=express['Router']();var auth=require(_0xb1ec('0x4'));var interaction=require(_0xb1ec('0x5'));var config=require(_0xb1ec('0x6'));var controller=require(_0xb1ec('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb1ec('0x8')]);router[_0xb1ec('0x9')](_0xb1ec('0xa'),auth['isAuthenticated'](),controller[_0xb1ec('0xb')]);router[_0xb1ec('0x9')](_0xb1ec('0xc'),auth[_0xb1ec('0xd')](),controller[_0xb1ec('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b3507,_0x5e9558,_0x5dfad8){_0x5dfad8(null,path[_0xb1ec('0xf')](config[_0xb1ec('0x10')],_0xb1ec('0x11')));},'filename':function(_0x4fbf91,_0x3b2494,_0x3711c9){_0x3b2494['originalname']=_0x3b2494['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3711c9(null,util['format'](_0xb1ec('0x12'),path[_0xb1ec('0x13')](_0x3b2494[_0xb1ec('0x14')],path[_0xb1ec('0x15')](_0x3b2494[_0xb1ec('0x14')])),Date['now'](),path['extname'](_0x3b2494[_0xb1ec('0x14')])));}})});router[_0xb1ec('0x16')]('/',upload[_0xb1ec('0x17')](_0xb1ec('0x18')),controller['create']);router[_0xb1ec('0x19')](_0xb1ec('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xb1ec('0x1a')](_0xb1ec('0xa'),auth[_0xb1ec('0xd')](),controller[_0xb1ec('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x3e83=['create','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','/:id','show','download','join','root','server/files/sounds/original/','originalname','replace','format','now','extname','post','single','file'];(function(_0x3ae5a2,_0x5e3a20){var _0x226026=function(_0x2d9433){while(--_0x2d9433){_0x3ae5a2['push'](_0x3ae5a2['shift']());}};_0x226026(++_0x5e3a20);}(_0x3e83,0x11b));var _0x33e8=function(_0x4c19a1,_0x15197f){_0x4c19a1=_0x4c19a1-0x0;var _0x58ac50=_0x3e83[_0x4c19a1];return _0x58ac50;};'use strict';var multer=require(_0x33e8('0x0'));var util=require(_0x33e8('0x1'));var path=require(_0x33e8('0x2'));var timeout=require(_0x33e8('0x3'));var express=require(_0x33e8('0x4'));var router=express['Router']();var auth=require(_0x33e8('0x5'));var interaction=require(_0x33e8('0x6'));var config=require(_0x33e8('0x7'));var controller=require(_0x33e8('0x8'));router['get']('/',auth[_0x33e8('0x9')](),controller[_0x33e8('0xa')]);router['get'](_0x33e8('0xb'),auth[_0x33e8('0x9')](),controller[_0x33e8('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x33e8('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xcc2b14,_0x2a2146,_0xc0c203){_0xc0c203(null,path[_0x33e8('0xe')](config[_0x33e8('0xf')],_0x33e8('0x10')));},'filename':function(_0x2be5f3,_0x3c2e8a,_0x2ad22a){_0x3c2e8a[_0x33e8('0x11')]=_0x3c2e8a[_0x33e8('0x11')][_0x33e8('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ad22a(null,util[_0x33e8('0x13')]('%s-%s%s',path['basename'](_0x3c2e8a[_0x33e8('0x11')],path['extname'](_0x3c2e8a['originalname'])),Date[_0x33e8('0x14')](),path[_0x33e8('0x15')](_0x3c2e8a['originalname'])));}})});router[_0x33e8('0x16')]('/',upload[_0x33e8('0x17')](_0x33e8('0x18')),controller[_0x33e8('0x19')]);router['put']('/:id',auth[_0x33e8('0x9')](),controller[_0x33e8('0x1a')]);router[_0x33e8('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x33e8('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 1bd7adf..a40b5e4 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 _0xdcf6=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x4d14c3,_0x29ae4b){var _0x447521=function(_0x57ef0a){while(--_0x57ef0a){_0x4d14c3['push'](_0x4d14c3['shift']());}};_0x447521(++_0x29ae4b);}(_0xdcf6,0x18e));var _0x6dcf=function(_0x3b247d,_0xbe4218){_0x3b247d=_0x3b247d-0x0;var _0x131bcf=_0xdcf6[_0x3b247d];return _0x131bcf;};'use strict';var Sequelize=require(_0x6dcf('0x0'));module[_0x6dcf('0x1')]={'name':{'type':Sequelize[_0x6dcf('0x2')],'unique':_0x6dcf('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x6dcf('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x6dcf('0x4')]},'original_sampleCount':{'type':Sequelize[_0x6dcf('0x5')]},'original_channelCount':{'type':Sequelize[_0x6dcf('0x6')]},'original_bitRate':{'type':Sequelize[_0x6dcf('0x5')]},'original_sampleRate':{'type':Sequelize[_0x6dcf('0x6')]},'converted_format':{'type':Sequelize[_0x6dcf('0x2')]},'converted_duration':{'type':Sequelize[_0x6dcf('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x6dcf('0x5')]},'converted_channelCount':{'type':Sequelize[_0x6dcf('0x6')]},'converted_bitRate':{'type':Sequelize[_0x6dcf('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0344=['STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0x0344,0x113));var _0x4034=function(_0x21bf1c,_0x117d24){_0x21bf1c=_0x21bf1c-0x0;var _0x458040=_0x0344[_0x21bf1c];return _0x458040;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4034('0x0')],'unique':_0x4034('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x4034('0x0')],'defaultValue':''},'description':{'type':Sequelize[_0x4034('0x0')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x4034('0x2')]},'original_sampleCount':{'type':Sequelize[_0x4034('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x4034('0x3')]},'original_sampleRate':{'type':Sequelize[_0x4034('0x4')]},'converted_format':{'type':Sequelize[_0x4034('0x0')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x4034('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 950b833..b717b2b 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 _0x77d8=['filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','keys','find','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','download','root','format','%s.%s','create','file','basename','filename','extname','originalname','substring','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','send','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','save','then','get','Sounds','UserProfileResource','destroy','error','stack','name','index','Sound','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick'];(function(_0x1d0f54,_0xd352da){var _0x5c68f2=function(_0x5a12d5){while(--_0x5a12d5){_0x1d0f54['push'](_0x1d0f54['shift']());}};_0x5c68f2(++_0xd352da);}(_0x77d8,0x138));var _0x877d=function(_0x1c5037,_0x52e4d0){_0x1c5037=_0x1c5037-0x0;var _0x1e6ead=_0x77d8[_0x1c5037];return _0x1e6ead;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x877d('0x0'));var zipdir=require(_0x877d('0x1'));var jsonpatch=require(_0x877d('0x2'));var rp=require(_0x877d('0x3'));var moment=require(_0x877d('0x4'));var BPromise=require(_0x877d('0x5'));var Mustache=require(_0x877d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x877d('0x7'));var csv=require(_0x877d('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x877d('0x9'));var squel=require(_0x877d('0xa'));var crypto=require(_0x877d('0xb'));var jsforce=require(_0x877d('0xc'));var deskjs=require(_0x877d('0xd'));var toCsv=require(_0x877d('0x8'));var querystring=require(_0x877d('0xe'));var Papa=require(_0x877d('0xf'));var Redis=require(_0x877d('0x10'));var authService=require(_0x877d('0x11'));var qs=require(_0x877d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x877d('0x13'));var logger=require(_0x877d('0x14'))(_0x877d('0x15'));var utils=require('../../config/utils');var config=require(_0x877d('0x16'));var db=require(_0x877d('0x17'))['db'];function respondWithStatusCode(_0x41473c,_0x3be316){_0x3be316=_0x3be316||0xcc;return function(_0x2587cf){if(_0x2587cf){return _0x41473c[_0x877d('0x18')](_0x3be316);}return _0x41473c[_0x877d('0x19')](_0x3be316)[_0x877d('0x1a')]();};}function respondWithResult(_0x1e100e,_0x1bf3f0){_0x1bf3f0=_0x1bf3f0||0xc8;return function(_0x1a9f5c){if(_0x1a9f5c){return _0x1e100e['status'](_0x1bf3f0)[_0x877d('0x1b')](_0x1a9f5c);}};}function respondWithFilteredResult(_0x3671de,_0x19de47){return function(_0x271c7e){if(_0x271c7e){var _0x1a9026=_0x271c7e['count'],_0x44e0cc=_0x19de47[_0x877d('0x1c')],_0x55d7c1=_0x19de47[_0x877d('0x1c')]+_0x19de47[_0x877d('0x1d')],_0x810f36;if(_0x55d7c1>=_0x1a9026){_0x55d7c1=_0x1a9026;_0x810f36=0xc8;}else{_0x810f36=0xce;}_0x3671de[_0x877d('0x19')](_0x810f36);return _0x3671de[_0x877d('0x1e')]('Content-Range',_0x44e0cc+'-'+_0x55d7c1+'/'+_0x1a9026)[_0x877d('0x1b')](_0x271c7e);}return null;};}function patchUpdates(_0x4ef515){return function(_0xd23187){try{jsonpatch[_0x877d('0x1f')](_0xd23187,_0x4ef515,!![]);}catch(_0x233a3f){return BPromise[_0x877d('0x20')](_0x233a3f);}return _0xd23187[_0x877d('0x21')]();};}function saveUpdates(_0x8981bb,_0x26065f){return function(_0x113652){if(_0x113652){return _0x113652['update'](_0x8981bb)[_0x877d('0x22')](function(_0x421aa9){return _0x421aa9;});}return null;};}function removeEntity(_0x15c4c1,_0x213f68){return function(_0x5ad8ba){if(_0x5ad8ba){return _0x5ad8ba['destroy']()[_0x877d('0x22')](function(){var _0x43713b=_0x5ad8ba[_0x877d('0x23')]({'plain':!![]});var _0x5a2cf1=_0x877d('0x24');return db[_0x877d('0x25')][_0x877d('0x26')]({'where':{'type':_0x5a2cf1,'resourceId':_0x43713b['id']}})[_0x877d('0x22')](function(){return _0x5ad8ba;});})[_0x877d('0x22')](function(){_0x15c4c1[_0x877d('0x19')](0xcc)[_0x877d('0x1a')]();});}};}function handleEntityNotFound(_0x2e9333,_0x39e8c6){return function(_0xe7c60e){if(!_0xe7c60e){_0x2e9333['sendStatus'](0x194);}return _0xe7c60e;};}function handleError(_0x159c48,_0x37ee17){_0x37ee17=_0x37ee17||0x1f4;return function(_0x3aad05){logger[_0x877d('0x27')](_0x3aad05[_0x877d('0x28')]);if(_0x3aad05[_0x877d('0x29')]){delete _0x3aad05[_0x877d('0x29')];}_0x159c48[_0x877d('0x19')](_0x37ee17)['send'](_0x3aad05);};}exports[_0x877d('0x2a')]=function(_0x39a3c6,_0x100140){var _0x4e243e={},_0x2899ae={},_0x30c98c={'count':0x0,'rows':[]};var _0x416a90=_['map'](db[_0x877d('0x2b')][_0x877d('0x2c')],function(_0x2a35c2){return{'name':_0x2a35c2[_0x877d('0x2d')],'type':_0x2a35c2[_0x877d('0x2e')][_0x877d('0x2f')]};});_0x2899ae[_0x877d('0x30')]=_[_0x877d('0x31')](_0x416a90,_0x877d('0x29'));_0x2899ae[_0x877d('0x32')]=_['keys'](_0x39a3c6['query']);_0x2899ae[_0x877d('0x33')]=_[_0x877d('0x34')](_0x2899ae[_0x877d('0x30')],_0x2899ae[_0x877d('0x32')]);_0x4e243e[_0x877d('0x35')]=_[_0x877d('0x34')](_0x2899ae['model'],qs['fields'](_0x39a3c6[_0x877d('0x32')][_0x877d('0x36')]));_0x4e243e[_0x877d('0x35')]=_0x4e243e[_0x877d('0x35')][_0x877d('0x37')]?_0x4e243e[_0x877d('0x35')]:_0x2899ae[_0x877d('0x30')];if(!_0x39a3c6[_0x877d('0x32')][_0x877d('0x38')](_0x877d('0x39'))){_0x4e243e['limit']=qs[_0x877d('0x1d')](_0x39a3c6['query'][_0x877d('0x1d')]);_0x4e243e[_0x877d('0x1c')]=qs[_0x877d('0x1c')](_0x39a3c6[_0x877d('0x32')][_0x877d('0x1c')]);}_0x4e243e['order']=qs[_0x877d('0x3a')](_0x39a3c6[_0x877d('0x32')][_0x877d('0x3a')]);_0x4e243e['where']=qs[_0x877d('0x33')](_[_0x877d('0x3b')](_0x39a3c6[_0x877d('0x32')],_0x2899ae[_0x877d('0x33')]));if(_0x39a3c6[_0x877d('0x32')][_0x877d('0x3c')]){_0x4e243e[_0x877d('0x3d')]=_[_0x877d('0x3e')](_0x4e243e['where'],{'$or':_[_0x877d('0x31')](_0x416a90,function(_0x233a35){if(_0x233a35[_0x877d('0x2e')]!==_0x877d('0x3f')){var _0x381ab1={};_0x381ab1[_0x233a35[_0x877d('0x29')]]={'$like':'%'+_0x39a3c6[_0x877d('0x32')][_0x877d('0x3c')]+'%'};return _0x381ab1;}})});}_0x4e243e=_[_0x877d('0x3e')]({},_0x4e243e,_0x39a3c6[_0x877d('0x40')]);var _0x2fb41e={'where':_0x4e243e[_0x877d('0x3d')]};return db[_0x877d('0x2b')]['count'](_0x2fb41e)['then'](function(_0x1b5c1d){_0x30c98c[_0x877d('0x41')]=_0x1b5c1d;if(_0x39a3c6[_0x877d('0x32')][_0x877d('0x42')]){_0x4e243e[_0x877d('0x43')]=[{'all':!![]}];}return db[_0x877d('0x2b')][_0x877d('0x44')](_0x4e243e);})[_0x877d('0x22')](function(_0x470a07){_0x30c98c['rows']=_0x470a07;return _0x30c98c;})[_0x877d('0x22')](respondWithFilteredResult(_0x100140,_0x4e243e))[_0x877d('0x45')](handleError(_0x100140,null));};exports[_0x877d('0x46')]=function(_0x5700e5,_0x2759fb){var _0x170f52={'raw':!![],'where':{'id':_0x5700e5[_0x877d('0x47')]['id']}},_0x6a6fb1={};_0x6a6fb1[_0x877d('0x30')]=_[_0x877d('0x48')](db[_0x877d('0x2b')][_0x877d('0x2c')]);_0x6a6fb1[_0x877d('0x32')]=_[_0x877d('0x48')](_0x5700e5[_0x877d('0x32')]);_0x6a6fb1[_0x877d('0x33')]=_[_0x877d('0x34')](_0x6a6fb1[_0x877d('0x30')],_0x6a6fb1['query']);_0x170f52['attributes']=_['intersection'](_0x6a6fb1['model'],qs[_0x877d('0x36')](_0x5700e5[_0x877d('0x32')][_0x877d('0x36')]));_0x170f52[_0x877d('0x35')]=_0x170f52[_0x877d('0x35')]['length']?_0x170f52[_0x877d('0x35')]:_0x6a6fb1['model'];if(_0x5700e5[_0x877d('0x32')][_0x877d('0x42')]){_0x170f52[_0x877d('0x43')]=[{'all':!![]}];}_0x170f52=_['merge']({},_0x170f52,_0x5700e5[_0x877d('0x40')]);return db[_0x877d('0x2b')][_0x877d('0x49')](_0x170f52)[_0x877d('0x22')](handleEntityNotFound(_0x2759fb,null))['then'](respondWithResult(_0x2759fb,null))[_0x877d('0x45')](handleError(_0x2759fb,null));};exports['download']=function(_0x14bacf,_0x4496f5,_0x55235c){return db[_0x877d('0x2b')]['find']({'where':{'id':_0x14bacf['params']['id']},'attributes':[_0x877d('0x29'),_0x877d('0x4a'),_0x877d('0x4b')],'raw':!![]})[_0x877d('0x22')](handleEntityNotFound(_0x4496f5,null))[_0x877d('0x22')](function(_0x53a926){if(_0x53a926){if(!fs[_0x877d('0x4c')](path[_0x877d('0x4d')](config['root'],_0x877d('0x4e'),_0x53a926[_0x877d('0x4a')]+'.'+_0x53a926[_0x877d('0x4b')]))){throw new db[(_0x877d('0x4f'))]['ValidationError']('Sound\x20not\x20found');}return _0x4496f5[_0x877d('0x50')](path[_0x877d('0x4d')](config[_0x877d('0x51')],'server/files/sounds/converted',util[_0x877d('0x52')](_0x877d('0x53'),_0x53a926[_0x877d('0x4a')],_0x53a926[_0x877d('0x4b')])),util[_0x877d('0x52')](_0x877d('0x53'),_0x53a926['name'],_0x53a926[_0x877d('0x4b')]));}return null;})[_0x877d('0x45')](handleError(_0x4496f5,null));};exports[_0x877d('0x54')]=function(_0x41196d,_0x2ab2fc,_0x218cc2){var _0x4539c0={'name':path['basename'](_0x41196d[_0x877d('0x55')]['originalname'],path['extname'](_0x41196d[_0x877d('0x55')]['originalname'])),'save_name':path[_0x877d('0x56')](_0x41196d['file'][_0x877d('0x57')],path['extname'](_0x41196d[_0x877d('0x55')][_0x877d('0x57')])),'original_format':path[_0x877d('0x58')](_0x41196d[_0x877d('0x55')][_0x877d('0x59')])[_0x877d('0x5a')](0x1),'converted_format':'wav'};var _0x5cbc44=path['join'](config[_0x877d('0x51')],_0x877d('0x5b'),_0x41196d[_0x877d('0x55')][_0x877d('0x57')]);var _0x6eed5b=path[_0x877d('0x4d')](config[_0x877d('0x51')],_0x877d('0x4e'),util[_0x877d('0x52')](_0x877d('0x53'),path[_0x877d('0x56')](_0x41196d[_0x877d('0x55')][_0x877d('0x57')],path[_0x877d('0x58')](_0x41196d[_0x877d('0x55')][_0x877d('0x57')])),_0x4539c0['converted_format']));logger['info'](_0x877d('0x5c'),_0x5cbc44);logger[_0x877d('0x5d')](_0x877d('0x5e'),_0x6eed5b);try{fs[_0x877d('0x5f')](_0x5cbc44,parseInt(_0x877d('0x60'),0x8));var _0x8c722e=sox[_0x877d('0x61')](_0x5cbc44,_0x6eed5b,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x8c722e['on'](_0x877d('0x27'),function(_0x182da1){fs[_0x877d('0x62')](_0x5cbc44);_0x2ab2fc[_0x877d('0x19')](0x1f4)[_0x877d('0x63')](_0x182da1);});_0x8c722e['on'](_0x877d('0x64'),function(_0x523cc5){_0x4539c0['original_duration']=isNaN(_0x523cc5['duration'])?null:_0x523cc5[_0x877d('0x65')]*0x3e8;_0x4539c0['original_sampleCount']=isNaN(_0x523cc5[_0x877d('0x66')])?null:_0x523cc5[_0x877d('0x66')];_0x4539c0[_0x877d('0x67')]=isNaN(_0x523cc5[_0x877d('0x68')])?null:_0x523cc5['channelCount'];_0x4539c0[_0x877d('0x69')]=isNaN(_0x523cc5['bitRate'])?null:_0x523cc5[_0x877d('0x6a')];_0x4539c0[_0x877d('0x6b')]=isNaN(_0x523cc5[_0x877d('0x6c')])?null:_0x523cc5[_0x877d('0x6c')];});_0x8c722e['on'](_0x877d('0x6d'),function(_0x4d70c5){_0x4539c0[_0x877d('0x6e')]=isNaN(_0x4d70c5[_0x877d('0x65')])?null:_0x4d70c5[_0x877d('0x65')]*0x3e8;_0x4539c0[_0x877d('0x6f')]=isNaN(_0x4d70c5[_0x877d('0x66')])?null:_0x4d70c5['sampleCount'];_0x4539c0[_0x877d('0x70')]=isNaN(_0x4d70c5['channelCount'])?null:_0x4d70c5['channelCount'];_0x4539c0[_0x877d('0x71')]=isNaN(_0x4d70c5['bitRate'])?null:_0x4d70c5[_0x877d('0x6a')];_0x4539c0[_0x877d('0x72')]=isNaN(_0x4d70c5['sampleRate'])?null:_0x4d70c5[_0x877d('0x6c')];});_0x8c722e['on'](_0x877d('0x1a'),function(){fs['chmodSync'](_0x6eed5b,parseInt('0777',0x8));return db[_0x877d('0x2b')][_0x877d('0x54')](_0x4539c0)[_0x877d('0x22')](function(_0x329df4){var _0x298776={'role':_0x41196d[_0x877d('0x73')]['role'],'userProfileId':_0x41196d[_0x877d('0x73')]['userProfileId']};if(!_0x298776)throw new Error(_0x877d('0x74'));if(_0x298776[_0x877d('0x75')]===_0x877d('0x76')){var _0x114cf1=_0x329df4['get']({'plain':!![]});return db[_0x877d('0x77')][_0x877d('0x49')]({'where':{'name':'Sounds','userProfileId':_0x298776['userProfileId']},'raw':!![]})[_0x877d('0x22')](function(_0x5d2022){if(_0x5d2022&&_0x5d2022[_0x877d('0x78')]===0x0){return db[_0x877d('0x25')][_0x877d('0x54')]({'name':_0x114cf1[_0x877d('0x29')],'resourceId':_0x114cf1['id'],'type':_0x5d2022[_0x877d('0x29')],'sectionId':_0x5d2022['id']},{})[_0x877d('0x22')](function(){return _0x329df4;});}else{return _0x329df4;}})['catch'](function(_0x5722b8){logger[_0x877d('0x27')](_0x877d('0x79'),_0x5722b8);throw _0x5722b8;});}return _0x329df4;})[_0x877d('0x22')](respondWithResult(_0x2ab2fc,null))[_0x877d('0x45')](handleError(_0x2ab2fc,null));});_0x8c722e['start']();}catch(_0x7c2f27){_0x2ab2fc[_0x877d('0x19')](0x1f4)[_0x877d('0x63')](_0x7c2f27);}};exports[_0x877d('0x7a')]=function(_0x11f878,_0x5a5ac4,_0x5e5213){return db[_0x877d('0x2b')]['find']({'where':{'id':_0x11f878['params']['id']}})[_0x877d('0x22')](handleEntityNotFound(_0x5a5ac4,null))[_0x877d('0x22')](saveUpdates(_[_0x877d('0x3b')](_0x11f878['body'],[_0x877d('0x29'),_0x877d('0x7b')]),null))[_0x877d('0x22')](respondWithResult(_0x5a5ac4,null))[_0x877d('0x45')](handleError(_0x5a5ac4,null));};exports['delete']=function(_0x9c98a5,_0x28cc7b,_0x2fac2e){return db[_0x877d('0x2b')][_0x877d('0x49')]({'where':{'id':_0x9c98a5[_0x877d('0x47')]['id']}})[_0x877d('0x22')](function(_0x2de1c8){if(_0x2de1c8){return _0x2de1c8[_0x877d('0x26')]();}})[_0x877d('0x22')](function(_0x44a2ac){var _0x31cbb8=path[_0x877d('0x4d')](config[_0x877d('0x51')],'server/files/sounds/original',util[_0x877d('0x52')](_0x877d('0x53'),_0x44a2ac[_0x877d('0x4a')],_0x44a2ac['original_format']));var _0x39002e=path[_0x877d('0x4d')](config[_0x877d('0x51')],_0x877d('0x4e'),util['format'](_0x877d('0x53'),_0x44a2ac[_0x877d('0x4a')],_0x44a2ac[_0x877d('0x4b')]));fs[_0x877d('0x62')](_0x31cbb8);fs[_0x877d('0x62')](_0x39002e);return _0x44a2ac;})[_0x877d('0x22')](function(_0x2cabf0){if(_0x2cabf0){return _0x28cc7b[_0x877d('0x19')](0xcc)[_0x877d('0x1a')]();}})['then'](handleEntityNotFound(_0x28cc7b,null))[_0x877d('0x45')](handleError(_0x28cc7b,null));}; \ No newline at end of file +var _0x0373=['get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','original_format','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','Sounds','UserProfileResource','destroy','error','name','send','map','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','Sound','includeAll','include','params','rawAttributes','length','find','catch','download','converted_format','existsSync','root','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','save_name','create','file','extname','originalname','filename','substring','wav','server/files/sounds/original','server/files/sounds/converted','basename','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x1993d4,_0x19d988){var _0x12b9ab=function(_0x5cf627){while(--_0x5cf627){_0x1993d4['push'](_0x1993d4['shift']());}};_0x12b9ab(++_0x19d988);}(_0x0373,0x1f0));var _0x3037=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0x0373[_0x552fce];return _0x3e27a2;};'use strict';var pdf=require(_0x3037('0x0'));var emlformat=require(_0x3037('0x1'));var rimraf=require(_0x3037('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3037('0x3'));var moment=require('moment');var BPromise=require(_0x3037('0x4'));var Mustache=require(_0x3037('0x5'));var util=require('util');var path=require(_0x3037('0x6'));var sox=require('sox');var csv=require(_0x3037('0x7'));var ejs=require(_0x3037('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3037('0x9'));var crypto=require(_0x3037('0xa'));var jsforce=require(_0x3037('0xb'));var deskjs=require(_0x3037('0xc'));var toCsv=require(_0x3037('0x7'));var querystring=require(_0x3037('0xd'));var Papa=require(_0x3037('0xe'));var Redis=require(_0x3037('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3037('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3037('0x11'));var logger=require(_0x3037('0x12'))(_0x3037('0x13'));var utils=require(_0x3037('0x14'));var config=require(_0x3037('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50c418,_0x21f5d2){_0x21f5d2=_0x21f5d2||0xcc;return function(_0x55d382){if(_0x55d382){return _0x50c418[_0x3037('0x16')](_0x21f5d2);}return _0x50c418[_0x3037('0x17')](_0x21f5d2)[_0x3037('0x18')]();};}function respondWithResult(_0x4ed146,_0xb84b19){_0xb84b19=_0xb84b19||0xc8;return function(_0xda348c){if(_0xda348c){return _0x4ed146[_0x3037('0x17')](_0xb84b19)['json'](_0xda348c);}};}function respondWithFilteredResult(_0x3aa58b,_0x30416b){return function(_0x4cf580){if(_0x4cf580){var _0x19d99f=_0x4cf580[_0x3037('0x19')],_0x38efdb=_0x30416b['offset'],_0x2b33ed=_0x30416b[_0x3037('0x1a')]+_0x30416b['limit'],_0x231f25;if(_0x2b33ed>=_0x19d99f){_0x2b33ed=_0x19d99f;_0x231f25=0xc8;}else{_0x231f25=0xce;}_0x3aa58b[_0x3037('0x17')](_0x231f25);return _0x3aa58b[_0x3037('0x1b')](_0x3037('0x1c'),_0x38efdb+'-'+_0x2b33ed+'/'+_0x19d99f)[_0x3037('0x1d')](_0x4cf580);}return null;};}function patchUpdates(_0xf0a8f4){return function(_0x26100a){try{jsonpatch[_0x3037('0x1e')](_0x26100a,_0xf0a8f4,!![]);}catch(_0x4d460a){return BPromise[_0x3037('0x1f')](_0x4d460a);}return _0x26100a[_0x3037('0x20')]();};}function saveUpdates(_0x16383b,_0x10ff71){return function(_0x4684f0){if(_0x4684f0){return _0x4684f0[_0x3037('0x21')](_0x16383b)[_0x3037('0x22')](function(_0x63d67){return _0x63d67;});}return null;};}function removeEntity(_0x25293f,_0x3e7671){return function(_0x19935d){if(_0x19935d){return _0x19935d['destroy']()[_0x3037('0x22')](function(){var _0x2b8341=_0x19935d['get']({'plain':!![]});var _0x16f17d=_0x3037('0x23');return db[_0x3037('0x24')][_0x3037('0x25')]({'where':{'type':_0x16f17d,'resourceId':_0x2b8341['id']}})[_0x3037('0x22')](function(){return _0x19935d;});})['then'](function(){_0x25293f[_0x3037('0x17')](0xcc)[_0x3037('0x18')]();});}};}function handleEntityNotFound(_0x54c289,_0x186218){return function(_0x58a82c){if(!_0x58a82c){_0x54c289[_0x3037('0x16')](0x194);}return _0x58a82c;};}function handleError(_0x233fad,_0x2b892d){_0x2b892d=_0x2b892d||0x1f4;return function(_0x1ded1b){logger[_0x3037('0x26')](_0x1ded1b['stack']);if(_0x1ded1b['name']){delete _0x1ded1b[_0x3037('0x27')];}_0x233fad['status'](_0x2b892d)[_0x3037('0x28')](_0x1ded1b);};}exports['index']=function(_0x38d823,_0x485eb1){var _0xa65df1={},_0x1664b6={},_0xfcc4a5={'count':0x0,'rows':[]};var _0xa2539d=_[_0x3037('0x29')](db['Sound']['rawAttributes'],function(_0x3f8ba2){return{'name':_0x3f8ba2[_0x3037('0x2a')],'type':_0x3f8ba2[_0x3037('0x2b')]['key']};});_0x1664b6[_0x3037('0x2c')]=_[_0x3037('0x29')](_0xa2539d,_0x3037('0x27'));_0x1664b6[_0x3037('0x2d')]=_[_0x3037('0x2e')](_0x38d823[_0x3037('0x2d')]);_0x1664b6[_0x3037('0x2f')]=_['intersection'](_0x1664b6[_0x3037('0x2c')],_0x1664b6[_0x3037('0x2d')]);_0xa65df1[_0x3037('0x30')]=_[_0x3037('0x31')](_0x1664b6['model'],qs['fields'](_0x38d823[_0x3037('0x2d')][_0x3037('0x32')]));_0xa65df1[_0x3037('0x30')]=_0xa65df1[_0x3037('0x30')]['length']?_0xa65df1['attributes']:_0x1664b6[_0x3037('0x2c')];if(!_0x38d823[_0x3037('0x2d')][_0x3037('0x33')](_0x3037('0x34'))){_0xa65df1[_0x3037('0x35')]=qs[_0x3037('0x35')](_0x38d823[_0x3037('0x2d')]['limit']);_0xa65df1['offset']=qs[_0x3037('0x1a')](_0x38d823[_0x3037('0x2d')][_0x3037('0x1a')]);}_0xa65df1[_0x3037('0x36')]=qs[_0x3037('0x37')](_0x38d823[_0x3037('0x2d')][_0x3037('0x37')]);_0xa65df1[_0x3037('0x38')]=qs[_0x3037('0x2f')](_[_0x3037('0x39')](_0x38d823[_0x3037('0x2d')],_0x1664b6[_0x3037('0x2f')]));if(_0x38d823['query'][_0x3037('0x3a')]){_0xa65df1['where']=_[_0x3037('0x3b')](_0xa65df1[_0x3037('0x38')],{'$or':_[_0x3037('0x29')](_0xa2539d,function(_0x54f9f4){if(_0x54f9f4[_0x3037('0x2b')]!=='VIRTUAL'){var _0x39907d={};_0x39907d[_0x54f9f4[_0x3037('0x27')]]={'$like':'%'+_0x38d823['query'][_0x3037('0x3a')]+'%'};return _0x39907d;}})});}_0xa65df1=_[_0x3037('0x3b')]({},_0xa65df1,_0x38d823[_0x3037('0x3c')]);var _0x335ca2={'where':_0xa65df1[_0x3037('0x38')]};return db[_0x3037('0x3d')][_0x3037('0x19')](_0x335ca2)['then'](function(_0x5e271b){_0xfcc4a5['count']=_0x5e271b;if(_0x38d823['query'][_0x3037('0x3e')]){_0xa65df1[_0x3037('0x3f')]=[{'all':!![]}];}return db[_0x3037('0x3d')]['findAll'](_0xa65df1);})[_0x3037('0x22')](function(_0x205550){_0xfcc4a5['rows']=_0x205550;return _0xfcc4a5;})['then'](respondWithFilteredResult(_0x485eb1,_0xa65df1))['catch'](handleError(_0x485eb1,null));};exports['show']=function(_0x1bf408,_0xab453a){var _0x3f5c38={'raw':!![],'where':{'id':_0x1bf408[_0x3037('0x40')]['id']}},_0xb1e294={};_0xb1e294['model']=_['keys'](db[_0x3037('0x3d')][_0x3037('0x41')]);_0xb1e294[_0x3037('0x2d')]=_[_0x3037('0x2e')](_0x1bf408['query']);_0xb1e294[_0x3037('0x2f')]=_[_0x3037('0x31')](_0xb1e294[_0x3037('0x2c')],_0xb1e294[_0x3037('0x2d')]);_0x3f5c38[_0x3037('0x30')]=_[_0x3037('0x31')](_0xb1e294[_0x3037('0x2c')],qs[_0x3037('0x32')](_0x1bf408[_0x3037('0x2d')][_0x3037('0x32')]));_0x3f5c38[_0x3037('0x30')]=_0x3f5c38['attributes'][_0x3037('0x42')]?_0x3f5c38['attributes']:_0xb1e294[_0x3037('0x2c')];if(_0x1bf408[_0x3037('0x2d')][_0x3037('0x3e')]){_0x3f5c38[_0x3037('0x3f')]=[{'all':!![]}];}_0x3f5c38=_[_0x3037('0x3b')]({},_0x3f5c38,_0x1bf408[_0x3037('0x3c')]);return db['Sound'][_0x3037('0x43')](_0x3f5c38)[_0x3037('0x22')](handleEntityNotFound(_0xab453a,null))[_0x3037('0x22')](respondWithResult(_0xab453a,null))[_0x3037('0x44')](handleError(_0xab453a,null));};exports[_0x3037('0x45')]=function(_0x20e4aa,_0x1a9c1e,_0xe40222){return db[_0x3037('0x3d')][_0x3037('0x43')]({'where':{'id':_0x20e4aa['params']['id']},'attributes':[_0x3037('0x27'),'save_name',_0x3037('0x46')],'raw':!![]})['then'](handleEntityNotFound(_0x1a9c1e,null))[_0x3037('0x22')](function(_0x20c28e){if(_0x20c28e){if(!fs[_0x3037('0x47')](path['join'](config[_0x3037('0x48')],'server/files/sounds/converted',_0x20c28e['save_name']+'.'+_0x20c28e[_0x3037('0x46')]))){throw new db[(_0x3037('0x49'))][(_0x3037('0x4a'))](_0x3037('0x4b'));}return _0x1a9c1e['download'](path[_0x3037('0x4c')](config[_0x3037('0x48')],'server/files/sounds/converted',util[_0x3037('0x4d')](_0x3037('0x4e'),_0x20c28e[_0x3037('0x4f')],_0x20c28e[_0x3037('0x46')])),util['format'](_0x3037('0x4e'),_0x20c28e[_0x3037('0x27')],_0x20c28e['converted_format']));}return null;})[_0x3037('0x44')](handleError(_0x1a9c1e,null));};exports[_0x3037('0x50')]=function(_0xd0cf8a,_0x24b7a0,_0x355528){var _0x41a74a={'name':path['basename'](_0xd0cf8a[_0x3037('0x51')]['originalname'],path[_0x3037('0x52')](_0xd0cf8a['file'][_0x3037('0x53')])),'save_name':path['basename'](_0xd0cf8a['file'][_0x3037('0x54')],path[_0x3037('0x52')](_0xd0cf8a[_0x3037('0x51')][_0x3037('0x54')])),'original_format':path['extname'](_0xd0cf8a['file'][_0x3037('0x53')])[_0x3037('0x55')](0x1),'converted_format':_0x3037('0x56')};var _0x830625=path['join'](config[_0x3037('0x48')],_0x3037('0x57'),_0xd0cf8a[_0x3037('0x51')][_0x3037('0x54')]);var _0x2c56bb=path[_0x3037('0x4c')](config[_0x3037('0x48')],_0x3037('0x58'),util[_0x3037('0x4d')](_0x3037('0x4e'),path[_0x3037('0x59')](_0xd0cf8a[_0x3037('0x51')][_0x3037('0x54')],path[_0x3037('0x52')](_0xd0cf8a[_0x3037('0x51')][_0x3037('0x54')])),_0x41a74a['converted_format']));logger['info'](_0x3037('0x5a'),_0x830625);logger[_0x3037('0x5b')](_0x3037('0x5c'),_0x2c56bb);try{fs[_0x3037('0x5d')](_0x830625,parseInt(_0x3037('0x5e'),0x8));var _0x4201a1=sox['transcode'](_0x830625,_0x2c56bb,{'sampleRate':0x1f40,'format':_0x3037('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4201a1['on'](_0x3037('0x26'),function(_0x4314f3){fs[_0x3037('0x5f')](_0x830625);_0x24b7a0[_0x3037('0x17')](0x1f4)['send'](_0x4314f3);});_0x4201a1['on'](_0x3037('0x60'),function(_0x509aab){_0x41a74a['original_duration']=isNaN(_0x509aab[_0x3037('0x61')])?null:_0x509aab[_0x3037('0x61')]*0x3e8;_0x41a74a[_0x3037('0x62')]=isNaN(_0x509aab[_0x3037('0x63')])?null:_0x509aab['sampleCount'];_0x41a74a[_0x3037('0x64')]=isNaN(_0x509aab[_0x3037('0x65')])?null:_0x509aab[_0x3037('0x65')];_0x41a74a[_0x3037('0x66')]=isNaN(_0x509aab['bitRate'])?null:_0x509aab[_0x3037('0x67')];_0x41a74a[_0x3037('0x68')]=isNaN(_0x509aab[_0x3037('0x69')])?null:_0x509aab[_0x3037('0x69')];});_0x4201a1['on']('dest',function(_0x10ac1e){_0x41a74a[_0x3037('0x6a')]=isNaN(_0x10ac1e[_0x3037('0x61')])?null:_0x10ac1e[_0x3037('0x61')]*0x3e8;_0x41a74a[_0x3037('0x6b')]=isNaN(_0x10ac1e[_0x3037('0x63')])?null:_0x10ac1e[_0x3037('0x63')];_0x41a74a[_0x3037('0x6c')]=isNaN(_0x10ac1e['channelCount'])?null:_0x10ac1e[_0x3037('0x65')];_0x41a74a[_0x3037('0x6d')]=isNaN(_0x10ac1e['bitRate'])?null:_0x10ac1e[_0x3037('0x67')];_0x41a74a[_0x3037('0x6e')]=isNaN(_0x10ac1e[_0x3037('0x69')])?null:_0x10ac1e[_0x3037('0x69')];});_0x4201a1['on'](_0x3037('0x18'),function(){fs[_0x3037('0x5d')](_0x2c56bb,parseInt(_0x3037('0x5e'),0x8));return db[_0x3037('0x3d')]['create'](_0x41a74a)[_0x3037('0x22')](function(_0x587c10){var _0x2d1278={'role':_0xd0cf8a['body'][_0x3037('0x6f')],'userProfileId':_0xd0cf8a[_0x3037('0x70')]['userProfileId']};if(!_0x2d1278)throw new Error(_0x3037('0x71'));if(_0x2d1278['role']==='user'){var _0xbab971=_0x587c10[_0x3037('0x72')]({'plain':!![]});return db[_0x3037('0x73')][_0x3037('0x43')]({'where':{'name':_0x3037('0x23'),'userProfileId':_0x2d1278[_0x3037('0x74')]},'raw':!![]})[_0x3037('0x22')](function(_0xa83bed){if(_0xa83bed&&_0xa83bed[_0x3037('0x75')]===0x0){return db['UserProfileResource'][_0x3037('0x50')]({'name':_0xbab971['name'],'resourceId':_0xbab971['id'],'type':_0xa83bed['name'],'sectionId':_0xa83bed['id']},{})['then'](function(){return _0x587c10;});}else{return _0x587c10;}})[_0x3037('0x44')](function(_0xb8578d){logger[_0x3037('0x26')](_0x3037('0x76'),_0xb8578d);throw _0xb8578d;});}return _0x587c10;})[_0x3037('0x22')](respondWithResult(_0x24b7a0,null))['catch'](handleError(_0x24b7a0,null));});_0x4201a1[_0x3037('0x77')]();}catch(_0x4596a5){_0x24b7a0[_0x3037('0x17')](0x1f4)[_0x3037('0x28')](_0x4596a5);}};exports[_0x3037('0x21')]=function(_0x3d8b62,_0x41b85e,_0x24d125){return db['Sound'][_0x3037('0x43')]({'where':{'id':_0x3d8b62[_0x3037('0x40')]['id']}})[_0x3037('0x22')](handleEntityNotFound(_0x41b85e,null))['then'](saveUpdates(_[_0x3037('0x39')](_0x3d8b62[_0x3037('0x70')],[_0x3037('0x27'),'description']),null))[_0x3037('0x22')](respondWithResult(_0x41b85e,null))[_0x3037('0x44')](handleError(_0x41b85e,null));};exports[_0x3037('0x78')]=function(_0x5ceb6c,_0x5b1f42,_0x445328){return db[_0x3037('0x3d')][_0x3037('0x43')]({'where':{'id':_0x5ceb6c[_0x3037('0x40')]['id']}})[_0x3037('0x22')](function(_0x5c3d4a){if(_0x5c3d4a){return _0x5c3d4a['destroy']();}})[_0x3037('0x22')](function(_0x4f1b3f){var _0xfb0c41=path[_0x3037('0x4c')](config[_0x3037('0x48')],_0x3037('0x57'),util['format'](_0x3037('0x4e'),_0x4f1b3f[_0x3037('0x4f')],_0x4f1b3f[_0x3037('0x79')]));var _0x44c524=path['join'](config['root'],_0x3037('0x58'),util[_0x3037('0x4d')](_0x3037('0x4e'),_0x4f1b3f['save_name'],_0x4f1b3f[_0x3037('0x46')]));fs[_0x3037('0x5f')](_0xfb0c41);fs['unlinkSync'](_0x44c524);return _0x4f1b3f;})[_0x3037('0x22')](function(_0x12da57){if(_0x12da57){return _0x5b1f42[_0x3037('0x17')](0xcc)[_0x3037('0x18')]();}})[_0x3037('0x22')](handleEntityNotFound(_0x5b1f42,null))[_0x3037('0x44')](handleError(_0x5b1f42,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index f371c4b..052adc5 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 _0x5e72=['exports','Sound','tools_sounds','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./sound.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e72,0x158));var _0x25e7=function(_0x3b11aa,_0xc043c8){_0x3b11aa=_0x3b11aa-0x0;var _0x1c64ff=_0x5e72[_0x3b11aa];return _0x1c64ff;};'use strict';var _=require(_0x25e7('0x0'));var util=require('util');var logger=require(_0x25e7('0x1'))('api');var moment=require(_0x25e7('0x2'));var BPromise=require(_0x25e7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x25e7('0x4'));var rimraf=require(_0x25e7('0x5'));var config=require(_0x25e7('0x6'));var attributes=require(_0x25e7('0x7'));module[_0x25e7('0x8')]=function(_0xa6e515,_0x9d9428){return _0xa6e515['define'](_0x25e7('0x9'),attributes,{'tableName':_0x25e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85d1=['api','bluebird','request-promise','path','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger'];(function(_0x33c1b1,_0x2355fb){var _0x2c2037=function(_0x1200fd){while(--_0x1200fd){_0x33c1b1['push'](_0x33c1b1['shift']());}};_0x2c2037(++_0x2355fb);}(_0x85d1,0x165));var _0x185d=function(_0x295583,_0x4756aa){_0x295583=_0x295583-0x0;var _0x4c2ae6=_0x85d1[_0x295583];return _0x4c2ae6;};'use strict';var _=require(_0x185d('0x0'));var util=require(_0x185d('0x1'));var logger=require(_0x185d('0x2'))(_0x185d('0x3'));var moment=require('moment');var BPromise=require(_0x185d('0x4'));var rp=require(_0x185d('0x5'));var fs=require('fs');var path=require(_0x185d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x185d('0x7'));module[_0x185d('0x8')]=function(_0x3d470f,_0x405184){return _0x3d470f[_0x185d('0x9')](_0x185d('0xa'),attributes,{'tableName':_0x185d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 938bbd4..adc8c19 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 _0x482a=['debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x56ef8b,_0xdbf624){var _0x356f9c=function(_0x5df79a){while(--_0x5df79a){_0x56ef8b['push'](_0x56ef8b['shift']());}};_0x356f9c(++_0xdbf624);}(_0x482a,0x9f));var _0xa482=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x482a[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xa482('0x0'));var util=require(_0xa482('0x1'));var moment=require(_0xa482('0x2'));var BPromise=require(_0xa482('0x3'));var rs=require(_0xa482('0x4'));var fs=require('fs');var Redis=require(_0xa482('0x5'));var db=require(_0xa482('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa482('0x7'))(_0xa482('0x8'));var config=require('../../config/environment');var jayson=require(_0xa482('0x9'));var client=jayson[_0xa482('0xa')][_0xa482('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa1a0fb,_0x11848e,_0x780d95){return new BPromise(function(_0xf6319c,_0x20e25a){return client[_0xa482('0xc')](_0xa1a0fb,_0x780d95)[_0xa482('0xd')](function(_0x3cc88b){logger[_0xa482('0xe')]('Sound,\x20%s,\x20%s',_0x11848e,_0xa482('0xf'));logger[_0xa482('0x10')](_0xa482('0x11'),_0x11848e,_0xa482('0xf'),JSON[_0xa482('0x12')](_0x3cc88b));if(_0x3cc88b[_0xa482('0x13')]){if(_0x3cc88b['error'][_0xa482('0x14')]===0x1f4){logger[_0xa482('0x13')](_0xa482('0x15'),_0x11848e,_0x3cc88b[_0xa482('0x13')][_0xa482('0x16')]);return _0x20e25a(_0x3cc88b['error'][_0xa482('0x16')]);}logger[_0xa482('0x13')](_0xa482('0x15'),_0x11848e,_0x3cc88b['error'][_0xa482('0x16')]);return _0xf6319c(_0x3cc88b[_0xa482('0x13')][_0xa482('0x16')]);}else{logger[_0xa482('0xe')]('Sound,\x20%s,\x20%s',_0x11848e,_0xa482('0xf'));_0xf6319c(_0x3cc88b[_0xa482('0x17')]['message']);}})[_0xa482('0x18')](function(_0x38a98b){logger['error'](_0xa482('0x15'),_0x11848e,_0x38a98b);_0x20e25a(_0x38a98b);});});}exports[_0xa482('0x19')]=function(_0x4160d0){var _0x5afbfc=this;return new Promise(function(_0x319901,_0x106ee8){return db[_0xa482('0x1a')][_0xa482('0x1b')]({'raw':_0x4160d0[_0xa482('0x1c')]?_0x4160d0[_0xa482('0x1c')][_0xa482('0x1d')]===undefined?!![]:![]:!![],'where':_0x4160d0['options']?_0x4160d0[_0xa482('0x1c')][_0xa482('0x1e')]||null:null,'attributes':_0x4160d0['options']?_0x4160d0[_0xa482('0x1c')][_0xa482('0x1f')]||null:null,'include':_0x4160d0[_0xa482('0x1c')]?_0x4160d0[_0xa482('0x1c')][_0xa482('0x20')]?_[_0xa482('0x21')](_0x4160d0[_0xa482('0x1c')][_0xa482('0x20')],function(_0x5c36c9){return{'model':db[_0x5c36c9[_0xa482('0x22')]],'as':_0x5c36c9['as'],'attributes':_0x5c36c9[_0xa482('0x1f')],'include':_0x5c36c9[_0xa482('0x20')]?_[_0xa482('0x21')](_0x5c36c9[_0xa482('0x20')],function(_0x3a0eae){return{'model':db[_0x3a0eae[_0xa482('0x22')]],'as':_0x3a0eae['as'],'attributes':_0x3a0eae[_0xa482('0x1f')],'include':_0x3a0eae['include']?_[_0xa482('0x21')](_0x3a0eae[_0xa482('0x20')],function(_0x26e69d){return{'model':db[_0x26e69d[_0xa482('0x22')]],'as':_0x26e69d['as'],'attributes':_0x26e69d['attributes']};}):[]};}):[]};}):[]:[]})[_0xa482('0xd')](function(_0x4b06d1){logger[_0xa482('0xe')](_0xa482('0x19'),_0x4160d0);logger[_0xa482('0x10')]('ShowSound',_0x4160d0,JSON[_0xa482('0x12')](_0x4b06d1));_0x319901(_0x4b06d1);})[_0xa482('0x18')](function(_0x1c9425){logger['error'](_0xa482('0x19'),_0x1c9425['message'],_0x4160d0);_0x106ee8(_0x5afbfc[_0xa482('0x13')](0x1f4,_0x1c9425['message']));});});}; \ No newline at end of file +var _0x908c=['options','raw','where','attributes','model','include','map','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','ShowSound','Sound','find'];(function(_0x2fa931,_0x63006f){var _0x28ceae=function(_0x3ebea9){while(--_0x3ebea9){_0x2fa931['push'](_0x2fa931['shift']());}};_0x28ceae(++_0x63006f);}(_0x908c,0x127));var _0xc908=function(_0x5dfdf3,_0x1606df){_0x5dfdf3=_0x5dfdf3-0x0;var _0x4b9edc=_0x908c[_0x5dfdf3];return _0x4b9edc;};'use strict';var _=require('lodash');var util=require(_0xc908('0x0'));var moment=require(_0xc908('0x1'));var BPromise=require(_0xc908('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc908('0x3'));var db=require(_0xc908('0x4'))['db'];var utils=require(_0xc908('0x5'));var logger=require(_0xc908('0x6'))(_0xc908('0x7'));var config=require(_0xc908('0x8'));var jayson=require(_0xc908('0x9'));var client=jayson[_0xc908('0xa')][_0xc908('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcf41cf,_0x16633c,_0xbf2e41){return new BPromise(function(_0xb603e9,_0x3b5566){return client[_0xc908('0xc')](_0xcf41cf,_0xbf2e41)['then'](function(_0xc60a29){logger[_0xc908('0xd')](_0xc908('0xe'),_0x16633c,'request\x20sent');logger[_0xc908('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x16633c,_0xc908('0x10'),JSON[_0xc908('0x11')](_0xc60a29));if(_0xc60a29['error']){if(_0xc60a29[_0xc908('0x12')]['code']===0x1f4){logger['error'](_0xc908('0xe'),_0x16633c,_0xc60a29[_0xc908('0x12')][_0xc908('0x13')]);return _0x3b5566(_0xc60a29[_0xc908('0x12')]['message']);}logger[_0xc908('0x12')](_0xc908('0xe'),_0x16633c,_0xc60a29[_0xc908('0x12')][_0xc908('0x13')]);return _0xb603e9(_0xc60a29[_0xc908('0x12')][_0xc908('0x13')]);}else{logger[_0xc908('0xd')](_0xc908('0xe'),_0x16633c,_0xc908('0x10'));_0xb603e9(_0xc60a29[_0xc908('0x14')][_0xc908('0x13')]);}})[_0xc908('0x15')](function(_0x1dad92){logger[_0xc908('0x12')](_0xc908('0xe'),_0x16633c,_0x1dad92);_0x3b5566(_0x1dad92);});});}exports[_0xc908('0x16')]=function(_0x4c3120){var _0x1158b5=this;return new Promise(function(_0x29bf7a,_0x3d10f8){return db[_0xc908('0x17')][_0xc908('0x18')]({'raw':_0x4c3120[_0xc908('0x19')]?_0x4c3120[_0xc908('0x19')][_0xc908('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c3120[_0xc908('0x19')]?_0x4c3120[_0xc908('0x19')][_0xc908('0x1b')]||null:null,'attributes':_0x4c3120[_0xc908('0x19')]?_0x4c3120[_0xc908('0x19')][_0xc908('0x1c')]||null:null,'include':_0x4c3120[_0xc908('0x19')]?_0x4c3120['options']['include']?_['map'](_0x4c3120[_0xc908('0x19')]['include'],function(_0x193602){return{'model':db[_0x193602[_0xc908('0x1d')]],'as':_0x193602['as'],'attributes':_0x193602[_0xc908('0x1c')],'include':_0x193602[_0xc908('0x1e')]?_[_0xc908('0x1f')](_0x193602[_0xc908('0x1e')],function(_0x609979){return{'model':db[_0x609979[_0xc908('0x1d')]],'as':_0x609979['as'],'attributes':_0x609979[_0xc908('0x1c')],'include':_0x609979[_0xc908('0x1e')]?_[_0xc908('0x1f')](_0x609979[_0xc908('0x1e')],function(_0x2bb6b3){return{'model':db[_0x2bb6b3[_0xc908('0x1d')]],'as':_0x2bb6b3['as'],'attributes':_0x2bb6b3[_0xc908('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4af7df){logger[_0xc908('0xd')](_0xc908('0x16'),_0x4c3120);logger[_0xc908('0xf')](_0xc908('0x16'),_0x4c3120,JSON[_0xc908('0x11')](_0x4af7df));_0x29bf7a(_0x4af7df);})['catch'](function(_0x54e071){logger[_0xc908('0x12')](_0xc908('0x16'),_0x54e071[_0xc908('0x13')],_0x4c3120);_0x3d10f8(_0x1158b5[_0xc908('0x12')](0x1f4,_0x54e071['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 332a0d1..da7e086 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 _0x296f=['../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x296f,0x76));var _0xf296=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x296f[_0x40df5f];return _0x1573f1;};'use strict';var multer=require(_0xf296('0x0'));var util=require(_0xf296('0x1'));var path=require(_0xf296('0x2'));var timeout=require(_0xf296('0x3'));var express=require(_0xf296('0x4'));var router=express[_0xf296('0x5')]();var auth=require(_0xf296('0x6'));var interaction=require(_0xf296('0x7'));var config=require(_0xf296('0x8'));var controller=require(_0xf296('0x9'));router['get']('/',auth[_0xf296('0xa')](),controller[_0xf296('0xb')]);router[_0xf296('0xc')](_0xf296('0xd'),auth[_0xf296('0xa')](),controller[_0xf296('0xe')]);router[_0xf296('0xf')]('/',auth[_0xf296('0xa')](),controller[_0xf296('0x10')]);router[_0xf296('0x11')](_0xf296('0xd'),auth[_0xf296('0xa')](),controller['update']);router[_0xf296('0x12')](_0xf296('0xd'),auth[_0xf296('0xa')](),controller[_0xf296('0x13')]);module[_0xf296('0x14')]=router; \ No newline at end of file +var _0x3bb5=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','show','post','create','put','/:id','delete','util'];(function(_0x2836df,_0x391935){var _0x45c293=function(_0x1de626){while(--_0x1de626){_0x2836df['push'](_0x2836df['shift']());}};_0x45c293(++_0x391935);}(_0x3bb5,0x1cf));var _0x53bb=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x3bb5[_0x2235bf];return _0x4c3a64;};'use strict';var multer=require('multer');var util=require(_0x53bb('0x0'));var path=require(_0x53bb('0x1'));var timeout=require(_0x53bb('0x2'));var express=require(_0x53bb('0x3'));var router=express[_0x53bb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x53bb('0x5'));var config=require(_0x53bb('0x6'));var controller=require(_0x53bb('0x7'));router[_0x53bb('0x8')]('/',auth[_0x53bb('0x9')](),controller['index']);router[_0x53bb('0x8')]('/:id',auth[_0x53bb('0x9')](),controller[_0x53bb('0xa')]);router[_0x53bb('0xb')]('/',auth['isAuthenticated'](),controller[_0x53bb('0xc')]);router[_0x53bb('0xd')](_0x53bb('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x53bb('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);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 dcf30f9..241450e 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 _0xc69f=['medium','ENUM','out','exports','STRING','TEXT'];(function(_0x5a424a,_0x51ddf7){var _0x37ed1f=function(_0x15fd7d){while(--_0x15fd7d){_0x5a424a['push'](_0x5a424a['shift']());}};_0x37ed1f(++_0x51ddf7);}(_0xc69f,0x117));var _0xfc69=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc69f[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0xfc69('0x0')]={'uniqueid':{'type':Sequelize[_0xfc69('0x1')]},'body':{'type':Sequelize[_0xfc69('0x2')](_0xfc69('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xfc69('0x4')]('in','out'),'defaultValue':_0xfc69('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x1b72=['out','sequelize','exports','STRING','ENUM'];(function(_0x12d66d,_0x5c72bf){var _0x3fb345=function(_0x2b32d9){while(--_0x2b32d9){_0x12d66d['push'](_0x12d66d['shift']());}};_0x3fb345(++_0x5c72bf);}(_0x1b72,0x100));var _0x21b7=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x1b72[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0x21b7('0x0'));module[_0x21b7('0x1')]={'uniqueid':{'type':Sequelize[_0x21b7('0x2')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x21b7('0x3')]('in',_0x21b7('0x4')),'defaultValue':_0x21b7('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index e4dcb4f..607bdfd 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 _0x34cf=['request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','reject','save','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','VIRTUAL','options','count','then','includeAll','include','rows','show','params','merge','find','catch','create','body','update','eml-format','rimraf','fast-json-patch'];(function(_0x34a9d3,_0x26ae97){var _0x243b14=function(_0x5269cc){while(--_0x5269cc){_0x34a9d3['push'](_0x34a9d3['shift']());}};_0x243b14(++_0x26ae97);}(_0x34cf,0xd8));var _0xf34c=function(_0x1eaa8e,_0x328153){_0x1eaa8e=_0x1eaa8e-0x0;var _0x195658=_0x34cf[_0x1eaa8e];return _0x195658;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf34c('0x0'));var rimraf=require(_0xf34c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf34c('0x2'));var rp=require(_0xf34c('0x3'));var moment=require(_0xf34c('0x4'));var BPromise=require(_0xf34c('0x5'));var Mustache=require(_0xf34c('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf34c('0x7'));var ejs=require(_0xf34c('0x8'));var fs=require('fs');var _=require(_0xf34c('0x9'));var squel=require(_0xf34c('0xa'));var crypto=require(_0xf34c('0xb'));var jsforce=require(_0xf34c('0xc'));var deskjs=require(_0xf34c('0xd'));var toCsv=require(_0xf34c('0x7'));var querystring=require(_0xf34c('0xe'));var Papa=require(_0xf34c('0xf'));var Redis=require('ioredis');var authService=require(_0xf34c('0x10'));var qs=require(_0xf34c('0x11'));var as=require(_0xf34c('0x12'));var hardwareService=require(_0xf34c('0x13'));var logger=require('../../config/logger')(_0xf34c('0x14'));var utils=require(_0xf34c('0x15'));var config=require(_0xf34c('0x16'));var db=require(_0xf34c('0x17'))['db'];function respondWithStatusCode(_0x4c4a6e,_0x2afa82){_0x2afa82=_0x2afa82||0xcc;return function(_0x5b2a08){if(_0x5b2a08){return _0x4c4a6e['sendStatus'](_0x2afa82);}return _0x4c4a6e[_0xf34c('0x18')](_0x2afa82)[_0xf34c('0x19')]();};}function respondWithResult(_0x38e189,_0x10c9b6){_0x10c9b6=_0x10c9b6||0xc8;return function(_0x3a2ba0){if(_0x3a2ba0){return _0x38e189['status'](_0x10c9b6)[_0xf34c('0x1a')](_0x3a2ba0);}};}function respondWithFilteredResult(_0x4fe8e0,_0x4eb03f){return function(_0x195fdd){if(_0x195fdd){var _0x2e98e8=_0x195fdd['count'],_0xd79736=_0x4eb03f[_0xf34c('0x1b')],_0x50f1fa=_0x4eb03f['offset']+_0x4eb03f[_0xf34c('0x1c')],_0x48c5a0;if(_0x50f1fa>=_0x2e98e8){_0x50f1fa=_0x2e98e8;_0x48c5a0=0xc8;}else{_0x48c5a0=0xce;}_0x4fe8e0[_0xf34c('0x18')](_0x48c5a0);return _0x4fe8e0[_0xf34c('0x1d')](_0xf34c('0x1e'),_0xd79736+'-'+_0x50f1fa+'/'+_0x2e98e8)[_0xf34c('0x1a')](_0x195fdd);}return null;};}function patchUpdates(_0x214c38){return function(_0x2479de){try{jsonpatch['apply'](_0x2479de,_0x214c38,!![]);}catch(_0x418000){return BPromise[_0xf34c('0x1f')](_0x418000);}return _0x2479de[_0xf34c('0x20')]();};}function saveUpdates(_0x4532f4,_0x1f2f80){return function(_0x16abc5){if(_0x16abc5){return _0x16abc5['update'](_0x4532f4)['then'](function(_0x162cf7){return _0x162cf7;});}return null;};}function removeEntity(_0x2bd55c,_0x3ec2a1){return function(_0x5ac83e){if(_0x5ac83e){return _0x5ac83e[_0xf34c('0x21')]()['then'](function(){_0x2bd55c[_0xf34c('0x18')](0xcc)[_0xf34c('0x19')]();});}};}function handleEntityNotFound(_0x3de901,_0x5f2f2a){return function(_0xaf888d){if(!_0xaf888d){_0x3de901['sendStatus'](0x194);}return _0xaf888d;};}function handleError(_0x1d0a44,_0x115dc0){_0x115dc0=_0x115dc0||0x1f4;return function(_0x1902b8){logger[_0xf34c('0x22')](_0x1902b8[_0xf34c('0x23')]);if(_0x1902b8[_0xf34c('0x24')]){delete _0x1902b8[_0xf34c('0x24')];}_0x1d0a44[_0xf34c('0x18')](_0x115dc0)[_0xf34c('0x25')](_0x1902b8);};}exports[_0xf34c('0x26')]=function(_0x200514,_0x2da785){var _0x41ebb5={},_0x26ed7e={},_0x5d5acc={'count':0x0,'rows':[]};var _0xb5f4a7=_[_0xf34c('0x27')](db[_0xf34c('0x28')][_0xf34c('0x29')],function(_0x35ac9c){return{'name':_0x35ac9c[_0xf34c('0x2a')],'type':_0x35ac9c[_0xf34c('0x2b')][_0xf34c('0x2c')]};});_0x26ed7e['model']=_[_0xf34c('0x27')](_0xb5f4a7,_0xf34c('0x24'));_0x26ed7e[_0xf34c('0x2d')]=_[_0xf34c('0x2e')](_0x200514[_0xf34c('0x2d')]);_0x26ed7e['filters']=_[_0xf34c('0x2f')](_0x26ed7e[_0xf34c('0x30')],_0x26ed7e[_0xf34c('0x2d')]);_0x41ebb5[_0xf34c('0x31')]=_[_0xf34c('0x2f')](_0x26ed7e[_0xf34c('0x30')],qs[_0xf34c('0x32')](_0x200514[_0xf34c('0x2d')][_0xf34c('0x32')]));_0x41ebb5['attributes']=_0x41ebb5[_0xf34c('0x31')][_0xf34c('0x33')]?_0x41ebb5['attributes']:_0x26ed7e['model'];if(!_0x200514['query'][_0xf34c('0x34')](_0xf34c('0x35'))){_0x41ebb5[_0xf34c('0x1c')]=qs[_0xf34c('0x1c')](_0x200514[_0xf34c('0x2d')]['limit']);_0x41ebb5['offset']=qs['offset'](_0x200514[_0xf34c('0x2d')][_0xf34c('0x1b')]);}_0x41ebb5['order']=qs[_0xf34c('0x36')](_0x200514[_0xf34c('0x2d')]['sort']);_0x41ebb5['where']=qs[_0xf34c('0x37')](_['pick'](_0x200514[_0xf34c('0x2d')],_0x26ed7e[_0xf34c('0x37')]));if(_0x200514['query'][_0xf34c('0x38')]){_0x41ebb5[_0xf34c('0x39')]=_['merge'](_0x41ebb5[_0xf34c('0x39')],{'$or':_[_0xf34c('0x27')](_0xb5f4a7,function(_0x3093cc){if(_0x3093cc['type']!==_0xf34c('0x3a')){var _0x694a80={};_0x694a80[_0x3093cc[_0xf34c('0x24')]]={'$like':'%'+_0x200514['query'][_0xf34c('0x38')]+'%'};return _0x694a80;}})});}_0x41ebb5=_['merge']({},_0x41ebb5,_0x200514[_0xf34c('0x3b')]);var _0x19027c={'where':_0x41ebb5[_0xf34c('0x39')]};return db['SquareMessage'][_0xf34c('0x3c')](_0x19027c)[_0xf34c('0x3d')](function(_0x2498e2){_0x5d5acc[_0xf34c('0x3c')]=_0x2498e2;if(_0x200514['query'][_0xf34c('0x3e')]){_0x41ebb5[_0xf34c('0x3f')]=[{'all':!![]}];}return db[_0xf34c('0x28')]['findAll'](_0x41ebb5);})['then'](function(_0x19031c){_0x5d5acc[_0xf34c('0x40')]=_0x19031c;return _0x5d5acc;})['then'](respondWithFilteredResult(_0x2da785,_0x41ebb5))['catch'](handleError(_0x2da785,null));};exports[_0xf34c('0x41')]=function(_0x19ddac,_0x3c3d63){var _0x3ed10b={'raw':!![],'where':{'id':_0x19ddac[_0xf34c('0x42')]['id']}},_0x36039b={};_0x36039b[_0xf34c('0x30')]=_[_0xf34c('0x2e')](db[_0xf34c('0x28')][_0xf34c('0x29')]);_0x36039b[_0xf34c('0x2d')]=_[_0xf34c('0x2e')](_0x19ddac[_0xf34c('0x2d')]);_0x36039b[_0xf34c('0x37')]=_[_0xf34c('0x2f')](_0x36039b[_0xf34c('0x30')],_0x36039b[_0xf34c('0x2d')]);_0x3ed10b[_0xf34c('0x31')]=_['intersection'](_0x36039b['model'],qs[_0xf34c('0x32')](_0x19ddac[_0xf34c('0x2d')][_0xf34c('0x32')]));_0x3ed10b[_0xf34c('0x31')]=_0x3ed10b[_0xf34c('0x31')][_0xf34c('0x33')]?_0x3ed10b[_0xf34c('0x31')]:_0x36039b[_0xf34c('0x30')];if(_0x19ddac[_0xf34c('0x2d')]['includeAll']){_0x3ed10b['include']=[{'all':!![]}];}_0x3ed10b=_[_0xf34c('0x43')]({},_0x3ed10b,_0x19ddac['options']);return db[_0xf34c('0x28')][_0xf34c('0x44')](_0x3ed10b)['then'](handleEntityNotFound(_0x3c3d63,null))[_0xf34c('0x3d')](respondWithResult(_0x3c3d63,null))[_0xf34c('0x45')](handleError(_0x3c3d63,null));};exports[_0xf34c('0x46')]=function(_0x50f30d,_0xfbaaed){return db[_0xf34c('0x28')][_0xf34c('0x46')](_0x50f30d[_0xf34c('0x47')],{})[_0xf34c('0x3d')](respondWithResult(_0xfbaaed,0xc9))[_0xf34c('0x45')](handleError(_0xfbaaed,null));};exports[_0xf34c('0x48')]=function(_0x4c4441,_0x44ab82){if(_0x4c4441[_0xf34c('0x47')]['id']){delete _0x4c4441['body']['id'];}return db[_0xf34c('0x28')][_0xf34c('0x44')]({'where':{'id':_0x4c4441[_0xf34c('0x42')]['id']}})[_0xf34c('0x3d')](handleEntityNotFound(_0x44ab82,null))[_0xf34c('0x3d')](saveUpdates(_0x4c4441[_0xf34c('0x47')],null))[_0xf34c('0x3d')](respondWithResult(_0x44ab82,null))[_0xf34c('0x45')](handleError(_0x44ab82,null));};exports[_0xf34c('0x21')]=function(_0x4017ae,_0x5b5e73){return db[_0xf34c('0x28')]['find']({'where':{'id':_0x4017ae['params']['id']}})[_0xf34c('0x3d')](handleEntityNotFound(_0x5b5e73,null))['then'](removeEntity(_0x5b5e73,null))[_0xf34c('0x45')](handleError(_0x5b5e73,null));}; \ No newline at end of file +var _0x75ea=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','error','stack','name','index','map','SquareMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','then','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','options','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service'];(function(_0x3778d8,_0x5ce417){var _0x45a1b3=function(_0x28488a){while(--_0x28488a){_0x3778d8['push'](_0x3778d8['shift']());}};_0x45a1b3(++_0x5ce417);}(_0x75ea,0x7d));var _0xa75e=function(_0x8d5c76,_0x5cc0d4){_0x8d5c76=_0x8d5c76-0x0;var _0x44fc55=_0x75ea[_0x8d5c76];return _0x44fc55;};'use strict';var pdf=require(_0xa75e('0x0'));var emlformat=require(_0xa75e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa75e('0x2'));var jsonpatch=require(_0xa75e('0x3'));var rp=require('request-promise');var moment=require(_0xa75e('0x4'));var BPromise=require(_0xa75e('0x5'));var Mustache=require(_0xa75e('0x6'));var util=require(_0xa75e('0x7'));var path=require(_0xa75e('0x8'));var sox=require('sox');var csv=require(_0xa75e('0x9'));var ejs=require(_0xa75e('0xa'));var fs=require('fs');var _=require(_0xa75e('0xb'));var squel=require(_0xa75e('0xc'));var crypto=require(_0xa75e('0xd'));var jsforce=require(_0xa75e('0xe'));var deskjs=require(_0xa75e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa75e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa75e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa75e('0x12'))(_0xa75e('0x13'));var utils=require('../../config/utils');var config=require(_0xa75e('0x14'));var db=require(_0xa75e('0x15'))['db'];function respondWithStatusCode(_0x38dce8,_0x35c81b){_0x35c81b=_0x35c81b||0xcc;return function(_0x46d808){if(_0x46d808){return _0x38dce8[_0xa75e('0x16')](_0x35c81b);}return _0x38dce8[_0xa75e('0x17')](_0x35c81b)[_0xa75e('0x18')]();};}function respondWithResult(_0x3f6719,_0x5319e2){_0x5319e2=_0x5319e2||0xc8;return function(_0x171e67){if(_0x171e67){return _0x3f6719['status'](_0x5319e2)[_0xa75e('0x19')](_0x171e67);}};}function respondWithFilteredResult(_0x10a205,_0x530c38){return function(_0x235860){if(_0x235860){var _0x3179e2=_0x235860[_0xa75e('0x1a')],_0x1d78ce=_0x530c38[_0xa75e('0x1b')],_0x49cbf7=_0x530c38[_0xa75e('0x1b')]+_0x530c38[_0xa75e('0x1c')],_0xb55a6f;if(_0x49cbf7>=_0x3179e2){_0x49cbf7=_0x3179e2;_0xb55a6f=0xc8;}else{_0xb55a6f=0xce;}_0x10a205[_0xa75e('0x17')](_0xb55a6f);return _0x10a205[_0xa75e('0x1d')](_0xa75e('0x1e'),_0x1d78ce+'-'+_0x49cbf7+'/'+_0x3179e2)['json'](_0x235860);}return null;};}function patchUpdates(_0x280491){return function(_0xb8f964){try{jsonpatch[_0xa75e('0x1f')](_0xb8f964,_0x280491,!![]);}catch(_0x4e0fea){return BPromise['reject'](_0x4e0fea);}return _0xb8f964[_0xa75e('0x20')]();};}function saveUpdates(_0x5c14c0,_0x47b19c){return function(_0x4e0809){if(_0x4e0809){return _0x4e0809[_0xa75e('0x21')](_0x5c14c0)['then'](function(_0x2e4f8c){return _0x2e4f8c;});}return null;};}function removeEntity(_0x5da171,_0x32766b){return function(_0x38b3ad){if(_0x38b3ad){return _0x38b3ad[_0xa75e('0x22')]()['then'](function(){_0x5da171[_0xa75e('0x17')](0xcc)[_0xa75e('0x18')]();});}};}function handleEntityNotFound(_0x158caa,_0x4e64aa){return function(_0x227d81){if(!_0x227d81){_0x158caa[_0xa75e('0x16')](0x194);}return _0x227d81;};}function handleError(_0x1faeab,_0x9add90){_0x9add90=_0x9add90||0x1f4;return function(_0x117e25){logger[_0xa75e('0x23')](_0x117e25[_0xa75e('0x24')]);if(_0x117e25[_0xa75e('0x25')]){delete _0x117e25[_0xa75e('0x25')];}_0x1faeab['status'](_0x9add90)['send'](_0x117e25);};}exports[_0xa75e('0x26')]=function(_0x3273d6,_0x58bfef){var _0x909d5b={},_0x316197={},_0xdb92a2={'count':0x0,'rows':[]};var _0x23f5ce=_[_0xa75e('0x27')](db[_0xa75e('0x28')]['rawAttributes'],function(_0x455b8a){return{'name':_0x455b8a[_0xa75e('0x29')],'type':_0x455b8a[_0xa75e('0x2a')][_0xa75e('0x2b')]};});_0x316197[_0xa75e('0x2c')]=_['map'](_0x23f5ce,_0xa75e('0x25'));_0x316197['query']=_['keys'](_0x3273d6[_0xa75e('0x2d')]);_0x316197[_0xa75e('0x2e')]=_[_0xa75e('0x2f')](_0x316197[_0xa75e('0x2c')],_0x316197[_0xa75e('0x2d')]);_0x909d5b[_0xa75e('0x30')]=_[_0xa75e('0x2f')](_0x316197[_0xa75e('0x2c')],qs[_0xa75e('0x31')](_0x3273d6[_0xa75e('0x2d')][_0xa75e('0x31')]));_0x909d5b[_0xa75e('0x30')]=_0x909d5b[_0xa75e('0x30')]['length']?_0x909d5b[_0xa75e('0x30')]:_0x316197[_0xa75e('0x2c')];if(!_0x3273d6[_0xa75e('0x2d')][_0xa75e('0x32')](_0xa75e('0x33'))){_0x909d5b[_0xa75e('0x1c')]=qs['limit'](_0x3273d6['query']['limit']);_0x909d5b[_0xa75e('0x1b')]=qs['offset'](_0x3273d6['query'][_0xa75e('0x1b')]);}_0x909d5b['order']=qs[_0xa75e('0x34')](_0x3273d6[_0xa75e('0x2d')][_0xa75e('0x34')]);_0x909d5b[_0xa75e('0x35')]=qs['filters'](_[_0xa75e('0x36')](_0x3273d6[_0xa75e('0x2d')],_0x316197[_0xa75e('0x2e')]));if(_0x3273d6['query']['filter']){_0x909d5b[_0xa75e('0x35')]=_[_0xa75e('0x37')](_0x909d5b['where'],{'$or':_[_0xa75e('0x27')](_0x23f5ce,function(_0x1b065b){if(_0x1b065b['type']!==_0xa75e('0x38')){var _0x140464={};_0x140464[_0x1b065b['name']]={'$like':'%'+_0x3273d6[_0xa75e('0x2d')][_0xa75e('0x39')]+'%'};return _0x140464;}})});}_0x909d5b=_[_0xa75e('0x37')]({},_0x909d5b,_0x3273d6['options']);var _0x353744={'where':_0x909d5b[_0xa75e('0x35')]};return db[_0xa75e('0x28')][_0xa75e('0x1a')](_0x353744)[_0xa75e('0x3a')](function(_0x509cfb){_0xdb92a2[_0xa75e('0x1a')]=_0x509cfb;if(_0x3273d6['query'][_0xa75e('0x3b')]){_0x909d5b[_0xa75e('0x3c')]=[{'all':!![]}];}return db[_0xa75e('0x28')][_0xa75e('0x3d')](_0x909d5b);})[_0xa75e('0x3a')](function(_0x49f697){_0xdb92a2[_0xa75e('0x3e')]=_0x49f697;return _0xdb92a2;})[_0xa75e('0x3a')](respondWithFilteredResult(_0x58bfef,_0x909d5b))[_0xa75e('0x3f')](handleError(_0x58bfef,null));};exports['show']=function(_0x367d2c,_0x11e3ed){var _0x5988b7={'raw':!![],'where':{'id':_0x367d2c[_0xa75e('0x40')]['id']}},_0x153d2f={};_0x153d2f['model']=_[_0xa75e('0x41')](db[_0xa75e('0x28')][_0xa75e('0x42')]);_0x153d2f[_0xa75e('0x2d')]=_[_0xa75e('0x41')](_0x367d2c[_0xa75e('0x2d')]);_0x153d2f['filters']=_[_0xa75e('0x2f')](_0x153d2f[_0xa75e('0x2c')],_0x153d2f[_0xa75e('0x2d')]);_0x5988b7[_0xa75e('0x30')]=_['intersection'](_0x153d2f['model'],qs['fields'](_0x367d2c[_0xa75e('0x2d')][_0xa75e('0x31')]));_0x5988b7[_0xa75e('0x30')]=_0x5988b7[_0xa75e('0x30')]['length']?_0x5988b7[_0xa75e('0x30')]:_0x153d2f['model'];if(_0x367d2c[_0xa75e('0x2d')][_0xa75e('0x3b')]){_0x5988b7[_0xa75e('0x3c')]=[{'all':!![]}];}_0x5988b7=_['merge']({},_0x5988b7,_0x367d2c[_0xa75e('0x43')]);return db[_0xa75e('0x28')]['find'](_0x5988b7)[_0xa75e('0x3a')](handleEntityNotFound(_0x11e3ed,null))[_0xa75e('0x3a')](respondWithResult(_0x11e3ed,null))[_0xa75e('0x3f')](handleError(_0x11e3ed,null));};exports[_0xa75e('0x44')]=function(_0x598900,_0x2a8e32){return db[_0xa75e('0x28')][_0xa75e('0x44')](_0x598900[_0xa75e('0x45')],{})['then'](respondWithResult(_0x2a8e32,0xc9))[_0xa75e('0x3f')](handleError(_0x2a8e32,null));};exports['update']=function(_0x427a20,_0x240b83){if(_0x427a20[_0xa75e('0x45')]['id']){delete _0x427a20['body']['id'];}return db[_0xa75e('0x28')][_0xa75e('0x46')]({'where':{'id':_0x427a20[_0xa75e('0x40')]['id']}})['then'](handleEntityNotFound(_0x240b83,null))[_0xa75e('0x3a')](saveUpdates(_0x427a20[_0xa75e('0x45')],null))[_0xa75e('0x3a')](respondWithResult(_0x240b83,null))['catch'](handleError(_0x240b83,null));};exports[_0xa75e('0x22')]=function(_0x56f300,_0x4462d0){return db[_0xa75e('0x28')][_0xa75e('0x46')]({'where':{'id':_0x56f300['params']['id']}})[_0xa75e('0x3a')](handleEntityNotFound(_0x4462d0,null))[_0xa75e('0x3a')](removeEntity(_0x4462d0,null))['catch'](handleError(_0x4462d0,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 278d213..350a730 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 _0xdfae=['../../config/logger','api','moment','request-promise','path','../../config/environment','define','lodash','util'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xdfae,0x193));var _0xedfa=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0xdfae[_0x46361e];return _0x14e302;};'use strict';var _=require(_0xedfa('0x0'));var util=require(_0xedfa('0x1'));var logger=require(_0xedfa('0x2'))(_0xedfa('0x3'));var moment=require(_0xedfa('0x4'));var BPromise=require('bluebird');var rp=require(_0xedfa('0x5'));var fs=require('fs');var path=require(_0xedfa('0x6'));var rimraf=require('rimraf');var config=require(_0xedfa('0x7'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x863394,_0x1c6662){return _0x863394[_0xedfa('0x8')]('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd174=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages'];(function(_0x7f212,_0x5b605f){var _0x1ffc9e=function(_0x4dcf13){while(--_0x4dcf13){_0x7f212['push'](_0x7f212['shift']());}};_0x1ffc9e(++_0x5b605f);}(_0xd174,0x9c));var _0x4d17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd174[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4d17('0x0'));var util=require('util');var logger=require(_0x4d17('0x1'))(_0x4d17('0x2'));var moment=require(_0x4d17('0x3'));var BPromise=require(_0x4d17('0x4'));var rp=require(_0x4d17('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4d17('0x6'));var attributes=require(_0x4d17('0x7'));module[_0x4d17('0x8')]=function(_0x5b991d,_0x47e31b){return _0x5b991d[_0x4d17('0x9')](_0x4d17('0xa'),attributes,{'tableName':_0x4d17('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 8dd8337..a9d894f 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 _0xed54=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','create','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed54,0xfc));var _0x4ed5=function(_0x490e6e,_0xf431b1){_0x490e6e=_0x490e6e-0x0;var _0x392656=_0xed54[_0x490e6e];return _0x392656;};'use strict';var _=require('lodash');var util=require(_0x4ed5('0x0'));var moment=require(_0x4ed5('0x1'));var BPromise=require(_0x4ed5('0x2'));var rs=require(_0x4ed5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ed5('0x4'))['db'];var utils=require(_0x4ed5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4ed5('0x6'));var jayson=require(_0x4ed5('0x7'));var client=jayson[_0x4ed5('0x8')][_0x4ed5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32b0b3,_0x406871,_0x499db9){return new BPromise(function(_0x487945,_0x3993ac){return client[_0x4ed5('0xa')](_0x32b0b3,_0x499db9)[_0x4ed5('0xb')](function(_0xb74766){logger[_0x4ed5('0xc')]('SquareMessage,\x20%s,\x20%s',_0x406871,_0x4ed5('0xd'));logger[_0x4ed5('0xe')](_0x4ed5('0xf'),_0x406871,_0x4ed5('0xd'),JSON[_0x4ed5('0x10')](_0xb74766));if(_0xb74766['error']){if(_0xb74766[_0x4ed5('0x11')][_0x4ed5('0x12')]===0x1f4){logger[_0x4ed5('0x11')](_0x4ed5('0x13'),_0x406871,_0xb74766[_0x4ed5('0x11')][_0x4ed5('0x14')]);return _0x3993ac(_0xb74766[_0x4ed5('0x11')][_0x4ed5('0x14')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x406871,_0xb74766[_0x4ed5('0x11')][_0x4ed5('0x14')]);return _0x487945(_0xb74766[_0x4ed5('0x11')][_0x4ed5('0x14')]);}else{logger[_0x4ed5('0xc')](_0x4ed5('0x13'),_0x406871,_0x4ed5('0xd'));_0x487945(_0xb74766[_0x4ed5('0x15')][_0x4ed5('0x14')]);}})[_0x4ed5('0x16')](function(_0x168916){logger[_0x4ed5('0x11')](_0x4ed5('0x13'),_0x406871,_0x168916);_0x3993ac(_0x168916);});});}exports[_0x4ed5('0x17')]=function(_0x16a940){var _0x38c405=this;return new Promise(function(_0x584745,_0x1a9962){return db[_0x4ed5('0x18')][_0x4ed5('0x19')](_0x16a940['body'],{'raw':_0x16a940[_0x4ed5('0x1a')]?_0x16a940[_0x4ed5('0x1a')][_0x4ed5('0x1b')]===undefined?!![]:![]:!![]})[_0x4ed5('0xb')](function(_0x1b4707){logger[_0x4ed5('0xc')](_0x4ed5('0x17'),_0x16a940);logger[_0x4ed5('0xe')]('CreateSquareMessage',_0x16a940,JSON[_0x4ed5('0x10')](_0x1b4707));_0x584745(_0x1b4707);})[_0x4ed5('0x16')](function(_0x4f59d2){logger[_0x4ed5('0x11')]('CreateSquareMessage',_0x4f59d2['message'],_0x16a940);_0x1a9962(_0x38c405['error'](0x1f4,_0x4f59d2[_0x4ed5('0x14')]));});});}; \ No newline at end of file +var _0x8d0a=['http','request','then','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','info','result','catch','SquareMessage','options','debug','CreateSquareMessage','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x15ad70,_0x2e6c67){var _0x3f44ef=function(_0x49a10e){while(--_0x49a10e){_0x15ad70['push'](_0x15ad70['shift']());}};_0x3f44ef(++_0x2e6c67);}(_0x8d0a,0x65));var _0xa8d0=function(_0x378c0d,_0x569fea){_0x378c0d=_0x378c0d-0x0;var _0x56546f=_0x8d0a[_0x378c0d];return _0x56546f;};'use strict';var _=require(_0xa8d0('0x0'));var util=require('util');var moment=require(_0xa8d0('0x1'));var BPromise=require(_0xa8d0('0x2'));var rs=require(_0xa8d0('0x3'));var fs=require('fs');var Redis=require(_0xa8d0('0x4'));var db=require(_0xa8d0('0x5'))['db'];var utils=require(_0xa8d0('0x6'));var logger=require(_0xa8d0('0x7'))(_0xa8d0('0x8'));var config=require(_0xa8d0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa8d0('0xa')][_0xa8d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f95a7,_0x1f8b78,_0x3ee6b4){return new BPromise(function(_0x55ffc0,_0x508238){return client[_0xa8d0('0xc')](_0x1f95a7,_0x3ee6b4)[_0xa8d0('0xd')](function(_0x49e137){logger['info']('SquareMessage,\x20%s,\x20%s',_0x1f8b78,_0xa8d0('0xe'));logger['debug'](_0xa8d0('0xf'),_0x1f8b78,_0xa8d0('0xe'),JSON[_0xa8d0('0x10')](_0x49e137));if(_0x49e137[_0xa8d0('0x11')]){if(_0x49e137[_0xa8d0('0x11')][_0xa8d0('0x12')]===0x1f4){logger[_0xa8d0('0x11')](_0xa8d0('0x13'),_0x1f8b78,_0x49e137[_0xa8d0('0x11')][_0xa8d0('0x14')]);return _0x508238(_0x49e137[_0xa8d0('0x11')]['message']);}logger[_0xa8d0('0x11')]('SquareMessage,\x20%s,\x20%s',_0x1f8b78,_0x49e137['error'][_0xa8d0('0x14')]);return _0x55ffc0(_0x49e137[_0xa8d0('0x11')]['message']);}else{logger[_0xa8d0('0x15')](_0xa8d0('0x13'),_0x1f8b78,_0xa8d0('0xe'));_0x55ffc0(_0x49e137[_0xa8d0('0x16')][_0xa8d0('0x14')]);}})[_0xa8d0('0x17')](function(_0x4ef7bf){logger[_0xa8d0('0x11')](_0xa8d0('0x13'),_0x1f8b78,_0x4ef7bf);_0x508238(_0x4ef7bf);});});}exports['CreateSquareMessage']=function(_0x2f0b00){var _0x1e325a=this;return new Promise(function(_0x53d168,_0x32b11a){return db[_0xa8d0('0x18')]['create'](_0x2f0b00['body'],{'raw':_0x2f0b00[_0xa8d0('0x19')]?_0x2f0b00[_0xa8d0('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xa8d0('0xd')](function(_0x356a52){logger[_0xa8d0('0x15')]('CreateSquareMessage',_0x2f0b00);logger[_0xa8d0('0x1a')]('CreateSquareMessage',_0x2f0b00,JSON[_0xa8d0('0x10')](_0x356a52));_0x53d168(_0x356a52);})[_0xa8d0('0x17')](function(_0x337677){logger[_0xa8d0('0x11')](_0xa8d0('0x1b'),_0x337677[_0xa8d0('0x14')],_0x2f0b00);_0x32b11a(_0x1e325a[_0xa8d0('0x11')](0x1f4,_0x337677['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 86e291d..eaabef9 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 _0x9510=['isAuthenticated','index','get','/:id','show','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller'];(function(_0x9e191a,_0xf223c){var _0x54bb11=function(_0x1ec842){while(--_0x1ec842){_0x9e191a['push'](_0x9e191a['shift']());}};_0x54bb11(++_0xf223c);}(_0x9510,0xbf));var _0x0951=function(_0x13d73f,_0x60cdd1){_0x13d73f=_0x13d73f-0x0;var _0x3c1e86=_0x9510[_0x13d73f];return _0x3c1e86;};'use strict';var multer=require(_0x0951('0x0'));var util=require('util');var path=require(_0x0951('0x1'));var timeout=require(_0x0951('0x2'));var express=require('express');var router=express[_0x0951('0x3')]();var auth=require(_0x0951('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0951('0x5'));var controller=require(_0x0951('0x6'));router['get']('/',auth[_0x0951('0x7')](),controller[_0x0951('0x8')]);router[_0x0951('0x9')](_0x0951('0xa'),auth['isAuthenticated'](),controller[_0x0951('0xb')]);router[_0x0951('0x9')](_0x0951('0xc'),auth[_0x0951('0x7')](),timeout(_0x0951('0xd')),controller[_0x0951('0xe')]);router[_0x0951('0xf')]('/',auth[_0x0951('0x7')](),controller[_0x0951('0x10')]);router[_0x0951('0x11')](_0x0951('0xa'),auth[_0x0951('0x7')](),controller[_0x0951('0x12')]);router[_0x0951('0x13')]('/:id',auth[_0x0951('0x7')](),controller[_0x0951('0x14')]);module[_0x0951('0x15')]=router; \ No newline at end of file +var _0x692a=['post','put','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','15s','test'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x692a,0x15b));var _0xa692=function(_0x985c1b,_0x329d89){_0x985c1b=_0x985c1b-0x0;var _0x1ef9cf=_0x692a[_0x985c1b];return _0x1ef9cf;};'use strict';var multer=require(_0xa692('0x0'));var util=require('util');var path=require(_0xa692('0x1'));var timeout=require('connect-timeout');var express=require(_0xa692('0x2'));var router=express[_0xa692('0x3')]();var auth=require(_0xa692('0x4'));var interaction=require(_0xa692('0x5'));var config=require(_0xa692('0x6'));var controller=require(_0xa692('0x7'));router[_0xa692('0x8')]('/',auth[_0xa692('0x9')](),controller[_0xa692('0xa')]);router[_0xa692('0x8')](_0xa692('0xb'),auth[_0xa692('0x9')](),controller['show']);router[_0xa692('0x8')]('/:id/test',auth[_0xa692('0x9')](),timeout(_0xa692('0xc')),controller[_0xa692('0xd')]);router[_0xa692('0xe')]('/',auth[_0xa692('0x9')](),controller['create']);router[_0xa692('0xf')](_0xa692('0xb'),auth[_0xa692('0x9')](),controller[_0xa692('0x10')]);router[_0xa692('0x11')](_0xa692('0xb'),auth[_0xa692('0x9')](),controller[_0xa692('0x12')]);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 fe5d3d5..566d73e 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 _0xce18=['sequelize','exports','name','STRING'];(function(_0x5661e9,_0x3fac6f){var _0x17ba30=function(_0x38d6cd){while(--_0x38d6cd){_0x5661e9['push'](_0x5661e9['shift']());}};_0x17ba30(++_0x3fac6f);}(_0xce18,0xc8));var _0x8ce1=function(_0x839237,_0x6bdfa3){_0x839237=_0x839237-0x0;var _0x464978=_0xce18[_0x839237];return _0x464978;};'use strict';var Sequelize=require(_0x8ce1('0x0'));module[_0x8ce1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8ce1('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8ce1('0x3')]}}; \ No newline at end of file +var _0xeed2=['STRING','sequelize','exports'];(function(_0x2a55a7,_0x4b6676){var _0x19647a=function(_0x11f74){while(--_0x11f74){_0x2a55a7['push'](_0x2a55a7['shift']());}};_0x19647a(++_0x4b6676);}(_0xeed2,0x85));var _0x2eed=function(_0x2ecbc8,_0x56b64b){_0x2ecbc8=_0x2ecbc8-0x0;var _0x59ae52=_0xeed2[_0x2ecbc8];return _0x59ae52;};'use strict';var Sequelize=require(_0x2eed('0x0'));module[_0x2eed('0x1')]={'name':{'type':Sequelize[_0x2eed('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x2eed('0x2')]},'description':{'type':Sequelize[_0x2eed('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 188f71b..e035293 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 _0x260e=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','apply','reject','save','destroy','then','ODBC','status','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','length','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js'];(function(_0x558395,_0x41f6b6){var _0x49f297=function(_0x149e48){while(--_0x149e48){_0x558395['push'](_0x558395['shift']());}};_0x49f297(++_0x41f6b6);}(_0x260e,0x141));var _0xe260=function(_0x30bf82,_0xaa839d){_0x30bf82=_0x30bf82-0x0;var _0x44c89e=_0x260e[_0x30bf82];return _0x44c89e;};'use strict';var pdf=require(_0xe260('0x0'));var emlformat=require(_0xe260('0x1'));var rimraf=require(_0xe260('0x2'));var zipdir=require(_0xe260('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe260('0x4'));var moment=require(_0xe260('0x5'));var BPromise=require(_0xe260('0x6'));var Mustache=require(_0xe260('0x7'));var util=require('util');var path=require(_0xe260('0x8'));var sox=require(_0xe260('0x9'));var csv=require(_0xe260('0xa'));var ejs=require(_0xe260('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe260('0xc'));var jsforce=require(_0xe260('0xd'));var deskjs=require(_0xe260('0xe'));var toCsv=require(_0xe260('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe260('0xf'));var qs=require(_0xe260('0x10'));var as=require(_0xe260('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe260('0x12'))(_0xe260('0x13'));var utils=require(_0xe260('0x14'));var config=require(_0xe260('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49176f,_0x3b3e62){_0x3b3e62=_0x3b3e62||0xcc;return function(_0x55d9f6){if(_0x55d9f6){return _0x49176f[_0xe260('0x16')](_0x3b3e62);}return _0x49176f['status'](_0x3b3e62)[_0xe260('0x17')]();};}function respondWithResult(_0x573ebe,_0x383c5e){_0x383c5e=_0x383c5e||0xc8;return function(_0x1d857d){if(_0x1d857d){return _0x573ebe['status'](_0x383c5e)[_0xe260('0x18')](_0x1d857d);}};}function respondWithFilteredResult(_0x1ce8e8,_0x1973e1){return function(_0x39dbfc){if(_0x39dbfc){var _0x2e416c=_0x39dbfc[_0xe260('0x19')],_0x2de7f2=_0x1973e1[_0xe260('0x1a')],_0x239d9e=_0x1973e1[_0xe260('0x1a')]+_0x1973e1['limit'],_0x372e4f;if(_0x239d9e>=_0x2e416c){_0x239d9e=_0x2e416c;_0x372e4f=0xc8;}else{_0x372e4f=0xce;}_0x1ce8e8['status'](_0x372e4f);return _0x1ce8e8['set']('Content-Range',_0x2de7f2+'-'+_0x239d9e+'/'+_0x2e416c)[_0xe260('0x18')](_0x39dbfc);}return null;};}function patchUpdates(_0x508340){return function(_0x5467d9){try{jsonpatch[_0xe260('0x1b')](_0x5467d9,_0x508340,!![]);}catch(_0x387755){return BPromise[_0xe260('0x1c')](_0x387755);}return _0x5467d9[_0xe260('0x1d')]();};}function saveUpdates(_0x4ecf83,_0x3852f4){return function(_0x3b6e90){if(_0x3b6e90){return _0x3b6e90['update'](_0x4ecf83)['then'](function(_0x1ed67f){return _0x1ed67f;});}return null;};}function removeEntity(_0x3ff2df,_0x513905){return function(_0x439ba5){if(_0x439ba5){return _0x439ba5[_0xe260('0x1e')]()[_0xe260('0x1f')](function(){var _0x25c293=_0x439ba5['get']({'plain':!![]});var _0x1a3bbc=_0xe260('0x20');return db['UserProfileResource'][_0xe260('0x1e')]({'where':{'type':_0x1a3bbc,'resourceId':_0x25c293['id']}})[_0xe260('0x1f')](function(){return _0x439ba5;});})[_0xe260('0x1f')](function(){_0x3ff2df[_0xe260('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x532332,_0x5ec515){return function(_0xaa09f5){if(!_0xaa09f5){_0x532332['sendStatus'](0x194);}return _0xaa09f5;};}function handleError(_0x39ae4a,_0x495238){_0x495238=_0x495238||0x1f4;return function(_0x422097){logger[_0xe260('0x22')](_0x422097[_0xe260('0x23')]);if(_0x422097['name']){delete _0x422097[_0xe260('0x24')];}_0x39ae4a[_0xe260('0x21')](_0x495238)[_0xe260('0x25')](_0x422097);};}exports[_0xe260('0x26')]=function(_0x19409a,_0x14b024){var _0x404ce1={},_0x34bacc={},_0x5f3917={'count':0x0,'rows':[]};var _0x1c8a4d=_[_0xe260('0x27')](db[_0xe260('0x28')][_0xe260('0x29')],function(_0x1215a6){return{'name':_0x1215a6['fieldName'],'type':_0x1215a6[_0xe260('0x2a')][_0xe260('0x2b')]};});_0x34bacc[_0xe260('0x2c')]=_[_0xe260('0x27')](_0x1c8a4d,_0xe260('0x24'));_0x34bacc['query']=_['keys'](_0x19409a[_0xe260('0x2d')]);_0x34bacc[_0xe260('0x2e')]=_['intersection'](_0x34bacc[_0xe260('0x2c')],_0x34bacc[_0xe260('0x2d')]);_0x404ce1[_0xe260('0x2f')]=_[_0xe260('0x30')](_0x34bacc[_0xe260('0x2c')],qs['fields'](_0x19409a[_0xe260('0x2d')][_0xe260('0x31')]));_0x404ce1[_0xe260('0x2f')]=_0x404ce1[_0xe260('0x2f')]['length']?_0x404ce1[_0xe260('0x2f')]:_0x34bacc[_0xe260('0x2c')];if(!_0x19409a['query']['hasOwnProperty'](_0xe260('0x32'))){_0x404ce1[_0xe260('0x33')]=qs[_0xe260('0x33')](_0x19409a[_0xe260('0x2d')][_0xe260('0x33')]);_0x404ce1['offset']=qs[_0xe260('0x1a')](_0x19409a['query']['offset']);}_0x404ce1[_0xe260('0x34')]=qs[_0xe260('0x35')](_0x19409a['query'][_0xe260('0x35')]);_0x404ce1[_0xe260('0x36')]=qs[_0xe260('0x2e')](_[_0xe260('0x37')](_0x19409a[_0xe260('0x2d')],_0x34bacc[_0xe260('0x2e')]));if(_0x19409a[_0xe260('0x2d')][_0xe260('0x38')]){_0x404ce1[_0xe260('0x36')]=_['merge'](_0x404ce1['where'],{'$or':_['map'](_0x1c8a4d,function(_0x21edfd){if(_0x21edfd[_0xe260('0x2a')]!==_0xe260('0x39')){var _0x30b96c={};_0x30b96c[_0x21edfd[_0xe260('0x24')]]={'$like':'%'+_0x19409a[_0xe260('0x2d')][_0xe260('0x38')]+'%'};return _0x30b96c;}})});}_0x404ce1=_[_0xe260('0x3a')]({},_0x404ce1,_0x19409a['options']);var _0x519307={'where':_0x404ce1[_0xe260('0x36')]};return db[_0xe260('0x28')]['count'](_0x519307)[_0xe260('0x1f')](function(_0x137283){_0x5f3917[_0xe260('0x19')]=_0x137283;if(_0x19409a[_0xe260('0x2d')][_0xe260('0x3b')]){_0x404ce1[_0xe260('0x3c')]=[{'all':!![]}];}return db[_0xe260('0x28')][_0xe260('0x3d')](_0x404ce1);})[_0xe260('0x1f')](function(_0x438636){_0x5f3917[_0xe260('0x3e')]=_0x438636;return _0x5f3917;})[_0xe260('0x1f')](respondWithFilteredResult(_0x14b024,_0x404ce1))[_0xe260('0x3f')](handleError(_0x14b024,null));};exports[_0xe260('0x40')]=function(_0x3345a6,_0x333615){var _0x4bed95={'raw':!![],'where':{'id':_0x3345a6[_0xe260('0x41')]['id']}},_0x1de99c={};_0x1de99c[_0xe260('0x2c')]=_[_0xe260('0x42')](db['SquareOdbc'][_0xe260('0x29')]);_0x1de99c['query']=_['keys'](_0x3345a6['query']);_0x1de99c[_0xe260('0x2e')]=_[_0xe260('0x30')](_0x1de99c[_0xe260('0x2c')],_0x1de99c[_0xe260('0x2d')]);_0x4bed95['attributes']=_[_0xe260('0x30')](_0x1de99c[_0xe260('0x2c')],qs['fields'](_0x3345a6[_0xe260('0x2d')]['fields']));_0x4bed95[_0xe260('0x2f')]=_0x4bed95[_0xe260('0x2f')][_0xe260('0x43')]?_0x4bed95['attributes']:_0x1de99c[_0xe260('0x2c')];if(_0x3345a6['query'][_0xe260('0x3b')]){_0x4bed95['include']=[{'all':!![]}];}_0x4bed95=_[_0xe260('0x3a')]({},_0x4bed95,_0x3345a6[_0xe260('0x44')]);return db[_0xe260('0x28')]['find'](_0x4bed95)[_0xe260('0x1f')](handleEntityNotFound(_0x333615,null))[_0xe260('0x1f')](respondWithResult(_0x333615,null))[_0xe260('0x3f')](handleError(_0x333615,null));};exports[_0xe260('0x45')]=function(_0x1a74af,_0x4f6c0d){return db[_0xe260('0x28')][_0xe260('0x45')](_0x1a74af['body'],{})[_0xe260('0x1f')](function(_0x50b8f9){var _0xa501cc=_0x1a74af[_0xe260('0x46')][_0xe260('0x47')]({'plain':!![]});if(!_0xa501cc)throw new Error(_0xe260('0x48'));if(_0xa501cc['role']===_0xe260('0x46')){var _0x2ce466=_0x50b8f9['get']({'plain':!![]});var _0x88d650='ODBC';return db[_0xe260('0x49')]['find']({'where':{'name':_0x88d650,'userProfileId':_0xa501cc['userProfileId']},'raw':!![]})[_0xe260('0x1f')](function(_0x2f51e2){if(_0x2f51e2&&_0x2f51e2[_0xe260('0x4a')]===0x0){return db[_0xe260('0x4b')]['create']({'name':_0x2ce466['name'],'resourceId':_0x2ce466['id'],'type':_0x2f51e2[_0xe260('0x24')],'sectionId':_0x2f51e2['id']},{})[_0xe260('0x1f')](function(){return _0x50b8f9;});}else{return _0x50b8f9;}})[_0xe260('0x3f')](function(_0x136b09){logger['error'](_0xe260('0x4c'),_0x136b09);throw _0x136b09;});}return _0x50b8f9;})[_0xe260('0x1f')](respondWithResult(_0x4f6c0d,0xc9))[_0xe260('0x3f')](handleError(_0x4f6c0d,null));};exports[_0xe260('0x4d')]=function(_0x4be3a4,_0x4fc939){if(_0x4be3a4['body']['id']){delete _0x4be3a4[_0xe260('0x4e')]['id'];}return db['SquareOdbc'][_0xe260('0x4f')]({'where':{'id':_0x4be3a4['params']['id']}})[_0xe260('0x1f')](handleEntityNotFound(_0x4fc939,null))[_0xe260('0x1f')](saveUpdates(_0x4be3a4['body'],null))[_0xe260('0x1f')](respondWithResult(_0x4fc939,null))[_0xe260('0x3f')](handleError(_0x4fc939,null));};exports[_0xe260('0x1e')]=function(_0x246ab1,_0x993d63){return db[_0xe260('0x28')][_0xe260('0x4f')]({'where':{'id':_0x246ab1[_0xe260('0x41')]['id']}})[_0xe260('0x1f')](handleEntityNotFound(_0x993d63,null))[_0xe260('0x1f')](removeEntity(_0x993d63,null))['catch'](handleError(_0x993d63,null));};exports['test']=function(_0x201a67,_0x91c2df,_0x38a722){var _0x1107ff;return db[_0xe260('0x28')][_0xe260('0x4f')]({'where':{'id':_0x201a67[_0xe260('0x41')]['id']},'attributes':['id',_0xe260('0x50')]})[_0xe260('0x1f')](handleEntityNotFound(_0x91c2df,null))[_0xe260('0x1f')](function(_0x55b874){if(_0x55b874){var _0x4781a6=require(_0xe260('0x51'))();_0x4781a6[_0xe260('0x52')](_0x55b874[_0xe260('0x50')]);_0x4781a6[_0xe260('0x53')]();return _0x55b874;}})[_0xe260('0x1f')](respondWithResult(_0x91c2df,null))[_0xe260('0x3f')](handleError(_0x91c2df,null));}; \ No newline at end of file +var _0x8c66=['jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ODBC','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','include','find','body','user','role','userProfileId','UserProfileResource','create','error','test','dsn','odbc','openSync','closeSync','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x8c66,0x1e6));var _0x68c6=function(_0x45bc3f,_0x234416){_0x45bc3f=_0x45bc3f-0x0;var _0x530329=_0x8c66[_0x45bc3f];return _0x530329;};'use strict';var pdf=require(_0x68c6('0x0'));var emlformat=require(_0x68c6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x68c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68c6('0x3'));var moment=require('moment');var BPromise=require(_0x68c6('0x4'));var Mustache=require(_0x68c6('0x5'));var util=require(_0x68c6('0x6'));var path=require(_0x68c6('0x7'));var sox=require(_0x68c6('0x8'));var csv=require(_0x68c6('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x68c6('0xa'));var crypto=require(_0x68c6('0xb'));var jsforce=require(_0x68c6('0xc'));var deskjs=require(_0x68c6('0xd'));var toCsv=require(_0x68c6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x68c6('0xe'));var authService=require(_0x68c6('0xf'));var qs=require(_0x68c6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68c6('0x11'));var logger=require(_0x68c6('0x12'))(_0x68c6('0x13'));var utils=require('../../config/utils');var config=require(_0x68c6('0x14'));var db=require(_0x68c6('0x15'))['db'];function respondWithStatusCode(_0x11f4f6,_0x2312a0){_0x2312a0=_0x2312a0||0xcc;return function(_0x43b77e){if(_0x43b77e){return _0x11f4f6[_0x68c6('0x16')](_0x2312a0);}return _0x11f4f6[_0x68c6('0x17')](_0x2312a0)[_0x68c6('0x18')]();};}function respondWithResult(_0x58721d,_0x46b332){_0x46b332=_0x46b332||0xc8;return function(_0xdd96be){if(_0xdd96be){return _0x58721d[_0x68c6('0x17')](_0x46b332)[_0x68c6('0x19')](_0xdd96be);}};}function respondWithFilteredResult(_0x3c05fc,_0x323654){return function(_0xa224bf){if(_0xa224bf){var _0xa695ee=_0xa224bf[_0x68c6('0x1a')],_0x1a06f4=_0x323654['offset'],_0x38fffc=_0x323654[_0x68c6('0x1b')]+_0x323654[_0x68c6('0x1c')],_0x407baf;if(_0x38fffc>=_0xa695ee){_0x38fffc=_0xa695ee;_0x407baf=0xc8;}else{_0x407baf=0xce;}_0x3c05fc[_0x68c6('0x17')](_0x407baf);return _0x3c05fc[_0x68c6('0x1d')](_0x68c6('0x1e'),_0x1a06f4+'-'+_0x38fffc+'/'+_0xa695ee)[_0x68c6('0x19')](_0xa224bf);}return null;};}function patchUpdates(_0x5c6089){return function(_0x5a40e3){try{jsonpatch[_0x68c6('0x1f')](_0x5a40e3,_0x5c6089,!![]);}catch(_0x574c5e){return BPromise[_0x68c6('0x20')](_0x574c5e);}return _0x5a40e3[_0x68c6('0x21')]();};}function saveUpdates(_0x5bf24f,_0x328dd4){return function(_0x23040d){if(_0x23040d){return _0x23040d[_0x68c6('0x22')](_0x5bf24f)[_0x68c6('0x23')](function(_0x3e3c43){return _0x3e3c43;});}return null;};}function removeEntity(_0x45f5cb,_0x4e3fed){return function(_0xc251df){if(_0xc251df){return _0xc251df[_0x68c6('0x24')]()[_0x68c6('0x23')](function(){var _0x57fb3a=_0xc251df[_0x68c6('0x25')]({'plain':!![]});var _0x6324c8=_0x68c6('0x26');return db['UserProfileResource'][_0x68c6('0x24')]({'where':{'type':_0x6324c8,'resourceId':_0x57fb3a['id']}})[_0x68c6('0x23')](function(){return _0xc251df;});})[_0x68c6('0x23')](function(){_0x45f5cb[_0x68c6('0x17')](0xcc)[_0x68c6('0x18')]();});}};}function handleEntityNotFound(_0x329a05,_0x5556f9){return function(_0x305fa0){if(!_0x305fa0){_0x329a05['sendStatus'](0x194);}return _0x305fa0;};}function handleError(_0x456301,_0x49982f){_0x49982f=_0x49982f||0x1f4;return function(_0x54a157){logger['error'](_0x54a157['stack']);if(_0x54a157[_0x68c6('0x27')]){delete _0x54a157['name'];}_0x456301[_0x68c6('0x17')](_0x49982f)[_0x68c6('0x28')](_0x54a157);};}exports[_0x68c6('0x29')]=function(_0x2006f4,_0x378569){var _0x24c449={},_0x58b028={},_0x13a961={'count':0x0,'rows':[]};var _0x121486=_[_0x68c6('0x2a')](db[_0x68c6('0x2b')][_0x68c6('0x2c')],function(_0x3cb245){return{'name':_0x3cb245[_0x68c6('0x2d')],'type':_0x3cb245[_0x68c6('0x2e')][_0x68c6('0x2f')]};});_0x58b028['model']=_[_0x68c6('0x2a')](_0x121486,_0x68c6('0x27'));_0x58b028[_0x68c6('0x30')]=_[_0x68c6('0x31')](_0x2006f4['query']);_0x58b028['filters']=_[_0x68c6('0x32')](_0x58b028[_0x68c6('0x33')],_0x58b028['query']);_0x24c449[_0x68c6('0x34')]=_[_0x68c6('0x32')](_0x58b028[_0x68c6('0x33')],qs[_0x68c6('0x35')](_0x2006f4['query']['fields']));_0x24c449[_0x68c6('0x34')]=_0x24c449[_0x68c6('0x34')][_0x68c6('0x36')]?_0x24c449[_0x68c6('0x34')]:_0x58b028['model'];if(!_0x2006f4[_0x68c6('0x30')][_0x68c6('0x37')](_0x68c6('0x38'))){_0x24c449[_0x68c6('0x1c')]=qs['limit'](_0x2006f4[_0x68c6('0x30')]['limit']);_0x24c449[_0x68c6('0x1b')]=qs['offset'](_0x2006f4['query'][_0x68c6('0x1b')]);}_0x24c449['order']=qs[_0x68c6('0x39')](_0x2006f4[_0x68c6('0x30')][_0x68c6('0x39')]);_0x24c449[_0x68c6('0x3a')]=qs[_0x68c6('0x3b')](_[_0x68c6('0x3c')](_0x2006f4[_0x68c6('0x30')],_0x58b028['filters']));if(_0x2006f4['query'][_0x68c6('0x3d')]){_0x24c449[_0x68c6('0x3a')]=_[_0x68c6('0x3e')](_0x24c449[_0x68c6('0x3a')],{'$or':_[_0x68c6('0x2a')](_0x121486,function(_0x26e548){if(_0x26e548[_0x68c6('0x2e')]!==_0x68c6('0x3f')){var _0x3b923c={};_0x3b923c[_0x26e548[_0x68c6('0x27')]]={'$like':'%'+_0x2006f4[_0x68c6('0x30')][_0x68c6('0x3d')]+'%'};return _0x3b923c;}})});}_0x24c449=_['merge']({},_0x24c449,_0x2006f4[_0x68c6('0x40')]);var _0x1dcead={'where':_0x24c449['where']};return db[_0x68c6('0x2b')][_0x68c6('0x1a')](_0x1dcead)[_0x68c6('0x23')](function(_0x91f17f){_0x13a961[_0x68c6('0x1a')]=_0x91f17f;if(_0x2006f4['query'][_0x68c6('0x41')]){_0x24c449['include']=[{'all':!![]}];}return db[_0x68c6('0x2b')]['findAll'](_0x24c449);})[_0x68c6('0x23')](function(_0x1857ff){_0x13a961['rows']=_0x1857ff;return _0x13a961;})[_0x68c6('0x23')](respondWithFilteredResult(_0x378569,_0x24c449))[_0x68c6('0x42')](handleError(_0x378569,null));};exports[_0x68c6('0x43')]=function(_0x3902fb,_0x293a1d){var _0x4b9c3d={'raw':!![],'where':{'id':_0x3902fb[_0x68c6('0x44')]['id']}},_0xe0bc5b={};_0xe0bc5b[_0x68c6('0x33')]=_[_0x68c6('0x31')](db[_0x68c6('0x2b')][_0x68c6('0x2c')]);_0xe0bc5b[_0x68c6('0x30')]=_[_0x68c6('0x31')](_0x3902fb[_0x68c6('0x30')]);_0xe0bc5b[_0x68c6('0x3b')]=_[_0x68c6('0x32')](_0xe0bc5b[_0x68c6('0x33')],_0xe0bc5b[_0x68c6('0x30')]);_0x4b9c3d['attributes']=_[_0x68c6('0x32')](_0xe0bc5b[_0x68c6('0x33')],qs['fields'](_0x3902fb[_0x68c6('0x30')]['fields']));_0x4b9c3d[_0x68c6('0x34')]=_0x4b9c3d['attributes']['length']?_0x4b9c3d[_0x68c6('0x34')]:_0xe0bc5b['model'];if(_0x3902fb['query']['includeAll']){_0x4b9c3d[_0x68c6('0x45')]=[{'all':!![]}];}_0x4b9c3d=_[_0x68c6('0x3e')]({},_0x4b9c3d,_0x3902fb[_0x68c6('0x40')]);return db[_0x68c6('0x2b')][_0x68c6('0x46')](_0x4b9c3d)[_0x68c6('0x23')](handleEntityNotFound(_0x293a1d,null))[_0x68c6('0x23')](respondWithResult(_0x293a1d,null))['catch'](handleError(_0x293a1d,null));};exports['create']=function(_0x402065,_0x597796){return db[_0x68c6('0x2b')]['create'](_0x402065[_0x68c6('0x47')],{})[_0x68c6('0x23')](function(_0xaac34a){var _0x41dc14=_0x402065[_0x68c6('0x48')][_0x68c6('0x25')]({'plain':!![]});if(!_0x41dc14)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41dc14[_0x68c6('0x49')]===_0x68c6('0x48')){var _0x285d91=_0xaac34a['get']({'plain':!![]});var _0x3543a4=_0x68c6('0x26');return db['UserProfileSection'][_0x68c6('0x46')]({'where':{'name':_0x3543a4,'userProfileId':_0x41dc14[_0x68c6('0x4a')]},'raw':!![]})[_0x68c6('0x23')](function(_0x12bc0b){if(_0x12bc0b&&_0x12bc0b['autoAssociation']===0x0){return db[_0x68c6('0x4b')][_0x68c6('0x4c')]({'name':_0x285d91[_0x68c6('0x27')],'resourceId':_0x285d91['id'],'type':_0x12bc0b[_0x68c6('0x27')],'sectionId':_0x12bc0b['id']},{})[_0x68c6('0x23')](function(){return _0xaac34a;});}else{return _0xaac34a;}})[_0x68c6('0x42')](function(_0x350b40){logger[_0x68c6('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x350b40);throw _0x350b40;});}return _0xaac34a;})[_0x68c6('0x23')](respondWithResult(_0x597796,0xc9))[_0x68c6('0x42')](handleError(_0x597796,null));};exports[_0x68c6('0x22')]=function(_0x4e1765,_0x4bb312){if(_0x4e1765[_0x68c6('0x47')]['id']){delete _0x4e1765[_0x68c6('0x47')]['id'];}return db['SquareOdbc'][_0x68c6('0x46')]({'where':{'id':_0x4e1765['params']['id']}})['then'](handleEntityNotFound(_0x4bb312,null))['then'](saveUpdates(_0x4e1765[_0x68c6('0x47')],null))['then'](respondWithResult(_0x4bb312,null))[_0x68c6('0x42')](handleError(_0x4bb312,null));};exports[_0x68c6('0x24')]=function(_0x2b602e,_0x1b5bda){return db[_0x68c6('0x2b')][_0x68c6('0x46')]({'where':{'id':_0x2b602e['params']['id']}})[_0x68c6('0x23')](handleEntityNotFound(_0x1b5bda,null))[_0x68c6('0x23')](removeEntity(_0x1b5bda,null))[_0x68c6('0x42')](handleError(_0x1b5bda,null));};exports[_0x68c6('0x4e')]=function(_0x3bc000,_0x32268f,_0x4f0a5a){var _0x4d5c44;return db['SquareOdbc'][_0x68c6('0x46')]({'where':{'id':_0x3bc000[_0x68c6('0x44')]['id']},'attributes':['id',_0x68c6('0x4f')]})[_0x68c6('0x23')](handleEntityNotFound(_0x32268f,null))[_0x68c6('0x23')](function(_0x45912b){if(_0x45912b){var _0x1b2198=require(_0x68c6('0x50'))();_0x1b2198[_0x68c6('0x51')](_0x45912b[_0x68c6('0x4f')]);_0x1b2198[_0x68c6('0x52')]();return _0x45912b;}})['then'](respondWithResult(_0x32268f,null))[_0x68c6('0x42')](handleError(_0x32268f,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 8b2b42b..a74bdfd 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 _0xa20b=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','square_odbc'];(function(_0x11aff2,_0x42b6bc){var _0x3ac1a8=function(_0x5ac52d){while(--_0x5ac52d){_0x11aff2['push'](_0x11aff2['shift']());}};_0x3ac1a8(++_0x42b6bc);}(_0xa20b,0x10e));var _0xba20=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa20b[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xba20('0x0'));var logger=require(_0xba20('0x1'))('api');var moment=require(_0xba20('0x2'));var BPromise=require('bluebird');var rp=require(_0xba20('0x3'));var fs=require('fs');var path=require(_0xba20('0x4'));var rimraf=require(_0xba20('0x5'));var config=require(_0xba20('0x6'));var attributes=require(_0xba20('0x7'));module[_0xba20('0x8')]=function(_0x4b076c,_0x15326c){return _0x4b076c['define']('SquareOdbc',attributes,{'tableName':_0xba20('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x464b=['exports','define','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x218ccb,_0x33e32f){var _0x592648=function(_0xb3e077){while(--_0xb3e077){_0x218ccb['push'](_0x218ccb['shift']());}};_0x592648(++_0x33e32f);}(_0x464b,0x161));var _0xb464=function(_0x43fdd9,_0x17929c){_0x43fdd9=_0x43fdd9-0x0;var _0x5d78b8=_0x464b[_0x43fdd9];return _0x5d78b8;};'use strict';var _=require(_0xb464('0x0'));var util=require(_0xb464('0x1'));var logger=require(_0xb464('0x2'))(_0xb464('0x3'));var moment=require(_0xb464('0x4'));var BPromise=require(_0xb464('0x5'));var rp=require(_0xb464('0x6'));var fs=require('fs');var path=require(_0xb464('0x7'));var rimraf=require(_0xb464('0x8'));var config=require(_0xb464('0x9'));var attributes=require(_0xb464('0xa'));module[_0xb464('0xb')]=function(_0x4553f7,_0x58b7ff){return _0x4553f7[_0xb464('0xc')]('SquareOdbc',attributes,{'tableName':_0xb464('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 7a57781..147547d 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 _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find'];(function(_0xf90c74,_0x1ea5ca){var _0x3e5b3a=function(_0x581d90){while(--_0x581d90){_0xf90c74['push'](_0xf90c74['shift']());}};_0x3e5b3a(++_0x1ea5ca);}(_0x55ca,0x126));var _0xa55c=function(_0x57cbfb,_0x2de760){_0x57cbfb=_0x57cbfb-0x0;var _0x4cb933=_0x55ca[_0x57cbfb];return _0x4cb933;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find'];(function(_0x1dda39,_0x221826){var _0x269408=function(_0x545613){while(--_0x545613){_0x1dda39['push'](_0x1dda39['shift']());}};_0x269408(++_0x221826);}(_0x55ca,0x126));var _0xa55c=function(_0x45afc1,_0x52a029){_0x45afc1=_0x45afc1-0x0;var _0x182539=_0x55ca[_0x45afc1];return _0x182539;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 1f22eda..3bf69c1 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 _0x28f2=['index','/:id','show','/:id/users','getUsers','create','addUsers','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated'];(function(_0x2bc19a,_0x20c3a7){var _0x2a2de8=function(_0x61c84f){while(--_0x61c84f){_0x2bc19a['push'](_0x2bc19a['shift']());}};_0x2a2de8(++_0x20c3a7);}(_0x28f2,0x193));var _0x228f=function(_0xbdf646,_0x3cefca){_0xbdf646=_0xbdf646-0x0;var _0x273b37=_0x28f2[_0xbdf646];return _0x273b37;};'use strict';var multer=require(_0x228f('0x0'));var util=require(_0x228f('0x1'));var path=require(_0x228f('0x2'));var timeout=require(_0x228f('0x3'));var express=require(_0x228f('0x4'));var router=express['Router']();var auth=require(_0x228f('0x5'));var interaction=require(_0x228f('0x6'));var config=require(_0x228f('0x7'));var controller=require(_0x228f('0x8'));router[_0x228f('0x9')]('/',auth[_0x228f('0xa')](),controller[_0x228f('0xb')]);router['get'](_0x228f('0xc'),auth['isAuthenticated'](),controller[_0x228f('0xd')]);router[_0x228f('0x9')](_0x228f('0xe'),auth['isAuthenticated'](),controller[_0x228f('0xf')]);router['post']('/',auth[_0x228f('0xa')](),controller[_0x228f('0x10')]);router['post'](_0x228f('0xe'),auth[_0x228f('0xa')](),controller[_0x228f('0x11')]);router[_0x228f('0x12')](_0x228f('0xc'),auth['isAuthenticated'](),controller[_0x228f('0x13')]);router[_0x228f('0x14')](_0x228f('0xc'),auth[_0x228f('0xa')](),controller[_0x228f('0x15')]);router[_0x228f('0x14')](_0x228f('0xe'),auth[_0x228f('0xa')](),controller['removeUsers']);module[_0x228f('0x16')]=router; \ No newline at end of file +var _0x9c00=['express','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','/:id/users','getUsers','post','create','addUsers','put','update','delete','destroy','removeUsers','exports','multer','util'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0x9c00,0x1a0));var _0x09c0=function(_0x3c78e7,_0x19a615){_0x3c78e7=_0x3c78e7-0x0;var _0x46c763=_0x9c00[_0x3c78e7];return _0x46c763;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x09c0('0x4'));var config=require(_0x09c0('0x5'));var controller=require(_0x09c0('0x6'));router[_0x09c0('0x7')]('/',auth[_0x09c0('0x8')](),controller['index']);router['get'](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xa')]);router[_0x09c0('0x7')](_0x09c0('0xb'),auth['isAuthenticated'](),controller[_0x09c0('0xc')]);router[_0x09c0('0xd')]('/',auth[_0x09c0('0x8')](),controller[_0x09c0('0xe')]);router[_0x09c0('0xd')](_0x09c0('0xb'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xf')]);router[_0x09c0('0x10')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x11')]);router[_0x09c0('0x12')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x13')]);router[_0x09c0('0x12')](_0x09c0('0xb'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x14')]);module[_0x09c0('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 0f537d4..ac84a73 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 _0x094c=['TEXT','BLOB','long','getDataValue','preproduction','toString','production','utf8','sequelize','exports','STRING'];(function(_0x4772e3,_0x4ae898){var _0x56832a=function(_0x4a08df){while(--_0x4a08df){_0x4772e3['push'](_0x4772e3['shift']());}};_0x56832a(++_0x4ae898);}(_0x094c,0x1aa));var _0xc094=function(_0x5f0305,_0x4bdfa8){_0x5f0305=_0x5f0305-0x0;var _0x344ecf=_0x094c[_0x5f0305];return _0x344ecf;};'use strict';var Sequelize=require(_0xc094('0x0'));module[_0xc094('0x1')]={'name':{'type':Sequelize[_0xc094('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xc094('0x3')]},'preproduction':{'type':Sequelize[_0xc094('0x4')](_0xc094('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0xc094('0x6')](_0xc094('0x7'))[_0xc094('0x8')]('utf8');}}},'production':{'type':Sequelize[_0xc094('0x4')](_0xc094('0x5')),'get':function(){if(this[_0xc094('0x6')](_0xc094('0x9'))){return this['getDataValue'](_0xc094('0x9'))[_0xc094('0x8')](_0xc094('0xa'));}}}}; \ No newline at end of file +var _0xbf8d=['production','sequelize','name','STRING','TEXT','BLOB','getDataValue','preproduction','toString','utf8'];(function(_0x593614,_0x2a9105){var _0x2f0f39=function(_0x4e1ef2){while(--_0x4e1ef2){_0x593614['push'](_0x593614['shift']());}};_0x2f0f39(++_0x2a9105);}(_0xbf8d,0x65));var _0xdbf8=function(_0x239e06,_0x36d5d2){_0x239e06=_0x239e06-0x0;var _0x1c134c=_0xbf8d[_0x239e06];return _0x1c134c;};'use strict';var Sequelize=require(_0xdbf8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xdbf8('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xdbf8('0x2')]},'notes':{'type':Sequelize[_0xdbf8('0x3')]},'preproduction':{'type':Sequelize[_0xdbf8('0x4')]('long'),'get':function(){if(this[_0xdbf8('0x5')](_0xdbf8('0x6'))){return this[_0xdbf8('0x5')](_0xdbf8('0x6'))[_0xdbf8('0x7')](_0xdbf8('0x8'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xdbf8('0x5')](_0xdbf8('0x9'))){return this[_0xdbf8('0x5')](_0xdbf8('0x9'))[_0xdbf8('0x7')](_0xdbf8('0x8'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c456d7a..6e3e114 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 _0xbee3=['rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','isArray','emit','userSquareProject:remove','findOne','User','order','getUsers','hasOwnProperty','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','count','offset','limit','set','reject','save','update','then','get','UserProfileResource','destroy','end','error','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','SquareProject','includeAll','include','findAll'];(function(_0x2f83e7,_0x5ca3cf){var _0x30dd7e=function(_0x5459d1){while(--_0x5459d1){_0x2f83e7['push'](_0x2f83e7['shift']());}};_0x30dd7e(++_0x5ca3cf);}(_0xbee3,0xd5));var _0x3bee=function(_0x162a27,_0x4f1b0e){_0x162a27=_0x162a27-0x0;var _0xb19ce6=_0xbee3[_0x162a27];return _0xb19ce6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3bee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3bee('0x1'));var rp=require(_0x3bee('0x2'));var moment=require('moment');var BPromise=require(_0x3bee('0x3'));var Mustache=require(_0x3bee('0x4'));var util=require(_0x3bee('0x5'));var path=require('path');var sox=require(_0x3bee('0x6'));var csv=require(_0x3bee('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x7'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var db=require(_0x3bee('0x15'))['db'];config[_0x3bee('0x16')]=_[_0x3bee('0x17')](config[_0x3bee('0x16')],{'host':_0x3bee('0x18'),'port':0x18eb});var socket=require(_0x3bee('0x19'))(new Redis(config[_0x3bee('0x16')]));require('./squareProject.socket')[_0x3bee('0x1a')](socket);function respondWithStatusCode(_0x33504d,_0x31ac52){_0x31ac52=_0x31ac52||0xcc;return function(_0x237110){if(_0x237110){return _0x33504d[_0x3bee('0x1b')](_0x31ac52);}return _0x33504d['status'](_0x31ac52)['end']();};}function respondWithResult(_0x346767,_0x515397){_0x515397=_0x515397||0xc8;return function(_0x2cfba7){if(_0x2cfba7){return _0x346767[_0x3bee('0x1c')](_0x515397)['json'](_0x2cfba7);}};}function respondWithFilteredResult(_0x5c87cf,_0x1582a4){return function(_0x36c5aa){if(_0x36c5aa){var _0xfdba3b=_0x36c5aa[_0x3bee('0x1d')],_0x631ff8=_0x1582a4[_0x3bee('0x1e')],_0x49095a=_0x1582a4[_0x3bee('0x1e')]+_0x1582a4[_0x3bee('0x1f')],_0x30a1de;if(_0x49095a>=_0xfdba3b){_0x49095a=_0xfdba3b;_0x30a1de=0xc8;}else{_0x30a1de=0xce;}_0x5c87cf[_0x3bee('0x1c')](_0x30a1de);return _0x5c87cf[_0x3bee('0x20')]('Content-Range',_0x631ff8+'-'+_0x49095a+'/'+_0xfdba3b)['json'](_0x36c5aa);}return null;};}function patchUpdates(_0x1afd0f){return function(_0x30bba2){try{jsonpatch['apply'](_0x30bba2,_0x1afd0f,!![]);}catch(_0x471027){return BPromise[_0x3bee('0x21')](_0x471027);}return _0x30bba2[_0x3bee('0x22')]();};}function saveUpdates(_0x179e62,_0x28c248){return function(_0x26e92e){if(_0x26e92e){return _0x26e92e[_0x3bee('0x23')](_0x179e62)['then'](function(_0x8ae4ca){return _0x8ae4ca;});}return null;};}function removeEntity(_0x1ed0c1,_0x1fed5a){return function(_0x3bb884){if(_0x3bb884){return _0x3bb884['destroy']()[_0x3bee('0x24')](function(){var _0xdcc781=_0x3bb884[_0x3bee('0x25')]({'plain':!![]});var _0x4b4cd4='SquareProjects';return db[_0x3bee('0x26')][_0x3bee('0x27')]({'where':{'type':_0x4b4cd4,'resourceId':_0xdcc781['id']}})['then'](function(){return _0x3bb884;});})[_0x3bee('0x24')](function(){_0x1ed0c1[_0x3bee('0x1c')](0xcc)[_0x3bee('0x28')]();});}};}function handleEntityNotFound(_0x5b1eec,_0x1984c4){return function(_0x355b64){if(!_0x355b64){_0x5b1eec[_0x3bee('0x1b')](0x194);}return _0x355b64;};}function handleError(_0x4f2066,_0x239fa4){_0x239fa4=_0x239fa4||0x1f4;return function(_0xf08fb3){logger[_0x3bee('0x29')](_0xf08fb3['stack']);if(_0xf08fb3[_0x3bee('0x2a')]){delete _0xf08fb3[_0x3bee('0x2a')];}_0x4f2066[_0x3bee('0x1c')](_0x239fa4)[_0x3bee('0x2b')](_0xf08fb3);};}exports[_0x3bee('0x2c')]=function(_0x559c2b,_0x564e45){var _0x3fbc8c={},_0x1e1529={},_0x10bae0={'count':0x0,'rows':[]};var _0x11e07d=_['map'](db['SquareProject'][_0x3bee('0x2d')],function(_0x42cb58){return{'name':_0x42cb58['fieldName'],'type':_0x42cb58['type'][_0x3bee('0x2e')]};});_0x1e1529[_0x3bee('0x2f')]=_[_0x3bee('0x30')](_0x11e07d,_0x3bee('0x2a'));_0x1e1529[_0x3bee('0x31')]=_[_0x3bee('0x32')](_0x559c2b[_0x3bee('0x31')]);_0x1e1529[_0x3bee('0x33')]=_[_0x3bee('0x34')](_0x1e1529[_0x3bee('0x2f')],_0x1e1529['query']);_0x3fbc8c['attributes']=_[_0x3bee('0x34')](_0x1e1529['model'],qs['fields'](_0x559c2b[_0x3bee('0x31')][_0x3bee('0x35')]));_0x3fbc8c[_0x3bee('0x36')]=_0x3fbc8c[_0x3bee('0x36')][_0x3bee('0x37')]?_0x3fbc8c[_0x3bee('0x36')]:_0x1e1529[_0x3bee('0x2f')];if(!_0x559c2b[_0x3bee('0x31')]['hasOwnProperty'](_0x3bee('0x38'))){_0x3fbc8c[_0x3bee('0x1f')]=qs['limit'](_0x559c2b[_0x3bee('0x31')][_0x3bee('0x1f')]);_0x3fbc8c[_0x3bee('0x1e')]=qs[_0x3bee('0x1e')](_0x559c2b[_0x3bee('0x31')]['offset']);}_0x3fbc8c['order']=qs[_0x3bee('0x39')](_0x559c2b[_0x3bee('0x31')][_0x3bee('0x39')]);_0x3fbc8c[_0x3bee('0x3a')]=qs[_0x3bee('0x33')](_[_0x3bee('0x3b')](_0x559c2b[_0x3bee('0x31')],_0x1e1529[_0x3bee('0x33')]));if(_0x559c2b[_0x3bee('0x31')][_0x3bee('0x3c')]){_0x3fbc8c[_0x3bee('0x3a')]=_[_0x3bee('0x3d')](_0x3fbc8c['where'],{'$or':_[_0x3bee('0x30')](_0x11e07d,function(_0x1b5eca){if(_0x1b5eca[_0x3bee('0x3e')]!==_0x3bee('0x3f')){var _0x268c0e={};_0x268c0e[_0x1b5eca[_0x3bee('0x2a')]]={'$like':'%'+_0x559c2b[_0x3bee('0x31')][_0x3bee('0x3c')]+'%'};return _0x268c0e;}})});}_0x3fbc8c=_[_0x3bee('0x3d')]({},_0x3fbc8c,_0x559c2b[_0x3bee('0x40')]);var _0x2e3740={'where':_0x3fbc8c[_0x3bee('0x3a')]};return db[_0x3bee('0x41')]['count'](_0x2e3740)[_0x3bee('0x24')](function(_0x2f30d7){_0x10bae0[_0x3bee('0x1d')]=_0x2f30d7;if(_0x559c2b[_0x3bee('0x31')][_0x3bee('0x42')]){_0x3fbc8c[_0x3bee('0x43')]=[{'all':!![]}];}return db[_0x3bee('0x41')][_0x3bee('0x44')](_0x3fbc8c);})['then'](function(_0x10a59d){_0x10bae0[_0x3bee('0x45')]=_0x10a59d;return _0x10bae0;})[_0x3bee('0x24')](respondWithFilteredResult(_0x564e45,_0x3fbc8c))['catch'](handleError(_0x564e45,null));};exports[_0x3bee('0x46')]=function(_0x57113b,_0x2b1677){var _0x48325e={'raw':![],'where':{'id':_0x57113b[_0x3bee('0x47')]['id']}},_0x5717d3={};_0x5717d3[_0x3bee('0x2f')]=_[_0x3bee('0x32')](db[_0x3bee('0x41')][_0x3bee('0x2d')]);_0x5717d3['query']=_['keys'](_0x57113b[_0x3bee('0x31')]);_0x5717d3['filters']=_[_0x3bee('0x34')](_0x5717d3['model'],_0x5717d3[_0x3bee('0x31')]);_0x48325e['attributes']=_[_0x3bee('0x34')](_0x5717d3[_0x3bee('0x2f')],qs[_0x3bee('0x35')](_0x57113b[_0x3bee('0x31')]['fields']));_0x48325e['attributes']=_0x48325e[_0x3bee('0x36')]['length']?_0x48325e['attributes']:_0x5717d3['model'];if(_0x57113b[_0x3bee('0x31')]['includeAll']){_0x48325e[_0x3bee('0x43')]=[{'all':!![]}];}_0x48325e=_[_0x3bee('0x3d')]({},_0x48325e,_0x57113b[_0x3bee('0x40')]);return db['SquareProject'][_0x3bee('0x48')](_0x48325e)['then'](handleEntityNotFound(_0x2b1677,null))[_0x3bee('0x24')](respondWithResult(_0x2b1677,null))['catch'](handleError(_0x2b1677,null));};exports[_0x3bee('0x49')]=function(_0x16b096,_0x15a96a){return db['SquareProject'][_0x3bee('0x49')](_0x16b096[_0x3bee('0x4a')],{})[_0x3bee('0x24')](function(_0x504382){var _0x479d7f=_0x16b096[_0x3bee('0x4b')][_0x3bee('0x25')]({'plain':!![]});if(!_0x479d7f)throw new Error(_0x3bee('0x4c'));if(_0x479d7f[_0x3bee('0x4d')]===_0x3bee('0x4b')){var _0x21ab40=_0x504382[_0x3bee('0x25')]({'plain':!![]});var _0x521ceb=_0x3bee('0x4e');return db[_0x3bee('0x4f')]['find']({'where':{'name':_0x521ceb,'userProfileId':_0x479d7f['userProfileId']},'raw':!![]})[_0x3bee('0x24')](function(_0x5d4755){if(_0x5d4755&&_0x5d4755[_0x3bee('0x50')]===0x0){return db[_0x3bee('0x26')][_0x3bee('0x49')]({'name':_0x21ab40['name'],'resourceId':_0x21ab40['id'],'type':_0x5d4755[_0x3bee('0x2a')],'sectionId':_0x5d4755['id']},{})[_0x3bee('0x24')](function(){return _0x504382;});}else{return _0x504382;}})[_0x3bee('0x51')](function(_0x5f5272){logger[_0x3bee('0x29')](_0x3bee('0x52'),_0x5f5272);throw _0x5f5272;});}return _0x504382;})['then'](respondWithResult(_0x15a96a,0xc9))[_0x3bee('0x51')](handleError(_0x15a96a,null));};exports[_0x3bee('0x23')]=function(_0x53c881,_0x432920){if(_0x53c881[_0x3bee('0x4a')]['id']){delete _0x53c881[_0x3bee('0x4a')]['id'];}return db[_0x3bee('0x41')][_0x3bee('0x48')]({'where':{'id':_0x53c881[_0x3bee('0x47')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x432920,null))[_0x3bee('0x24')](saveUpdates(_0x53c881['body'],null))['then'](respondWithResult(_0x432920,null))[_0x3bee('0x51')](handleError(_0x432920,null));};exports['destroy']=function(_0x38b82a,_0x2d3f3f){return db[_0x3bee('0x41')]['find']({'where':{'id':_0x38b82a[_0x3bee('0x47')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x2d3f3f,null))[_0x3bee('0x24')](removeEntity(_0x2d3f3f,null))['catch'](handleError(_0x2d3f3f,null));};exports[_0x3bee('0x53')]=function(_0x52a327,_0x3cb900,_0x2304cd){return db[_0x3bee('0x41')]['find']({'where':{'id':_0x52a327[_0x3bee('0x47')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x3cb900,null))[_0x3bee('0x24')](function(_0x526551){if(_0x526551){return _0x526551['addUsers'](_0x52a327[_0x3bee('0x4a')][_0x3bee('0x54')],_[_0x3bee('0x55')](_0x52a327['body'],['ids','id'])||{});}})[_0x3bee('0x24')](respondWithResult(_0x3cb900,null))['catch'](handleError(_0x3cb900,null));};exports['removeUsers']=function(_0xbae40e,_0x2a8f08,_0x43d3bc){return db['SquareProject']['find']({'where':{'id':_0xbae40e[_0x3bee('0x47')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x2a8f08,null))['then'](function(_0x3bd805){if(_0x3bd805){return _0x3bd805['removeUsers'](_0xbae40e[_0x3bee('0x31')][_0x3bee('0x54')])[_0x3bee('0x24')](function(){if(_[_0x3bee('0x56')](_0xbae40e[_0x3bee('0x31')][_0x3bee('0x54')])){for(var _0x273bc5=0x0;_0x273bc5<_0xbae40e[_0x3bee('0x31')][_0x3bee('0x54')][_0x3bee('0x37')];_0x273bc5+=0x1){socket[_0x3bee('0x57')]('userSquareProject:remove',{'UserId':Number(_0xbae40e['query']['ids'][_0x273bc5]),'SquareProjectId':Number(_0xbae40e[_0x3bee('0x47')]['id'])});}}else{socket[_0x3bee('0x57')](_0x3bee('0x58'),{'UserId':Number(_0xbae40e[_0x3bee('0x31')]['ids']),'SquareProjectId':Number(_0xbae40e[_0x3bee('0x47')]['id'])});}});}})[_0x3bee('0x24')](respondWithStatusCode(_0x2a8f08,null))['catch'](handleError(_0x2a8f08,null));};exports['getUsers']=function(_0x3b223a,_0xf5a4e3,_0x20be01){var _0x5c3b2c={};var _0x44212e={};var _0x1f7b50;var _0x1d9ffa;return db['SquareProject'][_0x3bee('0x59')]({'where':{'id':_0x3b223a[_0x3bee('0x47')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0xf5a4e3,null))[_0x3bee('0x24')](function(_0x52df57){if(_0x52df57){_0x1f7b50=_0x52df57;_0x44212e['model']=_[_0x3bee('0x32')](db[_0x3bee('0x5a')][_0x3bee('0x2d')]);_0x44212e[_0x3bee('0x31')]=_[_0x3bee('0x32')](_0x3b223a['query']);_0x44212e[_0x3bee('0x33')]=_['intersection'](_0x44212e[_0x3bee('0x2f')],_0x44212e[_0x3bee('0x31')]);_0x5c3b2c[_0x3bee('0x36')]=_[_0x3bee('0x34')](_0x44212e[_0x3bee('0x2f')],qs[_0x3bee('0x35')](_0x3b223a[_0x3bee('0x31')]['fields']));_0x5c3b2c[_0x3bee('0x36')]=_0x5c3b2c[_0x3bee('0x36')][_0x3bee('0x37')]?_0x5c3b2c[_0x3bee('0x36')]:_0x44212e['model'];_0x5c3b2c[_0x3bee('0x5b')]=qs[_0x3bee('0x39')](_0x3b223a[_0x3bee('0x31')][_0x3bee('0x39')]);_0x5c3b2c[_0x3bee('0x3a')]=qs[_0x3bee('0x33')](_[_0x3bee('0x3b')](_0x3b223a[_0x3bee('0x31')],_0x44212e['filters']));if(_0x3b223a[_0x3bee('0x31')][_0x3bee('0x3c')]){_0x5c3b2c[_0x3bee('0x3a')]=_['merge'](_0x5c3b2c[_0x3bee('0x3a')],{'$or':_[_0x3bee('0x30')](_0x5c3b2c[_0x3bee('0x36')],function(_0x3890cd){var _0x19e26d={};_0x19e26d[_0x3890cd]={'$like':'%'+_0x3b223a[_0x3bee('0x31')][_0x3bee('0x3c')]+'%'};return _0x19e26d;})});}_0x5c3b2c=_[_0x3bee('0x3d')]({},_0x5c3b2c,_0x3b223a[_0x3bee('0x40')]);return _0x1f7b50[_0x3bee('0x5c')](_0x5c3b2c);}})[_0x3bee('0x24')](function(_0x387924){if(_0x387924){_0x1d9ffa=_0x387924[_0x3bee('0x37')];if(!_0x3b223a[_0x3bee('0x31')][_0x3bee('0x5d')](_0x3bee('0x38'))){_0x5c3b2c[_0x3bee('0x1f')]=qs[_0x3bee('0x1f')](_0x3b223a[_0x3bee('0x31')][_0x3bee('0x1f')]);_0x5c3b2c[_0x3bee('0x1e')]=qs[_0x3bee('0x1e')](_0x3b223a[_0x3bee('0x31')][_0x3bee('0x1e')]);}return _0x1f7b50[_0x3bee('0x5c')](_0x5c3b2c);}})['then'](function(_0x35f0fb){if(_0x35f0fb){return _0x35f0fb?{'count':_0x1d9ffa,'rows':_0x35f0fb}:null;}})[_0x3bee('0x24')](respondWithResult(_0xf5a4e3,null))[_0x3bee('0x51')](handleError(_0xf5a4e3,null));}; \ No newline at end of file +var _0xbf6e=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','length','include','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','SquareProjects','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','index','map','SquareProject','fieldName','model','query','keys'];(function(_0x1b00da,_0x4d5a10){var _0x1aa22f=function(_0x25a64f){while(--_0x25a64f){_0x1b00da['push'](_0x1b00da['shift']());}};_0x1aa22f(++_0x4d5a10);}(_0xbf6e,0x149));var _0xebf6=function(_0x4fe566,_0x93c45f){_0x4fe566=_0x4fe566-0x0;var _0x5e38e0=_0xbf6e[_0x4fe566];return _0x5e38e0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xebf6('0x0'));var zipdir=require(_0xebf6('0x1'));var jsonpatch=require(_0xebf6('0x2'));var rp=require(_0xebf6('0x3'));var moment=require(_0xebf6('0x4'));var BPromise=require(_0xebf6('0x5'));var Mustache=require(_0xebf6('0x6'));var util=require('util');var path=require(_0xebf6('0x7'));var sox=require(_0xebf6('0x8'));var csv=require(_0xebf6('0x9'));var ejs=require(_0xebf6('0xa'));var fs=require('fs');var _=require(_0xebf6('0xb'));var squel=require(_0xebf6('0xc'));var crypto=require(_0xebf6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xebf6('0xe'));var toCsv=require(_0xebf6('0x9'));var querystring=require(_0xebf6('0xf'));var Papa=require('papaparse');var Redis=require(_0xebf6('0x10'));var authService=require(_0xebf6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xebf6('0x12'));var hardwareService=require(_0xebf6('0x13'));var logger=require(_0xebf6('0x14'))(_0xebf6('0x15'));var utils=require(_0xebf6('0x16'));var config=require(_0xebf6('0x17'));var db=require('../../mysqldb')['db'];config[_0xebf6('0x18')]=_[_0xebf6('0x19')](config['redis'],{'host':_0xebf6('0x1a'),'port':0x18eb});var socket=require(_0xebf6('0x1b'))(new Redis(config[_0xebf6('0x18')]));require(_0xebf6('0x1c'))[_0xebf6('0x1d')](socket);function respondWithStatusCode(_0x4dbf51,_0x4c01f4){_0x4c01f4=_0x4c01f4||0xcc;return function(_0x56b8f8){if(_0x56b8f8){return _0x4dbf51[_0xebf6('0x1e')](_0x4c01f4);}return _0x4dbf51[_0xebf6('0x1f')](_0x4c01f4)['end']();};}function respondWithResult(_0x35570e,_0x2c980f){_0x2c980f=_0x2c980f||0xc8;return function(_0xb164a1){if(_0xb164a1){return _0x35570e[_0xebf6('0x1f')](_0x2c980f)[_0xebf6('0x20')](_0xb164a1);}};}function respondWithFilteredResult(_0x13f495,_0x219621){return function(_0x2dc96f){if(_0x2dc96f){var _0x2d3984=_0x2dc96f[_0xebf6('0x21')],_0x308480=_0x219621[_0xebf6('0x22')],_0x55fa31=_0x219621[_0xebf6('0x22')]+_0x219621[_0xebf6('0x23')],_0x496dea;if(_0x55fa31>=_0x2d3984){_0x55fa31=_0x2d3984;_0x496dea=0xc8;}else{_0x496dea=0xce;}_0x13f495[_0xebf6('0x1f')](_0x496dea);return _0x13f495[_0xebf6('0x24')](_0xebf6('0x25'),_0x308480+'-'+_0x55fa31+'/'+_0x2d3984)[_0xebf6('0x20')](_0x2dc96f);}return null;};}function patchUpdates(_0x4fb497){return function(_0xbe39dd){try{jsonpatch[_0xebf6('0x26')](_0xbe39dd,_0x4fb497,!![]);}catch(_0x377934){return BPromise[_0xebf6('0x27')](_0x377934);}return _0xbe39dd[_0xebf6('0x28')]();};}function saveUpdates(_0x14c8ac,_0x2f419e){return function(_0xfce30a){if(_0xfce30a){return _0xfce30a[_0xebf6('0x29')](_0x14c8ac)[_0xebf6('0x2a')](function(_0x232074){return _0x232074;});}return null;};}function removeEntity(_0x2dd2ed,_0x43c4e2){return function(_0x3b8bc1){if(_0x3b8bc1){return _0x3b8bc1[_0xebf6('0x2b')]()[_0xebf6('0x2a')](function(){var _0x3b2b64=_0x3b8bc1[_0xebf6('0x2c')]({'plain':!![]});var _0x3b58cb='SquareProjects';return db['UserProfileResource'][_0xebf6('0x2b')]({'where':{'type':_0x3b58cb,'resourceId':_0x3b2b64['id']}})['then'](function(){return _0x3b8bc1;});})[_0xebf6('0x2a')](function(){_0x2dd2ed[_0xebf6('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f39eb,_0x37950c){return function(_0x40ae57){if(!_0x40ae57){_0x4f39eb[_0xebf6('0x1e')](0x194);}return _0x40ae57;};}function handleError(_0x7959c8,_0xedaaeb){_0xedaaeb=_0xedaaeb||0x1f4;return function(_0x2dc0cf){logger[_0xebf6('0x2d')](_0x2dc0cf[_0xebf6('0x2e')]);if(_0x2dc0cf['name']){delete _0x2dc0cf[_0xebf6('0x2f')];}_0x7959c8[_0xebf6('0x1f')](_0xedaaeb)['send'](_0x2dc0cf);};}exports[_0xebf6('0x30')]=function(_0x28bbea,_0x5ea6b2){var _0x2901fc={},_0x1fa407={},_0x32afa3={'count':0x0,'rows':[]};var _0x221b6e=_[_0xebf6('0x31')](db[_0xebf6('0x32')]['rawAttributes'],function(_0x3818c9){return{'name':_0x3818c9[_0xebf6('0x33')],'type':_0x3818c9['type']['key']};});_0x1fa407[_0xebf6('0x34')]=_[_0xebf6('0x31')](_0x221b6e,'name');_0x1fa407[_0xebf6('0x35')]=_[_0xebf6('0x36')](_0x28bbea['query']);_0x1fa407[_0xebf6('0x37')]=_[_0xebf6('0x38')](_0x1fa407[_0xebf6('0x34')],_0x1fa407['query']);_0x2901fc[_0xebf6('0x39')]=_[_0xebf6('0x38')](_0x1fa407[_0xebf6('0x34')],qs[_0xebf6('0x3a')](_0x28bbea['query']['fields']));_0x2901fc[_0xebf6('0x39')]=_0x2901fc[_0xebf6('0x39')]['length']?_0x2901fc[_0xebf6('0x39')]:_0x1fa407[_0xebf6('0x34')];if(!_0x28bbea['query'][_0xebf6('0x3b')](_0xebf6('0x3c'))){_0x2901fc[_0xebf6('0x23')]=qs[_0xebf6('0x23')](_0x28bbea[_0xebf6('0x35')]['limit']);_0x2901fc[_0xebf6('0x22')]=qs['offset'](_0x28bbea[_0xebf6('0x35')]['offset']);}_0x2901fc[_0xebf6('0x3d')]=qs[_0xebf6('0x3e')](_0x28bbea[_0xebf6('0x35')][_0xebf6('0x3e')]);_0x2901fc[_0xebf6('0x3f')]=qs[_0xebf6('0x37')](_['pick'](_0x28bbea[_0xebf6('0x35')],_0x1fa407[_0xebf6('0x37')]));if(_0x28bbea[_0xebf6('0x35')][_0xebf6('0x40')]){_0x2901fc[_0xebf6('0x3f')]=_[_0xebf6('0x41')](_0x2901fc['where'],{'$or':_[_0xebf6('0x31')](_0x221b6e,function(_0x2782a5){if(_0x2782a5[_0xebf6('0x42')]!==_0xebf6('0x43')){var _0x1457e9={};_0x1457e9[_0x2782a5[_0xebf6('0x2f')]]={'$like':'%'+_0x28bbea['query']['filter']+'%'};return _0x1457e9;}})});}_0x2901fc=_['merge']({},_0x2901fc,_0x28bbea[_0xebf6('0x44')]);var _0x3056ee={'where':_0x2901fc[_0xebf6('0x3f')]};return db['SquareProject'][_0xebf6('0x21')](_0x3056ee)[_0xebf6('0x2a')](function(_0x36c270){_0x32afa3['count']=_0x36c270;if(_0x28bbea[_0xebf6('0x35')][_0xebf6('0x45')]){_0x2901fc['include']=[{'all':!![]}];}return db[_0xebf6('0x32')][_0xebf6('0x46')](_0x2901fc);})[_0xebf6('0x2a')](function(_0x4c93da){_0x32afa3[_0xebf6('0x47')]=_0x4c93da;return _0x32afa3;})['then'](respondWithFilteredResult(_0x5ea6b2,_0x2901fc))['catch'](handleError(_0x5ea6b2,null));};exports[_0xebf6('0x48')]=function(_0x470f62,_0x10ca29){var _0x2ac140={'raw':![],'where':{'id':_0x470f62[_0xebf6('0x49')]['id']}},_0x4fd568={};_0x4fd568['model']=_[_0xebf6('0x36')](db[_0xebf6('0x32')][_0xebf6('0x4a')]);_0x4fd568[_0xebf6('0x35')]=_[_0xebf6('0x36')](_0x470f62['query']);_0x4fd568['filters']=_[_0xebf6('0x38')](_0x4fd568[_0xebf6('0x34')],_0x4fd568[_0xebf6('0x35')]);_0x2ac140[_0xebf6('0x39')]=_['intersection'](_0x4fd568[_0xebf6('0x34')],qs[_0xebf6('0x3a')](_0x470f62[_0xebf6('0x35')][_0xebf6('0x3a')]));_0x2ac140[_0xebf6('0x39')]=_0x2ac140[_0xebf6('0x39')][_0xebf6('0x4b')]?_0x2ac140['attributes']:_0x4fd568[_0xebf6('0x34')];if(_0x470f62[_0xebf6('0x35')][_0xebf6('0x45')]){_0x2ac140[_0xebf6('0x4c')]=[{'all':!![]}];}_0x2ac140=_[_0xebf6('0x41')]({},_0x2ac140,_0x470f62[_0xebf6('0x44')]);return db[_0xebf6('0x32')]['find'](_0x2ac140)[_0xebf6('0x2a')](handleEntityNotFound(_0x10ca29,null))['then'](respondWithResult(_0x10ca29,null))[_0xebf6('0x4d')](handleError(_0x10ca29,null));};exports[_0xebf6('0x4e')]=function(_0x5d84ac,_0xd14e0a){return db['SquareProject'][_0xebf6('0x4e')](_0x5d84ac[_0xebf6('0x4f')],{})[_0xebf6('0x2a')](function(_0x32c8b1){var _0x82f1aa=_0x5d84ac['user'][_0xebf6('0x2c')]({'plain':!![]});if(!_0x82f1aa)throw new Error(_0xebf6('0x50'));if(_0x82f1aa['role']===_0xebf6('0x51')){var _0x2765f2=_0x32c8b1[_0xebf6('0x2c')]({'plain':!![]});var _0x34b203=_0xebf6('0x52');return db['UserProfileSection'][_0xebf6('0x53')]({'where':{'name':_0x34b203,'userProfileId':_0x82f1aa[_0xebf6('0x54')]},'raw':!![]})[_0xebf6('0x2a')](function(_0x4dd74b){if(_0x4dd74b&&_0x4dd74b['autoAssociation']===0x0){return db[_0xebf6('0x55')][_0xebf6('0x4e')]({'name':_0x2765f2[_0xebf6('0x2f')],'resourceId':_0x2765f2['id'],'type':_0x4dd74b[_0xebf6('0x2f')],'sectionId':_0x4dd74b['id']},{})[_0xebf6('0x2a')](function(){return _0x32c8b1;});}else{return _0x32c8b1;}})[_0xebf6('0x4d')](function(_0x1f9159){logger[_0xebf6('0x2d')](_0xebf6('0x56'),_0x1f9159);throw _0x1f9159;});}return _0x32c8b1;})['then'](respondWithResult(_0xd14e0a,0xc9))[_0xebf6('0x4d')](handleError(_0xd14e0a,null));};exports[_0xebf6('0x29')]=function(_0x24ed4e,_0x5c4061){if(_0x24ed4e[_0xebf6('0x4f')]['id']){delete _0x24ed4e['body']['id'];}return db['SquareProject'][_0xebf6('0x53')]({'where':{'id':_0x24ed4e[_0xebf6('0x49')]['id']}})[_0xebf6('0x2a')](handleEntityNotFound(_0x5c4061,null))[_0xebf6('0x2a')](saveUpdates(_0x24ed4e[_0xebf6('0x4f')],null))['then'](respondWithResult(_0x5c4061,null))[_0xebf6('0x4d')](handleError(_0x5c4061,null));};exports['destroy']=function(_0x4ed306,_0x4ef686){return db[_0xebf6('0x32')][_0xebf6('0x53')]({'where':{'id':_0x4ed306['params']['id']}})[_0xebf6('0x2a')](handleEntityNotFound(_0x4ef686,null))[_0xebf6('0x2a')](removeEntity(_0x4ef686,null))[_0xebf6('0x4d')](handleError(_0x4ef686,null));};exports[_0xebf6('0x57')]=function(_0x3a4b20,_0x8c16a8,_0x246f9f){return db['SquareProject'][_0xebf6('0x53')]({'where':{'id':_0x3a4b20[_0xebf6('0x49')]['id']}})[_0xebf6('0x2a')](handleEntityNotFound(_0x8c16a8,null))[_0xebf6('0x2a')](function(_0x39637b){if(_0x39637b){return _0x39637b[_0xebf6('0x57')](_0x3a4b20['body'][_0xebf6('0x58')],_[_0xebf6('0x59')](_0x3a4b20[_0xebf6('0x4f')],[_0xebf6('0x58'),'id'])||{});}})[_0xebf6('0x2a')](respondWithResult(_0x8c16a8,null))[_0xebf6('0x4d')](handleError(_0x8c16a8,null));};exports['removeUsers']=function(_0x33c973,_0x193e5b,_0x1ea55c){return db[_0xebf6('0x32')][_0xebf6('0x53')]({'where':{'id':_0x33c973['params']['id']}})[_0xebf6('0x2a')](handleEntityNotFound(_0x193e5b,null))[_0xebf6('0x2a')](function(_0x416b2a){if(_0x416b2a){return _0x416b2a[_0xebf6('0x5a')](_0x33c973[_0xebf6('0x35')][_0xebf6('0x58')])[_0xebf6('0x2a')](function(){if(_[_0xebf6('0x5b')](_0x33c973[_0xebf6('0x35')][_0xebf6('0x58')])){for(var _0x247439=0x0;_0x247439<_0x33c973['query'][_0xebf6('0x58')][_0xebf6('0x4b')];_0x247439+=0x1){socket[_0xebf6('0x5c')](_0xebf6('0x5d'),{'UserId':Number(_0x33c973[_0xebf6('0x35')][_0xebf6('0x58')][_0x247439]),'SquareProjectId':Number(_0x33c973['params']['id'])});}}else{socket[_0xebf6('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x33c973[_0xebf6('0x35')][_0xebf6('0x58')]),'SquareProjectId':Number(_0x33c973[_0xebf6('0x49')]['id'])});}});}})[_0xebf6('0x2a')](respondWithStatusCode(_0x193e5b,null))[_0xebf6('0x4d')](handleError(_0x193e5b,null));};exports[_0xebf6('0x5e')]=function(_0x398074,_0x5e6951,_0x4ddbbd){var _0x14ff2d={};var _0x104842={};var _0x4b2b6d;var _0x3dc02c;return db[_0xebf6('0x32')]['findOne']({'where':{'id':_0x398074[_0xebf6('0x49')]['id']}})[_0xebf6('0x2a')](handleEntityNotFound(_0x5e6951,null))['then'](function(_0x35a5c4){if(_0x35a5c4){_0x4b2b6d=_0x35a5c4;_0x104842[_0xebf6('0x34')]=_[_0xebf6('0x36')](db[_0xebf6('0x5f')][_0xebf6('0x4a')]);_0x104842[_0xebf6('0x35')]=_[_0xebf6('0x36')](_0x398074['query']);_0x104842[_0xebf6('0x37')]=_[_0xebf6('0x38')](_0x104842[_0xebf6('0x34')],_0x104842[_0xebf6('0x35')]);_0x14ff2d[_0xebf6('0x39')]=_[_0xebf6('0x38')](_0x104842[_0xebf6('0x34')],qs[_0xebf6('0x3a')](_0x398074[_0xebf6('0x35')][_0xebf6('0x3a')]));_0x14ff2d['attributes']=_0x14ff2d['attributes'][_0xebf6('0x4b')]?_0x14ff2d[_0xebf6('0x39')]:_0x104842[_0xebf6('0x34')];_0x14ff2d[_0xebf6('0x3d')]=qs['sort'](_0x398074[_0xebf6('0x35')][_0xebf6('0x3e')]);_0x14ff2d[_0xebf6('0x3f')]=qs[_0xebf6('0x37')](_['pick'](_0x398074['query'],_0x104842['filters']));if(_0x398074[_0xebf6('0x35')][_0xebf6('0x40')]){_0x14ff2d[_0xebf6('0x3f')]=_[_0xebf6('0x41')](_0x14ff2d[_0xebf6('0x3f')],{'$or':_[_0xebf6('0x31')](_0x14ff2d[_0xebf6('0x39')],function(_0x3fc31a){var _0x5844ea={};_0x5844ea[_0x3fc31a]={'$like':'%'+_0x398074[_0xebf6('0x35')][_0xebf6('0x40')]+'%'};return _0x5844ea;})});}_0x14ff2d=_['merge']({},_0x14ff2d,_0x398074['options']);return _0x4b2b6d[_0xebf6('0x5e')](_0x14ff2d);}})['then'](function(_0x89be0){if(_0x89be0){_0x3dc02c=_0x89be0[_0xebf6('0x4b')];if(!_0x398074[_0xebf6('0x35')]['hasOwnProperty'](_0xebf6('0x3c'))){_0x14ff2d[_0xebf6('0x23')]=qs[_0xebf6('0x23')](_0x398074[_0xebf6('0x35')][_0xebf6('0x23')]);_0x14ff2d[_0xebf6('0x22')]=qs['offset'](_0x398074[_0xebf6('0x35')][_0xebf6('0x22')]);}return _0x4b2b6d['getUsers'](_0x14ff2d);}})[_0xebf6('0x2a')](function(_0x1f3606){if(_0x1f3606){return _0x1f3606?{'count':_0x3dc02c,'rows':_0x1f3606}:null;}})[_0xebf6('0x2a')](respondWithResult(_0x5e6951,null))['catch'](handleError(_0x5e6951,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 15530c0..acbeddf 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 _0x0e4f=['save','emit','hasOwnProperty','hook','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x54e615,_0x456e4c){var _0x15b5da=function(_0x3fdba1){while(--_0x3fdba1){_0x54e615['push'](_0x54e615['shift']());}};_0x15b5da(++_0x456e4c);}(_0x0e4f,0x1f4));var _0xf0e4=function(_0x107faf,_0x2ae43e){_0x107faf=_0x107faf-0x0;var _0x2130f5=_0x0e4f[_0x107faf];return _0x2130f5;};'use strict';var EventEmitter=require(_0xf0e4('0x0'));var SquareProject=require(_0xf0e4('0x1'))['db'][_0xf0e4('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf0e4('0x3')](0x0);var events={'afterCreate':_0xf0e4('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x34a3a2){return function(_0x18a22d,_0x5e3880,_0xb92394){SquareProjectEvents[_0xf0e4('0x5')](_0x34a3a2+':'+_0x18a22d['id'],_0x18a22d);SquareProjectEvents[_0xf0e4('0x5')](_0x34a3a2,_0x18a22d);_0xb92394(null);};}for(var e in events){if(events[_0xf0e4('0x6')](e)){var event=events[e];SquareProject[_0xf0e4('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xf2cb=['update','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x2d6370,_0x408154){var _0x428c2e=function(_0x28f42a){while(--_0x28f42a){_0x2d6370['push'](_0x2d6370['shift']());}};_0x428c2e(++_0x408154);}(_0xf2cb,0x130));var _0xbf2c=function(_0x37c7c4,_0x22887a){_0x37c7c4=_0x37c7c4-0x0;var _0x22ac1d=_0xf2cb[_0x37c7c4];return _0x22ac1d;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xbf2c('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xbf2c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf2c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1ecb79){return function(_0x41c649,_0x5abeb3,_0x52cc1a){SquareProjectEvents[_0xbf2c('0x3')](_0x1ecb79+':'+_0x41c649['id'],_0x41c649);SquareProjectEvents[_0xbf2c('0x3')](_0x1ecb79,_0x41c649);_0x52cc1a(null);};}for(var e in events){if(events[_0xbf2c('0x4')](e)){var event=events[e];SquareProject[_0xbf2c('0x5')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 0221787..d5c42a5 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 _0xede3=['SquareProject','square_projects','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3b1aec,_0x4a66ff){var _0x574c45=function(_0x4c5495){while(--_0x4c5495){_0x3b1aec['push'](_0x3b1aec['shift']());}};_0x574c45(++_0x4a66ff);}(_0xede3,0x1d6));var _0x3ede=function(_0x23a467,_0x29fa65){_0x23a467=_0x23a467-0x0;var _0x452012=_0xede3[_0x23a467];return _0x452012;};'use strict';var _=require('lodash');var util=require(_0x3ede('0x0'));var logger=require('../../config/logger')(_0x3ede('0x1'));var moment=require(_0x3ede('0x2'));var BPromise=require(_0x3ede('0x3'));var rp=require(_0x3ede('0x4'));var fs=require('fs');var path=require(_0x3ede('0x5'));var rimraf=require(_0x3ede('0x6'));var config=require(_0x3ede('0x7'));var attributes=require('./squareProject.attributes');module[_0x3ede('0x8')]=function(_0x1ff1f2,_0x2429a1){return _0x1ff1f2[_0x3ede('0x9')](_0x3ede('0xa'),attributes,{'tableName':_0x3ede('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48f3=['bluebird','path','rimraf','./squareProject.attributes','exports','define','SquareProject','lodash','util','../../config/logger','api','moment'];(function(_0x3aae01,_0x3911e){var _0x964cd8=function(_0x52f8ae){while(--_0x52f8ae){_0x3aae01['push'](_0x3aae01['shift']());}};_0x964cd8(++_0x3911e);}(_0x48f3,0x193));var _0x348f=function(_0xba4839,_0x575d37){_0xba4839=_0xba4839-0x0;var _0x1969c8=_0x48f3[_0xba4839];return _0x1969c8;};'use strict';var _=require(_0x348f('0x0'));var util=require(_0x348f('0x1'));var logger=require(_0x348f('0x2'))(_0x348f('0x3'));var moment=require(_0x348f('0x4'));var BPromise=require(_0x348f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x348f('0x6'));var rimraf=require(_0x348f('0x7'));var config=require('../../config/environment');var attributes=require(_0x348f('0x8'));module[_0x348f('0x9')]=function(_0x3c04c8,_0x332bf9){return _0x3c04c8[_0x348f('0xa')](_0x348f('0xb'),attributes,{'tableName':'square_projects','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 20ce775..ea19eb0 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 _0x96c4=['map','model','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','then','info','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','SquareProject,\x20%s,\x20%s','result','catch','ShowSquareProject','find','options','where','attributes','include'];(function(_0x377844,_0x563004){var _0x3688f=function(_0x5908d2){while(--_0x5908d2){_0x377844['push'](_0x377844['shift']());}};_0x3688f(++_0x563004);}(_0x96c4,0x1f3));var _0x496c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x96c4[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x496c('0x0'));var util=require(_0x496c('0x1'));var moment=require(_0x496c('0x2'));var BPromise=require('bluebird');var rs=require(_0x496c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x496c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x496c('0x5'))(_0x496c('0x6'));var config=require(_0x496c('0x7'));var jayson=require(_0x496c('0x8'));var client=jayson['client'][_0x496c('0x9')]({'port':0x232a});config[_0x496c('0xa')]=_['defaults'](config[_0x496c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x496c('0xb'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0x1fc0be,_0x544c86,_0x39d1ca){return new BPromise(function(_0x2b1ac0,_0x10c97f){return client['request'](_0x1fc0be,_0x39d1ca)[_0x496c('0xc')](function(_0x114fbf){logger[_0x496c('0xd')]('SquareProject,\x20%s,\x20%s',_0x544c86,_0x496c('0xe'));logger['debug'](_0x496c('0xf'),_0x544c86,_0x496c('0xe'),JSON['stringify'](_0x114fbf));if(_0x114fbf['error']){if(_0x114fbf[_0x496c('0x10')][_0x496c('0x11')]===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x544c86,_0x114fbf[_0x496c('0x10')]['message']);return _0x10c97f(_0x114fbf[_0x496c('0x10')][_0x496c('0x12')]);}logger['error'](_0x496c('0x13'),_0x544c86,_0x114fbf[_0x496c('0x10')][_0x496c('0x12')]);return _0x2b1ac0(_0x114fbf['error']['message']);}else{logger['info'](_0x496c('0x13'),_0x544c86,_0x496c('0xe'));_0x2b1ac0(_0x114fbf[_0x496c('0x14')][_0x496c('0x12')]);}})[_0x496c('0x15')](function(_0x127403){logger[_0x496c('0x10')](_0x496c('0x13'),_0x544c86,_0x127403);_0x10c97f(_0x127403);});});}exports[_0x496c('0x16')]=function(_0x5f40c3){var _0x2f1fb3=this;return new Promise(function(_0xc12dc1,_0x3d31a2){return db['SquareProject'][_0x496c('0x17')]({'raw':_0x5f40c3[_0x496c('0x18')]?_0x5f40c3[_0x496c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5f40c3[_0x496c('0x18')]?_0x5f40c3['options'][_0x496c('0x19')]||null:null,'attributes':_0x5f40c3['options']?_0x5f40c3['options'][_0x496c('0x1a')]||null:null,'include':_0x5f40c3[_0x496c('0x18')]?_0x5f40c3[_0x496c('0x18')][_0x496c('0x1b')]?_[_0x496c('0x1c')](_0x5f40c3['options']['include'],function(_0x4a974c){return{'model':db[_0x4a974c[_0x496c('0x1d')]],'as':_0x4a974c['as'],'attributes':_0x4a974c['attributes'],'include':_0x4a974c[_0x496c('0x1b')]?_[_0x496c('0x1c')](_0x4a974c['include'],function(_0x5b5702){return{'model':db[_0x5b5702[_0x496c('0x1d')]],'as':_0x5b5702['as'],'attributes':_0x5b5702[_0x496c('0x1a')],'include':_0x5b5702['include']?_[_0x496c('0x1c')](_0x5b5702[_0x496c('0x1b')],function(_0x39d8f3){return{'model':db[_0x39d8f3[_0x496c('0x1d')]],'as':_0x39d8f3['as'],'attributes':_0x39d8f3[_0x496c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x496c('0xc')](function(_0x2fa34c){logger[_0x496c('0xd')](_0x496c('0x16'),_0x5f40c3);logger[_0x496c('0x1e')]('ShowSquareProject',_0x5f40c3,JSON['stringify'](_0x2fa34c));_0xc12dc1(_0x2fa34c);})[_0x496c('0x15')](function(_0x2bd532){logger['error'](_0x496c('0x16'),_0x2bd532[_0x496c('0x12')],_0x5f40c3);_0x3d31a2(_0x2f1fb3['error'](0x1f4,_0x2bd532['message']));});});}; \ No newline at end of file +var _0x9dbf=['../../config/environment','jayson/promise','client','redis','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','find','options','raw','include','map','model','attributes','ShowSquareProject','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3898c2,_0x58ba6d){var _0x10bf68=function(_0x2a98cf){while(--_0x2a98cf){_0x3898c2['push'](_0x3898c2['shift']());}};_0x10bf68(++_0x58ba6d);}(_0x9dbf,0x110));var _0xf9db=function(_0x519f80,_0x12782d){_0x519f80=_0x519f80-0x0;var _0x12db92=_0x9dbf[_0x519f80];return _0x12db92;};'use strict';var _=require(_0xf9db('0x0'));var util=require('util');var moment=require(_0xf9db('0x1'));var BPromise=require(_0xf9db('0x2'));var rs=require(_0xf9db('0x3'));var fs=require('fs');var Redis=require(_0xf9db('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf9db('0x5'));var logger=require(_0xf9db('0x6'))(_0xf9db('0x7'));var config=require(_0xf9db('0x8'));var jayson=require(_0xf9db('0x9'));var client=jayson[_0xf9db('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xf9db('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf9db('0xb')]));require(_0xf9db('0xc'))[_0xf9db('0xd')](socket);function respondWithRpcPromise(_0x30512b,_0x7e080b,_0x55c22f){return new BPromise(function(_0x22b411,_0x468f44){return client[_0xf9db('0xe')](_0x30512b,_0x55c22f)[_0xf9db('0xf')](function(_0x11aee4){logger[_0xf9db('0x10')](_0xf9db('0x11'),_0x7e080b,_0xf9db('0x12'));logger[_0xf9db('0x13')](_0xf9db('0x14'),_0x7e080b,_0xf9db('0x12'),JSON[_0xf9db('0x15')](_0x11aee4));if(_0x11aee4['error']){if(_0x11aee4[_0xf9db('0x16')][_0xf9db('0x17')]===0x1f4){logger[_0xf9db('0x16')]('SquareProject,\x20%s,\x20%s',_0x7e080b,_0x11aee4[_0xf9db('0x16')]['message']);return _0x468f44(_0x11aee4[_0xf9db('0x16')][_0xf9db('0x18')]);}logger[_0xf9db('0x16')](_0xf9db('0x11'),_0x7e080b,_0x11aee4[_0xf9db('0x16')][_0xf9db('0x18')]);return _0x22b411(_0x11aee4[_0xf9db('0x16')]['message']);}else{logger['info'](_0xf9db('0x11'),_0x7e080b,_0xf9db('0x12'));_0x22b411(_0x11aee4[_0xf9db('0x19')][_0xf9db('0x18')]);}})['catch'](function(_0x1503c4){logger['error'](_0xf9db('0x11'),_0x7e080b,_0x1503c4);_0x468f44(_0x1503c4);});});}exports['ShowSquareProject']=function(_0x27031e){var _0x186e34=this;return new Promise(function(_0x238119,_0x298831){return db['SquareProject'][_0xf9db('0x1a')]({'raw':_0x27031e[_0xf9db('0x1b')]?_0x27031e['options'][_0xf9db('0x1c')]===undefined?!![]:![]:!![],'where':_0x27031e['options']?_0x27031e[_0xf9db('0x1b')]['where']||null:null,'attributes':_0x27031e['options']?_0x27031e[_0xf9db('0x1b')]['attributes']||null:null,'include':_0x27031e[_0xf9db('0x1b')]?_0x27031e[_0xf9db('0x1b')][_0xf9db('0x1d')]?_[_0xf9db('0x1e')](_0x27031e['options']['include'],function(_0x35d4e7){return{'model':db[_0x35d4e7[_0xf9db('0x1f')]],'as':_0x35d4e7['as'],'attributes':_0x35d4e7['attributes'],'include':_0x35d4e7[_0xf9db('0x1d')]?_[_0xf9db('0x1e')](_0x35d4e7[_0xf9db('0x1d')],function(_0x5606a5){return{'model':db[_0x5606a5[_0xf9db('0x1f')]],'as':_0x5606a5['as'],'attributes':_0x5606a5['attributes'],'include':_0x5606a5[_0xf9db('0x1d')]?_[_0xf9db('0x1e')](_0x5606a5['include'],function(_0xa91ff2){return{'model':db[_0xa91ff2[_0xf9db('0x1f')]],'as':_0xa91ff2['as'],'attributes':_0xa91ff2[_0xf9db('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf9db('0xf')](function(_0x11f5ef){logger[_0xf9db('0x10')](_0xf9db('0x21'),_0x27031e);logger[_0xf9db('0x13')](_0xf9db('0x21'),_0x27031e,JSON[_0xf9db('0x15')](_0x11f5ef));_0x238119(_0x11f5ef);})[_0xf9db('0x22')](function(_0x5d07fc){logger['error'](_0xf9db('0x21'),_0x5d07fc[_0xf9db('0x18')],_0x27031e);_0x298831(_0x186e34[_0xf9db('0x16')](0x1f4,_0x5d07fc['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 6c84505..0a61f7e 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 _0x7096=['emit','removeListener','register','length','save','update'];(function(_0x7f7e4d,_0x5b6e6f){var _0x335973=function(_0x216038){while(--_0x216038){_0x7f7e4d['push'](_0x7f7e4d['shift']());}};_0x335973(++_0x5b6e6f);}(_0x7096,0x10c));var _0x6709=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7096[_0x2b10c6];return _0x3789d2;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x6709('0x0'),'remove',_0x6709('0x1')];function createListener(_0x5c668a,_0x233cbf){return function(_0x9544e0){_0x233cbf[_0x6709('0x2')](_0x5c668a,_0x9544e0);};}function removeListener(_0xccdcb5,_0x3cd087){return function(){SquareProjectEvents[_0x6709('0x3')](_0xccdcb5,_0x3cd087);};}exports[_0x6709('0x4')]=function(_0x9d630f){for(var _0xa35832=0x0,_0x3e2223=events[_0x6709('0x5')];_0xa35832<_0x3e2223;_0xa35832++){var _0x985814=events[_0xa35832];var _0x30147f=createListener('squareProject:'+_0x985814,_0x9d630f);SquareProjectEvents['on'](_0x985814,_0x30147f);}}; \ No newline at end of file +var _0x71ab=['length','squareProject:','save','update','emit','removeListener','register'];(function(_0x26c568,_0x355fba){var _0x2fb394=function(_0x585446){while(--_0x585446){_0x26c568['push'](_0x26c568['shift']());}};_0x2fb394(++_0x355fba);}(_0x71ab,0x64));var _0xb71a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x71ab[_0x21a9d9];return _0x46adce;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xb71a('0x0'),'remove',_0xb71a('0x1')];function createListener(_0x5bdf89,_0x3e985a){return function(_0x3f0529){_0x3e985a[_0xb71a('0x2')](_0x5bdf89,_0x3f0529);};}function removeListener(_0x4094b2,_0x37ce74){return function(){SquareProjectEvents[_0xb71a('0x3')](_0x4094b2,_0x37ce74);};}exports[_0xb71a('0x4')]=function(_0x38d931){for(var _0x22c072=0x0,_0x35a84e=events[_0xb71a('0x5')];_0x22c072<_0x35a84e;_0x22c072++){var _0x2a4c86=events[_0x22c072];var _0x43ca14=createListener(_0xb71a('0x6')+_0x2a4c86,_0x38d931);SquareProjectEvents['on'](_0x2a4c86,_0x43ca14);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 6e011dc..dde67a8 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 _0xed1d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','isAuthenticated','index','get','show','download','post','create','put','update','delete','/:id/delete','destroy','exports','path','connect-timeout','Router'];(function(_0x3497e7,_0x5494ad){var _0x24445a=function(_0x4a2402){while(--_0x4a2402){_0x3497e7['push'](_0x3497e7['shift']());}};_0x24445a(++_0x5494ad);}(_0xed1d,0x165));var _0xded1=function(_0xcf67bf,_0x17ed67){_0xcf67bf=_0xcf67bf-0x0;var _0x44ad3b=_0xed1d[_0xcf67bf];return _0x44ad3b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xded1('0x0'));var timeout=require(_0xded1('0x1'));var express=require('express');var router=express[_0xded1('0x2')]();var auth=require(_0xded1('0x3'));var interaction=require(_0xded1('0x4'));var config=require(_0xded1('0x5'));var controller=require(_0xded1('0x6'));router['get']('/',auth[_0xded1('0x7')](),controller[_0xded1('0x8')]);router[_0xded1('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xded1('0xa')]);router[_0xded1('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xded1('0xb')]);router[_0xded1('0xc')]('/',auth['isAuthenticated'](),controller[_0xded1('0xd')]);router[_0xded1('0xe')]('/:id',auth[_0xded1('0x7')](),controller[_0xded1('0xf')]);router[_0xded1('0x10')](_0xded1('0x11'),auth[_0xded1('0x7')](),controller[_0xded1('0x12')]);module[_0xded1('0x13')]=router; \ No newline at end of file +var _0x5985=['update','delete','/:id/delete','destroy','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','create'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x5985,0x10f));var _0x5598=function(_0x434286,_0x3cec33){_0x434286=_0x434286-0x0;var _0x1e06d7=_0x5985[_0x434286];return _0x1e06d7;};'use strict';var multer=require(_0x5598('0x0'));var util=require(_0x5598('0x1'));var path=require('path');var timeout=require(_0x5598('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5598('0x3'));var config=require(_0x5598('0x4'));var controller=require(_0x5598('0x5'));router[_0x5598('0x6')]('/',auth[_0x5598('0x7')](),controller[_0x5598('0x8')]);router['get'](_0x5598('0x9'),auth[_0x5598('0x7')](),controller[_0x5598('0xa')]);router[_0x5598('0x6')](_0x5598('0xb'),auth[_0x5598('0x7')](),controller['download']);router[_0x5598('0xc')]('/',auth['isAuthenticated'](),controller[_0x5598('0xd')]);router['put']('/:id',auth[_0x5598('0x7')](),controller[_0x5598('0xe')]);router[_0x5598('0xf')](_0x5598('0x10'),auth[_0x5598('0x7')](),controller[_0x5598('0x11')]);module[_0x5598('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 9aa29cb..1dea45b 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 _0x2f92=['exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize'];(function(_0x196257,_0x256195){var _0x30d5c7=function(_0x100531){while(--_0x100531){_0x196257['push'](_0x196257['shift']());}};_0x30d5c7(++_0x256195);}(_0x2f92,0x1d7));var _0x22f9=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x2f92[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0x22f9('0x0'));module[_0x22f9('0x1')]={'uniqueid':{'type':Sequelize[_0x22f9('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x22f9('0x2')]},'extension':{'type':Sequelize[_0x22f9('0x2')]},'priority':{'type':Sequelize[_0x22f9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x22f9('0x2')]},'projectName':{'type':Sequelize[_0x22f9('0x2')]},'saveName':{'type':Sequelize[_0x22f9('0x2')]},'filename':{'type':Sequelize[_0x22f9('0x2')]},'savePath':{'type':Sequelize[_0x22f9('0x2')]},'format':{'type':Sequelize[_0x22f9('0x3')],'get':function(){var _0x589ef0='';var _0x2adf25=this[_0x22f9('0x4')](_0x22f9('0x5'));if(_0x2adf25){_0x589ef0=_0x2adf25[_0x22f9('0x6')](_0x2adf25[_0x22f9('0x7')]('.'));}return _0x589ef0;}}}; \ No newline at end of file +var _0x3456=['exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize'];(function(_0x3b6652,_0x32486d){var _0x14d39f=function(_0x3a595a){while(--_0x3a595a){_0x3b6652['push'](_0x3b6652['shift']());}};_0x14d39f(++_0x32486d);}(_0x3456,0x67));var _0x6345=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x3456[_0xf2628e];return _0x13863a;};'use strict';var Sequelize=require(_0x6345('0x0'));module[_0x6345('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6345('0x2')]},'context':{'type':Sequelize[_0x6345('0x2')]},'extension':{'type':Sequelize[_0x6345('0x2')]},'priority':{'type':Sequelize[_0x6345('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x6345('0x2')]},'saveName':{'type':Sequelize[_0x6345('0x2')]},'filename':{'type':Sequelize[_0x6345('0x2')]},'savePath':{'type':Sequelize[_0x6345('0x2')]},'format':{'type':Sequelize[_0x6345('0x3')],'get':function(){var _0x44a690='';var _0x1c2a9b=this[_0x6345('0x4')](_0x6345('0x5'));if(_0x1c2a9b){_0x44a690=_0x1c2a9b[_0x6345('0x6')](_0x1c2a9b[_0x6345('0x7')]('.'));}return _0x44a690;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index fc28fca..c27231a 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 _0x6578=['download','filename','unlink','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','SquareRecording','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','update','../../components/encryptor','uniqueid','savePath','format','%s.cypher','decryptFile','recording','existsSync','ValidationError','SquareRecording\x20not\x20found'];(function(_0x379799,_0x4ccf16){var _0x46e431=function(_0x34bd4d){while(--_0x34bd4d){_0x379799['push'](_0x379799['shift']());}};_0x46e431(++_0x4ccf16);}(_0x6578,0x66));var _0x8657=function(_0x10a552,_0x46fa86){_0x10a552=_0x10a552-0x0;var _0x378492=_0x6578[_0x10a552];return _0x378492;};'use strict';var pdf=require(_0x8657('0x0'));var emlformat=require(_0x8657('0x1'));var rimraf=require(_0x8657('0x2'));var zipdir=require(_0x8657('0x3'));var jsonpatch=require(_0x8657('0x4'));var rp=require(_0x8657('0x5'));var moment=require('moment');var BPromise=require(_0x8657('0x6'));var Mustache=require(_0x8657('0x7'));var util=require('util');var path=require(_0x8657('0x8'));var sox=require(_0x8657('0x9'));var csv=require(_0x8657('0xa'));var ejs=require(_0x8657('0xb'));var fs=require('fs');var _=require(_0x8657('0xc'));var squel=require('squel');var crypto=require(_0x8657('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8657('0xe'));var toCsv=require(_0x8657('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8657('0xf'));var qs=require(_0x8657('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8657('0x11'));var utils=require(_0x8657('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d62f0,_0xf2a2a1){_0xf2a2a1=_0xf2a2a1||0xcc;return function(_0x729bfa){if(_0x729bfa){return _0x3d62f0[_0x8657('0x13')](_0xf2a2a1);}return _0x3d62f0['status'](_0xf2a2a1)[_0x8657('0x14')]();};}function respondWithResult(_0x1cc718,_0x44bc10){_0x44bc10=_0x44bc10||0xc8;return function(_0x130711){if(_0x130711){return _0x1cc718[_0x8657('0x15')](_0x44bc10)[_0x8657('0x16')](_0x130711);}};}function respondWithFilteredResult(_0x258232,_0x36fcd0){return function(_0x10946c){if(_0x10946c){var _0x2ce959=_0x10946c[_0x8657('0x17')],_0x5dfe33=_0x36fcd0[_0x8657('0x18')],_0x49fa6e=_0x36fcd0[_0x8657('0x18')]+_0x36fcd0[_0x8657('0x19')],_0xdcec79;if(_0x49fa6e>=_0x2ce959){_0x49fa6e=_0x2ce959;_0xdcec79=0xc8;}else{_0xdcec79=0xce;}_0x258232[_0x8657('0x15')](_0xdcec79);return _0x258232[_0x8657('0x1a')](_0x8657('0x1b'),_0x5dfe33+'-'+_0x49fa6e+'/'+_0x2ce959)[_0x8657('0x16')](_0x10946c);}return null;};}function patchUpdates(_0x460f1e){return function(_0x51443c){try{jsonpatch[_0x8657('0x1c')](_0x51443c,_0x460f1e,!![]);}catch(_0x4c2580){return BPromise[_0x8657('0x1d')](_0x4c2580);}return _0x51443c[_0x8657('0x1e')]();};}function saveUpdates(_0x5369e3,_0x1b4c78){return function(_0x41cc73){if(_0x41cc73){return _0x41cc73['update'](_0x5369e3)[_0x8657('0x1f')](function(_0x308538){return _0x308538;});}return null;};}function removeEntity(_0x538ae8,_0x2a66ba){return function(_0x277b29){if(_0x277b29){return _0x277b29[_0x8657('0x20')]()[_0x8657('0x1f')](function(){_0x538ae8[_0x8657('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16439e,_0x4ae5d5){return function(_0x4ca7d8){if(!_0x4ca7d8){_0x16439e[_0x8657('0x13')](0x194);}return _0x4ca7d8;};}function handleError(_0x11e29c,_0x17912d){_0x17912d=_0x17912d||0x1f4;return function(_0x3f0f6f){logger['error'](_0x3f0f6f[_0x8657('0x21')]);if(_0x3f0f6f[_0x8657('0x22')]){delete _0x3f0f6f['name'];}_0x11e29c[_0x8657('0x15')](_0x17912d)[_0x8657('0x23')](_0x3f0f6f);};}exports[_0x8657('0x24')]=function(_0x2d233a,_0x448f52){var _0x1b7feb={},_0x3fc4eb={},_0x2ff0a3={'count':0x0,'rows':[]};var _0xffb807=_[_0x8657('0x25')](db[_0x8657('0x26')]['rawAttributes'],function(_0x3afc1a){return{'name':_0x3afc1a[_0x8657('0x27')],'type':_0x3afc1a[_0x8657('0x28')][_0x8657('0x29')]};});_0x3fc4eb[_0x8657('0x2a')]=_['map'](_0xffb807,_0x8657('0x22'));_0x3fc4eb['query']=_[_0x8657('0x2b')](_0x2d233a[_0x8657('0x2c')]);_0x3fc4eb[_0x8657('0x2d')]=_[_0x8657('0x2e')](_0x3fc4eb[_0x8657('0x2a')],_0x3fc4eb[_0x8657('0x2c')]);_0x1b7feb[_0x8657('0x2f')]=_[_0x8657('0x2e')](_0x3fc4eb[_0x8657('0x2a')],qs[_0x8657('0x30')](_0x2d233a[_0x8657('0x2c')][_0x8657('0x30')]));_0x1b7feb['attributes']=_0x1b7feb[_0x8657('0x2f')][_0x8657('0x31')]?_0x1b7feb[_0x8657('0x2f')]:_0x3fc4eb['model'];if(!_0x2d233a[_0x8657('0x2c')][_0x8657('0x32')](_0x8657('0x33'))){_0x1b7feb['limit']=qs[_0x8657('0x19')](_0x2d233a['query'][_0x8657('0x19')]);_0x1b7feb['offset']=qs[_0x8657('0x18')](_0x2d233a[_0x8657('0x2c')][_0x8657('0x18')]);}_0x1b7feb['order']=qs[_0x8657('0x34')](_0x2d233a[_0x8657('0x2c')][_0x8657('0x34')]);_0x1b7feb[_0x8657('0x35')]=qs[_0x8657('0x2d')](_['pick'](_0x2d233a[_0x8657('0x2c')],_0x3fc4eb['filters']));if(_0x2d233a[_0x8657('0x2c')][_0x8657('0x36')]){_0x1b7feb[_0x8657('0x35')]=_['merge'](_0x1b7feb[_0x8657('0x35')],{'$or':_[_0x8657('0x25')](_0xffb807,function(_0x18f99c){if(_0x18f99c[_0x8657('0x28')]!=='VIRTUAL'){var _0x1276dc={};_0x1276dc[_0x18f99c['name']]={'$like':'%'+_0x2d233a[_0x8657('0x2c')][_0x8657('0x36')]+'%'};return _0x1276dc;}})});}_0x1b7feb=_[_0x8657('0x37')]({},_0x1b7feb,_0x2d233a[_0x8657('0x38')]);var _0x7abe10={'where':_0x1b7feb[_0x8657('0x35')]};return db[_0x8657('0x26')][_0x8657('0x17')](_0x7abe10)[_0x8657('0x1f')](function(_0x563372){_0x2ff0a3[_0x8657('0x17')]=_0x563372;if(_0x2d233a[_0x8657('0x2c')][_0x8657('0x39')]){_0x1b7feb[_0x8657('0x3a')]=[{'all':!![]}];}return db['SquareRecording'][_0x8657('0x3b')](_0x1b7feb);})[_0x8657('0x1f')](function(_0x4893bd){_0x2ff0a3['rows']=_0x4893bd;return _0x2ff0a3;})['then'](respondWithFilteredResult(_0x448f52,_0x1b7feb))[_0x8657('0x3c')](handleError(_0x448f52,null));};exports[_0x8657('0x3d')]=function(_0x4081c8,_0xf6e3d0){var _0xf172f2={'raw':!![],'where':{'id':_0x4081c8[_0x8657('0x3e')]['id']}},_0x524128={};_0x524128[_0x8657('0x2a')]=_['keys'](db[_0x8657('0x26')][_0x8657('0x3f')]);_0x524128[_0x8657('0x2c')]=_[_0x8657('0x2b')](_0x4081c8['query']);_0x524128[_0x8657('0x2d')]=_[_0x8657('0x2e')](_0x524128[_0x8657('0x2a')],_0x524128[_0x8657('0x2c')]);_0xf172f2[_0x8657('0x2f')]=_[_0x8657('0x2e')](_0x524128[_0x8657('0x2a')],qs[_0x8657('0x30')](_0x4081c8[_0x8657('0x2c')][_0x8657('0x30')]));_0xf172f2['attributes']=_0xf172f2[_0x8657('0x2f')][_0x8657('0x31')]?_0xf172f2[_0x8657('0x2f')]:_0x524128[_0x8657('0x2a')];if(_0x4081c8['query'][_0x8657('0x39')]){_0xf172f2['include']=[{'all':!![]}];}_0xf172f2=_[_0x8657('0x37')]({},_0xf172f2,_0x4081c8[_0x8657('0x38')]);return db[_0x8657('0x26')][_0x8657('0x40')](_0xf172f2)[_0x8657('0x1f')](handleEntityNotFound(_0xf6e3d0,null))[_0x8657('0x1f')](respondWithResult(_0xf6e3d0,null))[_0x8657('0x3c')](handleError(_0xf6e3d0,null));};exports[_0x8657('0x41')]=function(_0xec54e8,_0x1d7df4){return db[_0x8657('0x26')][_0x8657('0x41')](_0xec54e8[_0x8657('0x42')],{})[_0x8657('0x1f')](respondWithResult(_0x1d7df4,0xc9))[_0x8657('0x3c')](handleError(_0x1d7df4,null));};exports[_0x8657('0x43')]=function(_0x3d0e4f,_0x57230a){if(_0x3d0e4f[_0x8657('0x42')]['id']){delete _0x3d0e4f['body']['id'];}return db['SquareRecording'][_0x8657('0x40')]({'where':{'id':_0x3d0e4f[_0x8657('0x3e')]['id']}})[_0x8657('0x1f')](handleEntityNotFound(_0x57230a,null))[_0x8657('0x1f')](saveUpdates(_0x3d0e4f[_0x8657('0x42')],null))[_0x8657('0x1f')](respondWithResult(_0x57230a,null))[_0x8657('0x3c')](handleError(_0x57230a,null));};exports['download']=function(_0x4afbae,_0x518a66,_0x5535ed){var _0x348540=require(_0x8657('0x44'));var _0xd491c8=![];var _0x10ccdc={};if(_0x4afbae[_0x8657('0x2c')][_0x8657('0x28')]&&_0x4afbae[_0x8657('0x2c')]['type']===_0x8657('0x45')){_0x10ccdc[_0x8657('0x45')]=_0x4afbae['params']['id'];}else{_0x10ccdc['id']=_0x4afbae[_0x8657('0x3e')]['id'];}return db['SquareRecording'][_0x8657('0x40')]({'where':_0x10ccdc,'attributes':['id',_0x8657('0x46'),'filename'],'raw':!![]})[_0x8657('0x1f')](handleEntityNotFound(_0x518a66,null))['then'](function(_0x3de858){if(_0x3de858){var _0x2c8c20=_0x3de858[_0x8657('0x46')];var _0x11a76b=util[_0x8657('0x47')](_0x8657('0x48'),_0x2c8c20);if(fs['existsSync'](_0x11a76b)){_0xd491c8=!![];return _0x348540[_0x8657('0x49')](_0x11a76b,_0x2c8c20,config['secrets'][_0x8657('0x4a')])['then'](function(){return _0x3de858;});}return _0x3de858;}})[_0x8657('0x1f')](function(_0x89ef32){if(_0x89ef32){var _0x14e2d8=_0x89ef32[_0x8657('0x46')];if(!fs[_0x8657('0x4b')](_0x14e2d8)){throw new db['Sequelize'][(_0x8657('0x4c'))](_0x8657('0x4d'));}if(_0x89ef32['filename']){return _0x518a66[_0x8657('0x4e')](_0x14e2d8,_0x89ef32[_0x8657('0x4f')]+path['extname'](_0x14e2d8),function(){if(_0xd491c8){fs[_0x8657('0x50')](_0x14e2d8);}});}else{return _0x518a66['download'](_0x14e2d8,function(_0x2796e7){if(_0xd491c8){fs['unlink'](_0x14e2d8);}});}}})[_0x8657('0x3c')](function(_0x1f6297){if(_0x1f6297['message']===_0x8657('0x4d')){_0x518a66['status'](0x194)[_0x8657('0x23')](_0x8657('0x51'));}else{return handleError(_0x518a66,null);}});};exports[_0x8657('0x20')]=function(_0x34f46f,_0x35b046){return db['SquareRecording'][_0x8657('0x40')]({'where':{'id':_0x34f46f['params']['id']}})[_0x8657('0x1f')](function(_0x12a275){if(!_0x12a275)throw new ReferenceError(_0x8657('0x52'));return _0x12a275;})['then'](function(_0xde2faa){var _0x519b59=_0xde2faa[_0x8657('0x46')];logger[_0x8657('0x53')](_0x8657('0x54'),_0x519b59);if(!_[_0x8657('0x55')](_0xde2faa[_0x8657('0x46')])&&fs['existsSync'](_0x519b59)){logger[_0x8657('0x53')]('File:\x20\x22'+_0x519b59+_0x8657('0x56'));fs[_0x8657('0x57')](_0x519b59);}_0x519b59=_0x519b59+_0x8657('0x58');if(!_[_0x8657('0x55')](_0xde2faa[_0x8657('0x46')])&&fs[_0x8657('0x4b')](_0x519b59)){logger[_0x8657('0x53')](_0x8657('0x59')+_0x519b59+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8657('0x57')](_0x519b59);}return _0xde2faa;})[_0x8657('0x1f')](function(_0x16622a){if(!_0x16622a)throw new InternalError();return _0x16622a['destroy']();})['then'](function(){_0x35b046[_0x8657('0x15')](0xcc)[_0x8657('0x14')]();})[_0x8657('0x3c')](handleError(_0x35b046,null));}; \ No newline at end of file +var _0x0cba=['moment','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','rows','params','includeAll','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','info','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x267281,_0x58544b){var _0x255146=function(_0x5f3b4c){while(--_0x5f3b4c){_0x267281['push'](_0x267281['shift']());}};_0x255146(++_0x58544b);}(_0x0cba,0x183));var _0xa0cb=function(_0x3cb09b,_0x31c2a5){_0x3cb09b=_0x3cb09b-0x0;var _0x242048=_0x0cba[_0x3cb09b];return _0x242048;};'use strict';var pdf=require(_0xa0cb('0x0'));var emlformat=require(_0xa0cb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa0cb('0x2'));var jsonpatch=require(_0xa0cb('0x3'));var rp=require(_0xa0cb('0x4'));var moment=require(_0xa0cb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa0cb('0x6'));var path=require('path');var sox=require(_0xa0cb('0x7'));var csv=require(_0xa0cb('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa0cb('0x9'));var squel=require(_0xa0cb('0xa'));var crypto=require(_0xa0cb('0xb'));var jsforce=require(_0xa0cb('0xc'));var deskjs=require(_0xa0cb('0xd'));var toCsv=require(_0xa0cb('0x8'));var querystring=require('querystring');var Papa=require(_0xa0cb('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa0cb('0xf'));var as=require(_0xa0cb('0x10'));var hardwareService=require(_0xa0cb('0x11'));var logger=require(_0xa0cb('0x12'))(_0xa0cb('0x13'));var utils=require(_0xa0cb('0x14'));var config=require(_0xa0cb('0x15'));var db=require(_0xa0cb('0x16'))['db'];function respondWithStatusCode(_0x142460,_0x2907f2){_0x2907f2=_0x2907f2||0xcc;return function(_0x43a85c){if(_0x43a85c){return _0x142460['sendStatus'](_0x2907f2);}return _0x142460[_0xa0cb('0x17')](_0x2907f2)[_0xa0cb('0x18')]();};}function respondWithResult(_0x35d22e,_0xd72b0c){_0xd72b0c=_0xd72b0c||0xc8;return function(_0x9bda8){if(_0x9bda8){return _0x35d22e['status'](_0xd72b0c)[_0xa0cb('0x19')](_0x9bda8);}};}function respondWithFilteredResult(_0x54de0b,_0x53dd2d){return function(_0x182fd8){if(_0x182fd8){var _0x3e2590=_0x182fd8['count'],_0x193530=_0x53dd2d[_0xa0cb('0x1a')],_0x31d9a0=_0x53dd2d[_0xa0cb('0x1a')]+_0x53dd2d[_0xa0cb('0x1b')],_0x383919;if(_0x31d9a0>=_0x3e2590){_0x31d9a0=_0x3e2590;_0x383919=0xc8;}else{_0x383919=0xce;}_0x54de0b[_0xa0cb('0x17')](_0x383919);return _0x54de0b[_0xa0cb('0x1c')](_0xa0cb('0x1d'),_0x193530+'-'+_0x31d9a0+'/'+_0x3e2590)['json'](_0x182fd8);}return null;};}function patchUpdates(_0x1f464c){return function(_0x5af8a4){try{jsonpatch[_0xa0cb('0x1e')](_0x5af8a4,_0x1f464c,!![]);}catch(_0x179e03){return BPromise[_0xa0cb('0x1f')](_0x179e03);}return _0x5af8a4[_0xa0cb('0x20')]();};}function saveUpdates(_0x45a05c,_0x45e0f7){return function(_0x1014a4){if(_0x1014a4){return _0x1014a4[_0xa0cb('0x21')](_0x45a05c)['then'](function(_0x1804a5){return _0x1804a5;});}return null;};}function removeEntity(_0x5ee829,_0x44ffe7){return function(_0x37e127){if(_0x37e127){return _0x37e127[_0xa0cb('0x22')]()[_0xa0cb('0x23')](function(){_0x5ee829['status'](0xcc)[_0xa0cb('0x18')]();});}};}function handleEntityNotFound(_0x144bac,_0x26bd59){return function(_0x1996d7){if(!_0x1996d7){_0x144bac[_0xa0cb('0x24')](0x194);}return _0x1996d7;};}function handleError(_0x577e78,_0x171549){_0x171549=_0x171549||0x1f4;return function(_0x4df9da){logger[_0xa0cb('0x25')](_0x4df9da[_0xa0cb('0x26')]);if(_0x4df9da[_0xa0cb('0x27')]){delete _0x4df9da['name'];}_0x577e78['status'](_0x171549)[_0xa0cb('0x28')](_0x4df9da);};}exports[_0xa0cb('0x29')]=function(_0x3a1297,_0xe8e372){var _0x57446b={},_0x514eb7={},_0x46753a={'count':0x0,'rows':[]};var _0x466629=_[_0xa0cb('0x2a')](db[_0xa0cb('0x2b')][_0xa0cb('0x2c')],function(_0x4a17de){return{'name':_0x4a17de[_0xa0cb('0x2d')],'type':_0x4a17de[_0xa0cb('0x2e')][_0xa0cb('0x2f')]};});_0x514eb7[_0xa0cb('0x30')]=_[_0xa0cb('0x2a')](_0x466629,_0xa0cb('0x27'));_0x514eb7[_0xa0cb('0x31')]=_[_0xa0cb('0x32')](_0x3a1297[_0xa0cb('0x31')]);_0x514eb7['filters']=_[_0xa0cb('0x33')](_0x514eb7[_0xa0cb('0x30')],_0x514eb7[_0xa0cb('0x31')]);_0x57446b[_0xa0cb('0x34')]=_[_0xa0cb('0x33')](_0x514eb7[_0xa0cb('0x30')],qs[_0xa0cb('0x35')](_0x3a1297[_0xa0cb('0x31')][_0xa0cb('0x35')]));_0x57446b[_0xa0cb('0x34')]=_0x57446b[_0xa0cb('0x34')][_0xa0cb('0x36')]?_0x57446b['attributes']:_0x514eb7[_0xa0cb('0x30')];if(!_0x3a1297[_0xa0cb('0x31')][_0xa0cb('0x37')]('nolimit')){_0x57446b['limit']=qs[_0xa0cb('0x1b')](_0x3a1297[_0xa0cb('0x31')][_0xa0cb('0x1b')]);_0x57446b[_0xa0cb('0x1a')]=qs[_0xa0cb('0x1a')](_0x3a1297[_0xa0cb('0x31')][_0xa0cb('0x1a')]);}_0x57446b[_0xa0cb('0x38')]=qs[_0xa0cb('0x39')](_0x3a1297[_0xa0cb('0x31')][_0xa0cb('0x39')]);_0x57446b[_0xa0cb('0x3a')]=qs['filters'](_[_0xa0cb('0x3b')](_0x3a1297[_0xa0cb('0x31')],_0x514eb7['filters']));if(_0x3a1297[_0xa0cb('0x31')][_0xa0cb('0x3c')]){_0x57446b[_0xa0cb('0x3a')]=_['merge'](_0x57446b['where'],{'$or':_[_0xa0cb('0x2a')](_0x466629,function(_0x4b309d){if(_0x4b309d['type']!==_0xa0cb('0x3d')){var _0x4f0487={};_0x4f0487[_0x4b309d[_0xa0cb('0x27')]]={'$like':'%'+_0x3a1297['query'][_0xa0cb('0x3c')]+'%'};return _0x4f0487;}})});}_0x57446b=_[_0xa0cb('0x3e')]({},_0x57446b,_0x3a1297[_0xa0cb('0x3f')]);var _0x475b18={'where':_0x57446b['where']};return db['SquareRecording'][_0xa0cb('0x40')](_0x475b18)[_0xa0cb('0x23')](function(_0x5c5876){_0x46753a[_0xa0cb('0x40')]=_0x5c5876;if(_0x3a1297[_0xa0cb('0x31')]['includeAll']){_0x57446b[_0xa0cb('0x41')]=[{'all':!![]}];}return db[_0xa0cb('0x2b')][_0xa0cb('0x42')](_0x57446b);})['then'](function(_0x3a1566){_0x46753a[_0xa0cb('0x43')]=_0x3a1566;return _0x46753a;})[_0xa0cb('0x23')](respondWithFilteredResult(_0xe8e372,_0x57446b))['catch'](handleError(_0xe8e372,null));};exports['show']=function(_0x4130ed,_0x14aff){var _0x4adc13={'raw':!![],'where':{'id':_0x4130ed[_0xa0cb('0x44')]['id']}},_0x4f916b={};_0x4f916b[_0xa0cb('0x30')]=_[_0xa0cb('0x32')](db['SquareRecording'][_0xa0cb('0x2c')]);_0x4f916b[_0xa0cb('0x31')]=_[_0xa0cb('0x32')](_0x4130ed[_0xa0cb('0x31')]);_0x4f916b['filters']=_[_0xa0cb('0x33')](_0x4f916b[_0xa0cb('0x30')],_0x4f916b[_0xa0cb('0x31')]);_0x4adc13[_0xa0cb('0x34')]=_[_0xa0cb('0x33')](_0x4f916b['model'],qs[_0xa0cb('0x35')](_0x4130ed['query'][_0xa0cb('0x35')]));_0x4adc13[_0xa0cb('0x34')]=_0x4adc13['attributes'][_0xa0cb('0x36')]?_0x4adc13[_0xa0cb('0x34')]:_0x4f916b[_0xa0cb('0x30')];if(_0x4130ed[_0xa0cb('0x31')][_0xa0cb('0x45')]){_0x4adc13[_0xa0cb('0x41')]=[{'all':!![]}];}_0x4adc13=_[_0xa0cb('0x3e')]({},_0x4adc13,_0x4130ed[_0xa0cb('0x3f')]);return db[_0xa0cb('0x2b')][_0xa0cb('0x46')](_0x4adc13)[_0xa0cb('0x23')](handleEntityNotFound(_0x14aff,null))[_0xa0cb('0x23')](respondWithResult(_0x14aff,null))[_0xa0cb('0x47')](handleError(_0x14aff,null));};exports[_0xa0cb('0x48')]=function(_0x36863e,_0x3ed1ab){return db[_0xa0cb('0x2b')][_0xa0cb('0x48')](_0x36863e[_0xa0cb('0x49')],{})[_0xa0cb('0x23')](respondWithResult(_0x3ed1ab,0xc9))['catch'](handleError(_0x3ed1ab,null));};exports[_0xa0cb('0x21')]=function(_0x3d2339,_0x274364){if(_0x3d2339[_0xa0cb('0x49')]['id']){delete _0x3d2339['body']['id'];}return db[_0xa0cb('0x2b')][_0xa0cb('0x46')]({'where':{'id':_0x3d2339[_0xa0cb('0x44')]['id']}})[_0xa0cb('0x23')](handleEntityNotFound(_0x274364,null))[_0xa0cb('0x23')](saveUpdates(_0x3d2339[_0xa0cb('0x49')],null))[_0xa0cb('0x23')](respondWithResult(_0x274364,null))[_0xa0cb('0x47')](handleError(_0x274364,null));};exports[_0xa0cb('0x4a')]=function(_0x51b55e,_0x338e44,_0x157f1c){var _0x456ce1=require(_0xa0cb('0x4b'));var _0x505aba=![];var _0x3a18b7={};if(_0x51b55e[_0xa0cb('0x31')][_0xa0cb('0x2e')]&&_0x51b55e[_0xa0cb('0x31')][_0xa0cb('0x2e')]===_0xa0cb('0x4c')){_0x3a18b7[_0xa0cb('0x4c')]=_0x51b55e['params']['id'];}else{_0x3a18b7['id']=_0x51b55e[_0xa0cb('0x44')]['id'];}return db[_0xa0cb('0x2b')]['find']({'where':_0x3a18b7,'attributes':['id',_0xa0cb('0x4d'),_0xa0cb('0x4e')],'raw':!![]})[_0xa0cb('0x23')](handleEntityNotFound(_0x338e44,null))[_0xa0cb('0x23')](function(_0x228129){if(_0x228129){var _0x4fc88d=_0x228129[_0xa0cb('0x4d')];var _0x499fef=util[_0xa0cb('0x4f')](_0xa0cb('0x50'),_0x4fc88d);if(fs[_0xa0cb('0x51')](_0x499fef)){_0x505aba=!![];return _0x456ce1['decryptFile'](_0x499fef,_0x4fc88d,config[_0xa0cb('0x52')][_0xa0cb('0x53')])['then'](function(){return _0x228129;});}return _0x228129;}})[_0xa0cb('0x23')](function(_0x37ddda){if(_0x37ddda){var _0x4b868b=_0x37ddda['savePath'];if(!fs['existsSync'](_0x4b868b)){throw new db[(_0xa0cb('0x54'))]['ValidationError'](_0xa0cb('0x55'));}if(_0x37ddda['filename']){return _0x338e44[_0xa0cb('0x4a')](_0x4b868b,_0x37ddda[_0xa0cb('0x4e')]+path[_0xa0cb('0x56')](_0x4b868b),function(){if(_0x505aba){fs[_0xa0cb('0x57')](_0x4b868b);}});}else{return _0x338e44['download'](_0x4b868b,function(_0xb7000d){if(_0x505aba){fs[_0xa0cb('0x57')](_0x4b868b);}});}}})['catch'](function(_0x3b976e){if(_0x3b976e[_0xa0cb('0x58')]===_0xa0cb('0x55')){_0x338e44[_0xa0cb('0x17')](0x194)[_0xa0cb('0x28')](_0xa0cb('0x59'));}else{return handleError(_0x338e44,null);}});};exports[_0xa0cb('0x22')]=function(_0x147a3d,_0x3ec8b8){return db[_0xa0cb('0x2b')][_0xa0cb('0x46')]({'where':{'id':_0x147a3d[_0xa0cb('0x44')]['id']}})[_0xa0cb('0x23')](function(_0x48252e){if(!_0x48252e)throw new ReferenceError(_0xa0cb('0x5a'));return _0x48252e;})['then'](function(_0x2ef041){var _0x4a5346=_0x2ef041[_0xa0cb('0x4d')];logger['info'](_0xa0cb('0x5b'),_0x4a5346);if(!_[_0xa0cb('0x5c')](_0x2ef041[_0xa0cb('0x4d')])&&fs[_0xa0cb('0x51')](_0x4a5346)){logger['info'](_0xa0cb('0x5d')+_0x4a5346+_0xa0cb('0x5e'));fs['unlinkSync'](_0x4a5346);}_0x4a5346=_0x4a5346+_0xa0cb('0x5f');if(!_[_0xa0cb('0x5c')](_0x2ef041['savePath'])&&fs['existsSync'](_0x4a5346)){logger[_0xa0cb('0x60')](_0xa0cb('0x5d')+_0x4a5346+_0xa0cb('0x5e'));fs[_0xa0cb('0x61')](_0x4a5346);}return _0x2ef041;})[_0xa0cb('0x23')](function(_0x24e7e0){if(!_0x24e7e0)throw new InternalError();return _0x24e7e0[_0xa0cb('0x22')]();})[_0xa0cb('0x23')](function(){_0x3ec8b8[_0xa0cb('0x17')](0xcc)[_0xa0cb('0x18')]();})[_0xa0cb('0x47')](handleError(_0x3ec8b8,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 0bc1ffc..69205e9 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 _0x351d=['../../config/environment','exports','SquareRecording','square_recordings','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x5554cd,_0x39f614){var _0x24e458=function(_0x3fa954){while(--_0x3fa954){_0x5554cd['push'](_0x5554cd['shift']());}};_0x24e458(++_0x39f614);}(_0x351d,0x90));var _0xd351=function(_0x3ae846,_0x376a97){_0x3ae846=_0x3ae846-0x0;var _0x1d748f=_0x351d[_0x3ae846];return _0x1d748f;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var logger=require(_0xd351('0x1'))(_0xd351('0x2'));var moment=require(_0xd351('0x3'));var BPromise=require('bluebird');var rp=require(_0xd351('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd351('0x5'));var config=require(_0xd351('0x6'));var attributes=require('./squareRecording.attributes');module[_0xd351('0x7')]=function(_0x45e9e5,_0x88bd2b){return _0x45e9e5['define'](_0xd351('0x8'),attributes,{'tableName':_0xd351('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfef3=['./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x4701a4,_0x1a2bf1){var _0x4e7522=function(_0x1c56f9){while(--_0x1c56f9){_0x4701a4['push'](_0x4701a4['shift']());}};_0x4e7522(++_0x1a2bf1);}(_0xfef3,0x118));var _0x3fef=function(_0x560589,_0x3889f0){_0x560589=_0x560589-0x0;var _0x386054=_0xfef3[_0x560589];return _0x386054;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var logger=require(_0x3fef('0x1'))('api');var moment=require(_0x3fef('0x2'));var BPromise=require(_0x3fef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fef('0x4'));var rimraf=require(_0x3fef('0x5'));var config=require('../../config/environment');var attributes=require(_0x3fef('0x6'));module[_0x3fef('0x7')]=function(_0x5dd9fb,_0x319a2a){return _0x5dd9fb[_0x3fef('0x8')](_0x3fef('0x9'),attributes,{'tableName':_0x3fef('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 b3e0ea2..243de9e 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 _0xa49c=['debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateSquareRecording','SquareRecording','body','options','raw'];(function(_0x5528c3,_0x35a416){var _0x47ec1b=function(_0x54a18e){while(--_0x54a18e){_0x5528c3['push'](_0x5528c3['shift']());}};_0x47ec1b(++_0x35a416);}(_0xa49c,0x1e7));var _0xca49=function(_0x3efd98,_0x5a231a){_0x3efd98=_0x3efd98-0x0;var _0x3d99b7=_0xa49c[_0x3efd98];return _0x3d99b7;};'use strict';var _=require(_0xca49('0x0'));var util=require(_0xca49('0x1'));var moment=require(_0xca49('0x2'));var BPromise=require(_0xca49('0x3'));var rs=require(_0xca49('0x4'));var fs=require('fs');var Redis=require(_0xca49('0x5'));var db=require(_0xca49('0x6'))['db'];var utils=require(_0xca49('0x7'));var logger=require(_0xca49('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xca49('0x9'));var client=jayson[_0xca49('0xa')][_0xca49('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x319d99,_0x489944,_0x4e8721){return new BPromise(function(_0x16f0f5,_0x4535d2){return client['request'](_0x319d99,_0x4e8721)[_0xca49('0xc')](function(_0x42bea1){logger[_0xca49('0xd')](_0xca49('0xe'),_0x489944,'request\x20sent');logger['debug'](_0xca49('0xf'),_0x489944,_0xca49('0x10'),JSON[_0xca49('0x11')](_0x42bea1));if(_0x42bea1[_0xca49('0x12')]){if(_0x42bea1[_0xca49('0x12')]['code']===0x1f4){logger['error'](_0xca49('0xe'),_0x489944,_0x42bea1[_0xca49('0x12')][_0xca49('0x13')]);return _0x4535d2(_0x42bea1[_0xca49('0x12')][_0xca49('0x13')]);}logger[_0xca49('0x12')](_0xca49('0xe'),_0x489944,_0x42bea1[_0xca49('0x12')]['message']);return _0x16f0f5(_0x42bea1[_0xca49('0x12')][_0xca49('0x13')]);}else{logger[_0xca49('0xd')]('SquareRecording,\x20%s,\x20%s',_0x489944,_0xca49('0x10'));_0x16f0f5(_0x42bea1['result'][_0xca49('0x13')]);}})[_0xca49('0x14')](function(_0x452d81){logger['error'](_0xca49('0xe'),_0x489944,_0x452d81);_0x4535d2(_0x452d81);});});}exports[_0xca49('0x15')]=function(_0x411f45){var _0x37bc92=this;return new Promise(function(_0x3de202,_0x51128c){return db[_0xca49('0x16')]['create'](_0x411f45[_0xca49('0x17')],{'raw':_0x411f45[_0xca49('0x18')]?_0x411f45[_0xca49('0x18')][_0xca49('0x19')]===undefined?!![]:![]:!![]})[_0xca49('0xc')](function(_0x339274){logger[_0xca49('0xd')]('CreateSquareRecording',_0x411f45);logger[_0xca49('0x1a')]('CreateSquareRecording',_0x411f45,JSON[_0xca49('0x11')](_0x339274));_0x3de202(_0x339274);})[_0xca49('0x14')](function(_0x597ffe){logger['error'](_0xca49('0x15'),_0x597ffe[_0xca49('0x13')],_0x411f45);_0x51128c(_0x37bc92['error'](0x1f4,_0x597ffe[_0xca49('0x13')]));});});}; \ No newline at end of file +var _0x660b=['then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','create','body','options','raw','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x660b,0x89));var _0xb660=function(_0x229fa6,_0x83d3d7){_0x229fa6=_0x229fa6-0x0;var _0x57c815=_0x660b[_0x229fa6];return _0x57c815;};'use strict';var _=require(_0xb660('0x0'));var util=require(_0xb660('0x1'));var moment=require(_0xb660('0x2'));var BPromise=require('bluebird');var rs=require(_0xb660('0x3'));var fs=require('fs');var Redis=require(_0xb660('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb660('0x5'));var logger=require(_0xb660('0x6'))(_0xb660('0x7'));var config=require(_0xb660('0x8'));var jayson=require(_0xb660('0x9'));var client=jayson[_0xb660('0xa')][_0xb660('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x152dea,_0xc81f13,_0xeffa11){return new BPromise(function(_0x4c1755,_0x3017eb){return client[_0xb660('0xc')](_0x152dea,_0xeffa11)[_0xb660('0xd')](function(_0x3e0cad){logger[_0xb660('0xe')](_0xb660('0xf'),_0xc81f13,_0xb660('0x10'));logger['debug'](_0xb660('0x11'),_0xc81f13,_0xb660('0x10'),JSON[_0xb660('0x12')](_0x3e0cad));if(_0x3e0cad[_0xb660('0x13')]){if(_0x3e0cad['error'][_0xb660('0x14')]===0x1f4){logger[_0xb660('0x13')](_0xb660('0xf'),_0xc81f13,_0x3e0cad[_0xb660('0x13')][_0xb660('0x15')]);return _0x3017eb(_0x3e0cad[_0xb660('0x13')]['message']);}logger['error']('SquareRecording,\x20%s,\x20%s',_0xc81f13,_0x3e0cad[_0xb660('0x13')][_0xb660('0x15')]);return _0x4c1755(_0x3e0cad[_0xb660('0x13')][_0xb660('0x15')]);}else{logger[_0xb660('0xe')](_0xb660('0xf'),_0xc81f13,'request\x20sent');_0x4c1755(_0x3e0cad[_0xb660('0x16')]['message']);}})[_0xb660('0x17')](function(_0x4cd26a){logger['error'](_0xb660('0xf'),_0xc81f13,_0x4cd26a);_0x3017eb(_0x4cd26a);});});}exports[_0xb660('0x18')]=function(_0x1187f8){var _0x326528=this;return new Promise(function(_0x9c166f,_0x40644b){return db['SquareRecording'][_0xb660('0x19')](_0x1187f8[_0xb660('0x1a')],{'raw':_0x1187f8[_0xb660('0x1b')]?_0x1187f8[_0xb660('0x1b')][_0xb660('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3df0b0){logger['info'](_0xb660('0x18'),_0x1187f8);logger[_0xb660('0x1d')](_0xb660('0x18'),_0x1187f8,JSON[_0xb660('0x12')](_0x3df0b0));_0x9c166f(_0x3df0b0);})['catch'](function(_0x4d4212){logger['error']('CreateSquareRecording',_0x4d4212[_0xb660('0x15')],_0x1187f8);_0x40644b(_0x326528[_0xb660('0x13')](0x1f4,_0x4d4212[_0xb660('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 78331fc..eb4f513 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 _0x757f=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete'];(function(_0x1b06cd,_0x5ac7e8){var _0x11d0e4=function(_0x5d49f3){while(--_0x5d49f3){_0x1b06cd['push'](_0x1b06cd['shift']());}};_0x11d0e4(++_0x5ac7e8);}(_0x757f,0x162));var _0xf757=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0x757f[_0x1fc1f9];return _0x4987ca;};'use strict';var multer=require(_0xf757('0x0'));var util=require(_0xf757('0x1'));var path=require('path');var timeout=require(_0xf757('0x2'));var express=require(_0xf757('0x3'));var router=express[_0xf757('0x4')]();var auth=require(_0xf757('0x5'));var interaction=require(_0xf757('0x6'));var config=require(_0xf757('0x7'));var controller=require(_0xf757('0x8'));router[_0xf757('0x9')]('/',auth[_0xf757('0xa')](),controller[_0xf757('0xb')]);router[_0xf757('0x9')](_0xf757('0xc'),auth[_0xf757('0xa')](),controller[_0xf757('0xd')]);router[_0xf757('0x9')](_0xf757('0xe'),auth[_0xf757('0xa')](),controller[_0xf757('0xf')]);router['post']('/',auth[_0xf757('0xa')](),controller[_0xf757('0x10')]);router[_0xf757('0x11')](_0xf757('0xe'),auth[_0xf757('0xa')](),controller[_0xf757('0x12')]);router[_0xf757('0x13')]('/:id',auth[_0xf757('0xa')](),controller[_0xf757('0x14')]);module[_0xf757('0x15')]=router; \ No newline at end of file +var _0xb1c0=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','/:id','delete'];(function(_0x10f61b,_0x3a7a52){var _0x2165e2=function(_0x12fa10){while(--_0x12fa10){_0x10f61b['push'](_0x10f61b['shift']());}};_0x2165e2(++_0x3a7a52);}(_0xb1c0,0x1e1));var _0x0b1c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb1c0[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x0b1c('0x0'));var util=require(_0x0b1c('0x1'));var path=require(_0x0b1c('0x2'));var timeout=require(_0x0b1c('0x3'));var express=require(_0x0b1c('0x4'));var router=express[_0x0b1c('0x5')]();var auth=require(_0x0b1c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0b1c('0x7'));var controller=require(_0x0b1c('0x8'));router[_0x0b1c('0x9')]('/',auth['isAuthenticated'](),controller[_0x0b1c('0xa')]);router[_0x0b1c('0x9')](_0x0b1c('0xb'),auth[_0x0b1c('0xc')](),controller[_0x0b1c('0xd')]);router['get']('/:id',auth[_0x0b1c('0xc')](),controller[_0x0b1c('0xe')]);router[_0x0b1c('0xf')]('/',auth[_0x0b1c('0xc')](),controller[_0x0b1c('0x10')]);router['put'](_0x0b1c('0x11'),auth[_0x0b1c('0xc')](),controller['update']);router[_0x0b1c('0x12')](_0x0b1c('0x11'),auth[_0x0b1c('0xc')](),controller[_0x0b1c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 0185e4a..4ee3bc7 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 _0x41e2=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x25730e,_0x5a33e4){var _0x158996=function(_0x4ccde0){while(--_0x4ccde0){_0x25730e['push'](_0x25730e['shift']());}};_0x158996(++_0x5a33e4);}(_0x41e2,0x1dc));var _0x241e=function(_0x3e7f40,_0x49389b){_0x3e7f40=_0x3e7f40-0x0;var _0x9a9a1f=_0x41e2[_0x3e7f40];return _0x9a9a1f;};'use strict';var Sequelize=require(_0x241e('0x0'));module[_0x241e('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x241e('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x241e('0x2')]},'type':{'type':Sequelize[_0x241e('0x2')]},'uniqueid':{'type':Sequelize[_0x241e('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x241e('0x2')]},'calleridname':{'type':Sequelize[_0x241e('0x2')]},'callingpres':{'type':Sequelize[_0x241e('0x2')]},'callingani2':{'type':Sequelize[_0x241e('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x241e('0x2')]},'rdnis':{'type':Sequelize[_0x241e('0x2')]},'context':{'type':Sequelize[_0x241e('0x2')]},'extension':{'type':Sequelize[_0x241e('0x2')]},'priority':{'type':Sequelize[_0x241e('0x2')]},'enhanced':{'type':Sequelize[_0x241e('0x2')]},'accountcode':{'type':Sequelize[_0x241e('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x241e('0x3')]},'bot':{'type':Sequelize[_0x241e('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x1524=['DATE','BOOLEAN','STRING'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x1524,0x11c));var _0x4152=function(_0x5b5c66,_0x232916){_0x5b5c66=_0x5b5c66-0x0;var _0x19c519=_0x1524[_0x5b5c66];return _0x19c519;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0x4152('0x0')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x4152('0x0')]},'channel':{'type':Sequelize[_0x4152('0x0')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4152('0x0')]},'uniqueid':{'type':Sequelize[_0x4152('0x0')]},'version':{'type':Sequelize[_0x4152('0x0')]},'callerid':{'type':Sequelize[_0x4152('0x0')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x4152('0x0')]},'callington':{'type':Sequelize[_0x4152('0x0')]},'callingtns':{'type':Sequelize[_0x4152('0x0')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4152('0x0')]},'extension':{'type':Sequelize[_0x4152('0x0')]},'priority':{'type':Sequelize[_0x4152('0x0')]},'enhanced':{'type':Sequelize[_0x4152('0x0')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x4152('0x0')]},'project_name':{'type':Sequelize[_0x4152('0x0')]},'joinAt':{'type':Sequelize[_0x4152('0x1')]},'leaveAt':{'type':Sequelize[_0x4152('0x1')]},'bot':{'type':Sequelize[_0x4152('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 1765a81..0ec4104 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(_0x1fcf8d,_0x575872){var _0x5f5d85=function(_0x40d04e){while(--_0x40d04e){_0x1fcf8d['push'](_0x1fcf8d['shift']());}};_0x5f5d85(++_0x575872);}(_0x814b,0x1a2));var _0xb814=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0x814b[_0x578275];return _0xf78041;};'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 _0x7217=['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','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../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','send','index','map','SquareReport','rawAttributes','fieldName'];(function(_0x36d625,_0x1a40b8){var _0x517960=function(_0x1615d3){while(--_0x1615d3){_0x36d625['push'](_0x36d625['shift']());}};_0x517960(++_0x1a40b8);}(_0x7217,0x19e));var _0x7721=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7217[_0x5b644e];return _0x49c6bf;};'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['SquareReport']['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));};exports[_0x7721('0x4c')]=function(_0x3386aa,_0x31770e){return db[_0x7721('0x2d')][_0x7721('0x4c')]()[_0x7721('0x26')](respondWithResult(_0x31770e,null))[_0x7721('0x46')](handleError(_0x31770e,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 667bc2b..b5b46f3 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 _0x2004=['path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x49c5cc,_0xd5c0c4){var _0x4a8a9b=function(_0x1d08e0){while(--_0x1d08e0){_0x49c5cc['push'](_0x49c5cc['shift']());}};_0x4a8a9b(++_0xd5c0c4);}(_0x2004,0xeb));var _0x4200=function(_0x188f53,_0x30cc69){_0x188f53=_0x188f53-0x0;var _0x3f8a48=_0x2004[_0x188f53];return _0x3f8a48;};'use strict';var _=require(_0x4200('0x0'));var util=require(_0x4200('0x1'));var logger=require(_0x4200('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4200('0x3'));var rp=require(_0x4200('0x4'));var fs=require('fs');var path=require(_0x4200('0x5'));var rimraf=require(_0x4200('0x6'));var config=require(_0x4200('0x7'));var attributes=require(_0x4200('0x8'));module[_0x4200('0x9')]=function(_0x32be09,_0x3bbdd8){return _0x32be09[_0x4200('0xa')](_0x4200('0xb'),attributes,{'tableName':_0x4200('0xc'),'paranoid':![],'indexes':[{'name':_0x4200('0xd'),'fields':['uniqueid',_0x4200('0xe')]},{'name':_0x4200('0xf'),'fields':[_0x4200('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f23=['uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','report_square'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f23,0x103));var _0x32f2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2f23[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x32f2('0x0'));var util=require(_0x32f2('0x1'));var logger=require(_0x32f2('0x2'))(_0x32f2('0x3'));var moment=require('moment');var BPromise=require(_0x32f2('0x4'));var rp=require(_0x32f2('0x5'));var fs=require('fs');var path=require(_0x32f2('0x6'));var rimraf=require(_0x32f2('0x7'));var config=require('../../config/environment');var attributes=require(_0x32f2('0x8'));module[_0x32f2('0x9')]=function(_0x57280c,_0x475007){return _0x57280c[_0x32f2('0xa')](_0x32f2('0xb'),attributes,{'tableName':_0x32f2('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x32f2('0xd'),_0x32f2('0xe')]},{'name':_0x32f2('0xf'),'fields':[_0x32f2('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 2a41ef5..7ff3fc8 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 _0x1db4=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareReport,\x20%s,\x20%s','CreateSquareReport','SquareReport','create','body','raw','update','options','where','UpdateSquareReport','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x1db4,0xb5));var _0x41db=function(_0x3eeff9,_0x33fdf5){_0x3eeff9=_0x3eeff9-0x0;var _0x159e30=_0x1db4[_0x3eeff9];return _0x159e30;};'use strict';var _=require(_0x41db('0x0'));var util=require('util');var moment=require(_0x41db('0x1'));var BPromise=require(_0x41db('0x2'));var rs=require(_0x41db('0x3'));var fs=require('fs');var Redis=require(_0x41db('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x41db('0x5'));var logger=require(_0x41db('0x6'))(_0x41db('0x7'));var config=require(_0x41db('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x41db('0x9')][_0x41db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x483314,_0x498087,_0x2f091e){return new BPromise(function(_0x172cb7,_0x4328b0){return client[_0x41db('0xb')](_0x483314,_0x2f091e)[_0x41db('0xc')](function(_0x446879){logger[_0x41db('0xd')]('SquareReport,\x20%s,\x20%s',_0x498087,_0x41db('0xe'));logger[_0x41db('0xf')](_0x41db('0x10'),_0x498087,_0x41db('0xe'),JSON[_0x41db('0x11')](_0x446879));if(_0x446879['error']){if(_0x446879[_0x41db('0x12')]['code']===0x1f4){logger[_0x41db('0x12')]('SquareReport,\x20%s,\x20%s',_0x498087,_0x446879[_0x41db('0x12')][_0x41db('0x13')]);return _0x4328b0(_0x446879[_0x41db('0x12')][_0x41db('0x13')]);}logger[_0x41db('0x12')]('SquareReport,\x20%s,\x20%s',_0x498087,_0x446879[_0x41db('0x12')][_0x41db('0x13')]);return _0x172cb7(_0x446879[_0x41db('0x12')][_0x41db('0x13')]);}else{logger['info'](_0x41db('0x14'),_0x498087,_0x41db('0xe'));_0x172cb7(_0x446879['result']['message']);}})['catch'](function(_0x1dabf7){logger[_0x41db('0x12')]('SquareReport,\x20%s,\x20%s',_0x498087,_0x1dabf7);_0x4328b0(_0x1dabf7);});});}exports[_0x41db('0x15')]=function(_0xffa463){var _0x1bf18c=this;return new Promise(function(_0x455eb6,_0x4bf7a2){return db[_0x41db('0x16')][_0x41db('0x17')](_0xffa463[_0x41db('0x18')],{'raw':_0xffa463['options']?_0xffa463['options'][_0x41db('0x19')]===undefined?!![]:![]:!![]})[_0x41db('0xc')](function(_0x4d369e){logger[_0x41db('0xd')]('CreateSquareReport',_0xffa463);logger[_0x41db('0xf')]('CreateSquareReport',_0xffa463,JSON['stringify'](_0x4d369e));_0x455eb6(_0x4d369e);})['catch'](function(_0x55e3f0){logger[_0x41db('0x12')](_0x41db('0x15'),_0x55e3f0[_0x41db('0x13')],_0xffa463);_0x4bf7a2(_0x1bf18c['error'](0x1f4,_0x55e3f0[_0x41db('0x13')]));});});};exports['UpdateSquareReport']=function(_0x3e46f3){var _0x36e490=this;return new Promise(function(_0x18ebcc,_0x163e58){return db[_0x41db('0x16')][_0x41db('0x1a')](_0x3e46f3[_0x41db('0x18')],{'raw':_0x3e46f3[_0x41db('0x1b')]?_0x3e46f3[_0x41db('0x1b')][_0x41db('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e46f3['options']?_0x3e46f3[_0x41db('0x1b')][_0x41db('0x1c')]||null:null,'attributes':_0x3e46f3[_0x41db('0x1b')]?_0x3e46f3[_0x41db('0x1b')]['attributes']||null:null,'limit':_0x3e46f3[_0x41db('0x1b')]?_0x3e46f3[_0x41db('0x1b')]['limit']||null:null})['then'](function(_0x2c830c){logger['info'](_0x41db('0x1d'),_0x3e46f3);logger['debug'](_0x41db('0x1d'),_0x3e46f3,JSON[_0x41db('0x11')](_0x2c830c));_0x18ebcc(_0x2c830c);})[_0x41db('0x1e')](function(_0x23b095){logger[_0x41db('0x12')](_0x41db('0x1d'),_0x23b095[_0x41db('0x13')],_0x3e46f3);_0x163e58(_0x36e490[_0x41db('0x12')](0x1f4,_0x23b095[_0x41db('0x13')]));});});}; \ No newline at end of file +var _0xccfb=['error','code','message','info','result','catch','body','options','raw','CreateSquareReport','UpdateSquareReport','SquareReport','update','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x364e5c,_0x1fc0e4){var _0x370035=function(_0x220ed6){while(--_0x220ed6){_0x364e5c['push'](_0x364e5c['shift']());}};_0x370035(++_0x1fc0e4);}(_0xccfb,0x1a7));var _0xbccf=function(_0x3044e8,_0x5ecca2){_0x3044e8=_0x3044e8-0x0;var _0x4b5dd5=_0xccfb[_0x3044e8];return _0x4b5dd5;};'use strict';var _=require(_0xbccf('0x0'));var util=require(_0xbccf('0x1'));var moment=require(_0xbccf('0x2'));var BPromise=require(_0xbccf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbccf('0x4'));var db=require(_0xbccf('0x5'))['db'];var utils=require(_0xbccf('0x6'));var logger=require(_0xbccf('0x7'))(_0xbccf('0x8'));var config=require(_0xbccf('0x9'));var jayson=require(_0xbccf('0xa'));var client=jayson[_0xbccf('0xb')][_0xbccf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x285932,_0x15777d,_0x247a70){return new BPromise(function(_0x3f3d90,_0x50a820){return client[_0xbccf('0xd')](_0x285932,_0x247a70)[_0xbccf('0xe')](function(_0x53d596){logger['info'](_0xbccf('0xf'),_0x15777d,_0xbccf('0x10'));logger[_0xbccf('0x11')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x15777d,_0xbccf('0x10'),JSON[_0xbccf('0x12')](_0x53d596));if(_0x53d596[_0xbccf('0x13')]){if(_0x53d596['error'][_0xbccf('0x14')]===0x1f4){logger[_0xbccf('0x13')](_0xbccf('0xf'),_0x15777d,_0x53d596[_0xbccf('0x13')][_0xbccf('0x15')]);return _0x50a820(_0x53d596[_0xbccf('0x13')]['message']);}logger[_0xbccf('0x13')](_0xbccf('0xf'),_0x15777d,_0x53d596[_0xbccf('0x13')]['message']);return _0x3f3d90(_0x53d596['error']['message']);}else{logger[_0xbccf('0x16')](_0xbccf('0xf'),_0x15777d,'request\x20sent');_0x3f3d90(_0x53d596[_0xbccf('0x17')]['message']);}})[_0xbccf('0x18')](function(_0x1ec1b5){logger[_0xbccf('0x13')](_0xbccf('0xf'),_0x15777d,_0x1ec1b5);_0x50a820(_0x1ec1b5);});});}exports['CreateSquareReport']=function(_0x20d71f){var _0x32003a=this;return new Promise(function(_0x33c678,_0x562224){return db['SquareReport']['create'](_0x20d71f[_0xbccf('0x19')],{'raw':_0x20d71f['options']?_0x20d71f[_0xbccf('0x1a')][_0xbccf('0x1b')]===undefined?!![]:![]:!![]})[_0xbccf('0xe')](function(_0x2169c4){logger[_0xbccf('0x16')](_0xbccf('0x1c'),_0x20d71f);logger[_0xbccf('0x11')](_0xbccf('0x1c'),_0x20d71f,JSON['stringify'](_0x2169c4));_0x33c678(_0x2169c4);})[_0xbccf('0x18')](function(_0x2273e8){logger[_0xbccf('0x13')]('CreateSquareReport',_0x2273e8['message'],_0x20d71f);_0x562224(_0x32003a['error'](0x1f4,_0x2273e8['message']));});});};exports[_0xbccf('0x1d')]=function(_0x41ea0f){var _0x329759=this;return new Promise(function(_0x1ada61,_0x2c7156){return db[_0xbccf('0x1e')][_0xbccf('0x1f')](_0x41ea0f[_0xbccf('0x19')],{'raw':_0x41ea0f[_0xbccf('0x1a')]?_0x41ea0f[_0xbccf('0x1a')][_0xbccf('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41ea0f[_0xbccf('0x1a')]?_0x41ea0f['options'][_0xbccf('0x20')]||null:null,'attributes':_0x41ea0f[_0xbccf('0x1a')]?_0x41ea0f['options']['attributes']||null:null,'limit':_0x41ea0f['options']?_0x41ea0f[_0xbccf('0x1a')][_0xbccf('0x21')]||null:null})[_0xbccf('0xe')](function(_0x2c3f1f){logger[_0xbccf('0x16')]('UpdateSquareReport',_0x41ea0f);logger[_0xbccf('0x11')](_0xbccf('0x1d'),_0x41ea0f,JSON[_0xbccf('0x12')](_0x2c3f1f));_0x1ada61(_0x2c3f1f);})[_0xbccf('0x18')](function(_0x26bd90){logger[_0xbccf('0x13')]('UpdateSquareReport',_0x26bd90[_0xbccf('0x15')],_0x41ea0f);_0x2c7156(_0x329759[_0xbccf('0x13')](0x1f4,_0x26bd90[_0xbccf('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 2fd95fa..19b7f8f 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x296e9d,_0x198c9f){var _0x1c3711=function(_0x833fa0){while(--_0x833fa0){_0x296e9d['push'](_0x296e9d['shift']());}};_0x1c3711(++_0x198c9f);}(_0x7a54,0x106));var _0x47a5=function(_0xb44402,_0xfbfbf0){_0xb44402=_0xb44402-0x0;var _0x88a1b0=_0x7a54[_0xb44402];return _0x88a1b0;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file +var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x15d95c,_0x279c4a){var _0x13728b=function(_0x177e19){while(--_0x177e19){_0x15d95c['push'](_0x15d95c['shift']());}};_0x13728b(++_0x279c4a);}(_0x7a54,0x106));var _0x47a5=function(_0x459f11,_0x474cd1){_0x459f11=_0x459f11-0x0;var _0x53a4e9=_0x7a54[_0x459f11];return _0x53a4e9;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index e1db436..8f4bd86 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 _0x9dc6=['sequelize','exports','STRING','TEXT'];(function(_0x3af5c7,_0x44a47a){var _0xe598ea=function(_0x23b5f8){while(--_0x23b5f8){_0x3af5c7['push'](_0x3af5c7['shift']());}};_0xe598ea(++_0x44a47a);}(_0x9dc6,0x68));var _0x69dc=function(_0x9e7dbc,_0x3e3887){_0x9e7dbc=_0x9e7dbc-0x0;var _0xb2f0a7=_0x9dc6[_0x9e7dbc];return _0xb2f0a7;};'use strict';var Sequelize=require(_0x69dc('0x0'));module[_0x69dc('0x1')]={'uniqueid':{'type':Sequelize[_0x69dc('0x2')]},'node':{'type':Sequelize[_0x69dc('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x69dc('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x69dc('0x2')]}}; \ No newline at end of file +var _0xae7a=['sequelize','exports','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xae7a,0x129));var _0xaae7=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0xae7a[_0x2aefb6];return _0x202772;};'use strict';var Sequelize=require(_0xaae7('0x0'));module[_0xaae7('0x1')]={'uniqueid':{'type':Sequelize[_0xaae7('0x2')]},'node':{'type':Sequelize[_0xaae7('0x2')]},'application':{'type':Sequelize[_0xaae7('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xaae7('0x2')]},'callerid':{'type':Sequelize[_0xaae7('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index f1b5688..0eb88dc 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 _0xebda=['params','merge','options','find','create','body','describe','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','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','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','SquareDetailsReport','includeAll','include','catch','show'];(function(_0x3f934e,_0x3b66be){var _0x3ece5b=function(_0x21b6df){while(--_0x21b6df){_0x3f934e['push'](_0x3f934e['shift']());}};_0x3ece5b(++_0x3b66be);}(_0xebda,0x9b));var _0xaebd=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0xebda[_0x256d6a];return _0x460058;};'use strict';var pdf=require(_0xaebd('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaebd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaebd('0x2'));var moment=require(_0xaebd('0x3'));var BPromise=require(_0xaebd('0x4'));var Mustache=require(_0xaebd('0x5'));var util=require('util');var path=require(_0xaebd('0x6'));var sox=require(_0xaebd('0x7'));var csv=require(_0xaebd('0x8'));var ejs=require(_0xaebd('0x9'));var fs=require('fs');var _=require(_0xaebd('0xa'));var squel=require(_0xaebd('0xb'));var crypto=require(_0xaebd('0xc'));var jsforce=require(_0xaebd('0xd'));var deskjs=require(_0xaebd('0xe'));var toCsv=require(_0xaebd('0x8'));var querystring=require(_0xaebd('0xf'));var Papa=require(_0xaebd('0x10'));var Redis=require('ioredis');var authService=require(_0xaebd('0x11'));var qs=require(_0xaebd('0x12'));var as=require(_0xaebd('0x13'));var hardwareService=require(_0xaebd('0x14'));var logger=require('../../config/logger')(_0xaebd('0x15'));var utils=require('../../config/utils');var config=require(_0xaebd('0x16'));var db=require(_0xaebd('0x17'))['db'];function respondWithStatusCode(_0x384e0c,_0x909a63){_0x909a63=_0x909a63||0xcc;return function(_0x25cf2b){if(_0x25cf2b){return _0x384e0c[_0xaebd('0x18')](_0x909a63);}return _0x384e0c[_0xaebd('0x19')](_0x909a63)[_0xaebd('0x1a')]();};}function respondWithResult(_0x14e346,_0x58f580){_0x58f580=_0x58f580||0xc8;return function(_0x49f725){if(_0x49f725){return _0x14e346[_0xaebd('0x19')](_0x58f580)[_0xaebd('0x1b')](_0x49f725);}};}function respondWithFilteredResult(_0x44b71c,_0x46e0){return function(_0xb2d5b2){if(_0xb2d5b2){var _0x572fd4=_0xb2d5b2['count'],_0x4dc648=_0x46e0[_0xaebd('0x1c')],_0x132706=_0x46e0[_0xaebd('0x1c')]+_0x46e0['limit'],_0x2bb931;if(_0x132706>=_0x572fd4){_0x132706=_0x572fd4;_0x2bb931=0xc8;}else{_0x2bb931=0xce;}_0x44b71c[_0xaebd('0x19')](_0x2bb931);return _0x44b71c[_0xaebd('0x1d')](_0xaebd('0x1e'),_0x4dc648+'-'+_0x132706+'/'+_0x572fd4)['json'](_0xb2d5b2);}return null;};}function patchUpdates(_0xcbf29b){return function(_0x48f231){try{jsonpatch[_0xaebd('0x1f')](_0x48f231,_0xcbf29b,!![]);}catch(_0x3a66ba){return BPromise[_0xaebd('0x20')](_0x3a66ba);}return _0x48f231[_0xaebd('0x21')]();};}function saveUpdates(_0x3fc261,_0x9dffa4){return function(_0x398b55){if(_0x398b55){return _0x398b55[_0xaebd('0x22')](_0x3fc261)[_0xaebd('0x23')](function(_0x510c19){return _0x510c19;});}return null;};}function removeEntity(_0x449c35,_0x4957b6){return function(_0x2cc8e3){if(_0x2cc8e3){return _0x2cc8e3[_0xaebd('0x24')]()[_0xaebd('0x23')](function(){_0x449c35['status'](0xcc)[_0xaebd('0x1a')]();});}};}function handleEntityNotFound(_0x4dde88,_0x58c0a3){return function(_0x27767d){if(!_0x27767d){_0x4dde88[_0xaebd('0x18')](0x194);}return _0x27767d;};}function handleError(_0x1cddae,_0x93173b){_0x93173b=_0x93173b||0x1f4;return function(_0x591b72){logger[_0xaebd('0x25')](_0x591b72['stack']);if(_0x591b72['name']){delete _0x591b72['name'];}_0x1cddae[_0xaebd('0x19')](_0x93173b)[_0xaebd('0x26')](_0x591b72);};}exports[_0xaebd('0x27')]=function(_0x5117fe,_0x2978ec){var _0x54766c={},_0x27ca97={},_0x5c8277={'count':0x0,'rows':[]};var _0x4aaeda=_[_0xaebd('0x28')](db['SquareDetailsReport'][_0xaebd('0x29')],function(_0xcf16ab){return{'name':_0xcf16ab[_0xaebd('0x2a')],'type':_0xcf16ab[_0xaebd('0x2b')][_0xaebd('0x2c')]};});_0x27ca97[_0xaebd('0x2d')]=_['map'](_0x4aaeda,_0xaebd('0x2e'));_0x27ca97[_0xaebd('0x2f')]=_[_0xaebd('0x30')](_0x5117fe[_0xaebd('0x2f')]);_0x27ca97[_0xaebd('0x31')]=_[_0xaebd('0x32')](_0x27ca97[_0xaebd('0x2d')],_0x27ca97[_0xaebd('0x2f')]);_0x54766c[_0xaebd('0x33')]=_[_0xaebd('0x32')](_0x27ca97[_0xaebd('0x2d')],qs[_0xaebd('0x34')](_0x5117fe[_0xaebd('0x2f')][_0xaebd('0x34')]));_0x54766c[_0xaebd('0x33')]=_0x54766c[_0xaebd('0x33')][_0xaebd('0x35')]?_0x54766c[_0xaebd('0x33')]:_0x27ca97[_0xaebd('0x2d')];if(!_0x5117fe[_0xaebd('0x2f')][_0xaebd('0x36')]('nolimit')){_0x54766c[_0xaebd('0x37')]=qs[_0xaebd('0x37')](_0x5117fe['query'][_0xaebd('0x37')]);_0x54766c[_0xaebd('0x1c')]=qs[_0xaebd('0x1c')](_0x5117fe['query'][_0xaebd('0x1c')]);}_0x54766c[_0xaebd('0x38')]=qs['sort'](_0x5117fe[_0xaebd('0x2f')][_0xaebd('0x39')]);_0x54766c[_0xaebd('0x3a')]=qs[_0xaebd('0x31')](_[_0xaebd('0x3b')](_0x5117fe[_0xaebd('0x2f')],_0x27ca97[_0xaebd('0x31')]));if(_0x5117fe[_0xaebd('0x2f')][_0xaebd('0x3c')]){_0x54766c[_0xaebd('0x3a')]=_['merge'](_0x54766c[_0xaebd('0x3a')],{'$or':_[_0xaebd('0x28')](_0x4aaeda,function(_0x4bc7e5){if(_0x4bc7e5['type']!==_0xaebd('0x3d')){var _0x272481={};_0x272481[_0x4bc7e5[_0xaebd('0x2e')]]={'$like':'%'+_0x5117fe[_0xaebd('0x2f')][_0xaebd('0x3c')]+'%'};return _0x272481;}})});}_0x54766c=_['merge']({},_0x54766c,_0x5117fe['options']);var _0x44f9b5={'where':_0x54766c[_0xaebd('0x3a')]};return db[_0xaebd('0x3e')]['count'](_0x44f9b5)[_0xaebd('0x23')](function(_0xa6102e){_0x5c8277['count']=_0xa6102e;if(_0x5117fe[_0xaebd('0x2f')][_0xaebd('0x3f')]){_0x54766c[_0xaebd('0x40')]=[{'all':!![]}];}return db[_0xaebd('0x3e')]['findAll'](_0x54766c);})[_0xaebd('0x23')](function(_0x121ec7){_0x5c8277['rows']=_0x121ec7;return _0x5c8277;})['then'](respondWithFilteredResult(_0x2978ec,_0x54766c))[_0xaebd('0x41')](handleError(_0x2978ec,null));};exports[_0xaebd('0x42')]=function(_0x372dc3,_0x3efe82){var _0x3262c0={'raw':!![],'where':{'id':_0x372dc3[_0xaebd('0x43')]['id']}},_0x149aea={};_0x149aea[_0xaebd('0x2d')]=_['keys'](db['SquareDetailsReport'][_0xaebd('0x29')]);_0x149aea[_0xaebd('0x2f')]=_[_0xaebd('0x30')](_0x372dc3[_0xaebd('0x2f')]);_0x149aea[_0xaebd('0x31')]=_[_0xaebd('0x32')](_0x149aea[_0xaebd('0x2d')],_0x149aea[_0xaebd('0x2f')]);_0x3262c0[_0xaebd('0x33')]=_[_0xaebd('0x32')](_0x149aea['model'],qs[_0xaebd('0x34')](_0x372dc3[_0xaebd('0x2f')]['fields']));_0x3262c0[_0xaebd('0x33')]=_0x3262c0[_0xaebd('0x33')][_0xaebd('0x35')]?_0x3262c0[_0xaebd('0x33')]:_0x149aea[_0xaebd('0x2d')];if(_0x372dc3[_0xaebd('0x2f')][_0xaebd('0x3f')]){_0x3262c0[_0xaebd('0x40')]=[{'all':!![]}];}_0x3262c0=_[_0xaebd('0x44')]({},_0x3262c0,_0x372dc3[_0xaebd('0x45')]);return db['SquareDetailsReport'][_0xaebd('0x46')](_0x3262c0)['then'](handleEntityNotFound(_0x3efe82,null))[_0xaebd('0x23')](respondWithResult(_0x3efe82,null))[_0xaebd('0x41')](handleError(_0x3efe82,null));};exports[_0xaebd('0x47')]=function(_0x365dc1,_0x2c49f7){return db[_0xaebd('0x3e')][_0xaebd('0x47')](_0x365dc1[_0xaebd('0x48')],{})[_0xaebd('0x23')](respondWithResult(_0x2c49f7,0xc9))[_0xaebd('0x41')](handleError(_0x2c49f7,null));};exports[_0xaebd('0x22')]=function(_0x392d1a,_0x1ca8ec){if(_0x392d1a[_0xaebd('0x48')]['id']){delete _0x392d1a[_0xaebd('0x48')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x392d1a[_0xaebd('0x43')]['id']}})[_0xaebd('0x23')](handleEntityNotFound(_0x1ca8ec,null))[_0xaebd('0x23')](saveUpdates(_0x392d1a[_0xaebd('0x48')],null))[_0xaebd('0x23')](respondWithResult(_0x1ca8ec,null))['catch'](handleError(_0x1ca8ec,null));};exports[_0xaebd('0x24')]=function(_0x599327,_0x412c72){return db[_0xaebd('0x3e')][_0xaebd('0x46')]({'where':{'id':_0x599327[_0xaebd('0x43')]['id']}})[_0xaebd('0x23')](handleEntityNotFound(_0x412c72,null))['then'](removeEntity(_0x412c72,null))[_0xaebd('0x41')](handleError(_0x412c72,null));};exports[_0xaebd('0x49')]=function(_0x59e9b1,_0x2fc36f){return db[_0xaebd('0x3e')][_0xaebd('0x49')]()[_0xaebd('0x23')](respondWithResult(_0x2fc36f,null))['catch'](handleError(_0x2fc36f,null));}; \ No newline at end of file +var _0xdcb4=['to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json','offset','limit','apply','save','update','then','sendStatus','stack','name','send','index','map','SquareDetailsReport','fieldName','type','key','model','keys','query','intersection','fields','attributes','nolimit','order','sort','filters','pick','where','merge','filter','options','count','includeAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x4c00ea,_0x1cf606){var _0x2754b6=function(_0x2bf125){while(--_0x2bf125){_0x4c00ea['push'](_0x4c00ea['shift']());}};_0x2754b6(++_0x1cf606);}(_0xdcb4,0xc5));var _0x4dcb=function(_0x341fc2,_0x123979){_0x341fc2=_0x341fc2-0x0;var _0x59fd3c=_0xdcb4[_0x341fc2];return _0x59fd3c;};'use strict';var pdf=require(_0x4dcb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4dcb('0x1'));var zipdir=require(_0x4dcb('0x2'));var jsonpatch=require(_0x4dcb('0x3'));var rp=require(_0x4dcb('0x4'));var moment=require(_0x4dcb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4dcb('0x6'));var util=require(_0x4dcb('0x7'));var path=require(_0x4dcb('0x8'));var sox=require(_0x4dcb('0x9'));var csv=require(_0x4dcb('0xa'));var ejs=require(_0x4dcb('0xb'));var fs=require('fs');var _=require(_0x4dcb('0xc'));var squel=require('squel');var crypto=require(_0x4dcb('0xd'));var jsforce=require(_0x4dcb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4dcb('0xa'));var querystring=require(_0x4dcb('0xf'));var Papa=require('papaparse');var Redis=require(_0x4dcb('0x10'));var authService=require(_0x4dcb('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4dcb('0x12'));var logger=require(_0x4dcb('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4dcb('0x14'))['db'];function respondWithStatusCode(_0x3bf2b0,_0x36d1f6){_0x36d1f6=_0x36d1f6||0xcc;return function(_0x3cc9ce){if(_0x3cc9ce){return _0x3bf2b0['sendStatus'](_0x36d1f6);}return _0x3bf2b0[_0x4dcb('0x15')](_0x36d1f6)[_0x4dcb('0x16')]();};}function respondWithResult(_0x5d2ca1,_0x26699e){_0x26699e=_0x26699e||0xc8;return function(_0x19c74d){if(_0x19c74d){return _0x5d2ca1[_0x4dcb('0x15')](_0x26699e)[_0x4dcb('0x17')](_0x19c74d);}};}function respondWithFilteredResult(_0x1052be,_0x348fda){return function(_0x512009){if(_0x512009){var _0x717ef3=_0x512009['count'],_0x3ab221=_0x348fda[_0x4dcb('0x18')],_0x4b9ed5=_0x348fda['offset']+_0x348fda[_0x4dcb('0x19')],_0x22c50d;if(_0x4b9ed5>=_0x717ef3){_0x4b9ed5=_0x717ef3;_0x22c50d=0xc8;}else{_0x22c50d=0xce;}_0x1052be[_0x4dcb('0x15')](_0x22c50d);return _0x1052be['set']('Content-Range',_0x3ab221+'-'+_0x4b9ed5+'/'+_0x717ef3)[_0x4dcb('0x17')](_0x512009);}return null;};}function patchUpdates(_0x2fd44f){return function(_0x3ebe84){try{jsonpatch[_0x4dcb('0x1a')](_0x3ebe84,_0x2fd44f,!![]);}catch(_0x5e9644){return BPromise['reject'](_0x5e9644);}return _0x3ebe84[_0x4dcb('0x1b')]();};}function saveUpdates(_0x5aabe6,_0x326cca){return function(_0x4d6f48){if(_0x4d6f48){return _0x4d6f48[_0x4dcb('0x1c')](_0x5aabe6)[_0x4dcb('0x1d')](function(_0x533bae){return _0x533bae;});}return null;};}function removeEntity(_0x18eedf,_0x69064e){return function(_0x24a305){if(_0x24a305){return _0x24a305['destroy']()['then'](function(){_0x18eedf[_0x4dcb('0x15')](0xcc)[_0x4dcb('0x16')]();});}};}function handleEntityNotFound(_0x570479,_0x57c490){return function(_0x3e8372){if(!_0x3e8372){_0x570479[_0x4dcb('0x1e')](0x194);}return _0x3e8372;};}function handleError(_0x2f7335,_0x5d0629){_0x5d0629=_0x5d0629||0x1f4;return function(_0x5bd123){logger['error'](_0x5bd123[_0x4dcb('0x1f')]);if(_0x5bd123['name']){delete _0x5bd123[_0x4dcb('0x20')];}_0x2f7335[_0x4dcb('0x15')](_0x5d0629)[_0x4dcb('0x21')](_0x5bd123);};}exports[_0x4dcb('0x22')]=function(_0x469757,_0x566151){var _0x15f578={},_0x56565e={},_0x562f3f={'count':0x0,'rows':[]};var _0x1a4e7d=_[_0x4dcb('0x23')](db[_0x4dcb('0x24')]['rawAttributes'],function(_0x277100){return{'name':_0x277100[_0x4dcb('0x25')],'type':_0x277100[_0x4dcb('0x26')][_0x4dcb('0x27')]};});_0x56565e[_0x4dcb('0x28')]=_[_0x4dcb('0x23')](_0x1a4e7d,_0x4dcb('0x20'));_0x56565e['query']=_[_0x4dcb('0x29')](_0x469757[_0x4dcb('0x2a')]);_0x56565e['filters']=_[_0x4dcb('0x2b')](_0x56565e[_0x4dcb('0x28')],_0x56565e[_0x4dcb('0x2a')]);_0x15f578['attributes']=_['intersection'](_0x56565e['model'],qs[_0x4dcb('0x2c')](_0x469757[_0x4dcb('0x2a')][_0x4dcb('0x2c')]));_0x15f578[_0x4dcb('0x2d')]=_0x15f578[_0x4dcb('0x2d')]['length']?_0x15f578[_0x4dcb('0x2d')]:_0x56565e[_0x4dcb('0x28')];if(!_0x469757[_0x4dcb('0x2a')]['hasOwnProperty'](_0x4dcb('0x2e'))){_0x15f578[_0x4dcb('0x19')]=qs[_0x4dcb('0x19')](_0x469757[_0x4dcb('0x2a')][_0x4dcb('0x19')]);_0x15f578['offset']=qs['offset'](_0x469757[_0x4dcb('0x2a')][_0x4dcb('0x18')]);}_0x15f578[_0x4dcb('0x2f')]=qs['sort'](_0x469757[_0x4dcb('0x2a')][_0x4dcb('0x30')]);_0x15f578['where']=qs[_0x4dcb('0x31')](_[_0x4dcb('0x32')](_0x469757[_0x4dcb('0x2a')],_0x56565e[_0x4dcb('0x31')]));if(_0x469757[_0x4dcb('0x2a')]['filter']){_0x15f578[_0x4dcb('0x33')]=_[_0x4dcb('0x34')](_0x15f578[_0x4dcb('0x33')],{'$or':_[_0x4dcb('0x23')](_0x1a4e7d,function(_0x4e16b9){if(_0x4e16b9['type']!=='VIRTUAL'){var _0x506d96={};_0x506d96[_0x4e16b9['name']]={'$like':'%'+_0x469757[_0x4dcb('0x2a')][_0x4dcb('0x35')]+'%'};return _0x506d96;}})});}_0x15f578=_[_0x4dcb('0x34')]({},_0x15f578,_0x469757[_0x4dcb('0x36')]);var _0x34f3c1={'where':_0x15f578[_0x4dcb('0x33')]};return db[_0x4dcb('0x24')][_0x4dcb('0x37')](_0x34f3c1)[_0x4dcb('0x1d')](function(_0x3cbf87){_0x562f3f['count']=_0x3cbf87;if(_0x469757['query'][_0x4dcb('0x38')]){_0x15f578['include']=[{'all':!![]}];}return db[_0x4dcb('0x24')]['findAll'](_0x15f578);})[_0x4dcb('0x1d')](function(_0x29b6d0){_0x562f3f[_0x4dcb('0x39')]=_0x29b6d0;return _0x562f3f;})[_0x4dcb('0x1d')](respondWithFilteredResult(_0x566151,_0x15f578))[_0x4dcb('0x3a')](handleError(_0x566151,null));};exports[_0x4dcb('0x3b')]=function(_0x2f4ac0,_0xf8ee51){var _0x335c7c={'raw':!![],'where':{'id':_0x2f4ac0[_0x4dcb('0x3c')]['id']}},_0x211d4f={};_0x211d4f['model']=_[_0x4dcb('0x29')](db[_0x4dcb('0x24')][_0x4dcb('0x3d')]);_0x211d4f[_0x4dcb('0x2a')]=_[_0x4dcb('0x29')](_0x2f4ac0[_0x4dcb('0x2a')]);_0x211d4f[_0x4dcb('0x31')]=_[_0x4dcb('0x2b')](_0x211d4f['model'],_0x211d4f[_0x4dcb('0x2a')]);_0x335c7c[_0x4dcb('0x2d')]=_[_0x4dcb('0x2b')](_0x211d4f['model'],qs['fields'](_0x2f4ac0[_0x4dcb('0x2a')][_0x4dcb('0x2c')]));_0x335c7c['attributes']=_0x335c7c['attributes'][_0x4dcb('0x3e')]?_0x335c7c[_0x4dcb('0x2d')]:_0x211d4f[_0x4dcb('0x28')];if(_0x2f4ac0[_0x4dcb('0x2a')][_0x4dcb('0x38')]){_0x335c7c[_0x4dcb('0x3f')]=[{'all':!![]}];}_0x335c7c=_[_0x4dcb('0x34')]({},_0x335c7c,_0x2f4ac0[_0x4dcb('0x36')]);return db[_0x4dcb('0x24')][_0x4dcb('0x40')](_0x335c7c)[_0x4dcb('0x1d')](handleEntityNotFound(_0xf8ee51,null))[_0x4dcb('0x1d')](respondWithResult(_0xf8ee51,null))[_0x4dcb('0x3a')](handleError(_0xf8ee51,null));};exports['create']=function(_0x54179a,_0xeda7b){return db['SquareDetailsReport'][_0x4dcb('0x41')](_0x54179a[_0x4dcb('0x42')],{})[_0x4dcb('0x1d')](respondWithResult(_0xeda7b,0xc9))[_0x4dcb('0x3a')](handleError(_0xeda7b,null));};exports[_0x4dcb('0x1c')]=function(_0x260592,_0x5e28b9){if(_0x260592[_0x4dcb('0x42')]['id']){delete _0x260592['body']['id'];}return db[_0x4dcb('0x24')][_0x4dcb('0x40')]({'where':{'id':_0x260592['params']['id']}})['then'](handleEntityNotFound(_0x5e28b9,null))['then'](saveUpdates(_0x260592[_0x4dcb('0x42')],null))[_0x4dcb('0x1d')](respondWithResult(_0x5e28b9,null))[_0x4dcb('0x3a')](handleError(_0x5e28b9,null));};exports[_0x4dcb('0x43')]=function(_0x36345e,_0x36af0c){return db[_0x4dcb('0x24')]['find']({'where':{'id':_0x36345e['params']['id']}})[_0x4dcb('0x1d')](handleEntityNotFound(_0x36af0c,null))[_0x4dcb('0x1d')](removeEntity(_0x36af0c,null))[_0x4dcb('0x3a')](handleError(_0x36af0c,null));};exports[_0x4dcb('0x44')]=function(_0xe52b15,_0x11fcfa){return db[_0x4dcb('0x24')]['describe']()['then'](respondWithResult(_0x11fcfa,null))['catch'](handleError(_0x11fcfa,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index bc7a071..5304c77 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 _0x171c=['./squareReportDetail.attributes','exports','report_square_details','../../config/logger','api','moment','request-promise','path'];(function(_0x4ba3c4,_0x24842d){var _0x2b6605=function(_0xc2698f){while(--_0xc2698f){_0x4ba3c4['push'](_0x4ba3c4['shift']());}};_0x2b6605(++_0x24842d);}(_0x171c,0x8b));var _0xc171=function(_0x4b3a31,_0x54af71){_0x4b3a31=_0x4b3a31-0x0;var _0x92ff9f=_0x171c[_0x4b3a31];return _0x92ff9f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc171('0x0'))(_0xc171('0x1'));var moment=require(_0xc171('0x2'));var BPromise=require('bluebird');var rp=require(_0xc171('0x3'));var fs=require('fs');var path=require(_0xc171('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc171('0x5'));module[_0xc171('0x6')]=function(_0x514447,_0x4e463f){return _0x514447['define']('SquareDetailsReport',attributes,{'tableName':_0xc171('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf524=['../../config/environment','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3cc47c,_0x1e59e2){var _0x1fe90f=function(_0x1c024b){while(--_0x1c024b){_0x3cc47c['push'](_0x3cc47c['shift']());}};_0x1fe90f(++_0x1e59e2);}(_0xf524,0x14a));var _0x4f52=function(_0x1cbcb2,_0x1237a3){_0x1cbcb2=_0x1cbcb2-0x0;var _0x41ac9f=_0xf524[_0x1cbcb2];return _0x41ac9f;};'use strict';var _=require(_0x4f52('0x0'));var util=require('util');var logger=require(_0x4f52('0x1'))(_0x4f52('0x2'));var moment=require(_0x4f52('0x3'));var BPromise=require(_0x4f52('0x4'));var rp=require(_0x4f52('0x5'));var fs=require('fs');var path=require(_0x4f52('0x6'));var rimraf=require(_0x4f52('0x7'));var config=require(_0x4f52('0x8'));var attributes=require('./squareReportDetail.attributes');module[_0x4f52('0x9')]=function(_0x1a61a1,_0x45fbbd){return _0x1a61a1[_0x4f52('0xa')](_0x4f52('0xb'),attributes,{'tableName':_0x4f52('0xc'),'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 7ad600c..ba1a610 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 _0x7377=['client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','raw','CreateSquareDetailsReport','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x33cf02,_0x3d5b3d){var _0x3cc4a9=function(_0x1981ad){while(--_0x1981ad){_0x33cf02['push'](_0x33cf02['shift']());}};_0x3cc4a9(++_0x3d5b3d);}(_0x7377,0xfd));var _0x7737=function(_0x3065df,_0x4fb225){_0x3065df=_0x3065df-0x0;var _0x23c9b0=_0x7377[_0x3065df];return _0x23c9b0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7737('0x0'));var rs=require(_0x7737('0x1'));var fs=require('fs');var Redis=require(_0x7737('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7737('0x3'));var logger=require(_0x7737('0x4'))(_0x7737('0x5'));var config=require(_0x7737('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7737('0x7')][_0x7737('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34680b,_0x39cce8,_0x379f3a){return new BPromise(function(_0x41bca5,_0x54e9b3){return client[_0x7737('0x9')](_0x34680b,_0x379f3a)[_0x7737('0xa')](function(_0x174528){logger[_0x7737('0xb')](_0x7737('0xc'),_0x39cce8,_0x7737('0xd'));logger[_0x7737('0xe')](_0x7737('0xf'),_0x39cce8,'request\x20sent',JSON[_0x7737('0x10')](_0x174528));if(_0x174528['error']){if(_0x174528[_0x7737('0x11')][_0x7737('0x12')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x39cce8,_0x174528[_0x7737('0x11')][_0x7737('0x13')]);return _0x54e9b3(_0x174528['error'][_0x7737('0x13')]);}logger[_0x7737('0x11')](_0x7737('0xc'),_0x39cce8,_0x174528[_0x7737('0x11')][_0x7737('0x13')]);return _0x41bca5(_0x174528['error'][_0x7737('0x13')]);}else{logger['info'](_0x7737('0xc'),_0x39cce8,'request\x20sent');_0x41bca5(_0x174528[_0x7737('0x14')][_0x7737('0x13')]);}})[_0x7737('0x15')](function(_0x566a9d){logger[_0x7737('0x11')](_0x7737('0xc'),_0x39cce8,_0x566a9d);_0x54e9b3(_0x566a9d);});});}exports['CreateSquareDetailsReport']=function(_0x408786){var _0x5500f5=this;return new Promise(function(_0x11dcfa,_0x224782){return db['SquareDetailsReport']['create'](_0x408786[_0x7737('0x16')],{'raw':_0x408786[_0x7737('0x17')]?_0x408786[_0x7737('0x17')][_0x7737('0x18')]===undefined?!![]:![]:!![]})[_0x7737('0xa')](function(_0xb46752){logger[_0x7737('0xb')](_0x7737('0x19'),_0x408786);logger[_0x7737('0xe')]('CreateSquareDetailsReport',_0x408786,JSON[_0x7737('0x10')](_0xb46752));_0x11dcfa(_0xb46752);})['catch'](function(_0x22a012){logger['error'](_0x7737('0x19'),_0x22a012['message'],_0x408786);_0x224782(_0x5500f5['error'](0x1f4,_0x22a012[_0x7737('0x13')]));});});}; \ No newline at end of file +var _0x6621=['info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4bb2b9,_0x459c78){var _0x40e2a2=function(_0x19a26c){while(--_0x19a26c){_0x4bb2b9['push'](_0x4bb2b9['shift']());}};_0x40e2a2(++_0x459c78);}(_0x6621,0x13b));var _0x1662=function(_0x398d76,_0x525c04){_0x398d76=_0x398d76-0x0;var _0x521007=_0x6621[_0x398d76];return _0x521007;};'use strict';var _=require(_0x1662('0x0'));var util=require(_0x1662('0x1'));var moment=require(_0x1662('0x2'));var BPromise=require('bluebird');var rs=require(_0x1662('0x3'));var fs=require('fs');var Redis=require(_0x1662('0x4'));var db=require(_0x1662('0x5'))['db'];var utils=require(_0x1662('0x6'));var logger=require(_0x1662('0x7'))(_0x1662('0x8'));var config=require(_0x1662('0x9'));var jayson=require(_0x1662('0xa'));var client=jayson[_0x1662('0xb')][_0x1662('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc7e64f,_0x267fbe,_0x3e5947){return new BPromise(function(_0x37cb19,_0x46a9a2){return client[_0x1662('0xd')](_0xc7e64f,_0x3e5947)[_0x1662('0xe')](function(_0x556eaa){logger[_0x1662('0xf')](_0x1662('0x10'),_0x267fbe,_0x1662('0x11'));logger[_0x1662('0x12')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x267fbe,_0x1662('0x11'),JSON[_0x1662('0x13')](_0x556eaa));if(_0x556eaa[_0x1662('0x14')]){if(_0x556eaa['error'][_0x1662('0x15')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x267fbe,_0x556eaa['error'][_0x1662('0x16')]);return _0x46a9a2(_0x556eaa[_0x1662('0x14')]['message']);}logger['error'](_0x1662('0x10'),_0x267fbe,_0x556eaa['error'][_0x1662('0x16')]);return _0x37cb19(_0x556eaa[_0x1662('0x14')][_0x1662('0x16')]);}else{logger[_0x1662('0xf')](_0x1662('0x10'),_0x267fbe,'request\x20sent');_0x37cb19(_0x556eaa[_0x1662('0x17')][_0x1662('0x16')]);}})[_0x1662('0x18')](function(_0x442b93){logger['error'](_0x1662('0x10'),_0x267fbe,_0x442b93);_0x46a9a2(_0x442b93);});});}exports[_0x1662('0x19')]=function(_0x1a6f5e){var _0x1ad410=this;return new Promise(function(_0x73da03,_0x177e77){return db['SquareDetailsReport'][_0x1662('0x1a')](_0x1a6f5e[_0x1662('0x1b')],{'raw':_0x1a6f5e[_0x1662('0x1c')]?_0x1a6f5e[_0x1662('0x1c')][_0x1662('0x1d')]===undefined?!![]:![]:!![]})[_0x1662('0xe')](function(_0x14acf0){logger[_0x1662('0xf')](_0x1662('0x19'),_0x1a6f5e);logger[_0x1662('0x12')](_0x1662('0x19'),_0x1a6f5e,JSON[_0x1662('0x13')](_0x14acf0));_0x73da03(_0x14acf0);})['catch'](function(_0x250010){logger['error'](_0x1662('0x19'),_0x250010[_0x1662('0x16')],_0x1a6f5e);_0x177e77(_0x1ad410[_0x1662('0x14')](0x1f4,_0x250010[_0x1662('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index dad2940..e05bfba 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 _0xdfc0=['/process/:pid/kill','killProcess','express','../../components/auth/service','./system.controller','get','isAuthenticated','index'];(function(_0x4fccef,_0x126309){var _0x29fe25=function(_0x1841a1){while(--_0x1841a1){_0x4fccef['push'](_0x4fccef['shift']());}};_0x29fe25(++_0x126309);}(_0xdfc0,0x1aa));var _0x0dfc=function(_0x5d73c2,_0x561964){_0x5d73c2=_0x5d73c2-0x0;var _0xedcce5=_0xdfc0[_0x5d73c2];return _0xedcce5;};'use strict';var express=require(_0x0dfc('0x0'));var router=express['Router']();var auth=require(_0x0dfc('0x1'));var controller=require(_0x0dfc('0x2'));router[_0x0dfc('0x3')]('/',auth[_0x0dfc('0x4')](),controller[_0x0dfc('0x5')]);router[_0x0dfc('0x3')](_0x0dfc('0x6'),auth['isAuthenticated'](),controller[_0x0dfc('0x7')]);module['exports']=router; \ No newline at end of file +var _0x5e22=['get','isAuthenticated','/process/:pid/kill','killProcess','exports','Router','./system.controller'];(function(_0x2d7a4b,_0xa36b04){var _0x603707=function(_0x498947){while(--_0x498947){_0x2d7a4b['push'](_0x2d7a4b['shift']());}};_0x603707(++_0xa36b04);}(_0x5e22,0x132));var _0x25e2=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x5e22[_0x599e60];return _0x468e19;};'use strict';var express=require('express');var router=express[_0x25e2('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x25e2('0x1'));router[_0x25e2('0x2')]('/',auth[_0x25e2('0x3')](),controller['index']);router[_0x25e2('0x2')](_0x25e2('0x4'),auth[_0x25e2('0x3')](),controller[_0x25e2('0x5')]);module[_0x25e2('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index fed22b9..9838b08 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 _0x1398=['ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','bluebird','inspect','status','index','getAllData','then','json','catch','killProcess','components/import/cm','format'];(function(_0x1f6f84,_0x2bab55){var _0x177f40=function(_0x384ab4){while(--_0x384ab4){_0x1f6f84['push'](_0x1f6f84['shift']());}};_0x177f40(++_0x2bab55);}(_0x1398,0xd7));var _0x8139=function(_0x4a821f,_0x290f50){_0x4a821f=_0x4a821f-0x0;var _0x262e2b=_0x1398[_0x4a821f];return _0x262e2b;};'use strict';var info=require(_0x8139('0x0'));var exec=require(_0x8139('0x1'))[_0x8139('0x2')];var logger=require(_0x8139('0x3'))('api');var util=require('util');var BPromise=require(_0x8139('0x4'));var _=require('lodash');function handleError(_0x51ff25,_0x26fd32,_0x37e847){_0x26fd32=_0x26fd32||0x1f4;return function(_0x403135){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x37e847,_0x26fd32,util[_0x8139('0x5')](_0x403135,{'showHidden':![],'depth':null}));delete _0x403135['name'];_0x51ff25[_0x8139('0x6')](_0x26fd32)['send'](_0x403135);};}exports[_0x8139('0x7')]=function(_0x4efa52,_0x3f57df){return info[_0x8139('0x8')]()[_0x8139('0x9')](function(_0x5dd9d5){return _0x3f57df[_0x8139('0x6')](0xc8)[_0x8139('0xa')](_0x5dd9d5);})[_0x8139('0xb')](function(_0x44ac97){return _0x3f57df[_0x8139('0x6')](0x1f4)[_0x8139('0xa')](_0x44ac97);});};exports[_0x8139('0xc')]=function(_0x3bc5a7,_0xe11b95){var _0x209a3a=[_0x8139('0xd')];return new BPromise(function(_0x1525bc,_0x3017b1){return exec(util[_0x8139('0xe')](_0x8139('0xf'),_0x3bc5a7[_0x8139('0x10')]['pid']),function(_0x1c6bd7,_0x270c1a,_0x432703){if(_0x1c6bd7){return _0x3017b1(_0x1c6bd7);}return _0x1525bc(_0x270c1a);});})[_0x8139('0x9')](function(_0x5782c0){var _0x4b7a2d=![];var _0x57f6a2=_0x5782c0['split'](/\n/);for(var _0xd3b4d=0x0,_0x35cc83=_0x209a3a[_0x8139('0x11')];_0xd3b4d<_0x35cc83,_0x4b7a2d===![];_0xd3b4d+=0x1){if(_0x5782c0[_0x8139('0x12')](_0x209a3a[_0xd3b4d])>=0x0){_0x4b7a2d=!![];}}if(!_0x4b7a2d){throw new Error(util[_0x8139('0xe')](_0x8139('0x13'),_0x3bc5a7[_0x8139('0x10')]['pid']));}process['kill'](_0x3bc5a7[_0x8139('0x10')][_0x8139('0x14')],_0x8139('0x15'));return _0xe11b95[_0x8139('0x6')](0xc8)[_0x8139('0xa')]({'message':util[_0x8139('0xe')](_0x8139('0x16'),_0x3bc5a7[_0x8139('0x10')][_0x8139('0x14')])});})[_0x8139('0xb')](handleError(_0xe11b95,null,_0x8139('0xc')));}; \ No newline at end of file +var _0xa958=['pid','then','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','bluebird','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params'];(function(_0x1e4e22,_0x567aad){var _0x5a26ea=function(_0x1f9afd){while(--_0x1f9afd){_0x1e4e22['push'](_0x1e4e22['shift']());}};_0x5a26ea(++_0x567aad);}(_0xa958,0x116));var _0x8a95=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa958[_0x56482c];return _0x5aae7a;};'use strict';var info=require(_0x8a95('0x0'));var exec=require(_0x8a95('0x1'))[_0x8a95('0x2')];var logger=require(_0x8a95('0x3'))(_0x8a95('0x4'));var util=require('util');var BPromise=require(_0x8a95('0x5'));var _=require('lodash');function handleError(_0x380436,_0x36b3ae,_0x2411d3){_0x36b3ae=_0x36b3ae||0x1f4;return function(_0x304fb7){logger['error'](_0x8a95('0x6'),_0x2411d3,_0x36b3ae,util[_0x8a95('0x7')](_0x304fb7,{'showHidden':![],'depth':null}));delete _0x304fb7[_0x8a95('0x8')];_0x380436[_0x8a95('0x9')](_0x36b3ae)[_0x8a95('0xa')](_0x304fb7);};}exports['index']=function(_0x3b9d23,_0x2bbc1e){return info[_0x8a95('0xb')]()['then'](function(_0x20073b){return _0x2bbc1e[_0x8a95('0x9')](0xc8)[_0x8a95('0xc')](_0x20073b);})[_0x8a95('0xd')](function(_0x3f38f8){return _0x2bbc1e[_0x8a95('0x9')](0x1f4)[_0x8a95('0xc')](_0x3f38f8);});};exports[_0x8a95('0xe')]=function(_0x1efb5c,_0x26a36f){var _0x3429d9=[_0x8a95('0xf')];return new BPromise(function(_0x5e599f,_0x4bb348){return exec(util[_0x8a95('0x10')](_0x8a95('0x11'),_0x1efb5c[_0x8a95('0x12')][_0x8a95('0x13')]),function(_0x441457,_0x28db06,_0x588acd){if(_0x441457){return _0x4bb348(_0x441457);}return _0x5e599f(_0x28db06);});})[_0x8a95('0x14')](function(_0x2a4f97){var _0x304e0e=![];var _0x113691=_0x2a4f97[_0x8a95('0x15')](/\n/);for(var _0x239e27=0x0,_0x2335fa=_0x3429d9['length'];_0x239e27<_0x2335fa,_0x304e0e===![];_0x239e27+=0x1){if(_0x2a4f97[_0x8a95('0x16')](_0x3429d9[_0x239e27])>=0x0){_0x304e0e=!![];}}if(!_0x304e0e){throw new Error(util['format'](_0x8a95('0x17'),_0x1efb5c['params'][_0x8a95('0x13')]));}process[_0x8a95('0x18')](_0x1efb5c['params'][_0x8a95('0x13')],_0x8a95('0x19'));return _0x26a36f[_0x8a95('0x9')](0xc8)['json']({'message':util['format'](_0x8a95('0x1a'),_0x1efb5c[_0x8a95('0x12')][_0x8a95('0x13')])});})['catch'](handleError(_0x26a36f,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index cef70c0..4048119 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 _0x5b02=['get','isAuthenticated','index','/:id','post','put','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./tag.controller'];(function(_0x20804b,_0x3374d9){var _0x19905a=function(_0x1d5527){while(--_0x1d5527){_0x20804b['push'](_0x20804b['shift']());}};_0x19905a(++_0x3374d9);}(_0x5b02,0xe9));var _0x25b0=function(_0x3b2340,_0x161933){_0x3b2340=_0x3b2340-0x0;var _0x5a528e=_0x5b02[_0x3b2340];return _0x5a528e;};'use strict';var multer=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var path=require(_0x25b0('0x2'));var timeout=require(_0x25b0('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x25b0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x25b0('0x5'));var controller=require(_0x25b0('0x6'));router[_0x25b0('0x7')]('/',auth[_0x25b0('0x8')](),controller[_0x25b0('0x9')]);router['get'](_0x25b0('0xa'),auth[_0x25b0('0x8')](),controller['show']);router[_0x25b0('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x25b0('0xc')](_0x25b0('0xa'),auth[_0x25b0('0x8')](),controller['update']);router[_0x25b0('0xd')](_0x25b0('0xa'),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);module[_0x25b0('0xf')]=router; \ No newline at end of file +var _0x2dae=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x30feae,_0x63bf96){var _0x3975d4=function(_0x38dff9){while(--_0x38dff9){_0x30feae['push'](_0x30feae['shift']());}};_0x3975d4(++_0x63bf96);}(_0x2dae,0xc3));var _0xe2da=function(_0x34b87f,_0x28aef2){_0x34b87f=_0x34b87f-0x0;var _0x449805=_0x2dae[_0x34b87f];return _0x449805;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var auth=require(_0xe2da('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe2da('0x6'));var controller=require(_0xe2da('0x7'));router[_0xe2da('0x8')]('/',auth[_0xe2da('0x9')](),controller['index']);router[_0xe2da('0x8')](_0xe2da('0xa'),auth[_0xe2da('0x9')](),controller[_0xe2da('0xb')]);router[_0xe2da('0xc')]('/',auth[_0xe2da('0x9')](),controller[_0xe2da('0xd')]);router[_0xe2da('0xe')](_0xe2da('0xa'),auth['isAuthenticated'](),controller[_0xe2da('0xf')]);router[_0xe2da('0x10')](_0xe2da('0xa'),auth[_0xe2da('0x9')](),controller[_0xe2da('0x11')]);module[_0xe2da('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 81ba2de..459d7ce 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 _0xb688=['STRING','name','#0091EA','exports'];(function(_0xc72b24,_0x3dc1fd){var _0x23ef2c=function(_0x4dfab5){while(--_0x4dfab5){_0xc72b24['push'](_0xc72b24['shift']());}};_0x23ef2c(++_0x3dc1fd);}(_0xb688,0xcf));var _0x8b68=function(_0xd3873d,_0x5167e3){_0xd3873d=_0xd3873d-0x0;var _0x538781=_0xb688[_0xd3873d];return _0x538781;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'name':{'type':Sequelize[_0x8b68('0x1')],'unique':_0x8b68('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8b68('0x1')],'defaultValue':_0x8b68('0x3')},'description':{'type':Sequelize[_0x8b68('0x1')]}}; \ No newline at end of file +var _0x878f=['STRING','name','#0091EA','exports'];(function(_0x5b7937,_0x1aa516){var _0x2c2d57=function(_0x1fd4b2){while(--_0x1fd4b2){_0x5b7937['push'](_0x5b7937['shift']());}};_0x2c2d57(++_0x1aa516);}(_0x878f,0x173));var _0xf878=function(_0x27c8ad,_0x173106){_0x27c8ad=_0x27c8ad-0x0;var _0x2ad205=_0x878f[_0x27c8ad];return _0x2ad205;};'use strict';var Sequelize=require('sequelize');module[_0xf878('0x0')]={'name':{'type':Sequelize[_0xf878('0x1')],'unique':_0xf878('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf878('0x1')],'defaultValue':_0xf878('0x3')},'description':{'type':Sequelize[_0xf878('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 1eb8ab6..18c9671 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 _0x78f7=['find','create','body','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','get','Tags','UserProfileResource','then','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','query','intersection','attributes','fields','length','model','hasOwnProperty','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','keys'];(function(_0x1b55be,_0x4d7430){var _0x4b0538=function(_0x45024d){while(--_0x45024d){_0x1b55be['push'](_0x1b55be['shift']());}};_0x4b0538(++_0x4d7430);}(_0x78f7,0xe2));var _0x778f=function(_0x205433,_0x52cc09){_0x205433=_0x205433-0x0;var _0x3afbc9=_0x78f7[_0x205433];return _0x3afbc9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x778f('0x0'));var rimraf=require(_0x778f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x778f('0x2'));var rp=require(_0x778f('0x3'));var moment=require('moment');var BPromise=require(_0x778f('0x4'));var Mustache=require(_0x778f('0x5'));var util=require(_0x778f('0x6'));var path=require('path');var sox=require(_0x778f('0x7'));var csv=require('to-csv');var ejs=require(_0x778f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x778f('0x9'));var crypto=require(_0x778f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x778f('0xb'));var toCsv=require(_0x778f('0xc'));var querystring=require(_0x778f('0xd'));var Papa=require(_0x778f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x778f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x778f('0x10'));var logger=require(_0x778f('0x11'))(_0x778f('0x12'));var utils=require(_0x778f('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x370120,_0x267069){_0x267069=_0x267069||0xcc;return function(_0x2f0c51){if(_0x2f0c51){return _0x370120[_0x778f('0x14')](_0x267069);}return _0x370120[_0x778f('0x15')](_0x267069)[_0x778f('0x16')]();};}function respondWithResult(_0x16ff42,_0x331c35){_0x331c35=_0x331c35||0xc8;return function(_0x27c2d2){if(_0x27c2d2){return _0x16ff42['status'](_0x331c35)[_0x778f('0x17')](_0x27c2d2);}};}function respondWithFilteredResult(_0x4f7335,_0x1d484b){return function(_0x169e1b){if(_0x169e1b){var _0x11fd6a=_0x169e1b[_0x778f('0x18')],_0x582ceb=_0x1d484b['offset'],_0x2a5da4=_0x1d484b[_0x778f('0x19')]+_0x1d484b[_0x778f('0x1a')],_0x1c6d29;if(_0x2a5da4>=_0x11fd6a){_0x2a5da4=_0x11fd6a;_0x1c6d29=0xc8;}else{_0x1c6d29=0xce;}_0x4f7335[_0x778f('0x15')](_0x1c6d29);return _0x4f7335[_0x778f('0x1b')](_0x778f('0x1c'),_0x582ceb+'-'+_0x2a5da4+'/'+_0x11fd6a)[_0x778f('0x17')](_0x169e1b);}return null;};}function patchUpdates(_0xabcbb7){return function(_0x34bee3){try{jsonpatch[_0x778f('0x1d')](_0x34bee3,_0xabcbb7,!![]);}catch(_0x37dc0a){return BPromise['reject'](_0x37dc0a);}return _0x34bee3[_0x778f('0x1e')]();};}function saveUpdates(_0x4725d3,_0x32c453){return function(_0xf59134){if(_0xf59134){return _0xf59134['update'](_0x4725d3)['then'](function(_0x1640bd){return _0x1640bd;});}return null;};}function removeEntity(_0xfe9671,_0x4768be){return function(_0x464451){if(_0x464451){return _0x464451[_0x778f('0x1f')]()['then'](function(){var _0xd6405=_0x464451[_0x778f('0x20')]({'plain':!![]});var _0x457c9c=_0x778f('0x21');return db[_0x778f('0x22')][_0x778f('0x1f')]({'where':{'type':_0x457c9c,'resourceId':_0xd6405['id']}})[_0x778f('0x23')](function(){return _0x464451;});})['then'](function(){_0xfe9671[_0x778f('0x15')](0xcc)[_0x778f('0x16')]();});}};}function handleEntityNotFound(_0x1f1d7a,_0x3a5aff){return function(_0x227461){if(!_0x227461){_0x1f1d7a[_0x778f('0x14')](0x194);}return _0x227461;};}function handleError(_0x50e503,_0x17c9bd){_0x17c9bd=_0x17c9bd||0x1f4;return function(_0x223394){logger['error'](_0x223394[_0x778f('0x24')]);if(_0x223394[_0x778f('0x25')]){delete _0x223394[_0x778f('0x25')];}_0x50e503[_0x778f('0x15')](_0x17c9bd)[_0x778f('0x26')](_0x223394);};}exports['index']=function(_0x435884,_0x3d1c1e){var _0x2e2c7c={},_0x400046={},_0x55fb2c={'count':0x0,'rows':[]};var _0xc528ea=_[_0x778f('0x27')](db[_0x778f('0x28')][_0x778f('0x29')],function(_0x280112){return{'name':_0x280112[_0x778f('0x2a')],'type':_0x280112[_0x778f('0x2b')][_0x778f('0x2c')]};});_0x400046['model']=_[_0x778f('0x27')](_0xc528ea,_0x778f('0x25'));_0x400046['query']=_['keys'](_0x435884[_0x778f('0x2d')]);_0x400046['filters']=_[_0x778f('0x2e')](_0x400046['model'],_0x400046[_0x778f('0x2d')]);_0x2e2c7c[_0x778f('0x2f')]=_[_0x778f('0x2e')](_0x400046['model'],qs[_0x778f('0x30')](_0x435884[_0x778f('0x2d')]['fields']));_0x2e2c7c[_0x778f('0x2f')]=_0x2e2c7c[_0x778f('0x2f')][_0x778f('0x31')]?_0x2e2c7c[_0x778f('0x2f')]:_0x400046[_0x778f('0x32')];if(!_0x435884[_0x778f('0x2d')][_0x778f('0x33')]('nolimit')){_0x2e2c7c[_0x778f('0x1a')]=qs[_0x778f('0x1a')](_0x435884[_0x778f('0x2d')][_0x778f('0x1a')]);_0x2e2c7c[_0x778f('0x19')]=qs[_0x778f('0x19')](_0x435884[_0x778f('0x2d')]['offset']);}_0x2e2c7c['order']=qs[_0x778f('0x34')](_0x435884[_0x778f('0x2d')][_0x778f('0x34')]);_0x2e2c7c['where']=qs[_0x778f('0x35')](_[_0x778f('0x36')](_0x435884[_0x778f('0x2d')],_0x400046[_0x778f('0x35')]));if(_0x435884['query'][_0x778f('0x37')]){_0x2e2c7c[_0x778f('0x38')]=_['merge'](_0x2e2c7c[_0x778f('0x38')],{'$or':_[_0x778f('0x27')](_0xc528ea,function(_0x2bcb26){if(_0x2bcb26[_0x778f('0x2b')]!==_0x778f('0x39')){var _0x2bba6a={};_0x2bba6a[_0x2bcb26['name']]={'$like':'%'+_0x435884[_0x778f('0x2d')]['filter']+'%'};return _0x2bba6a;}})});}_0x2e2c7c=_[_0x778f('0x3a')]({},_0x2e2c7c,_0x435884[_0x778f('0x3b')]);var _0x23c886={'where':_0x2e2c7c[_0x778f('0x38')]};return db['Tag'][_0x778f('0x18')](_0x23c886)['then'](function(_0x22c707){_0x55fb2c[_0x778f('0x18')]=_0x22c707;if(_0x435884['query'][_0x778f('0x3c')]){_0x2e2c7c['include']=[{'all':!![]}];}return db['Tag'][_0x778f('0x3d')](_0x2e2c7c);})[_0x778f('0x23')](function(_0x3a389e){_0x55fb2c[_0x778f('0x3e')]=_0x3a389e;return _0x55fb2c;})[_0x778f('0x23')](respondWithFilteredResult(_0x3d1c1e,_0x2e2c7c))[_0x778f('0x3f')](handleError(_0x3d1c1e,null));};exports['show']=function(_0x29a665,_0x324fc0){var _0x3d83d7={'raw':!![],'where':{'id':_0x29a665[_0x778f('0x40')]['id']}},_0x110476={};_0x110476['model']=_[_0x778f('0x41')](db[_0x778f('0x28')][_0x778f('0x29')]);_0x110476[_0x778f('0x2d')]=_[_0x778f('0x41')](_0x29a665[_0x778f('0x2d')]);_0x110476[_0x778f('0x35')]=_[_0x778f('0x2e')](_0x110476[_0x778f('0x32')],_0x110476[_0x778f('0x2d')]);_0x3d83d7[_0x778f('0x2f')]=_['intersection'](_0x110476[_0x778f('0x32')],qs[_0x778f('0x30')](_0x29a665[_0x778f('0x2d')][_0x778f('0x30')]));_0x3d83d7['attributes']=_0x3d83d7[_0x778f('0x2f')]['length']?_0x3d83d7[_0x778f('0x2f')]:_0x110476['model'];if(_0x29a665[_0x778f('0x2d')]['includeAll']){_0x3d83d7['include']=[{'all':!![]}];}_0x3d83d7=_[_0x778f('0x3a')]({},_0x3d83d7,_0x29a665[_0x778f('0x3b')]);return db['Tag'][_0x778f('0x42')](_0x3d83d7)[_0x778f('0x23')](handleEntityNotFound(_0x324fc0,null))[_0x778f('0x23')](respondWithResult(_0x324fc0,null))[_0x778f('0x3f')](handleError(_0x324fc0,null));};exports[_0x778f('0x43')]=function(_0x2eca24,_0x1a8509){return db[_0x778f('0x28')][_0x778f('0x43')](_0x2eca24[_0x778f('0x44')],{})[_0x778f('0x23')](function(_0x734b98){var _0x4665a3=_0x2eca24['user'][_0x778f('0x20')]({'plain':!![]});if(!_0x4665a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4665a3['role']===_0x778f('0x45')){var _0x3b54e8=_0x734b98[_0x778f('0x20')]({'plain':!![]});var _0xa84f85=_0x778f('0x21');return db['UserProfileSection'][_0x778f('0x42')]({'where':{'name':_0xa84f85,'userProfileId':_0x4665a3[_0x778f('0x46')]},'raw':!![]})['then'](function(_0x290ac5){if(_0x290ac5&&_0x290ac5['autoAssociation']===0x0){return db[_0x778f('0x22')][_0x778f('0x43')]({'name':_0x3b54e8[_0x778f('0x25')],'resourceId':_0x3b54e8['id'],'type':_0x290ac5[_0x778f('0x25')],'sectionId':_0x290ac5['id']},{})['then'](function(){return _0x734b98;});}else{return _0x734b98;}})['catch'](function(_0xb43c9f){logger['error'](_0x778f('0x47'),_0xb43c9f);throw _0xb43c9f;});}return _0x734b98;})[_0x778f('0x23')](respondWithResult(_0x1a8509,0xc9))['catch'](handleError(_0x1a8509,null));};exports[_0x778f('0x48')]=function(_0x3d03df,_0x1a49fe){if(_0x3d03df['body']['id']){delete _0x3d03df[_0x778f('0x44')]['id'];}return db['Tag'][_0x778f('0x42')]({'where':{'id':_0x3d03df[_0x778f('0x40')]['id']}})['then'](handleEntityNotFound(_0x1a49fe,null))[_0x778f('0x23')](saveUpdates(_0x3d03df[_0x778f('0x44')],null))[_0x778f('0x23')](respondWithResult(_0x1a49fe,null))[_0x778f('0x3f')](handleError(_0x1a49fe,null));};exports['destroy']=function(_0xa7cdc1,_0x54a53a){return db[_0x778f('0x28')][_0x778f('0x42')]({'where':{'id':_0xa7cdc1[_0x778f('0x40')]['id']}})[_0x778f('0x23')](handleEntityNotFound(_0x54a53a,null))[_0x778f('0x23')](removeEntity(_0x54a53a,null))[_0x778f('0x3f')](handleError(_0x54a53a,null));}; \ No newline at end of file +var _0x34ff=['merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','Tags','UserProfileResource','sendStatus','error','stack','name','send','Tag','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0x34ff,0x158));var _0xf34f=function(_0x402e9a,_0xd2f9a){_0x402e9a=_0x402e9a-0x0;var _0xc624d4=_0x34ff[_0x402e9a];return _0xc624d4;};'use strict';var pdf=require(_0xf34f('0x0'));var emlformat=require(_0xf34f('0x1'));var rimraf=require(_0xf34f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf34f('0x3'));var rp=require(_0xf34f('0x4'));var moment=require(_0xf34f('0x5'));var BPromise=require(_0xf34f('0x6'));var Mustache=require('mustache');var util=require(_0xf34f('0x7'));var path=require(_0xf34f('0x8'));var sox=require(_0xf34f('0x9'));var csv=require(_0xf34f('0xa'));var ejs=require(_0xf34f('0xb'));var fs=require('fs');var _=require(_0xf34f('0xc'));var squel=require(_0xf34f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf34f('0xe'));var Papa=require('papaparse');var Redis=require(_0xf34f('0xf'));var authService=require(_0xf34f('0x10'));var qs=require(_0xf34f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf34f('0x12'));var logger=require('../../config/logger')(_0xf34f('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52ae67,_0x5a60f8){_0x5a60f8=_0x5a60f8||0xcc;return function(_0x20ab0e){if(_0x20ab0e){return _0x52ae67['sendStatus'](_0x5a60f8);}return _0x52ae67[_0xf34f('0x14')](_0x5a60f8)[_0xf34f('0x15')]();};}function respondWithResult(_0x59a492,_0x4a0829){_0x4a0829=_0x4a0829||0xc8;return function(_0x3e6856){if(_0x3e6856){return _0x59a492[_0xf34f('0x14')](_0x4a0829)[_0xf34f('0x16')](_0x3e6856);}};}function respondWithFilteredResult(_0x5b2cab,_0x4fdbe8){return function(_0x4ec70e){if(_0x4ec70e){var _0x97207c=_0x4ec70e[_0xf34f('0x17')],_0x25a3c6=_0x4fdbe8[_0xf34f('0x18')],_0xcaf12e=_0x4fdbe8[_0xf34f('0x18')]+_0x4fdbe8['limit'],_0xa2b79a;if(_0xcaf12e>=_0x97207c){_0xcaf12e=_0x97207c;_0xa2b79a=0xc8;}else{_0xa2b79a=0xce;}_0x5b2cab['status'](_0xa2b79a);return _0x5b2cab[_0xf34f('0x19')](_0xf34f('0x1a'),_0x25a3c6+'-'+_0xcaf12e+'/'+_0x97207c)['json'](_0x4ec70e);}return null;};}function patchUpdates(_0x57ddc8){return function(_0x5f2175){try{jsonpatch[_0xf34f('0x1b')](_0x5f2175,_0x57ddc8,!![]);}catch(_0x274b7c){return BPromise[_0xf34f('0x1c')](_0x274b7c);}return _0x5f2175[_0xf34f('0x1d')]();};}function saveUpdates(_0x5cdc7b,_0x2b7714){return function(_0xa22344){if(_0xa22344){return _0xa22344['update'](_0x5cdc7b)[_0xf34f('0x1e')](function(_0x266ab5){return _0x266ab5;});}return null;};}function removeEntity(_0x301b5f,_0x27310e){return function(_0x3992bc){if(_0x3992bc){return _0x3992bc[_0xf34f('0x1f')]()[_0xf34f('0x1e')](function(){var _0x400ae2=_0x3992bc[_0xf34f('0x20')]({'plain':!![]});var _0x55e5bd=_0xf34f('0x21');return db[_0xf34f('0x22')][_0xf34f('0x1f')]({'where':{'type':_0x55e5bd,'resourceId':_0x400ae2['id']}})[_0xf34f('0x1e')](function(){return _0x3992bc;});})[_0xf34f('0x1e')](function(){_0x301b5f[_0xf34f('0x14')](0xcc)[_0xf34f('0x15')]();});}};}function handleEntityNotFound(_0x112006,_0x4e0c68){return function(_0x3af09b){if(!_0x3af09b){_0x112006[_0xf34f('0x23')](0x194);}return _0x3af09b;};}function handleError(_0xb29c59,_0x38cefe){_0x38cefe=_0x38cefe||0x1f4;return function(_0x12bbbb){logger[_0xf34f('0x24')](_0x12bbbb[_0xf34f('0x25')]);if(_0x12bbbb[_0xf34f('0x26')]){delete _0x12bbbb[_0xf34f('0x26')];}_0xb29c59[_0xf34f('0x14')](_0x38cefe)[_0xf34f('0x27')](_0x12bbbb);};}exports['index']=function(_0x354bad,_0x2304bd){var _0x1f9e9a={},_0x18f304={},_0x5268e8={'count':0x0,'rows':[]};var _0x2ae690=_['map'](db[_0xf34f('0x28')][_0xf34f('0x29')],function(_0x5e0614){return{'name':_0x5e0614['fieldName'],'type':_0x5e0614[_0xf34f('0x2a')][_0xf34f('0x2b')]};});_0x18f304[_0xf34f('0x2c')]=_[_0xf34f('0x2d')](_0x2ae690,_0xf34f('0x26'));_0x18f304['query']=_[_0xf34f('0x2e')](_0x354bad[_0xf34f('0x2f')]);_0x18f304[_0xf34f('0x30')]=_[_0xf34f('0x31')](_0x18f304[_0xf34f('0x2c')],_0x18f304['query']);_0x1f9e9a[_0xf34f('0x32')]=_[_0xf34f('0x31')](_0x18f304[_0xf34f('0x2c')],qs[_0xf34f('0x33')](_0x354bad[_0xf34f('0x2f')]['fields']));_0x1f9e9a[_0xf34f('0x32')]=_0x1f9e9a['attributes'][_0xf34f('0x34')]?_0x1f9e9a[_0xf34f('0x32')]:_0x18f304['model'];if(!_0x354bad[_0xf34f('0x2f')][_0xf34f('0x35')](_0xf34f('0x36'))){_0x1f9e9a['limit']=qs[_0xf34f('0x37')](_0x354bad[_0xf34f('0x2f')][_0xf34f('0x37')]);_0x1f9e9a['offset']=qs[_0xf34f('0x18')](_0x354bad[_0xf34f('0x2f')]['offset']);}_0x1f9e9a[_0xf34f('0x38')]=qs[_0xf34f('0x39')](_0x354bad['query'][_0xf34f('0x39')]);_0x1f9e9a[_0xf34f('0x3a')]=qs['filters'](_[_0xf34f('0x3b')](_0x354bad[_0xf34f('0x2f')],_0x18f304[_0xf34f('0x30')]));if(_0x354bad[_0xf34f('0x2f')][_0xf34f('0x3c')]){_0x1f9e9a[_0xf34f('0x3a')]=_[_0xf34f('0x3d')](_0x1f9e9a[_0xf34f('0x3a')],{'$or':_['map'](_0x2ae690,function(_0x169f03){if(_0x169f03[_0xf34f('0x2a')]!==_0xf34f('0x3e')){var _0x7e76f7={};_0x7e76f7[_0x169f03[_0xf34f('0x26')]]={'$like':'%'+_0x354bad['query'][_0xf34f('0x3c')]+'%'};return _0x7e76f7;}})});}_0x1f9e9a=_[_0xf34f('0x3d')]({},_0x1f9e9a,_0x354bad[_0xf34f('0x3f')]);var _0x1302ba={'where':_0x1f9e9a[_0xf34f('0x3a')]};return db['Tag']['count'](_0x1302ba)[_0xf34f('0x1e')](function(_0xdfb7fc){_0x5268e8[_0xf34f('0x17')]=_0xdfb7fc;if(_0x354bad[_0xf34f('0x2f')][_0xf34f('0x40')]){_0x1f9e9a[_0xf34f('0x41')]=[{'all':!![]}];}return db['Tag'][_0xf34f('0x42')](_0x1f9e9a);})['then'](function(_0x1f0ca3){_0x5268e8['rows']=_0x1f0ca3;return _0x5268e8;})[_0xf34f('0x1e')](respondWithFilteredResult(_0x2304bd,_0x1f9e9a))[_0xf34f('0x43')](handleError(_0x2304bd,null));};exports[_0xf34f('0x44')]=function(_0x2f4df9,_0x22fed6){var _0x24e418={'raw':!![],'where':{'id':_0x2f4df9['params']['id']}},_0x309eaa={};_0x309eaa[_0xf34f('0x2c')]=_[_0xf34f('0x2e')](db[_0xf34f('0x28')]['rawAttributes']);_0x309eaa[_0xf34f('0x2f')]=_[_0xf34f('0x2e')](_0x2f4df9['query']);_0x309eaa[_0xf34f('0x30')]=_['intersection'](_0x309eaa[_0xf34f('0x2c')],_0x309eaa[_0xf34f('0x2f')]);_0x24e418[_0xf34f('0x32')]=_[_0xf34f('0x31')](_0x309eaa[_0xf34f('0x2c')],qs[_0xf34f('0x33')](_0x2f4df9[_0xf34f('0x2f')][_0xf34f('0x33')]));_0x24e418[_0xf34f('0x32')]=_0x24e418[_0xf34f('0x32')]['length']?_0x24e418['attributes']:_0x309eaa[_0xf34f('0x2c')];if(_0x2f4df9['query'][_0xf34f('0x40')]){_0x24e418[_0xf34f('0x41')]=[{'all':!![]}];}_0x24e418=_[_0xf34f('0x3d')]({},_0x24e418,_0x2f4df9[_0xf34f('0x3f')]);return db[_0xf34f('0x28')][_0xf34f('0x45')](_0x24e418)[_0xf34f('0x1e')](handleEntityNotFound(_0x22fed6,null))[_0xf34f('0x1e')](respondWithResult(_0x22fed6,null))[_0xf34f('0x43')](handleError(_0x22fed6,null));};exports[_0xf34f('0x46')]=function(_0x32e4ce,_0x36bd16){return db['Tag'][_0xf34f('0x46')](_0x32e4ce[_0xf34f('0x47')],{})[_0xf34f('0x1e')](function(_0x188e55){var _0x3f8a6f=_0x32e4ce[_0xf34f('0x48')][_0xf34f('0x20')]({'plain':!![]});if(!_0x3f8a6f)throw new Error(_0xf34f('0x49'));if(_0x3f8a6f[_0xf34f('0x4a')]==='user'){var _0x4f88bb=_0x188e55['get']({'plain':!![]});var _0x53296a=_0xf34f('0x21');return db[_0xf34f('0x4b')][_0xf34f('0x45')]({'where':{'name':_0x53296a,'userProfileId':_0x3f8a6f[_0xf34f('0x4c')]},'raw':!![]})[_0xf34f('0x1e')](function(_0x3f7544){if(_0x3f7544&&_0x3f7544[_0xf34f('0x4d')]===0x0){return db['UserProfileResource'][_0xf34f('0x46')]({'name':_0x4f88bb[_0xf34f('0x26')],'resourceId':_0x4f88bb['id'],'type':_0x3f7544['name'],'sectionId':_0x3f7544['id']},{})[_0xf34f('0x1e')](function(){return _0x188e55;});}else{return _0x188e55;}})[_0xf34f('0x43')](function(_0x11b269){logger['error'](_0xf34f('0x4e'),_0x11b269);throw _0x11b269;});}return _0x188e55;})[_0xf34f('0x1e')](respondWithResult(_0x36bd16,0xc9))[_0xf34f('0x43')](handleError(_0x36bd16,null));};exports[_0xf34f('0x4f')]=function(_0x4b7423,_0x1f104d){if(_0x4b7423['body']['id']){delete _0x4b7423[_0xf34f('0x47')]['id'];}return db[_0xf34f('0x28')]['find']({'where':{'id':_0x4b7423[_0xf34f('0x50')]['id']}})[_0xf34f('0x1e')](handleEntityNotFound(_0x1f104d,null))['then'](saveUpdates(_0x4b7423[_0xf34f('0x47')],null))[_0xf34f('0x1e')](respondWithResult(_0x1f104d,null))[_0xf34f('0x43')](handleError(_0x1f104d,null));};exports[_0xf34f('0x1f')]=function(_0x5bd180,_0x262904){return db['Tag'][_0xf34f('0x45')]({'where':{'id':_0x5bd180[_0xf34f('0x50')]['id']}})[_0xf34f('0x1e')](handleEntityNotFound(_0x262904,null))[_0xf34f('0x1e')](removeEntity(_0x262904,null))[_0xf34f('0x43')](handleError(_0x262904,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index dfbb5ad..555de00 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 _0xae7e=['Tag','tools_tags','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports','define'];(function(_0x2c4229,_0xfd363a){var _0x54ffea=function(_0x4085d3){while(--_0x4085d3){_0x2c4229['push'](_0x2c4229['shift']());}};_0x54ffea(++_0xfd363a);}(_0xae7e,0xf2));var _0xeae7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xae7e[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xeae7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeae7('0x1'));var moment=require(_0xeae7('0x2'));var BPromise=require(_0xeae7('0x3'));var rp=require(_0xeae7('0x4'));var fs=require('fs');var path=require(_0xeae7('0x5'));var rimraf=require('rimraf');var config=require(_0xeae7('0x6'));var attributes=require(_0xeae7('0x7'));module[_0xeae7('0x8')]=function(_0x1ebeae,_0x327af6){return _0x1ebeae[_0xeae7('0x9')](_0xeae7('0xa'),attributes,{'tableName':_0xeae7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04b0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','Tag','tools_tags','util','../../config/logger','api'];(function(_0x462080,_0x5bcf80){var _0x135fc6=function(_0x11cd74){while(--_0x11cd74){_0x462080['push'](_0x462080['shift']());}};_0x135fc6(++_0x5bcf80);}(_0x04b0,0x7f));var _0x004b=function(_0x23fe5f,_0x4a6e0b){_0x23fe5f=_0x23fe5f-0x0;var _0x2300cf=_0x04b0[_0x23fe5f];return _0x2300cf;};'use strict';var _=require('lodash');var util=require(_0x004b('0x0'));var logger=require(_0x004b('0x1'))(_0x004b('0x2'));var moment=require(_0x004b('0x3'));var BPromise=require(_0x004b('0x4'));var rp=require(_0x004b('0x5'));var fs=require('fs');var path=require(_0x004b('0x6'));var rimraf=require(_0x004b('0x7'));var config=require(_0x004b('0x8'));var attributes=require(_0x004b('0x9'));module[_0x004b('0xa')]=function(_0x5d6f1f,_0x5b17a5){return _0x5d6f1f['define'](_0x004b('0xb'),attributes,{'tableName':_0x004b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 7107cda..1c8cdea 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 _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(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1be1,0x192));var _0x11be=function(_0x192a1a,_0x27ba63){_0x192a1a=_0x192a1a-0x0;var _0x15e07f=_0x1be1[_0x192a1a];return _0x15e07f;};'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 +var _0x6f7a=['http','request','then','info','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x49e52e,_0x15f616){var _0x36a6e6=function(_0x2f7be2){while(--_0x2f7be2){_0x49e52e['push'](_0x49e52e['shift']());}};_0x36a6e6(++_0x15f616);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x202e99,_0x5982f6){_0x202e99=_0x202e99-0x0;var _0x452c42=_0x6f7a[_0x202e99];return _0x452c42;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('Tag,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index ff32075..cb29387 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 _0x7a6e=['create','addQueues','/:id/users','addAgents','put','delete','removeQueues','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/queues','getQueues','post'];(function(_0x190681,_0x590f58){var _0x4f2ada=function(_0x4556db){while(--_0x4556db){_0x190681['push'](_0x190681['shift']());}};_0x4f2ada(++_0x590f58);}(_0x7a6e,0xa9));var _0xe7a6=function(_0x321f2e,_0x416816){_0x321f2e=_0x321f2e-0x0;var _0x1767ff=_0x7a6e[_0x321f2e];return _0x1767ff;};'use strict';var multer=require(_0xe7a6('0x0'));var util=require(_0xe7a6('0x1'));var path=require(_0xe7a6('0x2'));var timeout=require(_0xe7a6('0x3'));var express=require(_0xe7a6('0x4'));var router=express[_0xe7a6('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe7a6('0x6'));var config=require(_0xe7a6('0x7'));var controller=require('./team.controller');router[_0xe7a6('0x8')]('/',auth[_0xe7a6('0x9')](),controller['index']);router[_0xe7a6('0x8')](_0xe7a6('0xa'),auth[_0xe7a6('0x9')](),controller[_0xe7a6('0xb')]);router[_0xe7a6('0x8')](_0xe7a6('0xc'),auth[_0xe7a6('0x9')](),controller[_0xe7a6('0xd')]);router[_0xe7a6('0x8')]('/:id/users',auth[_0xe7a6('0x9')](),controller['getAgents']);router[_0xe7a6('0xe')]('/',auth[_0xe7a6('0x9')](),controller[_0xe7a6('0xf')]);router['post'](_0xe7a6('0xc'),auth[_0xe7a6('0x9')](),controller[_0xe7a6('0x10')]);router[_0xe7a6('0xe')](_0xe7a6('0x11'),auth['isAuthenticated'](),controller[_0xe7a6('0x12')]);router[_0xe7a6('0x13')](_0xe7a6('0xa'),auth[_0xe7a6('0x9')](),controller['update']);router[_0xe7a6('0x14')]('/:id',auth[_0xe7a6('0x9')](),controller['destroy']);router[_0xe7a6('0x14')]('/:id/queues',auth[_0xe7a6('0x9')](),controller[_0xe7a6('0x15')]);router[_0xe7a6('0x14')](_0xe7a6('0x11'),auth[_0xe7a6('0x9')](),controller['removeAgents']);module[_0xe7a6('0x16')]=router; \ No newline at end of file +var _0x26ab=['isAuthenticated','get','/:id','/:id/users','getAgents','post','create','put','update','delete','/:id/queues','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./team.controller'];(function(_0x3953f8,_0x4d1649){var _0x3d8960=function(_0x28f579){while(--_0x28f579){_0x3953f8['push'](_0x3953f8['shift']());}};_0x3d8960(++_0x4d1649);}(_0x26ab,0x199));var _0xb26a=function(_0x158f9d,_0x3497f0){_0x158f9d=_0x158f9d-0x0;var _0x8f812b=_0x26ab[_0x158f9d];return _0x8f812b;};'use strict';var multer=require(_0xb26a('0x0'));var util=require(_0xb26a('0x1'));var path=require(_0xb26a('0x2'));var timeout=require(_0xb26a('0x3'));var express=require(_0xb26a('0x4'));var router=express[_0xb26a('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb26a('0x6'));var config=require(_0xb26a('0x7'));var controller=require(_0xb26a('0x8'));router['get']('/',auth[_0xb26a('0x9')](),controller['index']);router[_0xb26a('0xa')](_0xb26a('0xb'),auth[_0xb26a('0x9')](),controller['show']);router[_0xb26a('0xa')]('/:id/queues',auth[_0xb26a('0x9')](),controller['getQueues']);router[_0xb26a('0xa')](_0xb26a('0xc'),auth[_0xb26a('0x9')](),controller[_0xb26a('0xd')]);router[_0xb26a('0xe')]('/',auth['isAuthenticated'](),controller[_0xb26a('0xf')]);router['post']('/:id/queues',auth['isAuthenticated'](),controller['addQueues']);router['post']('/:id/users',auth[_0xb26a('0x9')](),controller['addAgents']);router[_0xb26a('0x10')](_0xb26a('0xb'),auth[_0xb26a('0x9')](),controller[_0xb26a('0x11')]);router[_0xb26a('0x12')](_0xb26a('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xb26a('0x12')](_0xb26a('0x13'),auth[_0xb26a('0x9')](),controller['removeQueues']);router[_0xb26a('0x12')](_0xb26a('0xc'),auth['isAuthenticated'](),controller[_0xb26a('0x14')]);module[_0xb26a('0x15')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 4a6ea6c..fd1c67f 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 _0xe404=['exports','STRING'];(function(_0x2ddb6d,_0x25d45b){var _0x56c103=function(_0x4f73c4){while(--_0x4f73c4){_0x2ddb6d['push'](_0x2ddb6d['shift']());}};_0x56c103(++_0x25d45b);}(_0xe404,0x1c6));var _0x4e40=function(_0x130bf0,_0x21e0fd){_0x130bf0=_0x130bf0-0x0;var _0x2c3a67=_0xe404[_0x130bf0];return _0x2c3a67;};'use strict';var Sequelize=require('sequelize');module[_0x4e40('0x0')]={'name':{'type':Sequelize[_0x4e40('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x4e40('0x1')]}}; \ No newline at end of file +var _0x9305=['STRING','name','exports'];(function(_0x47c317,_0x303747){var _0x2d6244=function(_0x498c2b){while(--_0x498c2b){_0x47c317['push'](_0x47c317['shift']());}};_0x2d6244(++_0x303747);}(_0x9305,0x1e8));var _0x5930=function(_0x4a1a80,_0x110e3c){_0x4a1a80=_0x4a1a80-0x0;var _0x30ab85=_0x9305[_0x4a1a80];return _0x30ab85;};'use strict';var Sequelize=require('sequelize');module[_0x5930('0x0')]={'name':{'type':Sequelize[_0x5930('0x1')],'allowNull':![],'unique':_0x5930('0x2')},'description':{'type':Sequelize[_0x5930('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 24fa5f1..a7d226a 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 _0x082a=['set','json','apply','reject','update','then','destroy','get','Teams','UserProfileResource','end','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','Team','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getQueues','findOne','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queues','addQueues','isValidChannel','add','ids','removeQueues','remove','addAgents','Voice','Mail','Sms','each','User','online','voicePause','upsert','SIP/%s','interface','emit','userTeam:save','removeAgents','chat','mail','sms','openchannel','voice','UserVoiceQueueRt','isArray','getAgents','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','sendStatus','status','count','offset'];(function(_0x5bbb5a,_0xf1f6aa){var _0x1167ca=function(_0xb11749){while(--_0xb11749){_0x5bbb5a['push'](_0x5bbb5a['shift']());}};_0x1167ca(++_0xf1f6aa);}(_0x082a,0x154));var _0xa082=function(_0x3baeee,_0x3e23ee){_0x3baeee=_0x3baeee-0x0;var _0x4087be=_0x082a[_0x3baeee];return _0x4087be;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa082('0x0'));var rimraf=require(_0xa082('0x1'));var zipdir=require(_0xa082('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa082('0x3'));var moment=require(_0xa082('0x4'));var BPromise=require(_0xa082('0x5'));var Mustache=require(_0xa082('0x6'));var util=require(_0xa082('0x7'));var path=require('path');var sox=require(_0xa082('0x8'));var csv=require('to-csv');var ejs=require(_0xa082('0x9'));var fs=require('fs');var _=require(_0xa082('0xa'));var squel=require('squel');var crypto=require(_0xa082('0xb'));var jsforce=require(_0xa082('0xc'));var deskjs=require(_0xa082('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa082('0xe'));var Papa=require(_0xa082('0xf'));var Redis=require(_0xa082('0x10'));var authService=require(_0xa082('0x11'));var qs=require(_0xa082('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa082('0x13'));var logger=require(_0xa082('0x14'))(_0xa082('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa082('0x16'))['db'];config[_0xa082('0x17')]=_[_0xa082('0x18')](config[_0xa082('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xa082('0x19'))(new Redis(config[_0xa082('0x17')]));require(_0xa082('0x1a'))[_0xa082('0x1b')](socket);function respondWithStatusCode(_0x867ef4,_0x3238a1){_0x3238a1=_0x3238a1||0xcc;return function(_0x482971){if(_0x482971){return _0x867ef4[_0xa082('0x1c')](_0x3238a1);}return _0x867ef4[_0xa082('0x1d')](_0x3238a1)['end']();};}function respondWithResult(_0x20b6f8,_0x13b93f){_0x13b93f=_0x13b93f||0xc8;return function(_0x32cb5a){if(_0x32cb5a){return _0x20b6f8[_0xa082('0x1d')](_0x13b93f)['json'](_0x32cb5a);}};}function respondWithFilteredResult(_0x509718,_0x1395d0){return function(_0xc96f74){if(_0xc96f74){var _0x507043=_0xc96f74[_0xa082('0x1e')],_0x3c32cc=_0x1395d0[_0xa082('0x1f')],_0x536ffa=_0x1395d0[_0xa082('0x1f')]+_0x1395d0['limit'],_0xeaa1ce;if(_0x536ffa>=_0x507043){_0x536ffa=_0x507043;_0xeaa1ce=0xc8;}else{_0xeaa1ce=0xce;}_0x509718[_0xa082('0x1d')](_0xeaa1ce);return _0x509718[_0xa082('0x20')]('Content-Range',_0x3c32cc+'-'+_0x536ffa+'/'+_0x507043)[_0xa082('0x21')](_0xc96f74);}return null;};}function patchUpdates(_0x8904c7){return function(_0x417943){try{jsonpatch[_0xa082('0x22')](_0x417943,_0x8904c7,!![]);}catch(_0x50a196){return BPromise[_0xa082('0x23')](_0x50a196);}return _0x417943['save']();};}function saveUpdates(_0x1a10ba,_0x802f8e){return function(_0x4b9af6){if(_0x4b9af6){return _0x4b9af6[_0xa082('0x24')](_0x1a10ba)[_0xa082('0x25')](function(_0x4fdc57){return _0x4fdc57;});}return null;};}function removeEntity(_0x505d27,_0x36eded){return function(_0x1f3c04){if(_0x1f3c04){return _0x1f3c04[_0xa082('0x26')]()[_0xa082('0x25')](function(){var _0x425b5d=_0x1f3c04[_0xa082('0x27')]({'plain':!![]});var _0x3bead8=_0xa082('0x28');return db[_0xa082('0x29')][_0xa082('0x26')]({'where':{'type':_0x3bead8,'resourceId':_0x425b5d['id']}})[_0xa082('0x25')](function(){return _0x1f3c04;});})[_0xa082('0x25')](function(){_0x505d27[_0xa082('0x1d')](0xcc)[_0xa082('0x2a')]();});}};}function handleEntityNotFound(_0x21730e,_0x3e604e){return function(_0x3e9115){if(!_0x3e9115){_0x21730e[_0xa082('0x1c')](0x194);}return _0x3e9115;};}function handleError(_0x1793df,_0x22ace6){_0x22ace6=_0x22ace6||0x1f4;return function(_0x18f20e){logger[_0xa082('0x2b')](_0x18f20e[_0xa082('0x2c')]);if(_0x18f20e[_0xa082('0x2d')]){delete _0x18f20e[_0xa082('0x2d')];}_0x1793df[_0xa082('0x1d')](_0x22ace6)['send'](_0x18f20e);};}exports[_0xa082('0x2e')]=function(_0x3ad5a4,_0x8f2543){var _0x329bb2={},_0x220905={},_0x5e41a0={'count':0x0,'rows':[]};var _0x1b955e=_[_0xa082('0x2f')](db['Team']['rawAttributes'],function(_0x491652){return{'name':_0x491652[_0xa082('0x30')],'type':_0x491652[_0xa082('0x31')][_0xa082('0x32')]};});_0x220905[_0xa082('0x33')]=_[_0xa082('0x2f')](_0x1b955e,_0xa082('0x2d'));_0x220905[_0xa082('0x34')]=_[_0xa082('0x35')](_0x3ad5a4[_0xa082('0x34')]);_0x220905[_0xa082('0x36')]=_[_0xa082('0x37')](_0x220905[_0xa082('0x33')],_0x220905[_0xa082('0x34')]);_0x329bb2['attributes']=_['intersection'](_0x220905['model'],qs[_0xa082('0x38')](_0x3ad5a4[_0xa082('0x34')][_0xa082('0x38')]));_0x329bb2['attributes']=_0x329bb2['attributes'][_0xa082('0x39')]?_0x329bb2[_0xa082('0x3a')]:_0x220905[_0xa082('0x33')];if(!_0x3ad5a4['query'][_0xa082('0x3b')]('nolimit')){_0x329bb2[_0xa082('0x3c')]=qs[_0xa082('0x3c')](_0x3ad5a4['query'][_0xa082('0x3c')]);_0x329bb2[_0xa082('0x1f')]=qs['offset'](_0x3ad5a4[_0xa082('0x34')]['offset']);}_0x329bb2[_0xa082('0x3d')]=qs[_0xa082('0x3e')](_0x3ad5a4[_0xa082('0x34')][_0xa082('0x3e')]);_0x329bb2[_0xa082('0x3f')]=qs[_0xa082('0x36')](_[_0xa082('0x40')](_0x3ad5a4['query'],_0x220905[_0xa082('0x36')]));if(_0x3ad5a4[_0xa082('0x34')][_0xa082('0x41')]){_0x329bb2[_0xa082('0x3f')]=_[_0xa082('0x42')](_0x329bb2[_0xa082('0x3f')],{'$or':_[_0xa082('0x2f')](_0x1b955e,function(_0x506b20){if(_0x506b20[_0xa082('0x31')]!=='VIRTUAL'){var _0x4d005e={};_0x4d005e[_0x506b20['name']]={'$like':'%'+_0x3ad5a4[_0xa082('0x34')][_0xa082('0x41')]+'%'};return _0x4d005e;}})});}_0x329bb2=_[_0xa082('0x42')]({},_0x329bb2,_0x3ad5a4['options']);var _0x130d70={'where':_0x329bb2[_0xa082('0x3f')]};return db[_0xa082('0x43')]['count'](_0x130d70)['then'](function(_0x3a4d82){_0x5e41a0[_0xa082('0x1e')]=_0x3a4d82;if(_0x3ad5a4[_0xa082('0x34')][_0xa082('0x44')]){_0x329bb2[_0xa082('0x45')]=[{'all':!![]}];}return db[_0xa082('0x43')][_0xa082('0x46')](_0x329bb2);})[_0xa082('0x25')](function(_0x4f919b){_0x5e41a0[_0xa082('0x47')]=_0x4f919b;return _0x5e41a0;})[_0xa082('0x25')](respondWithFilteredResult(_0x8f2543,_0x329bb2))[_0xa082('0x48')](handleError(_0x8f2543,null));};exports[_0xa082('0x49')]=function(_0x44c3ee,_0x1ccf3e){var _0x204c9e={'raw':![],'where':{'id':_0x44c3ee[_0xa082('0x4a')]['id']}},_0xf2279d={};_0xf2279d['model']=_[_0xa082('0x35')](db[_0xa082('0x43')][_0xa082('0x4b')]);_0xf2279d['query']=_[_0xa082('0x35')](_0x44c3ee[_0xa082('0x34')]);_0xf2279d[_0xa082('0x36')]=_['intersection'](_0xf2279d[_0xa082('0x33')],_0xf2279d[_0xa082('0x34')]);_0x204c9e[_0xa082('0x3a')]=_[_0xa082('0x37')](_0xf2279d[_0xa082('0x33')],qs['fields'](_0x44c3ee['query'][_0xa082('0x38')]));_0x204c9e[_0xa082('0x3a')]=_0x204c9e['attributes'][_0xa082('0x39')]?_0x204c9e['attributes']:_0xf2279d['model'];if(_0x44c3ee['query'][_0xa082('0x44')]){_0x204c9e[_0xa082('0x45')]=[{'all':!![]}];}_0x204c9e=_[_0xa082('0x42')]({},_0x204c9e,_0x44c3ee[_0xa082('0x4c')]);return db['Team'][_0xa082('0x4d')](_0x204c9e)[_0xa082('0x25')](handleEntityNotFound(_0x1ccf3e,null))[_0xa082('0x25')](respondWithResult(_0x1ccf3e,null))[_0xa082('0x48')](handleError(_0x1ccf3e,null));};exports[_0xa082('0x4e')]=function(_0x265620,_0x144b3a){return db[_0xa082('0x43')][_0xa082('0x4e')](_0x265620[_0xa082('0x4f')],{})[_0xa082('0x25')](function(_0x2b1092){var _0x3ef24a=_0x265620[_0xa082('0x50')][_0xa082('0x27')]({'plain':!![]});if(!_0x3ef24a)throw new Error(_0xa082('0x51'));if(_0x3ef24a[_0xa082('0x52')]==='user'){var _0x340f7c=_0x2b1092['get']({'plain':!![]});var _0x498070=_0xa082('0x28');return db[_0xa082('0x53')][_0xa082('0x4d')]({'where':{'name':_0x498070,'userProfileId':_0x3ef24a[_0xa082('0x54')]},'raw':!![]})[_0xa082('0x25')](function(_0x3601c9){if(_0x3601c9&&_0x3601c9[_0xa082('0x55')]===0x0){return db['UserProfileResource'][_0xa082('0x4e')]({'name':_0x340f7c[_0xa082('0x2d')],'resourceId':_0x340f7c['id'],'type':_0x3601c9[_0xa082('0x2d')],'sectionId':_0x3601c9['id']},{})['then'](function(){return _0x2b1092;});}else{return _0x2b1092;}})['catch'](function(_0x4ad635){logger[_0xa082('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ad635);throw _0x4ad635;});}return _0x2b1092;})[_0xa082('0x25')](respondWithResult(_0x144b3a,0xc9))[_0xa082('0x48')](handleError(_0x144b3a,null));};exports[_0xa082('0x24')]=function(_0x58d4d4,_0x26fe0e){if(_0x58d4d4[_0xa082('0x4f')]['id']){delete _0x58d4d4[_0xa082('0x4f')]['id'];}return db[_0xa082('0x43')]['find']({'where':{'id':_0x58d4d4['params']['id']}})[_0xa082('0x25')](handleEntityNotFound(_0x26fe0e,null))[_0xa082('0x25')](saveUpdates(_0x58d4d4['body'],null))[_0xa082('0x25')](respondWithResult(_0x26fe0e,null))[_0xa082('0x48')](handleError(_0x26fe0e,null));};exports['destroy']=function(_0xc622d7,_0x19eb91){return db[_0xa082('0x43')][_0xa082('0x4d')]({'where':{'id':_0xc622d7['params']['id']}})[_0xa082('0x25')](handleEntityNotFound(_0x19eb91,null))[_0xa082('0x25')](removeEntity(_0x19eb91,null))[_0xa082('0x48')](handleError(_0x19eb91,null));};exports[_0xa082('0x56')]=function(_0x15db20,_0x51554e,_0x24e3ac){return db[_0xa082('0x43')][_0xa082('0x57')]({'where':{'id':_0x15db20['params']['id']}})[_0xa082('0x25')](handleEntityNotFound(_0x51554e,null))[_0xa082('0x25')](function(_0x52d08e){if(!_0x15db20[_0xa082('0x34')][_0xa082('0x58')]||!utils['isValidChannel'](_0x15db20[_0xa082('0x34')][_0xa082('0x58')])){throw new db[(_0xa082('0x59'))][(_0xa082('0x5a'))](_0xa082('0x5b'));}var _0x9825d5={};var _0x5c33ac={};_0x5c33ac[_0xa082('0x33')]=_[_0xa082('0x35')](db[_[_0xa082('0x5c')](_0x15db20['query']['channel'][_0xa082('0x5d')]())+'Queue'][_0xa082('0x4b')]);_0x5c33ac['query']=_[_0xa082('0x35')](_0x15db20['query']);_0x5c33ac['filters']=_['intersection'](_0x5c33ac['model'],_0x5c33ac[_0xa082('0x34')]);_0x9825d5['attributes']=_[_0xa082('0x37')](_0x5c33ac[_0xa082('0x33')],qs[_0xa082('0x38')](_0x15db20[_0xa082('0x34')]['fields']));_0x9825d5[_0xa082('0x3a')]=_0x9825d5[_0xa082('0x3a')][_0xa082('0x39')]?_0x9825d5['attributes']:_0x5c33ac[_0xa082('0x33')];_0x9825d5[_0xa082('0x3c')]=qs['limit'](_0x15db20[_0xa082('0x34')][_0xa082('0x3c')]);_0x9825d5[_0xa082('0x1f')]=qs[_0xa082('0x1f')](_0x15db20[_0xa082('0x34')]['offset']);_0x9825d5[_0xa082('0x3d')]=qs[_0xa082('0x3e')](_0x15db20[_0xa082('0x34')]['sort']);_0x9825d5['where']=qs[_0xa082('0x36')](_[_0xa082('0x40')](_0x15db20[_0xa082('0x34')],_0x5c33ac[_0xa082('0x36')]));_0x9825d5=_[_0xa082('0x42')]({},_0x9825d5,_0x15db20[_0xa082('0x4c')]);return _0x52d08e[_0xa082('0x27')+_[_0xa082('0x5c')](_0x15db20[_0xa082('0x34')]['channel'][_0xa082('0x5d')]())+_0xa082('0x5e')](_0x9825d5);})[_0xa082('0x25')](respondWithResult(_0x51554e,null))['catch'](handleError(_0x51554e,null));};exports[_0xa082('0x5f')]=function(_0x5c5d1d,_0x174032,_0x42305e){return db['Team']['findOne']({'where':{'id':_0x5c5d1d[_0xa082('0x4a')]['id']}})[_0xa082('0x25')](function(_0x28c340){if(_0x28c340){if(!_0x5c5d1d[_0xa082('0x4f')][_0xa082('0x58')]||!utils[_0xa082('0x60')](_0x5c5d1d['body'][_0xa082('0x58')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x28c340[_0xa082('0x61')+_[_0xa082('0x5c')](_0x5c5d1d[_0xa082('0x4f')][_0xa082('0x58')][_0xa082('0x5d')]())+'Queues'](_0x5c5d1d[_0xa082('0x4f')][_0xa082('0x62')]);}return null;})[_0xa082('0x25')](handleEntityNotFound(_0x174032,null))[_0xa082('0x25')](respondWithStatusCode(_0x174032,null))[_0xa082('0x48')](handleError(_0x174032,null));};exports[_0xa082('0x63')]=function(_0x3e8f11,_0x295809,_0x1473b){return db[_0xa082('0x43')][_0xa082('0x57')]({'where':{'id':_0x3e8f11[_0xa082('0x4a')]['id']}})[_0xa082('0x25')](function(_0x520683){if(_0x520683){if(!_0x3e8f11[_0xa082('0x34')][_0xa082('0x58')]||!utils['isValidChannel'](_0x3e8f11[_0xa082('0x34')][_0xa082('0x58')])){throw new db[(_0xa082('0x59'))][(_0xa082('0x5a'))](_0xa082('0x5b'));}return _0x520683[_0xa082('0x64')+_[_0xa082('0x5c')](_0x3e8f11[_0xa082('0x34')]['channel']['toLowerCase']())+_0xa082('0x5e')](_0x3e8f11['query']['ids']);}return null;})[_0xa082('0x25')](handleEntityNotFound(_0x295809,null))[_0xa082('0x25')](respondWithStatusCode(_0x295809,null))[_0xa082('0x48')](handleError(_0x295809,null));};exports[_0xa082('0x65')]=function(_0x3566ee,_0x45b514,_0x57df8b){return db[_0xa082('0x43')][_0xa082('0x4d')]({'where':{'id':_0x3566ee[_0xa082('0x4a')]['id']}})[_0xa082('0x25')](handleEntityNotFound(_0x45b514,null))['then'](function(_0x18b794){if(_0x18b794){var _0x23f21e=[_0xa082('0x66'),'Chat',_0xa082('0x67'),_0xa082('0x68'),'Fax','Openchannel'];return BPromise[_0xa082('0x69')](_0x23f21e,function(_0x39b05e){return _0x18b794[_0xa082('0x27')+_0x39b05e+_0xa082('0x5e')]({'attributes':['id',_0xa082('0x2d')]})[_0xa082('0x25')](function(_0x3277ca){return BPromise[_0xa082('0x69')](_0x3277ca,function(_0x1ac57f){return _0x1ac57f['addAgents'](_0x3566ee[_0xa082('0x4f')][_0xa082('0x62')])['then'](function(){if(_0x39b05e===_0xa082('0x66')){return db[_0xa082('0x6a')][_0xa082('0x46')]({'where':{'id':_0x3566ee[_0xa082('0x4f')]['ids']},'attributes':['id','name',_0xa082('0x6b'),_0xa082('0x6c'),'interface'],'raw':!![]})[_0xa082('0x25')](function(_0x1ce64d){return BPromise[_0xa082('0x69')](_[_0xa082('0x41')](_0x1ce64d,{'online':0x1}),function(_0x162b0b){return db['UserVoiceQueueRt'][_0xa082('0x6d')]({'membername':_0x162b0b[_0xa082('0x2d')],'UserId':_0x162b0b['id'],'queue_name':_0x1ac57f['name'],'VoiceQueueId':_0x1ac57f['id'],'interface':_['isNil'](_0x162b0b['interface'])?util['format'](_0xa082('0x6e'),_0x162b0b[_0xa082('0x2d')]):_0x162b0b[_0xa082('0x6f')],'paused':_0x162b0b[_0xa082('0x6c')]||![],'penalty':0x0});});});}});});})[_0xa082('0x25')](function(){return _0x18b794;});})['then'](function(){return _0x18b794;});}})[_0xa082('0x25')](function(_0x128d12){if(_0x128d12){return _0x128d12[_0xa082('0x65')](_0x3566ee[_0xa082('0x4f')][_0xa082('0x62')],_['omit'](_0x3566ee[_0xa082('0x4f')],[_0xa082('0x62'),'id'])||{})['spread'](function(_0x450617){for(var _0x4e706a=0x0;_0x4e706a<_0x3566ee['body'][_0xa082('0x62')][_0xa082('0x39')];_0x4e706a+=0x1){socket[_0xa082('0x70')](_0xa082('0x71'),{'UserId':_0x3566ee[_0xa082('0x4f')][_0xa082('0x62')][_0x4e706a],'TeamId':_0x3566ee[_0xa082('0x4a')]['id']});}return _0x450617;});}})['then'](respondWithResult(_0x45b514,null))[_0xa082('0x48')](handleError(_0x45b514,null));};exports[_0xa082('0x72')]=function(_0x273f4e,_0x467985,_0x2c341b){return db[_0xa082('0x43')]['find']({'where':{'id':_0x273f4e[_0xa082('0x4a')]['id']}})[_0xa082('0x25')](handleEntityNotFound(_0x467985,null))[_0xa082('0x25')](function(_0x3f2d98){if(_0x3f2d98){return BPromise[_0xa082('0x69')](['voice',_0xa082('0x73'),_0xa082('0x74'),_0xa082('0x75'),'fax',_0xa082('0x76')],function(_0x2463d4){return _0x3f2d98[_0xa082('0x27')+_[_0xa082('0x5c')](_0x2463d4)+'Queues']({'attributes':['id',_0xa082('0x2d')]})['then'](function(_0x53a66f){return BPromise['each'](_0x53a66f,function(_0x29b258){return _0x29b258[_0xa082('0x72')](_0x273f4e[_0xa082('0x34')][_0xa082('0x62')])[_0xa082('0x25')](function(){if(_0x2463d4===_0xa082('0x77')){return db[_0xa082('0x78')]['destroy']({'where':{'VoiceQueueId':_0x29b258['id'],'UserId':_0x273f4e[_0xa082('0x34')][_0xa082('0x62')]}});}});});})[_0xa082('0x25')](function(){return _0x3f2d98;});})[_0xa082('0x25')](function(){return _0x3f2d98;});}})['then'](function(_0x37dd4d){if(_0x37dd4d){return _0x37dd4d[_0xa082('0x72')](_0x273f4e[_0xa082('0x34')][_0xa082('0x62')])[_0xa082('0x25')](function(){if(_[_0xa082('0x79')](_0x273f4e[_0xa082('0x34')][_0xa082('0x62')])){for(var _0x2ab481=0x0;_0x2ab481<_0x273f4e[_0xa082('0x34')][_0xa082('0x62')]['length'];_0x2ab481+=0x1){socket[_0xa082('0x70')]('userTeam:remove',{'UserId':Number(_0x273f4e[_0xa082('0x34')][_0xa082('0x62')][_0x2ab481]),'TeamId':Number(_0x273f4e[_0xa082('0x4a')]['id'])});}}else{socket['emit']('userTeam:remove',{'UserId':Number(_0x273f4e[_0xa082('0x34')][_0xa082('0x62')]),'TeamId':Number(_0x273f4e[_0xa082('0x4a')]['id'])});}});}})[_0xa082('0x25')](respondWithStatusCode(_0x467985,null))[_0xa082('0x48')](handleError(_0x467985,null));};exports[_0xa082('0x7a')]=function(_0xafb52f,_0x82f5fc,_0x1921ef){var _0x2d60b0={};var _0xbcc474={};var _0x2eed7c;var _0x502c57;return db[_0xa082('0x43')]['findOne']({'where':{'id':_0xafb52f[_0xa082('0x4a')]['id']}})[_0xa082('0x25')](handleEntityNotFound(_0x82f5fc,null))[_0xa082('0x25')](function(_0x25bca1){if(_0x25bca1){_0x2eed7c=_0x25bca1;_0xbcc474[_0xa082('0x33')]=_['keys'](db[_0xa082('0x6a')][_0xa082('0x4b')]);_0xbcc474['query']=_[_0xa082('0x35')](_0xafb52f[_0xa082('0x34')]);_0xbcc474[_0xa082('0x36')]=_['intersection'](_0xbcc474[_0xa082('0x33')],_0xbcc474[_0xa082('0x34')]);_0x2d60b0[_0xa082('0x3a')]=_[_0xa082('0x37')](_0xbcc474[_0xa082('0x33')],qs['fields'](_0xafb52f[_0xa082('0x34')][_0xa082('0x38')]));_0x2d60b0[_0xa082('0x3a')]=_0x2d60b0[_0xa082('0x3a')][_0xa082('0x39')]?_0x2d60b0[_0xa082('0x3a')]:_0xbcc474['model'];_0x2d60b0[_0xa082('0x3d')]=qs[_0xa082('0x3e')](_0xafb52f[_0xa082('0x34')][_0xa082('0x3e')]);_0x2d60b0[_0xa082('0x3f')]=qs['filters'](_[_0xa082('0x40')](_0xafb52f[_0xa082('0x34')],_0xbcc474[_0xa082('0x36')]));if(_0xafb52f['query'][_0xa082('0x41')]){_0x2d60b0['where']=_['merge'](_0x2d60b0[_0xa082('0x3f')],{'$or':_[_0xa082('0x2f')](_0x2d60b0[_0xa082('0x3a')],function(_0x2b9e79){var _0x26a176={};_0x26a176[_0x2b9e79]={'$like':'%'+_0xafb52f[_0xa082('0x34')][_0xa082('0x41')]+'%'};return _0x26a176;})});}_0x2d60b0=_[_0xa082('0x42')]({},_0x2d60b0,_0xafb52f[_0xa082('0x4c')]);return _0x2eed7c['getAgents'](_0x2d60b0);}})['then'](function(_0x32e82d){if(_0x32e82d){_0x502c57=_0x32e82d[_0xa082('0x39')];if(!_0xafb52f[_0xa082('0x34')][_0xa082('0x3b')](_0xa082('0x7b'))){_0x2d60b0[_0xa082('0x3c')]=qs[_0xa082('0x3c')](_0xafb52f[_0xa082('0x34')][_0xa082('0x3c')]);_0x2d60b0['offset']=qs[_0xa082('0x1f')](_0xafb52f[_0xa082('0x34')][_0xa082('0x1f')]);}return _0x2eed7c['getAgents'](_0x2d60b0);}})[_0xa082('0x25')](function(_0x2fb128){if(_0x2fb128){return _0x2fb128?{'count':_0x502c57,'rows':_0x2fb128}:null;}})[_0xa082('0x25')](respondWithResult(_0x82f5fc,null))[_0xa082('0x48')](handleError(_0x82f5fc,null));}; \ No newline at end of file +var _0xa5c9=['merge','VIRTUAL','name','options','findAll','rows','catch','show','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getQueues','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','rawAttributes','order','get','Queues','addQueues','isValidChannel','add','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','each','ids','online','voicePause','interface','upsert','format','SIP/%s','omit','spread','emit','userTeam:save','removeAgents','voice','chat','mail','sms','fax','isArray','userTeam:remove','getAgents','findOne','User','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','Teams','UserProfileResource','end','stack','send','index','map','Team','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter'];(function(_0x4c6d55,_0x28e5c3){var _0x38c3f6=function(_0x4431e5){while(--_0x4431e5){_0x4c6d55['push'](_0x4c6d55['shift']());}};_0x38c3f6(++_0x28e5c3);}(_0xa5c9,0x143));var _0x9a5c=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0xa5c9[_0x1064bc];return _0x5edc45;};'use strict';var pdf=require(_0x9a5c('0x0'));var emlformat=require(_0x9a5c('0x1'));var rimraf=require(_0x9a5c('0x2'));var zipdir=require(_0x9a5c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9a5c('0x4'));var BPromise=require(_0x9a5c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9a5c('0x6'));var csv=require(_0x9a5c('0x7'));var ejs=require(_0x9a5c('0x8'));var fs=require('fs');var _=require(_0x9a5c('0x9'));var squel=require('squel');var crypto=require(_0x9a5c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9a5c('0xb'));var toCsv=require(_0x9a5c('0x7'));var querystring=require('querystring');var Papa=require(_0x9a5c('0xc'));var Redis=require(_0x9a5c('0xd'));var authService=require(_0x9a5c('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a5c('0xf'));var logger=require(_0x9a5c('0x10'))(_0x9a5c('0x11'));var utils=require(_0x9a5c('0x12'));var config=require(_0x9a5c('0x13'));var db=require(_0x9a5c('0x14'))['db'];config[_0x9a5c('0x15')]=_[_0x9a5c('0x16')](config[_0x9a5c('0x15')],{'host':_0x9a5c('0x17'),'port':0x18eb});var socket=require(_0x9a5c('0x18'))(new Redis(config[_0x9a5c('0x15')]));require('./team.socket')[_0x9a5c('0x19')](socket);function respondWithStatusCode(_0x3c39d6,_0x2b1cef){_0x2b1cef=_0x2b1cef||0xcc;return function(_0x4fdcdc){if(_0x4fdcdc){return _0x3c39d6[_0x9a5c('0x1a')](_0x2b1cef);}return _0x3c39d6[_0x9a5c('0x1b')](_0x2b1cef)['end']();};}function respondWithResult(_0x16422d,_0x5ef98e){_0x5ef98e=_0x5ef98e||0xc8;return function(_0x350bd5){if(_0x350bd5){return _0x16422d['status'](_0x5ef98e)[_0x9a5c('0x1c')](_0x350bd5);}};}function respondWithFilteredResult(_0x1e0c41,_0x59e410){return function(_0x2d509f){if(_0x2d509f){var _0x3f06b6=_0x2d509f[_0x9a5c('0x1d')],_0x39fbea=_0x59e410[_0x9a5c('0x1e')],_0x4bb262=_0x59e410['offset']+_0x59e410[_0x9a5c('0x1f')],_0x549a96;if(_0x4bb262>=_0x3f06b6){_0x4bb262=_0x3f06b6;_0x549a96=0xc8;}else{_0x549a96=0xce;}_0x1e0c41[_0x9a5c('0x1b')](_0x549a96);return _0x1e0c41['set'](_0x9a5c('0x20'),_0x39fbea+'-'+_0x4bb262+'/'+_0x3f06b6)[_0x9a5c('0x1c')](_0x2d509f);}return null;};}function patchUpdates(_0xe42960){return function(_0x53ad9f){try{jsonpatch[_0x9a5c('0x21')](_0x53ad9f,_0xe42960,!![]);}catch(_0x3c21cd){return BPromise['reject'](_0x3c21cd);}return _0x53ad9f[_0x9a5c('0x22')]();};}function saveUpdates(_0x191881,_0x5659b4){return function(_0x4b3d64){if(_0x4b3d64){return _0x4b3d64[_0x9a5c('0x23')](_0x191881)[_0x9a5c('0x24')](function(_0x5719eb){return _0x5719eb;});}return null;};}function removeEntity(_0x17dc2f,_0x3f7d13){return function(_0x163985){if(_0x163985){return _0x163985[_0x9a5c('0x25')]()[_0x9a5c('0x24')](function(){var _0x3c3112=_0x163985['get']({'plain':!![]});var _0x538e65=_0x9a5c('0x26');return db[_0x9a5c('0x27')][_0x9a5c('0x25')]({'where':{'type':_0x538e65,'resourceId':_0x3c3112['id']}})[_0x9a5c('0x24')](function(){return _0x163985;});})['then'](function(){_0x17dc2f[_0x9a5c('0x1b')](0xcc)[_0x9a5c('0x28')]();});}};}function handleEntityNotFound(_0x3b5d9c,_0x4119f7){return function(_0x439e6b){if(!_0x439e6b){_0x3b5d9c[_0x9a5c('0x1a')](0x194);}return _0x439e6b;};}function handleError(_0xf88f6b,_0x4146c9){_0x4146c9=_0x4146c9||0x1f4;return function(_0x3d3356){logger['error'](_0x3d3356[_0x9a5c('0x29')]);if(_0x3d3356['name']){delete _0x3d3356['name'];}_0xf88f6b['status'](_0x4146c9)[_0x9a5c('0x2a')](_0x3d3356);};}exports[_0x9a5c('0x2b')]=function(_0x214953,_0xb966ad){var _0x2f9161={},_0x35d472={},_0x56dcce={'count':0x0,'rows':[]};var _0x3f1815=_[_0x9a5c('0x2c')](db[_0x9a5c('0x2d')]['rawAttributes'],function(_0x39945c){return{'name':_0x39945c[_0x9a5c('0x2e')],'type':_0x39945c[_0x9a5c('0x2f')][_0x9a5c('0x30')]};});_0x35d472['model']=_[_0x9a5c('0x2c')](_0x3f1815,'name');_0x35d472[_0x9a5c('0x31')]=_['keys'](_0x214953[_0x9a5c('0x31')]);_0x35d472[_0x9a5c('0x32')]=_[_0x9a5c('0x33')](_0x35d472[_0x9a5c('0x34')],_0x35d472[_0x9a5c('0x31')]);_0x2f9161[_0x9a5c('0x35')]=_['intersection'](_0x35d472[_0x9a5c('0x34')],qs[_0x9a5c('0x36')](_0x214953[_0x9a5c('0x31')][_0x9a5c('0x36')]));_0x2f9161['attributes']=_0x2f9161[_0x9a5c('0x35')][_0x9a5c('0x37')]?_0x2f9161['attributes']:_0x35d472[_0x9a5c('0x34')];if(!_0x214953[_0x9a5c('0x31')]['hasOwnProperty'](_0x9a5c('0x38'))){_0x2f9161['limit']=qs[_0x9a5c('0x1f')](_0x214953[_0x9a5c('0x31')][_0x9a5c('0x1f')]);_0x2f9161[_0x9a5c('0x1e')]=qs[_0x9a5c('0x1e')](_0x214953['query']['offset']);}_0x2f9161['order']=qs['sort'](_0x214953[_0x9a5c('0x31')][_0x9a5c('0x39')]);_0x2f9161[_0x9a5c('0x3a')]=qs[_0x9a5c('0x32')](_[_0x9a5c('0x3b')](_0x214953[_0x9a5c('0x31')],_0x35d472[_0x9a5c('0x32')]));if(_0x214953[_0x9a5c('0x31')][_0x9a5c('0x3c')]){_0x2f9161[_0x9a5c('0x3a')]=_[_0x9a5c('0x3d')](_0x2f9161['where'],{'$or':_[_0x9a5c('0x2c')](_0x3f1815,function(_0x158376){if(_0x158376[_0x9a5c('0x2f')]!==_0x9a5c('0x3e')){var _0x4b4a6e={};_0x4b4a6e[_0x158376[_0x9a5c('0x3f')]]={'$like':'%'+_0x214953[_0x9a5c('0x31')]['filter']+'%'};return _0x4b4a6e;}})});}_0x2f9161=_[_0x9a5c('0x3d')]({},_0x2f9161,_0x214953[_0x9a5c('0x40')]);var _0x458d36={'where':_0x2f9161[_0x9a5c('0x3a')]};return db[_0x9a5c('0x2d')][_0x9a5c('0x1d')](_0x458d36)[_0x9a5c('0x24')](function(_0x2518e0){_0x56dcce[_0x9a5c('0x1d')]=_0x2518e0;if(_0x214953[_0x9a5c('0x31')]['includeAll']){_0x2f9161['include']=[{'all':!![]}];}return db[_0x9a5c('0x2d')][_0x9a5c('0x41')](_0x2f9161);})[_0x9a5c('0x24')](function(_0xe6e36d){_0x56dcce[_0x9a5c('0x42')]=_0xe6e36d;return _0x56dcce;})[_0x9a5c('0x24')](respondWithFilteredResult(_0xb966ad,_0x2f9161))[_0x9a5c('0x43')](handleError(_0xb966ad,null));};exports[_0x9a5c('0x44')]=function(_0x28775c,_0x38c031){var _0x718265={'raw':![],'where':{'id':_0x28775c['params']['id']}},_0x1322da={};_0x1322da['model']=_[_0x9a5c('0x45')](db[_0x9a5c('0x2d')]['rawAttributes']);_0x1322da[_0x9a5c('0x31')]=_[_0x9a5c('0x45')](_0x28775c['query']);_0x1322da['filters']=_['intersection'](_0x1322da[_0x9a5c('0x34')],_0x1322da['query']);_0x718265[_0x9a5c('0x35')]=_[_0x9a5c('0x33')](_0x1322da['model'],qs[_0x9a5c('0x36')](_0x28775c[_0x9a5c('0x31')]['fields']));_0x718265[_0x9a5c('0x35')]=_0x718265[_0x9a5c('0x35')]['length']?_0x718265['attributes']:_0x1322da[_0x9a5c('0x34')];if(_0x28775c[_0x9a5c('0x31')][_0x9a5c('0x46')]){_0x718265['include']=[{'all':!![]}];}_0x718265=_[_0x9a5c('0x3d')]({},_0x718265,_0x28775c[_0x9a5c('0x40')]);return db[_0x9a5c('0x2d')][_0x9a5c('0x47')](_0x718265)['then'](handleEntityNotFound(_0x38c031,null))[_0x9a5c('0x24')](respondWithResult(_0x38c031,null))[_0x9a5c('0x43')](handleError(_0x38c031,null));};exports['create']=function(_0x28a097,_0x932af5){return db[_0x9a5c('0x2d')][_0x9a5c('0x48')](_0x28a097[_0x9a5c('0x49')],{})[_0x9a5c('0x24')](function(_0xc5cbca){var _0x5e0297=_0x28a097[_0x9a5c('0x4a')]['get']({'plain':!![]});if(!_0x5e0297)throw new Error(_0x9a5c('0x4b'));if(_0x5e0297['role']===_0x9a5c('0x4a')){var _0x281139=_0xc5cbca['get']({'plain':!![]});var _0x32c24='Teams';return db['UserProfileSection'][_0x9a5c('0x47')]({'where':{'name':_0x32c24,'userProfileId':_0x5e0297[_0x9a5c('0x4c')]},'raw':!![]})[_0x9a5c('0x24')](function(_0x5b9f51){if(_0x5b9f51&&_0x5b9f51[_0x9a5c('0x4d')]===0x0){return db[_0x9a5c('0x27')][_0x9a5c('0x48')]({'name':_0x281139[_0x9a5c('0x3f')],'resourceId':_0x281139['id'],'type':_0x5b9f51[_0x9a5c('0x3f')],'sectionId':_0x5b9f51['id']},{})[_0x9a5c('0x24')](function(){return _0xc5cbca;});}else{return _0xc5cbca;}})[_0x9a5c('0x43')](function(_0x40665c){logger[_0x9a5c('0x4e')](_0x9a5c('0x4f'),_0x40665c);throw _0x40665c;});}return _0xc5cbca;})['then'](respondWithResult(_0x932af5,0xc9))['catch'](handleError(_0x932af5,null));};exports[_0x9a5c('0x23')]=function(_0x4545d8,_0x29a024){if(_0x4545d8[_0x9a5c('0x49')]['id']){delete _0x4545d8['body']['id'];}return db['Team'][_0x9a5c('0x47')]({'where':{'id':_0x4545d8[_0x9a5c('0x50')]['id']}})[_0x9a5c('0x24')](handleEntityNotFound(_0x29a024,null))[_0x9a5c('0x24')](saveUpdates(_0x4545d8['body'],null))[_0x9a5c('0x24')](respondWithResult(_0x29a024,null))[_0x9a5c('0x43')](handleError(_0x29a024,null));};exports['destroy']=function(_0x32fa49,_0x2b924c){return db[_0x9a5c('0x2d')][_0x9a5c('0x47')]({'where':{'id':_0x32fa49['params']['id']}})['then'](handleEntityNotFound(_0x2b924c,null))['then'](removeEntity(_0x2b924c,null))[_0x9a5c('0x43')](handleError(_0x2b924c,null));};exports[_0x9a5c('0x51')]=function(_0x546083,_0x40b041,_0x19024a){return db[_0x9a5c('0x2d')]['findOne']({'where':{'id':_0x546083[_0x9a5c('0x50')]['id']}})[_0x9a5c('0x24')](handleEntityNotFound(_0x40b041,null))[_0x9a5c('0x24')](function(_0x2170ac){if(!_0x546083[_0x9a5c('0x31')][_0x9a5c('0x52')]||!utils['isValidChannel'](_0x546083[_0x9a5c('0x31')][_0x9a5c('0x52')])){throw new db[(_0x9a5c('0x53'))][(_0x9a5c('0x54'))](_0x9a5c('0x55'));}var _0x3e14a4={};var _0x54e7ec={};_0x54e7ec[_0x9a5c('0x34')]=_[_0x9a5c('0x45')](db[_[_0x9a5c('0x56')](_0x546083[_0x9a5c('0x31')]['channel'][_0x9a5c('0x57')]())+_0x9a5c('0x58')][_0x9a5c('0x59')]);_0x54e7ec[_0x9a5c('0x31')]=_[_0x9a5c('0x45')](_0x546083['query']);_0x54e7ec[_0x9a5c('0x32')]=_[_0x9a5c('0x33')](_0x54e7ec[_0x9a5c('0x34')],_0x54e7ec[_0x9a5c('0x31')]);_0x3e14a4[_0x9a5c('0x35')]=_[_0x9a5c('0x33')](_0x54e7ec[_0x9a5c('0x34')],qs[_0x9a5c('0x36')](_0x546083['query'][_0x9a5c('0x36')]));_0x3e14a4[_0x9a5c('0x35')]=_0x3e14a4['attributes'][_0x9a5c('0x37')]?_0x3e14a4['attributes']:_0x54e7ec[_0x9a5c('0x34')];_0x3e14a4['limit']=qs[_0x9a5c('0x1f')](_0x546083[_0x9a5c('0x31')]['limit']);_0x3e14a4[_0x9a5c('0x1e')]=qs[_0x9a5c('0x1e')](_0x546083[_0x9a5c('0x31')][_0x9a5c('0x1e')]);_0x3e14a4[_0x9a5c('0x5a')]=qs[_0x9a5c('0x39')](_0x546083[_0x9a5c('0x31')][_0x9a5c('0x39')]);_0x3e14a4[_0x9a5c('0x3a')]=qs[_0x9a5c('0x32')](_[_0x9a5c('0x3b')](_0x546083[_0x9a5c('0x31')],_0x54e7ec['filters']));_0x3e14a4=_[_0x9a5c('0x3d')]({},_0x3e14a4,_0x546083[_0x9a5c('0x40')]);return _0x2170ac[_0x9a5c('0x5b')+_[_0x9a5c('0x56')](_0x546083[_0x9a5c('0x31')][_0x9a5c('0x52')][_0x9a5c('0x57')]())+_0x9a5c('0x5c')](_0x3e14a4);})[_0x9a5c('0x24')](respondWithResult(_0x40b041,null))[_0x9a5c('0x43')](handleError(_0x40b041,null));};exports[_0x9a5c('0x5d')]=function(_0xc82775,_0x5f14dd,_0x4619c8){return db[_0x9a5c('0x2d')]['findOne']({'where':{'id':_0xc82775[_0x9a5c('0x50')]['id']}})['then'](function(_0x911067){if(_0x911067){if(!_0xc82775[_0x9a5c('0x49')][_0x9a5c('0x52')]||!utils[_0x9a5c('0x5e')](_0xc82775[_0x9a5c('0x49')]['channel'])){throw new db[(_0x9a5c('0x53'))][(_0x9a5c('0x54'))](_0x9a5c('0x55'));}return _0x911067[_0x9a5c('0x5f')+_[_0x9a5c('0x56')](_0xc82775[_0x9a5c('0x49')]['channel'][_0x9a5c('0x57')]())+_0x9a5c('0x5c')](_0xc82775[_0x9a5c('0x49')]['ids']);}return null;})[_0x9a5c('0x24')](handleEntityNotFound(_0x5f14dd,null))['then'](respondWithStatusCode(_0x5f14dd,null))[_0x9a5c('0x43')](handleError(_0x5f14dd,null));};exports['removeQueues']=function(_0x6d5edd,_0x508ef5,_0x423b93){return db[_0x9a5c('0x2d')]['findOne']({'where':{'id':_0x6d5edd[_0x9a5c('0x50')]['id']}})[_0x9a5c('0x24')](function(_0x4b7cd6){if(_0x4b7cd6){if(!_0x6d5edd[_0x9a5c('0x31')][_0x9a5c('0x52')]||!utils['isValidChannel'](_0x6d5edd[_0x9a5c('0x31')][_0x9a5c('0x52')])){throw new db[(_0x9a5c('0x53'))][(_0x9a5c('0x54'))](_0x9a5c('0x55'));}return _0x4b7cd6[_0x9a5c('0x60')+_[_0x9a5c('0x56')](_0x6d5edd[_0x9a5c('0x31')][_0x9a5c('0x52')][_0x9a5c('0x57')]())+_0x9a5c('0x5c')](_0x6d5edd[_0x9a5c('0x31')]['ids']);}return null;})[_0x9a5c('0x24')](handleEntityNotFound(_0x508ef5,null))[_0x9a5c('0x24')](respondWithStatusCode(_0x508ef5,null))[_0x9a5c('0x43')](handleError(_0x508ef5,null));};exports[_0x9a5c('0x61')]=function(_0x187e09,_0x2a16c4,_0x18e204){return db[_0x9a5c('0x2d')][_0x9a5c('0x47')]({'where':{'id':_0x187e09['params']['id']}})['then'](handleEntityNotFound(_0x2a16c4,null))[_0x9a5c('0x24')](function(_0x487ee3){if(_0x487ee3){var _0x49cce7=[_0x9a5c('0x62'),_0x9a5c('0x63'),_0x9a5c('0x64'),_0x9a5c('0x65'),_0x9a5c('0x66'),_0x9a5c('0x67')];return BPromise[_0x9a5c('0x68')](_0x49cce7,function(_0x210368){return _0x487ee3[_0x9a5c('0x5b')+_0x210368+_0x9a5c('0x5c')]({'attributes':['id','name']})['then'](function(_0x1fb3ff){return BPromise[_0x9a5c('0x68')](_0x1fb3ff,function(_0x289e2c){return _0x289e2c['addAgents'](_0x187e09[_0x9a5c('0x49')][_0x9a5c('0x69')])['then'](function(){if(_0x210368===_0x9a5c('0x62')){return db['User'][_0x9a5c('0x41')]({'where':{'id':_0x187e09[_0x9a5c('0x49')]['ids']},'attributes':['id',_0x9a5c('0x3f'),_0x9a5c('0x6a'),_0x9a5c('0x6b'),_0x9a5c('0x6c')],'raw':!![]})['then'](function(_0x21f783){return BPromise[_0x9a5c('0x68')](_[_0x9a5c('0x3c')](_0x21f783,{'online':0x1}),function(_0x4a0f9d){return db['UserVoiceQueueRt'][_0x9a5c('0x6d')]({'membername':_0x4a0f9d['name'],'UserId':_0x4a0f9d['id'],'queue_name':_0x289e2c['name'],'VoiceQueueId':_0x289e2c['id'],'interface':_['isNil'](_0x4a0f9d[_0x9a5c('0x6c')])?util[_0x9a5c('0x6e')](_0x9a5c('0x6f'),_0x4a0f9d[_0x9a5c('0x3f')]):_0x4a0f9d[_0x9a5c('0x6c')],'paused':_0x4a0f9d[_0x9a5c('0x6b')]||![],'penalty':0x0});});});}});});})[_0x9a5c('0x24')](function(){return _0x487ee3;});})[_0x9a5c('0x24')](function(){return _0x487ee3;});}})[_0x9a5c('0x24')](function(_0x3c2f8c){if(_0x3c2f8c){return _0x3c2f8c['addAgents'](_0x187e09[_0x9a5c('0x49')][_0x9a5c('0x69')],_[_0x9a5c('0x70')](_0x187e09['body'],['ids','id'])||{})[_0x9a5c('0x71')](function(_0x3c6306){for(var _0x3cb5e4=0x0;_0x3cb5e4<_0x187e09[_0x9a5c('0x49')][_0x9a5c('0x69')][_0x9a5c('0x37')];_0x3cb5e4+=0x1){socket[_0x9a5c('0x72')](_0x9a5c('0x73'),{'UserId':_0x187e09[_0x9a5c('0x49')]['ids'][_0x3cb5e4],'TeamId':_0x187e09[_0x9a5c('0x50')]['id']});}return _0x3c6306;});}})[_0x9a5c('0x24')](respondWithResult(_0x2a16c4,null))['catch'](handleError(_0x2a16c4,null));};exports[_0x9a5c('0x74')]=function(_0x2c2535,_0x276a7c,_0x56b3e5){return db['Team'][_0x9a5c('0x47')]({'where':{'id':_0x2c2535['params']['id']}})[_0x9a5c('0x24')](handleEntityNotFound(_0x276a7c,null))[_0x9a5c('0x24')](function(_0x4f6866){if(_0x4f6866){return BPromise[_0x9a5c('0x68')]([_0x9a5c('0x75'),_0x9a5c('0x76'),_0x9a5c('0x77'),_0x9a5c('0x78'),_0x9a5c('0x79'),'openchannel'],function(_0x5af8aa){return _0x4f6866[_0x9a5c('0x5b')+_[_0x9a5c('0x56')](_0x5af8aa)+'Queues']({'attributes':['id',_0x9a5c('0x3f')]})[_0x9a5c('0x24')](function(_0x2451d5){return BPromise[_0x9a5c('0x68')](_0x2451d5,function(_0x1049e9){return _0x1049e9[_0x9a5c('0x74')](_0x2c2535['query']['ids'])['then'](function(){if(_0x5af8aa===_0x9a5c('0x75')){return db['UserVoiceQueueRt'][_0x9a5c('0x25')]({'where':{'VoiceQueueId':_0x1049e9['id'],'UserId':_0x2c2535[_0x9a5c('0x31')][_0x9a5c('0x69')]}});}});});})[_0x9a5c('0x24')](function(){return _0x4f6866;});})[_0x9a5c('0x24')](function(){return _0x4f6866;});}})[_0x9a5c('0x24')](function(_0x3987e6){if(_0x3987e6){return _0x3987e6[_0x9a5c('0x74')](_0x2c2535[_0x9a5c('0x31')][_0x9a5c('0x69')])[_0x9a5c('0x24')](function(){if(_[_0x9a5c('0x7a')](_0x2c2535[_0x9a5c('0x31')]['ids'])){for(var _0x1776b3=0x0;_0x1776b3<_0x2c2535['query'][_0x9a5c('0x69')]['length'];_0x1776b3+=0x1){socket['emit'](_0x9a5c('0x7b'),{'UserId':Number(_0x2c2535[_0x9a5c('0x31')][_0x9a5c('0x69')][_0x1776b3]),'TeamId':Number(_0x2c2535[_0x9a5c('0x50')]['id'])});}}else{socket[_0x9a5c('0x72')](_0x9a5c('0x7b'),{'UserId':Number(_0x2c2535[_0x9a5c('0x31')][_0x9a5c('0x69')]),'TeamId':Number(_0x2c2535[_0x9a5c('0x50')]['id'])});}});}})[_0x9a5c('0x24')](respondWithStatusCode(_0x276a7c,null))[_0x9a5c('0x43')](handleError(_0x276a7c,null));};exports[_0x9a5c('0x7c')]=function(_0x7fdc21,_0x52a555,_0x56dc26){var _0x34ec8a={};var _0x334d53={};var _0x21aa15;var _0x1672ce;return db['Team'][_0x9a5c('0x7d')]({'where':{'id':_0x7fdc21[_0x9a5c('0x50')]['id']}})[_0x9a5c('0x24')](handleEntityNotFound(_0x52a555,null))[_0x9a5c('0x24')](function(_0x4935a4){if(_0x4935a4){_0x21aa15=_0x4935a4;_0x334d53[_0x9a5c('0x34')]=_[_0x9a5c('0x45')](db[_0x9a5c('0x7e')][_0x9a5c('0x59')]);_0x334d53[_0x9a5c('0x31')]=_[_0x9a5c('0x45')](_0x7fdc21['query']);_0x334d53[_0x9a5c('0x32')]=_[_0x9a5c('0x33')](_0x334d53[_0x9a5c('0x34')],_0x334d53[_0x9a5c('0x31')]);_0x34ec8a[_0x9a5c('0x35')]=_[_0x9a5c('0x33')](_0x334d53[_0x9a5c('0x34')],qs[_0x9a5c('0x36')](_0x7fdc21[_0x9a5c('0x31')]['fields']));_0x34ec8a[_0x9a5c('0x35')]=_0x34ec8a[_0x9a5c('0x35')][_0x9a5c('0x37')]?_0x34ec8a[_0x9a5c('0x35')]:_0x334d53[_0x9a5c('0x34')];_0x34ec8a['order']=qs['sort'](_0x7fdc21[_0x9a5c('0x31')][_0x9a5c('0x39')]);_0x34ec8a['where']=qs[_0x9a5c('0x32')](_[_0x9a5c('0x3b')](_0x7fdc21[_0x9a5c('0x31')],_0x334d53[_0x9a5c('0x32')]));if(_0x7fdc21['query'][_0x9a5c('0x3c')]){_0x34ec8a[_0x9a5c('0x3a')]=_['merge'](_0x34ec8a[_0x9a5c('0x3a')],{'$or':_[_0x9a5c('0x2c')](_0x34ec8a[_0x9a5c('0x35')],function(_0x59303c){var _0x34c541={};_0x34c541[_0x59303c]={'$like':'%'+_0x7fdc21[_0x9a5c('0x31')][_0x9a5c('0x3c')]+'%'};return _0x34c541;})});}_0x34ec8a=_[_0x9a5c('0x3d')]({},_0x34ec8a,_0x7fdc21['options']);return _0x21aa15['getAgents'](_0x34ec8a);}})[_0x9a5c('0x24')](function(_0x15c5fd){if(_0x15c5fd){_0x1672ce=_0x15c5fd[_0x9a5c('0x37')];if(!_0x7fdc21['query'][_0x9a5c('0x7f')](_0x9a5c('0x38'))){_0x34ec8a[_0x9a5c('0x1f')]=qs[_0x9a5c('0x1f')](_0x7fdc21[_0x9a5c('0x31')][_0x9a5c('0x1f')]);_0x34ec8a[_0x9a5c('0x1e')]=qs[_0x9a5c('0x1e')](_0x7fdc21[_0x9a5c('0x31')][_0x9a5c('0x1e')]);}return _0x21aa15['getAgents'](_0x34ec8a);}})['then'](function(_0x39769d){if(_0x39769d){return _0x39769d?{'count':_0x1672ce,'rows':_0x39769d}:null;}})['then'](respondWithResult(_0x52a555,null))[_0x9a5c('0x43')](handleError(_0x52a555,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 731fdd8..652410b 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 _0x414a=['../../mysqldb','Team','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x2de4c0,_0xbdfa1b){var _0xf77a37=function(_0x1ec81a){while(--_0x1ec81a){_0x2de4c0['push'](_0x2de4c0['shift']());}};_0xf77a37(++_0xbdfa1b);}(_0x414a,0x6f));var _0xa414=function(_0x33c5c8,_0x3455ef){_0x33c5c8=_0x33c5c8-0x0;var _0x27f778=_0x414a[_0x33c5c8];return _0x27f778;};'use strict';var EventEmitter=require(_0xa414('0x0'));var Team=require(_0xa414('0x1'))['db'][_0xa414('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa414('0x3'),'afterUpdate':'update','afterDestroy':_0xa414('0x4')};function emitEvent(_0x57d7b8){return function(_0x4f093f,_0x39ae4f,_0x420ae0){TeamEvents[_0xa414('0x5')](_0x57d7b8+':'+_0x4f093f['id'],_0x4f093f);TeamEvents[_0xa414('0x5')](_0x57d7b8,_0x4f093f);_0x420ae0(null);};}for(var e in events){if(events[_0xa414('0x6')](e)){var event=events[e];Team[_0xa414('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xe3fd=['remove','hasOwnProperty','hook','exports','../../mysqldb','Team','save','update'];(function(_0x1a8c53,_0x18edd0){var _0x1315ac=function(_0x20e609){while(--_0x20e609){_0x1a8c53['push'](_0x1a8c53['shift']());}};_0x1315ac(++_0x18edd0);}(_0xe3fd,0x1d4));var _0xde3f=function(_0x24ac9b,_0x36ac5){_0x24ac9b=_0x24ac9b-0x0;var _0x3eeae3=_0xe3fd[_0x24ac9b];return _0x3eeae3;};'use strict';var EventEmitter=require('events');var Team=require(_0xde3f('0x0'))['db'][_0xde3f('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xde3f('0x2'),'afterUpdate':_0xde3f('0x3'),'afterDestroy':_0xde3f('0x4')};function emitEvent(_0x475b95){return function(_0x3deb65,_0x2e16a4,_0x5705ec){TeamEvents['emit'](_0x475b95+':'+_0x3deb65['id'],_0x3deb65);TeamEvents['emit'](_0x475b95,_0x3deb65);_0x5705ec(null);};}for(var e in events){if(events[_0xde3f('0x5')](e)){var event=events[e];Team[_0xde3f('0x6')](e,emitEvent(event));}}module[_0xde3f('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 d3b818d..c8f95e4 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 _0x2715=['util','../../config/logger','path','exports','Team','lodash'];(function(_0x421725,_0x318a04){var _0x51b322=function(_0xe58018){while(--_0xe58018){_0x421725['push'](_0x421725['shift']());}};_0x51b322(++_0x318a04);}(_0x2715,0x179));var _0x5271=function(_0x34974d,_0x1b9c5d){_0x34974d=_0x34974d-0x0;var _0x5c3adf=_0x2715[_0x34974d];return _0x5c3adf;};'use strict';var _=require(_0x5271('0x0'));var util=require(_0x5271('0x1'));var logger=require(_0x5271('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5271('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0x5271('0x4')]=function(_0x3656ee,_0x3ad14e){return _0x3656ee['define'](_0x5271('0x5'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x087e=['bluebird','request-promise','path','../../config/environment','./team.attributes','exports','define','Team','teams','lodash','util','../../config/logger','api','moment'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x087e,0x1f3));var _0xe087=function(_0x1f4aca,_0x37220b){_0x1f4aca=_0x1f4aca-0x0;var _0x22b59f=_0x087e[_0x1f4aca];return _0x22b59f;};'use strict';var _=require(_0xe087('0x0'));var util=require(_0xe087('0x1'));var logger=require(_0xe087('0x2'))(_0xe087('0x3'));var moment=require(_0xe087('0x4'));var BPromise=require(_0xe087('0x5'));var rp=require(_0xe087('0x6'));var fs=require('fs');var path=require(_0xe087('0x7'));var rimraf=require('rimraf');var config=require(_0xe087('0x8'));var attributes=require(_0xe087('0x9'));module[_0xe087('0xa')]=function(_0x1698e9,_0x2d88df){return _0x1698e9[_0xe087('0xb')](_0xe087('0xc'),attributes,{'tableName':_0xe087('0xd'),'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 b92f38b..4603f08 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 _0xe363=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','socket.io-emitter','redis','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x2be184,_0xc89414){var _0x1c1d30=function(_0x23b7e0){while(--_0x23b7e0){_0x2be184['push'](_0x2be184['shift']());}};_0x1c1d30(++_0xc89414);}(_0xe363,0x1c8));var _0x3e36=function(_0xbfe85c,_0x301dc2){_0xbfe85c=_0xbfe85c-0x0;var _0x1a6a31=_0xe363[_0xbfe85c];return _0x1a6a31;};'use strict';var _=require(_0x3e36('0x0'));var util=require(_0x3e36('0x1'));var moment=require(_0x3e36('0x2'));var BPromise=require(_0x3e36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e36('0x4'));var db=require(_0x3e36('0x5'))['db'];var utils=require(_0x3e36('0x6'));var logger=require(_0x3e36('0x7'))(_0x3e36('0x8'));var config=require('../../config/environment');var jayson=require(_0x3e36('0x9'));var client=jayson[_0x3e36('0xa')][_0x3e36('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3e36('0xc'))(new Redis(config[_0x3e36('0xd')]));require('./team.socket')[_0x3e36('0xe')](socket);function respondWithRpcPromise(_0x4c7917,_0x56d08a,_0x523195){return new BPromise(function(_0x5d1dfe,_0x2f7c8a){return client[_0x3e36('0xf')](_0x4c7917,_0x523195)[_0x3e36('0x10')](function(_0x2f76d5){logger[_0x3e36('0x11')](_0x3e36('0x12'),_0x56d08a,_0x3e36('0x13'));logger[_0x3e36('0x14')](_0x3e36('0x15'),_0x56d08a,_0x3e36('0x13'),JSON[_0x3e36('0x16')](_0x2f76d5));if(_0x2f76d5[_0x3e36('0x17')]){if(_0x2f76d5[_0x3e36('0x17')]['code']===0x1f4){logger[_0x3e36('0x17')](_0x3e36('0x12'),_0x56d08a,_0x2f76d5[_0x3e36('0x17')][_0x3e36('0x18')]);return _0x2f7c8a(_0x2f76d5[_0x3e36('0x17')]['message']);}logger[_0x3e36('0x17')]('Team,\x20%s,\x20%s',_0x56d08a,_0x2f76d5['error'][_0x3e36('0x18')]);return _0x5d1dfe(_0x2f76d5[_0x3e36('0x17')][_0x3e36('0x18')]);}else{logger[_0x3e36('0x11')]('Team,\x20%s,\x20%s',_0x56d08a,'request\x20sent');_0x5d1dfe(_0x2f76d5[_0x3e36('0x19')][_0x3e36('0x18')]);}})[_0x3e36('0x1a')](function(_0x189980){logger[_0x3e36('0x17')](_0x3e36('0x12'),_0x56d08a,_0x189980);_0x2f7c8a(_0x189980);});});} \ No newline at end of file +var _0x1721=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Team,\x20%s,\x20%s','catch','lodash','util','moment'];(function(_0x22f48d,_0x51b8e1){var _0x26ba9a=function(_0x5ee718){while(--_0x5ee718){_0x22f48d['push'](_0x22f48d['shift']());}};_0x26ba9a(++_0x51b8e1);}(_0x1721,0x102));var _0x1172=function(_0x230c8c,_0x5a39c2){_0x230c8c=_0x230c8c-0x0;var _0x443f00=_0x1721[_0x230c8c];return _0x443f00;};'use strict';var _=require(_0x1172('0x0'));var util=require(_0x1172('0x1'));var moment=require(_0x1172('0x2'));var BPromise=require('bluebird');var rs=require(_0x1172('0x3'));var fs=require('fs');var Redis=require(_0x1172('0x4'));var db=require(_0x1172('0x5'))['db'];var utils=require(_0x1172('0x6'));var logger=require('../../config/logger')(_0x1172('0x7'));var config=require('../../config/environment');var jayson=require(_0x1172('0x8'));var client=jayson[_0x1172('0x9')][_0x1172('0xa')]({'port':0x232a});config[_0x1172('0xb')]=_[_0x1172('0xc')](config[_0x1172('0xb')],{'host':_0x1172('0xd'),'port':0x18eb});var socket=require(_0x1172('0xe'))(new Redis(config[_0x1172('0xb')]));require(_0x1172('0xf'))[_0x1172('0x10')](socket);function respondWithRpcPromise(_0x2bd401,_0x5b5b91,_0x250092){return new BPromise(function(_0x4f719d,_0x53769d){return client[_0x1172('0x11')](_0x2bd401,_0x250092)[_0x1172('0x12')](function(_0x177685){logger[_0x1172('0x13')]('Team,\x20%s,\x20%s',_0x5b5b91,_0x1172('0x14'));logger[_0x1172('0x15')](_0x1172('0x16'),_0x5b5b91,'request\x20sent',JSON[_0x1172('0x17')](_0x177685));if(_0x177685[_0x1172('0x18')]){if(_0x177685[_0x1172('0x18')][_0x1172('0x19')]===0x1f4){logger[_0x1172('0x18')]('Team,\x20%s,\x20%s',_0x5b5b91,_0x177685[_0x1172('0x18')][_0x1172('0x1a')]);return _0x53769d(_0x177685[_0x1172('0x18')][_0x1172('0x1a')]);}logger[_0x1172('0x18')](_0x1172('0x1b'),_0x5b5b91,_0x177685[_0x1172('0x18')][_0x1172('0x1a')]);return _0x4f719d(_0x177685['error']['message']);}else{logger[_0x1172('0x13')](_0x1172('0x1b'),_0x5b5b91,'request\x20sent');_0x4f719d(_0x177685['result']['message']);}})[_0x1172('0x1c')](function(_0x4d0702){logger['error']('Team,\x20%s,\x20%s',_0x5b5b91,_0x4d0702);_0x53769d(_0x4d0702);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 81e777d..e3f88e2 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 _0xe14a=['removeListener','register','length','team:'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0xe14a,0x94));var _0xae14=function(_0x37a1a7,_0x5e736e){_0x37a1a7=_0x37a1a7-0x0;var _0x5580a3=_0xe14a[_0x37a1a7];return _0x5580a3;};'use strict';var TeamEvents=require('./team.events');var events=['save','remove','update'];function createListener(_0x4ed72e,_0x14d5a7){return function(_0xb92ae1){_0x14d5a7['emit'](_0x4ed72e,_0xb92ae1);};}function removeListener(_0x16bd5f,_0x2736f8){return function(){TeamEvents[_0xae14('0x0')](_0x16bd5f,_0x2736f8);};}exports[_0xae14('0x1')]=function(_0x2b5138){for(var _0x3a6279=0x0,_0xbdeb24=events[_0xae14('0x2')];_0x3a6279<_0xbdeb24;_0x3a6279++){var _0x19d9b8=events[_0x3a6279];var _0x1efd2c=createListener(_0xae14('0x3')+_0x19d9b8,_0x2b5138);TeamEvents['on'](_0x19d9b8,_0x1efd2c);}}; \ No newline at end of file +var _0xb7f0=['emit','removeListener','register','length','team:','./team.events','save','remove','update'];(function(_0x26e9d8,_0x4e7d4c){var _0x1df29d=function(_0x3f5cbd){while(--_0x3f5cbd){_0x26e9d8['push'](_0x26e9d8['shift']());}};_0x1df29d(++_0x4e7d4c);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xb7f0[_0x31e29a];return _0x32d892;};'use strict';var TeamEvents=require(_0x0b7f('0x0'));var events=[_0x0b7f('0x1'),_0x0b7f('0x2'),_0x0b7f('0x3')];function createListener(_0x4d30e5,_0x47efe2){return function(_0x3f0c98){_0x47efe2[_0x0b7f('0x4')](_0x4d30e5,_0x3f0c98);};}function removeListener(_0x228377,_0x188ea8){return function(){TeamEvents[_0x0b7f('0x5')](_0x228377,_0x188ea8);};}exports[_0x0b7f('0x6')]=function(_0x1c3c26){for(var _0x1ba1e8=0x0,_0x10dc6c=events[_0x0b7f('0x7')];_0x1ba1e8<_0x10dc6c;_0x1ba1e8++){var _0x53f9a5=events[_0x1ba1e8];var _0x98065a=createListener(_0x0b7f('0x8')+_0x53f9a5,_0x1c3c26);TeamEvents['on'](_0x53f9a5,_0x98065a);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 8869be4..0bea5a0 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 _0xe699=['../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4ffa20,_0x2df5bf){var _0x34582e=function(_0x514749){while(--_0x514749){_0x4ffa20['push'](_0x4ffa20['shift']());}};_0x34582e(++_0x2df5bf);}(_0xe699,0x71));var _0x9e69=function(_0x5eb8fd,_0x17a04b){_0x5eb8fd=_0x5eb8fd-0x0;var _0x191d26=_0xe699[_0x5eb8fd];return _0x191d26;};'use strict';var multer=require(_0x9e69('0x0'));var util=require(_0x9e69('0x1'));var path=require(_0x9e69('0x2'));var timeout=require(_0x9e69('0x3'));var express=require(_0x9e69('0x4'));var router=express[_0x9e69('0x5')]();var auth=require(_0x9e69('0x6'));var interaction=require(_0x9e69('0x7'));var config=require(_0x9e69('0x8'));var controller=require(_0x9e69('0x9'));router['get']('/',auth[_0x9e69('0xa')](),controller[_0x9e69('0xb')]);router[_0x9e69('0xc')](_0x9e69('0xd'),auth[_0x9e69('0xa')](),controller[_0x9e69('0xe')]);router['post']('/',auth[_0x9e69('0xa')](),controller[_0x9e69('0xf')]);router[_0x9e69('0x10')](_0x9e69('0xd'),auth[_0x9e69('0xa')](),controller[_0x9e69('0x11')]);router[_0x9e69('0x12')]('/:id',auth[_0x9e69('0xa')](),controller[_0x9e69('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe5c9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports'];(function(_0xe9660d,_0x5801c9){var _0x167062=function(_0x35c9d7){while(--_0x35c9d7){_0xe9660d['push'](_0xe9660d['shift']());}};_0x167062(++_0x5801c9);}(_0xe5c9,0x1e3));var _0x9e5c=function(_0x19a73e,_0x365967){_0x19a73e=_0x19a73e-0x0;var _0x4b3283=_0xe5c9[_0x19a73e];return _0x4b3283;};'use strict';var multer=require('multer');var util=require(_0x9e5c('0x0'));var path=require(_0x9e5c('0x1'));var timeout=require(_0x9e5c('0x2'));var express=require(_0x9e5c('0x3'));var router=express[_0x9e5c('0x4')]();var auth=require(_0x9e5c('0x5'));var interaction=require(_0x9e5c('0x6'));var config=require(_0x9e5c('0x7'));var controller=require(_0x9e5c('0x8'));router[_0x9e5c('0x9')]('/',auth[_0x9e5c('0xa')](),controller[_0x9e5c('0xb')]);router[_0x9e5c('0x9')]('/:id',auth[_0x9e5c('0xa')](),controller[_0x9e5c('0xc')]);router[_0x9e5c('0xd')]('/',auth[_0x9e5c('0xa')](),controller[_0x9e5c('0xe')]);router[_0x9e5c('0xf')]('/:id',auth[_0x9e5c('0xa')](),controller[_0x9e5c('0x10')]);router[_0x9e5c('0x11')](_0x9e5c('0x12'),auth[_0x9e5c('0xa')](),controller[_0x9e5c('0x13')]);module[_0x9e5c('0x14')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 681f83d..a59ac96 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 _0xc1f0=['exports','STRING','TEXT','sequelize'];(function(_0x114a8d,_0x28352c){var _0x107c80=function(_0x4333c4){while(--_0x4333c4){_0x114a8d['push'](_0x114a8d['shift']());}};_0x107c80(++_0x28352c);}(_0xc1f0,0x10f));var _0x0c1f=function(_0x1d4cb0,_0x21815d){_0x1d4cb0=_0x1d4cb0-0x0;var _0x22963b=_0xc1f0[_0x1d4cb0];return _0x22963b;};'use strict';var Sequelize=require(_0x0c1f('0x0'));module[_0x0c1f('0x1')]={'name':{'type':Sequelize[_0x0c1f('0x2')]},'description':{'type':Sequelize[_0x0c1f('0x2')]},'html':{'type':Sequelize[_0x0c1f('0x3')]}}; \ No newline at end of file +var _0xa9a2=['STRING','TEXT','sequelize'];(function(_0x2612f6,_0x16d381){var _0x20d731=function(_0x4cf03d){while(--_0x4cf03d){_0x2612f6['push'](_0x2612f6['shift']());}};_0x20d731(++_0x16d381);}(_0xa9a2,0x1af));var _0x2a9a=function(_0x3ce6d2,_0x90364d){_0x3ce6d2=_0x3ce6d2-0x0;var _0x4c1dd4=_0xa9a2[_0x3ce6d2];return _0x4c1dd4;};'use strict';var Sequelize=require(_0x2a9a('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a9a('0x1')]},'description':{'type':Sequelize[_0x2a9a('0x1')]},'html':{'type':Sequelize[_0x2a9a('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 90f30d7..d717937 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 _0x770d=['stack','name','send','index','map','rawAttributes','model','intersection','query','attributes','fields','length','nolimit','limit','offset','sort','where','pick','filters','type','VIRTUAL','filter','includeAll','findAll','rows','catch','keys','Template','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','json','count','status','set','Content-Range','apply','reject','save','then','get','Templates','destroy','error'];(function(_0x42b8b1,_0x38709f){var _0x1fe643=function(_0x355e8d){while(--_0x355e8d){_0x42b8b1['push'](_0x42b8b1['shift']());}};_0x1fe643(++_0x38709f);}(_0x770d,0x16d));var _0xd770=function(_0x586b04,_0x13b545){_0x586b04=_0x586b04-0x0;var _0x1af910=_0x770d[_0x586b04];return _0x1af910;};'use strict';var pdf=require(_0xd770('0x0'));var emlformat=require(_0xd770('0x1'));var rimraf=require(_0xd770('0x2'));var zipdir=require(_0xd770('0x3'));var jsonpatch=require(_0xd770('0x4'));var rp=require(_0xd770('0x5'));var moment=require(_0xd770('0x6'));var BPromise=require(_0xd770('0x7'));var Mustache=require(_0xd770('0x8'));var util=require(_0xd770('0x9'));var path=require(_0xd770('0xa'));var sox=require(_0xd770('0xb'));var csv=require(_0xd770('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd770('0xd'));var squel=require(_0xd770('0xe'));var crypto=require(_0xd770('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd770('0x10'));var toCsv=require(_0xd770('0xc'));var querystring=require('querystring');var Papa=require(_0xd770('0x11'));var Redis=require(_0xd770('0x12'));var authService=require(_0xd770('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd770('0x14'));var hardwareService=require(_0xd770('0x15'));var logger=require(_0xd770('0x16'))(_0xd770('0x17'));var utils=require(_0xd770('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e66be,_0x162d32){_0x162d32=_0x162d32||0xcc;return function(_0x5e2a99){if(_0x5e2a99){return _0x1e66be[_0xd770('0x19')](_0x162d32);}return _0x1e66be['status'](_0x162d32)[_0xd770('0x1a')]();};}function respondWithResult(_0x483e45,_0x360652){_0x360652=_0x360652||0xc8;return function(_0x2d8143){if(_0x2d8143){return _0x483e45['status'](_0x360652)[_0xd770('0x1b')](_0x2d8143);}};}function respondWithFilteredResult(_0x476d5e,_0xf080e8){return function(_0x2953d8){if(_0x2953d8){var _0x4922ed=_0x2953d8[_0xd770('0x1c')],_0xeeb108=_0xf080e8['offset'],_0x54e910=_0xf080e8['offset']+_0xf080e8['limit'],_0x4d78db;if(_0x54e910>=_0x4922ed){_0x54e910=_0x4922ed;_0x4d78db=0xc8;}else{_0x4d78db=0xce;}_0x476d5e[_0xd770('0x1d')](_0x4d78db);return _0x476d5e[_0xd770('0x1e')](_0xd770('0x1f'),_0xeeb108+'-'+_0x54e910+'/'+_0x4922ed)['json'](_0x2953d8);}return null;};}function patchUpdates(_0x418ea8){return function(_0x457ef1){try{jsonpatch[_0xd770('0x20')](_0x457ef1,_0x418ea8,!![]);}catch(_0xee5a8){return BPromise[_0xd770('0x21')](_0xee5a8);}return _0x457ef1[_0xd770('0x22')]();};}function saveUpdates(_0x27f2b1,_0x437574){return function(_0x46bcce){if(_0x46bcce){return _0x46bcce['update'](_0x27f2b1)['then'](function(_0x9593e5){return _0x9593e5;});}return null;};}function removeEntity(_0x2c32c6,_0x152cd3){return function(_0x55265d){if(_0x55265d){return _0x55265d['destroy']()[_0xd770('0x23')](function(){var _0x33757b=_0x55265d[_0xd770('0x24')]({'plain':!![]});var _0x3f4baa=_0xd770('0x25');return db['UserProfileResource'][_0xd770('0x26')]({'where':{'type':_0x3f4baa,'resourceId':_0x33757b['id']}})[_0xd770('0x23')](function(){return _0x55265d;});})[_0xd770('0x23')](function(){_0x2c32c6[_0xd770('0x1d')](0xcc)[_0xd770('0x1a')]();});}};}function handleEntityNotFound(_0x31072b,_0xc6ef19){return function(_0x4a7f09){if(!_0x4a7f09){_0x31072b[_0xd770('0x19')](0x194);}return _0x4a7f09;};}function handleError(_0x473889,_0x599af2){_0x599af2=_0x599af2||0x1f4;return function(_0x34c7c0){logger[_0xd770('0x27')](_0x34c7c0[_0xd770('0x28')]);if(_0x34c7c0[_0xd770('0x29')]){delete _0x34c7c0[_0xd770('0x29')];}_0x473889[_0xd770('0x1d')](_0x599af2)[_0xd770('0x2a')](_0x34c7c0);};}exports[_0xd770('0x2b')]=function(_0x31cc3b,_0x1a532d){var _0x798fe2={},_0x50be0a={},_0xb905ea={'count':0x0,'rows':[]};var _0x292607=_[_0xd770('0x2c')](db['Template'][_0xd770('0x2d')],function(_0x57ecbd){return{'name':_0x57ecbd['fieldName'],'type':_0x57ecbd['type']['key']};});_0x50be0a[_0xd770('0x2e')]=_[_0xd770('0x2c')](_0x292607,_0xd770('0x29'));_0x50be0a['query']=_['keys'](_0x31cc3b['query']);_0x50be0a['filters']=_[_0xd770('0x2f')](_0x50be0a[_0xd770('0x2e')],_0x50be0a[_0xd770('0x30')]);_0x798fe2[_0xd770('0x31')]=_[_0xd770('0x2f')](_0x50be0a['model'],qs[_0xd770('0x32')](_0x31cc3b[_0xd770('0x30')]['fields']));_0x798fe2[_0xd770('0x31')]=_0x798fe2[_0xd770('0x31')][_0xd770('0x33')]?_0x798fe2[_0xd770('0x31')]:_0x50be0a[_0xd770('0x2e')];if(!_0x31cc3b['query']['hasOwnProperty'](_0xd770('0x34'))){_0x798fe2['limit']=qs[_0xd770('0x35')](_0x31cc3b[_0xd770('0x30')][_0xd770('0x35')]);_0x798fe2[_0xd770('0x36')]=qs[_0xd770('0x36')](_0x31cc3b[_0xd770('0x30')][_0xd770('0x36')]);}_0x798fe2['order']=qs[_0xd770('0x37')](_0x31cc3b[_0xd770('0x30')][_0xd770('0x37')]);_0x798fe2[_0xd770('0x38')]=qs['filters'](_[_0xd770('0x39')](_0x31cc3b['query'],_0x50be0a[_0xd770('0x3a')]));if(_0x31cc3b['query']['filter']){_0x798fe2[_0xd770('0x38')]=_['merge'](_0x798fe2['where'],{'$or':_[_0xd770('0x2c')](_0x292607,function(_0x45922f){if(_0x45922f[_0xd770('0x3b')]!==_0xd770('0x3c')){var _0x2e126e={};_0x2e126e[_0x45922f['name']]={'$like':'%'+_0x31cc3b[_0xd770('0x30')][_0xd770('0x3d')]+'%'};return _0x2e126e;}})});}_0x798fe2=_['merge']({},_0x798fe2,_0x31cc3b['options']);var _0x379f98={'where':_0x798fe2[_0xd770('0x38')]};return db['Template']['count'](_0x379f98)[_0xd770('0x23')](function(_0x1c776a){_0xb905ea['count']=_0x1c776a;if(_0x31cc3b[_0xd770('0x30')][_0xd770('0x3e')]){_0x798fe2['include']=[{'all':!![]}];}return db['Template'][_0xd770('0x3f')](_0x798fe2);})[_0xd770('0x23')](function(_0x492f9c){_0xb905ea[_0xd770('0x40')]=_0x492f9c;return _0xb905ea;})['then'](respondWithFilteredResult(_0x1a532d,_0x798fe2))[_0xd770('0x41')](handleError(_0x1a532d,null));};exports['show']=function(_0x4d908a,_0x554c40){var _0x137d96={'raw':!![],'where':{'id':_0x4d908a['params']['id']}},_0x3c4a4e={};_0x3c4a4e[_0xd770('0x2e')]=_[_0xd770('0x42')](db[_0xd770('0x43')]['rawAttributes']);_0x3c4a4e[_0xd770('0x30')]=_[_0xd770('0x42')](_0x4d908a[_0xd770('0x30')]);_0x3c4a4e[_0xd770('0x3a')]=_[_0xd770('0x2f')](_0x3c4a4e[_0xd770('0x2e')],_0x3c4a4e[_0xd770('0x30')]);_0x137d96[_0xd770('0x31')]=_[_0xd770('0x2f')](_0x3c4a4e['model'],qs[_0xd770('0x32')](_0x4d908a[_0xd770('0x30')][_0xd770('0x32')]));_0x137d96['attributes']=_0x137d96[_0xd770('0x31')][_0xd770('0x33')]?_0x137d96[_0xd770('0x31')]:_0x3c4a4e[_0xd770('0x2e')];if(_0x4d908a[_0xd770('0x30')][_0xd770('0x3e')]){_0x137d96[_0xd770('0x44')]=[{'all':!![]}];}_0x137d96=_['merge']({},_0x137d96,_0x4d908a[_0xd770('0x45')]);return db[_0xd770('0x43')][_0xd770('0x46')](_0x137d96)[_0xd770('0x23')](handleEntityNotFound(_0x554c40,null))['then'](respondWithResult(_0x554c40,null))['catch'](handleError(_0x554c40,null));};exports['create']=function(_0x14e586,_0x563454){return db['Template'][_0xd770('0x47')](_0x14e586['body'],{})['then'](function(_0x147bcc){var _0x2b74a3=_0x14e586[_0xd770('0x48')][_0xd770('0x24')]({'plain':!![]});if(!_0x2b74a3)throw new Error(_0xd770('0x49'));if(_0x2b74a3[_0xd770('0x4a')]===_0xd770('0x48')){var _0x5ee15d=_0x147bcc[_0xd770('0x24')]({'plain':!![]});var _0x300b6d=_0xd770('0x25');return db['UserProfileSection'][_0xd770('0x46')]({'where':{'name':_0x300b6d,'userProfileId':_0x2b74a3[_0xd770('0x4b')]},'raw':!![]})[_0xd770('0x23')](function(_0x132ef9){if(_0x132ef9&&_0x132ef9[_0xd770('0x4c')]===0x0){return db[_0xd770('0x4d')]['create']({'name':_0x5ee15d[_0xd770('0x29')],'resourceId':_0x5ee15d['id'],'type':_0x132ef9[_0xd770('0x29')],'sectionId':_0x132ef9['id']},{})[_0xd770('0x23')](function(){return _0x147bcc;});}else{return _0x147bcc;}})[_0xd770('0x41')](function(_0x4482eb){logger[_0xd770('0x27')](_0xd770('0x4e'),_0x4482eb);throw _0x4482eb;});}return _0x147bcc;})[_0xd770('0x23')](respondWithResult(_0x563454,0xc9))['catch'](handleError(_0x563454,null));};exports['update']=function(_0x4c8125,_0x5528cd){if(_0x4c8125[_0xd770('0x4f')]['id']){delete _0x4c8125['body']['id'];}return db['Template'][_0xd770('0x46')]({'where':{'id':_0x4c8125[_0xd770('0x50')]['id']}})[_0xd770('0x23')](handleEntityNotFound(_0x5528cd,null))['then'](saveUpdates(_0x4c8125[_0xd770('0x4f')],null))[_0xd770('0x23')](respondWithResult(_0x5528cd,null))['catch'](handleError(_0x5528cd,null));};exports[_0xd770('0x26')]=function(_0x44d51d,_0x52226f){return db['Template'][_0xd770('0x46')]({'where':{'id':_0x44d51d[_0xd770('0x50')]['id']}})[_0xd770('0x23')](handleEntityNotFound(_0x52226f,null))[_0xd770('0x23')](removeEntity(_0x52226f,null))[_0xd770('0x41')](handleError(_0x52226f,null));}; \ No newline at end of file +var _0xaeff=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','then','get','Templates','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','Template','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','squel','crypto','to-csv','querystring'];(function(_0x240289,_0x2b1170){var _0x242b43=function(_0x3c96a6){while(--_0x3c96a6){_0x240289['push'](_0x240289['shift']());}};_0x242b43(++_0x2b1170);}(_0xaeff,0x1de));var _0xfaef=function(_0x977abd,_0x3d0eb4){_0x977abd=_0x977abd-0x0;var _0xb0d6c1=_0xaeff[_0x977abd];return _0xb0d6c1;};'use strict';var pdf=require(_0xfaef('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfaef('0x1'));var zipdir=require(_0xfaef('0x2'));var jsonpatch=require(_0xfaef('0x3'));var rp=require(_0xfaef('0x4'));var moment=require('moment');var BPromise=require(_0xfaef('0x5'));var Mustache=require(_0xfaef('0x6'));var util=require(_0xfaef('0x7'));var path=require(_0xfaef('0x8'));var sox=require(_0xfaef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfaef('0xa'));var crypto=require(_0xfaef('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfaef('0xc'));var querystring=require(_0xfaef('0xd'));var Papa=require(_0xfaef('0xe'));var Redis=require(_0xfaef('0xf'));var authService=require(_0xfaef('0x10'));var qs=require(_0xfaef('0x11'));var as=require(_0xfaef('0x12'));var hardwareService=require(_0xfaef('0x13'));var logger=require('../../config/logger')(_0xfaef('0x14'));var utils=require(_0xfaef('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x922c44,_0x96d55d){_0x96d55d=_0x96d55d||0xcc;return function(_0x58f5a7){if(_0x58f5a7){return _0x922c44[_0xfaef('0x16')](_0x96d55d);}return _0x922c44['status'](_0x96d55d)[_0xfaef('0x17')]();};}function respondWithResult(_0x1fb3cf,_0x3e973d){_0x3e973d=_0x3e973d||0xc8;return function(_0x4cb604){if(_0x4cb604){return _0x1fb3cf[_0xfaef('0x18')](_0x3e973d)['json'](_0x4cb604);}};}function respondWithFilteredResult(_0x7d72dc,_0x5c820c){return function(_0x2c76f6){if(_0x2c76f6){var _0x2af6a8=_0x2c76f6[_0xfaef('0x19')],_0x1c27ae=_0x5c820c[_0xfaef('0x1a')],_0x9e3e2f=_0x5c820c[_0xfaef('0x1a')]+_0x5c820c[_0xfaef('0x1b')],_0x13f7a2;if(_0x9e3e2f>=_0x2af6a8){_0x9e3e2f=_0x2af6a8;_0x13f7a2=0xc8;}else{_0x13f7a2=0xce;}_0x7d72dc[_0xfaef('0x18')](_0x13f7a2);return _0x7d72dc[_0xfaef('0x1c')]('Content-Range',_0x1c27ae+'-'+_0x9e3e2f+'/'+_0x2af6a8)[_0xfaef('0x1d')](_0x2c76f6);}return null;};}function patchUpdates(_0x1d1d1e){return function(_0x502afd){try{jsonpatch[_0xfaef('0x1e')](_0x502afd,_0x1d1d1e,!![]);}catch(_0x37eb97){return BPromise[_0xfaef('0x1f')](_0x37eb97);}return _0x502afd['save']();};}function saveUpdates(_0x33ec4d,_0x430f37){return function(_0x209ad2){if(_0x209ad2){return _0x209ad2[_0xfaef('0x20')](_0x33ec4d)['then'](function(_0x33fe85){return _0x33fe85;});}return null;};}function removeEntity(_0x4e088e,_0x4f3435){return function(_0x161ec3){if(_0x161ec3){return _0x161ec3['destroy']()[_0xfaef('0x21')](function(){var _0x3a984a=_0x161ec3[_0xfaef('0x22')]({'plain':!![]});var _0x513dde=_0xfaef('0x23');return db['UserProfileResource'][_0xfaef('0x24')]({'where':{'type':_0x513dde,'resourceId':_0x3a984a['id']}})[_0xfaef('0x21')](function(){return _0x161ec3;});})[_0xfaef('0x21')](function(){_0x4e088e[_0xfaef('0x18')](0xcc)[_0xfaef('0x17')]();});}};}function handleEntityNotFound(_0x131837,_0x3424fb){return function(_0x31edda){if(!_0x31edda){_0x131837['sendStatus'](0x194);}return _0x31edda;};}function handleError(_0x37424d,_0x53bbb9){_0x53bbb9=_0x53bbb9||0x1f4;return function(_0x5c2311){logger[_0xfaef('0x25')](_0x5c2311[_0xfaef('0x26')]);if(_0x5c2311[_0xfaef('0x27')]){delete _0x5c2311[_0xfaef('0x27')];}_0x37424d['status'](_0x53bbb9)[_0xfaef('0x28')](_0x5c2311);};}exports[_0xfaef('0x29')]=function(_0x9a0320,_0x4a6007){var _0x3b2273={},_0x91e12={},_0x1fcd59={'count':0x0,'rows':[]};var _0x44019d=_[_0xfaef('0x2a')](db['Template'][_0xfaef('0x2b')],function(_0x4012f1){return{'name':_0x4012f1[_0xfaef('0x2c')],'type':_0x4012f1[_0xfaef('0x2d')][_0xfaef('0x2e')]};});_0x91e12[_0xfaef('0x2f')]=_[_0xfaef('0x2a')](_0x44019d,_0xfaef('0x27'));_0x91e12[_0xfaef('0x30')]=_[_0xfaef('0x31')](_0x9a0320['query']);_0x91e12[_0xfaef('0x32')]=_[_0xfaef('0x33')](_0x91e12[_0xfaef('0x2f')],_0x91e12[_0xfaef('0x30')]);_0x3b2273['attributes']=_[_0xfaef('0x33')](_0x91e12['model'],qs[_0xfaef('0x34')](_0x9a0320['query'][_0xfaef('0x34')]));_0x3b2273[_0xfaef('0x35')]=_0x3b2273['attributes'][_0xfaef('0x36')]?_0x3b2273[_0xfaef('0x35')]:_0x91e12[_0xfaef('0x2f')];if(!_0x9a0320['query'][_0xfaef('0x37')](_0xfaef('0x38'))){_0x3b2273[_0xfaef('0x1b')]=qs[_0xfaef('0x1b')](_0x9a0320['query'][_0xfaef('0x1b')]);_0x3b2273['offset']=qs[_0xfaef('0x1a')](_0x9a0320[_0xfaef('0x30')][_0xfaef('0x1a')]);}_0x3b2273[_0xfaef('0x39')]=qs[_0xfaef('0x3a')](_0x9a0320[_0xfaef('0x30')][_0xfaef('0x3a')]);_0x3b2273[_0xfaef('0x3b')]=qs[_0xfaef('0x32')](_['pick'](_0x9a0320[_0xfaef('0x30')],_0x91e12[_0xfaef('0x32')]));if(_0x9a0320[_0xfaef('0x30')][_0xfaef('0x3c')]){_0x3b2273[_0xfaef('0x3b')]=_['merge'](_0x3b2273[_0xfaef('0x3b')],{'$or':_[_0xfaef('0x2a')](_0x44019d,function(_0x5c250e){if(_0x5c250e[_0xfaef('0x2d')]!==_0xfaef('0x3d')){var _0x1299bc={};_0x1299bc[_0x5c250e[_0xfaef('0x27')]]={'$like':'%'+_0x9a0320[_0xfaef('0x30')][_0xfaef('0x3c')]+'%'};return _0x1299bc;}})});}_0x3b2273=_[_0xfaef('0x3e')]({},_0x3b2273,_0x9a0320[_0xfaef('0x3f')]);var _0x3a7c8a={'where':_0x3b2273[_0xfaef('0x3b')]};return db['Template'][_0xfaef('0x19')](_0x3a7c8a)[_0xfaef('0x21')](function(_0x122226){_0x1fcd59['count']=_0x122226;if(_0x9a0320['query'][_0xfaef('0x40')]){_0x3b2273[_0xfaef('0x41')]=[{'all':!![]}];}return db[_0xfaef('0x42')][_0xfaef('0x43')](_0x3b2273);})[_0xfaef('0x21')](function(_0x18f95c){_0x1fcd59[_0xfaef('0x44')]=_0x18f95c;return _0x1fcd59;})[_0xfaef('0x21')](respondWithFilteredResult(_0x4a6007,_0x3b2273))[_0xfaef('0x45')](handleError(_0x4a6007,null));};exports[_0xfaef('0x46')]=function(_0x2e5b9d,_0x206489){var _0x206a19={'raw':!![],'where':{'id':_0x2e5b9d['params']['id']}},_0xfb8054={};_0xfb8054['model']=_[_0xfaef('0x31')](db[_0xfaef('0x42')][_0xfaef('0x2b')]);_0xfb8054[_0xfaef('0x30')]=_['keys'](_0x2e5b9d[_0xfaef('0x30')]);_0xfb8054[_0xfaef('0x32')]=_[_0xfaef('0x33')](_0xfb8054[_0xfaef('0x2f')],_0xfb8054['query']);_0x206a19['attributes']=_[_0xfaef('0x33')](_0xfb8054[_0xfaef('0x2f')],qs[_0xfaef('0x34')](_0x2e5b9d[_0xfaef('0x30')][_0xfaef('0x34')]));_0x206a19[_0xfaef('0x35')]=_0x206a19['attributes']['length']?_0x206a19[_0xfaef('0x35')]:_0xfb8054[_0xfaef('0x2f')];if(_0x2e5b9d[_0xfaef('0x30')][_0xfaef('0x40')]){_0x206a19['include']=[{'all':!![]}];}_0x206a19=_[_0xfaef('0x3e')]({},_0x206a19,_0x2e5b9d['options']);return db[_0xfaef('0x42')][_0xfaef('0x47')](_0x206a19)['then'](handleEntityNotFound(_0x206489,null))[_0xfaef('0x21')](respondWithResult(_0x206489,null))[_0xfaef('0x45')](handleError(_0x206489,null));};exports[_0xfaef('0x48')]=function(_0x2b743c,_0x4ce4bf){return db['Template'][_0xfaef('0x48')](_0x2b743c[_0xfaef('0x49')],{})[_0xfaef('0x21')](function(_0x21bdc1){var _0x3d48ce=_0x2b743c[_0xfaef('0x4a')][_0xfaef('0x22')]({'plain':!![]});if(!_0x3d48ce)throw new Error(_0xfaef('0x4b'));if(_0x3d48ce['role']===_0xfaef('0x4a')){var _0x18f35b=_0x21bdc1[_0xfaef('0x22')]({'plain':!![]});var _0x36deaf=_0xfaef('0x23');return db[_0xfaef('0x4c')][_0xfaef('0x47')]({'where':{'name':_0x36deaf,'userProfileId':_0x3d48ce[_0xfaef('0x4d')]},'raw':!![]})[_0xfaef('0x21')](function(_0x57aa14){if(_0x57aa14&&_0x57aa14[_0xfaef('0x4e')]===0x0){return db[_0xfaef('0x4f')][_0xfaef('0x48')]({'name':_0x18f35b[_0xfaef('0x27')],'resourceId':_0x18f35b['id'],'type':_0x57aa14['name'],'sectionId':_0x57aa14['id']},{})[_0xfaef('0x21')](function(){return _0x21bdc1;});}else{return _0x21bdc1;}})['catch'](function(_0x1ccac7){logger[_0xfaef('0x25')](_0xfaef('0x50'),_0x1ccac7);throw _0x1ccac7;});}return _0x21bdc1;})[_0xfaef('0x21')](respondWithResult(_0x4ce4bf,0xc9))[_0xfaef('0x45')](handleError(_0x4ce4bf,null));};exports[_0xfaef('0x20')]=function(_0x341988,_0x3a20f6){if(_0x341988['body']['id']){delete _0x341988[_0xfaef('0x49')]['id'];}return db[_0xfaef('0x42')]['find']({'where':{'id':_0x341988[_0xfaef('0x51')]['id']}})['then'](handleEntityNotFound(_0x3a20f6,null))[_0xfaef('0x21')](saveUpdates(_0x341988['body'],null))['then'](respondWithResult(_0x3a20f6,null))[_0xfaef('0x45')](handleError(_0x3a20f6,null));};exports[_0xfaef('0x24')]=function(_0x49a1cd,_0x6b2875){return db['Template'][_0xfaef('0x47')]({'where':{'id':_0x49a1cd[_0xfaef('0x51')]['id']}})[_0xfaef('0x21')](handleEntityNotFound(_0x6b2875,null))[_0xfaef('0x21')](removeEntity(_0x6b2875,null))[_0xfaef('0x45')](handleError(_0x6b2875,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index e1190e4..e3dfff2 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 _0x545f=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./template.attributes','Template','lodash'];(function(_0x5762c2,_0x124f8a){var _0x432ef8=function(_0x471b42){while(--_0x471b42){_0x5762c2['push'](_0x5762c2['shift']());}};_0x432ef8(++_0x124f8a);}(_0x545f,0x81));var _0xf545=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x545f[_0x187ee1];return _0x388160;};'use strict';var _=require(_0xf545('0x0'));var util=require(_0xf545('0x1'));var logger=require(_0xf545('0x2'))('api');var moment=require(_0xf545('0x3'));var BPromise=require('bluebird');var rp=require(_0xf545('0x4'));var fs=require('fs');var path=require(_0xf545('0x5'));var rimraf=require(_0xf545('0x6'));var config=require(_0xf545('0x7'));var attributes=require(_0xf545('0x8'));module['exports']=function(_0x5e9ada,_0x3b547a){return _0x5e9ada['define'](_0xf545('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xced1=['./template.attributes','define','Template','tools_templates','util','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x508bff,_0x13e6ec){var _0x485675=function(_0x310d26){while(--_0x310d26){_0x508bff['push'](_0x508bff['shift']());}};_0x485675(++_0x13e6ec);}(_0xced1,0xcc));var _0x1ced=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xced1[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0x1ced('0x0'));var logger=require(_0x1ced('0x1'))(_0x1ced('0x2'));var moment=require(_0x1ced('0x3'));var BPromise=require('bluebird');var rp=require(_0x1ced('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1ced('0x5'));var attributes=require(_0x1ced('0x6'));module['exports']=function(_0x58789c,_0x2b2f5f){return _0x58789c[_0x1ced('0x7')](_0x1ced('0x8'),attributes,{'tableName':_0x1ced('0x9'),'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 eeec785..9e2c1a8 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 _0x6c12=['raw','attributes','map','include','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Template,\x20%s,\x20%s','message','GetTemplate','Template','findAll','options'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6c12,0x1e5));var _0x26c1=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x6c12[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x26c1('0x0'));var util=require(_0x26c1('0x1'));var moment=require('moment');var BPromise=require(_0x26c1('0x2'));var rs=require(_0x26c1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26c1('0x4'))['db'];var utils=require(_0x26c1('0x5'));var logger=require(_0x26c1('0x6'))('rpc');var config=require(_0x26c1('0x7'));var jayson=require(_0x26c1('0x8'));var client=jayson[_0x26c1('0x9')][_0x26c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x375599,_0x272208,_0x322273){return new BPromise(function(_0x310bc4,_0x8b15ac){return client[_0x26c1('0xb')](_0x375599,_0x322273)[_0x26c1('0xc')](function(_0x1a0dad){logger[_0x26c1('0xd')]('Template,\x20%s,\x20%s',_0x272208,_0x26c1('0xe'));logger[_0x26c1('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x272208,_0x26c1('0xe'),JSON[_0x26c1('0x10')](_0x1a0dad));if(_0x1a0dad[_0x26c1('0x11')]){if(_0x1a0dad[_0x26c1('0x11')][_0x26c1('0x12')]===0x1f4){logger[_0x26c1('0x11')](_0x26c1('0x13'),_0x272208,_0x1a0dad[_0x26c1('0x11')][_0x26c1('0x14')]);return _0x8b15ac(_0x1a0dad[_0x26c1('0x11')][_0x26c1('0x14')]);}logger[_0x26c1('0x11')](_0x26c1('0x13'),_0x272208,_0x1a0dad[_0x26c1('0x11')][_0x26c1('0x14')]);return _0x310bc4(_0x1a0dad[_0x26c1('0x11')][_0x26c1('0x14')]);}else{logger[_0x26c1('0xd')](_0x26c1('0x13'),_0x272208,'request\x20sent');_0x310bc4(_0x1a0dad['result'][_0x26c1('0x14')]);}})['catch'](function(_0x360b03){logger[_0x26c1('0x11')](_0x26c1('0x13'),_0x272208,_0x360b03);_0x8b15ac(_0x360b03);});});}exports[_0x26c1('0x15')]=function(_0x4ea33f){var _0x3e997b=this;return new Promise(function(_0x5678e5,_0x2c54a6){return db[_0x26c1('0x16')][_0x26c1('0x17')]({'raw':_0x4ea33f[_0x26c1('0x18')]?_0x4ea33f[_0x26c1('0x18')][_0x26c1('0x19')]===undefined?!![]:![]:!![],'where':_0x4ea33f[_0x26c1('0x18')]?_0x4ea33f[_0x26c1('0x18')]['where']||null:null,'attributes':_0x4ea33f['options']?_0x4ea33f[_0x26c1('0x18')][_0x26c1('0x1a')]||null:null,'limit':_0x4ea33f[_0x26c1('0x18')]?_0x4ea33f[_0x26c1('0x18')]['limit']||null:null,'include':_0x4ea33f[_0x26c1('0x18')]?_0x4ea33f[_0x26c1('0x18')]['include']?_[_0x26c1('0x1b')](_0x4ea33f[_0x26c1('0x18')][_0x26c1('0x1c')],function(_0x47b2e0){return{'model':db[_0x47b2e0[_0x26c1('0x1d')]],'as':_0x47b2e0['as'],'attributes':_0x47b2e0[_0x26c1('0x1a')],'include':_0x47b2e0[_0x26c1('0x1c')]?_[_0x26c1('0x1b')](_0x47b2e0['include'],function(_0xa3da52){return{'model':db[_0xa3da52[_0x26c1('0x1d')]],'as':_0xa3da52['as'],'attributes':_0xa3da52[_0x26c1('0x1a')],'include':_0xa3da52[_0x26c1('0x1c')]?_['map'](_0xa3da52[_0x26c1('0x1c')],function(_0x25d7d8){return{'model':db[_0x25d7d8[_0x26c1('0x1d')]],'as':_0x25d7d8['as'],'attributes':_0x25d7d8[_0x26c1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x338132){logger['info']('GetTemplate',_0x4ea33f);logger[_0x26c1('0xf')](_0x26c1('0x15'),_0x4ea33f,JSON[_0x26c1('0x10')](_0x338132));_0x5678e5(_0x338132);})['catch'](function(_0x58b6ec){logger[_0x26c1('0x11')](_0x26c1('0x15'),_0x58b6ec[_0x26c1('0x14')],_0x4ea33f);_0x2c54a6(_0x3e997b['error'](0x1f4,_0x58b6ec[_0x26c1('0x14')]));});});}; \ No newline at end of file +var _0x5004=['bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model','util','moment'];(function(_0x5b997c,_0x5bd491){var _0x4eb5d2=function(_0x41907c){while(--_0x41907c){_0x5b997c['push'](_0x5b997c['shift']());}};_0x4eb5d2(++_0x5bd491);}(_0x5004,0x134));var _0x4500=function(_0x1d498f,_0xaf35dd){_0x1d498f=_0x1d498f-0x0;var _0x40e01f=_0x5004[_0x1d498f];return _0x40e01f;};'use strict';var _=require('lodash');var util=require(_0x4500('0x0'));var moment=require(_0x4500('0x1'));var BPromise=require(_0x4500('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4500('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4500('0x4'));var config=require(_0x4500('0x5'));var jayson=require(_0x4500('0x6'));var client=jayson[_0x4500('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f2c03,_0x53dfe3,_0x4a6975){return new BPromise(function(_0x160609,_0x5a516d){return client[_0x4500('0x8')](_0x3f2c03,_0x4a6975)[_0x4500('0x9')](function(_0x2f451a){logger[_0x4500('0xa')](_0x4500('0xb'),_0x53dfe3,_0x4500('0xc'));logger[_0x4500('0xd')](_0x4500('0xe'),_0x53dfe3,_0x4500('0xc'),JSON[_0x4500('0xf')](_0x2f451a));if(_0x2f451a[_0x4500('0x10')]){if(_0x2f451a['error'][_0x4500('0x11')]===0x1f4){logger[_0x4500('0x10')](_0x4500('0xb'),_0x53dfe3,_0x2f451a[_0x4500('0x10')]['message']);return _0x5a516d(_0x2f451a['error'][_0x4500('0x12')]);}logger[_0x4500('0x10')](_0x4500('0xb'),_0x53dfe3,_0x2f451a[_0x4500('0x10')]['message']);return _0x160609(_0x2f451a['error'][_0x4500('0x12')]);}else{logger[_0x4500('0xa')](_0x4500('0xb'),_0x53dfe3,_0x4500('0xc'));_0x160609(_0x2f451a[_0x4500('0x13')][_0x4500('0x12')]);}})[_0x4500('0x14')](function(_0x5eb343){logger[_0x4500('0x10')](_0x4500('0xb'),_0x53dfe3,_0x5eb343);_0x5a516d(_0x5eb343);});});}exports[_0x4500('0x15')]=function(_0x2b17a0){var _0x24e782=this;return new Promise(function(_0x5b756a,_0x268cb9){return db['Template'][_0x4500('0x16')]({'raw':_0x2b17a0[_0x4500('0x17')]?_0x2b17a0[_0x4500('0x17')][_0x4500('0x18')]===undefined?!![]:![]:!![],'where':_0x2b17a0[_0x4500('0x17')]?_0x2b17a0[_0x4500('0x17')][_0x4500('0x19')]||null:null,'attributes':_0x2b17a0[_0x4500('0x17')]?_0x2b17a0['options'][_0x4500('0x1a')]||null:null,'limit':_0x2b17a0['options']?_0x2b17a0[_0x4500('0x17')][_0x4500('0x1b')]||null:null,'include':_0x2b17a0['options']?_0x2b17a0[_0x4500('0x17')][_0x4500('0x1c')]?_['map'](_0x2b17a0[_0x4500('0x17')]['include'],function(_0x3447a7){return{'model':db[_0x3447a7['model']],'as':_0x3447a7['as'],'attributes':_0x3447a7[_0x4500('0x1a')],'include':_0x3447a7[_0x4500('0x1c')]?_[_0x4500('0x1d')](_0x3447a7[_0x4500('0x1c')],function(_0x22f23e){return{'model':db[_0x22f23e['model']],'as':_0x22f23e['as'],'attributes':_0x22f23e['attributes'],'include':_0x22f23e[_0x4500('0x1c')]?_[_0x4500('0x1d')](_0x22f23e[_0x4500('0x1c')],function(_0xd7a68f){return{'model':db[_0xd7a68f[_0x4500('0x1e')]],'as':_0xd7a68f['as'],'attributes':_0xd7a68f[_0x4500('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4500('0x9')](function(_0xd734a){logger[_0x4500('0xa')](_0x4500('0x15'),_0x2b17a0);logger[_0x4500('0xd')](_0x4500('0x15'),_0x2b17a0,JSON[_0x4500('0xf')](_0xd734a));_0x5b756a(_0xd734a);})[_0x4500('0x14')](function(_0x4f7f27){logger['error'](_0x4500('0x15'),_0x4f7f27['message'],_0x2b17a0);_0x268cb9(_0x24e782['error'](0x1f4,_0x4f7f27['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index aef1d4c..50857a5 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 _0x7939=['addAllCondition','addAnyCondition','put','update','delete','multer','path','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post'];(function(_0x10c2d3,_0x2f5914){var _0x5a0b13=function(_0x412864){while(--_0x412864){_0x10c2d3['push'](_0x10c2d3['shift']());}};_0x5a0b13(++_0x2f5914);}(_0x7939,0x1e8));var _0x9793=function(_0x3ce6d3,_0x5aacb9){_0x3ce6d3=_0x3ce6d3-0x0;var _0x2d1055=_0x7939[_0x3ce6d3];return _0x2d1055;};'use strict';var multer=require(_0x9793('0x0'));var util=require('util');var path=require(_0x9793('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x9793('0x2'));var interaction=require(_0x9793('0x3'));var config=require('../../config/environment');var controller=require(_0x9793('0x4'));router[_0x9793('0x5')]('/',auth[_0x9793('0x6')](),controller[_0x9793('0x7')]);router['get'](_0x9793('0x8'),auth['isAuthenticated'](),controller[_0x9793('0x9')]);router[_0x9793('0x5')](_0x9793('0xa'),auth[_0x9793('0x6')](),controller[_0x9793('0xb')]);router[_0x9793('0x5')](_0x9793('0xc'),auth[_0x9793('0x6')](),controller[_0x9793('0xd')]);router[_0x9793('0x5')](_0x9793('0xe'),auth[_0x9793('0x6')](),controller['getActions']);router['post']('/',auth[_0x9793('0x6')](),controller['create']);router[_0x9793('0xf')](_0x9793('0xa'),auth['isAuthenticated'](),controller[_0x9793('0x10')]);router[_0x9793('0xf')](_0x9793('0xc'),auth[_0x9793('0x6')](),controller[_0x9793('0x11')]);router[_0x9793('0xf')]('/:id/actions',auth[_0x9793('0x6')](),controller['addAction']);router[_0x9793('0x12')](_0x9793('0x8'),auth[_0x9793('0x6')](),controller[_0x9793('0x13')]);router[_0x9793('0x14')](_0x9793('0x8'),auth[_0x9793('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2b41=['get','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','/:id/all_conditions','addAllCondition','addAction','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../config/environment','./trigger.controller','isAuthenticated'];(function(_0x4cbdc4,_0x8be7a8){var _0x413c70=function(_0x9da4a5){while(--_0x9da4a5){_0x4cbdc4['push'](_0x4cbdc4['shift']());}};_0x413c70(++_0x8be7a8);}(_0x2b41,0x118));var _0x12b4=function(_0x51461b,_0x32ad42){_0x51461b=_0x51461b-0x0;var _0x1a66c4=_0x2b41[_0x51461b];return _0x1a66c4;};'use strict';var multer=require(_0x12b4('0x0'));var util=require(_0x12b4('0x1'));var path=require(_0x12b4('0x2'));var timeout=require(_0x12b4('0x3'));var express=require('express');var router=express[_0x12b4('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x12b4('0x5'));var controller=require(_0x12b4('0x6'));router['get']('/',auth[_0x12b4('0x7')](),controller['index']);router[_0x12b4('0x8')](_0x12b4('0x9'),auth[_0x12b4('0x7')](),controller[_0x12b4('0xa')]);router[_0x12b4('0x8')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x12b4('0xb')]);router[_0x12b4('0x8')](_0x12b4('0xc'),auth[_0x12b4('0x7')](),controller[_0x12b4('0xd')]);router['get'](_0x12b4('0xe'),auth[_0x12b4('0x7')](),controller['getActions']);router[_0x12b4('0xf')]('/',auth[_0x12b4('0x7')](),controller[_0x12b4('0x10')]);router[_0x12b4('0xf')](_0x12b4('0x11'),auth[_0x12b4('0x7')](),controller[_0x12b4('0x12')]);router[_0x12b4('0xf')]('/:id/any_conditions',auth[_0x12b4('0x7')](),controller['addAnyCondition']);router[_0x12b4('0xf')](_0x12b4('0xe'),auth['isAuthenticated'](),controller[_0x12b4('0x13')]);router[_0x12b4('0x14')](_0x12b4('0x9'),auth['isAuthenticated'](),controller[_0x12b4('0x15')]);router[_0x12b4('0x16')](_0x12b4('0x9'),auth[_0x12b4('0x7')](),controller[_0x12b4('0x17')]);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 01a77cf..e1fc2b2 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 _0x2522=['sequelize','exports','STRING','BOOLEAN'];(function(_0x12c076,_0x5bef17){var _0x2ddd18=function(_0x436336){while(--_0x436336){_0x12c076['push'](_0x12c076['shift']());}};_0x2ddd18(++_0x5bef17);}(_0x2522,0x17c));var _0x2252=function(_0xb276be,_0x5a3b6f){_0xb276be=_0xb276be-0x0;var _0x4a51e9=_0x2522[_0xb276be];return _0x4a51e9;};'use strict';var Sequelize=require(_0x2252('0x0'));module[_0x2252('0x1')]={'name':{'type':Sequelize[_0x2252('0x2')]},'channel':{'type':Sequelize[_0x2252('0x2')]},'description':{'type':Sequelize[_0x2252('0x2')]},'status':{'type':Sequelize[_0x2252('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xa351=['BOOLEAN','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa351,0x1c9));var _0x1a35=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa351[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x1a35('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1a35('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x1a35('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index b9f3efd..3de958b 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 _0x0183=['role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','TriggerAllId','Condition','getAllConditions','findOne','pick','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','save','update','destroy','then','get','Triggers','UserProfileResource','stack','name','send','map','Trigger','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x5c60c7,_0x337d41){var _0x2aab74=function(_0x2744a7){while(--_0x2744a7){_0x5c60c7['push'](_0x5c60c7['shift']());}};_0x2aab74(++_0x337d41);}(_0x0183,0x1e1));var _0x3018=function(_0x4edef1,_0xbd9020){_0x4edef1=_0x4edef1-0x0;var _0xa596aa=_0x0183[_0x4edef1];return _0xa596aa;};'use strict';var pdf=require(_0x3018('0x0'));var emlformat=require(_0x3018('0x1'));var rimraf=require(_0x3018('0x2'));var zipdir=require(_0x3018('0x3'));var jsonpatch=require(_0x3018('0x4'));var rp=require(_0x3018('0x5'));var moment=require(_0x3018('0x6'));var BPromise=require(_0x3018('0x7'));var Mustache=require(_0x3018('0x8'));var util=require(_0x3018('0x9'));var path=require(_0x3018('0xa'));var sox=require('sox');var csv=require(_0x3018('0xb'));var ejs=require(_0x3018('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3018('0xd'));var crypto=require(_0x3018('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3018('0xf'));var toCsv=require(_0x3018('0xb'));var querystring=require('querystring');var Papa=require(_0x3018('0x10'));var Redis=require(_0x3018('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3018('0x12'));var as=require(_0x3018('0x13'));var hardwareService=require(_0x3018('0x14'));var logger=require(_0x3018('0x15'))('api');var utils=require(_0x3018('0x16'));var config=require(_0x3018('0x17'));var db=require(_0x3018('0x18'))['db'];function respondWithStatusCode(_0x3ca159,_0xb2bd0e){_0xb2bd0e=_0xb2bd0e||0xcc;return function(_0x3e2530){if(_0x3e2530){return _0x3ca159[_0x3018('0x19')](_0xb2bd0e);}return _0x3ca159['status'](_0xb2bd0e)[_0x3018('0x1a')]();};}function respondWithResult(_0x16b1ed,_0x289127){_0x289127=_0x289127||0xc8;return function(_0x150dbd){if(_0x150dbd){return _0x16b1ed['status'](_0x289127)['json'](_0x150dbd);}};}function respondWithFilteredResult(_0xd45f2d,_0x3d17b1){return function(_0x4d3fcf){if(_0x4d3fcf){var _0x472545=_0x4d3fcf[_0x3018('0x1b')],_0x29bbff=_0x3d17b1[_0x3018('0x1c')],_0x26bb82=_0x3d17b1['offset']+_0x3d17b1[_0x3018('0x1d')],_0x5f16f1;if(_0x26bb82>=_0x472545){_0x26bb82=_0x472545;_0x5f16f1=0xc8;}else{_0x5f16f1=0xce;}_0xd45f2d[_0x3018('0x1e')](_0x5f16f1);return _0xd45f2d[_0x3018('0x1f')](_0x3018('0x20'),_0x29bbff+'-'+_0x26bb82+'/'+_0x472545)[_0x3018('0x21')](_0x4d3fcf);}return null;};}function patchUpdates(_0x1843a7){return function(_0x4ee5a2){try{jsonpatch[_0x3018('0x22')](_0x4ee5a2,_0x1843a7,!![]);}catch(_0x3b9ad5){return BPromise['reject'](_0x3b9ad5);}return _0x4ee5a2[_0x3018('0x23')]();};}function saveUpdates(_0x30f794,_0x390214){return function(_0x353508){if(_0x353508){return _0x353508[_0x3018('0x24')](_0x30f794)['then'](function(_0x5b016d){return _0x5b016d;});}return null;};}function removeEntity(_0x53ee7d,_0x5f48aa){return function(_0x5b55cf){if(_0x5b55cf){return _0x5b55cf[_0x3018('0x25')]()[_0x3018('0x26')](function(){var _0x22b75c=_0x5b55cf[_0x3018('0x27')]({'plain':!![]});var _0x5f2f3c=_0x3018('0x28');return db[_0x3018('0x29')][_0x3018('0x25')]({'where':{'type':_0x5f2f3c,'resourceId':_0x22b75c['id']}})['then'](function(){return _0x5b55cf;});})[_0x3018('0x26')](function(){_0x53ee7d[_0x3018('0x1e')](0xcc)[_0x3018('0x1a')]();});}};}function handleEntityNotFound(_0x2ab4cf,_0x3dc186){return function(_0x3320ec){if(!_0x3320ec){_0x2ab4cf[_0x3018('0x19')](0x194);}return _0x3320ec;};}function handleError(_0x1cf5b0,_0x241b4c){_0x241b4c=_0x241b4c||0x1f4;return function(_0x4812a6){logger['error'](_0x4812a6[_0x3018('0x2a')]);if(_0x4812a6[_0x3018('0x2b')]){delete _0x4812a6[_0x3018('0x2b')];}_0x1cf5b0[_0x3018('0x1e')](_0x241b4c)[_0x3018('0x2c')](_0x4812a6);};}exports['index']=function(_0x2d18c9,_0x42b198){var _0x3088ec={},_0x353d07={},_0x2d531e={'count':0x0,'rows':[]};var _0x36ba34=_[_0x3018('0x2d')](db[_0x3018('0x2e')][_0x3018('0x2f')],function(_0x214b53){return{'name':_0x214b53[_0x3018('0x30')],'type':_0x214b53[_0x3018('0x31')][_0x3018('0x32')]};});_0x353d07['model']=_[_0x3018('0x2d')](_0x36ba34,_0x3018('0x2b'));_0x353d07[_0x3018('0x33')]=_['keys'](_0x2d18c9[_0x3018('0x33')]);_0x353d07[_0x3018('0x34')]=_[_0x3018('0x35')](_0x353d07[_0x3018('0x36')],_0x353d07[_0x3018('0x33')]);_0x3088ec[_0x3018('0x37')]=_[_0x3018('0x35')](_0x353d07[_0x3018('0x36')],qs[_0x3018('0x38')](_0x2d18c9['query'][_0x3018('0x38')]));_0x3088ec[_0x3018('0x37')]=_0x3088ec[_0x3018('0x37')][_0x3018('0x39')]?_0x3088ec[_0x3018('0x37')]:_0x353d07[_0x3018('0x36')];if(!_0x2d18c9[_0x3018('0x33')]['hasOwnProperty'](_0x3018('0x3a'))){_0x3088ec[_0x3018('0x1d')]=qs[_0x3018('0x1d')](_0x2d18c9[_0x3018('0x33')]['limit']);_0x3088ec[_0x3018('0x1c')]=qs[_0x3018('0x1c')](_0x2d18c9['query'][_0x3018('0x1c')]);}_0x3088ec[_0x3018('0x3b')]=qs[_0x3018('0x3c')](_0x2d18c9[_0x3018('0x33')][_0x3018('0x3c')]);_0x3088ec[_0x3018('0x3d')]=qs[_0x3018('0x34')](_['pick'](_0x2d18c9[_0x3018('0x33')],_0x353d07[_0x3018('0x34')]));if(_0x2d18c9['query'][_0x3018('0x3e')]){_0x3088ec['where']=_[_0x3018('0x3f')](_0x3088ec[_0x3018('0x3d')],{'$or':_['map'](_0x36ba34,function(_0x1271f8){if(_0x1271f8[_0x3018('0x31')]!==_0x3018('0x40')){var _0x2e4de1={};_0x2e4de1[_0x1271f8[_0x3018('0x2b')]]={'$like':'%'+_0x2d18c9[_0x3018('0x33')][_0x3018('0x3e')]+'%'};return _0x2e4de1;}})});}_0x3088ec=_[_0x3018('0x3f')]({},_0x3088ec,_0x2d18c9[_0x3018('0x41')]);var _0x393f8d={'where':_0x3088ec[_0x3018('0x3d')]};return db[_0x3018('0x2e')][_0x3018('0x1b')](_0x393f8d)['then'](function(_0x796b64){_0x2d531e[_0x3018('0x1b')]=_0x796b64;if(_0x2d18c9[_0x3018('0x33')][_0x3018('0x42')]){_0x3088ec[_0x3018('0x43')]=[{'all':!![]}];}return db[_0x3018('0x2e')][_0x3018('0x44')](_0x3088ec);})[_0x3018('0x26')](function(_0x181c0e){_0x2d531e['rows']=_0x181c0e;return _0x2d531e;})[_0x3018('0x26')](respondWithFilteredResult(_0x42b198,_0x3088ec))[_0x3018('0x45')](handleError(_0x42b198,null));};exports[_0x3018('0x46')]=function(_0x132653,_0x2cad75){var _0x30f2ac={'raw':![],'where':{'id':_0x132653[_0x3018('0x47')]['id']}},_0x4016a6={};_0x4016a6[_0x3018('0x36')]=_[_0x3018('0x48')](db[_0x3018('0x2e')][_0x3018('0x2f')]);_0x4016a6[_0x3018('0x33')]=_['keys'](_0x132653[_0x3018('0x33')]);_0x4016a6[_0x3018('0x34')]=_[_0x3018('0x35')](_0x4016a6[_0x3018('0x36')],_0x4016a6[_0x3018('0x33')]);_0x30f2ac[_0x3018('0x37')]=_[_0x3018('0x35')](_0x4016a6['model'],qs[_0x3018('0x38')](_0x132653[_0x3018('0x33')][_0x3018('0x38')]));_0x30f2ac['attributes']=_0x30f2ac['attributes']['length']?_0x30f2ac[_0x3018('0x37')]:_0x4016a6['model'];if(_0x132653[_0x3018('0x33')][_0x3018('0x42')]){_0x30f2ac[_0x3018('0x43')]=[{'all':!![]}];}_0x30f2ac=_['merge']({},_0x30f2ac,_0x132653['options']);return db['Trigger']['find'](_0x30f2ac)[_0x3018('0x26')](handleEntityNotFound(_0x2cad75,null))['then'](respondWithResult(_0x2cad75,null))[_0x3018('0x45')](handleError(_0x2cad75,null));};exports[_0x3018('0x49')]=function(_0x30935d,_0xa78117){return db[_0x3018('0x2e')][_0x3018('0x49')](_0x30935d[_0x3018('0x4a')],{})['then'](function(_0x18e6cd){var _0x1668bf=_0x30935d[_0x3018('0x4b')][_0x3018('0x27')]({'plain':!![]});if(!_0x1668bf)throw new Error(_0x3018('0x4c'));if(_0x1668bf[_0x3018('0x4d')]==='user'){var _0x16d04c=_0x18e6cd['get']({'plain':!![]});var _0x3f9c35=_0x3018('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x3f9c35,'userProfileId':_0x1668bf[_0x3018('0x4e')]},'raw':!![]})[_0x3018('0x26')](function(_0x10c6a4){if(_0x10c6a4&&_0x10c6a4[_0x3018('0x4f')]===0x0){return db[_0x3018('0x29')][_0x3018('0x49')]({'name':_0x16d04c[_0x3018('0x2b')],'resourceId':_0x16d04c['id'],'type':_0x10c6a4['name'],'sectionId':_0x10c6a4['id']},{})[_0x3018('0x26')](function(){return _0x18e6cd;});}else{return _0x18e6cd;}})[_0x3018('0x45')](function(_0x4d8e58){logger['error'](_0x3018('0x50'),_0x4d8e58);throw _0x4d8e58;});}return _0x18e6cd;})[_0x3018('0x26')](respondWithResult(_0xa78117,0xc9))[_0x3018('0x45')](handleError(_0xa78117,null));};exports[_0x3018('0x24')]=function(_0x377bcc,_0x5415c3){if(_0x377bcc['body']['id']){delete _0x377bcc[_0x3018('0x4a')]['id'];}return db[_0x3018('0x2e')][_0x3018('0x51')]({'where':{'id':_0x377bcc[_0x3018('0x47')]['id']}})[_0x3018('0x26')](handleEntityNotFound(_0x5415c3,null))[_0x3018('0x26')](saveUpdates(_0x377bcc[_0x3018('0x4a')],null))[_0x3018('0x26')](respondWithResult(_0x5415c3,null))['catch'](handleError(_0x5415c3,null));};exports[_0x3018('0x25')]=function(_0x477cee,_0x456ad7){return db[_0x3018('0x2e')]['find']({'where':{'id':_0x477cee[_0x3018('0x47')]['id']}})[_0x3018('0x26')](handleEntityNotFound(_0x456ad7,null))[_0x3018('0x26')](removeEntity(_0x456ad7,null))[_0x3018('0x45')](handleError(_0x456ad7,null));};exports['addAllCondition']=function(_0x412493,_0x17426c,_0x1e7c9c){if(_0x412493[_0x3018('0x4a')]['id']){delete _0x412493[_0x3018('0x4a')]['id'];}return db[_0x3018('0x2e')][_0x3018('0x51')]({'where':{'id':_0x412493[_0x3018('0x47')]['id']}})['then'](handleEntityNotFound(_0x17426c,null))[_0x3018('0x26')](function(_0x223432){if(_0x223432){_0x412493[_0x3018('0x4a')][_0x3018('0x52')]=_0x223432['id'];return db['Condition'][_0x3018('0x49')](_0x412493[_0x3018('0x4a')]);}})[_0x3018('0x26')](respondWithResult(_0x17426c,null))[_0x3018('0x45')](handleError(_0x17426c,null));};exports['addAnyCondition']=function(_0x53c83a,_0x2961b8,_0x450602){if(_0x53c83a[_0x3018('0x4a')]['id']){delete _0x53c83a[_0x3018('0x4a')]['id'];}return db[_0x3018('0x2e')][_0x3018('0x51')]({'where':{'id':_0x53c83a[_0x3018('0x47')]['id']}})[_0x3018('0x26')](handleEntityNotFound(_0x2961b8,null))[_0x3018('0x26')](function(_0x465cef){if(_0x465cef){_0x53c83a['body']['TriggerAnyId']=_0x465cef['id'];return db[_0x3018('0x53')][_0x3018('0x49')](_0x53c83a[_0x3018('0x4a')]);}})['then'](respondWithResult(_0x2961b8,null))['catch'](handleError(_0x2961b8,null));};exports[_0x3018('0x54')]=function(_0x37b111,_0xf89b24,_0x4e4ca2){var _0x4f1ec8={};var _0x20781c={};var _0x492090;var _0x58a478;return db[_0x3018('0x2e')][_0x3018('0x55')]({'where':{'id':_0x37b111['params']['id']}})[_0x3018('0x26')](handleEntityNotFound(_0xf89b24,null))[_0x3018('0x26')](function(_0x1f4f09){if(_0x1f4f09){_0x492090=_0x1f4f09;_0x20781c['model']=_[_0x3018('0x48')](db[_0x3018('0x53')][_0x3018('0x2f')]);_0x20781c[_0x3018('0x33')]=_[_0x3018('0x48')](_0x37b111[_0x3018('0x33')]);_0x20781c[_0x3018('0x34')]=_[_0x3018('0x35')](_0x20781c['model'],_0x20781c['query']);_0x4f1ec8[_0x3018('0x37')]=_[_0x3018('0x35')](_0x20781c[_0x3018('0x36')],qs[_0x3018('0x38')](_0x37b111[_0x3018('0x33')][_0x3018('0x38')]));_0x4f1ec8[_0x3018('0x37')]=_0x4f1ec8['attributes'][_0x3018('0x39')]?_0x4f1ec8[_0x3018('0x37')]:_0x20781c[_0x3018('0x36')];_0x4f1ec8[_0x3018('0x3b')]=qs[_0x3018('0x3c')](_0x37b111['query'][_0x3018('0x3c')]);_0x4f1ec8['where']=qs['filters'](_[_0x3018('0x56')](_0x37b111[_0x3018('0x33')],_0x20781c[_0x3018('0x34')]));if(_0x37b111[_0x3018('0x33')]['filter']){_0x4f1ec8['where']=_['merge'](_0x4f1ec8[_0x3018('0x3d')],{'$or':_[_0x3018('0x2d')](_0x4f1ec8['attributes'],function(_0x26684){var _0x1a7e73={};_0x1a7e73[_0x26684]={'$like':'%'+_0x37b111[_0x3018('0x33')][_0x3018('0x3e')]+'%'};return _0x1a7e73;})});}_0x4f1ec8=_[_0x3018('0x3f')]({},_0x4f1ec8,_0x37b111['options']);return _0x492090['getAllConditions'](_0x4f1ec8);}})[_0x3018('0x26')](function(_0x696bdd){if(_0x696bdd){_0x58a478=_0x696bdd['length'];if(!_0x37b111[_0x3018('0x33')][_0x3018('0x57')](_0x3018('0x3a'))){_0x4f1ec8[_0x3018('0x1d')]=qs[_0x3018('0x1d')](_0x37b111[_0x3018('0x33')][_0x3018('0x1d')]);_0x4f1ec8[_0x3018('0x1c')]=qs[_0x3018('0x1c')](_0x37b111[_0x3018('0x33')][_0x3018('0x1c')]);}return _0x492090[_0x3018('0x54')](_0x4f1ec8);}})[_0x3018('0x26')](function(_0xe8a65e){if(_0xe8a65e){return _0xe8a65e?{'count':_0x58a478,'rows':_0xe8a65e}:null;}})[_0x3018('0x26')](respondWithResult(_0xf89b24,null))[_0x3018('0x45')](handleError(_0xf89b24,null));};exports[_0x3018('0x58')]=function(_0x24e98f,_0x365754,_0x41cb80){var _0x48d145={};var _0x522b55={};var _0x51bef6;var _0x1cd73c;return db['Trigger']['findOne']({'where':{'id':_0x24e98f[_0x3018('0x47')]['id']}})[_0x3018('0x26')](handleEntityNotFound(_0x365754,null))[_0x3018('0x26')](function(_0x176afb){if(_0x176afb){_0x51bef6=_0x176afb;_0x522b55[_0x3018('0x36')]=_[_0x3018('0x48')](db[_0x3018('0x53')][_0x3018('0x2f')]);_0x522b55[_0x3018('0x33')]=_[_0x3018('0x48')](_0x24e98f['query']);_0x522b55[_0x3018('0x34')]=_['intersection'](_0x522b55[_0x3018('0x36')],_0x522b55[_0x3018('0x33')]);_0x48d145['attributes']=_[_0x3018('0x35')](_0x522b55[_0x3018('0x36')],qs['fields'](_0x24e98f[_0x3018('0x33')][_0x3018('0x38')]));_0x48d145[_0x3018('0x37')]=_0x48d145[_0x3018('0x37')][_0x3018('0x39')]?_0x48d145[_0x3018('0x37')]:_0x522b55[_0x3018('0x36')];_0x48d145[_0x3018('0x3b')]=qs[_0x3018('0x3c')](_0x24e98f[_0x3018('0x33')]['sort']);_0x48d145[_0x3018('0x3d')]=qs[_0x3018('0x34')](_[_0x3018('0x56')](_0x24e98f['query'],_0x522b55[_0x3018('0x34')]));if(_0x24e98f['query'][_0x3018('0x3e')]){_0x48d145[_0x3018('0x3d')]=_[_0x3018('0x3f')](_0x48d145[_0x3018('0x3d')],{'$or':_[_0x3018('0x2d')](_0x48d145['attributes'],function(_0x5e9deb){var _0x4970b3={};_0x4970b3[_0x5e9deb]={'$like':'%'+_0x24e98f['query'][_0x3018('0x3e')]+'%'};return _0x4970b3;})});}_0x48d145=_[_0x3018('0x3f')]({},_0x48d145,_0x24e98f[_0x3018('0x41')]);return _0x51bef6['getAnyConditions'](_0x48d145);}})[_0x3018('0x26')](function(_0x4a24ff){if(_0x4a24ff){_0x1cd73c=_0x4a24ff[_0x3018('0x39')];if(!_0x24e98f[_0x3018('0x33')][_0x3018('0x57')](_0x3018('0x3a'))){_0x48d145[_0x3018('0x1d')]=qs[_0x3018('0x1d')](_0x24e98f[_0x3018('0x33')][_0x3018('0x1d')]);_0x48d145['offset']=qs[_0x3018('0x1c')](_0x24e98f[_0x3018('0x33')]['offset']);}return _0x51bef6[_0x3018('0x58')](_0x48d145);}})[_0x3018('0x26')](function(_0x37e80a){if(_0x37e80a){return _0x37e80a?{'count':_0x1cd73c,'rows':_0x37e80a}:null;}})[_0x3018('0x26')](respondWithResult(_0x365754,null))[_0x3018('0x45')](handleError(_0x365754,null));};exports[_0x3018('0x59')]=function(_0x488b3d,_0x36168,_0x1bd61a){if(_0x488b3d['body']['id']){delete _0x488b3d[_0x3018('0x4a')]['id'];}return db[_0x3018('0x2e')][_0x3018('0x51')]({'where':{'id':_0x488b3d['params']['id']}})[_0x3018('0x26')](handleEntityNotFound(_0x36168,null))[_0x3018('0x26')](function(_0x2b4d4d){if(_0x2b4d4d){_0x488b3d[_0x3018('0x4a')][_0x3018('0x5a')]=_0x2b4d4d['id'];return db[_0x3018('0x5b')][_0x3018('0x49')](_0x488b3d[_0x3018('0x4a')]);}})['then'](respondWithResult(_0x36168,null))[_0x3018('0x45')](handleError(_0x36168,null));};exports[_0x3018('0x5c')]=function(_0x4243ff,_0x591fd2,_0x4f1789){var _0x328a4a={};var _0x38e94e={};var _0x3e7528;var _0x1767a3;return db[_0x3018('0x2e')][_0x3018('0x55')]({'where':{'id':_0x4243ff[_0x3018('0x47')]['id']}})[_0x3018('0x26')](handleEntityNotFound(_0x591fd2,null))['then'](function(_0x3a3b4c){if(_0x3a3b4c){_0x3e7528=_0x3a3b4c;_0x38e94e['model']=_[_0x3018('0x48')](db['Action']['rawAttributes']);_0x38e94e[_0x3018('0x33')]=_['keys'](_0x4243ff[_0x3018('0x33')]);_0x38e94e[_0x3018('0x34')]=_[_0x3018('0x35')](_0x38e94e['model'],_0x38e94e[_0x3018('0x33')]);_0x328a4a[_0x3018('0x37')]=_[_0x3018('0x35')](_0x38e94e[_0x3018('0x36')],qs[_0x3018('0x38')](_0x4243ff[_0x3018('0x33')][_0x3018('0x38')]));_0x328a4a[_0x3018('0x37')]=_0x328a4a['attributes'][_0x3018('0x39')]?_0x328a4a[_0x3018('0x37')]:_0x38e94e[_0x3018('0x36')];_0x328a4a[_0x3018('0x3b')]=qs[_0x3018('0x3c')](_0x4243ff['query'][_0x3018('0x3c')]);_0x328a4a[_0x3018('0x3d')]=qs[_0x3018('0x34')](_[_0x3018('0x56')](_0x4243ff[_0x3018('0x33')],_0x38e94e[_0x3018('0x34')]));if(_0x4243ff[_0x3018('0x33')]['filter']){_0x328a4a[_0x3018('0x3d')]=_[_0x3018('0x3f')](_0x328a4a[_0x3018('0x3d')],{'$or':_[_0x3018('0x2d')](_0x328a4a[_0x3018('0x37')],function(_0x3cc682){var _0x17b295={};_0x17b295[_0x3cc682]={'$like':'%'+_0x4243ff[_0x3018('0x33')][_0x3018('0x3e')]+'%'};return _0x17b295;})});}_0x328a4a=_[_0x3018('0x3f')]({},_0x328a4a,_0x4243ff[_0x3018('0x41')]);return _0x3e7528[_0x3018('0x5c')](_0x328a4a);}})[_0x3018('0x26')](function(_0x41c530){if(_0x41c530){_0x1767a3=_0x41c530['length'];if(!_0x4243ff[_0x3018('0x33')][_0x3018('0x57')]('nolimit')){_0x328a4a[_0x3018('0x1d')]=qs[_0x3018('0x1d')](_0x4243ff[_0x3018('0x33')][_0x3018('0x1d')]);_0x328a4a[_0x3018('0x1c')]=qs[_0x3018('0x1c')](_0x4243ff[_0x3018('0x33')][_0x3018('0x1c')]);}return _0x3e7528[_0x3018('0x5c')](_0x328a4a);}})[_0x3018('0x26')](function(_0x514dde){if(_0x514dde){return _0x514dde?{'count':_0x1767a3,'rows':_0x514dde}:null;}})[_0x3018('0x26')](respondWithResult(_0x591fd2,null))[_0x3018('0x45')](handleError(_0x591fd2,null));}; \ No newline at end of file +var _0x2481=['../../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','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','send','index','Trigger','rawAttributes','fieldName','type','key','map','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x55be9e,_0x4b0df0){var _0x180d85=function(_0x3456bb){while(--_0x3456bb){_0x55be9e['push'](_0x55be9e['shift']());}};_0x180d85(++_0x4b0df0);}(_0x2481,0x119));var _0x1248=function(_0x107824,_0x1d2780){_0x107824=_0x107824-0x0;var _0x578fe2=_0x2481[_0x107824];return _0x578fe2;};'use strict';var pdf=require(_0x1248('0x0'));var emlformat=require(_0x1248('0x1'));var rimraf=require(_0x1248('0x2'));var zipdir=require(_0x1248('0x3'));var jsonpatch=require(_0x1248('0x4'));var rp=require(_0x1248('0x5'));var moment=require(_0x1248('0x6'));var BPromise=require(_0x1248('0x7'));var Mustache=require('mustache');var util=require(_0x1248('0x8'));var path=require(_0x1248('0x9'));var sox=require(_0x1248('0xa'));var csv=require('to-csv');var ejs=require(_0x1248('0xb'));var fs=require('fs');var _=require(_0x1248('0xc'));var squel=require('squel');var crypto=require(_0x1248('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1248('0xe'));var toCsv=require(_0x1248('0xf'));var querystring=require(_0x1248('0x10'));var Papa=require(_0x1248('0x11'));var Redis=require(_0x1248('0x12'));var authService=require(_0x1248('0x13'));var qs=require(_0x1248('0x14'));var as=require(_0x1248('0x15'));var hardwareService=require(_0x1248('0x16'));var logger=require(_0x1248('0x17'))(_0x1248('0x18'));var utils=require(_0x1248('0x19'));var config=require(_0x1248('0x1a'));var db=require(_0x1248('0x1b'))['db'];function respondWithStatusCode(_0x144691,_0x25d976){_0x25d976=_0x25d976||0xcc;return function(_0x2d2d10){if(_0x2d2d10){return _0x144691[_0x1248('0x1c')](_0x25d976);}return _0x144691[_0x1248('0x1d')](_0x25d976)[_0x1248('0x1e')]();};}function respondWithResult(_0x249415,_0x3dd5c3){_0x3dd5c3=_0x3dd5c3||0xc8;return function(_0x462f13){if(_0x462f13){return _0x249415[_0x1248('0x1d')](_0x3dd5c3)[_0x1248('0x1f')](_0x462f13);}};}function respondWithFilteredResult(_0x28cb96,_0x4bbdeb){return function(_0x475b94){if(_0x475b94){var _0x91afaf=_0x475b94['count'],_0x5e70e6=_0x4bbdeb[_0x1248('0x20')],_0x5b0034=_0x4bbdeb[_0x1248('0x20')]+_0x4bbdeb['limit'],_0x342afb;if(_0x5b0034>=_0x91afaf){_0x5b0034=_0x91afaf;_0x342afb=0xc8;}else{_0x342afb=0xce;}_0x28cb96[_0x1248('0x1d')](_0x342afb);return _0x28cb96[_0x1248('0x21')](_0x1248('0x22'),_0x5e70e6+'-'+_0x5b0034+'/'+_0x91afaf)[_0x1248('0x1f')](_0x475b94);}return null;};}function patchUpdates(_0x21dce0){return function(_0x49a080){try{jsonpatch['apply'](_0x49a080,_0x21dce0,!![]);}catch(_0xa4ee35){return BPromise[_0x1248('0x23')](_0xa4ee35);}return _0x49a080[_0x1248('0x24')]();};}function saveUpdates(_0x2c8f76,_0x38f019){return function(_0x469c6a){if(_0x469c6a){return _0x469c6a[_0x1248('0x25')](_0x2c8f76)[_0x1248('0x26')](function(_0x3b7fea){return _0x3b7fea;});}return null;};}function removeEntity(_0x39c93f,_0x3c4782){return function(_0x586b52){if(_0x586b52){return _0x586b52['destroy']()['then'](function(){var _0xacea0b=_0x586b52[_0x1248('0x27')]({'plain':!![]});var _0x44381c='Triggers';return db[_0x1248('0x28')][_0x1248('0x29')]({'where':{'type':_0x44381c,'resourceId':_0xacea0b['id']}})[_0x1248('0x26')](function(){return _0x586b52;});})[_0x1248('0x26')](function(){_0x39c93f[_0x1248('0x1d')](0xcc)[_0x1248('0x1e')]();});}};}function handleEntityNotFound(_0x545008,_0x5d922f){return function(_0xdfb646){if(!_0xdfb646){_0x545008[_0x1248('0x1c')](0x194);}return _0xdfb646;};}function handleError(_0x3934af,_0x4963ca){_0x4963ca=_0x4963ca||0x1f4;return function(_0x1ab983){logger['error'](_0x1ab983['stack']);if(_0x1ab983['name']){delete _0x1ab983['name'];}_0x3934af[_0x1248('0x1d')](_0x4963ca)[_0x1248('0x2a')](_0x1ab983);};}exports[_0x1248('0x2b')]=function(_0x227dbb,_0x20c49c){var _0x13d273={},_0x4125e6={},_0x585fe7={'count':0x0,'rows':[]};var _0x13d4c9=_['map'](db[_0x1248('0x2c')][_0x1248('0x2d')],function(_0x2af275){return{'name':_0x2af275[_0x1248('0x2e')],'type':_0x2af275[_0x1248('0x2f')][_0x1248('0x30')]};});_0x4125e6['model']=_[_0x1248('0x31')](_0x13d4c9,_0x1248('0x32'));_0x4125e6[_0x1248('0x33')]=_[_0x1248('0x34')](_0x227dbb[_0x1248('0x33')]);_0x4125e6[_0x1248('0x35')]=_[_0x1248('0x36')](_0x4125e6[_0x1248('0x37')],_0x4125e6[_0x1248('0x33')]);_0x13d273['attributes']=_['intersection'](_0x4125e6[_0x1248('0x37')],qs[_0x1248('0x38')](_0x227dbb[_0x1248('0x33')][_0x1248('0x38')]));_0x13d273[_0x1248('0x39')]=_0x13d273[_0x1248('0x39')][_0x1248('0x3a')]?_0x13d273[_0x1248('0x39')]:_0x4125e6[_0x1248('0x37')];if(!_0x227dbb[_0x1248('0x33')][_0x1248('0x3b')](_0x1248('0x3c'))){_0x13d273[_0x1248('0x3d')]=qs[_0x1248('0x3d')](_0x227dbb[_0x1248('0x33')][_0x1248('0x3d')]);_0x13d273['offset']=qs[_0x1248('0x20')](_0x227dbb['query'][_0x1248('0x20')]);}_0x13d273[_0x1248('0x3e')]=qs[_0x1248('0x3f')](_0x227dbb[_0x1248('0x33')][_0x1248('0x3f')]);_0x13d273[_0x1248('0x40')]=qs[_0x1248('0x35')](_[_0x1248('0x41')](_0x227dbb['query'],_0x4125e6[_0x1248('0x35')]));if(_0x227dbb[_0x1248('0x33')][_0x1248('0x42')]){_0x13d273['where']=_[_0x1248('0x43')](_0x13d273['where'],{'$or':_[_0x1248('0x31')](_0x13d4c9,function(_0x32c4f4){if(_0x32c4f4[_0x1248('0x2f')]!==_0x1248('0x44')){var _0x4ae380={};_0x4ae380[_0x32c4f4[_0x1248('0x32')]]={'$like':'%'+_0x227dbb[_0x1248('0x33')][_0x1248('0x42')]+'%'};return _0x4ae380;}})});}_0x13d273=_[_0x1248('0x43')]({},_0x13d273,_0x227dbb[_0x1248('0x45')]);var _0x1729bb={'where':_0x13d273[_0x1248('0x40')]};return db['Trigger'][_0x1248('0x46')](_0x1729bb)[_0x1248('0x26')](function(_0x37ea96){_0x585fe7['count']=_0x37ea96;if(_0x227dbb[_0x1248('0x33')]['includeAll']){_0x13d273[_0x1248('0x47')]=[{'all':!![]}];}return db[_0x1248('0x2c')]['findAll'](_0x13d273);})[_0x1248('0x26')](function(_0x46a4d1){_0x585fe7[_0x1248('0x48')]=_0x46a4d1;return _0x585fe7;})[_0x1248('0x26')](respondWithFilteredResult(_0x20c49c,_0x13d273))[_0x1248('0x49')](handleError(_0x20c49c,null));};exports[_0x1248('0x4a')]=function(_0x183714,_0x7b3ca9){var _0x469673={'raw':![],'where':{'id':_0x183714[_0x1248('0x4b')]['id']}},_0x15b08c={};_0x15b08c[_0x1248('0x37')]=_[_0x1248('0x34')](db['Trigger'][_0x1248('0x2d')]);_0x15b08c[_0x1248('0x33')]=_[_0x1248('0x34')](_0x183714[_0x1248('0x33')]);_0x15b08c['filters']=_['intersection'](_0x15b08c[_0x1248('0x37')],_0x15b08c['query']);_0x469673[_0x1248('0x39')]=_[_0x1248('0x36')](_0x15b08c[_0x1248('0x37')],qs[_0x1248('0x38')](_0x183714[_0x1248('0x33')][_0x1248('0x38')]));_0x469673['attributes']=_0x469673[_0x1248('0x39')][_0x1248('0x3a')]?_0x469673[_0x1248('0x39')]:_0x15b08c[_0x1248('0x37')];if(_0x183714[_0x1248('0x33')][_0x1248('0x4c')]){_0x469673[_0x1248('0x47')]=[{'all':!![]}];}_0x469673=_[_0x1248('0x43')]({},_0x469673,_0x183714[_0x1248('0x45')]);return db[_0x1248('0x2c')][_0x1248('0x4d')](_0x469673)[_0x1248('0x26')](handleEntityNotFound(_0x7b3ca9,null))['then'](respondWithResult(_0x7b3ca9,null))[_0x1248('0x49')](handleError(_0x7b3ca9,null));};exports['create']=function(_0x3777b0,_0x4c62ff){return db['Trigger'][_0x1248('0x4e')](_0x3777b0[_0x1248('0x4f')],{})[_0x1248('0x26')](function(_0x4043b8){var _0x5599f3=_0x3777b0['user']['get']({'plain':!![]});if(!_0x5599f3)throw new Error(_0x1248('0x50'));if(_0x5599f3[_0x1248('0x51')]==='user'){var _0x56da7b=_0x4043b8[_0x1248('0x27')]({'plain':!![]});var _0x499495=_0x1248('0x52');return db[_0x1248('0x53')][_0x1248('0x4d')]({'where':{'name':_0x499495,'userProfileId':_0x5599f3[_0x1248('0x54')]},'raw':!![]})['then'](function(_0x288b26){if(_0x288b26&&_0x288b26[_0x1248('0x55')]===0x0){return db[_0x1248('0x28')][_0x1248('0x4e')]({'name':_0x56da7b['name'],'resourceId':_0x56da7b['id'],'type':_0x288b26['name'],'sectionId':_0x288b26['id']},{})[_0x1248('0x26')](function(){return _0x4043b8;});}else{return _0x4043b8;}})[_0x1248('0x49')](function(_0x1367f4){logger[_0x1248('0x56')](_0x1248('0x57'),_0x1367f4);throw _0x1367f4;});}return _0x4043b8;})[_0x1248('0x26')](respondWithResult(_0x4c62ff,0xc9))[_0x1248('0x49')](handleError(_0x4c62ff,null));};exports[_0x1248('0x25')]=function(_0x38d72a,_0x3cd024){if(_0x38d72a[_0x1248('0x4f')]['id']){delete _0x38d72a[_0x1248('0x4f')]['id'];}return db[_0x1248('0x2c')][_0x1248('0x4d')]({'where':{'id':_0x38d72a[_0x1248('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3cd024,null))[_0x1248('0x26')](saveUpdates(_0x38d72a[_0x1248('0x4f')],null))[_0x1248('0x26')](respondWithResult(_0x3cd024,null))[_0x1248('0x49')](handleError(_0x3cd024,null));};exports['destroy']=function(_0x57509a,_0x1782b1){return db['Trigger'][_0x1248('0x4d')]({'where':{'id':_0x57509a[_0x1248('0x4b')]['id']}})[_0x1248('0x26')](handleEntityNotFound(_0x1782b1,null))['then'](removeEntity(_0x1782b1,null))[_0x1248('0x49')](handleError(_0x1782b1,null));};exports[_0x1248('0x58')]=function(_0x215bc2,_0x273ef6,_0x40956a){if(_0x215bc2[_0x1248('0x4f')]['id']){delete _0x215bc2[_0x1248('0x4f')]['id'];}return db[_0x1248('0x2c')]['find']({'where':{'id':_0x215bc2[_0x1248('0x4b')]['id']}})[_0x1248('0x26')](handleEntityNotFound(_0x273ef6,null))[_0x1248('0x26')](function(_0x4a343c){if(_0x4a343c){_0x215bc2[_0x1248('0x4f')][_0x1248('0x59')]=_0x4a343c['id'];return db[_0x1248('0x5a')][_0x1248('0x4e')](_0x215bc2[_0x1248('0x4f')]);}})['then'](respondWithResult(_0x273ef6,null))[_0x1248('0x49')](handleError(_0x273ef6,null));};exports[_0x1248('0x5b')]=function(_0x44ea1b,_0x834a08,_0x2cdd72){if(_0x44ea1b[_0x1248('0x4f')]['id']){delete _0x44ea1b[_0x1248('0x4f')]['id'];}return db['Trigger'][_0x1248('0x4d')]({'where':{'id':_0x44ea1b['params']['id']}})[_0x1248('0x26')](handleEntityNotFound(_0x834a08,null))['then'](function(_0x4d1c0b){if(_0x4d1c0b){_0x44ea1b[_0x1248('0x4f')][_0x1248('0x5c')]=_0x4d1c0b['id'];return db[_0x1248('0x5a')][_0x1248('0x4e')](_0x44ea1b[_0x1248('0x4f')]);}})['then'](respondWithResult(_0x834a08,null))['catch'](handleError(_0x834a08,null));};exports[_0x1248('0x5d')]=function(_0x38c9d0,_0x16b35d,_0x378ca3){var _0x1f2141={};var _0x17cc8f={};var _0xc07ac0;var _0x41874e;return db[_0x1248('0x2c')][_0x1248('0x5e')]({'where':{'id':_0x38c9d0[_0x1248('0x4b')]['id']}})[_0x1248('0x26')](handleEntityNotFound(_0x16b35d,null))[_0x1248('0x26')](function(_0x235b7a){if(_0x235b7a){_0xc07ac0=_0x235b7a;_0x17cc8f[_0x1248('0x37')]=_[_0x1248('0x34')](db[_0x1248('0x5a')][_0x1248('0x2d')]);_0x17cc8f[_0x1248('0x33')]=_[_0x1248('0x34')](_0x38c9d0['query']);_0x17cc8f['filters']=_[_0x1248('0x36')](_0x17cc8f['model'],_0x17cc8f[_0x1248('0x33')]);_0x1f2141[_0x1248('0x39')]=_[_0x1248('0x36')](_0x17cc8f['model'],qs[_0x1248('0x38')](_0x38c9d0[_0x1248('0x33')][_0x1248('0x38')]));_0x1f2141[_0x1248('0x39')]=_0x1f2141[_0x1248('0x39')][_0x1248('0x3a')]?_0x1f2141[_0x1248('0x39')]:_0x17cc8f['model'];_0x1f2141[_0x1248('0x3e')]=qs[_0x1248('0x3f')](_0x38c9d0[_0x1248('0x33')][_0x1248('0x3f')]);_0x1f2141[_0x1248('0x40')]=qs['filters'](_['pick'](_0x38c9d0[_0x1248('0x33')],_0x17cc8f['filters']));if(_0x38c9d0[_0x1248('0x33')]['filter']){_0x1f2141[_0x1248('0x40')]=_['merge'](_0x1f2141['where'],{'$or':_[_0x1248('0x31')](_0x1f2141[_0x1248('0x39')],function(_0x138e58){var _0x4afae6={};_0x4afae6[_0x138e58]={'$like':'%'+_0x38c9d0['query'][_0x1248('0x42')]+'%'};return _0x4afae6;})});}_0x1f2141=_[_0x1248('0x43')]({},_0x1f2141,_0x38c9d0['options']);return _0xc07ac0['getAllConditions'](_0x1f2141);}})['then'](function(_0x4d1918){if(_0x4d1918){_0x41874e=_0x4d1918[_0x1248('0x3a')];if(!_0x38c9d0[_0x1248('0x33')]['hasOwnProperty'](_0x1248('0x3c'))){_0x1f2141['limit']=qs[_0x1248('0x3d')](_0x38c9d0[_0x1248('0x33')][_0x1248('0x3d')]);_0x1f2141[_0x1248('0x20')]=qs[_0x1248('0x20')](_0x38c9d0[_0x1248('0x33')]['offset']);}return _0xc07ac0[_0x1248('0x5d')](_0x1f2141);}})[_0x1248('0x26')](function(_0x5bdb6f){if(_0x5bdb6f){return _0x5bdb6f?{'count':_0x41874e,'rows':_0x5bdb6f}:null;}})['then'](respondWithResult(_0x16b35d,null))[_0x1248('0x49')](handleError(_0x16b35d,null));};exports[_0x1248('0x5f')]=function(_0x1f6fb,_0x4069c8,_0x433561){var _0x12f312={};var _0x5ef6ee={};var _0x169786;var _0x3b9f0f;return db[_0x1248('0x2c')][_0x1248('0x5e')]({'where':{'id':_0x1f6fb['params']['id']}})[_0x1248('0x26')](handleEntityNotFound(_0x4069c8,null))[_0x1248('0x26')](function(_0x17bd74){if(_0x17bd74){_0x169786=_0x17bd74;_0x5ef6ee[_0x1248('0x37')]=_[_0x1248('0x34')](db[_0x1248('0x5a')][_0x1248('0x2d')]);_0x5ef6ee[_0x1248('0x33')]=_['keys'](_0x1f6fb[_0x1248('0x33')]);_0x5ef6ee[_0x1248('0x35')]=_['intersection'](_0x5ef6ee[_0x1248('0x37')],_0x5ef6ee[_0x1248('0x33')]);_0x12f312[_0x1248('0x39')]=_['intersection'](_0x5ef6ee[_0x1248('0x37')],qs['fields'](_0x1f6fb[_0x1248('0x33')]['fields']));_0x12f312[_0x1248('0x39')]=_0x12f312[_0x1248('0x39')][_0x1248('0x3a')]?_0x12f312[_0x1248('0x39')]:_0x5ef6ee[_0x1248('0x37')];_0x12f312[_0x1248('0x3e')]=qs[_0x1248('0x3f')](_0x1f6fb[_0x1248('0x33')][_0x1248('0x3f')]);_0x12f312[_0x1248('0x40')]=qs['filters'](_[_0x1248('0x41')](_0x1f6fb[_0x1248('0x33')],_0x5ef6ee[_0x1248('0x35')]));if(_0x1f6fb[_0x1248('0x33')][_0x1248('0x42')]){_0x12f312[_0x1248('0x40')]=_[_0x1248('0x43')](_0x12f312[_0x1248('0x40')],{'$or':_[_0x1248('0x31')](_0x12f312[_0x1248('0x39')],function(_0x3cb4d0){var _0x483c36={};_0x483c36[_0x3cb4d0]={'$like':'%'+_0x1f6fb['query'][_0x1248('0x42')]+'%'};return _0x483c36;})});}_0x12f312=_['merge']({},_0x12f312,_0x1f6fb[_0x1248('0x45')]);return _0x169786['getAnyConditions'](_0x12f312);}})[_0x1248('0x26')](function(_0x436005){if(_0x436005){_0x3b9f0f=_0x436005[_0x1248('0x3a')];if(!_0x1f6fb[_0x1248('0x33')]['hasOwnProperty'](_0x1248('0x3c'))){_0x12f312['limit']=qs['limit'](_0x1f6fb[_0x1248('0x33')][_0x1248('0x3d')]);_0x12f312[_0x1248('0x20')]=qs[_0x1248('0x20')](_0x1f6fb[_0x1248('0x33')][_0x1248('0x20')]);}return _0x169786[_0x1248('0x5f')](_0x12f312);}})['then'](function(_0x489341){if(_0x489341){return _0x489341?{'count':_0x3b9f0f,'rows':_0x489341}:null;}})['then'](respondWithResult(_0x4069c8,null))[_0x1248('0x49')](handleError(_0x4069c8,null));};exports[_0x1248('0x60')]=function(_0x2495dc,_0x1042de,_0x24ebe6){if(_0x2495dc[_0x1248('0x4f')]['id']){delete _0x2495dc['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x2495dc[_0x1248('0x4b')]['id']}})[_0x1248('0x26')](handleEntityNotFound(_0x1042de,null))[_0x1248('0x26')](function(_0x24f919){if(_0x24f919){_0x2495dc[_0x1248('0x4f')][_0x1248('0x61')]=_0x24f919['id'];return db[_0x1248('0x62')][_0x1248('0x4e')](_0x2495dc[_0x1248('0x4f')]);}})[_0x1248('0x26')](respondWithResult(_0x1042de,null))[_0x1248('0x49')](handleError(_0x1042de,null));};exports[_0x1248('0x63')]=function(_0x360fe0,_0x5acf52,_0x4c86a0){var _0x31afd7={};var _0x2184c8={};var _0x187c09;var _0x4fb035;return db[_0x1248('0x2c')][_0x1248('0x5e')]({'where':{'id':_0x360fe0[_0x1248('0x4b')]['id']}})[_0x1248('0x26')](handleEntityNotFound(_0x5acf52,null))['then'](function(_0x1d4076){if(_0x1d4076){_0x187c09=_0x1d4076;_0x2184c8['model']=_['keys'](db[_0x1248('0x62')][_0x1248('0x2d')]);_0x2184c8[_0x1248('0x33')]=_[_0x1248('0x34')](_0x360fe0[_0x1248('0x33')]);_0x2184c8[_0x1248('0x35')]=_[_0x1248('0x36')](_0x2184c8[_0x1248('0x37')],_0x2184c8['query']);_0x31afd7[_0x1248('0x39')]=_[_0x1248('0x36')](_0x2184c8['model'],qs['fields'](_0x360fe0[_0x1248('0x33')][_0x1248('0x38')]));_0x31afd7[_0x1248('0x39')]=_0x31afd7[_0x1248('0x39')][_0x1248('0x3a')]?_0x31afd7[_0x1248('0x39')]:_0x2184c8[_0x1248('0x37')];_0x31afd7['order']=qs[_0x1248('0x3f')](_0x360fe0[_0x1248('0x33')][_0x1248('0x3f')]);_0x31afd7[_0x1248('0x40')]=qs['filters'](_['pick'](_0x360fe0['query'],_0x2184c8[_0x1248('0x35')]));if(_0x360fe0['query']['filter']){_0x31afd7[_0x1248('0x40')]=_['merge'](_0x31afd7['where'],{'$or':_['map'](_0x31afd7[_0x1248('0x39')],function(_0x4995b1){var _0x3bde65={};_0x3bde65[_0x4995b1]={'$like':'%'+_0x360fe0[_0x1248('0x33')][_0x1248('0x42')]+'%'};return _0x3bde65;})});}_0x31afd7=_[_0x1248('0x43')]({},_0x31afd7,_0x360fe0[_0x1248('0x45')]);return _0x187c09[_0x1248('0x63')](_0x31afd7);}})[_0x1248('0x26')](function(_0x203cb5){if(_0x203cb5){_0x4fb035=_0x203cb5[_0x1248('0x3a')];if(!_0x360fe0[_0x1248('0x33')][_0x1248('0x3b')]('nolimit')){_0x31afd7[_0x1248('0x3d')]=qs[_0x1248('0x3d')](_0x360fe0[_0x1248('0x33')][_0x1248('0x3d')]);_0x31afd7['offset']=qs[_0x1248('0x20')](_0x360fe0[_0x1248('0x33')][_0x1248('0x20')]);}return _0x187c09[_0x1248('0x63')](_0x31afd7);}})[_0x1248('0x26')](function(_0x10c2c1){if(_0x10c2c1){return _0x10c2c1?{'count':_0x4fb035,'rows':_0x10c2c1}:null;}})[_0x1248('0x26')](respondWithResult(_0x5acf52,null))[_0x1248('0x49')](handleError(_0x5acf52,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index ed2e00d..aea4de8 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 _0x5d6f=['define','lodash','../../config/logger','moment','request-promise','path','./trigger.attributes','exports'];(function(_0x21416f,_0x5bffcd){var _0x2ef4bf=function(_0xdf52c8){while(--_0xdf52c8){_0x21416f['push'](_0x21416f['shift']());}};_0x2ef4bf(++_0x5bffcd);}(_0x5d6f,0xd1));var _0xf5d6=function(_0x51e326,_0x5a762f){_0x51e326=_0x51e326-0x0;var _0x11638e=_0x5d6f[_0x51e326];return _0x11638e;};'use strict';var _=require(_0xf5d6('0x0'));var util=require('util');var logger=require(_0xf5d6('0x1'))('api');var moment=require(_0xf5d6('0x2'));var BPromise=require('bluebird');var rp=require(_0xf5d6('0x3'));var fs=require('fs');var path=require(_0xf5d6('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5d6('0x5'));module[_0xf5d6('0x6')]=function(_0x3a354c,_0x39834a){return _0x3a354c[_0xf5d6('0x7')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d4c=['api','bluebird','path','rimraf','./trigger.attributes','exports','Trigger','tools_triggers','../../config/logger'];(function(_0x3f940e,_0x140c3b){var _0x424b2e=function(_0x3f2fb4){while(--_0x3f2fb4){_0x3f940e['push'](_0x3f940e['shift']());}};_0x424b2e(++_0x140c3b);}(_0x7d4c,0xa1));var _0xc7d4=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x7d4c[_0x541ea6];return _0x3c3e84;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc7d4('0x0'))(_0xc7d4('0x1'));var moment=require('moment');var BPromise=require(_0xc7d4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7d4('0x3'));var rimraf=require(_0xc7d4('0x4'));var config=require('../../config/environment');var attributes=require(_0xc7d4('0x5'));module[_0xc7d4('0x6')]=function(_0x5cbccc,_0xa63155){return _0x5cbccc['define'](_0xc7d4('0x7'),attributes,{'tableName':_0xc7d4('0x8'),'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 49fa74b..e83070e 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 _0xe511=['find','attributes','ShowTrigger','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrigger','Trigger','options','raw','where','include','map','model','then'];(function(_0x6f8934,_0x48c88f){var _0x21af99=function(_0x4c62ff){while(--_0x4c62ff){_0x6f8934['push'](_0x6f8934['shift']());}};_0x21af99(++_0x48c88f);}(_0xe511,0x16f));var _0x1e51=function(_0x557741,_0x43d009){_0x557741=_0x557741-0x0;var _0x4cd544=_0xe511[_0x557741];return _0x4cd544;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var moment=require('moment');var BPromise=require(_0x1e51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e51('0x3'));var db=require(_0x1e51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var config=require(_0x1e51('0x7'));var jayson=require(_0x1e51('0x8'));var client=jayson['client'][_0x1e51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21ed6b,_0x5c4590,_0x4fa2ba){return new BPromise(function(_0x394ad8,_0x133021){return client['request'](_0x21ed6b,_0x4fa2ba)['then'](function(_0x658941){logger[_0x1e51('0xa')](_0x1e51('0xb'),_0x5c4590,_0x1e51('0xc'));logger[_0x1e51('0xd')](_0x1e51('0xe'),_0x5c4590,'request\x20sent',JSON[_0x1e51('0xf')](_0x658941));if(_0x658941[_0x1e51('0x10')]){if(_0x658941[_0x1e51('0x10')][_0x1e51('0x11')]===0x1f4){logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941['error'][_0x1e51('0x12')]);return _0x133021(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);return _0x394ad8(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}else{logger[_0x1e51('0xa')]('Trigger,\x20%s,\x20%s',_0x5c4590,_0x1e51('0xc'));_0x394ad8(_0x658941[_0x1e51('0x13')][_0x1e51('0x12')]);}})['catch'](function(_0xa3b410){logger['error']('Trigger,\x20%s,\x20%s',_0x5c4590,_0xa3b410);_0x133021(_0xa3b410);});});}exports[_0x1e51('0x14')]=function(_0x27dcad){var _0x40ae4c=this;return new Promise(function(_0x4785a5,_0x4d1aae){return db[_0x1e51('0x15')]['findAll']({'raw':_0x27dcad[_0x1e51('0x16')]?_0x27dcad['options'][_0x1e51('0x17')]===undefined?!![]:![]:!![],'where':_0x27dcad[_0x1e51('0x16')]?_0x27dcad[_0x1e51('0x16')][_0x1e51('0x18')]||null:null,'attributes':_0x27dcad['options']?_0x27dcad['options']['attributes']||null:null,'limit':_0x27dcad['options']?_0x27dcad[_0x1e51('0x16')]['limit']||null:null,'include':_0x27dcad[_0x1e51('0x16')]?_0x27dcad[_0x1e51('0x16')][_0x1e51('0x19')]?_[_0x1e51('0x1a')](_0x27dcad[_0x1e51('0x16')][_0x1e51('0x19')],function(_0x270adf){return{'model':db[_0x270adf[_0x1e51('0x1b')]],'as':_0x270adf['as'],'attributes':_0x270adf['attributes'],'include':_0x270adf['include']?_[_0x1e51('0x1a')](_0x270adf[_0x1e51('0x19')],function(_0x2e42b1){return{'model':db[_0x2e42b1[_0x1e51('0x1b')]],'as':_0x2e42b1['as'],'attributes':_0x2e42b1['attributes'],'include':_0x2e42b1['include']?_['map'](_0x2e42b1[_0x1e51('0x19')],function(_0x2a1561){return{'model':db[_0x2a1561[_0x1e51('0x1b')]],'as':_0x2a1561['as'],'attributes':_0x2a1561['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e51('0x1c')](function(_0x49c507){logger['info'](_0x1e51('0x14'),_0x27dcad);logger['debug'](_0x1e51('0x14'),_0x27dcad,JSON[_0x1e51('0xf')](_0x49c507));_0x4785a5(_0x49c507);})['catch'](function(_0x3e6ef2){logger[_0x1e51('0x10')](_0x1e51('0x14'),_0x3e6ef2[_0x1e51('0x12')],_0x27dcad);_0x4d1aae(_0x40ae4c['error'](0x1f4,_0x3e6ef2['message']));});});};exports['ShowTrigger']=function(_0x20eb9b){var _0x288b50=this;return new Promise(function(_0x1ba84a,_0x36dabe){return db[_0x1e51('0x15')][_0x1e51('0x1d')]({'raw':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')][_0x1e51('0x17')]===undefined?!![]:![]:!![],'where':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')]['where']||null:null,'attributes':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')][_0x1e51('0x1e')]||null:null,'include':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')]['include']?_[_0x1e51('0x1a')](_0x20eb9b['options'][_0x1e51('0x19')],function(_0x3fb57e){return{'model':db[_0x3fb57e[_0x1e51('0x1b')]],'as':_0x3fb57e['as'],'attributes':_0x3fb57e['attributes'],'include':_0x3fb57e[_0x1e51('0x19')]?_['map'](_0x3fb57e[_0x1e51('0x19')],function(_0x4e0187){return{'model':db[_0x4e0187['model']],'as':_0x4e0187['as'],'attributes':_0x4e0187[_0x1e51('0x1e')],'include':_0x4e0187[_0x1e51('0x19')]?_[_0x1e51('0x1a')](_0x4e0187['include'],function(_0x42ac30){return{'model':db[_0x42ac30['model']],'as':_0x42ac30['as'],'attributes':_0x42ac30[_0x1e51('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1e51('0x1c')](function(_0x5760ba){logger[_0x1e51('0xa')](_0x1e51('0x1f'),_0x20eb9b);logger[_0x1e51('0xd')](_0x1e51('0x1f'),_0x20eb9b,JSON[_0x1e51('0xf')](_0x5760ba));_0x1ba84a(_0x5760ba);})[_0x1e51('0x20')](function(_0x5c57a6){logger['error'](_0x1e51('0x1f'),_0x5c57a6['message'],_0x20eb9b);_0x36dabe(_0x288b50[_0x1e51('0x10')](0x1f4,_0x5c57a6[_0x1e51('0x12')]));});});}; \ No newline at end of file +var _0xfef3=['error','message','result','GetTrigger','Trigger','options','raw','where','attributes','limit','include','model','map','catch','ShowTrigger','find','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x27a3cf,_0x59899c){var _0x3e0b94=function(_0x209008){while(--_0x209008){_0x27a3cf['push'](_0x27a3cf['shift']());}};_0x3e0b94(++_0x59899c);}(_0xfef3,0x118));var _0x3fef=function(_0x4fce10,_0x596096){_0x4fce10=_0x4fce10-0x0;var _0x180848=_0xfef3[_0x4fce10];return _0x180848;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var moment=require(_0x3fef('0x1'));var BPromise=require('bluebird');var rs=require(_0x3fef('0x2'));var fs=require('fs');var Redis=require(_0x3fef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fef('0x4'));var logger=require(_0x3fef('0x5'))('rpc');var config=require(_0x3fef('0x6'));var jayson=require(_0x3fef('0x7'));var client=jayson['client'][_0x3fef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f5b72,_0x800850,_0x33e00a){return new BPromise(function(_0x1fffc5,_0x41960c){return client[_0x3fef('0x9')](_0x5f5b72,_0x33e00a)[_0x3fef('0xa')](function(_0x31c30f){logger[_0x3fef('0xb')](_0x3fef('0xc'),_0x800850,_0x3fef('0xd'));logger[_0x3fef('0xe')](_0x3fef('0xf'),_0x800850,'request\x20sent',JSON[_0x3fef('0x10')](_0x31c30f));if(_0x31c30f[_0x3fef('0x11')]){if(_0x31c30f[_0x3fef('0x11')]['code']===0x1f4){logger[_0x3fef('0x11')]('Trigger,\x20%s,\x20%s',_0x800850,_0x31c30f[_0x3fef('0x11')][_0x3fef('0x12')]);return _0x41960c(_0x31c30f[_0x3fef('0x11')]['message']);}logger[_0x3fef('0x11')]('Trigger,\x20%s,\x20%s',_0x800850,_0x31c30f[_0x3fef('0x11')][_0x3fef('0x12')]);return _0x1fffc5(_0x31c30f['error'][_0x3fef('0x12')]);}else{logger[_0x3fef('0xb')](_0x3fef('0xc'),_0x800850,_0x3fef('0xd'));_0x1fffc5(_0x31c30f[_0x3fef('0x13')][_0x3fef('0x12')]);}})['catch'](function(_0x1cbdbb){logger[_0x3fef('0x11')](_0x3fef('0xc'),_0x800850,_0x1cbdbb);_0x41960c(_0x1cbdbb);});});}exports[_0x3fef('0x14')]=function(_0x1613ad){var _0xaa0ae3=this;return new Promise(function(_0x53d993,_0x36669d){return db[_0x3fef('0x15')]['findAll']({'raw':_0x1613ad[_0x3fef('0x16')]?_0x1613ad[_0x3fef('0x16')][_0x3fef('0x17')]===undefined?!![]:![]:!![],'where':_0x1613ad[_0x3fef('0x16')]?_0x1613ad[_0x3fef('0x16')][_0x3fef('0x18')]||null:null,'attributes':_0x1613ad[_0x3fef('0x16')]?_0x1613ad[_0x3fef('0x16')][_0x3fef('0x19')]||null:null,'limit':_0x1613ad[_0x3fef('0x16')]?_0x1613ad[_0x3fef('0x16')][_0x3fef('0x1a')]||null:null,'include':_0x1613ad[_0x3fef('0x16')]?_0x1613ad[_0x3fef('0x16')][_0x3fef('0x1b')]?_['map'](_0x1613ad['options']['include'],function(_0x378b03){return{'model':db[_0x378b03[_0x3fef('0x1c')]],'as':_0x378b03['as'],'attributes':_0x378b03[_0x3fef('0x19')],'include':_0x378b03['include']?_[_0x3fef('0x1d')](_0x378b03['include'],function(_0x45464b){return{'model':db[_0x45464b[_0x3fef('0x1c')]],'as':_0x45464b['as'],'attributes':_0x45464b[_0x3fef('0x19')],'include':_0x45464b[_0x3fef('0x1b')]?_[_0x3fef('0x1d')](_0x45464b['include'],function(_0x4b4dee){return{'model':db[_0x4b4dee['model']],'as':_0x4b4dee['as'],'attributes':_0x4b4dee[_0x3fef('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3fef('0xa')](function(_0x4ea2ab){logger[_0x3fef('0xb')](_0x3fef('0x14'),_0x1613ad);logger['debug'](_0x3fef('0x14'),_0x1613ad,JSON[_0x3fef('0x10')](_0x4ea2ab));_0x53d993(_0x4ea2ab);})[_0x3fef('0x1e')](function(_0x2b73fb){logger[_0x3fef('0x11')](_0x3fef('0x14'),_0x2b73fb[_0x3fef('0x12')],_0x1613ad);_0x36669d(_0xaa0ae3['error'](0x1f4,_0x2b73fb[_0x3fef('0x12')]));});});};exports[_0x3fef('0x1f')]=function(_0x21aad4){var _0x11bd40=this;return new Promise(function(_0x5dbbc0,_0xcd635d){return db['Trigger'][_0x3fef('0x20')]({'raw':_0x21aad4[_0x3fef('0x16')]?_0x21aad4[_0x3fef('0x16')][_0x3fef('0x17')]===undefined?!![]:![]:!![],'where':_0x21aad4[_0x3fef('0x16')]?_0x21aad4[_0x3fef('0x16')][_0x3fef('0x18')]||null:null,'attributes':_0x21aad4[_0x3fef('0x16')]?_0x21aad4[_0x3fef('0x16')][_0x3fef('0x19')]||null:null,'include':_0x21aad4['options']?_0x21aad4['options'][_0x3fef('0x1b')]?_['map'](_0x21aad4[_0x3fef('0x16')][_0x3fef('0x1b')],function(_0x4075ed){return{'model':db[_0x4075ed[_0x3fef('0x1c')]],'as':_0x4075ed['as'],'attributes':_0x4075ed[_0x3fef('0x19')],'include':_0x4075ed[_0x3fef('0x1b')]?_[_0x3fef('0x1d')](_0x4075ed[_0x3fef('0x1b')],function(_0x205690){return{'model':db[_0x205690[_0x3fef('0x1c')]],'as':_0x205690['as'],'attributes':_0x205690[_0x3fef('0x19')],'include':_0x205690[_0x3fef('0x1b')]?_[_0x3fef('0x1d')](_0x205690[_0x3fef('0x1b')],function(_0x58d276){return{'model':db[_0x58d276[_0x3fef('0x1c')]],'as':_0x58d276['as'],'attributes':_0x58d276[_0x3fef('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3fef('0xa')](function(_0x19e935){logger[_0x3fef('0xb')](_0x3fef('0x1f'),_0x21aad4);logger['debug']('ShowTrigger',_0x21aad4,JSON[_0x3fef('0x10')](_0x19e935));_0x5dbbc0(_0x19e935);})[_0x3fef('0x1e')](function(_0x42490a){logger[_0x3fef('0x11')](_0x3fef('0x1f'),_0x42490a[_0x3fef('0x12')],_0x21aad4);_0xcd635d(_0x11bd40[_0x3fef('0x11')](0x1f4,_0x42490a[_0x3fef('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 5df0693..25f14c3 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 _0xbd50=['show','clone','post','create','put','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated'];(function(_0x3e779c,_0x546ea2){var _0x22ab11=function(_0x4f2b7a){while(--_0x4f2b7a){_0x3e779c['push'](_0x3e779c['shift']());}};_0x22ab11(++_0x546ea2);}(_0xbd50,0x196));var _0x0bd5=function(_0x3be8e8,_0x246a8f){_0x3be8e8=_0x3be8e8-0x0;var _0x5f7c64=_0xbd50[_0x3be8e8];return _0x5f7c64;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var auth=require(_0x0bd5('0x5'));var interaction=require(_0x0bd5('0x6'));var config=require(_0x0bd5('0x7'));var controller=require('./trunk.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0bd5('0x8')]);router[_0x0bd5('0x9')](_0x0bd5('0xa'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0xc')]);router['post']('/:id/clone',auth[_0x0bd5('0xb')](),controller[_0x0bd5('0xd')]);router[_0x0bd5('0xe')]('/',auth['isAuthenticated'](),controller[_0x0bd5('0xf')]);router[_0x0bd5('0x10')]('/:id',auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x11')]);router['delete'](_0x0bd5('0xa'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7bae=['index','/:id','show','post','/:id/clone','clone','create','put','update','delete','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated'];(function(_0x3ebf8c,_0x3e1efd){var _0x32ee6f=function(_0x116798){while(--_0x116798){_0x3ebf8c['push'](_0x3ebf8c['shift']());}};_0x32ee6f(++_0x3e1efd);}(_0x7bae,0x13b));var _0xe7ba=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x7bae[_0x1eda20];return _0x31b953;};'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('0xb')](_0xe7ba('0xc'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xd')]);router['post']('/',auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xe')]);router[_0xe7ba('0xf')](_0xe7ba('0x9'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0x10')]);router[_0xe7ba('0x11')](_0xe7ba('0x9'),auth[_0xe7ba('0x7')](),controller['destroy']);module[_0xe7ba('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 8f3885e..1f989bd 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 _0xb858=['from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','yes','update','outgoing','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','uas','pai','fingerprint','certificate','passive','dynamic','nonat','update,nonat','sequelize','exports','STRING','ENUM','friend','user'];(function(_0x2c38c1,_0x108063){var _0x180ee2=function(_0x3c4da6){while(--_0x3c4da6){_0x2c38c1['push'](_0x2c38c1['shift']());}};_0x180ee2(++_0x108063);}(_0xb858,0x108));var _0x8b85=function(_0x5521b2,_0x342d2b){_0x5521b2=_0x5521b2-0x0;var _0x3250e3=_0xb858[_0x5521b2];return _0x3250e3;};'use strict';var Sequelize=require(_0x8b85('0x0'));module[_0x8b85('0x1')]={'name':{'type':Sequelize[_0x8b85('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x4'),_0x8b85('0x5'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x8b85('0x2')],'allowNull':![],'defaultValue':_0x8b85('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0x8b85('0x7'),'ALLOWED_PASSED_SCREEN',_0x8b85('0x8'),'ALLOWED',_0x8b85('0x9'),'PROHIB_PASSED_SCREEN',_0x8b85('0xa'),'PROHIB')},'deny':{'type':Sequelize[_0x8b85('0x2')]},'permit':{'type':Sequelize[_0x8b85('0x2')]},'secret':{'type':Sequelize[_0x8b85('0x2')]},'md5secret':{'type':Sequelize[_0x8b85('0x2')]},'remotesecret':{'type':Sequelize[_0x8b85('0x2')]},'transport':{'type':Sequelize[_0x8b85('0x2')],'defaultValue':_0x8b85('0xb'),'set':function(_0x17e8de){this['setDataValue']('transport',_0x17e8de?_0x17e8de[_0x8b85('0xc')](','):null);},'get':function(){return this['getDataValue'](_0x8b85('0xd'))?this[_0x8b85('0xe')](_0x8b85('0xd'))[_0x8b85('0xf')](','):null;},'comment':_0x8b85('0x10')},'dtmfmode':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x11'),'info',_0x8b85('0x12'),'inband','auto'),'defaultValue':_0x8b85('0x11')},'directmedia':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no','nonat',_0x8b85('0x14'),_0x8b85('0x15')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8b85('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x8b85('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x4acdf9){this[_0x8b85('0x16')]('nat',_0x4acdf9?_0x4acdf9[_0x8b85('0xc')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x8b85('0xe')](_0x8b85('0x17'))[_0x8b85('0xf')](','):null;},'comment':_0x8b85('0x18')},'callgroup':{'type':Sequelize[_0x8b85('0x2')]},'namedcallgroup':{'type':Sequelize[_0x8b85('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x8b85('0x2')]},'language':{'type':Sequelize[_0x8b85('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8b85('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8b85('0x2')],'defaultValue':_0x8b85('0x19')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x2d7cc6){this[_0x8b85('0x16')]('allow',_0x2d7cc6?_0x2d7cc6[_0x8b85('0xc')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x8b85('0xe')]('allow')?this[_0x8b85('0xe')](_0x8b85('0x1a'))[_0x8b85('0xf')](';'):null;},'comment':_0x8b85('0x1b')},'autoframing':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no')},'insecure':{'type':Sequelize[_0x8b85('0x2')],'defaultValue':_0x8b85('0x1c'),'set':function(_0x3d2d85){this[_0x8b85('0x16')](_0x8b85('0x1d'),_0x3d2d85?_0x3d2d85[_0x8b85('0xc')](','):null);},'get':function(){return this[_0x8b85('0xe')](_0x8b85('0x1d'))?this[_0x8b85('0xe')](_0x8b85('0x1d'))[_0x8b85('0xf')](','):null;},'comment':_0x8b85('0x1e')},'trustrpid':{'type':Sequelize[_0x8b85('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8b85('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8b85('0x3')]('yes','no',_0x8b85('0x1f'))},'promiscredir':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x8b85('0x13'),'no')},'accountcode':{'type':Sequelize[_0x8b85('0x20')](0xb)},'setvar':{'type':Sequelize[_0x8b85('0x2')]},'callerid':{'type':Sequelize[_0x8b85('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x8b85('0x2')]},'callcounter':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no'),'defaultValue':_0x8b85('0x13')},'busylevel':{'type':Sequelize[_0x8b85('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no')},'allowsubscribe':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no')},'allowtransfer':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no')},'subscribecontext':{'type':Sequelize[_0x8b85('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x8b85('0x3')]('yes','no',_0x8b85('0x21')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8b85('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x22'),_0x8b85('0x23'),'originate')},'session_expires':{'type':Sequelize[_0x8b85('0x20')](0xb)},'session_minse':{'type':Sequelize[_0x8b85('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x24'),_0x8b85('0x25')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x8b85('0x2')]},'regexten':{'type':Sequelize[_0x8b85('0x2')]},'fromdomain':{'type':Sequelize[_0x8b85('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no'),'defaultValue':_0x8b85('0x13')},'keepalive':{'type':Sequelize[_0x8b85('0x20')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x8b85('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8b85('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no',_0x8b85('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x8b85('0x2')]},'timert1':{'type':Sequelize[_0x8b85('0x20')](0xb)},'timerb':{'type':Sequelize[_0x8b85('0x20')](0xb)},'qualifyfreq':{'type':Sequelize[_0x8b85('0x20')](0xb)},'contactpermit':{'type':Sequelize[_0x8b85('0x2')]},'contactdeny':{'type':Sequelize[_0x8b85('0x2')]},'contactacl':{'type':Sequelize[_0x8b85('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x8b85('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8b85('0x3')]('yes','no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no')},'dtlsenable':{'type':Sequelize[_0x8b85('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no',_0x8b85('0x27'),_0x8b85('0x28'))},'dtlsrekey':{'type':Sequelize[_0x8b85('0x20')](0xb)},'dtlscertfile':{'type':Sequelize[_0x8b85('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x8b85('0x2')]},'dtlscipher':{'type':Sequelize[_0x8b85('0x2')]},'dtlscafile':{'type':Sequelize[_0x8b85('0x2')]},'dtlscapath':{'type':Sequelize[_0x8b85('0x2')]},'dtlssetup':{'type':Sequelize[_0x8b85('0x3')]('active',_0x8b85('0x29'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8b85('0x2')]},'usereqphone':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8b85('0x2')]},'recordofffeature':{'type':Sequelize[_0x8b85('0x2')]},'call_limit':{'type':Sequelize[_0x8b85('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no')},'subscribemwi':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no')},'vmexten':{'type':Sequelize[_0x8b85('0x2')]},'mohinterpret':{'type':Sequelize[_0x8b85('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8b85('0x2')]},'host':{'type':Sequelize[_0x8b85('0x2')],'defaultValue':_0x8b85('0x2a')},'canreinvite':{'type':Sequelize[_0x8b85('0x3')](_0x8b85('0x13'),'no',_0x8b85('0x2b'),'update',_0x8b85('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x8b85('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x8b85('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x24a2=['peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','sequelize','STRING','name','friend','user'];(function(_0x3553b1,_0x296a7b){var _0x468b12=function(_0x23f988){while(--_0x23f988){_0x3553b1['push'](_0x3553b1['shift']());}};_0x468b12(++_0x296a7b);}(_0x24a2,0x1c3));var _0x224a=function(_0x114b19,_0x11e70b){_0x114b19=_0x114b19-0x0;var _0x533650=_0x24a2[_0x114b19];return _0x533650;};'use strict';var Sequelize=require(_0x224a('0x0'));module['exports']={'name':{'type':Sequelize[_0x224a('0x1')],'allowNull':![],'unique':_0x224a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x224a('0x3'),_0x224a('0x4'),_0x224a('0x5')),'allowNull':![],'defaultValue':_0x224a('0x3')},'context':{'type':Sequelize[_0x224a('0x1')],'allowNull':![],'defaultValue':_0x224a('0x6')},'callingpres':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x8'),_0x224a('0x9'),_0x224a('0xa'),'ALLOWED',_0x224a('0xb'),_0x224a('0xc'),_0x224a('0xd'),_0x224a('0xe'))},'deny':{'type':Sequelize[_0x224a('0x1')]},'permit':{'type':Sequelize[_0x224a('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x224a('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x224a('0xf'),'set':function(_0x5d8f74){this[_0x224a('0x10')](_0x224a('0x11'),_0x5d8f74?_0x5d8f74['join'](','):null);},'get':function(){return this[_0x224a('0x12')](_0x224a('0x11'))?this[_0x224a('0x12')](_0x224a('0x11'))['split'](','):null;},'comment':_0x224a('0x13')},'dtmfmode':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x14'),_0x224a('0x15'),_0x224a('0x16'),_0x224a('0x17'),_0x224a('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no',_0x224a('0x1a'),_0x224a('0x1b'),_0x224a('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x224a('0x7')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x224a('0x1')]},'nat':{'type':Sequelize[_0x224a('0x1')],'defaultValue':_0x224a('0x1d'),'set':function(_0x11bcb2){this[_0x224a('0x10')](_0x224a('0x1e'),_0x11bcb2?_0x11bcb2[_0x224a('0x1f')](','):null);},'get':function(){return this[_0x224a('0x12')](_0x224a('0x1e'))?this['getDataValue']('nat')[_0x224a('0x20')](','):null;},'comment':_0x224a('0x21')},'callgroup':{'type':Sequelize[_0x224a('0x1')]},'namedcallgroup':{'type':Sequelize[_0x224a('0x1')]},'pickupgroup':{'type':Sequelize[_0x224a('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x224a('0x1')]},'language':{'type':Sequelize[_0x224a('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x224a('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x224a('0x1')],'defaultValue':_0x224a('0x22')},'allow':{'type':Sequelize[_0x224a('0x1')],'allowNull':![],'defaultValue':_0x224a('0x23'),'set':function(_0x4bd431){this['setDataValue']('allow',_0x4bd431?_0x4bd431[_0x224a('0x1f')](';'):_0x224a('0x23'));},'get':function(){return this['getDataValue'](_0x224a('0x24'))?this[_0x224a('0x12')](_0x224a('0x24'))[_0x224a('0x20')](';'):null;},'comment':_0x224a('0x25')},'autoframing':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no')},'insecure':{'type':Sequelize[_0x224a('0x1')],'defaultValue':_0x224a('0x26'),'set':function(_0x645a76){this[_0x224a('0x10')](_0x224a('0x27'),_0x645a76?_0x645a76[_0x224a('0x1f')](','):null);},'get':function(){return this[_0x224a('0x12')]('insecure')?this[_0x224a('0x12')](_0x224a('0x27'))['split'](','):null;},'comment':_0x224a('0x28')},'trustrpid':{'type':Sequelize['ENUM'](_0x224a('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x224a('0x19'),'no',_0x224a('0x29'))},'promiscredir':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no')},'accountcode':{'type':Sequelize[_0x224a('0x2a')](0xb)},'setvar':{'type':Sequelize[_0x224a('0x1')]},'callerid':{'type':Sequelize[_0x224a('0x1')],'defaultValue':_0x224a('0x2b')},'amaflags':{'type':Sequelize[_0x224a('0x1')]},'callcounter':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x224a('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x224a('0x1')]},'videosupport':{'type':Sequelize[_0x224a('0x7')]('yes','no',_0x224a('0x2c')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x224a('0x2a')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x224a('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x2d'),_0x224a('0x2e'),_0x224a('0x2f'))},'session_expires':{'type':Sequelize[_0x224a('0x2a')](0xb)},'session_minse':{'type':Sequelize[_0x224a('0x2a')](0xb)},'session_refresher':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x30'),_0x224a('0x31')),'defaultValue':_0x224a('0x31')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x224a('0x1')]},'fromdomain':{'type':Sequelize[_0x224a('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x224a('0x2a')](0x5)},'qualify':{'type':Sequelize[_0x224a('0x7')]('yes','no'),'defaultValue':_0x224a('0x19')},'keepalive':{'type':Sequelize[_0x224a('0x2a')](0xb)},'defaultip':{'type':Sequelize[_0x224a('0x1')]},'defaultuser':{'type':Sequelize[_0x224a('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x224a('0x2a')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x224a('0x2a')](0xb)},'sendrpid':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no',_0x224a('0x32')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x224a('0x1')]},'callbackextension':{'type':Sequelize[_0x224a('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x224a('0x2a')](0xb)},'contactpermit':{'type':Sequelize[_0x224a('0x1')]},'contactdeny':{'type':Sequelize[_0x224a('0x1')]},'contactacl':{'type':Sequelize[_0x224a('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x224a('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x224a('0x7')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x224a('0x19'),'no')},'force_avp':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no')},'icesupport':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x224a('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x19'),'no',_0x224a('0x33'),_0x224a('0x34'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x224a('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x224a('0x1')]},'dtlscapath':{'type':Sequelize[_0x224a('0x1')]},'dtlssetup':{'type':Sequelize[_0x224a('0x7')](_0x224a('0x35'),_0x224a('0x36'),_0x224a('0x37')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x224a('0x1')]},'usereqphone':{'type':Sequelize[_0x224a('0x7')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x224a('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x224a('0x2a')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x224a('0x7')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x224a('0x19'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x224a('0x1')]},'mohsuggest':{'type':Sequelize[_0x224a('0x1')]},'parkinglot':{'type':Sequelize[_0x224a('0x1')]},'description':{'type':Sequelize[_0x224a('0x1')]},'host':{'type':Sequelize[_0x224a('0x1')],'defaultValue':_0x224a('0x38')},'canreinvite':{'type':Sequelize[_0x224a('0x7')]('yes','no',_0x224a('0x1a'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x224a('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x224a('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 03c32a1..b13ede9 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 _0x5d81=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','autoAssociation','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','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','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','clone','createdAt','updatedAt','body'];(function(_0x4197cf,_0x1b2bfc){var _0x13d6c4=function(_0x389f74){while(--_0x389f74){_0x4197cf['push'](_0x4197cf['shift']());}};_0x13d6c4(++_0x1b2bfc);}(_0x5d81,0x1c0));var _0x15d8=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x5d81[_0x576170];return _0x397c70;};'use strict';var pdf=require(_0x15d8('0x0'));var emlformat=require(_0x15d8('0x1'));var rimraf=require(_0x15d8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15d8('0x3'));var rp=require(_0x15d8('0x4'));var moment=require(_0x15d8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x15d8('0x6'));var util=require('util');var path=require(_0x15d8('0x7'));var sox=require(_0x15d8('0x8'));var csv=require(_0x15d8('0x9'));var ejs=require(_0x15d8('0xa'));var fs=require('fs');var _=require(_0x15d8('0xb'));var squel=require(_0x15d8('0xc'));var crypto=require(_0x15d8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x15d8('0xe'));var toCsv=require(_0x15d8('0x9'));var querystring=require('querystring');var Papa=require(_0x15d8('0xf'));var Redis=require('ioredis');var authService=require(_0x15d8('0x10'));var qs=require(_0x15d8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x15d8('0x12'))(_0x15d8('0x13'));var utils=require('../../config/utils');var config=require(_0x15d8('0x14'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x15d8('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x2fcd54,_0x8a0e2c,_0x1ee495){if(_0x1ee495){var _0x3f4a08=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f4a08[_0x15d8('0x16')](_0x8a0e2c)){return _0x2fcd54;}else{throw new db['Sequelize'][(_0x15d8('0x17'))](_0x15d8('0x18'));}}else{return _0x2fcd54;}}function respondWithRpcPromise(_0x5bc3b4,_0x14d1fd,_0x4f8aea,_0x22a43b){return new BPromise(function(_0x3364b2,_0x21c4a8){var _0x13f1d8=_0x22a43b||client;return _0x13f1d8[_0x15d8('0x19')](_0x5bc3b4,_0x4f8aea)[_0x15d8('0x1a')](function(_0x45518d){logger[_0x15d8('0x1b')](_0x15d8('0x1c'),_0x14d1fd,_0x15d8('0x1d'));logger[_0x15d8('0x1e')]('Trunk,\x20%s,\x20%s,\x20%s',_0x14d1fd,_0x15d8('0x1d'),JSON[_0x15d8('0x1f')](_0x45518d));if(_0x45518d[_0x15d8('0x20')]){if(_0x45518d['error']['code']===0x1f4){logger['error'](_0x15d8('0x1c'),_0x14d1fd,_0x45518d[_0x15d8('0x20')][_0x15d8('0x21')]);return _0x21c4a8(_0x45518d['error'][_0x15d8('0x21')]);}logger[_0x15d8('0x20')]('Trunk,\x20%s,\x20%s',_0x14d1fd,_0x45518d[_0x15d8('0x20')][_0x15d8('0x21')]);return _0x3364b2(_0x45518d[_0x15d8('0x20')][_0x15d8('0x21')]);}else{logger[_0x15d8('0x1b')](_0x15d8('0x1c'),_0x14d1fd,_0x15d8('0x1d'));_0x3364b2(_0x45518d[_0x15d8('0x22')][_0x15d8('0x21')]);}})['catch'](function(_0x4debe2){logger[_0x15d8('0x20')]('Trunk,\x20%s,\x20%s',_0x14d1fd,_0x4debe2);_0x21c4a8(_0x4debe2);});});}function respondWithStatusCode(_0x272a36,_0x1e6768){_0x1e6768=_0x1e6768||0xcc;return function(_0x37b6d2){if(_0x37b6d2){return _0x272a36[_0x15d8('0x23')](_0x1e6768);}return _0x272a36[_0x15d8('0x24')](_0x1e6768)[_0x15d8('0x25')]();};}function respondWithResult(_0x10d00f,_0x3ec74c){_0x3ec74c=_0x3ec74c||0xc8;return function(_0x2cb5fe){if(_0x2cb5fe){return _0x10d00f[_0x15d8('0x24')](_0x3ec74c)[_0x15d8('0x26')](_0x2cb5fe);}};}function respondWithFilteredResult(_0x54f8f6,_0x7f1882){return function(_0x5061e3){if(_0x5061e3){var _0x2468ed=_0x5061e3[_0x15d8('0x27')],_0x219459=_0x7f1882[_0x15d8('0x28')],_0x16ac88=_0x7f1882[_0x15d8('0x28')]+_0x7f1882[_0x15d8('0x29')],_0x1a076c;if(_0x16ac88>=_0x2468ed){_0x16ac88=_0x2468ed;_0x1a076c=0xc8;}else{_0x1a076c=0xce;}_0x54f8f6[_0x15d8('0x24')](_0x1a076c);return _0x54f8f6['set']('Content-Range',_0x219459+'-'+_0x16ac88+'/'+_0x2468ed)[_0x15d8('0x26')](_0x5061e3);}return null;};}function patchUpdates(_0x55bcd5){return function(_0x4667de){try{jsonpatch[_0x15d8('0x2a')](_0x4667de,_0x55bcd5,!![]);}catch(_0x5bcda7){return BPromise[_0x15d8('0x2b')](_0x5bcda7);}return _0x4667de[_0x15d8('0x2c')]();};}function saveUpdates(_0x1c475b,_0x34c375){return function(_0x3926c2){if(_0x3926c2){return _0x3926c2[_0x15d8('0x2d')](_0x1c475b)[_0x15d8('0x1a')](function(_0x48e7e0){return _0x48e7e0;});}return null;};}function removeEntity(_0x1092b2,_0x1ea2b1){return function(_0x100208){if(_0x100208){return _0x100208[_0x15d8('0x2e')]()[_0x15d8('0x1a')](function(){var _0xcea2e6=_0x100208[_0x15d8('0x2f')]({'plain':!![]});var _0x174198=_0x15d8('0x30');return db[_0x15d8('0x31')][_0x15d8('0x2e')]({'where':{'type':_0x174198,'resourceId':_0xcea2e6['id']}})[_0x15d8('0x1a')](function(){return _0x100208;});})[_0x15d8('0x1a')](function(){_0x1092b2[_0x15d8('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4501dd,_0x1fe261){return function(_0x2d172c){if(!_0x2d172c){_0x4501dd[_0x15d8('0x23')](0x194);}return _0x2d172c;};}function handleError(_0x3a8d6b,_0x595e63){_0x595e63=_0x595e63||0x1f4;return function(_0x50b861){logger[_0x15d8('0x20')](_0x50b861['stack']);if(_0x50b861[_0x15d8('0x32')]){delete _0x50b861[_0x15d8('0x32')];}_0x3a8d6b[_0x15d8('0x24')](_0x595e63)[_0x15d8('0x33')](_0x50b861);};}exports[_0x15d8('0x34')]=function(_0x1083d5,_0x1a1761){var _0x57f1ac={},_0x571aed={},_0x361e4f={'count':0x0,'rows':[]};var _0x29aaa3=_[_0x15d8('0x35')](db[_0x15d8('0x36')][_0x15d8('0x37')],function(_0x38513d){return{'name':_0x38513d[_0x15d8('0x38')],'type':_0x38513d['type'][_0x15d8('0x39')]};});_0x571aed[_0x15d8('0x3a')]=_[_0x15d8('0x35')](_0x29aaa3,_0x15d8('0x32'));_0x571aed[_0x15d8('0x3b')]=_[_0x15d8('0x3c')](_0x1083d5[_0x15d8('0x3b')]);_0x571aed[_0x15d8('0x3d')]=_[_0x15d8('0x3e')](_0x571aed[_0x15d8('0x3a')],_0x571aed[_0x15d8('0x3b')]);_0x57f1ac['attributes']=_[_0x15d8('0x3e')](_0x571aed['model'],qs[_0x15d8('0x3f')](_0x1083d5['query'][_0x15d8('0x3f')]));_0x57f1ac[_0x15d8('0x40')]=_0x57f1ac[_0x15d8('0x40')][_0x15d8('0x41')]?_0x57f1ac[_0x15d8('0x40')]:_0x571aed['model'];if(!_0x1083d5[_0x15d8('0x3b')][_0x15d8('0x42')](_0x15d8('0x43'))){_0x57f1ac[_0x15d8('0x29')]=qs[_0x15d8('0x29')](_0x1083d5[_0x15d8('0x3b')]['limit']);_0x57f1ac[_0x15d8('0x28')]=qs[_0x15d8('0x28')](_0x1083d5[_0x15d8('0x3b')][_0x15d8('0x28')]);}_0x57f1ac[_0x15d8('0x44')]=qs[_0x15d8('0x45')](_0x1083d5[_0x15d8('0x3b')][_0x15d8('0x45')]);_0x57f1ac[_0x15d8('0x46')]=qs[_0x15d8('0x3d')](_['pick'](_0x1083d5[_0x15d8('0x3b')],_0x571aed[_0x15d8('0x3d')]));if(_0x1083d5[_0x15d8('0x3b')][_0x15d8('0x47')]){_0x57f1ac[_0x15d8('0x46')]=_[_0x15d8('0x48')](_0x57f1ac[_0x15d8('0x46')],{'$or':_[_0x15d8('0x35')](_0x29aaa3,function(_0x3f79fe){if(_0x3f79fe[_0x15d8('0x49')]!==_0x15d8('0x4a')){var _0x2f13f9={};_0x2f13f9[_0x3f79fe['name']]={'$like':'%'+_0x1083d5[_0x15d8('0x3b')][_0x15d8('0x47')]+'%'};return _0x2f13f9;}})});}_0x57f1ac=_[_0x15d8('0x48')]({},_0x57f1ac,_0x1083d5[_0x15d8('0x4b')]);var _0x537dfe={'where':_0x57f1ac[_0x15d8('0x46')]};return db[_0x15d8('0x36')][_0x15d8('0x27')](_0x537dfe)[_0x15d8('0x1a')](function(_0x3dc7e2){_0x361e4f['count']=_0x3dc7e2;if(_0x1083d5[_0x15d8('0x3b')][_0x15d8('0x4c')]){_0x57f1ac[_0x15d8('0x4d')]=[{'all':!![]}];}return db[_0x15d8('0x36')][_0x15d8('0x4e')](_0x57f1ac);})['then'](function(_0x32d146){_0x361e4f['rows']=_0x32d146;return _0x361e4f;})['then'](respondWithFilteredResult(_0x1a1761,_0x57f1ac))[_0x15d8('0x4f')](handleError(_0x1a1761,null));};exports[_0x15d8('0x50')]=function(_0x21ae1a,_0x45a712){var _0x1dc698={'raw':![],'where':{'id':_0x21ae1a[_0x15d8('0x51')]['id']}},_0x509878={};_0x509878[_0x15d8('0x3a')]=_[_0x15d8('0x3c')](db[_0x15d8('0x36')][_0x15d8('0x37')]);_0x509878[_0x15d8('0x3b')]=_[_0x15d8('0x3c')](_0x21ae1a[_0x15d8('0x3b')]);_0x509878[_0x15d8('0x3d')]=_[_0x15d8('0x3e')](_0x509878[_0x15d8('0x3a')],_0x509878[_0x15d8('0x3b')]);_0x1dc698['attributes']=_[_0x15d8('0x3e')](_0x509878['model'],qs[_0x15d8('0x3f')](_0x21ae1a[_0x15d8('0x3b')]['fields']));_0x1dc698['attributes']=_0x1dc698['attributes'][_0x15d8('0x41')]?_0x1dc698[_0x15d8('0x40')]:_0x509878[_0x15d8('0x3a')];if(_0x21ae1a[_0x15d8('0x3b')]['includeAll']){_0x1dc698[_0x15d8('0x4d')]=[{'all':!![]}];}_0x1dc698=_[_0x15d8('0x48')]({},_0x1dc698,_0x21ae1a['options']);return db[_0x15d8('0x36')][_0x15d8('0x52')](_0x1dc698)[_0x15d8('0x1a')](handleEntityNotFound(_0x45a712,null))['then'](respondWithResult(_0x45a712,null))[_0x15d8('0x4f')](handleError(_0x45a712,null));};exports[_0x15d8('0x53')]=function(_0xba21b4,_0x38c209){var _0x802e16={'where':{'id':_0xba21b4[_0x15d8('0x51')]['id']}},_0x14ce11={};_0x14ce11[_0x15d8('0x3a')]=_[_0x15d8('0x3c')](db['Trunk'][_0x15d8('0x37')]);_0x802e16[_0x15d8('0x40')]=_[_0x15d8('0x3e')](_0x14ce11[_0x15d8('0x3a')],qs['fields'](_0xba21b4[_0x15d8('0x3b')][_0x15d8('0x3f')]));_0x802e16[_0x15d8('0x40')]=_0x802e16[_0x15d8('0x40')]['length']?_0x802e16[_0x15d8('0x40')]:_0x14ce11[_0x15d8('0x3a')];if(_0xba21b4[_0x15d8('0x3b')][_0x15d8('0x4c')]){_0x802e16[_0x15d8('0x4d')]=[{'all':!![]}];}_0x802e16=_[_0x15d8('0x48')]({},_0x802e16,_0xba21b4[_0x15d8('0x4b')]);return db[_0x15d8('0x36')][_0x15d8('0x52')](_0x802e16)[_0x15d8('0x1a')](handleEntityNotFound(_0x38c209,null))[_0x15d8('0x1a')](function(_0x4dfc15){if(_0x4dfc15){var _0x340695=_0x4dfc15[_0x15d8('0x2f')]({'plain':!![]});_0x340695=qs['omit'](_0x340695,['id',_0x15d8('0x54'),_0x15d8('0x55')]);_0xba21b4[_0x15d8('0x56')]=_['omit'](_0xba21b4[_0x15d8('0x56')],['id','createdAt',_0x15d8('0x55')]);return db[_0x15d8('0x36')][_0x15d8('0x57')](_['merge'](_0x340695,_0xba21b4[_0x15d8('0x56')]),{'include':_0xba21b4[_0x15d8('0x3b')]['includeAll']?[{'all':!![]}]:undefined})[_0x15d8('0x1a')](function(_0x57e696){var _0x128da7=_0xba21b4[_0x15d8('0x58')][_0x15d8('0x2f')]({'plain':!![]});if(!_0x128da7)throw new Error(_0x15d8('0x59'));if(_0x128da7[_0x15d8('0x5a')]===_0x15d8('0x58')){var _0x3aba26=_0x57e696[_0x15d8('0x2f')]({'plain':!![]});var _0x245dc6=_0x15d8('0x30');return db['UserProfileSection'][_0x15d8('0x52')]({'where':{'name':_0x245dc6,'userProfileId':_0x128da7[_0x15d8('0x5b')]},'raw':!![]})[_0x15d8('0x1a')](function(_0x171557){if(_0x171557&&_0x171557['autoAssociation']===0x0){return db[_0x15d8('0x31')][_0x15d8('0x57')]({'name':_0x3aba26['name'],'resourceId':_0x3aba26['id'],'type':_0x171557['name'],'sectionId':_0x171557['id']},{})['then'](function(){return _0x57e696;});}else{return _0x57e696;}})[_0x15d8('0x4f')](function(_0x195613){logger[_0x15d8('0x20')](_0x15d8('0x5c'),_0x195613);throw _0x195613;});}return _0x57e696;});}})[_0x15d8('0x1a')](respondWithResult(_0x38c209,0xc9))['catch'](handleError(_0x38c209,null));};exports[_0x15d8('0x57')]=function(_0x1ddff3,_0x326631,_0x578d41){var _0x43d0ba;return db[_0x15d8('0x36')][_0x15d8('0x57')](_0x1ddff3['body'],{'raw':!![]})['then'](function(_0x390131){_0x43d0ba=_0x390131;return db[_0x15d8('0x36')]['findAll']({'raw':!![]});})[_0x15d8('0x1a')](function(_0x5a0285){var _0x234015=fs[_0x15d8('0x5d')](path[_0x15d8('0x5e')](config[_0x15d8('0x5f')],_0x15d8('0x60')),'utf8');var _0x3fb966=fs[_0x15d8('0x5d')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0x15d8('0x61'));var _0x5c091f=ejs[_0x15d8('0x62')](_0x234015,{'trunks':_0x5a0285||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x5c091f);if(_0x43d0ba['registry']){var _0xedd96e=ejs[_0x15d8('0x62')](_0x3fb966,{'trunks':_0x5a0285||[]});fs['writeFileSync'](_0x15d8('0x63'),_0xedd96e);}})[_0x15d8('0x1a')](function(){return respondWithRpcPromise(_0x15d8('0x64'),'create',{'module':_0x15d8('0x65')});})[_0x15d8('0x1a')](function(){var _0x319d59=_0x1ddff3[_0x15d8('0x58')][_0x15d8('0x2f')]({'plain':!![]});if(!_0x319d59)throw new Error(_0x15d8('0x59'));if(_0x319d59[_0x15d8('0x5a')]===_0x15d8('0x58')){var _0x54a200=_0x43d0ba['get']({'plain':!![]});return db[_0x15d8('0x66')][_0x15d8('0x52')]({'where':{'name':'Trunks','userProfileId':_0x319d59[_0x15d8('0x5b')]},'raw':!![]})[_0x15d8('0x1a')](function(_0x5effd0){if(_0x5effd0&&_0x5effd0[_0x15d8('0x67')]===0x0){return db[_0x15d8('0x31')][_0x15d8('0x57')]({'name':_0x54a200[_0x15d8('0x32')],'resourceId':_0x54a200['id'],'type':_0x5effd0[_0x15d8('0x32')],'sectionId':_0x5effd0['id']},{})[_0x15d8('0x1a')](function(){return _0x43d0ba;});}else{return _0x43d0ba;}})[_0x15d8('0x4f')](function(_0x38391b){logger[_0x15d8('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38391b);throw _0x38391b;});}return _0x43d0ba;})[_0x15d8('0x1a')](respondWithResult(_0x326631,0xc9))[_0x15d8('0x4f')](handleError(_0x326631,null));};exports[_0x15d8('0x2d')]=function(_0x2cf46a,_0x49008c,_0x52fc69){var _0xfd265c;return db[_0x15d8('0x36')][_0x15d8('0x52')]({'where':{'id':_0x2cf46a[_0x15d8('0x51')]['id']}})['then'](handleEntityNotFound(_0x49008c,null))[_0x15d8('0x1a')](saveUpdates(_0x2cf46a[_0x15d8('0x56')],null))[_0x15d8('0x1a')](function(_0x2f4688){if(_0x2f4688){_0xfd265c=_0x2f4688;return db[_0x15d8('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2434c4){if(_0x2434c4){var _0x38a5b4=fs[_0x15d8('0x5d')](path[_0x15d8('0x5e')](config[_0x15d8('0x5f')],_0x15d8('0x60')),_0x15d8('0x61'));var _0x36c866=fs[_0x15d8('0x5d')](path['join'](config['root'],_0x15d8('0x68')),'utf8');var _0x5d945a=ejs[_0x15d8('0x62')](_0x38a5b4,{'trunks':_0x2434c4||[]});fs[_0x15d8('0x69')](_0x15d8('0x6a'),_0x5d945a);var _0x3257f3=ejs[_0x15d8('0x62')](_0x36c866,{'trunks':_0x2434c4||[]});fs[_0x15d8('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x3257f3);return respondWithRpcPromise(_0x15d8('0x64'),'update',{'module':_0x15d8('0x65')});}return null;})[_0x15d8('0x1a')](function(_0x4e6a5e){if(_0x4e6a5e){return _0xfd265c;}})[_0x15d8('0x1a')](respondWithResult(_0x49008c,null))['catch'](handleError(_0x49008c,null));};exports[_0x15d8('0x2e')]=function(_0x5e3cab,_0xee48d5,_0x3af5df){var _0x15b3a8;return db[_0x15d8('0x36')][_0x15d8('0x52')]({'where':{'id':_0x5e3cab[_0x15d8('0x51')]['id']}})[_0x15d8('0x1a')](handleEntityNotFound(_0xee48d5,null))[_0x15d8('0x1a')](removeEntity(_0xee48d5,null))[_0x15d8('0x1a')](function(){return db['Trunk'][_0x15d8('0x4e')]({'raw':!![]});})[_0x15d8('0x1a')](function(_0x2ff68f){var _0x11aa6a=fs[_0x15d8('0x5d')](path[_0x15d8('0x5e')](config[_0x15d8('0x5f')],_0x15d8('0x60')),_0x15d8('0x61'));var _0x583dd6=fs['readFileSync'](path[_0x15d8('0x5e')](config['root'],_0x15d8('0x68')),'utf8');var _0x3ec6b2=ejs[_0x15d8('0x62')](_0x11aa6a,{'trunks':_0x2ff68f});var _0x572a94=ejs[_0x15d8('0x62')](_0x583dd6,{'trunks':_0x2ff68f});fs[_0x15d8('0x69')](_0x15d8('0x6a'),_0x3ec6b2);fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x572a94);return respondWithRpcPromise('Reload',_0x15d8('0x2e'),{'module':_0x15d8('0x65')});})['catch'](handleError(_0xee48d5,null));}; \ No newline at end of file +var _0xdb28=['moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','offset','limit','Content-Range','apply','reject','save','update','destroy','get','name','send','index','map','Trunk','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','show','params','includeAll','find','clone','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','readFileSync','root','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','user','userProfileId','UserProfileResource','/etc/asterisk/sip_xcally_registers.conf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x28e384,_0x41ccea){var _0x44145e=function(_0x88be4d){while(--_0x88be4d){_0x28e384['push'](_0x28e384['shift']());}};_0x44145e(++_0x41ccea);}(_0xdb28,0xe0));var _0x8db2=function(_0x3314ad,_0x1485f9){_0x3314ad=_0x3314ad-0x0;var _0x148cd4=_0xdb28[_0x3314ad];return _0x148cd4;};'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(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var moment=require(_0x8db2('0x6'));var BPromise=require(_0x8db2('0x7'));var Mustache=require('mustache');var util=require(_0x8db2('0x8'));var path=require(_0x8db2('0x9'));var sox=require(_0x8db2('0xa'));var csv=require(_0x8db2('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8db2('0xc'));var squel=require(_0x8db2('0xd'));var crypto=require(_0x8db2('0xe'));var jsforce=require(_0x8db2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8db2('0x10'));var Redis=require(_0x8db2('0x11'));var authService=require(_0x8db2('0x12'));var qs=require(_0x8db2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8db2('0x14'));var logger=require(_0x8db2('0x15'))(_0x8db2('0x16'));var utils=require(_0x8db2('0x17'));var config=require('../../config/environment');var db=require(_0x8db2('0x18'))['db'];var jayson=require(_0x8db2('0x19'));var client=jayson['client'][_0x8db2('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5ef095,_0x1a771e,_0x265186){if(_0x265186){var _0x25d5da=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25d5da[_0x8db2('0x1b')](_0x1a771e)){return _0x5ef095;}else{throw new db['Sequelize'][(_0x8db2('0x1c'))](_0x8db2('0x1d'));}}else{return _0x5ef095;}}function respondWithRpcPromise(_0x28ac4a,_0x3bc220,_0x5b8fa8,_0x40469c){return new BPromise(function(_0xb425a6,_0x5798bd){var _0x57f765=_0x40469c||client;return _0x57f765[_0x8db2('0x1e')](_0x28ac4a,_0x5b8fa8)[_0x8db2('0x1f')](function(_0x1fc086){logger[_0x8db2('0x20')](_0x8db2('0x21'),_0x3bc220,'request\x20sent');logger['debug'](_0x8db2('0x22'),_0x3bc220,_0x8db2('0x23'),JSON[_0x8db2('0x24')](_0x1fc086));if(_0x1fc086[_0x8db2('0x25')]){if(_0x1fc086[_0x8db2('0x25')]['code']===0x1f4){logger[_0x8db2('0x25')](_0x8db2('0x21'),_0x3bc220,_0x1fc086['error'][_0x8db2('0x26')]);return _0x5798bd(_0x1fc086[_0x8db2('0x25')][_0x8db2('0x26')]);}logger[_0x8db2('0x25')]('Trunk,\x20%s,\x20%s',_0x3bc220,_0x1fc086[_0x8db2('0x25')][_0x8db2('0x26')]);return _0xb425a6(_0x1fc086[_0x8db2('0x25')][_0x8db2('0x26')]);}else{logger[_0x8db2('0x20')](_0x8db2('0x21'),_0x3bc220,_0x8db2('0x23'));_0xb425a6(_0x1fc086[_0x8db2('0x27')]['message']);}})[_0x8db2('0x28')](function(_0x22253e){logger[_0x8db2('0x25')](_0x8db2('0x21'),_0x3bc220,_0x22253e);_0x5798bd(_0x22253e);});});}function respondWithStatusCode(_0x3d234e,_0x5bd07d){_0x5bd07d=_0x5bd07d||0xcc;return function(_0x3729a5){if(_0x3729a5){return _0x3d234e[_0x8db2('0x29')](_0x5bd07d);}return _0x3d234e['status'](_0x5bd07d)[_0x8db2('0x2a')]();};}function respondWithResult(_0x2187f5,_0x4d4505){_0x4d4505=_0x4d4505||0xc8;return function(_0x233123){if(_0x233123){return _0x2187f5[_0x8db2('0x2b')](_0x4d4505)[_0x8db2('0x2c')](_0x233123);}};}function respondWithFilteredResult(_0x38eb40,_0x1d7919){return function(_0x3336b4){if(_0x3336b4){var _0x42aea3=_0x3336b4['count'],_0x31ba4c=_0x1d7919[_0x8db2('0x2d')],_0x54c9ba=_0x1d7919[_0x8db2('0x2d')]+_0x1d7919[_0x8db2('0x2e')],_0x975b3b;if(_0x54c9ba>=_0x42aea3){_0x54c9ba=_0x42aea3;_0x975b3b=0xc8;}else{_0x975b3b=0xce;}_0x38eb40[_0x8db2('0x2b')](_0x975b3b);return _0x38eb40['set'](_0x8db2('0x2f'),_0x31ba4c+'-'+_0x54c9ba+'/'+_0x42aea3)[_0x8db2('0x2c')](_0x3336b4);}return null;};}function patchUpdates(_0x5d9084){return function(_0x172549){try{jsonpatch[_0x8db2('0x30')](_0x172549,_0x5d9084,!![]);}catch(_0x4e7dd0){return BPromise[_0x8db2('0x31')](_0x4e7dd0);}return _0x172549[_0x8db2('0x32')]();};}function saveUpdates(_0x45662c,_0x332b45){return function(_0x5f11e6){if(_0x5f11e6){return _0x5f11e6[_0x8db2('0x33')](_0x45662c)[_0x8db2('0x1f')](function(_0x213da1){return _0x213da1;});}return null;};}function removeEntity(_0x177b84,_0x352d26){return function(_0x53375c){if(_0x53375c){return _0x53375c[_0x8db2('0x34')]()[_0x8db2('0x1f')](function(){var _0x21758f=_0x53375c[_0x8db2('0x35')]({'plain':!![]});var _0x3573c9='Trunks';return db['UserProfileResource']['destroy']({'where':{'type':_0x3573c9,'resourceId':_0x21758f['id']}})[_0x8db2('0x1f')](function(){return _0x53375c;});})[_0x8db2('0x1f')](function(){_0x177b84[_0x8db2('0x2b')](0xcc)[_0x8db2('0x2a')]();});}};}function handleEntityNotFound(_0x3c28de,_0x857e78){return function(_0x416f0e){if(!_0x416f0e){_0x3c28de['sendStatus'](0x194);}return _0x416f0e;};}function handleError(_0x3b2b0b,_0x5b7925){_0x5b7925=_0x5b7925||0x1f4;return function(_0x1fe7cb){logger['error'](_0x1fe7cb['stack']);if(_0x1fe7cb[_0x8db2('0x36')]){delete _0x1fe7cb[_0x8db2('0x36')];}_0x3b2b0b['status'](_0x5b7925)[_0x8db2('0x37')](_0x1fe7cb);};}exports[_0x8db2('0x38')]=function(_0x2ceda6,_0x3992f3){var _0x4544f4={},_0x3a0bd2={},_0x5b1204={'count':0x0,'rows':[]};var _0x5a66a0=_[_0x8db2('0x39')](db[_0x8db2('0x3a')][_0x8db2('0x3b')],function(_0x11b152){return{'name':_0x11b152[_0x8db2('0x3c')],'type':_0x11b152['type'][_0x8db2('0x3d')]};});_0x3a0bd2[_0x8db2('0x3e')]=_[_0x8db2('0x39')](_0x5a66a0,_0x8db2('0x36'));_0x3a0bd2['query']=_[_0x8db2('0x3f')](_0x2ceda6[_0x8db2('0x40')]);_0x3a0bd2[_0x8db2('0x41')]=_[_0x8db2('0x42')](_0x3a0bd2[_0x8db2('0x3e')],_0x3a0bd2[_0x8db2('0x40')]);_0x4544f4['attributes']=_[_0x8db2('0x42')](_0x3a0bd2[_0x8db2('0x3e')],qs[_0x8db2('0x43')](_0x2ceda6[_0x8db2('0x40')]['fields']));_0x4544f4[_0x8db2('0x44')]=_0x4544f4[_0x8db2('0x44')][_0x8db2('0x45')]?_0x4544f4['attributes']:_0x3a0bd2['model'];if(!_0x2ceda6[_0x8db2('0x40')]['hasOwnProperty'](_0x8db2('0x46'))){_0x4544f4[_0x8db2('0x2e')]=qs[_0x8db2('0x2e')](_0x2ceda6[_0x8db2('0x40')][_0x8db2('0x2e')]);_0x4544f4['offset']=qs['offset'](_0x2ceda6[_0x8db2('0x40')][_0x8db2('0x2d')]);}_0x4544f4['order']=qs[_0x8db2('0x47')](_0x2ceda6[_0x8db2('0x40')][_0x8db2('0x47')]);_0x4544f4[_0x8db2('0x48')]=qs[_0x8db2('0x41')](_[_0x8db2('0x49')](_0x2ceda6[_0x8db2('0x40')],_0x3a0bd2[_0x8db2('0x41')]));if(_0x2ceda6[_0x8db2('0x40')][_0x8db2('0x4a')]){_0x4544f4['where']=_[_0x8db2('0x4b')](_0x4544f4['where'],{'$or':_[_0x8db2('0x39')](_0x5a66a0,function(_0x4c9542){if(_0x4c9542[_0x8db2('0x4c')]!==_0x8db2('0x4d')){var _0x40f2ae={};_0x40f2ae[_0x4c9542[_0x8db2('0x36')]]={'$like':'%'+_0x2ceda6[_0x8db2('0x40')][_0x8db2('0x4a')]+'%'};return _0x40f2ae;}})});}_0x4544f4=_[_0x8db2('0x4b')]({},_0x4544f4,_0x2ceda6[_0x8db2('0x4e')]);var _0x1f3327={'where':_0x4544f4[_0x8db2('0x48')]};return db[_0x8db2('0x3a')][_0x8db2('0x4f')](_0x1f3327)['then'](function(_0x39891e){_0x5b1204[_0x8db2('0x4f')]=_0x39891e;if(_0x2ceda6[_0x8db2('0x40')]['includeAll']){_0x4544f4[_0x8db2('0x50')]=[{'all':!![]}];}return db[_0x8db2('0x3a')][_0x8db2('0x51')](_0x4544f4);})['then'](function(_0x5da4de){_0x5b1204[_0x8db2('0x52')]=_0x5da4de;return _0x5b1204;})[_0x8db2('0x1f')](respondWithFilteredResult(_0x3992f3,_0x4544f4))[_0x8db2('0x28')](handleError(_0x3992f3,null));};exports[_0x8db2('0x53')]=function(_0x48ad6d,_0x441358){var _0x1a2b8b={'raw':![],'where':{'id':_0x48ad6d[_0x8db2('0x54')]['id']}},_0xe3ae3b={};_0xe3ae3b[_0x8db2('0x3e')]=_[_0x8db2('0x3f')](db[_0x8db2('0x3a')][_0x8db2('0x3b')]);_0xe3ae3b[_0x8db2('0x40')]=_[_0x8db2('0x3f')](_0x48ad6d[_0x8db2('0x40')]);_0xe3ae3b[_0x8db2('0x41')]=_[_0x8db2('0x42')](_0xe3ae3b['model'],_0xe3ae3b[_0x8db2('0x40')]);_0x1a2b8b['attributes']=_['intersection'](_0xe3ae3b[_0x8db2('0x3e')],qs[_0x8db2('0x43')](_0x48ad6d[_0x8db2('0x40')][_0x8db2('0x43')]));_0x1a2b8b[_0x8db2('0x44')]=_0x1a2b8b[_0x8db2('0x44')][_0x8db2('0x45')]?_0x1a2b8b[_0x8db2('0x44')]:_0xe3ae3b['model'];if(_0x48ad6d[_0x8db2('0x40')][_0x8db2('0x55')]){_0x1a2b8b[_0x8db2('0x50')]=[{'all':!![]}];}_0x1a2b8b=_[_0x8db2('0x4b')]({},_0x1a2b8b,_0x48ad6d[_0x8db2('0x4e')]);return db['Trunk'][_0x8db2('0x56')](_0x1a2b8b)[_0x8db2('0x1f')](handleEntityNotFound(_0x441358,null))[_0x8db2('0x1f')](respondWithResult(_0x441358,null))[_0x8db2('0x28')](handleError(_0x441358,null));};exports[_0x8db2('0x57')]=function(_0xd4e04,_0x40f57e){var _0x32bb2b={'where':{'id':_0xd4e04['params']['id']}},_0x5dbe27={};_0x5dbe27[_0x8db2('0x3e')]=_[_0x8db2('0x3f')](db[_0x8db2('0x3a')][_0x8db2('0x3b')]);_0x32bb2b[_0x8db2('0x44')]=_[_0x8db2('0x42')](_0x5dbe27[_0x8db2('0x3e')],qs[_0x8db2('0x43')](_0xd4e04[_0x8db2('0x40')][_0x8db2('0x43')]));_0x32bb2b[_0x8db2('0x44')]=_0x32bb2b[_0x8db2('0x44')][_0x8db2('0x45')]?_0x32bb2b[_0x8db2('0x44')]:_0x5dbe27['model'];if(_0xd4e04[_0x8db2('0x40')]['includeAll']){_0x32bb2b[_0x8db2('0x50')]=[{'all':!![]}];}_0x32bb2b=_['merge']({},_0x32bb2b,_0xd4e04[_0x8db2('0x4e')]);return db[_0x8db2('0x3a')][_0x8db2('0x56')](_0x32bb2b)[_0x8db2('0x1f')](handleEntityNotFound(_0x40f57e,null))[_0x8db2('0x1f')](function(_0x5b657f){if(_0x5b657f){var _0x545d4b=_0x5b657f['get']({'plain':!![]});_0x545d4b=qs[_0x8db2('0x58')](_0x545d4b,['id',_0x8db2('0x59'),_0x8db2('0x5a')]);_0xd4e04[_0x8db2('0x5b')]=_['omit'](_0xd4e04[_0x8db2('0x5b')],['id','createdAt',_0x8db2('0x5a')]);return db[_0x8db2('0x3a')][_0x8db2('0x5c')](_['merge'](_0x545d4b,_0xd4e04[_0x8db2('0x5b')]),{'include':_0xd4e04[_0x8db2('0x40')][_0x8db2('0x55')]?[{'all':!![]}]:undefined})['then'](function(_0x4cc818){var _0x14a866=_0xd4e04['user']['get']({'plain':!![]});if(!_0x14a866)throw new Error(_0x8db2('0x5d'));if(_0x14a866[_0x8db2('0x5e')]==='user'){var _0xccc123=_0x4cc818[_0x8db2('0x35')]({'plain':!![]});var _0x425e80=_0x8db2('0x5f');return db[_0x8db2('0x60')][_0x8db2('0x56')]({'where':{'name':_0x425e80,'userProfileId':_0x14a866['userProfileId']},'raw':!![]})['then'](function(_0x4cd796){if(_0x4cd796&&_0x4cd796[_0x8db2('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0xccc123[_0x8db2('0x36')],'resourceId':_0xccc123['id'],'type':_0x4cd796['name'],'sectionId':_0x4cd796['id']},{})[_0x8db2('0x1f')](function(){return _0x4cc818;});}else{return _0x4cc818;}})[_0x8db2('0x28')](function(_0x1512b1){logger['error'](_0x8db2('0x62'),_0x1512b1);throw _0x1512b1;});}return _0x4cc818;});}})[_0x8db2('0x1f')](respondWithResult(_0x40f57e,0xc9))[_0x8db2('0x28')](handleError(_0x40f57e,null));};exports[_0x8db2('0x5c')]=function(_0x482952,_0x1a351b,_0xd2a895){var _0x31506c;return db[_0x8db2('0x3a')][_0x8db2('0x5c')](_0x482952[_0x8db2('0x5b')],{'raw':!![]})[_0x8db2('0x1f')](function(_0x546c35){_0x31506c=_0x546c35;return db['Trunk'][_0x8db2('0x51')]({'raw':!![]});})[_0x8db2('0x1f')](function(_0x4ccb79){var _0x5ae18b=fs['readFileSync'](path[_0x8db2('0x63')](config['root'],_0x8db2('0x64')),'utf8');var _0x53fd9d=fs[_0x8db2('0x65')](path[_0x8db2('0x63')](config[_0x8db2('0x66')],_0x8db2('0x67')),_0x8db2('0x68'));var _0x4cfeb3=ejs[_0x8db2('0x69')](_0x5ae18b,{'trunks':_0x4ccb79||[]});fs[_0x8db2('0x6a')](_0x8db2('0x6b'),_0x4cfeb3);if(_0x31506c[_0x8db2('0x6c')]){var _0x47f13a=ejs[_0x8db2('0x69')](_0x53fd9d,{'trunks':_0x4ccb79||[]});fs[_0x8db2('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x47f13a);}})[_0x8db2('0x1f')](function(){return respondWithRpcPromise(_0x8db2('0x6d'),_0x8db2('0x5c'),{'module':_0x8db2('0x6e')});})[_0x8db2('0x1f')](function(){var _0x2f3eaf=_0x482952[_0x8db2('0x6f')][_0x8db2('0x35')]({'plain':!![]});if(!_0x2f3eaf)throw new Error(_0x8db2('0x5d'));if(_0x2f3eaf[_0x8db2('0x5e')]===_0x8db2('0x6f')){var _0x2ac773=_0x31506c['get']({'plain':!![]});return db['UserProfileSection'][_0x8db2('0x56')]({'where':{'name':_0x8db2('0x5f'),'userProfileId':_0x2f3eaf[_0x8db2('0x70')]},'raw':!![]})[_0x8db2('0x1f')](function(_0x16e45a){if(_0x16e45a&&_0x16e45a[_0x8db2('0x61')]===0x0){return db[_0x8db2('0x71')][_0x8db2('0x5c')]({'name':_0x2ac773[_0x8db2('0x36')],'resourceId':_0x2ac773['id'],'type':_0x16e45a[_0x8db2('0x36')],'sectionId':_0x16e45a['id']},{})[_0x8db2('0x1f')](function(){return _0x31506c;});}else{return _0x31506c;}})['catch'](function(_0x5e3ef5){logger[_0x8db2('0x25')](_0x8db2('0x62'),_0x5e3ef5);throw _0x5e3ef5;});}return _0x31506c;})[_0x8db2('0x1f')](respondWithResult(_0x1a351b,0xc9))[_0x8db2('0x28')](handleError(_0x1a351b,null));};exports[_0x8db2('0x33')]=function(_0x4355db,_0x53fae6,_0x39663f){var _0x1f6f1d;return db[_0x8db2('0x3a')][_0x8db2('0x56')]({'where':{'id':_0x4355db[_0x8db2('0x54')]['id']}})[_0x8db2('0x1f')](handleEntityNotFound(_0x53fae6,null))[_0x8db2('0x1f')](saveUpdates(_0x4355db[_0x8db2('0x5b')],null))[_0x8db2('0x1f')](function(_0x2dbf23){if(_0x2dbf23){_0x1f6f1d=_0x2dbf23;return db['Trunk']['findAll']({'raw':!![]});}})[_0x8db2('0x1f')](function(_0x1dc3c3){if(_0x1dc3c3){var _0x15ef4a=fs['readFileSync'](path[_0x8db2('0x63')](config[_0x8db2('0x66')],_0x8db2('0x64')),_0x8db2('0x68'));var _0x2a586a=fs[_0x8db2('0x65')](path[_0x8db2('0x63')](config['root'],_0x8db2('0x67')),'utf8');var _0x5e3fb6=ejs[_0x8db2('0x69')](_0x15ef4a,{'trunks':_0x1dc3c3||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x5e3fb6);var _0x149eee=ejs['render'](_0x2a586a,{'trunks':_0x1dc3c3||[]});fs['writeFileSync'](_0x8db2('0x72'),_0x149eee);return respondWithRpcPromise('Reload',_0x8db2('0x33'),{'module':_0x8db2('0x6e')});}return null;})[_0x8db2('0x1f')](function(_0x3834df){if(_0x3834df){return _0x1f6f1d;}})[_0x8db2('0x1f')](respondWithResult(_0x53fae6,null))[_0x8db2('0x28')](handleError(_0x53fae6,null));};exports[_0x8db2('0x34')]=function(_0x4ad8c1,_0x4460de,_0x26b56d){var _0x4e9ec1;return db['Trunk'][_0x8db2('0x56')]({'where':{'id':_0x4ad8c1[_0x8db2('0x54')]['id']}})[_0x8db2('0x1f')](handleEntityNotFound(_0x4460de,null))[_0x8db2('0x1f')](removeEntity(_0x4460de,null))[_0x8db2('0x1f')](function(){return db[_0x8db2('0x3a')][_0x8db2('0x51')]({'raw':!![]});})[_0x8db2('0x1f')](function(_0x32efa2){var _0x13237d=fs['readFileSync'](path[_0x8db2('0x63')](config[_0x8db2('0x66')],_0x8db2('0x64')),_0x8db2('0x68'));var _0x5baefe=fs[_0x8db2('0x65')](path[_0x8db2('0x63')](config[_0x8db2('0x66')],'server/files/templates/registry.ejs'),_0x8db2('0x68'));var _0x503a53=ejs[_0x8db2('0x69')](_0x13237d,{'trunks':_0x32efa2});var _0x1ac4ac=ejs[_0x8db2('0x69')](_0x5baefe,{'trunks':_0x32efa2});fs[_0x8db2('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x503a53);fs[_0x8db2('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x1ac4ac);return respondWithRpcPromise(_0x8db2('0x6d'),_0x8db2('0x34'),{'module':'chan_sip.so'});})['catch'](handleError(_0x4460de,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index daf2207..fae7f47 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 _0x7d0f=['Trunk','tools_trunks','lodash','util','../../config/logger','api','request-promise','path','exports'];(function(_0xc2c353,_0x41a5a3){var _0x806605=function(_0x439e06){while(--_0x439e06){_0xc2c353['push'](_0xc2c353['shift']());}};_0x806605(++_0x41a5a3);}(_0x7d0f,0xec));var _0xf7d0=function(_0x56fcb5,_0xe4858f){_0x56fcb5=_0x56fcb5-0x0;var _0x971ab=_0x7d0f[_0x56fcb5];return _0x971ab;};'use strict';var _=require(_0xf7d0('0x0'));var util=require(_0xf7d0('0x1'));var logger=require(_0xf7d0('0x2'))(_0xf7d0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf7d0('0x4'));var fs=require('fs');var path=require(_0xf7d0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0xf7d0('0x6')]=function(_0xb9cd2e,_0x19651a){return _0xb9cd2e['define'](_0xf7d0('0x7'),attributes,{'tableName':_0xf7d0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f64=['exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','request-promise','path','./trunk.attributes'];(function(_0x1fa21d,_0x39dcb6){var _0x3f40d2=function(_0xf2345d){while(--_0xf2345d){_0x1fa21d['push'](_0x1fa21d['shift']());}};_0x3f40d2(++_0x39dcb6);}(_0x4f64,0x70));var _0x44f6=function(_0x1f465f,_0x2427de){_0x1f465f=_0x1f465f-0x0;var _0x374185=_0x4f64[_0x1f465f];return _0x374185;};'use strict';var _=require(_0x44f6('0x0'));var util=require(_0x44f6('0x1'));var logger=require(_0x44f6('0x2'))(_0x44f6('0x3'));var moment=require(_0x44f6('0x4'));var BPromise=require('bluebird');var rp=require(_0x44f6('0x5'));var fs=require('fs');var path=require(_0x44f6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x44f6('0x7'));module[_0x44f6('0x8')]=function(_0x365b3b,_0x558897){return _0x365b3b[_0x44f6('0x9')](_0x44f6('0xa'),attributes,{'tableName':_0x44f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 072f69e..041ed97 100644 --- a/server/api/trunk/trunk.rpc.js +++ b/server/api/trunk/trunk.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['../../config/environment','jayson/promise','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetTrunk','Trunk','findAll','options','raw','attributes','include','map','model','catch','find','where','ShowTrunk','util','moment','bluebird','randomstring','ioredis','rpc'];(function(_0x469b7d,_0x4760f8){var _0xc78a4b=function(_0xd48e6c){while(--_0xd48e6c){_0x469b7d['push'](_0x469b7d['shift']());}};_0xc78a4b(++_0x4760f8);}(_0xda2d,0x102));var _0xdda2=function(_0x4d8217,_0x43f574){_0x4d8217=_0x4d8217-0x0;var _0x129569=_0xda2d[_0x4d8217];return _0x129569;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Trunk,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}exports[_0xdda2('0x14')]=function(_0x1a3b35){var _0x335fb5=this;return new Promise(function(_0x2b6ee8,_0x8d44b7){return db[_0xdda2('0x15')][_0xdda2('0x16')]({'raw':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')][_0xdda2('0x18')]===undefined?!![]:![]:!![],'where':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')]['where']||null:null,'attributes':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35['options'][_0xdda2('0x19')]||null:null,'limit':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')]['limit']||null:null,'include':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35['options'][_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x1a3b35['options'][_0xdda2('0x1a')],function(_0xfda248){return{'model':db[_0xfda248[_0xdda2('0x1c')]],'as':_0xfda248['as'],'attributes':_0xfda248[_0xdda2('0x19')],'include':_0xfda248[_0xdda2('0x1a')]?_['map'](_0xfda248[_0xdda2('0x1a')],function(_0x4be5ea){return{'model':db[_0x4be5ea[_0xdda2('0x1c')]],'as':_0x4be5ea['as'],'attributes':_0x4be5ea[_0xdda2('0x19')],'include':_0x4be5ea['include']?_['map'](_0x4be5ea[_0xdda2('0x1a')],function(_0x4567e7){return{'model':db[_0x4567e7[_0xdda2('0x1c')]],'as':_0x4567e7['as'],'attributes':_0x4567e7['attributes']};}):[]};}):[]};}):[]:[]})[_0xdda2('0xa')](function(_0x5d26ae){logger[_0xdda2('0x12')](_0xdda2('0x14'),_0x1a3b35);logger[_0xdda2('0xd')](_0xdda2('0x14'),_0x1a3b35,JSON['stringify'](_0x5d26ae));_0x2b6ee8(_0x5d26ae);})[_0xdda2('0x1d')](function(_0x255bbc){logger['error'](_0xdda2('0x14'),_0x255bbc[_0xdda2('0x11')],_0x1a3b35);_0x8d44b7(_0x335fb5[_0xdda2('0x10')](0x1f4,_0x255bbc[_0xdda2('0x11')]));});});};exports['ShowTrunk']=function(_0x129eba){var _0x5e107f=this;return new Promise(function(_0x4b19b7,_0x1ca9f3){return db['Trunk'][_0xdda2('0x1e')]({'raw':_0x129eba['options']?_0x129eba['options']['raw']===undefined?!![]:![]:!![],'where':_0x129eba[_0xdda2('0x17')]?_0x129eba['options'][_0xdda2('0x1f')]||null:null,'attributes':_0x129eba['options']?_0x129eba['options']['attributes']||null:null,'include':_0x129eba[_0xdda2('0x17')]?_0x129eba[_0xdda2('0x17')][_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x129eba[_0xdda2('0x17')][_0xdda2('0x1a')],function(_0x2bcfba){return{'model':db[_0x2bcfba[_0xdda2('0x1c')]],'as':_0x2bcfba['as'],'attributes':_0x2bcfba[_0xdda2('0x19')],'include':_0x2bcfba[_0xdda2('0x1a')]?_['map'](_0x2bcfba[_0xdda2('0x1a')],function(_0x4212da){return{'model':db[_0x4212da[_0xdda2('0x1c')]],'as':_0x4212da['as'],'attributes':_0x4212da[_0xdda2('0x19')],'include':_0x4212da[_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x4212da[_0xdda2('0x1a')],function(_0x5835cd){return{'model':db[_0x5835cd['model']],'as':_0x5835cd['as'],'attributes':_0x5835cd[_0xdda2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdda2('0xa')](function(_0x40eb19){logger['info']('ShowTrunk',_0x129eba);logger[_0xdda2('0xd')](_0xdda2('0x20'),_0x129eba,JSON[_0xdda2('0xf')](_0x40eb19));_0x4b19b7(_0x40eb19);})[_0xdda2('0x1d')](function(_0x246001){logger['error'](_0xdda2('0x20'),_0x246001[_0xdda2('0x11')],_0x129eba);_0x1ca9f3(_0x5e107f['error'](0x1f4,_0x246001['message']));});});}; \ No newline at end of file +var _0x5f2f=['map','include','model','attributes','then','ShowTrunk','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetTrunk','Trunk','findAll','options','raw','limit'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x5f2f,0x73));var _0xf5f2=function(_0x6a8a68,_0x398fa5){_0x6a8a68=_0x6a8a68-0x0;var _0xcafce9=_0x5f2f[_0x6a8a68];return _0xcafce9;};'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')]('Trunk,\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')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetTrunk',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetTrunk',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowTrunk',_0x153924);logger[_0xf5f2('0xf')]('ShowTrunk',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowTrunk',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 0950145..dd0ef6f 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 _0x7a54=['getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','/create_many','post','addContacts','create','addQueues','join','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','addAvatar','login','logout','/:id/pause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','describe','/whoami','/:id','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings'];(function(_0x574116,_0x2cccb3){var _0x400429=function(_0x5579d9){while(--_0x5579d9){_0x574116['push'](_0x574116['shift']());}};_0x400429(++_0x2cccb3);}(_0x7a54,0x106));var _0x47a5=function(_0x11e464,_0x2407a1){_0x11e464=_0x11e464-0x0;var _0x29d161=_0x7a54[_0x11e464];return _0x29d161;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['whoami']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x47a5('0x8')](_0x47a5('0xd'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);router[_0x47a5('0x8')](_0x47a5('0xf'),auth[_0x47a5('0x9')](),controller['getQueues']);router[_0x47a5('0x8')](_0x47a5('0x10'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x8')](_0x47a5('0x12'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x13')]);router['get'](_0x47a5('0x14'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x15')]);router[_0x47a5('0x8')](_0x47a5('0x16'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0x47a5('0x8')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x47a5('0x17')]);router[_0x47a5('0x8')](_0x47a5('0x18'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x19')]);router[_0x47a5('0x8')](_0x47a5('0x1a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x1b')]);router['get'](_0x47a5('0x1c'),auth[_0x47a5('0x9')](),controller['getSmsInteractions']);router[_0x47a5('0x8')](_0x47a5('0x1d'),auth[_0x47a5('0x9')](),controller['getFaxInteractions']);router[_0x47a5('0x8')](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x1f')]);router['get'](_0x47a5('0x20'),auth[_0x47a5('0x9')](),controller['getLists']);router[_0x47a5('0x8')](_0x47a5('0x21'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x22')]);router[_0x47a5('0x8')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x47a5('0x23')]);router['get'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router[_0x47a5('0x8')](_0x47a5('0x26'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x27')]);router[_0x47a5('0x8')](_0x47a5('0x28'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x29')]);router[_0x47a5('0x8')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x2b')]);router['get'](_0x47a5('0x2c'),auth['isAuthenticated'](),controller[_0x47a5('0x2d')]);router[_0x47a5('0x8')](_0x47a5('0x2e'),auth['isAuthenticated'](),controller[_0x47a5('0x2f')]);router[_0x47a5('0x8')](_0x47a5('0x30'),auth[_0x47a5('0x9')](),controller['getScheduledCalls']);router['get'](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller['getApiKey']);router['post'](_0x47a5('0x32'),auth[_0x47a5('0x9')](),controller['bulkCreate']);router[_0x47a5('0x33')]('/:id/contacts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x34')]);router['post']('/',auth['isAuthenticated'](),controller[_0x47a5('0x35')]);router['post'](_0x47a5('0xf'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x18f7e9,_0x50c086,_0x53c754){_0x53c754(null,path[_0x47a5('0x37')](config['root'],_0x47a5('0x38')));},'filename':function(_0x5ef577,_0x21ad34,_0x3534cb){_0x3534cb(null,util[_0x47a5('0x39')](_0x47a5('0x3a'),Date[_0x47a5('0x3b')](),_0x21ad34[_0x47a5('0x3c')]));}})});router[_0x47a5('0x33')](_0x47a5('0x3d'),upload[_0x47a5('0x3e')]('file'),controller[_0x47a5('0x3f')]);router[_0x47a5('0x33')]('/:id/login',auth[_0x47a5('0x9')](),controller[_0x47a5('0x40')]);router[_0x47a5('0x33')]('/:id/logout',auth[_0x47a5('0x9')](),controller[_0x47a5('0x41')]);router['post'](_0x47a5('0x42'),auth[_0x47a5('0x9')](),controller['pause']);router['post']('/:id/unpause',auth[_0x47a5('0x9')](),controller['unpause']);router[_0x47a5('0x33')](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x43')]);router[_0x47a5('0x33')](_0x47a5('0x44'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x45')]);router[_0x47a5('0x33')](_0x47a5('0x46'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x47')]);router[_0x47a5('0x33')]('/:id/fax_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x48')]);router[_0x47a5('0x33')](_0x47a5('0x49'),auth['isAuthenticated'](),controller[_0x47a5('0x4a')]);router['post']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x47a5('0x33')]('/:id/fax_accounts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x4b')]);router[_0x47a5('0x33')]('/:id/mail_accounts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x4c')]);router['post']('/:id/openchannel_accounts',auth[_0x47a5('0x9')](),controller['addOpenchannelAccounts']);router[_0x47a5('0x33')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4d')]);router[_0x47a5('0x33')](_0x47a5('0x2c'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4e')]);router[_0x47a5('0x33')](_0x47a5('0x2e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4f')]);router[_0x47a5('0x33')](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x50')]);router['put'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router['put'](_0x47a5('0x51'),auth['isAuthenticated'](),controller[_0x47a5('0x52')]);router[_0x47a5('0x53')]('/:id/queues',auth['isAuthenticated'](),controller[_0x47a5('0x54')]);router['delete'](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x55')]);router[_0x47a5('0x53')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x56')]);router['delete']('/:id/chat_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x57')]);router[_0x47a5('0x53')](_0x47a5('0x46'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x58')]);router[_0x47a5('0x53')]('/:id/fax_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x59')]);router[_0x47a5('0x53')]('/:id/sms_interactions',auth[_0x47a5('0x9')](),controller['removeSmsInteractions']);router[_0x47a5('0x53')](_0x47a5('0x5a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5b')]);router['delete'](_0x47a5('0x24'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5c')]);router[_0x47a5('0x53')](_0x47a5('0x26'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5d')]);router['delete'](_0x47a5('0x28'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5e')]);router[_0x47a5('0x53')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller['removeSmsAccounts']);router[_0x47a5('0x53')](_0x47a5('0x2c'),auth[_0x47a5('0x9')](),controller['removeChatWebsites']);router[_0x47a5('0x53')](_0x47a5('0x2e'),auth[_0x47a5('0x9')](),controller['removeSquareProjects']);router['delete'](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller['removeApiKey']);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(_0x1a9e78,_0x180720){var _0x113e06=function(_0x229c64){while(--_0x229c64){_0x1a9e78['push'](_0x1a9e78['shift']());}};_0x113e06(++_0x180720);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56b913,_0x3ddf4e){_0x56b913=_0x56b913-0x0;var _0x4d2bcf=_0x5f2f[_0x56b913];return _0x4d2bcf;};'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 9ff38f1..e312c33 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(_0x499b83,_0xde81d0){var _0x15d62a=function(_0x3500b5){while(--_0x3500b5){_0x499b83['push'](_0x499b83['shift']());}};_0x15d62a(++_0xde81d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x3cdf50,_0x3e8eb2){var _0x22d47a=function(_0xdc5336){while(--_0xdc5336){_0x3cdf50['push'](_0x3cdf50['shift']());}};_0x22d47a(++_0x3e8eb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 c26e3cc..64ba2bc 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 _0x38b2=['show','params','differenceBy','password','includeAll','bulkCreate','body','describe','addContacts','ids','omit','agent\x20role','admin','../../config/license/util','getLicense','users','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','Setting','securePassword','min_internal','max','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)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','email','permissions','102','103','110','104','107','111','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','channel','loginInPause','voicePause','isValidChannel','Unknown\x20channel','capitalize','Queues','penalty','spread','toLowerCase','voice','online','push','interface','each','UserVoiceQueueRt','upsert','removeQueues','remove','emit','Queue:remove','userpic','root','server/files/images/logos/default_profile.png','download','existsSync','join','getContacts','CmContact','hasOwnProperty','CmList','List','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','intrf','SIP/%s','user:%s','headers','x-forwarded-for','remoteAddress','socket','connection','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','concat','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','smsPause','pauseType','lastPauseAt','manual','mail','fax','sms','set','%s%s','Pause','getTeams','Team','addTeams','getChatQueues','setDataValue','getMailQueues','getSmsQueues','Sms','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','Voice','QueueId','Queue:save','removeTeams','Chat','Mail','removeAgent','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','removeSmsAccounts','getChatWebsites','removeChatWebsites','getSquareProjects','addSquareProjects','removeSquareProjects','CmHopper','$or','$gt','$gte','$lt','$ne','$between','$notBetween','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','phone','Contact','VoiceQueue','getApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','html-pdf','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','register','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','offset','limit','apply','reject','save','update','destroy','get','Users','user','Agents','agent','Telephones','telephone','filter','ignore','value','includes','role','find','name','UserProfileResource','sendStatus','stack','send','index','User','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','sequelize','lower','col','options','count','include','findAll','rows','catch'];(function(_0x9dba38,_0x3ed363){var _0x1b1dca=function(_0x30b990){while(--_0x30b990){_0x9dba38['push'](_0x9dba38['shift']());}};_0x1b1dca(++_0x3ed363);}(_0x38b2,0xf6));var _0x238b=function(_0x3e660e,_0x4a097e){_0x3e660e=_0x3e660e-0x0;var _0x288bc8=_0x38b2[_0x3e660e];return _0x288bc8;};'use strict';var pdf=require(_0x238b('0x0'));var emlformat=require(_0x238b('0x1'));var rimraf=require(_0x238b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x238b('0x3'));var moment=require(_0x238b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x238b('0x5'));var util=require('util');var path=require(_0x238b('0x6'));var sox=require(_0x238b('0x7'));var csv=require(_0x238b('0x8'));var ejs=require(_0x238b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x238b('0xa'));var crypto=require(_0x238b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x238b('0xc'));var toCsv=require(_0x238b('0x8'));var querystring=require(_0x238b('0xd'));var Papa=require(_0x238b('0xe'));var Redis=require(_0x238b('0xf'));var authService=require(_0x238b('0x10'));var qs=require(_0x238b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x238b('0x12'));var logger=require(_0x238b('0x13'))(_0x238b('0x14'));var utils=require(_0x238b('0x15'));var config=require(_0x238b('0x16'));var db=require('../../mysqldb')['db'];config[_0x238b('0x17')]=_[_0x238b('0x18')](config[_0x238b('0x17')],{'host':_0x238b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./user.socket')[_0x238b('0x1a')](socket);var jayson=require(_0x238b('0x1b'));var client=jayson[_0x238b('0x1c')][_0x238b('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x1c387a,_0x68824,_0x406840){if(_0x406840){var _0x24d857=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24d857['test'](_0x68824)){return _0x1c387a;}else{throw new db[(_0x238b('0x1e'))]['ValidationError'](_0x238b('0x1f'));}}else{return _0x1c387a;}}function respondWithRpcPromise(_0x53f48c,_0x2ada3b,_0x598719,_0x92d5b4){return new BPromise(function(_0x222d24,_0x37bfd8){var _0x4a70e3=_0x92d5b4||client;return _0x4a70e3[_0x238b('0x20')](_0x53f48c,_0x598719)[_0x238b('0x21')](function(_0x576fae){logger[_0x238b('0x22')](_0x238b('0x23'),_0x2ada3b,'request\x20sent');logger['debug'](_0x238b('0x24'),_0x2ada3b,_0x238b('0x25'),JSON[_0x238b('0x26')](_0x576fae));if(_0x576fae[_0x238b('0x27')]){if(_0x576fae[_0x238b('0x27')][_0x238b('0x28')]===0x1f4){logger[_0x238b('0x27')](_0x238b('0x23'),_0x2ada3b,_0x576fae[_0x238b('0x27')][_0x238b('0x29')]);return _0x37bfd8(_0x576fae['error']['message']);}logger[_0x238b('0x27')](_0x238b('0x23'),_0x2ada3b,_0x576fae['error']['message']);return _0x222d24(_0x576fae['error'][_0x238b('0x29')]);}else{logger[_0x238b('0x22')](_0x238b('0x23'),_0x2ada3b,_0x238b('0x25'));_0x222d24(_0x576fae[_0x238b('0x2a')]['message']);}})['catch'](function(_0x436303){logger[_0x238b('0x27')](_0x238b('0x23'),_0x2ada3b,_0x436303);_0x37bfd8(_0x436303);});});}function respondWithStatusCode(_0x1f63ad,_0x2d3c68){_0x2d3c68=_0x2d3c68||0xcc;return function(_0xe8dea4){if(_0xe8dea4){return _0x1f63ad['sendStatus'](_0x2d3c68);}return _0x1f63ad[_0x238b('0x2b')](_0x2d3c68)[_0x238b('0x2c')]();};}function respondWithResult(_0x1c7a56,_0x43b85f){_0x43b85f=_0x43b85f||0xc8;return function(_0x103ca8){if(_0x103ca8){return _0x1c7a56[_0x238b('0x2b')](_0x43b85f)[_0x238b('0x2d')](_0x103ca8);}};}function respondWithFilteredResult(_0xf277bd,_0x33788d){return function(_0x170c52){if(_0x170c52){var _0x6ea494=_0x170c52['count'],_0xf0d1bb=_0x33788d[_0x238b('0x2e')],_0x4af577=_0x33788d[_0x238b('0x2e')]+_0x33788d[_0x238b('0x2f')],_0x19fcf9;if(_0x4af577>=_0x6ea494){_0x4af577=_0x6ea494;_0x19fcf9=0xc8;}else{_0x19fcf9=0xce;}_0xf277bd['status'](_0x19fcf9);return _0xf277bd['set']('Content-Range',_0xf0d1bb+'-'+_0x4af577+'/'+_0x6ea494)['json'](_0x170c52);}return null;};}function patchUpdates(_0x3b3eed){return function(_0x4bd691){try{jsonpatch[_0x238b('0x30')](_0x4bd691,_0x3b3eed,!![]);}catch(_0x22585c){return BPromise[_0x238b('0x31')](_0x22585c);}return _0x4bd691[_0x238b('0x32')]();};}function saveUpdates(_0x24b659,_0x5381b3){return function(_0x5d3ca7){if(_0x5d3ca7){return _0x5d3ca7[_0x238b('0x33')](_0x24b659)[_0x238b('0x21')](function(_0x38aecc){return _0x38aecc;});}return null;};}function removeEntity(_0x4ee736,_0x13fb54){return function(_0x444c7b){if(_0x444c7b){return _0x444c7b[_0x238b('0x34')]()[_0x238b('0x21')](function(){var _0x5c2e84=_0x444c7b[_0x238b('0x35')]({'plain':!![]});var _0x5c2b39=[{'name':_0x238b('0x36'),'value':_0x238b('0x37'),'ignore':!![]},{'name':_0x238b('0x38'),'value':_0x238b('0x39'),'ignore':![]},{'name':_0x238b('0x3a'),'value':_0x238b('0x3b'),'ignore':![]}];var _0x11d428=_(_0x5c2b39)[_0x238b('0x3c')](_0x238b('0x3d'))['map'](_0x238b('0x3e'))[_0x238b('0x3e')]();if(_[_0x238b('0x3f')](_0x11d428,_0x5c2e84[_0x238b('0x40')])){return;}var _0xa05ef4=_[_0x238b('0x41')](_0x5c2b39,[_0x238b('0x3e'),_0x5c2e84['role']])[_0x238b('0x42')];return db[_0x238b('0x43')][_0x238b('0x34')]({'where':{'type':_0xa05ef4,'resourceId':_0x5c2e84['id']}})[_0x238b('0x21')](function(){return _0x444c7b;});})['then'](function(){_0x4ee736[_0x238b('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x252d22,_0x5bd65c){return function(_0x104ff6){if(!_0x104ff6){_0x252d22[_0x238b('0x44')](0x194);}return _0x104ff6;};}function handleError(_0xcec411,_0x1f4152){_0x1f4152=_0x1f4152||0x1f4;return function(_0x4b1862){logger['error'](_0x4b1862[_0x238b('0x45')]);if(_0x4b1862['name']){delete _0x4b1862[_0x238b('0x42')];}_0xcec411['status'](_0x1f4152)[_0x238b('0x46')](_0x4b1862);};}exports[_0x238b('0x47')]=function(_0x57aad6,_0xe946dd){var _0x23bd35={},_0x1fbff5={},_0xa43856={'count':0x0,'rows':[]};var _0xe4a041=_['map'](db[_0x238b('0x48')][_0x238b('0x49')],function(_0x299585){return{'name':_0x299585['fieldName'],'type':_0x299585[_0x238b('0x4a')]['key']};});_0x1fbff5[_0x238b('0x4b')]=_['differenceBy'](_[_0x238b('0x4c')](_0xe4a041,_0x238b('0x42')),['password','salt']);_0x1fbff5[_0x238b('0x4d')]=_[_0x238b('0x4e')](_0x57aad6['query']);_0x1fbff5[_0x238b('0x4f')]=_[_0x238b('0x50')](_0x1fbff5['model'],_0x1fbff5['query']);_0x23bd35[_0x238b('0x51')]=_['intersection'](_0x1fbff5[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x57aad6[_0x238b('0x4d')][_0x238b('0x52')]));_0x23bd35[_0x238b('0x51')]=_0x23bd35[_0x238b('0x51')][_0x238b('0x53')]?_0x23bd35[_0x238b('0x51')]:_0x1fbff5[_0x238b('0x4b')];if(!_0x57aad6['query']['hasOwnProperty']('nolimit')){_0x23bd35[_0x238b('0x2f')]=qs['limit'](_0x57aad6['query'][_0x238b('0x2f')]);_0x23bd35['offset']=qs[_0x238b('0x2e')](_0x57aad6['query'][_0x238b('0x2e')]);}_0x23bd35[_0x238b('0x54')]=qs[_0x238b('0x55')](_0x57aad6[_0x238b('0x4d')][_0x238b('0x55')]);_0x23bd35[_0x238b('0x56')]=qs[_0x238b('0x4f')](_[_0x238b('0x57')](_0x57aad6[_0x238b('0x4d')],_0x1fbff5[_0x238b('0x4f')]));if(_0x57aad6[_0x238b('0x4d')][_0x238b('0x3c')]){_0x23bd35[_0x238b('0x56')]=_[_0x238b('0x58')](_0x23bd35[_0x238b('0x56')],{'$or':_[_0x238b('0x4c')](_0xe4a041,function(_0x1af9be){if(_0x1af9be[_0x238b('0x4a')]!==_0x238b('0x59')){return db[_0x238b('0x5a')]['where'](db['sequelize']['fn'](_0x238b('0x5b'),db[_0x238b('0x5a')][_0x238b('0x5c')](_0x1af9be['name'])),{'$like':db[_0x238b('0x5a')]['fn'](_0x238b('0x5b'),'%'+_0x57aad6['query'][_0x238b('0x3c')]+'%')});}})});}_0x23bd35=_[_0x238b('0x58')]({},_0x23bd35,_0x57aad6[_0x238b('0x5d')]);var _0x30fb4e={'where':_0x23bd35[_0x238b('0x56')]};return db['User']['count'](_0x30fb4e)['then'](function(_0x7ae3c4){_0xa43856[_0x238b('0x5e')]=_0x7ae3c4;if(_0x57aad6[_0x238b('0x4d')]['includeAll']){_0x23bd35[_0x238b('0x5f')]=[{'all':!![]}];}return db[_0x238b('0x48')][_0x238b('0x60')](_0x23bd35);})[_0x238b('0x21')](function(_0x1a3094){_0xa43856[_0x238b('0x61')]=_0x1a3094;return _0xa43856;})['then'](respondWithFilteredResult(_0xe946dd,_0x23bd35))[_0x238b('0x62')](handleError(_0xe946dd,null));};exports[_0x238b('0x63')]=function(_0x77f820,_0x2ba862){var _0x24304b={'raw':![],'where':{'id':_0x77f820[_0x238b('0x64')]['id']}},_0x5b16f5={};_0x5b16f5['model']=_[_0x238b('0x65')](_[_0x238b('0x4e')](db[_0x238b('0x48')]['rawAttributes']),[_0x238b('0x66'),'salt']);_0x5b16f5[_0x238b('0x4d')]=_[_0x238b('0x4e')](_0x77f820[_0x238b('0x4d')]);_0x5b16f5['filters']=_[_0x238b('0x50')](_0x5b16f5[_0x238b('0x4b')],_0x5b16f5[_0x238b('0x4d')]);_0x24304b[_0x238b('0x51')]=_[_0x238b('0x50')](_0x5b16f5[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x77f820['query'][_0x238b('0x52')]));_0x24304b[_0x238b('0x51')]=_0x24304b['attributes']['length']?_0x24304b[_0x238b('0x51')]:_0x5b16f5['model'];if(_0x77f820[_0x238b('0x4d')][_0x238b('0x67')]){_0x24304b[_0x238b('0x5f')]=[{'all':!![]}];}_0x24304b=_[_0x238b('0x58')]({},_0x24304b,_0x77f820[_0x238b('0x5d')]);return db[_0x238b('0x48')][_0x238b('0x41')](_0x24304b)['then'](handleEntityNotFound(_0x2ba862,null))['then'](respondWithResult(_0x2ba862,null))[_0x238b('0x62')](handleError(_0x2ba862,null));};exports[_0x238b('0x68')]=function(_0x4a637b,_0x4bf245){return db['User'][_0x238b('0x68')](_0x4a637b[_0x238b('0x69')],{'raw':![],'individualHooks':!![]})[_0x238b('0x21')](respondWithResult(_0x4bf245,0xc9))[_0x238b('0x62')](handleError(_0x4bf245,null));};exports[_0x238b('0x33')]=function(_0x451e50,_0x5a8162){if(_0x451e50[_0x238b('0x69')]['id']){delete _0x451e50['body']['id'];}delete _0x451e50['body'][_0x238b('0x40')];return db[_0x238b('0x48')]['find']({'where':{'id':_0x451e50[_0x238b('0x64')]['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x5a8162,null))[_0x238b('0x21')](saveUpdates(_0x451e50[_0x238b('0x69')],null))[_0x238b('0x21')](respondWithResult(_0x5a8162,null))[_0x238b('0x62')](handleError(_0x5a8162,null));};exports[_0x238b('0x6a')]=function(_0x5a61a2,_0x2206b7){return db[_0x238b('0x48')][_0x238b('0x6a')]()[_0x238b('0x21')](respondWithResult(_0x2206b7,null))['catch'](handleError(_0x2206b7,null));};exports[_0x238b('0x6b')]=function(_0x5126b0,_0x1ddfa2,_0x296433){return db[_0x238b('0x48')][_0x238b('0x41')]({'where':{'id':_0x5126b0[_0x238b('0x64')]['id']}})['then'](handleEntityNotFound(_0x1ddfa2,null))[_0x238b('0x21')](function(_0x34f18c){if(_0x34f18c){return _0x34f18c[_0x238b('0x6b')](_0x5126b0[_0x238b('0x69')][_0x238b('0x6c')],_[_0x238b('0x6d')](_0x5126b0[_0x238b('0x69')],[_0x238b('0x6c'),'id'])||{});}})[_0x238b('0x21')](respondWithResult(_0x1ddfa2,null))[_0x238b('0x62')](handleError(_0x1ddfa2,null));};var getLicense=function(_0x37a867){return new BPromise(function(_0x224563,_0x17a928){var _0x5a129c=0x0;_0x37a867[_0x238b('0x69')][_0x238b('0x40')]==='agent'&&_0x224563(_0x238b('0x6e'));return db[_0x238b('0x48')][_0x238b('0x5e')]({'where':{'$or':[{'role':_0x37a867[_0x238b('0x69')][_0x238b('0x40')]===_0x238b('0x3b')?'telephone':[_0x238b('0x6f'),'user']}]}})[_0x238b('0x21')](function(_0x23472c){_0x5a129c=_0x23472c;return require(_0x238b('0x70'))[_0x238b('0x71')]();})[_0x238b('0x21')](function(_0xe5ddfd){var _0x4c9cf6=_0x37a867[_0x238b('0x69')][_0x238b('0x40')]==='telephone'?'telephones':_0x238b('0x72');if(!_['isNil'](_0xe5ddfd[_0x4c9cf6])&&_0x5a129c>=_0xe5ddfd[_0x4c9cf6]){return _0x17a928({'message':_0x238b('0x73')});}return _0x224563(util[_0x238b('0x74')](_0x238b('0x75'),_0x4c9cf6,_0x5a129c));})[_0x238b('0x62')](function(_0x1a202b){return _0x17a928(_0x1a202b);});});};exports[_0x238b('0x76')]=function(_0x2d0ded,_0x194c4c){return getLicense(_0x2d0ded)[_0x238b('0x21')](function(_0x520792){if(!_0x2d0ded[_0x238b('0x69')][_0x238b('0x77')]){var _0xc85cf;return db[_0x238b('0x78')]['findById'](0x1)[_0x238b('0x21')](function(_0x25e3e1){return checkPasswordPattern(_0x25e3e1,_0x2d0ded[_0x238b('0x69')][_0x238b('0x66')],_0x25e3e1[_0x238b('0x79')]);})[_0x238b('0x21')](function(_0x4be1b0){_0xc85cf=_0x4be1b0[_0x238b('0x7a')];return db[_0x238b('0x48')][_0x238b('0x7b')](_0x238b('0x77'));})['then'](function(_0x2dff16){if(_[_0x238b('0x7c')](_0x2dff16)){if(_0xc85cf){_0x2d0ded[_0x238b('0x69')][_0x238b('0x77')]=_0xc85cf;}else{_0x2d0ded[_0x238b('0x69')][_0x238b('0x77')]=0x1;}}else{if(_[_0x238b('0x7c')](_0xc85cf)||_0xc85cf==_0x2dff16){_0x2d0ded[_0x238b('0x69')][_0x238b('0x77')]=_0x2dff16+0x1;}else if(_0xc85cf>_0x2dff16){_0x2d0ded[_0x238b('0x69')][_0x238b('0x77')]=_0xc85cf;}else{return db[_0x238b('0x5a')][_0x238b('0x4d')](_0x238b('0x7d'),{'type':db[_0x238b('0x5a')][_0x238b('0x7e')][_0x238b('0x7f')]})['then'](function(_0x1f1c1f){if(_0x1f1c1f&&_0x1f1c1f['length']){for(var _0x5178fc=0x0,_0x366d44=_0x1f1c1f[_0x238b('0x53')];_0x5178fc<_0x366d44&&_[_0x238b('0x7c')](_0x2d0ded[_0x238b('0x69')]['internal']);_0x5178fc++){if(_0xc85cf<=_0x1f1c1f[_0x5178fc][_0x238b('0x80')]){_0x2d0ded[_0x238b('0x69')]['internal']=_0x1f1c1f[_0x5178fc][_0x238b('0x80')];}else if(_0xc85cf>_0x1f1c1f[_0x5178fc][_0x238b('0x80')]&&_0xc85cf<=_0x1f1c1f[_0x5178fc]['to']){_0x2d0ded['body'][_0x238b('0x77')]=_0xc85cf;}}}if(_[_0x238b('0x7c')](_0x2d0ded['body'][_0x238b('0x77')])){_0x2d0ded[_0x238b('0x69')][_0x238b('0x77')]=_0x2dff16+0x1;}});}}});}})[_0x238b('0x21')](function(){if(_0x2d0ded['body'][_0x238b('0x81')]){_0x2d0ded[_0x238b('0x69')][_0x238b('0x82')]=_0x2d0ded[_0x238b('0x69')][_0x238b('0x77')];_0x2d0ded[_0x238b('0x69')][_0x238b('0x83')]={'mailbox':_0x2d0ded[_0x238b('0x69')][_0x238b('0x77')],'password':_0x2d0ded[_0x238b('0x69')][_0x238b('0x66')],'fullname':_0x2d0ded[_0x238b('0x69')]['fullname'],'email':_0x2d0ded[_0x238b('0x69')][_0x238b('0x84')]};}if(_0x2d0ded[_0x238b('0x69')]&&_0x2d0ded[_0x238b('0x69')][_0x238b('0x40')]===_0x238b('0x39')){_0x2d0ded[_0x238b('0x69')][_0x238b('0x85')]=['101',_0x238b('0x86'),_0x238b('0x87'),_0x238b('0x88'),_0x238b('0x89'),'105','106',_0x238b('0x8a'),'108','109','100',_0x238b('0x8b')];}return db[_0x238b('0x48')][_0x238b('0x76')](_0x2d0ded[_0x238b('0x69')],{'include':[{'model':db[_0x238b('0x83')],'as':_0x238b('0x83')}]});})[_0x238b('0x21')](function(_0x4c8a54){if(_0x2d0ded[_0x238b('0x69')][_0x238b('0x40')]===_0x238b('0x37'))return _0x4c8a54;var _0x219d2a=_0x2d0ded['user'][_0x238b('0x35')]({'plain':!![]});if(!_0x219d2a)throw new Error(_0x238b('0x8c'));if(_0x219d2a[_0x238b('0x40')]===_0x238b('0x37')){var _0xe4e88b=_0x4c8a54[_0x238b('0x35')]({'plain':!![]});var _0x19d3e0=[{'name':_0x238b('0x38'),'value':_0x238b('0x39')},{'name':_0x238b('0x3a'),'value':_0x238b('0x3b')}];var _0x5372b2=_['find'](_0x19d3e0,[_0x238b('0x3e'),_0xe4e88b[_0x238b('0x40')]])[_0x238b('0x42')];return db[_0x238b('0x8d')]['find']({'where':{'name':_0x5372b2,'userProfileId':_0x219d2a[_0x238b('0x8e')]},'raw':!![]})[_0x238b('0x21')](function(_0x31dbdf){if(_0x31dbdf&&_0x31dbdf[_0x238b('0x8f')]===0x0){return db[_0x238b('0x43')][_0x238b('0x76')]({'name':_0xe4e88b['name'],'resourceId':_0xe4e88b['id'],'type':_0x31dbdf[_0x238b('0x42')],'sectionId':_0x31dbdf['id']},{})[_0x238b('0x21')](function(){return _0x4c8a54;});}else{return _0x4c8a54;}})['catch'](function(_0x5a81a0){logger[_0x238b('0x27')](_0x238b('0x90'),_0x5a81a0);throw _0x5a81a0;});}return _0x4c8a54;})['then'](respondWithResult(_0x194c4c,0xc9))[_0x238b('0x62')](handleError(_0x194c4c,null));};exports[_0x238b('0x91')]=function(_0x26bb59,_0x2108b2,_0x35794d){var _0x6225c1=![];if(_0x26bb59[_0x238b('0x69')]['id']){delete _0x26bb59[_0x238b('0x69')]['id'];}return db[_0x238b('0x78')][_0x238b('0x92')]({'attributes':['id',_0x238b('0x79')]})[_0x238b('0x21')](function(_0x50b61a){_0x6225c1=_0x50b61a[_0x238b('0x79')];return db['User'][_0x238b('0x41')]({'where':{'id':_0x26bb59[_0x238b('0x64')]['id']}});})[_0x238b('0x21')](function(_0x246bc8){if(_0x246bc8){if(_0x246bc8['id']==_0x26bb59[_0x238b('0x37')]['id']){if(!_0x26bb59['body'][_0x238b('0x93')]||!_0x26bb59[_0x238b('0x69')][_0x238b('0x94')]){throw new db[(_0x238b('0x1e'))][(_0x238b('0x95'))](_0x238b('0x96'));}if(!_0x246bc8['authenticate'](_0x26bb59[_0x238b('0x69')]['oldPassword'])){throw new db['Sequelize']['ValidationError'](_0x238b('0x97'));}if(_0x26bb59[_0x238b('0x69')][_0x238b('0x93')]==_0x26bb59[_0x238b('0x69')][_0x238b('0x94')]){throw new db[(_0x238b('0x1e'))][(_0x238b('0x95'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x246bc8;}else if(_0x26bb59[_0x238b('0x37')][_0x238b('0x40')]==_0x238b('0x6f')){if(!_0x26bb59[_0x238b('0x69')][_0x238b('0x94')]){throw new db[(_0x238b('0x1e'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x246bc8;}else if(_0x26bb59[_0x238b('0x37')][_0x238b('0x40')]=='user'){if(!_0x26bb59[_0x238b('0x69')][_0x238b('0x94')]){throw new db['Sequelize'][(_0x238b('0x95'))](_0x238b('0x98'));}if(_0x246bc8['role']!=_0x238b('0x39')){throw new db[(_0x238b('0x1e'))]['ValidationError']('Unauthorized');}return _0x246bc8;}else{throw new db[(_0x238b('0x1e'))]['ValidationError'](_0x238b('0x99'));}}return null;})[_0x238b('0x21')](handleEntityNotFound(_0x2108b2,null))['then'](function(_0x176d8a){return checkPasswordPattern(_0x176d8a,_0x26bb59[_0x238b('0x69')][_0x238b('0x94')],_0x6225c1);})[_0x238b('0x21')](saveUpdates({'password':_0x26bb59[_0x238b('0x69')][_0x238b('0x94')],'passwordResetAt':_0x26bb59[_0x238b('0x37')]['id']==_0x26bb59['params']['id']?moment():null},null))['then'](respondWithResult(_0x2108b2,null))[_0x238b('0x62')](handleError(_0x2108b2,null));};exports[_0x238b('0x9a')]=function(_0x5f3772,_0x1f6b2e,_0x518bd8){var _0x33ef2a=_0x5f3772[_0x238b('0x69')][_0x238b('0x9b')];return db['User'][_0x238b('0x41')]({'where':{'id':_0x5f3772[_0x238b('0x64')]['id']},'attributes':['id',_0x238b('0x42'),_0x238b('0x40'),'online',_0x238b('0x9c'),_0x238b('0x9d'),'interface']})[_0x238b('0x21')](handleEntityNotFound(_0x1f6b2e,null))[_0x238b('0x21')](function(_0x36fa9f){if(_0x36fa9f){if(!utils[_0x238b('0x9e')](_0x33ef2a)){throw new db['Sequelize'][(_0x238b('0x95'))](_0x238b('0x9f'));}return _0x36fa9f['add'+_[_0x238b('0xa0')](_0x33ef2a['toLowerCase']())+_0x238b('0xa1')](_0x5f3772[_0x238b('0x69')][_0x238b('0x6c')],{'penalty':_0x5f3772['body'][_0x238b('0xa2')]||0x0})[_0x238b('0xa3')](function(_0x2359e5){for(var _0x3bdebb=0x0;_0x3bdebb<_0x5f3772['body'][_0x238b('0x6c')][_0x238b('0x53')];_0x3bdebb+=0x1){var _0x53363b={'UserId':_0x5f3772[_0x238b('0x64')]['id']};_0x53363b[_[_0x238b('0xa0')](_0x33ef2a[_0x238b('0xa4')]())+'QueueId']=_0x5f3772['body'][_0x238b('0x6c')][_0x3bdebb];socket['emit']('user'+_[_0x238b('0xa0')](_0x33ef2a[_0x238b('0xa4')]())+'Queue:save',_0x53363b);}return _0x2359e5;})[_0x238b('0x21')](function(){if(_0x33ef2a===_0x238b('0xa5')){return db['VoiceQueue']['findAll']({'where':{'id':_0x5f3772[_0x238b('0x69')][_0x238b('0x6c')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x238b('0x21')](function(_0x12e6d4){var _0x46d5e9=_0x36fa9f[_0x238b('0x35')]({'plain':!![]});var _0x4da35b=[];if(_0x33ef2a===_0x238b('0xa5')&&_0x46d5e9['role']===_0x238b('0x39')&&_0x46d5e9[_0x238b('0xa6')]){for(var _0x566a98=0x0;_0x566a98<_0x12e6d4[_0x238b('0x53')];_0x566a98+=0x1){_0x4da35b[_0x238b('0xa7')]({'membername':_0x46d5e9['name'],'UserId':_0x46d5e9['id'],'queue_name':_0x12e6d4[_0x566a98][_0x238b('0x42')],'VoiceQueueId':_0x12e6d4[_0x566a98]['id'],'interface':_['isNil'](_0x46d5e9[_0x238b('0xa8')])?util['format']('SIP/%s',_0x46d5e9[_0x238b('0x42')]):_0x46d5e9[_0x238b('0xa8')],'paused':_0x46d5e9[_0x238b('0x9d')]||![],'penalty':_0x5f3772[_0x238b('0x69')][_0x238b('0xa2')]||0x0});}return BPromise[_0x238b('0xa9')](_0x4da35b,function(_0x4411de){return db[_0x238b('0xaa')][_0x238b('0xab')](_0x4411de);});}return _0x36fa9f;});}})[_0x238b('0x21')](respondWithStatusCode(_0x1f6b2e,null))[_0x238b('0x62')](handleError(_0x1f6b2e,null));};exports[_0x238b('0xac')]=function(_0x2ba75c,_0x52a49f,_0x59f606){var _0x35b1c2;return db[_0x238b('0x48')][_0x238b('0x41')]({'where':{'id':_0x2ba75c[_0x238b('0x64')]['id']},'attributes':['id','name',_0x238b('0x40')]})['then'](handleEntityNotFound(_0x52a49f,null))[_0x238b('0x21')](function(_0x15cbdf){if(_0x15cbdf){_0x35b1c2=_0x15cbdf;if(!_0x2ba75c[_0x238b('0x4d')][_0x238b('0x9b')]||!utils[_0x238b('0x9e')](_0x2ba75c[_0x238b('0x4d')][_0x238b('0x9b')])){throw new db[(_0x238b('0x1e'))][(_0x238b('0x95'))](_0x238b('0x9f'));}return _0x15cbdf[_0x238b('0xad')+_[_0x238b('0xa0')](_0x2ba75c[_0x238b('0x4d')]['channel'][_0x238b('0xa4')]())+'Queues'](_0x2ba75c[_0x238b('0x4d')][_0x238b('0x6c')]);}})[_0x238b('0x21')](function(_0x2dc76f){for(var _0x457db9=0x0;_0x457db9<_0x2ba75c[_0x238b('0x4d')][_0x238b('0x6c')][_0x238b('0x53')];_0x457db9+=0x1){var _0x278731={'UserId':_0x2ba75c[_0x238b('0x64')]['id']};_0x278731[_[_0x238b('0xa0')](_0x2ba75c[_0x238b('0x4d')][_0x238b('0x9b')][_0x238b('0xa4')]())+'QueueId']=_0x2ba75c[_0x238b('0x4d')][_0x238b('0x6c')][_0x457db9];socket[_0x238b('0xae')]('user'+_['capitalize'](_0x2ba75c[_0x238b('0x4d')][_0x238b('0x9b')][_0x238b('0xa4')]())+_0x238b('0xaf'),_0x278731);}return _0x2dc76f;})['then'](function(){if(_0x2ba75c['query']['channel']==='voice'){return db[_0x238b('0xaa')][_0x238b('0x34')]({'where':{'UserId':_0x2ba75c[_0x238b('0x64')]['id'],'VoiceQueueId':_0x2ba75c[_0x238b('0x4d')][_0x238b('0x6c')]},'individualHooks':!![]})[_0x238b('0x21')](function(){return _0x35b1c2;});}return _0x35b1c2;})[_0x238b('0x21')](respondWithStatusCode(_0x52a49f,null))['catch'](handleError(_0x52a49f,null));};exports['addAvatar']=function(_0x56060a,_0x1afb56,_0x5c4a55){_0x56060a[_0x238b('0x69')][_0x238b('0xb0')]=_0x56060a['file']['filename'];return db[_0x238b('0x48')][_0x238b('0x41')]({'where':{'id':_0x56060a['params']['id']}})['then'](handleEntityNotFound(_0x1afb56,null))[_0x238b('0x21')](saveUpdates(_0x56060a[_0x238b('0x69')],null))[_0x238b('0x21')](respondWithResult(_0x1afb56,null))['catch'](handleError(_0x1afb56,null));};exports['getAvatar']=function(_0x3aa7f9,_0x1ed968,_0x261613){var _0x43c2f5=path['join'](config[_0x238b('0xb1')],_0x238b('0xb2'));return db['User']['find']({'where':{'id':_0x3aa7f9[_0x238b('0x64')]['id']},'attributes':['id',_0x238b('0xb0')],'raw':!![]})[_0x238b('0x21')](handleEntityNotFound(_0x1ed968,null))[_0x238b('0x21')](function(_0x590734){if(_0x590734){if(_[_0x238b('0x7c')](_0x590734[_0x238b('0xb0')])){return _0x1ed968[_0x238b('0xb3')](_0x43c2f5);}else{if(!fs[_0x238b('0xb4')](path[_0x238b('0xb5')](config[_0x238b('0xb1')],'server/files/images/',_0x590734[_0x238b('0xb0')]))){return _0x1ed968['download'](_0x43c2f5);}return _0x1ed968['download'](path[_0x238b('0xb5')](config[_0x238b('0xb1')],'server/files/images/',_0x590734[_0x238b('0xb0')]));}}})[_0x238b('0x62')](handleError(_0x1ed968,null));};exports[_0x238b('0xb6')]=function(_0x4477ea,_0x1b05d0,_0x179d28){var _0x7fba9={};var _0x23ea68={};var _0x40eab2;var _0x272037;return db['User'][_0x238b('0x92')]({'where':{'id':_0x4477ea[_0x238b('0x64')]['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x1b05d0,null))[_0x238b('0x21')](function(_0x433bf4){if(_0x433bf4){_0x40eab2=_0x433bf4;_0x23ea68[_0x238b('0x4b')]=_[_0x238b('0x4e')](db[_0x238b('0xb7')][_0x238b('0x49')]);_0x23ea68['query']=_[_0x238b('0x4e')](_0x4477ea[_0x238b('0x4d')]);_0x23ea68['filters']=_[_0x238b('0x50')](_0x23ea68[_0x238b('0x4b')],_0x23ea68[_0x238b('0x4d')]);_0x7fba9[_0x238b('0x51')]=_[_0x238b('0x50')](_0x23ea68[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x4477ea['query'][_0x238b('0x52')]));_0x7fba9[_0x238b('0x51')]=_0x7fba9['attributes'][_0x238b('0x53')]?_0x7fba9['attributes']:_0x23ea68['model'];_0x7fba9[_0x238b('0x54')]=qs[_0x238b('0x55')](_0x4477ea[_0x238b('0x4d')][_0x238b('0x55')]);_0x7fba9[_0x238b('0x56')]=qs['filters'](_[_0x238b('0x57')](_0x4477ea[_0x238b('0x4d')],_0x23ea68[_0x238b('0x4f')]));if(_0x4477ea[_0x238b('0x4d')][_0x238b('0x3c')]){_0x7fba9[_0x238b('0x56')]=_[_0x238b('0x58')](_0x7fba9['where'],{'$or':_['map'](_0x7fba9[_0x238b('0x51')],function(_0x19b036){var _0x223fcc={};_0x223fcc[_0x19b036]={'$like':'%'+_0x4477ea[_0x238b('0x4d')][_0x238b('0x3c')]+'%'};return _0x223fcc;})});}_0x7fba9=_['merge']({},_0x7fba9,_0x4477ea[_0x238b('0x5d')]);return _0x40eab2[_0x238b('0xb6')](_0x7fba9);}})[_0x238b('0x21')](function(_0x4f14ca){if(_0x4f14ca){_0x272037=_0x4f14ca[_0x238b('0x53')];if(_0x4477ea[_0x238b('0x4d')][_0x238b('0xb8')](_0x238b('0x67'))){_0x7fba9[_0x238b('0x5f')]=[{'model':db[_0x238b('0xb9')],'as':_0x238b('0xba'),'required':![]},{'model':db['Tag'],'as':_0x238b('0xbb'),'attributes':['id',_0x238b('0x42'),_0x238b('0xbc')],'where':_0x4477ea[_0x238b('0x4d')][_0x238b('0xbd')]?{'id':_0x4477ea[_0x238b('0x4d')][_0x238b('0xbd')]}:undefined,'required':_0x4477ea[_0x238b('0x4d')][_0x238b('0xbd')]?!![]:![]}];}if(!_0x4477ea[_0x238b('0x4d')][_0x238b('0xb8')](_0x238b('0xbe'))){_0x7fba9[_0x238b('0x2f')]=qs['limit'](_0x4477ea[_0x238b('0x4d')][_0x238b('0x2f')]);_0x7fba9[_0x238b('0x2e')]=qs[_0x238b('0x2e')](_0x4477ea[_0x238b('0x4d')][_0x238b('0x2e')]);}return _0x40eab2[_0x238b('0xb6')](_0x7fba9);}})[_0x238b('0x21')](function(_0x356be2){if(_0x356be2){return _0x356be2?{'count':_0x272037,'rows':_0x356be2}:null;}})[_0x238b('0x21')](respondWithResult(_0x1b05d0,null))[_0x238b('0x62')](handleError(_0x1b05d0,null));};exports[_0x238b('0xbf')]=function(_0x2fd611,_0x412ee1,_0x3503db){var _0x3c126f;var _0x57f3d1;var _0x242810={};var _0x5794e3;return db[_0x238b('0x48')][_0x238b('0x92')]({'where':{'id':_0x2fd611[_0x238b('0x64')]['id']},'attributes':['id',_0x238b('0x42'),_0x238b('0x40')]})['then'](handleEntityNotFound(_0x412ee1,null))['then'](function(_0x3c99ec){if(!utils[_0x238b('0x9e')](_0x2fd611[_0x238b('0x4d')][_0x238b('0x9b')])){throw new db[(_0x238b('0x1e'))][(_0x238b('0x95'))](_0x238b('0x9f'));}_0x3c126f=_0x3c99ec;var _0x533579={};_0x533579['model']=_['keys'](db[_['capitalize'](_0x2fd611[_0x238b('0x4d')][_0x238b('0x9b')])+'Queue']['rawAttributes']);_0x533579[_0x238b('0x4d')]=_[_0x238b('0x4e')](_0x2fd611[_0x238b('0x4d')]);_0x533579['filters']=_[_0x238b('0x50')](_0x533579[_0x238b('0x4b')],_0x533579[_0x238b('0x4d')]);_0x242810[_0x238b('0x51')]=_[_0x238b('0x50')](_0x533579[_0x238b('0x4b')],qs['fields'](_0x2fd611['query']['fields']));_0x242810['attributes']=_0x242810['attributes'][_0x238b('0x53')]?_0x242810[_0x238b('0x51')]:_0x533579[_0x238b('0x4b')];_0x242810[_0x238b('0x54')]=qs[_0x238b('0x55')](_0x2fd611[_0x238b('0x4d')][_0x238b('0x55')]);_0x242810[_0x238b('0x56')]=qs[_0x238b('0x4f')](_[_0x238b('0x57')](_0x2fd611[_0x238b('0x4d')],_0x533579[_0x238b('0x4f')]));if(_0x2fd611[_0x238b('0x4d')]['filter']){_0x242810[_0x238b('0x56')]=_[_0x238b('0x58')](_0x242810[_0x238b('0x56')],{'$or':_['map'](_0x242810[_0x238b('0x51')],function(_0xa1437e){var _0xea173d={};_0xea173d[_0xa1437e]={'$like':'%'+_0x2fd611[_0x238b('0x4d')][_0x238b('0x3c')]+'%'};return _0xea173d;})});}_0x242810=_[_0x238b('0x58')]({},_0x242810,_0x2fd611[_0x238b('0x5d')]);switch(_0x3c126f['role']){case _0x238b('0x6f'):return db[_['capitalize'](_0x2fd611['query'][_0x238b('0x9b')])+_0x238b('0xc0')][_0x238b('0x60')](_0x242810);case'user':case _0x238b('0x39'):return _0x3c126f[_0x238b('0x35')+_[_0x238b('0xa0')](_0x2fd611[_0x238b('0x4d')][_0x238b('0x9b')])+_0x238b('0xa1')](_0x242810);default:throw new db['Sequelize']['ValidationError'](_0x238b('0xc1'));}})[_0x238b('0x21')](function(_0x1fbfe2){_0x5794e3=_0x1fbfe2[_0x238b('0x53')];if(!_0x2fd611[_0x238b('0x4d')][_0x238b('0xb8')](_0x238b('0xbe'))){_0x242810[_0x238b('0x2f')]=qs[_0x238b('0x2f')](_0x2fd611[_0x238b('0x4d')][_0x238b('0x2f')]);_0x242810[_0x238b('0x2e')]=qs[_0x238b('0x2e')](_0x2fd611['query'][_0x238b('0x2e')]);}switch(_0x3c126f[_0x238b('0x40')]){case _0x238b('0x6f'):return db[_['capitalize'](_0x2fd611[_0x238b('0x4d')][_0x238b('0x9b')])+'Queue'][_0x238b('0x60')](_0x242810);case _0x238b('0x37'):case _0x238b('0x39'):return _0x3c126f[_0x238b('0x35')+_[_0x238b('0xa0')](_0x2fd611['query'][_0x238b('0x9b')])+_0x238b('0xa1')](_0x242810);}})[_0x238b('0x21')](function(_0x531ab4){return{'count':_0x5794e3,'rows':_0x531ab4};})[_0x238b('0x21')](respondWithResult(_0x412ee1,null))[_0x238b('0x62')](handleError(_0x412ee1,null));};exports['getVoiceQueuesRt']=function(_0x4441a2,_0x2f22d4,_0x5db904){var _0x4c2044={};var _0x61277e={};var _0x753c86;var _0x5a2ea2;return db[_0x238b('0x48')][_0x238b('0x92')]({'where':{'id':_0x4441a2[_0x238b('0x64')]['id']}})['then'](handleEntityNotFound(_0x2f22d4,null))['then'](function(_0x1f783a){if(_0x1f783a){_0x753c86=_0x1f783a;_0x61277e['model']=_[_0x238b('0x4e')](db['UserVoiceQueueRt'][_0x238b('0x49')]);_0x61277e[_0x238b('0x4d')]=_[_0x238b('0x4e')](_0x4441a2[_0x238b('0x4d')]);_0x61277e[_0x238b('0x4f')]=_[_0x238b('0x50')](_0x61277e['model'],_0x61277e[_0x238b('0x4d')]);_0x4c2044[_0x238b('0x51')]=_[_0x238b('0x50')](_0x61277e[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x4441a2['query'][_0x238b('0x52')]));_0x4c2044[_0x238b('0x51')]=_0x4c2044[_0x238b('0x51')][_0x238b('0x53')]?_0x4c2044[_0x238b('0x51')]:_0x61277e['model'];_0x4c2044[_0x238b('0x54')]=qs[_0x238b('0x55')](_0x4441a2[_0x238b('0x4d')][_0x238b('0x55')]);_0x4c2044[_0x238b('0x56')]=qs['filters'](_[_0x238b('0x57')](_0x4441a2[_0x238b('0x4d')],_0x61277e[_0x238b('0x4f')]));if(_0x4441a2[_0x238b('0x4d')][_0x238b('0x3c')]){_0x4c2044[_0x238b('0x56')]=_['merge'](_0x4c2044['where'],{'$or':_[_0x238b('0x4c')](_0x4c2044[_0x238b('0x51')],function(_0x2dfb0d){var _0x278730={};_0x278730[_0x2dfb0d]={'$like':'%'+_0x4441a2[_0x238b('0x4d')]['filter']+'%'};return _0x278730;})});}_0x4c2044=_[_0x238b('0x58')]({},_0x4c2044,_0x4441a2[_0x238b('0x5d')]);return _0x753c86[_0x238b('0xc2')](_0x4c2044);}})[_0x238b('0x21')](function(_0x384be4){if(_0x384be4){_0x5a2ea2=_0x384be4[_0x238b('0x53')];if(!_0x4441a2[_0x238b('0x4d')][_0x238b('0xb8')](_0x238b('0xbe'))){_0x4c2044[_0x238b('0x2f')]=qs[_0x238b('0x2f')](_0x4441a2[_0x238b('0x4d')][_0x238b('0x2f')]);_0x4c2044[_0x238b('0x2e')]=qs['offset'](_0x4441a2[_0x238b('0x4d')][_0x238b('0x2e')]);}return _0x753c86[_0x238b('0xc2')](_0x4c2044);}})[_0x238b('0x21')](function(_0xa87c63){if(_0xa87c63){return _0xa87c63?{'count':_0x5a2ea2,'rows':_0xa87c63}:null;}})['then'](respondWithResult(_0x2f22d4,null))['catch'](handleError(_0x2f22d4,null));};exports[_0x238b('0xc3')]=function(_0x333134,_0x3a68f2,_0x41965c){var _0x21763={};var _0x3a5721={};var _0x1f1247;var _0x37d723;return db['User'][_0x238b('0x92')]({'where':{'id':_0x333134['params']['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x3a68f2,null))[_0x238b('0x21')](function(_0xc207ab){if(_0xc207ab){_0x1f1247=_0xc207ab;_0x3a5721['model']=_[_0x238b('0x4e')](db[_0x238b('0xc4')][_0x238b('0x49')]);_0x3a5721['query']=_[_0x238b('0x4e')](_0x333134[_0x238b('0x4d')]);_0x3a5721['filters']=_[_0x238b('0x50')](_0x3a5721['model'],_0x3a5721[_0x238b('0x4d')]);_0x21763[_0x238b('0x51')]=_['intersection'](_0x3a5721[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x333134['query'][_0x238b('0x52')]));_0x21763[_0x238b('0x51')]=_0x21763[_0x238b('0x51')][_0x238b('0x53')]?_0x21763[_0x238b('0x51')]:_0x3a5721[_0x238b('0x4b')];_0x21763['order']=qs[_0x238b('0x55')](_0x333134[_0x238b('0x4d')][_0x238b('0x55')]);_0x21763[_0x238b('0x56')]=qs[_0x238b('0x4f')](_[_0x238b('0x57')](_0x333134[_0x238b('0x4d')],_0x3a5721[_0x238b('0x4f')]));if(_0x333134[_0x238b('0x4d')][_0x238b('0x3c')]){_0x21763[_0x238b('0x56')]=_[_0x238b('0x58')](_0x21763[_0x238b('0x56')],{'$or':_[_0x238b('0x4c')](_0x21763[_0x238b('0x51')],function(_0x58cf16){var _0x4873af={};_0x4873af[_0x58cf16]={'$like':'%'+_0x333134[_0x238b('0x4d')][_0x238b('0x3c')]+'%'};return _0x4873af;})});}_0x21763=_[_0x238b('0x58')]({},_0x21763,_0x333134[_0x238b('0x5d')]);return _0x1f1247[_0x238b('0xc3')](_0x21763);}})[_0x238b('0x21')](function(_0x21fe2b){if(_0x21fe2b){_0x37d723=_0x21fe2b[_0x238b('0x53')];if(!_0x333134[_0x238b('0x4d')][_0x238b('0xb8')](_0x238b('0xbe'))){_0x21763[_0x238b('0x2f')]=qs[_0x238b('0x2f')](_0x333134[_0x238b('0x4d')][_0x238b('0x2f')]);_0x21763['offset']=qs[_0x238b('0x2e')](_0x333134[_0x238b('0x4d')]['offset']);}return _0x1f1247[_0x238b('0xc3')](_0x21763);}})[_0x238b('0x21')](function(_0x1efae3){if(_0x1efae3){return _0x1efae3?{'count':_0x37d723,'rows':_0x1efae3}:null;}})[_0x238b('0x21')](respondWithResult(_0x3a68f2,null))[_0x238b('0x62')](handleError(_0x3a68f2,null));};exports['getRecordings']=function(_0x4e23b5,_0x5cfcd2,_0x33aaa0){var _0x4961fa={'raw':!![],'where':{}};var _0x209d8f={};var _0x4b76d4={'count':0x0,'rows':[]};return db[_0x238b('0x48')][_0x238b('0x92')]({'where':{'id':_0x4e23b5[_0x238b('0x64')]['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x5cfcd2,null))[_0x238b('0x21')](function(_0xffd6dd){if(_0xffd6dd){_0x209d8f['model']=_[_0x238b('0x4e')](db['VoiceRecording'][_0x238b('0x49')]);_0x209d8f[_0x238b('0x4d')]=_[_0x238b('0x4e')](_0x4e23b5[_0x238b('0x4d')]);_0x209d8f[_0x238b('0x4f')]=_[_0x238b('0x50')](_0x209d8f[_0x238b('0x4b')],_0x209d8f['query']);_0x4961fa[_0x238b('0x51')]=_[_0x238b('0x50')](_0x209d8f['model'],qs['fields'](_0x4e23b5['query'][_0x238b('0x52')]));_0x4961fa[_0x238b('0x51')]=_0x4961fa[_0x238b('0x51')][_0x238b('0x53')]?_0x4961fa[_0x238b('0x51')]:_0x209d8f[_0x238b('0x4b')];if(!_0x4e23b5[_0x238b('0x4d')][_0x238b('0xb8')](_0x238b('0xbe'))){_0x4961fa[_0x238b('0x2f')]=qs[_0x238b('0x2f')](_0x4e23b5[_0x238b('0x4d')][_0x238b('0x2f')]);_0x4961fa[_0x238b('0x2e')]=qs[_0x238b('0x2e')](_0x4e23b5['query'][_0x238b('0x2e')]);}_0x4961fa['order']=qs[_0x238b('0x55')](_0x4e23b5[_0x238b('0x4d')][_0x238b('0x55')]);_0x4961fa['where']=qs[_0x238b('0x4f')](_['pick'](_0x4e23b5['query'],_0x209d8f[_0x238b('0x4f')]));_0x4961fa[_0x238b('0x56')][_0x238b('0xc5')]=_0xffd6dd['id'];if(_0x4e23b5[_0x238b('0x4d')][_0x238b('0x3c')]){_0x4961fa[_0x238b('0x56')]=_[_0x238b('0x58')](_0x4961fa[_0x238b('0x56')],{'$or':_[_0x238b('0x4c')](_0x4961fa[_0x238b('0x51')],function(_0x13f260){var _0x4143f6={};_0x4143f6[_0x13f260]={'$like':'%'+_0x4e23b5[_0x238b('0x4d')][_0x238b('0x3c')]+'%'};return _0x4143f6;})});}_0x4961fa=_[_0x238b('0x58')]({},_0x4961fa,_0x4e23b5[_0x238b('0x5d')]);return db[_0x238b('0xc6')]['count']({'where':_0x4961fa[_0x238b('0x56')]})[_0x238b('0x21')](function(_0x3ff544){_0x4b76d4[_0x238b('0x5e')]=_0x3ff544;if(_0x4e23b5[_0x238b('0x4d')][_0x238b('0x67')]){_0x4961fa[_0x238b('0x5f')]=[{'all':!![]}];}return db[_0x238b('0xc6')][_0x238b('0x60')](_0x4961fa);})['then'](function(_0x472a1e){_0x4b76d4[_0x238b('0x61')]=_0x472a1e;return _0x4b76d4;});}})[_0x238b('0x21')](respondWithFilteredResult(_0x5cfcd2,_0x4961fa))[_0x238b('0x62')](handleError(_0x5cfcd2,null));};exports[_0x238b('0xc7')]=function(_0x662d23,_0x45c469,_0x3a38e5){var _0x32308a={'raw':!![],'where':{}};var _0x22add4={};var _0x338afb={'count':0x0,'rows':[]};return db[_0x238b('0x48')][_0x238b('0x92')]({'where':{'id':_0x662d23['params']['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x45c469,null))[_0x238b('0x21')](function(_0x598e70){if(_0x598e70){_0x22add4[_0x238b('0x4b')]=_[_0x238b('0x4e')](db['ScreenRecording'][_0x238b('0x49')]);_0x22add4[_0x238b('0x4d')]=_[_0x238b('0x4e')](_0x662d23[_0x238b('0x4d')]);_0x22add4[_0x238b('0x4f')]=_[_0x238b('0x50')](_0x22add4[_0x238b('0x4b')],_0x22add4[_0x238b('0x4d')]);_0x32308a['attributes']=_[_0x238b('0x50')](_0x22add4[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x662d23[_0x238b('0x4d')][_0x238b('0x52')]));_0x32308a[_0x238b('0x51')]=_0x32308a[_0x238b('0x51')][_0x238b('0x53')]?_0x32308a[_0x238b('0x51')]:_0x22add4['model'];if(!_0x662d23['query'][_0x238b('0xb8')](_0x238b('0xbe'))){_0x32308a['limit']=qs[_0x238b('0x2f')](_0x662d23[_0x238b('0x4d')][_0x238b('0x2f')]);_0x32308a[_0x238b('0x2e')]=qs[_0x238b('0x2e')](_0x662d23['query']['offset']);}_0x32308a['order']=qs['sort'](_0x662d23[_0x238b('0x4d')][_0x238b('0x55')]);_0x32308a[_0x238b('0x56')]=qs['filters'](_[_0x238b('0x57')](_0x662d23['query'],_0x22add4[_0x238b('0x4f')]));_0x32308a[_0x238b('0x56')][_0x238b('0xc5')]=_0x598e70['id'];if(_0x662d23[_0x238b('0x4d')][_0x238b('0x3c')]){_0x32308a[_0x238b('0x56')]=_[_0x238b('0x58')](_0x32308a[_0x238b('0x56')],{'$or':_[_0x238b('0x4c')](_0x32308a[_0x238b('0x51')],function(_0x1bc16e){var _0x2e4bb7={};_0x2e4bb7[_0x1bc16e]={'$like':'%'+_0x662d23[_0x238b('0x4d')]['filter']+'%'};return _0x2e4bb7;})});}_0x32308a=_[_0x238b('0x58')]({},_0x32308a,_0x662d23[_0x238b('0x5d')]);return db[_0x238b('0xc8')][_0x238b('0x5e')]({'where':_0x32308a[_0x238b('0x56')]})['then'](function(_0x1eadc6){_0x338afb[_0x238b('0x5e')]=_0x1eadc6;if(_0x662d23['query'][_0x238b('0x67')]){_0x32308a[_0x238b('0x5f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x238b('0x60')](_0x32308a);})[_0x238b('0x21')](function(_0x5863cc){_0x338afb[_0x238b('0x61')]=_0x5863cc;return _0x338afb;});}})['then'](respondWithFilteredResult(_0x45c469,_0x32308a))['catch'](handleError(_0x45c469,null));};exports['getChatInteractions']=function(_0x52ab2f,_0x228ad5,_0x394828){var _0x366469={};var _0x282497={};var _0xbbcaba;var _0x377cee;return db[_0x238b('0x48')][_0x238b('0x92')]({'where':{'id':_0x52ab2f['params']['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x228ad5,null))[_0x238b('0x21')](function(_0x43778d){if(_0x43778d){_0xbbcaba=_0x43778d;_0x282497[_0x238b('0x4b')]=_[_0x238b('0x4e')](db['ChatInteraction'][_0x238b('0x49')]);_0x282497[_0x238b('0x4d')]=_['keys'](_0x52ab2f['query']);_0x282497[_0x238b('0x4f')]=_['intersection'](_0x282497['model'],_0x282497[_0x238b('0x4d')]);_0x366469[_0x238b('0x51')]=_[_0x238b('0x50')](_0x282497[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x52ab2f['query'][_0x238b('0x52')]));_0x366469['attributes']=_0x366469[_0x238b('0x51')][_0x238b('0x53')]?_0x366469[_0x238b('0x51')]:_0x282497[_0x238b('0x4b')];_0x366469[_0x238b('0x54')]=qs[_0x238b('0x55')](_0x52ab2f['query']['sort']);_0x366469[_0x238b('0x56')]=qs[_0x238b('0x4f')](_['pick'](_0x52ab2f['query'],_0x282497[_0x238b('0x4f')]));if(_0x52ab2f['query']['filter']){_0x366469['where']=_[_0x238b('0x58')](_0x366469[_0x238b('0x56')],{'$or':_[_0x238b('0x4c')](_0x366469[_0x238b('0x51')],function(_0x2bbe4c){var _0x323002={};_0x323002[_0x2bbe4c]={'$like':'%'+_0x52ab2f[_0x238b('0x4d')][_0x238b('0x3c')]+'%'};return _0x323002;})});}_0x366469=_[_0x238b('0x58')]({},_0x366469,_0x52ab2f['options']);return _0xbbcaba['getChatInteractions'](_0x366469);}})[_0x238b('0x21')](function(_0x353121){if(_0x353121){_0x377cee=_0x353121['length'];if(!_0x52ab2f['query'][_0x238b('0xb8')](_0x238b('0xbe'))){_0x366469[_0x238b('0x2f')]=qs[_0x238b('0x2f')](_0x52ab2f[_0x238b('0x4d')]['limit']);_0x366469[_0x238b('0x2e')]=qs['offset'](_0x52ab2f[_0x238b('0x4d')][_0x238b('0x2e')]);}return _0xbbcaba[_0x238b('0xc9')](_0x366469);}})[_0x238b('0x21')](function(_0x1428de){if(_0x1428de){return _0x1428de?{'count':_0x377cee,'rows':_0x1428de}:null;}})[_0x238b('0x21')](respondWithResult(_0x228ad5,null))[_0x238b('0x62')](handleError(_0x228ad5,null));};exports[_0x238b('0xca')]=function(_0x2ddb29,_0x5f5284,_0x3fef40){var _0x2ba516={};var _0x407343={};var _0x24e5f3;var _0x40b79b;return db[_0x238b('0x48')][_0x238b('0x92')]({'where':{'id':_0x2ddb29['params']['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x5f5284,null))['then'](function(_0xcd08b6){if(_0xcd08b6){_0x24e5f3=_0xcd08b6;_0x407343[_0x238b('0x4b')]=_[_0x238b('0x4e')](db[_0x238b('0xcb')][_0x238b('0x49')]);_0x407343[_0x238b('0x4d')]=_[_0x238b('0x4e')](_0x2ddb29['query']);_0x407343[_0x238b('0x4f')]=_[_0x238b('0x50')](_0x407343[_0x238b('0x4b')],_0x407343[_0x238b('0x4d')]);_0x2ba516[_0x238b('0x51')]=_[_0x238b('0x50')](_0x407343[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x2ddb29[_0x238b('0x4d')][_0x238b('0x52')]));_0x2ba516[_0x238b('0x51')]=_0x2ba516['attributes']['length']?_0x2ba516[_0x238b('0x51')]:_0x407343[_0x238b('0x4b')];_0x2ba516['order']=qs['sort'](_0x2ddb29[_0x238b('0x4d')][_0x238b('0x55')]);_0x2ba516[_0x238b('0x56')]=qs[_0x238b('0x4f')](_[_0x238b('0x57')](_0x2ddb29['query'],_0x407343[_0x238b('0x4f')]));if(_0x2ddb29[_0x238b('0x4d')][_0x238b('0x3c')]){_0x2ba516[_0x238b('0x56')]=_['merge'](_0x2ba516[_0x238b('0x56')],{'$or':_[_0x238b('0x4c')](_0x2ba516[_0x238b('0x51')],function(_0x57ab56){var _0x1d2f62={};_0x1d2f62[_0x57ab56]={'$like':'%'+_0x2ddb29[_0x238b('0x4d')]['filter']+'%'};return _0x1d2f62;})});}_0x2ba516=_['merge']({},_0x2ba516,_0x2ddb29[_0x238b('0x5d')]);return _0x24e5f3['getOpenchannelInteractions'](_0x2ba516);}})['then'](function(_0x127199){if(_0x127199){_0x40b79b=_0x127199[_0x238b('0x53')];if(!_0x2ddb29['query']['hasOwnProperty'](_0x238b('0xbe'))){_0x2ba516[_0x238b('0x2f')]=qs[_0x238b('0x2f')](_0x2ddb29[_0x238b('0x4d')][_0x238b('0x2f')]);_0x2ba516[_0x238b('0x2e')]=qs['offset'](_0x2ddb29['query'][_0x238b('0x2e')]);}return _0x24e5f3[_0x238b('0xca')](_0x2ba516);}})[_0x238b('0x21')](function(_0x1bb908){if(_0x1bb908){return _0x1bb908?{'count':_0x40b79b,'rows':_0x1bb908}:null;}})[_0x238b('0x21')](respondWithResult(_0x5f5284,null))[_0x238b('0x62')](handleError(_0x5f5284,null));};exports[_0x238b('0xcc')]=function(_0x3d0d4e,_0x23fb55,_0x319211){var _0x41c91b={'raw':!![],'where':{}};var _0x446226={};var _0x5b7a4f={'count':0x0,'rows':[]};return db[_0x238b('0x48')][_0x238b('0x92')]({'where':{'id':_0x3d0d4e['params']['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x23fb55,null))['then'](function(_0x1499d2){if(_0x1499d2){_0x446226['model']=_[_0x238b('0x4e')](db['MailInteraction'][_0x238b('0x49')]);_0x446226[_0x238b('0x4d')]=_[_0x238b('0x4e')](_0x3d0d4e[_0x238b('0x4d')]);_0x446226[_0x238b('0x4f')]=_[_0x238b('0x50')](_0x446226[_0x238b('0x4b')],_0x446226['query']);_0x41c91b[_0x238b('0x51')]=_[_0x238b('0x50')](_0x446226[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x3d0d4e[_0x238b('0x4d')][_0x238b('0x52')]));_0x41c91b[_0x238b('0x51')]=_0x41c91b['attributes'][_0x238b('0x53')]?_0x41c91b['attributes']:_0x446226[_0x238b('0x4b')];if(!_0x3d0d4e['query'][_0x238b('0xb8')](_0x238b('0xbe'))){_0x41c91b[_0x238b('0x2f')]=qs[_0x238b('0x2f')](_0x3d0d4e[_0x238b('0x4d')][_0x238b('0x2f')]);_0x41c91b['offset']=qs[_0x238b('0x2e')](_0x3d0d4e[_0x238b('0x4d')][_0x238b('0x2e')]);}_0x41c91b['order']=qs[_0x238b('0x55')](_0x3d0d4e[_0x238b('0x4d')]['sort']);_0x41c91b[_0x238b('0x56')]=qs[_0x238b('0x4f')](_['pick'](_0x3d0d4e[_0x238b('0x4d')],_0x446226[_0x238b('0x4f')]));_0x41c91b[_0x238b('0x56')][_0x238b('0xc5')]=_0x1499d2['id'];if(_0x3d0d4e[_0x238b('0x4d')][_0x238b('0x3c')]){_0x41c91b[_0x238b('0x56')]=_[_0x238b('0x58')](_0x41c91b['where'],{'$or':_[_0x238b('0x4c')](_0x41c91b[_0x238b('0x51')],function(_0x31192f){var _0x253904={};_0x253904[_0x31192f]={'$like':'%'+_0x3d0d4e['query'][_0x238b('0x3c')]+'%'};return _0x253904;})});}_0x41c91b=_['merge']({},_0x41c91b,_0x3d0d4e[_0x238b('0x5d')]);return db['MailInteraction'][_0x238b('0x5e')]({'where':_0x41c91b[_0x238b('0x56')]})[_0x238b('0x21')](function(_0x5df107){_0x5b7a4f[_0x238b('0x5e')]=_0x5df107;if(_0x3d0d4e[_0x238b('0x4d')]['includeAll']){_0x41c91b[_0x238b('0x5f')]=[{'all':!![]}];}return db[_0x238b('0xcd')][_0x238b('0x60')](_0x41c91b);})['then'](function(_0x492bcc){_0x5b7a4f[_0x238b('0x61')]=_0x492bcc;return _0x5b7a4f;});}})['then'](respondWithFilteredResult(_0x23fb55,_0x41c91b))[_0x238b('0x62')](handleError(_0x23fb55,null));};exports[_0x238b('0xce')]=function(_0x549685,_0x43f197,_0x53bb46){var _0x57af2a={};var _0x81b7={};var _0x190efb;var _0x3308fc;return db[_0x238b('0x48')]['findOne']({'where':{'id':_0x549685[_0x238b('0x64')]['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x43f197,null))[_0x238b('0x21')](function(_0x1849c6){if(_0x1849c6){_0x190efb=_0x1849c6;_0x81b7[_0x238b('0x4b')]=_['keys'](db[_0x238b('0xcf')][_0x238b('0x49')]);_0x81b7[_0x238b('0x4d')]=_['keys'](_0x549685[_0x238b('0x4d')]);_0x81b7['filters']=_[_0x238b('0x50')](_0x81b7[_0x238b('0x4b')],_0x81b7[_0x238b('0x4d')]);_0x57af2a[_0x238b('0x51')]=_[_0x238b('0x50')](_0x81b7[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x549685['query']['fields']));_0x57af2a['attributes']=_0x57af2a['attributes'][_0x238b('0x53')]?_0x57af2a[_0x238b('0x51')]:_0x81b7['model'];_0x57af2a[_0x238b('0x54')]=qs[_0x238b('0x55')](_0x549685[_0x238b('0x4d')][_0x238b('0x55')]);_0x57af2a['where']=qs['filters'](_[_0x238b('0x57')](_0x549685[_0x238b('0x4d')],_0x81b7['filters']));if(_0x549685[_0x238b('0x4d')][_0x238b('0x3c')]){_0x57af2a[_0x238b('0x56')]=_[_0x238b('0x58')](_0x57af2a['where'],{'$or':_['map'](_0x57af2a['attributes'],function(_0x293c21){var _0x5867ce={};_0x5867ce[_0x293c21]={'$like':'%'+_0x549685[_0x238b('0x4d')][_0x238b('0x3c')]+'%'};return _0x5867ce;})});}_0x57af2a=_[_0x238b('0x58')]({},_0x57af2a,_0x549685[_0x238b('0x5d')]);return _0x190efb[_0x238b('0xce')](_0x57af2a);}})[_0x238b('0x21')](function(_0x48f062){if(_0x48f062){_0x3308fc=_0x48f062[_0x238b('0x53')];if(!_0x549685[_0x238b('0x4d')][_0x238b('0xb8')](_0x238b('0xbe'))){_0x57af2a[_0x238b('0x2f')]=qs[_0x238b('0x2f')](_0x549685[_0x238b('0x4d')][_0x238b('0x2f')]);_0x57af2a[_0x238b('0x2e')]=qs[_0x238b('0x2e')](_0x549685[_0x238b('0x4d')]['offset']);}return _0x190efb[_0x238b('0xce')](_0x57af2a);}})[_0x238b('0x21')](function(_0xa3dbc3){if(_0xa3dbc3){return _0xa3dbc3?{'count':_0x3308fc,'rows':_0xa3dbc3}:null;}})['then'](respondWithResult(_0x43f197,null))['catch'](handleError(_0x43f197,null));};exports['getFaxInteractions']=function(_0x106a1e,_0x528870,_0x47311e){var _0x34473c={};var _0x1c64a3={};var _0x4d614f;var _0x3629f0;return db[_0x238b('0x48')][_0x238b('0x92')]({'where':{'id':_0x106a1e['params']['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x528870,null))['then'](function(_0x4cf92b){if(_0x4cf92b){_0x4d614f=_0x4cf92b;_0x1c64a3['model']=_['keys'](db[_0x238b('0xd0')]['rawAttributes']);_0x1c64a3['query']=_['keys'](_0x106a1e[_0x238b('0x4d')]);_0x1c64a3[_0x238b('0x4f')]=_[_0x238b('0x50')](_0x1c64a3[_0x238b('0x4b')],_0x1c64a3[_0x238b('0x4d')]);_0x34473c[_0x238b('0x51')]=_['intersection'](_0x1c64a3[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x106a1e[_0x238b('0x4d')][_0x238b('0x52')]));_0x34473c[_0x238b('0x51')]=_0x34473c['attributes'][_0x238b('0x53')]?_0x34473c[_0x238b('0x51')]:_0x1c64a3[_0x238b('0x4b')];_0x34473c[_0x238b('0x54')]=qs[_0x238b('0x55')](_0x106a1e['query'][_0x238b('0x55')]);_0x34473c[_0x238b('0x56')]=qs[_0x238b('0x4f')](_[_0x238b('0x57')](_0x106a1e[_0x238b('0x4d')],_0x1c64a3[_0x238b('0x4f')]));if(_0x106a1e[_0x238b('0x4d')]['filter']){_0x34473c[_0x238b('0x56')]=_['merge'](_0x34473c[_0x238b('0x56')],{'$or':_['map'](_0x34473c[_0x238b('0x51')],function(_0x1836ae){var _0x1c1d1a={};_0x1c1d1a[_0x1836ae]={'$like':'%'+_0x106a1e[_0x238b('0x4d')][_0x238b('0x3c')]+'%'};return _0x1c1d1a;})});}_0x34473c=_['merge']({},_0x34473c,_0x106a1e[_0x238b('0x5d')]);return _0x4d614f[_0x238b('0xd1')](_0x34473c);}})[_0x238b('0x21')](function(_0x148c55){if(_0x148c55){_0x3629f0=_0x148c55[_0x238b('0x53')];if(!_0x106a1e['query']['hasOwnProperty'](_0x238b('0xbe'))){_0x34473c[_0x238b('0x2f')]=qs[_0x238b('0x2f')](_0x106a1e[_0x238b('0x4d')][_0x238b('0x2f')]);_0x34473c['offset']=qs[_0x238b('0x2e')](_0x106a1e[_0x238b('0x4d')][_0x238b('0x2e')]);}return _0x4d614f[_0x238b('0xd1')](_0x34473c);}})[_0x238b('0x21')](function(_0x567538){if(_0x567538){return _0x567538?{'count':_0x3629f0,'rows':_0x567538}:null;}})[_0x238b('0x21')](respondWithResult(_0x528870,null))[_0x238b('0x62')](handleError(_0x528870,null));};exports['login']=function(_0x1118af,_0x3b2fe1,_0x1a66ef){var _0x30933a;var _0x2b62e4;var _0x241d4e;var _0x3f8d11=!_[_0x238b('0x7c')](_0x1118af[_0x238b('0x64')]['id'])?_0x1118af[_0x238b('0x64')]['id']:!_['isNil'](_0x1118af['user']['id'])?_0x1118af[_0x238b('0x37')]['id']:null;return db[_0x238b('0x48')]['find']({'where':{'id':_0x3f8d11,'role':{'$or':[_0x238b('0x6f'),_0x238b('0x37'),'agent']}},'attributes':['id','name','phone','mobile',_0x238b('0x40'),'internal',_0x238b('0x9c')]})['then'](function(_0x581edf){if(_0x581edf){if(_0x581edf[_0x238b('0x40')]===_0x238b('0x39')){_0x30933a=_0x581edf;if(_0x1118af[_0x238b('0x69')]['interface']){_0x241d4e=util['format']('LOCAL/%s@from-sip/n',_0x30933a[_0x1118af['body'][_0x238b('0xa8')]]);}else if(_0x1118af[_0x238b('0x69')][_0x238b('0xd2')]){_0x241d4e=util[_0x238b('0x74')](_0x238b('0xd3'),_0x1118af[_0x238b('0x69')]['intrf']);}else{_0x241d4e=util['format'](_0x238b('0xd3'),_0x30933a['name']);}socket['to'](util['format'](_0x238b('0xd4'),_0x30933a[_0x238b('0x42')]))[_0x238b('0xae')]('user:forcelogout',{'ip':_0x1118af[_0x238b('0xd5')][_0x238b('0xd6')]||_0x1118af['connection'][_0x238b('0xd7')]||_0x1118af[_0x238b('0xd8')]['remoteAddress']||_0x1118af[_0x238b('0xd9')][_0x238b('0xd8')][_0x238b('0xd7')]});return db[_0x238b('0xaa')][_0x238b('0x34')]({'where':{'membername':_0x30933a[_0x238b('0x42')]},'individualHooks':!![]});}}else{throw new db[(_0x238b('0x1e'))][(_0x238b('0x95'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x238b('0x21')](function(){if(_0x30933a){return _0x30933a[_0x238b('0xda')]({'raw':!![]});}})[_0x238b('0x21')](function(_0x1b042b){if(_0x30933a){var _0x1aa10e=[];if(_0x1b042b){_0x2b62e4=_0x1b042b;if(_0x2b62e4[_0x238b('0x53')]){for(var _0x3d2d14=0x0;_0x3d2d14<_0x2b62e4[_0x238b('0x53')];_0x3d2d14++){_0x1aa10e[_0x238b('0xa7')]({'membername':_0x30933a[_0x238b('0x42')],'UserId':_0x30933a['id'],'queue_name':_0x2b62e4[_0x3d2d14][_0x238b('0x42')],'VoiceQueueId':_0x2b62e4[_0x3d2d14]['id'],'interface':_0x241d4e,'paused':_0x30933a[_0x238b('0x9c')]||![],'penalty':_0x2b62e4[_0x3d2d14][_0x238b('0xdb')]||0x0});}return BPromise[_0x238b('0xa9')](_0x1aa10e,function(_0x4bb7c4){return db['UserVoiceQueueRt']['upsert'](_0x4bb7c4);});}}}})[_0x238b('0x21')](function(){if(_0x30933a){return db[_0x238b('0xdc')][_0x238b('0x60')]({'where':{'membername':_0x30933a[_0x238b('0x42')],'exitAt':null}});}})['then'](function(_0x57e40c){if(_0x30933a){var _0x151b2e=[];_0x57e40c[_0x238b('0xdd')](function(_0x3d794d){_0x151b2e[_0x238b('0xa7')](_0x3d794d['update']({'exitAt':moment()[_0x238b('0x74')](_0x238b('0xde'))}));});return BPromise[_0x238b('0xdf')](_0x151b2e);}})[_0x238b('0x21')](function(){if(_0x30933a){var _0x40b722=[];var _0x13ba98=[];var _0x4b7079=utils[_0x238b('0xe0')]();var _0x5c887b={'membername':_0x30933a[_0x238b('0x42')],'interface':_0x241d4e,'enterAt':moment()[_0x238b('0x74')](_0x238b('0xde')),'role':_0x30933a[_0x238b('0x40')],'internal':_0x30933a[_0x238b('0x77')]};_0x4b7079['forEach'](function(_0x401806){_0x40b722['push'](_[_0x238b('0x58')]({'channel':_0x401806,'type':_0x238b('0xe1'),'data1':_0x1118af['body'][_0x238b('0xe2')],'data2':_0x241d4e},_0x5c887b));if(_0x30933a[_0x238b('0x9c')]){_0x13ba98[_0x238b('0xa7')](_[_0x238b('0x58')]({'channel':_0x401806,'type':_0x238b('0xe3'),'data1':_0x238b('0xe4')},_0x5c887b));}});return db['MemberReport'][_0x238b('0x68')](_0x40b722[_0x238b('0xe5')](_0x13ba98),{'individualHooks':!![]});}})[_0x238b('0x21')](function(){if(_0x30933a){return _0x30933a[_0x238b('0x33')]({'online':!![],'lastLoginAt':moment()['format'](_0x238b('0xde')),'voicePause':_0x30933a['loginInPause']||![],'mailPause':_0x30933a[_0x238b('0x9c')]||![],'chatPause':_0x30933a[_0x238b('0x9c')]||![],'faxPause':_0x30933a[_0x238b('0x9c')]||![],'smsPause':_0x30933a[_0x238b('0x9c')]||![],'openchannelPause':_0x30933a[_0x238b('0x9c')]||![],'pauseType':_0x30933a['loginInPause']?_0x238b('0xe4'):null,'interface':_0x241d4e,'lastPauseAt':moment()[_0x238b('0x74')](_0x238b('0xde'))});}})[_0x238b('0x21')](function(_0x452f80){if(_0x1118af['isMiddleware']){return _0x1a66ef();}else{return BPromise[_0x238b('0xe6')](_0x452f80)[_0x238b('0x21')](respondWithResult(_0x3b2fe1,null));}})[_0x238b('0x62')](handleError(_0x3b2fe1,null));};exports[_0x238b('0xe7')]=function(_0x5982d2,_0x22f3f6,_0x374a66){var _0x1ea82f;return db['User']['find']({'where':{'id':_0x5982d2['params']['id'],'role':_0x238b('0x39')},'attributes':['id',_0x238b('0x42'),_0x238b('0x40')]})[_0x238b('0x21')](handleEntityNotFound(_0x22f3f6,null))[_0x238b('0x21')](function(_0x3f9688){if(_0x3f9688){_0x1ea82f=_0x3f9688;return db[_0x238b('0xaa')][_0x238b('0x34')]({'where':{'membername':_0x1ea82f[_0x238b('0x42')]},'individualHooks':!![]});}})['then'](function(){return db[_0x238b('0xdc')][_0x238b('0x60')]({'where':{'membername':_0x1ea82f['name'],'exitAt':null}});})[_0x238b('0x21')](function(_0x594026){var _0x43594d=[];_0x594026[_0x238b('0xdd')](function(_0x5dbd7d){_0x43594d[_0x238b('0xa7')](_0x5dbd7d['update']({'exitAt':moment()[_0x238b('0x74')](_0x238b('0xde'))}));});return BPromise['all'](_0x43594d);})[_0x238b('0x21')](function(){return _0x1ea82f['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x238b('0x21')](respondWithResult(_0x22f3f6,null))[_0x238b('0x62')](handleError(_0x22f3f6,null));};exports[_0x238b('0xe8')]=function(_0x344e81,_0x1c1269,_0x1c128a){var _0x98af74;return db[_0x238b('0xaa')][_0x238b('0x33')]({'paused':0x1},{'where':{'UserId':_0x344e81[_0x238b('0x64')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x238b('0x48')][_0x238b('0x41')]({'where':{'id':_0x344e81[_0x238b('0x64')]['id'],'role':_0x238b('0x39')},'attributes':['id',_0x238b('0x42'),_0x238b('0x40'),_0x238b('0x77'),_0x238b('0xa8')]});})['then'](handleEntityNotFound(_0x1c1269,null))[_0x238b('0x21')](function(_0x1fa8be){if(_0x1fa8be){_0x98af74=_0x1fa8be;return respondWithRpcPromise(_0x238b('0xe9'),'pause',{'id':_0x98af74['id'],'name':_0x98af74['name'],'pause':!![]});}})[_0x238b('0x21')](function(){if(_0x98af74){return db[_0x238b('0xdc')]['findAll']({'where':{'membername':_0x98af74[_0x238b('0x42')],'type':_0x238b('0xe3'),'exitAt':null}});}})[_0x238b('0x21')](function(_0x31d2e6){if(_0x31d2e6[_0x238b('0x53')]){var _0xdd9c4e=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3483c7=0x0,_0x575f68=_0x31d2e6[_0x238b('0x53')];_0x3483c7<_0x575f68;_0x3483c7++){_0x31d2e6[_0x3483c7][_0x238b('0xea')]({'exitAt':_0xdd9c4e});}}})[_0x238b('0x21')](function(){var _0x376634=[];var _0x188a97=utils[_0x238b('0xe0')]();_0x188a97[_0x238b('0xdd')](function(_0x54eb3f){_0x376634[_0x238b('0xa7')]({'channel':_0x54eb3f,'membername':_0x98af74[_0x238b('0x42')],'interface':_[_0x238b('0x7c')](_0x98af74[_0x238b('0xa8')])?util[_0x238b('0x74')]('SIP/%s',_0x98af74[_0x238b('0x42')]):_0x98af74[_0x238b('0xa8')],'type':_0x238b('0xe3'),'enterAt':moment()[_0x238b('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x344e81[_0x238b('0x69')]['type']||_0x238b('0xeb'),'role':_0x98af74[_0x238b('0x40')],'internal':_0x98af74[_0x238b('0x77')]});});return db[_0x238b('0xdc')]['bulkCreate'](_0x376634,{'individualHooks':!![]});})[_0x238b('0x21')](function(){return _0x98af74[_0x238b('0x33')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x344e81[_0x238b('0x69')][_0x238b('0x4a')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x238b('0x74')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x1c1269,null))['catch'](handleError(_0x1c1269,null));};exports[_0x238b('0xec')]=function(_0x22f049,_0x7dc378,_0xcddcfe){var _0x2bfa32;return db[_0x238b('0x48')][_0x238b('0x41')]({'where':{'id':_0x22f049['params']['id']},'attributes':['id',_0x238b('0x42'),_0x238b('0x40'),_0x238b('0x9d'),_0x238b('0xed'),_0x238b('0xee'),'faxPause','openchannelPause',_0x238b('0xef'),_0x238b('0xf0'),_0x238b('0xf1')]})[_0x238b('0x21')](handleEntityNotFound(_0x7dc378,null))[_0x238b('0x21')](function(_0x3c2ece){if(_0x3c2ece){_0x2bfa32=_0x3c2ece;if(_0x22f049['body'][_0x238b('0x9b')]&&!utils[_0x238b('0x9e')](_0x22f049[_0x238b('0x69')]['channel'])){throw new db['Sequelize'][(_0x238b('0x95'))](_0x238b('0x9f'));}switch(_0x22f049[_0x238b('0x69')][_0x238b('0x9b')]){case _0x238b('0xa5'):return respondWithRpcPromise(_0x238b('0xe9'),_0x238b('0xec'),{'id':_0x2bfa32['id'],'name':_0x2bfa32[_0x238b('0x42')],'pause':![]})['then'](function(){return db[_0x238b('0xaa')][_0x238b('0x33')]({'paused':0x0},{'where':{'UserId':_0x2bfa32['id']},'individualHooks':!![]});})[_0x238b('0x21')](function(){return db[_0x238b('0xdc')][_0x238b('0x41')]({'where':{'channel':_0x22f049['body'][_0x238b('0x9b')],'membername':_0x2bfa32[_0x238b('0x42')],'type':_0x238b('0xe3'),'exitAt':null}});})[_0x238b('0x21')](function(_0xbb2f2a){if(_0xbb2f2a){return _0xbb2f2a[_0x238b('0x33')]({'exitAt':moment()[_0x238b('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x238b('0xf2')},{'individualHooks':!![]});}return null;})[_0x238b('0x21')](function(){return _0x2bfa32[_0x238b('0x33')]({'voicePause':![]});});case _0x238b('0xf3'):case'chat':case _0x238b('0xf4'):case _0x238b('0xf5'):case'openchannel':return db[_0x238b('0xdc')][_0x238b('0x41')]({'where':{'channel':_0x22f049['body']['channel'],'membername':_0x2bfa32[_0x238b('0x42')],'type':_0x238b('0xe3'),'exitAt':null}})[_0x238b('0x21')](function(_0x982bdf){if(_0x982bdf){return _0x982bdf[_0x238b('0x33')]({'exitAt':moment()[_0x238b('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x238b('0xf2')},{'individualHooks':!![]});}return null;})[_0x238b('0x21')](function(){var _0x52117a={};_[_0x238b('0xf6')](_0x52117a,util[_0x238b('0x74')](_0x238b('0xf7'),_0x22f049[_0x238b('0x69')][_0x238b('0x9b')],_0x238b('0xf8')),![]);return _0x2bfa32[_0x238b('0x33')](_0x52117a);});default:return respondWithRpcPromise(_0x238b('0xe9'),_0x238b('0xec'),{'id':_0x2bfa32['id'],'name':_0x2bfa32['name'],'pause':![]})[_0x238b('0x21')](function(){return db['UserVoiceQueueRt'][_0x238b('0x33')]({'paused':0x0},{'where':{'UserId':_0x2bfa32['id']}});})['then'](function(){return db[_0x238b('0xdc')][_0x238b('0x60')]({'where':{'membername':_0x2bfa32[_0x238b('0x42')],'type':_0x238b('0xe3'),'exitAt':null}});})[_0x238b('0x21')](function(_0x27742e){var _0xf54d99=[];_0x27742e['forEach'](function(_0x35cc1b){_0xf54d99[_0x238b('0xa7')](_0x35cc1b[_0x238b('0x33')]({'exitAt':moment()[_0x238b('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'}));});return BPromise[_0x238b('0xdf')](_0xf54d99);})[_0x238b('0x21')](function(){return _0x2bfa32[_0x238b('0x33')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x7dc378,null))[_0x238b('0x62')](handleError(_0x7dc378,null));};exports[_0x238b('0xf9')]=function(_0x5f2447,_0x2693af,_0x1c2da2){var _0x3cd62f={};var _0x2cc1c2={};var _0x1b7915;var _0x114eb6;return db[_0x238b('0x48')][_0x238b('0x92')]({'where':{'id':_0x5f2447[_0x238b('0x64')]['id']}})['then'](handleEntityNotFound(_0x2693af,null))[_0x238b('0x21')](function(_0x45822f){if(_0x45822f){_0x1b7915=_0x45822f;_0x2cc1c2[_0x238b('0x4b')]=_['keys'](db[_0x238b('0xfa')]['rawAttributes']);_0x2cc1c2[_0x238b('0x4d')]=_['keys'](_0x5f2447['query']);_0x2cc1c2[_0x238b('0x4f')]=_['intersection'](_0x2cc1c2[_0x238b('0x4b')],_0x2cc1c2['query']);_0x3cd62f[_0x238b('0x51')]=_['intersection'](_0x2cc1c2[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x5f2447[_0x238b('0x4d')]['fields']));_0x3cd62f['attributes']=_0x3cd62f[_0x238b('0x51')][_0x238b('0x53')]?_0x3cd62f[_0x238b('0x51')]:_0x2cc1c2[_0x238b('0x4b')];_0x3cd62f['order']=qs[_0x238b('0x55')](_0x5f2447[_0x238b('0x4d')][_0x238b('0x55')]);_0x3cd62f['where']=qs['filters'](_[_0x238b('0x57')](_0x5f2447[_0x238b('0x4d')],_0x2cc1c2[_0x238b('0x4f')]));if(_0x5f2447['query'][_0x238b('0x3c')]){_0x3cd62f[_0x238b('0x56')]=_[_0x238b('0x58')](_0x3cd62f['where'],{'$or':_[_0x238b('0x4c')](_0x3cd62f[_0x238b('0x51')],function(_0x247043){var _0x803e11={};_0x803e11[_0x247043]={'$like':'%'+_0x5f2447['query'][_0x238b('0x3c')]+'%'};return _0x803e11;})});}_0x3cd62f=_[_0x238b('0x58')]({},_0x3cd62f,_0x5f2447[_0x238b('0x5d')]);return _0x1b7915[_0x238b('0xf9')](_0x3cd62f);}})[_0x238b('0x21')](function(_0x48a9c6){if(_0x48a9c6){_0x114eb6=_0x48a9c6[_0x238b('0x53')];if(!_0x5f2447['query']['hasOwnProperty'](_0x238b('0xbe'))){_0x3cd62f[_0x238b('0x2f')]=qs['limit'](_0x5f2447['query'][_0x238b('0x2f')]);_0x3cd62f[_0x238b('0x2e')]=qs[_0x238b('0x2e')](_0x5f2447[_0x238b('0x4d')]['offset']);}return _0x1b7915[_0x238b('0xf9')](_0x3cd62f);}})['then'](function(_0x5447b8){if(_0x5447b8){return _0x5447b8?{'count':_0x114eb6,'rows':_0x5447b8}:null;}})[_0x238b('0x21')](respondWithResult(_0x2693af,null))[_0x238b('0x62')](handleError(_0x2693af,null));};exports[_0x238b('0xfb')]=function(_0x4310a4,_0x1ab91a){return db[_0x238b('0x48')][_0x238b('0x41')]({'where':{'id':_0x4310a4[_0x238b('0x64')]['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x1ab91a,null))[_0x238b('0x21')](function(_0xf10c8e){if(_0xf10c8e){var _0xb6845d=_0xf10c8e[_0x238b('0x35')]({'plain':!![]});return _0xf10c8e['addTeams'](_0x4310a4[_0x238b('0x69')][_0x238b('0x6c')],_[_0x238b('0x6d')](_0x4310a4[_0x238b('0x69')],[_0x238b('0x6c'),'id'])||{})[_0x238b('0x21')](function(){for(var _0x118211=0x0;_0x118211<_0x4310a4[_0x238b('0x69')][_0x238b('0x6c')][_0x238b('0x53')];_0x118211++){var _0x50aebd=[];db[_0x238b('0xfa')][_0x238b('0x92')]({'where':{'id':_0x4310a4[_0x238b('0x69')][_0x238b('0x6c')][_0x118211]}})[_0x238b('0x21')](function(_0x321503){_0x50aebd['push'](_0x321503['getVoiceQueues']()[_0x238b('0x21')](function(_0x163b80){for(var _0x1d75bf=0x0;_0x1d75bf<_0x163b80['length'];_0x1d75bf++){_0x163b80[_0x1d75bf]['setDataValue'](_0x238b('0x9b'),'Voice');}return _0x163b80;}));_0x50aebd['push'](_0x321503[_0x238b('0xfc')]()['then'](function(_0x15123c){for(var _0x40ff99=0x0;_0x40ff99<_0x15123c[_0x238b('0x53')];_0x40ff99++){_0x15123c[_0x40ff99][_0x238b('0xfd')](_0x238b('0x9b'),'Chat');}return _0x15123c;}));_0x50aebd['push'](_0x321503[_0x238b('0xfe')]()[_0x238b('0x21')](function(_0x5b0475){for(var _0x315430=0x0;_0x315430<_0x5b0475[_0x238b('0x53')];_0x315430++){_0x5b0475[_0x315430][_0x238b('0xfd')]('channel','Mail');}return _0x5b0475;}));_0x50aebd[_0x238b('0xa7')](_0x321503[_0x238b('0xff')]()[_0x238b('0x21')](function(_0x42f829){for(var _0x563ef3=0x0;_0x563ef3<_0x42f829[_0x238b('0x53')];_0x563ef3++){_0x42f829[_0x563ef3][_0x238b('0xfd')](_0x238b('0x9b'),_0x238b('0x100'));}return _0x42f829;}));_0x50aebd[_0x238b('0xa7')](_0x321503[_0x238b('0x101')]()[_0x238b('0x21')](function(_0x46acef){for(var _0x43adfc=0x0;_0x43adfc<_0x46acef['length'];_0x43adfc++){_0x46acef[_0x43adfc]['setDataValue'](_0x238b('0x9b'),_0x238b('0x102'));}return _0x46acef;}));_0x50aebd[_0x238b('0xa7')](_0x321503[_0x238b('0x103')]()['then'](function(_0x148bad){for(var _0x4c8b3b=0x0;_0x4c8b3b<_0x148bad[_0x238b('0x53')];_0x4c8b3b++){_0x148bad[_0x4c8b3b]['setDataValue'](_0x238b('0x9b'),_0x238b('0x104'));}return _0x148bad;}));return BPromise[_0x238b('0xdf')](_0x50aebd);})[_0x238b('0x21')](function(_0xc08238){var _0x23b571=_[_0x238b('0x105')](_0xc08238);_0x50aebd=[];return db[_0x238b('0x5a')][_0x238b('0x106')](function(_0x1ad406){for(var _0x122933=0x0;_0x122933<_0x23b571[_0x238b('0x53')];_0x122933++){_0x50aebd[_0x238b('0xa7')](_0x23b571[_0x122933][_0x238b('0x107')](_0xb6845d['id']),{'transaction':_0x1ad406});}return BPromise[_0x238b('0xdf')](_0x50aebd)[_0x238b('0x21')](function(){if(_0xb6845d['online']){return BPromise[_0x238b('0xa9')](_['filter'](_0x23b571,function(_0x20109d){return _0x20109d[_0x238b('0x108')](_0x238b('0x9b'))===_0x238b('0x109');}),function(_0x8d3cc2){return db[_0x238b('0xaa')][_0x238b('0xab')]({'membername':_0xb6845d['name'],'UserId':_0xb6845d['id'],'queue_name':_0x8d3cc2[_0x238b('0x42')],'VoiceQueueId':_0x8d3cc2['id'],'interface':_[_0x238b('0x7c')](_0xb6845d[_0x238b('0xa8')])?util[_0x238b('0x74')](_0x238b('0xd3'),_0xb6845d[_0x238b('0x42')]):_0xb6845d['interface'],'paused':_0xb6845d[_0x238b('0x9d')]||![],'penalty':_0xb6845d[_0x238b('0xa2')]},{'transaction':_0x1ad406});});}else{return;}})[_0x238b('0x21')](function(){for(var _0x1048a2=0x0;_0x1048a2<_0x23b571['length'];_0x1048a2++){var _0x21b5d5=_0x23b571[_0x1048a2][_0x238b('0x108')]('channel');var _0x3f7e0d=_0x21b5d5+_0x238b('0x10a');socket['emit'](_0x238b('0x37')+_0x21b5d5+_0x238b('0x10b'),{'UserId':_0xb6845d['id'],['queueField']:_0x23b571[_0x1048a2]['id']});}});});});}});}})[_0x238b('0x21')](respondWithStatusCode(_0x1ab91a,null))[_0x238b('0x62')](handleError(_0x1ab91a,null));};exports[_0x238b('0x10c')]=function(_0x9bc725,_0x4d5dbb){return db[_0x238b('0x48')]['findOne']({'where':{'id':_0x9bc725['params']['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x4d5dbb,null))[_0x238b('0x21')](function(_0x3b65d2){if(_0x3b65d2){var _0x25b38f=_0x3b65d2[_0x238b('0x35')]({'plain':!![]});var _0x516458=_0x9bc725['query'][_0x238b('0x6c')];return _0x3b65d2['removeTeams'](_0x516458)[_0x238b('0x21')](function(){for(var _0x272a64=0x0;_0x272a64<_0x516458[_0x238b('0x53')];_0x272a64++){var _0x53f178=[];db[_0x238b('0xfa')][_0x238b('0x92')]({'where':{'id':_0x516458[_0x272a64]}})['then'](function(_0x3993de){_0x53f178[_0x238b('0xa7')](_0x3993de[_0x238b('0xda')]()['then'](function(_0x55e8e8){for(var _0x5f2491=0x0;_0x5f2491<_0x55e8e8[_0x238b('0x53')];_0x5f2491++){_0x55e8e8[_0x5f2491][_0x238b('0xfd')](_0x238b('0x9b'),_0x238b('0x109'));}return _0x55e8e8;}));_0x53f178['push'](_0x3993de[_0x238b('0xfc')]()[_0x238b('0x21')](function(_0x2f2cbf){for(var _0x59e40d=0x0;_0x59e40d<_0x2f2cbf[_0x238b('0x53')];_0x59e40d++){_0x2f2cbf[_0x59e40d][_0x238b('0xfd')](_0x238b('0x9b'),_0x238b('0x10d'));}return _0x2f2cbf;}));_0x53f178[_0x238b('0xa7')](_0x3993de[_0x238b('0xfe')]()[_0x238b('0x21')](function(_0x59e6c5){for(var _0x2e1064=0x0;_0x2e1064<_0x59e6c5['length'];_0x2e1064++){_0x59e6c5[_0x2e1064][_0x238b('0xfd')](_0x238b('0x9b'),_0x238b('0x10e'));}return _0x59e6c5;}));_0x53f178['push'](_0x3993de['getSmsQueues']()[_0x238b('0x21')](function(_0x140089){for(var _0x2d810e=0x0;_0x2d810e<_0x140089[_0x238b('0x53')];_0x2d810e++){_0x140089[_0x2d810e][_0x238b('0xfd')](_0x238b('0x9b'),_0x238b('0x100'));}return _0x140089;}));_0x53f178[_0x238b('0xa7')](_0x3993de['getFaxQueues']()[_0x238b('0x21')](function(_0x5ae98e){for(var _0x3db7cc=0x0;_0x3db7cc<_0x5ae98e['length'];_0x3db7cc++){_0x5ae98e[_0x3db7cc][_0x238b('0xfd')](_0x238b('0x9b'),_0x238b('0x102'));}return _0x5ae98e;}));_0x53f178[_0x238b('0xa7')](_0x3993de[_0x238b('0x103')]()[_0x238b('0x21')](function(_0x1efba6){for(var _0x529a02=0x0;_0x529a02<_0x1efba6[_0x238b('0x53')];_0x529a02++){_0x1efba6[_0x529a02][_0x238b('0xfd')](_0x238b('0x9b'),_0x238b('0x104'));}return _0x1efba6;}));return BPromise[_0x238b('0xdf')](_0x53f178);})['then'](function(_0x5226af){var _0x21d52b=_['flatten'](_0x5226af);_0x53f178=[];return db[_0x238b('0x5a')][_0x238b('0x106')](function(_0x5bb0b7){for(var _0x491ea5=0x0;_0x491ea5<_0x21d52b[_0x238b('0x53')];_0x491ea5++){_0x53f178[_0x238b('0xa7')](_0x21d52b[_0x491ea5][_0x238b('0x10f')](_0x25b38f['id']),{'transaction':_0x5bb0b7});}return BPromise[_0x238b('0xdf')](_0x53f178)[_0x238b('0x21')](function(){if(_0x25b38f[_0x238b('0xa6')]){return BPromise[_0x238b('0xa9')](_['filter'](_0x21d52b,function(_0x3d197c){return _0x3d197c[_0x238b('0x108')](_0x238b('0x9b'))===_0x238b('0x109');}),function(_0x102f5e){return db[_0x238b('0xaa')][_0x238b('0x34')]({'where':{'VoiceQueueId':_0x102f5e['id'],'UserId':_0x25b38f['id']},'transaction':_0x5bb0b7});});}else{return;}})['then'](function(){for(var _0x457ff4=0x0;_0x457ff4<_0x21d52b['length'];_0x457ff4++){var _0x2faef6=_0x21d52b[_0x457ff4][_0x238b('0x108')](_0x238b('0x9b'));var _0x36ceca=_0x2faef6+_0x238b('0x10a');socket['emit']('user'+_0x2faef6+'Queue:remove',{'UserId':_0x25b38f['id'],['queueField']:_0x21d52b[_0x457ff4]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x4d5dbb,null))[_0x238b('0x62')](handleError(_0x4d5dbb,null));};exports[_0x238b('0x110')]=function(_0x1731f6,_0x2f19bb,_0x56f95a){var _0x3662b1={};var _0x43aff4={};var _0x5eedb0;var _0x39629d;return db[_0x238b('0x48')][_0x238b('0x92')]({'where':{'id':_0x1731f6[_0x238b('0x64')]['id']}})['then'](handleEntityNotFound(_0x2f19bb,null))['then'](function(_0x258378){if(_0x258378){_0x5eedb0=_0x258378;_0x43aff4[_0x238b('0x4b')]=_['keys'](db[_0x238b('0xb9')]['rawAttributes']);_0x43aff4[_0x238b('0x4d')]=_['keys'](_0x1731f6[_0x238b('0x4d')]);_0x43aff4['filters']=_[_0x238b('0x50')](_0x43aff4[_0x238b('0x4b')],_0x43aff4[_0x238b('0x4d')]);_0x3662b1[_0x238b('0x51')]=_[_0x238b('0x50')](_0x43aff4[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x1731f6[_0x238b('0x4d')][_0x238b('0x52')]));_0x3662b1['attributes']=_0x3662b1['attributes'][_0x238b('0x53')]?_0x3662b1[_0x238b('0x51')]:_0x43aff4[_0x238b('0x4b')];_0x3662b1[_0x238b('0x54')]=qs[_0x238b('0x55')](_0x1731f6[_0x238b('0x4d')][_0x238b('0x55')]);_0x3662b1['where']=qs[_0x238b('0x4f')](_[_0x238b('0x57')](_0x1731f6[_0x238b('0x4d')],_0x43aff4['filters']));if(_0x1731f6['query']['filter']){_0x3662b1[_0x238b('0x56')]=_[_0x238b('0x58')](_0x3662b1[_0x238b('0x56')],{'$or':_[_0x238b('0x4c')](_0x3662b1['attributes'],function(_0x413a68){var _0x106428={};_0x106428[_0x413a68]={'$like':'%'+_0x1731f6['query'][_0x238b('0x3c')]+'%'};return _0x106428;})});}_0x3662b1=_[_0x238b('0x58')]({},_0x3662b1,_0x1731f6[_0x238b('0x5d')]);return _0x5eedb0['getLists'](_0x3662b1);}})[_0x238b('0x21')](function(_0x1f2859){if(_0x1f2859){_0x39629d=_0x1f2859[_0x238b('0x53')];if(!_0x1731f6['query'][_0x238b('0xb8')](_0x238b('0xbe'))){_0x3662b1[_0x238b('0x2f')]=qs['limit'](_0x1731f6[_0x238b('0x4d')][_0x238b('0x2f')]);_0x3662b1[_0x238b('0x2e')]=qs[_0x238b('0x2e')](_0x1731f6[_0x238b('0x4d')][_0x238b('0x2e')]);}return _0x5eedb0[_0x238b('0x110')](_0x3662b1);}})[_0x238b('0x21')](function(_0x2c9205){if(_0x2c9205){return _0x2c9205?{'count':_0x39629d,'rows':_0x2c9205}:null;}})[_0x238b('0x21')](respondWithResult(_0x2f19bb,null))['catch'](handleError(_0x2f19bb,null));};exports['getAgents']=function(_0x8cb96a,_0x1efaef,_0x4e37c5){var _0x1dfd1f={};var _0x5191df={};var _0x1d75e4;var _0x4bcbda;return db['User'][_0x238b('0x92')]({'where':{'id':_0x8cb96a[_0x238b('0x64')]['id']}})[_0x238b('0x21')](handleEntityNotFound(_0x1efaef,null))[_0x238b('0x21')](function(_0x32cf90){if(_0x32cf90){_0x1d75e4=_0x32cf90;_0x5191df[_0x238b('0x4b')]=_[_0x238b('0x4e')](db[_0x238b('0x48')][_0x238b('0x49')]);_0x5191df[_0x238b('0x4d')]=_[_0x238b('0x4e')](_0x8cb96a[_0x238b('0x4d')]);_0x5191df['filters']=_['intersection'](_0x5191df['model'],_0x5191df['query']);_0x1dfd1f[_0x238b('0x51')]=_[_0x238b('0x50')](_0x5191df[_0x238b('0x4b')],qs[_0x238b('0x52')](_0x8cb96a[_0x238b('0x4d')][_0x238b('0x52')]));_0x1dfd1f[_0x238b('0x51')]=_0x1dfd1f[_0x238b('0x51')][_0x238b('0x53')]?_0x1dfd1f['attributes']:_0x5191df['model'];_0x1dfd1f[_0x238b('0x54')]=qs[_0x238b('0x55')](_0x8cb96a[_0x238b('0x4d')][_0x238b('0x55')]);_0x1dfd1f[_0x238b('0x56')]=qs['filters'](_[_0x238b('0x57')](_0x8cb96a['query'],_0x5191df[_0x238b('0x4f')]));if(_0x8cb96a[_0x238b('0x4d')]['filter']){_0x1dfd1f[_0x238b('0x56')]=_[_0x238b('0x58')](_0x1dfd1f[_0x238b('0x56')],{'$or':_[_0x238b('0x4c')](_0x1dfd1f[_0x238b('0x51')],function(_0x202e4c){var _0x3aa50c={};_0x3aa50c[_0x202e4c]={'$like':'%'+_0x8cb96a['query'][_0x238b('0x3c')]+'%'};return _0x3aa50c;})});}_0x1dfd1f['model']=db[_0x238b('0x48')];_0x1dfd1f['as']=_0x238b('0x38');_0x1dfd1f=_[_0x238b('0x58')]({},_0x1dfd1f,_0x8cb96a[_0x238b('0x5d')]);return _0x1d75e4[_0x238b('0xda')]({'include':[_0x1dfd1f]});}})['then'](function(_0x175d28){if(_0x175d28){var _0x4c5658={},_0x16fa68=[],_0x4f878d=0x0;for(var _0x2deeef=0x0;_0x2deeef<_0x175d28['length'];_0x2deeef+=0x1){for(var _0x260efb=0x0,_0x31c438;_0x260efb<_0x175d28[_0x2deeef]['Agents'][_0x238b('0x53')];_0x260efb+=0x1){_0x31c438=_0x175d28[_0x2deeef][_0x238b('0x38')][_0x260efb][_0x238b('0x35')]({'plain':!![]});_0x4c5658[_0x31c438['id']]=_0x31c438;}}_0x4c5658=_[_0x238b('0x111')](_0x4c5658);for(var _0x529bef=qs[_0x238b('0x2e')](_0x8cb96a[_0x238b('0x4d')]['offset']);_0x529bef<_0x4c5658[_0x238b('0x53')]&&_0x16fa68['length']=_0x405baa){_0x5d971d=_0x405baa;_0x2affae=0xc8;}else{_0x2affae=0xce;}_0x39189d['status'](_0x2affae);return _0x39189d['set'](_0xa508('0x33'),_0x3eb26c+'-'+_0x5d971d+'/'+_0x405baa)['json'](_0x21fa3b);}return null;};}function patchUpdates(_0x4fee73){return function(_0xb542d7){try{jsonpatch[_0xa508('0x34')](_0xb542d7,_0x4fee73,!![]);}catch(_0x4a995c){return BPromise[_0xa508('0x35')](_0x4a995c);}return _0xb542d7[_0xa508('0x36')]();};}function saveUpdates(_0x1b94ef,_0x489e27){return function(_0x4a1c45){if(_0x4a1c45){return _0x4a1c45[_0xa508('0x37')](_0x1b94ef)[_0xa508('0x23')](function(_0x2a74dc){return _0x2a74dc;});}return null;};}function removeEntity(_0x20261f,_0x2a8a43){return function(_0x3c07a1){if(_0x3c07a1){return _0x3c07a1[_0xa508('0x38')]()[_0xa508('0x23')](function(){var _0x374293=_0x3c07a1[_0xa508('0x39')]({'plain':!![]});var _0x31b526=[{'name':'Users','value':_0xa508('0x3a'),'ignore':!![]},{'name':_0xa508('0x3b'),'value':_0xa508('0x3c'),'ignore':![]},{'name':_0xa508('0x3d'),'value':'telephone','ignore':![]}];var _0x283d26=_(_0x31b526)[_0xa508('0x3e')](_0xa508('0x3f'))['map'](_0xa508('0x40'))[_0xa508('0x40')]();if(_[_0xa508('0x41')](_0x283d26,_0x374293['role'])){return;}var _0x4cc50e=_[_0xa508('0x42')](_0x31b526,[_0xa508('0x40'),_0x374293[_0xa508('0x43')]])[_0xa508('0x44')];return db['UserProfileResource'][_0xa508('0x38')]({'where':{'type':_0x4cc50e,'resourceId':_0x374293['id']}})[_0xa508('0x23')](function(){return _0x3c07a1;});})[_0xa508('0x23')](function(){_0x20261f[_0xa508('0x2f')](0xcc)[_0xa508('0x2e')]();});}};}function handleEntityNotFound(_0x3438bb,_0x1fdc2b){return function(_0x399191){if(!_0x399191){_0x3438bb[_0xa508('0x2d')](0x194);}return _0x399191;};}function handleError(_0x41c6f8,_0x3d1e10){_0x3d1e10=_0x3d1e10||0x1f4;return function(_0xd4d205){logger['error'](_0xd4d205[_0xa508('0x45')]);if(_0xd4d205[_0xa508('0x44')]){delete _0xd4d205[_0xa508('0x44')];}_0x41c6f8[_0xa508('0x2f')](_0x3d1e10)['send'](_0xd4d205);};}exports[_0xa508('0x46')]=function(_0x34406f,_0x224972){var _0x3326d8={},_0x1aa7d8={},_0x180c0d={'count':0x0,'rows':[]};var _0x3fed24=_[_0xa508('0x47')](db[_0xa508('0x48')][_0xa508('0x49')],function(_0x159351){return{'name':_0x159351[_0xa508('0x4a')],'type':_0x159351[_0xa508('0x4b')]['key']};});_0x1aa7d8[_0xa508('0x4c')]=_['differenceBy'](_[_0xa508('0x47')](_0x3fed24,_0xa508('0x44')),[_0xa508('0x4d'),_0xa508('0x4e')]);_0x1aa7d8[_0xa508('0x4f')]=_[_0xa508('0x50')](_0x34406f[_0xa508('0x4f')]);_0x1aa7d8[_0xa508('0x51')]=_['intersection'](_0x1aa7d8[_0xa508('0x4c')],_0x1aa7d8[_0xa508('0x4f')]);_0x3326d8[_0xa508('0x52')]=_[_0xa508('0x53')](_0x1aa7d8[_0xa508('0x4c')],qs[_0xa508('0x54')](_0x34406f[_0xa508('0x4f')][_0xa508('0x54')]));_0x3326d8[_0xa508('0x52')]=_0x3326d8[_0xa508('0x52')][_0xa508('0x55')]?_0x3326d8[_0xa508('0x52')]:_0x1aa7d8[_0xa508('0x4c')];if(!_0x34406f[_0xa508('0x4f')][_0xa508('0x56')](_0xa508('0x57'))){_0x3326d8[_0xa508('0x32')]=qs[_0xa508('0x32')](_0x34406f[_0xa508('0x4f')][_0xa508('0x32')]);_0x3326d8[_0xa508('0x58')]=qs[_0xa508('0x58')](_0x34406f[_0xa508('0x4f')][_0xa508('0x58')]);}_0x3326d8[_0xa508('0x59')]=qs[_0xa508('0x5a')](_0x34406f['query'][_0xa508('0x5a')]);_0x3326d8[_0xa508('0x5b')]=qs[_0xa508('0x51')](_[_0xa508('0x5c')](_0x34406f[_0xa508('0x4f')],_0x1aa7d8['filters']));if(_0x34406f[_0xa508('0x4f')][_0xa508('0x3e')]){_0x3326d8[_0xa508('0x5b')]=_[_0xa508('0x5d')](_0x3326d8[_0xa508('0x5b')],{'$or':_[_0xa508('0x47')](_0x3fed24,function(_0x3d99ee){if(_0x3d99ee['type']!==_0xa508('0x5e')){return db[_0xa508('0x5f')][_0xa508('0x5b')](db['sequelize']['fn'](_0xa508('0x60'),db[_0xa508('0x5f')][_0xa508('0x61')](_0x3d99ee[_0xa508('0x44')])),{'$like':db[_0xa508('0x5f')]['fn'](_0xa508('0x60'),'%'+_0x34406f[_0xa508('0x4f')][_0xa508('0x3e')]+'%')});}})});}_0x3326d8=_[_0xa508('0x5d')]({},_0x3326d8,_0x34406f['options']);var _0x3a4ec6={'where':_0x3326d8[_0xa508('0x5b')]};return db[_0xa508('0x48')][_0xa508('0x31')](_0x3a4ec6)['then'](function(_0x2ef77e){_0x180c0d[_0xa508('0x31')]=_0x2ef77e;if(_0x34406f[_0xa508('0x4f')]['includeAll']){_0x3326d8[_0xa508('0x62')]=[{'all':!![]}];}return db[_0xa508('0x48')][_0xa508('0x63')](_0x3326d8);})[_0xa508('0x23')](function(_0x378773){_0x180c0d[_0xa508('0x64')]=_0x378773;return _0x180c0d;})[_0xa508('0x23')](respondWithFilteredResult(_0x224972,_0x3326d8))[_0xa508('0x2c')](handleError(_0x224972,null));};exports['show']=function(_0x1240ef,_0x340642){var _0x5184fe={'raw':![],'where':{'id':_0x1240ef['params']['id']}},_0x498915={};_0x498915[_0xa508('0x4c')]=_[_0xa508('0x65')](_[_0xa508('0x50')](db['User'][_0xa508('0x49')]),[_0xa508('0x4d'),_0xa508('0x4e')]);_0x498915[_0xa508('0x4f')]=_['keys'](_0x1240ef['query']);_0x498915[_0xa508('0x51')]=_['intersection'](_0x498915[_0xa508('0x4c')],_0x498915[_0xa508('0x4f')]);_0x5184fe['attributes']=_[_0xa508('0x53')](_0x498915['model'],qs[_0xa508('0x54')](_0x1240ef['query'][_0xa508('0x54')]));_0x5184fe['attributes']=_0x5184fe['attributes'][_0xa508('0x55')]?_0x5184fe['attributes']:_0x498915[_0xa508('0x4c')];if(_0x1240ef[_0xa508('0x4f')]['includeAll']){_0x5184fe[_0xa508('0x62')]=[{'all':!![]}];}_0x5184fe=_[_0xa508('0x5d')]({},_0x5184fe,_0x1240ef[_0xa508('0x66')]);return db[_0xa508('0x48')][_0xa508('0x42')](_0x5184fe)[_0xa508('0x23')](handleEntityNotFound(_0x340642,null))[_0xa508('0x23')](respondWithResult(_0x340642,null))[_0xa508('0x2c')](handleError(_0x340642,null));};exports[_0xa508('0x67')]=function(_0x31387d,_0x177b2e){return db[_0xa508('0x48')][_0xa508('0x67')](_0x31387d[_0xa508('0x68')],{'raw':![],'individualHooks':!![]})[_0xa508('0x23')](respondWithResult(_0x177b2e,0xc9))[_0xa508('0x2c')](handleError(_0x177b2e,null));};exports[_0xa508('0x37')]=function(_0x2c1dcb,_0x1e0f85){if(_0x2c1dcb[_0xa508('0x68')]['id']){delete _0x2c1dcb[_0xa508('0x68')]['id'];}delete _0x2c1dcb[_0xa508('0x68')][_0xa508('0x43')];return db[_0xa508('0x48')]['find']({'where':{'id':_0x2c1dcb[_0xa508('0x69')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x1e0f85,null))[_0xa508('0x23')](saveUpdates(_0x2c1dcb[_0xa508('0x68')],null))[_0xa508('0x23')](respondWithResult(_0x1e0f85,null))[_0xa508('0x2c')](handleError(_0x1e0f85,null));};exports[_0xa508('0x6a')]=function(_0x22a0ba,_0x5d605d){return db[_0xa508('0x48')][_0xa508('0x6a')]()[_0xa508('0x23')](respondWithResult(_0x5d605d,null))[_0xa508('0x2c')](handleError(_0x5d605d,null));};exports[_0xa508('0x6b')]=function(_0x1bf857,_0xcb3675,_0x33aaef){return db['User'][_0xa508('0x42')]({'where':{'id':_0x1bf857[_0xa508('0x69')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0xcb3675,null))[_0xa508('0x23')](function(_0x4ce6a3){if(_0x4ce6a3){return _0x4ce6a3[_0xa508('0x6b')](_0x1bf857[_0xa508('0x68')]['ids'],_[_0xa508('0x6c')](_0x1bf857['body'],[_0xa508('0x6d'),'id'])||{});}})[_0xa508('0x23')](respondWithResult(_0xcb3675,null))['catch'](handleError(_0xcb3675,null));};var getLicense=function(_0x12f815){return new BPromise(function(_0x540a18,_0x6a74cc){var _0x2c67dc=0x0;_0x12f815[_0xa508('0x68')][_0xa508('0x43')]===_0xa508('0x3c')&&_0x540a18(_0xa508('0x6e'));return db[_0xa508('0x48')][_0xa508('0x31')]({'where':{'$or':[{'role':_0x12f815[_0xa508('0x68')]['role']===_0xa508('0x6f')?'telephone':['admin',_0xa508('0x3a')]}]}})[_0xa508('0x23')](function(_0x35880e){_0x2c67dc=_0x35880e;return require(_0xa508('0x70'))['getLicense']();})[_0xa508('0x23')](function(_0x2b71b6){var _0x5cdbc8=_0x12f815[_0xa508('0x68')]['role']===_0xa508('0x6f')?_0xa508('0x71'):_0xa508('0x72');if(!_[_0xa508('0x73')](_0x2b71b6[_0x5cdbc8])&&_0x2c67dc>=_0x2b71b6[_0x5cdbc8]){return _0x6a74cc({'message':_0xa508('0x74')});}return _0x540a18(util['format'](_0xa508('0x75'),_0x5cdbc8,_0x2c67dc));})[_0xa508('0x2c')](function(_0x52f1e3){return _0x6a74cc(_0x52f1e3);});});};exports[_0xa508('0x76')]=function(_0x270cb8,_0x239823){return getLicense(_0x270cb8)[_0xa508('0x23')](function(_0x5f304f){if(!_0x270cb8[_0xa508('0x68')]['internal']){var _0x6d9fdf;return db[_0xa508('0x77')][_0xa508('0x78')](0x1)[_0xa508('0x23')](function(_0x2df27f){return checkPasswordPattern(_0x2df27f,_0x270cb8[_0xa508('0x68')][_0xa508('0x4d')],_0x2df27f[_0xa508('0x79')]);})['then'](function(_0x2f04e4){_0x6d9fdf=_0x2f04e4[_0xa508('0x7a')];return db['User']['max'](_0xa508('0x7b'));})['then'](function(_0x41e9b8){if(_[_0xa508('0x73')](_0x41e9b8)){if(_0x6d9fdf){_0x270cb8[_0xa508('0x68')]['internal']=_0x6d9fdf;}else{_0x270cb8[_0xa508('0x68')][_0xa508('0x7b')]=0x1;}}else{if(_[_0xa508('0x73')](_0x6d9fdf)||_0x6d9fdf==_0x41e9b8){_0x270cb8[_0xa508('0x68')][_0xa508('0x7b')]=_0x41e9b8+0x1;}else if(_0x6d9fdf>_0x41e9b8){_0x270cb8[_0xa508('0x68')][_0xa508('0x7b')]=_0x6d9fdf;}else{return db[_0xa508('0x5f')][_0xa508('0x4f')](_0xa508('0x7c'),{'type':db[_0xa508('0x5f')][_0xa508('0x7d')]['SELECT']})[_0xa508('0x23')](function(_0x2e16a4){if(_0x2e16a4&&_0x2e16a4['length']){for(var _0x7733e8=0x0,_0xcfb60d=_0x2e16a4[_0xa508('0x55')];_0x7733e8<_0xcfb60d&&_[_0xa508('0x73')](_0x270cb8[_0xa508('0x68')]['internal']);_0x7733e8++){if(_0x6d9fdf<=_0x2e16a4[_0x7733e8][_0xa508('0x7e')]){_0x270cb8['body'][_0xa508('0x7b')]=_0x2e16a4[_0x7733e8][_0xa508('0x7e')];}else if(_0x6d9fdf>_0x2e16a4[_0x7733e8][_0xa508('0x7e')]&&_0x6d9fdf<=_0x2e16a4[_0x7733e8]['to']){_0x270cb8[_0xa508('0x68')]['internal']=_0x6d9fdf;}}}if(_[_0xa508('0x73')](_0x270cb8[_0xa508('0x68')][_0xa508('0x7b')])){_0x270cb8[_0xa508('0x68')]['internal']=_0x41e9b8+0x1;}});}}});}})[_0xa508('0x23')](function(){if(_0x270cb8[_0xa508('0x68')][_0xa508('0x7f')]){_0x270cb8[_0xa508('0x68')]['mailbox']=_0x270cb8[_0xa508('0x68')]['internal'];_0x270cb8[_0xa508('0x68')][_0xa508('0x80')]={'mailbox':_0x270cb8[_0xa508('0x68')][_0xa508('0x7b')],'password':_0x270cb8[_0xa508('0x68')][_0xa508('0x4d')],'fullname':_0x270cb8[_0xa508('0x68')]['fullname'],'email':_0x270cb8[_0xa508('0x68')][_0xa508('0x81')]};}if(_0x270cb8[_0xa508('0x68')]&&_0x270cb8[_0xa508('0x68')][_0xa508('0x43')]==='agent'){_0x270cb8[_0xa508('0x68')]['permissions']=[_0xa508('0x82'),_0xa508('0x83'),_0xa508('0x84'),_0xa508('0x85'),_0xa508('0x86'),_0xa508('0x87'),_0xa508('0x88'),_0xa508('0x89'),_0xa508('0x8a'),_0xa508('0x8b'),_0xa508('0x8c'),_0xa508('0x8d')];}return db['User']['create'](_0x270cb8[_0xa508('0x68')],{'include':[{'model':db[_0xa508('0x80')],'as':_0xa508('0x80')}]});})[_0xa508('0x23')](function(_0x380514){if(_0x270cb8[_0xa508('0x68')][_0xa508('0x43')]==='user')return _0x380514;var _0x44d56e=_0x270cb8['user'][_0xa508('0x39')]({'plain':!![]});if(!_0x44d56e)throw new Error(_0xa508('0x8e'));if(_0x44d56e[_0xa508('0x43')]==='user'){var _0x3c3d73=_0x380514[_0xa508('0x39')]({'plain':!![]});var _0x36a8a4=[{'name':'Agents','value':_0xa508('0x3c')},{'name':_0xa508('0x3d'),'value':_0xa508('0x6f')}];var _0x203eda=_[_0xa508('0x42')](_0x36a8a4,['value',_0x3c3d73['role']])[_0xa508('0x44')];return db[_0xa508('0x8f')][_0xa508('0x42')]({'where':{'name':_0x203eda,'userProfileId':_0x44d56e['userProfileId']},'raw':!![]})[_0xa508('0x23')](function(_0x335992){if(_0x335992&&_0x335992[_0xa508('0x90')]===0x0){return db[_0xa508('0x91')][_0xa508('0x76')]({'name':_0x3c3d73[_0xa508('0x44')],'resourceId':_0x3c3d73['id'],'type':_0x335992[_0xa508('0x44')],'sectionId':_0x335992['id']},{})[_0xa508('0x23')](function(){return _0x380514;});}else{return _0x380514;}})[_0xa508('0x2c')](function(_0x305ee0){logger[_0xa508('0x29')](_0xa508('0x92'),_0x305ee0);throw _0x305ee0;});}return _0x380514;})[_0xa508('0x23')](respondWithResult(_0x239823,0xc9))[_0xa508('0x2c')](handleError(_0x239823,null));};exports[_0xa508('0x93')]=function(_0x19c2f0,_0x12f395,_0x70657c){var _0x26e773=![];if(_0x19c2f0[_0xa508('0x68')]['id']){delete _0x19c2f0[_0xa508('0x68')]['id'];}return db[_0xa508('0x77')]['findOne']({'attributes':['id',_0xa508('0x79')]})[_0xa508('0x23')](function(_0x5e09d7){_0x26e773=_0x5e09d7['securePassword'];return db['User']['find']({'where':{'id':_0x19c2f0['params']['id']}});})[_0xa508('0x23')](function(_0x1e55a4){if(_0x1e55a4){if(_0x1e55a4['id']==_0x19c2f0[_0xa508('0x3a')]['id']){if(!_0x19c2f0['body'][_0xa508('0x94')]||!_0x19c2f0['body'][_0xa508('0x95')]){throw new db[(_0xa508('0x1f'))][(_0xa508('0x20'))](_0xa508('0x96'));}if(!_0x1e55a4['authenticate'](_0x19c2f0[_0xa508('0x68')][_0xa508('0x94')])){throw new db[(_0xa508('0x1f'))][(_0xa508('0x20'))](_0xa508('0x97'));}if(_0x19c2f0[_0xa508('0x68')][_0xa508('0x94')]==_0x19c2f0[_0xa508('0x68')][_0xa508('0x95')]){throw new db[(_0xa508('0x1f'))][(_0xa508('0x20'))](_0xa508('0x98'));}return _0x1e55a4;}else if(_0x19c2f0['user'][_0xa508('0x43')]==_0xa508('0x99')){if(!_0x19c2f0[_0xa508('0x68')][_0xa508('0x95')]){throw new db['Sequelize'][(_0xa508('0x20'))](_0xa508('0x9a'));}return _0x1e55a4;}else if(_0x19c2f0[_0xa508('0x3a')][_0xa508('0x43')]==_0xa508('0x3a')){if(!_0x19c2f0[_0xa508('0x68')][_0xa508('0x95')]){throw new db[(_0xa508('0x1f'))][(_0xa508('0x20'))](_0xa508('0x9a'));}if(_0x1e55a4[_0xa508('0x43')]!='agent'){throw new db[(_0xa508('0x1f'))][(_0xa508('0x20'))](_0xa508('0x9b'));}return _0x1e55a4;}else{throw new db[(_0xa508('0x1f'))][(_0xa508('0x20'))](_0xa508('0x9b'));}}return null;})[_0xa508('0x23')](handleEntityNotFound(_0x12f395,null))[_0xa508('0x23')](function(_0x127645){return checkPasswordPattern(_0x127645,_0x19c2f0[_0xa508('0x68')][_0xa508('0x95')],_0x26e773);})['then'](saveUpdates({'password':_0x19c2f0[_0xa508('0x68')][_0xa508('0x95')],'passwordResetAt':_0x19c2f0[_0xa508('0x3a')]['id']==_0x19c2f0[_0xa508('0x69')]['id']?moment():null},null))[_0xa508('0x23')](respondWithResult(_0x12f395,null))[_0xa508('0x2c')](handleError(_0x12f395,null));};exports[_0xa508('0x9c')]=function(_0x5e0c66,_0x470d51,_0x42a3e7){var _0x394767=_0x5e0c66['body'][_0xa508('0x9d')];return db[_0xa508('0x48')]['find']({'where':{'id':_0x5e0c66[_0xa508('0x69')]['id']},'attributes':['id',_0xa508('0x44'),_0xa508('0x43'),'online',_0xa508('0x9e'),_0xa508('0x9f'),'interface']})['then'](handleEntityNotFound(_0x470d51,null))[_0xa508('0x23')](function(_0x7914c0){if(_0x7914c0){if(!utils['isValidChannel'](_0x394767)){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x7914c0['add'+_[_0xa508('0xa0')](_0x394767[_0xa508('0xa1')]())+_0xa508('0xa2')](_0x5e0c66[_0xa508('0x68')]['ids'],{'penalty':_0x5e0c66[_0xa508('0x68')][_0xa508('0xa3')]||0x0})[_0xa508('0xa4')](function(_0x2a1f47){for(var _0x19d6ca=0x0;_0x19d6ca<_0x5e0c66[_0xa508('0x68')]['ids']['length'];_0x19d6ca+=0x1){var _0x2105b1={'UserId':_0x5e0c66[_0xa508('0x69')]['id']};_0x2105b1[_[_0xa508('0xa0')](_0x394767['toLowerCase']())+_0xa508('0xa5')]=_0x5e0c66[_0xa508('0x68')][_0xa508('0x6d')][_0x19d6ca];socket[_0xa508('0xa6')](_0xa508('0x3a')+_[_0xa508('0xa0')](_0x394767[_0xa508('0xa1')]())+_0xa508('0xa7'),_0x2105b1);}return _0x2a1f47;})['then'](function(){if(_0x394767===_0xa508('0xa8')){return db[_0xa508('0xa9')][_0xa508('0x63')]({'where':{'id':_0x5e0c66[_0xa508('0x68')][_0xa508('0x6d')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xa508('0x23')](function(_0x393029){var _0x2c1b3c=_0x7914c0[_0xa508('0x39')]({'plain':!![]});var _0x16ca0f=[];if(_0x394767==='voice'&&_0x2c1b3c['role']===_0xa508('0x3c')&&_0x2c1b3c[_0xa508('0xaa')]){for(var _0x1e6744=0x0;_0x1e6744<_0x393029[_0xa508('0x55')];_0x1e6744+=0x1){_0x16ca0f[_0xa508('0xab')]({'membername':_0x2c1b3c[_0xa508('0x44')],'UserId':_0x2c1b3c['id'],'queue_name':_0x393029[_0x1e6744][_0xa508('0x44')],'VoiceQueueId':_0x393029[_0x1e6744]['id'],'interface':_[_0xa508('0x73')](_0x2c1b3c[_0xa508('0xac')])?util[_0xa508('0xad')](_0xa508('0xae'),_0x2c1b3c[_0xa508('0x44')]):_0x2c1b3c[_0xa508('0xac')],'paused':_0x2c1b3c[_0xa508('0x9f')]||![],'penalty':_0x5e0c66['body'][_0xa508('0xa3')]||0x0});}return BPromise[_0xa508('0xaf')](_0x16ca0f,function(_0x4ba9a3){return db[_0xa508('0xb0')][_0xa508('0xb1')](_0x4ba9a3);});}return _0x7914c0;});}})['then'](respondWithStatusCode(_0x470d51,null))['catch'](handleError(_0x470d51,null));};exports['removeQueues']=function(_0x3ba0f5,_0x42d8e7,_0x12b110){var _0x548bf0;return db['User'][_0xa508('0x42')]({'where':{'id':_0x3ba0f5['params']['id']},'attributes':['id',_0xa508('0x44'),'role']})[_0xa508('0x23')](handleEntityNotFound(_0x42d8e7,null))['then'](function(_0x2df65c){if(_0x2df65c){_0x548bf0=_0x2df65c;if(!_0x3ba0f5[_0xa508('0x4f')]['channel']||!utils[_0xa508('0xb2')](_0x3ba0f5[_0xa508('0x4f')][_0xa508('0x9d')])){throw new db[(_0xa508('0x1f'))][(_0xa508('0x20'))]('Unknown\x20channel');}return _0x2df65c[_0xa508('0xb3')+_[_0xa508('0xa0')](_0x3ba0f5['query'][_0xa508('0x9d')][_0xa508('0xa1')]())+_0xa508('0xa2')](_0x3ba0f5['query']['ids']);}})[_0xa508('0x23')](function(_0x2a2319){for(var _0x1f6b7e=0x0;_0x1f6b7e<_0x3ba0f5['query'][_0xa508('0x6d')][_0xa508('0x55')];_0x1f6b7e+=0x1){var _0x459763={'UserId':_0x3ba0f5['params']['id']};_0x459763[_[_0xa508('0xa0')](_0x3ba0f5['query'][_0xa508('0x9d')]['toLowerCase']())+_0xa508('0xa5')]=_0x3ba0f5[_0xa508('0x4f')][_0xa508('0x6d')][_0x1f6b7e];socket['emit'](_0xa508('0x3a')+_[_0xa508('0xa0')](_0x3ba0f5['query'][_0xa508('0x9d')][_0xa508('0xa1')]())+_0xa508('0xb4'),_0x459763);}return _0x2a2319;})[_0xa508('0x23')](function(){if(_0x3ba0f5[_0xa508('0x4f')][_0xa508('0x9d')]===_0xa508('0xa8')){return db[_0xa508('0xb0')][_0xa508('0x38')]({'where':{'UserId':_0x3ba0f5[_0xa508('0x69')]['id'],'VoiceQueueId':_0x3ba0f5[_0xa508('0x4f')][_0xa508('0x6d')]},'individualHooks':!![]})['then'](function(){return _0x548bf0;});}return _0x548bf0;})[_0xa508('0x23')](respondWithStatusCode(_0x42d8e7,null))[_0xa508('0x2c')](handleError(_0x42d8e7,null));};exports[_0xa508('0xb5')]=function(_0x38ab39,_0x1d0a87,_0x2e2f68){_0x38ab39[_0xa508('0x68')][_0xa508('0xb6')]=_0x38ab39[_0xa508('0xb7')]['filename'];return db[_0xa508('0x48')][_0xa508('0x42')]({'where':{'id':_0x38ab39[_0xa508('0x69')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x1d0a87,null))['then'](saveUpdates(_0x38ab39['body'],null))[_0xa508('0x23')](respondWithResult(_0x1d0a87,null))['catch'](handleError(_0x1d0a87,null));};exports['getAvatar']=function(_0x129469,_0x1a1c30,_0x1ea869){var _0x2c2bf8=path[_0xa508('0xb8')](config[_0xa508('0xb9')],'server/files/images/logos/default_profile.png');return db['User'][_0xa508('0x42')]({'where':{'id':_0x129469['params']['id']},'attributes':['id',_0xa508('0xb6')],'raw':!![]})[_0xa508('0x23')](handleEntityNotFound(_0x1a1c30,null))[_0xa508('0x23')](function(_0x365c78){if(_0x365c78){if(_[_0xa508('0x73')](_0x365c78[_0xa508('0xb6')])){return _0x1a1c30[_0xa508('0xba')](_0x2c2bf8);}else{if(!fs['existsSync'](path['join'](config[_0xa508('0xb9')],_0xa508('0xbb'),_0x365c78[_0xa508('0xb6')]))){return _0x1a1c30[_0xa508('0xba')](_0x2c2bf8);}return _0x1a1c30['download'](path[_0xa508('0xb8')](config['root'],'server/files/images/',_0x365c78['userpic']));}}})[_0xa508('0x2c')](handleError(_0x1a1c30,null));};exports[_0xa508('0xbc')]=function(_0x3be09e,_0x17fbd8,_0x19a669){var _0x50855a={};var _0x16004e={};var _0xd023c4;var _0x311565;return db[_0xa508('0x48')][_0xa508('0xbd')]({'where':{'id':_0x3be09e['params']['id']}})['then'](handleEntityNotFound(_0x17fbd8,null))[_0xa508('0x23')](function(_0x250871){if(_0x250871){_0xd023c4=_0x250871;_0x16004e['model']=_[_0xa508('0x50')](db[_0xa508('0xbe')]['rawAttributes']);_0x16004e[_0xa508('0x4f')]=_['keys'](_0x3be09e[_0xa508('0x4f')]);_0x16004e[_0xa508('0x51')]=_[_0xa508('0x53')](_0x16004e[_0xa508('0x4c')],_0x16004e[_0xa508('0x4f')]);_0x50855a[_0xa508('0x52')]=_[_0xa508('0x53')](_0x16004e[_0xa508('0x4c')],qs['fields'](_0x3be09e[_0xa508('0x4f')][_0xa508('0x54')]));_0x50855a[_0xa508('0x52')]=_0x50855a[_0xa508('0x52')]['length']?_0x50855a[_0xa508('0x52')]:_0x16004e[_0xa508('0x4c')];_0x50855a['order']=qs['sort'](_0x3be09e['query'][_0xa508('0x5a')]);_0x50855a['where']=qs['filters'](_[_0xa508('0x5c')](_0x3be09e[_0xa508('0x4f')],_0x16004e['filters']));if(_0x3be09e[_0xa508('0x4f')][_0xa508('0x3e')]){_0x50855a[_0xa508('0x5b')]=_[_0xa508('0x5d')](_0x50855a[_0xa508('0x5b')],{'$or':_['map'](_0x50855a['attributes'],function(_0x1d193a){var _0xfe8d95={};_0xfe8d95[_0x1d193a]={'$like':'%'+_0x3be09e['query']['filter']+'%'};return _0xfe8d95;})});}_0x50855a=_[_0xa508('0x5d')]({},_0x50855a,_0x3be09e[_0xa508('0x66')]);return _0xd023c4['getContacts'](_0x50855a);}})['then'](function(_0x18caaf){if(_0x18caaf){_0x311565=_0x18caaf[_0xa508('0x55')];if(_0x3be09e[_0xa508('0x4f')][_0xa508('0x56')](_0xa508('0xbf'))){_0x50855a['include']=[{'model':db[_0xa508('0xc0')],'as':_0xa508('0xc1'),'required':![]},{'model':db[_0xa508('0xc2')],'as':_0xa508('0xc3'),'attributes':['id','name',_0xa508('0xc4')],'where':_0x3be09e[_0xa508('0x4f')]['tag']?{'id':_0x3be09e['query']['tag']}:undefined,'required':_0x3be09e['query'][_0xa508('0xc5')]?!![]:![]}];}if(!_0x3be09e['query'][_0xa508('0x56')](_0xa508('0x57'))){_0x50855a[_0xa508('0x32')]=qs[_0xa508('0x32')](_0x3be09e[_0xa508('0x4f')]['limit']);_0x50855a[_0xa508('0x58')]=qs[_0xa508('0x58')](_0x3be09e[_0xa508('0x4f')]['offset']);}return _0xd023c4['getContacts'](_0x50855a);}})[_0xa508('0x23')](function(_0xa6eb2a){if(_0xa6eb2a){return _0xa6eb2a?{'count':_0x311565,'rows':_0xa6eb2a}:null;}})[_0xa508('0x23')](respondWithResult(_0x17fbd8,null))[_0xa508('0x2c')](handleError(_0x17fbd8,null));};exports[_0xa508('0xc6')]=function(_0x334912,_0x55b6de,_0x2f4d0d){var _0x49e406;var _0xf47a7d;var _0x338327={};var _0x4b16d6;return db[_0xa508('0x48')]['findOne']({'where':{'id':_0x334912[_0xa508('0x69')]['id']},'attributes':['id','name',_0xa508('0x43')]})[_0xa508('0x23')](handleEntityNotFound(_0x55b6de,null))['then'](function(_0x2979e4){if(!utils[_0xa508('0xb2')](_0x334912[_0xa508('0x4f')][_0xa508('0x9d')])){throw new db[(_0xa508('0x1f'))][(_0xa508('0x20'))](_0xa508('0xc7'));}_0x49e406=_0x2979e4;var _0x5aa7ca={};_0x5aa7ca[_0xa508('0x4c')]=_['keys'](db[_[_0xa508('0xa0')](_0x334912[_0xa508('0x4f')]['channel'])+_0xa508('0xc8')]['rawAttributes']);_0x5aa7ca[_0xa508('0x4f')]=_[_0xa508('0x50')](_0x334912['query']);_0x5aa7ca[_0xa508('0x51')]=_['intersection'](_0x5aa7ca[_0xa508('0x4c')],_0x5aa7ca[_0xa508('0x4f')]);_0x338327[_0xa508('0x52')]=_[_0xa508('0x53')](_0x5aa7ca[_0xa508('0x4c')],qs[_0xa508('0x54')](_0x334912['query'][_0xa508('0x54')]));_0x338327[_0xa508('0x52')]=_0x338327['attributes'][_0xa508('0x55')]?_0x338327[_0xa508('0x52')]:_0x5aa7ca[_0xa508('0x4c')];_0x338327[_0xa508('0x59')]=qs[_0xa508('0x5a')](_0x334912[_0xa508('0x4f')][_0xa508('0x5a')]);_0x338327[_0xa508('0x5b')]=qs['filters'](_[_0xa508('0x5c')](_0x334912['query'],_0x5aa7ca[_0xa508('0x51')]));if(_0x334912['query'][_0xa508('0x3e')]){_0x338327['where']=_['merge'](_0x338327[_0xa508('0x5b')],{'$or':_['map'](_0x338327['attributes'],function(_0x30cfd7){var _0x234be4={};_0x234be4[_0x30cfd7]={'$like':'%'+_0x334912[_0xa508('0x4f')][_0xa508('0x3e')]+'%'};return _0x234be4;})});}_0x338327=_['merge']({},_0x338327,_0x334912['options']);switch(_0x49e406[_0xa508('0x43')]){case'admin':return db[_[_0xa508('0xa0')](_0x334912[_0xa508('0x4f')][_0xa508('0x9d')])+_0xa508('0xc8')]['findAll'](_0x338327);case _0xa508('0x3a'):case'agent':return _0x49e406[_0xa508('0x39')+_[_0xa508('0xa0')](_0x334912['query'][_0xa508('0x9d')])+_0xa508('0xa2')](_0x338327);default:throw new db[(_0xa508('0x1f'))]['ValidationError'](_0xa508('0xc9'));}})[_0xa508('0x23')](function(_0x17ee2a){_0x4b16d6=_0x17ee2a[_0xa508('0x55')];if(!_0x334912['query'][_0xa508('0x56')](_0xa508('0x57'))){_0x338327[_0xa508('0x32')]=qs['limit'](_0x334912[_0xa508('0x4f')]['limit']);_0x338327[_0xa508('0x58')]=qs[_0xa508('0x58')](_0x334912['query'][_0xa508('0x58')]);}switch(_0x49e406[_0xa508('0x43')]){case _0xa508('0x99'):return db[_[_0xa508('0xa0')](_0x334912[_0xa508('0x4f')]['channel'])+_0xa508('0xc8')][_0xa508('0x63')](_0x338327);case'user':case _0xa508('0x3c'):return _0x49e406[_0xa508('0x39')+_['capitalize'](_0x334912[_0xa508('0x4f')]['channel'])+'Queues'](_0x338327);}})['then'](function(_0x504e01){return{'count':_0x4b16d6,'rows':_0x504e01};})[_0xa508('0x23')](respondWithResult(_0x55b6de,null))['catch'](handleError(_0x55b6de,null));};exports[_0xa508('0xca')]=function(_0xa71e21,_0x5baaf8,_0xf6cc0c){var _0x5bb91b={};var _0x4a9afc={};var _0x15f14a;var _0x2cc31a;return db['User']['findOne']({'where':{'id':_0xa71e21[_0xa508('0x69')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x5baaf8,null))['then'](function(_0x32afa2){if(_0x32afa2){_0x15f14a=_0x32afa2;_0x4a9afc[_0xa508('0x4c')]=_[_0xa508('0x50')](db[_0xa508('0xb0')]['rawAttributes']);_0x4a9afc[_0xa508('0x4f')]=_[_0xa508('0x50')](_0xa71e21[_0xa508('0x4f')]);_0x4a9afc[_0xa508('0x51')]=_[_0xa508('0x53')](_0x4a9afc[_0xa508('0x4c')],_0x4a9afc[_0xa508('0x4f')]);_0x5bb91b[_0xa508('0x52')]=_[_0xa508('0x53')](_0x4a9afc[_0xa508('0x4c')],qs[_0xa508('0x54')](_0xa71e21['query'][_0xa508('0x54')]));_0x5bb91b[_0xa508('0x52')]=_0x5bb91b[_0xa508('0x52')][_0xa508('0x55')]?_0x5bb91b[_0xa508('0x52')]:_0x4a9afc[_0xa508('0x4c')];_0x5bb91b[_0xa508('0x59')]=qs['sort'](_0xa71e21['query']['sort']);_0x5bb91b['where']=qs['filters'](_[_0xa508('0x5c')](_0xa71e21[_0xa508('0x4f')],_0x4a9afc[_0xa508('0x51')]));if(_0xa71e21[_0xa508('0x4f')][_0xa508('0x3e')]){_0x5bb91b['where']=_[_0xa508('0x5d')](_0x5bb91b[_0xa508('0x5b')],{'$or':_[_0xa508('0x47')](_0x5bb91b[_0xa508('0x52')],function(_0x1f6778){var _0x13a716={};_0x13a716[_0x1f6778]={'$like':'%'+_0xa71e21[_0xa508('0x4f')][_0xa508('0x3e')]+'%'};return _0x13a716;})});}_0x5bb91b=_[_0xa508('0x5d')]({},_0x5bb91b,_0xa71e21[_0xa508('0x66')]);return _0x15f14a[_0xa508('0xca')](_0x5bb91b);}})[_0xa508('0x23')](function(_0x1a2455){if(_0x1a2455){_0x2cc31a=_0x1a2455[_0xa508('0x55')];if(!_0xa71e21[_0xa508('0x4f')][_0xa508('0x56')]('nolimit')){_0x5bb91b[_0xa508('0x32')]=qs[_0xa508('0x32')](_0xa71e21[_0xa508('0x4f')][_0xa508('0x32')]);_0x5bb91b['offset']=qs[_0xa508('0x58')](_0xa71e21[_0xa508('0x4f')][_0xa508('0x58')]);}return _0x15f14a[_0xa508('0xca')](_0x5bb91b);}})['then'](function(_0x17c9fb){if(_0x17c9fb){return _0x17c9fb?{'count':_0x2cc31a,'rows':_0x17c9fb}:null;}})[_0xa508('0x23')](respondWithResult(_0x5baaf8,null))[_0xa508('0x2c')](handleError(_0x5baaf8,null));};exports[_0xa508('0xcb')]=function(_0xef5a27,_0x173a95,_0x57c79d){var _0x1f46bc={};var _0x5ba979={};var _0x443fca;var _0x4b3909;return db['User']['findOne']({'where':{'id':_0xef5a27[_0xa508('0x69')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x173a95,null))[_0xa508('0x23')](function(_0x1e234f){if(_0x1e234f){_0x443fca=_0x1e234f;_0x5ba979['model']=_[_0xa508('0x50')](db[_0xa508('0xcc')][_0xa508('0x49')]);_0x5ba979[_0xa508('0x4f')]=_['keys'](_0xef5a27[_0xa508('0x4f')]);_0x5ba979['filters']=_[_0xa508('0x53')](_0x5ba979[_0xa508('0x4c')],_0x5ba979['query']);_0x1f46bc[_0xa508('0x52')]=_[_0xa508('0x53')](_0x5ba979[_0xa508('0x4c')],qs[_0xa508('0x54')](_0xef5a27[_0xa508('0x4f')][_0xa508('0x54')]));_0x1f46bc[_0xa508('0x52')]=_0x1f46bc['attributes'][_0xa508('0x55')]?_0x1f46bc[_0xa508('0x52')]:_0x5ba979[_0xa508('0x4c')];_0x1f46bc['order']=qs['sort'](_0xef5a27[_0xa508('0x4f')][_0xa508('0x5a')]);_0x1f46bc['where']=qs[_0xa508('0x51')](_[_0xa508('0x5c')](_0xef5a27[_0xa508('0x4f')],_0x5ba979[_0xa508('0x51')]));if(_0xef5a27['query']['filter']){_0x1f46bc[_0xa508('0x5b')]=_[_0xa508('0x5d')](_0x1f46bc[_0xa508('0x5b')],{'$or':_[_0xa508('0x47')](_0x1f46bc['attributes'],function(_0xc73541){var _0xd2352b={};_0xd2352b[_0xc73541]={'$like':'%'+_0xef5a27[_0xa508('0x4f')]['filter']+'%'};return _0xd2352b;})});}_0x1f46bc=_[_0xa508('0x5d')]({},_0x1f46bc,_0xef5a27[_0xa508('0x66')]);return _0x443fca['getGroups'](_0x1f46bc);}})[_0xa508('0x23')](function(_0x510ba0){if(_0x510ba0){_0x4b3909=_0x510ba0[_0xa508('0x55')];if(!_0xef5a27[_0xa508('0x4f')][_0xa508('0x56')](_0xa508('0x57'))){_0x1f46bc[_0xa508('0x32')]=qs[_0xa508('0x32')](_0xef5a27['query'][_0xa508('0x32')]);_0x1f46bc[_0xa508('0x58')]=qs['offset'](_0xef5a27[_0xa508('0x4f')]['offset']);}return _0x443fca[_0xa508('0xcb')](_0x1f46bc);}})['then'](function(_0x474c4b){if(_0x474c4b){return _0x474c4b?{'count':_0x4b3909,'rows':_0x474c4b}:null;}})[_0xa508('0x23')](respondWithResult(_0x173a95,null))[_0xa508('0x2c')](handleError(_0x173a95,null));};exports[_0xa508('0xcd')]=function(_0x36becb,_0x24992a,_0x4852ea){var _0x3dd900={'raw':!![],'where':{}};var _0x5d7cf0={};var _0x40c2e7={'count':0x0,'rows':[]};return db[_0xa508('0x48')][_0xa508('0xbd')]({'where':{'id':_0x36becb[_0xa508('0x69')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x24992a,null))[_0xa508('0x23')](function(_0x44299b){if(_0x44299b){_0x5d7cf0[_0xa508('0x4c')]=_['keys'](db[_0xa508('0xce')][_0xa508('0x49')]);_0x5d7cf0[_0xa508('0x4f')]=_['keys'](_0x36becb[_0xa508('0x4f')]);_0x5d7cf0['filters']=_['intersection'](_0x5d7cf0['model'],_0x5d7cf0[_0xa508('0x4f')]);_0x3dd900[_0xa508('0x52')]=_[_0xa508('0x53')](_0x5d7cf0[_0xa508('0x4c')],qs[_0xa508('0x54')](_0x36becb['query'][_0xa508('0x54')]));_0x3dd900[_0xa508('0x52')]=_0x3dd900['attributes'][_0xa508('0x55')]?_0x3dd900[_0xa508('0x52')]:_0x5d7cf0[_0xa508('0x4c')];if(!_0x36becb[_0xa508('0x4f')][_0xa508('0x56')](_0xa508('0x57'))){_0x3dd900['limit']=qs[_0xa508('0x32')](_0x36becb[_0xa508('0x4f')][_0xa508('0x32')]);_0x3dd900['offset']=qs[_0xa508('0x58')](_0x36becb[_0xa508('0x4f')][_0xa508('0x58')]);}_0x3dd900[_0xa508('0x59')]=qs['sort'](_0x36becb[_0xa508('0x4f')]['sort']);_0x3dd900['where']=qs['filters'](_[_0xa508('0x5c')](_0x36becb[_0xa508('0x4f')],_0x5d7cf0[_0xa508('0x51')]));_0x3dd900[_0xa508('0x5b')][_0xa508('0xcf')]=_0x44299b['id'];if(_0x36becb['query']['filter']){_0x3dd900[_0xa508('0x5b')]=_['merge'](_0x3dd900[_0xa508('0x5b')],{'$or':_['map'](_0x3dd900[_0xa508('0x52')],function(_0x3e98fb){var _0x23b9e2={};_0x23b9e2[_0x3e98fb]={'$like':'%'+_0x36becb[_0xa508('0x4f')][_0xa508('0x3e')]+'%'};return _0x23b9e2;})});}_0x3dd900=_['merge']({},_0x3dd900,_0x36becb['options']);return db[_0xa508('0xce')]['count']({'where':_0x3dd900[_0xa508('0x5b')]})[_0xa508('0x23')](function(_0x1b2eb5){_0x40c2e7[_0xa508('0x31')]=_0x1b2eb5;if(_0x36becb['query'][_0xa508('0xbf')]){_0x3dd900[_0xa508('0x62')]=[{'all':!![]}];}return db['VoiceRecording'][_0xa508('0x63')](_0x3dd900);})[_0xa508('0x23')](function(_0x57f6cf){_0x40c2e7[_0xa508('0x64')]=_0x57f6cf;return _0x40c2e7;});}})[_0xa508('0x23')](respondWithFilteredResult(_0x24992a,_0x3dd900))['catch'](handleError(_0x24992a,null));};exports[_0xa508('0xd0')]=function(_0x1f3f0d,_0x2a92a6,_0x3deeef){var _0x11c10a={'raw':!![],'where':{}};var _0x22a31b={};var _0x276875={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x1f3f0d[_0xa508('0x69')]['id']}})['then'](handleEntityNotFound(_0x2a92a6,null))[_0xa508('0x23')](function(_0x4e1e3b){if(_0x4e1e3b){_0x22a31b[_0xa508('0x4c')]=_['keys'](db[_0xa508('0xd1')][_0xa508('0x49')]);_0x22a31b[_0xa508('0x4f')]=_[_0xa508('0x50')](_0x1f3f0d['query']);_0x22a31b[_0xa508('0x51')]=_['intersection'](_0x22a31b[_0xa508('0x4c')],_0x22a31b[_0xa508('0x4f')]);_0x11c10a[_0xa508('0x52')]=_['intersection'](_0x22a31b['model'],qs['fields'](_0x1f3f0d[_0xa508('0x4f')]['fields']));_0x11c10a[_0xa508('0x52')]=_0x11c10a[_0xa508('0x52')][_0xa508('0x55')]?_0x11c10a[_0xa508('0x52')]:_0x22a31b[_0xa508('0x4c')];if(!_0x1f3f0d['query'][_0xa508('0x56')]('nolimit')){_0x11c10a[_0xa508('0x32')]=qs[_0xa508('0x32')](_0x1f3f0d[_0xa508('0x4f')][_0xa508('0x32')]);_0x11c10a[_0xa508('0x58')]=qs[_0xa508('0x58')](_0x1f3f0d[_0xa508('0x4f')][_0xa508('0x58')]);}_0x11c10a[_0xa508('0x59')]=qs[_0xa508('0x5a')](_0x1f3f0d[_0xa508('0x4f')]['sort']);_0x11c10a[_0xa508('0x5b')]=qs[_0xa508('0x51')](_[_0xa508('0x5c')](_0x1f3f0d[_0xa508('0x4f')],_0x22a31b[_0xa508('0x51')]));_0x11c10a['where'][_0xa508('0xcf')]=_0x4e1e3b['id'];if(_0x1f3f0d[_0xa508('0x4f')][_0xa508('0x3e')]){_0x11c10a[_0xa508('0x5b')]=_['merge'](_0x11c10a[_0xa508('0x5b')],{'$or':_['map'](_0x11c10a[_0xa508('0x52')],function(_0x19b331){var _0x4b780d={};_0x4b780d[_0x19b331]={'$like':'%'+_0x1f3f0d['query'][_0xa508('0x3e')]+'%'};return _0x4b780d;})});}_0x11c10a=_[_0xa508('0x5d')]({},_0x11c10a,_0x1f3f0d[_0xa508('0x66')]);return db['ScreenRecording'][_0xa508('0x31')]({'where':_0x11c10a[_0xa508('0x5b')]})[_0xa508('0x23')](function(_0x3c82e3){_0x276875[_0xa508('0x31')]=_0x3c82e3;if(_0x1f3f0d[_0xa508('0x4f')][_0xa508('0xbf')]){_0x11c10a[_0xa508('0x62')]=[{'all':!![]}];}return db[_0xa508('0xd1')]['findAll'](_0x11c10a);})[_0xa508('0x23')](function(_0xbc173b){_0x276875['rows']=_0xbc173b;return _0x276875;});}})[_0xa508('0x23')](respondWithFilteredResult(_0x2a92a6,_0x11c10a))[_0xa508('0x2c')](handleError(_0x2a92a6,null));};exports[_0xa508('0xd2')]=function(_0x3773d7,_0x379c19,_0x251af8){var _0x2a2271={};var _0x37c126={};var _0x53ee30;var _0x3fbc96;return db[_0xa508('0x48')][_0xa508('0xbd')]({'where':{'id':_0x3773d7[_0xa508('0x69')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x379c19,null))[_0xa508('0x23')](function(_0x53758e){if(_0x53758e){_0x53ee30=_0x53758e;_0x37c126[_0xa508('0x4c')]=_[_0xa508('0x50')](db[_0xa508('0xd3')][_0xa508('0x49')]);_0x37c126[_0xa508('0x4f')]=_['keys'](_0x3773d7['query']);_0x37c126[_0xa508('0x51')]=_[_0xa508('0x53')](_0x37c126['model'],_0x37c126[_0xa508('0x4f')]);_0x2a2271[_0xa508('0x52')]=_[_0xa508('0x53')](_0x37c126['model'],qs[_0xa508('0x54')](_0x3773d7[_0xa508('0x4f')][_0xa508('0x54')]));_0x2a2271[_0xa508('0x52')]=_0x2a2271[_0xa508('0x52')][_0xa508('0x55')]?_0x2a2271[_0xa508('0x52')]:_0x37c126[_0xa508('0x4c')];_0x2a2271['order']=qs[_0xa508('0x5a')](_0x3773d7[_0xa508('0x4f')][_0xa508('0x5a')]);_0x2a2271[_0xa508('0x5b')]=qs[_0xa508('0x51')](_[_0xa508('0x5c')](_0x3773d7[_0xa508('0x4f')],_0x37c126[_0xa508('0x51')]));if(_0x3773d7[_0xa508('0x4f')]['filter']){_0x2a2271['where']=_[_0xa508('0x5d')](_0x2a2271[_0xa508('0x5b')],{'$or':_[_0xa508('0x47')](_0x2a2271[_0xa508('0x52')],function(_0x5f447){var _0x1bdfe5={};_0x1bdfe5[_0x5f447]={'$like':'%'+_0x3773d7['query'][_0xa508('0x3e')]+'%'};return _0x1bdfe5;})});}_0x2a2271=_[_0xa508('0x5d')]({},_0x2a2271,_0x3773d7['options']);return _0x53ee30[_0xa508('0xd2')](_0x2a2271);}})['then'](function(_0x32010d){if(_0x32010d){_0x3fbc96=_0x32010d[_0xa508('0x55')];if(!_0x3773d7[_0xa508('0x4f')][_0xa508('0x56')]('nolimit')){_0x2a2271[_0xa508('0x32')]=qs[_0xa508('0x32')](_0x3773d7[_0xa508('0x4f')][_0xa508('0x32')]);_0x2a2271[_0xa508('0x58')]=qs[_0xa508('0x58')](_0x3773d7[_0xa508('0x4f')][_0xa508('0x58')]);}return _0x53ee30[_0xa508('0xd2')](_0x2a2271);}})[_0xa508('0x23')](function(_0xfd6ef3){if(_0xfd6ef3){return _0xfd6ef3?{'count':_0x3fbc96,'rows':_0xfd6ef3}:null;}})[_0xa508('0x23')](respondWithResult(_0x379c19,null))['catch'](handleError(_0x379c19,null));};exports[_0xa508('0xd4')]=function(_0x3c8ca8,_0x386d4c,_0x14cc7f){var _0xe0c615={};var _0x13ec4f={};var _0x45f98a;var _0x3e7c5f;return db[_0xa508('0x48')][_0xa508('0xbd')]({'where':{'id':_0x3c8ca8['params']['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x386d4c,null))[_0xa508('0x23')](function(_0x573ab8){if(_0x573ab8){_0x45f98a=_0x573ab8;_0x13ec4f[_0xa508('0x4c')]=_[_0xa508('0x50')](db[_0xa508('0xd5')][_0xa508('0x49')]);_0x13ec4f[_0xa508('0x4f')]=_['keys'](_0x3c8ca8['query']);_0x13ec4f[_0xa508('0x51')]=_[_0xa508('0x53')](_0x13ec4f[_0xa508('0x4c')],_0x13ec4f[_0xa508('0x4f')]);_0xe0c615[_0xa508('0x52')]=_[_0xa508('0x53')](_0x13ec4f['model'],qs[_0xa508('0x54')](_0x3c8ca8[_0xa508('0x4f')][_0xa508('0x54')]));_0xe0c615[_0xa508('0x52')]=_0xe0c615[_0xa508('0x52')]['length']?_0xe0c615[_0xa508('0x52')]:_0x13ec4f[_0xa508('0x4c')];_0xe0c615[_0xa508('0x59')]=qs[_0xa508('0x5a')](_0x3c8ca8['query'][_0xa508('0x5a')]);_0xe0c615[_0xa508('0x5b')]=qs[_0xa508('0x51')](_[_0xa508('0x5c')](_0x3c8ca8[_0xa508('0x4f')],_0x13ec4f[_0xa508('0x51')]));if(_0x3c8ca8[_0xa508('0x4f')]['filter']){_0xe0c615['where']=_[_0xa508('0x5d')](_0xe0c615[_0xa508('0x5b')],{'$or':_[_0xa508('0x47')](_0xe0c615[_0xa508('0x52')],function(_0x2aba2c){var _0x450cf2={};_0x450cf2[_0x2aba2c]={'$like':'%'+_0x3c8ca8[_0xa508('0x4f')]['filter']+'%'};return _0x450cf2;})});}_0xe0c615=_[_0xa508('0x5d')]({},_0xe0c615,_0x3c8ca8['options']);return _0x45f98a[_0xa508('0xd4')](_0xe0c615);}})[_0xa508('0x23')](function(_0x35023a){if(_0x35023a){_0x3e7c5f=_0x35023a[_0xa508('0x55')];if(!_0x3c8ca8[_0xa508('0x4f')][_0xa508('0x56')](_0xa508('0x57'))){_0xe0c615[_0xa508('0x32')]=qs[_0xa508('0x32')](_0x3c8ca8[_0xa508('0x4f')][_0xa508('0x32')]);_0xe0c615[_0xa508('0x58')]=qs[_0xa508('0x58')](_0x3c8ca8['query'][_0xa508('0x58')]);}return _0x45f98a[_0xa508('0xd4')](_0xe0c615);}})[_0xa508('0x23')](function(_0x48974a){if(_0x48974a){return _0x48974a?{'count':_0x3e7c5f,'rows':_0x48974a}:null;}})[_0xa508('0x23')](respondWithResult(_0x386d4c,null))[_0xa508('0x2c')](handleError(_0x386d4c,null));};exports[_0xa508('0xd6')]=function(_0x2053a0,_0x1376f5,_0xa2ce7f){var _0x42e524={'raw':!![],'where':{}};var _0x37f02e={};var _0x2d38b6={'count':0x0,'rows':[]};return db[_0xa508('0x48')][_0xa508('0xbd')]({'where':{'id':_0x2053a0[_0xa508('0x69')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x1376f5,null))[_0xa508('0x23')](function(_0x347714){if(_0x347714){_0x37f02e[_0xa508('0x4c')]=_[_0xa508('0x50')](db[_0xa508('0xd7')][_0xa508('0x49')]);_0x37f02e[_0xa508('0x4f')]=_['keys'](_0x2053a0['query']);_0x37f02e['filters']=_[_0xa508('0x53')](_0x37f02e[_0xa508('0x4c')],_0x37f02e['query']);_0x42e524['attributes']=_[_0xa508('0x53')](_0x37f02e[_0xa508('0x4c')],qs['fields'](_0x2053a0[_0xa508('0x4f')][_0xa508('0x54')]));_0x42e524[_0xa508('0x52')]=_0x42e524[_0xa508('0x52')][_0xa508('0x55')]?_0x42e524[_0xa508('0x52')]:_0x37f02e[_0xa508('0x4c')];if(!_0x2053a0[_0xa508('0x4f')][_0xa508('0x56')]('nolimit')){_0x42e524[_0xa508('0x32')]=qs[_0xa508('0x32')](_0x2053a0['query'][_0xa508('0x32')]);_0x42e524[_0xa508('0x58')]=qs[_0xa508('0x58')](_0x2053a0[_0xa508('0x4f')][_0xa508('0x58')]);}_0x42e524[_0xa508('0x59')]=qs[_0xa508('0x5a')](_0x2053a0[_0xa508('0x4f')]['sort']);_0x42e524[_0xa508('0x5b')]=qs['filters'](_[_0xa508('0x5c')](_0x2053a0[_0xa508('0x4f')],_0x37f02e[_0xa508('0x51')]));_0x42e524[_0xa508('0x5b')][_0xa508('0xcf')]=_0x347714['id'];if(_0x2053a0[_0xa508('0x4f')][_0xa508('0x3e')]){_0x42e524[_0xa508('0x5b')]=_['merge'](_0x42e524['where'],{'$or':_[_0xa508('0x47')](_0x42e524['attributes'],function(_0x58e245){var _0x432feb={};_0x432feb[_0x58e245]={'$like':'%'+_0x2053a0[_0xa508('0x4f')][_0xa508('0x3e')]+'%'};return _0x432feb;})});}_0x42e524=_['merge']({},_0x42e524,_0x2053a0[_0xa508('0x66')]);return db[_0xa508('0xd7')][_0xa508('0x31')]({'where':_0x42e524[_0xa508('0x5b')]})[_0xa508('0x23')](function(_0x42be6a){_0x2d38b6['count']=_0x42be6a;if(_0x2053a0[_0xa508('0x4f')]['includeAll']){_0x42e524[_0xa508('0x62')]=[{'all':!![]}];}return db['MailInteraction'][_0xa508('0x63')](_0x42e524);})[_0xa508('0x23')](function(_0x520b48){_0x2d38b6[_0xa508('0x64')]=_0x520b48;return _0x2d38b6;});}})[_0xa508('0x23')](respondWithFilteredResult(_0x1376f5,_0x42e524))[_0xa508('0x2c')](handleError(_0x1376f5,null));};exports[_0xa508('0xd8')]=function(_0x1a6041,_0x2038b6,_0x4c1ddd){var _0x331934={};var _0xb0b6a8={};var _0x4ac35e;var _0x318c4b;return db['User'][_0xa508('0xbd')]({'where':{'id':_0x1a6041[_0xa508('0x69')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x2038b6,null))[_0xa508('0x23')](function(_0x1d4b00){if(_0x1d4b00){_0x4ac35e=_0x1d4b00;_0xb0b6a8[_0xa508('0x4c')]=_[_0xa508('0x50')](db[_0xa508('0xd9')][_0xa508('0x49')]);_0xb0b6a8[_0xa508('0x4f')]=_[_0xa508('0x50')](_0x1a6041[_0xa508('0x4f')]);_0xb0b6a8[_0xa508('0x51')]=_[_0xa508('0x53')](_0xb0b6a8[_0xa508('0x4c')],_0xb0b6a8[_0xa508('0x4f')]);_0x331934[_0xa508('0x52')]=_[_0xa508('0x53')](_0xb0b6a8[_0xa508('0x4c')],qs['fields'](_0x1a6041[_0xa508('0x4f')][_0xa508('0x54')]));_0x331934[_0xa508('0x52')]=_0x331934[_0xa508('0x52')][_0xa508('0x55')]?_0x331934[_0xa508('0x52')]:_0xb0b6a8[_0xa508('0x4c')];_0x331934[_0xa508('0x59')]=qs['sort'](_0x1a6041[_0xa508('0x4f')][_0xa508('0x5a')]);_0x331934['where']=qs[_0xa508('0x51')](_['pick'](_0x1a6041['query'],_0xb0b6a8[_0xa508('0x51')]));if(_0x1a6041[_0xa508('0x4f')][_0xa508('0x3e')]){_0x331934[_0xa508('0x5b')]=_['merge'](_0x331934[_0xa508('0x5b')],{'$or':_[_0xa508('0x47')](_0x331934[_0xa508('0x52')],function(_0x52aa9e){var _0x6ec4ba={};_0x6ec4ba[_0x52aa9e]={'$like':'%'+_0x1a6041[_0xa508('0x4f')][_0xa508('0x3e')]+'%'};return _0x6ec4ba;})});}_0x331934=_[_0xa508('0x5d')]({},_0x331934,_0x1a6041['options']);return _0x4ac35e[_0xa508('0xd8')](_0x331934);}})['then'](function(_0x3f4d13){if(_0x3f4d13){_0x318c4b=_0x3f4d13[_0xa508('0x55')];if(!_0x1a6041[_0xa508('0x4f')][_0xa508('0x56')]('nolimit')){_0x331934[_0xa508('0x32')]=qs['limit'](_0x1a6041[_0xa508('0x4f')][_0xa508('0x32')]);_0x331934[_0xa508('0x58')]=qs['offset'](_0x1a6041['query']['offset']);}return _0x4ac35e['getSmsInteractions'](_0x331934);}})[_0xa508('0x23')](function(_0x37008b){if(_0x37008b){return _0x37008b?{'count':_0x318c4b,'rows':_0x37008b}:null;}})[_0xa508('0x23')](respondWithResult(_0x2038b6,null))[_0xa508('0x2c')](handleError(_0x2038b6,null));};exports['getFaxInteractions']=function(_0x392a44,_0x4eaf6e,_0x216672){var _0xc7f716={};var _0x3243d8={};var _0x1c0430;var _0x2394c7;return db[_0xa508('0x48')][_0xa508('0xbd')]({'where':{'id':_0x392a44[_0xa508('0x69')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x4eaf6e,null))[_0xa508('0x23')](function(_0x3c8bbd){if(_0x3c8bbd){_0x1c0430=_0x3c8bbd;_0x3243d8['model']=_['keys'](db[_0xa508('0xda')][_0xa508('0x49')]);_0x3243d8[_0xa508('0x4f')]=_['keys'](_0x392a44[_0xa508('0x4f')]);_0x3243d8[_0xa508('0x51')]=_['intersection'](_0x3243d8['model'],_0x3243d8['query']);_0xc7f716['attributes']=_[_0xa508('0x53')](_0x3243d8[_0xa508('0x4c')],qs[_0xa508('0x54')](_0x392a44['query']['fields']));_0xc7f716['attributes']=_0xc7f716['attributes']['length']?_0xc7f716['attributes']:_0x3243d8['model'];_0xc7f716[_0xa508('0x59')]=qs[_0xa508('0x5a')](_0x392a44[_0xa508('0x4f')][_0xa508('0x5a')]);_0xc7f716['where']=qs[_0xa508('0x51')](_['pick'](_0x392a44[_0xa508('0x4f')],_0x3243d8['filters']));if(_0x392a44['query'][_0xa508('0x3e')]){_0xc7f716[_0xa508('0x5b')]=_[_0xa508('0x5d')](_0xc7f716[_0xa508('0x5b')],{'$or':_['map'](_0xc7f716['attributes'],function(_0x196d89){var _0x63bd64={};_0x63bd64[_0x196d89]={'$like':'%'+_0x392a44['query']['filter']+'%'};return _0x63bd64;})});}_0xc7f716=_[_0xa508('0x5d')]({},_0xc7f716,_0x392a44['options']);return _0x1c0430[_0xa508('0xdb')](_0xc7f716);}})[_0xa508('0x23')](function(_0x213d24){if(_0x213d24){_0x2394c7=_0x213d24[_0xa508('0x55')];if(!_0x392a44[_0xa508('0x4f')][_0xa508('0x56')](_0xa508('0x57'))){_0xc7f716['limit']=qs[_0xa508('0x32')](_0x392a44[_0xa508('0x4f')][_0xa508('0x32')]);_0xc7f716[_0xa508('0x58')]=qs[_0xa508('0x58')](_0x392a44[_0xa508('0x4f')][_0xa508('0x58')]);}return _0x1c0430[_0xa508('0xdb')](_0xc7f716);}})[_0xa508('0x23')](function(_0xb3e9dd){if(_0xb3e9dd){return _0xb3e9dd?{'count':_0x2394c7,'rows':_0xb3e9dd}:null;}})[_0xa508('0x23')](respondWithResult(_0x4eaf6e,null))[_0xa508('0x2c')](handleError(_0x4eaf6e,null));};exports['login']=function(_0x3906f2,_0x5b98f1,_0x191f54){var _0x12556a;var _0x49ab13;var _0x46da3d;var _0x464153=!_[_0xa508('0x73')](_0x3906f2[_0xa508('0x69')]['id'])?_0x3906f2[_0xa508('0x69')]['id']:!_[_0xa508('0x73')](_0x3906f2[_0xa508('0x3a')]['id'])?_0x3906f2[_0xa508('0x3a')]['id']:null;return db[_0xa508('0x48')][_0xa508('0x42')]({'where':{'id':_0x464153,'role':{'$or':['admin',_0xa508('0x3a'),'agent']}},'attributes':['id','name',_0xa508('0xdc'),_0xa508('0xdd'),'role','internal',_0xa508('0x9e')]})['then'](function(_0x57ab35){if(_0x57ab35){if(_0x57ab35[_0xa508('0x43')]===_0xa508('0x3c')){_0x12556a=_0x57ab35;if(_0x3906f2[_0xa508('0x68')][_0xa508('0xac')]){_0x46da3d=util[_0xa508('0xad')](_0xa508('0xde'),_0x12556a[_0x3906f2[_0xa508('0x68')][_0xa508('0xac')]]);}else if(_0x3906f2[_0xa508('0x68')][_0xa508('0xdf')]){_0x46da3d=util['format'](_0xa508('0xae'),_0x3906f2['body'][_0xa508('0xdf')]);}else{_0x46da3d=util[_0xa508('0xad')](_0xa508('0xae'),_0x12556a['name']);}socket['to'](util[_0xa508('0xad')]('user:%s',_0x12556a[_0xa508('0x44')]))[_0xa508('0xa6')]('user:forcelogout',{'ip':_0x3906f2[_0xa508('0xe0')][_0xa508('0xe1')]||_0x3906f2[_0xa508('0xe2')][_0xa508('0xe3')]||_0x3906f2['socket'][_0xa508('0xe3')]||_0x3906f2[_0xa508('0xe2')][_0xa508('0xe4')][_0xa508('0xe3')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x12556a[_0xa508('0x44')]},'individualHooks':!![]});}}else{throw new db[(_0xa508('0x1f'))]['ValidationError'](_0xa508('0xe5'));}})[_0xa508('0x23')](function(){if(_0x12556a){return _0x12556a[_0xa508('0xe6')]({'raw':!![]});}})[_0xa508('0x23')](function(_0x3ea1ea){if(_0x12556a){var _0x2e9927=[];if(_0x3ea1ea){_0x49ab13=_0x3ea1ea;if(_0x49ab13[_0xa508('0x55')]){for(var _0x391063=0x0;_0x391063<_0x49ab13[_0xa508('0x55')];_0x391063++){_0x2e9927[_0xa508('0xab')]({'membername':_0x12556a['name'],'UserId':_0x12556a['id'],'queue_name':_0x49ab13[_0x391063][_0xa508('0x44')],'VoiceQueueId':_0x49ab13[_0x391063]['id'],'interface':_0x46da3d,'paused':_0x12556a[_0xa508('0x9e')]||![],'penalty':_0x49ab13[_0x391063][_0xa508('0xe7')]||0x0});}return BPromise['each'](_0x2e9927,function(_0x4e6196){return db['UserVoiceQueueRt']['upsert'](_0x4e6196);});}}}})[_0xa508('0x23')](function(){if(_0x12556a){return db['MemberReport'][_0xa508('0x63')]({'where':{'membername':_0x12556a['name'],'exitAt':null}});}})[_0xa508('0x23')](function(_0x3a539a){if(_0x12556a){var _0x426448=[];_0x3a539a[_0xa508('0xe8')](function(_0x2981d9){_0x426448[_0xa508('0xab')](_0x2981d9['update']({'exitAt':moment()[_0xa508('0xad')](_0xa508('0xe9'))}));});return BPromise['all'](_0x426448);}})['then'](function(){if(_0x12556a){var _0x107acd=[];var _0x3bca39=[];var _0x32d570=utils[_0xa508('0xea')]();var _0x21433f={'membername':_0x12556a['name'],'interface':_0x46da3d,'enterAt':moment()[_0xa508('0xad')](_0xa508('0xe9')),'role':_0x12556a[_0xa508('0x43')],'internal':_0x12556a[_0xa508('0x7b')]};_0x32d570[_0xa508('0xe8')](function(_0x2d1626){_0x107acd[_0xa508('0xab')](_[_0xa508('0x5d')]({'channel':_0x2d1626,'type':_0xa508('0xeb'),'data1':_0x3906f2[_0xa508('0x68')]['device'],'data2':_0x46da3d},_0x21433f));if(_0x12556a[_0xa508('0x9e')]){_0x3bca39['push'](_[_0xa508('0x5d')]({'channel':_0x2d1626,'type':_0xa508('0xec'),'data1':_0xa508('0xed')},_0x21433f));}});return db['MemberReport']['bulkCreate'](_0x107acd['concat'](_0x3bca39),{'individualHooks':!![]});}})[_0xa508('0x23')](function(){if(_0x12556a){return _0x12556a['update']({'online':!![],'lastLoginAt':moment()[_0xa508('0xad')](_0xa508('0xe9')),'voicePause':_0x12556a['loginInPause']||![],'mailPause':_0x12556a[_0xa508('0x9e')]||![],'chatPause':_0x12556a[_0xa508('0x9e')]||![],'faxPause':_0x12556a[_0xa508('0x9e')]||![],'smsPause':_0x12556a[_0xa508('0x9e')]||![],'openchannelPause':_0x12556a[_0xa508('0x9e')]||![],'pauseType':_0x12556a[_0xa508('0x9e')]?_0xa508('0xed'):null,'interface':_0x46da3d,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xa508('0x23')](function(_0x30272d){if(_0x3906f2[_0xa508('0xee')]){return _0x191f54();}else{return BPromise['resolve'](_0x30272d)['then'](respondWithResult(_0x5b98f1,null));}})[_0xa508('0x2c')](handleError(_0x5b98f1,null));};exports[_0xa508('0xef')]=function(_0x3ae8fd,_0x1cfb33,_0x3b0932){var _0x42d590;return db['User']['find']({'where':{'id':_0x3ae8fd[_0xa508('0x69')]['id'],'role':_0xa508('0x3c')},'attributes':['id',_0xa508('0x44'),'role']})[_0xa508('0x23')](handleEntityNotFound(_0x1cfb33,null))[_0xa508('0x23')](function(_0x445a12){if(_0x445a12){_0x42d590=_0x445a12;return db['UserVoiceQueueRt'][_0xa508('0x38')]({'where':{'membername':_0x42d590[_0xa508('0x44')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x42d590[_0xa508('0x44')],'exitAt':null}});})[_0xa508('0x23')](function(_0x2e999b){var _0x113e3d=[];_0x2e999b[_0xa508('0xe8')](function(_0x3bb916){_0x113e3d[_0xa508('0xab')](_0x3bb916[_0xa508('0x37')]({'exitAt':moment()[_0xa508('0xad')](_0xa508('0xe9'))}));});return BPromise[_0xa508('0xf0')](_0x113e3d);})[_0xa508('0x23')](function(){return _0x42d590['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xa508('0x23')](respondWithResult(_0x1cfb33,null))[_0xa508('0x2c')](handleError(_0x1cfb33,null));};exports[_0xa508('0xf1')]=function(_0x15ba85,_0x534716,_0x5b63bb){var _0x47046f;return db[_0xa508('0xb0')][_0xa508('0x37')]({'paused':0x1},{'where':{'UserId':_0x15ba85[_0xa508('0x69')]['id']},'individualHooks':!![]})[_0xa508('0x23')](function(){return db[_0xa508('0x48')][_0xa508('0x42')]({'where':{'id':_0x15ba85[_0xa508('0x69')]['id'],'role':_0xa508('0x3c')},'attributes':['id',_0xa508('0x44'),_0xa508('0x43'),'internal','interface']});})[_0xa508('0x23')](handleEntityNotFound(_0x534716,null))[_0xa508('0x23')](function(_0x461778){if(_0x461778){_0x47046f=_0x461778;return respondWithRpcPromise(_0xa508('0xf2'),_0xa508('0xf1'),{'id':_0x47046f['id'],'name':_0x47046f[_0xa508('0x44')],'pause':!![]});}})[_0xa508('0x23')](function(){if(_0x47046f){return db[_0xa508('0xf3')]['findAll']({'where':{'membername':_0x47046f[_0xa508('0x44')],'type':_0xa508('0xec'),'exitAt':null}});}})[_0xa508('0x23')](function(_0x45b669){if(_0x45b669[_0xa508('0x55')]){var _0x18f4b9=moment()['format'](_0xa508('0xe9'));for(var _0x9a531d=0x0,_0x5ee170=_0x45b669[_0xa508('0x55')];_0x9a531d<_0x5ee170;_0x9a531d++){_0x45b669[_0x9a531d]['updateAttributes']({'exitAt':_0x18f4b9});}}})[_0xa508('0x23')](function(){var _0x56050d=[];var _0x366f36=utils[_0xa508('0xea')]();_0x366f36['forEach'](function(_0x204989){_0x56050d[_0xa508('0xab')]({'channel':_0x204989,'membername':_0x47046f[_0xa508('0x44')],'interface':_[_0xa508('0x73')](_0x47046f[_0xa508('0xac')])?util[_0xa508('0xad')]('SIP/%s',_0x47046f[_0xa508('0x44')]):_0x47046f[_0xa508('0xac')],'type':_0xa508('0xec'),'enterAt':moment()[_0xa508('0xad')](_0xa508('0xe9')),'data1':_0x15ba85['body'][_0xa508('0x4b')]||_0xa508('0xf4'),'role':_0x47046f[_0xa508('0x43')],'internal':_0x47046f[_0xa508('0x7b')]});});return db[_0xa508('0xf3')][_0xa508('0x67')](_0x56050d,{'individualHooks':!![]});})['then'](function(){return _0x47046f['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x15ba85[_0xa508('0x68')][_0xa508('0x4b')]||_0xa508('0xf4'),'lastPauseAt':moment()[_0xa508('0xad')](_0xa508('0xe9'))});})[_0xa508('0x23')](respondWithResult(_0x534716,null))['catch'](handleError(_0x534716,null));};exports[_0xa508('0xf5')]=function(_0x258e73,_0x3638b2,_0x1e66cc){var _0x5d977e;return db[_0xa508('0x48')][_0xa508('0x42')]({'where':{'id':_0x258e73['params']['id']},'attributes':['id',_0xa508('0x44'),_0xa508('0x43'),'voicePause',_0xa508('0xf6'),_0xa508('0xf7'),_0xa508('0xf8'),_0xa508('0xf9'),_0xa508('0xfa'),'pauseType',_0xa508('0xfb')]})[_0xa508('0x23')](handleEntityNotFound(_0x3638b2,null))[_0xa508('0x23')](function(_0x30a6b4){if(_0x30a6b4){_0x5d977e=_0x30a6b4;if(_0x258e73['body'][_0xa508('0x9d')]&&!utils[_0xa508('0xb2')](_0x258e73[_0xa508('0x68')][_0xa508('0x9d')])){throw new db[(_0xa508('0x1f'))][(_0xa508('0x20'))](_0xa508('0xc7'));}switch(_0x258e73[_0xa508('0x68')][_0xa508('0x9d')]){case _0xa508('0xa8'):return respondWithRpcPromise(_0xa508('0xf2'),_0xa508('0xf5'),{'id':_0x5d977e['id'],'name':_0x5d977e[_0xa508('0x44')],'pause':![]})[_0xa508('0x23')](function(){return db[_0xa508('0xb0')][_0xa508('0x37')]({'paused':0x0},{'where':{'UserId':_0x5d977e['id']},'individualHooks':!![]});})[_0xa508('0x23')](function(){return db[_0xa508('0xf3')][_0xa508('0x42')]({'where':{'channel':_0x258e73[_0xa508('0x68')][_0xa508('0x9d')],'membername':_0x5d977e[_0xa508('0x44')],'type':_0xa508('0xec'),'exitAt':null}});})[_0xa508('0x23')](function(_0x391ad3){if(_0x391ad3){return _0x391ad3['update']({'exitAt':moment()[_0xa508('0xad')](_0xa508('0xe9')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xa508('0x23')](function(){return _0x5d977e[_0xa508('0x37')]({'voicePause':![]});});case _0xa508('0xfc'):case _0xa508('0xfd'):case'fax':case'sms':case _0xa508('0xfe'):return db['MemberReport']['find']({'where':{'channel':_0x258e73['body']['channel'],'membername':_0x5d977e[_0xa508('0x44')],'type':_0xa508('0xec'),'exitAt':null}})[_0xa508('0x23')](function(_0x3bca7e){if(_0x3bca7e){return _0x3bca7e[_0xa508('0x37')]({'exitAt':moment()[_0xa508('0xad')](_0xa508('0xe9')),'data2':_0xa508('0xff')},{'individualHooks':!![]});}return null;})[_0xa508('0x23')](function(){var _0x4e6e65={};_[_0xa508('0x100')](_0x4e6e65,util[_0xa508('0xad')](_0xa508('0x101'),_0x258e73['body'][_0xa508('0x9d')],_0xa508('0x102')),![]);return _0x5d977e[_0xa508('0x37')](_0x4e6e65);});default:return respondWithRpcPromise(_0xa508('0xf2'),_0xa508('0xf5'),{'id':_0x5d977e['id'],'name':_0x5d977e[_0xa508('0x44')],'pause':![]})['then'](function(){return db[_0xa508('0xb0')]['update']({'paused':0x0},{'where':{'UserId':_0x5d977e['id']}});})[_0xa508('0x23')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x5d977e[_0xa508('0x44')],'type':_0xa508('0xec'),'exitAt':null}});})[_0xa508('0x23')](function(_0x81ae0f){var _0x5e6293=[];_0x81ae0f[_0xa508('0xe8')](function(_0x2ddf88){_0x5e6293['push'](_0x2ddf88[_0xa508('0x37')]({'exitAt':moment()[_0xa508('0xad')](_0xa508('0xe9')),'data2':_0xa508('0xff')}));});return BPromise['all'](_0x5e6293);})[_0xa508('0x23')](function(){return _0x5d977e['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xa508('0x23')](respondWithResult(_0x3638b2,null))[_0xa508('0x2c')](handleError(_0x3638b2,null));};exports[_0xa508('0x103')]=function(_0x278394,_0x1bb67c,_0xd96b32){var _0x4cdd4e={};var _0x422537={};var _0x5d6fc8;var _0x2a515d;return db[_0xa508('0x48')]['findOne']({'where':{'id':_0x278394[_0xa508('0x69')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x1bb67c,null))[_0xa508('0x23')](function(_0x46548a){if(_0x46548a){_0x5d6fc8=_0x46548a;_0x422537[_0xa508('0x4c')]=_['keys'](db[_0xa508('0x104')]['rawAttributes']);_0x422537[_0xa508('0x4f')]=_['keys'](_0x278394[_0xa508('0x4f')]);_0x422537[_0xa508('0x51')]=_[_0xa508('0x53')](_0x422537[_0xa508('0x4c')],_0x422537['query']);_0x4cdd4e[_0xa508('0x52')]=_[_0xa508('0x53')](_0x422537[_0xa508('0x4c')],qs['fields'](_0x278394['query'][_0xa508('0x54')]));_0x4cdd4e['attributes']=_0x4cdd4e['attributes'][_0xa508('0x55')]?_0x4cdd4e[_0xa508('0x52')]:_0x422537['model'];_0x4cdd4e['order']=qs[_0xa508('0x5a')](_0x278394[_0xa508('0x4f')][_0xa508('0x5a')]);_0x4cdd4e[_0xa508('0x5b')]=qs[_0xa508('0x51')](_[_0xa508('0x5c')](_0x278394[_0xa508('0x4f')],_0x422537[_0xa508('0x51')]));if(_0x278394[_0xa508('0x4f')][_0xa508('0x3e')]){_0x4cdd4e[_0xa508('0x5b')]=_['merge'](_0x4cdd4e[_0xa508('0x5b')],{'$or':_[_0xa508('0x47')](_0x4cdd4e['attributes'],function(_0xf41b09){var _0x370891={};_0x370891[_0xf41b09]={'$like':'%'+_0x278394[_0xa508('0x4f')][_0xa508('0x3e')]+'%'};return _0x370891;})});}_0x4cdd4e=_[_0xa508('0x5d')]({},_0x4cdd4e,_0x278394[_0xa508('0x66')]);return _0x5d6fc8[_0xa508('0x103')](_0x4cdd4e);}})[_0xa508('0x23')](function(_0x4b5727){if(_0x4b5727){_0x2a515d=_0x4b5727[_0xa508('0x55')];if(!_0x278394['query']['hasOwnProperty'](_0xa508('0x57'))){_0x4cdd4e[_0xa508('0x32')]=qs[_0xa508('0x32')](_0x278394[_0xa508('0x4f')][_0xa508('0x32')]);_0x4cdd4e[_0xa508('0x58')]=qs['offset'](_0x278394[_0xa508('0x4f')][_0xa508('0x58')]);}return _0x5d6fc8[_0xa508('0x103')](_0x4cdd4e);}})['then'](function(_0x122775){if(_0x122775){return _0x122775?{'count':_0x2a515d,'rows':_0x122775}:null;}})[_0xa508('0x23')](respondWithResult(_0x1bb67c,null))['catch'](handleError(_0x1bb67c,null));};exports[_0xa508('0x105')]=function(_0x4d0f2e,_0x4c00ad){return db[_0xa508('0x48')][_0xa508('0x42')]({'where':{'id':_0x4d0f2e[_0xa508('0x69')]['id']}})['then'](handleEntityNotFound(_0x4c00ad,null))[_0xa508('0x23')](function(_0x44acec){if(_0x44acec){var _0x225304=_0x44acec['get']({'plain':!![]});return _0x44acec[_0xa508('0x105')](_0x4d0f2e['body']['ids'],_[_0xa508('0x6c')](_0x4d0f2e['body'],['ids','id'])||{})[_0xa508('0x23')](function(){for(var _0x4ac85e=0x0;_0x4ac85e<_0x4d0f2e['body'][_0xa508('0x6d')][_0xa508('0x55')];_0x4ac85e++){var _0x3b42d7=[];db['Team'][_0xa508('0xbd')]({'where':{'id':_0x4d0f2e[_0xa508('0x68')][_0xa508('0x6d')][_0x4ac85e]}})[_0xa508('0x23')](function(_0x472930){_0x3b42d7[_0xa508('0xab')](_0x472930[_0xa508('0xe6')]()[_0xa508('0x23')](function(_0x5408a2){for(var _0x58aa13=0x0;_0x58aa13<_0x5408a2[_0xa508('0x55')];_0x58aa13++){_0x5408a2[_0x58aa13][_0xa508('0x106')](_0xa508('0x9d'),_0xa508('0x107'));}return _0x5408a2;}));_0x3b42d7[_0xa508('0xab')](_0x472930[_0xa508('0x108')]()['then'](function(_0x3771b7){for(var _0x229cb7=0x0;_0x229cb7<_0x3771b7[_0xa508('0x55')];_0x229cb7++){_0x3771b7[_0x229cb7]['setDataValue'](_0xa508('0x9d'),_0xa508('0x109'));}return _0x3771b7;}));_0x3b42d7[_0xa508('0xab')](_0x472930[_0xa508('0x10a')]()[_0xa508('0x23')](function(_0x48b6fa){for(var _0x4cee99=0x0;_0x4cee99<_0x48b6fa[_0xa508('0x55')];_0x4cee99++){_0x48b6fa[_0x4cee99][_0xa508('0x106')](_0xa508('0x9d'),_0xa508('0x10b'));}return _0x48b6fa;}));_0x3b42d7[_0xa508('0xab')](_0x472930['getSmsQueues']()[_0xa508('0x23')](function(_0x312c0a){for(var _0x16aaec=0x0;_0x16aaec<_0x312c0a[_0xa508('0x55')];_0x16aaec++){_0x312c0a[_0x16aaec][_0xa508('0x106')]('channel',_0xa508('0x10c'));}return _0x312c0a;}));_0x3b42d7[_0xa508('0xab')](_0x472930['getFaxQueues']()['then'](function(_0x39044b){for(var _0x21c21e=0x0;_0x21c21e<_0x39044b['length'];_0x21c21e++){_0x39044b[_0x21c21e][_0xa508('0x106')](_0xa508('0x9d'),'Fax');}return _0x39044b;}));_0x3b42d7[_0xa508('0xab')](_0x472930['getOpenchannelQueues']()[_0xa508('0x23')](function(_0x4ed93f){for(var _0xdc850e=0x0;_0xdc850e<_0x4ed93f[_0xa508('0x55')];_0xdc850e++){_0x4ed93f[_0xdc850e]['setDataValue']('channel',_0xa508('0x10d'));}return _0x4ed93f;}));return BPromise['all'](_0x3b42d7);})['then'](function(_0x43cbcd){var _0x3c6e4c=_['flatten'](_0x43cbcd);_0x3b42d7=[];return db['sequelize'][_0xa508('0x10e')](function(_0x55668a){for(var _0x3fde96=0x0;_0x3fde96<_0x3c6e4c[_0xa508('0x55')];_0x3fde96++){_0x3b42d7['push'](_0x3c6e4c[_0x3fde96][_0xa508('0x10f')](_0x225304['id']),{'transaction':_0x55668a});}return BPromise[_0xa508('0xf0')](_0x3b42d7)['then'](function(){if(_0x225304['online']){return BPromise[_0xa508('0xaf')](_['filter'](_0x3c6e4c,function(_0x3ea5d3){return _0x3ea5d3[_0xa508('0x110')](_0xa508('0x9d'))===_0xa508('0x107');}),function(_0x187524){return db[_0xa508('0xb0')]['upsert']({'membername':_0x225304['name'],'UserId':_0x225304['id'],'queue_name':_0x187524[_0xa508('0x44')],'VoiceQueueId':_0x187524['id'],'interface':_[_0xa508('0x73')](_0x225304[_0xa508('0xac')])?util[_0xa508('0xad')](_0xa508('0xae'),_0x225304['name']):_0x225304[_0xa508('0xac')],'paused':_0x225304[_0xa508('0x9f')]||![],'penalty':_0x225304['penalty']},{'transaction':_0x55668a});});}else{return;}})[_0xa508('0x23')](function(){for(var _0x50ea38=0x0;_0x50ea38<_0x3c6e4c[_0xa508('0x55')];_0x50ea38++){var _0x30ac7f=_0x3c6e4c[_0x50ea38]['getDataValue'](_0xa508('0x9d'));var _0x46edc8=_0x30ac7f+_0xa508('0xa5');socket[_0xa508('0xa6')](_0xa508('0x3a')+_0x30ac7f+_0xa508('0xa7'),{'UserId':_0x225304['id'],['queueField']:_0x3c6e4c[_0x50ea38]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x4c00ad,null))['catch'](handleError(_0x4c00ad,null));};exports[_0xa508('0x111')]=function(_0x4e5a15,_0x41ffc6){return db[_0xa508('0x48')][_0xa508('0xbd')]({'where':{'id':_0x4e5a15[_0xa508('0x69')]['id']}})['then'](handleEntityNotFound(_0x41ffc6,null))['then'](function(_0x4aaf51){if(_0x4aaf51){var _0x188025=_0x4aaf51[_0xa508('0x39')]({'plain':!![]});var _0x510353=_0x4e5a15[_0xa508('0x4f')]['ids'];return _0x4aaf51[_0xa508('0x111')](_0x510353)[_0xa508('0x23')](function(){for(var _0x568714=0x0;_0x568714<_0x510353[_0xa508('0x55')];_0x568714++){var _0x548a44=[];db[_0xa508('0x104')][_0xa508('0xbd')]({'where':{'id':_0x510353[_0x568714]}})[_0xa508('0x23')](function(_0x8ef0ab){_0x548a44['push'](_0x8ef0ab[_0xa508('0xe6')]()['then'](function(_0x3179f1){for(var _0x4b04a1=0x0;_0x4b04a1<_0x3179f1[_0xa508('0x55')];_0x4b04a1++){_0x3179f1[_0x4b04a1][_0xa508('0x106')](_0xa508('0x9d'),'Voice');}return _0x3179f1;}));_0x548a44[_0xa508('0xab')](_0x8ef0ab[_0xa508('0x108')]()[_0xa508('0x23')](function(_0x4e46d8){for(var _0x28906e=0x0;_0x28906e<_0x4e46d8['length'];_0x28906e++){_0x4e46d8[_0x28906e][_0xa508('0x106')](_0xa508('0x9d'),_0xa508('0x109'));}return _0x4e46d8;}));_0x548a44[_0xa508('0xab')](_0x8ef0ab[_0xa508('0x10a')]()[_0xa508('0x23')](function(_0x588246){for(var _0xfe22a7=0x0;_0xfe22a7<_0x588246[_0xa508('0x55')];_0xfe22a7++){_0x588246[_0xfe22a7][_0xa508('0x106')]('channel',_0xa508('0x10b'));}return _0x588246;}));_0x548a44[_0xa508('0xab')](_0x8ef0ab[_0xa508('0x112')]()[_0xa508('0x23')](function(_0x74ba8){for(var _0xca2681=0x0;_0xca2681<_0x74ba8['length'];_0xca2681++){_0x74ba8[_0xca2681][_0xa508('0x106')]('channel',_0xa508('0x10c'));}return _0x74ba8;}));_0x548a44[_0xa508('0xab')](_0x8ef0ab[_0xa508('0x113')]()[_0xa508('0x23')](function(_0x2590d4){for(var _0x33ed22=0x0;_0x33ed22<_0x2590d4['length'];_0x33ed22++){_0x2590d4[_0x33ed22][_0xa508('0x106')]('channel',_0xa508('0x114'));}return _0x2590d4;}));_0x548a44[_0xa508('0xab')](_0x8ef0ab['getOpenchannelQueues']()['then'](function(_0x85ec99){for(var _0x12ea55=0x0;_0x12ea55<_0x85ec99[_0xa508('0x55')];_0x12ea55++){_0x85ec99[_0x12ea55][_0xa508('0x106')]('channel',_0xa508('0x10d'));}return _0x85ec99;}));return BPromise[_0xa508('0xf0')](_0x548a44);})[_0xa508('0x23')](function(_0x5599ad){var _0x42fee0=_[_0xa508('0x115')](_0x5599ad);_0x548a44=[];return db['sequelize']['transaction'](function(_0x232021){for(var _0x3a815c=0x0;_0x3a815c<_0x42fee0['length'];_0x3a815c++){_0x548a44[_0xa508('0xab')](_0x42fee0[_0x3a815c][_0xa508('0x116')](_0x188025['id']),{'transaction':_0x232021});}return BPromise[_0xa508('0xf0')](_0x548a44)[_0xa508('0x23')](function(){if(_0x188025[_0xa508('0xaa')]){return BPromise[_0xa508('0xaf')](_[_0xa508('0x3e')](_0x42fee0,function(_0x1f01b8){return _0x1f01b8[_0xa508('0x110')]('channel')==='Voice';}),function(_0x3da1e1){return db[_0xa508('0xb0')][_0xa508('0x38')]({'where':{'VoiceQueueId':_0x3da1e1['id'],'UserId':_0x188025['id']},'transaction':_0x232021});});}else{return;}})[_0xa508('0x23')](function(){for(var _0x17ac16=0x0;_0x17ac16<_0x42fee0[_0xa508('0x55')];_0x17ac16++){var _0xb7356a=_0x42fee0[_0x17ac16]['getDataValue'](_0xa508('0x9d'));var _0x2866d5=_0xb7356a+'QueueId';socket['emit'](_0xa508('0x3a')+_0xb7356a+_0xa508('0xb4'),{'UserId':_0x188025['id'],['queueField']:_0x42fee0[_0x17ac16]['id']});}});});});}});}})[_0xa508('0x23')](respondWithStatusCode(_0x41ffc6,null))['catch'](handleError(_0x41ffc6,null));};exports['getLists']=function(_0x4c5f08,_0x590db6,_0xae547d){var _0x58d228={};var _0xa98bd5={};var _0x2a89cd;var _0x3d3376;return db[_0xa508('0x48')][_0xa508('0xbd')]({'where':{'id':_0x4c5f08[_0xa508('0x69')]['id']}})['then'](handleEntityNotFound(_0x590db6,null))[_0xa508('0x23')](function(_0x3ea17b){if(_0x3ea17b){_0x2a89cd=_0x3ea17b;_0xa98bd5[_0xa508('0x4c')]=_[_0xa508('0x50')](db['CmList']['rawAttributes']);_0xa98bd5['query']=_['keys'](_0x4c5f08[_0xa508('0x4f')]);_0xa98bd5['filters']=_['intersection'](_0xa98bd5[_0xa508('0x4c')],_0xa98bd5[_0xa508('0x4f')]);_0x58d228[_0xa508('0x52')]=_[_0xa508('0x53')](_0xa98bd5[_0xa508('0x4c')],qs[_0xa508('0x54')](_0x4c5f08[_0xa508('0x4f')][_0xa508('0x54')]));_0x58d228[_0xa508('0x52')]=_0x58d228[_0xa508('0x52')][_0xa508('0x55')]?_0x58d228['attributes']:_0xa98bd5['model'];_0x58d228[_0xa508('0x59')]=qs[_0xa508('0x5a')](_0x4c5f08[_0xa508('0x4f')]['sort']);_0x58d228['where']=qs[_0xa508('0x51')](_[_0xa508('0x5c')](_0x4c5f08[_0xa508('0x4f')],_0xa98bd5[_0xa508('0x51')]));if(_0x4c5f08[_0xa508('0x4f')]['filter']){_0x58d228['where']=_[_0xa508('0x5d')](_0x58d228[_0xa508('0x5b')],{'$or':_[_0xa508('0x47')](_0x58d228[_0xa508('0x52')],function(_0x2ec5b0){var _0x30131a={};_0x30131a[_0x2ec5b0]={'$like':'%'+_0x4c5f08[_0xa508('0x4f')]['filter']+'%'};return _0x30131a;})});}_0x58d228=_['merge']({},_0x58d228,_0x4c5f08[_0xa508('0x66')]);return _0x2a89cd[_0xa508('0x117')](_0x58d228);}})[_0xa508('0x23')](function(_0x110a20){if(_0x110a20){_0x3d3376=_0x110a20[_0xa508('0x55')];if(!_0x4c5f08[_0xa508('0x4f')][_0xa508('0x56')](_0xa508('0x57'))){_0x58d228[_0xa508('0x32')]=qs[_0xa508('0x32')](_0x4c5f08['query'][_0xa508('0x32')]);_0x58d228[_0xa508('0x58')]=qs[_0xa508('0x58')](_0x4c5f08['query'][_0xa508('0x58')]);}return _0x2a89cd[_0xa508('0x117')](_0x58d228);}})[_0xa508('0x23')](function(_0x454d09){if(_0x454d09){return _0x454d09?{'count':_0x3d3376,'rows':_0x454d09}:null;}})[_0xa508('0x23')](respondWithResult(_0x590db6,null))[_0xa508('0x2c')](handleError(_0x590db6,null));};exports[_0xa508('0x118')]=function(_0x2f8d25,_0x2604f8,_0x1af1aa){var _0x2254c5={};var _0x4184cd={};var _0x3cf36d;var _0x3c445f;return db['User'][_0xa508('0xbd')]({'where':{'id':_0x2f8d25[_0xa508('0x69')]['id']}})['then'](handleEntityNotFound(_0x2604f8,null))['then'](function(_0x426462){if(_0x426462){_0x3cf36d=_0x426462;_0x4184cd[_0xa508('0x4c')]=_[_0xa508('0x50')](db[_0xa508('0x48')][_0xa508('0x49')]);_0x4184cd[_0xa508('0x4f')]=_['keys'](_0x2f8d25[_0xa508('0x4f')]);_0x4184cd[_0xa508('0x51')]=_['intersection'](_0x4184cd[_0xa508('0x4c')],_0x4184cd[_0xa508('0x4f')]);_0x2254c5[_0xa508('0x52')]=_[_0xa508('0x53')](_0x4184cd[_0xa508('0x4c')],qs['fields'](_0x2f8d25[_0xa508('0x4f')]['fields']));_0x2254c5[_0xa508('0x52')]=_0x2254c5[_0xa508('0x52')][_0xa508('0x55')]?_0x2254c5[_0xa508('0x52')]:_0x4184cd[_0xa508('0x4c')];_0x2254c5[_0xa508('0x59')]=qs['sort'](_0x2f8d25[_0xa508('0x4f')][_0xa508('0x5a')]);_0x2254c5['where']=qs[_0xa508('0x51')](_['pick'](_0x2f8d25[_0xa508('0x4f')],_0x4184cd[_0xa508('0x51')]));if(_0x2f8d25[_0xa508('0x4f')][_0xa508('0x3e')]){_0x2254c5['where']=_[_0xa508('0x5d')](_0x2254c5[_0xa508('0x5b')],{'$or':_[_0xa508('0x47')](_0x2254c5[_0xa508('0x52')],function(_0x35dc8b){var _0x164005={};_0x164005[_0x35dc8b]={'$like':'%'+_0x2f8d25[_0xa508('0x4f')][_0xa508('0x3e')]+'%'};return _0x164005;})});}_0x2254c5[_0xa508('0x4c')]=db[_0xa508('0x48')];_0x2254c5['as']='Agents';_0x2254c5=_[_0xa508('0x5d')]({},_0x2254c5,_0x2f8d25[_0xa508('0x66')]);return _0x3cf36d['getVoiceQueues']({'include':[_0x2254c5]});}})[_0xa508('0x23')](function(_0x3119f0){if(_0x3119f0){var _0x4b5973={},_0x5efa4a=[],_0x98ca45=0x0;for(var _0x172aa1=0x0;_0x172aa1<_0x3119f0['length'];_0x172aa1+=0x1){for(var _0x472efe=0x0,_0x41c809;_0x472efe<_0x3119f0[_0x172aa1][_0xa508('0x3b')][_0xa508('0x55')];_0x472efe+=0x1){_0x41c809=_0x3119f0[_0x172aa1][_0xa508('0x3b')][_0x472efe][_0xa508('0x39')]({'plain':!![]});_0x4b5973[_0x41c809['id']]=_0x41c809;}}_0x4b5973=_[_0xa508('0x119')](_0x4b5973);for(var _0x3d2336=qs[_0xa508('0x58')](_0x2f8d25[_0xa508('0x4f')]['offset']);_0x3d2336<_0x4b5973[_0xa508('0x55')]&&_0x5efa4a[_0xa508('0x55')]=_0x283d65[_0x0549('0x54')]){throw new Error(_0x0549('0x55'));}})[_0x0549('0x11')](function(){if(_0x2e2164){return db[_0x0549('0x2d')]['destroy']({'where':{'membername':_0x2e2164['name']},'individualHooks':!![]});}})[_0x0549('0x11')](function(){if(_0x2e2164){return _0x2e2164['getVoiceQueues']({'raw':!![]});}})[_0x0549('0x11')](function(_0x219f9c){if(_0x2e2164){if(_0x219f9c){var _0x26fc88=[];_0x1bb539=_0x219f9c;if(_0x1bb539[_0x0549('0x31')]){for(var _0x9386ba=0x0;_0x9386ba<_0x1bb539[_0x0549('0x31')];_0x9386ba++){_0x26fc88['push'](db[_0x0549('0x2d')][_0x0549('0x56')]({'membername':_0x2e2164['name'],'UserId':_0x2e2164['id'],'queue_name':_0x1bb539[_0x9386ba][_0x0549('0x2a')],'VoiceQueueId':_0x1bb539[_0x9386ba]['id'],'interface':_0x115bd2,'paused':_0x2e2164[_0x0549('0x4f')]||![],'penalty':_0x1bb539[_0x9386ba]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0549('0x57')](_0x26fc88);}}}})[_0x0549('0x11')](function(){if(_0x2e2164){return db['MemberReport'][_0x0549('0x1e')]({'where':{'membername':_0x2e2164['name'],'exitAt':null}});}})[_0x0549('0x11')](function(_0x5887ce){if(_0x2e2164){if(_0x5887ce&&_0x5887ce[_0x0549('0x31')]){var _0x535bba=[];_0x5887ce['forEach'](function(_0x2f861b){_0x535bba['push'](_0x2f861b[_0x0549('0x2e')]({'exitAt':moment()[_0x0549('0x35')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x535bba);}}})[_0x0549('0x11')](function(_0x3e34e6){if(_0x2e2164){var _0xe4fa99=[];var _0x159e20=[];var _0x2c8aca=utils[_0x0549('0x33')]();var _0x48e11d={'membername':_0x2e2164[_0x0549('0x2a')],'interface':_0x115bd2,'enterAt':moment()[_0x0549('0x35')](_0x0549('0x30')),'role':_0x2e2164[_0x0549('0x2b')],'internal':_0x2e2164['internal']};_0x2c8aca['forEach'](function(_0x22972f){_0xe4fa99[_0x0549('0x4b')](_[_0x0549('0x58')]({'channel':_0x22972f,'type':'LOGIN','data1':_0x0549('0x59'),'data2':_0x115bd2},_0x48e11d));if(_0x2e2164[_0x0549('0x4f')]){_0x159e20[_0x0549('0x4b')](_['merge']({'channel':_0x22972f,'type':_0x0549('0x2f'),'data1':_0x0549('0x5a')},_0x48e11d));}});return db[_0x0549('0x3c')][_0x0549('0x3d')](_0xe4fa99['concat'](_0x159e20),{'individualHooks':!![]});}})['then'](function(){if(_0x2e2164){return _0x2e2164[_0x0549('0x2e')]({'online':!![],'lastLoginAt':moment()[_0x0549('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2e2164[_0x0549('0x4f')]||![],'mailPause':_0x2e2164['loginInPause']||![],'chatPause':_0x2e2164[_0x0549('0x4f')]||![],'faxPause':_0x2e2164[_0x0549('0x4f')]||![],'smsPause':_0x2e2164[_0x0549('0x4f')]||![],'openchannelPause':_0x2e2164[_0x0549('0x4f')]||![],'pauseType':_0x2e2164[_0x0549('0x4f')]?_0x0549('0x5a'):null,'lastPauseAt':moment()[_0x0549('0x35')](_0x0549('0x30')),'interface':_0x115bd2});}})['then'](function(_0x3e195b){_0x239dd1(_0x3e195b);})[_0x0549('0x1c')](function(_0x4f5612){_0x3fa06f(_0x367fee[_0x0549('0x16')](0x1f4,_0x4f5612['message']));});});}; \ No newline at end of file +var _0xbb56=['http','redis','defaults','localhost','./user.socket','register','then','info','User,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetUser','User','options','raw','attributes','limit','include','model','map','where','ShowUser','debug','PauseUser','find','name','internal','interface','findAll','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','SIP/%s','body','uniqueid','MemberReport','bulkCreate','update','type','DEFAULT\x20PAUSE','UnpauseUser','channel','isValidChannel','Unknown\x20channel','voice','mail','chat','fax','sms','set','system','all','LogoutUser','findOne','destroy','LoginUser','role','mobile','phone','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueueRt','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5d2feb,_0x488cf4){var _0x3cb1b5=function(_0x556e0f){while(--_0x556e0f){_0x5d2feb['push'](_0x5d2feb['shift']());}};_0x3cb1b5(++_0x488cf4);}(_0xbb56,0x167));var _0x6bb5=function(_0x518b3e,_0x571e0f){_0x518b3e=_0x518b3e-0x0;var _0x5296b0=_0xbb56[_0x518b3e];return _0x5296b0;};'use strict';var _=require(_0x6bb5('0x0'));var util=require(_0x6bb5('0x1'));var moment=require(_0x6bb5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6bb5('0x3'));var db=require(_0x6bb5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6bb5('0x5'))(_0x6bb5('0x6'));var config=require(_0x6bb5('0x7'));var jayson=require(_0x6bb5('0x8'));var client=jayson['client'][_0x6bb5('0x9')]({'port':0x232a});config[_0x6bb5('0xa')]=_[_0x6bb5('0xb')](config[_0x6bb5('0xa')],{'host':_0x6bb5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6bb5('0xa')]));require(_0x6bb5('0xd'))[_0x6bb5('0xe')](socket);function respondWithRpcPromise(_0x156530,_0x4f69fd,_0x45ef60){return new BPromise(function(_0xcd65b3,_0x492bed){return client['request'](_0x156530,_0x45ef60)[_0x6bb5('0xf')](function(_0x2e371c){logger[_0x6bb5('0x10')](_0x6bb5('0x11'),_0x4f69fd,'request\x20sent');logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x4f69fd,_0x6bb5('0x12'),JSON[_0x6bb5('0x13')](_0x2e371c));if(_0x2e371c[_0x6bb5('0x14')]){if(_0x2e371c[_0x6bb5('0x14')][_0x6bb5('0x15')]===0x1f4){logger[_0x6bb5('0x14')]('User,\x20%s,\x20%s',_0x4f69fd,_0x2e371c[_0x6bb5('0x14')][_0x6bb5('0x16')]);return _0x492bed(_0x2e371c[_0x6bb5('0x14')][_0x6bb5('0x16')]);}logger[_0x6bb5('0x14')](_0x6bb5('0x11'),_0x4f69fd,_0x2e371c[_0x6bb5('0x14')][_0x6bb5('0x16')]);return _0xcd65b3(_0x2e371c[_0x6bb5('0x14')][_0x6bb5('0x16')]);}else{logger[_0x6bb5('0x10')](_0x6bb5('0x11'),_0x4f69fd,'request\x20sent');_0xcd65b3(_0x2e371c[_0x6bb5('0x17')]['message']);}})[_0x6bb5('0x18')](function(_0x339600){logger[_0x6bb5('0x14')](_0x6bb5('0x11'),_0x4f69fd,_0x339600);_0x492bed(_0x339600);});});}exports[_0x6bb5('0x19')]=function(_0x3b9dd0){var _0x11fefd=this;return new Promise(function(_0x47c6c9,_0x10b4f8){return db[_0x6bb5('0x1a')]['findAll']({'raw':_0x3b9dd0[_0x6bb5('0x1b')]?_0x3b9dd0[_0x6bb5('0x1b')][_0x6bb5('0x1c')]===undefined?!![]:![]:!![],'where':_0x3b9dd0[_0x6bb5('0x1b')]?_0x3b9dd0[_0x6bb5('0x1b')]['where']||null:null,'attributes':_0x3b9dd0[_0x6bb5('0x1b')]?_0x3b9dd0[_0x6bb5('0x1b')][_0x6bb5('0x1d')]||null:null,'limit':_0x3b9dd0[_0x6bb5('0x1b')]?_0x3b9dd0[_0x6bb5('0x1b')][_0x6bb5('0x1e')]||null:null,'include':_0x3b9dd0[_0x6bb5('0x1b')]?_0x3b9dd0[_0x6bb5('0x1b')][_0x6bb5('0x1f')]?_['map'](_0x3b9dd0['options']['include'],function(_0x3d761e){return{'model':db[_0x3d761e[_0x6bb5('0x20')]],'as':_0x3d761e['as'],'attributes':_0x3d761e[_0x6bb5('0x1d')],'include':_0x3d761e[_0x6bb5('0x1f')]?_[_0x6bb5('0x21')](_0x3d761e[_0x6bb5('0x1f')],function(_0x4a8d3e){return{'model':db[_0x4a8d3e['model']],'as':_0x4a8d3e['as'],'attributes':_0x4a8d3e[_0x6bb5('0x1d')],'include':_0x4a8d3e[_0x6bb5('0x1f')]?_[_0x6bb5('0x21')](_0x4a8d3e[_0x6bb5('0x1f')],function(_0x4a6a2e){return{'model':db[_0x4a6a2e[_0x6bb5('0x20')]],'as':_0x4a6a2e['as'],'attributes':_0x4a6a2e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x567ffa){logger['info'](_0x6bb5('0x19'),_0x3b9dd0);logger['debug'](_0x6bb5('0x19'),_0x3b9dd0,JSON['stringify'](_0x567ffa));_0x47c6c9(_0x567ffa);})['catch'](function(_0x4a1301){logger[_0x6bb5('0x14')](_0x6bb5('0x19'),_0x4a1301[_0x6bb5('0x16')],_0x3b9dd0);_0x10b4f8(_0x11fefd[_0x6bb5('0x14')](0x1f4,_0x4a1301['message']));});});};exports['ShowUser']=function(_0x37c7e2){var _0x3b06d8=this;return new Promise(function(_0x42a58c,_0x2fd553){return db[_0x6bb5('0x1a')]['find']({'raw':_0x37c7e2[_0x6bb5('0x1b')]?_0x37c7e2[_0x6bb5('0x1b')][_0x6bb5('0x1c')]===undefined?!![]:![]:!![],'where':_0x37c7e2[_0x6bb5('0x1b')]?_0x37c7e2[_0x6bb5('0x1b')][_0x6bb5('0x22')]||null:null,'attributes':_0x37c7e2[_0x6bb5('0x1b')]?_0x37c7e2['options'][_0x6bb5('0x1d')]||null:null,'include':_0x37c7e2['options']?_0x37c7e2[_0x6bb5('0x1b')][_0x6bb5('0x1f')]?_[_0x6bb5('0x21')](_0x37c7e2[_0x6bb5('0x1b')][_0x6bb5('0x1f')],function(_0x4c0568){return{'model':db[_0x4c0568[_0x6bb5('0x20')]],'as':_0x4c0568['as'],'attributes':_0x4c0568[_0x6bb5('0x1d')],'include':_0x4c0568[_0x6bb5('0x1f')]?_[_0x6bb5('0x21')](_0x4c0568[_0x6bb5('0x1f')],function(_0x153a4c){return{'model':db[_0x153a4c[_0x6bb5('0x20')]],'as':_0x153a4c['as'],'attributes':_0x153a4c[_0x6bb5('0x1d')],'include':_0x153a4c[_0x6bb5('0x1f')]?_[_0x6bb5('0x21')](_0x153a4c[_0x6bb5('0x1f')],function(_0x2b88fb){return{'model':db[_0x2b88fb[_0x6bb5('0x20')]],'as':_0x2b88fb['as'],'attributes':_0x2b88fb[_0x6bb5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6bb5('0xf')](function(_0x4404eb){logger[_0x6bb5('0x10')](_0x6bb5('0x23'),_0x37c7e2);logger[_0x6bb5('0x24')]('ShowUser',_0x37c7e2,JSON[_0x6bb5('0x13')](_0x4404eb));_0x42a58c(_0x4404eb);})['catch'](function(_0x4b0340){logger[_0x6bb5('0x14')](_0x6bb5('0x23'),_0x4b0340[_0x6bb5('0x16')],_0x37c7e2);_0x2fd553(_0x3b06d8[_0x6bb5('0x14')](0x1f4,_0x4b0340['message']));});});};exports[_0x6bb5('0x25')]=function(_0x1f219e){var _0x18505f=this;return new Promise(function(_0x56e57b,_0x398168){var _0x2eb1f2;return db[_0x6bb5('0x1a')][_0x6bb5('0x26')]({'where':_0x1f219e['options'][_0x6bb5('0x22')]||{},'attributes':['id',_0x6bb5('0x27'),'role',_0x6bb5('0x28'),_0x6bb5('0x29')]})[_0x6bb5('0xf')](function(_0xa2070f){if(_0xa2070f){_0x2eb1f2=_0xa2070f;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x2eb1f2['id']},'individualHooks':!![]});}})['then'](function(){if(_0x2eb1f2){return db['MemberReport'][_0x6bb5('0x2a')]({'where':{'membername':_0x2eb1f2['name'],'type':_0x6bb5('0x2b'),'exitAt':null}});}})['then'](function(_0xd15f61){if(_0x2eb1f2){if(_0xd15f61&&_0xd15f61[_0x6bb5('0x2c')]){var _0x542ee3=moment()[_0x6bb5('0x2d')](_0x6bb5('0x2e'));for(var _0x4bafd7=0x0,_0x2417b2=_0xd15f61[_0x6bb5('0x2c')];_0x4bafd7<_0x2417b2;_0x4bafd7++){_0xd15f61[_0x4bafd7]['updateAttributes']({'exitAt':_0x542ee3});}}}})[_0x6bb5('0xf')](function(){if(_0x2eb1f2){var _0x431a29=[];var _0x83372b=utils[_0x6bb5('0x2f')]();_0x83372b[_0x6bb5('0x30')](function(_0x3ff20e){_0x431a29[_0x6bb5('0x31')]({'channel':_0x3ff20e,'membername':_0x2eb1f2[_0x6bb5('0x27')],'interface':_['isNil'](_0x2eb1f2[_0x6bb5('0x29')])?util['format'](_0x6bb5('0x32'),_0x2eb1f2[_0x6bb5('0x27')]):_0x2eb1f2[_0x6bb5('0x29')],'type':_0x6bb5('0x2b'),'enterAt':moment()[_0x6bb5('0x2d')](_0x6bb5('0x2e')),'data1':_0x1f219e[_0x6bb5('0x33')]['type']||'DEFAULT\x20PAUSE','role':_0x2eb1f2['role'],'internal':_0x2eb1f2['internal'],'uniqueid':_0x1f219e[_0x6bb5('0x33')][_0x6bb5('0x34')]||null});});return db[_0x6bb5('0x35')][_0x6bb5('0x36')](_0x431a29,{'individualHooks':!![]});}})[_0x6bb5('0xf')](function(){if(_0x2eb1f2){return _0x2eb1f2[_0x6bb5('0x37')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x1f219e[_0x6bb5('0x33')][_0x6bb5('0x38')]||_0x6bb5('0x39'),'lastPauseAt':moment()['format'](_0x6bb5('0x2e'))});}})[_0x6bb5('0xf')](function(_0x36ada3){_0x56e57b(_0x36ada3);})[_0x6bb5('0x18')](function(_0x34df3e){_0x398168(_0x18505f[_0x6bb5('0x14')](0x1f4,_0x34df3e['message']));});});};exports[_0x6bb5('0x3a')]=function(_0x47938f){var _0x32da15=this;return new Promise(function(_0x169412,_0x56216d){var _0xcdfa02;return db[_0x6bb5('0x1a')]['findOne']({'where':_0x47938f[_0x6bb5('0x1b')][_0x6bb5('0x22')]||{},'attributes':['id','name']})['then'](function(_0x3dc678){if(_0x3dc678){_0xcdfa02=_0x3dc678;if(_0x47938f[_0x6bb5('0x33')][_0x6bb5('0x3b')]&&!utils[_0x6bb5('0x3c')](_0x47938f[_0x6bb5('0x33')][_0x6bb5('0x3b')])){throw new Error(_0x6bb5('0x3d'));}switch(_0x47938f[_0x6bb5('0x33')][_0x6bb5('0x3b')]){case _0x6bb5('0x3e'):return db['UserVoiceQueueRt'][_0x6bb5('0x37')]({'paused':0x0},{'where':{'UserId':_0xcdfa02['id']}})[_0x6bb5('0xf')](function(){return db[_0x6bb5('0x35')][_0x6bb5('0x26')]({'where':{'channel':_0x47938f[_0x6bb5('0x33')][_0x6bb5('0x3b')],'membername':_0xcdfa02[_0x6bb5('0x27')],'type':_0x6bb5('0x2b'),'exitAt':null}});})[_0x6bb5('0xf')](function(_0x3740d6){if(_0x3740d6){return _0x3740d6[_0x6bb5('0x37')]({'exitAt':moment()[_0x6bb5('0x2d')](_0x6bb5('0x2e')),'data2':'system'},{'individualHooks':!![]});}return null;})['then'](function(){return _0xcdfa02[_0x6bb5('0x37')]({'voicePause':![]});});case _0x6bb5('0x3f'):case _0x6bb5('0x40'):case _0x6bb5('0x41'):case _0x6bb5('0x42'):case'openchannel':return db['MemberReport'][_0x6bb5('0x26')]({'where':{'channel':_0x47938f[_0x6bb5('0x33')][_0x6bb5('0x3b')],'membername':_0xcdfa02[_0x6bb5('0x27')],'type':'PAUSE','exitAt':null}})[_0x6bb5('0xf')](function(_0x26b845){return _0x26b845[_0x6bb5('0x37')]({'exitAt':moment()[_0x6bb5('0x2d')](_0x6bb5('0x2e')),'data2':'system'},{'individualHooks':!![]});})[_0x6bb5('0xf')](function(){var _0x1e3051={};_[_0x6bb5('0x43')](_0x1e3051,util[_0x6bb5('0x2d')]('%s%s',_0x47938f[_0x6bb5('0x33')]['channel'],'Pause'),![]);return _0xcdfa02[_0x6bb5('0x37')](_0x1e3051);});default:return db['UserVoiceQueueRt'][_0x6bb5('0x37')]({'paused':0x0},{'where':{'UserId':_0xcdfa02['id']}})[_0x6bb5('0xf')](function(){return db[_0x6bb5('0x35')]['findAll']({'where':{'membername':_0xcdfa02[_0x6bb5('0x27')],'type':_0x6bb5('0x2b'),'exitAt':null}});})[_0x6bb5('0xf')](function(_0x411185){var _0x120b9e=[];_0x411185[_0x6bb5('0x30')](function(_0x542a8f){_0x120b9e['push'](_0x542a8f['update']({'exitAt':moment()[_0x6bb5('0x2d')](_0x6bb5('0x2e')),'data2':_0x6bb5('0x44')}));});return BPromise[_0x6bb5('0x45')](_0x120b9e);})['then'](function(){return _0xcdfa02[_0x6bb5('0x37')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x6bb5('0xf')](function(_0x1cab22){_0x169412(_0x1cab22);})[_0x6bb5('0x18')](function(_0x5d0d19){_0x56216d(_0x32da15[_0x6bb5('0x14')](0x1f4,_0x5d0d19[_0x6bb5('0x16')]));});});};exports[_0x6bb5('0x46')]=function(_0x26fdbb){var _0x31964b=this;return new Promise(function(_0x2d289c,_0x712a83){var _0xa0288e;return db[_0x6bb5('0x1a')][_0x6bb5('0x47')]({'where':_0x26fdbb[_0x6bb5('0x1b')][_0x6bb5('0x22')]||{},'attributes':['id','name']})['then'](function(_0x4de131){if(_0x4de131){_0xa0288e=_0x4de131;return db['UserVoiceQueueRt'][_0x6bb5('0x48')]({'where':{'membername':_0xa0288e['name']},'individualHooks':!![]});}})[_0x6bb5('0xf')](function(){if(_0xa0288e){return db['MemberReport'][_0x6bb5('0x2a')]({'where':{'membername':_0xa0288e[_0x6bb5('0x27')],'exitAt':null}});}})[_0x6bb5('0xf')](function(_0x1668a5){if(_0xa0288e){if(_0x1668a5&&_0x1668a5['length']){var _0x4e0893=[];_0x1668a5['forEach'](function(_0x29c6eb){_0x4e0893[_0x6bb5('0x31')](_0x29c6eb[_0x6bb5('0x37')]({'exitAt':moment()[_0x6bb5('0x2d')](_0x6bb5('0x2e'))}));});return BPromise[_0x6bb5('0x45')](_0x4e0893);}}})['then'](function(){if(_0xa0288e){return _0xa0288e['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x6bb5('0xf')](function(_0x3cbd9c){_0x2d289c(_0x3cbd9c);})['catch'](function(_0x255da5){_0x712a83(_0x31964b['error'](0x1f4,_0x255da5['message']));});});};exports[_0x6bb5('0x49')]=function(_0xedbdf7){var _0x7a6127=this;return new Promise(function(_0x2d8bf9,_0x56c8fb){var _0x464edd;var _0x42cf33;var _0x293f26;var _0x2c1452;return db['User'][_0x6bb5('0x47')]({'where':_0xedbdf7[_0x6bb5('0x1b')][_0x6bb5('0x22')]||{},'attributes':['id',_0x6bb5('0x27'),_0x6bb5('0x4a'),_0x6bb5('0x4b'),_0x6bb5('0x4c'),'internal','loginInPause',_0x6bb5('0x29')]})['then'](function(_0x1de8b1){if(_0x1de8b1){_0x464edd=_0x1de8b1;_0x2c1452=_0xedbdf7['body'][_0x6bb5('0x29')]?_0xedbdf7[_0x6bb5('0x33')][_0x6bb5('0x29')]:util[_0x6bb5('0x2d')](_0x6bb5('0x32'),_0x464edd[_0x6bb5('0x27')]);return db[_0x6bb5('0x1a')][_0x6bb5('0x4d')]({'where':{'role':_0x6bb5('0x4e'),'online':!![],'id':{'$ne':_0x464edd['id']}}});}})[_0x6bb5('0xf')](function(_0x33f586){if(_0x33f586){_0x293f26=_0x33f586;return require(_0x6bb5('0x4f'))['getLicense']();}})[_0x6bb5('0xf')](function(_0x58bf09){if(_0x58bf09&&_0x58bf09[_0x6bb5('0x50')]&&_0x293f26>=_0x58bf09[_0x6bb5('0x50')]){throw new Error(_0x6bb5('0x51'));}})[_0x6bb5('0xf')](function(){if(_0x464edd){return db[_0x6bb5('0x52')][_0x6bb5('0x48')]({'where':{'membername':_0x464edd[_0x6bb5('0x27')]},'individualHooks':!![]});}})[_0x6bb5('0xf')](function(){if(_0x464edd){return _0x464edd[_0x6bb5('0x53')]({'raw':!![]});}})[_0x6bb5('0xf')](function(_0x21a974){if(_0x464edd){if(_0x21a974){var _0x42d946=[];_0x42cf33=_0x21a974;if(_0x42cf33[_0x6bb5('0x2c')]){for(var _0x41b0b1=0x0;_0x41b0b1<_0x42cf33[_0x6bb5('0x2c')];_0x41b0b1++){_0x42d946[_0x6bb5('0x31')](db['UserVoiceQueueRt'][_0x6bb5('0x54')]({'membername':_0x464edd[_0x6bb5('0x27')],'UserId':_0x464edd['id'],'queue_name':_0x42cf33[_0x41b0b1][_0x6bb5('0x27')],'VoiceQueueId':_0x42cf33[_0x41b0b1]['id'],'interface':_0x2c1452,'paused':_0x464edd[_0x6bb5('0x55')]||![],'penalty':_0x42cf33[_0x41b0b1][_0x6bb5('0x56')]||0x0}));}return BPromise[_0x6bb5('0x45')](_0x42d946);}}}})[_0x6bb5('0xf')](function(){if(_0x464edd){return db[_0x6bb5('0x35')][_0x6bb5('0x2a')]({'where':{'membername':_0x464edd[_0x6bb5('0x27')],'exitAt':null}});}})[_0x6bb5('0xf')](function(_0x1ee51a){if(_0x464edd){if(_0x1ee51a&&_0x1ee51a['length']){var _0xb788a8=[];_0x1ee51a['forEach'](function(_0x25bcb6){_0xb788a8['push'](_0x25bcb6[_0x6bb5('0x37')]({'exitAt':moment()['format'](_0x6bb5('0x2e'))}));});return BPromise['all'](_0xb788a8);}}})[_0x6bb5('0xf')](function(_0x102171){if(_0x464edd){var _0x5c715a=[];var _0x469a78=[];var _0x5bb48f=utils['getChannels']();var _0x305c03={'membername':_0x464edd[_0x6bb5('0x27')],'interface':_0x2c1452,'enterAt':moment()[_0x6bb5('0x2d')](_0x6bb5('0x2e')),'role':_0x464edd[_0x6bb5('0x4a')],'internal':_0x464edd['internal']};_0x5bb48f[_0x6bb5('0x30')](function(_0x4f5c6f){_0x5c715a[_0x6bb5('0x31')](_[_0x6bb5('0x57')]({'channel':_0x4f5c6f,'type':_0x6bb5('0x58'),'data1':_0x6bb5('0x59'),'data2':_0x2c1452},_0x305c03));if(_0x464edd[_0x6bb5('0x55')]){_0x469a78[_0x6bb5('0x31')](_[_0x6bb5('0x57')]({'channel':_0x4f5c6f,'type':_0x6bb5('0x2b'),'data1':_0x6bb5('0x5a')},_0x305c03));}});return db[_0x6bb5('0x35')][_0x6bb5('0x36')](_0x5c715a[_0x6bb5('0x5b')](_0x469a78),{'individualHooks':!![]});}})[_0x6bb5('0xf')](function(){if(_0x464edd){return _0x464edd[_0x6bb5('0x37')]({'online':!![],'lastLoginAt':moment()[_0x6bb5('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x464edd[_0x6bb5('0x55')]||![],'mailPause':_0x464edd['loginInPause']||![],'chatPause':_0x464edd[_0x6bb5('0x55')]||![],'faxPause':_0x464edd[_0x6bb5('0x55')]||![],'smsPause':_0x464edd[_0x6bb5('0x55')]||![],'openchannelPause':_0x464edd['loginInPause']||![],'pauseType':_0x464edd[_0x6bb5('0x55')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x6bb5('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x2c1452});}})['then'](function(_0x594fa0){_0x2d8bf9(_0x594fa0);})[_0x6bb5('0x18')](function(_0x30a4f3){_0x56c8fb(_0x7a6127[_0x6bb5('0x14')](0x1f4,_0x30a4f3[_0x6bb5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index b8a95bb..cf0ce5e 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 _0x5d18=['removeListener','register','length','user:','save','update','emit'];(function(_0xf51370,_0x289f97){var _0x5a9acb=function(_0x57233e){while(--_0x57233e){_0xf51370['push'](_0xf51370['shift']());}};_0x5a9acb(++_0x289f97);}(_0x5d18,0x1e0));var _0x85d1=function(_0x38c1bb,_0x52b5a7){_0x38c1bb=_0x38c1bb-0x0;var _0x1a8193=_0x5d18[_0x38c1bb];return _0x1a8193;};'use strict';var UserEvents=require('./user.events');var events=[_0x85d1('0x0'),'remove',_0x85d1('0x1')];function createListener(_0x1e63eb,_0x3682cf){return function(_0x2a6d94){_0x3682cf[_0x85d1('0x2')](_0x1e63eb,_0x2a6d94);};}function removeListener(_0x33991c,_0x5d55f1){return function(){UserEvents[_0x85d1('0x3')](_0x33991c,_0x5d55f1);};}exports[_0x85d1('0x4')]=function(_0x316c8){for(var _0x5b93de=0x0,_0x1bf828=events[_0x85d1('0x5')];_0x5b93de<_0x1bf828;_0x5b93de++){var _0x4e965f=events[_0x5b93de];var _0x30bd4e=createListener(_0x85d1('0x6')+_0x4e965f,_0x316c8);UserEvents['on'](_0x4e965f,_0x30bd4e);}}; \ No newline at end of file +var _0x38da=['update','removeListener','register','length','user:','save','remove'];(function(_0x23884b,_0x50c307){var _0x28113b=function(_0xce3fea){while(--_0xce3fea){_0x23884b['push'](_0x23884b['shift']());}};_0x28113b(++_0x50c307);}(_0x38da,0x8a));var _0xa38d=function(_0x3ae38e,_0x3aaa14){_0x3ae38e=_0x3ae38e-0x0;var _0x483595=_0x38da[_0x3ae38e];return _0x483595;};'use strict';var UserEvents=require('./user.events');var events=[_0xa38d('0x0'),_0xa38d('0x1'),_0xa38d('0x2')];function createListener(_0x5bf4fb,_0xdab8e){return function(_0x48f34b){_0xdab8e['emit'](_0x5bf4fb,_0x48f34b);};}function removeListener(_0x33ce43,_0x352836){return function(){UserEvents[_0xa38d('0x3')](_0x33ce43,_0x352836);};}exports[_0xa38d('0x4')]=function(_0x281a73){for(var _0x401b21=0x0,_0x4a9e36=events[_0xa38d('0x5')];_0x401b21<_0x4a9e36;_0x401b21++){var _0x273763=events[_0x401b21];var _0x542e20=createListener(_0xa38d('0x6')+_0x273763,_0x281a73);UserEvents['on'](_0x273763,_0x542e20);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index ff349c3..2c760bf 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 _0x2c79=['../../config/environment','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x47ee23,_0x58aad2){var _0x5b4718=function(_0x25cd81){while(--_0x25cd81){_0x47ee23['push'](_0x47ee23['shift']());}};_0x5b4718(++_0x58aad2);}(_0x2c79,0x1df));var _0x92c7=function(_0x5bca92,_0x2ea260){_0x5bca92=_0x5bca92-0x0;var _0x457763=_0x2c79[_0x5bca92];return _0x457763;};'use strict';var multer=require(_0x92c7('0x0'));var util=require(_0x92c7('0x1'));var path=require(_0x92c7('0x2'));var timeout=require(_0x92c7('0x3'));var express=require(_0x92c7('0x4'));var router=express['Router']();var auth=require(_0x92c7('0x5'));var interaction=require(_0x92c7('0x6'));var config=require(_0x92c7('0x7'));module[_0x92c7('0x8')]=router; \ No newline at end of file +var _0x6c13=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','Router'];(function(_0x44deee,_0x191c21){var _0x2d015a=function(_0x2005dd){while(--_0x2005dd){_0x44deee['push'](_0x44deee['shift']());}};_0x2d015a(++_0x191c21);}(_0x6c13,0xb4));var _0x36c1=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x6c13[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x36c1('0x0'));var util=require(_0x36c1('0x1'));var path=require('path');var timeout=require(_0x36c1('0x2'));var express=require('express');var router=express[_0x36c1('0x3')]();var auth=require(_0x36c1('0x4'));var interaction=require(_0x36c1('0x5'));var config=require(_0x36c1('0x6'));module[_0x36c1('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 bd998d7..e3e162d 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x30b82b,_0x4806c6){var _0x231927=function(_0xc5d062){while(--_0xc5d062){_0x30b82b['push'](_0x30b82b['shift']());}};_0x231927(++_0x4806c6);}(_0xe706,0xa3));var _0x6e70=function(_0x281372,_0x2a5398){_0x281372=_0x281372-0x0;var _0x4957b6=_0xe706[_0x281372];return _0x4957b6;};'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(_0x4c8240,_0x2726cb){var _0x197de3=function(_0x7aa97c){while(--_0x7aa97c){_0x4c8240['push'](_0x4c8240['shift']());}};_0x197de3(++_0x2726cb);}(_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/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 968b5ef..23fc6de 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 _0x48e3=['../../config/environment','./userChatQueue.attributes','define','user_has_chat_queues','lodash','api','moment','bluebird','rimraf'];(function(_0x2d2ada,_0x17ed6b){var _0x3ea55e=function(_0x456f2b){while(--_0x456f2b){_0x2d2ada['push'](_0x2d2ada['shift']());}};_0x3ea55e(++_0x17ed6b);}(_0x48e3,0x1ea));var _0x348e=function(_0x57db97,_0x22495d){_0x57db97=_0x57db97-0x0;var _0x8a2b42=_0x48e3[_0x57db97];return _0x8a2b42;};'use strict';var _=require(_0x348e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x348e('0x1'));var moment=require(_0x348e('0x2'));var BPromise=require(_0x348e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x348e('0x4'));var config=require(_0x348e('0x5'));var attributes=require(_0x348e('0x6'));module['exports']=function(_0x218f51,_0x9139ed){return _0x218f51[_0x348e('0x7')]('UserChatQueue',attributes,{'tableName':_0x348e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe77c=['UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x55db3b,_0x15f413){var _0x2412dc=function(_0x45caa7){while(--_0x45caa7){_0x55db3b['push'](_0x55db3b['shift']());}};_0x2412dc(++_0x15f413);}(_0xe77c,0x176));var _0xce77=function(_0x3dc30d,_0x3eee3c){_0x3dc30d=_0x3dc30d-0x0;var _0x225236=_0xe77c[_0x3dc30d];return _0x225236;};'use strict';var _=require(_0xce77('0x0'));var util=require(_0xce77('0x1'));var logger=require(_0xce77('0x2'))('api');var moment=require(_0xce77('0x3'));var BPromise=require(_0xce77('0x4'));var rp=require(_0xce77('0x5'));var fs=require('fs');var path=require(_0xce77('0x6'));var rimraf=require(_0xce77('0x7'));var config=require(_0xce77('0x8'));var attributes=require(_0xce77('0x9'));module['exports']=function(_0x5aea39,_0xed47c5){return _0x5aea39['define'](_0xce77('0xa'),attributes,{'tableName':_0xce77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 5c50fe6..eff0e1b 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 _0xd36e=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserChatQueue,\x20%s,\x20%s','message','catch','util','bluebird','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x515be2,_0x51b3ff){var _0x514679=function(_0x562c51){while(--_0x562c51){_0x515be2['push'](_0x515be2['shift']());}};_0x514679(++_0x51b3ff);}(_0xd36e,0xd4));var _0xed36=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd36e[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0xed36('0x0'));var moment=require('moment');var BPromise=require(_0xed36('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xed36('0x2'));var config=require(_0xed36('0x3'));var jayson=require(_0xed36('0x4'));var client=jayson[_0xed36('0x5')][_0xed36('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4f3dc4,_0x3fa6f3,_0x3875a0){return new BPromise(function(_0x24b25d,_0x355d6a){return client['request'](_0x4f3dc4,_0x3875a0)[_0xed36('0x7')](function(_0x1048e6){logger[_0xed36('0x8')]('UserChatQueue,\x20%s,\x20%s',_0x3fa6f3,'request\x20sent');logger[_0xed36('0x9')](_0xed36('0xa'),_0x3fa6f3,_0xed36('0xb'),JSON[_0xed36('0xc')](_0x1048e6));if(_0x1048e6[_0xed36('0xd')]){if(_0x1048e6[_0xed36('0xd')]['code']===0x1f4){logger[_0xed36('0xd')](_0xed36('0xe'),_0x3fa6f3,_0x1048e6[_0xed36('0xd')]['message']);return _0x355d6a(_0x1048e6[_0xed36('0xd')][_0xed36('0xf')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x3fa6f3,_0x1048e6['error'][_0xed36('0xf')]);return _0x24b25d(_0x1048e6[_0xed36('0xd')][_0xed36('0xf')]);}else{logger['info'](_0xed36('0xe'),_0x3fa6f3,_0xed36('0xb'));_0x24b25d(_0x1048e6['result'][_0xed36('0xf')]);}})[_0xed36('0x10')](function(_0x54219c){logger['error'](_0xed36('0xe'),_0x3fa6f3,_0x54219c);_0x355d6a(_0x54219c);});});} \ No newline at end of file +var _0xe6a4=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','info','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe6a4,0x7f));var _0x4e6a=function(_0x175bc6,_0xd90ea1){_0x175bc6=_0x175bc6-0x0;var _0x47cfc8=_0xe6a4[_0x175bc6];return _0x47cfc8;};'use strict';var _=require('lodash');var util=require(_0x4e6a('0x0'));var moment=require(_0x4e6a('0x1'));var BPromise=require(_0x4e6a('0x2'));var rs=require(_0x4e6a('0x3'));var fs=require('fs');var Redis=require(_0x4e6a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e6a('0x5'));var logger=require(_0x4e6a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4e6a('0x7'));var client=jayson[_0x4e6a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7bd966,_0x505463,_0x57814b){return new BPromise(function(_0x56f84b,_0xe7663d){return client[_0x4e6a('0x9')](_0x7bd966,_0x57814b)['then'](function(_0x5c6f88){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x505463,'request\x20sent');logger[_0x4e6a('0xa')](_0x4e6a('0xb'),_0x505463,_0x4e6a('0xc'),JSON[_0x4e6a('0xd')](_0x5c6f88));if(_0x5c6f88['error']){if(_0x5c6f88[_0x4e6a('0xe')][_0x4e6a('0xf')]===0x1f4){logger[_0x4e6a('0xe')](_0x4e6a('0x10'),_0x505463,_0x5c6f88[_0x4e6a('0xe')][_0x4e6a('0x11')]);return _0xe7663d(_0x5c6f88['error'][_0x4e6a('0x11')]);}logger[_0x4e6a('0xe')](_0x4e6a('0x10'),_0x505463,_0x5c6f88[_0x4e6a('0xe')][_0x4e6a('0x11')]);return _0x56f84b(_0x5c6f88[_0x4e6a('0xe')][_0x4e6a('0x11')]);}else{logger[_0x4e6a('0x12')](_0x4e6a('0x10'),_0x505463,_0x4e6a('0xc'));_0x56f84b(_0x5c6f88[_0x4e6a('0x13')][_0x4e6a('0x11')]);}})[_0x4e6a('0x14')](function(_0x2e10b5){logger[_0x4e6a('0xe')](_0x4e6a('0x10'),_0x505463,_0x2e10b5);_0xe7663d(_0x2e10b5);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 05ce96b..beaddd3 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 _0x67f9=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4482d8,_0x12703b){var _0x131eb1=function(_0xeab03e){while(--_0xeab03e){_0x4482d8['push'](_0x4482d8['shift']());}};_0x131eb1(++_0x12703b);}(_0x67f9,0x1da));var _0x967f=function(_0x55e710,_0x460e3e){_0x55e710=_0x55e710-0x0;var _0x56e798=_0x67f9[_0x55e710];return _0x56e798;};'use strict';var multer=require(_0x967f('0x0'));var util=require(_0x967f('0x1'));var path=require('path');var timeout=require(_0x967f('0x2'));var express=require(_0x967f('0x3'));var router=express['Router']();var auth=require(_0x967f('0x4'));var interaction=require(_0x967f('0x5'));var config=require(_0x967f('0x6'));module['exports']=router; \ No newline at end of file +var _0x6076=['path','connect-timeout','express','Router','../../components/interaction/service','multer','util'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x6076,0xb4));var _0x6607=function(_0x12cd7b,_0x22af03){_0x12cd7b=_0x12cd7b-0x0;var _0x2358a0=_0x6076[_0x12cd7b];return _0x2358a0;};'use strict';var multer=require(_0x6607('0x0'));var util=require(_0x6607('0x1'));var path=require(_0x6607('0x2'));var timeout=require(_0x6607('0x3'));var express=require(_0x6607('0x4'));var router=express[_0x6607('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x6607('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 4691953..8e4a5d0 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 _0xbaf0=['STRING','exports','INTEGER'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0baf('0x2')]}}; \ No newline at end of file +var _0x7916=['sequelize','INTEGER'];(function(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0x7916,0x128));var _0x6791=function(_0x5d6bd7,_0x3d97d2){_0x5d6bd7=_0x5d6bd7-0x0;var _0x29a88b=_0x7916[_0x5d6bd7];return _0x29a88b;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6791('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6791('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 575dbbf..1337863 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 _0xe730=['bluebird','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment'];(function(_0x4dcf1d,_0x491ea1){var _0x773104=function(_0x4f45c9){while(--_0x4f45c9){_0x4dcf1d['push'](_0x4dcf1d['shift']());}};_0x773104(++_0x491ea1);}(_0xe730,0xf2));var _0x0e73=function(_0x5e491d,_0x5286d0){_0x5e491d=_0x5e491d-0x0;var _0x2f1946=_0xe730[_0x5e491d];return _0x2f1946;};'use strict';var _=require(_0x0e73('0x0'));var util=require(_0x0e73('0x1'));var logger=require(_0x0e73('0x2'))(_0x0e73('0x3'));var moment=require(_0x0e73('0x4'));var BPromise=require(_0x0e73('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0e73('0x6'));var config=require(_0x0e73('0x7'));var attributes=require(_0x0e73('0x8'));module[_0x0e73('0x9')]=function(_0xf2384b,_0xa6d3e8){return _0xf2384b[_0x0e73('0xa')](_0x0e73('0xb'),attributes,{'tableName':_0x0e73('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6838=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues'];(function(_0x1c4b4c,_0x4e1f48){var _0x158ba7=function(_0x3fbec6){while(--_0x3fbec6){_0x1c4b4c['push'](_0x1c4b4c['shift']());}};_0x158ba7(++_0x4e1f48);}(_0x6838,0xa8));var _0x8683=function(_0x4631eb,_0x55649e){_0x4631eb=_0x4631eb-0x0;var _0x562eca=_0x6838[_0x4631eb];return _0x562eca;};'use strict';var _=require(_0x8683('0x0'));var util=require(_0x8683('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8683('0x2'));var BPromise=require(_0x8683('0x3'));var rp=require(_0x8683('0x4'));var fs=require('fs');var path=require(_0x8683('0x5'));var rimraf=require(_0x8683('0x6'));var config=require(_0x8683('0x7'));var attributes=require(_0x8683('0x8'));module[_0x8683('0x9')]=function(_0x186884,_0x2145f2){return _0x186884['define'](_0x8683('0xa'),attributes,{'tableName':_0x8683('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 18cae62..1da0bf7 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 _0x83a7=['error','code','message','UserFaxQueue,\x20%s,\x20%s','result','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','stringify'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x83a7,0x1f2));var _0x783a=function(_0x5590e5,_0x31c616){_0x5590e5=_0x5590e5-0x0;var _0x188a9a=_0x83a7[_0x5590e5];return _0x188a9a;};'use strict';var _=require(_0x783a('0x0'));var util=require(_0x783a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x783a('0x2'));var fs=require('fs');var Redis=require(_0x783a('0x3'));var db=require(_0x783a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x783a('0x5'));var config=require(_0x783a('0x6'));var jayson=require(_0x783a('0x7'));var client=jayson['client'][_0x783a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x103273,_0x57ecf4,_0x417afe){return new BPromise(function(_0x5633f3,_0x1b0e26){return client['request'](_0x103273,_0x417afe)['then'](function(_0x2d03b0){logger[_0x783a('0x9')]('UserFaxQueue,\x20%s,\x20%s',_0x57ecf4,_0x783a('0xa'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x57ecf4,'request\x20sent',JSON[_0x783a('0xb')](_0x2d03b0));if(_0x2d03b0['error']){if(_0x2d03b0[_0x783a('0xc')][_0x783a('0xd')]===0x1f4){logger[_0x783a('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x57ecf4,_0x2d03b0[_0x783a('0xc')][_0x783a('0xe')]);return _0x1b0e26(_0x2d03b0[_0x783a('0xc')]['message']);}logger[_0x783a('0xc')](_0x783a('0xf'),_0x57ecf4,_0x2d03b0[_0x783a('0xc')][_0x783a('0xe')]);return _0x5633f3(_0x2d03b0['error'][_0x783a('0xe')]);}else{logger[_0x783a('0x9')](_0x783a('0xf'),_0x57ecf4,_0x783a('0xa'));_0x5633f3(_0x2d03b0[_0x783a('0x10')]['message']);}})['catch'](function(_0x2c97a2){logger[_0x783a('0xc')](_0x783a('0xf'),_0x57ecf4,_0x2c97a2);_0x1b0e26(_0x2c97a2);});});} \ No newline at end of file +var _0xcb62=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x6e0bf4,_0x3a3699){var _0x1f6a65=function(_0x445e4f){while(--_0x445e4f){_0x6e0bf4['push'](_0x6e0bf4['shift']());}};_0x1f6a65(++_0x3a3699);}(_0xcb62,0xf7));var _0x2cb6=function(_0x2e9e07,_0x1ec21b){_0x2e9e07=_0x2e9e07-0x0;var _0xd03eef=_0xcb62[_0x2e9e07];return _0xd03eef;};'use strict';var _=require(_0x2cb6('0x0'));var util=require(_0x2cb6('0x1'));var moment=require(_0x2cb6('0x2'));var BPromise=require('bluebird');var rs=require(_0x2cb6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cb6('0x4'))['db'];var utils=require(_0x2cb6('0x5'));var logger=require(_0x2cb6('0x6'))('rpc');var config=require(_0x2cb6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2cb6('0x8')][_0x2cb6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ae30a,_0x893a1f,_0x123ea3){return new BPromise(function(_0x176633,_0x25dda9){return client[_0x2cb6('0xa')](_0x2ae30a,_0x123ea3)[_0x2cb6('0xb')](function(_0x4c8637){logger[_0x2cb6('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x893a1f,_0x2cb6('0xd'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x893a1f,_0x2cb6('0xd'),JSON[_0x2cb6('0xe')](_0x4c8637));if(_0x4c8637['error']){if(_0x4c8637[_0x2cb6('0xf')][_0x2cb6('0x10')]===0x1f4){logger['error'](_0x2cb6('0x11'),_0x893a1f,_0x4c8637[_0x2cb6('0xf')][_0x2cb6('0x12')]);return _0x25dda9(_0x4c8637[_0x2cb6('0xf')]['message']);}logger[_0x2cb6('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x893a1f,_0x4c8637[_0x2cb6('0xf')][_0x2cb6('0x12')]);return _0x176633(_0x4c8637[_0x2cb6('0xf')][_0x2cb6('0x12')]);}else{logger[_0x2cb6('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x893a1f,_0x2cb6('0xd'));_0x176633(_0x4c8637[_0x2cb6('0x13')][_0x2cb6('0x12')]);}})[_0x2cb6('0x14')](function(_0x403652){logger[_0x2cb6('0xf')](_0x2cb6('0x11'),_0x893a1f,_0x403652);_0x25dda9(_0x403652);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 2fa823e..8c559df 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 _0xfe06=['path','connect-timeout','express','Router','../../components/interaction/service','exports','multer'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xfe06,0x12c));var _0x6fe0=function(_0x39701d,_0xb4540b){_0x39701d=_0x39701d-0x0;var _0x2aad27=_0xfe06[_0x39701d];return _0x2aad27;};'use strict';var multer=require(_0x6fe0('0x0'));var util=require('util');var path=require(_0x6fe0('0x1'));var timeout=require(_0x6fe0('0x2'));var express=require(_0x6fe0('0x3'));var router=express[_0x6fe0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6fe0('0x5'));var config=require('../../config/environment');module[_0x6fe0('0x6')]=router; \ No newline at end of file +var _0xab50=['../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','Router','../../components/auth/service'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xab50,0x1e3));var _0x0ab5=function(_0x13af99,_0x361303){_0x13af99=_0x13af99-0x0;var _0x326b6a=_0xab50[_0x13af99];return _0x326b6a;};'use strict';var multer=require(_0x0ab5('0x0'));var util=require(_0x0ab5('0x1'));var path=require('path');var timeout=require(_0x0ab5('0x2'));var express=require('express');var router=express[_0x0ab5('0x3')]();var auth=require(_0x0ab5('0x4'));var interaction=require(_0x0ab5('0x5'));var config=require(_0x0ab5('0x6'));module[_0x0ab5('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index cfe676f..c66bae8 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x5c1b69,_0x6868f6){var _0x191c50=function(_0x412a20){while(--_0x412a20){_0x5c1b69['push'](_0x5c1b69['shift']());}};_0x191c50(++_0x6868f6);}(_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 +var _0xd8b0=['exports','sequelize'];(function(_0x71ae3c,_0x404627){var _0x194072=function(_0x13c008){while(--_0x13c008){_0x71ae3c['push'](_0x71ae3c['shift']());}};_0x194072(++_0x404627);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index ff2f087..39660b4 100644 --- a/server/api/userMailQueue/userMailQueue.model.js +++ b/server/api/userMailQueue/userMailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','../../config/logger','api'];(function(_0x56a0ca,_0x3b4cc2){var _0x500af5=function(_0x1974f5){while(--_0x1974f5){_0x56a0ca['push'](_0x56a0ca['shift']());}};_0x500af5(++_0x3b4cc2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util'];(function(_0x5c19f7,_0x4868d9){var _0xa330bd=function(_0x43b487){while(--_0x43b487){_0x5c19f7['push'](_0x5c19f7['shift']());}};_0xa330bd(++_0x4868d9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index fb697f3..82939f2 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 _0xe35c=['request','info','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserMailQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe35c,0x146));var _0xce35=function(_0x3a4132,_0xc1adce){_0x3a4132=_0x3a4132-0x0;var _0x56bb4e=_0xe35c[_0x3a4132];return _0x56bb4e;};'use strict';var _=require(_0xce35('0x0'));var util=require(_0xce35('0x1'));var moment=require(_0xce35('0x2'));var BPromise=require(_0xce35('0x3'));var rs=require(_0xce35('0x4'));var fs=require('fs');var Redis=require(_0xce35('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xce35('0x6'))('rpc');var config=require(_0xce35('0x7'));var jayson=require(_0xce35('0x8'));var client=jayson[_0xce35('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x270b81,_0x2df0d0,_0x2b4a82){return new BPromise(function(_0x74ae5e,_0x55e7f0){return client[_0xce35('0xa')](_0x270b81,_0x2b4a82)['then'](function(_0x549f60){logger[_0xce35('0xb')]('UserMailQueue,\x20%s,\x20%s',_0x2df0d0,'request\x20sent');logger[_0xce35('0xc')](_0xce35('0xd'),_0x2df0d0,_0xce35('0xe'),JSON[_0xce35('0xf')](_0x549f60));if(_0x549f60[_0xce35('0x10')]){if(_0x549f60['error']['code']===0x1f4){logger[_0xce35('0x10')](_0xce35('0x11'),_0x2df0d0,_0x549f60[_0xce35('0x10')][_0xce35('0x12')]);return _0x55e7f0(_0x549f60[_0xce35('0x10')]['message']);}logger['error'](_0xce35('0x11'),_0x2df0d0,_0x549f60[_0xce35('0x10')]['message']);return _0x74ae5e(_0x549f60[_0xce35('0x10')][_0xce35('0x12')]);}else{logger[_0xce35('0xb')](_0xce35('0x11'),_0x2df0d0,_0xce35('0xe'));_0x74ae5e(_0x549f60[_0xce35('0x13')][_0xce35('0x12')]);}})[_0xce35('0x14')](function(_0x4388fd){logger[_0xce35('0x10')](_0xce35('0x11'),_0x2df0d0,_0x4388fd);_0x55e7f0(_0x4388fd);});});} \ No newline at end of file +var _0x734f=['jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x558e97,_0x24311a){var _0x4ccdd4=function(_0x441824){while(--_0x441824){_0x558e97['push'](_0x558e97['shift']());}};_0x4ccdd4(++_0x24311a);}(_0x734f,0x71));var _0xf734=function(_0x3f2fea,_0x3c4ea8){_0x3f2fea=_0x3f2fea-0x0;var _0x69a4d5=_0x734f[_0x3f2fea];return _0x69a4d5;};'use strict';var _=require(_0xf734('0x0'));var util=require(_0xf734('0x1'));var moment=require('moment');var BPromise=require(_0xf734('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf734('0x3'))['db'];var utils=require(_0xf734('0x4'));var logger=require(_0xf734('0x5'))(_0xf734('0x6'));var config=require('../../config/environment');var jayson=require(_0xf734('0x7'));var client=jayson[_0xf734('0x8')][_0xf734('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c23b9,_0x3f04e9,_0x157bc3){return new BPromise(function(_0x33a2c8,_0x492fd5){return client[_0xf734('0xa')](_0x1c23b9,_0x157bc3)[_0xf734('0xb')](function(_0x5acf04){logger[_0xf734('0xc')](_0xf734('0xd'),_0x3f04e9,_0xf734('0xe'));logger[_0xf734('0xf')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x3f04e9,'request\x20sent',JSON[_0xf734('0x10')](_0x5acf04));if(_0x5acf04[_0xf734('0x11')]){if(_0x5acf04[_0xf734('0x11')]['code']===0x1f4){logger[_0xf734('0x11')](_0xf734('0xd'),_0x3f04e9,_0x5acf04[_0xf734('0x11')]['message']);return _0x492fd5(_0x5acf04['error'][_0xf734('0x12')]);}logger[_0xf734('0x11')](_0xf734('0xd'),_0x3f04e9,_0x5acf04[_0xf734('0x11')][_0xf734('0x12')]);return _0x33a2c8(_0x5acf04[_0xf734('0x11')][_0xf734('0x12')]);}else{logger[_0xf734('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x3f04e9,'request\x20sent');_0x33a2c8(_0x5acf04[_0xf734('0x13')][_0xf734('0x12')]);}})['catch'](function(_0x313b9a){logger[_0xf734('0x11')](_0xf734('0xd'),_0x3f04e9,_0x313b9a);_0x492fd5(_0x313b9a);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index fac38fb..e6fc96f 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 _0x63ec=['../../config/environment','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x30c48d,_0x25e828){var _0x2c64aa=function(_0x244ae6){while(--_0x244ae6){_0x30c48d['push'](_0x30c48d['shift']());}};_0x2c64aa(++_0x25e828);}(_0x63ec,0x1e4));var _0xc63e=function(_0x321237,_0x17bf3a){_0x321237=_0x321237-0x0;var _0x1564e5=_0x63ec[_0x321237];return _0x1564e5;};'use strict';var multer=require(_0xc63e('0x0'));var util=require(_0xc63e('0x1'));var path=require('path');var timeout=require(_0xc63e('0x2'));var express=require(_0xc63e('0x3'));var router=express[_0xc63e('0x4')]();var auth=require(_0xc63e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc63e('0x6'));module['exports']=router; \ No newline at end of file +var _0x29ed=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x155d44,_0x356cde){var _0x594a7a=function(_0x314b3e){while(--_0x314b3e){_0x155d44['push'](_0x155d44['shift']());}};_0x594a7a(++_0x356cde);}(_0x29ed,0x15c));var _0xd29e=function(_0x4174b3,_0x274e24){_0x4174b3=_0x4174b3-0x0;var _0x16cb3d=_0x29ed[_0x4174b3];return _0x16cb3d;};'use strict';var multer=require(_0xd29e('0x0'));var util=require(_0xd29e('0x1'));var path=require(_0xd29e('0x2'));var timeout=require(_0xd29e('0x3'));var express=require(_0xd29e('0x4'));var router=express[_0xd29e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd29e('0x6'));var config=require(_0xd29e('0x7'));module[_0xd29e('0x8')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index e1e72dd..28c41e4 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x24b05e,_0x203446){var _0x2c47da=function(_0x417a27){while(--_0x417a27){_0x24b05e['push'](_0x24b05e['shift']());}};_0x2c47da(++_0x203446);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x2a11c8,_0x25b238){var _0x5bf10b=function(_0x2ba18b){while(--_0x2ba18b){_0x2a11c8['push'](_0x2a11c8['shift']());}};_0x5bf10b(++_0x25b238);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 40437ef..7c83c95 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 _0xb0b3=['api','moment','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger'];(function(_0x9b3919,_0x367eac){var _0x545046=function(_0x7be416){while(--_0x7be416){_0x9b3919['push'](_0x9b3919['shift']());}};_0x545046(++_0x367eac);}(_0xb0b3,0x19d));var _0x3b0b=function(_0x28b14d,_0x7deae5){_0x28b14d=_0x28b14d-0x0;var _0x40ae66=_0xb0b3[_0x28b14d];return _0x40ae66;};'use strict';var _=require(_0x3b0b('0x0'));var util=require(_0x3b0b('0x1'));var logger=require(_0x3b0b('0x2'))(_0x3b0b('0x3'));var moment=require(_0x3b0b('0x4'));var BPromise=require(_0x3b0b('0x5'));var rp=require(_0x3b0b('0x6'));var fs=require('fs');var path=require(_0x3b0b('0x7'));var rimraf=require('rimraf');var config=require(_0x3b0b('0x8'));var attributes=require(_0x3b0b('0x9'));module['exports']=function(_0x1a1f90,_0x2da656){return _0x1a1f90[_0x3b0b('0xa')](_0x3b0b('0xb'),attributes,{'tableName':_0x3b0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2037=['user_has_openchannel_queues','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x56ef59,_0x2d1bc9){var _0x2432a6=function(_0x44430f){while(--_0x44430f){_0x56ef59['push'](_0x56ef59['shift']());}};_0x2432a6(++_0x2d1bc9);}(_0x2037,0xdd));var _0x7203=function(_0x55d911,_0x2b768c){_0x55d911=_0x55d911-0x0;var _0x3104c2=_0x2037[_0x55d911];return _0x3104c2;};'use strict';var _=require(_0x7203('0x0'));var util=require(_0x7203('0x1'));var logger=require('../../config/logger')(_0x7203('0x2'));var moment=require('moment');var BPromise=require(_0x7203('0x3'));var rp=require(_0x7203('0x4'));var fs=require('fs');var path=require(_0x7203('0x5'));var rimraf=require(_0x7203('0x6'));var config=require(_0x7203('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x7203('0x8')]=function(_0x1321f3,_0x16e54d){return _0x1321f3[_0x7203('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0x7203('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 5ab441d..8f9b6c0 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 _0x55dd=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','request\x20sent'];(function(_0x554453,_0x2d5e1a){var _0x19df7d=function(_0x1c5489){while(--_0x1c5489){_0x554453['push'](_0x554453['shift']());}};_0x19df7d(++_0x2d5e1a);}(_0x55dd,0x1b2));var _0xd55d=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0x55dd[_0x2ef8c1];return _0x288305;};'use strict';var _=require(_0xd55d('0x0'));var util=require('util');var moment=require(_0xd55d('0x1'));var BPromise=require(_0xd55d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd55d('0x3'));var db=require(_0xd55d('0x4'))['db'];var utils=require(_0xd55d('0x5'));var logger=require(_0xd55d('0x6'))(_0xd55d('0x7'));var config=require(_0xd55d('0x8'));var jayson=require(_0xd55d('0x9'));var client=jayson[_0xd55d('0xa')][_0xd55d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d7c25,_0x90d9c5,_0x302925){return new BPromise(function(_0x51e68e,_0x3623b3){return client[_0xd55d('0xc')](_0x5d7c25,_0x302925)[_0xd55d('0xd')](function(_0x36802a){logger[_0xd55d('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x90d9c5,'request\x20sent');logger[_0xd55d('0xf')](_0xd55d('0x10'),_0x90d9c5,'request\x20sent',JSON[_0xd55d('0x11')](_0x36802a));if(_0x36802a[_0xd55d('0x12')]){if(_0x36802a[_0xd55d('0x12')]['code']===0x1f4){logger[_0xd55d('0x12')](_0xd55d('0x13'),_0x90d9c5,_0x36802a[_0xd55d('0x12')]['message']);return _0x3623b3(_0x36802a['error']['message']);}logger[_0xd55d('0x12')](_0xd55d('0x13'),_0x90d9c5,_0x36802a[_0xd55d('0x12')][_0xd55d('0x14')]);return _0x51e68e(_0x36802a[_0xd55d('0x12')][_0xd55d('0x14')]);}else{logger[_0xd55d('0xe')](_0xd55d('0x13'),_0x90d9c5,_0xd55d('0x15'));_0x51e68e(_0x36802a[_0xd55d('0x16')][_0xd55d('0x14')]);}})[_0xd55d('0x17')](function(_0x576bab){logger[_0xd55d('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x90d9c5,_0x576bab);_0x3623b3(_0x576bab);});});} \ No newline at end of file +var _0x69db=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x3d6620,_0x112662){var _0x1324d4=function(_0x427864){while(--_0x427864){_0x3d6620['push'](_0x3d6620['shift']());}};_0x1324d4(++_0x112662);}(_0x69db,0x187));var _0xb69d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x69db[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xb69d('0x0'));var util=require('util');var moment=require(_0xb69d('0x1'));var BPromise=require(_0xb69d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb69d('0x3'));var db=require(_0xb69d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb69d('0x5'));var config=require(_0xb69d('0x6'));var jayson=require(_0xb69d('0x7'));var client=jayson['client'][_0xb69d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29172c,_0x8e9497,_0x519fb8){return new BPromise(function(_0x165060,_0x11f59f){return client['request'](_0x29172c,_0x519fb8)['then'](function(_0x4b0587){logger[_0xb69d('0x9')](_0xb69d('0xa'),_0x8e9497,_0xb69d('0xb'));logger[_0xb69d('0xc')](_0xb69d('0xd'),_0x8e9497,_0xb69d('0xb'),JSON[_0xb69d('0xe')](_0x4b0587));if(_0x4b0587[_0xb69d('0xf')]){if(_0x4b0587[_0xb69d('0xf')][_0xb69d('0x10')]===0x1f4){logger[_0xb69d('0xf')](_0xb69d('0xa'),_0x8e9497,_0x4b0587[_0xb69d('0xf')][_0xb69d('0x11')]);return _0x11f59f(_0x4b0587['error'][_0xb69d('0x11')]);}logger[_0xb69d('0xf')](_0xb69d('0xa'),_0x8e9497,_0x4b0587[_0xb69d('0xf')][_0xb69d('0x11')]);return _0x165060(_0x4b0587[_0xb69d('0xf')][_0xb69d('0x11')]);}else{logger[_0xb69d('0x9')](_0xb69d('0xa'),_0x8e9497,_0xb69d('0xb'));_0x165060(_0x4b0587[_0xb69d('0x12')][_0xb69d('0x11')]);}})[_0xb69d('0x13')](function(_0xac43fa){logger[_0xb69d('0xf')](_0xb69d('0xa'),_0x8e9497,_0xac43fa);_0x11f59f(_0xac43fa);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index afca21d..796458a 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 _0xbcdb=['path','express','Router','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getSections','/:id/resources','getResources','post','clone','/:id/sections','addSections','update','delete','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbcdb,0xd6));var _0xbbcd=function(_0x1fe6b1,_0x10d0eb){_0x1fe6b1=_0x1fe6b1-0x0;var _0x1048c0=_0xbcdb[_0x1fe6b1];return _0x1048c0;};'use strict';var multer=require(_0xbbcd('0x0'));var util=require(_0xbbcd('0x1'));var path=require(_0xbbcd('0x2'));var timeout=require('connect-timeout');var express=require(_0xbbcd('0x3'));var router=express[_0xbbcd('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbbcd('0x5'));var config=require('../../config/environment');var controller=require(_0xbbcd('0x6'));router[_0xbbcd('0x7')]('/',auth[_0xbbcd('0x8')](),controller[_0xbbcd('0x9')]);router[_0xbbcd('0x7')](_0xbbcd('0xa'),auth['isAuthenticated'](),controller[_0xbbcd('0xb')]);router[_0xbbcd('0x7')](_0xbbcd('0xc'),auth['isAuthenticated'](),controller[_0xbbcd('0xd')]);router['get']('/:id/sections',auth[_0xbbcd('0x8')](),controller[_0xbbcd('0xe')]);router[_0xbbcd('0x7')](_0xbbcd('0xf'),auth[_0xbbcd('0x8')](),controller[_0xbbcd('0x10')]);router[_0xbbcd('0x11')]('/',auth[_0xbbcd('0x8')](),controller['create']);router[_0xbbcd('0x11')]('/:id/clone',auth[_0xbbcd('0x8')](),controller[_0xbbcd('0x12')]);router[_0xbbcd('0x11')](_0xbbcd('0x13'),auth['isAuthenticated'](),controller[_0xbbcd('0x14')]);router['post'](_0xbbcd('0xf'),auth[_0xbbcd('0x8')](),controller['addResources']);router['put'](_0xbbcd('0xc'),auth[_0xbbcd('0x8')](),controller[_0xbbcd('0x15')]);router['delete']('/:id',auth[_0xbbcd('0x8')](),controller['destroy']);router[_0xbbcd('0x16')](_0xbbcd('0x13'),auth['isAuthenticated'](),controller['removeSections']);router[_0xbbcd('0x16')](_0xbbcd('0xf'),auth['isAuthenticated'](),controller['removeResources']);module[_0xbbcd('0x17')]=router; \ No newline at end of file +var _0xd5a6=['isAuthenticated','index','get','describe','/:id','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','addSections','/:id/resources','addResources','put','update','delete','removeSections','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller'];(function(_0xc16013,_0x1ba88c){var _0x532a68=function(_0x235fa5){while(--_0x235fa5){_0xc16013['push'](_0xc16013['shift']());}};_0x532a68(++_0x1ba88c);}(_0xd5a6,0xa5));var _0x6d5a=function(_0x46f08a,_0x223e23){_0x46f08a=_0x46f08a-0x0;var _0x1ff88b=_0xd5a6[_0x46f08a];return _0x1ff88b;};'use strict';var multer=require(_0x6d5a('0x0'));var util=require(_0x6d5a('0x1'));var path=require(_0x6d5a('0x2'));var timeout=require(_0x6d5a('0x3'));var express=require(_0x6d5a('0x4'));var router=express[_0x6d5a('0x5')]();var auth=require(_0x6d5a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6d5a('0x7'));var controller=require(_0x6d5a('0x8'));router['get']('/',auth[_0x6d5a('0x9')](),controller[_0x6d5a('0xa')]);router[_0x6d5a('0xb')]('/describe',auth[_0x6d5a('0x9')](),controller[_0x6d5a('0xc')]);router[_0x6d5a('0xb')](_0x6d5a('0xd'),auth[_0x6d5a('0x9')](),controller['show']);router[_0x6d5a('0xb')](_0x6d5a('0xe'),auth[_0x6d5a('0x9')](),controller[_0x6d5a('0xf')]);router[_0x6d5a('0xb')]('/:id/resources',auth[_0x6d5a('0x9')](),controller[_0x6d5a('0x10')]);router[_0x6d5a('0x11')]('/',auth[_0x6d5a('0x9')](),controller[_0x6d5a('0x12')]);router[_0x6d5a('0x11')](_0x6d5a('0x13'),auth[_0x6d5a('0x9')](),controller[_0x6d5a('0x14')]);router[_0x6d5a('0x11')]('/:id/sections',auth[_0x6d5a('0x9')](),controller[_0x6d5a('0x15')]);router[_0x6d5a('0x11')](_0x6d5a('0x16'),auth[_0x6d5a('0x9')](),controller[_0x6d5a('0x17')]);router[_0x6d5a('0x18')]('/:id',auth[_0x6d5a('0x9')](),controller[_0x6d5a('0x19')]);router[_0x6d5a('0x1a')](_0x6d5a('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x6d5a('0x1a')](_0x6d5a('0xe'),auth['isAuthenticated'](),controller[_0x6d5a('0x1b')]);router[_0x6d5a('0x1a')](_0x6d5a('0x16'),auth[_0x6d5a('0x9')](),controller['removeResources']);module[_0x6d5a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index a8a0620..d0e134d 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 _0xc123=['name','STRING','setDataValue','crudPermissions','getDataValue','split','sequelize','exports'];(function(_0x43083f,_0x280226){var _0x3ad555=function(_0x3a19e5){while(--_0x3a19e5){_0x43083f['push'](_0x43083f['shift']());}};_0x3ad555(++_0x280226);}(_0xc123,0x18e));var _0x3c12=function(_0x2f7e64,_0x3da39c){_0x2f7e64=_0x2f7e64-0x0;var _0x3188e2=_0xc123[_0x2f7e64];return _0x3188e2;};'use strict';var Sequelize=require(_0x3c12('0x0'));module[_0x3c12('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3c12('0x2')},'crudPermissions':{'type':Sequelize[_0x3c12('0x3')],'set':function(_0x4cab66){this[_0x3c12('0x4')](_0x3c12('0x5'),_0x4cab66?_0x4cab66['join'](''):[]);},'get':function(){return this[_0x3c12('0x6')]('crudPermissions')?this[_0x3c12('0x6')](_0x3c12('0x5'))[_0x3c12('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xdf2b=['STRING','setDataValue','crudPermissions','join','getDataValue','exports'];(function(_0x4cc2ad,_0x578dc9){var _0x590f13=function(_0x200dd4){while(--_0x200dd4){_0x4cc2ad['push'](_0x4cc2ad['shift']());}};_0x590f13(++_0x578dc9);}(_0xdf2b,0x125));var _0xbdf2=function(_0x37b7ba,_0x37fd44){_0x37b7ba=_0x37b7ba-0x0;var _0x5d88e7=_0xdf2b[_0x37b7ba];return _0x5d88e7;};'use strict';var Sequelize=require('sequelize');module[_0xbdf2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xbdf2('0x1')],'set':function(_0x4bdf94){this[_0xbdf2('0x2')](_0xbdf2('0x3'),_0x4bdf94?_0x4bdf94[_0xbdf2('0x4')](''):[]);},'get':function(){return this[_0xbdf2('0x5')](_0xbdf2('0x3'))?this[_0xbdf2('0x5')](_0xbdf2('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xbdf2('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 590b5f7..ea5d7ea 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 _0xcc97=['nolimit','field','foreignKey','associatedResources','AnalyticExtractedReport','reportType','reportId','DefaultReports','custom','CustomReports','rows','Tag','Tags','tag','ThroughTags','color','value','toLowerCase','squareprojects','odbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','ListId','CmCompany','globalcustomfields','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','contexts','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelaccounts','smsaccounts','SmsAccount','teams','Team','voicequeues','telephones','Users','admin','Agents','Telephones','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','ZohoAccount','CannedAnswer','Disposition','customdashboards','intervals','Interval','pauses','Schedule','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','plugins','extractedreports','Reports','metrics','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','./userProfile.socket','register','status','json','count','offset','limit','set','Content-Range','save','then','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','catch','create','body','params','find','get','omit','crudPermissions','createdAt','updatedAt','sequelize','UserProfileSection','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','describe','addSections','transaction','push','removeSections','destroy','ids','getSections','enabled','includes','isEmpty','subsections','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','findOne','ignore','union','all'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xcc97,0x149));var _0x7cc9=function(_0x11f805,_0x565d3f){_0x11f805=_0x11f805-0x0;var _0x46fe0f=_0xcc97[_0x11f805];return _0x46fe0f;};'use strict';var pdf=require(_0x7cc9('0x0'));var emlformat=require(_0x7cc9('0x1'));var rimraf=require(_0x7cc9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7cc9('0x3'));var rp=require(_0x7cc9('0x4'));var moment=require(_0x7cc9('0x5'));var BPromise=require(_0x7cc9('0x6'));var Mustache=require(_0x7cc9('0x7'));var util=require(_0x7cc9('0x8'));var path=require(_0x7cc9('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7cc9('0xa'));var fs=require('fs');var _=require(_0x7cc9('0xb'));var squel=require(_0x7cc9('0xc'));var crypto=require(_0x7cc9('0xd'));var jsforce=require(_0x7cc9('0xe'));var deskjs=require(_0x7cc9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7cc9('0x10'));var Papa=require(_0x7cc9('0x11'));var Redis=require(_0x7cc9('0x12'));var authService=require(_0x7cc9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7cc9('0x14'));var hardwareService=require(_0x7cc9('0x15'));var logger=require(_0x7cc9('0x16'))('api');var utils=require(_0x7cc9('0x17'));var config=require('../../config/environment');var db=require(_0x7cc9('0x18'))['db'];config['redis']=_[_0x7cc9('0x19')](config[_0x7cc9('0x1a')],{'host':_0x7cc9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7cc9('0x1c'))[_0x7cc9('0x1d')](socket);function respondWithStatusCode(_0x152d0a,_0x1ed08f){_0x1ed08f=_0x1ed08f||0xcc;return function(_0x1d0e9a){if(_0x1d0e9a){return _0x152d0a['sendStatus'](_0x1ed08f);}return _0x152d0a[_0x7cc9('0x1e')](_0x1ed08f)['end']();};}function respondWithResult(_0x2f7125,_0x505386){_0x505386=_0x505386||0xc8;return function(_0x56757d){if(_0x56757d){return _0x2f7125[_0x7cc9('0x1e')](_0x505386)[_0x7cc9('0x1f')](_0x56757d);}};}function respondWithFilteredResult(_0x2c1a76,_0x4845b6){return function(_0xaa0017){if(_0xaa0017){var _0x44cd7c=_0xaa0017[_0x7cc9('0x20')],_0x118eda=_0x4845b6['offset'],_0xba06eb=_0x4845b6[_0x7cc9('0x21')]+_0x4845b6[_0x7cc9('0x22')],_0x1d6cc4;if(_0xba06eb>=_0x44cd7c){_0xba06eb=_0x44cd7c;_0x1d6cc4=0xc8;}else{_0x1d6cc4=0xce;}_0x2c1a76[_0x7cc9('0x1e')](_0x1d6cc4);return _0x2c1a76[_0x7cc9('0x23')](_0x7cc9('0x24'),_0x118eda+'-'+_0xba06eb+'/'+_0x44cd7c)[_0x7cc9('0x1f')](_0xaa0017);}return null;};}function patchUpdates(_0x5e3a19){return function(_0x2a8b28){try{jsonpatch['apply'](_0x2a8b28,_0x5e3a19,!![]);}catch(_0x1795a2){return BPromise['reject'](_0x1795a2);}return _0x2a8b28[_0x7cc9('0x25')]();};}function saveUpdates(_0xac8d29,_0xb79645){return function(_0x1fdd25){if(_0x1fdd25){return _0x1fdd25['update'](_0xac8d29)[_0x7cc9('0x26')](function(_0x28d29d){return _0x28d29d;});}return null;};}function removeEntity(_0x9f6e85,_0x3738e2){return function(_0xdd205f){if(_0xdd205f){return _0xdd205f['destroy']()[_0x7cc9('0x26')](function(){_0x9f6e85[_0x7cc9('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39ffad,_0x3eba98){return function(_0x5c9b6a){if(!_0x5c9b6a){_0x39ffad['sendStatus'](0x194);}return _0x5c9b6a;};}function handleError(_0x47ebe8,_0x266a7f){_0x266a7f=_0x266a7f||0x1f4;return function(_0x223321){logger['error'](_0x223321[_0x7cc9('0x27')]);if(_0x223321['name']){delete _0x223321[_0x7cc9('0x28')];}_0x47ebe8[_0x7cc9('0x1e')](_0x266a7f)[_0x7cc9('0x29')](_0x223321);};}exports[_0x7cc9('0x2a')]=function(_0x527af9,_0x3d2ad3){var _0x4a6efc={},_0x2cec7d={},_0x49ee95={'count':0x0,'rows':[]};var _0x44f6fa=_['map'](db[_0x7cc9('0x2b')][_0x7cc9('0x2c')],function(_0x582697){return{'name':_0x582697[_0x7cc9('0x2d')],'type':_0x582697[_0x7cc9('0x2e')][_0x7cc9('0x2f')]};});_0x2cec7d[_0x7cc9('0x30')]=_[_0x7cc9('0x31')](_0x44f6fa,_0x7cc9('0x28'));_0x2cec7d['query']=_[_0x7cc9('0x32')](_0x527af9[_0x7cc9('0x33')]);_0x2cec7d[_0x7cc9('0x34')]=_[_0x7cc9('0x35')](_0x2cec7d[_0x7cc9('0x30')],_0x2cec7d[_0x7cc9('0x33')]);_0x4a6efc[_0x7cc9('0x36')]=_[_0x7cc9('0x35')](_0x2cec7d[_0x7cc9('0x30')],qs['fields'](_0x527af9[_0x7cc9('0x33')][_0x7cc9('0x37')]));_0x4a6efc[_0x7cc9('0x36')]=_0x4a6efc['attributes'][_0x7cc9('0x38')]?_0x4a6efc[_0x7cc9('0x36')]:_0x2cec7d['model'];if(!_0x527af9[_0x7cc9('0x33')][_0x7cc9('0x39')]('nolimit')){_0x4a6efc[_0x7cc9('0x22')]=qs[_0x7cc9('0x22')](_0x527af9[_0x7cc9('0x33')][_0x7cc9('0x22')]);_0x4a6efc[_0x7cc9('0x21')]=qs[_0x7cc9('0x21')](_0x527af9[_0x7cc9('0x33')][_0x7cc9('0x21')]);}_0x4a6efc[_0x7cc9('0x3a')]=qs[_0x7cc9('0x3b')](_0x527af9[_0x7cc9('0x33')][_0x7cc9('0x3b')]);_0x4a6efc[_0x7cc9('0x3c')]=qs[_0x7cc9('0x34')](_[_0x7cc9('0x3d')](_0x527af9[_0x7cc9('0x33')],_0x2cec7d[_0x7cc9('0x34')]));if(_0x527af9[_0x7cc9('0x33')][_0x7cc9('0x3e')]){_0x4a6efc[_0x7cc9('0x3c')]=_[_0x7cc9('0x3f')](_0x4a6efc['where'],{'$or':_[_0x7cc9('0x31')](_0x44f6fa,function(_0x4e8e87){if(_0x4e8e87[_0x7cc9('0x2e')]!==_0x7cc9('0x40')){var _0x5739af={};_0x5739af[_0x4e8e87[_0x7cc9('0x28')]]={'$like':'%'+_0x527af9[_0x7cc9('0x33')][_0x7cc9('0x3e')]+'%'};return _0x5739af;}})});}_0x4a6efc=_['merge']({},_0x4a6efc,_0x527af9[_0x7cc9('0x41')]);var _0xb173d0={'where':_0x4a6efc[_0x7cc9('0x3c')]};return db[_0x7cc9('0x2b')]['count'](_0xb173d0)[_0x7cc9('0x26')](function(_0x3f9fa4){_0x49ee95['count']=_0x3f9fa4;if(_0x527af9['query'][_0x7cc9('0x42')]){_0x4a6efc[_0x7cc9('0x43')]=[{'all':!![]}];}return db['UserProfile'][_0x7cc9('0x44')](_0x4a6efc);})['then'](function(_0x5474a2){_0x49ee95['rows']=_0x5474a2;return _0x49ee95;})[_0x7cc9('0x26')](respondWithFilteredResult(_0x3d2ad3,_0x4a6efc))['catch'](handleError(_0x3d2ad3,null));};exports[_0x7cc9('0x45')]=function(_0x570bcd,_0x31c480){var _0x57698d={'raw':![],'where':{'id':_0x570bcd['params']['id']}},_0x5edbe2={};_0x5edbe2['model']=_[_0x7cc9('0x32')](db[_0x7cc9('0x2b')][_0x7cc9('0x2c')]);_0x5edbe2[_0x7cc9('0x33')]=_[_0x7cc9('0x32')](_0x570bcd['query']);_0x5edbe2['filters']=_[_0x7cc9('0x35')](_0x5edbe2[_0x7cc9('0x30')],_0x5edbe2[_0x7cc9('0x33')]);_0x57698d[_0x7cc9('0x36')]=_[_0x7cc9('0x35')](_0x5edbe2[_0x7cc9('0x30')],qs[_0x7cc9('0x37')](_0x570bcd[_0x7cc9('0x33')][_0x7cc9('0x37')]));_0x57698d['attributes']=_0x57698d[_0x7cc9('0x36')][_0x7cc9('0x38')]?_0x57698d[_0x7cc9('0x36')]:_0x5edbe2['model'];if(_0x570bcd[_0x7cc9('0x33')]['includeAll']){_0x57698d['include']=[{'all':!![]}];}_0x57698d=_[_0x7cc9('0x3f')]({},_0x57698d,_0x570bcd['options']);return db[_0x7cc9('0x2b')]['find'](_0x57698d)[_0x7cc9('0x26')](handleEntityNotFound(_0x31c480,null))['then'](respondWithResult(_0x31c480,null))[_0x7cc9('0x46')](handleError(_0x31c480,null));};exports[_0x7cc9('0x47')]=function(_0x21f5d8,_0x1e5467){return db[_0x7cc9('0x2b')][_0x7cc9('0x47')](_0x21f5d8[_0x7cc9('0x48')],{})[_0x7cc9('0x26')](respondWithResult(_0x1e5467,0xc9))['catch'](handleError(_0x1e5467,null));};exports['clone']=function(_0x2dcfba,_0x114cce){var _0x2ce869={'where':{'id':_0x2dcfba[_0x7cc9('0x49')]['id']}},_0x50a380={};_0x50a380['model']=_['keys'](db['UserProfile'][_0x7cc9('0x2c')]);_0x2ce869[_0x7cc9('0x36')]=_[_0x7cc9('0x35')](_0x50a380[_0x7cc9('0x30')],qs[_0x7cc9('0x37')](_0x2dcfba[_0x7cc9('0x33')][_0x7cc9('0x37')]));_0x2ce869[_0x7cc9('0x36')]=_0x2ce869[_0x7cc9('0x36')]['length']?_0x2ce869[_0x7cc9('0x36')]:_0x50a380[_0x7cc9('0x30')];if(_0x2dcfba[_0x7cc9('0x33')]['includeAll']){_0x2ce869['include']=[{'all':!![]}];}_0x2ce869=_[_0x7cc9('0x3f')]({},_0x2ce869,_0x2dcfba[_0x7cc9('0x41')]);return db[_0x7cc9('0x2b')][_0x7cc9('0x4a')](_0x2ce869)[_0x7cc9('0x26')](handleEntityNotFound(_0x114cce,null))[_0x7cc9('0x26')](function(_0x266cff){if(_0x266cff){var _0x1a0e78=_0x266cff[_0x7cc9('0x4b')]({'plain':!![]});_0x1a0e78=qs[_0x7cc9('0x4c')](_0x1a0e78,['id','createdAt','updatedAt',_0x7cc9('0x4d')]);_0x2dcfba[_0x7cc9('0x48')]=_[_0x7cc9('0x4c')](_0x2dcfba[_0x7cc9('0x48')],['id',_0x7cc9('0x4e'),_0x7cc9('0x4f')]);return db[_0x7cc9('0x50')]['transaction'](function(_0x7b1974){return db['UserProfile'][_0x7cc9('0x47')](_[_0x7cc9('0x3f')](_0x1a0e78,_0x2dcfba[_0x7cc9('0x48')]),{'include':_0x2dcfba[_0x7cc9('0x33')][_0x7cc9('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x7b1974})[_0x7cc9('0x26')](function(_0x3118f3){var _0x2de227=_0x3118f3['get']({'plain':!![]});return db[_0x7cc9('0x51')][_0x7cc9('0x44')]({'where':{'userProfileId':_0x2dcfba[_0x7cc9('0x49')]['id']},'raw':!![]})[_0x7cc9('0x26')](function(_0x55c00b){if(_0x55c00b){return BPromise[_0x7cc9('0x52')](_0x55c00b,function(_0x4fa7c3){return new BPromise(function(_0x25a420,_0xb27125){if(_0x4fa7c3['autoAssociation']===null||_0x4fa7c3[_0x7cc9('0x53')]===0x1)_0x25a420(null);return db['UserProfileResource'][_0x7cc9('0x44')]({'where':{'sectionId':_0x4fa7c3['id']},'raw':!![]})[_0x7cc9('0x26')](function(_0x10366a){var _0x589fd9=_[_0x7cc9('0x31')](_0x10366a,function(_0x4fead6){return qs[_0x7cc9('0x4c')](_0x4fead6,['id',_0x7cc9('0x4e'),'updatedAt',_0x7cc9('0x54')]);});_0x25a420(_0x589fd9);})['catch'](function(_0x15277e){_0xb27125(_0x15277e);});})['then'](function(_0x52998c){var _0x3a48e0=qs['omit'](_0x4fa7c3,['id',_0x7cc9('0x4e'),_0x7cc9('0x4f')]);_0x3a48e0[_0x7cc9('0x55')]=_0x2de227['id'];if(_0x52998c)_0x3a48e0[_0x7cc9('0x56')]=_0x52998c;return _0x3a48e0;})[_0x7cc9('0x26')](function(_0x2f9eb){return db[_0x7cc9('0x51')][_0x7cc9('0x47')](_0x2f9eb,{'include':[{'model':db[_0x7cc9('0x57')],'as':_0x7cc9('0x56')}],'raw':!![],'transaction':_0x7b1974});});})['then'](function(){return _0x2de227;});}});});});}})['then'](respondWithResult(_0x114cce,0xc9))[_0x7cc9('0x46')](handleError(_0x114cce,null));};exports['update']=function(_0x17a3ea,_0x10ce32){if(_0x17a3ea['body']['id']){delete _0x17a3ea[_0x7cc9('0x48')]['id'];}return db[_0x7cc9('0x2b')][_0x7cc9('0x4a')]({'where':{'id':_0x17a3ea[_0x7cc9('0x49')]['id']}})[_0x7cc9('0x26')](handleEntityNotFound(_0x10ce32,null))[_0x7cc9('0x26')](saveUpdates(_0x17a3ea[_0x7cc9('0x48')],null))[_0x7cc9('0x26')](respondWithResult(_0x10ce32,null))[_0x7cc9('0x46')](handleError(_0x10ce32,null));};exports['destroy']=function(_0x48e273,_0xd756ee){return db[_0x7cc9('0x2b')][_0x7cc9('0x4a')]({'where':{'id':_0x48e273[_0x7cc9('0x49')]['id']}})['then'](handleEntityNotFound(_0xd756ee,null))[_0x7cc9('0x26')](removeEntity(_0xd756ee,null))['catch'](handleError(_0xd756ee,null));};exports[_0x7cc9('0x58')]=function(_0x3947b4,_0x245517){return db[_0x7cc9('0x2b')][_0x7cc9('0x58')]()[_0x7cc9('0x26')](respondWithResult(_0x245517,null))[_0x7cc9('0x46')](handleError(_0x245517,null));};exports[_0x7cc9('0x59')]=function(_0xf65aef,_0x305047){var _0x21f34e=_0xf65aef[_0x7cc9('0x48')];return db[_0x7cc9('0x2b')][_0x7cc9('0x4a')]({'where':{'id':_0xf65aef[_0x7cc9('0x49')]['id']}})[_0x7cc9('0x26')](handleEntityNotFound(_0x305047,null))['then'](function(_0x3d93d0){if(_0x3d93d0){return db[_0x7cc9('0x50')][_0x7cc9('0x5a')](function(_0x57aae9){return db[_0x7cc9('0x51')]['destroy']({'where':{'userProfileId':_0xf65aef[_0x7cc9('0x49')]['id'],'sectionId':_[_0x7cc9('0x31')](_0x21f34e,function(_0x4da863){return _0x4da863['sectionId'];})},'transaction':_0x57aae9})[_0x7cc9('0x26')](function(){var _0x2695ed=_[_0x7cc9('0x31')](_0x21f34e,function(_0x49b2a9){_0x49b2a9[_0x7cc9('0x55')]=_0xf65aef[_0x7cc9('0x49')]['id'];return _0x49b2a9;});var _0x5255cf=[];return BPromise[_0x7cc9('0x52')](_0x2695ed,function(_0xfe4575){return db[_0x7cc9('0x51')][_0x7cc9('0x47')](_0xfe4575,{'include':[{'model':db[_0x7cc9('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x57aae9})[_0x7cc9('0x26')](function(_0xffb3e8){_0x5255cf[_0x7cc9('0x5b')](_0xffb3e8[_0x7cc9('0x4b')]({'plain':!![]}));});})[_0x7cc9('0x26')](function(){return _0x5255cf;});});});}})[_0x7cc9('0x26')](function(_0x336908){return _0x336908;})[_0x7cc9('0x26')](respondWithResult(_0x305047,null))['catch'](handleError(_0x305047,null));};exports[_0x7cc9('0x5c')]=function(_0x2c644c,_0x533441){var _0x2b9259;return db['UserProfile'][_0x7cc9('0x4a')]({'where':{'id':_0x2c644c['params']['id']},'attributes':['id',_0x7cc9('0x28')]})[_0x7cc9('0x26')](handleEntityNotFound(_0x533441,null))[_0x7cc9('0x26')](function(_0x19f4ca){if(_0x19f4ca){_0x2b9259=_0x19f4ca;return db[_0x7cc9('0x51')][_0x7cc9('0x5d')]({'where':{'userProfileId':_0x2c644c[_0x7cc9('0x49')]['id'],'sectionId':_0x2c644c[_0x7cc9('0x33')][_0x7cc9('0x5e')]}});}})['then'](function(){return _0x2b9259;})[_0x7cc9('0x26')](respondWithStatusCode(_0x533441,null))[_0x7cc9('0x46')](handleError(_0x533441,null));};exports[_0x7cc9('0x5f')]=function(_0x53a49c,_0x2a16ea){var _0x528897=[];var _0x5b47fa=[];return db[_0x7cc9('0x51')][_0x7cc9('0x44')]({'where':{'userProfileId':_0x53a49c[_0x7cc9('0x49')]['id']},'raw':!![]})[_0x7cc9('0x26')](function(_0x1e3898){_0x528897=_[_0x7cc9('0x3e')](_0x1e3898,function(_0x3afb0a){return _0x3afb0a[_0x7cc9('0x60')]===0x1||_[_0x7cc9('0x61')]([0x3eb,0x709],_0x3afb0a[_0x7cc9('0x54')]);});if(!_[_0x7cc9('0x62')](_0x528897)){return _[_0x7cc9('0x31')](_0x528897,function(_0x114e2c){return _0x114e2c[_0x7cc9('0x54')];});}else{return;}})['then'](function(_0x1df93a){if(_0x1df93a)_0x5b47fa=_0x1df93a;if(_['includes'](_0x5b47fa,0x64)){var _0x53bbb9=_[_0x7cc9('0x4a')](_0x528897,{'sectionId':0x64});return hasDefaultDashboard(_0x53bbb9)['then'](function(_0x49b73c){return _[_0x7cc9('0x31')](_0x528897,function(_0x131877){if(_0x131877[_0x7cc9('0x54')]===0x64){_0x131877[_0x7cc9('0x63')]=_0x49b73c;}return _0x131877;});});}else{return;}})[_0x7cc9('0x26')](function(_0x2d2a58){if(_0x2d2a58)_0x528897=_0x2d2a58;if(_[_0x7cc9('0x61')](_0x5b47fa,0x3eb)){var _0x45744d=_['find'](_0x528897,{'sectionId':0x3eb});return getCustomDashboards(_0x45744d)[_0x7cc9('0x26')](function(_0x452ed2){return _['map'](_0x528897,function(_0x2ffcc3){if(_0x45744d[_0x7cc9('0x60')]){if(_0x2ffcc3[_0x7cc9('0x54')]===0x3eb){_0x2ffcc3['subsections']=_0x452ed2;}}else{if(_0x2ffcc3[_0x7cc9('0x54')]===0x64){_0x2ffcc3[_0x7cc9('0x63')]=_0x452ed2;}}return _0x2ffcc3;});});}else{return;}})[_0x7cc9('0x26')](function(_0x4b87ca){if(_0x4b87ca)_0x528897=_0x4b87ca;if(_[_0x7cc9('0x61')](_0x5b47fa,0x709)){var _0x549b93=_[_0x7cc9('0x4a')](_0x528897,{'sectionId':0x709});return getPlugins(_0x549b93)[_0x7cc9('0x26')](function(_0x3266f8){if(_0x549b93[_0x7cc9('0x60')]){return _[_0x7cc9('0x31')](_0x528897,function(_0x30d5ca){if(_0x30d5ca[_0x7cc9('0x54')]===0x709){_0x30d5ca['subsections']=_0x3266f8;}return _0x30d5ca;});}else{var _0x589ef7={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3266f8};var _0xb7b514=_[_0x7cc9('0x31')](_0x528897);_0xb7b514[_0x7cc9('0x5b')](_0x589ef7);return _0xb7b514;}});}else{return;}})[_0x7cc9('0x26')](function(_0x5ee8df){if(_0x5ee8df)_0x528897=_0x5ee8df;return _[_0x7cc9('0x3e')](_0x528897,[_0x7cc9('0x60'),0x1]);})[_0x7cc9('0x26')](respondWithResult(_0x2a16ea,null))[_0x7cc9('0x46')](handleError(_0x2a16ea,null));};function hasDefaultDashboard(_0x1c29bb){var _0x5c4d0e=[0x65];return new BPromise(function(_0xc00999,_0x1ea663){try{if(_0x1c29bb['autoAssociation']){_0xc00999(_0x5c4d0e);}else{return db[_0x7cc9('0x57')]['findOne']({'where':{'sectionId':_0x1c29bb['id']},'raw':!![]})[_0x7cc9('0x26')](function(_0x5be57d){_0x5be57d?_0xc00999(_0x5c4d0e):_0xc00999();});}}catch(_0x449198){_0x1ea663(_0x449198);}});}function getCustomDashboards(_0x3f36ef){var _0x5a1285=[];return new BPromise(function(_0x4345fb,_0x56adf7){try{if(_0x3f36ef['autoAssociation']){return db['Dashboard'][_0x7cc9('0x44')]({'raw':!![]})['then'](function(_0x19e757){_0x19e757[_0x7cc9('0x64')](function(_0x2a791f){_0x5a1285[_0x7cc9('0x5b')](_0x2a791f['id']+0x1869f);});_0x4345fb(_0x5a1285);});}else{return db['UserProfileResource'][_0x7cc9('0x44')]({'where':{'sectionId':_0x3f36ef['id']},'raw':!![]})[_0x7cc9('0x26')](function(_0xf1aeb4){_0xf1aeb4[_0x7cc9('0x64')](function(_0x4ada04){_0x5a1285['push'](_0x4ada04[_0x7cc9('0x65')]+0x1869f);});_0x4345fb(_0x5a1285);});}}catch(_0x1326d0){_0x56adf7(_0x1326d0);}});}function getPlugins(_0x493ffe){var _0x454818=[];return new BPromise(function(_0x40dd5f,_0x1fc303){try{if(_0x493ffe[_0x7cc9('0x53')]){return db[_0x7cc9('0x66')]['findAll']({'raw':!![]})[_0x7cc9('0x26')](function(_0x5611b9){_0x5611b9[_0x7cc9('0x64')](function(_0x2bc4bd){_0x454818[_0x7cc9('0x5b')](_0x2bc4bd['id']+0x15b38);});_0x40dd5f(_0x454818);});}else{return db[_0x7cc9('0x57')]['findAll']({'where':{'sectionId':_0x493ffe['id']},'raw':!![]})[_0x7cc9('0x26')](function(_0x62f5a7){_0x62f5a7[_0x7cc9('0x64')](function(_0x2d72f2){_0x454818[_0x7cc9('0x5b')](_0x2d72f2[_0x7cc9('0x65')]+0x15b38);});_0x40dd5f(_0x454818);});}}catch(_0x421788){_0x1fc303(_0x421788);}});}exports[_0x7cc9('0x67')]=function(_0x8ae32,_0x2b171c){return db[_0x7cc9('0x2b')][_0x7cc9('0x4a')]({'where':{'id':_0x8ae32[_0x7cc9('0x49')]['id']}})[_0x7cc9('0x26')](handleEntityNotFound(_0x2b171c,null))[_0x7cc9('0x26')](function(_0x5be0c3){if(_0x5be0c3){return db[_0x7cc9('0x50')][_0x7cc9('0x5a')](function(_0x4f34c2){return db[_0x7cc9('0x51')][_0x7cc9('0x44')]({'where':{'userProfileId':_0x8ae32['params']['id']},'attributes':['id'],'raw':!![]})[_0x7cc9('0x26')](function(_0x48090c){if(_0x48090c){return db[_0x7cc9('0x51')][_0x7cc9('0x5d')]({'where':{'userProfileId':_0x8ae32[_0x7cc9('0x49')]['id'],'id':_[_0x7cc9('0x31')](_0x48090c,function(_0x5237ba){return _0x5237ba['id'];})},'transaction':_0x4f34c2});}})[_0x7cc9('0x26')](function(_0x20286b){var _0x105eec=_[_0x7cc9('0x31')](_0x8ae32['body'],function(_0x1c0250){_0x1c0250[_0x7cc9('0x55')]=_0x8ae32[_0x7cc9('0x49')]['id'];return _0x1c0250;});return db[_0x7cc9('0x51')]['bulkCreate'](_0x105eec,{'raw':!![],'transaction':_0x4f34c2});})[_0x7cc9('0x26')](function(_0x5387ff){var _0x5958f2=_[_0x7cc9('0x3e')](_['map'](_0x5387ff,function(_0x459b6a){return _0x459b6a[_0x7cc9('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x5958f2){return db['UserProfileSection'][_0x7cc9('0x44')]({'where':{'userProfileId':_0x8ae32[_0x7cc9('0x49')]['id'],'sectionId':_[_0x7cc9('0x31')](_0x5958f2,function(_0x19426e){return _0x19426e['sectionId'];})},'attributes':['id',_0x7cc9('0x54')],'raw':!![]})[_0x7cc9('0x26')](function(_0x3bfde4){var _0x56c70e=_[_0x7cc9('0x31')](_0x8ae32['body'],function(_0x4c8348){_0x4c8348[_0x7cc9('0x55')]=_0x8ae32[_0x7cc9('0x49')]['id'];return _0x4c8348;});return db[_0x7cc9('0x57')][_0x7cc9('0x68')](_0x56c70e,{'raw':!![],'transaction':_0x4f34c2});});}})[_0x7cc9('0x46')](handleError(_0x2b171c,null));});}})[_0x7cc9('0x26')](function(_0x2fe08d){var _0xa7f864=_['map'](_0x2fe08d,function(_0x5ce03c){return _0x5ce03c[_0x7cc9('0x4b')]({'plain':!![]});});})[_0x7cc9('0x26')](respondWithResult(_0x2b171c,null))['catch'](handleError(_0x2b171c,null));};exports[_0x7cc9('0x69')]=function(_0x1a6b69,_0x3ceee1,_0x3d47b0){return db['UserProfile'][_0x7cc9('0x4a')]({'where':{'id':_0x1a6b69[_0x7cc9('0x49')]['id']}})[_0x7cc9('0x26')](handleEntityNotFound(_0x3ceee1,null))[_0x7cc9('0x26')](function(_0x1a6a05){if(_0x1a6a05){return _0x1a6a05['removeResources'](_0x1a6b69[_0x7cc9('0x33')][_0x7cc9('0x5e')]);}})[_0x7cc9('0x26')](respondWithStatusCode(_0x3ceee1,null))[_0x7cc9('0x46')](handleError(_0x3ceee1,null));};exports[_0x7cc9('0x6a')]=function(_0x351c92,_0x4620ef){var _0x367bd1={'raw':![],'where':{}};var _0x3aad0e={};var _0x2a55e8={'count':0x0,'rows':[]};var _0x2ea9fd=_0x351c92[_0x7cc9('0x33')][_0x7cc9('0x6b')];if(typeof _0x2ea9fd===_0x7cc9('0x6c')){throw new db[(_0x7cc9('0x6d'))][(_0x7cc9('0x6e'))]('Unknown\x20section');}var _0x13cab9=_0x351c92['query'][_0x7cc9('0x6f')]||![];var _0x7e484b=getQueryModels(_0x2ea9fd,_0x13cab9);if(typeof _0x7e484b[_0x7cc9('0x70')]===_0x7cc9('0x6c')){throw new db[(_0x7cc9('0x6d'))][(_0x7cc9('0x6e'))](_0x7cc9('0x71')+_0x2ea9fd+'\x27');}var _0x13f16d=[];if(!_[_0x7cc9('0x62')](_0x7e484b['parentSections'])){_0x13f16d=_0x7e484b[_0x7cc9('0x72')];}else{_0x13f16d=[{'name':_0x2ea9fd}];}return db[_0x7cc9('0x2b')][_0x7cc9('0x73')]({'where':{'id':_0x351c92[_0x7cc9('0x49')]['id']}})['then'](handleEntityNotFound(_0x4620ef,null))[_0x7cc9('0x26')](function(_0x126f9c){if(_0x126f9c){var _0x5576b0=[];for(var _0x30a6ba=0x0;_0x30a6ba<_0x13f16d[_0x7cc9('0x38')];_0x30a6ba++){_0x5576b0['push'](db[_0x7cc9('0x51')][_0x7cc9('0x73')]({'where':{'userProfileId':_0x126f9c['id'],'name':_0x13f16d[_0x30a6ba][_0x7cc9('0x28')]},'raw':!![]}));}return BPromise['all'](_0x5576b0);}})[_0x7cc9('0x26')](function(_0x58ec20){var _0x10f1d7=_[_0x7cc9('0x3e')](_0x58ec20,function(_0x4051da){return _0x4051da?_0x4051da:undefined;});var _0x247514=_[_0x7cc9('0x3e')](_0x13f16d,[_0x7cc9('0x74'),!![]]);var _0x2e6a19=_[_0x7cc9('0x62')](_0x10f1d7)&&_[_0x7cc9('0x62')](_0x247514)?null:_[_0x7cc9('0x75')](_0x247514,_0x10f1d7);if(_0x2e6a19){var _0xd10090=[];for(var _0x58938e=0x0;_0x58938e<_0x2e6a19[_0x7cc9('0x38')];_0x58938e++){var _0x201de2=_[_0x7cc9('0x4a')](_0x13f16d,function(_0x1f4d55){return _0x2e6a19[_0x58938e]?_0x1f4d55[_0x7cc9('0x28')]===_0x2e6a19[_0x58938e][_0x7cc9('0x28')]:null;});if(_0x201de2){if(_0x2e6a19[_0x58938e][_0x7cc9('0x74')]){_0xd10090[_0x7cc9('0x5b')](getAllResources(_0x7e484b[_0x7cc9('0x70')],_0x2e6a19[_0x58938e]));}else{if(!_0x2e6a19[_0x58938e][_0x7cc9('0x53')]){_0xd10090[_0x7cc9('0x5b')](getAllowedResources(_0x201de2,_0x2e6a19[_0x58938e],_0x7e484b[_0x7cc9('0x70')]));}else{if(_0x201de2[_0x7cc9('0x30')]){_0xd10090[_0x7cc9('0x5b')](getAllFilteredResources(_0x201de2,_0x2e6a19[_0x58938e]));}}}}}return BPromise[_0x7cc9('0x76')](_0xd10090);}else{return null;}})[_0x7cc9('0x26')](function(_0x22bad8){var _0x34dcaa=_0x22bad8;var _0x14c22b=null;if(_0x34dcaa){_0x14c22b=_0x34dcaa[_0x7cc9('0x38')]===0x1?_0x34dcaa[0x0]:null;}if(_0x14c22b||_0x34dcaa){var _0x25145f=db[_0x7e484b['childModel']]['rawAttributes'];_0x3aad0e['model']=_[_0x7cc9('0x32')](_0x25145f);_0x3aad0e['query']=_['keys'](_0x351c92[_0x7cc9('0x33')]);_0x3aad0e[_0x7cc9('0x34')]=_[_0x7cc9('0x35')](_0x3aad0e[_0x7cc9('0x30')],_0x3aad0e[_0x7cc9('0x33')]);_0x367bd1[_0x7cc9('0x36')]=_[_0x7cc9('0x35')](_0x3aad0e[_0x7cc9('0x30')],qs[_0x7cc9('0x37')](_0x351c92[_0x7cc9('0x33')][_0x7cc9('0x37')]));_0x367bd1[_0x7cc9('0x36')]=_0x367bd1[_0x7cc9('0x36')][_0x7cc9('0x38')]?_0x367bd1['attributes']:_0x3aad0e[_0x7cc9('0x30')];if(!_0x351c92[_0x7cc9('0x33')]['hasOwnProperty'](_0x7cc9('0x77'))){_0x367bd1[_0x7cc9('0x22')]=qs[_0x7cc9('0x22')](_0x351c92[_0x7cc9('0x33')][_0x7cc9('0x22')]);_0x367bd1[_0x7cc9('0x21')]=qs[_0x7cc9('0x21')](_0x351c92[_0x7cc9('0x33')]['offset']);}_0x367bd1[_0x7cc9('0x3a')]=qs[_0x7cc9('0x3b')](_0x351c92[_0x7cc9('0x33')]['sort']);_0x367bd1[_0x7cc9('0x3c')]=qs['filters'](_['pick'](_0x351c92['query'],_0x3aad0e[_0x7cc9('0x34')]));if(_0x351c92['query']['filter']){_0x367bd1[_0x7cc9('0x3c')]=_[_0x7cc9('0x3f')](_0x367bd1[_0x7cc9('0x3c')],{'$or':_[_0x7cc9('0x31')](_0x25145f,function(_0x43756e){if(_0x43756e['type'][_0x7cc9('0x2f')]!==_0x7cc9('0x40')){var _0x41efc6={};_0x41efc6[_0x43756e[_0x7cc9('0x78')]]={'$like':'%'+_0x351c92[_0x7cc9('0x33')][_0x7cc9('0x3e')]+'%'};return _0x41efc6;}})});}var _0x3e2aff=[];if(_0x14c22b){var _0x563d4a=_[_0x7cc9('0x4a')](_0x13f16d,['name',_0x14c22b[_0x7cc9('0x28')]]);if(_0x563d4a[_0x7cc9('0x78')]){var _0x567697={};if(_0x7e484b[_0x7cc9('0x70')]==='AnalyticExtractedReport'){_0x567697[_0x563d4a[_0x7cc9('0x79')]]=_[_0x7cc9('0x31')](_0x14c22b[_0x7cc9('0x7a')],'id');}else{_0x567697[_0x563d4a['foreignKey']]=_0x14c22b['associatedResources'];}_0x3e2aff[_0x7cc9('0x5b')](_0x567697);}else{_0x367bd1[_0x7cc9('0x3c')]['id']=_0x14c22b['associatedResources'];}}else{for(var _0x4f2325=0x0;_0x4f2325<_0x34dcaa[_0x7cc9('0x38')];_0x4f2325++){var _0x563d4a=_[_0x7cc9('0x4a')](_0x13f16d,[_0x7cc9('0x28'),_0x34dcaa[_0x4f2325][_0x7cc9('0x28')]]);if(_0x563d4a[_0x7cc9('0x78')]){var _0x567697={};_0x567697[_0x563d4a[_0x7cc9('0x79')]]=_0x34dcaa[_0x4f2325][_0x7cc9('0x7a')];_0x3e2aff[_0x7cc9('0x5b')](_0x567697);}else{if(!_0x367bd1[_0x7cc9('0x3c')]['id'])_0x367bd1[_0x7cc9('0x3c')]['id']=[];_0x34dcaa[_0x4f2325]['associatedResources']['forEach'](function(_0x7e23a3){_0x367bd1['where']['id'][_0x7cc9('0x5b')](_0x7e23a3);});}}}if(!_[_0x7cc9('0x62')](_0x3e2aff)){_0x367bd1[_0x7cc9('0x3c')]=_['merge'](_0x367bd1[_0x7cc9('0x3c')],{'$and':{'$or':_0x3e2aff}});}_0x367bd1=_['merge']({},_0x367bd1,_0x351c92['options']);if(_0x14c22b&&!_0x14c22b[_0x7cc9('0x53')]&&_0x7e484b[_0x7cc9('0x70')]===_0x7cc9('0x7b')){if(_0x351c92[_0x7cc9('0x33')][_0x7cc9('0x42')]){_0x367bd1[_0x7cc9('0x43')]=[{'all':!![]}];}return db[_0x7e484b[_0x7cc9('0x70')]][_0x7cc9('0x44')](_0x367bd1)['then'](function(_0x3bbac7){var _0x46057b=[];_0x3bbac7[_0x7cc9('0x64')](function(_0x328ca6){var _0x4def81;switch(_0x328ca6[_0x7cc9('0x7c')]){case'default':_0x4def81=_['find'](_0x14c22b['associatedResources'],function(_0x47f368){return _0x47f368['id']===_0x328ca6[_0x7cc9('0x7d')]&&_0x47f368[_0x7cc9('0x2e')]===_0x7cc9('0x7e');});break;case _0x7cc9('0x7f'):_0x4def81=_[_0x7cc9('0x4a')](_0x14c22b[_0x7cc9('0x7a')],function(_0x39482c){return _0x39482c['id']===_0x328ca6[_0x7cc9('0x7d')]&&_0x39482c['type']===_0x7cc9('0x80');});break;}if(_0x4def81)_0x46057b[_0x7cc9('0x5b')](_0x328ca6);});_0x2a55e8[_0x7cc9('0x20')]=_0x46057b[_0x7cc9('0x38')];_0x2a55e8[_0x7cc9('0x81')]=_0x46057b;return _0x2a55e8;});}else{return db[_0x7e484b['childModel']][_0x7cc9('0x20')]({'where':_0x367bd1['where']})[_0x7cc9('0x26')](function(_0x4bd2ad){_0x2a55e8['count']=_0x4bd2ad;if(_0x351c92['query']['includeAll']){if(_0x7e484b['childModel']==='CmContact'){_0x367bd1[_0x7cc9('0x43')]=[{'model':db[_0x7cc9('0x82')],'as':_0x7cc9('0x83'),'attributes':['id',_0x7cc9('0x28'),'color'],'required':_0x351c92[_0x7cc9('0x33')][_0x7cc9('0x84')]?!![]:![]},{'model':db[_0x7cc9('0x82')],'as':_0x7cc9('0x85'),'attributes':['id',_0x7cc9('0x28'),_0x7cc9('0x86')],'through':_0x351c92[_0x7cc9('0x33')][_0x7cc9('0x84')]?{'attributes':[],'where':{'TagId':_0x351c92[_0x7cc9('0x33')][_0x7cc9('0x84')]||undefined}}:{},'required':_0x351c92[_0x7cc9('0x33')]['tag']?!![]:![]}];}else{_0x367bd1[_0x7cc9('0x43')]=[{'all':!![]}];}}return db[_0x7e484b[_0x7cc9('0x70')]][_0x7cc9('0x44')](_0x367bd1);})[_0x7cc9('0x26')](function(_0x147f36){_0x2a55e8[_0x7cc9('0x81')]=_0x147f36;return _0x2a55e8;});}}else{return _0x2a55e8;}})[_0x7cc9('0x26')](respondWithFilteredResult(_0x4620ef,_0x367bd1))[_0x7cc9('0x46')](handleError(_0x4620ef,null));};function getAllResources(_0x2a859e,_0x2e0153){return new BPromise(function(_0x4896fe,_0x16c571){if(_0x2e0153){var _0xd100c7=_0x2e0153[_0x7cc9('0x3e')]?{[_0x2e0153['filter'][_0x7cc9('0x78')]]:_0x2e0153[_0x7cc9('0x3e')][_0x7cc9('0x87')]}:undefined;return db[_0x2a859e][_0x7cc9('0x44')]({'where':_0xd100c7,'raw':!![]})[_0x7cc9('0x26')](function(_0x12f7a8){_0x2e0153[_0x7cc9('0x7a')]=_[_0x7cc9('0x31')](_0x12f7a8,'id');_0x4896fe(_0x2e0153);})[_0x7cc9('0x46')](function(_0xab9c59){_0x16c571(_0xab9c59);});}else{_0x4896fe(null);}});}function getAllFilteredResources(_0x43a992,_0x4b0d64){return new BPromise(function(_0x44d7e8,_0x156126){var _0x271bd8=_0x43a992['filter']?{[_0x43a992[_0x7cc9('0x3e')][_0x7cc9('0x78')]]:_0x43a992[_0x7cc9('0x3e')][_0x7cc9('0x87')]}:undefined;return db[_0x43a992[_0x7cc9('0x30')]][_0x7cc9('0x44')]({'where':_0x271bd8,'raw':!![]})[_0x7cc9('0x26')](function(_0x5eec22){_0x4b0d64['associatedResources']=_['map'](_0x5eec22,function(_0x216104){return _0x216104[_0x7cc9('0x28')];});_0x44d7e8(_0x4b0d64);})[_0x7cc9('0x46')](function(_0x21193d){_0x156126(_0x21193d);});});}function getAllowedResources(_0x5f0c59,_0x4d9661,_0x1b65c5){return new BPromise(function(_0x269f20,_0x35347c){if(_0x4d9661){return db[_0x7cc9('0x57')][_0x7cc9('0x44')]({'where':{'sectionId':_0x4d9661['id']},'raw':!![]})[_0x7cc9('0x26')](function(_0x3d8bd8){if(_0x5f0c59[_0x7cc9('0x78')]&&_0x5f0c59['field']!=='id'){_0x4d9661['associatedResources']=_[_0x7cc9('0x31')](_0x3d8bd8,function(_0x3c9157){return _0x3c9157[_0x5f0c59['field']];});}else{if(_0x1b65c5===_0x7cc9('0x7b')){_0x4d9661[_0x7cc9('0x7a')]=_['map'](_0x3d8bd8,function(_0x5eeff1){return{'id':_0x5eeff1[_0x7cc9('0x65')],'type':_0x5eeff1[_0x7cc9('0x2e')]};});}else{_0x4d9661['associatedResources']=_[_0x7cc9('0x31')](_0x3d8bd8,function(_0x58c342){return _0x58c342['resourceId'];});}}_0x269f20(_0x4d9661);})[_0x7cc9('0x46')](function(_0x4f7af4){_0x35347c(_0x4f7af4);});}else{_0x269f20(null);}});}function getQueryModels(_0x511b84,_0xd3a356){var _0x2eb142=_0x511b84[_0x7cc9('0x88')]();var _0x50ae76={'childModel':undefined,'parentSections':[]};switch(_0x2eb142){case _0x7cc9('0x89'):_0x50ae76[_0x7cc9('0x70')]='SquareProject';break;case _0x7cc9('0x8a'):_0x50ae76[_0x7cc9('0x70')]='SquareOdbc';break;case _0x7cc9('0x8b'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0x8c');_0x50ae76['parentSections']=[{'name':_0x7cc9('0x8d'),'field':_0x7cc9('0x28'),'foreignKey':_0x7cc9('0x8e')}];break;case _0x7cc9('0x8f'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0x90');break;case _0x7cc9('0x91'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0x92');_0x50ae76[_0x7cc9('0x72')]=[{'name':'Lists','field':'id','foreignKey':_0x7cc9('0x93')}];break;case'lists':_0x50ae76['childModel']='CmList';break;case'companies':_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0x94');break;case _0x7cc9('0x95'):_0x50ae76['childModel']='CmCustomField';break;case'chatqueues':_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0x96');break;case _0x7cc9('0x97'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0x98');break;case _0x7cc9('0x99'):_0x50ae76['childModel']=_0x7cc9('0x9a');break;case _0x7cc9('0x9b'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0x9c');break;case _0x7cc9('0x9d'):case _0x7cc9('0x9e'):case'outboundroutes':_0x50ae76[_0x7cc9('0x70')]='VoiceExtension';break;case _0x7cc9('0x9f'):_0x50ae76['childModel']='VoiceContext';break;case'voicemails':_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xa0');break;case _0x7cc9('0xa1'):_0x50ae76['childModel']=_0x7cc9('0xa2');_0x50ae76[_0x7cc9('0x72')]=[{'name':'Agents','field':_0x7cc9('0x28'),'foreignKey':_0x7cc9('0xa3'),'model':_0x7cc9('0xa4'),'filter':{'field':_0x7cc9('0xa5'),'value':[_0x7cc9('0xa6')]}},{'name':'Telephones','field':_0x7cc9('0x28'),'foreignKey':_0x7cc9('0xa3'),'model':_0x7cc9('0xa4'),'filter':{'field':_0x7cc9('0xa5'),'value':[_0x7cc9('0xa7')]}},{'name':_0x7cc9('0xa8'),'field':'name','foreignKey':_0x7cc9('0xa9'),'model':_0x7cc9('0xaa'),'filter':{'field':_0x7cc9('0x2e'),'value':['inbound']}},{'name':_0x7cc9('0xab'),'field':_0x7cc9('0x28'),'foreignKey':'queue','model':_0x7cc9('0xaa'),'filter':{'field':_0x7cc9('0x2e'),'value':[_0x7cc9('0xac')]}}];break;case _0x7cc9('0xad'):_0x50ae76[_0x7cc9('0x70')]='VoiceMusicOnHold';break;case _0x7cc9('0xae'):_0x50ae76['childModel']='VoiceChanSpy';break;case _0x7cc9('0xaf'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xb0');break;case _0x7cc9('0xb1'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xb2');break;case _0x7cc9('0xb3'):_0x50ae76['childModel']=_0x7cc9('0xb4');break;case _0x7cc9('0xb5'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xb6');break;case _0x7cc9('0xb7'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xb8');break;case'openchannelqueues':_0x50ae76[_0x7cc9('0x70')]='OpenchannelQueue';break;case _0x7cc9('0xb9'):_0x50ae76[_0x7cc9('0x70')]='OpenchannelAccount';break;case'smsqueues':_0x50ae76[_0x7cc9('0x70')]='SmsQueue';break;case _0x7cc9('0xba'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xbb');break;case _0x7cc9('0xbc'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xbd');break;case _0x7cc9('0xbe'):case'queuecampaigns':_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xaa');if(_0xd3a356){_0x50ae76[_0x7cc9('0x72')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case'users':case'agents':case _0x7cc9('0xbf'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xa4');if(_0xd3a356){_0x50ae76[_0x7cc9('0x72')]=[{'name':_0x7cc9('0xc0'),'filter':{'field':_0x7cc9('0xa5'),'value':[_0x7cc9('0xc1'),'user']},'ignore':!![]},{'name':_0x7cc9('0xc2')},{'name':_0x7cc9('0xc3')}];}break;case'zendeskaccounts':_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xc4');break;case _0x7cc9('0xc5'):_0x50ae76[_0x7cc9('0x70')]='SalesforceAccount';break;case _0x7cc9('0xc6'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xc7');break;case _0x7cc9('0xc8'):_0x50ae76[_0x7cc9('0x70')]='SugarcrmAccount';break;case _0x7cc9('0xc9'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xca');break;case'zohoaccounts':_0x50ae76['childModel']=_0x7cc9('0xcb');break;case'vtigeraccounts':_0x50ae76['childModel']=_0x7cc9('0xa4');break;case'cannedanswers':_0x50ae76['childModel']=_0x7cc9('0xcc');break;case'dispositions':_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xcd');break;case _0x7cc9('0xce'):_0x50ae76[_0x7cc9('0x70')]='Dashboard';break;case _0x7cc9('0xcf'):_0x50ae76['childModel']=_0x7cc9('0xd0');break;case _0x7cc9('0xd1'):_0x50ae76['childModel']='Pause';break;case'scheduler':_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xd2');break;case'sounds':_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xd3');break;case _0x7cc9('0xd4'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0x82');break;case _0x7cc9('0xd5'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xd6');break;case _0x7cc9('0xd7'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0xd8');break;case _0x7cc9('0xd9'):_0x50ae76['childModel']=_0x7cc9('0xda');break;case _0x7cc9('0xdb'):_0x50ae76[_0x7cc9('0x70')]='Variable';break;case _0x7cc9('0xdc'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0x66');break;case _0x7cc9('0xdd'):_0x50ae76[_0x7cc9('0x70')]=_0x7cc9('0x7b');_0x50ae76['parentSections']=[{'name':_0x7cc9('0xde'),'field':'id','foreignKey':_0x7cc9('0x7d')}];break;case _0x7cc9('0xdf'):_0x50ae76['childModel']='AnalyticMetric';break;default:return _0x50ae76;}return _0x50ae76;} \ No newline at end of file +var _0x5a1d=['Resources','update','describe','addSections','sequelize','UserProfileSection','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','Dashboard','forEach','resourceId','bulkCreate','removeResources','undefined','Sequelize','ValidationError','Unknown\x20section','childModel','Invalid\x20section\x20\x27','parentSections','findOne','all','pick','VIRTUAL','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','custom','CmContact','Tag','Tags','color','tag','rows','value','toLowerCase','squareprojects','SquareProject','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','agent','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoicePrefix','ivrcampaigns','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','Disposition','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','templates','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','limit','set','Content-Range','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','UserProfile','count','includeAll','include','findAll','show','params','keys','options','find','create','catch','clone','get','omit','createdAt','updatedAt','crudPermissions','body','transaction','autoAssociation','UserProfileResource','sectionId','userProfileId'];(function(_0x2a89d6,_0x5dc178){var _0x13139a=function(_0x24b5e1){while(--_0x24b5e1){_0x2a89d6['push'](_0x2a89d6['shift']());}};_0x13139a(++_0x5dc178);}(_0x5a1d,0x8f));var _0xd5a1=function(_0x501d8d,_0x592133){_0x501d8d=_0x501d8d-0x0;var _0xcd05f1=_0x5a1d[_0x501d8d];return _0xcd05f1;};'use strict';var pdf=require(_0xd5a1('0x0'));var emlformat=require(_0xd5a1('0x1'));var rimraf=require(_0xd5a1('0x2'));var zipdir=require(_0xd5a1('0x3'));var jsonpatch=require(_0xd5a1('0x4'));var rp=require(_0xd5a1('0x5'));var moment=require('moment');var BPromise=require(_0xd5a1('0x6'));var Mustache=require('mustache');var util=require(_0xd5a1('0x7'));var path=require(_0xd5a1('0x8'));var sox=require(_0xd5a1('0x9'));var csv=require(_0xd5a1('0xa'));var ejs=require(_0xd5a1('0xb'));var fs=require('fs');var _=require(_0xd5a1('0xc'));var squel=require(_0xd5a1('0xd'));var crypto=require(_0xd5a1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd5a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd5a1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd5a1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5a1('0x11'))(_0xd5a1('0x12'));var utils=require(_0xd5a1('0x13'));var config=require(_0xd5a1('0x14'));var db=require('../../mysqldb')['db'];config[_0xd5a1('0x15')]=_[_0xd5a1('0x16')](config[_0xd5a1('0x15')],{'host':_0xd5a1('0x17'),'port':0x18eb});var socket=require(_0xd5a1('0x18'))(new Redis(config[_0xd5a1('0x15')]));require('./userProfile.socket')[_0xd5a1('0x19')](socket);function respondWithStatusCode(_0x1ffe51,_0x3c9c1a){_0x3c9c1a=_0x3c9c1a||0xcc;return function(_0x6d3f95){if(_0x6d3f95){return _0x1ffe51[_0xd5a1('0x1a')](_0x3c9c1a);}return _0x1ffe51['status'](_0x3c9c1a)[_0xd5a1('0x1b')]();};}function respondWithResult(_0x3fe876,_0x267a36){_0x267a36=_0x267a36||0xc8;return function(_0x3adbd0){if(_0x3adbd0){return _0x3fe876[_0xd5a1('0x1c')](_0x267a36)[_0xd5a1('0x1d')](_0x3adbd0);}};}function respondWithFilteredResult(_0x7560c3,_0x393543){return function(_0x2a330c){if(_0x2a330c){var _0x2ddf41=_0x2a330c['count'],_0x306e0d=_0x393543['offset'],_0x3dce20=_0x393543['offset']+_0x393543[_0xd5a1('0x1e')],_0x4c241b;if(_0x3dce20>=_0x2ddf41){_0x3dce20=_0x2ddf41;_0x4c241b=0xc8;}else{_0x4c241b=0xce;}_0x7560c3[_0xd5a1('0x1c')](_0x4c241b);return _0x7560c3[_0xd5a1('0x1f')](_0xd5a1('0x20'),_0x306e0d+'-'+_0x3dce20+'/'+_0x2ddf41)[_0xd5a1('0x1d')](_0x2a330c);}return null;};}function patchUpdates(_0x42f829){return function(_0x4a29){try{jsonpatch['apply'](_0x4a29,_0x42f829,!![]);}catch(_0x4d5012){return BPromise['reject'](_0x4d5012);}return _0x4a29[_0xd5a1('0x21')]();};}function saveUpdates(_0x20aa16,_0x48488a){return function(_0x3448d7){if(_0x3448d7){return _0x3448d7['update'](_0x20aa16)[_0xd5a1('0x22')](function(_0x29f8eb){return _0x29f8eb;});}return null;};}function removeEntity(_0x40fbe1,_0x1a9a64){return function(_0x379989){if(_0x379989){return _0x379989[_0xd5a1('0x23')]()[_0xd5a1('0x22')](function(){_0x40fbe1['status'](0xcc)[_0xd5a1('0x1b')]();});}};}function handleEntityNotFound(_0x3371d3,_0x3300ff){return function(_0x467a51){if(!_0x467a51){_0x3371d3['sendStatus'](0x194);}return _0x467a51;};}function handleError(_0x491e3f,_0x14b909){_0x14b909=_0x14b909||0x1f4;return function(_0x5078a4){logger[_0xd5a1('0x24')](_0x5078a4['stack']);if(_0x5078a4[_0xd5a1('0x25')]){delete _0x5078a4['name'];}_0x491e3f['status'](_0x14b909)[_0xd5a1('0x26')](_0x5078a4);};}exports[_0xd5a1('0x27')]=function(_0x28eabb,_0x2a0e9e){var _0x307f90={},_0x5a71e1={},_0x24b6fe={'count':0x0,'rows':[]};var _0x32c979=_[_0xd5a1('0x28')](db['UserProfile'][_0xd5a1('0x29')],function(_0x5ebbe7){return{'name':_0x5ebbe7[_0xd5a1('0x2a')],'type':_0x5ebbe7[_0xd5a1('0x2b')][_0xd5a1('0x2c')]};});_0x5a71e1[_0xd5a1('0x2d')]=_['map'](_0x32c979,'name');_0x5a71e1[_0xd5a1('0x2e')]=_['keys'](_0x28eabb[_0xd5a1('0x2e')]);_0x5a71e1[_0xd5a1('0x2f')]=_[_0xd5a1('0x30')](_0x5a71e1[_0xd5a1('0x2d')],_0x5a71e1[_0xd5a1('0x2e')]);_0x307f90[_0xd5a1('0x31')]=_['intersection'](_0x5a71e1[_0xd5a1('0x2d')],qs[_0xd5a1('0x32')](_0x28eabb['query']['fields']));_0x307f90[_0xd5a1('0x31')]=_0x307f90[_0xd5a1('0x31')][_0xd5a1('0x33')]?_0x307f90[_0xd5a1('0x31')]:_0x5a71e1[_0xd5a1('0x2d')];if(!_0x28eabb[_0xd5a1('0x2e')][_0xd5a1('0x34')](_0xd5a1('0x35'))){_0x307f90['limit']=qs[_0xd5a1('0x1e')](_0x28eabb['query'][_0xd5a1('0x1e')]);_0x307f90['offset']=qs[_0xd5a1('0x36')](_0x28eabb['query'][_0xd5a1('0x36')]);}_0x307f90[_0xd5a1('0x37')]=qs[_0xd5a1('0x38')](_0x28eabb[_0xd5a1('0x2e')][_0xd5a1('0x38')]);_0x307f90[_0xd5a1('0x39')]=qs['filters'](_['pick'](_0x28eabb[_0xd5a1('0x2e')],_0x5a71e1[_0xd5a1('0x2f')]));if(_0x28eabb['query'][_0xd5a1('0x3a')]){_0x307f90['where']=_[_0xd5a1('0x3b')](_0x307f90[_0xd5a1('0x39')],{'$or':_[_0xd5a1('0x28')](_0x32c979,function(_0x4cac9f){if(_0x4cac9f['type']!=='VIRTUAL'){var _0x2046b0={};_0x2046b0[_0x4cac9f['name']]={'$like':'%'+_0x28eabb[_0xd5a1('0x2e')]['filter']+'%'};return _0x2046b0;}})});}_0x307f90=_['merge']({},_0x307f90,_0x28eabb['options']);var _0xe12ca9={'where':_0x307f90[_0xd5a1('0x39')]};return db[_0xd5a1('0x3c')][_0xd5a1('0x3d')](_0xe12ca9)[_0xd5a1('0x22')](function(_0x1a603c){_0x24b6fe[_0xd5a1('0x3d')]=_0x1a603c;if(_0x28eabb['query'][_0xd5a1('0x3e')]){_0x307f90[_0xd5a1('0x3f')]=[{'all':!![]}];}return db[_0xd5a1('0x3c')][_0xd5a1('0x40')](_0x307f90);})['then'](function(_0x1c9587){_0x24b6fe['rows']=_0x1c9587;return _0x24b6fe;})[_0xd5a1('0x22')](respondWithFilteredResult(_0x2a0e9e,_0x307f90))['catch'](handleError(_0x2a0e9e,null));};exports[_0xd5a1('0x41')]=function(_0x267a5d,_0x3d8256){var _0x59137e={'raw':![],'where':{'id':_0x267a5d[_0xd5a1('0x42')]['id']}},_0x421db3={};_0x421db3[_0xd5a1('0x2d')]=_['keys'](db[_0xd5a1('0x3c')][_0xd5a1('0x29')]);_0x421db3['query']=_[_0xd5a1('0x43')](_0x267a5d[_0xd5a1('0x2e')]);_0x421db3[_0xd5a1('0x2f')]=_[_0xd5a1('0x30')](_0x421db3[_0xd5a1('0x2d')],_0x421db3[_0xd5a1('0x2e')]);_0x59137e[_0xd5a1('0x31')]=_[_0xd5a1('0x30')](_0x421db3[_0xd5a1('0x2d')],qs[_0xd5a1('0x32')](_0x267a5d[_0xd5a1('0x2e')][_0xd5a1('0x32')]));_0x59137e['attributes']=_0x59137e[_0xd5a1('0x31')]['length']?_0x59137e[_0xd5a1('0x31')]:_0x421db3['model'];if(_0x267a5d[_0xd5a1('0x2e')]['includeAll']){_0x59137e[_0xd5a1('0x3f')]=[{'all':!![]}];}_0x59137e=_[_0xd5a1('0x3b')]({},_0x59137e,_0x267a5d[_0xd5a1('0x44')]);return db[_0xd5a1('0x3c')][_0xd5a1('0x45')](_0x59137e)[_0xd5a1('0x22')](handleEntityNotFound(_0x3d8256,null))[_0xd5a1('0x22')](respondWithResult(_0x3d8256,null))['catch'](handleError(_0x3d8256,null));};exports[_0xd5a1('0x46')]=function(_0x5743eb,_0x1b9efa){return db[_0xd5a1('0x3c')][_0xd5a1('0x46')](_0x5743eb['body'],{})[_0xd5a1('0x22')](respondWithResult(_0x1b9efa,0xc9))[_0xd5a1('0x47')](handleError(_0x1b9efa,null));};exports[_0xd5a1('0x48')]=function(_0x53994f,_0x374fbb){var _0x1b4d8c={'where':{'id':_0x53994f[_0xd5a1('0x42')]['id']}},_0x340210={};_0x340210[_0xd5a1('0x2d')]=_[_0xd5a1('0x43')](db[_0xd5a1('0x3c')][_0xd5a1('0x29')]);_0x1b4d8c[_0xd5a1('0x31')]=_[_0xd5a1('0x30')](_0x340210['model'],qs['fields'](_0x53994f[_0xd5a1('0x2e')]['fields']));_0x1b4d8c[_0xd5a1('0x31')]=_0x1b4d8c['attributes'][_0xd5a1('0x33')]?_0x1b4d8c[_0xd5a1('0x31')]:_0x340210[_0xd5a1('0x2d')];if(_0x53994f[_0xd5a1('0x2e')][_0xd5a1('0x3e')]){_0x1b4d8c['include']=[{'all':!![]}];}_0x1b4d8c=_[_0xd5a1('0x3b')]({},_0x1b4d8c,_0x53994f[_0xd5a1('0x44')]);return db[_0xd5a1('0x3c')][_0xd5a1('0x45')](_0x1b4d8c)['then'](handleEntityNotFound(_0x374fbb,null))[_0xd5a1('0x22')](function(_0xc815cf){if(_0xc815cf){var _0x2c0ac8=_0xc815cf[_0xd5a1('0x49')]({'plain':!![]});_0x2c0ac8=qs[_0xd5a1('0x4a')](_0x2c0ac8,['id',_0xd5a1('0x4b'),_0xd5a1('0x4c'),_0xd5a1('0x4d')]);_0x53994f[_0xd5a1('0x4e')]=_[_0xd5a1('0x4a')](_0x53994f['body'],['id',_0xd5a1('0x4b'),_0xd5a1('0x4c')]);return db['sequelize'][_0xd5a1('0x4f')](function(_0x41d5f9){return db[_0xd5a1('0x3c')][_0xd5a1('0x46')](_['merge'](_0x2c0ac8,_0x53994f[_0xd5a1('0x4e')]),{'include':_0x53994f['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x41d5f9})[_0xd5a1('0x22')](function(_0x436cae){var _0x2a7162=_0x436cae[_0xd5a1('0x49')]({'plain':!![]});return db['UserProfileSection'][_0xd5a1('0x40')]({'where':{'userProfileId':_0x53994f[_0xd5a1('0x42')]['id']},'raw':!![]})[_0xd5a1('0x22')](function(_0x154cb3){if(_0x154cb3){return BPromise['each'](_0x154cb3,function(_0x31d28e){return new BPromise(function(_0x30f85a,_0x23c6f8){if(_0x31d28e[_0xd5a1('0x50')]===null||_0x31d28e[_0xd5a1('0x50')]===0x1)_0x30f85a(null);return db[_0xd5a1('0x51')]['findAll']({'where':{'sectionId':_0x31d28e['id']},'raw':!![]})[_0xd5a1('0x22')](function(_0xb48c98){var _0x49d960=_['map'](_0xb48c98,function(_0x181908){return qs[_0xd5a1('0x4a')](_0x181908,['id',_0xd5a1('0x4b'),_0xd5a1('0x4c'),_0xd5a1('0x52')]);});_0x30f85a(_0x49d960);})[_0xd5a1('0x47')](function(_0x172084){_0x23c6f8(_0x172084);});})['then'](function(_0x513131){var _0x2eb112=qs['omit'](_0x31d28e,['id',_0xd5a1('0x4b'),_0xd5a1('0x4c')]);_0x2eb112[_0xd5a1('0x53')]=_0x2a7162['id'];if(_0x513131)_0x2eb112[_0xd5a1('0x54')]=_0x513131;return _0x2eb112;})[_0xd5a1('0x22')](function(_0x8c02ac){return db['UserProfileSection']['create'](_0x8c02ac,{'include':[{'model':db[_0xd5a1('0x51')],'as':_0xd5a1('0x54')}],'raw':!![],'transaction':_0x41d5f9});});})[_0xd5a1('0x22')](function(){return _0x2a7162;});}});});});}})[_0xd5a1('0x22')](respondWithResult(_0x374fbb,0xc9))[_0xd5a1('0x47')](handleError(_0x374fbb,null));};exports[_0xd5a1('0x55')]=function(_0x51c819,_0x2e30b0){if(_0x51c819['body']['id']){delete _0x51c819[_0xd5a1('0x4e')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x51c819[_0xd5a1('0x42')]['id']}})[_0xd5a1('0x22')](handleEntityNotFound(_0x2e30b0,null))['then'](saveUpdates(_0x51c819['body'],null))[_0xd5a1('0x22')](respondWithResult(_0x2e30b0,null))[_0xd5a1('0x47')](handleError(_0x2e30b0,null));};exports[_0xd5a1('0x23')]=function(_0x262a26,_0xf842d8){return db[_0xd5a1('0x3c')][_0xd5a1('0x45')]({'where':{'id':_0x262a26[_0xd5a1('0x42')]['id']}})[_0xd5a1('0x22')](handleEntityNotFound(_0xf842d8,null))[_0xd5a1('0x22')](removeEntity(_0xf842d8,null))['catch'](handleError(_0xf842d8,null));};exports[_0xd5a1('0x56')]=function(_0x18df31,_0x1aa26f){return db[_0xd5a1('0x3c')][_0xd5a1('0x56')]()[_0xd5a1('0x22')](respondWithResult(_0x1aa26f,null))[_0xd5a1('0x47')](handleError(_0x1aa26f,null));};exports[_0xd5a1('0x57')]=function(_0x24a670,_0x5b3bc3){var _0x420e78=_0x24a670[_0xd5a1('0x4e')];return db[_0xd5a1('0x3c')][_0xd5a1('0x45')]({'where':{'id':_0x24a670[_0xd5a1('0x42')]['id']}})[_0xd5a1('0x22')](handleEntityNotFound(_0x5b3bc3,null))[_0xd5a1('0x22')](function(_0x4bf7f7){if(_0x4bf7f7){return db[_0xd5a1('0x58')][_0xd5a1('0x4f')](function(_0x2c8898){return db[_0xd5a1('0x59')][_0xd5a1('0x23')]({'where':{'userProfileId':_0x24a670[_0xd5a1('0x42')]['id'],'sectionId':_[_0xd5a1('0x28')](_0x420e78,function(_0x5961b5){return _0x5961b5['sectionId'];})},'transaction':_0x2c8898})['then'](function(){var _0x3756c3=_['map'](_0x420e78,function(_0x5130d8){_0x5130d8[_0xd5a1('0x53')]=_0x24a670[_0xd5a1('0x42')]['id'];return _0x5130d8;});var _0x45d006=[];return BPromise['each'](_0x3756c3,function(_0x4f97bd){return db[_0xd5a1('0x59')][_0xd5a1('0x46')](_0x4f97bd,{'include':[{'model':db['UserProfileResource'],'as':_0xd5a1('0x54')}],'raw':!![],'transaction':_0x2c8898})[_0xd5a1('0x22')](function(_0x551c2f){_0x45d006[_0xd5a1('0x5a')](_0x551c2f[_0xd5a1('0x49')]({'plain':!![]}));});})['then'](function(){return _0x45d006;});});});}})[_0xd5a1('0x22')](function(_0x22ba4c){return _0x22ba4c;})['then'](respondWithResult(_0x5b3bc3,null))[_0xd5a1('0x47')](handleError(_0x5b3bc3,null));};exports[_0xd5a1('0x5b')]=function(_0x3f9972,_0x3a8d86){var _0x4a099c;return db[_0xd5a1('0x3c')][_0xd5a1('0x45')]({'where':{'id':_0x3f9972[_0xd5a1('0x42')]['id']},'attributes':['id',_0xd5a1('0x25')]})[_0xd5a1('0x22')](handleEntityNotFound(_0x3a8d86,null))['then'](function(_0x3d3c1a){if(_0x3d3c1a){_0x4a099c=_0x3d3c1a;return db['UserProfileSection'][_0xd5a1('0x23')]({'where':{'userProfileId':_0x3f9972[_0xd5a1('0x42')]['id'],'sectionId':_0x3f9972['query'][_0xd5a1('0x5c')]}});}})[_0xd5a1('0x22')](function(){return _0x4a099c;})['then'](respondWithStatusCode(_0x3a8d86,null))[_0xd5a1('0x47')](handleError(_0x3a8d86,null));};exports[_0xd5a1('0x5d')]=function(_0x86152,_0x2d0a6d){var _0x57fe79=[];var _0x17a47f=[];return db['UserProfileSection'][_0xd5a1('0x40')]({'where':{'userProfileId':_0x86152[_0xd5a1('0x42')]['id']},'raw':!![]})['then'](function(_0x3c77ab){_0x57fe79=_[_0xd5a1('0x3a')](_0x3c77ab,function(_0x5678cb){return _0x5678cb[_0xd5a1('0x5e')]===0x1||_[_0xd5a1('0x5f')]([0x3eb,0x709],_0x5678cb[_0xd5a1('0x52')]);});if(!_[_0xd5a1('0x60')](_0x57fe79)){return _[_0xd5a1('0x28')](_0x57fe79,function(_0x73e20d){return _0x73e20d['sectionId'];});}else{return;}})['then'](function(_0x51b917){if(_0x51b917)_0x17a47f=_0x51b917;if(_[_0xd5a1('0x5f')](_0x17a47f,0x64)){var _0x3b4342=_[_0xd5a1('0x45')](_0x57fe79,{'sectionId':0x64});return hasDefaultDashboard(_0x3b4342)[_0xd5a1('0x22')](function(_0x1a4073){return _['map'](_0x57fe79,function(_0x42f8fe){if(_0x42f8fe[_0xd5a1('0x52')]===0x64){_0x42f8fe[_0xd5a1('0x61')]=_0x1a4073;}return _0x42f8fe;});});}else{return;}})[_0xd5a1('0x22')](function(_0x278d07){if(_0x278d07)_0x57fe79=_0x278d07;if(_[_0xd5a1('0x5f')](_0x17a47f,0x3eb)){var _0x4f33e8=_[_0xd5a1('0x45')](_0x57fe79,{'sectionId':0x3eb});return getCustomDashboards(_0x4f33e8)[_0xd5a1('0x22')](function(_0x4fbe3c){return _['map'](_0x57fe79,function(_0x578e93){if(_0x4f33e8[_0xd5a1('0x5e')]){if(_0x578e93[_0xd5a1('0x52')]===0x3eb){_0x578e93[_0xd5a1('0x61')]=_0x4fbe3c;}}else{if(_0x578e93[_0xd5a1('0x52')]===0x64){_0x578e93[_0xd5a1('0x61')]=_0x4fbe3c;}}return _0x578e93;});});}else{return;}})[_0xd5a1('0x22')](function(_0x150213){if(_0x150213)_0x57fe79=_0x150213;if(_[_0xd5a1('0x5f')](_0x17a47f,0x709)){var _0x38c420=_['find'](_0x57fe79,{'sectionId':0x709});return getPlugins(_0x38c420)[_0xd5a1('0x22')](function(_0x266a05){if(_0x38c420['enabled']){return _[_0xd5a1('0x28')](_0x57fe79,function(_0x194120){if(_0x194120[_0xd5a1('0x52')]===0x709){_0x194120[_0xd5a1('0x61')]=_0x266a05;}return _0x194120;});}else{var _0x2ff74e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x266a05};var _0x28e72e=_['map'](_0x57fe79);_0x28e72e[_0xd5a1('0x5a')](_0x2ff74e);return _0x28e72e;}});}else{return;}})[_0xd5a1('0x22')](function(_0x3f93cb){if(_0x3f93cb)_0x57fe79=_0x3f93cb;return _[_0xd5a1('0x3a')](_0x57fe79,[_0xd5a1('0x5e'),0x1]);})[_0xd5a1('0x22')](respondWithResult(_0x2d0a6d,null))[_0xd5a1('0x47')](handleError(_0x2d0a6d,null));};function hasDefaultDashboard(_0x485ce9){var _0x5627b7=[0x65];return new BPromise(function(_0x103f78,_0x3428b6){try{if(_0x485ce9[_0xd5a1('0x50')]){_0x103f78(_0x5627b7);}else{return db[_0xd5a1('0x51')]['findOne']({'where':{'sectionId':_0x485ce9['id']},'raw':!![]})[_0xd5a1('0x22')](function(_0xaa7123){_0xaa7123?_0x103f78(_0x5627b7):_0x103f78();});}}catch(_0x4ade11){_0x3428b6(_0x4ade11);}});}function getCustomDashboards(_0xdba51){var _0x5c8b78=[];return new BPromise(function(_0xe244bc,_0x335c5c){try{if(_0xdba51[_0xd5a1('0x50')]){return db[_0xd5a1('0x62')][_0xd5a1('0x40')]({'raw':!![]})[_0xd5a1('0x22')](function(_0x4acdc0){_0x4acdc0[_0xd5a1('0x63')](function(_0x53a929){_0x5c8b78['push'](_0x53a929['id']+0x1869f);});_0xe244bc(_0x5c8b78);});}else{return db[_0xd5a1('0x51')][_0xd5a1('0x40')]({'where':{'sectionId':_0xdba51['id']},'raw':!![]})['then'](function(_0x22bb00){_0x22bb00[_0xd5a1('0x63')](function(_0xab7acd){_0x5c8b78[_0xd5a1('0x5a')](_0xab7acd['resourceId']+0x1869f);});_0xe244bc(_0x5c8b78);});}}catch(_0x2ca4fd){_0x335c5c(_0x2ca4fd);}});}function getPlugins(_0x18370b){var _0x175cbf=[];return new BPromise(function(_0xcaa8e0,_0x41fdf3){try{if(_0x18370b[_0xd5a1('0x50')]){return db['Plugin'][_0xd5a1('0x40')]({'raw':!![]})['then'](function(_0x1bac0e){_0x1bac0e[_0xd5a1('0x63')](function(_0x1cc3df){_0x175cbf[_0xd5a1('0x5a')](_0x1cc3df['id']+0x15b38);});_0xcaa8e0(_0x175cbf);});}else{return db[_0xd5a1('0x51')]['findAll']({'where':{'sectionId':_0x18370b['id']},'raw':!![]})[_0xd5a1('0x22')](function(_0x5398cc){_0x5398cc[_0xd5a1('0x63')](function(_0x22eb95){_0x175cbf[_0xd5a1('0x5a')](_0x22eb95[_0xd5a1('0x64')]+0x15b38);});_0xcaa8e0(_0x175cbf);});}}catch(_0xadcf1e){_0x41fdf3(_0xadcf1e);}});}exports['addResources']=function(_0xe0a9a8,_0x1fccca){return db[_0xd5a1('0x3c')]['find']({'where':{'id':_0xe0a9a8[_0xd5a1('0x42')]['id']}})[_0xd5a1('0x22')](handleEntityNotFound(_0x1fccca,null))['then'](function(_0x19d55b){if(_0x19d55b){return db['sequelize'][_0xd5a1('0x4f')](function(_0x2aff5d){return db[_0xd5a1('0x59')]['findAll']({'where':{'userProfileId':_0xe0a9a8[_0xd5a1('0x42')]['id']},'attributes':['id'],'raw':!![]})[_0xd5a1('0x22')](function(_0x1545a5){if(_0x1545a5){return db[_0xd5a1('0x59')][_0xd5a1('0x23')]({'where':{'userProfileId':_0xe0a9a8[_0xd5a1('0x42')]['id'],'id':_[_0xd5a1('0x28')](_0x1545a5,function(_0x206756){return _0x206756['id'];})},'transaction':_0x2aff5d});}})[_0xd5a1('0x22')](function(_0x59156e){var _0x180bcd=_[_0xd5a1('0x28')](_0xe0a9a8[_0xd5a1('0x4e')],function(_0x18fe81){_0x18fe81[_0xd5a1('0x53')]=_0xe0a9a8[_0xd5a1('0x42')]['id'];return _0x18fe81;});return db[_0xd5a1('0x59')][_0xd5a1('0x65')](_0x180bcd,{'raw':!![],'transaction':_0x2aff5d});})['then'](function(_0x3e87c6){var _0x4daffe=_['filter'](_['map'](_0x3e87c6,function(_0x38a781){return _0x38a781['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4daffe){return db[_0xd5a1('0x59')][_0xd5a1('0x40')]({'where':{'userProfileId':_0xe0a9a8['params']['id'],'sectionId':_[_0xd5a1('0x28')](_0x4daffe,function(_0x141384){return _0x141384[_0xd5a1('0x52')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xd5a1('0x22')](function(_0x28dc66){var _0x45e864=_['map'](_0xe0a9a8[_0xd5a1('0x4e')],function(_0x2f2b6b){_0x2f2b6b['userProfileId']=_0xe0a9a8[_0xd5a1('0x42')]['id'];return _0x2f2b6b;});return db[_0xd5a1('0x51')]['bulkCreate'](_0x45e864,{'raw':!![],'transaction':_0x2aff5d});});}})[_0xd5a1('0x47')](handleError(_0x1fccca,null));});}})[_0xd5a1('0x22')](function(_0x47e06b){var _0x5c13f0=_[_0xd5a1('0x28')](_0x47e06b,function(_0x52746b){return _0x52746b[_0xd5a1('0x49')]({'plain':!![]});});})[_0xd5a1('0x22')](respondWithResult(_0x1fccca,null))[_0xd5a1('0x47')](handleError(_0x1fccca,null));};exports[_0xd5a1('0x66')]=function(_0x541955,_0xc828c5,_0xc16ef1){return db[_0xd5a1('0x3c')]['find']({'where':{'id':_0x541955[_0xd5a1('0x42')]['id']}})[_0xd5a1('0x22')](handleEntityNotFound(_0xc828c5,null))[_0xd5a1('0x22')](function(_0x33f4f7){if(_0x33f4f7){return _0x33f4f7[_0xd5a1('0x66')](_0x541955[_0xd5a1('0x2e')]['ids']);}})[_0xd5a1('0x22')](respondWithStatusCode(_0xc828c5,null))[_0xd5a1('0x47')](handleError(_0xc828c5,null));};exports['getResources']=function(_0x303835,_0x5a14e0){var _0x21a080={'raw':![],'where':{}};var _0x231fa6={};var _0x3e6451={'count':0x0,'rows':[]};var _0xf8b9d9=_0x303835[_0xd5a1('0x2e')]['section'];if(typeof _0xf8b9d9===_0xd5a1('0x67')){throw new db[(_0xd5a1('0x68'))][(_0xd5a1('0x69'))](_0xd5a1('0x6a'));}var _0x169936=_0x303835[_0xd5a1('0x2e')]['mergeResources']||![];var _0x3a369d=getQueryModels(_0xf8b9d9,_0x169936);if(typeof _0x3a369d[_0xd5a1('0x6b')]===_0xd5a1('0x67')){throw new db['Sequelize'][(_0xd5a1('0x69'))](_0xd5a1('0x6c')+_0xf8b9d9+'\x27');}var _0x1f276a=[];if(!_[_0xd5a1('0x60')](_0x3a369d[_0xd5a1('0x6d')])){_0x1f276a=_0x3a369d[_0xd5a1('0x6d')];}else{_0x1f276a=[{'name':_0xf8b9d9}];}return db[_0xd5a1('0x3c')][_0xd5a1('0x6e')]({'where':{'id':_0x303835[_0xd5a1('0x42')]['id']}})['then'](handleEntityNotFound(_0x5a14e0,null))[_0xd5a1('0x22')](function(_0x1145a3){if(_0x1145a3){var _0x429177=[];for(var _0x2be89d=0x0;_0x2be89d<_0x1f276a['length'];_0x2be89d++){_0x429177[_0xd5a1('0x5a')](db[_0xd5a1('0x59')][_0xd5a1('0x6e')]({'where':{'userProfileId':_0x1145a3['id'],'name':_0x1f276a[_0x2be89d][_0xd5a1('0x25')]},'raw':!![]}));}return BPromise[_0xd5a1('0x6f')](_0x429177);}})['then'](function(_0x6f2c36){var _0x5c48be=_['filter'](_0x6f2c36,function(_0x5e7c99){return _0x5e7c99?_0x5e7c99:undefined;});var _0x5c2121=_[_0xd5a1('0x3a')](_0x1f276a,['ignore',!![]]);var _0x1274be=_[_0xd5a1('0x60')](_0x5c48be)&&_[_0xd5a1('0x60')](_0x5c2121)?null:_['union'](_0x5c2121,_0x5c48be);if(_0x1274be){var _0x5dce79=[];for(var _0x30a119=0x0;_0x30a119<_0x1274be['length'];_0x30a119++){var _0x5de190=_[_0xd5a1('0x45')](_0x1f276a,function(_0x2096f4){return _0x1274be[_0x30a119]?_0x2096f4[_0xd5a1('0x25')]===_0x1274be[_0x30a119][_0xd5a1('0x25')]:null;});if(_0x5de190){if(_0x1274be[_0x30a119]['ignore']){_0x5dce79[_0xd5a1('0x5a')](getAllResources(_0x3a369d[_0xd5a1('0x6b')],_0x1274be[_0x30a119]));}else{if(!_0x1274be[_0x30a119][_0xd5a1('0x50')]){_0x5dce79[_0xd5a1('0x5a')](getAllowedResources(_0x5de190,_0x1274be[_0x30a119],_0x3a369d[_0xd5a1('0x6b')]));}else{if(_0x5de190[_0xd5a1('0x2d')]){_0x5dce79[_0xd5a1('0x5a')](getAllFilteredResources(_0x5de190,_0x1274be[_0x30a119]));}}}}}return BPromise[_0xd5a1('0x6f')](_0x5dce79);}else{return null;}})[_0xd5a1('0x22')](function(_0x423172){var _0x3caaa2=_0x423172;var _0x3bbfa2=null;if(_0x3caaa2){_0x3bbfa2=_0x3caaa2[_0xd5a1('0x33')]===0x1?_0x3caaa2[0x0]:null;}if(_0x3bbfa2||_0x3caaa2){var _0x1d688f=db[_0x3a369d[_0xd5a1('0x6b')]]['rawAttributes'];_0x231fa6[_0xd5a1('0x2d')]=_[_0xd5a1('0x43')](_0x1d688f);_0x231fa6[_0xd5a1('0x2e')]=_['keys'](_0x303835[_0xd5a1('0x2e')]);_0x231fa6[_0xd5a1('0x2f')]=_[_0xd5a1('0x30')](_0x231fa6[_0xd5a1('0x2d')],_0x231fa6[_0xd5a1('0x2e')]);_0x21a080['attributes']=_[_0xd5a1('0x30')](_0x231fa6[_0xd5a1('0x2d')],qs['fields'](_0x303835['query'][_0xd5a1('0x32')]));_0x21a080[_0xd5a1('0x31')]=_0x21a080[_0xd5a1('0x31')]['length']?_0x21a080['attributes']:_0x231fa6[_0xd5a1('0x2d')];if(!_0x303835[_0xd5a1('0x2e')][_0xd5a1('0x34')]('nolimit')){_0x21a080['limit']=qs[_0xd5a1('0x1e')](_0x303835['query'][_0xd5a1('0x1e')]);_0x21a080[_0xd5a1('0x36')]=qs[_0xd5a1('0x36')](_0x303835['query'][_0xd5a1('0x36')]);}_0x21a080[_0xd5a1('0x37')]=qs[_0xd5a1('0x38')](_0x303835[_0xd5a1('0x2e')][_0xd5a1('0x38')]);_0x21a080[_0xd5a1('0x39')]=qs[_0xd5a1('0x2f')](_[_0xd5a1('0x70')](_0x303835[_0xd5a1('0x2e')],_0x231fa6[_0xd5a1('0x2f')]));if(_0x303835['query'][_0xd5a1('0x3a')]){_0x21a080[_0xd5a1('0x39')]=_[_0xd5a1('0x3b')](_0x21a080[_0xd5a1('0x39')],{'$or':_[_0xd5a1('0x28')](_0x1d688f,function(_0x40ae6e){if(_0x40ae6e['type'][_0xd5a1('0x2c')]!==_0xd5a1('0x71')){var _0x513cde={};_0x513cde[_0x40ae6e[_0xd5a1('0x72')]]={'$like':'%'+_0x303835[_0xd5a1('0x2e')][_0xd5a1('0x3a')]+'%'};return _0x513cde;}})});}var _0x392c53=[];if(_0x3bbfa2){var _0x1aa8ba=_['find'](_0x1f276a,[_0xd5a1('0x25'),_0x3bbfa2[_0xd5a1('0x25')]]);if(_0x1aa8ba[_0xd5a1('0x72')]){var _0x362b91={};if(_0x3a369d[_0xd5a1('0x6b')]===_0xd5a1('0x73')){_0x362b91[_0x1aa8ba[_0xd5a1('0x74')]]=_['map'](_0x3bbfa2['associatedResources'],'id');}else{_0x362b91[_0x1aa8ba[_0xd5a1('0x74')]]=_0x3bbfa2[_0xd5a1('0x75')];}_0x392c53[_0xd5a1('0x5a')](_0x362b91);}else{_0x21a080['where']['id']=_0x3bbfa2[_0xd5a1('0x75')];}}else{for(var _0x79d702=0x0;_0x79d702<_0x3caaa2[_0xd5a1('0x33')];_0x79d702++){var _0x1aa8ba=_[_0xd5a1('0x45')](_0x1f276a,[_0xd5a1('0x25'),_0x3caaa2[_0x79d702][_0xd5a1('0x25')]]);if(_0x1aa8ba[_0xd5a1('0x72')]){var _0x362b91={};_0x362b91[_0x1aa8ba['foreignKey']]=_0x3caaa2[_0x79d702][_0xd5a1('0x75')];_0x392c53[_0xd5a1('0x5a')](_0x362b91);}else{if(!_0x21a080[_0xd5a1('0x39')]['id'])_0x21a080[_0xd5a1('0x39')]['id']=[];_0x3caaa2[_0x79d702][_0xd5a1('0x75')]['forEach'](function(_0x57dea2){_0x21a080['where']['id'][_0xd5a1('0x5a')](_0x57dea2);});}}}if(!_['isEmpty'](_0x392c53)){_0x21a080[_0xd5a1('0x39')]=_['merge'](_0x21a080['where'],{'$and':{'$or':_0x392c53}});}_0x21a080=_[_0xd5a1('0x3b')]({},_0x21a080,_0x303835[_0xd5a1('0x44')]);if(_0x3bbfa2&&!_0x3bbfa2['autoAssociation']&&_0x3a369d[_0xd5a1('0x6b')]===_0xd5a1('0x73')){if(_0x303835['query'][_0xd5a1('0x3e')]){_0x21a080[_0xd5a1('0x3f')]=[{'all':!![]}];}return db[_0x3a369d['childModel']][_0xd5a1('0x40')](_0x21a080)[_0xd5a1('0x22')](function(_0x17107b){var _0x478560=[];_0x17107b['forEach'](function(_0x1e1f11){var _0x544d3a;switch(_0x1e1f11[_0xd5a1('0x76')]){case _0xd5a1('0x77'):_0x544d3a=_[_0xd5a1('0x45')](_0x3bbfa2[_0xd5a1('0x75')],function(_0x191e82){return _0x191e82['id']===_0x1e1f11[_0xd5a1('0x78')]&&_0x191e82[_0xd5a1('0x2b')]==='DefaultReports';});break;case _0xd5a1('0x79'):_0x544d3a=_[_0xd5a1('0x45')](_0x3bbfa2[_0xd5a1('0x75')],function(_0x573b5a){return _0x573b5a['id']===_0x1e1f11[_0xd5a1('0x78')]&&_0x573b5a[_0xd5a1('0x2b')]==='CustomReports';});break;}if(_0x544d3a)_0x478560[_0xd5a1('0x5a')](_0x1e1f11);});_0x3e6451[_0xd5a1('0x3d')]=_0x478560[_0xd5a1('0x33')];_0x3e6451['rows']=_0x478560;return _0x3e6451;});}else{return db[_0x3a369d[_0xd5a1('0x6b')]][_0xd5a1('0x3d')]({'where':_0x21a080[_0xd5a1('0x39')]})[_0xd5a1('0x22')](function(_0x494ac9){_0x3e6451[_0xd5a1('0x3d')]=_0x494ac9;if(_0x303835[_0xd5a1('0x2e')][_0xd5a1('0x3e')]){if(_0x3a369d[_0xd5a1('0x6b')]===_0xd5a1('0x7a')){_0x21a080[_0xd5a1('0x3f')]=[{'model':db[_0xd5a1('0x7b')],'as':_0xd5a1('0x7c'),'attributes':['id','name',_0xd5a1('0x7d')],'required':_0x303835[_0xd5a1('0x2e')][_0xd5a1('0x7e')]?!![]:![]},{'model':db[_0xd5a1('0x7b')],'as':'ThroughTags','attributes':['id','name',_0xd5a1('0x7d')],'through':_0x303835[_0xd5a1('0x2e')]['tag']?{'attributes':[],'where':{'TagId':_0x303835[_0xd5a1('0x2e')][_0xd5a1('0x7e')]||undefined}}:{},'required':_0x303835[_0xd5a1('0x2e')][_0xd5a1('0x7e')]?!![]:![]}];}else{_0x21a080[_0xd5a1('0x3f')]=[{'all':!![]}];}}return db[_0x3a369d[_0xd5a1('0x6b')]][_0xd5a1('0x40')](_0x21a080);})[_0xd5a1('0x22')](function(_0x48e40f){_0x3e6451[_0xd5a1('0x7f')]=_0x48e40f;return _0x3e6451;});}}else{return _0x3e6451;}})['then'](respondWithFilteredResult(_0x5a14e0,_0x21a080))[_0xd5a1('0x47')](handleError(_0x5a14e0,null));};function getAllResources(_0x92e9d,_0x53d396){return new BPromise(function(_0x58dcf6,_0x355685){if(_0x53d396){var _0x3d16dc=_0x53d396['filter']?{[_0x53d396[_0xd5a1('0x3a')][_0xd5a1('0x72')]]:_0x53d396['filter'][_0xd5a1('0x80')]}:undefined;return db[_0x92e9d][_0xd5a1('0x40')]({'where':_0x3d16dc,'raw':!![]})[_0xd5a1('0x22')](function(_0x33271a){_0x53d396['associatedResources']=_['map'](_0x33271a,'id');_0x58dcf6(_0x53d396);})[_0xd5a1('0x47')](function(_0x179f89){_0x355685(_0x179f89);});}else{_0x58dcf6(null);}});}function getAllFilteredResources(_0x38b9b9,_0x5f52c9){return new BPromise(function(_0x360151,_0x4c12c8){var _0x1dcf80=_0x38b9b9[_0xd5a1('0x3a')]?{[_0x38b9b9[_0xd5a1('0x3a')][_0xd5a1('0x72')]]:_0x38b9b9[_0xd5a1('0x3a')]['value']}:undefined;return db[_0x38b9b9['model']][_0xd5a1('0x40')]({'where':_0x1dcf80,'raw':!![]})[_0xd5a1('0x22')](function(_0x206034){_0x5f52c9[_0xd5a1('0x75')]=_[_0xd5a1('0x28')](_0x206034,function(_0x4d5bae){return _0x4d5bae['name'];});_0x360151(_0x5f52c9);})[_0xd5a1('0x47')](function(_0x2d5264){_0x4c12c8(_0x2d5264);});});}function getAllowedResources(_0x553e99,_0x3f5425,_0x28c68f){return new BPromise(function(_0xe04e42,_0x2ab206){if(_0x3f5425){return db['UserProfileResource'][_0xd5a1('0x40')]({'where':{'sectionId':_0x3f5425['id']},'raw':!![]})['then'](function(_0x3e7667){if(_0x553e99['field']&&_0x553e99[_0xd5a1('0x72')]!=='id'){_0x3f5425[_0xd5a1('0x75')]=_[_0xd5a1('0x28')](_0x3e7667,function(_0x2fff22){return _0x2fff22[_0x553e99[_0xd5a1('0x72')]];});}else{if(_0x28c68f===_0xd5a1('0x73')){_0x3f5425[_0xd5a1('0x75')]=_[_0xd5a1('0x28')](_0x3e7667,function(_0x22d9a6){return{'id':_0x22d9a6[_0xd5a1('0x64')],'type':_0x22d9a6[_0xd5a1('0x2b')]};});}else{_0x3f5425[_0xd5a1('0x75')]=_[_0xd5a1('0x28')](_0x3e7667,function(_0x391c5b){return _0x391c5b['resourceId'];});}}_0xe04e42(_0x3f5425);})[_0xd5a1('0x47')](function(_0x65668a){_0x2ab206(_0x65668a);});}else{_0xe04e42(null);}});}function getQueryModels(_0x455aed,_0x2d1e1f){var _0x2e3f09=_0x455aed[_0xd5a1('0x81')]();var _0x2e85a6={'childModel':undefined,'parentSections':[]};switch(_0x2e3f09){case _0xd5a1('0x82'):_0x2e85a6['childModel']=_0xd5a1('0x83');break;case'odbc':_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x84');break;case _0xd5a1('0x85'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x86');_0x2e85a6[_0xd5a1('0x6d')]=[{'name':_0xd5a1('0x87'),'field':'name','foreignKey':_0xd5a1('0x88')}];break;case _0xd5a1('0x89'):_0x2e85a6['childModel']=_0xd5a1('0x8a');break;case'contacts':_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x7a');_0x2e85a6[_0xd5a1('0x6d')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0xd5a1('0x8b'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x8c');break;case _0xd5a1('0x8d'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x8e');break;case _0xd5a1('0x8f'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x90');break;case _0xd5a1('0x91'):_0x2e85a6['childModel']=_0xd5a1('0x92');break;case'chatwebsites':_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x93');break;case'faxqueues':_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x94');break;case _0xd5a1('0x95'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x96');break;case _0xd5a1('0x97'):case'internalroutes':case'outboundroutes':_0x2e85a6['childModel']=_0xd5a1('0x98');break;case'contexts':_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x99');break;case _0xd5a1('0x9a'):_0x2e85a6['childModel']=_0xd5a1('0x9b');break;case _0xd5a1('0x9c'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x9d');_0x2e85a6[_0xd5a1('0x6d')]=[{'name':'Agents','field':_0xd5a1('0x25'),'foreignKey':_0xd5a1('0x9e'),'model':_0xd5a1('0x9f'),'filter':{'field':'role','value':[_0xd5a1('0xa0')]}},{'name':'Telephones','field':_0xd5a1('0x25'),'foreignKey':_0xd5a1('0x9e'),'model':_0xd5a1('0x9f'),'filter':{'field':_0xd5a1('0xa1'),'value':[_0xd5a1('0xa2')]}},{'name':_0xd5a1('0xa3'),'field':_0xd5a1('0x25'),'foreignKey':_0xd5a1('0xa4'),'model':_0xd5a1('0xa5'),'filter':{'field':_0xd5a1('0x2b'),'value':[_0xd5a1('0xa6')]}},{'name':_0xd5a1('0xa7'),'field':_0xd5a1('0x25'),'foreignKey':_0xd5a1('0xa4'),'model':'VoiceQueue','filter':{'field':_0xd5a1('0x2b'),'value':[_0xd5a1('0xa8')]}}];break;case'musiconholds':_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xa9');break;case _0xd5a1('0xaa'):_0x2e85a6[_0xd5a1('0x6b')]='VoiceChanSpy';break;case'voiceprefixes':_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xab');break;case _0xd5a1('0xac'):_0x2e85a6['childModel']='Campaign';break;case'mailqueues':_0x2e85a6[_0xd5a1('0x6b')]='MailQueue';break;case _0xd5a1('0xad'):_0x2e85a6['childModel']='MailAccount';break;case _0xd5a1('0xae'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xaf');break;case _0xd5a1('0xb0'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xb1');break;case _0xd5a1('0xb2'):_0x2e85a6['childModel']=_0xd5a1('0xb3');break;case _0xd5a1('0xb4'):_0x2e85a6['childModel']=_0xd5a1('0xb5');break;case _0xd5a1('0xb6'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xb7');break;case _0xd5a1('0xb8'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xb9');break;case _0xd5a1('0xba'):case _0xd5a1('0xbb'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xa5');if(_0x2d1e1f){_0x2e85a6[_0xd5a1('0x6d')]=[{'name':'VoiceQueues'},{'name':_0xd5a1('0xa7')}];}break;case _0xd5a1('0xbc'):case'agents':case _0xd5a1('0xbd'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x9f');if(_0x2d1e1f){_0x2e85a6[_0xd5a1('0x6d')]=[{'name':_0xd5a1('0xbe'),'filter':{'field':'role','value':[_0xd5a1('0xbf'),_0xd5a1('0xc0')]},'ignore':!![]},{'name':_0xd5a1('0xc1')},{'name':'Telephones'}];}break;case _0xd5a1('0xc2'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xc3');break;case _0xd5a1('0xc4'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xc5');break;case _0xd5a1('0xc6'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xc7');break;case _0xd5a1('0xc8'):_0x2e85a6['childModel']=_0xd5a1('0xc9');break;case _0xd5a1('0xca'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xcb');break;case _0xd5a1('0xcc'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xcd');break;case _0xd5a1('0xce'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x9f');break;case'cannedanswers':_0x2e85a6['childModel']=_0xd5a1('0xcf');break;case'dispositions':_0x2e85a6['childModel']=_0xd5a1('0xd0');break;case'customdashboards':_0x2e85a6[_0xd5a1('0x6b')]='Dashboard';break;case'intervals':_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xd1');break;case _0xd5a1('0xd2'):_0x2e85a6[_0xd5a1('0x6b')]='Pause';break;case _0xd5a1('0xd3'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xd4');break;case _0xd5a1('0xd5'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xd6');break;case _0xd5a1('0xd7'):_0x2e85a6['childModel']=_0xd5a1('0x7b');break;case _0xd5a1('0xd8'):_0x2e85a6[_0xd5a1('0x6b')]='Template';break;case _0xd5a1('0xd9'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xda');break;case _0xd5a1('0xdb'):_0x2e85a6[_0xd5a1('0x6b')]='Trunk';break;case _0xd5a1('0xdc'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xdd');break;case _0xd5a1('0xde'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xdf');break;case'extractedreports':_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0x73');_0x2e85a6[_0xd5a1('0x6d')]=[{'name':_0xd5a1('0xe0'),'field':'id','foreignKey':_0xd5a1('0x78')}];break;case _0xd5a1('0xe1'):_0x2e85a6[_0xd5a1('0x6b')]=_0xd5a1('0xe2');break;default:return _0x2e85a6;}return _0x2e85a6;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 77fe9b6..be171b6 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 _0x1120=['update','emit','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save'];(function(_0x1ccb5d,_0x341da9){var _0x1fe071=function(_0x12433e){while(--_0x12433e){_0x1ccb5d['push'](_0x1ccb5d['shift']());}};_0x1fe071(++_0x341da9);}(_0x1120,0x148));var _0x0112=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x1120[_0x56f7e2];return _0x36240b;};'use strict';var EventEmitter=require(_0x0112('0x0'));var UserProfile=require(_0x0112('0x1'))['db'][_0x0112('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0112('0x3')](0x0);var events={'afterCreate':_0x0112('0x4'),'afterUpdate':_0x0112('0x5'),'afterDestroy':'remove'};function emitEvent(_0x218b72){return function(_0x1f4b3c,_0x2741e6,_0x159bbf){UserProfileEvents[_0x0112('0x6')](_0x218b72+':'+_0x1f4b3c['id'],_0x1f4b3c);UserProfileEvents['emit'](_0x218b72,_0x1f4b3c);_0x159bbf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x0112('0x7')](e,emitEvent(event));}}module[_0x0112('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xc54c=['setMaxListeners','save','hasOwnProperty','hook','events','../../mysqldb','UserProfile'];(function(_0x4fa3cf,_0x5ee88d){var _0x1d1e2c=function(_0x5000e3){while(--_0x5000e3){_0x4fa3cf['push'](_0x4fa3cf['shift']());}};_0x1d1e2c(++_0x5ee88d);}(_0xc54c,0x19a));var _0xcc54=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0xc54c[_0x3a3c17];return _0xd07f21;};'use strict';var EventEmitter=require(_0xcc54('0x0'));var UserProfile=require(_0xcc54('0x1'))['db'][_0xcc54('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xcc54('0x3')](0x0);var events={'afterCreate':_0xcc54('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5dea2b){return function(_0x4c92a7,_0x3a99d0,_0x4d3353){UserProfileEvents['emit'](_0x5dea2b+':'+_0x4c92a7['id'],_0x4c92a7);UserProfileEvents['emit'](_0x5dea2b,_0x4c92a7);_0x4d3353(null);};}for(var e in events){if(events[_0xcc54('0x5')](e)){var event=events[e];UserProfile[_0xcc54('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 79a6255..a788873 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 _0xdba4=['exports','UserProfile','user_profiles','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./userProfile.attributes'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0xdba4,0x66));var _0x4dba=function(_0x430dc3,_0x354dc7){_0x430dc3=_0x430dc3-0x0;var _0x1ab9d3=_0xdba4[_0x430dc3];return _0x1ab9d3;};'use strict';var _=require(_0x4dba('0x0'));var util=require(_0x4dba('0x1'));var logger=require(_0x4dba('0x2'))('api');var moment=require(_0x4dba('0x3'));var BPromise=require(_0x4dba('0x4'));var rp=require(_0x4dba('0x5'));var fs=require('fs');var path=require(_0x4dba('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4dba('0x7'));module[_0x4dba('0x8')]=function(_0x512880,_0x32c41b){return _0x512880['define'](_0x4dba('0x9'),attributes,{'tableName':_0x4dba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b38=['UserProfile','user_profiles','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x535412,_0x420e3f){var _0x1485fd=function(_0x55f50e){while(--_0x55f50e){_0x535412['push'](_0x535412['shift']());}};_0x1485fd(++_0x420e3f);}(_0x7b38,0xd4));var _0x87b3=function(_0x1dd460,_0x587959){_0x1dd460=_0x1dd460-0x0;var _0x379bf1=_0x7b38[_0x1dd460];return _0x379bf1;};'use strict';var _=require('lodash');var util=require(_0x87b3('0x0'));var logger=require(_0x87b3('0x1'))('api');var moment=require(_0x87b3('0x2'));var BPromise=require(_0x87b3('0x3'));var rp=require(_0x87b3('0x4'));var fs=require('fs');var path=require(_0x87b3('0x5'));var rimraf=require('rimraf');var config=require(_0x87b3('0x6'));var attributes=require('./userProfile.attributes');module['exports']=function(_0x350ac5,_0x27feca){return _0x350ac5[_0x87b3('0x7')](_0x87b3('0x8'),attributes,{'tableName':_0x87b3('0x9'),'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 00813ff..a8c5e7d 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 _0xa630=['debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent'];(function(_0x5594a0,_0x585311){var _0x6c32cb=function(_0x40e20e){while(--_0x40e20e){_0x5594a0['push'](_0x5594a0['shift']());}};_0x6c32cb(++_0x585311);}(_0xa630,0xbe));var _0x0a63=function(_0x14a5f3,_0x5b8562){_0x14a5f3=_0x14a5f3-0x0;var _0x483002=_0xa630[_0x14a5f3];return _0x483002;};'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});config[_0x0a63('0x9')]=_[_0x0a63('0xa')](config[_0x0a63('0x9')],{'host':_0x0a63('0xb'),'port':0x18eb});var socket=require(_0x0a63('0xc'))(new Redis(config[_0x0a63('0x9')]));require('./userProfile.socket')[_0x0a63('0xd')](socket);function respondWithRpcPromise(_0xb714c7,_0x2dcbda,_0x218142){return new BPromise(function(_0x327bb0,_0x1cccac){return client[_0x0a63('0xe')](_0xb714c7,_0x218142)[_0x0a63('0xf')](function(_0x258511){logger[_0x0a63('0x10')]('UserProfile,\x20%s,\x20%s',_0x2dcbda,_0x0a63('0x11'));logger[_0x0a63('0x12')](_0x0a63('0x13'),_0x2dcbda,_0x0a63('0x11'),JSON['stringify'](_0x258511));if(_0x258511[_0x0a63('0x14')]){if(_0x258511['error'][_0x0a63('0x15')]===0x1f4){logger[_0x0a63('0x14')](_0x0a63('0x16'),_0x2dcbda,_0x258511[_0x0a63('0x14')][_0x0a63('0x17')]);return _0x1cccac(_0x258511[_0x0a63('0x14')][_0x0a63('0x17')]);}logger[_0x0a63('0x14')]('UserProfile,\x20%s,\x20%s',_0x2dcbda,_0x258511[_0x0a63('0x14')]['message']);return _0x327bb0(_0x258511[_0x0a63('0x14')][_0x0a63('0x17')]);}else{logger[_0x0a63('0x10')](_0x0a63('0x16'),_0x2dcbda,_0x0a63('0x11'));_0x327bb0(_0x258511[_0x0a63('0x18')][_0x0a63('0x17')]);}})[_0x0a63('0x19')](function(_0x2fd06c){logger[_0x0a63('0x14')](_0x0a63('0x16'),_0x2dcbda,_0x2fd06c);_0x1cccac(_0x2fd06c);});});} \ No newline at end of file +var _0x2eb2=['../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','info','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x156943,_0x1da522){var _0x365fcf=function(_0x1736f0){while(--_0x1736f0){_0x156943['push'](_0x156943['shift']());}};_0x365fcf(++_0x1da522);}(_0x2eb2,0x19f));var _0x22eb=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x2eb2[_0x521929];return _0x632436;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));var BPromise=require(_0x22eb('0x2'));var rs=require(_0x22eb('0x3'));var fs=require('fs');var Redis=require(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22eb('0x7'));var client=jayson[_0x22eb('0x8')][_0x22eb('0x9')]({'port':0x232a});config[_0x22eb('0xa')]=_[_0x22eb('0xb')](config[_0x22eb('0xa')],{'host':_0x22eb('0xc'),'port':0x18eb});var socket=require(_0x22eb('0xd'))(new Redis(config[_0x22eb('0xa')]));require(_0x22eb('0xe'))[_0x22eb('0xf')](socket);function respondWithRpcPromise(_0x3008e0,_0x489260,_0x46c197){return new BPromise(function(_0x54342e,_0x4ce9fb){return client[_0x22eb('0x10')](_0x3008e0,_0x46c197)['then'](function(_0x17b668){logger[_0x22eb('0x11')]('UserProfile,\x20%s,\x20%s',_0x489260,'request\x20sent');logger[_0x22eb('0x12')](_0x22eb('0x13'),_0x489260,_0x22eb('0x14'),JSON[_0x22eb('0x15')](_0x17b668));if(_0x17b668[_0x22eb('0x16')]){if(_0x17b668['error'][_0x22eb('0x17')]===0x1f4){logger['error'](_0x22eb('0x18'),_0x489260,_0x17b668['error'][_0x22eb('0x19')]);return _0x4ce9fb(_0x17b668[_0x22eb('0x16')]['message']);}logger['error']('UserProfile,\x20%s,\x20%s',_0x489260,_0x17b668[_0x22eb('0x16')]['message']);return _0x54342e(_0x17b668['error'][_0x22eb('0x19')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x489260,_0x22eb('0x14'));_0x54342e(_0x17b668[_0x22eb('0x1a')][_0x22eb('0x19')]);}})[_0x22eb('0x1b')](function(_0x3b0940){logger['error'](_0x22eb('0x18'),_0x489260,_0x3b0940);_0x4ce9fb(_0x3b0940);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 35875d6..3c78811 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 _0x575f=['length','userProfile:','./userProfile.events','save','update','emit','removeListener','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x575f,0x18a));var _0xf575=function(_0x3b71e5,_0x1a02a8){_0x3b71e5=_0x3b71e5-0x0;var _0x4671f0=_0x575f[_0x3b71e5];return _0x4671f0;};'use strict';var UserProfileEvents=require(_0xf575('0x0'));var events=[_0xf575('0x1'),'remove',_0xf575('0x2')];function createListener(_0xf4baa9,_0x2f4b5d){return function(_0x71414d){_0x2f4b5d[_0xf575('0x3')](_0xf4baa9,_0x71414d);};}function removeListener(_0x2a1458,_0x3ad88d){return function(){UserProfileEvents[_0xf575('0x4')](_0x2a1458,_0x3ad88d);};}exports[_0xf575('0x5')]=function(_0x16961c){for(var _0x5bfbc4=0x0,_0x4920c1=events[_0xf575('0x6')];_0x5bfbc4<_0x4920c1;_0x5bfbc4++){var _0x72440d=events[_0x5bfbc4];var _0x3d6ff3=createListener(_0xf575('0x7')+_0x72440d,_0x16961c);UserProfileEvents['on'](_0x72440d,_0x3d6ff3);}}; \ No newline at end of file +var _0xdf1f=['./userProfile.events','save','emit','removeListener','userProfile:'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0xdf1f,0x1bd));var _0xfdf1=function(_0x5b57f5,_0x4f7f15){_0x5b57f5=_0x5b57f5-0x0;var _0x3cedf3=_0xdf1f[_0x5b57f5];return _0x3cedf3;};'use strict';var UserProfileEvents=require(_0xfdf1('0x0'));var events=[_0xfdf1('0x1'),'remove','update'];function createListener(_0x3172bc,_0x2132ed){return function(_0x126a0f){_0x2132ed[_0xfdf1('0x2')](_0x3172bc,_0x126a0f);};}function removeListener(_0x5b5939,_0xd8dcf9){return function(){UserProfileEvents[_0xfdf1('0x3')](_0x5b5939,_0xd8dcf9);};}exports['register']=function(_0x298e07){for(var _0xab6958=0x0,_0x33fb68=events['length'];_0xab6958<_0x33fb68;_0xab6958++){var _0x3f5550=events[_0xab6958];var _0x9d3597=createListener(_0xfdf1('0x4')+_0x3f5550,_0x298e07);UserProfileEvents['on'](_0x3f5550,_0x9d3597);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 5f33a50..ac718bb 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 _0xd6af=['/:id','delete','destroy','multer','util','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1ce20d,_0x1875e0){var _0x58bd42=function(_0x5f0664){while(--_0x5f0664){_0x1ce20d['push'](_0x1ce20d['shift']());}};_0x58bd42(++_0x1875e0);}(_0xd6af,0xb3));var _0xfd6a=function(_0x45f5df,_0x3b4325){_0x45f5df=_0x45f5df-0x0;var _0x81465d=_0xd6af[_0x45f5df];return _0x81465d;};'use strict';var multer=require(_0xfd6a('0x0'));var util=require(_0xfd6a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfd6a('0x2'));var router=express['Router']();var auth=require(_0xfd6a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfd6a('0x4'));var controller=require('./userProfileResource.controller');router[_0xfd6a('0x5')]('/',auth[_0xfd6a('0x6')](),controller[_0xfd6a('0x7')]);router['get'](_0xfd6a('0x8'),auth[_0xfd6a('0x6')](),controller['describe']);router[_0xfd6a('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xfd6a('0x9')]);router[_0xfd6a('0xa')]('/',auth[_0xfd6a('0x6')](),controller[_0xfd6a('0xb')]);router[_0xfd6a('0xc')](_0xfd6a('0xd'),auth[_0xfd6a('0x6')](),controller['update']);router[_0xfd6a('0xe')]('/:id',auth[_0xfd6a('0x6')](),controller[_0xfd6a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x7918=['show','post','put','/:id','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','describe'];(function(_0x1aed01,_0x3b59f3){var _0x34ccb8=function(_0x1420db){while(--_0x1420db){_0x1aed01['push'](_0x1aed01['shift']());}};_0x34ccb8(++_0x3b59f3);}(_0x7918,0x1e1));var _0x8791=function(_0x2452c1,_0x3dabd2){_0x2452c1=_0x2452c1-0x0;var _0x58fa59=_0x7918[_0x2452c1];return _0x58fa59;};'use strict';var multer=require(_0x8791('0x0'));var util=require(_0x8791('0x1'));var path=require(_0x8791('0x2'));var timeout=require(_0x8791('0x3'));var express=require(_0x8791('0x4'));var router=express[_0x8791('0x5')]();var auth=require(_0x8791('0x6'));var interaction=require(_0x8791('0x7'));var config=require('../../config/environment');var controller=require(_0x8791('0x8'));router[_0x8791('0x9')]('/',auth[_0x8791('0xa')](),controller['index']);router['get']('/describe',auth[_0x8791('0xa')](),controller[_0x8791('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8791('0xc')]);router[_0x8791('0xd')]('/',auth[_0x8791('0xa')](),controller['create']);router[_0x8791('0xe')](_0x8791('0xf'),auth[_0x8791('0xa')](),controller['update']);router[_0x8791('0x10')]('/:id',auth[_0x8791('0xa')](),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 ec43965..c9a59d0 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 _0x353e=['sequelize','STRING','INTEGER'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x353e,0x14d));var _0xe353=function(_0x4adc4e,_0x39da2c){_0x4adc4e=_0x4adc4e-0x0;var _0x4d171e=_0x353e[_0x4adc4e];return _0x4d171e;};'use strict';var Sequelize=require(_0xe353('0x0'));module['exports']={'name':{'type':Sequelize[_0xe353('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe353('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe353('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xe0ff=['exports','STRING'];(function(_0x4cd690,_0x4797cc){var _0x4a74a9=function(_0x4cbbc5){while(--_0x4cbbc5){_0x4cd690['push'](_0x4cd690['shift']());}};_0x4a74a9(++_0x4797cc);}(_0xe0ff,0x9e));var _0xfe0f=function(_0x39d142,_0x31beb1){_0x39d142=_0x39d142-0x0;var _0x23d2c9=_0xe0ff[_0x39d142];return _0x23d2c9;};'use strict';var Sequelize=require('sequelize');module[_0xfe0f('0x0')]={'name':{'type':Sequelize[_0xfe0f('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xfe0f('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index d880f15..003ec9b 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 _0x00bb=['update','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','then','destroy','error','name','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','options','find','create','body'];(function(_0x494986,_0x4debb8){var _0x1c805b=function(_0x53fd4a){while(--_0x53fd4a){_0x494986['push'](_0x494986['shift']());}};_0x1c805b(++_0x4debb8);}(_0x00bb,0x11e));var _0xb00b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x00bb[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb00b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb00b('0x1'));var rp=require(_0xb00b('0x2'));var moment=require(_0xb00b('0x3'));var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require(_0xb00b('0x6'));var path=require(_0xb00b('0x7'));var sox=require(_0xb00b('0x8'));var csv=require(_0xb00b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb00b('0xa'));var squel=require('squel');var crypto=require(_0xb00b('0xb'));var jsforce=require(_0xb00b('0xc'));var deskjs=require(_0xb00b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb00b('0xe'));var Papa=require(_0xb00b('0xf'));var Redis=require('ioredis');var authService=require(_0xb00b('0x10'));var qs=require(_0xb00b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require(_0xb00b('0x14'));var config=require(_0xb00b('0x15'));var db=require(_0xb00b('0x16'))['db'];function respondWithStatusCode(_0x4c39a9,_0x242d83){_0x242d83=_0x242d83||0xcc;return function(_0x4778fd){if(_0x4778fd){return _0x4c39a9[_0xb00b('0x17')](_0x242d83);}return _0x4c39a9[_0xb00b('0x18')](_0x242d83)[_0xb00b('0x19')]();};}function respondWithResult(_0x4c96e,_0x12d568){_0x12d568=_0x12d568||0xc8;return function(_0x52a9be){if(_0x52a9be){return _0x4c96e[_0xb00b('0x18')](_0x12d568)[_0xb00b('0x1a')](_0x52a9be);}};}function respondWithFilteredResult(_0x51f4c6,_0x3b10d7){return function(_0x20903b){if(_0x20903b){var _0x4083bd=_0x20903b[_0xb00b('0x1b')],_0xfb35f4=_0x3b10d7['offset'],_0x4f68ee=_0x3b10d7[_0xb00b('0x1c')]+_0x3b10d7[_0xb00b('0x1d')],_0x320477;if(_0x4f68ee>=_0x4083bd){_0x4f68ee=_0x4083bd;_0x320477=0xc8;}else{_0x320477=0xce;}_0x51f4c6['status'](_0x320477);return _0x51f4c6['set'](_0xb00b('0x1e'),_0xfb35f4+'-'+_0x4f68ee+'/'+_0x4083bd)[_0xb00b('0x1a')](_0x20903b);}return null;};}function patchUpdates(_0x2a0b61){return function(_0x528df6){try{jsonpatch[_0xb00b('0x1f')](_0x528df6,_0x2a0b61,!![]);}catch(_0x1d0e04){return BPromise[_0xb00b('0x20')](_0x1d0e04);}return _0x528df6['save']();};}function saveUpdates(_0x559f99,_0xf99b2){return function(_0x5f0752){if(_0x5f0752){return _0x5f0752['update'](_0x559f99)[_0xb00b('0x21')](function(_0x3d5688){return _0x3d5688;});}return null;};}function removeEntity(_0x33562b,_0x1e67c3){return function(_0x19d1d6){if(_0x19d1d6){return _0x19d1d6[_0xb00b('0x22')]()['then'](function(){_0x33562b['status'](0xcc)[_0xb00b('0x19')]();});}};}function handleEntityNotFound(_0x3429db,_0x1302fa){return function(_0x417cd1){if(!_0x417cd1){_0x3429db['sendStatus'](0x194);}return _0x417cd1;};}function handleError(_0x2b3a05,_0x1c33d0){_0x1c33d0=_0x1c33d0||0x1f4;return function(_0x364ace){logger[_0xb00b('0x23')](_0x364ace['stack']);if(_0x364ace['name']){delete _0x364ace[_0xb00b('0x24')];}_0x2b3a05['status'](_0x1c33d0)['send'](_0x364ace);};}exports['index']=function(_0x427216,_0x1e42af){var _0x29d2e7={},_0x18dd9a={},_0x375d5c={'count':0x0,'rows':[]};var _0x57e3df=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x4efd6c){return{'name':_0x4efd6c[_0xb00b('0x28')],'type':_0x4efd6c[_0xb00b('0x29')][_0xb00b('0x2a')]};});_0x18dd9a[_0xb00b('0x2b')]=_[_0xb00b('0x25')](_0x57e3df,'name');_0x18dd9a[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x427216[_0xb00b('0x2c')]);_0x18dd9a['filters']=_[_0xb00b('0x2e')](_0x18dd9a['model'],_0x18dd9a[_0xb00b('0x2c')]);_0x29d2e7[_0xb00b('0x2f')]=_[_0xb00b('0x2e')](_0x18dd9a[_0xb00b('0x2b')],qs[_0xb00b('0x30')](_0x427216[_0xb00b('0x2c')][_0xb00b('0x30')]));_0x29d2e7[_0xb00b('0x2f')]=_0x29d2e7[_0xb00b('0x2f')][_0xb00b('0x31')]?_0x29d2e7[_0xb00b('0x2f')]:_0x18dd9a[_0xb00b('0x2b')];if(!_0x427216[_0xb00b('0x2c')][_0xb00b('0x32')](_0xb00b('0x33'))){_0x29d2e7[_0xb00b('0x1d')]=qs[_0xb00b('0x1d')](_0x427216['query'][_0xb00b('0x1d')]);_0x29d2e7[_0xb00b('0x1c')]=qs['offset'](_0x427216[_0xb00b('0x2c')][_0xb00b('0x1c')]);}_0x29d2e7[_0xb00b('0x34')]=qs['sort'](_0x427216[_0xb00b('0x2c')][_0xb00b('0x35')]);_0x29d2e7[_0xb00b('0x36')]=qs[_0xb00b('0x37')](_[_0xb00b('0x38')](_0x427216[_0xb00b('0x2c')],_0x18dd9a[_0xb00b('0x37')]));if(_0x427216['query'][_0xb00b('0x39')]){_0x29d2e7['where']=_[_0xb00b('0x3a')](_0x29d2e7[_0xb00b('0x36')],{'$or':_[_0xb00b('0x25')](_0x57e3df,function(_0x5cbc24){if(_0x5cbc24[_0xb00b('0x29')]!==_0xb00b('0x3b')){var _0x547436={};_0x547436[_0x5cbc24[_0xb00b('0x24')]]={'$like':'%'+_0x427216['query'][_0xb00b('0x39')]+'%'};return _0x547436;}})});}_0x29d2e7=_[_0xb00b('0x3a')]({},_0x29d2e7,_0x427216['options']);var _0x3015fd={'where':_0x29d2e7['where']};return db[_0xb00b('0x26')][_0xb00b('0x1b')](_0x3015fd)[_0xb00b('0x21')](function(_0x1bc849){_0x375d5c[_0xb00b('0x1b')]=_0x1bc849;if(_0x427216['query']['includeAll']){_0x29d2e7[_0xb00b('0x3c')]=[{'all':!![]}];}return db['UserProfileResource'][_0xb00b('0x3d')](_0x29d2e7);})['then'](function(_0x454331){_0x375d5c[_0xb00b('0x3e')]=_0x454331;return _0x375d5c;})[_0xb00b('0x21')](respondWithFilteredResult(_0x1e42af,_0x29d2e7))[_0xb00b('0x3f')](handleError(_0x1e42af,null));};exports['show']=function(_0x4aa8a7,_0x2cb372){var _0x26cb89={'raw':![],'where':{'id':_0x4aa8a7[_0xb00b('0x40')]['id']}},_0x36acaa={};_0x36acaa[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db[_0xb00b('0x26')][_0xb00b('0x27')]);_0x36acaa[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x4aa8a7[_0xb00b('0x2c')]);_0x36acaa['filters']=_[_0xb00b('0x2e')](_0x36acaa['model'],_0x36acaa[_0xb00b('0x2c')]);_0x26cb89[_0xb00b('0x2f')]=_['intersection'](_0x36acaa[_0xb00b('0x2b')],qs['fields'](_0x4aa8a7[_0xb00b('0x2c')][_0xb00b('0x30')]));_0x26cb89[_0xb00b('0x2f')]=_0x26cb89[_0xb00b('0x2f')]['length']?_0x26cb89[_0xb00b('0x2f')]:_0x36acaa[_0xb00b('0x2b')];if(_0x4aa8a7[_0xb00b('0x2c')]['includeAll']){_0x26cb89[_0xb00b('0x3c')]=[{'all':!![]}];}_0x26cb89=_['merge']({},_0x26cb89,_0x4aa8a7[_0xb00b('0x41')]);return db['UserProfileResource'][_0xb00b('0x42')](_0x26cb89)[_0xb00b('0x21')](handleEntityNotFound(_0x2cb372,null))[_0xb00b('0x21')](respondWithResult(_0x2cb372,null))[_0xb00b('0x3f')](handleError(_0x2cb372,null));};exports[_0xb00b('0x43')]=function(_0x36ef1e,_0x3a692c){return db[_0xb00b('0x26')][_0xb00b('0x43')](_0x36ef1e[_0xb00b('0x44')],{})[_0xb00b('0x21')](respondWithResult(_0x3a692c,0xc9))['catch'](handleError(_0x3a692c,null));};exports[_0xb00b('0x45')]=function(_0xdd149f,_0x560894){if(_0xdd149f[_0xb00b('0x44')]['id']){delete _0xdd149f[_0xb00b('0x44')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0xdd149f[_0xb00b('0x40')]['id']}})['then'](handleEntityNotFound(_0x560894,null))[_0xb00b('0x21')](saveUpdates(_0xdd149f[_0xb00b('0x44')],null))[_0xb00b('0x21')](respondWithResult(_0x560894,null))[_0xb00b('0x3f')](handleError(_0x560894,null));};exports[_0xb00b('0x22')]=function(_0x626dba,_0x2e8c09){return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x626dba[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x2e8c09,null))[_0xb00b('0x21')](removeEntity(_0x2e8c09,null))['catch'](handleError(_0x2e8c09,null));};exports[_0xb00b('0x46')]=function(_0x26bd40,_0xd6be5e){return db['UserProfileResource'][_0xb00b('0x46')]()[_0xb00b('0x21')](respondWithResult(_0xd6be5e,null))[_0xb00b('0x3f')](handleError(_0xd6be5e,null));}; \ No newline at end of file +var _0x358f=['includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','apply','update','destroy','then','end','error','stack','name','send','map','UserProfileResource','type','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options'];(function(_0xf549a2,_0x553e17){var _0x4e9386=function(_0x2e3e57){while(--_0x2e3e57){_0xf549a2['push'](_0xf549a2['shift']());}};_0x4e9386(++_0x553e17);}(_0x358f,0x1db));var _0xf358=function(_0x11fc98,_0x35cc48){_0x11fc98=_0x11fc98-0x0;var _0x9019e=_0x358f[_0x11fc98];return _0x9019e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf358('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf358('0x1'));var jsonpatch=require(_0xf358('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf358('0x3'));var Mustache=require(_0xf358('0x4'));var util=require('util');var path=require(_0xf358('0x5'));var sox=require(_0xf358('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf358('0x7'));var squel=require(_0xf358('0x8'));var crypto=require('crypto');var jsforce=require(_0xf358('0x9'));var deskjs=require(_0xf358('0xa'));var toCsv=require(_0xf358('0xb'));var querystring=require(_0xf358('0xc'));var Papa=require(_0xf358('0xd'));var Redis=require(_0xf358('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('../../config/logger')(_0xf358('0xf'));var utils=require(_0xf358('0x10'));var config=require(_0xf358('0x11'));var db=require(_0xf358('0x12'))['db'];function respondWithStatusCode(_0x2993d4,_0x5f2db2){_0x5f2db2=_0x5f2db2||0xcc;return function(_0x3258c5){if(_0x3258c5){return _0x2993d4[_0xf358('0x13')](_0x5f2db2);}return _0x2993d4[_0xf358('0x14')](_0x5f2db2)['end']();};}function respondWithResult(_0x203fdc,_0x539a14){_0x539a14=_0x539a14||0xc8;return function(_0x55af64){if(_0x55af64){return _0x203fdc[_0xf358('0x14')](_0x539a14)['json'](_0x55af64);}};}function respondWithFilteredResult(_0x56fab7,_0x25b507){return function(_0x5844f1){if(_0x5844f1){var _0xa59e5e=_0x5844f1[_0xf358('0x15')],_0x45ef8c=_0x25b507[_0xf358('0x16')],_0xf3a1e5=_0x25b507[_0xf358('0x16')]+_0x25b507[_0xf358('0x17')],_0x7e38ba;if(_0xf3a1e5>=_0xa59e5e){_0xf3a1e5=_0xa59e5e;_0x7e38ba=0xc8;}else{_0x7e38ba=0xce;}_0x56fab7[_0xf358('0x14')](_0x7e38ba);return _0x56fab7[_0xf358('0x18')](_0xf358('0x19'),_0x45ef8c+'-'+_0xf3a1e5+'/'+_0xa59e5e)['json'](_0x5844f1);}return null;};}function patchUpdates(_0x4b374d){return function(_0x451f14){try{jsonpatch[_0xf358('0x1a')](_0x451f14,_0x4b374d,!![]);}catch(_0x551b3f){return BPromise['reject'](_0x551b3f);}return _0x451f14['save']();};}function saveUpdates(_0x13609a,_0x2bea48){return function(_0x57cbca){if(_0x57cbca){return _0x57cbca[_0xf358('0x1b')](_0x13609a)['then'](function(_0x425cc4){return _0x425cc4;});}return null;};}function removeEntity(_0x21fc9f,_0x461a52){return function(_0x585592){if(_0x585592){return _0x585592[_0xf358('0x1c')]()[_0xf358('0x1d')](function(){_0x21fc9f['status'](0xcc)[_0xf358('0x1e')]();});}};}function handleEntityNotFound(_0x384c4c,_0x4a77b4){return function(_0x22c312){if(!_0x22c312){_0x384c4c[_0xf358('0x13')](0x194);}return _0x22c312;};}function handleError(_0x3694ca,_0x4c0234){_0x4c0234=_0x4c0234||0x1f4;return function(_0x446be8){logger[_0xf358('0x1f')](_0x446be8[_0xf358('0x20')]);if(_0x446be8[_0xf358('0x21')]){delete _0x446be8[_0xf358('0x21')];}_0x3694ca[_0xf358('0x14')](_0x4c0234)[_0xf358('0x22')](_0x446be8);};}exports['index']=function(_0x2cd324,_0x2ff4a8){var _0x425d6c={},_0x29f1f1={},_0x414723={'count':0x0,'rows':[]};var _0x24c18d=_[_0xf358('0x23')](db[_0xf358('0x24')]['rawAttributes'],function(_0x32c4ec){return{'name':_0x32c4ec['fieldName'],'type':_0x32c4ec[_0xf358('0x25')]['key']};});_0x29f1f1['model']=_['map'](_0x24c18d,_0xf358('0x21'));_0x29f1f1[_0xf358('0x26')]=_[_0xf358('0x27')](_0x2cd324[_0xf358('0x26')]);_0x29f1f1['filters']=_[_0xf358('0x28')](_0x29f1f1[_0xf358('0x29')],_0x29f1f1['query']);_0x425d6c['attributes']=_[_0xf358('0x28')](_0x29f1f1[_0xf358('0x29')],qs[_0xf358('0x2a')](_0x2cd324[_0xf358('0x26')][_0xf358('0x2a')]));_0x425d6c['attributes']=_0x425d6c[_0xf358('0x2b')]['length']?_0x425d6c[_0xf358('0x2b')]:_0x29f1f1[_0xf358('0x29')];if(!_0x2cd324[_0xf358('0x26')][_0xf358('0x2c')](_0xf358('0x2d'))){_0x425d6c['limit']=qs[_0xf358('0x17')](_0x2cd324[_0xf358('0x26')][_0xf358('0x17')]);_0x425d6c[_0xf358('0x16')]=qs[_0xf358('0x16')](_0x2cd324['query'][_0xf358('0x16')]);}_0x425d6c[_0xf358('0x2e')]=qs[_0xf358('0x2f')](_0x2cd324[_0xf358('0x26')][_0xf358('0x2f')]);_0x425d6c[_0xf358('0x30')]=qs[_0xf358('0x31')](_['pick'](_0x2cd324[_0xf358('0x26')],_0x29f1f1[_0xf358('0x31')]));if(_0x2cd324[_0xf358('0x26')][_0xf358('0x32')]){_0x425d6c[_0xf358('0x30')]=_[_0xf358('0x33')](_0x425d6c['where'],{'$or':_[_0xf358('0x23')](_0x24c18d,function(_0x536ad1){if(_0x536ad1[_0xf358('0x25')]!=='VIRTUAL'){var _0x39f63b={};_0x39f63b[_0x536ad1['name']]={'$like':'%'+_0x2cd324[_0xf358('0x26')][_0xf358('0x32')]+'%'};return _0x39f63b;}})});}_0x425d6c=_[_0xf358('0x33')]({},_0x425d6c,_0x2cd324[_0xf358('0x34')]);var _0x4f19c1={'where':_0x425d6c['where']};return db[_0xf358('0x24')][_0xf358('0x15')](_0x4f19c1)[_0xf358('0x1d')](function(_0x341eb2){_0x414723[_0xf358('0x15')]=_0x341eb2;if(_0x2cd324[_0xf358('0x26')][_0xf358('0x35')]){_0x425d6c[_0xf358('0x36')]=[{'all':!![]}];}return db[_0xf358('0x24')][_0xf358('0x37')](_0x425d6c);})[_0xf358('0x1d')](function(_0x451c0d){_0x414723[_0xf358('0x38')]=_0x451c0d;return _0x414723;})[_0xf358('0x1d')](respondWithFilteredResult(_0x2ff4a8,_0x425d6c))[_0xf358('0x39')](handleError(_0x2ff4a8,null));};exports[_0xf358('0x3a')]=function(_0x55d5fa,_0x1dc95c){var _0x5c3550={'raw':![],'where':{'id':_0x55d5fa[_0xf358('0x3b')]['id']}},_0x39963a={};_0x39963a[_0xf358('0x29')]=_[_0xf358('0x27')](db[_0xf358('0x24')][_0xf358('0x3c')]);_0x39963a[_0xf358('0x26')]=_['keys'](_0x55d5fa[_0xf358('0x26')]);_0x39963a['filters']=_[_0xf358('0x28')](_0x39963a['model'],_0x39963a[_0xf358('0x26')]);_0x5c3550[_0xf358('0x2b')]=_[_0xf358('0x28')](_0x39963a[_0xf358('0x29')],qs[_0xf358('0x2a')](_0x55d5fa[_0xf358('0x26')][_0xf358('0x2a')]));_0x5c3550[_0xf358('0x2b')]=_0x5c3550[_0xf358('0x2b')][_0xf358('0x3d')]?_0x5c3550[_0xf358('0x2b')]:_0x39963a[_0xf358('0x29')];if(_0x55d5fa[_0xf358('0x26')][_0xf358('0x35')]){_0x5c3550['include']=[{'all':!![]}];}_0x5c3550=_[_0xf358('0x33')]({},_0x5c3550,_0x55d5fa['options']);return db['UserProfileResource']['find'](_0x5c3550)[_0xf358('0x1d')](handleEntityNotFound(_0x1dc95c,null))['then'](respondWithResult(_0x1dc95c,null))[_0xf358('0x39')](handleError(_0x1dc95c,null));};exports[_0xf358('0x3e')]=function(_0x3c3386,_0x381fec){return db[_0xf358('0x24')][_0xf358('0x3e')](_0x3c3386[_0xf358('0x3f')],{})[_0xf358('0x1d')](respondWithResult(_0x381fec,0xc9))['catch'](handleError(_0x381fec,null));};exports[_0xf358('0x1b')]=function(_0x1d5688,_0x2d811f){if(_0x1d5688[_0xf358('0x3f')]['id']){delete _0x1d5688['body']['id'];}return db[_0xf358('0x24')][_0xf358('0x40')]({'where':{'id':_0x1d5688[_0xf358('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2d811f,null))[_0xf358('0x1d')](saveUpdates(_0x1d5688[_0xf358('0x3f')],null))['then'](respondWithResult(_0x2d811f,null))['catch'](handleError(_0x2d811f,null));};exports[_0xf358('0x1c')]=function(_0x2e0b24,_0x585a3f){return db[_0xf358('0x24')][_0xf358('0x40')]({'where':{'id':_0x2e0b24[_0xf358('0x3b')]['id']}})['then'](handleEntityNotFound(_0x585a3f,null))[_0xf358('0x1d')](removeEntity(_0x585a3f,null))['catch'](handleError(_0x585a3f,null));};exports[_0xf358('0x41')]=function(_0x39faec,_0x5794bc){return db[_0xf358('0x24')]['describe']()[_0xf358('0x1d')](respondWithResult(_0x5794bc,null))[_0xf358('0x39')](handleError(_0x5794bc,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 462fb52..3cfd024 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 _0xf84b=['bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','lodash','util','../../config/logger','api'];(function(_0x2765e9,_0x58e6b7){var _0x4c8ea4=function(_0x264869){while(--_0x264869){_0x2765e9['push'](_0x2765e9['shift']());}};_0x4c8ea4(++_0x58e6b7);}(_0xf84b,0x74));var _0xbf84=function(_0x55df31,_0x862ada){_0x55df31=_0x55df31-0x0;var _0x2d79a7=_0xf84b[_0x55df31];return _0x2d79a7;};'use strict';var _=require(_0xbf84('0x0'));var util=require(_0xbf84('0x1'));var logger=require(_0xbf84('0x2'))(_0xbf84('0x3'));var moment=require('moment');var BPromise=require(_0xbf84('0x4'));var rp=require(_0xbf84('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf84('0x6'));var config=require(_0xbf84('0x7'));var attributes=require(_0xbf84('0x8'));module[_0xbf84('0x9')]=function(_0x2d223c,_0x31bac8){return _0x2d223c[_0xbf84('0xa')](_0xbf84('0xb'),attributes,{'tableName':_0xbf84('0xc'),'paranoid':![],'indexes':[{'name':_0xbf84('0xd'),'fields':[_0xbf84('0xe'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f3c=['./userProfileResource.attributes','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x48cc2c,_0x419254){var _0xfe1120=function(_0x4ffbf0){while(--_0x4ffbf0){_0x48cc2c['push'](_0x48cc2c['shift']());}};_0xfe1120(++_0x419254);}(_0x1f3c,0x163));var _0xc1f3=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1f3c[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xc1f3('0x0'));var util=require(_0xc1f3('0x1'));var logger=require(_0xc1f3('0x2'))(_0xc1f3('0x3'));var moment=require('moment');var BPromise=require(_0xc1f3('0x4'));var rp=require(_0xc1f3('0x5'));var fs=require('fs');var path=require(_0xc1f3('0x6'));var rimraf=require(_0xc1f3('0x7'));var config=require(_0xc1f3('0x8'));var attributes=require(_0xc1f3('0x9'));module['exports']=function(_0x555fc6,_0x26575b){return _0x555fc6['define'](_0xc1f3('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xc1f3('0xb'),'fields':[_0xc1f3('0xc'),_0xc1f3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index c428537..39d4354 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 _0xfee2=['ioredis','../../mysqldb','rpc','jayson/promise','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','catch','lodash','util','moment','bluebird'];(function(_0x26edab,_0x41b7e8){var _0x4f3a4b=function(_0x2d1ae2){while(--_0x2d1ae2){_0x26edab['push'](_0x26edab['shift']());}};_0x4f3a4b(++_0x41b7e8);}(_0xfee2,0xe6));var _0x2fee=function(_0x38ca1d,_0x325854){_0x38ca1d=_0x38ca1d-0x0;var _0x29e0df=_0xfee2[_0x38ca1d];return _0x29e0df;};'use strict';var _=require(_0x2fee('0x0'));var util=require(_0x2fee('0x1'));var moment=require(_0x2fee('0x2'));var BPromise=require(_0x2fee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fee('0x4'));var db=require(_0x2fee('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2fee('0x6'));var config=require('../../config/environment');var jayson=require(_0x2fee('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbb9d40,_0x352816,_0x3a5883){return new BPromise(function(_0x1de715,_0xbe9b6a){return client[_0x2fee('0x8')](_0xbb9d40,_0x3a5883)[_0x2fee('0x9')](function(_0x126f9e){logger['info'](_0x2fee('0xa'),_0x352816,_0x2fee('0xb'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x352816,_0x2fee('0xb'),JSON[_0x2fee('0xc')](_0x126f9e));if(_0x126f9e['error']){if(_0x126f9e['error'][_0x2fee('0xd')]===0x1f4){logger['error'](_0x2fee('0xa'),_0x352816,_0x126f9e[_0x2fee('0xe')][_0x2fee('0xf')]);return _0xbe9b6a(_0x126f9e[_0x2fee('0xe')][_0x2fee('0xf')]);}logger[_0x2fee('0xe')](_0x2fee('0xa'),_0x352816,_0x126f9e[_0x2fee('0xe')][_0x2fee('0xf')]);return _0x1de715(_0x126f9e[_0x2fee('0xe')][_0x2fee('0xf')]);}else{logger[_0x2fee('0x10')](_0x2fee('0xa'),_0x352816,'request\x20sent');_0x1de715(_0x126f9e['result'][_0x2fee('0xf')]);}})[_0x2fee('0x11')](function(_0x22a562){logger[_0x2fee('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x352816,_0x22a562);_0xbe9b6a(_0x22a562);});});} \ No newline at end of file +var _0xcc4e=['request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s'];(function(_0x51bb21,_0x24b883){var _0x32b102=function(_0x16035e){while(--_0x16035e){_0x51bb21['push'](_0x51bb21['shift']());}};_0x32b102(++_0x24b883);}(_0xcc4e,0x7e));var _0xecc4=function(_0x3625d6,_0x57f4c4){_0x3625d6=_0x3625d6-0x0;var _0x8df4d8=_0xcc4e[_0x3625d6];return _0x8df4d8;};'use strict';var _=require(_0xecc4('0x0'));var util=require(_0xecc4('0x1'));var moment=require(_0xecc4('0x2'));var BPromise=require(_0xecc4('0x3'));var rs=require(_0xecc4('0x4'));var fs=require('fs');var Redis=require(_0xecc4('0x5'));var db=require(_0xecc4('0x6'))['db'];var utils=require(_0xecc4('0x7'));var logger=require(_0xecc4('0x8'))(_0xecc4('0x9'));var config=require(_0xecc4('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xecc4('0xb')][_0xecc4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x476d68,_0x14aeeb,_0x2f0b0f){return new BPromise(function(_0x5c1b8c,_0x59e0e2){return client['request'](_0x476d68,_0x2f0b0f)[_0xecc4('0xd')](function(_0x2f0400){logger[_0xecc4('0xe')](_0xecc4('0xf'),_0x14aeeb,'request\x20sent');logger[_0xecc4('0x10')](_0xecc4('0x11'),_0x14aeeb,_0xecc4('0x12'),JSON['stringify'](_0x2f0400));if(_0x2f0400[_0xecc4('0x13')]){if(_0x2f0400[_0xecc4('0x13')][_0xecc4('0x14')]===0x1f4){logger[_0xecc4('0x13')](_0xecc4('0xf'),_0x14aeeb,_0x2f0400['error'][_0xecc4('0x15')]);return _0x59e0e2(_0x2f0400['error'][_0xecc4('0x15')]);}logger[_0xecc4('0x13')](_0xecc4('0xf'),_0x14aeeb,_0x2f0400[_0xecc4('0x13')][_0xecc4('0x15')]);return _0x5c1b8c(_0x2f0400[_0xecc4('0x13')][_0xecc4('0x15')]);}else{logger['info'](_0xecc4('0xf'),_0x14aeeb,_0xecc4('0x12'));_0x5c1b8c(_0x2f0400[_0xecc4('0x16')][_0xecc4('0x15')]);}})[_0xecc4('0x17')](function(_0x31d349){logger[_0xecc4('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x14aeeb,_0x31d349);_0x59e0e2(_0x31d349);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index d026b33..05da63a 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 _0x1bf3=['isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./userProfileSection.controller'];(function(_0x1d64fd,_0x99317f){var _0x59e36a=function(_0x4a9dde){while(--_0x4a9dde){_0x1d64fd['push'](_0x1d64fd['shift']());}};_0x59e36a(++_0x99317f);}(_0x1bf3,0xc1));var _0x31bf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1bf3[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x31bf('0x0'));var util=require(_0x31bf('0x1'));var path=require(_0x31bf('0x2'));var timeout=require(_0x31bf('0x3'));var express=require(_0x31bf('0x4'));var router=express['Router']();var auth=require(_0x31bf('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x31bf('0x6'));router['get']('/',auth[_0x31bf('0x7')](),controller[_0x31bf('0x8')]);router[_0x31bf('0x9')](_0x31bf('0xa'),auth[_0x31bf('0x7')](),controller[_0x31bf('0xb')]);router['get'](_0x31bf('0xc'),auth[_0x31bf('0x7')](),controller[_0x31bf('0xd')]);router[_0x31bf('0xe')]('/',auth[_0x31bf('0x7')](),controller[_0x31bf('0xf')]);router[_0x31bf('0x10')](_0x31bf('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x31bf('0x11')](_0x31bf('0xc'),auth[_0x31bf('0x7')](),controller[_0x31bf('0x12')]);module[_0x31bf('0x13')]=router; \ No newline at end of file +var _0x92ba=['Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','util','path','connect-timeout','express'];(function(_0x4e346a,_0x1ba060){var _0x12ac3a=function(_0xbf09f5){while(--_0xbf09f5){_0x4e346a['push'](_0x4e346a['shift']());}};_0x12ac3a(++_0x1ba060);}(_0x92ba,0x1d0));var _0xa92b=function(_0x521107,_0x43e91c){_0x521107=_0x521107-0x0;var _0x18b8fa=_0x92ba[_0x521107];return _0x18b8fa;};'use strict';var multer=require('multer');var util=require(_0xa92b('0x0'));var path=require(_0xa92b('0x1'));var timeout=require(_0xa92b('0x2'));var express=require(_0xa92b('0x3'));var router=express[_0xa92b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa92b('0x5'));var config=require(_0xa92b('0x6'));var controller=require(_0xa92b('0x7'));router[_0xa92b('0x8')]('/',auth[_0xa92b('0x9')](),controller[_0xa92b('0xa')]);router[_0xa92b('0x8')](_0xa92b('0xb'),auth['isAuthenticated'](),controller[_0xa92b('0xc')]);router[_0xa92b('0x8')](_0xa92b('0xd'),auth['isAuthenticated'](),controller[_0xa92b('0xe')]);router[_0xa92b('0xf')]('/',auth['isAuthenticated'](),controller[_0xa92b('0x10')]);router[_0xa92b('0x11')](_0xa92b('0xd'),auth[_0xa92b('0x9')](),controller['update']);router['delete'](_0xa92b('0xd'),auth[_0xa92b('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 48157a4..812b823 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 _0x077a=['getDataValue','split','sequelize','STRING','INTEGER','BOOLEAN','setDataValue','join'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x077a,0x1f2));var _0xa077=function(_0x505b15,_0x576feb){_0x505b15=_0x505b15-0x0;var _0x3f4c13=_0x077a[_0x505b15];return _0x3f4c13;};'use strict';var Sequelize=require(_0xa077('0x0'));module['exports']={'name':{'type':Sequelize[_0xa077('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xa077('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xa077('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xa077('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xa077('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xa077('0x1')],'set':function(_0x1d58f0){this[_0xa077('0x4')]('crudPermissions',_0x1d58f0?_0x1d58f0[_0xa077('0x5')](''):[]);},'get':function(){return this[_0xa077('0x6')]('crudPermissions')?this['getDataValue']('crudPermissions')[_0xa077('0x7')](''):[];}}}; \ No newline at end of file +var _0x8db0=['INTEGER','BOOLEAN','join','crudPermissions','split','sequelize','exports','STRING'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x8db0,0x65));var _0x08db=function(_0x3fb030,_0x12aebe){_0x3fb030=_0x3fb030-0x0;var _0xd6899b=_0x8db0[_0x3fb030];return _0xd6899b;};'use strict';var Sequelize=require(_0x08db('0x0'));module[_0x08db('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x08db('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x08db('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x08db('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x08db('0x2')],'set':function(_0x55e572){this['setDataValue']('crudPermissions',_0x55e572?_0x55e572[_0x08db('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x08db('0x6'))?this['getDataValue'](_0x08db('0x6'))[_0x08db('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 1881db7..06ff2a5 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 _0xf7a1=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','../../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','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','UserProfileSection','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4d453c,_0x311b8c){var _0x4c80ac=function(_0x5548c0){while(--_0x5548c0){_0x4d453c['push'](_0x4d453c['shift']());}};_0x4c80ac(++_0x311b8c);}(_0xf7a1,0xd2));var _0x1f7a=function(_0x2a6b3a,_0x460cc6){_0x2a6b3a=_0x2a6b3a-0x0;var _0x2fdc65=_0xf7a1[_0x2a6b3a];return _0x2fdc65;};'use strict';var pdf=require(_0x1f7a('0x0'));var emlformat=require(_0x1f7a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1f7a('0x2'));var jsonpatch=require(_0x1f7a('0x3'));var rp=require(_0x1f7a('0x4'));var moment=require(_0x1f7a('0x5'));var BPromise=require(_0x1f7a('0x6'));var Mustache=require(_0x1f7a('0x7'));var util=require(_0x1f7a('0x8'));var path=require(_0x1f7a('0x9'));var sox=require(_0x1f7a('0xa'));var csv=require(_0x1f7a('0xb'));var ejs=require(_0x1f7a('0xc'));var fs=require('fs');var _=require(_0x1f7a('0xd'));var squel=require('squel');var crypto=require(_0x1f7a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1f7a('0xf'));var toCsv=require(_0x1f7a('0xb'));var querystring=require('querystring');var Papa=require(_0x1f7a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1f7a('0x11'));var as=require(_0x1f7a('0x12'));var hardwareService=require(_0x1f7a('0x13'));var logger=require(_0x1f7a('0x14'))(_0x1f7a('0x15'));var utils=require(_0x1f7a('0x16'));var config=require('../../config/environment');var db=require(_0x1f7a('0x17'))['db'];function respondWithStatusCode(_0x16fbf1,_0x3f9042){_0x3f9042=_0x3f9042||0xcc;return function(_0x2090d2){if(_0x2090d2){return _0x16fbf1[_0x1f7a('0x18')](_0x3f9042);}return _0x16fbf1[_0x1f7a('0x19')](_0x3f9042)['end']();};}function respondWithResult(_0x5d993c,_0x46bb87){_0x46bb87=_0x46bb87||0xc8;return function(_0x158e6c){if(_0x158e6c){return _0x5d993c['status'](_0x46bb87)[_0x1f7a('0x1a')](_0x158e6c);}};}function respondWithFilteredResult(_0x172ff8,_0x84c8ba){return function(_0x48983a){if(_0x48983a){var _0xf847c=_0x48983a[_0x1f7a('0x1b')],_0x277599=_0x84c8ba[_0x1f7a('0x1c')],_0x35f11c=_0x84c8ba[_0x1f7a('0x1c')]+_0x84c8ba[_0x1f7a('0x1d')],_0x2f4ea7;if(_0x35f11c>=_0xf847c){_0x35f11c=_0xf847c;_0x2f4ea7=0xc8;}else{_0x2f4ea7=0xce;}_0x172ff8[_0x1f7a('0x19')](_0x2f4ea7);return _0x172ff8[_0x1f7a('0x1e')](_0x1f7a('0x1f'),_0x277599+'-'+_0x35f11c+'/'+_0xf847c)['json'](_0x48983a);}return null;};}function patchUpdates(_0x3bc749){return function(_0x39ba77){try{jsonpatch['apply'](_0x39ba77,_0x3bc749,!![]);}catch(_0x4299a0){return BPromise['reject'](_0x4299a0);}return _0x39ba77[_0x1f7a('0x20')]();};}function saveUpdates(_0x1e255f,_0x5caea2){return function(_0x3f9a42){if(_0x3f9a42){return _0x3f9a42[_0x1f7a('0x21')](_0x1e255f)[_0x1f7a('0x22')](function(_0x6b4fdc){return _0x6b4fdc;});}return null;};}function removeEntity(_0x442532,_0x20bfff){return function(_0x42154f){if(_0x42154f){return _0x42154f[_0x1f7a('0x23')]()[_0x1f7a('0x22')](function(){_0x442532[_0x1f7a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43f6c2,_0x20f891){return function(_0x321566){if(!_0x321566){_0x43f6c2[_0x1f7a('0x18')](0x194);}return _0x321566;};}function handleError(_0x33242f,_0x2b295c){_0x2b295c=_0x2b295c||0x1f4;return function(_0x39500b){logger[_0x1f7a('0x24')](_0x39500b[_0x1f7a('0x25')]);if(_0x39500b[_0x1f7a('0x26')]){delete _0x39500b[_0x1f7a('0x26')];}_0x33242f['status'](_0x2b295c)[_0x1f7a('0x27')](_0x39500b);};}exports['index']=function(_0x360f6f,_0x451cab){var _0x430215={},_0xc72681={},_0x323a7c={'count':0x0,'rows':[]};var _0x4aff1b=_[_0x1f7a('0x28')](db['UserProfileSection'][_0x1f7a('0x29')],function(_0x4398fd){return{'name':_0x4398fd[_0x1f7a('0x2a')],'type':_0x4398fd[_0x1f7a('0x2b')]['key']};});_0xc72681[_0x1f7a('0x2c')]=_[_0x1f7a('0x28')](_0x4aff1b,_0x1f7a('0x26'));_0xc72681[_0x1f7a('0x2d')]=_[_0x1f7a('0x2e')](_0x360f6f['query']);_0xc72681[_0x1f7a('0x2f')]=_[_0x1f7a('0x30')](_0xc72681[_0x1f7a('0x2c')],_0xc72681[_0x1f7a('0x2d')]);_0x430215['attributes']=_[_0x1f7a('0x30')](_0xc72681[_0x1f7a('0x2c')],qs[_0x1f7a('0x31')](_0x360f6f[_0x1f7a('0x2d')][_0x1f7a('0x31')]));_0x430215[_0x1f7a('0x32')]=_0x430215[_0x1f7a('0x32')][_0x1f7a('0x33')]?_0x430215[_0x1f7a('0x32')]:_0xc72681[_0x1f7a('0x2c')];if(!_0x360f6f[_0x1f7a('0x2d')][_0x1f7a('0x34')](_0x1f7a('0x35'))){_0x430215[_0x1f7a('0x1d')]=qs[_0x1f7a('0x1d')](_0x360f6f['query'][_0x1f7a('0x1d')]);_0x430215[_0x1f7a('0x1c')]=qs[_0x1f7a('0x1c')](_0x360f6f['query'][_0x1f7a('0x1c')]);}_0x430215[_0x1f7a('0x36')]=qs[_0x1f7a('0x37')](_0x360f6f[_0x1f7a('0x2d')][_0x1f7a('0x37')]);_0x430215[_0x1f7a('0x38')]=qs[_0x1f7a('0x2f')](_[_0x1f7a('0x39')](_0x360f6f[_0x1f7a('0x2d')],_0xc72681[_0x1f7a('0x2f')]));if(_0x360f6f[_0x1f7a('0x2d')][_0x1f7a('0x3a')]){_0x430215[_0x1f7a('0x38')]=_[_0x1f7a('0x3b')](_0x430215[_0x1f7a('0x38')],{'$or':_[_0x1f7a('0x28')](_0x4aff1b,function(_0x40edcd){if(_0x40edcd['type']!=='VIRTUAL'){var _0x169ac6={};_0x169ac6[_0x40edcd['name']]={'$like':'%'+_0x360f6f['query'][_0x1f7a('0x3a')]+'%'};return _0x169ac6;}})});}_0x430215=_[_0x1f7a('0x3b')]({},_0x430215,_0x360f6f[_0x1f7a('0x3c')]);var _0xbee781={'where':_0x430215[_0x1f7a('0x38')]};return db['UserProfileSection']['count'](_0xbee781)[_0x1f7a('0x22')](function(_0x2f444e){_0x323a7c['count']=_0x2f444e;if(_0x360f6f['query'][_0x1f7a('0x3d')]){_0x430215[_0x1f7a('0x3e')]=[{'all':!![]}];}return db['UserProfileSection'][_0x1f7a('0x3f')](_0x430215);})[_0x1f7a('0x22')](function(_0x2a655c){_0x323a7c[_0x1f7a('0x40')]=_0x2a655c;return _0x323a7c;})[_0x1f7a('0x22')](respondWithFilteredResult(_0x451cab,_0x430215))[_0x1f7a('0x41')](handleError(_0x451cab,null));};exports['show']=function(_0x1843fb,_0xb91a38){var _0x171a74={'raw':![],'where':{'id':_0x1843fb[_0x1f7a('0x42')]['id']}},_0x366bd3={};_0x366bd3[_0x1f7a('0x2c')]=_[_0x1f7a('0x2e')](db['UserProfileSection'][_0x1f7a('0x29')]);_0x366bd3[_0x1f7a('0x2d')]=_[_0x1f7a('0x2e')](_0x1843fb['query']);_0x366bd3[_0x1f7a('0x2f')]=_[_0x1f7a('0x30')](_0x366bd3[_0x1f7a('0x2c')],_0x366bd3[_0x1f7a('0x2d')]);_0x171a74[_0x1f7a('0x32')]=_[_0x1f7a('0x30')](_0x366bd3[_0x1f7a('0x2c')],qs[_0x1f7a('0x31')](_0x1843fb[_0x1f7a('0x2d')][_0x1f7a('0x31')]));_0x171a74['attributes']=_0x171a74[_0x1f7a('0x32')]['length']?_0x171a74[_0x1f7a('0x32')]:_0x366bd3[_0x1f7a('0x2c')];if(_0x1843fb[_0x1f7a('0x2d')][_0x1f7a('0x3d')]){_0x171a74[_0x1f7a('0x3e')]=[{'all':!![]}];}_0x171a74=_[_0x1f7a('0x3b')]({},_0x171a74,_0x1843fb['options']);return db[_0x1f7a('0x43')][_0x1f7a('0x44')](_0x171a74)[_0x1f7a('0x22')](handleEntityNotFound(_0xb91a38,null))['then'](respondWithResult(_0xb91a38,null))[_0x1f7a('0x41')](handleError(_0xb91a38,null));};exports[_0x1f7a('0x45')]=function(_0x147f0d,_0x2c1607){return db[_0x1f7a('0x43')][_0x1f7a('0x45')](_0x147f0d[_0x1f7a('0x46')],{})[_0x1f7a('0x22')](respondWithResult(_0x2c1607,0xc9))[_0x1f7a('0x41')](handleError(_0x2c1607,null));};exports['update']=function(_0x4c72a1,_0x1ab942){if(_0x4c72a1[_0x1f7a('0x46')]['id']){delete _0x4c72a1[_0x1f7a('0x46')]['id'];}return db['UserProfileSection'][_0x1f7a('0x44')]({'where':{'id':_0x4c72a1[_0x1f7a('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ab942,null))[_0x1f7a('0x22')](saveUpdates(_0x4c72a1[_0x1f7a('0x46')],null))[_0x1f7a('0x22')](respondWithResult(_0x1ab942,null))[_0x1f7a('0x41')](handleError(_0x1ab942,null));};exports['destroy']=function(_0x46b5b3,_0x40b4ab){return db[_0x1f7a('0x43')][_0x1f7a('0x44')]({'where':{'id':_0x46b5b3[_0x1f7a('0x42')]['id']}})[_0x1f7a('0x22')](handleEntityNotFound(_0x40b4ab,null))[_0x1f7a('0x22')](removeEntity(_0x40b4ab,null))['catch'](handleError(_0x40b4ab,null));};exports['describe']=function(_0x504708,_0x2fa348){return db[_0x1f7a('0x43')][_0x1f7a('0x47')]()[_0x1f7a('0x22')](respondWithResult(_0x2fa348,null))[_0x1f7a('0x41')](handleError(_0x2fa348,null));}; \ No newline at end of file +var _0x20da=['nolimit','sort','where','filters','filter','merge','VIRTUAL','name','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','error','index','UserProfileSection','rawAttributes','fieldName','type','model','map','query','keys','attributes','intersection','fields','hasOwnProperty'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x20da,0x1d2));var _0xa20d=function(_0x2adf1c,_0x3005c){_0x2adf1c=_0x2adf1c-0x0;var _0x401ed9=_0x20da[_0x2adf1c];return _0x401ed9;};'use strict';var pdf=require(_0xa20d('0x0'));var emlformat=require(_0xa20d('0x1'));var rimraf=require(_0xa20d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa20d('0x3'));var moment=require(_0xa20d('0x4'));var BPromise=require(_0xa20d('0x5'));var Mustache=require(_0xa20d('0x6'));var util=require(_0xa20d('0x7'));var path=require(_0xa20d('0x8'));var sox=require(_0xa20d('0x9'));var csv=require(_0xa20d('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa20d('0xb'));var squel=require('squel');var crypto=require(_0xa20d('0xc'));var jsforce=require(_0xa20d('0xd'));var deskjs=require(_0xa20d('0xe'));var toCsv=require(_0xa20d('0xa'));var querystring=require(_0xa20d('0xf'));var Papa=require(_0xa20d('0x10'));var Redis=require(_0xa20d('0x11'));var authService=require(_0xa20d('0x12'));var qs=require(_0xa20d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa20d('0x14'));var logger=require('../../config/logger')(_0xa20d('0x15'));var utils=require(_0xa20d('0x16'));var config=require(_0xa20d('0x17'));var db=require(_0xa20d('0x18'))['db'];function respondWithStatusCode(_0x2b09f6,_0x336671){_0x336671=_0x336671||0xcc;return function(_0x1caaac){if(_0x1caaac){return _0x2b09f6[_0xa20d('0x19')](_0x336671);}return _0x2b09f6[_0xa20d('0x1a')](_0x336671)['end']();};}function respondWithResult(_0xb99787,_0x22c694){_0x22c694=_0x22c694||0xc8;return function(_0x50945c){if(_0x50945c){return _0xb99787[_0xa20d('0x1a')](_0x22c694)[_0xa20d('0x1b')](_0x50945c);}};}function respondWithFilteredResult(_0x39bbb7,_0x5ba641){return function(_0x5e7be1){if(_0x5e7be1){var _0x250bb7=_0x5e7be1['count'],_0x29fbeb=_0x5ba641[_0xa20d('0x1c')],_0x2fb4ee=_0x5ba641[_0xa20d('0x1c')]+_0x5ba641[_0xa20d('0x1d')],_0x389ea0;if(_0x2fb4ee>=_0x250bb7){_0x2fb4ee=_0x250bb7;_0x389ea0=0xc8;}else{_0x389ea0=0xce;}_0x39bbb7[_0xa20d('0x1a')](_0x389ea0);return _0x39bbb7[_0xa20d('0x1e')](_0xa20d('0x1f'),_0x29fbeb+'-'+_0x2fb4ee+'/'+_0x250bb7)[_0xa20d('0x1b')](_0x5e7be1);}return null;};}function patchUpdates(_0xeefc21){return function(_0x3e426e){try{jsonpatch[_0xa20d('0x20')](_0x3e426e,_0xeefc21,!![]);}catch(_0x39ff93){return BPromise['reject'](_0x39ff93);}return _0x3e426e[_0xa20d('0x21')]();};}function saveUpdates(_0x1a4bc0,_0xc0160f){return function(_0x1a03b9){if(_0x1a03b9){return _0x1a03b9[_0xa20d('0x22')](_0x1a4bc0)[_0xa20d('0x23')](function(_0x495ca7){return _0x495ca7;});}return null;};}function removeEntity(_0x2eaa9b,_0x27c7e6){return function(_0x5e74cb){if(_0x5e74cb){return _0x5e74cb[_0xa20d('0x24')]()[_0xa20d('0x23')](function(){_0x2eaa9b[_0xa20d('0x1a')](0xcc)[_0xa20d('0x25')]();});}};}function handleEntityNotFound(_0x52557a,_0x196064){return function(_0x59b429){if(!_0x59b429){_0x52557a[_0xa20d('0x19')](0x194);}return _0x59b429;};}function handleError(_0x40621b,_0x47891d){_0x47891d=_0x47891d||0x1f4;return function(_0x536b05){logger[_0xa20d('0x26')](_0x536b05['stack']);if(_0x536b05['name']){delete _0x536b05['name'];}_0x40621b[_0xa20d('0x1a')](_0x47891d)['send'](_0x536b05);};}exports[_0xa20d('0x27')]=function(_0x335396,_0x5762bf){var _0x7c2dd9={},_0x115df0={},_0x50d4f7={'count':0x0,'rows':[]};var _0x247a27=_['map'](db[_0xa20d('0x28')][_0xa20d('0x29')],function(_0x32c887){return{'name':_0x32c887[_0xa20d('0x2a')],'type':_0x32c887[_0xa20d('0x2b')]['key']};});_0x115df0[_0xa20d('0x2c')]=_[_0xa20d('0x2d')](_0x247a27,'name');_0x115df0[_0xa20d('0x2e')]=_[_0xa20d('0x2f')](_0x335396[_0xa20d('0x2e')]);_0x115df0['filters']=_['intersection'](_0x115df0['model'],_0x115df0['query']);_0x7c2dd9[_0xa20d('0x30')]=_[_0xa20d('0x31')](_0x115df0[_0xa20d('0x2c')],qs['fields'](_0x335396[_0xa20d('0x2e')][_0xa20d('0x32')]));_0x7c2dd9['attributes']=_0x7c2dd9['attributes']['length']?_0x7c2dd9[_0xa20d('0x30')]:_0x115df0[_0xa20d('0x2c')];if(!_0x335396[_0xa20d('0x2e')][_0xa20d('0x33')](_0xa20d('0x34'))){_0x7c2dd9[_0xa20d('0x1d')]=qs[_0xa20d('0x1d')](_0x335396[_0xa20d('0x2e')][_0xa20d('0x1d')]);_0x7c2dd9[_0xa20d('0x1c')]=qs[_0xa20d('0x1c')](_0x335396['query'][_0xa20d('0x1c')]);}_0x7c2dd9['order']=qs[_0xa20d('0x35')](_0x335396[_0xa20d('0x2e')][_0xa20d('0x35')]);_0x7c2dd9[_0xa20d('0x36')]=qs['filters'](_['pick'](_0x335396['query'],_0x115df0[_0xa20d('0x37')]));if(_0x335396[_0xa20d('0x2e')][_0xa20d('0x38')]){_0x7c2dd9[_0xa20d('0x36')]=_[_0xa20d('0x39')](_0x7c2dd9[_0xa20d('0x36')],{'$or':_['map'](_0x247a27,function(_0x5cd044){if(_0x5cd044[_0xa20d('0x2b')]!==_0xa20d('0x3a')){var _0x18e7b2={};_0x18e7b2[_0x5cd044[_0xa20d('0x3b')]]={'$like':'%'+_0x335396['query'][_0xa20d('0x38')]+'%'};return _0x18e7b2;}})});}_0x7c2dd9=_[_0xa20d('0x39')]({},_0x7c2dd9,_0x335396[_0xa20d('0x3c')]);var _0x3b223f={'where':_0x7c2dd9['where']};return db[_0xa20d('0x28')][_0xa20d('0x3d')](_0x3b223f)[_0xa20d('0x23')](function(_0x19bc17){_0x50d4f7[_0xa20d('0x3d')]=_0x19bc17;if(_0x335396['query'][_0xa20d('0x3e')]){_0x7c2dd9[_0xa20d('0x3f')]=[{'all':!![]}];}return db[_0xa20d('0x28')][_0xa20d('0x40')](_0x7c2dd9);})[_0xa20d('0x23')](function(_0xf8f11d){_0x50d4f7[_0xa20d('0x41')]=_0xf8f11d;return _0x50d4f7;})[_0xa20d('0x23')](respondWithFilteredResult(_0x5762bf,_0x7c2dd9))[_0xa20d('0x42')](handleError(_0x5762bf,null));};exports[_0xa20d('0x43')]=function(_0x165535,_0x2cad1c){var _0x81f1da={'raw':![],'where':{'id':_0x165535[_0xa20d('0x44')]['id']}},_0x198db7={};_0x198db7[_0xa20d('0x2c')]=_[_0xa20d('0x2f')](db[_0xa20d('0x28')][_0xa20d('0x29')]);_0x198db7[_0xa20d('0x2e')]=_[_0xa20d('0x2f')](_0x165535[_0xa20d('0x2e')]);_0x198db7[_0xa20d('0x37')]=_[_0xa20d('0x31')](_0x198db7[_0xa20d('0x2c')],_0x198db7[_0xa20d('0x2e')]);_0x81f1da[_0xa20d('0x30')]=_[_0xa20d('0x31')](_0x198db7[_0xa20d('0x2c')],qs[_0xa20d('0x32')](_0x165535['query'][_0xa20d('0x32')]));_0x81f1da['attributes']=_0x81f1da['attributes'][_0xa20d('0x45')]?_0x81f1da[_0xa20d('0x30')]:_0x198db7[_0xa20d('0x2c')];if(_0x165535[_0xa20d('0x2e')]['includeAll']){_0x81f1da[_0xa20d('0x3f')]=[{'all':!![]}];}_0x81f1da=_[_0xa20d('0x39')]({},_0x81f1da,_0x165535['options']);return db[_0xa20d('0x28')][_0xa20d('0x46')](_0x81f1da)[_0xa20d('0x23')](handleEntityNotFound(_0x2cad1c,null))[_0xa20d('0x23')](respondWithResult(_0x2cad1c,null))[_0xa20d('0x42')](handleError(_0x2cad1c,null));};exports[_0xa20d('0x47')]=function(_0xe0b660,_0x184d0c){return db[_0xa20d('0x28')]['create'](_0xe0b660['body'],{})['then'](respondWithResult(_0x184d0c,0xc9))[_0xa20d('0x42')](handleError(_0x184d0c,null));};exports[_0xa20d('0x22')]=function(_0x3fc543,_0x1418c6){if(_0x3fc543[_0xa20d('0x48')]['id']){delete _0x3fc543[_0xa20d('0x48')]['id'];}return db['UserProfileSection'][_0xa20d('0x46')]({'where':{'id':_0x3fc543[_0xa20d('0x44')]['id']}})[_0xa20d('0x23')](handleEntityNotFound(_0x1418c6,null))[_0xa20d('0x23')](saveUpdates(_0x3fc543[_0xa20d('0x48')],null))[_0xa20d('0x23')](respondWithResult(_0x1418c6,null))[_0xa20d('0x42')](handleError(_0x1418c6,null));};exports['destroy']=function(_0x42903d,_0x3ac4d5){return db[_0xa20d('0x28')]['find']({'where':{'id':_0x42903d[_0xa20d('0x44')]['id']}})[_0xa20d('0x23')](handleEntityNotFound(_0x3ac4d5,null))[_0xa20d('0x23')](removeEntity(_0x3ac4d5,null))[_0xa20d('0x42')](handleError(_0x3ac4d5,null));};exports[_0xa20d('0x49')]=function(_0x320dba,_0x3dd877){return db[_0xa20d('0x28')][_0xa20d('0x49')]()['then'](respondWithResult(_0x3dd877,null))['catch'](handleError(_0x3dd877,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 9e1fb28..b6d8fab 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 _0x5eb1=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','define'];(function(_0x83c716,_0x25152d){var _0xab9893=function(_0x9b3f0a){while(--_0x9b3f0a){_0x83c716['push'](_0x83c716['shift']());}};_0xab9893(++_0x25152d);}(_0x5eb1,0x7c));var _0x15eb=function(_0x242e41,_0x2beb78){_0x242e41=_0x242e41-0x0;var _0x171510=_0x5eb1[_0x242e41];return _0x171510;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var logger=require(_0x15eb('0x1'))(_0x15eb('0x2'));var moment=require(_0x15eb('0x3'));var BPromise=require(_0x15eb('0x4'));var rp=require(_0x15eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15eb('0x6'));var config=require(_0x15eb('0x7'));var attributes=require(_0x15eb('0x8'));module[_0x15eb('0x9')]=function(_0x47e341,_0x1be042){return _0x47e341[_0x15eb('0xa')]('UserProfileSection',attributes,{'tableName':_0x15eb('0xb'),'paranoid':![],'indexes':[{'name':_0x15eb('0xc'),'fields':[_0x15eb('0xd'),_0x15eb('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xca57=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection'];(function(_0x2c4a34,_0x3d5f02){var _0x55b223=function(_0x1ff096){while(--_0x1ff096){_0x2c4a34['push'](_0x2c4a34['shift']());}};_0x55b223(++_0x3d5f02);}(_0xca57,0x1d5));var _0x7ca5=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xca57[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x7ca5('0x0'));var util=require(_0x7ca5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7ca5('0x2'));var BPromise=require(_0x7ca5('0x3'));var rp=require(_0x7ca5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ca5('0x5'));var config=require(_0x7ca5('0x6'));var attributes=require(_0x7ca5('0x7'));module[_0x7ca5('0x8')]=function(_0x5cfdb9,_0x13a4aa){return _0x5cfdb9[_0x7ca5('0x9')](_0x7ca5('0xa'),attributes,{'tableName':_0x7ca5('0xb'),'paranoid':![],'indexes':[{'name':_0x7ca5('0xc'),'fields':[_0x7ca5('0xd'),_0x7ca5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 12920e1..4fd178b 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 _0xc5e3=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x40646e,_0x5edd82){var _0x23d891=function(_0x5acc0c){while(--_0x5acc0c){_0x40646e['push'](_0x40646e['shift']());}};_0x23d891(++_0x5edd82);}(_0xc5e3,0x168));var _0x3c5e=function(_0x3889d2,_0xadfe8c){_0x3889d2=_0x3889d2-0x0;var _0x1a41ca=_0xc5e3[_0x3889d2];return _0x1a41ca;};'use strict';var _=require(_0x3c5e('0x0'));var util=require(_0x3c5e('0x1'));var moment=require('moment');var BPromise=require(_0x3c5e('0x2'));var rs=require(_0x3c5e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c5e('0x4'))['db'];var utils=require(_0x3c5e('0x5'));var logger=require('../../config/logger')(_0x3c5e('0x6'));var config=require(_0x3c5e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3c5e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x364f3c,_0x15c133,_0x3fd483){return new BPromise(function(_0x517082,_0x525293){return client['request'](_0x364f3c,_0x3fd483)[_0x3c5e('0x9')](function(_0x25f4f3){logger[_0x3c5e('0xa')](_0x3c5e('0xb'),_0x15c133,_0x3c5e('0xc'));logger['debug'](_0x3c5e('0xd'),_0x15c133,_0x3c5e('0xc'),JSON[_0x3c5e('0xe')](_0x25f4f3));if(_0x25f4f3[_0x3c5e('0xf')]){if(_0x25f4f3[_0x3c5e('0xf')][_0x3c5e('0x10')]===0x1f4){logger[_0x3c5e('0xf')](_0x3c5e('0xb'),_0x15c133,_0x25f4f3[_0x3c5e('0xf')][_0x3c5e('0x11')]);return _0x525293(_0x25f4f3[_0x3c5e('0xf')][_0x3c5e('0x11')]);}logger[_0x3c5e('0xf')](_0x3c5e('0xb'),_0x15c133,_0x25f4f3[_0x3c5e('0xf')][_0x3c5e('0x11')]);return _0x517082(_0x25f4f3[_0x3c5e('0xf')][_0x3c5e('0x11')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x15c133,_0x3c5e('0xc'));_0x517082(_0x25f4f3[_0x3c5e('0x12')][_0x3c5e('0x11')]);}})[_0x3c5e('0x13')](function(_0x3e4ec5){logger['error'](_0x3c5e('0xb'),_0x15c133,_0x3e4ec5);_0x525293(_0x3e4ec5);});});} \ No newline at end of file +var _0x4ee9=['info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','lodash','moment','bluebird','ioredis','../../config/logger','jayson/promise','http','request','then'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x4ee9,0x1d2));var _0x94ee=function(_0x28e68e,_0x426d50){_0x28e68e=_0x28e68e-0x0;var _0x47ee76=_0x4ee9[_0x28e68e];return _0x47ee76;};'use strict';var _=require(_0x94ee('0x0'));var util=require('util');var moment=require(_0x94ee('0x1'));var BPromise=require(_0x94ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94ee('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x94ee('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x94ee('0x5'));var client=jayson['client'][_0x94ee('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xe15af6,_0x1975ac,_0x2cbd97){return new BPromise(function(_0x2c9c07,_0x1d817f){return client[_0x94ee('0x7')](_0xe15af6,_0x2cbd97)[_0x94ee('0x8')](function(_0x4ec822){logger[_0x94ee('0x9')]('UserProfileSection,\x20%s,\x20%s',_0x1975ac,_0x94ee('0xa'));logger[_0x94ee('0xb')](_0x94ee('0xc'),_0x1975ac,_0x94ee('0xa'),JSON[_0x94ee('0xd')](_0x4ec822));if(_0x4ec822['error']){if(_0x4ec822[_0x94ee('0xe')][_0x94ee('0xf')]===0x1f4){logger[_0x94ee('0xe')](_0x94ee('0x10'),_0x1975ac,_0x4ec822[_0x94ee('0xe')][_0x94ee('0x11')]);return _0x1d817f(_0x4ec822[_0x94ee('0xe')][_0x94ee('0x11')]);}logger[_0x94ee('0xe')](_0x94ee('0x10'),_0x1975ac,_0x4ec822['error'][_0x94ee('0x11')]);return _0x2c9c07(_0x4ec822[_0x94ee('0xe')][_0x94ee('0x11')]);}else{logger['info'](_0x94ee('0x10'),_0x1975ac,_0x94ee('0xa'));_0x2c9c07(_0x4ec822[_0x94ee('0x12')][_0x94ee('0x11')]);}})['catch'](function(_0x23cefb){logger[_0x94ee('0xe')](_0x94ee('0x10'),_0x1975ac,_0x23cefb);_0x1d817f(_0x23cefb);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 1fdece7..fe0f7c8 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 _0xe4c9=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout'];(function(_0x2c3847,_0x3fc815){var _0x152317=function(_0x19e003){while(--_0x19e003){_0x2c3847['push'](_0x2c3847['shift']());}};_0x152317(++_0x3fc815);}(_0xe4c9,0xb4));var _0x9e4c=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0xe4c9[_0x1dfa63];return _0x26f2a9;};'use strict';var multer=require(_0x9e4c('0x0'));var util=require(_0x9e4c('0x1'));var path=require(_0x9e4c('0x2'));var timeout=require(_0x9e4c('0x3'));var express=require(_0x9e4c('0x4'));var router=express['Router']();var auth=require(_0x9e4c('0x5'));var interaction=require(_0x9e4c('0x6'));var config=require(_0x9e4c('0x7'));module['exports']=router; \ No newline at end of file +var _0x870c=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x50424f,_0x50aa88){var _0xd5e2de=function(_0x31dc63){while(--_0x31dc63){_0x50424f['push'](_0x50424f['shift']());}};_0xd5e2de(++_0x50aa88);}(_0x870c,0x1b9));var _0xc870=function(_0x57b925,_0x29faf7){_0x57b925=_0x57b925-0x0;var _0x11e9ad=_0x870c[_0x57b925];return _0x11e9ad;};'use strict';var multer=require(_0xc870('0x0'));var util=require(_0xc870('0x1'));var path=require('path');var timeout=require(_0xc870('0x2'));var express=require(_0xc870('0x3'));var router=express[_0xc870('0x4')]();var auth=require(_0xc870('0x5'));var interaction=require(_0xc870('0x6'));var config=require(_0xc870('0x7'));module[_0xc870('0x8')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index d9fde57..a198f93 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['exports','INTEGER'];(function(_0x525bcf,_0x428c0c){var _0x4c3486=function(_0xf87f2){while(--_0xf87f2){_0x525bcf['push'](_0x525bcf['shift']());}};_0x4c3486(++_0x428c0c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'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(_0x51cb2d,_0x13e29d){var _0x242722=function(_0x2777fe){while(--_0x2777fe){_0x51cb2d['push'](_0x51cb2d['shift']());}};_0x242722(++_0x13e29d);}(_0xe706,0xa3));var _0x6e70=function(_0x151f00,_0x4ca3a1){_0x151f00=_0x151f00-0x0;var _0x418d9b=_0xe706[_0x151f00];return _0x418d9b;};'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/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 1f967b5..77ba56b 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 _0x5433=['bluebird','request-promise','path','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x4f91b3,_0x445f77){var _0x2c1b57=function(_0x4d0660){while(--_0x4d0660){_0x4f91b3['push'](_0x4f91b3['shift']());}};_0x2c1b57(++_0x445f77);}(_0x5433,0x187));var _0x3543=function(_0x252365,_0x55c2e8){_0x252365=_0x252365-0x0;var _0x161267=_0x5433[_0x252365];return _0x161267;};'use strict';var _=require(_0x3543('0x0'));var util=require(_0x3543('0x1'));var logger=require(_0x3543('0x2'))(_0x3543('0x3'));var moment=require(_0x3543('0x4'));var BPromise=require(_0x3543('0x5'));var rp=require(_0x3543('0x6'));var fs=require('fs');var path=require(_0x3543('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3543('0x8'));module[_0x3543('0x9')]=function(_0x4a50a6,_0x3046ad){return _0x4a50a6[_0x3543('0xa')]('UserSmsQueue',attributes,{'tableName':_0x3543('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x496e=['user_has_sms_queues','../../config/logger','moment','bluebird','path','rimraf','exports','UserSmsQueue'];(function(_0x221a0f,_0x3970f6){var _0x30309e=function(_0x2a6cf4){while(--_0x2a6cf4){_0x221a0f['push'](_0x221a0f['shift']());}};_0x30309e(++_0x3970f6);}(_0x496e,0x79));var _0xe496=function(_0x3f71a0,_0x452c96){_0x3f71a0=_0x3f71a0-0x0;var _0x1d06d4=_0x496e[_0x3f71a0];return _0x1d06d4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe496('0x0'))('api');var moment=require(_0xe496('0x1'));var BPromise=require(_0xe496('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe496('0x3'));var rimraf=require(_0xe496('0x4'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0xe496('0x5')]=function(_0xed8c69,_0x1942fa){return _0xed8c69['define'](_0xe496('0x6'),attributes,{'tableName':_0xe496('0x7'),'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 798b70b..be6e74b 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 _0x3311=['util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4e723e,_0x3b5f02){var _0x17fdc7=function(_0x5c3ce7){while(--_0x5c3ce7){_0x4e723e['push'](_0x4e723e['shift']());}};_0x17fdc7(++_0x3b5f02);}(_0x3311,0xc6));var _0x1331=function(_0x39d95a,_0xb1672b){_0x39d95a=_0x39d95a-0x0;var _0x523f46=_0x3311[_0x39d95a];return _0x523f46;};'use strict';var _=require('lodash');var util=require(_0x1331('0x0'));var moment=require(_0x1331('0x1'));var BPromise=require('bluebird');var rs=require(_0x1331('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1331('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1331('0x4'))(_0x1331('0x5'));var config=require(_0x1331('0x6'));var jayson=require(_0x1331('0x7'));var client=jayson[_0x1331('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b88e9,_0x2300e9,_0x13ebb6){return new BPromise(function(_0x1ff294,_0x4bb892){return client[_0x1331('0x9')](_0x3b88e9,_0x13ebb6)[_0x1331('0xa')](function(_0x4c02b9){logger[_0x1331('0xb')](_0x1331('0xc'),_0x2300e9,_0x1331('0xd'));logger['debug'](_0x1331('0xe'),_0x2300e9,'request\x20sent',JSON['stringify'](_0x4c02b9));if(_0x4c02b9[_0x1331('0xf')]){if(_0x4c02b9[_0x1331('0xf')][_0x1331('0x10')]===0x1f4){logger[_0x1331('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x2300e9,_0x4c02b9['error']['message']);return _0x4bb892(_0x4c02b9[_0x1331('0xf')][_0x1331('0x11')]);}logger[_0x1331('0xf')](_0x1331('0xc'),_0x2300e9,_0x4c02b9[_0x1331('0xf')][_0x1331('0x11')]);return _0x1ff294(_0x4c02b9['error'][_0x1331('0x11')]);}else{logger['info'](_0x1331('0xc'),_0x2300e9,_0x1331('0xd'));_0x1ff294(_0x4c02b9['result']['message']);}})['catch'](function(_0x1f86b5){logger['error'](_0x1331('0xc'),_0x2300e9,_0x1f86b5);_0x4bb892(_0x1f86b5);});});} \ No newline at end of file +var _0x1cb0=['lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch'];(function(_0x43a484,_0xb16492){var _0x1c13ae=function(_0x18f96c){while(--_0x18f96c){_0x43a484['push'](_0x43a484['shift']());}};_0x1c13ae(++_0xb16492);}(_0x1cb0,0x187));var _0x01cb=function(_0x19a465,_0x47790a){_0x19a465=_0x19a465-0x0;var _0xda00f8=_0x1cb0[_0x19a465];return _0xda00f8;};'use strict';var _=require(_0x01cb('0x0'));var util=require(_0x01cb('0x1'));var moment=require(_0x01cb('0x2'));var BPromise=require(_0x01cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x01cb('0x5'))(_0x01cb('0x6'));var config=require('../../config/environment');var jayson=require(_0x01cb('0x7'));var client=jayson[_0x01cb('0x8')][_0x01cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c2914,_0x456ca1,_0x3e5f11){return new BPromise(function(_0x249b50,_0x22a4c5){return client[_0x01cb('0xa')](_0x4c2914,_0x3e5f11)[_0x01cb('0xb')](function(_0x4b5d2a){logger[_0x01cb('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x456ca1,_0x01cb('0xd'));logger[_0x01cb('0xe')](_0x01cb('0xf'),_0x456ca1,_0x01cb('0xd'),JSON[_0x01cb('0x10')](_0x4b5d2a));if(_0x4b5d2a[_0x01cb('0x11')]){if(_0x4b5d2a[_0x01cb('0x11')][_0x01cb('0x12')]===0x1f4){logger[_0x01cb('0x11')](_0x01cb('0x13'),_0x456ca1,_0x4b5d2a['error'][_0x01cb('0x14')]);return _0x22a4c5(_0x4b5d2a['error']['message']);}logger[_0x01cb('0x11')](_0x01cb('0x13'),_0x456ca1,_0x4b5d2a['error']['message']);return _0x249b50(_0x4b5d2a[_0x01cb('0x11')][_0x01cb('0x14')]);}else{logger[_0x01cb('0xc')](_0x01cb('0x13'),_0x456ca1,_0x01cb('0xd'));_0x249b50(_0x4b5d2a[_0x01cb('0x15')][_0x01cb('0x14')]);}})[_0x01cb('0x16')](function(_0x57e53b){logger[_0x01cb('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x456ca1,_0x57e53b);_0x22a4c5(_0x57e53b);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index d5e39cc..c59c7d4 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 _0xb844=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','path','express'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb844,0x1e0));var _0x4b84=function(_0x225e46,_0x199a3b){_0x225e46=_0x225e46-0x0;var _0x1c1fa2=_0xb844[_0x225e46];return _0x1c1fa2;};'use strict';var multer=require(_0x4b84('0x0'));var util=require('util');var path=require(_0x4b84('0x1'));var timeout=require('connect-timeout');var express=require(_0x4b84('0x2'));var router=express[_0x4b84('0x3')]();var auth=require(_0x4b84('0x4'));var interaction=require(_0x4b84('0x5'));var config=require(_0x4b84('0x6'));module['exports']=router; \ No newline at end of file +var _0xbdf9=['multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x3aa48e,_0x1ed916){var _0x1105ac=function(_0x27915c){while(--_0x27915c){_0x3aa48e['push'](_0x3aa48e['shift']());}};_0x1105ac(++_0x1ed916);}(_0xbdf9,0x1e0));var _0x9bdf=function(_0x1c9c24,_0x2a517b){_0x1c9c24=_0x1c9c24-0x0;var _0x349c69=_0xbdf9[_0x1c9c24];return _0x349c69;};'use strict';var multer=require(_0x9bdf('0x0'));var util=require(_0x9bdf('0x1'));var path=require(_0x9bdf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9bdf('0x3')]();var auth=require(_0x9bdf('0x4'));var interaction=require(_0x9bdf('0x5'));var config=require(_0x9bdf('0x6'));module[_0x9bdf('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 1b95739..e0b7b89 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x443f14,_0x49a018){var _0x2ba423=function(_0x4ebcad){while(--_0x4ebcad){_0x443f14['push'](_0x443f14['shift']());}};_0x2ba423(++_0x49a018);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x4986a9,_0x311d65){var _0x2d31fe=function(_0x369848){while(--_0x369848){_0x4986a9['push'](_0x4986a9['shift']());}};_0x2d31fe(++_0x311d65);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index e0d407b..318ac32 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 _0xf72b=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x126199,_0x6ece47){var _0x4f7bc6=function(_0x4ccce3){while(--_0x4ccce3){_0x126199['push'](_0x126199['shift']());}};_0x4f7bc6(++_0x6ece47);}(_0xf72b,0x1d9));var _0xbf72=function(_0x5defeb,_0x5a7791){_0x5defeb=_0x5defeb-0x0;var _0xa7b6fb=_0xf72b[_0x5defeb];return _0xa7b6fb;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var logger=require(_0xbf72('0x1'))('api');var moment=require(_0xbf72('0x2'));var BPromise=require(_0xbf72('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf72('0x4'));var rimraf=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var attributes=require(_0xbf72('0x7'));module[_0xbf72('0x8')]=function(_0x2b8440,_0x5ee060){return _0x2b8440[_0xbf72('0x9')](_0xbf72('0xa'),attributes,{'tableName':_0xbf72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a9a=['bluebird','request-promise','rimraf','../../config/environment','exports','define','user_has_voice_queues','util','api','moment'];(function(_0x24cf99,_0x2e2189){var _0x210865=function(_0x2d0ff8){while(--_0x2d0ff8){_0x24cf99['push'](_0x24cf99['shift']());}};_0x210865(++_0x2e2189);}(_0x0a9a,0x183));var _0xa0a9=function(_0x54ceaa,_0x1d07fd){_0x54ceaa=_0x54ceaa-0x0;var _0x26ed50=_0x0a9a[_0x54ceaa];return _0x26ed50;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var logger=require('../../config/logger')(_0xa0a9('0x1'));var moment=require(_0xa0a9('0x2'));var BPromise=require(_0xa0a9('0x3'));var rp=require(_0xa0a9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0a9('0x5'));var config=require(_0xa0a9('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0xa0a9('0x7')]=function(_0xc65bbb,_0x1aa717){return _0xc65bbb[_0xa0a9('0x8')]('UserVoiceQueue',attributes,{'tableName':_0xa0a9('0x9'),'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 bf3cbc9..e009e1f 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 _0x4fa4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring'];(function(_0x39a732,_0x193bec){var _0x47d942=function(_0xb3995e){while(--_0xb3995e){_0x39a732['push'](_0x39a732['shift']());}};_0x47d942(++_0x193bec);}(_0x4fa4,0xba));var _0x44fa=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4fa4[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x44fa('0x0'));var util=require(_0x44fa('0x1'));var moment=require('moment');var BPromise=require(_0x44fa('0x2'));var rs=require(_0x44fa('0x3'));var fs=require('fs');var Redis=require(_0x44fa('0x4'));var db=require(_0x44fa('0x5'))['db'];var utils=require(_0x44fa('0x6'));var logger=require(_0x44fa('0x7'))(_0x44fa('0x8'));var config=require('../../config/environment');var jayson=require(_0x44fa('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f1ac7,_0x2b9c78,_0x23de1b){return new BPromise(function(_0x3bf072,_0x36cef3){return client[_0x44fa('0xa')](_0x4f1ac7,_0x23de1b)[_0x44fa('0xb')](function(_0x12ecde){logger[_0x44fa('0xc')](_0x44fa('0xd'),_0x2b9c78,_0x44fa('0xe'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2b9c78,_0x44fa('0xe'),JSON['stringify'](_0x12ecde));if(_0x12ecde[_0x44fa('0xf')]){if(_0x12ecde[_0x44fa('0xf')][_0x44fa('0x10')]===0x1f4){logger['error'](_0x44fa('0xd'),_0x2b9c78,_0x12ecde[_0x44fa('0xf')]['message']);return _0x36cef3(_0x12ecde[_0x44fa('0xf')][_0x44fa('0x11')]);}logger[_0x44fa('0xf')](_0x44fa('0xd'),_0x2b9c78,_0x12ecde[_0x44fa('0xf')]['message']);return _0x3bf072(_0x12ecde[_0x44fa('0xf')][_0x44fa('0x11')]);}else{logger[_0x44fa('0xc')](_0x44fa('0xd'),_0x2b9c78,_0x44fa('0xe'));_0x3bf072(_0x12ecde[_0x44fa('0x12')][_0x44fa('0x11')]);}})['catch'](function(_0x4da671){logger[_0x44fa('0xf')](_0x44fa('0xd'),_0x2b9c78,_0x4da671);_0x36cef3(_0x4da671);});});} \ No newline at end of file +var _0x42e4=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment'];(function(_0x2a71c0,_0x4a1b8f){var _0x3745b6=function(_0x4841a8){while(--_0x4841a8){_0x2a71c0['push'](_0x2a71c0['shift']());}};_0x3745b6(++_0x4a1b8f);}(_0x42e4,0x1cc));var _0x442e=function(_0x3e8925,_0x426a92){_0x3e8925=_0x3e8925-0x0;var _0x448cbf=_0x42e4[_0x3e8925];return _0x448cbf;};'use strict';var _=require('lodash');var util=require(_0x442e('0x0'));var moment=require(_0x442e('0x1'));var BPromise=require(_0x442e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x442e('0x3'))['db'];var utils=require(_0x442e('0x4'));var logger=require(_0x442e('0x5'))(_0x442e('0x6'));var config=require(_0x442e('0x7'));var jayson=require(_0x442e('0x8'));var client=jayson['client'][_0x442e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xad3992,_0x4d3683,_0x148624){return new BPromise(function(_0x23cc33,_0x32fdb3){return client[_0x442e('0xa')](_0xad3992,_0x148624)[_0x442e('0xb')](function(_0x3fc593){logger[_0x442e('0xc')](_0x442e('0xd'),_0x4d3683,_0x442e('0xe'));logger['debug'](_0x442e('0xf'),_0x4d3683,_0x442e('0xe'),JSON['stringify'](_0x3fc593));if(_0x3fc593[_0x442e('0x10')]){if(_0x3fc593[_0x442e('0x10')][_0x442e('0x11')]===0x1f4){logger[_0x442e('0x10')](_0x442e('0xd'),_0x4d3683,_0x3fc593[_0x442e('0x10')][_0x442e('0x12')]);return _0x32fdb3(_0x3fc593[_0x442e('0x10')][_0x442e('0x12')]);}logger[_0x442e('0x10')](_0x442e('0xd'),_0x4d3683,_0x3fc593[_0x442e('0x10')][_0x442e('0x12')]);return _0x23cc33(_0x3fc593['error'][_0x442e('0x12')]);}else{logger['info'](_0x442e('0xd'),_0x4d3683,_0x442e('0xe'));_0x23cc33(_0x3fc593[_0x442e('0x13')][_0x442e('0x12')]);}})[_0x442e('0x14')](function(_0x5aa50f){logger[_0x442e('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x4d3683,_0x5aa50f);_0x32fdb3(_0x5aa50f);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 3dbae10..5a406ed 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 _0x2c4d=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2c4d,0x188));var _0xd2c4=function(_0x5cd23e,_0x20777b){_0x5cd23e=_0x5cd23e-0x0;var _0x216550=_0x2c4d[_0x5cd23e];return _0x216550;};'use strict';var multer=require(_0xd2c4('0x0'));var util=require('util');var path=require(_0xd2c4('0x1'));var timeout=require(_0xd2c4('0x2'));var express=require(_0xd2c4('0x3'));var router=express[_0xd2c4('0x4')]();var auth=require(_0xd2c4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd2c4('0x6'));module[_0xd2c4('0x7')]=router; \ No newline at end of file +var _0xc7e8=['exports','multer','connect-timeout','express','../../config/environment'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xc7e8,0x10f));var _0x8c7e=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0xc7e8[_0x4b91c4];return _0x25cb80;};'use strict';var multer=require(_0x8c7e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8c7e('0x1'));var express=require(_0x8c7e('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8c7e('0x3'));module[_0x8c7e('0x4')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 1fb3b78..f4aa10b 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 _0xd3f9=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','INTEGER'];(function(_0x51ea60,_0x2949f5){var _0xdd732=function(_0x9448b8){while(--_0x9448b8){_0x51ea60['push'](_0x51ea60['shift']());}};_0xdd732(++_0x2949f5);}(_0xd3f9,0xf3));var _0x9d3f=function(_0x449b86,_0x67f117){_0x449b86=_0x449b86-0x0;var _0x52a227=_0xd3f9[_0x449b86];return _0x52a227;};'use strict';var Sequelize=require(_0x9d3f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9d3f('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9d3f('0x2')},'membername':{'type':Sequelize[_0x9d3f('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x9d3f('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9d3f('0x3')],'allowNull':![],'unique':_0x9d3f('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x9d3f('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x9d3f('0x3')],'allowNull':![],'unique':_0x9d3f('0x4'),'comment':_0x9d3f('0x2')},'penalty':{'type':Sequelize[_0x9d3f('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x9d3f('0x2')}}; \ No newline at end of file +var _0xe7a8=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x28741e,_0x488691){var _0x5b94bb=function(_0x18a6a8){while(--_0x18a6a8){_0x28741e['push'](_0x28741e['shift']());}};_0x5b94bb(++_0x488691);}(_0xe7a8,0x16d));var _0x8e7a=function(_0x3d3531,_0x1e4748){_0x3d3531=_0x3d3531-0x0;var _0x299781=_0xe7a8[_0x3d3531];return _0x299781;};'use strict';var Sequelize=require(_0x8e7a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8e7a('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x8e7a('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x8e7a('0x3')],'allowNull':![],'unique':_0x8e7a('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x8e7a('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8e7a('0x4'),'comment':_0x8e7a('0x2')},'penalty':{'type':Sequelize[_0x8e7a('0x1')](0xb),'defaultValue':0x0,'comment':_0x8e7a('0x2')},'paused':{'type':Sequelize[_0x8e7a('0x1')](0xb),'defaultValue':0x0,'comment':_0x8e7a('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 8b1b7ad..06280f5 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 _0xc613=['hook','exports','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x175697,_0x8c0f37){var _0x14493c=function(_0x19a55d){while(--_0x19a55d){_0x175697['push'](_0x175697['shift']());}};_0x14493c(++_0x8c0f37);}(_0xc613,0x64));var _0x3c61=function(_0x7ec477,_0x402b71){_0x7ec477=_0x7ec477-0x0;var _0x57098d=_0xc613[_0x7ec477];return _0x57098d;};'use strict';var EventEmitter=require(_0x3c61('0x0'));var UserVoiceQueueRt=require(_0x3c61('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3c61('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3c61('0x3'),'afterDestroy':'remove'};function emitEvent(_0x53ebd1){return function(_0x3b4bfc,_0x272a3a,_0x16d65a){UserVoiceQueueRtEvents[_0x3c61('0x4')](_0x53ebd1+':'+_0x3b4bfc['id'],_0x3b4bfc);UserVoiceQueueRtEvents['emit'](_0x53ebd1,_0x3b4bfc);_0x16d65a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x3c61('0x5')](e,emitEvent(event));}}module[_0x3c61('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x85e7=['UserVoiceQueueRt','save','update','emit','hook','exports','events','../../mysqldb'];(function(_0x4b4d08,_0x2dd246){var _0x15cd66=function(_0x5b9915){while(--_0x5b9915){_0x4b4d08['push'](_0x4b4d08['shift']());}};_0x15cd66(++_0x2dd246);}(_0x85e7,0x1e6));var _0x785e=function(_0x178d6d,_0x54ad61){_0x178d6d=_0x178d6d-0x0;var _0xba0226=_0x85e7[_0x178d6d];return _0xba0226;};'use strict';var EventEmitter=require(_0x785e('0x0'));var UserVoiceQueueRt=require(_0x785e('0x1'))['db'][_0x785e('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x785e('0x3'),'afterUpdate':_0x785e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5357a2){return function(_0x2e3204,_0x49de9c,_0x5a4bba){UserVoiceQueueRtEvents['emit'](_0x5357a2+':'+_0x2e3204['id'],_0x2e3204);UserVoiceQueueRtEvents[_0x785e('0x5')](_0x5357a2,_0x2e3204);_0x5a4bba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x785e('0x6')](e,emitEvent(event));}}module[_0x785e('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 96d07df..1c0499e 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 _0x6a81=['api','moment','bluebird','request-promise','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','util','../../config/logger'];(function(_0x813b91,_0x133e32){var _0x4f13cb=function(_0x7a6973){while(--_0x7a6973){_0x813b91['push'](_0x813b91['shift']());}};_0x4f13cb(++_0x133e32);}(_0x6a81,0x1c5));var _0x16a8=function(_0x7ad0f8,_0x5b660e){_0x7ad0f8=_0x7ad0f8-0x0;var _0x215e03=_0x6a81[_0x7ad0f8];return _0x215e03;};'use strict';var _=require(_0x16a8('0x0'));var util=require(_0x16a8('0x1'));var logger=require(_0x16a8('0x2'))(_0x16a8('0x3'));var moment=require(_0x16a8('0x4'));var BPromise=require(_0x16a8('0x5'));var rp=require(_0x16a8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16a8('0x7'));var config=require('../../config/environment');var attributes=require(_0x16a8('0x8'));module[_0x16a8('0x9')]=function(_0x466247,_0x3403fa){return _0x466247[_0x16a8('0xa')](_0x16a8('0xb'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b55=['../../config/environment','./userVoiceQueueRt.attributes','exports','user_has_voice_queues_rt','lodash','util','api','request-promise','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2b55,0x1c6));var _0x52b5=function(_0xbe354d,_0x49ff69){_0xbe354d=_0xbe354d-0x0;var _0x4c2dfe=_0x2b55[_0xbe354d];return _0x4c2dfe;};'use strict';var _=require(_0x52b5('0x0'));var util=require(_0x52b5('0x1'));var logger=require('../../config/logger')(_0x52b5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x52b5('0x3'));var fs=require('fs');var path=require(_0x52b5('0x4'));var rimraf=require('rimraf');var config=require(_0x52b5('0x5'));var attributes=require(_0x52b5('0x6'));module[_0x52b5('0x7')]=function(_0x4f363b,_0x2efbd7){return _0x4f363b['define']('UserVoiceQueueRt',attributes,{'tableName':_0x52b5('0x8'),'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 8a9f2b6..a0e7548 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 _0x7e14=['sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','COUNT'];(function(_0x2f87b,_0x28514b){var _0x21a0b9=function(_0x22261d){while(--_0x22261d){_0x2f87b['push'](_0x2f87b['shift']());}};_0x21a0b9(++_0x28514b);}(_0x7e14,0x1d9));var _0x47e1=function(_0x489ac6,_0x10c52a){_0x489ac6=_0x489ac6-0x0;var _0x2e2ca9=_0x7e14[_0x489ac6];return _0x2e2ca9;};'use strict';var _=require(_0x47e1('0x0'));var util=require(_0x47e1('0x1'));var moment=require('moment');var BPromise=require(_0x47e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47e1('0x3'))['db'];var utils=require(_0x47e1('0x4'));var logger=require('../../config/logger')(_0x47e1('0x5'));var config=require(_0x47e1('0x6'));var jayson=require(_0x47e1('0x7'));var client=jayson[_0x47e1('0x8')]['http']({'port':0x232a});config['redis']=_[_0x47e1('0x9')](config['redis'],{'host':_0x47e1('0xa'),'port':0x18eb});var socket=require(_0x47e1('0xb'))(new Redis(config[_0x47e1('0xc')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x4a1cf8,_0x5bdba2,_0x28ffb4){return new BPromise(function(_0x532a3a,_0xcb59ad){return client[_0x47e1('0xd')](_0x4a1cf8,_0x28ffb4)[_0x47e1('0xe')](function(_0x4f432d){logger['info'](_0x47e1('0xf'),_0x5bdba2,_0x47e1('0x10'));logger[_0x47e1('0x11')](_0x47e1('0x12'),_0x5bdba2,_0x47e1('0x10'),JSON['stringify'](_0x4f432d));if(_0x4f432d['error']){if(_0x4f432d['error'][_0x47e1('0x13')]===0x1f4){logger[_0x47e1('0x14')](_0x47e1('0xf'),_0x5bdba2,_0x4f432d[_0x47e1('0x14')][_0x47e1('0x15')]);return _0xcb59ad(_0x4f432d[_0x47e1('0x14')][_0x47e1('0x15')]);}logger['error'](_0x47e1('0xf'),_0x5bdba2,_0x4f432d[_0x47e1('0x14')][_0x47e1('0x15')]);return _0x532a3a(_0x4f432d[_0x47e1('0x14')][_0x47e1('0x15')]);}else{logger[_0x47e1('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5bdba2,_0x47e1('0x10'));_0x532a3a(_0x4f432d[_0x47e1('0x17')][_0x47e1('0x15')]);}})[_0x47e1('0x18')](function(_0x34ef64){logger[_0x47e1('0x14')](_0x47e1('0xf'),_0x5bdba2,_0x34ef64);_0xcb59ad(_0x34ef64);});});}exports[_0x47e1('0x19')]=function(_0x521c13){var _0x36b7dc=this;return new Promise(function(_0x3f9844,_0x2baad6){return db[_0x47e1('0x1a')][_0x47e1('0x1b')]({'raw':_0x521c13['options']?_0x521c13[_0x47e1('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x521c13[_0x47e1('0x1c')]?_0x521c13[_0x47e1('0x1c')][_0x47e1('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0x47e1('0x1e'),db[_0x47e1('0x1f')]['fn']('IF',db[_0x47e1('0x1f')][_0x47e1('0x20')](_0x47e1('0x21')))),_0x47e1('0x22')]]})[_0x47e1('0xe')](function(_0x589553){logger[_0x47e1('0x16')]('GetVoiceQueueRtPauses',_0x521c13);logger[_0x47e1('0x11')]('GetVoiceQueueRtPauses',_0x521c13,JSON[_0x47e1('0x23')](_0x589553));_0x3f9844(_0x589553);})[_0x47e1('0x18')](function(_0x5cf9bf){logger[_0x47e1('0x14')](_0x47e1('0x19'),_0x5cf9bf[_0x47e1('0x15')],_0x521c13);_0x2baad6(_0x36b7dc[_0x47e1('0x14')](0x1f4,_0x5cf9bf[_0x47e1('0x15')]));});});}; \ No newline at end of file +var _0xc791=['raw','where','sequelize','COUNT','literal','outboundQueuePauses','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','request\x20sent','result','catch','GetVoiceQueueRtPauses','findAll','options'];(function(_0x32a4cf,_0x515527){var _0x4f5f3f=function(_0x47196c){while(--_0x47196c){_0x32a4cf['push'](_0x32a4cf['shift']());}};_0x4f5f3f(++_0x515527);}(_0xc791,0x80));var _0x1c79=function(_0x5316d4,_0x3e273a){_0x5316d4=_0x5316d4-0x0;var _0x590f57=_0xc791[_0x5316d4];return _0x590f57;};'use strict';var _=require(_0x1c79('0x0'));var util=require(_0x1c79('0x1'));var moment=require(_0x1c79('0x2'));var BPromise=require(_0x1c79('0x3'));var rs=require(_0x1c79('0x4'));var fs=require('fs');var Redis=require(_0x1c79('0x5'));var db=require(_0x1c79('0x6'))['db'];var utils=require(_0x1c79('0x7'));var logger=require(_0x1c79('0x8'))(_0x1c79('0x9'));var config=require('../../config/environment');var jayson=require(_0x1c79('0xa'));var client=jayson[_0x1c79('0xb')][_0x1c79('0xc')]({'port':0x232a});config[_0x1c79('0xd')]=_[_0x1c79('0xe')](config[_0x1c79('0xd')],{'host':_0x1c79('0xf'),'port':0x18eb});var socket=require(_0x1c79('0x10'))(new Redis(config[_0x1c79('0xd')]));require(_0x1c79('0x11'))[_0x1c79('0x12')](socket);function respondWithRpcPromise(_0x4ddc8d,_0x465853,_0x6f7d5){return new BPromise(function(_0x1a98b6,_0x551c2c){return client['request'](_0x4ddc8d,_0x6f7d5)[_0x1c79('0x13')](function(_0x40ba77){logger[_0x1c79('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x465853,'request\x20sent');logger['debug'](_0x1c79('0x15'),_0x465853,'request\x20sent',JSON['stringify'](_0x40ba77));if(_0x40ba77['error']){if(_0x40ba77[_0x1c79('0x16')][_0x1c79('0x17')]===0x1f4){logger[_0x1c79('0x16')](_0x1c79('0x18'),_0x465853,_0x40ba77[_0x1c79('0x16')][_0x1c79('0x19')]);return _0x551c2c(_0x40ba77[_0x1c79('0x16')][_0x1c79('0x19')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x465853,_0x40ba77[_0x1c79('0x16')]['message']);return _0x1a98b6(_0x40ba77['error']['message']);}else{logger[_0x1c79('0x14')](_0x1c79('0x18'),_0x465853,_0x1c79('0x1a'));_0x1a98b6(_0x40ba77[_0x1c79('0x1b')][_0x1c79('0x19')]);}})[_0x1c79('0x1c')](function(_0x18bc8d){logger['error'](_0x1c79('0x18'),_0x465853,_0x18bc8d);_0x551c2c(_0x18bc8d);});});}exports[_0x1c79('0x1d')]=function(_0x495050){var _0x57ef58=this;return new Promise(function(_0x22a103,_0x58fd39){return db['UserVoiceQueueRt'][_0x1c79('0x1e')]({'raw':_0x495050[_0x1c79('0x1f')]?_0x495050[_0x1c79('0x1f')][_0x1c79('0x20')]===undefined?!![]:![]:!![],'where':_0x495050['options']?_0x495050['options'][_0x1c79('0x21')]||null:null,'attributes':[[db[_0x1c79('0x22')]['fn'](_0x1c79('0x23'),db['sequelize']['fn']('IF',db[_0x1c79('0x22')][_0x1c79('0x24')]('`paused`\x20=\x201,\x201,\x20null'))),_0x1c79('0x25')]]})[_0x1c79('0x13')](function(_0xde6cac){logger['info']('GetVoiceQueueRtPauses',_0x495050);logger[_0x1c79('0x26')](_0x1c79('0x1d'),_0x495050,JSON[_0x1c79('0x27')](_0xde6cac));_0x22a103(_0xde6cac);})[_0x1c79('0x1c')](function(_0x4d9d17){logger[_0x1c79('0x16')](_0x1c79('0x1d'),_0x4d9d17[_0x1c79('0x19')],_0x495050);_0x58fd39(_0x57ef58['error'](0x1f4,_0x4d9d17['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 8364cf6..f79d520 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 _0x1e8f=['userVoiceQueueRt:','save','remove','update','emit','removeListener','register','length'];(function(_0x34bcbf,_0x529caf){var _0x4951ee=function(_0x22734c){while(--_0x22734c){_0x34bcbf['push'](_0x34bcbf['shift']());}};_0x4951ee(++_0x529caf);}(_0x1e8f,0x119));var _0xf1e8=function(_0x18da58,_0x514339){_0x18da58=_0x18da58-0x0;var _0x5d12d7=_0x1e8f[_0x18da58];return _0x5d12d7;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xf1e8('0x0'),_0xf1e8('0x1'),_0xf1e8('0x2')];function createListener(_0x2e9847,_0x55916b){return function(_0x5ef1f7){_0x55916b[_0xf1e8('0x3')](_0x2e9847,_0x5ef1f7);};}function removeListener(_0x4bf87a,_0x5bdce2){return function(){UserVoiceQueueRtEvents[_0xf1e8('0x4')](_0x4bf87a,_0x5bdce2);};}exports[_0xf1e8('0x5')]=function(_0x34e5fa){for(var _0x56b27b=0x0,_0x4885d9=events[_0xf1e8('0x6')];_0x56b27b<_0x4885d9;_0x56b27b++){var _0x56df6d=events[_0x56b27b];var _0x33709b=createListener(_0xf1e8('0x7')+_0x56df6d,_0x34e5fa);UserVoiceQueueRtEvents['on'](_0x56df6d,_0x33709b);}}; \ No newline at end of file +var _0x8f80=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x25c8aa,_0x25ee75){var _0x47b440=function(_0x40b0f0){while(--_0x40b0f0){_0x25c8aa['push'](_0x25c8aa['shift']());}};_0x47b440(++_0x25ee75);}(_0x8f80,0x187));var _0x08f8=function(_0x57d534,_0x3a2041){_0x57d534=_0x57d534-0x0;var _0xdac558=_0x8f80[_0x57d534];return _0xdac558;};'use strict';var UserVoiceQueueRtEvents=require(_0x08f8('0x0'));var events=[_0x08f8('0x1'),_0x08f8('0x2'),_0x08f8('0x3')];function createListener(_0x439bbe,_0x5e5ffa){return function(_0x270d99){_0x5e5ffa[_0x08f8('0x4')](_0x439bbe,_0x270d99);};}function removeListener(_0x1ed3df,_0x2e6a0e){return function(){UserVoiceQueueRtEvents[_0x08f8('0x5')](_0x1ed3df,_0x2e6a0e);};}exports[_0x08f8('0x6')]=function(_0x400638){for(var _0x1c45f4=0x0,_0xe242c0=events[_0x08f8('0x7')];_0x1c45f4<_0xe242c0;_0x1c45f4++){var _0x2f205b=events[_0x1c45f4];var _0x3350d1=createListener(_0x08f8('0x8')+_0x2f205b,_0x400638);UserVoiceQueueRtEvents['on'](_0x2f205b,_0x3350d1);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 4763d70..d4148fb 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 _0x2217=['get','isAuthenticated','index','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./variable.controller'];(function(_0x2d071a,_0x4f7442){var _0x46e5a1=function(_0x2b67a2){while(--_0x2b67a2){_0x2d071a['push'](_0x2d071a['shift']());}};_0x46e5a1(++_0x4f7442);}(_0x2217,0xf9));var _0x7221=function(_0x318fef,_0x33235a){_0x318fef=_0x318fef-0x0;var _0x26d02c=_0x2217[_0x318fef];return _0x26d02c;};'use strict';var multer=require(_0x7221('0x0'));var util=require(_0x7221('0x1'));var path=require(_0x7221('0x2'));var timeout=require(_0x7221('0x3'));var express=require(_0x7221('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7221('0x5'));var controller=require(_0x7221('0x6'));router[_0x7221('0x7')]('/',auth[_0x7221('0x8')](),controller[_0x7221('0x9')]);router[_0x7221('0x7')](_0x7221('0xa'),auth['isAuthenticated'](),controller[_0x7221('0xb')]);router[_0x7221('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7221('0xa'),auth[_0x7221('0x8')](),controller[_0x7221('0xd')]);router['delete'](_0x7221('0xa'),auth['isAuthenticated'](),controller[_0x7221('0xe')]);module[_0x7221('0xf')]=router; \ No newline at end of file +var _0x50a5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','post','create','put','/:id','exports','multer','util','path','express','Router'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0x50a5,0x1e8));var _0x550a=function(_0x34e59f,_0x549173){_0x34e59f=_0x34e59f-0x0;var _0x42461f=_0x50a5[_0x34e59f];return _0x42461f;};'use strict';var multer=require(_0x550a('0x0'));var util=require(_0x550a('0x1'));var path=require(_0x550a('0x2'));var timeout=require('connect-timeout');var express=require(_0x550a('0x3'));var router=express[_0x550a('0x4')]();var auth=require(_0x550a('0x5'));var interaction=require(_0x550a('0x6'));var config=require(_0x550a('0x7'));var controller=require(_0x550a('0x8'));router[_0x550a('0x9')]('/',auth[_0x550a('0xa')](),controller[_0x550a('0xb')]);router['get']('/:id',auth[_0x550a('0xa')](),controller['show']);router[_0x550a('0xc')]('/',auth[_0x550a('0xa')](),controller[_0x550a('0xd')]);router[_0x550a('0xe')](_0x550a('0xf'),auth[_0x550a('0xa')](),controller['update']);router['delete'](_0x550a('0xf'),auth[_0x550a('0xa')](),controller['destroy']);module[_0x550a('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 05e3cf3..7f9bbc4 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 _0x0464=['sequelize','exports','STRING'];(function(_0x4724ba,_0x372142){var _0x3c2f63=function(_0x44f80b){while(--_0x44f80b){_0x4724ba['push'](_0x4724ba['shift']());}};_0x3c2f63(++_0x372142);}(_0x0464,0xe7));var _0x4046=function(_0x1fe9a5,_0x559dfc){_0x1fe9a5=_0x1fe9a5-0x0;var _0x492d3e=_0x0464[_0x1fe9a5];return _0x492d3e;};'use strict';var Sequelize=require(_0x4046('0x0'));module[_0x4046('0x1')]={'name':{'type':Sequelize[_0x4046('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4046('0x2')]}}; \ No newline at end of file +var _0xcacf=['STRING','name','sequelize'];(function(_0x11f9fe,_0x5e3648){var _0x291b9e=function(_0x3413b1){while(--_0x3413b1){_0x11f9fe['push'](_0x11f9fe['shift']());}};_0x291b9e(++_0x5e3648);}(_0xcacf,0x134));var _0xfcac=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xcacf[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0xfcac('0x0'));module['exports']={'name':{'type':Sequelize[_0xfcac('0x1')],'unique':_0xfcac('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfcac('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 21098f8..d1f52a9 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 _0x3456=['includeAll','include','findAll','catch','show','intersection','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Variables','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','stack','name','rawAttributes','type','key','model','map','keys','attributes','fields','length','query','hasOwnProperty','order','sort','filters','filter','options','where','Variable'];(function(_0x58cc40,_0x183602){var _0x19f72b=function(_0x26cc96){while(--_0x26cc96){_0x58cc40['push'](_0x58cc40['shift']());}};_0x19f72b(++_0x183602);}(_0x3456,0x193));var _0x6345=function(_0x4ddfe1,_0x35939d){_0x4ddfe1=_0x4ddfe1-0x0;var _0x4aaf51=_0x3456[_0x4ddfe1];return _0x4aaf51;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6345('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6345('0x1'));var jsonpatch=require(_0x6345('0x2'));var rp=require(_0x6345('0x3'));var moment=require(_0x6345('0x4'));var BPromise=require(_0x6345('0x5'));var Mustache=require(_0x6345('0x6'));var util=require(_0x6345('0x7'));var path=require(_0x6345('0x8'));var sox=require(_0x6345('0x9'));var csv=require(_0x6345('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6345('0xb'));var squel=require(_0x6345('0xc'));var crypto=require('crypto');var jsforce=require(_0x6345('0xd'));var deskjs=require(_0x6345('0xe'));var toCsv=require(_0x6345('0xa'));var querystring=require('querystring');var Papa=require(_0x6345('0xf'));var Redis=require(_0x6345('0x10'));var authService=require(_0x6345('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6345('0x12'));var logger=require('../../config/logger')(_0x6345('0x13'));var utils=require(_0x6345('0x14'));var config=require(_0x6345('0x15'));var db=require(_0x6345('0x16'))['db'];function respondWithStatusCode(_0x5b7ede,_0x130099){_0x130099=_0x130099||0xcc;return function(_0x5274bf){if(_0x5274bf){return _0x5b7ede[_0x6345('0x17')](_0x130099);}return _0x5b7ede[_0x6345('0x18')](_0x130099)[_0x6345('0x19')]();};}function respondWithResult(_0x5e7cdb,_0x28dd7b){_0x28dd7b=_0x28dd7b||0xc8;return function(_0x5b4d1c){if(_0x5b4d1c){return _0x5e7cdb[_0x6345('0x18')](_0x28dd7b)[_0x6345('0x1a')](_0x5b4d1c);}};}function respondWithFilteredResult(_0x11dfaf,_0x280d93){return function(_0x9a2848){if(_0x9a2848){var _0x573453=_0x9a2848[_0x6345('0x1b')],_0xadc522=_0x280d93[_0x6345('0x1c')],_0x5cfc10=_0x280d93[_0x6345('0x1c')]+_0x280d93[_0x6345('0x1d')],_0x25fb92;if(_0x5cfc10>=_0x573453){_0x5cfc10=_0x573453;_0x25fb92=0xc8;}else{_0x25fb92=0xce;}_0x11dfaf[_0x6345('0x18')](_0x25fb92);return _0x11dfaf[_0x6345('0x1e')](_0x6345('0x1f'),_0xadc522+'-'+_0x5cfc10+'/'+_0x573453)[_0x6345('0x1a')](_0x9a2848);}return null;};}function patchUpdates(_0x430b06){return function(_0x50ed16){try{jsonpatch[_0x6345('0x20')](_0x50ed16,_0x430b06,!![]);}catch(_0xd9fe1b){return BPromise['reject'](_0xd9fe1b);}return _0x50ed16['save']();};}function saveUpdates(_0x508f8e,_0xb1bf9d){return function(_0x3155e0){if(_0x3155e0){return _0x3155e0[_0x6345('0x21')](_0x508f8e)[_0x6345('0x22')](function(_0x142297){return _0x142297;});}return null;};}function removeEntity(_0x14dec8,_0x3d3f34){return function(_0x3300f4){if(_0x3300f4){return _0x3300f4[_0x6345('0x23')]()[_0x6345('0x22')](function(){var _0x36dbcd=_0x3300f4[_0x6345('0x24')]({'plain':!![]});var _0x35448e='Variables';return db[_0x6345('0x25')][_0x6345('0x23')]({'where':{'type':_0x35448e,'resourceId':_0x36dbcd['id']}})[_0x6345('0x22')](function(){return _0x3300f4;});})['then'](function(){_0x14dec8[_0x6345('0x18')](0xcc)[_0x6345('0x19')]();});}};}function handleEntityNotFound(_0x1e6e06,_0x3222ae){return function(_0x50b1e5){if(!_0x50b1e5){_0x1e6e06[_0x6345('0x17')](0x194);}return _0x50b1e5;};}function handleError(_0x57e822,_0xebbb04){_0xebbb04=_0xebbb04||0x1f4;return function(_0x39ea31){logger[_0x6345('0x26')](_0x39ea31[_0x6345('0x27')]);if(_0x39ea31[_0x6345('0x28')]){delete _0x39ea31[_0x6345('0x28')];}_0x57e822['status'](_0xebbb04)['send'](_0x39ea31);};}exports['index']=function(_0xf6e467,_0x3f2e05){var _0x5dafee={},_0x1b5963={},_0x2f012a={'count':0x0,'rows':[]};var _0x3281f3=_['map'](db['Variable'][_0x6345('0x29')],function(_0x3cf159){return{'name':_0x3cf159['fieldName'],'type':_0x3cf159[_0x6345('0x2a')][_0x6345('0x2b')]};});_0x1b5963[_0x6345('0x2c')]=_[_0x6345('0x2d')](_0x3281f3,_0x6345('0x28'));_0x1b5963['query']=_[_0x6345('0x2e')](_0xf6e467['query']);_0x1b5963['filters']=_['intersection'](_0x1b5963[_0x6345('0x2c')],_0x1b5963['query']);_0x5dafee[_0x6345('0x2f')]=_['intersection'](_0x1b5963[_0x6345('0x2c')],qs[_0x6345('0x30')](_0xf6e467['query'][_0x6345('0x30')]));_0x5dafee[_0x6345('0x2f')]=_0x5dafee['attributes'][_0x6345('0x31')]?_0x5dafee['attributes']:_0x1b5963[_0x6345('0x2c')];if(!_0xf6e467[_0x6345('0x32')][_0x6345('0x33')]('nolimit')){_0x5dafee['limit']=qs[_0x6345('0x1d')](_0xf6e467[_0x6345('0x32')][_0x6345('0x1d')]);_0x5dafee[_0x6345('0x1c')]=qs[_0x6345('0x1c')](_0xf6e467['query'][_0x6345('0x1c')]);}_0x5dafee[_0x6345('0x34')]=qs[_0x6345('0x35')](_0xf6e467[_0x6345('0x32')][_0x6345('0x35')]);_0x5dafee['where']=qs[_0x6345('0x36')](_['pick'](_0xf6e467['query'],_0x1b5963[_0x6345('0x36')]));if(_0xf6e467[_0x6345('0x32')][_0x6345('0x37')]){_0x5dafee['where']=_['merge'](_0x5dafee['where'],{'$or':_[_0x6345('0x2d')](_0x3281f3,function(_0x2df55e){if(_0x2df55e[_0x6345('0x2a')]!=='VIRTUAL'){var _0x191bbe={};_0x191bbe[_0x2df55e[_0x6345('0x28')]]={'$like':'%'+_0xf6e467[_0x6345('0x32')][_0x6345('0x37')]+'%'};return _0x191bbe;}})});}_0x5dafee=_['merge']({},_0x5dafee,_0xf6e467[_0x6345('0x38')]);var _0x521198={'where':_0x5dafee[_0x6345('0x39')]};return db[_0x6345('0x3a')][_0x6345('0x1b')](_0x521198)[_0x6345('0x22')](function(_0x4195d7){_0x2f012a['count']=_0x4195d7;if(_0xf6e467[_0x6345('0x32')][_0x6345('0x3b')]){_0x5dafee[_0x6345('0x3c')]=[{'all':!![]}];}return db[_0x6345('0x3a')][_0x6345('0x3d')](_0x5dafee);})['then'](function(_0x48ac76){_0x2f012a['rows']=_0x48ac76;return _0x2f012a;})[_0x6345('0x22')](respondWithFilteredResult(_0x3f2e05,_0x5dafee))[_0x6345('0x3e')](handleError(_0x3f2e05,null));};exports[_0x6345('0x3f')]=function(_0xfc17d1,_0x51131c){var _0x71d0e4={'raw':!![],'where':{'id':_0xfc17d1['params']['id']}},_0x423c30={};_0x423c30[_0x6345('0x2c')]=_[_0x6345('0x2e')](db[_0x6345('0x3a')]['rawAttributes']);_0x423c30['query']=_[_0x6345('0x2e')](_0xfc17d1[_0x6345('0x32')]);_0x423c30[_0x6345('0x36')]=_[_0x6345('0x40')](_0x423c30[_0x6345('0x2c')],_0x423c30['query']);_0x71d0e4[_0x6345('0x2f')]=_[_0x6345('0x40')](_0x423c30[_0x6345('0x2c')],qs['fields'](_0xfc17d1[_0x6345('0x32')]['fields']));_0x71d0e4['attributes']=_0x71d0e4[_0x6345('0x2f')][_0x6345('0x31')]?_0x71d0e4[_0x6345('0x2f')]:_0x423c30[_0x6345('0x2c')];if(_0xfc17d1[_0x6345('0x32')]['includeAll']){_0x71d0e4['include']=[{'all':!![]}];}_0x71d0e4=_[_0x6345('0x41')]({},_0x71d0e4,_0xfc17d1[_0x6345('0x38')]);return db[_0x6345('0x3a')][_0x6345('0x42')](_0x71d0e4)[_0x6345('0x22')](handleEntityNotFound(_0x51131c,null))[_0x6345('0x22')](respondWithResult(_0x51131c,null))[_0x6345('0x3e')](handleError(_0x51131c,null));};exports[_0x6345('0x43')]=function(_0x41d6e3,_0x3587bd){return db[_0x6345('0x3a')][_0x6345('0x43')](_0x41d6e3[_0x6345('0x44')],{})[_0x6345('0x22')](function(_0x1f14c1){var _0x4cc0d2=_0x41d6e3[_0x6345('0x45')][_0x6345('0x24')]({'plain':!![]});if(!_0x4cc0d2)throw new Error(_0x6345('0x46'));if(_0x4cc0d2['role']===_0x6345('0x45')){var _0x1e7576=_0x1f14c1[_0x6345('0x24')]({'plain':!![]});var _0x323bd9=_0x6345('0x47');return db[_0x6345('0x48')][_0x6345('0x42')]({'where':{'name':_0x323bd9,'userProfileId':_0x4cc0d2[_0x6345('0x49')]},'raw':!![]})[_0x6345('0x22')](function(_0x380ecb){if(_0x380ecb&&_0x380ecb[_0x6345('0x4a')]===0x0){return db['UserProfileResource'][_0x6345('0x43')]({'name':_0x1e7576[_0x6345('0x28')],'resourceId':_0x1e7576['id'],'type':_0x380ecb[_0x6345('0x28')],'sectionId':_0x380ecb['id']},{})[_0x6345('0x22')](function(){return _0x1f14c1;});}else{return _0x1f14c1;}})[_0x6345('0x3e')](function(_0x5384d5){logger[_0x6345('0x26')](_0x6345('0x4b'),_0x5384d5);throw _0x5384d5;});}return _0x1f14c1;})[_0x6345('0x22')](respondWithResult(_0x3587bd,0xc9))[_0x6345('0x3e')](handleError(_0x3587bd,null));};exports[_0x6345('0x21')]=function(_0x315be6,_0x411f5a){if(_0x315be6[_0x6345('0x44')]['id']){delete _0x315be6['body']['id'];}return db[_0x6345('0x3a')][_0x6345('0x42')]({'where':{'id':_0x315be6['params']['id']}})[_0x6345('0x22')](handleEntityNotFound(_0x411f5a,null))[_0x6345('0x22')](saveUpdates(_0x315be6[_0x6345('0x44')],null))['then'](respondWithResult(_0x411f5a,null))[_0x6345('0x3e')](handleError(_0x411f5a,null));};exports['destroy']=function(_0x2987fc,_0x51dd9b){return db[_0x6345('0x3a')][_0x6345('0x42')]({'where':{'id':_0x2987fc[_0x6345('0x4c')]['id']}})[_0x6345('0x22')](handleEntityNotFound(_0x51dd9b,null))['then'](removeEntity(_0x51dd9b,null))[_0x6345('0x3e')](handleError(_0x51dd9b,null));}; \ No newline at end of file +var _0x1a8f=['../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Variables','UserProfileResource','stack','name','send','map','Variable','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','rows','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x3ea386,_0x4b45f3){var _0x4114e8=function(_0x53c514){while(--_0x53c514){_0x3ea386['push'](_0x3ea386['shift']());}};_0x4114e8(++_0x4b45f3);}(_0x1a8f,0x87));var _0xf1a8=function(_0x50514b,_0x83db65){_0x50514b=_0x50514b-0x0;var _0x5d8587=_0x1a8f[_0x50514b];return _0x5d8587;};'use strict';var pdf=require(_0xf1a8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf1a8('0x1'));var zipdir=require(_0xf1a8('0x2'));var jsonpatch=require(_0xf1a8('0x3'));var rp=require(_0xf1a8('0x4'));var moment=require(_0xf1a8('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf1a8('0x6'));var csv=require(_0xf1a8('0x7'));var ejs=require(_0xf1a8('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf1a8('0x9'));var crypto=require('crypto');var jsforce=require(_0xf1a8('0xa'));var deskjs=require(_0xf1a8('0xb'));var toCsv=require(_0xf1a8('0x7'));var querystring=require('querystring');var Papa=require(_0xf1a8('0xc'));var Redis=require('ioredis');var authService=require(_0xf1a8('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xf1a8('0xe'));var hardwareService=require(_0xf1a8('0xf'));var logger=require(_0xf1a8('0x10'))(_0xf1a8('0x11'));var utils=require('../../config/utils');var config=require(_0xf1a8('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x250103,_0x482274){_0x482274=_0x482274||0xcc;return function(_0x3aef2b){if(_0x3aef2b){return _0x250103[_0xf1a8('0x13')](_0x482274);}return _0x250103[_0xf1a8('0x14')](_0x482274)[_0xf1a8('0x15')]();};}function respondWithResult(_0x2d0965,_0x292f03){_0x292f03=_0x292f03||0xc8;return function(_0x4fbba7){if(_0x4fbba7){return _0x2d0965[_0xf1a8('0x14')](_0x292f03)[_0xf1a8('0x16')](_0x4fbba7);}};}function respondWithFilteredResult(_0x5854c5,_0xd9c1bf){return function(_0x3efcf1){if(_0x3efcf1){var _0x18533d=_0x3efcf1[_0xf1a8('0x17')],_0x65d930=_0xd9c1bf[_0xf1a8('0x18')],_0x7c2937=_0xd9c1bf[_0xf1a8('0x18')]+_0xd9c1bf[_0xf1a8('0x19')],_0x2280f2;if(_0x7c2937>=_0x18533d){_0x7c2937=_0x18533d;_0x2280f2=0xc8;}else{_0x2280f2=0xce;}_0x5854c5[_0xf1a8('0x14')](_0x2280f2);return _0x5854c5[_0xf1a8('0x1a')](_0xf1a8('0x1b'),_0x65d930+'-'+_0x7c2937+'/'+_0x18533d)['json'](_0x3efcf1);}return null;};}function patchUpdates(_0x159d9d){return function(_0x35a6f3){try{jsonpatch[_0xf1a8('0x1c')](_0x35a6f3,_0x159d9d,!![]);}catch(_0x22420e){return BPromise[_0xf1a8('0x1d')](_0x22420e);}return _0x35a6f3['save']();};}function saveUpdates(_0xd2839,_0x5a558a){return function(_0x1205bb){if(_0x1205bb){return _0x1205bb[_0xf1a8('0x1e')](_0xd2839)[_0xf1a8('0x1f')](function(_0x366b72){return _0x366b72;});}return null;};}function removeEntity(_0x32ada6,_0x1b0fc0){return function(_0x40bf24){if(_0x40bf24){return _0x40bf24[_0xf1a8('0x20')]()['then'](function(){var _0x3a284c=_0x40bf24[_0xf1a8('0x21')]({'plain':!![]});var _0x1fa221=_0xf1a8('0x22');return db[_0xf1a8('0x23')]['destroy']({'where':{'type':_0x1fa221,'resourceId':_0x3a284c['id']}})[_0xf1a8('0x1f')](function(){return _0x40bf24;});})[_0xf1a8('0x1f')](function(){_0x32ada6[_0xf1a8('0x14')](0xcc)[_0xf1a8('0x15')]();});}};}function handleEntityNotFound(_0x4b90a5,_0x2db901){return function(_0x4f843d){if(!_0x4f843d){_0x4b90a5[_0xf1a8('0x13')](0x194);}return _0x4f843d;};}function handleError(_0xd75dfb,_0x2903c8){_0x2903c8=_0x2903c8||0x1f4;return function(_0x5ef78e){logger['error'](_0x5ef78e[_0xf1a8('0x24')]);if(_0x5ef78e[_0xf1a8('0x25')]){delete _0x5ef78e[_0xf1a8('0x25')];}_0xd75dfb['status'](_0x2903c8)[_0xf1a8('0x26')](_0x5ef78e);};}exports['index']=function(_0x1424bc,_0x1acbba){var _0x566154={},_0xe6e6e3={},_0x4cf9f1={'count':0x0,'rows':[]};var _0x504563=_[_0xf1a8('0x27')](db[_0xf1a8('0x28')][_0xf1a8('0x29')],function(_0x5f3f5d){return{'name':_0x5f3f5d[_0xf1a8('0x2a')],'type':_0x5f3f5d[_0xf1a8('0x2b')][_0xf1a8('0x2c')]};});_0xe6e6e3['model']=_[_0xf1a8('0x27')](_0x504563,_0xf1a8('0x25'));_0xe6e6e3[_0xf1a8('0x2d')]=_[_0xf1a8('0x2e')](_0x1424bc[_0xf1a8('0x2d')]);_0xe6e6e3[_0xf1a8('0x2f')]=_[_0xf1a8('0x30')](_0xe6e6e3[_0xf1a8('0x31')],_0xe6e6e3[_0xf1a8('0x2d')]);_0x566154[_0xf1a8('0x32')]=_['intersection'](_0xe6e6e3[_0xf1a8('0x31')],qs[_0xf1a8('0x33')](_0x1424bc[_0xf1a8('0x2d')]['fields']));_0x566154['attributes']=_0x566154[_0xf1a8('0x32')][_0xf1a8('0x34')]?_0x566154[_0xf1a8('0x32')]:_0xe6e6e3[_0xf1a8('0x31')];if(!_0x1424bc[_0xf1a8('0x2d')]['hasOwnProperty'](_0xf1a8('0x35'))){_0x566154['limit']=qs[_0xf1a8('0x19')](_0x1424bc[_0xf1a8('0x2d')]['limit']);_0x566154[_0xf1a8('0x18')]=qs[_0xf1a8('0x18')](_0x1424bc[_0xf1a8('0x2d')][_0xf1a8('0x18')]);}_0x566154[_0xf1a8('0x36')]=qs[_0xf1a8('0x37')](_0x1424bc['query'][_0xf1a8('0x37')]);_0x566154[_0xf1a8('0x38')]=qs[_0xf1a8('0x2f')](_['pick'](_0x1424bc[_0xf1a8('0x2d')],_0xe6e6e3[_0xf1a8('0x2f')]));if(_0x1424bc['query'][_0xf1a8('0x39')]){_0x566154[_0xf1a8('0x38')]=_['merge'](_0x566154[_0xf1a8('0x38')],{'$or':_[_0xf1a8('0x27')](_0x504563,function(_0x5e0af1){if(_0x5e0af1[_0xf1a8('0x2b')]!==_0xf1a8('0x3a')){var _0x1be9cf={};_0x1be9cf[_0x5e0af1[_0xf1a8('0x25')]]={'$like':'%'+_0x1424bc['query'][_0xf1a8('0x39')]+'%'};return _0x1be9cf;}})});}_0x566154=_[_0xf1a8('0x3b')]({},_0x566154,_0x1424bc['options']);var _0x19e767={'where':_0x566154['where']};return db[_0xf1a8('0x28')][_0xf1a8('0x17')](_0x19e767)['then'](function(_0x109271){_0x4cf9f1[_0xf1a8('0x17')]=_0x109271;if(_0x1424bc[_0xf1a8('0x2d')][_0xf1a8('0x3c')]){_0x566154[_0xf1a8('0x3d')]=[{'all':!![]}];}return db[_0xf1a8('0x28')]['findAll'](_0x566154);})[_0xf1a8('0x1f')](function(_0x48e8ca){_0x4cf9f1[_0xf1a8('0x3e')]=_0x48e8ca;return _0x4cf9f1;})[_0xf1a8('0x1f')](respondWithFilteredResult(_0x1acbba,_0x566154))[_0xf1a8('0x3f')](handleError(_0x1acbba,null));};exports['show']=function(_0x159a9c,_0x127328){var _0x3d2769={'raw':!![],'where':{'id':_0x159a9c[_0xf1a8('0x40')]['id']}},_0x3796e6={};_0x3796e6[_0xf1a8('0x31')]=_['keys'](db[_0xf1a8('0x28')]['rawAttributes']);_0x3796e6[_0xf1a8('0x2d')]=_[_0xf1a8('0x2e')](_0x159a9c[_0xf1a8('0x2d')]);_0x3796e6[_0xf1a8('0x2f')]=_[_0xf1a8('0x30')](_0x3796e6[_0xf1a8('0x31')],_0x3796e6[_0xf1a8('0x2d')]);_0x3d2769[_0xf1a8('0x32')]=_[_0xf1a8('0x30')](_0x3796e6[_0xf1a8('0x31')],qs[_0xf1a8('0x33')](_0x159a9c[_0xf1a8('0x2d')][_0xf1a8('0x33')]));_0x3d2769[_0xf1a8('0x32')]=_0x3d2769[_0xf1a8('0x32')][_0xf1a8('0x34')]?_0x3d2769[_0xf1a8('0x32')]:_0x3796e6[_0xf1a8('0x31')];if(_0x159a9c[_0xf1a8('0x2d')]['includeAll']){_0x3d2769[_0xf1a8('0x3d')]=[{'all':!![]}];}_0x3d2769=_['merge']({},_0x3d2769,_0x159a9c[_0xf1a8('0x41')]);return db[_0xf1a8('0x28')][_0xf1a8('0x42')](_0x3d2769)[_0xf1a8('0x1f')](handleEntityNotFound(_0x127328,null))['then'](respondWithResult(_0x127328,null))[_0xf1a8('0x3f')](handleError(_0x127328,null));};exports[_0xf1a8('0x43')]=function(_0x2da253,_0x4bb994){return db[_0xf1a8('0x28')][_0xf1a8('0x43')](_0x2da253[_0xf1a8('0x44')],{})[_0xf1a8('0x1f')](function(_0x44c330){var _0xf69e59=_0x2da253[_0xf1a8('0x45')][_0xf1a8('0x21')]({'plain':!![]});if(!_0xf69e59)throw new Error(_0xf1a8('0x46'));if(_0xf69e59[_0xf1a8('0x47')]==='user'){var _0x3b4e06=_0x44c330[_0xf1a8('0x21')]({'plain':!![]});var _0x4c2da3=_0xf1a8('0x22');return db[_0xf1a8('0x48')][_0xf1a8('0x42')]({'where':{'name':_0x4c2da3,'userProfileId':_0xf69e59[_0xf1a8('0x49')]},'raw':!![]})[_0xf1a8('0x1f')](function(_0xdc48ee){if(_0xdc48ee&&_0xdc48ee[_0xf1a8('0x4a')]===0x0){return db[_0xf1a8('0x23')][_0xf1a8('0x43')]({'name':_0x3b4e06['name'],'resourceId':_0x3b4e06['id'],'type':_0xdc48ee[_0xf1a8('0x25')],'sectionId':_0xdc48ee['id']},{})[_0xf1a8('0x1f')](function(){return _0x44c330;});}else{return _0x44c330;}})[_0xf1a8('0x3f')](function(_0x4ea297){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ea297);throw _0x4ea297;});}return _0x44c330;})['then'](respondWithResult(_0x4bb994,0xc9))[_0xf1a8('0x3f')](handleError(_0x4bb994,null));};exports[_0xf1a8('0x1e')]=function(_0x257ca9,_0x1c677f){if(_0x257ca9[_0xf1a8('0x44')]['id']){delete _0x257ca9[_0xf1a8('0x44')]['id'];}return db[_0xf1a8('0x28')][_0xf1a8('0x42')]({'where':{'id':_0x257ca9[_0xf1a8('0x40')]['id']}})['then'](handleEntityNotFound(_0x1c677f,null))[_0xf1a8('0x1f')](saveUpdates(_0x257ca9[_0xf1a8('0x44')],null))['then'](respondWithResult(_0x1c677f,null))[_0xf1a8('0x3f')](handleError(_0x1c677f,null));};exports['destroy']=function(_0xb4f2e,_0x12e667){return db['Variable'][_0xf1a8('0x42')]({'where':{'id':_0xb4f2e[_0xf1a8('0x40')]['id']}})[_0xf1a8('0x1f')](handleEntityNotFound(_0x12e667,null))['then'](removeEntity(_0x12e667,null))['catch'](handleError(_0x12e667,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 094f7a4..740dae1 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 _0x4a06=['path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4251b4,_0x1d43ca){var _0x1a86c4=function(_0x24bc04){while(--_0x24bc04){_0x4251b4['push'](_0x4251b4['shift']());}};_0x1a86c4(++_0x1d43ca);}(_0x4a06,0x1f2));var _0x64a0=function(_0x406f2d,_0x4fbbbb){_0x406f2d=_0x406f2d-0x0;var _0x180641=_0x4a06[_0x406f2d];return _0x180641;};'use strict';var _=require(_0x64a0('0x0'));var util=require(_0x64a0('0x1'));var logger=require(_0x64a0('0x2'))(_0x64a0('0x3'));var moment=require(_0x64a0('0x4'));var BPromise=require(_0x64a0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64a0('0x6'));var rimraf=require(_0x64a0('0x7'));var config=require(_0x64a0('0x8'));var attributes=require(_0x64a0('0x9'));module[_0x64a0('0xa')]=function(_0xba1d8f,_0x37464e){return _0xba1d8f[_0x64a0('0xb')](_0x64a0('0xc'),attributes,{'tableName':_0x64a0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e69=['tools_variables','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable'];(function(_0x459d7d,_0x55db19){var _0x26abf1=function(_0x39e5d5){while(--_0x39e5d5){_0x459d7d['push'](_0x459d7d['shift']());}};_0x26abf1(++_0x55db19);}(_0x1e69,0x85));var _0x91e6=function(_0x3ad2be,_0x36fe53){_0x3ad2be=_0x3ad2be-0x0;var _0xefbd6a=_0x1e69[_0x3ad2be];return _0xefbd6a;};'use strict';var _=require('lodash');var util=require(_0x91e6('0x0'));var logger=require(_0x91e6('0x1'))(_0x91e6('0x2'));var moment=require(_0x91e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x91e6('0x4'));var rimraf=require(_0x91e6('0x5'));var config=require(_0x91e6('0x6'));var attributes=require(_0x91e6('0x7'));module[_0x91e6('0x8')]=function(_0x42fe90,_0x4091b8){return _0x42fe90[_0x91e6('0x9')](_0x91e6('0xa'),attributes,{'tableName':_0x91e6('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 d2b539e..729e9a7 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 _0x428a=['then','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','raw','where','map','include','model','attributes'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x428a,0x6b));var _0xa428=function(_0x45b4b8,_0x3e8e11){_0x45b4b8=_0x45b4b8-0x0;var _0x99a54e=_0x428a[_0x45b4b8];return _0x99a54e;};'use strict';var _=require(_0xa428('0x0'));var util=require(_0xa428('0x1'));var moment=require(_0xa428('0x2'));var BPromise=require(_0xa428('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa428('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa428('0x5'));var logger=require(_0xa428('0x6'))(_0xa428('0x7'));var config=require(_0xa428('0x8'));var jayson=require(_0xa428('0x9'));var client=jayson[_0xa428('0xa')][_0xa428('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a0141,_0x47324f,_0x53a569){return new BPromise(function(_0x3070f8,_0x18d92a){return client[_0xa428('0xc')](_0x3a0141,_0x53a569)['then'](function(_0x4bdf39){logger[_0xa428('0xd')](_0xa428('0xe'),_0x47324f,_0xa428('0xf'));logger[_0xa428('0x10')](_0xa428('0x11'),_0x47324f,_0xa428('0xf'),JSON[_0xa428('0x12')](_0x4bdf39));if(_0x4bdf39[_0xa428('0x13')]){if(_0x4bdf39[_0xa428('0x13')][_0xa428('0x14')]===0x1f4){logger[_0xa428('0x13')](_0xa428('0xe'),_0x47324f,_0x4bdf39['error'][_0xa428('0x15')]);return _0x18d92a(_0x4bdf39[_0xa428('0x13')][_0xa428('0x15')]);}logger[_0xa428('0x13')]('Variable,\x20%s,\x20%s',_0x47324f,_0x4bdf39[_0xa428('0x13')]['message']);return _0x3070f8(_0x4bdf39[_0xa428('0x13')][_0xa428('0x15')]);}else{logger[_0xa428('0xd')](_0xa428('0xe'),_0x47324f,_0xa428('0xf'));_0x3070f8(_0x4bdf39[_0xa428('0x16')]['message']);}})['catch'](function(_0x5d31ad){logger[_0xa428('0x13')]('Variable,\x20%s,\x20%s',_0x47324f,_0x5d31ad);_0x18d92a(_0x5d31ad);});});}exports[_0xa428('0x17')]=function(_0x1554e9){var _0x2979a2=this;return new Promise(function(_0xef8d72,_0x19b6a4){return db[_0xa428('0x18')][_0xa428('0x19')]({'raw':_0x1554e9[_0xa428('0x1a')]?_0x1554e9[_0xa428('0x1a')][_0xa428('0x1b')]===undefined?!![]:![]:!![],'where':_0x1554e9[_0xa428('0x1a')]?_0x1554e9[_0xa428('0x1a')][_0xa428('0x1c')]||null:null,'attributes':_0x1554e9[_0xa428('0x1a')]?_0x1554e9[_0xa428('0x1a')]['attributes']||null:null,'include':_0x1554e9['options']?_0x1554e9[_0xa428('0x1a')]['include']?_[_0xa428('0x1d')](_0x1554e9[_0xa428('0x1a')][_0xa428('0x1e')],function(_0x229c25){return{'model':db[_0x229c25[_0xa428('0x1f')]],'as':_0x229c25['as'],'attributes':_0x229c25[_0xa428('0x20')],'include':_0x229c25[_0xa428('0x1e')]?_['map'](_0x229c25[_0xa428('0x1e')],function(_0x2e41af){return{'model':db[_0x2e41af[_0xa428('0x1f')]],'as':_0x2e41af['as'],'attributes':_0x2e41af[_0xa428('0x20')],'include':_0x2e41af['include']?_[_0xa428('0x1d')](_0x2e41af[_0xa428('0x1e')],function(_0x35348a){return{'model':db[_0x35348a[_0xa428('0x1f')]],'as':_0x35348a['as'],'attributes':_0x35348a[_0xa428('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa428('0x21')](function(_0x2ed457){logger[_0xa428('0xd')](_0xa428('0x17'),_0x1554e9);logger[_0xa428('0x10')](_0xa428('0x17'),_0x1554e9,JSON[_0xa428('0x12')](_0x2ed457));_0xef8d72(_0x2ed457);})[_0xa428('0x22')](function(_0x3fd055){logger[_0xa428('0x13')](_0xa428('0x17'),_0x3fd055[_0xa428('0x15')],_0x1554e9);_0x19b6a4(_0x2979a2['error'](0x1f4,_0x3fd055[_0xa428('0x15')]));});});}; \ No newline at end of file +var _0xbcc8=['error','code','message','info','catch','ShowVariable','Variable','options','raw','attributes','include','map','model','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xeb4b98,_0x214d34){var _0x34c6b4=function(_0x381455){while(--_0x381455){_0xeb4b98['push'](_0xeb4b98['shift']());}};_0x34c6b4(++_0x214d34);}(_0xbcc8,0x67));var _0x8bcc=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0xbcc8[_0x1b2255];return _0x33e57d;};'use strict';var _=require('lodash');var util=require(_0x8bcc('0x0'));var moment=require(_0x8bcc('0x1'));var BPromise=require(_0x8bcc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bcc('0x3'))['db'];var utils=require(_0x8bcc('0x4'));var logger=require(_0x8bcc('0x5'))('rpc');var config=require(_0x8bcc('0x6'));var jayson=require(_0x8bcc('0x7'));var client=jayson[_0x8bcc('0x8')][_0x8bcc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x420743,_0x54ac79,_0x3dda72){return new BPromise(function(_0x384c7e,_0x5400c1){return client[_0x8bcc('0xa')](_0x420743,_0x3dda72)[_0x8bcc('0xb')](function(_0x58a7fe){logger['info'](_0x8bcc('0xc'),_0x54ac79,_0x8bcc('0xd'));logger[_0x8bcc('0xe')](_0x8bcc('0xf'),_0x54ac79,_0x8bcc('0xd'),JSON[_0x8bcc('0x10')](_0x58a7fe));if(_0x58a7fe[_0x8bcc('0x11')]){if(_0x58a7fe[_0x8bcc('0x11')][_0x8bcc('0x12')]===0x1f4){logger[_0x8bcc('0x11')](_0x8bcc('0xc'),_0x54ac79,_0x58a7fe[_0x8bcc('0x11')]['message']);return _0x5400c1(_0x58a7fe[_0x8bcc('0x11')]['message']);}logger[_0x8bcc('0x11')](_0x8bcc('0xc'),_0x54ac79,_0x58a7fe[_0x8bcc('0x11')][_0x8bcc('0x13')]);return _0x384c7e(_0x58a7fe[_0x8bcc('0x11')][_0x8bcc('0x13')]);}else{logger[_0x8bcc('0x14')]('Variable,\x20%s,\x20%s',_0x54ac79,_0x8bcc('0xd'));_0x384c7e(_0x58a7fe['result'][_0x8bcc('0x13')]);}})[_0x8bcc('0x15')](function(_0x120340){logger[_0x8bcc('0x11')]('Variable,\x20%s,\x20%s',_0x54ac79,_0x120340);_0x5400c1(_0x120340);});});}exports[_0x8bcc('0x16')]=function(_0x3e4c7a){var _0x198f89=this;return new Promise(function(_0x139ad9,_0x3cf688){return db[_0x8bcc('0x17')]['find']({'raw':_0x3e4c7a['options']?_0x3e4c7a[_0x8bcc('0x18')][_0x8bcc('0x19')]===undefined?!![]:![]:!![],'where':_0x3e4c7a[_0x8bcc('0x18')]?_0x3e4c7a[_0x8bcc('0x18')]['where']||null:null,'attributes':_0x3e4c7a['options']?_0x3e4c7a[_0x8bcc('0x18')][_0x8bcc('0x1a')]||null:null,'include':_0x3e4c7a[_0x8bcc('0x18')]?_0x3e4c7a[_0x8bcc('0x18')][_0x8bcc('0x1b')]?_[_0x8bcc('0x1c')](_0x3e4c7a['options'][_0x8bcc('0x1b')],function(_0x2d3e78){return{'model':db[_0x2d3e78[_0x8bcc('0x1d')]],'as':_0x2d3e78['as'],'attributes':_0x2d3e78['attributes'],'include':_0x2d3e78['include']?_['map'](_0x2d3e78[_0x8bcc('0x1b')],function(_0x1e6c24){return{'model':db[_0x1e6c24[_0x8bcc('0x1d')]],'as':_0x1e6c24['as'],'attributes':_0x1e6c24[_0x8bcc('0x1a')],'include':_0x1e6c24['include']?_[_0x8bcc('0x1c')](_0x1e6c24[_0x8bcc('0x1b')],function(_0x21adef){return{'model':db[_0x21adef[_0x8bcc('0x1d')]],'as':_0x21adef['as'],'attributes':_0x21adef[_0x8bcc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e0509){logger[_0x8bcc('0x14')](_0x8bcc('0x16'),_0x3e4c7a);logger['debug'](_0x8bcc('0x16'),_0x3e4c7a,JSON[_0x8bcc('0x10')](_0x4e0509));_0x139ad9(_0x4e0509);})['catch'](function(_0x4c3cab){logger[_0x8bcc('0x11')](_0x8bcc('0x16'),_0x4c3cab[_0x8bcc('0x13')],_0x3e4c7a);_0x3cf688(_0x198f89[_0x8bcc('0x11')](0x1f4,_0x4c3cab['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 6c18f7b..4187950 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 _0x6788=['get','index','isAuthenticated','canUpdate','fetch','reset','/pull','pull','restart','/migrations','migrations','express','../../components/auth/service','./version.controller'];(function(_0x30101b,_0x21e6de){var _0x3149a5=function(_0x58157d){while(--_0x58157d){_0x30101b['push'](_0x30101b['shift']());}};_0x3149a5(++_0x21e6de);}(_0x6788,0x1bd));var _0x8678=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x6788[_0x178e48];return _0x440d7e;};'use strict';var express=require(_0x8678('0x0'));var router=express['Router']();var auth=require(_0x8678('0x1'));var controller=require(_0x8678('0x2'));router[_0x8678('0x3')]('/',controller[_0x8678('0x4')]);router[_0x8678('0x3')]('/fetch',auth[_0x8678('0x5')](),auth[_0x8678('0x6')](),controller[_0x8678('0x7')]);router[_0x8678('0x3')]('/reset',auth[_0x8678('0x5')](),auth['canUpdate'](),controller[_0x8678('0x8')]);router[_0x8678('0x3')](_0x8678('0x9'),auth['isAuthenticated'](),auth[_0x8678('0x6')](),controller[_0x8678('0xa')]);router[_0x8678('0x3')]('/restart',auth[_0x8678('0x5')](),controller[_0x8678('0xb')]);router[_0x8678('0x3')](_0x8678('0xc'),controller[_0x8678('0xd')]);module['exports']=router; \ No newline at end of file +var _0x46df=['isAuthenticated','canUpdate','/pull','/restart','restart','migrations','exports','express','./version.controller','get','index'];(function(_0x2a8b21,_0x5cd96b){var _0x114314=function(_0xd17a7){while(--_0xd17a7){_0x2a8b21['push'](_0x2a8b21['shift']());}};_0x114314(++_0x5cd96b);}(_0x46df,0x1e0));var _0xf46d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x46df[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0xf46d('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xf46d('0x1'));router[_0xf46d('0x2')]('/',controller[_0xf46d('0x3')]);router['get']('/fetch',auth[_0xf46d('0x4')](),auth['canUpdate'](),controller['fetch']);router['get']('/reset',auth['isAuthenticated'](),auth[_0xf46d('0x5')](),controller['reset']);router[_0xf46d('0x2')](_0xf46d('0x6'),auth[_0xf46d('0x4')](),auth[_0xf46d('0x5')](),controller['pull']);router['get'](_0xf46d('0x7'),auth['isAuthenticated'](),controller[_0xf46d('0x8')]);router['get']('/migrations',controller[_0xf46d('0x9')]);module[_0xf46d('0xa')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index ffb81d6..bac3613 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 _0x8952=['git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','root','server','length','.js','sort','Migration','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','exports','query','fetch','latest','2.0.0','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD'];(function(_0x247249,_0x13c7fd){var _0x252ca4=function(_0x5b7f47){while(--_0x5b7f47){_0x247249['push'](_0x247249['shift']());}};_0x252ca4(++_0x13c7fd);}(_0x8952,0x17e));var _0x2895=function(_0x3f9665,_0x12148d){_0x3f9665=_0x3f9665-0x0;var _0x8e858b=_0x8952[_0x3f9665];return _0x8e858b;};'use strict';var Umzug=require('umzug');var path=require(_0x2895('0x0'));var fs=require('fs');var _=require(_0x2895('0x1'));var pkginfo=require(_0x2895('0x2'))(module,_0x2895('0x3'));var compareVersions=require(_0x2895('0x4'));var exec=require('child_process')[_0x2895('0x5')];var db=require(_0x2895('0x6'))['db'];var config=require(_0x2895('0x7'));var pm2=require('../../config/pm2');var logger=require(_0x2895('0x8'))(_0x2895('0x9'));var git=require(_0x2895('0xa'))(config['root']);exports['index']=function(_0x238b4a,_0x335002){var _0x159f86={'current':module[_0x2895('0xb')][_0x2895('0x3')],'phonebar':0x2};if(_0x238b4a['query']&&_0x238b4a[_0x2895('0xc')]['latest']){return git[_0x2895('0xd')]()['tags'](function(_0x5e66fc,_0x56c5b9){_0x159f86[_0x2895('0xe')]=(_0x5e66fc?module[_0x2895('0xb')][_0x2895('0x3')]:_0x56c5b9['latest'])||_0x2895('0xf');return _0x335002[_0x2895('0x10')](0xc8)['json'](_0x159f86);});}else{return _0x335002[_0x2895('0x10')](0xc8)[_0x2895('0x11')](_0x159f86);}};exports['fetch']=function(_0x590a1b,_0x1d1493){return git[_0x2895('0xd')](['origin',_0x2895('0x12')],function(_0xd8192e){if(_0xd8192e){logger[_0x2895('0x13')](_0xd8192e);return _0x1d1493[_0x2895('0x10')](0x1f4)[_0x2895('0x11')](_0xd8192e);}logger[_0x2895('0x14')](_0x2895('0x15'));return _0x1d1493[_0x2895('0x10')](0xc8)[_0x2895('0x11')]({'output':_0x2895('0x16')});});};exports[_0x2895('0x17')]=function(_0x183b05,_0xbf8b63){return git[_0x2895('0x17')]([_0x2895('0x18'),_0x2895('0x19')],function(_0x2fe8fe){if(_0x2fe8fe){logger[_0x2895('0x13')](_0x2fe8fe);return _0xbf8b63['status'](0x1f4)['json'](_0x2fe8fe);}logger['info'](_0x2895('0x1a'));return _0xbf8b63[_0x2895('0x10')](0xc8)[_0x2895('0x11')]({'output':'git\x20reset\x20--hard'});});};exports[_0x2895('0x1b')]=function(_0x190b79,_0x2743b5){exec(_0x2895('0x1c'),function(_0x8b75e0,_0x5dbbfe,_0x30c6c3){logger[_0x2895('0x14')](_0x5dbbfe);logger['info'](_0x30c6c3);if(_0x8b75e0){logger[_0x2895('0x13')](_0x8b75e0);return _0x2743b5[_0x2895('0x10')](0x1f4)[_0x2895('0x11')](_0x8b75e0);}return _0x2743b5['status'](0xc8)['json']({'output':_0x5dbbfe});});};exports[_0x2895('0x1d')]=function(_0x4569b5,_0x23b0eb){return pm2['restart'](_0x2895('0x1e'))[_0x2895('0x1f')](function(_0x480604){logger[_0x2895('0x14')](_0x2895('0x20'),_0x480604);return _0x23b0eb[_0x2895('0x10')](0xc8)['json']({'output':_0x2895('0x21')});})[_0x2895('0x22')](function(_0x5eedfc){logger[_0x2895('0x13')](_0x5eedfc);return _0x23b0eb['status'](0x1f4)['json'](_0x5eedfc);});};exports[_0x2895('0x23')]=function(_0x4ee2cc,_0xfa4f85){var _0x381538=fs['readdirSync'](path['join'](config[_0x2895('0x24')],_0x2895('0x25'),_0x2895('0x23')));var _0x14e343=[];for(var _0x14d150=0x0;_0x14d150<_0x381538[_0x2895('0x26')];_0x14d150++){var _0x34e110=_0x381538[_0x14d150]['replace'](_0x2895('0x27'),'');if(compareVersions(module[_0x2895('0xb')][_0x2895('0x3')],_0x34e110)===-0x1){_0x14e343['push'](_0x34e110);}}if(_0x14e343[_0x2895('0x26')]){var _0x458a55=_0x14e343[_0x2895('0x28')](compareVersions);var _0x35a2e8=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x2895('0x29')],'modelName':_0x2895('0x29'),'columnName':_0x2895('0x3')},'migrations':{'params':[db[_0x2895('0x2a')][_0x2895('0x2b')](),db['sequelize']['constructor'],function(){throw new Error(_0x2895('0x2c'));}],'path':path[_0x2895('0x2d')](config['root'],_0x2895('0x25'),'migrations'),'pattern':/\.js$/}});_0x35a2e8['up']({'migrations':_[_0x2895('0x2e')](_0x458a55,function(_0x3f73e1){return _0x3f73e1+'.js';})})[_0x2895('0x1f')](function(){return _0xfa4f85['status'](0xc8)[_0x2895('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x2895('0x3')]+_0x2895('0x2f')+_[_0x2895('0x30')](_0x458a55),'migrations':_['join'](_0x458a55)});})[_0x2895('0x22')](function(_0x15772b){if(_0x15772b instanceof db[_0x2895('0x2a')][_0x2895('0x31')]){return _0xfa4f85[_0x2895('0x10')](0xc8)[_0x2895('0x11')]({'output':_0x2895('0x32')});}else{return _0xfa4f85[_0x2895('0x10')](0x1f4)[_0x2895('0x11')](_0x15772b);}});}else{return _0xfa4f85[_0x2895('0x10')](0xc8)['json']({'output':_0x2895('0x32')});}}; \ No newline at end of file +var _0x9e2e=['getQueryInterface','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','Database\x20already\x20up-to-date','umzug','path','lodash','version','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','query','latest','fetch','exports','status','json','origin','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','info','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','length','replace','.js','push','sort','Migration'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x2b5a55,_0x54bd23){_0x2b5a55=_0x2b5a55-0x0;var _0x2f41cb=_0x9e2e[_0x2b5a55];return _0x2f41cb;};'use strict';var Umzug=require(_0xe9e2('0x0'));var path=require(_0xe9e2('0x1'));var fs=require('fs');var _=require(_0xe9e2('0x2'));var pkginfo=require('pkginfo')(module,_0xe9e2('0x3'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0xe9e2('0x4')];var db=require(_0xe9e2('0x5'))['db'];var config=require(_0xe9e2('0x6'));var pm2=require(_0xe9e2('0x7'));var logger=require(_0xe9e2('0x8'))(_0xe9e2('0x9'));var git=require(_0xe9e2('0xa'))(config['root']);exports[_0xe9e2('0xb')]=function(_0x4f1ef7,_0x2bec58){var _0x1ade12={'current':module['exports'][_0xe9e2('0x3')],'phonebar':0x2};if(_0x4f1ef7[_0xe9e2('0xc')]&&_0x4f1ef7['query'][_0xe9e2('0xd')]){return git[_0xe9e2('0xe')]()['tags'](function(_0x53e3c5,_0x116094){_0x1ade12[_0xe9e2('0xd')]=(_0x53e3c5?module[_0xe9e2('0xf')][_0xe9e2('0x3')]:_0x116094['latest'])||'2.0.0';return _0x2bec58[_0xe9e2('0x10')](0xc8)[_0xe9e2('0x11')](_0x1ade12);});}else{return _0x2bec58[_0xe9e2('0x10')](0xc8)[_0xe9e2('0x11')](_0x1ade12);}};exports[_0xe9e2('0xe')]=function(_0x23331d,_0x41ea08){return git[_0xe9e2('0xe')]([_0xe9e2('0x12'),_0xe9e2('0x13')],function(_0x58f329){if(_0x58f329){logger['error'](_0x58f329);return _0x41ea08[_0xe9e2('0x10')](0x1f4)['json'](_0x58f329);}logger['info'](_0xe9e2('0x14'));return _0x41ea08[_0xe9e2('0x10')](0xc8)[_0xe9e2('0x11')]({'output':_0xe9e2('0x15')});});};exports[_0xe9e2('0x16')]=function(_0x25d70f,_0x5f3fc8){return git[_0xe9e2('0x16')]([_0xe9e2('0x17'),_0xe9e2('0x18')],function(_0x5b804f){if(_0x5b804f){logger[_0xe9e2('0x19')](_0x5b804f);return _0x5f3fc8[_0xe9e2('0x10')](0x1f4)[_0xe9e2('0x11')](_0x5b804f);}logger['info'](_0xe9e2('0x1a'));return _0x5f3fc8[_0xe9e2('0x10')](0xc8)[_0xe9e2('0x11')]({'output':'git\x20reset\x20--hard'});});};exports[_0xe9e2('0x1b')]=function(_0x36c8a3,_0x456455){exec(_0xe9e2('0x1c'),function(_0x5bb286,_0x183680,_0x1655fe){logger[_0xe9e2('0x1d')](_0x183680);logger[_0xe9e2('0x1d')](_0x1655fe);if(_0x5bb286){logger[_0xe9e2('0x19')](_0x5bb286);return _0x456455[_0xe9e2('0x10')](0x1f4)[_0xe9e2('0x11')](_0x5bb286);}return _0x456455[_0xe9e2('0x10')](0xc8)[_0xe9e2('0x11')]({'output':_0x183680});});};exports[_0xe9e2('0x1e')]=function(_0x1c22f6,_0x2e8577){return pm2[_0xe9e2('0x1e')](_0xe9e2('0x1f'))[_0xe9e2('0x20')](function(_0x1bf061){logger[_0xe9e2('0x1d')]('pm2\x20restart\x20motion\x20%s',_0x1bf061);return _0x2e8577[_0xe9e2('0x10')](0xc8)[_0xe9e2('0x11')]({'output':_0xe9e2('0x21')});})[_0xe9e2('0x22')](function(_0x57254c){logger[_0xe9e2('0x19')](_0x57254c);return _0x2e8577[_0xe9e2('0x10')](0x1f4)[_0xe9e2('0x11')](_0x57254c);});};exports[_0xe9e2('0x23')]=function(_0x257a3a,_0x4fc1ce){var _0x4cf43f=fs[_0xe9e2('0x24')](path[_0xe9e2('0x25')](config[_0xe9e2('0x26')],_0xe9e2('0x27'),_0xe9e2('0x23')));var _0x42b8ca=[];for(var _0x5da7b3=0x0;_0x5da7b3<_0x4cf43f[_0xe9e2('0x28')];_0x5da7b3++){var _0x546961=_0x4cf43f[_0x5da7b3][_0xe9e2('0x29')](_0xe9e2('0x2a'),'');if(compareVersions(module[_0xe9e2('0xf')][_0xe9e2('0x3')],_0x546961)===-0x1){_0x42b8ca[_0xe9e2('0x2b')](_0x546961);}}if(_0x42b8ca['length']){var _0x5331aa=_0x42b8ca[_0xe9e2('0x2c')](compareVersions);var _0xecccbc=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xe9e2('0x2d')],'modelName':_0xe9e2('0x2d'),'columnName':_0xe9e2('0x3')},'migrations':{'params':[db['sequelize'][_0xe9e2('0x2e')](),db[_0xe9e2('0x2f')][_0xe9e2('0x30')],function(){throw new Error(_0xe9e2('0x31'));}],'path':path['join'](config[_0xe9e2('0x26')],_0xe9e2('0x27'),_0xe9e2('0x23')),'pattern':/\.js$/}});_0xecccbc['up']({'migrations':_['map'](_0x5331aa,function(_0x47e133){return _0x47e133+_0xe9e2('0x2a');})})[_0xe9e2('0x20')](function(){return _0x4fc1ce[_0xe9e2('0x10')](0xc8)[_0xe9e2('0x11')]({'output':_0xe9e2('0x32')+module[_0xe9e2('0xf')][_0xe9e2('0x3')]+'\x20to\x20'+_['last'](_0x5331aa),'migrations':_[_0xe9e2('0x25')](_0x5331aa)});})['catch'](function(_0x33ea98){if(_0x33ea98 instanceof db[_0xe9e2('0x2f')]['UniqueConstraintError']){return _0x4fc1ce[_0xe9e2('0x10')](0xc8)[_0xe9e2('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x4fc1ce[_0xe9e2('0x10')](0x1f4)[_0xe9e2('0x11')](_0x33ea98);}});}else{return _0x4fc1ce['status'](0xc8)['json']({'output':_0xe9e2('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 851d380..beb74ae 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 _0xb686=['describe','/:id','show','post','put','update','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','get','/describe'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xb686,0x181));var _0x6b68=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xb686[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x6b68('0x0'));var util=require(_0x6b68('0x1'));var path=require(_0x6b68('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6b68('0x3')]();var auth=require(_0x6b68('0x4'));var interaction=require(_0x6b68('0x5'));var config=require(_0x6b68('0x6'));var controller=require(_0x6b68('0x7'));router['get']('/',auth[_0x6b68('0x8')](),controller['index']);router[_0x6b68('0x9')](_0x6b68('0xa'),auth['isAuthenticated'](),controller[_0x6b68('0xb')]);router[_0x6b68('0x9')](_0x6b68('0xc'),auth[_0x6b68('0x8')](),controller[_0x6b68('0xd')]);router[_0x6b68('0xe')]('/',auth[_0x6b68('0x8')](),controller['create']);router[_0x6b68('0xf')](_0x6b68('0xc'),auth['isAuthenticated'](),controller[_0x6b68('0x10')]);router['delete'](_0x6b68('0xc'),auth['isAuthenticated'](),controller[_0x6b68('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9f6b=['multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','put','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9f6b,0x12c));var _0xb9f6=function(_0x56a40d,_0x931121){_0x56a40d=_0x56a40d-0x0;var _0xc9b722=_0x9f6b[_0x56a40d];return _0xc9b722;};'use strict';var multer=require(_0xb9f6('0x0'));var util=require(_0xb9f6('0x1'));var path=require(_0xb9f6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb9f6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb9f6('0x4'));var config=require(_0xb9f6('0x5'));var controller=require(_0xb9f6('0x6'));router[_0xb9f6('0x7')]('/',auth[_0xb9f6('0x8')](),controller['index']);router['get'](_0xb9f6('0x9'),auth[_0xb9f6('0x8')](),controller[_0xb9f6('0xa')]);router[_0xb9f6('0x7')](_0xb9f6('0xb'),auth[_0xb9f6('0x8')](),controller[_0xb9f6('0xc')]);router['post']('/',auth[_0xb9f6('0x8')](),controller['create']);router[_0xb9f6('0xd')](_0xb9f6('0xb'),auth['isAuthenticated'](),controller[_0xb9f6('0xe')]);router['delete']('/:id',auth[_0xb9f6('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index b8ee270..37b1208 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 _0x55ca=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55ca,0x126));var _0xa55c=function(_0x400096,_0x101dc3){_0x400096=_0x400096-0x0;var _0x31755a=_0x55ca[_0x400096];return _0x31755a;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa55c('0x2')]},'queue':{'type':Sequelize[_0xa55c('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xa55c('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa55c('0x3')]},'agentconnectAt':{'type':Sequelize[_0xa55c('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xa55c('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xa55c('0x3')]},'agentdumpAt':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xa55c('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xa55c('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xa55c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa55c('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa55c('0x2')]},'channelstate':{'type':Sequelize[_0xa55c('0x4')]},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xa55c('0x2')]},'transfer':{'type':Sequelize[_0xa55c('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa55c('0x2')],'comment':_0xa55c('0x6')},'transferexten':{'type':Sequelize[_0xa55c('0x2')]},'transferuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'agententerreason':{'type':Sequelize[_0xa55c('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x814b=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x414df0,_0x3b902f){var _0x2cf357=function(_0x528c3c){while(--_0x528c3c){_0x414df0['push'](_0x414df0['shift']());}};_0x2cf357(++_0x3b902f);}(_0x814b,0x1a2));var _0xb814=function(_0x1ce236,_0xca922e){_0x1ce236=_0x1ce236-0x0;var _0x241819=_0x814b[_0x1ce236];return _0x241819;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'type':{'type':Sequelize[_0xb814('0x2')]},'uniqueid':{'type':Sequelize[_0xb814('0x2')]},'calleridnum':{'type':Sequelize[_0xb814('0x2')]},'calleridname':{'type':Sequelize[_0xb814('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xb814('0x2')]},'membername':{'type':Sequelize[_0xb814('0x2')]},'agentcalledAt':{'type':Sequelize[_0xb814('0x3')]},'agentconnectAt':{'type':Sequelize[_0xb814('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xb814('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xb814('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xb814('0x4')]},'agentcomplete':{'type':Sequelize[_0xb814('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb814('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb814('0x4')]},'agentacw':{'type':Sequelize[_0xb814('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb814('0x4')]},'reason':{'type':Sequelize[_0xb814('0x2')]},'lastevent':{'type':Sequelize[_0xb814('0x2')]},'channel':{'type':Sequelize[_0xb814('0x2')]},'channelstate':{'type':Sequelize[_0xb814('0x4')]},'channelstatedesc':{'type':Sequelize[_0xb814('0x2')]},'connectedlinenum':{'type':Sequelize[_0xb814('0x2')]},'connectedlinename':{'type':Sequelize[_0xb814('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb814('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xb814('0x2')]},'priority':{'type':Sequelize[_0xb814('0x2')]},'destchannel':{'type':Sequelize[_0xb814('0x2')]},'destchannelstate':{'type':Sequelize[_0xb814('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xb814('0x2')]},'destcalleridnum':{'type':Sequelize[_0xb814('0x2')]},'destcalleridname':{'type':Sequelize[_0xb814('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xb814('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb814('0x2')]},'destlanguage':{'type':Sequelize[_0xb814('0x2')]},'destaccountcode':{'type':Sequelize[_0xb814('0x2')]},'destcontext':{'type':Sequelize[_0xb814('0x2')]},'destexten':{'type':Sequelize[_0xb814('0x2')]},'destpriority':{'type':Sequelize[_0xb814('0x2')]},'destuniqueid':{'type':Sequelize[_0xb814('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb814('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xb814('0x2')]},'transfer':{'type':Sequelize[_0xb814('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb814('0x2')],'comment':_0xb814('0x6')},'transferexten':{'type':Sequelize[_0xb814('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xb814('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 67a4b89..42db5eb 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 _0xee31=['squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceAgentReport','findAll','catch','params','length','includeAll','include','find','create','body','describe','html-pdf','eml-format','zip-dir','request-promise','moment','util','sox','ejs'];(function(_0x38e6b4,_0x5bbc24){var _0x4e2379=function(_0x2d7ad0){while(--_0x2d7ad0){_0x38e6b4['push'](_0x38e6b4['shift']());}};_0x4e2379(++_0x5bbc24);}(_0xee31,0x118));var _0x1ee3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xee31[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x1ee3('0x0'));var emlformat=require(_0x1ee3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1ee3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ee3('0x3'));var moment=require(_0x1ee3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1ee3('0x5'));var path=require('path');var sox=require(_0x1ee3('0x6'));var csv=require('to-csv');var ejs=require(_0x1ee3('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1ee3('0x8'));var crypto=require('crypto');var jsforce=require(_0x1ee3('0x9'));var deskjs=require(_0x1ee3('0xa'));var toCsv=require(_0x1ee3('0xb'));var querystring=require(_0x1ee3('0xc'));var Papa=require(_0x1ee3('0xd'));var Redis=require(_0x1ee3('0xe'));var authService=require(_0x1ee3('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ee3('0x10'));var logger=require(_0x1ee3('0x11'))(_0x1ee3('0x12'));var utils=require(_0x1ee3('0x13'));var config=require(_0x1ee3('0x14'));var db=require(_0x1ee3('0x15'))['db'];function respondWithStatusCode(_0x682e86,_0x3d1e19){_0x3d1e19=_0x3d1e19||0xcc;return function(_0x2ccb8b){if(_0x2ccb8b){return _0x682e86[_0x1ee3('0x16')](_0x3d1e19);}return _0x682e86[_0x1ee3('0x17')](_0x3d1e19)['end']();};}function respondWithResult(_0x557211,_0x1bfbdb){_0x1bfbdb=_0x1bfbdb||0xc8;return function(_0x1797bc){if(_0x1797bc){return _0x557211[_0x1ee3('0x17')](_0x1bfbdb)[_0x1ee3('0x18')](_0x1797bc);}};}function respondWithFilteredResult(_0x2e4326,_0xdb9328){return function(_0x4cb351){if(_0x4cb351){var _0x5425af=_0x4cb351[_0x1ee3('0x19')],_0x3f1895=_0xdb9328['offset'],_0x3396f3=_0xdb9328[_0x1ee3('0x1a')]+_0xdb9328[_0x1ee3('0x1b')],_0x1b5ed4;if(_0x3396f3>=_0x5425af){_0x3396f3=_0x5425af;_0x1b5ed4=0xc8;}else{_0x1b5ed4=0xce;}_0x2e4326[_0x1ee3('0x17')](_0x1b5ed4);return _0x2e4326['set'](_0x1ee3('0x1c'),_0x3f1895+'-'+_0x3396f3+'/'+_0x5425af)[_0x1ee3('0x18')](_0x4cb351);}return null;};}function patchUpdates(_0x5c7b2a){return function(_0x444ccb){try{jsonpatch[_0x1ee3('0x1d')](_0x444ccb,_0x5c7b2a,!![]);}catch(_0x22cb9a){return BPromise[_0x1ee3('0x1e')](_0x22cb9a);}return _0x444ccb[_0x1ee3('0x1f')]();};}function saveUpdates(_0x44e766,_0x2cb37a){return function(_0x263cb2){if(_0x263cb2){return _0x263cb2[_0x1ee3('0x20')](_0x44e766)['then'](function(_0x5250fd){return _0x5250fd;});}return null;};}function removeEntity(_0x12f4db,_0x37df6c){return function(_0x163248){if(_0x163248){return _0x163248[_0x1ee3('0x21')]()[_0x1ee3('0x22')](function(){_0x12f4db[_0x1ee3('0x17')](0xcc)[_0x1ee3('0x23')]();});}};}function handleEntityNotFound(_0x3cd751,_0x2b24e5){return function(_0x43de12){if(!_0x43de12){_0x3cd751[_0x1ee3('0x16')](0x194);}return _0x43de12;};}function handleError(_0x37459c,_0xfa8044){_0xfa8044=_0xfa8044||0x1f4;return function(_0x57aa60){logger[_0x1ee3('0x24')](_0x57aa60['stack']);if(_0x57aa60[_0x1ee3('0x25')]){delete _0x57aa60[_0x1ee3('0x25')];}_0x37459c[_0x1ee3('0x17')](_0xfa8044)[_0x1ee3('0x26')](_0x57aa60);};}exports[_0x1ee3('0x27')]=function(_0xbe1343,_0x52c73b){var _0x418d33={},_0x1aecc2={},_0x3a8dfd={'count':0x0,'rows':[]};var _0x5ace79=_[_0x1ee3('0x28')](db['VoiceAgentReport'][_0x1ee3('0x29')],function(_0x135924){return{'name':_0x135924[_0x1ee3('0x2a')],'type':_0x135924[_0x1ee3('0x2b')]['key']};});_0x1aecc2[_0x1ee3('0x2c')]=_[_0x1ee3('0x28')](_0x5ace79,'name');_0x1aecc2[_0x1ee3('0x2d')]=_[_0x1ee3('0x2e')](_0xbe1343[_0x1ee3('0x2d')]);_0x1aecc2[_0x1ee3('0x2f')]=_[_0x1ee3('0x30')](_0x1aecc2[_0x1ee3('0x2c')],_0x1aecc2[_0x1ee3('0x2d')]);_0x418d33[_0x1ee3('0x31')]=_[_0x1ee3('0x30')](_0x1aecc2['model'],qs[_0x1ee3('0x32')](_0xbe1343[_0x1ee3('0x2d')][_0x1ee3('0x32')]));_0x418d33[_0x1ee3('0x31')]=_0x418d33[_0x1ee3('0x31')]['length']?_0x418d33[_0x1ee3('0x31')]:_0x1aecc2[_0x1ee3('0x2c')];if(!_0xbe1343['query'][_0x1ee3('0x33')](_0x1ee3('0x34'))){_0x418d33[_0x1ee3('0x1b')]=qs[_0x1ee3('0x1b')](_0xbe1343[_0x1ee3('0x2d')][_0x1ee3('0x1b')]);_0x418d33[_0x1ee3('0x1a')]=qs['offset'](_0xbe1343['query'][_0x1ee3('0x1a')]);}_0x418d33[_0x1ee3('0x35')]=qs[_0x1ee3('0x36')](_0xbe1343['query'][_0x1ee3('0x36')]);_0x418d33[_0x1ee3('0x37')]=qs[_0x1ee3('0x2f')](_[_0x1ee3('0x38')](_0xbe1343[_0x1ee3('0x2d')],_0x1aecc2[_0x1ee3('0x2f')]));if(_0xbe1343[_0x1ee3('0x2d')][_0x1ee3('0x39')]){_0x418d33['where']=_['merge'](_0x418d33[_0x1ee3('0x37')],{'$or':_[_0x1ee3('0x28')](_0x5ace79,function(_0x49e403){if(_0x49e403['type']!==_0x1ee3('0x3a')){var _0x583281={};_0x583281[_0x49e403[_0x1ee3('0x25')]]={'$like':'%'+_0xbe1343[_0x1ee3('0x2d')][_0x1ee3('0x39')]+'%'};return _0x583281;}})});}_0x418d33=_[_0x1ee3('0x3b')]({},_0x418d33,_0xbe1343[_0x1ee3('0x3c')]);var _0x1e34f6={'where':_0x418d33[_0x1ee3('0x37')]};return db[_0x1ee3('0x3d')][_0x1ee3('0x19')](_0x1e34f6)[_0x1ee3('0x22')](function(_0x22f2e8){_0x3a8dfd[_0x1ee3('0x19')]=_0x22f2e8;if(_0xbe1343[_0x1ee3('0x2d')]['includeAll']){_0x418d33['include']=[{'all':!![]}];}return db[_0x1ee3('0x3d')][_0x1ee3('0x3e')](_0x418d33);})[_0x1ee3('0x22')](function(_0x32732a){_0x3a8dfd['rows']=_0x32732a;return _0x3a8dfd;})[_0x1ee3('0x22')](respondWithFilteredResult(_0x52c73b,_0x418d33))[_0x1ee3('0x3f')](handleError(_0x52c73b,null));};exports['show']=function(_0x2e3421,_0x4bf509){var _0x2ad645={'raw':![],'where':{'id':_0x2e3421[_0x1ee3('0x40')]['id']}},_0xfb6d6e={};_0xfb6d6e[_0x1ee3('0x2c')]=_[_0x1ee3('0x2e')](db['VoiceAgentReport'][_0x1ee3('0x29')]);_0xfb6d6e['query']=_[_0x1ee3('0x2e')](_0x2e3421[_0x1ee3('0x2d')]);_0xfb6d6e[_0x1ee3('0x2f')]=_[_0x1ee3('0x30')](_0xfb6d6e[_0x1ee3('0x2c')],_0xfb6d6e[_0x1ee3('0x2d')]);_0x2ad645[_0x1ee3('0x31')]=_['intersection'](_0xfb6d6e[_0x1ee3('0x2c')],qs['fields'](_0x2e3421['query'][_0x1ee3('0x32')]));_0x2ad645[_0x1ee3('0x31')]=_0x2ad645[_0x1ee3('0x31')][_0x1ee3('0x41')]?_0x2ad645[_0x1ee3('0x31')]:_0xfb6d6e[_0x1ee3('0x2c')];if(_0x2e3421[_0x1ee3('0x2d')][_0x1ee3('0x42')]){_0x2ad645[_0x1ee3('0x43')]=[{'all':!![]}];}_0x2ad645=_[_0x1ee3('0x3b')]({},_0x2ad645,_0x2e3421['options']);return db['VoiceAgentReport'][_0x1ee3('0x44')](_0x2ad645)[_0x1ee3('0x22')](handleEntityNotFound(_0x4bf509,null))['then'](respondWithResult(_0x4bf509,null))[_0x1ee3('0x3f')](handleError(_0x4bf509,null));};exports['create']=function(_0x313a7c,_0x13a018){return db[_0x1ee3('0x3d')][_0x1ee3('0x45')](_0x313a7c['body'],{})['then'](respondWithResult(_0x13a018,0xc9))[_0x1ee3('0x3f')](handleError(_0x13a018,null));};exports[_0x1ee3('0x20')]=function(_0x5ebdef,_0x6f6e80){if(_0x5ebdef[_0x1ee3('0x46')]['id']){delete _0x5ebdef[_0x1ee3('0x46')]['id'];}return db['VoiceAgentReport'][_0x1ee3('0x44')]({'where':{'id':_0x5ebdef['params']['id']}})[_0x1ee3('0x22')](handleEntityNotFound(_0x6f6e80,null))['then'](saveUpdates(_0x5ebdef[_0x1ee3('0x46')],null))['then'](respondWithResult(_0x6f6e80,null))[_0x1ee3('0x3f')](handleError(_0x6f6e80,null));};exports[_0x1ee3('0x21')]=function(_0x3e32cd,_0x509a91){return db[_0x1ee3('0x3d')]['find']({'where':{'id':_0x3e32cd['params']['id']}})[_0x1ee3('0x22')](handleEntityNotFound(_0x509a91,null))[_0x1ee3('0x22')](removeEntity(_0x509a91,null))[_0x1ee3('0x3f')](handleError(_0x509a91,null));};exports['describe']=function(_0x1650de,_0x5e4f4f){return db[_0x1ee3('0x3d')][_0x1ee3('0x47')]()['then'](respondWithResult(_0x5e4f4f,null))['catch'](handleError(_0x5e4f4f,null));}; \ No newline at end of file +var _0xd37b=['reject','save','update','then','stack','name','send','map','VoiceAgentReport','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply'];(function(_0x348ec8,_0x4f3207){var _0x53dd91=function(_0x42f6ac){while(--_0x42f6ac){_0x348ec8['push'](_0x348ec8['shift']());}};_0x53dd91(++_0x4f3207);}(_0xd37b,0xfe));var _0xbd37=function(_0x4b2733,_0xe211a3){_0x4b2733=_0x4b2733-0x0;var _0x4996e9=_0xd37b[_0x4b2733];return _0x4996e9;};'use strict';var pdf=require(_0xbd37('0x0'));var emlformat=require(_0xbd37('0x1'));var rimraf=require(_0xbd37('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbd37('0x3'));var moment=require(_0xbd37('0x4'));var BPromise=require(_0xbd37('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbd37('0x6'));var sox=require(_0xbd37('0x7'));var csv=require(_0xbd37('0x8'));var ejs=require(_0xbd37('0x9'));var fs=require('fs');var _=require(_0xbd37('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbd37('0xb'));var deskjs=require(_0xbd37('0xc'));var toCsv=require(_0xbd37('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd37('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xbd37('0xe'));var as=require(_0xbd37('0xf'));var hardwareService=require(_0xbd37('0x10'));var logger=require('../../config/logger')(_0xbd37('0x11'));var utils=require(_0xbd37('0x12'));var config=require(_0xbd37('0x13'));var db=require(_0xbd37('0x14'))['db'];function respondWithStatusCode(_0x34aa11,_0x51d80f){_0x51d80f=_0x51d80f||0xcc;return function(_0x31eb5f){if(_0x31eb5f){return _0x34aa11[_0xbd37('0x15')](_0x51d80f);}return _0x34aa11[_0xbd37('0x16')](_0x51d80f)[_0xbd37('0x17')]();};}function respondWithResult(_0x432f15,_0x49624b){_0x49624b=_0x49624b||0xc8;return function(_0x5ad25c){if(_0x5ad25c){return _0x432f15[_0xbd37('0x16')](_0x49624b)[_0xbd37('0x18')](_0x5ad25c);}};}function respondWithFilteredResult(_0x302950,_0x591dd6){return function(_0x46da84){if(_0x46da84){var _0x35fff0=_0x46da84[_0xbd37('0x19')],_0x529a76=_0x591dd6[_0xbd37('0x1a')],_0x419a36=_0x591dd6[_0xbd37('0x1a')]+_0x591dd6[_0xbd37('0x1b')],_0x3563fd;if(_0x419a36>=_0x35fff0){_0x419a36=_0x35fff0;_0x3563fd=0xc8;}else{_0x3563fd=0xce;}_0x302950[_0xbd37('0x16')](_0x3563fd);return _0x302950[_0xbd37('0x1c')]('Content-Range',_0x529a76+'-'+_0x419a36+'/'+_0x35fff0)['json'](_0x46da84);}return null;};}function patchUpdates(_0x4cdfcf){return function(_0xf27a99){try{jsonpatch[_0xbd37('0x1d')](_0xf27a99,_0x4cdfcf,!![]);}catch(_0x5808cd){return BPromise[_0xbd37('0x1e')](_0x5808cd);}return _0xf27a99[_0xbd37('0x1f')]();};}function saveUpdates(_0x117b43,_0x1da44a){return function(_0x33d164){if(_0x33d164){return _0x33d164[_0xbd37('0x20')](_0x117b43)[_0xbd37('0x21')](function(_0x2d7d96){return _0x2d7d96;});}return null;};}function removeEntity(_0x3fa4fc,_0x594a8b){return function(_0x2d7f18){if(_0x2d7f18){return _0x2d7f18['destroy']()['then'](function(){_0x3fa4fc[_0xbd37('0x16')](0xcc)[_0xbd37('0x17')]();});}};}function handleEntityNotFound(_0x55cebd,_0x33de6e){return function(_0x24803d){if(!_0x24803d){_0x55cebd['sendStatus'](0x194);}return _0x24803d;};}function handleError(_0x4460e8,_0x597be6){_0x597be6=_0x597be6||0x1f4;return function(_0x1c83e3){logger['error'](_0x1c83e3[_0xbd37('0x22')]);if(_0x1c83e3[_0xbd37('0x23')]){delete _0x1c83e3[_0xbd37('0x23')];}_0x4460e8['status'](_0x597be6)[_0xbd37('0x24')](_0x1c83e3);};}exports['index']=function(_0x4764eb,_0x2cb7ad){var _0x1cb876={},_0x34a7e2={},_0x40f14e={'count':0x0,'rows':[]};var _0x391329=_[_0xbd37('0x25')](db[_0xbd37('0x26')]['rawAttributes'],function(_0x50955a){return{'name':_0x50955a['fieldName'],'type':_0x50955a[_0xbd37('0x27')][_0xbd37('0x28')]};});_0x34a7e2[_0xbd37('0x29')]=_[_0xbd37('0x25')](_0x391329,'name');_0x34a7e2['query']=_[_0xbd37('0x2a')](_0x4764eb['query']);_0x34a7e2[_0xbd37('0x2b')]=_[_0xbd37('0x2c')](_0x34a7e2[_0xbd37('0x29')],_0x34a7e2[_0xbd37('0x2d')]);_0x1cb876[_0xbd37('0x2e')]=_['intersection'](_0x34a7e2[_0xbd37('0x29')],qs[_0xbd37('0x2f')](_0x4764eb[_0xbd37('0x2d')][_0xbd37('0x2f')]));_0x1cb876['attributes']=_0x1cb876[_0xbd37('0x2e')][_0xbd37('0x30')]?_0x1cb876['attributes']:_0x34a7e2[_0xbd37('0x29')];if(!_0x4764eb[_0xbd37('0x2d')][_0xbd37('0x31')](_0xbd37('0x32'))){_0x1cb876['limit']=qs[_0xbd37('0x1b')](_0x4764eb[_0xbd37('0x2d')][_0xbd37('0x1b')]);_0x1cb876[_0xbd37('0x1a')]=qs[_0xbd37('0x1a')](_0x4764eb[_0xbd37('0x2d')][_0xbd37('0x1a')]);}_0x1cb876[_0xbd37('0x33')]=qs[_0xbd37('0x34')](_0x4764eb[_0xbd37('0x2d')][_0xbd37('0x34')]);_0x1cb876['where']=qs[_0xbd37('0x2b')](_['pick'](_0x4764eb[_0xbd37('0x2d')],_0x34a7e2[_0xbd37('0x2b')]));if(_0x4764eb[_0xbd37('0x2d')]['filter']){_0x1cb876[_0xbd37('0x35')]=_['merge'](_0x1cb876[_0xbd37('0x35')],{'$or':_['map'](_0x391329,function(_0x5bf1c3){if(_0x5bf1c3['type']!==_0xbd37('0x36')){var _0x5c2b5a={};_0x5c2b5a[_0x5bf1c3[_0xbd37('0x23')]]={'$like':'%'+_0x4764eb['query'][_0xbd37('0x37')]+'%'};return _0x5c2b5a;}})});}_0x1cb876=_[_0xbd37('0x38')]({},_0x1cb876,_0x4764eb[_0xbd37('0x39')]);var _0x288eb4={'where':_0x1cb876['where']};return db[_0xbd37('0x26')][_0xbd37('0x19')](_0x288eb4)[_0xbd37('0x21')](function(_0xa23a76){_0x40f14e[_0xbd37('0x19')]=_0xa23a76;if(_0x4764eb[_0xbd37('0x2d')][_0xbd37('0x3a')]){_0x1cb876[_0xbd37('0x3b')]=[{'all':!![]}];}return db[_0xbd37('0x26')][_0xbd37('0x3c')](_0x1cb876);})['then'](function(_0x444127){_0x40f14e[_0xbd37('0x3d')]=_0x444127;return _0x40f14e;})['then'](respondWithFilteredResult(_0x2cb7ad,_0x1cb876))[_0xbd37('0x3e')](handleError(_0x2cb7ad,null));};exports[_0xbd37('0x3f')]=function(_0x78b9ae,_0x564331){var _0x1eba0a={'raw':![],'where':{'id':_0x78b9ae[_0xbd37('0x40')]['id']}},_0x458ffb={};_0x458ffb[_0xbd37('0x29')]=_[_0xbd37('0x2a')](db['VoiceAgentReport'][_0xbd37('0x41')]);_0x458ffb['query']=_['keys'](_0x78b9ae['query']);_0x458ffb[_0xbd37('0x2b')]=_['intersection'](_0x458ffb['model'],_0x458ffb['query']);_0x1eba0a[_0xbd37('0x2e')]=_[_0xbd37('0x2c')](_0x458ffb['model'],qs[_0xbd37('0x2f')](_0x78b9ae[_0xbd37('0x2d')][_0xbd37('0x2f')]));_0x1eba0a['attributes']=_0x1eba0a[_0xbd37('0x2e')][_0xbd37('0x30')]?_0x1eba0a[_0xbd37('0x2e')]:_0x458ffb[_0xbd37('0x29')];if(_0x78b9ae[_0xbd37('0x2d')][_0xbd37('0x3a')]){_0x1eba0a[_0xbd37('0x3b')]=[{'all':!![]}];}_0x1eba0a=_[_0xbd37('0x38')]({},_0x1eba0a,_0x78b9ae['options']);return db[_0xbd37('0x26')][_0xbd37('0x42')](_0x1eba0a)[_0xbd37('0x21')](handleEntityNotFound(_0x564331,null))[_0xbd37('0x21')](respondWithResult(_0x564331,null))[_0xbd37('0x3e')](handleError(_0x564331,null));};exports[_0xbd37('0x43')]=function(_0x3d79cb,_0x40b390){return db[_0xbd37('0x26')][_0xbd37('0x43')](_0x3d79cb['body'],{})['then'](respondWithResult(_0x40b390,0xc9))['catch'](handleError(_0x40b390,null));};exports[_0xbd37('0x20')]=function(_0x597b43,_0x1e4147){if(_0x597b43[_0xbd37('0x44')]['id']){delete _0x597b43[_0xbd37('0x44')]['id'];}return db[_0xbd37('0x26')][_0xbd37('0x42')]({'where':{'id':_0x597b43[_0xbd37('0x40')]['id']}})[_0xbd37('0x21')](handleEntityNotFound(_0x1e4147,null))['then'](saveUpdates(_0x597b43[_0xbd37('0x44')],null))[_0xbd37('0x21')](respondWithResult(_0x1e4147,null))['catch'](handleError(_0x1e4147,null));};exports[_0xbd37('0x45')]=function(_0x196af3,_0x179eab){return db[_0xbd37('0x26')][_0xbd37('0x42')]({'where':{'id':_0x196af3[_0xbd37('0x40')]['id']}})[_0xbd37('0x21')](handleEntityNotFound(_0x179eab,null))[_0xbd37('0x21')](removeEntity(_0x179eab,null))[_0xbd37('0x3e')](handleError(_0x179eab,null));};exports['describe']=function(_0x3386e3,_0x253952){return db[_0xbd37('0x26')][_0xbd37('0x46')]()[_0xbd37('0x21')](respondWithResult(_0x253952,null))[_0xbd37('0x3e')](handleError(_0x253952,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 07ce684..2399921 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 _0x3728=['./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','api','moment','bluebird','path','rimraf'];(function(_0x23d4e1,_0x4e0871){var _0x128343=function(_0x2ab15f){while(--_0x2ab15f){_0x23d4e1['push'](_0x23d4e1['shift']());}};_0x128343(++_0x4e0871);}(_0x3728,0x125));var _0x8372=function(_0x2b76e7,_0x34dd5f){_0x2b76e7=_0x2b76e7-0x0;var _0x5988c4=_0x3728[_0x2b76e7];return _0x5988c4;};'use strict';var _=require('lodash');var util=require(_0x8372('0x0'));var logger=require('../../config/logger')(_0x8372('0x1'));var moment=require(_0x8372('0x2'));var BPromise=require(_0x8372('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8372('0x4'));var rimraf=require(_0x8372('0x5'));var config=require('../../config/environment');var attributes=require(_0x8372('0x6'));module[_0x8372('0x7')]=function(_0x31d5c4,_0xa22275){return _0x31d5c4[_0x8372('0x8')](_0x8372('0x9'),attributes,{'tableName':_0x8372('0xa'),'paranoid':![],'indexes':[{'fields':[_0x8372('0xb'),_0x8372('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb190=['../../config/logger','api','bluebird','path','exports','VoiceAgentReport','lodash','util'];(function(_0x4fe7ae,_0x2a9bc9){var _0x2c5722=function(_0x49754e){while(--_0x49754e){_0x4fe7ae['push'](_0x4fe7ae['shift']());}};_0x2c5722(++_0x2a9bc9);}(_0xb190,0xce));var _0x0b19=function(_0x111f58,_0x3f9421){_0x111f58=_0x111f58-0x0;var _0x336488=_0xb190[_0x111f58];return _0x336488;};'use strict';var _=require(_0x0b19('0x0'));var util=require(_0x0b19('0x1'));var logger=require(_0x0b19('0x2'))(_0x0b19('0x3'));var moment=require('moment');var BPromise=require(_0x0b19('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b19('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x0b19('0x6')]=function(_0x81dca3,_0x2de62d){return _0x81dca3['define'](_0x0b19('0x7'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 4c8b02e..007bb20 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 _0xc884=['info','catch','CreateVoiceAgentReport','create','raw','UpdateVoiceAgentReport','options','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','VoiceAgentReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x17715e,_0x369792){var _0x3c44ab=function(_0x47f907){while(--_0x47f907){_0x17715e['push'](_0x17715e['shift']());}};_0x3c44ab(++_0x369792);}(_0xc884,0xdd));var _0x4c88=function(_0x12ae3e,_0x10cd73){_0x12ae3e=_0x12ae3e-0x0;var _0x17461f=_0xc884[_0x12ae3e];return _0x17461f;};'use strict';var _=require(_0x4c88('0x0'));var util=require(_0x4c88('0x1'));var moment=require(_0x4c88('0x2'));var BPromise=require(_0x4c88('0x3'));var rs=require(_0x4c88('0x4'));var fs=require('fs');var Redis=require(_0x4c88('0x5'));var db=require(_0x4c88('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c88('0x7'))(_0x4c88('0x8'));var config=require(_0x4c88('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4c88('0xa')][_0x4c88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf5610f,_0x1bb12d,_0x129203){return new BPromise(function(_0x386c6b,_0x46dd70){return client['request'](_0xf5610f,_0x129203)['then'](function(_0xc1f5f5){logger['info'](_0x4c88('0xc'),_0x1bb12d,'request\x20sent');logger[_0x4c88('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x1bb12d,_0x4c88('0xe'),JSON[_0x4c88('0xf')](_0xc1f5f5));if(_0xc1f5f5[_0x4c88('0x10')]){if(_0xc1f5f5['error'][_0x4c88('0x11')]===0x1f4){logger[_0x4c88('0x10')](_0x4c88('0xc'),_0x1bb12d,_0xc1f5f5[_0x4c88('0x10')]['message']);return _0x46dd70(_0xc1f5f5[_0x4c88('0x10')]['message']);}logger['error'](_0x4c88('0xc'),_0x1bb12d,_0xc1f5f5[_0x4c88('0x10')][_0x4c88('0x12')]);return _0x386c6b(_0xc1f5f5['error'][_0x4c88('0x12')]);}else{logger[_0x4c88('0x13')](_0x4c88('0xc'),_0x1bb12d,'request\x20sent');_0x386c6b(_0xc1f5f5['result'][_0x4c88('0x12')]);}})[_0x4c88('0x14')](function(_0x41a744){logger['error'](_0x4c88('0xc'),_0x1bb12d,_0x41a744);_0x46dd70(_0x41a744);});});}exports[_0x4c88('0x15')]=function(_0x87e149){var _0x5bc5f5=this;return new Promise(function(_0x35f375,_0x426529){return db['VoiceAgentReport'][_0x4c88('0x16')](_0x87e149['body'],{'raw':_0x87e149['options']?_0x87e149['options'][_0x4c88('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x1f114b){logger[_0x4c88('0x13')]('CreateVoiceAgentReport',_0x87e149);logger[_0x4c88('0xd')](_0x4c88('0x15'),_0x87e149,JSON[_0x4c88('0xf')](_0x1f114b));_0x35f375(_0x1f114b);})['catch'](function(_0x3940d7){logger['error']('CreateVoiceAgentReport',_0x3940d7['message'],_0x87e149);_0x426529(_0x5bc5f5[_0x4c88('0x10')](0x1f4,_0x3940d7[_0x4c88('0x12')]));});});};exports[_0x4c88('0x18')]=function(_0x178df2){var _0xf4ec67=this;return new Promise(function(_0x3cae00,_0x580549){return db['VoiceAgentReport']['update'](_0x178df2['body'],{'raw':_0x178df2[_0x4c88('0x19')]?_0x178df2[_0x4c88('0x19')][_0x4c88('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x178df2[_0x4c88('0x19')]?_0x178df2['options'][_0x4c88('0x1a')]||null:null,'attributes':_0x178df2[_0x4c88('0x19')]?_0x178df2[_0x4c88('0x19')][_0x4c88('0x1b')]||null:null,'limit':_0x178df2['options']?_0x178df2['options'][_0x4c88('0x1c')]||null:null})[_0x4c88('0x1d')](function(_0x43b12f){logger['info'](_0x4c88('0x18'),_0x178df2);logger[_0x4c88('0xd')](_0x4c88('0x18'),_0x178df2,JSON[_0x4c88('0xf')](_0x43b12f));_0x3cae00(_0x43b12f);})[_0x4c88('0x14')](function(_0x2dd582){logger['error'](_0x4c88('0x18'),_0x2dd582[_0x4c88('0x12')],_0x178df2);_0x580549(_0xf4ec67['error'](0x1f4,_0x2dd582[_0x4c88('0x12')]));});});}; \ No newline at end of file +var _0x6484=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x224361,_0x1a7924){var _0x32678c=function(_0x331660){while(--_0x331660){_0x224361['push'](_0x224361['shift']());}};_0x32678c(++_0x1a7924);}(_0x6484,0x64));var _0x4648=function(_0x112e39,_0x39e445){_0x112e39=_0x112e39-0x0;var _0xd883de=_0x6484[_0x112e39];return _0xd883de;};'use strict';var _=require(_0x4648('0x0'));var util=require(_0x4648('0x1'));var moment=require(_0x4648('0x2'));var BPromise=require(_0x4648('0x3'));var rs=require(_0x4648('0x4'));var fs=require('fs');var Redis=require(_0x4648('0x5'));var db=require(_0x4648('0x6'))['db'];var utils=require(_0x4648('0x7'));var logger=require(_0x4648('0x8'))(_0x4648('0x9'));var config=require('../../config/environment');var jayson=require(_0x4648('0xa'));var client=jayson[_0x4648('0xb')][_0x4648('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x37efab,_0x284f92,_0x467e26){return new BPromise(function(_0x598072,_0xdd8612){return client[_0x4648('0xd')](_0x37efab,_0x467e26)[_0x4648('0xe')](function(_0x5ea0e2){logger[_0x4648('0xf')](_0x4648('0x10'),_0x284f92,_0x4648('0x11'));logger[_0x4648('0x12')](_0x4648('0x13'),_0x284f92,_0x4648('0x11'),JSON[_0x4648('0x14')](_0x5ea0e2));if(_0x5ea0e2[_0x4648('0x15')]){if(_0x5ea0e2[_0x4648('0x15')][_0x4648('0x16')]===0x1f4){logger[_0x4648('0x15')](_0x4648('0x10'),_0x284f92,_0x5ea0e2[_0x4648('0x15')][_0x4648('0x17')]);return _0xdd8612(_0x5ea0e2[_0x4648('0x15')][_0x4648('0x17')]);}logger[_0x4648('0x15')]('VoiceAgentReport,\x20%s,\x20%s',_0x284f92,_0x5ea0e2[_0x4648('0x15')]['message']);return _0x598072(_0x5ea0e2[_0x4648('0x15')][_0x4648('0x17')]);}else{logger[_0x4648('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x284f92,_0x4648('0x11'));_0x598072(_0x5ea0e2['result'][_0x4648('0x17')]);}})[_0x4648('0x18')](function(_0x5890a7){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x284f92,_0x5890a7);_0xdd8612(_0x5890a7);});});}exports[_0x4648('0x19')]=function(_0x5d608b){var _0x2fc0c2=this;return new Promise(function(_0x1dd805,_0x4b304a){return db[_0x4648('0x1a')][_0x4648('0x1b')](_0x5d608b[_0x4648('0x1c')],{'raw':_0x5d608b['options']?_0x5d608b[_0x4648('0x1d')][_0x4648('0x1e')]===undefined?!![]:![]:!![]})[_0x4648('0xe')](function(_0xb022b8){logger[_0x4648('0xf')](_0x4648('0x19'),_0x5d608b);logger[_0x4648('0x12')](_0x4648('0x19'),_0x5d608b,JSON[_0x4648('0x14')](_0xb022b8));_0x1dd805(_0xb022b8);})[_0x4648('0x18')](function(_0x481965){logger[_0x4648('0x15')](_0x4648('0x19'),_0x481965['message'],_0x5d608b);_0x4b304a(_0x2fc0c2[_0x4648('0x15')](0x1f4,_0x481965['message']));});});};exports[_0x4648('0x1f')]=function(_0x197a4d){var _0x480e4c=this;return new Promise(function(_0x4118a7,_0x2ff371){return db[_0x4648('0x1a')][_0x4648('0x20')](_0x197a4d[_0x4648('0x1c')],{'raw':_0x197a4d[_0x4648('0x1d')]?_0x197a4d[_0x4648('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x197a4d['options']?_0x197a4d[_0x4648('0x1d')][_0x4648('0x21')]||null:null,'attributes':_0x197a4d['options']?_0x197a4d[_0x4648('0x1d')]['attributes']||null:null,'limit':_0x197a4d[_0x4648('0x1d')]?_0x197a4d[_0x4648('0x1d')][_0x4648('0x22')]||null:null})['then'](function(_0x3f4355){logger[_0x4648('0xf')]('UpdateVoiceAgentReport',_0x197a4d);logger[_0x4648('0x12')](_0x4648('0x1f'),_0x197a4d,JSON[_0x4648('0x14')](_0x3f4355));_0x4118a7(_0x3f4355);})['catch'](function(_0x206c60){logger[_0x4648('0x15')](_0x4648('0x1f'),_0x206c60[_0x4648('0x17')],_0x197a4d);_0x2ff371(_0x480e4c['error'](0x1f4,_0x206c60['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index a337f9d..655c736 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 _0xf967=['./voiceCallReport.controller','get','index','/describe','isAuthenticated','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1e5ca1,_0x359b77){var _0x28eeb1=function(_0x536257){while(--_0x536257){_0x1e5ca1['push'](_0x1e5ca1['shift']());}};_0x28eeb1(++_0x359b77);}(_0xf967,0x116));var _0x7f96=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf967[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x7f96('0x0'));var util=require(_0x7f96('0x1'));var path=require(_0x7f96('0x2'));var timeout=require(_0x7f96('0x3'));var express=require('express');var router=express[_0x7f96('0x4')]();var auth=require(_0x7f96('0x5'));var interaction=require(_0x7f96('0x6'));var config=require('../../config/environment');var controller=require(_0x7f96('0x7'));router[_0x7f96('0x8')]('/',auth['isAuthenticated'](),controller[_0x7f96('0x9')]);router[_0x7f96('0x8')](_0x7f96('0xa'),auth[_0x7f96('0xb')](),controller['describe']);router[_0x7f96('0x8')](_0x7f96('0xc'),auth[_0x7f96('0xb')](),controller[_0x7f96('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7f96('0xe')](_0x7f96('0xc'),auth['isAuthenticated'](),controller[_0x7f96('0xf')]);router[_0x7f96('0x10')](_0x7f96('0xc'),auth[_0x7f96('0xb')](),controller[_0x7f96('0x11')]);module[_0x7f96('0x12')]=router; \ No newline at end of file +var _0xaf61=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x513863,_0x44062e){var _0x90ac2f=function(_0xe94c5d){while(--_0xe94c5d){_0x513863['push'](_0x513863['shift']());}};_0x90ac2f(++_0x44062e);}(_0xaf61,0x126));var _0x1af6=function(_0x3889f6,_0x5b50d3){_0x3889f6=_0x3889f6-0x0;var _0x17c783=_0xaf61[_0x3889f6];return _0x17c783;};'use strict';var multer=require(_0x1af6('0x0'));var util=require('util');var path=require(_0x1af6('0x1'));var timeout=require(_0x1af6('0x2'));var express=require(_0x1af6('0x3'));var router=express[_0x1af6('0x4')]();var auth=require(_0x1af6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1af6('0x6'));var controller=require(_0x1af6('0x7'));router[_0x1af6('0x8')]('/',auth[_0x1af6('0x9')](),controller[_0x1af6('0xa')]);router[_0x1af6('0x8')](_0x1af6('0xb'),auth[_0x1af6('0x9')](),controller[_0x1af6('0xc')]);router['get'](_0x1af6('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x1af6('0xe')]('/',auth[_0x1af6('0x9')](),controller[_0x1af6('0xf')]);router[_0x1af6('0x10')](_0x1af6('0xd'),auth[_0x1af6('0x9')](),controller[_0x1af6('0x11')]);router[_0x1af6('0x12')](_0x1af6('0xd'),auth[_0x1af6('0x9')](),controller[_0x1af6('0x13')]);module[_0x1af6('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index cc1a4c0..874b7a8 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 _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x12e1fa,_0x44e981){var _0x1e743e=function(_0x56e0c1){while(--_0x56e0c1){_0x12e1fa['push'](_0x12e1fa['shift']());}};_0x1e743e(++_0x44e981);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 +var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x58a6d2,_0x198bd5){var _0x33bd7d=function(_0x376676){while(--_0x376676){_0x58a6d2['push'](_0x58a6d2['shift']());}};_0x33bd7d(++_0x198bd5);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index d686106..c98a81f 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 _0xb98d=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','User','findAll','rows','catch','params','includeAll','create','find','describe','body','uniqueid','user','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status'];(function(_0x5b065b,_0x5ca524){var _0x3dd4fb=function(_0x296857){while(--_0x296857){_0x5b065b['push'](_0x5b065b['shift']());}};_0x3dd4fb(++_0x5ca524);}(_0xb98d,0x113));var _0xdb98=function(_0x14f2bc,_0x139a22){_0x14f2bc=_0x14f2bc-0x0;var _0x96a084=_0xb98d[_0x14f2bc];return _0x96a084;};'use strict';var pdf=require(_0xdb98('0x0'));var emlformat=require(_0xdb98('0x1'));var rimraf=require(_0xdb98('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb98('0x3'));var rp=require('request-promise');var moment=require(_0xdb98('0x4'));var BPromise=require(_0xdb98('0x5'));var Mustache=require(_0xdb98('0x6'));var util=require('util');var path=require(_0xdb98('0x7'));var sox=require(_0xdb98('0x8'));var csv=require(_0xdb98('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdb98('0xa'));var squel=require('squel');var crypto=require(_0xdb98('0xb'));var jsforce=require(_0xdb98('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdb98('0xd'));var Papa=require(_0xdb98('0xe'));var Redis=require(_0xdb98('0xf'));var authService=require(_0xdb98('0x10'));var qs=require(_0xdb98('0x11'));var as=require(_0xdb98('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb98('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xdb98('0x14'));var db=require(_0xdb98('0x15'))['db'];function respondWithStatusCode(_0x28d822,_0x203422){_0x203422=_0x203422||0xcc;return function(_0x4c6c37){if(_0x4c6c37){return _0x28d822[_0xdb98('0x16')](_0x203422);}return _0x28d822['status'](_0x203422)[_0xdb98('0x17')]();};}function respondWithResult(_0xda9a56,_0x24526f){_0x24526f=_0x24526f||0xc8;return function(_0x6b668d){if(_0x6b668d){return _0xda9a56[_0xdb98('0x18')](_0x24526f)[_0xdb98('0x19')](_0x6b668d);}};}function respondWithFilteredResult(_0x33c450,_0x16d3fa){return function(_0x8d97ef){if(_0x8d97ef){var _0x54dfff=_0x8d97ef[_0xdb98('0x1a')],_0x575bca=_0x16d3fa[_0xdb98('0x1b')],_0x6623f1=_0x16d3fa[_0xdb98('0x1b')]+_0x16d3fa[_0xdb98('0x1c')],_0x4b6d43;if(_0x6623f1>=_0x54dfff){_0x6623f1=_0x54dfff;_0x4b6d43=0xc8;}else{_0x4b6d43=0xce;}_0x33c450[_0xdb98('0x18')](_0x4b6d43);return _0x33c450[_0xdb98('0x1d')](_0xdb98('0x1e'),_0x575bca+'-'+_0x6623f1+'/'+_0x54dfff)[_0xdb98('0x19')](_0x8d97ef);}return null;};}function patchUpdates(_0x8ac3f5){return function(_0xb936de){try{jsonpatch[_0xdb98('0x1f')](_0xb936de,_0x8ac3f5,!![]);}catch(_0x59e2b9){return BPromise[_0xdb98('0x20')](_0x59e2b9);}return _0xb936de[_0xdb98('0x21')]();};}function saveUpdates(_0x37ade3,_0x2430cb){return function(_0x5f339f){if(_0x5f339f){return _0x5f339f[_0xdb98('0x22')](_0x37ade3)[_0xdb98('0x23')](function(_0x36c279){return _0x36c279;});}return null;};}function removeEntity(_0x539c67,_0xb43122){return function(_0x4189c6){if(_0x4189c6){return _0x4189c6[_0xdb98('0x24')]()[_0xdb98('0x23')](function(){_0x539c67[_0xdb98('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14fdba,_0x2f4ef7){return function(_0x27adb2){if(!_0x27adb2){_0x14fdba[_0xdb98('0x16')](0x194);}return _0x27adb2;};}function handleError(_0x193cd3,_0x5e796f){_0x5e796f=_0x5e796f||0x1f4;return function(_0x1e7cb7){logger[_0xdb98('0x25')](_0x1e7cb7[_0xdb98('0x26')]);if(_0x1e7cb7[_0xdb98('0x27')]){delete _0x1e7cb7[_0xdb98('0x27')];}_0x193cd3['status'](_0x5e796f)[_0xdb98('0x28')](_0x1e7cb7);};}exports[_0xdb98('0x29')]=function(_0x49396a,_0x4cfc35){var _0x2b92e3={},_0x1d840d={},_0x2d67b6={'count':0x0,'rows':[]};var _0x5de782=_['map'](db[_0xdb98('0x2a')][_0xdb98('0x2b')],function(_0x1af4f0){return{'name':_0x1af4f0[_0xdb98('0x2c')],'type':_0x1af4f0[_0xdb98('0x2d')]['key']};});_0x1d840d[_0xdb98('0x2e')]=_[_0xdb98('0x2f')](_0x5de782,_0xdb98('0x27'));_0x1d840d[_0xdb98('0x30')]=_[_0xdb98('0x31')](_0x49396a['query']);_0x1d840d['filters']=_[_0xdb98('0x32')](_0x1d840d['model'],_0x1d840d[_0xdb98('0x30')]);_0x2b92e3[_0xdb98('0x33')]=_[_0xdb98('0x32')](_0x1d840d[_0xdb98('0x2e')],qs[_0xdb98('0x34')](_0x49396a[_0xdb98('0x30')][_0xdb98('0x34')]));_0x2b92e3[_0xdb98('0x33')]=_0x2b92e3['attributes'][_0xdb98('0x35')]?_0x2b92e3[_0xdb98('0x33')]:_0x1d840d[_0xdb98('0x2e')];if(!_0x49396a[_0xdb98('0x30')]['hasOwnProperty'](_0xdb98('0x36'))){_0x2b92e3['limit']=qs[_0xdb98('0x1c')](_0x49396a[_0xdb98('0x30')][_0xdb98('0x1c')]);_0x2b92e3[_0xdb98('0x1b')]=qs[_0xdb98('0x1b')](_0x49396a[_0xdb98('0x30')][_0xdb98('0x1b')]);}_0x2b92e3[_0xdb98('0x37')]=qs[_0xdb98('0x38')](_0x49396a['query'][_0xdb98('0x38')]);_0x2b92e3[_0xdb98('0x39')]=qs[_0xdb98('0x3a')](_[_0xdb98('0x3b')](_0x49396a[_0xdb98('0x30')],_0x1d840d['filters']));if(_0x49396a['query'][_0xdb98('0x3c')]){_0x2b92e3[_0xdb98('0x39')]=_['merge'](_0x2b92e3[_0xdb98('0x39')],{'$or':_['map'](_0x5de782,function(_0x3e99b6){if(_0x3e99b6[_0xdb98('0x2d')]!==_0xdb98('0x3d')){var _0x48439c={};_0x48439c[_0x3e99b6[_0xdb98('0x27')]]={'$like':'%'+_0x49396a[_0xdb98('0x30')][_0xdb98('0x3c')]+'%'};return _0x48439c;}})});}_0x2b92e3=_['merge']({},_0x2b92e3,_0x49396a[_0xdb98('0x3e')]);var _0x47fad9={'where':_0x2b92e3[_0xdb98('0x39')]};return db[_0xdb98('0x2a')][_0xdb98('0x1a')](_0x47fad9)['then'](function(_0x32b20b){_0x2d67b6[_0xdb98('0x1a')]=_0x32b20b;if(_0x49396a[_0xdb98('0x30')]['includeAll']){_0x2b92e3['include']=[{'attributes':['id',_0xdb98('0x27'),'fullname','alias'],'model':db[_0xdb98('0x3f')],'as':_0xdb98('0x3f')}];}return db[_0xdb98('0x2a')][_0xdb98('0x40')](_0x2b92e3);})[_0xdb98('0x23')](function(_0x27f319){_0x2d67b6[_0xdb98('0x41')]=_0x27f319;return _0x2d67b6;})[_0xdb98('0x23')](respondWithFilteredResult(_0x4cfc35,_0x2b92e3))[_0xdb98('0x42')](handleError(_0x4cfc35,null));};exports['show']=function(_0x27fcc2,_0x553354){var _0x4db3cb={'raw':!![],'where':{'id':_0x27fcc2[_0xdb98('0x43')]['id']}},_0x483aba={};_0x483aba[_0xdb98('0x2e')]=_['keys'](db[_0xdb98('0x2a')]['rawAttributes']);_0x483aba[_0xdb98('0x30')]=_[_0xdb98('0x31')](_0x27fcc2[_0xdb98('0x30')]);_0x483aba[_0xdb98('0x3a')]=_[_0xdb98('0x32')](_0x483aba['model'],_0x483aba[_0xdb98('0x30')]);_0x4db3cb[_0xdb98('0x33')]=_[_0xdb98('0x32')](_0x483aba[_0xdb98('0x2e')],qs[_0xdb98('0x34')](_0x27fcc2['query'][_0xdb98('0x34')]));_0x4db3cb[_0xdb98('0x33')]=_0x4db3cb['attributes'][_0xdb98('0x35')]?_0x4db3cb['attributes']:_0x483aba['model'];if(_0x27fcc2[_0xdb98('0x30')][_0xdb98('0x44')]){_0x4db3cb['include']=[{'all':!![]}];}_0x4db3cb=_['merge']({},_0x4db3cb,_0x27fcc2['options']);return db[_0xdb98('0x2a')]['find'](_0x4db3cb)['then'](handleEntityNotFound(_0x553354,null))['then'](respondWithResult(_0x553354,null))[_0xdb98('0x42')](handleError(_0x553354,null));};exports[_0xdb98('0x45')]=function(_0x343f3a,_0x37c22a){return db['VoiceCallReport'][_0xdb98('0x45')](_0x343f3a['body'],{})[_0xdb98('0x23')](respondWithResult(_0x37c22a,0xc9))[_0xdb98('0x42')](handleError(_0x37c22a,null));};exports['destroy']=function(_0x537d3f,_0x30a2ff){return db[_0xdb98('0x2a')][_0xdb98('0x46')]({'where':{'id':_0x537d3f[_0xdb98('0x43')]['id']}})[_0xdb98('0x23')](handleEntityNotFound(_0x30a2ff,null))[_0xdb98('0x23')](removeEntity(_0x30a2ff,null))[_0xdb98('0x42')](handleError(_0x30a2ff,null));};exports[_0xdb98('0x47')]=function(_0x56ff44,_0x1ea584){return db[_0xdb98('0x2a')][_0xdb98('0x47')]()[_0xdb98('0x23')](respondWithResult(_0x1ea584,null))[_0xdb98('0x42')](handleError(_0x1ea584,null));};exports[_0xdb98('0x22')]=function(_0x59090a,_0x585d32){if(_0x59090a[_0xdb98('0x48')]['uniqueid']){delete _0x59090a[_0xdb98('0x48')][_0xdb98('0x49')];}return db[_0xdb98('0x2a')][_0xdb98('0x46')]({'where':{'uniqueid':_0x59090a[_0xdb98('0x43')]['id'],'UserId':{'$or':[null,_0x59090a[_0xdb98('0x4a')]['id']]}}})[_0xdb98('0x23')](handleEntityNotFound(_0x585d32,null))[_0xdb98('0x23')](saveUpdates(_0x59090a[_0xdb98('0x48')],null))[_0xdb98('0x23')](respondWithResult(_0x585d32,null))[_0xdb98('0x42')](handleError(_0x585d32,null));}; \ No newline at end of file +var _0xc3ed=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','fullname','alias','User','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','uniqueid','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','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/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceCallReport','fieldName','key','model'];(function(_0x456ce9,_0x307b39){var _0x3bd143=function(_0x397790){while(--_0x397790){_0x456ce9['push'](_0x456ce9['shift']());}};_0x3bd143(++_0x307b39);}(_0xc3ed,0xc3));var _0xdc3e=function(_0x150a49,_0x47b070){_0x150a49=_0x150a49-0x0;var _0xe8c345=_0xc3ed[_0x150a49];return _0xe8c345;};'use strict';var pdf=require(_0xdc3e('0x0'));var emlformat=require(_0xdc3e('0x1'));var rimraf=require(_0xdc3e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc3e('0x3'));var rp=require(_0xdc3e('0x4'));var moment=require(_0xdc3e('0x5'));var BPromise=require(_0xdc3e('0x6'));var Mustache=require(_0xdc3e('0x7'));var util=require('util');var path=require(_0xdc3e('0x8'));var sox=require('sox');var csv=require(_0xdc3e('0x9'));var ejs=require(_0xdc3e('0xa'));var fs=require('fs');var _=require(_0xdc3e('0xb'));var squel=require(_0xdc3e('0xc'));var crypto=require(_0xdc3e('0xd'));var jsforce=require(_0xdc3e('0xe'));var deskjs=require(_0xdc3e('0xf'));var toCsv=require(_0xdc3e('0x9'));var querystring=require(_0xdc3e('0x10'));var Papa=require(_0xdc3e('0x11'));var Redis=require('ioredis');var authService=require(_0xdc3e('0x12'));var qs=require(_0xdc3e('0x13'));var as=require(_0xdc3e('0x14'));var hardwareService=require(_0xdc3e('0x15'));var logger=require(_0xdc3e('0x16'))(_0xdc3e('0x17'));var utils=require('../../config/utils');var config=require(_0xdc3e('0x18'));var db=require(_0xdc3e('0x19'))['db'];function respondWithStatusCode(_0x15e25e,_0x34a45e){_0x34a45e=_0x34a45e||0xcc;return function(_0x2e4c43){if(_0x2e4c43){return _0x15e25e[_0xdc3e('0x1a')](_0x34a45e);}return _0x15e25e['status'](_0x34a45e)['end']();};}function respondWithResult(_0x495efa,_0x1037a6){_0x1037a6=_0x1037a6||0xc8;return function(_0x10e062){if(_0x10e062){return _0x495efa[_0xdc3e('0x1b')](_0x1037a6)[_0xdc3e('0x1c')](_0x10e062);}};}function respondWithFilteredResult(_0x30670c,_0x513e0c){return function(_0x317718){if(_0x317718){var _0x2c4ec8=_0x317718[_0xdc3e('0x1d')],_0xd42189=_0x513e0c[_0xdc3e('0x1e')],_0x3cc046=_0x513e0c[_0xdc3e('0x1e')]+_0x513e0c['limit'],_0x3151f1;if(_0x3cc046>=_0x2c4ec8){_0x3cc046=_0x2c4ec8;_0x3151f1=0xc8;}else{_0x3151f1=0xce;}_0x30670c[_0xdc3e('0x1b')](_0x3151f1);return _0x30670c['set'](_0xdc3e('0x1f'),_0xd42189+'-'+_0x3cc046+'/'+_0x2c4ec8)[_0xdc3e('0x1c')](_0x317718);}return null;};}function patchUpdates(_0x1c8ba0){return function(_0x66c819){try{jsonpatch[_0xdc3e('0x20')](_0x66c819,_0x1c8ba0,!![]);}catch(_0x4c3d01){return BPromise[_0xdc3e('0x21')](_0x4c3d01);}return _0x66c819[_0xdc3e('0x22')]();};}function saveUpdates(_0x53ae30,_0x50b4d6){return function(_0x320e3e){if(_0x320e3e){return _0x320e3e[_0xdc3e('0x23')](_0x53ae30)[_0xdc3e('0x24')](function(_0x39fee1){return _0x39fee1;});}return null;};}function removeEntity(_0x347cd4,_0x1b75e7){return function(_0xd698cc){if(_0xd698cc){return _0xd698cc[_0xdc3e('0x25')]()[_0xdc3e('0x24')](function(){_0x347cd4[_0xdc3e('0x1b')](0xcc)[_0xdc3e('0x26')]();});}};}function handleEntityNotFound(_0x4564fe,_0x5b2fa9){return function(_0x24d5e8){if(!_0x24d5e8){_0x4564fe[_0xdc3e('0x1a')](0x194);}return _0x24d5e8;};}function handleError(_0x4ccbc5,_0x3e0723){_0x3e0723=_0x3e0723||0x1f4;return function(_0x10eb63){logger[_0xdc3e('0x27')](_0x10eb63['stack']);if(_0x10eb63[_0xdc3e('0x28')]){delete _0x10eb63['name'];}_0x4ccbc5['status'](_0x3e0723)[_0xdc3e('0x29')](_0x10eb63);};}exports[_0xdc3e('0x2a')]=function(_0xc3032,_0x78d060){var _0x3a4ead={},_0x2da974={},_0x589d6c={'count':0x0,'rows':[]};var _0x2fd6f9=_[_0xdc3e('0x2b')](db[_0xdc3e('0x2c')]['rawAttributes'],function(_0x5da05c){return{'name':_0x5da05c[_0xdc3e('0x2d')],'type':_0x5da05c['type'][_0xdc3e('0x2e')]};});_0x2da974[_0xdc3e('0x2f')]=_[_0xdc3e('0x2b')](_0x2fd6f9,_0xdc3e('0x28'));_0x2da974[_0xdc3e('0x30')]=_[_0xdc3e('0x31')](_0xc3032[_0xdc3e('0x30')]);_0x2da974[_0xdc3e('0x32')]=_[_0xdc3e('0x33')](_0x2da974[_0xdc3e('0x2f')],_0x2da974[_0xdc3e('0x30')]);_0x3a4ead[_0xdc3e('0x34')]=_[_0xdc3e('0x33')](_0x2da974[_0xdc3e('0x2f')],qs[_0xdc3e('0x35')](_0xc3032['query'][_0xdc3e('0x35')]));_0x3a4ead['attributes']=_0x3a4ead[_0xdc3e('0x34')][_0xdc3e('0x36')]?_0x3a4ead[_0xdc3e('0x34')]:_0x2da974[_0xdc3e('0x2f')];if(!_0xc3032[_0xdc3e('0x30')][_0xdc3e('0x37')](_0xdc3e('0x38'))){_0x3a4ead[_0xdc3e('0x39')]=qs['limit'](_0xc3032['query'][_0xdc3e('0x39')]);_0x3a4ead[_0xdc3e('0x1e')]=qs[_0xdc3e('0x1e')](_0xc3032['query']['offset']);}_0x3a4ead[_0xdc3e('0x3a')]=qs[_0xdc3e('0x3b')](_0xc3032[_0xdc3e('0x30')][_0xdc3e('0x3b')]);_0x3a4ead['where']=qs[_0xdc3e('0x32')](_[_0xdc3e('0x3c')](_0xc3032['query'],_0x2da974[_0xdc3e('0x32')]));if(_0xc3032[_0xdc3e('0x30')][_0xdc3e('0x3d')]){_0x3a4ead[_0xdc3e('0x3e')]=_[_0xdc3e('0x3f')](_0x3a4ead[_0xdc3e('0x3e')],{'$or':_[_0xdc3e('0x2b')](_0x2fd6f9,function(_0x4251e5){if(_0x4251e5['type']!==_0xdc3e('0x40')){var _0x46ba57={};_0x46ba57[_0x4251e5['name']]={'$like':'%'+_0xc3032[_0xdc3e('0x30')]['filter']+'%'};return _0x46ba57;}})});}_0x3a4ead=_[_0xdc3e('0x3f')]({},_0x3a4ead,_0xc3032[_0xdc3e('0x41')]);var _0x46a1bd={'where':_0x3a4ead[_0xdc3e('0x3e')]};return db['VoiceCallReport']['count'](_0x46a1bd)[_0xdc3e('0x24')](function(_0x2b480c){_0x589d6c['count']=_0x2b480c;if(_0xc3032[_0xdc3e('0x30')]['includeAll']){_0x3a4ead[_0xdc3e('0x42')]=[{'attributes':['id',_0xdc3e('0x28'),_0xdc3e('0x43'),_0xdc3e('0x44')],'model':db[_0xdc3e('0x45')],'as':_0xdc3e('0x45')}];}return db[_0xdc3e('0x2c')][_0xdc3e('0x46')](_0x3a4ead);})['then'](function(_0x44d9e0){_0x589d6c[_0xdc3e('0x47')]=_0x44d9e0;return _0x589d6c;})[_0xdc3e('0x24')](respondWithFilteredResult(_0x78d060,_0x3a4ead))[_0xdc3e('0x48')](handleError(_0x78d060,null));};exports[_0xdc3e('0x49')]=function(_0x3e27bc,_0x571314){var _0x5a58b1={'raw':!![],'where':{'id':_0x3e27bc[_0xdc3e('0x4a')]['id']}},_0x2855d3={};_0x2855d3[_0xdc3e('0x2f')]=_['keys'](db[_0xdc3e('0x2c')][_0xdc3e('0x4b')]);_0x2855d3[_0xdc3e('0x30')]=_['keys'](_0x3e27bc[_0xdc3e('0x30')]);_0x2855d3['filters']=_[_0xdc3e('0x33')](_0x2855d3['model'],_0x2855d3[_0xdc3e('0x30')]);_0x5a58b1[_0xdc3e('0x34')]=_['intersection'](_0x2855d3[_0xdc3e('0x2f')],qs[_0xdc3e('0x35')](_0x3e27bc['query']['fields']));_0x5a58b1[_0xdc3e('0x34')]=_0x5a58b1[_0xdc3e('0x34')]['length']?_0x5a58b1[_0xdc3e('0x34')]:_0x2855d3[_0xdc3e('0x2f')];if(_0x3e27bc[_0xdc3e('0x30')][_0xdc3e('0x4c')]){_0x5a58b1[_0xdc3e('0x42')]=[{'all':!![]}];}_0x5a58b1=_[_0xdc3e('0x3f')]({},_0x5a58b1,_0x3e27bc[_0xdc3e('0x41')]);return db['VoiceCallReport'][_0xdc3e('0x4d')](_0x5a58b1)[_0xdc3e('0x24')](handleEntityNotFound(_0x571314,null))[_0xdc3e('0x24')](respondWithResult(_0x571314,null))['catch'](handleError(_0x571314,null));};exports[_0xdc3e('0x4e')]=function(_0x32195b,_0x3eb9d3){return db[_0xdc3e('0x2c')][_0xdc3e('0x4e')](_0x32195b[_0xdc3e('0x4f')],{})[_0xdc3e('0x24')](respondWithResult(_0x3eb9d3,0xc9))[_0xdc3e('0x48')](handleError(_0x3eb9d3,null));};exports[_0xdc3e('0x25')]=function(_0x1dd796,_0x4abca4){return db[_0xdc3e('0x2c')]['find']({'where':{'id':_0x1dd796['params']['id']}})[_0xdc3e('0x24')](handleEntityNotFound(_0x4abca4,null))[_0xdc3e('0x24')](removeEntity(_0x4abca4,null))['catch'](handleError(_0x4abca4,null));};exports['describe']=function(_0x19cdb6,_0x3c1d81){return db[_0xdc3e('0x2c')]['describe']()[_0xdc3e('0x24')](respondWithResult(_0x3c1d81,null))[_0xdc3e('0x48')](handleError(_0x3c1d81,null));};exports[_0xdc3e('0x23')]=function(_0x5d5228,_0x3f966a){if(_0x5d5228[_0xdc3e('0x4f')]['uniqueid']){delete _0x5d5228['body'][_0xdc3e('0x50')];}return db[_0xdc3e('0x2c')][_0xdc3e('0x4d')]({'where':{'uniqueid':_0x5d5228['params']['id'],'UserId':{'$or':[null,_0x5d5228['user']['id']]}}})['then'](handleEntityNotFound(_0x3f966a,null))['then'](saveUpdates(_0x5d5228[_0xdc3e('0x4f')],null))['then'](respondWithResult(_0x3f966a,null))[_0xdc3e('0x48')](handleError(_0x3f966a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 04188c3..1c2525c 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 _0xd32c=['exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x2ac5de,_0x2cebca){var _0x1415b2=function(_0x11e3e9){while(--_0x11e3e9){_0x2ac5de['push'](_0x2ac5de['shift']());}};_0x1415b2(++_0x2cebca);}(_0xd32c,0x113));var _0xcd32=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0xd32c[_0x4503df];return _0x3f1b2b;};'use strict';var _=require(_0xcd32('0x0'));var util=require(_0xcd32('0x1'));var logger=require(_0xcd32('0x2'))(_0xcd32('0x3'));var moment=require(_0xcd32('0x4'));var BPromise=require(_0xcd32('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd32('0x6'));var rimraf=require(_0xcd32('0x7'));var config=require(_0xcd32('0x8'));var attributes=require(_0xcd32('0x9'));module[_0xcd32('0xa')]=function(_0x43f8e5,_0x5a3d75){return _0x43f8e5[_0xcd32('0xb')](_0xcd32('0xc'),attributes,{'tableName':_0xcd32('0xd'),'paranoid':![],'indexes':[{'fields':[_0xcd32('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33a6=['exports','VoiceCallReport','report_call','uniqueid','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0xec1513,_0x2486f5){var _0x110167=function(_0x568409){while(--_0x568409){_0xec1513['push'](_0xec1513['shift']());}};_0x110167(++_0x2486f5);}(_0x33a6,0x17a));var _0x633a=function(_0x257d87,_0x3b6dcd){_0x257d87=_0x257d87-0x0;var _0x305bf4=_0x33a6[_0x257d87];return _0x305bf4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x633a('0x0'))('api');var moment=require(_0x633a('0x1'));var BPromise=require(_0x633a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x633a('0x3'));var rimraf=require(_0x633a('0x4'));var config=require(_0x633a('0x5'));var attributes=require(_0x633a('0x6'));module[_0x633a('0x7')]=function(_0x5502b2,_0x3af3f5){return _0x5502b2['define'](_0x633a('0x8'),attributes,{'tableName':_0x633a('0x9'),'paranoid':![],'indexes':[{'fields':[_0x633a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 4b751ad..5585395 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 _0x11c1=['request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','include','model','then','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceCallReport,\x20%s,\x20%s'];(function(_0x13d216,_0x564ee2){var _0x2cf4c1=function(_0x595d42){while(--_0x595d42){_0x13d216['push'](_0x13d216['shift']());}};_0x2cf4c1(++_0x564ee2);}(_0x11c1,0x11b));var _0x111c=function(_0x197e33,_0x5d7577){_0x197e33=_0x197e33-0x0;var _0x5ab6ff=_0x11c1[_0x197e33];return _0x5ab6ff;};'use strict';var _=require(_0x111c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x111c('0x1'));var fs=require('fs');var Redis=require(_0x111c('0x2'));var db=require(_0x111c('0x3'))['db'];var utils=require(_0x111c('0x4'));var logger=require(_0x111c('0x5'))(_0x111c('0x6'));var config=require(_0x111c('0x7'));var jayson=require(_0x111c('0x8'));var client=jayson[_0x111c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30690a,_0x31dd67,_0x3cbb3a){return new BPromise(function(_0x368124,_0x227fe7){return client[_0x111c('0xa')](_0x30690a,_0x3cbb3a)['then'](function(_0x1600b2){logger[_0x111c('0xb')](_0x111c('0xc'),_0x31dd67,_0x111c('0xd'));logger[_0x111c('0xe')](_0x111c('0xf'),_0x31dd67,_0x111c('0xd'),JSON[_0x111c('0x10')](_0x1600b2));if(_0x1600b2[_0x111c('0x11')]){if(_0x1600b2[_0x111c('0x11')][_0x111c('0x12')]===0x1f4){logger[_0x111c('0x11')](_0x111c('0xc'),_0x31dd67,_0x1600b2[_0x111c('0x11')][_0x111c('0x13')]);return _0x227fe7(_0x1600b2['error'][_0x111c('0x13')]);}logger[_0x111c('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x31dd67,_0x1600b2[_0x111c('0x11')][_0x111c('0x13')]);return _0x368124(_0x1600b2[_0x111c('0x11')][_0x111c('0x13')]);}else{logger['info'](_0x111c('0xc'),_0x31dd67,_0x111c('0xd'));_0x368124(_0x1600b2['result'][_0x111c('0x13')]);}})[_0x111c('0x14')](function(_0x5121f4){logger[_0x111c('0x11')](_0x111c('0xc'),_0x31dd67,_0x5121f4);_0x227fe7(_0x5121f4);});});}exports[_0x111c('0x15')]=function(_0x163756){var _0x14f83a=this;return new Promise(function(_0x1b5302,_0x18e326){return db[_0x111c('0x16')][_0x111c('0x17')]({'raw':_0x163756[_0x111c('0x18')]?_0x163756[_0x111c('0x18')][_0x111c('0x19')]===undefined?!![]:![]:!![],'where':_0x163756[_0x111c('0x18')]?_0x163756[_0x111c('0x18')][_0x111c('0x1a')]||null:null,'attributes':_0x163756[_0x111c('0x18')]?_0x163756[_0x111c('0x18')][_0x111c('0x1b')]||null:null,'limit':_0x163756['options']?_0x163756[_0x111c('0x18')][_0x111c('0x1c')]||null:null,'include':_0x163756[_0x111c('0x18')]?_0x163756['options']['include']?_[_0x111c('0x1d')](_0x163756[_0x111c('0x18')][_0x111c('0x1e')],function(_0x2642e1){return{'model':db[_0x2642e1[_0x111c('0x1f')]],'as':_0x2642e1['as'],'attributes':_0x2642e1[_0x111c('0x1b')],'include':_0x2642e1[_0x111c('0x1e')]?_[_0x111c('0x1d')](_0x2642e1[_0x111c('0x1e')],function(_0x506e36){return{'model':db[_0x506e36[_0x111c('0x1f')]],'as':_0x506e36['as'],'attributes':_0x506e36['attributes'],'include':_0x506e36[_0x111c('0x1e')]?_[_0x111c('0x1d')](_0x506e36['include'],function(_0x18d10d){return{'model':db[_0x18d10d['model']],'as':_0x18d10d['as'],'attributes':_0x18d10d[_0x111c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x111c('0x20')](function(_0x1db772){logger[_0x111c('0xb')](_0x111c('0x15'),_0x163756);logger[_0x111c('0xe')](_0x111c('0x15'),_0x163756,JSON[_0x111c('0x10')](_0x1db772));_0x1b5302(_0x1db772);})[_0x111c('0x14')](function(_0x2e373c){logger[_0x111c('0x11')](_0x111c('0x15'),_0x2e373c[_0x111c('0x13')],_0x163756);_0x18e326(_0x14f83a[_0x111c('0x11')](0x1f4,_0x2e373c[_0x111c('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x3dd447){var _0x390de2=this;return new Promise(function(_0x153c7c,_0x2a0142){return db[_0x111c('0x16')][_0x111c('0x21')](_0x3dd447[_0x111c('0x22')],{'raw':_0x3dd447[_0x111c('0x18')]?_0x3dd447[_0x111c('0x18')][_0x111c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4ed30b){logger[_0x111c('0xb')](_0x111c('0x23'),_0x3dd447);logger[_0x111c('0xe')](_0x111c('0x23'),_0x3dd447,JSON[_0x111c('0x10')](_0x4ed30b));_0x153c7c(_0x4ed30b);})['catch'](function(_0x230ff5){logger[_0x111c('0x11')](_0x111c('0x23'),_0x230ff5[_0x111c('0x13')],_0x3dd447);_0x2a0142(_0x390de2['error'](0x1f4,_0x230ff5['message']));});});};exports[_0x111c('0x24')]=function(_0x3f8cf3){var _0x508440=this;return new Promise(function(_0x45d487,_0x58332a){return db[_0x111c('0x16')]['update'](_0x3f8cf3[_0x111c('0x22')],{'raw':_0x3f8cf3[_0x111c('0x18')]?_0x3f8cf3[_0x111c('0x18')][_0x111c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8cf3['options']?_0x3f8cf3[_0x111c('0x18')]['where']||null:null,'attributes':_0x3f8cf3[_0x111c('0x18')]?_0x3f8cf3[_0x111c('0x18')][_0x111c('0x1b')]||null:null,'limit':_0x3f8cf3[_0x111c('0x18')]?_0x3f8cf3[_0x111c('0x18')][_0x111c('0x1c')]||null:null})[_0x111c('0x20')](function(_0x3819ef){logger[_0x111c('0xb')](_0x111c('0x24'),_0x3f8cf3);logger['debug'](_0x111c('0x24'),_0x3f8cf3,JSON[_0x111c('0x10')](_0x3819ef));_0x45d487(_0x3819ef);})[_0x111c('0x14')](function(_0x3252d6){logger[_0x111c('0x11')](_0x111c('0x24'),_0x3252d6[_0x111c('0x13')],_0x3f8cf3);_0x58332a(_0x508440[_0x111c('0x11')](0x1f4,_0x3252d6['message']));});});}; \ No newline at end of file +var _0x7b70=['error','message','result','catch','GetVoiceCallReport','options','attributes','limit','include','model','map','debug','CreateVoiceCallReport','raw','UpdateVoiceCallReport','VoiceCallReport','body','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1ba8c6,_0xec5c5f){var _0x4a08cf=function(_0x16d16a){while(--_0x16d16a){_0x1ba8c6['push'](_0x1ba8c6['shift']());}};_0x4a08cf(++_0xec5c5f);}(_0x7b70,0xcb));var _0x07b7=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x7b70[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x07b7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x07b7('0x1'));var fs=require('fs');var Redis=require(_0x07b7('0x2'));var db=require(_0x07b7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x07b7('0x4'))(_0x07b7('0x5'));var config=require(_0x07b7('0x6'));var jayson=require(_0x07b7('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x550995,_0x5b6d14,_0x113d07){return new BPromise(function(_0x59dda7,_0x1439b7){return client[_0x07b7('0x8')](_0x550995,_0x113d07)[_0x07b7('0x9')](function(_0x416188){logger[_0x07b7('0xa')](_0x07b7('0xb'),_0x5b6d14,_0x07b7('0xc'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5b6d14,'request\x20sent',JSON[_0x07b7('0xd')](_0x416188));if(_0x416188[_0x07b7('0xe')]){if(_0x416188['error']['code']===0x1f4){logger[_0x07b7('0xe')](_0x07b7('0xb'),_0x5b6d14,_0x416188[_0x07b7('0xe')]['message']);return _0x1439b7(_0x416188['error']['message']);}logger['error'](_0x07b7('0xb'),_0x5b6d14,_0x416188['error'][_0x07b7('0xf')]);return _0x59dda7(_0x416188['error'][_0x07b7('0xf')]);}else{logger['info'](_0x07b7('0xb'),_0x5b6d14,_0x07b7('0xc'));_0x59dda7(_0x416188[_0x07b7('0x10')][_0x07b7('0xf')]);}})[_0x07b7('0x11')](function(_0x307d4f){logger[_0x07b7('0xe')](_0x07b7('0xb'),_0x5b6d14,_0x307d4f);_0x1439b7(_0x307d4f);});});}exports[_0x07b7('0x12')]=function(_0x409c16){var _0x44731f=this;return new Promise(function(_0x49c22e,_0x1bf6d4){return db['VoiceCallReport']['findAll']({'raw':_0x409c16[_0x07b7('0x13')]?_0x409c16[_0x07b7('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x409c16[_0x07b7('0x13')]?_0x409c16['options']['where']||null:null,'attributes':_0x409c16[_0x07b7('0x13')]?_0x409c16[_0x07b7('0x13')][_0x07b7('0x14')]||null:null,'limit':_0x409c16[_0x07b7('0x13')]?_0x409c16[_0x07b7('0x13')][_0x07b7('0x15')]||null:null,'include':_0x409c16['options']?_0x409c16[_0x07b7('0x13')][_0x07b7('0x16')]?_['map'](_0x409c16[_0x07b7('0x13')][_0x07b7('0x16')],function(_0x4d93f8){return{'model':db[_0x4d93f8[_0x07b7('0x17')]],'as':_0x4d93f8['as'],'attributes':_0x4d93f8[_0x07b7('0x14')],'include':_0x4d93f8[_0x07b7('0x16')]?_[_0x07b7('0x18')](_0x4d93f8[_0x07b7('0x16')],function(_0x2a924f){return{'model':db[_0x2a924f[_0x07b7('0x17')]],'as':_0x2a924f['as'],'attributes':_0x2a924f[_0x07b7('0x14')],'include':_0x2a924f[_0x07b7('0x16')]?_[_0x07b7('0x18')](_0x2a924f[_0x07b7('0x16')],function(_0x24ee57){return{'model':db[_0x24ee57[_0x07b7('0x17')]],'as':_0x24ee57['as'],'attributes':_0x24ee57[_0x07b7('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8be6a5){logger[_0x07b7('0xa')](_0x07b7('0x12'),_0x409c16);logger[_0x07b7('0x19')]('GetVoiceCallReport',_0x409c16,JSON[_0x07b7('0xd')](_0x8be6a5));_0x49c22e(_0x8be6a5);})[_0x07b7('0x11')](function(_0x5d1f52){logger[_0x07b7('0xe')](_0x07b7('0x12'),_0x5d1f52[_0x07b7('0xf')],_0x409c16);_0x1bf6d4(_0x44731f[_0x07b7('0xe')](0x1f4,_0x5d1f52[_0x07b7('0xf')]));});});};exports[_0x07b7('0x1a')]=function(_0x5c8b53){var _0xb2c68b=this;return new Promise(function(_0xe88559,_0x52a651){return db['VoiceCallReport']['create'](_0x5c8b53['body'],{'raw':_0x5c8b53['options']?_0x5c8b53[_0x07b7('0x13')][_0x07b7('0x1b')]===undefined?!![]:![]:!![]})[_0x07b7('0x9')](function(_0x396705){logger[_0x07b7('0xa')](_0x07b7('0x1a'),_0x5c8b53);logger[_0x07b7('0x19')](_0x07b7('0x1a'),_0x5c8b53,JSON[_0x07b7('0xd')](_0x396705));_0xe88559(_0x396705);})[_0x07b7('0x11')](function(_0x3c0263){logger['error'](_0x07b7('0x1a'),_0x3c0263['message'],_0x5c8b53);_0x52a651(_0xb2c68b['error'](0x1f4,_0x3c0263[_0x07b7('0xf')]));});});};exports[_0x07b7('0x1c')]=function(_0x5a5248){var _0x2a23b0=this;return new Promise(function(_0x25a63d,_0x279ea5){return db[_0x07b7('0x1d')]['update'](_0x5a5248[_0x07b7('0x1e')],{'raw':_0x5a5248[_0x07b7('0x13')]?_0x5a5248[_0x07b7('0x13')][_0x07b7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a5248[_0x07b7('0x13')]?_0x5a5248['options']['where']||null:null,'attributes':_0x5a5248['options']?_0x5a5248[_0x07b7('0x13')][_0x07b7('0x14')]||null:null,'limit':_0x5a5248['options']?_0x5a5248[_0x07b7('0x13')][_0x07b7('0x15')]||null:null})[_0x07b7('0x9')](function(_0x4f6daa){logger['info']('UpdateVoiceCallReport',_0x5a5248);logger[_0x07b7('0x19')](_0x07b7('0x1c'),_0x5a5248,JSON[_0x07b7('0xd')](_0x4f6daa));_0x25a63d(_0x4f6daa);})[_0x07b7('0x11')](function(_0x1ca46a){logger[_0x07b7('0xe')](_0x07b7('0x1c'),_0x1ca46a[_0x07b7('0xf')],_0x5a5248);_0x279ea5(_0x2a23b0[_0x07b7('0xe')](0x1f4,_0x1ca46a[_0x07b7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 7ed228a..a7f7cee 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 _0xf31b=['index','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceChanSpy.controller'];(function(_0xfca93a,_0x49c794){var _0xc7bcb9=function(_0x1ba525){while(--_0x1ba525){_0xfca93a['push'](_0xfca93a['shift']());}};_0xc7bcb9(++_0x49c794);}(_0xf31b,0x1a0));var _0xbf31=function(_0x24ce87,_0xf0d336){_0x24ce87=_0x24ce87-0x0;var _0x327c23=_0xf31b[_0x24ce87];return _0x327c23;};'use strict';var multer=require(_0xbf31('0x0'));var util=require(_0xbf31('0x1'));var path=require(_0xbf31('0x2'));var timeout=require(_0xbf31('0x3'));var express=require(_0xbf31('0x4'));var router=express[_0xbf31('0x5')]();var auth=require(_0xbf31('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbf31('0x7'));var controller=require(_0xbf31('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbf31('0x9')]);router['get'](_0xbf31('0xa'),auth[_0xbf31('0xb')](),controller['show']);router['post']('/',auth[_0xbf31('0xb')](),controller['create']);router[_0xbf31('0xc')](_0xbf31('0xa'),auth[_0xbf31('0xb')](),controller[_0xbf31('0xd')]);router[_0xbf31('0xe')](_0xbf31('0xa'),auth[_0xbf31('0xb')](),controller[_0xbf31('0xf')]);module[_0xbf31('0x10')]=router; \ No newline at end of file +var _0x8ff3=['post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show'];(function(_0x4745d9,_0x411b00){var _0x38f2ac=function(_0x436be3){while(--_0x436be3){_0x4745d9['push'](_0x4745d9['shift']());}};_0x38f2ac(++_0x411b00);}(_0x8ff3,0x72));var _0x38ff=function(_0x53fcd0,_0x294576){_0x53fcd0=_0x53fcd0-0x0;var _0x456acb=_0x8ff3[_0x53fcd0];return _0x456acb;};'use strict';var multer=require(_0x38ff('0x0'));var util=require(_0x38ff('0x1'));var path=require('path');var timeout=require(_0x38ff('0x2'));var express=require(_0x38ff('0x3'));var router=express[_0x38ff('0x4')]();var auth=require(_0x38ff('0x5'));var interaction=require(_0x38ff('0x6'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x38ff('0x7')]('/',auth['isAuthenticated'](),controller[_0x38ff('0x8')]);router['get'](_0x38ff('0x9'),auth[_0x38ff('0xa')](),controller[_0x38ff('0xb')]);router[_0x38ff('0xc')]('/',auth[_0x38ff('0xa')](),controller[_0x38ff('0xd')]);router[_0x38ff('0xe')](_0x38ff('0x9'),auth[_0x38ff('0xa')](),controller[_0x38ff('0xf')]);router[_0x38ff('0x10')](_0x38ff('0x9'),auth[_0x38ff('0xa')](),controller['destroy']);module[_0x38ff('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 5519149..6c5e39b 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 _0xc868=['join','getDataValue','split','BOOLEAN','sequelize','STRING','setDataValue','options'];(function(_0x57c9c7,_0xb70a91){var _0x48ad8b=function(_0x51af55){while(--_0x51af55){_0x57c9c7['push'](_0x57c9c7['shift']());}};_0x48ad8b(++_0xb70a91);}(_0xc868,0x1ec));var _0x8c86=function(_0x2444c1,_0x347b12){_0x2444c1=_0x2444c1-0x0;var _0xb9cedf=_0xc868[_0x2444c1];return _0xb9cedf;};'use strict';var Sequelize=require(_0x8c86('0x0'));module['exports']={'name':{'type':Sequelize[_0x8c86('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x8c86('0x1')],'set':function(_0x16b0bf){this[_0x8c86('0x2')](_0x8c86('0x3'),_0x16b0bf?_0x16b0bf[_0x8c86('0x4')](''):[]);},'get':function(){return this[_0x8c86('0x5')](_0x8c86('0x3'))?this['getDataValue'](_0x8c86('0x3'))[_0x8c86('0x6')](''):[];}},'auth':{'type':Sequelize[_0x8c86('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x8c86('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8c86('0x1')]}}; \ No newline at end of file +var _0x555b=['join','getDataValue','sequelize','exports','STRING','name','options'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x555b,0x1de));var _0xb555=function(_0x480c86,_0x279ef1){_0x480c86=_0x480c86-0x0;var _0x3c4527=_0x555b[_0x480c86];return _0x3c4527;};'use strict';var Sequelize=require(_0xb555('0x0'));module[_0xb555('0x1')]={'name':{'type':Sequelize[_0xb555('0x2')]},'prefix':{'type':Sequelize[_0xb555('0x2')],'unique':_0xb555('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x46ee56){this['setDataValue'](_0xb555('0x4'),_0x46ee56?_0x46ee56[_0xb555('0x5')](''):[]);},'get':function(){return this[_0xb555('0x6')](_0xb555('0x4'))?this[_0xb555('0x6')](_0xb555('0x4'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xb555('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xb555('0x2')]},'description':{'type':Sequelize[_0xb555('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index a7d8236..874fa52 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 _0x3559=['fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','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','set','Content-Range','apply','reject','update','then','destroy','ChanSpies','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','body','html-pdf','zip-dir'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x3559,0xee));var _0x9355=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3559[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0x9355('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9355('0x1'));var jsonpatch=require(_0x9355('0x2'));var rp=require(_0x9355('0x3'));var moment=require('moment');var BPromise=require(_0x9355('0x4'));var Mustache=require(_0x9355('0x5'));var util=require('util');var path=require(_0x9355('0x6'));var sox=require('sox');var csv=require(_0x9355('0x7'));var ejs=require(_0x9355('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9355('0x9'));var crypto=require(_0x9355('0xa'));var jsforce=require(_0x9355('0xb'));var deskjs=require(_0x9355('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9355('0xd'));var Papa=require('papaparse');var Redis=require(_0x9355('0xe'));var authService=require(_0x9355('0xf'));var qs=require(_0x9355('0x10'));var as=require(_0x9355('0x11'));var hardwareService=require(_0x9355('0x12'));var logger=require(_0x9355('0x13'))(_0x9355('0x14'));var utils=require('../../config/utils');var config=require(_0x9355('0x15'));var db=require(_0x9355('0x16'))['db'];function respondWithStatusCode(_0xd0efc2,_0x1d82a1){_0x1d82a1=_0x1d82a1||0xcc;return function(_0x11c1d4){if(_0x11c1d4){return _0xd0efc2[_0x9355('0x17')](_0x1d82a1);}return _0xd0efc2[_0x9355('0x18')](_0x1d82a1)['end']();};}function respondWithResult(_0x38b30d,_0x189362){_0x189362=_0x189362||0xc8;return function(_0x2c104c){if(_0x2c104c){return _0x38b30d[_0x9355('0x18')](_0x189362)[_0x9355('0x19')](_0x2c104c);}};}function respondWithFilteredResult(_0x466789,_0x286ea5){return function(_0x955d39){if(_0x955d39){var _0x539347=_0x955d39[_0x9355('0x1a')],_0x45486e=_0x286ea5[_0x9355('0x1b')],_0x3edb03=_0x286ea5[_0x9355('0x1b')]+_0x286ea5[_0x9355('0x1c')],_0xa8d1a9;if(_0x3edb03>=_0x539347){_0x3edb03=_0x539347;_0xa8d1a9=0xc8;}else{_0xa8d1a9=0xce;}_0x466789[_0x9355('0x18')](_0xa8d1a9);return _0x466789[_0x9355('0x1d')](_0x9355('0x1e'),_0x45486e+'-'+_0x3edb03+'/'+_0x539347)[_0x9355('0x19')](_0x955d39);}return null;};}function patchUpdates(_0x4c0224){return function(_0xa37cf2){try{jsonpatch[_0x9355('0x1f')](_0xa37cf2,_0x4c0224,!![]);}catch(_0x4c9636){return BPromise[_0x9355('0x20')](_0x4c9636);}return _0xa37cf2['save']();};}function saveUpdates(_0x559322,_0x46db18){return function(_0x293219){if(_0x293219){return _0x293219[_0x9355('0x21')](_0x559322)[_0x9355('0x22')](function(_0x2c0468){return _0x2c0468;});}return null;};}function removeEntity(_0x13f0dc,_0x3a240c){return function(_0x2c29df){if(_0x2c29df){return _0x2c29df[_0x9355('0x23')]()[_0x9355('0x22')](function(){var _0x2496f4=_0x2c29df['get']({'plain':!![]});var _0x22fc03=_0x9355('0x24');return db[_0x9355('0x25')][_0x9355('0x23')]({'where':{'type':_0x22fc03,'resourceId':_0x2496f4['id']}})[_0x9355('0x22')](function(){return _0x2c29df;});})[_0x9355('0x22')](function(){_0x13f0dc[_0x9355('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4410df,_0x28f714){return function(_0x47cd2e){if(!_0x47cd2e){_0x4410df['sendStatus'](0x194);}return _0x47cd2e;};}function handleError(_0x16452d,_0xa39767){_0xa39767=_0xa39767||0x1f4;return function(_0x209523){logger[_0x9355('0x26')](_0x209523[_0x9355('0x27')]);if(_0x209523[_0x9355('0x28')]){delete _0x209523['name'];}_0x16452d[_0x9355('0x18')](_0xa39767)[_0x9355('0x29')](_0x209523);};}exports[_0x9355('0x2a')]=function(_0x9eec,_0x1cb058){var _0x1e24fe={},_0x594232={},_0x5f3261={'count':0x0,'rows':[]};var _0x5322f7=_['map'](db[_0x9355('0x2b')][_0x9355('0x2c')],function(_0x94d06f){return{'name':_0x94d06f['fieldName'],'type':_0x94d06f[_0x9355('0x2d')][_0x9355('0x2e')]};});_0x594232[_0x9355('0x2f')]=_[_0x9355('0x30')](_0x5322f7,_0x9355('0x28'));_0x594232[_0x9355('0x31')]=_[_0x9355('0x32')](_0x9eec[_0x9355('0x31')]);_0x594232[_0x9355('0x33')]=_[_0x9355('0x34')](_0x594232[_0x9355('0x2f')],_0x594232[_0x9355('0x31')]);_0x1e24fe['attributes']=_[_0x9355('0x34')](_0x594232[_0x9355('0x2f')],qs[_0x9355('0x35')](_0x9eec[_0x9355('0x31')][_0x9355('0x35')]));_0x1e24fe['attributes']=_0x1e24fe[_0x9355('0x36')][_0x9355('0x37')]?_0x1e24fe[_0x9355('0x36')]:_0x594232[_0x9355('0x2f')];if(!_0x9eec[_0x9355('0x31')]['hasOwnProperty']('nolimit')){_0x1e24fe[_0x9355('0x1c')]=qs[_0x9355('0x1c')](_0x9eec[_0x9355('0x31')][_0x9355('0x1c')]);_0x1e24fe[_0x9355('0x1b')]=qs[_0x9355('0x1b')](_0x9eec[_0x9355('0x31')]['offset']);}_0x1e24fe[_0x9355('0x38')]=qs[_0x9355('0x39')](_0x9eec['query'][_0x9355('0x39')]);_0x1e24fe[_0x9355('0x3a')]=qs['filters'](_[_0x9355('0x3b')](_0x9eec['query'],_0x594232[_0x9355('0x33')]));if(_0x9eec['query'][_0x9355('0x3c')]){_0x1e24fe[_0x9355('0x3a')]=_[_0x9355('0x3d')](_0x1e24fe[_0x9355('0x3a')],{'$or':_[_0x9355('0x30')](_0x5322f7,function(_0xbb624d){if(_0xbb624d[_0x9355('0x2d')]!==_0x9355('0x3e')){var _0x37590b={};_0x37590b[_0xbb624d[_0x9355('0x28')]]={'$like':'%'+_0x9eec['query'][_0x9355('0x3c')]+'%'};return _0x37590b;}})});}_0x1e24fe=_[_0x9355('0x3d')]({},_0x1e24fe,_0x9eec[_0x9355('0x3f')]);var _0x406da1={'where':_0x1e24fe[_0x9355('0x3a')]};return db['VoiceChanSpy'][_0x9355('0x1a')](_0x406da1)[_0x9355('0x22')](function(_0x457cab){_0x5f3261[_0x9355('0x1a')]=_0x457cab;if(_0x9eec[_0x9355('0x31')][_0x9355('0x40')]){_0x1e24fe['include']=[{'all':!![]}];}return db[_0x9355('0x2b')][_0x9355('0x41')](_0x1e24fe);})[_0x9355('0x22')](function(_0x7354f2){_0x5f3261[_0x9355('0x42')]=_0x7354f2;return _0x5f3261;})[_0x9355('0x22')](respondWithFilteredResult(_0x1cb058,_0x1e24fe))['catch'](handleError(_0x1cb058,null));};exports[_0x9355('0x43')]=function(_0x328d0a,_0x36e927){var _0x4e6443={'raw':![],'where':{'id':_0x328d0a[_0x9355('0x44')]['id']}},_0x4292f3={};_0x4292f3[_0x9355('0x2f')]=_[_0x9355('0x32')](db['VoiceChanSpy'][_0x9355('0x2c')]);_0x4292f3[_0x9355('0x31')]=_[_0x9355('0x32')](_0x328d0a[_0x9355('0x31')]);_0x4292f3[_0x9355('0x33')]=_[_0x9355('0x34')](_0x4292f3[_0x9355('0x2f')],_0x4292f3[_0x9355('0x31')]);_0x4e6443[_0x9355('0x36')]=_[_0x9355('0x34')](_0x4292f3['model'],qs[_0x9355('0x35')](_0x328d0a[_0x9355('0x31')][_0x9355('0x35')]));_0x4e6443[_0x9355('0x36')]=_0x4e6443[_0x9355('0x36')]['length']?_0x4e6443['attributes']:_0x4292f3['model'];if(_0x328d0a[_0x9355('0x31')][_0x9355('0x40')]){_0x4e6443[_0x9355('0x45')]=[{'all':!![]}];}_0x4e6443=_[_0x9355('0x3d')]({},_0x4e6443,_0x328d0a[_0x9355('0x3f')]);return db[_0x9355('0x2b')][_0x9355('0x46')](_0x4e6443)[_0x9355('0x22')](handleEntityNotFound(_0x36e927,null))[_0x9355('0x22')](respondWithResult(_0x36e927,null))[_0x9355('0x47')](handleError(_0x36e927,null));};exports[_0x9355('0x48')]=function(_0x3a1b66,_0x3e7d1b){return db[_0x9355('0x2b')]['create'](_0x3a1b66['body'],{})[_0x9355('0x22')](function(_0x38babc){var _0x36af5f=_0x3a1b66[_0x9355('0x49')][_0x9355('0x4a')]({'plain':!![]});if(!_0x36af5f)throw new Error(_0x9355('0x4b'));if(_0x36af5f[_0x9355('0x4c')]===_0x9355('0x49')){var _0x1e10a3=_0x38babc[_0x9355('0x4a')]({'plain':!![]});var _0x488297=_0x9355('0x24');return db['UserProfileSection'][_0x9355('0x46')]({'where':{'name':_0x488297,'userProfileId':_0x36af5f[_0x9355('0x4d')]},'raw':!![]})[_0x9355('0x22')](function(_0x4fb1f3){if(_0x4fb1f3&&_0x4fb1f3[_0x9355('0x4e')]===0x0){return db[_0x9355('0x25')][_0x9355('0x48')]({'name':_0x1e10a3['name'],'resourceId':_0x1e10a3['id'],'type':_0x4fb1f3['name'],'sectionId':_0x4fb1f3['id']},{})['then'](function(){return _0x38babc;});}else{return _0x38babc;}})[_0x9355('0x47')](function(_0x331017){logger[_0x9355('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x331017);throw _0x331017;});}return _0x38babc;})[_0x9355('0x22')](respondWithResult(_0x3e7d1b,0xc9))['catch'](handleError(_0x3e7d1b,null));};exports[_0x9355('0x21')]=function(_0x4b9218,_0x4f480e){if(_0x4b9218['body']['id']){delete _0x4b9218[_0x9355('0x4f')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x4b9218[_0x9355('0x44')]['id']}})[_0x9355('0x22')](handleEntityNotFound(_0x4f480e,null))[_0x9355('0x22')](saveUpdates(_0x4b9218['body'],null))['then'](respondWithResult(_0x4f480e,null))['catch'](handleError(_0x4f480e,null));};exports['destroy']=function(_0x1caece,_0x170805){return db[_0x9355('0x2b')][_0x9355('0x46')]({'where':{'id':_0x1caece[_0x9355('0x44')]['id']}})[_0x9355('0x22')](handleEntityNotFound(_0x170805,null))[_0x9355('0x22')](removeEntity(_0x170805,null))[_0x9355('0x47')](handleError(_0x170805,null));}; \ No newline at end of file +var _0x89bf=['intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','find','create','body','get','ChanSpies','autoAssociation','catch','params','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x284885,_0x34b143){var _0x3a9710=function(_0x31eda3){while(--_0x31eda3){_0x284885['push'](_0x284885['shift']());}};_0x3a9710(++_0x34b143);}(_0x89bf,0xb5));var _0xf89b=function(_0x4a8788,_0x432f7e){_0x4a8788=_0x4a8788-0x0;var _0x547da5=_0x89bf[_0x4a8788];return _0x547da5;};'use strict';var pdf=require(_0xf89b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf89b('0x1'));var zipdir=require(_0xf89b('0x2'));var jsonpatch=require(_0xf89b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf89b('0x4'));var Mustache=require(_0xf89b('0x5'));var util=require('util');var path=require(_0xf89b('0x6'));var sox=require(_0xf89b('0x7'));var csv=require(_0xf89b('0x8'));var ejs=require(_0xf89b('0x9'));var fs=require('fs');var _=require(_0xf89b('0xa'));var squel=require(_0xf89b('0xb'));var crypto=require(_0xf89b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf89b('0xd'));var Papa=require(_0xf89b('0xe'));var Redis=require(_0xf89b('0xf'));var authService=require(_0xf89b('0x10'));var qs=require(_0xf89b('0x11'));var as=require(_0xf89b('0x12'));var hardwareService=require(_0xf89b('0x13'));var logger=require(_0xf89b('0x14'))(_0xf89b('0x15'));var utils=require(_0xf89b('0x16'));var config=require(_0xf89b('0x17'));var db=require(_0xf89b('0x18'))['db'];function respondWithStatusCode(_0x97cb1b,_0xd0bb76){_0xd0bb76=_0xd0bb76||0xcc;return function(_0x56f31b){if(_0x56f31b){return _0x97cb1b[_0xf89b('0x19')](_0xd0bb76);}return _0x97cb1b['status'](_0xd0bb76)[_0xf89b('0x1a')]();};}function respondWithResult(_0x549e90,_0x29de93){_0x29de93=_0x29de93||0xc8;return function(_0xe486f2){if(_0xe486f2){return _0x549e90[_0xf89b('0x1b')](_0x29de93)['json'](_0xe486f2);}};}function respondWithFilteredResult(_0x13cd9a,_0x1414a1){return function(_0x5e84ff){if(_0x5e84ff){var _0x51c6b1=_0x5e84ff[_0xf89b('0x1c')],_0x1d0239=_0x1414a1[_0xf89b('0x1d')],_0x1434c1=_0x1414a1['offset']+_0x1414a1[_0xf89b('0x1e')],_0x41444e;if(_0x1434c1>=_0x51c6b1){_0x1434c1=_0x51c6b1;_0x41444e=0xc8;}else{_0x41444e=0xce;}_0x13cd9a[_0xf89b('0x1b')](_0x41444e);return _0x13cd9a[_0xf89b('0x1f')](_0xf89b('0x20'),_0x1d0239+'-'+_0x1434c1+'/'+_0x51c6b1)[_0xf89b('0x21')](_0x5e84ff);}return null;};}function patchUpdates(_0x65d4bd){return function(_0x1c29a0){try{jsonpatch['apply'](_0x1c29a0,_0x65d4bd,!![]);}catch(_0x2dbdaf){return BPromise[_0xf89b('0x22')](_0x2dbdaf);}return _0x1c29a0[_0xf89b('0x23')]();};}function saveUpdates(_0x1d640d,_0x19250a){return function(_0x2112f6){if(_0x2112f6){return _0x2112f6[_0xf89b('0x24')](_0x1d640d)[_0xf89b('0x25')](function(_0x44b233){return _0x44b233;});}return null;};}function removeEntity(_0x1eafb4,_0x53bc88){return function(_0x19a638){if(_0x19a638){return _0x19a638[_0xf89b('0x26')]()[_0xf89b('0x25')](function(){var _0x229b9d=_0x19a638['get']({'plain':!![]});var _0x4e9bf8='ChanSpies';return db[_0xf89b('0x27')][_0xf89b('0x26')]({'where':{'type':_0x4e9bf8,'resourceId':_0x229b9d['id']}})['then'](function(){return _0x19a638;});})['then'](function(){_0x1eafb4[_0xf89b('0x1b')](0xcc)[_0xf89b('0x1a')]();});}};}function handleEntityNotFound(_0x2ebdd6,_0x925d81){return function(_0x405342){if(!_0x405342){_0x2ebdd6['sendStatus'](0x194);}return _0x405342;};}function handleError(_0x178199,_0x1de5c3){_0x1de5c3=_0x1de5c3||0x1f4;return function(_0x81a86){logger[_0xf89b('0x28')](_0x81a86['stack']);if(_0x81a86[_0xf89b('0x29')]){delete _0x81a86['name'];}_0x178199[_0xf89b('0x1b')](_0x1de5c3)[_0xf89b('0x2a')](_0x81a86);};}exports[_0xf89b('0x2b')]=function(_0x2e0ece,_0x55dd34){var _0x7135a4={},_0x4b627d={},_0x49fd39={'count':0x0,'rows':[]};var _0x3d74e9=_['map'](db[_0xf89b('0x2c')][_0xf89b('0x2d')],function(_0x30ba3b){return{'name':_0x30ba3b[_0xf89b('0x2e')],'type':_0x30ba3b[_0xf89b('0x2f')][_0xf89b('0x30')]};});_0x4b627d[_0xf89b('0x31')]=_[_0xf89b('0x32')](_0x3d74e9,_0xf89b('0x29'));_0x4b627d[_0xf89b('0x33')]=_[_0xf89b('0x34')](_0x2e0ece['query']);_0x4b627d['filters']=_[_0xf89b('0x35')](_0x4b627d[_0xf89b('0x31')],_0x4b627d[_0xf89b('0x33')]);_0x7135a4['attributes']=_[_0xf89b('0x35')](_0x4b627d[_0xf89b('0x31')],qs[_0xf89b('0x36')](_0x2e0ece[_0xf89b('0x33')]['fields']));_0x7135a4[_0xf89b('0x37')]=_0x7135a4[_0xf89b('0x37')][_0xf89b('0x38')]?_0x7135a4[_0xf89b('0x37')]:_0x4b627d[_0xf89b('0x31')];if(!_0x2e0ece['query'][_0xf89b('0x39')]('nolimit')){_0x7135a4[_0xf89b('0x1e')]=qs[_0xf89b('0x1e')](_0x2e0ece[_0xf89b('0x33')][_0xf89b('0x1e')]);_0x7135a4[_0xf89b('0x1d')]=qs['offset'](_0x2e0ece[_0xf89b('0x33')]['offset']);}_0x7135a4[_0xf89b('0x3a')]=qs[_0xf89b('0x3b')](_0x2e0ece[_0xf89b('0x33')][_0xf89b('0x3b')]);_0x7135a4[_0xf89b('0x3c')]=qs[_0xf89b('0x3d')](_[_0xf89b('0x3e')](_0x2e0ece[_0xf89b('0x33')],_0x4b627d['filters']));if(_0x2e0ece[_0xf89b('0x33')][_0xf89b('0x3f')]){_0x7135a4[_0xf89b('0x3c')]=_[_0xf89b('0x40')](_0x7135a4['where'],{'$or':_[_0xf89b('0x32')](_0x3d74e9,function(_0x3f09eb){if(_0x3f09eb['type']!==_0xf89b('0x41')){var _0x2b5c85={};_0x2b5c85[_0x3f09eb[_0xf89b('0x29')]]={'$like':'%'+_0x2e0ece['query'][_0xf89b('0x3f')]+'%'};return _0x2b5c85;}})});}_0x7135a4=_['merge']({},_0x7135a4,_0x2e0ece[_0xf89b('0x42')]);var _0x2ea99e={'where':_0x7135a4[_0xf89b('0x3c')]};return db[_0xf89b('0x2c')][_0xf89b('0x1c')](_0x2ea99e)[_0xf89b('0x25')](function(_0x38ea54){_0x49fd39[_0xf89b('0x1c')]=_0x38ea54;if(_0x2e0ece[_0xf89b('0x33')][_0xf89b('0x43')]){_0x7135a4['include']=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x7135a4);})[_0xf89b('0x25')](function(_0x1f268e){_0x49fd39[_0xf89b('0x44')]=_0x1f268e;return _0x49fd39;})[_0xf89b('0x25')](respondWithFilteredResult(_0x55dd34,_0x7135a4))['catch'](handleError(_0x55dd34,null));};exports[_0xf89b('0x45')]=function(_0x16d906,_0x30582f){var _0x42fb6e={'raw':![],'where':{'id':_0x16d906['params']['id']}},_0x1dd5a8={};_0x1dd5a8[_0xf89b('0x31')]=_['keys'](db['VoiceChanSpy'][_0xf89b('0x2d')]);_0x1dd5a8['query']=_[_0xf89b('0x34')](_0x16d906['query']);_0x1dd5a8[_0xf89b('0x3d')]=_[_0xf89b('0x35')](_0x1dd5a8['model'],_0x1dd5a8[_0xf89b('0x33')]);_0x42fb6e['attributes']=_['intersection'](_0x1dd5a8[_0xf89b('0x31')],qs[_0xf89b('0x36')](_0x16d906[_0xf89b('0x33')][_0xf89b('0x36')]));_0x42fb6e[_0xf89b('0x37')]=_0x42fb6e[_0xf89b('0x37')][_0xf89b('0x38')]?_0x42fb6e['attributes']:_0x1dd5a8[_0xf89b('0x31')];if(_0x16d906[_0xf89b('0x33')][_0xf89b('0x43')]){_0x42fb6e['include']=[{'all':!![]}];}_0x42fb6e=_[_0xf89b('0x40')]({},_0x42fb6e,_0x16d906['options']);return db[_0xf89b('0x2c')][_0xf89b('0x46')](_0x42fb6e)['then'](handleEntityNotFound(_0x30582f,null))[_0xf89b('0x25')](respondWithResult(_0x30582f,null))['catch'](handleError(_0x30582f,null));};exports[_0xf89b('0x47')]=function(_0x49b8f0,_0x4e3c8e){return db[_0xf89b('0x2c')][_0xf89b('0x47')](_0x49b8f0[_0xf89b('0x48')],{})[_0xf89b('0x25')](function(_0x2818c8){var _0x2c0eb5=_0x49b8f0['user'][_0xf89b('0x49')]({'plain':!![]});if(!_0x2c0eb5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c0eb5['role']==='user'){var _0x1154bf=_0x2818c8[_0xf89b('0x49')]({'plain':!![]});var _0x54ef9f=_0xf89b('0x4a');return db['UserProfileSection'][_0xf89b('0x46')]({'where':{'name':_0x54ef9f,'userProfileId':_0x2c0eb5['userProfileId']},'raw':!![]})['then'](function(_0x292319){if(_0x292319&&_0x292319[_0xf89b('0x4b')]===0x0){return db[_0xf89b('0x27')][_0xf89b('0x47')]({'name':_0x1154bf[_0xf89b('0x29')],'resourceId':_0x1154bf['id'],'type':_0x292319[_0xf89b('0x29')],'sectionId':_0x292319['id']},{})['then'](function(){return _0x2818c8;});}else{return _0x2818c8;}})[_0xf89b('0x4c')](function(_0x2f961e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f961e);throw _0x2f961e;});}return _0x2818c8;})[_0xf89b('0x25')](respondWithResult(_0x4e3c8e,0xc9))['catch'](handleError(_0x4e3c8e,null));};exports[_0xf89b('0x24')]=function(_0x5d15cb,_0x10fa40){if(_0x5d15cb[_0xf89b('0x48')]['id']){delete _0x5d15cb[_0xf89b('0x48')]['id'];}return db[_0xf89b('0x2c')][_0xf89b('0x46')]({'where':{'id':_0x5d15cb[_0xf89b('0x4d')]['id']}})[_0xf89b('0x25')](handleEntityNotFound(_0x10fa40,null))[_0xf89b('0x25')](saveUpdates(_0x5d15cb[_0xf89b('0x48')],null))[_0xf89b('0x25')](respondWithResult(_0x10fa40,null))[_0xf89b('0x4c')](handleError(_0x10fa40,null));};exports[_0xf89b('0x26')]=function(_0x3f6a08,_0x92e0ec){return db[_0xf89b('0x2c')][_0xf89b('0x46')]({'where':{'id':_0x3f6a08[_0xf89b('0x4d')]['id']}})[_0xf89b('0x25')](handleEntityNotFound(_0x92e0ec,null))[_0xf89b('0x25')](removeEntity(_0x92e0ec,null))[_0xf89b('0x4c')](handleError(_0x92e0ec,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 5c2810f..87b67ac 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 _0x786a=['CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','password','ChanSpy','name','options','join','StopMixMonitor','length','internal','concat','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set'];(function(_0x4a4d88,_0x2be95a){var _0x479329=function(_0x37bb8e){while(--_0x37bb8e){_0x4a4d88['push'](_0x4a4d88['shift']());}};_0x479329(++_0x2be95a);}(_0x786a,0x11c));var _0xa786=function(_0x4a91a9,_0x5491e8){_0x4a91a9=_0x4a91a9-0x0;var _0x2a9bbe=_0x786a[_0x4a91a9];return _0x2a9bbe;};'use strict';var _=require(_0xa786('0x0'));var util=require(_0xa786('0x1'));var BPromise=require('bluebird');var attributes=require(_0xa786('0x2'));var getUserApplications=function(_0x5ea5fa,_0x5d2b83,_0x1eede0){var _0x46dd84=0x1;var _0x5a1932=[];var _0x383596={'context':_0x5d2b83[_0xa786('0x3')]||_0xa786('0x4'),'exten':util[_0xa786('0x5')](_0xa786('0x6'),_0x5ea5fa[_0xa786('0x7')],_0x1eede0),'type':_0xa786('0x8'),'isApp':![],'ChanSpyId':_0x5ea5fa['id'],'UserId':_0x5d2b83['id']};_0x5a1932[_0xa786('0x9')](_[_0xa786('0xa')]({'app':_0xa786('0xb'),'appdata':util[_0xa786('0x5')](_0xa786('0xc'),_0xa786('0xd')),'priority':_0x46dd84++},_0x383596));if(_0x5ea5fa[_0xa786('0xe')]){_0x5a1932[_0xa786('0x9')](_[_0xa786('0xa')]({'app':_0xa786('0xf'),'appdata':util[_0xa786('0x5')](_0xa786('0x10'),_0x5ea5fa['recordingFormat']),'priority':_0x46dd84++},_0x383596));}if(_0x5ea5fa['auth']){_0x5a1932[_0xa786('0x9')](_[_0xa786('0xa')]({'app':'Authenticate','appdata':_0x5ea5fa[_0xa786('0x11')],'priority':_0x46dd84++},_0x383596));}_0x5a1932['push'](_['merge']({'app':_0xa786('0x12'),'appdata':util['format']('SIP/%s,%s',_0x5d2b83[_0xa786('0x13')],_0x5ea5fa[_0xa786('0x14')]?_0x5ea5fa[_0xa786('0x14')][_0xa786('0x15')](''):''),'priority':_0x46dd84++},_0x383596));if(_0x5ea5fa['record']){_0x5a1932[_0xa786('0x9')](_[_0xa786('0xa')]({'app':_0xa786('0x16'),'priority':_0x46dd84++},_0x383596));}return _0x5a1932;};var getChanSpyApplications=function(_0x277ab3,_0x1e4509){var _0x54a185=[];for(var _0x421457=0x0,_0x39b842=0x1;_0x421457<_0x1e4509[_0xa786('0x17')];_0x421457++,_0x39b842=0x1){_0x54a185=_0x54a185['concat'](getUserApplications(_0x277ab3,_0x1e4509[_0x421457],_0x1e4509[_0x421457][_0xa786('0x18')]));if(_0x1e4509[_0x421457][_0xa786('0x18')]!=_0x1e4509[_0x421457][_0xa786('0x13')]){_0x54a185=_0x54a185[_0xa786('0x19')](getUserApplications(_0x277ab3,_0x1e4509[_0x421457],_0x1e4509[_0x421457][_0xa786('0x13')]));}}return _0x54a185;};var getChanSpyPromise=function(_0x504ec0,_0x18bf30){return new BPromise(function(_0x3a9820,_0x5a5736){return _0x504ec0['User'][_0xa786('0x1a')]({'attributes':['id',_0xa786('0x13'),_0xa786('0x18')],'where':{'role':_0xa786('0x1b'),'chanspy':!![]},'raw':!![]})[_0xa786('0x1c')](function(_0x2ceec7){if(_0x2ceec7){return _0x3a9820(getChanSpyApplications(_0x18bf30,_0x2ceec7));}return _0x3a9820([]);})[_0xa786('0x1d')](function(_0x1b52a8){_0x5a5736(_0x1b52a8);});});};module[_0xa786('0x1e')]=function(_0x1f1411,_0x586f54){var _0x2ceec1=_0x1f1411[_0xa786('0x1f')];return _0x1f1411['define'](_0xa786('0x20'),attributes,{'tableName':_0xa786('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c3342,_0x1a3c18,_0x835906){return getChanSpyPromise(_0x2ceec1,_0x1c3342)[_0xa786('0x1c')](function(_0x4e2233){if(_0x4e2233&&_0x4e2233['length']){return _0x2ceec1['VoiceExtension'][_0xa786('0x22')](_0x4e2233);}})['then'](function(){_0x835906();})['catch'](function(_0x50347c){_0x835906(_0x50347c);});},'afterUpdate':function(_0x10de8b,_0x567637,_0xaf4b09){return _0x2ceec1[_0xa786('0x23')][_0xa786('0x24')]({'where':{'ChanSpyId':_0x10de8b['id']}})[_0xa786('0x1c')](function(){return getChanSpyPromise(_0x2ceec1,_0x10de8b);})['then'](function(_0x5bfcfe){if(_0x5bfcfe&&_0x5bfcfe[_0xa786('0x17')]){return _0x2ceec1['VoiceExtension'][_0xa786('0x22')](_0x5bfcfe);}})[_0xa786('0x1c')](function(){_0xaf4b09();})[_0xa786('0x1d')](function(_0x253288){_0xaf4b09(_0x253288);});},'afterDestroy':function(_0x1f191e,_0x497d17,_0x36182f){return _0x2ceec1[_0xa786('0x23')][_0xa786('0x24')]({'where':{'ChanSpyId':_0x1f191e['id']}})[_0xa786('0x1c')](function(){_0x36182f();})[_0xa786('0x1d')](function(_0x57d251){_0x36182f(_0x57d251);});}}});}; \ No newline at end of file +var _0x36e2=['password','push','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','then','catch','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,ab','recordingFormat','Authenticate'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x36e2,0x187));var _0x236e=function(_0x338888,_0x4e437b){_0x338888=_0x338888-0x0;var _0xced6fc=_0x36e2[_0x338888];return _0xced6fc;};'use strict';var _=require(_0x236e('0x0'));var util=require(_0x236e('0x1'));var BPromise=require('bluebird');var attributes=require(_0x236e('0x2'));var getUserApplications=function(_0x209856,_0x5e9bb7,_0x3ba623){var _0x51b28e=0x1;var _0x20500b=[];var _0x5cc80e={'context':_0x5e9bb7['context']||_0x236e('0x3'),'exten':util[_0x236e('0x4')](_0x236e('0x5'),_0x209856[_0x236e('0x6')],_0x3ba623),'type':_0x236e('0x7'),'isApp':![],'ChanSpyId':_0x209856['id'],'UserId':_0x5e9bb7['id']};_0x20500b['push'](_[_0x236e('0x8')]({'app':_0x236e('0x9'),'appdata':util[_0x236e('0x4')](_0x236e('0xa'),_0x236e('0xb')),'priority':_0x51b28e++},_0x5cc80e));if(_0x209856[_0x236e('0xc')]){_0x20500b['push'](_['merge']({'app':'MixMonitor','appdata':util['format'](_0x236e('0xd'),_0x209856[_0x236e('0xe')]),'priority':_0x51b28e++},_0x5cc80e));}if(_0x209856['auth']){_0x20500b['push'](_[_0x236e('0x8')]({'app':_0x236e('0xf'),'appdata':_0x209856[_0x236e('0x10')],'priority':_0x51b28e++},_0x5cc80e));}_0x20500b[_0x236e('0x11')](_[_0x236e('0x8')]({'app':_0x236e('0x12'),'appdata':util[_0x236e('0x4')](_0x236e('0x13'),_0x5e9bb7[_0x236e('0x14')],_0x209856['options']?_0x209856[_0x236e('0x15')][_0x236e('0x16')](''):''),'priority':_0x51b28e++},_0x5cc80e));if(_0x209856[_0x236e('0xc')]){_0x20500b['push'](_['merge']({'app':_0x236e('0x17'),'priority':_0x51b28e++},_0x5cc80e));}return _0x20500b;};var getChanSpyApplications=function(_0x3aca03,_0xcc9c01){var _0x94e4c0=[];for(var _0x55b3b7=0x0,_0x3badf7=0x1;_0x55b3b7<_0xcc9c01[_0x236e('0x18')];_0x55b3b7++,_0x3badf7=0x1){_0x94e4c0=_0x94e4c0[_0x236e('0x19')](getUserApplications(_0x3aca03,_0xcc9c01[_0x55b3b7],_0xcc9c01[_0x55b3b7][_0x236e('0x1a')]));if(_0xcc9c01[_0x55b3b7]['internal']!=_0xcc9c01[_0x55b3b7]['name']){_0x94e4c0=_0x94e4c0[_0x236e('0x19')](getUserApplications(_0x3aca03,_0xcc9c01[_0x55b3b7],_0xcc9c01[_0x55b3b7][_0x236e('0x14')]));}}return _0x94e4c0;};var getChanSpyPromise=function(_0x1761d8,_0x216403){return new BPromise(function(_0x165c49,_0x675810){return _0x1761d8[_0x236e('0x1b')][_0x236e('0x1c')]({'attributes':['id','name',_0x236e('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x236e('0x1d')](function(_0x4f0462){if(_0x4f0462){return _0x165c49(getChanSpyApplications(_0x216403,_0x4f0462));}return _0x165c49([]);})[_0x236e('0x1e')](function(_0x86bb62){_0x675810(_0x86bb62);});});};module['exports']=function(_0x39aba5,_0x2e07e4){var _0x2ead21=_0x39aba5[_0x236e('0x1f')];return _0x39aba5[_0x236e('0x20')](_0x236e('0x21'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4cccba,_0x2115a6,_0x536c99){return getChanSpyPromise(_0x2ead21,_0x4cccba)[_0x236e('0x1d')](function(_0x15a1e7){if(_0x15a1e7&&_0x15a1e7[_0x236e('0x18')]){return _0x2ead21[_0x236e('0x22')][_0x236e('0x23')](_0x15a1e7);}})[_0x236e('0x1d')](function(){_0x536c99();})[_0x236e('0x1e')](function(_0x498d20){_0x536c99(_0x498d20);});},'afterUpdate':function(_0xee2fbd,_0x5f1285,_0x28c2dd){return _0x2ead21['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0xee2fbd['id']}})[_0x236e('0x1d')](function(){return getChanSpyPromise(_0x2ead21,_0xee2fbd);})['then'](function(_0x50b2cc){if(_0x50b2cc&&_0x50b2cc[_0x236e('0x18')]){return _0x2ead21[_0x236e('0x22')][_0x236e('0x23')](_0x50b2cc);}})[_0x236e('0x1d')](function(){_0x28c2dd();})['catch'](function(_0x42f24c){_0x28c2dd(_0x42f24c);});},'afterDestroy':function(_0x28336b,_0x23c023,_0x3b6e1e){return _0x2ead21[_0x236e('0x22')][_0x236e('0x24')]({'where':{'ChanSpyId':_0x28336b['id']}})[_0x236e('0x1d')](function(){_0x3b6e1e();})[_0x236e('0x1e')](function(_0x2a71a1){_0x3b6e1e(_0x2a71a1);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index e2b7b8d..7693530 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 _0xfa00=['rpc','../../config/environment','jayson/promise','http','request','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa00,0x1dd));var _0x0fa0=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfa00[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0x0fa0('0x0'));var moment=require('moment');var BPromise=require(_0x0fa0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fa0('0x2'));var db=require(_0x0fa0('0x3'))['db'];var utils=require(_0x0fa0('0x4'));var logger=require(_0x0fa0('0x5'))(_0x0fa0('0x6'));var config=require(_0x0fa0('0x7'));var jayson=require(_0x0fa0('0x8'));var client=jayson['client'][_0x0fa0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad9b2,_0x44517b,_0x5bc482){return new BPromise(function(_0x29c723,_0x19b872){return client[_0x0fa0('0xa')](_0x5ad9b2,_0x5bc482)['then'](function(_0x3c752e){logger[_0x0fa0('0xb')](_0x0fa0('0xc'),_0x44517b,'request\x20sent');logger[_0x0fa0('0xd')](_0x0fa0('0xe'),_0x44517b,_0x0fa0('0xf'),JSON[_0x0fa0('0x10')](_0x3c752e));if(_0x3c752e[_0x0fa0('0x11')]){if(_0x3c752e['error'][_0x0fa0('0x12')]===0x1f4){logger[_0x0fa0('0x11')](_0x0fa0('0xc'),_0x44517b,_0x3c752e[_0x0fa0('0x11')][_0x0fa0('0x13')]);return _0x19b872(_0x3c752e[_0x0fa0('0x11')][_0x0fa0('0x13')]);}logger[_0x0fa0('0x11')](_0x0fa0('0xc'),_0x44517b,_0x3c752e[_0x0fa0('0x11')]['message']);return _0x29c723(_0x3c752e[_0x0fa0('0x11')]['message']);}else{logger[_0x0fa0('0xb')](_0x0fa0('0xc'),_0x44517b,_0x0fa0('0xf'));_0x29c723(_0x3c752e[_0x0fa0('0x14')]['message']);}})['catch'](function(_0x199d89){logger[_0x0fa0('0x11')](_0x0fa0('0xc'),_0x44517b,_0x199d89);_0x19b872(_0x199d89);});});} \ No newline at end of file +var _0x8d7d=['../../config/logger','../../config/environment','jayson/promise','client','http','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x4b80c3,_0x3b227f){var _0x432cfe=function(_0xa31c05){while(--_0xa31c05){_0x4b80c3['push'](_0x4b80c3['shift']());}};_0x432cfe(++_0x3b227f);}(_0x8d7d,0xd7));var _0xd8d7=function(_0x2bc272,_0x28bc2c){_0x2bc272=_0x2bc272-0x0;var _0x24ad78=_0x8d7d[_0x2bc272];return _0x24ad78;};'use strict';var _=require(_0xd8d7('0x0'));var util=require(_0xd8d7('0x1'));var moment=require('moment');var BPromise=require(_0xd8d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8d7('0x3'))['db'];var utils=require(_0xd8d7('0x4'));var logger=require(_0xd8d7('0x5'))('rpc');var config=require(_0xd8d7('0x6'));var jayson=require(_0xd8d7('0x7'));var client=jayson[_0xd8d7('0x8')][_0xd8d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41f195,_0xf25d32,_0x34e2da){return new BPromise(function(_0x129f05,_0x469bfd){return client[_0xd8d7('0xa')](_0x41f195,_0x34e2da)['then'](function(_0x3b5c3f){logger['info'](_0xd8d7('0xb'),_0xf25d32,_0xd8d7('0xc'));logger[_0xd8d7('0xd')](_0xd8d7('0xe'),_0xf25d32,_0xd8d7('0xc'),JSON['stringify'](_0x3b5c3f));if(_0x3b5c3f[_0xd8d7('0xf')]){if(_0x3b5c3f[_0xd8d7('0xf')][_0xd8d7('0x10')]===0x1f4){logger[_0xd8d7('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0xf25d32,_0x3b5c3f['error'][_0xd8d7('0x11')]);return _0x469bfd(_0x3b5c3f[_0xd8d7('0xf')]['message']);}logger[_0xd8d7('0xf')](_0xd8d7('0xb'),_0xf25d32,_0x3b5c3f[_0xd8d7('0xf')][_0xd8d7('0x11')]);return _0x129f05(_0x3b5c3f['error'][_0xd8d7('0x11')]);}else{logger[_0xd8d7('0x12')](_0xd8d7('0xb'),_0xf25d32,_0xd8d7('0xc'));_0x129f05(_0x3b5c3f['result'][_0xd8d7('0x11')]);}})[_0xd8d7('0x13')](function(_0x8fd7a3){logger[_0xd8d7('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0xf25d32,_0x8fd7a3);_0x469bfd(_0x8fd7a3);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index bab04e0..2f09974 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 _0xe020=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','show','post','create','put','update','delete','/:id','destroy'];(function(_0x131a6e,_0x2b88c8){var _0x415b98=function(_0x3a314d){while(--_0x3a314d){_0x131a6e['push'](_0x131a6e['shift']());}};_0x415b98(++_0x2b88c8);}(_0xe020,0x131));var _0x0e02=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xe020[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x0e02('0x0'));var util=require('util');var path=require(_0x0e02('0x1'));var timeout=require(_0x0e02('0x2'));var express=require(_0x0e02('0x3'));var router=express[_0x0e02('0x4')]();var auth=require(_0x0e02('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0e02('0x6'));var controller=require(_0x0e02('0x7'));router[_0x0e02('0x8')]('/',auth[_0x0e02('0x9')](),controller['index']);router[_0x0e02('0x8')]('/:id',auth[_0x0e02('0x9')](),controller[_0x0e02('0xa')]);router[_0x0e02('0xb')]('/',auth[_0x0e02('0x9')](),controller[_0x0e02('0xc')]);router[_0x0e02('0xd')]('/:id',auth[_0x0e02('0x9')](),controller[_0x0e02('0xe')]);router[_0x0e02('0xf')](_0x0e02('0x10'),auth['isAuthenticated'](),controller[_0x0e02('0x11')]);module[_0x0e02('0x12')]=router; \ No newline at end of file +var _0xb306=['exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','show','put','update'];(function(_0x3cb6c3,_0x191af3){var _0x18cd33=function(_0x537913){while(--_0x537913){_0x3cb6c3['push'](_0x3cb6c3['shift']());}};_0x18cd33(++_0x191af3);}(_0xb306,0xc5));var _0x6b30=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb306[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x6b30('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6b30('0x1'));var express=require('express');var router=express[_0x6b30('0x2')]();var auth=require(_0x6b30('0x3'));var interaction=require(_0x6b30('0x4'));var config=require('../../config/environment');var controller=require(_0x6b30('0x5'));router[_0x6b30('0x6')]('/',auth[_0x6b30('0x7')](),controller[_0x6b30('0x8')]);router[_0x6b30('0x6')](_0x6b30('0x9'),auth[_0x6b30('0x7')](),controller[_0x6b30('0xa')]);router['post']('/',auth[_0x6b30('0x7')](),controller['create']);router[_0x6b30('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x6b30('0xc')]);router['delete'](_0x6b30('0x9'),auth[_0x6b30('0x7')](),controller['destroy']);module[_0x6b30('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 662a2c3..f0acffa 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 _0x34e8=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x3f10c5,_0x31d838){var _0x3092bb=function(_0x355afc){while(--_0x355afc){_0x3f10c5['push'](_0x3f10c5['shift']());}};_0x3092bb(++_0x31d838);}(_0x34e8,0x12c));var _0x834e=function(_0x57a73a,_0x579dc9){_0x57a73a=_0x57a73a-0x0;var _0x109af0=_0x34e8[_0x57a73a];return _0x109af0;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x834e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3e74=['name','sequelize','STRING'];(function(_0x44f274,_0x204885){var _0x2b5f73=function(_0x97da8a){while(--_0x97da8a){_0x44f274['push'](_0x44f274['shift']());}};_0x2b5f73(++_0x204885);}(_0x3e74,0x175));var _0x43e7=function(_0x25691a,_0xe3574e){_0x25691a=_0x25691a-0x0;var _0x36a531=_0x3e74[_0x25691a];return _0x36a531;};'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 diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 8a1939a..d9732d4 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 _0x17ce=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','Contexts','UserProfileResource','stack','name','map','VoiceContext','fieldName','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','include','findAll','show','params','rawAttributes','length','includeAll','options','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','role','userProfileId','autoAssociation','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x5b4715,_0x5b51ef){var _0x175d7c=function(_0x4d97e6){while(--_0x4d97e6){_0x5b4715['push'](_0x5b4715['shift']());}};_0x175d7c(++_0x5b51ef);}(_0x17ce,0x1a0));var _0xe17c=function(_0x5f4c38,_0x1e5373){_0x5f4c38=_0x5f4c38-0x0;var _0x1c227e=_0x17ce[_0x5f4c38];return _0x1c227e;};'use strict';var pdf=require(_0xe17c('0x0'));var emlformat=require(_0xe17c('0x1'));var rimraf=require(_0xe17c('0x2'));var zipdir=require(_0xe17c('0x3'));var jsonpatch=require(_0xe17c('0x4'));var rp=require(_0xe17c('0x5'));var moment=require('moment');var BPromise=require(_0xe17c('0x6'));var Mustache=require(_0xe17c('0x7'));var util=require(_0xe17c('0x8'));var path=require(_0xe17c('0x9'));var sox=require(_0xe17c('0xa'));var csv=require(_0xe17c('0xb'));var ejs=require(_0xe17c('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe17c('0xd'));var crypto=require('crypto');var jsforce=require(_0xe17c('0xe'));var deskjs=require(_0xe17c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe17c('0x10'));var Papa=require(_0xe17c('0x11'));var Redis=require(_0xe17c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe17c('0x13'));var as=require(_0xe17c('0x14'));var hardwareService=require(_0xe17c('0x15'));var logger=require(_0xe17c('0x16'))(_0xe17c('0x17'));var utils=require(_0xe17c('0x18'));var config=require(_0xe17c('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xe17c('0x1a'));var client=jayson[_0xe17c('0x1b')][_0xe17c('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x44a1c2,_0x1cd819,_0xc0d0df){if(_0xc0d0df){var _0x17568b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17568b[_0xe17c('0x1d')](_0x1cd819)){return _0x44a1c2;}else{throw new db[(_0xe17c('0x1e'))][(_0xe17c('0x1f'))]('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 _0x44a1c2;}}function respondWithRpcPromise(_0x56dca1,_0x2cb214,_0x2522c8,_0x124048){return new BPromise(function(_0x567c29,_0x243292){var _0x4e3104=_0x124048||client;return _0x4e3104[_0xe17c('0x20')](_0x56dca1,_0x2522c8)[_0xe17c('0x21')](function(_0x31c7d2){logger[_0xe17c('0x22')](_0xe17c('0x23'),_0x2cb214,_0xe17c('0x24'));logger[_0xe17c('0x25')](_0xe17c('0x26'),_0x2cb214,_0xe17c('0x24'),JSON['stringify'](_0x31c7d2));if(_0x31c7d2[_0xe17c('0x27')]){if(_0x31c7d2[_0xe17c('0x27')]['code']===0x1f4){logger[_0xe17c('0x27')]('VoiceContext,\x20%s,\x20%s',_0x2cb214,_0x31c7d2[_0xe17c('0x27')][_0xe17c('0x28')]);return _0x243292(_0x31c7d2['error']['message']);}logger[_0xe17c('0x27')](_0xe17c('0x23'),_0x2cb214,_0x31c7d2[_0xe17c('0x27')]['message']);return _0x567c29(_0x31c7d2['error']['message']);}else{logger[_0xe17c('0x22')](_0xe17c('0x23'),_0x2cb214,_0xe17c('0x24'));_0x567c29(_0x31c7d2[_0xe17c('0x29')]['message']);}})[_0xe17c('0x2a')](function(_0x4b663f){logger['error']('VoiceContext,\x20%s,\x20%s',_0x2cb214,_0x4b663f);_0x243292(_0x4b663f);});});}function respondWithStatusCode(_0x45c9b0,_0x4755b3){_0x4755b3=_0x4755b3||0xcc;return function(_0x345b93){if(_0x345b93){return _0x45c9b0[_0xe17c('0x2b')](_0x4755b3);}return _0x45c9b0['status'](_0x4755b3)[_0xe17c('0x2c')]();};}function respondWithResult(_0xdb00f9,_0x54f3d8){_0x54f3d8=_0x54f3d8||0xc8;return function(_0x113664){if(_0x113664){return _0xdb00f9[_0xe17c('0x2d')](_0x54f3d8)[_0xe17c('0x2e')](_0x113664);}};}function respondWithFilteredResult(_0x4c5321,_0x11e806){return function(_0x325221){if(_0x325221){var _0x1f4f2d=_0x325221[_0xe17c('0x2f')],_0x5f0569=_0x11e806[_0xe17c('0x30')],_0x327088=_0x11e806[_0xe17c('0x30')]+_0x11e806[_0xe17c('0x31')],_0x33f7f5;if(_0x327088>=_0x1f4f2d){_0x327088=_0x1f4f2d;_0x33f7f5=0xc8;}else{_0x33f7f5=0xce;}_0x4c5321[_0xe17c('0x2d')](_0x33f7f5);return _0x4c5321[_0xe17c('0x32')](_0xe17c('0x33'),_0x5f0569+'-'+_0x327088+'/'+_0x1f4f2d)[_0xe17c('0x2e')](_0x325221);}return null;};}function patchUpdates(_0x5db886){return function(_0x322e00){try{jsonpatch[_0xe17c('0x34')](_0x322e00,_0x5db886,!![]);}catch(_0x4bfa87){return BPromise[_0xe17c('0x35')](_0x4bfa87);}return _0x322e00[_0xe17c('0x36')]();};}function saveUpdates(_0x377f21,_0x147e94){return function(_0x554233){if(_0x554233){return _0x554233[_0xe17c('0x37')](_0x377f21)[_0xe17c('0x21')](function(_0x10912f){return _0x10912f;});}return null;};}function removeEntity(_0x36ef4a,_0x11efd9){return function(_0x3126d4){if(_0x3126d4){return _0x3126d4[_0xe17c('0x38')]()[_0xe17c('0x21')](function(){var _0x472acf=_0x3126d4['get']({'plain':!![]});var _0x2cf037=_0xe17c('0x39');return db[_0xe17c('0x3a')][_0xe17c('0x38')]({'where':{'type':_0x2cf037,'resourceId':_0x472acf['id']}})['then'](function(){return _0x3126d4;});})['then'](function(){_0x36ef4a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x592cd3,_0x4a379b){return function(_0x5512f6){if(!_0x5512f6){_0x592cd3[_0xe17c('0x2b')](0x194);}return _0x5512f6;};}function handleError(_0x4fd816,_0x4c5115){_0x4c5115=_0x4c5115||0x1f4;return function(_0x42028f){logger[_0xe17c('0x27')](_0x42028f[_0xe17c('0x3b')]);if(_0x42028f['name']){delete _0x42028f[_0xe17c('0x3c')];}_0x4fd816[_0xe17c('0x2d')](_0x4c5115)['send'](_0x42028f);};}exports['index']=function(_0x328f5c,_0x1d8703){var _0x11b51d={},_0x26c551={},_0x3a6ffb={'count':0x0,'rows':[]};var _0xc05f4e=_[_0xe17c('0x3d')](db[_0xe17c('0x3e')]['rawAttributes'],function(_0x315ba0){return{'name':_0x315ba0[_0xe17c('0x3f')],'type':_0x315ba0[_0xe17c('0x40')][_0xe17c('0x41')]};});_0x26c551[_0xe17c('0x42')]=_[_0xe17c('0x3d')](_0xc05f4e,'name');_0x26c551['query']=_[_0xe17c('0x43')](_0x328f5c[_0xe17c('0x44')]);_0x26c551['filters']=_['intersection'](_0x26c551[_0xe17c('0x42')],_0x26c551[_0xe17c('0x44')]);_0x11b51d[_0xe17c('0x45')]=_[_0xe17c('0x46')](_0x26c551[_0xe17c('0x42')],qs[_0xe17c('0x47')](_0x328f5c[_0xe17c('0x44')][_0xe17c('0x47')]));_0x11b51d[_0xe17c('0x45')]=_0x11b51d[_0xe17c('0x45')]['length']?_0x11b51d[_0xe17c('0x45')]:_0x26c551[_0xe17c('0x42')];if(!_0x328f5c[_0xe17c('0x44')][_0xe17c('0x48')]('nolimit')){_0x11b51d[_0xe17c('0x31')]=qs['limit'](_0x328f5c[_0xe17c('0x44')][_0xe17c('0x31')]);_0x11b51d[_0xe17c('0x30')]=qs[_0xe17c('0x30')](_0x328f5c['query'][_0xe17c('0x30')]);}_0x11b51d[_0xe17c('0x49')]=qs[_0xe17c('0x4a')](_0x328f5c[_0xe17c('0x44')][_0xe17c('0x4a')]);_0x11b51d[_0xe17c('0x4b')]=qs[_0xe17c('0x4c')](_[_0xe17c('0x4d')](_0x328f5c[_0xe17c('0x44')],_0x26c551[_0xe17c('0x4c')]));if(_0x328f5c[_0xe17c('0x44')][_0xe17c('0x4e')]){_0x11b51d['where']=_['merge'](_0x11b51d[_0xe17c('0x4b')],{'$or':_[_0xe17c('0x3d')](_0xc05f4e,function(_0x5c56bb){if(_0x5c56bb[_0xe17c('0x40')]!=='VIRTUAL'){var _0x76ce79={};_0x76ce79[_0x5c56bb[_0xe17c('0x3c')]]={'$like':'%'+_0x328f5c[_0xe17c('0x44')][_0xe17c('0x4e')]+'%'};return _0x76ce79;}})});}_0x11b51d=_[_0xe17c('0x4f')]({},_0x11b51d,_0x328f5c['options']);var _0x4ddd5d={'where':_0x11b51d[_0xe17c('0x4b')]};return db[_0xe17c('0x3e')]['count'](_0x4ddd5d)[_0xe17c('0x21')](function(_0x4ed35c){_0x3a6ffb[_0xe17c('0x2f')]=_0x4ed35c;if(_0x328f5c[_0xe17c('0x44')]['includeAll']){_0x11b51d[_0xe17c('0x50')]=[{'all':!![]}];}return db[_0xe17c('0x3e')][_0xe17c('0x51')](_0x11b51d);})[_0xe17c('0x21')](function(_0x299d34){_0x3a6ffb['rows']=_0x299d34;return _0x3a6ffb;})[_0xe17c('0x21')](respondWithFilteredResult(_0x1d8703,_0x11b51d))[_0xe17c('0x2a')](handleError(_0x1d8703,null));};exports[_0xe17c('0x52')]=function(_0x332707,_0x553d57){var _0x142b51={'raw':![],'where':{'id':_0x332707[_0xe17c('0x53')]['id']}},_0x3416ff={};_0x3416ff[_0xe17c('0x42')]=_[_0xe17c('0x43')](db['VoiceContext'][_0xe17c('0x54')]);_0x3416ff['query']=_[_0xe17c('0x43')](_0x332707[_0xe17c('0x44')]);_0x3416ff['filters']=_[_0xe17c('0x46')](_0x3416ff['model'],_0x3416ff[_0xe17c('0x44')]);_0x142b51[_0xe17c('0x45')]=_[_0xe17c('0x46')](_0x3416ff[_0xe17c('0x42')],qs[_0xe17c('0x47')](_0x332707['query']['fields']));_0x142b51[_0xe17c('0x45')]=_0x142b51[_0xe17c('0x45')][_0xe17c('0x55')]?_0x142b51[_0xe17c('0x45')]:_0x3416ff['model'];if(_0x332707[_0xe17c('0x44')][_0xe17c('0x56')]){_0x142b51[_0xe17c('0x50')]=[{'all':!![]}];}_0x142b51=_[_0xe17c('0x4f')]({},_0x142b51,_0x332707[_0xe17c('0x57')]);return db[_0xe17c('0x3e')][_0xe17c('0x58')](_0x142b51)[_0xe17c('0x21')](handleEntityNotFound(_0x553d57,null))['then'](respondWithResult(_0x553d57,null))[_0xe17c('0x2a')](handleError(_0x553d57,null));};exports['create']=function(_0x27975e,_0x5adc01,_0x2a4ab8){var _0x26c305;return db[_0xe17c('0x3e')][_0xe17c('0x59')](_0x27975e[_0xe17c('0x5a')],{'raw':!![]})[_0xe17c('0x21')](function(_0x4ceb85){_0x26c305=_0x4ceb85;return db[_0xe17c('0x3e')]['findAll']({'raw':!![]});})[_0xe17c('0x21')](function(_0x26cf41){var _0x125af6=fs[_0xe17c('0x5b')](path[_0xe17c('0x5c')](config[_0xe17c('0x5d')],_0xe17c('0x5e')),_0xe17c('0x5f'));var _0x5ac1ea=ejs[_0xe17c('0x60')](_0x125af6,{'contexts':_0x26cf41||[]});fs[_0xe17c('0x61')](_0xe17c('0x62'),_0x5ac1ea);})['then'](function(){return respondWithRpcPromise('Reload',_0xe17c('0x59'),{'module':_0xe17c('0x63')});})[_0xe17c('0x21')](function(){var _0x506f82=_0x27975e[_0xe17c('0x64')][_0xe17c('0x65')]({'plain':!![]});if(!_0x506f82)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x506f82[_0xe17c('0x66')]===_0xe17c('0x64')){var _0x376b15=_0x26c305['get']({'plain':!![]});return db['UserProfileSection'][_0xe17c('0x58')]({'where':{'name':_0xe17c('0x39'),'userProfileId':_0x506f82[_0xe17c('0x67')]},'raw':!![]})[_0xe17c('0x21')](function(_0x1f15d3){if(_0x1f15d3&&_0x1f15d3[_0xe17c('0x68')]===0x0){return db[_0xe17c('0x3a')][_0xe17c('0x59')]({'name':_0x376b15[_0xe17c('0x3c')],'resourceId':_0x376b15['id'],'type':_0x1f15d3['name'],'sectionId':_0x1f15d3['id']},{})[_0xe17c('0x21')](function(){return _0x26c305;});}else{return _0x26c305;}})[_0xe17c('0x2a')](function(_0x57b28b){logger[_0xe17c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57b28b);throw _0x57b28b;});}return _0x26c305;})[_0xe17c('0x21')](respondWithResult(_0x5adc01,0xc9))['catch'](handleError(_0x5adc01,null));};exports[_0xe17c('0x37')]=function(_0x246fc8,_0x2de8ab,_0x1c5e72){var _0x43be4f;return db[_0xe17c('0x3e')]['find']({'where':{'id':_0x246fc8[_0xe17c('0x53')]['id']}})[_0xe17c('0x21')](handleEntityNotFound(_0x2de8ab,null))[_0xe17c('0x21')](saveUpdates(_0x246fc8[_0xe17c('0x5a')],null))[_0xe17c('0x21')](function(_0x13ad33){if(_0x13ad33){_0x43be4f=_0x13ad33;return db[_0xe17c('0x3e')][_0xe17c('0x51')]({'raw':!![]});}})[_0xe17c('0x21')](function(_0x5d083d){var _0x216aa7=fs[_0xe17c('0x5b')](path[_0xe17c('0x5c')](config['root'],_0xe17c('0x5e')),_0xe17c('0x5f'));var _0x33c251=ejs[_0xe17c('0x60')](_0x216aa7,{'contexts':_0x5d083d||[]});fs[_0xe17c('0x61')](_0xe17c('0x62'),_0x33c251);})[_0xe17c('0x21')](function(){return respondWithRpcPromise('Reload',_0xe17c('0x37'),{'module':_0xe17c('0x63')});})[_0xe17c('0x21')](function(){return _0x43be4f;})[_0xe17c('0x21')](respondWithResult(_0x2de8ab,null))[_0xe17c('0x2a')](handleError(_0x2de8ab,null));};exports['destroy']=function(_0x4a1722,_0x8fc506,_0x59f705){var _0xe88c2a;return db[_0xe17c('0x3e')]['find']({'where':{'id':_0x4a1722[_0xe17c('0x53')]['id']}})['then'](handleEntityNotFound(_0x8fc506,null))[_0xe17c('0x21')](removeEntity(_0x8fc506,null))[_0xe17c('0x21')](function(){return db[_0xe17c('0x3e')][_0xe17c('0x51')]({'raw':!![]});})['then'](function(_0x398df5){var _0x7f636c=fs[_0xe17c('0x5b')](path[_0xe17c('0x5c')](config[_0xe17c('0x5d')],_0xe17c('0x5e')),_0xe17c('0x5f'));var _0x211e44=ejs[_0xe17c('0x60')](_0x7f636c,{'contexts':_0x398df5});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x211e44);return respondWithRpcPromise('Reload',_0xe17c('0x38'),{'module':'chan_sip.so'});})[_0xe17c('0x2a')](handleError(_0x8fc506,null));}; \ No newline at end of file +var _0xabe4=['UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','utf8','render','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','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','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','request\x20sent','result','catch','sendStatus','status','json','count','offset','Content-Range','apply','save','update','destroy','get','Contexts','end','stack','name','send','map','VoiceContext','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','keys','find','create','body','findAll','readFileSync','root','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','role'];(function(_0x30af91,_0x233834){var _0x3e4134=function(_0x35ebfc){while(--_0x35ebfc){_0x30af91['push'](_0x30af91['shift']());}};_0x3e4134(++_0x233834);}(_0xabe4,0x1af));var _0x4abe=function(_0x317b63,_0x2acf92){_0x317b63=_0x317b63-0x0;var _0x36a2e2=_0xabe4[_0x317b63];return _0x36a2e2;};'use strict';var pdf=require(_0x4abe('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4abe('0x1'));var jsonpatch=require(_0x4abe('0x2'));var rp=require(_0x4abe('0x3'));var moment=require(_0x4abe('0x4'));var BPromise=require(_0x4abe('0x5'));var Mustache=require(_0x4abe('0x6'));var util=require(_0x4abe('0x7'));var path=require(_0x4abe('0x8'));var sox=require(_0x4abe('0x9'));var csv=require(_0x4abe('0xa'));var ejs=require(_0x4abe('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4abe('0xc'));var crypto=require('crypto');var jsforce=require(_0x4abe('0xd'));var deskjs=require(_0x4abe('0xe'));var toCsv=require(_0x4abe('0xa'));var querystring=require(_0x4abe('0xf'));var Papa=require(_0x4abe('0x10'));var Redis=require(_0x4abe('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4abe('0x12'));var as=require(_0x4abe('0x13'));var hardwareService=require(_0x4abe('0x14'));var logger=require('../../config/logger')(_0x4abe('0x15'));var utils=require(_0x4abe('0x16'));var config=require(_0x4abe('0x17'));var db=require(_0x4abe('0x18'))['db'];var jayson=require(_0x4abe('0x19'));var client=jayson[_0x4abe('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x3b04e9,_0x3733d0,_0x4bbf39){if(_0x4bbf39){var _0x5a331a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a331a[_0x4abe('0x1b')](_0x3733d0)){return _0x3b04e9;}else{throw new db['Sequelize'][(_0x4abe('0x1c'))](_0x4abe('0x1d'));}}else{return _0x3b04e9;}}function respondWithRpcPromise(_0x231da3,_0x495776,_0x2bb51b,_0x1437fe){return new BPromise(function(_0x3cba6f,_0x420a85){var _0x4414ca=_0x1437fe||client;return _0x4414ca[_0x4abe('0x1e')](_0x231da3,_0x2bb51b)[_0x4abe('0x1f')](function(_0x474426){logger[_0x4abe('0x20')]('VoiceContext,\x20%s,\x20%s',_0x495776,'request\x20sent');logger[_0x4abe('0x21')](_0x4abe('0x22'),_0x495776,'request\x20sent',JSON[_0x4abe('0x23')](_0x474426));if(_0x474426[_0x4abe('0x24')]){if(_0x474426['error'][_0x4abe('0x25')]===0x1f4){logger[_0x4abe('0x24')]('VoiceContext,\x20%s,\x20%s',_0x495776,_0x474426[_0x4abe('0x24')][_0x4abe('0x26')]);return _0x420a85(_0x474426[_0x4abe('0x24')][_0x4abe('0x26')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x495776,_0x474426[_0x4abe('0x24')][_0x4abe('0x26')]);return _0x3cba6f(_0x474426[_0x4abe('0x24')]['message']);}else{logger['info'](_0x4abe('0x27'),_0x495776,_0x4abe('0x28'));_0x3cba6f(_0x474426[_0x4abe('0x29')][_0x4abe('0x26')]);}})[_0x4abe('0x2a')](function(_0x137619){logger['error'](_0x4abe('0x27'),_0x495776,_0x137619);_0x420a85(_0x137619);});});}function respondWithStatusCode(_0x3dcd0a,_0x36fbd4){_0x36fbd4=_0x36fbd4||0xcc;return function(_0x56fb5b){if(_0x56fb5b){return _0x3dcd0a[_0x4abe('0x2b')](_0x36fbd4);}return _0x3dcd0a[_0x4abe('0x2c')](_0x36fbd4)['end']();};}function respondWithResult(_0x464d79,_0x4c62ac){_0x4c62ac=_0x4c62ac||0xc8;return function(_0x57b17a){if(_0x57b17a){return _0x464d79[_0x4abe('0x2c')](_0x4c62ac)[_0x4abe('0x2d')](_0x57b17a);}};}function respondWithFilteredResult(_0x5c20d8,_0x5e5864){return function(_0xea7e54){if(_0xea7e54){var _0x32875a=_0xea7e54[_0x4abe('0x2e')],_0x5a7a22=_0x5e5864[_0x4abe('0x2f')],_0x57e6b9=_0x5e5864[_0x4abe('0x2f')]+_0x5e5864['limit'],_0x315d47;if(_0x57e6b9>=_0x32875a){_0x57e6b9=_0x32875a;_0x315d47=0xc8;}else{_0x315d47=0xce;}_0x5c20d8['status'](_0x315d47);return _0x5c20d8['set'](_0x4abe('0x30'),_0x5a7a22+'-'+_0x57e6b9+'/'+_0x32875a)[_0x4abe('0x2d')](_0xea7e54);}return null;};}function patchUpdates(_0x1424a7){return function(_0x21f655){try{jsonpatch[_0x4abe('0x31')](_0x21f655,_0x1424a7,!![]);}catch(_0x1d0afb){return BPromise['reject'](_0x1d0afb);}return _0x21f655[_0x4abe('0x32')]();};}function saveUpdates(_0x20c4da,_0x420d88){return function(_0x11391d){if(_0x11391d){return _0x11391d[_0x4abe('0x33')](_0x20c4da)[_0x4abe('0x1f')](function(_0x546b2b){return _0x546b2b;});}return null;};}function removeEntity(_0x1f1b44,_0x2391e8){return function(_0xafaa8c){if(_0xafaa8c){return _0xafaa8c[_0x4abe('0x34')]()[_0x4abe('0x1f')](function(){var _0x12de67=_0xafaa8c[_0x4abe('0x35')]({'plain':!![]});var _0x4e757f=_0x4abe('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x4e757f,'resourceId':_0x12de67['id']}})['then'](function(){return _0xafaa8c;});})[_0x4abe('0x1f')](function(){_0x1f1b44['status'](0xcc)[_0x4abe('0x37')]();});}};}function handleEntityNotFound(_0x5464f2,_0x72885){return function(_0x87479b){if(!_0x87479b){_0x5464f2['sendStatus'](0x194);}return _0x87479b;};}function handleError(_0x31a257,_0x1b0e6c){_0x1b0e6c=_0x1b0e6c||0x1f4;return function(_0x1e7a47){logger[_0x4abe('0x24')](_0x1e7a47[_0x4abe('0x38')]);if(_0x1e7a47[_0x4abe('0x39')]){delete _0x1e7a47[_0x4abe('0x39')];}_0x31a257[_0x4abe('0x2c')](_0x1b0e6c)[_0x4abe('0x3a')](_0x1e7a47);};}exports['index']=function(_0x19eb19,_0x48b924){var _0x92cbbd={},_0x29d0e3={},_0x407c3b={'count':0x0,'rows':[]};var _0x411a4c=_[_0x4abe('0x3b')](db[_0x4abe('0x3c')][_0x4abe('0x3d')],function(_0x16f9b8){return{'name':_0x16f9b8['fieldName'],'type':_0x16f9b8[_0x4abe('0x3e')][_0x4abe('0x3f')]};});_0x29d0e3['model']=_['map'](_0x411a4c,'name');_0x29d0e3[_0x4abe('0x40')]=_['keys'](_0x19eb19[_0x4abe('0x40')]);_0x29d0e3[_0x4abe('0x41')]=_['intersection'](_0x29d0e3[_0x4abe('0x42')],_0x29d0e3[_0x4abe('0x40')]);_0x92cbbd[_0x4abe('0x43')]=_[_0x4abe('0x44')](_0x29d0e3[_0x4abe('0x42')],qs[_0x4abe('0x45')](_0x19eb19[_0x4abe('0x40')][_0x4abe('0x45')]));_0x92cbbd['attributes']=_0x92cbbd[_0x4abe('0x43')][_0x4abe('0x46')]?_0x92cbbd[_0x4abe('0x43')]:_0x29d0e3[_0x4abe('0x42')];if(!_0x19eb19[_0x4abe('0x40')][_0x4abe('0x47')](_0x4abe('0x48'))){_0x92cbbd[_0x4abe('0x49')]=qs[_0x4abe('0x49')](_0x19eb19[_0x4abe('0x40')]['limit']);_0x92cbbd[_0x4abe('0x2f')]=qs['offset'](_0x19eb19[_0x4abe('0x40')][_0x4abe('0x2f')]);}_0x92cbbd[_0x4abe('0x4a')]=qs[_0x4abe('0x4b')](_0x19eb19[_0x4abe('0x40')][_0x4abe('0x4b')]);_0x92cbbd[_0x4abe('0x4c')]=qs[_0x4abe('0x41')](_[_0x4abe('0x4d')](_0x19eb19['query'],_0x29d0e3[_0x4abe('0x41')]));if(_0x19eb19[_0x4abe('0x40')][_0x4abe('0x4e')]){_0x92cbbd[_0x4abe('0x4c')]=_[_0x4abe('0x4f')](_0x92cbbd[_0x4abe('0x4c')],{'$or':_['map'](_0x411a4c,function(_0x2cb4f4){if(_0x2cb4f4[_0x4abe('0x3e')]!==_0x4abe('0x50')){var _0x186bb0={};_0x186bb0[_0x2cb4f4[_0x4abe('0x39')]]={'$like':'%'+_0x19eb19[_0x4abe('0x40')][_0x4abe('0x4e')]+'%'};return _0x186bb0;}})});}_0x92cbbd=_[_0x4abe('0x4f')]({},_0x92cbbd,_0x19eb19[_0x4abe('0x51')]);var _0x28e892={'where':_0x92cbbd[_0x4abe('0x4c')]};return db['VoiceContext'][_0x4abe('0x2e')](_0x28e892)['then'](function(_0x579c1f){_0x407c3b[_0x4abe('0x2e')]=_0x579c1f;if(_0x19eb19['query'][_0x4abe('0x52')]){_0x92cbbd[_0x4abe('0x53')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x92cbbd);})['then'](function(_0x9cf51c){_0x407c3b[_0x4abe('0x54')]=_0x9cf51c;return _0x407c3b;})['then'](respondWithFilteredResult(_0x48b924,_0x92cbbd))[_0x4abe('0x2a')](handleError(_0x48b924,null));};exports['show']=function(_0x51092f,_0x2a2b7f){var _0x21d7c9={'raw':![],'where':{'id':_0x51092f[_0x4abe('0x55')]['id']}},_0xa14f8={};_0xa14f8[_0x4abe('0x42')]=_[_0x4abe('0x56')](db[_0x4abe('0x3c')]['rawAttributes']);_0xa14f8[_0x4abe('0x40')]=_[_0x4abe('0x56')](_0x51092f[_0x4abe('0x40')]);_0xa14f8['filters']=_['intersection'](_0xa14f8[_0x4abe('0x42')],_0xa14f8[_0x4abe('0x40')]);_0x21d7c9[_0x4abe('0x43')]=_['intersection'](_0xa14f8[_0x4abe('0x42')],qs[_0x4abe('0x45')](_0x51092f['query']['fields']));_0x21d7c9[_0x4abe('0x43')]=_0x21d7c9['attributes'][_0x4abe('0x46')]?_0x21d7c9[_0x4abe('0x43')]:_0xa14f8['model'];if(_0x51092f[_0x4abe('0x40')]['includeAll']){_0x21d7c9[_0x4abe('0x53')]=[{'all':!![]}];}_0x21d7c9=_['merge']({},_0x21d7c9,_0x51092f['options']);return db[_0x4abe('0x3c')][_0x4abe('0x57')](_0x21d7c9)[_0x4abe('0x1f')](handleEntityNotFound(_0x2a2b7f,null))[_0x4abe('0x1f')](respondWithResult(_0x2a2b7f,null))[_0x4abe('0x2a')](handleError(_0x2a2b7f,null));};exports['create']=function(_0x427f14,_0xca2e,_0x5d6652){var _0x5a62de;return db[_0x4abe('0x3c')][_0x4abe('0x58')](_0x427f14[_0x4abe('0x59')],{'raw':!![]})[_0x4abe('0x1f')](function(_0xc88397){_0x5a62de=_0xc88397;return db['VoiceContext'][_0x4abe('0x5a')]({'raw':!![]});})[_0x4abe('0x1f')](function(_0xacf584){var _0x2e8c47=fs[_0x4abe('0x5b')](path['join'](config[_0x4abe('0x5c')],_0x4abe('0x5d')),'utf8');var _0x372e61=ejs['render'](_0x2e8c47,{'contexts':_0xacf584||[]});fs[_0x4abe('0x5e')](_0x4abe('0x5f'),_0x372e61);})[_0x4abe('0x1f')](function(){return respondWithRpcPromise(_0x4abe('0x60'),'create',{'module':_0x4abe('0x61')});})['then'](function(){var _0x3e4fc2=_0x427f14['user']['get']({'plain':!![]});if(!_0x3e4fc2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e4fc2[_0x4abe('0x62')]==='user'){var _0x4cfe00=_0x5a62de[_0x4abe('0x35')]({'plain':!![]});return db[_0x4abe('0x63')][_0x4abe('0x57')]({'where':{'name':_0x4abe('0x36'),'userProfileId':_0x3e4fc2[_0x4abe('0x64')]},'raw':!![]})['then'](function(_0x5c4da2){if(_0x5c4da2&&_0x5c4da2['autoAssociation']===0x0){return db[_0x4abe('0x65')][_0x4abe('0x58')]({'name':_0x4cfe00[_0x4abe('0x39')],'resourceId':_0x4cfe00['id'],'type':_0x5c4da2[_0x4abe('0x39')],'sectionId':_0x5c4da2['id']},{})[_0x4abe('0x1f')](function(){return _0x5a62de;});}else{return _0x5a62de;}})['catch'](function(_0x27b156){logger[_0x4abe('0x24')](_0x4abe('0x66'),_0x27b156);throw _0x27b156;});}return _0x5a62de;})[_0x4abe('0x1f')](respondWithResult(_0xca2e,0xc9))[_0x4abe('0x2a')](handleError(_0xca2e,null));};exports[_0x4abe('0x33')]=function(_0x3d280e,_0x31c563,_0x15a6da){var _0x131e5c;return db[_0x4abe('0x3c')]['find']({'where':{'id':_0x3d280e['params']['id']}})[_0x4abe('0x1f')](handleEntityNotFound(_0x31c563,null))[_0x4abe('0x1f')](saveUpdates(_0x3d280e[_0x4abe('0x59')],null))['then'](function(_0xf33c7d){if(_0xf33c7d){_0x131e5c=_0xf33c7d;return db[_0x4abe('0x3c')][_0x4abe('0x5a')]({'raw':!![]});}})[_0x4abe('0x1f')](function(_0x278054){var _0x1c3629=fs[_0x4abe('0x5b')](path[_0x4abe('0x67')](config[_0x4abe('0x5c')],'server/files/templates/context.ejs'),_0x4abe('0x68'));var _0x5d102f=ejs[_0x4abe('0x69')](_0x1c3629,{'contexts':_0x278054||[]});fs[_0x4abe('0x5e')](_0x4abe('0x5f'),_0x5d102f);})[_0x4abe('0x1f')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x4abe('0x61')});})[_0x4abe('0x1f')](function(){return _0x131e5c;})[_0x4abe('0x1f')](respondWithResult(_0x31c563,null))['catch'](handleError(_0x31c563,null));};exports[_0x4abe('0x34')]=function(_0x5ecae1,_0x2ba908,_0x2092e2){var _0xfd10b;return db[_0x4abe('0x3c')][_0x4abe('0x57')]({'where':{'id':_0x5ecae1['params']['id']}})[_0x4abe('0x1f')](handleEntityNotFound(_0x2ba908,null))[_0x4abe('0x1f')](removeEntity(_0x2ba908,null))[_0x4abe('0x1f')](function(){return db[_0x4abe('0x3c')][_0x4abe('0x5a')]({'raw':!![]});})[_0x4abe('0x1f')](function(_0x1f30ef){var _0x152b5b=fs[_0x4abe('0x5b')](path[_0x4abe('0x67')](config[_0x4abe('0x5c')],_0x4abe('0x5d')),_0x4abe('0x68'));var _0xc265e1=ejs['render'](_0x152b5b,{'contexts':_0x1f30ef});fs[_0x4abe('0x5e')](_0x4abe('0x5f'),_0xc265e1);return respondWithRpcPromise(_0x4abe('0x60'),_0x4abe('0x34'),{'module':_0x4abe('0x61')});})[_0x4abe('0x2a')](handleError(_0x2ba908,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index e532095..c4f0db6 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 _0xf1a8=['bluebird','request-promise','rimraf','define','VoiceContext','voice_contexts','lodash','api'];(function(_0x6fae04,_0x33078d){var _0x546f87=function(_0xf771a0){while(--_0xf771a0){_0x6fae04['push'](_0x6fae04['shift']());}};_0x546f87(++_0x33078d);}(_0xf1a8,0x11e));var _0x8f1a=function(_0x497b7b,_0x2f912a){_0x497b7b=_0x497b7b-0x0;var _0x235951=_0xf1a8[_0x497b7b];return _0x235951;};'use strict';var _=require(_0x8f1a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8f1a('0x1'));var moment=require('moment');var BPromise=require(_0x8f1a('0x2'));var rp=require(_0x8f1a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f1a('0x4'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module['exports']=function(_0x354724,_0x1ef0bb){return _0x354724[_0x8f1a('0x5')](_0x8f1a('0x6'),attributes,{'tableName':_0x8f1a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3e1=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts'];(function(_0x5a05b6,_0x4c8435){var _0x4cd107=function(_0x347343){while(--_0x347343){_0x5a05b6['push'](_0x5a05b6['shift']());}};_0x4cd107(++_0x4c8435);}(_0xb3e1,0xd2));var _0x1b3e=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xb3e1[_0x386c3e];return _0x4b8e13;};'use strict';var _=require(_0x1b3e('0x0'));var util=require(_0x1b3e('0x1'));var logger=require('../../config/logger')(_0x1b3e('0x2'));var moment=require(_0x1b3e('0x3'));var BPromise=require(_0x1b3e('0x4'));var rp=require(_0x1b3e('0x5'));var fs=require('fs');var path=require(_0x1b3e('0x6'));var rimraf=require(_0x1b3e('0x7'));var config=require(_0x1b3e('0x8'));var attributes=require(_0x1b3e('0x9'));module[_0x1b3e('0xa')]=function(_0x3e2413,_0x43d9f9){return _0x3e2413[_0x1b3e('0xb')](_0x1b3e('0xc'),attributes,{'tableName':_0x1b3e('0xd'),'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 25d0a0f..26b962c 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 _0x1a72=['message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x21b36c,_0x543483){var _0x236627=function(_0x174f99){while(--_0x174f99){_0x21b36c['push'](_0x21b36c['shift']());}};_0x236627(++_0x543483);}(_0x1a72,0xad));var _0x21a7=function(_0x2a8773,_0x5e112a){_0x2a8773=_0x2a8773-0x0;var _0x1960b9=_0x1a72[_0x2a8773];return _0x1960b9;};'use strict';var _=require(_0x21a7('0x0'));var util=require(_0x21a7('0x1'));var moment=require('moment');var BPromise=require(_0x21a7('0x2'));var rs=require(_0x21a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x21a7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x21a7('0x5'))('rpc');var config=require(_0x21a7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x21a7('0x7')][_0x21a7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x458090,_0x2c4024,_0x40e24f){return new BPromise(function(_0x552968,_0x485194){return client[_0x21a7('0x9')](_0x458090,_0x40e24f)[_0x21a7('0xa')](function(_0x5b801b){logger['info'](_0x21a7('0xb'),_0x2c4024,_0x21a7('0xc'));logger[_0x21a7('0xd')](_0x21a7('0xe'),_0x2c4024,'request\x20sent',JSON['stringify'](_0x5b801b));if(_0x5b801b[_0x21a7('0xf')]){if(_0x5b801b['error'][_0x21a7('0x10')]===0x1f4){logger[_0x21a7('0xf')](_0x21a7('0xb'),_0x2c4024,_0x5b801b['error'][_0x21a7('0x11')]);return _0x485194(_0x5b801b[_0x21a7('0xf')][_0x21a7('0x11')]);}logger[_0x21a7('0xf')](_0x21a7('0xb'),_0x2c4024,_0x5b801b[_0x21a7('0xf')][_0x21a7('0x11')]);return _0x552968(_0x5b801b[_0x21a7('0xf')][_0x21a7('0x11')]);}else{logger['info'](_0x21a7('0xb'),_0x2c4024,_0x21a7('0xc'));_0x552968(_0x5b801b['result']['message']);}})[_0x21a7('0x12')](function(_0x99524d){logger[_0x21a7('0xf')]('VoiceContext,\x20%s,\x20%s',_0x2c4024,_0x99524d);_0x485194(_0x99524d);});});} \ No newline at end of file +var _0x9bcd=['error','code','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x36ccd3,_0x518fb0){var _0x1b40cd=function(_0x336c4d){while(--_0x336c4d){_0x36ccd3['push'](_0x36ccd3['shift']());}};_0x1b40cd(++_0x518fb0);}(_0x9bcd,0x100));var _0xd9bc=function(_0x3ec644,_0x4fe0ac){_0x3ec644=_0x3ec644-0x0;var _0x443fd1=_0x9bcd[_0x3ec644];return _0x443fd1;};'use strict';var _=require(_0xd9bc('0x0'));var util=require(_0xd9bc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd9bc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9bc('0x3'))['db'];var utils=require(_0xd9bc('0x4'));var logger=require(_0xd9bc('0x5'))(_0xd9bc('0x6'));var config=require('../../config/environment');var jayson=require(_0xd9bc('0x7'));var client=jayson[_0xd9bc('0x8')][_0xd9bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e4bf2,_0x2d0fc8,_0x2d471e){return new BPromise(function(_0x4c6378,_0x293503){return client[_0xd9bc('0xa')](_0x4e4bf2,_0x2d471e)[_0xd9bc('0xb')](function(_0x2b645c){logger[_0xd9bc('0xc')](_0xd9bc('0xd'),_0x2d0fc8,_0xd9bc('0xe'));logger[_0xd9bc('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2d0fc8,_0xd9bc('0xe'),JSON[_0xd9bc('0x10')](_0x2b645c));if(_0x2b645c[_0xd9bc('0x11')]){if(_0x2b645c[_0xd9bc('0x11')][_0xd9bc('0x12')]===0x1f4){logger[_0xd9bc('0x11')](_0xd9bc('0xd'),_0x2d0fc8,_0x2b645c[_0xd9bc('0x11')]['message']);return _0x293503(_0x2b645c[_0xd9bc('0x11')][_0xd9bc('0x13')]);}logger['error'](_0xd9bc('0xd'),_0x2d0fc8,_0x2b645c[_0xd9bc('0x11')][_0xd9bc('0x13')]);return _0x4c6378(_0x2b645c['error'][_0xd9bc('0x13')]);}else{logger[_0xd9bc('0xc')]('VoiceContext,\x20%s,\x20%s',_0x2d0fc8,_0xd9bc('0xe'));_0x4c6378(_0x2b645c[_0xd9bc('0x14')][_0xd9bc('0x13')]);}})['catch'](function(_0x240600){logger['error'](_0xd9bc('0xd'),_0x2d0fc8,_0x240600);_0x293503(_0x240600);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index dbfd08e..0573f8c 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 _0x7406=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy','util','connect-timeout','express','Router'];(function(_0x5d31f3,_0x4239b0){var _0x1cc88c=function(_0x1be8fc){while(--_0x1be8fc){_0x5d31f3['push'](_0x5d31f3['shift']());}};_0x1cc88c(++_0x4239b0);}(_0x7406,0x13f));var _0x6740=function(_0x3a82f7,_0x1d8189){_0x3a82f7=_0x3a82f7-0x0;var _0x2304a0=_0x7406[_0x3a82f7];return _0x2304a0;};'use strict';var multer=require('multer');var util=require(_0x6740('0x0'));var path=require('path');var timeout=require(_0x6740('0x1'));var express=require(_0x6740('0x2'));var router=express[_0x6740('0x3')]();var auth=require(_0x6740('0x4'));var interaction=require(_0x6740('0x5'));var config=require(_0x6740('0x6'));var controller=require(_0x6740('0x7'));router[_0x6740('0x8')]('/',auth[_0x6740('0x9')](),controller[_0x6740('0xa')]);router[_0x6740('0x8')]('/describe',auth[_0x6740('0x9')](),controller[_0x6740('0xb')]);router[_0x6740('0x8')](_0x6740('0xc'),auth[_0x6740('0x9')](),controller[_0x6740('0xd')]);router['post']('/',auth[_0x6740('0x9')](),controller[_0x6740('0xe')]);router[_0x6740('0xf')](_0x6740('0xc'),auth[_0x6740('0x9')](),controller[_0x6740('0x10')]);router[_0x6740('0x11')](_0x6740('0xc'),auth[_0x6740('0x9')](),controller[_0x6740('0x12')]);module['exports']=router; \ No newline at end of file +var _0xcf15=['describe','post','/:id','delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe'];(function(_0xa22583,_0x564cdd){var _0x3e2d07=function(_0x56520a){while(--_0x56520a){_0xa22583['push'](_0xa22583['shift']());}};_0x3e2d07(++_0x564cdd);}(_0xcf15,0x7d));var _0x5cf1=function(_0x5ff027,_0x451702){_0x5ff027=_0x5ff027-0x0;var _0x2ca147=_0xcf15[_0x5ff027];return _0x2ca147;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5cf1('0x0'));var timeout=require(_0x5cf1('0x1'));var express=require(_0x5cf1('0x2'));var router=express[_0x5cf1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5cf1('0x4'));var config=require(_0x5cf1('0x5'));var controller=require(_0x5cf1('0x6'));router[_0x5cf1('0x7')]('/',auth[_0x5cf1('0x8')](),controller[_0x5cf1('0x9')]);router[_0x5cf1('0x7')](_0x5cf1('0xa'),auth[_0x5cf1('0x8')](),controller[_0x5cf1('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5cf1('0xc')]('/',auth[_0x5cf1('0x8')](),controller['create']);router['put'](_0x5cf1('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5cf1('0xe')](_0x5cf1('0xd'),auth['isAuthenticated'](),controller[_0x5cf1('0xf')]);module[_0x5cf1('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index d048931..9322ea6 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 _0x9c63=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x9c63,0x12b));var _0x39c6=function(_0x43b3be,_0xf7a3b9){_0x43b3be=_0x43b3be-0x0;var _0x3afda2=_0x9c63[_0x43b3be];return _0x3afda2;};'use strict';var Sequelize=require(_0x39c6('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x39c6('0x1')]},'channel':{'type':Sequelize[_0x39c6('0x1')]},'channelstate':{'type':Sequelize[_0x39c6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x39c6('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x39c6('0x1')]},'connectedlinenum':{'type':Sequelize[_0x39c6('0x1')]},'connectedlinename':{'type':Sequelize[_0x39c6('0x1')]},'language':{'type':Sequelize[_0x39c6('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x39c6('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x39c6('0x1')]},'destchannel':{'type':Sequelize[_0x39c6('0x1')]},'destchannelstate':{'type':Sequelize[_0x39c6('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x39c6('0x1')]},'destcalleridnum':{'type':Sequelize[_0x39c6('0x1')]},'destcalleridname':{'type':Sequelize[_0x39c6('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x39c6('0x1')]},'destlanguage':{'type':Sequelize[_0x39c6('0x1')]},'destaccountcode':{'type':Sequelize[_0x39c6('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x39c6('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x39c6('0x1')]},'destlinkedid':{'type':Sequelize[_0x39c6('0x1')]},'dialstring':{'type':Sequelize[_0x39c6('0x1')]},'dialstatus':{'type':Sequelize[_0x39c6('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x39c6('0x3')]},'endtime':{'type':Sequelize[_0x39c6('0x3')]},'lastevent':{'type':Sequelize[_0x39c6('0x1')],'comment':_0x39c6('0x4')},'routeId':{'type':Sequelize[_0x39c6('0x2')]},'duration':{'type':Sequelize[_0x39c6('0x2')]},'holdtime':{'type':Sequelize[_0x39c6('0x2')]},'billableseconds':{'type':Sequelize[_0x39c6('0x2')]}}; \ No newline at end of file +var _0x0d68=['DATE','sequelize','STRING','INTEGER'];(function(_0x53d017,_0x11565c){var _0x4f369f=function(_0x529785){while(--_0x529785){_0x53d017['push'](_0x53d017['shift']());}};_0x4f369f(++_0x11565c);}(_0x0d68,0x129));var _0x80d6=function(_0x9076ca,_0x57e87b){_0x9076ca=_0x9076ca-0x0;var _0x557f0a=_0x0d68[_0x9076ca];return _0x557f0a;};'use strict';var Sequelize=require(_0x80d6('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x80d6('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x80d6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x80d6('0x1')]},'calleridnum':{'type':Sequelize[_0x80d6('0x1')]},'calleridname':{'type':Sequelize[_0x80d6('0x1')]},'connectedlinenum':{'type':Sequelize[_0x80d6('0x1')]},'connectedlinename':{'type':Sequelize[_0x80d6('0x1')]},'language':{'type':Sequelize[_0x80d6('0x1')]},'accountcode':{'type':Sequelize[_0x80d6('0x1')]},'context':{'type':Sequelize[_0x80d6('0x1')]},'exten':{'type':Sequelize[_0x80d6('0x1')]},'priority':{'type':Sequelize[_0x80d6('0x2')]},'uniqueid':{'type':Sequelize[_0x80d6('0x1')]},'linkedid':{'type':Sequelize[_0x80d6('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x80d6('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x80d6('0x1')]},'destcalleridnum':{'type':Sequelize[_0x80d6('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x80d6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x80d6('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x80d6('0x1')]},'destpriority':{'type':Sequelize[_0x80d6('0x2')]},'destuniqueid':{'type':Sequelize[_0x80d6('0x1')]},'destlinkedid':{'type':Sequelize[_0x80d6('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x80d6('0x1')]},'starttime':{'type':Sequelize[_0x80d6('0x3')]},'answertime':{'type':Sequelize[_0x80d6('0x3')]},'endtime':{'type':Sequelize[_0x80d6('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x80d6('0x2')]},'duration':{'type':Sequelize[_0x80d6('0x2')]},'holdtime':{'type':Sequelize[_0x80d6('0x2')]},'billableseconds':{'type':Sequelize[_0x80d6('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 4e4ce27..cfdf61f 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 _0x6f6b=['nolimit','limit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','length','include','create','body','find','describe','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','json','reject','save','update','then','destroy','error','stack','name','send','index','VoiceDialReport','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x8dc46d,_0x237800){var _0x1b928f=function(_0x570df7){while(--_0x570df7){_0x8dc46d['push'](_0x8dc46d['shift']());}};_0x1b928f(++_0x237800);}(_0x6f6b,0x1c0));var _0xb6f6=function(_0x30f0c5,_0x4d34e8){_0x30f0c5=_0x30f0c5-0x0;var _0x3b5e80=_0x6f6b[_0x30f0c5];return _0x3b5e80;};'use strict';var pdf=require(_0xb6f6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb6f6('0x1'));var rp=require(_0xb6f6('0x2'));var moment=require(_0xb6f6('0x3'));var BPromise=require(_0xb6f6('0x4'));var Mustache=require(_0xb6f6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb6f6('0x6'));var fs=require('fs');var _=require(_0xb6f6('0x7'));var squel=require(_0xb6f6('0x8'));var crypto=require(_0xb6f6('0x9'));var jsforce=require(_0xb6f6('0xa'));var deskjs=require(_0xb6f6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb6f6('0xc'));var Papa=require(_0xb6f6('0xd'));var Redis=require(_0xb6f6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb6f6('0xf'));var as=require(_0xb6f6('0x10'));var hardwareService=require(_0xb6f6('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb6f6('0x12'));var db=require(_0xb6f6('0x13'))['db'];function respondWithStatusCode(_0x49fb38,_0x27f3cc){_0x27f3cc=_0x27f3cc||0xcc;return function(_0x5da2eb){if(_0x5da2eb){return _0x49fb38[_0xb6f6('0x14')](_0x27f3cc);}return _0x49fb38[_0xb6f6('0x15')](_0x27f3cc)[_0xb6f6('0x16')]();};}function respondWithResult(_0x59987d,_0x3af808){_0x3af808=_0x3af808||0xc8;return function(_0xc95424){if(_0xc95424){return _0x59987d[_0xb6f6('0x15')](_0x3af808)['json'](_0xc95424);}};}function respondWithFilteredResult(_0x5ef89a,_0x359870){return function(_0xb67b1d){if(_0xb67b1d){var _0xf83aba=_0xb67b1d[_0xb6f6('0x17')],_0x528899=_0x359870[_0xb6f6('0x18')],_0x103564=_0x359870[_0xb6f6('0x18')]+_0x359870['limit'],_0x3c2c6d;if(_0x103564>=_0xf83aba){_0x103564=_0xf83aba;_0x3c2c6d=0xc8;}else{_0x3c2c6d=0xce;}_0x5ef89a['status'](_0x3c2c6d);return _0x5ef89a[_0xb6f6('0x19')]('Content-Range',_0x528899+'-'+_0x103564+'/'+_0xf83aba)[_0xb6f6('0x1a')](_0xb67b1d);}return null;};}function patchUpdates(_0x10e10a){return function(_0x4e13c5){try{jsonpatch['apply'](_0x4e13c5,_0x10e10a,!![]);}catch(_0x5e9fa1){return BPromise[_0xb6f6('0x1b')](_0x5e9fa1);}return _0x4e13c5[_0xb6f6('0x1c')]();};}function saveUpdates(_0x21faf3,_0x967fc8){return function(_0x39e395){if(_0x39e395){return _0x39e395[_0xb6f6('0x1d')](_0x21faf3)[_0xb6f6('0x1e')](function(_0x2fadc0){return _0x2fadc0;});}return null;};}function removeEntity(_0x9cbd18,_0x21541a){return function(_0x2f80d5){if(_0x2f80d5){return _0x2f80d5[_0xb6f6('0x1f')]()[_0xb6f6('0x1e')](function(){_0x9cbd18[_0xb6f6('0x15')](0xcc)[_0xb6f6('0x16')]();});}};}function handleEntityNotFound(_0x5b3b4e,_0x35f927){return function(_0x21a9aa){if(!_0x21a9aa){_0x5b3b4e[_0xb6f6('0x14')](0x194);}return _0x21a9aa;};}function handleError(_0x260c74,_0xa36498){_0xa36498=_0xa36498||0x1f4;return function(_0x2dc6da){logger[_0xb6f6('0x20')](_0x2dc6da[_0xb6f6('0x21')]);if(_0x2dc6da['name']){delete _0x2dc6da[_0xb6f6('0x22')];}_0x260c74['status'](_0xa36498)[_0xb6f6('0x23')](_0x2dc6da);};}exports[_0xb6f6('0x24')]=function(_0x3b8482,_0xcf1427){var _0x14647e={},_0x276431={},_0x3769c2={'count':0x0,'rows':[]};var _0x1891c7=_['map'](db[_0xb6f6('0x25')][_0xb6f6('0x26')],function(_0x2ea5ea){return{'name':_0x2ea5ea['fieldName'],'type':_0x2ea5ea[_0xb6f6('0x27')][_0xb6f6('0x28')]};});_0x276431[_0xb6f6('0x29')]=_[_0xb6f6('0x2a')](_0x1891c7,_0xb6f6('0x22'));_0x276431[_0xb6f6('0x2b')]=_['keys'](_0x3b8482[_0xb6f6('0x2b')]);_0x276431[_0xb6f6('0x2c')]=_[_0xb6f6('0x2d')](_0x276431['model'],_0x276431['query']);_0x14647e[_0xb6f6('0x2e')]=_['intersection'](_0x276431[_0xb6f6('0x29')],qs[_0xb6f6('0x2f')](_0x3b8482[_0xb6f6('0x2b')][_0xb6f6('0x2f')]));_0x14647e[_0xb6f6('0x2e')]=_0x14647e[_0xb6f6('0x2e')]['length']?_0x14647e[_0xb6f6('0x2e')]:_0x276431[_0xb6f6('0x29')];if(!_0x3b8482['query'][_0xb6f6('0x30')](_0xb6f6('0x31'))){_0x14647e[_0xb6f6('0x32')]=qs[_0xb6f6('0x32')](_0x3b8482['query'][_0xb6f6('0x32')]);_0x14647e[_0xb6f6('0x18')]=qs[_0xb6f6('0x18')](_0x3b8482['query']['offset']);}_0x14647e[_0xb6f6('0x33')]=qs[_0xb6f6('0x34')](_0x3b8482[_0xb6f6('0x2b')][_0xb6f6('0x34')]);_0x14647e[_0xb6f6('0x35')]=qs[_0xb6f6('0x2c')](_[_0xb6f6('0x36')](_0x3b8482['query'],_0x276431[_0xb6f6('0x2c')]));if(_0x3b8482[_0xb6f6('0x2b')]['filter']){_0x14647e[_0xb6f6('0x35')]=_['merge'](_0x14647e[_0xb6f6('0x35')],{'$or':_[_0xb6f6('0x2a')](_0x1891c7,function(_0x5d122a){if(_0x5d122a['type']!==_0xb6f6('0x37')){var _0x199452={};_0x199452[_0x5d122a[_0xb6f6('0x22')]]={'$like':'%'+_0x3b8482[_0xb6f6('0x2b')]['filter']+'%'};return _0x199452;}})});}_0x14647e=_[_0xb6f6('0x38')]({},_0x14647e,_0x3b8482[_0xb6f6('0x39')]);var _0xeffc7f={'where':_0x14647e[_0xb6f6('0x35')]};return db['VoiceDialReport']['count'](_0xeffc7f)['then'](function(_0x2c1273){_0x3769c2[_0xb6f6('0x17')]=_0x2c1273;if(_0x3b8482[_0xb6f6('0x2b')][_0xb6f6('0x3a')]){_0x14647e['include']=[{'all':!![]}];}return db[_0xb6f6('0x25')][_0xb6f6('0x3b')](_0x14647e);})[_0xb6f6('0x1e')](function(_0x79bc93){_0x3769c2[_0xb6f6('0x3c')]=_0x79bc93;return _0x3769c2;})[_0xb6f6('0x1e')](respondWithFilteredResult(_0xcf1427,_0x14647e))[_0xb6f6('0x3d')](handleError(_0xcf1427,null));};exports[_0xb6f6('0x3e')]=function(_0x358cd6,_0xac91e8){var _0x55b598={'raw':!![],'where':{'id':_0x358cd6[_0xb6f6('0x3f')]['id']}},_0x3275fa={};_0x3275fa[_0xb6f6('0x29')]=_['keys'](db['VoiceDialReport'][_0xb6f6('0x26')]);_0x3275fa[_0xb6f6('0x2b')]=_[_0xb6f6('0x40')](_0x358cd6['query']);_0x3275fa[_0xb6f6('0x2c')]=_[_0xb6f6('0x2d')](_0x3275fa[_0xb6f6('0x29')],_0x3275fa[_0xb6f6('0x2b')]);_0x55b598['attributes']=_['intersection'](_0x3275fa[_0xb6f6('0x29')],qs[_0xb6f6('0x2f')](_0x358cd6[_0xb6f6('0x2b')][_0xb6f6('0x2f')]));_0x55b598[_0xb6f6('0x2e')]=_0x55b598[_0xb6f6('0x2e')][_0xb6f6('0x41')]?_0x55b598[_0xb6f6('0x2e')]:_0x3275fa[_0xb6f6('0x29')];if(_0x358cd6[_0xb6f6('0x2b')][_0xb6f6('0x3a')]){_0x55b598[_0xb6f6('0x42')]=[{'all':!![]}];}_0x55b598=_['merge']({},_0x55b598,_0x358cd6[_0xb6f6('0x39')]);return db[_0xb6f6('0x25')]['find'](_0x55b598)[_0xb6f6('0x1e')](handleEntityNotFound(_0xac91e8,null))[_0xb6f6('0x1e')](respondWithResult(_0xac91e8,null))[_0xb6f6('0x3d')](handleError(_0xac91e8,null));};exports[_0xb6f6('0x43')]=function(_0xbaad24,_0x3439e4){return db[_0xb6f6('0x25')][_0xb6f6('0x43')](_0xbaad24[_0xb6f6('0x44')],{})[_0xb6f6('0x1e')](respondWithResult(_0x3439e4,0xc9))[_0xb6f6('0x3d')](handleError(_0x3439e4,null));};exports[_0xb6f6('0x1d')]=function(_0x1f6cbc,_0x10f5d7){if(_0x1f6cbc[_0xb6f6('0x44')]['id']){delete _0x1f6cbc[_0xb6f6('0x44')]['id'];}return db[_0xb6f6('0x25')][_0xb6f6('0x45')]({'where':{'id':_0x1f6cbc[_0xb6f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x10f5d7,null))[_0xb6f6('0x1e')](saveUpdates(_0x1f6cbc[_0xb6f6('0x44')],null))['then'](respondWithResult(_0x10f5d7,null))['catch'](handleError(_0x10f5d7,null));};exports['destroy']=function(_0x4871c1,_0x4ab445){return db['VoiceDialReport'][_0xb6f6('0x45')]({'where':{'id':_0x4871c1[_0xb6f6('0x3f')]['id']}})[_0xb6f6('0x1e')](handleEntityNotFound(_0x4ab445,null))['then'](removeEntity(_0x4ab445,null))[_0xb6f6('0x3d')](handleError(_0x4ab445,null));};exports['describe']=function(_0x1e956f,_0x36e413){return db['VoiceDialReport'][_0xb6f6('0x46')]()[_0xb6f6('0x1e')](respondWithResult(_0x36e413,null))[_0xb6f6('0x3d')](handleError(_0x36e413,null));}; \ No newline at end of file +var _0x6f26=['desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','reject','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','find','create','update','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel'];(function(_0x173ea4,_0x1ed6ce){var _0x2491ff=function(_0x1d4405){while(--_0x1d4405){_0x173ea4['push'](_0x173ea4['shift']());}};_0x2491ff(++_0x1ed6ce);}(_0x6f26,0x19e));var _0x66f2=function(_0x2e9662,_0xba0b06){_0x2e9662=_0x2e9662-0x0;var _0xec0122=_0x6f26[_0x2e9662];return _0xec0122;};'use strict';var pdf=require(_0x66f2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x66f2('0x1'));var zipdir=require(_0x66f2('0x2'));var jsonpatch=require(_0x66f2('0x3'));var rp=require('request-promise');var moment=require(_0x66f2('0x4'));var BPromise=require(_0x66f2('0x5'));var Mustache=require(_0x66f2('0x6'));var util=require(_0x66f2('0x7'));var path=require(_0x66f2('0x8'));var sox=require(_0x66f2('0x9'));var csv=require('to-csv');var ejs=require(_0x66f2('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x66f2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x66f2('0xc'));var toCsv=require(_0x66f2('0xd'));var querystring=require('querystring');var Papa=require(_0x66f2('0xe'));var Redis=require(_0x66f2('0xf'));var authService=require(_0x66f2('0x10'));var qs=require(_0x66f2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66f2('0x12'));var logger=require(_0x66f2('0x13'))(_0x66f2('0x14'));var utils=require(_0x66f2('0x15'));var config=require(_0x66f2('0x16'));var db=require(_0x66f2('0x17'))['db'];function respondWithStatusCode(_0x39da66,_0x1cb0be){_0x1cb0be=_0x1cb0be||0xcc;return function(_0x17956d){if(_0x17956d){return _0x39da66[_0x66f2('0x18')](_0x1cb0be);}return _0x39da66['status'](_0x1cb0be)[_0x66f2('0x19')]();};}function respondWithResult(_0x569576,_0x170ef3){_0x170ef3=_0x170ef3||0xc8;return function(_0x2596ce){if(_0x2596ce){return _0x569576[_0x66f2('0x1a')](_0x170ef3)[_0x66f2('0x1b')](_0x2596ce);}};}function respondWithFilteredResult(_0x4f8dc5,_0x2d2ddf){return function(_0x1f7ea9){if(_0x1f7ea9){var _0x22597c=_0x1f7ea9['count'],_0xc492af=_0x2d2ddf[_0x66f2('0x1c')],_0x212968=_0x2d2ddf[_0x66f2('0x1c')]+_0x2d2ddf[_0x66f2('0x1d')],_0xb2f980;if(_0x212968>=_0x22597c){_0x212968=_0x22597c;_0xb2f980=0xc8;}else{_0xb2f980=0xce;}_0x4f8dc5[_0x66f2('0x1a')](_0xb2f980);return _0x4f8dc5['set'](_0x66f2('0x1e'),_0xc492af+'-'+_0x212968+'/'+_0x22597c)[_0x66f2('0x1b')](_0x1f7ea9);}return null;};}function patchUpdates(_0x163324){return function(_0x4aa075){try{jsonpatch['apply'](_0x4aa075,_0x163324,!![]);}catch(_0x5cf803){return BPromise[_0x66f2('0x1f')](_0x5cf803);}return _0x4aa075['save']();};}function saveUpdates(_0x2e891a,_0x4c71ab){return function(_0x522e0a){if(_0x522e0a){return _0x522e0a['update'](_0x2e891a)[_0x66f2('0x20')](function(_0x3a8340){return _0x3a8340;});}return null;};}function removeEntity(_0x3c32d3,_0x5a141f){return function(_0x2c4420){if(_0x2c4420){return _0x2c4420[_0x66f2('0x21')]()[_0x66f2('0x20')](function(){_0x3c32d3['status'](0xcc)[_0x66f2('0x19')]();});}};}function handleEntityNotFound(_0x28ab19,_0x3802e1){return function(_0x3fbdce){if(!_0x3fbdce){_0x28ab19[_0x66f2('0x18')](0x194);}return _0x3fbdce;};}function handleError(_0xeb8730,_0x72d4ca){_0x72d4ca=_0x72d4ca||0x1f4;return function(_0x49fcb9){logger[_0x66f2('0x22')](_0x49fcb9[_0x66f2('0x23')]);if(_0x49fcb9[_0x66f2('0x24')]){delete _0x49fcb9[_0x66f2('0x24')];}_0xeb8730[_0x66f2('0x1a')](_0x72d4ca)[_0x66f2('0x25')](_0x49fcb9);};}exports[_0x66f2('0x26')]=function(_0x1cf6b3,_0x128bc7){var _0x459b63={},_0x5c7c23={},_0x44a9ce={'count':0x0,'rows':[]};var _0x1ae4fa=_[_0x66f2('0x27')](db[_0x66f2('0x28')][_0x66f2('0x29')],function(_0x5d206c){return{'name':_0x5d206c[_0x66f2('0x2a')],'type':_0x5d206c['type']['key']};});_0x5c7c23['model']=_[_0x66f2('0x27')](_0x1ae4fa,_0x66f2('0x24'));_0x5c7c23[_0x66f2('0x2b')]=_[_0x66f2('0x2c')](_0x1cf6b3[_0x66f2('0x2b')]);_0x5c7c23[_0x66f2('0x2d')]=_[_0x66f2('0x2e')](_0x5c7c23[_0x66f2('0x2f')],_0x5c7c23[_0x66f2('0x2b')]);_0x459b63[_0x66f2('0x30')]=_[_0x66f2('0x2e')](_0x5c7c23[_0x66f2('0x2f')],qs['fields'](_0x1cf6b3['query'][_0x66f2('0x31')]));_0x459b63['attributes']=_0x459b63[_0x66f2('0x30')][_0x66f2('0x32')]?_0x459b63[_0x66f2('0x30')]:_0x5c7c23[_0x66f2('0x2f')];if(!_0x1cf6b3[_0x66f2('0x2b')][_0x66f2('0x33')]('nolimit')){_0x459b63[_0x66f2('0x1d')]=qs[_0x66f2('0x1d')](_0x1cf6b3[_0x66f2('0x2b')][_0x66f2('0x1d')]);_0x459b63[_0x66f2('0x1c')]=qs['offset'](_0x1cf6b3[_0x66f2('0x2b')][_0x66f2('0x1c')]);}_0x459b63['order']=qs[_0x66f2('0x34')](_0x1cf6b3['query'][_0x66f2('0x34')]);_0x459b63[_0x66f2('0x35')]=qs[_0x66f2('0x2d')](_[_0x66f2('0x36')](_0x1cf6b3[_0x66f2('0x2b')],_0x5c7c23[_0x66f2('0x2d')]));if(_0x1cf6b3[_0x66f2('0x2b')][_0x66f2('0x37')]){_0x459b63[_0x66f2('0x35')]=_[_0x66f2('0x38')](_0x459b63[_0x66f2('0x35')],{'$or':_['map'](_0x1ae4fa,function(_0x298d1d){if(_0x298d1d[_0x66f2('0x39')]!==_0x66f2('0x3a')){var _0x302b31={};_0x302b31[_0x298d1d[_0x66f2('0x24')]]={'$like':'%'+_0x1cf6b3[_0x66f2('0x2b')][_0x66f2('0x37')]+'%'};return _0x302b31;}})});}_0x459b63=_[_0x66f2('0x38')]({},_0x459b63,_0x1cf6b3[_0x66f2('0x3b')]);var _0x5cacc6={'where':_0x459b63[_0x66f2('0x35')]};return db[_0x66f2('0x28')]['count'](_0x5cacc6)[_0x66f2('0x20')](function(_0x2f2999){_0x44a9ce[_0x66f2('0x3c')]=_0x2f2999;if(_0x1cf6b3[_0x66f2('0x2b')][_0x66f2('0x3d')]){_0x459b63[_0x66f2('0x3e')]=[{'all':!![]}];}return db[_0x66f2('0x28')][_0x66f2('0x3f')](_0x459b63);})[_0x66f2('0x20')](function(_0x12ed44){_0x44a9ce[_0x66f2('0x40')]=_0x12ed44;return _0x44a9ce;})[_0x66f2('0x20')](respondWithFilteredResult(_0x128bc7,_0x459b63))[_0x66f2('0x41')](handleError(_0x128bc7,null));};exports['show']=function(_0x5b8349,_0x5cb329){var _0x25c287={'raw':!![],'where':{'id':_0x5b8349[_0x66f2('0x42')]['id']}},_0x500ee9={};_0x500ee9[_0x66f2('0x2f')]=_[_0x66f2('0x2c')](db['VoiceDialReport'][_0x66f2('0x29')]);_0x500ee9['query']=_[_0x66f2('0x2c')](_0x5b8349['query']);_0x500ee9['filters']=_[_0x66f2('0x2e')](_0x500ee9[_0x66f2('0x2f')],_0x500ee9[_0x66f2('0x2b')]);_0x25c287['attributes']=_[_0x66f2('0x2e')](_0x500ee9[_0x66f2('0x2f')],qs[_0x66f2('0x31')](_0x5b8349[_0x66f2('0x2b')][_0x66f2('0x31')]));_0x25c287[_0x66f2('0x30')]=_0x25c287[_0x66f2('0x30')][_0x66f2('0x32')]?_0x25c287[_0x66f2('0x30')]:_0x500ee9[_0x66f2('0x2f')];if(_0x5b8349[_0x66f2('0x2b')]['includeAll']){_0x25c287[_0x66f2('0x3e')]=[{'all':!![]}];}_0x25c287=_[_0x66f2('0x38')]({},_0x25c287,_0x5b8349[_0x66f2('0x3b')]);return db['VoiceDialReport'][_0x66f2('0x43')](_0x25c287)['then'](handleEntityNotFound(_0x5cb329,null))[_0x66f2('0x20')](respondWithResult(_0x5cb329,null))[_0x66f2('0x41')](handleError(_0x5cb329,null));};exports[_0x66f2('0x44')]=function(_0x1566ed,_0x3bc7a6){return db['VoiceDialReport']['create'](_0x1566ed['body'],{})['then'](respondWithResult(_0x3bc7a6,0xc9))[_0x66f2('0x41')](handleError(_0x3bc7a6,null));};exports[_0x66f2('0x45')]=function(_0x778c94,_0x192e5a){if(_0x778c94[_0x66f2('0x46')]['id']){delete _0x778c94[_0x66f2('0x46')]['id'];}return db[_0x66f2('0x28')][_0x66f2('0x43')]({'where':{'id':_0x778c94[_0x66f2('0x42')]['id']}})[_0x66f2('0x20')](handleEntityNotFound(_0x192e5a,null))[_0x66f2('0x20')](saveUpdates(_0x778c94[_0x66f2('0x46')],null))[_0x66f2('0x20')](respondWithResult(_0x192e5a,null))[_0x66f2('0x41')](handleError(_0x192e5a,null));};exports[_0x66f2('0x21')]=function(_0x26fc93,_0x1f0e30){return db['VoiceDialReport'][_0x66f2('0x43')]({'where':{'id':_0x26fc93[_0x66f2('0x42')]['id']}})['then'](handleEntityNotFound(_0x1f0e30,null))[_0x66f2('0x20')](removeEntity(_0x1f0e30,null))[_0x66f2('0x41')](handleError(_0x1f0e30,null));};exports['describe']=function(_0xfae500,_0x1598c9){return db['VoiceDialReport']['describe']()[_0x66f2('0x20')](respondWithResult(_0x1598c9,null))[_0x66f2('0x41')](handleError(_0x1598c9,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 6db99d0..54105f8 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 _0x8468=['api','moment','bluebird','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x8468,0x14f));var _0x8846=function(_0x280321,_0x1270f3){_0x280321=_0x280321-0x0;var _0x3348df=_0x8468[_0x280321];return _0x3348df;};'use strict';var _=require(_0x8846('0x0'));var util=require(_0x8846('0x1'));var logger=require(_0x8846('0x2'))(_0x8846('0x3'));var moment=require(_0x8846('0x4'));var BPromise=require(_0x8846('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8846('0x6'));var attributes=require(_0x8846('0x7'));module[_0x8846('0x8')]=function(_0x55d1c2,_0x41067f){return _0x55d1c2[_0x8846('0x9')](_0x8846('0xa'),attributes,{'tableName':_0x8846('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8846('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd218=['request-promise','path','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','../../config/logger','api','moment'];(function(_0x221869,_0x18f121){var _0x62421=function(_0x4f1422){while(--_0x4f1422){_0x221869['push'](_0x221869['shift']());}};_0x62421(++_0x18f121);}(_0xd218,0x81));var _0x8d21=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xd218[_0xae7c2f];return _0x5d7001;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8d21('0x0'))(_0x8d21('0x1'));var moment=require(_0x8d21('0x2'));var BPromise=require('bluebird');var rp=require(_0x8d21('0x3'));var fs=require('fs');var path=require(_0x8d21('0x4'));var rimraf=require('rimraf');var config=require(_0x8d21('0x5'));var attributes=require(_0x8d21('0x6'));module[_0x8d21('0x7')]=function(_0x302db8,_0xed320f){return _0x302db8['define'](_0x8d21('0x8'),attributes,{'tableName':_0x8d21('0x9'),'paranoid':![],'indexes':[{'fields':[_0x8d21('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 ae49867..c1dedf7 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 _0xd52a=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateVoiceDialReport','create','options','raw','UpdateVoiceDialReport','VoiceDialReport','body','where','limit','then','util'];(function(_0x1ad693,_0x18b06e){var _0x1a442a=function(_0x44c431){while(--_0x44c431){_0x1ad693['push'](_0x1ad693['shift']());}};_0x1a442a(++_0x18b06e);}(_0xd52a,0xca));var _0xad52=function(_0x16935d,_0x44fad0){_0x16935d=_0x16935d-0x0;var _0x571772=_0xd52a[_0x16935d];return _0x571772;};'use strict';var _=require('lodash');var util=require(_0xad52('0x0'));var moment=require('moment');var BPromise=require(_0xad52('0x1'));var rs=require(_0xad52('0x2'));var fs=require('fs');var Redis=require(_0xad52('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad52('0x4'));var logger=require(_0xad52('0x5'))(_0xad52('0x6'));var config=require(_0xad52('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad70b,_0x55f7a7,_0x23fc23){return new BPromise(function(_0x4bbff0,_0x192ba5){return client[_0xad52('0x8')](_0x1ad70b,_0x23fc23)['then'](function(_0x39c078){logger['info'](_0xad52('0x9'),_0x55f7a7,'request\x20sent');logger[_0xad52('0xa')](_0xad52('0xb'),_0x55f7a7,_0xad52('0xc'),JSON[_0xad52('0xd')](_0x39c078));if(_0x39c078['error']){if(_0x39c078['error']['code']===0x1f4){logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);return _0x192ba5(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')]['message']);return _0x4bbff0(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}else{logger[_0xad52('0x10')](_0xad52('0x9'),_0x55f7a7,_0xad52('0xc'));_0x4bbff0(_0x39c078[_0xad52('0x11')][_0xad52('0xf')]);}})[_0xad52('0x12')](function(_0x450099){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x55f7a7,_0x450099);_0x192ba5(_0x450099);});});}exports[_0xad52('0x13')]=function(_0x39128c){var _0x351440=this;return new Promise(function(_0x1c19e9,_0x33da89){return db['VoiceDialReport'][_0xad52('0x14')](_0x39128c['body'],{'raw':_0x39128c[_0xad52('0x15')]?_0x39128c[_0xad52('0x15')][_0xad52('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x24fb52){logger['info'](_0xad52('0x13'),_0x39128c);logger[_0xad52('0xa')](_0xad52('0x13'),_0x39128c,JSON[_0xad52('0xd')](_0x24fb52));_0x1c19e9(_0x24fb52);})[_0xad52('0x12')](function(_0x2f1526){logger['error'](_0xad52('0x13'),_0x2f1526['message'],_0x39128c);_0x33da89(_0x351440[_0xad52('0xe')](0x1f4,_0x2f1526[_0xad52('0xf')]));});});};exports[_0xad52('0x17')]=function(_0x5bce67){var _0x379f53=this;return new Promise(function(_0x579b9d,_0x5437e3){return db[_0xad52('0x18')]['update'](_0x5bce67[_0xad52('0x19')],{'raw':_0x5bce67[_0xad52('0x15')]?_0x5bce67['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bce67[_0xad52('0x15')]?_0x5bce67[_0xad52('0x15')][_0xad52('0x1a')]||null:null,'attributes':_0x5bce67['options']?_0x5bce67[_0xad52('0x15')]['attributes']||null:null,'limit':_0x5bce67[_0xad52('0x15')]?_0x5bce67[_0xad52('0x15')][_0xad52('0x1b')]||null:null})[_0xad52('0x1c')](function(_0x503bd0){logger[_0xad52('0x10')](_0xad52('0x17'),_0x5bce67);logger['debug'](_0xad52('0x17'),_0x5bce67,JSON[_0xad52('0xd')](_0x503bd0));_0x579b9d(_0x503bd0);})[_0xad52('0x12')](function(_0x75dfb6){logger[_0xad52('0xe')]('UpdateVoiceDialReport',_0x75dfb6['message'],_0x5bce67);_0x5437e3(_0x379f53['error'](0x1f4,_0x75dfb6[_0xad52('0xf')]));});});}; \ No newline at end of file +var _0xd73a=['stringify','UpdateVoiceDialReport','update','body','raw','where','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','VoiceDialReport','create','options','then','CreateVoiceDialReport'];(function(_0x444971,_0x12ad36){var _0x4bf256=function(_0x7d29c3){while(--_0x7d29c3){_0x444971['push'](_0x444971['shift']());}};_0x4bf256(++_0x12ad36);}(_0xd73a,0x171));var _0xad73=function(_0x29afc6,_0x37118f){_0x29afc6=_0x29afc6-0x0;var _0x23fb71=_0xd73a[_0x29afc6];return _0x23fb71;};'use strict';var _=require(_0xad73('0x0'));var util=require(_0xad73('0x1'));var moment=require(_0xad73('0x2'));var BPromise=require(_0xad73('0x3'));var rs=require(_0xad73('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad73('0x5'));var logger=require(_0xad73('0x6'))(_0xad73('0x7'));var config=require(_0xad73('0x8'));var jayson=require(_0xad73('0x9'));var client=jayson[_0xad73('0xa')][_0xad73('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f4736,_0x24d620,_0x15cf28){return new BPromise(function(_0x1352b3,_0x524324){return client[_0xad73('0xc')](_0x2f4736,_0x15cf28)['then'](function(_0x3c07fa){logger[_0xad73('0xd')](_0xad73('0xe'),_0x24d620,'request\x20sent');logger[_0xad73('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x24d620,_0xad73('0x10'),JSON['stringify'](_0x3c07fa));if(_0x3c07fa[_0xad73('0x11')]){if(_0x3c07fa[_0xad73('0x11')][_0xad73('0x12')]===0x1f4){logger['error'](_0xad73('0xe'),_0x24d620,_0x3c07fa[_0xad73('0x11')]['message']);return _0x524324(_0x3c07fa[_0xad73('0x11')][_0xad73('0x13')]);}logger[_0xad73('0x11')](_0xad73('0xe'),_0x24d620,_0x3c07fa[_0xad73('0x11')][_0xad73('0x13')]);return _0x1352b3(_0x3c07fa['error'][_0xad73('0x13')]);}else{logger[_0xad73('0xd')](_0xad73('0xe'),_0x24d620,_0xad73('0x10'));_0x1352b3(_0x3c07fa[_0xad73('0x14')][_0xad73('0x13')]);}})[_0xad73('0x15')](function(_0x367a5d){logger[_0xad73('0x11')](_0xad73('0xe'),_0x24d620,_0x367a5d);_0x524324(_0x367a5d);});});}exports['CreateVoiceDialReport']=function(_0x47381a){var _0x4cafad=this;return new Promise(function(_0x5bd242,_0x28bd73){return db[_0xad73('0x16')][_0xad73('0x17')](_0x47381a['body'],{'raw':_0x47381a[_0xad73('0x18')]?_0x47381a[_0xad73('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xad73('0x19')](function(_0x4289df){logger[_0xad73('0xd')](_0xad73('0x1a'),_0x47381a);logger[_0xad73('0xf')](_0xad73('0x1a'),_0x47381a,JSON[_0xad73('0x1b')](_0x4289df));_0x5bd242(_0x4289df);})['catch'](function(_0xfe2758){logger[_0xad73('0x11')](_0xad73('0x1a'),_0xfe2758[_0xad73('0x13')],_0x47381a);_0x28bd73(_0x4cafad[_0xad73('0x11')](0x1f4,_0xfe2758[_0xad73('0x13')]));});});};exports[_0xad73('0x1c')]=function(_0x439f09){var _0xcdb93d=this;return new Promise(function(_0x68aa8c,_0x18e58b){return db[_0xad73('0x16')][_0xad73('0x1d')](_0x439f09[_0xad73('0x1e')],{'raw':_0x439f09[_0xad73('0x18')]?_0x439f09[_0xad73('0x18')][_0xad73('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x439f09[_0xad73('0x18')]?_0x439f09[_0xad73('0x18')][_0xad73('0x20')]||null:null,'attributes':_0x439f09['options']?_0x439f09['options']['attributes']||null:null,'limit':_0x439f09[_0xad73('0x18')]?_0x439f09[_0xad73('0x18')]['limit']||null:null})[_0xad73('0x19')](function(_0x54a8f9){logger['info'](_0xad73('0x1c'),_0x439f09);logger[_0xad73('0xf')](_0xad73('0x1c'),_0x439f09,JSON[_0xad73('0x1b')](_0x54a8f9));_0x68aa8c(_0x54a8f9);})['catch'](function(_0xdf45e8){logger[_0xad73('0x11')](_0xad73('0x1c'),_0xdf45e8['message'],_0x439f09);_0x18e58b(_0xcdb93d[_0xad73('0x11')](0x1f4,_0xdf45e8[_0xad73('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 08a1b2e..d7e7af1 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 _0xbf13=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','show','post','create','/:id/applications','addApplications','put','update','delete','exports','multer','util'];(function(_0x14224f,_0x6b798b){var _0x2d2c33=function(_0x3eb823){while(--_0x3eb823){_0x14224f['push'](_0x14224f['shift']());}};_0x2d2c33(++_0x6b798b);}(_0xbf13,0xe2));var _0x3bf1=function(_0x322aeb,_0x56517e){_0x322aeb=_0x322aeb-0x0;var _0x32e117=_0xbf13[_0x322aeb];return _0x32e117;};'use strict';var multer=require(_0x3bf1('0x0'));var util=require(_0x3bf1('0x1'));var path=require(_0x3bf1('0x2'));var timeout=require(_0x3bf1('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3bf1('0x4'));var interaction=require(_0x3bf1('0x5'));var config=require('../../config/environment');var controller=require(_0x3bf1('0x6'));router[_0x3bf1('0x7')]('/',auth[_0x3bf1('0x8')](),controller[_0x3bf1('0x9')]);router[_0x3bf1('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3bf1('0xa')]);router[_0x3bf1('0xb')]('/',auth['isAuthenticated'](),controller[_0x3bf1('0xc')]);router[_0x3bf1('0xb')](_0x3bf1('0xd'),auth[_0x3bf1('0x8')](),controller[_0x3bf1('0xe')]);router[_0x3bf1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3bf1('0x10')]);router[_0x3bf1('0x11')]('/:id',auth[_0x3bf1('0x8')](),controller['destroy']);module[_0x3bf1('0x12')]=router; \ No newline at end of file +var _0xfa34=['express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','/:id/applications','addApplications','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x506172,_0xbc3a3){var _0x2723c0=function(_0x57c3d9){while(--_0x57c3d9){_0x506172['push'](_0x506172['shift']());}};_0x2723c0(++_0xbc3a3);}(_0xfa34,0x74));var _0x4fa3=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0xfa34[_0x3e8cae];return _0x45c4d6;};'use strict';var multer=require(_0x4fa3('0x0'));var util=require(_0x4fa3('0x1'));var path=require(_0x4fa3('0x2'));var timeout=require(_0x4fa3('0x3'));var express=require(_0x4fa3('0x4'));var router=express[_0x4fa3('0x5')]();var auth=require(_0x4fa3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4fa3('0x7'));var controller=require(_0x4fa3('0x8'));router[_0x4fa3('0x9')]('/',auth[_0x4fa3('0xa')](),controller['index']);router[_0x4fa3('0x9')](_0x4fa3('0xb'),auth[_0x4fa3('0xa')](),controller[_0x4fa3('0xc')]);router[_0x4fa3('0xd')]('/',auth[_0x4fa3('0xa')](),controller[_0x4fa3('0xe')]);router[_0x4fa3('0xd')](_0x4fa3('0xf'),auth['isAuthenticated'](),controller[_0x4fa3('0x10')]);router[_0x4fa3('0x11')](_0x4fa3('0xb'),auth[_0x4fa3('0xa')](),controller['update']);router[_0x4fa3('0x12')](_0x4fa3('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4fa3('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 38e1543..7ff7dc4 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(_0x54639a,_0x5c8bbb){var _0x3aab1f=function(_0xae341b){while(--_0xae341b){_0x54639a['push'](_0x54639a['shift']());}};_0x3aab1f(++_0x5c8bbb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x34a752,_0x152aa1){var _0x121f4e=function(_0x4d0539){while(--_0x4d0539){_0x34a752['push'](_0x34a752['shift']());}};_0x121f4e(++_0x152aa1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 ab790e0..0d74fc2 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 _0xe019=['exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','OutboundRoutes','internal','value','UserProfileSection','autoAssociation','description','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','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/environment','redis','defaults','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','Content-Range','reject','save','update','destroy','then','get','InboundRoutes','InternalRoutes','filter','map','find','type','name','UserProfileResource','error','stack','send','index','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','VoiceExtension','rows','catch','params','body','outbound','startsWith'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0xe019,0x1b0));var _0x9e01=function(_0x57f32c,_0x20a63d){_0x57f32c=_0x57f32c-0x0;var _0x4087c7=_0xe019[_0x57f32c];return _0x4087c7;};'use strict';var pdf=require(_0x9e01('0x0'));var emlformat=require(_0x9e01('0x1'));var rimraf=require(_0x9e01('0x2'));var zipdir=require(_0x9e01('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e01('0x4'));var moment=require(_0x9e01('0x5'));var BPromise=require(_0x9e01('0x6'));var Mustache=require(_0x9e01('0x7'));var util=require(_0x9e01('0x8'));var path=require(_0x9e01('0x9'));var sox=require('sox');var csv=require(_0x9e01('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9e01('0xb'));var jsforce=require(_0x9e01('0xc'));var deskjs=require(_0x9e01('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9e01('0xe'));var Papa=require(_0x9e01('0xf'));var Redis=require('ioredis');var authService=require(_0x9e01('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9e01('0x11'));var hardwareService=require(_0x9e01('0x12'));var logger=require(_0x9e01('0x13'))(_0x9e01('0x14'));var utils=require('../../config/utils');var config=require(_0x9e01('0x15'));var db=require('../../mysqldb')['db'];config[_0x9e01('0x16')]=_[_0x9e01('0x17')](config[_0x9e01('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x9e01('0x18'))(new Redis(config[_0x9e01('0x16')]));require(_0x9e01('0x19'))['register'](socket);function respondWithStatusCode(_0xe90457,_0x4fc9a2){_0x4fc9a2=_0x4fc9a2||0xcc;return function(_0x399772){if(_0x399772){return _0xe90457[_0x9e01('0x1a')](_0x4fc9a2);}return _0xe90457[_0x9e01('0x1b')](_0x4fc9a2)[_0x9e01('0x1c')]();};}function respondWithResult(_0x488c10,_0x548ba0){_0x548ba0=_0x548ba0||0xc8;return function(_0x1043a5){if(_0x1043a5){return _0x488c10[_0x9e01('0x1b')](_0x548ba0)[_0x9e01('0x1d')](_0x1043a5);}};}function respondWithFilteredResult(_0x3291fe,_0x5efb57){return function(_0x479d00){if(_0x479d00){var _0x17dec0=_0x479d00['count'],_0x6f7d2f=_0x5efb57['offset'],_0x31bb5a=_0x5efb57[_0x9e01('0x1e')]+_0x5efb57['limit'],_0x20de1f;if(_0x31bb5a>=_0x17dec0){_0x31bb5a=_0x17dec0;_0x20de1f=0xc8;}else{_0x20de1f=0xce;}_0x3291fe[_0x9e01('0x1b')](_0x20de1f);return _0x3291fe['set'](_0x9e01('0x1f'),_0x6f7d2f+'-'+_0x31bb5a+'/'+_0x17dec0)[_0x9e01('0x1d')](_0x479d00);}return null;};}function patchUpdates(_0x46f171){return function(_0x2dce48){try{jsonpatch['apply'](_0x2dce48,_0x46f171,!![]);}catch(_0x3b7835){return BPromise[_0x9e01('0x20')](_0x3b7835);}return _0x2dce48[_0x9e01('0x21')]();};}function saveUpdates(_0x19fb7f,_0x467f74){return function(_0x4cd992){if(_0x4cd992){return _0x4cd992[_0x9e01('0x22')](_0x19fb7f)['then'](function(_0x295bc1){return _0x295bc1;});}return null;};}function removeEntity(_0x371f96,_0x21d77b){return function(_0x553ba2){if(_0x553ba2){return _0x553ba2[_0x9e01('0x23')]()[_0x9e01('0x24')](function(){var _0x4caa8f=_0x553ba2[_0x9e01('0x25')]({'plain':!![]});var _0x515f4f=[{'name':_0x9e01('0x26'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0x9e01('0x27'),'value':'internal','ignore':![]}];var _0x20293e=_(_0x515f4f)[_0x9e01('0x28')]('ignore')[_0x9e01('0x29')]('value')['value']();if(_['includes'](_0x20293e,_0x4caa8f['type'])){return;}var _0x1fdc50=_[_0x9e01('0x2a')](_0x515f4f,['value',_0x4caa8f[_0x9e01('0x2b')]])[_0x9e01('0x2c')];return db[_0x9e01('0x2d')][_0x9e01('0x23')]({'where':{'type':_0x1fdc50,'resourceId':_0x4caa8f['id']}})[_0x9e01('0x24')](function(){return _0x553ba2;});})[_0x9e01('0x24')](function(){_0x371f96[_0x9e01('0x1b')](0xcc)[_0x9e01('0x1c')]();});}};}function handleEntityNotFound(_0x532864,_0x2d3047){return function(_0x566ffe){if(!_0x566ffe){_0x532864[_0x9e01('0x1a')](0x194);}return _0x566ffe;};}function handleError(_0x5150c7,_0x22b572){_0x22b572=_0x22b572||0x1f4;return function(_0x1984c4){logger[_0x9e01('0x2e')](_0x1984c4[_0x9e01('0x2f')]);if(_0x1984c4[_0x9e01('0x2c')]){delete _0x1984c4['name'];}_0x5150c7[_0x9e01('0x1b')](_0x22b572)[_0x9e01('0x30')](_0x1984c4);};}exports[_0x9e01('0x31')]=function(_0xb6b744,_0x4cc66b){var _0x313cf8={},_0x2313cd={},_0x3d607e={'count':0x0,'rows':[]};var _0x7dcfe7=_['map'](db['VoiceExtension'][_0x9e01('0x32')],function(_0x1504f9){return{'name':_0x1504f9[_0x9e01('0x33')],'type':_0x1504f9[_0x9e01('0x2b')]['key']};});_0x2313cd[_0x9e01('0x34')]=_[_0x9e01('0x29')](_0x7dcfe7,_0x9e01('0x2c'));_0x2313cd['query']=_[_0x9e01('0x35')](_0xb6b744[_0x9e01('0x36')]);_0x2313cd[_0x9e01('0x37')]=_[_0x9e01('0x38')](_0x2313cd[_0x9e01('0x34')],_0x2313cd['query']);_0x313cf8[_0x9e01('0x39')]=_['intersection'](_0x2313cd[_0x9e01('0x34')],qs['fields'](_0xb6b744[_0x9e01('0x36')][_0x9e01('0x3a')]));_0x313cf8[_0x9e01('0x39')]=_0x313cf8[_0x9e01('0x39')][_0x9e01('0x3b')]?_0x313cf8[_0x9e01('0x39')]:_0x2313cd[_0x9e01('0x34')];if(!_0xb6b744[_0x9e01('0x36')]['hasOwnProperty'](_0x9e01('0x3c'))){_0x313cf8[_0x9e01('0x3d')]=qs[_0x9e01('0x3d')](_0xb6b744[_0x9e01('0x36')]['limit']);_0x313cf8['offset']=qs[_0x9e01('0x1e')](_0xb6b744[_0x9e01('0x36')]['offset']);}_0x313cf8['order']=qs[_0x9e01('0x3e')](_0xb6b744[_0x9e01('0x36')][_0x9e01('0x3e')]);_0x313cf8[_0x9e01('0x3f')]=qs[_0x9e01('0x37')](_[_0x9e01('0x40')](_0xb6b744['query'],_0x2313cd[_0x9e01('0x37')]));if(_0xb6b744[_0x9e01('0x36')]['filter']){_0x313cf8['where']=_[_0x9e01('0x41')](_0x313cf8[_0x9e01('0x3f')],{'$or':_[_0x9e01('0x29')](_0x7dcfe7,function(_0x3da5fc){if(_0x3da5fc['type']!==_0x9e01('0x42')){var _0x233868={};_0x233868[_0x3da5fc[_0x9e01('0x2c')]]={'$like':'%'+_0xb6b744[_0x9e01('0x36')][_0x9e01('0x28')]+'%'};return _0x233868;}})});}_0x313cf8=_[_0x9e01('0x41')]({},_0x313cf8,_0xb6b744[_0x9e01('0x43')]);var _0x26403f={'where':_0x313cf8['where']};return db['VoiceExtension'][_0x9e01('0x44')](_0x26403f)[_0x9e01('0x24')](function(_0x5cadf1){_0x3d607e['count']=_0x5cadf1;if(_0xb6b744['query'][_0x9e01('0x45')]){_0x313cf8[_0x9e01('0x46')]=[{'all':!![]}];}return db[_0x9e01('0x47')]['findAll'](_0x313cf8);})['then'](function(_0x14c113){_0x3d607e[_0x9e01('0x48')]=_0x14c113;return _0x3d607e;})[_0x9e01('0x24')](respondWithFilteredResult(_0x4cc66b,_0x313cf8))[_0x9e01('0x49')](handleError(_0x4cc66b,null));};exports['show']=function(_0x53b7a8,_0x5eb385){var _0x69d8b4={'raw':![],'where':{'id':_0x53b7a8[_0x9e01('0x4a')]['id']}},_0x11f220={};_0x11f220[_0x9e01('0x34')]=_[_0x9e01('0x35')](db[_0x9e01('0x47')]['rawAttributes']);_0x11f220[_0x9e01('0x36')]=_[_0x9e01('0x35')](_0x53b7a8[_0x9e01('0x36')]);_0x11f220[_0x9e01('0x37')]=_['intersection'](_0x11f220[_0x9e01('0x34')],_0x11f220[_0x9e01('0x36')]);_0x69d8b4[_0x9e01('0x39')]=_[_0x9e01('0x38')](_0x11f220[_0x9e01('0x34')],qs[_0x9e01('0x3a')](_0x53b7a8[_0x9e01('0x36')][_0x9e01('0x3a')]));_0x69d8b4[_0x9e01('0x39')]=_0x69d8b4[_0x9e01('0x39')][_0x9e01('0x3b')]?_0x69d8b4[_0x9e01('0x39')]:_0x11f220[_0x9e01('0x34')];if(_0x53b7a8[_0x9e01('0x36')][_0x9e01('0x45')]){_0x69d8b4['include']=[{'all':!![]}];}_0x69d8b4=_[_0x9e01('0x41')]({},_0x69d8b4,_0x53b7a8[_0x9e01('0x43')]);return db[_0x9e01('0x47')][_0x9e01('0x2a')](_0x69d8b4)[_0x9e01('0x24')](handleEntityNotFound(_0x5eb385,null))[_0x9e01('0x24')](respondWithResult(_0x5eb385,null))[_0x9e01('0x49')](handleError(_0x5eb385,null));};exports[_0x9e01('0x23')]=function(_0x408c33,_0x1c1dba){return db[_0x9e01('0x47')][_0x9e01('0x2a')]({'where':{'id':_0x408c33[_0x9e01('0x4a')]['id']}})[_0x9e01('0x24')](handleEntityNotFound(_0x1c1dba,null))[_0x9e01('0x24')](removeEntity(_0x1c1dba,null))[_0x9e01('0x49')](handleError(_0x1c1dba,null));};exports['create']=function(_0x6da4e6,_0x434c2b){if(_0x6da4e6[_0x9e01('0x4b')][_0x9e01('0x2b')]===_0x9e01('0x4c')&&!_[_0x9e01('0x4d')](_0x6da4e6[_0x9e01('0x4b')][_0x9e01('0x4e')],'_')){_0x6da4e6[_0x9e01('0x4b')][_0x9e01('0x4e')]='_'[_0x9e01('0x4f')](_0x6da4e6[_0x9e01('0x4b')][_0x9e01('0x4e')]);}return db[_0x9e01('0x47')][_0x9e01('0x50')](_0x6da4e6[_0x9e01('0x4b')],{'raw':![]})[_0x9e01('0x24')](function(_0x1b309c){var _0x5532a1=_0x6da4e6[_0x9e01('0x51')]['get']({'plain':!![]});if(!_0x5532a1)throw new Error(_0x9e01('0x52'));if(_0x5532a1[_0x9e01('0x53')]===_0x9e01('0x51')){var _0x53946a=_0x1b309c[_0x9e01('0x25')]({'plain':!![]});var _0x59fe4e=[{'name':_0x9e01('0x26'),'value':_0x9e01('0x54')},{'name':_0x9e01('0x55'),'value':_0x9e01('0x4c')},{'name':'InternalRoutes','value':_0x9e01('0x56')}];var _0x298a7e=_['find'](_0x59fe4e,[_0x9e01('0x57'),_0x53946a[_0x9e01('0x2b')]])[_0x9e01('0x2c')];return db[_0x9e01('0x58')]['find']({'where':{'name':_0x298a7e,'userProfileId':_0x5532a1['userProfileId']},'raw':!![]})[_0x9e01('0x24')](function(_0x5679f6){if(_0x5679f6&&_0x5679f6[_0x9e01('0x59')]===0x0){return db[_0x9e01('0x2d')][_0x9e01('0x50')]({'name':_0x53946a[_0x9e01('0x2c')],'resourceId':_0x53946a['id'],'type':_0x5679f6[_0x9e01('0x2c')],'sectionId':_0x5679f6['id']},{})['then'](function(){return _0x1b309c;});}else{return _0x1b309c;}})[_0x9e01('0x49')](function(_0x109c36){logger[_0x9e01('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x109c36);throw _0x109c36;});}return _0x1b309c;})[_0x9e01('0x24')](respondWithResult(_0x434c2b,0xc9))[_0x9e01('0x49')](handleError(_0x434c2b,null));};exports[_0x9e01('0x22')]=function(_0x3874de,_0x47a12f){if(_0x3874de[_0x9e01('0x4b')]['id']){delete _0x3874de[_0x9e01('0x4b')]['id'];}return db[_0x9e01('0x47')][_0x9e01('0x2a')]({'where':{'id':_0x3874de[_0x9e01('0x4a')]['id']}})['then'](handleEntityNotFound(_0x47a12f,null))['then'](function(_0x3efd2b){if(_0x3efd2b){return db[_0x9e01('0x47')]['update'](_[_0x9e01('0x40')](_0x3874de['body'],[_0x9e01('0x4e'),'context',_0x9e01('0x5a'),_0x9e01('0x5b'),_0x9e01('0x5c'),_0x9e01('0x5d')]),{'where':{'context':_0x3efd2b[_0x9e01('0x5e')],'exten':_0x3efd2b[_0x9e01('0x4e')]},'individualHooks':!![]})[_0x9e01('0x24')](function(_0x4d39f0){return _0x4d39f0;});}return null;})[_0x9e01('0x24')](respondWithStatusCode(_0x47a12f,null))[_0x9e01('0x49')](handleError(_0x47a12f,null));};exports[_0x9e01('0x5f')]=function(_0x220fe8,_0x5b83d8,_0x535e15){return db[_0x9e01('0x47')][_0x9e01('0x60')]({'where':{'id':_0x220fe8['params']['id']}})[_0x9e01('0x24')](handleEntityNotFound(_0x5b83d8,null))[_0x9e01('0x24')](function(_0x1b715a){if(_0x1b715a){return db[_0x9e01('0x61')][_0x9e01('0x62')](function(_0x2a99d7){return db[_0x9e01('0x47')]['destroy']({'where':{'VoiceExtensionId':_0x220fe8[_0x9e01('0x4a')]['id']},'transaction':_0x2a99d7})[_0x9e01('0x24')](function(_0x2367fd){var _0x11d09c=_[_0x9e01('0x29')](_0x220fe8['body'],function(_0xf5eea0){_0xf5eea0[_0x9e01('0x63')]=_0x220fe8[_0x9e01('0x4a')]['id'];return _0xf5eea0;});return db[_0x9e01('0x47')][_0x9e01('0x64')](_0x11d09c,{'transaction':_0x2a99d7});});})[_0x9e01('0x24')](function(){return db[_0x9e01('0x47')][_0x9e01('0x65')]({'where':{'isApp':!![],'VoiceExtensionId':_0x220fe8[_0x9e01('0x4a')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x9e01('0x24')](respondWithResult(_0x5b83d8,null))[_0x9e01('0x49')](handleError(_0x5b83d8,null));}; \ No newline at end of file +var _0x23cd=['length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','params','keys','options','find','create','body','startsWith','exten','role','user','InboundRoutes','OutboundRoutes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','inbound','outbound','InternalRoutes','internal','map','value','includes','type','name','UserProfileResource','destroy','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields'];(function(_0xdeac17,_0x19ad66){var _0x33aabd=function(_0x558a9e){while(--_0x558a9e){_0xdeac17['push'](_0xdeac17['shift']());}};_0x33aabd(++_0x19ad66);}(_0x23cd,0x8c));var _0xd23c=function(_0x549f42,_0x118e51){_0x549f42=_0x549f42-0x0;var _0x2624ee=_0x23cd[_0x549f42];return _0x2624ee;};'use strict';var pdf=require(_0xd23c('0x0'));var emlformat=require(_0xd23c('0x1'));var rimraf=require(_0xd23c('0x2'));var zipdir=require(_0xd23c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd23c('0x4'));var moment=require('moment');var BPromise=require(_0xd23c('0x5'));var Mustache=require('mustache');var util=require(_0xd23c('0x6'));var path=require(_0xd23c('0x7'));var sox=require('sox');var csv=require(_0xd23c('0x8'));var ejs=require(_0xd23c('0x9'));var fs=require('fs');var _=require(_0xd23c('0xa'));var squel=require(_0xd23c('0xb'));var crypto=require(_0xd23c('0xc'));var jsforce=require(_0xd23c('0xd'));var deskjs=require(_0xd23c('0xe'));var toCsv=require(_0xd23c('0x8'));var querystring=require(_0xd23c('0xf'));var Papa=require(_0xd23c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd23c('0x11'));var as=require(_0xd23c('0x12'));var hardwareService=require(_0xd23c('0x13'));var logger=require('../../config/logger')(_0xd23c('0x14'));var utils=require(_0xd23c('0x15'));var config=require('../../config/environment');var db=require(_0xd23c('0x16'))['db'];config['redis']=_['defaults'](config[_0xd23c('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xd23c('0x18'))(new Redis(config[_0xd23c('0x17')]));require(_0xd23c('0x19'))[_0xd23c('0x1a')](socket);function respondWithStatusCode(_0x16ed80,_0x1e207f){_0x1e207f=_0x1e207f||0xcc;return function(_0x11f6ae){if(_0x11f6ae){return _0x16ed80[_0xd23c('0x1b')](_0x1e207f);}return _0x16ed80[_0xd23c('0x1c')](_0x1e207f)[_0xd23c('0x1d')]();};}function respondWithResult(_0x25db39,_0x241d3d){_0x241d3d=_0x241d3d||0xc8;return function(_0x587443){if(_0x587443){return _0x25db39[_0xd23c('0x1c')](_0x241d3d)[_0xd23c('0x1e')](_0x587443);}};}function respondWithFilteredResult(_0x555329,_0x545ddf){return function(_0x42ff93){if(_0x42ff93){var _0x52e615=_0x42ff93[_0xd23c('0x1f')],_0x561c00=_0x545ddf[_0xd23c('0x20')],_0x38f3e6=_0x545ddf[_0xd23c('0x20')]+_0x545ddf[_0xd23c('0x21')],_0x3c8d7f;if(_0x38f3e6>=_0x52e615){_0x38f3e6=_0x52e615;_0x3c8d7f=0xc8;}else{_0x3c8d7f=0xce;}_0x555329[_0xd23c('0x1c')](_0x3c8d7f);return _0x555329[_0xd23c('0x22')](_0xd23c('0x23'),_0x561c00+'-'+_0x38f3e6+'/'+_0x52e615)[_0xd23c('0x1e')](_0x42ff93);}return null;};}function patchUpdates(_0xf76faa){return function(_0x32d335){try{jsonpatch[_0xd23c('0x24')](_0x32d335,_0xf76faa,!![]);}catch(_0x573b32){return BPromise[_0xd23c('0x25')](_0x573b32);}return _0x32d335['save']();};}function saveUpdates(_0x28a9fc,_0x41486e){return function(_0x25a03d){if(_0x25a03d){return _0x25a03d[_0xd23c('0x26')](_0x28a9fc)[_0xd23c('0x27')](function(_0xda2fcd){return _0xda2fcd;});}return null;};}function removeEntity(_0x138115,_0x5ba9e1){return function(_0x3edb97){if(_0x3edb97){return _0x3edb97['destroy']()['then'](function(){var _0x2995a7=_0x3edb97[_0xd23c('0x28')]({'plain':!![]});var _0x18bb6c=[{'name':'InboundRoutes','value':_0xd23c('0x29'),'ignore':![]},{'name':'OutboundRoutes','value':_0xd23c('0x2a'),'ignore':![]},{'name':_0xd23c('0x2b'),'value':_0xd23c('0x2c'),'ignore':![]}];var _0x25ecfd=_(_0x18bb6c)['filter']('ignore')[_0xd23c('0x2d')](_0xd23c('0x2e'))[_0xd23c('0x2e')]();if(_[_0xd23c('0x2f')](_0x25ecfd,_0x2995a7[_0xd23c('0x30')])){return;}var _0x55d1e4=_['find'](_0x18bb6c,[_0xd23c('0x2e'),_0x2995a7[_0xd23c('0x30')]])[_0xd23c('0x31')];return db[_0xd23c('0x32')][_0xd23c('0x33')]({'where':{'type':_0x55d1e4,'resourceId':_0x2995a7['id']}})[_0xd23c('0x27')](function(){return _0x3edb97;});})[_0xd23c('0x27')](function(){_0x138115[_0xd23c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4249ff,_0x14ee4a){return function(_0x5b2589){if(!_0x5b2589){_0x4249ff[_0xd23c('0x1b')](0x194);}return _0x5b2589;};}function handleError(_0x4c93dd,_0x295118){_0x295118=_0x295118||0x1f4;return function(_0x915de2){logger[_0xd23c('0x34')](_0x915de2[_0xd23c('0x35')]);if(_0x915de2[_0xd23c('0x31')]){delete _0x915de2[_0xd23c('0x31')];}_0x4c93dd[_0xd23c('0x1c')](_0x295118)[_0xd23c('0x36')](_0x915de2);};}exports[_0xd23c('0x37')]=function(_0x5b628c,_0x34a9d3){var _0x561498={},_0x1d0f1d={},_0x4575b2={'count':0x0,'rows':[]};var _0x2c1e6c=_[_0xd23c('0x2d')](db[_0xd23c('0x38')][_0xd23c('0x39')],function(_0x357104){return{'name':_0x357104[_0xd23c('0x3a')],'type':_0x357104['type'][_0xd23c('0x3b')]};});_0x1d0f1d[_0xd23c('0x3c')]=_[_0xd23c('0x2d')](_0x2c1e6c,_0xd23c('0x31'));_0x1d0f1d[_0xd23c('0x3d')]=_['keys'](_0x5b628c['query']);_0x1d0f1d[_0xd23c('0x3e')]=_[_0xd23c('0x3f')](_0x1d0f1d[_0xd23c('0x3c')],_0x1d0f1d['query']);_0x561498[_0xd23c('0x40')]=_[_0xd23c('0x3f')](_0x1d0f1d[_0xd23c('0x3c')],qs[_0xd23c('0x41')](_0x5b628c[_0xd23c('0x3d')][_0xd23c('0x41')]));_0x561498['attributes']=_0x561498[_0xd23c('0x40')][_0xd23c('0x42')]?_0x561498[_0xd23c('0x40')]:_0x1d0f1d[_0xd23c('0x3c')];if(!_0x5b628c[_0xd23c('0x3d')]['hasOwnProperty'](_0xd23c('0x43'))){_0x561498[_0xd23c('0x21')]=qs[_0xd23c('0x21')](_0x5b628c[_0xd23c('0x3d')][_0xd23c('0x21')]);_0x561498[_0xd23c('0x20')]=qs[_0xd23c('0x20')](_0x5b628c[_0xd23c('0x3d')][_0xd23c('0x20')]);}_0x561498['order']=qs[_0xd23c('0x44')](_0x5b628c[_0xd23c('0x3d')][_0xd23c('0x44')]);_0x561498[_0xd23c('0x45')]=qs[_0xd23c('0x3e')](_[_0xd23c('0x46')](_0x5b628c['query'],_0x1d0f1d['filters']));if(_0x5b628c[_0xd23c('0x3d')][_0xd23c('0x47')]){_0x561498['where']=_[_0xd23c('0x48')](_0x561498[_0xd23c('0x45')],{'$or':_[_0xd23c('0x2d')](_0x2c1e6c,function(_0x2ef326){if(_0x2ef326[_0xd23c('0x30')]!==_0xd23c('0x49')){var _0x545dd2={};_0x545dd2[_0x2ef326[_0xd23c('0x31')]]={'$like':'%'+_0x5b628c[_0xd23c('0x3d')][_0xd23c('0x47')]+'%'};return _0x545dd2;}})});}_0x561498=_[_0xd23c('0x48')]({},_0x561498,_0x5b628c['options']);var _0x3f82de={'where':_0x561498[_0xd23c('0x45')]};return db[_0xd23c('0x38')][_0xd23c('0x1f')](_0x3f82de)['then'](function(_0x21addd){_0x4575b2[_0xd23c('0x1f')]=_0x21addd;if(_0x5b628c['query'][_0xd23c('0x4a')]){_0x561498[_0xd23c('0x4b')]=[{'all':!![]}];}return db[_0xd23c('0x38')]['findAll'](_0x561498);})['then'](function(_0x18c946){_0x4575b2['rows']=_0x18c946;return _0x4575b2;})[_0xd23c('0x27')](respondWithFilteredResult(_0x34a9d3,_0x561498))[_0xd23c('0x4c')](handleError(_0x34a9d3,null));};exports['show']=function(_0x2512a3,_0x1a5bdd){var _0x3f4e05={'raw':![],'where':{'id':_0x2512a3[_0xd23c('0x4d')]['id']}},_0x162322={};_0x162322[_0xd23c('0x3c')]=_[_0xd23c('0x4e')](db[_0xd23c('0x38')]['rawAttributes']);_0x162322[_0xd23c('0x3d')]=_['keys'](_0x2512a3[_0xd23c('0x3d')]);_0x162322[_0xd23c('0x3e')]=_[_0xd23c('0x3f')](_0x162322['model'],_0x162322['query']);_0x3f4e05[_0xd23c('0x40')]=_[_0xd23c('0x3f')](_0x162322[_0xd23c('0x3c')],qs[_0xd23c('0x41')](_0x2512a3['query'][_0xd23c('0x41')]));_0x3f4e05[_0xd23c('0x40')]=_0x3f4e05['attributes']['length']?_0x3f4e05[_0xd23c('0x40')]:_0x162322['model'];if(_0x2512a3[_0xd23c('0x3d')][_0xd23c('0x4a')]){_0x3f4e05['include']=[{'all':!![]}];}_0x3f4e05=_[_0xd23c('0x48')]({},_0x3f4e05,_0x2512a3[_0xd23c('0x4f')]);return db[_0xd23c('0x38')][_0xd23c('0x50')](_0x3f4e05)[_0xd23c('0x27')](handleEntityNotFound(_0x1a5bdd,null))['then'](respondWithResult(_0x1a5bdd,null))[_0xd23c('0x4c')](handleError(_0x1a5bdd,null));};exports[_0xd23c('0x33')]=function(_0x46316d,_0x22cbb7){return db['VoiceExtension'][_0xd23c('0x50')]({'where':{'id':_0x46316d[_0xd23c('0x4d')]['id']}})[_0xd23c('0x27')](handleEntityNotFound(_0x22cbb7,null))[_0xd23c('0x27')](removeEntity(_0x22cbb7,null))[_0xd23c('0x4c')](handleError(_0x22cbb7,null));};exports[_0xd23c('0x51')]=function(_0x3fb56a,_0x53c147){if(_0x3fb56a[_0xd23c('0x52')][_0xd23c('0x30')]===_0xd23c('0x2a')&&!_[_0xd23c('0x53')](_0x3fb56a[_0xd23c('0x52')]['exten'],'_')){_0x3fb56a['body'][_0xd23c('0x54')]='_'['concat'](_0x3fb56a['body'][_0xd23c('0x54')]);}return db[_0xd23c('0x38')][_0xd23c('0x51')](_0x3fb56a[_0xd23c('0x52')],{'raw':![]})[_0xd23c('0x27')](function(_0x4a7504){var _0x3b064e=_0x3fb56a['user']['get']({'plain':!![]});if(!_0x3b064e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b064e[_0xd23c('0x55')]===_0xd23c('0x56')){var _0x27e2cf=_0x4a7504[_0xd23c('0x28')]({'plain':!![]});var _0x3179bb=[{'name':_0xd23c('0x57'),'value':_0xd23c('0x29')},{'name':_0xd23c('0x58'),'value':_0xd23c('0x2a')},{'name':_0xd23c('0x2b'),'value':'internal'}];var _0x21c8e4=_[_0xd23c('0x50')](_0x3179bb,[_0xd23c('0x2e'),_0x27e2cf[_0xd23c('0x30')]])[_0xd23c('0x31')];return db['UserProfileSection']['find']({'where':{'name':_0x21c8e4,'userProfileId':_0x3b064e[_0xd23c('0x59')]},'raw':!![]})[_0xd23c('0x27')](function(_0x4d18af){if(_0x4d18af&&_0x4d18af[_0xd23c('0x5a')]===0x0){return db[_0xd23c('0x32')][_0xd23c('0x51')]({'name':_0x27e2cf[_0xd23c('0x31')],'resourceId':_0x27e2cf['id'],'type':_0x4d18af[_0xd23c('0x31')],'sectionId':_0x4d18af['id']},{})[_0xd23c('0x27')](function(){return _0x4a7504;});}else{return _0x4a7504;}})[_0xd23c('0x4c')](function(_0x5e057c){logger[_0xd23c('0x34')](_0xd23c('0x5b'),_0x5e057c);throw _0x5e057c;});}return _0x4a7504;})[_0xd23c('0x27')](respondWithResult(_0x53c147,0xc9))[_0xd23c('0x4c')](handleError(_0x53c147,null));};exports['update']=function(_0x2893dd,_0x3ae14a){if(_0x2893dd['body']['id']){delete _0x2893dd['body']['id'];}return db[_0xd23c('0x38')]['find']({'where':{'id':_0x2893dd[_0xd23c('0x4d')]['id']}})[_0xd23c('0x27')](handleEntityNotFound(_0x3ae14a,null))[_0xd23c('0x27')](function(_0x30c521){if(_0x30c521){return db[_0xd23c('0x38')]['update'](_['pick'](_0x2893dd[_0xd23c('0x52')],[_0xd23c('0x54'),_0xd23c('0x5c'),_0xd23c('0x5d'),'recordingFormat',_0xd23c('0x5e'),_0xd23c('0x5f')]),{'where':{'context':_0x30c521['context'],'exten':_0x30c521['exten']},'individualHooks':!![]})[_0xd23c('0x27')](function(_0x34bfd2){return _0x34bfd2;});}return null;})[_0xd23c('0x27')](respondWithStatusCode(_0x3ae14a,null))[_0xd23c('0x4c')](handleError(_0x3ae14a,null));};exports[_0xd23c('0x60')]=function(_0xee5356,_0x22d857,_0x528970){return db[_0xd23c('0x38')][_0xd23c('0x61')]({'where':{'id':_0xee5356[_0xd23c('0x4d')]['id']}})[_0xd23c('0x27')](handleEntityNotFound(_0x22d857,null))[_0xd23c('0x27')](function(_0x250c17){if(_0x250c17){return db[_0xd23c('0x62')][_0xd23c('0x63')](function(_0x51c118){return db[_0xd23c('0x38')][_0xd23c('0x33')]({'where':{'VoiceExtensionId':_0xee5356[_0xd23c('0x4d')]['id']},'transaction':_0x51c118})[_0xd23c('0x27')](function(_0x380bf2){var _0x25d6ce=_[_0xd23c('0x2d')](_0xee5356[_0xd23c('0x52')],function(_0x463110){_0x463110[_0xd23c('0x64')]=_0xee5356[_0xd23c('0x4d')]['id'];return _0x463110;});return db['VoiceExtension'][_0xd23c('0x65')](_0x25d6ce,{'transaction':_0x51c118});});})[_0xd23c('0x27')](function(){return db['VoiceExtension'][_0xd23c('0x66')]({'where':{'isApp':!![],'VoiceExtensionId':_0xee5356['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xd23c('0x27')](respondWithResult(_0x22d857,null))['catch'](handleError(_0x22d857,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 4e09bc7..6150ce2 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 _0xcbff=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x144527,_0x4fbbab){var _0x20eace=function(_0x2c6f25){while(--_0x2c6f25){_0x144527['push'](_0x144527['shift']());}};_0x20eace(++_0x4fbbab);}(_0xcbff,0x188));var _0xfcbf=function(_0x4d22af,_0x2da329){_0x4d22af=_0x4d22af-0x0;var _0x1aa3f4=_0xcbff[_0x4d22af];return _0x1aa3f4;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xfcbf('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xfcbf('0x1')](0x0);var events={'afterCreate':_0xfcbf('0x2'),'afterUpdate':_0xfcbf('0x3'),'afterDestroy':_0xfcbf('0x4')};function emitEvent(_0x4c16e5){return function(_0x441bf0,_0x34a7b5,_0x37dcdc){VoiceExtensionEvents['emit'](_0x4c16e5+':'+_0x441bf0['id'],_0x441bf0);VoiceExtensionEvents[_0xfcbf('0x5')](_0x4c16e5,_0x441bf0);_0x37dcdc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xfcbf('0x6')](e,emitEvent(event));}}module[_0xfcbf('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x38c1=['../../mysqldb','VoiceExtension','setMaxListeners','save','emit','hook','exports','events'];(function(_0x1b1a3b,_0x52a88a){var _0x385347=function(_0x4ca60a){while(--_0x4ca60a){_0x1b1a3b['push'](_0x1b1a3b['shift']());}};_0x385347(++_0x52a88a);}(_0x38c1,0x7f));var _0x138c=function(_0x5cc30e,_0x2646b6){_0x5cc30e=_0x5cc30e-0x0;var _0x208c6d=_0x38c1[_0x5cc30e];return _0x208c6d;};'use strict';var EventEmitter=require(_0x138c('0x0'));var VoiceExtension=require(_0x138c('0x1'))['db'][_0x138c('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x138c('0x3')](0x0);var events={'afterCreate':_0x138c('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x38788a){return function(_0xc83009,_0x1ca394,_0x23f0f8){VoiceExtensionEvents[_0x138c('0x5')](_0x38788a+':'+_0xc83009['id'],_0xc83009);VoiceExtensionEvents[_0x138c('0x5')](_0x38788a,_0xc83009);_0x23f0f8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x138c('0x6')](e,emitEvent(event));}}module[_0x138c('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index c03ae6e..caf4fbd 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 _0x5512=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','VoiceExtension','voice_extensions','lodash'];(function(_0x45b835,_0x202e2f){var _0x1734e2=function(_0x3edbf7){while(--_0x3edbf7){_0x45b835['push'](_0x45b835['shift']());}};_0x1734e2(++_0x202e2f);}(_0x5512,0xb5));var _0x2551=function(_0x231c40,_0x323163){_0x231c40=_0x231c40-0x0;var _0x3ef92d=_0x5512[_0x231c40];return _0x3ef92d;};'use strict';var _=require(_0x2551('0x0'));var util=require(_0x2551('0x1'));var logger=require('../../config/logger')(_0x2551('0x2'));var moment=require(_0x2551('0x3'));var BPromise=require(_0x2551('0x4'));var rp=require(_0x2551('0x5'));var fs=require('fs');var path=require(_0x2551('0x6'));var rimraf=require(_0x2551('0x7'));var config=require(_0x2551('0x8'));var attributes=require(_0x2551('0x9'));module[_0x2551('0xa')]=function(_0x1d3fea,_0x2b1f08){return _0x1d3fea['define'](_0x2551('0xb'),attributes,{'tableName':_0x2551('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x531a=['./voiceExtension.attributes','exports','define','VoiceExtension','lodash','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x1a80da,_0x1b532b){var _0x1c1df0=function(_0x21476f){while(--_0x21476f){_0x1a80da['push'](_0x1a80da['shift']());}};_0x1c1df0(++_0x1b532b);}(_0x531a,0x1b2));var _0xa531=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x531a[_0x56fe98];return _0x212f4f;};'use strict';var _=require(_0xa531('0x0'));var util=require('util');var logger=require(_0xa531('0x1'))(_0xa531('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa531('0x3'));var fs=require('fs');var path=require(_0xa531('0x4'));var rimraf=require('rimraf');var config=require(_0xa531('0x5'));var attributes=require(_0xa531('0x6'));module[_0xa531('0x7')]=function(_0x9413f5,_0x3598fe){return _0x9413f5[_0xa531('0x8')](_0xa531('0x9'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index fd05f9d..b977021 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 _0xaf80=['redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x2bff34,_0x496c64){var _0x5e0cfa=function(_0x8efb34){while(--_0x8efb34){_0x2bff34['push'](_0x2bff34['shift']());}};_0x5e0cfa(++_0x496c64);}(_0xaf80,0xbd));var _0x0af8=function(_0xa798df,_0x43e75d){_0xa798df=_0xa798df-0x0;var _0x51e638=_0xaf80[_0xa798df];return _0x51e638;};'use strict';var _=require(_0x0af8('0x0'));var util=require(_0x0af8('0x1'));var moment=require(_0x0af8('0x2'));var BPromise=require(_0x0af8('0x3'));var rs=require(_0x0af8('0x4'));var fs=require('fs');var Redis=require(_0x0af8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0af8('0x6'));var logger=require('../../config/logger')(_0x0af8('0x7'));var config=require(_0x0af8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0af8('0x9')][_0x0af8('0xa')]({'port':0x232a});config[_0x0af8('0xb')]=_[_0x0af8('0xc')](config[_0x0af8('0xb')],{'host':_0x0af8('0xd'),'port':0x18eb});var socket=require(_0x0af8('0xe'))(new Redis(config[_0x0af8('0xb')]));require(_0x0af8('0xf'))[_0x0af8('0x10')](socket);function respondWithRpcPromise(_0x2bafb9,_0x182d75,_0x235c45){return new BPromise(function(_0x4e0cbc,_0x175cc3){return client[_0x0af8('0x11')](_0x2bafb9,_0x235c45)[_0x0af8('0x12')](function(_0x58cbbd){logger[_0x0af8('0x13')](_0x0af8('0x14'),_0x182d75,_0x0af8('0x15'));logger[_0x0af8('0x16')](_0x0af8('0x17'),_0x182d75,'request\x20sent',JSON[_0x0af8('0x18')](_0x58cbbd));if(_0x58cbbd[_0x0af8('0x19')]){if(_0x58cbbd['error'][_0x0af8('0x1a')]===0x1f4){logger[_0x0af8('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x182d75,_0x58cbbd['error'][_0x0af8('0x1b')]);return _0x175cc3(_0x58cbbd[_0x0af8('0x19')][_0x0af8('0x1b')]);}logger[_0x0af8('0x19')](_0x0af8('0x14'),_0x182d75,_0x58cbbd[_0x0af8('0x19')]['message']);return _0x4e0cbc(_0x58cbbd[_0x0af8('0x19')][_0x0af8('0x1b')]);}else{logger[_0x0af8('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x182d75,_0x0af8('0x15'));_0x4e0cbc(_0x58cbbd['result']['message']);}})[_0x0af8('0x1c')](function(_0x27b318){logger['error'](_0x0af8('0x14'),_0x182d75,_0x27b318);_0x175cc3(_0x27b318);});});}exports[_0x0af8('0x1d')]=function(_0x790155){var _0x49a607=this;return new Promise(function(_0x32b65d,_0x285ef9){return db[_0x0af8('0x1e')][_0x0af8('0x1f')]({'raw':_0x790155[_0x0af8('0x20')]?_0x790155['options'][_0x0af8('0x21')]===undefined?!![]:![]:!![],'where':_0x790155[_0x0af8('0x20')]?_0x790155[_0x0af8('0x20')][_0x0af8('0x22')]||null:null,'attributes':_0x790155[_0x0af8('0x20')]?_0x790155[_0x0af8('0x20')][_0x0af8('0x23')]||null:null,'limit':_0x790155[_0x0af8('0x20')]?_0x790155[_0x0af8('0x20')][_0x0af8('0x24')]||null:null,'include':_0x790155[_0x0af8('0x20')]?_0x790155[_0x0af8('0x20')][_0x0af8('0x25')]?_[_0x0af8('0x26')](_0x790155[_0x0af8('0x20')][_0x0af8('0x25')],function(_0x46f87b){return{'model':db[_0x46f87b[_0x0af8('0x27')]],'as':_0x46f87b['as'],'attributes':_0x46f87b[_0x0af8('0x23')],'include':_0x46f87b[_0x0af8('0x25')]?_[_0x0af8('0x26')](_0x46f87b[_0x0af8('0x25')],function(_0x26161a){return{'model':db[_0x26161a[_0x0af8('0x27')]],'as':_0x26161a['as'],'attributes':_0x26161a['attributes'],'include':_0x26161a['include']?_[_0x0af8('0x26')](_0x26161a['include'],function(_0x2582f7){return{'model':db[_0x2582f7[_0x0af8('0x27')]],'as':_0x2582f7['as'],'attributes':_0x2582f7[_0x0af8('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0af8('0x12')](function(_0xc7a218){logger[_0x0af8('0x13')](_0x0af8('0x1d'),_0x790155);logger[_0x0af8('0x16')]('GetVoiceExtension',_0x790155,JSON[_0x0af8('0x18')](_0xc7a218));_0x32b65d(_0xc7a218);})[_0x0af8('0x1c')](function(_0x182c8e){logger['error'](_0x0af8('0x1d'),_0x182c8e[_0x0af8('0x1b')],_0x790155);_0x285ef9(_0x49a607[_0x0af8('0x19')](0x1f4,_0x182c8e['message']));});});}; \ No newline at end of file +var _0x943a=['VoiceExtension,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0x943a,0x109));var _0xa943=function(_0xc27d6,_0x5dd679){_0xc27d6=_0xc27d6-0x0;var _0x692658=_0x943a[_0xc27d6];return _0x692658;};'use strict';var _=require(_0xa943('0x0'));var util=require('util');var moment=require(_0xa943('0x1'));var BPromise=require('bluebird');var rs=require(_0xa943('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa943('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa943('0x4'));var config=require(_0xa943('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa943('0x6')][_0xa943('0x7')]({'port':0x232a});config[_0xa943('0x8')]=_[_0xa943('0x9')](config[_0xa943('0x8')],{'host':_0xa943('0xa'),'port':0x18eb});var socket=require(_0xa943('0xb'))(new Redis(config[_0xa943('0x8')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x29bb2f,_0x5c7ac0,_0x2828c0){return new BPromise(function(_0x31fcfe,_0x524e20){return client[_0xa943('0xc')](_0x29bb2f,_0x2828c0)[_0xa943('0xd')](function(_0x2930ec){logger[_0xa943('0xe')](_0xa943('0xf'),_0x5c7ac0,'request\x20sent');logger[_0xa943('0x10')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x5c7ac0,_0xa943('0x11'),JSON[_0xa943('0x12')](_0x2930ec));if(_0x2930ec['error']){if(_0x2930ec[_0xa943('0x13')][_0xa943('0x14')]===0x1f4){logger[_0xa943('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x5c7ac0,_0x2930ec[_0xa943('0x13')]['message']);return _0x524e20(_0x2930ec[_0xa943('0x13')][_0xa943('0x15')]);}logger[_0xa943('0x13')](_0xa943('0xf'),_0x5c7ac0,_0x2930ec[_0xa943('0x13')][_0xa943('0x15')]);return _0x31fcfe(_0x2930ec[_0xa943('0x13')][_0xa943('0x15')]);}else{logger[_0xa943('0xe')]('VoiceExtension,\x20%s,\x20%s',_0x5c7ac0,_0xa943('0x11'));_0x31fcfe(_0x2930ec[_0xa943('0x16')]['message']);}})[_0xa943('0x17')](function(_0x3059cc){logger[_0xa943('0x13')](_0xa943('0xf'),_0x5c7ac0,_0x3059cc);_0x524e20(_0x3059cc);});});}exports[_0xa943('0x18')]=function(_0x35b9df){var _0x211601=this;return new Promise(function(_0x3f4c35,_0x33915e){return db[_0xa943('0x19')][_0xa943('0x1a')]({'raw':_0x35b9df[_0xa943('0x1b')]?_0x35b9df[_0xa943('0x1b')][_0xa943('0x1c')]===undefined?!![]:![]:!![],'where':_0x35b9df[_0xa943('0x1b')]?_0x35b9df[_0xa943('0x1b')][_0xa943('0x1d')]||null:null,'attributes':_0x35b9df[_0xa943('0x1b')]?_0x35b9df[_0xa943('0x1b')][_0xa943('0x1e')]||null:null,'limit':_0x35b9df[_0xa943('0x1b')]?_0x35b9df['options'][_0xa943('0x1f')]||null:null,'include':_0x35b9df['options']?_0x35b9df['options'][_0xa943('0x20')]?_[_0xa943('0x21')](_0x35b9df[_0xa943('0x1b')][_0xa943('0x20')],function(_0x2e73f7){return{'model':db[_0x2e73f7[_0xa943('0x22')]],'as':_0x2e73f7['as'],'attributes':_0x2e73f7[_0xa943('0x1e')],'include':_0x2e73f7[_0xa943('0x20')]?_[_0xa943('0x21')](_0x2e73f7[_0xa943('0x20')],function(_0x7505a4){return{'model':db[_0x7505a4['model']],'as':_0x7505a4['as'],'attributes':_0x7505a4[_0xa943('0x1e')],'include':_0x7505a4['include']?_[_0xa943('0x21')](_0x7505a4[_0xa943('0x20')],function(_0x3207f1){return{'model':db[_0x3207f1[_0xa943('0x22')]],'as':_0x3207f1['as'],'attributes':_0x3207f1['attributes']};}):[]};}):[]};}):[]:[]})[_0xa943('0xd')](function(_0x70f8fb){logger[_0xa943('0xe')]('GetVoiceExtension',_0x35b9df);logger[_0xa943('0x10')](_0xa943('0x18'),_0x35b9df,JSON[_0xa943('0x12')](_0x70f8fb));_0x3f4c35(_0x70f8fb);})[_0xa943('0x17')](function(_0x1f896b){logger[_0xa943('0x13')](_0xa943('0x18'),_0x1f896b[_0xa943('0x15')],_0x35b9df);_0x33915e(_0x211601[_0xa943('0x13')](0x1f4,_0x1f896b[_0xa943('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 4bf8124..9efd5eb 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 _0x4dcc=['emit','removeListener','register','length','voiceExtension:','save','update'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4dcc,0x1a2));var _0xc4dc=function(_0x56e32e,_0x9eb2f6){_0x56e32e=_0x56e32e-0x0;var _0x2a757b=_0x4dcc[_0x56e32e];return _0x2a757b;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0xc4dc('0x0'),'remove',_0xc4dc('0x1')];function createListener(_0x170ce3,_0x3a092a){return function(_0x185b17){_0x3a092a[_0xc4dc('0x2')](_0x170ce3,_0x185b17);};}function removeListener(_0xb55f9b,_0x1e7241){return function(){VoiceExtensionEvents[_0xc4dc('0x3')](_0xb55f9b,_0x1e7241);};}exports[_0xc4dc('0x4')]=function(_0xe3bb7e){for(var _0x3f3fba=0x0,_0x5928be=events[_0xc4dc('0x5')];_0x3f3fba<_0x5928be;_0x3f3fba++){var _0x3d7c3d=events[_0x3f3fba];var _0x4e27e6=createListener(_0xc4dc('0x6')+_0x3d7c3d,_0xe3bb7e);VoiceExtensionEvents['on'](_0x3d7c3d,_0x4e27e6);}}; \ No newline at end of file +var _0x48f5=['length','voiceExtension:','./voiceExtension.events','save','remove','update','removeListener'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0x48f5,0x12f));var _0x548f=function(_0x262866,_0xd3896d){_0x262866=_0x262866-0x0;var _0x2e7114=_0x48f5[_0x262866];return _0x2e7114;};'use strict';var VoiceExtensionEvents=require(_0x548f('0x0'));var events=[_0x548f('0x1'),_0x548f('0x2'),_0x548f('0x3')];function createListener(_0x21578b,_0x2b966d){return function(_0x6d2be1){_0x2b966d['emit'](_0x21578b,_0x6d2be1);};}function removeListener(_0x190d96,_0x3f694a){return function(){VoiceExtensionEvents[_0x548f('0x4')](_0x190d96,_0x3f694a);};}exports['register']=function(_0x40913c){for(var _0x5265d4=0x0,_0xbcc28b=events[_0x548f('0x5')];_0x5265d4<_0xbcc28b;_0x5265d4++){var _0x3dd362=events[_0x5265d4];var _0x56f67f=createListener(_0x548f('0x6')+_0x3dd362,_0x40913c);VoiceExtensionEvents['on'](_0x3dd362,_0x56f67f);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 2c1a59b..9335e91 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 _0xf78a=['delete','/:id','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','getMessages','post','update'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xf78a,0x7b));var _0xaf78=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0xf78a[_0x5a636f];return _0x6a8cfb;};'use strict';var multer=require(_0xaf78('0x0'));var util=require(_0xaf78('0x1'));var path=require('path');var timeout=require(_0xaf78('0x2'));var express=require(_0xaf78('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xaf78('0x4'));var config=require(_0xaf78('0x5'));var controller=require(_0xaf78('0x6'));router[_0xaf78('0x7')]('/',auth[_0xaf78('0x8')](),controller[_0xaf78('0x9')]);router[_0xaf78('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xaf78('0xa')]);router[_0xaf78('0xb')]('/',auth[_0xaf78('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaf78('0xc')]);router[_0xaf78('0xd')](_0xaf78('0xe'),auth[_0xaf78('0x8')](),controller[_0xaf78('0xf')]);module[_0xaf78('0x10')]=router; \ No newline at end of file +var _0x740c=['../../config/environment','index','get','/:id','isAuthenticated','/:id/messages','post','put','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4c9d00,_0x5092d5){var _0x4a73f5=function(_0xc0bfc7){while(--_0xc0bfc7){_0x4c9d00['push'](_0x4c9d00['shift']());}};_0x4a73f5(++_0x5092d5);}(_0x740c,0xda));var _0xc740=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x740c[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc740('0x0'));var util=require('util');var path=require(_0xc740('0x1'));var timeout=require(_0xc740('0x2'));var express=require(_0xc740('0x3'));var router=express[_0xc740('0x4')]();var auth=require(_0xc740('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc740('0x6'));var controller=require('./voiceMail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc740('0x7')]);router[_0xc740('0x8')](_0xc740('0x9'),auth[_0xc740('0xa')](),controller['show']);router[_0xc740('0x8')](_0xc740('0xb'),auth[_0xc740('0xa')](),controller['getMessages']);router[_0xc740('0xc')]('/',auth[_0xc740('0xa')](),controller['create']);router[_0xc740('0xd')](_0xc740('0x9'),auth[_0xc740('0xa')](),controller[_0xc740('0xe')]);router[_0xc740('0xf')](_0xc740('0x9'),auth[_0xc740('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 1e2abcb..5ada7fa 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 _0xd8b0=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports','contest_mailbox','STRING','setDataValue','email','string'];(function(_0x29cfcb,_0x5cce76){var _0x1b1abf=function(_0x1b58f3){while(--_0x1b58f3){_0x29cfcb['push'](_0x29cfcb['shift']());}};_0x1b1abf(++_0x5cce76);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0x0d8b('0x2')},'mailbox':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':'','allowNull':![],'unique':_0x0d8b('0x2')},'password':{'type':Sequelize[_0x0d8b('0x3')]},'fullname':{'type':Sequelize[_0x0d8b('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x5e15e6){this[_0x0d8b('0x4')](_0x0d8b('0x5'),typeof _0x5e15e6===_0x0d8b('0x6')&&_0x5e15e6['trim']()?_0x5e15e6[_0x0d8b('0x7')]():null);}},'pager':{'type':Sequelize[_0x0d8b('0x3')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0x8')},'attach':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':_0x0d8b('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':_0x0d8b('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0d8b('0x3')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x0d8b('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0d8b('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':_0x0d8b('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x0d8b('0xc')},'emailsubject':{'type':Sequelize[_0x0d8b('0x3')]},'emailbody':{'type':Sequelize[_0x0d8b('0x3')]},'maxsecs':{'type':Sequelize[_0x0d8b('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0d8b('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0d8b('0xe')],'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x10'))+'\x20-\x20'+this[_0x0d8b('0xf')](_0x0d8b('0x11'));}}}; \ No newline at end of file +var _0xed3c=['INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','yes','ENUM','TINYINT(4)','TIMESTAMP'];(function(_0x3ec981,_0x39c978){var _0x31522f=function(_0x1e402a){while(--_0x1e402a){_0x3ec981['push'](_0x3ec981['shift']());}};_0x31522f(++_0x39c978);}(_0xed3c,0x1a6));var _0xced3=function(_0x402eff,_0x2525f2){_0x402eff=_0x402eff-0x0;var _0x2eb371=_0xed3c[_0x402eff];return _0x2eb371;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'customer_id':{'type':Sequelize[_0xced3('0x2')]},'context':{'type':Sequelize[_0xced3('0x2')],'defaultValue':'from-voicemail','unique':_0xced3('0x3')},'mailbox':{'type':Sequelize[_0xced3('0x2')],'defaultValue':'','allowNull':![],'unique':_0xced3('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xced3('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1ada18){this[_0xced3('0x4')](_0xced3('0x5'),typeof _0x1ada18==='string'&&_0x1ada18['trim']()?_0x1ada18['trim']():null);}},'pager':{'type':Sequelize[_0xced3('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0xced3('0x6'),'no'),'defaultValue':_0xced3('0x6'),'allowNull':![]},'saycid':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':_0xced3('0x6'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xced3('0x2')]},'review':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xced3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xced3('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xced3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xced3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':_0xced3('0x6'),'allowNull':![]},'forcename':{'type':Sequelize[_0xced3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xced3('0x6'),'no'),'defaultValue':_0xced3('0x6'),'allowNull':![]},'stamp':{'type':_0xced3('0x9')},'emailsubject':{'type':Sequelize[_0xced3('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xced3('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xced3('0xb')],'get':function(){return this[_0xced3('0xc')](_0xced3('0xd'))+_0xced3('0xe')+this[_0xced3('0xc')](_0xced3('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 1f22586..60b9dfa 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 _0xd93b=['rawAttributes','key','query','filters','model','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','name','options','VoiceMail','include','findAll','rows','params','keys','intersection','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','VoiceMailMessage','length','nolimit','order','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','get','Voicemails','error','index','map'];(function(_0x4938ae,_0xa6036a){var _0xc070e8=function(_0x1fe630){while(--_0x1fe630){_0x4938ae['push'](_0x4938ae['shift']());}};_0xc070e8(++_0xa6036a);}(_0xd93b,0x11e));var _0xbd93=function(_0x4034ba,_0x56d675){_0x4034ba=_0x4034ba-0x0;var _0x435241=_0xd93b[_0x4034ba];return _0x435241;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbd93('0x0'));var zipdir=require(_0xbd93('0x1'));var jsonpatch=require(_0xbd93('0x2'));var rp=require(_0xbd93('0x3'));var moment=require('moment');var BPromise=require(_0xbd93('0x4'));var Mustache=require(_0xbd93('0x5'));var util=require('util');var path=require(_0xbd93('0x6'));var sox=require(_0xbd93('0x7'));var csv=require(_0xbd93('0x8'));var ejs=require(_0xbd93('0x9'));var fs=require('fs');var _=require(_0xbd93('0xa'));var squel=require(_0xbd93('0xb'));var crypto=require(_0xbd93('0xc'));var jsforce=require(_0xbd93('0xd'));var deskjs=require(_0xbd93('0xe'));var toCsv=require(_0xbd93('0x8'));var querystring=require('querystring');var Papa=require(_0xbd93('0xf'));var Redis=require(_0xbd93('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbd93('0x11'));var as=require(_0xbd93('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd93('0x13'))(_0xbd93('0x14'));var utils=require(_0xbd93('0x15'));var config=require(_0xbd93('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ab0bc,_0x4a574c){_0x4a574c=_0x4a574c||0xcc;return function(_0x1687f5){if(_0x1687f5){return _0x1ab0bc[_0xbd93('0x17')](_0x4a574c);}return _0x1ab0bc[_0xbd93('0x18')](_0x4a574c)[_0xbd93('0x19')]();};}function respondWithResult(_0x1d3db1,_0x46cb69){_0x46cb69=_0x46cb69||0xc8;return function(_0x5eb277){if(_0x5eb277){return _0x1d3db1[_0xbd93('0x18')](_0x46cb69)[_0xbd93('0x1a')](_0x5eb277);}};}function respondWithFilteredResult(_0x3adb32,_0x5877a1){return function(_0x590b2b){if(_0x590b2b){var _0x40efa5=_0x590b2b[_0xbd93('0x1b')],_0xb9a4fa=_0x5877a1[_0xbd93('0x1c')],_0x19546f=_0x5877a1[_0xbd93('0x1c')]+_0x5877a1[_0xbd93('0x1d')],_0x33a464;if(_0x19546f>=_0x40efa5){_0x19546f=_0x40efa5;_0x33a464=0xc8;}else{_0x33a464=0xce;}_0x3adb32['status'](_0x33a464);return _0x3adb32[_0xbd93('0x1e')](_0xbd93('0x1f'),_0xb9a4fa+'-'+_0x19546f+'/'+_0x40efa5)[_0xbd93('0x1a')](_0x590b2b);}return null;};}function patchUpdates(_0xb6d99b){return function(_0x75543b){try{jsonpatch[_0xbd93('0x20')](_0x75543b,_0xb6d99b,!![]);}catch(_0x3b8919){return BPromise['reject'](_0x3b8919);}return _0x75543b[_0xbd93('0x21')]();};}function saveUpdates(_0x3ab5b2,_0x593536){return function(_0x3be1c4){if(_0x3be1c4){return _0x3be1c4[_0xbd93('0x22')](_0x3ab5b2)['then'](function(_0x2c9d9a){return _0x2c9d9a;});}return null;};}function removeEntity(_0x3a5fa6,_0x563f43){return function(_0x3a44b0){if(_0x3a44b0){return _0x3a44b0[_0xbd93('0x23')]()[_0xbd93('0x24')](function(){var _0x33cc8e=_0x3a44b0[_0xbd93('0x25')]({'plain':!![]});var _0x198cfa=_0xbd93('0x26');return db['UserProfileResource'][_0xbd93('0x23')]({'where':{'type':_0x198cfa,'resourceId':_0x33cc8e['id']}})[_0xbd93('0x24')](function(){return _0x3a44b0;});})[_0xbd93('0x24')](function(){_0x3a5fa6['status'](0xcc)[_0xbd93('0x19')]();});}};}function handleEntityNotFound(_0x1138be,_0x315557){return function(_0x1b71f9){if(!_0x1b71f9){_0x1138be['sendStatus'](0x194);}return _0x1b71f9;};}function handleError(_0xa120e9,_0x5b6824){_0x5b6824=_0x5b6824||0x1f4;return function(_0x28984a){logger[_0xbd93('0x27')](_0x28984a['stack']);if(_0x28984a['name']){delete _0x28984a['name'];}_0xa120e9[_0xbd93('0x18')](_0x5b6824)['send'](_0x28984a);};}exports[_0xbd93('0x28')]=function(_0x5715ba,_0x3fa3b4){var _0xed1369={},_0x293892={},_0x42a897={'count':0x0,'rows':[]};var _0x598250=_[_0xbd93('0x29')](db['VoiceMail'][_0xbd93('0x2a')],function(_0x554a72){return{'name':_0x554a72['fieldName'],'type':_0x554a72['type'][_0xbd93('0x2b')]};});_0x293892['model']=_[_0xbd93('0x29')](_0x598250,'name');_0x293892['query']=_['keys'](_0x5715ba[_0xbd93('0x2c')]);_0x293892[_0xbd93('0x2d')]=_['intersection'](_0x293892[_0xbd93('0x2e')],_0x293892[_0xbd93('0x2c')]);_0xed1369[_0xbd93('0x2f')]=_['intersection'](_0x293892[_0xbd93('0x2e')],qs['fields'](_0x5715ba[_0xbd93('0x2c')][_0xbd93('0x30')]));_0xed1369[_0xbd93('0x2f')]=_0xed1369['attributes']['length']?_0xed1369['attributes']:_0x293892[_0xbd93('0x2e')];if(!_0x5715ba[_0xbd93('0x2c')][_0xbd93('0x31')]('nolimit')){_0xed1369['limit']=qs['limit'](_0x5715ba[_0xbd93('0x2c')][_0xbd93('0x1d')]);_0xed1369[_0xbd93('0x1c')]=qs[_0xbd93('0x1c')](_0x5715ba[_0xbd93('0x2c')][_0xbd93('0x1c')]);}_0xed1369['order']=qs['sort'](_0x5715ba[_0xbd93('0x2c')][_0xbd93('0x32')]);_0xed1369[_0xbd93('0x33')]=qs['filters'](_['pick'](_0x5715ba[_0xbd93('0x2c')],_0x293892[_0xbd93('0x2d')]));if(_0x5715ba['query'][_0xbd93('0x34')]){_0xed1369[_0xbd93('0x33')]=_[_0xbd93('0x35')](_0xed1369['where'],{'$or':_['map'](_0x598250,function(_0x143c05){if(_0x143c05['type']!==_0xbd93('0x36')){var _0x544e48={};_0x544e48[_0x143c05[_0xbd93('0x37')]]={'$like':'%'+_0x5715ba['query'][_0xbd93('0x34')]+'%'};return _0x544e48;}})});}_0xed1369=_[_0xbd93('0x35')]({},_0xed1369,_0x5715ba[_0xbd93('0x38')]);var _0x442ad2={'where':_0xed1369[_0xbd93('0x33')]};return db[_0xbd93('0x39')][_0xbd93('0x1b')](_0x442ad2)[_0xbd93('0x24')](function(_0x434956){_0x42a897[_0xbd93('0x1b')]=_0x434956;if(_0x5715ba[_0xbd93('0x2c')]['includeAll']){_0xed1369[_0xbd93('0x3a')]=[{'all':!![]}];}return db[_0xbd93('0x39')][_0xbd93('0x3b')](_0xed1369);})[_0xbd93('0x24')](function(_0x3467b7){_0x42a897[_0xbd93('0x3c')]=_0x3467b7;return _0x42a897;})[_0xbd93('0x24')](respondWithFilteredResult(_0x3fa3b4,_0xed1369))['catch'](handleError(_0x3fa3b4,null));};exports['show']=function(_0x4de05c,_0x5804c0){var _0x50b60b={'raw':!![],'where':{'id':_0x4de05c[_0xbd93('0x3d')]['id']}},_0x16dd99={};_0x16dd99[_0xbd93('0x2e')]=_['keys'](db[_0xbd93('0x39')][_0xbd93('0x2a')]);_0x16dd99[_0xbd93('0x2c')]=_[_0xbd93('0x3e')](_0x4de05c[_0xbd93('0x2c')]);_0x16dd99[_0xbd93('0x2d')]=_[_0xbd93('0x3f')](_0x16dd99['model'],_0x16dd99[_0xbd93('0x2c')]);_0x50b60b[_0xbd93('0x2f')]=_[_0xbd93('0x3f')](_0x16dd99[_0xbd93('0x2e')],qs[_0xbd93('0x30')](_0x4de05c[_0xbd93('0x2c')]['fields']));_0x50b60b[_0xbd93('0x2f')]=_0x50b60b[_0xbd93('0x2f')]['length']?_0x50b60b[_0xbd93('0x2f')]:_0x16dd99[_0xbd93('0x2e')];if(_0x4de05c[_0xbd93('0x2c')][_0xbd93('0x40')]){_0x50b60b['include']=[{'all':!![]}];}_0x50b60b=_[_0xbd93('0x35')]({},_0x50b60b,_0x4de05c[_0xbd93('0x38')]);return db['VoiceMail'][_0xbd93('0x41')](_0x50b60b)['then'](handleEntityNotFound(_0x5804c0,null))[_0xbd93('0x24')](respondWithResult(_0x5804c0,null))[_0xbd93('0x42')](handleError(_0x5804c0,null));};exports['create']=function(_0x573ab6,_0x326ccb){return db['VoiceMail'][_0xbd93('0x43')](_0x573ab6['body'],{})[_0xbd93('0x24')](function(_0xd481c8){var _0x45b146=_0x573ab6[_0xbd93('0x44')][_0xbd93('0x25')]({'plain':!![]});if(!_0x45b146)throw new Error(_0xbd93('0x45'));if(_0x45b146[_0xbd93('0x46')]===_0xbd93('0x44')){var _0xd69039=_0xd481c8[_0xbd93('0x25')]({'plain':!![]});var _0x552d1c=_0xbd93('0x26');return db[_0xbd93('0x47')][_0xbd93('0x41')]({'where':{'name':_0x552d1c,'userProfileId':_0x45b146[_0xbd93('0x48')]},'raw':!![]})[_0xbd93('0x24')](function(_0x2f5592){if(_0x2f5592&&_0x2f5592['autoAssociation']===0x0){return db[_0xbd93('0x49')][_0xbd93('0x43')]({'name':_0xd69039['name'],'resourceId':_0xd69039['id'],'type':_0x2f5592[_0xbd93('0x37')],'sectionId':_0x2f5592['id']},{})[_0xbd93('0x24')](function(){return _0xd481c8;});}else{return _0xd481c8;}})[_0xbd93('0x42')](function(_0x47e530){logger['error'](_0xbd93('0x4a'),_0x47e530);throw _0x47e530;});}return _0xd481c8;})[_0xbd93('0x24')](respondWithResult(_0x326ccb,0xc9))[_0xbd93('0x42')](handleError(_0x326ccb,null));};exports[_0xbd93('0x22')]=function(_0x7a8c04,_0x2be6fa){if(_0x7a8c04[_0xbd93('0x4b')]['id']){delete _0x7a8c04[_0xbd93('0x4b')]['id'];}return db[_0xbd93('0x39')][_0xbd93('0x41')]({'where':{'id':_0x7a8c04[_0xbd93('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2be6fa,null))['then'](saveUpdates(_0x7a8c04[_0xbd93('0x4b')],null))['then'](respondWithResult(_0x2be6fa,null))[_0xbd93('0x42')](handleError(_0x2be6fa,null));};exports[_0xbd93('0x23')]=function(_0x51030c,_0x2e4f4a){return db[_0xbd93('0x39')][_0xbd93('0x41')]({'where':{'id':_0x51030c['params']['id']}})[_0xbd93('0x24')](handleEntityNotFound(_0x2e4f4a,null))[_0xbd93('0x24')](removeEntity(_0x2e4f4a,null))[_0xbd93('0x42')](handleError(_0x2e4f4a,null));};exports['getMessages']=function(_0x4e3195,_0x1ed5d0,_0x6229bb){return db['VoiceMail'][_0xbd93('0x4c')]({'where':{'id':_0x4e3195[_0xbd93('0x3d')]['id']}})[_0xbd93('0x24')](handleEntityNotFound(_0x1ed5d0,null))[_0xbd93('0x24')](function(_0xac21fc){var _0x40eac4;var _0x37e029={},_0x4f2ac5={};_0x4f2ac5['model']=_[_0xbd93('0x3e')](db[_0xbd93('0x4d')][_0xbd93('0x2a')]);_0x4f2ac5[_0xbd93('0x2c')]=_[_0xbd93('0x3e')](_0x4e3195[_0xbd93('0x2c')]);_0x4f2ac5[_0xbd93('0x2d')]=_[_0xbd93('0x3f')](_0x4f2ac5[_0xbd93('0x2e')],_0x4f2ac5['query']);_0x37e029[_0xbd93('0x2f')]=_[_0xbd93('0x3f')](_0x4f2ac5[_0xbd93('0x2e')],qs['fields'](_0x4e3195[_0xbd93('0x2c')][_0xbd93('0x30')]));_0x37e029[_0xbd93('0x2f')]=_0x37e029[_0xbd93('0x2f')][_0xbd93('0x4e')]?_0x37e029[_0xbd93('0x2f')]:_0x4f2ac5['model'];if(!_0x4e3195['query']['hasOwnProperty'](_0xbd93('0x4f'))){_0x37e029[_0xbd93('0x1d')]=qs[_0xbd93('0x1d')](_0x4e3195[_0xbd93('0x2c')][_0xbd93('0x1d')]);_0x37e029['offset']=qs['offset'](_0x4e3195[_0xbd93('0x2c')][_0xbd93('0x1c')]);}_0x37e029[_0xbd93('0x50')]=qs[_0xbd93('0x32')](_0x4e3195['query']['sort']);_0x37e029[_0xbd93('0x33')]=qs[_0xbd93('0x2d')](_['pick'](_0x4e3195[_0xbd93('0x2c')],_0x4f2ac5['filters']));if(_0x4e3195[_0xbd93('0x2c')]['filter']){_0x37e029['where']=_[_0xbd93('0x35')](_0x37e029[_0xbd93('0x33')],{'$or':_['map'](_0x37e029[_0xbd93('0x2f')],function(_0x5cf09f){var _0x5bbe28={};_0x5bbe28[_0x5cf09f]={'$like':'%'+_0x4e3195[_0xbd93('0x2c')][_0xbd93('0x34')]+'%'};return _0x5bbe28;})});}_0x37e029[_0xbd93('0x33')]=_[_0xbd93('0x35')](_0x37e029['where'],{'mailboxuser':_0xac21fc['mailbox']});_0x37e029=_[_0xbd93('0x35')]({},_0x37e029,_0x4e3195['options']);return db[_0xbd93('0x4d')][_0xbd93('0x51')](_0x37e029)['then'](respondWithFilteredResult(_0x1ed5d0,_0x37e029));})[_0xbd93('0x42')](handleError(_0x1ed5d0,null));}; \ No newline at end of file +var _0xf2a9=['where','pick','filter','VIRTUAL','VoiceMail','include','findAll','rows','show','params','rawAttributes','merge','options','catch','create','body','user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','findOne','VoiceMailMessage','hasOwnProperty','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort'];(function(_0x1fddfd,_0x153a74){var _0x595b32=function(_0x2512d4){while(--_0x2512d4){_0x1fddfd['push'](_0x1fddfd['shift']());}};_0x595b32(++_0x153a74);}(_0xf2a9,0x77));var _0x9f2a=function(_0x270a0c,_0x1efc27){_0x270a0c=_0x270a0c-0x0;var _0x1cd130=_0xf2a9[_0x270a0c];return _0x1cd130;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9f2a('0x0'));var rimraf=require(_0x9f2a('0x1'));var zipdir=require(_0x9f2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f2a('0x3'));var moment=require(_0x9f2a('0x4'));var BPromise=require(_0x9f2a('0x5'));var Mustache=require(_0x9f2a('0x6'));var util=require(_0x9f2a('0x7'));var path=require('path');var sox=require(_0x9f2a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9f2a('0x9'));var squel=require('squel');var crypto=require(_0x9f2a('0xa'));var jsforce=require(_0x9f2a('0xb'));var deskjs=require(_0x9f2a('0xc'));var toCsv=require(_0x9f2a('0xd'));var querystring=require(_0x9f2a('0xe'));var Papa=require(_0x9f2a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9f2a('0x10'));var as=require(_0x9f2a('0x11'));var hardwareService=require(_0x9f2a('0x12'));var logger=require('../../config/logger')(_0x9f2a('0x13'));var utils=require(_0x9f2a('0x14'));var config=require(_0x9f2a('0x15'));var db=require(_0x9f2a('0x16'))['db'];function respondWithStatusCode(_0x32a207,_0x486314){_0x486314=_0x486314||0xcc;return function(_0x27e0bc){if(_0x27e0bc){return _0x32a207[_0x9f2a('0x17')](_0x486314);}return _0x32a207[_0x9f2a('0x18')](_0x486314)[_0x9f2a('0x19')]();};}function respondWithResult(_0x519c63,_0x4f001d){_0x4f001d=_0x4f001d||0xc8;return function(_0x5241f8){if(_0x5241f8){return _0x519c63[_0x9f2a('0x18')](_0x4f001d)[_0x9f2a('0x1a')](_0x5241f8);}};}function respondWithFilteredResult(_0x1b55d2,_0x240c7b){return function(_0x4d1813){if(_0x4d1813){var _0x1cd0c4=_0x4d1813[_0x9f2a('0x1b')],_0x3b0e4b=_0x240c7b[_0x9f2a('0x1c')],_0x3f7fc3=_0x240c7b[_0x9f2a('0x1c')]+_0x240c7b['limit'],_0x6d6bf9;if(_0x3f7fc3>=_0x1cd0c4){_0x3f7fc3=_0x1cd0c4;_0x6d6bf9=0xc8;}else{_0x6d6bf9=0xce;}_0x1b55d2[_0x9f2a('0x18')](_0x6d6bf9);return _0x1b55d2[_0x9f2a('0x1d')](_0x9f2a('0x1e'),_0x3b0e4b+'-'+_0x3f7fc3+'/'+_0x1cd0c4)[_0x9f2a('0x1a')](_0x4d1813);}return null;};}function patchUpdates(_0x5244d0){return function(_0x41a5a4){try{jsonpatch[_0x9f2a('0x1f')](_0x41a5a4,_0x5244d0,!![]);}catch(_0x1a2f7e){return BPromise[_0x9f2a('0x20')](_0x1a2f7e);}return _0x41a5a4[_0x9f2a('0x21')]();};}function saveUpdates(_0x1d891f,_0x111016){return function(_0x4bcf7e){if(_0x4bcf7e){return _0x4bcf7e['update'](_0x1d891f)[_0x9f2a('0x22')](function(_0x35c8d9){return _0x35c8d9;});}return null;};}function removeEntity(_0x377d8c,_0x5035ec){return function(_0x10cdd2){if(_0x10cdd2){return _0x10cdd2['destroy']()['then'](function(){var _0x47bc38=_0x10cdd2[_0x9f2a('0x23')]({'plain':!![]});var _0x56b638='Voicemails';return db[_0x9f2a('0x24')][_0x9f2a('0x25')]({'where':{'type':_0x56b638,'resourceId':_0x47bc38['id']}})[_0x9f2a('0x22')](function(){return _0x10cdd2;});})[_0x9f2a('0x22')](function(){_0x377d8c[_0x9f2a('0x18')](0xcc)[_0x9f2a('0x19')]();});}};}function handleEntityNotFound(_0x1d84fe,_0x5eddbd){return function(_0x38e107){if(!_0x38e107){_0x1d84fe['sendStatus'](0x194);}return _0x38e107;};}function handleError(_0x45f0ba,_0x51d8f8){_0x51d8f8=_0x51d8f8||0x1f4;return function(_0x3d9480){logger[_0x9f2a('0x26')](_0x3d9480[_0x9f2a('0x27')]);if(_0x3d9480[_0x9f2a('0x28')]){delete _0x3d9480[_0x9f2a('0x28')];}_0x45f0ba['status'](_0x51d8f8)[_0x9f2a('0x29')](_0x3d9480);};}exports[_0x9f2a('0x2a')]=function(_0x4bda1f,_0xc0a1b7){var _0x165bb3={},_0x2de7c5={},_0x22906a={'count':0x0,'rows':[]};var _0x1c17e2=_[_0x9f2a('0x2b')](db['VoiceMail']['rawAttributes'],function(_0x43a46d){return{'name':_0x43a46d[_0x9f2a('0x2c')],'type':_0x43a46d[_0x9f2a('0x2d')][_0x9f2a('0x2e')]};});_0x2de7c5[_0x9f2a('0x2f')]=_['map'](_0x1c17e2,_0x9f2a('0x28'));_0x2de7c5[_0x9f2a('0x30')]=_[_0x9f2a('0x31')](_0x4bda1f[_0x9f2a('0x30')]);_0x2de7c5[_0x9f2a('0x32')]=_[_0x9f2a('0x33')](_0x2de7c5['model'],_0x2de7c5[_0x9f2a('0x30')]);_0x165bb3[_0x9f2a('0x34')]=_[_0x9f2a('0x33')](_0x2de7c5[_0x9f2a('0x2f')],qs[_0x9f2a('0x35')](_0x4bda1f[_0x9f2a('0x30')][_0x9f2a('0x35')]));_0x165bb3[_0x9f2a('0x34')]=_0x165bb3[_0x9f2a('0x34')][_0x9f2a('0x36')]?_0x165bb3['attributes']:_0x2de7c5[_0x9f2a('0x2f')];if(!_0x4bda1f['query']['hasOwnProperty'](_0x9f2a('0x37'))){_0x165bb3[_0x9f2a('0x38')]=qs[_0x9f2a('0x38')](_0x4bda1f['query'][_0x9f2a('0x38')]);_0x165bb3[_0x9f2a('0x1c')]=qs[_0x9f2a('0x1c')](_0x4bda1f[_0x9f2a('0x30')]['offset']);}_0x165bb3[_0x9f2a('0x39')]=qs[_0x9f2a('0x3a')](_0x4bda1f['query'][_0x9f2a('0x3a')]);_0x165bb3[_0x9f2a('0x3b')]=qs['filters'](_[_0x9f2a('0x3c')](_0x4bda1f[_0x9f2a('0x30')],_0x2de7c5[_0x9f2a('0x32')]));if(_0x4bda1f[_0x9f2a('0x30')][_0x9f2a('0x3d')]){_0x165bb3['where']=_['merge'](_0x165bb3[_0x9f2a('0x3b')],{'$or':_[_0x9f2a('0x2b')](_0x1c17e2,function(_0x94ab1b){if(_0x94ab1b[_0x9f2a('0x2d')]!==_0x9f2a('0x3e')){var _0x296d7a={};_0x296d7a[_0x94ab1b[_0x9f2a('0x28')]]={'$like':'%'+_0x4bda1f[_0x9f2a('0x30')]['filter']+'%'};return _0x296d7a;}})});}_0x165bb3=_['merge']({},_0x165bb3,_0x4bda1f['options']);var _0x49178c={'where':_0x165bb3[_0x9f2a('0x3b')]};return db[_0x9f2a('0x3f')][_0x9f2a('0x1b')](_0x49178c)[_0x9f2a('0x22')](function(_0xa3603e){_0x22906a[_0x9f2a('0x1b')]=_0xa3603e;if(_0x4bda1f[_0x9f2a('0x30')]['includeAll']){_0x165bb3[_0x9f2a('0x40')]=[{'all':!![]}];}return db[_0x9f2a('0x3f')][_0x9f2a('0x41')](_0x165bb3);})[_0x9f2a('0x22')](function(_0x34efb5){_0x22906a[_0x9f2a('0x42')]=_0x34efb5;return _0x22906a;})[_0x9f2a('0x22')](respondWithFilteredResult(_0xc0a1b7,_0x165bb3))['catch'](handleError(_0xc0a1b7,null));};exports[_0x9f2a('0x43')]=function(_0x1e0670,_0x1addff){var _0x338d22={'raw':!![],'where':{'id':_0x1e0670[_0x9f2a('0x44')]['id']}},_0x4335a3={};_0x4335a3[_0x9f2a('0x2f')]=_[_0x9f2a('0x31')](db[_0x9f2a('0x3f')][_0x9f2a('0x45')]);_0x4335a3['query']=_[_0x9f2a('0x31')](_0x1e0670[_0x9f2a('0x30')]);_0x4335a3['filters']=_[_0x9f2a('0x33')](_0x4335a3[_0x9f2a('0x2f')],_0x4335a3['query']);_0x338d22[_0x9f2a('0x34')]=_[_0x9f2a('0x33')](_0x4335a3[_0x9f2a('0x2f')],qs[_0x9f2a('0x35')](_0x1e0670[_0x9f2a('0x30')][_0x9f2a('0x35')]));_0x338d22[_0x9f2a('0x34')]=_0x338d22[_0x9f2a('0x34')]['length']?_0x338d22['attributes']:_0x4335a3[_0x9f2a('0x2f')];if(_0x1e0670['query']['includeAll']){_0x338d22[_0x9f2a('0x40')]=[{'all':!![]}];}_0x338d22=_[_0x9f2a('0x46')]({},_0x338d22,_0x1e0670[_0x9f2a('0x47')]);return db[_0x9f2a('0x3f')]['find'](_0x338d22)[_0x9f2a('0x22')](handleEntityNotFound(_0x1addff,null))[_0x9f2a('0x22')](respondWithResult(_0x1addff,null))[_0x9f2a('0x48')](handleError(_0x1addff,null));};exports['create']=function(_0xdfa311,_0x269368){return db[_0x9f2a('0x3f')][_0x9f2a('0x49')](_0xdfa311[_0x9f2a('0x4a')],{})['then'](function(_0x43af77){var _0x226496=_0xdfa311[_0x9f2a('0x4b')]['get']({'plain':!![]});if(!_0x226496)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x226496[_0x9f2a('0x4c')]==='user'){var _0xa0af15=_0x43af77['get']({'plain':!![]});var _0x1ee137=_0x9f2a('0x4d');return db[_0x9f2a('0x4e')]['find']({'where':{'name':_0x1ee137,'userProfileId':_0x226496[_0x9f2a('0x4f')]},'raw':!![]})[_0x9f2a('0x22')](function(_0x3c87ac){if(_0x3c87ac&&_0x3c87ac[_0x9f2a('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0xa0af15[_0x9f2a('0x28')],'resourceId':_0xa0af15['id'],'type':_0x3c87ac[_0x9f2a('0x28')],'sectionId':_0x3c87ac['id']},{})[_0x9f2a('0x22')](function(){return _0x43af77;});}else{return _0x43af77;}})['catch'](function(_0x36ae5b){logger[_0x9f2a('0x26')](_0x9f2a('0x51'),_0x36ae5b);throw _0x36ae5b;});}return _0x43af77;})[_0x9f2a('0x22')](respondWithResult(_0x269368,0xc9))['catch'](handleError(_0x269368,null));};exports[_0x9f2a('0x52')]=function(_0xdf53b8,_0x514853){if(_0xdf53b8[_0x9f2a('0x4a')]['id']){delete _0xdf53b8[_0x9f2a('0x4a')]['id'];}return db[_0x9f2a('0x3f')][_0x9f2a('0x53')]({'where':{'id':_0xdf53b8[_0x9f2a('0x44')]['id']}})[_0x9f2a('0x22')](handleEntityNotFound(_0x514853,null))[_0x9f2a('0x22')](saveUpdates(_0xdf53b8[_0x9f2a('0x4a')],null))[_0x9f2a('0x22')](respondWithResult(_0x514853,null))['catch'](handleError(_0x514853,null));};exports[_0x9f2a('0x25')]=function(_0x5a2d91,_0x1c02f6){return db[_0x9f2a('0x3f')]['find']({'where':{'id':_0x5a2d91['params']['id']}})[_0x9f2a('0x22')](handleEntityNotFound(_0x1c02f6,null))['then'](removeEntity(_0x1c02f6,null))[_0x9f2a('0x48')](handleError(_0x1c02f6,null));};exports['getMessages']=function(_0x2ec6d1,_0x4a0adb,_0x7538ff){return db[_0x9f2a('0x3f')][_0x9f2a('0x54')]({'where':{'id':_0x2ec6d1[_0x9f2a('0x44')]['id']}})[_0x9f2a('0x22')](handleEntityNotFound(_0x4a0adb,null))[_0x9f2a('0x22')](function(_0x4c5b3d){var _0x39a8be;var _0x1ac836={},_0x44ee0c={};_0x44ee0c['model']=_[_0x9f2a('0x31')](db[_0x9f2a('0x55')]['rawAttributes']);_0x44ee0c[_0x9f2a('0x30')]=_['keys'](_0x2ec6d1[_0x9f2a('0x30')]);_0x44ee0c[_0x9f2a('0x32')]=_['intersection'](_0x44ee0c[_0x9f2a('0x2f')],_0x44ee0c[_0x9f2a('0x30')]);_0x1ac836[_0x9f2a('0x34')]=_[_0x9f2a('0x33')](_0x44ee0c['model'],qs['fields'](_0x2ec6d1[_0x9f2a('0x30')]['fields']));_0x1ac836[_0x9f2a('0x34')]=_0x1ac836['attributes'][_0x9f2a('0x36')]?_0x1ac836[_0x9f2a('0x34')]:_0x44ee0c[_0x9f2a('0x2f')];if(!_0x2ec6d1['query'][_0x9f2a('0x56')](_0x9f2a('0x37'))){_0x1ac836[_0x9f2a('0x38')]=qs[_0x9f2a('0x38')](_0x2ec6d1['query'][_0x9f2a('0x38')]);_0x1ac836[_0x9f2a('0x1c')]=qs[_0x9f2a('0x1c')](_0x2ec6d1[_0x9f2a('0x30')][_0x9f2a('0x1c')]);}_0x1ac836['order']=qs[_0x9f2a('0x3a')](_0x2ec6d1['query'][_0x9f2a('0x3a')]);_0x1ac836[_0x9f2a('0x3b')]=qs[_0x9f2a('0x32')](_[_0x9f2a('0x3c')](_0x2ec6d1[_0x9f2a('0x30')],_0x44ee0c[_0x9f2a('0x32')]));if(_0x2ec6d1[_0x9f2a('0x30')][_0x9f2a('0x3d')]){_0x1ac836[_0x9f2a('0x3b')]=_[_0x9f2a('0x46')](_0x1ac836[_0x9f2a('0x3b')],{'$or':_[_0x9f2a('0x2b')](_0x1ac836[_0x9f2a('0x34')],function(_0x47875e){var _0x268196={};_0x268196[_0x47875e]={'$like':'%'+_0x2ec6d1[_0x9f2a('0x30')][_0x9f2a('0x3d')]+'%'};return _0x268196;})});}_0x1ac836['where']=_['merge'](_0x1ac836[_0x9f2a('0x3b')],{'mailboxuser':_0x4c5b3d[_0x9f2a('0x57')]});_0x1ac836=_['merge']({},_0x1ac836,_0x2ec6d1[_0x9f2a('0x47')]);return db[_0x9f2a('0x55')][_0x9f2a('0x58')](_0x1ac836)[_0x9f2a('0x22')](respondWithFilteredResult(_0x4a0adb,_0x1ac836));})[_0x9f2a('0x48')](handleError(_0x4a0adb,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index fbe0783..99c2686 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 _0x58b6=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x58b6,0x103));var _0x658b=function(_0x141213,_0x54d57b){_0x141213=_0x141213-0x0;var _0x53f2c0=_0x58b6[_0x141213];return _0x53f2c0;};'use strict';var _=require(_0x658b('0x0'));var util=require(_0x658b('0x1'));var logger=require(_0x658b('0x2'))(_0x658b('0x3'));var moment=require(_0x658b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x658b('0x5'));var rimraf=require(_0x658b('0x6'));var config=require(_0x658b('0x7'));var attributes=require('./voiceMail.attributes');module[_0x658b('0x8')]=function(_0x3605bf,_0x3efa4a){return _0x3605bf[_0x658b('0x9')](_0x658b('0xa'),attributes,{'tableName':_0x658b('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x658b('0xc'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1541=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','context','util'];(function(_0x3eea6e,_0x2016fe){var _0xc02bc4=function(_0x4dffd9){while(--_0x4dffd9){_0x3eea6e['push'](_0x3eea6e['shift']());}};_0xc02bc4(++_0x2016fe);}(_0x1541,0x158));var _0x1154=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0x1541[_0x912d27];return _0x31b918;};'use strict';var _=require('lodash');var util=require(_0x1154('0x0'));var logger=require(_0x1154('0x1'))('api');var moment=require(_0x1154('0x2'));var BPromise=require(_0x1154('0x3'));var rp=require(_0x1154('0x4'));var fs=require('fs');var path=require(_0x1154('0x5'));var rimraf=require(_0x1154('0x6'));var config=require(_0x1154('0x7'));var attributes=require(_0x1154('0x8'));module[_0x1154('0x9')]=function(_0xd0d446,_0x4ec72b){return _0xd0d446[_0x1154('0xa')]('VoiceMail',attributes,{'tableName':_0x1154('0xb'),'paranoid':![],'indexes':[{'name':_0x1154('0xc'),'fields':[_0x1154('0xd'),_0x1154('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 0b5eca7..1627bf5 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 _0x3aa9=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','info','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x294e7e,_0x4ac683){var _0x5a199f=function(_0x472083){while(--_0x472083){_0x294e7e['push'](_0x294e7e['shift']());}};_0x5a199f(++_0x4ac683);}(_0x3aa9,0x9f));var _0x93aa=function(_0x11aff2,_0x2e64c3){_0x11aff2=_0x11aff2-0x0;var _0x37c500=_0x3aa9[_0x11aff2];return _0x37c500;};'use strict';var _=require(_0x93aa('0x0'));var util=require(_0x93aa('0x1'));var moment=require('moment');var BPromise=require(_0x93aa('0x2'));var rs=require(_0x93aa('0x3'));var fs=require('fs');var Redis=require(_0x93aa('0x4'));var db=require(_0x93aa('0x5'))['db'];var utils=require(_0x93aa('0x6'));var logger=require(_0x93aa('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x93aa('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd98efc,_0x2d9328,_0x5d2270){return new BPromise(function(_0x5dba10,_0x19170e){return client['request'](_0xd98efc,_0x5d2270)['then'](function(_0x1a032a){logger[_0x93aa('0x9')](_0x93aa('0xa'),_0x2d9328,_0x93aa('0xb'));logger[_0x93aa('0xc')](_0x93aa('0xd'),_0x2d9328,_0x93aa('0xb'),JSON['stringify'](_0x1a032a));if(_0x1a032a[_0x93aa('0xe')]){if(_0x1a032a[_0x93aa('0xe')][_0x93aa('0xf')]===0x1f4){logger['error'](_0x93aa('0xa'),_0x2d9328,_0x1a032a[_0x93aa('0xe')][_0x93aa('0x10')]);return _0x19170e(_0x1a032a[_0x93aa('0xe')]['message']);}logger['error'](_0x93aa('0xa'),_0x2d9328,_0x1a032a[_0x93aa('0xe')][_0x93aa('0x10')]);return _0x5dba10(_0x1a032a[_0x93aa('0xe')][_0x93aa('0x10')]);}else{logger['info'](_0x93aa('0xa'),_0x2d9328,_0x93aa('0xb'));_0x5dba10(_0x1a032a[_0x93aa('0x11')][_0x93aa('0x10')]);}})[_0x93aa('0x12')](function(_0x47f9e6){logger['error'](_0x93aa('0xa'),_0x2d9328,_0x47f9e6);_0x19170e(_0x47f9e6);});});} \ No newline at end of file +var _0xb610=['stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x224474,_0x4870eb){var _0x175527=function(_0xdb3520){while(--_0xdb3520){_0x224474['push'](_0x224474['shift']());}};_0x175527(++_0x4870eb);}(_0xb610,0x18d));var _0x0b61=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb610[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x0b61('0x0'));var util=require('util');var moment=require(_0x0b61('0x1'));var BPromise=require(_0x0b61('0x2'));var rs=require(_0x0b61('0x3'));var fs=require('fs');var Redis=require(_0x0b61('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b61('0x5'));var logger=require(_0x0b61('0x6'))(_0x0b61('0x7'));var config=require(_0x0b61('0x8'));var jayson=require(_0x0b61('0x9'));var client=jayson[_0x0b61('0xa')][_0x0b61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59c3e3,_0x5776a1,_0x3d9eef){return new BPromise(function(_0xd75d44,_0x2b94c7){return client['request'](_0x59c3e3,_0x3d9eef)[_0x0b61('0xc')](function(_0x11e751){logger['info'](_0x0b61('0xd'),_0x5776a1,'request\x20sent');logger[_0x0b61('0xe')](_0x0b61('0xf'),_0x5776a1,_0x0b61('0x10'),JSON[_0x0b61('0x11')](_0x11e751));if(_0x11e751[_0x0b61('0x12')]){if(_0x11e751[_0x0b61('0x12')][_0x0b61('0x13')]===0x1f4){logger[_0x0b61('0x12')](_0x0b61('0xd'),_0x5776a1,_0x11e751[_0x0b61('0x12')][_0x0b61('0x14')]);return _0x2b94c7(_0x11e751[_0x0b61('0x12')][_0x0b61('0x14')]);}logger[_0x0b61('0x12')](_0x0b61('0xd'),_0x5776a1,_0x11e751[_0x0b61('0x12')][_0x0b61('0x14')]);return _0xd75d44(_0x11e751[_0x0b61('0x12')][_0x0b61('0x14')]);}else{logger[_0x0b61('0x15')](_0x0b61('0xd'),_0x5776a1,_0x0b61('0x10'));_0xd75d44(_0x11e751['result'][_0x0b61('0x14')]);}})[_0x0b61('0x16')](function(_0x426a1e){logger[_0x0b61('0x12')]('VoiceMail,\x20%s,\x20%s',_0x5776a1,_0x426a1e);_0x2b94c7(_0x426a1e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index bea8d75..6d11b30 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 _0x4819=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','isAuthenticated','show','/:id/download','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0xab2865,_0x32e71e){var _0x31f344=function(_0x2a3762){while(--_0x2a3762){_0xab2865['push'](_0xab2865['shift']());}};_0x31f344(++_0x32e71e);}(_0x4819,0xcd));var _0x9481=function(_0x5c5e95,_0x740a18){_0x5c5e95=_0x5c5e95-0x0;var _0x55c9aa=_0x4819[_0x5c5e95];return _0x55c9aa;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var auth=require(_0x9481('0x5'));var interaction=require(_0x9481('0x6'));var config=require(_0x9481('0x7'));var controller=require(_0x9481('0x8'));router[_0x9481('0x9')]('/',auth['isAuthenticated'](),controller[_0x9481('0xa')]);router['get']('/:id',auth[_0x9481('0xb')](),controller[_0x9481('0xc')]);router[_0x9481('0x9')](_0x9481('0xd'),auth[_0x9481('0xb')](),controller['download']);router[_0x9481('0xe')]('/',auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['put'](_0x9481('0x10'),auth[_0x9481('0xb')](),controller[_0x9481('0x11')]);router[_0x9481('0x12')](_0x9481('0x10'),auth[_0x9481('0xb')](),controller[_0x9481('0x13')]);module[_0x9481('0x14')]=router; \ No newline at end of file +var _0x1261=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','/:id','show','/:id/download','isAuthenticated','download','create','put','destroy'];(function(_0x3064a3,_0x20e71a){var _0x4319b6=function(_0x2e5240){while(--_0x2e5240){_0x3064a3['push'](_0x3064a3['shift']());}};_0x4319b6(++_0x20e71a);}(_0x1261,0x144));var _0x1126=function(_0x2ad1b8,_0x1ea09b){_0x2ad1b8=_0x2ad1b8-0x0;var _0x52547d=_0x1261[_0x2ad1b8];return _0x52547d;};'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')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1126('0x9')](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0xb')]);router[_0x1126('0x9')](_0x1126('0xc'),auth[_0x1126('0xd')](),controller[_0x1126('0xe')]);router['post']('/',auth[_0x1126('0xd')](),controller[_0x1126('0xf')]);router[_0x1126('0x10')]('/:id',auth[_0x1126('0xd')](),controller['update']);router['delete'](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0x11')]);module[_0x1126('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 7d0870a..9de4612 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 _0x170a=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x170a,0x164));var _0xa170=function(_0x2ad0da,_0x2565b4){_0x2ad0da=_0x2ad0da-0x0;var _0x3471a0=_0x170a[_0x2ad0da];return _0x3471a0;};'use strict';var Sequelize=require(_0xa170('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x36cd39){return this[_0xa170('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xa170('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xa170('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xa170('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xa170('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xa170('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xa170('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xa170('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xa170('0x4')](_0xa170('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xa170('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa170('0x3')],'defaultValue':''},'stamp':{'type':_0xa170('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0x6d11=['STRING','BLOB','long','TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER'];(function(_0x50ac35,_0x2f4323){var _0x4947de=function(_0x10d02d){while(--_0x10d02d){_0x50ac35['push'](_0x50ac35['shift']());}};_0x4947de(++_0x2f4323);}(_0x6d11,0x175));var _0x16d1=function(_0x824415,_0x19f60b){_0x824415=_0x824415-0x0;var _0x5445a7=_0x6d11[_0x824415];return _0x5445a7;};'use strict';var Sequelize=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'name':{'type':Sequelize[_0x16d1('0x2')],'get':function(_0x43a777){return this[_0x16d1('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x16d1('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x16d1('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x16d1('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x16d1('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x16d1('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x16d1('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x16d1('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x16d1('0x6')](_0x16d1('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x16d1('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x16d1('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index fef3dd6..d3db0f2 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 _0xdc97=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','update','then','name','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','intersection','query','attributes','length','hasOwnProperty','nolimit','limit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','fields','find','catch','create','body','destroy','params','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','msg_id','.wav\x22','set','send','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','jsforce','desk.js'];(function(_0x36806e,_0x237e6a){var _0x188660=function(_0x35e358){while(--_0x35e358){_0x36806e['push'](_0x36806e['shift']());}};_0x188660(++_0x237e6a);}(_0xdc97,0x13b));var _0x7dc9=function(_0x51041f,_0x53475a){_0x51041f=_0x51041f-0x0;var _0x3c1ee7=_0xdc97[_0x51041f];return _0x3c1ee7;};'use strict';var pdf=require(_0x7dc9('0x0'));var emlformat=require(_0x7dc9('0x1'));var rimraf=require(_0x7dc9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7dc9('0x3'));var rp=require('request-promise');var moment=require(_0x7dc9('0x4'));var BPromise=require(_0x7dc9('0x5'));var Mustache=require('mustache');var util=require(_0x7dc9('0x6'));var path=require(_0x7dc9('0x7'));var sox=require(_0x7dc9('0x8'));var csv=require(_0x7dc9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x9'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4be1c8,_0x599ef1){_0x599ef1=_0x599ef1||0xcc;return function(_0x94c75a){if(_0x94c75a){return _0x4be1c8[_0x7dc9('0x16')](_0x599ef1);}return _0x4be1c8['status'](_0x599ef1)[_0x7dc9('0x17')]();};}function respondWithResult(_0x2f3acd,_0xaadf2){_0xaadf2=_0xaadf2||0xc8;return function(_0xf37bc7){if(_0xf37bc7){return _0x2f3acd[_0x7dc9('0x18')](_0xaadf2)[_0x7dc9('0x19')](_0xf37bc7);}};}function respondWithFilteredResult(_0x524d09,_0x3a54f2){return function(_0x278191){if(_0x278191){var _0x1b0aa1=_0x278191[_0x7dc9('0x1a')],_0x442819=_0x3a54f2[_0x7dc9('0x1b')],_0x11606f=_0x3a54f2[_0x7dc9('0x1b')]+_0x3a54f2['limit'],_0xbe0437;if(_0x11606f>=_0x1b0aa1){_0x11606f=_0x1b0aa1;_0xbe0437=0xc8;}else{_0xbe0437=0xce;}_0x524d09[_0x7dc9('0x18')](_0xbe0437);return _0x524d09['set'](_0x7dc9('0x1c'),_0x442819+'-'+_0x11606f+'/'+_0x1b0aa1)[_0x7dc9('0x19')](_0x278191);}return null;};}function patchUpdates(_0x5d61d7){return function(_0x41f66e){try{jsonpatch[_0x7dc9('0x1d')](_0x41f66e,_0x5d61d7,!![]);}catch(_0x12f08d){return BPromise[_0x7dc9('0x1e')](_0x12f08d);}return _0x41f66e[_0x7dc9('0x1f')]();};}function saveUpdates(_0x184bfd,_0x2dad65){return function(_0x2895f5){if(_0x2895f5){return _0x2895f5[_0x7dc9('0x20')](_0x184bfd)[_0x7dc9('0x21')](function(_0x576681){return _0x576681;});}return null;};}function removeEntity(_0x593e60,_0x12954f){return function(_0x5981e2){if(_0x5981e2){return _0x5981e2['destroy']()[_0x7dc9('0x21')](function(){_0x593e60[_0x7dc9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xffc080,_0x43d31f){return function(_0x41110a){if(!_0x41110a){_0xffc080['sendStatus'](0x194);}return _0x41110a;};}function handleError(_0x424763,_0x1e3a8d){_0x1e3a8d=_0x1e3a8d||0x1f4;return function(_0xf95336){logger['error'](_0xf95336['stack']);if(_0xf95336['name']){delete _0xf95336[_0x7dc9('0x22')];}_0x424763[_0x7dc9('0x18')](_0x1e3a8d)['send'](_0xf95336);};}exports['index']=function(_0x47771b,_0x5afb7d){var _0x2d22eb={},_0x1c690b={},_0x3a74a0={'count':0x0,'rows':[]};var _0x3e4102=_[_0x7dc9('0x23')](db[_0x7dc9('0x24')][_0x7dc9('0x25')],function(_0x229f8e){return{'name':_0x229f8e[_0x7dc9('0x26')],'type':_0x229f8e[_0x7dc9('0x27')][_0x7dc9('0x28')]};});_0x1c690b[_0x7dc9('0x29')]=_['differenceBy'](_['map'](_0x3e4102,'name'),['name']);_0x1c690b['query']=_['keys'](_0x47771b['query']);_0x1c690b['filters']=_[_0x7dc9('0x2a')](_0x1c690b[_0x7dc9('0x29')],_0x1c690b[_0x7dc9('0x2b')]);_0x2d22eb[_0x7dc9('0x2c')]=_[_0x7dc9('0x2a')](_0x1c690b[_0x7dc9('0x29')],qs['fields'](_0x47771b['query']['fields']));_0x2d22eb[_0x7dc9('0x2c')]=_0x2d22eb['attributes'][_0x7dc9('0x2d')]?_0x2d22eb[_0x7dc9('0x2c')]:_0x1c690b[_0x7dc9('0x29')];if(!_0x47771b[_0x7dc9('0x2b')][_0x7dc9('0x2e')](_0x7dc9('0x2f'))){_0x2d22eb[_0x7dc9('0x30')]=qs[_0x7dc9('0x30')](_0x47771b['query'][_0x7dc9('0x30')]);_0x2d22eb['offset']=qs[_0x7dc9('0x1b')](_0x47771b[_0x7dc9('0x2b')][_0x7dc9('0x1b')]);}_0x2d22eb[_0x7dc9('0x31')]=qs['sort'](_0x47771b[_0x7dc9('0x2b')]['sort']);_0x2d22eb[_0x7dc9('0x32')]=qs['filters'](_['pick'](_0x47771b[_0x7dc9('0x2b')],_0x1c690b[_0x7dc9('0x33')]));if(_0x47771b[_0x7dc9('0x2b')][_0x7dc9('0x34')]){_0x2d22eb['where']=_[_0x7dc9('0x35')](_0x2d22eb[_0x7dc9('0x32')],{'$or':_[_0x7dc9('0x23')](_0x3e4102,function(_0x437e6d){if(_0x437e6d[_0x7dc9('0x27')]!==_0x7dc9('0x36')){var _0x225a1c={};_0x225a1c[_0x437e6d[_0x7dc9('0x22')]]={'$like':'%'+_0x47771b[_0x7dc9('0x2b')][_0x7dc9('0x34')]+'%'};return _0x225a1c;}})});}_0x2d22eb=_[_0x7dc9('0x35')]({},_0x2d22eb,_0x47771b[_0x7dc9('0x37')]);var _0x5a94b5={'where':_0x2d22eb[_0x7dc9('0x32')]};return db[_0x7dc9('0x24')][_0x7dc9('0x1a')](_0x5a94b5)[_0x7dc9('0x21')](function(_0x4bcdce){_0x3a74a0[_0x7dc9('0x1a')]=_0x4bcdce;if(_0x47771b[_0x7dc9('0x2b')][_0x7dc9('0x38')]){_0x2d22eb[_0x7dc9('0x39')]=[{'all':!![]}];}return db[_0x7dc9('0x24')][_0x7dc9('0x3a')](_0x2d22eb);})['then'](function(_0x553230){_0x3a74a0[_0x7dc9('0x3b')]=_0x553230;return _0x3a74a0;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x5afb7d,_0x2d22eb))['catch'](handleError(_0x5afb7d,null));};exports[_0x7dc9('0x3c')]=function(_0x4a37ec,_0x315d65){var _0x2a91fe={'raw':!![],'where':{'id':_0x4a37ec['params']['id']}},_0x3bca9c={};_0x3bca9c[_0x7dc9('0x29')]=_[_0x7dc9('0x3d')](db[_0x7dc9('0x24')][_0x7dc9('0x25')]);_0x3bca9c[_0x7dc9('0x2b')]=_[_0x7dc9('0x3d')](_0x4a37ec[_0x7dc9('0x2b')]);_0x3bca9c['filters']=_[_0x7dc9('0x2a')](_0x3bca9c['model'],_0x3bca9c['query']);_0x2a91fe[_0x7dc9('0x2c')]=_[_0x7dc9('0x2a')](_0x3bca9c[_0x7dc9('0x29')],qs[_0x7dc9('0x3e')](_0x4a37ec[_0x7dc9('0x2b')][_0x7dc9('0x3e')]));_0x2a91fe[_0x7dc9('0x2c')]=_0x2a91fe[_0x7dc9('0x2c')][_0x7dc9('0x2d')]?_0x2a91fe['attributes']:_0x3bca9c[_0x7dc9('0x29')];if(_0x4a37ec[_0x7dc9('0x2b')][_0x7dc9('0x38')]){_0x2a91fe[_0x7dc9('0x39')]=[{'all':!![]}];}_0x2a91fe=_[_0x7dc9('0x35')]({},_0x2a91fe,_0x4a37ec[_0x7dc9('0x37')]);return db['VoiceMailMessage'][_0x7dc9('0x3f')](_0x2a91fe)[_0x7dc9('0x21')](handleEntityNotFound(_0x315d65,null))['then'](respondWithResult(_0x315d65,null))[_0x7dc9('0x40')](handleError(_0x315d65,null));};exports[_0x7dc9('0x41')]=function(_0x3c45b5,_0x5f0f97){return db[_0x7dc9('0x24')]['create'](_0x3c45b5['body'],{})[_0x7dc9('0x21')](respondWithResult(_0x5f0f97,0xc9))[_0x7dc9('0x40')](handleError(_0x5f0f97,null));};exports[_0x7dc9('0x20')]=function(_0x5e0dc5,_0x4aea89){if(_0x5e0dc5[_0x7dc9('0x42')]['id']){delete _0x5e0dc5['body']['id'];}return db[_0x7dc9('0x24')][_0x7dc9('0x3f')]({'where':{'id':_0x5e0dc5['params']['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x4aea89,null))[_0x7dc9('0x21')](saveUpdates(_0x5e0dc5[_0x7dc9('0x42')],null))[_0x7dc9('0x21')](respondWithResult(_0x4aea89,null))[_0x7dc9('0x40')](handleError(_0x4aea89,null));};exports[_0x7dc9('0x43')]=function(_0x86739f,_0x3a1102){return db[_0x7dc9('0x24')][_0x7dc9('0x3f')]({'where':{'id':_0x86739f[_0x7dc9('0x44')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x3a1102,null))[_0x7dc9('0x21')](removeEntity(_0x3a1102,null))['catch'](handleError(_0x3a1102,null));};exports[_0x7dc9('0x45')]=function(_0x4fcfd5,_0x57993f,_0x446103){return db[_0x7dc9('0x24')][_0x7dc9('0x3f')]({'where':{'id':_0x4fcfd5[_0x7dc9('0x44')]['id']},'attributes':['id',_0x7dc9('0x46'),'msg_id']})[_0x7dc9('0x21')](handleEntityNotFound(_0x57993f,null))[_0x7dc9('0x21')](function(_0x34f7b1){if(_0x34f7b1){if(!_0x34f7b1['recording']){throw new db[(_0x7dc9('0x47'))][(_0x7dc9('0x48'))](_0x7dc9('0x49'));}var _0x32bc31={'Content-Type':_0x7dc9('0x4a'),'Content-Disposition':_0x7dc9('0x4b')};if(_0x34f7b1['msg_id']){_0x32bc31[_0x7dc9('0x4c')]=_0x7dc9('0x4d')+_0x34f7b1[_0x7dc9('0x4e')]+_0x7dc9('0x4f');}_0x57993f[_0x7dc9('0x50')](_0x32bc31);return _0x57993f[_0x7dc9('0x51')](new Buffer(_0x34f7b1[_0x7dc9('0x46')]));}})[_0x7dc9('0x40')](handleError(_0x57993f,null));}; \ No newline at end of file +var _0x5075=['fieldName','type','model','differenceBy','query','filters','intersection','attributes','fields','order','sort','filter','where','merge','options','includeAll','include','rows','catch','show','params','keys','length','find','create','body','download','recording','msg_id','Sequelize','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','index','map','VoiceMailMessage','rawAttributes'];(function(_0x364c9c,_0x3c57a0){var _0x3f52a1=function(_0x5a1748){while(--_0x5a1748){_0x364c9c['push'](_0x364c9c['shift']());}};_0x3f52a1(++_0x3c57a0);}(_0x5075,0x73));var _0x5507=function(_0x3ee935,_0x293a98){_0x3ee935=_0x3ee935-0x0;var _0x586db7=_0x5075[_0x3ee935];return _0x586db7;};'use strict';var pdf=require(_0x5507('0x0'));var emlformat=require(_0x5507('0x1'));var rimraf=require(_0x5507('0x2'));var zipdir=require(_0x5507('0x3'));var jsonpatch=require(_0x5507('0x4'));var rp=require(_0x5507('0x5'));var moment=require(_0x5507('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5507('0x7'));var util=require(_0x5507('0x8'));var path=require(_0x5507('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5507('0xa'));var fs=require('fs');var _=require(_0x5507('0xb'));var squel=require('squel');var crypto=require(_0x5507('0xc'));var jsforce=require(_0x5507('0xd'));var deskjs=require(_0x5507('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5507('0xf'));var Redis=require(_0x5507('0x10'));var authService=require(_0x5507('0x11'));var qs=require(_0x5507('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5507('0x13'));var logger=require(_0x5507('0x14'))('api');var utils=require(_0x5507('0x15'));var config=require(_0x5507('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37a1de,_0x2a2ea0){_0x2a2ea0=_0x2a2ea0||0xcc;return function(_0x32c872){if(_0x32c872){return _0x37a1de[_0x5507('0x17')](_0x2a2ea0);}return _0x37a1de[_0x5507('0x18')](_0x2a2ea0)[_0x5507('0x19')]();};}function respondWithResult(_0x59889b,_0x9cc3f9){_0x9cc3f9=_0x9cc3f9||0xc8;return function(_0x2b7c43){if(_0x2b7c43){return _0x59889b[_0x5507('0x18')](_0x9cc3f9)[_0x5507('0x1a')](_0x2b7c43);}};}function respondWithFilteredResult(_0x4df473,_0x49e400){return function(_0x10d7b9){if(_0x10d7b9){var _0x2dfd06=_0x10d7b9[_0x5507('0x1b')],_0x1ab167=_0x49e400[_0x5507('0x1c')],_0xa6e4b3=_0x49e400[_0x5507('0x1c')]+_0x49e400[_0x5507('0x1d')],_0x2ede34;if(_0xa6e4b3>=_0x2dfd06){_0xa6e4b3=_0x2dfd06;_0x2ede34=0xc8;}else{_0x2ede34=0xce;}_0x4df473[_0x5507('0x18')](_0x2ede34);return _0x4df473[_0x5507('0x1e')](_0x5507('0x1f'),_0x1ab167+'-'+_0xa6e4b3+'/'+_0x2dfd06)['json'](_0x10d7b9);}return null;};}function patchUpdates(_0x14dab0){return function(_0x276a81){try{jsonpatch[_0x5507('0x20')](_0x276a81,_0x14dab0,!![]);}catch(_0x193eda){return BPromise['reject'](_0x193eda);}return _0x276a81[_0x5507('0x21')]();};}function saveUpdates(_0x1af06e,_0x1a54b0){return function(_0x3ca1f7){if(_0x3ca1f7){return _0x3ca1f7[_0x5507('0x22')](_0x1af06e)[_0x5507('0x23')](function(_0x501a94){return _0x501a94;});}return null;};}function removeEntity(_0x475970,_0x105535){return function(_0x1f6325){if(_0x1f6325){return _0x1f6325[_0x5507('0x24')]()[_0x5507('0x23')](function(){_0x475970[_0x5507('0x18')](0xcc)[_0x5507('0x19')]();});}};}function handleEntityNotFound(_0x10f149,_0x398911){return function(_0xa47641){if(!_0xa47641){_0x10f149[_0x5507('0x17')](0x194);}return _0xa47641;};}function handleError(_0x414e74,_0x164ac7){_0x164ac7=_0x164ac7||0x1f4;return function(_0x2ee6ed){logger[_0x5507('0x25')](_0x2ee6ed['stack']);if(_0x2ee6ed[_0x5507('0x26')]){delete _0x2ee6ed['name'];}_0x414e74[_0x5507('0x18')](_0x164ac7)['send'](_0x2ee6ed);};}exports[_0x5507('0x27')]=function(_0x24668b,_0x4beb0a){var _0x5cbb09={},_0xbe8d32={},_0x1a18d0={'count':0x0,'rows':[]};var _0x5912d4=_[_0x5507('0x28')](db[_0x5507('0x29')][_0x5507('0x2a')],function(_0x38f4d9){return{'name':_0x38f4d9[_0x5507('0x2b')],'type':_0x38f4d9[_0x5507('0x2c')]['key']};});_0xbe8d32[_0x5507('0x2d')]=_[_0x5507('0x2e')](_[_0x5507('0x28')](_0x5912d4,_0x5507('0x26')),[_0x5507('0x26')]);_0xbe8d32['query']=_['keys'](_0x24668b[_0x5507('0x2f')]);_0xbe8d32[_0x5507('0x30')]=_[_0x5507('0x31')](_0xbe8d32[_0x5507('0x2d')],_0xbe8d32['query']);_0x5cbb09[_0x5507('0x32')]=_[_0x5507('0x31')](_0xbe8d32[_0x5507('0x2d')],qs[_0x5507('0x33')](_0x24668b[_0x5507('0x2f')][_0x5507('0x33')]));_0x5cbb09[_0x5507('0x32')]=_0x5cbb09[_0x5507('0x32')]['length']?_0x5cbb09[_0x5507('0x32')]:_0xbe8d32[_0x5507('0x2d')];if(!_0x24668b[_0x5507('0x2f')]['hasOwnProperty']('nolimit')){_0x5cbb09[_0x5507('0x1d')]=qs[_0x5507('0x1d')](_0x24668b[_0x5507('0x2f')][_0x5507('0x1d')]);_0x5cbb09[_0x5507('0x1c')]=qs['offset'](_0x24668b['query'][_0x5507('0x1c')]);}_0x5cbb09[_0x5507('0x34')]=qs[_0x5507('0x35')](_0x24668b[_0x5507('0x2f')]['sort']);_0x5cbb09['where']=qs[_0x5507('0x30')](_['pick'](_0x24668b[_0x5507('0x2f')],_0xbe8d32[_0x5507('0x30')]));if(_0x24668b[_0x5507('0x2f')][_0x5507('0x36')]){_0x5cbb09[_0x5507('0x37')]=_[_0x5507('0x38')](_0x5cbb09[_0x5507('0x37')],{'$or':_[_0x5507('0x28')](_0x5912d4,function(_0x44502c){if(_0x44502c[_0x5507('0x2c')]!=='VIRTUAL'){var _0x4bddfb={};_0x4bddfb[_0x44502c['name']]={'$like':'%'+_0x24668b['query'][_0x5507('0x36')]+'%'};return _0x4bddfb;}})});}_0x5cbb09=_[_0x5507('0x38')]({},_0x5cbb09,_0x24668b[_0x5507('0x39')]);var _0x854262={'where':_0x5cbb09[_0x5507('0x37')]};return db[_0x5507('0x29')][_0x5507('0x1b')](_0x854262)[_0x5507('0x23')](function(_0xbc9f93){_0x1a18d0[_0x5507('0x1b')]=_0xbc9f93;if(_0x24668b[_0x5507('0x2f')][_0x5507('0x3a')]){_0x5cbb09[_0x5507('0x3b')]=[{'all':!![]}];}return db[_0x5507('0x29')]['findAll'](_0x5cbb09);})['then'](function(_0x50eb32){_0x1a18d0[_0x5507('0x3c')]=_0x50eb32;return _0x1a18d0;})[_0x5507('0x23')](respondWithFilteredResult(_0x4beb0a,_0x5cbb09))[_0x5507('0x3d')](handleError(_0x4beb0a,null));};exports[_0x5507('0x3e')]=function(_0xcd4df5,_0x17d7db){var _0x340c4c={'raw':!![],'where':{'id':_0xcd4df5[_0x5507('0x3f')]['id']}},_0x371136={};_0x371136[_0x5507('0x2d')]=_[_0x5507('0x40')](db[_0x5507('0x29')][_0x5507('0x2a')]);_0x371136[_0x5507('0x2f')]=_[_0x5507('0x40')](_0xcd4df5[_0x5507('0x2f')]);_0x371136[_0x5507('0x30')]=_[_0x5507('0x31')](_0x371136[_0x5507('0x2d')],_0x371136['query']);_0x340c4c[_0x5507('0x32')]=_[_0x5507('0x31')](_0x371136['model'],qs['fields'](_0xcd4df5[_0x5507('0x2f')][_0x5507('0x33')]));_0x340c4c[_0x5507('0x32')]=_0x340c4c[_0x5507('0x32')][_0x5507('0x41')]?_0x340c4c['attributes']:_0x371136[_0x5507('0x2d')];if(_0xcd4df5[_0x5507('0x2f')][_0x5507('0x3a')]){_0x340c4c['include']=[{'all':!![]}];}_0x340c4c=_[_0x5507('0x38')]({},_0x340c4c,_0xcd4df5[_0x5507('0x39')]);return db[_0x5507('0x29')][_0x5507('0x42')](_0x340c4c)[_0x5507('0x23')](handleEntityNotFound(_0x17d7db,null))['then'](respondWithResult(_0x17d7db,null))[_0x5507('0x3d')](handleError(_0x17d7db,null));};exports['create']=function(_0x36c29f,_0x3504bd){return db[_0x5507('0x29')][_0x5507('0x43')](_0x36c29f[_0x5507('0x44')],{})[_0x5507('0x23')](respondWithResult(_0x3504bd,0xc9))[_0x5507('0x3d')](handleError(_0x3504bd,null));};exports[_0x5507('0x22')]=function(_0x549cf0,_0x36aee1){if(_0x549cf0[_0x5507('0x44')]['id']){delete _0x549cf0['body']['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x549cf0[_0x5507('0x3f')]['id']}})['then'](handleEntityNotFound(_0x36aee1,null))[_0x5507('0x23')](saveUpdates(_0x549cf0['body'],null))[_0x5507('0x23')](respondWithResult(_0x36aee1,null))['catch'](handleError(_0x36aee1,null));};exports['destroy']=function(_0x3b98ae,_0x350c7e){return db[_0x5507('0x29')][_0x5507('0x42')]({'where':{'id':_0x3b98ae[_0x5507('0x3f')]['id']}})[_0x5507('0x23')](handleEntityNotFound(_0x350c7e,null))['then'](removeEntity(_0x350c7e,null))[_0x5507('0x3d')](handleError(_0x350c7e,null));};exports[_0x5507('0x45')]=function(_0x2f795c,_0x4b5722,_0x1ec672){return db[_0x5507('0x29')][_0x5507('0x42')]({'where':{'id':_0x2f795c[_0x5507('0x3f')]['id']},'attributes':['id',_0x5507('0x46'),_0x5507('0x47')]})[_0x5507('0x23')](handleEntityNotFound(_0x4b5722,null))[_0x5507('0x23')](function(_0x4674f9){if(_0x4674f9){if(!_0x4674f9[_0x5507('0x46')]){throw new db[(_0x5507('0x48'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x1992fa={'Content-Type':_0x5507('0x49'),'Content-Disposition':_0x5507('0x4a')};if(_0x4674f9[_0x5507('0x47')]){_0x1992fa[_0x5507('0x4b')]=_0x5507('0x4c')+_0x4674f9[_0x5507('0x47')]+_0x5507('0x4d');}_0x4b5722[_0x5507('0x1e')](_0x1992fa);return _0x4b5722[_0x5507('0x4e')](new Buffer(_0x4674f9[_0x5507('0x46')]));}})[_0x5507('0x3d')](handleError(_0x4b5722,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 3bd49d4..1029dd2 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 _0xee45=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util'];(function(_0x3b630e,_0x2150c){var _0x2433ae=function(_0x207b5a){while(--_0x207b5a){_0x3b630e['push'](_0x3b630e['shift']());}};_0x2433ae(++_0x2150c);}(_0xee45,0x1df));var _0x5ee4=function(_0x3ade49,_0x4b2b1b){_0x3ade49=_0x3ade49-0x0;var _0x429c6c=_0xee45[_0x3ade49];return _0x429c6c;};'use strict';var _=require(_0x5ee4('0x0'));var util=require(_0x5ee4('0x1'));var logger=require(_0x5ee4('0x2'))('api');var moment=require(_0x5ee4('0x3'));var BPromise=require(_0x5ee4('0x4'));var rp=require(_0x5ee4('0x5'));var fs=require('fs');var path=require(_0x5ee4('0x6'));var rimraf=require('rimraf');var config=require(_0x5ee4('0x7'));var attributes=require(_0x5ee4('0x8'));module[_0x5ee4('0x9')]=function(_0x528d1c,_0x15e780){return _0x528d1c[_0x5ee4('0xa')](_0x5ee4('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x5ee4('0xc'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x0e9d=['request-promise','rimraf','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e9d,0xbb));var _0xd0e9=function(_0x413213,_0x38efbd){_0x413213=_0x413213-0x0;var _0x1c844d=_0x0e9d[_0x413213];return _0x1c844d;};'use strict';var _=require('lodash');var util=require(_0xd0e9('0x0'));var logger=require(_0xd0e9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd0e9('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0e9('0x3'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xd0e9('0x4')]=function(_0x21aff5,_0x1b0584){return _0x21aff5[_0xd0e9('0x5')](_0xd0e9('0x6'),attributes,{'tableName':_0xd0e9('0x7'),'paranoid':![],'indexes':[{'name':_0xd0e9('0x8'),'fields':[_0xd0e9('0x8')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index ce26fa0..2aa16de 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js +++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ca=['client','http','request','info','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3406e5,_0x44a336){var _0x1271f6=function(_0x101ee7){while(--_0x101ee7){_0x3406e5['push'](_0x3406e5['shift']());}};_0x1271f6(++_0x44a336);}(_0x57ca,0x108));var _0xa57c=function(_0x1b5f3a,_0x3ec783){_0x1b5f3a=_0x1b5f3a-0x0;var _0x13f8fb=_0x57ca[_0x1b5f3a];return _0x13f8fb;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x64460d,_0x557fd6){var _0x4f60cf=function(_0x23f878){while(--_0x23f878){_0x64460d['push'](_0x64460d['shift']());}};_0x4f60cf(++_0x557fd6);}(_0x1a85,0x178));var _0x51a8=function(_0x3ae8f4,_0x2920f4){_0x3ae8f4=_0x3ae8f4-0x0;var _0x367312=_0x1a85[_0x3ae8f4];return _0x367312;};'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')]('VoiceMailMessage,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index d1f8768..3d06bcf 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 _0x74f2=['destroy','removeSound','exports','multer','util','connect-timeout','express','../../components/auth/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete'];(function(_0x383574,_0x2e663f){var _0x10ca6b=function(_0x59163a){while(--_0x59163a){_0x383574['push'](_0x383574['shift']());}};_0x10ca6b(++_0x2e663f);}(_0x74f2,0x18f));var _0x274f=function(_0x5ea129,_0x3970a6){_0x5ea129=_0x5ea129-0x0;var _0x40c77a=_0x74f2[_0x5ea129];return _0x40c77a;};'use strict';var multer=require(_0x274f('0x0'));var util=require(_0x274f('0x1'));var path=require('path');var timeout=require(_0x274f('0x2'));var express=require(_0x274f('0x3'));var router=express['Router']();var auth=require(_0x274f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x274f('0x5'));router[_0x274f('0x6')]('/',auth[_0x274f('0x7')](),controller[_0x274f('0x8')]);router[_0x274f('0x6')]('/:id',auth[_0x274f('0x7')](),controller[_0x274f('0x9')]);router['get'](_0x274f('0xa'),auth[_0x274f('0x7')](),controller[_0x274f('0xb')]);router[_0x274f('0xc')]('/',auth['isAuthenticated'](),controller[_0x274f('0xd')]);router[_0x274f('0xc')](_0x274f('0xa'),auth['isAuthenticated'](),controller[_0x274f('0xe')]);router[_0x274f('0xf')](_0x274f('0x10'),auth['isAuthenticated'](),controller[_0x274f('0x11')]);router[_0x274f('0x12')](_0x274f('0x10'),auth['isAuthenticated'](),controller[_0x274f('0x13')]);router['delete']('/:id/sounds/:id2',auth[_0x274f('0x7')](),controller[_0x274f('0x14')]);module[_0x274f('0x15')]=router; \ No newline at end of file +var _0x7b36=['addSound','destroy','delete','removeSound','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','index','get','/:id','isAuthenticated','show','/:id/sounds','getSounds','post','create'];(function(_0x56fd03,_0x1723c8){var _0x38a694=function(_0x380d97){while(--_0x380d97){_0x56fd03['push'](_0x56fd03['shift']());}};_0x38a694(++_0x1723c8);}(_0x7b36,0x9e));var _0x67b3=function(_0x1d1fc0,_0x11a809){_0x1d1fc0=_0x1d1fc0-0x0;var _0x62d605=_0x7b36[_0x1d1fc0];return _0x62d605;};'use strict';var multer=require(_0x67b3('0x0'));var util=require('util');var path=require(_0x67b3('0x1'));var timeout=require(_0x67b3('0x2'));var express=require(_0x67b3('0x3'));var router=express[_0x67b3('0x4')]();var auth=require(_0x67b3('0x5'));var interaction=require(_0x67b3('0x6'));var config=require(_0x67b3('0x7'));var controller=require(_0x67b3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x67b3('0x9')]);router[_0x67b3('0xa')](_0x67b3('0xb'),auth[_0x67b3('0xc')](),controller[_0x67b3('0xd')]);router['get'](_0x67b3('0xe'),auth[_0x67b3('0xc')](),controller[_0x67b3('0xf')]);router[_0x67b3('0x10')]('/',auth[_0x67b3('0xc')](),controller[_0x67b3('0x11')]);router[_0x67b3('0x10')](_0x67b3('0xe'),auth[_0x67b3('0xc')](),controller[_0x67b3('0x12')]);router['put'](_0x67b3('0xb'),auth[_0x67b3('0xc')](),controller['update']);router['delete'](_0x67b3('0xb'),auth['isAuthenticated'](),controller[_0x67b3('0x13')]);router[_0x67b3('0x14')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x67b3('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c5ccad1..4181e09 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 _0xb14c=['files','quietmp3nb','mp3','alpha','TIMESTAMP','STRING','ENUM'];(function(_0x28e22a,_0x4d49a6){var _0x3e25a8=function(_0x1b0d9b){while(--_0x1b0d9b){_0x28e22a['push'](_0x28e22a['shift']());}};_0x3e25a8(++_0x4d49a6);}(_0xb14c,0x1a9));var _0xcb14=function(_0x32f0d0,_0x456024){_0x32f0d0=_0x32f0d0-0x0;var _0x4b9648=_0xb14c[_0x32f0d0];return _0x4b9648;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcb14('0x0')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xcb14('0x1')]('custom',_0xcb14('0x2'),'mp3nb',_0xcb14('0x3'),'quietmp3',_0xcb14('0x4')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xcb14('0x0')],'allowNull':!![]},'application':{'type':Sequelize[_0xcb14('0x0')],'allowNull':!![]},'digit':{'type':Sequelize[_0xcb14('0x0')],'allowNull':!![]},'sort':{'type':Sequelize[_0xcb14('0x0')],'allowNull':!![],'defaultValue':_0xcb14('0x5')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xcb14('0x6')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa286=['quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','files','mp3nb','quietmp3nb'];(function(_0x5ed65f,_0x23d121){var _0x1f43ae=function(_0x3b7368){while(--_0x3b7368){_0x5ed65f['push'](_0x5ed65f['shift']());}};_0x1f43ae(++_0x23d121);}(_0xa286,0x161));var _0x6a28=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xa286[_0x53abe5];return _0xc1c37e;};'use strict';var Sequelize=require(_0x6a28('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a28('0x1')],'allowNull':![],'unique':_0x6a28('0x2')},'mode':{'type':Sequelize[_0x6a28('0x3')]('custom',_0x6a28('0x4'),_0x6a28('0x5'),_0x6a28('0x6'),_0x6a28('0x7'),_0x6a28('0x8')),'allowNull':!![],'defaultValue':_0x6a28('0x4')},'directory':{'type':Sequelize[_0x6a28('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x6a28('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x6a28('0x1')],'allowNull':!![],'defaultValue':_0x6a28('0x9')},'format':{'type':Sequelize[_0x6a28('0x1')],'allowNull':!![]},'stamp':{'type':_0x6a28('0xa')},'defaultEntry':{'type':Sequelize[_0x6a28('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 a46fc3c..fce8dd1 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 _0x422d=['pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','keys','length','include','find','update','body','create','sequelize','transaction','mode','files','root','directory','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','MusicOnHolds','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','readdirSync','forEach','unlinkSync','join','Sequelize','message','addSound','Sound','createdAt','server/files/sounds/converted','%s.%s','basename','save_name','extname','converted_format','format','symlinkSync','ValidationError','removeSound','findOne','id2','getSounds','html-pdf','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','reject','save','get','destroy','then','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4a2d61,_0x1356c5){var _0x521acb=function(_0x583153){while(--_0x583153){_0x4a2d61['push'](_0x4a2d61['shift']());}};_0x521acb(++_0x1356c5);}(_0x422d,0xa2));var _0xd422=function(_0x257378,_0xab275d){_0x257378=_0x257378-0x0;var _0x58456e=_0x422d[_0x257378];return _0x58456e;};'use strict';var pdf=require(_0xd422('0x0'));var emlformat=require(_0xd422('0x1'));var rimraf=require(_0xd422('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd422('0x3'));var Mustache=require(_0xd422('0x4'));var util=require(_0xd422('0x5'));var path=require(_0xd422('0x6'));var sox=require(_0xd422('0x7'));var csv=require(_0xd422('0x8'));var ejs=require(_0xd422('0x9'));var fs=require('fs');var _=require(_0xd422('0xa'));var squel=require(_0xd422('0xb'));var crypto=require(_0xd422('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd422('0xd'));var toCsv=require(_0xd422('0x8'));var querystring=require(_0xd422('0xe'));var Papa=require(_0xd422('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd422('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd422('0x11'));var logger=require(_0xd422('0x12'))(_0xd422('0x13'));var utils=require('../../config/utils');var config=require(_0xd422('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14fb0b,_0x2bdaf3){_0x2bdaf3=_0x2bdaf3||0xcc;return function(_0x3fadba){if(_0x3fadba){return _0x14fb0b['sendStatus'](_0x2bdaf3);}return _0x14fb0b[_0xd422('0x15')](_0x2bdaf3)[_0xd422('0x16')]();};}function respondWithResult(_0xf52dfb,_0x3eb043){_0x3eb043=_0x3eb043||0xc8;return function(_0xa2f341){if(_0xa2f341){return _0xf52dfb[_0xd422('0x15')](_0x3eb043)[_0xd422('0x17')](_0xa2f341);}};}function respondWithFilteredResult(_0x2020b9,_0x3e0539){return function(_0x7749dd){if(_0x7749dd){var _0x5ae487=_0x7749dd[_0xd422('0x18')],_0x57e28e=_0x3e0539['offset'],_0x144ced=_0x3e0539[_0xd422('0x19')]+_0x3e0539[_0xd422('0x1a')],_0xba62db;if(_0x144ced>=_0x5ae487){_0x144ced=_0x5ae487;_0xba62db=0xc8;}else{_0xba62db=0xce;}_0x2020b9[_0xd422('0x15')](_0xba62db);return _0x2020b9['set']('Content-Range',_0x57e28e+'-'+_0x144ced+'/'+_0x5ae487)[_0xd422('0x17')](_0x7749dd);}return null;};}function patchUpdates(_0x1f8430){return function(_0xc4552c){try{jsonpatch['apply'](_0xc4552c,_0x1f8430,!![]);}catch(_0x5ca6fe){return BPromise[_0xd422('0x1b')](_0x5ca6fe);}return _0xc4552c[_0xd422('0x1c')]();};}function saveUpdates(_0x102c0f,_0x45314a){return function(_0x2c75e8){if(_0x2c75e8){return _0x2c75e8['update'](_0x102c0f)['then'](function(_0x1eb806){return _0x1eb806;});}return null;};}function removeEntity(_0x433ea0,_0x59ea28){return function(_0x4b2e8e){if(_0x4b2e8e){return _0x4b2e8e['destroy']()['then'](function(){var _0x3b09b1=_0x4b2e8e[_0xd422('0x1d')]({'plain':!![]});var _0x56321f='MusicOnHolds';return db['UserProfileResource'][_0xd422('0x1e')]({'where':{'type':_0x56321f,'resourceId':_0x3b09b1['id']}})['then'](function(){return _0x4b2e8e;});})[_0xd422('0x1f')](function(){_0x433ea0[_0xd422('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46ae45,_0xb927ea){return function(_0x125a08){if(!_0x125a08){_0x46ae45['sendStatus'](0x194);}return _0x125a08;};}function handleError(_0x4fde40,_0xa2d2dd){_0xa2d2dd=_0xa2d2dd||0x1f4;return function(_0x1b3028){logger[_0xd422('0x20')](_0x1b3028[_0xd422('0x21')]);if(_0x1b3028['name']){delete _0x1b3028[_0xd422('0x22')];}_0x4fde40[_0xd422('0x15')](_0xa2d2dd)['send'](_0x1b3028);};}exports[_0xd422('0x23')]=function(_0x2d8181,_0x357138){var _0x2648aa={},_0xd5f53={},_0xcc3339={'count':0x0,'rows':[]};var _0x4dfd2d=_[_0xd422('0x24')](db[_0xd422('0x25')][_0xd422('0x26')],function(_0x53d0cd){return{'name':_0x53d0cd[_0xd422('0x27')],'type':_0x53d0cd['type'][_0xd422('0x28')]};});_0xd5f53[_0xd422('0x29')]=_[_0xd422('0x24')](_0x4dfd2d,'name');_0xd5f53[_0xd422('0x2a')]=_['keys'](_0x2d8181[_0xd422('0x2a')]);_0xd5f53[_0xd422('0x2b')]=_[_0xd422('0x2c')](_0xd5f53[_0xd422('0x29')],_0xd5f53['query']);_0x2648aa['attributes']=_[_0xd422('0x2c')](_0xd5f53['model'],qs[_0xd422('0x2d')](_0x2d8181[_0xd422('0x2a')]['fields']));_0x2648aa[_0xd422('0x2e')]=_0x2648aa[_0xd422('0x2e')]['length']?_0x2648aa[_0xd422('0x2e')]:_0xd5f53[_0xd422('0x29')];if(!_0x2d8181[_0xd422('0x2a')][_0xd422('0x2f')](_0xd422('0x30'))){_0x2648aa[_0xd422('0x1a')]=qs[_0xd422('0x1a')](_0x2d8181[_0xd422('0x2a')][_0xd422('0x1a')]);_0x2648aa['offset']=qs['offset'](_0x2d8181[_0xd422('0x2a')][_0xd422('0x19')]);}_0x2648aa[_0xd422('0x31')]=qs[_0xd422('0x32')](_0x2d8181[_0xd422('0x2a')][_0xd422('0x32')]);_0x2648aa[_0xd422('0x33')]=qs[_0xd422('0x2b')](_[_0xd422('0x34')](_0x2d8181[_0xd422('0x2a')],_0xd5f53[_0xd422('0x2b')]));if(_0x2d8181[_0xd422('0x2a')][_0xd422('0x35')]){_0x2648aa[_0xd422('0x33')]=_[_0xd422('0x36')](_0x2648aa[_0xd422('0x33')],{'$or':_['map'](_0x4dfd2d,function(_0xaf2c17){if(_0xaf2c17[_0xd422('0x37')]!==_0xd422('0x38')){var _0x243b72={};_0x243b72[_0xaf2c17[_0xd422('0x22')]]={'$like':'%'+_0x2d8181[_0xd422('0x2a')]['filter']+'%'};return _0x243b72;}})});}_0x2648aa=_[_0xd422('0x36')]({},_0x2648aa,_0x2d8181[_0xd422('0x39')]);var _0x317d27={'where':_0x2648aa[_0xd422('0x33')]};return db[_0xd422('0x25')][_0xd422('0x18')](_0x317d27)[_0xd422('0x1f')](function(_0x91f3ac){_0xcc3339[_0xd422('0x18')]=_0x91f3ac;if(_0x2d8181[_0xd422('0x2a')][_0xd422('0x3a')]){_0x2648aa['include']=[{'all':!![]}];}return db[_0xd422('0x25')][_0xd422('0x3b')](_0x2648aa);})[_0xd422('0x1f')](function(_0x5508d0){_0xcc3339[_0xd422('0x3c')]=_0x5508d0;return _0xcc3339;})[_0xd422('0x1f')](respondWithFilteredResult(_0x357138,_0x2648aa))['catch'](handleError(_0x357138,null));};exports['show']=function(_0x2d1009,_0x569d07){var _0x539140={'raw':![],'where':{'id':_0x2d1009[_0xd422('0x3d')]['id']}},_0x2c59cc={};_0x2c59cc['model']=_['keys'](db[_0xd422('0x25')][_0xd422('0x26')]);_0x2c59cc[_0xd422('0x2a')]=_[_0xd422('0x3e')](_0x2d1009[_0xd422('0x2a')]);_0x2c59cc[_0xd422('0x2b')]=_[_0xd422('0x2c')](_0x2c59cc[_0xd422('0x29')],_0x2c59cc[_0xd422('0x2a')]);_0x539140['attributes']=_[_0xd422('0x2c')](_0x2c59cc[_0xd422('0x29')],qs[_0xd422('0x2d')](_0x2d1009['query']['fields']));_0x539140[_0xd422('0x2e')]=_0x539140['attributes'][_0xd422('0x3f')]?_0x539140[_0xd422('0x2e')]:_0x2c59cc[_0xd422('0x29')];if(_0x2d1009[_0xd422('0x2a')]['includeAll']){_0x539140[_0xd422('0x40')]=[{'all':!![]}];}_0x539140=_[_0xd422('0x36')]({},_0x539140,_0x2d1009[_0xd422('0x39')]);return db['VoiceMusicOnHold'][_0xd422('0x41')](_0x539140)[_0xd422('0x1f')](handleEntityNotFound(_0x569d07,null))['then'](respondWithResult(_0x569d07,null))['catch'](handleError(_0x569d07,null));};exports[_0xd422('0x42')]=function(_0x350c66,_0x438829){if(_0x350c66[_0xd422('0x43')]['id']){delete _0x350c66['body']['id'];}return db[_0xd422('0x25')][_0xd422('0x41')]({'where':{'id':_0x350c66[_0xd422('0x3d')]['id']}})[_0xd422('0x1f')](handleEntityNotFound(_0x438829,null))[_0xd422('0x1f')](saveUpdates(_0x350c66[_0xd422('0x43')],null))[_0xd422('0x1f')](respondWithResult(_0x438829,null))['catch'](handleError(_0x438829,null));};exports[_0xd422('0x44')]=function(_0x2407a2,_0x5b3c34,_0x28c833){return db[_0xd422('0x45')][_0xd422('0x46')](function(_0x585803){if(_0x2407a2[_0xd422('0x43')][_0xd422('0x47')]===_0xd422('0x48')){_0x2407a2[_0xd422('0x43')]['directory']=path['join'](config[_0xd422('0x49')],'server/files/moh',_0x2407a2['body'][_0xd422('0x22')]);}return db[_0xd422('0x25')][_0xd422('0x44')](_0x2407a2[_0xd422('0x43')],{'transaction':_0x585803})[_0xd422('0x1f')](function(_0x259572){if(_0x2407a2[_0xd422('0x43')][_0xd422('0x47')]===_0xd422('0x48')){fs['mkdirSync'](_0x259572[_0xd422('0x4a')],parseInt(_0xd422('0x4b'),0x8));}var _0x4355cd=_0x2407a2['user'][_0xd422('0x1d')]({'plain':!![]});if(!_0x4355cd)throw new Error(_0xd422('0x4c'));if(_0x4355cd[_0xd422('0x4d')]===_0xd422('0x4e')){var _0x2b7304=_0x259572[_0xd422('0x1d')]({'plain':!![]});return db[_0xd422('0x4f')][_0xd422('0x41')]({'where':{'name':_0xd422('0x50'),'userProfileId':_0x4355cd[_0xd422('0x51')]},'raw':!![]})[_0xd422('0x1f')](function(_0x5503e8){if(_0x5503e8&&_0x5503e8['autoAssociation']===0x0){return db[_0xd422('0x52')][_0xd422('0x44')]({'name':_0x2b7304['name'],'resourceId':_0x2b7304['id'],'type':_0x5503e8[_0xd422('0x22')],'sectionId':_0x5503e8['id']},{})[_0xd422('0x1f')](function(){return _0x259572;});}else{return _0x259572;}})['catch'](function(_0x241fc0){logger[_0xd422('0x20')](_0xd422('0x53'),_0x241fc0);});}return _0x259572;});})[_0xd422('0x1f')](respondWithResult(_0x5b3c34,0xc9))[_0xd422('0x54')](handleError(_0x5b3c34,null));};exports[_0xd422('0x1e')]=function(_0x56cdd0,_0x4a6984,_0x59c074){var _0x3e6b09;return db[_0xd422('0x25')][_0xd422('0x41')]({'where':{'id':_0x56cdd0[_0xd422('0x3d')]['id']}})['then'](function(_0x14da13){if(_0x14da13){return db[_0xd422('0x45')]['transaction'](function(_0x1f6499){return _0x14da13[_0xd422('0x1e')]({'transaction':_0x1f6499,'raw':!![]})[_0xd422('0x1f')](function(_0x1f3328){if(_0x1f3328['directory']){fs[_0xd422('0x55')](_0x1f3328[_0xd422('0x4a')])[_0xd422('0x56')](function(_0x25fb76){fs[_0xd422('0x57')](path[_0xd422('0x58')](_0x1f3328[_0xd422('0x4a')],_0x25fb76));});fs['rmdirSync'](_0x1f3328[_0xd422('0x4a')]);}return _0x1f3328;});})['catch'](function(_0x2e5324){throw new db[(_0xd422('0x59'))]['ValidationError'](_0x2e5324[_0xd422('0x5a')]);});}})[_0xd422('0x1f')](handleEntityNotFound(_0x4a6984,null))[_0xd422('0x1f')](removeEntity(_0x4a6984,null))[_0xd422('0x54')](handleError(_0x4a6984,null));};exports[_0xd422('0x5b')]=function(_0x258fee,_0x301f6f,_0x9059b1){return db[_0xd422('0x45')][_0xd422('0x46')](function(_0x3a058c){var _0x38428d;return db[_0xd422('0x25')][_0xd422('0x41')]({'where':{'id':_0x258fee[_0xd422('0x3d')]['id']}})[_0xd422('0x1f')](function(_0x2c7551){if(_0x2c7551){_0x38428d=_0x2c7551;return _0x2c7551[_0xd422('0x5b')](_0x258fee[_0xd422('0x43')]['id'],{'transaction':_0x3a058c});}})[_0xd422('0x1f')](function(_0x54f3fb){if(_0x54f3fb){return db[_0xd422('0x5c')]['findOne']({'where':{'id':_0x258fee[_0xd422('0x43')]['id']},'attributes':['id',_0xd422('0x22'),'save_name','converted_format',_0xd422('0x5d')],'raw':!![]});}})[_0xd422('0x1f')](function(_0xab0de8){if(_0xab0de8){var _0x559cea=path[_0xd422('0x58')](config['root'],_0xd422('0x5e'),util['format'](_0xd422('0x5f'),path[_0xd422('0x60')](_0xab0de8[_0xd422('0x61')],path[_0xd422('0x62')](_0xab0de8['save_name'])),_0xab0de8[_0xd422('0x63')]));var _0x5ca530=path[_0xd422('0x58')](config[_0xd422('0x49')],'server/files/moh',_0x38428d[_0xd422('0x22')],util[_0xd422('0x64')](_0xd422('0x5f'),_0xab0de8[_0xd422('0x22')],_0xab0de8[_0xd422('0x63')]));fs[_0xd422('0x65')](_0x559cea,_0x5ca530);return _0xab0de8;}})['catch'](function(_0x374302){throw new db[(_0xd422('0x59'))][(_0xd422('0x66'))](_0x374302[_0xd422('0x5a')]);});})['then'](handleEntityNotFound(_0x301f6f,null))['then'](respondWithResult(_0x301f6f,0xc9))[_0xd422('0x54')](handleError(_0x301f6f,null));};exports[_0xd422('0x67')]=function(_0x208f59,_0x1d3e5d,_0x2b1cd1){return db[_0xd422('0x45')][_0xd422('0x46')](function(_0xe36d63){var _0x32c4b2;return db[_0xd422('0x25')][_0xd422('0x68')]({'where':{'id':_0x208f59[_0xd422('0x3d')]['id']}})[_0xd422('0x1f')](handleEntityNotFound(_0x1d3e5d,null))['then'](function(_0x702e3f){if(_0x702e3f){_0x32c4b2=_0x702e3f;return _0x702e3f[_0xd422('0x67')](_0x208f59[_0xd422('0x3d')]['id2']);}})[_0xd422('0x1f')](function(_0x312cb3){if(_0x312cb3){return db[_0xd422('0x5c')][_0xd422('0x68')]({'where':{'id':_0x208f59[_0xd422('0x3d')][_0xd422('0x69')]},'attributes':['id',_0xd422('0x22'),_0xd422('0x61'),_0xd422('0x63'),_0xd422('0x5d')],'raw':!![]});}})[_0xd422('0x1f')](function(_0x22fe28){if(_0x22fe28){fs[_0xd422('0x57')](path[_0xd422('0x58')](_0x32c4b2[_0xd422('0x4a')],util[_0xd422('0x64')](_0xd422('0x5f'),_0x22fe28[_0xd422('0x22')],_0x22fe28[_0xd422('0x63')])));return _0x22fe28;}})[_0xd422('0x54')](function(_0x37450c){throw new db['Sequelize']['ValidationError'](_0x37450c['message']);});})[_0xd422('0x1f')](handleEntityNotFound(_0x1d3e5d,null))[_0xd422('0x1f')](respondWithStatusCode(_0x1d3e5d,0xcc))[_0xd422('0x54')](handleError(_0x1d3e5d,null));};exports[_0xd422('0x6a')]=function(_0x921af5,_0xe2eca8,_0x594a02){var _0x31ab3a={};var _0x13ad94={};var _0x51e8f3;var _0x4cda02;return db['VoiceMusicOnHold'][_0xd422('0x68')]({'where':{'id':_0x921af5[_0xd422('0x3d')]['id']}})[_0xd422('0x1f')](handleEntityNotFound(_0xe2eca8,null))[_0xd422('0x1f')](function(_0x395826){if(_0x395826){_0x51e8f3=_0x395826;_0x13ad94[_0xd422('0x29')]=_[_0xd422('0x3e')](db[_0xd422('0x5c')]['rawAttributes']);_0x13ad94['query']=_['keys'](_0x921af5[_0xd422('0x2a')]);_0x13ad94['filters']=_[_0xd422('0x2c')](_0x13ad94[_0xd422('0x29')],_0x13ad94[_0xd422('0x2a')]);_0x31ab3a['attributes']=_[_0xd422('0x2c')](_0x13ad94[_0xd422('0x29')],qs[_0xd422('0x2d')](_0x921af5['query'][_0xd422('0x2d')]));_0x31ab3a[_0xd422('0x2e')]=_0x31ab3a[_0xd422('0x2e')]['length']?_0x31ab3a[_0xd422('0x2e')]:_0x13ad94[_0xd422('0x29')];_0x31ab3a[_0xd422('0x31')]=qs['sort'](_0x921af5[_0xd422('0x2a')]['sort']);_0x31ab3a[_0xd422('0x33')]=qs['filters'](_[_0xd422('0x34')](_0x921af5[_0xd422('0x2a')],_0x13ad94[_0xd422('0x2b')]));if(_0x921af5[_0xd422('0x2a')][_0xd422('0x35')]){_0x31ab3a[_0xd422('0x33')]=_[_0xd422('0x36')](_0x31ab3a[_0xd422('0x33')],{'$or':_['map'](_0x31ab3a[_0xd422('0x2e')],function(_0x508708){var _0x5c6f71={};_0x5c6f71[_0x508708]={'$like':'%'+_0x921af5[_0xd422('0x2a')][_0xd422('0x35')]+'%'};return _0x5c6f71;})});}_0x31ab3a=_[_0xd422('0x36')]({},_0x31ab3a,_0x921af5['options']);return _0x51e8f3[_0xd422('0x6a')](_0x31ab3a);}})[_0xd422('0x1f')](function(_0x5e12f8){if(_0x5e12f8){_0x4cda02=_0x5e12f8[_0xd422('0x3f')];if(!_0x921af5[_0xd422('0x2a')]['hasOwnProperty'](_0xd422('0x30'))){_0x31ab3a[_0xd422('0x1a')]=qs[_0xd422('0x1a')](_0x921af5[_0xd422('0x2a')][_0xd422('0x1a')]);_0x31ab3a[_0xd422('0x19')]=qs[_0xd422('0x19')](_0x921af5[_0xd422('0x2a')][_0xd422('0x19')]);}return _0x51e8f3['getSounds'](_0x31ab3a);}})[_0xd422('0x1f')](function(_0x110130){if(_0x110130){return _0x110130?{'count':_0x4cda02,'rows':_0x110130}:null;}})[_0xd422('0x1f')](respondWithResult(_0xe2eca8,null))[_0xd422('0x54')](handleError(_0xe2eca8,null));}; \ No newline at end of file +var _0x08cb=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','body','find','create','mode','files','directory','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','readdirSync','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','join','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','removeSound','id2','getSounds','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','name','send','map','VoiceMusicOnHold'];(function(_0x427001,_0x549755){var _0x406095=function(_0x32022b){while(--_0x32022b){_0x427001['push'](_0x427001['shift']());}};_0x406095(++_0x549755);}(_0x08cb,0x18f));var _0xb08c=function(_0x1f7772,_0xcb0069){_0x1f7772=_0x1f7772-0x0;var _0x151c54=_0x08cb[_0x1f7772];return _0x151c54;};'use strict';var pdf=require(_0xb08c('0x0'));var emlformat=require(_0xb08c('0x1'));var rimraf=require(_0xb08c('0x2'));var zipdir=require(_0xb08c('0x3'));var jsonpatch=require(_0xb08c('0x4'));var rp=require(_0xb08c('0x5'));var moment=require(_0xb08c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb08c('0x7'));var util=require(_0xb08c('0x8'));var path=require(_0xb08c('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb08c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb08c('0xb'));var crypto=require('crypto');var jsforce=require(_0xb08c('0xc'));var deskjs=require(_0xb08c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb08c('0xe'));var Papa=require(_0xb08c('0xf'));var Redis=require(_0xb08c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb08c('0x11'));var logger=require(_0xb08c('0x12'))(_0xb08c('0x13'));var utils=require(_0xb08c('0x14'));var config=require(_0xb08c('0x15'));var db=require(_0xb08c('0x16'))['db'];function respondWithStatusCode(_0x1d4457,_0x1feebf){_0x1feebf=_0x1feebf||0xcc;return function(_0x2e7bb4){if(_0x2e7bb4){return _0x1d4457['sendStatus'](_0x1feebf);}return _0x1d4457[_0xb08c('0x17')](_0x1feebf)[_0xb08c('0x18')]();};}function respondWithResult(_0xbf70f9,_0x216f2c){_0x216f2c=_0x216f2c||0xc8;return function(_0x4fa134){if(_0x4fa134){return _0xbf70f9[_0xb08c('0x17')](_0x216f2c)[_0xb08c('0x19')](_0x4fa134);}};}function respondWithFilteredResult(_0x36184c,_0x354768){return function(_0x3ae9e4){if(_0x3ae9e4){var _0x5b4ba3=_0x3ae9e4[_0xb08c('0x1a')],_0x2d3277=_0x354768[_0xb08c('0x1b')],_0x47afef=_0x354768[_0xb08c('0x1b')]+_0x354768[_0xb08c('0x1c')],_0x1d5b4c;if(_0x47afef>=_0x5b4ba3){_0x47afef=_0x5b4ba3;_0x1d5b4c=0xc8;}else{_0x1d5b4c=0xce;}_0x36184c[_0xb08c('0x17')](_0x1d5b4c);return _0x36184c[_0xb08c('0x1d')]('Content-Range',_0x2d3277+'-'+_0x47afef+'/'+_0x5b4ba3)['json'](_0x3ae9e4);}return null;};}function patchUpdates(_0x34455d){return function(_0xc0b815){try{jsonpatch[_0xb08c('0x1e')](_0xc0b815,_0x34455d,!![]);}catch(_0x4da208){return BPromise[_0xb08c('0x1f')](_0x4da208);}return _0xc0b815[_0xb08c('0x20')]();};}function saveUpdates(_0x330377,_0x1e728b){return function(_0x11a322){if(_0x11a322){return _0x11a322[_0xb08c('0x21')](_0x330377)[_0xb08c('0x22')](function(_0x44b2d2){return _0x44b2d2;});}return null;};}function removeEntity(_0x26e44b,_0x450dc9){return function(_0x4529f5){if(_0x4529f5){return _0x4529f5[_0xb08c('0x23')]()[_0xb08c('0x22')](function(){var _0x108132=_0x4529f5[_0xb08c('0x24')]({'plain':!![]});var _0xe44a38=_0xb08c('0x25');return db[_0xb08c('0x26')][_0xb08c('0x23')]({'where':{'type':_0xe44a38,'resourceId':_0x108132['id']}})[_0xb08c('0x22')](function(){return _0x4529f5;});})[_0xb08c('0x22')](function(){_0x26e44b[_0xb08c('0x17')](0xcc)[_0xb08c('0x18')]();});}};}function handleEntityNotFound(_0x1d8841,_0x4be5b3){return function(_0x297c0a){if(!_0x297c0a){_0x1d8841[_0xb08c('0x27')](0x194);}return _0x297c0a;};}function handleError(_0x52ff06,_0x2b2b90){_0x2b2b90=_0x2b2b90||0x1f4;return function(_0x3a1e37){logger[_0xb08c('0x28')](_0x3a1e37['stack']);if(_0x3a1e37[_0xb08c('0x29')]){delete _0x3a1e37[_0xb08c('0x29')];}_0x52ff06[_0xb08c('0x17')](_0x2b2b90)[_0xb08c('0x2a')](_0x3a1e37);};}exports['index']=function(_0x19e6e6,_0x37d638){var _0x272e84={},_0x1a075f={},_0x4c54a8={'count':0x0,'rows':[]};var _0x2c501d=_[_0xb08c('0x2b')](db[_0xb08c('0x2c')][_0xb08c('0x2d')],function(_0x276a42){return{'name':_0x276a42[_0xb08c('0x2e')],'type':_0x276a42[_0xb08c('0x2f')][_0xb08c('0x30')]};});_0x1a075f[_0xb08c('0x31')]=_[_0xb08c('0x2b')](_0x2c501d,_0xb08c('0x29'));_0x1a075f[_0xb08c('0x32')]=_[_0xb08c('0x33')](_0x19e6e6[_0xb08c('0x32')]);_0x1a075f[_0xb08c('0x34')]=_[_0xb08c('0x35')](_0x1a075f[_0xb08c('0x31')],_0x1a075f[_0xb08c('0x32')]);_0x272e84[_0xb08c('0x36')]=_[_0xb08c('0x35')](_0x1a075f[_0xb08c('0x31')],qs[_0xb08c('0x37')](_0x19e6e6[_0xb08c('0x32')]['fields']));_0x272e84[_0xb08c('0x36')]=_0x272e84[_0xb08c('0x36')][_0xb08c('0x38')]?_0x272e84['attributes']:_0x1a075f[_0xb08c('0x31')];if(!_0x19e6e6[_0xb08c('0x32')][_0xb08c('0x39')](_0xb08c('0x3a'))){_0x272e84['limit']=qs[_0xb08c('0x1c')](_0x19e6e6[_0xb08c('0x32')][_0xb08c('0x1c')]);_0x272e84[_0xb08c('0x1b')]=qs[_0xb08c('0x1b')](_0x19e6e6['query'][_0xb08c('0x1b')]);}_0x272e84[_0xb08c('0x3b')]=qs[_0xb08c('0x3c')](_0x19e6e6[_0xb08c('0x32')]['sort']);_0x272e84[_0xb08c('0x3d')]=qs[_0xb08c('0x34')](_[_0xb08c('0x3e')](_0x19e6e6[_0xb08c('0x32')],_0x1a075f[_0xb08c('0x34')]));if(_0x19e6e6['query'][_0xb08c('0x3f')]){_0x272e84[_0xb08c('0x3d')]=_[_0xb08c('0x40')](_0x272e84['where'],{'$or':_['map'](_0x2c501d,function(_0x5852ea){if(_0x5852ea[_0xb08c('0x2f')]!=='VIRTUAL'){var _0x40f72d={};_0x40f72d[_0x5852ea[_0xb08c('0x29')]]={'$like':'%'+_0x19e6e6[_0xb08c('0x32')]['filter']+'%'};return _0x40f72d;}})});}_0x272e84=_['merge']({},_0x272e84,_0x19e6e6[_0xb08c('0x41')]);var _0x2c9cfc={'where':_0x272e84['where']};return db[_0xb08c('0x2c')][_0xb08c('0x1a')](_0x2c9cfc)[_0xb08c('0x22')](function(_0x439ccb){_0x4c54a8[_0xb08c('0x1a')]=_0x439ccb;if(_0x19e6e6['query'][_0xb08c('0x42')]){_0x272e84[_0xb08c('0x43')]=[{'all':!![]}];}return db[_0xb08c('0x2c')][_0xb08c('0x44')](_0x272e84);})[_0xb08c('0x22')](function(_0x321f97){_0x4c54a8['rows']=_0x321f97;return _0x4c54a8;})[_0xb08c('0x22')](respondWithFilteredResult(_0x37d638,_0x272e84))[_0xb08c('0x45')](handleError(_0x37d638,null));};exports[_0xb08c('0x46')]=function(_0x285e46,_0x52c944){var _0x56bfd8={'raw':![],'where':{'id':_0x285e46[_0xb08c('0x47')]['id']}},_0x4eb6a1={};_0x4eb6a1[_0xb08c('0x31')]=_['keys'](db[_0xb08c('0x2c')][_0xb08c('0x2d')]);_0x4eb6a1['query']=_['keys'](_0x285e46['query']);_0x4eb6a1[_0xb08c('0x34')]=_[_0xb08c('0x35')](_0x4eb6a1[_0xb08c('0x31')],_0x4eb6a1['query']);_0x56bfd8[_0xb08c('0x36')]=_[_0xb08c('0x35')](_0x4eb6a1[_0xb08c('0x31')],qs[_0xb08c('0x37')](_0x285e46['query'][_0xb08c('0x37')]));_0x56bfd8[_0xb08c('0x36')]=_0x56bfd8[_0xb08c('0x36')][_0xb08c('0x38')]?_0x56bfd8[_0xb08c('0x36')]:_0x4eb6a1[_0xb08c('0x31')];if(_0x285e46[_0xb08c('0x32')][_0xb08c('0x42')]){_0x56bfd8['include']=[{'all':!![]}];}_0x56bfd8=_[_0xb08c('0x40')]({},_0x56bfd8,_0x285e46[_0xb08c('0x41')]);return db[_0xb08c('0x2c')]['find'](_0x56bfd8)[_0xb08c('0x22')](handleEntityNotFound(_0x52c944,null))[_0xb08c('0x22')](respondWithResult(_0x52c944,null))[_0xb08c('0x45')](handleError(_0x52c944,null));};exports[_0xb08c('0x21')]=function(_0x249133,_0x1e2c74){if(_0x249133[_0xb08c('0x48')]['id']){delete _0x249133['body']['id'];}return db['VoiceMusicOnHold'][_0xb08c('0x49')]({'where':{'id':_0x249133[_0xb08c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e2c74,null))[_0xb08c('0x22')](saveUpdates(_0x249133[_0xb08c('0x48')],null))[_0xb08c('0x22')](respondWithResult(_0x1e2c74,null))[_0xb08c('0x45')](handleError(_0x1e2c74,null));};exports[_0xb08c('0x4a')]=function(_0x2cd21d,_0x483610,_0x19b28d){return db['sequelize']['transaction'](function(_0x2232e4){if(_0x2cd21d[_0xb08c('0x48')][_0xb08c('0x4b')]===_0xb08c('0x4c')){_0x2cd21d[_0xb08c('0x48')][_0xb08c('0x4d')]=path['join'](config[_0xb08c('0x4e')],_0xb08c('0x4f'),_0x2cd21d['body'][_0xb08c('0x29')]);}return db[_0xb08c('0x2c')][_0xb08c('0x4a')](_0x2cd21d[_0xb08c('0x48')],{'transaction':_0x2232e4})[_0xb08c('0x22')](function(_0x1041fa){if(_0x2cd21d[_0xb08c('0x48')][_0xb08c('0x4b')]===_0xb08c('0x4c')){fs[_0xb08c('0x50')](_0x1041fa[_0xb08c('0x4d')],parseInt(_0xb08c('0x51'),0x8));}var _0x48c437=_0x2cd21d[_0xb08c('0x52')][_0xb08c('0x24')]({'plain':!![]});if(!_0x48c437)throw new Error(_0xb08c('0x53'));if(_0x48c437['role']===_0xb08c('0x52')){var _0xfde97b=_0x1041fa['get']({'plain':!![]});return db[_0xb08c('0x54')][_0xb08c('0x49')]({'where':{'name':_0xb08c('0x25'),'userProfileId':_0x48c437[_0xb08c('0x55')]},'raw':!![]})['then'](function(_0x265ef5){if(_0x265ef5&&_0x265ef5[_0xb08c('0x56')]===0x0){return db[_0xb08c('0x26')][_0xb08c('0x4a')]({'name':_0xfde97b['name'],'resourceId':_0xfde97b['id'],'type':_0x265ef5[_0xb08c('0x29')],'sectionId':_0x265ef5['id']},{})[_0xb08c('0x22')](function(){return _0x1041fa;});}else{return _0x1041fa;}})[_0xb08c('0x45')](function(_0x1a96e7){logger[_0xb08c('0x28')](_0xb08c('0x57'),_0x1a96e7);});}return _0x1041fa;});})[_0xb08c('0x22')](respondWithResult(_0x483610,0xc9))['catch'](handleError(_0x483610,null));};exports[_0xb08c('0x23')]=function(_0x156320,_0x2ab3a7,_0x371fba){var _0xa617b6;return db[_0xb08c('0x2c')][_0xb08c('0x49')]({'where':{'id':_0x156320[_0xb08c('0x47')]['id']}})['then'](function(_0x4398f6){if(_0x4398f6){return db[_0xb08c('0x58')][_0xb08c('0x59')](function(_0x45592){return _0x4398f6[_0xb08c('0x23')]({'transaction':_0x45592,'raw':!![]})[_0xb08c('0x22')](function(_0x283832){if(_0x283832[_0xb08c('0x4d')]){fs[_0xb08c('0x5a')](_0x283832[_0xb08c('0x4d')])['forEach'](function(_0x2465ff){fs[_0xb08c('0x5b')](path['join'](_0x283832['directory'],_0x2465ff));});fs['rmdirSync'](_0x283832['directory']);}return _0x283832;});})[_0xb08c('0x45')](function(_0x206df4){throw new db[(_0xb08c('0x5c'))][(_0xb08c('0x5d'))](_0x206df4[_0xb08c('0x5e')]);});}})['then'](handleEntityNotFound(_0x2ab3a7,null))[_0xb08c('0x22')](removeEntity(_0x2ab3a7,null))[_0xb08c('0x45')](handleError(_0x2ab3a7,null));};exports['addSound']=function(_0x34e699,_0x3356d7,_0x3e8613){return db[_0xb08c('0x58')][_0xb08c('0x59')](function(_0x550628){var _0x253800;return db[_0xb08c('0x2c')][_0xb08c('0x49')]({'where':{'id':_0x34e699[_0xb08c('0x47')]['id']}})[_0xb08c('0x22')](function(_0x3a2d49){if(_0x3a2d49){_0x253800=_0x3a2d49;return _0x3a2d49[_0xb08c('0x5f')](_0x34e699[_0xb08c('0x48')]['id'],{'transaction':_0x550628});}})['then'](function(_0x51020c){if(_0x51020c){return db[_0xb08c('0x60')][_0xb08c('0x61')]({'where':{'id':_0x34e699['body']['id']},'attributes':['id',_0xb08c('0x29'),_0xb08c('0x62'),'converted_format',_0xb08c('0x63')],'raw':!![]});}})[_0xb08c('0x22')](function(_0x7c310a){if(_0x7c310a){var _0x2ec418=path[_0xb08c('0x64')](config[_0xb08c('0x4e')],_0xb08c('0x65'),util[_0xb08c('0x66')](_0xb08c('0x67'),path[_0xb08c('0x68')](_0x7c310a[_0xb08c('0x62')],path[_0xb08c('0x69')](_0x7c310a['save_name'])),_0x7c310a['converted_format']));var _0x4eadb9=path[_0xb08c('0x64')](config[_0xb08c('0x4e')],'server/files/moh',_0x253800[_0xb08c('0x29')],util['format'](_0xb08c('0x67'),_0x7c310a[_0xb08c('0x29')],_0x7c310a[_0xb08c('0x6a')]));fs[_0xb08c('0x6b')](_0x2ec418,_0x4eadb9);return _0x7c310a;}})[_0xb08c('0x45')](function(_0x136d06){throw new db[(_0xb08c('0x5c'))][(_0xb08c('0x5d'))](_0x136d06[_0xb08c('0x5e')]);});})['then'](handleEntityNotFound(_0x3356d7,null))['then'](respondWithResult(_0x3356d7,0xc9))[_0xb08c('0x45')](handleError(_0x3356d7,null));};exports[_0xb08c('0x6c')]=function(_0xa51fab,_0x1f97da,_0x3ae5fd){return db[_0xb08c('0x58')][_0xb08c('0x59')](function(_0x5c6c8e){var _0x20fa16;return db[_0xb08c('0x2c')][_0xb08c('0x61')]({'where':{'id':_0xa51fab['params']['id']}})['then'](handleEntityNotFound(_0x1f97da,null))[_0xb08c('0x22')](function(_0xdde1db){if(_0xdde1db){_0x20fa16=_0xdde1db;return _0xdde1db[_0xb08c('0x6c')](_0xa51fab[_0xb08c('0x47')][_0xb08c('0x6d')]);}})['then'](function(_0x3337ad){if(_0x3337ad){return db[_0xb08c('0x60')]['findOne']({'where':{'id':_0xa51fab[_0xb08c('0x47')][_0xb08c('0x6d')]},'attributes':['id',_0xb08c('0x29'),_0xb08c('0x62'),_0xb08c('0x6a'),_0xb08c('0x63')],'raw':!![]});}})['then'](function(_0x4afb72){if(_0x4afb72){fs['unlinkSync'](path['join'](_0x20fa16['directory'],util[_0xb08c('0x66')]('%s.%s',_0x4afb72[_0xb08c('0x29')],_0x4afb72[_0xb08c('0x6a')])));return _0x4afb72;}})[_0xb08c('0x45')](function(_0x52c762){throw new db[(_0xb08c('0x5c'))][(_0xb08c('0x5d'))](_0x52c762['message']);});})[_0xb08c('0x22')](handleEntityNotFound(_0x1f97da,null))['then'](respondWithStatusCode(_0x1f97da,0xcc))['catch'](handleError(_0x1f97da,null));};exports[_0xb08c('0x6e')]=function(_0x1619aa,_0x24ee6e,_0x2d8bfc){var _0x38a5ab={};var _0x177a9f={};var _0x48ba17;var _0x28ce3b;return db['VoiceMusicOnHold'][_0xb08c('0x61')]({'where':{'id':_0x1619aa['params']['id']}})['then'](handleEntityNotFound(_0x24ee6e,null))[_0xb08c('0x22')](function(_0x21d2dc){if(_0x21d2dc){_0x48ba17=_0x21d2dc;_0x177a9f['model']=_[_0xb08c('0x33')](db[_0xb08c('0x60')]['rawAttributes']);_0x177a9f['query']=_[_0xb08c('0x33')](_0x1619aa[_0xb08c('0x32')]);_0x177a9f[_0xb08c('0x34')]=_[_0xb08c('0x35')](_0x177a9f[_0xb08c('0x31')],_0x177a9f[_0xb08c('0x32')]);_0x38a5ab[_0xb08c('0x36')]=_[_0xb08c('0x35')](_0x177a9f[_0xb08c('0x31')],qs[_0xb08c('0x37')](_0x1619aa['query'][_0xb08c('0x37')]));_0x38a5ab[_0xb08c('0x36')]=_0x38a5ab[_0xb08c('0x36')][_0xb08c('0x38')]?_0x38a5ab['attributes']:_0x177a9f[_0xb08c('0x31')];_0x38a5ab['order']=qs[_0xb08c('0x3c')](_0x1619aa[_0xb08c('0x32')]['sort']);_0x38a5ab[_0xb08c('0x3d')]=qs[_0xb08c('0x34')](_[_0xb08c('0x3e')](_0x1619aa[_0xb08c('0x32')],_0x177a9f[_0xb08c('0x34')]));if(_0x1619aa[_0xb08c('0x32')][_0xb08c('0x3f')]){_0x38a5ab[_0xb08c('0x3d')]=_[_0xb08c('0x40')](_0x38a5ab[_0xb08c('0x3d')],{'$or':_[_0xb08c('0x2b')](_0x38a5ab[_0xb08c('0x36')],function(_0x18fc9f){var _0x285919={};_0x285919[_0x18fc9f]={'$like':'%'+_0x1619aa[_0xb08c('0x32')][_0xb08c('0x3f')]+'%'};return _0x285919;})});}_0x38a5ab=_['merge']({},_0x38a5ab,_0x1619aa[_0xb08c('0x41')]);return _0x48ba17[_0xb08c('0x6e')](_0x38a5ab);}})['then'](function(_0x30ba2a){if(_0x30ba2a){_0x28ce3b=_0x30ba2a[_0xb08c('0x38')];if(!_0x1619aa[_0xb08c('0x32')]['hasOwnProperty']('nolimit')){_0x38a5ab[_0xb08c('0x1c')]=qs[_0xb08c('0x1c')](_0x1619aa['query'][_0xb08c('0x1c')]);_0x38a5ab[_0xb08c('0x1b')]=qs[_0xb08c('0x1b')](_0x1619aa[_0xb08c('0x32')][_0xb08c('0x1b')]);}return _0x48ba17[_0xb08c('0x6e')](_0x38a5ab);}})['then'](function(_0x16016f){if(_0x16016f){return _0x16016f?{'count':_0x28ce3b,'rows':_0x16016f}:null;}})[_0xb08c('0x22')](respondWithResult(_0x24ee6e,null))[_0xb08c('0x45')](handleError(_0x24ee6e,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 1af8931..14df2f7 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 _0x9a75=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0x3ff21c,_0x57d865){var _0x1f3895=function(_0xa7c873){while(--_0xa7c873){_0x3ff21c['push'](_0x3ff21c['shift']());}};_0x1f3895(++_0x57d865);}(_0x9a75,0x14f));var _0x59a7=function(_0xbede59,_0x181fe8){_0xbede59=_0xbede59-0x0;var _0x4ae89f=_0x9a75[_0xbede59];return _0x4ae89f;};'use strict';var _=require(_0x59a7('0x0'));var util=require(_0x59a7('0x1'));var logger=require(_0x59a7('0x2'))(_0x59a7('0x3'));var moment=require(_0x59a7('0x4'));var BPromise=require(_0x59a7('0x5'));var rp=require(_0x59a7('0x6'));var fs=require('fs');var path=require(_0x59a7('0x7'));var rimraf=require(_0x59a7('0x8'));var config=require(_0x59a7('0x9'));var attributes=require(_0x59a7('0xa'));module[_0x59a7('0xb')]=function(_0x5e997e,_0x325363){return _0x5e997e['define'](_0x59a7('0xc'),attributes,{'tableName':_0x59a7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff9e=['voice_musiconhold','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0xff9e,0x194));var _0xeff9=function(_0x388169,_0x1e572a){_0x388169=_0x388169-0x0;var _0x1673ec=_0xff9e[_0x388169];return _0x1673ec;};'use strict';var _=require(_0xeff9('0x0'));var util=require(_0xeff9('0x1'));var logger=require('../../config/logger')(_0xeff9('0x2'));var moment=require(_0xeff9('0x3'));var BPromise=require(_0xeff9('0x4'));var rp=require(_0xeff9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeff9('0x6'));var config=require(_0xeff9('0x7'));var attributes=require(_0xeff9('0x8'));module[_0xeff9('0x9')]=function(_0x1b2c40,_0x230050){return _0x1b2c40[_0xeff9('0xa')](_0xeff9('0xb'),attributes,{'tableName':_0xeff9('0xc'),'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 0e27257..69f36f4 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 _0x7d31=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../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','message','result'];(function(_0x494688,_0x462862){var _0x9528e1=function(_0x262479){while(--_0x262479){_0x494688['push'](_0x494688['shift']());}};_0x9528e1(++_0x462862);}(_0x7d31,0x168));var _0x17d3=function(_0x5af673,_0x4b6254){_0x5af673=_0x5af673-0x0;var _0x42f51b=_0x7d31[_0x5af673];return _0x42f51b;};'use strict';var _=require(_0x17d3('0x0'));var util=require(_0x17d3('0x1'));var moment=require(_0x17d3('0x2'));var BPromise=require(_0x17d3('0x3'));var rs=require(_0x17d3('0x4'));var fs=require('fs');var Redis=require(_0x17d3('0x5'));var db=require(_0x17d3('0x6'))['db'];var utils=require(_0x17d3('0x7'));var logger=require(_0x17d3('0x8'))(_0x17d3('0x9'));var config=require(_0x17d3('0xa'));var jayson=require(_0x17d3('0xb'));var client=jayson[_0x17d3('0xc')][_0x17d3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x39ce9e,_0x312a32,_0x378adb){return new BPromise(function(_0x4dbe06,_0x28f377){return client[_0x17d3('0xe')](_0x39ce9e,_0x378adb)['then'](function(_0x49e244){logger[_0x17d3('0xf')](_0x17d3('0x10'),_0x312a32,_0x17d3('0x11'));logger[_0x17d3('0x12')](_0x17d3('0x13'),_0x312a32,_0x17d3('0x11'),JSON[_0x17d3('0x14')](_0x49e244));if(_0x49e244['error']){if(_0x49e244[_0x17d3('0x15')]['code']===0x1f4){logger[_0x17d3('0x15')](_0x17d3('0x10'),_0x312a32,_0x49e244[_0x17d3('0x15')][_0x17d3('0x16')]);return _0x28f377(_0x49e244[_0x17d3('0x15')]['message']);}logger[_0x17d3('0x15')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x312a32,_0x49e244[_0x17d3('0x15')][_0x17d3('0x16')]);return _0x4dbe06(_0x49e244[_0x17d3('0x15')][_0x17d3('0x16')]);}else{logger[_0x17d3('0xf')](_0x17d3('0x10'),_0x312a32,_0x17d3('0x11'));_0x4dbe06(_0x49e244[_0x17d3('0x17')][_0x17d3('0x16')]);}})['catch'](function(_0x495cc2){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x312a32,_0x495cc2);_0x28f377(_0x495cc2);});});} \ No newline at end of file +var _0xdd03=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','moment','bluebird','ioredis'];(function(_0x1442eb,_0x19951e){var _0x5c31ea=function(_0xcc03b8){while(--_0xcc03b8){_0x1442eb['push'](_0x1442eb['shift']());}};_0x5c31ea(++_0x19951e);}(_0xdd03,0x18b));var _0x3dd0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdd03[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x3dd0('0x0'));var moment=require(_0x3dd0('0x1'));var BPromise=require(_0x3dd0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3dd0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3dd0('0x4'));var logger=require(_0x3dd0('0x5'))('rpc');var config=require(_0x3dd0('0x6'));var jayson=require(_0x3dd0('0x7'));var client=jayson[_0x3dd0('0x8')][_0x3dd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1843f1,_0x1f1a18,_0x1e676b){return new BPromise(function(_0x10e627,_0x19f84d){return client[_0x3dd0('0xa')](_0x1843f1,_0x1e676b)[_0x3dd0('0xb')](function(_0x589d6e){logger[_0x3dd0('0xc')](_0x3dd0('0xd'),_0x1f1a18,'request\x20sent');logger[_0x3dd0('0xe')](_0x3dd0('0xf'),_0x1f1a18,_0x3dd0('0x10'),JSON['stringify'](_0x589d6e));if(_0x589d6e['error']){if(_0x589d6e[_0x3dd0('0x11')][_0x3dd0('0x12')]===0x1f4){logger[_0x3dd0('0x11')](_0x3dd0('0xd'),_0x1f1a18,_0x589d6e['error'][_0x3dd0('0x13')]);return _0x19f84d(_0x589d6e[_0x3dd0('0x11')][_0x3dd0('0x13')]);}logger['error'](_0x3dd0('0xd'),_0x1f1a18,_0x589d6e[_0x3dd0('0x11')][_0x3dd0('0x13')]);return _0x10e627(_0x589d6e[_0x3dd0('0x11')][_0x3dd0('0x13')]);}else{logger[_0x3dd0('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x1f1a18,_0x3dd0('0x10'));_0x10e627(_0x589d6e[_0x3dd0('0x14')]['message']);}})['catch'](function(_0x5e1ab0){logger[_0x3dd0('0x11')](_0x3dd0('0xd'),_0x1f1a18,_0x5e1ab0);_0x19f84d(_0x5e1ab0);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 49437ee..30504a2 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 _0x1ce1=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents','post','create','put','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout'];(function(_0x477340,_0x496046){var _0x24dee4=function(_0x342a9e){while(--_0x342a9e){_0x477340['push'](_0x477340['shift']());}};_0x24dee4(++_0x496046);}(_0x1ce1,0x105));var _0x11ce=function(_0x48bbd8,_0x1514d8){_0x48bbd8=_0x48bbd8-0x0;var _0x372eae=_0x1ce1[_0x48bbd8];return _0x372eae;};'use strict';var multer=require(_0x11ce('0x0'));var util=require('util');var path=require(_0x11ce('0x1'));var timeout=require(_0x11ce('0x2'));var express=require(_0x11ce('0x3'));var router=express[_0x11ce('0x4')]();var auth=require(_0x11ce('0x5'));var interaction=require(_0x11ce('0x6'));var config=require(_0x11ce('0x7'));var controller=require('./voicePrefix.controller');router[_0x11ce('0x8')]('/',auth[_0x11ce('0x9')](),controller[_0x11ce('0xa')]);router[_0x11ce('0x8')]('/describe',auth[_0x11ce('0x9')](),controller[_0x11ce('0xb')]);router[_0x11ce('0x8')](_0x11ce('0xc'),auth[_0x11ce('0x9')](),controller[_0x11ce('0xd')]);router[_0x11ce('0x8')](_0x11ce('0xe'),auth[_0x11ce('0x9')](),controller[_0x11ce('0xf')]);router[_0x11ce('0x10')]('/',auth[_0x11ce('0x9')](),controller[_0x11ce('0x11')]);router[_0x11ce('0x10')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x11ce('0x12')]('/:id',auth[_0x11ce('0x9')](),controller[_0x11ce('0x13')]);router[_0x11ce('0x14')](_0x11ce('0xc'),auth[_0x11ce('0x9')](),controller[_0x11ce('0x15')]);router[_0x11ce('0x14')]('/:id/users',auth[_0x11ce('0x9')](),controller[_0x11ce('0x16')]);module[_0x11ce('0x17')]=router; \ No newline at end of file +var _0xa32f=['index','/describe','/:id','show','/:id/users','getAgents','post','create','update','delete','removeAgents','exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated'];(function(_0x10c507,_0x3153d1){var _0x4bd358=function(_0x49288a){while(--_0x49288a){_0x10c507['push'](_0x10c507['shift']());}};_0x4bd358(++_0x3153d1);}(_0xa32f,0x19c));var _0xfa32=function(_0x3e0c70,_0x27653d){_0x3e0c70=_0x3e0c70-0x0;var _0x19a245=_0xa32f[_0x3e0c70];return _0x19a245;};'use strict';var multer=require(_0xfa32('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfa32('0x1'));var router=express['Router']();var auth=require(_0xfa32('0x2'));var interaction=require(_0xfa32('0x3'));var config=require(_0xfa32('0x4'));var controller=require(_0xfa32('0x5'));router[_0xfa32('0x6')]('/',auth[_0xfa32('0x7')](),controller[_0xfa32('0x8')]);router[_0xfa32('0x6')](_0xfa32('0x9'),auth[_0xfa32('0x7')](),controller['describe']);router[_0xfa32('0x6')](_0xfa32('0xa'),auth[_0xfa32('0x7')](),controller[_0xfa32('0xb')]);router[_0xfa32('0x6')](_0xfa32('0xc'),auth[_0xfa32('0x7')](),controller[_0xfa32('0xd')]);router[_0xfa32('0xe')]('/',auth[_0xfa32('0x7')](),controller[_0xfa32('0xf')]);router[_0xfa32('0xe')](_0xfa32('0xc'),auth[_0xfa32('0x7')](),controller['addAgents']);router['put']('/:id',auth[_0xfa32('0x7')](),controller[_0xfa32('0x10')]);router[_0xfa32('0x11')](_0xfa32('0xa'),auth[_0xfa32('0x7')](),controller['destroy']);router[_0xfa32('0x11')](_0xfa32('0xc'),auth[_0xfa32('0x7')](),controller[_0xfa32('0x12')]);module[_0xfa32('0x13')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 2db1b8a..9b20a04 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 _0x5dbc=['sequelize','exports','STRING','name','VIRTUAL','getDataValue'];(function(_0x143157,_0x1a87e1){var _0x4b2e8d=function(_0x348c73){while(--_0x348c73){_0x143157['push'](_0x143157['shift']());}};_0x4b2e8d(++_0x1a87e1);}(_0x5dbc,0x162));var _0xc5db=function(_0x3343f1,_0x420049){_0x3343f1=_0x3343f1-0x0;var _0x4bfe55=_0x5dbc[_0x3343f1];return _0x4bfe55;};'use strict';var Sequelize=require(_0xc5db('0x0'));module[_0xc5db('0x1')]={'name':{'type':Sequelize[_0xc5db('0x2')],'allowNull':![],'unique':_0xc5db('0x3')},'prefix':{'type':Sequelize[_0xc5db('0x4')],'get':function(_0x195e00){return'system-'+this[_0xc5db('0x5')](_0xc5db('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xc5db('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xc2e4=['name','INTEGER','sequelize','STRING','VIRTUAL','system-'];(function(_0x13fbf5,_0x27f5f6){var _0x121d4c=function(_0x385af7){while(--_0x385af7){_0x13fbf5['push'](_0x13fbf5['shift']());}};_0x121d4c(++_0x27f5f6);}(_0xc2e4,0x6e));var _0x4c2e=function(_0x29bf1d,_0x621bd2){_0x29bf1d=_0x29bf1d-0x0;var _0x38edec=_0xc2e4[_0x29bf1d];return _0x38edec;};'use strict';var Sequelize=require(_0x4c2e('0x0'));module['exports']={'name':{'type':Sequelize[_0x4c2e('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x4c2e('0x2')],'get':function(_0xdd4e0d){return _0x4c2e('0x3')+this['getDataValue'](_0x4c2e('0x4'))+'-';}},'description':{'type':Sequelize[_0x4c2e('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x4c2e('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 793f9ae..dfe4978 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 _0xfa1e=['query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','options','VoicePrefix','count','includeAll','include','findAll','show','params','keys','find','catch','describe','sequelize','transaction','create','body','VoiceExtensionId','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','User','getAgents','hasOwnProperty','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','json','offset','limit','set','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','name','send','rawAttributes','fieldName','type','key','model','map'];(function(_0x2113e4,_0x264f7b){var _0x3db351=function(_0x12aa6a){while(--_0x12aa6a){_0x2113e4['push'](_0x2113e4['shift']());}};_0x3db351(++_0x264f7b);}(_0xfa1e,0x137));var _0xefa1=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xfa1e[_0x2160a9];return _0xa88cf7;};'use strict';var pdf=require(_0xefa1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xefa1('0x1'));var jsonpatch=require(_0xefa1('0x2'));var rp=require(_0xefa1('0x3'));var moment=require(_0xefa1('0x4'));var BPromise=require(_0xefa1('0x5'));var Mustache=require(_0xefa1('0x6'));var util=require(_0xefa1('0x7'));var path=require(_0xefa1('0x8'));var sox=require(_0xefa1('0x9'));var csv=require(_0xefa1('0xa'));var ejs=require(_0xefa1('0xb'));var fs=require('fs');var _=require(_0xefa1('0xc'));var squel=require('squel');var crypto=require(_0xefa1('0xd'));var jsforce=require(_0xefa1('0xe'));var deskjs=require(_0xefa1('0xf'));var toCsv=require(_0xefa1('0xa'));var querystring=require('querystring');var Papa=require(_0xefa1('0x10'));var Redis=require('ioredis');var authService=require(_0xefa1('0x11'));var qs=require(_0xefa1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefa1('0x13'));var logger=require(_0xefa1('0x14'))('api');var utils=require(_0xefa1('0x15'));var config=require(_0xefa1('0x16'));var db=require(_0xefa1('0x17'))['db'];config[_0xefa1('0x18')]=_[_0xefa1('0x19')](config[_0xefa1('0x18')],{'host':_0xefa1('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xefa1('0x18')]));require(_0xefa1('0x1b'))[_0xefa1('0x1c')](socket);function respondWithStatusCode(_0x5bbabd,_0x8cea1c){_0x8cea1c=_0x8cea1c||0xcc;return function(_0x7292ec){if(_0x7292ec){return _0x5bbabd[_0xefa1('0x1d')](_0x8cea1c);}return _0x5bbabd[_0xefa1('0x1e')](_0x8cea1c)['end']();};}function respondWithResult(_0x47dc27,_0x3c6763){_0x3c6763=_0x3c6763||0xc8;return function(_0xa09b2b){if(_0xa09b2b){return _0x47dc27[_0xefa1('0x1e')](_0x3c6763)[_0xefa1('0x1f')](_0xa09b2b);}};}function respondWithFilteredResult(_0x1d9b26,_0x394e3f){return function(_0x43f9c9){if(_0x43f9c9){var _0x39bfab=_0x43f9c9['count'],_0x5a1d71=_0x394e3f[_0xefa1('0x20')],_0x143f25=_0x394e3f['offset']+_0x394e3f[_0xefa1('0x21')],_0x59c6e2;if(_0x143f25>=_0x39bfab){_0x143f25=_0x39bfab;_0x59c6e2=0xc8;}else{_0x59c6e2=0xce;}_0x1d9b26[_0xefa1('0x1e')](_0x59c6e2);return _0x1d9b26[_0xefa1('0x22')]('Content-Range',_0x5a1d71+'-'+_0x143f25+'/'+_0x39bfab)[_0xefa1('0x1f')](_0x43f9c9);}return null;};}function patchUpdates(_0x304a59){return function(_0x31a8df){try{jsonpatch[_0xefa1('0x23')](_0x31a8df,_0x304a59,!![]);}catch(_0x595a42){return BPromise[_0xefa1('0x24')](_0x595a42);}return _0x31a8df['save']();};}function saveUpdates(_0x4ebc95,_0x31f82c){return function(_0x5e35c7){if(_0x5e35c7){return _0x5e35c7[_0xefa1('0x25')](_0x4ebc95)[_0xefa1('0x26')](function(_0x4e63e6){return _0x4e63e6;});}return null;};}function removeEntity(_0x3a076a,_0x4203be){return function(_0x18dff9){if(_0x18dff9){return _0x18dff9[_0xefa1('0x27')]()['then'](function(){var _0x1c19fe=_0x18dff9[_0xefa1('0x28')]({'plain':!![]});var _0x33a9e8=_0xefa1('0x29');return db[_0xefa1('0x2a')][_0xefa1('0x27')]({'where':{'type':_0x33a9e8,'resourceId':_0x1c19fe['id']}})[_0xefa1('0x26')](function(){return _0x18dff9;});})[_0xefa1('0x26')](function(){_0x3a076a['status'](0xcc)[_0xefa1('0x2b')]();});}};}function handleEntityNotFound(_0x393ef2,_0x411027){return function(_0x6aed8c){if(!_0x6aed8c){_0x393ef2[_0xefa1('0x1d')](0x194);}return _0x6aed8c;};}function handleError(_0x547b51,_0x37c031){_0x37c031=_0x37c031||0x1f4;return function(_0x3ac8f8){logger['error'](_0x3ac8f8['stack']);if(_0x3ac8f8['name']){delete _0x3ac8f8[_0xefa1('0x2c')];}_0x547b51['status'](_0x37c031)[_0xefa1('0x2d')](_0x3ac8f8);};}exports['index']=function(_0x11613e,_0x275cb1){var _0x5f20f4={},_0x3e1c90={},_0x1c6dbc={'count':0x0,'rows':[]};var _0x359c08=_['map'](db['VoicePrefix'][_0xefa1('0x2e')],function(_0x292b1d){return{'name':_0x292b1d[_0xefa1('0x2f')],'type':_0x292b1d[_0xefa1('0x30')][_0xefa1('0x31')]};});_0x3e1c90[_0xefa1('0x32')]=_[_0xefa1('0x33')](_0x359c08,_0xefa1('0x2c'));_0x3e1c90[_0xefa1('0x34')]=_['keys'](_0x11613e[_0xefa1('0x34')]);_0x3e1c90[_0xefa1('0x35')]=_[_0xefa1('0x36')](_0x3e1c90[_0xefa1('0x32')],_0x3e1c90[_0xefa1('0x34')]);_0x5f20f4['attributes']=_[_0xefa1('0x36')](_0x3e1c90[_0xefa1('0x32')],qs[_0xefa1('0x37')](_0x11613e[_0xefa1('0x34')][_0xefa1('0x37')]));_0x5f20f4[_0xefa1('0x38')]=_0x5f20f4['attributes'][_0xefa1('0x39')]?_0x5f20f4[_0xefa1('0x38')]:_0x3e1c90[_0xefa1('0x32')];if(!_0x11613e['query']['hasOwnProperty'](_0xefa1('0x3a'))){_0x5f20f4[_0xefa1('0x21')]=qs['limit'](_0x11613e['query']['limit']);_0x5f20f4[_0xefa1('0x20')]=qs[_0xefa1('0x20')](_0x11613e[_0xefa1('0x34')]['offset']);}_0x5f20f4[_0xefa1('0x3b')]=qs[_0xefa1('0x3c')](_0x11613e[_0xefa1('0x34')][_0xefa1('0x3c')]);_0x5f20f4['where']=qs['filters'](_[_0xefa1('0x3d')](_0x11613e[_0xefa1('0x34')],_0x3e1c90[_0xefa1('0x35')]));if(_0x11613e[_0xefa1('0x34')][_0xefa1('0x3e')]){_0x5f20f4['where']=_[_0xefa1('0x3f')](_0x5f20f4[_0xefa1('0x40')],{'$or':_[_0xefa1('0x33')](_0x359c08,function(_0x241550){if(_0x241550[_0xefa1('0x30')]!=='VIRTUAL'){var _0x21e868={};_0x21e868[_0x241550[_0xefa1('0x2c')]]={'$like':'%'+_0x11613e[_0xefa1('0x34')]['filter']+'%'};return _0x21e868;}})});}_0x5f20f4=_[_0xefa1('0x3f')]({},_0x5f20f4,_0x11613e[_0xefa1('0x41')]);var _0x5e3422={'where':_0x5f20f4[_0xefa1('0x40')]};return db[_0xefa1('0x42')][_0xefa1('0x43')](_0x5e3422)[_0xefa1('0x26')](function(_0x1274ff){_0x1c6dbc['count']=_0x1274ff;if(_0x11613e[_0xefa1('0x34')][_0xefa1('0x44')]){_0x5f20f4[_0xefa1('0x45')]=[{'all':!![]}];}return db[_0xefa1('0x42')][_0xefa1('0x46')](_0x5f20f4);})[_0xefa1('0x26')](function(_0x3c6d48){_0x1c6dbc['rows']=_0x3c6d48;return _0x1c6dbc;})['then'](respondWithFilteredResult(_0x275cb1,_0x5f20f4))['catch'](handleError(_0x275cb1,null));};exports[_0xefa1('0x47')]=function(_0x27058a,_0x1d7fb8){var _0x47de1e={'raw':![],'where':{'id':_0x27058a[_0xefa1('0x48')]['id']}},_0x2ec629={};_0x2ec629[_0xefa1('0x32')]=_[_0xefa1('0x49')](db[_0xefa1('0x42')]['rawAttributes']);_0x2ec629[_0xefa1('0x34')]=_[_0xefa1('0x49')](_0x27058a[_0xefa1('0x34')]);_0x2ec629[_0xefa1('0x35')]=_[_0xefa1('0x36')](_0x2ec629['model'],_0x2ec629[_0xefa1('0x34')]);_0x47de1e[_0xefa1('0x38')]=_[_0xefa1('0x36')](_0x2ec629['model'],qs[_0xefa1('0x37')](_0x27058a[_0xefa1('0x34')][_0xefa1('0x37')]));_0x47de1e[_0xefa1('0x38')]=_0x47de1e[_0xefa1('0x38')][_0xefa1('0x39')]?_0x47de1e[_0xefa1('0x38')]:_0x2ec629['model'];if(_0x27058a['query'][_0xefa1('0x44')]){_0x47de1e[_0xefa1('0x45')]=[{'all':!![]}];}_0x47de1e=_['merge']({},_0x47de1e,_0x27058a[_0xefa1('0x41')]);return db[_0xefa1('0x42')]['find'](_0x47de1e)[_0xefa1('0x26')](handleEntityNotFound(_0x1d7fb8,null))[_0xefa1('0x26')](respondWithResult(_0x1d7fb8,null))['catch'](handleError(_0x1d7fb8,null));};exports[_0xefa1('0x27')]=function(_0x319b60,_0x1b1ca1){return db[_0xefa1('0x42')][_0xefa1('0x4a')]({'where':{'id':_0x319b60[_0xefa1('0x48')]['id']}})[_0xefa1('0x26')](handleEntityNotFound(_0x1b1ca1,null))[_0xefa1('0x26')](removeEntity(_0x1b1ca1,null))[_0xefa1('0x4b')](handleError(_0x1b1ca1,null));};exports[_0xefa1('0x4c')]=function(_0x5f5035,_0x3cbf9a){return db[_0xefa1('0x42')][_0xefa1('0x4c')]()[_0xefa1('0x26')](respondWithResult(_0x3cbf9a,null))[_0xefa1('0x4b')](handleError(_0x3cbf9a,null));};exports['create']=function(_0x51a7fe,_0x24825e){var _0x51fc56;return db[_0xefa1('0x4d')][_0xefa1('0x4e')](function(_0xb2fba4){return db[_0xefa1('0x42')][_0xefa1('0x4f')](_0x51a7fe[_0xefa1('0x50')],{'transaction':_0xb2fba4})[_0xefa1('0x26')](function(_0x19ffcc){_0x51fc56=_0x19ffcc['get']({'plain':!![]});return db['VoiceExtension'][_0xefa1('0x4a')]({'where':{'id':_0x51fc56[_0xefa1('0x51')]},'raw':!![]})[_0xefa1('0x26')](function(_0x5a03dd){return createVoicePrefixExtensions(_0x51fc56,_0x5a03dd,_0xb2fba4);});});})[_0xefa1('0x26')](function(){var _0xf2dde=_0x51a7fe[_0xefa1('0x52')][_0xefa1('0x28')]({'plain':!![]});if(!_0xf2dde)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf2dde[_0xefa1('0x53')]===_0xefa1('0x52')){var _0x3b1c7d=_0x51fc56;return db[_0xefa1('0x54')]['find']({'where':{'name':_0xefa1('0x29'),'userProfileId':_0xf2dde['userProfileId']},'raw':!![]})[_0xefa1('0x26')](function(_0x55ae6b){if(_0x55ae6b&&_0x55ae6b[_0xefa1('0x55')]===0x0){return db[_0xefa1('0x2a')][_0xefa1('0x4f')]({'name':_0x3b1c7d[_0xefa1('0x2c')],'resourceId':_0x3b1c7d['id'],'type':_0x55ae6b[_0xefa1('0x2c')],'sectionId':_0x55ae6b['id']},{})[_0xefa1('0x26')](function(){return _0x51fc56;});}else{return _0x51fc56;}})[_0xefa1('0x4b')](function(_0x25518b){logger[_0xefa1('0x56')](_0xefa1('0x57'),_0x25518b);throw _0x25518b;});}return _0x51fc56;})['then'](respondWithResult(_0x24825e,null))[_0xefa1('0x4b')](handleError(_0x24825e,null));};function Extension(_0x29090e,_0x324cdb,_0x315bd5,_0x335b30){this['context']=_0xefa1('0x58');this[_0xefa1('0x59')]=_0x29090e;this[_0xefa1('0x5a')]=_0x315bd5;this[_0xefa1('0x30')]=_0xefa1('0x5b');this[_0xefa1('0x5c')]=_0xefa1('0x5d');this[_0xefa1('0x5e')]=_0x324cdb;this[_0xefa1('0x5f')]=_0x335b30;}function createVoicePrefixExtensions(_0x46ba77,_0x3a726b,_0x4ae49f){return new BPromise(function(_0x56da0c,_0x1b52bc){var _0x183b9f=new Extension(formatPrefixName(_0x46ba77[_0xefa1('0x60')]),0x1,_0xefa1('0x61'),_0xefa1('0x62'));_0x183b9f[_0xefa1('0x63')]=_0x46ba77['id'];return db[_0xefa1('0x64')][_0xefa1('0x4f')](_0x183b9f,{'transaction':_0x4ae49f})[_0xefa1('0x26')](function(_0x504151){var _0x2fc766=_0x504151[_0xefa1('0x28')]({'plain':!![]});var _0x319196=_[_0xefa1('0x33')](addVoicePrefixExtensions(_0x46ba77,_0x3a726b),function(_0xa7ee9f){_0xa7ee9f[_0xefa1('0x51')]=_0x2fc766['id'];_0xa7ee9f['VoicePrefixId']=_0x46ba77['id'];return _0xa7ee9f;});return db[_0xefa1('0x64')]['bulkCreate'](_0x319196,{'transaction':_0x4ae49f})[_0xefa1('0x26')](function(_0x37c25d){if(!_0x37c25d){return _0x1b52bc(_0xefa1('0x65'));}else{return _0x56da0c(_0x37c25d);}})[_0xefa1('0x4b')](function(_0x24233b){return _0x1b52bc(_0x24233b);});});;});};function addVoicePrefixExtensions(_0xa20d71,_0x557d7a){var _0x570ba1=[];var _0x4ed0ba=formatPrefixName(_0xa20d71[_0xefa1('0x60')]);_0x570ba1[_0xefa1('0x66')](new Extension(_0x4ed0ba,0x2,_0xefa1('0x67'),'CDR(prefix)='+_0xa20d71[_0xefa1('0x2c')]));if(_0xa20d71[_0xefa1('0x68')]){_0x570ba1['push'](new Extension(_0x4ed0ba,0x3,_0xefa1('0x67'),_0xefa1('0x69')+_0xa20d71[_0xefa1('0x68')]));}else{_0x570ba1[_0xefa1('0x66')](new Extension(_0x4ed0ba,0x3,_0xefa1('0x61'),_0xefa1('0x6a')));}_0x570ba1[_0xefa1('0x66')](new Extension(_0x4ed0ba,0x4,'goto',_0x557d7a['context']+','+'${EXTEN:'+(0x8+_0xa20d71[_0xefa1('0x2c')]['length'])+'}'+','+0x1));return _0x570ba1;}function formatPrefixName(_0x65ddd3){var _0x227945='_';for(var _0x4fef37=0x0;_0x4fef37<_0x65ddd3[_0xefa1('0x39')];_0x4fef37++){if(_0x65ddd3[_0xefa1('0x6b')](_0x4fef37)=='-'){_0x227945+=_0x65ddd3[_0xefa1('0x6b')](_0x4fef37);}else{_0x227945+='['+_0x65ddd3[_0xefa1('0x6b')](_0x4fef37)+']';}}_0x227945+='.';return _0x227945;}exports['update']=function(_0x432da0,_0x38e869,_0x371cee){var _0x463fd5=_0x432da0[_0xefa1('0x50')];_0x463fd5[_0xefa1('0x60')]=_0xefa1('0x6c')+_0x463fd5['name']+'-';return db[_0xefa1('0x4d')][_0xefa1('0x4e')](function(_0x1992c7){return db['VoicePrefix'][_0xefa1('0x25')](_0x463fd5,{'where':{'id':_0x463fd5['id']},'transaction':_0x1992c7})[_0xefa1('0x26')](function(){return db[_0xefa1('0x64')][_0xefa1('0x27')]({'where':{'VoicePrefixId':_0x463fd5['id']},'transaction':_0x1992c7})['then'](function(){return db[_0xefa1('0x64')][_0xefa1('0x4a')]({'where':{'id':_0x463fd5[_0xefa1('0x51')]},'raw':!![]})[_0xefa1('0x26')](function(_0x425e1b){return createVoicePrefixExtensions(_0x463fd5,_0x425e1b,_0x1992c7);});});});})[_0xefa1('0x26')](function(){return db[_0xefa1('0x42')][_0xefa1('0x6d')](_0x463fd5['id']);})[_0xefa1('0x26')](respondWithResult(_0x38e869,null))['catch'](handleError(_0x38e869,null));};exports[_0xefa1('0x6e')]=function(_0x44a2d5,_0x39fccb,_0x1df89f){return db[_0xefa1('0x42')][_0xefa1('0x4a')]({'where':{'id':_0x44a2d5[_0xefa1('0x48')]['id']}})['then'](handleEntityNotFound(_0x39fccb,null))['then'](function(_0x310342){if(_0x310342){return _0x310342[_0xefa1('0x6e')](_0x44a2d5[_0xefa1('0x50')][_0xefa1('0x6f')],_['omit'](_0x44a2d5[_0xefa1('0x50')],['ids','id'])||{})[_0xefa1('0x70')](function(_0x53881c){for(var _0x493cad=0x0;_0x493cad<_0x44a2d5[_0xefa1('0x50')][_0xefa1('0x6f')][_0xefa1('0x39')];_0x493cad+=0x1){socket[_0xefa1('0x71')](_0xefa1('0x72'),{'UserId':_0x44a2d5[_0xefa1('0x50')]['ids'][_0x493cad],'VoicePrefixId':_0x44a2d5['params']['id']});}return _0x53881c;});}})[_0xefa1('0x26')](respondWithResult(_0x39fccb,null))['catch'](handleError(_0x39fccb,null));};exports[_0xefa1('0x73')]=function(_0xac1257,_0x52c221,_0x2f5e5e){return db[_0xefa1('0x42')]['find']({'where':{'id':_0xac1257[_0xefa1('0x48')]['id']}})['then'](handleEntityNotFound(_0x52c221,null))['then'](function(_0x373e95){if(_0x373e95){return _0x373e95[_0xefa1('0x73')](_0xac1257[_0xefa1('0x34')][_0xefa1('0x6f')])[_0xefa1('0x26')](function(){if(_[_0xefa1('0x74')](_0xac1257[_0xefa1('0x34')][_0xefa1('0x6f')])){for(var _0x1c26d7=0x0;_0x1c26d7<_0xac1257['query'][_0xefa1('0x6f')]['length'];_0x1c26d7+=0x1){socket[_0xefa1('0x71')](_0xefa1('0x75'),{'UserId':Number(_0xac1257[_0xefa1('0x34')][_0xefa1('0x6f')][_0x1c26d7]),'VoicePrefixId':Number(_0xac1257[_0xefa1('0x48')]['id'])});}}else{socket[_0xefa1('0x71')]('userVoicePrefix:remove',{'UserId':Number(_0xac1257[_0xefa1('0x34')]['ids']),'VoicePrefixId':Number(_0xac1257[_0xefa1('0x48')]['id'])});}});}})[_0xefa1('0x26')](respondWithStatusCode(_0x52c221,null))[_0xefa1('0x4b')](handleError(_0x52c221,null));};exports['getAgents']=function(_0x22bb51,_0x399da3,_0x159240){var _0x292b58={};var _0x3b2ccf={};var _0x24db78;var _0x21a6a8;return db['VoicePrefix']['findOne']({'where':{'id':_0x22bb51[_0xefa1('0x48')]['id']}})[_0xefa1('0x26')](handleEntityNotFound(_0x399da3,null))[_0xefa1('0x26')](function(_0x4ff86e){if(_0x4ff86e){_0x24db78=_0x4ff86e;_0x3b2ccf[_0xefa1('0x32')]=_['keys'](db[_0xefa1('0x76')][_0xefa1('0x2e')]);_0x3b2ccf['query']=_['keys'](_0x22bb51[_0xefa1('0x34')]);_0x3b2ccf[_0xefa1('0x35')]=_[_0xefa1('0x36')](_0x3b2ccf[_0xefa1('0x32')],_0x3b2ccf['query']);_0x292b58['attributes']=_[_0xefa1('0x36')](_0x3b2ccf[_0xefa1('0x32')],qs[_0xefa1('0x37')](_0x22bb51['query'][_0xefa1('0x37')]));_0x292b58[_0xefa1('0x38')]=_0x292b58[_0xefa1('0x38')]['length']?_0x292b58['attributes']:_0x3b2ccf[_0xefa1('0x32')];_0x292b58['order']=qs[_0xefa1('0x3c')](_0x22bb51[_0xefa1('0x34')]['sort']);_0x292b58['where']=qs[_0xefa1('0x35')](_['pick'](_0x22bb51[_0xefa1('0x34')],_0x3b2ccf[_0xefa1('0x35')]));if(_0x22bb51[_0xefa1('0x34')][_0xefa1('0x3e')]){_0x292b58[_0xefa1('0x40')]=_[_0xefa1('0x3f')](_0x292b58[_0xefa1('0x40')],{'$or':_[_0xefa1('0x33')](_0x292b58['attributes'],function(_0x373855){var _0xb49486={};_0xb49486[_0x373855]={'$like':'%'+_0x22bb51[_0xefa1('0x34')]['filter']+'%'};return _0xb49486;})});}_0x292b58=_[_0xefa1('0x3f')]({},_0x292b58,_0x22bb51[_0xefa1('0x41')]);return _0x24db78[_0xefa1('0x77')](_0x292b58);}})['then'](function(_0x27356a){if(_0x27356a){_0x21a6a8=_0x27356a[_0xefa1('0x39')];if(!_0x22bb51[_0xefa1('0x34')][_0xefa1('0x78')]('nolimit')){_0x292b58['limit']=qs[_0xefa1('0x21')](_0x22bb51[_0xefa1('0x34')]['limit']);_0x292b58[_0xefa1('0x20')]=qs[_0xefa1('0x20')](_0x22bb51[_0xefa1('0x34')]['offset']);}return _0x24db78[_0xefa1('0x77')](_0x292b58);}})[_0xefa1('0x26')](function(_0x486035){if(_0x486035){return _0x486035?{'count':_0x21a6a8,'rows':_0x486035}:null;}})['then'](respondWithResult(_0x399da3,null))[_0xefa1('0x4b')](handleError(_0x399da3,null));}; \ No newline at end of file +var _0x4c57=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoicePrefix','includeAll','include','findAll','rows','show','params','keys','rawAttributes','catch','find','describe','create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','userProfileId','error','context','exten','system','Voice\x20Prefix\x20Extension','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','VoicePrefixes','UserProfileResource','send','index','map','fieldName','type','key','model','name','query','filters','intersection','attributes'];(function(_0x224897,_0x18e414){var _0x910924=function(_0x1bb333){while(--_0x1bb333){_0x224897['push'](_0x224897['shift']());}};_0x910924(++_0x18e414);}(_0x4c57,0x1ad));var _0x74c5=function(_0x1fbcac,_0x232833){_0x1fbcac=_0x1fbcac-0x0;var _0x401b24=_0x4c57[_0x1fbcac];return _0x401b24;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x74c5('0x0'));var rimraf=require(_0x74c5('0x1'));var zipdir=require(_0x74c5('0x2'));var jsonpatch=require(_0x74c5('0x3'));var rp=require('request-promise');var moment=require(_0x74c5('0x4'));var BPromise=require(_0x74c5('0x5'));var Mustache=require(_0x74c5('0x6'));var util=require('util');var path=require(_0x74c5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x74c5('0x8'));var fs=require('fs');var _=require(_0x74c5('0x9'));var squel=require(_0x74c5('0xa'));var crypto=require(_0x74c5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x74c5('0xc'));var toCsv=require(_0x74c5('0xd'));var querystring=require(_0x74c5('0xe'));var Papa=require('papaparse');var Redis=require(_0x74c5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74c5('0x10'));var as=require(_0x74c5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74c5('0x12'))(_0x74c5('0x13'));var utils=require('../../config/utils');var config=require(_0x74c5('0x14'));var db=require(_0x74c5('0x15'))['db'];config[_0x74c5('0x16')]=_['defaults'](config[_0x74c5('0x16')],{'host':_0x74c5('0x17'),'port':0x18eb});var socket=require(_0x74c5('0x18'))(new Redis(config[_0x74c5('0x16')]));require(_0x74c5('0x19'))[_0x74c5('0x1a')](socket);function respondWithStatusCode(_0x59f636,_0x2ccc19){_0x2ccc19=_0x2ccc19||0xcc;return function(_0x25f786){if(_0x25f786){return _0x59f636[_0x74c5('0x1b')](_0x2ccc19);}return _0x59f636['status'](_0x2ccc19)[_0x74c5('0x1c')]();};}function respondWithResult(_0x28f348,_0x45ad4c){_0x45ad4c=_0x45ad4c||0xc8;return function(_0xfda3d0){if(_0xfda3d0){return _0x28f348[_0x74c5('0x1d')](_0x45ad4c)[_0x74c5('0x1e')](_0xfda3d0);}};}function respondWithFilteredResult(_0x48dbe9,_0x4d56e8){return function(_0x31aa1f){if(_0x31aa1f){var _0x3d50dc=_0x31aa1f[_0x74c5('0x1f')],_0x29ae03=_0x4d56e8[_0x74c5('0x20')],_0x1fdbc9=_0x4d56e8['offset']+_0x4d56e8[_0x74c5('0x21')],_0x50acc6;if(_0x1fdbc9>=_0x3d50dc){_0x1fdbc9=_0x3d50dc;_0x50acc6=0xc8;}else{_0x50acc6=0xce;}_0x48dbe9[_0x74c5('0x1d')](_0x50acc6);return _0x48dbe9[_0x74c5('0x22')](_0x74c5('0x23'),_0x29ae03+'-'+_0x1fdbc9+'/'+_0x3d50dc)[_0x74c5('0x1e')](_0x31aa1f);}return null;};}function patchUpdates(_0x5b5665){return function(_0x373c35){try{jsonpatch[_0x74c5('0x24')](_0x373c35,_0x5b5665,!![]);}catch(_0x5a741e){return BPromise['reject'](_0x5a741e);}return _0x373c35[_0x74c5('0x25')]();};}function saveUpdates(_0xbef793,_0x56ae6f){return function(_0x419eb2){if(_0x419eb2){return _0x419eb2[_0x74c5('0x26')](_0xbef793)[_0x74c5('0x27')](function(_0x4d5fa6){return _0x4d5fa6;});}return null;};}function removeEntity(_0xf4fea3,_0x55c08e){return function(_0x5e92c6){if(_0x5e92c6){return _0x5e92c6[_0x74c5('0x28')]()[_0x74c5('0x27')](function(){var _0x533a9f=_0x5e92c6['get']({'plain':!![]});var _0x1cc7c2=_0x74c5('0x29');return db[_0x74c5('0x2a')][_0x74c5('0x28')]({'where':{'type':_0x1cc7c2,'resourceId':_0x533a9f['id']}})[_0x74c5('0x27')](function(){return _0x5e92c6;});})[_0x74c5('0x27')](function(){_0xf4fea3[_0x74c5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b044,_0x4c41b3){return function(_0x314628){if(!_0x314628){_0x52b044[_0x74c5('0x1b')](0x194);}return _0x314628;};}function handleError(_0x5e29f3,_0x27e0d5){_0x27e0d5=_0x27e0d5||0x1f4;return function(_0x9b1a41){logger['error'](_0x9b1a41['stack']);if(_0x9b1a41['name']){delete _0x9b1a41['name'];}_0x5e29f3['status'](_0x27e0d5)[_0x74c5('0x2b')](_0x9b1a41);};}exports[_0x74c5('0x2c')]=function(_0x8a4b6,_0x2c3f21){var _0x24d58d={},_0x2fdcd1={},_0x3df3f4={'count':0x0,'rows':[]};var _0x323bc4=_[_0x74c5('0x2d')](db['VoicePrefix']['rawAttributes'],function(_0x4bb566){return{'name':_0x4bb566[_0x74c5('0x2e')],'type':_0x4bb566[_0x74c5('0x2f')][_0x74c5('0x30')]};});_0x2fdcd1[_0x74c5('0x31')]=_[_0x74c5('0x2d')](_0x323bc4,_0x74c5('0x32'));_0x2fdcd1[_0x74c5('0x33')]=_['keys'](_0x8a4b6[_0x74c5('0x33')]);_0x2fdcd1[_0x74c5('0x34')]=_[_0x74c5('0x35')](_0x2fdcd1[_0x74c5('0x31')],_0x2fdcd1[_0x74c5('0x33')]);_0x24d58d[_0x74c5('0x36')]=_['intersection'](_0x2fdcd1[_0x74c5('0x31')],qs[_0x74c5('0x37')](_0x8a4b6[_0x74c5('0x33')][_0x74c5('0x37')]));_0x24d58d[_0x74c5('0x36')]=_0x24d58d['attributes'][_0x74c5('0x38')]?_0x24d58d['attributes']:_0x2fdcd1[_0x74c5('0x31')];if(!_0x8a4b6[_0x74c5('0x33')][_0x74c5('0x39')](_0x74c5('0x3a'))){_0x24d58d[_0x74c5('0x21')]=qs['limit'](_0x8a4b6['query'][_0x74c5('0x21')]);_0x24d58d[_0x74c5('0x20')]=qs['offset'](_0x8a4b6[_0x74c5('0x33')]['offset']);}_0x24d58d[_0x74c5('0x3b')]=qs[_0x74c5('0x3c')](_0x8a4b6[_0x74c5('0x33')][_0x74c5('0x3c')]);_0x24d58d[_0x74c5('0x3d')]=qs[_0x74c5('0x34')](_[_0x74c5('0x3e')](_0x8a4b6['query'],_0x2fdcd1[_0x74c5('0x34')]));if(_0x8a4b6['query']['filter']){_0x24d58d['where']=_[_0x74c5('0x3f')](_0x24d58d[_0x74c5('0x3d')],{'$or':_[_0x74c5('0x2d')](_0x323bc4,function(_0x44d609){if(_0x44d609[_0x74c5('0x2f')]!==_0x74c5('0x40')){var _0x2a65f2={};_0x2a65f2[_0x44d609['name']]={'$like':'%'+_0x8a4b6[_0x74c5('0x33')][_0x74c5('0x41')]+'%'};return _0x2a65f2;}})});}_0x24d58d=_[_0x74c5('0x3f')]({},_0x24d58d,_0x8a4b6[_0x74c5('0x42')]);var _0x268627={'where':_0x24d58d['where']};return db[_0x74c5('0x43')]['count'](_0x268627)[_0x74c5('0x27')](function(_0x17cc91){_0x3df3f4[_0x74c5('0x1f')]=_0x17cc91;if(_0x8a4b6[_0x74c5('0x33')][_0x74c5('0x44')]){_0x24d58d[_0x74c5('0x45')]=[{'all':!![]}];}return db['VoicePrefix'][_0x74c5('0x46')](_0x24d58d);})[_0x74c5('0x27')](function(_0x1cc67d){_0x3df3f4[_0x74c5('0x47')]=_0x1cc67d;return _0x3df3f4;})[_0x74c5('0x27')](respondWithFilteredResult(_0x2c3f21,_0x24d58d))['catch'](handleError(_0x2c3f21,null));};exports[_0x74c5('0x48')]=function(_0x79f72c,_0xa0f2e){var _0x115758={'raw':![],'where':{'id':_0x79f72c[_0x74c5('0x49')]['id']}},_0x37ee5d={};_0x37ee5d[_0x74c5('0x31')]=_[_0x74c5('0x4a')](db['VoicePrefix'][_0x74c5('0x4b')]);_0x37ee5d[_0x74c5('0x33')]=_[_0x74c5('0x4a')](_0x79f72c[_0x74c5('0x33')]);_0x37ee5d[_0x74c5('0x34')]=_[_0x74c5('0x35')](_0x37ee5d['model'],_0x37ee5d[_0x74c5('0x33')]);_0x115758[_0x74c5('0x36')]=_[_0x74c5('0x35')](_0x37ee5d[_0x74c5('0x31')],qs[_0x74c5('0x37')](_0x79f72c[_0x74c5('0x33')][_0x74c5('0x37')]));_0x115758[_0x74c5('0x36')]=_0x115758[_0x74c5('0x36')]['length']?_0x115758['attributes']:_0x37ee5d[_0x74c5('0x31')];if(_0x79f72c[_0x74c5('0x33')][_0x74c5('0x44')]){_0x115758[_0x74c5('0x45')]=[{'all':!![]}];}_0x115758=_[_0x74c5('0x3f')]({},_0x115758,_0x79f72c['options']);return db[_0x74c5('0x43')]['find'](_0x115758)['then'](handleEntityNotFound(_0xa0f2e,null))[_0x74c5('0x27')](respondWithResult(_0xa0f2e,null))[_0x74c5('0x4c')](handleError(_0xa0f2e,null));};exports[_0x74c5('0x28')]=function(_0x4b6975,_0x146d25){return db[_0x74c5('0x43')][_0x74c5('0x4d')]({'where':{'id':_0x4b6975[_0x74c5('0x49')]['id']}})[_0x74c5('0x27')](handleEntityNotFound(_0x146d25,null))[_0x74c5('0x27')](removeEntity(_0x146d25,null))[_0x74c5('0x4c')](handleError(_0x146d25,null));};exports[_0x74c5('0x4e')]=function(_0x128c6b,_0x50ef17){return db[_0x74c5('0x43')]['describe']()[_0x74c5('0x27')](respondWithResult(_0x50ef17,null))[_0x74c5('0x4c')](handleError(_0x50ef17,null));};exports[_0x74c5('0x4f')]=function(_0x3532a6,_0x2ef636){var _0x3dbd56;return db[_0x74c5('0x50')][_0x74c5('0x51')](function(_0x13342c){return db[_0x74c5('0x43')][_0x74c5('0x4f')](_0x3532a6[_0x74c5('0x52')],{'transaction':_0x13342c})[_0x74c5('0x27')](function(_0x192fd7){_0x3dbd56=_0x192fd7[_0x74c5('0x53')]({'plain':!![]});return db[_0x74c5('0x54')]['find']({'where':{'id':_0x3dbd56[_0x74c5('0x55')]},'raw':!![]})[_0x74c5('0x27')](function(_0xb94d18){return createVoicePrefixExtensions(_0x3dbd56,_0xb94d18,_0x13342c);});});})[_0x74c5('0x27')](function(){var _0x318c5f=_0x3532a6[_0x74c5('0x56')][_0x74c5('0x53')]({'plain':!![]});if(!_0x318c5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x318c5f[_0x74c5('0x57')]==='user'){var _0xf9ba27=_0x3dbd56;return db[_0x74c5('0x58')]['find']({'where':{'name':_0x74c5('0x29'),'userProfileId':_0x318c5f[_0x74c5('0x59')]},'raw':!![]})[_0x74c5('0x27')](function(_0x3b68c8){if(_0x3b68c8&&_0x3b68c8['autoAssociation']===0x0){return db[_0x74c5('0x2a')][_0x74c5('0x4f')]({'name':_0xf9ba27['name'],'resourceId':_0xf9ba27['id'],'type':_0x3b68c8[_0x74c5('0x32')],'sectionId':_0x3b68c8['id']},{})[_0x74c5('0x27')](function(){return _0x3dbd56;});}else{return _0x3dbd56;}})[_0x74c5('0x4c')](function(_0x1af25a){logger[_0x74c5('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1af25a);throw _0x1af25a;});}return _0x3dbd56;})[_0x74c5('0x27')](respondWithResult(_0x2ef636,null))[_0x74c5('0x4c')](handleError(_0x2ef636,null));};function Extension(_0x50191c,_0x92469f,_0x237590,_0x305cbf){this[_0x74c5('0x5b')]='from-sip';this[_0x74c5('0x5c')]=_0x50191c;this['app']=_0x237590;this[_0x74c5('0x2f')]=_0x74c5('0x5d');this['description']=_0x74c5('0x5e');this['priority']=_0x92469f;this[_0x74c5('0x5f')]=_0x305cbf;}function createVoicePrefixExtensions(_0x453ec9,_0x1168c1,_0x3b84b2){return new BPromise(function(_0x25ed4d,_0x4119ce){var _0x4a9371=new Extension(formatPrefixName(_0x453ec9['prefix']),0x1,_0x74c5('0x60'),_0x74c5('0x61'));_0x4a9371[_0x74c5('0x62')]=_0x453ec9['id'];return db['VoiceExtension'][_0x74c5('0x4f')](_0x4a9371,{'transaction':_0x3b84b2})[_0x74c5('0x27')](function(_0xfc7e3d){var _0x35c065=_0xfc7e3d[_0x74c5('0x53')]({'plain':!![]});var _0x19cc9e=_[_0x74c5('0x2d')](addVoicePrefixExtensions(_0x453ec9,_0x1168c1),function(_0x5edf6d){_0x5edf6d[_0x74c5('0x55')]=_0x35c065['id'];_0x5edf6d[_0x74c5('0x62')]=_0x453ec9['id'];return _0x5edf6d;});return db[_0x74c5('0x54')][_0x74c5('0x63')](_0x19cc9e,{'transaction':_0x3b84b2})['then'](function(_0x1217bc){if(!_0x1217bc){return _0x4119ce(_0x74c5('0x64'));}else{return _0x25ed4d(_0x1217bc);}})[_0x74c5('0x4c')](function(_0x409868){return _0x4119ce(_0x409868);});});;});};function addVoicePrefixExtensions(_0x23cc21,_0x5b237a){var _0x6cafaa=[];var _0x47ecfa=formatPrefixName(_0x23cc21[_0x74c5('0x65')]);_0x6cafaa[_0x74c5('0x66')](new Extension(_0x47ecfa,0x2,_0x74c5('0x67'),'CDR(prefix)='+_0x23cc21['name']));if(_0x23cc21[_0x74c5('0x68')]){_0x6cafaa[_0x74c5('0x66')](new Extension(_0x47ecfa,0x3,_0x74c5('0x67'),_0x74c5('0x69')+_0x23cc21[_0x74c5('0x68')]));}else{_0x6cafaa[_0x74c5('0x66')](new Extension(_0x47ecfa,0x3,_0x74c5('0x60'),_0x74c5('0x6a')));}_0x6cafaa['push'](new Extension(_0x47ecfa,0x4,_0x74c5('0x6b'),_0x5b237a[_0x74c5('0x5b')]+','+_0x74c5('0x6c')+(0x8+_0x23cc21[_0x74c5('0x32')][_0x74c5('0x38')])+'}'+','+0x1));return _0x6cafaa;}function formatPrefixName(_0x1df794){var _0x589578='_';for(var _0x26b9a4=0x0;_0x26b9a4<_0x1df794[_0x74c5('0x38')];_0x26b9a4++){if(_0x1df794['charAt'](_0x26b9a4)=='-'){_0x589578+=_0x1df794[_0x74c5('0x6d')](_0x26b9a4);}else{_0x589578+='['+_0x1df794[_0x74c5('0x6d')](_0x26b9a4)+']';}}_0x589578+='.';return _0x589578;}exports[_0x74c5('0x26')]=function(_0xcbc1d2,_0x970a9b,_0x3de59c){var _0x553515=_0xcbc1d2[_0x74c5('0x52')];_0x553515[_0x74c5('0x65')]='system-'+_0x553515[_0x74c5('0x32')]+'-';return db[_0x74c5('0x50')][_0x74c5('0x51')](function(_0xe1e587){return db[_0x74c5('0x43')][_0x74c5('0x26')](_0x553515,{'where':{'id':_0x553515['id']},'transaction':_0xe1e587})['then'](function(){return db[_0x74c5('0x54')]['destroy']({'where':{'VoicePrefixId':_0x553515['id']},'transaction':_0xe1e587})[_0x74c5('0x27')](function(){return db[_0x74c5('0x54')]['find']({'where':{'id':_0x553515[_0x74c5('0x55')]},'raw':!![]})['then'](function(_0xcd4d49){return createVoicePrefixExtensions(_0x553515,_0xcd4d49,_0xe1e587);});});});})[_0x74c5('0x27')](function(){return db[_0x74c5('0x43')][_0x74c5('0x6e')](_0x553515['id']);})[_0x74c5('0x27')](respondWithResult(_0x970a9b,null))[_0x74c5('0x4c')](handleError(_0x970a9b,null));};exports[_0x74c5('0x6f')]=function(_0x1bcd55,_0x100de8,_0x2eff40){return db[_0x74c5('0x43')][_0x74c5('0x4d')]({'where':{'id':_0x1bcd55['params']['id']}})[_0x74c5('0x27')](handleEntityNotFound(_0x100de8,null))[_0x74c5('0x27')](function(_0x9c062f){if(_0x9c062f){return _0x9c062f[_0x74c5('0x6f')](_0x1bcd55['body'][_0x74c5('0x70')],_[_0x74c5('0x71')](_0x1bcd55['body'],[_0x74c5('0x70'),'id'])||{})['spread'](function(_0x2708d5){for(var _0x473a74=0x0;_0x473a74<_0x1bcd55[_0x74c5('0x52')][_0x74c5('0x70')][_0x74c5('0x38')];_0x473a74+=0x1){socket[_0x74c5('0x72')](_0x74c5('0x73'),{'UserId':_0x1bcd55[_0x74c5('0x52')][_0x74c5('0x70')][_0x473a74],'VoicePrefixId':_0x1bcd55[_0x74c5('0x49')]['id']});}return _0x2708d5;});}})[_0x74c5('0x27')](respondWithResult(_0x100de8,null))[_0x74c5('0x4c')](handleError(_0x100de8,null));};exports[_0x74c5('0x74')]=function(_0x633255,_0x4c6fd8,_0x25b542){return db['VoicePrefix'][_0x74c5('0x4d')]({'where':{'id':_0x633255[_0x74c5('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c6fd8,null))[_0x74c5('0x27')](function(_0x5894d9){if(_0x5894d9){return _0x5894d9[_0x74c5('0x74')](_0x633255[_0x74c5('0x33')][_0x74c5('0x70')])[_0x74c5('0x27')](function(){if(_['isArray'](_0x633255['query']['ids'])){for(var _0x36a587=0x0;_0x36a587<_0x633255['query'][_0x74c5('0x70')][_0x74c5('0x38')];_0x36a587+=0x1){socket['emit'](_0x74c5('0x75'),{'UserId':Number(_0x633255['query'][_0x74c5('0x70')][_0x36a587]),'VoicePrefixId':Number(_0x633255[_0x74c5('0x49')]['id'])});}}else{socket[_0x74c5('0x72')](_0x74c5('0x75'),{'UserId':Number(_0x633255[_0x74c5('0x33')][_0x74c5('0x70')]),'VoicePrefixId':Number(_0x633255[_0x74c5('0x49')]['id'])});}});}})[_0x74c5('0x27')](respondWithStatusCode(_0x4c6fd8,null))[_0x74c5('0x4c')](handleError(_0x4c6fd8,null));};exports[_0x74c5('0x76')]=function(_0x462b42,_0x96999b,_0x47eb82){var _0xe93cd9={};var _0x1dba83={};var _0x170b3b;var _0x24db96;return db[_0x74c5('0x43')][_0x74c5('0x77')]({'where':{'id':_0x462b42['params']['id']}})['then'](handleEntityNotFound(_0x96999b,null))[_0x74c5('0x27')](function(_0xe3411d){if(_0xe3411d){_0x170b3b=_0xe3411d;_0x1dba83[_0x74c5('0x31')]=_['keys'](db[_0x74c5('0x78')][_0x74c5('0x4b')]);_0x1dba83['query']=_[_0x74c5('0x4a')](_0x462b42[_0x74c5('0x33')]);_0x1dba83['filters']=_['intersection'](_0x1dba83[_0x74c5('0x31')],_0x1dba83['query']);_0xe93cd9['attributes']=_[_0x74c5('0x35')](_0x1dba83[_0x74c5('0x31')],qs[_0x74c5('0x37')](_0x462b42[_0x74c5('0x33')][_0x74c5('0x37')]));_0xe93cd9[_0x74c5('0x36')]=_0xe93cd9[_0x74c5('0x36')][_0x74c5('0x38')]?_0xe93cd9['attributes']:_0x1dba83['model'];_0xe93cd9[_0x74c5('0x3b')]=qs['sort'](_0x462b42['query'][_0x74c5('0x3c')]);_0xe93cd9[_0x74c5('0x3d')]=qs[_0x74c5('0x34')](_[_0x74c5('0x3e')](_0x462b42[_0x74c5('0x33')],_0x1dba83[_0x74c5('0x34')]));if(_0x462b42[_0x74c5('0x33')][_0x74c5('0x41')]){_0xe93cd9[_0x74c5('0x3d')]=_[_0x74c5('0x3f')](_0xe93cd9[_0x74c5('0x3d')],{'$or':_['map'](_0xe93cd9[_0x74c5('0x36')],function(_0x10eafc){var _0x1cc051={};_0x1cc051[_0x10eafc]={'$like':'%'+_0x462b42['query'][_0x74c5('0x41')]+'%'};return _0x1cc051;})});}_0xe93cd9=_['merge']({},_0xe93cd9,_0x462b42[_0x74c5('0x42')]);return _0x170b3b['getAgents'](_0xe93cd9);}})[_0x74c5('0x27')](function(_0x16c212){if(_0x16c212){_0x24db96=_0x16c212[_0x74c5('0x38')];if(!_0x462b42[_0x74c5('0x33')][_0x74c5('0x39')](_0x74c5('0x3a'))){_0xe93cd9[_0x74c5('0x21')]=qs[_0x74c5('0x21')](_0x462b42[_0x74c5('0x33')][_0x74c5('0x21')]);_0xe93cd9[_0x74c5('0x20')]=qs[_0x74c5('0x20')](_0x462b42[_0x74c5('0x33')][_0x74c5('0x20')]);}return _0x170b3b['getAgents'](_0xe93cd9);}})['then'](function(_0x89481b){if(_0x89481b){return _0x89481b?{'count':_0x24db96,'rows':_0x89481b}:null;}})[_0x74c5('0x27')](respondWithResult(_0x96999b,null))['catch'](handleError(_0x96999b,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index c3ea538..960bc80 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 _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','update','emit'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var VoicePrefix=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){VoicePrefixEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);VoicePrefixEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];VoicePrefix[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x1f9435,_0x176fe1){var _0xd0926=function(_0xf11e15){while(--_0xf11e15){_0x1f9435['push'](_0x1f9435['shift']());}};_0xd0926(++_0x176fe1);}(_0x008c,0x188));var _0xc008=function(_0x3a094d,_0x2811f1){_0x3a094d=_0x3a094d-0x0;var _0x2fce9f=_0x008c[_0x3a094d];return _0x2fce9f;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoicePrefix=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoicePrefixEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoicePrefixEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoicePrefix[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 8f854cf..96111d5 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 _0x1912=['bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','voice_prefixes','util','../../config/logger','api','moment'];(function(_0x1dffeb,_0x5299df){var _0x437a91=function(_0x17e962){while(--_0x17e962){_0x1dffeb['push'](_0x1dffeb['shift']());}};_0x437a91(++_0x5299df);}(_0x1912,0xb0));var _0x2191=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1912[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x2191('0x0'));var logger=require(_0x2191('0x1'))(_0x2191('0x2'));var moment=require(_0x2191('0x3'));var BPromise=require(_0x2191('0x4'));var rp=require(_0x2191('0x5'));var fs=require('fs');var path=require(_0x2191('0x6'));var rimraf=require(_0x2191('0x7'));var config=require(_0x2191('0x8'));var attributes=require(_0x2191('0x9'));module['exports']=function(_0x515892,_0xd69484){return _0x515892[_0x2191('0xa')]('VoicePrefix',attributes,{'tableName':_0x2191('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd71=['moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','../../config/logger','api'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0xbd71,0x81));var _0x1bd7=function(_0x2d1c48,_0x3230cd){_0x2d1c48=_0x2d1c48-0x0;var _0x3bdc70=_0xbd71[_0x2d1c48];return _0x3bdc70;};'use strict';var _=require(_0x1bd7('0x0'));var util=require('util');var logger=require(_0x1bd7('0x1'))(_0x1bd7('0x2'));var moment=require(_0x1bd7('0x3'));var BPromise=require(_0x1bd7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bd7('0x5'));var rimraf=require(_0x1bd7('0x6'));var config=require(_0x1bd7('0x7'));var attributes=require(_0x1bd7('0x8'));module['exports']=function(_0x5b69d3,_0x504728){return _0x5b69d3[_0x1bd7('0x9')](_0x1bd7('0xa'),attributes,{'tableName':_0x1bd7('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 a18747f..4e3ec5b 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 _0xcd94=['jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2fe8e1,_0x3552bf){var _0x89bd52=function(_0x357bfc){while(--_0x357bfc){_0x2fe8e1['push'](_0x2fe8e1['shift']());}};_0x89bd52(++_0x3552bf);}(_0xcd94,0x19b));var _0x4cd9=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0xcd94[_0x1d5400];return _0x21d9fe;};'use strict';var _=require('lodash');var util=require(_0x4cd9('0x0'));var moment=require(_0x4cd9('0x1'));var BPromise=require(_0x4cd9('0x2'));var rs=require(_0x4cd9('0x3'));var fs=require('fs');var Redis=require(_0x4cd9('0x4'));var db=require(_0x4cd9('0x5'))['db'];var utils=require(_0x4cd9('0x6'));var logger=require('../../config/logger')(_0x4cd9('0x7'));var config=require(_0x4cd9('0x8'));var jayson=require(_0x4cd9('0x9'));var client=jayson[_0x4cd9('0xa')][_0x4cd9('0xb')]({'port':0x232a});config[_0x4cd9('0xc')]=_[_0x4cd9('0xd')](config[_0x4cd9('0xc')],{'host':_0x4cd9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4cd9('0xf'))[_0x4cd9('0x10')](socket);function respondWithRpcPromise(_0x5e6845,_0x5a5568,_0x4a424a){return new BPromise(function(_0x4d70e3,_0x515512){return client[_0x4cd9('0x11')](_0x5e6845,_0x4a424a)[_0x4cd9('0x12')](function(_0x4b2060){logger['info'](_0x4cd9('0x13'),_0x5a5568,_0x4cd9('0x14'));logger[_0x4cd9('0x15')](_0x4cd9('0x16'),_0x5a5568,'request\x20sent',JSON[_0x4cd9('0x17')](_0x4b2060));if(_0x4b2060['error']){if(_0x4b2060[_0x4cd9('0x18')][_0x4cd9('0x19')]===0x1f4){logger[_0x4cd9('0x18')](_0x4cd9('0x13'),_0x5a5568,_0x4b2060[_0x4cd9('0x18')][_0x4cd9('0x1a')]);return _0x515512(_0x4b2060[_0x4cd9('0x18')][_0x4cd9('0x1a')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x5a5568,_0x4b2060[_0x4cd9('0x18')][_0x4cd9('0x1a')]);return _0x4d70e3(_0x4b2060[_0x4cd9('0x18')][_0x4cd9('0x1a')]);}else{logger[_0x4cd9('0x1b')](_0x4cd9('0x13'),_0x5a5568,'request\x20sent');_0x4d70e3(_0x4b2060[_0x4cd9('0x1c')][_0x4cd9('0x1a')]);}})[_0x4cd9('0x1d')](function(_0x471e04){logger[_0x4cd9('0x18')](_0x4cd9('0x13'),_0x5a5568,_0x471e04);_0x515512(_0x471e04);});});} \ No newline at end of file +var _0x07e8=['then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./voicePrefix.socket','register','request'];(function(_0x560331,_0x39e881){var _0x35f1ae=function(_0x74ad75){while(--_0x74ad75){_0x560331['push'](_0x560331['shift']());}};_0x35f1ae(++_0x39e881);}(_0x07e8,0x10f));var _0x807e=function(_0x41f3fd,_0x50d0c2){_0x41f3fd=_0x41f3fd-0x0;var _0x3a836f=_0x07e8[_0x41f3fd];return _0x3a836f;};'use strict';var _=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var moment=require(_0x807e('0x2'));var BPromise=require('bluebird');var rs=require(_0x807e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x807e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x807e('0x5'));var config=require(_0x807e('0x6'));var jayson=require(_0x807e('0x7'));var client=jayson['client'][_0x807e('0x8')]({'port':0x232a});config[_0x807e('0x9')]=_[_0x807e('0xa')](config[_0x807e('0x9')],{'host':_0x807e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x807e('0x9')]));require(_0x807e('0xc'))[_0x807e('0xd')](socket);function respondWithRpcPromise(_0x3c6c7a,_0x1c2fdd,_0x45e953){return new BPromise(function(_0x382931,_0x2f44db){return client[_0x807e('0xe')](_0x3c6c7a,_0x45e953)[_0x807e('0xf')](function(_0x2ca6f0){logger[_0x807e('0x10')](_0x807e('0x11'),_0x1c2fdd,_0x807e('0x12'));logger['debug'](_0x807e('0x13'),_0x1c2fdd,_0x807e('0x12'),JSON[_0x807e('0x14')](_0x2ca6f0));if(_0x2ca6f0[_0x807e('0x15')]){if(_0x2ca6f0[_0x807e('0x15')][_0x807e('0x16')]===0x1f4){logger[_0x807e('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x1c2fdd,_0x2ca6f0['error'][_0x807e('0x17')]);return _0x2f44db(_0x2ca6f0[_0x807e('0x15')][_0x807e('0x17')]);}logger[_0x807e('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x1c2fdd,_0x2ca6f0[_0x807e('0x15')][_0x807e('0x17')]);return _0x382931(_0x2ca6f0[_0x807e('0x15')][_0x807e('0x17')]);}else{logger[_0x807e('0x10')](_0x807e('0x11'),_0x1c2fdd,'request\x20sent');_0x382931(_0x2ca6f0[_0x807e('0x18')]['message']);}})[_0x807e('0x19')](function(_0x328290){logger[_0x807e('0x15')](_0x807e('0x11'),_0x1c2fdd,_0x328290);_0x2f44db(_0x328290);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 914e80c..3ab5b37 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 _0x24ea=['./voicePrefix.events','remove','removeListener','register','length','voicePrefix:'];(function(_0x25c572,_0xadfd0){var _0x4471ad=function(_0x5eb27a){while(--_0x5eb27a){_0x25c572['push'](_0x25c572['shift']());}};_0x4471ad(++_0xadfd0);}(_0x24ea,0x78));var _0xa24e=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0x24ea[_0x58fbb0];return _0x1783d2;};'use strict';var VoicePrefixEvents=require(_0xa24e('0x0'));var events=['save',_0xa24e('0x1'),'update'];function createListener(_0x5d499a,_0x4b0641){return function(_0x3c52ab){_0x4b0641['emit'](_0x5d499a,_0x3c52ab);};}function removeListener(_0x2cacc1,_0x4846dd){return function(){VoicePrefixEvents[_0xa24e('0x2')](_0x2cacc1,_0x4846dd);};}exports[_0xa24e('0x3')]=function(_0x1c736e){for(var _0x538914=0x0,_0xd8bf75=events[_0xa24e('0x4')];_0x538914<_0xd8bf75;_0x538914++){var _0x5846fd=events[_0x538914];var _0x2486d6=createListener(_0xa24e('0x5')+_0x5846fd,_0x1c736e);VoicePrefixEvents['on'](_0x5846fd,_0x2486d6);}}; \ No newline at end of file +var _0x2f97=['length','voicePrefix:','./voicePrefix.events','remove','removeListener'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2f97,0xc0));var _0x72f9=function(_0x1a0d40,_0xda8c93){_0x1a0d40=_0x1a0d40-0x0;var _0x3f3ae4=_0x2f97[_0x1a0d40];return _0x3f3ae4;};'use strict';var VoicePrefixEvents=require(_0x72f9('0x0'));var events=['save',_0x72f9('0x1'),'update'];function createListener(_0x2fedda,_0x3740fc){return function(_0x1516b8){_0x3740fc['emit'](_0x2fedda,_0x1516b8);};}function removeListener(_0x4d9460,_0xbb4e48){return function(){VoicePrefixEvents[_0x72f9('0x2')](_0x4d9460,_0xbb4e48);};}exports['register']=function(_0xd37e40){for(var _0x4894e5=0x0,_0x38da8f=events[_0x72f9('0x3')];_0x4894e5<_0x38da8f;_0x4894e5++){var _0x21e92e=events[_0x4894e5];var _0x44ca9a=createListener(_0x72f9('0x4')+_0x21e92e,_0xd37e40);VoicePrefixEvents['on'](_0x21e92e,_0x44ca9a);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index b54a583..d12679a 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 _0x9ce3=['clone','addTeams','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','getBlackLists','create','post','/:id/clone'];(function(_0x4d15d2,_0x4aad5a){var _0x52bb10=function(_0x1c8941){while(--_0x1c8941){_0x4d15d2['push'](_0x4d15d2['shift']());}};_0x52bb10(++_0x4aad5a);}(_0x9ce3,0x18f));var _0x39ce=function(_0x590da5,_0x298084){_0x590da5=_0x590da5-0x0;var _0x54d4c4=_0x9ce3[_0x590da5];return _0x54d4c4;};'use strict';var multer=require(_0x39ce('0x0'));var util=require(_0x39ce('0x1'));var path=require(_0x39ce('0x2'));var timeout=require(_0x39ce('0x3'));var express=require(_0x39ce('0x4'));var router=express[_0x39ce('0x5')]();var auth=require(_0x39ce('0x6'));var interaction=require(_0x39ce('0x7'));var config=require(_0x39ce('0x8'));var controller=require('./voiceQueue.controller');router[_0x39ce('0x9')]('/',auth[_0x39ce('0xa')](),controller['index']);router[_0x39ce('0x9')](_0x39ce('0xb'),auth[_0x39ce('0xa')](),controller[_0x39ce('0xc')]);router[_0x39ce('0x9')]('/:id/hoppers',auth[_0x39ce('0xa')](),controller[_0x39ce('0xd')]);router[_0x39ce('0x9')](_0x39ce('0xe'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x39ce('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x39ce('0xf')]);router['get'](_0x39ce('0x10'),auth[_0x39ce('0xa')](),controller[_0x39ce('0x11')]);router['get'](_0x39ce('0x12'),auth[_0x39ce('0xa')](),controller[_0x39ce('0x13')]);router[_0x39ce('0x9')](_0x39ce('0x14'),auth[_0x39ce('0xa')](),controller[_0x39ce('0x15')]);router[_0x39ce('0x9')](_0x39ce('0x16'),auth[_0x39ce('0xa')](),controller[_0x39ce('0x17')]);router[_0x39ce('0x9')](_0x39ce('0x18'),auth[_0x39ce('0xa')](),controller[_0x39ce('0x19')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x39ce('0x1a')]);router['post']('/',auth[_0x39ce('0xa')](),controller[_0x39ce('0x1b')]);router[_0x39ce('0x1c')](_0x39ce('0x1d'),auth[_0x39ce('0xa')](),controller[_0x39ce('0x1e')]);router[_0x39ce('0x1c')](_0x39ce('0x12'),auth[_0x39ce('0xa')](),controller[_0x39ce('0x1f')]);router[_0x39ce('0x1c')]('/:id/users',auth[_0x39ce('0xa')](),controller['addAgents']);router['post'](_0x39ce('0x18'),auth['isAuthenticated'](),controller['addLists']);router[_0x39ce('0x1c')](_0x39ce('0x20'),auth['isAuthenticated'](),controller[_0x39ce('0x21')]);router['put'](_0x39ce('0xb'),auth[_0x39ce('0xa')](),controller[_0x39ce('0x22')]);router[_0x39ce('0x23')]('/:id',auth[_0x39ce('0xa')](),controller[_0x39ce('0x24')]);router[_0x39ce('0x23')](_0x39ce('0x12'),auth[_0x39ce('0xa')](),controller[_0x39ce('0x25')]);router[_0x39ce('0x23')](_0x39ce('0x14'),auth[_0x39ce('0xa')](),controller[_0x39ce('0x26')]);router[_0x39ce('0x23')]('/:id/lists',auth['isAuthenticated'](),controller['removeLists']);router[_0x39ce('0x23')](_0x39ce('0x20'),auth[_0x39ce('0xa')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0x4133=['/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','/:id/users','addAgents','addLists','addBlackLists','put','destroy','delete','removeTeams','removeAgents','/:id/lists','removeBlackLists','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','/:id/teams','getAgents','/:id/members','getMembers','getLists'];(function(_0x45f779,_0xd14a77){var _0xb28541=function(_0x596394){while(--_0x596394){_0x45f779['push'](_0x45f779['shift']());}};_0xb28541(++_0xd14a77);}(_0x4133,0xe5));var _0x3413=function(_0x53a7d,_0x3df61f){_0x53a7d=_0x53a7d-0x0;var _0x1f0308=_0x4133[_0x53a7d];return _0x1f0308;};'use strict';var multer=require(_0x3413('0x0'));var util=require('util');var path=require(_0x3413('0x1'));var timeout=require('connect-timeout');var express=require(_0x3413('0x2'));var router=express[_0x3413('0x3')]();var auth=require(_0x3413('0x4'));var interaction=require(_0x3413('0x5'));var config=require(_0x3413('0x6'));var controller=require('./voiceQueue.controller');router['get']('/',auth[_0x3413('0x7')](),controller[_0x3413('0x8')]);router[_0x3413('0x9')](_0x3413('0xa'),auth[_0x3413('0x7')](),controller[_0x3413('0xb')]);router['get'](_0x3413('0xc'),auth[_0x3413('0x7')](),controller[_0x3413('0xd')]);router['get'](_0x3413('0xe'),auth[_0x3413('0x7')](),controller[_0x3413('0xf')]);router[_0x3413('0x9')](_0x3413('0x10'),auth[_0x3413('0x7')](),controller['getHopperFinals']);router[_0x3413('0x9')](_0x3413('0x11'),auth[_0x3413('0x7')](),controller['getHopperBlacks']);router['get'](_0x3413('0x12'),auth['isAuthenticated'](),controller['getTeams']);router[_0x3413('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x3413('0x13')]);router[_0x3413('0x9')](_0x3413('0x14'),auth[_0x3413('0x7')](),controller[_0x3413('0x15')]);router[_0x3413('0x9')]('/:id/lists',auth[_0x3413('0x7')](),controller[_0x3413('0x16')]);router[_0x3413('0x9')](_0x3413('0x17'),auth[_0x3413('0x7')](),controller[_0x3413('0x18')]);router[_0x3413('0x19')]('/',auth['isAuthenticated'](),controller[_0x3413('0x1a')]);router[_0x3413('0x19')](_0x3413('0x1b'),auth[_0x3413('0x7')](),controller[_0x3413('0x1c')]);router[_0x3413('0x19')]('/:id/teams',auth[_0x3413('0x7')](),controller[_0x3413('0x1d')]);router[_0x3413('0x19')](_0x3413('0x1e'),auth['isAuthenticated'](),controller[_0x3413('0x1f')]);router[_0x3413('0x19')]('/:id/lists',auth[_0x3413('0x7')](),controller[_0x3413('0x20')]);router[_0x3413('0x19')](_0x3413('0x17'),auth['isAuthenticated'](),controller[_0x3413('0x21')]);router[_0x3413('0x22')](_0x3413('0xa'),auth[_0x3413('0x7')](),controller['update']);router['delete'](_0x3413('0xa'),auth[_0x3413('0x7')](),controller[_0x3413('0x23')]);router[_0x3413('0x24')](_0x3413('0x12'),auth[_0x3413('0x7')](),controller[_0x3413('0x25')]);router['delete']('/:id/users',auth[_0x3413('0x7')](),controller[_0x3413('0x26')]);router['delete'](_0x3413('0x27'),auth['isAuthenticated'](),controller['removeLists']);router[_0x3413('0x24')](_0x3413('0x17'),auth[_0x3413('0x7')](),controller[_0x3413('0x28')]);module[_0x3413('0x29')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index e640009..b0a423a 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 _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x17f339,_0x1c4422){var _0x529dc2=function(_0x3ff2fd){while(--_0x3ff2fd){_0x17f339['push'](_0x17f339['shift']());}};_0x529dc2(++_0x1c4422);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x487f15,_0x1cf5fb){var _0x32c8a1=function(_0x255c2f){while(--_0x255c2f){_0x487f15['push'](_0x487f15['shift']());}};_0x32c8a1(++_0x1cf5fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('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 cd891a4..3240597 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 _0x720e=['catch','show','rawAttributes','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','role','update','findOne','hasOwnProperty','CmHopper','findAll','getHopperHistories','VoiceQueueId','CmHopperHistory','CmHopperFinal','rows','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','every','TeamId','all','union','removeTeams','isEmpty','addAgents','voicePause','push','format','removeAgents','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','NOW()','scheduledAt','CmListId','cm_contacts','ListId\x20=\x20?','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','fromQuery','ListId','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','count','offset','set','Content-Range','reject','save','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','find','type','name','UserProfileResource','end','error','stack','send','index','key','model','keys','filters','intersection','fields','query','attributes','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','include','VoiceQueue'];(function(_0x555069,_0x23d66a){var _0x100af7=function(_0x1606bd){while(--_0x1606bd){_0x555069['push'](_0x555069['shift']());}};_0x100af7(++_0x23d66a);}(_0x720e,0x1cb));var _0xe720=function(_0x3cc751,_0x38b8ff){_0x3cc751=_0x3cc751-0x0;var _0x3956a2=_0x720e[_0x3cc751];return _0x3956a2;};'use strict';var pdf=require(_0xe720('0x0'));var emlformat=require(_0xe720('0x1'));var rimraf=require(_0xe720('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe720('0x3'));var moment=require('moment');var BPromise=require(_0xe720('0x4'));var Mustache=require(_0xe720('0x5'));var util=require(_0xe720('0x6'));var path=require(_0xe720('0x7'));var sox=require(_0xe720('0x8'));var csv=require(_0xe720('0x9'));var ejs=require(_0xe720('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe720('0xb'));var crypto=require(_0xe720('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe720('0xd'));var Papa=require(_0xe720('0xe'));var Redis=require(_0xe720('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe720('0x10'));var as=require(_0xe720('0x11'));var hardwareService=require(_0xe720('0x12'));var logger=require(_0xe720('0x13'))(_0xe720('0x14'));var utils=require(_0xe720('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xe720('0x16')]=_[_0xe720('0x17')](config[_0xe720('0x16')],{'host':_0xe720('0x18'),'port':0x18eb});var socket=require(_0xe720('0x19'))(new Redis(config[_0xe720('0x16')]));require(_0xe720('0x1a'))[_0xe720('0x1b')](socket);function respondWithStatusCode(_0x3b25e5,_0x4f85fe){_0x4f85fe=_0x4f85fe||0xcc;return function(_0x47e7e9){if(_0x47e7e9){return _0x3b25e5[_0xe720('0x1c')](_0x4f85fe);}return _0x3b25e5[_0xe720('0x1d')](_0x4f85fe)['end']();};}function respondWithResult(_0x312c36,_0x2fd06d){_0x2fd06d=_0x2fd06d||0xc8;return function(_0x539231){if(_0x539231){return _0x312c36[_0xe720('0x1d')](_0x2fd06d)['json'](_0x539231);}};}function respondWithFilteredResult(_0x4307d4,_0x27582e){return function(_0x59ea77){if(_0x59ea77){var _0x3428d3=_0x59ea77[_0xe720('0x1e')],_0x5e4a0c=_0x27582e['offset'],_0x1d75e7=_0x27582e[_0xe720('0x1f')]+_0x27582e['limit'],_0x113590;if(_0x1d75e7>=_0x3428d3){_0x1d75e7=_0x3428d3;_0x113590=0xc8;}else{_0x113590=0xce;}_0x4307d4[_0xe720('0x1d')](_0x113590);return _0x4307d4[_0xe720('0x20')](_0xe720('0x21'),_0x5e4a0c+'-'+_0x1d75e7+'/'+_0x3428d3)['json'](_0x59ea77);}return null;};}function patchUpdates(_0x5b9779){return function(_0x1e2196){try{jsonpatch['apply'](_0x1e2196,_0x5b9779,!![]);}catch(_0x305438){return BPromise[_0xe720('0x22')](_0x305438);}return _0x1e2196[_0xe720('0x23')]();};}function saveUpdates(_0xaa596f,_0xdb9b6){return function(_0x3c1420){if(_0x3c1420){return _0x3c1420['update'](_0xaa596f)[_0xe720('0x24')](function(_0x72c24d){return _0x72c24d;});}return null;};}function removeEntity(_0x4309a5,_0x47b367){return function(_0x210a27){if(_0x210a27){return _0x210a27[_0xe720('0x25')]()[_0xe720('0x24')](function(){var _0xb7dc74=_0x210a27[_0xe720('0x26')]({'plain':!![]});var _0x1bca96=[{'name':_0xe720('0x27'),'value':_0xe720('0x28'),'ignore':![]},{'name':_0xe720('0x29'),'value':_0xe720('0x2a'),'ignore':![]}];var _0x8c0bd8=_(_0x1bca96)[_0xe720('0x2b')]('ignore')[_0xe720('0x2c')](_0xe720('0x2d'))[_0xe720('0x2d')]();if(_[_0xe720('0x2e')](_0x8c0bd8,_0xb7dc74['type'])){return;}var _0x28b6e2=_[_0xe720('0x2f')](_0x1bca96,[_0xe720('0x2d'),_0xb7dc74[_0xe720('0x30')]])[_0xe720('0x31')];return db[_0xe720('0x32')][_0xe720('0x25')]({'where':{'type':_0x28b6e2,'resourceId':_0xb7dc74['id']}})[_0xe720('0x24')](function(){return _0x210a27;});})['then'](function(){_0x4309a5[_0xe720('0x1d')](0xcc)[_0xe720('0x33')]();});}};}function handleEntityNotFound(_0x4b2054,_0x5166dc){return function(_0x42d668){if(!_0x42d668){_0x4b2054[_0xe720('0x1c')](0x194);}return _0x42d668;};}function handleError(_0x39384b,_0x51b4ff){_0x51b4ff=_0x51b4ff||0x1f4;return function(_0x4e6d82){logger[_0xe720('0x34')](_0x4e6d82[_0xe720('0x35')]);if(_0x4e6d82[_0xe720('0x31')]){delete _0x4e6d82[_0xe720('0x31')];}_0x39384b['status'](_0x51b4ff)[_0xe720('0x36')](_0x4e6d82);};}exports[_0xe720('0x37')]=function(_0x21ed87,_0x1d2fdc){var _0x25970f={},_0x1e3722={},_0x389f7a={'count':0x0,'rows':[]};var _0x43dc1f=_[_0xe720('0x2c')](db['VoiceQueue']['rawAttributes'],function(_0x43e06a){return{'name':_0x43e06a['fieldName'],'type':_0x43e06a[_0xe720('0x30')][_0xe720('0x38')]};});_0x1e3722[_0xe720('0x39')]=_[_0xe720('0x2c')](_0x43dc1f,_0xe720('0x31'));_0x1e3722['query']=_[_0xe720('0x3a')](_0x21ed87['query']);_0x1e3722[_0xe720('0x3b')]=_[_0xe720('0x3c')](_0x1e3722[_0xe720('0x39')],_0x1e3722['query']);_0x25970f['attributes']=_[_0xe720('0x3c')](_0x1e3722[_0xe720('0x39')],qs[_0xe720('0x3d')](_0x21ed87[_0xe720('0x3e')][_0xe720('0x3d')]));_0x25970f['attributes']=_0x25970f[_0xe720('0x3f')]['length']?_0x25970f['attributes']:_0x1e3722[_0xe720('0x39')];if(!_0x21ed87[_0xe720('0x3e')]['hasOwnProperty'](_0xe720('0x40'))){_0x25970f[_0xe720('0x41')]=qs[_0xe720('0x41')](_0x21ed87[_0xe720('0x3e')][_0xe720('0x41')]);_0x25970f['offset']=qs[_0xe720('0x1f')](_0x21ed87[_0xe720('0x3e')][_0xe720('0x1f')]);}_0x25970f[_0xe720('0x42')]=qs[_0xe720('0x43')](_0x21ed87[_0xe720('0x3e')][_0xe720('0x43')]);_0x25970f[_0xe720('0x44')]=qs[_0xe720('0x3b')](_[_0xe720('0x45')](_0x21ed87[_0xe720('0x3e')],_0x1e3722[_0xe720('0x3b')]));if(_0x21ed87[_0xe720('0x3e')][_0xe720('0x2b')]){_0x25970f[_0xe720('0x44')]=_[_0xe720('0x46')](_0x25970f['where'],{'$or':_[_0xe720('0x2c')](_0x43dc1f,function(_0x9b9279){if(_0x9b9279[_0xe720('0x30')]!==_0xe720('0x47')){var _0x2c3b22={};_0x2c3b22[_0x9b9279[_0xe720('0x31')]]={'$like':'%'+_0x21ed87[_0xe720('0x3e')][_0xe720('0x2b')]+'%'};return _0x2c3b22;}})});}_0x25970f=_[_0xe720('0x46')]({},_0x25970f,_0x21ed87[_0xe720('0x48')]);var _0x43cbd8={'where':_0x25970f['where']};return db['VoiceQueue'][_0xe720('0x1e')](_0x43cbd8)[_0xe720('0x24')](function(_0x2af4d2){_0x389f7a['count']=_0x2af4d2;if(_0x21ed87[_0xe720('0x3e')]['includeAll']){_0x25970f[_0xe720('0x49')]=[{'all':!![]}];}return db[_0xe720('0x4a')]['findAll'](_0x25970f);})[_0xe720('0x24')](function(_0x57fd09){_0x389f7a['rows']=_0x57fd09;return _0x389f7a;})[_0xe720('0x24')](respondWithFilteredResult(_0x1d2fdc,_0x25970f))[_0xe720('0x4b')](handleError(_0x1d2fdc,null));};exports[_0xe720('0x4c')]=function(_0x19823d,_0x19414a){var _0x53b6e0={'raw':![],'where':{'id':_0x19823d['params']['id']}},_0x42fe67={};_0x42fe67[_0xe720('0x39')]=_[_0xe720('0x3a')](db[_0xe720('0x4a')][_0xe720('0x4d')]);_0x42fe67['query']=_[_0xe720('0x3a')](_0x19823d[_0xe720('0x3e')]);_0x42fe67[_0xe720('0x3b')]=_[_0xe720('0x3c')](_0x42fe67[_0xe720('0x39')],_0x42fe67[_0xe720('0x3e')]);_0x53b6e0['attributes']=_[_0xe720('0x3c')](_0x42fe67[_0xe720('0x39')],qs['fields'](_0x19823d[_0xe720('0x3e')][_0xe720('0x3d')]));_0x53b6e0[_0xe720('0x3f')]=_0x53b6e0['attributes'][_0xe720('0x4e')]?_0x53b6e0[_0xe720('0x3f')]:_0x42fe67[_0xe720('0x39')];if(_0x19823d[_0xe720('0x3e')][_0xe720('0x4f')]){_0x53b6e0['include']=[{'all':!![]}];}_0x53b6e0=_[_0xe720('0x46')]({},_0x53b6e0,_0x19823d['options']);return db[_0xe720('0x4a')][_0xe720('0x2f')](_0x53b6e0)['then'](handleEntityNotFound(_0x19414a,null))[_0xe720('0x24')](respondWithResult(_0x19414a,null))[_0xe720('0x4b')](handleError(_0x19414a,null));};exports[_0xe720('0x50')]=function(_0x41c1d0,_0x3bc7cb){return db[_0xe720('0x4a')]['create'](_0x41c1d0[_0xe720('0x51')],{})['then'](function(_0x119d2a){var _0x56228d=_0x41c1d0[_0xe720('0x52')][_0xe720('0x26')]({'plain':!![]});if(!_0x56228d)throw new Error(_0xe720('0x53'));if(_0x56228d['role']==='user'){var _0x41a0e1=_0x119d2a[_0xe720('0x26')]({'plain':!![]});var _0xea19e4=[{'name':_0xe720('0x27'),'value':_0xe720('0x28')},{'name':_0xe720('0x29'),'value':_0xe720('0x2a')}];var _0x261f4f=_[_0xe720('0x2f')](_0xea19e4,['value',_0x41a0e1[_0xe720('0x30')]])[_0xe720('0x31')];return db['UserProfileSection'][_0xe720('0x2f')]({'where':{'name':_0x261f4f,'userProfileId':_0x56228d[_0xe720('0x54')]},'raw':!![]})[_0xe720('0x24')](function(_0x2cecac){if(_0x2cecac&&_0x2cecac[_0xe720('0x55')]===0x0){return db['UserProfileResource'][_0xe720('0x50')]({'name':_0x41a0e1['name'],'resourceId':_0x41a0e1['id'],'type':_0x2cecac[_0xe720('0x31')],'sectionId':_0x2cecac['id']},{})[_0xe720('0x24')](function(){return _0x119d2a;});}else{return _0x119d2a;}})['catch'](function(_0x3af8f5){logger[_0xe720('0x34')](_0xe720('0x56'),_0x3af8f5);throw _0x3af8f5;});}return _0x119d2a;})[_0xe720('0x24')](respondWithResult(_0x3bc7cb,0xc9))[_0xe720('0x4b')](handleError(_0x3bc7cb,null));};exports[_0xe720('0x57')]=function(_0xb970fe,_0x4cddcb){var _0x23bb98={'where':{'id':_0xb970fe[_0xe720('0x58')]['id']}},_0x109e21={};_0x109e21['model']=_['keys'](db[_0xe720('0x4a')][_0xe720('0x4d')]);_0x23bb98[_0xe720('0x3f')]=_[_0xe720('0x3c')](_0x109e21[_0xe720('0x39')],qs[_0xe720('0x3d')](_0xb970fe[_0xe720('0x3e')][_0xe720('0x3d')]));_0x23bb98[_0xe720('0x3f')]=_0x23bb98[_0xe720('0x3f')][_0xe720('0x4e')]?_0x23bb98['attributes']:_0x109e21[_0xe720('0x39')];if(_0xb970fe[_0xe720('0x3e')][_0xe720('0x4f')]){_0x23bb98[_0xe720('0x49')]=[{'all':!![]}];}_0x23bb98=_[_0xe720('0x46')]({},_0x23bb98,_0xb970fe[_0xe720('0x48')]);return db['VoiceQueue'][_0xe720('0x2f')](_0x23bb98)['then'](handleEntityNotFound(_0x4cddcb,null))[_0xe720('0x24')](function(_0xf3178b){if(_0xf3178b){var _0x4d6fce=_0xf3178b['get']({'plain':!![]});_0x4d6fce=qs[_0xe720('0x59')](_0x4d6fce,['id',_0xe720('0x5a'),_0xe720('0x5b')]);_0xb970fe[_0xe720('0x51')]=_[_0xe720('0x59')](_0xb970fe[_0xe720('0x51')],['id','createdAt',_0xe720('0x5b')]);return db[_0xe720('0x4a')][_0xe720('0x50')](_[_0xe720('0x46')](_0x4d6fce,_0xb970fe[_0xe720('0x51')]),{'include':_0xb970fe[_0xe720('0x3e')][_0xe720('0x4f')]?[{'all':!![]}]:undefined})[_0xe720('0x24')](function(_0x3e3956){var _0xdce1cf=_0xb970fe['user'][_0xe720('0x26')]({'plain':!![]});if(!_0xdce1cf)throw new Error(_0xe720('0x53'));if(_0xdce1cf[_0xe720('0x5c')]===_0xe720('0x52')){var _0x393355=_0x3e3956[_0xe720('0x26')]({'plain':!![]});var _0x3f5b37=[{'name':'VoiceQueues','value':_0xe720('0x28')},{'name':'QueueCampaigns','value':_0xe720('0x2a')}];var _0x3dc187=_[_0xe720('0x2f')](_0x3f5b37,['value',_0x393355[_0xe720('0x30')]])[_0xe720('0x31')];return db['UserProfileSection']['find']({'where':{'name':_0x3dc187,'userProfileId':_0xdce1cf[_0xe720('0x54')]},'raw':!![]})[_0xe720('0x24')](function(_0x2c9a76){if(_0x2c9a76&&_0x2c9a76['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x393355[_0xe720('0x31')],'resourceId':_0x393355['id'],'type':_0x2c9a76[_0xe720('0x31')],'sectionId':_0x2c9a76['id']},{})['then'](function(){return _0x3e3956;});}else{return _0x3e3956;}})[_0xe720('0x4b')](function(_0x57209e){logger[_0xe720('0x34')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57209e);throw _0x57209e;});}return _0x3e3956;});}})[_0xe720('0x24')](respondWithResult(_0x4cddcb,0xc9))[_0xe720('0x4b')](handleError(_0x4cddcb,null));};exports[_0xe720('0x5d')]=function(_0x23178c,_0xbcce1b){if(_0x23178c[_0xe720('0x51')]['id']){delete _0x23178c['body']['id'];}return db['VoiceQueue'][_0xe720('0x2f')]({'where':{'id':_0x23178c[_0xe720('0x58')]['id']}})[_0xe720('0x24')](handleEntityNotFound(_0xbcce1b,null))[_0xe720('0x24')](saveUpdates(_0x23178c['body'],null))['then'](respondWithResult(_0xbcce1b,null))[_0xe720('0x4b')](handleError(_0xbcce1b,null));};exports[_0xe720('0x25')]=function(_0x53c2e0,_0x5226c7){return db[_0xe720('0x4a')][_0xe720('0x2f')]({'where':{'id':_0x53c2e0[_0xe720('0x58')]['id']}})[_0xe720('0x24')](handleEntityNotFound(_0x5226c7,null))[_0xe720('0x24')](removeEntity(_0x5226c7,null))[_0xe720('0x4b')](handleError(_0x5226c7,null));};exports['getHoppers']=function(_0x3f8d21,_0x21a9a4,_0x5b0a85){var _0x8dc1cc={'raw':![],'where':{}};var _0x577773={};var _0x9d3f07={'count':0x0,'rows':[]};return db[_0xe720('0x4a')][_0xe720('0x5e')]({'where':{'id':_0x3f8d21[_0xe720('0x58')]['id']}})['then'](handleEntityNotFound(_0x21a9a4,null))[_0xe720('0x24')](function(_0x58ee5c){if(_0x58ee5c){_0x577773[_0xe720('0x39')]=_[_0xe720('0x3a')](db['CmHopper'][_0xe720('0x4d')]);_0x577773[_0xe720('0x3e')]=_[_0xe720('0x3a')](_0x3f8d21[_0xe720('0x3e')]);_0x577773[_0xe720('0x3b')]=_[_0xe720('0x3c')](_0x577773['model'],_0x577773[_0xe720('0x3e')]);_0x8dc1cc[_0xe720('0x3f')]=_[_0xe720('0x3c')](_0x577773['model'],qs[_0xe720('0x3d')](_0x3f8d21[_0xe720('0x3e')][_0xe720('0x3d')]));_0x8dc1cc[_0xe720('0x3f')]=_0x8dc1cc[_0xe720('0x3f')][_0xe720('0x4e')]?_0x8dc1cc[_0xe720('0x3f')]:_0x577773[_0xe720('0x39')];if(!_0x3f8d21[_0xe720('0x3e')][_0xe720('0x5f')](_0xe720('0x40'))){_0x8dc1cc['limit']=qs[_0xe720('0x41')](_0x3f8d21[_0xe720('0x3e')][_0xe720('0x41')]);_0x8dc1cc[_0xe720('0x1f')]=qs['offset'](_0x3f8d21[_0xe720('0x3e')]['offset']);}_0x8dc1cc['order']=qs['sort'](_0x3f8d21[_0xe720('0x3e')][_0xe720('0x43')]);_0x8dc1cc[_0xe720('0x44')]=qs[_0xe720('0x3b')](_[_0xe720('0x45')](_0x3f8d21[_0xe720('0x3e')],_0x577773[_0xe720('0x3b')]));_0x8dc1cc[_0xe720('0x44')]['VoiceQueueId']=_0x58ee5c['id'];if(_0x3f8d21[_0xe720('0x3e')][_0xe720('0x2b')]){_0x8dc1cc[_0xe720('0x44')]=_['merge'](_0x8dc1cc['where'],{'$or':_[_0xe720('0x2c')](_0x8dc1cc[_0xe720('0x3f')],function(_0x3f4250){var _0x8a8b7={};_0x8a8b7[_0x3f4250]={'$like':'%'+_0x3f8d21[_0xe720('0x3e')][_0xe720('0x2b')]+'%'};return _0x8a8b7;})});}_0x8dc1cc=_[_0xe720('0x46')]({},_0x8dc1cc,_0x3f8d21[_0xe720('0x48')]);return db[_0xe720('0x60')][_0xe720('0x1e')]({'where':_0x8dc1cc[_0xe720('0x44')]})[_0xe720('0x24')](function(_0x1bc0e3){_0x9d3f07['count']=_0x1bc0e3;if(_0x3f8d21[_0xe720('0x3e')][_0xe720('0x4f')]){_0x8dc1cc['include']=[{'all':!![]}];}return db[_0xe720('0x60')][_0xe720('0x61')](_0x8dc1cc);})['then'](function(_0x2e646e){_0x9d3f07['rows']=_0x2e646e;return _0x9d3f07;});}})['then'](respondWithFilteredResult(_0x21a9a4,_0x8dc1cc))[_0xe720('0x4b')](handleError(_0x21a9a4,null));};exports[_0xe720('0x62')]=function(_0x3fea0e,_0xbbb276,_0x3ff726){var _0x5da592={'raw':!![],'where':{}};var _0x242ace={};var _0x133527={'count':0x0,'rows':[]};return db[_0xe720('0x4a')][_0xe720('0x5e')]({'where':{'id':_0x3fea0e['params']['id']}})[_0xe720('0x24')](handleEntityNotFound(_0xbbb276,null))[_0xe720('0x24')](function(_0x4bebed){if(_0x4bebed){_0x242ace[_0xe720('0x39')]=_[_0xe720('0x3a')](db['CmHopperHistory'][_0xe720('0x4d')]);_0x242ace[_0xe720('0x3e')]=_[_0xe720('0x3a')](_0x3fea0e['query']);_0x242ace[_0xe720('0x3b')]=_[_0xe720('0x3c')](_0x242ace[_0xe720('0x39')],_0x242ace['query']);_0x5da592['attributes']=_[_0xe720('0x3c')](_0x242ace[_0xe720('0x39')],qs['fields'](_0x3fea0e[_0xe720('0x3e')][_0xe720('0x3d')]));_0x5da592[_0xe720('0x3f')]=_0x5da592[_0xe720('0x3f')][_0xe720('0x4e')]?_0x5da592['attributes']:_0x242ace[_0xe720('0x39')];if(!_0x3fea0e[_0xe720('0x3e')][_0xe720('0x5f')](_0xe720('0x40'))){_0x5da592[_0xe720('0x41')]=qs['limit'](_0x3fea0e[_0xe720('0x3e')][_0xe720('0x41')]);_0x5da592[_0xe720('0x1f')]=qs[_0xe720('0x1f')](_0x3fea0e[_0xe720('0x3e')]['offset']);}_0x5da592['order']=qs[_0xe720('0x43')](_0x3fea0e[_0xe720('0x3e')][_0xe720('0x43')]);_0x5da592[_0xe720('0x44')]=qs['filters'](_[_0xe720('0x45')](_0x3fea0e['query'],_0x242ace[_0xe720('0x3b')]));_0x5da592[_0xe720('0x44')][_0xe720('0x63')]=_0x4bebed['id'];if(_0x3fea0e[_0xe720('0x3e')][_0xe720('0x2b')]){_0x5da592[_0xe720('0x44')]=_[_0xe720('0x46')](_0x5da592['where'],{'$or':_['map'](_0x5da592['attributes'],function(_0x20e580){var _0x404c2a={};_0x404c2a[_0x20e580]={'$like':'%'+_0x3fea0e[_0xe720('0x3e')]['filter']+'%'};return _0x404c2a;})});}_0x5da592=_[_0xe720('0x46')]({},_0x5da592,_0x3fea0e[_0xe720('0x48')]);return db[_0xe720('0x64')][_0xe720('0x1e')]({'where':_0x5da592[_0xe720('0x44')]})['then'](function(_0x2c9412){_0x133527[_0xe720('0x1e')]=_0x2c9412;if(_0x3fea0e[_0xe720('0x3e')][_0xe720('0x4f')]){_0x5da592['include']=[{'all':!![]}];}return db[_0xe720('0x64')]['findAll'](_0x5da592);})[_0xe720('0x24')](function(_0x172485){_0x133527['rows']=_0x172485;return _0x133527;});}})['then'](respondWithFilteredResult(_0xbbb276,_0x5da592))[_0xe720('0x4b')](handleError(_0xbbb276,null));};exports['getHopperFinals']=function(_0x5325d4,_0x14b5a9,_0x22c857){var _0x5af4dd={'raw':!![],'where':{}};var _0x4b28cb={};var _0x11857c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe720('0x5e')]({'where':{'id':_0x5325d4['params']['id']}})['then'](handleEntityNotFound(_0x14b5a9,null))[_0xe720('0x24')](function(_0xb00480){if(_0xb00480){_0x4b28cb[_0xe720('0x39')]=_['keys'](db[_0xe720('0x65')][_0xe720('0x4d')]);_0x4b28cb[_0xe720('0x3e')]=_['keys'](_0x5325d4[_0xe720('0x3e')]);_0x4b28cb[_0xe720('0x3b')]=_[_0xe720('0x3c')](_0x4b28cb['model'],_0x4b28cb[_0xe720('0x3e')]);_0x5af4dd[_0xe720('0x3f')]=_[_0xe720('0x3c')](_0x4b28cb[_0xe720('0x39')],qs[_0xe720('0x3d')](_0x5325d4['query'][_0xe720('0x3d')]));_0x5af4dd[_0xe720('0x3f')]=_0x5af4dd['attributes'][_0xe720('0x4e')]?_0x5af4dd[_0xe720('0x3f')]:_0x4b28cb['model'];if(!_0x5325d4[_0xe720('0x3e')][_0xe720('0x5f')](_0xe720('0x40'))){_0x5af4dd[_0xe720('0x41')]=qs['limit'](_0x5325d4['query'][_0xe720('0x41')]);_0x5af4dd[_0xe720('0x1f')]=qs[_0xe720('0x1f')](_0x5325d4[_0xe720('0x3e')][_0xe720('0x1f')]);}_0x5af4dd[_0xe720('0x42')]=qs[_0xe720('0x43')](_0x5325d4[_0xe720('0x3e')][_0xe720('0x43')]);_0x5af4dd[_0xe720('0x44')]=qs[_0xe720('0x3b')](_['pick'](_0x5325d4[_0xe720('0x3e')],_0x4b28cb[_0xe720('0x3b')]));_0x5af4dd[_0xe720('0x44')][_0xe720('0x63')]=_0xb00480['id'];if(_0x5325d4[_0xe720('0x3e')][_0xe720('0x2b')]){_0x5af4dd[_0xe720('0x44')]=_['merge'](_0x5af4dd['where'],{'$or':_[_0xe720('0x2c')](_0x5af4dd[_0xe720('0x3f')],function(_0x1d60eb){var _0xfecdb3={};_0xfecdb3[_0x1d60eb]={'$like':'%'+_0x5325d4['query'][_0xe720('0x2b')]+'%'};return _0xfecdb3;})});}_0x5af4dd=_['merge']({},_0x5af4dd,_0x5325d4[_0xe720('0x48')]);return db['CmHopperFinal'][_0xe720('0x1e')]({'where':_0x5af4dd[_0xe720('0x44')]})[_0xe720('0x24')](function(_0x588cdd){_0x11857c[_0xe720('0x1e')]=_0x588cdd;if(_0x5325d4[_0xe720('0x3e')]['includeAll']){_0x5af4dd[_0xe720('0x49')]=[{'all':!![]}];}return db[_0xe720('0x65')][_0xe720('0x61')](_0x5af4dd);})['then'](function(_0x50aa65){_0x11857c[_0xe720('0x66')]=_0x50aa65;return _0x11857c;});}})['then'](respondWithFilteredResult(_0x14b5a9,_0x5af4dd))[_0xe720('0x4b')](handleError(_0x14b5a9,null));};exports[_0xe720('0x67')]=function(_0x36ee6a,_0x1a8436,_0x5974cc){var _0x2cf858={'raw':!![],'where':{}};var _0x2da057={};var _0x12a8d6={'count':0x0,'rows':[]};return db[_0xe720('0x4a')][_0xe720('0x5e')]({'where':{'id':_0x36ee6a['params']['id']}})[_0xe720('0x24')](handleEntityNotFound(_0x1a8436,null))[_0xe720('0x24')](function(_0x1505f3){if(_0x1505f3){_0x2da057[_0xe720('0x39')]=_[_0xe720('0x3a')](db[_0xe720('0x68')][_0xe720('0x4d')]);_0x2da057[_0xe720('0x3e')]=_[_0xe720('0x3a')](_0x36ee6a[_0xe720('0x3e')]);_0x2da057['filters']=_[_0xe720('0x3c')](_0x2da057['model'],_0x2da057['query']);_0x2cf858[_0xe720('0x3f')]=_[_0xe720('0x3c')](_0x2da057['model'],qs[_0xe720('0x3d')](_0x36ee6a['query'][_0xe720('0x3d')]));_0x2cf858[_0xe720('0x3f')]=_0x2cf858[_0xe720('0x3f')][_0xe720('0x4e')]?_0x2cf858[_0xe720('0x3f')]:_0x2da057[_0xe720('0x39')];if(!_0x36ee6a[_0xe720('0x3e')][_0xe720('0x5f')](_0xe720('0x40'))){_0x2cf858[_0xe720('0x41')]=qs[_0xe720('0x41')](_0x36ee6a[_0xe720('0x3e')]['limit']);_0x2cf858[_0xe720('0x1f')]=qs[_0xe720('0x1f')](_0x36ee6a[_0xe720('0x3e')][_0xe720('0x1f')]);}_0x2cf858['order']=qs[_0xe720('0x43')](_0x36ee6a[_0xe720('0x3e')]['sort']);_0x2cf858[_0xe720('0x44')]=qs[_0xe720('0x3b')](_[_0xe720('0x45')](_0x36ee6a['query'],_0x2da057['filters']));_0x2cf858[_0xe720('0x44')][_0xe720('0x63')]=_0x1505f3['id'];if(_0x36ee6a[_0xe720('0x3e')][_0xe720('0x2b')]){_0x2cf858[_0xe720('0x44')]=_[_0xe720('0x46')](_0x2cf858[_0xe720('0x44')],{'$or':_[_0xe720('0x2c')](_0x2cf858[_0xe720('0x3f')],function(_0x242446){var _0x5dc94d={};_0x5dc94d[_0x242446]={'$like':'%'+_0x36ee6a[_0xe720('0x3e')][_0xe720('0x2b')]+'%'};return _0x5dc94d;})});}_0x2cf858=_[_0xe720('0x46')]({},_0x2cf858,_0x36ee6a['options']);return db[_0xe720('0x68')][_0xe720('0x1e')]({'where':_0x2cf858[_0xe720('0x44')]})[_0xe720('0x24')](function(_0x423453){_0x12a8d6['count']=_0x423453;if(_0x36ee6a[_0xe720('0x3e')][_0xe720('0x4f')]){_0x2cf858['include']=[{'all':!![]}];}return db[_0xe720('0x68')][_0xe720('0x61')](_0x2cf858);})[_0xe720('0x24')](function(_0x4066a4){_0x12a8d6['rows']=_0x4066a4;return _0x12a8d6;});}})[_0xe720('0x24')](respondWithFilteredResult(_0x1a8436,_0x2cf858))[_0xe720('0x4b')](handleError(_0x1a8436,null));};exports[_0xe720('0x69')]=function(_0x1a2af1,_0x35f851,_0x3db5c9){var _0x2acf2b={};var _0x2bb534={};var _0x48b64d;var _0x203d37;return db['VoiceQueue'][_0xe720('0x5e')]({'where':{'id':_0x1a2af1['params']['id']}})['then'](handleEntityNotFound(_0x35f851,null))[_0xe720('0x24')](function(_0xf5621f){if(_0xf5621f){_0x48b64d=_0xf5621f;_0x2bb534['model']=_[_0xe720('0x3a')](db['Team'][_0xe720('0x4d')]);_0x2bb534[_0xe720('0x3e')]=_['keys'](_0x1a2af1[_0xe720('0x3e')]);_0x2bb534[_0xe720('0x3b')]=_[_0xe720('0x3c')](_0x2bb534[_0xe720('0x39')],_0x2bb534[_0xe720('0x3e')]);_0x2acf2b[_0xe720('0x3f')]=_['intersection'](_0x2bb534['model'],qs[_0xe720('0x3d')](_0x1a2af1[_0xe720('0x3e')][_0xe720('0x3d')]));_0x2acf2b[_0xe720('0x3f')]=_0x2acf2b['attributes']['length']?_0x2acf2b[_0xe720('0x3f')]:_0x2bb534['model'];_0x2acf2b[_0xe720('0x42')]=qs[_0xe720('0x43')](_0x1a2af1[_0xe720('0x3e')][_0xe720('0x43')]);_0x2acf2b[_0xe720('0x44')]=qs[_0xe720('0x3b')](_[_0xe720('0x45')](_0x1a2af1[_0xe720('0x3e')],_0x2bb534[_0xe720('0x3b')]));if(_0x1a2af1[_0xe720('0x3e')][_0xe720('0x2b')]){_0x2acf2b[_0xe720('0x44')]=_[_0xe720('0x46')](_0x2acf2b['where'],{'$or':_[_0xe720('0x2c')](_0x2acf2b[_0xe720('0x3f')],function(_0x3369f2){var _0x5289d9={};_0x5289d9[_0x3369f2]={'$like':'%'+_0x1a2af1[_0xe720('0x3e')][_0xe720('0x2b')]+'%'};return _0x5289d9;})});}_0x2acf2b=_[_0xe720('0x46')]({},_0x2acf2b,_0x1a2af1[_0xe720('0x48')]);return _0x48b64d[_0xe720('0x69')](_0x2acf2b);}})[_0xe720('0x24')](function(_0x4045e8){if(_0x4045e8){_0x203d37=_0x4045e8[_0xe720('0x4e')];if(!_0x1a2af1['query'][_0xe720('0x5f')](_0xe720('0x40'))){_0x2acf2b['limit']=qs[_0xe720('0x41')](_0x1a2af1[_0xe720('0x3e')][_0xe720('0x41')]);_0x2acf2b['offset']=qs[_0xe720('0x1f')](_0x1a2af1[_0xe720('0x3e')][_0xe720('0x1f')]);}return _0x48b64d[_0xe720('0x69')](_0x2acf2b);}})[_0xe720('0x24')](function(_0x2417db){if(_0x2417db){return _0x2417db?{'count':_0x203d37,'rows':_0x2417db}:null;}})[_0xe720('0x24')](respondWithResult(_0x35f851,null))[_0xe720('0x4b')](handleError(_0x35f851,null));};exports[_0xe720('0x6a')]=function(_0x240579,_0x23b98c,_0x3d2359){var _0x3331c4=_0x240579['body'][_0xe720('0x6b')];var _0x456b46=_[_0xe720('0x2c')](_0x3331c4,'id');return db[_0xe720('0x6c')][_0xe720('0x61')]({'where':{'id':_0x456b46},'attributes':['id'],'include':[{'model':db[_0xe720('0x6d')],'as':_0xe720('0x6e'),'attributes':['id',_0xe720('0x31'),_0xe720('0x6f'),'voicePause',_0xe720('0x70')],'raw':!![]}]})[_0xe720('0x24')](function(_0x4bd391){if(_0x4bd391){var _0x52a268=_[_0xe720('0x71')](_0x4bd391,function(_0x2273e6){var _0x342df7=_0x2273e6[_0xe720('0x26')]({'plain':!![]});_0x342df7[_0xe720('0x6e')][_0xe720('0x72')](function(_0x319643){_0x319643[_0xe720('0x73')]=_[_0xe720('0x2f')](_0x3331c4,{'id':_0x342df7['id']})[_0xe720('0x73')];});return _0x342df7[_0xe720('0x6e')];});return db['VoiceQueue'][_0xe720('0x2f')]({'where':{'id':_0x240579[_0xe720('0x58')]['id']}})['then'](function(_0x2372f1){return db[_0xe720('0x74')][_0xe720('0x75')](function(_0x1020a4){return _0x2372f1[_0xe720('0x6a')](_0x456b46,{'transaction':_0x1020a4})['then'](function(){return BPromise[_0xe720('0x76')](_0x52a268,function(_0x29826b){return db[_0xe720('0x77')]['findOrCreate']({'where':{'UserId':_0x29826b['id'],'VoiceQueueId':_0x240579[_0xe720('0x58')]['id']},'defaults':{'penalty':_0x29826b['penalty']},'transaction':_0x1020a4});});})[_0xe720('0x24')](function(){return BPromise[_0xe720('0x76')](_[_0xe720('0x2b')](_0x52a268,{'online':!![]}),function(_0x55ac6a){return db[_0xe720('0x78')][_0xe720('0x79')]({'membername':_0x55ac6a['name'],'UserId':_0x55ac6a['id'],'queue_name':_0x2372f1[_0xe720('0x31')],'VoiceQueueId':_0x2372f1['id'],'interface':_[_0xe720('0x7a')](_0x55ac6a[_0xe720('0x70')])?util['format'](_0xe720('0x7b'),_0x55ac6a[_0xe720('0x31')]):_0x55ac6a[_0xe720('0x70')],'paused':_0x55ac6a['voicePause']||![],'penalty':_0x55ac6a[_0xe720('0x73')]},{'transaction':_0x1020a4});});})['then'](function(){_0x52a268[_0xe720('0x72')](function(_0x8f643e){socket[_0xe720('0x7c')](_0xe720('0x7d'),{'UserId':_0x8f643e['id'],'VoiceQueueId':_0x2372f1['id']});});});});});}})[_0xe720('0x24')](respondWithStatusCode(_0x23b98c,null))[_0xe720('0x4b')](handleError(_0x23b98c,null));};exports['removeTeams']=function(_0x153438,_0xc75640,_0x515b57){return db[_0xe720('0x6c')][_0xe720('0x61')]({'where':{'id':_0x153438[_0xe720('0x3e')][_0xe720('0x7e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe720('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xc75640,null))['then'](function(_0x2d8c4f){var _0x2ed684=_['map'](_0x2d8c4f,'id');var _0x1094d1=[];var _0x1eff68=[];var _0x177618=squel[_0xe720('0x7f')]();_0x177618[_0xe720('0x80')](_0xe720('0x81'))[_0xe720('0x82')](_0xe720('0x83'),'tq')['join'](_0xe720('0x84'),'ut',_0xe720('0x85'))[_0xe720('0x44')]('VoiceQueueId\x20=\x20?',_0x153438[_0xe720('0x58')]['id']);for(var _0x23d3e1=0x0;_0x23d3e1<_0x2d8c4f[_0xe720('0x4e')];_0x23d3e1+=0x1){let _0x205263=_0x2d8c4f[_0x23d3e1];for(var _0x93470b=0x0;_0x93470b<_0x205263[_0xe720('0x6e')]['length'];_0x93470b+=0x1){let _0x17b515=_0x205263[_0xe720('0x6e')][_0x93470b];var _0x50f357=_0x177618[_0xe720('0x57')]();_0x50f357[_0xe720('0x44')](_0xe720('0x86'),_0x17b515['id']);_0x1eff68['push'](db[_0xe720('0x74')][_0xe720('0x3e')](_0x50f357[_0xe720('0x87')](),{'type':db[_0xe720('0x74')]['QueryTypes']['SELECT']})['then'](function(_0x15dd85){if(_0x15dd85[_0xe720('0x4e')]===0x1){return _0x17b515['id'];}else{var _0x216ecb=_[_0xe720('0x88')](_[_0xe720('0x2c')](_0x15dd85,_0xe720('0x89')),function(_0x323c82){return _[_0xe720('0x2e')](_0x2ed684,_0x323c82);});if(_0x216ecb){return _0x17b515['id'];}}}));}}return BPromise[_0xe720('0x8a')](_0x1eff68)['then'](function(_0x5cd8a3){_0x1094d1=_(_0x1094d1)[_0xe720('0x8b')](_0x5cd8a3)['compact']()[_0xe720('0x2d')]();return db['VoiceQueue'][_0xe720('0x2f')]({'where':{'id':_0x153438[_0xe720('0x58')]['id']}})[_0xe720('0x24')](function(_0xdf06f8){return db[_0xe720('0x74')]['transaction'](function(_0x4df118){return _0xdf06f8[_0xe720('0x8c')](_0x153438[_0xe720('0x3e')][_0xe720('0x7e')],{'transaction':_0x4df118})[_0xe720('0x24')](function(){if(!_[_0xe720('0x8d')](_0x1094d1)){return _0xdf06f8['removeAgents'](_0x1094d1,{'transaction':_0x4df118})['then'](function(){return db[_0xe720('0x78')]['destroy']({'where':{'VoiceQueueId':_0x153438[_0xe720('0x58')]['id'],'UserId':_0x1094d1},'transaction':_0x4df118});});}})['then'](function(){_0x1094d1['forEach'](function(_0x4f7663){socket[_0xe720('0x7c')]('userVoiceQueue:remove',{'UserId':_0x4f7663,'VoiceQueueId':_0xdf06f8['id']});});});});});});})[_0xe720('0x24')](respondWithStatusCode(_0xc75640,null))['catch'](handleError(_0xc75640,null));};exports[_0xe720('0x8e')]=function(_0x176707,_0x31a46b,_0x48979f){var _0x299271,_0x4b223d;return db[_0xe720('0x4a')][_0xe720('0x2f')]({'where':{'id':_0x176707[_0xe720('0x58')]['id']}})[_0xe720('0x24')](handleEntityNotFound(_0x31a46b,null))[_0xe720('0x24')](function(_0x3353b0){if(_0x3353b0){_0x4b223d=_0x3353b0;return _0x3353b0[_0xe720('0x8e')](_0x176707[_0xe720('0x51')][_0xe720('0x7e')],_[_0xe720('0x59')](_0x176707[_0xe720('0x51')],[_0xe720('0x7e'),'id'])||{})['spread'](function(_0x1c18b3){for(var _0x5658fe=0x0;_0x5658fe<_0x176707[_0xe720('0x51')][_0xe720('0x7e')][_0xe720('0x4e')];_0x5658fe+=0x1){socket[_0xe720('0x7c')](_0xe720('0x7d'),{'UserId':_0x176707['body']['ids'][_0x5658fe],'VoiceQueueId':_0x176707['params']['id']});}return _0x1c18b3;});}})[_0xe720('0x24')](function(_0x397706){_0x299271=_0x397706||[];if(_0x4b223d){return db[_0xe720('0x6d')]['findAll']({'where':{'id':_0x176707[_0xe720('0x51')][_0xe720('0x7e')]},'attributes':['id',_0xe720('0x31'),_0xe720('0x6f'),_0xe720('0x8f'),_0xe720('0x70')],'raw':!![]});}})[_0xe720('0x24')](function(_0x2f034a){if(!_[_0xe720('0x8d')](_0x2f034a)){var _0x202f59=[];for(var _0x1b8b48=0x0;_0x1b8b48<_0x2f034a[_0xe720('0x4e')];_0x1b8b48++){if(_0x2f034a[_0x1b8b48]['online']){_0x202f59[_0xe720('0x90')](db[_0xe720('0x78')][_0xe720('0x79')]({'membername':_0x2f034a[_0x1b8b48][_0xe720('0x31')],'UserId':_0x2f034a[_0x1b8b48]['id'],'queue_name':_0x4b223d[_0xe720('0x31')],'VoiceQueueId':_0x4b223d['id'],'interface':_['isNil'](_0x2f034a[_0x1b8b48][_0xe720('0x70')])?util[_0xe720('0x91')](_0xe720('0x7b'),_0x2f034a[_0x1b8b48]['name']):_0x2f034a[_0x1b8b48][_0xe720('0x70')],'paused':_0x2f034a[_0x1b8b48]['voicePause']||![],'penalty':_0x176707[_0xe720('0x51')][_0xe720('0x73')]||0x0}));}}return BPromise['all'](_0x202f59);}})[_0xe720('0x24')](function(){return _0x299271;})[_0xe720('0x24')](respondWithResult(_0x31a46b,null))[_0xe720('0x4b')](handleError(_0x31a46b,null));};exports[_0xe720('0x92')]=function(_0x38aa4a,_0x507950,_0x3bb15e){return db['VoiceQueue'][_0xe720('0x2f')]({'where':{'id':_0x38aa4a[_0xe720('0x58')]['id']}})[_0xe720('0x24')](handleEntityNotFound(_0x507950,null))[_0xe720('0x24')](function(_0x2a1c07){if(_0x2a1c07){return _0x2a1c07[_0xe720('0x92')](_0x38aa4a[_0xe720('0x3e')][_0xe720('0x7e')])[_0xe720('0x24')](function(){if(_['isArray'](_0x38aa4a[_0xe720('0x3e')]['ids'])){for(var _0x4dfcf9=0x0;_0x4dfcf9<_0x38aa4a['query'][_0xe720('0x7e')]['length'];_0x4dfcf9+=0x1){socket[_0xe720('0x7c')](_0xe720('0x93'),{'UserId':Number(_0x38aa4a[_0xe720('0x3e')][_0xe720('0x7e')][_0x4dfcf9]),'VoiceQueueId':Number(_0x38aa4a['params']['id'])});}}else{socket[_0xe720('0x7c')](_0xe720('0x93'),{'UserId':Number(_0x38aa4a[_0xe720('0x3e')]['ids']),'VoiceQueueId':Number(_0x38aa4a[_0xe720('0x58')]['id'])});}});}})[_0xe720('0x24')](function(_0x380662){return db[_0xe720('0x78')][_0xe720('0x25')]({'where':{'VoiceQueueId':_0x38aa4a['params']['id'],'UserId':_0x38aa4a['query'][_0xe720('0x7e')]}})[_0xe720('0x24')](function(){return _0x380662;});})[_0xe720('0x24')](respondWithStatusCode(_0x507950,null))['catch'](handleError(_0x507950,null));};exports[_0xe720('0x94')]=function(_0x543b6b,_0x59262a,_0x414611){var _0x518ac6={};var _0x149698={};var _0x5cb079;var _0x4f9e9c;return db[_0xe720('0x4a')][_0xe720('0x5e')]({'where':{'id':_0x543b6b[_0xe720('0x58')]['id']}})[_0xe720('0x24')](handleEntityNotFound(_0x59262a,null))['then'](function(_0x3125dd){if(_0x3125dd){_0x5cb079=_0x3125dd;_0x149698[_0xe720('0x39')]=_['keys'](db[_0xe720('0x6d')][_0xe720('0x4d')]);_0x149698['query']=_[_0xe720('0x3a')](_0x543b6b[_0xe720('0x3e')]);_0x149698[_0xe720('0x3b')]=_[_0xe720('0x3c')](_0x149698[_0xe720('0x39')],_0x149698[_0xe720('0x3e')]);_0x518ac6['attributes']=_['intersection'](_0x149698[_0xe720('0x39')],qs[_0xe720('0x3d')](_0x543b6b[_0xe720('0x3e')][_0xe720('0x3d')]));_0x518ac6[_0xe720('0x3f')]=_0x518ac6[_0xe720('0x3f')][_0xe720('0x4e')]?_0x518ac6['attributes']:_0x149698[_0xe720('0x39')];_0x518ac6[_0xe720('0x42')]=qs[_0xe720('0x43')](_0x543b6b[_0xe720('0x3e')][_0xe720('0x43')]);_0x518ac6[_0xe720('0x44')]=qs[_0xe720('0x3b')](_[_0xe720('0x45')](_0x543b6b['query'],_0x149698['filters']));if(_0x543b6b['query'][_0xe720('0x2b')]){_0x518ac6[_0xe720('0x44')]=_[_0xe720('0x46')](_0x518ac6[_0xe720('0x44')],{'$or':_[_0xe720('0x2c')](_0x518ac6['attributes'],function(_0x252459){var _0x439c7d={};_0x439c7d[_0x252459]={'$like':'%'+_0x543b6b[_0xe720('0x3e')][_0xe720('0x2b')]+'%'};return _0x439c7d;})});}_0x518ac6=_[_0xe720('0x46')]({},_0x518ac6,_0x543b6b[_0xe720('0x48')]);return _0x5cb079[_0xe720('0x94')](_0x518ac6);}})[_0xe720('0x24')](function(_0x3988bc){if(_0x3988bc){_0x4f9e9c=_0x3988bc[_0xe720('0x4e')];if(!_0x543b6b['query']['hasOwnProperty']('nolimit')){_0x518ac6['limit']=qs[_0xe720('0x41')](_0x543b6b[_0xe720('0x3e')][_0xe720('0x41')]);_0x518ac6['offset']=qs[_0xe720('0x1f')](_0x543b6b[_0xe720('0x3e')][_0xe720('0x1f')]);}return _0x5cb079[_0xe720('0x94')](_0x518ac6);}})[_0xe720('0x24')](function(_0x763efd){if(_0x763efd){return _0x763efd?{'count':_0x4f9e9c,'rows':_0x763efd}:null;}})[_0xe720('0x24')](respondWithResult(_0x59262a,null))[_0xe720('0x4b')](handleError(_0x59262a,null));};exports['getMembers']=function(_0x44d38d,_0x13249b,_0x3939b1){var _0x2cdfe9={};var _0x16141b={};var _0x598019;var _0x5b3439;return db['VoiceQueue'][_0xe720('0x5e')]({'where':{'id':_0x44d38d[_0xe720('0x58')]['id']}})['then'](handleEntityNotFound(_0x13249b,null))[_0xe720('0x24')](function(_0x20142b){if(_0x20142b){_0x598019=_0x20142b;_0x16141b[_0xe720('0x39')]=_['keys'](db[_0xe720('0x78')][_0xe720('0x4d')]);_0x16141b[_0xe720('0x3e')]=_[_0xe720('0x3a')](_0x44d38d[_0xe720('0x3e')]);_0x16141b[_0xe720('0x3b')]=_[_0xe720('0x3c')](_0x16141b[_0xe720('0x39')],_0x16141b['query']);_0x2cdfe9[_0xe720('0x3f')]=_['intersection'](_0x16141b[_0xe720('0x39')],qs[_0xe720('0x3d')](_0x44d38d[_0xe720('0x3e')][_0xe720('0x3d')]));_0x2cdfe9[_0xe720('0x3f')]=_0x2cdfe9[_0xe720('0x3f')][_0xe720('0x4e')]?_0x2cdfe9[_0xe720('0x3f')]:_0x16141b[_0xe720('0x39')];_0x2cdfe9[_0xe720('0x42')]=qs[_0xe720('0x43')](_0x44d38d[_0xe720('0x3e')][_0xe720('0x43')]);_0x2cdfe9[_0xe720('0x44')]=qs[_0xe720('0x3b')](_[_0xe720('0x45')](_0x44d38d[_0xe720('0x3e')],_0x16141b[_0xe720('0x3b')]));if(_0x44d38d[_0xe720('0x3e')][_0xe720('0x2b')]){_0x2cdfe9[_0xe720('0x44')]=_[_0xe720('0x46')](_0x2cdfe9[_0xe720('0x44')],{'$or':_['map'](_0x2cdfe9[_0xe720('0x3f')],function(_0x40ae33){var _0x5e6314={};_0x5e6314[_0x40ae33]={'$like':'%'+_0x44d38d[_0xe720('0x3e')]['filter']+'%'};return _0x5e6314;})});}_0x2cdfe9=_[_0xe720('0x46')]({},_0x2cdfe9,_0x44d38d[_0xe720('0x48')]);return _0x598019[_0xe720('0x95')](_0x2cdfe9);}})[_0xe720('0x24')](function(_0x3a7a68){if(_0x3a7a68){_0x5b3439=_0x3a7a68[_0xe720('0x4e')];if(!_0x44d38d[_0xe720('0x3e')][_0xe720('0x5f')]('nolimit')){_0x2cdfe9[_0xe720('0x41')]=qs[_0xe720('0x41')](_0x44d38d[_0xe720('0x3e')][_0xe720('0x41')]);_0x2cdfe9[_0xe720('0x1f')]=qs[_0xe720('0x1f')](_0x44d38d['query'][_0xe720('0x1f')]);}return _0x598019[_0xe720('0x95')](_0x2cdfe9);}})[_0xe720('0x24')](function(_0x638b30){return _0x638b30?{'count':_0x5b3439,'rows':_0x638b30}:null;})[_0xe720('0x24')](respondWithResult(_0x13249b,null))[_0xe720('0x4b')](handleError(_0x13249b,null));};exports[_0xe720('0x96')]=function(_0x36500a,_0x3b640a,_0x16413d){var _0x12d474={};var _0x5bf2c8={};var _0xdb6873;var _0x1a0fc5;return db[_0xe720('0x4a')]['findOne']({'where':{'id':_0x36500a[_0xe720('0x58')]['id']}})[_0xe720('0x24')](handleEntityNotFound(_0x3b640a,null))[_0xe720('0x24')](function(_0x1ce10d){if(_0x1ce10d){_0xdb6873=_0x1ce10d;_0x5bf2c8['model']=_['keys'](db['CmList'][_0xe720('0x4d')]);_0x5bf2c8[_0xe720('0x3e')]=_[_0xe720('0x3a')](_0x36500a[_0xe720('0x3e')]);_0x5bf2c8[_0xe720('0x3b')]=_[_0xe720('0x3c')](_0x5bf2c8[_0xe720('0x39')],_0x5bf2c8[_0xe720('0x3e')]);_0x12d474['attributes']=_[_0xe720('0x3c')](_0x5bf2c8[_0xe720('0x39')],qs[_0xe720('0x3d')](_0x36500a['query']['fields']));_0x12d474[_0xe720('0x3f')]=_0x12d474[_0xe720('0x3f')][_0xe720('0x4e')]?_0x12d474[_0xe720('0x3f')]:_0x5bf2c8[_0xe720('0x39')];_0x12d474[_0xe720('0x42')]=qs[_0xe720('0x43')](_0x36500a[_0xe720('0x3e')][_0xe720('0x43')]);_0x12d474[_0xe720('0x44')]=qs['filters'](_[_0xe720('0x45')](_0x36500a['query'],_0x5bf2c8['filters']));if(_0x36500a[_0xe720('0x3e')]['filter']){_0x12d474[_0xe720('0x44')]=_[_0xe720('0x46')](_0x12d474['where'],{'$or':_['map'](_0x12d474[_0xe720('0x3f')],function(_0xe90614){var _0x5071a5={};_0x5071a5[_0xe90614]={'$like':'%'+_0x36500a[_0xe720('0x3e')][_0xe720('0x2b')]+'%'};return _0x5071a5;})});}_0x12d474=_['merge']({},_0x12d474,_0x36500a[_0xe720('0x48')]);return _0xdb6873['getLists'](_0x12d474);}})[_0xe720('0x24')](function(_0x16808d){if(_0x16808d){_0x1a0fc5=_0x16808d[_0xe720('0x4e')];if(!_0x36500a[_0xe720('0x3e')][_0xe720('0x5f')](_0xe720('0x40'))){_0x12d474[_0xe720('0x41')]=qs[_0xe720('0x41')](_0x36500a[_0xe720('0x3e')][_0xe720('0x41')]);_0x12d474['offset']=qs[_0xe720('0x1f')](_0x36500a['query'][_0xe720('0x1f')]);}return _0xdb6873['getLists'](_0x12d474);}})[_0xe720('0x24')](function(_0x3c9254){if(_0x3c9254){return _0x3c9254?{'count':_0x1a0fc5,'rows':_0x3c9254}:null;}})[_0xe720('0x24')](respondWithResult(_0x3b640a,null))[_0xe720('0x4b')](handleError(_0x3b640a,null));};exports[_0xe720('0x97')]=function(_0xf7ecb2,_0x2d1b18,_0xebb0d){var _0x21c005,_0x59d99e;return db['VoiceQueue'][_0xe720('0x2f')]({'where':{'id':_0xf7ecb2['params']['id']}})[_0xe720('0x24')](handleEntityNotFound(_0x2d1b18,null))[_0xe720('0x24')](function(_0x247ebb){if(_0x247ebb){_0x59d99e=_0x247ebb;return _0x247ebb[_0xe720('0x97')](_0xf7ecb2[_0xe720('0x51')][_0xe720('0x7e')],_[_0xe720('0x59')](_0xf7ecb2[_0xe720('0x51')],[_0xe720('0x7e'),'id'])||{});}return null;})[_0xe720('0x98')](function(_0x418fbd){var _0x6628f1;_0x21c005=_0x418fbd||[];var _0x22607e=[];if(_0x418fbd){for(var _0x3c03df=0x0;_0x3c03df<_0x418fbd[_0xe720('0x4e')];_0x3c03df+=0x1){var _0xc01ec8=_0x418fbd[_0x3c03df][_0xe720('0x26')]({'plain':!![]});_0x59d99e[_0xe720('0x99')]=_0xf7ecb2[_0xe720('0x51')][_0xe720('0x99')]?_0xf7ecb2[_0xe720('0x51')]['dialCheckDuplicateType']:_0x59d99e[_0xe720('0x99')];switch(_0x59d99e[_0xe720('0x99')]){case _0xe720('0x9a'):_0x6628f1=squel[_0xe720('0x9b')]()[_0xe720('0x9c')](_0xe720('0x9d'))['fromQuery']([_0xe720('0x9e'),'scheduledAt',_0xe720('0x9f'),'ListId',_0xe720('0x63'),_0xe720('0x5a'),_0xe720('0x5b')],squel[_0xe720('0x7f')]()['field'](_0xe720('0x9e'),_0xe720('0x9e'))[_0xe720('0x80')](_0xe720('0xa0'),_0xe720('0xa1'))['field']('id','ContactId')[_0xe720('0x80')](_0xc01ec8[_0xe720('0xa2')][_0xe720('0x87')](),'ListId')[_0xe720('0x80')](_0xf7ecb2[_0xe720('0x58')]['id']['toString'](),_0xe720('0x63'))[_0xe720('0x80')](_0xe720('0xa0'),'createdAt')[_0xe720('0x80')](_0xe720('0xa0'),_0xe720('0x5b'))[_0xe720('0x82')](_0xe720('0xa3'))['where']('deletedAt\x20IS\x20NULL')[_0xe720('0x44')](_0xe720('0xa4'),_0xc01ec8[_0xe720('0xa2')][_0xe720('0x87')]())['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe720('0x7f')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xe720('0x82')](_0xe720('0xa5'))[_0xe720('0x44')](_0xe720('0xa6'),_0xf7ecb2[_0xe720('0x58')]['id'][_0xe720('0x87')]()))[_0xe720('0x44')](_0xe720('0xa7'),squel[_0xe720('0x7f')]()[_0xe720('0x80')]('COALESCE(phone,\x27\x27)')[_0xe720('0x82')](_0xe720('0x9d'))[_0xe720('0x44')](_0xe720('0xa6'),_0xf7ecb2[_0xe720('0x58')]['id']['toString']())))[_0xe720('0x87')]();break;case'onlyIfOpen':_0x6628f1=squel[_0xe720('0x9b')]()['into'](_0xe720('0x9d'))[_0xe720('0xa8')]([_0xe720('0x9e'),_0xe720('0xa1'),_0xe720('0x9f'),_0xe720('0xa9'),'VoiceQueueId',_0xe720('0x5a'),_0xe720('0x5b')],squel[_0xe720('0x7f')]()[_0xe720('0x80')](_0xe720('0x9e'),_0xe720('0x9e'))[_0xe720('0x80')](_0xe720('0xa0'),_0xe720('0xa1'))[_0xe720('0x80')]('id',_0xe720('0x9f'))['field'](_0xc01ec8[_0xe720('0xa2')][_0xe720('0x87')](),_0xe720('0xa9'))[_0xe720('0x80')](_0xf7ecb2['params']['id'][_0xe720('0x87')](),'VoiceQueueId')[_0xe720('0x80')]('NOW()',_0xe720('0x5a'))['field'](_0xe720('0xa0'),'updatedAt')[_0xe720('0x82')](_0xe720('0xa3'))[_0xe720('0x44')](_0xe720('0xaa'))[_0xe720('0x44')]('ListId\x20=\x20?',_0xc01ec8[_0xe720('0xa2')][_0xe720('0x87')]())[_0xe720('0x44')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe720('0x7f')]()['field']('COALESCE(phone,\x27\x27)')[_0xe720('0x82')](_0xe720('0x9d'))[_0xe720('0x44')](_0xe720('0xa6'),_0xf7ecb2[_0xe720('0x58')]['id'][_0xe720('0x87')]())))['toString']();break;default:_0x6628f1=squel['insert']()[_0xe720('0x9c')]('cm_hopper')[_0xe720('0xa8')]([_0xe720('0x9e'),_0xe720('0xa1'),'ContactId',_0xe720('0xa9'),_0xe720('0x63'),'createdAt',_0xe720('0x5b')],squel[_0xe720('0x7f')]()[_0xe720('0x80')](_0xe720('0x9e'),_0xe720('0x9e'))[_0xe720('0x80')](_0xe720('0xa0'),_0xe720('0xa1'))[_0xe720('0x80')]('id','ContactId')[_0xe720('0x80')](_0xc01ec8[_0xe720('0xa2')][_0xe720('0x87')](),'ListId')[_0xe720('0x80')](_0xf7ecb2['params']['id'][_0xe720('0x87')](),_0xe720('0x63'))[_0xe720('0x80')](_0xe720('0xa0'),'createdAt')[_0xe720('0x80')](_0xe720('0xa0'),_0xe720('0x5b'))[_0xe720('0x82')](_0xe720('0xa3'))[_0xe720('0x44')](_0xe720('0xaa'))[_0xe720('0x44')](_0xe720('0xa4'),_0xc01ec8['CmListId'][_0xe720('0x87')]())[_0xe720('0x44')](_0xe720('0xab')))[_0xe720('0x87')]();}_0x22607e[_0xe720('0x90')](db[_0xe720('0x74')]['query'](_0x6628f1));}return BPromise[_0xe720('0x8a')](_0x22607e);}})['then'](function(){return _0x21c005;})[_0xe720('0x24')](respondWithResult(_0x2d1b18,null))[_0xe720('0x4b')](handleError(_0x2d1b18,null));};exports[_0xe720('0xac')]=function(_0x5845f8,_0x19f26c,_0x54de9f){return db[_0xe720('0x4a')][_0xe720('0x2f')]({'where':{'id':_0x5845f8[_0xe720('0x58')]['id']}})[_0xe720('0x24')](handleEntityNotFound(_0x19f26c,null))[_0xe720('0x24')](function(_0x3132c5){if(_0x3132c5){return _0x3132c5[_0xe720('0xac')](_0x5845f8[_0xe720('0x3e')]['ids']);}})['then'](function(_0x984bb6){if(_0x984bb6){return db[_0xe720('0x60')][_0xe720('0x25')]({'where':{'ListId':_0x5845f8[_0xe720('0x3e')][_0xe720('0x7e')],'VoiceQueueId':_0x5845f8[_0xe720('0x58')]['id']}})['then'](function(){return _0x984bb6;});}})[_0xe720('0x24')](respondWithStatusCode(_0x19f26c,null))[_0xe720('0x4b')](handleError(_0x19f26c,null));};exports[_0xe720('0xad')]=function(_0x2eb792,_0x318c26,_0x1497e1){var _0x41c61c={};var _0x2989a0={};var _0x1b5abe;var _0x1fab49;return db[_0xe720('0x4a')]['findOne']({'where':{'id':_0x2eb792['params']['id']}})[_0xe720('0x24')](handleEntityNotFound(_0x318c26,null))[_0xe720('0x24')](function(_0x16901d){if(_0x16901d){_0x1b5abe=_0x16901d;_0x2989a0[_0xe720('0x39')]=_[_0xe720('0x3a')](db[_0xe720('0xae')]['rawAttributes']);_0x2989a0[_0xe720('0x3e')]=_[_0xe720('0x3a')](_0x2eb792[_0xe720('0x3e')]);_0x2989a0['filters']=_[_0xe720('0x3c')](_0x2989a0['model'],_0x2989a0[_0xe720('0x3e')]);_0x41c61c[_0xe720('0x3f')]=_[_0xe720('0x3c')](_0x2989a0[_0xe720('0x39')],qs[_0xe720('0x3d')](_0x2eb792[_0xe720('0x3e')][_0xe720('0x3d')]));_0x41c61c[_0xe720('0x3f')]=_0x41c61c[_0xe720('0x3f')]['length']?_0x41c61c['attributes']:_0x2989a0[_0xe720('0x39')];_0x41c61c[_0xe720('0x42')]=qs['sort'](_0x2eb792['query']['sort']);_0x41c61c[_0xe720('0x44')]=qs[_0xe720('0x3b')](_['pick'](_0x2eb792['query'],_0x2989a0[_0xe720('0x3b')]));if(_0x2eb792[_0xe720('0x3e')][_0xe720('0x2b')]){_0x41c61c[_0xe720('0x44')]=_['merge'](_0x41c61c[_0xe720('0x44')],{'$or':_['map'](_0x41c61c['attributes'],function(_0x9fa83d){var _0x392acd={};_0x392acd[_0x9fa83d]={'$like':'%'+_0x2eb792[_0xe720('0x3e')][_0xe720('0x2b')]+'%'};return _0x392acd;})});}_0x41c61c=_[_0xe720('0x46')]({},_0x41c61c,_0x2eb792['options']);return _0x1b5abe[_0xe720('0xad')](_0x41c61c);}})[_0xe720('0x24')](function(_0x3738b7){if(_0x3738b7){_0x1fab49=_0x3738b7['length'];if(!_0x2eb792[_0xe720('0x3e')][_0xe720('0x5f')](_0xe720('0x40'))){_0x41c61c[_0xe720('0x41')]=qs[_0xe720('0x41')](_0x2eb792[_0xe720('0x3e')][_0xe720('0x41')]);_0x41c61c[_0xe720('0x1f')]=qs[_0xe720('0x1f')](_0x2eb792[_0xe720('0x3e')][_0xe720('0x1f')]);}return _0x1b5abe[_0xe720('0xad')](_0x41c61c);}})[_0xe720('0x24')](function(_0x259e3d){if(_0x259e3d){return _0x259e3d?{'count':_0x1fab49,'rows':_0x259e3d}:null;}})['then'](respondWithResult(_0x318c26,null))[_0xe720('0x4b')](handleError(_0x318c26,null));};exports[_0xe720('0xaf')]=function(_0x2c4313,_0xc65363,_0x4c5350){var _0x4fd7ab,_0x5b79e6;return db[_0xe720('0x4a')][_0xe720('0x2f')]({'where':{'id':_0x2c4313[_0xe720('0x58')]['id']}})[_0xe720('0x24')](handleEntityNotFound(_0xc65363,null))[_0xe720('0x24')](function(_0x5ae749){if(_0x5ae749){_0x5b79e6=_0x5ae749;return _0x5ae749[_0xe720('0xaf')](_0x2c4313[_0xe720('0x51')]['ids'],_['omit'](_0x2c4313[_0xe720('0x51')],[_0xe720('0x7e'),'id'])||{});}return null;})[_0xe720('0x98')](function(_0x2fbe58){var _0x1f5fb0;_0x4fd7ab=_0x2fbe58||[];var _0x492982=[];if(_0x2fbe58){for(var _0x70fa17=0x0;_0x70fa17<_0x2fbe58[_0xe720('0x4e')];_0x70fa17+=0x1){var _0x5dcfa7=_0x2fbe58[_0x70fa17][_0xe720('0x26')]({'plain':!![]});_0x1f5fb0=squel[_0xe720('0x9b')]()[_0xe720('0x9c')](_0xe720('0xb0'))[_0xe720('0xa8')]([_0xe720('0x9e'),_0xe720('0x9f'),_0xe720('0xa9'),_0xe720('0x63'),_0xe720('0x5a'),_0xe720('0x5b')],squel['select']()[_0xe720('0x80')](_0xe720('0x9e'),_0xe720('0x9e'))[_0xe720('0x80')]('id',_0xe720('0x9f'))[_0xe720('0x80')](_0x5dcfa7['CmListId']['toString'](),_0xe720('0xa9'))['field'](_0x2c4313[_0xe720('0x58')]['id']['toString'](),_0xe720('0x63'))[_0xe720('0x80')]('NOW()','createdAt')[_0xe720('0x80')](_0xe720('0xa0'),_0xe720('0x5b'))[_0xe720('0x82')](_0xe720('0xa3'))[_0xe720('0x44')]('deletedAt\x20IS\x20NULL')[_0xe720('0x44')](_0xe720('0xa4'),_0x5dcfa7[_0xe720('0xa2')][_0xe720('0x87')]())[_0xe720('0x44')](_0xe720('0xab')))[_0xe720('0x87')]();_0x492982[_0xe720('0x90')](db[_0xe720('0x74')]['query'](_0x1f5fb0));}return BPromise[_0xe720('0x8a')](_0x492982);}})['then'](function(){return _0x4fd7ab;})[_0xe720('0x24')](respondWithResult(_0xc65363,null))[_0xe720('0x4b')](handleError(_0xc65363,null));};exports[_0xe720('0xb1')]=function(_0x540181,_0x41e448,_0x479faf){return db[_0xe720('0x4a')][_0xe720('0x2f')]({'where':{'id':_0x540181[_0xe720('0x58')]['id']}})[_0xe720('0x24')](handleEntityNotFound(_0x41e448,null))[_0xe720('0x24')](function(_0x3c21ef){if(_0x3c21ef){return _0x3c21ef[_0xe720('0xb1')](_0x540181['query']['ids']);}})[_0xe720('0x24')](function(_0x2b1543){if(_0x2b1543){return db[_0xe720('0x68')]['destroy']({'where':{'ListId':_0x540181['query'][_0xe720('0x7e')],'VoiceQueueId':_0x540181[_0xe720('0x58')]['id']}})[_0xe720('0x24')](function(){return _0x2b1543;});}})[_0xe720('0x24')](respondWithStatusCode(_0x41e448,null))[_0xe720('0x4b')](handleError(_0x41e448,null));}; \ No newline at end of file +var _0xdf92=['getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','each','findOrCreate','UserVoiceQueueRt','upsert','format','SIP/%s','forEach','emit','userVoiceQueue:save','ids','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','TeamId','all','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','push','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','NOW()','ContactId','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','phone','cm_contacts','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','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','api','../../mysqldb','defaults','redis','./voiceQueue.socket','register','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','then','destroy','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','UserProfileResource','error','stack','name','send','index','map','VoiceQueue','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','params','keys','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','role','UserProfileSection','update','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','VoiceQueueId','findAll','rows','getHopperHistories','CmHopperHistory'];(function(_0xc618bc,_0x42b9e4){var _0x462e3f=function(_0x10e4ff){while(--_0x10e4ff){_0xc618bc['push'](_0xc618bc['shift']());}};_0x462e3f(++_0x42b9e4);}(_0xdf92,0x10c));var _0x2df9=function(_0x41e429,_0x168fd){_0x41e429=_0x41e429-0x0;var _0x3124e=_0xdf92[_0x41e429];return _0x3124e;};'use strict';var pdf=require(_0x2df9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2df9('0x1'));var jsonpatch=require(_0x2df9('0x2'));var rp=require(_0x2df9('0x3'));var moment=require(_0x2df9('0x4'));var BPromise=require(_0x2df9('0x5'));var Mustache=require(_0x2df9('0x6'));var util=require(_0x2df9('0x7'));var path=require(_0x2df9('0x8'));var sox=require(_0x2df9('0x9'));var csv=require(_0x2df9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2df9('0xb'));var squel=require(_0x2df9('0xc'));var crypto=require(_0x2df9('0xd'));var jsforce=require(_0x2df9('0xe'));var deskjs=require(_0x2df9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2df9('0x10'));var Papa=require(_0x2df9('0x11'));var Redis=require(_0x2df9('0x12'));var authService=require(_0x2df9('0x13'));var qs=require(_0x2df9('0x14'));var as=require(_0x2df9('0x15'));var hardwareService=require(_0x2df9('0x16'));var logger=require(_0x2df9('0x17'))(_0x2df9('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2df9('0x19'))['db'];config['redis']=_[_0x2df9('0x1a')](config[_0x2df9('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2df9('0x1b')]));require(_0x2df9('0x1c'))[_0x2df9('0x1d')](socket);function respondWithStatusCode(_0x2be1d2,_0x5737dc){_0x5737dc=_0x5737dc||0xcc;return function(_0x2dc037){if(_0x2dc037){return _0x2be1d2[_0x2df9('0x1e')](_0x5737dc);}return _0x2be1d2[_0x2df9('0x1f')](_0x5737dc)[_0x2df9('0x20')]();};}function respondWithResult(_0x3e5ec5,_0x544736){_0x544736=_0x544736||0xc8;return function(_0x1a955a){if(_0x1a955a){return _0x3e5ec5[_0x2df9('0x1f')](_0x544736)['json'](_0x1a955a);}};}function respondWithFilteredResult(_0x3eb28b,_0x3e19b9){return function(_0x19524e){if(_0x19524e){var _0xd48d46=_0x19524e[_0x2df9('0x21')],_0x2ed7e3=_0x3e19b9['offset'],_0x46763a=_0x3e19b9[_0x2df9('0x22')]+_0x3e19b9['limit'],_0x4e6e3e;if(_0x46763a>=_0xd48d46){_0x46763a=_0xd48d46;_0x4e6e3e=0xc8;}else{_0x4e6e3e=0xce;}_0x3eb28b[_0x2df9('0x1f')](_0x4e6e3e);return _0x3eb28b['set'](_0x2df9('0x23'),_0x2ed7e3+'-'+_0x46763a+'/'+_0xd48d46)[_0x2df9('0x24')](_0x19524e);}return null;};}function patchUpdates(_0x2bf7ff){return function(_0x110d9b){try{jsonpatch[_0x2df9('0x25')](_0x110d9b,_0x2bf7ff,!![]);}catch(_0xf37b82){return BPromise[_0x2df9('0x26')](_0xf37b82);}return _0x110d9b[_0x2df9('0x27')]();};}function saveUpdates(_0x4b70f5,_0x5a1586){return function(_0x38fa9f){if(_0x38fa9f){return _0x38fa9f['update'](_0x4b70f5)[_0x2df9('0x28')](function(_0x37a1c4){return _0x37a1c4;});}return null;};}function removeEntity(_0x160a25,_0x294fea){return function(_0x41150b){if(_0x41150b){return _0x41150b[_0x2df9('0x29')]()['then'](function(){var _0x5c77a0=_0x41150b['get']({'plain':!![]});var _0x59c2bb=[{'name':'VoiceQueues','value':_0x2df9('0x2a'),'ignore':![]},{'name':_0x2df9('0x2b'),'value':_0x2df9('0x2c'),'ignore':![]}];var _0x19855e=_(_0x59c2bb)[_0x2df9('0x2d')](_0x2df9('0x2e'))['map'](_0x2df9('0x2f'))[_0x2df9('0x2f')]();if(_[_0x2df9('0x30')](_0x19855e,_0x5c77a0[_0x2df9('0x31')])){return;}var _0x588fe5=_[_0x2df9('0x32')](_0x59c2bb,[_0x2df9('0x2f'),_0x5c77a0[_0x2df9('0x31')]])['name'];return db[_0x2df9('0x33')][_0x2df9('0x29')]({'where':{'type':_0x588fe5,'resourceId':_0x5c77a0['id']}})[_0x2df9('0x28')](function(){return _0x41150b;});})[_0x2df9('0x28')](function(){_0x160a25[_0x2df9('0x1f')](0xcc)[_0x2df9('0x20')]();});}};}function handleEntityNotFound(_0x1e010f,_0x5d96f6){return function(_0x43726b){if(!_0x43726b){_0x1e010f['sendStatus'](0x194);}return _0x43726b;};}function handleError(_0x32a11e,_0x3f0a65){_0x3f0a65=_0x3f0a65||0x1f4;return function(_0x3b0ace){logger[_0x2df9('0x34')](_0x3b0ace[_0x2df9('0x35')]);if(_0x3b0ace[_0x2df9('0x36')]){delete _0x3b0ace['name'];}_0x32a11e[_0x2df9('0x1f')](_0x3f0a65)[_0x2df9('0x37')](_0x3b0ace);};}exports[_0x2df9('0x38')]=function(_0x2957b4,_0x90ec05){var _0x366c60={},_0x98f0bd={},_0x50b2d1={'count':0x0,'rows':[]};var _0x4c371b=_[_0x2df9('0x39')](db[_0x2df9('0x3a')][_0x2df9('0x3b')],function(_0x6e6e72){return{'name':_0x6e6e72[_0x2df9('0x3c')],'type':_0x6e6e72[_0x2df9('0x31')][_0x2df9('0x3d')]};});_0x98f0bd['model']=_[_0x2df9('0x39')](_0x4c371b,_0x2df9('0x36'));_0x98f0bd[_0x2df9('0x3e')]=_['keys'](_0x2957b4[_0x2df9('0x3e')]);_0x98f0bd[_0x2df9('0x3f')]=_[_0x2df9('0x40')](_0x98f0bd[_0x2df9('0x41')],_0x98f0bd[_0x2df9('0x3e')]);_0x366c60[_0x2df9('0x42')]=_['intersection'](_0x98f0bd[_0x2df9('0x41')],qs[_0x2df9('0x43')](_0x2957b4[_0x2df9('0x3e')]['fields']));_0x366c60[_0x2df9('0x42')]=_0x366c60[_0x2df9('0x42')][_0x2df9('0x44')]?_0x366c60[_0x2df9('0x42')]:_0x98f0bd['model'];if(!_0x2957b4[_0x2df9('0x3e')]['hasOwnProperty']('nolimit')){_0x366c60[_0x2df9('0x45')]=qs[_0x2df9('0x45')](_0x2957b4[_0x2df9('0x3e')][_0x2df9('0x45')]);_0x366c60['offset']=qs[_0x2df9('0x22')](_0x2957b4[_0x2df9('0x3e')][_0x2df9('0x22')]);}_0x366c60[_0x2df9('0x46')]=qs[_0x2df9('0x47')](_0x2957b4[_0x2df9('0x3e')][_0x2df9('0x47')]);_0x366c60[_0x2df9('0x48')]=qs[_0x2df9('0x3f')](_[_0x2df9('0x49')](_0x2957b4[_0x2df9('0x3e')],_0x98f0bd['filters']));if(_0x2957b4[_0x2df9('0x3e')][_0x2df9('0x2d')]){_0x366c60[_0x2df9('0x48')]=_[_0x2df9('0x4a')](_0x366c60[_0x2df9('0x48')],{'$or':_[_0x2df9('0x39')](_0x4c371b,function(_0x50ed9a){if(_0x50ed9a[_0x2df9('0x31')]!==_0x2df9('0x4b')){var _0x49036c={};_0x49036c[_0x50ed9a[_0x2df9('0x36')]]={'$like':'%'+_0x2957b4['query'][_0x2df9('0x2d')]+'%'};return _0x49036c;}})});}_0x366c60=_[_0x2df9('0x4a')]({},_0x366c60,_0x2957b4[_0x2df9('0x4c')]);var _0x407a8b={'where':_0x366c60[_0x2df9('0x48')]};return db[_0x2df9('0x3a')][_0x2df9('0x21')](_0x407a8b)[_0x2df9('0x28')](function(_0x39698a){_0x50b2d1[_0x2df9('0x21')]=_0x39698a;if(_0x2957b4[_0x2df9('0x3e')][_0x2df9('0x4d')]){_0x366c60[_0x2df9('0x4e')]=[{'all':!![]}];}return db[_0x2df9('0x3a')]['findAll'](_0x366c60);})[_0x2df9('0x28')](function(_0x4a5134){_0x50b2d1['rows']=_0x4a5134;return _0x50b2d1;})['then'](respondWithFilteredResult(_0x90ec05,_0x366c60))['catch'](handleError(_0x90ec05,null));};exports['show']=function(_0x976c6e,_0x274268){var _0xb78868={'raw':![],'where':{'id':_0x976c6e[_0x2df9('0x4f')]['id']}},_0xd34970={};_0xd34970[_0x2df9('0x41')]=_[_0x2df9('0x50')](db[_0x2df9('0x3a')]['rawAttributes']);_0xd34970[_0x2df9('0x3e')]=_['keys'](_0x976c6e[_0x2df9('0x3e')]);_0xd34970[_0x2df9('0x3f')]=_[_0x2df9('0x40')](_0xd34970['model'],_0xd34970[_0x2df9('0x3e')]);_0xb78868[_0x2df9('0x42')]=_['intersection'](_0xd34970[_0x2df9('0x41')],qs['fields'](_0x976c6e[_0x2df9('0x3e')]['fields']));_0xb78868['attributes']=_0xb78868[_0x2df9('0x42')][_0x2df9('0x44')]?_0xb78868['attributes']:_0xd34970[_0x2df9('0x41')];if(_0x976c6e[_0x2df9('0x3e')][_0x2df9('0x4d')]){_0xb78868['include']=[{'all':!![]}];}_0xb78868=_[_0x2df9('0x4a')]({},_0xb78868,_0x976c6e[_0x2df9('0x4c')]);return db[_0x2df9('0x3a')][_0x2df9('0x32')](_0xb78868)[_0x2df9('0x28')](handleEntityNotFound(_0x274268,null))[_0x2df9('0x28')](respondWithResult(_0x274268,null))[_0x2df9('0x51')](handleError(_0x274268,null));};exports[_0x2df9('0x52')]=function(_0x30d5a7,_0x46c416){return db[_0x2df9('0x3a')][_0x2df9('0x52')](_0x30d5a7[_0x2df9('0x53')],{})[_0x2df9('0x28')](function(_0x316f86){var _0x3e73a3=_0x30d5a7[_0x2df9('0x54')][_0x2df9('0x55')]({'plain':!![]});if(!_0x3e73a3)throw new Error(_0x2df9('0x56'));if(_0x3e73a3['role']===_0x2df9('0x54')){var _0x2efdef=_0x316f86[_0x2df9('0x55')]({'plain':!![]});var _0x37ce18=[{'name':_0x2df9('0x57'),'value':'inbound'},{'name':_0x2df9('0x2b'),'value':_0x2df9('0x2c')}];var _0x4392bd=_[_0x2df9('0x32')](_0x37ce18,[_0x2df9('0x2f'),_0x2efdef[_0x2df9('0x31')]])[_0x2df9('0x36')];return db['UserProfileSection']['find']({'where':{'name':_0x4392bd,'userProfileId':_0x3e73a3[_0x2df9('0x58')]},'raw':!![]})[_0x2df9('0x28')](function(_0x7bf0c5){if(_0x7bf0c5&&_0x7bf0c5[_0x2df9('0x59')]===0x0){return db[_0x2df9('0x33')]['create']({'name':_0x2efdef[_0x2df9('0x36')],'resourceId':_0x2efdef['id'],'type':_0x7bf0c5[_0x2df9('0x36')],'sectionId':_0x7bf0c5['id']},{})[_0x2df9('0x28')](function(){return _0x316f86;});}else{return _0x316f86;}})['catch'](function(_0x1bec31){logger['error'](_0x2df9('0x5a'),_0x1bec31);throw _0x1bec31;});}return _0x316f86;})['then'](respondWithResult(_0x46c416,0xc9))[_0x2df9('0x51')](handleError(_0x46c416,null));};exports[_0x2df9('0x5b')]=function(_0x5e3196,_0x6b0830){var _0x7fc7b8={'where':{'id':_0x5e3196[_0x2df9('0x4f')]['id']}},_0x40334d={};_0x40334d[_0x2df9('0x41')]=_[_0x2df9('0x50')](db[_0x2df9('0x3a')][_0x2df9('0x3b')]);_0x7fc7b8[_0x2df9('0x42')]=_['intersection'](_0x40334d[_0x2df9('0x41')],qs[_0x2df9('0x43')](_0x5e3196[_0x2df9('0x3e')][_0x2df9('0x43')]));_0x7fc7b8[_0x2df9('0x42')]=_0x7fc7b8[_0x2df9('0x42')][_0x2df9('0x44')]?_0x7fc7b8[_0x2df9('0x42')]:_0x40334d[_0x2df9('0x41')];if(_0x5e3196['query'][_0x2df9('0x4d')]){_0x7fc7b8[_0x2df9('0x4e')]=[{'all':!![]}];}_0x7fc7b8=_[_0x2df9('0x4a')]({},_0x7fc7b8,_0x5e3196[_0x2df9('0x4c')]);return db['VoiceQueue'][_0x2df9('0x32')](_0x7fc7b8)[_0x2df9('0x28')](handleEntityNotFound(_0x6b0830,null))[_0x2df9('0x28')](function(_0x2835df){if(_0x2835df){var _0x2045fd=_0x2835df[_0x2df9('0x55')]({'plain':!![]});_0x2045fd=qs[_0x2df9('0x5c')](_0x2045fd,['id','createdAt',_0x2df9('0x5d')]);_0x5e3196[_0x2df9('0x53')]=_[_0x2df9('0x5c')](_0x5e3196[_0x2df9('0x53')],['id',_0x2df9('0x5e'),_0x2df9('0x5d')]);return db[_0x2df9('0x3a')]['create'](_['merge'](_0x2045fd,_0x5e3196[_0x2df9('0x53')]),{'include':_0x5e3196[_0x2df9('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0x2df9('0x28')](function(_0x1ba18c){var _0x142d75=_0x5e3196['user'][_0x2df9('0x55')]({'plain':!![]});if(!_0x142d75)throw new Error(_0x2df9('0x56'));if(_0x142d75[_0x2df9('0x5f')]===_0x2df9('0x54')){var _0x285612=_0x1ba18c[_0x2df9('0x55')]({'plain':!![]});var _0x4268a1=[{'name':_0x2df9('0x57'),'value':_0x2df9('0x2a')},{'name':_0x2df9('0x2b'),'value':_0x2df9('0x2c')}];var _0x4df79c=_[_0x2df9('0x32')](_0x4268a1,[_0x2df9('0x2f'),_0x285612[_0x2df9('0x31')]])[_0x2df9('0x36')];return db[_0x2df9('0x60')][_0x2df9('0x32')]({'where':{'name':_0x4df79c,'userProfileId':_0x142d75['userProfileId']},'raw':!![]})[_0x2df9('0x28')](function(_0x5d81f5){if(_0x5d81f5&&_0x5d81f5[_0x2df9('0x59')]===0x0){return db[_0x2df9('0x33')][_0x2df9('0x52')]({'name':_0x285612[_0x2df9('0x36')],'resourceId':_0x285612['id'],'type':_0x5d81f5[_0x2df9('0x36')],'sectionId':_0x5d81f5['id']},{})['then'](function(){return _0x1ba18c;});}else{return _0x1ba18c;}})[_0x2df9('0x51')](function(_0xf0d41e){logger['error'](_0x2df9('0x5a'),_0xf0d41e);throw _0xf0d41e;});}return _0x1ba18c;});}})[_0x2df9('0x28')](respondWithResult(_0x6b0830,0xc9))[_0x2df9('0x51')](handleError(_0x6b0830,null));};exports[_0x2df9('0x61')]=function(_0x21828d,_0x56d5f2){if(_0x21828d[_0x2df9('0x53')]['id']){delete _0x21828d[_0x2df9('0x53')]['id'];}return db[_0x2df9('0x3a')][_0x2df9('0x32')]({'where':{'id':_0x21828d['params']['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x56d5f2,null))[_0x2df9('0x28')](saveUpdates(_0x21828d[_0x2df9('0x53')],null))[_0x2df9('0x28')](respondWithResult(_0x56d5f2,null))['catch'](handleError(_0x56d5f2,null));};exports[_0x2df9('0x29')]=function(_0x10b42b,_0x276f37){return db[_0x2df9('0x3a')][_0x2df9('0x32')]({'where':{'id':_0x10b42b[_0x2df9('0x4f')]['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x276f37,null))['then'](removeEntity(_0x276f37,null))['catch'](handleError(_0x276f37,null));};exports[_0x2df9('0x62')]=function(_0x20bb7e,_0x1d9bd4,_0x259975){var _0x25edca={'raw':![],'where':{}};var _0x35c466={};var _0x434c54={'count':0x0,'rows':[]};return db[_0x2df9('0x3a')][_0x2df9('0x63')]({'where':{'id':_0x20bb7e[_0x2df9('0x4f')]['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x1d9bd4,null))[_0x2df9('0x28')](function(_0x26f977){if(_0x26f977){_0x35c466['model']=_[_0x2df9('0x50')](db[_0x2df9('0x64')]['rawAttributes']);_0x35c466[_0x2df9('0x3e')]=_[_0x2df9('0x50')](_0x20bb7e[_0x2df9('0x3e')]);_0x35c466[_0x2df9('0x3f')]=_[_0x2df9('0x40')](_0x35c466['model'],_0x35c466[_0x2df9('0x3e')]);_0x25edca[_0x2df9('0x42')]=_[_0x2df9('0x40')](_0x35c466[_0x2df9('0x41')],qs[_0x2df9('0x43')](_0x20bb7e[_0x2df9('0x3e')][_0x2df9('0x43')]));_0x25edca[_0x2df9('0x42')]=_0x25edca[_0x2df9('0x42')]['length']?_0x25edca[_0x2df9('0x42')]:_0x35c466[_0x2df9('0x41')];if(!_0x20bb7e[_0x2df9('0x3e')][_0x2df9('0x65')](_0x2df9('0x66'))){_0x25edca[_0x2df9('0x45')]=qs[_0x2df9('0x45')](_0x20bb7e[_0x2df9('0x3e')][_0x2df9('0x45')]);_0x25edca['offset']=qs['offset'](_0x20bb7e[_0x2df9('0x3e')][_0x2df9('0x22')]);}_0x25edca[_0x2df9('0x46')]=qs[_0x2df9('0x47')](_0x20bb7e['query'][_0x2df9('0x47')]);_0x25edca[_0x2df9('0x48')]=qs[_0x2df9('0x3f')](_[_0x2df9('0x49')](_0x20bb7e[_0x2df9('0x3e')],_0x35c466[_0x2df9('0x3f')]));_0x25edca['where'][_0x2df9('0x67')]=_0x26f977['id'];if(_0x20bb7e[_0x2df9('0x3e')][_0x2df9('0x2d')]){_0x25edca['where']=_[_0x2df9('0x4a')](_0x25edca['where'],{'$or':_[_0x2df9('0x39')](_0x25edca[_0x2df9('0x42')],function(_0x44db0d){var _0x5cfb23={};_0x5cfb23[_0x44db0d]={'$like':'%'+_0x20bb7e[_0x2df9('0x3e')][_0x2df9('0x2d')]+'%'};return _0x5cfb23;})});}_0x25edca=_[_0x2df9('0x4a')]({},_0x25edca,_0x20bb7e[_0x2df9('0x4c')]);return db[_0x2df9('0x64')][_0x2df9('0x21')]({'where':_0x25edca[_0x2df9('0x48')]})[_0x2df9('0x28')](function(_0x478320){_0x434c54[_0x2df9('0x21')]=_0x478320;if(_0x20bb7e[_0x2df9('0x3e')]['includeAll']){_0x25edca[_0x2df9('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0x2df9('0x68')](_0x25edca);})[_0x2df9('0x28')](function(_0x460779){_0x434c54[_0x2df9('0x69')]=_0x460779;return _0x434c54;});}})['then'](respondWithFilteredResult(_0x1d9bd4,_0x25edca))[_0x2df9('0x51')](handleError(_0x1d9bd4,null));};exports[_0x2df9('0x6a')]=function(_0x4b845b,_0x59cbf9,_0x5362bd){var _0x2a49cf={'raw':!![],'where':{}};var _0x418ffe={};var _0x586efe={'count':0x0,'rows':[]};return db[_0x2df9('0x3a')][_0x2df9('0x63')]({'where':{'id':_0x4b845b['params']['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x59cbf9,null))[_0x2df9('0x28')](function(_0xae14ed){if(_0xae14ed){_0x418ffe[_0x2df9('0x41')]=_[_0x2df9('0x50')](db[_0x2df9('0x6b')][_0x2df9('0x3b')]);_0x418ffe['query']=_[_0x2df9('0x50')](_0x4b845b[_0x2df9('0x3e')]);_0x418ffe[_0x2df9('0x3f')]=_['intersection'](_0x418ffe['model'],_0x418ffe['query']);_0x2a49cf[_0x2df9('0x42')]=_[_0x2df9('0x40')](_0x418ffe['model'],qs[_0x2df9('0x43')](_0x4b845b[_0x2df9('0x3e')][_0x2df9('0x43')]));_0x2a49cf[_0x2df9('0x42')]=_0x2a49cf[_0x2df9('0x42')]['length']?_0x2a49cf[_0x2df9('0x42')]:_0x418ffe[_0x2df9('0x41')];if(!_0x4b845b[_0x2df9('0x3e')][_0x2df9('0x65')]('nolimit')){_0x2a49cf[_0x2df9('0x45')]=qs[_0x2df9('0x45')](_0x4b845b['query'][_0x2df9('0x45')]);_0x2a49cf[_0x2df9('0x22')]=qs[_0x2df9('0x22')](_0x4b845b['query'][_0x2df9('0x22')]);}_0x2a49cf[_0x2df9('0x46')]=qs[_0x2df9('0x47')](_0x4b845b[_0x2df9('0x3e')][_0x2df9('0x47')]);_0x2a49cf[_0x2df9('0x48')]=qs[_0x2df9('0x3f')](_[_0x2df9('0x49')](_0x4b845b[_0x2df9('0x3e')],_0x418ffe[_0x2df9('0x3f')]));_0x2a49cf[_0x2df9('0x48')][_0x2df9('0x67')]=_0xae14ed['id'];if(_0x4b845b[_0x2df9('0x3e')][_0x2df9('0x2d')]){_0x2a49cf[_0x2df9('0x48')]=_[_0x2df9('0x4a')](_0x2a49cf[_0x2df9('0x48')],{'$or':_[_0x2df9('0x39')](_0x2a49cf[_0x2df9('0x42')],function(_0x20cbe4){var _0x197a72={};_0x197a72[_0x20cbe4]={'$like':'%'+_0x4b845b[_0x2df9('0x3e')][_0x2df9('0x2d')]+'%'};return _0x197a72;})});}_0x2a49cf=_[_0x2df9('0x4a')]({},_0x2a49cf,_0x4b845b[_0x2df9('0x4c')]);return db[_0x2df9('0x6b')][_0x2df9('0x21')]({'where':_0x2a49cf[_0x2df9('0x48')]})[_0x2df9('0x28')](function(_0x2f75de){_0x586efe[_0x2df9('0x21')]=_0x2f75de;if(_0x4b845b[_0x2df9('0x3e')][_0x2df9('0x4d')]){_0x2a49cf[_0x2df9('0x4e')]=[{'all':!![]}];}return db[_0x2df9('0x6b')][_0x2df9('0x68')](_0x2a49cf);})[_0x2df9('0x28')](function(_0x517523){_0x586efe[_0x2df9('0x69')]=_0x517523;return _0x586efe;});}})[_0x2df9('0x28')](respondWithFilteredResult(_0x59cbf9,_0x2a49cf))[_0x2df9('0x51')](handleError(_0x59cbf9,null));};exports[_0x2df9('0x6c')]=function(_0x5b9220,_0x13dca3,_0x279eb6){var _0x270455={'raw':!![],'where':{}};var _0x40aa52={};var _0x43e197={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x2df9('0x63')]({'where':{'id':_0x5b9220[_0x2df9('0x4f')]['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x13dca3,null))[_0x2df9('0x28')](function(_0xa30871){if(_0xa30871){_0x40aa52[_0x2df9('0x41')]=_['keys'](db[_0x2df9('0x6d')]['rawAttributes']);_0x40aa52['query']=_[_0x2df9('0x50')](_0x5b9220[_0x2df9('0x3e')]);_0x40aa52[_0x2df9('0x3f')]=_[_0x2df9('0x40')](_0x40aa52[_0x2df9('0x41')],_0x40aa52[_0x2df9('0x3e')]);_0x270455[_0x2df9('0x42')]=_[_0x2df9('0x40')](_0x40aa52['model'],qs[_0x2df9('0x43')](_0x5b9220['query'][_0x2df9('0x43')]));_0x270455[_0x2df9('0x42')]=_0x270455[_0x2df9('0x42')][_0x2df9('0x44')]?_0x270455[_0x2df9('0x42')]:_0x40aa52[_0x2df9('0x41')];if(!_0x5b9220['query'][_0x2df9('0x65')]('nolimit')){_0x270455[_0x2df9('0x45')]=qs[_0x2df9('0x45')](_0x5b9220[_0x2df9('0x3e')][_0x2df9('0x45')]);_0x270455[_0x2df9('0x22')]=qs[_0x2df9('0x22')](_0x5b9220[_0x2df9('0x3e')][_0x2df9('0x22')]);}_0x270455[_0x2df9('0x46')]=qs[_0x2df9('0x47')](_0x5b9220['query'][_0x2df9('0x47')]);_0x270455['where']=qs[_0x2df9('0x3f')](_[_0x2df9('0x49')](_0x5b9220[_0x2df9('0x3e')],_0x40aa52[_0x2df9('0x3f')]));_0x270455[_0x2df9('0x48')][_0x2df9('0x67')]=_0xa30871['id'];if(_0x5b9220[_0x2df9('0x3e')][_0x2df9('0x2d')]){_0x270455[_0x2df9('0x48')]=_['merge'](_0x270455['where'],{'$or':_['map'](_0x270455[_0x2df9('0x42')],function(_0x142e1d){var _0x2e72d8={};_0x2e72d8[_0x142e1d]={'$like':'%'+_0x5b9220['query']['filter']+'%'};return _0x2e72d8;})});}_0x270455=_['merge']({},_0x270455,_0x5b9220['options']);return db[_0x2df9('0x6d')][_0x2df9('0x21')]({'where':_0x270455[_0x2df9('0x48')]})[_0x2df9('0x28')](function(_0x1d518e){_0x43e197['count']=_0x1d518e;if(_0x5b9220['query'][_0x2df9('0x4d')]){_0x270455[_0x2df9('0x4e')]=[{'all':!![]}];}return db[_0x2df9('0x6d')][_0x2df9('0x68')](_0x270455);})[_0x2df9('0x28')](function(_0x26c261){_0x43e197['rows']=_0x26c261;return _0x43e197;});}})[_0x2df9('0x28')](respondWithFilteredResult(_0x13dca3,_0x270455))['catch'](handleError(_0x13dca3,null));};exports[_0x2df9('0x6e')]=function(_0x1d4197,_0x11c43c,_0x196501){var _0x2a1331={'raw':!![],'where':{}};var _0x1a5273={};var _0x248570={'count':0x0,'rows':[]};return db[_0x2df9('0x3a')][_0x2df9('0x63')]({'where':{'id':_0x1d4197['params']['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x11c43c,null))['then'](function(_0x1d12b8){if(_0x1d12b8){_0x1a5273[_0x2df9('0x41')]=_[_0x2df9('0x50')](db['CmHopperBlack']['rawAttributes']);_0x1a5273[_0x2df9('0x3e')]=_[_0x2df9('0x50')](_0x1d4197[_0x2df9('0x3e')]);_0x1a5273[_0x2df9('0x3f')]=_['intersection'](_0x1a5273[_0x2df9('0x41')],_0x1a5273[_0x2df9('0x3e')]);_0x2a1331[_0x2df9('0x42')]=_[_0x2df9('0x40')](_0x1a5273[_0x2df9('0x41')],qs[_0x2df9('0x43')](_0x1d4197[_0x2df9('0x3e')][_0x2df9('0x43')]));_0x2a1331[_0x2df9('0x42')]=_0x2a1331[_0x2df9('0x42')][_0x2df9('0x44')]?_0x2a1331['attributes']:_0x1a5273[_0x2df9('0x41')];if(!_0x1d4197[_0x2df9('0x3e')][_0x2df9('0x65')](_0x2df9('0x66'))){_0x2a1331[_0x2df9('0x45')]=qs[_0x2df9('0x45')](_0x1d4197[_0x2df9('0x3e')][_0x2df9('0x45')]);_0x2a1331[_0x2df9('0x22')]=qs['offset'](_0x1d4197[_0x2df9('0x3e')][_0x2df9('0x22')]);}_0x2a1331[_0x2df9('0x46')]=qs['sort'](_0x1d4197[_0x2df9('0x3e')][_0x2df9('0x47')]);_0x2a1331['where']=qs[_0x2df9('0x3f')](_[_0x2df9('0x49')](_0x1d4197['query'],_0x1a5273[_0x2df9('0x3f')]));_0x2a1331[_0x2df9('0x48')]['VoiceQueueId']=_0x1d12b8['id'];if(_0x1d4197[_0x2df9('0x3e')]['filter']){_0x2a1331[_0x2df9('0x48')]=_[_0x2df9('0x4a')](_0x2a1331[_0x2df9('0x48')],{'$or':_[_0x2df9('0x39')](_0x2a1331[_0x2df9('0x42')],function(_0x476eef){var _0x18125f={};_0x18125f[_0x476eef]={'$like':'%'+_0x1d4197[_0x2df9('0x3e')]['filter']+'%'};return _0x18125f;})});}_0x2a1331=_['merge']({},_0x2a1331,_0x1d4197[_0x2df9('0x4c')]);return db['CmHopperBlack'][_0x2df9('0x21')]({'where':_0x2a1331[_0x2df9('0x48')]})[_0x2df9('0x28')](function(_0x445f5f){_0x248570['count']=_0x445f5f;if(_0x1d4197[_0x2df9('0x3e')][_0x2df9('0x4d')]){_0x2a1331['include']=[{'all':!![]}];}return db[_0x2df9('0x6f')][_0x2df9('0x68')](_0x2a1331);})[_0x2df9('0x28')](function(_0x239fa0){_0x248570[_0x2df9('0x69')]=_0x239fa0;return _0x248570;});}})['then'](respondWithFilteredResult(_0x11c43c,_0x2a1331))[_0x2df9('0x51')](handleError(_0x11c43c,null));};exports[_0x2df9('0x70')]=function(_0x7b0b7e,_0x2a7e20,_0x3e5598){var _0x31597b={};var _0x9c9395={};var _0x5b69fd;var _0x421795;return db[_0x2df9('0x3a')]['findOne']({'where':{'id':_0x7b0b7e[_0x2df9('0x4f')]['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x2a7e20,null))[_0x2df9('0x28')](function(_0x5bbeb3){if(_0x5bbeb3){_0x5b69fd=_0x5bbeb3;_0x9c9395[_0x2df9('0x41')]=_[_0x2df9('0x50')](db[_0x2df9('0x71')][_0x2df9('0x3b')]);_0x9c9395[_0x2df9('0x3e')]=_[_0x2df9('0x50')](_0x7b0b7e[_0x2df9('0x3e')]);_0x9c9395[_0x2df9('0x3f')]=_[_0x2df9('0x40')](_0x9c9395['model'],_0x9c9395[_0x2df9('0x3e')]);_0x31597b['attributes']=_[_0x2df9('0x40')](_0x9c9395[_0x2df9('0x41')],qs['fields'](_0x7b0b7e[_0x2df9('0x3e')]['fields']));_0x31597b[_0x2df9('0x42')]=_0x31597b[_0x2df9('0x42')][_0x2df9('0x44')]?_0x31597b['attributes']:_0x9c9395[_0x2df9('0x41')];_0x31597b[_0x2df9('0x46')]=qs[_0x2df9('0x47')](_0x7b0b7e['query'][_0x2df9('0x47')]);_0x31597b['where']=qs[_0x2df9('0x3f')](_[_0x2df9('0x49')](_0x7b0b7e['query'],_0x9c9395[_0x2df9('0x3f')]));if(_0x7b0b7e['query'][_0x2df9('0x2d')]){_0x31597b['where']=_[_0x2df9('0x4a')](_0x31597b[_0x2df9('0x48')],{'$or':_[_0x2df9('0x39')](_0x31597b[_0x2df9('0x42')],function(_0x5f0d4d){var _0x3d6c92={};_0x3d6c92[_0x5f0d4d]={'$like':'%'+_0x7b0b7e[_0x2df9('0x3e')][_0x2df9('0x2d')]+'%'};return _0x3d6c92;})});}_0x31597b=_[_0x2df9('0x4a')]({},_0x31597b,_0x7b0b7e[_0x2df9('0x4c')]);return _0x5b69fd[_0x2df9('0x70')](_0x31597b);}})[_0x2df9('0x28')](function(_0x354dae){if(_0x354dae){_0x421795=_0x354dae[_0x2df9('0x44')];if(!_0x7b0b7e[_0x2df9('0x3e')][_0x2df9('0x65')](_0x2df9('0x66'))){_0x31597b[_0x2df9('0x45')]=qs[_0x2df9('0x45')](_0x7b0b7e[_0x2df9('0x3e')][_0x2df9('0x45')]);_0x31597b[_0x2df9('0x22')]=qs[_0x2df9('0x22')](_0x7b0b7e['query'][_0x2df9('0x22')]);}return _0x5b69fd[_0x2df9('0x70')](_0x31597b);}})['then'](function(_0x117f4f){if(_0x117f4f){return _0x117f4f?{'count':_0x421795,'rows':_0x117f4f}:null;}})[_0x2df9('0x28')](respondWithResult(_0x2a7e20,null))[_0x2df9('0x51')](handleError(_0x2a7e20,null));};exports[_0x2df9('0x72')]=function(_0x35eb9c,_0x401b17,_0x2b7715){var _0x1b671b=_0x35eb9c[_0x2df9('0x53')][_0x2df9('0x73')];var _0x12c57a=_[_0x2df9('0x39')](_0x1b671b,'id');return db[_0x2df9('0x71')][_0x2df9('0x68')]({'where':{'id':_0x12c57a},'attributes':['id'],'include':[{'model':db[_0x2df9('0x74')],'as':'Agents','attributes':['id','name',_0x2df9('0x75'),_0x2df9('0x76'),_0x2df9('0x77')],'raw':!![]}]})[_0x2df9('0x28')](function(_0xa9c821){if(_0xa9c821){var _0x204d4c=_[_0x2df9('0x78')](_0xa9c821,function(_0x3915e8){var _0x1aaca7=_0x3915e8['get']({'plain':!![]});_0x1aaca7[_0x2df9('0x79')]['forEach'](function(_0x27edaf){_0x27edaf[_0x2df9('0x7a')]=_['find'](_0x1b671b,{'id':_0x1aaca7['id']})['penalty'];});return _0x1aaca7['Agents'];});return db['VoiceQueue']['find']({'where':{'id':_0x35eb9c[_0x2df9('0x4f')]['id']}})[_0x2df9('0x28')](function(_0x1cef1c){return db[_0x2df9('0x7b')][_0x2df9('0x7c')](function(_0x2e18e1){return _0x1cef1c['addTeams'](_0x12c57a,{'transaction':_0x2e18e1})[_0x2df9('0x28')](function(){return BPromise[_0x2df9('0x7d')](_0x204d4c,function(_0x3b204b){return db['UserVoiceQueue'][_0x2df9('0x7e')]({'where':{'UserId':_0x3b204b['id'],'VoiceQueueId':_0x35eb9c['params']['id']},'defaults':{'penalty':_0x3b204b[_0x2df9('0x7a')]},'transaction':_0x2e18e1});});})['then'](function(){return BPromise[_0x2df9('0x7d')](_[_0x2df9('0x2d')](_0x204d4c,{'online':!![]}),function(_0x48559a){return db[_0x2df9('0x7f')][_0x2df9('0x80')]({'membername':_0x48559a[_0x2df9('0x36')],'UserId':_0x48559a['id'],'queue_name':_0x1cef1c[_0x2df9('0x36')],'VoiceQueueId':_0x1cef1c['id'],'interface':_['isNil'](_0x48559a[_0x2df9('0x77')])?util[_0x2df9('0x81')](_0x2df9('0x82'),_0x48559a[_0x2df9('0x36')]):_0x48559a[_0x2df9('0x77')],'paused':_0x48559a[_0x2df9('0x76')]||![],'penalty':_0x48559a[_0x2df9('0x7a')]},{'transaction':_0x2e18e1});});})[_0x2df9('0x28')](function(){_0x204d4c[_0x2df9('0x83')](function(_0x92924d){socket[_0x2df9('0x84')](_0x2df9('0x85'),{'UserId':_0x92924d['id'],'VoiceQueueId':_0x1cef1c['id']});});});});});}})[_0x2df9('0x28')](respondWithStatusCode(_0x401b17,null))['catch'](handleError(_0x401b17,null));};exports['removeTeams']=function(_0x298079,_0x59c562,_0xf14895){return db['Team'][_0x2df9('0x68')]({'where':{'id':_0x298079['query'][_0x2df9('0x86')]},'attributes':['id'],'include':[{'model':db[_0x2df9('0x74')],'as':_0x2df9('0x79'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x59c562,null))[_0x2df9('0x28')](function(_0x5da9ed){var _0xbb54a=_[_0x2df9('0x39')](_0x5da9ed,'id');var _0x3a0b39=[];var _0x52a5d0=[];var _0x177e6f=squel['select']();_0x177e6f[_0x2df9('0x87')](_0x2df9('0x88'))['from'](_0x2df9('0x89'),'tq')[_0x2df9('0x8a')](_0x2df9('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x2df9('0x8c'),_0x298079[_0x2df9('0x4f')]['id']);for(var _0x5d30e9=0x0;_0x5d30e9<_0x5da9ed['length'];_0x5d30e9+=0x1){let _0x51c884=_0x5da9ed[_0x5d30e9];for(var _0x559141=0x0;_0x559141<_0x51c884[_0x2df9('0x79')][_0x2df9('0x44')];_0x559141+=0x1){let _0x5e3c31=_0x51c884[_0x2df9('0x79')][_0x559141];var _0x2c415f=_0x177e6f[_0x2df9('0x5b')]();_0x2c415f[_0x2df9('0x48')](_0x2df9('0x8d'),_0x5e3c31['id']);_0x52a5d0['push'](db['sequelize'][_0x2df9('0x3e')](_0x2c415f[_0x2df9('0x8e')](),{'type':db['sequelize']['QueryTypes'][_0x2df9('0x8f')]})[_0x2df9('0x28')](function(_0x56cd5b){if(_0x56cd5b[_0x2df9('0x44')]===0x1){return _0x5e3c31['id'];}else{var _0x110edf=_['every'](_['map'](_0x56cd5b,_0x2df9('0x90')),function(_0x1a70f8){return _['includes'](_0xbb54a,_0x1a70f8);});if(_0x110edf){return _0x5e3c31['id'];}}}));}}return BPromise[_0x2df9('0x91')](_0x52a5d0)['then'](function(_0x591a49){_0x3a0b39=_(_0x3a0b39)['union'](_0x591a49)[_0x2df9('0x92')]()[_0x2df9('0x2f')]();return db[_0x2df9('0x3a')][_0x2df9('0x32')]({'where':{'id':_0x298079[_0x2df9('0x4f')]['id']}})[_0x2df9('0x28')](function(_0x224ec0){return db[_0x2df9('0x7b')]['transaction'](function(_0x3af2e5){return _0x224ec0[_0x2df9('0x93')](_0x298079[_0x2df9('0x3e')]['ids'],{'transaction':_0x3af2e5})['then'](function(){if(!_[_0x2df9('0x94')](_0x3a0b39)){return _0x224ec0[_0x2df9('0x95')](_0x3a0b39,{'transaction':_0x3af2e5})[_0x2df9('0x28')](function(){return db[_0x2df9('0x7f')][_0x2df9('0x29')]({'where':{'VoiceQueueId':_0x298079[_0x2df9('0x4f')]['id'],'UserId':_0x3a0b39},'transaction':_0x3af2e5});});}})['then'](function(){_0x3a0b39[_0x2df9('0x83')](function(_0x5e78c0){socket[_0x2df9('0x84')](_0x2df9('0x96'),{'UserId':_0x5e78c0,'VoiceQueueId':_0x224ec0['id']});});});});});});})[_0x2df9('0x28')](respondWithStatusCode(_0x59c562,null))[_0x2df9('0x51')](handleError(_0x59c562,null));};exports[_0x2df9('0x97')]=function(_0x3d8c7b,_0x2630c0,_0x315dd7){var _0x23f184,_0x48e449;return db[_0x2df9('0x3a')]['find']({'where':{'id':_0x3d8c7b[_0x2df9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2630c0,null))[_0x2df9('0x28')](function(_0x24aa44){if(_0x24aa44){_0x48e449=_0x24aa44;return _0x24aa44[_0x2df9('0x97')](_0x3d8c7b['body'][_0x2df9('0x86')],_[_0x2df9('0x5c')](_0x3d8c7b['body'],['ids','id'])||{})['spread'](function(_0x406ca9){for(var _0xfd0406=0x0;_0xfd0406<_0x3d8c7b[_0x2df9('0x53')][_0x2df9('0x86')][_0x2df9('0x44')];_0xfd0406+=0x1){socket[_0x2df9('0x84')](_0x2df9('0x85'),{'UserId':_0x3d8c7b['body']['ids'][_0xfd0406],'VoiceQueueId':_0x3d8c7b['params']['id']});}return _0x406ca9;});}})[_0x2df9('0x28')](function(_0x4fe28a){_0x23f184=_0x4fe28a||[];if(_0x48e449){return db[_0x2df9('0x74')][_0x2df9('0x68')]({'where':{'id':_0x3d8c7b['body'][_0x2df9('0x86')]},'attributes':['id',_0x2df9('0x36'),_0x2df9('0x75'),_0x2df9('0x76'),'interface'],'raw':!![]});}})['then'](function(_0x3b0624){if(!_[_0x2df9('0x94')](_0x3b0624)){var _0x101423=[];for(var _0x3b4027=0x0;_0x3b4027<_0x3b0624[_0x2df9('0x44')];_0x3b4027++){if(_0x3b0624[_0x3b4027][_0x2df9('0x75')]){_0x101423[_0x2df9('0x98')](db[_0x2df9('0x7f')][_0x2df9('0x80')]({'membername':_0x3b0624[_0x3b4027]['name'],'UserId':_0x3b0624[_0x3b4027]['id'],'queue_name':_0x48e449[_0x2df9('0x36')],'VoiceQueueId':_0x48e449['id'],'interface':_['isNil'](_0x3b0624[_0x3b4027][_0x2df9('0x77')])?util['format'](_0x2df9('0x82'),_0x3b0624[_0x3b4027]['name']):_0x3b0624[_0x3b4027][_0x2df9('0x77')],'paused':_0x3b0624[_0x3b4027][_0x2df9('0x76')]||![],'penalty':_0x3d8c7b['body'][_0x2df9('0x7a')]||0x0}));}}return BPromise['all'](_0x101423);}})[_0x2df9('0x28')](function(){return _0x23f184;})[_0x2df9('0x28')](respondWithResult(_0x2630c0,null))['catch'](handleError(_0x2630c0,null));};exports[_0x2df9('0x95')]=function(_0x58b4ab,_0x16fe8f,_0x28cbe8){return db['VoiceQueue'][_0x2df9('0x32')]({'where':{'id':_0x58b4ab[_0x2df9('0x4f')]['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x16fe8f,null))[_0x2df9('0x28')](function(_0xaea1d8){if(_0xaea1d8){return _0xaea1d8[_0x2df9('0x95')](_0x58b4ab[_0x2df9('0x3e')]['ids'])[_0x2df9('0x28')](function(){if(_[_0x2df9('0x99')](_0x58b4ab[_0x2df9('0x3e')][_0x2df9('0x86')])){for(var _0x536886=0x0;_0x536886<_0x58b4ab['query'][_0x2df9('0x86')][_0x2df9('0x44')];_0x536886+=0x1){socket[_0x2df9('0x84')](_0x2df9('0x96'),{'UserId':Number(_0x58b4ab[_0x2df9('0x3e')][_0x2df9('0x86')][_0x536886]),'VoiceQueueId':Number(_0x58b4ab[_0x2df9('0x4f')]['id'])});}}else{socket[_0x2df9('0x84')](_0x2df9('0x96'),{'UserId':Number(_0x58b4ab[_0x2df9('0x3e')][_0x2df9('0x86')]),'VoiceQueueId':Number(_0x58b4ab[_0x2df9('0x4f')]['id'])});}});}})[_0x2df9('0x28')](function(_0x113e59){return db[_0x2df9('0x7f')][_0x2df9('0x29')]({'where':{'VoiceQueueId':_0x58b4ab[_0x2df9('0x4f')]['id'],'UserId':_0x58b4ab[_0x2df9('0x3e')]['ids']}})['then'](function(){return _0x113e59;});})[_0x2df9('0x28')](respondWithStatusCode(_0x16fe8f,null))['catch'](handleError(_0x16fe8f,null));};exports[_0x2df9('0x9a')]=function(_0x444797,_0x471556,_0x4b7027){var _0x45a048={};var _0x2e4f69={};var _0x29370b;var _0x1a32fa;return db[_0x2df9('0x3a')][_0x2df9('0x63')]({'where':{'id':_0x444797['params']['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x471556,null))[_0x2df9('0x28')](function(_0x33db4){if(_0x33db4){_0x29370b=_0x33db4;_0x2e4f69['model']=_['keys'](db[_0x2df9('0x74')]['rawAttributes']);_0x2e4f69['query']=_[_0x2df9('0x50')](_0x444797[_0x2df9('0x3e')]);_0x2e4f69['filters']=_[_0x2df9('0x40')](_0x2e4f69[_0x2df9('0x41')],_0x2e4f69[_0x2df9('0x3e')]);_0x45a048[_0x2df9('0x42')]=_[_0x2df9('0x40')](_0x2e4f69[_0x2df9('0x41')],qs[_0x2df9('0x43')](_0x444797['query'][_0x2df9('0x43')]));_0x45a048[_0x2df9('0x42')]=_0x45a048[_0x2df9('0x42')][_0x2df9('0x44')]?_0x45a048['attributes']:_0x2e4f69[_0x2df9('0x41')];_0x45a048[_0x2df9('0x46')]=qs[_0x2df9('0x47')](_0x444797['query'][_0x2df9('0x47')]);_0x45a048[_0x2df9('0x48')]=qs[_0x2df9('0x3f')](_[_0x2df9('0x49')](_0x444797[_0x2df9('0x3e')],_0x2e4f69[_0x2df9('0x3f')]));if(_0x444797['query'][_0x2df9('0x2d')]){_0x45a048[_0x2df9('0x48')]=_[_0x2df9('0x4a')](_0x45a048[_0x2df9('0x48')],{'$or':_['map'](_0x45a048['attributes'],function(_0x430eb8){var _0x11310e={};_0x11310e[_0x430eb8]={'$like':'%'+_0x444797[_0x2df9('0x3e')][_0x2df9('0x2d')]+'%'};return _0x11310e;})});}_0x45a048=_['merge']({},_0x45a048,_0x444797[_0x2df9('0x4c')]);return _0x29370b[_0x2df9('0x9a')](_0x45a048);}})[_0x2df9('0x28')](function(_0x36b803){if(_0x36b803){_0x1a32fa=_0x36b803[_0x2df9('0x44')];if(!_0x444797[_0x2df9('0x3e')]['hasOwnProperty']('nolimit')){_0x45a048[_0x2df9('0x45')]=qs[_0x2df9('0x45')](_0x444797[_0x2df9('0x3e')][_0x2df9('0x45')]);_0x45a048['offset']=qs['offset'](_0x444797['query']['offset']);}return _0x29370b['getAgents'](_0x45a048);}})[_0x2df9('0x28')](function(_0x40fae2){if(_0x40fae2){return _0x40fae2?{'count':_0x1a32fa,'rows':_0x40fae2}:null;}})['then'](respondWithResult(_0x471556,null))['catch'](handleError(_0x471556,null));};exports['getMembers']=function(_0x499e3f,_0xb77334,_0x55f588){var _0x3f934f={};var _0x4a8841={};var _0x32e718;var _0x4d8a36;return db[_0x2df9('0x3a')][_0x2df9('0x63')]({'where':{'id':_0x499e3f['params']['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0xb77334,null))[_0x2df9('0x28')](function(_0x3521c3){if(_0x3521c3){_0x32e718=_0x3521c3;_0x4a8841[_0x2df9('0x41')]=_['keys'](db[_0x2df9('0x7f')][_0x2df9('0x3b')]);_0x4a8841[_0x2df9('0x3e')]=_[_0x2df9('0x50')](_0x499e3f[_0x2df9('0x3e')]);_0x4a8841[_0x2df9('0x3f')]=_[_0x2df9('0x40')](_0x4a8841['model'],_0x4a8841[_0x2df9('0x3e')]);_0x3f934f[_0x2df9('0x42')]=_[_0x2df9('0x40')](_0x4a8841['model'],qs[_0x2df9('0x43')](_0x499e3f[_0x2df9('0x3e')][_0x2df9('0x43')]));_0x3f934f['attributes']=_0x3f934f['attributes'][_0x2df9('0x44')]?_0x3f934f[_0x2df9('0x42')]:_0x4a8841[_0x2df9('0x41')];_0x3f934f[_0x2df9('0x46')]=qs[_0x2df9('0x47')](_0x499e3f[_0x2df9('0x3e')][_0x2df9('0x47')]);_0x3f934f[_0x2df9('0x48')]=qs[_0x2df9('0x3f')](_[_0x2df9('0x49')](_0x499e3f['query'],_0x4a8841[_0x2df9('0x3f')]));if(_0x499e3f[_0x2df9('0x3e')][_0x2df9('0x2d')]){_0x3f934f[_0x2df9('0x48')]=_[_0x2df9('0x4a')](_0x3f934f[_0x2df9('0x48')],{'$or':_[_0x2df9('0x39')](_0x3f934f[_0x2df9('0x42')],function(_0xc141cf){var _0x1b88d3={};_0x1b88d3[_0xc141cf]={'$like':'%'+_0x499e3f[_0x2df9('0x3e')]['filter']+'%'};return _0x1b88d3;})});}_0x3f934f=_['merge']({},_0x3f934f,_0x499e3f[_0x2df9('0x4c')]);return _0x32e718[_0x2df9('0x9b')](_0x3f934f);}})[_0x2df9('0x28')](function(_0x46d777){if(_0x46d777){_0x4d8a36=_0x46d777[_0x2df9('0x44')];if(!_0x499e3f[_0x2df9('0x3e')][_0x2df9('0x65')](_0x2df9('0x66'))){_0x3f934f['limit']=qs[_0x2df9('0x45')](_0x499e3f[_0x2df9('0x3e')][_0x2df9('0x45')]);_0x3f934f[_0x2df9('0x22')]=qs[_0x2df9('0x22')](_0x499e3f[_0x2df9('0x3e')][_0x2df9('0x22')]);}return _0x32e718[_0x2df9('0x9b')](_0x3f934f);}})['then'](function(_0x539c48){return _0x539c48?{'count':_0x4d8a36,'rows':_0x539c48}:null;})['then'](respondWithResult(_0xb77334,null))[_0x2df9('0x51')](handleError(_0xb77334,null));};exports[_0x2df9('0x9c')]=function(_0xfa2dd6,_0x1eb568,_0x3a2c5c){var _0x2679f4={};var _0x7777eb={};var _0x2c9a9a;var _0x3bc49f;return db[_0x2df9('0x3a')]['findOne']({'where':{'id':_0xfa2dd6[_0x2df9('0x4f')]['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x1eb568,null))[_0x2df9('0x28')](function(_0x1575f3){if(_0x1575f3){_0x2c9a9a=_0x1575f3;_0x7777eb[_0x2df9('0x41')]=_[_0x2df9('0x50')](db[_0x2df9('0x9d')]['rawAttributes']);_0x7777eb['query']=_['keys'](_0xfa2dd6[_0x2df9('0x3e')]);_0x7777eb['filters']=_['intersection'](_0x7777eb[_0x2df9('0x41')],_0x7777eb[_0x2df9('0x3e')]);_0x2679f4['attributes']=_[_0x2df9('0x40')](_0x7777eb['model'],qs[_0x2df9('0x43')](_0xfa2dd6[_0x2df9('0x3e')][_0x2df9('0x43')]));_0x2679f4[_0x2df9('0x42')]=_0x2679f4['attributes'][_0x2df9('0x44')]?_0x2679f4['attributes']:_0x7777eb['model'];_0x2679f4[_0x2df9('0x46')]=qs[_0x2df9('0x47')](_0xfa2dd6[_0x2df9('0x3e')][_0x2df9('0x47')]);_0x2679f4[_0x2df9('0x48')]=qs['filters'](_[_0x2df9('0x49')](_0xfa2dd6[_0x2df9('0x3e')],_0x7777eb['filters']));if(_0xfa2dd6[_0x2df9('0x3e')][_0x2df9('0x2d')]){_0x2679f4[_0x2df9('0x48')]=_[_0x2df9('0x4a')](_0x2679f4[_0x2df9('0x48')],{'$or':_[_0x2df9('0x39')](_0x2679f4['attributes'],function(_0x2fcc02){var _0x28020a={};_0x28020a[_0x2fcc02]={'$like':'%'+_0xfa2dd6['query'][_0x2df9('0x2d')]+'%'};return _0x28020a;})});}_0x2679f4=_[_0x2df9('0x4a')]({},_0x2679f4,_0xfa2dd6[_0x2df9('0x4c')]);return _0x2c9a9a[_0x2df9('0x9c')](_0x2679f4);}})['then'](function(_0x1ac79a){if(_0x1ac79a){_0x3bc49f=_0x1ac79a[_0x2df9('0x44')];if(!_0xfa2dd6[_0x2df9('0x3e')][_0x2df9('0x65')](_0x2df9('0x66'))){_0x2679f4[_0x2df9('0x45')]=qs[_0x2df9('0x45')](_0xfa2dd6[_0x2df9('0x3e')][_0x2df9('0x45')]);_0x2679f4['offset']=qs['offset'](_0xfa2dd6[_0x2df9('0x3e')][_0x2df9('0x22')]);}return _0x2c9a9a[_0x2df9('0x9c')](_0x2679f4);}})[_0x2df9('0x28')](function(_0x4a98b4){if(_0x4a98b4){return _0x4a98b4?{'count':_0x3bc49f,'rows':_0x4a98b4}:null;}})[_0x2df9('0x28')](respondWithResult(_0x1eb568,null))[_0x2df9('0x51')](handleError(_0x1eb568,null));};exports[_0x2df9('0x9e')]=function(_0x389138,_0x7e2d2,_0x36e078){var _0x513446,_0x52f3db;return db['VoiceQueue'][_0x2df9('0x32')]({'where':{'id':_0x389138['params']['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x7e2d2,null))[_0x2df9('0x28')](function(_0x5eac83){if(_0x5eac83){_0x52f3db=_0x5eac83;return _0x5eac83[_0x2df9('0x9e')](_0x389138[_0x2df9('0x53')][_0x2df9('0x86')],_[_0x2df9('0x5c')](_0x389138[_0x2df9('0x53')],['ids','id'])||{});}return null;})[_0x2df9('0x9f')](function(_0xcb46d7){var _0x47dad0;_0x513446=_0xcb46d7||[];var _0x548cd2=[];if(_0xcb46d7){for(var _0x46eb09=0x0;_0x46eb09<_0xcb46d7[_0x2df9('0x44')];_0x46eb09+=0x1){var _0x2a4cd6=_0xcb46d7[_0x46eb09][_0x2df9('0x55')]({'plain':!![]});_0x52f3db[_0x2df9('0xa0')]=_0x389138[_0x2df9('0x53')][_0x2df9('0xa0')]?_0x389138['body'][_0x2df9('0xa0')]:_0x52f3db['dialCheckDuplicateType'];switch(_0x52f3db[_0x2df9('0xa0')]){case _0x2df9('0xa1'):_0x47dad0=squel[_0x2df9('0xa2')]()[_0x2df9('0xa3')](_0x2df9('0xa4'))[_0x2df9('0xa5')](['phone',_0x2df9('0xa6'),'ContactId',_0x2df9('0xa7'),_0x2df9('0x67'),_0x2df9('0x5e'),_0x2df9('0x5d')],squel['select']()[_0x2df9('0x87')]('phone','phone')[_0x2df9('0x87')](_0x2df9('0xa8'),_0x2df9('0xa6'))[_0x2df9('0x87')]('id',_0x2df9('0xa9'))[_0x2df9('0x87')](_0x2a4cd6['CmListId'][_0x2df9('0x8e')](),_0x2df9('0xa7'))[_0x2df9('0x87')](_0x389138[_0x2df9('0x4f')]['id'][_0x2df9('0x8e')](),_0x2df9('0x67'))[_0x2df9('0x87')](_0x2df9('0xa8'),_0x2df9('0x5e'))[_0x2df9('0x87')](_0x2df9('0xa8'),_0x2df9('0x5d'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x2df9('0x48')](_0x2df9('0xaa'),_0x2a4cd6[_0x2df9('0xab')][_0x2df9('0x8e')]())[_0x2df9('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x2df9('0x48')](_0x2df9('0xac'),squel[_0x2df9('0xad')]()[_0x2df9('0x87')](_0x2df9('0xae'))[_0x2df9('0xaf')](_0x2df9('0xb0'))[_0x2df9('0x48')](_0x2df9('0x8c'),_0x389138[_0x2df9('0x4f')]['id'][_0x2df9('0x8e')]()))[_0x2df9('0x48')](_0x2df9('0xac'),squel[_0x2df9('0xad')]()[_0x2df9('0x87')](_0x2df9('0xb1'))[_0x2df9('0xaf')](_0x2df9('0xa4'))[_0x2df9('0x48')](_0x2df9('0x8c'),_0x389138[_0x2df9('0x4f')]['id'][_0x2df9('0x8e')]())))['toString']();break;case _0x2df9('0xb2'):_0x47dad0=squel['insert']()['into'](_0x2df9('0xa4'))[_0x2df9('0xa5')]([_0x2df9('0xb3'),_0x2df9('0xa6'),'ContactId','ListId',_0x2df9('0x67'),'createdAt',_0x2df9('0x5d')],squel['select']()['field'](_0x2df9('0xb3'),'phone')[_0x2df9('0x87')](_0x2df9('0xa8'),_0x2df9('0xa6'))[_0x2df9('0x87')]('id','ContactId')[_0x2df9('0x87')](_0x2a4cd6[_0x2df9('0xab')][_0x2df9('0x8e')](),_0x2df9('0xa7'))[_0x2df9('0x87')](_0x389138[_0x2df9('0x4f')]['id'][_0x2df9('0x8e')](),'VoiceQueueId')[_0x2df9('0x87')](_0x2df9('0xa8'),_0x2df9('0x5e'))[_0x2df9('0x87')](_0x2df9('0xa8'),_0x2df9('0x5d'))[_0x2df9('0xaf')](_0x2df9('0xb4'))[_0x2df9('0x48')]('deletedAt\x20IS\x20NULL')['where'](_0x2df9('0xaa'),_0x2a4cd6[_0x2df9('0xab')]['toString']())['where'](_0x2df9('0xb5'))[_0x2df9('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2df9('0xad')]()[_0x2df9('0x87')](_0x2df9('0xb1'))[_0x2df9('0xaf')]('cm_hopper')[_0x2df9('0x48')]('VoiceQueueId\x20=\x20?',_0x389138[_0x2df9('0x4f')]['id'][_0x2df9('0x8e')]())))['toString']();break;default:_0x47dad0=squel['insert']()['into']('cm_hopper')[_0x2df9('0xa5')]([_0x2df9('0xb3'),_0x2df9('0xa6'),_0x2df9('0xa9'),_0x2df9('0xa7'),_0x2df9('0x67'),_0x2df9('0x5e'),_0x2df9('0x5d')],squel[_0x2df9('0xad')]()[_0x2df9('0x87')](_0x2df9('0xb3'),_0x2df9('0xb3'))[_0x2df9('0x87')]('NOW()',_0x2df9('0xa6'))[_0x2df9('0x87')]('id',_0x2df9('0xa9'))[_0x2df9('0x87')](_0x2a4cd6[_0x2df9('0xab')]['toString'](),'ListId')[_0x2df9('0x87')](_0x389138[_0x2df9('0x4f')]['id'][_0x2df9('0x8e')](),'VoiceQueueId')['field'](_0x2df9('0xa8'),_0x2df9('0x5e'))[_0x2df9('0x87')]('NOW()',_0x2df9('0x5d'))[_0x2df9('0xaf')](_0x2df9('0xb4'))['where'](_0x2df9('0xb6'))[_0x2df9('0x48')](_0x2df9('0xaa'),_0x2a4cd6[_0x2df9('0xab')][_0x2df9('0x8e')]())['where'](_0x2df9('0xb5')))[_0x2df9('0x8e')]();}_0x548cd2['push'](db[_0x2df9('0x7b')][_0x2df9('0x3e')](_0x47dad0));}return BPromise[_0x2df9('0x91')](_0x548cd2);}})['then'](function(){return _0x513446;})['then'](respondWithResult(_0x7e2d2,null))[_0x2df9('0x51')](handleError(_0x7e2d2,null));};exports['removeLists']=function(_0x574ec0,_0x12c1b3,_0x182ab4){return db[_0x2df9('0x3a')][_0x2df9('0x32')]({'where':{'id':_0x574ec0[_0x2df9('0x4f')]['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x12c1b3,null))[_0x2df9('0x28')](function(_0x10678a){if(_0x10678a){return _0x10678a[_0x2df9('0xb7')](_0x574ec0['query']['ids']);}})[_0x2df9('0x28')](function(_0xe717fb){if(_0xe717fb){return db[_0x2df9('0x64')][_0x2df9('0x29')]({'where':{'ListId':_0x574ec0[_0x2df9('0x3e')][_0x2df9('0x86')],'VoiceQueueId':_0x574ec0[_0x2df9('0x4f')]['id']}})['then'](function(){return _0xe717fb;});}})[_0x2df9('0x28')](respondWithStatusCode(_0x12c1b3,null))[_0x2df9('0x51')](handleError(_0x12c1b3,null));};exports['getBlackLists']=function(_0x1fe6c7,_0xff4f58,_0x476084){var _0x2fb900={};var _0x7c9a1d={};var _0x2bd268;var _0x1c742e;return db[_0x2df9('0x3a')][_0x2df9('0x63')]({'where':{'id':_0x1fe6c7[_0x2df9('0x4f')]['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0xff4f58,null))[_0x2df9('0x28')](function(_0x40206d){if(_0x40206d){_0x2bd268=_0x40206d;_0x7c9a1d[_0x2df9('0x41')]=_[_0x2df9('0x50')](db[_0x2df9('0x9d')]['rawAttributes']);_0x7c9a1d[_0x2df9('0x3e')]=_[_0x2df9('0x50')](_0x1fe6c7['query']);_0x7c9a1d[_0x2df9('0x3f')]=_[_0x2df9('0x40')](_0x7c9a1d['model'],_0x7c9a1d[_0x2df9('0x3e')]);_0x2fb900[_0x2df9('0x42')]=_['intersection'](_0x7c9a1d['model'],qs[_0x2df9('0x43')](_0x1fe6c7[_0x2df9('0x3e')][_0x2df9('0x43')]));_0x2fb900[_0x2df9('0x42')]=_0x2fb900[_0x2df9('0x42')][_0x2df9('0x44')]?_0x2fb900[_0x2df9('0x42')]:_0x7c9a1d[_0x2df9('0x41')];_0x2fb900[_0x2df9('0x46')]=qs['sort'](_0x1fe6c7[_0x2df9('0x3e')][_0x2df9('0x47')]);_0x2fb900[_0x2df9('0x48')]=qs[_0x2df9('0x3f')](_[_0x2df9('0x49')](_0x1fe6c7[_0x2df9('0x3e')],_0x7c9a1d[_0x2df9('0x3f')]));if(_0x1fe6c7['query'][_0x2df9('0x2d')]){_0x2fb900[_0x2df9('0x48')]=_[_0x2df9('0x4a')](_0x2fb900[_0x2df9('0x48')],{'$or':_[_0x2df9('0x39')](_0x2fb900['attributes'],function(_0x31e984){var _0x2c0c3b={};_0x2c0c3b[_0x31e984]={'$like':'%'+_0x1fe6c7[_0x2df9('0x3e')][_0x2df9('0x2d')]+'%'};return _0x2c0c3b;})});}_0x2fb900=_[_0x2df9('0x4a')]({},_0x2fb900,_0x1fe6c7[_0x2df9('0x4c')]);return _0x2bd268[_0x2df9('0xb8')](_0x2fb900);}})[_0x2df9('0x28')](function(_0x3f994d){if(_0x3f994d){_0x1c742e=_0x3f994d['length'];if(!_0x1fe6c7[_0x2df9('0x3e')][_0x2df9('0x65')]('nolimit')){_0x2fb900[_0x2df9('0x45')]=qs[_0x2df9('0x45')](_0x1fe6c7[_0x2df9('0x3e')][_0x2df9('0x45')]);_0x2fb900[_0x2df9('0x22')]=qs[_0x2df9('0x22')](_0x1fe6c7[_0x2df9('0x3e')]['offset']);}return _0x2bd268[_0x2df9('0xb8')](_0x2fb900);}})[_0x2df9('0x28')](function(_0x2f6d62){if(_0x2f6d62){return _0x2f6d62?{'count':_0x1c742e,'rows':_0x2f6d62}:null;}})['then'](respondWithResult(_0xff4f58,null))[_0x2df9('0x51')](handleError(_0xff4f58,null));};exports[_0x2df9('0xb9')]=function(_0xebb92e,_0x580971,_0x58dc17){var _0x4b6a2a,_0x2afe84;return db['VoiceQueue'][_0x2df9('0x32')]({'where':{'id':_0xebb92e['params']['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x580971,null))[_0x2df9('0x28')](function(_0x32e1f2){if(_0x32e1f2){_0x2afe84=_0x32e1f2;return _0x32e1f2[_0x2df9('0xb9')](_0xebb92e[_0x2df9('0x53')][_0x2df9('0x86')],_[_0x2df9('0x5c')](_0xebb92e['body'],[_0x2df9('0x86'),'id'])||{});}return null;})[_0x2df9('0x9f')](function(_0x536255){var _0x1c0f0b;_0x4b6a2a=_0x536255||[];var _0x521e3d=[];if(_0x536255){for(var _0x5aa811=0x0;_0x5aa811<_0x536255[_0x2df9('0x44')];_0x5aa811+=0x1){var _0x1d5f74=_0x536255[_0x5aa811][_0x2df9('0x55')]({'plain':!![]});_0x1c0f0b=squel[_0x2df9('0xa2')]()['into'](_0x2df9('0xba'))['fromQuery'](['phone',_0x2df9('0xa9'),_0x2df9('0xa7'),'VoiceQueueId',_0x2df9('0x5e'),_0x2df9('0x5d')],squel['select']()[_0x2df9('0x87')]('phone',_0x2df9('0xb3'))[_0x2df9('0x87')]('id',_0x2df9('0xa9'))['field'](_0x1d5f74[_0x2df9('0xab')][_0x2df9('0x8e')](),'ListId')[_0x2df9('0x87')](_0xebb92e['params']['id'][_0x2df9('0x8e')](),_0x2df9('0x67'))['field']('NOW()',_0x2df9('0x5e'))[_0x2df9('0x87')](_0x2df9('0xa8'),_0x2df9('0x5d'))[_0x2df9('0xaf')](_0x2df9('0xb4'))[_0x2df9('0x48')](_0x2df9('0xb6'))[_0x2df9('0x48')](_0x2df9('0xaa'),_0x1d5f74['CmListId']['toString']())[_0x2df9('0x48')](_0x2df9('0xb5')))['toString']();_0x521e3d[_0x2df9('0x98')](db['sequelize'][_0x2df9('0x3e')](_0x1c0f0b));}return BPromise[_0x2df9('0x91')](_0x521e3d);}})[_0x2df9('0x28')](function(){return _0x4b6a2a;})['then'](respondWithResult(_0x580971,null))[_0x2df9('0x51')](handleError(_0x580971,null));};exports[_0x2df9('0xbb')]=function(_0x4b425c,_0x3be70f,_0x5266e9){return db[_0x2df9('0x3a')][_0x2df9('0x32')]({'where':{'id':_0x4b425c[_0x2df9('0x4f')]['id']}})[_0x2df9('0x28')](handleEntityNotFound(_0x3be70f,null))[_0x2df9('0x28')](function(_0x5b0dea){if(_0x5b0dea){return _0x5b0dea[_0x2df9('0xbb')](_0x4b425c[_0x2df9('0x3e')][_0x2df9('0x86')]);}})[_0x2df9('0x28')](function(_0x163643){if(_0x163643){return db[_0x2df9('0x6f')][_0x2df9('0x29')]({'where':{'ListId':_0x4b425c[_0x2df9('0x3e')]['ids'],'VoiceQueueId':_0x4b425c[_0x2df9('0x4f')]['id']}})['then'](function(){return _0x163643;});}})['then'](respondWithStatusCode(_0x3be70f,null))[_0x2df9('0x51')](handleError(_0x3be70f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 643da81..2236c07 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 _0x00a3=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0x5e56db,_0x37f86e){var _0x2f49c9=function(_0x4838e0){while(--_0x4838e0){_0x5e56db['push'](_0x5e56db['shift']());}};_0x2f49c9(++_0x37f86e);}(_0x00a3,0x126));var _0x300a=function(_0x592fa0,_0x35f2b3){_0x592fa0=_0x592fa0-0x0;var _0x384d15=_0x00a3[_0x592fa0];return _0x384d15;};'use strict';var EventEmitter=require(_0x300a('0x0'));var VoiceQueue=require(_0x300a('0x1'))['db'][_0x300a('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x300a('0x3')](0x0);var events={'afterCreate':_0x300a('0x4'),'afterUpdate':_0x300a('0x5'),'afterDestroy':_0x300a('0x6')};function emitEvent(_0x3cf514){return function(_0x245beb,_0x148ef9,_0x406750){VoiceQueueEvents[_0x300a('0x7')](_0x3cf514+':'+_0x245beb['id'],_0x245beb);VoiceQueueEvents[_0x300a('0x7')](_0x3cf514,_0x245beb);_0x406750(null);};}for(var e in events){if(events[_0x300a('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x300a('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xbe60=['setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb','VoiceQueue'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xbe60,0x10c));var _0x0be6=function(_0x4328cc,_0x255c02){_0x4328cc=_0x4328cc-0x0;var _0x1a96d3=_0xbe60[_0x4328cc];return _0x1a96d3;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x0be6('0x0'))['db'][_0x0be6('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0be6('0x2')](0x0);var events={'afterCreate':_0x0be6('0x3'),'afterUpdate':_0x0be6('0x4'),'afterDestroy':_0x0be6('0x5')};function emitEvent(_0x47be15){return function(_0x1bdae3,_0x1f99b5,_0x29d66b){VoiceQueueEvents[_0x0be6('0x6')](_0x47be15+':'+_0x1bdae3['id'],_0x1bdae3);VoiceQueueEvents[_0x0be6('0x6')](_0x47be15,_0x1bdae3);_0x29d66b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x0be6('0x7')](e,emitEvent(event));}}module[_0x0be6('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 38f550d..d8de174 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 _0xd5f4=['define','voice_queues','../../config/logger','moment','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x4a7480,_0x3cd95b){var _0x25775a=function(_0x22bd81){while(--_0x22bd81){_0x4a7480['push'](_0x4a7480['shift']());}};_0x25775a(++_0x3cd95b);}(_0xd5f4,0x1ad));var _0x4d5f=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xd5f4[_0x599f41];return _0x2e4d58;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4d5f('0x0'))('api');var moment=require(_0x4d5f('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4d5f('0x2'));var attributes=require(_0x4d5f('0x3'));module[_0x4d5f('0x4')]=function(_0x3a2a3d,_0x1cc2ad){return _0x3a2a3d[_0x4d5f('0x5')]('VoiceQueue',attributes,{'tableName':_0x4d5f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a50=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceQueue.attributes','VoiceQueue','voice_queues','lodash','util'];(function(_0x46cb37,_0x1e1692){var _0x335f57=function(_0x5d1446){while(--_0x5d1446){_0x46cb37['push'](_0x46cb37['shift']());}};_0x335f57(++_0x1e1692);}(_0x3a50,0xe5));var _0x03a5=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x3a50[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x03a5('0x0'));var util=require(_0x03a5('0x1'));var logger=require(_0x03a5('0x2'))(_0x03a5('0x3'));var moment=require(_0x03a5('0x4'));var BPromise=require(_0x03a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x03a5('0x6'));var config=require(_0x03a5('0x7'));var attributes=require(_0x03a5('0x8'));module['exports']=function(_0x473225,_0x24b62b){return _0x473225['define'](_0x03a5('0x9'),attributes,{'tableName':_0x03a5('0xa'),'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 bc450a2..a3f2ad9 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 _0x2d24=['attributes','limit','include','map','model','GetVoiceQueue','ShowVoiceQueue','find','stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','result','VoiceQueue','options','raw','where'];(function(_0xbd663f,_0x499b1e){var _0xd79e0d=function(_0x5d2d55){while(--_0x5d2d55){_0xbd663f['push'](_0xbd663f['shift']());}};_0xd79e0d(++_0x499b1e);}(_0x2d24,0xa2));var _0x42d2=function(_0x17a502,_0x157a39){_0x17a502=_0x17a502-0x0;var _0x2c26b1=_0x2d24[_0x17a502];return _0x2c26b1;};'use strict';var _=require(_0x42d2('0x0'));var util=require('util');var moment=require(_0x42d2('0x1'));var BPromise=require(_0x42d2('0x2'));var rs=require(_0x42d2('0x3'));var fs=require('fs');var Redis=require(_0x42d2('0x4'));var db=require(_0x42d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x42d2('0x6'))(_0x42d2('0x7'));var config=require(_0x42d2('0x8'));var jayson=require(_0x42d2('0x9'));var client=jayson[_0x42d2('0xa')]['http']({'port':0x232a});config[_0x42d2('0xb')]=_['defaults'](config[_0x42d2('0xb')],{'host':_0x42d2('0xc'),'port':0x18eb});var socket=require(_0x42d2('0xd'))(new Redis(config['redis']));require(_0x42d2('0xe'))[_0x42d2('0xf')](socket);function respondWithRpcPromise(_0x52a6b5,_0x3a8e14,_0x3996f5){return new BPromise(function(_0x320378,_0xd7bf42){return client['request'](_0x52a6b5,_0x3996f5)[_0x42d2('0x10')](function(_0x4c6a54){logger[_0x42d2('0x11')](_0x42d2('0x12'),_0x3a8e14,'request\x20sent');logger[_0x42d2('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x3a8e14,_0x42d2('0x14'),JSON['stringify'](_0x4c6a54));if(_0x4c6a54[_0x42d2('0x15')]){if(_0x4c6a54[_0x42d2('0x15')]['code']===0x1f4){logger[_0x42d2('0x15')](_0x42d2('0x12'),_0x3a8e14,_0x4c6a54[_0x42d2('0x15')][_0x42d2('0x16')]);return _0xd7bf42(_0x4c6a54['error'][_0x42d2('0x16')]);}logger[_0x42d2('0x15')](_0x42d2('0x12'),_0x3a8e14,_0x4c6a54['error'][_0x42d2('0x16')]);return _0x320378(_0x4c6a54[_0x42d2('0x15')][_0x42d2('0x16')]);}else{logger[_0x42d2('0x11')](_0x42d2('0x12'),_0x3a8e14,_0x42d2('0x14'));_0x320378(_0x4c6a54[_0x42d2('0x17')]['message']);}})['catch'](function(_0x5dc496){logger[_0x42d2('0x15')](_0x42d2('0x12'),_0x3a8e14,_0x5dc496);_0xd7bf42(_0x5dc496);});});}exports['GetVoiceQueue']=function(_0x4a6296){var _0x368d37=this;return new Promise(function(_0x32318e,_0x33c529){return db[_0x42d2('0x18')]['findAll']({'raw':_0x4a6296['options']?_0x4a6296[_0x42d2('0x19')][_0x42d2('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a6296[_0x42d2('0x19')]?_0x4a6296[_0x42d2('0x19')][_0x42d2('0x1b')]||null:null,'attributes':_0x4a6296['options']?_0x4a6296[_0x42d2('0x19')][_0x42d2('0x1c')]||null:null,'limit':_0x4a6296['options']?_0x4a6296[_0x42d2('0x19')][_0x42d2('0x1d')]||null:null,'include':_0x4a6296[_0x42d2('0x19')]?_0x4a6296[_0x42d2('0x19')][_0x42d2('0x1e')]?_[_0x42d2('0x1f')](_0x4a6296[_0x42d2('0x19')][_0x42d2('0x1e')],function(_0x5b6c7c){return{'model':db[_0x5b6c7c[_0x42d2('0x20')]],'as':_0x5b6c7c['as'],'attributes':_0x5b6c7c[_0x42d2('0x1c')],'include':_0x5b6c7c[_0x42d2('0x1e')]?_[_0x42d2('0x1f')](_0x5b6c7c[_0x42d2('0x1e')],function(_0x29261e){return{'model':db[_0x29261e[_0x42d2('0x20')]],'as':_0x29261e['as'],'attributes':_0x29261e[_0x42d2('0x1c')],'include':_0x29261e[_0x42d2('0x1e')]?_['map'](_0x29261e[_0x42d2('0x1e')],function(_0x33cf6e){return{'model':db[_0x33cf6e[_0x42d2('0x20')]],'as':_0x33cf6e['as'],'attributes':_0x33cf6e[_0x42d2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x42d2('0x10')](function(_0x2f4e47){logger[_0x42d2('0x11')](_0x42d2('0x21'),_0x4a6296);logger[_0x42d2('0x13')](_0x42d2('0x21'),_0x4a6296,JSON['stringify'](_0x2f4e47));_0x32318e(_0x2f4e47);})['catch'](function(_0xbb053f){logger['error'](_0x42d2('0x21'),_0xbb053f[_0x42d2('0x16')],_0x4a6296);_0x33c529(_0x368d37[_0x42d2('0x15')](0x1f4,_0xbb053f[_0x42d2('0x16')]));});});};exports[_0x42d2('0x22')]=function(_0x30fbea){var _0x4034ad=this;return new Promise(function(_0x4363f7,_0x356e59){return db['VoiceQueue'][_0x42d2('0x23')]({'raw':_0x30fbea['options']?_0x30fbea[_0x42d2('0x19')][_0x42d2('0x1a')]===undefined?!![]:![]:!![],'where':_0x30fbea[_0x42d2('0x19')]?_0x30fbea[_0x42d2('0x19')][_0x42d2('0x1b')]||null:null,'attributes':_0x30fbea[_0x42d2('0x19')]?_0x30fbea['options'][_0x42d2('0x1c')]||null:null,'include':_0x30fbea[_0x42d2('0x19')]?_0x30fbea[_0x42d2('0x19')][_0x42d2('0x1e')]?_[_0x42d2('0x1f')](_0x30fbea[_0x42d2('0x19')][_0x42d2('0x1e')],function(_0x1122b7){return{'model':db[_0x1122b7[_0x42d2('0x20')]],'as':_0x1122b7['as'],'attributes':_0x1122b7['attributes'],'include':_0x1122b7[_0x42d2('0x1e')]?_[_0x42d2('0x1f')](_0x1122b7['include'],function(_0x251b0b){return{'model':db[_0x251b0b[_0x42d2('0x20')]],'as':_0x251b0b['as'],'attributes':_0x251b0b['attributes'],'include':_0x251b0b[_0x42d2('0x1e')]?_[_0x42d2('0x1f')](_0x251b0b[_0x42d2('0x1e')],function(_0x471f71){return{'model':db[_0x471f71[_0x42d2('0x20')]],'as':_0x471f71['as'],'attributes':_0x471f71[_0x42d2('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4dcca8){logger['info'](_0x42d2('0x22'),_0x30fbea);logger[_0x42d2('0x13')]('ShowVoiceQueue',_0x30fbea,JSON[_0x42d2('0x24')](_0x4dcca8));_0x4363f7(_0x4dcca8);})[_0x42d2('0x25')](function(_0x376ea){logger['error'](_0x42d2('0x22'),_0x376ea[_0x42d2('0x16')],_0x30fbea);_0x356e59(_0x4034ad[_0x42d2('0x15')](0x1f4,_0x376ea['message']));});});}; \ No newline at end of file +var _0x4ff0=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueue','options','raw','where','attributes','limit','include','map','model','then','GetVoiceQueue','ShowVoiceQueue','lodash','util','bluebird','randomstring'];(function(_0xb50bc,_0x41d8ec){var _0x31ec0f=function(_0x47d1a8){while(--_0x47d1a8){_0xb50bc['push'](_0xb50bc['shift']());}};_0x31ec0f(++_0x41d8ec);}(_0x4ff0,0x196));var _0x04ff=function(_0x38f55f,_0x349ce0){_0x38f55f=_0x38f55f-0x0;var _0x98b5c0=_0x4ff0[_0x38f55f];return _0x98b5c0;};'use strict';var _=require(_0x04ff('0x0'));var util=require(_0x04ff('0x1'));var moment=require('moment');var BPromise=require(_0x04ff('0x2'));var rs=require(_0x04ff('0x3'));var fs=require('fs');var Redis=require(_0x04ff('0x4'));var db=require(_0x04ff('0x5'))['db'];var utils=require(_0x04ff('0x6'));var logger=require('../../config/logger')(_0x04ff('0x7'));var config=require('../../config/environment');var jayson=require(_0x04ff('0x8'));var client=jayson[_0x04ff('0x9')][_0x04ff('0xa')]({'port':0x232a});config['redis']=_[_0x04ff('0xb')](config['redis'],{'host':_0x04ff('0xc'),'port':0x18eb});var socket=require(_0x04ff('0xd'))(new Redis(config[_0x04ff('0xe')]));require(_0x04ff('0xf'))[_0x04ff('0x10')](socket);function respondWithRpcPromise(_0x56bc2d,_0x296561,_0x5ddfbf){return new BPromise(function(_0x3d91a9,_0x2a4cca){return client[_0x04ff('0x11')](_0x56bc2d,_0x5ddfbf)['then'](function(_0xe0ea59){logger[_0x04ff('0x12')](_0x04ff('0x13'),_0x296561,_0x04ff('0x14'));logger[_0x04ff('0x15')](_0x04ff('0x16'),_0x296561,'request\x20sent',JSON[_0x04ff('0x17')](_0xe0ea59));if(_0xe0ea59[_0x04ff('0x18')]){if(_0xe0ea59[_0x04ff('0x18')][_0x04ff('0x19')]===0x1f4){logger[_0x04ff('0x18')](_0x04ff('0x13'),_0x296561,_0xe0ea59['error'][_0x04ff('0x1a')]);return _0x2a4cca(_0xe0ea59[_0x04ff('0x18')][_0x04ff('0x1a')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x296561,_0xe0ea59[_0x04ff('0x18')][_0x04ff('0x1a')]);return _0x3d91a9(_0xe0ea59['error'][_0x04ff('0x1a')]);}else{logger['info'](_0x04ff('0x13'),_0x296561,_0x04ff('0x14'));_0x3d91a9(_0xe0ea59[_0x04ff('0x1b')][_0x04ff('0x1a')]);}})[_0x04ff('0x1c')](function(_0x5509d0){logger[_0x04ff('0x18')](_0x04ff('0x13'),_0x296561,_0x5509d0);_0x2a4cca(_0x5509d0);});});}exports['GetVoiceQueue']=function(_0x54c778){var _0x2daf59=this;return new Promise(function(_0x142874,_0x1a1d1a){return db[_0x04ff('0x1d')]['findAll']({'raw':_0x54c778[_0x04ff('0x1e')]?_0x54c778['options'][_0x04ff('0x1f')]===undefined?!![]:![]:!![],'where':_0x54c778[_0x04ff('0x1e')]?_0x54c778[_0x04ff('0x1e')][_0x04ff('0x20')]||null:null,'attributes':_0x54c778['options']?_0x54c778['options'][_0x04ff('0x21')]||null:null,'limit':_0x54c778[_0x04ff('0x1e')]?_0x54c778[_0x04ff('0x1e')][_0x04ff('0x22')]||null:null,'include':_0x54c778[_0x04ff('0x1e')]?_0x54c778[_0x04ff('0x1e')][_0x04ff('0x23')]?_[_0x04ff('0x24')](_0x54c778[_0x04ff('0x1e')][_0x04ff('0x23')],function(_0x2dca16){return{'model':db[_0x2dca16[_0x04ff('0x25')]],'as':_0x2dca16['as'],'attributes':_0x2dca16[_0x04ff('0x21')],'include':_0x2dca16['include']?_[_0x04ff('0x24')](_0x2dca16['include'],function(_0x417a91){return{'model':db[_0x417a91[_0x04ff('0x25')]],'as':_0x417a91['as'],'attributes':_0x417a91[_0x04ff('0x21')],'include':_0x417a91[_0x04ff('0x23')]?_['map'](_0x417a91[_0x04ff('0x23')],function(_0x2013d1){return{'model':db[_0x2013d1['model']],'as':_0x2013d1['as'],'attributes':_0x2013d1[_0x04ff('0x21')]};}):[]};}):[]};}):[]:[]})[_0x04ff('0x26')](function(_0x20e8df){logger['info'](_0x04ff('0x27'),_0x54c778);logger[_0x04ff('0x15')]('GetVoiceQueue',_0x54c778,JSON[_0x04ff('0x17')](_0x20e8df));_0x142874(_0x20e8df);})['catch'](function(_0x1fa17d){logger['error'](_0x04ff('0x27'),_0x1fa17d[_0x04ff('0x1a')],_0x54c778);_0x1a1d1a(_0x2daf59[_0x04ff('0x18')](0x1f4,_0x1fa17d['message']));});});};exports[_0x04ff('0x28')]=function(_0x1274ab){var _0x793544=this;return new Promise(function(_0x4feb59,_0x1ae9cd){return db[_0x04ff('0x1d')]['find']({'raw':_0x1274ab[_0x04ff('0x1e')]?_0x1274ab[_0x04ff('0x1e')][_0x04ff('0x1f')]===undefined?!![]:![]:!![],'where':_0x1274ab[_0x04ff('0x1e')]?_0x1274ab[_0x04ff('0x1e')][_0x04ff('0x20')]||null:null,'attributes':_0x1274ab[_0x04ff('0x1e')]?_0x1274ab[_0x04ff('0x1e')][_0x04ff('0x21')]||null:null,'include':_0x1274ab[_0x04ff('0x1e')]?_0x1274ab[_0x04ff('0x1e')]['include']?_[_0x04ff('0x24')](_0x1274ab[_0x04ff('0x1e')][_0x04ff('0x23')],function(_0x3d9d6e){return{'model':db[_0x3d9d6e['model']],'as':_0x3d9d6e['as'],'attributes':_0x3d9d6e[_0x04ff('0x21')],'include':_0x3d9d6e[_0x04ff('0x23')]?_[_0x04ff('0x24')](_0x3d9d6e['include'],function(_0x3c4774){return{'model':db[_0x3c4774[_0x04ff('0x25')]],'as':_0x3c4774['as'],'attributes':_0x3c4774['attributes'],'include':_0x3c4774[_0x04ff('0x23')]?_['map'](_0x3c4774[_0x04ff('0x23')],function(_0x5b53e3){return{'model':db[_0x5b53e3[_0x04ff('0x25')]],'as':_0x5b53e3['as'],'attributes':_0x5b53e3['attributes']};}):[]};}):[]};}):[]:[]})[_0x04ff('0x26')](function(_0x60fb72){logger[_0x04ff('0x12')](_0x04ff('0x28'),_0x1274ab);logger[_0x04ff('0x15')](_0x04ff('0x28'),_0x1274ab,JSON[_0x04ff('0x17')](_0x60fb72));_0x4feb59(_0x60fb72);})[_0x04ff('0x1c')](function(_0x5a3f63){logger[_0x04ff('0x18')](_0x04ff('0x28'),_0x5a3f63['message'],_0x1274ab);_0x1ae9cd(_0x793544[_0x04ff('0x18')](0x1f4,_0x5a3f63[_0x04ff('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 4e75f1a..0cb8492 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 _0x841e=['remove','update','length','./voiceQueue.events'];(function(_0x1206d7,_0x1b0ed7){var _0x5e1142=function(_0x33ab8a){while(--_0x33ab8a){_0x1206d7['push'](_0x1206d7['shift']());}};_0x5e1142(++_0x1b0ed7);}(_0x841e,0x1c3));var _0xe841=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x841e[_0x20a584];return _0x4b41a8;};'use strict';var VoiceQueueEvents=require(_0xe841('0x0'));var events=['save',_0xe841('0x1'),_0xe841('0x2')];function createListener(_0xf0936,_0x36ec3b){return function(_0x4ba770){_0x36ec3b['emit'](_0xf0936,_0x4ba770);};}function removeListener(_0x56c011,_0x451a3c){return function(){VoiceQueueEvents['removeListener'](_0x56c011,_0x451a3c);};}exports['register']=function(_0x553c91){for(var _0x250231=0x0,_0xe4af9=events[_0xe841('0x3')];_0x250231<_0xe4af9;_0x250231++){var _0x286a7c=events[_0x250231];var _0x1c0904=createListener('voiceQueue:'+_0x286a7c,_0x553c91);VoiceQueueEvents['on'](_0x286a7c,_0x1c0904);}}; \ No newline at end of file +var _0x210b=['save','remove','removeListener','length','voiceQueue:'];(function(_0x5750df,_0x5441ff){var _0x1288b6=function(_0x5b9c3a){while(--_0x5b9c3a){_0x5750df['push'](_0x5750df['shift']());}};_0x1288b6(++_0x5441ff);}(_0x210b,0xfa));var _0xb210=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x210b[_0x47a7d0];return _0xb9bd08;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xb210('0x0'),_0xb210('0x1'),'update'];function createListener(_0x1408e1,_0x37bfe8){return function(_0x2a98b3){_0x37bfe8['emit'](_0x1408e1,_0x2a98b3);};}function removeListener(_0x3673e6,_0x593960){return function(){VoiceQueueEvents[_0xb210('0x2')](_0x3673e6,_0x593960);};}exports['register']=function(_0x557590){for(var _0x3177de=0x0,_0x5da442=events[_0xb210('0x3')];_0x3177de<_0x5da442;_0x3177de++){var _0x311d1e=events[_0x3177de];var _0xcf817a=createListener(_0xb210('0x4')+_0x311d1e,_0x557590);VoiceQueueEvents['on'](_0x311d1e,_0xcf817a);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index ff51dee..642454a 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 _0x6b1b=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','getVoiceQueuesReport','/:id','create','put','destroy'];(function(_0x296d86,_0x3f66f5){var _0x19a60e=function(_0x18f47a){while(--_0x18f47a){_0x296d86['push'](_0x296d86['shift']());}};_0x19a60e(++_0x3f66f5);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x6b1b[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require('multer');var util=require(_0xb6b1('0x0'));var path=require(_0xb6b1('0x1'));var timeout=require(_0xb6b1('0x2'));var express=require('express');var router=express[_0xb6b1('0x3')]();var auth=require(_0xb6b1('0x4'));var interaction=require(_0xb6b1('0x5'));var config=require(_0xb6b1('0x6'));var controller=require(_0xb6b1('0x7'));router[_0xb6b1('0x8')]('/',auth[_0xb6b1('0x9')](),controller[_0xb6b1('0xa')]);router[_0xb6b1('0x8')](_0xb6b1('0xb'),auth[_0xb6b1('0x9')](),controller['describe']);router[_0xb6b1('0x8')]('/index',auth['isAuthenticated'](),controller[_0xb6b1('0xc')]);router['get'](_0xb6b1('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb6b1('0xe')]);router[_0xb6b1('0xf')]('/:id',auth[_0xb6b1('0x9')](),controller['update']);router['delete'](_0xb6b1('0xd'),auth[_0xb6b1('0x9')](),controller[_0xb6b1('0x10')]);module[_0xb6b1('0x11')]=router; \ No newline at end of file +var _0x3a6d=['/index','getVoiceQueuesReport','/:id','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x388879,_0xe0b81b){var _0x42ce08=function(_0x29f2aa){while(--_0x29f2aa){_0x388879['push'](_0x388879['shift']());}};_0x42ce08(++_0xe0b81b);}(_0x3a6d,0x143));var _0xd3a6=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x3a6d[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var auth=require(_0xd3a6('0x5'));var interaction=require(_0xd3a6('0x6'));var config=require('../../config/environment');var controller=require(_0xd3a6('0x7'));router[_0xd3a6('0x8')]('/',auth[_0xd3a6('0x9')](),controller[_0xd3a6('0xa')]);router[_0xd3a6('0x8')](_0xd3a6('0xb'),auth['isAuthenticated'](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0x8')](_0xd3a6('0xd'),auth[_0xd3a6('0x9')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0x8')](_0xd3a6('0xf'),auth[_0xd3a6('0x9')](),controller[_0xd3a6('0x10')]);router['post']('/',auth[_0xd3a6('0x9')](),controller[_0xd3a6('0x11')]);router[_0xd3a6('0x12')](_0xd3a6('0xf'),auth[_0xd3a6('0x9')](),controller['update']);router['delete']('/:id',auth[_0xd3a6('0x9')](),controller[_0xd3a6('0x13')]);module[_0xd3a6('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 a85564e..d07682a 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 _0xcc59=['YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format'];(function(_0x4c2462,_0x29a448){var _0x568667=function(_0x2100d3){while(--_0x2100d3){_0x4c2462['push'](_0x4c2462['shift']());}};_0x568667(++_0x29a448);}(_0xcc59,0x1ba));var _0x9cc5=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0xcc59[_0x5f46e7];return _0x567e95;};'use strict';var Sequelize=require(_0x9cc5('0x0'));var moment=require(_0x9cc5('0x1'));module[_0x9cc5('0x2')]={'type':{'type':Sequelize[_0x9cc5('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9cc5('0x3')]},'calleridname':{'type':Sequelize[_0x9cc5('0x3')]},'queue':{'type':Sequelize[_0x9cc5('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x9cc5('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x497aa6){var _0x2edaaf=moment(_0x497aa6);var _0x5b9b22=moment(this[_0x9cc5('0x5')](_0x9cc5('0x6')))[_0x9cc5('0x7')](_0x9cc5('0x8'));var _0x166104=_0x2edaaf[_0x9cc5('0x9')](_0x5b9b22,_0x9cc5('0xa'));this['setDataValue'](_0x9cc5('0xb'),_0x497aa6);this[_0x9cc5('0xc')](_0x9cc5('0xd'),_0x166104||null);}},'position':{'type':Sequelize[_0x9cc5('0xe')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x9cc5('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x9cc5('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x9cc5('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x9cc5('0x3')],'comment':_0x9cc5('0x10')},'originalposition':{'type':Sequelize[_0x9cc5('0xe')]},'channel':{'type':Sequelize[_0x9cc5('0x3')]},'connectedlinenum':{'type':Sequelize[_0x9cc5('0x3')]},'connectedlinename':{'type':Sequelize[_0x9cc5('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9cc5('0x3')]},'exten':{'type':Sequelize[_0x9cc5('0x3')]},'priority':{'type':Sequelize[_0x9cc5('0x3')]},'holdtime':{'type':Sequelize[_0x9cc5('0xe')]},'mohtime':{'type':Sequelize[_0x9cc5('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9cc5('0x3')]},'transfer':{'type':Sequelize[_0x9cc5('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9cc5('0x3')],'comment':_0x9cc5('0x11')},'transferexten':{'type':Sequelize[_0x9cc5('0x3')]},'transferuniqueid':{'type':Sequelize[_0x9cc5('0x3')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3a40=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x118c30,_0x7eb1eb){var _0x569999=function(_0x550ba2){while(--_0x550ba2){_0x118c30['push'](_0x118c30['shift']());}};_0x569999(++_0x7eb1eb);}(_0x3a40,0x1ab));var _0x03a4=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3a40[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x03a4('0x0'));var moment=require(_0x03a4('0x1'));module[_0x03a4('0x2')]={'type':{'type':Sequelize[_0x03a4('0x3')]},'uniqueid':{'type':Sequelize[_0x03a4('0x3')]},'calleridnum':{'type':Sequelize[_0x03a4('0x3')]},'calleridname':{'type':Sequelize[_0x03a4('0x3')]},'queue':{'type':Sequelize[_0x03a4('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x03a4('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x03a4('0x4')],'set':function(_0x3d4fcd){var _0x72a44=moment(_0x3d4fcd);var _0xa10c61=moment(this[_0x03a4('0x5')](_0x03a4('0x6')))[_0x03a4('0x7')](_0x03a4('0x8'));var _0x258213=_0x72a44[_0x03a4('0x9')](_0xa10c61,'seconds');this[_0x03a4('0xa')](_0x03a4('0xb'),_0x3d4fcd);this[_0x03a4('0xa')](_0x03a4('0xc'),_0x258213||null);}},'position':{'type':Sequelize[_0x03a4('0xd')]},'count':{'type':Sequelize[_0x03a4('0xd')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x03a4('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x03a4('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x03a4('0x3')],'comment':_0x03a4('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x03a4('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x03a4('0x3')]},'exten':{'type':Sequelize[_0x03a4('0x3')]},'priority':{'type':Sequelize[_0x03a4('0x3')]},'holdtime':{'type':Sequelize[_0x03a4('0xd')]},'mohtime':{'type':Sequelize[_0x03a4('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x03a4('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x03a4('0x3')]},'transfer':{'type':Sequelize[_0x03a4('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x03a4('0x3')],'comment':_0x03a4('0x10')},'transferexten':{'type':Sequelize[_0x03a4('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x03a4('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x03a4('0xd')],'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 b660984..0775bce 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 _0x0295=['offset','Content-Range','reject','update','then','error','stack','name','send','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','pick','options','getVoiceQueuesReport','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','./voiceQueueReport.socket','register','sendStatus','status','end','json','count'];(function(_0x4251e5,_0xffe5c3){var _0x3d6236=function(_0x4b6d59){while(--_0x4b6d59){_0x4251e5['push'](_0x4251e5['shift']());}};_0x3d6236(++_0xffe5c3);}(_0x0295,0x1f0));var _0x5029=function(_0x3256c6,_0x3166f8){_0x3256c6=_0x3256c6-0x0;var _0x19ae14=_0x0295[_0x3256c6];return _0x19ae14;};'use strict';var pdf=require(_0x5029('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5029('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5029('0x2'));var BPromise=require(_0x5029('0x3'));var Mustache=require(_0x5029('0x4'));var util=require(_0x5029('0x5'));var path=require(_0x5029('0x6'));var sox=require(_0x5029('0x7'));var csv=require(_0x5029('0x8'));var ejs=require(_0x5029('0x9'));var fs=require('fs');var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var db=require('../../mysqldb')['db'];config[_0x5029('0x14')]=_[_0x5029('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5029('0x16'))[_0x5029('0x17')](socket);function respondWithStatusCode(_0x12c237,_0x434630){_0x434630=_0x434630||0xcc;return function(_0x2c0b33){if(_0x2c0b33){return _0x12c237[_0x5029('0x18')](_0x434630);}return _0x12c237[_0x5029('0x19')](_0x434630)[_0x5029('0x1a')]();};}function respondWithResult(_0x10bf55,_0x326923){_0x326923=_0x326923||0xc8;return function(_0x457c73){if(_0x457c73){return _0x10bf55[_0x5029('0x19')](_0x326923)[_0x5029('0x1b')](_0x457c73);}};}function respondWithFilteredResult(_0x2c273c,_0x343918){return function(_0x4f7ab4){if(_0x4f7ab4){var _0x1ed567=_0x4f7ab4[_0x5029('0x1c')],_0x31a155=_0x343918[_0x5029('0x1d')],_0x35de81=_0x343918[_0x5029('0x1d')]+_0x343918['limit'],_0x4902f3;if(_0x35de81>=_0x1ed567){_0x35de81=_0x1ed567;_0x4902f3=0xc8;}else{_0x4902f3=0xce;}_0x2c273c[_0x5029('0x19')](_0x4902f3);return _0x2c273c['set'](_0x5029('0x1e'),_0x31a155+'-'+_0x35de81+'/'+_0x1ed567)[_0x5029('0x1b')](_0x4f7ab4);}return null;};}function patchUpdates(_0x2710aa){return function(_0x3cf0fb){try{jsonpatch['apply'](_0x3cf0fb,_0x2710aa,!![]);}catch(_0x47ecca){return BPromise[_0x5029('0x1f')](_0x47ecca);}return _0x3cf0fb['save']();};}function saveUpdates(_0x3f657d,_0x853a34){return function(_0x1eb228){if(_0x1eb228){return _0x1eb228[_0x5029('0x20')](_0x3f657d)[_0x5029('0x21')](function(_0x3a3e52){return _0x3a3e52;});}return null;};}function removeEntity(_0x125c26,_0x356dac){return function(_0x3e857d){if(_0x3e857d){return _0x3e857d['destroy']()['then'](function(){_0x125c26['status'](0xcc)[_0x5029('0x1a')]();});}};}function handleEntityNotFound(_0x45666c,_0x51093c){return function(_0x5727e9){if(!_0x5727e9){_0x45666c[_0x5029('0x18')](0x194);}return _0x5727e9;};}function handleError(_0x1e7e61,_0x36d810){_0x36d810=_0x36d810||0x1f4;return function(_0x5527fc){logger[_0x5029('0x22')](_0x5527fc[_0x5029('0x23')]);if(_0x5527fc['name']){delete _0x5527fc[_0x5029('0x24')];}_0x1e7e61[_0x5029('0x19')](_0x36d810)[_0x5029('0x25')](_0x5527fc);};}exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={},_0x4b6f92={},_0x2cedf6={'count':0x0,'rows':[]};var _0x2bb398=_['map'](db[_0x5029('0x26')][_0x5029('0x27')],function(_0x4434ff){return{'name':_0x4434ff[_0x5029('0x28')],'type':_0x4434ff[_0x5029('0x29')][_0x5029('0x2a')]};});_0x4b6f92[_0x5029('0x2b')]=_[_0x5029('0x2c')](_0x2bb398,_0x5029('0x24'));_0x4b6f92[_0x5029('0x2d')]=_[_0x5029('0x2e')](_0x32da06[_0x5029('0x2d')]);_0x4b6f92['filters']=_[_0x5029('0x2f')](_0x4b6f92['model'],_0x4b6f92[_0x5029('0x2d')]);_0xe5313e['attributes']=_['intersection'](_0x4b6f92[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x32da06[_0x5029('0x2d')]['fields']));_0xe5313e[_0x5029('0x31')]=_0xe5313e[_0x5029('0x31')][_0x5029('0x32')]?_0xe5313e[_0x5029('0x31')]:_0x4b6f92[_0x5029('0x2b')];if(!_0x32da06[_0x5029('0x2d')][_0x5029('0x33')](_0x5029('0x34'))){_0xe5313e[_0x5029('0x35')]=qs['limit'](_0x32da06[_0x5029('0x2d')][_0x5029('0x35')]);_0xe5313e[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x32da06['query'][_0x5029('0x1d')]);}_0xe5313e[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x32da06['query']['sort']);_0xe5313e[_0x5029('0x38')]=qs[_0x5029('0x39')](_['pick'](_0x32da06['query'],_0x4b6f92[_0x5029('0x39')]));if(_0x32da06[_0x5029('0x2d')][_0x5029('0x3a')]){_0xe5313e[_0x5029('0x38')]=_[_0x5029('0x3b')](_0xe5313e[_0x5029('0x38')],{'$or':_[_0x5029('0x2c')](_0x2bb398,function(_0x2f13b1){if(_0x2f13b1[_0x5029('0x29')]!==_0x5029('0x3c')){var _0x3e5b67={};_0x3e5b67[_0x2f13b1[_0x5029('0x24')]]={'$like':'%'+_0x32da06[_0x5029('0x2d')][_0x5029('0x3a')]+'%'};return _0x3e5b67;}})});}_0xe5313e=_['merge']({},_0xe5313e,_0x32da06['options']);var _0x73797c={'where':_0xe5313e[_0x5029('0x38')]};return db[_0x5029('0x26')]['count'](_0x73797c)[_0x5029('0x21')](function(_0x39b216){_0x2cedf6['count']=_0x39b216;if(_0x32da06[_0x5029('0x2d')]['includeAll']){_0xe5313e[_0x5029('0x3d')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x5029('0x3e')](_0xe5313e);})[_0x5029('0x21')](function(_0x24a18d){_0x2cedf6[_0x5029('0x3f')]=_0x24a18d;return _0x2cedf6;})[_0x5029('0x21')](respondWithFilteredResult(_0x251f99,_0xe5313e))[_0x5029('0x40')](handleError(_0x251f99,null));};exports[_0x5029('0x41')]=function(_0x1021ea,_0x2ae047){var _0x5a3e4d={'raw':![],'where':{'id':_0x1021ea[_0x5029('0x42')]['id']}},_0x103dfb={};_0x103dfb[_0x5029('0x2b')]=_[_0x5029('0x2e')](db[_0x5029('0x26')][_0x5029('0x27')]);_0x103dfb['query']=_[_0x5029('0x2e')](_0x1021ea[_0x5029('0x2d')]);_0x103dfb[_0x5029('0x39')]=_[_0x5029('0x2f')](_0x103dfb[_0x5029('0x2b')],_0x103dfb['query']);_0x5a3e4d[_0x5029('0x31')]=_[_0x5029('0x2f')](_0x103dfb[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x1021ea[_0x5029('0x2d')][_0x5029('0x30')]));_0x5a3e4d[_0x5029('0x31')]=_0x5a3e4d[_0x5029('0x31')][_0x5029('0x32')]?_0x5a3e4d['attributes']:_0x103dfb[_0x5029('0x2b')];if(_0x1021ea[_0x5029('0x2d')][_0x5029('0x43')]){_0x5a3e4d[_0x5029('0x3d')]=[{'all':!![]}];}_0x5a3e4d=_['merge']({},_0x5a3e4d,_0x1021ea['options']);return db[_0x5029('0x26')][_0x5029('0x44')](_0x5a3e4d)[_0x5029('0x21')](handleEntityNotFound(_0x2ae047,null))[_0x5029('0x21')](respondWithResult(_0x2ae047,null))[_0x5029('0x40')](handleError(_0x2ae047,null));};exports[_0x5029('0x45')]=function(_0x2bb7fc,_0x19a6ca){return db[_0x5029('0x26')][_0x5029('0x45')](_0x2bb7fc[_0x5029('0x46')],{})[_0x5029('0x21')](respondWithResult(_0x19a6ca,0xc9))[_0x5029('0x40')](handleError(_0x19a6ca,null));};exports[_0x5029('0x20')]=function(_0x3168bd,_0x175cc0){if(_0x3168bd[_0x5029('0x46')]['id']){delete _0x3168bd[_0x5029('0x46')]['id'];}return db[_0x5029('0x26')][_0x5029('0x44')]({'where':{'id':_0x3168bd[_0x5029('0x42')]['id']}})['then'](handleEntityNotFound(_0x175cc0,null))[_0x5029('0x21')](saveUpdates(_0x3168bd['body'],null))[_0x5029('0x21')](respondWithResult(_0x175cc0,null))[_0x5029('0x40')](handleError(_0x175cc0,null));};exports['destroy']=function(_0x5343c6,_0x319bff){return db['VoiceQueueReport']['find']({'where':{'id':_0x5343c6[_0x5029('0x42')]['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x319bff,null))[_0x5029('0x21')](removeEntity(_0x319bff,null))['catch'](handleError(_0x319bff,null));};exports['describe']=function(_0x1510bb,_0x3d4e9a){return db['VoiceQueueReport'][_0x5029('0x47')]()['then'](respondWithResult(_0x3d4e9a,null))[_0x5029('0x40')](handleError(_0x3d4e9a,null));};exports['getVoiceQueuesReport']=function(_0x2340b0,_0x27e1c0){var _0x358c8a={},_0x6d03b2={},_0x42609={'count':0x0,'rows':[]};_0x6d03b2[_0x5029('0x2b')]=_[_0x5029('0x2e')](db[_0x5029('0x26')]['rawAttributes']);_0x6d03b2[_0x5029('0x2d')]=_['keys'](_0x2340b0[_0x5029('0x2d')]);_0x6d03b2[_0x5029('0x39')]=_['intersection'](_0x6d03b2[_0x5029('0x2b')],_0x6d03b2['query']);_0x358c8a['attributes']=_['intersection'](_0x6d03b2[_0x5029('0x2b')],qs['fields'](_0x2340b0[_0x5029('0x2d')][_0x5029('0x30')]));_0x358c8a[_0x5029('0x31')]=_0x358c8a['attributes'][_0x5029('0x32')]?_0x358c8a['attributes']:_0x6d03b2['model'];if(!_0x2340b0[_0x5029('0x2d')][_0x5029('0x33')](_0x5029('0x34'))){_0x358c8a[_0x5029('0x35')]=qs[_0x5029('0x35')](_0x2340b0['query'][_0x5029('0x35')]);_0x358c8a[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x2340b0[_0x5029('0x2d')]['offset']);}_0x358c8a[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x2340b0['query']['sort']);_0x358c8a[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x48')](_0x2340b0[_0x5029('0x2d')],_0x6d03b2['filters']));if(_0x2340b0[_0x5029('0x2d')][_0x5029('0x3a')]){_0x358c8a[_0x5029('0x38')]=_[_0x5029('0x3b')](_0x358c8a[_0x5029('0x38')],{'$or':_[_0x5029('0x2c')](_0x358c8a['attributes'],function(_0x560324){var _0x4314c0={};_0x4314c0[_0x560324]={'$like':'%'+_0x2340b0[_0x5029('0x2d')][_0x5029('0x3a')]+'%'};return _0x4314c0;})});}_0x358c8a=_['merge']({},_0x358c8a,_0x2340b0[_0x5029('0x49')]);var _0x2d439a={'where':_0x358c8a[_0x5029('0x38')]};return db[_0x5029('0x26')][_0x5029('0x1c')](_0x2d439a)['then'](function(_0x2ec5d0){_0x42609[_0x5029('0x1c')]=_0x2ec5d0;if(_0x2340b0[_0x5029('0x2d')]['includeAll']){_0x358c8a[_0x5029('0x3d')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x5029('0x3e')](_0x358c8a);})['then'](function(_0xff558b){_0x42609[_0x5029('0x3f')]=_0xff558b;return _0x42609;})[_0x5029('0x21')](respondWithFilteredResult(_0x27e1c0,_0x358c8a,_0x5029('0x4a')))[_0x5029('0x40')](handleError(_0x27e1c0,null,_0x5029('0x4a')));}; \ No newline at end of file +var _0x66fa=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','includeAll','include','findAll','rows','show','params','intersection','options','find','catch','create','body','getVoiceQueuesReport','pick','filter','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','./voiceQueueReport.socket','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x66fa,0x117));var _0xa66f=function(_0x1715a3,_0x5e3bd2){_0x1715a3=_0x1715a3-0x0;var _0xd88f25=_0x66fa[_0x1715a3];return _0xd88f25;};'use strict';var pdf=require(_0xa66f('0x0'));var emlformat=require(_0xa66f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa66f('0x2'));var jsonpatch=require(_0xa66f('0x3'));var rp=require(_0xa66f('0x4'));var moment=require(_0xa66f('0x5'));var BPromise=require(_0xa66f('0x6'));var Mustache=require(_0xa66f('0x7'));var util=require(_0xa66f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa66f('0x9'));var ejs=require(_0xa66f('0xa'));var fs=require('fs');var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var db=require(_0xa66f('0x14'))['db'];config['redis']=_[_0xa66f('0x15')](config[_0xa66f('0x16')],{'host':_0xa66f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa66f('0x18'))['register'](socket);function respondWithStatusCode(_0x528427,_0x5a7b16){_0x5a7b16=_0x5a7b16||0xcc;return function(_0x3ac0ac){if(_0x3ac0ac){return _0x528427[_0xa66f('0x19')](_0x5a7b16);}return _0x528427[_0xa66f('0x1a')](_0x5a7b16)[_0xa66f('0x1b')]();};}function respondWithResult(_0xd348f9,_0x567d4f){_0x567d4f=_0x567d4f||0xc8;return function(_0x5510dc){if(_0x5510dc){return _0xd348f9[_0xa66f('0x1a')](_0x567d4f)[_0xa66f('0x1c')](_0x5510dc);}};}function respondWithFilteredResult(_0x295acf,_0x403f4d){return function(_0x5c67f5){if(_0x5c67f5){var _0x1cbe64=_0x5c67f5[_0xa66f('0x1d')],_0x55b59d=_0x403f4d[_0xa66f('0x1e')],_0x4a28d4=_0x403f4d[_0xa66f('0x1e')]+_0x403f4d[_0xa66f('0x1f')],_0x2f9da2;if(_0x4a28d4>=_0x1cbe64){_0x4a28d4=_0x1cbe64;_0x2f9da2=0xc8;}else{_0x2f9da2=0xce;}_0x295acf[_0xa66f('0x1a')](_0x2f9da2);return _0x295acf[_0xa66f('0x20')](_0xa66f('0x21'),_0x55b59d+'-'+_0x4a28d4+'/'+_0x1cbe64)[_0xa66f('0x1c')](_0x5c67f5);}return null;};}function patchUpdates(_0x2d9602){return function(_0x235b61){try{jsonpatch[_0xa66f('0x22')](_0x235b61,_0x2d9602,!![]);}catch(_0x3c4eb1){return BPromise[_0xa66f('0x23')](_0x3c4eb1);}return _0x235b61[_0xa66f('0x24')]();};}function saveUpdates(_0x5cd613,_0x27f570){return function(_0xc5c82e){if(_0xc5c82e){return _0xc5c82e[_0xa66f('0x25')](_0x5cd613)[_0xa66f('0x26')](function(_0x5cbd82){return _0x5cbd82;});}return null;};}function removeEntity(_0x337602,_0x473822){return function(_0x209f4d){if(_0x209f4d){return _0x209f4d[_0xa66f('0x27')]()['then'](function(){_0x337602['status'](0xcc)[_0xa66f('0x1b')]();});}};}function handleEntityNotFound(_0x598942,_0x3a3e4f){return function(_0xc661f2){if(!_0xc661f2){_0x598942[_0xa66f('0x19')](0x194);}return _0xc661f2;};}function handleError(_0x57da7f,_0x4683c7){_0x4683c7=_0x4683c7||0x1f4;return function(_0x1c2903){logger[_0xa66f('0x28')](_0x1c2903[_0xa66f('0x29')]);if(_0x1c2903[_0xa66f('0x2a')]){delete _0x1c2903[_0xa66f('0x2a')];}_0x57da7f[_0xa66f('0x1a')](_0x4683c7)[_0xa66f('0x2b')](_0x1c2903);};}exports[_0xa66f('0x2c')]=function(_0x117d03,_0x45f71c){var _0x63650b={},_0x42b966={},_0xeeb22e={'count':0x0,'rows':[]};var _0x49f615=_['map'](db[_0xa66f('0x2d')][_0xa66f('0x2e')],function(_0x55f309){return{'name':_0x55f309[_0xa66f('0x2f')],'type':_0x55f309[_0xa66f('0x30')]['key']};});_0x42b966[_0xa66f('0x31')]=_[_0xa66f('0x32')](_0x49f615,_0xa66f('0x2a'));_0x42b966[_0xa66f('0x33')]=_[_0xa66f('0x34')](_0x117d03['query']);_0x42b966[_0xa66f('0x35')]=_['intersection'](_0x42b966[_0xa66f('0x31')],_0x42b966[_0xa66f('0x33')]);_0x63650b[_0xa66f('0x36')]=_['intersection'](_0x42b966[_0xa66f('0x31')],qs[_0xa66f('0x37')](_0x117d03['query'][_0xa66f('0x37')]));_0x63650b[_0xa66f('0x36')]=_0x63650b[_0xa66f('0x36')][_0xa66f('0x38')]?_0x63650b[_0xa66f('0x36')]:_0x42b966[_0xa66f('0x31')];if(!_0x117d03[_0xa66f('0x33')][_0xa66f('0x39')](_0xa66f('0x3a'))){_0x63650b[_0xa66f('0x1f')]=qs['limit'](_0x117d03[_0xa66f('0x33')]['limit']);_0x63650b[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x117d03[_0xa66f('0x33')][_0xa66f('0x1e')]);}_0x63650b[_0xa66f('0x3b')]=qs[_0xa66f('0x3c')](_0x117d03[_0xa66f('0x33')][_0xa66f('0x3c')]);_0x63650b['where']=qs[_0xa66f('0x35')](_['pick'](_0x117d03[_0xa66f('0x33')],_0x42b966[_0xa66f('0x35')]));if(_0x117d03[_0xa66f('0x33')]['filter']){_0x63650b['where']=_[_0xa66f('0x3d')](_0x63650b[_0xa66f('0x3e')],{'$or':_[_0xa66f('0x32')](_0x49f615,function(_0x1f5a5f){if(_0x1f5a5f[_0xa66f('0x30')]!=='VIRTUAL'){var _0x5cb0a9={};_0x5cb0a9[_0x1f5a5f['name']]={'$like':'%'+_0x117d03[_0xa66f('0x33')]['filter']+'%'};return _0x5cb0a9;}})});}_0x63650b=_['merge']({},_0x63650b,_0x117d03['options']);var _0x5fdc3e={'where':_0x63650b['where']};return db[_0xa66f('0x2d')][_0xa66f('0x1d')](_0x5fdc3e)[_0xa66f('0x26')](function(_0x1647a0){_0xeeb22e[_0xa66f('0x1d')]=_0x1647a0;if(_0x117d03[_0xa66f('0x33')][_0xa66f('0x3f')]){_0x63650b[_0xa66f('0x40')]=[{'all':!![]}];}return db[_0xa66f('0x2d')][_0xa66f('0x41')](_0x63650b);})[_0xa66f('0x26')](function(_0x93f6ff){_0xeeb22e[_0xa66f('0x42')]=_0x93f6ff;return _0xeeb22e;})[_0xa66f('0x26')](respondWithFilteredResult(_0x45f71c,_0x63650b))['catch'](handleError(_0x45f71c,null));};exports[_0xa66f('0x43')]=function(_0x25c2cb,_0x58c1f2){var _0x248587={'raw':![],'where':{'id':_0x25c2cb[_0xa66f('0x44')]['id']}},_0x4b6e6b={};_0x4b6e6b[_0xa66f('0x31')]=_['keys'](db[_0xa66f('0x2d')][_0xa66f('0x2e')]);_0x4b6e6b[_0xa66f('0x33')]=_['keys'](_0x25c2cb[_0xa66f('0x33')]);_0x4b6e6b['filters']=_[_0xa66f('0x45')](_0x4b6e6b[_0xa66f('0x31')],_0x4b6e6b[_0xa66f('0x33')]);_0x248587[_0xa66f('0x36')]=_[_0xa66f('0x45')](_0x4b6e6b[_0xa66f('0x31')],qs[_0xa66f('0x37')](_0x25c2cb['query'][_0xa66f('0x37')]));_0x248587[_0xa66f('0x36')]=_0x248587[_0xa66f('0x36')][_0xa66f('0x38')]?_0x248587[_0xa66f('0x36')]:_0x4b6e6b['model'];if(_0x25c2cb['query'][_0xa66f('0x3f')]){_0x248587[_0xa66f('0x40')]=[{'all':!![]}];}_0x248587=_[_0xa66f('0x3d')]({},_0x248587,_0x25c2cb[_0xa66f('0x46')]);return db[_0xa66f('0x2d')][_0xa66f('0x47')](_0x248587)['then'](handleEntityNotFound(_0x58c1f2,null))[_0xa66f('0x26')](respondWithResult(_0x58c1f2,null))[_0xa66f('0x48')](handleError(_0x58c1f2,null));};exports[_0xa66f('0x49')]=function(_0x5651e9,_0x57c8a0){return db[_0xa66f('0x2d')][_0xa66f('0x49')](_0x5651e9[_0xa66f('0x4a')],{})['then'](respondWithResult(_0x57c8a0,0xc9))['catch'](handleError(_0x57c8a0,null));};exports['update']=function(_0x19e7ce,_0x35e477){if(_0x19e7ce[_0xa66f('0x4a')]['id']){delete _0x19e7ce[_0xa66f('0x4a')]['id'];}return db[_0xa66f('0x2d')][_0xa66f('0x47')]({'where':{'id':_0x19e7ce[_0xa66f('0x44')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x35e477,null))['then'](saveUpdates(_0x19e7ce[_0xa66f('0x4a')],null))[_0xa66f('0x26')](respondWithResult(_0x35e477,null))[_0xa66f('0x48')](handleError(_0x35e477,null));};exports[_0xa66f('0x27')]=function(_0x11597b,_0x33cdc7){return db['VoiceQueueReport'][_0xa66f('0x47')]({'where':{'id':_0x11597b[_0xa66f('0x44')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x33cdc7,null))[_0xa66f('0x26')](removeEntity(_0x33cdc7,null))[_0xa66f('0x48')](handleError(_0x33cdc7,null));};exports['describe']=function(_0x389b9a,_0x50e0cd){return db[_0xa66f('0x2d')]['describe']()['then'](respondWithResult(_0x50e0cd,null))[_0xa66f('0x48')](handleError(_0x50e0cd,null));};exports[_0xa66f('0x4b')]=function(_0x12271d,_0x2c79df){var _0x35ed5b={},_0xe97cf4={},_0x53a62f={'count':0x0,'rows':[]};_0xe97cf4[_0xa66f('0x31')]=_[_0xa66f('0x34')](db[_0xa66f('0x2d')][_0xa66f('0x2e')]);_0xe97cf4['query']=_[_0xa66f('0x34')](_0x12271d['query']);_0xe97cf4[_0xa66f('0x35')]=_[_0xa66f('0x45')](_0xe97cf4[_0xa66f('0x31')],_0xe97cf4[_0xa66f('0x33')]);_0x35ed5b[_0xa66f('0x36')]=_[_0xa66f('0x45')](_0xe97cf4[_0xa66f('0x31')],qs['fields'](_0x12271d[_0xa66f('0x33')][_0xa66f('0x37')]));_0x35ed5b[_0xa66f('0x36')]=_0x35ed5b[_0xa66f('0x36')][_0xa66f('0x38')]?_0x35ed5b[_0xa66f('0x36')]:_0xe97cf4[_0xa66f('0x31')];if(!_0x12271d[_0xa66f('0x33')][_0xa66f('0x39')]('nolimit')){_0x35ed5b['limit']=qs[_0xa66f('0x1f')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x1f')]);_0x35ed5b[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x1e')]);}_0x35ed5b['order']=qs[_0xa66f('0x3c')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x3c')]);_0x35ed5b[_0xa66f('0x3e')]=qs['filters'](_[_0xa66f('0x4c')](_0x12271d[_0xa66f('0x33')],_0xe97cf4[_0xa66f('0x35')]));if(_0x12271d[_0xa66f('0x33')][_0xa66f('0x4d')]){_0x35ed5b[_0xa66f('0x3e')]=_['merge'](_0x35ed5b['where'],{'$or':_[_0xa66f('0x32')](_0x35ed5b[_0xa66f('0x36')],function(_0x174aad){var _0x52edb3={};_0x52edb3[_0x174aad]={'$like':'%'+_0x12271d[_0xa66f('0x33')][_0xa66f('0x4d')]+'%'};return _0x52edb3;})});}_0x35ed5b=_[_0xa66f('0x3d')]({},_0x35ed5b,_0x12271d[_0xa66f('0x46')]);var _0x17b2cf={'where':_0x35ed5b[_0xa66f('0x3e')]};return db[_0xa66f('0x2d')][_0xa66f('0x1d')](_0x17b2cf)[_0xa66f('0x26')](function(_0x5d4299){_0x53a62f[_0xa66f('0x1d')]=_0x5d4299;if(_0x12271d[_0xa66f('0x33')][_0xa66f('0x3f')]){_0x35ed5b[_0xa66f('0x40')]=[{'all':!![]}];}return db[_0xa66f('0x2d')][_0xa66f('0x41')](_0x35ed5b);})[_0xa66f('0x26')](function(_0x3b38ad){_0x53a62f['rows']=_0x3b38ad;return _0x53a62f;})['then'](respondWithFilteredResult(_0x2c79df,_0x35ed5b,_0xa66f('0x4b')))[_0xa66f('0x48')](handleError(_0x2c79df,null,_0xa66f('0x4b')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 0bda29c..1191d75 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 _0x3011=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x5189d6,_0x557268){var _0xb04855=function(_0x49d867){while(--_0x49d867){_0x5189d6['push'](_0x5189d6['shift']());}};_0xb04855(++_0x557268);}(_0x3011,0x162));var _0x1301=function(_0x5f53c3,_0x5f40b0){_0x5f53c3=_0x5f53c3-0x0;var _0x5d4be5=_0x3011[_0x5f53c3];return _0x5d4be5;};'use strict';var EventEmitter=require(_0x1301('0x0'));var VoiceQueueReport=require(_0x1301('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1301('0x2')](0x0);var events={'afterCreate':_0x1301('0x3'),'afterUpdate':'update','afterDestroy':_0x1301('0x4')};function emitEvent(_0x14bdfb){return function(_0x2a2941,_0xa4e4a6,_0x41e144){VoiceQueueReportEvents[_0x1301('0x5')](_0x14bdfb+':'+_0x2a2941['id'],_0x2a2941);VoiceQueueReportEvents[_0x1301('0x5')](_0x14bdfb,_0x2a2941);_0x41e144(null);};}for(var e in events){if(events[_0x1301('0x6')](e)){var event=events[e];VoiceQueueReport[_0x1301('0x7')](e,emitEvent(event));}}module[_0x1301('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x3a9f=['remove','emit','hook','exports','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x5434dd,_0x5b6caa){var _0x5d55de=function(_0x5515fe){while(--_0x5515fe){_0x5434dd['push'](_0x5434dd['shift']());}};_0x5d55de(++_0x5b6caa);}(_0x3a9f,0x1cc));var _0xf3a9=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x3a9f[_0x51fe5f];return _0x4abce9;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xf3a9('0x0'))['db'][_0xf3a9('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf3a9('0x2')](0x0);var events={'afterCreate':_0xf3a9('0x3'),'afterUpdate':'update','afterDestroy':_0xf3a9('0x4')};function emitEvent(_0x455497){return function(_0x1df7e6,_0x17e510,_0x145b04){VoiceQueueReportEvents[_0xf3a9('0x5')](_0x455497+':'+_0x1df7e6['id'],_0x1df7e6);VoiceQueueReportEvents[_0xf3a9('0x5')](_0x455497,_0x1df7e6);_0x145b04(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xf3a9('0x6')](e,emitEvent(event));}}module[_0xf3a9('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index afa8eec..ff7de0c 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 _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api'];(function(_0x5706fb,_0xacfe3c){var _0x21799d=function(_0x9a813e){while(--_0x9a813e){_0x5706fb['push'](_0x5706fb['shift']());}};_0x21799d(++_0xacfe3c);}(_0xdb28,0x106));var _0x8db2=function(_0x470730,_0x1389fa){_0x470730=_0x470730-0x0;var _0x317cd8=_0xdb28[_0x470730];return _0x317cd8;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./voiceQueueReport.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8db2('0xc')]},{'fields':[_0x8db2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f66=['request-promise','path','../../config/environment','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','api','moment','bluebird'];(function(_0xf0744c,_0x123219){var _0x4bf463=function(_0x3e6c5c){while(--_0x3e6c5c){_0xf0744c['push'](_0xf0744c['shift']());}};_0x4bf463(++_0x123219);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var fs=require('fs');var path=require(_0x65f6('0x5'));var rimraf=require('rimraf');var config=require(_0x65f6('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'paranoid':![],'indexes':[{'fields':[_0x65f6('0xa')]},{'fields':[_0x65f6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 102ed9d..e47286d 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 _0x29b8=['include','map','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','VoiceQueueReport','update','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit'];(function(_0x2c6573,_0x4a6473){var _0x4c42ec=function(_0x12aa7d){while(--_0x12aa7d){_0x2c6573['push'](_0x2c6573['shift']());}};_0x4c42ec(++_0x4a6473);}(_0x29b8,0x169));var _0x829b=function(_0x102f97,_0x5bda2f){_0x102f97=_0x102f97-0x0;var _0xd22058=_0x29b8[_0x102f97];return _0xd22058;};'use strict';var _=require(_0x829b('0x0'));var util=require(_0x829b('0x1'));var moment=require(_0x829b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x829b('0x3'));var db=require(_0x829b('0x4'))['db'];var utils=require(_0x829b('0x5'));var logger=require(_0x829b('0x6'))(_0x829b('0x7'));var config=require(_0x829b('0x8'));var jayson=require(_0x829b('0x9'));var client=jayson[_0x829b('0xa')]['http']({'port':0x232a});config[_0x829b('0xb')]=_[_0x829b('0xc')](config[_0x829b('0xb')],{'host':_0x829b('0xd'),'port':0x18eb});var socket=require(_0x829b('0xe'))(new Redis(config[_0x829b('0xb')]));require('./voiceQueueReport.socket')[_0x829b('0xf')](socket);function respondWithRpcPromise(_0x582703,_0x4b5a5c,_0x4802eb){return new BPromise(function(_0x130b4d,_0x46db5b){return client[_0x829b('0x10')](_0x582703,_0x4802eb)[_0x829b('0x11')](function(_0xcc115){logger[_0x829b('0x12')](_0x829b('0x13'),_0x4b5a5c,'request\x20sent');logger[_0x829b('0x14')](_0x829b('0x15'),_0x4b5a5c,'request\x20sent',JSON[_0x829b('0x16')](_0xcc115));if(_0xcc115[_0x829b('0x17')]){if(_0xcc115[_0x829b('0x17')]['code']===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x4b5a5c,_0xcc115[_0x829b('0x17')][_0x829b('0x18')]);return _0x46db5b(_0xcc115[_0x829b('0x17')][_0x829b('0x18')]);}logger[_0x829b('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x4b5a5c,_0xcc115[_0x829b('0x17')][_0x829b('0x18')]);return _0x130b4d(_0xcc115['error'][_0x829b('0x18')]);}else{logger[_0x829b('0x12')](_0x829b('0x13'),_0x4b5a5c,_0x829b('0x19'));_0x130b4d(_0xcc115[_0x829b('0x1a')][_0x829b('0x18')]);}})[_0x829b('0x1b')](function(_0x3fe280){logger[_0x829b('0x17')](_0x829b('0x13'),_0x4b5a5c,_0x3fe280);_0x46db5b(_0x3fe280);});});}exports[_0x829b('0x1c')]=function(_0x1cb974){var _0x3b1e3d=this;return new Promise(function(_0x1522b8,_0x1c8bcc){return db['VoiceQueueReport'][_0x829b('0x1d')]({'raw':_0x1cb974['options']?_0x1cb974[_0x829b('0x1e')][_0x829b('0x1f')]===undefined?!![]:![]:!![],'where':_0x1cb974[_0x829b('0x1e')]?_0x1cb974['options'][_0x829b('0x20')]||null:null,'attributes':_0x1cb974[_0x829b('0x1e')]?_0x1cb974[_0x829b('0x1e')][_0x829b('0x21')]||null:null,'limit':_0x1cb974[_0x829b('0x1e')]?_0x1cb974[_0x829b('0x1e')][_0x829b('0x22')]||null:null,'include':_0x1cb974[_0x829b('0x1e')]?_0x1cb974[_0x829b('0x1e')][_0x829b('0x23')]?_[_0x829b('0x24')](_0x1cb974['options']['include'],function(_0x2cb106){return{'model':db[_0x2cb106[_0x829b('0x25')]],'as':_0x2cb106['as'],'attributes':_0x2cb106[_0x829b('0x21')],'include':_0x2cb106['include']?_[_0x829b('0x24')](_0x2cb106['include'],function(_0xae839b){return{'model':db[_0xae839b[_0x829b('0x25')]],'as':_0xae839b['as'],'attributes':_0xae839b[_0x829b('0x21')],'include':_0xae839b[_0x829b('0x23')]?_['map'](_0xae839b[_0x829b('0x23')],function(_0x3ccdb2){return{'model':db[_0x3ccdb2[_0x829b('0x25')]],'as':_0x3ccdb2['as'],'attributes':_0x3ccdb2[_0x829b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21ad31){logger['info'](_0x829b('0x1c'),_0x1cb974);logger[_0x829b('0x14')](_0x829b('0x1c'),_0x1cb974,JSON[_0x829b('0x16')](_0x21ad31));_0x1522b8(_0x21ad31);})['catch'](function(_0x2c69fc){logger[_0x829b('0x17')](_0x829b('0x1c'),_0x2c69fc['message'],_0x1cb974);_0x1c8bcc(_0x3b1e3d['error'](0x1f4,_0x2c69fc[_0x829b('0x18')]));});});};exports[_0x829b('0x26')]=function(_0x2c4408){var _0x37ba9b=this;return new Promise(function(_0x42bbe9,_0x472d82){return db['VoiceQueueReport'][_0x829b('0x27')](_0x2c4408[_0x829b('0x28')],{'raw':_0x2c4408['options']?_0x2c4408['options'][_0x829b('0x1f')]===undefined?!![]:![]:!![]})[_0x829b('0x11')](function(_0x2b9547){logger[_0x829b('0x12')](_0x829b('0x26'),_0x2c4408);logger[_0x829b('0x14')](_0x829b('0x26'),_0x2c4408,JSON[_0x829b('0x16')](_0x2b9547));_0x42bbe9(_0x2b9547);})[_0x829b('0x1b')](function(_0x4d1d42){logger[_0x829b('0x17')](_0x829b('0x26'),_0x4d1d42[_0x829b('0x18')],_0x2c4408);_0x472d82(_0x37ba9b[_0x829b('0x17')](0x1f4,_0x4d1d42[_0x829b('0x18')]));});});};exports[_0x829b('0x29')]=function(_0x25d046){var _0x5bbe7c=this;return new Promise(function(_0x1b7d88,_0x4dc87c){return db[_0x829b('0x2a')][_0x829b('0x2b')](_0x25d046[_0x829b('0x28')],{'raw':_0x25d046[_0x829b('0x1e')]?_0x25d046[_0x829b('0x1e')][_0x829b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25d046[_0x829b('0x1e')]?_0x25d046['options'][_0x829b('0x20')]||null:null,'attributes':_0x25d046['options']?_0x25d046[_0x829b('0x1e')][_0x829b('0x21')]||null:null,'limit':_0x25d046['options']?_0x25d046[_0x829b('0x1e')][_0x829b('0x22')]||null:null})[_0x829b('0x11')](function(_0x4da0d3){logger[_0x829b('0x12')](_0x829b('0x29'),_0x25d046);logger['debug'](_0x829b('0x29'),_0x25d046,JSON[_0x829b('0x16')](_0x4da0d3));_0x1b7d88(_0x4da0d3);})[_0x829b('0x1b')](function(_0x4a0474){logger[_0x829b('0x17')](_0x829b('0x29'),_0x4a0474[_0x829b('0x18')],_0x25d046);_0x4dc87c(_0x5bbe7c['error'](0x1f4,_0x4a0474[_0x829b('0x18')]));});});}; \ No newline at end of file +var _0x1a40=['update','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceQueueReport','options','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','body','raw','UpdateVoiceQueueReport'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1a40,0xd3));var _0x01a4=function(_0x5de1ca,_0x122002){_0x5de1ca=_0x5de1ca-0x0;var _0x2e4d27=_0x1a40[_0x5de1ca];return _0x2e4d27;};'use strict';var _=require('lodash');var util=require(_0x01a4('0x0'));var moment=require(_0x01a4('0x1'));var BPromise=require(_0x01a4('0x2'));var rs=require(_0x01a4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01a4('0x4'))['db'];var utils=require(_0x01a4('0x5'));var logger=require(_0x01a4('0x6'))(_0x01a4('0x7'));var config=require(_0x01a4('0x8'));var jayson=require(_0x01a4('0x9'));var client=jayson[_0x01a4('0xa')][_0x01a4('0xb')]({'port':0x232a});config[_0x01a4('0xc')]=_['defaults'](config[_0x01a4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x01a4('0xd'))(new Redis(config[_0x01a4('0xc')]));require(_0x01a4('0xe'))[_0x01a4('0xf')](socket);function respondWithRpcPromise(_0xea48e,_0x5da08f,_0x53ad6e){return new BPromise(function(_0x1b326a,_0x3fda5b){return client[_0x01a4('0x10')](_0xea48e,_0x53ad6e)[_0x01a4('0x11')](function(_0x3e7b5f){logger[_0x01a4('0x12')](_0x01a4('0x13'),_0x5da08f,_0x01a4('0x14'));logger[_0x01a4('0x15')](_0x01a4('0x16'),_0x5da08f,'request\x20sent',JSON[_0x01a4('0x17')](_0x3e7b5f));if(_0x3e7b5f[_0x01a4('0x18')]){if(_0x3e7b5f[_0x01a4('0x18')][_0x01a4('0x19')]===0x1f4){logger[_0x01a4('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x5da08f,_0x3e7b5f['error'][_0x01a4('0x1a')]);return _0x3fda5b(_0x3e7b5f[_0x01a4('0x18')][_0x01a4('0x1a')]);}logger[_0x01a4('0x18')](_0x01a4('0x13'),_0x5da08f,_0x3e7b5f[_0x01a4('0x18')][_0x01a4('0x1a')]);return _0x1b326a(_0x3e7b5f['error'][_0x01a4('0x1a')]);}else{logger[_0x01a4('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x5da08f,_0x01a4('0x14'));_0x1b326a(_0x3e7b5f['result'][_0x01a4('0x1a')]);}})[_0x01a4('0x1b')](function(_0x4d607a){logger['error'](_0x01a4('0x13'),_0x5da08f,_0x4d607a);_0x3fda5b(_0x4d607a);});});}exports['GetVoiceQueueReport']=function(_0xdecc74){var _0x23ddd3=this;return new Promise(function(_0x49fc8d,_0x2bcf84){return db[_0x01a4('0x1c')]['findAll']({'raw':_0xdecc74[_0x01a4('0x1d')]?_0xdecc74[_0x01a4('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xdecc74[_0x01a4('0x1d')]?_0xdecc74[_0x01a4('0x1d')][_0x01a4('0x1e')]||null:null,'attributes':_0xdecc74[_0x01a4('0x1d')]?_0xdecc74[_0x01a4('0x1d')][_0x01a4('0x1f')]||null:null,'limit':_0xdecc74[_0x01a4('0x1d')]?_0xdecc74[_0x01a4('0x1d')][_0x01a4('0x20')]||null:null,'include':_0xdecc74[_0x01a4('0x1d')]?_0xdecc74[_0x01a4('0x1d')][_0x01a4('0x21')]?_[_0x01a4('0x22')](_0xdecc74[_0x01a4('0x1d')][_0x01a4('0x21')],function(_0x4465ff){return{'model':db[_0x4465ff[_0x01a4('0x23')]],'as':_0x4465ff['as'],'attributes':_0x4465ff[_0x01a4('0x1f')],'include':_0x4465ff[_0x01a4('0x21')]?_[_0x01a4('0x22')](_0x4465ff[_0x01a4('0x21')],function(_0x206bc2){return{'model':db[_0x206bc2['model']],'as':_0x206bc2['as'],'attributes':_0x206bc2['attributes'],'include':_0x206bc2[_0x01a4('0x21')]?_[_0x01a4('0x22')](_0x206bc2[_0x01a4('0x21')],function(_0x1201c2){return{'model':db[_0x1201c2[_0x01a4('0x23')]],'as':_0x1201c2['as'],'attributes':_0x1201c2[_0x01a4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x01a4('0x11')](function(_0x350605){logger[_0x01a4('0x12')]('GetVoiceQueueReport',_0xdecc74);logger[_0x01a4('0x15')](_0x01a4('0x24'),_0xdecc74,JSON['stringify'](_0x350605));_0x49fc8d(_0x350605);})[_0x01a4('0x1b')](function(_0x57f8d0){logger['error'](_0x01a4('0x24'),_0x57f8d0[_0x01a4('0x1a')],_0xdecc74);_0x2bcf84(_0x23ddd3['error'](0x1f4,_0x57f8d0['message']));});});};exports[_0x01a4('0x25')]=function(_0x3eab9a){var _0x5ac753=this;return new Promise(function(_0x34db9a,_0x3a4500){return db[_0x01a4('0x1c')]['create'](_0x3eab9a[_0x01a4('0x26')],{'raw':_0x3eab9a[_0x01a4('0x1d')]?_0x3eab9a[_0x01a4('0x1d')][_0x01a4('0x27')]===undefined?!![]:![]:!![]})[_0x01a4('0x11')](function(_0x2e00bb){logger[_0x01a4('0x12')]('CreateVoiceQueueReport',_0x3eab9a);logger['debug'](_0x01a4('0x25'),_0x3eab9a,JSON[_0x01a4('0x17')](_0x2e00bb));_0x34db9a(_0x2e00bb);})['catch'](function(_0x209709){logger[_0x01a4('0x18')](_0x01a4('0x25'),_0x209709['message'],_0x3eab9a);_0x3a4500(_0x5ac753[_0x01a4('0x18')](0x1f4,_0x209709[_0x01a4('0x1a')]));});});};exports[_0x01a4('0x28')]=function(_0x48435a){var _0x5cc9a4=this;return new Promise(function(_0x90b533,_0x55e982){return db[_0x01a4('0x1c')][_0x01a4('0x29')](_0x48435a[_0x01a4('0x26')],{'raw':_0x48435a[_0x01a4('0x1d')]?_0x48435a[_0x01a4('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48435a[_0x01a4('0x1d')]?_0x48435a['options'][_0x01a4('0x1e')]||null:null,'attributes':_0x48435a[_0x01a4('0x1d')]?_0x48435a[_0x01a4('0x1d')]['attributes']||null:null,'limit':_0x48435a[_0x01a4('0x1d')]?_0x48435a[_0x01a4('0x1d')][_0x01a4('0x20')]||null:null})[_0x01a4('0x11')](function(_0xab6f16){logger[_0x01a4('0x12')](_0x01a4('0x28'),_0x48435a);logger[_0x01a4('0x15')](_0x01a4('0x28'),_0x48435a,JSON[_0x01a4('0x17')](_0xab6f16));_0x90b533(_0xab6f16);})[_0x01a4('0x1b')](function(_0x182d9a){logger[_0x01a4('0x18')](_0x01a4('0x28'),_0x182d9a[_0x01a4('0x1a')],_0x48435a);_0x55e982(_0x5cc9a4['error'](0x1f4,_0x182d9a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 88b84df..616be46 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 _0x5292=['register','length','voiceQueueReport:','save','update','emit','removeListener'];(function(_0x2e26e0,_0x59fc69){var _0x432020=function(_0x138bf0){while(--_0x138bf0){_0x2e26e0['push'](_0x2e26e0['shift']());}};_0x432020(++_0x59fc69);}(_0x5292,0x96));var _0x2529=function(_0x4fa08c,_0x30cac4){_0x4fa08c=_0x4fa08c-0x0;var _0x7a920a=_0x5292[_0x4fa08c];return _0x7a920a;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x2529('0x0'),'remove',_0x2529('0x1')];function createListener(_0x1a385d,_0x4cad4c){return function(_0x10c02c){_0x4cad4c[_0x2529('0x2')](_0x1a385d,_0x10c02c);};}function removeListener(_0x240214,_0xd0cf71){return function(){VoiceQueueReportEvents[_0x2529('0x3')](_0x240214,_0xd0cf71);};}exports[_0x2529('0x4')]=function(_0x5cd45d){for(var _0x44f0b6=0x0,_0x46555e=events[_0x2529('0x5')];_0x44f0b6<_0x46555e;_0x44f0b6++){var _0x37e993=events[_0x44f0b6];var _0x283440=createListener(_0x2529('0x6')+_0x37e993,_0x5cd45d);VoiceQueueReportEvents['on'](_0x37e993,_0x283440);}}; \ No newline at end of file +var _0xd378=['length','remove','removeListener','register'];(function(_0x3cc8a2,_0x1f897a){var _0x1946e3=function(_0x6b1fe1){while(--_0x6b1fe1){_0x3cc8a2['push'](_0x3cc8a2['shift']());}};_0x1946e3(++_0x1f897a);}(_0xd378,0x129));var _0x8d37=function(_0xabae5f,_0x22c9de){_0xabae5f=_0xabae5f-0x0;var _0x9b3535=_0xd378[_0xabae5f];return _0x9b3535;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0x8d37('0x0'),'update'];function createListener(_0x2a11ad,_0x1bfb86){return function(_0x275554){_0x1bfb86['emit'](_0x2a11ad,_0x275554);};}function removeListener(_0x68c4aa,_0x3e72a0){return function(){VoiceQueueReportEvents[_0x8d37('0x1')](_0x68c4aa,_0x3e72a0);};}exports[_0x8d37('0x2')]=function(_0x5daa3b){for(var _0x71564a=0x0,_0x53a013=events[_0x8d37('0x3')];_0x71564a<_0x53a013;_0x71564a++){var _0x407f84=events[_0x71564a];var _0x452db2=createListener('voiceQueueReport:'+_0x407f84,_0x5daa3b);VoiceQueueReportEvents['on'](_0x407f84,_0x452db2);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index e440ab7..b9079fe 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 _0x80ea=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','show','post','create','/:id','update'];(function(_0x1aee84,_0x4d7fdd){var _0x2b89af=function(_0x350deb){while(--_0x350deb){_0x1aee84['push'](_0x1aee84['shift']());}};_0x2b89af(++_0x4d7fdd);}(_0x80ea,0x1cf));var _0xa80e=function(_0x49ec3e,_0xf9ec6){_0x49ec3e=_0x49ec3e-0x0;var _0xe81e5b=_0x80ea[_0x49ec3e];return _0xe81e5b;};'use strict';var multer=require(_0xa80e('0x0'));var util=require(_0xa80e('0x1'));var path=require(_0xa80e('0x2'));var timeout=require(_0xa80e('0x3'));var express=require(_0xa80e('0x4'));var router=express[_0xa80e('0x5')]();var auth=require(_0xa80e('0x6'));var interaction=require(_0xa80e('0x7'));var config=require(_0xa80e('0x8'));var controller=require(_0xa80e('0x9'));router[_0xa80e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa80e('0xa')]('/:id',auth[_0xa80e('0xb')](),controller[_0xa80e('0xc')]);router[_0xa80e('0xd')]('/',auth['isAuthenticated'](),controller[_0xa80e('0xe')]);router['put'](_0xa80e('0xf'),auth[_0xa80e('0xb')](),controller[_0xa80e('0x10')]);router[_0xa80e('0x11')]('/:id',auth[_0xa80e('0xb')](),controller[_0xa80e('0x12')]);module[_0xa80e('0x13')]=router; \ No newline at end of file +var _0xd5b1=['index','/:id','post','create','put','update','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x21bfce,_0x4c2c80){var _0x1cd9e0=function(_0x3fb74c){while(--_0x3fb74c){_0x21bfce['push'](_0x21bfce['shift']());}};_0x1cd9e0(++_0x4c2c80);}(_0xd5b1,0x116));var _0x1d5b=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0xd5b1[_0x29dda1];return _0x21b0ef;};'use strict';var multer=require(_0x1d5b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1d5b('0x1'));var express=require('express');var router=express[_0x1d5b('0x2')]();var auth=require(_0x1d5b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1d5b('0x4'));var controller=require('./voiceQueuesLog.controller');router[_0x1d5b('0x5')]('/',auth[_0x1d5b('0x6')](),controller[_0x1d5b('0x7')]);router[_0x1d5b('0x5')](_0x1d5b('0x8'),auth[_0x1d5b('0x6')](),controller['show']);router[_0x1d5b('0x9')]('/',auth[_0x1d5b('0x6')](),controller[_0x1d5b('0xa')]);router[_0x1d5b('0xb')](_0x1d5b('0x8'),auth[_0x1d5b('0x6')](),controller[_0x1d5b('0xc')]);router[_0x1d5b('0xd')]('/:id',auth[_0x1d5b('0x6')](),controller['destroy']);module[_0x1d5b('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 151fdda..85d86c7 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 _0xf81e=['exports','STRING','format','sequelize','moment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf81e,0x80));var _0xef81=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf81e[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xef81('0x0'));var moment=require(_0xef81('0x1'));module[_0xef81('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xef81('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xef81('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xef81('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xef81('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xef81('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xef81('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xef81('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xef81('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xef81('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x6b6a=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE'];(function(_0x572c8a,_0x320aca){var _0x2f11f2=function(_0xd6c9d0){while(--_0xd6c9d0){_0x572c8a['push'](_0x572c8a['shift']());}};_0x2f11f2(++_0x320aca);}(_0x6b6a,0xe5));var _0xa6b6=function(_0x5bcd0a,_0x2a552d){_0x5bcd0a=_0x5bcd0a-0x0;var _0x5293a6=_0x6b6a[_0x5bcd0a];return _0x5293a6;};'use strict';var Sequelize=require(_0xa6b6('0x0'));var moment=require(_0xa6b6('0x1'));module[_0xa6b6('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xa6b6('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa6b6('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa6b6('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xa6b6('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa6b6('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa6b6('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xa6b6('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xa6b6('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xa6b6('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0xa6b6('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 84b8a46..871775b 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 _0x8ce7=['lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','save','then','destroy','error','name','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','map','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x8ce7,0xc9));var _0x78ce=function(_0x50de9b,_0x926c10){_0x50de9b=_0x50de9b-0x0;var _0x2841e0=_0x8ce7[_0x50de9b];return _0x2841e0;};'use strict';var pdf=require(_0x78ce('0x0'));var emlformat=require(_0x78ce('0x1'));var rimraf=require(_0x78ce('0x2'));var zipdir=require(_0x78ce('0x3'));var jsonpatch=require(_0x78ce('0x4'));var rp=require(_0x78ce('0x5'));var moment=require(_0x78ce('0x6'));var BPromise=require(_0x78ce('0x7'));var Mustache=require(_0x78ce('0x8'));var util=require('util');var path=require('path');var sox=require(_0x78ce('0x9'));var csv=require(_0x78ce('0xa'));var ejs=require(_0x78ce('0xb'));var fs=require('fs');var _=require(_0x78ce('0xc'));var squel=require(_0x78ce('0xd'));var crypto=require(_0x78ce('0xe'));var jsforce=require(_0x78ce('0xf'));var deskjs=require(_0x78ce('0x10'));var toCsv=require(_0x78ce('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x78ce('0x11'));var authService=require(_0x78ce('0x12'));var qs=require(_0x78ce('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78ce('0x14'));var logger=require('../../config/logger')(_0x78ce('0x15'));var utils=require(_0x78ce('0x16'));var config=require(_0x78ce('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bf75a,_0x2413dc){_0x2413dc=_0x2413dc||0xcc;return function(_0x2b923c){if(_0x2b923c){return _0x2bf75a[_0x78ce('0x18')](_0x2413dc);}return _0x2bf75a[_0x78ce('0x19')](_0x2413dc)[_0x78ce('0x1a')]();};}function respondWithResult(_0x6a63c9,_0x4a8172){_0x4a8172=_0x4a8172||0xc8;return function(_0x5c0669){if(_0x5c0669){return _0x6a63c9[_0x78ce('0x19')](_0x4a8172)[_0x78ce('0x1b')](_0x5c0669);}};}function respondWithFilteredResult(_0xcd9c6d,_0x2edfc8){return function(_0x567d79){if(_0x567d79){var _0x7b628a=_0x567d79['count'],_0x55a6a2=_0x2edfc8[_0x78ce('0x1c')],_0x2def4c=_0x2edfc8[_0x78ce('0x1c')]+_0x2edfc8[_0x78ce('0x1d')],_0x2c12fb;if(_0x2def4c>=_0x7b628a){_0x2def4c=_0x7b628a;_0x2c12fb=0xc8;}else{_0x2c12fb=0xce;}_0xcd9c6d['status'](_0x2c12fb);return _0xcd9c6d[_0x78ce('0x1e')](_0x78ce('0x1f'),_0x55a6a2+'-'+_0x2def4c+'/'+_0x7b628a)[_0x78ce('0x1b')](_0x567d79);}return null;};}function patchUpdates(_0x1e07d6){return function(_0x35b111){try{jsonpatch['apply'](_0x35b111,_0x1e07d6,!![]);}catch(_0x5a95c0){return BPromise['reject'](_0x5a95c0);}return _0x35b111[_0x78ce('0x20')]();};}function saveUpdates(_0x41bfe0,_0x181e0f){return function(_0x1f7618){if(_0x1f7618){return _0x1f7618['update'](_0x41bfe0)[_0x78ce('0x21')](function(_0x1e9ceb){return _0x1e9ceb;});}return null;};}function removeEntity(_0x2f4dd5,_0x26c224){return function(_0x6a297d){if(_0x6a297d){return _0x6a297d[_0x78ce('0x22')]()['then'](function(){_0x2f4dd5[_0x78ce('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xed58e8,_0x5b5040){return function(_0x2d5203){if(!_0x2d5203){_0xed58e8[_0x78ce('0x18')](0x194);}return _0x2d5203;};}function handleError(_0x13d5bb,_0x1160db){_0x1160db=_0x1160db||0x1f4;return function(_0x5e561f){logger[_0x78ce('0x23')](_0x5e561f['stack']);if(_0x5e561f[_0x78ce('0x24')]){delete _0x5e561f[_0x78ce('0x24')];}_0x13d5bb[_0x78ce('0x19')](_0x1160db)['send'](_0x5e561f);};}exports[_0x78ce('0x25')]=function(_0x466f33,_0x5bb0d6){var _0xc7d9a8={},_0x3f6dcd={},_0x16ca68={'count':0x0,'rows':[]};var _0x3dadfc=_['map'](db[_0x78ce('0x26')][_0x78ce('0x27')],function(_0x4be476){return{'name':_0x4be476[_0x78ce('0x28')],'type':_0x4be476[_0x78ce('0x29')][_0x78ce('0x2a')]};});_0x3f6dcd[_0x78ce('0x2b')]=_[_0x78ce('0x2c')](_0x3dadfc,_0x78ce('0x24'));_0x3f6dcd['query']=_['keys'](_0x466f33['query']);_0x3f6dcd[_0x78ce('0x2d')]=_[_0x78ce('0x2e')](_0x3f6dcd[_0x78ce('0x2b')],_0x3f6dcd['query']);_0xc7d9a8[_0x78ce('0x2f')]=_[_0x78ce('0x2e')](_0x3f6dcd[_0x78ce('0x2b')],qs[_0x78ce('0x30')](_0x466f33[_0x78ce('0x31')]['fields']));_0xc7d9a8[_0x78ce('0x2f')]=_0xc7d9a8[_0x78ce('0x2f')]['length']?_0xc7d9a8['attributes']:_0x3f6dcd[_0x78ce('0x2b')];if(!_0x466f33[_0x78ce('0x31')][_0x78ce('0x32')](_0x78ce('0x33'))){_0xc7d9a8['limit']=qs[_0x78ce('0x1d')](_0x466f33['query'][_0x78ce('0x1d')]);_0xc7d9a8[_0x78ce('0x1c')]=qs[_0x78ce('0x1c')](_0x466f33[_0x78ce('0x31')][_0x78ce('0x1c')]);}_0xc7d9a8[_0x78ce('0x34')]=qs['sort'](_0x466f33[_0x78ce('0x31')][_0x78ce('0x35')]);_0xc7d9a8[_0x78ce('0x36')]=qs[_0x78ce('0x2d')](_[_0x78ce('0x37')](_0x466f33[_0x78ce('0x31')],_0x3f6dcd[_0x78ce('0x2d')]));if(_0x466f33['query'][_0x78ce('0x38')]){_0xc7d9a8['where']=_[_0x78ce('0x39')](_0xc7d9a8[_0x78ce('0x36')],{'$or':_[_0x78ce('0x2c')](_0x3dadfc,function(_0x24a459){if(_0x24a459[_0x78ce('0x29')]!=='VIRTUAL'){var _0x341233={};_0x341233[_0x24a459['name']]={'$like':'%'+_0x466f33[_0x78ce('0x31')]['filter']+'%'};return _0x341233;}})});}_0xc7d9a8=_[_0x78ce('0x39')]({},_0xc7d9a8,_0x466f33['options']);var _0x3248a4={'where':_0xc7d9a8[_0x78ce('0x36')]};return db[_0x78ce('0x26')][_0x78ce('0x3a')](_0x3248a4)[_0x78ce('0x21')](function(_0x4b2819){_0x16ca68[_0x78ce('0x3a')]=_0x4b2819;if(_0x466f33['query'][_0x78ce('0x3b')]){_0xc7d9a8[_0x78ce('0x3c')]=[{'all':!![]}];}return db[_0x78ce('0x26')][_0x78ce('0x3d')](_0xc7d9a8);})['then'](function(_0x5655aa){_0x16ca68[_0x78ce('0x3e')]=_0x5655aa;return _0x16ca68;})[_0x78ce('0x21')](respondWithFilteredResult(_0x5bb0d6,_0xc7d9a8))[_0x78ce('0x3f')](handleError(_0x5bb0d6,null));};exports[_0x78ce('0x40')]=function(_0x471597,_0x21a636){var _0x43cce3={'raw':!![],'where':{'id':_0x471597['params']['id']}},_0x1bce94={};_0x1bce94[_0x78ce('0x2b')]=_[_0x78ce('0x41')](db['VoiceQueuesLog'][_0x78ce('0x27')]);_0x1bce94['query']=_['keys'](_0x471597[_0x78ce('0x31')]);_0x1bce94[_0x78ce('0x2d')]=_[_0x78ce('0x2e')](_0x1bce94[_0x78ce('0x2b')],_0x1bce94[_0x78ce('0x31')]);_0x43cce3['attributes']=_[_0x78ce('0x2e')](_0x1bce94[_0x78ce('0x2b')],qs[_0x78ce('0x30')](_0x471597[_0x78ce('0x31')]['fields']));_0x43cce3['attributes']=_0x43cce3['attributes']['length']?_0x43cce3['attributes']:_0x1bce94[_0x78ce('0x2b')];if(_0x471597[_0x78ce('0x31')]['includeAll']){_0x43cce3[_0x78ce('0x3c')]=[{'all':!![]}];}_0x43cce3=_[_0x78ce('0x39')]({},_0x43cce3,_0x471597[_0x78ce('0x42')]);return db[_0x78ce('0x26')][_0x78ce('0x43')](_0x43cce3)[_0x78ce('0x21')](handleEntityNotFound(_0x21a636,null))['then'](respondWithResult(_0x21a636,null))['catch'](handleError(_0x21a636,null));};exports['create']=function(_0x9a4086,_0x33369d){return db['VoiceQueuesLog'][_0x78ce('0x44')](_0x9a4086[_0x78ce('0x45')],{})[_0x78ce('0x21')](respondWithResult(_0x33369d,0xc9))[_0x78ce('0x3f')](handleError(_0x33369d,null));};exports['update']=function(_0x1eb9ef,_0x279462){if(_0x1eb9ef[_0x78ce('0x45')]['id']){delete _0x1eb9ef['body']['id'];}return db[_0x78ce('0x26')][_0x78ce('0x43')]({'where':{'id':_0x1eb9ef['params']['id']}})['then'](handleEntityNotFound(_0x279462,null))[_0x78ce('0x21')](saveUpdates(_0x1eb9ef[_0x78ce('0x45')],null))[_0x78ce('0x21')](respondWithResult(_0x279462,null))[_0x78ce('0x3f')](handleError(_0x279462,null));};exports[_0x78ce('0x22')]=function(_0xdeaba6,_0x361997){return db['VoiceQueuesLog'][_0x78ce('0x43')]({'where':{'id':_0xdeaba6[_0x78ce('0x46')]['id']}})[_0x78ce('0x21')](handleEntityNotFound(_0x361997,null))[_0x78ce('0x21')](removeEntity(_0x361997,null))[_0x78ce('0x3f')](handleError(_0x361997,null));}; \ No newline at end of file +var _0x9400=['type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName'];(function(_0xb9a3dc,_0x3c05b6){var _0xa8c6f7=function(_0x2652eb){while(--_0x2652eb){_0xb9a3dc['push'](_0xb9a3dc['shift']());}};_0xa8c6f7(++_0x3c05b6);}(_0x9400,0x65));var _0x0940=function(_0x4c3fbf,_0x1228a5){_0x4c3fbf=_0x4c3fbf-0x0;var _0x41513b=_0x9400[_0x4c3fbf];return _0x41513b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0940('0x0'));var rimraf=require(_0x0940('0x1'));var zipdir=require(_0x0940('0x2'));var jsonpatch=require(_0x0940('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0940('0x4'));var Mustache=require(_0x0940('0x5'));var util=require(_0x0940('0x6'));var path=require(_0x0940('0x7'));var sox=require(_0x0940('0x8'));var csv=require('to-csv');var ejs=require(_0x0940('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0940('0xa'));var crypto=require('crypto');var jsforce=require(_0x0940('0xb'));var deskjs=require(_0x0940('0xc'));var toCsv=require(_0x0940('0xd'));var querystring=require(_0x0940('0xe'));var Papa=require(_0x0940('0xf'));var Redis=require('ioredis');var authService=require(_0x0940('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0940('0x11'));var hardwareService=require(_0x0940('0x12'));var logger=require('../../config/logger')(_0x0940('0x13'));var utils=require(_0x0940('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10cc27,_0x239f2f){_0x239f2f=_0x239f2f||0xcc;return function(_0x4cac6f){if(_0x4cac6f){return _0x10cc27['sendStatus'](_0x239f2f);}return _0x10cc27[_0x0940('0x15')](_0x239f2f)[_0x0940('0x16')]();};}function respondWithResult(_0x4d6284,_0x531fe7){_0x531fe7=_0x531fe7||0xc8;return function(_0x33616c){if(_0x33616c){return _0x4d6284[_0x0940('0x15')](_0x531fe7)[_0x0940('0x17')](_0x33616c);}};}function respondWithFilteredResult(_0x57851c,_0x228822){return function(_0x233ab5){if(_0x233ab5){var _0x2fe893=_0x233ab5[_0x0940('0x18')],_0x5c2e9d=_0x228822[_0x0940('0x19')],_0x5376ad=_0x228822[_0x0940('0x19')]+_0x228822[_0x0940('0x1a')],_0x35a582;if(_0x5376ad>=_0x2fe893){_0x5376ad=_0x2fe893;_0x35a582=0xc8;}else{_0x35a582=0xce;}_0x57851c[_0x0940('0x15')](_0x35a582);return _0x57851c[_0x0940('0x1b')](_0x0940('0x1c'),_0x5c2e9d+'-'+_0x5376ad+'/'+_0x2fe893)['json'](_0x233ab5);}return null;};}function patchUpdates(_0x119757){return function(_0x293c3a){try{jsonpatch[_0x0940('0x1d')](_0x293c3a,_0x119757,!![]);}catch(_0x20989c){return BPromise[_0x0940('0x1e')](_0x20989c);}return _0x293c3a['save']();};}function saveUpdates(_0x34b09d,_0x1308b0){return function(_0xfd6c19){if(_0xfd6c19){return _0xfd6c19[_0x0940('0x1f')](_0x34b09d)[_0x0940('0x20')](function(_0x139768){return _0x139768;});}return null;};}function removeEntity(_0x16de74,_0x1bf545){return function(_0x1f9e16){if(_0x1f9e16){return _0x1f9e16[_0x0940('0x21')]()[_0x0940('0x20')](function(){_0x16de74[_0x0940('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc9c383,_0x4d8d33){return function(_0x1eb43e){if(!_0x1eb43e){_0xc9c383['sendStatus'](0x194);}return _0x1eb43e;};}function handleError(_0x121007,_0x49dbcd){_0x49dbcd=_0x49dbcd||0x1f4;return function(_0x263246){logger[_0x0940('0x22')](_0x263246[_0x0940('0x23')]);if(_0x263246[_0x0940('0x24')]){delete _0x263246['name'];}_0x121007[_0x0940('0x15')](_0x49dbcd)[_0x0940('0x25')](_0x263246);};}exports[_0x0940('0x26')]=function(_0x16cd28,_0x30f0b7){var _0x15188f={},_0x36d4bc={},_0x491c7f={'count':0x0,'rows':[]};var _0x6828d4=_[_0x0940('0x27')](db[_0x0940('0x28')][_0x0940('0x29')],function(_0x31faa0){return{'name':_0x31faa0[_0x0940('0x2a')],'type':_0x31faa0[_0x0940('0x2b')][_0x0940('0x2c')]};});_0x36d4bc[_0x0940('0x2d')]=_[_0x0940('0x27')](_0x6828d4,_0x0940('0x24'));_0x36d4bc[_0x0940('0x2e')]=_[_0x0940('0x2f')](_0x16cd28[_0x0940('0x2e')]);_0x36d4bc[_0x0940('0x30')]=_[_0x0940('0x31')](_0x36d4bc[_0x0940('0x2d')],_0x36d4bc[_0x0940('0x2e')]);_0x15188f[_0x0940('0x32')]=_[_0x0940('0x31')](_0x36d4bc['model'],qs['fields'](_0x16cd28[_0x0940('0x2e')][_0x0940('0x33')]));_0x15188f[_0x0940('0x32')]=_0x15188f[_0x0940('0x32')][_0x0940('0x34')]?_0x15188f[_0x0940('0x32')]:_0x36d4bc[_0x0940('0x2d')];if(!_0x16cd28[_0x0940('0x2e')]['hasOwnProperty'](_0x0940('0x35'))){_0x15188f['limit']=qs[_0x0940('0x1a')](_0x16cd28[_0x0940('0x2e')][_0x0940('0x1a')]);_0x15188f[_0x0940('0x19')]=qs[_0x0940('0x19')](_0x16cd28[_0x0940('0x2e')]['offset']);}_0x15188f[_0x0940('0x36')]=qs[_0x0940('0x37')](_0x16cd28['query'][_0x0940('0x37')]);_0x15188f[_0x0940('0x38')]=qs[_0x0940('0x30')](_[_0x0940('0x39')](_0x16cd28[_0x0940('0x2e')],_0x36d4bc[_0x0940('0x30')]));if(_0x16cd28[_0x0940('0x2e')][_0x0940('0x3a')]){_0x15188f[_0x0940('0x38')]=_['merge'](_0x15188f[_0x0940('0x38')],{'$or':_[_0x0940('0x27')](_0x6828d4,function(_0x2d1d6a){if(_0x2d1d6a[_0x0940('0x2b')]!==_0x0940('0x3b')){var _0x5168ad={};_0x5168ad[_0x2d1d6a[_0x0940('0x24')]]={'$like':'%'+_0x16cd28[_0x0940('0x2e')]['filter']+'%'};return _0x5168ad;}})});}_0x15188f=_['merge']({},_0x15188f,_0x16cd28[_0x0940('0x3c')]);var _0x5739ae={'where':_0x15188f[_0x0940('0x38')]};return db[_0x0940('0x28')][_0x0940('0x18')](_0x5739ae)['then'](function(_0x504d5f){_0x491c7f[_0x0940('0x18')]=_0x504d5f;if(_0x16cd28[_0x0940('0x2e')]['includeAll']){_0x15188f[_0x0940('0x3d')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x0940('0x3e')](_0x15188f);})[_0x0940('0x20')](function(_0x570b52){_0x491c7f[_0x0940('0x3f')]=_0x570b52;return _0x491c7f;})['then'](respondWithFilteredResult(_0x30f0b7,_0x15188f))[_0x0940('0x40')](handleError(_0x30f0b7,null));};exports[_0x0940('0x41')]=function(_0x910e02,_0x5df06b){var _0x21b1a5={'raw':!![],'where':{'id':_0x910e02[_0x0940('0x42')]['id']}},_0x4e4cd3={};_0x4e4cd3[_0x0940('0x2d')]=_[_0x0940('0x2f')](db[_0x0940('0x28')][_0x0940('0x29')]);_0x4e4cd3[_0x0940('0x2e')]=_[_0x0940('0x2f')](_0x910e02[_0x0940('0x2e')]);_0x4e4cd3[_0x0940('0x30')]=_[_0x0940('0x31')](_0x4e4cd3['model'],_0x4e4cd3[_0x0940('0x2e')]);_0x21b1a5[_0x0940('0x32')]=_[_0x0940('0x31')](_0x4e4cd3[_0x0940('0x2d')],qs[_0x0940('0x33')](_0x910e02[_0x0940('0x2e')][_0x0940('0x33')]));_0x21b1a5[_0x0940('0x32')]=_0x21b1a5[_0x0940('0x32')][_0x0940('0x34')]?_0x21b1a5['attributes']:_0x4e4cd3[_0x0940('0x2d')];if(_0x910e02['query'][_0x0940('0x43')]){_0x21b1a5[_0x0940('0x3d')]=[{'all':!![]}];}_0x21b1a5=_[_0x0940('0x44')]({},_0x21b1a5,_0x910e02[_0x0940('0x3c')]);return db[_0x0940('0x28')][_0x0940('0x45')](_0x21b1a5)[_0x0940('0x20')](handleEntityNotFound(_0x5df06b,null))['then'](respondWithResult(_0x5df06b,null))[_0x0940('0x40')](handleError(_0x5df06b,null));};exports[_0x0940('0x46')]=function(_0x1c695e,_0x3be15c){return db[_0x0940('0x28')][_0x0940('0x46')](_0x1c695e['body'],{})[_0x0940('0x20')](respondWithResult(_0x3be15c,0xc9))['catch'](handleError(_0x3be15c,null));};exports[_0x0940('0x1f')]=function(_0x7a5a48,_0x8301a2){if(_0x7a5a48[_0x0940('0x47')]['id']){delete _0x7a5a48[_0x0940('0x47')]['id'];}return db[_0x0940('0x28')][_0x0940('0x45')]({'where':{'id':_0x7a5a48[_0x0940('0x42')]['id']}})[_0x0940('0x20')](handleEntityNotFound(_0x8301a2,null))['then'](saveUpdates(_0x7a5a48[_0x0940('0x47')],null))['then'](respondWithResult(_0x8301a2,null))[_0x0940('0x40')](handleError(_0x8301a2,null));};exports[_0x0940('0x21')]=function(_0x5ba407,_0x385b33){return db[_0x0940('0x28')]['find']({'where':{'id':_0x5ba407[_0x0940('0x42')]['id']}})[_0x0940('0x20')](handleEntityNotFound(_0x385b33,null))[_0x0940('0x20')](removeEntity(_0x385b33,null))[_0x0940('0x40')](handleError(_0x385b33,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 82fb205..5a302e6 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 _0x1ea6=['define','VoiceQueuesLog','voice_queues_log','event','dtm','util','../../config/logger','api','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x5b5cf0,_0x3e3799){var _0x1738c4=function(_0x15c1ab){while(--_0x15c1ab){_0x5b5cf0['push'](_0x5b5cf0['shift']());}};_0x1738c4(++_0x3e3799);}(_0x1ea6,0x6d));var _0x61ea=function(_0x5d1b7a,_0x9559a6){_0x5d1b7a=_0x5d1b7a-0x0;var _0x3ec602=_0x1ea6[_0x5d1b7a];return _0x3ec602;};'use strict';var _=require('lodash');var util=require(_0x61ea('0x0'));var logger=require(_0x61ea('0x1'))(_0x61ea('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x61ea('0x3'));var rimraf=require(_0x61ea('0x4'));var config=require(_0x61ea('0x5'));var attributes=require(_0x61ea('0x6'));module[_0x61ea('0x7')]=function(_0x367e59,_0xa0c740){return _0x367e59[_0x61ea('0x8')](_0x61ea('0x9'),attributes,{'tableName':_0x61ea('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x61ea('0xb'),_0x61ea('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xca20=['rimraf','../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x280ae7,_0x456fb1){var _0x418b9e=function(_0x4d730d){while(--_0x4d730d){_0x280ae7['push'](_0x280ae7['shift']());}};_0x418b9e(++_0x456fb1);}(_0xca20,0x1a7));var _0x0ca2=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xca20[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0ca2('0x0'))(_0x0ca2('0x1'));var moment=require(_0x0ca2('0x2'));var BPromise=require(_0x0ca2('0x3'));var rp=require(_0x0ca2('0x4'));var fs=require('fs');var path=require(_0x0ca2('0x5'));var rimraf=require(_0x0ca2('0x6'));var config=require(_0x0ca2('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x0ca2('0x8')]=function(_0xb6e2b6,_0x33f609){return _0xb6e2b6[_0x0ca2('0x9')](_0x0ca2('0xa'),attributes,{'tableName':_0x0ca2('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x0ca2('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index b21f4d0..ba146df 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 _0x757a=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\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(_0xd6d2c1,_0x29053c){var _0x178466=function(_0x232636){while(--_0x232636){_0xd6d2c1['push'](_0xd6d2c1['shift']());}};_0x178466(++_0x29053c);}(_0x757a,0xde));var _0xa757=function(_0x3bddd3,_0x559c0b){_0x3bddd3=_0x3bddd3-0x0;var _0x9cbdbc=_0x757a[_0x3bddd3];return _0x9cbdbc;};'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']('VoiceQueuesLog,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('VoiceQueuesLog,\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 +var _0xa699=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3382f5,_0x14183e){var _0x2e5007=function(_0x459f58){while(--_0x459f58){_0x3382f5['push'](_0x3382f5['shift']());}};_0x2e5007(++_0x14183e);}(_0xa699,0x6b));var _0x9a69=function(_0x2fa1c6,_0x4a5b8d){_0x2fa1c6=_0x2fa1c6-0x0;var _0x5f3257=_0xa699[_0x2fa1c6];return _0x5f3257;};'use strict';var _=require(_0x9a69('0x0'));var util=require(_0x9a69('0x1'));var moment=require(_0x9a69('0x2'));var BPromise=require(_0x9a69('0x3'));var rs=require(_0x9a69('0x4'));var fs=require('fs');var Redis=require(_0x9a69('0x5'));var db=require(_0x9a69('0x6'))['db'];var utils=require(_0x9a69('0x7'));var logger=require(_0x9a69('0x8'))(_0x9a69('0x9'));var config=require(_0x9a69('0xa'));var jayson=require(_0x9a69('0xb'));var client=jayson[_0x9a69('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26b842,_0x3f9bce,_0x3bb021){return new BPromise(function(_0x4665a9,_0x5031b0){return client[_0x9a69('0xd')](_0x26b842,_0x3bb021)[_0x9a69('0xe')](function(_0x3fb953){logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,'request\x20sent');logger['debug'](_0x9a69('0x11'),_0x3f9bce,'request\x20sent',JSON[_0x9a69('0x12')](_0x3fb953));if(_0x3fb953[_0x9a69('0x13')]){if(_0x3fb953['error'][_0x9a69('0x14')]===0x1f4){logger[_0x9a69('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x5031b0(_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);}logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x4665a9(_0x3fb953[_0x9a69('0x13')]['message']);}else{logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,_0x9a69('0x16'));_0x4665a9(_0x3fb953['result'][_0x9a69('0x15')]);}})[_0x9a69('0x17')](function(_0x380e46){logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x380e46);_0x5031b0(_0x380e46);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 3104558..e0900c2 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 _0xb737=['../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','/:id/downloads','create','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0xb737,0x189));var _0x7b73=function(_0x23403a,_0x268c35){_0x23403a=_0x23403a-0x0;var _0x685413=_0xb737[_0x23403a];return _0x685413;};'use strict';var multer=require(_0x7b73('0x0'));var util=require(_0x7b73('0x1'));var path=require(_0x7b73('0x2'));var timeout=require(_0x7b73('0x3'));var express=require(_0x7b73('0x4'));var router=express[_0x7b73('0x5')]();var auth=require(_0x7b73('0x6'));var interaction=require(_0x7b73('0x7'));var config=require(_0x7b73('0x8'));var controller=require(_0x7b73('0x9'));router[_0x7b73('0xa')]('/',auth[_0x7b73('0xb')](),controller[_0x7b73('0xc')]);router[_0x7b73('0xa')]('/describe',auth[_0x7b73('0xb')](),controller['describe']);router[_0x7b73('0xa')](_0x7b73('0xd'),auth[_0x7b73('0xb')](),controller['show']);router['get'](_0x7b73('0xe'),auth[_0x7b73('0xb')](),controller[_0x7b73('0xf')]);router['get'](_0x7b73('0x10'),controller['downloads']);router['post']('/',auth[_0x7b73('0xb')](),controller[_0x7b73('0x11')]);router['put'](_0x7b73('0xd'),auth[_0x7b73('0xb')](),controller['update']);router[_0x7b73('0x12')](_0x7b73('0xd'),auth[_0x7b73('0xb')](),controller[_0x7b73('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0f1f=['show','/:id/download','download','/:id/downloads','downloads','create','put','destroy','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','/describe','get','/:id'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0x0f1f,0xd9));var _0xf0f1=function(_0x3cdf50,_0x3e8eb2){_0x3cdf50=_0x3cdf50-0x0;var _0x22d47a=_0x0f1f[_0x3cdf50];return _0x22d47a;};'use strict';var multer=require('multer');var util=require(_0xf0f1('0x0'));var path=require(_0xf0f1('0x1'));var timeout=require(_0xf0f1('0x2'));var express=require(_0xf0f1('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf0f1('0x4'));var config=require(_0xf0f1('0x5'));var controller=require(_0xf0f1('0x6'));router['get']('/',auth[_0xf0f1('0x7')](),controller['index']);router['get'](_0xf0f1('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xf0f1('0x9')](_0xf0f1('0xa'),auth['isAuthenticated'](),controller[_0xf0f1('0xb')]);router['get'](_0xf0f1('0xc'),auth[_0xf0f1('0x7')](),controller[_0xf0f1('0xd')]);router['get'](_0xf0f1('0xe'),controller[_0xf0f1('0xf')]);router['post']('/',auth[_0xf0f1('0x7')](),controller[_0xf0f1('0x10')]);router[_0xf0f1('0x11')]('/:id',auth[_0xf0f1('0x7')](),controller['update']);router['delete'](_0xf0f1('0xa'),auth[_0xf0f1('0x7')](),controller[_0xf0f1('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index a4d92a2..38406de 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 _0xbffb=['updatedAt','sequelize','path','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','membername','split','INTEGER','createdAt','format','MM-DD-YYYY\x20HH:mm','DATE'];(function(_0x686638,_0x37d462){var _0x535412=function(_0x50b0fe){while(--_0x50b0fe){_0x686638['push'](_0x686638['shift']());}};_0x535412(++_0x37d462);}(_0xbffb,0x155));var _0xbbff=function(_0x2e9a31,_0x349215){_0x2e9a31=_0x2e9a31-0x0;var _0x10577e=_0xbffb[_0x2e9a31];return _0x10577e;};'use strict';var Sequelize=require(_0xbbff('0x0'));var moment=require('moment');var path=require(_0xbbff('0x1'));module[_0xbbff('0x2')]={'format':{'type':Sequelize[_0xbbff('0x3')],'get':function(){return this[_0xbbff('0x4')](_0xbbff('0x5'))?path[_0xbbff('0x6')](this[_0xbbff('0x4')](_0xbbff('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0xbbff('0x7')]},'channel':{'type':Sequelize[_0xbbff('0x7')],'set':function(_0x9455ff){if(_0x9455ff){this[_0xbbff('0x8')]('channel',_0x9455ff);this[_0xbbff('0x8')](_0xbbff('0x9'),_0x9455ff[_0xbbff('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xbbff('0x7')]},'calleridname':{'type':Sequelize[_0xbbff('0x7')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xbbff('0x7')]},'accountcode':{'type':Sequelize[_0xbbff('0x7')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xbbff('0x7')]},'value':{'type':Sequelize[_0xbbff('0x7')]},'type':{'type':Sequelize[_0xbbff('0x7')]},'rating':{'type':Sequelize[_0xbbff('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xbbff('0x7')]},'userDisposition':{'type':Sequelize[_0xbbff('0x7')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xbbff('0xc')))[_0xbbff('0xd')](_0xbbff('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0xbbff('0xf')],'get':function(){return moment(this[_0xbbff('0x4')](_0xbbff('0x10')))[_0xbbff('0xd')](_0xbbff('0xe'))['toString']();}}}; \ No newline at end of file +var _0xf12f=['createdAt','DATE','updatedAt','toString','moment','path','getDataValue','value','extname','STRING','setDataValue','channel','membername','split'];(function(_0x178f52,_0x5d9675){var _0x556f99=function(_0x4a7b17){while(--_0x4a7b17){_0x178f52['push'](_0x178f52['shift']());}};_0x556f99(++_0x5d9675);}(_0xf12f,0x11c));var _0xff12=function(_0x18b306,_0x34065a){_0x18b306=_0x18b306-0x0;var _0x5818dd=_0xf12f[_0x18b306];return _0x5818dd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xff12('0x0'));var path=require(_0xff12('0x1'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xff12('0x2')](_0xff12('0x3'))?path[_0xff12('0x4')](this[_0xff12('0x2')](_0xff12('0x3'))):undefined;}},'uniqueid':{'type':Sequelize[_0xff12('0x5')]},'channel':{'type':Sequelize[_0xff12('0x5')],'set':function(_0x504fd5){if(_0x504fd5){this[_0xff12('0x6')](_0xff12('0x7'),_0x504fd5);this[_0xff12('0x6')](_0xff12('0x8'),_0x504fd5[_0xff12('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xff12('0x5')]},'calleridnum':{'type':Sequelize[_0xff12('0x5')]},'calleridname':{'type':Sequelize[_0xff12('0x5')]},'connectedlinenum':{'type':Sequelize[_0xff12('0x5')]},'connectedlinename':{'type':Sequelize[_0xff12('0x5')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xff12('0x5')]},'exten':{'type':Sequelize[_0xff12('0x5')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xff12('0x5')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xff12('0x5')]},'userDisposition':{'type':Sequelize[_0xff12('0x5')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xff12('0x2')](_0xff12('0xa')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0xff12('0xb')],'get':function(){return moment(this[_0xff12('0x2')](_0xff12('0xc')))['format']('MM-DD-YYYY\x20HH:mm')[_0xff12('0xd')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index c8afc68..a376510 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 _0xe390=['query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','show','params','rawAttributes','find','create','body','catch','update','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','decryptFile','secrets','recording','existsSync','filename','extname','unlink','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','col','token','$and','push','Sequelize','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','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','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','reject','save','then','destroy','error','name','send','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','keys'];(function(_0x3d9920,_0x533fec){var _0x4a54a5=function(_0x5a3759){while(--_0x5a3759){_0x3d9920['push'](_0x3d9920['shift']());}};_0x4a54a5(++_0x533fec);}(_0xe390,0x1db));var _0x0e39=function(_0x3290d3,_0x38b836){_0x3290d3=_0x3290d3-0x0;var _0x31455a=_0xe390[_0x3290d3];return _0x31455a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0e39('0x0'));var rimraf=require(_0x0e39('0x1'));var zipdir=require(_0x0e39('0x2'));var jsonpatch=require(_0x0e39('0x3'));var rp=require(_0x0e39('0x4'));var moment=require(_0x0e39('0x5'));var BPromise=require(_0x0e39('0x6'));var Mustache=require(_0x0e39('0x7'));var util=require(_0x0e39('0x8'));var path=require(_0x0e39('0x9'));var sox=require(_0x0e39('0xa'));var csv=require(_0x0e39('0xb'));var ejs=require(_0x0e39('0xc'));var fs=require('fs');var _=require(_0x0e39('0xd'));var squel=require(_0x0e39('0xe'));var crypto=require(_0x0e39('0xf'));var jsforce=require(_0x0e39('0x10'));var deskjs=require(_0x0e39('0x11'));var toCsv=require('to-csv');var querystring=require(_0x0e39('0x12'));var Papa=require(_0x0e39('0x13'));var Redis=require('ioredis');var authService=require(_0x0e39('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x0e39('0x15'));var hardwareService=require(_0x0e39('0x16'));var logger=require(_0x0e39('0x17'))(_0x0e39('0x18'));var utils=require('../../config/utils');var config=require(_0x0e39('0x19'));var db=require(_0x0e39('0x1a'))['db'];function respondWithStatusCode(_0x446044,_0x5eeb3f){_0x5eeb3f=_0x5eeb3f||0xcc;return function(_0x1d6db1){if(_0x1d6db1){return _0x446044[_0x0e39('0x1b')](_0x5eeb3f);}return _0x446044['status'](_0x5eeb3f)[_0x0e39('0x1c')]();};}function respondWithResult(_0x3124e8,_0x12855f){_0x12855f=_0x12855f||0xc8;return function(_0x49cabc){if(_0x49cabc){return _0x3124e8[_0x0e39('0x1d')](_0x12855f)[_0x0e39('0x1e')](_0x49cabc);}};}function respondWithFilteredResult(_0x549473,_0x3abe2c){return function(_0x344936){if(_0x344936){var _0x41f3f9=_0x344936[_0x0e39('0x1f')],_0x374032=_0x3abe2c[_0x0e39('0x20')],_0x1b18d3=_0x3abe2c['offset']+_0x3abe2c[_0x0e39('0x21')],_0x413686;if(_0x1b18d3>=_0x41f3f9){_0x1b18d3=_0x41f3f9;_0x413686=0xc8;}else{_0x413686=0xce;}_0x549473[_0x0e39('0x1d')](_0x413686);return _0x549473['set']('Content-Range',_0x374032+'-'+_0x1b18d3+'/'+_0x41f3f9)[_0x0e39('0x1e')](_0x344936);}return null;};}function patchUpdates(_0x3937ca){return function(_0x5c8812){try{jsonpatch['apply'](_0x5c8812,_0x3937ca,!![]);}catch(_0x31dd62){return BPromise[_0x0e39('0x22')](_0x31dd62);}return _0x5c8812[_0x0e39('0x23')]();};}function saveUpdates(_0x540fbd,_0x1fe532){return function(_0xc82932){if(_0xc82932){return _0xc82932['update'](_0x540fbd)[_0x0e39('0x24')](function(_0x2d6995){return _0x2d6995;});}return null;};}function removeEntity(_0xb7d6b3,_0x259637){return function(_0x2f4d5f){if(_0x2f4d5f){return _0x2f4d5f[_0x0e39('0x25')]()['then'](function(){_0xb7d6b3[_0x0e39('0x1d')](0xcc)[_0x0e39('0x1c')]();});}};}function handleEntityNotFound(_0x4210de,_0x4273c2){return function(_0x4a08b9){if(!_0x4a08b9){_0x4210de['sendStatus'](0x194);}return _0x4a08b9;};}function handleError(_0x2ce979,_0x25fba1){_0x25fba1=_0x25fba1||0x1f4;return function(_0x196d11){logger[_0x0e39('0x26')](_0x196d11['stack']);if(_0x196d11[_0x0e39('0x27')]){delete _0x196d11[_0x0e39('0x27')];}_0x2ce979['status'](_0x25fba1)[_0x0e39('0x28')](_0x196d11);};}exports[_0x0e39('0x29')]=function(_0x4aae5c,_0x4a4e2b){var _0x38d7b4={},_0x1a7cd3={},_0x25583b={'count':0x0,'rows':[]};var _0x490974=_[_0x0e39('0x2a')](db[_0x0e39('0x2b')]['rawAttributes'],function(_0x3477cd){return{'name':_0x3477cd[_0x0e39('0x2c')],'type':_0x3477cd[_0x0e39('0x2d')][_0x0e39('0x2e')]};});_0x1a7cd3[_0x0e39('0x2f')]=_[_0x0e39('0x30')](_[_0x0e39('0x2a')](_0x490974,_0x0e39('0x27')),['format']);_0x1a7cd3['query']=_[_0x0e39('0x31')](_0x4aae5c[_0x0e39('0x32')]);_0x1a7cd3['filters']=_['intersection'](_0x1a7cd3[_0x0e39('0x2f')],_0x1a7cd3['query']);_0x38d7b4[_0x0e39('0x33')]=_[_0x0e39('0x34')](_0x1a7cd3[_0x0e39('0x2f')],qs[_0x0e39('0x35')](_0x4aae5c['query'][_0x0e39('0x35')]));_0x38d7b4[_0x0e39('0x33')]=_0x38d7b4[_0x0e39('0x33')][_0x0e39('0x36')]?_0x38d7b4[_0x0e39('0x33')]:_0x1a7cd3[_0x0e39('0x2f')];if(!_0x4aae5c[_0x0e39('0x32')][_0x0e39('0x37')](_0x0e39('0x38'))){_0x38d7b4[_0x0e39('0x21')]=qs[_0x0e39('0x21')](_0x4aae5c[_0x0e39('0x32')]['limit']);_0x38d7b4[_0x0e39('0x20')]=qs[_0x0e39('0x20')](_0x4aae5c[_0x0e39('0x32')]['offset']);}_0x38d7b4[_0x0e39('0x39')]=qs[_0x0e39('0x3a')](_0x4aae5c[_0x0e39('0x32')]['sort']);_0x38d7b4[_0x0e39('0x3b')]=qs[_0x0e39('0x3c')](_[_0x0e39('0x3d')](_0x4aae5c[_0x0e39('0x32')],_0x1a7cd3['filters']));if(_0x4aae5c[_0x0e39('0x32')]['filter']){_0x38d7b4[_0x0e39('0x3b')]=_[_0x0e39('0x3e')](_0x38d7b4[_0x0e39('0x3b')],{'$or':_['map'](_0x490974,function(_0xc74f57){if(_0xc74f57[_0x0e39('0x2d')]!==_0x0e39('0x3f')){var _0x2ee622={};_0x2ee622[_0xc74f57[_0x0e39('0x27')]]={'$like':'%'+_0x4aae5c[_0x0e39('0x32')][_0x0e39('0x40')]+'%'};return _0x2ee622;}})});}_0x38d7b4=_[_0x0e39('0x3e')]({},_0x38d7b4,_0x4aae5c[_0x0e39('0x41')]);var _0x4e30e4={'where':_0x38d7b4[_0x0e39('0x3b')]};return db['VoiceRecording'][_0x0e39('0x1f')](_0x4e30e4)['then'](function(_0x4381f0){_0x25583b[_0x0e39('0x1f')]=_0x4381f0;if(_0x4aae5c[_0x0e39('0x32')][_0x0e39('0x42')]){_0x38d7b4[_0x0e39('0x43')]=[{'all':!![]}];}return db[_0x0e39('0x2b')]['findAll'](_0x38d7b4);})['then'](function(_0x521749){_0x25583b['rows']=_0x521749;return _0x25583b;})[_0x0e39('0x24')](respondWithFilteredResult(_0x4a4e2b,_0x38d7b4))['catch'](handleError(_0x4a4e2b,null));};exports[_0x0e39('0x44')]=function(_0x1daa76,_0x36ea07){var _0x1f3736={'raw':![],'where':{'id':_0x1daa76[_0x0e39('0x45')]['id']}},_0xb4dd0a={};_0xb4dd0a[_0x0e39('0x2f')]=_['keys'](db[_0x0e39('0x2b')][_0x0e39('0x46')]);_0xb4dd0a['query']=_[_0x0e39('0x31')](_0x1daa76[_0x0e39('0x32')]);_0xb4dd0a[_0x0e39('0x3c')]=_['intersection'](_0xb4dd0a[_0x0e39('0x2f')],_0xb4dd0a[_0x0e39('0x32')]);_0x1f3736[_0x0e39('0x33')]=_[_0x0e39('0x34')](_0xb4dd0a[_0x0e39('0x2f')],qs['fields'](_0x1daa76[_0x0e39('0x32')][_0x0e39('0x35')]));_0x1f3736[_0x0e39('0x33')]=_0x1f3736['attributes'][_0x0e39('0x36')]?_0x1f3736[_0x0e39('0x33')]:_0xb4dd0a[_0x0e39('0x2f')];if(_0x1daa76['query'][_0x0e39('0x42')]){_0x1f3736[_0x0e39('0x43')]=[{'all':!![]}];}_0x1f3736=_[_0x0e39('0x3e')]({},_0x1f3736,_0x1daa76['options']);return db[_0x0e39('0x2b')][_0x0e39('0x47')](_0x1f3736)['then'](handleEntityNotFound(_0x36ea07,null))[_0x0e39('0x24')](respondWithResult(_0x36ea07,null))['catch'](handleError(_0x36ea07,null));};exports[_0x0e39('0x48')]=function(_0x4e7b4d,_0x4f641c){return db[_0x0e39('0x2b')][_0x0e39('0x48')](_0x4e7b4d[_0x0e39('0x49')],{})[_0x0e39('0x24')](respondWithResult(_0x4f641c,0xc9))[_0x0e39('0x4a')](handleError(_0x4f641c,null));};exports[_0x0e39('0x4b')]=function(_0x1bcd0c,_0x3ba048){if(_0x1bcd0c[_0x0e39('0x49')]['id']){delete _0x1bcd0c['body']['id'];}return db['VoiceRecording'][_0x0e39('0x47')]({'where':{'id':_0x1bcd0c[_0x0e39('0x45')]['id']}})[_0x0e39('0x24')](handleEntityNotFound(_0x3ba048,null))[_0x0e39('0x24')](saveUpdates(_0x1bcd0c['body'],null))['then'](respondWithResult(_0x3ba048,null))[_0x0e39('0x4a')](handleError(_0x3ba048,null));};exports[_0x0e39('0x4c')]=function(_0x119dfb,_0x92edf4){return db[_0x0e39('0x2b')]['describe']()[_0x0e39('0x24')](respondWithResult(_0x92edf4,null))[_0x0e39('0x4a')](handleError(_0x92edf4,null));};exports[_0x0e39('0x4d')]=function(_0x2079e4,_0x29ed9a,_0x3005df){var _0x5ce10c=require(_0x0e39('0x4e'));var _0x534b1e=![];var _0x49e390={};if(_0x2079e4[_0x0e39('0x32')]['type']&&_0x2079e4[_0x0e39('0x32')][_0x0e39('0x2d')]==='uniqueid'){_0x49e390[_0x0e39('0x4f')]=_0x2079e4[_0x0e39('0x45')]['id'];}else{_0x49e390['id']=_0x2079e4['params']['id'];}return db['VoiceRecording'][_0x0e39('0x47')]({'where':_0x49e390,'attributes':['id',_0x0e39('0x50')],'raw':!![]})[_0x0e39('0x24')](handleEntityNotFound(_0x29ed9a,null))[_0x0e39('0x24')](function(_0xc4e694){if(_0xc4e694){var _0x5062c8=_0xc4e694[_0x0e39('0x50')];var _0x3c4867=util[_0x0e39('0x51')](_0x0e39('0x52'),_0x5062c8);if(fs['existsSync'](_0x3c4867)){_0x534b1e=!![];return _0x5ce10c[_0x0e39('0x53')](_0x3c4867,_0x5062c8,config[_0x0e39('0x54')][_0x0e39('0x55')])[_0x0e39('0x24')](function(){return _0xc4e694;});}return _0xc4e694;}})[_0x0e39('0x24')](function(_0x8f7be6){if(_0x8f7be6){var _0xd8d7e7=_0x8f7be6[_0x0e39('0x50')];if(!fs[_0x0e39('0x56')](_0xd8d7e7)){throw new db['Sequelize']['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x8f7be6['filename']){return _0x29ed9a[_0x0e39('0x4d')](_0xd8d7e7,_0x8f7be6[_0x0e39('0x57')]+path[_0x0e39('0x58')](_0xd8d7e7),function(){if(_0x534b1e){fs[_0x0e39('0x59')](_0xd8d7e7);}});}else{return _0x29ed9a[_0x0e39('0x4d')](_0xd8d7e7,function(_0xb451da){if(_0x534b1e){fs[_0x0e39('0x59')](_0xd8d7e7);}});}}})[_0x0e39('0x4a')](function(_0x4c1286){if(_0x4c1286['message']===_0x0e39('0x5a')){_0x29ed9a['status'](0x194)['send'](_0x0e39('0x5b'));}else{return handleError(_0x29ed9a,null);}});};exports[_0x0e39('0x5c')]=function(_0x26f5a1,_0xafe9d7,_0x396524){var _0x200a31=require(_0x0e39('0x4e'));var _0x45f99d=![];var _0x104adf={'$and':[db[_0x0e39('0x5d')]['where'](db[_0x0e39('0x5d')]['fn']('MD5',db[_0x0e39('0x5d')][_0x0e39('0x5e')](_0x0e39('0x4f'))),_0x26f5a1['query'][_0x0e39('0x5f')])]};if(_0x26f5a1[_0x0e39('0x32')][_0x0e39('0x2d')]&&_0x26f5a1[_0x0e39('0x32')][_0x0e39('0x2d')]==='uniqueid'){_0x104adf[_0x0e39('0x60')][_0x0e39('0x61')]({'uniqueid':_0x26f5a1[_0x0e39('0x45')]['id']});}else{_0x104adf[_0x0e39('0x60')]['push']({'id':_0x26f5a1['params']['id']});}return db[_0x0e39('0x2b')][_0x0e39('0x47')]({'where':_0x104adf,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0xafe9d7,null))[_0x0e39('0x24')](function(_0x467ebe){if(_0x467ebe){var _0x4c9211=util['format']('%s.cypher',_0x467ebe[_0x0e39('0x50')]);if(fs[_0x0e39('0x56')](_0x4c9211)){_0x45f99d=!![];return _0x200a31['decryptFile'](_0x4c9211,_0x467ebe[_0x0e39('0x50')],config[_0x0e39('0x54')][_0x0e39('0x55')])[_0x0e39('0x24')](function(){return _0x467ebe;});}return _0x467ebe;}})['then'](function(_0x4c1ab9){if(_0x4c1ab9){if(!fs[_0x0e39('0x56')](_0x4c1ab9['value'])){throw new db[(_0x0e39('0x62'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x4c1ab9[_0x0e39('0x57')]){return _0xafe9d7[_0x0e39('0x4d')](_0x4c1ab9[_0x0e39('0x50')],_0x4c1ab9[_0x0e39('0x57')]+path[_0x0e39('0x58')](_0x4c1ab9[_0x0e39('0x50')]),function(){if(_0x45f99d){fs[_0x0e39('0x59')](_0x4c1ab9['value']);}});}else{return _0xafe9d7[_0x0e39('0x4d')](_0x4c1ab9[_0x0e39('0x50')],function(_0x3cdc69){if(_0x45f99d){fs['unlink'](_0x4c1ab9['value']);}});}}})[_0x0e39('0x4a')](handleError(_0xafe9d7,null));};exports[_0x0e39('0x25')]=function(_0x3f5ac1,_0x2f30d5){return db[_0x0e39('0x2b')][_0x0e39('0x47')]({'where':{'id':_0x3f5ac1['params']['id']}})[_0x0e39('0x24')](function(_0x5ce547){if(!_0x5ce547)throw new ReferenceError('Entity\x20not\x20found');return _0x5ce547;})['then'](function(_0x3c20ff){var _0x107cff=_0x3c20ff['value'];logger[_0x0e39('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x107cff);if(!_[_0x0e39('0x64')](_0x3c20ff[_0x0e39('0x50')])&&fs[_0x0e39('0x56')](_0x107cff)){logger[_0x0e39('0x63')](_0x0e39('0x65')+_0x107cff+_0x0e39('0x66'));fs['unlinkSync'](_0x107cff);}_0x107cff=_0x107cff+_0x0e39('0x67');if(!_['isNil'](_0x3c20ff[_0x0e39('0x50')])&&fs[_0x0e39('0x56')](_0x107cff)){logger['info'](_0x0e39('0x65')+_0x107cff+_0x0e39('0x66'));fs[_0x0e39('0x68')](_0x107cff);}return _0x3c20ff;})[_0x0e39('0x24')](function(_0xc6c787){if(!_0xc6c787)throw new InternalError();return _0xc6c787[_0x0e39('0x25')]();})['then'](function(){_0x2f30d5['status'](0xcc)['end']();})[_0x0e39('0x4a')](handleError(_0x2f30d5,null));}; \ No newline at end of file +var _0xc984=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','end','json','count','offset','limit','status','apply','save','update','then','destroy','sendStatus','error','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','decryptFile','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc984,0xc1));var _0x4c98=function(_0x47aa1c,_0x6d799){_0x47aa1c=_0x47aa1c-0x0;var _0x5ef98a=_0xc984[_0x47aa1c];return _0x5ef98a;};'use strict';var pdf=require(_0x4c98('0x0'));var emlformat=require(_0x4c98('0x1'));var rimraf=require(_0x4c98('0x2'));var zipdir=require(_0x4c98('0x3'));var jsonpatch=require(_0x4c98('0x4'));var rp=require(_0x4c98('0x5'));var moment=require(_0x4c98('0x6'));var BPromise=require(_0x4c98('0x7'));var Mustache=require(_0x4c98('0x8'));var util=require(_0x4c98('0x9'));var path=require(_0x4c98('0xa'));var sox=require(_0x4c98('0xb'));var csv=require('to-csv');var ejs=require(_0x4c98('0xc'));var fs=require('fs');var _=require(_0x4c98('0xd'));var squel=require(_0x4c98('0xe'));var crypto=require(_0x4c98('0xf'));var jsforce=require(_0x4c98('0x10'));var deskjs=require(_0x4c98('0x11'));var toCsv=require('to-csv');var querystring=require(_0x4c98('0x12'));var Papa=require('papaparse');var Redis=require(_0x4c98('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x4c98('0x14'));var as=require(_0x4c98('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c98('0x16'))(_0x4c98('0x17'));var utils=require(_0x4c98('0x18'));var config=require('../../config/environment');var db=require(_0x4c98('0x19'))['db'];function respondWithStatusCode(_0x226637,_0x2fbba5){_0x2fbba5=_0x2fbba5||0xcc;return function(_0x28490e){if(_0x28490e){return _0x226637['sendStatus'](_0x2fbba5);}return _0x226637['status'](_0x2fbba5)[_0x4c98('0x1a')]();};}function respondWithResult(_0x22be59,_0x39b109){_0x39b109=_0x39b109||0xc8;return function(_0x3ba5d4){if(_0x3ba5d4){return _0x22be59['status'](_0x39b109)[_0x4c98('0x1b')](_0x3ba5d4);}};}function respondWithFilteredResult(_0x5b2b40,_0x71f813){return function(_0x175258){if(_0x175258){var _0x280c65=_0x175258[_0x4c98('0x1c')],_0x43b064=_0x71f813[_0x4c98('0x1d')],_0x2900e0=_0x71f813[_0x4c98('0x1d')]+_0x71f813[_0x4c98('0x1e')],_0x5ed9c8;if(_0x2900e0>=_0x280c65){_0x2900e0=_0x280c65;_0x5ed9c8=0xc8;}else{_0x5ed9c8=0xce;}_0x5b2b40[_0x4c98('0x1f')](_0x5ed9c8);return _0x5b2b40['set']('Content-Range',_0x43b064+'-'+_0x2900e0+'/'+_0x280c65)[_0x4c98('0x1b')](_0x175258);}return null;};}function patchUpdates(_0xb971aa){return function(_0x45ee77){try{jsonpatch[_0x4c98('0x20')](_0x45ee77,_0xb971aa,!![]);}catch(_0x437d03){return BPromise['reject'](_0x437d03);}return _0x45ee77[_0x4c98('0x21')]();};}function saveUpdates(_0x4573de,_0x43e400){return function(_0x102cfb){if(_0x102cfb){return _0x102cfb[_0x4c98('0x22')](_0x4573de)[_0x4c98('0x23')](function(_0x1c2920){return _0x1c2920;});}return null;};}function removeEntity(_0x442b9b,_0x28371d){return function(_0x3a9129){if(_0x3a9129){return _0x3a9129[_0x4c98('0x24')]()[_0x4c98('0x23')](function(){_0x442b9b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cfc29,_0x2ce32b){return function(_0x1149a7){if(!_0x1149a7){_0x1cfc29[_0x4c98('0x25')](0x194);}return _0x1149a7;};}function handleError(_0x58e89c,_0x1957c1){_0x1957c1=_0x1957c1||0x1f4;return function(_0x5508b1){logger[_0x4c98('0x26')](_0x5508b1['stack']);if(_0x5508b1[_0x4c98('0x27')]){delete _0x5508b1[_0x4c98('0x27')];}_0x58e89c[_0x4c98('0x1f')](_0x1957c1)[_0x4c98('0x28')](_0x5508b1);};}exports['index']=function(_0x550ac1,_0x446c2f){var _0x411517={},_0x36b04d={},_0x6591bf={'count':0x0,'rows':[]};var _0x176186=_[_0x4c98('0x29')](db[_0x4c98('0x2a')][_0x4c98('0x2b')],function(_0x1b0382){return{'name':_0x1b0382[_0x4c98('0x2c')],'type':_0x1b0382[_0x4c98('0x2d')][_0x4c98('0x2e')]};});_0x36b04d[_0x4c98('0x2f')]=_[_0x4c98('0x30')](_[_0x4c98('0x29')](_0x176186,_0x4c98('0x27')),['format']);_0x36b04d[_0x4c98('0x31')]=_[_0x4c98('0x32')](_0x550ac1[_0x4c98('0x31')]);_0x36b04d[_0x4c98('0x33')]=_[_0x4c98('0x34')](_0x36b04d['model'],_0x36b04d[_0x4c98('0x31')]);_0x411517[_0x4c98('0x35')]=_[_0x4c98('0x34')](_0x36b04d['model'],qs[_0x4c98('0x36')](_0x550ac1[_0x4c98('0x31')]['fields']));_0x411517[_0x4c98('0x35')]=_0x411517[_0x4c98('0x35')]['length']?_0x411517[_0x4c98('0x35')]:_0x36b04d[_0x4c98('0x2f')];if(!_0x550ac1[_0x4c98('0x31')][_0x4c98('0x37')]('nolimit')){_0x411517['limit']=qs[_0x4c98('0x1e')](_0x550ac1[_0x4c98('0x31')]['limit']);_0x411517[_0x4c98('0x1d')]=qs['offset'](_0x550ac1[_0x4c98('0x31')][_0x4c98('0x1d')]);}_0x411517['order']=qs['sort'](_0x550ac1[_0x4c98('0x31')][_0x4c98('0x38')]);_0x411517[_0x4c98('0x39')]=qs[_0x4c98('0x33')](_[_0x4c98('0x3a')](_0x550ac1[_0x4c98('0x31')],_0x36b04d[_0x4c98('0x33')]));if(_0x550ac1[_0x4c98('0x31')][_0x4c98('0x3b')]){_0x411517[_0x4c98('0x39')]=_['merge'](_0x411517['where'],{'$or':_['map'](_0x176186,function(_0x4aaa5d){if(_0x4aaa5d['type']!==_0x4c98('0x3c')){var _0x2e2658={};_0x2e2658[_0x4aaa5d['name']]={'$like':'%'+_0x550ac1['query'][_0x4c98('0x3b')]+'%'};return _0x2e2658;}})});}_0x411517=_[_0x4c98('0x3d')]({},_0x411517,_0x550ac1['options']);var _0x45ebf2={'where':_0x411517['where']};return db[_0x4c98('0x2a')][_0x4c98('0x1c')](_0x45ebf2)[_0x4c98('0x23')](function(_0x42b7c8){_0x6591bf[_0x4c98('0x1c')]=_0x42b7c8;if(_0x550ac1[_0x4c98('0x31')][_0x4c98('0x3e')]){_0x411517[_0x4c98('0x3f')]=[{'all':!![]}];}return db[_0x4c98('0x2a')][_0x4c98('0x40')](_0x411517);})[_0x4c98('0x23')](function(_0x552cd2){_0x6591bf[_0x4c98('0x41')]=_0x552cd2;return _0x6591bf;})[_0x4c98('0x23')](respondWithFilteredResult(_0x446c2f,_0x411517))[_0x4c98('0x42')](handleError(_0x446c2f,null));};exports[_0x4c98('0x43')]=function(_0x4f875d,_0x30fe4){var _0x6fcc14={'raw':![],'where':{'id':_0x4f875d[_0x4c98('0x44')]['id']}},_0x228eaf={};_0x228eaf[_0x4c98('0x2f')]=_[_0x4c98('0x32')](db['VoiceRecording'][_0x4c98('0x2b')]);_0x228eaf[_0x4c98('0x31')]=_[_0x4c98('0x32')](_0x4f875d[_0x4c98('0x31')]);_0x228eaf[_0x4c98('0x33')]=_['intersection'](_0x228eaf[_0x4c98('0x2f')],_0x228eaf['query']);_0x6fcc14[_0x4c98('0x35')]=_[_0x4c98('0x34')](_0x228eaf['model'],qs[_0x4c98('0x36')](_0x4f875d[_0x4c98('0x31')][_0x4c98('0x36')]));_0x6fcc14[_0x4c98('0x35')]=_0x6fcc14[_0x4c98('0x35')][_0x4c98('0x45')]?_0x6fcc14[_0x4c98('0x35')]:_0x228eaf[_0x4c98('0x2f')];if(_0x4f875d[_0x4c98('0x31')][_0x4c98('0x3e')]){_0x6fcc14[_0x4c98('0x3f')]=[{'all':!![]}];}_0x6fcc14=_['merge']({},_0x6fcc14,_0x4f875d[_0x4c98('0x46')]);return db[_0x4c98('0x2a')][_0x4c98('0x47')](_0x6fcc14)[_0x4c98('0x23')](handleEntityNotFound(_0x30fe4,null))[_0x4c98('0x23')](respondWithResult(_0x30fe4,null))[_0x4c98('0x42')](handleError(_0x30fe4,null));};exports[_0x4c98('0x48')]=function(_0x16aeb7,_0x6f05d8){return db[_0x4c98('0x2a')][_0x4c98('0x48')](_0x16aeb7[_0x4c98('0x49')],{})[_0x4c98('0x23')](respondWithResult(_0x6f05d8,0xc9))[_0x4c98('0x42')](handleError(_0x6f05d8,null));};exports[_0x4c98('0x22')]=function(_0x43019e,_0x1438f7){if(_0x43019e['body']['id']){delete _0x43019e[_0x4c98('0x49')]['id'];}return db[_0x4c98('0x2a')]['find']({'where':{'id':_0x43019e[_0x4c98('0x44')]['id']}})[_0x4c98('0x23')](handleEntityNotFound(_0x1438f7,null))['then'](saveUpdates(_0x43019e[_0x4c98('0x49')],null))[_0x4c98('0x23')](respondWithResult(_0x1438f7,null))[_0x4c98('0x42')](handleError(_0x1438f7,null));};exports[_0x4c98('0x4a')]=function(_0x5aa25a,_0x202246){return db[_0x4c98('0x2a')][_0x4c98('0x4a')]()[_0x4c98('0x23')](respondWithResult(_0x202246,null))[_0x4c98('0x42')](handleError(_0x202246,null));};exports[_0x4c98('0x4b')]=function(_0x4338fd,_0xbd3d54,_0x5354ae){var _0x480289=require(_0x4c98('0x4c'));var _0x1201e9=![];var _0x2d54f0={};if(_0x4338fd['query'][_0x4c98('0x2d')]&&_0x4338fd[_0x4c98('0x31')]['type']===_0x4c98('0x4d')){_0x2d54f0[_0x4c98('0x4d')]=_0x4338fd[_0x4c98('0x44')]['id'];}else{_0x2d54f0['id']=_0x4338fd[_0x4c98('0x44')]['id'];}return db[_0x4c98('0x2a')][_0x4c98('0x47')]({'where':_0x2d54f0,'attributes':['id','value'],'raw':!![]})[_0x4c98('0x23')](handleEntityNotFound(_0xbd3d54,null))[_0x4c98('0x23')](function(_0x5f06da){if(_0x5f06da){var _0xae34cd=_0x5f06da[_0x4c98('0x4e')];var _0x5773e0=util['format'](_0x4c98('0x4f'),_0xae34cd);if(fs[_0x4c98('0x50')](_0x5773e0)){_0x1201e9=!![];return _0x480289['decryptFile'](_0x5773e0,_0xae34cd,config[_0x4c98('0x51')][_0x4c98('0x52')])['then'](function(){return _0x5f06da;});}return _0x5f06da;}})['then'](function(_0x3a5602){if(_0x3a5602){var _0x358332=_0x3a5602['value'];if(!fs['existsSync'](_0x358332)){throw new db[(_0x4c98('0x53'))][(_0x4c98('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x3a5602[_0x4c98('0x55')]){return _0xbd3d54['download'](_0x358332,_0x3a5602[_0x4c98('0x55')]+path[_0x4c98('0x56')](_0x358332),function(){if(_0x1201e9){fs[_0x4c98('0x57')](_0x358332);}});}else{return _0xbd3d54[_0x4c98('0x4b')](_0x358332,function(_0x58463f){if(_0x1201e9){fs[_0x4c98('0x57')](_0x358332);}});}}})[_0x4c98('0x42')](function(_0x3c91f8){if(_0x3c91f8[_0x4c98('0x58')]===_0x4c98('0x59')){_0xbd3d54['status'](0x194)['send'](_0x4c98('0x5a'));}else{return handleError(_0xbd3d54,null);}});};exports[_0x4c98('0x5b')]=function(_0x1e9432,_0x35ab6f,_0x5286bc){var _0x48d26a=require(_0x4c98('0x4c'));var _0x49fa4a=![];var _0x13c35d={'$and':[db[_0x4c98('0x5c')][_0x4c98('0x39')](db[_0x4c98('0x5c')]['fn'](_0x4c98('0x5d'),db[_0x4c98('0x5c')][_0x4c98('0x5e')](_0x4c98('0x4d'))),_0x1e9432[_0x4c98('0x31')][_0x4c98('0x5f')])]};if(_0x1e9432[_0x4c98('0x31')][_0x4c98('0x2d')]&&_0x1e9432[_0x4c98('0x31')]['type']==='uniqueid'){_0x13c35d[_0x4c98('0x60')][_0x4c98('0x61')]({'uniqueid':_0x1e9432[_0x4c98('0x44')]['id']});}else{_0x13c35d[_0x4c98('0x60')][_0x4c98('0x61')]({'id':_0x1e9432['params']['id']});}return db[_0x4c98('0x2a')][_0x4c98('0x47')]({'where':_0x13c35d,'attributes':['id',_0x4c98('0x4e')],'raw':!![]})[_0x4c98('0x23')](handleEntityNotFound(_0x35ab6f,null))[_0x4c98('0x23')](function(_0x68eaae){if(_0x68eaae){var _0x52cef7=util['format'](_0x4c98('0x4f'),_0x68eaae[_0x4c98('0x4e')]);if(fs[_0x4c98('0x50')](_0x52cef7)){_0x49fa4a=!![];return _0x48d26a[_0x4c98('0x62')](_0x52cef7,_0x68eaae[_0x4c98('0x4e')],config['secrets']['recording'])[_0x4c98('0x23')](function(){return _0x68eaae;});}return _0x68eaae;}})[_0x4c98('0x23')](function(_0xa50034){if(_0xa50034){if(!fs[_0x4c98('0x50')](_0xa50034[_0x4c98('0x4e')])){throw new db['Sequelize']['ValidationError']('VoiceRecording\x20not\x20found');}if(_0xa50034[_0x4c98('0x55')]){return _0x35ab6f['download'](_0xa50034['value'],_0xa50034[_0x4c98('0x55')]+path[_0x4c98('0x56')](_0xa50034[_0x4c98('0x4e')]),function(){if(_0x49fa4a){fs[_0x4c98('0x57')](_0xa50034['value']);}});}else{return _0x35ab6f[_0x4c98('0x4b')](_0xa50034['value'],function(_0x420787){if(_0x49fa4a){fs[_0x4c98('0x57')](_0xa50034[_0x4c98('0x4e')]);}});}}})[_0x4c98('0x42')](handleError(_0x35ab6f,null));};exports[_0x4c98('0x24')]=function(_0x52d072,_0x3e955d){return db[_0x4c98('0x2a')][_0x4c98('0x47')]({'where':{'id':_0x52d072[_0x4c98('0x44')]['id']}})[_0x4c98('0x23')](function(_0x55a6e5){if(!_0x55a6e5)throw new ReferenceError(_0x4c98('0x63'));return _0x55a6e5;})[_0x4c98('0x23')](function(_0xe3788d){var _0x35cf56=_0xe3788d[_0x4c98('0x4e')];logger['info'](_0x4c98('0x64'),_0x35cf56);if(!_[_0x4c98('0x65')](_0xe3788d[_0x4c98('0x4e')])&&fs[_0x4c98('0x50')](_0x35cf56)){logger[_0x4c98('0x66')](_0x4c98('0x67')+_0x35cf56+_0x4c98('0x68'));fs[_0x4c98('0x69')](_0x35cf56);}_0x35cf56=_0x35cf56+_0x4c98('0x6a');if(!_[_0x4c98('0x65')](_0xe3788d['value'])&&fs[_0x4c98('0x50')](_0x35cf56)){logger[_0x4c98('0x66')](_0x4c98('0x67')+_0x35cf56+_0x4c98('0x68'));fs[_0x4c98('0x69')](_0x35cf56);}return _0xe3788d;})[_0x4c98('0x23')](function(_0x83d190){if(!_0x83d190)throw new InternalError();return _0x83d190[_0x4c98('0x24')]();})[_0x4c98('0x23')](function(){_0x3e955d[_0x4c98('0x1f')](0xcc)[_0x4c98('0x1a')]();})[_0x4c98('0x42')](handleError(_0x3e955d,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index a9f8065..d37a760 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 _0xd823=['./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x124fda,_0xbe582){var _0xd4b5e6=function(_0x108832){while(--_0x108832){_0x124fda['push'](_0x124fda['shift']());}};_0xd4b5e6(++_0xbe582);}(_0xd823,0x10d));var _0x3d82=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xd823[_0x3afe18];return _0x19ed1f;};'use strict';var _=require(_0x3d82('0x0'));var util=require(_0x3d82('0x1'));var logger=require(_0x3d82('0x2'))(_0x3d82('0x3'));var moment=require('moment');var BPromise=require(_0x3d82('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d82('0x5'));var rimraf=require(_0x3d82('0x6'));var config=require('../../config/environment');var attributes=require(_0x3d82('0x7'));module['exports']=function(_0x1d3257,_0x2558e9){return _0x1d3257[_0x3d82('0x8')](_0x3d82('0x9'),attributes,{'tableName':_0x3d82('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3d82('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb155=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','voice_recordings','uniqueid','lodash','util','api','moment'];(function(_0x154334,_0x1bb73c){var _0xd5bf66=function(_0x29dbf0){while(--_0x29dbf0){_0x154334['push'](_0x154334['shift']());}};_0xd5bf66(++_0x1bb73c);}(_0xb155,0x1f4));var _0x5b15=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0xb155[_0x9d1e6b];return _0x2b3070;};'use strict';var _=require(_0x5b15('0x0'));var util=require(_0x5b15('0x1'));var logger=require('../../config/logger')(_0x5b15('0x2'));var moment=require(_0x5b15('0x3'));var BPromise=require(_0x5b15('0x4'));var rp=require(_0x5b15('0x5'));var fs=require('fs');var path=require(_0x5b15('0x6'));var rimraf=require(_0x5b15('0x7'));var config=require(_0x5b15('0x8'));var attributes=require(_0x5b15('0x9'));module['exports']=function(_0x107567,_0x439e89){return _0x107567['define']('VoiceRecording',attributes,{'tableName':_0x5b15('0xa'),'paranoid':![],'indexes':[{'name':_0x5b15('0xb'),'fields':[_0x5b15('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 7fb302f..d63318b 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(_0x5eae0c,_0x36d39b){var _0x1695ed=function(_0x265afa){while(--_0x265afa){_0x5eae0c['push'](_0x5eae0c['shift']());}};_0x1695ed(++_0x36d39b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x5e2474,_0x3dde05){var _0x4208ca=function(_0x27a93f){while(--_0x27a93f){_0x5e2474['push'](_0x5e2474['shift']());}};_0x4208ca(++_0x3dde05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 5615530..d80c66f 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 _0xdbf5=['index','/:id','show','put','update','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0xacb2cb,_0x20c853){var _0x583f2a=function(_0x44bb62){while(--_0x44bb62){_0xacb2cb['push'](_0xacb2cb['shift']());}};_0x583f2a(++_0x20c853);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2767ea,_0x3772a0){_0x2767ea=_0x2767ea-0x0;var _0x15dbc0=_0xdbf5[_0x2767ea];return _0x15dbc0;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var auth=require(_0x5dbf('0x3'));var interaction=require(_0x5dbf('0x4'));var config=require(_0x5dbf('0x5'));var controller=require(_0x5dbf('0x6'));router[_0x5dbf('0x7')]('/',auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x9')]);router[_0x5dbf('0x7')](_0x5dbf('0xa'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0xb')]);router['post']('/',auth[_0x5dbf('0x8')](),controller['create']);router[_0x5dbf('0xc')](_0x5dbf('0xa'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0xd')]);router['delete'](_0x5dbf('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5dbf('0xe')]=router; \ No newline at end of file +var _0xe3da=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','post','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4038b7,_0x378b74){var _0xc22722=function(_0x5458f5){while(--_0x5458f5){_0x4038b7['push'](_0x4038b7['shift']());}};_0xc22722(++_0x378b74);}(_0xe3da,0x1cd));var _0xae3d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe3da[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var auth=require(_0xae3d('0x6'));var interaction=require(_0xae3d('0x7'));var config=require(_0xae3d('0x8'));var controller=require(_0xae3d('0x9'));router[_0xae3d('0xa')]('/',auth[_0xae3d('0xb')](),controller[_0xae3d('0xc')]);router[_0xae3d('0xa')](_0xae3d('0xd'),auth[_0xae3d('0xb')](),controller['show']);router[_0xae3d('0xe')]('/',auth[_0xae3d('0xb')](),controller['create']);router['put'](_0xae3d('0xd'),auth[_0xae3d('0xb')](),controller[_0xae3d('0xf')]);router[_0xae3d('0x10')](_0xae3d('0xd'),auth[_0xae3d('0xb')](),controller['destroy']);module[_0xae3d('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index da8c6ce..6df8295 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 _0x3732=['ENUM','moment','exports','blind','attended','STRING'];(function(_0x4b28e2,_0x534280){var _0xfa4226=function(_0x5dd237){while(--_0x5dd237){_0x4b28e2['push'](_0x4b28e2['shift']());}};_0xfa4226(++_0x534280);}(_0x3732,0x9d));var _0x2373=function(_0x5a084d,_0x5ade6e){_0x5a084d=_0x5a084d-0x0;var _0x505e0f=_0x3732[_0x5a084d];return _0x505e0f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2373('0x0'));module[_0x2373('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2373('0x2'),_0x2373('0x3'))},'result':{'type':Sequelize[_0x2373('0x4')]},'transfererchannel':{'type':Sequelize[_0x2373('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x2373('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x2373('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x2373('0x4')]},'transferercontext':{'type':Sequelize[_0x2373('0x4')]},'transfererexten':{'type':Sequelize[_0x2373('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x2373('0x4')]},'transfereechannel':{'type':Sequelize[_0x2373('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x2373('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x2373('0x4')]},'transfereecontext':{'type':Sequelize[_0x2373('0x4')]},'transfereeexten':{'type':Sequelize[_0x2373('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x2373('0x5')]('Yes','No')},'context':{'type':Sequelize[_0x2373('0x4')]},'extension':{'type':Sequelize[_0x2373('0x4')]}}; \ No newline at end of file +var _0xd9c4=['STRING','Yes','moment','blind','attended'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd9c4,0x1ab));var _0x4d9c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd9c4[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4d9c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x4d9c('0x1'),_0x4d9c('0x2'))},'result':{'type':Sequelize[_0x4d9c('0x3')]},'transfererchannel':{'type':Sequelize[_0x4d9c('0x3')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x4d9c('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x4d9c('0x3')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x4d9c('0x3')]},'transferercontext':{'type':Sequelize[_0x4d9c('0x3')]},'transfererexten':{'type':Sequelize[_0x4d9c('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x4d9c('0x3')]},'transfereechannel':{'type':Sequelize[_0x4d9c('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x4d9c('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x4d9c('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x4d9c('0x3')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x4d9c('0x3')]},'isexternal':{'type':Sequelize['ENUM'](_0x4d9c('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4d9c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index c8d12b6..714cc81 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 _0xa571=['set','apply','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','count','offset','limit'];(function(_0x40983c,_0x28e17d){var _0x52b6e8=function(_0x4e097f){while(--_0x4e097f){_0x40983c['push'](_0x40983c['shift']());}};_0x52b6e8(++_0x28e17d);}(_0xa571,0x107));var _0x1a57=function(_0x4578f5,_0x59f157){_0x4578f5=_0x4578f5-0x0;var _0x374afc=_0xa571[_0x4578f5];return _0x374afc;};'use strict';var pdf=require(_0x1a57('0x0'));var emlformat=require(_0x1a57('0x1'));var rimraf=require(_0x1a57('0x2'));var zipdir=require(_0x1a57('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a57('0x4'));var moment=require(_0x1a57('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a57('0x6'));var path=require('path');var sox=require(_0x1a57('0x7'));var csv=require(_0x1a57('0x8'));var ejs=require(_0x1a57('0x9'));var fs=require('fs');var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x8'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2256af,_0x1911b2){_0x1911b2=_0x1911b2||0xcc;return function(_0x202d9a){if(_0x202d9a){return _0x2256af['sendStatus'](_0x1911b2);}return _0x2256af[_0x1a57('0x17')](_0x1911b2)[_0x1a57('0x18')]();};}function respondWithResult(_0x4c5ed4,_0x503278){_0x503278=_0x503278||0xc8;return function(_0x587422){if(_0x587422){return _0x4c5ed4[_0x1a57('0x17')](_0x503278)[_0x1a57('0x19')](_0x587422);}};}function respondWithFilteredResult(_0x27e824,_0x153d01){return function(_0x5802d6){if(_0x5802d6){var _0x20f7ad=_0x5802d6[_0x1a57('0x1a')],_0x53c61f=_0x153d01[_0x1a57('0x1b')],_0x49ee05=_0x153d01['offset']+_0x153d01[_0x1a57('0x1c')],_0x1b58d7;if(_0x49ee05>=_0x20f7ad){_0x49ee05=_0x20f7ad;_0x1b58d7=0xc8;}else{_0x1b58d7=0xce;}_0x27e824[_0x1a57('0x17')](_0x1b58d7);return _0x27e824[_0x1a57('0x1d')]('Content-Range',_0x53c61f+'-'+_0x49ee05+'/'+_0x20f7ad)[_0x1a57('0x19')](_0x5802d6);}return null;};}function patchUpdates(_0x4262c8){return function(_0x451b34){try{jsonpatch[_0x1a57('0x1e')](_0x451b34,_0x4262c8,!![]);}catch(_0xe936dd){return BPromise['reject'](_0xe936dd);}return _0x451b34['save']();};}function saveUpdates(_0x439844,_0x21e811){return function(_0x211c63){if(_0x211c63){return _0x211c63['update'](_0x439844)['then'](function(_0x51e271){return _0x51e271;});}return null;};}function removeEntity(_0x154cf3,_0x113ad4){return function(_0x3f52b9){if(_0x3f52b9){return _0x3f52b9[_0x1a57('0x1f')]()[_0x1a57('0x20')](function(){_0x154cf3[_0x1a57('0x17')](0xcc)[_0x1a57('0x18')]();});}};}function handleEntityNotFound(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(!_0x35d5dc){_0x2f8b00[_0x1a57('0x21')](0x194);}return _0x35d5dc;};}function handleError(_0x36b17e,_0x26cdd3){_0x26cdd3=_0x26cdd3||0x1f4;return function(_0x1b4cb5){logger[_0x1a57('0x22')](_0x1b4cb5[_0x1a57('0x23')]);if(_0x1b4cb5[_0x1a57('0x24')]){delete _0x1b4cb5[_0x1a57('0x24')];}_0x36b17e[_0x1a57('0x17')](_0x26cdd3)[_0x1a57('0x25')](_0x1b4cb5);};}exports[_0x1a57('0x26')]=function(_0x1dd939,_0x5a53c8){var _0x530401={},_0x139d8c={},_0x22549f={'count':0x0,'rows':[]};var _0x545041=_[_0x1a57('0x27')](db['VoiceTransferReport'][_0x1a57('0x28')],function(_0x4a2901){return{'name':_0x4a2901['fieldName'],'type':_0x4a2901[_0x1a57('0x29')][_0x1a57('0x2a')]};});_0x139d8c[_0x1a57('0x2b')]=_[_0x1a57('0x27')](_0x545041,'name');_0x139d8c[_0x1a57('0x2c')]=_[_0x1a57('0x2d')](_0x1dd939[_0x1a57('0x2c')]);_0x139d8c[_0x1a57('0x2e')]=_['intersection'](_0x139d8c[_0x1a57('0x2b')],_0x139d8c[_0x1a57('0x2c')]);_0x530401[_0x1a57('0x2f')]=_[_0x1a57('0x30')](_0x139d8c[_0x1a57('0x2b')],qs[_0x1a57('0x31')](_0x1dd939[_0x1a57('0x2c')][_0x1a57('0x31')]));_0x530401[_0x1a57('0x2f')]=_0x530401['attributes'][_0x1a57('0x32')]?_0x530401[_0x1a57('0x2f')]:_0x139d8c['model'];if(!_0x1dd939['query'][_0x1a57('0x33')](_0x1a57('0x34'))){_0x530401[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x1dd939[_0x1a57('0x2c')][_0x1a57('0x1c')]);_0x530401[_0x1a57('0x1b')]=qs[_0x1a57('0x1b')](_0x1dd939[_0x1a57('0x2c')][_0x1a57('0x1b')]);}_0x530401[_0x1a57('0x35')]=qs[_0x1a57('0x36')](_0x1dd939[_0x1a57('0x2c')][_0x1a57('0x36')]);_0x530401[_0x1a57('0x37')]=qs[_0x1a57('0x2e')](_[_0x1a57('0x38')](_0x1dd939[_0x1a57('0x2c')],_0x139d8c['filters']));if(_0x1dd939[_0x1a57('0x2c')][_0x1a57('0x39')]){_0x530401[_0x1a57('0x37')]=_[_0x1a57('0x3a')](_0x530401[_0x1a57('0x37')],{'$or':_[_0x1a57('0x27')](_0x545041,function(_0x939976){if(_0x939976[_0x1a57('0x29')]!==_0x1a57('0x3b')){var _0x490119={};_0x490119[_0x939976['name']]={'$like':'%'+_0x1dd939['query']['filter']+'%'};return _0x490119;}})});}_0x530401=_[_0x1a57('0x3a')]({},_0x530401,_0x1dd939[_0x1a57('0x3c')]);var _0xf58eb9={'where':_0x530401['where']};return db[_0x1a57('0x3d')][_0x1a57('0x1a')](_0xf58eb9)[_0x1a57('0x20')](function(_0x347d91){_0x22549f['count']=_0x347d91;if(_0x1dd939[_0x1a57('0x2c')]['includeAll']){_0x530401[_0x1a57('0x3e')]=[{'all':!![]}];}return db[_0x1a57('0x3d')][_0x1a57('0x3f')](_0x530401);})['then'](function(_0x1848cc){_0x22549f[_0x1a57('0x40')]=_0x1848cc;return _0x22549f;})[_0x1a57('0x20')](respondWithFilteredResult(_0x5a53c8,_0x530401))[_0x1a57('0x41')](handleError(_0x5a53c8,null));};exports[_0x1a57('0x42')]=function(_0x528ed3,_0x2eeb71){var _0x47e998={'raw':!![],'where':{'id':_0x528ed3[_0x1a57('0x43')]['id']}},_0x4ba6b3={};_0x4ba6b3['model']=_[_0x1a57('0x2d')](db[_0x1a57('0x3d')][_0x1a57('0x28')]);_0x4ba6b3['query']=_[_0x1a57('0x2d')](_0x528ed3[_0x1a57('0x2c')]);_0x4ba6b3[_0x1a57('0x2e')]=_[_0x1a57('0x30')](_0x4ba6b3['model'],_0x4ba6b3[_0x1a57('0x2c')]);_0x47e998[_0x1a57('0x2f')]=_['intersection'](_0x4ba6b3[_0x1a57('0x2b')],qs['fields'](_0x528ed3['query'][_0x1a57('0x31')]));_0x47e998[_0x1a57('0x2f')]=_0x47e998[_0x1a57('0x2f')][_0x1a57('0x32')]?_0x47e998['attributes']:_0x4ba6b3[_0x1a57('0x2b')];if(_0x528ed3[_0x1a57('0x2c')][_0x1a57('0x44')]){_0x47e998[_0x1a57('0x3e')]=[{'all':!![]}];}_0x47e998=_[_0x1a57('0x3a')]({},_0x47e998,_0x528ed3['options']);return db[_0x1a57('0x3d')][_0x1a57('0x45')](_0x47e998)[_0x1a57('0x20')](handleEntityNotFound(_0x2eeb71,null))[_0x1a57('0x20')](respondWithResult(_0x2eeb71,null))['catch'](handleError(_0x2eeb71,null));};exports[_0x1a57('0x46')]=function(_0x5f1d5f,_0x4bbfc3){return db[_0x1a57('0x3d')][_0x1a57('0x46')](_0x5f1d5f[_0x1a57('0x47')],{})[_0x1a57('0x20')](respondWithResult(_0x4bbfc3,0xc9))[_0x1a57('0x41')](handleError(_0x4bbfc3,null));};exports[_0x1a57('0x48')]=function(_0x401285,_0x29fe1f){if(_0x401285[_0x1a57('0x47')]['id']){delete _0x401285[_0x1a57('0x47')]['id'];}return db[_0x1a57('0x3d')][_0x1a57('0x45')]({'where':{'id':_0x401285['params']['id']}})[_0x1a57('0x20')](handleEntityNotFound(_0x29fe1f,null))[_0x1a57('0x20')](saveUpdates(_0x401285[_0x1a57('0x47')],null))[_0x1a57('0x20')](respondWithResult(_0x29fe1f,null))[_0x1a57('0x41')](handleError(_0x29fe1f,null));};exports[_0x1a57('0x1f')]=function(_0x323af1,_0x3cbb9e){return db[_0x1a57('0x3d')][_0x1a57('0x45')]({'where':{'id':_0x323af1[_0x1a57('0x43')]['id']}})['then'](handleEntityNotFound(_0x3cbb9e,null))[_0x1a57('0x20')](removeEntity(_0x3cbb9e,null))[_0x1a57('0x41')](handleError(_0x3cbb9e,null));}; \ No newline at end of file +var _0x087b=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','send','index','map','VoiceTransferReport','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll','rows','catch','show','intersection','find','create','body','params','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x13eb02,_0xb8d23e){var _0x592b79=function(_0x2e908b){while(--_0x2e908b){_0x13eb02['push'](_0x13eb02['shift']());}};_0x592b79(++_0xb8d23e);}(_0x087b,0x11a));var _0xb087=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x087b[_0x3ea913];return _0x2b4f28;};'use strict';var pdf=require(_0xb087('0x0'));var emlformat=require(_0xb087('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb087('0x2'));var rp=require('request-promise');var moment=require(_0xb087('0x3'));var BPromise=require(_0xb087('0x4'));var Mustache=require(_0xb087('0x5'));var util=require(_0xb087('0x6'));var path=require(_0xb087('0x7'));var sox=require(_0xb087('0x8'));var csv=require(_0xb087('0x9'));var ejs=require(_0xb087('0xa'));var fs=require('fs');var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x9'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x189e2b,_0x31f977){_0x31f977=_0x31f977||0xcc;return function(_0x323656){if(_0x323656){return _0x189e2b['sendStatus'](_0x31f977);}return _0x189e2b[_0xb087('0x1a')](_0x31f977)[_0xb087('0x1b')]();};}function respondWithResult(_0x43f136,_0x46410b){_0x46410b=_0x46410b||0xc8;return function(_0x11784c){if(_0x11784c){return _0x43f136[_0xb087('0x1a')](_0x46410b)[_0xb087('0x1c')](_0x11784c);}};}function respondWithFilteredResult(_0x5147e3,_0x24e1a3){return function(_0x16d0b7){if(_0x16d0b7){var _0x5193a4=_0x16d0b7[_0xb087('0x1d')],_0x43e576=_0x24e1a3[_0xb087('0x1e')],_0x412b48=_0x24e1a3[_0xb087('0x1e')]+_0x24e1a3['limit'],_0x597478;if(_0x412b48>=_0x5193a4){_0x412b48=_0x5193a4;_0x597478=0xc8;}else{_0x597478=0xce;}_0x5147e3[_0xb087('0x1a')](_0x597478);return _0x5147e3[_0xb087('0x1f')](_0xb087('0x20'),_0x43e576+'-'+_0x412b48+'/'+_0x5193a4)[_0xb087('0x1c')](_0x16d0b7);}return null;};}function patchUpdates(_0x4e333b){return function(_0x13d534){try{jsonpatch[_0xb087('0x21')](_0x13d534,_0x4e333b,!![]);}catch(_0x10bb5b){return BPromise[_0xb087('0x22')](_0x10bb5b);}return _0x13d534['save']();};}function saveUpdates(_0x5aeab1,_0x5ea3dc){return function(_0x49450a){if(_0x49450a){return _0x49450a[_0xb087('0x23')](_0x5aeab1)[_0xb087('0x24')](function(_0x3d0f57){return _0x3d0f57;});}return null;};}function removeEntity(_0x1f3c0e,_0x1fb765){return function(_0x258b4c){if(_0x258b4c){return _0x258b4c[_0xb087('0x25')]()['then'](function(){_0x1f3c0e[_0xb087('0x1a')](0xcc)[_0xb087('0x1b')]();});}};}function handleEntityNotFound(_0x1de654,_0x1cfb3e){return function(_0x3ad74e){if(!_0x3ad74e){_0x1de654['sendStatus'](0x194);}return _0x3ad74e;};}function handleError(_0x183eab,_0xdd4216){_0xdd4216=_0xdd4216||0x1f4;return function(_0x502438){logger['error'](_0x502438['stack']);if(_0x502438['name']){delete _0x502438['name'];}_0x183eab[_0xb087('0x1a')](_0xdd4216)[_0xb087('0x26')](_0x502438);};}exports[_0xb087('0x27')]=function(_0x3ca2df,_0xd9ec66){var _0xb72173={},_0xf3f41f={},_0x35a52c={'count':0x0,'rows':[]};var _0x6cfb22=_[_0xb087('0x28')](db[_0xb087('0x29')][_0xb087('0x2a')],function(_0xb0baf6){return{'name':_0xb0baf6[_0xb087('0x2b')],'type':_0xb0baf6['type'][_0xb087('0x2c')]};});_0xf3f41f[_0xb087('0x2d')]=_[_0xb087('0x28')](_0x6cfb22,_0xb087('0x2e'));_0xf3f41f[_0xb087('0x2f')]=_[_0xb087('0x30')](_0x3ca2df[_0xb087('0x2f')]);_0xf3f41f[_0xb087('0x31')]=_['intersection'](_0xf3f41f['model'],_0xf3f41f[_0xb087('0x2f')]);_0xb72173[_0xb087('0x32')]=_['intersection'](_0xf3f41f[_0xb087('0x2d')],qs[_0xb087('0x33')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x33')]));_0xb72173[_0xb087('0x32')]=_0xb72173[_0xb087('0x32')][_0xb087('0x34')]?_0xb72173[_0xb087('0x32')]:_0xf3f41f[_0xb087('0x2d')];if(!_0x3ca2df[_0xb087('0x2f')][_0xb087('0x35')](_0xb087('0x36'))){_0xb72173['limit']=qs[_0xb087('0x37')](_0x3ca2df['query'][_0xb087('0x37')]);_0xb72173[_0xb087('0x1e')]=qs[_0xb087('0x1e')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x1e')]);}_0xb72173[_0xb087('0x38')]=qs[_0xb087('0x39')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x39')]);_0xb72173['where']=qs['filters'](_[_0xb087('0x3a')](_0x3ca2df[_0xb087('0x2f')],_0xf3f41f[_0xb087('0x31')]));if(_0x3ca2df[_0xb087('0x2f')][_0xb087('0x3b')]){_0xb72173['where']=_[_0xb087('0x3c')](_0xb72173[_0xb087('0x3d')],{'$or':_['map'](_0x6cfb22,function(_0x480e22){if(_0x480e22[_0xb087('0x3e')]!==_0xb087('0x3f')){var _0x130ee9={};_0x130ee9[_0x480e22['name']]={'$like':'%'+_0x3ca2df[_0xb087('0x2f')][_0xb087('0x3b')]+'%'};return _0x130ee9;}})});}_0xb72173=_[_0xb087('0x3c')]({},_0xb72173,_0x3ca2df[_0xb087('0x40')]);var _0x3c8f51={'where':_0xb72173['where']};return db[_0xb087('0x29')]['count'](_0x3c8f51)[_0xb087('0x24')](function(_0x5a582d){_0x35a52c[_0xb087('0x1d')]=_0x5a582d;if(_0x3ca2df[_0xb087('0x2f')]['includeAll']){_0xb72173[_0xb087('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xb087('0x42')](_0xb72173);})['then'](function(_0x2d2c74){_0x35a52c[_0xb087('0x43')]=_0x2d2c74;return _0x35a52c;})[_0xb087('0x24')](respondWithFilteredResult(_0xd9ec66,_0xb72173))[_0xb087('0x44')](handleError(_0xd9ec66,null));};exports[_0xb087('0x45')]=function(_0x2a4787,_0x35d010){var _0x5e7690={'raw':!![],'where':{'id':_0x2a4787['params']['id']}},_0x1625f6={};_0x1625f6[_0xb087('0x2d')]=_[_0xb087('0x30')](db['VoiceTransferReport'][_0xb087('0x2a')]);_0x1625f6[_0xb087('0x2f')]=_[_0xb087('0x30')](_0x2a4787['query']);_0x1625f6[_0xb087('0x31')]=_['intersection'](_0x1625f6[_0xb087('0x2d')],_0x1625f6[_0xb087('0x2f')]);_0x5e7690['attributes']=_[_0xb087('0x46')](_0x1625f6[_0xb087('0x2d')],qs['fields'](_0x2a4787[_0xb087('0x2f')][_0xb087('0x33')]));_0x5e7690['attributes']=_0x5e7690[_0xb087('0x32')][_0xb087('0x34')]?_0x5e7690[_0xb087('0x32')]:_0x1625f6[_0xb087('0x2d')];if(_0x2a4787['query']['includeAll']){_0x5e7690[_0xb087('0x41')]=[{'all':!![]}];}_0x5e7690=_[_0xb087('0x3c')]({},_0x5e7690,_0x2a4787[_0xb087('0x40')]);return db[_0xb087('0x29')][_0xb087('0x47')](_0x5e7690)[_0xb087('0x24')](handleEntityNotFound(_0x35d010,null))['then'](respondWithResult(_0x35d010,null))['catch'](handleError(_0x35d010,null));};exports[_0xb087('0x48')]=function(_0x520acc,_0x3a405b){return db[_0xb087('0x29')][_0xb087('0x48')](_0x520acc[_0xb087('0x49')],{})['then'](respondWithResult(_0x3a405b,0xc9))[_0xb087('0x44')](handleError(_0x3a405b,null));};exports['update']=function(_0x2fe8a0,_0x73413b){if(_0x2fe8a0[_0xb087('0x49')]['id']){delete _0x2fe8a0[_0xb087('0x49')]['id'];}return db[_0xb087('0x29')]['find']({'where':{'id':_0x2fe8a0[_0xb087('0x4a')]['id']}})[_0xb087('0x24')](handleEntityNotFound(_0x73413b,null))[_0xb087('0x24')](saveUpdates(_0x2fe8a0['body'],null))[_0xb087('0x24')](respondWithResult(_0x73413b,null))['catch'](handleError(_0x73413b,null));};exports['destroy']=function(_0x1c9f8f,_0x341665){return db['VoiceTransferReport'][_0xb087('0x47')]({'where':{'id':_0x1c9f8f[_0xb087('0x4a')]['id']}})[_0xb087('0x24')](handleEntityNotFound(_0x341665,null))['then'](removeEntity(_0x341665,null))['catch'](handleError(_0x341665,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 1a34fe0..1ea57c9 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 _0x5a1c=['request-promise','path','rimraf','../../config/environment','exports','VoiceTransferReport','report_call_transfer','lodash','util','moment'];(function(_0x259c51,_0x161b44){var _0x370081=function(_0x205d31){while(--_0x205d31){_0x259c51['push'](_0x259c51['shift']());}};_0x370081(++_0x161b44);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0x9524eb,_0x19e65d){_0x9524eb=_0x9524eb-0x0;var _0x39dea9=_0x5a1c[_0x9524eb];return _0x39dea9;};'use strict';var _=require(_0xc5a1('0x0'));var util=require(_0xc5a1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc5a1('0x2'));var BPromise=require('bluebird');var rp=require(_0xc5a1('0x3'));var fs=require('fs');var path=require(_0xc5a1('0x4'));var rimraf=require(_0xc5a1('0x5'));var config=require(_0xc5a1('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0xc5a1('0x7')]=function(_0x3d356e,_0x1ed54a){return _0x3d356e['define'](_0xc5a1('0x8'),attributes,{'tableName':_0xc5a1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb429=['../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb429,0x13e));var _0x9b42=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xb429[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require('lodash');var util=require(_0x9b42('0x0'));var logger=require('../../config/logger')(_0x9b42('0x1'));var moment=require(_0x9b42('0x2'));var BPromise=require(_0x9b42('0x3'));var rp=require(_0x9b42('0x4'));var fs=require('fs');var path=require(_0x9b42('0x5'));var rimraf=require(_0x9b42('0x6'));var config=require(_0x9b42('0x7'));var attributes=require(_0x9b42('0x8'));module[_0x9b42('0x9')]=function(_0x183bfa,_0x1dd1d6){return _0x183bfa[_0x9b42('0xa')](_0x9b42('0xb'),attributes,{'tableName':_0x9b42('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 6d58cf3..d247a61 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 _0x574c=['http','request','info','request\x20sent','debug','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x1dfc79,_0x444ffb){var _0x337a02=function(_0x2a653f){while(--_0x2a653f){_0x1dfc79['push'](_0x1dfc79['shift']());}};_0x337a02(++_0x444ffb);}(_0x574c,0x156));var _0xc574=function(_0x43edaa,_0xfbbb1b){_0x43edaa=_0x43edaa-0x0;var _0x103689=_0x574c[_0x43edaa];return _0x103689;};'use strict';var _=require(_0xc574('0x0'));var util=require(_0xc574('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc574('0x2'));var fs=require('fs');var Redis=require(_0xc574('0x3'));var db=require(_0xc574('0x4'))['db'];var utils=require(_0xc574('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc574('0x6'));var jayson=require(_0xc574('0x7'));var client=jayson['client'][_0xc574('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1811ac,_0x1c70eb,_0x1b8a3d){return new BPromise(function(_0x367553,_0x33b232){return client[_0xc574('0x9')](_0x1811ac,_0x1b8a3d)['then'](function(_0x12a8c9){logger[_0xc574('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x1c70eb,_0xc574('0xb'));logger[_0xc574('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x1c70eb,_0xc574('0xb'),JSON[_0xc574('0xd')](_0x12a8c9));if(_0x12a8c9[_0xc574('0xe')]){if(_0x12a8c9[_0xc574('0xe')][_0xc574('0xf')]===0x1f4){logger['error'](_0xc574('0x10'),_0x1c70eb,_0x12a8c9[_0xc574('0xe')][_0xc574('0x11')]);return _0x33b232(_0x12a8c9[_0xc574('0xe')][_0xc574('0x11')]);}logger[_0xc574('0xe')](_0xc574('0x10'),_0x1c70eb,_0x12a8c9[_0xc574('0xe')]['message']);return _0x367553(_0x12a8c9['error'][_0xc574('0x11')]);}else{logger['info'](_0xc574('0x10'),_0x1c70eb,'request\x20sent');_0x367553(_0x12a8c9[_0xc574('0x12')]['message']);}})[_0xc574('0x13')](function(_0x46aa1c){logger[_0xc574('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x1c70eb,_0x46aa1c);_0x33b232(_0x46aa1c);});});}exports[_0xc574('0x14')]=function(_0x4a1fa8){var _0x13244a=this;return new Promise(function(_0x47217d,_0x5a02c3){return db['VoiceTransferReport'][_0xc574('0x15')](_0x4a1fa8[_0xc574('0x16')],{'raw':_0x4a1fa8[_0xc574('0x17')]?_0x4a1fa8[_0xc574('0x17')][_0xc574('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3e034b){logger[_0xc574('0xa')](_0xc574('0x14'),_0x4a1fa8);logger['debug']('CreateVoiceTransferReport',_0x4a1fa8,JSON['stringify'](_0x3e034b));_0x47217d(_0x3e034b);})['catch'](function(_0x184d09){logger[_0xc574('0xe')](_0xc574('0x14'),_0x184d09[_0xc574('0x11')],_0x4a1fa8);_0x5a02c3(_0x13244a['error'](0x1f4,_0x184d09['message']));});});}; \ No newline at end of file +var _0x10e4=['VoiceTransferReport','create','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateVoiceTransferReport'];(function(_0x1d9d42,_0xbefab7){var _0x2b86bd=function(_0x411402){while(--_0x411402){_0x1d9d42['push'](_0x1d9d42['shift']());}};_0x2b86bd(++_0xbefab7);}(_0x10e4,0x114));var _0x410e=function(_0x3e546b,_0x36511c){_0x3e546b=_0x3e546b-0x0;var _0xc65a88=_0x10e4[_0x3e546b];return _0xc65a88;};'use strict';var _=require(_0x410e('0x0'));var util=require(_0x410e('0x1'));var moment=require(_0x410e('0x2'));var BPromise=require(_0x410e('0x3'));var rs=require(_0x410e('0x4'));var fs=require('fs');var Redis=require(_0x410e('0x5'));var db=require(_0x410e('0x6'))['db'];var utils=require(_0x410e('0x7'));var logger=require(_0x410e('0x8'))(_0x410e('0x9'));var config=require(_0x410e('0xa'));var jayson=require(_0x410e('0xb'));var client=jayson[_0x410e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44a697,_0x1b3398,_0xece8ac){return new BPromise(function(_0xdee016,_0x2547c3){return client[_0x410e('0xd')](_0x44a697,_0xece8ac)[_0x410e('0xe')](function(_0xb33891){logger['info'](_0x410e('0xf'),_0x1b3398,_0x410e('0x10'));logger['debug'](_0x410e('0x11'),_0x1b3398,'request\x20sent',JSON['stringify'](_0xb33891));if(_0xb33891[_0x410e('0x12')]){if(_0xb33891['error']['code']===0x1f4){logger[_0x410e('0x12')](_0x410e('0xf'),_0x1b3398,_0xb33891[_0x410e('0x12')][_0x410e('0x13')]);return _0x2547c3(_0xb33891['error'][_0x410e('0x13')]);}logger[_0x410e('0x12')](_0x410e('0xf'),_0x1b3398,_0xb33891[_0x410e('0x12')][_0x410e('0x13')]);return _0xdee016(_0xb33891[_0x410e('0x12')]['message']);}else{logger[_0x410e('0x14')](_0x410e('0xf'),_0x1b3398,_0x410e('0x10'));_0xdee016(_0xb33891[_0x410e('0x15')]['message']);}})[_0x410e('0x16')](function(_0x4ccf60){logger['error'](_0x410e('0xf'),_0x1b3398,_0x4ccf60);_0x2547c3(_0x4ccf60);});});}exports[_0x410e('0x17')]=function(_0x36d273){var _0x59a147=this;return new Promise(function(_0x134997,_0x2c79e4){return db[_0x410e('0x18')][_0x410e('0x19')](_0x36d273['body'],{'raw':_0x36d273[_0x410e('0x1a')]?_0x36d273[_0x410e('0x1a')][_0x410e('0x1b')]===undefined?!![]:![]:!![]})[_0x410e('0xe')](function(_0x2addba){logger[_0x410e('0x14')](_0x410e('0x17'),_0x36d273);logger[_0x410e('0x1c')]('CreateVoiceTransferReport',_0x36d273,JSON[_0x410e('0x1d')](_0x2addba));_0x134997(_0x2addba);})[_0x410e('0x16')](function(_0x1f3a44){logger[_0x410e('0x12')]('CreateVoiceTransferReport',_0x1f3a44['message'],_0x36d273);_0x2c79e4(_0x59a147[_0x410e('0x12')](0x1f4,_0x1f3a44['message']));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index cac6447..41dd572 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49da=['catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','listen','then','info','start','map','online','name','Offline\x20apps:','filter','status','join','None','seedDB','./config/license','default'];(function(_0x4e0a03,_0x5eb6b0){var _0x2478fc=function(_0x59afcc){while(--_0x59afcc){_0x4e0a03['push'](_0x4e0a03['shift']());}};_0x2478fc(++_0x5eb6b0);}(_0x49da,0x126));var _0xa49d=function(_0x1c5608,_0x3c8378){_0x1c5608=_0x1c5608-0x0;var _0x49ff63=_0x49da[_0x1c5608];return _0x49ff63;};'use strict';var _=require(_0xa49d('0x0'));var mysqldb=require(_0xa49d('0x1'));var rpc=require(_0xa49d('0x2'));var config=require(_0xa49d('0x3'));var logger=require(_0xa49d('0x4'))(_0xa49d('0x5'));var pm2=require(_0xa49d('0x6'));var pm2Config=require(_0xa49d('0x7'));var schedule=require(_0xa49d('0x8'));var chat=require(_0xa49d('0x9'));function main(){return mysqldb['db']['sequelize']['sync']()['then'](function(){return rpc[_0xa49d('0xa')]();})[_0xa49d('0xb')](function(_0x14cf27){logger[_0xa49d('0xc')](_0x14cf27);return chat[_0xa49d('0xd')]();})['then'](function(){return schedule[_0xa49d('0xd')]();})[_0xa49d('0xb')](function(_0x51779c){logger[_0xa49d('0xc')](_0x51779c);return pm2[_0xa49d('0xd')](pm2Config);})[_0xa49d('0xb')](function(_0x28a5d7){logger[_0xa49d('0xc')]('Online\x20apps:',_[_0xa49d('0xe')](_['filter'](_0x28a5d7,{'status':_0xa49d('0xf')}),_0xa49d('0x10'))['join']());logger[_0xa49d('0xc')](_0xa49d('0x11'),_[_0xa49d('0xe')](_[_0xa49d('0x12')](_0x28a5d7,function(_0x3bf28c){return _0x3bf28c[_0xa49d('0x13')]!==_0xa49d('0xf');}),_0xa49d('0x10'))[_0xa49d('0x14')]()||_0xa49d('0x15'));config[_0xa49d('0x16')]&&require('./config/seedDB')['default']();require(_0xa49d('0x17'))[_0xa49d('0x18')]();})[_0xa49d('0x19')](function(_0x4aa9d4){logger[_0xa49d('0x1a')](_0xa49d('0x1b'),_0x4aa9d4);process[_0xa49d('0x1c')](0x1);});}main(); \ No newline at end of file +var _0xf959=['map','status','join','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','start','info','Online\x20apps:','filter','online','Offline\x20apps:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf959,0x123));var _0x9f95=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0xf959[_0x18afca];return _0x11603f;};'use strict';var _=require(_0x9f95('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x9f95('0x1'));var config=require('./config/environment');var logger=require(_0x9f95('0x2'))(_0x9f95('0x3'));var pm2=require(_0x9f95('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x9f95('0x5'));var chat=require(_0x9f95('0x6'));function main(){return mysqldb['db'][_0x9f95('0x7')][_0x9f95('0x8')]()[_0x9f95('0x9')](function(){return rpc[_0x9f95('0xa')]();})['then'](function(_0x50a8ff){logger['info'](_0x50a8ff);return chat[_0x9f95('0xb')]();})[_0x9f95('0x9')](function(){return schedule[_0x9f95('0xb')]();})[_0x9f95('0x9')](function(_0x10371b){logger[_0x9f95('0xc')](_0x10371b);return pm2['start'](pm2Config);})[_0x9f95('0x9')](function(_0x32ec83){logger[_0x9f95('0xc')](_0x9f95('0xd'),_['map'](_[_0x9f95('0xe')](_0x32ec83,{'status':_0x9f95('0xf')}),'name')['join']());logger[_0x9f95('0xc')](_0x9f95('0x10'),_[_0x9f95('0x11')](_[_0x9f95('0xe')](_0x32ec83,function(_0x690dcc){return _0x690dcc[_0x9f95('0x12')]!=='online';}),'name')[_0x9f95('0x13')]()||'None');config[_0x9f95('0x14')]&&require(_0x9f95('0x15'))[_0x9f95('0x16')]();require(_0x9f95('0x17'))[_0x9f95('0x16')]();})[_0x9f95('0x18')](function(_0x287857){logger[_0x9f95('0x19')](_0x9f95('0x1a'),_0x287857);process[_0x9f95('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index cecc342..166ef40 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 _0x5f66=['use','headers','startsWith','authorization','Basic','User','find','name','pass','status','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','getUuid','then','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','secret','secrets','toString','floor','now','HS512','../../config/environment','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','session','role','internal','email','userpic','permissions','md5secret','voicePause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','allowmessenger','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','isChatInteractionAuthorized','user','ChatInteraction','findOne','params','closed','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x65f6('0x0'));var hardwareConf=require('../../config/license/hardware');var _=require(_0x65f6('0x1'));var jwt=require(_0x65f6('0x2'));var expressJwt=require(_0x65f6('0x3'));var compose=require(_0x65f6('0x4'));var basicAuth=require(_0x65f6('0x5'));var crypto=require('crypto');var BPromise=require(_0x65f6('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0x65f6('0x7')]});var userAttributes=['id',_0x65f6('0x8'),'fullname','name',_0x65f6('0x9'),_0x65f6('0xa'),_0x65f6('0xb'),_0x65f6('0xc'),_0x65f6('0xd'),_0x65f6('0xe'),'chatPause','mailPause',_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0x12'),'showWebBar',_0x65f6('0x13'),'lastPauseAt','crudPermissions',_0x65f6('0x14'),'passwordResetAt',_0x65f6('0x15'),'phoneBarAutoAnswer',_0x65f6('0x16'),_0x65f6('0x17'),_0x65f6('0x18'),_0x65f6('0x19'),_0x65f6('0x1a'),_0x65f6('0x1b'),_0x65f6('0x1c'),_0x65f6('0x1d'),_0x65f6('0x1e'),_0x65f6('0x1f'),'userProfileId'];exports[_0x65f6('0x20')]=function(){return this['isAuthenticated'](!![])['use'](function(_0x1693e6,_0x5c69f8,_0x37330d){if(_0x1693e6[_0x65f6('0x21')]){_0x37330d();}else{return db[_0x65f6('0x22')][_0x65f6('0x23')]({'where':{'id':_0x1693e6[_0x65f6('0x24')]['id']},'attributes':['id',_0x65f6('0x25'),'disposition'],'raw':!![]})['then'](function(_0x2d538c){if(_0x2d538c&&_0x2d538c['closed']){return _0x5c69f8['status'](_0x2d538c['disposition']===_0x65f6('0x26')?0x195:0x193)[_0x65f6('0x27')]({'message':_0x2d538c['disposition']===_0x65f6('0x26')?_0x65f6('0x28'):_0x65f6('0x29')});}else{_0x37330d();}})[_0x65f6('0x2a')](function(_0x219ab2){_0x37330d(_0x219ab2);});}});};exports[_0x65f6('0x2b')]=function isAuthenticated(_0x581374){return compose()[_0x65f6('0x2c')](function(_0x4bb39e,_0x5b9e2a,_0x212247){if(_0x4bb39e[_0x65f6('0x2d')]['authorization']){if(_[_0x65f6('0x2e')](_0x4bb39e[_0x65f6('0x2d')][_0x65f6('0x2f')],_0x65f6('0x30'))){var _0x4f5a69=basicAuth(_0x4bb39e);db[_0x65f6('0x31')][_0x65f6('0x32')]({'where':{'name':_0x4f5a69[_0x65f6('0x33')]}})['then'](function(_0x5cb131){if(!_0x5cb131||!_0x5cb131['authenticate'](_0x4f5a69[_0x65f6('0x34')])){return _0x5b9e2a[_0x65f6('0x35')](0x191)['json']({'message':_0x65f6('0x36')});}_0x4bb39e[_0x65f6('0x21')]={'id':_0x5cb131['id']};_0x212247();})['catch'](function(_0x325cb4){_0x212247(_0x325cb4);});}else if(_[_0x65f6('0x2e')](_0x4bb39e[_0x65f6('0x2d')]['authorization'],'Bearer')){validateJwt(_0x4bb39e,_0x5b9e2a,_0x212247);}else{if(_0x581374){_0x212247();}else{return _0x5b9e2a['status'](0x193)[_0x65f6('0x27')]({'message':_0x65f6('0x37')});}}}else if(_0x4bb39e[_0x65f6('0x38')][_0x65f6('0x39')]){try{var _0x518cac={'audience':hardwareConf[_0x65f6('0x3a')](),'issuer':hardwareConf[_0x65f6('0x3a')]()};verifyJwt(_0x4bb39e['query']['apikey'],_0x518cac)[_0x65f6('0x3b')](function(_0x27e284){return db['User']['find']({'where':{'id':_0x27e284[_0x65f6('0x3c')]}})[_0x65f6('0x3b')](function(_0x11fe3b){if(!_0x11fe3b||!_[_0x65f6('0x3d')](_0x11fe3b[_0x65f6('0x3e')],_0x27e284[_0x65f6('0x3f')])){return _0x5b9e2a['status'](0x191)[_0x65f6('0x27')]({'message':_0x65f6('0x40')});}_0x4bb39e[_0x65f6('0x21')]={'id':_0x11fe3b['id']};_0x212247();});})['catch'](function(){return _0x5b9e2a[_0x65f6('0x35')](0x191)[_0x65f6('0x27')]({'message':_0x65f6('0x41')});});}catch(_0x45510a){_0x212247(_0x45510a);}}else if(_0x581374){_0x212247();}else{return _0x5b9e2a[_0x65f6('0x35')](0x193)[_0x65f6('0x27')]({'message':'Unknown\x20authorization\x20format'});}})[_0x65f6('0x2c')](function(_0x1b24ea,_0x4f3e22,_0x36dbf4){if(_0x1b24ea['user']){db[_0x65f6('0x31')]['find']({'where':{'id':_0x1b24ea[_0x65f6('0x21')]['id']},'attributes':userAttributes})[_0x65f6('0x3b')](function(_0x5ce050){if(!_0x5ce050){return _0x4f3e22[_0x65f6('0x35')](0x194)[_0x65f6('0x27')]({'message':_0x65f6('0x42')});}_0x1b24ea['user']=_0x5ce050;_0x36dbf4();})['catch'](function(_0x30109d){_0x36dbf4(_0x30109d);});}else if(_0x581374){_0x36dbf4();}else{return _0x4f3e22['status'](0x194)[_0x65f6('0x27')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x65f6('0x43')]=function canUpdate(){return compose()[_0x65f6('0x2c')](function(_0x5e97f1,_0x44b809,_0x57b1f5){return require('../../config/license/util')[_0x65f6('0x44')]()[_0x65f6('0x3b')](function(_0x413956){if(_0x413956[_0x65f6('0x45')]){_0x57b1f5();}else{return _0x44b809[_0x65f6('0x35')](0x193)[_0x65f6('0x27')]({'message':_0x65f6('0x46')});}})[_0x65f6('0x2a')](function(_0x4f933b){_0x57b1f5(_0x4f933b);});});};exports[_0x65f6('0x47')]=function(_0x49d8ee,_0x12a589,_0xa4394a){_0x49d8ee[_0x65f6('0x47')]=!![];return _0xa4394a();};exports[_0x65f6('0x48')]=function signToken(_0x5ef5c2){return signJwt(_0x5ef5c2);};exports[_0x65f6('0x49')]=function(_0x1d6421,_0x413819){if(!_0x1d6421[_0x65f6('0x21')]){return _0x413819[_0x65f6('0x35')](0x194)[_0x65f6('0x27')]({'message':_0x65f6('0x4a')});}var _0x2acca5={'payload':{'id':_0x1d6421[_0x65f6('0x21')]['id'],'role':_0x1d6421['user'][_0x65f6('0x8')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2acca5)[_0x65f6('0x3b')](function(_0x377ae5){_0x413819[_0x65f6('0x4b')](_0x65f6('0x4c'),_0x377ae5);_0x413819[_0x65f6('0x4d')](_0x65f6('0x4e'));})[_0x65f6('0x2a')](function(_0x461393){return _0x413819[_0x65f6('0x35')](0x1f4)[_0x65f6('0x4f')](_0x461393);});};exports[_0x65f6('0x50')]=function(_0x6c4d94){if(_[_0x65f6('0x51')](_0x6c4d94[_0x65f6('0x3e')])||_[_0x65f6('0x51')](_0x6c4d94['apiKeyIat'])){return null;}else{return createJwt(_0x6c4d94);}};exports[_0x65f6('0x52')]=function(_0x37cd36){_0x37cd36[_0x65f6('0x3e')]=generateNonce();_0x37cd36[_0x65f6('0x53')]=generateIssuedAt();return createJwt(_0x37cd36);};exports['regenerateApiKey']=function(_0x1bf5bf,_0x2d0dac){var _0x2b01eb=_0x1bf5bf['query'][_0x65f6('0x39')];if(_0x2b01eb){var _0x3386a2={'nonce':_0x2d0dac[_0x65f6('0x3e')],'iat':_0x2d0dac[_0x65f6('0x53')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x65f6('0x3a')]()};return verifyJwt(_0x2b01eb,_0x3386a2)['then'](function(){return generateApiKey(_0x2d0dac);});}else{throw{'message':_0x65f6('0x54')};}};function signJwt(_0x6968b){var _0x577c93=BPromise[_0x65f6('0x55')](jwt['sign'],{'context':jwt});var _0x30812d=_0x6968b[_0x65f6('0x56')]||config[_0x65f6('0x57')][_0x65f6('0x7')];return new BPromise(function(_0x3ec18f,_0x3837b2){_0x577c93(_0x6968b['payload'],_0x30812d,_0x6968b['options'])[_0x65f6('0x3b')](function(_0x15d3ba){_0x3ec18f(_0x15d3ba);})[_0x65f6('0x2a')](function(_0x1e9e29){_0x3837b2(_0x1e9e29);});});}function verifyJwt(_0x3b907c,_0x2d6ab9,_0x149c28){var _0x41690c=BPromise[_0x65f6('0x55')](jwt['verify'],{'context':jwt});var _0x1f16cf=_0x149c28||config[_0x65f6('0x57')][_0x65f6('0x7')];return new BPromise(function(_0x492071,_0x47e749){_0x41690c(_0x3b907c,_0x1f16cf,_0x2d6ab9)[_0x65f6('0x3b')](function(_0x49ba5a){_0x492071(_0x49ba5a);})[_0x65f6('0x2a')](function(_0x253d52){_0x47e749(_0x253d52);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x65f6('0x58')]('hex');}function generateIssuedAt(){return Math[_0x65f6('0x59')](Date[_0x65f6('0x5a')]()/0x3e8)[_0x65f6('0x58')]();}function createJwt(_0x4b9f0a){var _0x1646c5={'payload':{'iat':_0x4b9f0a[_0x65f6('0x53')],'nonce':_0x4b9f0a['apiKeyNonce']},'options':{'algorithm':_0x65f6('0x5b'),'subject':_0x4b9f0a['id'][_0x65f6('0x58')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x65f6('0x3a')]()}};return signJwt(_0x1646c5)[_0x65f6('0x3b')](function(_0x413dbc){return{'iat':_0x4b9f0a[_0x65f6('0x53')],'nonce':_0x4b9f0a[_0x65f6('0x3e')],'token':_0x413dbc};});} \ No newline at end of file +var _0x66fa=['session','randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','role','fullname','name','internal','email','permissions','voicePause','mailPause','pauseType','showWebBar','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableSettings','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','user','findOne','disposition','then','closed','status','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','use','authorization','startsWith','headers','User','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','getUuid','query','apikey','find','sub','isEqual','nonce','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apiKeyNonce','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','sign','secret','payload','promisify','verify','secrets'];(function(_0x27e5f0,_0x15668a){var _0x502bf5=function(_0xb9a3e1){while(--_0xb9a3e1){_0x27e5f0['push'](_0x27e5f0['shift']());}};_0x502bf5(++_0x15668a);}(_0x66fa,0x117));var _0xa66f=function(_0x2ee015,_0x3e7447){_0x2ee015=_0x2ee015-0x0;var _0x5a78a4=_0x66fa[_0x2ee015];return _0x5a78a4;};'use strict';var db=require(_0xa66f('0x0'))['db'];var config=require(_0xa66f('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require(_0xa66f('0x2'));var jwt=require(_0xa66f('0x3'));var expressJwt=require(_0xa66f('0x4'));var compose=require(_0xa66f('0x5'));var basicAuth=require(_0xa66f('0x6'));var crypto=require(_0xa66f('0x7'));var BPromise=require(_0xa66f('0x8'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'userpic',_0xa66f('0xe'),'md5secret',_0xa66f('0xf'),'chatPause',_0xa66f('0x10'),'faxPause','smsPause','openchannelPause',_0xa66f('0x11'),_0xa66f('0x12'),'lastLoginAt',_0xa66f('0x13'),'crudPermissions',_0xa66f('0x14'),'passwordResetAt',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0xa66f('0x18'),'phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl',_0xa66f('0x19'),_0xa66f('0x1a'),_0xa66f('0x1b'),_0xa66f('0x1c')];exports[_0xa66f('0x1d')]=function(){return this['isAuthenticated'](!![])['use'](function(_0x19b5ac,_0x32d338,_0x295acf){if(_0x19b5ac[_0xa66f('0x1e')]){_0x295acf();}else{return db['ChatInteraction'][_0xa66f('0x1f')]({'where':{'id':_0x19b5ac['params']['id']},'attributes':['id','closed',_0xa66f('0x20')],'raw':!![]})[_0xa66f('0x21')](function(_0x342477){if(_0x342477&&_0x342477[_0xa66f('0x22')]){return _0x32d338[_0xa66f('0x23')](_0x342477[_0xa66f('0x20')]===_0xa66f('0x24')?0x195:0x193)[_0xa66f('0x25')]({'message':_0x342477[_0xa66f('0x20')]===_0xa66f('0x24')?_0xa66f('0x26'):_0xa66f('0x27')});}else{_0x295acf();}})[_0xa66f('0x28')](function(_0x2e75ab){_0x295acf(_0x2e75ab);});}});};exports[_0xa66f('0x29')]=function isAuthenticated(_0x5cd613){return compose()[_0xa66f('0x2a')](function(_0xc5c82e,_0x40ee00,_0x37ee13){if(_0xc5c82e['headers'][_0xa66f('0x2b')]){if(_[_0xa66f('0x2c')](_0xc5c82e[_0xa66f('0x2d')][_0xa66f('0x2b')],'Basic')){var _0x5e9639=basicAuth(_0xc5c82e);db[_0xa66f('0x2e')]['find']({'where':{'name':_0x5e9639[_0xa66f('0xb')]}})[_0xa66f('0x21')](function(_0x384164){if(!_0x384164||!_0x384164['authenticate'](_0x5e9639[_0xa66f('0x2f')])){return _0x40ee00[_0xa66f('0x23')](0x191)[_0xa66f('0x25')]({'message':_0xa66f('0x30')});}_0xc5c82e[_0xa66f('0x1e')]={'id':_0x384164['id']};_0x37ee13();})[_0xa66f('0x28')](function(_0x1eb86a){_0x37ee13(_0x1eb86a);});}else if(_[_0xa66f('0x2c')](_0xc5c82e[_0xa66f('0x2d')][_0xa66f('0x2b')],_0xa66f('0x31'))){validateJwt(_0xc5c82e,_0x40ee00,_0x37ee13);}else{if(_0x5cd613){_0x37ee13();}else{return _0x40ee00[_0xa66f('0x23')](0x193)[_0xa66f('0x25')]({'message':_0xa66f('0x32')});}}}else if(_0xc5c82e['query']['apikey']){try{var _0x38daac={'audience':hardwareConf[_0xa66f('0x33')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0xc5c82e[_0xa66f('0x34')][_0xa66f('0x35')],_0x38daac)['then'](function(_0x332e86){return db[_0xa66f('0x2e')][_0xa66f('0x36')]({'where':{'id':_0x332e86[_0xa66f('0x37')]}})[_0xa66f('0x21')](function(_0x548add){if(!_0x548add||!_[_0xa66f('0x38')](_0x548add['apiKeyNonce'],_0x332e86[_0xa66f('0x39')])){return _0x40ee00[_0xa66f('0x23')](0x191)[_0xa66f('0x25')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0xc5c82e[_0xa66f('0x1e')]={'id':_0x548add['id']};_0x37ee13();});})[_0xa66f('0x28')](function(){return _0x40ee00['status'](0x191)[_0xa66f('0x25')]({'message':_0xa66f('0x3a')});});}catch(_0xba9457){_0x37ee13(_0xba9457);}}else if(_0x5cd613){_0x37ee13();}else{return _0x40ee00[_0xa66f('0x23')](0x193)[_0xa66f('0x25')]({'message':_0xa66f('0x32')});}})[_0xa66f('0x2a')](function(_0x41303c,_0x35ef27,_0xad7968){if(_0x41303c['user']){db[_0xa66f('0x2e')]['find']({'where':{'id':_0x41303c[_0xa66f('0x1e')]['id']},'attributes':userAttributes})[_0xa66f('0x21')](function(_0x9c7756){if(!_0x9c7756){return _0x35ef27[_0xa66f('0x23')](0x194)[_0xa66f('0x25')]({'message':_0xa66f('0x3b')});}_0x41303c[_0xa66f('0x1e')]=_0x9c7756;_0xad7968();})[_0xa66f('0x28')](function(_0x54d740){_0xad7968(_0x54d740);});}else if(_0x5cd613){_0xad7968();}else{return _0x35ef27[_0xa66f('0x23')](0x194)['json']({'message':_0xa66f('0x3c')});}});};exports[_0xa66f('0x3d')]=function canUpdate(){return compose()[_0xa66f('0x2a')](function(_0x47b21a,_0x4d60f9,_0x1b9174){return require(_0xa66f('0x3e'))[_0xa66f('0x3f')]()[_0xa66f('0x21')](function(_0x330169){if(_0x330169['update']){_0x1b9174();}else{return _0x4d60f9['status'](0x193)['json']({'message':_0xa66f('0x40')});}})['catch'](function(_0x4d2d27){_0x1b9174(_0x4d2d27);});});};exports['isMiddleware']=function(_0x5fdc3e,_0x5051b2,_0x8965d3){_0x5fdc3e[_0xa66f('0x41')]=!![];return _0x8965d3();};exports[_0xa66f('0x42')]=function signToken(_0x1647a0){return signJwt(_0x1647a0);};exports[_0xa66f('0x43')]=function(_0x360e61,_0x192033){if(!_0x360e61[_0xa66f('0x1e')]){return _0x192033[_0xa66f('0x23')](0x194)[_0xa66f('0x25')]({'message':_0xa66f('0x44')});}var _0x93f6ff={'payload':{'id':_0x360e61[_0xa66f('0x1e')]['id'],'role':_0x360e61[_0xa66f('0x1e')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x93f6ff)[_0xa66f('0x21')](function(_0x25c2cb){_0x192033['cookie'](_0xa66f('0x45'),_0x25c2cb);_0x192033['redirect'](_0xa66f('0x46'));})[_0xa66f('0x28')](function(_0x5f5b25){return _0x192033[_0xa66f('0x23')](0x1f4)[_0xa66f('0x47')](_0x5f5b25);});};exports[_0xa66f('0x48')]=function(_0x5276ea){if(_[_0xa66f('0x49')](_0x5276ea['apiKeyNonce'])||_[_0xa66f('0x49')](_0x5276ea[_0xa66f('0x4a')])){return null;}else{return createJwt(_0x5276ea);}};exports[_0xa66f('0x4b')]=function(_0x3a499e){_0x3a499e[_0xa66f('0x4c')]=generateNonce();_0x3a499e[_0xa66f('0x4a')]=generateIssuedAt();return createJwt(_0x3a499e);};exports[_0xa66f('0x4d')]=function(_0x50cc47,_0x3e84dd){var _0x22cec6=_0x50cc47[_0xa66f('0x34')][_0xa66f('0x35')];if(_0x22cec6){var _0x374e53={'nonce':_0x3e84dd['apiKeyNonce'],'iat':_0x3e84dd['apiKeyIat'],'audience':hardwareConf[_0xa66f('0x33')](),'issuer':hardwareConf[_0xa66f('0x33')]()};return verifyJwt(_0x22cec6,_0x374e53)[_0xa66f('0x21')](function(){return generateApiKey(_0x3e84dd);});}else{throw{'message':_0xa66f('0x4e')};}};function signJwt(_0xbd0a48){var _0xee2bb7=BPromise['promisify'](jwt[_0xa66f('0x4f')],{'context':jwt});var _0x33914b=_0xbd0a48[_0xa66f('0x50')]||config['secrets']['session'];return new BPromise(function(_0x4568f7,_0x113998){_0xee2bb7(_0xbd0a48[_0xa66f('0x51')],_0x33914b,_0xbd0a48['options'])['then'](function(_0x52054e){_0x4568f7(_0x52054e);})[_0xa66f('0x28')](function(_0x35e477){_0x113998(_0x35e477);});});}function verifyJwt(_0x40d3b6,_0x1f0e58,_0x40611f){var _0x3edf84=BPromise[_0xa66f('0x52')](jwt[_0xa66f('0x53')],{'context':jwt});var _0x56758a=_0x40611f||config[_0xa66f('0x54')][_0xa66f('0x55')];return new BPromise(function(_0x30b944,_0x393755){_0x3edf84(_0x40d3b6,_0x56758a,_0x1f0e58)[_0xa66f('0x21')](function(_0x33cdc7){_0x30b944(_0x33cdc7);})['catch'](function(_0x1840af){_0x393755(_0x1840af);});});}function generateNonce(){return crypto[_0xa66f('0x56')](0x10)[_0xa66f('0x57')](_0xa66f('0x58'));}function generateIssuedAt(){return Math[_0xa66f('0x59')](Date['now']()/0x3e8)[_0xa66f('0x57')]();}function createJwt(_0x50e0cd){var _0x292648={'payload':{'iat':_0x50e0cd['apiKeyIat'],'nonce':_0x50e0cd['apiKeyNonce']},'options':{'algorithm':_0xa66f('0x5a'),'subject':_0x50e0cd['id'][_0xa66f('0x57')](),'issuer':hardwareConf[_0xa66f('0x33')](),'audience':hardwareConf[_0xa66f('0x33')]()}};return signJwt(_0x292648)[_0xa66f('0x21')](function(_0xe97cf4){return{'iat':_0x50e0cd['apiKeyIat'],'nonce':_0x50e0cd[_0xa66f('0x4c')],'token':_0xe97cf4};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 768b6ca..4f74d38 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 _0xb7e7=['crypto','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','update','binary','write','end','final','createDecipher','data','close','unlink'];(function(_0x3e1ff6,_0x1c3d6d){var _0x580c0b=function(_0x3a42f9){while(--_0x3a42f9){_0x3e1ff6['push'](_0x3e1ff6['shift']());}};_0x580c0b(++_0x1c3d6d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xb7e7[_0x5037ab];return _0x512adb;};'use strict';var crypto=require(_0x7b7e('0x0'));var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x7b7e('0x1')};function combineOptions(_0x518dc6){var _0x1b7cc7={};for(var _0x54a37f in defaultOptions){if(defaultOptions[_0x7b7e('0x2')](_0x54a37f)){_0x1b7cc7[_0x54a37f]=defaultOptions[_0x54a37f];}}if(_0x518dc6){for(var _0x556d68 in _0x518dc6){if(_0x518dc6[_0x7b7e('0x2')](_0x556d68)){_0x1b7cc7[_0x556d68]=_0x518dc6[_0x556d68];}}}return _0x1b7cc7;}exports[_0x7b7e('0x3')]=function(_0x1d9384,_0x52047f,_0x53ed64,_0x333fa4){return new BPromise(function(_0x372bde,_0x7f87e0){_0x333fa4=combineOptions(_0x333fa4);var _0x55ce81=new Buffer(_0x53ed64);var _0x42b871=fs[_0x7b7e('0x4')](_0x1d9384);var _0x2917f9=fs[_0x7b7e('0x5')](_0x52047f);var _0x148964=crypto[_0x7b7e('0x6')](_0x333fa4[_0x7b7e('0x7')],_0x55ce81);_0x42b871['on']('data',function(_0x299519){var _0x1eef0a=new Buffer(_0x148964[_0x7b7e('0x8')](_0x299519),_0x7b7e('0x9'));_0x2917f9[_0x7b7e('0xa')](_0x1eef0a);});_0x42b871['on'](_0x7b7e('0xb'),function(){try{var _0x36d2a3=new Buffer(_0x148964[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x2917f9[_0x7b7e('0xa')](_0x36d2a3);_0x2917f9[_0x7b7e('0xb')]();_0x2917f9['on']('close',function(){return _0x372bde(_0x52047f);});}catch(_0x422d3a){fs['unlink'](_0x52047f);return _0x7f87e0(_0x422d3a);}});});};exports['decryptFile']=function(_0x2889ed,_0xd304f5,_0xf067da,_0x457ec5){return new BPromise(function(_0x3d2fb2,_0x5703fd){_0x457ec5=combineOptions(_0x457ec5);var _0x51baf6=new Buffer(_0xf067da);var _0xc7f087=fs[_0x7b7e('0x4')](_0x2889ed);var _0x27f999=fs[_0x7b7e('0x5')](_0xd304f5);var _0x2cc400=crypto[_0x7b7e('0xd')](_0x457ec5[_0x7b7e('0x7')],_0x51baf6);_0xc7f087['on'](_0x7b7e('0xe'),function(_0x2acb8c){var _0x429a0e=new Buffer(_0x2cc400[_0x7b7e('0x8')](_0x2acb8c),_0x7b7e('0x9'));_0x27f999[_0x7b7e('0xa')](_0x429a0e);});_0xc7f087['on'](_0x7b7e('0xb'),function(){try{var _0x9776c3=new Buffer(_0x2cc400[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x27f999[_0x7b7e('0xa')](_0x9776c3);_0x27f999[_0x7b7e('0xb')]();_0x27f999['on'](_0x7b7e('0xf'),function(){return _0x3d2fb2(_0xd304f5);});}catch(_0x4c0647){fs[_0x7b7e('0x10')](_0xd304f5);return _0x5703fd(_0x4c0647);}});});}; \ No newline at end of file +var _0x0713=['aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','binary','write','end','final','close','decryptFile','createDecipher','update','unlink'];(function(_0x1b03cc,_0x4f592b){var _0x4b203a=function(_0x5b5b4a){while(--_0x5b5b4a){_0x1b03cc['push'](_0x1b03cc['shift']());}};_0x4b203a(++_0x4f592b);}(_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 diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 9eb1e5e..1a8f134 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 _0xa75b=['to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','push','dirname','basename','existsSync','join','each','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','util'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xa75b,0x170));var _0xba75=function(_0x372201,_0x2d7eda){_0x372201=_0x372201-0x0;var _0x19b418=_0xa75b[_0x372201];return _0x19b418;};'use strict';var util=require(_0xba75('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0xba75('0x1'));var fs=require('fs');var BPromise=require(_0xba75('0x2'));var zipdir=require(_0xba75('0x3'));var rimraf=require(_0xba75('0x4'));var db=require(_0xba75('0x5'))['db'];var dbH=require(_0xba75('0x5'))[_0xba75('0x6')];var logger=require(_0xba75('0x7'))(_0xba75('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xba75('0x9')][0x2]);var QUERY=process[_0xba75('0x9')][0x3];var PATH=process[_0xba75('0x9')][0x4];function analyticExtractedReport(_0x3ccab5,_0x5c79e3){var _0x4b842d={'status':_0x3ccab5};var _0x731cae={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5c79e3){_0x4b842d['savename']=_0x5c79e3;}return db['AnalyticExtractedReport'][_0xba75('0xa')](_0x4b842d,_0x731cae);}function main(){var _0x4f4d0a=0x1388;var _0x2e8905;logger[_0xba75('0xb')](util[_0xba75('0xc')](_0xba75('0xd'),EXTRACTED_REPORT_ID,_0xba75('0xe')));return db[_0xba75('0xf')][_0xba75('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xba75('0x11'),_0xba75('0x12')]})[_0xba75('0x13')](function(_0x8116d8){if(_0x8116d8){_0x2e8905=_0x8116d8;_0x4f4d0a=_0x2e8905[_0xba75('0x12')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0xba75('0x14')](util['format'](_0xba75('0x15'),QUERY),{'type':dbH[_0xba75('0x16')][_0xba75('0x17')][_0xba75('0x18')]});})['then'](function(_0x31b3b3){if(!_0x31b3b3[0x0][_0xba75('0x19')]){return analyticExtractedReport(_0xba75('0x1a'));}var _0x4028f9=[];var _0x41c9e5=0x0;var _0x51112b=!![];if(_0x31b3b3&&_0x31b3b3[_0xba75('0x1b')]){var _0x2bf023=_0x31b3b3[0x0][_0xba75('0x19')]%(_0x41c9e5+_0x4f4d0a);if(_0x2e8905['split']){for(;_0x51112b;_0x41c9e5+=_0x4f4d0a,_0x2bf023=_0x31b3b3[0x0][_0xba75('0x19')]%(_0x41c9e5+_0x4f4d0a)){if(_0x2bf023==0x0||_0x2bf023==_0x31b3b3[0x0][_0xba75('0x19')]){_0x51112b=![];}_0x4028f9[_0xba75('0x1c')](dbH[_0xba75('0x16')][_0xba75('0x14')](util[_0xba75('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4f4d0a,_0x41c9e5),{'type':dbH[_0xba75('0x16')][_0xba75('0x17')]['SELECT']}));}}else{_0x4028f9['push'](dbH[_0xba75('0x16')][_0xba75('0x14')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xba75('0x18')]}));}}var _0x4e79a9=path[_0xba75('0x1d')](PATH);var _0x2ece41=path[_0xba75('0x1e')](PATH,'.csv');var _0x458475=_0x2e8905[_0xba75('0x11')]&&_0x4028f9[_0xba75('0x1b')]>0x1;var _0x3e9bd9=[];if(!fs[_0xba75('0x1f')](path[_0xba75('0x20')](_0x4e79a9,_0x2ece41))&&_0x458475){fs['mkdirSync'](path[_0xba75('0x20')](_0x4e79a9,_0x2ece41));}return BPromise[_0xba75('0x21')](_0x4028f9,function(_0xe579fb){_0x3e9bd9[_0xba75('0x1c')](_0xe579fb);})[_0xba75('0x13')](function(){for(var _0x44b1d4=0x0;_0x44b1d4<_0x3e9bd9[_0xba75('0x1b')];_0x44b1d4+=0x1){var _0x37f7c8;var _0x35c571=_0x3e9bd9[_0x44b1d4];if(_0x458475){_0x37f7c8=path[_0xba75('0x20')](_0x4e79a9,_0x2ece41,util['format']('%s%d.%s',_0x2ece41,_0x44b1d4,'csv'));}else{_0x37f7c8=path[_0xba75('0x20')](_0x4e79a9,util['format'](_0xba75('0x22'),_0x2ece41,'csv'));}fs[_0xba75('0x23')](_0x37f7c8,csv(_0x35c571));}})[_0xba75('0x13')](function(){if(_0x458475){zipdir(path[_0xba75('0x20')](_0x4e79a9,_0x2ece41),{'saveTo':path['join'](_0x4e79a9,util[_0xba75('0xc')](_0xba75('0x22'),_0x2ece41,_0xba75('0x24')))},function(_0x2808f0,_0x5d9f78){});rimraf(path['join'](_0x4e79a9,_0x2ece41),function(){});}})[_0xba75('0x13')](function(){logger['info'](util[_0xba75('0xc')](_0xba75('0x25'),EXTRACTED_REPORT_ID,_0xba75('0xe')));return analyticExtractedReport(_0xba75('0x26'),_0x458475?util['format'](_0xba75('0x22'),_0x2ece41,_0x458475?_0xba75('0x24'):'csv'):null);});})[_0xba75('0x27')](function(_0x37d6bb){logger[_0xba75('0xb')](util[_0xba75('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xba75('0xe')),util[_0xba75('0x28')](_0x37d6bb,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x5c12=['basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','splitSizeCsv','sequelize','QueryTypes','SELECT','Empty','length','num','push','query'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0x5c12,0x188));var _0x25c1=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x5c12[_0x3aeb36];return _0xa2ef21;};'use strict';var util=require('util');var path=require(_0x25c1('0x0'));var _=require(_0x25c1('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x25c1('0x2'));var zipdir=require(_0x25c1('0x3'));var rimraf=require(_0x25c1('0x4'));var db=require(_0x25c1('0x5'))['db'];var dbH=require(_0x25c1('0x5'))[_0x25c1('0x6')];var logger=require(_0x25c1('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x25c1('0x8')][0x2]);var QUERY=process[_0x25c1('0x8')][0x3];var PATH=process[_0x25c1('0x8')][0x4];function analyticExtractedReport(_0x4ab674,_0x5c69b1){var _0x24981c={'status':_0x4ab674};var _0x3b69ba={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5c69b1){_0x24981c[_0x25c1('0x9')]=_0x5c69b1;}return db[_0x25c1('0xa')][_0x25c1('0xb')](_0x24981c,_0x3b69ba);}function main(){var _0x588f30=0x1388;var _0x3e062e;logger[_0x25c1('0xc')](util[_0x25c1('0xd')](_0x25c1('0xe'),EXTRACTED_REPORT_ID,_0x25c1('0xf')));return db['Setting'][_0x25c1('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x25c1('0x11'),'splitSizeCsv']})[_0x25c1('0x12')](function(_0x209af5){if(_0x209af5){_0x3e062e=_0x209af5;_0x588f30=_0x3e062e[_0x25c1('0x13')]||0x1388;}})[_0x25c1('0x12')](function(){return dbH['sequelize']['query'](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x25c1('0x14')][_0x25c1('0x15')][_0x25c1('0x16')]});})[_0x25c1('0x12')](function(_0x17a032){if(!_0x17a032[0x0]['num']){return analyticExtractedReport(_0x25c1('0x17'));}var _0x55b62d=[];var _0x5d631e=0x0;var _0x5b852a=!![];if(_0x17a032&&_0x17a032[_0x25c1('0x18')]){var _0x1a08b5=_0x17a032[0x0]['num']%(_0x5d631e+_0x588f30);if(_0x3e062e['split']){for(;_0x5b852a;_0x5d631e+=_0x588f30,_0x1a08b5=_0x17a032[0x0][_0x25c1('0x19')]%(_0x5d631e+_0x588f30)){if(_0x1a08b5==0x0||_0x1a08b5==_0x17a032[0x0]['num']){_0x5b852a=![];}_0x55b62d[_0x25c1('0x1a')](dbH[_0x25c1('0x14')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x588f30,_0x5d631e),{'type':dbH[_0x25c1('0x14')][_0x25c1('0x15')][_0x25c1('0x16')]}));}}else{_0x55b62d[_0x25c1('0x1a')](dbH['sequelize'][_0x25c1('0x1b')](QUERY,{'type':dbH[_0x25c1('0x14')][_0x25c1('0x15')][_0x25c1('0x16')]}));}}var _0x517a46=path['dirname'](PATH);var _0x2a8a84=path[_0x25c1('0x1c')](PATH,_0x25c1('0x1d'));var _0x1c61e7=_0x3e062e[_0x25c1('0x11')]&&_0x55b62d[_0x25c1('0x18')]>0x1;var _0x2ba595=[];if(!fs[_0x25c1('0x1e')](path[_0x25c1('0x1f')](_0x517a46,_0x2a8a84))&&_0x1c61e7){fs[_0x25c1('0x20')](path[_0x25c1('0x1f')](_0x517a46,_0x2a8a84));}return BPromise[_0x25c1('0x21')](_0x55b62d,function(_0x399d72){_0x2ba595['push'](_0x399d72);})[_0x25c1('0x12')](function(){for(var _0x20dbb9=0x0;_0x20dbb9<_0x2ba595[_0x25c1('0x18')];_0x20dbb9+=0x1){var _0x1fb59f;var _0x21fdb8=_0x2ba595[_0x20dbb9];if(_0x1c61e7){_0x1fb59f=path[_0x25c1('0x1f')](_0x517a46,_0x2a8a84,util['format'](_0x25c1('0x22'),_0x2a8a84,_0x20dbb9,_0x25c1('0x23')));}else{_0x1fb59f=path[_0x25c1('0x1f')](_0x517a46,util[_0x25c1('0xd')](_0x25c1('0x24'),_0x2a8a84,_0x25c1('0x23')));}fs['writeFileSync'](_0x1fb59f,csv(_0x21fdb8));}})[_0x25c1('0x12')](function(){if(_0x1c61e7){zipdir(path['join'](_0x517a46,_0x2a8a84),{'saveTo':path[_0x25c1('0x1f')](_0x517a46,util[_0x25c1('0xd')](_0x25c1('0x24'),_0x2a8a84,_0x25c1('0x25')))},function(_0x2e80b5,_0x21069c){});rimraf(path[_0x25c1('0x1f')](_0x517a46,_0x2a8a84),function(){});}})[_0x25c1('0x12')](function(){logger[_0x25c1('0xc')](util['format'](_0x25c1('0x26'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x1c61e7?util[_0x25c1('0xd')](_0x25c1('0x24'),_0x2a8a84,_0x1c61e7?'zip':_0x25c1('0x23')):null);});})['catch'](function(_0x3bfcff){logger['info'](util[_0x25c1('0xd')](_0x25c1('0x27'),EXTRACTED_REPORT_ID,_0x25c1('0xf')),util[_0x25c1('0x28')](_0x3bfcff,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x25c1('0x29'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 0fbb925..8cd866a 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x3594cc,_0x40d56b){var _0xccdd28=function(_0x1a1964){while(--_0x1a1964){_0x3594cc['push'](_0x3594cc['shift']());}};_0xccdd28(++_0x40d56b);}(_0xb10b,0x12a));var _0xbb10=function(_0x789179,_0x455e5f){_0x789179=_0x789179-0x0;var _0x10878f=_0xb10b[_0x789179];return _0x10878f;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file +var _0x5f2f=['hasOwnProperty','push','num','Empty','dirname','basename','Setting','find','split','splitSizePdf','then','length','query','format','QueryTypes','SELECT','sequelize','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','landscape','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','createWriteStream','finish','err','end','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x5f40fc,_0x123e05){var _0x3dc6cc=function(_0x415bdf){while(--_0x415bdf){_0x5f40fc['push'](_0x5f40fc['shift']());}};_0x3dc6cc(++_0x123e05);}(_0x5f2f,0x73));var _0xf5f2=function(_0x348efb,_0x3fdb02){_0x348efb=_0x348efb-0x0;var _0x3f7332=_0x5f2f[_0x348efb];return _0x3f7332;};'use strict';var _=require(_0xf5f2('0x0'));var fs=require('fs');var BPromise=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var path=require(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var PdfPrinter=require(_0xf5f2('0x5'));var zipdir=require(_0xf5f2('0x6'));var rimraf=require(_0xf5f2('0x7'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf5f2('0x8')];var logger=require(_0xf5f2('0x9'))(_0xf5f2('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xf5f2('0xb')][0x2]);var QUERY=process[_0xf5f2('0xb')][0x3];var PATH=process[_0xf5f2('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf5f2('0xc');var _extractedReport;function analyticExtractedReport(_0x46cd9c,_0x2ec345){var _0x56a69f={'status':_0x46cd9c};var _0x375da4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ec345){_0x56a69f[_0xf5f2('0xd')]=_0x2ec345;}return db[_0xf5f2('0xe')]['update'](_0x56a69f,_0x375da4);}function getHeader(_0x977a59){var _0x4ebbbe=[];for(var _0x53fb33 in _0x977a59){if(_0x977a59[_0xf5f2('0xf')](_0x53fb33)){_0x4ebbbe[_0xf5f2('0x10')]({'text':_0x53fb33,'style':'tableHeader'});}}return _0x4ebbbe;}function extractReport(_0x336f6b){var _0x14b51f=0x1388;var _0x331482;if(!_0x336f6b[0x0][_0xf5f2('0x11')]){return analyticExtractedReport(_0xf5f2('0x12'));}var _0x3e5956=[];var _0x5c01b8=0x0;var _0x5850f4=!![];var _0xea612c=path[_0xf5f2('0x13')](PATH);var _0x1c1a5c=path[_0xf5f2('0x14')](PATH,'.pdf');var _0xafe430=![];var _0x286197=[];return db[_0xf5f2('0x15')][_0xf5f2('0x16')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf5f2('0x17'),_0xf5f2('0x18')]})[_0xf5f2('0x19')](function(_0x395a5a){if(_0x395a5a){_0x331482=_0x395a5a;_0x14b51f=_0x331482[_0xf5f2('0x18')]||0x3e8;}})[_0xf5f2('0x19')](function(){if(_0x336f6b&&_0x336f6b[_0xf5f2('0x1a')]){var _0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f);if(_0x331482[_0xf5f2('0x17')]){for(;_0x5850f4;_0x5c01b8+=_0x14b51f,_0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f)){if(_0x28e097==0x0||_0x28e097==_0x336f6b[0x0][_0xf5f2('0x11')]){_0x5850f4=![];}_0x3e5956[_0xf5f2('0x10')](dbH['sequelize'][_0xf5f2('0x1b')](util[_0xf5f2('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x14b51f,_0x5c01b8),{'type':dbH['sequelize'][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}else{_0x3e5956['push'](dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](QUERY,{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}_0xafe430=_0x331482['split']&&_0x3e5956[_0xf5f2('0x1a')]>0x1;if(!fs[_0xf5f2('0x20')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c))&&_0xafe430){fs[_0xf5f2('0x22')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c));}return BPromise['each'](_0x3e5956,function(_0x529f07){_0x286197[_0xf5f2('0x10')](_0x529f07);});})[_0xf5f2('0x19')](function(){return BPromise[_0xf5f2('0x23')](_0x3e5956,function(_0x1a5bb3,_0xf6c58d){var _0x788a8d;var _0x13a3be=util[_0xf5f2('0x1c')](_0xf5f2('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xf5f2('0x25')])[_0xf5f2('0x1c')](FORMAT),moment(_extractedReport[_0xf5f2('0x26')])[_0xf5f2('0x1c')](FORMAT));var _0x198c73={'pageSize':'A4','pageOrientation':_0xf5f2('0x27'),'content':[{'text':_0x13a3be,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x22c826={'headerRows':0x1,'body':[]};_0x22c826[_0xf5f2('0x28')][_0xf5f2('0x10')](getHeader(_0x1a5bb3[0x0]));var _0x5027ab;for(var _0x5a2c7e=0x0;_0x5a2c7e<_0x1a5bb3[_0xf5f2('0x1a')];_0x5a2c7e+=0x1){_0x5027ab=[];for(var _0x50b8a2 in _0x1a5bb3[_0x5a2c7e]){if(_0x1a5bb3[_0x5a2c7e][_0xf5f2('0xf')](_0x50b8a2)){_0x5027ab[_0xf5f2('0x10')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]?_[_0xf5f2('0x29')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]):'');}}_0x22c826['body']['push'](_0x5027ab);}_0x198c73[_0xf5f2('0x2a')]['push']({'table':_0x22c826});return new BPromise(function(_0xb744b9,_0x58a4df){var _0x45b643=new PdfPrinter({'Roboto':{'normal':__dirname+_0xf5f2('0x2b'),'bold':__dirname+_0xf5f2('0x2c'),'italics':__dirname+_0xf5f2('0x2d'),'bolditalics':__dirname+_0xf5f2('0x2e')}});var _0x277eee=_0x45b643[_0xf5f2('0x2f')](_0x198c73);if(_0xafe430){_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c,util['format'](_0xf5f2('0x30'),_0x1c1a5c,_0xf6c58d,_0xf5f2('0x31')));}else{_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xf5f2('0x31')));}var _0x297c0c=_0x277eee['pipe'](fs[_0xf5f2('0x33')](_0x788a8d));_0x297c0c['on'](_0xf5f2('0x34'),function(){_0xb744b9();});_0x297c0c['on']('error',function(_0x3fc168){console['log'](_0xf5f2('0x35'),_0x3fc168);_0x58a4df(_0x3fc168);});_0x277eee[_0xf5f2('0x36')]();});});})[_0xf5f2('0x19')](function(){if(_0xafe430){return new BPromise(function(_0x2e3cca,_0x59a6dd){zipdir(path['join'](_0xea612c,_0x1c1a5c),{'saveTo':path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,'zip'))},function(_0x41447f){if(_0x41447f){_0x59a6dd(_0x41447f);}else{_0x2e3cca();}});});}})['then'](function(){if(_0xafe430){rimraf(path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c),function(){});}})['then'](function(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf5f2('0x38')));return analyticExtractedReport(_0xf5f2('0x39'),_0xafe430?util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xafe430?'zip':'pdf'):null);});}function main(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')](_0xf5f2('0x3a'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')));return db[_0xf5f2('0xe')][_0xf5f2('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf5f2('0x19')](function(_0x4c0ac7){_extractedReport=_0x4c0ac7;return dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](util['format'](_0xf5f2('0x3d'),QUERY),{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]});})[_0xf5f2('0x19')](extractReport)[_0xf5f2('0x3e')](function(_0x462ea3){logger[_0xf5f2('0x37')](util['format'](_0xf5f2('0x3f'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')),util[_0xf5f2('0x40')](_0x462ea3,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ea1f1f9..124bd2e 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 _0x0adf=['dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Failed','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','splitSizeXlsx','then','sequelize','query','QueryTypes','num','Empty','split','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT'];(function(_0x107844,_0x41926f){var _0x40c2b5=function(_0x2d0c58){while(--_0x2d0c58){_0x107844['push'](_0x107844['shift']());}};_0x40c2b5(++_0x41926f);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x42da11,_0x179f70){_0x42da11=_0x42da11-0x0;var _0x1b9b9e=_0x0adf[_0x42da11];return _0x1b9b9e;};'use strict';var util=require(_0xf0ad('0x0'));var path=require(_0xf0ad('0x1'));var _=require(_0xf0ad('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xf0ad('0x3'));var zipdir=require(_0xf0ad('0x4'));var rimraf=require(_0xf0ad('0x5'));var db=require(_0xf0ad('0x6'))['db'];var dbH=require(_0xf0ad('0x6'))[_0xf0ad('0x7')];var logger=require(_0xf0ad('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xf0ad('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xf0ad('0x9')][0x4];function analyticExtractedReport(_0x44cf37,_0x170574){var _0x41c99d={'status':_0x44cf37};var _0xa9a315={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x170574){_0x41c99d[_0xf0ad('0xa')]=_0x170574;}return db[_0xf0ad('0xb')]['update'](_0x41c99d,_0xa9a315);}function main(){var _0x2ab4eb=0x1388;var _0x53c81a;logger[_0xf0ad('0xc')](util[_0xf0ad('0xd')](_0xf0ad('0xe'),EXTRACTED_REPORT_ID,_0xf0ad('0xf')));return db[_0xf0ad('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf0ad('0x11')]})[_0xf0ad('0x12')](function(_0x3646a2){if(_0x3646a2){_0x53c81a=_0x3646a2;_0x2ab4eb=_0x53c81a[_0xf0ad('0x11')]||0x1388;}})['then'](function(){return dbH[_0xf0ad('0x13')][_0xf0ad('0x14')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xf0ad('0x15')]['SELECT']});})[_0xf0ad('0x12')](function(_0x313ad6){if(!_0x313ad6[0x0][_0xf0ad('0x16')]){return analyticExtractedReport(_0xf0ad('0x17'));}var _0x237dd9=[];var _0x5c23ff=0x0;var _0x1ad9e0=!![];if(_0x53c81a[_0xf0ad('0x18')]){if(_0x313ad6&&_0x313ad6[_0xf0ad('0x19')]){var _0x1c9fac=_0x313ad6[0x0]['num']%(_0x5c23ff+_0x2ab4eb);for(;_0x1ad9e0;_0x5c23ff+=_0x2ab4eb,_0x1c9fac=_0x313ad6[0x0]['num']%(_0x5c23ff+_0x2ab4eb)){if(_0x1c9fac==0x0||_0x1c9fac==_0x313ad6[0x0][_0xf0ad('0x16')]){_0x1ad9e0=![];}_0x237dd9[_0xf0ad('0x1a')](dbH['sequelize'][_0xf0ad('0x14')](util[_0xf0ad('0xd')](_0xf0ad('0x1b'),QUERY,_0x2ab4eb,_0x5c23ff),{'type':dbH[_0xf0ad('0x13')]['QueryTypes']['SELECT']}));}}}else{_0x237dd9[_0xf0ad('0x1a')](dbH[_0xf0ad('0x13')][_0xf0ad('0x14')](QUERY,{'type':dbH[_0xf0ad('0x13')][_0xf0ad('0x15')][_0xf0ad('0x1c')]}));}var _0x4e874a=path[_0xf0ad('0x1d')](PATH);var _0x16e62a=path[_0xf0ad('0x1e')](PATH,_0xf0ad('0x1f'));var _0x29d647=_0x53c81a[_0xf0ad('0x18')]&&_0x237dd9[_0xf0ad('0x19')]>0x1;var _0x276322=[];if(!fs[_0xf0ad('0x20')](path[_0xf0ad('0x21')](_0x4e874a,_0x16e62a))&&_0x29d647){fs[_0xf0ad('0x22')](path[_0xf0ad('0x21')](_0x4e874a,_0x16e62a));}return BPromise[_0xf0ad('0x23')](_0x237dd9,function(_0x456f81){_0x276322[_0xf0ad('0x1a')](_0x456f81);})['then'](function(){for(var _0x234bc7=0x0;_0x234bc7<_0x276322[_0xf0ad('0x19')];_0x234bc7+=0x1){var _0x248794;var _0x7377d7=_0x276322[_0x234bc7];if(_0x29d647){_0x248794=path[_0xf0ad('0x21')](_0x4e874a,_0x16e62a,util[_0xf0ad('0xd')]('%s%d.%s',_0x16e62a,_0x234bc7,_0xf0ad('0x24')));}else{_0x248794=path[_0xf0ad('0x21')](_0x4e874a,util[_0xf0ad('0xd')](_0xf0ad('0x25'),_0x16e62a,_0xf0ad('0x24')));}fs[_0xf0ad('0x26')](_0x248794,json2xls(_0x7377d7),_0xf0ad('0x27'));}})[_0xf0ad('0x12')](function(){if(_0x29d647){zipdir(path[_0xf0ad('0x21')](_0x4e874a,_0x16e62a),{'saveTo':path[_0xf0ad('0x21')](_0x4e874a,util[_0xf0ad('0xd')]('%s.%s',_0x16e62a,_0xf0ad('0x28')))},function(_0x5f5115,_0x83f211){});rimraf(path['join'](_0x4e874a,_0x16e62a),function(){});}})[_0xf0ad('0x12')](function(){logger[_0xf0ad('0xc')](util[_0xf0ad('0xd')](_0xf0ad('0x29'),EXTRACTED_REPORT_ID,_0xf0ad('0xf')));return analyticExtractedReport(_0xf0ad('0x2a'),_0x29d647?util[_0xf0ad('0xd')](_0xf0ad('0x25'),_0x16e62a,_0x29d647?'zip':'xlsx'):null);});})[_0xf0ad('0x2b')](function(_0x113bf2){logger[_0xf0ad('0xc')](util[_0xf0ad('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf0ad('0xf')),util['inspect'](_0x113bf2,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xf0ad('0x2c'));});}main(); \ No newline at end of file +var _0x142c=['Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','split','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','Completed','zip'];(function(_0x121f32,_0x2a696e){var _0x3385cc=function(_0x4f3d6c){while(--_0x4f3d6c){_0x121f32['push'](_0x121f32['shift']());}};_0x3385cc(++_0x2a696e);}(_0x142c,0x8f));var _0xc142=function(_0x55c1d3,_0x261893){_0x55c1d3=_0x55c1d3-0x0;var _0x385b98=_0x142c[_0x55c1d3];return _0x385b98;};'use strict';var util=require(_0xc142('0x0'));var path=require(_0xc142('0x1'));var _=require(_0xc142('0x2'));var fs=require('fs');var json2xls=require(_0xc142('0x3'));var BPromise=require(_0xc142('0x4'));var zipdir=require(_0xc142('0x5'));var rimraf=require(_0xc142('0x6'));var db=require(_0xc142('0x7'))['db'];var dbH=require('../../mysqldb')[_0xc142('0x8')];var logger=require(_0xc142('0x9'))(_0xc142('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xc142('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xc142('0xb')][0x4];function analyticExtractedReport(_0x583f7b,_0x477ae4){var _0x2e8d46={'status':_0x583f7b};var _0x4794dc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x477ae4){_0x2e8d46[_0xc142('0xc')]=_0x477ae4;}return db[_0xc142('0xd')][_0xc142('0xe')](_0x2e8d46,_0x4794dc);}function main(){var _0x5a6ab9=0x1388;var _0x4b6780;logger[_0xc142('0xf')](util[_0xc142('0x10')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc142('0x11')));return db[_0xc142('0x12')][_0xc142('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xc142('0x14')]})[_0xc142('0x15')](function(_0x1af911){if(_0x1af911){_0x4b6780=_0x1af911;_0x5a6ab9=_0x4b6780[_0xc142('0x14')]||0x1388;}})['then'](function(){return dbH[_0xc142('0x16')][_0xc142('0x17')](util[_0xc142('0x10')](_0xc142('0x18'),QUERY),{'type':dbH[_0xc142('0x16')]['QueryTypes'][_0xc142('0x19')]});})['then'](function(_0x2bc00e){if(!_0x2bc00e[0x0][_0xc142('0x1a')]){return analyticExtractedReport('Empty');}var _0x3c2d24=[];var _0x9683fa=0x0;var _0x57c161=!![];if(_0x4b6780[_0xc142('0x1b')]){if(_0x2bc00e&&_0x2bc00e[_0xc142('0x1c')]){var _0x1a5c1a=_0x2bc00e[0x0][_0xc142('0x1a')]%(_0x9683fa+_0x5a6ab9);for(;_0x57c161;_0x9683fa+=_0x5a6ab9,_0x1a5c1a=_0x2bc00e[0x0][_0xc142('0x1a')]%(_0x9683fa+_0x5a6ab9)){if(_0x1a5c1a==0x0||_0x1a5c1a==_0x2bc00e[0x0][_0xc142('0x1a')]){_0x57c161=![];}_0x3c2d24[_0xc142('0x1d')](dbH['sequelize'][_0xc142('0x17')](util[_0xc142('0x10')](_0xc142('0x1e'),QUERY,_0x5a6ab9,_0x9683fa),{'type':dbH[_0xc142('0x16')][_0xc142('0x1f')][_0xc142('0x19')]}));}}}else{_0x3c2d24['push'](dbH[_0xc142('0x16')][_0xc142('0x17')](QUERY,{'type':dbH[_0xc142('0x16')][_0xc142('0x1f')][_0xc142('0x19')]}));}var _0x376a7a=path['dirname'](PATH);var _0x558157=path[_0xc142('0x20')](PATH,_0xc142('0x21'));var _0x3924f9=_0x4b6780[_0xc142('0x1b')]&&_0x3c2d24[_0xc142('0x1c')]>0x1;var _0xfa0959=[];if(!fs[_0xc142('0x22')](path[_0xc142('0x23')](_0x376a7a,_0x558157))&&_0x3924f9){fs[_0xc142('0x24')](path['join'](_0x376a7a,_0x558157));}return BPromise[_0xc142('0x25')](_0x3c2d24,function(_0xfb7d87){_0xfa0959[_0xc142('0x1d')](_0xfb7d87);})['then'](function(){for(var _0x121f4b=0x0;_0x121f4b<_0xfa0959[_0xc142('0x1c')];_0x121f4b+=0x1){var _0x15bf7c;var _0x4fcc97=_0xfa0959[_0x121f4b];if(_0x3924f9){_0x15bf7c=path[_0xc142('0x23')](_0x376a7a,_0x558157,util[_0xc142('0x10')](_0xc142('0x26'),_0x558157,_0x121f4b,_0xc142('0x27')));}else{_0x15bf7c=path[_0xc142('0x23')](_0x376a7a,util[_0xc142('0x10')](_0xc142('0x28'),_0x558157,_0xc142('0x27')));}fs[_0xc142('0x29')](_0x15bf7c,json2xls(_0x4fcc97),_0xc142('0x2a'));}})[_0xc142('0x15')](function(){if(_0x3924f9){zipdir(path[_0xc142('0x23')](_0x376a7a,_0x558157),{'saveTo':path['join'](_0x376a7a,util[_0xc142('0x10')](_0xc142('0x28'),_0x558157,'zip'))},function(_0x3bc723,_0x2d4c85){});rimraf(path[_0xc142('0x23')](_0x376a7a,_0x558157),function(){});}})[_0xc142('0x15')](function(){logger[_0xc142('0xf')](util[_0xc142('0x10')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xc142('0x2b'),_0x3924f9?util[_0xc142('0x10')](_0xc142('0x28'),_0x558157,_0x3924f9?_0xc142('0x2c'):'xlsx'):null);});})['catch'](function(_0x36e30e){logger['info'](util[_0xc142('0x10')](_0xc142('0x2d'),EXTRACTED_REPORT_ID,_0xc142('0x11')),util['inspect'](_0x36e30e,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xc142('0x2e'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index d32956b..e50ade6 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 _0x2ab3=['appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','Hangup','destroy','bulkCreate','catch','error','rewrite','lodash','Interval','findAll','then','intervals','models','VoiceExtension','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extension','find','extensions','push','type','Set','format','context','outbound','cutdigits','${EXTEN:','${EXTEN}','exten','CDR(routeid)=','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','VoiceExtensionId','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','toLowerCase'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x2ab3,0x1d3));var _0x32ab=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x2ab3[_0x4099ee];return _0x1b7bfc;};'use strict';var _=require(_0x32ab('0x0'));var util=require('util');function rewrite(_0x5d361f,_0x4afb00){var _0x749161=this;return _0x5d361f['models'][_0x32ab('0x1')][_0x32ab('0x2')]({'raw':!![]})[_0x32ab('0x3')](function(_0x2cee7a){_0x749161[_0x32ab('0x4')]=_0x2cee7a;return _0x5d361f[_0x32ab('0x5')][_0x32ab('0x6')][_0x32ab('0x2')]({'where':{'IntervalId':_0x4afb00[_0x32ab('0x7')]},'raw':!![]});})[_0x32ab('0x3')](function(_0x30a454){return _0x5d361f[_0x32ab('0x5')][_0x32ab('0x6')][_0x32ab('0x2')]({'where':{'exten':{'$in':_[_0x32ab('0x8')](_[_0x32ab('0x9')](_0x30a454,'exten'))}},'order':[{'raw':_0x32ab('0xa')}],'raw':!![]});})[_0x32ab('0x3')](function(_0x19687a){var _0x35dee4=_[_0x32ab('0xb')](_0x19687a,{'priority':'1'});var _0x274795=_[_0x32ab('0xb')](_0x19687a,{'isApp':0x1});var _0xdd65f7=_[_0x32ab('0xc')](_0x274795,'exten');var _0x32309a=[_0x32ab('0xd'),'playback'];var _0xad72f6=[];var _0x136db=[];for(var _0x4f082a in _0xdd65f7){if(_0xdd65f7['hasOwnProperty'](_0x4f082a)){_0x749161[_0x32ab('0xe')]=0x2;_0x749161['extensions']=[];_0x749161[_0x32ab('0xf')]=_[_0x32ab('0x10')](_0x35dee4,{'exten':_0xdd65f7[_0x4f082a][0x0]['exten']});_0x749161[_0x32ab('0x11')][_0x32ab('0x12')]({'type':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x13')],'app':_0x32ab('0x14'),'appdata':util[_0x32ab('0x15')]('CDR(type)=%s',_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x13')]),'context':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x16')],'exten':_0xdd65f7[_0x4f082a][0x0]['exten'],'priority':_0x749161['priority']++,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0]['VoiceExtensionId']});if(_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x13')]===_0x32ab('0x17')){if(_0x749161[_0x32ab('0xf')]){_0x749161[_0x32ab('0x11')][_0x32ab('0x12')]({'type':_0xdd65f7[_0x4f082a][0x0]['type'],'app':_0x32ab('0x14'),'appdata':'CDR(destination)='+(_0x749161['extension'][_0x32ab('0x18')]?_0x32ab('0x19')+_0x749161[_0x32ab('0xf')][_0x32ab('0x18')]+'}':_0x32ab('0x1a')),'context':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x16')],'exten':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1b')],'priority':_0x749161[_0x32ab('0xe')]++,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0]['VoiceExtensionId']});}_0x749161[_0x32ab('0x11')][_0x32ab('0x12')]({'type':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x13')],'app':'Set','appdata':_0x32ab('0x1c')+_0xdd65f7[_0x4f082a][0x0]['VoiceExtensionId'],'context':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x16')],'exten':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1b')],'priority':_0x749161[_0x32ab('0xe')]++,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0]['VoiceExtensionId']});var _0x41022b=_0x749161[_0x32ab('0xe')]++;_0x749161[_0x32ab('0x11')][_0x32ab('0x12')]({'type':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x13')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x41022b+0x2)+'):Goto('+(_0x41022b+0x1)+')','context':_0xdd65f7[_0x4f082a][0x0]['context'],'exten':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1b')],'priority':_0x41022b,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0]['VoiceExtensionId']});if(_0x749161[_0x32ab('0xf')]){_0x749161[_0x32ab('0x11')][_0x32ab('0x12')]({'type':_0xdd65f7[_0x4f082a][0x0]['type'],'app':_0x32ab('0x14'),'appdata':_0x749161[_0x32ab('0xf')][_0x32ab('0x18')]?_0x32ab('0x1d')+_0x749161[_0x32ab('0xf')][_0x32ab('0x18')]+'}':_0x32ab('0x1e'),'context':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x16')],'exten':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1b')],'priority':_0x749161[_0x32ab('0xe')]++,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1f')]});}_0x749161[_0x32ab('0x11')][_0x32ab('0x12')]({'type':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x13')],'app':_0x32ab('0x14'),'appdata':_0x32ab('0x20')+_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1f')],'context':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x16')],'exten':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1b')],'priority':_0x749161[_0x32ab('0xe')]++,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1f')]});if(_0x749161['extension']&&_0x749161[_0x32ab('0xf')][_0x32ab('0x21')](_0x32ab('0x22'))&&_0x749161['extension'][_0x32ab('0x22')]!=='none'){_0x749161[_0x32ab('0x11')]['push']({'type':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x13')],'app':_0x32ab('0x14'),'appdata':_0x32ab('0x23'),'context':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x16')],'exten':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1b')],'priority':_0x749161[_0x32ab('0xe')]++,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1f')]});_0x749161[_0x32ab('0x11')][_0x32ab('0x12')]({'type':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x13')],'app':_0x32ab('0x14'),'appdata':_0x32ab('0x24')+_0x749161[_0x32ab('0xf')]['recordingFormat']||_0x32ab('0x25'),'context':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x16')],'exten':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1b')],'priority':_0x749161['priority']++,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1f')]});}}_0x749161[_0x32ab('0x11')][_0x32ab('0x12')]({'type':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x13')],'app':_0x32ab('0x14'),'appdata':_0x32ab('0x26'),'context':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x16')],'exten':_0xdd65f7[_0x4f082a][0x0]['exten'],'priority':_0x749161['priority']++,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1f')]});_0x749161['extensions'][_0x32ab('0x12')]({'type':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x13')],'app':'Set','appdata':_0x32ab('0x27'),'context':_0xdd65f7[_0x4f082a][0x0]['context'],'exten':_0xdd65f7[_0x4f082a][0x0]['exten'],'priority':_0x749161[_0x32ab('0xe')]++,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1f')]});_0x749161[_0x32ab('0x11')][_0x32ab('0x12')]({'type':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x13')],'app':_0x32ab('0x14'),'appdata':_0x32ab('0x28'),'context':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x16')],'exten':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1b')],'priority':_0x749161[_0x32ab('0xe')]++,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1f')]});for(var _0x318c21=0x0,_0x132f19=0x0;_0x318c21<_0xdd65f7[_0x4f082a][_0x32ab('0x29')];_0x318c21+=0x1,_0x132f19=0x0){var _0x51dfe6=_0xdd65f7[_0x4f082a][_0x318c21];if(_0x51dfe6[_0x32ab('0x13')]){_0x51dfe6[_0x32ab('0x13')]=_0x51dfe6[_0x32ab('0x13')]['toLowerCase']();}var _0x22edda=[];var _0x564888=[];delete _0x51dfe6['id'];delete _0x51dfe6['createdAt'];delete _0x51dfe6[_0x32ab('0x2a')];var _0x47b137=_0x51dfe6[_0x32ab('0x2b')]!==_0x32ab('0x2c')?[_0x51dfe6['interval']]:_0x51dfe6[_0x32ab('0x7')]?_[_0x32ab('0x9')](_[_0x32ab('0xb')](_0x749161[_0x32ab('0x4')],{'IntervalId':_0x51dfe6[_0x32ab('0x7')]}),_0x32ab('0x2b')):[];if(_0x51dfe6[_0x32ab('0x21')]('tag')){if(_0x51dfe6[_0x32ab('0x2d')]&&_0x51dfe6[_0x32ab('0x2d')]!=='--'){_0x22edda[_0x32ab('0x12')]({'type':_0x51dfe6[_0x32ab('0x13')],'app':_0x32ab('0x14'),'appdata':_0x32ab('0x2e')+_0x51dfe6[_0x32ab('0x2d')],'context':_0x51dfe6[_0x32ab('0x16')],'exten':_0x51dfe6['exten'],'priority':_0x47b137[_0x32ab('0x29')]+_0x749161[_0x32ab('0xe')]+_0x132f19++,'VoiceExtensionId':_0x51dfe6['VoiceExtensionId']});}}if(_0x51dfe6[_0x32ab('0x13')]==='outbound'&&_0x51dfe6[_0x32ab('0x21')](_0x32ab('0x2f'))){if(_0x51dfe6[_0x32ab('0x2f')]){_0x22edda['push']({'type':_0x51dfe6[_0x32ab('0x13')],'app':_0x32ab('0x30'),'appdata':_0x32ab('0x31')+_0x51dfe6[_0x32ab('0x2f')]+')','context':_0x51dfe6['context'],'exten':_0x51dfe6[_0x32ab('0x1b')],'priority':_0x47b137[_0x32ab('0x29')]+_0x749161[_0x32ab('0xe')]+_0x132f19++,'VoiceExtensionId':_0x51dfe6[_0x32ab('0x1f')]});}else{_0x22edda['push']({'type':_0x51dfe6[_0x32ab('0x13')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x51dfe6[_0x32ab('0x16')],'exten':_0x51dfe6['exten'],'priority':_0x47b137['length']+_0x749161[_0x32ab('0xe')]+_0x132f19++,'VoiceExtensionId':_0x51dfe6[_0x32ab('0x1f')]});}}if(_0x51dfe6[_0x32ab('0x21')](_0x32ab('0x32'))){if(_0x32309a[_0x32ab('0x33')](_0x51dfe6['app'][_0x32ab('0x34')]())>=0x0&&_0x51dfe6[_0x32ab('0x35')]!=='custom'){if(_0x51dfe6['answer']){_0x22edda['push']({'type':_0x51dfe6[_0x32ab('0x13')],'app':_0x32ab('0x30'),'appdata':_0x32ab('0x36'),'context':_0x51dfe6['context'],'exten':_0x51dfe6['exten'],'priority':_0x47b137[_0x32ab('0x29')]+_0x749161[_0x32ab('0xe')]+_0x132f19++,'VoiceExtensionId':_0x51dfe6[_0x32ab('0x1f')]});_0x22edda[_0x32ab('0x12')]({'type':_0x51dfe6['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x51dfe6[_0x32ab('0x16')],'exten':_0x51dfe6[_0x32ab('0x1b')],'priority':_0x47b137[_0x32ab('0x29')]+_0x749161[_0x32ab('0xe')]+_0x132f19++,'VoiceExtensionId':_0x51dfe6[_0x32ab('0x1f')]});}else{_0x22edda[_0x32ab('0x12')]({'type':_0x51dfe6[_0x32ab('0x13')],'app':'ExecIf','appdata':_0x32ab('0x37'),'context':_0x51dfe6[_0x32ab('0x16')],'exten':_0x51dfe6['exten'],'priority':_0x47b137[_0x32ab('0x29')]+_0x749161[_0x32ab('0xe')]+_0x132f19++,'VoiceExtensionId':_0x51dfe6[_0x32ab('0x1f')]});_0x22edda[_0x32ab('0x12')]({'type':_0x51dfe6['type'],'app':_0x32ab('0x14'),'appdata':_0x32ab('0x38'),'context':_0x51dfe6[_0x32ab('0x16')],'exten':_0x51dfe6['exten'],'priority':_0x47b137['length']+_0x749161['priority']+_0x132f19++,'VoiceExtensionId':_0x51dfe6['VoiceExtensionId']});}}}for(var _0x46c578=0x0;_0x46c578<_0x47b137['length'];_0x46c578+=0x1){var _0x4c6019=_0x749161['priority']+_0x47b137[_0x32ab('0x29')];var _0x582dca=_0x46c578===_0x47b137['length']-0x1?_0x749161[_0x32ab('0xe')]+_0x22edda['length']+_0x564888[_0x32ab('0x29')]+0x2:_0x749161[_0x32ab('0xe')]+_0x46c578+0x1;_0x22edda['splice'](_0x46c578,0x0,{'type':_0x51dfe6[_0x32ab('0x13')],'app':'GotoIfTime','appdata':_0x47b137[_0x46c578]+'?'+_0x51dfe6[_0x32ab('0x16')]+_0x32ab('0x39')+_0x4c6019+':'+_0x51dfe6[_0x32ab('0x16')]+_0x32ab('0x39')+_0x582dca,'exten':_0x51dfe6[_0x32ab('0x1b')],'context':_0x51dfe6[_0x32ab('0x16')],'priority':_0x749161[_0x32ab('0xe')]+_0x46c578,'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0]['VoiceExtensionId']});}_0x51dfe6['priority']=_0x22edda['length']?_[_0x32ab('0x3a')](_0x22edda)[_0x32ab('0xe')]+0x1:_0x749161['priority'];_0x749161[_0x32ab('0xe')]=(_0x564888['length']?_['last'](_0x564888)[_0x32ab('0xe')]:_0x51dfe6[_0x32ab('0xe')])+0x1;_0x749161[_0x32ab('0x11')]=_['concat'](_0x749161[_0x32ab('0x11')],_0x22edda,[_0x51dfe6],_0x564888);}_0x749161['extensions'][_0x32ab('0x12')]({'type':_0xdd65f7[_0x4f082a][0x0]['type'],'app':_0x32ab('0x3b'),'exten':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x1b')],'context':_0xdd65f7[_0x4f082a][0x0][_0x32ab('0x16')],'priority':_0x749161[_0x32ab('0xe')],'VoiceExtensionId':_0xdd65f7[_0x4f082a][0x0]['VoiceExtensionId']});_0xad72f6[_0x32ab('0x12')](_0xdd65f7[_0x4f082a][0x0]['VoiceExtensionId']);_0x136db=_['concat'](_0x136db,_0x749161['extensions']);}}return _0x5d361f['transaction'](function(_0x2026a4){return _0x5d361f['models'][_0x32ab('0x6')][_0x32ab('0x3c')]({'where':{'VoiceExtensionId':{'$in':_0xad72f6}},'transaction':_0x2026a4})[_0x32ab('0x3')](function(_0x32ba42){return _0x5d361f[_0x32ab('0x5')]['VoiceExtension'][_0x32ab('0x3d')](_['sortBy'](_0x136db,_0x32ab('0xe')),{'transaction':_0x2026a4});});});})[_0x32ab('0x3e')](function(_0x1252e0){console[_0x32ab('0x3f')](_0x1252e0);});}exports[_0x32ab('0x40')]=rewrite; \ No newline at end of file +var _0xb6b8=['error','rewrite','util','models','Interval','then','intervals','VoiceExtension','findAll','uniq','map','exten','filter','groupBy','playback','hasOwnProperty','extensions','extension','find','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','push','cutdigits','${EXTEN:','${EXTEN}','priority','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','toLowerCase','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','last','concat','transaction','destroy'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xb6b8,0xc5));var _0x8b6b=function(_0x4f6808,_0x36ea0f){_0x4f6808=_0x4f6808-0x0;var _0x5713f0=_0xb6b8[_0x4f6808];return _0x5713f0;};'use strict';var _=require('lodash');var util=require(_0x8b6b('0x0'));function rewrite(_0x2efc6b,_0x4633fe){var _0x3cc9c9=this;return _0x2efc6b[_0x8b6b('0x1')][_0x8b6b('0x2')]['findAll']({'raw':!![]})[_0x8b6b('0x3')](function(_0x23b61b){_0x3cc9c9[_0x8b6b('0x4')]=_0x23b61b;return _0x2efc6b['models'][_0x8b6b('0x5')]['findAll']({'where':{'IntervalId':_0x4633fe['IntervalId']},'raw':!![]});})[_0x8b6b('0x3')](function(_0x303c21){return _0x2efc6b[_0x8b6b('0x1')][_0x8b6b('0x5')][_0x8b6b('0x6')]({'where':{'exten':{'$in':_[_0x8b6b('0x7')](_[_0x8b6b('0x8')](_0x303c21,_0x8b6b('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x5b5825){var _0x30083b=_[_0x8b6b('0xa')](_0x5b5825,{'priority':'1'});var _0x1c79db=_['filter'](_0x5b5825,{'isApp':0x1});var _0xdbd439=_[_0x8b6b('0xb')](_0x1c79db,'exten');var _0x2e21f7=['queue',_0x8b6b('0xc')];var _0x1fd37e=[];var _0x524b0b=[];for(var _0x4d895c in _0xdbd439){if(_0xdbd439[_0x8b6b('0xd')](_0x4d895c)){_0x3cc9c9['priority']=0x2;_0x3cc9c9[_0x8b6b('0xe')]=[];_0x3cc9c9[_0x8b6b('0xf')]=_[_0x8b6b('0x10')](_0x30083b,{'exten':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x9')]});_0x3cc9c9[_0x8b6b('0xe')]['push']({'type':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')],'app':_0x8b6b('0x12'),'appdata':util[_0x8b6b('0x13')](_0x8b6b('0x14'),_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')]),'context':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x15')],'exten':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x9')],'priority':_0x3cc9c9['priority']++,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')]});if(_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')]===_0x8b6b('0x17')){if(_0x3cc9c9[_0x8b6b('0xf')]){_0x3cc9c9['extensions'][_0x8b6b('0x18')]({'type':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')],'app':'Set','appdata':'CDR(destination)='+(_0x3cc9c9[_0x8b6b('0xf')][_0x8b6b('0x19')]?_0x8b6b('0x1a')+_0x3cc9c9['extension'][_0x8b6b('0x19')]+'}':_0x8b6b('0x1b')),'context':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x15')],'exten':_0xdbd439[_0x4d895c][0x0]['exten'],'priority':_0x3cc9c9[_0x8b6b('0x1c')]++,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')]});}_0x3cc9c9[_0x8b6b('0xe')]['push']({'type':_0xdbd439[_0x4d895c][0x0]['type'],'app':_0x8b6b('0x12'),'appdata':_0x8b6b('0x1d')+_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')],'context':_0xdbd439[_0x4d895c][0x0]['context'],'exten':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x9')],'priority':_0x3cc9c9[_0x8b6b('0x1c')]++,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')]});var _0x2753fc=_0x3cc9c9[_0x8b6b('0x1c')]++;_0x3cc9c9['extensions']['push']({'type':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')],'app':_0x8b6b('0x1e'),'appdata':_0x8b6b('0x1f')+(_0x2753fc+0x2)+_0x8b6b('0x20')+(_0x2753fc+0x1)+')','context':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x15')],'exten':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x9')],'priority':_0x2753fc,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0]['VoiceExtensionId']});if(_0x3cc9c9['extension']){_0x3cc9c9[_0x8b6b('0xe')][_0x8b6b('0x18')]({'type':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')],'app':_0x8b6b('0x12'),'appdata':_0x3cc9c9[_0x8b6b('0xf')][_0x8b6b('0x19')]?_0x8b6b('0x21')+_0x3cc9c9[_0x8b6b('0xf')][_0x8b6b('0x19')]+'}':'CDR(prefix)=noprefix','context':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x15')],'exten':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x9')],'priority':_0x3cc9c9['priority']++,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')]});}_0x3cc9c9[_0x8b6b('0xe')][_0x8b6b('0x18')]({'type':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')],'app':'Set','appdata':_0x8b6b('0x22')+_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')],'context':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x15')],'exten':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x9')],'priority':_0x3cc9c9[_0x8b6b('0x1c')]++,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')]});if(_0x3cc9c9[_0x8b6b('0xf')]&&_0x3cc9c9[_0x8b6b('0xf')]['hasOwnProperty'](_0x8b6b('0x23'))&&_0x3cc9c9[_0x8b6b('0xf')][_0x8b6b('0x23')]!=='none'){_0x3cc9c9[_0x8b6b('0xe')][_0x8b6b('0x18')]({'type':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')],'app':_0x8b6b('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x15')],'exten':_0xdbd439[_0x4d895c][0x0]['exten'],'priority':_0x3cc9c9[_0x8b6b('0x1c')]++,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')]});_0x3cc9c9[_0x8b6b('0xe')][_0x8b6b('0x18')]({'type':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')],'app':_0x8b6b('0x12'),'appdata':_0x8b6b('0x24')+_0x3cc9c9[_0x8b6b('0xf')][_0x8b6b('0x23')]||_0x8b6b('0x25'),'context':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x15')],'exten':_0xdbd439[_0x4d895c][0x0]['exten'],'priority':_0x3cc9c9['priority']++,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')]});}}_0x3cc9c9[_0x8b6b('0xe')][_0x8b6b('0x18')]({'type':_0xdbd439[_0x4d895c][0x0]['type'],'app':_0x8b6b('0x12'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x15')],'exten':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x9')],'priority':_0x3cc9c9[_0x8b6b('0x1c')]++,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')]});_0x3cc9c9['extensions'][_0x8b6b('0x18')]({'type':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')],'app':_0x8b6b('0x12'),'appdata':_0x8b6b('0x26'),'context':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x15')],'exten':_0xdbd439[_0x4d895c][0x0]['exten'],'priority':_0x3cc9c9[_0x8b6b('0x1c')]++,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')]});_0x3cc9c9[_0x8b6b('0xe')][_0x8b6b('0x18')]({'type':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')],'app':'Set','appdata':_0x8b6b('0x27'),'context':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x15')],'exten':_0xdbd439[_0x4d895c][0x0]['exten'],'priority':_0x3cc9c9['priority']++,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0]['VoiceExtensionId']});for(var _0x24d5a2=0x0,_0x5ce5a0=0x0;_0x24d5a2<_0xdbd439[_0x4d895c][_0x8b6b('0x28')];_0x24d5a2+=0x1,_0x5ce5a0=0x0){var _0x58c7a2=_0xdbd439[_0x4d895c][_0x24d5a2];if(_0x58c7a2[_0x8b6b('0x11')]){_0x58c7a2[_0x8b6b('0x11')]=_0x58c7a2[_0x8b6b('0x11')]['toLowerCase']();}var _0x3bc49e=[];var _0x1a85ee=[];delete _0x58c7a2['id'];delete _0x58c7a2['createdAt'];delete _0x58c7a2['updatedAt'];var _0x491794=_0x58c7a2[_0x8b6b('0x29')]!==_0x8b6b('0x2a')?[_0x58c7a2['interval']]:_0x58c7a2[_0x8b6b('0x2b')]?_[_0x8b6b('0x8')](_[_0x8b6b('0xa')](_0x3cc9c9[_0x8b6b('0x4')],{'IntervalId':_0x58c7a2[_0x8b6b('0x2b')]}),'interval'):[];if(_0x58c7a2[_0x8b6b('0xd')]('tag')){if(_0x58c7a2[_0x8b6b('0x2c')]&&_0x58c7a2[_0x8b6b('0x2c')]!=='--'){_0x3bc49e[_0x8b6b('0x18')]({'type':_0x58c7a2[_0x8b6b('0x11')],'app':_0x8b6b('0x12'),'appdata':_0x8b6b('0x2d')+_0x58c7a2[_0x8b6b('0x2c')],'context':_0x58c7a2['context'],'exten':_0x58c7a2[_0x8b6b('0x9')],'priority':_0x491794['length']+_0x3cc9c9[_0x8b6b('0x1c')]+_0x5ce5a0++,'VoiceExtensionId':_0x58c7a2[_0x8b6b('0x16')]});}}if(_0x58c7a2[_0x8b6b('0x11')]===_0x8b6b('0x17')&&_0x58c7a2[_0x8b6b('0xd')](_0x8b6b('0x2e'))){if(_0x58c7a2[_0x8b6b('0x2e')]){_0x3bc49e[_0x8b6b('0x18')]({'type':_0x58c7a2[_0x8b6b('0x11')],'app':'ExecIf','appdata':_0x8b6b('0x2f')+_0x58c7a2[_0x8b6b('0x2e')]+')','context':_0x58c7a2[_0x8b6b('0x15')],'exten':_0x58c7a2[_0x8b6b('0x9')],'priority':_0x491794['length']+_0x3cc9c9[_0x8b6b('0x1c')]+_0x5ce5a0++,'VoiceExtensionId':_0x58c7a2[_0x8b6b('0x16')]});}else{_0x3bc49e[_0x8b6b('0x18')]({'type':_0x58c7a2[_0x8b6b('0x11')],'app':'ExecIf','appdata':_0x8b6b('0x30'),'context':_0x58c7a2[_0x8b6b('0x15')],'exten':_0x58c7a2['exten'],'priority':_0x491794['length']+_0x3cc9c9['priority']+_0x5ce5a0++,'VoiceExtensionId':_0x58c7a2['VoiceExtensionId']});}}if(_0x58c7a2[_0x8b6b('0xd')](_0x8b6b('0x31'))){if(_0x2e21f7[_0x8b6b('0x32')](_0x58c7a2['app'][_0x8b6b('0x33')]())>=0x0&&_0x58c7a2[_0x8b6b('0x34')]!==_0x8b6b('0x35')){if(_0x58c7a2['answer']){_0x3bc49e[_0x8b6b('0x18')]({'type':_0x58c7a2[_0x8b6b('0x11')],'app':_0x8b6b('0x1e'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x58c7a2[_0x8b6b('0x15')],'exten':_0x58c7a2['exten'],'priority':_0x491794[_0x8b6b('0x28')]+_0x3cc9c9[_0x8b6b('0x1c')]+_0x5ce5a0++,'VoiceExtensionId':_0x58c7a2[_0x8b6b('0x16')]});_0x3bc49e['push']({'type':_0x58c7a2[_0x8b6b('0x11')],'app':_0x8b6b('0x12'),'appdata':_0x8b6b('0x36'),'context':_0x58c7a2[_0x8b6b('0x15')],'exten':_0x58c7a2['exten'],'priority':_0x491794[_0x8b6b('0x28')]+_0x3cc9c9[_0x8b6b('0x1c')]+_0x5ce5a0++,'VoiceExtensionId':_0x58c7a2['VoiceExtensionId']});}else{_0x3bc49e[_0x8b6b('0x18')]({'type':_0x58c7a2[_0x8b6b('0x11')],'app':_0x8b6b('0x1e'),'appdata':_0x8b6b('0x37'),'context':_0x58c7a2[_0x8b6b('0x15')],'exten':_0x58c7a2['exten'],'priority':_0x491794['length']+_0x3cc9c9['priority']+_0x5ce5a0++,'VoiceExtensionId':_0x58c7a2[_0x8b6b('0x16')]});_0x3bc49e['push']({'type':_0x58c7a2['type'],'app':_0x8b6b('0x12'),'appdata':_0x8b6b('0x38'),'context':_0x58c7a2[_0x8b6b('0x15')],'exten':_0x58c7a2[_0x8b6b('0x9')],'priority':_0x491794[_0x8b6b('0x28')]+_0x3cc9c9['priority']+_0x5ce5a0++,'VoiceExtensionId':_0x58c7a2[_0x8b6b('0x16')]});}}}for(var _0x42ad7a=0x0;_0x42ad7a<_0x491794[_0x8b6b('0x28')];_0x42ad7a+=0x1){var _0x3caccc=_0x3cc9c9[_0x8b6b('0x1c')]+_0x491794['length'];var _0x503b3f=_0x42ad7a===_0x491794[_0x8b6b('0x28')]-0x1?_0x3cc9c9[_0x8b6b('0x1c')]+_0x3bc49e[_0x8b6b('0x28')]+_0x1a85ee[_0x8b6b('0x28')]+0x2:_0x3cc9c9[_0x8b6b('0x1c')]+_0x42ad7a+0x1;_0x3bc49e[_0x8b6b('0x39')](_0x42ad7a,0x0,{'type':_0x58c7a2[_0x8b6b('0x11')],'app':_0x8b6b('0x3a'),'appdata':_0x491794[_0x42ad7a]+'?'+_0x58c7a2[_0x8b6b('0x15')]+',${EXTEN},'+_0x3caccc+':'+_0x58c7a2['context']+',${EXTEN},'+_0x503b3f,'exten':_0x58c7a2[_0x8b6b('0x9')],'context':_0x58c7a2[_0x8b6b('0x15')],'priority':_0x3cc9c9[_0x8b6b('0x1c')]+_0x42ad7a,'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')]});}_0x58c7a2[_0x8b6b('0x1c')]=_0x3bc49e[_0x8b6b('0x28')]?_[_0x8b6b('0x3b')](_0x3bc49e)[_0x8b6b('0x1c')]+0x1:_0x3cc9c9['priority'];_0x3cc9c9[_0x8b6b('0x1c')]=(_0x1a85ee['length']?_['last'](_0x1a85ee)[_0x8b6b('0x1c')]:_0x58c7a2[_0x8b6b('0x1c')])+0x1;_0x3cc9c9[_0x8b6b('0xe')]=_[_0x8b6b('0x3c')](_0x3cc9c9[_0x8b6b('0xe')],_0x3bc49e,[_0x58c7a2],_0x1a85ee);}_0x3cc9c9[_0x8b6b('0xe')][_0x8b6b('0x18')]({'type':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x11')],'app':'Hangup','exten':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x9')],'context':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x15')],'priority':_0x3cc9c9[_0x8b6b('0x1c')],'VoiceExtensionId':_0xdbd439[_0x4d895c][0x0][_0x8b6b('0x16')]});_0x1fd37e[_0x8b6b('0x18')](_0xdbd439[_0x4d895c][0x0]['VoiceExtensionId']);_0x524b0b=_[_0x8b6b('0x3c')](_0x524b0b,_0x3cc9c9[_0x8b6b('0xe')]);}}return _0x2efc6b[_0x8b6b('0x3d')](function(_0x1ae51e){return _0x2efc6b[_0x8b6b('0x1')][_0x8b6b('0x5')][_0x8b6b('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x1fd37e}},'transaction':_0x1ae51e})['then'](function(_0xf8aeac){return _0x2efc6b[_0x8b6b('0x1')][_0x8b6b('0x5')]['bulkCreate'](_['sortBy'](_0x524b0b,_0x8b6b('0x1c')),{'transaction':_0x1ae51e});});});})['catch'](function(_0x307ee6){console[_0x8b6b('0x3f')](_0x307ee6);});}exports[_0x8b6b('0x40')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 2e4e781..2540d28 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 _0xb7e7=['birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','insert','into','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','toString','NOW()','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ContactId','cm_contacts','where','str','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','createReadStream','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','papaparse','../../../mysqldb','../../../config/logger','api','redis','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','error','contact','index','test','isNil','errors','length','map','join','data','phone','phone\x20not\x20specified!'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb7e7,0x121));var _0x7b7e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb7e7[_0x502c7d];return _0x30b7ed;};'use strict';var BPromise=require(_0x7b7e('0x0'));var util=require('util');var _=require(_0x7b7e('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x7b7e('0x2'));var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));config[_0x7b7e('0x6')]=_['defaults'](config['redis'],{'host':_0x7b7e('0x7'),'port':0x18eb});var socket=require(_0x7b7e('0x8'))(new Redis(config[_0x7b7e('0x6')]));require('../../../api/cmContact/cmContact.socket')[_0x7b7e('0x9')](socket);try{if(!process[_0x7b7e('0xa')][0x2]||process[_0x7b7e('0xa')][0x2]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x2]===_0x7b7e('0xc')){throw new Error(_0x7b7e('0xd'));}var FILEPATH=process['argv'][0x2];if(!process[_0x7b7e('0xa')][0x3]||process[_0x7b7e('0xa')][0x3]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x3]===_0x7b7e('0xc')||!process[_0x7b7e('0xa')][0x4]||process[_0x7b7e('0xa')][0x4]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x4]==='null'){throw new Error(_0x7b7e('0xe'));}var FIELDS=_[_0x7b7e('0xf')](process['argv'][0x3][_0x7b7e('0x10')](','),process['argv'][0x4]['split'](','));if(!process[_0x7b7e('0xa')][0x5]||process[_0x7b7e('0xa')][0x5]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x5]===_0x7b7e('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x7b7e('0xa')][0x6]&&process[_0x7b7e('0xa')][0x6]!==_0x7b7e('0xb')&&process[_0x7b7e('0xa')][0x6]!==_0x7b7e('0xc')?process[_0x7b7e('0xa')][0x6]:null;var DUPLICATES=process[_0x7b7e('0xa')][0x7]&&process[_0x7b7e('0xa')][0x7]!==_0x7b7e('0xb')&&process[_0x7b7e('0xa')][0x7]!==_0x7b7e('0xc')?process[_0x7b7e('0xa')][0x7]:null;if(!process[_0x7b7e('0xa')][0x8]||process[_0x7b7e('0xa')][0x8]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x8]===_0x7b7e('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x7b7e('0xa')][0x8];}catch(_0x43db4f){logger[_0x7b7e('0x11')](_0x43db4f);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(_0x4c0647,_0x313122,_0xbf0cb3,_0x14243b){var _0x200156={'message':_0x313122};_0x200156[_0x4c0647]=!![];if(_0xbf0cb3){_0x200156[_0x7b7e('0x12')]=_0xbf0cb3;}if(_0x14243b){_0x200156[_0x7b7e('0x13')]=_0x14243b;}return _0x200156;}function isEmail(_0x28bf43){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))*$/[_0x7b7e('0x14')](_0x28bf43);}function checkRow(_0x53bbb3,_0x5d6215,_0x4a836a){return new BPromise(function(_0x26ee14,_0x22598e){if(_[_0x7b7e('0x15')](_0x53bbb3)){return _0x22598e(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4a836a));}if(_0x53bbb3['errors']&&_0x53bbb3[_0x7b7e('0x16')][_0x7b7e('0x17')]){var _0x16a3c7=_[_0x7b7e('0x18')](_0x53bbb3[_0x7b7e('0x16')],'message')[_0x7b7e('0x19')](';');return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x16a3c7,null,_0x4a836a));}var _0x4c46b8={};for(var _0x57b9da in FIELDS){if(FIELDS['hasOwnProperty'](_0x57b9da)&&FIELDS[_0x57b9da]){_0x4c46b8[_0x57b9da]=_0x53bbb3[_0x7b7e('0x1a')][0x0][FIELDS[_0x57b9da]]||_0x53bbb3[_0x7b7e('0x1a')][0x0]['\ufeff'+FIELDS[_0x57b9da]];}}if(!_0x4c46b8['firstName']){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),'firstName\x20not\x20specified!',null,_0x4a836a));}if(!_0x4c46b8[_0x7b7e('0x1b')]){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x7b7e('0x1c'),null,_0x4a836a));}if(_0x4c46b8['birthDate']){var _0x3960b8=moment(_0x4c46b8[_0x7b7e('0x1d')],_0x7b7e('0x1e'));if(!_0x3960b8[_0x7b7e('0x1f')]()){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4a836a));}}if(_0x4c46b8[_0x7b7e('0x20')]){if(!isEmail(_0x4c46b8['email'])){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x7b7e('0x21'),null,_0x4a836a));}}_0x4c46b8[_0x7b7e('0x22')]=LISTID;_0x4c46b8[_0x7b7e('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x7b7e('0x17')]&&_0x5d6215){var _0x247ea0={};for(var _0x29cb58=0x0,_0x4bfe7f=DUPLICATES['length'];_0x29cb58<_0x4bfe7f;_0x29cb58+=0x1){_0x247ea0[DUPLICATES[_0x29cb58]]=_0x4c46b8[DUPLICATES[_0x29cb58]];}var _0xebcdbc=_[_0x7b7e('0x24')](_0x5d6215,_0x247ea0);if(_0xebcdbc){return _0x22598e(handleCheckRowError('duplicate',_0x7b7e('0x25'),_0xebcdbc,_0x4a836a));}}return db[_0x7b7e('0x26')][_0x7b7e('0x27')](_0x4c46b8,{'raw':!![],'hooks':![],'fields':_['keys'](_0x4c46b8)})[_0x7b7e('0x28')](function(_0x256908){if(DUPLICATES&&DUPLICATES[_0x7b7e('0x17')]&&_0x5d6215){_0x5d6215[_0x7b7e('0x29')](_[_0x7b7e('0x2a')](_0x4c46b8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x256908['id'];return _0x26ee14();})[_0x7b7e('0x2b')](function(_0x3e8cf4){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x7b7e('0x2c')+(_0x3e8cf4[_0x7b7e('0x2d')]||JSON[_0x7b7e('0x2e')](_0x3e8cf4)),null,_0x4a836a));});});}function checkHopper(){function _0x2d0620(){return function(_0x442366){logger[_0x7b7e('0x11')](_0x7b7e('0x2f'),_0x7b7e('0x30'),util['inspect'](_0x442366,{'showHidden':![],'depth':null}));};}var _0x8c80d5=function(_0x156dca,_0xb20532){var _0x242609=squel[_0x7b7e('0x31')]()[_0x7b7e('0x32')](_0x7b7e('0x33'))[_0x7b7e('0x34')]([_0x7b7e('0x1b'),_0x7b7e('0x35'),'ContactId',_0x7b7e('0x22'),_0xb20532,_0x7b7e('0x36'),_0x7b7e('0x37')],squel[_0x7b7e('0x38')]()['field'](_0x7b7e('0x1b'),_0x7b7e('0x1b'))[_0x7b7e('0x39')]('NOW()','scheduledAt')[_0x7b7e('0x39')]('id','ContactId')[_0x7b7e('0x39')](LISTID[_0x7b7e('0x3a')](),'ListId')[_0x7b7e('0x39')](_0x156dca['id'][_0x7b7e('0x3a')](),_0xb20532)[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x36'))[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x37'))[_0x7b7e('0x3c')]('cm_contacts')['where'](_0x7b7e('0x3d'))['where'](_0x7b7e('0x3e'),LISTID['toString']())['where'](_0x7b7e('0x3f'))['where'](_0x7b7e('0x40'),squel['select']()[_0x7b7e('0x39')](_0x7b7e('0x1b'))[_0x7b7e('0x3c')](_0x7b7e('0x33'))['where'](_0xb20532+_0x7b7e('0x41'),_0x156dca['id'][_0x7b7e('0x3a')]())))[_0x7b7e('0x3a')]();return _0x242609;};var _0x37895a=function(_0x3e4f21,_0xccdfc7){var _0x5e8572=squel['insert']()['into'](_0x7b7e('0x33'))[_0x7b7e('0x34')]([_0x7b7e('0x1b'),_0x7b7e('0x35'),_0x7b7e('0x42'),_0x7b7e('0x22'),_0xccdfc7,'createdAt',_0x7b7e('0x37')],squel[_0x7b7e('0x38')]()['field']('phone',_0x7b7e('0x1b'))[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x35'))[_0x7b7e('0x39')]('id',_0x7b7e('0x42'))['field'](LISTID[_0x7b7e('0x3a')](),'ListId')[_0x7b7e('0x39')](_0x3e4f21['id'][_0x7b7e('0x3a')](),_0xccdfc7)[_0x7b7e('0x39')](_0x7b7e('0x3b'),'createdAt')[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x37'))[_0x7b7e('0x3c')](_0x7b7e('0x43'))['where'](_0x7b7e('0x3d'))[_0x7b7e('0x44')](_0x7b7e('0x3e'),LISTID[_0x7b7e('0x3a')]())[_0x7b7e('0x44')]('id\x20IN\x20?',squel[_0x7b7e('0x45')](hopperContacts))[_0x7b7e('0x44')](_0x7b7e('0x3f'))[_0x7b7e('0x44')](_0x7b7e('0x40'),squel[_0x7b7e('0x38')]()[_0x7b7e('0x39')]('calleridnum')[_0x7b7e('0x3c')]('cm_hopper_final')[_0x7b7e('0x44')](_0xccdfc7+_0x7b7e('0x41'),_0x3e4f21['id']['toString']()))[_0x7b7e('0x44')](_0x7b7e('0x40'),squel[_0x7b7e('0x38')]()[_0x7b7e('0x39')](_0x7b7e('0x1b'))[_0x7b7e('0x3c')](_0x7b7e('0x33'))['where'](_0xccdfc7+_0x7b7e('0x41'),_0x3e4f21['id'][_0x7b7e('0x3a')]())))[_0x7b7e('0x3a')]();return _0x5e8572;};function _0x24481a(_0x5b9ab5,_0x527403){var _0x5bdf1d=squel[_0x7b7e('0x31')]()[_0x7b7e('0x32')](_0x7b7e('0x33'))['fromQuery'](['phone',_0x7b7e('0x35'),_0x7b7e('0x42'),'ListId',_0x527403,_0x7b7e('0x36'),_0x7b7e('0x37')],squel[_0x7b7e('0x38')]()['field'](_0x7b7e('0x1b'),_0x7b7e('0x1b'))['field'](_0x7b7e('0x3b'),_0x7b7e('0x35'))[_0x7b7e('0x39')]('id',_0x7b7e('0x42'))[_0x7b7e('0x39')](LISTID[_0x7b7e('0x3a')](),_0x7b7e('0x22'))[_0x7b7e('0x39')](_0x5b9ab5['id'][_0x7b7e('0x3a')](),_0x527403)['field'](_0x7b7e('0x3b'),_0x7b7e('0x36'))['field'](_0x7b7e('0x3b'),_0x7b7e('0x37'))[_0x7b7e('0x3c')]('cm_contacts')[_0x7b7e('0x44')]('deletedAt\x20IS\x20NULL')[_0x7b7e('0x44')](_0x7b7e('0x3e'),LISTID['toString']())[_0x7b7e('0x44')](_0x7b7e('0x46'),squel['str'](hopperContacts))[_0x7b7e('0x44')](_0x7b7e('0x3f')))[_0x7b7e('0x3a')]();return _0x5bdf1d;}function _0x3b1adb(_0x5eb32c,_0x101896){var _0x73904d=squel[_0x7b7e('0x31')]()[_0x7b7e('0x32')](_0x7b7e('0x47'))[_0x7b7e('0x34')]([_0x7b7e('0x1b'),_0x7b7e('0x42'),_0x7b7e('0x22'),_0x101896,_0x7b7e('0x36'),'updatedAt'],squel[_0x7b7e('0x38')]()['field']('phone',_0x7b7e('0x1b'))[_0x7b7e('0x39')]('id',_0x7b7e('0x42'))[_0x7b7e('0x39')](LISTID['toString'](),_0x7b7e('0x22'))[_0x7b7e('0x39')](_0x5eb32c['id'][_0x7b7e('0x3a')](),_0x101896)[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x36'))['field'](_0x7b7e('0x3b'),'updatedAt')['from'](_0x7b7e('0x43'))['where'](_0x7b7e('0x3d'))['where'](_0x7b7e('0x3e'),LISTID[_0x7b7e('0x3a')]())['where'](_0x7b7e('0x46'),squel[_0x7b7e('0x45')](hopperContacts))['where'](_0x7b7e('0x3f')))[_0x7b7e('0x3a')]();return _0x73904d;}return db[_0x7b7e('0x48')][_0x7b7e('0x49')]({'where':{'type':_0x7b7e('0x4a')},'attributes':['id',_0x7b7e('0x4b')],'include':[{'model':db[_0x7b7e('0x4c')],'as':_0x7b7e('0x4d'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x17e5ba){var _0x589b02=[];if(_0x17e5ba){var _0x59ecf9;for(var _0x34e7df=0x0,_0x46ac1f;_0x34e7df<_0x17e5ba[_0x7b7e('0x17')];_0x34e7df+=0x1){_0x46ac1f=_0x17e5ba[_0x34e7df][_0x7b7e('0x4e')]({'plain':!![]});switch(_0x46ac1f[_0x7b7e('0x4b')]){case _0x7b7e('0x4f'):_0x589b02[_0x7b7e('0x29')](db['sequelize'][_0x7b7e('0x50')](_0x37895a(_0x46ac1f,_0x7b7e('0x51')))['then'](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;case _0x7b7e('0x52'):_0x589b02[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x8c80d5(_0x46ac1f,_0x7b7e('0x51')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;default:_0x589b02[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x24481a(_0x46ac1f,'VoiceQueueId'))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));}}}return _0x589b02;})[_0x7b7e('0x54')]()[_0x7b7e('0x28')](function(){return db[_0x7b7e('0x48')][_0x7b7e('0x49')]({'where':{'type':_0x7b7e('0x4a')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x7b7e('0x55'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x1eb5ce){var _0x49f0a4=[];if(_0x1eb5ce){var _0x1d6aa4;for(var _0x195ae2=0x0,_0x381ee6;_0x195ae2<_0x1eb5ce[_0x7b7e('0x17')];_0x195ae2+=0x1){_0x381ee6=_0x1eb5ce[_0x195ae2][_0x7b7e('0x4e')]({'plain':!![]});_0x49f0a4['push'](db['sequelize']['query'](_0x3b1adb(_0x381ee6,_0x7b7e('0x51')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));}}return _0x49f0a4;})['all']();})[_0x7b7e('0x28')](function(){return db[_0x7b7e('0x56')][_0x7b7e('0x49')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x7b7e('0x4c')],'as':_0x7b7e('0x4d'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x34a06c){var _0x538c5f=[];if(_0x34a06c){for(var _0x315923=0x0,_0x40b4ae;_0x315923<_0x34a06c[_0x7b7e('0x17')];_0x315923+=0x1){_0x40b4ae=_0x34a06c[_0x315923][_0x7b7e('0x4e')]({'plain':!![]});switch(_0x40b4ae['dialCheckDuplicateType']){case'always':_0x538c5f[_0x7b7e('0x29')](db['sequelize'][_0x7b7e('0x50')](_0x37895a(_0x40b4ae,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;case'onlyIfOpen':_0x538c5f[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x8c80d5(_0x40b4ae,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;default:_0x538c5f[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x24481a(_0x40b4ae,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));}}}return _0x538c5f;})[_0x7b7e('0x54')]();})[_0x7b7e('0x28')](function(){return db[_0x7b7e('0x56')][_0x7b7e('0x49')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x7b7e('0x55'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x1d9e08){var _0xa03d7a=[];if(_0x1d9e08){for(var _0x10c35e=0x0,_0x302462;_0x10c35e<_0x1d9e08[_0x7b7e('0x17')];_0x10c35e+=0x1){_0x302462=_0x1d9e08[_0x10c35e]['get']({'plain':!![]});_0xa03d7a[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x3b1adb(_0x302462,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})['catch'](_0x2d0620()));}}return _0xa03d7a;})['all']();})[_0x7b7e('0x2b')](function(_0x110f2b){logger[_0x7b7e('0x11')](_0x7b7e('0x58'),_0x7b7e('0x59'),_0x110f2b[_0x7b7e('0x2d')]);});}var processPromises=function(_0x2c65b8){return BPromise[_0x7b7e('0x54')](promises)[_0x7b7e('0x28')](function(_0x850d0f){})['catch'](function(_0x27402a){logger[_0x7b7e('0x11')](_0x7b7e('0x5a'),JSON[_0x7b7e('0x2e')](_0x27402a));})[_0x7b7e('0x5b')](function(){socket[_0x7b7e('0x5c')](_0x7b7e('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2c65b8){return _0x2c65b8['resume']();}});};var endCsv=function(){return BPromise[_0x7b7e('0x5e')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x7b7e('0x28')](function(){socket[_0x7b7e('0x5c')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x7b7e('0x5f')](FILEPATH);}catch(_0x38fd40){logger[_0x7b7e('0x11')](_0x7b7e('0x60'),JSON[_0x7b7e('0x2e')](_0x38fd40));}finally{process['exit'](0x0);}});};process['on'](_0x7b7e('0x61'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x7b7e('0x5e')]()[_0x7b7e('0x28')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7b7e('0x10')](',');return db[_0x7b7e('0x26')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x7b7e('0x28')](function(_0x5cedd4){var _0x25233a=fs[_0x7b7e('0x62')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x7b7e('0x63')](_0x25233a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1e71ab,_0x11d615){total+=0x1;var _0x3afd15=total;promises[_0x7b7e('0x29')](checkRow(_0x1e71ab,_0x5cedd4,_0x3afd15)['then'](function(){success+=0x1;})[_0x7b7e('0x2b')](function(_0x30eeee){if(_0x30eeee['error']){errors+=0x1;delete _0x30eeee[_0x7b7e('0x11')];}else if(_0x30eeee[_0x7b7e('0x64')]){duplicates+=0x1;delete _0x30eeee[_0x7b7e('0x64')];}rows[_0x7b7e('0x29')](_0x30eeee);}));if(total%0xc8===0x0){_0x11d615[_0x7b7e('0x65')]();return processPromises(_0x11d615);}},'complete':function(){return processPromises()[_0x7b7e('0x28')](function(){logger[_0x7b7e('0x66')](_0x7b7e('0x67'));endCsv();});},'error':function(_0x41e2b5,_0x97232d){logger[_0x7b7e('0x66')](_0x7b7e('0x68'),JSON[_0x7b7e('0x2e')](_0x41e2b5));endCsv();}});})[_0x7b7e('0x2b')](function(_0x12d0cb){logger[_0x7b7e('0x11')](_0x7b7e('0x69'),JSON[_0x7b7e('0x2e')](_0x12d0cb));});}main(); \ No newline at end of file +var _0xa9e0=['CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','str','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','onlyIfOpen','query','catch','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','emit','unlinkSync','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate'];(function(_0x35eb5e,_0x95d354){var _0x1aaade=function(_0x4901b0){while(--_0x4901b0){_0x35eb5e['push'](_0x35eb5e['shift']());}};_0x1aaade(++_0x95d354);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0a9e('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var socket=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x0a9e('0xb')][0x2]||process['argv'][0x2]==='undefined'||process[_0x0a9e('0xb')][0x2]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xd'));}var FILEPATH=process[_0x0a9e('0xb')][0x2];if(!process[_0x0a9e('0xb')][0x3]||process[_0x0a9e('0xb')][0x3]==='undefined'||process['argv'][0x3]==='null'||!process['argv'][0x4]||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xf'));}var FIELDS=_[_0x0a9e('0x10')](process['argv'][0x3][_0x0a9e('0x11')](','),process[_0x0a9e('0xb')][0x4][_0x0a9e('0x11')](','));if(!process[_0x0a9e('0xb')][0x5]||process[_0x0a9e('0xb')][0x5]===_0x0a9e('0xe')||process['argv'][0x5]===_0x0a9e('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x0a9e('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x0a9e('0xb')][0x6]!==_0x0a9e('0xe')&&process['argv'][0x6]!==_0x0a9e('0xc')?process['argv'][0x6]:null;var DUPLICATES=process[_0x0a9e('0xb')][0x7]&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xe')&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xc')?process[_0x0a9e('0xb')][0x7]:null;if(!process[_0x0a9e('0xb')][0x8]||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x2c3407){logger[_0x0a9e('0x13')](_0x2c3407);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x53682f,_0x20f109,_0x5a09ef,_0x588269){var _0x3a02e1={'message':_0x20f109};_0x3a02e1[_0x53682f]=!![];if(_0x5a09ef){_0x3a02e1[_0x0a9e('0x14')]=_0x5a09ef;}if(_0x588269){_0x3a02e1[_0x0a9e('0x15')]=_0x588269;}return _0x3a02e1;}function isEmail(_0x30bae6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x30bae6);}function checkRow(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return new BPromise(function(_0x4d00e6,_0x370d86){if(_[_0x0a9e('0x16')](_0xfb6e48)){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3b45bc));}if(_0xfb6e48['errors']&&_0xfb6e48[_0x0a9e('0x17')][_0x0a9e('0x18')]){var _0x40c424=_[_0x0a9e('0x19')](_0xfb6e48['errors'],_0x0a9e('0x1a'))['join'](';');return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x40c424,null,_0x3b45bc));}var _0x5bfb33={};for(var _0x1dc186 in FIELDS){if(FIELDS[_0x0a9e('0x1b')](_0x1dc186)&&FIELDS[_0x1dc186]){_0x5bfb33[_0x1dc186]=_0xfb6e48[_0x0a9e('0x1c')][0x0][FIELDS[_0x1dc186]]||_0xfb6e48[_0x0a9e('0x1c')][0x0]['\ufeff'+FIELDS[_0x1dc186]];}}if(!_0x5bfb33[_0x0a9e('0x1d')]){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x1e'),null,_0x3b45bc));}if(!_0x5bfb33[_0x0a9e('0x1f')]){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x20'),null,_0x3b45bc));}if(_0x5bfb33[_0x0a9e('0x21')]){var _0x2b1f27=moment(_0x5bfb33[_0x0a9e('0x21')],'YYYY-MM-DD');if(!_0x2b1f27[_0x0a9e('0x22')]()){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x23'),null,_0x3b45bc));}}if(_0x5bfb33[_0x0a9e('0x24')]){if(!isEmail(_0x5bfb33[_0x0a9e('0x24')])){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x25'),null,_0x3b45bc));}}_0x5bfb33[_0x0a9e('0x26')]=LISTID;_0x5bfb33[_0x0a9e('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2fb0e4){var _0x426950={};for(var _0x5d1e0e=0x0,_0x2407f9=DUPLICATES[_0x0a9e('0x18')];_0x5d1e0e<_0x2407f9;_0x5d1e0e+=0x1){_0x426950[DUPLICATES[_0x5d1e0e]]=_0x5bfb33[DUPLICATES[_0x5d1e0e]];}var _0x1122db=_[_0x0a9e('0x28')](_0x2fb0e4,_0x426950);if(_0x1122db){return _0x370d86(handleCheckRowError(_0x0a9e('0x29'),'Duplicate\x20Contact',_0x1122db,_0x3b45bc));}}return db[_0x0a9e('0x2a')][_0x0a9e('0x2b')](_0x5bfb33,{'raw':!![],'hooks':![],'fields':_[_0x0a9e('0x2c')](_0x5bfb33)})[_0x0a9e('0x2d')](function(_0x2b45ea){if(DUPLICATES&&DUPLICATES[_0x0a9e('0x18')]&&_0x2fb0e4){_0x2fb0e4[_0x0a9e('0x2e')](_[_0x0a9e('0x2f')](_0x5bfb33,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2b45ea['id'];return _0x4d00e6();})['catch'](function(_0x44295a){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x30')+(_0x44295a[_0x0a9e('0x1a')]||JSON[_0x0a9e('0x31')](_0x44295a)),null,_0x3b45bc));});});}function checkHopper(){function _0x3f3d41(){return function(_0x567193){logger[_0x0a9e('0x13')](_0x0a9e('0x32'),_0x0a9e('0x33'),util[_0x0a9e('0x34')](_0x567193,{'showHidden':![],'depth':null}));};}var _0x4853b1=function(_0x54135e,_0x1e8694){var _0x5640eb=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')](['phone',_0x0a9e('0x39'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x1e8694,'createdAt',_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')]('phone','phone')[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),'ListId')['field'](_0x54135e['id'][_0x0a9e('0x3f')](),_0x1e8694)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')](_0x0a9e('0x46'))[_0x0a9e('0x43')](_0x0a9e('0x47'),squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')['where'](_0x1e8694+_0x0a9e('0x48'),_0x54135e['id'][_0x0a9e('0x3f')]())))[_0x0a9e('0x3f')]();return _0x5640eb;};var _0x315881=function(_0x1a69dd,_0xc9a702){var _0x10b040=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),'scheduledAt',_0x0a9e('0x3a'),_0x0a9e('0x26'),_0xc9a702,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x1a69dd['id'][_0x0a9e('0x3f')](),_0xc9a702)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x3b'))[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')]('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x4a'))[_0x0a9e('0x41')](_0x0a9e('0x4b'))[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id'][_0x0a9e('0x3f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id']['toString']())))['toString']();return _0x10b040;};function _0x2ef381(_0x59c6ff,_0x443e72){var _0x4c3845=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))['fromQuery']([_0x0a9e('0x1f'),_0x0a9e('0x39'),'ContactId','ListId',_0x443e72,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')]('phone',_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')['field']('id','ContactId')[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x59c6ff['id'][_0x0a9e('0x3f')](),_0x443e72)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID['toString']())[_0x0a9e('0x43')](_0x0a9e('0x4c'),squel['str'](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x0a9e('0x3f')]();return _0x4c3845;}function _0x5ba1f9(_0x4b3c1a,_0x5674ee){var _0x273cb5=squel['insert']()[_0x0a9e('0x36')](_0x0a9e('0x4d'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x5674ee,'createdAt',_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field']('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),_0x0a9e('0x26'))['field'](_0x4b3c1a['id'][_0x0a9e('0x3f')](),_0x5674ee)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x3b'))[_0x0a9e('0x41')]('cm_contacts')[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')]('ListId\x20=\x20?',LISTID[_0x0a9e('0x3f')]())['where']('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')](_0x0a9e('0x46')))[_0x0a9e('0x3f')]();return _0x273cb5;}return db[_0x0a9e('0x4e')][_0x0a9e('0x4f')]({'where':{'type':_0x0a9e('0x50')},'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x53'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x19012b){var _0x2bbb86=[];if(_0x19012b){var _0x2b8192;for(var _0x320898=0x0,_0x412a72;_0x320898<_0x19012b[_0x0a9e('0x18')];_0x320898+=0x1){_0x412a72=_0x19012b[_0x320898][_0x0a9e('0x54')]({'plain':!![]});switch(_0x412a72['dialCheckDuplicateType']){case _0x0a9e('0x55'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x315881(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x4853b1(_0x412a72,_0x0a9e('0x57')))['then'](function(){})['catch'](_0x3f3d41()));break;default:_0x2bbb86['push'](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x2ef381(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}}return _0x2bbb86;})[_0x0a9e('0x5b')]()[_0x0a9e('0x2d')](function(){return db[_0x0a9e('0x4e')]['findAll']({'where':{'type':_0x0a9e('0x50')},'attributes':['id'],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x2bdc44){var _0x583b2e=[];if(_0x2bdc44){var _0x4437ff;for(var _0x44351d=0x0,_0x4c46c1;_0x44351d<_0x2bdc44[_0x0a9e('0x18')];_0x44351d+=0x1){_0x4c46c1=_0x2bdc44[_0x44351d][_0x0a9e('0x54')]({'plain':!![]});_0x583b2e[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x5ba1f9(_0x4c46c1,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x583b2e;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x3511c9){var _0x30a4c7=[];if(_0x3511c9){for(var _0xf410e5=0x0,_0x332367;_0xf410e5<_0x3511c9[_0x0a9e('0x18')];_0xf410e5+=0x1){_0x332367=_0x3511c9[_0xf410e5][_0x0a9e('0x54')]({'plain':!![]});switch(_0x332367[_0x0a9e('0x51')]){case _0x0a9e('0x55'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x315881(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x4853b1(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));break;default:_0x30a4c7[_0x0a9e('0x2e')](db['sequelize']['query'](_0x2ef381(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));}}}return _0x30a4c7;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x2d2286){var _0x42b959=[];if(_0x2d2286){for(var _0x3755fe=0x0,_0x1f42a0;_0x3755fe<_0x2d2286[_0x0a9e('0x18')];_0x3755fe+=0x1){_0x1f42a0=_0x2d2286[_0x3755fe]['get']({'plain':!![]});_0x42b959[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x5ba1f9(_0x1f42a0,_0x0a9e('0x5e')))['then'](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x42b959;})[_0x0a9e('0x5b')]();})['catch'](function(_0x1d6834){logger['error'](_0x0a9e('0x5f'),_0x0a9e('0x60'),_0x1d6834[_0x0a9e('0x1a')]);});}var processPromises=function(_0x385d52){return BPromise['all'](promises)['then'](function(_0x353384){})[_0x0a9e('0x5a')](function(_0x94dcf5){logger['error'](_0x0a9e('0x61'),JSON[_0x0a9e('0x31')](_0x94dcf5));})['finally'](function(){socket['emit'](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x385d52){return _0x385d52['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0a9e('0x2d')](function(){socket[_0x0a9e('0x63')](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0a9e('0x64')](FILEPATH);}catch(_0x3c6dd6){logger[_0x0a9e('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x0a9e('0x31')](_0x3c6dd6));}finally{process['exit'](0x0);}});};process['on'](_0x0a9e('0x65'),function(){logger[_0x0a9e('0x66')](_0x0a9e('0x67'));endCsv();});function main(){return BPromise[_0x0a9e('0x68')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0a9e('0x11')](',');return db[_0x0a9e('0x2a')][_0x0a9e('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0xb6e411){var _0x21e592=fs[_0x0a9e('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0a9e('0x6a')](_0x21e592,{'header':!![],'skipEmptyLines':!![],'step':function(_0x255e49,_0x1910bf){total+=0x1;var _0x32b9bd=total;promises[_0x0a9e('0x2e')](checkRow(_0x255e49,_0xb6e411,_0x32b9bd)['then'](function(){success+=0x1;})[_0x0a9e('0x5a')](function(_0x3325c5){if(_0x3325c5['error']){errors+=0x1;delete _0x3325c5[_0x0a9e('0x13')];}else if(_0x3325c5[_0x0a9e('0x29')]){duplicates+=0x1;delete _0x3325c5[_0x0a9e('0x29')];}rows['push'](_0x3325c5);}));if(total%0xc8===0x0){_0x1910bf[_0x0a9e('0x6b')]();return processPromises(_0x1910bf);}},'complete':function(){return processPromises()['then'](function(){logger[_0x0a9e('0x66')](_0x0a9e('0x6c'));endCsv();});},'error':function(_0x558a87,_0x1f29bd){logger[_0x0a9e('0x66')](_0x0a9e('0x6d'),JSON[_0x0a9e('0x31')](_0x558a87));endCsv();}});})[_0x0a9e('0x5a')](function(_0x501050){logger[_0x0a9e('0x13')](_0x0a9e('0x6e'),JSON[_0x0a9e('0x31')](_0x501050));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 5defddb..65a62de 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 _0xd008=['fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.updatedAt','cm_hopper_black','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','cm_contacts','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','error','message','exit','errors','push','code','sequelize','query','catch','info','main','stringify','send','start','binding','root','server/files/tmp','header','writeFileSync','createReadStream','data','length','rows','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','then','finish','affectedRows','contact:import:','complete','argv','file\x20doesn\x27t\x20exists','parse','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','insert','into','cm_hopper'];(function(_0x5547a5,_0x13f2ee){var _0x33be23=function(_0x39284c){while(--_0x39284c){_0x5547a5['push'](_0x5547a5['shift']());}};_0x33be23(++_0x13f2ee);}(_0xd008,0x1e5));var _0x8d00=function(_0x902a16,_0xd7abbc){_0x902a16=_0x902a16-0x0;var _0x23ee6c=_0xd008[_0x902a16];return _0x23ee6c;};'use strict';var fs=require('fs');var path=require(_0x8d00('0x0'));var _=require(_0x8d00('0x1'));var Papa=require('papaparse');var util=require(_0x8d00('0x2'));var BPromise=require(_0x8d00('0x3'));var moment=require('moment');var squel=require(_0x8d00('0x4'));var Redis=require(_0x8d00('0x5'));var db=require(_0x8d00('0x6'))['db'];var config=require(_0x8d00('0x7'));var logger=require(_0x8d00('0x8'))(_0x8d00('0x9'));config[_0x8d00('0xa')]=_[_0x8d00('0xb')](config['redis'],{'host':_0x8d00('0xc'),'port':0x18eb});var socket=require(_0x8d00('0xd'))(new Redis(config[_0x8d00('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x8d00('0xe'));function isEmail(_0x5f14ec){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'](_0x5f14ec);}function selectNotIn(_0x5684bf,_0x29c2f5,_0x1fd0c9,_0x2989a5,_0x30c311){return squel[_0x8d00('0xf')]()[_0x8d00('0x10')](_0x8d00('0x11'))[_0x8d00('0x12')](_0x2989a5)[_0x8d00('0x13')](_0x29c2f5,null,_0x29c2f5+_0x8d00('0x14')+_0x2989a5+'.'+_0x1fd0c9)['where'](_0x2989a5+'.'+_0x1fd0c9+'\x20=\x20'+_0x5684bf+'.'+_0x1fd0c9)[_0x8d00('0x15')](_0x29c2f5+_0x8d00('0x16')+_0x30c311[_0x8d00('0x13')]()+')');}function insertCmHopper(_0x56e5dc,_0x370b3d,_0x36381b,_0x33ece9,_0x22729d){var _0x504755=[_0x8d00('0x17'),_0x8d00('0x18'),_0x8d00('0x19'),_0x8d00('0x1a'),_0x370b3d+'.'+_0x33ece9,_0x8d00('0x1b'),'cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','\x22'+_0x22729d+'\x22'];return squel[_0x8d00('0x1c')]()[_0x8d00('0x1d')](_0x8d00('0x1e'))[_0x8d00('0x1f')]([_0x8d00('0x11'),_0x8d00('0x20'),_0x8d00('0x21'),_0x8d00('0x22'),_0x33ece9,_0x8d00('0x23'),_0x8d00('0x24'),_0x8d00('0x25'),_0x8d00('0x26'),'recallme'],squel[_0x8d00('0xf')]()[_0x8d00('0x27')](_0x504755)[_0x8d00('0x12')](_0x370b3d)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x370b3d+_0x8d00('0x28'))[_0x8d00('0x13')](_0x36381b,null,_0x36381b+_0x8d00('0x14')+_0x370b3d+'.'+_0x33ece9)[_0x8d00('0x15')](_0x370b3d+'.CmListId\x20=\x20?',_0x56e5dc)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x8d00('0x29'),selectNotIn(_0x370b3d,_0x36381b,_0x33ece9,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))[_0x8d00('0x15')](_0x8d00('0x29'),selectNotIn(_0x370b3d,_0x36381b,_0x33ece9,'cm_hopper',[_0x8d00('0x2a')])))[_0x8d00('0x2b')]();}function insertCmHopperBlack(_0xf08289,_0x5d7dd6,_0x48a004,_0xd08653){var _0x1a17e4=['cm_contacts.phone','cm_contacts.id',_0x8d00('0x1a'),_0x5d7dd6+'.'+_0xd08653,'cm_contacts.createdAt',_0x8d00('0x2c')];return squel[_0x8d00('0x1c')]()[_0x8d00('0x1d')](_0x8d00('0x2d'))[_0x8d00('0x1f')]([_0x8d00('0x11'),_0x8d00('0x21'),_0x8d00('0x22'),_0xd08653,_0x8d00('0x23'),'updatedAt'],squel[_0x8d00('0xf')]()[_0x8d00('0x27')](_0x1a17e4)[_0x8d00('0x12')](_0x5d7dd6)[_0x8d00('0x13')]('cm_contacts',null,_0x8d00('0x2e')+_0x5d7dd6+_0x8d00('0x28'))[_0x8d00('0x13')](_0x48a004,null,_0x48a004+_0x8d00('0x14')+_0x5d7dd6+'.'+_0xd08653)[_0x8d00('0x15')](_0x5d7dd6+_0x8d00('0x2f'),_0xf08289)[_0x8d00('0x15')](_0x8d00('0x30'),NOW)[_0x8d00('0x15')](_0x8d00('0x29'),squel[_0x8d00('0xf')]()[_0x8d00('0x10')](_0x8d00('0x11'))[_0x8d00('0x12')](_0x8d00('0x2d'))['where'](_0x8d00('0x31'),_0xf08289)[_0x8d00('0x15')](_0xd08653+_0x8d00('0x32'),_0x5d7dd6+'.'+_0xd08653)))[_0x8d00('0x2b')]();}function insertCmContact(_0x1ac379,_0xb2631b,_0x4577e3,_0x5f36c8){var _0x415696=_['concat'](_[_0x8d00('0x33')](_0x5f36c8),[_0x8d00('0x22'),_0x8d00('0x34'),_0x8d00('0x23'),_0x8d00('0x24')]);return squel['insert']()[_0x8d00('0x1d')]('cm_contacts')[_0x8d00('0x1f')](_0x415696,squel[_0x8d00('0xf')]()[_0x8d00('0x27')](_0x415696)[_0x8d00('0x12')](_0xb2631b)['where']('('+_0x4577e3[_0x8d00('0x13')](',')+_0x8d00('0x35'),squel[_0x8d00('0xf')]()[_0x8d00('0x27')](_0x4577e3)[_0x8d00('0x12')](_0x8d00('0x36'))[_0x8d00('0x15')](_0x8d00('0x31'),_0x1ac379)[_0x8d00('0x15')](_0x8d00('0x37')))['where'](_0x8d00('0x38'),squel[_0x8d00('0xf')]()['field'](_0x8d00('0x39'),_0x8d00('0x3a'))[_0x8d00('0x12')](_0xb2631b)[_0x8d00('0x3b')](_0x4577e3['join'](','))))[_0x8d00('0x2b')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x41d5f3){logger[_0x8d00('0x3c')](_0x41d5f3[_0x8d00('0x3d')]);process[_0x8d00('0x3e')](0x1);}function handleError(_0x5606bd,_0x2c5238){stats[_0x8d00('0x3f')][_0x8d00('0x40')]({'name':_0x2c5238[_0x8d00('0x41')],'message':_0x2c5238[_0x8d00('0x3d')],'row':_0x5606bd});}function handleQuery(_0x38cc6e){logger['info'](_0x38cc6e);return db[_0x8d00('0x42')][_0x8d00('0x43')](_0x38cc6e)['spread'](function(_0x7e234a){results[_0x8d00('0x40')](_0x7e234a);})[_0x8d00('0x44')](function(_0xf74384){logger[_0x8d00('0x3c')](_0xf74384[_0x8d00('0x3d')]);});}function main(_0x2c7c22,_0x5ebb61,_0x484640,_0x1a2916){logger[_0x8d00('0x45')](_0x8d00('0x46'),_0x2c7c22,JSON[_0x8d00('0x47')](_0x5ebb61));process[_0x8d00('0x48')](_0x8d00('0x49'));var _0xe02eaf=_0x5ebb61[_0x8d00('0x4a')];var _0x346f2a=_0x5ebb61['socket_timestamp'];var _0x4986d7=path[_0x8d00('0x13')](config[_0x8d00('0x4b')],_0x8d00('0x4c'),_0x346f2a+'.csv');var _0x1c3202=_[_0x8d00('0x33')](_0xe02eaf)[_0x8d00('0x13')]();logger[_0x8d00('0x45')](_0x8d00('0x4d'),_0x1c3202);fs[_0x8d00('0x4e')](_0x4986d7,_0x1c3202+'\x0a');Papa['parse'](fs[_0x8d00('0x4f')](_0x2c7c22),{'header':!![],'skipEmptyLines':!![],'step':function(_0x41d7f2,_0x5f5cdd){try{for(var _0x5d2c73=0x0,_0x244a2b=[];_0x5d2c73<_0x41d7f2[_0x8d00('0x50')][_0x8d00('0x51')];_0x5d2c73++){stats[_0x8d00('0x52')]+=0x1;if(_0x41d7f2['errors'][_0x5d2c73]){handleError(_0x41d7f2[_0x8d00('0x50')][_0x5d2c73],_0x41d7f2[_0x8d00('0x3f')][_0x5d2c73]);}else{var _0x48d421=[];for(var _0x192346 in _0xe02eaf){if(_0xe02eaf[_0x8d00('0x53')](_0x192346)){if(_0x41d7f2[_0x8d00('0x50')][_0x5d2c73][_0xe02eaf[_0x192346]]){var _0x1c8785=_[_0x8d00('0x54')](_0x41d7f2[_0x8d00('0x50')][_0x5d2c73][_0xe02eaf[_0x192346]][_0x8d00('0x55')](/"/g,'\x27'));switch(_0x192346){case _0x8d00('0x20'):var _0x18282f=moment(_0x1c8785,_0x8d00('0xe'),!![]);if(_0x18282f[_0x8d00('0x56')]()){_0x244a2b[_0x8d00('0x40')]('\x22'+_0x1c8785+'\x22');}else{_0x48d421[_0x8d00('0x40')](_0x8d00('0x57'));}break;case _0x8d00('0x25'):var _0x1434ad=parseInt(_0x1c8785);_0x1c8785=_['isNaN'](_0x1434ad)||_0x1434ad<0x0||_0x1434ad>0x4?_0x1a2916?0x3:0x2:_0x1434ad;_0x244a2b[_0x8d00('0x40')]('\x22'+_0x1c8785+'\x22');break;case _0x8d00('0x26'):var _0x103d65=parseInt(_0x1c8785);if(_[_0x8d00('0x58')](_0x103d65)&&_[_0x8d00('0x59')](_0x484640,_0x103d65)){_0x244a2b['push']('\x22'+_0x103d65+'\x22');}else{_0x48d421[_0x8d00('0x40')](_0x8d00('0x5a'));}break;case _0x8d00('0x5b'):if(isEmail(_0x1c8785)){_0x244a2b[_0x8d00('0x40')]('\x22'+_0x1c8785+'\x22');}else{_0x48d421[_0x8d00('0x40')](_0x8d00('0x5c'));}break;case'dateOfBirth':var _0x6a995d=moment(_0x1c8785,_0x8d00('0x5d'),!![]);if(_0x6a995d['isValid']()){_0x244a2b[_0x8d00('0x40')]('\x22'+_0x1c8785+'\x22');}else{_0x48d421[_0x8d00('0x40')](_0x8d00('0x5e'));}break;default:_0x244a2b[_0x8d00('0x40')]('\x22'+_0x1c8785+'\x22');}}else{switch(_0x192346){case _0x8d00('0x5f'):case'phone':_0x48d421[_0x8d00('0x40')](_0x192346+_0x8d00('0x60'));break;default:_0x244a2b[_0x8d00('0x40')]('\x22\x22');}}}}if(_0x48d421[_0x8d00('0x51')]){handleError(_0x41d7f2[_0x8d00('0x50')][_0x5d2c73],{'code':_0x8d00('0x61'),'message':_0x48d421[_0x8d00('0x13')]()});}else{fs['appendFileSync'](_0x4986d7,_0x244a2b[_0x8d00('0x13')]()+'\x0a');}_0x244a2b=[];}if(!(stats[_0x8d00('0x52')]%0xc8)){socket[_0x8d00('0x62')]('contact:import:'+_0x346f2a,stats);stats[_0x8d00('0x3f')]=[];}}if(stopped){logger[_0x8d00('0x45')](_0x8d00('0x63'));_0x5f5cdd[_0x8d00('0x64')]();}}catch(_0x2fee0e){handleError(_0x41d7f2[_0x8d00('0x50')][_0x5d2c73],{'code':_0x8d00('0x65'),'message':_0x2fee0e[_0x8d00('0x3d')]});logger[_0x8d00('0x3c')](_0x8d00('0x66'),_0x2fee0e[_0x8d00('0x3d')]);}},'complete':function(){try{var _0x25e25e=[];var _0x592a17=_0x8d00('0x36');if(_0x5ebb61[_0x8d00('0x67')]&&_0x5ebb61[_0x8d00('0x67')][_0x8d00('0x51')]){_0x592a17=_0x8d00('0x68')+_0x346f2a;_0x25e25e[_0x8d00('0x40')](_0x8d00('0x69')+_0x592a17+_0x8d00('0x6a'));}var _0x2bfdd1=util['format'](_0x8d00('0x6b'),_0x4986d7,_0x592a17,_0x1c3202,_0x5ebb61['ListId'],_0x5ebb61[_0x8d00('0x34')]||null,NOW,NOW);if(_['isNil'](_0xe02eaf[_0x8d00('0x20')])){_0x2bfdd1+=_0x8d00('0x6c');}_0x25e25e[_0x8d00('0x40')](_0x2bfdd1);if(_0x5ebb61[_0x8d00('0x67')]&&_0x5ebb61[_0x8d00('0x67')][_0x8d00('0x51')]){_0x25e25e[_0x8d00('0x40')](insertCmContact(_0x5ebb61[_0x8d00('0x22')],_0x592a17,_0x5ebb61[_0x8d00('0x67')],_0xe02eaf));_0x25e25e['push'](_0x8d00('0x6d')+_0x592a17+';');}_0x25e25e[_0x8d00('0x40')](insertCmHopper(_0x5ebb61[_0x8d00('0x22')],_0x8d00('0x6e'),_0x8d00('0x6f'),'VoiceQueueId',_0x1a2916));_0x25e25e['push'](insertCmHopperBlack(_0x5ebb61[_0x8d00('0x22')],'voice_queues_has_cm_blacklists',_0x8d00('0x6f'),_0x8d00('0x70')));_0x25e25e[_0x8d00('0x40')](insertCmHopper(_0x5ebb61[_0x8d00('0x22')],'campaigns_has_cm_lists',_0x8d00('0x71'),_0x8d00('0x72'),_0x1a2916));_0x25e25e[_0x8d00('0x40')](insertCmHopperBlack(_0x5ebb61['ListId'],_0x8d00('0x73'),'campaigns','CampaignId'));BPromise['each'](_0x25e25e,handleQuery)[_0x8d00('0x74')](function(_0x35a591){stats[_0x8d00('0x75')]=!![];stats[_0x8d00('0x76')]=_0x5ebb61[_0x8d00('0x67')]&&_0x5ebb61[_0x8d00('0x67')]['length']?results[0x2][_0x8d00('0x76')]:results[0x0][_0x8d00('0x76')];socket[_0x8d00('0x62')](_0x8d00('0x77')+_0x346f2a,stats);fs['unlink'](_0x2c7c22);fs['unlink'](_0x4986d7);process[_0x8d00('0x3e')](0x0);})['catch'](function(_0x3797ce){logger['error'](_0x3797ce[_0x8d00('0x3d')]);process[_0x8d00('0x3e')](0x1);});}catch(_0x5f20c9){logger['error'](_0x8d00('0x78'),_0x5f20c9[_0x8d00('0x3d')]);process['exit'](0x1);}},'error':function(_0x510baf,_0x4ad54b,_0x2d90f1,_0x317d71){throw new Error(_0x317d71);}});}function validate(){if(process[_0x8d00('0x79')]&&process[_0x8d00('0x79')][_0x8d00('0x51')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x4a2071=path[_0x8d00('0x13')](config['root'],'server/files/tmp',process['argv'][0x2]);if(!fs['existsSync'](_0x4a2071)){throw new Error(_0x8d00('0x7a'));}var _0x40678b={};try{_0x40678b=JSON[_0x8d00('0x7b')](process['argv'][0x3]);if(!_0x40678b[_0x8d00('0x4a')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x40678b[_0x8d00('0x4a')][_0x8d00('0x11')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x40678b['binding'][_0x8d00('0x5f')]){throw new Error(_0x8d00('0x7c'));}var _0x4a2c7d=0x0;if(_0x40678b['binding']['UserId']){_0x4a2c7d=0x1;}if(!_0x40678b[_0x8d00('0x22')]){throw new Error(_0x8d00('0x7d'));}}catch(_0x1f46f9){throw new Error('body\x20id\x20mandatory');}var _0x435465=[];try{_0x435465=_[_0x8d00('0x7e')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x4712ed){logger[_0x8d00('0x45')](_0x8d00('0x7f'));}main(_0x4a2071,_0x40678b,_0x435465,_0x4a2c7d);}validate();process['on']('SIGINT',handleStop);process['on'](_0x8d00('0x80'),handleUncaughtException); \ No newline at end of file +var _0x0cc7=['deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','message','errors','push','code','info','sequelize','query','spread','catch','send','start','socket_timestamp','root','server/files/tmp','.csv','header','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','exit','error','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','binding','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','socket.io-emitter','format','select','field','from','join','.id\x20=\x20','where','\x20=\x20','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','cm_contacts.ListId','cm_hopper_black','.CmListId','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?'];(function(_0x35b38b,_0xf4b410){var _0x41b107=function(_0x4590b5){while(--_0x4590b5){_0x35b38b['push'](_0x35b38b['shift']());}};_0x41b107(++_0xf4b410);}(_0x0cc7,0x1f3));var _0x70cc=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x0cc7[_0xa8883];return _0x479426;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x70cc('0x0'));var Papa=require(_0x70cc('0x1'));var util=require(_0x70cc('0x2'));var BPromise=require(_0x70cc('0x3'));var moment=require(_0x70cc('0x4'));var squel=require('squel');var Redis=require(_0x70cc('0x5'));var db=require(_0x70cc('0x6'))['db'];var config=require(_0x70cc('0x7'));var logger=require('../../../config/logger')(_0x70cc('0x8'));config[_0x70cc('0x9')]=_[_0x70cc('0xa')](config[_0x70cc('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x70cc('0xb'))(new Redis(config[_0x70cc('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x70cc('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x23adba){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'](_0x23adba);}function selectNotIn(_0x30c029,_0x3ccd5d,_0x2c1ad2,_0x47f55c,_0x5d4656){return squel[_0x70cc('0xd')]()[_0x70cc('0xe')]('phone')[_0x70cc('0xf')](_0x47f55c)[_0x70cc('0x10')](_0x3ccd5d,null,_0x3ccd5d+_0x70cc('0x11')+_0x47f55c+'.'+_0x2c1ad2)[_0x70cc('0x12')](_0x47f55c+'.'+_0x2c1ad2+_0x70cc('0x13')+_0x30c029+'.'+_0x2c1ad2)[_0x70cc('0x12')](_0x3ccd5d+'.dialCheckDuplicateType\x20IN\x20('+_0x5d4656[_0x70cc('0x10')]()+')');}function insertCmHopper(_0x3466f1,_0x5041b5,_0x242d09,_0x57281b,_0x54544b){var _0x5ceb6b=['cm_contacts.phone',_0x70cc('0x14'),_0x70cc('0x15'),'cm_contacts.ListId',_0x5041b5+'.'+_0x57281b,_0x70cc('0x16'),_0x70cc('0x17'),_0x70cc('0x18'),_0x70cc('0x19'),'\x22'+_0x54544b+'\x22'];return squel[_0x70cc('0x1a')]()[_0x70cc('0x1b')](_0x70cc('0x1c'))[_0x70cc('0x1d')]([_0x70cc('0x1e'),_0x70cc('0x1f'),_0x70cc('0x20'),_0x70cc('0x21'),_0x57281b,_0x70cc('0x22'),_0x70cc('0x23'),_0x70cc('0x24'),_0x70cc('0x25'),_0x70cc('0x26')],squel[_0x70cc('0xd')]()[_0x70cc('0x27')](_0x5ceb6b)[_0x70cc('0xf')](_0x5041b5)[_0x70cc('0x10')](_0x70cc('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x5041b5+'.CmListId')['join'](_0x242d09,null,_0x242d09+'.id\x20=\x20'+_0x5041b5+'.'+_0x57281b)[_0x70cc('0x12')](_0x5041b5+_0x70cc('0x29'),_0x3466f1)[_0x70cc('0x12')](_0x70cc('0x2a'),NOW)['where'](_0x70cc('0x2b'),selectNotIn(_0x5041b5,_0x242d09,_0x57281b,_0x70cc('0x1c'),['\x22always\x22','\x22onlyIfOpen\x22']))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5041b5,_0x242d09,_0x57281b,_0x70cc('0x1c'),['\x22always\x22'])))[_0x70cc('0x2c')]();}function insertCmHopperBlack(_0x1f7019,_0x5954e1,_0x145e24,_0x3aa11c){var _0x3bf8b2=[_0x70cc('0x2d'),'cm_contacts.id',_0x70cc('0x2e'),_0x5954e1+'.'+_0x3aa11c,_0x70cc('0x16'),_0x70cc('0x17')];return squel[_0x70cc('0x1a')]()[_0x70cc('0x1b')](_0x70cc('0x2f'))[_0x70cc('0x1d')](['phone',_0x70cc('0x20'),_0x70cc('0x21'),_0x3aa11c,_0x70cc('0x22'),_0x70cc('0x23')],squel[_0x70cc('0xd')]()['fields'](_0x3bf8b2)[_0x70cc('0xf')](_0x5954e1)[_0x70cc('0x10')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x5954e1+_0x70cc('0x30'))[_0x70cc('0x10')](_0x145e24,null,_0x145e24+'.id\x20=\x20'+_0x5954e1+'.'+_0x3aa11c)[_0x70cc('0x12')](_0x5954e1+'.CmListId\x20=\x20?',_0x1f7019)[_0x70cc('0x12')](_0x70cc('0x2a'),NOW)[_0x70cc('0x12')](_0x70cc('0x2b'),squel['select']()[_0x70cc('0xe')](_0x70cc('0x1e'))['from'](_0x70cc('0x2f'))[_0x70cc('0x12')]('ListId\x20=\x20?',_0x1f7019)[_0x70cc('0x12')](_0x3aa11c+_0x70cc('0x31'),_0x5954e1+'.'+_0x3aa11c)))[_0x70cc('0x2c')]();}function insertCmContact(_0x5dea9c,_0x183dc1,_0x9ffdf2,_0x46c3aa){var _0x5c5b13=_['concat'](_[_0x70cc('0x32')](_0x46c3aa),[_0x70cc('0x21'),_0x70cc('0x33'),_0x70cc('0x22'),_0x70cc('0x23')]);return squel[_0x70cc('0x1a')]()[_0x70cc('0x1b')]('cm_contacts')['fromQuery'](_0x5c5b13,squel[_0x70cc('0xd')]()[_0x70cc('0x27')](_0x5c5b13)['from'](_0x183dc1)['where']('('+_0x9ffdf2[_0x70cc('0x10')](',')+_0x70cc('0x34'),squel[_0x70cc('0xd')]()[_0x70cc('0x27')](_0x9ffdf2)['from'](_0x70cc('0x28'))[_0x70cc('0x12')]('ListId\x20=\x20?',_0x5dea9c)['where'](_0x70cc('0x35')))[_0x70cc('0x12')](_0x70cc('0x36'),squel[_0x70cc('0xd')]()[_0x70cc('0xe')](_0x70cc('0x37'),_0x70cc('0x38'))[_0x70cc('0xf')](_0x183dc1)[_0x70cc('0x39')](_0x9ffdf2[_0x70cc('0x10')](','))))['toString']();}function handleStop(){logger['info'](_0x70cc('0x3a'));stopped=!![];}function handleUncaughtException(_0x3caa3a){logger['error'](_0x3caa3a[_0x70cc('0x3b')]);process['exit'](0x1);}function handleError(_0x42d492,_0x3f7305){stats[_0x70cc('0x3c')][_0x70cc('0x3d')]({'name':_0x3f7305[_0x70cc('0x3e')],'message':_0x3f7305[_0x70cc('0x3b')],'row':_0x42d492});}function handleQuery(_0x54640f){logger[_0x70cc('0x3f')](_0x54640f);return db[_0x70cc('0x40')][_0x70cc('0x41')](_0x54640f)[_0x70cc('0x42')](function(_0x5d6163){results['push'](_0x5d6163);})[_0x70cc('0x43')](function(_0x46f771){logger['error'](_0x46f771[_0x70cc('0x3b')]);});}function main(_0x3070c4,_0x2e5d0d,_0x422348,_0x507586){logger[_0x70cc('0x3f')]('main',_0x3070c4,JSON['stringify'](_0x2e5d0d));process[_0x70cc('0x44')](_0x70cc('0x45'));var _0x48f6a8=_0x2e5d0d['binding'];var _0x2ec9ce=_0x2e5d0d[_0x70cc('0x46')];var _0x531549=path[_0x70cc('0x10')](config[_0x70cc('0x47')],_0x70cc('0x48'),_0x2ec9ce+_0x70cc('0x49'));var _0x28401e=_[_0x70cc('0x32')](_0x48f6a8)[_0x70cc('0x10')]();logger[_0x70cc('0x3f')](_0x70cc('0x4a'),_0x28401e);fs['writeFileSync'](_0x531549,_0x28401e+'\x0a');Papa[_0x70cc('0x4b')](fs[_0x70cc('0x4c')](_0x3070c4),{'header':!![],'skipEmptyLines':!![],'step':function(_0xf3e0a2,_0x12577e){try{for(var _0x358059=0x0,_0x398f3d=[];_0x358059<_0xf3e0a2[_0x70cc('0x4d')][_0x70cc('0x4e')];_0x358059++){stats[_0x70cc('0x4f')]+=0x1;if(_0xf3e0a2[_0x70cc('0x3c')][_0x358059]){handleError(_0xf3e0a2[_0x70cc('0x4d')][_0x358059],_0xf3e0a2[_0x70cc('0x3c')][_0x358059]);}else{var _0x3ace8e=[];for(var _0x5e8ac0 in _0x48f6a8){if(_0x48f6a8[_0x70cc('0x50')](_0x5e8ac0)){if(_0xf3e0a2[_0x70cc('0x4d')][_0x358059][_0x48f6a8[_0x5e8ac0]]){var _0xde363=_[_0x70cc('0x51')](_0xf3e0a2['data'][_0x358059][_0x48f6a8[_0x5e8ac0]][_0x70cc('0x52')](/"/g,'\x27'));switch(_0x5e8ac0){case _0x70cc('0x1f'):var _0x53112a=moment(_0xde363,_0x70cc('0x53'),!![]);if(_0x53112a['isValid']()){_0x398f3d[_0x70cc('0x3d')]('\x22'+_0xde363+'\x22');}else{_0x3ace8e[_0x70cc('0x3d')](_0x70cc('0x54'));}break;case _0x70cc('0x24'):var _0x1d6b65=parseInt(_0xde363);_0xde363=_[_0x70cc('0x55')](_0x1d6b65)||_0x1d6b65<0x0||_0x1d6b65>0x4?_0x507586?0x3:0x2:_0x1d6b65;_0x398f3d[_0x70cc('0x3d')]('\x22'+_0xde363+'\x22');break;case'UserId':var _0x201c86=parseInt(_0xde363);if(_[_0x70cc('0x56')](_0x201c86)&&_[_0x70cc('0x57')](_0x422348,_0x201c86)){_0x398f3d[_0x70cc('0x3d')]('\x22'+_0x201c86+'\x22');}else{_0x3ace8e[_0x70cc('0x3d')](_0x70cc('0x58'));}break;case _0x70cc('0x59'):if(isEmail(_0xde363)){_0x398f3d[_0x70cc('0x3d')]('\x22'+_0xde363+'\x22');}else{_0x3ace8e[_0x70cc('0x3d')]('email\x20wrong\x20format');}break;case _0x70cc('0x5a'):var _0x4bddb8=moment(_0xde363,_0x70cc('0x5b'),!![]);if(_0x4bddb8[_0x70cc('0x5c')]()){_0x398f3d[_0x70cc('0x3d')]('\x22'+_0xde363+'\x22');}else{_0x3ace8e[_0x70cc('0x3d')](_0x70cc('0x5d'));}break;default:_0x398f3d['push']('\x22'+_0xde363+'\x22');}}else{switch(_0x5e8ac0){case _0x70cc('0x5e'):case _0x70cc('0x1e'):_0x3ace8e[_0x70cc('0x3d')](_0x5e8ac0+_0x70cc('0x5f'));break;default:_0x398f3d[_0x70cc('0x3d')]('\x22\x22');}}}}if(_0x3ace8e[_0x70cc('0x4e')]){handleError(_0xf3e0a2[_0x70cc('0x4d')][_0x358059],{'code':_0x70cc('0x60'),'message':_0x3ace8e[_0x70cc('0x10')]()});}else{fs[_0x70cc('0x61')](_0x531549,_0x398f3d[_0x70cc('0x10')]()+'\x0a');}_0x398f3d=[];}if(!(stats[_0x70cc('0x4f')]%0xc8)){socket[_0x70cc('0x62')](_0x70cc('0x63')+_0x2ec9ce,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x70cc('0x64'));_0x12577e[_0x70cc('0x65')]();}}catch(_0x3372a0){handleError(_0xf3e0a2[_0x70cc('0x4d')][_0x358059],{'code':_0x70cc('0x66'),'message':_0x3372a0['message']});logger['error'](_0x70cc('0x67'),_0x3372a0['message']);}},'complete':function(){try{var _0x5325dc=[];var _0x207ad0=_0x70cc('0x28');if(_0x2e5d0d['duplicates']&&_0x2e5d0d[_0x70cc('0x68')][_0x70cc('0x4e')]){_0x207ad0=_0x70cc('0x69')+_0x2ec9ce;_0x5325dc[_0x70cc('0x3d')](_0x70cc('0x6a')+_0x207ad0+_0x70cc('0x6b'));}var _0x56dc34=util[_0x70cc('0xc')](_0x70cc('0x6c'),_0x531549,_0x207ad0,_0x28401e,_0x2e5d0d['ListId'],_0x2e5d0d['CompanyId']||null,NOW,NOW);if(_[_0x70cc('0x6d')](_0x48f6a8['scheduledat'])){_0x56dc34+=_0x70cc('0x6e');}_0x5325dc[_0x70cc('0x3d')](_0x56dc34);if(_0x2e5d0d['duplicates']&&_0x2e5d0d[_0x70cc('0x68')][_0x70cc('0x4e')]){_0x5325dc[_0x70cc('0x3d')](insertCmContact(_0x2e5d0d[_0x70cc('0x21')],_0x207ad0,_0x2e5d0d[_0x70cc('0x68')],_0x48f6a8));_0x5325dc[_0x70cc('0x3d')]('DROP\x20TABLE\x20'+_0x207ad0+';');}_0x5325dc[_0x70cc('0x3d')](insertCmHopper(_0x2e5d0d['ListId'],_0x70cc('0x6f'),'voice_queues',_0x70cc('0x70'),_0x507586));_0x5325dc['push'](insertCmHopperBlack(_0x2e5d0d[_0x70cc('0x21')],_0x70cc('0x71'),_0x70cc('0x72'),'VoiceQueueId'));_0x5325dc[_0x70cc('0x3d')](insertCmHopper(_0x2e5d0d['ListId'],_0x70cc('0x73'),_0x70cc('0x74'),_0x70cc('0x75'),_0x507586));_0x5325dc[_0x70cc('0x3d')](insertCmHopperBlack(_0x2e5d0d[_0x70cc('0x21')],_0x70cc('0x76'),_0x70cc('0x74'),_0x70cc('0x75')));BPromise[_0x70cc('0x77')](_0x5325dc,handleQuery)[_0x70cc('0x78')](function(_0xac068b){stats[_0x70cc('0x79')]=!![];stats[_0x70cc('0x7a')]=_0x2e5d0d[_0x70cc('0x68')]&&_0x2e5d0d[_0x70cc('0x68')][_0x70cc('0x4e')]?results[0x2]['affectedRows']:results[0x0][_0x70cc('0x7a')];socket[_0x70cc('0x62')]('contact:import:'+_0x2ec9ce,stats);fs[_0x70cc('0x7b')](_0x3070c4);fs[_0x70cc('0x7b')](_0x531549);process[_0x70cc('0x7c')](0x0);})[_0x70cc('0x43')](function(_0x482eea){logger[_0x70cc('0x7d')](_0x482eea[_0x70cc('0x3b')]);process['exit'](0x1);});}catch(_0x19bd2f){logger[_0x70cc('0x7d')]('complete',_0x19bd2f[_0x70cc('0x3b')]);process[_0x70cc('0x7c')](0x1);}},'error':function(_0x5d5568,_0x193725,_0x83b8e6,_0x135b64){throw new Error(_0x135b64);}});}function validate(){if(process[_0x70cc('0x7e')]&&process[_0x70cc('0x7e')][_0x70cc('0x4e')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x42154c=path[_0x70cc('0x10')](config[_0x70cc('0x47')],_0x70cc('0x48'),process['argv'][0x2]);if(!fs[_0x70cc('0x7f')](_0x42154c)){throw new Error(_0x70cc('0x80'));}var _0x1bcb64={};try{_0x1bcb64=JSON[_0x70cc('0x4b')](process[_0x70cc('0x7e')][0x3]);if(!_0x1bcb64['binding']){throw new Error(_0x70cc('0x81'));}if(!_0x1bcb64['binding'][_0x70cc('0x1e')]){throw new Error(_0x70cc('0x82'));}if(!_0x1bcb64[_0x70cc('0x83')][_0x70cc('0x5e')]){throw new Error(_0x70cc('0x84'));}var _0xc7f35b=0x0;if(_0x1bcb64[_0x70cc('0x83')][_0x70cc('0x25')]){_0xc7f35b=0x1;}if(!_0x1bcb64[_0x70cc('0x21')]){throw new Error(_0x70cc('0x85'));}}catch(_0x2bd651){throw new Error(_0x70cc('0x86'));}var _0x36f9e0=[];try{_0x36f9e0=_[_0x70cc('0x87')](JSON['parse'](process[_0x70cc('0x7e')][0x4]),'id');}catch(_0x15f884){logger['info'](_0x70cc('0x88'));}main(_0x42154c,_0x1bcb64,_0x36f9e0,_0xc7f35b);}validate();process['on'](_0x70cc('0x89'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 473d80b..40d2e1e 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 _0xa7fa=['destcalleridnum','Member\x20Name','membername','starttime','***\x20Time\x20Info\x20***','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','outbound','Outbound\x20Call','getDescriptions','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number'];(function(_0x4003fe,_0x38c382){var _0x5af37c=function(_0x112092){while(--_0x112092){_0x4003fe['push'](_0x4003fe['shift']());}};_0x5af37c(++_0x38c382);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';exports[_0xaa7f('0x0')]=function(_0x5b54f2,_0x5f4cc1){var _0x33c194=[{'type':_0xaa7f('0x1'),'content':_0xaa7f('0x2'),'variableName':null}];switch(_0x5b54f2[_0xaa7f('0x3')]()){case'voice':switch(_0x5f4cc1[_0xaa7f('0x3')]()){case _0xaa7f('0x4'):_0x33c194[_0xaa7f('0x5')]({'type':_0xaa7f('0x6'),'content':'','variableName':'queue'});_0x33c194[_0xaa7f('0x5')]({'type':'variable','content':'','variableName':'calleridnum'});break;case _0xaa7f('0x7'):_0x33c194['push']({'type':_0xaa7f('0x1'),'content':_0xaa7f('0x8'),'variableName':null});_0x33c194[_0xaa7f('0x5')]({'type':_0xaa7f('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x33c194;};exports[_0xaa7f('0x9')]=function(_0x3e7148,_0x5692a7){var _0x471fdc=[];switch(_0x3e7148[_0xaa7f('0x3')]()){case _0xaa7f('0xa'):switch(_0x5692a7[_0xaa7f('0x3')]()){case'inbound':_0x471fdc=[{'type':'string','content':_0xaa7f('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xaa7f('0xc'),'content':'','key':_0xaa7f('0xd'),'keyType':_0xaa7f('0x6'),'variableName':_0xaa7f('0xe')},{'type':_0xaa7f('0xc'),'content':'','key':_0xaa7f('0xf'),'keyType':_0xaa7f('0x6'),'variableName':_0xaa7f('0x10')},{'type':'keyValue','content':'','key':_0xaa7f('0x11'),'keyType':'variable','variableName':_0xaa7f('0x12')},{'type':_0xaa7f('0xc'),'content':'','key':_0xaa7f('0x13'),'keyType':'variable','variableName':_0xaa7f('0x14')},{'type':_0xaa7f('0xc'),'content':'','key':_0xaa7f('0x15'),'keyType':_0xaa7f('0x6'),'variableName':_0xaa7f('0x16')},{'type':_0xaa7f('0xc'),'content':'','key':_0xaa7f('0x17'),'keyType':'variable','variableName':_0xaa7f('0x18')},{'type':_0xaa7f('0x1'),'content':_0xaa7f('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xaa7f('0xc'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0xaa7f('0x1a')},{'type':'keyValue','content':'','key':_0xaa7f('0x1b'),'keyType':_0xaa7f('0x6'),'variableName':'destcalleridnum'},{'type':_0xaa7f('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xaa7f('0xc'),'content':'','key':_0xaa7f('0x1c'),'keyType':_0xaa7f('0x6'),'variableName':'agentcalledAt'},{'type':_0xaa7f('0xc'),'content':'','key':_0xaa7f('0x1d'),'keyType':_0xaa7f('0x6'),'variableName':_0xaa7f('0x1e')},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':_0xaa7f('0x6'),'variableName':_0xaa7f('0x1f')},{'type':_0xaa7f('0xc'),'content':'','key':_0xaa7f('0x20'),'keyType':_0xaa7f('0x6'),'variableName':_0xaa7f('0x21')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0xaa7f('0x22')}];break;case'outbound':_0x471fdc=[{'type':_0xaa7f('0x1'),'content':_0xaa7f('0xb'),'variableName':null},{'type':'keyValue','content':'','key':_0xaa7f('0x23'),'keyType':'variable','keyContent':'','variableName':_0xaa7f('0x24')},{'type':_0xaa7f('0xc'),'content':'','key':_0xaa7f('0x25'),'keyType':_0xaa7f('0x6'),'keyContent':'','variableName':_0xaa7f('0x26')},{'type':'keyValue','content':'','key':_0xaa7f('0x15'),'keyType':_0xaa7f('0x6'),'keyContent':'','variableName':_0xaa7f('0x16')},{'type':'keyValue','content':'','key':_0xaa7f('0x17'),'keyType':_0xaa7f('0x6'),'keyContent':'','variableName':_0xaa7f('0x27')},{'type':_0xaa7f('0x1'),'content':_0xaa7f('0x28')},{'type':_0xaa7f('0xc'),'content':'','key':'Answer\x20Time','keyType':_0xaa7f('0x6'),'keyContent':'','variableName':_0xaa7f('0x29')},{'type':'keyValue','content':'','key':_0xaa7f('0x2a'),'keyType':_0xaa7f('0x6'),'keyContent':'','variableName':_0xaa7f('0x2b')},{'type':_0xaa7f('0xc'),'content':'','key':_0xaa7f('0x2c'),'keyType':_0xaa7f('0x6'),'keyContent':'','variableName':_0xaa7f('0x2d')},{'type':_0xaa7f('0xc'),'content':'','key':_0xaa7f('0x2e'),'keyType':_0xaa7f('0x6'),'keyContent':'','variableName':_0xaa7f('0x2f')}];break;}}return _0x471fdc;}; \ No newline at end of file +var _0x4c99=['Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Hold\x20Time','holdtime','Talk\x20Time','talktime','Member\x20Name','membername','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','toLowerCase','voice','inbound','push','queue','outbound','string','Outbound\x20Call','variable','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','Call\x20To','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name'];(function(_0x2e9a85,_0x1ba0d2){var _0x1ade02=function(_0x2bedaf){while(--_0x2bedaf){_0x2e9a85['push'](_0x2e9a85['shift']());}};_0x1ade02(++_0x1ba0d2);}(_0x4c99,0x1ec));var _0x94c9=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4c99[_0x5d2803];return _0xdcad2c;};'use strict';exports[_0x94c9('0x0')]=function(_0x52a620,_0xbcda13){var _0x4831d6=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x52a620[_0x94c9('0x1')]()){case _0x94c9('0x2'):switch(_0xbcda13['toLowerCase']()){case _0x94c9('0x3'):_0x4831d6[_0x94c9('0x4')]({'type':'variable','content':'','variableName':_0x94c9('0x5')});_0x4831d6['push']({'type':'variable','content':'','variableName':'calleridnum'});break;case _0x94c9('0x6'):_0x4831d6[_0x94c9('0x4')]({'type':_0x94c9('0x7'),'content':_0x94c9('0x8'),'variableName':null});_0x4831d6[_0x94c9('0x4')]({'type':_0x94c9('0x9'),'content':'','variableName':_0x94c9('0xa')});break;}}return _0x4831d6;};exports[_0x94c9('0xb')]=function(_0x1a43b0,_0x284f39){var _0x58b0ae=[];switch(_0x1a43b0[_0x94c9('0x1')]()){case _0x94c9('0x2'):switch(_0x284f39[_0x94c9('0x1')]()){case'inbound':_0x58b0ae=[{'type':_0x94c9('0x7'),'content':_0x94c9('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0xe'),'keyType':_0x94c9('0x9'),'variableName':_0x94c9('0xf')},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x10'),'keyType':'variable','variableName':'calleridname'},{'type':'keyValue','content':'','key':_0x94c9('0x11'),'keyType':_0x94c9('0x9'),'variableName':'destexten'},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x12'),'keyType':_0x94c9('0x9'),'variableName':'queue'},{'type':'keyValue','content':'','key':_0x94c9('0x13'),'keyType':_0x94c9('0x9'),'variableName':_0x94c9('0x14')},{'type':_0x94c9('0xd'),'content':'','key':'Date','keyType':_0x94c9('0x9'),'variableName':_0x94c9('0x15')},{'type':_0x94c9('0x7'),'content':_0x94c9('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x17'),'keyType':_0x94c9('0x9'),'variableName':'destcalleridname'},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x18'),'keyType':'variable','variableName':_0x94c9('0xa')},{'type':_0x94c9('0x7'),'content':_0x94c9('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x1a'),'keyType':_0x94c9('0x9'),'variableName':_0x94c9('0x15')},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x1b'),'keyType':_0x94c9('0x9'),'variableName':'agentconnectAt'},{'type':_0x94c9('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0x94c9('0x9'),'variableName':'agentcompleteAt'},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x1c'),'keyType':_0x94c9('0x9'),'variableName':_0x94c9('0x1d')},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x1e'),'keyType':'variable','variableName':_0x94c9('0x1f')}];break;case _0x94c9('0x6'):_0x58b0ae=[{'type':_0x94c9('0x7'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x94c9('0xd'),'content':'','key':'Called\x20Number','keyType':_0x94c9('0x9'),'keyContent':'','variableName':_0x94c9('0xa')},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x20'),'keyType':_0x94c9('0x9'),'keyContent':'','variableName':_0x94c9('0x21')},{'type':'keyValue','content':'','key':_0x94c9('0x13'),'keyType':_0x94c9('0x9'),'keyContent':'','variableName':_0x94c9('0x14')},{'type':'keyValue','content':'','key':_0x94c9('0x22'),'keyType':_0x94c9('0x9'),'keyContent':'','variableName':_0x94c9('0x23')},{'type':_0x94c9('0x7'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x24'),'keyType':'variable','keyContent':'','variableName':_0x94c9('0x25')},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x26'),'keyType':_0x94c9('0x9'),'keyContent':'','variableName':_0x94c9('0x27')},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x28'),'keyType':'variable','keyContent':'','variableName':_0x94c9('0x29')},{'type':_0x94c9('0xd'),'content':'','key':_0x94c9('0x2a'),'keyType':_0x94c9('0x9'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x58b0ae;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 20ce6fe..78fab2e 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 _0x0116=['error','user','query','clone','body','omit','html','phone','fax','mobile','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','catch'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0116,0x183));var _0x6011=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0116[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var db=require(_0x6011('0x0'))['db'];var loggers={'openchannel':require(_0x6011('0x1'))(_0x6011('0x2')),'mail':require(_0x6011('0x1'))(_0x6011('0x3')),'fax':require(_0x6011('0x1'))('fax-interactions'),'sms':require(_0x6011('0x1'))('sms-interactions'),'chat':require(_0x6011('0x1'))('chat-interactions')};function getInteractionId(_0x1a423d,_0x17e797,_0x14f180){if(_0x1a423d&&_0x1a423d[_[_0x6011('0x4')](_0x14f180)+'InteractionId']){return _0x1a423d[_[_0x6011('0x4')](_0x14f180)+_0x6011('0x5')];}else if(_0x1a423d&&_0x1a423d['id']){return _0x1a423d['id'];}else if(_0x17e797&&_0x17e797['id']){return _0x17e797['id'];}else{return _0x6011('0x6');}}function log(_0x2585f9,_0xe0c18e,_0x532740,_0x147da0,_0x6f44fd,_0x2b068b){loggers[_0x6f44fd[_0x6011('0x7')]()][_0x2585f9](_0x6011('0x8'),_0x2b068b[_0x6011('0x9')](),_0xe0c18e?_0xe0c18e['id']:null,_0xe0c18e?_0xe0c18e[_0x6011('0xa')]:null,_0xe0c18e?_0xe0c18e[_0x6011('0xb')]:null,getInteractionId(_0x532740,_0x147da0,_0x6f44fd),_0x532740?JSON[_0x6011('0xc')](_0x532740):'null');}function updateUser(_0x2e3abd,_0x396df5,_0x274a32,_0x49e2d2,_0x31b4f3){db[_[_0x6011('0x4')](_0x49e2d2)+_0x6011('0xd')][_0x6011('0xe')]({'where':{'id':getInteractionId(_0x396df5,_0x274a32,_0x49e2d2)}})[_0x6011('0xf')](function(_0x4eb75f){if(_0x4eb75f){return _0x4eb75f[_0x6011('0x10')]({'UserId':_0x2e3abd?_0x2e3abd['id']:null});}})[_0x6011('0xf')](function(_0x1cbead){if(_0x1cbead){log(_0x6011('0x11'),_0x2e3abd,_0x396df5,_0x274a32,_0x49e2d2,_0x31b4f3);}})[_0x6011('0x12')](function(){log(_0x6011('0x13'),_0x2e3abd,_0x396df5,_0x274a32,_0x49e2d2,_0x31b4f3);});}exports['tracked']=function(_0x4e7e1a,_0x2b4259){return function(_0x126175,_0x299bed,_0x2443ee){var _0x2992eb=_0x126175[_0x6011('0x14')];var _0x6cf19d={};var _0xf53ed0=_0x126175[_0x6011('0x15')];if(_0x6cf19d){_0x6cf19d=_[_0x6011('0x16')](_0x126175[_0x6011('0x17')]);_0x6cf19d=_[_0x6011('0x18')](_0x6cf19d,[_0x6011('0x17'),_0x6011('0x19'),_0x6011('0x1a'),_0x6011('0x1b'),_0x6011('0x1c')]);}updateUser(_0x2992eb,_0x6cf19d,_0xf53ed0,_0x4e7e1a,_0x2b4259);_0x2443ee(null);};}; \ No newline at end of file +var _0x96f8=['fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','catch','tracked','user','query','omit','body','html','mobile','../../mysqldb','../../config/logger','openchannel-interactions'];(function(_0x1ecfc8,_0x416e75){var _0x43d7d9=function(_0x44a24f){while(--_0x44a24f){_0x1ecfc8['push'](_0x1ecfc8['shift']());}};_0x43d7d9(++_0x416e75);}(_0x96f8,0x177));var _0x896f=function(_0x3f6813,_0x2a3e1d){_0x3f6813=_0x3f6813-0x0;var _0x5c3092=_0x96f8[_0x3f6813];return _0x5c3092;};'use strict';var _=require('lodash');var db=require(_0x896f('0x0'))['db'];var loggers={'openchannel':require(_0x896f('0x1'))(_0x896f('0x2')),'mail':require(_0x896f('0x1'))('mail-interactions'),'fax':require(_0x896f('0x1'))(_0x896f('0x3')),'sms':require(_0x896f('0x1'))(_0x896f('0x4')),'chat':require(_0x896f('0x1'))(_0x896f('0x5'))};function getInteractionId(_0x3339c3,_0x11706d,_0x1929d6){if(_0x3339c3&&_0x3339c3[_[_0x896f('0x6')](_0x1929d6)+_0x896f('0x7')]){return _0x3339c3[_[_0x896f('0x6')](_0x1929d6)+_0x896f('0x7')];}else if(_0x3339c3&&_0x3339c3['id']){return _0x3339c3['id'];}else if(_0x11706d&&_0x11706d['id']){return _0x11706d['id'];}else{return _0x896f('0x8');}}function log(_0x3b93b1,_0x5386ac,_0x63ec55,_0x5612b2,_0x2de82a,_0x1525d4){loggers[_0x2de82a[_0x896f('0x9')]()][_0x3b93b1]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1525d4[_0x896f('0xa')](),_0x5386ac?_0x5386ac['id']:null,_0x5386ac?_0x5386ac[_0x896f('0xb')]:null,_0x5386ac?_0x5386ac[_0x896f('0xc')]:null,getInteractionId(_0x63ec55,_0x5612b2,_0x2de82a),_0x63ec55?JSON[_0x896f('0xd')](_0x63ec55):'null');}function updateUser(_0x39088f,_0x208e63,_0x54eb56,_0x4c76b9,_0x86750e){db[_['upperFirst'](_0x4c76b9)+_0x896f('0xe')][_0x896f('0xf')]({'where':{'id':getInteractionId(_0x208e63,_0x54eb56,_0x4c76b9)}})[_0x896f('0x10')](function(_0x38027d){if(_0x38027d){return _0x38027d[_0x896f('0x11')]({'UserId':_0x39088f?_0x39088f['id']:null});}})[_0x896f('0x10')](function(_0x21e554){if(_0x21e554){log(_0x896f('0x12'),_0x39088f,_0x208e63,_0x54eb56,_0x4c76b9,_0x86750e);}})[_0x896f('0x13')](function(){log('error',_0x39088f,_0x208e63,_0x54eb56,_0x4c76b9,_0x86750e);});}exports[_0x896f('0x14')]=function(_0x5211fc,_0x14c314){return function(_0xbeafee,_0x247d6e,_0x553e15){var _0x2bc02d=_0xbeafee[_0x896f('0x15')];var _0x608d91={};var _0x2d5d60=_0xbeafee[_0x896f('0x16')];if(_0x608d91){_0x608d91=_['clone'](_0xbeafee['body']);_0x608d91=_[_0x896f('0x17')](_0x608d91,[_0x896f('0x18'),_0x896f('0x19'),'phone','fax',_0x896f('0x1a')]);}updateUser(_0x2bc02d,_0x608d91,_0x2d5d60,_0x5211fc,_0x14c314);_0x553e15(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index c9fbb7d..4e66f01 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 _0x0d6b=['%s:%s:%s','update','utf8','final','use','License','then','count','catch','User','admin','user','isUserLimit','crypto','util','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format'];(function(_0x1fe931,_0xc4415){var _0x206cb0=function(_0x5d045a){while(--_0x5d045a){_0x1fe931['push'](_0x1fe931['shift']());}};_0x206cb0(++_0xc4415);}(_0x0d6b,0x199));var _0xb0d6=function(_0x364152,_0x4da267){_0x364152=_0x364152-0x0;var _0x460cfd=_0x0d6b[_0x364152];return _0x460cfd;};'use strict';var crypto=require(_0xb0d6('0x0'));var util=require(_0xb0d6('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0xb0d6('0x2'));function getValueFromLicense(_0x323381,_0x37f73a){if(_0x323381&&_0x37f73a){if(_0x37f73a[_0xb0d6('0x3')]&&_0x37f73a[_0xb0d6('0x4')]){var _0x3c0327=_0x37f73a['data1'];var _0x3944b4=_0x37f73a[_0xb0d6('0x4')];var _0x4a1168=_0x3c0327['split']('-')[0x4];var _0x464fdc=_0x3c0327[_0xb0d6('0x5')]('-')[0x0];var _0x3e3077=crypto[_0xb0d6('0x6')](_0xb0d6('0x7'),util[_0xb0d6('0x8')](_0xb0d6('0x9'),_0x4a1168,_0x3c0327,_0x464fdc));var _0x1aab79=_0x3e3077[_0xb0d6('0xa')](_0x3944b4,'base64',_0xb0d6('0xb'));_0x1aab79+=_0x3e3077[_0xb0d6('0xc')](_0xb0d6('0xb'));var _0x502378=JSON['parse'](_0x1aab79);return _0x502378['hasOwnProperty'](_0x323381)?_0x502378[_0x323381]:null;}}return null;}function isLimit(_0x1dc33d,_0x100d60,_0x5e4890,_0x47f600){var _0x3ca403=_0x100d60;return compose()[_0xb0d6('0xd')](function(_0x3f59dd,_0x59ffb2,_0x1f777c){return db[_0xb0d6('0xe')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xb0d6('0xf')](function(_0x21e70e){var _0x13c00=getValueFromLicense(_0x1dc33d,_0x21e70e);return _0x13c00?_0x13c00:_0x3ca403;})[_0xb0d6('0xf')](function(_0x58ff4f){_0x3ca403=_0x58ff4f;return _0x5e4890[_0xb0d6('0x10')](_0x47f600);})[_0xb0d6('0xf')](function(_0x3941d4){if(_0x3941d4>=_0x3ca403){return _0x59ffb2['status'](0x193)['json']({'message':util[_0xb0d6('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x1dc33d)});}_0x1f777c();})[_0xb0d6('0x11')](function(_0x21efb0){_0x1f777c(_0x21efb0);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xb0d6('0x12')],{'where':{'$or':[{'role':_0xb0d6('0x13')},{'role':_0xb0d6('0x14')}]}});}exports[_0xb0d6('0x15')]=isUserLimit; \ No newline at end of file +var _0xeb98=['status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','hasOwnProperty','findOne','then','count'];(function(_0x51a9cd,_0x4e5861){var _0x1bf6d2=function(_0x4a6880){while(--_0x4a6880){_0x51a9cd['push'](_0x51a9cd['shift']());}};_0x1bf6d2(++_0x4e5861);}(_0xeb98,0x197));var _0x8eb9=function(_0x51bedd,_0x14dddc){_0x51bedd=_0x51bedd-0x0;var _0x45f416=_0xeb98[_0x51bedd];return _0x45f416;};'use strict';var crypto=require(_0x8eb9('0x0'));var util=require('util');var compose=require(_0x8eb9('0x1'));var db=require(_0x8eb9('0x2'))['db'];var config=require(_0x8eb9('0x3'));function getValueFromLicense(_0x446c45,_0x1b56db){if(_0x446c45&&_0x1b56db){if(_0x1b56db[_0x8eb9('0x4')]&&_0x1b56db['license']){var _0x583957=_0x1b56db[_0x8eb9('0x4')];var _0x5b1a30=_0x1b56db[_0x8eb9('0x5')];var _0xdaf997=_0x583957[_0x8eb9('0x6')]('-')[0x4];var _0x4a4e50=_0x583957['split']('-')[0x0];var _0x436927=crypto['createDecipher'](_0x8eb9('0x7'),util[_0x8eb9('0x8')](_0x8eb9('0x9'),_0xdaf997,_0x583957,_0x4a4e50));var _0x599a35=_0x436927[_0x8eb9('0xa')](_0x5b1a30,_0x8eb9('0xb'),_0x8eb9('0xc'));_0x599a35+=_0x436927[_0x8eb9('0xd')]('utf8');var _0x415f80=JSON['parse'](_0x599a35);return _0x415f80[_0x8eb9('0xe')](_0x446c45)?_0x415f80[_0x446c45]:null;}}return null;}function isLimit(_0x50a027,_0x47efb0,_0x42a765,_0x5860c4){var _0x1745d9=_0x47efb0;return compose()['use'](function(_0x3e64b3,_0x829f53,_0x4d27a2){return db['License'][_0x8eb9('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x8eb9('0x10')](function(_0xa9aad5){var _0x1165f8=getValueFromLicense(_0x50a027,_0xa9aad5);return _0x1165f8?_0x1165f8:_0x1745d9;})[_0x8eb9('0x10')](function(_0x8c5aac){_0x1745d9=_0x8c5aac;return _0x42a765[_0x8eb9('0x11')](_0x5860c4);})[_0x8eb9('0x10')](function(_0x45549f){if(_0x45549f>=_0x1745d9){return _0x829f53[_0x8eb9('0x12')](0x193)[_0x8eb9('0x13')]({'message':util[_0x8eb9('0x8')](_0x8eb9('0x14'),_0x50a027)});}_0x4d27a2();})[_0x8eb9('0x15')](function(_0x23cc82){_0x4d27a2(_0x23cc82);});});}function isUserLimit(){return isLimit(_0x8eb9('0x16'),0x1,db[_0x8eb9('0x17')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x8eb9('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 24ecfd6..8c1cb73 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 _0x85db=['days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','$gt','<=\x20?','>=\x20?','$between','$in','start','pop','utcOffset','add','hours','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','match','indexOf','map','conditions','push','buildExpression','DATE','operator','value','includes','$lte'];(function(_0x340a19,_0x1e0934){var _0x44c217=function(_0x26ebf1){while(--_0x26ebf1){_0x340a19['push'](_0x340a19['shift']());}};_0x44c217(++_0x1e0934);}(_0x85db,0x8e));var _0xb85d=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x85db[_0x5eb22e];return _0x27fed5;};'use strict';var _=require('lodash');var moment=require(_0xb85d('0x0'));exports[_0xb85d('0x1')]=function(_0x49ba8e){var _0x1ee26c={'conditions':[]};_0x1ee26c[_0xb85d('0x2')]=_[_0xb85d('0x3')](_0x49ba8e,_0xb85d('0x4'))?'or':_0xb85d('0x5');var _0xd867b=_0x49ba8e[_0xb85d('0x6')](_0xb85d('0x7'),'')['replace'](_0xb85d('0x4'),'')[_0xb85d('0x8')]('||');for(var _0x4d34c7=0x0;_0x4d34c7<_0xd867b[_0xb85d('0x9')];_0x4d34c7++){var _0x406f60=_0xd867b[_0x4d34c7][_0xb85d('0x8')](':=');var _0x45a986=_0x406f60[0x0];var _0x5dccf7=_0x406f60[_0xb85d('0xa')](0x1);_0x5dccf7[_0xb85d('0xb')](function(_0x51f6a9){var _0x99364c=_0x51f6a9[_0xb85d('0x8')]('[')['shift']();var _0x3e5201=_0x51f6a9[_0xb85d('0xc')](/\[(.*?)\]/g);_0x3e5201[_0xb85d('0xb')](function(_0x105629){var _0x21610f=_0x105629['split']('[')['filter'](function(_0x19ae7a){return _0x19ae7a[_0xb85d('0xd')](']')>-0x1;})[_0xb85d('0xe')](function(_0x1ecb4c){return _0x1ecb4c[_0xb85d('0x8')](']')[0x0];})[0x0];_0x1ee26c[_0xb85d('0xf')][_0xb85d('0x10')]({'field':_0x45a986,'operator':_0x99364c,'value':_0x21610f});});});}return _0x1ee26c;};exports[_0xb85d('0x11')]=function(_0x2185dd,_0xbbd84e,_0x2abe8d){var _0x3e3a4e={};if(_0xbbd84e===_0xb85d('0x12')){if(_0x2abe8d['operator']==='$eq'){_0x2abe8d[_0xb85d('0x13')]='$between';_0x2abe8d['value']+=','+_0x2abe8d[_0xb85d('0x14')];}else if(_[_0xb85d('0x15')](['$gt',_0xb85d('0x16')],_0x2abe8d['operator'])){_0x2abe8d[_0xb85d('0x14')]=moment(_0x2abe8d[_0xb85d('0x14')])['add'](0x1,_0xb85d('0x17'))[_0xb85d('0x18')](_0xb85d('0x19'));}}if(_0x2abe8d[_0xb85d('0x1a')]){_0xbbd84e=_0x2abe8d[_0xb85d('0x1a')];_0x3e3a4e[_0xb85d('0x1b')]=_0xb85d('0x1c')+_0x2185dd+'.'+_0x2abe8d[_0xb85d('0x1d')]+_0xb85d('0x1e')+_0x2abe8d['castTo']+')\x20'+parseOperator(_0x2abe8d['operator']);}else{_0x3e3a4e[_0xb85d('0x1b')]=_0x2185dd+'.'+_0x2abe8d[_0xb85d('0x1d')]+'\x20'+parseOperator(_0x2abe8d[_0xb85d('0x13')]);}if(_[_0xb85d('0x15')]([_0xb85d('0x1f'),_0xb85d('0x20')],_0x2abe8d[_0xb85d('0x13')]))_0x3e3a4e[_0xb85d('0x1b')]='('+_0x3e3a4e[_0xb85d('0x1b')]+_0xb85d('0x21')+_0x2185dd+'.'+_0x2abe8d['field']+_0xb85d('0x22');_0x3e3a4e['value']=parseValue(_0xbbd84e,_0x2abe8d[_0xb85d('0x13')],_0x2abe8d[_0xb85d('0x14')]);return _0x3e3a4e;};function parseOperator(_0x52b2ef){var _0x194585;switch(_0x52b2ef){case'$in':_0x194585=_0xb85d('0x23');break;case _0xb85d('0x20'):_0x194585=_0xb85d('0x24');break;case'$eq':_0x194585=_0xb85d('0x25');break;case _0xb85d('0x1f'):_0x194585='<>\x20?';break;case _0xb85d('0x26'):case _0xb85d('0x27'):case _0xb85d('0x28'):_0x194585='LIKE\x20?';break;case _0xb85d('0x29'):_0x194585=_0xb85d('0x2a');break;case _0xb85d('0x2b'):_0x194585='>\x20?';break;case _0xb85d('0x16'):_0x194585=_0xb85d('0x2c');break;case'$gte':_0x194585=_0xb85d('0x2d');break;case _0xb85d('0x2e'):_0x194585='BETWEEN\x20?\x20AND\x20?';break;}return _0x194585;}function parseValue(_0x11cf4c,_0x5a8abc,_0x7b4cd7){var _0x5f564f={'start':undefined,'end':undefined};switch(_0x5a8abc){case _0xb85d('0x2f'):case _0xb85d('0x20'):_0x5f564f['start']=_0x7b4cd7['split'](',');break;case _0xb85d('0x26'):_0x5f564f[_0xb85d('0x30')]='%'+_0x7b4cd7+'%';break;case _0xb85d('0x27'):_0x5f564f[_0xb85d('0x30')]=_0x7b4cd7+'%';break;case _0xb85d('0x28'):_0x5f564f[_0xb85d('0x30')]='%'+_0x7b4cd7;break;case _0xb85d('0x2e'):var _0x5068bc=_0x7b4cd7[_0xb85d('0x8')](',');var _0x7b4cd7=_0x5068bc['shift']();var _0x195c6c=_0x5068bc[_0xb85d('0x31')]();if(_0x11cf4c==='DATE'){_0x7b4cd7=moment(_0x7b4cd7)[_0xb85d('0x32')](0x0,!![])['format']();_0x195c6c=moment(_0x195c6c)[_0xb85d('0x32')](0x0,!![])[_0xb85d('0x33')](0x17,_0xb85d('0x34'))['add'](0x3b,_0xb85d('0x35'))[_0xb85d('0x33')](0x3b,_0xb85d('0x36'))[_0xb85d('0x18')]();}_0x5f564f={'start':_0x7b4cd7,'end':_0x195c6c};break;default:_0x5f564f[_0xb85d('0x30')]=_0x7b4cd7;break;}return _0x5f564f;} \ No newline at end of file +var _0xeeff=['text','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','=\x20?','$startsWith','$endsWith','LIKE\x20?','$gt','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$notIn','start','$substring','pop','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','[$or]','and','replace','[$and]','split','length','slice','shift','forEach','filter','indexOf','map','push','buildExpression','DATE','operator','$eq','$between','value','includes','$lte','days','format','YYYY-MM-DD','castTo'];(function(_0x256b4c,_0x579f2b){var _0x2b5c31=function(_0x4a4af8){while(--_0x4a4af8){_0x256b4c['push'](_0x256b4c['shift']());}};_0x2b5c31(++_0x579f2b);}(_0xeeff,0x83));var _0xfeef=function(_0x4bd7f4,_0x8e30a2){_0x4bd7f4=_0x4bd7f4-0x0;var _0x426a9e=_0xeeff[_0x4bd7f4];return _0x426a9e;};'use strict';var _=require(_0xfeef('0x0'));var moment=require(_0xfeef('0x1'));exports[_0xfeef('0x2')]=function(_0x5dbe78){var _0x4946f3={'conditions':[]};_0x4946f3['sqlOperator']=_['startsWith'](_0x5dbe78,_0xfeef('0x3'))?'or':_0xfeef('0x4');var _0x28165f=_0x5dbe78[_0xfeef('0x5')](_0xfeef('0x6'),'')['replace'](_0xfeef('0x3'),'')[_0xfeef('0x7')]('||');for(var _0x5add0e=0x0;_0x5add0e<_0x28165f[_0xfeef('0x8')];_0x5add0e++){var _0x9d645=_0x28165f[_0x5add0e][_0xfeef('0x7')](':=');var _0x41e800=_0x9d645[0x0];var _0x2234c2=_0x9d645[_0xfeef('0x9')](0x1);_0x2234c2['forEach'](function(_0x29c886){var _0xf59d32=_0x29c886['split']('[')[_0xfeef('0xa')]();var _0x3649de=_0x29c886['match'](/\[(.*?)\]/g);_0x3649de[_0xfeef('0xb')](function(_0x18ffb6){var _0x3de5d2=_0x18ffb6[_0xfeef('0x7')]('[')[_0xfeef('0xc')](function(_0x5b98f7){return _0x5b98f7[_0xfeef('0xd')](']')>-0x1;})[_0xfeef('0xe')](function(_0x348703){return _0x348703[_0xfeef('0x7')](']')[0x0];})[0x0];_0x4946f3['conditions'][_0xfeef('0xf')]({'field':_0x41e800,'operator':_0xf59d32,'value':_0x3de5d2});});});}return _0x4946f3;};exports[_0xfeef('0x10')]=function(_0x2efa0f,_0x5d8487,_0x3ce558){var _0x3cddc4={};if(_0x5d8487===_0xfeef('0x11')){if(_0x3ce558[_0xfeef('0x12')]===_0xfeef('0x13')){_0x3ce558[_0xfeef('0x12')]=_0xfeef('0x14');_0x3ce558['value']+=','+_0x3ce558[_0xfeef('0x15')];}else if(_[_0xfeef('0x16')](['$gt',_0xfeef('0x17')],_0x3ce558[_0xfeef('0x12')])){_0x3ce558[_0xfeef('0x15')]=moment(_0x3ce558[_0xfeef('0x15')])['add'](0x1,_0xfeef('0x18'))[_0xfeef('0x19')](_0xfeef('0x1a'));}}if(_0x3ce558[_0xfeef('0x1b')]){_0x5d8487=_0x3ce558[_0xfeef('0x1b')];_0x3cddc4[_0xfeef('0x1c')]='CAST('+_0x2efa0f+'.'+_0x3ce558[_0xfeef('0x1d')]+_0xfeef('0x1e')+_0x3ce558[_0xfeef('0x1b')]+')\x20'+parseOperator(_0x3ce558[_0xfeef('0x12')]);}else{_0x3cddc4[_0xfeef('0x1c')]=_0x2efa0f+'.'+_0x3ce558[_0xfeef('0x1d')]+'\x20'+parseOperator(_0x3ce558[_0xfeef('0x12')]);}if(_[_0xfeef('0x16')]([_0xfeef('0x1f'),'$notIn'],_0x3ce558[_0xfeef('0x12')]))_0x3cddc4['text']='('+_0x3cddc4['text']+_0xfeef('0x20')+_0x2efa0f+'.'+_0x3ce558['field']+_0xfeef('0x21');_0x3cddc4[_0xfeef('0x15')]=parseValue(_0x5d8487,_0x3ce558[_0xfeef('0x12')],_0x3ce558[_0xfeef('0x15')]);return _0x3cddc4;};function parseOperator(_0x5f3714){var _0x3151a1;switch(_0x5f3714){case _0xfeef('0x22'):_0x3151a1='IN\x20?';break;case'$notIn':_0x3151a1='NOT\x20IN\x20?';break;case _0xfeef('0x13'):_0x3151a1=_0xfeef('0x23');break;case'$ne':_0x3151a1='<>\x20?';break;case'$substring':case _0xfeef('0x24'):case _0xfeef('0x25'):_0x3151a1=_0xfeef('0x26');break;case'$lt':_0x3151a1='<\x20?';break;case _0xfeef('0x27'):_0x3151a1='>\x20?';break;case _0xfeef('0x17'):_0x3151a1=_0xfeef('0x28');break;case _0xfeef('0x29'):_0x3151a1=_0xfeef('0x2a');break;case'$between':_0x3151a1=_0xfeef('0x2b');break;}return _0x3151a1;}function parseValue(_0xae889f,_0x105bfc,_0x59ae4b){var _0x582510={'start':undefined,'end':undefined};switch(_0x105bfc){case'$in':case _0xfeef('0x2c'):_0x582510[_0xfeef('0x2d')]=_0x59ae4b[_0xfeef('0x7')](',');break;case _0xfeef('0x2e'):_0x582510['start']='%'+_0x59ae4b+'%';break;case'$startsWith':_0x582510[_0xfeef('0x2d')]=_0x59ae4b+'%';break;case'$endsWith':_0x582510[_0xfeef('0x2d')]='%'+_0x59ae4b;break;case _0xfeef('0x14'):var _0x5514c3=_0x59ae4b[_0xfeef('0x7')](',');var _0x59ae4b=_0x5514c3[_0xfeef('0xa')]();var _0x572c68=_0x5514c3[_0xfeef('0x2f')]();if(_0xae889f===_0xfeef('0x11')){_0x59ae4b=moment(_0x59ae4b)[_0xfeef('0x30')](0x0,!![])['format']();_0x572c68=moment(_0x572c68)[_0xfeef('0x30')](0x0,!![])[_0xfeef('0x31')](0x17,_0xfeef('0x32'))[_0xfeef('0x31')](0x3b,_0xfeef('0x33'))[_0xfeef('0x31')](0x3b,_0xfeef('0x34'))[_0xfeef('0x19')]();}_0x582510={'start':_0x59ae4b,'end':_0x572c68};break;default:_0x582510['start']=_0x59ae4b;break;}return _0x582510;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 09df78d..6afd214 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 _0xe6a6=['isEmpty','isArray','split','limit','offset','sort','map','indexOf','priority','cast','col','substr','ASC','length','isObject','isString','unset','hasOwnProperty','omit','isNumeric','match','^[0-9]*$','isEmail','getFullTextValue','forEach','push','toString','join','fields'];(function(_0x34b783,_0x3047d9){var _0x334e97=function(_0x1db6f5){while(--_0x1db6f5){_0x34b783['push'](_0x34b783['shift']());}};_0x334e97(++_0x3047d9);}(_0xe6a6,0x195));var _0x6e6a=function(_0x44c952,_0xe04f35){_0x44c952=_0x44c952-0x0;var _0x12512b=_0xe6a6[_0x44c952];return _0x12512b;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0x6e6a('0x0')]=function(_0x3df0b6){var _0x28bc1f=null;if(_0x3df0b6){_0x28bc1f=_0x3df0b6['split'](',');}return _0x28bc1f;};exports['filters']=function(_0x3f7798){var _0x210027={};if(!_[_0x6e6a('0x1')](_0x3f7798)){_0x210027={};_['forOwn'](_0x3f7798,function(_0x277ccc,_0x24ac4d){try{_0x210027[_0x24ac4d]=_[_0x6e6a('0x2')](_0x277ccc)?_0x277ccc:JSON['parse'](_0x277ccc);}catch(_0x3aa1ac){_0x210027[_0x24ac4d]=_0x277ccc[_0x6e6a('0x3')](',');}});}return _0x210027;};exports[_0x6e6a('0x4')]=function(_0x363f94){_0x363f94=parseInt(_0x363f94,0xa);if(!_0x363f94||_0x363f94<0x0){_0x363f94=LIMIT_VALUE;}return _0x363f94;};exports[_0x6e6a('0x5')]=function(_0x2dcabc){_0x2dcabc=parseInt(_0x2dcabc,0xa);if(!_0x2dcabc||_0x2dcabc<0x0){_0x2dcabc=0x0;}return _0x2dcabc;};exports[_0x6e6a('0x6')]=function(_0xb66b5a){var _0x2d05a7,_0x948abb=null;if(_0xb66b5a){_0x2d05a7=_0xb66b5a[_0x6e6a('0x3')](',');_0x948abb=_[_0x6e6a('0x7')](_0x2d05a7,function(_0x22aa47){if(_0x22aa47[_0x6e6a('0x8')]('-')===0x0){return[_0x22aa47===_0x6e6a('0x9')?sequelize[_0x6e6a('0xa')](sequelize[_0x6e6a('0xb')]('priority'),'unsigned'):_0x22aa47[_0x6e6a('0xc')](0x1),'DESC'];}else{return[_0x22aa47===_0x6e6a('0x9')?sequelize['cast'](sequelize[_0x6e6a('0xb')](_0x6e6a('0x9')),'unsigned'):_0x22aa47,_0x6e6a('0xd')];}});}return _0x948abb;};exports['omit']=function(_0x2401ff,_0x4f2529){if(_[_0x6e6a('0x1')](_0x2401ff)){return _0x2401ff;}if(_[_0x6e6a('0x2')](_0x2401ff)){for(var _0x3978d2=0x0;_0x3978d2<_0x2401ff[_0x6e6a('0xe')];_0x3978d2+=0x1){_0x2401ff[_0x3978d2]=this['omit'](_0x2401ff[_0x3978d2],_0x4f2529);}return _0x2401ff;}if(!_[_0x6e6a('0xf')](_0x2401ff)){return _0x2401ff;}if(_[_0x6e6a('0x10')](_0x4f2529)){_0x4f2529=[_0x4f2529];}if(!_['isArray'](_0x4f2529)){return _0x2401ff;}for(var _0x1b3dcf=0x0;_0x1b3dcf<_0x4f2529[_0x6e6a('0xe')];_0x1b3dcf+=0x1){_[_0x6e6a('0x11')](_0x2401ff,_0x4f2529[_0x1b3dcf]);}for(var _0x30ac6b in _0x2401ff){if(_0x2401ff[_0x6e6a('0x12')](_0x30ac6b)){_0x2401ff[_0x30ac6b]=this[_0x6e6a('0x13')](_0x2401ff[_0x30ac6b],_0x4f2529);}}return _0x2401ff;};exports[_0x6e6a('0x14')]=function(_0xd8d995){return _0xd8d995[_0x6e6a('0x15')](RegExp(_0x6e6a('0x16')))?!![]:![];};exports[_0x6e6a('0x17')]=function(_0x178cb0){return _0x178cb0['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x6e6a('0x18')]=function(_0x132b97){var _0x50d8d1=[];_0x132b97[_0x6e6a('0x3')]('\x20')[_0x6e6a('0x19')](function(_0x463120){_0x50d8d1[_0x6e6a('0x1a')]('+'+_0x463120[_0x6e6a('0x1b')]()+'*');});return _0x50d8d1[_0x6e6a('0x1c')]('\x20');}; \ No newline at end of file +var _0x50e1=['isEmpty','forOwn','isArray','parse','limit','sort','map','priority','cast','col','DESC','omit','length','isString','hasOwnProperty','match','isEmail','getFullTextValue','push','join','lodash','sequelize','fields','split','filters'];(function(_0x5b482d,_0x230544){var _0x4d744f=function(_0x2a5246){while(--_0x2a5246){_0x5b482d['push'](_0x5b482d['shift']());}};_0x4d744f(++_0x230544);}(_0x50e1,0xf5));var _0x150e=function(_0x34c40b,_0x1b0983){_0x34c40b=_0x34c40b-0x0;var _0x565f13=_0x50e1[_0x34c40b];return _0x565f13;};'use strict';var _=require(_0x150e('0x0'));var sequelize=require(_0x150e('0x1'));var LIMIT_VALUE=0xfa;exports[_0x150e('0x2')]=function(_0xcda9db){var _0x382670=null;if(_0xcda9db){_0x382670=_0xcda9db[_0x150e('0x3')](',');}return _0x382670;};exports[_0x150e('0x4')]=function(_0xb4f9ff){var _0x140f5f={};if(!_[_0x150e('0x5')](_0xb4f9ff)){_0x140f5f={};_[_0x150e('0x6')](_0xb4f9ff,function(_0x51c1b8,_0x1ab825){try{_0x140f5f[_0x1ab825]=_[_0x150e('0x7')](_0x51c1b8)?_0x51c1b8:JSON[_0x150e('0x8')](_0x51c1b8);}catch(_0x321d65){_0x140f5f[_0x1ab825]=_0x51c1b8[_0x150e('0x3')](',');}});}return _0x140f5f;};exports[_0x150e('0x9')]=function(_0x5b704a){_0x5b704a=parseInt(_0x5b704a,0xa);if(!_0x5b704a||_0x5b704a<0x0){_0x5b704a=LIMIT_VALUE;}return _0x5b704a;};exports['offset']=function(_0x1da5f8){_0x1da5f8=parseInt(_0x1da5f8,0xa);if(!_0x1da5f8||_0x1da5f8<0x0){_0x1da5f8=0x0;}return _0x1da5f8;};exports[_0x150e('0xa')]=function(_0x2152e0){var _0x2844c0,_0x3d0d7f=null;if(_0x2152e0){_0x2844c0=_0x2152e0['split'](',');_0x3d0d7f=_[_0x150e('0xb')](_0x2844c0,function(_0x3dd08d){if(_0x3dd08d['indexOf']('-')===0x0){return[_0x3dd08d===_0x150e('0xc')?sequelize[_0x150e('0xd')](sequelize[_0x150e('0xe')](_0x150e('0xc')),'unsigned'):_0x3dd08d['substr'](0x1),_0x150e('0xf')];}else{return[_0x3dd08d===_0x150e('0xc')?sequelize[_0x150e('0xd')](sequelize['col'](_0x150e('0xc')),'unsigned'):_0x3dd08d,'ASC'];}});}return _0x3d0d7f;};exports[_0x150e('0x10')]=function(_0x475333,_0x400903){if(_['isEmpty'](_0x475333)){return _0x475333;}if(_[_0x150e('0x7')](_0x475333)){for(var _0x39d90d=0x0;_0x39d90d<_0x475333[_0x150e('0x11')];_0x39d90d+=0x1){_0x475333[_0x39d90d]=this[_0x150e('0x10')](_0x475333[_0x39d90d],_0x400903);}return _0x475333;}if(!_['isObject'](_0x475333)){return _0x475333;}if(_[_0x150e('0x12')](_0x400903)){_0x400903=[_0x400903];}if(!_['isArray'](_0x400903)){return _0x475333;}for(var _0x4bb0eb=0x0;_0x4bb0eb<_0x400903[_0x150e('0x11')];_0x4bb0eb+=0x1){_['unset'](_0x475333,_0x400903[_0x4bb0eb]);}for(var _0x5bf23f in _0x475333){if(_0x475333[_0x150e('0x13')](_0x5bf23f)){_0x475333[_0x5bf23f]=this[_0x150e('0x10')](_0x475333[_0x5bf23f],_0x400903);}}return _0x475333;};exports['isNumeric']=function(_0x35ef0b){return _0x35ef0b[_0x150e('0x14')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0x150e('0x15')]=function(_0x36d056){return _0x36d056[_0x150e('0x14')](/^\S+@\S+$/)?!![]:![];};exports[_0x150e('0x16')]=function(_0x5a55be){var _0x438798=[];_0x5a55be[_0x150e('0x3')]('\x20')['forEach'](function(_0x4d2ec3){_0x438798[_0x150e('0x17')]('+'+_0x4d2ec3['toString']()+'*');});return _0x438798[_0x150e('0x18')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 69bf34b..1446d64 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb70b=['path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','set','appPath','join','public','development','test','use','json\x20replacer','split','static','views','root','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','express','serve-favicon','body-parser','method-override'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0xb70b,0xce));var _0xbb70=function(_0x5eb1a7,_0x4acae9){_0x5eb1a7=_0x5eb1a7-0x0;var _0x39fdf3=_0xb70b[_0x5eb1a7];return _0x39fdf3;};'use strict';var express=require(_0xbb70('0x0'));var favicon=require(_0xbb70('0x1'));var bodyParser=require(_0xbb70('0x2'));var methodOverride=require(_0xbb70('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require('errorhandler');var path=require(_0xbb70('0x4'));var passport=require(_0xbb70('0x5'));var cors=require(_0xbb70('0x6'));var moment=require(_0xbb70('0x7'));var config=require(_0xbb70('0x8'));var db=require(_0xbb70('0x9'))['db'];exports[_0xbb70('0xa')]=function(_0x46af94){var _0x367fe6=_0x46af94[_0xbb70('0xb')](_0xbb70('0xc'));if(_0x367fe6===_0xbb70('0xd')){_0x46af94[_0xbb70('0xe')](_0xbb70('0xf'),path[_0xbb70('0x10')](config['root'],_0xbb70('0x11')));}if(_0x367fe6===_0xbb70('0x12')||_0x367fe6===_0xbb70('0x13')){_0x46af94[_0xbb70('0xe')](_0xbb70('0xf'),path[_0xbb70('0x10')](config['root'],'client'));_0x46af94[_0xbb70('0x14')](errorHandler());}_0x46af94['set'](_0xbb70('0x15'),function(_0xde99fb,_0x4d3a4c){if(this[_0xde99fb]instanceof Date){_0x4d3a4c=this[_0xde99fb]['toISOString']()[_0xbb70('0x16')]('.')[0x0]+'Z';}return _0x4d3a4c;});_0x46af94['use'](express[_0xbb70('0x17')](_0x46af94['get'](_0xbb70('0xf'))));_0x46af94[_0xbb70('0xe')](_0xbb70('0x18'),config[_0xbb70('0x19')]+_0xbb70('0x1a'));_0x46af94[_0xbb70('0x1b')](_0xbb70('0x1c'),require(_0xbb70('0x1d'))[_0xbb70('0x1e')]);_0x46af94['set'](_0xbb70('0x1f'),_0xbb70('0x1c'));_0x46af94[_0xbb70('0x14')](bodyParser[_0xbb70('0x20')]({'limit':_0xbb70('0x21'),'extended':!![]}));_0x46af94[_0xbb70('0x14')](bodyParser[_0xbb70('0x22')]({'limit':_0xbb70('0x21')}));_0x46af94['use'](cors());_0x46af94[_0xbb70('0x14')](methodOverride());_0x46af94[_0xbb70('0x14')](cookieParser());_0x46af94[_0xbb70('0x14')](passport['initialize']());}; \ No newline at end of file +var _0x36dd=['split','views','html','ejs','renderFile','use','urlencoded','json','50mb','initialize','express','serve-favicon','body-parser','method-override','errorhandler','path','passport','./environment','../mysqldb','get','env','production','set','root','public','development','appPath','client','json\x20replacer','toISOString'];(function(_0x4a9dd1,_0xfa8de5){var _0x2e761a=function(_0x546de0){while(--_0x546de0){_0x4a9dd1['push'](_0x4a9dd1['shift']());}};_0x2e761a(++_0xfa8de5);}(_0x36dd,0x1ae));var _0xd36d=function(_0x54a761,_0x431fd4){_0x54a761=_0x54a761-0x0;var _0x37d1da=_0x36dd[_0x54a761];return _0x37d1da;};'use strict';var express=require(_0xd36d('0x0'));var favicon=require(_0xd36d('0x1'));var bodyParser=require(_0xd36d('0x2'));var methodOverride=require(_0xd36d('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xd36d('0x4'));var path=require(_0xd36d('0x5'));var passport=require(_0xd36d('0x6'));var cors=require('cors');var moment=require('moment');var config=require(_0xd36d('0x7'));var db=require(_0xd36d('0x8'))['db'];exports['default']=function(_0x33b7dc){var _0x403cc8=_0x33b7dc[_0xd36d('0x9')](_0xd36d('0xa'));if(_0x403cc8===_0xd36d('0xb')){_0x33b7dc[_0xd36d('0xc')]('appPath',path['join'](config[_0xd36d('0xd')],_0xd36d('0xe')));}if(_0x403cc8===_0xd36d('0xf')||_0x403cc8==='test'){_0x33b7dc['set'](_0xd36d('0x10'),path['join'](config[_0xd36d('0xd')],_0xd36d('0x11')));_0x33b7dc['use'](errorHandler());}_0x33b7dc[_0xd36d('0xc')](_0xd36d('0x12'),function(_0xaaf197,_0x51b91b){if(this[_0xaaf197]instanceof Date){_0x51b91b=this[_0xaaf197][_0xd36d('0x13')]()[_0xd36d('0x14')]('.')[0x0]+'Z';}return _0x51b91b;});_0x33b7dc['use'](express['static'](_0x33b7dc[_0xd36d('0x9')](_0xd36d('0x10'))));_0x33b7dc['set'](_0xd36d('0x15'),config[_0xd36d('0xd')]+'/server/views');_0x33b7dc['engine'](_0xd36d('0x16'),require(_0xd36d('0x17'))[_0xd36d('0x18')]);_0x33b7dc[_0xd36d('0xc')]('view\x20engine','html');_0x33b7dc[_0xd36d('0x19')](bodyParser[_0xd36d('0x1a')]({'limit':'50mb','extended':!![]}));_0x33b7dc[_0xd36d('0x19')](bodyParser[_0xd36d('0x1b')]({'limit':_0xd36d('0x1c')}));_0x33b7dc[_0xd36d('0x19')](cors());_0x33b7dc[_0xd36d('0x19')](methodOverride());_0x33b7dc[_0xd36d('0x19')](cookieParser());_0x33b7dc[_0xd36d('0x19')](passport[_0xd36d('0x1d')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 887f4c0..37a612f 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 _0x16a6=['lodash','crypto','child_process','execSync','networkInterfaces','keys','filter','internal','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','join','createHash','md5','update','digest','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','macAddress','ipAddress','substring'];(function(_0x4088ee,_0x5e296b){var _0x46fac2=function(_0x29ef6f){while(--_0x29ef6f){_0x4088ee['push'](_0x4088ee['shift']());}};_0x46fac2(++_0x5e296b);}(_0x16a6,0x15c));var _0x616a=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x16a6[_0x5538d5];return _0x323b1a;};'use strict';var _=require(_0x616a('0x0'));var os=require('os');var crypto=require(_0x616a('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x616a('0x2'))[_0x616a('0x3')];function getInterfaces(){var _0x13f2fe=[];var _0x255d72=os[_0x616a('0x4')]();var _0x13cbc6=_['orderBy'](_[_0x616a('0x5')](_0x255d72));for(var _0x12e729=0x0;_0x12e729<_0x13cbc6['length'];_0x12e729++){var _0x56eaab=_0x255d72[_0x13cbc6[_0x12e729]][_0x616a('0x6')](function(_0x455029){return _0x455029['family']==='IPv4'&&_0x455029[_0x616a('0x7')]===![];});_0x13f2fe=_0x13f2fe['concat'](_0x56eaab);}return _0x13f2fe;}function getFirstInterface(){var _0x2eb046=_['head'](getInterfaces());return{'macAddress':_0x2eb046&&_0x2eb046[_0x616a('0x8')]?_0x2eb046[_0x616a('0x8')]:_0x616a('0x9'),'ipAddress':_0x2eb046&&_0x2eb046['address']?_0x2eb046[_0x616a('0xa')]:_0x616a('0xb')};}exports[_0x616a('0xc')]=getFirstInterface;function getCPUhash(){var _0x47674e=_[_0x616a('0xd')](os[_0x616a('0xe')]()[_0x616a('0xf')](function(_0x4122b7){return _0x4122b7['model'];}))[_0x616a('0x10')](':');return crypto[_0x616a('0x11')](_0x616a('0x12'))[_0x616a('0x13')](_0x47674e)[_0x616a('0x14')]('hex');}exports[_0x616a('0x15')]=function(){switch(os[_0x616a('0x16')]()){case _0x616a('0x17'):return exec(_0x616a('0x18'),{'encoding':_0x616a('0x19')})['replace']('\x0d\x0a','');default:var _0x204e68=getFirstInterface();var _0x1803bc=getCPUhash();var _0x4eb3ba=_0x1803bc+'|'+os['hostname']()+'|'+_0x204e68[_0x616a('0x1a')]+'|'+_0x204e68[_0x616a('0x1b')];var _0x23052c=crypto['createHash'](_0x616a('0x12'))[_0x616a('0x13')](_0x4eb3ba)['digest']('hex');return _0x23052c[_0x616a('0x1c')](0x0,0x8)+'-'+_0x23052c[_0x616a('0x1c')](0x8,0xc)+'-'+_0x23052c[_0x616a('0x1c')](0xc,0x10)+'-'+_0x23052c[_0x616a('0x1c')](0x10,0x14)+'-'+_0x23052c['substring'](0x14);}}; \ No newline at end of file +var _0x975f=['address','127.0.0.1','getFirstInterface','map','join','createHash','md5','update','digest','hex','getUuid','win32','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','execSync','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00'];(function(_0x2e8abb,_0x48c5f9){var _0x568c7d=function(_0xf533e1){while(--_0xf533e1){_0x2e8abb['push'](_0x2e8abb['shift']());}};_0x568c7d(++_0x48c5f9);}(_0x975f,0x109));var _0xf975=function(_0x54a2e4,_0x1ff92c){_0x54a2e4=_0x54a2e4-0x0;var _0x4742d0=_0x975f[_0x54a2e4];return _0x4742d0;};'use strict';var _=require(_0xf975('0x0'));var os=require('os');var crypto=require(_0xf975('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xf975('0x2')];function getInterfaces(){var _0x274f21=[];var _0x556f63=os[_0xf975('0x3')]();var _0x2d047c=_[_0xf975('0x4')](_[_0xf975('0x5')](_0x556f63));for(var _0x4a3199=0x0;_0x4a3199<_0x2d047c[_0xf975('0x6')];_0x4a3199++){var _0x5a9aca=_0x556f63[_0x2d047c[_0x4a3199]][_0xf975('0x7')](function(_0x2018ea){return _0x2018ea['family']===_0xf975('0x8')&&_0x2018ea[_0xf975('0x9')]===![];});_0x274f21=_0x274f21[_0xf975('0xa')](_0x5a9aca);}return _0x274f21;}function getFirstInterface(){var _0x53dc00=_[_0xf975('0xb')](getInterfaces());return{'macAddress':_0x53dc00&&_0x53dc00[_0xf975('0xc')]?_0x53dc00['mac']:_0xf975('0xd'),'ipAddress':_0x53dc00&&_0x53dc00[_0xf975('0xe')]?_0x53dc00[_0xf975('0xe')]:_0xf975('0xf')};}exports[_0xf975('0x10')]=getFirstInterface;function getCPUhash(){var _0x22f122=_[_0xf975('0x4')](os['cpus']()[_0xf975('0x11')](function(_0x34111a){return _0x34111a['model'];}))[_0xf975('0x12')](':');return crypto[_0xf975('0x13')](_0xf975('0x14'))[_0xf975('0x15')](_0x22f122)[_0xf975('0x16')](_0xf975('0x17'));}exports[_0xf975('0x18')]=function(){switch(os['platform']()){case _0xf975('0x19'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0xf975('0x1a')]('\x0d\x0a','');default:var _0x168a76=getFirstInterface();var _0x24b7dc=getCPUhash();var _0x3bcc62=_0x24b7dc+'|'+os[_0xf975('0x1b')]()+'|'+_0x168a76[_0xf975('0x1c')]+'|'+_0x168a76[_0xf975('0x1d')];var _0x4f6568=crypto['createHash'](_0xf975('0x14'))[_0xf975('0x15')](_0x3bcc62)[_0xf975('0x16')](_0xf975('0x17'));return _0x4f6568[_0xf975('0x1e')](0x0,0x8)+'-'+_0x4f6568[_0xf975('0x1e')](0x8,0xc)+'-'+_0x4f6568['substring'](0xc,0x10)+'-'+_0x4f6568[_0xf975('0x1e')](0x10,0x14)+'-'+_0x4f6568[_0xf975('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 2b980ce..f3e68e5 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 _0x39e6=['createDecipher','aes-256-ctr','||FIELD||VALUE||\x0a','User','admin','fullname','email','|uuid|','|machineUuid|','getFirstInterface','ipAddress','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','info','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','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','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','pkginfo','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','then','catch','createCipher','session','update','utf8','base64','final'];(function(_0x1067cb,_0x21d610){var _0x2fa954=function(_0x5effe4){while(--_0x5effe4){_0x1067cb['push'](_0x1067cb['shift']());}};_0x2fa954(++_0x21d610);}(_0x39e6,0x9e));var _0x639e=function(_0x292c23,_0x341359){_0x292c23=_0x292c23-0x0;var _0x71b09b=_0x39e6[_0x292c23];return _0x71b09b;};'use strict';var util=require(_0x639e('0x0'));var crypto=require('crypto');var moment=require(_0x639e('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x639e('0x2'))(module,_0x639e('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x639e('0x4'));var hardware=require(_0x639e('0x5'));var logger=require(_0x639e('0x6'))(_0x639e('0x7'));var jira=require(_0x639e('0x8'));var HOST=_0x639e('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x3812c0){return new BPromise(function(_0x21db36,_0x36b11f){var _0x134eec=util[_0x639e('0xa')](_0x639e('0xb'),HOST,_0x3812c0,module[_0x639e('0xc')][_0x639e('0x3')]);if(oldToken){_0x134eec=util[_0x639e('0xa')](_0x639e('0xd'),HOST,_0x3812c0,module[_0x639e('0xc')][_0x639e('0x3')],oldToken);}var _0x5cf5c9={'uri':_0x134eec,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5cf5c9)[_0x639e('0xe')](function(_0x42ea7f){_0x21db36(_0x42ea7f);})[_0x639e('0xf')](function(_0x109764){_0x36b11f(_0x109764);});});}function encryptDate(_0x1be347){var _0x16117b=crypto[_0x639e('0x10')]('aes-256-ctr',config['secrets'][_0x639e('0x11')]);var _0x3a1693=_0x16117b[_0x639e('0x12')](_0x1be347,_0x639e('0x13'),_0x639e('0x14'));_0x3a1693+=_0x16117b[_0x639e('0x15')]('base64');return _0x3a1693;}function decryptDate(_0x31826a){var _0x20bfbb=crypto[_0x639e('0x16')](_0x639e('0x17'),config['secrets'][_0x639e('0x11')]);var _0x4b9634=_0x20bfbb[_0x639e('0x12')](_0x31826a,_0x639e('0x14'),_0x639e('0x13'));_0x4b9634+=_0x20bfbb[_0x639e('0x15')](_0x639e('0x13'));return _0x4b9634;}function sendJiraAlert(_0x1c023e,_0x56e381,_0x1e8310){var _0x34baca=_0x639e('0x18');return db[_0x639e('0x19')]['findOne']({'where':{'role':_0x639e('0x1a')},'attributes':[_0x639e('0x1b'),_0x639e('0x1c')],'raw':!![]})[_0x639e('0xe')](function(_0x27d79b){ADMIN=_0x27d79b;_0x34baca+='|reason|'+_0x1e8310+'|\x0a';_0x34baca+=_0x639e('0x1d')+_0x1c023e+'|\x0a';_0x34baca+=_0x639e('0x1e')+_0x56e381+'|\x0a';_0x34baca+='|name|'+ADMIN[_0x639e('0x1b')]+'|\x0a';_0x34baca+='|email|'+ADMIN['email']+'|\x0a';return _0x34baca;})[_0x639e('0xe')](function(_0x3813f6){var _0x3ab673=hardware[_0x639e('0x1f')]()[_0x639e('0x20')];return jira['openIssue']({'key':_0x639e('0x21'),'summary':_0x639e('0x22'),'description':_0x3813f6,'issuetype':_0x639e('0x23'),'oldToken':_0x1c023e,'newToken':_0x56e381,'email':ADMIN[_0x639e('0x1c')],'name':ADMIN[_0x639e('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x3ab673});});}function manageLicense(_0x5f27f6,_0x381554){var _0x97665a=_0x381554[_0x639e('0x24')]({'plain':!![]});httpRequest(_0x5f27f6)[_0x639e('0xe')](function(_0x5b5b8c){if(oldToken){oldToken=undefined;}if(_0x5b5b8c[_0x639e('0x25')]){if(!_0x97665a[_0x639e('0x7')]&&_0x97665a[_0x639e('0x7')]!=_0x5b5b8c['license']||_0x97665a[_0x639e('0x7')]&&_0x97665a['data2']){logger[_0x639e('0x26')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x97665a['license']&&!_0x97665a[_0x639e('0x27')]&&_0x97665a[_0x639e('0x7')]!=_0x5b5b8c[_0x639e('0x7')]){logger[_0x639e('0x26')](_0x639e('0x28'));}if(_0x97665a[_0x639e('0x7')]&&!_0x97665a['data2']&&_0x97665a[_0x639e('0x7')]==_0x5b5b8c[_0x639e('0x7')]){return _0x381554;}return _0x381554['update']({'data1':_0x5f27f6,'data2':null,'license':_0x5b5b8c['license']});}else{if(_0x5b5b8c[_0x639e('0x7')]||_0x97665a[_0x639e('0x7')]){if(!_0x97665a[_0x639e('0x27')]){if(_0x97665a['data1']==_0x5f27f6){GRAY_PERIOD_REASON=_0x639e('0x29');logger['info'](_0x639e('0x2a'));}else{GRAY_PERIOD_REASON=_0x639e('0x2b');oldToken=_0x97665a[_0x639e('0x2c')];logger['info'](_0x639e('0x2d'),_0x97665a['data1'],_0x5f27f6);}sendJiraAlert(_0x97665a[_0x639e('0x2c')],_0x5b5b8c[_0x639e('0x2e')],GRAY_PERIOD_REASON);logger[_0x639e('0x26')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x639e('0x2f')](),moment()[_0x639e('0xa')](_0x639e('0x30')));return _0x381554['update']({'data2':encryptDate(moment()[_0x639e('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x639e('0x31')](decryptDate(_0x97665a[_0x639e('0x27')]),_0x639e('0x32'))>DAYS){logger[_0x639e('0x26')](_0x639e('0x33'),moment()['format'](_0x639e('0x30')));return _0x381554[_0x639e('0x12')]({'data1':_0x5f27f6,'data2':null,'license':null});}}}else{if(_0x97665a[_0x639e('0x2c')]!=_0x5f27f6){logger[_0x639e('0x26')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x97665a[_0x639e('0x2c')],_0x5f27f6);return _0x381554[_0x639e('0x12')]({'data1':_0x5f27f6,'data2':null,'license':null});}}}return _0x381554;})[_0x639e('0xe')](function(_0x56b347){_0x381554=_0x56b347;})[_0x639e('0xf')](function(_0x47b97f){logger[_0x639e('0x34')](_0x47b97f[_0x639e('0x35')]);})[_0x639e('0x36')](function(){setTimeout(function(){manageLicense(hardware[_0x639e('0x37')](),_0x381554);},TIME);});}function defaultLicense(){var _0x9cc80=hardware[_0x639e('0x37')]();if(_0x9cc80){return db['License'][_0x639e('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x9cc80}})[_0x639e('0x39')](function(_0x55a8e2,_0x26e637){logger['info'](_0x639e('0x3a'),_0x9cc80);manageLicense(_0x9cc80,_0x55a8e2);})[_0x639e('0xf')](function(_0x3ba300){logger[_0x639e('0x34')](_0x3ba300[_0x639e('0x35')]);});}}exports[_0x639e('0x3b')]=defaultLicense; \ No newline at end of file +var _0xd481=['License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','pkginfo','version','../../mysqldb','./hardware','license','../../api/jira/jira.controller','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','aes-256-ctr','secrets','utf8','base64','final','createDecipher','session','update','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|uuid|','|machineUuid|','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','get','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','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','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid'];(function(_0x38567b,_0x32ba4e){var _0x2ebec5=function(_0x207708){while(--_0x207708){_0x38567b['push'](_0x38567b['shift']());}};_0x2ebec5(++_0x32ba4e);}(_0xd481,0x1e4));var _0x1d48=function(_0x1383a3,_0xd5f97a){_0x1383a3=_0x1383a3-0x0;var _0x43b62c=_0xd481[_0x1383a3];return _0x43b62c;};'use strict';var util=require(_0x1d48('0x0'));var crypto=require('crypto');var moment=require(_0x1d48('0x1'));var rp=require(_0x1d48('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x1d48('0x3'))(module,_0x1d48('0x4'));var db=require(_0x1d48('0x5'))['db'];var config=require('../environment');var hardware=require(_0x1d48('0x6'));var logger=require('../logger')(_0x1d48('0x7'));var jira=require(_0x1d48('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x472584){return new BPromise(function(_0x3099cc,_0x3b8bd4){var _0x27c383=util[_0x1d48('0x9')](_0x1d48('0xa'),HOST,_0x472584,module[_0x1d48('0xb')][_0x1d48('0x4')]);if(oldToken){_0x27c383=util[_0x1d48('0x9')](_0x1d48('0xc'),HOST,_0x472584,module[_0x1d48('0xb')][_0x1d48('0x4')],oldToken);}var _0x4dd9d3={'uri':_0x27c383,'method':_0x1d48('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x4dd9d3)[_0x1d48('0xe')](function(_0xf54674){_0x3099cc(_0xf54674);})[_0x1d48('0xf')](function(_0x2923f5){_0x3b8bd4(_0x2923f5);});});}function encryptDate(_0x145afb){var _0xa1246f=crypto[_0x1d48('0x10')](_0x1d48('0x11'),config[_0x1d48('0x12')]['session']);var _0x3034d5=_0xa1246f['update'](_0x145afb,_0x1d48('0x13'),_0x1d48('0x14'));_0x3034d5+=_0xa1246f[_0x1d48('0x15')](_0x1d48('0x14'));return _0x3034d5;}function decryptDate(_0x4f9f04){var _0x1845bd=crypto[_0x1d48('0x16')](_0x1d48('0x11'),config['secrets'][_0x1d48('0x17')]);var _0x433c92=_0x1845bd[_0x1d48('0x18')](_0x4f9f04,_0x1d48('0x14'),_0x1d48('0x13'));_0x433c92+=_0x1845bd[_0x1d48('0x15')](_0x1d48('0x13'));return _0x433c92;}function sendJiraAlert(_0x258c7a,_0xec25a1,_0x544426){var _0x5173a3=_0x1d48('0x19');return db[_0x1d48('0x1a')][_0x1d48('0x1b')]({'where':{'role':_0x1d48('0x1c')},'attributes':[_0x1d48('0x1d'),_0x1d48('0x1e')],'raw':!![]})[_0x1d48('0xe')](function(_0x1b0520){ADMIN=_0x1b0520;_0x5173a3+='|reason|'+_0x544426+'|\x0a';_0x5173a3+=_0x1d48('0x1f')+_0x258c7a+'|\x0a';_0x5173a3+=_0x1d48('0x20')+_0xec25a1+'|\x0a';_0x5173a3+='|name|'+ADMIN['fullname']+'|\x0a';_0x5173a3+=_0x1d48('0x21')+ADMIN[_0x1d48('0x1e')]+'|\x0a';return _0x5173a3;})[_0x1d48('0xe')](function(_0x20699a){var _0x14b6c9=hardware[_0x1d48('0x22')]()[_0x1d48('0x23')];return jira[_0x1d48('0x24')]({'key':_0x1d48('0x25'),'summary':_0x1d48('0x26'),'description':_0x20699a,'issuetype':'Alert','oldToken':_0x258c7a,'newToken':_0xec25a1,'email':ADMIN['email'],'name':ADMIN[_0x1d48('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x14b6c9});});}function manageLicense(_0x2c2b65,_0x42f8f6){var _0x2bf773=_0x42f8f6[_0x1d48('0x27')]({'plain':!![]});httpRequest(_0x2c2b65)[_0x1d48('0xe')](function(_0x54dc83){if(oldToken){oldToken=undefined;}if(_0x54dc83['active']){if(!_0x2bf773[_0x1d48('0x7')]&&_0x2bf773[_0x1d48('0x7')]!=_0x54dc83['license']||_0x2bf773[_0x1d48('0x7')]&&_0x2bf773[_0x1d48('0x28')]){logger[_0x1d48('0x29')](_0x1d48('0x2a'));}if(_0x2bf773['license']&&!_0x2bf773[_0x1d48('0x28')]&&_0x2bf773[_0x1d48('0x7')]!=_0x54dc83[_0x1d48('0x7')]){logger[_0x1d48('0x29')](_0x1d48('0x2b'));}if(_0x2bf773['license']&&!_0x2bf773[_0x1d48('0x28')]&&_0x2bf773[_0x1d48('0x7')]==_0x54dc83[_0x1d48('0x7')]){return _0x42f8f6;}return _0x42f8f6[_0x1d48('0x18')]({'data1':_0x2c2b65,'data2':null,'license':_0x54dc83[_0x1d48('0x7')]});}else{if(_0x54dc83['license']||_0x2bf773[_0x1d48('0x7')]){if(!_0x2bf773[_0x1d48('0x28')]){if(_0x2bf773[_0x1d48('0x2c')]==_0x2c2b65){GRAY_PERIOD_REASON='Disabled';logger[_0x1d48('0x29')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x2bf773[_0x1d48('0x2c')];logger[_0x1d48('0x29')](_0x1d48('0x2d'),_0x2bf773['data1'],_0x2c2b65);}sendJiraAlert(_0x2bf773[_0x1d48('0x2c')],_0x54dc83[_0x1d48('0x2e')],GRAY_PERIOD_REASON);logger['info'](_0x1d48('0x2f'),GRAY_PERIOD_REASON[_0x1d48('0x30')](),moment()[_0x1d48('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x42f8f6[_0x1d48('0x18')]({'data2':encryptDate(moment()['format'](_0x1d48('0x31')))});}else{if(moment()[_0x1d48('0x32')](decryptDate(_0x2bf773[_0x1d48('0x28')]),'days')>DAYS){logger['info'](_0x1d48('0x33'),moment()[_0x1d48('0x9')](_0x1d48('0x31')));return _0x42f8f6[_0x1d48('0x18')]({'data1':_0x2c2b65,'data2':null,'license':null});}}}else{if(_0x2bf773[_0x1d48('0x2c')]!=_0x2c2b65){logger[_0x1d48('0x29')](_0x1d48('0x2d'),_0x2bf773[_0x1d48('0x2c')],_0x2c2b65);return _0x42f8f6[_0x1d48('0x18')]({'data1':_0x2c2b65,'data2':null,'license':null});}}}return _0x42f8f6;})[_0x1d48('0xe')](function(_0x1474ab){_0x42f8f6=_0x1474ab;})[_0x1d48('0xf')](function(_0x78d04){logger[_0x1d48('0x34')](_0x78d04[_0x1d48('0x35')]);})[_0x1d48('0x36')](function(){setTimeout(function(){manageLicense(hardware[_0x1d48('0x37')](),_0x42f8f6);},TIME);});}function defaultLicense(){var _0xb3c168=hardware[_0x1d48('0x37')]();if(_0xb3c168){return db[_0x1d48('0x38')][_0x1d48('0x39')]({'where':{'id':0x1},'defaults':{'data1':_0xb3c168}})[_0x1d48('0x3a')](function(_0x33010f,_0x78ca07){logger[_0x1d48('0x29')](_0x1d48('0x3b'),_0xb3c168);manageLicense(_0xb3c168,_0x33010f);})[_0x1d48('0xf')](function(_0x23f638){logger['error'](_0x23f638[_0x1d48('0x35')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 567ecbf..e11ef61 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 _0x5e20=['days','grayReason','changed','data1','message','2027-01-01T00:00:00.000Z','getLicense','License','then','checkLicense','crypto','lodash','moment','./hardware','../environment','../../mysqldb','license','data2','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','demo','uuid','getUuid','createDecipher','session','final','deadline','add'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x5e20,0xd6));var _0x05e2=function(_0x22c5bf,_0x299c2a){_0x22c5bf=_0x22c5bf-0x0;var _0x403675=_0x5e20[_0x22c5bf];return _0x403675;};'use strict';var crypto=require(_0x05e2('0x0'));var util=require('util');var _=require(_0x05e2('0x1'));var moment=require(_0x05e2('0x2'));var hardware=require(_0x05e2('0x3'));var config=require(_0x05e2('0x4'));var db=require(_0x05e2('0x5'))['db'];function checkLicense(_0x3c9e28,_0x2f7043){if(_0x3c9e28){try{var _0x51dced=_0x2f7043||_0x3c9e28[_0x05e2('0x6')];if(_['isEmpty'](_0x51dced)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x300495=_0x3c9e28['data1'];var _0x4f42c9=_0x3c9e28[_0x05e2('0x7')];var _0x46ae25=_0x300495[_0x05e2('0x8')]('-')[0x4];var _0x343923=_0x300495[_0x05e2('0x8')]('-')[0x0];var _0x178125=crypto['createDecipher'](_0x05e2('0x9'),util[_0x05e2('0xa')](_0x05e2('0xb'),_0x46ae25,_0x300495,_0x343923));var _0x4ce230=_0x178125[_0x05e2('0xc')](_0x51dced,_0x05e2('0xd'),_0x05e2('0xe'));_0x4ce230+=_0x178125['final'](_0x05e2('0xe'));var _0x5c23a3=JSON[_0x05e2('0xf')](_0x4ce230);_0x5c23a3[_0x05e2('0x10')]=![];_0x5c23a3[_0x05e2('0x11')]=_0x300495;_0x5c23a3['machineUuid']=hardware[_0x05e2('0x12')]();if(_0x4f42c9){var _0x341516=crypto[_0x05e2('0x13')](_0x05e2('0x9'),config['secrets'][_0x05e2('0x14')]);var _0x4434c7=_0x341516[_0x05e2('0xc')](_0x4f42c9,_0x05e2('0xd'),_0x05e2('0xe'));_0x4434c7+=_0x341516[_0x05e2('0x15')](_0x05e2('0xe'));_0x5c23a3['gray']=_0x4434c7;_0x5c23a3[_0x05e2('0x16')]=moment(_0x4434c7)[_0x05e2('0x17')](0x7,_0x05e2('0x18'))[_0x05e2('0xa')]();_0x5c23a3[_0x05e2('0x19')]=_0x5c23a3[_0x05e2('0x11')]!=_0x5c23a3['machineUuid']?_0x05e2('0x1a'):'disabled';}return _0x5c23a3;}catch(_0x4a2500){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x3c9e28[_0x05e2('0x1b')],'machineUuid':hardware[_0x05e2('0x12')](),'message':_0x4a2500[_0x05e2('0x1c')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x05e2('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x3c9e28['data1'],'machineUuid':hardware[_0x05e2('0x12')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x05e2('0x1e')]=function(_0x5bac98){return db[_0x05e2('0x1f')]['find'](_['defaults'](_0x5bac98,{'raw':!![],'where':{'id':0x1}}))[_0x05e2('0x20')](function(_0x5598e8){return checkLicense(_0x5598e8,null);});};exports[_0x05e2('0x21')]=checkLicense; \ No newline at end of file +var _0xf7f6=['format','%s:%s:%s','update','base64','final','utf8','parse','demo','uuid','machineUuid','aes-256-ctr','secrets','gray','deadline','add','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','getLicense','find','defaults','then','checkLicense','crypto','util','lodash','moment','../environment','../../mysqldb','license','License\x20key\x20value\x20not\x20found','data1','data2','createDecipher'];(function(_0x4944f1,_0x482a52){var _0x433494=function(_0x40d7f3){while(--_0x40d7f3){_0x4944f1['push'](_0x4944f1['shift']());}};_0x433494(++_0x482a52);}(_0xf7f6,0x1e3));var _0x6f7f=function(_0x47ef08,_0x8aee75){_0x47ef08=_0x47ef08-0x0;var _0x53ffea=_0xf7f6[_0x47ef08];return _0x53ffea;};'use strict';var crypto=require(_0x6f7f('0x0'));var util=require(_0x6f7f('0x1'));var _=require(_0x6f7f('0x2'));var moment=require(_0x6f7f('0x3'));var hardware=require('./hardware');var config=require(_0x6f7f('0x4'));var db=require(_0x6f7f('0x5'))['db'];function checkLicense(_0x377572,_0x458568){if(_0x377572){try{var _0x51a951=_0x458568||_0x377572[_0x6f7f('0x6')];if(_['isEmpty'](_0x51a951)){throw new Error(_0x6f7f('0x7'));}var _0x24a780=_0x377572[_0x6f7f('0x8')];var _0x1485e0=_0x377572[_0x6f7f('0x9')];var _0x1cde5a=_0x24a780['split']('-')[0x4];var _0x242468=_0x24a780['split']('-')[0x0];var _0x380f03=crypto[_0x6f7f('0xa')]('aes-256-ctr',util[_0x6f7f('0xb')](_0x6f7f('0xc'),_0x1cde5a,_0x24a780,_0x242468));var _0x12c551=_0x380f03[_0x6f7f('0xd')](_0x51a951,_0x6f7f('0xe'),'utf8');_0x12c551+=_0x380f03[_0x6f7f('0xf')](_0x6f7f('0x10'));var _0x34c302=JSON[_0x6f7f('0x11')](_0x12c551);_0x34c302[_0x6f7f('0x12')]=![];_0x34c302[_0x6f7f('0x13')]=_0x24a780;_0x34c302[_0x6f7f('0x14')]=hardware['getUuid']();if(_0x1485e0){var _0x304780=crypto['createDecipher'](_0x6f7f('0x15'),config[_0x6f7f('0x16')]['session']);var _0x3d6219=_0x304780[_0x6f7f('0xd')](_0x1485e0,_0x6f7f('0xe'),_0x6f7f('0x10'));_0x3d6219+=_0x304780['final']('utf8');_0x34c302[_0x6f7f('0x17')]=_0x3d6219;_0x34c302[_0x6f7f('0x18')]=moment(_0x3d6219)[_0x6f7f('0x19')](0x7,_0x6f7f('0x1a'))['format']();_0x34c302[_0x6f7f('0x1b')]=_0x34c302[_0x6f7f('0x13')]!=_0x34c302[_0x6f7f('0x14')]?_0x6f7f('0x1c'):_0x6f7f('0x1d');}return _0x34c302;}catch(_0x48640d){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6f7f('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x377572['data1'],'machineUuid':hardware['getUuid'](),'message':_0x48640d['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x6f7f('0x1f'),'uuid':_0x377572[_0x6f7f('0x8')],'machineUuid':hardware[_0x6f7f('0x20')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x6f7f('0x21')]=function(_0x190e3a){return db['License'][_0x6f7f('0x22')](_[_0x6f7f('0x23')](_0x190e3a,{'raw':!![],'where':{'id':0x1}}))[_0x6f7f('0x24')](function(_0x799684){return checkLicense(_0x799684,null);});};exports[_0x6f7f('0x25')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 31b6460..3bb1dfd 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 _0xc9fb=['exports','http://localhost:9000','myappanuglar-secret','secret'];(function(_0xc2b4c8,_0x756a49){var _0x402443=function(_0x571bae){while(--_0x571bae){_0xc2b4c8['push'](_0xc2b4c8['shift']());}};_0x402443(++_0x756a49);}(_0xc9fb,0x148));var _0xbc9f=function(_0x261a6f,_0x2690db){_0x261a6f=_0x261a6f-0x0;var _0x25ebf3=_0xc9fb[_0x261a6f];return _0x25ebf3;};'use strict';module[_0xbc9f('0x0')]={'DOMAIN':_0xbc9f('0x1'),'SESSION_SECRET':_0xbc9f('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xbc9f('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x4a96=['http://localhost:9000','secret','exports'];(function(_0x1bd395,_0x51fb41){var _0x2d9ce5=function(_0x29eda4){while(--_0x29eda4){_0x1bd395['push'](_0x1bd395['shift']());}};_0x2d9ce5(++_0x51fb41);}(_0x4a96,0x19d));var _0x64a9=function(_0x25f75a,_0x1c34cf){_0x25f75a=_0x25f75a-0x0;var _0x4ae1b3=_0x4a96[_0x25f75a];return _0x4ae1b3;};'use strict';module[_0x64a9('0x0')]={'DOMAIN':_0x64a9('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x64a9('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 50349b4..4f4333e 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0265=['format','%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','File','%s-%s','error','info','transports','Console','env','debugLevel','moment','winston','util','path','INFO','join','log','xcally'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x0265,0xf5));var _0x5026=function(_0x1bb6ba,_0x57520c){_0x1bb6ba=_0x1bb6ba-0x0;var _0x211680=_0x0265[_0x1bb6ba];return _0x211680;};'use strict';var moment=require(_0x5026('0x0'));var winston=require(_0x5026('0x1'));var util=require(_0x5026('0x2'));var path=require(_0x5026('0x3'));var debugLevel=_0x5026('0x4');function filename(_0x589fe3,_0x25c95c){return path[_0x5026('0x5')]('/var',_0x5026('0x6'),_0x5026('0x7'),util[_0x5026('0x8')](_0x5026('0x9'),_0x589fe3,_0x25c95c));}function formatter(_0x4e7ed4,_0x56f007){return util[_0x5026('0x8')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x5026('0x8')](_0x5026('0xa')),_0x56f007[_0x5026('0xb')][_0x5026('0xc')](),_0x4e7ed4,_0x56f007['message']);}module[_0x5026('0xd')]=function(_0x4412b0){return new winston[(_0x5026('0xe'))]({'transports':[new winston['transports'][(_0x5026('0xf'))]({'name':util[_0x5026('0x8')](_0x5026('0x10'),_0x4412b0,'error'),'filename':filename(_0x4412b0,_0x5026('0x11')),'level':_0x5026('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3956a3){return formatter(_0x4412b0,_0x3956a3);}}),new winston['transports'][(_0x5026('0xf'))]({'name':util[_0x5026('0x8')](_0x5026('0x10'),_0x4412b0,_0x5026('0x12')),'filename':filename(_0x4412b0,_0x5026('0x12')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4d99db){return formatter(_0x4412b0,_0x4d99db);}}),new winston[(_0x5026('0x13'))][(_0x5026('0x14'))]({'level':process[_0x5026('0x15')][_0x5026('0x16')]||debugLevel,'json':![],'formatter':function(_0x2c814d){return formatter(_0x4412b0,_0x2c814d);}})]});}; \ No newline at end of file +var _0x9930=['error','info','Console','debugLevel','moment','winston','path','INFO','join','log','xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','message','exports','Logger','transports','File','%s-%s'];(function(_0x18b36c,_0x4ca518){var _0x3eeedb=function(_0x12a829){while(--_0x12a829){_0x18b36c['push'](_0x18b36c['shift']());}};_0x3eeedb(++_0x4ca518);}(_0x9930,0x11c));var _0x0993=function(_0x3674f2,_0x4802c9){_0x3674f2=_0x3674f2-0x0;var _0x5b7aeb=_0x9930[_0x3674f2];return _0x5b7aeb;};'use strict';var moment=require(_0x0993('0x0'));var winston=require(_0x0993('0x1'));var util=require('util');var path=require(_0x0993('0x2'));var debugLevel=_0x0993('0x3');function filename(_0x21f82d,_0x5c11d8){return path[_0x0993('0x4')]('/var',_0x0993('0x5'),_0x0993('0x6'),util[_0x0993('0x7')]('%s-%s.log',_0x21f82d,_0x5c11d8));}function formatter(_0x50317c,_0x422b26){return util['format'](_0x0993('0x8'),moment()[_0x0993('0x7')](_0x0993('0x9')),_0x422b26['level']['toUpperCase'](),_0x50317c,_0x422b26[_0x0993('0xa')]);}module[_0x0993('0xb')]=function(_0x50eddd){return new winston[(_0x0993('0xc'))]({'transports':[new winston[(_0x0993('0xd'))][(_0x0993('0xe'))]({'name':util[_0x0993('0x7')](_0x0993('0xf'),_0x50eddd,'error'),'filename':filename(_0x50eddd,_0x0993('0x10')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x452324){return formatter(_0x50eddd,_0x452324);}}),new winston[(_0x0993('0xd'))][(_0x0993('0xe'))]({'name':util[_0x0993('0x7')](_0x0993('0xf'),_0x50eddd,_0x0993('0x11')),'filename':filename(_0x50eddd,'info'),'level':_0x0993('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x56b6f9){return formatter(_0x50eddd,_0x56b6f9);}}),new winston[(_0x0993('0xd'))][(_0x0993('0x12'))]({'level':process['env'][_0x0993('0x13')]||debugLevel,'json':![],'formatter':function(_0x50f2f9){return formatter(_0x50eddd,_0x50f2f9);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 9e48cf5..862bbdb 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 _0xbf03=['exports','path','join','../../services/express/index.js','ami','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x578d15,_0x17eb68){var _0x59211d=function(_0x4a6d57){while(--_0x4a6d57){_0x578d15['push'](_0x578d15['shift']());}};_0x59211d(++_0x17eb68);}(_0xbf03,0x1e1));var _0x3bf0=function(_0x317870,_0x1a8203){_0x317870=_0x317870-0x0;var _0x157232=_0xbf03[_0x317870];return _0x157232;};'use strict';var path=require(_0x3bf0('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x3bf0('0x1')](__dirname,_0x3bf0('0x2'))},{'name':_0x3bf0('0x3'),'script':path[_0x3bf0('0x1')](__dirname,'../../services/ami/index.js')},{'name':_0x3bf0('0x4'),'script':path[_0x3bf0('0x1')](__dirname,'../../services/agi/index.js')},{'name':_0x3bf0('0x5'),'script':path['join'](__dirname,_0x3bf0('0x6'))},{'name':_0x3bf0('0x7'),'script':path[_0x3bf0('0x1')](__dirname,_0x3bf0('0x8'))},{'name':_0x3bf0('0x9'),'script':path[_0x3bf0('0x1')](__dirname,_0x3bf0('0xa'))}]};module[_0x3bf0('0xb')]=config; \ No newline at end of file +var _0x96c8=['../../services/xdr/index.js','express','join','ami','../../services/agi/index.js','email','routing','../../services/routing/index.js','xdr'];(function(_0x33ee27,_0x2d1d4b){var _0x20d77a=function(_0x48fafa){while(--_0x48fafa){_0x33ee27['push'](_0x33ee27['shift']());}};_0x20d77a(++_0x2d1d4b);}(_0x96c8,0xa3));var _0x896c=function(_0x4a99fb,_0x4f61f2){_0x4a99fb=_0x4a99fb-0x0;var _0x1ddcd9=_0x96c8[_0x4a99fb];return _0x1ddcd9;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x896c('0x0'),'script':path[_0x896c('0x1')](__dirname,'../../services/express/index.js')},{'name':_0x896c('0x2'),'script':path[_0x896c('0x1')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x896c('0x1')](__dirname,_0x896c('0x3'))},{'name':_0x896c('0x4'),'script':path[_0x896c('0x1')](__dirname,'../../services/email/index.js')},{'name':_0x896c('0x5'),'script':path[_0x896c('0x1')](__dirname,_0x896c('0x6'))},{'name':_0x896c('0x7'),'script':path[_0x896c('0x1')](__dirname,_0x896c('0x8'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index b629def..afa67c9 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 _0xf6ca=['restart','list','delete','dump','saved','pm2','bluebird','./config','then','disconnect','stop'];(function(_0x43bacb,_0x2d6964){var _0x157f03=function(_0x301fb2){while(--_0x301fb2){_0x43bacb['push'](_0x43bacb['shift']());}};_0x157f03(++_0x2d6964);}(_0xf6ca,0x15a));var _0xaf6c=function(_0x208e33,_0x3d7e7a){_0x208e33=_0x208e33-0x0;var _0x352029=_0xf6ca[_0x208e33];return _0x352029;};'use strict';var pm2=require(_0xaf6c('0x0'));var BPromise=require(_0xaf6c('0x1'));var config=require(_0xaf6c('0x2'));function connect(){return new BPromise(function(_0x53853a,_0x2ceaaf){return pm2['connect'](function(_0x534200){if(_0x534200){return _0x2ceaaf(_0x534200);}return _0x53853a('connected');});});};exports['start']=function(_0x370fbd){return connect()[_0xaf6c('0x3')](function(){return new BPromise(function(_0x5666a4,_0x4014b1){return pm2['start'](_0x370fbd,function(_0x43cb25,_0xaf780c){if(_0x43cb25){return _0x4014b1(_0x43cb25);}pm2[_0xaf6c('0x4')]();return _0x5666a4(_0xaf780c);});});});};exports[_0xaf6c('0x5')]=function(_0x460531){return connect()['then'](function(){return new BPromise(function(_0x138571,_0x5389db){return pm2[_0xaf6c('0x5')](_0x460531,function(_0x3f1493,_0xadc085){if(_0x3f1493){return _0x5389db(_0x3f1493);}pm2[_0xaf6c('0x4')]();return _0x138571(_0xadc085);});});});};exports[_0xaf6c('0x6')]=function(_0x1c1de1){return connect()[_0xaf6c('0x3')](function(){return new BPromise(function(_0x506f35,_0x29b406){return pm2[_0xaf6c('0x6')](_0x1c1de1,function(_0x1e7a15,_0xdfbda2){if(_0x1e7a15){return _0x29b406(_0x1e7a15);}pm2[_0xaf6c('0x4')]();return _0x506f35(_0xdfbda2);});});});};exports[_0xaf6c('0x7')]=function(){return connect()[_0xaf6c('0x3')](function(){return new BPromise(function(_0x497e93,_0x316a54){return pm2[_0xaf6c('0x7')](function(_0x21b175,_0x111eb2){if(_0x21b175){return _0x316a54(_0x21b175);}pm2[_0xaf6c('0x4')]();return _0x497e93(_0x111eb2);});});});};exports['describe']=function(_0x547230){return connect()['then'](function(){return new BPromise(function(_0x306113,_0x18d583){return pm2['describe'](_0x547230,function(_0x56e1a2,_0x24fd70){if(_0x56e1a2){return _0x18d583(_0x56e1a2);}pm2[_0xaf6c('0x4')]();return _0x306113(_0x24fd70);});});});};exports[_0xaf6c('0x8')]=function(_0x3d9c04){return connect()[_0xaf6c('0x3')](function(){return new BPromise(function(_0x2c6a30,_0x18d52b){return pm2['delete'](_0x3d9c04,function(_0x1323e8,_0x16100d){if(_0x1323e8){return _0x18d52b(_0x1323e8);}pm2[_0xaf6c('0x4')]();return _0x2c6a30(_0x16100d);});});});};exports[_0xaf6c('0x9')]=function(){return connect()[_0xaf6c('0x3')](function(){return new BPromise(function(_0x319954,_0x500511){return pm2['dump'](function(_0x4374ed){if(_0x4374ed){return _0x500511(_0x4374ed);}return _0x319954(_0xaf6c('0xa'));});});});}; \ No newline at end of file +var _0xc21c=['connect','start','then','disconnect','stop','restart','list','describe','delete','dump','pm2','bluebird'];(function(_0xa5563d,_0x338776){var _0x298358=function(_0x308a60){while(--_0x308a60){_0xa5563d['push'](_0xa5563d['shift']());}};_0x298358(++_0x338776);}(_0xc21c,0x166));var _0xcc21=function(_0x58a1c5,_0x4b30c0){_0x58a1c5=_0x58a1c5-0x0;var _0x3b90e2=_0xc21c[_0x58a1c5];return _0x3b90e2;};'use strict';var pm2=require(_0xcc21('0x0'));var BPromise=require(_0xcc21('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x70bfbc,_0x16faaa){return pm2[_0xcc21('0x2')](function(_0x3f2c61){if(_0x3f2c61){return _0x16faaa(_0x3f2c61);}return _0x70bfbc('connected');});});};exports[_0xcc21('0x3')]=function(_0x31bf8b){return connect()[_0xcc21('0x4')](function(){return new BPromise(function(_0x274889,_0x1ff108){return pm2[_0xcc21('0x3')](_0x31bf8b,function(_0x33604a,_0x4f3166){if(_0x33604a){return _0x1ff108(_0x33604a);}pm2[_0xcc21('0x5')]();return _0x274889(_0x4f3166);});});});};exports[_0xcc21('0x6')]=function(_0x4cb3ea){return connect()[_0xcc21('0x4')](function(){return new BPromise(function(_0x5bb78c,_0x144387){return pm2['stop'](_0x4cb3ea,function(_0x412a15,_0x4ecf6a){if(_0x412a15){return _0x144387(_0x412a15);}pm2[_0xcc21('0x5')]();return _0x5bb78c(_0x4ecf6a);});});});};exports[_0xcc21('0x7')]=function(_0x502845){return connect()['then'](function(){return new BPromise(function(_0x32cd27,_0x29bd23){return pm2['restart'](_0x502845,function(_0x314564,_0x5a9e2e){if(_0x314564){return _0x29bd23(_0x314564);}pm2[_0xcc21('0x5')]();return _0x32cd27(_0x5a9e2e);});});});};exports[_0xcc21('0x8')]=function(){return connect()[_0xcc21('0x4')](function(){return new BPromise(function(_0x5aaf2b,_0x73243b){return pm2['list'](function(_0xdd42cd,_0x35b642){if(_0xdd42cd){return _0x73243b(_0xdd42cd);}pm2[_0xcc21('0x5')]();return _0x5aaf2b(_0x35b642);});});});};exports[_0xcc21('0x9')]=function(_0x6e9b5a){return connect()[_0xcc21('0x4')](function(){return new BPromise(function(_0x160e8d,_0x5b3cd2){return pm2['describe'](_0x6e9b5a,function(_0x2bd0b4,_0x56d008){if(_0x2bd0b4){return _0x5b3cd2(_0x2bd0b4);}pm2[_0xcc21('0x5')]();return _0x160e8d(_0x56d008);});});});};exports[_0xcc21('0xa')]=function(_0x26152e){return connect()[_0xcc21('0x4')](function(){return new BPromise(function(_0x79ea56,_0x5a727c){return pm2[_0xcc21('0xa')](_0x26152e,function(_0x2a3056,_0x3548f4){if(_0x2a3056){return _0x5a727c(_0x2a3056);}pm2[_0xcc21('0x5')]();return _0x79ea56(_0x3548f4);});});});};exports['dump']=function(){return connect()[_0xcc21('0x4')](function(){return new BPromise(function(_0xb96492,_0x399f99){return pm2[_0xcc21('0xb')](function(_0x21e12c){if(_0x21e12c){return _0x399f99(_0x21e12c);}return _0xb96492('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 17e0653..83dfaa1 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 _0xb59e=['emit','chatInteraction:update','start','lodash','moment','../../mysqldb','../../config/environment','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','subtract','minutes','then','update','format','map','length'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xb59e,0x1a5));var _0xeb59=function(_0x589b39,_0x3f07e2){_0x589b39=_0x589b39-0x0;var _0x8e2fe4=_0xb59e[_0x589b39];return _0x8e2fe4;};'use strict';var _=require(_0xeb59('0x0'));var moment=require(_0xeb59('0x1'));var Redis=require('ioredis');var db=require(_0xeb59('0x2'))['db'];var config=require(_0xeb59('0x3'));config[_0xeb59('0x4')]=_['defaults'](config[_0xeb59('0x4')],{'host':_0xeb59('0x5'),'port':0x18eb});var io=require(_0xeb59('0x6'))(new Redis(config[_0xeb59('0x4')]));function closeInteractions(){var _0x2cdf4d=0x0;var _0x56dd9c=[];return db[_0xeb59('0x7')][_0xeb59('0x8')]({'raw':!![],'attributes':['id',_0xeb59('0x9')],'where':{'id':0x1}})['then'](function(_0xb539f0){_0x2cdf4d=_0xb539f0[_0xeb59('0x9')];if(_0x2cdf4d){return db[_0xeb59('0xa')][_0xeb59('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xeb59('0xc')](_0xb539f0[_0xeb59('0x9')],_0xeb59('0xd'))}}});}else{return[];}})[_0xeb59('0xe')](function(_0x357d27){_0x56dd9c=_0x357d27;if(_0x2cdf4d){return db[_0xeb59('0xa')][_0xeb59('0xf')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xeb59('0x10')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0xeb59('0x11')](_0x56dd9c||[],'id')}});}})[_0xeb59('0xe')](function(_0x43ea43){for(var _0xa8a0c9=0x0;_0xa8a0c9<_0x56dd9c[_0xeb59('0x12')];_0xa8a0c9++){io[_0xeb59('0x13')](_0xeb59('0x14'),{'id':_0x56dd9c[_0xa8a0c9]['id'],'closed':!![]});}})['catch'](function(_0x13d0b9){console['error'](_0x13d0b9);});}exports[_0xeb59('0x15')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xcad2=['format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','chatInteraction:update','catch','error','start','lodash','ioredis','../../mysqldb','../../config/environment','defaults','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','minutes','update','system','timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcad2,0x183));var _0x2cad=function(_0x264038,_0x4f332d){_0x264038=_0x264038-0x0;var _0x1f8fca=_0xcad2[_0x264038];return _0x1f8fca;};'use strict';var _=require(_0x2cad('0x0'));var moment=require('moment');var Redis=require(_0x2cad('0x1'));var db=require(_0x2cad('0x2'))['db'];var config=require(_0x2cad('0x3'));config['redis']=_[_0x2cad('0x4')](config[_0x2cad('0x5')],{'host':_0x2cad('0x6'),'port':0x18eb});var io=require(_0x2cad('0x7'))(new Redis(config[_0x2cad('0x5')]));function closeInteractions(){var _0x29cdeb=0x0;var _0x2a9682=[];return db[_0x2cad('0x8')][_0x2cad('0x9')]({'raw':!![],'attributes':['id',_0x2cad('0xa')],'where':{'id':0x1}})[_0x2cad('0xb')](function(_0xdcc265){_0x29cdeb=_0xdcc265[_0x2cad('0xa')];if(_0x29cdeb){return db[_0x2cad('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x2cad('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0xdcc265[_0x2cad('0xa')],_0x2cad('0xe'))}}});}else{return[];}})['then'](function(_0x397546){_0x2a9682=_0x397546;if(_0x29cdeb){return db['ChatInteraction'][_0x2cad('0xf')]({'closeReason':_0x2cad('0x10'),'disposition':_0x2cad('0x11'),'closed':!![],'closedAt':moment()[_0x2cad('0x12')](_0x2cad('0x13'))},{'where':{'id':_[_0x2cad('0x14')](_0x2a9682||[],'id')}});}})[_0x2cad('0xb')](function(_0x1e398c){for(var _0x58b68b=0x0;_0x58b68b<_0x2a9682[_0x2cad('0x15')];_0x58b68b++){io[_0x2cad('0x16')](_0x2cad('0x17'),{'id':_0x2a9682[_0x58b68b]['id'],'closed':!![]});}})[_0x2cad('0x18')](function(_0x4c7ce1){console[_0x2cad('0x19')](_0x4c7ce1);});}exports[_0x2cad('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 e03eda2..bd110aa 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 _0xd8ba=['zip','existsSync','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Sent','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','map','keyBy','toString','difference','length','exists','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','stop','endAt','update','stop\x20cron','run','start','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','email','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname'];(function(_0x441a66,_0x3573cd){var _0x2404f3=function(_0x58e62f){while(--_0x58e62f){_0x441a66['push'](_0x441a66['shift']());}};_0x2404f3(++_0x3573cd);}(_0xd8ba,0x96));var _0xad8b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd8ba[_0x19950b];return _0x3c6b41;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0xad8b('0x0'));var moment=require(_0xad8b('0x1'));var CronJobManager=require(_0xad8b('0x2'));var jayson=require(_0xad8b('0x3'));var BPromise=require(_0xad8b('0x4'));var logger=require(_0xad8b('0x5'))(_0xad8b('0x6'));var db=require(_0xad8b('0x7'))['db'];var analyticCustomReportController=require(_0xad8b('0x8'));var analyticDefaultReportController=require(_0xad8b('0x9'));var client=jayson['client'][_0xad8b('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x393e73,_0xaee3e3){return function(){logger[_0xad8b('0xb')](_0xad8b('0xc'),_0x393e73['email']);var _0x5d8286=!![];var _0x4c46b0={'tls':{'rejectUnauthorized':![]}};if(_0x393e73[_0xad8b('0xd')][_0xad8b('0xe')]['service']){_0x4c46b0['service']=_0x393e73[_0xad8b('0xd')]['Smtp'][_0xad8b('0xf')];}else{_0x4c46b0[_0xad8b('0x10')]=_0x393e73[_0xad8b('0xd')][_0xad8b('0xe')][_0xad8b('0x10')];_0x4c46b0[_0xad8b('0x11')]=_0x393e73[_0xad8b('0xd')][_0xad8b('0xe')][_0xad8b('0x11')];_0x4c46b0[_0xad8b('0x12')]=_0x393e73[_0xad8b('0xd')][_0xad8b('0xe')][_0xad8b('0x12')];}if(_0x393e73['MailAccount']['Smtp'][_0xad8b('0x13')]){_0x4c46b0[_0xad8b('0x14')]={'user':_0x393e73['MailAccount'][_0xad8b('0xe')][_0xad8b('0x15')],'pass':_0x393e73['MailAccount'][_0xad8b('0xe')][_0xad8b('0x16')]};}var _0x51ef85={'account':_0x4c46b0,'message':{'from':util[_0xad8b('0x17')](_0xad8b('0x18'),_0x393e73[_0xad8b('0xd')]['name'],_0x393e73['MailAccount'][_0xad8b('0x19')]||_0x393e73[_0xad8b('0xd')][_0xad8b('0xe')]['user']),'to':_0x393e73[_0xad8b('0x19')],'cc':_0x393e73['cc'],'bcc':_0x393e73[_0xad8b('0x1a')],'subject':util['format'](_0xad8b('0x1b'),_0xaee3e3[_0xad8b('0x1c')],_0x393e73[_0xad8b('0x1d')],_0x393e73[_0xad8b('0x1e')])}};var _0x183f5c=path[_0xad8b('0x1f')](__dirname,_0xad8b('0x20'));var _0x1f87e6=_0xaee3e3[_0xad8b('0x21')];var _0x3086c5=util['format'](_0xad8b('0x22'),path['basename'](_0xaee3e3['savename'],path[_0xad8b('0x23')](_0xaee3e3['savename'])),_0xad8b('0x24'));var _0x4423eb=path[_0xad8b('0x1f')](_0x183f5c,_0x1f87e6);var _0x5f2a66=path[_0xad8b('0x1f')](_0x183f5c,_0x3086c5);if(fs[_0xad8b('0x25')](_0x4423eb)){_0xaee3e3['status']='Sent';_0x51ef85[_0xad8b('0x26')][_0xad8b('0x27')]=[{'filename':_0x1f87e6,'path':_0x4423eb}];_0x51ef85[_0xad8b('0x26')]['text']=util[_0xad8b('0x17')](_0xad8b('0x28'),JSON[_0xad8b('0x29')](_0xaee3e3,null,0x2));}else if(fs[_0xad8b('0x25')](_0x5f2a66)){_0xaee3e3[_0xad8b('0x2a')]=_0xad8b('0x2b');_0x51ef85[_0xad8b('0x26')][_0xad8b('0x27')]=[{'filename':_0x3086c5,'path':_0x5f2a66}];}else{_0x51ef85[_0xad8b('0x26')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x393e73[_0xad8b('0x2c')]){_0x5d8286=![];logger[_0xad8b('0xb')](_0xad8b('0x2d'));}}if(_0x5d8286){return client[_0xad8b('0x2e')](_0xad8b('0x2f'),_0x51ef85)[_0xad8b('0x30')](function(_0x5873a6){if(_0x5873a6[_0xad8b('0x31')]){return logger[_0xad8b('0x31')](_0xad8b('0x32'),JSON[_0xad8b('0x29')](_0x5873a6));}return logger[_0xad8b('0xb')](_0xad8b('0x33'));})[_0xad8b('0x34')](function(_0x49fb73){return logger[_0xad8b('0x31')](_0xad8b('0x32'),JSON[_0xad8b('0x29')](_0x49fb73));});}};}function handleError(){return function(_0x154964){return logger['error'](JSON['stringify'](_0x154964));};}function handleResult(_0x27f4cf){return function(_0x4c5255){logger[_0xad8b('0xb')](_0xad8b('0x35'),JSON[_0xad8b('0x29')](_0x4c5255));if(_0x27f4cf['MailAccount']&&_0x27f4cf[_0xad8b('0xd')][_0xad8b('0xe')]&&!_['isNil'](_0x27f4cf[_0xad8b('0x19')])){setTimeout(handleSendEmail(_0x27f4cf,_0x4c5255),0x3c*0x3e8);}};}function handleJob(_0x27a1a3){return function(){try{if(_[_0xad8b('0x36')](_0x27a1a3[_0xad8b('0x1d')])){return logger[_0xad8b('0xb')](_0xad8b('0x37'));}if(_['isNil'](_0x27a1a3[_0xad8b('0x1e')])){return logger[_0xad8b('0xb')](_0xad8b('0x38'));}var _0x119f59={'startDate':moment()[_0xad8b('0x39')](_0x27a1a3[_0xad8b('0x1d')],_0x27a1a3[_0xad8b('0x1e')])[_0xad8b('0x17')](_0xad8b('0x3a')),'endDate':moment()[_0xad8b('0x17')](_0xad8b('0x3a')),'type':_0xad8b('0x3b'),'output':_0x27a1a3[_0xad8b('0x3c')],'name':_0x27a1a3['name']};if(!_['isNil'](_0x27a1a3[_0xad8b('0x3d')])){logger[_0xad8b('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x27a1a3[_0xad8b('0x3d')]);return analyticDefaultReportController[_0xad8b('0x3e')]({'id':_0x27a1a3[_0xad8b('0x3d')]},_0x119f59)[_0xad8b('0x30')](handleResult(_0x27a1a3))['catch'](handleError());}if(!_[_0xad8b('0x36')](_0x27a1a3['CustomReportId'])){logger['info'](_0xad8b('0x3f'),_0x27a1a3[_0xad8b('0x40')]);return analyticCustomReportController[_0xad8b('0x3e')]({'id':_0x27a1a3[_0xad8b('0x40')]},_0x119f59)[_0xad8b('0x30')](handleResult(_0x27a1a3))['catch'](handleError());}}catch(_0x3f03eb){logger['error'](JSON[_0xad8b('0x29')](_0x3f03eb));}return logger[_0xad8b('0xb')](_0xad8b('0x41'));};}function getJobs(_0x3104f5){var _0x35387f={};if(_0x3104f5){_0x35387f['id']=_0x3104f5;}return db[_0xad8b('0x42')]['findAll']({'where':_0x35387f,'include':[{'model':db['MailAccount'],'attributes':['id',_0xad8b('0x1c'),_0xad8b('0x19')],'include':[{'model':db[_0xad8b('0x43')],'as':_0xad8b('0xe')}]}]})['then'](function(_0x3bc6ae){var _0x5b71ac=_[_0xad8b('0x44')](manager[_0xad8b('0x45')]);var _0x25edec=_[_0xad8b('0x46')](_0x3bc6ae,function(_0x506d67){return _0x506d67['id']['toString']();});var _0x48fa74=_[_0xad8b('0x47')](_0x3bc6ae,function(_0x575391){return _0x575391['id'][_0xad8b('0x48')]();});var _0x55cbd1=_0x3104f5?_0x25edec:_[_0xad8b('0x49')](_0x25edec,_0x5b71ac);var _0x57ab06=_['intersection'](_0x25edec,_0x5b71ac);var _0x5e30d0=_[_0xad8b('0x49')](_0x5b71ac,_0x25edec);var _0x4fe375;var _0x2da4ee;for(_0x4fe375=0x0;_0x4fe375<_0x5e30d0[_0xad8b('0x4a')]&&!_0x3104f5;_0x4fe375+=0x1){_0x2da4ee=_0x5e30d0[_0x4fe375]['toString']();if(manager[_0xad8b('0x4b')](_0x2da4ee)){manager['stop'](_0x2da4ee);manager[_0xad8b('0x4c')](_0x2da4ee);logger[_0xad8b('0xb')]('delete\x20cron',_0x2da4ee);}}logger[_0xad8b('0xb')](_0xad8b('0x4d'),JSON['stringify'](_0x55cbd1));for(_0x4fe375=0x0;_0x4fe375<_0x55cbd1[_0xad8b('0x4a')];_0x4fe375+=0x1){_0x2da4ee=_0x55cbd1[_0x4fe375]['toString']();logger[_0xad8b('0xb')](_0xad8b('0x4e'),_0x2da4ee);if(_0x3104f5){logger[_0xad8b('0xb')](_0xad8b('0x4f'),_0x3104f5);logger[_0xad8b('0xb')](JSON[_0xad8b('0x29')](_0x48fa74[_0x2da4ee]));BPromise[_0xad8b('0x50')]()[_0xad8b('0x30')](handleJob(_0x48fa74[_0x2da4ee]));logger['info'](_0xad8b('0x51'),_0x48fa74[_0x2da4ee][_0xad8b('0x1c')],_0x48fa74[_0x2da4ee]['cron']);}else if(_0x48fa74[_0x2da4ee][_0xad8b('0x52')]&&_0x48fa74[_0x2da4ee][_0xad8b('0x53')]&&moment()[_0xad8b('0x54')](_0x48fa74[_0x2da4ee][_0xad8b('0x55')],_0x48fa74[_0x2da4ee]['endAt'])){manager[_0xad8b('0x56')](_0x2da4ee,_0x48fa74[_0x2da4ee][_0xad8b('0x52')],handleJob(_0x48fa74[_0x2da4ee]));manager['start'](_0x2da4ee);logger[_0xad8b('0xb')]('add\x20cron',_0x48fa74[_0x2da4ee][_0xad8b('0x1c')],_0x48fa74[_0x2da4ee][_0xad8b('0x52')]);}else if(manager['exists'](_0x2da4ee)){manager[_0xad8b('0x57')](_0x2da4ee);manager[_0xad8b('0x4c')](_0x2da4ee);logger[_0xad8b('0xb')]('stop\x20cron',_0x48fa74[_0x2da4ee][_0xad8b('0x1c')],_0x48fa74[_0x2da4ee]['cron']);}}for(_0x4fe375=0x0,_0x2da4ee;_0x4fe375<_0x57ab06['length']&&!_0x3104f5;_0x4fe375+=0x1){_0x2da4ee=_0x57ab06[_0x4fe375][_0xad8b('0x48')]();if(manager['exists'](_0x2da4ee)){if(_0x48fa74[_0x2da4ee][_0xad8b('0x52')]&&_0x48fa74[_0x2da4ee][_0xad8b('0x53')]&&moment()[_0xad8b('0x54')](_0x48fa74[_0x2da4ee][_0xad8b('0x55')],_0x48fa74[_0x2da4ee][_0xad8b('0x58')])){manager[_0xad8b('0x59')](_0x2da4ee,_0x48fa74[_0x2da4ee]['cron'],handleJob(_0x48fa74[_0x2da4ee]));logger['info']('update\x20cron',_0x48fa74[_0x2da4ee][_0xad8b('0x1c')],_0x48fa74[_0x2da4ee][_0xad8b('0x52')]);}else{manager['stop'](_0x2da4ee);manager[_0xad8b('0x4c')](_0x2da4ee);logger['info'](_0xad8b('0x5a'),_0x48fa74[_0x2da4ee][_0xad8b('0x1c')],_0x48fa74[_0x2da4ee][_0xad8b('0x52')]);}}}})[_0xad8b('0x34')](function(_0x453ee6){logger[_0xad8b('0x31')](JSON[_0xad8b('0x29')](_0x453ee6));});}exports[_0xad8b('0x5b')]=function(_0x4fbc39){return getJobs(_0x4fbc39);};exports[_0xad8b('0x5c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x4725=['Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','error\x20mail','data','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','catch','no\x20report\x20id','Schedule','findAll','map','toString','keyBy','difference','intersection','length','exists','stop','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','startAt','endAt','start','add\x20cron','deleteJob','stop\x20cron','active','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','info'];(function(_0x3a3b23,_0x16bb7b){var _0x3560af=function(_0xf38938){while(--_0xf38938){_0x3a3b23['push'](_0x3a3b23['shift']());}};_0x3560af(++_0x16bb7b);}(_0x4725,0x164));var _0x5472=function(_0x88355c,_0xedb8e1){_0x88355c=_0x88355c-0x0;var _0x3a73e3=_0x4725[_0x88355c];return _0x3a73e3;};'use strict';var fs=require('fs');var util=require(_0x5472('0x0'));var path=require(_0x5472('0x1'));var _=require(_0x5472('0x2'));var moment=require(_0x5472('0x3'));var CronJobManager=require(_0x5472('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0x5472('0x5'));var logger=require(_0x5472('0x6'))(_0x5472('0x7'));var db=require(_0x5472('0x8'))['db'];var analyticCustomReportController=require(_0x5472('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x5472('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x51c21e,_0x2f3077){return function(){logger[_0x5472('0xb')](_0x5472('0xc'),_0x51c21e[_0x5472('0xd')]);var _0x5e134b=!![];var _0x1f1a61={'tls':{'rejectUnauthorized':![]}};if(_0x51c21e[_0x5472('0xe')][_0x5472('0xf')][_0x5472('0x10')]){_0x1f1a61['service']=_0x51c21e[_0x5472('0xe')][_0x5472('0xf')]['service'];}else{_0x1f1a61[_0x5472('0x11')]=_0x51c21e[_0x5472('0xe')][_0x5472('0xf')][_0x5472('0x11')];_0x1f1a61['port']=_0x51c21e[_0x5472('0xe')][_0x5472('0xf')][_0x5472('0x12')];_0x1f1a61[_0x5472('0x13')]=_0x51c21e[_0x5472('0xe')][_0x5472('0xf')][_0x5472('0x13')];}if(_0x51c21e[_0x5472('0xe')][_0x5472('0xf')][_0x5472('0x14')]){_0x1f1a61[_0x5472('0x15')]={'user':_0x51c21e[_0x5472('0xe')][_0x5472('0xf')][_0x5472('0x16')],'pass':_0x51c21e[_0x5472('0xe')][_0x5472('0xf')][_0x5472('0x17')]};}var _0x12e5f7={'account':_0x1f1a61,'message':{'from':util[_0x5472('0x18')](_0x5472('0x19'),_0x51c21e[_0x5472('0xe')][_0x5472('0x1a')],_0x51c21e[_0x5472('0xe')][_0x5472('0xd')]||_0x51c21e[_0x5472('0xe')]['Smtp'][_0x5472('0x16')]),'to':_0x51c21e[_0x5472('0xd')],'cc':_0x51c21e['cc'],'bcc':_0x51c21e[_0x5472('0x1b')],'subject':util[_0x5472('0x18')](_0x5472('0x1c'),_0x2f3077[_0x5472('0x1a')],_0x51c21e[_0x5472('0x1d')],_0x51c21e[_0x5472('0x1e')])}};var _0x47747d=path[_0x5472('0x1f')](__dirname,_0x5472('0x20'));var _0x2eed64=_0x2f3077[_0x5472('0x21')];var _0x2052c3=util['format'](_0x5472('0x22'),path[_0x5472('0x23')](_0x2f3077[_0x5472('0x21')],path[_0x5472('0x24')](_0x2f3077[_0x5472('0x21')])),_0x5472('0x25'));var _0x443d7b=path['join'](_0x47747d,_0x2eed64);var _0x4059f3=path[_0x5472('0x1f')](_0x47747d,_0x2052c3);if(fs[_0x5472('0x26')](_0x443d7b)){_0x2f3077['status']='Sent';_0x12e5f7[_0x5472('0x27')][_0x5472('0x28')]=[{'filename':_0x2eed64,'path':_0x443d7b}];_0x12e5f7[_0x5472('0x27')]['text']=util['format'](_0x5472('0x29'),JSON[_0x5472('0x2a')](_0x2f3077,null,0x2));}else if(fs[_0x5472('0x26')](_0x4059f3)){_0x2f3077[_0x5472('0x2b')]=_0x5472('0x2c');_0x12e5f7[_0x5472('0x27')]['attachments']=[{'filename':_0x2052c3,'path':_0x4059f3}];}else{_0x12e5f7[_0x5472('0x27')]['text']=_0x5472('0x2d');if(!_0x51c21e[_0x5472('0x2e')]){_0x5e134b=![];logger[_0x5472('0xb')](_0x5472('0x2f'));}}if(_0x5e134b){return client[_0x5472('0x30')](_0x5472('0x31'),_0x12e5f7)[_0x5472('0x32')](function(_0x2169f2){if(_0x2169f2[_0x5472('0x33')]){return logger['error']('error\x20mail',JSON[_0x5472('0x2a')](_0x2169f2));}return logger['info'](_0x5472('0x34'));})['catch'](function(_0x4c2b56){return logger[_0x5472('0x33')](_0x5472('0x35'),JSON[_0x5472('0x2a')](_0x4c2b56));});}};}function handleError(){return function(_0x1685e5){return logger[_0x5472('0x33')](JSON[_0x5472('0x2a')](_0x1685e5));};}function handleResult(_0x2fdceb){return function(_0x135256){logger['info'](_0x5472('0x36'),JSON[_0x5472('0x2a')](_0x135256));if(_0x2fdceb[_0x5472('0xe')]&&_0x2fdceb[_0x5472('0xe')]['Smtp']&&!_['isNil'](_0x2fdceb['email'])){setTimeout(handleSendEmail(_0x2fdceb,_0x135256),0x3c*0x3e8);}};}function handleJob(_0x483c41){return function(){try{if(_[_0x5472('0x37')](_0x483c41[_0x5472('0x1d')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x5472('0x37')](_0x483c41[_0x5472('0x1e')])){return logger[_0x5472('0xb')](_0x5472('0x38'));}var _0x346fb7={'startDate':moment()['subtract'](_0x483c41['subtractNumber'],_0x483c41[_0x5472('0x1e')])[_0x5472('0x18')](_0x5472('0x39')),'endDate':moment()[_0x5472('0x18')](_0x5472('0x39')),'type':_0x5472('0x3a'),'output':_0x483c41[_0x5472('0x3b')],'name':_0x483c41[_0x5472('0x1a')]};if(!_[_0x5472('0x37')](_0x483c41[_0x5472('0x3c')])){logger[_0x5472('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x483c41[_0x5472('0x3c')]);return analyticDefaultReportController[_0x5472('0x3d')]({'id':_0x483c41[_0x5472('0x3c')]},_0x346fb7)['then'](handleResult(_0x483c41))['catch'](handleError());}if(!_[_0x5472('0x37')](_0x483c41[_0x5472('0x3e')])){logger[_0x5472('0xb')]('exec\x20custom\x20report\x20id:%s',_0x483c41[_0x5472('0x3e')]);return analyticCustomReportController[_0x5472('0x3d')]({'id':_0x483c41[_0x5472('0x3e')]},_0x346fb7)[_0x5472('0x32')](handleResult(_0x483c41))[_0x5472('0x3f')](handleError());}}catch(_0x2d557c){logger[_0x5472('0x33')](JSON[_0x5472('0x2a')](_0x2d557c));}return logger['info'](_0x5472('0x40'));};}function getJobs(_0x3749fe){var _0x313417={};if(_0x3749fe){_0x313417['id']=_0x3749fe;}return db[_0x5472('0x41')][_0x5472('0x42')]({'where':_0x313417,'include':[{'model':db[_0x5472('0xe')],'attributes':['id',_0x5472('0x1a'),_0x5472('0xd')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0x5472('0x32')](function(_0x3f2193){var _0x16d24f=_['keys'](manager['jobs']);var _0x211d25=_[_0x5472('0x43')](_0x3f2193,function(_0x355e35){return _0x355e35['id'][_0x5472('0x44')]();});var _0x418d5b=_[_0x5472('0x45')](_0x3f2193,function(_0x53fc6b){return _0x53fc6b['id'][_0x5472('0x44')]();});var _0x2150dd=_0x3749fe?_0x211d25:_[_0x5472('0x46')](_0x211d25,_0x16d24f);var _0xb676dc=_[_0x5472('0x47')](_0x211d25,_0x16d24f);var _0x434765=_[_0x5472('0x46')](_0x16d24f,_0x211d25);var _0x5ce55c;var _0x750617;for(_0x5ce55c=0x0;_0x5ce55c<_0x434765[_0x5472('0x48')]&&!_0x3749fe;_0x5ce55c+=0x1){_0x750617=_0x434765[_0x5ce55c]['toString']();if(manager[_0x5472('0x49')](_0x750617)){manager[_0x5472('0x4a')](_0x750617);manager['deleteJob'](_0x750617);logger[_0x5472('0xb')](_0x5472('0x4b'),_0x750617);}}logger[_0x5472('0xb')](_0x5472('0x4c'),JSON['stringify'](_0x2150dd));for(_0x5ce55c=0x0;_0x5ce55c<_0x2150dd[_0x5472('0x48')];_0x5ce55c+=0x1){_0x750617=_0x2150dd[_0x5ce55c][_0x5472('0x44')]();logger[_0x5472('0xb')](_0x5472('0x4d'),_0x750617);if(_0x3749fe){logger['info'](_0x5472('0x4e'),_0x3749fe);logger[_0x5472('0xb')](JSON['stringify'](_0x418d5b[_0x750617]));BPromise[_0x5472('0x4f')]()[_0x5472('0x32')](handleJob(_0x418d5b[_0x750617]));logger[_0x5472('0xb')](_0x5472('0x50'),_0x418d5b[_0x750617][_0x5472('0x1a')],_0x418d5b[_0x750617][_0x5472('0x51')]);}else if(_0x418d5b[_0x750617][_0x5472('0x51')]&&_0x418d5b[_0x750617]['active']&&moment()['isBetween'](_0x418d5b[_0x750617][_0x5472('0x52')],_0x418d5b[_0x750617][_0x5472('0x53')])){manager['add'](_0x750617,_0x418d5b[_0x750617][_0x5472('0x51')],handleJob(_0x418d5b[_0x750617]));manager[_0x5472('0x54')](_0x750617);logger['info'](_0x5472('0x55'),_0x418d5b[_0x750617]['name'],_0x418d5b[_0x750617][_0x5472('0x51')]);}else if(manager['exists'](_0x750617)){manager[_0x5472('0x4a')](_0x750617);manager[_0x5472('0x56')](_0x750617);logger[_0x5472('0xb')](_0x5472('0x57'),_0x418d5b[_0x750617][_0x5472('0x1a')],_0x418d5b[_0x750617][_0x5472('0x51')]);}}for(_0x5ce55c=0x0,_0x750617;_0x5ce55c<_0xb676dc['length']&&!_0x3749fe;_0x5ce55c+=0x1){_0x750617=_0xb676dc[_0x5ce55c][_0x5472('0x44')]();if(manager[_0x5472('0x49')](_0x750617)){if(_0x418d5b[_0x750617][_0x5472('0x51')]&&_0x418d5b[_0x750617][_0x5472('0x58')]&&moment()['isBetween'](_0x418d5b[_0x750617][_0x5472('0x52')],_0x418d5b[_0x750617][_0x5472('0x53')])){manager[_0x5472('0x59')](_0x750617,_0x418d5b[_0x750617][_0x5472('0x51')],handleJob(_0x418d5b[_0x750617]));logger['info'](_0x5472('0x5a'),_0x418d5b[_0x750617][_0x5472('0x1a')],_0x418d5b[_0x750617][_0x5472('0x51')]);}else{manager[_0x5472('0x4a')](_0x750617);manager[_0x5472('0x56')](_0x750617);logger[_0x5472('0xb')](_0x5472('0x57'),_0x418d5b[_0x750617]['name'],_0x418d5b[_0x750617][_0x5472('0x51')]);}}}})[_0x5472('0x3f')](function(_0x1feba7){logger[_0x5472('0x33')](JSON[_0x5472('0x2a')](_0x1feba7));});}exports[_0x5472('0x5b')]=function(_0x29ed6c){return getJobs(_0x29ed6c);};exports[_0x5472('0x54')]=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 b0089ec..4881e34 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab88=['now','@xcally.com','CmContact','destroy','then','bulkCreate','finished\x20populating','contacts1','log','contacts2','hopper2','util','push','Innocenzo'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xab88,0x185));var _0x8ab8=function(_0x482b06,_0x475ea9){_0x482b06=_0x482b06-0x0;var _0x404a0a=_0xab88[_0x482b06];return _0x404a0a;};'use strict';var util=require(_0x8ab8('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x8ab8('0x1')]({'id':i,'firstName':_0x8ab8('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x8ab8('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x8ab8('0x3')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8ab8('0x3')](),'updatedAt':Date[_0x8ab8('0x3')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x8ab8('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x8ab8('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x8ab8('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x8ab8('0x3')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8ab8('0x3')](),'updatedAt':Date['now']()});}db[_0x8ab8('0x5')][_0x8ab8('0x6')]({'where':{}})[_0x8ab8('0x7')](function(){return db[_0x8ab8('0x5')][_0x8ab8('0x8')](contacts);})[_0x8ab8('0x7')](function(){console['log'](_0x8ab8('0x9'),_0x8ab8('0xa'));return db['CmHopper']['destroy']({'where':{}});})['then'](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x8ab8('0x7')](function(){console['log'](_0x8ab8('0x9'),'hopper1');return db[_0x8ab8('0x5')][_0x8ab8('0x8')](contacts2);})[_0x8ab8('0x7')](function(){console[_0x8ab8('0xb')](_0x8ab8('0x9'),_0x8ab8('0xc'));return db['CmHopper'][_0x8ab8('0x8')](hopper2);})[_0x8ab8('0x7')](function(){console[_0x8ab8('0xb')](_0x8ab8('0x9'),_0x8ab8('0xd'));})['catch'](function(_0x2dcce8){console[_0x8ab8('0xb')](_0x2dcce8);}); \ No newline at end of file +var _0x8855=['catch','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2'];(function(_0x1cb701,_0xaebc06){var _0x2ac38d=function(_0x33003b){while(--_0x33003b){_0x1cb701['push'](_0x1cb701['shift']());}};_0x2ac38d(++_0xaebc06);}(_0x8855,0xf1));var _0x5885=function(_0x2c5c15,_0x428d60){_0x2c5c15=_0x2c5c15-0x0;var _0x4efc3e=_0x8855[_0x2c5c15];return _0x4efc3e;};'use strict';var util=require(_0x5885('0x0'));var db=require(_0x5885('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5885('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5885('0x3')+i,'phone':0xf879fb460+i,'email':_0x5885('0x4')+i+_0x5885('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x5885('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5885('0x6')](),'updatedAt':Date[_0x5885('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5885('0x2')]({'id':i,'firstName':_0x5885('0x7')+i,'lastName':_0x5885('0x3')+i,'phone':0xf879fb460+i,'email':_0x5885('0x4')+i+_0x5885('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x5885('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5885('0x6')](),'updatedAt':Date[_0x5885('0x6')]()});}db[_0x5885('0x8')][_0x5885('0x9')]({'where':{}})[_0x5885('0xa')](function(){return db[_0x5885('0x8')][_0x5885('0xb')](contacts);})[_0x5885('0xa')](function(){console[_0x5885('0xc')](_0x5885('0xd'),_0x5885('0xe'));return db[_0x5885('0xf')]['destroy']({'where':{}});})[_0x5885('0xa')](function(){return db[_0x5885('0xf')][_0x5885('0xb')](hopper);})['then'](function(){console[_0x5885('0xc')](_0x5885('0xd'),_0x5885('0x10'));return db[_0x5885('0x8')][_0x5885('0xb')](contacts2);})[_0x5885('0xa')](function(){console[_0x5885('0xc')](_0x5885('0xd'),_0x5885('0x11'));return db['CmHopper'][_0x5885('0xb')](hopper2);})[_0x5885('0xa')](function(){console['log'](_0x5885('0xd'),_0x5885('0x12'));})[_0x5885('0x13')](function(_0x9860c0){console['log'](_0x9860c0);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index e37c12c..2875a17 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e9b=['yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','catch','../mysqldb','%s%s','agent','format','%s%s@xcally.com','password','friend','udp','wss','ulaw'];(function(_0x5a3ac1,_0x1e967b){var _0x47d00b=function(_0x359b32){while(--_0x359b32){_0x5a3ac1['push'](_0x5a3ac1['shift']());}};_0x47d00b(++_0x1e967b);}(_0x4e9b,0x14c));var _0xb4e9=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x4e9b[_0x26f702];return _0x11417d;};'use strict';var util=require('util');var db=require(_0xb4e9('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xb4e9('0x1'),_0xb4e9('0x2'),i),'fullname':util[_0xb4e9('0x3')]('%s%s',_0xb4e9('0x2'),i),'email':util['format'](_0xb4e9('0x4'),'agent',i),'role':'agent','password':_0xb4e9('0x5'),'internal':0xfa0+i,'type':_0xb4e9('0x6'),'transport':[_0xb4e9('0x7'),'ws',_0xb4e9('0x8')],'disallow':['all'],'allow':[_0xb4e9('0x9')],'defaultuser':util[_0xb4e9('0x3')](_0xb4e9('0x1'),_0xb4e9('0x2'),i),'encryption':_0xb4e9('0xa'),'avpf':_0xb4e9('0xa'),'force_avp':_0xb4e9('0xa'),'icesupport':'yes','dtlsenable':_0xb4e9('0xa'),'dtlsverify':'no','dtlscertfile':_0xb4e9('0xb'),'dtlsprivatekey':_0xb4e9('0xc'),'dtlssetup':'actpass','callerid':util['format'](_0xb4e9('0xd'),util[_0xb4e9('0x3')](_0xb4e9('0x1'),'agent',i),0xfa0+i)});}db[_0xb4e9('0xe')][_0xb4e9('0xf')](users)[_0xb4e9('0x10')](function(){console['log']('add\x20user');})[_0xb4e9('0x11')](function(_0x301732){console['log'](_0x301732);}); \ No newline at end of file +var _0xb7b6=['ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','all'];(function(_0x5b8685,_0x1a1c28){var _0xa3ef57=function(_0xa91aad){while(--_0xa91aad){_0x5b8685['push'](_0x5b8685['shift']());}};_0xa3ef57(++_0x1a1c28);}(_0xb7b6,0x14c));var _0x6b7b=function(_0xe7c6b3,_0x23b2bd){_0xe7c6b3=_0xe7c6b3-0x0;var _0x3eb532=_0xb7b6[_0xe7c6b3];return _0x3eb532;};'use strict';var util=require('util');var db=require(_0x6b7b('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6b7b('0x1')]({'name':util[_0x6b7b('0x2')](_0x6b7b('0x3'),_0x6b7b('0x4'),i),'fullname':util[_0x6b7b('0x2')](_0x6b7b('0x3'),'agent',i),'email':util['format'](_0x6b7b('0x5'),_0x6b7b('0x4'),i),'role':_0x6b7b('0x4'),'password':_0x6b7b('0x6'),'internal':0xfa0+i,'type':_0x6b7b('0x7'),'transport':[_0x6b7b('0x8'),'ws','wss'],'disallow':[_0x6b7b('0x9')],'allow':[_0x6b7b('0xa')],'defaultuser':util['format'](_0x6b7b('0x3'),_0x6b7b('0x4'),i),'encryption':_0x6b7b('0xb'),'avpf':_0x6b7b('0xb'),'force_avp':_0x6b7b('0xb'),'icesupport':_0x6b7b('0xb'),'dtlsenable':_0x6b7b('0xb'),'dtlsverify':'no','dtlscertfile':_0x6b7b('0xc'),'dtlsprivatekey':_0x6b7b('0xd'),'dtlssetup':'actpass','callerid':util[_0x6b7b('0x2')](_0x6b7b('0xe'),util[_0x6b7b('0x2')](_0x6b7b('0x3'),_0x6b7b('0x4'),i),0xfa0+i)});}db['User'][_0x6b7b('0xf')](users)[_0x6b7b('0x10')](function(){console[_0x6b7b('0x11')](_0x6b7b('0x12'));})['catch'](function(_0x187165){console[_0x6b7b('0x11')](_0x187165);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 795a59e..66483dd 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3426=['user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','agent','telephone','type','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','MailQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','Campaign','ivr','then','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','SmsQueue','OpenchannelQueue','Trunk','user','ChatQueue','FaxQueues','FaxQueue','SmsQueues','MailQueue','Telephones','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','chat','fax','mail','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','map','removeMailInteractions'];(function(_0x1719e4,_0x2d18ac){var _0x5026a9=function(_0x1808f8){while(--_0x1808f8){_0x1719e4['push'](_0x1719e4['shift']());}};_0x5026a9(++_0x2d18ac);}(_0x3426,0x131));var _0x6342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3426[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6342('0x0'));var util=require(_0x6342('0x1'));var BPromise=require(_0x6342('0x2'));var db=require(_0x6342('0x3'))['db'];var config=require(_0x6342('0x4'));var queryQueues={'attributes':['id',_0x6342('0x5')],'include':[{'as':'Agents','model':db[_0x6342('0x6')],'attributes':['id',_0x6342('0x5'),_0x6342('0x7')],'raw':!![],'where':{'role':_0x6342('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x6342('0x5')],'where':{'role':_0x6342('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x6342('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x6342('0x5')],'where':{'role':_0x6342('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x6342('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x415268,_0x57d14f,_0x457188){return db[_0x6342('0xb')]['findOne']({'where':{'name':_0x415268,'userProfileId':_0x57d14f},'raw':!![]})['then'](function(_0x57f963){if(_0x57f963){if(_0x57f963[_0x6342('0xc')]){switch(_0x415268){case _0x6342('0xd'):case _0x6342('0xe'):case'FaxQueues':case'SmsQueues':case _0x6342('0xf'):case _0x6342('0x10'):return db[_0x457188][_0x6342('0x11')](queryQueues);case'Telephones':return db[_0x457188][_0x6342('0x11')](queryTelephones);case _0x6342('0x12'):return db[_0x457188][_0x6342('0x11')](queryTrunks);case _0x6342('0x13'):return db[_0x457188]['findAll'](queryCampaigns);}}else{return db[_0x6342('0x14')][_0x6342('0x11')]({'attributes':[_0x6342('0x15')],'where':{'sectionId':_0x57f963['id']},'raw':!![]})['then'](function(_0x2b9677){if(_0x2b9677){var _0x18a812={'where':{'id':_['map'](_0x2b9677,_0x6342('0x15'))},'raw':!![]};switch(_0x457188){case _0x6342('0x6'):_0x18a812[_0x6342('0x16')][_0x6342('0x7')]=_0x6342('0x9');break;case _0x6342('0x17'):_0x18a812['where']['type']=_0x6342('0x18');break;}return db[_0x457188]['findAll'](_0x18a812);}else{return[];}});}}else{return[];}})[_0x6342('0x19')](function(_0x5a56dd){return _0x5a56dd;});}function joinOrLeaveQueues(_0x48c42c,_0x6e6dc3,_0x5e72c0,_0x2a667a){_0x48c42c[_0x6e6dc3](util[_0x6342('0x1a')](_0x6342('0x1b'),_0x5e72c0,_0x2a667a[_0x6342('0x5')]));if(_0x2a667a[_0x6342('0x1c')]){for(var _0x586f97=0x0;_0x586f97<_0x2a667a[_0x6342('0x1c')][_0x6342('0x1d')];_0x586f97+=0x1){_0x48c42c[_0x6e6dc3](util[_0x6342('0x1a')](_0x6342('0x1e'),_0x2a667a[_0x6342('0x1c')][_0x586f97][_0x6342('0x5')]));}}}function joinOrLeave(_0x819d84,_0xcf4b3a,_0x59781e){var _0x1f7597;if(_0x819d84[_0x6342('0x1f')][_0x6342('0x20')]['id']){db[_0x6342('0x6')][_0x6342('0x21')]({'attributes':['id','name',_0x6342('0x7'),_0x6342('0x22')],'where':{'id':_0x819d84[_0x6342('0x1f')][_0x6342('0x20')]['id']},'include':[{'model':db[_0x6342('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6342('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x6342('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x6342('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6342('0x27')],'as':_0x6342('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3ce3cd){if(_0x3ce3cd){_0x1f7597=_0x3ce3cd;_0x819d84[_0xcf4b3a](util['format'](_0x6342('0x1e'),_0x3ce3cd[_0x6342('0x5')]));var _0xd90aad=[];switch(_0x3ce3cd[_0x6342('0x7')]){case'admin':_0x819d84[_0xcf4b3a](_0x6342('0x29'));_0x819d84[_0xcf4b3a](_0x6342('0x2a'));if(queryQueues[_0x6342('0x2b')](_0x6342('0x2c'))){delete queryQueues[_0x6342('0x2c')];}_0xd90aad[_0x6342('0x2d')](db[_0x6342('0x2e')]['findAll'](queryQueues));_0xd90aad[_0x6342('0x2d')](db['ChatQueue'][_0x6342('0x11')](queryQueues));_0xd90aad[_0x6342('0x2d')](db['FaxQueue'][_0x6342('0x11')](queryQueues));_0xd90aad[_0x6342('0x2d')](db[_0x6342('0x2f')]['findAll'](queryQueues));_0xd90aad[_0x6342('0x2d')](db['MailQueue'][_0x6342('0x11')](queryQueues));_0xd90aad[_0x6342('0x2d')](db[_0x6342('0x30')][_0x6342('0x11')](queryQueues));_0xd90aad[_0x6342('0x2d')](db[_0x6342('0x6')][_0x6342('0x11')](queryTelephones));_0xd90aad[_0x6342('0x2d')](db[_0x6342('0x31')][_0x6342('0x11')](queryTrunks));_0xd90aad[_0x6342('0x2d')](db['Campaign'][_0x6342('0x11')](queryCampaigns));_0xd90aad[_0x6342('0x2d')](db[_0x6342('0x6')][_0x6342('0x11')](queryAgents));break;case _0x6342('0x32'):_0x819d84[_0xcf4b3a](_0x6342('0x29'));_0x819d84[_0xcf4b3a](_0x6342('0x2a'));_0xd90aad[_0x6342('0x2d')](getAssociatedResources(_0x6342('0xd'),_0x3ce3cd[_0x6342('0x22')],_0x6342('0x2e')));_0xd90aad['push'](getAssociatedResources(_0x6342('0xe'),_0x3ce3cd[_0x6342('0x22')],_0x6342('0x33')));_0xd90aad['push'](getAssociatedResources(_0x6342('0x34'),_0x3ce3cd['userProfileId'],_0x6342('0x35')));_0xd90aad[_0x6342('0x2d')](getAssociatedResources(_0x6342('0x36'),_0x3ce3cd[_0x6342('0x22')],'SmsQueue'));_0xd90aad['push'](getAssociatedResources('MailQueues',_0x3ce3cd[_0x6342('0x22')],_0x6342('0x37')));_0xd90aad[_0x6342('0x2d')](getAssociatedResources(_0x6342('0x10'),_0x3ce3cd[_0x6342('0x22')],_0x6342('0x30')));_0xd90aad['push'](getAssociatedResources(_0x6342('0x38'),_0x3ce3cd[_0x6342('0x22')],_0x6342('0x6')));_0xd90aad[_0x6342('0x2d')](getAssociatedResources('Trunks',_0x3ce3cd['userProfileId'],_0x6342('0x31')));_0xd90aad[_0x6342('0x2d')](getAssociatedResources(_0x6342('0x13'),_0x3ce3cd[_0x6342('0x22')],_0x6342('0x17')));_0xd90aad[_0x6342('0x2d')](db[_0x6342('0x6')][_0x6342('0x11')](queryAgents));break;case _0x6342('0x8'):_0x819d84[_0xcf4b3a]('voice:inbound');_0x819d84[_0xcf4b3a]('voice:outbound');_0xd90aad[_0x6342('0x2d')](_0x3ce3cd['getVoiceQueues']({'attributes':['id','name']}));_0xd90aad[_0x6342('0x2d')](_0x3ce3cd[_0x6342('0x39')]({'attributes':['id','name']}));_0xd90aad[_0x6342('0x2d')](_0x3ce3cd[_0x6342('0x3a')]({'attributes':['id',_0x6342('0x5')]}));_0xd90aad[_0x6342('0x2d')](_0x3ce3cd[_0x6342('0x3b')]({'attributes':['id',_0x6342('0x5')]}));_0xd90aad[_0x6342('0x2d')](_0x3ce3cd[_0x6342('0x3c')]({'attributes':['id','name']}));_0xd90aad[_0x6342('0x2d')](_0x3ce3cd[_0x6342('0x3d')]({'attributes':['id','name']}));break;}return BPromise[_0x6342('0x3e')](_0xd90aad);}})[_0x6342('0x19')](function(_0x4fea86){if(_0x4fea86&&_0x4fea86[_0x6342('0x1d')]){for(var _0x542978=0x0;_0x542978<_0x4fea86['length'];_0x542978+=0x1){for(var _0x26eae3=0x0;_0x26eae3<_0x4fea86[_0x542978][_0x6342('0x1d')];_0x26eae3+=0x1){switch(_0x542978){case 0x0:joinOrLeaveQueues(_0x819d84,_0xcf4b3a,'voice',_0x4fea86[_0x542978][_0x26eae3]);break;case 0x1:joinOrLeaveQueues(_0x819d84,_0xcf4b3a,_0x6342('0x3f'),_0x4fea86[_0x542978][_0x26eae3]);break;case 0x2:joinOrLeaveQueues(_0x819d84,_0xcf4b3a,_0x6342('0x40'),_0x4fea86[_0x542978][_0x26eae3]);break;case 0x3:joinOrLeaveQueues(_0x819d84,_0xcf4b3a,'sms',_0x4fea86[_0x542978][_0x26eae3]);break;case 0x4:joinOrLeaveQueues(_0x819d84,_0xcf4b3a,_0x6342('0x41'),_0x4fea86[_0x542978][_0x26eae3]);break;case 0x5:joinOrLeaveQueues(_0x819d84,_0xcf4b3a,'openchannel',_0x4fea86[_0x542978][_0x26eae3]);break;case 0x6:_0x819d84[_0xcf4b3a](util[_0x6342('0x1a')](_0x6342('0x42'),_0x4fea86[_0x542978][_0x26eae3][_0x6342('0x5')]));break;case 0x7:_0x819d84[_0xcf4b3a](util[_0x6342('0x1a')](_0x6342('0x43'),_0x4fea86[_0x542978][_0x26eae3][_0x6342('0x5')]));break;case 0x8:_0x819d84[_0xcf4b3a](util['format'](_0x6342('0x44'),_0x4fea86[_0x542978][_0x26eae3][_0x6342('0xa')],_0x4fea86[_0x542978][_0x26eae3]['name']));break;case 0x9:_0x819d84[_0xcf4b3a](util[_0x6342('0x1a')]('user:%s',_0x4fea86[_0x542978][_0x26eae3][_0x6342('0x5')]));break;}}}}})[_0x6342('0x19')](function(){if(_0xcf4b3a===_0x6342('0x45')){var _0x210d3f=_['map'](_0x1f7597[_0x6342('0x46')],'id');return _0x1f7597[_0x6342('0x47')](_0x210d3f)[_0x6342('0x19')](function(){for(var _0x5dd30d=0x0;_0x5dd30d<_0x210d3f[_0x6342('0x1d')];_0x5dd30d+=0x1){_0x59781e[_0x6342('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x210d3f[_0x5dd30d]),'UserId':Number(_0x1f7597['id'])});}});}})[_0x6342('0x19')](function(){if(_0xcf4b3a===_0x6342('0x45')){var _0x2c25a9=_[_0x6342('0x49')](_0x1f7597['MailInteractions'],'id');return _0x1f7597[_0x6342('0x4a')](_0x2c25a9)[_0x6342('0x19')](function(){for(var _0x53fd10=0x0;_0x53fd10<_0x2c25a9[_0x6342('0x1d')];_0x53fd10+=0x1){_0x59781e[_0x6342('0x48')](_0x6342('0x4b'),{'MailInteractionId':Number(_0x2c25a9[_0x53fd10]),'UserId':Number(_0x1f7597['id'])});}});}})[_0x6342('0x19')](function(){if(_0xcf4b3a==='leave'){var _0x39f713=_[_0x6342('0x49')](_0x1f7597[_0x6342('0x25')],'id');return _0x1f7597[_0x6342('0x4c')](_0x39f713)[_0x6342('0x19')](function(){for(var _0x7ffc9a=0x0;_0x7ffc9a<_0x39f713[_0x6342('0x1d')];_0x7ffc9a+=0x1){_0x59781e[_0x6342('0x48')](_0x6342('0x4d'),{'FaxInteractionId':Number(_0x39f713[_0x7ffc9a]),'UserId':Number(_0x1f7597['id'])});}});}})['then'](function(){if(_0xcf4b3a===_0x6342('0x45')){var _0x440338=_[_0x6342('0x49')](_0x1f7597[_0x6342('0x4e')],'id');return _0x1f7597[_0x6342('0x4f')](_0x440338)[_0x6342('0x19')](function(){for(var _0x5825aa=0x0;_0x5825aa<_0x440338[_0x6342('0x1d')];_0x5825aa+=0x1){_0x59781e[_0x6342('0x48')](_0x6342('0x50'),{'SmsInteractionId':Number(_0x440338[_0x5825aa]),'UserId':Number(_0x1f7597['id'])});}});}})[_0x6342('0x19')](function(){if(_0xcf4b3a==='leave'){var _0x5375d6=_[_0x6342('0x49')](_0x1f7597[_0x6342('0x28')],'id');return _0x1f7597[_0x6342('0x51')](_0x5375d6)[_0x6342('0x19')](function(){for(var _0x1d22ef=0x0;_0x1d22ef<_0x5375d6['length'];_0x1d22ef+=0x1){_0x59781e[_0x6342('0x48')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x5375d6[_0x1d22ef]),'UserId':Number(_0x1f7597['id'])});}});}})['catch'](function(_0x3c6059){_0x819d84[_0x6342('0x52')](_0x3c6059);});}}function onDisconnect(_0x47a806,_0x1b3ecc){joinOrLeave(_0x47a806,_0x6342('0x45'),_0x1b3ecc);}function onConnect(_0x466c5b){joinOrLeave(_0x466c5b,_0x6342('0x53'));}exports[_0x6342('0x54')]=function(_0x379821){_0x379821['on'](_0x6342('0x55'),function(_0x16373f){_0x16373f[_0x6342('0x56')](0x0);_0x16373f[_0x6342('0x57')]=_0x16373f[_0x6342('0x58')][_0x6342('0x55')]['remoteAddress']+':'+_0x16373f[_0x6342('0x58')]['connection'][_0x6342('0x59')];_0x16373f[_0x6342('0x5a')]=new Date();_0x16373f[_0x6342('0x52')]=function(_0x52af87){console[_0x6342('0x52')](_0x6342('0x5b')+_0x16373f[_0x6342('0x5c')][_0x6342('0x5')]+'['+_0x16373f[_0x6342('0x57')]+']',_0x52af87);};_0x16373f['on'](_0x6342('0x5d'),function(){onDisconnect(_0x16373f,_0x379821);_0x16373f[_0x6342('0x52')]('DISCONNECTED');});onConnect(_0x16373f);_0x16373f['log'](_0x6342('0x5e'));});}; \ No newline at end of file +var _0x6859=['role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','MailQueues','findAll','Telephones','Trunks','resourceId','map','Campaign','where','format','user:%s','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','OpenchannelQueue','Trunk','user','userProfileId','ChatQueues','FaxQueues','SmsQueues','MailQueue','OpenchannelQueues','IvrCampaigns','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','removeFaxInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','catch','join','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','User','name'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0x6859,0xb8));var _0x9685=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x6859[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0x9685('0x0'));var util=require(_0x9685('0x1'));var BPromise=require(_0x9685('0x2'));var db=require(_0x9685('0x3'))['db'];var config=require(_0x9685('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x9685('0x5'),'model':db[_0x9685('0x6')],'attributes':['id',_0x9685('0x7'),_0x9685('0x8')],'raw':!![],'where':{'role':_0x9685('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9685('0x7')],'where':{'role':_0x9685('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x9685('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0x9685('0x7')],'where':{'role':_0x9685('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9685('0x7'),_0x9685('0xb')],'where':{'type':_0x9685('0xc')}};function getAssociatedResources(_0x43b549,_0x11a813,_0x334f8e){return db['UserProfileSection'][_0x9685('0xd')]({'where':{'name':_0x43b549,'userProfileId':_0x11a813},'raw':!![]})[_0x9685('0xe')](function(_0x1dc6be){if(_0x1dc6be){if(_0x1dc6be[_0x9685('0xf')]){switch(_0x43b549){case _0x9685('0x10'):case'ChatQueues':case'FaxQueues':case'SmsQueues':case _0x9685('0x11'):case'OpenchannelQueues':return db[_0x334f8e][_0x9685('0x12')](queryQueues);case _0x9685('0x13'):return db[_0x334f8e][_0x9685('0x12')](queryTelephones);case _0x9685('0x14'):return db[_0x334f8e][_0x9685('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x334f8e]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x9685('0x12')]({'attributes':[_0x9685('0x15')],'where':{'sectionId':_0x1dc6be['id']},'raw':!![]})[_0x9685('0xe')](function(_0x2b66c0){if(_0x2b66c0){var _0xfcc8ad={'where':{'id':_[_0x9685('0x16')](_0x2b66c0,_0x9685('0x15'))},'raw':!![]};switch(_0x334f8e){case _0x9685('0x6'):_0xfcc8ad['where']['role']=_0x9685('0xa');break;case _0x9685('0x17'):_0xfcc8ad[_0x9685('0x18')][_0x9685('0xb')]=_0x9685('0xc');break;}return db[_0x334f8e][_0x9685('0x12')](_0xfcc8ad);}else{return[];}});}}else{return[];}})[_0x9685('0xe')](function(_0x2a94b8){return _0x2a94b8;});}function joinOrLeaveQueues(_0x23148a,_0x58ddc0,_0x3485b0,_0x57ebf4){_0x23148a[_0x58ddc0](util['format']('%s:queue:%s',_0x3485b0,_0x57ebf4[_0x9685('0x7')]));if(_0x57ebf4[_0x9685('0x5')]){for(var _0x2427be=0x0;_0x2427be<_0x57ebf4[_0x9685('0x5')]['length'];_0x2427be+=0x1){_0x23148a[_0x58ddc0](util[_0x9685('0x19')](_0x9685('0x1a'),_0x57ebf4[_0x9685('0x5')][_0x2427be]['name']));}}}function joinOrLeave(_0x34babd,_0x405365,_0x108c22){var _0x113234;if(_0x34babd[_0x9685('0x1b')]['query']['id']){db[_0x9685('0x6')]['find']({'attributes':['id',_0x9685('0x7'),_0x9685('0x8'),'userProfileId'],'where':{'id':_0x34babd[_0x9685('0x1b')][_0x9685('0x1c')]['id']},'include':[{'model':db[_0x9685('0x1d')],'as':_0x9685('0x1e'),'attributes':['id'],'raw':!![]},{'model':db[_0x9685('0x1f')],'as':_0x9685('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x9685('0x21')],'as':_0x9685('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x9685('0x23')],'as':_0x9685('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x9685('0x25')],'as':_0x9685('0x26'),'attributes':['id'],'raw':!![]}]})[_0x9685('0xe')](function(_0x55291e){if(_0x55291e){_0x113234=_0x55291e;_0x34babd[_0x405365](util[_0x9685('0x19')](_0x9685('0x1a'),_0x55291e[_0x9685('0x7')]));var _0x1fb6d6=[];switch(_0x55291e[_0x9685('0x8')]){case _0x9685('0x27'):_0x34babd[_0x405365](_0x9685('0x28'));_0x34babd[_0x405365](_0x9685('0x29'));if(queryQueues[_0x9685('0x2a')](_0x9685('0x2b'))){delete queryQueues[_0x9685('0x2b')];}_0x1fb6d6[_0x9685('0x2c')](db[_0x9685('0x2d')][_0x9685('0x12')](queryQueues));_0x1fb6d6[_0x9685('0x2c')](db[_0x9685('0x2e')][_0x9685('0x12')](queryQueues));_0x1fb6d6[_0x9685('0x2c')](db[_0x9685('0x2f')][_0x9685('0x12')](queryQueues));_0x1fb6d6['push'](db['SmsQueue'][_0x9685('0x12')](queryQueues));_0x1fb6d6['push'](db['MailQueue'][_0x9685('0x12')](queryQueues));_0x1fb6d6['push'](db[_0x9685('0x30')][_0x9685('0x12')](queryQueues));_0x1fb6d6[_0x9685('0x2c')](db['User'][_0x9685('0x12')](queryTelephones));_0x1fb6d6['push'](db[_0x9685('0x31')][_0x9685('0x12')](queryTrunks));_0x1fb6d6[_0x9685('0x2c')](db[_0x9685('0x17')][_0x9685('0x12')](queryCampaigns));_0x1fb6d6['push'](db[_0x9685('0x6')][_0x9685('0x12')](queryAgents));break;case _0x9685('0x32'):_0x34babd[_0x405365]('voice:inbound');_0x34babd[_0x405365]('voice:outbound');_0x1fb6d6['push'](getAssociatedResources(_0x9685('0x10'),_0x55291e[_0x9685('0x33')],_0x9685('0x2d')));_0x1fb6d6[_0x9685('0x2c')](getAssociatedResources(_0x9685('0x34'),_0x55291e[_0x9685('0x33')],_0x9685('0x2e')));_0x1fb6d6[_0x9685('0x2c')](getAssociatedResources(_0x9685('0x35'),_0x55291e['userProfileId'],_0x9685('0x2f')));_0x1fb6d6[_0x9685('0x2c')](getAssociatedResources(_0x9685('0x36'),_0x55291e['userProfileId'],'SmsQueue'));_0x1fb6d6[_0x9685('0x2c')](getAssociatedResources(_0x9685('0x11'),_0x55291e[_0x9685('0x33')],_0x9685('0x37')));_0x1fb6d6[_0x9685('0x2c')](getAssociatedResources(_0x9685('0x38'),_0x55291e[_0x9685('0x33')],_0x9685('0x30')));_0x1fb6d6[_0x9685('0x2c')](getAssociatedResources(_0x9685('0x13'),_0x55291e[_0x9685('0x33')],'User'));_0x1fb6d6['push'](getAssociatedResources('Trunks',_0x55291e[_0x9685('0x33')],_0x9685('0x31')));_0x1fb6d6[_0x9685('0x2c')](getAssociatedResources(_0x9685('0x39'),_0x55291e[_0x9685('0x33')],'Campaign'));_0x1fb6d6[_0x9685('0x2c')](db[_0x9685('0x6')][_0x9685('0x12')](queryAgents));break;case'agent':_0x34babd[_0x405365](_0x9685('0x28'));_0x34babd[_0x405365]('voice:outbound');_0x1fb6d6['push'](_0x55291e[_0x9685('0x3a')]({'attributes':['id','name']}));_0x1fb6d6[_0x9685('0x2c')](_0x55291e['getChatQueues']({'attributes':['id',_0x9685('0x7')]}));_0x1fb6d6[_0x9685('0x2c')](_0x55291e[_0x9685('0x3b')]({'attributes':['id',_0x9685('0x7')]}));_0x1fb6d6[_0x9685('0x2c')](_0x55291e[_0x9685('0x3c')]({'attributes':['id',_0x9685('0x7')]}));_0x1fb6d6['push'](_0x55291e[_0x9685('0x3d')]({'attributes':['id',_0x9685('0x7')]}));_0x1fb6d6[_0x9685('0x2c')](_0x55291e[_0x9685('0x3e')]({'attributes':['id','name']}));break;}return BPromise[_0x9685('0x3f')](_0x1fb6d6);}})[_0x9685('0xe')](function(_0x2f9123){if(_0x2f9123&&_0x2f9123[_0x9685('0x40')]){for(var _0x3e6713=0x0;_0x3e6713<_0x2f9123['length'];_0x3e6713+=0x1){for(var _0x2f9951=0x0;_0x2f9951<_0x2f9123[_0x3e6713]['length'];_0x2f9951+=0x1){switch(_0x3e6713){case 0x0:joinOrLeaveQueues(_0x34babd,_0x405365,_0x9685('0x41'),_0x2f9123[_0x3e6713][_0x2f9951]);break;case 0x1:joinOrLeaveQueues(_0x34babd,_0x405365,'chat',_0x2f9123[_0x3e6713][_0x2f9951]);break;case 0x2:joinOrLeaveQueues(_0x34babd,_0x405365,_0x9685('0x42'),_0x2f9123[_0x3e6713][_0x2f9951]);break;case 0x3:joinOrLeaveQueues(_0x34babd,_0x405365,_0x9685('0x43'),_0x2f9123[_0x3e6713][_0x2f9951]);break;case 0x4:joinOrLeaveQueues(_0x34babd,_0x405365,_0x9685('0x44'),_0x2f9123[_0x3e6713][_0x2f9951]);break;case 0x5:joinOrLeaveQueues(_0x34babd,_0x405365,_0x9685('0x45'),_0x2f9123[_0x3e6713][_0x2f9951]);break;case 0x6:_0x34babd[_0x405365](util[_0x9685('0x19')](_0x9685('0x46'),_0x2f9123[_0x3e6713][_0x2f9951]['name']));break;case 0x7:_0x34babd[_0x405365](util[_0x9685('0x19')](_0x9685('0x47'),_0x2f9123[_0x3e6713][_0x2f9951][_0x9685('0x7')]));break;case 0x8:_0x34babd[_0x405365](util[_0x9685('0x19')](_0x9685('0x48'),_0x2f9123[_0x3e6713][_0x2f9951]['type'],_0x2f9123[_0x3e6713][_0x2f9951][_0x9685('0x7')]));break;case 0x9:_0x34babd[_0x405365](util['format'](_0x9685('0x1a'),_0x2f9123[_0x3e6713][_0x2f9951][_0x9685('0x7')]));break;}}}}})[_0x9685('0xe')](function(){if(_0x405365===_0x9685('0x49')){var _0x342ce7=_[_0x9685('0x16')](_0x113234[_0x9685('0x1e')],'id');return _0x113234[_0x9685('0x4a')](_0x342ce7)[_0x9685('0xe')](function(){for(var _0x57841a=0x0;_0x57841a<_0x342ce7[_0x9685('0x40')];_0x57841a+=0x1){_0x108c22[_0x9685('0x4b')](_0x9685('0x4c'),{'ChatInteractionId':Number(_0x342ce7[_0x57841a]),'UserId':Number(_0x113234['id'])});}});}})[_0x9685('0xe')](function(){if(_0x405365===_0x9685('0x49')){var _0x2bef2f=_['map'](_0x113234[_0x9685('0x20')],'id');return _0x113234[_0x9685('0x4d')](_0x2bef2f)[_0x9685('0xe')](function(){for(var _0x201be0=0x0;_0x201be0<_0x2bef2f[_0x9685('0x40')];_0x201be0+=0x1){_0x108c22[_0x9685('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2bef2f[_0x201be0]),'UserId':Number(_0x113234['id'])});}});}})['then'](function(){if(_0x405365===_0x9685('0x49')){var _0x297d33=_['map'](_0x113234[_0x9685('0x22')],'id');return _0x113234[_0x9685('0x4e')](_0x297d33)[_0x9685('0xe')](function(){for(var _0x1754dc=0x0;_0x1754dc<_0x297d33['length'];_0x1754dc+=0x1){_0x108c22[_0x9685('0x4b')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x297d33[_0x1754dc]),'UserId':Number(_0x113234['id'])});}});}})['then'](function(){if(_0x405365===_0x9685('0x49')){var _0x566973=_['map'](_0x113234[_0x9685('0x24')],'id');return _0x113234['removeSmsInteractions'](_0x566973)[_0x9685('0xe')](function(){for(var _0x2040a5=0x0;_0x2040a5<_0x566973[_0x9685('0x40')];_0x2040a5+=0x1){_0x108c22[_0x9685('0x4b')](_0x9685('0x4f'),{'SmsInteractionId':Number(_0x566973[_0x2040a5]),'UserId':Number(_0x113234['id'])});}});}})[_0x9685('0xe')](function(){if(_0x405365===_0x9685('0x49')){var _0x57d5b8=_['map'](_0x113234[_0x9685('0x26')],'id');return _0x113234[_0x9685('0x50')](_0x57d5b8)['then'](function(){for(var _0x4d80ba=0x0;_0x4d80ba<_0x57d5b8[_0x9685('0x40')];_0x4d80ba+=0x1){_0x108c22[_0x9685('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x57d5b8[_0x4d80ba]),'UserId':Number(_0x113234['id'])});}});}})[_0x9685('0x51')](function(_0x81a5e3){_0x34babd['log'](_0x81a5e3);});}}function onDisconnect(_0x56b286,_0x3e993f){joinOrLeave(_0x56b286,'leave',_0x3e993f);}function onConnect(_0x188d8a){joinOrLeave(_0x188d8a,_0x9685('0x52'));}exports['default']=function(_0x2fbc05){_0x2fbc05['on'](_0x9685('0x53'),function(_0x2ec380){_0x2ec380[_0x9685('0x54')](0x0);_0x2ec380[_0x9685('0x55')]=_0x2ec380[_0x9685('0x56')][_0x9685('0x53')][_0x9685('0x57')]+':'+_0x2ec380[_0x9685('0x56')][_0x9685('0x53')][_0x9685('0x58')];_0x2ec380[_0x9685('0x59')]=new Date();_0x2ec380[_0x9685('0x5a')]=function(_0x48c57e){console[_0x9685('0x5a')](_0x9685('0x5b')+_0x2ec380[_0x9685('0x5c')][_0x9685('0x7')]+'['+_0x2ec380[_0x9685('0x55')]+']',_0x48c57e);};_0x2ec380['on'](_0x9685('0x5d'),function(){onDisconnect(_0x2ec380,_0x2fbc05);_0x2ec380['log'](_0x9685('0x5e'));});onConnect(_0x2ec380);_0x2ec380[_0x9685('0x5a')](_0x9685('0x5f'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 2cfb9ef..25f6c51 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 _0x2a4f=['SmsMessage','newmessage','FaxInteraction','Fax','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelMessage','request','then','info','Trigger,\x20%s','error','code','catch','EventManager','get','event','direction','UserId','User','find','name','interface','SIP/%s','channel','incomingmessage','opened','changed','closed','format','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','jayson/promise','../logger','client','Chat','afterCreate','ChatInteraction','afterUpdate','closedinteraction','Sms','SmsInteraction','newinteraction'];(function(_0x2b0e7d,_0x556cc2){var _0x2c984d=function(_0x4c4546){while(--_0x4c4546){_0x2b0e7d['push'](_0x2b0e7d['shift']());}};_0x2c984d(++_0x556cc2);}(_0x2a4f,0xfd));var _0xf2a4=function(_0x496ca4,_0x7cc3fa){_0x496ca4=_0x496ca4-0x0;var _0x5e1e22=_0x2a4f[_0x496ca4];return _0x5e1e22;};'use strict';var util=require(_0xf2a4('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf2a4('0x1'));var logger=require(_0xf2a4('0x2'))('triggers');var client=jayson[_0xf2a4('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0xf2a4('0x4'),'model':'ChatInteraction','event':_0xf2a4('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xf2a4('0x4'),'model':_0xf2a4('0x6'),'event':_0xf2a4('0x7'),'condition':_0xf2a4('0x8'),'callback':afterUpdate},{'channel':'Chat','model':'ChatMessage','event':_0xf2a4('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xf2a4('0x9'),'model':_0xf2a4('0xa'),'event':'afterCreate','condition':_0xf2a4('0xb'),'callback':afterCreate},{'channel':'Sms','model':_0xf2a4('0xa'),'event':_0xf2a4('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf2a4('0x9'),'model':_0xf2a4('0xc'),'event':_0xf2a4('0x5'),'condition':_0xf2a4('0xd'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xf2a4('0xe'),'event':'afterCreate','condition':_0xf2a4('0xb'),'callback':afterCreate},{'channel':_0xf2a4('0xf'),'model':_0xf2a4('0xe'),'event':_0xf2a4('0x7'),'condition':_0xf2a4('0x8'),'callback':afterUpdate},{'channel':_0xf2a4('0xf'),'model':_0xf2a4('0x10'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0xf2a4('0x11'),'event':'afterCreate','condition':_0xf2a4('0xb'),'callback':afterCreate},{'channel':_0xf2a4('0x12'),'model':_0xf2a4('0x11'),'event':_0xf2a4('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf2a4('0x12'),'model':_0xf2a4('0x13'),'event':_0xf2a4('0x5'),'condition':_0xf2a4('0xd'),'callback':afterCreateMessage},{'channel':_0xf2a4('0x14'),'model':'OpenchannelInteraction','event':_0xf2a4('0x5'),'condition':_0xf2a4('0xb'),'callback':afterCreate},{'channel':_0xf2a4('0x14'),'model':'OpenchannelInteraction','event':_0xf2a4('0x7'),'condition':_0xf2a4('0x8'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xf2a4('0x15'),'event':_0xf2a4('0x5'),'condition':_0xf2a4('0xd'),'callback':afterCreateMessage}];function request(_0x301993){return client[_0xf2a4('0x16')]('EventManager',_0x301993)[_0xf2a4('0x17')](function(_0xf41b9d){logger[_0xf2a4('0x18')](_0xf2a4('0x19'),'EventManager',_0xf41b9d);if(_0xf41b9d['error']){if(_0xf41b9d[_0xf2a4('0x1a')][_0xf2a4('0x1b')]===0x1f4){logger[_0xf2a4('0x1a')](_0xf2a4('0x19'),'EventManager',_0xf41b9d[_0xf2a4('0x1a')]);}}})[_0xf2a4('0x1c')](function(_0x558d60){logger['error'](_0xf2a4('0x19'),_0xf2a4('0x1d'),_0x558d60);});}function afterCreateMessage(_0x18faf7,_0x4ba744){return function(_0x14efe3,_0x527c98){_0x14efe3=_0x14efe3[_0xf2a4('0x1e')]({'plain':!![]});_0x14efe3['channel']=_0x18faf7;_0x14efe3[_0xf2a4('0x1f')]=_0x14efe3[_0xf2a4('0x20')];if(_0x14efe3[_0xf2a4('0x21')]){return db[_0xf2a4('0x22')][_0xf2a4('0x23')]({'where':{'id':_0x14efe3[_0xf2a4('0x21')]},'attributes':['id',_0xf2a4('0x24')],'raw':!![]})[_0xf2a4('0x17')](function(_0x5a7224){_0x14efe3[_0xf2a4('0x25')]=util['format'](_0xf2a4('0x26'),_0x5a7224[_0xf2a4('0x24')]);_0x14efe3[_0xf2a4('0x27')]=_0x18faf7;return request({'event':_0xf2a4('0x28'),'message':_0x14efe3});})[_0xf2a4('0x1c')](function(_0x3d3d07){console['error'](_0x3d3d07);});}else{return request({'event':'outgoingmessage','message':_0x14efe3});}};}function afterCreate(_0x39476e,_0x11b158){return function(_0x21d86a,_0x113cc0){_0x21d86a=_0x21d86a['get']({'plain':!![]});_0x21d86a['channel']=_0x39476e;_0x21d86a[_0xf2a4('0x1f')]=_0xf2a4('0x29');return request({'event':_0x11b158,'message':_0x21d86a});};}function afterUpdate(_0x5ccdfa,_0x4874c5){return function(_0x1d35a6,_0x556c3c){if(_0x1d35a6[_0xf2a4('0x2a')](_0xf2a4('0x2b'))&&_0x1d35a6[_0xf2a4('0x2b')]){_0x1d35a6=_0x1d35a6[_0xf2a4('0x1e')]({'plain':!![]});_0x1d35a6[_0xf2a4('0x27')]=_0x5ccdfa;_0x1d35a6['event']=_0xf2a4('0x2b');if(_0x1d35a6[_0xf2a4('0x21')]){return db[_0xf2a4('0x22')]['find']({'where':{'id':_0x1d35a6['UserId']},'attributes':['id',_0xf2a4('0x24')],'raw':!![]})[_0xf2a4('0x17')](function(_0x5f001c){_0x1d35a6[_0xf2a4('0x25')]=util[_0xf2a4('0x2c')](_0xf2a4('0x26'),_0x5f001c[_0xf2a4('0x24')]);return request({'event':_0x4874c5,'message':_0x1d35a6});})[_0xf2a4('0x1c')](function(_0x5a38df){console['error'](_0x5a38df);});}else{return request({'event':_0x4874c5,'message':_0x1d35a6});}}};}exports[_0xf2a4('0x2d')]=function(){for(var _0x1406c5=0x0;_0x1406c5=_0x1462f4['agents']){throw Error(_0x5f19('0x13'));}_0x4b1069(_0xc602cc);})[_0x5f19('0x14')](function(_0x1c7a39){_0x132bc3(_0x1c7a39);});});}; \ No newline at end of file +var _0xa878=['lodash','bluebird','mail','chat','fax','sms','isValidChannel','clearBlockUser','isUndefined','blockedAt','updateAttributes','User','getLicense','agents','catch'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xa878,0xd2));var _0x8a87=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa878[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8a87('0x0'));var BPromise=require(_0x8a87('0x1'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=['voice',_0x8a87('0x2'),_0x8a87('0x3'),_0x8a87('0x4'),_0x8a87('0x5'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0x8a87('0x6')]=function(_0x34e109){_0x34e109=_0x34e109['toLowerCase']();return _['includes'](channels,_0x34e109);};exports[_0x8a87('0x7')]=function(_0x35b71c,_0xb4041e,_0x135263,_0x39a956){var _0x330289={'loginAttempts':_0xb4041e,'blocked':_0x135263};if(!_[_0x8a87('0x8')](_0x39a956)){_0x330289[_0x8a87('0x9')]=_0x39a956;}return _0x35b71c[_0x8a87('0xa')](_0x330289);};exports['getLicense']=function(_0x3df16f){return new BPromise(function(_0x269f80,_0x3033f0){var _0x51d1a7=0x0;if(_0x3df16f['role']!=='agent'){_0x269f80(_0x3df16f);}db[_0x8a87('0xb')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x3df16f['id']}}})['then'](function(_0x5b8c99){_0x51d1a7=_0x5b8c99;return util[_0x8a87('0xc')]();})['then'](function(_0x196379){if(_0x196379&&_0x196379['agents']&&_0x51d1a7>=_0x196379[_0x8a87('0xd')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x269f80(_0x3df16f);})[_0x8a87('0xe')](function(_0x2f729a){_0x3033f0(_0x2f729a);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 2981df8..53673e2 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9c0=['exports','404','status','render'];(function(_0xeccccb,_0x80e76b){var _0x1f6416=function(_0x256081){while(--_0x256081){_0xeccccb['push'](_0xeccccb['shift']());}};_0x1f6416(++_0x80e76b);}(_0xc9c0,0x160));var _0x0c9c=function(_0x3c112e,_0x279664){_0x3c112e=_0x3c112e-0x0;var _0x20ac70=_0xc9c0[_0x3c112e];return _0x20ac70;};'use strict';module[_0x0c9c('0x0')][0x194]=function pageNotFound(_0x49bce6,_0x9784f4){var _0xc2c3eb=_0x0c9c('0x1');var _0x2fa62a=0x194;var _0x1b95e6={'status':_0x2fa62a};_0x9784f4[_0x0c9c('0x2')](_0x1b95e6['status']);_0x9784f4[_0x0c9c('0x3')](_0xc2c3eb,{},function(_0x16cb0a,_0x5cb0db){if(_0x16cb0a){return _0x9784f4[_0x0c9c('0x2')](_0x1b95e6[_0x0c9c('0x2')])['json'](_0x1b95e6);}_0x9784f4['send'](_0x5cb0db);});}; \ No newline at end of file +var _0xab9b=['send','exports','status','json'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xab9b,0xa1));var _0xbab9=function(_0x51b661,_0x566ef8){_0x51b661=_0x51b661-0x0;var _0x5d1971=_0xab9b[_0x51b661];return _0x5d1971;};'use strict';module[_0xbab9('0x0')][0x194]=function pageNotFound(_0x1ecea7,_0x360162){var _0x238181='404';var _0x4d2e5f=0x194;var _0x56e48={'status':_0x4d2e5f};_0x360162[_0xbab9('0x1')](_0x56e48[_0xbab9('0x1')]);_0x360162['render'](_0x238181,{},function(_0x3debcc,_0x16b64a){if(_0x3debcc){return _0x360162[_0xbab9('0x1')](_0x56e48[_0xbab9('0x1')])[_0xbab9('0x2')](_0x56e48);}_0x360162[_0xbab9('0x3')](_0x16b64a);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index bcd8fbc..2755cf6 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f51=['ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','cascade','Recordings','hasMany','VoiceQueuesRt','UserId','VoiceExtension','Extensions','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','CmContact','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','SmsQueues','VoicePrefixes','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','team_has_voice_queues','BlackLists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','AgentReports','uniqueid','ContactId','MailAccountId','hasOne','Imap','MailServerOut','Smtp','Dispositions','MailMessage','Interactions','List','TemplateId','team_has_mail_queues','MailInteractionId','Contact','Tag','Tags','ThroughTags','Users','Attachments','Account','MailApplication','restrict','TagId','ListId','Answers','Exntensions','FaxAccountId','fax_interaction_has_tags','FaxInteractionId','Interaction','AttachmentId','SmsAccountId','SmsMessage','SmsApplication','SmsInteractionId','Owner','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','ChatProactiveAction','CompanyId','HopperFinals','Company','cm_contact_has_tags','OwnerId','CampaignId','All','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','Intervals','MailApplications','FaxApplications','SmsApplications','CustomReportId','Mohs','mail_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','AnyCondition','Actions','TriggerId','AnalyticFieldReport','AnalyticDefaultReport','Fields','DefaultReportId','AccountId','Subjects','SubjectId','DescriptionId','Subject','Description','Field','FieldId','VariableId','SugarcrmAccount','Configurations','Descriptions','DeskField','int_desk_configuration_has_tags','ZohoAccount','ZohoField','int_zendesk_configuration_has_tags','FreshdeskAccount','ServicenowConfiguration','Dynamics365Configuration','FreshsalesAccount','FreshsalesConfiguration','ChatQueueReport','SessionId','JscriptyAnswerReport','SmsQueueReport','JscriptyProject','ProjectId','team_has_openchannel_queues','OpenchannelQueues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToChatQueueId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','VoicePrefix','user_has_voice_prefixes','UserProfileSections','Resources','sectionId','exports','path','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','xcall','xC@LL1234','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmHopper','CmHopperBlack','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticMetric','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model'];(function(_0x43fa62,_0x2824d0){var _0x47bc4c=function(_0xd5124f){while(--_0xd5124f){_0x43fa62['push'](_0x43fa62['shift']());}};_0x47bc4c(++_0x2824d0);}(_0x9f51,0x123));var _0x19f5=function(_0xac209,_0x3741cd){_0xac209=_0xac209-0x0;var _0x234c24=_0x9f51[_0xac209];return _0x234c24;};'use strict';var path=require(_0x19f5('0x0'));var config=require(_0x19f5('0x1'));var Sequelize=require(_0x19f5('0x2'));var _=require(_0x19f5('0x3'));var jstz=require(_0x19f5('0x4'));var timezone=jstz[_0x19f5('0x5')]();config[_0x19f5('0x2')]=_[_0x19f5('0x6')](config['sequelize'],{'database':'motion2','username':_0x19f5('0x7'),'password':_0x19f5('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x19f5('0x9')},'logging':![],'timezone':timezone[_0x19f5('0xa')](),'define':{'charset':_0x19f5('0xb'),'collate':_0x19f5('0xc')}}});config['sequelizeHistory']=_[_0x19f5('0x6')](config[_0x19f5('0xd')],{'database':'motion2','username':_0x19f5('0x7'),'password':_0x19f5('0x8'),'options':{'host':_0x19f5('0xe'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x19f5('0x9')},'logging':![],'timezone':timezone[_0x19f5('0xa')](),'define':{'charset':_0x19f5('0xb'),'collate':_0x19f5('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x19f5('0x2')][_0x19f5('0xf')],config['sequelize']['username'],config[_0x19f5('0x2')][_0x19f5('0x10')],config[_0x19f5('0x2')][_0x19f5('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x19f5('0xd')][_0x19f5('0xf')],config[_0x19f5('0xd')][_0x19f5('0x12')],config[_0x19f5('0xd')][_0x19f5('0x10')],config[_0x19f5('0xd')][_0x19f5('0x11')])};db[_0x19f5('0x13')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x15'));db[_0x19f5('0x16')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x17'));db[_0x19f5('0x18')]=db[_0x19f5('0x2')]['import'](_0x19f5('0x19'));db['VoiceExtension']=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x1a'));db[_0x19f5('0x1b')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x1c'));db[_0x19f5('0x1d')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x1e'));db['VoiceRecording']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x1f'));db[_0x19f5('0x20')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x21'));db[_0x19f5('0x22')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/voiceMail/voiceMail.model');db[_0x19f5('0x23')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x24'));db['VoiceDialReport']=db[_0x19f5('0x2')]['import']('../api/voiceDialReport/voiceDialReport.model');db[_0x19f5('0x25')]=db['sequelize'][_0x19f5('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x19f5('0x26')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x27'));db[_0x19f5('0x28')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x29'));db['Trunk']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x2a'));db[_0x19f5('0x2b')]=db['sequelize']['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x19f5('0x2c')]=db[_0x19f5('0x2')]['import'](_0x19f5('0x2d'));db[_0x19f5('0x2e')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x19f5('0x2f')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x30'));db[_0x19f5('0x31')]=db[_0x19f5('0x2')]['import']('../api/userMailQueue/userMailQueue.model');db[_0x19f5('0x32')]=db['sequelize'][_0x19f5('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0x19f5('0x33')]=db['sequelize'][_0x19f5('0x14')]('../api/userSmsQueue/userSmsQueue.model');db[_0x19f5('0x34')]=db[_0x19f5('0x2')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x19f5('0x35')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x36'));db['MailServerOut']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x37'));db[_0x19f5('0x38')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x39'));db[_0x19f5('0x3a')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x3b'));db[_0x19f5('0x3c')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x3d'));db[_0x19f5('0x3e')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x3f'));db['MailMessage']=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x40'));db['MailApplication']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x41'));db[_0x19f5('0x42')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x43'));db[_0x19f5('0x44')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/dashboard/dashboard.model');db[_0x19f5('0x45')]=db['sequelize'][_0x19f5('0x14')]('../api/dashboardItem/dashboardItem.model');db[_0x19f5('0x46')]=db[_0x19f5('0x2')]['import'](_0x19f5('0x47'));db[_0x19f5('0x48')]=db[_0x19f5('0x2')]['import'](_0x19f5('0x49'));db[_0x19f5('0x4a')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x4b'));db[_0x19f5('0x4c')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x4d'));db[_0x19f5('0x4e')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x4f'));db[_0x19f5('0x50')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0x19f5('0x51')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x52'));db['SmsApplication']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x53'));db[_0x19f5('0x54')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x55'));db['SmsMessage']=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/smsMessage/smsMessage.model');db[_0x19f5('0x56')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/smsQueue/smsQueue.model');db[_0x19f5('0x57')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x58'));db[_0x19f5('0x59')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x5a'));db[_0x19f5('0x5b')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x5c'));db[_0x19f5('0x5d')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x5e'));db[_0x19f5('0x5f')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/openchannelQueue/openchannelQueue.model');db[_0x19f5('0x60')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x61'));db[_0x19f5('0x62')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x63'));db[_0x19f5('0x64')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x65'));db[_0x19f5('0x66')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x67'));db[_0x19f5('0x68')]=db[_0x19f5('0x2')]['import'](_0x19f5('0x69'));db[_0x19f5('0x6a')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x6b'));db[_0x19f5('0x6c')]=db['sequelize']['import'](_0x19f5('0x6d'));db[_0x19f5('0x6e')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x6f'));db['ChatProactiveAction']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x70'));db[_0x19f5('0x71')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x72'));db['CmContact']=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/cmContact/cmContact.model');db[_0x19f5('0x73')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/cmHopper/cmHopper.model');db[_0x19f5('0x74')]=db['sequelize'][_0x19f5('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x19f5('0x75')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x19f5('0x76')]=db[_0x19f5('0x2')]['import'](_0x19f5('0x77'));db[_0x19f5('0x78')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x79'));db[_0x19f5('0x7a')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x7b'));db[_0x19f5('0x7c')]=db[_0x19f5('0x2')]['import']('../api/action/action.model');db[_0x19f5('0x7d')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/automation/automation.model');db[_0x19f5('0x7e')]=db[_0x19f5('0x2')]['import'](_0x19f5('0x7f'));db[_0x19f5('0x80')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x81'));db[_0x19f5('0x82')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x83'));db['Interval']=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x84'));db[_0x19f5('0x85')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0x86'));db['Cdr']=db['sequelize']['import'](_0x19f5('0x87'));db[_0x19f5('0x88')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x89'));db[_0x19f5('0x8a')]=db['sequelize']['import']('../api/schedule/schedule.model');db[_0x19f5('0x8b')]=db[_0x19f5('0x2')]['import'](_0x19f5('0x8c'));db['Tag']=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/tag/tag.model');db['Template']=db[_0x19f5('0x2')]['import'](_0x19f5('0x8d'));db[_0x19f5('0x8e')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/trigger/trigger.model');db[_0x19f5('0x8f')]=db[_0x19f5('0x2')]['import'](_0x19f5('0x90'));db[_0x19f5('0x91')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/integration/integration.model');db[_0x19f5('0x92')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x93'));db[_0x19f5('0x94')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x95'));db['AnalyticDefaultReport']=db[_0x19f5('0x2')]['import'](_0x19f5('0x96'));db['AnalyticExtractedReport']=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x19f5('0x97')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0x19f5('0x2')]['import'](_0x19f5('0x98'));db['AnalyticTreeReport']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x99'));db[_0x19f5('0x9a')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x9b'));db[_0x19f5('0x9c')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x9d'));db[_0x19f5('0x9e')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0x9f'));db[_0x19f5('0xa0')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xa1'));db[_0x19f5('0xa2')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xa3'));db[_0x19f5('0xa4')]=db[_0x19f5('0x2')]['import'](_0x19f5('0xa5'));db[_0x19f5('0xa6')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xa7'));db['DeskField']=db['sequelize'][_0x19f5('0x14')](_0x19f5('0xa8'));db['ZohoAccount']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xa9'));db[_0x19f5('0xaa')]=db[_0x19f5('0x2')]['import'](_0x19f5('0xab'));db['ZohoField']=db[_0x19f5('0x2')]['import'](_0x19f5('0xac'));db[_0x19f5('0xad')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0xae'));db[_0x19f5('0xaf')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xb0'));db[_0x19f5('0xb1')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xb2'));db[_0x19f5('0xb3')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xb4'));db[_0x19f5('0xb5')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xb6'));db[_0x19f5('0xb7')]=db[_0x19f5('0x2')]['import'](_0x19f5('0xb8'));db[_0x19f5('0xb9')]=db[_0x19f5('0x2')]['import'](_0x19f5('0xba'));db[_0x19f5('0xbb')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xbc'));db[_0x19f5('0xbd')]=db['sequelize'][_0x19f5('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db['sequelize'][_0x19f5('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x19f5('0xbe')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0xbf'));db[_0x19f5('0xc0')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xc1'));db['Dynamics365Configuration']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xc2'));db[_0x19f5('0xc3')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xc4'));db['FreshsalesAccount']=db[_0x19f5('0x2')]['import'](_0x19f5('0xc5'));db['FreshsalesConfiguration']=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x19f5('0xc6')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xc7'));db[_0x19f5('0x91')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xc8'));db[_0x19f5('0xc9')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xca'));db['ChatQueueReport']=db[_0x19f5('0x2')]['import']('../api/chatQueueReport/chatQueueReport.model');db[_0x19f5('0xcb')]=db[_0x19f5('0x2')]['import'](_0x19f5('0xcc'));db['JscriptyAnswerReport']=db['sequelize']['import'](_0x19f5('0xcd'));db[_0x19f5('0xce')]=db['sequelize'][_0x19f5('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x19f5('0xcf')]=db['sequelize'][_0x19f5('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0x19f5('0xd0')]=db[_0x19f5('0x2')]['import'](_0x19f5('0xd1'));db[_0x19f5('0xd2')]=db[_0x19f5('0x2')]['import'](_0x19f5('0xd3'));db['JscriptyProject']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xd4'));db[_0x19f5('0xd5')]=db['sequelize'][_0x19f5('0x14')]('../api/setting/setting.model');db[_0x19f5('0xd6')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0xd7'));db[_0x19f5('0xd8')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0xd9'));db[_0x19f5('0xda')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xdb'));db[_0x19f5('0xdc')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/squareMessage/squareMessage.model');db[_0x19f5('0xdd')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0xde'));db[_0x19f5('0xdf')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/license/license.model');db[_0x19f5('0xe0')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0xe1'));db[_0x19f5('0xe2')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xe3'));db[_0x19f5('0xe4')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/attachment/attachment.model');db[_0x19f5('0xe5')]=db[_0x19f5('0x2')]['import'](_0x19f5('0xe6'));db[_0x19f5('0xe7')]=db[_0x19f5('0x2')]['import'](_0x19f5('0xe8'));db[_0x19f5('0xe9')]=db['sequelize'][_0x19f5('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0x19f5('0xea')]=db[_0x19f5('0x2')][_0x19f5('0x14')]('../api/faxTransferReport/faxTransferReport.model');db[_0x19f5('0xeb')]=db[_0x19f5('0x2')]['import'](_0x19f5('0xec'));db[_0x19f5('0xed')]=db['sequelize'][_0x19f5('0x14')](_0x19f5('0xee'));db['CmList']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xef'));db['VoicePrefix']=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xf0'));db[_0x19f5('0xf1')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xf2'));db[_0x19f5('0xf3')]=db['sequelize']['import'](_0x19f5('0xf4'));db[_0x19f5('0xf5')]=db[_0x19f5('0x2')][_0x19f5('0x14')](_0x19f5('0xf6'));db['User']['hasOne'](db['VoiceMail'],{'as':_0x19f5('0x22'),'onDelete':_0x19f5('0xf7'),'foreignKey':'UserId'});db[_0x19f5('0x13')]['hasMany'](db['VoiceRecording'],{'as':_0x19f5('0xf8'),'foreignKey':'UserId'});db['User'][_0x19f5('0xf9')](db['UserVoiceQueueRt'],{'as':_0x19f5('0xfa'),'foreignKey':_0x19f5('0xfb')});db['User'][_0x19f5('0xf9')](db[_0x19f5('0xfc')],{'as':_0x19f5('0xfd'),'onDelete':_0x19f5('0xf7'),'hooks':!![]});db[_0x19f5('0x13')]['hasMany'](db[_0x19f5('0x75')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x19f5('0x13')]['hasMany'](db[_0x19f5('0x76')],{'as':'HopperHistory','foreignKey':_0x19f5('0xfb')});db[_0x19f5('0x13')][_0x19f5('0xf9')](db[_0x19f5('0x78')],{'as':_0x19f5('0x78'),'foreignKey':_0x19f5('0xfb')});db[_0x19f5('0x13')][_0x19f5('0xf9')](db[_0x19f5('0x5b')],{'as':_0x19f5('0xfe'),'foreignKey':_0x19f5('0xfb')});db[_0x19f5('0x13')][_0x19f5('0xf9')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x19f5('0xfb')});db[_0x19f5('0x13')][_0x19f5('0xf9')](db[_0x19f5('0x54')],{'as':_0x19f5('0xff'),'foreignKey':'UserId'});db[_0x19f5('0x13')][_0x19f5('0xf9')](db[_0x19f5('0x4a')],{'as':_0x19f5('0x100'),'foreignKey':_0x19f5('0xfb')});db[_0x19f5('0x13')]['hasMany'](db[_0x19f5('0x3e')],{'as':_0x19f5('0x101'),'foreignKey':_0x19f5('0xfb')});db[_0x19f5('0x13')][_0x19f5('0x102')](db[_0x19f5('0xf1')],{'as':_0x19f5('0xf1'),'foreignKey':_0x19f5('0x103')});db[_0x19f5('0x13')]['belongsToMany'](db['ChatGroup'],{'as':_0x19f5('0x104'),'through':_0x19f5('0x105')});db[_0x19f5('0x13')][_0x19f5('0x106')](db[_0x19f5('0x107')],{'as':_0x19f5('0x108'),'through':_0x19f5('0x109')});db[_0x19f5('0x13')][_0x19f5('0x106')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x10b'),'through':_0x19f5('0x10c')});db[_0x19f5('0x13')]['belongsToMany'](db['Team'],{'through':_0x19f5('0x10d')});db['User']['belongsToMany'](db[_0x19f5('0x3e')],{'as':_0x19f5('0x101'),'through':_0x19f5('0x10e')});db[_0x19f5('0x13')][_0x19f5('0x106')](db[_0x19f5('0x66')],{'as':_0x19f5('0x10f'),'through':_0x19f5('0x110')});db['User'][_0x19f5('0x106')](db[_0x19f5('0x4a')],{'as':_0x19f5('0x100'),'through':_0x19f5('0x111')});db[_0x19f5('0x13')][_0x19f5('0x106')](db[_0x19f5('0x54')],{'as':_0x19f5('0xff'),'through':_0x19f5('0x112')});db[_0x19f5('0x13')][_0x19f5('0x106')](db['OpenchannelInteraction'],{'as':_0x19f5('0xfe'),'through':_0x19f5('0x113')});db[_0x19f5('0x13')][_0x19f5('0x106')](db[_0x19f5('0x1d')],{'as':_0x19f5('0x114'),'through':_0x19f5('0x2e'),'required':![]});db[_0x19f5('0x13')]['belongsToMany'](db[_0x19f5('0x3a')],{'as':_0x19f5('0x115'),'through':_0x19f5('0x31'),'required':![]});db[_0x19f5('0x13')][_0x19f5('0x106')](db[_0x19f5('0x6c')],{'as':_0x19f5('0x116'),'through':_0x19f5('0x2f'),'required':![],'hooks':!![]});db['User'][_0x19f5('0x106')](db[_0x19f5('0x4e')],{'as':_0x19f5('0x117'),'through':'UserFaxQueue','required':![]});db[_0x19f5('0x13')]['belongsToMany'](db[_0x19f5('0x56')],{'as':_0x19f5('0x118'),'through':_0x19f5('0x33'),'required':![]});db[_0x19f5('0x13')][_0x19f5('0x106')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x19f5('0x34'),'required':![]});db['User'][_0x19f5('0x106')](db[_0x19f5('0x10a')],{'through':_0x19f5('0x10c')});db[_0x19f5('0x13')]['belongsToMany'](db['VoicePrefix'],{'as':_0x19f5('0x119'),'through':'user_has_voice_prefixes','required':![]});db[_0x19f5('0x13')][_0x19f5('0x106')](db[_0x19f5('0x60')],{'as':'ChatWebsites','through':'user_has_chat_websites'});db[_0x19f5('0x13')]['belongsToMany'](db['FaxAccount'],{'as':_0x19f5('0x11a'),'through':_0x19f5('0x11b')});db['User'][_0x19f5('0x106')](db[_0x19f5('0x38')],{'as':_0x19f5('0x11c'),'through':_0x19f5('0x11d')});db[_0x19f5('0x13')][_0x19f5('0x106')](db[_0x19f5('0x57')],{'as':_0x19f5('0x11e'),'through':_0x19f5('0x11f')});db[_0x19f5('0x13')]['belongsToMany'](db[_0x19f5('0x51')],{'as':'SmsAccounts','through':_0x19f5('0x120')});db['User'][_0x19f5('0x106')](db['SquareProject'],{'as':_0x19f5('0x121'),'through':_0x19f5('0x122')});db['VoiceChanSpy'][_0x19f5('0xf9')](db[_0x19f5('0xfc')],{'as':_0x19f5('0x123'),'onDelete':_0x19f5('0xf7'),'foreignKey':'ChanSpyId'});db[_0x19f5('0x18')]['hasMany'](db['VoiceExtension'],{'onDelete':_0x19f5('0xf7')});db[_0x19f5('0xfc')][_0x19f5('0xf9')](db[_0x19f5('0xfc')],{'as':_0x19f5('0x124'),'onDelete':_0x19f5('0xf7')});db['VoiceMusicOnHold']['belongsToMany'](db[_0x19f5('0x8b')],{'as':_0x19f5('0x125'),'through':_0x19f5('0x126')});db[_0x19f5('0x1d')][_0x19f5('0xf9')](db['UserVoiceQueueRt'],{'as':_0x19f5('0x127'),'foreignKey':_0x19f5('0x128')});db[_0x19f5('0x1d')][_0x19f5('0xf9')](db['CmHopper'],{'as':_0x19f5('0x129'),'foreignKey':_0x19f5('0x128')});db[_0x19f5('0x1d')][_0x19f5('0xf9')](db[_0x19f5('0x75')],{'as':'HopperFinals','foreignKey':_0x19f5('0x128')});db[_0x19f5('0x1d')][_0x19f5('0xf9')](db[_0x19f5('0x76')],{'as':_0x19f5('0x12a'),'foreignKey':_0x19f5('0x128')});db[_0x19f5('0x1d')][_0x19f5('0xf9')](db[_0x19f5('0x78')],{'as':_0x19f5('0x78'),'foreignKey':_0x19f5('0x128')});db[_0x19f5('0x1d')]['hasMany'](db[_0x19f5('0x74')],{'as':_0x19f5('0x12b'),'foreignKey':_0x19f5('0x128')});db['VoiceQueue']['hasMany'](db[_0x19f5('0xcf')],{'as':_0x19f5('0x12c'),'foreignKey':_0x19f5('0x128')});db['VoiceQueue'][_0x19f5('0x102')](db[_0x19f5('0x12d')],{'as':_0x19f5('0x12d'),'foreignKey':_0x19f5('0x12e')});db[_0x19f5('0x1d')]['belongsTo'](db[_0x19f5('0x12d')],{'as':_0x19f5('0x12f'),'foreignKey':'TrunkBackupId'});db[_0x19f5('0x1d')][_0x19f5('0x102')](db['Interval'],{'as':_0x19f5('0x130'),'foreignKey':_0x19f5('0x131')});db[_0x19f5('0x1d')][_0x19f5('0x102')](db['Pause'],{'as':_0x19f5('0x132'),'foreignKey':_0x19f5('0x133')});db[_0x19f5('0x1d')][_0x19f5('0x106')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x10b'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x19f5('0x106')](db[_0x19f5('0x13')],{'as':_0x19f5('0x134'),'through':_0x19f5('0x2e')});db[_0x19f5('0x1d')][_0x19f5('0x106')](db['Team'],{'as':_0x19f5('0x135'),'through':_0x19f5('0x136')});db[_0x19f5('0x1d')]['belongsToMany'](db[_0x19f5('0x10a')],{'as':_0x19f5('0x137'),'through':'voice_queues_has_cm_blacklists'});db['VoiceRecording']['belongsTo'](db[_0x19f5('0x13')],{'as':_0x19f5('0x13'),'foreignKey':_0x19f5('0xfb')});db[_0x19f5('0x20')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'as':'User','foreignKey':_0x19f5('0xfb')});db[_0x19f5('0x22')][_0x19f5('0xf9')](db[_0x19f5('0x23')],{'as':_0x19f5('0x138'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x19f5('0x139')});db[_0x19f5('0x23')][_0x19f5('0x102')](db[_0x19f5('0x22')],{'foreignKey':_0x19f5('0x13a'),'targetKey':_0x19f5('0x139')});db[_0x19f5('0x13b')]['hasMany'](db['VoiceQueueReport'],{'as':_0x19f5('0x13c'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0x19f5('0xf9')](db[_0x19f5('0x25')],{'as':_0x19f5('0x13d'),'foreignKey':_0x19f5('0x13e'),'constraints':![]});db[_0x19f5('0x13b')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'as':_0x19f5('0x13'),'foreignKey':_0x19f5('0xfb')});db[_0x19f5('0x13b')]['belongsTo'](db[_0x19f5('0x107')],{'as':'Contact','foreignKey':_0x19f5('0x13f')});db[_0x19f5('0x35')][_0x19f5('0x102')](db[_0x19f5('0x38')],{'as':_0x19f5('0x38'),'foreignKey':_0x19f5('0x140')});db['MailServerOut'][_0x19f5('0x102')](db[_0x19f5('0x38')],{'as':'MailAccount','foreignKey':_0x19f5('0x140')});db[_0x19f5('0x38')][_0x19f5('0x141')](db[_0x19f5('0x35')],{'as':_0x19f5('0x142'),'onDelete':_0x19f5('0xf7')});db[_0x19f5('0x38')][_0x19f5('0x141')](db[_0x19f5('0x143')],{'as':_0x19f5('0x144'),'onDelete':_0x19f5('0xf7')});db[_0x19f5('0x38')]['hasMany'](db[_0x19f5('0x80')],{'as':_0x19f5('0x145'),'foreignKey':_0x19f5('0x140')});db['MailAccount']['hasMany'](db[_0x19f5('0x7e')],{'as':'Answers','foreignKey':_0x19f5('0x140')});db[_0x19f5('0x38')][_0x19f5('0xf9')](db[_0x19f5('0x146')],{'as':_0x19f5('0x138'),'foreignKey':_0x19f5('0x140')});db['MailAccount'][_0x19f5('0xf9')](db[_0x19f5('0x3e')],{'as':_0x19f5('0x147')});db[_0x19f5('0x38')][_0x19f5('0xf9')](db['MailApplication'],{'as':_0x19f5('0x124')});db[_0x19f5('0x38')][_0x19f5('0x102')](db['CmList'],{'as':_0x19f5('0x148'),'foreignKey':'ListId'});db[_0x19f5('0x38')][_0x19f5('0x102')](db['Template'],{'as':'Template','foreignKey':_0x19f5('0x149')});db[_0x19f5('0x38')][_0x19f5('0x102')](db[_0x19f5('0x85')],{'as':_0x19f5('0x132'),'foreignKey':_0x19f5('0x133')});db['MailAccount'][_0x19f5('0x106')](db['User'],{'as':_0x19f5('0x134'),'through':_0x19f5('0x11d')});db[_0x19f5('0x3a')]['belongsToMany'](db[_0x19f5('0x13')],{'as':_0x19f5('0x134'),'through':_0x19f5('0x31')});db[_0x19f5('0x3a')][_0x19f5('0x106')](db[_0x19f5('0xdd')],{'through':_0x19f5('0x14a'),'as':_0x19f5('0x135')});db['MailInteraction'][_0x19f5('0xf9')](db[_0x19f5('0x146')],{'as':_0x19f5('0x138'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x14b')});db[_0x19f5('0x3e')][_0x19f5('0x102')](db[_0x19f5('0x38')],{'as':'Account','foreignKey':_0x19f5('0x140')});db[_0x19f5('0x3e')][_0x19f5('0x102')](db[_0x19f5('0x107')],{'as':_0x19f5('0x14c'),'foreignKey':_0x19f5('0x13f')});db[_0x19f5('0x3e')][_0x19f5('0x102')](db['User'],{'as':'Owner','foreignKey':_0x19f5('0xfb')});db[_0x19f5('0x3e')][_0x19f5('0x106')](db[_0x19f5('0x14d')],{'through':'mail_interaction_has_tags','as':_0x19f5('0x14e')});db['MailInteraction'][_0x19f5('0x106')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0x19f5('0x14f')});db[_0x19f5('0x3e')]['belongsToMany'](db[_0x19f5('0x13')],{'as':_0x19f5('0x150'),'through':_0x19f5('0x10e'),'foreignKey':_0x19f5('0x14b')});db[_0x19f5('0x146')][_0x19f5('0xf9')](db[_0x19f5('0xe4')],{'as':_0x19f5('0x151'),'onDelete':_0x19f5('0xf7')});db[_0x19f5('0x146')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'as':_0x19f5('0x13')});db[_0x19f5('0x146')][_0x19f5('0x102')](db[_0x19f5('0x107')],{'onDelete':_0x19f5('0xf7'),'as':_0x19f5('0x14c')});db['MailMessage'][_0x19f5('0x102')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0x19f5('0x14b')});db['MailMessage']['belongsTo'](db[_0x19f5('0x38')],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x140')});db[_0x19f5('0x153')][_0x19f5('0x102')](db['User'],{'onDelete':_0x19f5('0x154')});db[_0x19f5('0x153')][_0x19f5('0x102')](db[_0x19f5('0x3a')],{'onDelete':_0x19f5('0x154')});db[_0x19f5('0x153')]['belongsTo'](db[_0x19f5('0x38')],{'onDelete':_0x19f5('0x154')});db[_0x19f5('0x153')][_0x19f5('0x102')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x19f5('0x153')]['belongsTo'](db[_0x19f5('0x14d')],{'onDelete':_0x19f5('0x154'),'foreignKey':_0x19f5('0x155')});db[_0x19f5('0x42')][_0x19f5('0x102')](db[_0x19f5('0x38')],{});db[_0x19f5('0x42')][_0x19f5('0x102')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x148'),'foreignKey':_0x19f5('0x156')});db[_0x19f5('0x42')]['belongsTo'](db[_0x19f5('0x107')],{'as':_0x19f5('0x14c'),'foreignKey':'ContactId'});db[_0x19f5('0x42')]['belongsTo'](db['MailInteraction'],{});db[_0x19f5('0x42')][_0x19f5('0x102')](db[_0x19f5('0x146')],{});db['MailQueueReport'][_0x19f5('0x102')](db[_0x19f5('0x13')],{});db[_0x19f5('0x42')][_0x19f5('0x102')](db[_0x19f5('0x3a')],{});db[_0x19f5('0x44')][_0x19f5('0xf9')](db['DashboardItem'],{'as':'Items','onDelete':_0x19f5('0xf7')});db[_0x19f5('0x46')][_0x19f5('0xf9')](db['Disposition'],{'as':_0x19f5('0x145'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0x19f5('0xf9')](db['CannedAnswer'],{'as':_0x19f5('0x157'),'foreignKey':'FaxAccountId'});db[_0x19f5('0x46')]['hasMany'](db[_0x19f5('0x4a')],{'as':_0x19f5('0x147')});db[_0x19f5('0x46')][_0x19f5('0xf9')](db['FaxApplication'],{'as':_0x19f5('0x124')});db[_0x19f5('0x46')][_0x19f5('0xf9')](db[_0x19f5('0xfc')],{'as':_0x19f5('0x158'),'onDelete':_0x19f5('0xf7')});db['FaxAccount']['hasMany'](db[_0x19f5('0x4c')],{'as':'Messages'});db['FaxAccount']['belongsTo'](db[_0x19f5('0x12d')],{'as':_0x19f5('0x12d')});db['FaxAccount'][_0x19f5('0x102')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x148'),'foreignKey':'ListId'});db['FaxAccount'][_0x19f5('0x102')](db[_0x19f5('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0x19f5('0x133')});db['FaxAccount']['belongsToMany'](db['User'],{'as':_0x19f5('0x134'),'through':_0x19f5('0x11b')});db[_0x19f5('0x48')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'onDelete':_0x19f5('0x154')});db[_0x19f5('0x48')]['belongsTo'](db[_0x19f5('0x4e')],{'onDelete':_0x19f5('0x154')});db[_0x19f5('0x48')][_0x19f5('0x102')](db[_0x19f5('0x46')],{'onDelete':_0x19f5('0x154')});db[_0x19f5('0x48')][_0x19f5('0x102')](db[_0x19f5('0x14d')],{'onDelete':_0x19f5('0x154'),'foreignKey':_0x19f5('0x155')});db[_0x19f5('0x4a')][_0x19f5('0xf9')](db[_0x19f5('0x4c')],{'as':_0x19f5('0x138'),'onDelete':_0x19f5('0xf7'),'foreignKey':'FaxInteractionId'});db[_0x19f5('0x4a')]['belongsTo'](db[_0x19f5('0x46')],{'as':'Account','foreignKey':_0x19f5('0x159')});db['FaxInteraction']['belongsTo'](db[_0x19f5('0x107')],{'as':_0x19f5('0x14c'),'foreignKey':_0x19f5('0x13f')});db[_0x19f5('0x4a')]['belongsTo'](db[_0x19f5('0x13')],{'as':'Owner','foreignKey':_0x19f5('0xfb')});db[_0x19f5('0x4a')][_0x19f5('0x106')](db[_0x19f5('0x14d')],{'through':_0x19f5('0x15a'),'as':'Tags'});db['FaxInteraction']['belongsToMany'](db[_0x19f5('0x14d')],{'through':_0x19f5('0x15a'),'as':_0x19f5('0x14f')});db[_0x19f5('0x4a')][_0x19f5('0x106')](db['User'],{'as':_0x19f5('0x150'),'through':_0x19f5('0x111'),'foreignKey':_0x19f5('0x15b')});db[_0x19f5('0x4c')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'onDelete':'cascade','as':_0x19f5('0x13')});db['FaxMessage'][_0x19f5('0x102')](db[_0x19f5('0x4a')],{'as':_0x19f5('0x15c'),'foreignKey':'FaxInteractionId'});db[_0x19f5('0x4c')][_0x19f5('0x102')](db[_0x19f5('0x107')],{'onDelete':'cascade','as':_0x19f5('0x14c')});db[_0x19f5('0x4c')][_0x19f5('0x102')](db[_0x19f5('0xe4')],{'as':_0x19f5('0xe4'),'foreignKey':_0x19f5('0x15d')});db[_0x19f5('0x4c')][_0x19f5('0x102')](db[_0x19f5('0x46')],{'as':'Account','foreignKey':_0x19f5('0x159')});db[_0x19f5('0x4e')][_0x19f5('0x106')](db[_0x19f5('0x13')],{'as':'Agents','through':'UserFaxQueue'});db[_0x19f5('0x4e')][_0x19f5('0x106')](db['Team'],{'through':'team_has_fax_queues','as':_0x19f5('0x135')});db['FaxQueueReport']['belongsTo'](db['FaxAccount'],{});db[_0x19f5('0x50')][_0x19f5('0x102')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x148'),'foreignKey':_0x19f5('0x156')});db['FaxQueueReport'][_0x19f5('0x102')](db[_0x19f5('0x107')],{'as':_0x19f5('0x14c'),'foreignKey':'ContactId'});db[_0x19f5('0x50')][_0x19f5('0x102')](db[_0x19f5('0x4a')],{});db[_0x19f5('0x50')][_0x19f5('0x102')](db[_0x19f5('0x4c')],{});db[_0x19f5('0x50')][_0x19f5('0x102')](db[_0x19f5('0x13')],{});db[_0x19f5('0x50')][_0x19f5('0x102')](db[_0x19f5('0x4e')],{});db[_0x19f5('0x51')][_0x19f5('0xf9')](db[_0x19f5('0x80')],{'as':'Dispositions','foreignKey':_0x19f5('0x15e')});db['SmsAccount'][_0x19f5('0xf9')](db[_0x19f5('0x7e')],{'as':_0x19f5('0x157'),'foreignKey':_0x19f5('0x15e')});db['SmsAccount'][_0x19f5('0xf9')](db[_0x19f5('0x15f')],{'as':_0x19f5('0x138'),'foreignKey':'SmsAccountId'});db[_0x19f5('0x51')][_0x19f5('0xf9')](db['SmsInteraction'],{'as':_0x19f5('0x147')});db[_0x19f5('0x51')][_0x19f5('0xf9')](db[_0x19f5('0x160')],{'as':_0x19f5('0x124')});db[_0x19f5('0x51')][_0x19f5('0x102')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x148'),'foreignKey':'ListId'});db[_0x19f5('0x51')][_0x19f5('0x102')](db[_0x19f5('0x85')],{'as':_0x19f5('0x132'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x19f5('0x51')][_0x19f5('0x106')](db['User'],{'as':_0x19f5('0x134'),'through':_0x19f5('0x120')});db[_0x19f5('0x160')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'onDelete':_0x19f5('0x154')});db['SmsApplication']['belongsTo'](db[_0x19f5('0x56')],{'onDelete':_0x19f5('0x154')});db['SmsApplication'][_0x19f5('0x102')](db[_0x19f5('0x51')],{'onDelete':'restrict'});db[_0x19f5('0x160')][_0x19f5('0x102')](db[_0x19f5('0x130')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x19f5('0x160')][_0x19f5('0x102')](db['Tag'],{'onDelete':_0x19f5('0x154'),'foreignKey':_0x19f5('0x155')});db[_0x19f5('0x54')]['hasMany'](db['SmsMessage'],{'as':_0x19f5('0x138'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x161')});db[_0x19f5('0x54')]['belongsTo'](db[_0x19f5('0x51')],{'as':_0x19f5('0x152'),'foreignKey':'SmsAccountId'});db['SmsInteraction'][_0x19f5('0x102')](db[_0x19f5('0x107')],{'as':_0x19f5('0x14c'),'foreignKey':_0x19f5('0x13f')});db[_0x19f5('0x54')][_0x19f5('0x102')](db['User'],{'as':_0x19f5('0x162'),'foreignKey':'UserId'});db[_0x19f5('0x54')][_0x19f5('0x106')](db[_0x19f5('0x14d')],{'through':_0x19f5('0x163'),'as':_0x19f5('0x14e')});db[_0x19f5('0x54')][_0x19f5('0x106')](db[_0x19f5('0x14d')],{'through':'sms_interaction_has_tags','as':_0x19f5('0x14f')});db[_0x19f5('0x54')][_0x19f5('0x106')](db[_0x19f5('0x13')],{'as':_0x19f5('0x150'),'through':_0x19f5('0x112'),'foreignKey':_0x19f5('0x161')});db[_0x19f5('0x15f')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'as':'User'});db[_0x19f5('0x15f')][_0x19f5('0x102')](db[_0x19f5('0x107')],{'onDelete':'cascade','as':_0x19f5('0x14c')});db[_0x19f5('0x15f')][_0x19f5('0x102')](db[_0x19f5('0x54')],{'onDelete':_0x19f5('0xf7'),'as':_0x19f5('0x15c'),'foreignKey':_0x19f5('0x161')});db['SmsMessage'][_0x19f5('0x102')](db['SmsAccount'],{'as':_0x19f5('0x152'),'foreignKey':'SmsAccountId'});db[_0x19f5('0x56')][_0x19f5('0x106')](db['User'],{'as':_0x19f5('0x134'),'through':_0x19f5('0x33'),'foreignKey':_0x19f5('0x164')});db[_0x19f5('0x56')]['belongsToMany'](db[_0x19f5('0xdd')],{'through':_0x19f5('0x165'),'as':'Teams'});db['OpenchannelAccount']['hasMany'](db[_0x19f5('0x80')],{'as':_0x19f5('0x145'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x19f5('0xf9')](db[_0x19f5('0x7e')],{'as':_0x19f5('0x157'),'foreignKey':'OpenchannelAccountId'});db[_0x19f5('0x57')][_0x19f5('0xf9')](db[_0x19f5('0x5b')],{'as':_0x19f5('0x147'),'foreignKey':'OpenchannelAccountId'});db[_0x19f5('0x57')][_0x19f5('0xf9')](db[_0x19f5('0x5d')],{'as':_0x19f5('0x138'),'foreignKey':_0x19f5('0x166')});db[_0x19f5('0x57')][_0x19f5('0xf9')](db[_0x19f5('0x59')],{'as':_0x19f5('0x124'),'foreignKey':_0x19f5('0x166')});db[_0x19f5('0x57')][_0x19f5('0x102')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x148'),'foreignKey':_0x19f5('0x156')});db[_0x19f5('0x57')]['belongsTo'](db['Pause'],{'as':_0x19f5('0x132'),'foreignKey':_0x19f5('0x133')});db[_0x19f5('0x57')]['belongsToMany'](db[_0x19f5('0x13')],{'as':_0x19f5('0x134'),'through':_0x19f5('0x11f')});db['OpenchannelApplication'][_0x19f5('0x102')](db[_0x19f5('0x13')],{'onDelete':_0x19f5('0x154')});db[_0x19f5('0x59')][_0x19f5('0x102')](db['OpenchannelQueue'],{'onDelete':_0x19f5('0x154'),'foreignKey':_0x19f5('0x167')});db[_0x19f5('0x59')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x19f5('0x166')});db[_0x19f5('0x59')]['belongsTo'](db['Interval'],{'onDelete':_0x19f5('0x154'),'foreignKey':_0x19f5('0x131')});db['OpenchannelApplication'][_0x19f5('0x102')](db[_0x19f5('0x14d')],{'onDelete':'restrict','foreignKey':_0x19f5('0x155')});db[_0x19f5('0x5b')][_0x19f5('0xf9')](db[_0x19f5('0x5d')],{'as':_0x19f5('0x138'),'onDelete':_0x19f5('0xf7'),'foreignKey':'OpenchannelInteractionId'});db[_0x19f5('0x5b')]['belongsTo'](db[_0x19f5('0x57')],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x166')});db[_0x19f5('0x5b')][_0x19f5('0x102')](db['CmContact'],{'as':_0x19f5('0x14c'),'foreignKey':_0x19f5('0x13f')});db[_0x19f5('0x5b')]['belongsTo'](db[_0x19f5('0x13')],{'as':'Owner','foreignKey':_0x19f5('0xfb')});db['OpenchannelInteraction']['belongsToMany'](db[_0x19f5('0x14d')],{'through':_0x19f5('0x168'),'as':_0x19f5('0x14e')});db[_0x19f5('0x5b')][_0x19f5('0x106')](db['Tag'],{'through':_0x19f5('0x168'),'as':_0x19f5('0x14f')});db[_0x19f5('0x5b')]['belongsToMany'](db[_0x19f5('0x13')],{'as':_0x19f5('0x150'),'through':_0x19f5('0x113'),'foreignKey':_0x19f5('0x169')});db[_0x19f5('0x5d')][_0x19f5('0x102')](db['User'],{'onDelete':_0x19f5('0xf7'),'as':_0x19f5('0x13')});db[_0x19f5('0x5d')][_0x19f5('0x102')](db['CmContact'],{'onDelete':_0x19f5('0xf7'),'as':_0x19f5('0x14c')});db[_0x19f5('0x5d')][_0x19f5('0x102')](db[_0x19f5('0x5b')],{'onDelete':_0x19f5('0xf7'),'as':_0x19f5('0x15c'),'foreignKey':_0x19f5('0x169')});db['OpenchannelMessage'][_0x19f5('0x102')](db[_0x19f5('0xe4')],{'as':_0x19f5('0xe4'),'foreignKey':_0x19f5('0x15d')});db[_0x19f5('0x5d')][_0x19f5('0x102')](db[_0x19f5('0x57')],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x166')});db[_0x19f5('0x5f')][_0x19f5('0x106')](db[_0x19f5('0x13')],{'as':_0x19f5('0x134'),'through':_0x19f5('0x34'),'foreignKey':'OpenchannelQueueId'});db[_0x19f5('0x5f')][_0x19f5('0x106')](db[_0x19f5('0xdd')],{'through':'team_has_openchannel_queues','as':_0x19f5('0x135')});db[_0x19f5('0x60')]['hasMany'](db[_0x19f5('0x80')],{'as':_0x19f5('0x145'),'foreignKey':_0x19f5('0x16a')});db[_0x19f5('0x60')]['hasMany'](db['CannedAnswer'],{'as':_0x19f5('0x157'),'foreignKey':_0x19f5('0x16a')});db[_0x19f5('0x60')][_0x19f5('0xf9')](db['ChatProactiveAction'],{'as':_0x19f5('0x16b')});db[_0x19f5('0x60')]['hasMany'](db[_0x19f5('0x66')],{'as':_0x19f5('0x147')});db[_0x19f5('0x60')][_0x19f5('0xf9')](db['ChatApplication'],{'as':_0x19f5('0x124')});db[_0x19f5('0x60')]['hasMany'](db[_0x19f5('0x68')],{'as':'Messages'});db[_0x19f5('0x60')][_0x19f5('0x102')](db['CmList'],{'as':_0x19f5('0x148'),'foreignKey':'ListId'});db[_0x19f5('0x60')]['belongsTo'](db[_0x19f5('0x130')],{'as':_0x19f5('0x130'),'foreignKey':_0x19f5('0x131')});db[_0x19f5('0x60')]['belongsTo'](db[_0x19f5('0x85')],{'as':_0x19f5('0x132'),'foreignKey':_0x19f5('0x133')});db[_0x19f5('0x60')][_0x19f5('0x106')](db[_0x19f5('0x13')],{'as':'Agents','through':'user_has_chat_websites'});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x19f5('0x62')][_0x19f5('0x102')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x148'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0x19f5('0x102')](db['CmContact'],{'as':_0x19f5('0x14c'),'foreignKey':_0x19f5('0x13f')});db['OpenchannelQueueReport'][_0x19f5('0x102')](db['OpenchannelInteraction'],{});db[_0x19f5('0x62')][_0x19f5('0x102')](db[_0x19f5('0x5d')],{});db[_0x19f5('0x62')][_0x19f5('0x102')](db['User'],{});db[_0x19f5('0x62')]['belongsTo'](db[_0x19f5('0x5f')],{});db[_0x19f5('0x64')]['belongsTo'](db[_0x19f5('0x13')],{'as':_0x19f5('0x16c'),'foreignKey':_0x19f5('0xfb'),'onDelete':_0x19f5('0x154')});db[_0x19f5('0x64')][_0x19f5('0x102')](db['ChatQueue'],{'as':_0x19f5('0x16d'),'foreignKey':_0x19f5('0x16e'),'onDelete':_0x19f5('0x154')});db[_0x19f5('0x64')][_0x19f5('0x102')](db[_0x19f5('0x60')],{'as':_0x19f5('0x16f'),'foreignKey':_0x19f5('0x16a'),'onDelete':_0x19f5('0x154')});db[_0x19f5('0x64')][_0x19f5('0x102')](db[_0x19f5('0x14d')],{'onDelete':_0x19f5('0x154'),'foreignKey':_0x19f5('0x155')});db[_0x19f5('0x66')][_0x19f5('0xf9')](db[_0x19f5('0x68')],{'as':_0x19f5('0x138'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x170')});db['ChatInteraction'][_0x19f5('0x102')](db[_0x19f5('0x60')],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x16a')});db[_0x19f5('0x66')]['belongsTo'](db[_0x19f5('0x107')],{'as':'Contact','foreignKey':_0x19f5('0x13f')});db['ChatInteraction'][_0x19f5('0x102')](db[_0x19f5('0x13')],{'as':'Owner','foreignKey':'UserId'});db[_0x19f5('0x66')]['belongsToMany'](db[_0x19f5('0x14d')],{'through':_0x19f5('0x171'),'as':_0x19f5('0x14e')});db[_0x19f5('0x66')][_0x19f5('0x106')](db[_0x19f5('0x14d')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0x19f5('0x66')]['belongsToMany'](db[_0x19f5('0x13')],{'as':_0x19f5('0x150'),'through':_0x19f5('0x110'),'foreignKey':_0x19f5('0x170')});db['ChatMessage'][_0x19f5('0x102')](db[_0x19f5('0x13')],{'onDelete':_0x19f5('0xf7'),'as':_0x19f5('0x13')});db[_0x19f5('0x68')]['belongsTo'](db['CmContact'],{'onDelete':_0x19f5('0xf7'),'as':_0x19f5('0x14c'),'foreignKey':_0x19f5('0x13f')});db['ChatMessage'][_0x19f5('0x102')](db['ChatInteraction'],{'onDelete':_0x19f5('0xf7'),'as':'Interaction','foreignKey':_0x19f5('0x170')});db['ChatMessage'][_0x19f5('0x102')](db[_0x19f5('0xe4')],{'as':_0x19f5('0xe4'),'foreignKey':_0x19f5('0x15d')});db[_0x19f5('0x68')]['belongsTo'](db[_0x19f5('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x19f5('0x6a')][_0x19f5('0x102')](db[_0x19f5('0x107')],{'onDelete':_0x19f5('0xf7'),'as':_0x19f5('0x14c'),'foreignKey':_0x19f5('0x13f')});db[_0x19f5('0x6a')][_0x19f5('0x102')](db[_0x19f5('0x60')],{'as':_0x19f5('0x152'),'foreignKey':'ChatWebsiteId'});db[_0x19f5('0x6c')]['belongsToMany'](db[_0x19f5('0x13')],{'as':_0x19f5('0x134'),'through':_0x19f5('0x2f'),'hooks':!![]});db['ChatQueue'][_0x19f5('0x106')](db[_0x19f5('0xdd')],{'through':_0x19f5('0x172'),'as':_0x19f5('0x135')});db[_0x19f5('0x6e')][_0x19f5('0xf9')](db[_0x19f5('0xcb')],{'as':_0x19f5('0x138'),'foreignKey':_0x19f5('0x173'),'onDelete':_0x19f5('0xf7')});db[_0x19f5('0x6e')][_0x19f5('0x106')](db[_0x19f5('0x13')],{'as':'Members','through':_0x19f5('0x105')});db[_0x19f5('0x174')]['belongsTo'](db[_0x19f5('0x60')],{'as':'Website','foreignKey':'ChatWebsiteId'});db[_0x19f5('0x71')][_0x19f5('0xf9')](db[_0x19f5('0x107')],{'as':_0x19f5('0x108'),'foreignKey':_0x19f5('0x175')});db[_0x19f5('0x107')][_0x19f5('0xf9')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x19f5('0x13f')});db[_0x19f5('0x107')][_0x19f5('0xf9')](db[_0x19f5('0x75')],{'as':_0x19f5('0x176'),'foreignKey':_0x19f5('0x13f')});db[_0x19f5('0x107')][_0x19f5('0xf9')](db[_0x19f5('0x76')],{'as':_0x19f5('0x12a'),'foreignKey':'ContactId'});db[_0x19f5('0x107')][_0x19f5('0xf9')](db[_0x19f5('0x78')],{'as':_0x19f5('0x78'),'foreignKey':'ContactId'});db['CmContact'][_0x19f5('0xf9')](db['JscriptySessionReport'],{'as':_0x19f5('0x12c'),'foreignKey':_0x19f5('0x13f')});db[_0x19f5('0x107')]['hasMany'](db[_0x19f5('0x5b')],{'as':_0x19f5('0xfe'),'foreignKey':'ContactId','onDelete':_0x19f5('0x154')});db[_0x19f5('0x107')]['hasMany'](db[_0x19f5('0x66')],{'as':_0x19f5('0x10f'),'foreignKey':_0x19f5('0x13f'),'onDelete':_0x19f5('0x154')});db['CmContact'][_0x19f5('0xf9')](db[_0x19f5('0x54')],{'as':'SmsInteractions','foreignKey':_0x19f5('0x13f'),'onDelete':'restrict'});db[_0x19f5('0x107')]['hasMany'](db[_0x19f5('0x4a')],{'as':_0x19f5('0x100'),'foreignKey':'ContactId','onDelete':_0x19f5('0x154')});db[_0x19f5('0x107')]['hasMany'](db[_0x19f5('0x3e')],{'as':_0x19f5('0x101'),'foreignKey':_0x19f5('0x13f'),'onDelete':_0x19f5('0x154')});db[_0x19f5('0x107')][_0x19f5('0x102')](db[_0x19f5('0x71')],{'as':_0x19f5('0x177'),'foreignKey':_0x19f5('0x175')});db[_0x19f5('0x107')][_0x19f5('0x102')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x148'),'foreignKey':_0x19f5('0x156'),'onDelete':_0x19f5('0xf7')});db[_0x19f5('0x107')][_0x19f5('0x106')](db['User'],{'as':'Users','through':_0x19f5('0x109')});db[_0x19f5('0x107')][_0x19f5('0x106')](db[_0x19f5('0x14d')],{'as':_0x19f5('0x14e'),'through':_0x19f5('0x178')});db[_0x19f5('0x107')][_0x19f5('0x106')](db[_0x19f5('0x14d')],{'through':_0x19f5('0x178'),'as':_0x19f5('0x14f')});db[_0x19f5('0x73')]['belongsTo'](db[_0x19f5('0x107')],{'as':_0x19f5('0x14c'),'foreignKey':_0x19f5('0x13f'),'onDelete':_0x19f5('0xf7')});db[_0x19f5('0x73')][_0x19f5('0x102')](db[_0x19f5('0x10a')],{'as':'List','foreignKey':'ListId','onDelete':_0x19f5('0xf7')});db[_0x19f5('0x73')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'as':_0x19f5('0x16c'),'foreignKey':'UserId'});db[_0x19f5('0x73')][_0x19f5('0x102')](db[_0x19f5('0x1d')],{'as':_0x19f5('0x16d'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x19f5('0x73')][_0x19f5('0x102')](db['Campaign'],{'as':_0x19f5('0xe0'),'foreignKey':'CampaignId','onDelete':_0x19f5('0xf7')});db[_0x19f5('0x73')]['belongsTo'](db['User'],{'as':_0x19f5('0x162'),'foreignKey':_0x19f5('0x179')});db[_0x19f5('0x74')][_0x19f5('0x102')](db[_0x19f5('0x107')],{'as':_0x19f5('0x14c'),'foreignKey':_0x19f5('0x13f'),'onDelete':'cascade'});db[_0x19f5('0x74')][_0x19f5('0x102')](db['CmList'],{'as':_0x19f5('0x148'),'foreignKey':_0x19f5('0x156'),'onDelete':_0x19f5('0xf7')});db[_0x19f5('0x74')][_0x19f5('0x102')](db[_0x19f5('0x1d')],{'as':'Queue','foreignKey':_0x19f5('0x128'),'onDelete':_0x19f5('0xf7')});db[_0x19f5('0x74')]['belongsTo'](db[_0x19f5('0xe0')],{'as':'Campaign','foreignKey':_0x19f5('0x17a'),'onDelete':_0x19f5('0xf7')});db[_0x19f5('0x7d')][_0x19f5('0xf9')](db[_0x19f5('0x82')],{'as':{'plural':_0x19f5('0x17b'),'singular':'OneAll'},'foreignKey':_0x19f5('0x17c'),'onDelete':_0x19f5('0xf7'),'hooks':!![]});db[_0x19f5('0x7d')]['hasMany'](db[_0x19f5('0x82')],{'as':{'plural':_0x19f5('0x17d'),'singular':_0x19f5('0x17e')},'foreignKey':_0x19f5('0x17f'),'onDelete':_0x19f5('0xf7'),'hooks':!![]});db['Automation'][_0x19f5('0xf9')](db['Action'],{'as':'Actions','foreignKey':_0x19f5('0x180'),'onDelete':_0x19f5('0xf7'),'hooks':!![]});db[_0x19f5('0x130')][_0x19f5('0xf9')](db[_0x19f5('0x130')],{'as':_0x19f5('0x181'),'foreignKey':_0x19f5('0x131'),'onDelete':_0x19f5('0xf7'),'hooks':!![],'required':![]});db['Interval'][_0x19f5('0xf9')](db[_0x19f5('0xfc')],{'as':_0x19f5('0xfd'),'foreignKey':_0x19f5('0x131'),'onDelete':'restrict'});db[_0x19f5('0x130')][_0x19f5('0xf9')](db['MailApplication'],{'as':_0x19f5('0x182'),'foreignKey':'IntervalId'});db[_0x19f5('0x130')][_0x19f5('0xf9')](db[_0x19f5('0x64')],{'as':'ChatApplications','foreignKey':_0x19f5('0x131')});db[_0x19f5('0x130')][_0x19f5('0xf9')](db[_0x19f5('0x48')],{'as':_0x19f5('0x183'),'foreignKey':_0x19f5('0x131')});db['Interval'][_0x19f5('0xf9')](db[_0x19f5('0x160')],{'as':_0x19f5('0x184'),'foreignKey':_0x19f5('0x131')});db[_0x19f5('0x8a')][_0x19f5('0x102')](db[_0x19f5('0x38')],{});db[_0x19f5('0x8a')][_0x19f5('0x102')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db['Schedule'][_0x19f5('0x102')](db['AnalyticCustomReport'],{'foreignKey':_0x19f5('0x185')});db[_0x19f5('0x8b')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x19f5('0x186'),'through':'moh_has_sounds','onDelete':_0x19f5('0x154')});db[_0x19f5('0x14d')][_0x19f5('0x106')](db[_0x19f5('0x107')],{'through':_0x19f5('0x178')});db[_0x19f5('0x14d')][_0x19f5('0x106')](db[_0x19f5('0x66')],{'through':_0x19f5('0x171')});db[_0x19f5('0x14d')][_0x19f5('0x106')](db[_0x19f5('0x3e')],{'through':_0x19f5('0x187')});db['Tag'][_0x19f5('0x106')](db['SmsInteraction'],{'through':_0x19f5('0x163')});db['Tag'][_0x19f5('0x106')](db['FaxInteraction'],{'through':_0x19f5('0x15a')});db['Tag'][_0x19f5('0x106')](db[_0x19f5('0x5b')],{'through':_0x19f5('0x168')});db[_0x19f5('0x8e')][_0x19f5('0xf9')](db['Condition'],{'as':{'plural':_0x19f5('0x188'),'singular':'AllCondition'},'foreignKey':_0x19f5('0x189'),'onDelete':_0x19f5('0xf7'),'hooks':!![]});db[_0x19f5('0x8e')][_0x19f5('0xf9')](db[_0x19f5('0x82')],{'as':{'plural':_0x19f5('0x18a'),'singular':_0x19f5('0x18b')},'foreignKey':'TriggerAnyId','onDelete':_0x19f5('0xf7'),'hooks':!![]});db['Trigger'][_0x19f5('0xf9')](db['Action'],{'as':_0x19f5('0x18c'),'foreignKey':_0x19f5('0x18d'),'onDelete':_0x19f5('0xf7'),'hooks':!![]});db[_0x19f5('0x94')]['hasMany'](db[_0x19f5('0x18e')],{'as':'Fields','onDelete':_0x19f5('0xf7'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x19f5('0x18f')]['hasMany'](db[_0x19f5('0x18e')],{'as':_0x19f5('0x190'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x191')});db['AnalyticMetric'][_0x19f5('0xf9')](db['AnalyticFieldReport'],{'as':_0x19f5('0x190'),'onDelete':_0x19f5('0xf7'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x19f5('0x102')](db[_0x19f5('0x97')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0x19f5('0xf9')](db[_0x19f5('0x9c')],{'as':'Configurations','onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x192')});db[_0x19f5('0x9c')][_0x19f5('0xf9')](db[_0x19f5('0x9e')],{'as':_0x19f5('0x193'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x194')});db[_0x19f5('0x9c')]['hasMany'](db[_0x19f5('0x9e')],{'as':'Descriptions','onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x195')});db['SalesforceConfiguration']['hasMany'](db[_0x19f5('0x9e')],{'as':_0x19f5('0x190'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x19f5('0x9c')][_0x19f5('0x102')](db[_0x19f5('0x9a')],{'as':_0x19f5('0x152'),'foreignKey':'AccountId'});db[_0x19f5('0x9e')][_0x19f5('0xf9')](db[_0x19f5('0x9e')],{'as':_0x19f5('0x196'),'foreignKey':_0x19f5('0x194')});db[_0x19f5('0x9e')][_0x19f5('0xf9')](db[_0x19f5('0x9e')],{'as':_0x19f5('0x197'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0x19f5('0xf9')](db[_0x19f5('0x9e')],{'as':_0x19f5('0x198'),'foreignKey':_0x19f5('0x199')});db[_0x19f5('0x9e')][_0x19f5('0x102')](db['Variable'],{'as':_0x19f5('0x8f'),'foreignKey':_0x19f5('0x19a')});db[_0x19f5('0x19b')]['hasMany'](db[_0x19f5('0xa0')],{'as':_0x19f5('0x19c'),'onDelete':'cascade','foreignKey':_0x19f5('0x192')});db['SugarcrmConfiguration']['hasMany'](db[_0x19f5('0xa2')],{'as':_0x19f5('0x193'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x194')});db['SugarcrmConfiguration'][_0x19f5('0xf9')](db[_0x19f5('0xa2')],{'as':_0x19f5('0x19d'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x195')});db[_0x19f5('0xa0')]['hasMany'](db[_0x19f5('0xa2')],{'as':_0x19f5('0x190'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x199')});db[_0x19f5('0xa0')][_0x19f5('0x102')](db[_0x19f5('0x19b')],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x192')});db[_0x19f5('0xa2')][_0x19f5('0xf9')](db[_0x19f5('0xa2')],{'as':_0x19f5('0x196'),'foreignKey':_0x19f5('0x194')});db['SugarcrmField']['hasMany'](db[_0x19f5('0xa2')],{'as':_0x19f5('0x197'),'foreignKey':_0x19f5('0x195')});db[_0x19f5('0xa2')][_0x19f5('0xf9')](db[_0x19f5('0xa2')],{'as':_0x19f5('0x198'),'foreignKey':'FieldId'});db[_0x19f5('0xa2')][_0x19f5('0x102')](db['Variable'],{'as':_0x19f5('0x8f'),'foreignKey':'VariableId'});db[_0x19f5('0xa4')][_0x19f5('0xf9')](db[_0x19f5('0xa6')],{'as':'Configurations','onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x192')});db[_0x19f5('0xa6')]['hasMany'](db[_0x19f5('0x19e')],{'as':'Subjects','onDelete':_0x19f5('0xf7'),'foreignKey':'SubjectId'});db[_0x19f5('0xa6')][_0x19f5('0xf9')](db[_0x19f5('0x19e')],{'as':_0x19f5('0x19d'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x195')});db['DeskConfiguration'][_0x19f5('0xf9')](db[_0x19f5('0x19e')],{'as':'Fields','onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x199')});db[_0x19f5('0xa6')]['belongsTo'](db[_0x19f5('0xa4')],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x192')});db['DeskConfiguration'][_0x19f5('0x106')](db[_0x19f5('0x14d')],{'through':_0x19f5('0x19f')});db[_0x19f5('0x19e')]['hasMany'](db['DeskField'],{'as':_0x19f5('0x196'),'foreignKey':_0x19f5('0x194')});db['DeskField'][_0x19f5('0xf9')](db[_0x19f5('0x19e')],{'as':_0x19f5('0x197'),'foreignKey':_0x19f5('0x195')});db[_0x19f5('0x19e')][_0x19f5('0xf9')](db[_0x19f5('0x19e')],{'as':_0x19f5('0x198'),'foreignKey':_0x19f5('0x199')});db[_0x19f5('0x19e')]['belongsTo'](db['Variable'],{'as':_0x19f5('0x8f'),'foreignKey':_0x19f5('0x19a')});db[_0x19f5('0x1a0')][_0x19f5('0xf9')](db[_0x19f5('0xaa')],{'as':_0x19f5('0x19c'),'onDelete':'cascade','foreignKey':_0x19f5('0x192')});db[_0x19f5('0xaa')][_0x19f5('0xf9')](db[_0x19f5('0x1a1')],{'as':_0x19f5('0x193'),'onDelete':'cascade','foreignKey':_0x19f5('0x194')});db['ZohoConfiguration'][_0x19f5('0xf9')](db[_0x19f5('0x1a1')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x19f5('0x195')});db[_0x19f5('0xaa')][_0x19f5('0xf9')](db[_0x19f5('0x1a1')],{'as':_0x19f5('0x190'),'onDelete':'cascade','foreignKey':_0x19f5('0x199')});db[_0x19f5('0xaa')][_0x19f5('0x102')](db[_0x19f5('0x1a0')],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x192')});db[_0x19f5('0x1a1')][_0x19f5('0xf9')](db[_0x19f5('0x1a1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x19f5('0x1a1')][_0x19f5('0xf9')](db['ZohoField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x19f5('0x1a1')][_0x19f5('0xf9')](db[_0x19f5('0x1a1')],{'as':_0x19f5('0x198'),'foreignKey':_0x19f5('0x199')});db[_0x19f5('0x1a1')][_0x19f5('0x102')](db[_0x19f5('0x8f')],{'as':_0x19f5('0x8f'),'foreignKey':_0x19f5('0x19a')});db[_0x19f5('0xad')][_0x19f5('0xf9')](db[_0x19f5('0xaf')],{'as':_0x19f5('0x19c'),'onDelete':_0x19f5('0xf7'),'foreignKey':'AccountId'});db[_0x19f5('0xaf')][_0x19f5('0xf9')](db[_0x19f5('0xb1')],{'as':_0x19f5('0x193'),'foreignKey':_0x19f5('0x194')});db['ZendeskConfiguration'][_0x19f5('0xf9')](db[_0x19f5('0xb1')],{'as':'Descriptions','foreignKey':_0x19f5('0x195')});db[_0x19f5('0xaf')]['hasMany'](db[_0x19f5('0xb1')],{'as':'Fields','foreignKey':_0x19f5('0x199')});db[_0x19f5('0xaf')][_0x19f5('0x102')](db[_0x19f5('0xad')],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x192')});db[_0x19f5('0xaf')]['belongsToMany'](db['Tag'],{'through':_0x19f5('0x1a2')});db[_0x19f5('0xb1')]['hasMany'](db[_0x19f5('0xb1')],{'as':_0x19f5('0x196'),'foreignKey':'SubjectId'});db[_0x19f5('0xb1')][_0x19f5('0xf9')](db[_0x19f5('0xb1')],{'as':_0x19f5('0x197'),'foreignKey':_0x19f5('0x195')});db['ZendeskField']['hasMany'](db[_0x19f5('0xb1')],{'as':_0x19f5('0x198'),'foreignKey':_0x19f5('0x199')});db[_0x19f5('0xb1')]['belongsTo'](db[_0x19f5('0x8f')],{'as':_0x19f5('0x8f'),'foreignKey':_0x19f5('0x19a')});db[_0x19f5('0x1a3')][_0x19f5('0xf9')](db[_0x19f5('0xb3')],{'as':'Configurations','onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x192')});db[_0x19f5('0xb3')][_0x19f5('0xf9')](db['FreshdeskField'],{'as':'Subjects','onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x194')});db[_0x19f5('0xb3')][_0x19f5('0xf9')](db[_0x19f5('0xb5')],{'as':_0x19f5('0x19d'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x195')});db['FreshdeskConfiguration']['hasMany'](db[_0x19f5('0xb5')],{'as':_0x19f5('0x190'),'onDelete':'cascade','foreignKey':_0x19f5('0x199')});db[_0x19f5('0xb3')][_0x19f5('0x102')](db[_0x19f5('0x1a3')],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x192')});db[_0x19f5('0xb3')][_0x19f5('0x106')](db[_0x19f5('0x14d')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x19f5('0xb5')]['hasMany'](db[_0x19f5('0xb5')],{'as':_0x19f5('0x196'),'foreignKey':_0x19f5('0x194')});db[_0x19f5('0xb5')][_0x19f5('0xf9')](db['FreshdeskField'],{'as':_0x19f5('0x197'),'foreignKey':_0x19f5('0x195')});db[_0x19f5('0xb5')]['hasMany'](db[_0x19f5('0xb5')],{'as':_0x19f5('0x198'),'foreignKey':_0x19f5('0x199')});db[_0x19f5('0xb5')][_0x19f5('0x102')](db[_0x19f5('0x8f')],{'as':_0x19f5('0x8f'),'foreignKey':_0x19f5('0x19a')});db[_0x19f5('0xb7')][_0x19f5('0xf9')](db[_0x19f5('0xb9')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x19f5('0x192')});db['VtigerConfiguration'][_0x19f5('0xf9')](db['VtigerField'],{'as':_0x19f5('0x193'),'foreignKey':_0x19f5('0x194')});db[_0x19f5('0xb9')][_0x19f5('0xf9')](db[_0x19f5('0xbb')],{'as':_0x19f5('0x19d'),'foreignKey':_0x19f5('0x195')});db['VtigerConfiguration']['hasMany'](db[_0x19f5('0xbb')],{'as':'Fields','foreignKey':_0x19f5('0x199')});db[_0x19f5('0xb9')][_0x19f5('0x102')](db[_0x19f5('0xb7')],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x192')});db['VtigerField'][_0x19f5('0xf9')](db[_0x19f5('0xbb')],{'as':_0x19f5('0x196'),'foreignKey':_0x19f5('0x194')});db[_0x19f5('0xbb')][_0x19f5('0xf9')](db['VtigerField'],{'as':_0x19f5('0x197'),'foreignKey':_0x19f5('0x195')});db['VtigerField']['hasMany'](db[_0x19f5('0xbb')],{'as':_0x19f5('0x198'),'foreignKey':'FieldId'});db[_0x19f5('0xbb')]['belongsTo'](db['Variable'],{'as':_0x19f5('0x8f'),'foreignKey':_0x19f5('0x19a')});db[_0x19f5('0xbd')][_0x19f5('0xf9')](db[_0x19f5('0x1a4')],{'as':'Configurations','onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x192')});db[_0x19f5('0x1a4')][_0x19f5('0xf9')](db[_0x19f5('0xbe')],{'as':_0x19f5('0x193'),'foreignKey':'SubjectId'});db[_0x19f5('0x1a4')][_0x19f5('0xf9')](db[_0x19f5('0xbe')],{'as':_0x19f5('0x19d'),'foreignKey':'DescriptionId'});db[_0x19f5('0x1a4')][_0x19f5('0xf9')](db[_0x19f5('0xbe')],{'as':'Fields','foreignKey':_0x19f5('0x199')});db[_0x19f5('0x1a4')][_0x19f5('0x102')](db[_0x19f5('0xbd')],{'as':'Account','foreignKey':'AccountId'});db[_0x19f5('0xbe')][_0x19f5('0xf9')](db[_0x19f5('0xbe')],{'as':_0x19f5('0x196'),'foreignKey':_0x19f5('0x194')});db[_0x19f5('0xbe')][_0x19f5('0xf9')](db['ServicenowField'],{'as':_0x19f5('0x197'),'foreignKey':'DescriptionId'});db[_0x19f5('0xbe')][_0x19f5('0xf9')](db['ServicenowField'],{'as':_0x19f5('0x198'),'foreignKey':'FieldId'});db[_0x19f5('0xbe')][_0x19f5('0x102')](db[_0x19f5('0x8f')],{'as':_0x19f5('0x8f'),'foreignKey':_0x19f5('0x19a')});db[_0x19f5('0xc0')]['hasMany'](db['Dynamics365Configuration'],{'as':_0x19f5('0x19c'),'onDelete':'cascade','foreignKey':_0x19f5('0x192')});db[_0x19f5('0x1a5')][_0x19f5('0xf9')](db[_0x19f5('0xc3')],{'as':'Subjects','onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x194')});db['Dynamics365Configuration'][_0x19f5('0xf9')](db[_0x19f5('0xc3')],{'as':_0x19f5('0x19d'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x195')});db[_0x19f5('0x1a5')][_0x19f5('0xf9')](db[_0x19f5('0xc3')],{'as':_0x19f5('0x190'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x199')});db[_0x19f5('0x1a5')][_0x19f5('0x102')](db['Dynamics365Account'],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x192')});db[_0x19f5('0xc3')][_0x19f5('0xf9')](db[_0x19f5('0xc3')],{'as':'Subject','foreignKey':_0x19f5('0x194')});db[_0x19f5('0xc3')][_0x19f5('0xf9')](db[_0x19f5('0xc3')],{'as':_0x19f5('0x197'),'foreignKey':_0x19f5('0x195')});db[_0x19f5('0xc3')]['hasMany'](db[_0x19f5('0xc3')],{'as':'Field','foreignKey':'FieldId'});db['Dynamics365Field'][_0x19f5('0x102')](db[_0x19f5('0x8f')],{'as':_0x19f5('0x8f'),'foreignKey':'VariableId'});db[_0x19f5('0x1a6')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x19f5('0x19c'),'onDelete':'cascade','foreignKey':_0x19f5('0x192')});db[_0x19f5('0x1a7')][_0x19f5('0xf9')](db[_0x19f5('0xc6')],{'as':'Subjects','foreignKey':_0x19f5('0x194')});db['FreshsalesConfiguration'][_0x19f5('0xf9')](db['FreshsalesField'],{'as':_0x19f5('0x19d'),'foreignKey':_0x19f5('0x195')});db[_0x19f5('0x1a7')][_0x19f5('0xf9')](db[_0x19f5('0xc6')],{'as':_0x19f5('0x190'),'foreignKey':_0x19f5('0x199')});db[_0x19f5('0x1a7')][_0x19f5('0x102')](db['FreshsalesAccount'],{'as':_0x19f5('0x152'),'foreignKey':_0x19f5('0x192')});db[_0x19f5('0xc6')]['hasMany'](db['FreshsalesField'],{'as':_0x19f5('0x196'),'foreignKey':'SubjectId'});db['FreshsalesField'][_0x19f5('0xf9')](db['FreshsalesField'],{'as':_0x19f5('0x197'),'foreignKey':'DescriptionId'});db['FreshsalesField'][_0x19f5('0xf9')](db[_0x19f5('0xc6')],{'as':_0x19f5('0x198'),'foreignKey':_0x19f5('0x199')});db['FreshsalesField']['belongsTo'](db[_0x19f5('0x8f')],{'as':_0x19f5('0x8f'),'foreignKey':_0x19f5('0x19a')});db['ChatQueueReport']['belongsTo'](db[_0x19f5('0x60')],{});db['ChatQueueReport'][_0x19f5('0x102')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x148'),'foreignKey':_0x19f5('0x156')});db[_0x19f5('0x1a8')][_0x19f5('0x102')](db[_0x19f5('0x107')],{'as':'Contact','foreignKey':_0x19f5('0x13f')});db[_0x19f5('0x1a8')][_0x19f5('0x102')](db[_0x19f5('0x66')],{});db[_0x19f5('0x1a8')][_0x19f5('0x102')](db[_0x19f5('0x68')],{});db[_0x19f5('0x1a8')][_0x19f5('0x102')](db[_0x19f5('0x13')],{});db['ChatQueueReport']['belongsTo'](db['ChatQueue'],{});db[_0x19f5('0xcb')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'onDelete':_0x19f5('0xf7'),'foreignKey':'FromId'});db[_0x19f5('0xcb')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'onDelete':_0x19f5('0xf7'),'foreignKey':'ToId'});db[_0x19f5('0xcf')][_0x19f5('0xf9')](db[_0x19f5('0xce')],{'foreignKey':_0x19f5('0x1a9'),'onDelete':_0x19f5('0xf7')});db[_0x19f5('0xcf')][_0x19f5('0xf9')](db[_0x19f5('0x1aa')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x19f5('0x1ab')][_0x19f5('0x102')](db[_0x19f5('0x51')],{});db[_0x19f5('0x1ab')]['belongsTo'](db['CmList'],{'as':_0x19f5('0x148'),'foreignKey':_0x19f5('0x156')});db[_0x19f5('0x1ab')]['belongsTo'](db[_0x19f5('0x107')],{'as':_0x19f5('0x14c'),'foreignKey':_0x19f5('0x13f')});db[_0x19f5('0x1ab')][_0x19f5('0x102')](db[_0x19f5('0x54')],{});db[_0x19f5('0x1ab')]['belongsTo'](db[_0x19f5('0x15f')],{});db[_0x19f5('0x1ab')]['belongsTo'](db[_0x19f5('0x13')],{});db[_0x19f5('0x1ab')][_0x19f5('0x102')](db[_0x19f5('0x56')],{});db[_0x19f5('0x1ac')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x19f5('0x1ad')});db['JscriptyProject'][_0x19f5('0xf9')](db[_0x19f5('0xce')],{'foreignKey':_0x19f5('0x1ad')});db[_0x19f5('0x1ac')]['hasMany'](db[_0x19f5('0x1aa')],{'foreignKey':_0x19f5('0x1ad')});db[_0x19f5('0xd8')][_0x19f5('0x106')](db['User'],{'as':_0x19f5('0x150'),'through':_0x19f5('0x122')});db[_0x19f5('0xdd')]['belongsToMany'](db[_0x19f5('0x13')],{'as':_0x19f5('0x134'),'through':_0x19f5('0x10d')});db[_0x19f5('0xdd')]['belongsToMany'](db['VoiceQueue'],{'through':'team_has_voice_queues','as':_0x19f5('0x114')});db['Team'][_0x19f5('0x106')](db[_0x19f5('0x3a')],{'through':_0x19f5('0x14a'),'as':'MailQueues'});db['Team'][_0x19f5('0x106')](db[_0x19f5('0x6c')],{'through':_0x19f5('0x172'),'as':'ChatQueues'});db['Team'][_0x19f5('0x106')](db[_0x19f5('0x4e')],{'through':'team_has_fax_queues','as':_0x19f5('0x117')});db[_0x19f5('0xdd')][_0x19f5('0x106')](db[_0x19f5('0x56')],{'through':_0x19f5('0x165'),'as':_0x19f5('0x118')});db[_0x19f5('0xdd')][_0x19f5('0x106')](db[_0x19f5('0x5f')],{'through':_0x19f5('0x1ae'),'as':_0x19f5('0x1af')});db['Campaign'][_0x19f5('0xf9')](db['CmHopper'],{'as':_0x19f5('0x129'),'foreignKey':_0x19f5('0x17a')});db['Campaign'][_0x19f5('0xf9')](db[_0x19f5('0x75')],{'as':'HopperFinals','foreignKey':_0x19f5('0x17a')});db[_0x19f5('0xe0')][_0x19f5('0xf9')](db['CmHopperHistory'],{'as':_0x19f5('0x12a'),'foreignKey':_0x19f5('0x17a')});db['Campaign'][_0x19f5('0xf9')](db[_0x19f5('0x74')],{'as':'HopperBlacks','foreignKey':_0x19f5('0x17a')});db['Campaign']['belongsTo'](db[_0x19f5('0x12d')],{'as':_0x19f5('0x12d'),'foreignKey':_0x19f5('0x12e')});db[_0x19f5('0xe0')][_0x19f5('0x102')](db['Trunk'],{'as':_0x19f5('0x12f'),'foreignKey':_0x19f5('0x1b0')});db['Campaign'][_0x19f5('0x102')](db['Interval'],{'as':_0x19f5('0x130'),'foreignKey':_0x19f5('0x131')});db[_0x19f5('0xe0')][_0x19f5('0x102')](db['SquareProject'],{'as':_0x19f5('0xd8'),'foreignKey':_0x19f5('0x1b1')});db['Campaign'][_0x19f5('0x106')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x10b'),'through':_0x19f5('0x1b2')});db[_0x19f5('0xe0')][_0x19f5('0x106')](db[_0x19f5('0x10a')],{'as':_0x19f5('0x137'),'through':_0x19f5('0x1b3')});db[_0x19f5('0xe7')][_0x19f5('0x102')](db[_0x19f5('0x146')],{});db[_0x19f5('0xe7')][_0x19f5('0x102')](db['MailInteraction'],{});db['MailTransferReport'][_0x19f5('0x102')](db[_0x19f5('0x38')],{'foreignKey':'FromMailAccountId','as':_0x19f5('0x1b4')});db[_0x19f5('0xe7')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'foreignKey':_0x19f5('0x1b5'),'as':_0x19f5('0x1b6')});db[_0x19f5('0xe7')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x19f5('0x1b7')});db[_0x19f5('0xe7')]['belongsTo'](db[_0x19f5('0x3a')],{'foreignKey':'ToMailQueueId','as':_0x19f5('0x1b8')});db[_0x19f5('0xe7')][_0x19f5('0x102')](db[_0x19f5('0x38')],{'foreignKey':_0x19f5('0x1b9'),'as':_0x19f5('0x1ba')});db[_0x19f5('0xe9')][_0x19f5('0x102')](db[_0x19f5('0x68')],{});db[_0x19f5('0xe9')][_0x19f5('0x102')](db[_0x19f5('0x66')],{});db['ChatTransferReport'][_0x19f5('0x102')](db[_0x19f5('0x60')],{'foreignKey':_0x19f5('0x1bb'),'as':_0x19f5('0x1b4')});db[_0x19f5('0xe9')]['belongsTo'](db[_0x19f5('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x19f5('0xe9')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'foreignKey':_0x19f5('0x1bc'),'as':_0x19f5('0x1b7')});db['ChatTransferReport'][_0x19f5('0x102')](db[_0x19f5('0x6c')],{'foreignKey':_0x19f5('0x1bd'),'as':'ToQueue'});db['ChatTransferReport'][_0x19f5('0x102')](db[_0x19f5('0x60')],{'foreignKey':'ToChatWebsiteId','as':_0x19f5('0x1ba')});db['FaxTransferReport'][_0x19f5('0x102')](db[_0x19f5('0x4c')],{});db[_0x19f5('0xea')][_0x19f5('0x102')](db[_0x19f5('0x4a')],{});db[_0x19f5('0xea')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x19f5('0x1be'),'as':'FromAccount'});db[_0x19f5('0xea')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'foreignKey':_0x19f5('0x1b5'),'as':'FromAgent'});db[_0x19f5('0xea')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'foreignKey':_0x19f5('0x1bc'),'as':_0x19f5('0x1b7')});db['FaxTransferReport'][_0x19f5('0x102')](db[_0x19f5('0x4e')],{'foreignKey':_0x19f5('0x1bf'),'as':_0x19f5('0x1b8')});db[_0x19f5('0xea')][_0x19f5('0x102')](db[_0x19f5('0x46')],{'foreignKey':_0x19f5('0x1c0'),'as':_0x19f5('0x1ba')});db['OpenchannelTransferReport'][_0x19f5('0x102')](db[_0x19f5('0x5d')],{});db[_0x19f5('0xeb')][_0x19f5('0x102')](db[_0x19f5('0x5b')],{});db[_0x19f5('0xeb')][_0x19f5('0x102')](db[_0x19f5('0x57')],{'foreignKey':_0x19f5('0x1c1'),'as':'FromAccount'});db[_0x19f5('0xeb')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'foreignKey':'FromUserId','as':_0x19f5('0x1b6')});db[_0x19f5('0xeb')][_0x19f5('0x102')](db['User'],{'foreignKey':_0x19f5('0x1bc'),'as':_0x19f5('0x1b7')});db[_0x19f5('0xeb')][_0x19f5('0x102')](db['OpenchannelQueue'],{'foreignKey':_0x19f5('0x1c2'),'as':_0x19f5('0x1b8')});db[_0x19f5('0xeb')][_0x19f5('0x102')](db[_0x19f5('0x57')],{'foreignKey':_0x19f5('0x1c3'),'as':_0x19f5('0x1ba')});db[_0x19f5('0xed')][_0x19f5('0x102')](db[_0x19f5('0x15f')],{});db[_0x19f5('0xed')][_0x19f5('0x102')](db[_0x19f5('0x54')],{});db[_0x19f5('0xed')][_0x19f5('0x102')](db[_0x19f5('0x51')],{'foreignKey':_0x19f5('0x1c4'),'as':_0x19f5('0x1b4')});db[_0x19f5('0xed')][_0x19f5('0x102')](db[_0x19f5('0x13')],{'foreignKey':_0x19f5('0x1b5'),'as':_0x19f5('0x1b6')});db[_0x19f5('0xed')]['belongsTo'](db[_0x19f5('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db['SmsTransferReport'][_0x19f5('0x102')](db[_0x19f5('0x56')],{'foreignKey':_0x19f5('0x1c5'),'as':_0x19f5('0x1b8')});db[_0x19f5('0xed')][_0x19f5('0x102')](db[_0x19f5('0x51')],{'foreignKey':'ToSmsAccountId','as':_0x19f5('0x1ba')});db['CmList'][_0x19f5('0xf9')](db['Disposition'],{'as':'Dispositions','foreignKey':'ListId'});db['CmList']['hasMany'](db['CmCustomField'],{'as':_0x19f5('0x1c6'),'foreignKey':'ListId'});db[_0x19f5('0x10a')][_0x19f5('0xf9')](db['CmContact'],{'as':_0x19f5('0x108'),'onDelete':_0x19f5('0xf7'),'foreignKey':_0x19f5('0x156')});db[_0x19f5('0x10a')][_0x19f5('0xf9')](db[_0x19f5('0x75')],{'as':_0x19f5('0x176'),'foreignKey':_0x19f5('0x156')});db[_0x19f5('0x10a')][_0x19f5('0xf9')](db[_0x19f5('0x76')],{'as':_0x19f5('0x1c7'),'foreignKey':'ListId'});db[_0x19f5('0x10a')][_0x19f5('0xf9')](db['ReportAgentPreview'],{'as':_0x19f5('0x78'),'foreignKey':_0x19f5('0x156')});db[_0x19f5('0x10a')][_0x19f5('0x106')](db['VoiceQueue'],{'as':_0x19f5('0x1c8'),'through':_0x19f5('0x1c9')});db[_0x19f5('0x10a')][_0x19f5('0x106')](db['User'],{'as':_0x19f5('0x134'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0x19f5('0xf9')](db['VoiceExtension'],{'as':_0x19f5('0xfd'),'onDelete':_0x19f5('0x154')});db[_0x19f5('0x1ca')][_0x19f5('0x106')](db[_0x19f5('0x13')],{'as':'Agents','through':_0x19f5('0x1cb')});db[_0x19f5('0xf1')]['hasMany'](db['User'],{'as':'Users','foreignKey':_0x19f5('0x103')});db['UserProfile'][_0x19f5('0xf9')](db[_0x19f5('0xf3')],{'as':_0x19f5('0x1cc'),'foreignKey':_0x19f5('0x103'),'onDelete':'cascade'});db[_0x19f5('0xf3')][_0x19f5('0xf9')](db[_0x19f5('0xf5')],{'as':_0x19f5('0x1cd'),'foreignKey':_0x19f5('0x1ce'),'onDelete':_0x19f5('0xf7')});module[_0x19f5('0x1cf')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xdf7c=['../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','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','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','../api/license/license.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','User','hasOne','cascade','hasMany','Recordings','UserId','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','OpenchannelInteraction','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','belongsToMany','ChatGroup','chat_group_has_users','cm_user_has_contacts','cm_user_has_lists','user_has_teams','MailInteraction','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','ChatQueues','SmsQueues','OpenchannelQueues','VoicePrefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','SpiedAgents','VoiceContext','Applications','Sounds','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','VoiceMailMessage','Messages','mailboxuser','mailbox','uniqueid','Contact','ContactId','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','ListId','Template','TemplateId','team_has_mail_queues','Owner','Tags','Users','Attachments','Interaction','MailInteractionId','Account','restrict','MailQueueReport','Items','FaxAccountId','Exntensions','FaxQueue','TagId','fax_interaction_has_tags','ThroughTags','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Website','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','CmCompany','Contacts','CompanyId','CmHopper','Company','cm_contact_has_tags','Agent','Queue','Campaign','CampaignId','OwnerId','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','ChatApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','mail_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','MetricId','Configurations','AccountId','SubjectId','DescriptionId','Subject','Description','Field','FieldId','VariableId','Subjects','Descriptions','DeskConfiguration','int_desk_configuration_has_tags','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','FromId','ToId','SessionId','SmsQueueReport','ProjectId','team_has_voice_queues','team_has_openchannel_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToChatQueueId','FromFaxAccountId','ToAgent','ToFaxQueueId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsAccountId','HopperHistory','user_has_voice_prefixes','UserProfile','UserProfileSections','userProfileId','Resources','sectionId','exports','../config/environment','sequelize','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','sequelizeHistory','utf8','utf8_general_ci','database','username','password','options','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration'];(function(_0x2ece5a,_0x3b0ad5){var _0x3e7978=function(_0x23199f){while(--_0x23199f){_0x2ece5a['push'](_0x2ece5a['shift']());}};_0x3e7978(++_0x3b0ad5);}(_0xdf7c,0x127));var _0xcdf7=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0xdf7c[_0x497b1e];return _0x3f72e1;};'use strict';var path=require('path');var config=require(_0xcdf7('0x0'));var Sequelize=require(_0xcdf7('0x1'));var _=require('lodash');var jstz=require(_0xcdf7('0x2'));var timezone=jstz['determine']();config[_0xcdf7('0x1')]=_[_0xcdf7('0x3')](config[_0xcdf7('0x1')],{'database':_0xcdf7('0x4'),'username':_0xcdf7('0x5'),'password':_0xcdf7('0x6'),'options':{'host':_0xcdf7('0x7'),'port':0xcea,'dialect':_0xcdf7('0x8'),'dialectOptions':{'charset':_0xcdf7('0x9')},'logging':![],'timezone':timezone[_0xcdf7('0xa')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config[_0xcdf7('0xb')]=_[_0xcdf7('0x3')](config[_0xcdf7('0xb')],{'database':_0xcdf7('0x4'),'username':_0xcdf7('0x5'),'password':_0xcdf7('0x6'),'options':{'host':_0xcdf7('0x7'),'port':0xcea,'dialect':_0xcdf7('0x8'),'dialectOptions':{'charset':_0xcdf7('0x9')},'logging':![],'timezone':timezone[_0xcdf7('0xa')](),'define':{'charset':_0xcdf7('0xc'),'collate':_0xcdf7('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcdf7('0x1')][_0xcdf7('0xe')],config[_0xcdf7('0x1')][_0xcdf7('0xf')],config[_0xcdf7('0x1')][_0xcdf7('0x10')],config['sequelize'][_0xcdf7('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcdf7('0xb')][_0xcdf7('0xe')],config[_0xcdf7('0xb')][_0xcdf7('0xf')],config[_0xcdf7('0xb')][_0xcdf7('0x10')],config[_0xcdf7('0xb')]['options'])};db['User']=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/user/user.model');db[_0xcdf7('0x13')]=db['sequelize']['import'](_0xcdf7('0x14'));db['VoiceContext']=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x15'));db[_0xcdf7('0x16')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x17'));db[_0xcdf7('0x18')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/voiceQueue/voiceQueue.model');db[_0xcdf7('0x19')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/voiceRecording/voiceRecording.model');db[_0xcdf7('0x1a')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x1b'));db[_0xcdf7('0x1c')]=db[_0xcdf7('0x1')]['import']('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xcdf7('0x1d')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x1e'));db['VoiceDialReport']=db['sequelize'][_0xcdf7('0x12')]('../api/voiceDialReport/voiceDialReport.model');db[_0xcdf7('0x1f')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x20'));db[_0xcdf7('0x21')]=db['sequelize'][_0xcdf7('0x12')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xcdf7('0x22')]=db['sequelize'][_0xcdf7('0x12')]('../api/memberReport/memberReport.model');db[_0xcdf7('0x23')]=db['sequelize'][_0xcdf7('0x12')]('../api/trunk/trunk.model');db[_0xcdf7('0x24')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0x25'));db['UserVoiceQueueRt']=db['sequelize']['import'](_0xcdf7('0x26'));db[_0xcdf7('0x27')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x28'));db[_0xcdf7('0x29')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x2a'));db[_0xcdf7('0x2b')]=db[_0xcdf7('0x1')]['import']('../api/userMailQueue/userMailQueue.model');db[_0xcdf7('0x2c')]=db['sequelize']['import'](_0xcdf7('0x2d'));db[_0xcdf7('0x2e')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x2f'));db[_0xcdf7('0x30')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x31'));db[_0xcdf7('0x32')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0x33'));db[_0xcdf7('0x34')]=db[_0xcdf7('0x1')]['import']('../api/mailServerOut/mailServerOut.model');db[_0xcdf7('0x35')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/mailAccount/mailAccount.model');db[_0xcdf7('0x36')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x37'));db[_0xcdf7('0x38')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x39'));db['MailInteraction']=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x3a'));db[_0xcdf7('0x3b')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x3c'));db['MailQueueReport']=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0x3d'));db[_0xcdf7('0x3e')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0x3f'));db['DashboardItem']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x40'));db[_0xcdf7('0x41')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x42'));db[_0xcdf7('0x43')]=db['sequelize']['import'](_0xcdf7('0x44'));db[_0xcdf7('0x45')]=db[_0xcdf7('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db[_0xcdf7('0x46')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x47'));db['FaxQueue']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x48'));db[_0xcdf7('0x49')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x4a'));db[_0xcdf7('0x4b')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/smsAccount/smsAccount.model');db[_0xcdf7('0x4c')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x4d'));db[_0xcdf7('0x4e')]=db['sequelize']['import'](_0xcdf7('0x4f'));db[_0xcdf7('0x50')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x51'));db[_0xcdf7('0x52')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x53'));db[_0xcdf7('0x54')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x55'));db[_0xcdf7('0x56')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x57'));db['OpenchannelInteraction']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x58'));db['OpenchannelMessage']=db[_0xcdf7('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db[_0xcdf7('0x59')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x5a'));db[_0xcdf7('0x5b')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x5c'));db['OpenchannelQueueReport']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x5d'));db[_0xcdf7('0x5e')]=db[_0xcdf7('0x1')]['import']('../api/chatApplication/chatApplication.model');db[_0xcdf7('0x5f')]=db['sequelize']['import'](_0xcdf7('0x60'));db[_0xcdf7('0x61')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/chatMessage/chatMessage.model');db[_0xcdf7('0x62')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x63'));db[_0xcdf7('0x64')]=db['sequelize'][_0xcdf7('0x12')]('../api/chatQueue/chatQueue.model');db['ChatGroup']=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0x65'));db[_0xcdf7('0x66')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0x67'));db['CmCompany']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x68'));db[_0xcdf7('0x69')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0x6a'));db['CmHopper']=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/cmHopper/cmHopper.model');db[_0xcdf7('0x6b')]=db['sequelize'][_0xcdf7('0x12')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xcdf7('0x6c')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x6d'));db[_0xcdf7('0x6e')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x6f'));db[_0xcdf7('0x70')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x71'));db[_0xcdf7('0x72')]=db[_0xcdf7('0x1')]['import']('../api/cmCustomField/cmCustomField.model');db[_0xcdf7('0x73')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x74'));db[_0xcdf7('0x75')]=db['sequelize']['import'](_0xcdf7('0x76'));db[_0xcdf7('0x77')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0x78'));db[_0xcdf7('0x79')]=db['sequelize'][_0xcdf7('0x12')]('../api/disposition/disposition.model');db[_0xcdf7('0x7a')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x7b'));db[_0xcdf7('0x7c')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0x7d'));db[_0xcdf7('0x7e')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x7f'));db[_0xcdf7('0x80')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/cdr/cdr.model');db[_0xcdf7('0x81')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x82'));db[_0xcdf7('0x83')]=db['sequelize']['import'](_0xcdf7('0x84'));db[_0xcdf7('0x85')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x86'));db[_0xcdf7('0x87')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x88'));db['Template']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x89'));db[_0xcdf7('0x8a')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x8b'));db[_0xcdf7('0x8c')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x8d'));db[_0xcdf7('0x8e')]=db['sequelize'][_0xcdf7('0x12')]('../api/integration/integration.model');db['IntegrationReport']=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x8f'));db[_0xcdf7('0x90')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0x91'));db['AnalyticDefaultReport']=db['sequelize'][_0xcdf7('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xcdf7('0x92')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x93'));db[_0xcdf7('0x94')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x95'));db[_0xcdf7('0x96')]=db['sequelize']['import'](_0xcdf7('0x97'));db[_0xcdf7('0x98')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0x99'));db[_0xcdf7('0x9a')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0x9b'));db[_0xcdf7('0x9c')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0x9d'));db[_0xcdf7('0x9e')]=db[_0xcdf7('0x1')]['import']('../api/intSalesforceField/intSalesforceField.model');db[_0xcdf7('0x9f')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0xa0'));db[_0xcdf7('0xa1')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0xa2'));db[_0xcdf7('0xa3')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xa4'));db[_0xcdf7('0xa5')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0xa6'));db['DeskConfiguration']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xa7'));db[_0xcdf7('0xa8')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xa9'));db[_0xcdf7('0xaa')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0xab'));db[_0xcdf7('0xac')]=db['sequelize']['import'](_0xcdf7('0xad'));db[_0xcdf7('0xae')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/intZohoField/intZohoField.model');db[_0xcdf7('0xaf')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xb0'));db['ZendeskConfiguration']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xb1'));db[_0xcdf7('0xb2')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xb3'));db[_0xcdf7('0xb4')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xb5'));db[_0xcdf7('0xb6')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0xb7'));db[_0xcdf7('0xb8')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xb9'));db[_0xcdf7('0xba')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db[_0xcdf7('0x1')]['import'](_0xcdf7('0xbb'));db[_0xcdf7('0xbc')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xbd'));db[_0xcdf7('0xbe')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0xbf'));db[_0xcdf7('0xc0')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xcdf7('0xc1')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xc2'));db[_0xcdf7('0xc3')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xc4'));db[_0xcdf7('0xc5')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0xc6'));db[_0xcdf7('0xc7')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xc8'));db[_0xcdf7('0xc9')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0xca'));db[_0xcdf7('0xcb')]=db['sequelize'][_0xcdf7('0x12')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xcdf7('0xcc')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0xcd'));db[_0xcdf7('0x8e')]=db[_0xcdf7('0x1')]['import']('../api/integration/integration.model');db[_0xcdf7('0xce')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xcf'));db[_0xcdf7('0xd0')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xd1'));db[_0xcdf7('0xd2')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0xd3'));db[_0xcdf7('0xd4')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xd5'));db[_0xcdf7('0xd6')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xd7'));db[_0xcdf7('0xd8')]=db['sequelize'][_0xcdf7('0x12')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xd9'));db[_0xcdf7('0xda')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0xdb'));db['SquareDetailsReport']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xdc'));db[_0xcdf7('0xdd')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xde'));db[_0xcdf7('0xdf')]=db[_0xcdf7('0x1')]['import']('../api/setting/setting.model');db['SquareOdbc']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xe0'));db[_0xcdf7('0xe1')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0xe2'));db[_0xcdf7('0xe3')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xe4'));db['SquareMessage']=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/squareMessage/squareMessage.model');db[_0xcdf7('0xe5')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0xe6'));db['License']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xe7'));db['Campaign']=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/campaign/campaign.model');db[_0xcdf7('0xe8')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0xe9'));db[_0xcdf7('0xea')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xeb'));db[_0xcdf7('0xec')]=db[_0xcdf7('0x1')]['import'](_0xcdf7('0xed'));db['MailTransferReport']=db[_0xcdf7('0x1')]['import'](_0xcdf7('0xee'));db[_0xcdf7('0xef')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xf0'));db[_0xcdf7('0xf1')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0xf2'));db[_0xcdf7('0xf3')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0xf4'));db['SmsTransferReport']=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/smsTransferReport/smsTransferReport.model');db[_0xcdf7('0xf5')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xf6'));db[_0xcdf7('0xf7')]=db['sequelize'][_0xcdf7('0x12')](_0xcdf7('0xf8'));db['UserProfile']=db[_0xcdf7('0x1')][_0xcdf7('0x12')](_0xcdf7('0xf9'));db[_0xcdf7('0xfa')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0xcdf7('0xfb')]=db[_0xcdf7('0x1')][_0xcdf7('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0xcdf7('0xfc')][_0xcdf7('0xfd')](db[_0xcdf7('0x1c')],{'as':_0xcdf7('0x1c'),'onDelete':_0xcdf7('0xfe'),'foreignKey':'UserId'});db[_0xcdf7('0xfc')][_0xcdf7('0xff')](db[_0xcdf7('0x19')],{'as':_0xcdf7('0x100'),'foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0xfc')][_0xcdf7('0xff')](db['UserVoiceQueueRt'],{'as':_0xcdf7('0x102'),'foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0xfc')][_0xcdf7('0xff')](db[_0xcdf7('0x103')],{'as':_0xcdf7('0x104'),'onDelete':_0xcdf7('0xfe'),'hooks':!![]});db['User'][_0xcdf7('0xff')](db[_0xcdf7('0x6c')],{'as':_0xcdf7('0x105'),'foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0xfc')]['hasMany'](db[_0xcdf7('0x6e')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0xcdf7('0xfc')]['hasMany'](db[_0xcdf7('0x70')],{'as':_0xcdf7('0x70'),'foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0xfc')]['hasMany'](db[_0xcdf7('0x106')],{'as':_0xcdf7('0x107'),'foreignKey':_0xcdf7('0x101')});db['User'][_0xcdf7('0xff')](db[_0xcdf7('0x5f')],{'as':'ChatInteractions','foreignKey':'UserId'});db['User'][_0xcdf7('0xff')](db[_0xcdf7('0x4e')],{'as':_0xcdf7('0x108'),'foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0xfc')][_0xcdf7('0xff')](db[_0xcdf7('0x45')],{'as':_0xcdf7('0x109'),'foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0xfc')][_0xcdf7('0xff')](db['MailInteraction'],{'as':_0xcdf7('0x10a'),'foreignKey':_0xcdf7('0x101')});db['User']['belongsTo'](db['UserProfile'],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db[_0xcdf7('0x10c')],{'as':'Groups','through':_0xcdf7('0x10d')});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db[_0xcdf7('0x69')],{'as':'Contacts','through':_0xcdf7('0x10e')});db[_0xcdf7('0xfc')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0xcdf7('0x10f')});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db['Team'],{'through':_0xcdf7('0x110')});db[_0xcdf7('0xfc')]['belongsToMany'](db[_0xcdf7('0x111')],{'as':_0xcdf7('0x10a'),'through':_0xcdf7('0x112')});db[_0xcdf7('0xfc')]['belongsToMany'](db[_0xcdf7('0x5f')],{'as':_0xcdf7('0x113'),'through':_0xcdf7('0x114')});db['User'][_0xcdf7('0x10b')](db[_0xcdf7('0x45')],{'as':_0xcdf7('0x109'),'through':_0xcdf7('0x115')});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db[_0xcdf7('0x4e')],{'as':_0xcdf7('0x108'),'through':'user_has_sms_interactions'});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db[_0xcdf7('0x106')],{'as':_0xcdf7('0x107'),'through':_0xcdf7('0x116')});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db[_0xcdf7('0x18')],{'as':_0xcdf7('0x117'),'through':_0xcdf7('0x27'),'required':![]});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db[_0xcdf7('0x36')],{'as':_0xcdf7('0x118'),'through':_0xcdf7('0x2b'),'required':![]});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db['ChatQueue'],{'as':_0xcdf7('0x119'),'through':_0xcdf7('0x29'),'required':![],'hooks':!![]});db[_0xcdf7('0xfc')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':_0xcdf7('0x2c'),'required':![]});db['User']['belongsToMany'](db['SmsQueue'],{'as':_0xcdf7('0x11a'),'through':_0xcdf7('0x2e'),'required':![]});db[_0xcdf7('0xfc')]['belongsToMany'](db[_0xcdf7('0x59')],{'as':_0xcdf7('0x11b'),'through':_0xcdf7('0x30'),'required':![]});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db['CmList'],{'through':_0xcdf7('0x10f')});db['User']['belongsToMany'](db[_0xcdf7('0xf7')],{'as':_0xcdf7('0x11c'),'through':'user_has_voice_prefixes','required':![]});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db[_0xcdf7('0x5b')],{'as':_0xcdf7('0x11d'),'through':_0xcdf7('0x11e')});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db[_0xcdf7('0x41')],{'as':_0xcdf7('0x11f'),'through':_0xcdf7('0x120')});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db[_0xcdf7('0x35')],{'as':_0xcdf7('0x121'),'through':'user_has_mail_accounts'});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db[_0xcdf7('0x54')],{'as':'OpenchannelAccounts','through':_0xcdf7('0x122')});db[_0xcdf7('0xfc')][_0xcdf7('0x10b')](db[_0xcdf7('0x4b')],{'as':_0xcdf7('0x123'),'through':_0xcdf7('0x124')});db['User'][_0xcdf7('0x10b')](db['SquareProject'],{'as':_0xcdf7('0x125'),'through':'user_has_square_projects'});db[_0xcdf7('0x13')][_0xcdf7('0xff')](db[_0xcdf7('0x103')],{'as':_0xcdf7('0x126'),'onDelete':_0xcdf7('0xfe'),'foreignKey':'ChanSpyId'});db[_0xcdf7('0x127')][_0xcdf7('0xff')](db[_0xcdf7('0x103')],{'onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0x103')][_0xcdf7('0xff')](db['VoiceExtension'],{'as':_0xcdf7('0x128'),'onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0x16')]['belongsToMany'](db[_0xcdf7('0x85')],{'as':_0xcdf7('0x129'),'through':_0xcdf7('0x12a')});db['VoiceQueue'][_0xcdf7('0xff')](db[_0xcdf7('0x12b')],{'as':_0xcdf7('0x12c'),'foreignKey':_0xcdf7('0x12d')});db[_0xcdf7('0x18')][_0xcdf7('0xff')](db['CmHopper'],{'as':_0xcdf7('0x12e'),'foreignKey':'VoiceQueueId'});db[_0xcdf7('0x18')]['hasMany'](db[_0xcdf7('0x6c')],{'as':_0xcdf7('0x105'),'foreignKey':'VoiceQueueId'});db[_0xcdf7('0x18')][_0xcdf7('0xff')](db[_0xcdf7('0x6e')],{'as':_0xcdf7('0x12f'),'foreignKey':_0xcdf7('0x12d')});db[_0xcdf7('0x18')]['hasMany'](db['ReportAgentPreview'],{'as':_0xcdf7('0x70'),'foreignKey':_0xcdf7('0x12d')});db['VoiceQueue']['hasMany'](db[_0xcdf7('0x6b')],{'as':_0xcdf7('0x130'),'foreignKey':_0xcdf7('0x12d')});db['VoiceQueue'][_0xcdf7('0xff')](db[_0xcdf7('0xd8')],{'as':_0xcdf7('0x131'),'foreignKey':_0xcdf7('0x12d')});db['VoiceQueue'][_0xcdf7('0x132')](db['Trunk'],{'as':_0xcdf7('0x23'),'foreignKey':_0xcdf7('0x133')});db[_0xcdf7('0x18')][_0xcdf7('0x132')](db[_0xcdf7('0x23')],{'as':_0xcdf7('0x134'),'foreignKey':_0xcdf7('0x135')});db['VoiceQueue'][_0xcdf7('0x132')](db['Interval'],{'as':_0xcdf7('0x7c'),'foreignKey':_0xcdf7('0x136')});db[_0xcdf7('0x18')][_0xcdf7('0x132')](db[_0xcdf7('0x7e')],{'as':_0xcdf7('0x137'),'foreignKey':_0xcdf7('0x138')});db['VoiceQueue'][_0xcdf7('0x10b')](db[_0xcdf7('0xf5')],{'as':_0xcdf7('0x139'),'through':_0xcdf7('0x13a')});db[_0xcdf7('0x18')][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x13b'),'through':'UserVoiceQueue'});db[_0xcdf7('0x18')]['belongsToMany'](db[_0xcdf7('0xe5')],{'as':_0xcdf7('0x13c'),'through':'team_has_voice_queues'});db['VoiceQueue'][_0xcdf7('0x10b')](db[_0xcdf7('0xf5')],{'as':_0xcdf7('0x13d'),'through':'voice_queues_has_cm_blacklists'});db[_0xcdf7('0x19')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0xfc'),'foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0x1a')][_0xcdf7('0x132')](db['User'],{'as':'User','foreignKey':_0xcdf7('0x101')});db['VoiceMail'][_0xcdf7('0xff')](db[_0xcdf7('0x13e')],{'as':_0xcdf7('0x13f'),'onDelete':'cascade','foreignKey':_0xcdf7('0x140'),'sourceKey':_0xcdf7('0x141')});db[_0xcdf7('0x13e')]['belongsTo'](db[_0xcdf7('0x1c')],{'foreignKey':_0xcdf7('0x140'),'targetKey':_0xcdf7('0x141')});db[_0xcdf7('0x1d')][_0xcdf7('0xff')](db[_0xcdf7('0x21')],{'as':'QueueCalls','foreignKey':_0xcdf7('0x142'),'constraints':![]});db[_0xcdf7('0x1d')][_0xcdf7('0xff')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0xcdf7('0x1d')][_0xcdf7('0x132')](db['User'],{'as':'User','foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0x1d')]['belongsTo'](db[_0xcdf7('0x69')],{'as':_0xcdf7('0x143'),'foreignKey':_0xcdf7('0x144')});db['MailServerIn']['belongsTo'](db[_0xcdf7('0x35')],{'as':_0xcdf7('0x35'),'foreignKey':_0xcdf7('0x145')});db[_0xcdf7('0x34')][_0xcdf7('0x132')](db['MailAccount'],{'as':_0xcdf7('0x35'),'foreignKey':_0xcdf7('0x145')});db[_0xcdf7('0x35')][_0xcdf7('0xfd')](db[_0xcdf7('0x32')],{'as':_0xcdf7('0x146'),'onDelete':'cascade'});db[_0xcdf7('0x35')]['hasOne'](db[_0xcdf7('0x34')],{'as':_0xcdf7('0x147'),'onDelete':'cascade'});db[_0xcdf7('0x35')][_0xcdf7('0xff')](db[_0xcdf7('0x79')],{'as':_0xcdf7('0x148'),'foreignKey':_0xcdf7('0x145')});db[_0xcdf7('0x35')][_0xcdf7('0xff')](db[_0xcdf7('0x77')],{'as':_0xcdf7('0x149'),'foreignKey':_0xcdf7('0x145')});db[_0xcdf7('0x35')][_0xcdf7('0xff')](db[_0xcdf7('0x3b')],{'as':'Messages','foreignKey':_0xcdf7('0x145')});db[_0xcdf7('0x35')][_0xcdf7('0xff')](db[_0xcdf7('0x111')],{'as':_0xcdf7('0x14a')});db[_0xcdf7('0x35')][_0xcdf7('0xff')](db[_0xcdf7('0x14b')],{'as':_0xcdf7('0x128')});db[_0xcdf7('0x35')]['belongsTo'](db['CmList'],{'as':_0xcdf7('0x14c'),'foreignKey':_0xcdf7('0x14d')});db[_0xcdf7('0x35')][_0xcdf7('0x132')](db[_0xcdf7('0x14e')],{'as':'Template','foreignKey':_0xcdf7('0x14f')});db[_0xcdf7('0x35')][_0xcdf7('0x132')](db[_0xcdf7('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xcdf7('0x35')][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x13b'),'through':'user_has_mail_accounts'});db[_0xcdf7('0x36')][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x13b'),'through':'UserMailQueue'});db[_0xcdf7('0x36')][_0xcdf7('0x10b')](db[_0xcdf7('0xe5')],{'through':_0xcdf7('0x150'),'as':_0xcdf7('0x13c')});db[_0xcdf7('0x111')][_0xcdf7('0xff')](db[_0xcdf7('0x3b')],{'as':_0xcdf7('0x13f'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db['MailInteraction'][_0xcdf7('0x132')](db[_0xcdf7('0x35')],{'as':'Account','foreignKey':_0xcdf7('0x145')});db[_0xcdf7('0x111')]['belongsTo'](db[_0xcdf7('0x69')],{'as':_0xcdf7('0x143'),'foreignKey':_0xcdf7('0x144')});db['MailInteraction']['belongsTo'](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x151'),'foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0x111')][_0xcdf7('0x10b')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xcdf7('0x152')});db['MailInteraction'][_0xcdf7('0x10b')](db[_0xcdf7('0x87')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0xcdf7('0x111')]['belongsToMany'](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x153'),'through':_0xcdf7('0x112'),'foreignKey':'MailInteractionId'});db[_0xcdf7('0x3b')][_0xcdf7('0xff')](db[_0xcdf7('0xea')],{'as':_0xcdf7('0x154'),'onDelete':_0xcdf7('0xfe')});db['MailMessage']['belongsTo'](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0xfc')});db['MailMessage'][_0xcdf7('0x132')](db[_0xcdf7('0x69')],{'onDelete':_0xcdf7('0xfe'),'as':_0xcdf7('0x143')});db['MailMessage']['belongsTo'](db[_0xcdf7('0x111')],{'as':_0xcdf7('0x155'),'foreignKey':_0xcdf7('0x156')});db[_0xcdf7('0x3b')][_0xcdf7('0x132')](db[_0xcdf7('0x35')],{'as':_0xcdf7('0x157'),'foreignKey':'MailAccountId'});db[_0xcdf7('0x14b')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'onDelete':_0xcdf7('0x158')});db['MailApplication'][_0xcdf7('0x132')](db['MailQueue'],{'onDelete':'restrict'});db[_0xcdf7('0x14b')][_0xcdf7('0x132')](db[_0xcdf7('0x35')],{'onDelete':_0xcdf7('0x158')});db['MailApplication'][_0xcdf7('0x132')](db[_0xcdf7('0x7c')],{'onDelete':_0xcdf7('0x158'),'foreignKey':_0xcdf7('0x136')});db[_0xcdf7('0x14b')][_0xcdf7('0x132')](db[_0xcdf7('0x87')],{'onDelete':_0xcdf7('0x158'),'foreignKey':'TagId'});db[_0xcdf7('0x159')]['belongsTo'](db[_0xcdf7('0x35')],{});db['MailQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xcdf7('0x159')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xcdf7('0x144')});db[_0xcdf7('0x159')][_0xcdf7('0x132')](db[_0xcdf7('0x111')],{});db[_0xcdf7('0x159')][_0xcdf7('0x132')](db[_0xcdf7('0x3b')],{});db[_0xcdf7('0x159')]['belongsTo'](db[_0xcdf7('0xfc')],{});db[_0xcdf7('0x159')][_0xcdf7('0x132')](db[_0xcdf7('0x36')],{});db['Dashboard'][_0xcdf7('0xff')](db['DashboardItem'],{'as':_0xcdf7('0x15a'),'onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0x41')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0xcdf7('0x15b')});db['FaxAccount'][_0xcdf7('0xff')](db[_0xcdf7('0x77')],{'as':_0xcdf7('0x149'),'foreignKey':_0xcdf7('0x15b')});db[_0xcdf7('0x41')][_0xcdf7('0xff')](db[_0xcdf7('0x45')],{'as':_0xcdf7('0x14a')});db['FaxAccount'][_0xcdf7('0xff')](db[_0xcdf7('0x43')],{'as':_0xcdf7('0x128')});db['FaxAccount'][_0xcdf7('0xff')](db[_0xcdf7('0x103')],{'as':_0xcdf7('0x15c'),'onDelete':'cascade'});db['FaxAccount'][_0xcdf7('0xff')](db[_0xcdf7('0x46')],{'as':'Messages'});db[_0xcdf7('0x41')][_0xcdf7('0x132')](db[_0xcdf7('0x23')],{'as':_0xcdf7('0x23')});db[_0xcdf7('0x41')][_0xcdf7('0x132')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['FaxAccount'][_0xcdf7('0x132')](db['Pause'],{'as':_0xcdf7('0x137'),'foreignKey':_0xcdf7('0x138')});db[_0xcdf7('0x41')][_0xcdf7('0x10b')](db['User'],{'as':_0xcdf7('0x13b'),'through':_0xcdf7('0x120')});db[_0xcdf7('0x43')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'onDelete':_0xcdf7('0x158')});db['FaxApplication'][_0xcdf7('0x132')](db[_0xcdf7('0x15d')],{'onDelete':_0xcdf7('0x158')});db[_0xcdf7('0x43')]['belongsTo'](db['FaxAccount'],{'onDelete':_0xcdf7('0x158')});db[_0xcdf7('0x43')][_0xcdf7('0x132')](db['Tag'],{'onDelete':_0xcdf7('0x158'),'foreignKey':_0xcdf7('0x15e')});db[_0xcdf7('0x45')][_0xcdf7('0xff')](db['FaxMessage'],{'as':_0xcdf7('0x13f'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0xcdf7('0x45')][_0xcdf7('0x132')](db[_0xcdf7('0x41')],{'as':_0xcdf7('0x157'),'foreignKey':_0xcdf7('0x15b')});db[_0xcdf7('0x45')][_0xcdf7('0x132')](db[_0xcdf7('0x69')],{'as':_0xcdf7('0x143'),'foreignKey':_0xcdf7('0x144')});db[_0xcdf7('0x45')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x151'),'foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0x45')][_0xcdf7('0x10b')](db['Tag'],{'through':_0xcdf7('0x15f'),'as':'Tags'});db[_0xcdf7('0x45')][_0xcdf7('0x10b')](db['Tag'],{'through':_0xcdf7('0x15f'),'as':_0xcdf7('0x160')});db['FaxInteraction'][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x153'),'through':'user_has_fax_interactions','foreignKey':_0xcdf7('0x161')});db[_0xcdf7('0x46')][_0xcdf7('0x132')](db['User'],{'onDelete':_0xcdf7('0xfe'),'as':'User'});db[_0xcdf7('0x46')][_0xcdf7('0x132')](db[_0xcdf7('0x45')],{'as':_0xcdf7('0x155'),'foreignKey':_0xcdf7('0x161')});db['FaxMessage'][_0xcdf7('0x132')](db[_0xcdf7('0x69')],{'onDelete':_0xcdf7('0xfe'),'as':_0xcdf7('0x143')});db[_0xcdf7('0x46')]['belongsTo'](db[_0xcdf7('0xea')],{'as':_0xcdf7('0xea'),'foreignKey':_0xcdf7('0x162')});db[_0xcdf7('0x46')][_0xcdf7('0x132')](db[_0xcdf7('0x41')],{'as':'Account','foreignKey':_0xcdf7('0x15b')});db[_0xcdf7('0x15d')][_0xcdf7('0x10b')](db['User'],{'as':'Agents','through':_0xcdf7('0x2c')});db[_0xcdf7('0x15d')][_0xcdf7('0x10b')](db[_0xcdf7('0xe5')],{'through':_0xcdf7('0x163'),'as':_0xcdf7('0x13c')});db[_0xcdf7('0x49')][_0xcdf7('0x132')](db['FaxAccount'],{});db[_0xcdf7('0x49')]['belongsTo'](db['CmList'],{'as':_0xcdf7('0x14c'),'foreignKey':'ListId'});db[_0xcdf7('0x49')]['belongsTo'](db['CmContact'],{'as':_0xcdf7('0x143'),'foreignKey':'ContactId'});db[_0xcdf7('0x49')][_0xcdf7('0x132')](db[_0xcdf7('0x45')],{});db[_0xcdf7('0x49')]['belongsTo'](db[_0xcdf7('0x46')],{});db['FaxQueueReport']['belongsTo'](db[_0xcdf7('0xfc')],{});db['FaxQueueReport'][_0xcdf7('0x132')](db[_0xcdf7('0x15d')],{});db[_0xcdf7('0x4b')][_0xcdf7('0xff')](db[_0xcdf7('0x79')],{'as':'Dispositions','foreignKey':_0xcdf7('0x164')});db[_0xcdf7('0x4b')][_0xcdf7('0xff')](db[_0xcdf7('0x77')],{'as':'Answers','foreignKey':_0xcdf7('0x164')});db[_0xcdf7('0x4b')][_0xcdf7('0xff')](db[_0xcdf7('0x50')],{'as':_0xcdf7('0x13f'),'foreignKey':_0xcdf7('0x164')});db[_0xcdf7('0x4b')][_0xcdf7('0xff')](db[_0xcdf7('0x4e')],{'as':_0xcdf7('0x14a')});db[_0xcdf7('0x4b')]['hasMany'](db[_0xcdf7('0x4c')],{'as':_0xcdf7('0x128')});db[_0xcdf7('0x4b')]['belongsTo'](db[_0xcdf7('0xf5')],{'as':_0xcdf7('0x14c'),'foreignKey':'ListId'});db[_0xcdf7('0x4b')][_0xcdf7('0x132')](db[_0xcdf7('0x7e')],{'as':_0xcdf7('0x137'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xcdf7('0x4b')][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':'Agents','through':_0xcdf7('0x124')});db[_0xcdf7('0x4c')]['belongsTo'](db[_0xcdf7('0xfc')],{'onDelete':_0xcdf7('0x158')});db['SmsApplication']['belongsTo'](db[_0xcdf7('0x52')],{'onDelete':'restrict'});db[_0xcdf7('0x4c')][_0xcdf7('0x132')](db['SmsAccount'],{'onDelete':_0xcdf7('0x158')});db['SmsApplication'][_0xcdf7('0x132')](db[_0xcdf7('0x7c')],{'onDelete':_0xcdf7('0x158'),'foreignKey':_0xcdf7('0x136')});db[_0xcdf7('0x4c')]['belongsTo'](db[_0xcdf7('0x87')],{'onDelete':_0xcdf7('0x158'),'foreignKey':_0xcdf7('0x15e')});db['SmsInteraction']['hasMany'](db['SmsMessage'],{'as':_0xcdf7('0x13f'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x165')});db[_0xcdf7('0x4e')]['belongsTo'](db[_0xcdf7('0x4b')],{'as':_0xcdf7('0x157'),'foreignKey':_0xcdf7('0x164')});db[_0xcdf7('0x4e')][_0xcdf7('0x132')](db[_0xcdf7('0x69')],{'as':'Contact','foreignKey':_0xcdf7('0x144')});db[_0xcdf7('0x4e')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'as':'Owner','foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0x4e')][_0xcdf7('0x10b')](db[_0xcdf7('0x87')],{'through':_0xcdf7('0x166'),'as':_0xcdf7('0x152')});db['SmsInteraction'][_0xcdf7('0x10b')](db['Tag'],{'through':_0xcdf7('0x166'),'as':_0xcdf7('0x160')});db[_0xcdf7('0x4e')][_0xcdf7('0x10b')](db['User'],{'as':_0xcdf7('0x153'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0xcdf7('0x50')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0xfc')});db[_0xcdf7('0x50')][_0xcdf7('0x132')](db[_0xcdf7('0x69')],{'onDelete':_0xcdf7('0xfe'),'as':_0xcdf7('0x143')});db[_0xcdf7('0x50')]['belongsTo'](db[_0xcdf7('0x4e')],{'onDelete':_0xcdf7('0xfe'),'as':_0xcdf7('0x155'),'foreignKey':_0xcdf7('0x165')});db[_0xcdf7('0x50')][_0xcdf7('0x132')](db['SmsAccount'],{'as':'Account','foreignKey':_0xcdf7('0x164')});db['SmsQueue'][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':'Agents','through':_0xcdf7('0x2e'),'foreignKey':_0xcdf7('0x167')});db[_0xcdf7('0x52')]['belongsToMany'](db[_0xcdf7('0xe5')],{'through':'team_has_sms_queues','as':_0xcdf7('0x13c')});db[_0xcdf7('0x54')]['hasMany'](db[_0xcdf7('0x79')],{'as':_0xcdf7('0x148'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xcdf7('0xff')](db['CannedAnswer'],{'as':_0xcdf7('0x149'),'foreignKey':'OpenchannelAccountId'});db[_0xcdf7('0x54')][_0xcdf7('0xff')](db[_0xcdf7('0x106')],{'as':_0xcdf7('0x14a'),'foreignKey':_0xcdf7('0x168')});db['OpenchannelAccount'][_0xcdf7('0xff')](db[_0xcdf7('0x169')],{'as':_0xcdf7('0x13f'),'foreignKey':'OpenchannelAccountId'});db[_0xcdf7('0x54')][_0xcdf7('0xff')](db[_0xcdf7('0x56')],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db[_0xcdf7('0x54')]['belongsTo'](db[_0xcdf7('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0xcdf7('0x54')]['belongsTo'](db[_0xcdf7('0x7e')],{'as':_0xcdf7('0x137'),'foreignKey':_0xcdf7('0x138')});db['OpenchannelAccount'][_0xcdf7('0x10b')](db['User'],{'as':'Agents','through':_0xcdf7('0x122')});db['OpenchannelApplication'][_0xcdf7('0x132')](db['User'],{'onDelete':_0xcdf7('0x158')});db[_0xcdf7('0x56')][_0xcdf7('0x132')](db[_0xcdf7('0x59')],{'onDelete':_0xcdf7('0x158'),'foreignKey':_0xcdf7('0x16a')});db[_0xcdf7('0x56')][_0xcdf7('0x132')](db[_0xcdf7('0x54')],{'onDelete':_0xcdf7('0x158'),'foreignKey':'OpenchannelAccountId'});db[_0xcdf7('0x56')]['belongsTo'](db[_0xcdf7('0x7c')],{'onDelete':_0xcdf7('0x158'),'foreignKey':_0xcdf7('0x136')});db[_0xcdf7('0x56')][_0xcdf7('0x132')](db[_0xcdf7('0x87')],{'onDelete':_0xcdf7('0x158'),'foreignKey':_0xcdf7('0x15e')});db[_0xcdf7('0x106')]['hasMany'](db[_0xcdf7('0x169')],{'as':'Messages','onDelete':_0xcdf7('0xfe'),'foreignKey':'OpenchannelInteractionId'});db[_0xcdf7('0x106')][_0xcdf7('0x132')](db['OpenchannelAccount'],{'as':_0xcdf7('0x157'),'foreignKey':_0xcdf7('0x168')});db[_0xcdf7('0x106')][_0xcdf7('0x132')](db['CmContact'],{'as':_0xcdf7('0x143'),'foreignKey':_0xcdf7('0x144')});db[_0xcdf7('0x106')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'as':'Owner','foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0x106')][_0xcdf7('0x10b')](db[_0xcdf7('0x87')],{'through':_0xcdf7('0x16b'),'as':_0xcdf7('0x152')});db['OpenchannelInteraction'][_0xcdf7('0x10b')](db[_0xcdf7('0x87')],{'through':_0xcdf7('0x16b'),'as':_0xcdf7('0x160')});db[_0xcdf7('0x106')]['belongsToMany'](db['User'],{'as':_0xcdf7('0x153'),'through':_0xcdf7('0x116'),'foreignKey':_0xcdf7('0x16c')});db[_0xcdf7('0x169')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'onDelete':_0xcdf7('0xfe'),'as':'User'});db[_0xcdf7('0x169')]['belongsTo'](db[_0xcdf7('0x69')],{'onDelete':'cascade','as':_0xcdf7('0x143')});db[_0xcdf7('0x169')][_0xcdf7('0x132')](db[_0xcdf7('0x106')],{'onDelete':_0xcdf7('0xfe'),'as':_0xcdf7('0x155'),'foreignKey':_0xcdf7('0x16c')});db['OpenchannelMessage'][_0xcdf7('0x132')](db[_0xcdf7('0xea')],{'as':_0xcdf7('0xea'),'foreignKey':'AttachmentId'});db[_0xcdf7('0x169')][_0xcdf7('0x132')](db[_0xcdf7('0x54')],{'as':_0xcdf7('0x157'),'foreignKey':'OpenchannelAccountId'});db[_0xcdf7('0x59')][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x13b'),'through':_0xcdf7('0x30'),'foreignKey':_0xcdf7('0x16a')});db[_0xcdf7('0x59')][_0xcdf7('0x10b')](db[_0xcdf7('0xe5')],{'through':'team_has_openchannel_queues','as':_0xcdf7('0x13c')});db[_0xcdf7('0x5b')]['hasMany'](db[_0xcdf7('0x79')],{'as':_0xcdf7('0x148'),'foreignKey':_0xcdf7('0x16d')});db[_0xcdf7('0x5b')][_0xcdf7('0xff')](db[_0xcdf7('0x77')],{'as':_0xcdf7('0x149'),'foreignKey':_0xcdf7('0x16d')});db[_0xcdf7('0x5b')][_0xcdf7('0xff')](db[_0xcdf7('0x66')],{'as':_0xcdf7('0x16e')});db[_0xcdf7('0x5b')][_0xcdf7('0xff')](db[_0xcdf7('0x5f')],{'as':_0xcdf7('0x14a')});db[_0xcdf7('0x5b')][_0xcdf7('0xff')](db[_0xcdf7('0x5e')],{'as':_0xcdf7('0x128')});db[_0xcdf7('0x5b')]['hasMany'](db[_0xcdf7('0x61')],{'as':_0xcdf7('0x13f')});db[_0xcdf7('0x5b')][_0xcdf7('0x132')](db[_0xcdf7('0xf5')],{'as':_0xcdf7('0x14c'),'foreignKey':'ListId'});db[_0xcdf7('0x5b')][_0xcdf7('0x132')](db['Interval'],{'as':'Interval','foreignKey':_0xcdf7('0x136')});db[_0xcdf7('0x5b')][_0xcdf7('0x132')](db['Pause'],{'as':_0xcdf7('0x137'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xcdf7('0x5b')][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x13b'),'through':_0xcdf7('0x11e')});db['OpenchannelQueueReport'][_0xcdf7('0x132')](db[_0xcdf7('0x54')],{});db[_0xcdf7('0x16f')][_0xcdf7('0x132')](db['CmList'],{'as':_0xcdf7('0x14c'),'foreignKey':'ListId'});db[_0xcdf7('0x16f')][_0xcdf7('0x132')](db['CmContact'],{'as':_0xcdf7('0x143'),'foreignKey':'ContactId'});db[_0xcdf7('0x16f')][_0xcdf7('0x132')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0xcdf7('0x132')](db[_0xcdf7('0x169')],{});db[_0xcdf7('0x16f')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{});db[_0xcdf7('0x16f')][_0xcdf7('0x132')](db[_0xcdf7('0x59')],{});db[_0xcdf7('0x5e')][_0xcdf7('0x132')](db['User'],{'as':'Agent','foreignKey':_0xcdf7('0x101'),'onDelete':_0xcdf7('0x158')});db[_0xcdf7('0x5e')][_0xcdf7('0x132')](db['ChatQueue'],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0xcdf7('0x158')});db['ChatApplication']['belongsTo'](db['ChatWebsite'],{'as':_0xcdf7('0x170'),'foreignKey':_0xcdf7('0x16d'),'onDelete':'restrict'});db['ChatApplication'][_0xcdf7('0x132')](db['Tag'],{'onDelete':_0xcdf7('0x158'),'foreignKey':_0xcdf7('0x15e')});db[_0xcdf7('0x5f')]['hasMany'](db[_0xcdf7('0x61')],{'as':'Messages','onDelete':_0xcdf7('0xfe'),'foreignKey':'ChatInteractionId'});db['ChatInteraction'][_0xcdf7('0x132')](db[_0xcdf7('0x5b')],{'as':'Account','foreignKey':_0xcdf7('0x16d')});db[_0xcdf7('0x5f')]['belongsTo'](db['CmContact'],{'as':_0xcdf7('0x143'),'foreignKey':'ContactId'});db[_0xcdf7('0x5f')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'as':'Owner','foreignKey':_0xcdf7('0x101')});db['ChatInteraction'][_0xcdf7('0x10b')](db[_0xcdf7('0x87')],{'through':_0xcdf7('0x171'),'as':_0xcdf7('0x152')});db[_0xcdf7('0x5f')]['belongsToMany'](db[_0xcdf7('0x87')],{'through':'chat_interaction_has_tags','as':_0xcdf7('0x160')});db['ChatInteraction'][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':'Users','through':_0xcdf7('0x114'),'foreignKey':_0xcdf7('0x172')});db[_0xcdf7('0x61')]['belongsTo'](db['User'],{'onDelete':_0xcdf7('0xfe'),'as':_0xcdf7('0xfc')});db[_0xcdf7('0x61')][_0xcdf7('0x132')](db[_0xcdf7('0x69')],{'onDelete':_0xcdf7('0xfe'),'as':_0xcdf7('0x143'),'foreignKey':'ContactId'});db[_0xcdf7('0x61')][_0xcdf7('0x132')](db['ChatInteraction'],{'onDelete':_0xcdf7('0xfe'),'as':_0xcdf7('0x155'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xcdf7('0x132')](db[_0xcdf7('0xea')],{'as':'Attachment','foreignKey':_0xcdf7('0x162')});db[_0xcdf7('0x61')]['belongsTo'](db[_0xcdf7('0x5b')],{'as':_0xcdf7('0x157'),'foreignKey':_0xcdf7('0x16d')});db['ChatOfflineMessage'][_0xcdf7('0x132')](db[_0xcdf7('0x69')],{'onDelete':_0xcdf7('0xfe'),'as':_0xcdf7('0x143'),'foreignKey':'ContactId'});db[_0xcdf7('0x62')][_0xcdf7('0x132')](db[_0xcdf7('0x5b')],{'as':_0xcdf7('0x157'),'foreignKey':'ChatWebsiteId'});db[_0xcdf7('0x64')][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x13b'),'through':_0xcdf7('0x29'),'hooks':!![]});db[_0xcdf7('0x64')][_0xcdf7('0x10b')](db[_0xcdf7('0xe5')],{'through':_0xcdf7('0x173'),'as':_0xcdf7('0x13c')});db[_0xcdf7('0x10c')][_0xcdf7('0xff')](db[_0xcdf7('0xd2')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0x10c')][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x12c'),'through':'chat_group_has_users'});db[_0xcdf7('0x66')][_0xcdf7('0x132')](db[_0xcdf7('0x5b')],{'as':_0xcdf7('0x170'),'foreignKey':_0xcdf7('0x16d')});db[_0xcdf7('0x174')][_0xcdf7('0xff')](db[_0xcdf7('0x69')],{'as':_0xcdf7('0x175'),'foreignKey':_0xcdf7('0x176')});db[_0xcdf7('0x69')][_0xcdf7('0xff')](db[_0xcdf7('0x177')],{'as':_0xcdf7('0x12e'),'foreignKey':_0xcdf7('0x144')});db['CmContact'][_0xcdf7('0xff')](db[_0xcdf7('0x6c')],{'as':_0xcdf7('0x105'),'foreignKey':_0xcdf7('0x144')});db[_0xcdf7('0x69')]['hasMany'](db['CmHopperHistory'],{'as':_0xcdf7('0x12f'),'foreignKey':_0xcdf7('0x144')});db[_0xcdf7('0x69')][_0xcdf7('0xff')](db[_0xcdf7('0x70')],{'as':_0xcdf7('0x70'),'foreignKey':_0xcdf7('0x144')});db[_0xcdf7('0x69')]['hasMany'](db['JscriptySessionReport'],{'as':_0xcdf7('0x131'),'foreignKey':_0xcdf7('0x144')});db[_0xcdf7('0x69')][_0xcdf7('0xff')](db[_0xcdf7('0x106')],{'as':_0xcdf7('0x107'),'foreignKey':'ContactId','onDelete':_0xcdf7('0x158')});db['CmContact'][_0xcdf7('0xff')](db[_0xcdf7('0x5f')],{'as':_0xcdf7('0x113'),'foreignKey':'ContactId','onDelete':_0xcdf7('0x158')});db[_0xcdf7('0x69')][_0xcdf7('0xff')](db[_0xcdf7('0x4e')],{'as':_0xcdf7('0x108'),'foreignKey':_0xcdf7('0x144'),'onDelete':'restrict'});db[_0xcdf7('0x69')][_0xcdf7('0xff')](db[_0xcdf7('0x45')],{'as':_0xcdf7('0x109'),'foreignKey':_0xcdf7('0x144'),'onDelete':_0xcdf7('0x158')});db[_0xcdf7('0x69')][_0xcdf7('0xff')](db[_0xcdf7('0x111')],{'as':_0xcdf7('0x10a'),'foreignKey':_0xcdf7('0x144'),'onDelete':_0xcdf7('0x158')});db[_0xcdf7('0x69')][_0xcdf7('0x132')](db['CmCompany'],{'as':_0xcdf7('0x178'),'foreignKey':'CompanyId'});db['CmContact'][_0xcdf7('0x132')](db[_0xcdf7('0xf5')],{'as':_0xcdf7('0x14c'),'foreignKey':'ListId','onDelete':'cascade'});db['CmContact']['belongsToMany'](db[_0xcdf7('0xfc')],{'as':'Users','through':_0xcdf7('0x10e')});db[_0xcdf7('0x69')][_0xcdf7('0x10b')](db[_0xcdf7('0x87')],{'as':_0xcdf7('0x152'),'through':_0xcdf7('0x179')});db['CmContact'][_0xcdf7('0x10b')](db[_0xcdf7('0x87')],{'through':_0xcdf7('0x179'),'as':_0xcdf7('0x160')});db[_0xcdf7('0x177')][_0xcdf7('0x132')](db[_0xcdf7('0x69')],{'as':_0xcdf7('0x143'),'foreignKey':_0xcdf7('0x144'),'onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0x177')][_0xcdf7('0x132')](db[_0xcdf7('0xf5')],{'as':_0xcdf7('0x14c'),'foreignKey':_0xcdf7('0x14d'),'onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0x177')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x17a'),'foreignKey':_0xcdf7('0x101')});db[_0xcdf7('0x177')][_0xcdf7('0x132')](db['VoiceQueue'],{'as':_0xcdf7('0x17b'),'foreignKey':_0xcdf7('0x12d'),'onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0x177')][_0xcdf7('0x132')](db[_0xcdf7('0x17c')],{'as':'Campaign','foreignKey':_0xcdf7('0x17d'),'onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0x177')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'as':_0xcdf7('0x151'),'foreignKey':_0xcdf7('0x17e')});db['CmHopperBlack'][_0xcdf7('0x132')](db[_0xcdf7('0x69')],{'as':'Contact','foreignKey':_0xcdf7('0x144'),'onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0x6b')][_0xcdf7('0x132')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0xcdf7('0x6b')][_0xcdf7('0x132')](db[_0xcdf7('0x18')],{'as':_0xcdf7('0x17b'),'foreignKey':'VoiceQueueId','onDelete':_0xcdf7('0xfe')});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':_0xcdf7('0x17d'),'onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0x75')][_0xcdf7('0xff')](db[_0xcdf7('0x7a')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0xcdf7('0x17f'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xcdf7('0xff')](db[_0xcdf7('0x7a')],{'as':{'plural':'Any','singular':_0xcdf7('0x180')},'foreignKey':_0xcdf7('0x181'),'onDelete':'cascade','hooks':!![]});db[_0xcdf7('0x75')]['hasMany'](db[_0xcdf7('0x73')],{'as':_0xcdf7('0x182'),'foreignKey':_0xcdf7('0x183'),'onDelete':'cascade','hooks':!![]});db[_0xcdf7('0x7c')][_0xcdf7('0xff')](db['Interval'],{'as':_0xcdf7('0x184'),'foreignKey':_0xcdf7('0x136'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xcdf7('0x7c')][_0xcdf7('0xff')](db['VoiceExtension'],{'as':_0xcdf7('0x104'),'foreignKey':_0xcdf7('0x136'),'onDelete':_0xcdf7('0x158')});db[_0xcdf7('0x7c')][_0xcdf7('0xff')](db[_0xcdf7('0x14b')],{'as':'MailApplications','foreignKey':'IntervalId'});db['Interval'][_0xcdf7('0xff')](db[_0xcdf7('0x5e')],{'as':_0xcdf7('0x185'),'foreignKey':_0xcdf7('0x136')});db[_0xcdf7('0x7c')][_0xcdf7('0xff')](db[_0xcdf7('0x43')],{'as':_0xcdf7('0x186'),'foreignKey':_0xcdf7('0x136')});db['Interval'][_0xcdf7('0xff')](db[_0xcdf7('0x4c')],{'as':_0xcdf7('0x187'),'foreignKey':'IntervalId'});db[_0xcdf7('0x83')][_0xcdf7('0x132')](db[_0xcdf7('0x35')],{});db[_0xcdf7('0x83')][_0xcdf7('0x132')](db[_0xcdf7('0x188')],{'foreignKey':_0xcdf7('0x189')});db[_0xcdf7('0x83')][_0xcdf7('0x132')](db[_0xcdf7('0x90')],{'foreignKey':_0xcdf7('0x18a')});db[_0xcdf7('0x85')][_0xcdf7('0x10b')](db[_0xcdf7('0x16')],{'as':'Mohs','through':'moh_has_sounds','onDelete':'restrict'});db['Tag'][_0xcdf7('0x10b')](db[_0xcdf7('0x69')],{'through':_0xcdf7('0x179')});db[_0xcdf7('0x87')][_0xcdf7('0x10b')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db['Tag'][_0xcdf7('0x10b')](db['MailInteraction'],{'through':_0xcdf7('0x18b')});db[_0xcdf7('0x87')][_0xcdf7('0x10b')](db[_0xcdf7('0x4e')],{'through':_0xcdf7('0x166')});db['Tag'][_0xcdf7('0x10b')](db[_0xcdf7('0x45')],{'through':_0xcdf7('0x15f')});db['Tag'][_0xcdf7('0x10b')](db[_0xcdf7('0x106')],{'through':_0xcdf7('0x16b')});db[_0xcdf7('0x8a')]['hasMany'](db['Condition'],{'as':{'plural':_0xcdf7('0x18c'),'singular':_0xcdf7('0x18d')},'foreignKey':_0xcdf7('0x18e'),'onDelete':_0xcdf7('0xfe'),'hooks':!![]});db[_0xcdf7('0x8a')][_0xcdf7('0xff')](db[_0xcdf7('0x7a')],{'as':{'plural':_0xcdf7('0x18f'),'singular':_0xcdf7('0x190')},'foreignKey':'TriggerAnyId','onDelete':_0xcdf7('0xfe'),'hooks':!![]});db[_0xcdf7('0x8a')]['hasMany'](db[_0xcdf7('0x73')],{'as':_0xcdf7('0x182'),'foreignKey':_0xcdf7('0x191'),'onDelete':_0xcdf7('0xfe'),'hooks':!![]});db[_0xcdf7('0x90')]['hasMany'](db[_0xcdf7('0x96')],{'as':_0xcdf7('0x192'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x18a'),'hooks':!![]});db[_0xcdf7('0x188')]['hasMany'](db[_0xcdf7('0x96')],{'as':'Fields','onDelete':_0xcdf7('0xfe'),'foreignKey':'DefaultReportId'});db[_0xcdf7('0x94')]['hasMany'](db[_0xcdf7('0x96')],{'as':_0xcdf7('0x192'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x193')});db[_0xcdf7('0x96')][_0xcdf7('0x132')](db[_0xcdf7('0x94')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0xcdf7('0xff')](db[_0xcdf7('0x9c')],{'as':_0xcdf7('0x194'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x195')});db['SalesforceConfiguration'][_0xcdf7('0xff')](db[_0xcdf7('0x9e')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0x9c')][_0xcdf7('0xff')](db[_0xcdf7('0x9e')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0x9c')][_0xcdf7('0xff')](db['SalesforceField'],{'as':_0xcdf7('0x192'),'onDelete':_0xcdf7('0xfe'),'foreignKey':'FieldId'});db[_0xcdf7('0x9c')]['belongsTo'](db[_0xcdf7('0x9a')],{'as':_0xcdf7('0x157'),'foreignKey':'AccountId'});db[_0xcdf7('0x9e')][_0xcdf7('0xff')](db[_0xcdf7('0x9e')],{'as':_0xcdf7('0x198'),'foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0x9e')]['hasMany'](db[_0xcdf7('0x9e')],{'as':_0xcdf7('0x199'),'foreignKey':_0xcdf7('0x197')});db['SalesforceField']['hasMany'](db[_0xcdf7('0x9e')],{'as':_0xcdf7('0x19a'),'foreignKey':_0xcdf7('0x19b')});db['SalesforceField'][_0xcdf7('0x132')](db[_0xcdf7('0x8c')],{'as':_0xcdf7('0x8c'),'foreignKey':_0xcdf7('0x19c')});db[_0xcdf7('0x9f')][_0xcdf7('0xff')](db['SugarcrmConfiguration'],{'as':_0xcdf7('0x194'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0xa1')][_0xcdf7('0xff')](db[_0xcdf7('0xa3')],{'as':_0xcdf7('0x19d'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xa1')][_0xcdf7('0xff')](db[_0xcdf7('0xa3')],{'as':_0xcdf7('0x19e'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x197')});db['SugarcrmConfiguration'][_0xcdf7('0xff')](db[_0xcdf7('0xa3')],{'as':_0xcdf7('0x192'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x19b')});db['SugarcrmConfiguration'][_0xcdf7('0x132')](db[_0xcdf7('0x9f')],{'as':'Account','foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0xa3')][_0xcdf7('0xff')](db[_0xcdf7('0xa3')],{'as':'Subject','foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xa3')][_0xcdf7('0xff')](db[_0xcdf7('0xa3')],{'as':'Description','foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0xa3')][_0xcdf7('0xff')](db[_0xcdf7('0xa3')],{'as':_0xcdf7('0x19a'),'foreignKey':_0xcdf7('0x19b')});db['SugarcrmField'][_0xcdf7('0x132')](db[_0xcdf7('0x8c')],{'as':_0xcdf7('0x8c'),'foreignKey':_0xcdf7('0x19c')});db['DeskAccount']['hasMany'](db[_0xcdf7('0x19f')],{'as':_0xcdf7('0x194'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xcdf7('0x19f')]['hasMany'](db[_0xcdf7('0xa8')],{'as':_0xcdf7('0x19d'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0x19f')]['hasMany'](db[_0xcdf7('0xa8')],{'as':_0xcdf7('0x19e'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x197')});db['DeskConfiguration']['hasMany'](db[_0xcdf7('0xa8')],{'as':_0xcdf7('0x192'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x19b')});db['DeskConfiguration'][_0xcdf7('0x132')](db['DeskAccount'],{'as':_0xcdf7('0x157'),'foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0x19f')][_0xcdf7('0x10b')](db[_0xcdf7('0x87')],{'through':_0xcdf7('0x1a0')});db[_0xcdf7('0xa8')]['hasMany'](db[_0xcdf7('0xa8')],{'as':'Subject','foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xa8')][_0xcdf7('0xff')](db[_0xcdf7('0xa8')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xcdf7('0xa8')]['hasMany'](db[_0xcdf7('0xa8')],{'as':_0xcdf7('0x19a'),'foreignKey':'FieldId'});db[_0xcdf7('0xa8')][_0xcdf7('0x132')](db[_0xcdf7('0x8c')],{'as':_0xcdf7('0x8c'),'foreignKey':_0xcdf7('0x19c')});db[_0xcdf7('0xaa')][_0xcdf7('0xff')](db[_0xcdf7('0xac')],{'as':_0xcdf7('0x194'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0xac')][_0xcdf7('0xff')](db[_0xcdf7('0xae')],{'as':_0xcdf7('0x19d'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xac')][_0xcdf7('0xff')](db['ZohoField'],{'as':_0xcdf7('0x19e'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0xac')][_0xcdf7('0xff')](db[_0xcdf7('0xae')],{'as':_0xcdf7('0x192'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x19b')});db['ZohoConfiguration'][_0xcdf7('0x132')](db[_0xcdf7('0xaa')],{'as':_0xcdf7('0x157'),'foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0xae')][_0xcdf7('0xff')](db[_0xcdf7('0xae')],{'as':_0xcdf7('0x198'),'foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xae')]['hasMany'](db[_0xcdf7('0xae')],{'as':'Description','foreignKey':_0xcdf7('0x197')});db['ZohoField'][_0xcdf7('0xff')](db['ZohoField'],{'as':_0xcdf7('0x19a'),'foreignKey':'FieldId'});db[_0xcdf7('0xae')][_0xcdf7('0x132')](db['Variable'],{'as':_0xcdf7('0x8c'),'foreignKey':_0xcdf7('0x19c')});db[_0xcdf7('0xaf')][_0xcdf7('0xff')](db[_0xcdf7('0x1a1')],{'as':_0xcdf7('0x194'),'onDelete':_0xcdf7('0xfe'),'foreignKey':'AccountId'});db[_0xcdf7('0x1a1')][_0xcdf7('0xff')](db[_0xcdf7('0xb2')],{'as':_0xcdf7('0x19d'),'foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0x1a1')][_0xcdf7('0xff')](db[_0xcdf7('0xb2')],{'as':_0xcdf7('0x19e'),'foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0x1a1')][_0xcdf7('0xff')](db[_0xcdf7('0xb2')],{'as':_0xcdf7('0x192'),'foreignKey':_0xcdf7('0x19b')});db[_0xcdf7('0x1a1')][_0xcdf7('0x132')](db[_0xcdf7('0xaf')],{'as':_0xcdf7('0x157'),'foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0x1a1')]['belongsToMany'](db[_0xcdf7('0x87')],{'through':_0xcdf7('0x1a2')});db[_0xcdf7('0xb2')][_0xcdf7('0xff')](db['ZendeskField'],{'as':_0xcdf7('0x198'),'foreignKey':'SubjectId'});db[_0xcdf7('0xb2')]['hasMany'](db['ZendeskField'],{'as':_0xcdf7('0x199'),'foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0xb2')]['hasMany'](db[_0xcdf7('0xb2')],{'as':_0xcdf7('0x19a'),'foreignKey':_0xcdf7('0x19b')});db[_0xcdf7('0xb2')]['belongsTo'](db[_0xcdf7('0x8c')],{'as':_0xcdf7('0x8c'),'foreignKey':_0xcdf7('0x19c')});db[_0xcdf7('0xb4')][_0xcdf7('0xff')](db[_0xcdf7('0xb6')],{'as':_0xcdf7('0x194'),'onDelete':'cascade','foreignKey':_0xcdf7('0x195')});db['FreshdeskConfiguration'][_0xcdf7('0xff')](db[_0xcdf7('0xb8')],{'as':_0xcdf7('0x19d'),'onDelete':'cascade','foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xb6')][_0xcdf7('0xff')](db[_0xcdf7('0xb8')],{'as':_0xcdf7('0x19e'),'onDelete':'cascade','foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0xb6')]['hasMany'](db[_0xcdf7('0xb8')],{'as':_0xcdf7('0x192'),'onDelete':_0xcdf7('0xfe'),'foreignKey':'FieldId'});db[_0xcdf7('0xb6')][_0xcdf7('0x132')](db[_0xcdf7('0xb4')],{'as':_0xcdf7('0x157'),'foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0xb6')][_0xcdf7('0x10b')](db[_0xcdf7('0x87')],{'through':_0xcdf7('0x1a3')});db[_0xcdf7('0xb8')][_0xcdf7('0xff')](db['FreshdeskField'],{'as':_0xcdf7('0x198'),'foreignKey':'SubjectId'});db[_0xcdf7('0xb8')][_0xcdf7('0xff')](db[_0xcdf7('0xb8')],{'as':_0xcdf7('0x199'),'foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0xb8')]['hasMany'](db[_0xcdf7('0xb8')],{'as':_0xcdf7('0x19a'),'foreignKey':_0xcdf7('0x19b')});db['FreshdeskField']['belongsTo'](db['Variable'],{'as':_0xcdf7('0x8c'),'foreignKey':_0xcdf7('0x19c')});db['VtigerAccount'][_0xcdf7('0xff')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0x1a4')][_0xcdf7('0xff')](db[_0xcdf7('0xbc')],{'as':_0xcdf7('0x19d'),'foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0x1a4')][_0xcdf7('0xff')](db[_0xcdf7('0xbc')],{'as':_0xcdf7('0x19e'),'foreignKey':_0xcdf7('0x197')});db['VtigerConfiguration'][_0xcdf7('0xff')](db[_0xcdf7('0xbc')],{'as':_0xcdf7('0x192'),'foreignKey':_0xcdf7('0x19b')});db[_0xcdf7('0x1a4')][_0xcdf7('0x132')](db[_0xcdf7('0xba')],{'as':_0xcdf7('0x157'),'foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0xbc')][_0xcdf7('0xff')](db[_0xcdf7('0xbc')],{'as':'Subject','foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xbc')][_0xcdf7('0xff')](db['VtigerField'],{'as':_0xcdf7('0x199'),'foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0xbc')][_0xcdf7('0xff')](db[_0xcdf7('0xbc')],{'as':'Field','foreignKey':_0xcdf7('0x19b')});db[_0xcdf7('0xbc')][_0xcdf7('0x132')](db[_0xcdf7('0x8c')],{'as':_0xcdf7('0x8c'),'foreignKey':_0xcdf7('0x19c')});db[_0xcdf7('0xbe')][_0xcdf7('0xff')](db['ServicenowConfiguration'],{'as':_0xcdf7('0x194'),'onDelete':'cascade','foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0xc0')][_0xcdf7('0xff')](db[_0xcdf7('0xc1')],{'as':_0xcdf7('0x19d'),'foreignKey':'SubjectId'});db[_0xcdf7('0xc0')][_0xcdf7('0xff')](db[_0xcdf7('0xc1')],{'as':_0xcdf7('0x19e'),'foreignKey':_0xcdf7('0x197')});db['ServicenowConfiguration']['hasMany'](db[_0xcdf7('0xc1')],{'as':'Fields','foreignKey':_0xcdf7('0x19b')});db[_0xcdf7('0xc0')]['belongsTo'](db[_0xcdf7('0xbe')],{'as':_0xcdf7('0x157'),'foreignKey':'AccountId'});db[_0xcdf7('0xc1')]['hasMany'](db[_0xcdf7('0xc1')],{'as':_0xcdf7('0x198'),'foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xc1')]['hasMany'](db[_0xcdf7('0xc1')],{'as':_0xcdf7('0x199'),'foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0xc1')][_0xcdf7('0xff')](db[_0xcdf7('0xc1')],{'as':'Field','foreignKey':'FieldId'});db[_0xcdf7('0xc1')][_0xcdf7('0x132')](db[_0xcdf7('0x8c')],{'as':_0xcdf7('0x8c'),'foreignKey':_0xcdf7('0x19c')});db[_0xcdf7('0xc3')][_0xcdf7('0xff')](db[_0xcdf7('0xc5')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0xc5')][_0xcdf7('0xff')](db[_0xcdf7('0xc7')],{'as':'Subjects','onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xc5')][_0xcdf7('0xff')](db[_0xcdf7('0xc7')],{'as':_0xcdf7('0x19e'),'onDelete':'cascade','foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0xc5')][_0xcdf7('0xff')](db[_0xcdf7('0xc7')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xcdf7('0xc5')]['belongsTo'](db[_0xcdf7('0xc3')],{'as':'Account','foreignKey':_0xcdf7('0x195')});db[_0xcdf7('0xc7')][_0xcdf7('0xff')](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xc7')][_0xcdf7('0xff')](db['Dynamics365Field'],{'as':_0xcdf7('0x199'),'foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0xc7')][_0xcdf7('0xff')](db[_0xcdf7('0xc7')],{'as':_0xcdf7('0x19a'),'foreignKey':'FieldId'});db[_0xcdf7('0xc7')][_0xcdf7('0x132')](db[_0xcdf7('0x8c')],{'as':'Variable','foreignKey':'VariableId'});db[_0xcdf7('0xc9')][_0xcdf7('0xff')](db[_0xcdf7('0xcb')],{'as':_0xcdf7('0x194'),'onDelete':_0xcdf7('0xfe'),'foreignKey':'AccountId'});db[_0xcdf7('0xcb')]['hasMany'](db[_0xcdf7('0xcc')],{'as':_0xcdf7('0x19d'),'foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xcb')][_0xcdf7('0xff')](db[_0xcdf7('0xcc')],{'as':_0xcdf7('0x19e'),'foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0xcb')][_0xcdf7('0xff')](db[_0xcdf7('0xcc')],{'as':_0xcdf7('0x192'),'foreignKey':_0xcdf7('0x19b')});db['FreshsalesConfiguration'][_0xcdf7('0x132')](db['FreshsalesAccount'],{'as':_0xcdf7('0x157'),'foreignKey':_0xcdf7('0x195')});db['FreshsalesField']['hasMany'](db[_0xcdf7('0xcc')],{'as':_0xcdf7('0x198'),'foreignKey':_0xcdf7('0x196')});db[_0xcdf7('0xcc')][_0xcdf7('0xff')](db['FreshsalesField'],{'as':'Description','foreignKey':_0xcdf7('0x197')});db[_0xcdf7('0xcc')][_0xcdf7('0xff')](db[_0xcdf7('0xcc')],{'as':_0xcdf7('0x19a'),'foreignKey':_0xcdf7('0x19b')});db[_0xcdf7('0xcc')][_0xcdf7('0x132')](db['Variable'],{'as':'Variable','foreignKey':_0xcdf7('0x19c')});db[_0xcdf7('0xd0')][_0xcdf7('0x132')](db[_0xcdf7('0x5b')],{});db[_0xcdf7('0xd0')][_0xcdf7('0x132')](db[_0xcdf7('0xf5')],{'as':_0xcdf7('0x14c'),'foreignKey':'ListId'});db['ChatQueueReport']['belongsTo'](db[_0xcdf7('0x69')],{'as':_0xcdf7('0x143'),'foreignKey':_0xcdf7('0x144')});db[_0xcdf7('0xd0')][_0xcdf7('0x132')](db[_0xcdf7('0x5f')],{});db[_0xcdf7('0xd0')][_0xcdf7('0x132')](db[_0xcdf7('0x61')],{});db[_0xcdf7('0xd0')][_0xcdf7('0x132')](db['User'],{});db['ChatQueueReport'][_0xcdf7('0x132')](db[_0xcdf7('0x64')],{});db[_0xcdf7('0xd2')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'onDelete':'cascade','foreignKey':_0xcdf7('0x1a5')});db[_0xcdf7('0xd2')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x1a6')});db[_0xcdf7('0xd8')]['hasMany'](db[_0xcdf7('0xd6')],{'foreignKey':_0xcdf7('0x1a7'),'onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0xd8')][_0xcdf7('0xff')](db[_0xcdf7('0xd4')],{'foreignKey':_0xcdf7('0x1a7'),'onDelete':_0xcdf7('0xfe')});db[_0xcdf7('0x1a8')][_0xcdf7('0x132')](db[_0xcdf7('0x4b')],{});db[_0xcdf7('0x1a8')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xcdf7('0x1a8')][_0xcdf7('0x132')](db[_0xcdf7('0x69')],{'as':_0xcdf7('0x143'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xcdf7('0x132')](db[_0xcdf7('0x4e')],{});db['SmsQueueReport']['belongsTo'](db['SmsMessage'],{});db[_0xcdf7('0x1a8')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{});db[_0xcdf7('0x1a8')][_0xcdf7('0x132')](db[_0xcdf7('0x52')],{});db[_0xcdf7('0xdd')][_0xcdf7('0xff')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0xcdf7('0xff')](db[_0xcdf7('0xd6')],{'foreignKey':_0xcdf7('0x1a9')});db[_0xcdf7('0xdd')][_0xcdf7('0xff')](db[_0xcdf7('0xd4')],{'foreignKey':_0xcdf7('0x1a9')});db[_0xcdf7('0xe1')][_0xcdf7('0x10b')](db['User'],{'as':_0xcdf7('0x153'),'through':'user_has_square_projects'});db[_0xcdf7('0xe5')][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':'Agents','through':_0xcdf7('0x110')});db['Team']['belongsToMany'](db[_0xcdf7('0x18')],{'through':_0xcdf7('0x1aa'),'as':_0xcdf7('0x117')});db[_0xcdf7('0xe5')][_0xcdf7('0x10b')](db[_0xcdf7('0x36')],{'through':'team_has_mail_queues','as':_0xcdf7('0x118')});db[_0xcdf7('0xe5')][_0xcdf7('0x10b')](db['ChatQueue'],{'through':_0xcdf7('0x173'),'as':_0xcdf7('0x119')});db['Team'][_0xcdf7('0x10b')](db[_0xcdf7('0x15d')],{'through':_0xcdf7('0x163'),'as':'FaxQueues'});db[_0xcdf7('0xe5')]['belongsToMany'](db[_0xcdf7('0x52')],{'through':'team_has_sms_queues','as':_0xcdf7('0x11a')});db[_0xcdf7('0xe5')][_0xcdf7('0x10b')](db['OpenchannelQueue'],{'through':_0xcdf7('0x1ab'),'as':'OpenchannelQueues'});db['Campaign'][_0xcdf7('0xff')](db[_0xcdf7('0x177')],{'as':_0xcdf7('0x12e'),'foreignKey':'CampaignId'});db['Campaign'][_0xcdf7('0xff')](db['CmHopperFinal'],{'as':_0xcdf7('0x105'),'foreignKey':_0xcdf7('0x17d')});db[_0xcdf7('0x17c')][_0xcdf7('0xff')](db[_0xcdf7('0x6e')],{'as':_0xcdf7('0x12f'),'foreignKey':_0xcdf7('0x17d')});db[_0xcdf7('0x17c')]['hasMany'](db[_0xcdf7('0x6b')],{'as':_0xcdf7('0x130'),'foreignKey':'CampaignId'});db[_0xcdf7('0x17c')][_0xcdf7('0x132')](db[_0xcdf7('0x23')],{'as':_0xcdf7('0x23'),'foreignKey':_0xcdf7('0x133')});db[_0xcdf7('0x17c')][_0xcdf7('0x132')](db[_0xcdf7('0x23')],{'as':'TrunkBackup','foreignKey':_0xcdf7('0x135')});db[_0xcdf7('0x17c')][_0xcdf7('0x132')](db[_0xcdf7('0x7c')],{'as':'Interval','foreignKey':_0xcdf7('0x136')});db[_0xcdf7('0x17c')][_0xcdf7('0x132')](db[_0xcdf7('0xe1')],{'as':_0xcdf7('0xe1'),'foreignKey':_0xcdf7('0x1ac')});db[_0xcdf7('0x17c')][_0xcdf7('0x10b')](db['CmList'],{'as':_0xcdf7('0x139'),'through':_0xcdf7('0x1ad')});db[_0xcdf7('0x17c')][_0xcdf7('0x10b')](db[_0xcdf7('0xf5')],{'as':_0xcdf7('0x13d'),'through':_0xcdf7('0x1ae')});db[_0xcdf7('0x1af')][_0xcdf7('0x132')](db[_0xcdf7('0x3b')],{});db[_0xcdf7('0x1af')][_0xcdf7('0x132')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0xcdf7('0x1b0'),'as':_0xcdf7('0x1b1')});db[_0xcdf7('0x1af')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'foreignKey':_0xcdf7('0x1b2'),'as':_0xcdf7('0x1b3')});db[_0xcdf7('0x1af')]['belongsTo'](db[_0xcdf7('0xfc')],{'foreignKey':_0xcdf7('0x1b4'),'as':'ToAgent'});db[_0xcdf7('0x1af')][_0xcdf7('0x132')](db[_0xcdf7('0x36')],{'foreignKey':_0xcdf7('0x1b5'),'as':_0xcdf7('0x1b6')});db[_0xcdf7('0x1af')]['belongsTo'](db[_0xcdf7('0x35')],{'foreignKey':_0xcdf7('0x1b7'),'as':_0xcdf7('0x1b8')});db[_0xcdf7('0xef')][_0xcdf7('0x132')](db[_0xcdf7('0x61')],{});db[_0xcdf7('0xef')]['belongsTo'](db[_0xcdf7('0x5f')],{});db['ChatTransferReport'][_0xcdf7('0x132')](db[_0xcdf7('0x5b')],{'foreignKey':'FromChatWebsiteId','as':_0xcdf7('0x1b1')});db[_0xcdf7('0xef')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'foreignKey':'FromUserId','as':_0xcdf7('0x1b3')});db[_0xcdf7('0xef')]['belongsTo'](db['User'],{'foreignKey':_0xcdf7('0x1b4'),'as':'ToAgent'});db[_0xcdf7('0xef')][_0xcdf7('0x132')](db[_0xcdf7('0x64')],{'foreignKey':_0xcdf7('0x1b9'),'as':_0xcdf7('0x1b6')});db[_0xcdf7('0xef')]['belongsTo'](db[_0xcdf7('0x5b')],{'foreignKey':'ToChatWebsiteId','as':_0xcdf7('0x1b8')});db[_0xcdf7('0xf1')][_0xcdf7('0x132')](db[_0xcdf7('0x46')],{});db[_0xcdf7('0xf1')][_0xcdf7('0x132')](db[_0xcdf7('0x45')],{});db[_0xcdf7('0xf1')][_0xcdf7('0x132')](db[_0xcdf7('0x41')],{'foreignKey':_0xcdf7('0x1ba'),'as':_0xcdf7('0x1b1')});db[_0xcdf7('0xf1')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'foreignKey':_0xcdf7('0x1b2'),'as':'FromAgent'});db[_0xcdf7('0xf1')]['belongsTo'](db[_0xcdf7('0xfc')],{'foreignKey':_0xcdf7('0x1b4'),'as':_0xcdf7('0x1bb')});db['FaxTransferReport']['belongsTo'](db['FaxQueue'],{'foreignKey':_0xcdf7('0x1bc'),'as':_0xcdf7('0x1b6')});db[_0xcdf7('0xf1')][_0xcdf7('0x132')](db[_0xcdf7('0x41')],{'foreignKey':'ToFaxAccountId','as':_0xcdf7('0x1b8')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelMessage'],{});db[_0xcdf7('0xf3')]['belongsTo'](db[_0xcdf7('0x106')],{});db['OpenchannelTransferReport'][_0xcdf7('0x132')](db[_0xcdf7('0x54')],{'foreignKey':'FromOpenchannelAccountId','as':_0xcdf7('0x1b1')});db[_0xcdf7('0xf3')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'foreignKey':_0xcdf7('0x1b2'),'as':_0xcdf7('0x1b3')});db[_0xcdf7('0xf3')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'foreignKey':'ToUserId','as':_0xcdf7('0x1bb')});db['OpenchannelTransferReport'][_0xcdf7('0x132')](db['OpenchannelQueue'],{'foreignKey':_0xcdf7('0x1bd'),'as':_0xcdf7('0x1b6')});db[_0xcdf7('0xf3')][_0xcdf7('0x132')](db[_0xcdf7('0x54')],{'foreignKey':_0xcdf7('0x1be'),'as':_0xcdf7('0x1b8')});db['SmsTransferReport'][_0xcdf7('0x132')](db[_0xcdf7('0x50')],{});db[_0xcdf7('0x1bf')][_0xcdf7('0x132')](db[_0xcdf7('0x4e')],{});db[_0xcdf7('0x1bf')][_0xcdf7('0x132')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0xcdf7('0x1b1')});db[_0xcdf7('0x1bf')][_0xcdf7('0x132')](db[_0xcdf7('0xfc')],{'foreignKey':_0xcdf7('0x1b2'),'as':_0xcdf7('0x1b3')});db[_0xcdf7('0x1bf')][_0xcdf7('0x132')](db['User'],{'foreignKey':_0xcdf7('0x1b4'),'as':_0xcdf7('0x1bb')});db[_0xcdf7('0x1bf')][_0xcdf7('0x132')](db[_0xcdf7('0x52')],{'foreignKey':'ToSmsQueueId','as':_0xcdf7('0x1b6')});db['SmsTransferReport']['belongsTo'](db[_0xcdf7('0x4b')],{'foreignKey':_0xcdf7('0x1c0'),'as':_0xcdf7('0x1b8')});db['CmList'][_0xcdf7('0xff')](db[_0xcdf7('0x79')],{'as':'Dispositions','foreignKey':_0xcdf7('0x14d')});db[_0xcdf7('0xf5')][_0xcdf7('0xff')](db[_0xcdf7('0x72')],{'as':'CustomFields','foreignKey':_0xcdf7('0x14d')});db[_0xcdf7('0xf5')][_0xcdf7('0xff')](db[_0xcdf7('0x69')],{'as':_0xcdf7('0x175'),'onDelete':_0xcdf7('0xfe'),'foreignKey':_0xcdf7('0x14d')});db[_0xcdf7('0xf5')][_0xcdf7('0xff')](db[_0xcdf7('0x6c')],{'as':_0xcdf7('0x105'),'foreignKey':_0xcdf7('0x14d')});db['CmList'][_0xcdf7('0xff')](db[_0xcdf7('0x6e')],{'as':_0xcdf7('0x1c1'),'foreignKey':_0xcdf7('0x14d')});db[_0xcdf7('0xf5')][_0xcdf7('0xff')](db[_0xcdf7('0x70')],{'as':_0xcdf7('0x70'),'foreignKey':_0xcdf7('0x14d')});db[_0xcdf7('0xf5')][_0xcdf7('0x10b')](db[_0xcdf7('0x18')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0xcdf7('0xf5')]['belongsToMany'](db['User'],{'as':_0xcdf7('0x13b'),'through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0xcdf7('0x103')],{'as':_0xcdf7('0x104'),'onDelete':_0xcdf7('0x158')});db['VoicePrefix'][_0xcdf7('0x10b')](db[_0xcdf7('0xfc')],{'as':'Agents','through':_0xcdf7('0x1c2')});db['UserProfile'][_0xcdf7('0xff')](db['User'],{'as':_0xcdf7('0x153'),'foreignKey':'userProfileId'});db[_0xcdf7('0x1c3')][_0xcdf7('0xff')](db['UserProfileSection'],{'as':_0xcdf7('0x1c4'),'foreignKey':_0xcdf7('0x1c5'),'onDelete':'cascade'});db[_0xcdf7('0xfa')][_0xcdf7('0xff')](db['UserProfileResource'],{'as':_0xcdf7('0x1c6'),'foreignKey':_0xcdf7('0x1c7'),'onDelete':_0xcdf7('0xfe')});module[_0xcdf7('0x1c8')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 6d652e6..f9c2876 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0bf=['/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/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/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','./api/userProfileResource','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','/api/rpc','/api/version','./api/version','/api/system','/api/pm2','/apidoc','static','root','/www','join','/demo','/snippet','snippet','1.0.16','/plugins','/server/files/plugins','route','get','sendFile','appPath','/index.html','path','express-winston','util','./errors','./config/environment','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','connection','remoteAddress','statusCode','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','url','other','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/agents/reports','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction'];(function(_0x5a25a9,_0xd1fbd7){var _0xe5e638=function(_0x484b8b){while(--_0x484b8b){_0x5a25a9['push'](_0x5a25a9['shift']());}};_0xe5e638(++_0xd1fbd7);}(_0xd0bf,0x9a));var _0xfd0b=function(_0x57356e,_0x1982df){_0x57356e=_0x57356e-0x0;var _0x4411d9=_0xd0bf[_0x57356e];return _0x4411d9;};'use strict';var path=require(_0xfd0b('0x0'));var express=require('express');var ewinston=require(_0xfd0b('0x1'));var util=require(_0xfd0b('0x2'));var errors=require(_0xfd0b('0x3'));var config=require(_0xfd0b('0x4'));var logger=require(_0xfd0b('0x5'))(_0xfd0b('0x6'));var authLogger=require(_0xfd0b('0x5'))(_0xfd0b('0x7'));exports[_0xfd0b('0x8')]=function(_0x293ac7){_0x293ac7[_0xfd0b('0x9')](ewinston[_0xfd0b('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x5a88be,_0x6c06c7){return util['format'](_0xfd0b('0xb'),_0x5a88be[_0xfd0b('0xc')],_0x5a88be[_0xfd0b('0xd')]['x-forwarded-for']?_0x5a88be[_0xfd0b('0xd')]['x-forwarded-for']:_0x5a88be[_0xfd0b('0xe')][_0xfd0b('0xf')]||_0x5a88be['ip'],_0x5a88be['url'],_0x6c06c7[_0xfd0b('0x10')],_0x6c06c7[_0xfd0b('0x11')],_0x5a88be[_0xfd0b('0x12')]?_0x5a88be[_0xfd0b('0x12')]['id']:null,_0x5a88be[_0xfd0b('0x12')]?_0x5a88be[_0xfd0b('0x12')][_0xfd0b('0x13')]:null,_0x5a88be[_0xfd0b('0x12')]?_0x5a88be['user'][_0xfd0b('0x14')]:null);}}));_0x293ac7['use'](ewinston[_0xfd0b('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x231361,_0x11be59){var _0x4715dc=_0xfd0b('0x15');if(_0x231361[_0xfd0b('0x16')]&&_0x231361[_0xfd0b('0x16')][_0xfd0b('0x17')]&&_0x231361[_0xfd0b('0x16')][_0xfd0b('0x18')]){_0x4715dc=_0xfd0b('0x19');}return util[_0xfd0b('0x1a')](_0x4715dc,_0x231361[_0xfd0b('0xc')],_0x231361[_0xfd0b('0xd')]['x-forwarded-for']?_0x231361[_0xfd0b('0xd')]['x-forwarded-for']:_0x231361[_0xfd0b('0xe')]['remoteAddress']||_0x231361['ip'],_0x231361[_0xfd0b('0x1b')],_0x11be59[_0xfd0b('0x10')],_0x11be59[_0xfd0b('0x11')],_0x231361[_0xfd0b('0x12')]?_0x231361[_0xfd0b('0x12')]['id']:null,_0x231361[_0xfd0b('0x12')]?_0x231361[_0xfd0b('0x12')][_0xfd0b('0x13')]:null,_0x231361[_0xfd0b('0x12')]?_0x231361[_0xfd0b('0x12')][_0xfd0b('0x14')]:null,_0x231361[_0xfd0b('0x16')]&&_0x231361['body'][_0xfd0b('0x17')]?_0x231361['body'][_0xfd0b('0x17')]:_0xfd0b('0x1c'),_0x231361[_0xfd0b('0x16')]&&_0x231361[_0xfd0b('0x16')][_0xfd0b('0x18')]?_0x231361[_0xfd0b('0x16')][_0xfd0b('0x18')]:'',_0x231361[_0xfd0b('0x16')]&&_0x231361['body'][_0xfd0b('0x1d')]?_0x231361[_0xfd0b('0x16')][_0xfd0b('0x1d')]:'');},'ignoreRoute':function(_0x4a7351){var _0x2aa27f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2aa27f[_0xfd0b('0x1e')](_0x4a7351[_0xfd0b('0x1b')]);}}));_0x293ac7[_0xfd0b('0x9')]('/api/users',require(_0xfd0b('0x1f')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x20'),require(_0xfd0b('0x21')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x22'),require('./api/voiceContext'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x23'),require(_0xfd0b('0x24')));_0x293ac7['use'](_0xfd0b('0x25'),require(_0xfd0b('0x26')));_0x293ac7[_0xfd0b('0x9')]('/api/voice/queues',require(_0xfd0b('0x27')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x28'),require(_0xfd0b('0x29')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x2a'),require(_0xfd0b('0x2b')));_0x293ac7[_0xfd0b('0x9')]('/api/voice/mails',require(_0xfd0b('0x2c')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x2d'),require(_0xfd0b('0x2e')));_0x293ac7['use']('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x293ac7['use']('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x2f'),require('./api/voiceAgentReport'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x30'),require('./api/voiceQueueReport'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x31'),require(_0xfd0b('0x32')));_0x293ac7['use'](_0xfd0b('0x33'),require(_0xfd0b('0x34')));_0x293ac7[_0xfd0b('0x9')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x293ac7['use'](_0xfd0b('0x35'),require(_0xfd0b('0x36')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x37'),require(_0xfd0b('0x38')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x39'),require('./api/mailQueue'));_0x293ac7[_0xfd0b('0x9')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x293ac7[_0xfd0b('0x9')]('/api/mail/interactions',require(_0xfd0b('0x3a')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x3b'),require(_0xfd0b('0x3c')));_0x293ac7[_0xfd0b('0x9')]('/api/mail/applications',require(_0xfd0b('0x3d')));_0x293ac7['use'](_0xfd0b('0x3e'),require(_0xfd0b('0x3f')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x40'),require(_0xfd0b('0x41')));_0x293ac7[_0xfd0b('0x9')]('/api/dashboards/items',require(_0xfd0b('0x42')));_0x293ac7['use']('/api/fax/accounts',require(_0xfd0b('0x43')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x44'),require('./api/faxApplication'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x45'),require(_0xfd0b('0x46')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x47'),require(_0xfd0b('0x48')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x49'),require('./api/faxQueue'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x4a'),require(_0xfd0b('0x4b')));_0x293ac7['use'](_0xfd0b('0x4c'),require(_0xfd0b('0x4d')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x4e'),require(_0xfd0b('0x4f')));_0x293ac7[_0xfd0b('0x9')]('/api/sms/interactions',require('./api/smsInteraction'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x50'),require(_0xfd0b('0x51')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x52'),require('./api/smsQueue'));_0x293ac7[_0xfd0b('0x9')]('/api/openchannel/accounts',require(_0xfd0b('0x53')));_0x293ac7[_0xfd0b('0x9')]('/api/openchannel/applications',require(_0xfd0b('0x54')));_0x293ac7[_0xfd0b('0x9')]('/api/openchannel/interactions',require(_0xfd0b('0x55')));_0x293ac7['use'](_0xfd0b('0x56'),require(_0xfd0b('0x57')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x58'),require(_0xfd0b('0x59')));_0x293ac7[_0xfd0b('0x9')]('/api/chat/websites',require(_0xfd0b('0x5a')));_0x293ac7['use'](_0xfd0b('0x5b'),require(_0xfd0b('0x5c')));_0x293ac7['use'](_0xfd0b('0x5d'),require(_0xfd0b('0x5e')));_0x293ac7['use'](_0xfd0b('0x5f'),require(_0xfd0b('0x60')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x61'),require('./api/chatMessage'));_0x293ac7[_0xfd0b('0x9')]('/api/chat/offline_messages',require(_0xfd0b('0x62')));_0x293ac7['use'](_0xfd0b('0x63'),require('./api/chatQueue'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x64'),require(_0xfd0b('0x65')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x66'),require(_0xfd0b('0x67')));_0x293ac7['use'](_0xfd0b('0x68'),require(_0xfd0b('0x69')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x6a'),require(_0xfd0b('0x6b')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x6c'),require(_0xfd0b('0x6d')));_0x293ac7['use']('/api/cm/hopper_black',require(_0xfd0b('0x6e')));_0x293ac7[_0xfd0b('0x9')]('/api/cm/hopper_final',require(_0xfd0b('0x6f')));_0x293ac7['use'](_0xfd0b('0x70'),require('./api/cmHopperHistory'));_0x293ac7[_0xfd0b('0x9')]('/api/cm/custom_fields',require(_0xfd0b('0x71')));_0x293ac7['use'](_0xfd0b('0x72'),require(_0xfd0b('0x73')));_0x293ac7[_0xfd0b('0x9')]('/api/automations',require(_0xfd0b('0x74')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x75'),require(_0xfd0b('0x76')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x77'),require('./api/disposition'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x78'),require('./api/condition'));_0x293ac7['use']('/api/intervals',require(_0xfd0b('0x79')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x7a'),require('./api/pause'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x7b'),require(_0xfd0b('0x7c')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x7d'),require(_0xfd0b('0x7e')));_0x293ac7[_0xfd0b('0x9')]('/api/schedules',require(_0xfd0b('0x7f')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x80'),require('./api/sound'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x81'),require('./api/tag'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x82'),require(_0xfd0b('0x83')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x84'),require(_0xfd0b('0x85')));_0x293ac7[_0xfd0b('0x9')]('/api/variables',require(_0xfd0b('0x86')));_0x293ac7[_0xfd0b('0x9')]('/api/integrations',require(_0xfd0b('0x87')));_0x293ac7[_0xfd0b('0x9')]('/api/integrations/reports',require(_0xfd0b('0x88')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x89'),require('./api/analyticCustomReport'));_0x293ac7['use']('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x293ac7[_0xfd0b('0x9')]('/api/analytics/extracted_reports',require(_0xfd0b('0x8a')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x8b'),require(_0xfd0b('0x8c')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x8d'),require('./api/analyticFieldReport'));_0x293ac7['use']('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x8e'),require(_0xfd0b('0x8f')));_0x293ac7['use'](_0xfd0b('0x90'),require('./api/intSalesforceConfiguration'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x91'),require(_0xfd0b('0x92')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x93'),require(_0xfd0b('0x94')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x95'),require(_0xfd0b('0x96')));_0x293ac7[_0xfd0b('0x9')]('/api/integrations/sugarcrm/fields',require(_0xfd0b('0x97')));_0x293ac7['use'](_0xfd0b('0x98'),require(_0xfd0b('0x99')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0x9a'),require(_0xfd0b('0x9b')));_0x293ac7[_0xfd0b('0x9')]('/api/integrations/desk/fields',require(_0xfd0b('0x9c')));_0x293ac7['use']('/api/integrations/zoho/accounts',require(_0xfd0b('0x9d')));_0x293ac7[_0xfd0b('0x9')]('/api/integrations/zoho/configurations',require(_0xfd0b('0x9e')));_0x293ac7[_0xfd0b('0x9')]('/api/integrations/zoho/fields',require(_0xfd0b('0x9f')));_0x293ac7['use'](_0xfd0b('0xa0'),require(_0xfd0b('0xa1')));_0x293ac7[_0xfd0b('0x9')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xa2'),require(_0xfd0b('0xa3')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xa4'),require(_0xfd0b('0xa5')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xa6'),require('./api/intFreshdeskConfiguration'));_0x293ac7[_0xfd0b('0x9')]('/api/integrations/freshdesk/fields',require(_0xfd0b('0xa7')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xa8'),require(_0xfd0b('0xa9')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xaa'),require(_0xfd0b('0xab')));_0x293ac7[_0xfd0b('0x9')]('/api/integrations/vtiger/fields',require(_0xfd0b('0xac')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xad'),require(_0xfd0b('0xae')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xaf'),require('./api/intServicenowConfiguration'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xb0'),require('./api/intServicenowField'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xb1'),require(_0xfd0b('0xb2')));_0x293ac7[_0xfd0b('0x9')]('/api/integrations/dynamics365/configurations',require(_0xfd0b('0xb3')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xb4'),require(_0xfd0b('0xb5')));_0x293ac7['use'](_0xfd0b('0xb6'),require(_0xfd0b('0xb7')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xb8'),require('./api/intFreshsalesConfiguration'));_0x293ac7[_0xfd0b('0x9')]('/api/integrations/freshsales/fields',require(_0xfd0b('0xb9')));_0x293ac7[_0xfd0b('0x9')]('/api/networks',require(_0xfd0b('0xba')));_0x293ac7[_0xfd0b('0x9')]('/api/chat/reports/queue',require(_0xfd0b('0xbb')));_0x293ac7['use'](_0xfd0b('0xbc'),require(_0xfd0b('0xbd')));_0x293ac7[_0xfd0b('0x9')]('/api/jscripty/answers/reports',require(_0xfd0b('0xbe')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xbf'),require('./api/jscriptyQuestionReport'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xc0'),require('./api/jscriptySessionReport'));_0x293ac7['use'](_0xfd0b('0xc1'),require(_0xfd0b('0xc2')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xc3'),require('./api/squareReport'));_0x293ac7['use'](_0xfd0b('0xc4'),require(_0xfd0b('0xc5')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xc6'),require('./api/jscriptyProject'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xc7'),require(_0xfd0b('0xc8')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xc9'),require(_0xfd0b('0xca')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xcb'),require('./api/squareProject'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xcc'),require(_0xfd0b('0xcd')));_0x293ac7['use'](_0xfd0b('0xce'),require(_0xfd0b('0xcf')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xd0'),require(_0xfd0b('0xd1')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xd2'),require(_0xfd0b('0xd3')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xd4'),require(_0xfd0b('0xd5')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xd6'),require(_0xfd0b('0xd7')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xd8'),require(_0xfd0b('0xd9')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xda'),require('./api/plugin'));_0x293ac7['use']('/api/mail/reports/transfer',require(_0xfd0b('0xdb')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xdc'),require(_0xfd0b('0xdd')));_0x293ac7['use'](_0xfd0b('0xde'),require('./api/faxTransferReport'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xdf'),require(_0xfd0b('0xe0')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xe1'),require('./api/smsTransferReport'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xe2'),require(_0xfd0b('0xe3')));_0x293ac7[_0xfd0b('0x9')]('/api/voice/prefixes',require(_0xfd0b('0xe4')));_0x293ac7['use'](_0xfd0b('0xe5'),require(_0xfd0b('0xe6')));_0x293ac7[_0xfd0b('0x9')]('/api/userProfile/sections',require(_0xfd0b('0xe7')));_0x293ac7[_0xfd0b('0x9')]('/api/userProfile/resources',require(_0xfd0b('0xe8')));_0x293ac7[_0xfd0b('0x9')]('/api/auth/local',require(_0xfd0b('0xe9')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xea'),require(_0xfd0b('0xeb')));_0x293ac7[_0xfd0b('0x9')]('/api/jira',require(_0xfd0b('0xec')));_0x293ac7['use'](_0xfd0b('0xed'),require('./api/rpc'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xee'),require(_0xfd0b('0xef')));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xf0'),require('./api/system'));_0x293ac7['use'](_0xfd0b('0xf1'),require('./api/pm2'));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xf2'),express[_0xfd0b('0xf3')](path['join'](config[_0xfd0b('0xf4')],_0xfd0b('0xf2'))));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xf5'),express[_0xfd0b('0xf3')](path[_0xfd0b('0xf6')](config[_0xfd0b('0xf4')],_0xfd0b('0xf5'))));_0x293ac7['use'](_0xfd0b('0xf7'),express[_0xfd0b('0xf3')](path[_0xfd0b('0xf6')](config[_0xfd0b('0xf4')],_0xfd0b('0xf7'))));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xf8'),express[_0xfd0b('0xf3')](path[_0xfd0b('0xf6')](config[_0xfd0b('0xf4')],_0xfd0b('0xf9'),_0xfd0b('0xfa'))));_0x293ac7[_0xfd0b('0x9')](_0xfd0b('0xfb'),express[_0xfd0b('0xf3')](path[_0xfd0b('0xf6')](config[_0xfd0b('0xf4')],_0xfd0b('0xfc'))));_0x293ac7[_0xfd0b('0xfd')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xfd0b('0xfe')](errors[0x194]);_0x293ac7['route']('/*')[_0xfd0b('0xfe')](function(_0xac32dc,_0x5b02c7){_0x5b02c7[_0xfd0b('0xff')](path['resolve'](_0x293ac7[_0xfd0b('0xfe')](_0xfd0b('0x100'))+_0xfd0b('0x101')));});}; \ No newline at end of file +var _0xbc21=['./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./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/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','/www','root','/demo','/snippet','snippet','1.0.16','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','express-winston','./errors','./config/environment','./config/logger','api','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','user','name','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','url','statusCode','responseTime','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/variable','/api/integrations','/api/integrations/reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','/api/networks','./api/network','./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/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/campaign','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer'];(function(_0xc394ee,_0x2ab576){var _0x3a6c16=function(_0x66e0ee){while(--_0x66e0ee){_0xc394ee['push'](_0xc394ee['shift']());}};_0x3a6c16(++_0x2ab576);}(_0xbc21,0x137));var _0x1bc2=function(_0x36e9bd,_0x3df63f){_0x36e9bd=_0x36e9bd-0x0;var _0x2b7cda=_0xbc21[_0x36e9bd];return _0x2b7cda;};'use strict';var path=require(_0x1bc2('0x0'));var express=require(_0x1bc2('0x1'));var ewinston=require(_0x1bc2('0x2'));var util=require('util');var errors=require(_0x1bc2('0x3'));var config=require(_0x1bc2('0x4'));var logger=require(_0x1bc2('0x5'))(_0x1bc2('0x6'));var authLogger=require(_0x1bc2('0x5'))('auth');exports[_0x1bc2('0x7')]=function(_0x4910ed){_0x4910ed[_0x1bc2('0x8')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3a9afe,_0xfe18d7){return util['format'](_0x1bc2('0x9'),_0x3a9afe[_0x1bc2('0xa')],_0x3a9afe[_0x1bc2('0xb')]['x-forwarded-for']?_0x3a9afe['headers'][_0x1bc2('0xc')]:_0x3a9afe[_0x1bc2('0xd')][_0x1bc2('0xe')]||_0x3a9afe['ip'],_0x3a9afe['url'],_0xfe18d7['statusCode'],_0xfe18d7['responseTime'],_0x3a9afe['user']?_0x3a9afe[_0x1bc2('0xf')]['id']:null,_0x3a9afe[_0x1bc2('0xf')]?_0x3a9afe[_0x1bc2('0xf')][_0x1bc2('0x10')]:null,_0x3a9afe[_0x1bc2('0xf')]?_0x3a9afe[_0x1bc2('0xf')]['role']:null);}}));_0x4910ed[_0x1bc2('0x8')](ewinston[_0x1bc2('0x11')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x15ec84,_0x39b297){var _0x384188=_0x1bc2('0x12');if(_0x15ec84[_0x1bc2('0x13')]&&_0x15ec84[_0x1bc2('0x13')][_0x1bc2('0x14')]&&_0x15ec84[_0x1bc2('0x13')][_0x1bc2('0x15')]){_0x384188=_0x1bc2('0x16');}return util[_0x1bc2('0x17')](_0x384188,_0x15ec84['method'],_0x15ec84[_0x1bc2('0xb')][_0x1bc2('0xc')]?_0x15ec84[_0x1bc2('0xb')][_0x1bc2('0xc')]:_0x15ec84['connection'][_0x1bc2('0xe')]||_0x15ec84['ip'],_0x15ec84[_0x1bc2('0x18')],_0x39b297[_0x1bc2('0x19')],_0x39b297[_0x1bc2('0x1a')],_0x15ec84[_0x1bc2('0xf')]?_0x15ec84[_0x1bc2('0xf')]['id']:null,_0x15ec84[_0x1bc2('0xf')]?_0x15ec84[_0x1bc2('0xf')]['name']:null,_0x15ec84[_0x1bc2('0xf')]?_0x15ec84[_0x1bc2('0xf')]['role']:null,_0x15ec84['body']&&_0x15ec84['body'][_0x1bc2('0x14')]?_0x15ec84[_0x1bc2('0x13')]['device']:_0x1bc2('0x1b'),_0x15ec84[_0x1bc2('0x13')]&&_0x15ec84[_0x1bc2('0x13')][_0x1bc2('0x15')]?_0x15ec84[_0x1bc2('0x13')]['agent_id']:'',_0x15ec84[_0x1bc2('0x13')]&&_0x15ec84[_0x1bc2('0x13')][_0x1bc2('0x1c')]?_0x15ec84[_0x1bc2('0x13')][_0x1bc2('0x1c')]:'');},'ignoreRoute':function(_0x2f0bf8){var _0x247a98=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x247a98[_0x1bc2('0x1d')](_0x2f0bf8[_0x1bc2('0x18')]);}}));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x1e'),require(_0x1bc2('0x1f')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x20'),require(_0x1bc2('0x21')));_0x4910ed['use'](_0x1bc2('0x22'),require('./api/voiceContext'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x23'),require(_0x1bc2('0x24')));_0x4910ed[_0x1bc2('0x8')]('/api/voice/mohs',require(_0x1bc2('0x25')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x26'),require(_0x1bc2('0x27')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x28'),require(_0x1bc2('0x29')));_0x4910ed['use']('/api/screen/recordings',require(_0x1bc2('0x2a')));_0x4910ed['use'](_0x1bc2('0x2b'),require(_0x1bc2('0x2c')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x2d'),require('./api/voiceMailMessage'));_0x4910ed['use'](_0x1bc2('0x2e'),require(_0x1bc2('0x2f')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x30'),require(_0x1bc2('0x31')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x32'),require('./api/voiceAgentReport'));_0x4910ed[_0x1bc2('0x8')]('/api/voice/queues/reports',require(_0x1bc2('0x33')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x34'),require(_0x1bc2('0x35')));_0x4910ed['use'](_0x1bc2('0x36'),require(_0x1bc2('0x37')));_0x4910ed[_0x1bc2('0x8')]('/api/voice/transfers/reports',require(_0x1bc2('0x38')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x39'),require(_0x1bc2('0x3a')));_0x4910ed['use'](_0x1bc2('0x3b'),require(_0x1bc2('0x3c')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x3d'),require('./api/mailQueue'));_0x4910ed['use']('/api/mail/substatuses',require(_0x1bc2('0x3e')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x3f'),require(_0x1bc2('0x40')));_0x4910ed['use']('/api/mail/messages',require(_0x1bc2('0x41')));_0x4910ed[_0x1bc2('0x8')]('/api/mail/applications',require(_0x1bc2('0x42')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x43'),require(_0x1bc2('0x44')));_0x4910ed['use'](_0x1bc2('0x45'),require(_0x1bc2('0x46')));_0x4910ed[_0x1bc2('0x8')]('/api/dashboards/items',require(_0x1bc2('0x47')));_0x4910ed['use']('/api/fax/accounts',require(_0x1bc2('0x48')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x49'),require('./api/faxApplication'));_0x4910ed['use'](_0x1bc2('0x4a'),require(_0x1bc2('0x4b')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x4c'),require(_0x1bc2('0x4d')));_0x4910ed['use'](_0x1bc2('0x4e'),require(_0x1bc2('0x4f')));_0x4910ed[_0x1bc2('0x8')]('/api/fax/reports/queue',require(_0x1bc2('0x50')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x51'),require(_0x1bc2('0x52')));_0x4910ed['use'](_0x1bc2('0x53'),require(_0x1bc2('0x54')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x55'),require(_0x1bc2('0x56')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x57'),require('./api/smsMessage'));_0x4910ed[_0x1bc2('0x8')]('/api/sms/queues',require(_0x1bc2('0x58')));_0x4910ed['use']('/api/openchannel/accounts',require(_0x1bc2('0x59')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x5a'),require('./api/openchannelApplication'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x5b'),require(_0x1bc2('0x5c')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x5d'),require('./api/openchannelMessage'));_0x4910ed[_0x1bc2('0x8')]('/api/openchannel/queues',require(_0x1bc2('0x5e')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x5f'),require('./api/chatWebsite'));_0x4910ed['use'](_0x1bc2('0x60'),require('./api/openchannelQueueReport'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x61'),require(_0x1bc2('0x62')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x63'),require('./api/chatInteraction'));_0x4910ed[_0x1bc2('0x8')]('/api/chat/messages',require(_0x1bc2('0x64')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x65'),require('./api/chatOfflineMessage'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x66'),require(_0x1bc2('0x67')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x68'),require(_0x1bc2('0x69')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x6a'),require(_0x1bc2('0x6b')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x6c'),require(_0x1bc2('0x6d')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x6e'),require('./api/cmContact'));_0x4910ed['use'](_0x1bc2('0x6f'),require('./api/cmHopper'));_0x4910ed['use'](_0x1bc2('0x70'),require(_0x1bc2('0x71')));_0x4910ed['use']('/api/cm/hopper_final',require(_0x1bc2('0x72')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x73'),require('./api/cmHopperHistory'));_0x4910ed[_0x1bc2('0x8')]('/api/cm/custom_fields',require(_0x1bc2('0x74')));_0x4910ed[_0x1bc2('0x8')]('/api/actions',require(_0x1bc2('0x75')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x76'),require(_0x1bc2('0x77')));_0x4910ed[_0x1bc2('0x8')]('/api/canned_answers',require(_0x1bc2('0x78')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x79'),require(_0x1bc2('0x7a')));_0x4910ed['use'](_0x1bc2('0x7b'),require(_0x1bc2('0x7c')));_0x4910ed[_0x1bc2('0x8')]('/api/intervals',require('./api/interval'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x7d'),require(_0x1bc2('0x7e')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x7f'),require(_0x1bc2('0x80')));_0x4910ed['use'](_0x1bc2('0x81'),require(_0x1bc2('0x82')));_0x4910ed['use'](_0x1bc2('0x83'),require(_0x1bc2('0x84')));_0x4910ed['use'](_0x1bc2('0x85'),require(_0x1bc2('0x86')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x87'),require(_0x1bc2('0x88')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x89'),require(_0x1bc2('0x8a')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x8b'),require('./api/trigger'));_0x4910ed[_0x1bc2('0x8')]('/api/variables',require(_0x1bc2('0x8c')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x8d'),require('./api/integration'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x8e'),require('./api/integrationReport'));_0x4910ed[_0x1bc2('0x8')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x8f'),require(_0x1bc2('0x90')));_0x4910ed['use'](_0x1bc2('0x91'),require('./api/analyticExtractedReport'));_0x4910ed[_0x1bc2('0x8')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x92'),require(_0x1bc2('0x93')));_0x4910ed[_0x1bc2('0x8')]('/api/analytics/tree_reports',require(_0x1bc2('0x94')));_0x4910ed['use'](_0x1bc2('0x95'),require('./api/intSalesforceAccount'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x96'),require('./api/intSalesforceConfiguration'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x97'),require('./api/intSalesforceField'));_0x4910ed[_0x1bc2('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x1bc2('0x98')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x99'),require('./api/intSugarcrmConfiguration'));_0x4910ed[_0x1bc2('0x8')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x4910ed['use']('/api/integrations/desk/accounts',require(_0x1bc2('0x9a')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x9b'),require(_0x1bc2('0x9c')));_0x4910ed[_0x1bc2('0x8')]('/api/integrations/desk/fields',require(_0x1bc2('0x9d')));_0x4910ed['use'](_0x1bc2('0x9e'),require(_0x1bc2('0x9f')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xa0'),require(_0x1bc2('0xa1')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xa2'),require('./api/intZohoField'));_0x4910ed[_0x1bc2('0x8')]('/api/integrations/zendesk/accounts',require(_0x1bc2('0xa3')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xa4'),require(_0x1bc2('0xa5')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xa6'),require(_0x1bc2('0xa7')));_0x4910ed['use'](_0x1bc2('0xa8'),require(_0x1bc2('0xa9')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xaa'),require(_0x1bc2('0xab')));_0x4910ed['use']('/api/integrations/freshdesk/fields',require(_0x1bc2('0xac')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xad'),require(_0x1bc2('0xae')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xaf'),require(_0x1bc2('0xb0')));_0x4910ed['use']('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x4910ed['use'](_0x1bc2('0xb1'),require(_0x1bc2('0xb2')));_0x4910ed['use'](_0x1bc2('0xb3'),require(_0x1bc2('0xb4')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xb5'),require('./api/intServicenowField'));_0x4910ed['use']('/api/integrations/dynamics365/accounts',require(_0x1bc2('0xb6')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xb7'),require(_0x1bc2('0xb8')));_0x4910ed[_0x1bc2('0x8')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xb9'),require('./api/intFreshsalesAccount'));_0x4910ed['use'](_0x1bc2('0xba'),require('./api/intFreshsalesConfiguration'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xbb'),require('./api/intFreshsalesField'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xbc'),require(_0x1bc2('0xbd')));_0x4910ed['use']('/api/chat/reports/queue',require(_0x1bc2('0xbe')));_0x4910ed['use'](_0x1bc2('0xbf'),require('./api/chatInternalMessage'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xc0'),require(_0x1bc2('0xc1')));_0x4910ed['use'](_0x1bc2('0xc2'),require(_0x1bc2('0xc3')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xc4'),require(_0x1bc2('0xc5')));_0x4910ed['use'](_0x1bc2('0xc6'),require('./api/smsQueueReport'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xc7'),require(_0x1bc2('0xc8')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xc9'),require('./api/squareReportDetail'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xca'),require(_0x1bc2('0xcb')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xcc'),require(_0x1bc2('0xcd')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xce'),require('./api/squareOdbc'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xcf'),require(_0x1bc2('0xd0')));_0x4910ed[_0x1bc2('0x8')]('/api/square/recordings',require(_0x1bc2('0xd1')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xd2'),require(_0x1bc2('0xd3')));_0x4910ed['use'](_0x1bc2('0xd4'),require(_0x1bc2('0xd5')));_0x4910ed['use'](_0x1bc2('0xd6'),require('./api/license'));_0x4910ed[_0x1bc2('0x8')]('/api/campaigns',require(_0x1bc2('0xd7')));_0x4910ed['use']('/api/migrations',require(_0x1bc2('0xd8')));_0x4910ed['use']('/api/attachments',require(_0x1bc2('0xd9')));_0x4910ed['use'](_0x1bc2('0xda'),require(_0x1bc2('0xdb')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xdc'),require(_0x1bc2('0xdd')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xde'),require(_0x1bc2('0xdf')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xe0'),require(_0x1bc2('0xe1')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xe2'),require('./api/openchannelTransferReport'));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xe3'),require(_0x1bc2('0xe4')));_0x4910ed[_0x1bc2('0x8')]('/api/cm/lists',require(_0x1bc2('0xe5')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xe6'),require(_0x1bc2('0xe7')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xe8'),require(_0x1bc2('0xe9')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xea'),require(_0x1bc2('0xeb')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xec'),require(_0x1bc2('0xed')));_0x4910ed['use'](_0x1bc2('0xee'),require(_0x1bc2('0xef')));_0x4910ed['use']('/api/auth/google',require(_0x1bc2('0xf0')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xf1'),require('./api/jira'));_0x4910ed['use'](_0x1bc2('0xf2'),require(_0x1bc2('0xf3')));_0x4910ed['use'](_0x1bc2('0xf4'),require(_0x1bc2('0xf5')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xf6'),require(_0x1bc2('0xf7')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xf8'),require(_0x1bc2('0xf9')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xfa'),express[_0x1bc2('0xfb')](path[_0x1bc2('0xfc')](config['root'],'/apidoc')));_0x4910ed['use'](_0x1bc2('0xfd'),express['static'](path[_0x1bc2('0xfc')](config[_0x1bc2('0xfe')],'/www')));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0xff'),express[_0x1bc2('0xfb')](path['join'](config[_0x1bc2('0xfe')],_0x1bc2('0xff'))));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x100'),express[_0x1bc2('0xfb')](path[_0x1bc2('0xfc')](config[_0x1bc2('0xfe')],_0x1bc2('0x101'),_0x1bc2('0x102'))));_0x4910ed[_0x1bc2('0x8')](_0x1bc2('0x103'),express[_0x1bc2('0xfb')](path[_0x1bc2('0xfc')](config['root'],'/server/files/plugins')));_0x4910ed[_0x1bc2('0x104')](_0x1bc2('0x105'))['get'](errors[0x194]);_0x4910ed[_0x1bc2('0x104')]('/*')[_0x1bc2('0x106')](function(_0x579cc0,_0x22d6c0){_0x22d6c0[_0x1bc2('0x107')](path[_0x1bc2('0x108')](_0x4910ed[_0x1bc2('0x106')](_0x1bc2('0x109'))+_0x1bc2('0x10a')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 6992c37..a730770 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7723=['../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','http','rpc','port','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc'];(function(_0x37e9c1,_0x20ff2a){var _0x3b12bd=function(_0x4d42ae){while(--_0x4d42ae){_0x37e9c1['push'](_0x37e9c1['shift']());}};_0x3b12bd(++_0x20ff2a);}(_0x7723,0xe0));var _0x3772=function(_0x25623c,_0x1eb73c){_0x25623c=_0x25623c-0x0;var _0x70865c=_0x7723[_0x25623c];return _0x70865c;};'use strict';var jayson=require(_0x3772('0x0'));var BPromise=require(_0x3772('0x1'));var _=require(_0x3772('0x2'));var config=require(_0x3772('0x3'));exports[_0x3772('0x4')]=function(){return new BPromise(function(_0x4093a4,_0xed613d){var _0x53ce93={};_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x6')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x7')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x8')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x9')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0xa')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0xb')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0xc')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/memberReport/memberReport.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/trunk/trunk.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0xd')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0xe')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0xf')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x10')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/mailQueue/mailQueue.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x11')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/mailMessage/mailMessage.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x12')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x13')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x14')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x15')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x16')));_0x53ce93=_['merge'](_0x53ce93,require('../api/faxMessage/faxMessage.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x17')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x18')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x19')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/smsInteraction/smsInteraction.rpc'));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x1a')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x1b')));_0x53ce93=_['merge'](_0x53ce93,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x1c')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x1d')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x1e')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x1f')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x20')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x21')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/chatQueue/chatQueue.rpc'));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x22')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x23')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x24')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x25')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x26')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/pause/pause.rpc'));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x27')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x28')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/trigger/trigger.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/variable/variable.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x29')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x2a')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x2b')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x2c')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x2d')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x2e')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x2f')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x30')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x31')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x32')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x33')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x34')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x35')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x36')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x37')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x38')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x39')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x3a')));_0x53ce93=_[_0x3772('0x5')](_0x53ce93,require(_0x3772('0x3b')));_0x53ce93=_['merge'](_0x53ce93,require(_0x3772('0x3c')));var _0xeaf0b6=jayson['server'](_0x53ce93)[_0x3772('0x3d')]();var _0x57c73b=config[_0x3772('0x3e')][_0x3772('0x3f')]||config[_0x3772('0x3f')]+0x1;var _0x45289=config[_0x3772('0x3e')]['ip']||_0x3772('0x40');_0xeaf0b6['on']('error',function(_0x2757a3){return _0xed613d(_0x2757a3);});_0xeaf0b6['listen'](_0x57c73b,_0x45289,function(){console['log'](_0x3772('0x41'),_0x45289,_0x57c73b);require(_0x3772('0x42'))[_0x3772('0x43')]();return _0x4093a4(_0x3772('0x44')+_0x45289+':'+_0x57c73b);});});}; \ No newline at end of file +var _0xa6a6=['../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','rpc','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','lodash','listen','merge','../api/user/user.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc'];(function(_0x35a6cf,_0x49fecf){var _0x5cda5b=function(_0x7dc4fd){while(--_0x7dc4fd){_0x35a6cf['push'](_0x35a6cf['shift']());}};_0x5cda5b(++_0x49fecf);}(_0xa6a6,0x146));var _0x6a6a=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xa6a6[_0x1035c1];return _0x308d67;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0x6a6a('0x0'));var config=require('../config/environment');exports[_0x6a6a('0x1')]=function(){return new BPromise(function(_0xf146b0,_0x179e08){var _0x1d0260={};_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x3')));_0x1d0260=_['merge'](_0x1d0260,require('../api/voiceExtension/voiceExtension.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/voiceQueue/voiceQueue.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/voiceRecording/voiceRecording.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x4')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x5')));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0x6')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x7')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x8')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x9')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0xa')));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0xb')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0xc')));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0xd')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0xe')));_0x1d0260=_['merge'](_0x1d0260,require('../api/mailInteraction/mailInteraction.rpc'));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0xf')));_0x1d0260=_['merge'](_0x1d0260,require('../api/mailApplication/mailApplication.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x10')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x11')));_0x1d0260=_['merge'](_0x1d0260,require('../api/faxApplication/faxApplication.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x12')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/faxMessage/faxMessage.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/faxQueue/faxQueue.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x13')));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0x14')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x15')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/smsMessage/smsMessage.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/smsQueue/smsQueue.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x16')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x17')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x18')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x19')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x1a')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/chatInteraction/chatInteraction.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x1b')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x1c')));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0x1d')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/cmHopper/cmHopper.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0x1e')));_0x1d0260=_['merge'](_0x1d0260,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x1f')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x20')));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0x21')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x22')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x23')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x24')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/variable/variable.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x25')));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0x26')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x27')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x28')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x29')));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0x2a')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x2b')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0x2c')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x2d')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x2e')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x2f')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x30')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require('../api/squareRecording/squareRecording.rpc'));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x31')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x32')));_0x1d0260=_[_0x6a6a('0x2')](_0x1d0260,require(_0x6a6a('0x33')));_0x1d0260=_['merge'](_0x1d0260,require(_0x6a6a('0x34')));var _0x58a9a2=jayson['server'](_0x1d0260)['http']();var _0x4c6e21=config[_0x6a6a('0x35')]['port']||config['port']+0x1;var _0xc0a839=config[_0x6a6a('0x35')]['ip']||'localhost';_0x58a9a2['on'](_0x6a6a('0x36'),function(_0x77891b){return _0x179e08(_0x77891b);});_0x58a9a2[_0x6a6a('0x1')](_0x4c6e21,_0xc0a839,function(){console['log'](_0x6a6a('0x37'),_0xc0a839,_0x4c6e21);require(_0x6a6a('0x38'))['default']();return _0xf146b0(_0x6a6a('0x39')+_0xc0a839+':'+_0x4c6e21);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index b39cabf..8411ecf 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 _0xa9e0=['utf8','setTimeout','setEncoding','ready','line','toLowerCase','hangup','emit','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','write','inherits','prototype','sendRequest','command','sync','ANSWER','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','label','exports','util','lodash','events','./error','call'];(function(_0x243237,_0x4c2200){var _0x3336b0=function(_0x1c9153){while(--_0x1c9153){_0x243237['push'](_0x243237['shift']());}};_0x3336b0(++_0x4c2200);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x0a9e('0x3'));function AGIChannel(_0x4ce2f1){var _0x333808=this,_0x432180=new AGIReply(),_0x2ab90b=![],_0x991246={};EventEmitter[_0x0a9e('0x4')](_0x333808);_0x4ce2f1['setEncoding'](_0x0a9e('0x5'));_0x4ce2f1[_0x0a9e('0x6')](0x8*0x3c*0x3c*0x3e8);_0x432180[_0x0a9e('0x7')]('utf8');_0x432180['on']('headers',function(_0xe42b77){for(var _0x56465b in _0xe42b77){_0x333808[_0x56465b]=_0xe42b77[_0x56465b];}_0x333808['emit'](_0x0a9e('0x8'));});_0x432180['on'](_0x0a9e('0x9'),function(_0x307b3e){if(_0x307b3e[_0x0a9e('0xa')]()==_0x0a9e('0xb')){_0x333808[_0x0a9e('0xc')]('hangup');return;}if(_0x307b3e['substring'](0x0,0xb)=='520-Invalid'){_0x2ab90b=!![];}if(_0x2ab90b){_0x991246['rx']+=_0x307b3e+'\x0a';if(_0x307b3e['search'](_0x0a9e('0xd'))!=-0x1){_0x2ab90b=![];}}else{_0x991246['rx']=_0x307b3e;}if(_0x2ab90b){return;}if(typeof _0x991246['cb']==_0x0a9e('0xe')){var _0xd5b662=_0x991246['rx'][_0x0a9e('0xf')](0x0,0x3),_0x26d672=null,_0x32d742=null;_0xd5b662=parseInt(_0xd5b662);if(isNaN(_0xd5b662)){_0x991246['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xd5b662!=0xc8){_0x991246['cb'](null,{'code':_0xd5b662,'result':-0x1,'extra':'KO'});return;}_0x26d672=_0x991246['rx'][_0x0a9e('0xf')](0x4)[_0x0a9e('0x10')](_0x0a9e('0x11'),'');if(_0x26d672[_0x0a9e('0x12')]('\x20')!=-0x1){_0x26d672=_0x26d672[_0x0a9e('0x13')](0x0,_0x26d672[_0x0a9e('0x12')]('\x20'));}if(_['startsWith'](_0x26d672,'-1')){_0x26d672=parseInt(_0x26d672);}_0x32d742=_0x991246['rx'][_0x0a9e('0x14')]('\x20');if(_0x32d742['length']==0x3){_0x32d742=_0x32d742[0x2][_0x0a9e('0xf')](0x1,_0x32d742[0x2]['length']-0x1);}else if(_0x32d742[_0x0a9e('0x15')]>0x3){var _0x12066b=/\((.+)\)/;var _0x48f32d=_0x991246['rx'][_0x0a9e('0x16')](_0x12066b);if(_0x48f32d){_0x32d742=_0x48f32d[0x1];}else{_0x32d742=null;}}else{_0x32d742=null;}_0x991246['cb'](null,{'code':_0xd5b662,'result':_0x26d672,'extra':_0x32d742});}});_0x4ce2f1['on']('error',function(_0x459eb1){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x17'),new AGIError(_0x0a9e('0x18'),_0x459eb1[_0x0a9e('0x19')]));});_0x4ce2f1['on'](_0x0a9e('0x1a'),function(){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x1a'),new AGIError(_0x0a9e('0x1b')));});_0x4ce2f1['on'](_0x0a9e('0x1c'),function(){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4ce2f1[_0x0a9e('0x1d')]();});_0x4ce2f1[_0x0a9e('0x1e')](_0x432180);this['command']=function(_0x20f109,_0x5a09ef){var _0x20f109=_0x20f109||'',_0x5a09ef=typeof _0x5a09ef==_0x0a9e('0xe')?_0x5a09ef:new Function();_0x991246={'tx':_0x20f109,'rx':'','cb':_0x5a09ef};_0x4ce2f1[_0x0a9e('0x1f')](_0x20f109+'\x0a');},this[_0x0a9e('0x1a')]=function(){_0x4ce2f1['destroy']();};}util[_0x0a9e('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x22')]=function(_0x4d00e6){return this[_0x0a9e('0x23')][_0x0a9e('0x24')](this,_0x4d00e6);};AGIChannel[_0x0a9e('0x21')]['answer']=function(){return this['sendRequest'](_0x0a9e('0x25'));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x26')]=function(_0x33161b,_0x526cf3,_0x384319){_0x33161b=_0x33161b===undefined?'beep':_0x33161b;_0x526cf3=_0x526cf3===undefined?'5':_0x526cf3;_0x384319=_0x384319===undefined?'1':_0x384319;return this[_0x0a9e('0x22')](util['format'](_0x0a9e('0x27'),_0x33161b,_0x526cf3*0x3e8,_0x384319));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x28')]=function(_0x14433c){_0x14433c=_0x14433c||_0x0a9e('0x29');return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x14433c));};AGIChannel['prototype'][_0x0a9e('0x2c')]=function(_0x468813,_0x2b1f27){if(_[_0x0a9e('0x2d')](_0x2b1f27)){return this['sendRequest'](util[_0x0a9e('0x2a')](_0x0a9e('0x2e'),_0x468813,_0x2b1f27[_0x0a9e('0x2f')](',')));}return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x2e'),_0x468813,_0x2b1f27));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x30')]=function(_0x1dbde2){return this['sendRequest'](util[_0x0a9e('0x2a')]('SET\x20CONTEXT\x20%s',_0x1dbde2));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x31')]=function(_0x1122db){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SET\x20EXTENSION\x20%s',_0x1122db));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x32')]=function(_0x40cb85){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x33'),_0x40cb85));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0xb')]=function(){return this['sendRequest'](_0x0a9e('0x34'));};AGIChannel['prototype'][_0x0a9e('0x35')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41=_['isBoolean'](_0x2b7e7f)||_[_0x0a9e('0x36')](_0x2b7e7f)?_0x2b7e7f[_0x0a9e('0x37')]():_0x2b7e7f;return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x14b13f,_0x3f3d41?_0x3f3d41['toString']()[_0x0a9e('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){return this[_0x0a9e('0x22')](util['format'](_0x0a9e('0x39'),_0x3d9717,_0x381c37));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x3a')]=function(_0x533942,_0x1dbf74){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x533942,_0x1dbf74));};AGIChannel['prototype'][_0x0a9e('0x3b')]=function(_0x40d766,_0x5adda1){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x3c'),_0x40d766,_0x5adda1));};AGIChannel[_0x0a9e('0x21')]['continueAt']=function(_0x5a594b,_0x15e37d,_0x45b3d0){_0x15e37d=_0x15e37d||this['extension'];_0x45b3d0=_0x45b3d0||0x1;this[_0x0a9e('0x30')](_0x5a594b);this[_0x0a9e('0x31')](_0x15e37d);this[_0x0a9e('0x32')](_0x45b3d0);return this['noop'](util[_0x0a9e('0x2a')](_0x0a9e('0x3d'),_0x5a594b,_0x15e37d,_0x45b3d0));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x3e')]=function(_0x13cb1f){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x3f'),_0x13cb1f));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x40')]=function(_0x2c3711,_0x148007,_0x1a7bce,_0x11ca30,_0x37f6cc,_0x4d04c8){_0x148007=_0x148007||'wav';_0x1a7bce=_0x1a7bce||'';_0x11ca30=_0x11ca30===undefined?-0x1:_0x11ca30==='-1'?-0x1:_0x11ca30*0x3e8;_0x37f6cc=_0x37f6cc===undefined?'':'s='+_0x37f6cc;_0x4d04c8=_0x4d04c8?_0x0a9e('0x41'):'';return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x42'),_0x2c3711,_0x148007,_0x1a7bce,_0x11ca30,_0x4d04c8,_0x37f6cc));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x43')]=function(_0x10b040,_0x445e25){_0x445e25=_0x445e25||'';return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x44'),_0x10b040,_0x445e25));};AGIChannel[_0x0a9e('0x21')]['agi']=function(_0x117c99){return this[_0x0a9e('0x2c')](_0x0a9e('0x45'),_0x117c99);};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x46')]=function(_0xbe9d19){return this[_0x0a9e('0x2c')](_0x0a9e('0x47'),_0xbe9d19);};AGIChannel['prototype'][_0x0a9e('0x17')]=function(_0x48fd45,_0x473dc8){this[_0x0a9e('0x28')](util[_0x0a9e('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x48fd45['id'],_0x48fd45[_0x0a9e('0x48')],_0x473dc8));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0a9e('0x49')]=AGIChannel; \ No newline at end of file +var _0x70e0=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','wav','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','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./error','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','substr','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','command','sync','answer','getData','sendRequest'];(function(_0x57536d,_0x41362c){var _0x1d084c=function(_0x32e73a){while(--_0x32e73a){_0x57536d['push'](_0x57536d['shift']());}};_0x1d084c(++_0x41362c);}(_0x70e0,0x17b));var _0x070e=function(_0x24b0c7,_0x342001){_0x24b0c7=_0x24b0c7-0x0;var _0x5f2460=_0x70e0[_0x24b0c7];return _0x5f2460;};'use strict';var util=require(_0x070e('0x0'));var _=require(_0x070e('0x1'));var EventEmitter=require(_0x070e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x070e('0x3'));function AGIChannel(_0xee173){var _0x277d32=this,_0x2593e5=new AGIReply(),_0x5c90fc=![],_0x7bce9b={};EventEmitter['call'](_0x277d32);_0xee173[_0x070e('0x4')]('utf8');_0xee173['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2593e5['setEncoding'](_0x070e('0x5'));_0x2593e5['on'](_0x070e('0x6'),function(_0x604664){for(var _0x2611e6 in _0x604664){_0x277d32[_0x2611e6]=_0x604664[_0x2611e6];}_0x277d32[_0x070e('0x7')](_0x070e('0x8'));});_0x2593e5['on'](_0x070e('0x9'),function(_0x4e99e6){if(_0x4e99e6['toLowerCase']()==_0x070e('0xa')){_0x277d32[_0x070e('0x7')](_0x070e('0xa'));return;}if(_0x4e99e6[_0x070e('0xb')](0x0,0xb)==_0x070e('0xc')){_0x5c90fc=!![];}if(_0x5c90fc){_0x7bce9b['rx']+=_0x4e99e6+'\x0a';if(_0x4e99e6[_0x070e('0xd')](_0x070e('0xe'))!=-0x1){_0x5c90fc=![];}}else{_0x7bce9b['rx']=_0x4e99e6;}if(_0x5c90fc){return;}if(typeof _0x7bce9b['cb']==_0x070e('0xf')){var _0x39d2b9=_0x7bce9b['rx']['substring'](0x0,0x3),_0x5bf079=null,_0x2930b8=null;_0x39d2b9=parseInt(_0x39d2b9);if(isNaN(_0x39d2b9)){_0x7bce9b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x39d2b9!=0xc8){_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':-0x1,'extra':'KO'});return;}_0x5bf079=_0x7bce9b['rx'][_0x070e('0xb')](0x4)['replace']('result=','');if(_0x5bf079['indexOf']('\x20')!=-0x1){_0x5bf079=_0x5bf079[_0x070e('0x10')](0x0,_0x5bf079[_0x070e('0x11')]('\x20'));}if(_['startsWith'](_0x5bf079,'-1')){_0x5bf079=parseInt(_0x5bf079);}_0x2930b8=_0x7bce9b['rx']['split']('\x20');if(_0x2930b8[_0x070e('0x12')]==0x3){_0x2930b8=_0x2930b8[0x2][_0x070e('0xb')](0x1,_0x2930b8[0x2][_0x070e('0x12')]-0x1);}else if(_0x2930b8[_0x070e('0x12')]>0x3){var _0x5bc71e=/\((.+)\)/;var _0x49861b=_0x7bce9b['rx'][_0x070e('0x13')](_0x5bc71e);if(_0x49861b){_0x2930b8=_0x49861b[0x1];}else{_0x2930b8=null;}}else{_0x2930b8=null;}_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':_0x5bf079,'extra':_0x2930b8});}});_0xee173['on'](_0x070e('0x14'),function(_0x38f6e6){_0x277d32[_0x070e('0x7')](_0x070e('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x38f6e6[_0x070e('0x15')]));});_0xee173['on'](_0x070e('0x16'),function(){_0x277d32[_0x070e('0x7')](_0x070e('0x16'),new AGIError(_0x070e('0x17')));});_0xee173['on']('timeout',function(){_0x277d32['emit']('timeout',new AGIError(_0x070e('0x18')));_0xee173[_0x070e('0x19')]();});_0xee173[_0x070e('0x1a')](_0x2593e5);this['command']=function(_0x5b184,_0x5dc5d2){var _0x5b184=_0x5b184||'',_0x5dc5d2=typeof _0x5dc5d2==_0x070e('0xf')?_0x5dc5d2:new Function();_0x7bce9b={'tx':_0x5b184,'rx':'','cb':_0x5dc5d2};_0xee173[_0x070e('0x1b')](_0x5b184+'\x0a');},this[_0x070e('0x16')]=function(){_0xee173[_0x070e('0x19')]();};}util[_0x070e('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x070e('0x1d')]['sendRequest']=function(_0x2f8055){return this[_0x070e('0x1e')][_0x070e('0x1f')](this,_0x2f8055);};AGIChannel['prototype'][_0x070e('0x20')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x070e('0x1d')][_0x070e('0x21')]=function(_0x41deb1,_0x1743cc,_0x4763c6){_0x41deb1=_0x41deb1===undefined?'beep':_0x41deb1;_0x1743cc=_0x1743cc===undefined?'5':_0x1743cc;_0x4763c6=_0x4763c6===undefined?'1':_0x4763c6;return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x24'),_0x41deb1,_0x1743cc*0x3e8,_0x4763c6));};AGIChannel[_0x070e('0x1d')][_0x070e('0x25')]=function(_0x28d7f2){_0x28d7f2=_0x28d7f2||_0x070e('0x26');return this[_0x070e('0x22')](util['format'](_0x070e('0x27'),_0x28d7f2));};AGIChannel[_0x070e('0x1d')][_0x070e('0x28')]=function(_0x56fc12,_0x5c5f0d){if(_[_0x070e('0x29')](_0x5c5f0d)){return this[_0x070e('0x22')](util[_0x070e('0x23')]('EXEC\x20%s\x20%s',_0x56fc12,_0x5c5f0d[_0x070e('0x2a')](',')));}return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2b'),_0x56fc12,_0x5c5f0d));};AGIChannel['prototype']['setContext']=function(_0x523b75){return this['sendRequest'](util[_0x070e('0x23')]('SET\x20CONTEXT\x20%s',_0x523b75));};AGIChannel[_0x070e('0x1d')][_0x070e('0x2c')]=function(_0x4f8130){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x2d'),_0x4f8130));};AGIChannel['prototype']['setPriority']=function(_0x41ade4){return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2e'),_0x41ade4));};AGIChannel[_0x070e('0x1d')]['hangup']=function(){return this['sendRequest'](_0x070e('0x2f'));};AGIChannel[_0x070e('0x1d')][_0x070e('0x30')]=function(_0xf57ed,_0xf11439){var _0x4deaf8=_[_0x070e('0x31')](_0xf11439)||_[_0x070e('0x32')](_0xf11439)?_0xf11439['toString']():_0xf11439;return this[_0x070e('0x22')](util[_0x070e('0x23')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xf57ed,_0x4deaf8?_0x4deaf8['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x070e('0x1d')][_0x070e('0x33')]=function(_0x39dfaa,_0x334733){return this[_0x070e('0x22')](util['format'](_0x070e('0x34'),_0x39dfaa,_0x334733));};AGIChannel[_0x070e('0x1d')][_0x070e('0x35')]=function(_0x487276,_0x268c5d){return this[_0x070e('0x22')](util[_0x070e('0x23')]('SAY\x20DIGITS\x20%s\x20%s',_0x487276,_0x268c5d));};AGIChannel[_0x070e('0x1d')][_0x070e('0x36')]=function(_0x4800a9,_0x173602){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x37'),_0x4800a9,_0x173602));};AGIChannel[_0x070e('0x1d')][_0x070e('0x38')]=function(_0xd03404,_0x47b929,_0xd18220){_0x47b929=_0x47b929||this['extension'];_0xd18220=_0xd18220||0x1;this['setContext'](_0xd03404);this[_0x070e('0x2c')](_0x47b929);this[_0x070e('0x39')](_0xd18220);return this[_0x070e('0x25')](util['format'](_0x070e('0x3a'),_0xd03404,_0x47b929,_0xd18220));};AGIChannel[_0x070e('0x1d')][_0x070e('0x3b')]=function(_0x7dc240){return this['sendRequest'](util[_0x070e('0x23')]('GET\x20VARIABLE\x20\x22%s\x22',_0x7dc240));};AGIChannel['prototype']['recordFile']=function(_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x34f23e,_0x562aa4){_0x926533=_0x926533||_0x070e('0x3c');_0x26b3e2=_0x26b3e2||'';_0x29dccd=_0x29dccd===undefined?-0x1:_0x29dccd==='-1'?-0x1:_0x29dccd*0x3e8;_0x34f23e=_0x34f23e===undefined?'':'s='+_0x34f23e;_0x562aa4=_0x562aa4?'BEEP':'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3d'),_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x562aa4,_0x34f23e));};AGIChannel['prototype']['streamFile']=function(_0x261a27,_0x5ee4b8){_0x5ee4b8=_0x5ee4b8||'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3e'),_0x261a27,_0x5ee4b8));};AGIChannel['prototype'][_0x070e('0x3f')]=function(_0x20a1ee){return this['exec']('AGI',_0x20a1ee);};AGIChannel[_0x070e('0x1d')][_0x070e('0x40')]=function(_0x2d43ce){return this[_0x070e('0x28')](_0x070e('0x41'),_0x2d43ce);};AGIChannel['prototype'][_0x070e('0x14')]=function(_0x3f6c64,_0x427fa7){this[_0x070e('0x25')](util[_0x070e('0x23')](_0x070e('0x42'),_0x3f6c64['id'],_0x3f6c64[_0x070e('0x43')],_0x427fa7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x070e('0x44')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 9f82fd5..349e58c 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 _0x2f74=['format','apply','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x2f74,0xb7));var _0x42f7=function(_0x38b0a1,_0x29da11){_0x38b0a1=_0x38b0a1-0x0;var _0x27d217=_0x2f74[_0x38b0a1];return _0x27d217;};'use strict';var util=require(_0x42f7('0x0'));var error={'E_AGI_UNDEFINED':_0x42f7('0x1'),'E_AGI_ARGUMENT_PORT':_0x42f7('0x2'),'E_AGI_SERVER_ERROR':_0x42f7('0x3'),'E_AGI_SERVER_CLOSE':_0x42f7('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x42f7('0x5'),'E_AGI_SOCKET_ERROR':_0x42f7('0x6'),'E_AGI_SOCKET_CLOSE':_0x42f7('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x42f7('0x8'),'E_AGI_IVR_ENTRY':_0x42f7('0x9')};function AGIError(_0x194f53){var _0x194f53=_0x194f53||null,_0x2f114a=_0x2f114a||[],_0x4848ac=0x1,_0x346d22='';if(!error[_0x194f53]){_0x194f53=_0x42f7('0xa');}_0x2f114a[_0x42f7('0xb')](error[_0x194f53]);while(arguments[_0x4848ac]){_0x2f114a[_0x42f7('0xb')](arguments[_0x4848ac]);_0x4848ac++;}_0x346d22=util[_0x42f7('0xc')][_0x42f7('0xd')](util,_0x2f114a);this['message']=_0x346d22;this[_0x42f7('0xe')]=_0x194f53;}module['exports']=AGIError; \ No newline at end of file +var _0x6e0d=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20timeout.','E_AGI_UNDEFINED','push','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x6e0d,0x11c));var _0xd6e0=function(_0x46a454,_0xea225d){_0x46a454=_0x46a454-0x0;var _0x584e2d=_0x6e0d[_0x46a454];return _0x584e2d;};'use strict';var util=require(_0xd6e0('0x0'));var error={'E_AGI_UNDEFINED':_0xd6e0('0x1'),'E_AGI_ARGUMENT_PORT':_0xd6e0('0x2'),'E_AGI_SERVER_ERROR':_0xd6e0('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xd6e0('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xd6e0('0x5'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x97b7c1){var _0x97b7c1=_0x97b7c1||null,_0x30d100=_0x30d100||[],_0x1515da=0x1,_0x22ce6d='';if(!error[_0x97b7c1]){_0x97b7c1=_0xd6e0('0x6');}_0x30d100[_0xd6e0('0x7')](error[_0x97b7c1]);while(arguments[_0x1515da]){_0x30d100[_0xd6e0('0x7')](arguments[_0x1515da]);_0x1515da++;}_0x22ce6d=util['format'][_0xd6e0('0x8')](util,_0x30d100);this[_0xd6e0('0x9')]=_0x22ce6d;this[_0xd6e0('0xa')]=_0x97b7c1;}module[_0xd6e0('0xb')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 9591ad5..ff0ffb8 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 _0xa571=['edges','addEdge','push','size','relations','numberOfEdges','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','condition','split','length','agicommand','target','default','invalid','vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','vertices','prototype'];(function(_0x32efcb,_0x55523f){var _0x1dae88=function(_0x11c606){while(--_0x11c606){_0x32efcb['push'](_0x32efcb['shift']());}};_0x1dae88(++_0x55523f);}(_0xa571,0x107));var _0x1a57=function(_0x29160f,_0x4b778b){_0x29160f=_0x29160f-0x0;var _0x10282d=_0xa571[_0x29160f];return _0x10282d;};'use strict';var _=require(_0x1a57('0x0'));var logger=require(_0x1a57('0x1'))(_0x1a57('0x2'));var verticesWithRetry=[_0x1a57('0x3'),'getdigits',_0x1a57('0x4')];var Graph=function(){this[_0x1a57('0x5')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph[_0x1a57('0x6')]['addVertex']=function(_0xa58922){this[_0x1a57('0x5')][_0xa58922['id']]=_0xa58922;this[_0x1a57('0x7')][_0xa58922['id']]=[];};Graph[_0x1a57('0x6')][_0x1a57('0x8')]=function(_0x924873,_0x5d9f45,_0x3edb40){this[_0x1a57('0x7')][_0x924873][_0x1a57('0x9')]({'target':_0x5d9f45,'condition':_0x3edb40});this['numberOfEdges']+=0x1;};Graph[_0x1a57('0x6')][_0x1a57('0xa')]=function(){return _[_0x1a57('0xa')](this[_0x1a57('0x5')]);};Graph[_0x1a57('0x6')][_0x1a57('0xb')]=function(){return this[_0x1a57('0xc')];};Graph[_0x1a57('0x6')]['getVertex']=function(_0x562fa4){return this[_0x1a57('0x5')][_0x562fa4];};Graph[_0x1a57('0x6')][_0x1a57('0xd')]=function(_0x5ae643,_0x3de36a){if(!this[_0x1a57('0x5')][_0x5ae643]){return logger['info'](_0x1a57('0xe'));}var _0x587422=_0x3de36a(this[_0x1a57('0x5')][_0x5ae643]);if(!_0x587422){return logger[_0x1a57('0xf')](_0x1a57('0x10'));}if(this[_0x1a57('0x7')][_0x5ae643]['length']===0x0){return logger[_0x1a57('0xf')]('no\x20edge/s\x20available');}for(var _0x49ee05=0x0,_0x1b58d7=[],_0x1c537f=![];_0x49ee05\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','getSquareProject','catch','createSquareReport','indexOf','agi_','inspect','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','hangup','sync','production','start','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','debug','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','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'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x029b,0x66));var _0xb029=function(_0x135e9b,_0x2642d9){_0x135e9b=_0x135e9b-0x0;var _0x3555e0=_0x029b[_0x135e9b];return _0x3555e0;};'use strict';var parser=require(_0xb029('0x0'));var _=require(_0xb029('0x1'));var syncho=require('syncho');var util=require(_0xb029('0x2'));var moment=require(_0xb029('0x3'));var config=require('../../config/environment');var logger=require(_0xb029('0x4'))(_0xb029('0x5'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0xb029('0x6'));var Graph=require(_0xb029('0x7'));var Vertices=require(_0xb029('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xb029('0x5')]=_[_0xb029('0x9')](config['agi'],{'ip':_0xb029('0xa'),'port':0x11dd});function connectionHandler(_0x48b3d0){process[_0xb029('0xb')](function(){syncho(function(){try{setChannelVariables(_0x48b3d0);agiHandler(_0x48b3d0);}catch(_0x480ead){logger[_0xb029('0xc')](_0x480ead['stack']);}});});}function listeningHandler(){console[_0xb029('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xb029('0x5')][_0xb029('0xe')]);logger['info'](util[_0xb029('0xf')](_0xb029('0x10'),config[_0xb029('0x5')]['ip'],config[_0xb029('0x5')][_0xb029('0xe')]));}function errorHandler(_0x498b6a){if(_0x498b6a&&_0x498b6a[_0xb029('0x11')]&&_0x498b6a['message']){logger[_0xb029('0xc')](util[_0xb029('0xf')](_0xb029('0x12'),_0x498b6a[_0xb029('0x11')],_0x498b6a['message']));}else{logger[_0xb029('0xc')](util[_0xb029('0xf')](_0xb029('0x13'),_0x498b6a['stack']));}}function closeHandler(){logger[_0xb029('0x14')](util[_0xb029('0xf')](_0xb029('0x15'),this[_0xb029('0x16')],this[_0xb029('0x17')],this[_0xb029('0x18')],this[_0xb029('0x19')],this[_0xb029('0x1a')]));try{createSquareReport(this);}catch(_0x3f91cb){logger['error'](_0x3f91cb['stack']);}}function timeoutHandler(){logger[_0xb029('0x14')](util['format'](_0xb029('0x1b'),this[_0xb029('0x16')],this[_0xb029('0x17')],this['callerid'],this['dnid'],this[_0xb029('0x1a')]));}function hangupHandler(){logger[_0xb029('0x14')](util[_0xb029('0xf')](_0xb029('0x1c'),this[_0xb029('0x16')],this[_0xb029('0x17')],this['callerid'],this['dnid'],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x3e1dc4){return parser[_0xb029('0x1d')](_0x3e1dc4,{'object':!![]})[_0xb029('0x1e')][_0xb029('0x1f')];}function addVertex(_0x500bb6,_0x3642b5,_0x379ef3){_0x3642b5[_0xb029('0x20')]=_0x379ef3;if(_0x3642b5[_0xb029('0x21')](_0xb029('0x22'))){_0x3642b5[_0xb029('0x23')]=parseInt(_0x3642b5[_0xb029('0x22')],0xa);}_0x500bb6[_0xb029('0x24')](_[_0xb029('0x25')](_0x3642b5,_0xb029('0x26')));}function initGraph(_0xd9206b,_0x22dccd){var _0x279e4a=new Graph();for(var _0x599a14 in _0xd9206b){if(_0xd9206b[_0xb029('0x21')](_0x599a14)){if(_[_0xb029('0x27')](_0xd9206b[_0x599a14])){for(var _0x47f874=0x0;_0x47f874<_0xd9206b[_0x599a14]['length'];_0x47f874+=0x1){addVertex(_0x279e4a,_0xd9206b[_0x599a14][_0x47f874],_0x599a14);}}else{addVertex(_0x279e4a,_0xd9206b[_0x599a14],_0x599a14);}}}for(var _0x112ce9=0x0;_0x112ce9<_0x22dccd[_0xb029('0x28')];_0x112ce9+=0x1){if(_0x22dccd[_0x112ce9][_0xb029('0x29')]&&_0x22dccd[_0x112ce9][_0xb029('0x2a')]){_0x279e4a[_0xb029('0x2b')](_0x22dccd[_0x112ce9]['source'],_0x22dccd[_0x112ce9][_0xb029('0x2a')],_0x22dccd[_0x112ce9]['value']);}}return _0x279e4a;}function getSquareProject(_0x2b2d98,_0x6960fb){rpc[_0xb029('0x2c')](_0x2b2d98)['then'](function(_0x1aa94b){_0x6960fb(null,_0x1aa94b);})[_0xb029('0x2d')](function(_0x59bf9d){_0x6960fb(null,_0x59bf9d);});}function createSquareReport(_0x236217,_0x4d9e7e){rpc[_0xb029('0x2e')](_0x236217)['then'](function(_0x88a69b){if(_0x4d9e7e){_0x4d9e7e(null,_0x88a69b);}})[_0xb029('0x2d')](function(_0x392d0f){if(_0x4d9e7e){_0x4d9e7e(null,_0x392d0f);}});}function setChannelVariables(_0x2324f3){for(var _0x2812b7 in _0x2324f3){if(_0x2324f3[_0xb029('0x21')](_0x2812b7)){if(_0x2812b7[_0xb029('0x2f')](_0xb029('0x30'))===0x0){_0x2324f3[_0x2812b7['substring'](0x4)]=_0x2324f3[_0x2812b7];delete _0x2324f3[_0x2812b7];}}}}function getLogFromObject(_0x2d87c1){return util[_0xb029('0x31')](_0x2d87c1,{'showHidden':![],'depth':null});}function agiHandler(_0x130663){var _0x53753a,_0x4390e4,_0x2b0f6b,_0x5f4688,_0x2f17b0;logger['debug'](_0xb029('0x32'),JSON['stringify'](_0x130663,null,0x2));logger[_0xb029('0x14')](util[_0xb029('0xf')](_0xb029('0x33'),_0x130663[_0xb029('0x16')],_0x130663[_0xb029('0x17')],_0x130663[_0xb029('0x18')],_0x130663[_0xb029('0x19')],_0x130663['uniqueid']));_0x130663['on'](_0xb029('0xc'),errorHandler);_0x130663['on'](_0xb029('0x34'),closeHandler);_0x130663['on']('timeout',timeoutHandler);_0x130663[_0xb029('0x35')]=![];_0x130663['on'](_0xb029('0x36'),hangupHandler);var _0x35105c=getSquareProject[_0xb029('0x37')](null,_0x130663['arg_1']);if(_0x35105c){if(_0x35105c[_0xb029('0x38')]){_0x53753a=getRoot(_0x35105c[_0xb029('0x38')]);if(_0x53753a&&_0x53753a[_0xb029('0x39')]){logger['debug'](_0xb029('0x1f'),JSON[_0xb029('0x3a')](_0x53753a,null,0x2));_0x130663[_0xb029('0x3b')]=moment()[_0xb029('0xf')](_0xb029('0x3c'));_0x4390e4=initGraph(_[_0xb029('0x25')](_0x53753a,_0xb029('0x26')),_0x53753a[_0xb029('0x26')]);_0x2b0f6b=new Vertices(_0x130663,rpc,mailRpc);logger[_0xb029('0x14')](util[_0xb029('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x130663[_0xb029('0x16')],_0x130663[_0xb029('0x17')],_0x130663[_0xb029('0x18')],_0x130663['dnid'],_0x130663['uniqueid']));_0x4390e4['traverseBFS'](_0x53753a[_0xb029('0x39')]['id'],function(_0x41a857){try{_0x41a857=_0x2b0f6b['clear'](_0x41a857);logger[_0xb029('0x3d')](_0xb029('0x3e'),JSON[_0xb029('0x3a')](_0x41a857,null,0x2));if(_0x41a857[_0xb029('0x20')]===_0xb029('0x3f')){logger['info'](_0xb029('0x40'));_0x130663[_0xb029('0x41')]=_0x41a857['context']||_0x130663[_0xb029('0x41')];_0x130663[_0xb029('0x42')]=_0x41a857[_0xb029('0x42')];_0x130663['priority']=_0x41a857[_0xb029('0x43')]?_0x41a857[_0xb029('0x43')]-0x1:0x1;return null;}else if(_0x41a857&&_0x2b0f6b[_0x41a857['agicommand']]){_0x2f17b0=_0x2b0f6b[_0x41a857['agicommand']](_0x41a857);logger[_0xb029('0x14')](_0xb029('0x44'),JSON[_0xb029('0x3a')](_0x2f17b0,null,0x2));if(_0x2f17b0&&_0x2f17b0[_0xb029('0x45')]===AGI_CODE_SUCCESS&&_0x2f17b0['result']!==AGI_RESULT_ERROR&&!_0x130663['evtHangup']){logger[_0xb029('0x3d')]('response',getLogFromObject(_0x2f17b0));return _[_0xb029('0x46')](_0x2f17b0['result'])?null:_0x2f17b0[_0xb029('0x47')][_0xb029('0x48')]();}else{logger[_0xb029('0xc')](_0xb029('0x44'),getLogFromObject(_0x2f17b0));return null;}}else{logger[_0xb029('0xc')](_0xb029('0x49'));return null;}}catch(_0x5f294b){logger[_0xb029('0xc')](_0x5f294b['stack']);return null;}});if(_0x53753a['finally']){logger[_0xb029('0x14')](util['format'](_0xb029('0x4a'),_0x130663['arg_1'],_0x130663[_0xb029('0x17')],_0x130663[_0xb029('0x18')],_0x130663[_0xb029('0x19')],_0x130663[_0xb029('0x1a')]));_0x4390e4['traverseBFS'](_0x53753a[_0xb029('0x4b')]['id'],function(_0x43adce){try{_0x43adce=_0x2b0f6b[_0xb029('0x4c')](_0x43adce);logger[_0xb029('0x3d')](_0xb029('0x3e'),JSON[_0xb029('0x3a')](_0x43adce,null,0x2));if(_0x43adce&&_0x2b0f6b[_0x43adce[_0xb029('0x20')]]){_0x2f17b0=_0x2b0f6b[_0x43adce[_0xb029('0x20')]](_0x43adce);if(_0x2f17b0){logger[_0xb029('0x3d')](_0xb029('0x44'),getLogFromObject(_0x2f17b0));return _['isUndefined'](_0x2f17b0[_0xb029('0x47')])?null:_0x2f17b0[_0xb029('0x47')][_0xb029('0x48')]();}else{logger[_0xb029('0xc')]('response',getLogFromObject(_0x2f17b0));return null;}}else{logger[_0xb029('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x5f6e93){logger[_0xb029('0xc')](_0x5f6e93[_0xb029('0x4d')]);return null;}});}logger[_0xb029('0x14')](util[_0xb029('0xf')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x130663['arg_1'],_0x130663[_0xb029('0x17')],_0x130663[_0xb029('0x18')],_0x130663[_0xb029('0x19')],_0x130663[_0xb029('0x1a')]));logger[_0xb029('0x14')](util[_0xb029('0xf')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x130663[_0xb029('0x41')],_0x130663[_0xb029('0x42')],parseInt(_0x130663[_0xb029('0x43')],0xa)+0x1));_0x130663['continueAt'](_0x130663['context'],_0x130663[_0xb029('0x42')],parseInt(_0x130663['priority'],0xa)+0x1);_0x130663[_0xb029('0x34')]();}}else{logger[_0xb029('0xc')](util[_0xb029('0xf')]('Project\x20%s\x20not\x20published',_0x130663[_0xb029('0x16')]));_0x130663[_0xb029('0x4e')](_0x130663['context'],_0x130663[_0xb029('0x42')],parseInt(_0x130663[_0xb029('0x43')],0xa)+0x1);_0x130663[_0xb029('0x34')]();}}else{logger['error'](util[_0xb029('0xf')](_0xb029('0x4f'),_0x130663[_0xb029('0x16')]));_0x130663[_0xb029('0x4e')](_0x130663['context'],_0x130663[_0xb029('0x42')],parseInt(_0x130663[_0xb029('0x43')],0xa)+0x1);_0x130663[_0xb029('0x34')]();}}function main(){var _0x49294c;return utilLicense[_0xb029('0x50')]()['then'](function(_0x7dbf28){if(_0x7dbf28){if(_0x7dbf28[_0xb029('0x51')]){if(_0x7dbf28[_0xb029('0x52')]&&_0x7dbf28[_0xb029('0x52')]>0x0){logger[_0xb029('0x14')](util[_0xb029('0xf')](_0xb029('0x53'),_0x7dbf28['callysquare']));_0x49294c=_0x7dbf28['callysquare'];}else{logger['info'](_0xb029('0x54'));}}else{logger[_0xb029('0x14')](_0xb029('0x55'));_0x49294c=-0x1;}}})[_0xb029('0x2d')](function(_0x307c5d){logger['error'](_0xb029('0x56'),_0x307c5d[_0xb029('0x4d')]);})[_0xb029('0x4b')](function(){var _0x1ef398=require('./server')(config[_0xb029('0x5')][_0xb029('0xe')],config[_0xb029('0x5')]['ip'],_0x49294c);_0x1ef398['on'](_0xb029('0xc'),errorHandler);_0x1ef398['on'](_0xb029('0x57'),listeningHandler);_0x1ef398['on'](_0xb029('0x58'),connectionHandler);_0x1ef398['on'](_0xb029('0x34'),closeHandler);});}main(); \ No newline at end of file +var _0x029b=['clear','stack','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','listening','connection','xml2json','lodash','util','moment','../../config/logger','agi','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','log','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[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','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','getSquareProject','catch','createSquareReport','indexOf','agi_','inspect','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','hangup','sync','production','start','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','debug','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x029b,0x66));var _0xb029=function(_0x10c881,_0x5e6a3c){_0x10c881=_0x10c881-0x0;var _0x200e05=_0x029b[_0x10c881];return _0x200e05;};'use strict';var parser=require(_0xb029('0x0'));var _=require(_0xb029('0x1'));var syncho=require('syncho');var util=require(_0xb029('0x2'));var moment=require(_0xb029('0x3'));var config=require('../../config/environment');var logger=require(_0xb029('0x4'))(_0xb029('0x5'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0xb029('0x6'));var Graph=require(_0xb029('0x7'));var Vertices=require(_0xb029('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xb029('0x5')]=_[_0xb029('0x9')](config['agi'],{'ip':_0xb029('0xa'),'port':0x11dd});function connectionHandler(_0x48b3d0){process[_0xb029('0xb')](function(){syncho(function(){try{setChannelVariables(_0x48b3d0);agiHandler(_0x48b3d0);}catch(_0x480ead){logger[_0xb029('0xc')](_0x480ead['stack']);}});});}function listeningHandler(){console[_0xb029('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xb029('0x5')][_0xb029('0xe')]);logger['info'](util[_0xb029('0xf')](_0xb029('0x10'),config[_0xb029('0x5')]['ip'],config[_0xb029('0x5')][_0xb029('0xe')]));}function errorHandler(_0x498b6a){if(_0x498b6a&&_0x498b6a[_0xb029('0x11')]&&_0x498b6a['message']){logger[_0xb029('0xc')](util[_0xb029('0xf')](_0xb029('0x12'),_0x498b6a[_0xb029('0x11')],_0x498b6a['message']));}else{logger[_0xb029('0xc')](util[_0xb029('0xf')](_0xb029('0x13'),_0x498b6a['stack']));}}function closeHandler(){logger[_0xb029('0x14')](util[_0xb029('0xf')](_0xb029('0x15'),this[_0xb029('0x16')],this[_0xb029('0x17')],this[_0xb029('0x18')],this[_0xb029('0x19')],this[_0xb029('0x1a')]));try{createSquareReport(this);}catch(_0x3f91cb){logger['error'](_0x3f91cb['stack']);}}function timeoutHandler(){logger[_0xb029('0x14')](util['format'](_0xb029('0x1b'),this[_0xb029('0x16')],this[_0xb029('0x17')],this['callerid'],this['dnid'],this[_0xb029('0x1a')]));}function hangupHandler(){logger[_0xb029('0x14')](util[_0xb029('0xf')](_0xb029('0x1c'),this[_0xb029('0x16')],this[_0xb029('0x17')],this['callerid'],this['dnid'],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x3e1dc4){return parser[_0xb029('0x1d')](_0x3e1dc4,{'object':!![]})[_0xb029('0x1e')][_0xb029('0x1f')];}function addVertex(_0x500bb6,_0x3642b5,_0x379ef3){_0x3642b5[_0xb029('0x20')]=_0x379ef3;if(_0x3642b5[_0xb029('0x21')](_0xb029('0x22'))){_0x3642b5[_0xb029('0x23')]=parseInt(_0x3642b5[_0xb029('0x22')],0xa);}_0x500bb6[_0xb029('0x24')](_[_0xb029('0x25')](_0x3642b5,_0xb029('0x26')));}function initGraph(_0xd9206b,_0x22dccd){var _0x279e4a=new Graph();for(var _0x599a14 in _0xd9206b){if(_0xd9206b[_0xb029('0x21')](_0x599a14)){if(_[_0xb029('0x27')](_0xd9206b[_0x599a14])){for(var _0x47f874=0x0;_0x47f874<_0xd9206b[_0x599a14]['length'];_0x47f874+=0x1){addVertex(_0x279e4a,_0xd9206b[_0x599a14][_0x47f874],_0x599a14);}}else{addVertex(_0x279e4a,_0xd9206b[_0x599a14],_0x599a14);}}}for(var _0x112ce9=0x0;_0x112ce9<_0x22dccd[_0xb029('0x28')];_0x112ce9+=0x1){if(_0x22dccd[_0x112ce9][_0xb029('0x29')]&&_0x22dccd[_0x112ce9][_0xb029('0x2a')]){_0x279e4a[_0xb029('0x2b')](_0x22dccd[_0x112ce9]['source'],_0x22dccd[_0x112ce9][_0xb029('0x2a')],_0x22dccd[_0x112ce9]['value']);}}return _0x279e4a;}function getSquareProject(_0x2b2d98,_0x6960fb){rpc[_0xb029('0x2c')](_0x2b2d98)['then'](function(_0x1aa94b){_0x6960fb(null,_0x1aa94b);})[_0xb029('0x2d')](function(_0x59bf9d){_0x6960fb(null,_0x59bf9d);});}function createSquareReport(_0x236217,_0x4d9e7e){rpc[_0xb029('0x2e')](_0x236217)['then'](function(_0x88a69b){if(_0x4d9e7e){_0x4d9e7e(null,_0x88a69b);}})[_0xb029('0x2d')](function(_0x392d0f){if(_0x4d9e7e){_0x4d9e7e(null,_0x392d0f);}});}function setChannelVariables(_0x2324f3){for(var _0x2812b7 in _0x2324f3){if(_0x2324f3[_0xb029('0x21')](_0x2812b7)){if(_0x2812b7[_0xb029('0x2f')](_0xb029('0x30'))===0x0){_0x2324f3[_0x2812b7['substring'](0x4)]=_0x2324f3[_0x2812b7];delete _0x2324f3[_0x2812b7];}}}}function getLogFromObject(_0x2d87c1){return util[_0xb029('0x31')](_0x2d87c1,{'showHidden':![],'depth':null});}function agiHandler(_0x130663){var _0x53753a,_0x4390e4,_0x2b0f6b,_0x5f4688,_0x2f17b0;logger['debug'](_0xb029('0x32'),JSON['stringify'](_0x130663,null,0x2));logger[_0xb029('0x14')](util[_0xb029('0xf')](_0xb029('0x33'),_0x130663[_0xb029('0x16')],_0x130663[_0xb029('0x17')],_0x130663[_0xb029('0x18')],_0x130663[_0xb029('0x19')],_0x130663['uniqueid']));_0x130663['on'](_0xb029('0xc'),errorHandler);_0x130663['on'](_0xb029('0x34'),closeHandler);_0x130663['on']('timeout',timeoutHandler);_0x130663[_0xb029('0x35')]=![];_0x130663['on'](_0xb029('0x36'),hangupHandler);var _0x35105c=getSquareProject[_0xb029('0x37')](null,_0x130663['arg_1']);if(_0x35105c){if(_0x35105c[_0xb029('0x38')]){_0x53753a=getRoot(_0x35105c[_0xb029('0x38')]);if(_0x53753a&&_0x53753a[_0xb029('0x39')]){logger['debug'](_0xb029('0x1f'),JSON[_0xb029('0x3a')](_0x53753a,null,0x2));_0x130663[_0xb029('0x3b')]=moment()[_0xb029('0xf')](_0xb029('0x3c'));_0x4390e4=initGraph(_[_0xb029('0x25')](_0x53753a,_0xb029('0x26')),_0x53753a[_0xb029('0x26')]);_0x2b0f6b=new Vertices(_0x130663,rpc,mailRpc);logger[_0xb029('0x14')](util[_0xb029('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x130663[_0xb029('0x16')],_0x130663[_0xb029('0x17')],_0x130663[_0xb029('0x18')],_0x130663['dnid'],_0x130663['uniqueid']));_0x4390e4['traverseBFS'](_0x53753a[_0xb029('0x39')]['id'],function(_0x41a857){try{_0x41a857=_0x2b0f6b['clear'](_0x41a857);logger[_0xb029('0x3d')](_0xb029('0x3e'),JSON[_0xb029('0x3a')](_0x41a857,null,0x2));if(_0x41a857[_0xb029('0x20')]===_0xb029('0x3f')){logger['info'](_0xb029('0x40'));_0x130663[_0xb029('0x41')]=_0x41a857['context']||_0x130663[_0xb029('0x41')];_0x130663[_0xb029('0x42')]=_0x41a857[_0xb029('0x42')];_0x130663['priority']=_0x41a857[_0xb029('0x43')]?_0x41a857[_0xb029('0x43')]-0x1:0x1;return null;}else if(_0x41a857&&_0x2b0f6b[_0x41a857['agicommand']]){_0x2f17b0=_0x2b0f6b[_0x41a857['agicommand']](_0x41a857);logger[_0xb029('0x14')](_0xb029('0x44'),JSON[_0xb029('0x3a')](_0x2f17b0,null,0x2));if(_0x2f17b0&&_0x2f17b0[_0xb029('0x45')]===AGI_CODE_SUCCESS&&_0x2f17b0['result']!==AGI_RESULT_ERROR&&!_0x130663['evtHangup']){logger[_0xb029('0x3d')]('response',getLogFromObject(_0x2f17b0));return _[_0xb029('0x46')](_0x2f17b0['result'])?null:_0x2f17b0[_0xb029('0x47')][_0xb029('0x48')]();}else{logger[_0xb029('0xc')](_0xb029('0x44'),getLogFromObject(_0x2f17b0));return null;}}else{logger[_0xb029('0xc')](_0xb029('0x49'));return null;}}catch(_0x5f294b){logger[_0xb029('0xc')](_0x5f294b['stack']);return null;}});if(_0x53753a['finally']){logger[_0xb029('0x14')](util['format'](_0xb029('0x4a'),_0x130663['arg_1'],_0x130663[_0xb029('0x17')],_0x130663[_0xb029('0x18')],_0x130663[_0xb029('0x19')],_0x130663[_0xb029('0x1a')]));_0x4390e4['traverseBFS'](_0x53753a[_0xb029('0x4b')]['id'],function(_0x43adce){try{_0x43adce=_0x2b0f6b[_0xb029('0x4c')](_0x43adce);logger[_0xb029('0x3d')](_0xb029('0x3e'),JSON[_0xb029('0x3a')](_0x43adce,null,0x2));if(_0x43adce&&_0x2b0f6b[_0x43adce[_0xb029('0x20')]]){_0x2f17b0=_0x2b0f6b[_0x43adce[_0xb029('0x20')]](_0x43adce);if(_0x2f17b0){logger[_0xb029('0x3d')](_0xb029('0x44'),getLogFromObject(_0x2f17b0));return _['isUndefined'](_0x2f17b0[_0xb029('0x47')])?null:_0x2f17b0[_0xb029('0x47')][_0xb029('0x48')]();}else{logger[_0xb029('0xc')]('response',getLogFromObject(_0x2f17b0));return null;}}else{logger[_0xb029('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x5f6e93){logger[_0xb029('0xc')](_0x5f6e93[_0xb029('0x4d')]);return null;}});}logger[_0xb029('0x14')](util[_0xb029('0xf')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x130663['arg_1'],_0x130663[_0xb029('0x17')],_0x130663[_0xb029('0x18')],_0x130663[_0xb029('0x19')],_0x130663[_0xb029('0x1a')]));logger[_0xb029('0x14')](util[_0xb029('0xf')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x130663[_0xb029('0x41')],_0x130663[_0xb029('0x42')],parseInt(_0x130663[_0xb029('0x43')],0xa)+0x1));_0x130663['continueAt'](_0x130663['context'],_0x130663[_0xb029('0x42')],parseInt(_0x130663['priority'],0xa)+0x1);_0x130663[_0xb029('0x34')]();}}else{logger[_0xb029('0xc')](util[_0xb029('0xf')]('Project\x20%s\x20not\x20published',_0x130663[_0xb029('0x16')]));_0x130663[_0xb029('0x4e')](_0x130663['context'],_0x130663[_0xb029('0x42')],parseInt(_0x130663[_0xb029('0x43')],0xa)+0x1);_0x130663[_0xb029('0x34')]();}}else{logger['error'](util[_0xb029('0xf')](_0xb029('0x4f'),_0x130663[_0xb029('0x16')]));_0x130663[_0xb029('0x4e')](_0x130663['context'],_0x130663[_0xb029('0x42')],parseInt(_0x130663[_0xb029('0x43')],0xa)+0x1);_0x130663[_0xb029('0x34')]();}}function main(){var _0x49294c;return utilLicense[_0xb029('0x50')]()['then'](function(_0x7dbf28){if(_0x7dbf28){if(_0x7dbf28[_0xb029('0x51')]){if(_0x7dbf28[_0xb029('0x52')]&&_0x7dbf28[_0xb029('0x52')]>0x0){logger[_0xb029('0x14')](util[_0xb029('0xf')](_0xb029('0x53'),_0x7dbf28['callysquare']));_0x49294c=_0x7dbf28['callysquare'];}else{logger['info'](_0xb029('0x54'));}}else{logger[_0xb029('0x14')](_0xb029('0x55'));_0x49294c=-0x1;}}})[_0xb029('0x2d')](function(_0x307c5d){logger['error'](_0xb029('0x56'),_0x307c5d[_0xb029('0x4d')]);})[_0xb029('0x4b')](function(){var _0x1ef398=require('./server')(config[_0xb029('0x5')][_0xb029('0xe')],config[_0xb029('0x5')]['ip'],_0x49294c);_0x1ef398['on'](_0xb029('0xc'),errorHandler);_0x1ef398['on'](_0xb029('0x57'),listeningHandler);_0x1ef398['on'](_0xb029('0x58'),connectionHandler);_0x1ef398['on'](_0xb029('0x34'),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 9391361..470e470 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(_0x18dc27,_0x4ed1c5){var _0x20ec3a=function(_0xe791de){while(--_0xe791de){_0x18dc27['push'](_0x18dc27['shift']());}};_0x20ec3a(++_0x4ed1c5);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x34605a,_0x212187){var _0x322668=function(_0x487c08){while(--_0x487c08){_0x34605a['push'](_0x34605a['shift']());}};_0x322668(++_0x212187);}(_0x34e8,0x12c));var _0x834e=function(_0x2d9e64,_0x18610e){_0x2d9e64=_0x2d9e64-0x0;var _0x287363=_0x34e8[_0x2d9e64];return _0x287363;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index a2a2eac..0f479af 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x2fc65f,_0x3be297){var _0x16105a=function(_0x1da866){while(--_0x1da866){_0x2fc65f['push'](_0x2fc65f['shift']());}};_0x16105a(++_0x3be297);}(_0x7a54,0x106));var _0x47a5=function(_0x199630,_0x404239){_0x199630=_0x199630-0x0;var _0x4ebc00=_0x7a54[_0x199630];return _0x4ebc00;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x3972dd,_0x298e3f){var _0x3a29c8=function(_0x461387){while(--_0x461387){_0x3972dd['push'](_0x3972dd['shift']());}};_0x3a29c8(++_0x298e3f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x13b518,_0x4f7109){_0x13b518=_0x13b518-0x0;var _0xea6300=_0x5f2f[_0x13b518];return _0xea6300;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index f1e4987..c76a2e5 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 _0x805a=['result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','lodash','jayson/promise','http','request','then','error','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x805a,0xad));var _0xa805=function(_0x19a028,_0x161bbc){_0x19a028=_0x19a028-0x0;var _0x2822b0=_0x805a[_0x19a028];return _0x2822b0;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xa805('0x0'));var util=require('util');var jayson=require(_0xa805('0x1'));var client=jayson['client'][_0xa805('0x2')]({'port':0x2329});function request(_0x59a160,_0x14e22b){return new BPromise(function(_0x423e62,_0x3b85f3){return client[_0xa805('0x3')](_0x59a160,_0x14e22b)[_0xa805('0x4')](function(_0x30af71){if(_0x30af71['error']){return _0x3b85f3(_0x30af71[_0xa805('0x5')][_0xa805('0x6')]);}else{return _0x423e62(_0x30af71[_0xa805('0x7')]);}})[_0xa805('0x8')](function(_0x36697e){return _0x3b85f3(_0x36697e);});});}exports[_0xa805('0x9')]=function(_0x241c95){return request(_0xa805('0xa'),{'options':{'raw':![],'where':{'name':_0x241c95},'attributes':[_0xa805('0xb')]}});};exports[_0xa805('0xc')]=function(_0x155c5c){return request(_0xa805('0xd'),{'options':{'raw':![],'where':{'id':_0x155c5c},'include':[{'model':_0xa805('0xe'),'as':_0xa805('0xf')}],'attributes':['id',_0xa805('0x10'),_0xa805('0x11')]}});};exports[_0xa805('0x12')]=function(_0x21bbf8){return request(_0xa805('0xa'),{'options':{'where':{'id':_0x21bbf8},'attributes':[_0xa805('0x10')]}});};exports[_0xa805('0x13')]=function(_0x16ced2){return request(_0xa805('0x14'),{'options':{'where':{'id':_0x16ced2},'attributes':['name']}});};exports[_0xa805('0x15')]=function(_0x508ad3){return request(_0xa805('0x16'),{'options':{'where':{'id':_0x508ad3},'attributes':[_0xa805('0x10')]}});};exports[_0xa805('0x17')]=function(_0x440d0b){return request(_0xa805('0x18'),{'options':{'where':{'id':_0x440d0b},'attributes':['dsn']}});};exports[_0xa805('0x19')]=function(_0x2cba15){return request(_0xa805('0x1a'),{'options':{'where':{'id':_0x2cba15},'attributes':[_0xa805('0x10')]}});};exports['getTrunkById']=function(_0x475c91){return request(_0xa805('0x1b'),{'options':{'where':{'id':_0x475c91},'attributes':[_0xa805('0x10')]}});};exports[_0xa805('0x1c')]=function(_0x21d0b7){return request(_0xa805('0x1d'),{'options':{'where':{'id':_0x21d0b7},'attributes':[_0xa805('0x1e')]}});};exports[_0xa805('0x1f')]=function(_0x54fca5){return request(_0xa805('0x20'),{'options':{'raw':![],'where':{'id':_0x54fca5},'include':[{'model':_0xa805('0x21'),'as':_0xa805('0x22')}]}});};exports[_0xa805('0x23')]=function(_0x19f5ae){return request(_0xa805('0x24'),{'options':{'where':{'id':_0x19f5ae},'attributes':['id',_0xa805('0x10')]}});};exports[_0xa805('0x25')]=function(_0x3e26a4){return request(_0xa805('0x26'),{'body':_0x3e26a4});};exports[_0xa805('0x27')]=function(_0x293434){return request('CreateSquareDetailsReport',{'body':_0x293434});};exports[_0xa805('0x28')]=function(_0xc9bf2d){return request(_0xa805('0x29'),{'body':_['merge'](_0xc9bf2d,{'project_name':_0xc9bf2d[_0xa805('0x2a')],'prev_project_name':_0xc9bf2d['arg_2']||'','is_subproject':_0xc9bf2d[_0xa805('0x2b')]?!![]:![],'leaveAt':moment()[_0xa805('0x2c')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xa805('0x2d')]=function(_0x10a307){return request(_0xa805('0x2e'),{'body':_0x10a307});};exports[_0xa805('0x2f')]=function(_0x542318){return request(_0xa805('0x30'),{'body':_0x542318});};exports[_0xa805('0x31')]=function(_0x24e0b6){return request(_0xa805('0x32'),{'options':{'raw':![],'where':{'phone':_0x24e0b6['phone'],'ListId':_0x24e0b6[_0xa805('0x33')]}}})[_0xa805('0x4')](function(_0x2c3474){if(_0x2c3474){return _0x2c3474;}return request('CreateCmContact',{'body':_0x24e0b6});});};exports['getPauseById']=function(_0x370e56){return request(_0xa805('0x34'),{'options':{'where':{'id':_0x370e56},'attributes':['name']}});};exports[_0xa805('0x35')]=function(_0x3a4f64,_0x52d9e9){return request(_0xa805('0x36'),{'body':{'interface':_0x52d9e9},'options':{'where':_0x3a4f64}});};exports[_0xa805('0x37')]=function(_0x25ffbf,_0x55db80,_0x50b6a8){return request(_0xa805('0x38'),{'body':{'type':_0x55db80,'uniqueid':_0x50b6a8},'options':{'where':_0x25ffbf}});};exports[_0xa805('0x39')]=function(_0x1f701c){return request('UnpauseUser',{'body':{},'options':{'where':_0x1f701c}});};exports[_0xa805('0x3a')]=function(_0x49bd9e){return request(_0xa805('0x3b'),{'body':{},'options':{'where':_0x49bd9e}});}; \ No newline at end of file +var _0xf865=['error','message','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareReport','CreateSquareReport','merge','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash','util','jayson/promise','client','http','then'];(function(_0x83a59,_0x874740){var _0x25232d=function(_0x23771c){while(--_0x23771c){_0x83a59['push'](_0x83a59['shift']());}};_0x25232d(++_0x874740);}(_0xf865,0x11a));var _0x5f86=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xf865[_0x3305de];return _0x3b5a84;};'use strict';var BPromise=require(_0x5f86('0x0'));var moment=require(_0x5f86('0x1'));var _=require(_0x5f86('0x2'));var util=require(_0x5f86('0x3'));var jayson=require(_0x5f86('0x4'));var client=jayson[_0x5f86('0x5')][_0x5f86('0x6')]({'port':0x2329});function request(_0x3796f9,_0x2bac9d){return new BPromise(function(_0x100f3a,_0x82094d){return client['request'](_0x3796f9,_0x2bac9d)[_0x5f86('0x7')](function(_0x5332e4){if(_0x5332e4[_0x5f86('0x8')]){return _0x82094d(_0x5332e4['error'][_0x5f86('0x9')]);}else{return _0x100f3a(_0x5332e4['result']);}})[_0x5f86('0xa')](function(_0x2b0997){return _0x82094d(_0x2b0997);});});}exports[_0x5f86('0xb')]=function(_0x115be7){return request(_0x5f86('0xc'),{'options':{'raw':![],'where':{'name':_0x115be7},'attributes':[_0x5f86('0xd')]}});};exports[_0x5f86('0xe')]=function(_0x4c270e){return request(_0x5f86('0xf'),{'options':{'raw':![],'where':{'id':_0x4c270e},'include':[{'model':_0x5f86('0x10'),'as':_0x5f86('0x11')}],'attributes':['id',_0x5f86('0x12'),_0x5f86('0x13')]}});};exports['getSquareProjectById']=function(_0x123728){return request(_0x5f86('0xc'),{'options':{'where':{'id':_0x123728},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x2a0fdd){return request(_0x5f86('0x14'),{'options':{'where':{'id':_0x2a0fdd},'attributes':[_0x5f86('0x12')]}});};exports[_0x5f86('0x15')]=function(_0x315879){return request(_0x5f86('0x16'),{'options':{'where':{'id':_0x315879},'attributes':['name']}});};exports[_0x5f86('0x17')]=function(_0x4fec48){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x4fec48},'attributes':[_0x5f86('0x18')]}});};exports[_0x5f86('0x19')]=function(_0x436cec){return request(_0x5f86('0x1a'),{'options':{'where':{'id':_0x436cec},'attributes':[_0x5f86('0x12')]}});};exports[_0x5f86('0x1b')]=function(_0xa9c94c){return request(_0x5f86('0x1c'),{'options':{'where':{'id':_0xa9c94c},'attributes':[_0x5f86('0x12')]}});};exports['getSoundById']=function(_0x4b2561){return request('ShowSound',{'options':{'where':{'id':_0x4b2561},'attributes':['save_name']}});};exports[_0x5f86('0x1d')]=function(_0x6b7e87){return request(_0x5f86('0x1e'),{'options':{'raw':![],'where':{'id':_0x6b7e87},'include':[{'model':_0x5f86('0x1f'),'as':_0x5f86('0x20')}]}});};exports[_0x5f86('0x21')]=function(_0x33a30e){return request('ShowSmsAccount',{'options':{'where':{'id':_0x33a30e},'attributes':['id',_0x5f86('0x12')]}});};exports[_0x5f86('0x22')]=function(_0x8b39f1){return request(_0x5f86('0x23'),{'body':_0x8b39f1});};exports['createSquareDetailsReport']=function(_0x48b3b9){return request('CreateSquareDetailsReport',{'body':_0x48b3b9});};exports[_0x5f86('0x24')]=function(_0xf66b43){return request(_0x5f86('0x25'),{'body':_[_0x5f86('0x26')](_0xf66b43,{'project_name':_0xf66b43['arg_1'],'prev_project_name':_0xf66b43[_0x5f86('0x27')]||'','is_subproject':_0xf66b43['arg_2']?!![]:![],'leaveAt':moment()[_0x5f86('0x28')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x5f86('0x29')]=function(_0x3652ee){return request(_0x5f86('0x2a'),{'body':_0x3652ee});};exports[_0x5f86('0x2b')]=function(_0x2b3f93){return request('CreateSquareMessage',{'body':_0x2b3f93});};exports[_0x5f86('0x2c')]=function(_0x522a20){return request(_0x5f86('0x2d'),{'options':{'raw':![],'where':{'phone':_0x522a20[_0x5f86('0x2e')],'ListId':_0x522a20[_0x5f86('0x2f')]}}})[_0x5f86('0x7')](function(_0x15f407){if(_0x15f407){return _0x15f407;}return request(_0x5f86('0x30'),{'body':_0x522a20});});};exports[_0x5f86('0x31')]=function(_0xd2b8f7){return request(_0x5f86('0x32'),{'options':{'where':{'id':_0xd2b8f7},'attributes':[_0x5f86('0x12')]}});};exports[_0x5f86('0x33')]=function(_0x419f20,_0x1150e6){return request(_0x5f86('0x34'),{'body':{'interface':_0x1150e6},'options':{'where':_0x419f20}});};exports[_0x5f86('0x35')]=function(_0x451b65,_0xf2ef4c,_0x2fc649){return request(_0x5f86('0x36'),{'body':{'type':_0xf2ef4c,'uniqueid':_0x2fc649},'options':{'where':_0x451b65}});};exports[_0x5f86('0x37')]=function(_0x1557fc){return request(_0x5f86('0x38'),{'body':{},'options':{'where':_0x1557fc}});};exports[_0x5f86('0x39')]=function(_0x56e5ce){return request('LogoutUser',{'body':{},'options':{'where':_0x56e5ce}});}; \ 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 5f073f9..4b7ab47 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 _0xf3cd=['./lex','exports','./polly'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2567f0,_0x4fa60){_0x2567f0=_0x2567f0-0x0;var _0x14852a=_0xf3cd[_0x2567f0];return _0x14852a;};var polly=require(_0xdf3c('0x0'));var lex=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x7bae=['exports'];(function(_0x3baeae,_0x704d0a){var _0x506f95=function(_0x405328){while(--_0x405328){_0x3baeae['push'](_0x3baeae['shift']());}};_0x506f95(++_0x704d0a);}(_0x7bae,0x13b));var _0xe7ba=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x7bae[_0x397cfb];return _0x15fed9;};var polly=require('./polly');var lex=require('./lex');module[_0xe7ba('0x0')]={'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 4ca00a6..90d2929 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c38=['exports','./lib/api'];(function(_0x17ff77,_0x327a4f){var _0xa0230c=function(_0x11be90){while(--_0x11be90){_0x17ff77['push'](_0x17ff77['shift']());}};_0xa0230c(++_0x327a4f);}(_0x8c38,0x83));var _0x88c3=function(_0x23d7ea,_0x319aea){_0x23d7ea=_0x23d7ea-0x0;var _0x3c9af2=_0x8c38[_0x23d7ea];return _0x3c9af2;};'use strict';var lex=require(_0x88c3('0x0'));module[_0x88c3('0x1')]=function(_0x51a0df,_0x143fbc,_0x3c7e76,_0x2fd347,_0x2ac453,_0x4ac99a){return lex(_0x51a0df,_0x143fbc,_0x3c7e76,_0x2fd347,_0x2ac453,_0x4ac99a);}; \ No newline at end of file +var _0x402f=['./lib/api'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x402f,0x6f));var _0xf402=function(_0x19cb31,_0x588f7f){_0x19cb31=_0x19cb31-0x0;var _0x4590ed=_0x402f[_0x19cb31];return _0x4590ed;};'use strict';var lex=require(_0xf402('0x0'));module['exports']=function(_0x15798b,_0x567587,_0x588b83,_0x3ccbce,_0xe1847c,_0x86f726){return lex(_0x15798b,_0x567587,_0x588b83,_0x3ccbce,_0xe1847c,_0x86f726);}; \ 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 d486bc3..6b79f82 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 _0x3157=['postText','slots','hasOwnProperty','slot_','exports','LexRuntime','bluebird','aws-sdk'];(function(_0x5165ae,_0x4a614b){var _0x3ab8bb=function(_0x36ad6d){while(--_0x36ad6d){_0x5165ae['push'](_0x5165ae['shift']());}};_0x3ab8bb(++_0x4a614b);}(_0x3157,0xde));var _0x7315=function(_0x41dafa,_0x39df07){_0x41dafa=_0x41dafa-0x0;var _0x370c22=_0x3157[_0x41dafa];return _0x370c22;};'use strict';var BPromise=require(_0x7315('0x0'));var AWS=require(_0x7315('0x1'));function lexResult(_0x1635d7,_0x4e4881){return new BPromise(function(_0x145690,_0x59e949){_0x1635d7[_0x7315('0x2')](_0x4e4881,function(_0x2fe420,_0x50d33b){if(_0x2fe420){_0x59e949(_0x2fe420);}if(_0x50d33b[_0x7315('0x3')]){for(const _0x27e265 in _0x50d33b['slots']){if(_0x50d33b[_0x7315('0x3')][_0x7315('0x4')](_0x27e265)){var _0x3aab2d=_0x50d33b['slots'][_0x27e265];_0x50d33b[_0x7315('0x5')+_0x27e265]=_0x3aab2d;}}}_0x145690(_0x50d33b);});});}module[_0x7315('0x6')]=function(_0x56492b,_0x3072e4,_0x11d628,_0x2ae565,_0x9b477d,_0x847a22){var _0xd21f2b=new AWS[(_0x7315('0x7'))]({'accessKeyId':_0x3072e4,'secretAccessKey':_0x11d628,'region':_0x2ae565});var _0x2ac387={'botAlias':'$LATEST','botName':_0x847a22,'inputText':_0x9b477d,'userId':_0x56492b};return lexResult(_0xd21f2b,_0x2ac387);}; \ No newline at end of file +var _0xaa5d=['$LATEST','bluebird','aws-sdk','postText','slots','slot_','exports'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xaa5d,0x1ac));var _0xdaa5=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0xaa5d[_0xa4928c];return _0x27cc29;};'use strict';var BPromise=require(_0xdaa5('0x0'));var AWS=require(_0xdaa5('0x1'));function lexResult(_0x5ff182,_0x2bd691){return new BPromise(function(_0x1b0c69,_0x3f26b5){_0x5ff182[_0xdaa5('0x2')](_0x2bd691,function(_0x55ccfe,_0x3e2657){if(_0x55ccfe){_0x3f26b5(_0x55ccfe);}if(_0x3e2657['slots']){for(const _0x2b2f72 in _0x3e2657[_0xdaa5('0x3')]){if(_0x3e2657['slots']['hasOwnProperty'](_0x2b2f72)){var _0x35b970=_0x3e2657[_0xdaa5('0x3')][_0x2b2f72];_0x3e2657[_0xdaa5('0x4')+_0x2b2f72]=_0x35b970;}}}_0x1b0c69(_0x3e2657);});});}module[_0xdaa5('0x5')]=function(_0x2cbcaa,_0x1f9ef2,_0x57fff2,_0x4537ad,_0x45a634,_0x35816f){var _0x8143c1=new AWS['LexRuntime']({'accessKeyId':_0x1f9ef2,'secretAccessKey':_0x57fff2,'region':_0x4537ad});var _0x43bad5={'botAlias':_0xdaa5('0x6'),'botName':_0x35816f,'inputText':_0x45a634,'userId':_0x2cbcaa};return lexResult(_0x8143c1,_0x43bad5);}; \ 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 16d4042..ee79b54 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 _0x2e77=['./lib/api','exports'];(function(_0x7181f2,_0x59005f){var _0x3e504d=function(_0x232cee){while(--_0x232cee){_0x7181f2['push'](_0x7181f2['shift']());}};_0x3e504d(++_0x59005f);}(_0x2e77,0x19c));var _0x72e7=function(_0x4ecee7,_0xdc1784){_0x4ecee7=_0x4ecee7-0x0;var _0x34eb43=_0x2e77[_0x4ecee7];return _0x34eb43;};'use strict';var polly=require(_0x72e7('0x0'));module[_0x72e7('0x1')]=function(_0x550379,_0x2202d1,_0x405236,_0x5e6c90,_0x2e8b6d,_0x3056a9,_0x2e67f7){return polly(_0x550379,_0x2202d1,_0x405236,_0x5e6c90,_0x2e8b6d,_0x3056a9,_0x2e67f7);}; \ No newline at end of file +var _0x7b54=['exports','./lib/api'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x7b54,0xb7));var _0x47b5=function(_0x447d73,_0x50f8c7){_0x447d73=_0x447d73-0x0;var _0x343b07=_0x7b54[_0x447d73];return _0x343b07;};'use strict';var polly=require(_0x47b5('0x0'));module[_0x47b5('0x1')]=function(_0x48a9f2,_0x5784c3,_0xedc3d4,_0x48c700,_0x2d8288,_0x534291,_0x56d58f){return polly(_0x48a9f2,_0x5784c3,_0xedc3d4,_0x48c700,_0x2d8288,_0x534291,_0x56d58f);}; \ 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 8e03c94..1fc74b7 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 _0xe14e=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird'];(function(_0x5890ed,_0x5eec7c){var _0x49ef9b=function(_0x3d68eb){while(--_0x3d68eb){_0x5890ed['push'](_0x5890ed['shift']());}};_0x49ef9b(++_0x5eec7c);}(_0xe14e,0xbe));var _0xee14=function(_0x133648,_0x70a2db){_0x133648=_0x133648-0x0;var _0x1bc0ea=_0xe14e[_0x133648];return _0x1bc0ea;};'use strict';var fs=require('fs');var path=require(_0xee14('0x0'));var BPromise=require(_0xee14('0x1'));var rs=require(_0xee14('0x2'));var AWS=require(_0xee14('0x3'));function pollyResult(_0x5db6c0,_0x4862e8,_0x1eb8ef){return new BPromise(function(_0x62c08d,_0x960ebb){_0x5db6c0[_0xee14('0x4')](_0x4862e8,function(_0x59bd53,_0x3dcc92){if(_0x59bd53){_0x960ebb(_0x59bd53);}else if(_0x3dcc92){if(_0x3dcc92['AudioStream']instanceof Buffer){fs['writeFile'](_0x1eb8ef,_0x3dcc92[_0xee14('0x5')],function(_0x1b0747){if(_0x1b0747){_0x960ebb(_0x1b0747);}else{_0x62c08d();}});}else{_0x960ebb(new Error(_0xee14('0x6')));}}else{_0x960ebb(new Error(_0xee14('0x7')));}});});}module[_0xee14('0x8')]=function(_0x4c2143,_0x1bdece,_0x37377c,_0x114114,_0x4f6bae,_0x232800,_0x5d01e4){var _0xbf2d62=new AWS[(_0xee14('0x9'))]({'accessKeyId':_0x4c2143,'secretAccessKey':_0x1bdece,'region':_0x37377c});var _0x4ea39b={'Text':_0x4f6bae,'TextType':_0x232800||_0xee14('0xa'),'OutputFormat':_0xee14('0xb'),'VoiceId':_0x114114};return pollyResult(_0xbf2d62,_0x4ea39b,_0x5d01e4);}; \ No newline at end of file +var _0x3363=['No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3321ad,_0x53be57){var _0x28f9f1=function(_0x192618){while(--_0x192618){_0x3321ad['push'](_0x3321ad['shift']());}};_0x28f9f1(++_0x53be57);}(_0x3363,0x7b));var _0x3336=function(_0x3d0dda,_0x3f09df){_0x3d0dda=_0x3d0dda-0x0;var _0x4b92a0=_0x3363[_0x3d0dda];return _0x4b92a0;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x3336('0x0'));var rs=require(_0x3336('0x1'));var AWS=require(_0x3336('0x2'));function pollyResult(_0xcf2199,_0x2f6e97,_0x5c093d){return new BPromise(function(_0x516de7,_0x59cae6){_0xcf2199[_0x3336('0x3')](_0x2f6e97,function(_0x678091,_0x8cca51){if(_0x678091){_0x59cae6(_0x678091);}else if(_0x8cca51){if(_0x8cca51['AudioStream']instanceof Buffer){fs[_0x3336('0x4')](_0x5c093d,_0x8cca51[_0x3336('0x5')],function(_0x3f1bd3){if(_0x3f1bd3){_0x59cae6(_0x3f1bd3);}else{_0x516de7();}});}else{_0x59cae6(new Error(_0x3336('0x6')));}}else{_0x59cae6(new Error(_0x3336('0x7')));}});});}module['exports']=function(_0x3036dd,_0xd46193,_0x164660,_0x53ee0c,_0x4e67c4,_0x42bcaa,_0x124c37){var _0x5b79c7=new AWS[(_0x3336('0x8'))]({'accessKeyId':_0x3036dd,'secretAccessKey':_0xd46193,'region':_0x164660});var _0x427ea0={'Text':_0x4e67c4,'TextType':_0x42bcaa||'text','OutputFormat':_0x3336('0x9'),'VoiceId':_0x53ee0c};return pollyResult(_0x5b79c7,_0x427ea0,_0x124c37);}; \ 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 bc2800b..f77511b 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 _0x66ff=['exports'];(function(_0x181d13,_0x261e23){var _0x179d8c=function(_0x5196cf){while(--_0x5196cf){_0x181d13['push'](_0x181d13['shift']());}};_0x179d8c(++_0x261e23);}(_0x66ff,0x1ac));var _0xf66f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x66ff[_0x14add3];return _0x4a174f;};'use strict';var asr=require('./lib/api');module[_0xf66f('0x0')]=function(_0x4b89a9,_0x57ef39,_0xc475ef,_0x5f246a){return asr(_0x4b89a9,_0x57ef39,_0xc475ef);}; \ No newline at end of file +var _0x758a=['exports','./lib/api'];(function(_0x3fda0a,_0x40433c){var _0x40c5dd=function(_0x2e2f17){while(--_0x2e2f17){_0x3fda0a['push'](_0x3fda0a['shift']());}};_0x40c5dd(++_0x40433c);}(_0x758a,0x179));var _0xa758=function(_0x38cef6,_0x28ed2d){_0x38cef6=_0x38cef6-0x0;var _0x49d035=_0x758a[_0x38cef6];return _0x49d035;};'use strict';var asr=require(_0xa758('0x0'));module[_0xa758('0x1')]=function(_0x22f9ba,_0x4daae1,_0x16e959,_0x3e2061){return asr(_0x22f9ba,_0x4daae1,_0x16e959);}; \ 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 28367ba..3ecb29f 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 _0x1a71=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','bluebird'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x1a71,0xe9));var _0x11a7=function(_0x47a854,_0x5871dd){_0x47a854=_0x47a854-0x0;var _0x51a0af=_0x1a71[_0x47a854];return _0x51a0af;};'use strict';var url=require('url');var BPromise=require(_0x11a7('0x0'));var fs=require('fs');var host=_0x11a7('0x1');module[_0x11a7('0x2')]=function(_0x2e99c2,_0x309f0c,_0x2c7377){return new BPromise(function(_0x23ab12,_0x25f6d7){var _0xa37536;if(typeof _0x2e99c2!==_0x11a7('0x3')||_0x2e99c2[_0x11a7('0x4')]===0x0){return _0x25f6d7(_0x11a7('0x5'));}if(typeof _0x309f0c!=='string'||_0x309f0c[_0x11a7('0x4')]===0x0){return _0x25f6d7(_0x11a7('0x6'));}if(typeof _0x2c7377!=='undefined'&&(typeof _0x2c7377!=='string'||_0x2c7377['length']===0x0)){return _0x25f6d7(_0x11a7('0x7'));}try{_0xa37536=fs['readFileSync'](_0x2e99c2)[_0x11a7('0x8')](_0x11a7('0x9'));}catch(_0x375d90){return _0x25f6d7(_0x375d90);}return _0x23ab12({'method':_0x11a7('0xa'),'uri':host+_0x11a7('0xb')+_0x309f0c,'body':{'config':{'encoding':_0x11a7('0xc'),'sampleRateHertz':'8000','languageCode':_0x2c7377},'audio':{'content':_0xa37536}},'json':!![]});});}; \ No newline at end of file +var _0x5004=['key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length'];(function(_0x489343,_0xc64756){var _0x3350cb=function(_0x26a341){while(--_0x26a341){_0x489343['push'](_0x489343['shift']());}};_0x3350cb(++_0xc64756);}(_0x5004,0xda));var _0x4500=function(_0x523164,_0x1e8989){_0x523164=_0x523164-0x0;var _0x2fa249=_0x5004[_0x523164];return _0x2fa249;};'use strict';var url=require(_0x4500('0x0'));var BPromise=require(_0x4500('0x1'));var fs=require('fs');var host=_0x4500('0x2');module[_0x4500('0x3')]=function(_0x5bd0fe,_0x5712cb,_0x5d6166){return new BPromise(function(_0x3b3b93,_0x18d802){var _0x31815b;if(typeof _0x5bd0fe!==_0x4500('0x4')||_0x5bd0fe[_0x4500('0x5')]===0x0){return _0x18d802('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x5712cb!=='string'||_0x5712cb[_0x4500('0x5')]===0x0){return _0x18d802(_0x4500('0x6'));}if(typeof _0x5d6166!==_0x4500('0x7')&&(typeof _0x5d6166!=='string'||_0x5d6166[_0x4500('0x5')]===0x0)){return _0x18d802('lang\x20should\x20be\x20a\x20string');}try{_0x31815b=fs[_0x4500('0x8')](_0x5bd0fe)[_0x4500('0x9')]('base64');}catch(_0x5ed0fe){return _0x18d802(_0x5ed0fe);}return _0x3b3b93({'method':_0x4500('0xa'),'uri':host+_0x4500('0xb')+_0x5712cb,'body':{'config':{'encoding':_0x4500('0xc'),'sampleRateHertz':_0x4500('0xd'),'languageCode':_0x5d6166},'audio':{'content':_0x31815b}},'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 d6fcb3a..fa915f8 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 _0x1798=['exports','./asr'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x1798,0xa7));var _0x8179=function(_0x340fef,_0x3e0f38){_0x340fef=_0x340fef-0x0;var _0x1d735c=_0x1798[_0x340fef];return _0x1d735c;};var asr=require(_0x8179('0x0'));module[_0x8179('0x1')]={'asr':asr}; \ No newline at end of file +var _0x06d2=['exports','./asr'];(function(_0x46b36b,_0x5f1f0a){var _0x758979=function(_0x38552e){while(--_0x38552e){_0x46b36b['push'](_0x46b36b['shift']());}};_0x758979(++_0x5f1f0a);}(_0x06d2,0xcd));var _0x206d=function(_0x3ec015,_0x3b3762){_0x3ec015=_0x3ec015-0x0;var _0x1ee4fc=_0x06d2[_0x3ec015];return _0x1ee4fc;};var asr=require(_0x206d('0x0'));module[_0x206d('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 1d040f4..2e81aee 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 _0x16ae=['parse','bluebird','randomstring','sox','request-promise','util','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','request\x20to\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','pipe','https:','get','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','base64','then','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','777','.wav','chmodSync','googleCloudTTS\x20path','goggleTTS\x20path','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','stringify','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','freeform=3','nda','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','http','https','url'];(function(_0x610dbc,_0x38eaea){var _0x4b04fe=function(_0x58c8dd){while(--_0x58c8dd){_0x610dbc['push'](_0x610dbc['shift']());}};_0x4b04fe(++_0x38eaea);}(_0x16ae,0x146));var _0xe16a=function(_0x7c1a84,_0x539deb){_0x7c1a84=_0x7c1a84-0x0;var _0x4980e4=_0x16ae[_0x7c1a84];return _0x4980e4;};'use strict';var fs=require('fs');var path=require(_0xe16a('0x0'));var http=require(_0xe16a('0x1'));var https=require(_0xe16a('0x2'));var urlParse=require(_0xe16a('0x3'))[_0xe16a('0x4')];var BPromise=require(_0xe16a('0x5'));var rs=require(_0xe16a('0x6'));var sox=require(_0xe16a('0x7'));var rp=require(_0xe16a('0x8'));var util=require(_0xe16a('0x9'));var querystring=require(_0xe16a('0xa'));var tts=require(_0xe16a('0xb'));var apiai=require(_0xe16a('0xc'));var md5=require(_0xe16a('0xd'));var google=require(_0xe16a('0xe'));var aws=require(_0xe16a('0xf'));var tilde=require('./tilde');var sestek=require(_0xe16a('0x10'));var logger=require(_0xe16a('0x11'))('agi');var ISPEECH_API=_0xe16a('0x12');function downloadFile(_0x396e19,_0xa06096){return new BPromise(function(_0x39ff4e,_0x2d3e7e){var _0x23631f=urlParse(_0x396e19);var _0x3da693=_0x23631f[_0xe16a('0x13')]==='https:'?https:http;var _0x3c661c={'host':_0x23631f[_0xe16a('0x14')],'path':_0x23631f['path'],'headers':{'user-agent':_0xe16a('0x15')}};_0x3da693['get'](_0x3c661c,function(_0xadbeb3){if(_0xadbeb3[_0xe16a('0x16')]!==0xc8){logger[_0xe16a('0x17')]('request\x20to\x20'+_0x396e19+_0xe16a('0x18')+_0xadbeb3['statusCode']+'\x20('+_0xadbeb3['statusMessage']+')');_0x2d3e7e(new Error(_0xe16a('0x19')+_0x396e19+_0xe16a('0x18')+_0xadbeb3[_0xe16a('0x16')]+'\x20('+_0xadbeb3[_0xe16a('0x1a')]+')'));return;}var _0x1388f1=fs[_0xe16a('0x1b')](_0xa06096);_0x1388f1['on'](_0xe16a('0x1c'),function(){logger[_0xe16a('0x1d')](_0xe16a('0x1e'));_0x1388f1[_0xe16a('0x1f')](_0x39ff4e);});_0x1388f1['on']('error',function(_0x56d2fd){fs[_0xe16a('0x20')](_0xa06096);logger[_0xe16a('0x17')]('download\x20error',_0x56d2fd);_0x2d3e7e(_0x56d2fd);});_0xadbeb3[_0xe16a('0x21')](_0x1388f1);})['on'](_0xe16a('0x17'),function(_0x399b13){logger[_0xe16a('0x17')](_0x399b13);_0x2d3e7e(_0x399b13);})['end']();});}function uploadFile(_0x391ab9){return new BPromise(function(_0x494d6a,_0x4192d9){var _0x298bdd=urlParse(_0x391ab9);var _0x1afc7f=_0x298bdd[_0xe16a('0x13')]===_0xe16a('0x22')?https:http;var _0x1e48b0={'host':_0x298bdd[_0xe16a('0x14')],'path':_0x298bdd[_0xe16a('0x0')],'headers':{'user-agent':_0xe16a('0x15')}};_0x1afc7f[_0xe16a('0x23')](_0x1e48b0,function(_0x1b16d3){if(_0x1b16d3['statusCode']!==0xc8){_0x4192d9(new Error(_0xe16a('0x19')+_0x391ab9+_0xe16a('0x18')+_0x1b16d3[_0xe16a('0x16')]+'\x20('+_0x1b16d3['statusMessage']+')'));return;}var _0x2b35e6='';_0x1b16d3['on'](_0xe16a('0x24'),function(_0x30da66){_0x2b35e6+=_0x30da66;});_0x1b16d3['on']('end',function(){_0x494d6a(_0x2b35e6);});})['on'](_0xe16a('0x17'),function(_0x1a9abc){_0x4192d9(_0x1a9abc);})[_0xe16a('0x25')]();});}function convertFile(_0x15d9f6,_0x3bdf9d){return new BPromise(function(_0x48e601,_0x466cd2){var _0x2affde=sox[_0xe16a('0x26')](_0x15d9f6,_0x3bdf9d,{'sampleRate':0x1f40,'format':_0xe16a('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2affde['on'](_0xe16a('0x17'),function(_0x3e448a){logger['error'](_0xe16a('0x28'),_0x3e448a);_0x466cd2(_0x3e448a);});_0x2affde['on']('end',function(){logger['info'](_0xe16a('0x29'));_0x48e601();});_0x2affde['start']();});}function base64Decode(_0x217106,_0x37fb59){var _0x1bd532=path[_0xe16a('0x2a')](__dirname,_0xe16a('0x2b'),rs[_0xe16a('0x2c')](0x4)+'.wav');fs['writeFileSync'](_0x1bd532,_0x217106,_0xe16a('0x2d'));return convertFile(_0x1bd532,_0x37fb59)[_0xe16a('0x2e')](function(){try{fs[_0xe16a('0x20')](_0x1bd532);fs['chmodSync'](_0x37fb59,'777');}catch(_0xc8cbee){logger['error'](_0xc8cbee);}return _0x37fb59[_0xe16a('0x2f')]('.')[0x0];});}function base64Encode(_0x2c59c1){var _0x4d83bb=fs[_0xe16a('0x30')](_0x2c59c1);return new Buffer(_0x4d83bb)[_0xe16a('0x31')](_0xe16a('0x2d'));}exports['googleCloudTTS']=function(_0x109bd3,_0x14f5c6,_0x44125a,_0x4bd746,_0x1fa588,_0x122814){var _0x3cc032,_0x7f091a;var _0x4c8c4a=_0xe16a('0x32');var _0x458428=_0xe16a('0x33')+_0x109bd3;var _0x5ab581={};if(_0x14f5c6===_0xe16a('0x34')){_0x5ab581[_0xe16a('0x35')]={'ssml':_0x44125a};}else{_0x5ab581[_0xe16a('0x35')]={'text':_0x44125a};};_0x5ab581[_0xe16a('0x36')]={'languageCode':_0x4bd746,'ssmlGender':_0x1fa588};_0x5ab581[_0xe16a('0x37')]={'audioEncoding':_0xe16a('0x38'),'sampleRateHertz':0x1f40};var _0x36919a={'url':_0x4c8c4a+_0xe16a('0x39')+_0x458428,'method':_0xe16a('0x3a'),'json':!![],'body':_0x5ab581};return rp(_0x36919a)[_0xe16a('0x2e')](function(_0x2968e6){return new BPromise(function(_0xa3c969,_0x17bc8f){_0x3cc032=path[_0xe16a('0x2a')](__dirname,_0xe16a('0x2b'),rs[_0xe16a('0x2c')](0x4)+_0xe16a('0x3b'));var _0x1bc25c=Buffer[_0xe16a('0x3c')](_0x2968e6[_0xe16a('0x3d')],_0xe16a('0x2d'));return fs[_0xe16a('0x3e')](_0x3cc032,_0x1bc25c,function(_0x1d7505){_0x17bc8f(_0x1d7505);},function(_0x3f6208){fs['chmodSync'](_0x3cc032,_0xe16a('0x3f'));_0xa3c969(_0x3f6208);});});})['then'](function(_0x1b896f){_0x7f091a=path[_0xe16a('0x2a')](__dirname,_0xe16a('0x2b'),rs[_0xe16a('0x2c')](0x4)+_0xe16a('0x40'));return convertFile(_0x3cc032,_0x7f091a);})['then'](function(){try{fs['unlink'](_0x3cc032);fs[_0xe16a('0x41')](_0x7f091a,_0xe16a('0x3f'));}catch(_0x5b1694){logger[_0xe16a('0x17')](_0x5b1694);}logger[_0xe16a('0x1d')](_0xe16a('0x42'),_0x7f091a[_0xe16a('0x2f')]('.')[0x0]);return _0x7f091a[_0xe16a('0x2f')]('.')[0x0];});};exports['googleTTS']=function(_0x27bc85,_0x4aa42f){var _0x517e75,_0xd23554;return tts(_0x27bc85,_0x4aa42f||'en',0x1)[_0xe16a('0x2e')](function(_0xe80c2c){logger[_0xe16a('0x1d')](_0xe80c2c);_0x517e75=path[_0xe16a('0x2a')](__dirname,_0xe16a('0x2b'),rs['generate'](0x4)+_0xe16a('0x3b'));return downloadFile(_0xe80c2c,_0x517e75);})[_0xe16a('0x2e')](function(){_0xd23554=path[_0xe16a('0x2a')](__dirname,'tmp',rs[_0xe16a('0x2c')](0x4)+'.wav');return convertFile(_0x517e75,_0xd23554);})[_0xe16a('0x2e')](function(){try{fs[_0xe16a('0x20')](_0x517e75);fs[_0xe16a('0x41')](_0xd23554,_0xe16a('0x3f'));}catch(_0x562311){logger[_0xe16a('0x17')](_0x562311);}logger[_0xe16a('0x1d')](_0xe16a('0x43'),_0xd23554['split']('.')[0x0]);return _0xd23554[_0xe16a('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0x36a1c7,_0x2179a9,_0xde6fc9){return google['asr'](_0x36a1c7,_0x2179a9,_0xde6fc9)[_0xe16a('0x2e')](function(_0x443027){logger[_0xe16a('0x1d')](_0x443027['uri']);return rp(_0x443027);})[_0xe16a('0x2e')](function(_0xc11f16){var _0x1191cb='';var _0x47de27=0x0;try{fs[_0xe16a('0x20')](_0x36a1c7);}catch(_0x1ff82a){logger[_0xe16a('0x17')](_0x1ff82a);}if(_0xc11f16&&_0xc11f16[_0xe16a('0x44')]){_0x1191cb=_0xc11f16['results'][_0xe16a('0x45')](function(_0x255323){return _0x255323&&_0x255323['alternatives'][0x0]&&_0x255323[_0xe16a('0x46')][0x0][_0xe16a('0x47')]?_0x255323['alternatives'][0x0][_0xe16a('0x47')]:'';})[_0xe16a('0x48')]('\x0a');_0x47de27=_0xc11f16[_0xe16a('0x44')][_0xe16a('0x45')](function(_0x34a3c1){return _0x34a3c1&&_0x34a3c1[_0xe16a('0x46')][0x0]&&_0x34a3c1['alternatives'][0x0][_0xe16a('0x49')]?_0x34a3c1['alternatives'][0x0][_0xe16a('0x49')]:0x0;})[_0xe16a('0x48')]('\x0a');}logger['info'](_0xe16a('0x4a'),_0x1191cb);logger[_0xe16a('0x1d')](_0xe16a('0x4b'),_0x47de27);return{'transcript':_0x1191cb,'confidence':_0x47de27};})[_0xe16a('0x4c')](function(_0x3f749d){logger[_0xe16a('0x17')](_0xe16a('0x4d'),_0x3f749d[_0xe16a('0x16')],_0x3f749d[_0xe16a('0x4e')],_0x3f749d[_0xe16a('0x4f')]);});};exports[_0xe16a('0x50')]=function(_0x19a70a,_0x472afb,_0x21aed5,_0x1df535){var _0x549075=apiai(_0x472afb,{'language':_0x1df535||'en'});return _0x549075[_0xe16a('0x51')](_0x21aed5,{'sessionId':md5(_0x19a70a)})[_0xe16a('0x2e')](function(_0x1b54bb){logger[_0xe16a('0x1d')](JSON['stringify'](_0x1b54bb));return{'source':_0x1b54bb[_0xe16a('0x52')]['source'],'resolvedQuery':_0x1b54bb[_0xe16a('0x52')]['resolvedQuery'],'action':_0x1b54bb[_0xe16a('0x52')][_0xe16a('0x53')],'actionIncomplete':_0x1b54bb[_0xe16a('0x52')][_0xe16a('0x54')],'speech':_0x1b54bb['result'][_0xe16a('0x55')][_0xe16a('0x56')],'score':_0x1b54bb['result'][_0xe16a('0x57')],'statusCode':_0x1b54bb[_0xe16a('0x58')][_0xe16a('0x59')],'endConversation':_0x1b54bb['result'][_0xe16a('0x5a')][_0xe16a('0x5b')]||![],'isFallbackIntent':_0x1b54bb[_0xe16a('0x52')][_0xe16a('0x5a')][_0xe16a('0x5c')]};});};exports['tildeASR']=function(_0x26ce37,_0x43beea,_0x1ec0b3,_0x53a59f){return tilde[_0xe16a('0x5d')](_0x26ce37,_0x43beea,_0x1ec0b3,_0x53a59f)[_0xe16a('0x2e')](function(_0x70e49e){try{fs[_0xe16a('0x20')](_0x26ce37);}catch(_0xf4c19d){logger[_0xe16a('0x17')](_0xf4c19d);}logger[_0xe16a('0x1d')](_0xe16a('0x5e'),_0x70e49e['transcript']);logger[_0xe16a('0x1d')](_0xe16a('0x5f'),_0x70e49e[_0xe16a('0x49')]);return _0x70e49e;});};exports['awsPolly']=function(_0x2a589e,_0x1f0df2,_0x5c18df,_0x5ef326,_0x2aa4db,_0x54c605){var _0x21f798=path[_0xe16a('0x2a')](__dirname,_0xe16a('0x2b'),rs['generate'](0x4)+'.mp3');var _0xb2848b;return aws[_0xe16a('0x60')](_0x2a589e,_0x1f0df2,_0x5c18df,_0x5ef326,_0x2aa4db,_0x54c605,_0x21f798)['then'](function(){_0xb2848b=path[_0xe16a('0x2a')](__dirname,_0xe16a('0x2b'),rs[_0xe16a('0x2c')](0x4)+_0xe16a('0x40'));return convertFile(_0x21f798,_0xb2848b);})[_0xe16a('0x2e')](function(){try{fs[_0xe16a('0x20')](_0x21f798);fs[_0xe16a('0x41')](_0xb2848b,_0xe16a('0x3f'));}catch(_0x4228ed){logger[_0xe16a('0x17')](_0x4228ed);}return _0xb2848b['split']('.')[0x0];});};exports[_0xe16a('0x61')]=function(_0x428a78,_0x410508,_0x196502,_0x265ca1,_0x58f938,_0x19b087){return aws[_0xe16a('0x62')](_0x428a78,_0x410508,_0x196502,_0x265ca1,_0x58f938,_0x19b087)[_0xe16a('0x2e')](function(_0x3de81f){logger[_0xe16a('0x1d')](JSON[_0xe16a('0x63')](_0x3de81f));return _0x3de81f;});};exports['ispeechTTS']=function(_0x59ea4e,_0x4dcc79,_0x1f75c1,_0x16769e){var _0x379316=util['format'](_0xe16a('0x64'),ISPEECH_API,_0x59ea4e,encodeURIComponent(_0x4dcc79),_0x1f75c1,_0x16769e);var _0x410165=path[_0xe16a('0x2a')](__dirname,'tmp',rs[_0xe16a('0x2c')](0x4)+_0xe16a('0x3b'));var _0x2d7a77;return downloadFile(_0x379316,_0x410165)[_0xe16a('0x2e')](function(){_0x2d7a77=path[_0xe16a('0x2a')](__dirname,_0xe16a('0x2b'),rs['generate'](0x4)+_0xe16a('0x40'));return convertFile(_0x410165,_0x2d7a77);})[_0xe16a('0x2e')](function(){try{fs[_0xe16a('0x20')](_0x410165);fs[_0xe16a('0x41')](_0x2d7a77,'777');}catch(_0x2a8dd8){logger['error'](_0x2a8dd8);}return _0x2d7a77[_0xe16a('0x2f')]('.')[0x0];});};exports['ispeechASR']=function(_0x30cbf1,_0x31606f,_0x24542c,_0x55cb7e){var _0x4f297e=util[_0xe16a('0x65')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x31606f,_0x24542c,base64Encode(_0x30cbf1),_0x55cb7e?util[_0xe16a('0x65')]('model=%s',encodeURIComponent(_0x55cb7e)):_0xe16a('0x66'));return uploadFile(_0x4f297e)[_0xe16a('0x2e')](function(_0x36ccd3){return querystring[_0xe16a('0x4')](_0x36ccd3);});};exports['sestekNDA']=function(_0x3fb950,_0x322443){return sestek[_0xe16a('0x67')](_0x3fb950,_0x322443)[_0xe16a('0x2e')](function(_0x5807fe){logger[_0xe16a('0x1d')](JSON[_0xe16a('0x63')](_0x5807fe));var _0x26c867={'speech':_0x5807fe['text'],'action':_0x5807fe[_0xe16a('0x68')]?_0x5807fe[_0xe16a('0x68')]['CustomAction']:undefined,'actiondata':_0x5807fe['channelData']?_0x5807fe[_0xe16a('0x68')][_0xe16a('0x69')]:undefined};if(_0x5807fe['channelData']&&_0x5807fe['channelData']['AudioFromTts']){return base64Decode(_0x5807fe[_0xe16a('0x68')][_0xe16a('0x6a')][_0xe16a('0x6b')],path[_0xe16a('0x2a')](__dirname,_0xe16a('0x2b'),rs['generate'](0x4)+_0xe16a('0x40')))[_0xe16a('0x2e')](function(_0x22f537){_0x26c867[_0xe16a('0x6c')]=_0x22f537;return _0x26c867;});}return _0x26c867;});};exports[_0xe16a('0x6d')]=function(){return __dirname;}; \ No newline at end of file +var _0xddd2=['writeFile','chmodSync','googleCloudTTS\x20path','googleTTS','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','googleDialogflow','stringify','result','source','action','fulfillment','speech','score','status','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','path','url','parse','bluebird','sox','request-promise','util','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','unlink','error','download\x20error','pipe','WHAT_EVER','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent'];(function(_0x40e696,_0x2197f3){var _0x34dd0e=function(_0x545344){while(--_0x545344){_0x40e696['push'](_0x40e696['shift']());}};_0x34dd0e(++_0x2197f3);}(_0xddd2,0xa5));var _0x2ddd=function(_0xf22b3b,_0x435061){_0xf22b3b=_0xf22b3b-0x0;var _0x34fd6c=_0xddd2[_0xf22b3b];return _0x34fd6c;};'use strict';var fs=require('fs');var path=require(_0x2ddd('0x0'));var http=require('http');var https=require('https');var urlParse=require(_0x2ddd('0x1'))[_0x2ddd('0x2')];var BPromise=require(_0x2ddd('0x3'));var rs=require('randomstring');var sox=require(_0x2ddd('0x4'));var rp=require(_0x2ddd('0x5'));var util=require(_0x2ddd('0x6'));var querystring=require(_0x2ddd('0x7'));var tts=require(_0x2ddd('0x8'));var apiai=require(_0x2ddd('0x9'));var md5=require(_0x2ddd('0xa'));var google=require(_0x2ddd('0xb'));var aws=require(_0x2ddd('0xc'));var tilde=require(_0x2ddd('0xd'));var sestek=require('./sestek');var logger=require(_0x2ddd('0xe'))(_0x2ddd('0xf'));var ISPEECH_API=_0x2ddd('0x10');function downloadFile(_0x5a4e8c,_0x16b657){return new BPromise(function(_0x3cb7e3,_0x5d4309){var _0x5bbded=urlParse(_0x5a4e8c);var _0x4155ca=_0x5bbded[_0x2ddd('0x11')]===_0x2ddd('0x12')?https:http;var _0x4c1774={'host':_0x5bbded[_0x2ddd('0x13')],'path':_0x5bbded['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4155ca[_0x2ddd('0x14')](_0x4c1774,function(_0x5006f8){if(_0x5006f8[_0x2ddd('0x15')]!==0xc8){logger['error'](_0x2ddd('0x16')+_0x5a4e8c+_0x2ddd('0x17')+_0x5006f8[_0x2ddd('0x15')]+'\x20('+_0x5006f8[_0x2ddd('0x18')]+')');_0x5d4309(new Error(_0x2ddd('0x16')+_0x5a4e8c+'\x20failed,\x20status\x20code\x20=\x20'+_0x5006f8[_0x2ddd('0x15')]+'\x20('+_0x5006f8[_0x2ddd('0x18')]+')'));return;}var _0x18b2ee=fs[_0x2ddd('0x19')](_0x16b657);_0x18b2ee['on'](_0x2ddd('0x1a'),function(){logger[_0x2ddd('0x1b')](_0x2ddd('0x1c'));_0x18b2ee['close'](_0x3cb7e3);});_0x18b2ee['on']('error',function(_0xf418ca){fs[_0x2ddd('0x1d')](_0x16b657);logger[_0x2ddd('0x1e')](_0x2ddd('0x1f'),_0xf418ca);_0x5d4309(_0xf418ca);});_0x5006f8[_0x2ddd('0x20')](_0x18b2ee);})['on'](_0x2ddd('0x1e'),function(_0x2a627b){logger[_0x2ddd('0x1e')](_0x2a627b);_0x5d4309(_0x2a627b);})['end']();});}function uploadFile(_0xcabc10){return new BPromise(function(_0x544666,_0x1ebf51){var _0x206381=urlParse(_0xcabc10);var _0x2d94e0=_0x206381[_0x2ddd('0x11')]===_0x2ddd('0x12')?https:http;var _0x2e71fb={'host':_0x206381[_0x2ddd('0x13')],'path':_0x206381['path'],'headers':{'user-agent':_0x2ddd('0x21')}};_0x2d94e0['get'](_0x2e71fb,function(_0x3717ba){if(_0x3717ba['statusCode']!==0xc8){_0x1ebf51(new Error(_0x2ddd('0x16')+_0xcabc10+_0x2ddd('0x17')+_0x3717ba[_0x2ddd('0x15')]+'\x20('+_0x3717ba[_0x2ddd('0x18')]+')'));return;}var _0x301380='';_0x3717ba['on'](_0x2ddd('0x22'),function(_0x3c13c4){_0x301380+=_0x3c13c4;});_0x3717ba['on'](_0x2ddd('0x23'),function(){_0x544666(_0x301380);});})['on'](_0x2ddd('0x1e'),function(_0x285b4e){_0x1ebf51(_0x285b4e);})[_0x2ddd('0x23')]();});}function convertFile(_0x4b554c,_0x1170ac){return new BPromise(function(_0x146325,_0x3fadf5){var _0x4d0472=sox[_0x2ddd('0x24')](_0x4b554c,_0x1170ac,{'sampleRate':0x1f40,'format':_0x2ddd('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4d0472['on']('error',function(_0x269db0){logger['error'](_0x2ddd('0x26'),_0x269db0);_0x3fadf5(_0x269db0);});_0x4d0472['on'](_0x2ddd('0x23'),function(){logger[_0x2ddd('0x1b')](_0x2ddd('0x27'));_0x146325();});_0x4d0472[_0x2ddd('0x28')]();});}function base64Decode(_0x2544cd,_0x3a762d){var _0x4f1fd2=path[_0x2ddd('0x29')](__dirname,_0x2ddd('0x2a'),rs[_0x2ddd('0x2b')](0x4)+_0x2ddd('0x2c'));fs[_0x2ddd('0x2d')](_0x4f1fd2,_0x2544cd,_0x2ddd('0x2e'));return convertFile(_0x4f1fd2,_0x3a762d)[_0x2ddd('0x2f')](function(){try{fs['unlink'](_0x4f1fd2);fs['chmodSync'](_0x3a762d,_0x2ddd('0x30'));}catch(_0x3361f9){logger[_0x2ddd('0x1e')](_0x3361f9);}return _0x3a762d[_0x2ddd('0x31')]('.')[0x0];});}function base64Encode(_0x133e9c){var _0x24c8ba=fs['readFileSync'](_0x133e9c);return new Buffer(_0x24c8ba)[_0x2ddd('0x32')](_0x2ddd('0x2e'));}exports[_0x2ddd('0x33')]=function(_0x190273,_0x26ca9e,_0x2ab1a9,_0x4447e8,_0x501c98,_0x34b824){var _0x3404f6,_0x2183ff;var _0x434bb5=_0x2ddd('0x34');var _0x4a7c54=_0x2ddd('0x35')+_0x190273;var _0x207a35={};if(_0x26ca9e===_0x2ddd('0x36')){_0x207a35[_0x2ddd('0x37')]={'ssml':_0x2ab1a9};}else{_0x207a35[_0x2ddd('0x37')]={'text':_0x2ab1a9};};_0x207a35['voice']={'languageCode':_0x4447e8,'ssmlGender':_0x501c98};_0x207a35[_0x2ddd('0x38')]={'audioEncoding':_0x2ddd('0x39'),'sampleRateHertz':0x1f40};var _0x459208={'url':_0x434bb5+_0x2ddd('0x3a')+_0x4a7c54,'method':_0x2ddd('0x3b'),'json':!![],'body':_0x207a35};return rp(_0x459208)['then'](function(_0x38b2b7){return new BPromise(function(_0x77966b,_0x5c1fcd){_0x3404f6=path[_0x2ddd('0x29')](__dirname,_0x2ddd('0x2a'),rs[_0x2ddd('0x2b')](0x4)+_0x2ddd('0x3c'));var _0xaffc7b=Buffer[_0x2ddd('0x3d')](_0x38b2b7[_0x2ddd('0x3e')],_0x2ddd('0x2e'));return fs[_0x2ddd('0x3f')](_0x3404f6,_0xaffc7b,function(_0x5d7768){_0x5c1fcd(_0x5d7768);},function(_0x1be970){fs[_0x2ddd('0x40')](_0x3404f6,_0x2ddd('0x30'));_0x77966b(_0x1be970);});});})[_0x2ddd('0x2f')](function(_0x4be2b5){_0x2183ff=path[_0x2ddd('0x29')](__dirname,_0x2ddd('0x2a'),rs['generate'](0x4)+'.wav');return convertFile(_0x3404f6,_0x2183ff);})[_0x2ddd('0x2f')](function(){try{fs[_0x2ddd('0x1d')](_0x3404f6);fs['chmodSync'](_0x2183ff,_0x2ddd('0x30'));}catch(_0x20a27e){logger[_0x2ddd('0x1e')](_0x20a27e);}logger[_0x2ddd('0x1b')](_0x2ddd('0x41'),_0x2183ff[_0x2ddd('0x31')]('.')[0x0]);return _0x2183ff[_0x2ddd('0x31')]('.')[0x0];});};exports[_0x2ddd('0x42')]=function(_0x23eda4,_0x359f17){var _0x4bd86e,_0x5a3333;return tts(_0x23eda4,_0x359f17||'en',0x1)['then'](function(_0x45396d){logger[_0x2ddd('0x1b')](_0x45396d);_0x4bd86e=path[_0x2ddd('0x29')](__dirname,_0x2ddd('0x2a'),rs[_0x2ddd('0x2b')](0x4)+'.mp3');return downloadFile(_0x45396d,_0x4bd86e);})[_0x2ddd('0x2f')](function(){_0x5a3333=path[_0x2ddd('0x29')](__dirname,_0x2ddd('0x2a'),rs[_0x2ddd('0x2b')](0x4)+_0x2ddd('0x2c'));return convertFile(_0x4bd86e,_0x5a3333);})['then'](function(){try{fs[_0x2ddd('0x1d')](_0x4bd86e);fs[_0x2ddd('0x40')](_0x5a3333,_0x2ddd('0x30'));}catch(_0x32a0ed){logger['error'](_0x32a0ed);}logger['info'](_0x2ddd('0x43'),_0x5a3333[_0x2ddd('0x31')]('.')[0x0]);return _0x5a3333[_0x2ddd('0x31')]('.')[0x0];});};exports[_0x2ddd('0x44')]=function(_0x1e1964,_0x5290d9,_0x30c058){return google[_0x2ddd('0x45')](_0x1e1964,_0x5290d9,_0x30c058)[_0x2ddd('0x2f')](function(_0x600529){logger[_0x2ddd('0x1b')](_0x600529[_0x2ddd('0x46')]);return rp(_0x600529);})['then'](function(_0x2a89eb){var _0x16c53c='';var _0x4ec20b=0x0;try{fs['unlink'](_0x1e1964);}catch(_0x32804d){logger[_0x2ddd('0x1e')](_0x32804d);}if(_0x2a89eb&&_0x2a89eb[_0x2ddd('0x47')]){_0x16c53c=_0x2a89eb[_0x2ddd('0x47')][_0x2ddd('0x48')](function(_0x3eddfb){return _0x3eddfb&&_0x3eddfb['alternatives'][0x0]&&_0x3eddfb[_0x2ddd('0x49')][0x0]['transcript']?_0x3eddfb[_0x2ddd('0x49')][0x0][_0x2ddd('0x4a')]:'';})[_0x2ddd('0x4b')]('\x0a');_0x4ec20b=_0x2a89eb[_0x2ddd('0x47')][_0x2ddd('0x48')](function(_0x50df1e){return _0x50df1e&&_0x50df1e['alternatives'][0x0]&&_0x50df1e[_0x2ddd('0x49')][0x0][_0x2ddd('0x4c')]?_0x50df1e[_0x2ddd('0x49')][0x0][_0x2ddd('0x4c')]:0x0;})[_0x2ddd('0x4b')]('\x0a');}logger[_0x2ddd('0x1b')](_0x2ddd('0x4d'),_0x16c53c);logger[_0x2ddd('0x1b')](_0x2ddd('0x4e'),_0x4ec20b);return{'transcript':_0x16c53c,'confidence':_0x4ec20b};})[_0x2ddd('0x4f')](function(_0x409cb7){logger[_0x2ddd('0x1e')](_0x2ddd('0x50'),_0x409cb7[_0x2ddd('0x15')],_0x409cb7['name'],_0x409cb7['message']);});};exports[_0x2ddd('0x51')]=function(_0x4f2968,_0x523a37,_0x5b0785,_0x458b10){var _0x2e8b18=apiai(_0x523a37,{'language':_0x458b10||'en'});return _0x2e8b18['textRequest'](_0x5b0785,{'sessionId':md5(_0x4f2968)})[_0x2ddd('0x2f')](function(_0x3a3626){logger['info'](JSON[_0x2ddd('0x52')](_0x3a3626));return{'source':_0x3a3626[_0x2ddd('0x53')][_0x2ddd('0x54')],'resolvedQuery':_0x3a3626['result']['resolvedQuery'],'action':_0x3a3626[_0x2ddd('0x53')][_0x2ddd('0x55')],'actionIncomplete':_0x3a3626[_0x2ddd('0x53')]['actionIncomplete'],'speech':_0x3a3626['result'][_0x2ddd('0x56')][_0x2ddd('0x57')],'score':_0x3a3626[_0x2ddd('0x53')][_0x2ddd('0x58')],'statusCode':_0x3a3626[_0x2ddd('0x59')]['code'],'endConversation':_0x3a3626[_0x2ddd('0x53')]['metadata'][_0x2ddd('0x5a')]||![],'isFallbackIntent':_0x3a3626['result']['metadata'][_0x2ddd('0x5b')]};});};exports[_0x2ddd('0x5c')]=function(_0x339049,_0x29acf3,_0x36fae3,_0x576909){return tilde[_0x2ddd('0x45')](_0x339049,_0x29acf3,_0x36fae3,_0x576909)['then'](function(_0x271229){try{fs['unlink'](_0x339049);}catch(_0x5497ea){logger['error'](_0x5497ea);}logger[_0x2ddd('0x1b')](_0x2ddd('0x5d'),_0x271229['transcript']);logger[_0x2ddd('0x1b')](_0x2ddd('0x5e'),_0x271229[_0x2ddd('0x4c')]);return _0x271229;});};exports[_0x2ddd('0x5f')]=function(_0x4a70e7,_0x2b480b,_0x3a5529,_0x19d698,_0x277a27,_0xa92542){var _0x16f2f0=path[_0x2ddd('0x29')](__dirname,_0x2ddd('0x2a'),rs[_0x2ddd('0x2b')](0x4)+_0x2ddd('0x3c'));var _0x57e1cd;return aws[_0x2ddd('0x60')](_0x4a70e7,_0x2b480b,_0x3a5529,_0x19d698,_0x277a27,_0xa92542,_0x16f2f0)[_0x2ddd('0x2f')](function(){_0x57e1cd=path['resolve'](__dirname,_0x2ddd('0x2a'),rs[_0x2ddd('0x2b')](0x4)+_0x2ddd('0x2c'));return convertFile(_0x16f2f0,_0x57e1cd);})['then'](function(){try{fs[_0x2ddd('0x1d')](_0x16f2f0);fs['chmodSync'](_0x57e1cd,_0x2ddd('0x30'));}catch(_0x2afbb8){logger[_0x2ddd('0x1e')](_0x2afbb8);}return _0x57e1cd[_0x2ddd('0x31')]('.')[0x0];});};exports[_0x2ddd('0x61')]=function(_0x99ba2f,_0x280784,_0xa5b7f5,_0x2b87d1,_0x1217e3,_0x37bdfd){return aws[_0x2ddd('0x62')](_0x99ba2f,_0x280784,_0xa5b7f5,_0x2b87d1,_0x1217e3,_0x37bdfd)['then'](function(_0x731451){logger[_0x2ddd('0x1b')](JSON['stringify'](_0x731451));return _0x731451;});};exports[_0x2ddd('0x63')]=function(_0x2037a5,_0x478ba9,_0x14c722,_0x265cab){var _0x22298a=util[_0x2ddd('0x64')](_0x2ddd('0x65'),ISPEECH_API,_0x2037a5,encodeURIComponent(_0x478ba9),_0x14c722,_0x265cab);var _0x2861f9=path['resolve'](__dirname,'tmp',rs[_0x2ddd('0x2b')](0x4)+'.mp3');var _0x1a639f;return downloadFile(_0x22298a,_0x2861f9)[_0x2ddd('0x2f')](function(){_0x1a639f=path[_0x2ddd('0x29')](__dirname,'tmp',rs['generate'](0x4)+_0x2ddd('0x2c'));return convertFile(_0x2861f9,_0x1a639f);})[_0x2ddd('0x2f')](function(){try{fs[_0x2ddd('0x1d')](_0x2861f9);fs['chmodSync'](_0x1a639f,_0x2ddd('0x30'));}catch(_0x47f447){logger[_0x2ddd('0x1e')](_0x47f447);}return _0x1a639f[_0x2ddd('0x31')]('.')[0x0];});};exports[_0x2ddd('0x66')]=function(_0x4e1c77,_0x58825a,_0x213caa,_0x85b4e7){var _0x1c5651=util['format'](_0x2ddd('0x67'),ISPEECH_API,_0x58825a,_0x213caa,base64Encode(_0x4e1c77),_0x85b4e7?util['format']('model=%s',encodeURIComponent(_0x85b4e7)):_0x2ddd('0x68'));return uploadFile(_0x1c5651)[_0x2ddd('0x2f')](function(_0x4c0d45){return querystring[_0x2ddd('0x2')](_0x4c0d45);});};exports[_0x2ddd('0x69')]=function(_0x5bb6a6,_0x5bec8e){return sestek[_0x2ddd('0x6a')](_0x5bb6a6,_0x5bec8e)['then'](function(_0x5addba){logger[_0x2ddd('0x1b')](JSON[_0x2ddd('0x52')](_0x5addba));var _0xbfef2={'speech':_0x5addba[_0x2ddd('0x6b')],'action':_0x5addba[_0x2ddd('0x6c')]?_0x5addba['channelData'][_0x2ddd('0x6d')]:undefined,'actiondata':_0x5addba[_0x2ddd('0x6c')]?_0x5addba[_0x2ddd('0x6c')]['CustomActionData']:undefined};if(_0x5addba[_0x2ddd('0x6c')]&&_0x5addba['channelData'][_0x2ddd('0x6e')]){return base64Decode(_0x5addba[_0x2ddd('0x6c')][_0x2ddd('0x6e')][_0x2ddd('0x6f')],path[_0x2ddd('0x29')](__dirname,_0x2ddd('0x2a'),rs['generate'](0x4)+_0x2ddd('0x2c')))[_0x2ddd('0x2f')](function(_0xc26716){_0xbfef2[_0x2ddd('0x70')]=_0xc26716;return _0xbfef2;});}return _0xbfef2;});};exports[_0x2ddd('0x71')]=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 7590e4c..03f75cb 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 _0xd83c=['exports','./nda'];(function(_0x5ad00b,_0x22c334){var _0x2aab79=function(_0x999352){while(--_0x999352){_0x5ad00b['push'](_0x5ad00b['shift']());}};_0x2aab79(++_0x22c334);}(_0xd83c,0x129));var _0xcd83=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0xd83c[_0x12b683];return _0xfb150b;};var nda=require(_0xcd83('0x0'));module[_0xcd83('0x1')]={'nda':nda}; \ No newline at end of file +var _0x8bbb=['exports','./nda'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x8bbb,0x83));var _0xb8bb=function(_0x3dc68d,_0x1c1951){_0x3dc68d=_0x3dc68d-0x0;var _0xdf7f94=_0x8bbb[_0x3dc68d];return _0xdf7f94;};var nda=require(_0xb8bb('0x0'));module[_0xb8bb('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 69bd632..b915da1 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 _0x2076=['request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','ProjectName','body','custom_action','channelData','CustomActionData','custom_action_data','info','stringify'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0x2076,0x9b));var _0x6207=function(_0x1f9b32,_0x1dfba0){_0x1f9b32=_0x1f9b32-0x0;var _0x1e59a9=_0x2076[_0x1f9b32];return _0x1e59a9;};'use strict';var rp=require(_0x6207('0x0'));var url=require('url');var logger=require(_0x6207('0x1'))(_0x6207('0x2'));module[_0x6207('0x3')]=function(_0x2664fc,_0x2f79f1){var _0x53406d={'method':_0x6207('0x4'),'uri':url[_0x6207('0x5')](_0x2f79f1[_0x6207('0x6')],_0x6207('0x7')),'form':{'grant_type':_0x6207('0x8'),'username':_0x2f79f1['username'],'password':_0x2f79f1[_0x6207('0x8')]},'json':!![]};return rp(_0x53406d)['then'](function(_0xd14611){var _0x295fec={'method':_0x6207('0x4'),'uri':url[_0x6207('0x5')](_0x2f79f1[_0x6207('0x9')],_0x6207('0xa')),'body':{'type':_0x2f79f1[_0x6207('0xb')]||_0x6207('0xc'),'channelId':_0x6207('0xd'),'conversation':{'id':_0x2664fc[_0x6207('0xe')]},'from':{'id':_0x2664fc[_0x6207('0xf')],'name':_0x2664fc[_0x6207('0x10')]},'recipient':{'id':_0x2664fc[_0x6207('0x11')],'name':_0x2664fc[_0x6207('0x12')]},'text':_0x2f79f1[_0x6207('0x13')],'channelData':{}},'headers':{'Authorization':_0x6207('0x14')+_0xd14611[_0x6207('0x15')]},'json':!![]};if(_0x2f79f1[_0x6207('0x16')]){_0x295fec['body']['channelData'][_0x6207('0x17')]=_0x2f79f1[_0x6207('0x16')];}if(_0x2f79f1['ndagenerate_audio']=='1'){_0x295fec[_0x6207('0x18')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x2f79f1[_0x6207('0x19')]){_0x295fec[_0x6207('0x18')][_0x6207('0x1a')]['CustomAction']=_0x2f79f1[_0x6207('0x19')];if(_0x2f79f1['custom_action_data']){_0x295fec[_0x6207('0x18')][_0x6207('0x1a')][_0x6207('0x1b')]=_0x2f79f1[_0x6207('0x1c')];}}logger[_0x6207('0x1d')](JSON[_0x6207('0x1e')](_0x295fec));return rp(_0x295fec);});}; \ No newline at end of file +var _0x04a3=['extension','access_token','project','body','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','channelData','CustomAction','CustomActionData','custom_action_data','stringify','request-promise','../../../../../config/logger','agi','exports','resolve','ndauth_url','username','password','POST','ndassistant_url','ndaactivity_type','message','Nda','calleridname','dnid'];(function(_0x44e7a8,_0x1081e4){var _0xa2bf66=function(_0x1cb85e){while(--_0x1cb85e){_0x44e7a8['push'](_0x44e7a8['shift']());}};_0xa2bf66(++_0x1081e4);}(_0x04a3,0x1e9));var _0x304a=function(_0x4b909e,_0x23d1a2){_0x4b909e=_0x4b909e-0x0;var _0x1835f4=_0x04a3[_0x4b909e];return _0x1835f4;};'use strict';var rp=require(_0x304a('0x0'));var url=require('url');var logger=require(_0x304a('0x1'))(_0x304a('0x2'));module[_0x304a('0x3')]=function(_0x18ec9a,_0x20377e){var _0x3bcaaf={'method':'POST','uri':url[_0x304a('0x4')](_0x20377e[_0x304a('0x5')],'/token'),'form':{'grant_type':'password','username':_0x20377e[_0x304a('0x6')],'password':_0x20377e[_0x304a('0x7')]},'json':!![]};return rp(_0x3bcaaf)['then'](function(_0x150099){var _0x2505d3={'method':_0x304a('0x8'),'uri':url[_0x304a('0x4')](_0x20377e[_0x304a('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x20377e[_0x304a('0xa')]||_0x304a('0xb'),'channelId':_0x304a('0xc'),'conversation':{'id':_0x18ec9a['uniqueid']},'from':{'id':_0x18ec9a['callerid'],'name':_0x18ec9a[_0x304a('0xd')]},'recipient':{'id':_0x18ec9a[_0x304a('0xe')],'name':_0x18ec9a[_0x304a('0xf')]},'text':_0x20377e['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x150099[_0x304a('0x10')]},'json':!![]};if(_0x20377e[_0x304a('0x11')]){_0x2505d3[_0x304a('0x12')]['channelData'][_0x304a('0x13')]=_0x20377e['project'];}if(_0x20377e[_0x304a('0x14')]=='1'){_0x2505d3[_0x304a('0x12')]['channelData'][_0x304a('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x20377e[_0x304a('0x16')]){_0x2505d3[_0x304a('0x12')][_0x304a('0x17')][_0x304a('0x18')]=_0x20377e[_0x304a('0x16')];if(_0x20377e['custom_action_data']){_0x2505d3['body']['channelData'][_0x304a('0x19')]=_0x20377e[_0x304a('0x1a')];}}logger['info'](JSON[_0x304a('0x1b')](_0x2505d3));return rp(_0x2505d3);});}; \ 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 8da86c4..4b2debd 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 _0xd6ec=['exports'];(function(_0x10c939,_0x382bf7){var _0x12b5af=function(_0x1683bf){while(--_0x1683bf){_0x10c939['push'](_0x10c939['shift']());}};_0x12b5af(++_0x382bf7);}(_0xd6ec,0x6e));var _0xcd6e=function(_0x1f9847,_0x14440d){_0x1f9847=_0x1f9847-0x0;var _0x1863eb=_0xd6ec[_0x1f9847];return _0x1863eb;};'use strict';var asr=require('./lib/api');module[_0xcd6e('0x0')]=function(_0x4623f9,_0x1c8f0f,_0x437323,_0x3f037c){return asr(_0x4623f9,_0x1c8f0f,_0x437323,_0x3f037c);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x41c617,_0x5533d1,_0x10e0d8,_0xa000e6){return asr(_0x41c617,_0x5533d1,_0x10e0d8,_0xa000e6);}; \ 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 8bc89e6..f212dae 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 _0x5fc8=['Authentication\x20failed.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','EOS','Tilde\x20ASR\x20send\x20error','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.'];(function(_0x440acb,_0x5dee65){var _0x4b04ab=function(_0x3da7e6){while(--_0x3da7e6){_0x440acb['push'](_0x440acb['shift']());}};_0x4b04ab(++_0x5dee65);}(_0x5fc8,0xae));var _0x85fc=function(_0x45eab2,_0x28e2ba){_0x45eab2=_0x45eab2-0x0;var _0x1f939b=_0x5fc8[_0x45eab2];return _0x1f939b;};'use strict';var BPromise=require(_0x85fc('0x0'));var _=require(_0x85fc('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x85fc('0x2'));var crypto=require(_0x85fc('0x3'));var logger=require(_0x85fc('0x4'))(_0x85fc('0x5'));module['exports']=function(_0x2cabaa,_0x124459,_0x193faa,_0x22b9e7){return new BPromise(function(_0x8e490e,_0x3ab97e){logger[_0x85fc('0x6')](_0x85fc('0x7'),_0x22b9e7||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x456b81=new WebSocket(_0x22b9e7||_0x85fc('0x8'),{'perMessageDeflate':![]});var _0x58c4c1='';var _0x340790='0';var _0x23a742='1';var _0x2d0b41='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4b3713(_0x3b0d7a){var _0x4c62f2=crypto['createHash'](_0x85fc('0x9'));_0x4c62f2[_0x85fc('0xa')](_0x3b0d7a);return _0x4c62f2[_0x85fc('0xb')](_0x85fc('0xc'));}function _0xb7add3(){try{logger[_0x85fc('0x6')](_0x85fc('0xd'));var _0x52e94d=moment()['unix']();var _0x710fed=_0x4b3713(_0x52e94d+_0x124459+_0x193faa);_0x456b81[_0x85fc('0xe')](JSON[_0x85fc('0xf')]({'appID':_0x124459,'timestamp':_0x52e94d,'appKey':_0x710fed}));var _0x5080a5=fs[_0x85fc('0x10')](_0x2cabaa);_0x5080a5['on'](_0x85fc('0x11'),function(_0x41bc44){_0x456b81[_0x85fc('0xe')](_0x41bc44);});_0x5080a5['on']('close',function(){_0x456b81[_0x85fc('0xe')](_0x85fc('0x12'));});}catch(_0x764425){logger['error'](_0x85fc('0x13'),JSON[_0x85fc('0xf')](_0x764425));_0x456b81['terminate']();}}function _0x2a42b7(_0xf014c3){try{if(_0xf014c3){var _0x3b84c6=JSON['parse'](_0xf014c3);switch(_0x3b84c6[_0x85fc('0x14')]){case 0x0:if(_0x3b84c6['result']){if(_0x3b84c6[_0x85fc('0x15')][_0x85fc('0x16')]){logger[_0x85fc('0x6')](_0x85fc('0x17'),JSON[_0x85fc('0xf')](_0x3b84c6[_0x85fc('0x15')][_0x85fc('0x18')]));_0x58c4c1=_0x3b84c6[_0x85fc('0x15')][_0x85fc('0x18')][0x0][_0x85fc('0x19')];_0x340790=_0x3b84c6[_0x85fc('0x15')][_0x85fc('0x18')][0x0][_0x85fc('0x1a')];_0x23a742='0';_0x2d0b41=_0x85fc('0x1b');_0x456b81['terminate']();}}break;case 0x1:logger[_0x85fc('0x6')](_0x85fc('0x1c'));_0x23a742='1';_0x2d0b41='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x85fc('0x6')](_0x85fc('0x1d'));_0x23a742='2';_0x2d0b41='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x85fc('0x6')](_0x85fc('0x1e'));_0x23a742='9';_0x2d0b41=_0x85fc('0x1e');break;case 0xa:logger[_0x85fc('0x6')](_0x85fc('0x1f'));_0x23a742='10';_0x2d0b41=_0x85fc('0x1f');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x23a742='11';_0x2d0b41='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x2ddf61){logger[_0x85fc('0x20')](_0x85fc('0x21'),JSON[_0x85fc('0xf')](_0x2ddf61));_0x456b81['terminate']();}}function _0x4143dc(){logger[_0x85fc('0x6')](_0x85fc('0x22'));_0x8e490e({'transcript':_0x58c4c1,'confidence':_0x340790,'status':_0x23a742,'status_message':_0x2d0b41});}function _0x1c6763(_0x12f4b7){logger[_0x85fc('0x20')](_0x85fc('0x23'));if(!_[_0x85fc('0x24')](_0x12f4b7)){logger[_0x85fc('0x20')](_[_0x85fc('0x25')](_0x12f4b7)?JSON['stringify'](_0x12f4b7):_0x12f4b7);}}_0x456b81['on'](_0x85fc('0x26'),_0xb7add3);_0x456b81['on'](_0x85fc('0x27'),_0x2a42b7);_0x456b81['on'](_0x85fc('0x28'),_0x4143dc);_0x456b81['on'](_0x85fc('0x20'),_0x1c6763);});}; \ No newline at end of file +var _0xe97f=['stringify','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isObject','open','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','error','Tilde\x20ASR\x20send\x20error'];(function(_0x4f97bd,_0x51ead5){var _0x3bfb16=function(_0x1a7922){while(--_0x1a7922){_0x4f97bd['push'](_0x4f97bd['shift']());}};_0x3bfb16(++_0x51ead5);}(_0xe97f,0x1be));var _0xfe97=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xe97f[_0x36eaaa];return _0x461349;};'use strict';var BPromise=require(_0xfe97('0x0'));var _=require(_0xfe97('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xfe97('0x2'));var crypto=require(_0xfe97('0x3'));var logger=require(_0xfe97('0x4'))(_0xfe97('0x5'));module[_0xfe97('0x6')]=function(_0x4a8645,_0x39b14e,_0x129385,_0x569b96){return new BPromise(function(_0x2794e9,_0x3fe3e3){logger[_0xfe97('0x7')](_0xfe97('0x8'),_0x569b96||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x374db3=new WebSocket(_0x569b96||_0xfe97('0x9'),{'perMessageDeflate':![]});var _0x4847a7='';var _0x156c1e='0';var _0x470573='1';var _0x384cdf=_0xfe97('0xa');function _0x90766b(_0x2ccc7c){var _0x550db3=crypto[_0xfe97('0xb')]('sha1');_0x550db3[_0xfe97('0xc')](_0x2ccc7c);return _0x550db3[_0xfe97('0xd')](_0xfe97('0xe'));}function _0x5efa23(){try{logger['info'](_0xfe97('0xf'));var _0x5a1983=moment()[_0xfe97('0x10')]();var _0x535fb7=_0x90766b(_0x5a1983+_0x39b14e+_0x129385);_0x374db3[_0xfe97('0x11')](JSON['stringify']({'appID':_0x39b14e,'timestamp':_0x5a1983,'appKey':_0x535fb7}));var _0xb79752=fs[_0xfe97('0x12')](_0x4a8645);_0xb79752['on'](_0xfe97('0x13'),function(_0x38e66a){_0x374db3[_0xfe97('0x11')](_0x38e66a);});_0xb79752['on']('close',function(){_0x374db3[_0xfe97('0x11')]('EOS');});}catch(_0x150784){logger[_0xfe97('0x14')](_0xfe97('0x15'),JSON[_0xfe97('0x16')](_0x150784));_0x374db3[_0xfe97('0x17')]();}}function _0x137344(_0x30fead){try{if(_0x30fead){var _0x42c9d2=JSON['parse'](_0x30fead);switch(_0x42c9d2[_0xfe97('0x18')]){case 0x0:if(_0x42c9d2[_0xfe97('0x19')]){if(_0x42c9d2[_0xfe97('0x19')][_0xfe97('0x1a')]){logger[_0xfe97('0x7')](_0xfe97('0x1b'),JSON[_0xfe97('0x16')](_0x42c9d2['result'][_0xfe97('0x1c')]));_0x4847a7=_0x42c9d2[_0xfe97('0x19')][_0xfe97('0x1c')][0x0]['transcript'];_0x156c1e=_0x42c9d2[_0xfe97('0x19')]['hypotheses'][0x0]['likelihood'];_0x470573='0';_0x384cdf=_0xfe97('0x1d');_0x374db3[_0xfe97('0x17')]();}}break;case 0x1:logger[_0xfe97('0x7')](_0xfe97('0xa'));_0x470573='1';_0x384cdf='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xfe97('0x7')](_0xfe97('0x1e'));_0x470573='2';_0x384cdf=_0xfe97('0x1e');break;case 0x9:logger[_0xfe97('0x7')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x470573='9';_0x384cdf=_0xfe97('0x1f');break;case 0xa:logger['info']('Authentication\x20failed.');_0x470573='10';_0x384cdf=_0xfe97('0x20');break;case 0xb:logger[_0xfe97('0x7')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x470573='11';_0x384cdf=_0xfe97('0x21');}}}catch(_0x3d7f85){logger[_0xfe97('0x14')](_0xfe97('0x22'),JSON[_0xfe97('0x16')](_0x3d7f85));_0x374db3[_0xfe97('0x17')]();}}function _0x5e1e3e(){logger['info'](_0xfe97('0x23'));_0x2794e9({'transcript':_0x4847a7,'confidence':_0x156c1e,'status':_0x470573,'status_message':_0x384cdf});}function _0x57305e(_0x3c24c1){logger[_0xfe97('0x14')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x3c24c1)){logger[_0xfe97('0x14')](_[_0xfe97('0x24')](_0x3c24c1)?JSON[_0xfe97('0x16')](_0x3c24c1):_0x3c24c1);}}_0x374db3['on'](_0xfe97('0x25'),_0x5efa23);_0x374db3['on']('message',_0x137344);_0x374db3['on'](_0xfe97('0x26'),_0x5e1e3e);_0x374db3['on'](_0xfe97('0x14'),_0x57305e);});}; \ 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 d4db00b..86b0aca 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 _0x8265=['./asr','exports'];(function(_0x508685,_0x9f94af){var _0x976a76=function(_0x1bcb05){while(--_0x1bcb05){_0x508685['push'](_0x508685['shift']());}};_0x976a76(++_0x9f94af);}(_0x8265,0xa0));var _0x5826=function(_0x22bfc3,_0x1e257a){_0x22bfc3=_0x22bfc3-0x0;var _0x463592=_0x8265[_0x22bfc3];return _0x463592;};var asr=require(_0x5826('0x0'));module[_0x5826('0x1')]={'asr':asr}; \ No newline at end of file +var _0x2b47=['./asr'];(function(_0x10bb69,_0x4e76ec){var _0x48624d=function(_0x517962){while(--_0x517962){_0x10bb69['push'](_0x10bb69['shift']());}};_0x48624d(++_0x4e76ec);}(_0x2b47,0x77));var _0x72b4=function(_0x2d92c6,_0x53fc97){_0x2d92c6=_0x2d92c6-0x0;var _0x23dcda=_0x2b47[_0x2d92c6];return _0x23dcda;};var asr=require(_0x72b4('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 6dd67fd..281dca8 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 _0xc68d=['./channel','127.0.0.1','emit','error','listen','listening','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','net','events'];(function(_0x6f7a95,_0x3c05d2){var _0x41b8ff=function(_0x2d066a){while(--_0x2d066a){_0x6f7a95['push'](_0x6f7a95['shift']());}};_0x41b8ff(++_0x3c05d2);}(_0xc68d,0x17a));var _0xdc68=function(_0x36f54e,_0x4f91bc){_0x36f54e=_0x36f54e-0x0;var _0x347c6f=_0xc68d[_0x36f54e];return _0x347c6f;};'use strict';var util=require('util');var net=require(_0xdc68('0x0'));var EventEmitter=require(_0xdc68('0x1'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0xdc68('0x2'));var AGIServer=function(_0x3875a1,_0x38fe02,_0x314b9b){var _0x402e65=this,_0x3875a1=_0x3875a1||0x11dd,_0x38fe02=_0x38fe02||_0xdc68('0x3'),_0x36f545=null,_0x2709db=0x0;EventEmitter['call'](_0x402e65);function _0x214161(){if(!_0x3875a1){_0x402e65[_0xdc68('0x4')](_0xdc68('0x5'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x36f545=net['createServer']();_0x36f545[_0xdc68('0x6')](_0x3875a1,_0x38fe02);_0x36f545['on'](_0xdc68('0x7'),function(){_0x402e65[_0xdc68('0x4')](_0xdc68('0x7'));});_0x36f545['on']('connection',function(_0x420435){_0x36f545[_0xdc68('0x8')](function(_0x6db3df,_0x19c524){if(_0x6db3df){_0x402e65['emit'](_0xdc68('0x5'),new AGIError(_0xdc68('0x9'),_0x6db3df));}else if(_0x314b9b&&_0x314b9b<0x0){_0x402e65['emit'](_0xdc68('0x5'),new AGIError(_0xdc68('0xa')));_0x420435[_0xdc68('0xb')]();}else if(_0x314b9b&&_0x314b9b>0x0&&_0x314b9b<_0x19c524){_0x2709db+=0x1;_0x402e65['emit'](_0xdc68('0x5'),new AGIError(_0xdc68('0xc'),_0x2709db));_0x420435[_0xdc68('0xb')]();}else{var _0xd229ba=new AGIChannel(_0x420435);_0xd229ba['on'](_0xdc68('0xd'),function(){_0x402e65[_0xdc68('0x4')](_0xdc68('0xe'),_0xd229ba);});}});});_0x36f545['on']('error',function(_0x210d65){_0x402e65['emit'](_0xdc68('0x5'),new AGIError('E_AGI_SERVER_ERROR',_0x210d65[_0xdc68('0xf')]));});_0x36f545['on'](_0xdc68('0x10'),function(){_0x402e65['emit'](_0xdc68('0x10'),new AGIError(_0xdc68('0x11')));});}process[_0xdc68('0x12')](function(){_0x214161();});};util['inherits'](AGIServer,EventEmitter);module[_0xdc68('0x13')]=function(_0x3a52da,_0x40dbe7,_0x17c349){return new AGIServer(_0x3a52da,_0x40dbe7,_0x17c349);}; \ No newline at end of file +var _0xd73a=['listen','listening','connection','getConnections','error','destroy','E_AGI_SERVER_MAXCONNECTION','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','exports','util','net','events','EventEmitter','./error','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT'];(function(_0x4decb2,_0x3eec27){var _0x21d464=function(_0x29fda7){while(--_0x29fda7){_0x4decb2['push'](_0x4decb2['shift']());}};_0x21d464(++_0x3eec27);}(_0xd73a,0x171));var _0xad73=function(_0x310b6f,_0x839ec3){_0x310b6f=_0x310b6f-0x0;var _0x36182d=_0xd73a[_0x310b6f];return _0x36182d;};'use strict';var util=require(_0xad73('0x0'));var net=require(_0xad73('0x1'));var EventEmitter=require(_0xad73('0x2'))[_0xad73('0x3')];var AGIError=require(_0xad73('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x5048f2,_0x1b0cd2,_0x216563){var _0x279d4f=this,_0x5048f2=_0x5048f2||0x11dd,_0x1b0cd2=_0x1b0cd2||_0xad73('0x5'),_0x7d2258=null,_0x247d3c=0x0;EventEmitter[_0xad73('0x6')](_0x279d4f);function _0x15cf28(){if(!_0x5048f2){_0x279d4f[_0xad73('0x7')]('error',new AGIError(_0xad73('0x8')));return![];}_0x7d2258=net['createServer']();_0x7d2258[_0xad73('0x9')](_0x5048f2,_0x1b0cd2);_0x7d2258['on'](_0xad73('0xa'),function(){_0x279d4f[_0xad73('0x7')]('listening');});_0x7d2258['on'](_0xad73('0xb'),function(_0x5567bb){_0x7d2258[_0xad73('0xc')](function(_0x5eae26,_0x2b2f33){if(_0x5eae26){_0x279d4f[_0xad73('0x7')](_0xad73('0xd'),new AGIError('E_AGI_SERVER_ERROR',_0x5eae26));}else if(_0x216563&&_0x216563<0x0){_0x279d4f[_0xad73('0x7')](_0xad73('0xd'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x5567bb[_0xad73('0xe')]();}else if(_0x216563&&_0x216563>0x0&&_0x216563<_0x2b2f33){_0x247d3c+=0x1;_0x279d4f[_0xad73('0x7')](_0xad73('0xd'),new AGIError(_0xad73('0xf'),_0x247d3c));_0x5567bb[_0xad73('0xe')]();}else{var _0x82fe13=new AGIChannel(_0x5567bb);_0x82fe13['on']('ready',function(){_0x279d4f[_0xad73('0x7')](_0xad73('0xb'),_0x82fe13);});}});});_0x7d2258['on'](_0xad73('0xd'),function(_0x155548){_0x279d4f[_0xad73('0x7')](_0xad73('0xd'),new AGIError(_0xad73('0x10'),_0x155548[_0xad73('0x11')]));});_0x7d2258['on'](_0xad73('0x12'),function(){_0x279d4f[_0xad73('0x7')]('close',new AGIError(_0xad73('0x13')));});}process['nextTick'](function(){_0x15cf28();});};util['inherits'](AGIServer,EventEmitter);module[_0xad73('0x14')]=function(_0x522010,_0x11ed16,_0x578068){return new AGIServer(_0x522010,_0x11ed16,_0x578068);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index c2a5fe8..ade8f33 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 _0xa3ab=['SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','retry','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','goal','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','getData','digit','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','port','secure','auth','user','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','Enter\x20in\x20START\x20(%s)\x20block','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://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','replaceAll','join','exports','path','util','lodash','shelljs','randomstring','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','rpc','mailRpc','prototype','getVariable','getVariableById','name','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','then','catch','getSquareOdbc','getSquareOdbcById','getUserById','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','getSoundPath','format','getQueryOdbc','open','error','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','LOCAL','exec','replace','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MALE','googleTTS','google_tts_language','restAPI','method','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','url','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','key','dialogflow_language','sestekNDA','ispeechTTS','en-US','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','length','replaceAllVariables','saveRestApiResult','%s.%s','isArray','setVariable','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','no\x20grammar\x20configured','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','getUser','no\x20user\x20found','DIAL','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s'];(function(_0x27fd1d,_0x2c7271){var _0x41b9af=function(_0x5cf451){while(--_0x5cf451){_0x27fd1d['push'](_0x27fd1d['shift']());}};_0x41b9af(++_0x2c7271);}(_0xa3ab,0xcf));var _0xba3a=function(_0x4e4619,_0x33a78e){_0x4e4619=_0x4e4619-0x0;var _0x54abba=_0xa3ab[_0x4e4619];return _0x54abba;};'use strict';var fs=require('fs');var path=require(_0xba3a('0x0'));var util=require(_0xba3a('0x1'));var _=require(_0xba3a('0x2'));var sh=require(_0xba3a('0x3'));var odbc=require('odbc')();var rs=require(_0xba3a('0x4'));var moment=require(_0xba3a('0x5'));var Mustache=require(_0xba3a('0x6'));var rp=require(_0xba3a('0x7'));var logger=require('../../config/logger')(_0xba3a('0x8'));var config=require(_0xba3a('0x9'));var scripts=require(_0xba3a('0xa'));var FILES_PATH=_0xba3a('0xb');var recursiveMapAttributes=[_0xba3a('0xc'),_0xba3a('0xd')];var verticesWithRetry=[_0xba3a('0xe'),_0xba3a('0xf'),'getsecretdigits'];var AGIVertices=function(_0xacfa71,_0x5241e7,_0x37404b){this['channel']=_0xacfa71;this[_0xba3a('0x10')]=_0x5241e7;this[_0xba3a('0x11')]=_0x37404b;};AGIVertices[_0xba3a('0x12')][_0xba3a('0x13')]=function(_0x676408,_0x2c7a3f){this[_0xba3a('0x10')][_0xba3a('0x14')](_0x676408)['then'](function(_0x2fe179){_0x2c7a3f(null,_0x2fe179?_0x2fe179[_0xba3a('0x15')]:![]);})['catch'](function(_0x349e12){_0x2c7a3f(_0x349e12);});};AGIVertices['prototype'][_0xba3a('0x16')]=function(_0xd22eb,_0x96c121){this[_0xba3a('0x10')][_0xba3a('0x17')](_0xd22eb)['then'](function(_0x3ee74a){_0x96c121(null,_0x3ee74a?_0x3ee74a[_0xba3a('0x15')]:![]);})['catch'](function(_0x44bbd5){_0x96c121(_0x44bbd5);});};AGIVertices['prototype'][_0xba3a('0x18')]=function(_0x430fa9,_0x2228bb){this[_0xba3a('0x10')][_0xba3a('0x19')](_0x430fa9)[_0xba3a('0x1a')](function(_0x55842c){_0x2228bb(null,_0x55842c?_0x55842c[_0xba3a('0x15')]:![]);})[_0xba3a('0x1b')](function(_0x1c4a28){_0x2228bb(_0x1c4a28);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x1c')]=function(_0x5ab0bf,_0x5baf22){this['rpc'][_0xba3a('0x1d')](_0x5ab0bf)[_0xba3a('0x1a')](function(_0x253ab0){_0x5baf22(null,_0x253ab0?_0x253ab0['dsn']:![]);})[_0xba3a('0x1b')](function(_0x39b98c){_0x5baf22(_0x39b98c);});};AGIVertices['prototype']['getUser']=function(_0x188862,_0x1dfbed){this['rpc'][_0xba3a('0x1e')](_0x188862)[_0xba3a('0x1a')](function(_0x436849){_0x1dfbed(null,_0x436849?_0x436849[_0xba3a('0x15')]:![]);})[_0xba3a('0x1b')](function(_0xd5f360){_0x1dfbed(_0xd5f360);});};AGIVertices['prototype']['getTrunk']=function(_0x34c20a,_0x3825db){this[_0xba3a('0x10')][_0xba3a('0x1f')](_0x34c20a)[_0xba3a('0x1a')](function(_0x289b89){_0x3825db(null,_0x289b89?_0x289b89[_0xba3a('0x15')]:![]);})['catch'](function(_0x560a59){_0x3825db(_0x560a59);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x20')]=function(_0x5468b8,_0x364d14){var _0x1bf938=this;this[_0xba3a('0x10')][_0xba3a('0x21')](_0x5468b8)['then'](function(_0x4c849d){_0x364d14(null,_0x4c849d?_0x1bf938['getSoundPath'](_0x4c849d[_0xba3a('0x22')]):![]);})[_0xba3a('0x1b')](function(_0x251acc){_0x364d14(_0x251acc);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x23')]=function(_0x5e04cf,_0x54d181){this[_0xba3a('0x10')][_0xba3a('0x24')](_0x5e04cf)['then'](function(_0x497dbf){_0x54d181(null,_0x497dbf?_0x497dbf:![]);})[_0xba3a('0x1b')](function(_0x28d048){_0x54d181(_0x28d048);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x25')]=function(_0x18e893,_0x39ec78,_0x11ba9c){this[_0xba3a('0x11')][_0xba3a('0x25')](_0x18e893,_0x39ec78)[_0xba3a('0x1a')](function(){_0x11ba9c(null);})[_0xba3a('0x1b')](function(_0x255223){_0x11ba9c(_0x255223);});};AGIVertices['prototype'][_0xba3a('0x26')]=function(_0xa1794c,_0x75a92d){this[_0xba3a('0x10')][_0xba3a('0x27')](_0xa1794c)[_0xba3a('0x1a')](function(_0x193bef){if(_0x193bef){if(_0x193bef[_0xba3a('0x28')]){_0x75a92d(null,[_0x193bef[_0xba3a('0x29')]]);}else{_0x75a92d(null,_['map'](_0x193bef[_0xba3a('0x2a')],_0xba3a('0x29')));}}else{_0x75a92d(null,![]);}})[_0xba3a('0x1b')](function(_0x4d96ee){_0x75a92d(_0x4d96ee);});};AGIVertices['prototype'][_0xba3a('0x2b')]=function(_0x48f981){return util[_0xba3a('0x2c')]('%s/sounds/converted/%s',FILES_PATH,_0x48f981);};AGIVertices[_0xba3a('0x12')][_0xba3a('0x2d')]=function(_0x4cc67b,_0x3c480a,_0x1977ea){odbc[_0xba3a('0x2e')](_0x4cc67b,function(_0x559e36){if(_0x559e36){logger[_0xba3a('0x2f')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x559e36);_0x1977ea(_0x559e36);}else{logger[_0xba3a('0x30')]('ODBC\x20connection\x20successfully');odbc[_0xba3a('0x31')](_0x3c480a,function(_0x18b3fd,_0x4db50f){if(_0x18b3fd){logger[_0xba3a('0x30')](_0xba3a('0x32'),_0x3c480a);_0x1977ea(_0x18b3fd);}else{logger['info'](_0xba3a('0x33'),_0x3c480a);odbc[_0xba3a('0x34')](function(_0x1229b3){if(_0x1229b3){logger[_0xba3a('0x2f')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1229b3);}_0x1977ea(null,_0x4db50f);});}});}});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x35')]=function(_0x155341,_0xfd7d23){this['rpc'][_0xba3a('0x36')](_0x155341)[_0xba3a('0x1a')](function(_0x35003f){_0xfd7d23(null,_0x35003f?_0x35003f:![]);})['catch'](function(_0x3183bc){_0xfd7d23(_0x3183bc);});};AGIVertices['prototype'][_0xba3a('0x37')]=function(_0x46ebc9,_0x11ff23){this[_0xba3a('0x10')][_0xba3a('0x37')](_0x46ebc9)[_0xba3a('0x1a')](function(_0x5141){_0x11ff23(null,_0x5141);})[_0xba3a('0x1b')](function(_0x32715e){_0x11ff23(_0x32715e);});};AGIVertices[_0xba3a('0x12')]['createSquareDetailsReport']=function(_0x3288aa,_0x52ff2a,_0x429b58){this[_0xba3a('0x10')][_0xba3a('0x38')]({'uniqueid':this[_0xba3a('0x39')][_0xba3a('0x3a')],'node':_0x3288aa[_0xba3a('0x3b')],'application':_0x3288aa[_0xba3a('0x3c')],'data':_0x52ff2a||null,'project_name':this[_0xba3a('0x39')][_0xba3a('0x3d')],'callerid':this[_0xba3a('0x39')]['callerid']})[_0xba3a('0x1a')](function(_0x30a8c4){if(_0x429b58){_0x429b58(null,_0x30a8c4);}})['catch'](function(_0x5da4a2){if(_0x429b58){_0x429b58(_0x5da4a2);}});};AGIVertices[_0xba3a('0x12')]['createSquareRecording']=function(_0x2ef2f1,_0x49945f,_0x48c8a1,_0x1f5a7c){this['rpc'][_0xba3a('0x3e')]({'uniqueid':this['channel'][_0xba3a('0x3a')],'callerid':this[_0xba3a('0x39')][_0xba3a('0x3f')],'calleridname':this['channel'][_0xba3a('0x40')],'context':this[_0xba3a('0x39')][_0xba3a('0x41')],'extension':this[_0xba3a('0x39')][_0xba3a('0x42')],'priority':this[_0xba3a('0x39')][_0xba3a('0x43')],'accountcode':this[_0xba3a('0x39')][_0xba3a('0x44')],'dnid':this[_0xba3a('0x39')][_0xba3a('0x45')],'projectName':this[_0xba3a('0x39')][_0xba3a('0x3d')],'saveName':_0x49945f,'filename':_0x2ef2f1[_0xba3a('0x46')]||_0x49945f,'savePath':_0x48c8a1})[_0xba3a('0x1a')](function(_0xdbd4){_0x1f5a7c(null,_0xdbd4);})[_0xba3a('0x1b')](function(_0x419377){_0x1f5a7c(_0x419377);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x47')]=function(_0x54c326,_0x24868e,_0x24f982){this[_0xba3a('0x10')][_0xba3a('0x47')]({'uniqueid':this[_0xba3a('0x39')]['uniqueid'],'body':_0x54c326,'direction':_0x24868e})[_0xba3a('0x1a')](function(_0x46e3f3){if(_0x24f982){_0x24f982(null,_0x46e3f3);}})['catch'](function(_0x1eb625){if(_0x24f982){_0x24f982(_0x1eb625);}});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x48')]=function(_0x505ca5,_0x57ed28){this[_0xba3a('0x10')][_0xba3a('0x48')]({'firstName':_[_0xba3a('0x49')](_0x505ca5[_0xba3a('0x15')])||_[_0xba3a('0x4a')](_0x505ca5[_0xba3a('0x15')])?_0xba3a('0x4b')+Math[_0xba3a('0x4c')]():_0x505ca5['name'],'lastName':_[_0xba3a('0x49')](_0x505ca5[_0xba3a('0x4d')])||_[_0xba3a('0x4a')](_0x505ca5[_0xba3a('0x4d')])?null:_0x505ca5['lastName'],'phone':_0x505ca5[_0xba3a('0x4e')],'ListId':_0x505ca5[_0xba3a('0x4f')],'scheduledat':_0x505ca5['scheduledAt'],'callbackUniqueid':this[_0xba3a('0x39')][_0xba3a('0x3a')],'tags':_0xba3a('0x50'),'description':'Callback\x20scheduled\x20at\x20'+_0x505ca5[_0xba3a('0x51')][_0xba3a('0x52')](),'priority':_0x505ca5[_0xba3a('0x53')]})[_0xba3a('0x1a')](function(_0x56b7cf){_0x57ed28(null,_0x56b7cf);})['catch'](function(_0x13d825){_0x57ed28(_0x13d825);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x54')]=function(_0x1d5830,_0xea2115){this[_0xba3a('0x10')][_0xba3a('0x55')](_0x1d5830)[_0xba3a('0x1a')](function(_0x2323b5){_0xea2115(null,_0x2323b5?_0x2323b5[_0xba3a('0x15')]:![]);})[_0xba3a('0x1b')](function(_0x15a2b6){_0xea2115(_0x15a2b6);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x56')]=function(_0x4d61ce,_0x34fac8,_0xa5d6ae){var _0x389d04={'role':_0xba3a('0x57')};_0x389d04[_0x4d61ce]=this[_0xba3a('0x39')][_0xba3a('0x3f')];this[_0xba3a('0x10')][_0xba3a('0x56')](_0x389d04,_0x34fac8,this[_0xba3a('0x39')][_0xba3a('0x3a')])[_0xba3a('0x1a')](function(_0x37ff36){_0xa5d6ae(null,_['isNil'](_0x37ff36)?![]:!![]);})['catch'](function(_0x1f4324){logger['error'](_0x1f4324);_0xa5d6ae(null,![]);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x58')]=function(_0x15a7a4,_0x52df2b){var _0x22ec66={'role':_0xba3a('0x57')};_0x22ec66[_0x15a7a4]=this[_0xba3a('0x39')][_0xba3a('0x3f')];this[_0xba3a('0x10')][_0xba3a('0x58')](_0x22ec66)[_0xba3a('0x1a')](function(_0x1376ae){_0x52df2b(null,_['isNil'](_0x1376ae)?![]:!![]);})[_0xba3a('0x1b')](function(_0x30d945){logger['error'](_0x30d945);_0x52df2b(null,![]);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x59')]=function(_0x19a9a7,_0x2a5fe1){var _0x5b72c8={'role':_0xba3a('0x57')};_0x5b72c8[_0x19a9a7]=this[_0xba3a('0x39')]['callerid'];this[_0xba3a('0x10')][_0xba3a('0x59')](_0x5b72c8)['then'](function(_0x576e22){_0x2a5fe1(null,_[_0xba3a('0x4a')](_0x576e22)?![]:!![]);})[_0xba3a('0x1b')](function(_0x2eb845){logger[_0xba3a('0x2f')](_0x2eb845);_0x2a5fe1(null,![]);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x5a')]=function(_0x388c8e,_0x299157){var _0x48a135={'role':'agent'};_0x48a135[_0x388c8e]=this[_0xba3a('0x39')][_0xba3a('0x3f')];var _0x3fc806=_0x388c8e!='internal'?util[_0xba3a('0x2c')]('%s/%s@from-sip/n',_0xba3a('0x5b'),this[_0xba3a('0x39')][_0xba3a('0x3f')]):undefined;this[_0xba3a('0x10')]['agentLogin'](_0x48a135,_0x3fc806)['then'](function(_0x1b571e){_0x299157(null,_[_0xba3a('0x4a')](_0x1b571e)?![]:!![]);})[_0xba3a('0x1b')](function(_0x5ac592){logger[_0xba3a('0x2f')](_0x5ac592);_0x299157(null,![]);});};AGIVertices[_0xba3a('0x12')]['shellCommand']=function(_0x1f8ed6,_0x1b1354){sh[_0xba3a('0x5c')](_['trim'](_0x1f8ed6),function(_0x30751c,_0x5b5023){var _0x424aaf=_0x5b5023[_0xba3a('0x5d')](/(\r\n|\n|\r)/gm,'');_0x1b1354(null,_0x424aaf);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x5e')]=function(_0x2e5c88,_0x521807){scripts[_0xba3a('0x5e')](_0x2e5c88[_0xba3a('0x5f')],_0x2e5c88['google_cloud_tts_text_type']||'text',_0x2e5c88[_0xba3a('0x60')],_0x2e5c88[_0xba3a('0x61')]||'en-US',_0x2e5c88[_0xba3a('0x62')]||_0xba3a('0x63'),_0x2e5c88['audioEncoding']||'MP3')[_0xba3a('0x1a')](function(_0x5e88e4){_0x521807(null,_0x5e88e4);})[_0xba3a('0x1b')](function(_0x19c9a2){_0x521807(_0x19c9a2);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x64')]=function(_0x5b221b,_0xe8ace2){scripts[_0xba3a('0x64')](_0x5b221b[_0xba3a('0x60')],_0x5b221b[_0xba3a('0x65')]||'en',0x1)['then'](function(_0x15084d){_0xe8ace2(null,_0x15084d);})['catch'](function(_0x6889d3){_0xe8ace2(_0x6889d3);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x66')]=function(_0x5bab73,_0x59eb87){var _0x343843={'uri':_0x5bab73['url'],'method':_0x5bab73[_0xba3a('0x67')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5bab73[_0xba3a('0x68')])==='number'&&parseInt(_0x5bab73[_0xba3a('0x68')])>=0x1?parseInt(_0x5bab73[_0xba3a('0x68')])*0x3e8:0x5*0x3e8};if(_[_0xba3a('0x69')]([_0xba3a('0x6a'),_0xba3a('0x6b')],_0x343843[_0xba3a('0x67')][_0xba3a('0x6c')]())){try{_0x343843[_0xba3a('0x6d')]=_0x5bab73['rawBody']?JSON[_0xba3a('0x6e')](_0x5bab73[_0xba3a('0xd')]):{};}catch(_0x2c1e51){logger[_0xba3a('0x2f')](_0xba3a('0x6f'),_0x2c1e51);}}try{_0x343843['headers']=_0x5bab73[_0xba3a('0xc')]?JSON['parse'](_0x5bab73[_0xba3a('0xc')]):{};}catch(_0x5c650a){logger['error'](_0xba3a('0x70'),_0x5c650a);}if(_0x5bab73[_0xba3a('0x71')]){try{var _0x5701c2=require(_0x5bab73['computedVariables'])[_0xba3a('0x72')](this,_0x343843);_0x343843['uri']=Mustache[_0xba3a('0x73')](_0x5bab73[_0xba3a('0x74')],_0x5701c2,{},['$$','$$']);if(_0x343843[_0xba3a('0x75')]){_0x343843[_0xba3a('0x75')]=JSON['parse'](Mustache[_0xba3a('0x73')](JSON[_0xba3a('0x76')](_0x343843[_0xba3a('0x75')]),_0x5701c2,{},['$$','$$']));}if(_0x343843[_0xba3a('0x6d')]){_0x343843[_0xba3a('0x6d')]=JSON['parse'](Mustache['render'](JSON[_0xba3a('0x76')](_0x343843[_0xba3a('0x6d')]),_0x5701c2,{},['$$','$$']));}}catch(_0x36a548){logger[_0xba3a('0x2f')](_0xba3a('0x77'),_0x36a548);}}rp(_0x343843)[_0xba3a('0x1a')](function(_0x481201){var _0x1f0f37={'statusCode':_0x481201['statusCode']||0xc8,'statusMessage':_0x481201['statusMessage']||'OK','headers':_0x481201[_0xba3a('0x75')]||{},'body':_0x481201[_0xba3a('0x6d')]||{}};_0x59eb87(null,_0x1f0f37);})['catch'](function(_0x5080ed){var _0x1c9c46={'statusCode':_0x5080ed[_0xba3a('0x78')]||0x1f4,'statusMessage':_0x5080ed['message']||_0xba3a('0x79'),'headers':_0x5080ed['options'][_0xba3a('0x75')]||{},'body':_0x5080ed[_0xba3a('0x7a')]['body']||{}};_0x59eb87(null,_0x1c9c46);});};AGIVertices[_0xba3a('0x12')]['googleDialogflow']=function(_0x4ebb49,_0x4f68ce){scripts['googleDialogflow'](this[_0xba3a('0x39')]['uniqueid'],_0x4ebb49[_0xba3a('0x7b')],_0x4ebb49[_0xba3a('0x60')],_0x4ebb49[_0xba3a('0x7c')]||'en')['then'](function(_0x1da291){_0x4f68ce(null,_0x1da291);})['catch'](function(_0x269e09){_0x4f68ce(_0x269e09);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x7d')]=function(_0x18e3db,_0x2c09f0){scripts[_0xba3a('0x7d')](this[_0xba3a('0x39')],_0x18e3db)[_0xba3a('0x1a')](function(_0x198c98){_0x2c09f0(null,_0x198c98);})[_0xba3a('0x1b')](function(_0x1d3f08){_0x2c09f0(_0x1d3f08);});};AGIVertices['prototype'][_0xba3a('0x7e')]=function(_0x4e7912,_0x37394d){scripts[_0xba3a('0x7e')](_0x4e7912[_0xba3a('0x7b')],_0x4e7912['text'],_0x4e7912['ispeech_tts_language']||_0xba3a('0x7f'),_0x4e7912['speed'])[_0xba3a('0x1a')](function(_0x52c212){_0x37394d(null,_0x52c212);})[_0xba3a('0x1b')](function(_0x5ba991){_0x37394d(_0x5ba991);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x80')]=function(_0x2798d1,_0x2aaa95,_0xa41b7){scripts[_0xba3a('0x80')](_0x2aaa95,_0x2798d1[_0xba3a('0x7b')],_0x2798d1[_0xba3a('0x81')]||'en-US',this[_0xba3a('0x82')](_0x2798d1[_0xba3a('0x83')])?_0x2798d1[_0xba3a('0x83')]:undefined)[_0xba3a('0x1a')](function(_0x3eb70b){_0xa41b7(null,_0x3eb70b);})[_0xba3a('0x1b')](function(_0x10d77e){_0xa41b7(_0x10d77e);});};AGIVertices['prototype'][_0xba3a('0x84')]=function(_0x343052,_0x318f07){scripts['awsPolly'](_0x343052[_0xba3a('0x85')],_0x343052[_0xba3a('0x86')],_0x343052[_0xba3a('0x87')],_0x343052['aws_polly_voice']||'Amy',_0x343052[_0xba3a('0x60')],_0x343052[_0xba3a('0x88')]||'text')[_0xba3a('0x1a')](function(_0x4c49f6){_0x318f07(null,_0x4c49f6);})[_0xba3a('0x1b')](function(_0x344a78){_0x318f07(_0x344a78);});};AGIVertices[_0xba3a('0x12')]['awsLex']=function(_0x5029e2,_0x5a9c1b){scripts[_0xba3a('0x89')](this[_0xba3a('0x39')][_0xba3a('0x3a')],_0x5029e2[_0xba3a('0x85')],_0x5029e2[_0xba3a('0x86')],_0x5029e2[_0xba3a('0x8a')],_0x5029e2[_0xba3a('0x60')],_0x5029e2[_0xba3a('0x8b')])[_0xba3a('0x1a')](function(_0x28ec57){_0x5a9c1b(null,_0x28ec57);})['catch'](function(_0x56d62e){_0x5a9c1b(_0x56d62e);});};AGIVertices[_0xba3a('0x12')][_0xba3a('0x8c')]=function(_0x1fc31b,_0x588076,_0x1e6bfe){scripts[_0xba3a('0x8c')](_0x588076,_0x1fc31b[_0xba3a('0x7b')],_0x1fc31b[_0xba3a('0x8d')]||_0xba3a('0x7f'))[_0xba3a('0x1a')](function(_0x503cbe){_0x1e6bfe(null,_0x503cbe);})[_0xba3a('0x1b')](function(_0xc97ef0){_0x1e6bfe(_0xc97ef0);});};AGIVertices['prototype'][_0xba3a('0x8e')]=function(_0x376948,_0x1c6bc0,_0x471a1d){scripts[_0xba3a('0x8e')](_0x1c6bc0,_0x376948[_0xba3a('0x8f')],_0x376948[_0xba3a('0x90')],_0x376948[_0xba3a('0x91')])[_0xba3a('0x1a')](function(_0x2496c1){_0x471a1d(null,_0x2496c1);})['catch'](function(_0x38fd94){_0x471a1d(_0x38fd94);});};AGIVertices['prototype'][_0xba3a('0x92')]=function(_0x4a31ad){var _0x51021f=_[_0xba3a('0x69')](verticesWithRetry,_0x4a31ad['agicommand'])?_0x4a31ad:_[_0xba3a('0x93')](_0x4a31ad);for(var _0x36f05c in _0x51021f){if(_0x51021f[_0xba3a('0x94')](_0x36f05c)){if(_0x51021f[_0x36f05c]&&_[_0xba3a('0x95')](_0x51021f[_0x36f05c])){if(_[_0xba3a('0x69')](recursiveMapAttributes,_0x36f05c)){_0x51021f[_0x36f05c]=this[_0xba3a('0x96')](_0x51021f[_0x36f05c]);}else{_0x51021f[_0x36f05c]=this['replaceAllVariables'](_0x51021f[_0x36f05c]);}}}}return _0x51021f;};AGIVertices['prototype']['recursiveNodeIndex']=function(_0x59ab6e){for(var _0x210802 in _0x59ab6e){if(_0x59ab6e[_0xba3a('0x94')](_0x210802)){if(_[_0xba3a('0x97')](_0x59ab6e[_0x210802])){this[_0xba3a('0x98')](_0x59ab6e[_0x210802]);}else if(_['isArray'](_0x59ab6e[_0x210802])){for(var _0x22e77f=0x0;_0x22e77f<_0x59ab6e[_0x210802][_0xba3a('0x99')];_0x22e77f++){this[_0xba3a('0x98')](_0x59ab6e[_0x210802][_0x22e77f]);}}else if(_['isString'](_0x59ab6e[_0x210802])){_0x59ab6e[_0x210802]=this[_0xba3a('0x9a')](_0x59ab6e[_0x210802]);}}}};AGIVertices[_0xba3a('0x12')][_0xba3a('0x9b')]=function(_0x68e6ae,_0x42bfe6){for(var _0x51f430 in _0x68e6ae){if(_0x68e6ae[_0xba3a('0x94')](_0x51f430)){if(_[_0xba3a('0x97')](_0x68e6ae[_0x51f430])){if(!_[_0xba3a('0x49')](_0x68e6ae[_0x51f430])){this[_0xba3a('0x9b')](_0x68e6ae[_0x51f430],util[_0xba3a('0x2c')](_0xba3a('0x9c'),_0x42bfe6,_0x51f430));}}else if(_[_0xba3a('0x9d')](_0x68e6ae[_0x51f430])){for(var _0x4a6833=0x0;_0x4a6833<_0x68e6ae[_0x51f430][_0xba3a('0x99')];_0x4a6833++){this[_0xba3a('0x9b')](_0x68e6ae[_0x51f430][_0x4a6833],util[_0xba3a('0x2c')]('%s.%s',_0x42bfe6,_0x51f430+'['+_0x4a6833+']'));}}else{if(!_[_0xba3a('0x4a')](_0x68e6ae[_0x51f430])){this['channel'][_0xba3a('0x9e')](util[_0xba3a('0x2c')](_0xba3a('0x9c'),_0x42bfe6,_0x51f430),_0x68e6ae[_0x51f430]);}}}}};AGIVertices[_0xba3a('0x12')][_0xba3a('0x96')]=function(_0x35f134){try{var _0x58a7aa=JSON[_0xba3a('0x6e')](_0x35f134);this['recursiveNodeIndex'](_0x58a7aa);return JSON[_0xba3a('0x76')](_0x58a7aa);}catch(_0x473878){return this[_0xba3a('0x9a')](_0x35f134);}};AGIVertices[_0xba3a('0x12')][_0xba3a('0x9a')]=function(_0x58d045){var _0x1c11b1=_0x58d045[_0xba3a('0x9f')]('{');for(var _0x1434a7=0x1;_0x1434a7<_0x1c11b1[_0xba3a('0x99')];_0x1434a7+=0x1){var _0xd657=_0x1c11b1[_0x1434a7][_0xba3a('0x9f')]('}');if(_0xd657[_0xba3a('0x99')]>0x1){_0x58d045=_0x58d045['replaceAll']('{'+_0xd657[0x0]+'}',this['channel'][_0xba3a('0x13')](_0xd657[0x0])[_0xba3a('0xa0')]||_0xd657[0x0]);}}if(_0x1c11b1['length']===0x1){return _0x58d045[_0xba3a('0x52')]();}return this[_0xba3a('0x9a')](_0x58d045);};AGIVertices[_0xba3a('0x12')][_0xba3a('0xa1')]=function(_0x5215a2,_0x2e65f4){var _0x3b9759=this['channel']['getVariable'](_0x5215a2);if(_0x3b9759[_0xba3a('0xa2')]===-0x1){return _0x3b9759;}logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0xa3'),_0x2e65f4,_0x3b9759['extra']));return this[_0xba3a('0x39')][_0xba3a('0x9e')](_0x2e65f4,_0x3b9759[_0xba3a('0xa0')]);};AGIVertices[_0xba3a('0x12')][_0xba3a('0x82')]=function(_0x533fa3){return _0x533fa3&&_0x533fa3!=='0'&&_0x533fa3!=='-1'&&_0x533fa3!=='';};AGIVertices[_0xba3a('0x12')][_0xba3a('0xa4')]=function(_0x3451cb){this[_0xba3a('0x38')][_0xba3a('0x72')](this,_0x3451cb,'-');_0x3451cb['retry']=_0x3451cb[_0xba3a('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xba3a('0x8')]=function(_0x5c6c9a){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0xa5'),_0x5c6c9a[_0xba3a('0x3b')]));return this[_0xba3a('0x39')][_0xba3a('0x8')]([_0x5c6c9a[_0xba3a('0xa6')],_0x5c6c9a[_0xba3a('0xa7')]]);};AGIVertices['prototype'][_0xba3a('0xa8')]=function(_0xceee27){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0xceee27[_0xba3a('0x3b')]));if(this[_0xba3a('0x82')](_0xceee27['timeout'])){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0xa9'),_0xceee27[_0xba3a('0x68')]));var _0x3eac64=this[_0xba3a('0x39')][_0xba3a('0xaa')](_0xceee27['timeout']);if(_0x3eac64[_0xba3a('0xa2')]===-0x1){return _0x3eac64;}}return this['channel'][_0xba3a('0xa8')]();};AGIVertices[_0xba3a('0x12')][_0xba3a('0x50')]=function(_0x56c47f){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0xab'),_0x56c47f[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x56c47f[_0xba3a('0x4f')])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x56c47f,'no\x20list\x20selected');}_0x56c47f[_0xba3a('0x51')]=moment();if(this['isConfigured'](_0x56c47f[_0xba3a('0xac')])){_0x56c47f[_0xba3a('0x51')]=moment()[_0xba3a('0xad')](_0x56c47f[_0xba3a('0xac')],_0xba3a('0xae'));}if(!this[_0xba3a('0x82')](_0x56c47f[_0xba3a('0x53')])){_0x56c47f[_0xba3a('0x53')]=0x2;}this[_0xba3a('0x48')]['sync'](this,_0x56c47f);return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0xb0'),_0x56c47f[_0xba3a('0x4e')],_0x56c47f[_0xba3a('0x4f')],_0x56c47f[_0xba3a('0x51')]));};AGIVertices[_0xba3a('0x12')][_0xba3a('0xb1')]=function(_0x545fde){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x545fde[_0xba3a('0x3b')]));var _0x3817e2=this['channel'][_0xba3a('0x5c')](_0x545fde[_0xba3a('0xb2')],_0x545fde[_0xba3a('0x7a')]);if(_0x3817e2[_0xba3a('0xa2')]===-0x1){return _0x3817e2;}return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0xb3'),_0x545fde[_0xba3a('0xb2')],_0x545fde[_0xba3a('0x7a')]));};AGIVertices[_0xba3a('0x12')][_0xba3a('0xb4')]=function(_0x50d681){logger[_0xba3a('0x30')](util['format'](_0xba3a('0xb5'),_0x50d681[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x50d681[_0xba3a('0x60')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0xb6'));}var _0x1dd9b9='\x22'+_0x50d681['text']+'\x22';if(this[_0xba3a('0x82')](_0x50d681[_0xba3a('0x7a')])){_0x1dd9b9+=','+_0x50d681['options'];}var _0xed239=this[_0xba3a('0x39')][_0xba3a('0x5c')](_0xba3a('0xb7'),_0x1dd9b9);if(_0xed239[_0xba3a('0xa2')]===-0x1){return _0xed239;}return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1dd9b9));};AGIVertices[_0xba3a('0x12')][_0xba3a('0xb8')]=function(_0x5832ff){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0xb9'),_0x5832ff['label']));if(!this['isConfigured'](_0x5832ff[_0xba3a('0x60')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0xb6'));}var _0x3ae3f1='\x22'+_0x5832ff[_0xba3a('0x60')]+'\x22';if(this[_0xba3a('0x82')](_0x5832ff['options'])){_0x3ae3f1+=','+_0x5832ff['options'];}var _0x42d953=this[_0xba3a('0x39')][_0xba3a('0x5c')](_0xba3a('0xb7'),_0x3ae3f1);if(_0x42d953['result']===-0x1){return _0x42d953;}return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0xba'),_0x3ae3f1));};AGIVertices[_0xba3a('0x12')][_0xba3a('0xbb')]=function(_0x328605){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x328605[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x328605[_0xba3a('0xbc')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x30451a=_0x328605[_0xba3a('0xbc')];if(this[_0xba3a('0x82')](_0x328605['options'])){_0x30451a+=','+_0x328605['options'];}var _0x57eed8=this[_0xba3a('0x39')][_0xba3a('0x5c')](_0xba3a('0xbd'),_0x30451a);if(_0x57eed8[_0xba3a('0xa2')]===-0x1){return _0x57eed8;}var _0x41f1d8=this[_0xba3a('0xa1')](_0xba3a('0xbe'),_0xba3a('0xbf'));if(_0x41f1d8[_0xba3a('0xa2')]===-0x1){return _0x41f1d8;}var _0x4d7055=this[_0xba3a('0xa1')](_0xba3a('0xc0'),_0xba3a('0xc1'));if(_0x4d7055[_0xba3a('0xa2')]===-0x1){return _0x4d7055;}var _0x46308e=this[_0xba3a('0xa1')](_0xba3a('0xc2'),'LUMENVOX_ASR_INSTANCE');if(_0x46308e['result']===-0x1){return _0x46308e;}return this[_0xba3a('0x39')]['noop'](util[_0xba3a('0x2c')](_0xba3a('0xc3'),_0x30451a));};AGIVertices[_0xba3a('0x12')][_0xba3a('0xc4')]=function(_0x206641){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x206641[_0xba3a('0x3b')]));if(!this['isConfigured'](_0x206641[_0xba3a('0xbc')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0xc5'));}var _0x380f05=_0x206641[_0xba3a('0xbc')];if(this['isConfigured'](_0x206641[_0xba3a('0x7a')])){_0x380f05+=','+_0x206641[_0xba3a('0x7a')];}var _0x504522=this['channel'][_0xba3a('0x5c')]('MRCPRecog',_0x380f05);if(_0x504522[_0xba3a('0xa2')]===-0x1){return _0x504522;}var _0x52581c=this[_0xba3a('0xa1')](_0xba3a('0xbe'),'SESTEK_ASR_CONFIDENCE');if(_0x52581c[_0xba3a('0xa2')]===-0x1){return _0x52581c;}var _0x2e06eb=this[_0xba3a('0xa1')](_0xba3a('0xc0'),_0xba3a('0xc6'));if(_0x2e06eb[_0xba3a('0xa2')]===-0x1){return _0x2e06eb;}var _0xc37c04=this[_0xba3a('0xa1')](_0xba3a('0xc2'),_0xba3a('0xc7'));if(_0xc37c04[_0xba3a('0xa2')]===-0x1){return _0xc37c04;}return this[_0xba3a('0x39')]['noop'](util[_0xba3a('0x2c')](_0xba3a('0xc3'),_0x380f05));};AGIVertices[_0xba3a('0x12')][_0xba3a('0xc8')]=function(_0x3a3226){logger[_0xba3a('0x30')](util['format'](_0xba3a('0xc9'),_0x3a3226[_0xba3a('0x3b')]));if(!this['isConfigured'](_0x3a3226[_0xba3a('0xca')])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x3a3226,'no\x20database\x20selected');}var _0x1a57c9=this[_0xba3a('0x1c')][_0xba3a('0x72')](this,_0x3a3226[_0xba3a('0xca')]);if(!_0x1a57c9){return this[_0xba3a('0x39')]['error'](_0x3a3226,_0xba3a('0xcb'));}if(!this['isConfigured'](_0x3a3226['query'])){return this[_0xba3a('0x39')]['error'](_0x3a3226,'no\x20query\x20configured');}var _0x41f4ac=_0x3a3226[_0xba3a('0x31')][_0xba3a('0x5d')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0xba3a('0x2c')](_0xba3a('0xcc'),_0x41f4ac));var _0x1bfa63=this[_0xba3a('0x2d')][_0xba3a('0x72')](this,_0x1a57c9,_0x41f4ac);this[_0xba3a('0x38')][_0xba3a('0x72')](this,_0x3a3226,_0x41f4ac);if(!this[_0xba3a('0x82')](_0x3a3226[_0xba3a('0xcd')])){return this[_0xba3a('0x39')]['noop'](_0xba3a('0xce'));}var _0x3cfaff=this[_0xba3a('0x13')][_0xba3a('0x72')](this,_0x3a3226['variable_id']);if(!_0x3cfaff){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x3a3226,_0xba3a('0xcf'));}var _0x56f852=this;_0x1bfa63[_0xba3a('0xd0')](function(_0x50b41b,_0x243dc1){Object['keys'](_0x50b41b)[_0xba3a('0xd0')](function(_0x2a22f1){_0x56f852['channel'][_0xba3a('0x9e')](util[_0xba3a('0x2c')](_0xba3a('0xd1'),_0x3cfaff,_0x243dc1,_0x2a22f1),_0x50b41b[_0x2a22f1]);});});this['channel'][_0xba3a('0x9e')](util['format'](_0xba3a('0xd2'),_0x3cfaff),_0x1bfa63[_0xba3a('0x99')]);return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0xd3'),_0x3cfaff));};AGIVertices[_0xba3a('0x12')][_0xba3a('0xd4')]=function(_0x4ab837){logger[_0xba3a('0xd5')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x4ab837[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x4ab837[_0xba3a('0xd6')])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x4ab837,'no\x20user\x20selected');}var _0x3d590d=this[_0xba3a('0xd7')][_0xba3a('0x72')](this,_0x4ab837[_0xba3a('0xd6')]);if(!_0x3d590d){return this[_0xba3a('0x39')]['error'](_0x4ab837,_0xba3a('0xd8'));}var _0x3aa412=this[_0xba3a('0x39')][_0xba3a('0x5c')](_0xba3a('0xd9'),[util[_0xba3a('0x2c')]('SIP/%s',_0x3d590d),_0x4ab837[_0xba3a('0x68')],_0x4ab837[_0xba3a('0xda')],_0x4ab837[_0xba3a('0x74')]]);if(_0x3aa412[_0xba3a('0xa2')]===-0x1){return _0x3aa412;}return this[_0xba3a('0x39')][_0xba3a('0xaf')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xba3a('0x12')]['dialogflow']=function(_0x550dab){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0xdb'),_0x550dab[_0xba3a('0x3b')]));if(!this['isConfigured'](_0x550dab[_0xba3a('0x7b')])){return this[_0xba3a('0x39')]['noop']('no\x20key\x20configured');}if(!this[_0xba3a('0x82')](_0x550dab[_0xba3a('0x60')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')]('no\x20text\x20configured');}this[_0xba3a('0x39')][_0xba3a('0xdc')]=!![];this[_0xba3a('0x38')](_0x550dab);this[_0xba3a('0x47')](_0x550dab[_0xba3a('0x60')],'in');this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0xdd'),_0x550dab[_0xba3a('0x60')]));var _0x1864cb=this[_0xba3a('0xde')][_0xba3a('0x72')](this,_0x550dab);if(_0x1864cb){for(var _0x583f56 in _0x1864cb){if(_0x1864cb[_0xba3a('0x94')](_0x583f56)){this[_0xba3a('0x39')][_0xba3a('0x9e')](util['format'](_0xba3a('0xdf'),_0x583f56['toUpperCase']()),_0x1864cb[_0x583f56]);}}this['createSquareMessage'](_0x1864cb[_0xba3a('0xe0')],'out');return this[_0xba3a('0x39')]['noop'](util['format'](_0xba3a('0xe1'),_0x1864cb['speech']));}return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x550dab,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xba3a('0x12')]['sesteknda']=function(_0x22a85c){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x22a85c['label']));if(!this[_0xba3a('0x82')](_0x22a85c[_0xba3a('0xe2')])){return this[_0xba3a('0x39')]['noop'](_0xba3a('0xe3'));}if(!this[_0xba3a('0x82')](_0x22a85c[_0xba3a('0xe4')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0xe5'));}if(!this[_0xba3a('0x82')](_0x22a85c[_0xba3a('0xe6')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0xe7'));}if(!this['isConfigured'](_0x22a85c[_0xba3a('0xe8')])){return this[_0xba3a('0x39')]['noop'](_0xba3a('0xb6'));}this[_0xba3a('0x39')]['bot']=!![];this[_0xba3a('0x38')](_0x22a85c);this[_0xba3a('0x47')](_0x22a85c[_0xba3a('0x60')],'in');this[_0xba3a('0x39')]['noop'](util[_0xba3a('0x2c')](_0xba3a('0xe9'),_0x22a85c[_0xba3a('0x60')]));var _0x39f7ab=this[_0xba3a('0x7d')][_0xba3a('0x72')](this,_0x22a85c);if(_0x39f7ab){for(var _0x39a2d8 in _0x39f7ab){if(_0x39f7ab[_0xba3a('0x94')](_0x39a2d8)){this[_0xba3a('0x39')][_0xba3a('0x9e')](util[_0xba3a('0x2c')](_0xba3a('0xea'),_0x39a2d8[_0xba3a('0x6c')]()),_0x39f7ab[_0x39a2d8]);}}this[_0xba3a('0x47')](_0x39f7ab[_0xba3a('0xe0')],_0xba3a('0xeb'));if(_0x39f7ab[_0xba3a('0xec')]){this['channel'][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0xed'),_0x39f7ab[_0xba3a('0xec')]));var _0x5ddc8a=this[_0xba3a('0x39')][_0xba3a('0xee')](_0x39f7ab[_0xba3a('0xec')]);try{fs[_0xba3a('0xef')](_0x39f7ab[_0xba3a('0xec')]+_0xba3a('0xf0'));}catch(_0xacb73a){logger['error'](_0xacb73a);}return _0x5ddc8a;}else{return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0xf1'),_0x39f7ab[_0xba3a('0xe0')]));}}return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x22a85c,_0xba3a('0xf2'));};AGIVertices[_0xba3a('0x12')][_0xba3a('0xf3')]=function(_0xce9d7c){logger[_0xba3a('0x30')](util['format'](_0xba3a('0xf4'),_0xce9d7c[_0xba3a('0x3b')]));return this[_0xba3a('0x39')]['noop']('end');};AGIVertices['prototype'][_0xba3a('0xf5')]=function(_0x54cb86){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0xf6'),_0x54cb86[_0xba3a('0x3b')]));var _0x294123='';if(_0x54cb86[_0xba3a('0xf7')]){if(!this[_0xba3a('0x82')](_0x54cb86['trunk_id'])){return this['channel'][_0xba3a('0x2f')](_0x54cb86,_0xba3a('0xf8'));}else{var _0x4145cb=parseInt(_0x54cb86[_0xba3a('0xf7')],0xa);if(isNaN(_0x4145cb)){_0x294123=_0x54cb86[_0xba3a('0xf7')];}else{_0x294123=this[_0xba3a('0xf9')]['sync'](this,_0x54cb86[_0xba3a('0xf7')]);if(!_0x294123){return this['channel'][_0xba3a('0x2f')](_0x54cb86,_0xba3a('0xfa'));}}}}else if(_0x54cb86[_0xba3a('0xfb')]){_0x294123=_0x54cb86[_0xba3a('0xfb')];}else{return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x54cb86,'no\x20trunk\x20selected');}var _0x1d8f00=this[_0xba3a('0x39')]['exec'](_0xba3a('0xd9'),[util[_0xba3a('0x2c')](_0xba3a('0xfc'),_0x294123,_0x54cb86[_0xba3a('0x4e')]),_0x54cb86[_0xba3a('0x68')],_0x54cb86[_0xba3a('0xda')],_0x54cb86[_0xba3a('0x74')]]);if(_0x1d8f00[_0xba3a('0xa2')]===-0x1){return _0x1d8f00;}return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0xfd'),_0xba3a('0xd9')));};AGIVertices[_0xba3a('0x12')]['finally']=function(_0x4bcb4a){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x4bcb4a[_0xba3a('0x3b')]));return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0xfe'));};AGIVertices['prototype'][_0xba3a('0xf')]=function(_0x21860f){logger[_0xba3a('0x30')](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x21860f[_0xba3a('0x3b')]));if(_0x21860f[_0xba3a('0xff')]===0x0){return this[_0xba3a('0xa4')](_0x21860f);}_0x21860f[_0xba3a('0xff')]-=0x1;if(!this[_0xba3a('0x82')](_0x21860f['file_id'])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x21860f,_0xba3a('0x100'));}var _0x1098fe=this[_0xba3a('0x20')][_0xba3a('0x72')](this,_0x21860f[_0xba3a('0x101')]);if(!_0x1098fe){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x21860f,_0xba3a('0x102'));}if(!this[_0xba3a('0x82')](_0x21860f[_0xba3a('0xcd')])){return this['channel']['error'](_0xba3a('0xce'));}var _0xd73a80=this[_0xba3a('0x39')]['getData'](_0x1098fe,_0x21860f[_0xba3a('0x103')],_0x21860f['maxdigit']);var _0x75949e=_0xd73a80[_0xba3a('0xa2')]?_0xd73a80['result'][_0xba3a('0x52')]():'';logger[_0xba3a('0x30')](_0xba3a('0x104'),JSON[_0xba3a('0x76')](_0xd73a80));if(_0xd73a80[_0xba3a('0xa2')]===-0x1){this['createSquareDetailsReport'][_0xba3a('0x72')](this,_0x21860f,_0x75949e);return _0xd73a80;}else if(_0xd73a80[_0xba3a('0xa0')]===_0xba3a('0x68')){_0xd73a80[_0xba3a('0xa2')]=_0x75949e['length']>=parseInt(_0x21860f[_0xba3a('0x105')])?'x':'i';}else{_0xd73a80[_0xba3a('0xa2')]=_0x75949e['length']>=parseInt(_0x21860f[_0xba3a('0x105')])&&_0x75949e[_0xba3a('0x99')]<=parseInt(_0x21860f[_0xba3a('0x106')])?'x':'i';}var _0x359e35=this['getVariable'][_0xba3a('0x72')](this,_0x21860f['variable_id']);if(!_0x359e35){return this['channel'][_0xba3a('0x2f')](_0x21860f,'no\x20variable\x20found');}this['channel']['setVariable'](_0x359e35,_0x75949e);if(this['isConfigured'](_0x21860f[_0xba3a('0x107')])){var _0x1865c5=parseInt(_0x21860f[_0xba3a('0x107')],0xa);var _0x3ee70d=rs[_0xba3a('0x108')]({'charset':'*','length':_0x1865c5});var _0x5a6159=_0x75949e['length'];if(_0x5a6159>0x0){if(_0x5a6159>_0x1865c5){this[_0xba3a('0x38')]['sync'](this,_0x21860f,_0x21860f[_0xba3a('0x109')]==='first'?_0x3ee70d+_0x75949e['substr'](_0x1865c5):_0x75949e[_0xba3a('0x10a')](0x0,_0x5a6159-_0x1865c5)+_0x3ee70d);}else{this[_0xba3a('0x38')]['sync'](this,_0x21860f,rs[_0xba3a('0x108')]({'charset':'*','length':_0x5a6159}));}}else{this['createSquareDetailsReport']['sync'](this,_0x21860f,'');}}else{this[_0xba3a('0x38')][_0xba3a('0x72')](this,_0x21860f,_0x75949e);}return _0xd73a80;};AGIVertices[_0xba3a('0x12')][_0xba3a('0x10b')]=function(_0x47c1d1){logger[_0xba3a('0x30')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x47c1d1['label']));return this[_0xba3a('0xf')](_0x47c1d1);};AGIVertices['prototype'][_0xba3a('0x10c')]=function(_0x4591d6){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x4591d6[_0xba3a('0x3b')]));this[_0xba3a('0x38')][_0xba3a('0x72')](this,_0x4591d6,_0x4591d6['goalname']);return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x10d'),_0x4591d6[_0xba3a('0x10e')]));};AGIVertices[_0xba3a('0x12')][_0xba3a('0x10f')]=function(_0x3c67eb){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x110'),_0x3c67eb[_0xba3a('0x3b')]));if(!this['isConfigured'](_0x3c67eb[_0xba3a('0x85')])||!this[_0xba3a('0x82')](_0x3c67eb[_0xba3a('0x86')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0x111'));}if(!this['isConfigured'](_0x3c67eb[_0xba3a('0x60')])){return this[_0xba3a('0x39')]['noop'](_0xba3a('0xb6'));}this['channel']['noop'](util[_0xba3a('0x2c')](_0xba3a('0x112'),_0x3c67eb[_0xba3a('0x60')]));var _0x433a86=this[_0xba3a('0x84')][_0xba3a('0x72')](this,_0x3c67eb);if(_0x433a86){this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x113'),_0x433a86));var _0x3a32b5=this[_0xba3a('0x39')][_0xba3a('0xee')](_0x433a86);try{fs[_0xba3a('0xef')](_0x433a86+_0xba3a('0xf0'));}catch(_0x2c9123){logger[_0xba3a('0x2f')](_0x2c9123);}return _0x3a32b5;}return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x3c67eb,_0xba3a('0x114'));};AGIVertices['prototype'][_0xba3a('0x115')]=function(_0x3eb626){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x116'),_0x3eb626[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x3eb626['aws_access_key_id'])||!this['isConfigured'](_0x3eb626['aws_secret_access_key'])){return this['channel']['noop'](_0xba3a('0x111'));}if(!this[_0xba3a('0x82')](_0x3eb626[_0xba3a('0x8b')])){return this['channel'][_0xba3a('0xaf')](_0xba3a('0x117'));}if(!this[_0xba3a('0x82')](_0x3eb626[_0xba3a('0x60')])){return this['channel'][_0xba3a('0xaf')](_0xba3a('0xb6'));}this[_0xba3a('0x39')]['bot']=!![];this[_0xba3a('0x38')](_0x3eb626);this[_0xba3a('0x47')](_0x3eb626[_0xba3a('0x60')],'in');this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x118'),_0x3eb626[_0xba3a('0x60')]));var _0x415d43=this['awsLex']['sync'](this,_0x3eb626);if(_0x415d43){for(var _0x2fa6b7 in _0x415d43){if(_0x415d43[_0xba3a('0x94')](_0x2fa6b7)&&_[_0xba3a('0x95')](_0x415d43[_0x2fa6b7])){this[_0xba3a('0x39')][_0xba3a('0x9e')](util['format'](_0xba3a('0x119'),_0x2fa6b7[_0xba3a('0x6c')]()),_0x415d43[_0x2fa6b7]);}}if(_[_0xba3a('0x4a')](_0x415d43[_0xba3a('0x11a')])){return this['channel']['noop'](_0xba3a('0x11b'));}else{this[_0xba3a('0x47')](_0x415d43[_0xba3a('0x11a')],_0xba3a('0xeb'));return this[_0xba3a('0x39')][_0xba3a('0xaf')](util['format'](_0xba3a('0x11c'),_0x415d43[_0xba3a('0x11a')]));}}return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x3eb626,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xba3a('0x12')][_0xba3a('0x11d')]=function(_0xc73bcc){logger['info'](util[_0xba3a('0x2c')](_0xba3a('0x11e'),_0xc73bcc[_0xba3a('0x3b')],_0xc73bcc[_0xba3a('0x68')]));if(!this['isConfigured'](_0xc73bcc[_0xba3a('0x7b')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0x11f'));}var _0xae8f76=_0xba3a('0x120');var _0x3f9063=util[_0xba3a('0x2c')]('%s/recordings/%s',FILES_PATH,rs[_0xba3a('0x108')](0x4));var _0xb08af=util['format']('%s.%s',_0x3f9063,_0xae8f76);var _0x1d4391=!![];if(_0xc73bcc[_0xba3a('0x121')]===_0xba3a('0x122')){_0x1d4391=![];}var _0x31b520=this[_0xba3a('0x39')][_0xba3a('0x123')](_0x3f9063,_0xae8f76,_0xc73bcc[_0xba3a('0x124')],_0xc73bcc[_0xba3a('0x68')],undefined,_0x1d4391);if(_0x31b520[_0xba3a('0xa2')]!==-0x1){this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x125'),_0xb08af));var _0x5c6bd3=this[_0xba3a('0x8c')][_0xba3a('0x72')](this,_0xc73bcc,_0xb08af);if(_0x5c6bd3){for(var _0x382a09 in _0x5c6bd3){if(_0x5c6bd3[_0xba3a('0x94')](_0x382a09)){this['channel'][_0xba3a('0x9e')](util[_0xba3a('0x2c')]('GOOGLE_ASR_%s',_0x382a09['toUpperCase']()),_0x5c6bd3[_0x382a09]);}}return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x126'),JSON[_0xba3a('0x76')](_0x5c6bd3)));}}return _0x31b520;};AGIVertices[_0xba3a('0x12')]['tildeasr']=function(_0x41d83a){logger['info'](util['format'](_0xba3a('0x127'),_0x41d83a[_0xba3a('0x3b')]));if(!this['isConfigured'](_0x41d83a['appid'])){return this[_0xba3a('0x39')]['noop'](_0xba3a('0x128'));}if(!this['isConfigured'](_0x41d83a[_0xba3a('0x90')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')]('no\x20appsecret\x20configured');}var _0x11e88e='wav';var _0x306f6e=util[_0xba3a('0x2c')](_0xba3a('0x129'),FILES_PATH,rs[_0xba3a('0x108')](0x4));var _0x4f40be=util[_0xba3a('0x2c')](_0xba3a('0x9c'),_0x306f6e,_0x11e88e);var _0x2b1853=!![];if(_0x41d83a[_0xba3a('0x121')]===_0xba3a('0x122')){_0x2b1853=![];}var _0x1b4e77=this[_0xba3a('0x39')][_0xba3a('0x123')](_0x306f6e,_0x11e88e,_0x41d83a[_0xba3a('0x124')],_0x41d83a[_0xba3a('0x68')],undefined,_0x2b1853);if(_0x1b4e77[_0xba3a('0xa2')]!==-0x1){this['channel'][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x12a'),_0x4f40be));var _0xf1ed00=this[_0xba3a('0x8e')][_0xba3a('0x72')](this,_0x41d83a,_0x4f40be);if(_0xf1ed00){for(var _0x5ea092 in _0xf1ed00){if(_0xf1ed00['hasOwnProperty'](_0x5ea092)){this[_0xba3a('0x39')][_0xba3a('0x9e')](util[_0xba3a('0x2c')](_0xba3a('0x12b'),_0x5ea092[_0xba3a('0x6c')]()),_0xf1ed00[_0x5ea092]);}}return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x12c'),JSON['stringify'](_0xf1ed00)));}}return _0x1b4e77;};AGIVertices['prototype'][_0xba3a('0x12d')]=function(_0x2ff41d){logger['info'](util[_0xba3a('0x2c')](_0xba3a('0x12e'),_0x2ff41d['label']));return this[_0xba3a('0x39')][_0xba3a('0x12f')](_0x2ff41d[_0xba3a('0x41')],_0x2ff41d[_0xba3a('0x42')],_0x2ff41d[_0xba3a('0x43')]);};AGIVertices[_0xba3a('0x12')][_0xba3a('0x130')]=function(_0x45796e){logger['info'](util['format'](_0xba3a('0x131'),_0x45796e['label']));if(!this[_0xba3a('0x82')](_0x45796e[_0xba3a('0x132')])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x45796e,_0xba3a('0x133'));}try{var _0x5b93df=eval(_0x45796e[_0xba3a('0x132')])?'true':_0xba3a('0x134');this['channel'][_0xba3a('0xaf')](util['format'](_0xba3a('0x135'),_0x45796e['condition'],_0x5b93df));return{'code':0xc8,'result':_0x5b93df};}catch(_0x981600){return{'code':0xc8,'result':_0xba3a('0x134')};}};AGIVertices['prototype'][_0xba3a('0x136')]=function(_0x62787f){logger[_0xba3a('0x30')](util['format'](_0xba3a('0x137'),_0x62787f[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x62787f[_0xba3a('0x138')])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x62787f,_0xba3a('0x139'));}var _0x20d379=this[_0xba3a('0x26')][_0xba3a('0x72')](this,_0x62787f[_0xba3a('0x138')]);if(!_0x20d379){return this['channel'][_0xba3a('0x2f')](_0x62787f,_0xba3a('0x13a'));}for(var _0xcee69e=0x0;_0xcee69e<_0x20d379[_0xba3a('0x99')];_0xcee69e+=0x1){var _0x5d18b2=this['channel'][_0xba3a('0x13')](util[_0xba3a('0x2c')](_0xba3a('0x13b'),_0x20d379[_0xcee69e]));if(_0x5d18b2[_0xba3a('0xa2')]===-0x1){return _0x5d18b2;}logger[_0xba3a('0x30')](util['format'](_0xba3a('0x13c'),_0x20d379[_0xcee69e],_0x5d18b2[_0xba3a('0xa0')]));if(_0x5d18b2[_0xba3a('0xa0')]===_0xba3a('0x13d')){logger[_0xba3a('0x30')](util['format'](_0xba3a('0x13c'),_0x20d379[_0xcee69e],'true'));this[_0xba3a('0x39')]['noop'](util[_0xba3a('0x2c')](_0xba3a('0x13c'),_0x20d379[_0xcee69e],'true'));return{'code':0xc8,'result':_0xba3a('0x13d')};}else{logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x13c'),_0x20d379[_0xcee69e],_0xba3a('0x134')));this['channel'][_0xba3a('0xaf')](util[_0xba3a('0x2c')]('IFTIME\x20%s\x20%s',_0x20d379[_0xcee69e],_0xba3a('0x134')));}}return{'code':0xc8,'result':_0xba3a('0x134')};};AGIVertices[_0xba3a('0x12')][_0xba3a('0x13e')]=function(_0x34c1fd){logger['info'](util[_0xba3a('0x2c')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x34c1fd[_0xba3a('0x3b')]));return this['channel'][_0xba3a('0x13e')]();};AGIVertices['prototype']['ispeechasr']=function(_0x58b4c6){logger['info'](util[_0xba3a('0x2c')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x58b4c6['label']));if(!this[_0xba3a('0x82')](_0x58b4c6['key'])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0x11f'));}var _0x54b447=_0xba3a('0x120');var _0x310eb1=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x21dd35=util[_0xba3a('0x2c')](_0xba3a('0x9c'),_0x310eb1,_0x54b447);var _0x51fda0=!![];if(_0x58b4c6[_0xba3a('0x121')]===_0xba3a('0x122')){_0x51fda0=![];}var _0x40f3c2=this[_0xba3a('0x39')][_0xba3a('0x123')](_0x310eb1,_0x54b447,_0x58b4c6[_0xba3a('0x124')],_0x58b4c6['timeout'],undefined,_0x51fda0);if(_0x40f3c2['result']!==-0x1){this[_0xba3a('0x39')]['noop'](util[_0xba3a('0x2c')]('ispeech\x20%s\x20file\x20created',_0x21dd35));var _0x4e16e5=this[_0xba3a('0x80')]['sync'](this,_0x58b4c6,_0x21dd35);if(_0x4e16e5){for(var _0x275184 in _0x4e16e5){if(_0x4e16e5[_0xba3a('0x94')](_0x275184)){this[_0xba3a('0x39')][_0xba3a('0x9e')](util[_0xba3a('0x2c')](_0xba3a('0x13f'),_0x275184[_0xba3a('0x6c')]()),_0x4e16e5[_0x275184]);}}return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x140'),JSON[_0xba3a('0x76')](_0x4e16e5)));}}return _0x40f3c2;};AGIVertices[_0xba3a('0x12')]['ispeechtts']=function(_0x4ae853){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x141'),_0x4ae853[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x4ae853[_0xba3a('0x7b')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0x11f'));}if(!this[_0xba3a('0x82')](_0x4ae853[_0xba3a('0x60')])){return this['channel'][_0xba3a('0xaf')](_0xba3a('0xb6'));}this[_0xba3a('0x39')][_0xba3a('0xaf')](util['format'](_0xba3a('0x142'),_0x4ae853[_0xba3a('0x60')]));var _0x1dff1b=this[_0xba3a('0x7e')][_0xba3a('0x72')](this,_0x4ae853);if(_0x1dff1b){this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x143'),_0x1dff1b));var _0x387f74=this['channel'][_0xba3a('0xee')](_0x1dff1b,_0x4ae853[_0xba3a('0x124')]);try{fs['unlink'](_0x1dff1b+_0xba3a('0xf0'));}catch(_0x2af4f3){logger[_0xba3a('0x2f')](_0x2af4f3);}return _0x387f74;}return this[_0xba3a('0x39')]['error'](_0x4ae853,_0xba3a('0x144'));};AGIVertices[_0xba3a('0x12')]['login']=function(_0xeee6f9){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x145'),_0xeee6f9['label']));if(!this['isConfigured'](_0xeee6f9[_0xba3a('0x146')])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0xeee6f9,_0xba3a('0x147'));}logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x148'),this[_0xba3a('0x39')][_0xba3a('0x3f')],_0xeee6f9[_0xba3a('0x146')]));var _0x39af34=this[_0xba3a('0x5a')][_0xba3a('0x72')](this,_0xeee6f9[_0xba3a('0x146')]);if(_0x39af34){logger['info'](util[_0xba3a('0x2c')](_0xba3a('0x149'),this[_0xba3a('0x39')][_0xba3a('0x3f')],_0xeee6f9[_0xba3a('0x146')]));this[_0xba3a('0x39')]['noop'](util[_0xba3a('0x2c')](_0xba3a('0x149'),this[_0xba3a('0x39')][_0xba3a('0x3f')],_0xeee6f9[_0xba3a('0x146')]));return{'code':0xc8,'result':_0xba3a('0x14a')};}else{logger[_0xba3a('0x30')](util[_0xba3a('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xba3a('0x39')]['callerid'],_0xeee6f9[_0xba3a('0x146')]));this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x14b'),this['channel'][_0xba3a('0x3f')],_0xeee6f9[_0xba3a('0x146')]));return{'code':0xc8,'result':_0xba3a('0x14c')};}};AGIVertices['prototype'][_0xba3a('0x14d')]=function(_0xf68b82){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x14e'),_0xf68b82[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0xf68b82['findBy'])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0xf68b82,_0xba3a('0x147'));}logger['info'](util[_0xba3a('0x2c')](_0xba3a('0x148'),this[_0xba3a('0x39')]['callerid'],_0xf68b82[_0xba3a('0x146')]));var _0x2407ac=this[_0xba3a('0x59')][_0xba3a('0x72')](this,_0xf68b82[_0xba3a('0x146')]);if(_0x2407ac){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x149'),this['channel']['callerid'],_0xf68b82[_0xba3a('0x146')]));this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x149'),this[_0xba3a('0x39')][_0xba3a('0x3f')],_0xf68b82[_0xba3a('0x146')]));return{'code':0xc8,'result':_0xba3a('0x14a')};}else{logger[_0xba3a('0x30')](util[_0xba3a('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xba3a('0x39')][_0xba3a('0x3f')],_0xf68b82[_0xba3a('0x146')]));this[_0xba3a('0x39')][_0xba3a('0xaf')](util['format'](_0xba3a('0x14b'),this[_0xba3a('0x39')]['callerid'],_0xf68b82[_0xba3a('0x146')]));return{'code':0xc8,'result':_0xba3a('0x14c')};}};AGIVertices[_0xba3a('0x12')][_0xba3a('0x14f')]=function(_0x25ae64){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x150'),_0x25ae64[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x25ae64[_0xba3a('0x151')])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x25ae64,_0xba3a('0x152'));}this[_0xba3a('0x39')]['noop'](util[_0xba3a('0x2c')](_0xba3a('0x153'),_0x25ae64[_0xba3a('0x151')]));var _0x3a1e2c=eval(_0x25ae64[_0xba3a('0x151')]);if(!this[_0xba3a('0x82')](_0x25ae64[_0xba3a('0xcd')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0xce'));}var _0x7fd851=this[_0xba3a('0x13')][_0xba3a('0x72')](this,_0x25ae64[_0xba3a('0xcd')]);if(!_0x7fd851){return this['channel']['error'](_0x25ae64,_0xba3a('0xcf'));}if(_[_0xba3a('0x9d')](_0x3a1e2c)){var _0x5f31fa=this;_0x3a1e2c[_0xba3a('0xd0')](function(_0x1708fe,_0x53bcbe){_0x5f31fa[_0xba3a('0x39')][_0xba3a('0x9e')](util[_0xba3a('0x2c')](_0xba3a('0x154'),_0x7fd851,_0x53bcbe),_0x1708fe);});return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x155'),_0x7fd851));}else{return this['channel'][_0xba3a('0x9e')](_0x7fd851,_0x3a1e2c);}};AGIVertices[_0xba3a('0x12')][_0xba3a('0xe')]=function(_0x2e3eae){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x2e3eae['label']));if(_0x2e3eae[_0xba3a('0xff')]===0x0){return this[_0xba3a('0xa4')](_0x2e3eae);}_0x2e3eae[_0xba3a('0xff')]-=0x1;if(!this[_0xba3a('0x82')](_0x2e3eae[_0xba3a('0x101')])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x2e3eae,'no\x20file\x20audio\x20selected');}var _0x1def9e=this[_0xba3a('0x20')][_0xba3a('0x72')](this,_0x2e3eae[_0xba3a('0x101')]);if(!_0x1def9e){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x2e3eae,_0xba3a('0x102'));}var _0x594294=this[_0xba3a('0x39')][_0xba3a('0x156')](_0x1def9e,_0x2e3eae[_0xba3a('0x103')],_0x2e3eae[_0xba3a('0x157')]);var _0x5998f0=_0x594294[_0xba3a('0xa2')];if(_0x594294[_0xba3a('0xa2')]===-0x1){this[_0xba3a('0x38')]['sync'](this,_0x2e3eae,'-1');return _0x594294;}else if(_0x594294[_0xba3a('0xa0')]===_0xba3a('0x68')){_0x594294[_0xba3a('0xa2')]=_0x594294['result'][_0xba3a('0x99')]>0x0?_0x594294[_0xba3a('0xa2')]:'t';}else if(_['isEmpty'](_0x594294['result'])){_0x594294[_0xba3a('0xa2')]='#';_0x5998f0='#';}if(!this['isConfigured'](_0x2e3eae[_0xba3a('0xcd')])){this['channel'][_0xba3a('0xaf')](_0xba3a('0xce'));}else{var _0x2a16ee=this['getVariable'][_0xba3a('0x72')](this,_0x2e3eae[_0xba3a('0xcd')]);if(!_0x2a16ee){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x2e3eae,'no\x20variable\x20found');}this[_0xba3a('0x39')]['setVariable'](_0x2a16ee,_0x5998f0);}this[_0xba3a('0x38')][_0xba3a('0x72')](this,_0x2e3eae,_0x5998f0);return _0x594294;};AGIVertices[_0xba3a('0x12')]['noop']=function(_0x3f50be){logger['info'](util[_0xba3a('0x2c')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x3f50be[_0xba3a('0x3b')]));return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0x3f50be['output']||_0x3f50be['label']);};AGIVertices[_0xba3a('0x12')][_0xba3a('0x158')]=function(_0x11aabb){logger['info'](util[_0xba3a('0x2c')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x11aabb[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x11aabb['findBy'])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x11aabb,_0xba3a('0x147'));}logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x148'),this['channel'][_0xba3a('0x3f')],_0x11aabb['findBy']));var _0x3ed821=this[_0xba3a('0x54')]['sync'](this,_0x11aabb[_0xba3a('0x159')]);var _0x2122d4=this[_0xba3a('0x56')][_0xba3a('0x72')](this,_0x11aabb[_0xba3a('0x146')],_0x3ed821);if(_0x2122d4){logger['info'](util[_0xba3a('0x2c')](_0xba3a('0x149'),this[_0xba3a('0x39')]['callerid'],_0x11aabb[_0xba3a('0x146')]));this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x149'),this[_0xba3a('0x39')][_0xba3a('0x3f')],_0x11aabb[_0xba3a('0x146')]));return{'code':0xc8,'result':_0xba3a('0x14a')};}else{logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x14b'),this['channel'][_0xba3a('0x3f')],_0x11aabb[_0xba3a('0x146')]));this[_0xba3a('0x39')][_0xba3a('0xaf')](util['format'](_0xba3a('0x149'),this[_0xba3a('0x39')][_0xba3a('0x3f')],_0x11aabb['findBy']));return{'code':0xc8,'result':_0xba3a('0x14c')};}};AGIVertices[_0xba3a('0x12')][_0xba3a('0x15a')]=function(_0x1aa1c3){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x15b'),_0x1aa1c3['label']));if(!this[_0xba3a('0x82')](_0x1aa1c3[_0xba3a('0x101')])){return this['channel'][_0xba3a('0x2f')](_0x1aa1c3,_0xba3a('0x100'));}var _0x3fd4b0=this[_0xba3a('0x20')][_0xba3a('0x72')](this,_0x1aa1c3[_0xba3a('0x101')]);if(!_0x3fd4b0){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x1aa1c3,_0xba3a('0x102'));}var _0x279dc2=this[_0xba3a('0x39')][_0xba3a('0x5c')](_0xba3a('0x15c'),[_0x3fd4b0,_0x1aa1c3['opts']]);if(_0x279dc2[_0xba3a('0xa2')]===-0x1){return _0x279dc2;}return this[_0xba3a('0x39')]['noop'](util['format'](_0xba3a('0xb3'),'PLAYBACK',_0x3fd4b0));};AGIVertices['prototype'][_0xba3a('0x15d')]=function(_0x2432ad){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x15e'),_0x2432ad[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x2432ad['queue_id'])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x2432ad,_0xba3a('0x15f'));}var _0x23f551='';var _0x1abbfe=parseInt(_0x2432ad[_0xba3a('0x160')],0xa);if(isNaN(_0x1abbfe)){_0x23f551=_0x2432ad[_0xba3a('0x160')];}else{_0x23f551=this[_0xba3a('0x16')][_0xba3a('0x72')](this,_0x2432ad[_0xba3a('0x160')]);if(!_0x23f551){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x2432ad,_0xba3a('0x161'));}}var _0x566ae7='';if(this[_0xba3a('0x82')](_0x2432ad['file_id'])){var _0x575bbc=this[_0xba3a('0x20')][_0xba3a('0x72')](this,_0x2432ad['file_id']);if(_0x575bbc){_0x566ae7=_0x575bbc;}}this[_0xba3a('0x38')][_0xba3a('0x72')](this,_0x2432ad,_0x23f551);if(_0x2432ad[_0xba3a('0xda')][_0xba3a('0x162')]('x')<0x0){_0x2432ad[_0xba3a('0xda')]+='x';}if(_0x2432ad[_0xba3a('0xda')][_0xba3a('0x162')]('X')<0x0){_0x2432ad[_0xba3a('0xda')]+='X';}this['channel'][_0xba3a('0x9e')](_0xba3a('0x163'),_0x23f551?_0x23f551[_0xba3a('0x164')]():'');var _0x40ee3c=this[_0xba3a('0x39')][_0xba3a('0x5c')](_0xba3a('0x165'),[_0x23f551,_0x2432ad['opts'],_0x2432ad[_0xba3a('0x74')],_0x566ae7,_0x2432ad[_0xba3a('0x68')],_0x2432ad[_0xba3a('0x8')],_0x2432ad[_0xba3a('0x166')],_0x2432ad[_0xba3a('0x167')],'',_0x2432ad[_0xba3a('0x168')]]);if(_0x40ee3c[_0xba3a('0xa2')]===-0x1){return _0x40ee3c;}return this[_0xba3a('0x39')]['noop'](util[_0xba3a('0x2c')](_0xba3a('0xb3'),_0xba3a('0x165'),_0x23f551));};AGIVertices[_0xba3a('0x12')][_0xba3a('0x169')]=function(_0x1c1efd){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x16a'),_0x1c1efd[_0xba3a('0x3b')]));var _0x2d21d7=_0x1c1efd['recordingFormat']||_0xba3a('0x120');var _0x4d8635=util[_0xba3a('0x2c')]('%s_%s',this['channel']['uniqueid'],rs['generate'](0x5));var _0x19cdea=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x4d8635,_0x2d21d7);var _0x1e0656=util[_0xba3a('0x2c')](_0xba3a('0x129'),FILES_PATH,_0x4d8635);this['createSquareRecording']['sync'](this,_0x1c1efd,_0x4d8635,_0x19cdea);this[_0xba3a('0x39')][_0xba3a('0x9e')](_0xba3a('0x16b'),_0x4d8635);logger[_0xba3a('0x30')](_0xba3a('0x16c'),_0x1e0656,_0x2d21d7,_0x1c1efd[_0xba3a('0x16d')],_0x1c1efd[_0xba3a('0x68')]);return this[_0xba3a('0x39')][_0xba3a('0x123')](_0x1e0656,_0x2d21d7,_0x1c1efd[_0xba3a('0x16d')],_0x1c1efd['timeout'],undefined,!![]);};AGIVertices[_0xba3a('0x12')][_0xba3a('0x16e')]=function(_0x23080e){logger[_0xba3a('0x30')](util['format'](_0xba3a('0x16f'),_0x23080e[_0xba3a('0x3b')]));if(!this['isConfigured'](_0x23080e[_0xba3a('0x74')])){return this['channel'][_0xba3a('0xaf')](_0xba3a('0x170'));}var _0x2f044e=this[_0xba3a('0x66')][_0xba3a('0x72')](this,_0x23080e);logger['info'](util[_0xba3a('0x2c')](_0xba3a('0x171'),util[_0xba3a('0x172')](_0x2f044e,{'showHidden':![],'depth':null})));if(!this[_0xba3a('0x82')](_0x23080e[_0xba3a('0xcd')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0x173'));}var _0x182cf6=this[_0xba3a('0x13')]['sync'](this,_0x23080e[_0xba3a('0xcd')]);if(!_0x182cf6){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x23080e,'no\x20variable\x20found');}this[_0xba3a('0x39')]['setVariable'](util['format'](_0xba3a('0x174'),_0x182cf6),_0x2f044e[_0xba3a('0x78')]?_0x2f044e['statusCode']:_0xba3a('0x175'));this[_0xba3a('0x39')][_0xba3a('0x9e')](util[_0xba3a('0x2c')](_0xba3a('0x176'),_0x182cf6),_0x2f044e[_0xba3a('0x177')]?_0x2f044e['statusMessage']:'OK');if(_0x2f044e['body']){try{this[_0xba3a('0x9b')](_0x2f044e[_0xba3a('0x6d')],_0x182cf6);}catch(_0x2bfd52){logger[_0xba3a('0x2f')](util[_0xba3a('0x2c')](_0xba3a('0x178'),_0x182cf6));}}return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0xd3'),_0x182cf6));};AGIVertices[_0xba3a('0x12')][_0xba3a('0x179')]=function(_0x145c0f){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x17a'),_0x145c0f[_0xba3a('0x3b')]));return this[_0xba3a('0x39')]['sayDigits'](_0x145c0f['digits'][_0xba3a('0x5d')](/\s+/g,''),_0x145c0f[_0xba3a('0x16d')]);};AGIVertices['prototype']['saynumber']=function(_0x9139b5){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x17b'),_0x9139b5[_0xba3a('0x3b')]));return this['channel'][_0xba3a('0x17c')](_0x9139b5[_0xba3a('0x17d')]['replace'](/\s+/g,''),_0x9139b5[_0xba3a('0x16d')]);};AGIVertices[_0xba3a('0x12')][_0xba3a('0x17e')]=function(_0x97d370){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x17f'),_0x97d370['label']));return this[_0xba3a('0x39')]['sayPhonetic'](_0x97d370[_0xba3a('0x60')],_0x97d370[_0xba3a('0x16d')]);};AGIVertices[_0xba3a('0x12')]['sendMail']=function(_0x5b8145){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x180'),_0x5b8145[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x5b8145[_0xba3a('0x181')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0x182'));}var _0x501c5b=this['getMailAccount']['sync'](this,_0x5b8145[_0xba3a('0x181')]);if(!_0x501c5b||!_0x501c5b[_0xba3a('0x183')]){return this['channel'][_0xba3a('0x2f')](_0x5b8145,_0xba3a('0x184'));}var _0x3941de={'from':util[_0xba3a('0x2c')](_0xba3a('0x185'),_0x501c5b[_0xba3a('0x15')],_0x501c5b[_0xba3a('0x186')]||_0x501c5b[_0xba3a('0x183')]['user']),'to':_0x5b8145['to']||'','cc':_0x5b8145['cc']||'','bcc':_0x5b8145[_0xba3a('0x187')]||'','subject':_0x5b8145[_0xba3a('0x188')],'html':_0x5b8145[_0xba3a('0x60')],'text':_0x5b8145[_0xba3a('0x60')]};var _0x227462={'tls':{'rejectUnauthorized':![]}};if(_0x501c5b[_0xba3a('0x183')][_0xba3a('0x189')]){_0x227462[_0xba3a('0x189')]=_0x501c5b['Smtp'][_0xba3a('0x189')];}else{_0x227462[_0xba3a('0x18a')]=_0x501c5b['Smtp'][_0xba3a('0x18a')];_0x227462['port']=_0x501c5b[_0xba3a('0x183')][_0xba3a('0x18b')];_0x227462[_0xba3a('0x18c')]=_0x501c5b['Smtp'][_0xba3a('0x18c')];}if(_0x501c5b[_0xba3a('0x183')]['authentication']){_0x227462[_0xba3a('0x18d')]={'user':_0x501c5b[_0xba3a('0x183')][_0xba3a('0x18e')],'pass':_0x501c5b[_0xba3a('0x183')]['pass']};}if(this[_0xba3a('0x82')](_0x5b8145[_0xba3a('0x18f')])){}logger[_0xba3a('0xd5')](_0xba3a('0x190'),JSON[_0xba3a('0x76')](_0x3941de));this[_0xba3a('0x38')][_0xba3a('0x72')](this,_0x5b8145,_0x5b8145[_0xba3a('0x181')]);this['channel']['noop'](util['format'](_0xba3a('0x191'),_0x501c5b['name']));this[_0xba3a('0x25')][_0xba3a('0x72')](this,_0x227462,_0x3941de);return this[_0xba3a('0x39')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xba3a('0x12')][_0xba3a('0x192')]=function(_0x3c1401){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x193'),_0x3c1401['label']));return this[_0xba3a('0x39')][_0xba3a('0xaf')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xba3a('0x12')][_0xba3a('0x194')]=function(_0x3f04ec){logger['info'](util[_0xba3a('0x2c')](_0xba3a('0x195'),_0x3f04ec[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x3f04ec[_0xba3a('0x196')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')]('no\x20sms\x20account\x20configured');}var _0xeecc7=this['getSmsAccount'][_0xba3a('0x72')](this,_0x3f04ec[_0xba3a('0x196')]);if(!_0xeecc7){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x3f04ec,_0xba3a('0x197'));}var _0x2c9d80={'body':_0x3f04ec[_0xba3a('0x198')],'phone':_0x3f04ec['to']||'','SmsAccountId':_0xeecc7['id']};logger[_0xba3a('0xd5')](_0xba3a('0x199'),JSON[_0xba3a('0x76')](_0x2c9d80));this['createSquareDetailsReport'][_0xba3a('0x72')](this,_0x3f04ec,_0x3f04ec[_0xba3a('0x196')]);this[_0xba3a('0x39')]['noop'](util[_0xba3a('0x2c')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0xeecc7[_0xba3a('0x15')]));this['createSmsMessage'][_0xba3a('0x72')](this,_0x2c9d80);return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0x19a'));};AGIVertices['prototype'][_0xba3a('0x19b')]=function(_0x22cfb2){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x19c'),_0x22cfb2[_0xba3a('0x3b')]));if(!this['isConfigured'](_0x22cfb2[_0xba3a('0xcd')])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x22cfb2,'no\x20variable\x20selected');}var _0x5d13b4=this[_0xba3a('0x13')][_0xba3a('0x72')](this,_0x22cfb2['variable_id']);if(!_0x5d13b4){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x22cfb2,_0xba3a('0xcf'));}return this[_0xba3a('0x39')]['setVariable'](_0x5d13b4,_0x22cfb2['variable_value']);};AGIVertices[_0xba3a('0x12')]['start']=function(_0x3e9bd5){logger['info'](util[_0xba3a('0x2c')](_0xba3a('0x19d'),_0x3e9bd5[_0xba3a('0x3b')]));this[_0xba3a('0x39')]['noop']('START\x20CALLY\x20SQUARE');if(_0x3e9bd5['answer']===_0xba3a('0x19e')){this['channel']['noop'](_0xba3a('0x19f'));return this[_0xba3a('0x39')]['answer']();}return this['channel'][_0xba3a('0xaf')](_0xba3a('0x1a0'));};AGIVertices[_0xba3a('0x12')][_0xba3a('0x1a1')]=function(_0x28bd26){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x1a2'),_0x28bd26[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x28bd26['project_id'])){return this['channel'][_0xba3a('0x2f')](_0x28bd26,_0xba3a('0x1a3'));}var _0x53e92b=this['getSquareProject'][_0xba3a('0x72')](this,_0x28bd26[_0xba3a('0x1a4')]);if(!this[_0xba3a('0x82')](_0x53e92b)){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x28bd26,util[_0xba3a('0x2c')](_0xba3a('0x1a5'),_0x28bd26['project_id']));}if(_0x53e92b===this[_0xba3a('0x39')][_0xba3a('0x3d')]){return this[_0xba3a('0x39')]['error'](_0x28bd26,_0xba3a('0x1a6'));}this[_0xba3a('0x38')][_0xba3a('0x72')](this,_0x28bd26,_0x53e92b);var _0x3e7dc7=this['channel']['exec']('AGI',util[_0xba3a('0x2c')](_0xba3a('0x1a7'),config[_0xba3a('0x8')][_0xba3a('0x18a')]||_0xba3a('0x1a8'),_0x53e92b,this[_0xba3a('0x39')][_0xba3a('0x3d')]));if(_0x3e7dc7['result']===-0x1){return _0x3e7dc7;}return this[_0xba3a('0x39')]['noop'](util['format'](_0xba3a('0xb3'),_0xba3a('0x1a9'),_0x53e92b));};AGIVertices[_0xba3a('0x12')][_0xba3a('0x1aa')]=function(_0x2d46b5){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x1ab'),_0x2d46b5[_0xba3a('0x3b')]));var _0x10e0e0=this[_0xba3a('0x1ac')][_0xba3a('0x72')](this,_0x2d46b5[_0xba3a('0xa6')]);this[_0xba3a('0x38')][_0xba3a('0x72')](this,_0x2d46b5,_0x2d46b5[_0xba3a('0xa6')]);if(this['isConfigured'](_0x2d46b5[_0xba3a('0xcd')])){var _0x32dda1=this['getVariable'][_0xba3a('0x72')](this,_0x2d46b5[_0xba3a('0xcd')]);if(_0x32dda1){this['channel'][_0xba3a('0x9e')](_0x32dda1,_0x10e0e0);return this['channel']['noop'](util[_0xba3a('0x2c')](_0xba3a('0x1ad'),_0x2d46b5[_0xba3a('0xa6')],_0x32dda1));}}return this['channel'][_0xba3a('0xaf')](util[_0xba3a('0x2c')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x2d46b5[_0xba3a('0xa6')]));};AGIVertices['prototype'][_0xba3a('0x1ae')]=function(_0x133255){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x1af'),_0x133255['label']));if(!this['isConfigured'](_0x133255[_0xba3a('0x5f')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0x1b0'));}if(!this[_0xba3a('0x82')](_0x133255[_0xba3a('0x60')])){return this[_0xba3a('0x39')][_0xba3a('0xaf')](_0xba3a('0xb6'));}this[_0xba3a('0x39')]['noop'](util[_0xba3a('0x2c')](_0xba3a('0x1b1'),_0x133255[_0xba3a('0x60')]));var _0x2122c3=this['googleCloudTTS']['sync'](this,_0x133255);if(_0x2122c3){this['channel']['noop'](util[_0xba3a('0x2c')](_0xba3a('0x1b2'),_0x2122c3));var _0x138a8e=this[_0xba3a('0x39')][_0xba3a('0xee')](_0x2122c3);try{fs[_0xba3a('0xef')](_0x2122c3+_0xba3a('0xf0'));}catch(_0x228101){logger[_0xba3a('0x2f')](_0x228101);}return _0x138a8e;}return this[_0xba3a('0x39')]['error'](_0x133255,_0xba3a('0x1b3'));};AGIVertices[_0xba3a('0x12')][_0xba3a('0x1b4')]=function(_0x31076c){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x1b5'),_0x31076c[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x31076c['text'])){return this['channel'][_0xba3a('0xaf')](_0xba3a('0xb6'));}this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x1b6'),_0x31076c[_0xba3a('0x60')]));var _0x324ca2=this[_0xba3a('0x64')][_0xba3a('0x72')](this,_0x31076c);if(_0x324ca2){this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x1b7'),_0x324ca2));var _0x512aa2=this['channel'][_0xba3a('0xee')](_0x324ca2);try{fs[_0xba3a('0xef')](_0x324ca2+_0xba3a('0xf0'));}catch(_0x1ceb19){logger[_0xba3a('0x2f')](_0x1ceb19);}return _0x512aa2;}return this['channel'][_0xba3a('0x2f')](_0x31076c,_0xba3a('0x1b8'));};AGIVertices[_0xba3a('0x12')]['unpause']=function(_0x2383cf){logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x1b9'),_0x2383cf[_0xba3a('0x3b')]));if(!this[_0xba3a('0x82')](_0x2383cf['findBy'])){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x2383cf,'no\x20find\x20by\x20configured');}logger[_0xba3a('0x30')](util[_0xba3a('0x2c')](_0xba3a('0x148'),this[_0xba3a('0x39')][_0xba3a('0x3f')],_0x2383cf['findBy']));var _0x413df3=this[_0xba3a('0x58')][_0xba3a('0x72')](this,_0x2383cf[_0xba3a('0x146')]);if(_0x413df3){logger[_0xba3a('0x30')](util['format'](_0xba3a('0x149'),this[_0xba3a('0x39')]['callerid'],_0x2383cf[_0xba3a('0x146')]));this['channel'][_0xba3a('0xaf')](util[_0xba3a('0x2c')](_0xba3a('0x149'),this[_0xba3a('0x39')][_0xba3a('0x3f')],_0x2383cf[_0xba3a('0x146')]));return{'code':0xc8,'result':_0xba3a('0x14a')};}else{logger[_0xba3a('0x30')](util['format'](_0xba3a('0x14b'),this[_0xba3a('0x39')]['callerid'],_0x2383cf['findBy']));this[_0xba3a('0x39')]['noop'](util[_0xba3a('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xba3a('0x39')][_0xba3a('0x3f')],_0x2383cf[_0xba3a('0x146')]));return{'code':0xc8,'result':_0xba3a('0x14c')};}};AGIVertices[_0xba3a('0x12')]['voicemail']=function(_0x1d34ae){logger['info'](util[_0xba3a('0x2c')](_0xba3a('0x1ba'),_0x1d34ae[_0xba3a('0x3b')]));var _0x48ceeb=this[_0xba3a('0x39')][_0xba3a('0x5c')](_0xba3a('0x1bb'),[_0x1d34ae[_0xba3a('0x1bc')],_0x1d34ae[_0xba3a('0x7a')]]);if(_0x48ceeb[_0xba3a('0xa2')]===-0x1){return _0x48ceeb;}return this[_0xba3a('0x39')][_0xba3a('0xaf')](util[_0xba3a('0x2c')]('Executed\x20command\x20%s\x20%s',_0xba3a('0x1bb'),_0x1d34ae[_0xba3a('0x1bc')]));};AGIVertices[_0xba3a('0x12')][_0xba3a('0x1bd')]=function(_0x3d8f0b){logger['info'](util[_0xba3a('0x2c')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x3d8f0b[_0xba3a('0x3b')]));if(!this['isConfigured'](_0x3d8f0b[_0xba3a('0xcd')])){return this['channel'][_0xba3a('0x2f')](_0x3d8f0b,'no\x20variable\x20selected');}var _0x472831=this[_0xba3a('0x13')][_0xba3a('0x72')](this,_0x3d8f0b[_0xba3a('0xcd')]);if(!_0x472831){return this[_0xba3a('0x39')][_0xba3a('0x2f')](_0x3d8f0b,_0xba3a('0xcf'));}var _0x127ea4=this[_0xba3a('0x39')][_0xba3a('0x13')](_0x472831);return{'code':0xc8,'result':_0x127ea4[_0xba3a('0xa0')]?_0x127ea4[_0xba3a('0xa0')]:'-'};};String[_0xba3a('0x12')][_0xba3a('0x1be')]=function(_0x498e93,_0x3e1ab8){return this[_0xba3a('0x9f')](_0x498e93)[_0xba3a('0x1bf')](_0x3e1ab8);};module[_0xba3a('0x1c0')]=AGIVertices; \ No newline at end of file +var _0x24b2=['appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','replaceAllVariables','saveRestApiResult','isArray','%s.%s','split','length','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','scheduledAt','delay','add','noop','custom_app','exec','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','MRCPSynth','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','ndauth_url','no\x20username\x20configured','password','no\x20password\x20configured','bot','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','menu','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','digits','saynumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','pass','debug','account_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','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','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','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','path','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','channel','rpc','mailRpc','getVariableById','then','name','prototype','catch','getSquareProject','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','context','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','callback_','lastName','phone','toString','callback_priority','getPause','getPauseById','agentPause','agent','callerid','isNil','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR'];(function(_0x21fd45,_0x32e491){var _0x537a12=function(_0x5d446c){while(--_0x5d446c){_0x21fd45['push'](_0x21fd45['shift']());}};_0x537a12(++_0x32e491);}(_0x24b2,0x133));var _0x224b=function(_0x22f6b3,_0x35be3e){_0x22f6b3=_0x22f6b3-0x0;var _0x3dcb97=_0x24b2[_0x22f6b3];return _0x3dcb97;};'use strict';var fs=require('fs');var path=require(_0x224b('0x0'));var util=require('util');var _=require(_0x224b('0x1'));var sh=require(_0x224b('0x2'));var odbc=require('odbc')();var rs=require(_0x224b('0x3'));var moment=require(_0x224b('0x4'));var Mustache=require(_0x224b('0x5'));var rp=require(_0x224b('0x6'));var logger=require(_0x224b('0x7'))(_0x224b('0x8'));var config=require('../../config/environment');var scripts=require(_0x224b('0x9'));var FILES_PATH=_0x224b('0xa');var recursiveMapAttributes=[_0x224b('0xb'),_0x224b('0xc')];var verticesWithRetry=['menu',_0x224b('0xd'),'getsecretdigits'];var AGIVertices=function(_0x4fa46d,_0x328e13,_0x456970){this[_0x224b('0xe')]=_0x4fa46d;this[_0x224b('0xf')]=_0x328e13;this[_0x224b('0x10')]=_0x456970;};AGIVertices['prototype']['getVariable']=function(_0x7acb49,_0x21f35c){this[_0x224b('0xf')][_0x224b('0x11')](_0x7acb49)[_0x224b('0x12')](function(_0x333e58){_0x21f35c(null,_0x333e58?_0x333e58[_0x224b('0x13')]:![]);})['catch'](function(_0x240a73){_0x21f35c(_0x240a73);});};AGIVertices[_0x224b('0x14')]['getVoiceQueue']=function(_0x504e49,_0x589c35){this[_0x224b('0xf')]['getVoiceQueueById'](_0x504e49)[_0x224b('0x12')](function(_0x5ed2b1){_0x589c35(null,_0x5ed2b1?_0x5ed2b1[_0x224b('0x13')]:![]);})[_0x224b('0x15')](function(_0x4194ab){_0x589c35(_0x4194ab);});};AGIVertices[_0x224b('0x14')][_0x224b('0x16')]=function(_0x1ae020,_0x1f8a0a){this[_0x224b('0xf')]['getSquareProjectById'](_0x1ae020)[_0x224b('0x12')](function(_0x3f4936){_0x1f8a0a(null,_0x3f4936?_0x3f4936[_0x224b('0x13')]:![]);})['catch'](function(_0x7b0e07){_0x1f8a0a(_0x7b0e07);});};AGIVertices[_0x224b('0x14')][_0x224b('0x17')]=function(_0x526246,_0x1af897){this[_0x224b('0xf')][_0x224b('0x18')](_0x526246)['then'](function(_0x31403e){_0x1af897(null,_0x31403e?_0x31403e['dsn']:![]);})['catch'](function(_0x22653a){_0x1af897(_0x22653a);});};AGIVertices[_0x224b('0x14')][_0x224b('0x19')]=function(_0x36027c,_0x1e0022){this[_0x224b('0xf')][_0x224b('0x1a')](_0x36027c)['then'](function(_0x1b2699){_0x1e0022(null,_0x1b2699?_0x1b2699['name']:![]);})[_0x224b('0x15')](function(_0x33dfdb){_0x1e0022(_0x33dfdb);});};AGIVertices[_0x224b('0x14')][_0x224b('0x1b')]=function(_0x8a68ad,_0x4f67a8){this[_0x224b('0xf')][_0x224b('0x1c')](_0x8a68ad)[_0x224b('0x12')](function(_0x2f2c07){_0x4f67a8(null,_0x2f2c07?_0x2f2c07[_0x224b('0x13')]:![]);})['catch'](function(_0x457f7a){_0x4f67a8(_0x457f7a);});};AGIVertices[_0x224b('0x14')][_0x224b('0x1d')]=function(_0x22b75e,_0x2516fb){var _0x1fa27b=this;this[_0x224b('0xf')][_0x224b('0x1e')](_0x22b75e)['then'](function(_0x5d1cde){_0x2516fb(null,_0x5d1cde?_0x1fa27b[_0x224b('0x1f')](_0x5d1cde['save_name']):![]);})[_0x224b('0x15')](function(_0x42add2){_0x2516fb(_0x42add2);});};AGIVertices[_0x224b('0x14')][_0x224b('0x20')]=function(_0x56fd38,_0x21e965){this[_0x224b('0xf')][_0x224b('0x21')](_0x56fd38)[_0x224b('0x12')](function(_0x18c38c){_0x21e965(null,_0x18c38c?_0x18c38c:![]);})[_0x224b('0x15')](function(_0x157c06){_0x21e965(_0x157c06);});};AGIVertices[_0x224b('0x14')][_0x224b('0x22')]=function(_0xc375c9,_0x2ab1a8,_0x40aaf6){this['mailRpc'][_0x224b('0x22')](_0xc375c9,_0x2ab1a8)['then'](function(){_0x40aaf6(null);})[_0x224b('0x15')](function(_0x385d5d){_0x40aaf6(_0x385d5d);});};AGIVertices[_0x224b('0x14')][_0x224b('0x23')]=function(_0x4e35d6,_0x1b36d8){this[_0x224b('0xf')][_0x224b('0x24')](_0x4e35d6)[_0x224b('0x12')](function(_0x5172c0){if(_0x5172c0){if(_0x5172c0[_0x224b('0x25')]){_0x1b36d8(null,[_0x5172c0['interval']]);}else{_0x1b36d8(null,_[_0x224b('0x26')](_0x5172c0[_0x224b('0x27')],_0x224b('0x28')));}}else{_0x1b36d8(null,![]);}})[_0x224b('0x15')](function(_0x13bb9f){_0x1b36d8(_0x13bb9f);});};AGIVertices[_0x224b('0x14')][_0x224b('0x1f')]=function(_0x2d4ccf){return util[_0x224b('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x2d4ccf);};AGIVertices['prototype'][_0x224b('0x2a')]=function(_0x323438,_0x2c74a1,_0x4d2d3b){odbc['open'](_0x323438,function(_0x785ca){if(_0x785ca){logger[_0x224b('0x2b')](_0x224b('0x2c'),_0x785ca);_0x4d2d3b(_0x785ca);}else{logger[_0x224b('0x2d')]('ODBC\x20connection\x20successfully');odbc[_0x224b('0x2e')](_0x2c74a1,function(_0x598940,_0x1d4e2d){if(_0x598940){logger[_0x224b('0x2d')](_0x224b('0x2f'),_0x2c74a1);_0x4d2d3b(_0x598940);}else{logger['info'](_0x224b('0x30'),_0x2c74a1);odbc[_0x224b('0x31')](function(_0x37fdd1){if(_0x37fdd1){logger[_0x224b('0x2b')](_0x224b('0x32'),_0x37fdd1);}_0x4d2d3b(null,_0x1d4e2d);});}});}});};AGIVertices['prototype'][_0x224b('0x33')]=function(_0x2881e5,_0x5b3a21){this[_0x224b('0xf')][_0x224b('0x34')](_0x2881e5)['then'](function(_0x2e9067){_0x5b3a21(null,_0x2e9067?_0x2e9067:![]);})[_0x224b('0x15')](function(_0x26e3d7){_0x5b3a21(_0x26e3d7);});};AGIVertices[_0x224b('0x14')][_0x224b('0x35')]=function(_0x277b1e,_0x31c59c){this['rpc']['createSmsMessage'](_0x277b1e)['then'](function(_0x2c698f){_0x31c59c(null,_0x2c698f);})['catch'](function(_0x4dd085){_0x31c59c(_0x4dd085);});};AGIVertices[_0x224b('0x14')][_0x224b('0x36')]=function(_0xcf82d7,_0x364dd9,_0x41337d){this[_0x224b('0xf')][_0x224b('0x36')]({'uniqueid':this['channel'][_0x224b('0x37')],'node':_0xcf82d7[_0x224b('0x38')],'application':_0xcf82d7['agicommand'],'data':_0x364dd9||null,'project_name':this['channel'][_0x224b('0x39')],'callerid':this['channel']['callerid']})[_0x224b('0x12')](function(_0xec8624){if(_0x41337d){_0x41337d(null,_0xec8624);}})[_0x224b('0x15')](function(_0x50801a){if(_0x41337d){_0x41337d(_0x50801a);}});};AGIVertices[_0x224b('0x14')][_0x224b('0x3a')]=function(_0x42c1e3,_0x48f1f2,_0x3dacc2,_0x5d7647){this[_0x224b('0xf')][_0x224b('0x3a')]({'uniqueid':this[_0x224b('0xe')][_0x224b('0x37')],'callerid':this[_0x224b('0xe')]['callerid'],'calleridname':this[_0x224b('0xe')]['calleridname'],'context':this['channel'][_0x224b('0x3b')],'extension':this[_0x224b('0xe')]['extension'],'priority':this['channel'][_0x224b('0x3c')],'accountcode':this[_0x224b('0xe')][_0x224b('0x3d')],'dnid':this['channel']['dnid'],'projectName':this[_0x224b('0xe')]['arg_1'],'saveName':_0x48f1f2,'filename':_0x42c1e3[_0x224b('0x3e')]||_0x48f1f2,'savePath':_0x3dacc2})[_0x224b('0x12')](function(_0x12a1df){_0x5d7647(null,_0x12a1df);})['catch'](function(_0x126583){_0x5d7647(_0x126583);});};AGIVertices[_0x224b('0x14')][_0x224b('0x3f')]=function(_0x58a33e,_0x5b2192,_0x4206bf){this[_0x224b('0xf')][_0x224b('0x3f')]({'uniqueid':this['channel'][_0x224b('0x37')],'body':_0x58a33e,'direction':_0x5b2192})[_0x224b('0x12')](function(_0x577317){if(_0x4206bf){_0x4206bf(null,_0x577317);}})[_0x224b('0x15')](function(_0x57f3f6){if(_0x4206bf){_0x4206bf(_0x57f3f6);}});};AGIVertices[_0x224b('0x14')][_0x224b('0x40')]=function(_0x677765,_0x2cc6d3){this[_0x224b('0xf')]['createCmContact']({'firstName':_[_0x224b('0x41')](_0x677765[_0x224b('0x13')])||_['isNil'](_0x677765[_0x224b('0x13')])?_0x224b('0x42')+Math['random']():_0x677765['name'],'lastName':_['isEmpty'](_0x677765[_0x224b('0x43')])||_['isNil'](_0x677765['lastName'])?null:_0x677765[_0x224b('0x43')],'phone':_0x677765[_0x224b('0x44')],'ListId':_0x677765['list_id'],'scheduledat':_0x677765['scheduledAt'],'callbackUniqueid':this[_0x224b('0xe')][_0x224b('0x37')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x677765['scheduledAt'][_0x224b('0x45')](),'priority':_0x677765[_0x224b('0x46')]})[_0x224b('0x12')](function(_0x561ab3){_0x2cc6d3(null,_0x561ab3);})['catch'](function(_0x34b0aa){_0x2cc6d3(_0x34b0aa);});};AGIVertices[_0x224b('0x14')][_0x224b('0x47')]=function(_0x3895b2,_0x8d9cab){this['rpc'][_0x224b('0x48')](_0x3895b2)['then'](function(_0x38a57b){_0x8d9cab(null,_0x38a57b?_0x38a57b[_0x224b('0x13')]:![]);})[_0x224b('0x15')](function(_0x32ad7d){_0x8d9cab(_0x32ad7d);});};AGIVertices[_0x224b('0x14')][_0x224b('0x49')]=function(_0x53c7c9,_0x5740c2,_0x303940){var _0x32447b={'role':_0x224b('0x4a')};_0x32447b[_0x53c7c9]=this[_0x224b('0xe')][_0x224b('0x4b')];this[_0x224b('0xf')][_0x224b('0x49')](_0x32447b,_0x5740c2,this[_0x224b('0xe')][_0x224b('0x37')])['then'](function(_0x16a198){_0x303940(null,_[_0x224b('0x4c')](_0x16a198)?![]:!![]);})[_0x224b('0x15')](function(_0x2dc203){logger[_0x224b('0x2b')](_0x2dc203);_0x303940(null,![]);});};AGIVertices[_0x224b('0x14')][_0x224b('0x4d')]=function(_0x97eb16,_0x146243){var _0x27f5e4={'role':_0x224b('0x4a')};_0x27f5e4[_0x97eb16]=this[_0x224b('0xe')][_0x224b('0x4b')];this[_0x224b('0xf')]['agentUnpause'](_0x27f5e4)['then'](function(_0x183c70){_0x146243(null,_[_0x224b('0x4c')](_0x183c70)?![]:!![]);})[_0x224b('0x15')](function(_0x487e5e){logger[_0x224b('0x2b')](_0x487e5e);_0x146243(null,![]);});};AGIVertices['prototype'][_0x224b('0x4e')]=function(_0x591e81,_0x4387c0){var _0x30347b={'role':_0x224b('0x4a')};_0x30347b[_0x591e81]=this[_0x224b('0xe')][_0x224b('0x4b')];this[_0x224b('0xf')][_0x224b('0x4e')](_0x30347b)['then'](function(_0xc7fb4a){_0x4387c0(null,_[_0x224b('0x4c')](_0xc7fb4a)?![]:!![]);})[_0x224b('0x15')](function(_0x5a4ba9){logger[_0x224b('0x2b')](_0x5a4ba9);_0x4387c0(null,![]);});};AGIVertices['prototype'][_0x224b('0x4f')]=function(_0xc0e49b,_0x1837fd){var _0x5aa28b={'role':_0x224b('0x4a')};_0x5aa28b[_0xc0e49b]=this[_0x224b('0xe')]['callerid'];var _0x4ec9de=_0xc0e49b!=_0x224b('0x50')?util[_0x224b('0x29')](_0x224b('0x51'),_0x224b('0x52'),this[_0x224b('0xe')][_0x224b('0x4b')]):undefined;this[_0x224b('0xf')]['agentLogin'](_0x5aa28b,_0x4ec9de)[_0x224b('0x12')](function(_0x4e18a7){_0x1837fd(null,_[_0x224b('0x4c')](_0x4e18a7)?![]:!![]);})['catch'](function(_0x497019){logger[_0x224b('0x2b')](_0x497019);_0x1837fd(null,![]);});};AGIVertices[_0x224b('0x14')][_0x224b('0x53')]=function(_0x3a6004,_0x36f553){sh['exec'](_[_0x224b('0x54')](_0x3a6004),function(_0xe48f5b,_0x48073e){var _0x5157f1=_0x48073e[_0x224b('0x55')](/(\r\n|\n|\r)/gm,'');_0x36f553(null,_0x5157f1);});};AGIVertices[_0x224b('0x14')][_0x224b('0x56')]=function(_0x236ebf,_0x130898){scripts[_0x224b('0x56')](_0x236ebf[_0x224b('0x57')],_0x236ebf[_0x224b('0x58')]||_0x224b('0x59'),_0x236ebf[_0x224b('0x59')],_0x236ebf[_0x224b('0x5a')]||_0x224b('0x5b'),_0x236ebf[_0x224b('0x5c')]||'MALE',_0x236ebf[_0x224b('0x5d')]||'MP3')[_0x224b('0x12')](function(_0x3c4d5c){_0x130898(null,_0x3c4d5c);})[_0x224b('0x15')](function(_0x16d667){_0x130898(_0x16d667);});};AGIVertices[_0x224b('0x14')][_0x224b('0x5e')]=function(_0x48ae51,_0x354a1c){scripts[_0x224b('0x5e')](_0x48ae51['text'],_0x48ae51[_0x224b('0x5f')]||'en',0x1)['then'](function(_0x40ea2b){_0x354a1c(null,_0x40ea2b);})[_0x224b('0x15')](function(_0x69ac03){_0x354a1c(_0x69ac03);});};AGIVertices[_0x224b('0x14')][_0x224b('0x60')]=function(_0x5666d1,_0x766fbe){var _0x3fecc0={'uri':_0x5666d1[_0x224b('0x61')],'method':_0x5666d1[_0x224b('0x62')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5666d1[_0x224b('0x63')])===_0x224b('0x64')&&parseInt(_0x5666d1[_0x224b('0x63')])>=0x1?parseInt(_0x5666d1[_0x224b('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x224b('0x65')]([_0x224b('0x66'),_0x224b('0x67')],_0x3fecc0[_0x224b('0x62')][_0x224b('0x68')]())){try{_0x3fecc0['body']=_0x5666d1[_0x224b('0xc')]?JSON[_0x224b('0x69')](_0x5666d1[_0x224b('0xc')]):{};}catch(_0x5d73e2){logger[_0x224b('0x2b')](_0x224b('0x6a'),_0x5d73e2);}}try{_0x3fecc0[_0x224b('0x6b')]=_0x5666d1['rawHeaders']?JSON['parse'](_0x5666d1[_0x224b('0xb')]):{};}catch(_0x11d478){logger[_0x224b('0x2b')](_0x224b('0x6c'),_0x11d478);}if(_0x5666d1['computedVariables']){try{var _0xf5b826=require(_0x5666d1[_0x224b('0x6d')])[_0x224b('0x6e')](this,_0x3fecc0);_0x3fecc0[_0x224b('0x6f')]=Mustache[_0x224b('0x70')](_0x5666d1[_0x224b('0x61')],_0xf5b826,{},['$$','$$']);if(_0x3fecc0[_0x224b('0x6b')]){_0x3fecc0[_0x224b('0x6b')]=JSON[_0x224b('0x69')](Mustache[_0x224b('0x70')](JSON[_0x224b('0x71')](_0x3fecc0[_0x224b('0x6b')]),_0xf5b826,{},['$$','$$']));}if(_0x3fecc0[_0x224b('0x72')]){_0x3fecc0['body']=JSON[_0x224b('0x69')](Mustache[_0x224b('0x70')](JSON['stringify'](_0x3fecc0[_0x224b('0x72')]),_0xf5b826,{},['$$','$$']));}}catch(_0x52c70d){logger[_0x224b('0x2b')](_0x224b('0x73'),_0x52c70d);}}rp(_0x3fecc0)[_0x224b('0x12')](function(_0x3db640){var _0x506c52={'statusCode':_0x3db640[_0x224b('0x74')]||0xc8,'statusMessage':_0x3db640['statusMessage']||'OK','headers':_0x3db640['headers']||{},'body':_0x3db640[_0x224b('0x72')]||{}};_0x766fbe(null,_0x506c52);})['catch'](function(_0x4060fa){var _0x4a048f={'statusCode':_0x4060fa[_0x224b('0x74')]||0x1f4,'statusMessage':_0x4060fa['message']||_0x224b('0x75'),'headers':_0x4060fa[_0x224b('0x76')]['headers']||{},'body':_0x4060fa[_0x224b('0x76')]['body']||{}};_0x766fbe(null,_0x4a048f);});};AGIVertices[_0x224b('0x14')][_0x224b('0x77')]=function(_0x38264b,_0x5a6e7e){scripts['googleDialogflow'](this[_0x224b('0xe')][_0x224b('0x37')],_0x38264b['key'],_0x38264b['text'],_0x38264b[_0x224b('0x78')]||'en')[_0x224b('0x12')](function(_0x19e203){_0x5a6e7e(null,_0x19e203);})[_0x224b('0x15')](function(_0x30470d){_0x5a6e7e(_0x30470d);});};AGIVertices[_0x224b('0x14')][_0x224b('0x79')]=function(_0x13288f,_0x1c733b){scripts[_0x224b('0x79')](this[_0x224b('0xe')],_0x13288f)['then'](function(_0x5bf25a){_0x1c733b(null,_0x5bf25a);})[_0x224b('0x15')](function(_0x536bab){_0x1c733b(_0x536bab);});};AGIVertices[_0x224b('0x14')][_0x224b('0x7a')]=function(_0x2af4c9,_0x460e4d){scripts[_0x224b('0x7a')](_0x2af4c9[_0x224b('0x7b')],_0x2af4c9[_0x224b('0x59')],_0x2af4c9[_0x224b('0x7c')]||_0x224b('0x5b'),_0x2af4c9[_0x224b('0x7d')])[_0x224b('0x12')](function(_0x1f0b08){_0x460e4d(null,_0x1f0b08);})[_0x224b('0x15')](function(_0x430097){_0x460e4d(_0x430097);});};AGIVertices[_0x224b('0x14')]['ispeechASR']=function(_0x4f4282,_0x5d2d7d,_0x1fc28c){scripts[_0x224b('0x7e')](_0x5d2d7d,_0x4f4282[_0x224b('0x7b')],_0x4f4282['ispeech_asr_language']||_0x224b('0x5b'),this['isConfigured'](_0x4f4282[_0x224b('0x7f')])?_0x4f4282[_0x224b('0x7f')]:undefined)['then'](function(_0x28bbd5){_0x1fc28c(null,_0x28bbd5);})[_0x224b('0x15')](function(_0x5c8dc2){_0x1fc28c(_0x5c8dc2);});};AGIVertices[_0x224b('0x14')][_0x224b('0x80')]=function(_0x486b10,_0x4e0d4b){scripts[_0x224b('0x80')](_0x486b10[_0x224b('0x81')],_0x486b10['aws_secret_access_key'],_0x486b10[_0x224b('0x82')],_0x486b10[_0x224b('0x83')]||_0x224b('0x84'),_0x486b10['text'],_0x486b10[_0x224b('0x85')]||_0x224b('0x59'))['then'](function(_0x3fa337){_0x4e0d4b(null,_0x3fa337);})['catch'](function(_0x35116e){_0x4e0d4b(_0x35116e);});};AGIVertices[_0x224b('0x14')][_0x224b('0x86')]=function(_0x287565,_0x2d0744){scripts[_0x224b('0x86')](this['channel'][_0x224b('0x37')],_0x287565[_0x224b('0x81')],_0x287565[_0x224b('0x87')],_0x287565[_0x224b('0x88')],_0x287565[_0x224b('0x59')],_0x287565[_0x224b('0x89')])[_0x224b('0x12')](function(_0x478b05){_0x2d0744(null,_0x478b05);})[_0x224b('0x15')](function(_0x3ac79b){_0x2d0744(_0x3ac79b);});};AGIVertices[_0x224b('0x14')]['googleASR']=function(_0x21f5c2,_0xe31abd,_0x421747){scripts[_0x224b('0x8a')](_0xe31abd,_0x21f5c2['key'],_0x21f5c2[_0x224b('0x8b')]||_0x224b('0x5b'))[_0x224b('0x12')](function(_0x5f1253){_0x421747(null,_0x5f1253);})[_0x224b('0x15')](function(_0x29ffb5){_0x421747(_0x29ffb5);});};AGIVertices['prototype'][_0x224b('0x8c')]=function(_0x223991,_0x1772f4,_0xc85fc6){scripts[_0x224b('0x8c')](_0x1772f4,_0x223991['appid'],_0x223991[_0x224b('0x8d')],_0x223991[_0x224b('0x6f')])[_0x224b('0x12')](function(_0x1a7935){_0xc85fc6(null,_0x1a7935);})[_0x224b('0x15')](function(_0x334d0f){_0xc85fc6(_0x334d0f);});};AGIVertices[_0x224b('0x14')][_0x224b('0x8e')]=function(_0x3f46bb){var _0x4dcf3e=_[_0x224b('0x65')](verticesWithRetry,_0x3f46bb[_0x224b('0x8f')])?_0x3f46bb:_[_0x224b('0x90')](_0x3f46bb);for(var _0x14c399 in _0x4dcf3e){if(_0x4dcf3e[_0x224b('0x91')](_0x14c399)){if(_0x4dcf3e[_0x14c399]&&_[_0x224b('0x92')](_0x4dcf3e[_0x14c399])){if(_[_0x224b('0x65')](recursiveMapAttributes,_0x14c399)){_0x4dcf3e[_0x14c399]=this[_0x224b('0x93')](_0x4dcf3e[_0x14c399]);}else{_0x4dcf3e[_0x14c399]=this['replaceAllVariables'](_0x4dcf3e[_0x14c399]);}}}}return _0x4dcf3e;};AGIVertices[_0x224b('0x14')][_0x224b('0x94')]=function(_0x2a56c0){for(var _0x7301be in _0x2a56c0){if(_0x2a56c0['hasOwnProperty'](_0x7301be)){if(_[_0x224b('0x95')](_0x2a56c0[_0x7301be])){this[_0x224b('0x94')](_0x2a56c0[_0x7301be]);}else if(_['isArray'](_0x2a56c0[_0x7301be])){for(var _0x5162be=0x0;_0x5162be<_0x2a56c0[_0x7301be]['length'];_0x5162be++){this[_0x224b('0x94')](_0x2a56c0[_0x7301be][_0x5162be]);}}else if(_[_0x224b('0x92')](_0x2a56c0[_0x7301be])){_0x2a56c0[_0x7301be]=this[_0x224b('0x96')](_0x2a56c0[_0x7301be]);}}}};AGIVertices['prototype'][_0x224b('0x97')]=function(_0x1b26c7,_0x44fcf){for(var _0x30d163 in _0x1b26c7){if(_0x1b26c7['hasOwnProperty'](_0x30d163)){if(_[_0x224b('0x95')](_0x1b26c7[_0x30d163])){if(!_[_0x224b('0x41')](_0x1b26c7[_0x30d163])){this[_0x224b('0x97')](_0x1b26c7[_0x30d163],util[_0x224b('0x29')]('%s.%s',_0x44fcf,_0x30d163));}}else if(_[_0x224b('0x98')](_0x1b26c7[_0x30d163])){for(var _0x4c7b17=0x0;_0x4c7b17<_0x1b26c7[_0x30d163]['length'];_0x4c7b17++){this['saveRestApiResult'](_0x1b26c7[_0x30d163][_0x4c7b17],util[_0x224b('0x29')](_0x224b('0x99'),_0x44fcf,_0x30d163+'['+_0x4c7b17+']'));}}else{if(!_['isNil'](_0x1b26c7[_0x30d163])){this[_0x224b('0xe')]['setVariable'](util['format'](_0x224b('0x99'),_0x44fcf,_0x30d163),_0x1b26c7[_0x30d163]);}}}}};AGIVertices[_0x224b('0x14')][_0x224b('0x93')]=function(_0x1751a3){try{var _0x3864e5=JSON['parse'](_0x1751a3);this[_0x224b('0x94')](_0x3864e5);return JSON[_0x224b('0x71')](_0x3864e5);}catch(_0x56d543){return this[_0x224b('0x96')](_0x1751a3);}};AGIVertices[_0x224b('0x14')][_0x224b('0x96')]=function(_0x44fc32){var _0x4e9cef=_0x44fc32[_0x224b('0x9a')]('{');for(var _0x15ba20=0x1;_0x15ba20<_0x4e9cef['length'];_0x15ba20+=0x1){var _0x5556df=_0x4e9cef[_0x15ba20][_0x224b('0x9a')]('}');if(_0x5556df[_0x224b('0x9b')]>0x1){_0x44fc32=_0x44fc32[_0x224b('0x9c')]('{'+_0x5556df[0x0]+'}',this['channel'][_0x224b('0x9d')](_0x5556df[0x0])[_0x224b('0x9e')]||_0x5556df[0x0]);}}if(_0x4e9cef[_0x224b('0x9b')]===0x1){return _0x44fc32[_0x224b('0x45')]();}return this[_0x224b('0x96')](_0x44fc32);};AGIVertices[_0x224b('0x14')][_0x224b('0x9f')]=function(_0x511526,_0x2df8ca){var _0x34c15d=this[_0x224b('0xe')][_0x224b('0x9d')](_0x511526);if(_0x34c15d[_0x224b('0xa0')]===-0x1){return _0x34c15d;}logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0xa1'),_0x2df8ca,_0x34c15d['extra']));return this[_0x224b('0xe')][_0x224b('0xa2')](_0x2df8ca,_0x34c15d[_0x224b('0x9e')]);};AGIVertices[_0x224b('0x14')][_0x224b('0xa3')]=function(_0x2d51c7){return _0x2d51c7&&_0x2d51c7!=='0'&&_0x2d51c7!=='-1'&&_0x2d51c7!=='';};AGIVertices[_0x224b('0x14')][_0x224b('0xa4')]=function(_0x5858ce){this[_0x224b('0x36')]['sync'](this,_0x5858ce,'-');_0x5858ce[_0x224b('0xa5')]=_0x5858ce[_0x224b('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x224b('0x14')]['agi']=function(_0x129ccb){logger[_0x224b('0x2d')](util['format'](_0x224b('0xa6'),_0x129ccb[_0x224b('0x38')]));return this[_0x224b('0xe')][_0x224b('0x8')]([_0x129ccb[_0x224b('0xa7')],_0x129ccb[_0x224b('0xa8')]]);};AGIVertices['prototype'][_0x224b('0xa9')]=function(_0x3dcf34){logger[_0x224b('0x2d')](util['format'](_0x224b('0xaa'),_0x3dcf34['label']));if(this['isConfigured'](_0x3dcf34['timeout'])){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0xab'),_0x3dcf34['timeout']));var _0x2b1ef7=this[_0x224b('0xe')]['wait'](_0x3dcf34[_0x224b('0x63')]);if(_0x2b1ef7[_0x224b('0xa0')]===-0x1){return _0x2b1ef7;}}return this['channel'][_0x224b('0xa9')]();};AGIVertices[_0x224b('0x14')][_0x224b('0xac')]=function(_0x5d632b){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0xad'),_0x5d632b[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x5d632b[_0x224b('0xae')])){return this['channel'][_0x224b('0x2b')](_0x5d632b,'no\x20list\x20selected');}_0x5d632b[_0x224b('0xaf')]=moment();if(this[_0x224b('0xa3')](_0x5d632b[_0x224b('0xb0')])){_0x5d632b[_0x224b('0xaf')]=moment()[_0x224b('0xb1')](_0x5d632b[_0x224b('0xb0')],'minutes');}if(!this[_0x224b('0xa3')](_0x5d632b[_0x224b('0x46')])){_0x5d632b[_0x224b('0x46')]=0x2;}this['createCmContact']['sync'](this,_0x5d632b);return this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5d632b[_0x224b('0x44')],_0x5d632b[_0x224b('0xae')],_0x5d632b['scheduledAt']));};AGIVertices[_0x224b('0x14')][_0x224b('0xb3')]=function(_0x189f36){logger['info'](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x189f36[_0x224b('0x38')]));var _0x87535e=this[_0x224b('0xe')][_0x224b('0xb4')](_0x189f36['application'],_0x189f36[_0x224b('0x76')]);if(_0x87535e[_0x224b('0xa0')]===-0x1){return _0x87535e;}return this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0xb5'),_0x189f36[_0x224b('0xb6')],_0x189f36[_0x224b('0x76')]));};AGIVertices[_0x224b('0x14')][_0x224b('0xb7')]=function(_0x1692c6){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0xb8'),_0x1692c6[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x1692c6[_0x224b('0x59')])){return this[_0x224b('0xe')]['noop'](_0x224b('0xb9'));}var _0x3751d7='\x22'+_0x1692c6[_0x224b('0x59')]+'\x22';if(this[_0x224b('0xa3')](_0x1692c6[_0x224b('0x76')])){_0x3751d7+=','+_0x1692c6[_0x224b('0x76')];}var _0x40407f=this[_0x224b('0xe')][_0x224b('0xb4')]('MRCPSynth',_0x3751d7);if(_0x40407f['result']===-0x1){return _0x40407f;}return this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0xba'),_0x3751d7));};AGIVertices['prototype']['sestektts']=function(_0x2979fd){logger[_0x224b('0x2d')](util[_0x224b('0x29')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x2979fd[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x2979fd[_0x224b('0x59')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x536591='\x22'+_0x2979fd[_0x224b('0x59')]+'\x22';if(this[_0x224b('0xa3')](_0x2979fd[_0x224b('0x76')])){_0x536591+=','+_0x2979fd[_0x224b('0x76')];}var _0x1aa25e=this[_0x224b('0xe')]['exec'](_0x224b('0xbb'),_0x536591);if(_0x1aa25e[_0x224b('0xa0')]===-0x1){return _0x1aa25e;}return this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0xba'),_0x536591));};AGIVertices[_0x224b('0x14')]['lumenvoxasr']=function(_0xe6f2ea){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0xbc'),_0xe6f2ea[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0xe6f2ea[_0x224b('0xbd')])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0xbe'));}var _0x1eace5=_0xe6f2ea[_0x224b('0xbd')];if(this['isConfigured'](_0xe6f2ea[_0x224b('0x76')])){_0x1eace5+=','+_0xe6f2ea['options'];}var _0x1117bf=this[_0x224b('0xe')][_0x224b('0xb4')](_0x224b('0xbf'),_0x1eace5);if(_0x1117bf[_0x224b('0xa0')]===-0x1){return _0x1117bf;}var _0x4918cc=this[_0x224b('0x9f')](_0x224b('0xc0'),_0x224b('0xc1'));if(_0x4918cc[_0x224b('0xa0')]===-0x1){return _0x4918cc;}var _0x87c013=this[_0x224b('0x9f')](_0x224b('0xc2'),_0x224b('0xc3'));if(_0x87c013[_0x224b('0xa0')]===-0x1){return _0x87c013;}var _0x1f0ce1=this[_0x224b('0x9f')](_0x224b('0xc4'),'LUMENVOX_ASR_INSTANCE');if(_0x1f0ce1['result']===-0x1){return _0x1f0ce1;}return this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1eace5));};AGIVertices[_0x224b('0x14')][_0x224b('0xc5')]=function(_0x520b59){logger['info'](util[_0x224b('0x29')](_0x224b('0xc6'),_0x520b59['label']));if(!this[_0x224b('0xa3')](_0x520b59[_0x224b('0xbd')])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0xbe'));}var _0x43684b=_0x520b59[_0x224b('0xbd')];if(this[_0x224b('0xa3')](_0x520b59['options'])){_0x43684b+=','+_0x520b59['options'];}var _0x2588c0=this[_0x224b('0xe')]['exec'](_0x224b('0xbf'),_0x43684b);if(_0x2588c0[_0x224b('0xa0')]===-0x1){return _0x2588c0;}var _0x504c56=this[_0x224b('0x9f')](_0x224b('0xc0'),_0x224b('0xc7'));if(_0x504c56[_0x224b('0xa0')]===-0x1){return _0x504c56;}var _0xc41f33=this[_0x224b('0x9f')](_0x224b('0xc2'),'SESTEK_ASR_TRANSCRIPT');if(_0xc41f33['result']===-0x1){return _0xc41f33;}var _0x1bff43=this[_0x224b('0x9f')](_0x224b('0xc4'),_0x224b('0xc8'));if(_0x1bff43[_0x224b('0xa0')]===-0x1){return _0x1bff43;}return this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0xc9'),_0x43684b));};AGIVertices[_0x224b('0x14')][_0x224b('0xca')]=function(_0x34eea7){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0xcb'),_0x34eea7[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x34eea7[_0x224b('0xcc')])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x34eea7,_0x224b('0xcd'));}var _0x33cebc=this[_0x224b('0x17')][_0x224b('0x6e')](this,_0x34eea7['odbc_id']);if(!_0x33cebc){return this['channel']['error'](_0x34eea7,_0x224b('0xce'));}if(!this[_0x224b('0xa3')](_0x34eea7['query'])){return this[_0x224b('0xe')]['error'](_0x34eea7,_0x224b('0xcf'));}var _0x4e7c51=_0x34eea7['query'][_0x224b('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0xd0'),_0x4e7c51));var _0x5bdf53=this[_0x224b('0x2a')]['sync'](this,_0x33cebc,_0x4e7c51);this[_0x224b('0x36')][_0x224b('0x6e')](this,_0x34eea7,_0x4e7c51);if(!this['isConfigured'](_0x34eea7['variable_id'])){return this[_0x224b('0xe')][_0x224b('0xb2')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x67ffd9=this[_0x224b('0x9d')][_0x224b('0x6e')](this,_0x34eea7[_0x224b('0xd1')]);if(!_0x67ffd9){return this[_0x224b('0xe')]['error'](_0x34eea7,_0x224b('0xd2'));}var _0x471801=this;_0x5bdf53[_0x224b('0xd3')](function(_0xc0fbec,_0x5ba603){Object['keys'](_0xc0fbec)[_0x224b('0xd3')](function(_0xb1bdca){_0x471801[_0x224b('0xe')][_0x224b('0xa2')](util['format'](_0x224b('0xd4'),_0x67ffd9,_0x5ba603,_0xb1bdca),_0xc0fbec[_0xb1bdca]);});});this[_0x224b('0xe')][_0x224b('0xa2')](util[_0x224b('0x29')](_0x224b('0xd5'),_0x67ffd9),_0x5bdf53[_0x224b('0x9b')]);return this[_0x224b('0xe')]['noop'](util[_0x224b('0x29')](_0x224b('0xd6'),_0x67ffd9));};AGIVertices[_0x224b('0x14')]['dial']=function(_0x2ffc20){logger['debug'](util[_0x224b('0x29')](_0x224b('0xd7'),_0x2ffc20[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x2ffc20['sip_id'])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x2ffc20,_0x224b('0xd8'));}var _0x22f501=this[_0x224b('0x19')][_0x224b('0x6e')](this,_0x2ffc20[_0x224b('0xd9')]);if(!_0x22f501){return this[_0x224b('0xe')]['error'](_0x2ffc20,_0x224b('0xda'));}var _0x8c9d17=this[_0x224b('0xe')][_0x224b('0xb4')](_0x224b('0xdb'),[util[_0x224b('0x29')](_0x224b('0xdc'),_0x22f501),_0x2ffc20[_0x224b('0x63')],_0x2ffc20[_0x224b('0xdd')],_0x2ffc20[_0x224b('0x61')]]);if(_0x8c9d17[_0x224b('0xa0')]===-0x1){return _0x8c9d17;}return this[_0x224b('0xe')]['noop'](util['format'](_0x224b('0xde'),_0x224b('0xdb')));};AGIVertices[_0x224b('0x14')][_0x224b('0xdf')]=function(_0x23dc95){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0xe0'),_0x23dc95['label']));if(!this[_0x224b('0xa3')](_0x23dc95[_0x224b('0x7b')])){return this[_0x224b('0xe')][_0x224b('0xb2')]('no\x20key\x20configured');}if(!this[_0x224b('0xa3')](_0x23dc95[_0x224b('0x59')])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0xb9'));}this[_0x224b('0xe')]['bot']=!![];this[_0x224b('0x36')](_0x23dc95);this['createSquareMessage'](_0x23dc95[_0x224b('0x59')],'in');this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0xe1'),_0x23dc95['text']));var _0x463262=this[_0x224b('0x77')][_0x224b('0x6e')](this,_0x23dc95);if(_0x463262){for(var _0x10514b in _0x463262){if(_0x463262[_0x224b('0x91')](_0x10514b)){this['channel'][_0x224b('0xa2')](util[_0x224b('0x29')](_0x224b('0xe2'),_0x10514b[_0x224b('0x68')]()),_0x463262[_0x10514b]);}}this['createSquareMessage'](_0x463262[_0x224b('0xe3')],_0x224b('0xe4'));return this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0xe5'),_0x463262[_0x224b('0xe3')]));}return this[_0x224b('0xe')]['error'](_0x23dc95,_0x224b('0xe6'));};AGIVertices['prototype'][_0x224b('0xe7')]=function(_0x58393){logger['info'](util[_0x224b('0x29')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x58393[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x58393[_0x224b('0xe8')])){return this[_0x224b('0xe')][_0x224b('0xb2')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x224b('0xa3')](_0x58393['username'])){return this['channel']['noop'](_0x224b('0xe9'));}if(!this[_0x224b('0xa3')](_0x58393[_0x224b('0xea')])){return this[_0x224b('0xe')]['noop'](_0x224b('0xeb'));}if(!this[_0x224b('0xa3')](_0x58393['ndassistant_url'])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0xb9'));}this[_0x224b('0xe')][_0x224b('0xec')]=!![];this['createSquareDetailsReport'](_0x58393);this['createSquareMessage'](_0x58393[_0x224b('0x59')],'in');this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')]('Trying\x20SestekNDA:\x20%s',_0x58393[_0x224b('0x59')]));var _0x5c8da2=this[_0x224b('0x79')][_0x224b('0x6e')](this,_0x58393);if(_0x5c8da2){for(var _0x4593df in _0x5c8da2){if(_0x5c8da2[_0x224b('0x91')](_0x4593df)){this[_0x224b('0xe')]['setVariable'](util[_0x224b('0x29')](_0x224b('0xed'),_0x4593df[_0x224b('0x68')]()),_0x5c8da2[_0x4593df]);}}this[_0x224b('0x3f')](_0x5c8da2[_0x224b('0xe3')],_0x224b('0xe4'));if(_0x5c8da2['audiofile']){this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0xee'),_0x5c8da2[_0x224b('0xef')]));var _0x1c10e4=this['channel'][_0x224b('0xf0')](_0x5c8da2[_0x224b('0xef')]);try{fs[_0x224b('0xf1')](_0x5c8da2['audiofile']+'.wav');}catch(_0x35e204){logger[_0x224b('0x2b')](_0x35e204);}return _0x1c10e4;}else{return this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0xf2'),_0x5c8da2[_0x224b('0xe3')]));}}return this[_0x224b('0xe')][_0x224b('0x2b')](_0x58393,_0x224b('0xf3'));};AGIVertices[_0x224b('0x14')]['end']=function(_0x77af90){logger['info'](util[_0x224b('0x29')](_0x224b('0xf4'),_0x77af90[_0x224b('0x38')]));return this[_0x224b('0xe')]['noop']('end');};AGIVertices[_0x224b('0x14')]['ext_dial']=function(_0x4c5d49){logger[_0x224b('0x2d')](util[_0x224b('0x29')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x4c5d49[_0x224b('0x38')]));var _0x2adbb1='';if(_0x4c5d49[_0x224b('0xf5')]){if(!this[_0x224b('0xa3')](_0x4c5d49[_0x224b('0xf5')])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x4c5d49,_0x224b('0xf6'));}else{var _0x1cd3c2=parseInt(_0x4c5d49[_0x224b('0xf5')],0xa);if(isNaN(_0x1cd3c2)){_0x2adbb1=_0x4c5d49[_0x224b('0xf5')];}else{_0x2adbb1=this[_0x224b('0x1b')][_0x224b('0x6e')](this,_0x4c5d49['trunk_id']);if(!_0x2adbb1){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x4c5d49,_0x224b('0xf7'));}}}}else if(_0x4c5d49[_0x224b('0xf8')]){_0x2adbb1=_0x4c5d49[_0x224b('0xf8')];}else{return this['channel'][_0x224b('0x2b')](_0x4c5d49,_0x224b('0xf6'));}var _0x4fec70=this['channel'][_0x224b('0xb4')](_0x224b('0xdb'),[util['format'](_0x224b('0xf9'),_0x2adbb1,_0x4c5d49[_0x224b('0x44')]),_0x4c5d49[_0x224b('0x63')],_0x4c5d49['opts'],_0x4c5d49[_0x224b('0x61')]]);if(_0x4fec70[_0x224b('0xa0')]===-0x1){return _0x4fec70;}return this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')]('Executed\x20command\x20%s',_0x224b('0xdb')));};AGIVertices[_0x224b('0x14')][_0x224b('0xfa')]=function(_0x6d1217){logger['info'](util[_0x224b('0x29')](_0x224b('0xfb'),_0x6d1217[_0x224b('0x38')]));return this[_0x224b('0xe')][_0x224b('0xb2')]('finally');};AGIVertices['prototype'][_0x224b('0xd')]=function(_0x1065a1){logger['info'](util[_0x224b('0x29')](_0x224b('0xfc'),_0x1065a1[_0x224b('0x38')]));if(_0x1065a1[_0x224b('0xa5')]===0x0){return this[_0x224b('0xa4')](_0x1065a1);}_0x1065a1[_0x224b('0xa5')]-=0x1;if(!this[_0x224b('0xa3')](_0x1065a1['file_id'])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x1065a1,_0x224b('0xfd'));}var _0x27c929=this[_0x224b('0x1d')][_0x224b('0x6e')](this,_0x1065a1[_0x224b('0xfe')]);if(!_0x27c929){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x1065a1,_0x224b('0xff'));}if(!this[_0x224b('0xa3')](_0x1065a1[_0x224b('0xd1')])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x224b('0x100'));}var _0x1b8a57=this[_0x224b('0xe')][_0x224b('0x101')](_0x27c929,_0x1065a1['response'],_0x1065a1[_0x224b('0x102')]);var _0x475403=_0x1b8a57['result']?_0x1b8a57[_0x224b('0xa0')]['toString']():'';logger[_0x224b('0x2d')](_0x224b('0x103'),JSON[_0x224b('0x71')](_0x1b8a57));if(_0x1b8a57[_0x224b('0xa0')]===-0x1){this[_0x224b('0x36')]['sync'](this,_0x1065a1,_0x475403);return _0x1b8a57;}else if(_0x1b8a57['extra']===_0x224b('0x63')){_0x1b8a57[_0x224b('0xa0')]=_0x475403[_0x224b('0x9b')]>=parseInt(_0x1065a1[_0x224b('0x104')])?'x':'i';}else{_0x1b8a57[_0x224b('0xa0')]=_0x475403[_0x224b('0x9b')]>=parseInt(_0x1065a1[_0x224b('0x104')])&&_0x475403[_0x224b('0x9b')]<=parseInt(_0x1065a1[_0x224b('0x102')])?'x':'i';}var _0xc54fdb=this[_0x224b('0x9d')][_0x224b('0x6e')](this,_0x1065a1[_0x224b('0xd1')]);if(!_0xc54fdb){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x1065a1,_0x224b('0xd2'));}this[_0x224b('0xe')]['setVariable'](_0xc54fdb,_0x475403);if(this[_0x224b('0xa3')](_0x1065a1[_0x224b('0x105')])){var _0x454a5e=parseInt(_0x1065a1[_0x224b('0x105')],0xa);var _0x3c9107=rs[_0x224b('0x106')]({'charset':'*','length':_0x454a5e});var _0x60cf23=_0x475403[_0x224b('0x9b')];if(_0x60cf23>0x0){if(_0x60cf23>_0x454a5e){this[_0x224b('0x36')]['sync'](this,_0x1065a1,_0x1065a1[_0x224b('0x107')]==='first'?_0x3c9107+_0x475403['substr'](_0x454a5e):_0x475403[_0x224b('0x108')](0x0,_0x60cf23-_0x454a5e)+_0x3c9107);}else{this['createSquareDetailsReport']['sync'](this,_0x1065a1,rs[_0x224b('0x106')]({'charset':'*','length':_0x60cf23}));}}else{this['createSquareDetailsReport'][_0x224b('0x6e')](this,_0x1065a1,'');}}else{this[_0x224b('0x36')][_0x224b('0x6e')](this,_0x1065a1,_0x475403);}return _0x1b8a57;};AGIVertices[_0x224b('0x14')][_0x224b('0x109')]=function(_0x4ade65){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x10a'),_0x4ade65[_0x224b('0x38')]));return this[_0x224b('0xd')](_0x4ade65);};AGIVertices[_0x224b('0x14')]['goal']=function(_0x34b7ee){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x10b'),_0x34b7ee[_0x224b('0x38')]));this['createSquareDetailsReport'][_0x224b('0x6e')](this,_0x34b7ee,_0x34b7ee[_0x224b('0x10c')]);return this[_0x224b('0xe')][_0x224b('0xb2')](util['format'](_0x224b('0x10d'),_0x34b7ee[_0x224b('0x10c')]));};AGIVertices[_0x224b('0x14')][_0x224b('0x10e')]=function(_0x45bb52){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x10f'),_0x45bb52[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x45bb52[_0x224b('0x81')])||!this['isConfigured'](_0x45bb52[_0x224b('0x87')])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x110'));}if(!this[_0x224b('0xa3')](_0x45bb52[_0x224b('0x59')])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0xb9'));}this[_0x224b('0xe')][_0x224b('0xb2')](util['format'](_0x224b('0x111'),_0x45bb52[_0x224b('0x59')]));var _0x28a70b=this[_0x224b('0x80')][_0x224b('0x6e')](this,_0x45bb52);if(_0x28a70b){this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')]('aws\x20Polly\x20%s\x20file\x20created',_0x28a70b));var _0x1f1bd3=this[_0x224b('0xe')][_0x224b('0xf0')](_0x28a70b);try{fs[_0x224b('0xf1')](_0x28a70b+_0x224b('0x112'));}catch(_0x5bc41f){logger['error'](_0x5bc41f);}return _0x1f1bd3;}return this['channel'][_0x224b('0x2b')](_0x45bb52,_0x224b('0x113'));};AGIVertices['prototype']['awslex']=function(_0x1d9653){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x114'),_0x1d9653[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x1d9653[_0x224b('0x81')])||!this[_0x224b('0xa3')](_0x1d9653[_0x224b('0x87')])){return this['channel'][_0x224b('0xb2')](_0x224b('0x110'));}if(!this[_0x224b('0xa3')](_0x1d9653[_0x224b('0x89')])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x115'));}if(!this[_0x224b('0xa3')](_0x1d9653[_0x224b('0x59')])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0xb9'));}this[_0x224b('0xe')][_0x224b('0xec')]=!![];this[_0x224b('0x36')](_0x1d9653);this[_0x224b('0x3f')](_0x1d9653[_0x224b('0x59')],'in');this[_0x224b('0xe')]['noop'](util[_0x224b('0x29')](_0x224b('0x116'),_0x1d9653[_0x224b('0x59')]));var _0x3e2a77=this['awsLex'][_0x224b('0x6e')](this,_0x1d9653);if(_0x3e2a77){for(var _0x56d855 in _0x3e2a77){if(_0x3e2a77[_0x224b('0x91')](_0x56d855)&&_['isString'](_0x3e2a77[_0x56d855])){this[_0x224b('0xe')][_0x224b('0xa2')](util['format'](_0x224b('0x117'),_0x56d855[_0x224b('0x68')]()),_0x3e2a77[_0x56d855]);}}if(_['isNil'](_0x3e2a77[_0x224b('0x118')])){return this['channel'][_0x224b('0xb2')](_0x224b('0x119'));}else{this[_0x224b('0x3f')](_0x3e2a77[_0x224b('0x118')],'out');return this[_0x224b('0xe')]['noop'](util['format'](_0x224b('0x11a'),_0x3e2a77[_0x224b('0x118')]));}}return this[_0x224b('0xe')]['error'](_0x1d9653,_0x224b('0x11b'));};AGIVertices[_0x224b('0x14')][_0x224b('0x11c')]=function(_0x27c029){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x11d'),_0x27c029[_0x224b('0x38')],_0x27c029[_0x224b('0x63')]));if(!this[_0x224b('0xa3')](_0x27c029['key'])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x11e'));}var _0x5bb4ac=_0x224b('0x11f');var _0x24f13c=util[_0x224b('0x29')](_0x224b('0x120'),FILES_PATH,rs[_0x224b('0x106')](0x4));var _0x6593e3=util[_0x224b('0x29')](_0x224b('0x99'),_0x24f13c,_0x5bb4ac);var _0x269530=!![];if(_0x27c029[_0x224b('0x121')]===_0x224b('0x122')){_0x269530=![];}var _0x3d64fd=this[_0x224b('0xe')][_0x224b('0x123')](_0x24f13c,_0x5bb4ac,_0x27c029[_0x224b('0x124')],_0x27c029['timeout'],undefined,_0x269530);if(_0x3d64fd[_0x224b('0xa0')]!==-0x1){this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x125'),_0x6593e3));var _0x4888b1=this[_0x224b('0x8a')][_0x224b('0x6e')](this,_0x27c029,_0x6593e3);if(_0x4888b1){for(var _0x388d8c in _0x4888b1){if(_0x4888b1[_0x224b('0x91')](_0x388d8c)){this[_0x224b('0xe')][_0x224b('0xa2')](util['format'](_0x224b('0x126'),_0x388d8c[_0x224b('0x68')]()),_0x4888b1[_0x388d8c]);}}return this['channel'][_0x224b('0xb2')](util['format'](_0x224b('0x127'),JSON[_0x224b('0x71')](_0x4888b1)));}}return _0x3d64fd;};AGIVertices[_0x224b('0x14')]['tildeasr']=function(_0x103c96){logger[_0x224b('0x2d')](util['format'](_0x224b('0x128'),_0x103c96[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x103c96['appid'])){return this[_0x224b('0xe')]['noop']('no\x20appid\x20configured');}if(!this[_0x224b('0xa3')](_0x103c96[_0x224b('0x8d')])){return this[_0x224b('0xe')]['noop'](_0x224b('0x129'));}var _0x5e414a=_0x224b('0x11f');var _0x3518c6=util[_0x224b('0x29')]('%s/recordings/%s',FILES_PATH,rs[_0x224b('0x106')](0x4));var _0x1f4955=util['format']('%s.%s',_0x3518c6,_0x5e414a);var _0x2b3e0d=!![];if(_0x103c96['beep']==='NOBEEP'){_0x2b3e0d=![];}var _0x48ce0d=this[_0x224b('0xe')][_0x224b('0x123')](_0x3518c6,_0x5e414a,_0x103c96[_0x224b('0x124')],_0x103c96['timeout'],undefined,_0x2b3e0d);if(_0x48ce0d[_0x224b('0xa0')]!==-0x1){this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x12a'),_0x1f4955));var _0x418f6b=this[_0x224b('0x8c')]['sync'](this,_0x103c96,_0x1f4955);if(_0x418f6b){for(var _0xe6572 in _0x418f6b){if(_0x418f6b[_0x224b('0x91')](_0xe6572)){this[_0x224b('0xe')]['setVariable'](util['format']('TILDE_ASR_%s',_0xe6572[_0x224b('0x68')]()),_0x418f6b[_0xe6572]);}}return this[_0x224b('0xe')][_0x224b('0xb2')](util['format'](_0x224b('0x12b'),JSON[_0x224b('0x71')](_0x418f6b)));}}return _0x48ce0d;};AGIVertices['prototype'][_0x224b('0x12c')]=function(_0x4d0cae){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x12d'),_0x4d0cae[_0x224b('0x38')]));return this[_0x224b('0xe')][_0x224b('0x12e')](_0x4d0cae[_0x224b('0x3b')],_0x4d0cae[_0x224b('0x12f')],_0x4d0cae[_0x224b('0x3c')]);};AGIVertices[_0x224b('0x14')][_0x224b('0x130')]=function(_0x20cbe3){logger[_0x224b('0x2d')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x20cbe3[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x20cbe3[_0x224b('0x131')])){return this['channel'][_0x224b('0x2b')](_0x20cbe3,_0x224b('0x132'));}try{var _0x69a451=eval(_0x20cbe3[_0x224b('0x131')])?_0x224b('0x133'):'false';this[_0x224b('0xe')]['noop'](util[_0x224b('0x29')](_0x224b('0x134'),_0x20cbe3[_0x224b('0x131')],_0x69a451));return{'code':0xc8,'result':_0x69a451};}catch(_0x236b2c){return{'code':0xc8,'result':_0x224b('0x135')};}};AGIVertices[_0x224b('0x14')]['gotoiftime']=function(_0x306f24){logger[_0x224b('0x2d')](util['format'](_0x224b('0x136'),_0x306f24[_0x224b('0x38')]));if(!this['isConfigured'](_0x306f24[_0x224b('0x137')])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x306f24,_0x224b('0x138'));}var _0x16d238=this['getIntervals'][_0x224b('0x6e')](this,_0x306f24[_0x224b('0x137')]);if(!_0x16d238){return this['channel'][_0x224b('0x2b')](_0x306f24,_0x224b('0x139'));}for(var _0x4d2d0f=0x0;_0x4d2d0f<_0x16d238[_0x224b('0x9b')];_0x4d2d0f+=0x1){var _0x430a2c=this['channel'][_0x224b('0x9d')](util[_0x224b('0x29')]('IFTIME(%s?true:false)',_0x16d238[_0x4d2d0f]));if(_0x430a2c['result']===-0x1){return _0x430a2c;}logger[_0x224b('0x2d')](util['format'](_0x224b('0x13a'),_0x16d238[_0x4d2d0f],_0x430a2c[_0x224b('0x9e')]));if(_0x430a2c[_0x224b('0x9e')]===_0x224b('0x133')){logger[_0x224b('0x2d')](util[_0x224b('0x29')]('IFTIME\x20%s\x20%s',_0x16d238[_0x4d2d0f],_0x224b('0x133')));this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')]('IFTIME\x20%s\x20%s',_0x16d238[_0x4d2d0f],_0x224b('0x133')));return{'code':0xc8,'result':_0x224b('0x133')};}else{logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x13a'),_0x16d238[_0x4d2d0f],_0x224b('0x135')));this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x13a'),_0x16d238[_0x4d2d0f],_0x224b('0x135')));}}return{'code':0xc8,'result':_0x224b('0x135')};};AGIVertices[_0x224b('0x14')][_0x224b('0x13b')]=function(_0x1d32c6){logger[_0x224b('0x2d')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x1d32c6['label']));return this['channel']['hangup']();};AGIVertices['prototype'][_0x224b('0x13c')]=function(_0x91155){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x13d'),_0x91155[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x91155[_0x224b('0x7b')])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x11e'));}var _0x3aae32='wav';var _0x4e6756=util['format'](_0x224b('0x120'),FILES_PATH,rs[_0x224b('0x106')](0x4));var _0x1ad32f=util[_0x224b('0x29')](_0x224b('0x99'),_0x4e6756,_0x3aae32);var _0x17ea5b=!![];if(_0x91155[_0x224b('0x121')]===_0x224b('0x122')){_0x17ea5b=![];}var _0x5a4611=this['channel']['recordFile'](_0x4e6756,_0x3aae32,_0x91155[_0x224b('0x124')],_0x91155[_0x224b('0x63')],undefined,_0x17ea5b);if(_0x5a4611['result']!==-0x1){this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x13e'),_0x1ad32f));var _0x5ab91f=this['ispeechASR']['sync'](this,_0x91155,_0x1ad32f);if(_0x5ab91f){for(var _0x1e7f17 in _0x5ab91f){if(_0x5ab91f[_0x224b('0x91')](_0x1e7f17)){this[_0x224b('0xe')][_0x224b('0xa2')](util[_0x224b('0x29')]('ISPEECH_ASR_%s',_0x1e7f17[_0x224b('0x68')]()),_0x5ab91f[_0x1e7f17]);}}return this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x13f'),JSON[_0x224b('0x71')](_0x5ab91f)));}}return _0x5a4611;};AGIVertices['prototype'][_0x224b('0x140')]=function(_0x29c9c0){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x141'),_0x29c9c0[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x29c9c0[_0x224b('0x7b')])){return this[_0x224b('0xe')][_0x224b('0xb2')]('no\x20key\x20configured');}if(!this[_0x224b('0xa3')](_0x29c9c0['text'])){return this[_0x224b('0xe')][_0x224b('0xb2')]('no\x20text\x20configured');}this[_0x224b('0xe')][_0x224b('0xb2')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x29c9c0[_0x224b('0x59')]));var _0xf01a91=this['ispeechTTS'][_0x224b('0x6e')](this,_0x29c9c0);if(_0xf01a91){this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x13e'),_0xf01a91));var _0xc2d294=this[_0x224b('0xe')][_0x224b('0xf0')](_0xf01a91,_0x29c9c0[_0x224b('0x124')]);try{fs[_0x224b('0xf1')](_0xf01a91+_0x224b('0x112'));}catch(_0x45ee85){logger[_0x224b('0x2b')](_0x45ee85);}return _0xc2d294;}return this[_0x224b('0xe')][_0x224b('0x2b')](_0x29c9c0,_0x224b('0x142'));};AGIVertices[_0x224b('0x14')][_0x224b('0x143')]=function(_0x4cb532){logger[_0x224b('0x2d')](util['format'](_0x224b('0x144'),_0x4cb532[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x4cb532['findBy'])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x4cb532,'no\x20find\x20by\x20configured');}logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x145'),this['channel'][_0x224b('0x4b')],_0x4cb532['findBy']));var _0x5f2185=this['agentLogin'][_0x224b('0x6e')](this,_0x4cb532[_0x224b('0x146')]);if(_0x5f2185){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x147'),this['channel']['callerid'],_0x4cb532[_0x224b('0x146')]));this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x147'),this[_0x224b('0xe')]['callerid'],_0x4cb532[_0x224b('0x146')]));return{'code':0xc8,'result':_0x224b('0x148')};}else{logger['info'](util[_0x224b('0x29')](_0x224b('0x149'),this['channel'][_0x224b('0x4b')],_0x4cb532[_0x224b('0x146')]));this[_0x224b('0xe')]['noop'](util[_0x224b('0x29')](_0x224b('0x149'),this[_0x224b('0xe')][_0x224b('0x4b')],_0x4cb532[_0x224b('0x146')]));return{'code':0xc8,'result':_0x224b('0x14a')};}};AGIVertices[_0x224b('0x14')]['logout']=function(_0x409fe1){logger[_0x224b('0x2d')](util['format'](_0x224b('0x14b'),_0x409fe1[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x409fe1[_0x224b('0x146')])){return this[_0x224b('0xe')]['error'](_0x409fe1,_0x224b('0x14c'));}logger[_0x224b('0x2d')](util[_0x224b('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x224b('0xe')][_0x224b('0x4b')],_0x409fe1[_0x224b('0x146')]));var _0x1ff13b=this[_0x224b('0x4e')][_0x224b('0x6e')](this,_0x409fe1[_0x224b('0x146')]);if(_0x1ff13b){logger[_0x224b('0x2d')](util[_0x224b('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x224b('0xe')][_0x224b('0x4b')],_0x409fe1[_0x224b('0x146')]));this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x147'),this[_0x224b('0xe')][_0x224b('0x4b')],_0x409fe1[_0x224b('0x146')]));return{'code':0xc8,'result':_0x224b('0x148')};}else{logger['info'](util[_0x224b('0x29')](_0x224b('0x149'),this[_0x224b('0xe')][_0x224b('0x4b')],_0x409fe1[_0x224b('0x146')]));this[_0x224b('0xe')][_0x224b('0xb2')](util['format'](_0x224b('0x149'),this[_0x224b('0xe')][_0x224b('0x4b')],_0x409fe1[_0x224b('0x146')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x224b('0x14')][_0x224b('0x14d')]=function(_0x2b8385){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x2b8385[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x2b8385['operation'])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x2b8385,_0x224b('0x14e'));}this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x14f'),_0x2b8385[_0x224b('0x150')]));var _0x10766c=eval(_0x2b8385[_0x224b('0x150')]);if(!this[_0x224b('0xa3')](_0x2b8385[_0x224b('0xd1')])){return this[_0x224b('0xe')][_0x224b('0xb2')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4ae122=this['getVariable'][_0x224b('0x6e')](this,_0x2b8385[_0x224b('0xd1')]);if(!_0x4ae122){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x2b8385,_0x224b('0xd2'));}if(_['isArray'](_0x10766c)){var _0xb5781=this;_0x10766c[_0x224b('0xd3')](function(_0x4f9705,_0x4cb11f){_0xb5781['channel'][_0x224b('0xa2')](util['format'](_0x224b('0x151'),_0x4ae122,_0x4cb11f),_0x4f9705);});return this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')]('variable\x20%s[key]\x20set',_0x4ae122));}else{return this[_0x224b('0xe')][_0x224b('0xa2')](_0x4ae122,_0x10766c);}};AGIVertices['prototype'][_0x224b('0x152')]=function(_0x46515d){logger[_0x224b('0x2d')](util[_0x224b('0x29')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x46515d[_0x224b('0x38')]));if(_0x46515d[_0x224b('0xa5')]===0x0){return this[_0x224b('0xa4')](_0x46515d);}_0x46515d['retry']-=0x1;if(!this[_0x224b('0xa3')](_0x46515d[_0x224b('0xfe')])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x46515d,_0x224b('0xfd'));}var _0x1f5ccd=this['getSound']['sync'](this,_0x46515d[_0x224b('0xfe')]);if(!_0x1f5ccd){return this['channel'][_0x224b('0x2b')](_0x46515d,_0x224b('0xff'));}var _0x4730cf=this[_0x224b('0xe')]['getData'](_0x1f5ccd,_0x46515d[_0x224b('0x153')],_0x46515d[_0x224b('0x154')]);var _0x26752f=_0x4730cf[_0x224b('0xa0')];if(_0x4730cf[_0x224b('0xa0')]===-0x1){this[_0x224b('0x36')][_0x224b('0x6e')](this,_0x46515d,'-1');return _0x4730cf;}else if(_0x4730cf[_0x224b('0x9e')]===_0x224b('0x63')){_0x4730cf['result']=_0x4730cf[_0x224b('0xa0')]['length']>0x0?_0x4730cf[_0x224b('0xa0')]:'t';}else if(_[_0x224b('0x41')](_0x4730cf[_0x224b('0xa0')])){_0x4730cf['result']='#';_0x26752f='#';}if(!this['isConfigured'](_0x46515d[_0x224b('0xd1')])){this['channel']['noop'](_0x224b('0x100'));}else{var _0x5ced07=this['getVariable'][_0x224b('0x6e')](this,_0x46515d[_0x224b('0xd1')]);if(!_0x5ced07){return this['channel']['error'](_0x46515d,_0x224b('0xd2'));}this[_0x224b('0xe')][_0x224b('0xa2')](_0x5ced07,_0x26752f);}this[_0x224b('0x36')][_0x224b('0x6e')](this,_0x46515d,_0x26752f);return _0x4730cf;};AGIVertices['prototype']['noop']=function(_0x142fd6){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x155'),_0x142fd6[_0x224b('0x38')]));return this[_0x224b('0xe')][_0x224b('0xb2')](_0x142fd6[_0x224b('0x156')]||_0x142fd6[_0x224b('0x38')]);};AGIVertices['prototype'][_0x224b('0x157')]=function(_0x18a799){logger['info'](util['format'](_0x224b('0x158'),_0x18a799[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x18a799[_0x224b('0x146')])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x18a799,_0x224b('0x14c'));}logger[_0x224b('0x2d')](util['format'](_0x224b('0x145'),this[_0x224b('0xe')][_0x224b('0x4b')],_0x18a799[_0x224b('0x146')]));var _0x52f277=this[_0x224b('0x47')]['sync'](this,_0x18a799[_0x224b('0x159')]);var _0x21b25a=this['agentPause']['sync'](this,_0x18a799[_0x224b('0x146')],_0x52f277);if(_0x21b25a){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x147'),this[_0x224b('0xe')][_0x224b('0x4b')],_0x18a799[_0x224b('0x146')]));this[_0x224b('0xe')][_0x224b('0xb2')](util['format'](_0x224b('0x147'),this[_0x224b('0xe')]['callerid'],_0x18a799[_0x224b('0x146')]));return{'code':0xc8,'result':_0x224b('0x148')};}else{logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x149'),this[_0x224b('0xe')]['callerid'],_0x18a799['findBy']));this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x147'),this[_0x224b('0xe')][_0x224b('0x4b')],_0x18a799[_0x224b('0x146')]));return{'code':0xc8,'result':_0x224b('0x14a')};}};AGIVertices[_0x224b('0x14')][_0x224b('0x15a')]=function(_0x1ff8b1){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x15b'),_0x1ff8b1['label']));if(!this[_0x224b('0xa3')](_0x1ff8b1[_0x224b('0xfe')])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x1ff8b1,_0x224b('0xfd'));}var _0x5b0f9c=this[_0x224b('0x1d')][_0x224b('0x6e')](this,_0x1ff8b1[_0x224b('0xfe')]);if(!_0x5b0f9c){return this['channel'][_0x224b('0x2b')](_0x1ff8b1,'no\x20file\x20audio\x20found');}var _0x35d873=this[_0x224b('0xe')][_0x224b('0xb4')]('PLAYBACK',[_0x5b0f9c,_0x1ff8b1[_0x224b('0xdd')]]);if(_0x35d873[_0x224b('0xa0')]===-0x1){return _0x35d873;}return this[_0x224b('0xe')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x224b('0x15c'),_0x5b0f9c));};AGIVertices[_0x224b('0x14')][_0x224b('0x15d')]=function(_0x132216){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x15e'),_0x132216['label']));if(!this[_0x224b('0xa3')](_0x132216[_0x224b('0x15f')])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x132216,_0x224b('0x160'));}var _0x10c0e7='';var _0x4cb85c=parseInt(_0x132216['queue_id'],0xa);if(isNaN(_0x4cb85c)){_0x10c0e7=_0x132216[_0x224b('0x15f')];}else{_0x10c0e7=this[_0x224b('0x161')][_0x224b('0x6e')](this,_0x132216[_0x224b('0x15f')]);if(!_0x10c0e7){return this['channel']['error'](_0x132216,'no\x20queue\x20found');}}var _0x4bd3d2='';if(this[_0x224b('0xa3')](_0x132216['file_id'])){var _0x1ebcf7=this['getSound'][_0x224b('0x6e')](this,_0x132216[_0x224b('0xfe')]);if(_0x1ebcf7){_0x4bd3d2=_0x1ebcf7;}}this[_0x224b('0x36')][_0x224b('0x6e')](this,_0x132216,_0x10c0e7);if(_0x132216['opts'][_0x224b('0x162')]('x')<0x0){_0x132216[_0x224b('0xdd')]+='x';}if(_0x132216[_0x224b('0xdd')][_0x224b('0x162')]('X')<0x0){_0x132216[_0x224b('0xdd')]+='X';}this['channel'][_0x224b('0xa2')]('XMCS-QUEUE',_0x10c0e7?_0x10c0e7[_0x224b('0x163')]():'');var _0x42f4f2=this['channel'][_0x224b('0xb4')](_0x224b('0x164'),[_0x10c0e7,_0x132216[_0x224b('0xdd')],_0x132216[_0x224b('0x61')],_0x4bd3d2,_0x132216['timeout'],_0x132216[_0x224b('0x8')],_0x132216[_0x224b('0x165')],_0x132216[_0x224b('0x166')],'',_0x132216[_0x224b('0x167')]]);if(_0x42f4f2[_0x224b('0xa0')]===-0x1){return _0x42f4f2;}return this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0xb5'),'QUEUE',_0x10c0e7));};AGIVertices[_0x224b('0x14')][_0x224b('0x168')]=function(_0x52c7af){logger[_0x224b('0x2d')](util['format'](_0x224b('0x169'),_0x52c7af[_0x224b('0x38')]));var _0x5e973e=_0x52c7af[_0x224b('0x16a')]||'wav';var _0x2438b1=util[_0x224b('0x29')](_0x224b('0x16b'),this[_0x224b('0xe')][_0x224b('0x37')],rs[_0x224b('0x106')](0x5));var _0x26a065=util['format'](_0x224b('0x16c'),FILES_PATH,_0x2438b1,_0x5e973e);var _0x2ebad7=util[_0x224b('0x29')](_0x224b('0x120'),FILES_PATH,_0x2438b1);this[_0x224b('0x3a')][_0x224b('0x6e')](this,_0x52c7af,_0x2438b1,_0x26a065);this['channel'][_0x224b('0xa2')](_0x224b('0x16d'),_0x2438b1);logger[_0x224b('0x2d')](_0x224b('0x16e'),_0x2ebad7,_0x5e973e,_0x52c7af[_0x224b('0x16f')],_0x52c7af[_0x224b('0x63')]);return this[_0x224b('0xe')][_0x224b('0x123')](_0x2ebad7,_0x5e973e,_0x52c7af['escape_digits'],_0x52c7af['timeout'],undefined,!![]);};AGIVertices['prototype'][_0x224b('0x170')]=function(_0x26e0b3){logger[_0x224b('0x2d')](util['format'](_0x224b('0x171'),_0x26e0b3[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x26e0b3[_0x224b('0x61')])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x172'));}var _0x79e3fd=this['restAPI'][_0x224b('0x6e')](this,_0x26e0b3);logger['info'](util['format'](_0x224b('0x173'),util['inspect'](_0x79e3fd,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x26e0b3[_0x224b('0xd1')])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x174'));}var _0x5a35fb=this['getVariable'][_0x224b('0x6e')](this,_0x26e0b3['variable_id']);if(!_0x5a35fb){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x26e0b3,_0x224b('0xd2'));}this[_0x224b('0xe')]['setVariable'](util[_0x224b('0x29')](_0x224b('0x175'),_0x5a35fb),_0x79e3fd['statusCode']?_0x79e3fd['statusCode']:'200');this[_0x224b('0xe')][_0x224b('0xa2')](util[_0x224b('0x29')]('%s_STATUS_MESSAGE',_0x5a35fb),_0x79e3fd[_0x224b('0x176')]?_0x79e3fd['statusMessage']:'OK');if(_0x79e3fd[_0x224b('0x72')]){try{this[_0x224b('0x97')](_0x79e3fd[_0x224b('0x72')],_0x5a35fb);}catch(_0x31bf82){logger[_0x224b('0x2b')](util['format'](_0x224b('0x177'),_0x5a35fb));}}return this['channel']['noop'](util[_0x224b('0x29')](_0x224b('0xd6'),_0x5a35fb));};AGIVertices['prototype'][_0x224b('0x178')]=function(_0x1f98ac){logger[_0x224b('0x2d')](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1f98ac[_0x224b('0x38')]));return this[_0x224b('0xe')]['sayDigits'](_0x1f98ac[_0x224b('0x179')][_0x224b('0x55')](/\s+/g,''),_0x1f98ac[_0x224b('0x16f')]);};AGIVertices[_0x224b('0x14')][_0x224b('0x17a')]=function(_0x1860af){logger[_0x224b('0x2d')](util[_0x224b('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x1860af[_0x224b('0x38')]));return this[_0x224b('0xe')]['sayNumber'](_0x1860af[_0x224b('0x64')][_0x224b('0x55')](/\s+/g,''),_0x1860af[_0x224b('0x16f')]);};AGIVertices['prototype'][_0x224b('0x17b')]=function(_0x50ca90){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x17c'),_0x50ca90['label']));return this[_0x224b('0xe')]['sayPhonetic'](_0x50ca90[_0x224b('0x59')],_0x50ca90[_0x224b('0x16f')]);};AGIVertices[_0x224b('0x14')][_0x224b('0x17d')]=function(_0x312c85){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x17e'),_0x312c85[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x312c85['account_id'])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x17f'));}var _0x1f1a2b=this['getMailAccount'][_0x224b('0x6e')](this,_0x312c85['account_id']);if(!_0x1f1a2b||!_0x1f1a2b[_0x224b('0x180')]){return this[_0x224b('0xe')]['error'](_0x312c85,_0x224b('0x181'));}var _0x50102b={'from':util['format'](_0x224b('0x182'),_0x1f1a2b[_0x224b('0x13')],_0x1f1a2b[_0x224b('0x183')]||_0x1f1a2b[_0x224b('0x180')][_0x224b('0x184')]),'to':_0x312c85['to']||'','cc':_0x312c85['cc']||'','bcc':_0x312c85[_0x224b('0x185')]||'','subject':_0x312c85[_0x224b('0x186')],'html':_0x312c85[_0x224b('0x59')],'text':_0x312c85[_0x224b('0x59')]};var _0xf7e58c={'tls':{'rejectUnauthorized':![]}};if(_0x1f1a2b[_0x224b('0x180')]['service']){_0xf7e58c[_0x224b('0x187')]=_0x1f1a2b[_0x224b('0x180')][_0x224b('0x187')];}else{_0xf7e58c[_0x224b('0x188')]=_0x1f1a2b[_0x224b('0x180')][_0x224b('0x188')];_0xf7e58c[_0x224b('0x189')]=_0x1f1a2b['Smtp'][_0x224b('0x189')];_0xf7e58c[_0x224b('0x18a')]=_0x1f1a2b[_0x224b('0x180')][_0x224b('0x18a')];}if(_0x1f1a2b['Smtp'][_0x224b('0x18b')]){_0xf7e58c[_0x224b('0x18c')]={'user':_0x1f1a2b[_0x224b('0x180')][_0x224b('0x184')],'pass':_0x1f1a2b[_0x224b('0x180')][_0x224b('0x18d')]};}if(this[_0x224b('0xa3')](_0x312c85['template_id'])){}logger[_0x224b('0x18e')]('sendMail\x20message',JSON['stringify'](_0x50102b));this[_0x224b('0x36')][_0x224b('0x6e')](this,_0x312c85,_0x312c85[_0x224b('0x18f')]);this[_0x224b('0xe')][_0x224b('0xb2')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x1f1a2b[_0x224b('0x13')]));this[_0x224b('0x22')][_0x224b('0x6e')](this,_0xf7e58c,_0x50102b);return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x190'));};AGIVertices[_0x224b('0x14')][_0x224b('0x191')]=function(_0x15b922){logger[_0x224b('0x2d')](util['format'](_0x224b('0x192'),_0x15b922[_0x224b('0x38')]));return this[_0x224b('0xe')]['noop'](_0x224b('0x193'));};AGIVertices[_0x224b('0x14')]['sendSMS']=function(_0x30a128){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x194'),_0x30a128[_0x224b('0x38')]));if(!this['isConfigured'](_0x30a128[_0x224b('0x195')])){return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x196'));}var _0x574788=this[_0x224b('0x33')][_0x224b('0x6e')](this,_0x30a128['sms_account_id']);if(!_0x574788){return this[_0x224b('0xe')]['error'](_0x30a128,_0x224b('0x197'));}var _0x41f186={'body':_0x30a128[_0x224b('0x198')],'phone':_0x30a128['to']||'','SmsAccountId':_0x574788['id']};logger['debug'](_0x224b('0x199'),JSON[_0x224b('0x71')](_0x41f186));this['createSquareDetailsReport'][_0x224b('0x6e')](this,_0x30a128,_0x30a128[_0x224b('0x195')]);this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x19a'),_0x574788[_0x224b('0x13')]));this['createSmsMessage'][_0x224b('0x6e')](this,_0x41f186);return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x19b'));};AGIVertices['prototype'][_0x224b('0x19c')]=function(_0x256803){logger[_0x224b('0x2d')](util[_0x224b('0x29')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x256803[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x256803[_0x224b('0xd1')])){return this['channel'][_0x224b('0x2b')](_0x256803,_0x224b('0x19d'));}var _0x2010db=this[_0x224b('0x9d')][_0x224b('0x6e')](this,_0x256803[_0x224b('0xd1')]);if(!_0x2010db){return this['channel'][_0x224b('0x2b')](_0x256803,'no\x20variable\x20found');}return this[_0x224b('0xe')][_0x224b('0xa2')](_0x2010db,_0x256803[_0x224b('0x19e')]);};AGIVertices[_0x224b('0x14')][_0x224b('0x19f')]=function(_0x56cca9){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x1a0'),_0x56cca9[_0x224b('0x38')]));this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x1a1'));if(_0x56cca9[_0x224b('0xa9')]===_0x224b('0x1a2')){this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x1a3'));return this['channel']['answer']();}return this[_0x224b('0xe')][_0x224b('0xb2')](_0x224b('0x1a4'));};AGIVertices['prototype'][_0x224b('0x1a5')]=function(_0x46f7c9){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x1a6'),_0x46f7c9[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0x46f7c9[_0x224b('0x1a7')])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x46f7c9,_0x224b('0x1a8'));}var _0x140c61=this[_0x224b('0x16')]['sync'](this,_0x46f7c9['project_id']);if(!this[_0x224b('0xa3')](_0x140c61)){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x46f7c9,util[_0x224b('0x29')](_0x224b('0x1a9'),_0x46f7c9['project_id']));}if(_0x140c61===this[_0x224b('0xe')][_0x224b('0x39')]){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x46f7c9,_0x224b('0x1aa'));}this['createSquareDetailsReport'][_0x224b('0x6e')](this,_0x46f7c9,_0x140c61);var _0x3b753b=this[_0x224b('0xe')]['exec'](_0x224b('0x1ab'),util[_0x224b('0x29')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x224b('0x8')][_0x224b('0x188')]||_0x224b('0x1ac'),_0x140c61,this['channel'][_0x224b('0x39')]));if(_0x3b753b[_0x224b('0xa0')]===-0x1){return _0x3b753b;}return this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')]('Executed\x20command\x20%s\x20%s',_0x224b('0x1ab'),_0x140c61));};AGIVertices[_0x224b('0x14')][_0x224b('0x1ad')]=function(_0x2508ae){logger['info'](util[_0x224b('0x29')](_0x224b('0x1ae'),_0x2508ae['label']));var _0xbc9a73=this['shellCommand'][_0x224b('0x6e')](this,_0x2508ae[_0x224b('0xa7')]);this[_0x224b('0x36')][_0x224b('0x6e')](this,_0x2508ae,_0x2508ae['command']);if(this[_0x224b('0xa3')](_0x2508ae[_0x224b('0xd1')])){var _0x1212a2=this[_0x224b('0x9d')][_0x224b('0x6e')](this,_0x2508ae[_0x224b('0xd1')]);if(_0x1212a2){this[_0x224b('0xe')][_0x224b('0xa2')](_0x1212a2,_0xbc9a73);return this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2508ae[_0x224b('0xa7')],_0x1212a2));}}return this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x2508ae[_0x224b('0xa7')]));};AGIVertices['prototype'][_0x224b('0x1af')]=function(_0x419414){logger['info'](util[_0x224b('0x29')](_0x224b('0x1b0'),_0x419414[_0x224b('0x38')]));if(!this['isConfigured'](_0x419414['apiKey'])){return this[_0x224b('0xe')][_0x224b('0xb2')]('no\x20apiKey\x20configured');}if(!this[_0x224b('0xa3')](_0x419414['text'])){return this['channel'][_0x224b('0xb2')](_0x224b('0xb9'));}this['channel'][_0x224b('0xb2')](util[_0x224b('0x29')](_0x224b('0x1b1'),_0x419414['text']));var _0x5c8cf6=this[_0x224b('0x56')][_0x224b('0x6e')](this,_0x419414);if(_0x5c8cf6){this[_0x224b('0xe')]['noop'](util['format'](_0x224b('0x1b2'),_0x5c8cf6));var _0x42dff6=this[_0x224b('0xe')][_0x224b('0xf0')](_0x5c8cf6);try{fs[_0x224b('0xf1')](_0x5c8cf6+_0x224b('0x112'));}catch(_0x5eb2e5){logger[_0x224b('0x2b')](_0x5eb2e5);}return _0x42dff6;}return this[_0x224b('0xe')][_0x224b('0x2b')](_0x419414,_0x224b('0x1b3'));};AGIVertices[_0x224b('0x14')]['tts']=function(_0x477414){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x1b4'),_0x477414['label']));if(!this[_0x224b('0xa3')](_0x477414[_0x224b('0x59')])){return this[_0x224b('0xe')]['noop'](_0x224b('0xb9'));}this[_0x224b('0xe')][_0x224b('0xb2')](util[_0x224b('0x29')]('Trying\x20Google\x20TTS\x20%s',_0x477414[_0x224b('0x59')]));var _0xf21ca=this['googleTTS'][_0x224b('0x6e')](this,_0x477414);if(_0xf21ca){this[_0x224b('0xe')][_0x224b('0xb2')](util['format'](_0x224b('0x1b5'),_0xf21ca));var _0x4a9e09=this['channel'][_0x224b('0xf0')](_0xf21ca);try{fs['unlink'](_0xf21ca+_0x224b('0x112'));}catch(_0x858275){logger[_0x224b('0x2b')](_0x858275);}return _0x4a9e09;}return this[_0x224b('0xe')][_0x224b('0x2b')](_0x477414,_0x224b('0x1b6'));};AGIVertices[_0x224b('0x14')][_0x224b('0x1b7')]=function(_0xbd4778){logger[_0x224b('0x2d')](util['format'](_0x224b('0x1b8'),_0xbd4778[_0x224b('0x38')]));if(!this[_0x224b('0xa3')](_0xbd4778[_0x224b('0x146')])){return this[_0x224b('0xe')]['error'](_0xbd4778,_0x224b('0x14c'));}logger[_0x224b('0x2d')](util['format'](_0x224b('0x145'),this[_0x224b('0xe')][_0x224b('0x4b')],_0xbd4778[_0x224b('0x146')]));var _0x8a40a9=this[_0x224b('0x4d')][_0x224b('0x6e')](this,_0xbd4778[_0x224b('0x146')]);if(_0x8a40a9){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x147'),this[_0x224b('0xe')][_0x224b('0x4b')],_0xbd4778[_0x224b('0x146')]));this[_0x224b('0xe')]['noop'](util['format'](_0x224b('0x147'),this['channel'][_0x224b('0x4b')],_0xbd4778[_0x224b('0x146')]));return{'code':0xc8,'result':_0x224b('0x148')};}else{logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x149'),this['channel'][_0x224b('0x4b')],_0xbd4778['findBy']));this['channel'][_0x224b('0xb2')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x224b('0xe')][_0x224b('0x4b')],_0xbd4778[_0x224b('0x146')]));return{'code':0xc8,'result':_0x224b('0x14a')};}};AGIVertices[_0x224b('0x14')][_0x224b('0x1b9')]=function(_0x3b1219){logger[_0x224b('0x2d')](util[_0x224b('0x29')](_0x224b('0x1ba'),_0x3b1219[_0x224b('0x38')]));var _0x5e2b5c=this['channel'][_0x224b('0xb4')](_0x224b('0x1bb'),[_0x3b1219[_0x224b('0x1bc')],_0x3b1219[_0x224b('0x76')]]);if(_0x5e2b5c['result']===-0x1){return _0x5e2b5c;}return this[_0x224b('0xe')]['noop'](util['format'](_0x224b('0xb5'),_0x224b('0x1bb'),_0x3b1219['mailbox']));};AGIVertices[_0x224b('0x14')][_0x224b('0x1bd')]=function(_0x432b89){logger[_0x224b('0x2d')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x432b89[_0x224b('0x38')]));if(!this['isConfigured'](_0x432b89[_0x224b('0xd1')])){return this[_0x224b('0xe')][_0x224b('0x2b')](_0x432b89,_0x224b('0x19d'));}var _0x3c5f84=this['getVariable'][_0x224b('0x6e')](this,_0x432b89[_0x224b('0xd1')]);if(!_0x3c5f84){return this[_0x224b('0xe')]['error'](_0x432b89,_0x224b('0xd2'));}var _0x2ecd0f=this[_0x224b('0xe')][_0x224b('0x9d')](_0x3c5f84);return{'code':0xc8,'result':_0x2ecd0f[_0x224b('0x9e')]?_0x2ecd0f[_0x224b('0x9e')]:'-'};};String[_0x224b('0x14')][_0x224b('0x9c')]=function(_0x54aaf3,_0x2642c9){return this[_0x224b('0x9a')](_0x54aaf3)[_0x224b('0x1be')](_0x2642c9);};module[_0x224b('0x1bf')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 71ea76b..d52339f 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 _0x84ab=['attended','destlinkedid','savePause','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','isUndefined','[%s][HANGUP:LINKEDID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]'];(function(_0x1fffa5,_0x2c6b12){var _0x3bb919=function(_0x568096){while(--_0x568096){_0x1fffa5['push'](_0x1fffa5['shift']());}};_0x3bb919(++_0x2c6b12);}(_0x84ab,0x12f));var _0xb84a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x84ab[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xb84a('0x0'));var _=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var ami=require(_0xb84a('0x3'));var logger=require(_0xb84a('0x4'))('acw');var RpcUser=require(_0xb84a('0x5'));var RpcVoiceAgentReport=require(_0xb84a('0x6'));function Acw(_0x47b8e3){this[_0xb84a('0x7')]=_0x47b8e3[_0xb84a('0x7')];this[_0xb84a('0x8')]=_0x47b8e3['agents'];this['timers']=_0x47b8e3['timers'];this[_0xb84a('0x9')]={};ami['on']('agentconnect',this[_0xb84a('0xa')][_0xb84a('0xb')](this));ami['on']('hanguprequest',this[_0xb84a('0xc')]['bind'](this));ami['on'](_0xb84a('0xd'),this[_0xb84a('0xe')][_0xb84a('0xb')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xb84a('0xf'),this[_0xb84a('0x10')][_0xb84a('0xb')](this));ami['on'](_0xb84a('0x11'),this[_0xb84a('0x12')]['bind'](this));ami['on'](_0xb84a('0x13'),this[_0xb84a('0x14')][_0xb84a('0xb')](this));}function getDiff(_0x3c161c){var _0x44b26b=moment()[_0xb84a('0x15')](0x0);var _0x12ccab=moment(_0x3c161c)[_0xb84a('0x15')](0x0);return _0x44b26b[_0xb84a('0x16')](_0x12ccab,_0xb84a('0x17'));}Acw[_0xb84a('0x18')][_0xb84a('0x19')]=function(_0x5716bd){try{var _0x11dd4d=this;var _0x4a691d=this[_0xb84a('0x9')][_0x5716bd][_0xb84a('0x1a')];var _0x1c7378=this[_0xb84a('0x9')][_0x5716bd][_0xb84a('0x1b')];var _0x34d82f=this[_0xb84a('0x7')][_0x1c7378];var _0x3f7437=![];var _0x11d5a0=_0xb84a('0x1c');if(_0x34d82f[_0xb84a('0x1d')]){if(_0x34d82f[_0xb84a('0x1e')]['name']){_0x3f7437=!![];_0x11d5a0=_0x34d82f[_0xb84a('0x1e')][_0xb84a('0x1f')];}}ami['Action']({'action':_0xb84a('0x20'),'interface':_0x4a691d,'paused':!![],'reason':_0x11d5a0})[_0xb84a('0x21')](function(_0x42c788){if(_0x11dd4d[_0xb84a('0x8')][_0x4a691d]){return RpcUser['getAgent'](_0x11dd4d['agents'][_0x4a691d]['id'])[_0xb84a('0x21')](function(_0x19097d){if(_0x19097d&&!_0x19097d[_0xb84a('0x22')]){logger[_0xb84a('0x23')](_0xb84a('0x24'),_0x5716bd,_0x4a691d,_0x1c7378);var _0x3b8fb2=_0x11dd4d[_0xb84a('0x9')][_0x5716bd][_0xb84a('0x25')]&&_0x11dd4d[_0xb84a('0x9')][_0x5716bd][_0xb84a('0x26')]?_0x11dd4d[_0xb84a('0x9')][_0x5716bd][_0xb84a('0x26')]:_0x5716bd;return RpcUser[_0xb84a('0x27')](_0x11dd4d[_0xb84a('0x8')][_0x4a691d],_0x11d5a0,_0x3b8fb2)[_0xb84a('0x21')](function(_0x3258a9){if(!_0x3f7437){_0x11dd4d[_0xb84a('0x28')][_0x4a691d]={};logger[_0xb84a('0x23')](_0xb84a('0x29'),_0x5716bd,_0x11dd4d[_0xb84a('0x7')][_0x1c7378][_0xb84a('0x2a')],_0x4a691d,_0x1c7378);_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x2b')]=setTimeout(_0x11dd4d[_0xb84a('0x2c')][_0xb84a('0xb')](_0x11dd4d,_0x4a691d),_0x11dd4d[_0xb84a('0x7')][_0x1c7378]['acwTimeout']*0x3e8);_0x11dd4d['timers'][_0x4a691d][_0xb84a('0x2d')]=moment()[_0xb84a('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x2f')]=_0x5716bd;_0x11dd4d['timers'][_0x4a691d]['queue']=_0x1c7378;_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x30')]=function(){var _0x49ba3d=getDiff(_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x2d')]);clearTimeout(_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x2b')]);_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x2b')]=![];RpcVoiceAgentReport[_0xb84a('0x31')]({'acwtime':_0x49ba3d},_0x11dd4d[_0xb84a('0x28')][_0x4a691d]['uniqueid'],_0x4a691d)[_0xb84a('0x21')](function(_0x5b794f){logger['info'](_0xb84a('0x32'),_0x5716bd,_0x49ba3d,_0x5b794f);})[_0xb84a('0x33')](function(_0x47a5b6){logger['error'](_0xb84a('0x34'),_0x5716bd,_0x47a5b6);});delete _0x11dd4d[_0xb84a('0x28')][_0x4a691d];};}});}else{logger[_0xb84a('0x23')](_0xb84a('0x35'),_0x5716bd,_0x4a691d,_0x1c7378);}});}})[_0xb84a('0x33')](function(_0x1d7ef1){logger[_0xb84a('0x36')](_0xb84a('0x29'),_0x5716bd,_0x11dd4d['voiceQueues'][_0x1c7378][_0xb84a('0x2a')],_0x4a691d,_0x1c7378);})[_0xb84a('0x37')](function(){delete _0x11dd4d[_0xb84a('0x9')][_0x5716bd];});}catch(_0xf894a6){logger[_0xb84a('0x36')](_0xb84a('0x38'),_0xf894a6[_0xb84a('0x39')]);}};Acw['prototype'][_0xb84a('0x2c')]=function(_0x56d783){try{var _0x1a3115=this;if(_0x1a3115[_0xb84a('0x28')][_0x56d783]){_0x1a3115[_0xb84a('0x28')][_0x56d783]['timer']=![];var _0x4af084=_0x1a3115[_0xb84a('0x28')][_0x56d783][_0xb84a('0x2f')];var _0x4a3737=_0x1a3115[_0xb84a('0x28')][_0x56d783][_0xb84a('0x1b')];var _0x4cb5d4=_0x1a3115[_0xb84a('0x7')][_0x4a3737][_0xb84a('0x2a')];logger['info'](_0xb84a('0x3a'),_0x56d783);RpcUser[_0xb84a('0x3b')](this[_0xb84a('0x8')][_0x56d783]);RpcVoiceAgentReport[_0xb84a('0x31')]({'acwtime':_0x4cb5d4,'agentacw':!![]},_0x4af084,_0x56d783)['then'](function(_0x57a1a8){logger['info'](_0xb84a('0x32'),_0x4af084,_0x4cb5d4,_0x57a1a8);})[_0xb84a('0x33')](function(_0x43a071){logger[_0xb84a('0x36')]('[%s][UPDATE][ERRORS:%s]',_0x4af084,_0x43a071);});}else{logger[_0xb84a('0x36')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x56d783);if(_0x1a3115[_0xb84a('0x28')]){logger['info']('[ACW][TIMERS]',JSON['stringify'](_0x1a3115[_0xb84a('0x28')]));}}}catch(_0x22791f){logger[_0xb84a('0x36')](_0xb84a('0x3c'),_0x22791f['message']);}};Acw[_0xb84a('0x18')][_0xb84a('0xa')]=function(_0x3908c3){try{if(this[_0xb84a('0x7')][_0x3908c3['queue']]&&(this['voiceQueues'][_0x3908c3[_0xb84a('0x1b')]][_0xb84a('0x3d')]||this['voiceQueues'][_0x3908c3[_0xb84a('0x1b')]][_0xb84a('0x1d')])){if(this[_0xb84a('0x8')][_0x3908c3[_0xb84a('0x1a')]]){this[_0xb84a('0x9')][_0x3908c3[_0xb84a('0x2f')]]={'queue':_0x3908c3[_0xb84a('0x1b')],'interface':_0x3908c3[_0xb84a('0x1a')],'destlinkedid':_0x3908c3[_0xb84a('0x26')]};}}}catch(_0xcd1e3b){logger[_0xb84a('0x36')](_0xb84a('0x3e'),_0xcd1e3b[_0xb84a('0x39')]);}};Acw[_0xb84a('0x18')][_0xb84a('0x14')]=function(_0x4ad7d0){try{if(this[_0xb84a('0x7')][_0x4ad7d0[_0xb84a('0x1b')]]&&(this[_0xb84a('0x7')][_0x4ad7d0[_0xb84a('0x1b')]][_0xb84a('0x3d')]||this[_0xb84a('0x7')][_0x4ad7d0['queue']][_0xb84a('0x1d')])){if(this['agents'][_0x4ad7d0[_0xb84a('0x1a')]]){this[_0xb84a('0x9')][_0x4ad7d0[_0xb84a('0x2f')]]={'queue':_0x4ad7d0[_0xb84a('0x1b')],'interface':_0x4ad7d0['interface']};}}}catch(_0x21ef72){logger[_0xb84a('0x36')](_0xb84a('0x3f'),_0x21ef72['message']);}};Acw['prototype'][_0xb84a('0xc')]=function(_0x10b0cc){try{if(this[_0xb84a('0x9')][_0x10b0cc['uniqueid']]&&_['isUndefined'](this['channels'][_0x10b0cc[_0xb84a('0x2f')]][_0xb84a('0x25')])){logger[_0xb84a('0x23')](_0xb84a('0x40'),_0x10b0cc[_0xb84a('0x2f')]);this['startAcw'](_0x10b0cc['uniqueid']);}else if(this['channels'][_0x10b0cc['linkedid']]&&_[_0xb84a('0x41')](this[_0xb84a('0x9')][_0x10b0cc['linkedid']][_0xb84a('0x25')])){logger[_0xb84a('0x23')](_0xb84a('0x42'),_0x10b0cc[_0xb84a('0x43')]);this[_0xb84a('0x19')](_0x10b0cc[_0xb84a('0x43')]);}}catch(_0x5a07d2){logger['error'](_0xb84a('0x44'),_0x5a07d2['message']);}};Acw[_0xb84a('0x18')]['syncHangup']=function(_0x575908){try{if(this['channels'][_0x575908[_0xb84a('0x2f')]]&&this[_0xb84a('0x9')][_0x575908[_0xb84a('0x2f')]][_0xb84a('0x25')]){logger[_0xb84a('0x23')](_0xb84a('0x45'),_0x575908[_0xb84a('0x2f')]);this[_0xb84a('0x19')](_0x575908['uniqueid']);}else if(this['channels'][_0x575908['linkedid']]&&this[_0xb84a('0x9')][_0x575908[_0xb84a('0x43')]]['attended']){logger[_0xb84a('0x23')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x575908['linkedid']);this['startAcw'](_0x575908[_0xb84a('0x43')]);}}catch(_0x172076){logger[_0xb84a('0x36')]('[ACW][syncHangup]\x20%s',_0x172076[_0xb84a('0x39')]);}};Acw[_0xb84a('0x18')][_0xb84a('0x10')]=function(_0x505994){try{if(!_[_0xb84a('0x46')](this['channels'][_0x505994['transfereeuniqueid']])){this[_0xb84a('0x19')](_0x505994['transfereeuniqueid']);if(this[_0xb84a('0x9')][_0x505994['secondtransfereruniqueid']]){this[_0xb84a('0x9')][_0x505994[_0xb84a('0x47')]][_0xb84a('0x25')]=!![];this[_0xb84a('0x9')][_0x505994['transfertargetuniqueid']]=this['channels'][_0x505994['secondtransfereruniqueid']];delete this[_0xb84a('0x9')][_0x505994[_0xb84a('0x47')]];}}else if(!_['isNil'](this['channels'][_0x505994[_0xb84a('0x48')]])){this[_0xb84a('0x19')](_0x505994[_0xb84a('0x48')]);if(this['channels'][_0x505994[_0xb84a('0x49')]]){this[_0xb84a('0x9')][_0x505994['origtransfereruniqueid']][_0xb84a('0x25')]=!![];this[_0xb84a('0x9')][_0x505994[_0xb84a('0x4a')]]=this[_0xb84a('0x9')][_0x505994[_0xb84a('0x49')]];delete this[_0xb84a('0x9')][_0x505994[_0xb84a('0x49')]];}}}catch(_0x47c27f){logger[_0xb84a('0x36')](_0xb84a('0x4b'),_0x47c27f['message']);}};Acw[_0xb84a('0x18')][_0xb84a('0x12')]=function(_0x34ac0f){try{if(this[_0xb84a('0x9')][_0x34ac0f[_0xb84a('0x4c')]]){logger[_0xb84a('0x23')](_0xb84a('0x4d'),JSON[_0xb84a('0x4e')](_0x34ac0f[_0xb84a('0x4c')]));this['startAcw'](_0x34ac0f[_0xb84a('0x4c')]);}else if(this['channels'][_0x34ac0f['transfererlinkedid']]){logger[_0xb84a('0x23')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xb84a('0x4e')](_0x34ac0f['transfererlinkedid']));this[_0xb84a('0x19')](_0x34ac0f[_0xb84a('0x4f')]);}}catch(_0x4c7d56){logger[_0xb84a('0x36')](_0xb84a('0x50'),_0x4c7d56[_0xb84a('0x39')]);}};Acw[_0xb84a('0x18')][_0xb84a('0x51')]=function(_0x192c9a){try{if(this[_0xb84a('0x7')][_0x192c9a['queue']]&&this[_0xb84a('0x7')][_0x192c9a['queue']]['autopause']===_0xb84a('0x52')){if(this[_0xb84a('0x8')][_0x192c9a[_0xb84a('0x1a')]]){logger[_0xb84a('0x23')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x192c9a['uniqueid'],_0x192c9a[_0xb84a('0x1a')],_0x192c9a[_0xb84a('0x1b')]);return RpcUser[_0xb84a('0x27')](this[_0xb84a('0x8')][_0x192c9a['interface']],_0xb84a('0x53'),_0x192c9a['uniqueid']);}}}catch(_0x1eec1f){logger['error'](_0xb84a('0x54'),_0x1eec1f['message']);}};module['exports']=Acw; \ No newline at end of file +var _0x0e85=['[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','queue','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[ACW][START]\x20%s','prototype','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','message','acw','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','linkedid','isUndefined','attended','[%s][HANGUP:LINKEDID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','transfereeuniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','milliseconds','diff','seconds','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','then','voicePause','info','destlinkedid','savePause'];(function(_0x51553b,_0x568b17){var _0xddba53=function(_0x88d101){while(--_0x88d101){_0x51553b['push'](_0x51553b['shift']());}};_0xddba53(++_0x568b17);}(_0x0e85,0x7c));var _0x50e8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0e85[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x50e8('0x0'));var _=require(_0x50e8('0x1'));var moment=require('moment');var ami=require(_0x50e8('0x2'));var logger=require(_0x50e8('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x236cf3){this['voiceQueues']=_0x236cf3[_0x50e8('0x4')];this[_0x50e8('0x5')]=_0x236cf3[_0x50e8('0x5')];this[_0x50e8('0x6')]=_0x236cf3['timers'];this[_0x50e8('0x7')]={};ami['on'](_0x50e8('0x8'),this[_0x50e8('0x9')][_0x50e8('0xa')](this));ami['on'](_0x50e8('0xb'),this[_0x50e8('0xc')]['bind'](this));ami['on'](_0x50e8('0xd'),this[_0x50e8('0xe')][_0x50e8('0xa')](this));ami['on'](_0x50e8('0xf'),this[_0x50e8('0x10')][_0x50e8('0xa')](this));ami['on'](_0x50e8('0x11'),this[_0x50e8('0x12')]['bind'](this));ami['on']('blindtransfer',this[_0x50e8('0x13')][_0x50e8('0xa')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x50e8('0xa')](this));}function getDiff(_0x2abda1){var _0x1a4c85=moment()[_0x50e8('0x14')](0x0);var _0x54efd3=moment(_0x2abda1)[_0x50e8('0x14')](0x0);return _0x1a4c85[_0x50e8('0x15')](_0x54efd3,_0x50e8('0x16'));}Acw['prototype']['startAcw']=function(_0x30a872){try{var _0xf02b48=this;var _0x40c184=this[_0x50e8('0x7')][_0x30a872][_0x50e8('0x17')];var _0x1f0338=this['channels'][_0x30a872]['queue'];var _0x441f25=this[_0x50e8('0x4')][_0x1f0338];var _0x40d060=![];var _0x45ce11=_0x50e8('0x18');if(_0x441f25[_0x50e8('0x19')]){if(_0x441f25[_0x50e8('0x1a')]['name']){_0x40d060=!![];_0x45ce11=_0x441f25[_0x50e8('0x1a')]['name'];}}ami[_0x50e8('0x1b')]({'action':_0x50e8('0x1c'),'interface':_0x40c184,'paused':!![],'reason':_0x45ce11})[_0x50e8('0x1d')](function(_0x20f835){if(_0xf02b48[_0x50e8('0x5')][_0x40c184]){return RpcUser['getAgent'](_0xf02b48[_0x50e8('0x5')][_0x40c184]['id'])[_0x50e8('0x1d')](function(_0x58110d){if(_0x58110d&&!_0x58110d[_0x50e8('0x1e')]){logger[_0x50e8('0x1f')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x30a872,_0x40c184,_0x1f0338);var _0x1ce7fc=_0xf02b48[_0x50e8('0x7')][_0x30a872]['attended']&&_0xf02b48['channels'][_0x30a872]['destlinkedid']?_0xf02b48[_0x50e8('0x7')][_0x30a872][_0x50e8('0x20')]:_0x30a872;return RpcUser[_0x50e8('0x21')](_0xf02b48[_0x50e8('0x5')][_0x40c184],_0x45ce11,_0x1ce7fc)[_0x50e8('0x1d')](function(_0x13b6e9){if(!_0x40d060){_0xf02b48['timers'][_0x40c184]={};logger[_0x50e8('0x1f')](_0x50e8('0x22'),_0x30a872,_0xf02b48['voiceQueues'][_0x1f0338][_0x50e8('0x23')],_0x40c184,_0x1f0338);_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x24')]=setTimeout(_0xf02b48[_0x50e8('0x25')]['bind'](_0xf02b48,_0x40c184),_0xf02b48[_0x50e8('0x4')][_0x1f0338]['acwTimeout']*0x3e8);_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x26')]=moment()[_0x50e8('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x28')]=_0x30a872;_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x29')]=_0x1f0338;_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x2a')]=function(){var _0x2c6fb3=getDiff(_0xf02b48['timers'][_0x40c184][_0x50e8('0x26')]);clearTimeout(_0xf02b48[_0x50e8('0x6')][_0x40c184]['timer']);_0xf02b48['timers'][_0x40c184][_0x50e8('0x24')]=![];RpcVoiceAgentReport[_0x50e8('0x2b')]({'acwtime':_0x2c6fb3},_0xf02b48[_0x50e8('0x6')][_0x40c184]['uniqueid'],_0x40c184)['then'](function(_0x3e58a9){logger[_0x50e8('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x30a872,_0x2c6fb3,_0x3e58a9);})[_0x50e8('0x2c')](function(_0x17c6a5){logger[_0x50e8('0x2d')](_0x50e8('0x2e'),_0x30a872,_0x17c6a5);});delete _0xf02b48['timers'][_0x40c184];};}});}else{logger[_0x50e8('0x1f')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x30a872,_0x40c184,_0x1f0338);}});}})[_0x50e8('0x2c')](function(_0x33fc5b){logger[_0x50e8('0x2d')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x30a872,_0xf02b48[_0x50e8('0x4')][_0x1f0338][_0x50e8('0x23')],_0x40c184,_0x1f0338);})['finally'](function(){delete _0xf02b48[_0x50e8('0x7')][_0x30a872];});}catch(_0x1c2fdb){logger[_0x50e8('0x2d')](_0x50e8('0x2f'),_0x1c2fdb['message']);}};Acw[_0x50e8('0x30')][_0x50e8('0x25')]=function(_0x24d3ea){try{var _0x4e2a37=this;if(_0x4e2a37['timers'][_0x24d3ea]){_0x4e2a37[_0x50e8('0x6')][_0x24d3ea][_0x50e8('0x24')]=![];var _0x3f01ee=_0x4e2a37['timers'][_0x24d3ea]['uniqueid'];var _0x5dff99=_0x4e2a37[_0x50e8('0x6')][_0x24d3ea][_0x50e8('0x29')];var _0x2cbee3=_0x4e2a37[_0x50e8('0x4')][_0x5dff99][_0x50e8('0x23')];logger[_0x50e8('0x1f')](_0x50e8('0x31'),_0x24d3ea);RpcUser[_0x50e8('0x32')](this[_0x50e8('0x5')][_0x24d3ea]);RpcVoiceAgentReport[_0x50e8('0x2b')]({'acwtime':_0x2cbee3,'agentacw':!![]},_0x3f01ee,_0x24d3ea)['then'](function(_0x3371a4){logger[_0x50e8('0x1f')](_0x50e8('0x33'),_0x3f01ee,_0x2cbee3,_0x3371a4);})[_0x50e8('0x2c')](function(_0x5dbbe1){logger[_0x50e8('0x2d')](_0x50e8('0x2e'),_0x3f01ee,_0x5dbbe1);});}else{logger[_0x50e8('0x2d')](_0x50e8('0x34'),_0x24d3ea);if(_0x4e2a37[_0x50e8('0x6')]){logger['info']('[ACW][TIMERS]',JSON[_0x50e8('0x35')](_0x4e2a37[_0x50e8('0x6')]));}}}catch(_0x53705e){logger[_0x50e8('0x2d')](_0x50e8('0x36'),_0x53705e[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0x9')]=function(_0x313e7b){try{if(this[_0x50e8('0x4')][_0x313e7b[_0x50e8('0x29')]]&&(this['voiceQueues'][_0x313e7b[_0x50e8('0x29')]][_0x50e8('0x38')]||this[_0x50e8('0x4')][_0x313e7b[_0x50e8('0x29')]]['mandatoryDisposition'])){if(this[_0x50e8('0x5')][_0x313e7b[_0x50e8('0x17')]]){this[_0x50e8('0x7')][_0x313e7b[_0x50e8('0x28')]]={'queue':_0x313e7b['queue'],'interface':_0x313e7b[_0x50e8('0x17')],'destlinkedid':_0x313e7b['destlinkedid']};}}}catch(_0x4a2619){logger['error'](_0x50e8('0x39'),_0x4a2619[_0x50e8('0x37')]);}};Acw['prototype'][_0x50e8('0x3a')]=function(_0x2007c4){try{if(this[_0x50e8('0x4')][_0x2007c4[_0x50e8('0x29')]]&&(this[_0x50e8('0x4')][_0x2007c4[_0x50e8('0x29')]]['acw']||this[_0x50e8('0x4')][_0x2007c4['queue']][_0x50e8('0x19')])){if(this[_0x50e8('0x5')][_0x2007c4['interface']]){this[_0x50e8('0x7')][_0x2007c4['uniqueid']]={'queue':_0x2007c4[_0x50e8('0x29')],'interface':_0x2007c4[_0x50e8('0x17')]};}}}catch(_0x2e55ed){logger[_0x50e8('0x2d')](_0x50e8('0x3b'),_0x2e55ed[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0xc')]=function(_0x141bd4){try{if(this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x28')]]&&_['isUndefined'](this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x28')]]['attended'])){logger[_0x50e8('0x1f')]('[%s][HANGUP:UNIQUEID]',_0x141bd4[_0x50e8('0x28')]);this['startAcw'](_0x141bd4[_0x50e8('0x28')]);}else if(this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x3c')]]&&_[_0x50e8('0x3d')](this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x3c')]][_0x50e8('0x3e')])){logger['info'](_0x50e8('0x3f'),_0x141bd4[_0x50e8('0x3c')]);this[_0x50e8('0x40')](_0x141bd4[_0x50e8('0x3c')]);}}catch(_0x3303f5){logger[_0x50e8('0x2d')]('[ACW][syncHangupRequest]\x20%s',_0x3303f5[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0xe')]=function(_0x27c80a){try{if(this['channels'][_0x27c80a[_0x50e8('0x28')]]&&this[_0x50e8('0x7')][_0x27c80a[_0x50e8('0x28')]][_0x50e8('0x3e')]){logger[_0x50e8('0x1f')](_0x50e8('0x41'),_0x27c80a[_0x50e8('0x28')]);this['startAcw'](_0x27c80a['uniqueid']);}else if(this['channels'][_0x27c80a[_0x50e8('0x3c')]]&&this[_0x50e8('0x7')][_0x27c80a[_0x50e8('0x3c')]][_0x50e8('0x3e')]){logger[_0x50e8('0x1f')](_0x50e8('0x42'),_0x27c80a['linkedid']);this[_0x50e8('0x40')](_0x27c80a[_0x50e8('0x3c')]);}}catch(_0x460c8e){logger[_0x50e8('0x2d')]('[ACW][syncHangup]\x20%s',_0x460c8e[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0x12')]=function(_0x1cc5ba){try{if(!_[_0x50e8('0x43')](this[_0x50e8('0x7')][_0x1cc5ba['transfereeuniqueid']])){this[_0x50e8('0x40')](_0x1cc5ba['transfereeuniqueid']);if(this['channels'][_0x1cc5ba['secondtransfereruniqueid']]){this[_0x50e8('0x7')][_0x1cc5ba['secondtransfereruniqueid']][_0x50e8('0x3e')]=!![];this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x44')]]=this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x45')]];delete this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x45')]];}}else if(!_['isNil'](this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x44')]])){this[_0x50e8('0x40')](_0x1cc5ba['transfertargetuniqueid']);if(this['channels'][_0x1cc5ba['origtransfereruniqueid']]){this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x46')]][_0x50e8('0x3e')]=!![];this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x47')]]=this[_0x50e8('0x7')][_0x1cc5ba['origtransfereruniqueid']];delete this[_0x50e8('0x7')][_0x1cc5ba['origtransfereruniqueid']];}}}catch(_0x255b48){logger[_0x50e8('0x2d')]('[ACW][syncAttendedTransfer]\x20%s',_0x255b48['message']);}};Acw['prototype'][_0x50e8('0x13')]=function(_0x3588f0){try{if(this['channels'][_0x3588f0[_0x50e8('0x48')]]){logger[_0x50e8('0x1f')](_0x50e8('0x49'),JSON[_0x50e8('0x35')](_0x3588f0[_0x50e8('0x48')]));this['startAcw'](_0x3588f0[_0x50e8('0x48')]);}else if(this[_0x50e8('0x7')][_0x3588f0[_0x50e8('0x4a')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x50e8('0x35')](_0x3588f0[_0x50e8('0x4a')]));this[_0x50e8('0x40')](_0x3588f0[_0x50e8('0x4a')]);}}catch(_0x2b59f5){logger[_0x50e8('0x2d')]('[ACW][syncBlindTransfer]\x20%s',_0x2b59f5['message']);}};Acw[_0x50e8('0x30')]['syncAgentRingNoAnswer']=function(_0x1fc530){try{if(this[_0x50e8('0x4')][_0x1fc530['queue']]&&this[_0x50e8('0x4')][_0x1fc530['queue']]['autopause']==='all'){if(this[_0x50e8('0x5')][_0x1fc530[_0x50e8('0x17')]]){logger[_0x50e8('0x1f')](_0x50e8('0x4b'),_0x1fc530['uniqueid'],_0x1fc530['interface'],_0x1fc530[_0x50e8('0x29')]);return RpcUser[_0x50e8('0x21')](this[_0x50e8('0x5')][_0x1fc530[_0x50e8('0x17')]],_0x50e8('0x4c'),_0x1fc530[_0x50e8('0x28')]);}}}catch(_0x42e1dd){logger[_0x50e8('0x2d')](_0x50e8('0x4d'),_0x42e1dd[_0x50e8('0x37')]);}};module[_0x50e8('0x4e')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 2de20f9..f45281b 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 _0xa25e=['Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionDeviceStateList','catch','log','close','exports','asterisk-manager','util','lodash','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected'];(function(_0x12ac6e,_0x49267c){var _0x385ebb=function(_0xf3f80d){while(--_0xf3f80d){_0x12ac6e['push'](_0x12ac6e['shift']());}};_0x385ebb(++_0x49267c);}(_0xa25e,0x6b));var _0xea25=function(_0x26489e,_0x17fca8){_0x26489e=_0x26489e-0x0;var _0x41b00d=_0xa25e[_0x26489e];return _0x41b00d;};'use strict';var Manager=require(_0xea25('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require(_0xea25('0x1'));var _=require(_0xea25('0x2'));var logger=require(_0xea25('0x3'))(_0xea25('0x4'));var config=require(_0xea25('0x5'));var ami=new Manager(config[_0xea25('0x6')][_0xea25('0x7')],config[_0xea25('0x6')]['ip'],config['asterisk']['username'],config['asterisk'][_0xea25('0x8')],!![]);ami[_0xea25('0x9')]();ami[_0xea25('0xa')]=BPromise[_0xea25('0xb')](ami['action']);function error(_0x397dc5){logger[_0xea25('0xc')](util[_0xea25('0xd')](_0xea25('0xe'),config[_0xea25('0x6')][_0xea25('0xf')],config[_0xea25('0x6')]['ip'],config[_0xea25('0x6')][_0xea25('0x7')],util[_0xea25('0x10')](_0x397dc5,![],null)));}function close(){logger[_0xea25('0xc')](util[_0xea25('0xd')](_0xea25('0x11'),config[_0xea25('0x6')]['username'],config['asterisk']['ip'],config[_0xea25('0x6')][_0xea25('0x7')]));}ami[_0xea25('0x12')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xea25('0xa')]({'action':_0xea25('0x13')});};};ami[_0xea25('0x14')]=function(){return function(){return ami[_0xea25('0xa')]({'action':'sippeerstatus'});};};ami[_0xea25('0x15')]=function(){return function(){return ami['Action']({'action':_0xea25('0x16')});};};ami[_0xea25('0x17')]=function(){return function(){return ami[_0xea25('0xa')]({'action':_0xea25('0x18')});};};function connect(_0x18d35d){logger[_0xea25('0x19')](util[_0xea25('0xd')](_0xea25('0x1a'),config[_0xea25('0x6')][_0xea25('0xf')],config[_0xea25('0x6')]['ip'],config[_0xea25('0x6')][_0xea25('0x7')]));ami[_0xea25('0x1b')](_0xea25('0xc'),error);ami[_0xea25('0x1b')]('close',close);}ami['on'](_0xea25('0x1c'),connect);ami['on'](_0xea25('0x1d'),function(_0x4e09cc){logger[_0xea25('0x19')](util['format'](_0xea25('0x1e'),config[_0xea25('0x6')][_0xea25('0xf')],config[_0xea25('0x6')]['ip'],config[_0xea25('0x6')][_0xea25('0x7')],util[_0xea25('0x10')](_0x4e09cc,![],null)));});ami['on'](_0xea25('0x1f'),function(_0x505450){logger['info'](util[_0xea25('0xd')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config['asterisk'][_0xea25('0xf')],config[_0xea25('0x6')]['ip'],config[_0xea25('0x6')][_0xea25('0x7')]));return BPromise[_0xea25('0x20')]()[_0xea25('0x21')](ami[_0xea25('0x12')]())[_0xea25('0x21')](ami[_0xea25('0x22')]())['then'](ami[_0xea25('0x14')]())[_0xea25('0x21')](ami[_0xea25('0x15')]())[_0xea25('0x21')](ami[_0xea25('0x17')]())[_0xea25('0x23')](function(_0x2c3d47){console[_0xea25('0x24')](_0x2c3d47);});});ami['once'](_0xea25('0xc'),error);ami[_0xea25('0x1b')](_0xea25('0x25'),close);module[_0xea25('0x26')]=ami; \ No newline at end of file +var _0xdf9f=['../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','actionQueueSummary','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','then','actionCoreShowChannels','log','exports','moment','util'];(function(_0x487f78,_0x4cb9db){var _0x1283ac=function(_0x5dc557){while(--_0x5dc557){_0x487f78['push'](_0x487f78['shift']());}};_0x1283ac(++_0x4cb9db);}(_0xdf9f,0xd6));var _0xfdf9=function(_0x4b2cfb,_0x5293c3){_0x4b2cfb=_0x4b2cfb-0x0;var _0x466f9f=_0xdf9f[_0x4b2cfb];return _0x466f9f;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require(_0xfdf9('0x0'));var util=require(_0xfdf9('0x1'));var _=require('lodash');var logger=require(_0xfdf9('0x2'))(_0xfdf9('0x3'));var config=require(_0xfdf9('0x4'));var ami=new Manager(config[_0xfdf9('0x5')][_0xfdf9('0x6')],config[_0xfdf9('0x5')]['ip'],config[_0xfdf9('0x5')][_0xfdf9('0x7')],config[_0xfdf9('0x5')][_0xfdf9('0x8')],!![]);ami[_0xfdf9('0x9')]();ami[_0xfdf9('0xa')]=BPromise['promisify'](ami[_0xfdf9('0xb')]);function error(_0x2e6041){logger[_0xfdf9('0xc')](util[_0xfdf9('0xd')](_0xfdf9('0xe'),config[_0xfdf9('0x5')]['username'],config['asterisk']['ip'],config[_0xfdf9('0x5')][_0xfdf9('0x6')],util[_0xfdf9('0xf')](_0x2e6041,![],null)));}function close(){logger[_0xfdf9('0xc')](util[_0xfdf9('0xd')](_0xfdf9('0x10'),config[_0xfdf9('0x5')]['username'],config['asterisk']['ip'],config[_0xfdf9('0x5')][_0xfdf9('0x6')]));}ami[_0xfdf9('0x11')]=function(){return function(){return ami[_0xfdf9('0xa')]({'action':_0xfdf9('0x12')});};};ami[_0xfdf9('0x13')]=function(){return function(){return ami[_0xfdf9('0xa')]({'action':'devicestatelist'});};};ami[_0xfdf9('0x14')]=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0xfdf9('0x15')]=function(){return function(){return ami[_0xfdf9('0xa')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xfdf9('0xa')]({'action':_0xfdf9('0x16')});};};function connect(_0x3830dc){logger[_0xfdf9('0x17')](util[_0xfdf9('0xd')](_0xfdf9('0x18'),config[_0xfdf9('0x5')][_0xfdf9('0x7')],config[_0xfdf9('0x5')]['ip'],config['asterisk'][_0xfdf9('0x6')]));ami[_0xfdf9('0x19')](_0xfdf9('0xc'),error);ami[_0xfdf9('0x19')](_0xfdf9('0x1a'),close);}ami['on'](_0xfdf9('0x1b'),connect);ami['on'](_0xfdf9('0x1c'),function(_0x269b4c){logger['info'](util[_0xfdf9('0xd')](_0xfdf9('0x1d'),config['asterisk'][_0xfdf9('0x7')],config['asterisk']['ip'],config['asterisk']['port'],util['inspect'](_0x269b4c,![],null)));});ami['on'](_0xfdf9('0x1e'),function(_0x1b3c9d){logger[_0xfdf9('0x17')](util[_0xfdf9('0xd')](_0xfdf9('0x1f'),config[_0xfdf9('0x5')]['username'],config['asterisk']['ip'],config[_0xfdf9('0x5')]['port']));return BPromise['resolve']()[_0xfdf9('0x20')](ami[_0xfdf9('0x11')]())['then'](ami[_0xfdf9('0x13')]())[_0xfdf9('0x20')](ami[_0xfdf9('0x14')]())[_0xfdf9('0x20')](ami['actionQueueSummary']())[_0xfdf9('0x20')](ami[_0xfdf9('0x21')]())['catch'](function(_0x1ee184){console[_0xfdf9('0x22')](_0x1ee184);});});ami['once'](_0xfdf9('0xc'),error);ami[_0xfdf9('0x19')](_0xfdf9('0x1a'),close);module[_0xfdf9('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 95a9962..d0656bf 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 _0xfa28=['Request','request','then','debug','rpc','memberReport','error','message','exports','jayson/promise','bluebird','../../config/logger','client','http'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xfa28,0x121));var _0x8fa2=function(_0x5ae8f7,_0x330d91){_0x5ae8f7=_0x5ae8f7-0x0;var _0x54c636=_0xfa28[_0x5ae8f7];return _0x54c636;};'use strict';var jayson=require(_0x8fa2('0x0'));var BPromise=require(_0x8fa2('0x1'));var logger=require(_0x8fa2('0x2'))('ami');var client=jayson[_0x8fa2('0x3')][_0x8fa2('0x4')]({'port':0x2329});client[_0x8fa2('0x5')]=function(_0x4ca182,_0x4d171c){return new BPromise(function(_0x4456d0,_0x20c402){return client[_0x8fa2('0x6')](_0x4ca182,_0x4d171c)[_0x8fa2('0x7')](function(_0x1b8315){logger[_0x8fa2('0x8')](_0x8fa2('0x9'),_0x8fa2('0xa'),_0x4ca182,_0x4d171c,_0x1b8315);if(_0x1b8315[_0x8fa2('0xb')]){logger[_0x8fa2('0xb')]('rpc',_0x8fa2('0xa'),_0x4ca182,_0x1b8315[_0x8fa2('0xb')]['message'],_0x4d171c);return _0x20c402(_0x1b8315[_0x8fa2('0xb')][_0x8fa2('0xc')]);}else{return _0x4456d0(_0x1b8315['result']);}})['catch'](function(_0x5a4a4e){logger['error'](_0x8fa2('0x9'),_0x8fa2('0xa'),_0x4ca182,_0x5a4a4e,_0x4d171c);return _0x20c402(_0x5a4a4e);});});};module[_0x8fa2('0xd')]=client; \ No newline at end of file +var _0xa612=['jayson/promise','bluebird','../../config/logger','ami','client','http','request','debug','rpc','error','message','result','catch','memberReport','exports'];(function(_0x9e23,_0x1aabe5){var _0x152578=function(_0xc312ca){while(--_0xc312ca){_0x9e23['push'](_0x9e23['shift']());}};_0x152578(++_0x1aabe5);}(_0xa612,0x1ef));var _0x2a61=function(_0x5e7fe2,_0x571808){_0x5e7fe2=_0x5e7fe2-0x0;var _0xdaa56a=_0xa612[_0x5e7fe2];return _0xdaa56a;};'use strict';var jayson=require(_0x2a61('0x0'));var BPromise=require(_0x2a61('0x1'));var logger=require(_0x2a61('0x2'))(_0x2a61('0x3'));var client=jayson[_0x2a61('0x4')][_0x2a61('0x5')]({'port':0x2329});client['Request']=function(_0x161c58,_0x2861d3){return new BPromise(function(_0x2bfae7,_0x12b6ee){return client[_0x2a61('0x6')](_0x161c58,_0x2861d3)['then'](function(_0x35eeca){logger[_0x2a61('0x7')](_0x2a61('0x8'),'memberReport',_0x161c58,_0x2861d3,_0x35eeca);if(_0x35eeca['error']){logger[_0x2a61('0x9')]('rpc','memberReport',_0x161c58,_0x35eeca['error']['message'],_0x2861d3);return _0x12b6ee(_0x35eeca[_0x2a61('0x9')][_0x2a61('0xa')]);}else{return _0x2bfae7(_0x35eeca[_0x2a61('0xb')]);}})[_0x2a61('0xc')](function(_0x658bb4){logger[_0x2a61('0x9')](_0x2a61('0x8'),_0x2a61('0xd'),_0x161c58,_0x658bb4,_0x2861d3);return _0x12b6ee(_0x658bb4);});});};module[_0x2a61('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 2c695da..9ca3af8 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 _0x0f88=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','format','dialCutDigit','util','lodash','moment','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry'];(function(_0x1ad4b0,_0x4dc102){var _0x477967=function(_0x3665d6){while(--_0x3665d6){_0x1ad4b0['push'](_0x1ad4b0['shift']());}};_0x477967(++_0x4dc102);}(_0x0f88,0x1d9));var _0x80f8=function(_0x13419e,_0x3e04e9){_0x13419e=_0x13419e-0x0;var _0x112be5=_0x0f88[_0x13419e];return _0x112be5;};'use strict';var util=require(_0x80f8('0x0'));var _=require(_0x80f8('0x1'));var moment=require(_0x80f8('0x2'));function checkNameSurname(_0x3767c2,_0x25bcba,_0x236dde){var _0x362cbf='';if(!_[_0x80f8('0x3')](_0x25bcba)&&'string'===typeof _0x25bcba){_0x362cbf+=_0x25bcba;}if(!_[_0x80f8('0x3')](_0x236dde)&&'string'===typeof _0x236dde){_0x362cbf+='\x20'+_0x236dde;}if(_0x362cbf!==''){return _0x362cbf;}return _0x3767c2;}function Action(_0xfd2e40,_0x2ed778,_0x1add64){this[_0x80f8('0x4')]=_0xfd2e40;this[_0x80f8('0x5')]=_0x1add64||undefined;this[_0x80f8('0x6')]=checkNameSurname(_0x2ed778[_0x80f8('0x7')][_0x80f8('0x8')],_0x2ed778[_0x80f8('0x7')][_0x80f8('0x9')],_0x2ed778[_0x80f8('0x7')][_0x80f8('0xa')]);this[_0x80f8('0xb')]=_0x2ed778[_0x80f8('0x7')][_0x80f8('0x8')];this[_0x80f8('0xc')]=_0xfd2e40[_0x80f8('0x6')];this[_0x80f8('0xd')]=_0x2ed778[_0x80f8('0xd')]||![];this[_0x80f8('0xe')]=_0xfd2e40['type'];this[_0x80f8('0xf')]=_0xfd2e40[_0x80f8('0xf')]||0x3;this[_0x80f8('0x10')]=_0x2ed778['scheduledat'];this[_0x80f8('0x11')]=_0x2ed778[_0x80f8('0x11')];this[_0x80f8('0x12')]=_0x2ed778['countcongestionretry'];this['countnoanswerretry']=_0x2ed778['countnoanswerretry'];this['countnosuchnumberretry']=_0x2ed778[_0x80f8('0x13')];this['countdropretry']=_0x2ed778[_0x80f8('0x14')];this[_0x80f8('0x15')]=_0x2ed778[_0x80f8('0x15')];this[_0x80f8('0x16')]=_0x2ed778[_0x80f8('0x16')];this[_0x80f8('0x17')]=_0x2ed778[_0x80f8('0x17')];this[_0x80f8('0x18')]=_0x2ed778[_0x80f8('0x18')];this[_0x80f8('0x19')]=_0x2ed778['ListId'];this[_0x80f8('0x1a')]=_0x2ed778[_0x80f8('0x1a')];this[_0x80f8('0x1b')]=_0x2ed778[_0x80f8('0x1b')];this[_0x80f8('0x1c')]=_0x2ed778['CampaignId'];this[_0x80f8('0x1d')]=_0x2ed778['id'];this[_0x80f8('0x1e')]=_0x2ed778['Contact'][_0x80f8('0x9')]||'';this[_0x80f8('0x1f')]=moment()['format'](_0x80f8('0x20'));this[_0x80f8('0x21')]=_0x2ed778[_0x80f8('0x21')];this[_0x80f8('0x22')]=_0x2ed778[_0x80f8('0x22')];this[_0x80f8('0x23')]=_0x2ed778[_0x80f8('0x23')];this[_0x80f8('0x24')]=_0x2ed778['recallme'];this[_0x80f8('0x25')]='';this['originatecalleridname']='';}Action[_0x80f8('0x26')]['getCaller']=function(){return util[_0x80f8('0x27')]('\x22%s\x22\x20<%s>',this[_0x80f8('0x6')],this[_0x80f8('0x4')][_0x80f8('0x28')]>0x0?this['number']['substring'](this[_0x80f8('0x4')][_0x80f8('0x28')]):this['number']);};Action[_0x80f8('0x26')]['getQueue']=function(){return this[_0x80f8('0xc')];};module['exports']=Action; \ No newline at end of file +var _0xe126=['active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>','substring','getQueue','exports','util','lodash','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','number','queue'];(function(_0x12eab4,_0x50003d){var _0x47ab6c=function(_0x59c8da){while(--_0x59c8da){_0x12eab4['push'](_0x12eab4['shift']());}};_0x47ab6c(++_0x50003d);}(_0xe126,0xeb));var _0x6e12=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xe126[_0xe73080];return _0x12cbc4;};'use strict';var util=require(_0x6e12('0x0'));var _=require(_0x6e12('0x1'));var moment=require('moment');function checkNameSurname(_0x2f58a1,_0x397a9d,_0x206eb5){var _0x3078b5='';if(!_[_0x6e12('0x2')](_0x397a9d)&&'string'===typeof _0x397a9d){_0x3078b5+=_0x397a9d;}if(!_[_0x6e12('0x2')](_0x206eb5)&&'string'===typeof _0x206eb5){_0x3078b5+='\x20'+_0x206eb5;}if(_0x3078b5!==''){return _0x3078b5;}return _0x2f58a1;}function Action(_0x43c79e,_0xeba6b3,_0x4e8c75){this[_0x6e12('0x3')]=_0x43c79e;this[_0x6e12('0x4')]=_0x4e8c75||undefined;this[_0x6e12('0x5')]=checkNameSurname(_0xeba6b3[_0x6e12('0x6')][_0x6e12('0x7')],_0xeba6b3[_0x6e12('0x6')][_0x6e12('0x8')],_0xeba6b3['Contact']['lastName']);this[_0x6e12('0x9')]=_0xeba6b3[_0x6e12('0x6')]['phone'];this[_0x6e12('0xa')]=_0x43c79e['name'];this['active']=_0xeba6b3[_0x6e12('0xb')]||![];this[_0x6e12('0xc')]=_0x43c79e['type'];this[_0x6e12('0xd')]=_0x43c79e['dialQueueTimeout']||0x3;this[_0x6e12('0xe')]=_0xeba6b3[_0x6e12('0xe')];this[_0x6e12('0xf')]=_0xeba6b3[_0x6e12('0xf')];this['countcongestionretry']=_0xeba6b3[_0x6e12('0x10')];this['countnoanswerretry']=_0xeba6b3[_0x6e12('0x11')];this[_0x6e12('0x12')]=_0xeba6b3[_0x6e12('0x12')];this[_0x6e12('0x13')]=_0xeba6b3['countdropretry'];this[_0x6e12('0x14')]=_0xeba6b3[_0x6e12('0x14')];this[_0x6e12('0x15')]=_0xeba6b3['countmachineretry'];this['countagentrejectretry']=_0xeba6b3['countagentrejectretry'];this[_0x6e12('0x16')]=_0xeba6b3[_0x6e12('0x16')];this[_0x6e12('0x17')]=_0xeba6b3[_0x6e12('0x17')];this[_0x6e12('0x18')]=_0xeba6b3[_0x6e12('0x18')];this[_0x6e12('0x19')]=_0xeba6b3['VoiceQueueId'];this[_0x6e12('0x1a')]=_0xeba6b3['CampaignId'];this['idHopper']=_0xeba6b3['id'];this[_0x6e12('0x1b')]=_0xeba6b3[_0x6e12('0x6')][_0x6e12('0x8')]||'';this[_0x6e12('0x1c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6e12('0x1d')]=_0xeba6b3['callback'];this['callbackuniqueid']=_0xeba6b3[_0x6e12('0x1e')];this[_0x6e12('0x1f')]=_0xeba6b3[_0x6e12('0x1f')];this[_0x6e12('0x20')]=_0xeba6b3['recallme'];this[_0x6e12('0x21')]='';this['originatecalleridname']='';}Action[_0x6e12('0x22')][_0x6e12('0x23')]=function(){return util[_0x6e12('0x24')](_0x6e12('0x25'),this[_0x6e12('0x5')],this[_0x6e12('0x3')]['dialCutDigit']>0x0?this[_0x6e12('0x9')][_0x6e12('0x26')](this['voiceQueue']['dialCutDigit']):this['number']);};Action[_0x6e12('0x22')][_0x6e12('0x27')]=function(){return this[_0x6e12('0xa')];};module[_0x6e12('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index da63c2b..3da9c80 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 _0x0a8d=['lodash','moment','milliseconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','answertime','endtime','ringtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x0a8d,0x171));var _0xd0a8=function(_0x592ae7,_0x28856f){_0x592ae7=_0x592ae7-0x0;var _0x2e558f=_0x0a8d[_0x592ae7];return _0x2e558f;};'use strict';var util=require('util');var _=require(_0xd0a8('0x0'));var moment=require(_0xd0a8('0x1'));function getSeconds(_0x32583a,_0x1a4b2c){var _0x337ea2=moment(_0x32583a)[_0xd0a8('0x2')](0x0);var _0x309de0=moment(_0x1a4b2c)[_0xd0a8('0x2')](0x0);return _0x337ea2['diff'](_0x309de0,'seconds');}function AgentComplete(_0x354cbc,_0x346f27){this[_0xd0a8('0x3')]=0x4;this[_0xd0a8('0x4')]=_0xd0a8('0x5');this[_0xd0a8('0x6')]=_0x354cbc['scheduledat'];this[_0xd0a8('0x7')]=_0x354cbc['type'];this['campaigntype']=_0x354cbc[_0xd0a8('0x7')]===_0xd0a8('0x8')?_0xd0a8('0x9'):_0x354cbc['type'];this[_0xd0a8('0xa')]=_0x354cbc['countbusyretry'];this[_0xd0a8('0xb')]=_0x354cbc[_0xd0a8('0xb')];this[_0xd0a8('0xc')]=_0x354cbc['countnoanswerretry'];this[_0xd0a8('0xd')]=_0x354cbc[_0xd0a8('0xa')]+_0x354cbc['countcongestionretry']+_0x354cbc[_0xd0a8('0xc')]+_0x354cbc[_0xd0a8('0xe')]+_0x354cbc['countdropretry']+_0x354cbc[_0xd0a8('0xf')]+_0x354cbc['countmachineretry']+_0x354cbc['countagentrejectretry'];this['countnosuchnumberretry']=_0x354cbc[_0xd0a8('0xe')];this[_0xd0a8('0x10')]=_0x354cbc['countdropretry'];this[_0xd0a8('0xf')]=_0x354cbc[_0xd0a8('0xf')];this[_0xd0a8('0x11')]=_0x354cbc['countmachineretry'];this[_0xd0a8('0x12')]=_0x354cbc[_0xd0a8('0x12')];this[_0xd0a8('0x13')]=_0x346f27[_0xd0a8('0x13')];this['calleridname']=_0x354cbc[_0xd0a8('0x14')];this[_0xd0a8('0x15')]=_0x354cbc['number'];this[_0xd0a8('0x16')]=_0x354cbc[_0xd0a8('0x16')];this[_0xd0a8('0x17')]=_0x354cbc[_0xd0a8('0x17')];this['answertime']=_0x354cbc[_0xd0a8('0x18')];this[_0xd0a8('0x19')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xd0a8('0x1a')]=getSeconds(_0x354cbc[_0xd0a8('0x17')],_0x354cbc[_0xd0a8('0x16')]);this['holdtime']=getSeconds(_0x354cbc[_0xd0a8('0x18')],_0x354cbc[_0xd0a8('0x17')]);this['talktime']=getSeconds(this['endtime'],_0x354cbc['answertime']);this['queue']=_0x346f27[_0xd0a8('0x9')];this['membername']=_0x346f27[_0xd0a8('0x1b')];this[_0xd0a8('0x1c')]=_0x346f27[_0xd0a8('0x1c')];this[_0xd0a8('0x1d')]=_0x354cbc[_0xd0a8('0x1d')];this[_0xd0a8('0x1e')]=_0x354cbc[_0xd0a8('0x1e')];this['callbackat']=_0x354cbc[_0xd0a8('0x1f')];this[_0xd0a8('0x20')]=_0x354cbc[_0xd0a8('0x20')];this[_0xd0a8('0x21')]=_0x354cbc[_0xd0a8('0x21')];this[_0xd0a8('0x22')]=_0x354cbc[_0xd0a8('0x22')];this['UserId']=_0x354cbc[_0xd0a8('0x23')];this[_0xd0a8('0x24')]=_0x354cbc['VoiceQueueId'];this[_0xd0a8('0x25')]=_0x354cbc['CampaignId'];this['originatecalleridnum']=_0x354cbc[_0xd0a8('0x26')]||'';this['originatecalleridname']=_0x354cbc[_0xd0a8('0x27')]||'';}module[_0xd0a8('0x28')]=AgentComplete; \ No newline at end of file +var _0xe380=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound'];(function(_0x3d962f,_0x518679){var _0x11c5cf=function(_0x13d0ca){while(--_0x13d0ca){_0x3d962f['push'](_0x3d962f['shift']());}};_0x11c5cf(++_0x518679);}(_0xe380,0x1ee));var _0x0e38=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xe380[_0x50a0c2];return _0x5ebadd;};'use strict';var util=require(_0x0e38('0x0'));var _=require(_0x0e38('0x1'));var moment=require(_0x0e38('0x2'));function getSeconds(_0x226f19,_0x54196c){var _0xa0766b=moment(_0x226f19)['milliseconds'](0x0);var _0x2f1328=moment(_0x54196c)[_0x0e38('0x3')](0x0);return _0xa0766b[_0x0e38('0x4')](_0x2f1328,_0x0e38('0x5'));}function AgentComplete(_0x44f0aa,_0x102217){this[_0x0e38('0x6')]=0x4;this['statedesc']=_0x0e38('0x7');this[_0x0e38('0x8')]=_0x44f0aa['scheduledat'];this[_0x0e38('0x9')]=_0x44f0aa[_0x0e38('0x9')];this[_0x0e38('0xa')]=_0x44f0aa['type']===_0x0e38('0xb')?_0x0e38('0xc'):_0x44f0aa[_0x0e38('0x9')];this[_0x0e38('0xd')]=_0x44f0aa[_0x0e38('0xd')];this[_0x0e38('0xe')]=_0x44f0aa[_0x0e38('0xe')];this['countnoanswerretry']=_0x44f0aa[_0x0e38('0xf')];this[_0x0e38('0x10')]=_0x44f0aa[_0x0e38('0xd')]+_0x44f0aa[_0x0e38('0xe')]+_0x44f0aa['countnoanswerretry']+_0x44f0aa[_0x0e38('0x11')]+_0x44f0aa[_0x0e38('0x12')]+_0x44f0aa[_0x0e38('0x13')]+_0x44f0aa[_0x0e38('0x14')]+_0x44f0aa[_0x0e38('0x15')];this['countnosuchnumberretry']=_0x44f0aa[_0x0e38('0x11')];this[_0x0e38('0x12')]=_0x44f0aa[_0x0e38('0x12')];this[_0x0e38('0x13')]=_0x44f0aa[_0x0e38('0x13')];this['countmachineretry']=_0x44f0aa[_0x0e38('0x14')];this['countagentrejectretry']=_0x44f0aa[_0x0e38('0x15')];this[_0x0e38('0x16')]=_0x102217[_0x0e38('0x16')];this['calleridname']=_0x44f0aa[_0x0e38('0x17')];this[_0x0e38('0x18')]=_0x44f0aa[_0x0e38('0x19')];this[_0x0e38('0x1a')]=_0x44f0aa[_0x0e38('0x1a')];this[_0x0e38('0x1b')]=_0x44f0aa[_0x0e38('0x1b')];this['answertime']=_0x44f0aa[_0x0e38('0x1c')];this[_0x0e38('0x1d')]=moment()[_0x0e38('0x1e')](_0x0e38('0x1f'));this['ringtime']=getSeconds(_0x44f0aa[_0x0e38('0x1b')],_0x44f0aa[_0x0e38('0x1a')]);this[_0x0e38('0x20')]=getSeconds(_0x44f0aa[_0x0e38('0x1c')],_0x44f0aa[_0x0e38('0x1b')]);this[_0x0e38('0x21')]=getSeconds(this[_0x0e38('0x1d')],_0x44f0aa[_0x0e38('0x1c')]);this['queue']=_0x102217[_0x0e38('0xc')];this[_0x0e38('0x22')]=_0x102217[_0x0e38('0x22')];this['reason']=_0x102217[_0x0e38('0x23')];this['callback']=_0x44f0aa['callback'];this[_0x0e38('0x24')]=_0x44f0aa[_0x0e38('0x24')];this[_0x0e38('0x25')]=_0x44f0aa[_0x0e38('0x25')];this[_0x0e38('0x26')]=_0x44f0aa[_0x0e38('0x26')];this[_0x0e38('0x27')]=_0x44f0aa[_0x0e38('0x27')];this[_0x0e38('0x28')]=_0x44f0aa[_0x0e38('0x28')];this[_0x0e38('0x29')]=_0x44f0aa[_0x0e38('0x29')];this[_0x0e38('0x2a')]=_0x44f0aa[_0x0e38('0x2a')];this[_0x0e38('0x2b')]=_0x44f0aa['CampaignId'];this[_0x0e38('0x2c')]=_0x44f0aa[_0x0e38('0x2c')]||'';this[_0x0e38('0x2d')]=_0x44f0aa[_0x0e38('0x2d')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 83a87f7..9554bd9 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 _0x4293=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0x4293,0x190));var _0x3429=function(_0x4efaa2,_0x53cba1){_0x4efaa2=_0x4efaa2-0x0;var _0x2b2d6d=_0x4293[_0x4efaa2];return _0x2b2d6d;};'use strict';var util=require('util');var _=require(_0x3429('0x0'));var moment=require('moment');function getSeconds(_0x24141f,_0x4c842a){var _0x9aad8a=moment(_0x24141f)[_0x3429('0x1')](0x0);var _0x38492d=moment(_0x4c842a)['milliseconds'](0x0);return _0x9aad8a[_0x3429('0x2')](_0x38492d,_0x3429('0x3'));}function Final(_0x5a864a){this[_0x3429('0x4')]=_0x5a864a[_0x3429('0x4')];this[_0x3429('0x5')]=_0x5a864a['scheduledat'];this[_0x3429('0x6')]=_0x5a864a['type'];this[_0x3429('0x7')]=_0x5a864a[_0x3429('0x6')]===_0x3429('0x8')?_0x3429('0x9'):_0x5a864a[_0x3429('0x6')];this[_0x3429('0xa')]=_0x5a864a[_0x3429('0xa')];this[_0x3429('0xb')]=_0x5a864a[_0x3429('0xb')];this[_0x3429('0xc')]=_0x5a864a[_0x3429('0xc')];this[_0x3429('0xd')]=_0x5a864a[_0x3429('0xa')]+_0x5a864a[_0x3429('0xb')]+_0x5a864a['countnoanswerretry']+_0x5a864a[_0x3429('0xe')]+_0x5a864a['countdropretry']+_0x5a864a[_0x3429('0xf')]+_0x5a864a[_0x3429('0x10')]+_0x5a864a['countagentrejectretry'];this[_0x3429('0xe')]=_0x5a864a[_0x3429('0xe')];this[_0x3429('0x11')]=_0x5a864a['countdropretry'];this[_0x3429('0xf')]=_0x5a864a[_0x3429('0xf')];this['countmachineretry']=_0x5a864a[_0x3429('0x10')];this[_0x3429('0x12')]=_0x5a864a[_0x3429('0x12')];this['queue']=_0x5a864a[_0x3429('0x9')];this['calleridname']=_0x5a864a[_0x3429('0x13')];this[_0x3429('0x14')]=_0x5a864a[_0x3429('0x14')];this[_0x3429('0x15')]=_0x5a864a['starttime'];this[_0x3429('0x16')]=_0x5a864a['responsetime'];this[_0x3429('0x17')]=_0x5a864a['responsetime'];this[_0x3429('0x18')]=_0x5a864a[_0x3429('0x18')]||0x0;this[_0x3429('0x19')]=_0x5a864a[_0x3429('0x19')]||0x0;this[_0x3429('0x1a')]=_0x5a864a[_0x3429('0x1a')]||0x0;this[_0x3429('0x1b')]=_0x5a864a['callback'];this[_0x3429('0x1c')]=_0x5a864a[_0x3429('0x1c')];this[_0x3429('0x1d')]=_0x5a864a['callbackat'];this[_0x3429('0x1e')]=_0x5a864a[_0x3429('0x1e')];this[_0x3429('0x1f')]=_0x5a864a['ContactId'];this[_0x3429('0x20')]=_0x5a864a[_0x3429('0x20')];this[_0x3429('0x21')]=_0x5a864a['UserId'];this[_0x3429('0x22')]=_0x5a864a[_0x3429('0x22')];this[_0x3429('0x23')]=_0x5a864a[_0x3429('0x23')];this[_0x3429('0x24')]=_0x5a864a[_0x3429('0x24')]||'';this[_0x3429('0x25')]=_0x5a864a[_0x3429('0x25')]||'';}module[_0x3429('0x26')]=Final; \ No newline at end of file +var _0x9617=['countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x9617,0x175));var _0x7961=function(_0x4996b1,_0xba7b8d){_0x4996b1=_0x4996b1-0x0;var _0x298372=_0x9617[_0x4996b1];return _0x298372;};'use strict';var util=require(_0x7961('0x0'));var _=require(_0x7961('0x1'));var moment=require(_0x7961('0x2'));function getSeconds(_0x3ca26d,_0x57bfd6){var _0xaa22fb=moment(_0x3ca26d)[_0x7961('0x3')](0x0);var _0x29866c=moment(_0x57bfd6)['milliseconds'](0x0);return _0xaa22fb[_0x7961('0x4')](_0x29866c,_0x7961('0x5'));}function Final(_0x5a83f8){this['uniqueid']=_0x5a83f8[_0x7961('0x6')];this[_0x7961('0x7')]=_0x5a83f8[_0x7961('0x7')];this[_0x7961('0x8')]=_0x5a83f8[_0x7961('0x8')];this[_0x7961('0x9')]=_0x5a83f8[_0x7961('0x8')]===_0x7961('0xa')?_0x7961('0xb'):_0x5a83f8[_0x7961('0x8')];this['countbusyretry']=_0x5a83f8[_0x7961('0xc')];this['countcongestionretry']=_0x5a83f8[_0x7961('0xd')];this[_0x7961('0xe')]=_0x5a83f8[_0x7961('0xe')];this[_0x7961('0xf')]=_0x5a83f8['countbusyretry']+_0x5a83f8[_0x7961('0xd')]+_0x5a83f8[_0x7961('0xe')]+_0x5a83f8[_0x7961('0x10')]+_0x5a83f8['countdropretry']+_0x5a83f8[_0x7961('0x11')]+_0x5a83f8[_0x7961('0x12')]+_0x5a83f8[_0x7961('0x13')];this[_0x7961('0x10')]=_0x5a83f8['countnosuchnumberretry'];this[_0x7961('0x14')]=_0x5a83f8[_0x7961('0x14')];this[_0x7961('0x11')]=_0x5a83f8['countabandonedretry'];this[_0x7961('0x12')]=_0x5a83f8[_0x7961('0x12')];this[_0x7961('0x13')]=_0x5a83f8[_0x7961('0x13')];this[_0x7961('0xb')]=_0x5a83f8[_0x7961('0xb')];this[_0x7961('0x15')]=_0x5a83f8['calleridname'];this[_0x7961('0x16')]=_0x5a83f8[_0x7961('0x16')];this['starttime']=_0x5a83f8['starttime'];this[_0x7961('0x17')]=_0x5a83f8['responsetime'];this[_0x7961('0x18')]=_0x5a83f8[_0x7961('0x17')];this[_0x7961('0x19')]=_0x5a83f8['ringtime']||0x0;this[_0x7961('0x1a')]=_0x5a83f8[_0x7961('0x1a')]||0x0;this[_0x7961('0x1b')]=_0x5a83f8[_0x7961('0x1b')]||0x0;this['callback']=_0x5a83f8[_0x7961('0x1c')];this[_0x7961('0x1d')]=_0x5a83f8[_0x7961('0x1d')];this[_0x7961('0x1e')]=_0x5a83f8[_0x7961('0x1e')];this['recallme']=_0x5a83f8[_0x7961('0x1f')];this[_0x7961('0x20')]=_0x5a83f8[_0x7961('0x20')];this[_0x7961('0x21')]=_0x5a83f8[_0x7961('0x21')];this[_0x7961('0x22')]=_0x5a83f8['UserId'];this[_0x7961('0x23')]=_0x5a83f8[_0x7961('0x23')];this[_0x7961('0x24')]=_0x5a83f8[_0x7961('0x24')];this[_0x7961('0x25')]=_0x5a83f8[_0x7961('0x25')]||'';this['originatecalleridname']=_0x5a83f8['originatecalleridname']||'';}module[_0x7961('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 8214ff7..dbb6678 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 _0x907a=['name','calleridnum','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','talktime','queue','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname'];(function(_0x6a374c,_0x120994){var _0x5e2047=function(_0x354454){while(--_0x354454){_0x6a374c['push'](_0x6a374c['shift']());}};_0x5e2047(++_0x120994);}(_0x907a,0x17f));var _0xa907=function(_0x50b175,_0x3e81ed){_0x50b175=_0x50b175-0x0;var _0x3cfe31=_0x907a[_0x50b175];return _0x3cfe31;};'use strict';var util=require(_0xa907('0x0'));var _=require(_0xa907('0x1'));var moment=require(_0xa907('0x2'));function getSeconds(_0x49b8a2,_0x32d0fa){var _0x71816e=moment(_0x49b8a2)[_0xa907('0x3')](0x0);var _0x3a8eca=moment(_0x32d0fa)[_0xa907('0x3')](0x0);return _0x71816e[_0xa907('0x4')](_0x3a8eca,_0xa907('0x5'));}function Hangup(_0x3ea5c5,_0x274fc5){this['state']=0x4;this['statedesc']=_0xa907('0x6');this[_0xa907('0x7')]=_0x3ea5c5[_0xa907('0x7')];this[_0xa907('0x8')]=_0x3ea5c5[_0xa907('0x8')];this[_0xa907('0x9')]=_0x3ea5c5[_0xa907('0x8')]===_0xa907('0xa')?'queue':_0x3ea5c5[_0xa907('0x8')];this[_0xa907('0xb')]=_0x3ea5c5[_0xa907('0xb')];this[_0xa907('0xc')]=_0x3ea5c5[_0xa907('0xc')];this['countnoanswerretry']=_0x3ea5c5[_0xa907('0xd')];this[_0xa907('0xe')]=_0x3ea5c5['countbusyretry']+_0x3ea5c5['countcongestionretry']+_0x3ea5c5[_0xa907('0xd')]+_0x3ea5c5[_0xa907('0xf')]+_0x3ea5c5['countdropretry']+_0x3ea5c5['countabandonedretry']+_0x3ea5c5[_0xa907('0x10')]+_0x3ea5c5['countagentrejectretry'];this[_0xa907('0xf')]=_0x3ea5c5['countnosuchnumberretry'];this[_0xa907('0x11')]=_0x3ea5c5['countdropretry'];this[_0xa907('0x12')]=_0x3ea5c5['countabandonedretry'];this[_0xa907('0x10')]=_0x3ea5c5[_0xa907('0x10')];this[_0xa907('0x13')]=_0x3ea5c5[_0xa907('0x13')];this[_0xa907('0x14')]=_0x274fc5['uniqueid'];this[_0xa907('0x15')]=_0x3ea5c5[_0xa907('0x16')];this[_0xa907('0x17')]=_0x3ea5c5['number'];this['starttime']=_0x3ea5c5['starttime'];this[_0xa907('0x18')]=_0x3ea5c5[_0xa907('0x18')];this[_0xa907('0x19')]=moment()[_0xa907('0x1a')](_0xa907('0x1b'));this[_0xa907('0x1c')]=getSeconds(_0x3ea5c5[_0xa907('0x18')],_0x3ea5c5[_0xa907('0x1d')]);this[_0xa907('0x1e')]=0x0;this[_0xa907('0x1f')]=getSeconds(this[_0xa907('0x19')],_0x3ea5c5[_0xa907('0x18')]);this['queue']=_0x3ea5c5[_0xa907('0x20')];this[_0xa907('0x21')]='IVR';this[_0xa907('0x22')]=_0x274fc5[_0xa907('0x23')];this[_0xa907('0x24')]=_0x3ea5c5[_0xa907('0x24')];this['callbackuniqueid']=_0x3ea5c5[_0xa907('0x25')];this[_0xa907('0x26')]=_0x3ea5c5[_0xa907('0x26')];this['recallme']=_0x3ea5c5['recallme'];this[_0xa907('0x27')]=_0x3ea5c5[_0xa907('0x27')];this[_0xa907('0x28')]=_0x3ea5c5[_0xa907('0x28')];this['UserId']=_0x3ea5c5[_0xa907('0x29')];this['VoiceQueueId']=_0x3ea5c5[_0xa907('0x2a')];this[_0xa907('0x2b')]=_0x3ea5c5[_0xa907('0x2b')];}module[_0xa907('0x2c')]=Hangup; \ No newline at end of file +var _0x0ac4=['name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','recallme','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0x0ac4,0x1ec));var _0x40ac=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x0ac4[_0xe30e17];return _0x2342c9;};'use strict';var util=require(_0x40ac('0x0'));var _=require(_0x40ac('0x1'));var moment=require(_0x40ac('0x2'));function getSeconds(_0x4d4a1e,_0x4255c3){var _0x21af2c=moment(_0x4d4a1e)[_0x40ac('0x3')](0x0);var _0x2a0eae=moment(_0x4255c3)[_0x40ac('0x3')](0x0);return _0x21af2c[_0x40ac('0x4')](_0x2a0eae,_0x40ac('0x5'));}function Hangup(_0x27cd3b,_0x548cff){this[_0x40ac('0x6')]=0x4;this[_0x40ac('0x7')]=_0x40ac('0x8');this[_0x40ac('0x9')]=_0x27cd3b[_0x40ac('0x9')];this[_0x40ac('0xa')]=_0x27cd3b[_0x40ac('0xa')];this[_0x40ac('0xb')]=_0x27cd3b[_0x40ac('0xa')]===_0x40ac('0xc')?_0x40ac('0xd'):_0x27cd3b[_0x40ac('0xa')];this[_0x40ac('0xe')]=_0x27cd3b['countbusyretry'];this['countcongestionretry']=_0x27cd3b[_0x40ac('0xf')];this['countnoanswerretry']=_0x27cd3b[_0x40ac('0x10')];this[_0x40ac('0x11')]=_0x27cd3b[_0x40ac('0xe')]+_0x27cd3b[_0x40ac('0xf')]+_0x27cd3b[_0x40ac('0x10')]+_0x27cd3b['countnosuchnumberretry']+_0x27cd3b[_0x40ac('0x12')]+_0x27cd3b['countabandonedretry']+_0x27cd3b[_0x40ac('0x13')]+_0x27cd3b[_0x40ac('0x14')];this[_0x40ac('0x15')]=_0x27cd3b['countnosuchnumberretry'];this[_0x40ac('0x12')]=_0x27cd3b[_0x40ac('0x12')];this[_0x40ac('0x16')]=_0x27cd3b['countabandonedretry'];this[_0x40ac('0x13')]=_0x27cd3b['countmachineretry'];this[_0x40ac('0x14')]=_0x27cd3b['countagentrejectretry'];this['uniqueid']=_0x548cff[_0x40ac('0x17')];this['calleridname']=_0x27cd3b[_0x40ac('0x18')];this[_0x40ac('0x19')]=_0x27cd3b['number'];this[_0x40ac('0x1a')]=_0x27cd3b[_0x40ac('0x1a')];this[_0x40ac('0x1b')]=_0x27cd3b[_0x40ac('0x1b')];this[_0x40ac('0x1c')]=moment()[_0x40ac('0x1d')](_0x40ac('0x1e'));this['ringtime']=getSeconds(_0x27cd3b['responsetime'],_0x27cd3b[_0x40ac('0x1a')]);this['holdtime']=0x0;this[_0x40ac('0x1f')]=getSeconds(this[_0x40ac('0x1c')],_0x27cd3b[_0x40ac('0x1b')]);this[_0x40ac('0xd')]=_0x27cd3b['queue'];this[_0x40ac('0x20')]=_0x40ac('0x21');this[_0x40ac('0x22')]=_0x548cff[_0x40ac('0x23')];this[_0x40ac('0x24')]=_0x27cd3b[_0x40ac('0x24')];this[_0x40ac('0x25')]=_0x27cd3b[_0x40ac('0x25')];this['callbackat']=_0x27cd3b['callbackat'];this['recallme']=_0x27cd3b[_0x40ac('0x26')];this['ContactId']=_0x27cd3b['ContactId'];this[_0x40ac('0x27')]=_0x27cd3b[_0x40ac('0x27')];this[_0x40ac('0x28')]=_0x27cd3b[_0x40ac('0x28')];this[_0x40ac('0x29')]=_0x27cd3b['VoiceQueueId'];this[_0x40ac('0x2a')]=_0x27cd3b[_0x40ac('0x2a')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 900d0ee..2647d80 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 _0x450f=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound'];(function(_0x51376d,_0x569f0c){var _0x3d4b31=function(_0x442a10){while(--_0x442a10){_0x51376d['push'](_0x51376d['shift']());}};_0x3d4b31(++_0x569f0c);}(_0x450f,0x15d));var _0xf450=function(_0x2c40bf,_0x5ce37a){_0x2c40bf=_0x2c40bf-0x0;var _0x31ab19=_0x450f[_0x2c40bf];return _0x31ab19;};'use strict';var util=require(_0xf450('0x0'));var _=require(_0xf450('0x1'));var moment=require(_0xf450('0x2'));function getSeconds(_0x2a5f51,_0x419750){var _0x2230c5=moment(_0x2a5f51)[_0xf450('0x3')](0x0);var _0x3cbb5a=moment(_0x419750)[_0xf450('0x3')](0x0);return _0x2230c5[_0xf450('0x4')](_0x3cbb5a,_0xf450('0x5'));}function History(_0x4c092a){this[_0xf450('0x6')]=_0x4c092a[_0xf450('0x6')];this[_0xf450('0x7')]=_0x4c092a[_0xf450('0x7')]||undefined;this[_0xf450('0x8')]=_0x4c092a[_0xf450('0x8')];this[_0xf450('0x9')]=_0x4c092a[_0xf450('0x8')]===_0xf450('0xa')?'queue':_0x4c092a[_0xf450('0x8')];this[_0xf450('0xb')]=_0x4c092a[_0xf450('0xb')];this[_0xf450('0xc')]=_0x4c092a['countcongestionretry'];this[_0xf450('0xd')]=_0x4c092a[_0xf450('0xd')];this[_0xf450('0xe')]=_0x4c092a[_0xf450('0xb')]+_0x4c092a[_0xf450('0xc')]+_0x4c092a[_0xf450('0xd')]+_0x4c092a[_0xf450('0xf')]+_0x4c092a[_0xf450('0x10')]+_0x4c092a[_0xf450('0x11')]+_0x4c092a[_0xf450('0x12')]+_0x4c092a[_0xf450('0x13')];this[_0xf450('0xf')]=_0x4c092a['countnosuchnumberretry'];this[_0xf450('0x10')]=_0x4c092a[_0xf450('0x10')];this[_0xf450('0x11')]=_0x4c092a['countabandonedretry'];this[_0xf450('0x12')]=_0x4c092a[_0xf450('0x12')];this[_0xf450('0x13')]=_0x4c092a['countagentrejectretry'];this['queue']=_0x4c092a[_0xf450('0x14')];this[_0xf450('0x15')]=_0x4c092a[_0xf450('0x16')];this[_0xf450('0x17')]=_0x4c092a[_0xf450('0x18')];this[_0xf450('0x19')]=_0x4c092a[_0xf450('0x19')];this[_0xf450('0x1a')]=_0x4c092a[_0xf450('0x1a')];this[_0xf450('0x1b')]=_0x4c092a[_0xf450('0x1a')];this['ringtime']=getSeconds(_0x4c092a[_0xf450('0x1a')],_0x4c092a[_0xf450('0x19')]);this[_0xf450('0x1c')]=0x0;this[_0xf450('0x1d')]=0x0;this[_0xf450('0x1e')]=_0x4c092a['callback'];this['callbackuniqueid']=_0x4c092a['callbackuniqueid'];this[_0xf450('0x1f')]=_0x4c092a[_0xf450('0x1f')];this[_0xf450('0x20')]=_0x4c092a[_0xf450('0x20')];this[_0xf450('0x21')]=_0x4c092a['ContactId'];this[_0xf450('0x22')]=_0x4c092a[_0xf450('0x22')];this[_0xf450('0x23')]=_0x4c092a[_0xf450('0x23')];this['VoiceQueueId']=_0x4c092a[_0xf450('0x24')];this['CampaignId']=_0x4c092a[_0xf450('0x25')];this['originatecalleridnum']=_0x4c092a[_0xf450('0x26')]||'';this[_0xf450('0x27')]=_0x4c092a[_0xf450('0x27')]||'';}module['exports']=History; \ No newline at end of file +var _0xd8ba=['outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','queue','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype'];(function(_0x276308,_0x29ef69){var _0x3fbe6f=function(_0x302816){while(--_0x302816){_0x276308['push'](_0x276308['shift']());}};_0x3fbe6f(++_0x29ef69);}(_0xd8ba,0x12f));var _0xad8b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd8ba[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0xad8b('0x0'));var _=require(_0xad8b('0x1'));var moment=require(_0xad8b('0x2'));function getSeconds(_0x6cef9f,_0x43ea9b){var _0x80966e=moment(_0x6cef9f)[_0xad8b('0x3')](0x0);var _0x30c70c=moment(_0x43ea9b)[_0xad8b('0x3')](0x0);return _0x80966e['diff'](_0x30c70c,_0xad8b('0x4'));}function History(_0x3a8d85){this[_0xad8b('0x5')]=_0x3a8d85[_0xad8b('0x5')];this[_0xad8b('0x6')]=_0x3a8d85[_0xad8b('0x6')]||undefined;this[_0xad8b('0x7')]=_0x3a8d85[_0xad8b('0x7')];this[_0xad8b('0x8')]=_0x3a8d85[_0xad8b('0x7')]===_0xad8b('0x9')?'queue':_0x3a8d85[_0xad8b('0x7')];this[_0xad8b('0xa')]=_0x3a8d85[_0xad8b('0xa')];this[_0xad8b('0xb')]=_0x3a8d85['countcongestionretry'];this[_0xad8b('0xc')]=_0x3a8d85['countnoanswerretry'];this['countglobal']=_0x3a8d85[_0xad8b('0xa')]+_0x3a8d85['countcongestionretry']+_0x3a8d85[_0xad8b('0xc')]+_0x3a8d85[_0xad8b('0xd')]+_0x3a8d85[_0xad8b('0xe')]+_0x3a8d85[_0xad8b('0xf')]+_0x3a8d85['countmachineretry']+_0x3a8d85[_0xad8b('0x10')];this['countnosuchnumberretry']=_0x3a8d85[_0xad8b('0xd')];this[_0xad8b('0xe')]=_0x3a8d85[_0xad8b('0xe')];this[_0xad8b('0xf')]=_0x3a8d85[_0xad8b('0xf')];this[_0xad8b('0x11')]=_0x3a8d85[_0xad8b('0x11')];this[_0xad8b('0x10')]=_0x3a8d85[_0xad8b('0x10')];this[_0xad8b('0x12')]=_0x3a8d85[_0xad8b('0x12')];this['calleridname']=_0x3a8d85[_0xad8b('0x13')];this[_0xad8b('0x14')]=_0x3a8d85[_0xad8b('0x15')];this[_0xad8b('0x16')]=_0x3a8d85[_0xad8b('0x16')];this[_0xad8b('0x17')]=_0x3a8d85[_0xad8b('0x17')];this[_0xad8b('0x18')]=_0x3a8d85['responsetime'];this[_0xad8b('0x19')]=getSeconds(_0x3a8d85['responsetime'],_0x3a8d85['starttime']);this[_0xad8b('0x1a')]=0x0;this[_0xad8b('0x1b')]=0x0;this[_0xad8b('0x1c')]=_0x3a8d85['callback'];this[_0xad8b('0x1d')]=_0x3a8d85[_0xad8b('0x1d')];this['callbackat']=_0x3a8d85[_0xad8b('0x1e')];this[_0xad8b('0x1f')]=_0x3a8d85['recallme'];this['ContactId']=_0x3a8d85[_0xad8b('0x20')];this['ListId']=_0x3a8d85['ListId'];this[_0xad8b('0x21')]=_0x3a8d85[_0xad8b('0x21')];this[_0xad8b('0x22')]=_0x3a8d85[_0xad8b('0x22')];this['CampaignId']=_0x3a8d85[_0xad8b('0x23')];this[_0xad8b('0x24')]=_0x3a8d85['originatecalleridnum']||'';this['originatecalleridname']=_0x3a8d85[_0xad8b('0x25')]||'';}module[_0xad8b('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index cf86ece..cc58c94 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 _0x46eb=['agentconnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','Interval','Intervals','\x20INTERVAL_IS_NULL','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','ivr','format','campaign:ivr:%s','campaign:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','originated','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','sendMessageOneNotActive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','endtime','clearZombieChannels','[uniqueid]','enqueue','isNil','Action','channel','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','catch','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','merge','pick','ContactId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','status','reachable','saveInDb','variable','exten','xcally-motion-dialer','value','outboundAnswerAgiCallsDay','statedesc','membername','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','uniqueid','state','Machine','AMD','amd','[syncMachine][createHistory]','[syncMachine]','HANGUP','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Unknow','reason','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','agiafterat','dialDropMaxRetry','countdropretry','dialDropRetryFrequency','minutes','ListId','VoiceQueueId','[rescheduleContact][Drop]','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','syncQueueMember','actionid','paused','stateinterface','locked','rrmemory','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','indexOf','content','true','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','checkIfTime','dialGlobalInterval','dialTimezone','checkDialMethod','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','voiceQueue\x20is\x20undefine','Contact','phone','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','originate','SIP/%s/%s%s','trim','dialCutDigit','substring','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][Abandoned]','dialMachineRetryFrequency','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','[getDataPredictive]','check\x20failure','outboundQueuePauses','busyFactor','[CatchErlangB]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','Contact\x20updated','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[actionOriginate]\x20','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','dialer','../../../config/logger','booked','predictive','syncQueueSummary','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR'];(function(_0x1423f0,_0x18bb72){var _0x5dfea4=function(_0x240314){while(--_0x240314){_0x1423f0['push'](_0x1423f0['shift']());}};_0x5dfea4(++_0x18bb72);}(_0x46eb,0x1df));var _0xb46e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x46eb[_0x4565bf];return _0x5610ba;};'use strict';var util=require(_0xb46e('0x0'));var _=require(_0xb46e('0x1'));var BPromise=require(_0xb46e('0x2'));var uuid=require(_0xb46e('0x3'));var moment=require(_0xb46e('0x4'));var rr=require('rr');var md5=require(_0xb46e('0x5'));var Redis=require(_0xb46e('0x6'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xb46e('0x7'));var loggerBooked=require(_0xb46e('0x8'))(_0xb46e('0x9'));var loggerPredictive=require('../../../config/logger')(_0xb46e('0xa'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xb46e('0xb'));var ami=require(_0xb46e('0xc'));config['redis']=_[_0xb46e('0xd')](config[_0xb46e('0xe')],{'host':_0xb46e('0xf'),'port':0x18eb});var io=require(_0xb46e('0x10'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xb46e('0x11'));var cmHopperHistory=require(_0xb46e('0x12'));var cmHopperBlack=require(_0xb46e('0x13'));var voiceQueueRt=require(_0xb46e('0x14'));var Action=require('./action');var History=require(_0xb46e('0x15'));var Final=require(_0xb46e('0x16'));var AgentComplete=require(_0xb46e('0x17'));var QueueCallerAbandon=require(_0xb46e('0x18'));var Hangup=require('./hangup');var ipAgi=process[_0xb46e('0x19')][_0xb46e('0x1a')]||_0xb46e('0x1b');var strategy={'rrmemory':'rrmemory','roundrobin':_0xb46e('0x1c')};var Sequence=function(){};Sequence[_0xb46e('0x1d')]['enqueue']=function(_0x1cb810){this['tail']=this[_0xb46e('0x1e')]?this[_0xb46e('0x1e')][_0xb46e('0x1f')](_0x1cb810):_0x1cb810();};function Dialer(_0x38fe19,_0x4d1dbf){this[_0xb46e('0x20')]=new Sequence();this[_0xb46e('0x21')]=_0x4d1dbf;this['voiceQueues']=_0x38fe19[_0xb46e('0x22')];this[_0xb46e('0x23')]=_0x38fe19[_0xb46e('0x23')];this[_0xb46e('0x24')]=_0x38fe19[_0xb46e('0x24')];this[_0xb46e('0x25')]=_0x38fe19[_0xb46e('0x25')];this['maxNumberOriginate']=config[_0xb46e('0x26')]||0x2;this['channels']={};this[_0xb46e('0x27')]={};this['contactsId']={};this[_0xb46e('0x28')]={};this[_0xb46e('0x29')]={};this[_0xb46e('0x2a')]={};this[_0xb46e('0x2b')]={};this[_0xb46e('0x2c')]={};this[_0xb46e('0x2d')]={};this[_0xb46e('0x2e')]={};ami['on'](_0xb46e('0x2f'),this['syncAgentConnect'][_0xb46e('0x30')](this));ami['on']('queuecallerabandon',this[_0xb46e('0x31')][_0xb46e('0x30')](this));ami['on'](_0xb46e('0x32'),this[_0xb46e('0x33')][_0xb46e('0x30')](this));ami['on'](_0xb46e('0x34'),this[_0xb46e('0x35')][_0xb46e('0x30')](this));ami['on'](_0xb46e('0x36'),this[_0xb46e('0xb')][_0xb46e('0x30')](this));ami['on'](_0xb46e('0x37'),this[_0xb46e('0x38')][_0xb46e('0x30')](this));ami['on'](_0xb46e('0x39'),this[_0xb46e('0x3a')][_0xb46e('0x30')](this));ami['on'](_0xb46e('0x3b'),this['syncVarSet'][_0xb46e('0x30')](this));ami['on'](_0xb46e('0x3c'),this['syncQueueMember'][_0xb46e('0x30')](this));ami['on'](_0xb46e('0x3d'),this[_0xb46e('0x3e')][_0xb46e('0x30')](this));this[_0xb46e('0x3f')]();this[_0xb46e('0x40')]();}function isNotNull(_0x5798a4){return _0x5798a4!==null&&!_[_0xb46e('0x41')](_0x5798a4);}function checkIsLoggedIn(_0x2c904b,_0x585990){return function(){if(_0x585990<=0x0){_0x2c904b['message']=_0xb46e('0x42');throw _0x2c904b[_0xb46e('0x43')]+_0xb46e('0x44');}};}function isActive(_0x1de32b){return _0x1de32b;}function checkIsActive(_0x3b2cd6,_0x58d4b5){return function(){if(!isActive(_0x58d4b5)){_0x3b2cd6[_0xb46e('0x45')]=_0xb46e('0x46');throw _0x3b2cd6[_0xb46e('0x43')]+_0xb46e('0x47');}};}function checkInterval(_0x1e690f){return function(){if(!isNotNull(_0x1e690f['Interval'])){_0x1e690f[_0xb46e('0x45')]=_0xb46e('0x48');throw _0x1e690f['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x1e690f[_0xb46e('0x49')][_0xb46e('0x4a')])){_0x1e690f[_0xb46e('0x45')]=_0xb46e('0x48');throw _0x1e690f['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x1e690f[_0xb46e('0x49')][_0xb46e('0x4a')]))){_0x1e690f['message']=_0xb46e('0x48');throw _0x1e690f['name']+_0xb46e('0x4b');}};}function msgResponse(_0x1eed39,_0x3bace1,_0x3ce1f7){return{'action':_0x1eed39,'response':_0x3bace1,'message':_0x3ce1f7,'stack':_0x3ce1f7};}function myreject(_0x258808){return function(_0x1f410c){return _0x258808(msgResponse('[ifTime][Action]','Error',JSON[_0xb46e('0x4c')](_0x1f410c)));};}function getSeconds(_0x1d9410,_0x3db0a9){var _0x2c1838=moment(_0x1d9410)[_0xb46e('0x4d')](0x0);var _0x486776=moment(_0x3db0a9)['milliseconds'](0x0);return _0x2c1838[_0xb46e('0x4e')](_0x486776,_0xb46e('0x4f'));}function emit(_0x77f538,_0xb46c67,_0x52dcb5){io['to'](_0x77f538)[_0xb46e('0x50')](_0xb46c67,_0x52dcb5);}function emitVoiceQueueSummary(_0x1577a9){if(_0x1577a9[_0xb46e('0x51')]===_0xb46e('0x52')){var _0x37d151={'id':_0x1577a9['id'],'name':_0x1577a9[_0xb46e('0x43')],'strategy':_0x1577a9[_0xb46e('0x53')],'answered':_0x1577a9[_0xb46e('0x54')],'available':_0x1577a9['available'],'loggedIn':_0x1577a9[_0xb46e('0x55')],'pTalking':_0x1577a9[_0xb46e('0x56')],'sumBillable':_0x1577a9[_0xb46e('0x57')],'sumDuration':_0x1577a9[_0xb46e('0x58')],'sumHoldTime':_0x1577a9[_0xb46e('0x59')]||0x0,'talking':_0x1577a9[_0xb46e('0x5a')],'total':_0x1577a9[_0xb46e('0x5b')],'type':_0x1577a9['type'],'unmanaged':_0x1577a9[_0xb46e('0x5c')],'abandoned':_0x1577a9[_0xb46e('0x5d')],'waiting':_0x1577a9[_0xb46e('0x5e')],'loggedInDb':_0x1577a9[_0xb46e('0x5f')],'dialActive':_0x1577a9['dialActive'],'dialMethod':_0x1577a9[_0xb46e('0x60')],'dialOriginateCallerIdName':_0x1577a9[_0xb46e('0x61')],'dialOriginateCallerIdNumber':_0x1577a9[_0xb46e('0x62')],'dialOriginateTimeout':_0x1577a9[_0xb46e('0x63')],'dialPrefix':_0x1577a9[_0xb46e('0x64')],'outboundAnswerAgiCallsDay':_0x1577a9['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1577a9[_0xb46e('0x65')],'outboundBlacklistCallsDay':_0x1577a9[_0xb46e('0x66')],'outboundBusyCallsDay':_0x1577a9[_0xb46e('0x67')],'outboundCongestionCallsDay':_0x1577a9[_0xb46e('0x68')],'outboundDropCallsDayACS':_0x1577a9[_0xb46e('0x69')],'outboundDropCallsDayCallersExit':_0x1577a9[_0xb46e('0x6a')],'outboundDropCallsDayTimeout':_0x1577a9[_0xb46e('0x6b')],'outboundNoAnswerCallsDay':_0x1577a9[_0xb46e('0x6c')],'outboundNoSuchCallsDay':_0x1577a9[_0xb46e('0x6d')],'outboundOriginateFailureCallsDay':_0x1577a9[_0xb46e('0x6e')],'outboundReCallsDay':_0x1577a9[_0xb46e('0x6f')],'outboundRejectCallsDay':_0x1577a9['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1577a9[_0xb46e('0x70')],'predictiveIntervalAnsweredCalls':_0x1577a9[_0xb46e('0x71')],'predictiveIntervalAvgHoldtime':_0x1577a9[_0xb46e('0x72')],'predictiveIntervalAvgTalktime':_0x1577a9[_0xb46e('0x73')],'predictiveIntervalDroppedCallsCallersExit':_0x1577a9[_0xb46e('0x74')],'predictiveIntervalDroppedCallsTimeout':_0x1577a9[_0xb46e('0x75')],'predictiveIntervalErlangCalls':_0x1577a9['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1577a9[_0xb46e('0x76')],'predictiveIntervalHitRate':_0x1577a9['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1577a9[_0xb46e('0x77')],'predictiveIntervalPauses':_0x1577a9[_0xb46e('0x78')],'predictiveIntervalAvailable':_0x1577a9[_0xb46e('0x79')],'predictiveIntervalTotalCalls':_0x1577a9[_0xb46e('0x7a')],'message':_0x1577a9[_0xb46e('0x45')],'originated':_0x1577a9['originated'],'erlangCalls':_0x1577a9['erlangCalls'],'erlangCallToSecond':_0x1577a9['erlangCallToSecond'],'erlangAbandonmentRate':_0x1577a9[_0xb46e('0x7b')],'erlangBusyFactor':_0x1577a9[_0xb46e('0x7c')],'startPredictive':_0x1577a9[_0xb46e('0x2a')],'startProgressive':_0x1577a9[_0xb46e('0x2b')]};if(_0x1577a9[_0xb46e('0x7d')]){_0x37d151['Trunk']={'id':_0x1577a9['Trunk']['id'],'name':_0x1577a9[_0xb46e('0x7d')]['name'],'active':_0x1577a9[_0xb46e('0x7d')][_0xb46e('0x7e')],'callerid':_0x1577a9[_0xb46e('0x7d')][_0xb46e('0x7f')]};}if(_0x1577a9[_0xb46e('0x49')]){_0x37d151[_0xb46e('0x49')]={'id':_0x1577a9[_0xb46e('0x49')]['id'],'name':_0x1577a9['Interval'][_0xb46e('0x43')]};}var _0x591222=md5(JSON[_0xb46e('0x4c')](_0x37d151));if(_0x1577a9[_0xb46e('0x5')]!==_0x591222){_0x1577a9[_0xb46e('0x5')]=_0x591222;emit(util['format']('voice:queue:%s',_0x37d151[_0xb46e('0x43')]),'voice_queue:save',_0x37d151);}}}function emitCampaignSummary(_0x324483){if(_0x324483['type']===_0xb46e('0x80')){emit(util[_0xb46e('0x81')](_0xb46e('0x82'),_0x324483[_0xb46e('0x43')]),_0xb46e('0x83'),_0x324483);}}function checkGetDataPredictive(_0x33c28e){if(isNotNull(_0x33c28e)){if(!_[_0xb46e('0x84')](_0x33c28e)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xb46e('0x85')](_0xb46e('0x86'),_0x33c28e[_0xb46e('0x7a')]);loggerPredictive['info'](_0xb46e('0x87'),_0x33c28e[_0xb46e('0x71')]);loggerPredictive['info'](_0xb46e('0x88'),_0x33c28e['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0xb46e('0x89'),_0x33c28e['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xb46e('0x85')](_0xb46e('0x8a'),_0x33c28e[_0xb46e('0x72')]);loggerPredictive[_0xb46e('0x85')](_0xb46e('0x8b'),_0x33c28e[_0xb46e('0x73')]);loggerPredictive[_0xb46e('0x85')](_0xb46e('0x8c'));if(_0x33c28e['predictiveIntervalTotalCalls']>0x0){if(!_[_0xb46e('0x41')](_0x33c28e[_0xb46e('0x73')])&&_0x33c28e[_0xb46e('0x73')]>0x0){return!![];}else{loggerPredictive[_0xb46e('0x85')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0xb46e('0x41')](_0x33c28e[_0xb46e('0x72')])&&_0x33c28e[_0xb46e('0x72')]>0x0){return!![];}else{loggerPredictive[_0xb46e('0x85')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xb46e('0x85')](_0xb46e('0x8d'));}}else{loggerPredictive[_0xb46e('0x85')]('History\x20information\x20are\x20empty');}}else{loggerPredictive[_0xb46e('0x85')](_0xb46e('0x8e'));}return![];}function mergeDataErlangB(_0x4eb8b1){return function(_0x2e444e){loggerPredictive[_0xb46e('0x85')](_0xb46e('0x8f'));loggerPredictive[_0xb46e('0x85')](_0xb46e('0x90'),_0x2e444e[_0xb46e('0x91')]);loggerPredictive[_0xb46e('0x85')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e444e[_0xb46e('0x92')]);loggerPredictive['info'](_0xb46e('0x93'),_0x2e444e[_0xb46e('0x7b')]);loggerPredictive[_0xb46e('0x85')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e444e['erlangBusyFactor']);loggerPredictive[_0xb46e('0x85')](_0xb46e('0x93'),_0x2e444e[_0xb46e('0x7b')]);loggerPredictive['info'](_0xb46e('0x8c'));_['merge'](_0x4eb8b1,_0x2e444e);};}function getDiff(_0x454a3d){var _0x4b571d=moment()['milliseconds'](0x0);var _0x4009cd=moment(_0x454a3d)[_0xb46e('0x4d')](0x0);return _0x4b571d[_0xb46e('0x4e')](_0x4009cd,_0xb46e('0x4f'));}function ifInterval(_0xf4c0e9,_0x30e071){if(_['isUndefined'](_0x30e071)){return![];}if(getDiff(_0x30e071)<_0xf4c0e9*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x5ec4bd){if(isNotNull(_0x5ec4bd)){if(!_['isUndefined'](_0x5ec4bd[_0xb46e('0x2b')])){_0x5ec4bd[_0xb46e('0x2b')]=undefined;loggerPredictive[_0xb46e('0x85')](_0x5ec4bd['name'],_0xb46e('0x94'));}if(!_['isUndefined'](_0x5ec4bd['startPredictive'])){_0x5ec4bd[_0xb46e('0x2a')]=undefined;loggerPredictive[_0xb46e('0x85')](_0x5ec4bd[_0xb46e('0x43')],_0xb46e('0x95'));}if(!_[_0xb46e('0x41')](_0x5ec4bd[_0xb46e('0x96')])){clearInterval(_0x5ec4bd[_0xb46e('0x96')]);_0x5ec4bd[_0xb46e('0x96')]=undefined;loggerPredictive[_0xb46e('0x85')](_0x5ec4bd['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x36d9c0,_0x5bedca){if(_0x5bedca===0x0){return 0x0;}var _0x3afb65=0x1;for(var _0x471b93=0x1;_0x471b93<=_0x5bedca;_0x471b93+=0x1){_0x3afb65=0x1+_0x3afb65*_0x471b93/_0x36d9c0;}return 0x1/_0x3afb65;}function isVoiceQueueOutbound(_0x4b5869){return _0x4b5869===_0xb46e('0x52');}function isNotPreview(_0x54cda9){return _0x54cda9!==_0xb46e('0x21');}function isCampaignIvr(_0x29bb8e){return _0x29bb8e===_0xb46e('0x80');}function getCallerId(_0x4502af,_0x46a61d,_0x38e2db){if(!_[_0xb46e('0x41')](_0x38e2db)&&_0xb46e('0x97')===typeof _0x38e2db&&!_['isEmpty'](_0x38e2db)){if(!_[_0xb46e('0x41')](_0x46a61d)&&_0xb46e('0x97')===typeof _0x46a61d&&!_[_0xb46e('0x84')](_0x46a61d)){return util[_0xb46e('0x81')](_0xb46e('0x98'),_0x46a61d,_0x38e2db);}return util[_0xb46e('0x81')]('\x22%s\x22\x20<%s>',_0x38e2db,_0x38e2db);}if(!_[_0xb46e('0x41')](_0x4502af)&&_0xb46e('0x97')===typeof _0x4502af&&!_[_0xb46e('0x84')](_0x4502af)){return _0x4502af;}return _0xb46e('0x99');}function loggerCatchQueueSummary(_0xbfc5d9,_0x3a9c79){return function(_0x174891){freeVariablesPredictive(_0x3a9c79);emitVoiceQueueSummary(_0x3a9c79);emitCampaignSummary(_0x3a9c79);loggerSyncQueueSummary[_0xb46e('0x9a')](_0xbfc5d9,util[_0xb46e('0x9b')](_0x174891,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x51e053,_0x154111){return function(_0xb8f787){loggerPredictive['error'](_0x154111[_0xb46e('0x43')],_0x51e053);loggerPredictive[_0xb46e('0x9a')](_0xb8f787[_0xb46e('0x9c')]);freeVariablesPredictive(_0x154111);};}function loggerCatch(_0x20b923){return function(_0x2fcd9e){logger['error'](_0x20b923,util[_0xb46e('0x9b')](_0x2fcd9e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1b0e79){return _0x1b0e79&&!_[_0xb46e('0x41')](_0x1b0e79)&&_0x1b0e79[_0xb46e('0x9d')]>0x0;}function decremetOriginate(_0x109e54){if(!_['isUndefined'](_0x109e54)&&_0x109e54!==null){if(_0x109e54[_0xb46e('0x9e')](_0xb46e('0x9f'))){if(_0x109e54[_0xb46e('0x9f')]>0x0){_0x109e54[_0xb46e('0x9f')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xb46e('0x9a')](_0xb46e('0xa0'));}}function checkContactLowerLimitOriginate(_0x3b9a9b,_0x42ef87,_0x2d2022){if(_0x42ef87>_0x2d2022){for(var _0x5b7bfb=0x0;_0x5b7bfb<_0x42ef87-_0x2d2022;_0x5b7bfb+=0x1){decremetOriginate(_0x3b9a9b);}}}function loggerGetContactDialer(_0x453418,_0x1ece8e,_0x5b3433){return function(_0x353d0a){checkContactLowerLimitOriginate(_0x1ece8e,_0x5b3433,0x0);logger[_0xb46e('0x9a')](_0x453418,util[_0xb46e('0x9b')](_0x353d0a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x317d41){return function(_0x153fbb){if(isNotNull(_0x153fbb)&&isNotNull(_0x153fbb[0x0])){if(_0x153fbb[0x0]['contactsRescheduled']>0x0){_0x317d41['message']=_0xb46e('0xa1');logger[_0xb46e('0x85')](_0xb46e('0xa2')+_0x317d41['name'],_0x153fbb[0x0]['contactsRescheduled'],_0xb46e('0xa3'));}else{_0x317d41['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0xb46e('0x85')]('[getContactDialer2][Empty]'+_0x317d41['name']);}}};}function notSendMessagesQueue(_0x2535a7){if(_0x2535a7[_0xb46e('0xa4')]){freeVariablesPredictive(_0x2535a7);if(_0x2535a7[_0xb46e('0x9f')]===0x0&&_0x2535a7[_0xb46e('0x5a')]===0x0&&_0x2535a7[_0xb46e('0x5e')]===0x0&&(_0x2535a7['pTalking']||0x0)===0x0){_0x2535a7[_0xb46e('0xa4')]=![];_0x2535a7['available']=0x0;_0x2535a7[_0xb46e('0x45')]=_0xb46e('0x46');loggerSyncQueueSummary[_0xb46e('0x9a')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2535a7[_0xb46e('0x43')],_0xb46e('0xa5'));}else{_0x2535a7[_0xb46e('0x45')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xb46e('0x9a')](_0xb46e('0xa6'),_0x2535a7[_0xb46e('0x43')],_0xb46e('0xa7'));}emitVoiceQueueSummary(_0x2535a7);}}function notSendMessagesCampaign(_0x5c23c7){if(_0x5c23c7[_0xb46e('0xa4')]){if(_0x5c23c7[_0xb46e('0x9f')]===0x0){_0x5c23c7['sendMessageOneNotActive']=![];_0x5c23c7['message']=_0xb46e('0x46');loggerSyncQueueSummary[_0xb46e('0x9a')](_0xb46e('0xa8'),_0x5c23c7[_0xb46e('0x43')],_0xb46e('0xa5'));}else{_0x5c23c7['message']=_0xb46e('0xa9');loggerSyncQueueSummary[_0xb46e('0x9a')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5c23c7['name'],_0xb46e('0xa7'));}emitCampaignSummary(_0x5c23c7);}}function createObjHistory(_0x46def1,_0x2ad41d,_0xd6a629,_0x5d7fcc,_0x1c34ea){_0x46def1[_0xb46e('0x45')]=_0xd6a629;var _0x3196ac=new Action(_0x46def1,_0x2ad41d);var _0x530b9d=new History(_0x3196ac);_0x530b9d['state']=_0x5d7fcc;_0x530b9d['statedesc']=_0x1c34ea;_0x530b9d[_0xb46e('0xaa')]=_0x3196ac['starttime'];return _0x530b9d;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x36608d=this;setInterval(function(){_0x36608d[_0xb46e('0xab')](_0x36608d['uniqueId'],_0xb46e('0xac'));_0x36608d['clearZombieChannels'](_0x36608d[_0xb46e('0x27')],'[actions]');},0x32c8);};Dialer[_0xb46e('0x1d')][_0xb46e('0xab')]=function(_0x1f2366,_0x3cc2d9){var _0x10ebcc=this;for(var _0x150686 in _0x1f2366){if(_0x1f2366['hasOwnProperty'](_0x150686)){this[_0xb46e('0x20')][_0xb46e('0xad')](function(){if(!_[_0xb46e('0xae')](_0x1f2366[_0x150686])){return ami[_0xb46e('0xaf')]({'action':'status','channel':_0x1f2366[_0x150686][_0xb46e('0xb0')]})['catch'](function(_0x3beb9d){if(_0x3beb9d[_0xb46e('0x45')]===_0xb46e('0xb1')){setTimeout(function(){if(_0x1f2366[_0x150686]&&_0x1f2366[_0x150686]['type']!==_0xb46e('0x80')){_0x10ebcc[_0xb46e('0xb2')](_0x10ebcc['voiceQueues'][_0x1f2366[_0x150686]['queue']]);logger['error'](_0xb46e('0xb3'),_0x3cc2d9,_0x150686,_0x1f2366[_0x150686][_0xb46e('0xb4')]);delete _0x1f2366[_0x150686];}if(_0x1f2366[_0x150686]&&_0x1f2366[_0x150686][_0xb46e('0x51')]===_0xb46e('0x80')){_0x10ebcc[_0xb46e('0xb2')](_0x10ebcc[_0xb46e('0x23')][_0x1f2366[_0x150686][_0xb46e('0xb4')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x3cc2d9,_0x150686,_0x1f2366[_0x150686][_0xb46e('0xb4')]);delete _0x1f2366[_0x150686];}},0x2328);}});}});}}};Dialer[_0xb46e('0x1d')][_0xb46e('0xb5')]=function(_0x3a7257){return BPromise[_0xb46e('0xb6')]()['then'](cmHopper[_0xb46e('0xb5')](_0x3a7257))['catch'](loggerCatch(_0xb46e('0xb7')));};Dialer[_0xb46e('0x1d')][_0xb46e('0xb8')]=function(_0x44fca9){return BPromise[_0xb46e('0xb6')]()[_0xb46e('0xb9')](cmHopperBlack[_0xb46e('0xb8')](_0x44fca9))[_0xb46e('0xba')](loggerCatch(_0xb46e('0xbb')));};Dialer[_0xb46e('0x1d')][_0xb46e('0xbc')]=function(_0x17a363){return BPromise['resolve']()[_0xb46e('0xb9')](cmHopperBlack[_0xb46e('0xbc')](_0x17a363))[_0xb46e('0xba')](loggerCatch(_0xb46e('0xbd')));};Dialer[_0xb46e('0x1d')][_0xb46e('0xbe')]=function(_0x1a71a6){return BPromise['resolve']()[_0xb46e('0xb9')](cmHopperHistory['avgHandleTime'](_0x1a71a6))[_0xb46e('0xba')](loggerCatch(_0xb46e('0xbf')));};Dialer['prototype'][_0xb46e('0xc0')]=function(_0x496f9d){return BPromise['resolve']()[_0xb46e('0xb9')](cmHopper[_0xb46e('0xc0')](_0x496f9d))['catch'](loggerCatch(_0xb46e('0xc1')));};Dialer[_0xb46e('0x1d')][_0xb46e('0xc2')]=function(_0x3f4710,_0x55a659,_0x3a5db5){return BPromise[_0xb46e('0xb6')]()[_0xb46e('0xb9')](cmHopper[_0xb46e('0xc2')](_0x3f4710,_0x55a659,_0x3a5db5))[_0xb46e('0xba')](loggerCatch(_0xb46e('0xc3')));};Dialer['prototype']['getContactDialer']=function(_0x4e4b3b,_0xfced7a,_0x1815c5,_0x3022bc){return BPromise['resolve']()[_0xb46e('0xb9')](cmHopper[_0xb46e('0xc4')](_0x4e4b3b,_0xfced7a,_0x1815c5,_0x3022bc))[_0xb46e('0xba')](loggerCatch(_0xb46e('0xc5')));};Dialer[_0xb46e('0x1d')]['getContactDialerIvr']=function(_0x504d55,_0x443fe9,_0x249281){return BPromise[_0xb46e('0xb6')]()[_0xb46e('0xb9')](cmHopper[_0xb46e('0xc6')](_0x504d55,_0x443fe9,_0x249281))[_0xb46e('0xba')](loggerCatch(_0xb46e('0xc5')));};Dialer[_0xb46e('0x1d')][_0xb46e('0xc7')]=function(_0x280255){return BPromise[_0xb46e('0xb6')]()[_0xb46e('0xb9')](voiceQueueRt[_0xb46e('0xc7')](_0x280255))[_0xb46e('0xba')](loggerCatch(_0xb46e('0xc8')));};Dialer[_0xb46e('0x1d')]['moveContactManagedDialer']=function(_0x1a73d7){return BPromise['resolve']()[_0xb46e('0xb9')](cmHopper[_0xb46e('0xc9')](_0x1a73d7))[_0xb46e('0xba')](loggerCatch(_0xb46e('0xca')));};Dialer[_0xb46e('0x1d')]['createHistory']=function(_0x543ab1){return BPromise[_0xb46e('0xb6')]()[_0xb46e('0xb9')](cmHopperHistory[_0xb46e('0xcb')](_0x543ab1))[_0xb46e('0xba')](loggerCatch(_0xb46e('0xcc')));};Dialer['prototype'][_0xb46e('0xb2')]=function(_0x21d7f4){if(!_[_0xb46e('0x41')](_0x21d7f4)&&_0x21d7f4!==null){if(_0x21d7f4[_0xb46e('0x9e')](_0xb46e('0x9f'))){if(_0x21d7f4[_0xb46e('0x9f')]>0x0){_0x21d7f4[_0xb46e('0x9f')]-=0x1;}else{logger[_0xb46e('0x9a')](_0xb46e('0xcd'));}}}else{logger['error'](_0xb46e('0xce'));}};Dialer['prototype'][_0xb46e('0xcf')]=function(_0x55d292,_0x1d178a){var _0x139bfa=this;return function(_0x479ebc){_0x139bfa['updateOriginated'](_0x1d178a);logger[_0xb46e('0x9a')](_0x55d292,util['inspect'](_0x479ebc,{'showHidden':![],'depth':null}));};};Dialer[_0xb46e('0x1d')][_0xb46e('0xd0')]=function(_0x3f3572,_0x4c043b,_0x4af3cd){var _0x4e25ac={'state':0x19,'statedesc':'notFound'};this[_0xb46e('0xb2')](_0x4c043b);this['saveInDb'](_[_0xb46e('0xd1')](_0x4e25ac,_[_0xb46e('0xd2')](_0x4af3cd,[_0xb46e('0xd3'),'ListId',_0xb46e('0xd4'),'VoiceQueueId',_0xb46e('0xd5')])),_0xb46e('0xd6'),_0xb46e('0xd7'));logger['error'](_0x3f3572);};Dialer[_0xb46e('0x1d')][_0xb46e('0xd8')]=function(_0x1dfb52){return _0x1dfb52===_0xb46e('0xd9');};Dialer[_0xb46e('0x1d')][_0xb46e('0xda')]=function(_0x545372){return!_[_0xb46e('0x41')](_0x545372)&&_0x545372&&!_[_0xb46e('0x41')](_0x545372[_0xb46e('0x43')])&&!_[_0xb46e('0x41')](_0x545372['active'])&&_0x545372[_0xb46e('0x7e')]&&(this[_0xb46e('0x25')][util[_0xb46e('0x81')](_0xb46e('0xdb'),_0x545372[_0xb46e('0x43')])][_0xb46e('0xdc')]===_0xb46e('0xdd')||this[_0xb46e('0x25')][util[_0xb46e('0x81')](_0xb46e('0xdb'),_0x545372[_0xb46e('0x43')])][_0xb46e('0xdc')]==='unmonitored');};Dialer[_0xb46e('0x1d')][_0xb46e('0xde')]=function(_0x10ea1c,_0x4e9127,_0x4aa82e){this['createHistory'](_0x10ea1c)[_0xb46e('0xba')](loggerCatch(_0x4e9127));this[_0xb46e('0xc9')](_0x10ea1c)['catch'](loggerCatch(_0x4aa82e));};Dialer[_0xb46e('0x1d')]['syncVarSet']=function(_0x83a638){var _0x34cf8a=this[_0xb46e('0x28')][_0x83a638['uniqueid']];var _0x24f47e;if(!_[_0xb46e('0xae')](_0x83a638)&&!_[_0xb46e('0xae')](_0x83a638[_0xb46e('0xdf')])&&!_[_0xb46e('0xae')](_0x83a638[_0xb46e('0xdf')]['amdstatus'])&&_0x83a638[_0xb46e('0xe0')]===_0xb46e('0xe1')&&_0x34cf8a){if(_0x34cf8a[_0xb46e('0x51')]!=='ivr'&&this['voiceQueues'][_0x34cf8a['queue']]['dialAMDActive']&&_0x83a638[_0xb46e('0xe2')]==='HANGUP'){delete this['uniqueId'][_0x83a638['uniqueid']];this[_0xb46e('0xb2')](this[_0xb46e('0x22')][_0x34cf8a[_0xb46e('0xb4')]]);this['voiceQueues'][_0x34cf8a[_0xb46e('0xb4')]][_0xb46e('0x65')]+=0x1;this[_0xb46e('0x22')][_0x34cf8a['queue']][_0xb46e('0xe3')]+=0x1;_0x24f47e=new Hangup(_0x34cf8a,_0x83a638);_0x24f47e['state']=0x12;_0x24f47e[_0xb46e('0xe4')]='HangupInAMD';_0x24f47e[_0xb46e('0xe5')]='AMD';this[_0xb46e('0xde')](_0x24f47e,_0xb46e('0xe6'),_0xb46e('0xe7'));}if(_0x34cf8a[_0xb46e('0x51')]!==_0xb46e('0x80')&&this[_0xb46e('0x22')][_0x34cf8a[_0xb46e('0xb4')]][_0xb46e('0xe8')]&&_0x83a638[_0xb46e('0xe2')]===_0xb46e('0xe9')){delete this[_0xb46e('0x28')][_0x83a638[_0xb46e('0xea')]];this[_0xb46e('0xb2')](this[_0xb46e('0x22')][_0x34cf8a[_0xb46e('0xb4')]]);this[_0xb46e('0x22')][_0x34cf8a['queue']][_0xb46e('0x65')]+=0x1;this[_0xb46e('0x22')][_0x34cf8a[_0xb46e('0xb4')]][_0xb46e('0xe3')]+=0x1;_0x24f47e=new Hangup(_0x34cf8a,_0x83a638);_0x24f47e[_0xb46e('0xeb')]=0x13;_0x24f47e['statedesc']=_0xb46e('0xec');_0x24f47e[_0xb46e('0xe5')]=_0xb46e('0xed');_0x24f47e[_0xb46e('0xee')]=!![];this[_0xb46e('0xde')](_0x24f47e,_0xb46e('0xef'),_0xb46e('0xf0'));}if(_0x34cf8a[_0xb46e('0x51')]===_0xb46e('0x80')&&this[_0xb46e('0x23')][_0x34cf8a['queue']][_0xb46e('0xe8')]&&_0x83a638[_0xb46e('0xe2')]===_0xb46e('0xf1')){delete this[_0xb46e('0x28')][_0x83a638[_0xb46e('0xea')]];this['updateOriginated'](this[_0xb46e('0x23')][_0x34cf8a[_0xb46e('0xb4')]]);_0x24f47e=new Hangup(_0x34cf8a,_0x83a638);_0x24f47e[_0xb46e('0xeb')]=0x12;_0x24f47e[_0xb46e('0xe4')]='HangupInAMD';_0x24f47e[_0xb46e('0xe5')]=_0xb46e('0xed');this[_0xb46e('0xde')](_0x24f47e,'[syncHangupInAMDIvr][createHistory]',_0xb46e('0xf2'));}if(_0x34cf8a[_0xb46e('0x51')]===_0xb46e('0x80')&&this[_0xb46e('0x23')][_0x34cf8a[_0xb46e('0xb4')]][_0xb46e('0xe8')]&&_0x83a638[_0xb46e('0xe2')]===_0xb46e('0xe9')){delete this['uniqueId'][_0x83a638[_0xb46e('0xea')]];this[_0xb46e('0xb2')](this[_0xb46e('0x23')][_0x34cf8a[_0xb46e('0xb4')]]);_0x24f47e=new Hangup(_0x34cf8a,_0x83a638);_0x24f47e[_0xb46e('0xeb')]=0x13;_0x24f47e[_0xb46e('0xe4')]='Machine';_0x24f47e[_0xb46e('0xe5')]='AMD';_0x24f47e[_0xb46e('0xee')]=!![];this[_0xb46e('0xde')](_0x24f47e,_0xb46e('0xf3'),_0xb46e('0xf4'));}}};Dialer[_0xb46e('0x1d')][_0xb46e('0x38')]=function(_0x425bef){var _0x54150d=this['uniqueId'][_0x425bef['uniqueid']];var _0xcd16d4=this;var _0x4f1cce;if(_0x54150d&&_0x54150d[_0xb46e('0x51')]===_0xb46e('0x80')){delete this[_0xb46e('0x28')][_0x425bef[_0xb46e('0xea')]];this['updateOriginated'](this[_0xb46e('0x23')][_0x54150d[_0xb46e('0xb4')]]);this[_0xb46e('0x23')][_0x54150d[_0xb46e('0xb4')]][_0xb46e('0xf5')]+=0x1;_0x4f1cce=new Hangup(_0x54150d,_0x425bef);this['createHistory'](_0x4f1cce)[_0xb46e('0xba')](loggerCatch(_0xb46e('0xf6')));this[_0xb46e('0xc9')](_0x4f1cce)[_0xb46e('0xba')](loggerCatch(_0xb46e('0xf7')));}if(_0x54150d&&_0x54150d[_0xb46e('0x51')]!=='ivr'&&isNotNull(this[_0xb46e('0x22')][_0x54150d[_0xb46e('0xb4')]][_0xb46e('0xf8')])){delete this['uniqueId'][_0x425bef[_0xb46e('0xea')]];this[_0xb46e('0xb2')](this[_0xb46e('0x22')][_0x54150d[_0xb46e('0xb4')]]);this[_0xb46e('0x22')][_0x54150d[_0xb46e('0xb4')]]['outboundAnswerCallsDay']+=0x1;this[_0xb46e('0x22')][_0x54150d['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x4f1cce=new Hangup(_0x54150d,_0x425bef);_0x4f1cce['state']=0x10;_0x4f1cce[_0xb46e('0xe4')]='AnswerAGI';_0x4f1cce[_0xb46e('0xe5')]=_0xb46e('0xf9');this[_0xb46e('0xcb')](_0x4f1cce)['catch'](loggerCatch(_0xb46e('0xf6')));this['moveContactManagedDialer'](_0x4f1cce)['catch'](loggerCatch(_0xb46e('0xf7')));}if(_0x54150d&&_0x54150d['type']!==_0xb46e('0x80')&&!isNotNull(this[_0xb46e('0x22')][_0x54150d[_0xb46e('0xb4')]][_0xb46e('0xf8')])){delete this[_0xb46e('0x28')][_0x425bef[_0xb46e('0xea')]];this[_0xb46e('0xb2')](this[_0xb46e('0x22')][_0x54150d[_0xb46e('0xb4')]]);this[_0xb46e('0x22')][_0x54150d[_0xb46e('0xb4')]][_0xb46e('0x70')]+=0x1;_0x4f1cce=new Hangup(_0x54150d,_0x425bef);_0x4f1cce['state']=0xc;_0x4f1cce['statedesc']=_0x425bef[_0xb46e('0xfa')];_0x4f1cce[_0xb46e('0xe5')]=_0xb46e('0xfb');this['createHistory'](_0x4f1cce)['catch'](loggerCatch(_0xb46e('0xf6')));this[_0xb46e('0xc9')](_0x4f1cce)[_0xb46e('0xba')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xb46e('0x1d')][_0xb46e('0x35')]=function(_0x2df17a){var _0x5e9d7b=this[_0xb46e('0x28')][_0x2df17a[_0xb46e('0xea')]];var _0x140ec7=this;if(this[_0xb46e('0x22')][_0x2df17a[_0xb46e('0xb4')]]){if(_0x5e9d7b&&_0x5e9d7b['type']!==_0xb46e('0x80')){delete this[_0xb46e('0x28')][_0x2df17a[_0xb46e('0xea')]];this[_0xb46e('0x22')][_0x2df17a[_0xb46e('0xb4')]]['outboundAnswerCallsDay']+=0x1;var _0x2dbd16=new AgentComplete(_0x5e9d7b,_0x2df17a);if(_0x2df17a[_0xb46e('0xfc')]==='agent'){_0x2dbd16['agiafterat']=this['voiceQueues'][_0x2df17a[_0xb46e('0xb4')]][_0xb46e('0xfd')]&&this[_0xb46e('0x22')][_0x2df17a[_0xb46e('0xb4')]]['dialAgiAfterHangupAgent']?moment()[_0xb46e('0x81')](_0xb46e('0xfe')):undefined;}this[_0xb46e('0xcb')](_0x2dbd16)[_0xb46e('0xba')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x2dbd16)[_0xb46e('0xba')](loggerCatch(_0xb46e('0xff')));}}};Dialer[_0xb46e('0x1d')][_0xb46e('0x100')]=function(_0x2230dc){if(this['voiceQueues'][_0x2230dc['queue']]){if(this['uniqueId'][_0x2230dc[_0xb46e('0xea')]]&&this[_0xb46e('0x28')][_0x2230dc['uniqueid']][_0xb46e('0x51')]!==_0xb46e('0x80')){this[_0xb46e('0xb2')](this['voiceQueues'][_0x2230dc[_0xb46e('0xb4')]]);this[_0xb46e('0x28')][_0x2230dc[_0xb46e('0xea')]][_0xb46e('0x101')]=moment()[_0xb46e('0x81')](_0xb46e('0xfe'));}}};Dialer[_0xb46e('0x1d')][_0xb46e('0x102')]=function(_0x44d16c){this['createHistory'](_0x44d16c)['catch'](loggerCatch(_0xb46e('0x103')));this[_0xb46e('0xc9')](_0x44d16c)[_0xb46e('0xba')](loggerCatch(_0xb46e('0x104')));};Dialer[_0xb46e('0x1d')]['syncQueueCallerAbandon']=function(_0x136e2f){var _0x4877f2=this[_0xb46e('0x28')][_0x136e2f[_0xb46e('0xea')]];var _0x1b7aa1=this;if(this[_0xb46e('0x22')][_0x136e2f[_0xb46e('0xb4')]]){if(_0x4877f2&&_0x4877f2[_0xb46e('0x51')]!==_0xb46e('0x80')){delete this[_0xb46e('0x28')][_0x136e2f[_0xb46e('0xea')]];this[_0xb46e('0xb2')](this['voiceQueues'][_0x136e2f['queue']]);_0x4877f2['droptime']=moment()['format'](_0xb46e('0xfe'));var _0x5210c2=new QueueCallerAbandon(_0x4877f2,_0x136e2f);if(getSeconds(_0x4877f2[_0xb46e('0x105')],_0x4877f2[_0xb46e('0x106')])>=_0x4877f2[_0xb46e('0x107')]){this[_0xb46e('0x22')][_0x136e2f[_0xb46e('0xb4')]][_0xb46e('0x75')]+=0x1;this[_0xb46e('0x22')][_0x136e2f['queue']][_0xb46e('0x6b')]+=0x1;this['voiceQueues'][_0x136e2f[_0xb46e('0xb4')]][_0xb46e('0x76')]+=0x1;_0x5210c2[_0xb46e('0xeb')]=0xa;_0x5210c2['statedesc']=_0xb46e('0x108');_0x5210c2[_0xb46e('0x109')]='TIMEOUT';_0x5210c2[_0xb46e('0x10a')]=this[_0xb46e('0x22')][_0x136e2f[_0xb46e('0xb4')]]['dialQueueProject2']?moment()[_0xb46e('0x81')](_0xb46e('0xfe')):undefined;if(_0x5210c2['countdropretry']>=this[_0xb46e('0x22')][_0x136e2f[_0xb46e('0xb4')]][_0xb46e('0x10b')]-0x1){this[_0xb46e('0x102')](_0x5210c2);}else{this[_0xb46e('0xc0')]({'active':![],'countdropretry':_0x5210c2[_0xb46e('0x10c')]+=0x1,'scheduledat':moment()['add'](this[_0xb46e('0x22')][_0x136e2f[_0xb46e('0xb4')]][_0xb46e('0x10d')],_0xb46e('0x10e'))['format'](_0xb46e('0xfe')),'ContactId':_0x4877f2[_0xb46e('0xd3')],'ListId':_0x4877f2[_0xb46e('0x10f')],'VoiceQueueId':_0x4877f2[_0xb46e('0x110')]||undefined,'CampaignId':_0x4877f2[_0xb46e('0xd5')]||undefined})['catch'](loggerCatch(_0xb46e('0x111')));}}else{this[_0xb46e('0x22')][_0x136e2f[_0xb46e('0xb4')]][_0xb46e('0x74')]+=0x1;this[_0xb46e('0x22')][_0x136e2f['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x5210c2[_0xb46e('0xeb')]=0xb;_0x5210c2['statedesc']=_0xb46e('0x112');_0x5210c2['dropreason']=_0xb46e('0x113');if(_0x5210c2[_0xb46e('0x114')]>=this['voiceQueues'][_0x136e2f['queue']][_0xb46e('0x115')]-0x1){this['queueCallerAbandonCreateState'](_0x5210c2);}else{this[_0xb46e('0xc0')]({'active':![],'countabandonedretry':_0x5210c2[_0xb46e('0x114')]+=0x1,'scheduledat':moment()['add'](this[_0xb46e('0x22')][_0x136e2f[_0xb46e('0xb4')]][_0xb46e('0x116')],_0xb46e('0x10e'))['format'](_0xb46e('0xfe')),'ContactId':_0x4877f2['ContactId'],'ListId':_0x4877f2[_0xb46e('0x10f')],'VoiceQueueId':_0x4877f2['VoiceQueueId']||undefined,'CampaignId':_0x4877f2[_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch('[rescheduleContact][Abandoned]'));}}}}};Dialer['prototype'][_0xb46e('0x3a')]=function(_0x96c35d){if(this['actions'][_0x96c35d[_0xb46e('0xea')]]){this[_0xb46e('0x27')][_0x96c35d[_0xb46e('0xea')]][_0xb46e('0xb0')]=_0x96c35d['channel'];}if(this[_0xb46e('0x28')][_0x96c35d[_0xb46e('0xea')]]){this[_0xb46e('0x28')][_0x96c35d[_0xb46e('0xea')]][_0xb46e('0xb0')]=_0x96c35d[_0xb46e('0xb0')];}};Dialer['prototype'][_0xb46e('0x117')]=function(_0x2947d4){if(strategy[this[_0xb46e('0x22')][this[_0xb46e('0x27')][_0x2947d4['actionid']][_0xb46e('0xb4')]][_0xb46e('0x53')]]===_0xb46e('0x1c')){if(this[_0xb46e('0x27')][_0x2947d4[_0xb46e('0x118')]]&&_[_0xb46e('0xae')](this[_0xb46e('0x27')][_0x2947d4[_0xb46e('0x118')]]['locked'])&&_0x2947d4['status']==='1'&&_0x2947d4[_0xb46e('0x119')]==='0'){if(this[_0xb46e('0x24')][_0x2947d4[_0xb46e('0x11a')]]){if(!this['agents'][_0x2947d4[_0xb46e('0x11a')]]['locked']){this[_0xb46e('0x24')][_0x2947d4[_0xb46e('0x11a')]]['locked']=!![];this[_0xb46e('0x27')][_0x2947d4[_0xb46e('0x118')]][_0xb46e('0x11b')]=!![];this[_0xb46e('0x27')][_0x2947d4[_0xb46e('0x118')]][_0xb46e('0x11a')]=_0x2947d4['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0xb46e('0x27')][_0x2947d4['actionid']][_0xb46e('0xb4')]][_0xb46e('0x53')]]||'rrmemory')===_0xb46e('0x11c')){if(this[_0xb46e('0x27')][_0x2947d4[_0xb46e('0x118')]]){if(this[_0xb46e('0x24')][_0x2947d4[_0xb46e('0x11a')]]){this[_0xb46e('0x27')][_0x2947d4[_0xb46e('0x118')]][_0xb46e('0x11a')]=_0x2947d4[_0xb46e('0x11a')];if(_[_0xb46e('0xae')](this[_0xb46e('0x2d')][this['actions'][_0x2947d4['actionid']][_0xb46e('0xb4')]])){this[_0xb46e('0x2d')][this[_0xb46e('0x27')][_0x2947d4[_0xb46e('0x118')]]['queue']]=[];}this['queueBooked'][this[_0xb46e('0x27')][_0x2947d4['actionid']][_0xb46e('0xb4')]][_0xb46e('0x11d')](_[_0xb46e('0xd1')](_[_0xb46e('0xd2')](this[_0xb46e('0x27')][_0x2947d4['actionid']],[_0xb46e('0x11e'),'stateinterface']),{'status':_0x2947d4[_0xb46e('0xdc')],'paused':_0x2947d4[_0xb46e('0x119')]}));}}}};function unlockQueueStatus(_0x37cc69,_0x1905ea){setTimeout(function(){if(_['isUndefined'](_0x37cc69[_0xb46e('0x11f')])){loggerBooked[_0xb46e('0x9a')](_0xb46e('0x120'),_0x1905ea);}_0x37cc69[_0xb46e('0x11f')]=!![];loggerBooked[_0xb46e('0x85')]('[booked][unlockQueueStatus]',_0x1905ea,JSON[_0xb46e('0x4c')](_[_0xb46e('0xd2')](_0x37cc69,[_0xb46e('0x43'),_0xb46e('0x11f')])));},0x1f3);}Dialer[_0xb46e('0x1d')]['syncQueueStatusComplete']=function(_0x27f31a){var _0x58aa3c=this;var _0x3b5639=_0x58aa3c['voiceQueues'][_0x58aa3c[_0xb46e('0x27')][_0x27f31a['actionid']][_0xb46e('0xb4')]];if(strategy[this[_0xb46e('0x22')][this[_0xb46e('0x27')][_0x27f31a['actionid']][_0xb46e('0xb4')]][_0xb46e('0x53')]]===_0xb46e('0x1c')){if(this['actions'][_0x27f31a[_0xb46e('0x118')]]&&this[_0xb46e('0x27')][_0x27f31a[_0xb46e('0x118')]][_0xb46e('0x11a')]){this[_0xb46e('0x21')][_0xb46e('0x121')](this[_0xb46e('0x27')][_0x27f31a[_0xb46e('0x118')]][_0xb46e('0x11e')],this['actions'][_0x27f31a[_0xb46e('0x118')]][_0xb46e('0x11a')])[_0xb46e('0xba')](function(_0x1f2739){logger[_0xb46e('0x9a')](_0xb46e('0x122'),util['inspect'](_0x1f2739,{'showHidden':![],'depth':null}));})[_0xb46e('0x1f')](function(){_0x58aa3c['updateOriginated'](_0x58aa3c['voiceQueues'][_0x58aa3c[_0xb46e('0x27')][_0x27f31a[_0xb46e('0x118')]][_0xb46e('0xb4')]]);_0x58aa3c['agents'][_0x58aa3c[_0xb46e('0x27')][_0x27f31a[_0xb46e('0x118')]][_0xb46e('0x11a')]]['locked']=![];delete _0x58aa3c[_0xb46e('0x27')][_0x27f31a[_0xb46e('0x118')]];unlockQueueStatus(_0x3b5639);});}else{this[_0xb46e('0xb2')](this['voiceQueues'][this[_0xb46e('0x27')][_0x27f31a['actionid']][_0xb46e('0xb4')]]);this[_0xb46e('0xc0')]({'active':![],'ContactId':this['actions'][_0x27f31a[_0xb46e('0x118')]][_0xb46e('0xd3')],'ListId':this[_0xb46e('0x27')][_0x27f31a[_0xb46e('0x118')]][_0xb46e('0x10f')],'VoiceQueueId':this[_0xb46e('0x27')][_0x27f31a['actionid']][_0xb46e('0x110')]||undefined,'CampaignId':this['actions'][_0x27f31a[_0xb46e('0x118')]]['CampaignId']||undefined})['catch'](loggerCatch(_0xb46e('0x123')));delete this[_0xb46e('0x27')][_0x27f31a[_0xb46e('0x118')]];unlockQueueStatus(_0x3b5639);}}else if((strategy[this['voiceQueues'][this['actions'][_0x27f31a[_0xb46e('0x118')]]['queue']][_0xb46e('0x53')]]||'rrmemory')==='rrmemory'){var _0xf5161c;if(this[_0xb46e('0x27')][_0x27f31a['actionid']]&&!_[_0xb46e('0x84')](this[_0xb46e('0x2d')][this[_0xb46e('0x27')][_0x27f31a['actionid']][_0xb46e('0xb4')]])){if(this[_0xb46e('0x2e')][_0x58aa3c[_0xb46e('0x27')][_0x27f31a['actionid']][_0xb46e('0xb4')]]){this[_0xb46e('0x2e')][_0x58aa3c[_0xb46e('0x27')][_0x27f31a['actionid']][_0xb46e('0xb4')]]=this[_0xb46e('0x2e')][this['actions'][_0x27f31a['actionid']][_0xb46e('0xb4')]]?this[_0xb46e('0x2e')][this[_0xb46e('0x27')][_0x27f31a[_0xb46e('0x118')]][_0xb46e('0xb4')]]:this[_0xb46e('0x2d')][this['actions'][_0x27f31a[_0xb46e('0x118')]][_0xb46e('0xb4')]]?this[_0xb46e('0x2d')][this['actions'][_0x27f31a[_0xb46e('0x118')]][_0xb46e('0xb4')]][_0xb46e('0x124')]||0x0:0x0;}this[_0xb46e('0x2d')][this[_0xb46e('0x27')][_0x27f31a[_0xb46e('0x118')]]['queue']][_0xb46e('0x124')]=this[_0xb46e('0x2e')][this[_0xb46e('0x27')][_0x27f31a['actionid']][_0xb46e('0xb4')]];for(var _0x49096f=0x0;_0x49096f=0x0?!![]:![];})[_0xb46e('0xba')](myreject(_0x236d6d)));}}else{_0x3c0cfc[_0xb46e('0x11d')](ami[_0xb46e('0xaf')]({'action':_0xb46e('0x13b'),'command':util[_0xb46e('0x81')](_0xb46e('0x13c'),_0x19c5e9,!_[_0xb46e('0x41')](config[_0xb46e('0x138')][_0x27a2cc])?_0x27a2cc:'')})[_0xb46e('0xb9')](function(_0x513b7f){return _0x513b7f[_0xb46e('0x13f')][_0xb46e('0x13e')](_0xb46e('0x140'))>=0x0?!![]:![];})['catch'](myreject(_0x236d6d)));}BPromise['all'](_0x3c0cfc)[_0xb46e('0xb9')](function(_0x48becd){var _0x3581f2=_[_0xb46e('0x141')](_0x48becd);if(_0x3581f2){return _0x47aed7(_0x3581f2);}else{_0xfbe1fc[_0xb46e('0x45')]=_0x12cfb6?_0xb46e('0x142'):'INTERVAL_IS_OVERTIME';return _0x236d6d(msgResponse(_0xb46e('0x143'),_0xb46e('0x135'),_0xb46e('0x144')+_0x12cfb6+'\x20'+_0x16adc9+_0xb46e('0x145')+util[_0xb46e('0x9b')](_0x19c5e9,{'showHidden':![],'depth':null})+_0xb46e('0x146')+_0x27a2cc));}})['catch'](function(_0x2c29ca){return _0x236d6d(msgResponse('ifTime',_0xb46e('0x135'),JSON[_0xb46e('0x4c')](_0x2c29ca)));});});};Dialer[_0xb46e('0x1d')]['checkDialMethod']=function(_0x472931){var _0x124f4a=this;return function(){switch(_0x472931[_0xb46e('0x60')]){case _0xb46e('0x147'):freeVariablesPredictive(_0x472931);_0x124f4a[_0xb46e('0x148')](_0x472931,0x1);break;case _0xb46e('0x149'):freeVariablesPredictive(_0x472931);_0x124f4a[_0xb46e('0x148')](_0x472931,_0x472931[_0xb46e('0x14a')]);break;case _0xb46e('0xa'):_0x124f4a[_0xb46e('0xa')](_0x472931);break;case _0xb46e('0x9'):freeVariablesPredictive(_0x472931);_0x124f4a[_0xb46e('0x148')](_0x472931,0x1);break;default:freeVariablesPredictive(_0x472931);logger[_0xb46e('0x9a')](_0xb46e('0x14b'),_0x472931[_0xb46e('0x43')],_0xb46e('0x14c'));}};};Dialer[_0xb46e('0x1d')][_0xb46e('0x14d')]=function(_0x1ffc0a){var _0x25e6cf=this;return function(){_0x25e6cf[_0xb46e('0x14e')](_0x1ffc0a);};};Dialer[_0xb46e('0x1d')]['syncQueueSummary']=function(_0x3c7eec){var _0x4dce3a=this;if(isNotPreview(_0x3c7eec[_0xb46e('0x60')])){if(isVoiceQueueOutbound(_0x3c7eec[_0xb46e('0x51')])&&isActive(_0x3c7eec['dialActive'])){_0x3c7eec[_0xb46e('0xa4')]=!![];BPromise[_0xb46e('0xb6')]()['then'](checkIsLoggedIn(_0x3c7eec,_0x3c7eec[_0xb46e('0x55')]))[_0xb46e('0xb9')](checkIsActive(_0x3c7eec,_0x3c7eec[_0xb46e('0x14f')]))['then'](checkInterval(_0x3c7eec))[_0xb46e('0xb9')](_0x4dce3a[_0xb46e('0x130')](_0x3c7eec))[_0xb46e('0xb9')](_0x4dce3a[_0xb46e('0x150')](_0x3c7eec[_0xb46e('0x151')],_0x3c7eec[_0xb46e('0x152')],_0x3c7eec[_0xb46e('0x43')],_0x3c7eec))['then'](_0x4dce3a['checkIfTimeIntervals'](_0x3c7eec['Interval'],_0x3c7eec[_0xb46e('0x152')],_0x3c7eec['name'],_0x3c7eec))[_0xb46e('0xb9')](_0x4dce3a[_0xb46e('0x153')](_0x3c7eec))[_0xb46e('0xba')](loggerCatchQueueSummary('[syncQueueSummary]',_0x3c7eec));}else{notSendMessagesQueue(_0x3c7eec);}}else{freeVariablesPredictive(_0x3c7eec);}};Dialer[_0xb46e('0x1d')][_0xb46e('0x12f')]=function(){var _0x13f9a9=this;var _0x2e3140;for(var _0x12e964 in this['campaigns']){if(this['campaigns'][_0xb46e('0x9e')](_0x12e964)){_0x2e3140=this[_0xb46e('0x23')][_0x12e964];if(isCampaignIvr(_0x2e3140[_0xb46e('0x51')])&&isActive(_0x2e3140[_0xb46e('0x7e')])){_0x2e3140['sendMessageOneNotActive']=!![];BPromise[_0xb46e('0xb6')]()[_0xb46e('0xb9')](checkIsActive(_0x2e3140,_0x2e3140[_0xb46e('0x7e')]))[_0xb46e('0xb9')](checkInterval(_0x2e3140))[_0xb46e('0xb9')](_0x13f9a9['checkIsTrunkReachable'](_0x2e3140))[_0xb46e('0xb9')](_0x13f9a9[_0xb46e('0x150')](_0x2e3140[_0xb46e('0x151')],_0x2e3140[_0xb46e('0x152')],_0x2e3140[_0xb46e('0x43')],_0x2e3140))['then'](_0x13f9a9[_0xb46e('0x134')](_0x2e3140[_0xb46e('0x49')],_0x2e3140[_0xb46e('0x152')],_0x2e3140[_0xb46e('0x43')],_0x2e3140))[_0xb46e('0xb9')](_0x13f9a9['launchHandleIvr'](_0x2e3140))[_0xb46e('0xba')](loggerCatchQueueSummary(_0xb46e('0x154'),_0x2e3140));}else{notSendMessagesCampaign(_0x2e3140);}}}};function getCallerIdRandom(_0x3bfd06,_0x391087){var _0x272557,_0x53cf81,_0x2ad38;if(_0x391087<=0x0){_0x391087=0x1;}_0x272557=new RegExp(_0xb46e('0x155')+_0x391087+'}$');_0x53cf81=Math[_0xb46e('0x156')](0xa,_0x391087-0x1);_0x2ad38=Math['pow'](0xa,_0x391087)-0x1;return util[_0xb46e('0x81')]('%s',_[_0xb46e('0x157')](_0x3bfd06,_0x272557,_[_0xb46e('0x158')](_0x53cf81,_0x2ad38)));}function extractCalleridName(_0x3f397b){var _0x2b76cc=_0x3f397b[_0xb46e('0x159')](/"(.*?)"/);return _0x2b76cc?_0x2b76cc[0x1]:_0x3f397b;}function extractCalleridNumber(_0x4108bf){var _0x2f5553=_0x4108bf['match'](/<(.*?)>/);return _0x2f5553?_0x2f5553[0x1]:_0x4108bf;}Dialer[_0xb46e('0x1d')]['actionOriginate']=function(_0x353d8f,_0x4ebad7){var _0x5e1948=this;var _0x108d59=uuid['v4']();this['actions'][_0x108d59]=new Action(_0x353d8f,_0x4ebad7,_0x108d59);return new BPromise(function(_0x5102ce,_0x5c0cf9){if(_[_0xb46e('0x41')](_0x353d8f)&&_0xb46e('0x15a')!==typeof _0x353d8f){return _0x5c0cf9(msgResponse('originate',_0xb46e('0x135'),_0xb46e('0x15b')));}if(_[_0xb46e('0x41')](_0x4ebad7[_0xb46e('0x15c')][_0xb46e('0x15d')])||_0x4ebad7[_0xb46e('0x15c')][_0xb46e('0x15d')]===null){return _0x5c0cf9(msgResponse('originate',_0xb46e('0x135'),'contact\x20is\x20undefine'));}var _0x226ce2={'XMD-CALLERID':_0x5e1948['actions'][_0x108d59]['getCaller'](),'XMD-AGI':_0x353d8f['dialQueueProject']?util[_0xb46e('0x81')](_0xb46e('0x15e'),ipAgi,_0x353d8f[_0xb46e('0xf8')]):_0xb46e('0x15f'),'XMD-AGIAFTER':_0x353d8f[_0xb46e('0xfd')]?util[_0xb46e('0x81')](_0xb46e('0x15e'),ipAgi,_0x353d8f[_0xb46e('0xfd')]):_0xb46e('0x15f'),'XMD-QUEUE':_0x353d8f[_0xb46e('0x51')]===_0xb46e('0x52')?util[_0xb46e('0x81')]('\x22%s,%s%s,,,%s\x22',_0x353d8f[_0xb46e('0x43')],_0x353d8f[_0xb46e('0x160')]||'',_0x353d8f[_0xb46e('0x161')]?'c':'',_0x353d8f['dialQueueTimeout']||0x3):_0xb46e('0x15f'),'XMD-CONTACTID':_0x4ebad7[_0xb46e('0xd3')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5e1948[_0xb46e('0x27')][_0x108d59]['getCaller'](),'XMD-AMD':_0x353d8f[_0xb46e('0xe8')]?'ACTIVE':_0xb46e('0x15f'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x353d8f[_0xb46e('0xe8')]){_0x226ce2[_0xb46e('0x162')]=_0x353d8f['dialAMDInitialSilence']||0x9c4;_0x226ce2[_0xb46e('0x163')]=_0x353d8f['dialAMDGreeting']||0x5dc;_0x226ce2[_0xb46e('0x164')]=_0x353d8f[_0xb46e('0x165')]||0x320;_0x226ce2[_0xb46e('0x166')]=_0x353d8f[_0xb46e('0x167')]||0x1388;_0x226ce2[_0xb46e('0x168')]=_0x353d8f['dialAMDMinWordLength']||0x64;_0x226ce2[_0xb46e('0x169')]=_0x353d8f['dialAMDBetweenWordsSilence']||0x32;_0x226ce2[_0xb46e('0x16a')]=_0x353d8f['dialAMDMaximumNumberOfWords']||0x3;_0x226ce2[_0xb46e('0x16b')]=_0x353d8f[_0xb46e('0x16c')]||0x100;_0x226ce2['XMD-AMDMAXIMUMWORDLENGTH']=_0x353d8f['dialAMDMaximumWordLength']||0x1388;}if(_0x353d8f['type']===_0xb46e('0x52')){_0x226ce2['XMD-VOICEQUEUEID']=_0x4ebad7[_0xb46e('0x110')];}else{_0x226ce2[_0xb46e('0x16d')]=_0x4ebad7[_0xb46e('0xd5')];}for(var _0x4a5b9a in _0x4ebad7[_0xb46e('0x15c')]){if(_0x4ebad7[_0xb46e('0x15c')][_0xb46e('0x9e')](_0x4a5b9a)){if(isNotNull(_0x4ebad7[_0xb46e('0x15c')][_0x4a5b9a])&&_0x4a5b9a!=='id'&&_0x4a5b9a!=='tags'&&_0x4a5b9a!==_0xb46e('0x16e')&&_0x4a5b9a!==_0xb46e('0x16f')){_0x226ce2[util['format'](_0xb46e('0x170'),_0xb46e('0x171'),_[_0xb46e('0x172')](_0x4a5b9a))]=_0x4ebad7[_0xb46e('0x15c')][_0x4a5b9a];}}}var _0x417dac=_0x5e1948[_0xb46e('0xda')](_0x353d8f[_0xb46e('0x7d')])?getCallerId(_0x353d8f[_0xb46e('0x7d')][_0xb46e('0x7f')],_0x353d8f[_0xb46e('0x61')],_0x353d8f[_0xb46e('0x173')]>0x0?getCallerIdRandom(_0x353d8f[_0xb46e('0x62')],_0x353d8f[_0xb46e('0x173')]):_0x353d8f['dialOriginateCallerIdNumber']):getCallerId(_[_0xb46e('0xae')](_0x353d8f['TrunkBackup'])?_0x353d8f[_0xb46e('0x7d')][_0xb46e('0x7f')]:_0x353d8f['TrunkBackup'][_0xb46e('0x7f')],_0x353d8f[_0xb46e('0x61')],_0x353d8f[_0xb46e('0x173')]>0x0?getCallerIdRandom(_0x353d8f[_0xb46e('0x62')],_0x353d8f[_0xb46e('0x173')]):_0x353d8f[_0xb46e('0x62')]);if(_0x417dac){_0x226ce2['XMD-ORIGINATECALLERIDNAME']=_0x5e1948['actions'][_0x108d59][_0xb46e('0x174')]=extractCalleridName(_0x417dac);_0x226ce2['XMD-ORIGINATECALLERIDNUM']=_0x5e1948['actions'][_0x108d59][_0xb46e('0x175')]=extractCalleridNumber(_0x417dac);}return ami[_0xb46e('0xaf')]({'actionid':_0x108d59,'action':_0xb46e('0x176'),'channel':_0x5e1948[_0xb46e('0xda')](_0x353d8f[_0xb46e('0x7d')])?util[_0xb46e('0x81')](_0xb46e('0x177'),_0x353d8f[_0xb46e('0x7d')][_0xb46e('0x43')],isNotNull(_0x353d8f[_0xb46e('0x64')])?_0x353d8f[_0xb46e('0x64')][_0xb46e('0x178')]()||'':'',_0x353d8f[_0xb46e('0x179')]>0x0?_0x4ebad7[_0xb46e('0x15c')][_0xb46e('0x15d')][_0xb46e('0x17a')](_0x353d8f[_0xb46e('0x179')]):_0x4ebad7[_0xb46e('0x15c')][_0xb46e('0x15d')]):util[_0xb46e('0x81')](_0xb46e('0x177'),_[_0xb46e('0xae')](_0x353d8f['TrunkBackup'])?_0x353d8f[_0xb46e('0x7d')][_0xb46e('0x43')]:_0x353d8f[_0xb46e('0x131')]['name'],isNotNull(_0x353d8f[_0xb46e('0x64')])?_0x353d8f[_0xb46e('0x64')][_0xb46e('0x178')]()||'':'',_0x353d8f[_0xb46e('0x179')]>0x0?_0x4ebad7[_0xb46e('0x15c')]['phone']['substring'](_0x353d8f[_0xb46e('0x179')]):_0x4ebad7[_0xb46e('0x15c')]['phone']),'callerid':_0x417dac,'Exten':_0xb46e('0xe1'),'Context':'from-sip','Priority':'1','variable':_0x226ce2,'timeout':(_0x353d8f[_0xb46e('0x63')]||0x1e)*0x3e8,'async':!![],'channelid':_0x108d59})['then'](function(_0x5bb950){return _0x5102ce(_0x5bb950);})['catch'](function(_0x5d844b){_0x353d8f['outboundOriginateFailureCallsDay']+=0x1;var _0x40cd5d=new History(_0x5e1948[_0xb46e('0x27')][_0x108d59]);logger[_0xb46e('0x9a')](util[_0xb46e('0x81')](_0xb46e('0x17b'),JSON[_0xb46e('0x4c')](_0x5d844b)));_0x40cd5d['state']=0xe;_0x40cd5d[_0xb46e('0xe4')]=_0xb46e('0x17c');_0x40cd5d[_0xb46e('0x17d')]=moment()[_0xb46e('0x81')](_0xb46e('0xfe'));_0x40cd5d[_0xb46e('0xaa')]=_0x40cd5d[_0xb46e('0x17d')];_0x5e1948[_0xb46e('0xcb')](_0x40cd5d)[_0xb46e('0xba')](loggerCatch('[originate][error]'));_0x5e1948[_0xb46e('0xc9')](_0x40cd5d)[_0xb46e('0xba')](loggerCatch(_0xb46e('0x17e')))[_0xb46e('0x1f')](function(){delete _0x5e1948[_0xb46e('0x27')][_0x108d59];return _0x5c0cf9(msgResponse(_0xb46e('0x176'),_0xb46e('0x17f'),_0xb46e('0x180')));});});});};Dialer[_0xb46e('0x1d')][_0xb46e('0x33')]=function(_0x476799){var _0x43a00a=this[_0xb46e('0x27')][_0x476799['actionid']];var _0x480e6f=this;if(_0x43a00a){delete this['actions'][_0x476799['actionid']];_0x43a00a[_0xb46e('0x106')]=moment()[_0xb46e('0x81')](_0xb46e('0xfe'));var _0x1aad02=_0x43a00a[_0xb46e('0x51')]==='ivr'?this['campaigns'][_0x43a00a[_0xb46e('0xb4')]]:this[_0xb46e('0x22')][_0x43a00a[_0xb46e('0x181')]()];if(!this[_0xb46e('0xd8')](_0x476799[_0xb46e('0x182')])){this[_0xb46e('0xb2')](_0x1aad02);return this[_0xb46e('0x183')](_0x43a00a,_0x1aad02,_0x476799)['then'](function(_0x3d55bc){})[_0xb46e('0xba')](loggerCatch('[callProgressDetecting]\x20'));}else{this['uniqueId'][_0x476799[_0xb46e('0xea')]]=_0x43a00a;}}};Dialer['prototype']['checkRetriveMax']=function(_0x5c3e2d,_0x212bf5,_0x69cf00){var _0x5cfbce=new History(_0x212bf5);if(_0x5cfbce[_0xb46e('0x184')]+_0x5cfbce[_0xb46e('0x185')]+_0x5cfbce[_0xb46e('0x186')]+_0x5cfbce[_0xb46e('0x187')]+_0x5cfbce[_0xb46e('0x10c')]+_0x5cfbce[_0xb46e('0x114')]+_0x5cfbce[_0xb46e('0x188')]+_0x5cfbce[_0xb46e('0x189')]>=_0x69cf00[_0xb46e('0x18a')]-0x1){return!![];}switch(_0x5c3e2d){case 0x3:if(_0x5cfbce['countnoanswerretry']>=_0x69cf00[_0xb46e('0x18b')]-0x1){return!![];}else{this[_0xb46e('0xc0')]({'active':![],'countnoanswerretry':_0x5cfbce['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xb46e('0x18c')](_0x69cf00[_0xb46e('0x18d')],'minutes')[_0xb46e('0x81')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5cfbce[_0xb46e('0xd3')],'ListId':_0x5cfbce['ListId'],'VoiceQueueId':_0x5cfbce[_0xb46e('0x110')]||undefined,'CampaignId':_0x5cfbce[_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch(_0xb46e('0x18e')));}break;case 0x5:if(_0x5cfbce[_0xb46e('0x184')]>=_0x69cf00[_0xb46e('0x18f')]-0x1){return!![];}else{this[_0xb46e('0xc0')]({'active':![],'countbusyretry':_0x5cfbce[_0xb46e('0x184')]+=0x1,'scheduledat':moment()[_0xb46e('0x18c')](_0x69cf00['dialBusyRetryFrequency'],_0xb46e('0x10e'))['format'](_0xb46e('0xfe')),'ContactId':_0x5cfbce[_0xb46e('0xd3')],'ListId':_0x5cfbce[_0xb46e('0x10f')],'VoiceQueueId':_0x5cfbce[_0xb46e('0x110')]||undefined,'CampaignId':_0x5cfbce[_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch(_0xb46e('0x190')));}break;case 0x8:if(_0x5cfbce[_0xb46e('0x185')]>=_0x69cf00[_0xb46e('0x191')]-0x1){return!![];}else{this[_0xb46e('0xc0')]({'active':![],'countcongestionretry':_0x5cfbce[_0xb46e('0x185')]+=0x1,'scheduledat':moment()[_0xb46e('0x18c')](_0x69cf00['dialCongestionRetryFrequency'],'minutes')[_0xb46e('0x81')](_0xb46e('0xfe')),'ContactId':_0x5cfbce[_0xb46e('0xd3')],'ListId':_0x5cfbce['ListId'],'VoiceQueueId':_0x5cfbce[_0xb46e('0x110')]||undefined,'CampaignId':_0x5cfbce[_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch(_0xb46e('0x192')));}break;case 0x0:if(_0x5cfbce[_0xb46e('0x187')]>=_0x69cf00[_0xb46e('0x193')]-0x1){return!![];}else{this[_0xb46e('0xc0')]({'active':![],'countnosuchnumberretry':_0x5cfbce['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xb46e('0x18c')](_0x69cf00[_0xb46e('0x194')],'minutes')[_0xb46e('0x81')](_0xb46e('0xfe')),'ContactId':_0x5cfbce[_0xb46e('0xd3')],'ListId':_0x5cfbce[_0xb46e('0x10f')],'VoiceQueueId':_0x5cfbce[_0xb46e('0x110')]||undefined,'CampaignId':_0x5cfbce[_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x5cfbce[_0xb46e('0x10c')]>=_0x69cf00[_0xb46e('0x10b')]-0x1){return!![];}else{this[_0xb46e('0xc0')]({'active':![],'countdropretry':_0x5cfbce[_0xb46e('0x10c')]+=0x1,'scheduledat':moment()[_0xb46e('0x18c')](_0x69cf00[_0xb46e('0x10d')],_0xb46e('0x10e'))[_0xb46e('0x81')](_0xb46e('0xfe')),'ContactId':_0x5cfbce[_0xb46e('0xd3')],'ListId':_0x5cfbce['ListId'],'VoiceQueueId':_0x5cfbce[_0xb46e('0x110')]||undefined,'CampaignId':_0x5cfbce[_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch(_0xb46e('0x111')));}break;case 0xb:if(_0x5cfbce[_0xb46e('0x114')]>=_0x69cf00[_0xb46e('0x115')]-0x1){return!![];}else{this[_0xb46e('0xc0')]({'active':![],'countabandonedretry':_0x5cfbce[_0xb46e('0x114')]+=0x1,'scheduledat':moment()['add'](_0x69cf00[_0xb46e('0x116')],_0xb46e('0x10e'))[_0xb46e('0x81')](_0xb46e('0xfe')),'ContactId':_0x5cfbce[_0xb46e('0xd3')],'ListId':_0x5cfbce['ListId'],'VoiceQueueId':_0x5cfbce[_0xb46e('0x110')]||undefined,'CampaignId':_0x5cfbce[_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch(_0xb46e('0x195')));}break;case 0x13:if(_0x5cfbce[_0xb46e('0x188')]>=_0x69cf00['dialMachineMaxRetry']-0x1){return!![];}else{this[_0xb46e('0xc0')]({'active':![],'countmachineretry':_0x5cfbce[_0xb46e('0x188')]+=0x1,'scheduledat':moment()[_0xb46e('0x18c')](_0x69cf00[_0xb46e('0x196')],_0xb46e('0x10e'))[_0xb46e('0x81')](_0xb46e('0xfe')),'ContactId':_0x5cfbce['ContactId'],'ListId':_0x5cfbce[_0xb46e('0x10f')],'VoiceQueueId':_0x5cfbce[_0xb46e('0x110')]||undefined,'CampaignId':_0x5cfbce[_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch(_0xb46e('0x197')));}break;case 0x14:if(_0x5cfbce['countagentrejectretry']>=_0x69cf00[_0xb46e('0x198')]-0x1){return!![];}else{this[_0xb46e('0xc0')]({'active':![],'countagentrejectretry':_0x5cfbce[_0xb46e('0x189')]+=0x1,'scheduledat':moment()['add'](_0x69cf00[_0xb46e('0x199')],_0xb46e('0x10e'))[_0xb46e('0x81')](_0xb46e('0xfe')),'ContactId':_0x5cfbce['ContactId'],'ListId':_0x5cfbce[_0xb46e('0x10f')],'VoiceQueueId':_0x5cfbce[_0xb46e('0x110')]||undefined,'CampaignId':_0x5cfbce[_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch(_0xb46e('0x19a')));}break;default:return!![];}};Dialer[_0xb46e('0x1d')][_0xb46e('0x183')]=function(_0x3f97f8,_0xd80271,_0x147dad){var _0x4e3b93=this;var _0x48c4d0=new History(_0x3f97f8);return new BPromise(function(_0x4db4fe,_0x47fe73){if(_[_0xb46e('0x41')](_0xd80271)&&_0xb46e('0x15a')!==typeof _0xd80271){return _0x47fe73(msgResponse('[callProgressDetecting]',_0xb46e('0x135'),'entity\x20is\x20undefine'));}if(_[_0xb46e('0x41')](_0x147dad)&&_0xb46e('0x15a')!==typeof _0x147dad){return _0x47fe73(msgResponse('[callProgressDetecting]',_0xb46e('0x135'),_0xb46e('0x19b')));}switch(_0x147dad['reason']){case'0':_0xd80271[_0xb46e('0x6d')]+=0x1;_0x48c4d0[_0xb46e('0xeb')]=0x0;_0x48c4d0['statedesc']=_0xb46e('0x19c');_0x4e3b93[_0xb46e('0xcb')](_0x48c4d0)[_0xb46e('0xba')](loggerCatch(_0xb46e('0x19d')));if(_0x4e3b93['checkRetriveMax'](0x0,_0x3f97f8,_0xd80271)){if(_0x48c4d0['countbusyretry']+_0x48c4d0[_0xb46e('0x185')]+_0x48c4d0[_0xb46e('0x186')]+_0x48c4d0['countnosuchnumberretry']+_0x48c4d0[_0xb46e('0x10c')]+_0x48c4d0[_0xb46e('0x114')]+_0x48c4d0[_0xb46e('0x188')]+_0x48c4d0[_0xb46e('0x189')]>=_0xd80271[_0xb46e('0x18a')]){_0x4e3b93[_0xb46e('0x19e')](_0x48c4d0,_0x4db4fe,_0x47fe73,_0xb46e('0x19f'));}else{_0x4e3b93[_0xb46e('0x1a0')](_0x48c4d0,_0x4db4fe,_0x47fe73,_0xb46e('0x19f'));}}break;case'3':_0xd80271[_0xb46e('0x6c')]+=0x1;_0x48c4d0[_0xb46e('0xeb')]=0x3;_0x48c4d0['statedesc']=_0xb46e('0x1a1');_0x48c4d0[_0xb46e('0x186')]+=0x1;_0x48c4d0[_0xb46e('0x1a2')]+=0x1;_0x4e3b93[_0xb46e('0xcb')](_0x48c4d0)[_0xb46e('0xba')](loggerCatch(_0xb46e('0x1a3')));if(_0x4e3b93[_0xb46e('0x1a4')](0x3,_0x3f97f8,_0xd80271)){if(_0x48c4d0[_0xb46e('0x186')]>=_0xd80271['dialNoAnswerMaxRetry']){_0x4e3b93[_0xb46e('0x1a0')](_0x48c4d0,_0x4db4fe,_0x47fe73,_0xb46e('0x1a5'));}else{_0x4e3b93[_0xb46e('0x19e')](_0x48c4d0,_0x4db4fe,_0x47fe73,_0xb46e('0x1a5'));}}break;case'5':_0xd80271[_0xb46e('0x67')]+=0x1;_0x48c4d0[_0xb46e('0xeb')]=0x5;_0x48c4d0[_0xb46e('0xe4')]=_0xb46e('0x1a6');_0x48c4d0[_0xb46e('0x184')]+=0x1;_0x48c4d0[_0xb46e('0x1a2')]+=0x1;_0x4e3b93['createHistory'](_0x48c4d0)[_0xb46e('0xba')](loggerCatch(_0xb46e('0x1a7')));if(_0x4e3b93[_0xb46e('0x1a4')](0x5,_0x3f97f8,_0xd80271)){if(_0x48c4d0[_0xb46e('0x184')]>=_0xd80271['dialBusyMaxRetry']){_0x4e3b93[_0xb46e('0x1a0')](_0x48c4d0,_0x4db4fe,_0x47fe73,_0xb46e('0x1a8'));}else{_0x4e3b93[_0xb46e('0x19e')](_0x48c4d0,_0x4db4fe,_0x47fe73,_0xb46e('0x1a8'));}}break;case'8':_0xd80271['outboundCongestionCallsDay']+=0x1;_0x48c4d0[_0xb46e('0xeb')]=0x8;_0x48c4d0[_0xb46e('0xe4')]=_0xb46e('0x1a9');_0x48c4d0[_0xb46e('0x185')]+=0x1;_0x48c4d0[_0xb46e('0x1a2')]+=0x1;_0x4e3b93[_0xb46e('0xcb')](_0x48c4d0)['catch'](loggerCatch(_0xb46e('0x1aa')));if(_0x4e3b93['checkRetriveMax'](0x8,_0x3f97f8,_0xd80271)){if(_0x48c4d0['countcongestionretry']>=_0xd80271[_0xb46e('0x191')]){_0x4e3b93['createStateFinal'](_0x48c4d0,_0x4db4fe,_0x47fe73,_0xb46e('0x1ab'));}else{_0x4e3b93['stateGlobal'](_0x48c4d0,_0x4db4fe,_0x47fe73,_0xb46e('0x1ab'));}}break;case'11':_0xd80271[_0xb46e('0x1ac')]+=0x1;_0x48c4d0[_0xb46e('0xeb')]=0xb;_0x48c4d0['statedesc']=_0xb46e('0x112');_0x48c4d0[_0xb46e('0x114')]+=0x1;_0x48c4d0[_0xb46e('0x1a2')]+=0x1;_0x4e3b93[_0xb46e('0xcb')](_0x48c4d0)[_0xb46e('0xba')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x4e3b93[_0xb46e('0x1a4')](0xb,_0x3f97f8,_0xd80271)){if(_0x48c4d0['countabandonedretry']>=_0xd80271[_0xb46e('0x115')]){_0x4e3b93[_0xb46e('0x1a0')](_0x48c4d0,_0x4db4fe,_0x47fe73,'reason\x2011\x20abandoned');}else{_0x4e3b93[_0xb46e('0x19e')](_0x48c4d0,_0x4db4fe,_0x47fe73,_0xb46e('0x1ad'));}}break;case'20':_0xd80271[_0xb46e('0x1ae')]+=0x1;_0x48c4d0[_0xb46e('0xeb')]=0x14;_0x48c4d0[_0xb46e('0xe4')]=_0xb46e('0x1af');_0x48c4d0[_0xb46e('0x189')]+=0x1;_0x48c4d0[_0xb46e('0x1a2')]+=0x1;_0x4e3b93[_0xb46e('0xcb')](_0x48c4d0)[_0xb46e('0xba')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x4e3b93['checkRetriveMax'](0x14,_0x3f97f8,_0xd80271)){if(_0x48c4d0[_0xb46e('0x189')]>=_0xd80271['dialAgentRejectMaxRetry']){_0x4e3b93[_0xb46e('0x1a0')](_0x48c4d0,_0x4db4fe,_0x47fe73,_0xb46e('0x1b0'));}else{_0x4e3b93[_0xb46e('0x19e')](_0x48c4d0,_0x4db4fe,_0x47fe73,'reason\x2020\x20agentreject');}}break;default:_0xd80271['outboundUnknownCallsDay']+=0x1;_0x48c4d0[_0xb46e('0xeb')]=0xc;_0x48c4d0[_0xb46e('0xe4')]=_0x147dad['reason'];_0x4e3b93[_0xb46e('0xcb')](_0x48c4d0)[_0xb46e('0xba')](loggerCatch(_0xb46e('0x1b1')));if(_0x4e3b93['checkRetriveMax'](_0x147dad[_0xb46e('0xfc')],_0x3f97f8,_0xd80271)){if(_0x48c4d0['countbusyretry']+_0x48c4d0['countcongestionretry']+_0x48c4d0[_0xb46e('0x186')]+_0x48c4d0[_0xb46e('0x187')]+_0x48c4d0['countdropretry']+_0x48c4d0[_0xb46e('0x114')]+_0x48c4d0['countmachineretry']+_0x48c4d0[_0xb46e('0x189')]>=_0xd80271[_0xb46e('0x18a')]){_0x4e3b93[_0xb46e('0x19e')](_0x48c4d0,_0x4db4fe,_0x47fe73,_0x147dad['reason']);}else{_0x4e3b93[_0xb46e('0x1a0')](_0x48c4d0,_0x4db4fe,_0x47fe73,_0x147dad[_0xb46e('0xfc')]);}}}});};Dialer[_0xb46e('0x1d')][_0xb46e('0x19e')]=function(_0x85e35,_0xe6f9fa,_0x4c9769,_0x37a8c8){var _0x3761ff=new Final(_0x85e35);_0x3761ff['state']=0xf;_0x3761ff[_0xb46e('0xe4')]=_0xb46e('0x1b2');this[_0xb46e('0x1a0')](_0x3761ff,_0xe6f9fa,_0x4c9769,_0x37a8c8);};Dialer[_0xb46e('0x1d')]['createStateFinal']=function(_0x570dd6,_0x59fd38,_0x49c488,_0x3e6500){this[_0xb46e('0xc9')](_0x570dd6)[_0xb46e('0xb9')](function(_0x2315d9){return _0x59fd38(msgResponse('[callProgressDetecting]',_0xb46e('0xd9'),_0x3e6500));})[_0xb46e('0xba')](function(_0x5de4c9){return _0x49c488(msgResponse('[moveContactManagedDialer][0]',_0xb46e('0x135'),'contact\x20not\x20moved'));});};Dialer[_0xb46e('0x1d')][_0xb46e('0xa')]=function(_0x42af7a){var _0x1fc3a3=this;var _0x3f9f4d=_0x42af7a['dialPredictiveOptimizationPercentage']/0x64;var _0x24578c=_0x42af7a[_0xb46e('0x6b')]/(_0x42af7a[_0xb46e('0x6b')]+_0x42af7a['outboundAnswerCallsDay']);var _0x52cf6b=Math[_0xb46e('0x1b3')](_0x42af7a['predictiveIntervalAvailable']*(_0x42af7a[_0xb46e('0x1b4')]/0x64));var _0x1a74f6=Math[_0xb46e('0x1b3')](_0x42af7a['predictiveIntervalAvailable']*(_0x42af7a[_0xb46e('0x1b5')]/0x64));var _0x4ec7dc=_0x42af7a[_0xb46e('0x1b6')]+_0x42af7a[_0xb46e('0x5a')];var _0x5d5528=Math[_0xb46e('0x1b7')](_0x42af7a[_0xb46e('0x91')]*_0x42af7a[_0xb46e('0x7b')]*_0x42af7a['predictiveIntervalHitRate']*_0x42af7a[_0xb46e('0x77')]);if(_['isUndefined'](_0x42af7a[_0xb46e('0x2b')])){if(!_[_0xb46e('0x41')](_0x42af7a['startPredictive'])){_0x42af7a[_0xb46e('0x2a')]=undefined;loggerPredictive[_0xb46e('0x9a')](_0xb46e('0x1b8'),_0xb46e('0x1b9'));}if(!_[_0xb46e('0x41')](_0x42af7a[_0xb46e('0x96')])){loggerPredictive[_0xb46e('0x9a')]('[startMethodPredictive][StartProgressive]',_0xb46e('0x1ba'));clearInterval(_0x42af7a['handlePredictive']);_0x42af7a['handlePredictive']=undefined;}_0x42af7a[_0xb46e('0x2b')]=moment()[_0xb46e('0x81')](_0xb46e('0xfe'));loggerPredictive[_0xb46e('0x85')](_0x42af7a[_0xb46e('0x43')],_0xb46e('0x1bb'),_0x42af7a['startProgressive']);this[_0xb46e('0x148')](_0x42af7a,0x1);}else if(ifInterval(_0x42af7a['dialPredictiveInterval'],_0x42af7a[_0xb46e('0x2b')])){this[_0xb46e('0x148')](_0x42af7a,0x1);loggerPredictiveCalls[_0xb46e('0x85')](_0xb46e('0x1bc'),_0x42af7a[_0xb46e('0x2b')],_0x42af7a[_0xb46e('0x43')]);_0x42af7a[_0xb46e('0x91')]=0x0;_0x42af7a[_0xb46e('0x76')]=0x0;}else if(_0x3f9f4d<_0x24578c&&_0x42af7a[_0xb46e('0x1bd')]===_0xb46e('0x1be')){freeVariablesPredictive(_0x42af7a);loggerPredictive[_0xb46e('0x85')](_0xb46e('0x1bf'),_0xb46e('0x1c0'),_0x24578c,_0xb46e('0x2b'),_0x42af7a['name']);}else if(_0x5d5528<_0x42af7a[_0xb46e('0x76')]&&_0x42af7a['dialPredictiveOptimization']===_0xb46e('0x1be')){freeVariablesPredictive(_0x42af7a);loggerPredictive['info'](_0xb46e('0x1c1'),_0xb46e('0x1c2'),_0x5d5528,_0xb46e('0x1c3'),_0x42af7a[_0xb46e('0x76')],_0xb46e('0x2b'),_0x42af7a[_0xb46e('0x43')]);}else if(!ifInterval(_0x42af7a[_0xb46e('0x1c4')],_0x42af7a[_0xb46e('0x2b')])&&_['isUndefined'](_0x42af7a[_0xb46e('0x2a')])&&!_['isUndefined'](_0x42af7a[_0xb46e('0x2b')])){_0x42af7a[_0xb46e('0x2a')]=moment()[_0xb46e('0x81')](_0xb46e('0xfe'));loggerPredictive[_0xb46e('0x85')](_0x42af7a[_0xb46e('0x43')],_0xb46e('0x1c5'),_0x42af7a[_0xb46e('0x2a')]);this[_0xb46e('0xbe')](_0x42af7a[_0xb46e('0x1c4')])[_0xb46e('0xb9')](this[_0xb46e('0x1c6')](_0x42af7a))[_0xb46e('0xb9')](mergeDataErlangB(_0x42af7a))['then'](this[_0xb46e('0x1c7')](_0x42af7a))[_0xb46e('0xba')](loggerCatchPredictive(_0xb46e('0x1c8'),_0x42af7a));}else if(!ifInterval(_0x42af7a[_0xb46e('0x1c4')],_0x42af7a[_0xb46e('0x2a')])){_0x42af7a['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x42af7a[_0xb46e('0x2a')]=moment()['format'](_0xb46e('0xfe'));loggerPredictive[_0xb46e('0x85')](_0x42af7a[_0xb46e('0x43')],_0xb46e('0x1c9'),_0x42af7a['startPredictive']);clearInterval(_0x42af7a['handlePredictive']);_0x42af7a[_0xb46e('0x96')]=undefined;this['averageHandleTime'](_0x42af7a['dialPredictiveInterval'])[_0xb46e('0xb9')](this[_0xb46e('0x1c6')](_0x42af7a))[_0xb46e('0xb9')](mergeDataErlangB(_0x42af7a))[_0xb46e('0xb9')](this[_0xb46e('0x1c7')](_0x42af7a))[_0xb46e('0xba')](loggerCatchPredictive(_0xb46e('0x1ca'),_0x42af7a));}else if(_0x42af7a[_0xb46e('0x79')]&&_0x4ec7dc<_0x42af7a[_0xb46e('0x79')]-_0x1a74f6){freeVariablesPredictive(_0x42af7a);loggerPredictive[_0xb46e('0x85')](_0x42af7a[_0xb46e('0x43')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4ec7dc,')\x20are\x20less\x20than\x20threshold\x20(',_0x42af7a[_0xb46e('0x79')],'-',_0x1a74f6,'=',_0x42af7a[_0xb46e('0x79')]-_0x1a74f6,')');}else if(_0x42af7a[_0xb46e('0x79')]&&_0x4ec7dc>_0x42af7a[_0xb46e('0x79')]+_0x52cf6b){freeVariablesPredictive(_0x42af7a);loggerPredictive[_0xb46e('0x85')](_0x42af7a[_0xb46e('0x43')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4ec7dc,_0xb46e('0x1cb'),_0x42af7a[_0xb46e('0x79')],'+',_0x52cf6b,'=',_0x42af7a[_0xb46e('0x79')]+_0x52cf6b,')');}};Dialer[_0xb46e('0x1d')]['getDataPredictive']=function(_0x41fc43){var _0xff6e2e=this;return function(_0x16523e){return new BPromise(function(_0x46e7bc,_0x57d153){_[_0xb46e('0xd1')](_0x41fc43,_0x16523e[0x0]);if(checkGetDataPredictive(_0x16523e[0x0])){var _0x945f7f=_0x41fc43['predictiveIntervalAvailable']=_0x41fc43[_0xb46e('0x5a')]+_0x41fc43[_0xb46e('0x1b6')];var _0x13b21f=_0x41fc43[_0xb46e('0x1c4')]*0x3c;var _0x128ad7=_0x16523e[0x0][_0xb46e('0x73')]+_0x16523e[0x0][_0xb46e('0x72')];var _0x38fedc=(_0x16523e[0x0][_0xb46e('0x71')]+_0x16523e[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x16523e[0x0][_0xb46e('0x74')])/_0x16523e[0x0][_0xb46e('0x7a')];_0x41fc43[_0xb46e('0x1cc')]=_0x38fedc>0x0?_0x38fedc:0x1;switch(_0x41fc43['dialPredictiveOptimization']){case _0xb46e('0x1be'):var _0x48f514=_0x41fc43[_0xb46e('0x1cd')]/0x64;return _0xff6e2e[_0xb46e('0x1ce')](_0x945f7f,_0x13b21f,_0x128ad7,_0x38fedc,_0x48f514)[_0xb46e('0xb9')](function(_0x4e9151){return _0x46e7bc(_0x4e9151);});case _0xb46e('0x1cf'):var _0x564a96=_0x41fc43[_0xb46e('0x1cd')]/0x64;return _0xff6e2e['busyFactor'](_0x945f7f,_0x13b21f,_0x128ad7,_0x38fedc,_0x564a96)[_0xb46e('0xb9')](function(_0x107b3a){return _0x46e7bc(_0x107b3a);});default:return _0x57d153(msgResponse(_0xb46e('0x1d0'),_0xb46e('0x135'),'Unknown\x20Predictive'));}}else{return _0x57d153(msgResponse(_0xb46e('0x1d0'),_0xb46e('0x135'),_0xb46e('0x1d1')));}});};};Dialer[_0xb46e('0x1d')]['getDataPredictiveOld']=function(_0x51af44){var _0x5c8bfe=this;return function(_0x288eb8){return new BPromise(function(_0x39124a,_0x31a388){_[_0xb46e('0xd1')](_0x51af44,_0x288eb8[0x0]);if(checkGetDataPredictive(_0x288eb8[0x0])){loggerPredictive[_0xb46e('0x85')](JSON[_0xb46e('0x4c')](_0x288eb8[0x0]));if(_0x51af44[_0xb46e('0x1bd')]===_0xb46e('0x1be')){return _0x5c8bfe['getVoiceQueueRtPauses'](_0x51af44['id'])[_0xb46e('0xb9')](function(_0x4ebce9){var _0x5632a7=_0x51af44[_0xb46e('0x55')]-_0x4ebce9[0x0][_0xb46e('0x1d2')];var _0x196c5f=_0x51af44[_0xb46e('0x1c4')]*0x3c;var _0x2df019=_0x288eb8[0x0][_0xb46e('0x73')]+_0x288eb8[0x0][_0xb46e('0x72')];var _0x3cc996=(_0x288eb8[0x0][_0xb46e('0x71')]+_0x288eb8[0x0][_0xb46e('0x75')]+_0x288eb8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x288eb8[0x0][_0xb46e('0x7a')];var _0x7477e5=_0x51af44[_0xb46e('0x1cd')]/0x64;_0x51af44['predictiveIntervalPauses']=_0x4ebce9[0x0]['outboundQueuePauses']||0x0;_0x51af44[_0xb46e('0x1cc')]=_0x3cc996>0x0?_0x3cc996:0x1;return _0x5c8bfe['abandonmentRate'](_0x5632a7,_0x196c5f,_0x2df019,_0x3cc996,_0x7477e5);})[_0xb46e('0xb9')](function(_0x443f6b){return _0x39124a(_0x443f6b);})[_0xb46e('0xba')](function(_0x5264ff){return _0x31a388(msgResponse('[CatchErlangB]',_0xb46e('0x135'),JSON[_0xb46e('0x4c')](_0x5264ff)));});}if(_0x51af44[_0xb46e('0x1bd')]===_0xb46e('0x1cf')){return _0x5c8bfe[_0xb46e('0xc7')](_0x51af44['id'])['then'](function(_0x27c97e){var _0x3b939c=_0x51af44[_0xb46e('0x55')]-_0x27c97e[0x0][_0xb46e('0x1d2')];var _0x249ecc=_0x51af44[_0xb46e('0x1c4')]*0x3c;var _0x53ab67=_0x288eb8[0x0][_0xb46e('0x73')]+_0x288eb8[0x0][_0xb46e('0x72')];var _0x24c2a3=(_0x288eb8[0x0]['predictiveIntervalAnsweredCalls']+_0x288eb8[0x0][_0xb46e('0x75')]+_0x288eb8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x288eb8[0x0][_0xb46e('0x7a')];var _0x2b31ff=_0x51af44[_0xb46e('0x1cd')]/0x64;_0x51af44[_0xb46e('0x78')]=_0x27c97e[0x0]['outboundQueuePauses']||0x0;_0x51af44[_0xb46e('0x1cc')]=_0x24c2a3>0x0?_0x24c2a3:0x1;return _0x5c8bfe[_0xb46e('0x1d3')](_0x3b939c,_0x249ecc,_0x53ab67,_0x24c2a3,_0x2b31ff);})[_0xb46e('0xb9')](function(_0x5a9e0d){return _0x39124a(_0x5a9e0d);})[_0xb46e('0xba')](function(_0xf7449f){return _0x31a388(msgResponse(_0xb46e('0x1d4'),'Failure',JSON['stringify'](_0xf7449f)));});}}else{return _0x31a388(msgResponse(_0xb46e('0x1d0'),_0xb46e('0x135'),'check\x20failure'));}});};};Dialer['prototype'][_0xb46e('0x1c7')]=function(_0x242339){var _0x381604=this;return function(){var _0x225264=0x0;var _0x35a273=Math[_0xb46e('0x1b7')](_0x242339[_0xb46e('0x92')]*0x3e8);if(_0x35a273>0x0){_0x35a273=_0x35a273<0x64?0x64:_0x35a273;loggerPredictive['info'](_0x242339[_0xb46e('0x43')],_0xb46e('0x1d5'),_0x35a273,_0xb46e('0x4d'));_0x242339[_0xb46e('0x96')]=setInterval(function(){_0x381604[_0xb46e('0x96')](_0x242339);loggerPredictiveCalls[_0xb46e('0x85')]('[handlePredictive]',_0x225264+=0x1);},_0x35a273);}else{loggerPredictive['info'](_0x242339[_0xb46e('0x43')],_0xb46e('0x1d6'));}};};Dialer[_0xb46e('0x1d')][_0xb46e('0x1d7')]=function(_0x32780f,_0x1b3592){var _0x2b5c88=this;return function(_0x84df26){if(_[_0xb46e('0x84')](_0x84df26)){if(_['isNil'](_0x1b3592['UserId'])||!_0x1b3592[_0xb46e('0x1d8')]){if(_0x32780f['dialMethod']===_0xb46e('0x9')){_0x32780f[_0xb46e('0x11f')]=_[_0xb46e('0x41')](_0x32780f['queueStatusComplete'])?!![]:_0x32780f[_0xb46e('0x11f')];var _0x390d41=uuid['v4']();_0x2b5c88[_0xb46e('0x27')][_0x390d41]=new Action(_0x32780f,_0x1b3592,_0x390d41);loggerBooked['info'](_0xb46e('0x1d9'),_0x390d41,_0xb46e('0x1da'),JSON[_0xb46e('0x4c')](_0x32780f[_0xb46e('0x11f')]),'Queue:\x20',_0x32780f['name']);if(_0x32780f[_0xb46e('0x11f')]){_0x32780f['queueStatusComplete']=![];_0x2b5c88['queueBooked'][_0x2b5c88[_0xb46e('0x27')][_0x390d41][_0xb46e('0xb4')]]=[];ami[_0xb46e('0xaf')]({'actionid':_0x390d41,'action':'queuestatus','queue':_0x32780f['name']})[_0xb46e('0xba')](function(_0xf49c34){_0x2b5c88[_0xb46e('0xb2')](_0x32780f);_0x2b5c88[_0xb46e('0xc0')]({'active':![],'ContactId':_0x2b5c88[_0xb46e('0x27')][_0x390d41]['ContactId'],'ListId':_0x2b5c88[_0xb46e('0x27')][_0x390d41][_0xb46e('0x10f')],'VoiceQueueId':_0x2b5c88[_0xb46e('0x27')][_0x390d41][_0xb46e('0x110')]||undefined,'CampaignId':_0x2b5c88[_0xb46e('0x27')][_0x390d41][_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch(_0xb46e('0x1db')));delete _0x2b5c88['actions'][_0x390d41];});}else{loggerBooked[_0xb46e('0x85')](_0xb46e('0x1dc'),JSON['stringify'](_0x32780f[_0xb46e('0x11f')]),_0xb46e('0x1dd'),_0x32780f[_0xb46e('0x43')]);_0x2b5c88[_0xb46e('0xb2')](_0x32780f);_0x2b5c88[_0xb46e('0xc0')]({'active':![],'ContactId':_0x2b5c88[_0xb46e('0x27')][_0x390d41][_0xb46e('0xd3')],'ListId':_0x2b5c88[_0xb46e('0x27')][_0x390d41]['ListId'],'VoiceQueueId':_0x2b5c88[_0xb46e('0x27')][_0x390d41][_0xb46e('0x110')]||undefined,'CampaignId':_0x2b5c88[_0xb46e('0x27')][_0x390d41][_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2b5c88[_0xb46e('0x27')][_0x390d41];}}else{return _0x2b5c88[_0xb46e('0x1de')](_0x32780f,_0x1b3592);}}else{if(getDiff(_0x1b3592[_0xb46e('0x1df')])<_0x32780f[_0xb46e('0x1e0')]*0x3c){if(_0x1b3592[_0xb46e('0x1e1')]&&!_0x1b3592[_0xb46e('0x1e1')][_0xb46e('0x1e2')]){_0x2b5c88[_0xb46e('0x21')][_0xb46e('0x121')](_0x1b3592['id'])['finally'](function(){_0x2b5c88[_0xb46e('0xb2')](_0x32780f);});}else{_0x2b5c88[_0xb46e('0xc2')]({'active':![]},_0x1b3592['id'],0x1)[_0xb46e('0x1f')](function(){console['log'](_0xb46e('0x1e3'));_0x2b5c88[_0xb46e('0xb2')](_0x32780f);});}}else{_0x32780f['outboundReCallsDay']+=0x1;_0x2b5c88[_0xb46e('0xb2')](_0x32780f);if(_0x32780f[_0xb46e('0x1e4')]){_0x2b5c88['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1b3592[_0xb46e('0xd3')],'ListId':_0x1b3592[_0xb46e('0x10f')],'VoiceQueueId':_0x1b3592['VoiceQueueId']||undefined,'CampaignId':_0x1b3592[_0xb46e('0xd5')]||undefined})[_0xb46e('0xba')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x2b5c88[_0xb46e('0xcb')](createObjHistory(_0x32780f,_0x1b3592,'RECALLINQUEUE',0x17,_0xb46e('0x1e5')))[_0xb46e('0xba')](loggerCatch(_0xb46e('0x1e6')));}else{_0x2b5c88['saveInDb'](createObjHistory(_0x32780f,_0x1b3592,_0xb46e('0x1e7'),0x16,_0xb46e('0x1e8')),_0xb46e('0x1e9'),_0xb46e('0x1ea'));}}}}else{_0x32780f[_0xb46e('0x66')]+=0x1;_0x2b5c88[_0xb46e('0xde')](createObjHistory(_0x32780f,_0x1b3592,_0xb46e('0x1eb'),0xd,'Blacklist'),_0xb46e('0x1ec'),_0xb46e('0x1ed'));throw _0xb46e('0x1ee');}};};Dialer[_0xb46e('0x1d')][_0xb46e('0x14e')]=function(_0x4a062d){var _0x15b668=this;var _0x36430d=[];var _0x54b3c9=_0x4a062d['limitCalls']-_0x4a062d['originated']-_0x4a062d['temp'];emitCampaignSummary(_0x4a062d);if(_0x54b3c9>0x0){if(_0x54b3c9>this[_0xb46e('0x26')]){_0x54b3c9=this[_0xb46e('0x26')];}_0x4a062d[_0xb46e('0x1ef')]+=_0x54b3c9;this[_0xb46e('0xc6')](_0x4a062d['id'],_0x54b3c9,_0x4a062d[_0xb46e('0x1f0')])['then'](function(_0x22d5ec){_0x4a062d['temp']-=_0x54b3c9;_0x4a062d[_0xb46e('0x1ef')]=_0x4a062d['temp']>0x0?_0x4a062d[_0xb46e('0x1ef')]:0x0;if(!checkContactEmpty(_0x22d5ec)){_0x4a062d['message']=_0xb46e('0x1f1');logger[_0xb46e('0x85')](_0xb46e('0x1f2')+_0x4a062d['name']);}else{_0x4a062d[_0xb46e('0x9f')]+=_0x22d5ec[_0xb46e('0x9d')];_0x4a062d['message']=_0xb46e('0x1f3');for(var _0x3ce336=0x0;_0x3ce336<_0x22d5ec[_0xb46e('0x9d')];_0x3ce336+=0x1){_0x4a062d[_0xb46e('0x1f4')]+=0x1;if(_[_0xb46e('0xae')](_0x22d5ec[_0x3ce336])||_[_0xb46e('0xae')](_0x22d5ec[_0x3ce336][_0xb46e('0x15c')])||_[_0xb46e('0xae')](_0x22d5ec[_0x3ce336][_0xb46e('0x15c')]['phone'])){_0x15b668[_0xb46e('0xd0')]('[actionOriginate]\x20',_0x4a062d,_0x22d5ec[_0x3ce336]);}else{_0x15b668[_0xb46e('0xbc')](_[_0xb46e('0xd2')](_0x22d5ec[_0x3ce336],[_0xb46e('0xd5'),_0xb46e('0x1f5')]))[_0xb46e('0xb9')](_0x15b668['checkContactBlack'](_0x4a062d,_0x22d5ec[_0x3ce336]))[_0xb46e('0xba')](_0x15b668[_0xb46e('0xcf')](_0xb46e('0x1f6'),_0x4a062d));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x4a062d,_0x54b3c9));}};Dialer[_0xb46e('0x1d')][_0xb46e('0x148')]=function(_0x45d5a7,_0x2dc5fa){var _0x555182=this;var _0x279afe=[];var _0x4d9be3=_0x2dc5fa>=0x1?_0x2dc5fa:0x1;var _0x3d1924=[];if(_0x45d5a7['dialMethod']===_0xb46e('0x9')){_0x4d9be3=0x1;}var _0x33eaf7=Math[_0xb46e('0x1b7')](_0x45d5a7[_0xb46e('0x1b6')]*_0x4d9be3)-_0x45d5a7['originated']-_0x45d5a7[_0xb46e('0x1ef')];emitVoiceQueueSummary(_0x45d5a7);if(_0x45d5a7[_0xb46e('0x1f7')]>0x0){var _0x156a1a=_0x45d5a7[_0xb46e('0x1f7')]-_0x45d5a7['originated']-_0x45d5a7[_0xb46e('0x5a')]-_0x45d5a7[_0xb46e('0x1ef')]-_0x45d5a7['pTalking'];if(_0x33eaf7>_0x156a1a){_0x33eaf7=_0x156a1a;}}if(_0x33eaf7>0x0){if(_0x45d5a7[_0xb46e('0x60')]===_0xb46e('0x9')){_0x33eaf7=0x1;}if(_0x33eaf7>this[_0xb46e('0x26')]){_0x33eaf7=this[_0xb46e('0x26')];}_0x45d5a7[_0xb46e('0x1ef')]+=_0x33eaf7;for(var _0x2ff61e in this[_0xb46e('0x24')]){if(this[_0xb46e('0x24')]['hasOwnProperty'](_0x2ff61e)){if(this['agents'][_0x2ff61e]['state']===_0xb46e('0x1f8')&&this[_0xb46e('0x24')][_0x2ff61e]['status']===_0xb46e('0xdd')){_0x279afe[_0xb46e('0x11d')](this[_0xb46e('0x24')][_0x2ff61e]['id']);}}}this[_0xb46e('0xc4')](_0x45d5a7['id'],_0x279afe,_0x33eaf7,_0x45d5a7[_0xb46e('0x1f0')])[_0xb46e('0xb9')](function(_0x9a81e8){_0x45d5a7[_0xb46e('0x1ef')]-=_0x33eaf7;_0x45d5a7[_0xb46e('0x1ef')]=_0x45d5a7[_0xb46e('0x1ef')]>0x0?_0x45d5a7[_0xb46e('0x1ef')]:0x0;if(!checkContactEmpty(_0x9a81e8)){_0x555182[_0xb46e('0xb5')](_0x45d5a7)[_0xb46e('0xb9')](sendMessageReschedule(_0x45d5a7))[_0xb46e('0xba')](loggerCatch('[countReScheduled]\x20'));}else{_0x45d5a7['originated']+=_0x9a81e8[_0xb46e('0x9d')];_0x45d5a7[_0xb46e('0x45')]=_0x45d5a7[_0xb46e('0x60')]==='booked'?'ACTIVE':_0xb46e('0x1f3');for(var _0x44d65b=0x0;_0x44d65b<_0x9a81e8[_0xb46e('0x9d')];_0x44d65b+=0x1){if(_[_0xb46e('0xae')](_0x9a81e8[_0x44d65b])||_['isNil'](_0x9a81e8[_0x44d65b]['Contact'])||_[_0xb46e('0xae')](_0x9a81e8[_0x44d65b][_0xb46e('0x15c')][_0xb46e('0x15d')])){_0x555182['emptyContact']('[actionOriginate]\x20',_0x45d5a7,_0x9a81e8[_0x44d65b]);}else{_0x555182[_0xb46e('0xb8')](_['pick'](_0x9a81e8[_0x44d65b],[_0xb46e('0x110'),_0xb46e('0x1f5')]))['then'](_0x555182[_0xb46e('0x1d7')](_0x45d5a7,_0x9a81e8[_0x44d65b]))['catch'](_0x555182[_0xb46e('0xcf')](_0xb46e('0x1f9'),_0x45d5a7));}}}})[_0xb46e('0xba')](loggerGetContactDialer('[getContactDialer2]',_0x45d5a7,_0x33eaf7));}};Dialer[_0xb46e('0x1d')][_0xb46e('0x96')]=function(_0x3dc371){var _0xcdb84=this;if(_0x3dc371[_0xb46e('0x1f7')]>0x0){var _0x77f69a=_0x3dc371['dialLimitQueue']-_0x3dc371['originated']-_0x3dc371[_0xb46e('0x5a')];if(_0x77f69a>0x0){this[_0xb46e('0x1fa')](_0x3dc371);}else{loggerPredictiveCalls[_0xb46e('0x85')](_0xb46e('0x1fb'));}}else{this[_0xb46e('0x1fa')](_0x3dc371);}};Dialer['prototype'][_0xb46e('0x1fa')]=function(_0x3b3ab4){var _0x5dfca9=this;var _0x42daf8=[];_0x3b3ab4[_0xb46e('0x9f')]+=0x1;for(var _0x44a686 in this[_0xb46e('0x24')]){if(this['agents']['hasOwnProperty'](_0x44a686)){if(this[_0xb46e('0x24')][_0x44a686][_0xb46e('0xeb')]===_0xb46e('0x1f8')&&this[_0xb46e('0x24')][_0x44a686][_0xb46e('0xdc')]===_0xb46e('0xdd')){_0x42daf8[_0xb46e('0x11d')](this[_0xb46e('0x24')][_0x44a686]['id']);}}}this[_0xb46e('0xc4')](_0x3b3ab4['id'],_0x42daf8,0x1,_0x3b3ab4[_0xb46e('0x1f0')])['then'](function(_0x51e332){if(!checkContactEmpty(_0x51e332)){checkContactLowerLimitOriginate(_0x3b3ab4,0x1,0x0);_0x5dfca9[_0xb46e('0xb5')](_0x3b3ab4)[_0xb46e('0xb9')](sendMessageReschedule(_0x3b3ab4))['catch'](loggerCatch(_0xb46e('0xb7')));}else{_0x3b3ab4[_0xb46e('0x45')]='RUNNING';if(_['isNil'](_0x51e332[0x0])||_[_0xb46e('0xae')](_0x51e332[0x0]['Contact'])||_[_0xb46e('0xae')](_0x51e332[0x0][_0xb46e('0x15c')][_0xb46e('0x15d')])){_0x5dfca9[_0xb46e('0xd0')](_0xb46e('0x1f9'),_0x3b3ab4,_0x51e332[0x0]);}else{_0x5dfca9['checkIsBlackList'](_[_0xb46e('0xd2')](_0x51e332[0x0],[_0xb46e('0x110'),_0xb46e('0x1f5')]))['then'](_0x5dfca9['checkContactBlack'](_0x3b3ab4,_0x51e332[0x0]))[_0xb46e('0xba')](_0x5dfca9[_0xb46e('0xcf')](_0xb46e('0x1fc'),_0x3b3ab4));}}})[_0xb46e('0xba')](loggerGetContactDialer(_0xb46e('0x1fd'),_0x3b3ab4,0x1));emitVoiceQueueSummary(_0x3b3ab4);};Dialer['prototype']['abandonmentRate']=function(_0x3c3ced,_0x65039f,_0x34360a,_0x5a7ddb,_0x596f53,_0x5a083d){loggerPredictive['info'](_0xb46e('0x1fe'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c3ced);loggerPredictive[_0xb46e('0x85')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x65039f);loggerPredictive[_0xb46e('0x85')]('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',_0x34360a);loggerPredictive[_0xb46e('0x85')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a7ddb);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x596f53);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x923c89,_0x50365d){if(_0x3c3ced<=0x0||isNaN(_0x3c3ced)){return _0x50365d(msgResponse(_0xb46e('0x1ff'),_0xb46e('0x17f'),'m\x20=\x20'+_0x3c3ced));}if(_0x34360a<=0x0||isNaN(_0x34360a)){return _0x50365d(msgResponse('[abandonmentRate]',_0xb46e('0x17f'),_0xb46e('0x200')+_0x34360a));}if(_0x5a7ddb<=0x0||isNaN(_0x5a7ddb)){return _0x50365d(msgResponse(_0xb46e('0x1ff'),_0xb46e('0x17f'),_0xb46e('0x201')+_0x5a7ddb));}if(_0x65039f<=0x0||isNaN(_0x65039f)){return _0x50365d(msgResponse(_0xb46e('0x1ff'),'Error',_0xb46e('0x202')+_0x65039f));}if(_0x596f53<=0x0||isNaN(_0x596f53)){return _0x50365d(msgResponse(_0xb46e('0x1ff'),'Error',_0xb46e('0x203')+_0x596f53));}_0x5a083d=_0x5a083d||0x0;var _0x344959=0x1/_0x34360a;var _0x111f17=0x0;var _0x1aa6c3=0x0;var _0x50dae3=0x0;var _0x19adee=0x0;for(var _0x223739=0x0;_0x50dae3<_0x596f53;_0x223739+=0x1){_0x1aa6c3=_0x223739/_0x65039f;_0x111f17=(_0x5a7ddb*_0x1aa6c3+_0x5a083d)/_0x344959;_0x50dae3=erlangb(_0x111f17,_0x3c3ced);_0x19adee=_0x111f17/_0x3c3ced*(0x1-erlangb(_0x111f17,_0x3c3ced));}return _0x923c89({'erlangCalls':_0x223739,'erlangCallToSecond':_0x65039f/_0x223739,'erlangAbandonmentRate':_0x50dae3,'erlangBusyFactor':_0x19adee});});};Dialer[_0xb46e('0x1d')]['busyFactor']=function(_0x28b401,_0x218718,_0x552966,_0x5d1735,_0x599a73,_0x5bd875){loggerPredictive[_0xb46e('0x85')](_0xb46e('0x204'));loggerPredictive['info'](_0xb46e('0x205'),_0x28b401);loggerPredictive['info'](_0xb46e('0x206'),_0x218718);loggerPredictive[_0xb46e('0x85')](_0xb46e('0x207'),_0x552966);loggerPredictive[_0xb46e('0x85')](_0xb46e('0x208'),_0x5d1735);loggerPredictive[_0xb46e('0x85')](_0xb46e('0x209'),_0x599a73);loggerPredictive[_0xb46e('0x85')](_0xb46e('0x8c'));return new BPromise(function(_0x75030f,_0x2d88e1){if(_0x28b401<=0x0||isNaN(_0x28b401)){return _0x2d88e1(msgResponse(_0xb46e('0x20a'),_0xb46e('0x17f'),_0xb46e('0x20b')+_0x28b401));}if(_0x552966<=0x0||isNaN(_0x552966)){return _0x2d88e1(msgResponse(_0xb46e('0x20a'),_0xb46e('0x17f'),'Ts\x20=\x20'+_0x552966));}if(_0x5d1735<=0x0||isNaN(_0x5d1735)){return _0x2d88e1(msgResponse('[busyFactor]','Error',_0xb46e('0x201')+_0x5d1735));}if(_0x218718<=0x0||isNaN(_0x218718)){return _0x2d88e1(msgResponse(_0xb46e('0x20a'),_0xb46e('0x17f'),_0xb46e('0x202')+_0x218718));}if(_0x599a73<=0x0||isNaN(_0x599a73)){return _0x2d88e1(msgResponse(_0xb46e('0x20a'),_0xb46e('0x17f'),_0xb46e('0x20c')+_0x599a73));}_0x5bd875=_0x5bd875||0x0;var _0x2347af=0x1/_0x552966;var _0x36dfeb=0x0;var _0x2ce1cf=0x0;var _0x1c6152=0x0;var _0x12bd0f=0x0;for(var _0x4f3f7b=0x0;_0x12bd0f<_0x599a73;_0x4f3f7b+=0x1){_0x2ce1cf=_0x4f3f7b/_0x218718;_0x36dfeb=(_0x5d1735*_0x2ce1cf+_0x5bd875)/_0x2347af;_0x1c6152=erlangb(_0x36dfeb,_0x28b401);_0x12bd0f=_0x36dfeb/_0x28b401*(0x1-erlangb(_0x36dfeb,_0x28b401));}return _0x75030f({'erlangCalls':_0x4f3f7b,'erlangCallToSecond':_0x218718/_0x4f3f7b,'erlangAbandonmentRate':_0x1c6152,'erlangBusyFactor':_0x12bd0f});});};module[_0xb46e('0x20d')]=Dialer; \ No newline at end of file +var _0x95af=['MACHINE','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','amd','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialDropMaxRetry','countdropretry','add','dialDropRetryFrequency','minutes','ListId','[rescheduleContact][Drop]','Abandoned','CALLEREXIT','countabandonedretry','[rescheduleContact][Abandoned]','channel','syncQueueMember','actionid','locked','stateinterface','push','idHopper','paused','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','contactAgent-idHopper:\x20','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','content','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','booked','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncCampaigns]','pow','replace','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','tags','updatedAt','%s%s','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','countnoanswerretry','dialNoAnswerRetryFrequency','dialBusyRetryFrequency','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialAbandonedRetryFrequency','countmachineretry','dialMachineMaxRetry','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','countglobal','dialBusyMaxRetry','reason\x205\x20busy','stateGlobal','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','reason\x2011\x20abandoned','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','check\x20failure','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','Agent','voicePause','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[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','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]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','busyFactor','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','util','bluebird','md5','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./agentComplete','./queueCallerAbandon','./hangup','env','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','originateresponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','answered','available','pTalking','sumBillable','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialPrefix','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','hasOwnProperty','isNil','Action','status','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','[unlockContact]\x20','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','reachable','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','outboundAnswerCallsDay','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]'];(function(_0x3e2e87,_0x3123af){var _0x3c00f0=function(_0x1e5f4c){while(--_0x1e5f4c){_0x3e2e87['push'](_0x3e2e87['shift']());}};_0x3c00f0(++_0x3123af);}(_0x95af,0x11f));var _0xf95a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95af[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xf95a('0x0'));var _=require('lodash');var BPromise=require(_0xf95a('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0xf95a('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment/');var logger=require(_0xf95a('0x3'))(_0xf95a('0x4'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require('../../../config/logger')(_0xf95a('0x5'));var loggerPredictiveCalls=require('../../../config/logger')(_0xf95a('0x6'));var loggerSyncQueueSummary=require(_0xf95a('0x3'))(_0xf95a('0x7'));var ami=require(_0xf95a('0x8'));config[_0xf95a('0x9')]=_['defaults'](config[_0xf95a('0x9')],{'host':_0xf95a('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf95a('0x9')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xf95a('0xb'));var voiceQueueRt=require(_0xf95a('0xc'));var Action=require(_0xf95a('0xd'));var History=require('./history');var Final=require('./final');var AgentComplete=require(_0xf95a('0xe'));var QueueCallerAbandon=require(_0xf95a('0xf'));var Hangup=require(_0xf95a('0x10'));var ipAgi=process[_0xf95a('0x11')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0xf95a('0x12'),'roundrobin':_0xf95a('0x13')};var Sequence=function(){};Sequence[_0xf95a('0x14')][_0xf95a('0x15')]=function(_0x44c905){this['tail']=this[_0xf95a('0x16')]?this[_0xf95a('0x16')]['finally'](_0x44c905):_0x44c905();};function Dialer(_0x181d7d,_0x1afc4d){this[_0xf95a('0x17')]=new Sequence();this[_0xf95a('0x18')]=_0x1afc4d;this[_0xf95a('0x19')]=_0x181d7d['voiceQueues'];this['campaigns']=_0x181d7d[_0xf95a('0x1a')];this[_0xf95a('0x1b')]=_0x181d7d[_0xf95a('0x1b')];this['trunks']=_0x181d7d[_0xf95a('0x1c')];this[_0xf95a('0x1d')]=config[_0xf95a('0x1d')]||0x2;this[_0xf95a('0x1e')]={};this[_0xf95a('0x1f')]={};this['contactsId']={};this[_0xf95a('0x20')]={};this[_0xf95a('0x21')]={};this[_0xf95a('0x22')]={};this[_0xf95a('0x23')]={};this[_0xf95a('0x24')]={};this[_0xf95a('0x25')]={};this['queueBookedRR']={};ami['on'](_0xf95a('0x26'),this[_0xf95a('0x27')][_0xf95a('0x28')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xf95a('0x29'),this['syncOriginateResponse'][_0xf95a('0x28')](this));ami['on']('agentcomplete',this[_0xf95a('0x2a')][_0xf95a('0x28')](this));ami['on'](_0xf95a('0x2b'),this[_0xf95a('0x7')]['bind'](this));ami['on'](_0xf95a('0x2c'),this[_0xf95a('0x2d')][_0xf95a('0x28')](this));ami['on'](_0xf95a('0x2e'),this[_0xf95a('0x2f')][_0xf95a('0x28')](this));ami['on'](_0xf95a('0x30'),this[_0xf95a('0x31')][_0xf95a('0x28')](this));ami['on'](_0xf95a('0x32'),this['syncQueueMember'][_0xf95a('0x28')](this));ami['on']('queuestatuscomplete',this[_0xf95a('0x33')][_0xf95a('0x28')](this));this[_0xf95a('0x34')]();this[_0xf95a('0x35')]();}function isNotNull(_0x24d8ba){return _0x24d8ba!==null&&!_[_0xf95a('0x36')](_0x24d8ba);}function checkIsLoggedIn(_0x3b7e55,_0x337012){return function(){if(_0x337012<=0x0){_0x3b7e55[_0xf95a('0x37')]=_0xf95a('0x38');throw _0x3b7e55['name']+_0xf95a('0x39');}};}function isActive(_0x50f21a){return _0x50f21a;}function checkIsActive(_0x5022c9,_0x5cda51){return function(){if(!isActive(_0x5cda51)){_0x5022c9[_0xf95a('0x37')]='NOT_ACTIVE';throw _0x5022c9[_0xf95a('0x3a')]+_0xf95a('0x3b');}};}function checkInterval(_0x18776b){return function(){if(!isNotNull(_0x18776b[_0xf95a('0x3c')])){_0x18776b[_0xf95a('0x37')]=_0xf95a('0x3d');throw _0x18776b['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x18776b[_0xf95a('0x3c')][_0xf95a('0x3e')])){_0x18776b[_0xf95a('0x37')]=_0xf95a('0x3d');throw _0x18776b['name']+_0xf95a('0x3f');}if(!isNotNull(_[_0xf95a('0x40')](_0x18776b['Interval']['Intervals']))){_0x18776b[_0xf95a('0x37')]=_0xf95a('0x3d');throw _0x18776b[_0xf95a('0x3a')]+_0xf95a('0x3f');}};}function msgResponse(_0x311b9c,_0x5a233d,_0x3e9244){return{'action':_0x311b9c,'response':_0x5a233d,'message':_0x3e9244,'stack':_0x3e9244};}function myreject(_0x2dacc9){return function(_0xf35d47){return _0x2dacc9(msgResponse(_0xf95a('0x41'),_0xf95a('0x42'),JSON[_0xf95a('0x43')](_0xf35d47)));};}function getSeconds(_0xa5eca,_0x4cc143){var _0xa92273=moment(_0xa5eca)[_0xf95a('0x44')](0x0);var _0x1842cd=moment(_0x4cc143)[_0xf95a('0x44')](0x0);return _0xa92273[_0xf95a('0x45')](_0x1842cd,_0xf95a('0x46'));}function emit(_0xcd7826,_0x191c39,_0x35c845){io['to'](_0xcd7826)['emit'](_0x191c39,_0x35c845);}function emitVoiceQueueSummary(_0x33d072){if(_0x33d072[_0xf95a('0x47')]===_0xf95a('0x48')){var _0x4b3279={'id':_0x33d072['id'],'name':_0x33d072['name'],'strategy':_0x33d072[_0xf95a('0x49')],'answered':_0x33d072[_0xf95a('0x4a')],'available':_0x33d072[_0xf95a('0x4b')],'loggedIn':_0x33d072['loggedIn'],'pTalking':_0x33d072[_0xf95a('0x4c')],'sumBillable':_0x33d072[_0xf95a('0x4d')],'sumDuration':_0x33d072['sumDuration'],'sumHoldTime':_0x33d072['sumHoldTime']||0x0,'talking':_0x33d072[_0xf95a('0x4e')],'total':_0x33d072[_0xf95a('0x4f')],'type':_0x33d072[_0xf95a('0x47')],'unmanaged':_0x33d072[_0xf95a('0x50')],'abandoned':_0x33d072[_0xf95a('0x51')],'waiting':_0x33d072[_0xf95a('0x52')],'loggedInDb':_0x33d072[_0xf95a('0x53')],'dialActive':_0x33d072[_0xf95a('0x54')],'dialMethod':_0x33d072[_0xf95a('0x55')],'dialOriginateCallerIdName':_0x33d072['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x33d072['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x33d072['dialOriginateTimeout'],'dialPrefix':_0x33d072[_0xf95a('0x56')],'outboundAnswerAgiCallsDay':_0x33d072[_0xf95a('0x57')],'outboundAnswerCallsDay':_0x33d072['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x33d072['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x33d072[_0xf95a('0x58')],'outboundCongestionCallsDay':_0x33d072[_0xf95a('0x59')],'outboundDropCallsDayACS':_0x33d072[_0xf95a('0x5a')],'outboundDropCallsDayCallersExit':_0x33d072[_0xf95a('0x5b')],'outboundDropCallsDayTimeout':_0x33d072[_0xf95a('0x5c')],'outboundNoAnswerCallsDay':_0x33d072[_0xf95a('0x5d')],'outboundNoSuchCallsDay':_0x33d072[_0xf95a('0x5e')],'outboundOriginateFailureCallsDay':_0x33d072[_0xf95a('0x5f')],'outboundReCallsDay':_0x33d072[_0xf95a('0x60')],'outboundRejectCallsDay':_0x33d072['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x33d072[_0xf95a('0x61')],'predictiveIntervalAnsweredCalls':_0x33d072['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x33d072[_0xf95a('0x62')],'predictiveIntervalAvgTalktime':_0x33d072[_0xf95a('0x63')],'predictiveIntervalDroppedCallsCallersExit':_0x33d072[_0xf95a('0x64')],'predictiveIntervalDroppedCallsTimeout':_0x33d072[_0xf95a('0x65')],'predictiveIntervalErlangCalls':_0x33d072[_0xf95a('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0x33d072['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x33d072[_0xf95a('0x67')],'predictiveIntervalMultiplicativeFactor':_0x33d072[_0xf95a('0x68')],'predictiveIntervalPauses':_0x33d072['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x33d072[_0xf95a('0x69')],'predictiveIntervalTotalCalls':_0x33d072[_0xf95a('0x6a')],'message':_0x33d072[_0xf95a('0x37')],'originated':_0x33d072[_0xf95a('0x6b')],'erlangCalls':_0x33d072[_0xf95a('0x6c')],'erlangCallToSecond':_0x33d072[_0xf95a('0x6d')],'erlangAbandonmentRate':_0x33d072['erlangAbandonmentRate'],'erlangBusyFactor':_0x33d072[_0xf95a('0x6e')],'startPredictive':_0x33d072[_0xf95a('0x22')],'startProgressive':_0x33d072['startProgressive']};if(_0x33d072[_0xf95a('0x6f')]){_0x4b3279[_0xf95a('0x6f')]={'id':_0x33d072[_0xf95a('0x6f')]['id'],'name':_0x33d072[_0xf95a('0x6f')]['name'],'active':_0x33d072[_0xf95a('0x6f')]['active'],'callerid':_0x33d072[_0xf95a('0x6f')][_0xf95a('0x70')]};}if(_0x33d072[_0xf95a('0x3c')]){_0x4b3279['Interval']={'id':_0x33d072[_0xf95a('0x3c')]['id'],'name':_0x33d072[_0xf95a('0x3c')][_0xf95a('0x3a')]};}var _0x21a9b4=md5(JSON[_0xf95a('0x43')](_0x4b3279));if(_0x33d072['md5']!==_0x21a9b4){_0x33d072['md5']=_0x21a9b4;emit(util['format'](_0xf95a('0x71'),_0x4b3279[_0xf95a('0x3a')]),_0xf95a('0x72'),_0x4b3279);}}}function emitCampaignSummary(_0x1965c2){if(_0x1965c2['type']===_0xf95a('0x73')){emit(util[_0xf95a('0x74')](_0xf95a('0x75'),_0x1965c2['name']),_0xf95a('0x76'),_0x1965c2);}}function checkGetDataPredictive(_0x366d14){if(isNotNull(_0x366d14)){if(!_[_0xf95a('0x40')](_0x366d14)){loggerPredictive[_0xf95a('0x77')](_0xf95a('0x78'));loggerPredictive[_0xf95a('0x77')](_0xf95a('0x79'),_0x366d14[_0xf95a('0x6a')]);loggerPredictive['info'](_0xf95a('0x7a'),_0x366d14[_0xf95a('0x7b')]);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x7c'),_0x366d14[_0xf95a('0x65')]);loggerPredictive['info'](_0xf95a('0x7d'),_0x366d14[_0xf95a('0x64')]);loggerPredictive['info'](_0xf95a('0x7e'),_0x366d14[_0xf95a('0x62')]);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x7f'),_0x366d14[_0xf95a('0x63')]);loggerPredictive['info']('---------------------------');if(_0x366d14[_0xf95a('0x6a')]>0x0){if(!_[_0xf95a('0x36')](_0x366d14['predictiveIntervalAvgTalktime'])&&_0x366d14[_0xf95a('0x63')]>0x0){return!![];}else{loggerPredictive[_0xf95a('0x77')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0xf95a('0x36')](_0x366d14['predictiveIntervalAvgHoldtime'])&&_0x366d14[_0xf95a('0x62')]>0x0){return!![];}else{loggerPredictive[_0xf95a('0x77')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xf95a('0x77')](_0xf95a('0x80'));}}else{loggerPredictive[_0xf95a('0x77')](_0xf95a('0x81'));}}else{loggerPredictive[_0xf95a('0x77')](_0xf95a('0x81'));}return![];}function mergeDataErlangB(_0x4be7d7){return function(_0x42ff44){loggerPredictive[_0xf95a('0x77')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xf95a('0x77')](_0xf95a('0x82'),_0x42ff44['erlangCalls']);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x83'),_0x42ff44['erlangCallToSecond']);loggerPredictive['info'](_0xf95a('0x84'),_0x42ff44[_0xf95a('0x85')]);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x86'),_0x42ff44[_0xf95a('0x6e')]);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x84'),_0x42ff44[_0xf95a('0x85')]);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x87'));_[_0xf95a('0x88')](_0x4be7d7,_0x42ff44);};}function getDiff(_0x2d7007){var _0x33386b=moment()['milliseconds'](0x0);var _0x3efe4d=moment(_0x2d7007)[_0xf95a('0x44')](0x0);return _0x33386b[_0xf95a('0x45')](_0x3efe4d,_0xf95a('0x46'));}function ifInterval(_0x5c0f33,_0x560b58){if(_[_0xf95a('0x36')](_0x560b58)){return![];}if(getDiff(_0x560b58)<_0x5c0f33*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x3e486c){if(isNotNull(_0x3e486c)){if(!_['isUndefined'](_0x3e486c[_0xf95a('0x23')])){_0x3e486c['startProgressive']=undefined;loggerPredictive[_0xf95a('0x77')](_0x3e486c[_0xf95a('0x3a')],_0xf95a('0x89'));}if(!_['isUndefined'](_0x3e486c['startPredictive'])){_0x3e486c[_0xf95a('0x22')]=undefined;loggerPredictive[_0xf95a('0x77')](_0x3e486c['name'],_0xf95a('0x8a'));}if(!_[_0xf95a('0x36')](_0x3e486c[_0xf95a('0x8b')])){clearInterval(_0x3e486c['handlePredictive']);_0x3e486c[_0xf95a('0x8b')]=undefined;loggerPredictive['info'](_0x3e486c[_0xf95a('0x3a')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x46e542,_0x41405a){if(_0x41405a===0x0){return 0x0;}var _0x1a52bd=0x1;for(var _0x405077=0x1;_0x405077<=_0x41405a;_0x405077+=0x1){_0x1a52bd=0x1+_0x1a52bd*_0x405077/_0x46e542;}return 0x1/_0x1a52bd;}function isVoiceQueueOutbound(_0x116c43){return _0x116c43===_0xf95a('0x48');}function isNotPreview(_0x27fb20){return _0x27fb20!==_0xf95a('0x18');}function isCampaignIvr(_0x55481a){return _0x55481a==='ivr';}function getCallerId(_0x317834,_0x37ad5c,_0x87c28f){if(!_['isUndefined'](_0x87c28f)&&_0xf95a('0x8c')===typeof _0x87c28f&&!_[_0xf95a('0x40')](_0x87c28f)){if(!_[_0xf95a('0x36')](_0x37ad5c)&&_0xf95a('0x8c')===typeof _0x37ad5c&&!_['isEmpty'](_0x37ad5c)){return util[_0xf95a('0x74')]('\x22%s\x22\x20<%s>',_0x37ad5c,_0x87c28f);}return util[_0xf95a('0x74')](_0xf95a('0x8d'),_0x87c28f,_0x87c28f);}if(!_[_0xf95a('0x36')](_0x317834)&&_0xf95a('0x8c')===typeof _0x317834&&!_[_0xf95a('0x40')](_0x317834)){return _0x317834;}return _0xf95a('0x8e');}function loggerCatchQueueSummary(_0x5456e1,_0x4a2431){return function(_0x269a67){freeVariablesPredictive(_0x4a2431);emitVoiceQueueSummary(_0x4a2431);emitCampaignSummary(_0x4a2431);loggerSyncQueueSummary[_0xf95a('0x8f')](_0x5456e1,util[_0xf95a('0x90')](_0x269a67,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2788af,_0x5870f3){return function(_0x5ecb42){loggerPredictive[_0xf95a('0x8f')](_0x5870f3[_0xf95a('0x3a')],_0x2788af);loggerPredictive[_0xf95a('0x8f')](_0x5ecb42[_0xf95a('0x91')]);freeVariablesPredictive(_0x5870f3);};}function loggerCatch(_0x175190){return function(_0x41f70d){logger[_0xf95a('0x8f')](_0x175190,util[_0xf95a('0x90')](_0x41f70d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2a6cec){return _0x2a6cec&&!_[_0xf95a('0x36')](_0x2a6cec)&&_0x2a6cec[_0xf95a('0x92')]>0x0;}function decremetOriginate(_0x4bb9f3){if(!_['isUndefined'](_0x4bb9f3)&&_0x4bb9f3!==null){if(_0x4bb9f3['hasOwnProperty'](_0xf95a('0x6b'))){if(_0x4bb9f3['originated']>0x0){_0x4bb9f3[_0xf95a('0x6b')]-=0x1;}else{logger['error'](_0xf95a('0x93'));}}}else{logger[_0xf95a('0x8f')](_0xf95a('0x94'));}}function checkContactLowerLimitOriginate(_0xae4d8f,_0x2ddcdf,_0x30adc5){if(_0x2ddcdf>_0x30adc5){for(var _0xcc2c80=0x0;_0xcc2c80<_0x2ddcdf-_0x30adc5;_0xcc2c80+=0x1){decremetOriginate(_0xae4d8f);}}}function loggerGetContactDialer(_0x3a0395,_0x2a47c6,_0x4bc5e2){return function(_0x4175fc){checkContactLowerLimitOriginate(_0x2a47c6,_0x4bc5e2,0x0);logger[_0xf95a('0x8f')](_0x3a0395,util[_0xf95a('0x90')](_0x4175fc,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x49be51){return function(_0x146511){if(isNotNull(_0x146511)&&isNotNull(_0x146511[0x0])){if(_0x146511[0x0]['contactsRescheduled']>0x0){_0x49be51[_0xf95a('0x37')]=_0xf95a('0x95');logger[_0xf95a('0x77')]('[getContactDialer2][ReScheduled]'+_0x49be51['name'],_0x146511[0x0][_0xf95a('0x96')],_0xf95a('0x97'));}else{_0x49be51['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0xf95a('0x77')](_0xf95a('0x98')+_0x49be51['name']);}}};}function notSendMessagesQueue(_0x896cb2){if(_0x896cb2['sendMessageOneNotActive']){freeVariablesPredictive(_0x896cb2);if(_0x896cb2[_0xf95a('0x6b')]===0x0&&_0x896cb2[_0xf95a('0x4e')]===0x0&&_0x896cb2[_0xf95a('0x52')]===0x0&&(_0x896cb2[_0xf95a('0x4c')]||0x0)===0x0){_0x896cb2[_0xf95a('0x99')]=![];_0x896cb2[_0xf95a('0x4b')]=0x0;_0x896cb2[_0xf95a('0x37')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xf95a('0x8f')](_0xf95a('0x9a'),_0x896cb2['name'],_0xf95a('0x9b'));}else{_0x896cb2[_0xf95a('0x37')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xf95a('0x9a'),_0x896cb2[_0xf95a('0x3a')],_0xf95a('0x9c'));}emitVoiceQueueSummary(_0x896cb2);}}function notSendMessagesCampaign(_0x5f0b3a){if(_0x5f0b3a[_0xf95a('0x99')]){if(_0x5f0b3a[_0xf95a('0x6b')]===0x0){_0x5f0b3a[_0xf95a('0x99')]=![];_0x5f0b3a[_0xf95a('0x37')]=_0xf95a('0x9d');loggerSyncQueueSummary['error'](_0xf95a('0x9e'),_0x5f0b3a['name'],'is\x20not\x20active');}else{_0x5f0b3a[_0xf95a('0x37')]=_0xf95a('0x9f');loggerSyncQueueSummary[_0xf95a('0x8f')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5f0b3a[_0xf95a('0x3a')],_0xf95a('0x9c'));}emitCampaignSummary(_0x5f0b3a);}}function createObjHistory(_0x3ea1f6,_0x4c7877,_0x31cbe5,_0x287e99,_0x36646a){_0x3ea1f6[_0xf95a('0x37')]=_0x31cbe5;var _0x29c6e5=new Action(_0x3ea1f6,_0x4c7877);var _0x5cf622=new History(_0x29c6e5);_0x5cf622[_0xf95a('0xa0')]=_0x287e99;_0x5cf622[_0xf95a('0xa1')]=_0x36646a;_0x5cf622[_0xf95a('0xa2')]=_0x29c6e5[_0xf95a('0xa3')];return _0x5cf622;}Dialer['prototype'][_0xf95a('0x35')]=function(){var _0x304636=this;setInterval(function(){_0x304636[_0xf95a('0xa4')](_0x304636[_0xf95a('0x20')],_0xf95a('0xa5'));_0x304636[_0xf95a('0xa4')](_0x304636['actions'],_0xf95a('0xa6'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x270e07,_0x53691e){var _0x5db962=this;for(var _0x3608d5 in _0x270e07){if(_0x270e07[_0xf95a('0xa7')](_0x3608d5)){this['sequence'][_0xf95a('0x15')](function(){if(!_[_0xf95a('0xa8')](_0x270e07[_0x3608d5])){return ami[_0xf95a('0xa9')]({'action':_0xf95a('0xaa'),'channel':_0x270e07[_0x3608d5]['channel']})[_0xf95a('0xab')](function(_0x1c80ef){if(_0x1c80ef[_0xf95a('0x37')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x270e07[_0x3608d5]&&_0x270e07[_0x3608d5][_0xf95a('0x47')]!==_0xf95a('0x73')){_0x5db962[_0xf95a('0xac')](_0x5db962['voiceQueues'][_0x270e07[_0x3608d5][_0xf95a('0xad')]]);logger[_0xf95a('0x8f')](_0xf95a('0xae'),_0x53691e,_0x3608d5,_0x270e07[_0x3608d5][_0xf95a('0xad')]);delete _0x270e07[_0x3608d5];}if(_0x270e07[_0x3608d5]&&_0x270e07[_0x3608d5][_0xf95a('0x47')]===_0xf95a('0x73')){_0x5db962[_0xf95a('0xac')](_0x5db962[_0xf95a('0x1a')][_0x270e07[_0x3608d5][_0xf95a('0xad')]]);logger[_0xf95a('0x8f')](_0xf95a('0xaf'),_0x53691e,_0x3608d5,_0x270e07[_0x3608d5][_0xf95a('0xad')]);delete _0x270e07[_0x3608d5];}},0x2328);}});}});}}};Dialer['prototype'][_0xf95a('0xb0')]=function(_0x435d92){return BPromise['resolve']()[_0xf95a('0xb1')](cmHopper[_0xf95a('0xb0')](_0x435d92))[_0xf95a('0xab')](loggerCatch(_0xf95a('0xb2')));};Dialer[_0xf95a('0x14')][_0xf95a('0xb3')]=function(_0x225c5a){return BPromise[_0xf95a('0xb4')]()[_0xf95a('0xb1')](cmHopperBlack[_0xf95a('0xb3')](_0x225c5a))['catch'](loggerCatch(_0xf95a('0xb5')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x3c7b1a){return BPromise[_0xf95a('0xb4')]()[_0xf95a('0xb1')](cmHopperBlack['checkIsBlackListIvr'](_0x3c7b1a))[_0xf95a('0xab')](loggerCatch(_0xf95a('0xb6')));};Dialer[_0xf95a('0x14')]['averageHandleTime']=function(_0x27d887){return BPromise[_0xf95a('0xb4')]()[_0xf95a('0xb1')](cmHopperHistory[_0xf95a('0xb7')](_0x27d887))[_0xf95a('0xab')](loggerCatch(_0xf95a('0xb8')));};Dialer[_0xf95a('0x14')][_0xf95a('0xb9')]=function(_0x577733){return BPromise['resolve']()[_0xf95a('0xb1')](cmHopper[_0xf95a('0xb9')](_0x577733))[_0xf95a('0xab')](loggerCatch(_0xf95a('0xba')));};Dialer[_0xf95a('0x14')]['unlockContact']=function(_0x1c3318,_0x51ef4f,_0x8d1d5c){return BPromise['resolve']()[_0xf95a('0xb1')](cmHopper['unlockContact'](_0x1c3318,_0x51ef4f,_0x8d1d5c))['catch'](loggerCatch(_0xf95a('0xbb')));};Dialer[_0xf95a('0x14')]['getContactDialer']=function(_0x73bbfc,_0x34a0e1,_0x3dc334,_0x5086b4){return BPromise[_0xf95a('0xb4')]()[_0xf95a('0xb1')](cmHopper[_0xf95a('0xbc')](_0x73bbfc,_0x34a0e1,_0x3dc334,_0x5086b4))[_0xf95a('0xab')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xf95a('0x14')][_0xf95a('0xbd')]=function(_0x3bf078,_0x360e8,_0x3d34fc){return BPromise['resolve']()[_0xf95a('0xb1')](cmHopper[_0xf95a('0xbd')](_0x3bf078,_0x360e8,_0x3d34fc))[_0xf95a('0xab')](loggerCatch(_0xf95a('0xbe')));};Dialer[_0xf95a('0x14')]['getVoiceQueueRtPauses']=function(_0x444369){return BPromise['resolve']()[_0xf95a('0xb1')](voiceQueueRt[_0xf95a('0xbf')](_0x444369))[_0xf95a('0xab')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xf95a('0x14')][_0xf95a('0xc0')]=function(_0x54449c){return BPromise['resolve']()[_0xf95a('0xb1')](cmHopper[_0xf95a('0xc0')](_0x54449c))[_0xf95a('0xab')](loggerCatch(_0xf95a('0xc1')));};Dialer[_0xf95a('0x14')][_0xf95a('0xc2')]=function(_0x3c7ecf){return BPromise[_0xf95a('0xb4')]()[_0xf95a('0xb1')](cmHopperHistory['createHistory'](_0x3c7ecf))['catch'](loggerCatch(_0xf95a('0xc3')));};Dialer[_0xf95a('0x14')]['updateOriginated']=function(_0x495018){if(!_['isUndefined'](_0x495018)&&_0x495018!==null){if(_0x495018[_0xf95a('0xa7')](_0xf95a('0x6b'))){if(_0x495018[_0xf95a('0x6b')]>0x0){_0x495018[_0xf95a('0x6b')]-=0x1;}else{logger['error'](_0xf95a('0xc4'));}}}else{logger[_0xf95a('0x8f')](_0xf95a('0xc5'));}};Dialer['prototype']['loggerHandler']=function(_0x3ef2f9,_0x2e613d){var _0x4e56a9=this;return function(_0x5d0055){_0x4e56a9[_0xf95a('0xac')](_0x2e613d);logger[_0xf95a('0x8f')](_0x3ef2f9,util[_0xf95a('0x90')](_0x5d0055,{'showHidden':![],'depth':null}));};};Dialer[_0xf95a('0x14')][_0xf95a('0xc6')]=function(_0x54bb0c,_0x587eaf,_0x2c1d4d){var _0x970fc5={'state':0x19,'statedesc':'notFound'};this[_0xf95a('0xac')](_0x587eaf);this[_0xf95a('0xc7')](_[_0xf95a('0x88')](_0x970fc5,_[_0xf95a('0xc8')](_0x2c1d4d,[_0xf95a('0xc9'),'ListId',_0xf95a('0xca'),_0xf95a('0xcb'),_0xf95a('0xcc')])),_0xf95a('0xcd'),_0xf95a('0xce'));logger[_0xf95a('0x8f')](_0x54bb0c);};Dialer[_0xf95a('0x14')][_0xf95a('0xcf')]=function(_0x1e1301){return _0x1e1301===_0xf95a('0xd0');};Dialer['prototype'][_0xf95a('0xd1')]=function(_0x3bc16f){return!_[_0xf95a('0x36')](_0x3bc16f)&&_0x3bc16f&&!_['isUndefined'](_0x3bc16f[_0xf95a('0x3a')])&&!_['isUndefined'](_0x3bc16f[_0xf95a('0xd2')])&&_0x3bc16f[_0xf95a('0xd2')]&&(this[_0xf95a('0x1c')][util[_0xf95a('0x74')]('SIP/%s',_0x3bc16f[_0xf95a('0x3a')])][_0xf95a('0xaa')]===_0xf95a('0xd3')||this[_0xf95a('0x1c')][util[_0xf95a('0x74')]('SIP/%s',_0x3bc16f[_0xf95a('0x3a')])][_0xf95a('0xaa')]===_0xf95a('0xd4'));};Dialer[_0xf95a('0x14')][_0xf95a('0xc7')]=function(_0x4672d6,_0x539d82,_0x59b126){this[_0xf95a('0xc2')](_0x4672d6)[_0xf95a('0xab')](loggerCatch(_0x539d82));this['moveContactManagedDialer'](_0x4672d6)['catch'](loggerCatch(_0x59b126));};Dialer[_0xf95a('0x14')]['syncVarSet']=function(_0x1dc731){var _0x5dd025=this['uniqueId'][_0x1dc731['uniqueid']];var _0x46f05a;if(!_[_0xf95a('0xa8')](_0x1dc731)&&!_[_0xf95a('0xa8')](_0x1dc731[_0xf95a('0xd5')])&&!_['isNil'](_0x1dc731['variable'][_0xf95a('0xd6')])&&_0x1dc731[_0xf95a('0xd7')]===_0xf95a('0xd8')&&_0x5dd025){if(_0x5dd025['type']!=='ivr'&&this[_0xf95a('0x19')][_0x5dd025[_0xf95a('0xad')]][_0xf95a('0xd9')]&&_0x1dc731[_0xf95a('0xda')]===_0xf95a('0xdb')){delete this[_0xf95a('0x20')][_0x1dc731[_0xf95a('0xdc')]];this[_0xf95a('0xac')](this[_0xf95a('0x19')][_0x5dd025[_0xf95a('0xad')]]);this[_0xf95a('0x19')][_0x5dd025[_0xf95a('0xad')]][_0xf95a('0xdd')]+=0x1;this[_0xf95a('0x19')][_0x5dd025[_0xf95a('0xad')]][_0xf95a('0x57')]+=0x1;_0x46f05a=new Hangup(_0x5dd025,_0x1dc731);_0x46f05a[_0xf95a('0xa0')]=0x12;_0x46f05a[_0xf95a('0xa1')]=_0xf95a('0xde');_0x46f05a[_0xf95a('0xdf')]=_0xf95a('0xe0');this['saveInDb'](_0x46f05a,_0xf95a('0xe1'),'[syncHangupInAMD]');}if(_0x5dd025[_0xf95a('0x47')]!==_0xf95a('0x73')&&this[_0xf95a('0x19')][_0x5dd025['queue']][_0xf95a('0xd9')]&&_0x1dc731[_0xf95a('0xda')]===_0xf95a('0xe2')){delete this[_0xf95a('0x20')][_0x1dc731[_0xf95a('0xdc')]];this[_0xf95a('0xac')](this[_0xf95a('0x19')][_0x5dd025['queue']]);this[_0xf95a('0x19')][_0x5dd025['queue']][_0xf95a('0xdd')]+=0x1;this[_0xf95a('0x19')][_0x5dd025['queue']][_0xf95a('0x57')]+=0x1;_0x46f05a=new Hangup(_0x5dd025,_0x1dc731);_0x46f05a['state']=0x13;_0x46f05a[_0xf95a('0xa1')]='Machine';_0x46f05a[_0xf95a('0xdf')]=_0xf95a('0xe0');_0x46f05a['amd']=!![];this[_0xf95a('0xc7')](_0x46f05a,'[syncMachine][createHistory]','[syncMachine]');}if(_0x5dd025[_0xf95a('0x47')]===_0xf95a('0x73')&&this['campaigns'][_0x5dd025[_0xf95a('0xad')]][_0xf95a('0xd9')]&&_0x1dc731[_0xf95a('0xda')]===_0xf95a('0xdb')){delete this[_0xf95a('0x20')][_0x1dc731[_0xf95a('0xdc')]];this[_0xf95a('0xac')](this['campaigns'][_0x5dd025['queue']]);_0x46f05a=new Hangup(_0x5dd025,_0x1dc731);_0x46f05a[_0xf95a('0xa0')]=0x12;_0x46f05a[_0xf95a('0xa1')]=_0xf95a('0xde');_0x46f05a[_0xf95a('0xdf')]='AMD';this[_0xf95a('0xc7')](_0x46f05a,_0xf95a('0xe3'),_0xf95a('0xe4'));}if(_0x5dd025[_0xf95a('0x47')]===_0xf95a('0x73')&&this[_0xf95a('0x1a')][_0x5dd025[_0xf95a('0xad')]][_0xf95a('0xd9')]&&_0x1dc731['value']===_0xf95a('0xe2')){delete this[_0xf95a('0x20')][_0x1dc731['uniqueid']];this[_0xf95a('0xac')](this['campaigns'][_0x5dd025[_0xf95a('0xad')]]);_0x46f05a=new Hangup(_0x5dd025,_0x1dc731);_0x46f05a[_0xf95a('0xa0')]=0x13;_0x46f05a[_0xf95a('0xa1')]=_0xf95a('0xe5');_0x46f05a[_0xf95a('0xdf')]='AMD';_0x46f05a[_0xf95a('0xe6')]=!![];this[_0xf95a('0xc7')](_0x46f05a,_0xf95a('0xe7'),_0xf95a('0xe8'));}}};Dialer[_0xf95a('0x14')][_0xf95a('0x2d')]=function(_0x5b1012){var _0x49247c=this[_0xf95a('0x20')][_0x5b1012[_0xf95a('0xdc')]];var _0x2232ff=this;var _0x7af3ca;if(_0x49247c&&_0x49247c['type']===_0xf95a('0x73')){delete this[_0xf95a('0x20')][_0x5b1012['uniqueid']];this[_0xf95a('0xac')](this[_0xf95a('0x1a')][_0x49247c['queue']]);this[_0xf95a('0x1a')][_0x49247c['queue']][_0xf95a('0xe9')]+=0x1;_0x7af3ca=new Hangup(_0x49247c,_0x5b1012);this[_0xf95a('0xc2')](_0x7af3ca)[_0xf95a('0xab')](loggerCatch(_0xf95a('0xea')));this[_0xf95a('0xc0')](_0x7af3ca)[_0xf95a('0xab')](loggerCatch(_0xf95a('0xeb')));}if(_0x49247c&&_0x49247c[_0xf95a('0x47')]!==_0xf95a('0x73')&&isNotNull(this[_0xf95a('0x19')][_0x49247c[_0xf95a('0xad')]]['dialQueueProject'])){delete this[_0xf95a('0x20')][_0x5b1012[_0xf95a('0xdc')]];this[_0xf95a('0xac')](this[_0xf95a('0x19')][_0x49247c[_0xf95a('0xad')]]);this['voiceQueues'][_0x49247c[_0xf95a('0xad')]][_0xf95a('0xdd')]+=0x1;this[_0xf95a('0x19')][_0x49247c[_0xf95a('0xad')]][_0xf95a('0x57')]+=0x1;_0x7af3ca=new Hangup(_0x49247c,_0x5b1012);_0x7af3ca[_0xf95a('0xa0')]=0x10;_0x7af3ca[_0xf95a('0xa1')]=_0xf95a('0xec');_0x7af3ca[_0xf95a('0xdf')]=_0xf95a('0xed');this[_0xf95a('0xc2')](_0x7af3ca)['catch'](loggerCatch(_0xf95a('0xea')));this[_0xf95a('0xc0')](_0x7af3ca)[_0xf95a('0xab')](loggerCatch(_0xf95a('0xeb')));}if(_0x49247c&&_0x49247c['type']!==_0xf95a('0x73')&&!isNotNull(this['voiceQueues'][_0x49247c[_0xf95a('0xad')]][_0xf95a('0xee')])){delete this[_0xf95a('0x20')][_0x5b1012[_0xf95a('0xdc')]];this[_0xf95a('0xac')](this['voiceQueues'][_0x49247c[_0xf95a('0xad')]]);this[_0xf95a('0x19')][_0x49247c[_0xf95a('0xad')]][_0xf95a('0x61')]+=0x1;_0x7af3ca=new Hangup(_0x49247c,_0x5b1012);_0x7af3ca['state']=0xc;_0x7af3ca[_0xf95a('0xa1')]=_0x5b1012[_0xf95a('0xef')];_0x7af3ca['membername']=_0xf95a('0xf0');this['createHistory'](_0x7af3ca)[_0xf95a('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xf95a('0xc0')](_0x7af3ca)[_0xf95a('0xab')](loggerCatch(_0xf95a('0xeb')));}};Dialer[_0xf95a('0x14')][_0xf95a('0x2a')]=function(_0x252ea2){var _0x3a3f7=this[_0xf95a('0x20')][_0x252ea2['uniqueid']];var _0x42990a=this;if(this[_0xf95a('0x19')][_0x252ea2[_0xf95a('0xad')]]){if(_0x3a3f7&&_0x3a3f7['type']!==_0xf95a('0x73')){delete this[_0xf95a('0x20')][_0x252ea2['uniqueid']];this['voiceQueues'][_0x252ea2[_0xf95a('0xad')]]['outboundAnswerCallsDay']+=0x1;var _0x377a39=new AgentComplete(_0x3a3f7,_0x252ea2);if(_0x252ea2[_0xf95a('0xf1')]===_0xf95a('0xf2')){_0x377a39[_0xf95a('0xf3')]=this[_0xf95a('0x19')][_0x252ea2[_0xf95a('0xad')]]['dialQueueProject2']&&this['voiceQueues'][_0x252ea2[_0xf95a('0xad')]][_0xf95a('0xf4')]?moment()[_0xf95a('0x74')](_0xf95a('0xf5')):undefined;}this['createHistory'](_0x377a39)[_0xf95a('0xab')](loggerCatch(_0xf95a('0xf6')));this[_0xf95a('0xc0')](_0x377a39)[_0xf95a('0xab')](loggerCatch(_0xf95a('0xf7')));}}};Dialer[_0xf95a('0x14')][_0xf95a('0x27')]=function(_0x158447){if(this[_0xf95a('0x19')][_0x158447[_0xf95a('0xad')]]){if(this[_0xf95a('0x20')][_0x158447['uniqueid']]&&this[_0xf95a('0x20')][_0x158447[_0xf95a('0xdc')]][_0xf95a('0x47')]!==_0xf95a('0x73')){this['updateOriginated'](this['voiceQueues'][_0x158447[_0xf95a('0xad')]]);this['uniqueId'][_0x158447[_0xf95a('0xdc')]]['answertime']=moment()[_0xf95a('0x74')](_0xf95a('0xf5'));}}};Dialer[_0xf95a('0x14')]['queueCallerAbandonCreateState']=function(_0x421f55){this[_0xf95a('0xc2')](_0x421f55)[_0xf95a('0xab')](loggerCatch(_0xf95a('0xf6')));this['moveContactManagedDialer'](_0x421f55)[_0xf95a('0xab')](loggerCatch(_0xf95a('0xf8')));};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x4a2d10){var _0x387262=this[_0xf95a('0x20')][_0x4a2d10[_0xf95a('0xdc')]];var _0x4e3712=this;if(this[_0xf95a('0x19')][_0x4a2d10['queue']]){if(_0x387262&&_0x387262[_0xf95a('0x47')]!==_0xf95a('0x73')){delete this[_0xf95a('0x20')][_0x4a2d10[_0xf95a('0xdc')]];this['updateOriginated'](this[_0xf95a('0x19')][_0x4a2d10[_0xf95a('0xad')]]);_0x387262['droptime']=moment()[_0xf95a('0x74')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5ef6d3=new QueueCallerAbandon(_0x387262,_0x4a2d10);if(getSeconds(_0x387262[_0xf95a('0xf9')],_0x387262[_0xf95a('0xfa')])>=_0x387262['dialQueueTimeout']){this['voiceQueues'][_0x4a2d10[_0xf95a('0xad')]][_0xf95a('0x65')]+=0x1;this[_0xf95a('0x19')][_0x4a2d10[_0xf95a('0xad')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x4a2d10[_0xf95a('0xad')]][_0xf95a('0xfb')]+=0x1;_0x5ef6d3['state']=0xa;_0x5ef6d3[_0xf95a('0xa1')]=_0xf95a('0xfc');_0x5ef6d3[_0xf95a('0xfd')]=_0xf95a('0xfe');_0x5ef6d3[_0xf95a('0xf3')]=this['voiceQueues'][_0x4a2d10[_0xf95a('0xad')]]['dialQueueProject2']?moment()[_0xf95a('0x74')](_0xf95a('0xf5')):undefined;if(_0x5ef6d3['countdropretry']>=this[_0xf95a('0x19')][_0x4a2d10[_0xf95a('0xad')]][_0xf95a('0xff')]-0x1){this['queueCallerAbandonCreateState'](_0x5ef6d3);}else{this[_0xf95a('0xb9')]({'active':![],'countdropretry':_0x5ef6d3[_0xf95a('0x100')]+=0x1,'scheduledat':moment()[_0xf95a('0x101')](this[_0xf95a('0x19')][_0x4a2d10['queue']][_0xf95a('0x102')],_0xf95a('0x103'))[_0xf95a('0x74')](_0xf95a('0xf5')),'ContactId':_0x387262['ContactId'],'ListId':_0x387262[_0xf95a('0x104')],'VoiceQueueId':_0x387262[_0xf95a('0xcb')]||undefined,'CampaignId':_0x387262[_0xf95a('0xcc')]||undefined})[_0xf95a('0xab')](loggerCatch(_0xf95a('0x105')));}}else{this['voiceQueues'][_0x4a2d10[_0xf95a('0xad')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xf95a('0x19')][_0x4a2d10[_0xf95a('0xad')]]['outboundDropCallsDayCallersExit']+=0x1;_0x5ef6d3['state']=0xb;_0x5ef6d3[_0xf95a('0xa1')]=_0xf95a('0x106');_0x5ef6d3[_0xf95a('0xfd')]=_0xf95a('0x107');if(_0x5ef6d3[_0xf95a('0x108')]>=this['voiceQueues'][_0x4a2d10[_0xf95a('0xad')]]['dialAbandonedMaxRetry']-0x1){this['queueCallerAbandonCreateState'](_0x5ef6d3);}else{this[_0xf95a('0xb9')]({'active':![],'countabandonedretry':_0x5ef6d3[_0xf95a('0x108')]+=0x1,'scheduledat':moment()[_0xf95a('0x101')](this[_0xf95a('0x19')][_0x4a2d10[_0xf95a('0xad')]]['dialAbandonedRetryFrequency'],_0xf95a('0x103'))[_0xf95a('0x74')](_0xf95a('0xf5')),'ContactId':_0x387262[_0xf95a('0xc9')],'ListId':_0x387262['ListId'],'VoiceQueueId':_0x387262[_0xf95a('0xcb')]||undefined,'CampaignId':_0x387262['CampaignId']||undefined})[_0xf95a('0xab')](loggerCatch(_0xf95a('0x109')));}}}}};Dialer[_0xf95a('0x14')][_0xf95a('0x2f')]=function(_0xa088ac){if(this[_0xf95a('0x1f')][_0xa088ac[_0xf95a('0xdc')]]){this[_0xf95a('0x1f')][_0xa088ac['uniqueid']][_0xf95a('0x10a')]=_0xa088ac['channel'];}if(this[_0xf95a('0x20')][_0xa088ac[_0xf95a('0xdc')]]){this[_0xf95a('0x20')][_0xa088ac['uniqueid']][_0xf95a('0x10a')]=_0xa088ac[_0xf95a('0x10a')];}};Dialer[_0xf95a('0x14')][_0xf95a('0x10b')]=function(_0x3fcc1b){if(strategy[this['voiceQueues'][this[_0xf95a('0x1f')][_0x3fcc1b['actionid']][_0xf95a('0xad')]]['strategy']]===_0xf95a('0x13')){if(this[_0xf95a('0x1f')][_0x3fcc1b[_0xf95a('0x10c')]]&&_[_0xf95a('0xa8')](this[_0xf95a('0x1f')][_0x3fcc1b[_0xf95a('0x10c')]][_0xf95a('0x10d')])&&_0x3fcc1b['status']==='1'&&_0x3fcc1b['paused']==='0'){if(this[_0xf95a('0x1b')][_0x3fcc1b['stateinterface']]){if(!this[_0xf95a('0x1b')][_0x3fcc1b['stateinterface']][_0xf95a('0x10d')]){this[_0xf95a('0x1b')][_0x3fcc1b['stateinterface']][_0xf95a('0x10d')]=!![];this[_0xf95a('0x1f')][_0x3fcc1b[_0xf95a('0x10c')]][_0xf95a('0x10d')]=!![];this['actions'][_0x3fcc1b[_0xf95a('0x10c')]][_0xf95a('0x10e')]=_0x3fcc1b[_0xf95a('0x10e')];}}}}else if((strategy[this['voiceQueues'][this[_0xf95a('0x1f')][_0x3fcc1b[_0xf95a('0x10c')]][_0xf95a('0xad')]][_0xf95a('0x49')]]||_0xf95a('0x12'))===_0xf95a('0x12')){if(this['actions'][_0x3fcc1b[_0xf95a('0x10c')]]){if(this['agents'][_0x3fcc1b[_0xf95a('0x10e')]]){this[_0xf95a('0x1f')][_0x3fcc1b[_0xf95a('0x10c')]][_0xf95a('0x10e')]=_0x3fcc1b[_0xf95a('0x10e')];if(_[_0xf95a('0xa8')](this[_0xf95a('0x25')][this['actions'][_0x3fcc1b[_0xf95a('0x10c')]][_0xf95a('0xad')]])){this['queueBooked'][this[_0xf95a('0x1f')][_0x3fcc1b[_0xf95a('0x10c')]][_0xf95a('0xad')]]=[];}this[_0xf95a('0x25')][this[_0xf95a('0x1f')][_0x3fcc1b[_0xf95a('0x10c')]]['queue']][_0xf95a('0x10f')](_[_0xf95a('0x88')](_[_0xf95a('0xc8')](this[_0xf95a('0x1f')][_0x3fcc1b[_0xf95a('0x10c')]],[_0xf95a('0x110'),_0xf95a('0x10e')]),{'status':_0x3fcc1b['status'],'paused':_0x3fcc1b[_0xf95a('0x111')]}));}}}};function unlockQueueStatus(_0x19fff3,_0x4c044a){setTimeout(function(){if(_[_0xf95a('0x36')](_0x19fff3['queueStatusComplete'])){loggerBooked['error'](_0xf95a('0x112'),_0x4c044a);}_0x19fff3[_0xf95a('0x113')]=!![];loggerBooked[_0xf95a('0x77')](_0xf95a('0x114'),_0x4c044a,JSON['stringify'](_['pick'](_0x19fff3,[_0xf95a('0x3a'),_0xf95a('0x113')])));},0x1f3);}Dialer[_0xf95a('0x14')]['syncQueueStatusComplete']=function(_0x358366){var _0x121e37=this;var _0x34bbf1=_0x121e37[_0xf95a('0x19')][_0x121e37[_0xf95a('0x1f')][_0x358366[_0xf95a('0x10c')]][_0xf95a('0xad')]];if(strategy[this[_0xf95a('0x19')][this[_0xf95a('0x1f')][_0x358366[_0xf95a('0x10c')]][_0xf95a('0xad')]]['strategy']]===_0xf95a('0x13')){if(this[_0xf95a('0x1f')][_0x358366[_0xf95a('0x10c')]]&&this[_0xf95a('0x1f')][_0x358366['actionid']][_0xf95a('0x10e')]){this[_0xf95a('0x18')][_0xf95a('0x115')](this[_0xf95a('0x1f')][_0x358366[_0xf95a('0x10c')]][_0xf95a('0x110')],this[_0xf95a('0x1f')][_0x358366['actionid']][_0xf95a('0x10e')])[_0xf95a('0xab')](function(_0x156f88){logger['error'](_0xf95a('0x116'),util[_0xf95a('0x90')](_0x156f88,{'showHidden':![],'depth':null}));})[_0xf95a('0x117')](function(){_0x121e37[_0xf95a('0xac')](_0x121e37[_0xf95a('0x19')][_0x121e37[_0xf95a('0x1f')][_0x358366['actionid']][_0xf95a('0xad')]]);_0x121e37[_0xf95a('0x1b')][_0x121e37[_0xf95a('0x1f')][_0x358366['actionid']]['stateinterface']][_0xf95a('0x10d')]=![];delete _0x121e37[_0xf95a('0x1f')][_0x358366[_0xf95a('0x10c')]];unlockQueueStatus(_0x34bbf1);});}else{this[_0xf95a('0xac')](this[_0xf95a('0x19')][this[_0xf95a('0x1f')][_0x358366[_0xf95a('0x10c')]]['queue']]);this[_0xf95a('0xb9')]({'active':![],'ContactId':this['actions'][_0x358366[_0xf95a('0x10c')]]['ContactId'],'ListId':this[_0xf95a('0x1f')][_0x358366[_0xf95a('0x10c')]]['ListId'],'VoiceQueueId':this['actions'][_0x358366['actionid']][_0xf95a('0xcb')]||undefined,'CampaignId':this[_0xf95a('0x1f')][_0x358366['actionid']][_0xf95a('0xcc')]||undefined})[_0xf95a('0xab')](loggerCatch(_0xf95a('0x118')));delete this[_0xf95a('0x1f')][_0x358366[_0xf95a('0x10c')]];unlockQueueStatus(_0x34bbf1);}}else if((strategy[this['voiceQueues'][this[_0xf95a('0x1f')][_0x358366[_0xf95a('0x10c')]][_0xf95a('0xad')]][_0xf95a('0x49')]]||'rrmemory')===_0xf95a('0x12')){var _0x29d81a;if(this[_0xf95a('0x1f')][_0x358366['actionid']]&&!_[_0xf95a('0x40')](this['queueBooked'][this['actions'][_0x358366[_0xf95a('0x10c')]][_0xf95a('0xad')]])){if(this[_0xf95a('0x119')][_0x121e37[_0xf95a('0x1f')][_0x358366[_0xf95a('0x10c')]][_0xf95a('0xad')]]){this[_0xf95a('0x119')][_0x121e37['actions'][_0x358366['actionid']][_0xf95a('0xad')]]=this['queueBookedRR'][this['actions'][_0x358366[_0xf95a('0x10c')]]['queue']]?this[_0xf95a('0x119')][this[_0xf95a('0x1f')][_0x358366['actionid']][_0xf95a('0xad')]]:this['queueBooked'][this[_0xf95a('0x1f')][_0x358366[_0xf95a('0x10c')]][_0xf95a('0xad')]]?this[_0xf95a('0x25')][this['actions'][_0x358366[_0xf95a('0x10c')]]['queue']]['_rr']||0x0:0x0;}this[_0xf95a('0x25')][this['actions'][_0x358366[_0xf95a('0x10c')]][_0xf95a('0xad')]]['_rr']=this[_0xf95a('0x119')][this['actions'][_0x358366[_0xf95a('0x10c')]][_0xf95a('0xad')]];for(var _0x4ea094=0x0;_0x4ea094=0x0?!![]:![];})['catch'](myreject(_0x298819)));}}else{_0x5bd6c3['push'](ami[_0xf95a('0xa9')]({'action':'command','command':util[_0xf95a('0x74')](_0xf95a('0x132'),_0x229068,!_['isUndefined'](config['timezones'][_0x106796])?_0x106796:'')})[_0xf95a('0xb1')](function(_0x1afcd0){return _0x1afcd0[_0xf95a('0x133')][_0xf95a('0x134')]('true')>=0x0?!![]:![];})[_0xf95a('0xab')](myreject(_0x298819)));}BPromise[_0xf95a('0x135')](_0x5bd6c3)[_0xf95a('0xb1')](function(_0x464bf2){var _0x106fab=_[_0xf95a('0x136')](_0x464bf2);if(_0x106fab){return _0x257027(_0x106fab);}else{_0x11b770[_0xf95a('0x37')]=_0x486bf7?_0xf95a('0x137'):_0xf95a('0x138');return _0x298819(msgResponse(_0xf95a('0x139'),_0xf95a('0x129'),'Global:\x20'+_0x486bf7+'\x20'+_0x1d357f+_0xf95a('0x13a')+util[_0xf95a('0x90')](_0x229068,{'showHidden':![],'depth':null})+_0xf95a('0x13b')+_0x106796));}})[_0xf95a('0xab')](function(_0x450e58){return _0x298819(msgResponse(_0xf95a('0x127'),'Failure',JSON[_0xf95a('0x43')](_0x450e58)));});});};Dialer['prototype'][_0xf95a('0x13c')]=function(_0x56f1b1){var _0x6e6752=this;return function(){switch(_0x56f1b1[_0xf95a('0x55')]){case _0xf95a('0x13d'):freeVariablesPredictive(_0x56f1b1);_0x6e6752['handlePower'](_0x56f1b1,0x1);break;case _0xf95a('0x13e'):freeVariablesPredictive(_0x56f1b1);_0x6e6752[_0xf95a('0x13f')](_0x56f1b1,_0x56f1b1['dialPowerLevel']);break;case _0xf95a('0x5'):_0x6e6752[_0xf95a('0x5')](_0x56f1b1);break;case _0xf95a('0x140'):freeVariablesPredictive(_0x56f1b1);_0x6e6752[_0xf95a('0x13f')](_0x56f1b1,0x1);break;default:freeVariablesPredictive(_0x56f1b1);logger[_0xf95a('0x8f')](_0xf95a('0x141'),_0x56f1b1[_0xf95a('0x3a')],_0xf95a('0x142'));}};};Dialer[_0xf95a('0x14')][_0xf95a('0x143')]=function(_0x5dc7ee){var _0x46c6ed=this;return function(){_0x46c6ed[_0xf95a('0x144')](_0x5dc7ee);};};Dialer[_0xf95a('0x14')]['syncQueueSummary']=function(_0x24f2f8){var _0x56d293=this;if(isNotPreview(_0x24f2f8[_0xf95a('0x55')])){if(isVoiceQueueOutbound(_0x24f2f8[_0xf95a('0x47')])&&isActive(_0x24f2f8[_0xf95a('0x54')])){_0x24f2f8[_0xf95a('0x99')]=!![];BPromise[_0xf95a('0xb4')]()[_0xf95a('0xb1')](checkIsLoggedIn(_0x24f2f8,_0x24f2f8[_0xf95a('0x145')]))[_0xf95a('0xb1')](checkIsActive(_0x24f2f8,_0x24f2f8[_0xf95a('0x54')]))[_0xf95a('0xb1')](checkInterval(_0x24f2f8))['then'](_0x56d293[_0xf95a('0x146')](_0x24f2f8))[_0xf95a('0xb1')](_0x56d293[_0xf95a('0x126')](_0x24f2f8[_0xf95a('0x147')],_0x24f2f8[_0xf95a('0x148')],_0x24f2f8[_0xf95a('0x3a')],_0x24f2f8))['then'](_0x56d293[_0xf95a('0x128')](_0x24f2f8[_0xf95a('0x3c')],_0x24f2f8[_0xf95a('0x148')],_0x24f2f8[_0xf95a('0x3a')],_0x24f2f8))['then'](_0x56d293[_0xf95a('0x13c')](_0x24f2f8))[_0xf95a('0xab')](loggerCatchQueueSummary('[syncQueueSummary]',_0x24f2f8));}else{notSendMessagesQueue(_0x24f2f8);}}else{freeVariablesPredictive(_0x24f2f8);}};Dialer[_0xf95a('0x14')][_0xf95a('0x122')]=function(){var _0x162855=this;var _0xf47d65;for(var _0x176fdd in this[_0xf95a('0x1a')]){if(this[_0xf95a('0x1a')][_0xf95a('0xa7')](_0x176fdd)){_0xf47d65=this[_0xf95a('0x1a')][_0x176fdd];if(isCampaignIvr(_0xf47d65['type'])&&isActive(_0xf47d65['active'])){_0xf47d65['sendMessageOneNotActive']=!![];BPromise['resolve']()['then'](checkIsActive(_0xf47d65,_0xf47d65['active']))[_0xf95a('0xb1')](checkInterval(_0xf47d65))[_0xf95a('0xb1')](_0x162855[_0xf95a('0x146')](_0xf47d65))[_0xf95a('0xb1')](_0x162855[_0xf95a('0x126')](_0xf47d65[_0xf95a('0x147')],_0xf47d65['dialTimezone'],_0xf47d65[_0xf95a('0x3a')],_0xf47d65))[_0xf95a('0xb1')](_0x162855[_0xf95a('0x128')](_0xf47d65['Interval'],_0xf47d65[_0xf95a('0x148')],_0xf47d65['name'],_0xf47d65))[_0xf95a('0xb1')](_0x162855['launchHandleIvr'](_0xf47d65))[_0xf95a('0xab')](loggerCatchQueueSummary(_0xf95a('0x149'),_0xf47d65));}else{notSendMessagesCampaign(_0xf47d65);}}}};function getCallerIdRandom(_0x5b53dc,_0x5ed605){var _0x314a91,_0xd0d277,_0x231f8c;if(_0x5ed605<=0x0){_0x5ed605=0x1;}_0x314a91=new RegExp('\x5cw{0,'+_0x5ed605+'}$');_0xd0d277=Math[_0xf95a('0x14a')](0xa,_0x5ed605-0x1);_0x231f8c=Math[_0xf95a('0x14a')](0xa,_0x5ed605)-0x1;return util[_0xf95a('0x74')]('%s',_[_0xf95a('0x14b')](_0x5b53dc,_0x314a91,_['random'](_0xd0d277,_0x231f8c)));}function extractCalleridName(_0x13cff1){var _0x2cc392=_0x13cff1['match'](/"(.*?)"/);return _0x2cc392?_0x2cc392[0x1]:_0x13cff1;}function extractCalleridNumber(_0x1bf67c){var _0x21a0a2=_0x1bf67c[_0xf95a('0x14c')](/<(.*?)>/);return _0x21a0a2?_0x21a0a2[0x1]:_0x1bf67c;}Dialer['prototype'][_0xf95a('0x14d')]=function(_0x1442e9,_0x53a3c1){var _0x33f506=this;var _0x2ed783=uuid['v4']();this[_0xf95a('0x1f')][_0x2ed783]=new Action(_0x1442e9,_0x53a3c1,_0x2ed783);return new BPromise(function(_0x5359de,_0x4cb97d){if(_['isUndefined'](_0x1442e9)&&_0xf95a('0x14e')!==typeof _0x1442e9){return _0x4cb97d(msgResponse('originate',_0xf95a('0x129'),_0xf95a('0x14f')));}if(_[_0xf95a('0x36')](_0x53a3c1[_0xf95a('0x150')][_0xf95a('0x151')])||_0x53a3c1[_0xf95a('0x150')]['phone']===null){return _0x4cb97d(msgResponse(_0xf95a('0x152'),'Failure',_0xf95a('0x153')));}var _0x2eba31={'XMD-CALLERID':_0x33f506[_0xf95a('0x1f')][_0x2ed783][_0xf95a('0x154')](),'XMD-AGI':_0x1442e9[_0xf95a('0xee')]?util[_0xf95a('0x74')](_0xf95a('0x155'),ipAgi,_0x1442e9['dialQueueProject']):_0xf95a('0x156'),'XMD-AGIAFTER':_0x1442e9[_0xf95a('0x157')]?util[_0xf95a('0x74')](_0xf95a('0x155'),ipAgi,_0x1442e9['dialQueueProject2']):_0xf95a('0x156'),'XMD-QUEUE':_0x1442e9[_0xf95a('0x47')]==='outbound'?util[_0xf95a('0x74')](_0xf95a('0x158'),_0x1442e9[_0xf95a('0x3a')],_0x1442e9[_0xf95a('0x159')]||'',_0x1442e9[_0xf95a('0xf4')]?'c':'',_0x1442e9[_0xf95a('0x15a')]||0x3):_0xf95a('0x156'),'XMD-CONTACTID':_0x53a3c1[_0xf95a('0xc9')],'XMD-CDRTYPE':_0xf95a('0x4'),'CALLERID(all)':_0x33f506['actions'][_0x2ed783][_0xf95a('0x154')](),'XMD-AMD':_0x1442e9['dialAMDActive']?_0xf95a('0x15b'):_0xf95a('0x156'),'XMD-DESTINATION':_0xf95a('0xd8')};if(_0x1442e9[_0xf95a('0xd9')]){_0x2eba31[_0xf95a('0x15c')]=_0x1442e9[_0xf95a('0x15d')]||0x9c4;_0x2eba31['XMD-AMDGREETING']=_0x1442e9['dialAMDGreeting']||0x5dc;_0x2eba31[_0xf95a('0x15e')]=_0x1442e9[_0xf95a('0x15f')]||0x320;_0x2eba31['XMD-AMDTOTALANALYSISTIME']=_0x1442e9['dialAMDTotalAnalysisTime']||0x1388;_0x2eba31[_0xf95a('0x160')]=_0x1442e9[_0xf95a('0x161')]||0x64;_0x2eba31[_0xf95a('0x162')]=_0x1442e9[_0xf95a('0x163')]||0x32;_0x2eba31['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x1442e9[_0xf95a('0x164')]||0x3;_0x2eba31['XMD-AMDSILENCETHRESHOLD']=_0x1442e9[_0xf95a('0x165')]||0x100;_0x2eba31[_0xf95a('0x166')]=_0x1442e9[_0xf95a('0x167')]||0x1388;}if(_0x1442e9[_0xf95a('0x47')]===_0xf95a('0x48')){_0x2eba31['XMD-VOICEQUEUEID']=_0x53a3c1[_0xf95a('0xcb')];}else{_0x2eba31['XMD-CAMPAIGNID']=_0x53a3c1[_0xf95a('0xcc')];}for(var _0x3e93da in _0x53a3c1['Contact']){if(_0x53a3c1['Contact']['hasOwnProperty'](_0x3e93da)){if(isNotNull(_0x53a3c1['Contact'][_0x3e93da])&&_0x3e93da!=='id'&&_0x3e93da!==_0xf95a('0x168')&&_0x3e93da!=='createdAt'&&_0x3e93da!==_0xf95a('0x169')){_0x2eba31[util['format'](_0xf95a('0x16a'),'XMD-',_['toUpper'](_0x3e93da))]=_0x53a3c1[_0xf95a('0x150')][_0x3e93da];}}}var _0x302ef6=_0x33f506[_0xf95a('0xd1')](_0x1442e9[_0xf95a('0x6f')])?getCallerId(_0x1442e9[_0xf95a('0x6f')][_0xf95a('0x70')],_0x1442e9[_0xf95a('0x16b')],_0x1442e9[_0xf95a('0x16c')]>0x0?getCallerIdRandom(_0x1442e9[_0xf95a('0x16d')],_0x1442e9[_0xf95a('0x16c')]):_0x1442e9['dialOriginateCallerIdNumber']):getCallerId(_[_0xf95a('0xa8')](_0x1442e9[_0xf95a('0x123')])?_0x1442e9['Trunk'][_0xf95a('0x70')]:_0x1442e9['TrunkBackup'][_0xf95a('0x70')],_0x1442e9[_0xf95a('0x16b')],_0x1442e9[_0xf95a('0x16c')]>0x0?getCallerIdRandom(_0x1442e9['dialOriginateCallerIdNumber'],_0x1442e9[_0xf95a('0x16c')]):_0x1442e9[_0xf95a('0x16d')]);if(_0x302ef6){_0x2eba31[_0xf95a('0x16e')]=_0x33f506[_0xf95a('0x1f')][_0x2ed783][_0xf95a('0x16f')]=extractCalleridName(_0x302ef6);_0x2eba31['XMD-ORIGINATECALLERIDNUM']=_0x33f506[_0xf95a('0x1f')][_0x2ed783][_0xf95a('0x170')]=extractCalleridNumber(_0x302ef6);}return ami['Action']({'actionid':_0x2ed783,'action':_0xf95a('0x152'),'channel':_0x33f506[_0xf95a('0xd1')](_0x1442e9[_0xf95a('0x6f')])?util[_0xf95a('0x74')](_0xf95a('0x171'),_0x1442e9[_0xf95a('0x6f')][_0xf95a('0x3a')],isNotNull(_0x1442e9['dialPrefix'])?_0x1442e9['dialPrefix'][_0xf95a('0x172')]()||'':'',_0x1442e9[_0xf95a('0x173')]>0x0?_0x53a3c1[_0xf95a('0x150')]['phone'][_0xf95a('0x174')](_0x1442e9[_0xf95a('0x173')]):_0x53a3c1['Contact'][_0xf95a('0x151')]):util['format'](_0xf95a('0x171'),_[_0xf95a('0xa8')](_0x1442e9[_0xf95a('0x123')])?_0x1442e9[_0xf95a('0x6f')][_0xf95a('0x3a')]:_0x1442e9[_0xf95a('0x123')][_0xf95a('0x3a')],isNotNull(_0x1442e9[_0xf95a('0x56')])?_0x1442e9[_0xf95a('0x56')][_0xf95a('0x172')]()||'':'',_0x1442e9[_0xf95a('0x173')]>0x0?_0x53a3c1[_0xf95a('0x150')][_0xf95a('0x151')][_0xf95a('0x174')](_0x1442e9[_0xf95a('0x173')]):_0x53a3c1[_0xf95a('0x150')][_0xf95a('0x151')]),'callerid':_0x302ef6,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x2eba31,'timeout':(_0x1442e9['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2ed783})['then'](function(_0x5db057){return _0x5359de(_0x5db057);})[_0xf95a('0xab')](function(_0xd3021e){_0x1442e9['outboundOriginateFailureCallsDay']+=0x1;var _0x1f1a67=new History(_0x33f506['actions'][_0x2ed783]);logger[_0xf95a('0x8f')](util[_0xf95a('0x74')]('[originateError]:\x20%s',JSON[_0xf95a('0x43')](_0xd3021e)));_0x1f1a67[_0xf95a('0xa0')]=0xe;_0x1f1a67[_0xf95a('0xa1')]=_0xf95a('0x175');_0x1f1a67[_0xf95a('0xa3')]=moment()[_0xf95a('0x74')](_0xf95a('0xf5'));_0x1f1a67[_0xf95a('0xa2')]=_0x1f1a67[_0xf95a('0xa3')];_0x33f506['createHistory'](_0x1f1a67)[_0xf95a('0xab')](loggerCatch('[originate][error]'));_0x33f506[_0xf95a('0xc0')](_0x1f1a67)[_0xf95a('0xab')](loggerCatch(_0xf95a('0x176')))['finally'](function(){delete _0x33f506['actions'][_0x2ed783];return _0x4cb97d(msgResponse('originate','Error',_0xf95a('0x177')));});});});};Dialer['prototype'][_0xf95a('0x178')]=function(_0x370440){var _0x21b597=this['actions'][_0x370440[_0xf95a('0x10c')]];var _0x25fc30=this;if(_0x21b597){delete this[_0xf95a('0x1f')][_0x370440[_0xf95a('0x10c')]];_0x21b597[_0xf95a('0xfa')]=moment()[_0xf95a('0x74')]('YYYY-MM-DD\x20HH:mm:ss');var _0x10ca44=_0x21b597[_0xf95a('0x47')]==='ivr'?this[_0xf95a('0x1a')][_0x21b597[_0xf95a('0xad')]]:this['voiceQueues'][_0x21b597[_0xf95a('0x179')]()];if(!this[_0xf95a('0xcf')](_0x370440['response'])){this[_0xf95a('0xac')](_0x10ca44);return this[_0xf95a('0x17a')](_0x21b597,_0x10ca44,_0x370440)[_0xf95a('0xb1')](function(_0x5945e6){})[_0xf95a('0xab')](loggerCatch(_0xf95a('0x17b')));}else{this[_0xf95a('0x20')][_0x370440[_0xf95a('0xdc')]]=_0x21b597;}}};Dialer[_0xf95a('0x14')][_0xf95a('0x17c')]=function(_0x48bb5a,_0x1a4ce1,_0x11952a){var _0x341be0=new History(_0x1a4ce1);if(_0x341be0[_0xf95a('0x17d')]+_0x341be0[_0xf95a('0x17e')]+_0x341be0['countnoanswerretry']+_0x341be0[_0xf95a('0x17f')]+_0x341be0['countdropretry']+_0x341be0[_0xf95a('0x108')]+_0x341be0['countmachineretry']+_0x341be0[_0xf95a('0x180')]>=_0x11952a[_0xf95a('0x181')]-0x1){return!![];}switch(_0x48bb5a){case 0x3:if(_0x341be0[_0xf95a('0x182')]>=_0x11952a['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0xf95a('0xb9')]({'active':![],'countnoanswerretry':_0x341be0[_0xf95a('0x182')]+=0x1,'scheduledat':moment()[_0xf95a('0x101')](_0x11952a[_0xf95a('0x183')],_0xf95a('0x103'))[_0xf95a('0x74')](_0xf95a('0xf5')),'ContactId':_0x341be0[_0xf95a('0xc9')],'ListId':_0x341be0[_0xf95a('0x104')],'VoiceQueueId':_0x341be0[_0xf95a('0xcb')]||undefined,'CampaignId':_0x341be0['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x341be0[_0xf95a('0x17d')]>=_0x11952a['dialBusyMaxRetry']-0x1){return!![];}else{this[_0xf95a('0xb9')]({'active':![],'countbusyretry':_0x341be0[_0xf95a('0x17d')]+=0x1,'scheduledat':moment()[_0xf95a('0x101')](_0x11952a[_0xf95a('0x184')],_0xf95a('0x103'))[_0xf95a('0x74')](_0xf95a('0xf5')),'ContactId':_0x341be0[_0xf95a('0xc9')],'ListId':_0x341be0[_0xf95a('0x104')],'VoiceQueueId':_0x341be0['VoiceQueueId']||undefined,'CampaignId':_0x341be0['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x341be0[_0xf95a('0x17e')]>=_0x11952a[_0xf95a('0x185')]-0x1){return!![];}else{this[_0xf95a('0xb9')]({'active':![],'countcongestionretry':_0x341be0[_0xf95a('0x17e')]+=0x1,'scheduledat':moment()[_0xf95a('0x101')](_0x11952a['dialCongestionRetryFrequency'],_0xf95a('0x103'))['format'](_0xf95a('0xf5')),'ContactId':_0x341be0[_0xf95a('0xc9')],'ListId':_0x341be0[_0xf95a('0x104')],'VoiceQueueId':_0x341be0[_0xf95a('0xcb')]||undefined,'CampaignId':_0x341be0[_0xf95a('0xcc')]||undefined})[_0xf95a('0xab')](loggerCatch(_0xf95a('0x186')));}break;case 0x0:if(_0x341be0[_0xf95a('0x17f')]>=_0x11952a[_0xf95a('0x187')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x341be0[_0xf95a('0x17f')]+=0x1,'scheduledat':moment()[_0xf95a('0x101')](_0x11952a['dialNoSuchNumberRetryFrequency'],_0xf95a('0x103'))[_0xf95a('0x74')](_0xf95a('0xf5')),'ContactId':_0x341be0[_0xf95a('0xc9')],'ListId':_0x341be0[_0xf95a('0x104')],'VoiceQueueId':_0x341be0[_0xf95a('0xcb')]||undefined,'CampaignId':_0x341be0[_0xf95a('0xcc')]||undefined})[_0xf95a('0xab')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x341be0[_0xf95a('0x100')]>=_0x11952a[_0xf95a('0xff')]-0x1){return!![];}else{this[_0xf95a('0xb9')]({'active':![],'countdropretry':_0x341be0[_0xf95a('0x100')]+=0x1,'scheduledat':moment()[_0xf95a('0x101')](_0x11952a[_0xf95a('0x102')],_0xf95a('0x103'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x341be0[_0xf95a('0xc9')],'ListId':_0x341be0[_0xf95a('0x104')],'VoiceQueueId':_0x341be0['VoiceQueueId']||undefined,'CampaignId':_0x341be0[_0xf95a('0xcc')]||undefined})[_0xf95a('0xab')](loggerCatch(_0xf95a('0x105')));}break;case 0xb:if(_0x341be0[_0xf95a('0x108')]>=_0x11952a['dialAbandonedMaxRetry']-0x1){return!![];}else{this[_0xf95a('0xb9')]({'active':![],'countabandonedretry':_0x341be0['countabandonedretry']+=0x1,'scheduledat':moment()[_0xf95a('0x101')](_0x11952a[_0xf95a('0x188')],_0xf95a('0x103'))[_0xf95a('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x341be0[_0xf95a('0xc9')],'ListId':_0x341be0[_0xf95a('0x104')],'VoiceQueueId':_0x341be0[_0xf95a('0xcb')]||undefined,'CampaignId':_0x341be0['CampaignId']||undefined})[_0xf95a('0xab')](loggerCatch('[rescheduleContact][Abandoned]'));}break;case 0x13:if(_0x341be0[_0xf95a('0x189')]>=_0x11952a[_0xf95a('0x18a')]-0x1){return!![];}else{this[_0xf95a('0xb9')]({'active':![],'countmachineretry':_0x341be0['countmachineretry']+=0x1,'scheduledat':moment()[_0xf95a('0x101')](_0x11952a['dialMachineRetryFrequency'],_0xf95a('0x103'))[_0xf95a('0x74')](_0xf95a('0xf5')),'ContactId':_0x341be0[_0xf95a('0xc9')],'ListId':_0x341be0[_0xf95a('0x104')],'VoiceQueueId':_0x341be0['VoiceQueueId']||undefined,'CampaignId':_0x341be0[_0xf95a('0xcc')]||undefined})['catch'](loggerCatch(_0xf95a('0x18b')));}break;case 0x14:if(_0x341be0[_0xf95a('0x180')]>=_0x11952a[_0xf95a('0x18c')]-0x1){return!![];}else{this[_0xf95a('0xb9')]({'active':![],'countagentrejectretry':_0x341be0[_0xf95a('0x180')]+=0x1,'scheduledat':moment()[_0xf95a('0x101')](_0x11952a['dialAgentRejectRetryFrequency'],_0xf95a('0x103'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x341be0[_0xf95a('0xc9')],'ListId':_0x341be0[_0xf95a('0x104')],'VoiceQueueId':_0x341be0[_0xf95a('0xcb')]||undefined,'CampaignId':_0x341be0[_0xf95a('0xcc')]||undefined})['catch'](loggerCatch(_0xf95a('0x18d')));}break;default:return!![];}};Dialer[_0xf95a('0x14')]['callProgressDetecting']=function(_0x5c8990,_0x52dc08,_0x27d6e6){var _0xf44107=this;var _0x5f0951=new History(_0x5c8990);return new BPromise(function(_0x2f7fa2,_0x23f80f){if(_[_0xf95a('0x36')](_0x52dc08)&&_0xf95a('0x14e')!==typeof _0x52dc08){return _0x23f80f(msgResponse(_0xf95a('0x18e'),_0xf95a('0x129'),_0xf95a('0x18f')));}if(_[_0xf95a('0x36')](_0x27d6e6)&&_0xf95a('0x14e')!==typeof _0x27d6e6){return _0x23f80f(msgResponse('[callProgressDetecting]','Failure',_0xf95a('0x190')));}switch(_0x27d6e6[_0xf95a('0xf1')]){case'0':_0x52dc08[_0xf95a('0x5e')]+=0x1;_0x5f0951[_0xf95a('0xa0')]=0x0;_0x5f0951[_0xf95a('0xa1')]=_0xf95a('0x191');_0xf44107[_0xf95a('0xc2')](_0x5f0951)[_0xf95a('0xab')](loggerCatch(_0xf95a('0x192')));if(_0xf44107[_0xf95a('0x17c')](0x0,_0x5c8990,_0x52dc08)){if(_0x5f0951['countbusyretry']+_0x5f0951[_0xf95a('0x17e')]+_0x5f0951[_0xf95a('0x182')]+_0x5f0951[_0xf95a('0x17f')]+_0x5f0951[_0xf95a('0x100')]+_0x5f0951[_0xf95a('0x108')]+_0x5f0951[_0xf95a('0x189')]+_0x5f0951[_0xf95a('0x180')]>=_0x52dc08['dialGlobalMaxRetry']){_0xf44107['stateGlobal'](_0x5f0951,_0x2f7fa2,_0x23f80f,'reason\x200\x20no\x20such\x20number....');}else{_0xf44107[_0xf95a('0x193')](_0x5f0951,_0x2f7fa2,_0x23f80f,_0xf95a('0x194'));}}break;case'3':_0x52dc08['outboundNoAnswerCallsDay']+=0x1;_0x5f0951[_0xf95a('0xa0')]=0x3;_0x5f0951['statedesc']=_0xf95a('0x195');_0x5f0951[_0xf95a('0x182')]+=0x1;_0x5f0951['countglobal']+=0x1;_0xf44107[_0xf95a('0xc2')](_0x5f0951)[_0xf95a('0xab')](loggerCatch(_0xf95a('0x196')));if(_0xf44107[_0xf95a('0x17c')](0x3,_0x5c8990,_0x52dc08)){if(_0x5f0951['countnoanswerretry']>=_0x52dc08[_0xf95a('0x197')]){_0xf44107['createStateFinal'](_0x5f0951,_0x2f7fa2,_0x23f80f,_0xf95a('0x198'));}else{_0xf44107['stateGlobal'](_0x5f0951,_0x2f7fa2,_0x23f80f,_0xf95a('0x198'));}}break;case'5':_0x52dc08[_0xf95a('0x58')]+=0x1;_0x5f0951[_0xf95a('0xa0')]=0x5;_0x5f0951[_0xf95a('0xa1')]=_0xf95a('0x199');_0x5f0951[_0xf95a('0x17d')]+=0x1;_0x5f0951[_0xf95a('0x19a')]+=0x1;_0xf44107[_0xf95a('0xc2')](_0x5f0951)[_0xf95a('0xab')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0xf44107['checkRetriveMax'](0x5,_0x5c8990,_0x52dc08)){if(_0x5f0951[_0xf95a('0x17d')]>=_0x52dc08[_0xf95a('0x19b')]){_0xf44107[_0xf95a('0x193')](_0x5f0951,_0x2f7fa2,_0x23f80f,_0xf95a('0x19c'));}else{_0xf44107[_0xf95a('0x19d')](_0x5f0951,_0x2f7fa2,_0x23f80f,_0xf95a('0x19c'));}}break;case'8':_0x52dc08[_0xf95a('0x59')]+=0x1;_0x5f0951[_0xf95a('0xa0')]=0x8;_0x5f0951['statedesc']='Congestion';_0x5f0951[_0xf95a('0x17e')]+=0x1;_0x5f0951[_0xf95a('0x19a')]+=0x1;_0xf44107['createHistory'](_0x5f0951)[_0xf95a('0xab')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0xf44107[_0xf95a('0x17c')](0x8,_0x5c8990,_0x52dc08)){if(_0x5f0951[_0xf95a('0x17e')]>=_0x52dc08[_0xf95a('0x185')]){_0xf44107[_0xf95a('0x193')](_0x5f0951,_0x2f7fa2,_0x23f80f,_0xf95a('0x19e'));}else{_0xf44107[_0xf95a('0x19d')](_0x5f0951,_0x2f7fa2,_0x23f80f,_0xf95a('0x19e'));}}break;case'11':_0x52dc08[_0xf95a('0x19f')]+=0x1;_0x5f0951['state']=0xb;_0x5f0951[_0xf95a('0xa1')]=_0xf95a('0x106');_0x5f0951['countabandonedretry']+=0x1;_0x5f0951[_0xf95a('0x19a')]+=0x1;_0xf44107[_0xf95a('0xc2')](_0x5f0951)[_0xf95a('0xab')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0xf44107['checkRetriveMax'](0xb,_0x5c8990,_0x52dc08)){if(_0x5f0951[_0xf95a('0x108')]>=_0x52dc08[_0xf95a('0x1a0')]){_0xf44107['createStateFinal'](_0x5f0951,_0x2f7fa2,_0x23f80f,'reason\x2011\x20abandoned');}else{_0xf44107[_0xf95a('0x19d')](_0x5f0951,_0x2f7fa2,_0x23f80f,_0xf95a('0x1a1'));}}break;case'20':_0x52dc08['outboundRejectCallsDay']+=0x1;_0x5f0951[_0xf95a('0xa0')]=0x14;_0x5f0951[_0xf95a('0xa1')]='AgentReject';_0x5f0951[_0xf95a('0x180')]+=0x1;_0x5f0951[_0xf95a('0x19a')]+=0x1;_0xf44107[_0xf95a('0xc2')](_0x5f0951)[_0xf95a('0xab')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0xf44107[_0xf95a('0x17c')](0x14,_0x5c8990,_0x52dc08)){if(_0x5f0951[_0xf95a('0x180')]>=_0x52dc08[_0xf95a('0x18c')]){_0xf44107[_0xf95a('0x193')](_0x5f0951,_0x2f7fa2,_0x23f80f,_0xf95a('0x1a2'));}else{_0xf44107[_0xf95a('0x19d')](_0x5f0951,_0x2f7fa2,_0x23f80f,_0xf95a('0x1a2'));}}break;default:_0x52dc08[_0xf95a('0x61')]+=0x1;_0x5f0951[_0xf95a('0xa0')]=0xc;_0x5f0951[_0xf95a('0xa1')]=_0x27d6e6[_0xf95a('0xf1')];_0xf44107['createHistory'](_0x5f0951)[_0xf95a('0xab')](loggerCatch(_0xf95a('0x1a3')));if(_0xf44107[_0xf95a('0x17c')](_0x27d6e6[_0xf95a('0xf1')],_0x5c8990,_0x52dc08)){if(_0x5f0951[_0xf95a('0x17d')]+_0x5f0951['countcongestionretry']+_0x5f0951[_0xf95a('0x182')]+_0x5f0951[_0xf95a('0x17f')]+_0x5f0951[_0xf95a('0x100')]+_0x5f0951[_0xf95a('0x108')]+_0x5f0951['countmachineretry']+_0x5f0951[_0xf95a('0x180')]>=_0x52dc08[_0xf95a('0x181')]){_0xf44107[_0xf95a('0x19d')](_0x5f0951,_0x2f7fa2,_0x23f80f,_0x27d6e6[_0xf95a('0xf1')]);}else{_0xf44107[_0xf95a('0x193')](_0x5f0951,_0x2f7fa2,_0x23f80f,_0x27d6e6[_0xf95a('0xf1')]);}}}});};Dialer['prototype'][_0xf95a('0x19d')]=function(_0x3ce77a,_0x540f5c,_0x4fc0ae,_0x1d191c){var _0x5393fb=new Final(_0x3ce77a);_0x5393fb[_0xf95a('0xa0')]=0xf;_0x5393fb['statedesc']='Global';this[_0xf95a('0x193')](_0x5393fb,_0x540f5c,_0x4fc0ae,_0x1d191c);};Dialer[_0xf95a('0x14')][_0xf95a('0x193')]=function(_0x285de8,_0x14179e,_0x98fc9a,_0x57ad7b){this['moveContactManagedDialer'](_0x285de8)[_0xf95a('0xb1')](function(_0x5d0021){return _0x14179e(msgResponse(_0xf95a('0x18e'),_0xf95a('0xd0'),_0x57ad7b));})[_0xf95a('0xab')](function(_0x1c0ec7){return _0x98fc9a(msgResponse(_0xf95a('0x1a4'),_0xf95a('0x129'),_0xf95a('0x1a5')));});};Dialer[_0xf95a('0x14')][_0xf95a('0x5')]=function(_0x7b6e1b){var _0x1dc4c9=this;var _0x39b467=_0x7b6e1b[_0xf95a('0x1a6')]/0x64;var _0x3c65dc=_0x7b6e1b['outboundDropCallsDayTimeout']/(_0x7b6e1b[_0xf95a('0x5c')]+_0x7b6e1b['outboundAnswerCallsDay']);var _0x47dad4=Math[_0xf95a('0x1a7')](_0x7b6e1b[_0xf95a('0x69')]*(_0x7b6e1b[_0xf95a('0x1a8')]/0x64));var _0x561bd7=Math[_0xf95a('0x1a7')](_0x7b6e1b[_0xf95a('0x69')]*(_0x7b6e1b[_0xf95a('0x1a9')]/0x64));var _0x31b444=_0x7b6e1b[_0xf95a('0x4b')]+_0x7b6e1b[_0xf95a('0x4e')];var _0x3c55f9=Math['floor'](_0x7b6e1b['erlangCalls']*_0x7b6e1b[_0xf95a('0x85')]*_0x7b6e1b[_0xf95a('0x67')]*_0x7b6e1b[_0xf95a('0x68')]);if(_[_0xf95a('0x36')](_0x7b6e1b[_0xf95a('0x23')])){if(!_[_0xf95a('0x36')](_0x7b6e1b['startPredictive'])){_0x7b6e1b[_0xf95a('0x22')]=undefined;loggerPredictive[_0xf95a('0x8f')]('[startMethodPredictive][StartProgressive]',_0xf95a('0x1aa'));}if(!_[_0xf95a('0x36')](_0x7b6e1b[_0xf95a('0x8b')])){loggerPredictive[_0xf95a('0x8f')](_0xf95a('0x1ab'),_0xf95a('0x1ac'));clearInterval(_0x7b6e1b[_0xf95a('0x8b')]);_0x7b6e1b[_0xf95a('0x8b')]=undefined;}_0x7b6e1b[_0xf95a('0x23')]=moment()[_0xf95a('0x74')](_0xf95a('0xf5'));loggerPredictive[_0xf95a('0x77')](_0x7b6e1b[_0xf95a('0x3a')],_0xf95a('0x1ad'),_0x7b6e1b['startProgressive']);this[_0xf95a('0x13f')](_0x7b6e1b,0x1);}else if(ifInterval(_0x7b6e1b[_0xf95a('0x1ae')],_0x7b6e1b[_0xf95a('0x23')])){this[_0xf95a('0x13f')](_0x7b6e1b,0x1);loggerPredictiveCalls[_0xf95a('0x77')]('[startMethodPredictive][StartProgressive][Loop]',_0x7b6e1b['startProgressive'],_0x7b6e1b[_0xf95a('0x3a')]);_0x7b6e1b['erlangCalls']=0x0;_0x7b6e1b[_0xf95a('0xfb')]=0x0;}else if(_0x39b467<_0x3c65dc&&_0x7b6e1b['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x7b6e1b);loggerPredictive[_0xf95a('0x77')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xf95a('0x1af'),_0x3c65dc,_0xf95a('0x23'),_0x7b6e1b[_0xf95a('0x3a')]);}else if(_0x3c55f9<_0x7b6e1b[_0xf95a('0xfb')]&&_0x7b6e1b[_0xf95a('0x1b0')]===_0xf95a('0x1b1')){freeVariablesPredictive(_0x7b6e1b);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x1b2'),'Max\x20Drop\x20',_0x3c55f9,_0xf95a('0x1b3'),_0x7b6e1b['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x7b6e1b[_0xf95a('0x3a')]);}else if(!ifInterval(_0x7b6e1b['dialPredictiveInterval'],_0x7b6e1b[_0xf95a('0x23')])&&_[_0xf95a('0x36')](_0x7b6e1b[_0xf95a('0x22')])&&!_[_0xf95a('0x36')](_0x7b6e1b['startProgressive'])){_0x7b6e1b[_0xf95a('0x22')]=moment()[_0xf95a('0x74')](_0xf95a('0xf5'));loggerPredictive[_0xf95a('0x77')](_0x7b6e1b['name'],_0xf95a('0x1b4'),_0x7b6e1b[_0xf95a('0x22')]);this['averageHandleTime'](_0x7b6e1b['dialPredictiveInterval'])[_0xf95a('0xb1')](this[_0xf95a('0x1b5')](_0x7b6e1b))[_0xf95a('0xb1')](mergeDataErlangB(_0x7b6e1b))[_0xf95a('0xb1')](this['startMethodPredictive'](_0x7b6e1b))[_0xf95a('0xab')](loggerCatchPredictive(_0xf95a('0x1b6'),_0x7b6e1b));}else if(!ifInterval(_0x7b6e1b[_0xf95a('0x1ae')],_0x7b6e1b[_0xf95a('0x22')])){_0x7b6e1b[_0xf95a('0xfb')]=0x0;_0x7b6e1b[_0xf95a('0x22')]=moment()[_0xf95a('0x74')](_0xf95a('0xf5'));loggerPredictive['info'](_0x7b6e1b[_0xf95a('0x3a')],_0xf95a('0x1b7'),_0x7b6e1b[_0xf95a('0x22')]);clearInterval(_0x7b6e1b[_0xf95a('0x8b')]);_0x7b6e1b[_0xf95a('0x8b')]=undefined;this['averageHandleTime'](_0x7b6e1b[_0xf95a('0x1ae')])[_0xf95a('0xb1')](this[_0xf95a('0x1b5')](_0x7b6e1b))[_0xf95a('0xb1')](mergeDataErlangB(_0x7b6e1b))[_0xf95a('0xb1')](this[_0xf95a('0x1b8')](_0x7b6e1b))['catch'](loggerCatchPredictive(_0xf95a('0x1b9'),_0x7b6e1b));}else if(_0x7b6e1b[_0xf95a('0x69')]&&_0x31b444<_0x7b6e1b[_0xf95a('0x69')]-_0x561bd7){freeVariablesPredictive(_0x7b6e1b);loggerPredictive[_0xf95a('0x77')](_0x7b6e1b[_0xf95a('0x3a')],_0xf95a('0x1ba'),_0x31b444,_0xf95a('0x1bb'),_0x7b6e1b[_0xf95a('0x69')],'-',_0x561bd7,'=',_0x7b6e1b[_0xf95a('0x69')]-_0x561bd7,')');}else if(_0x7b6e1b[_0xf95a('0x69')]&&_0x31b444>_0x7b6e1b['predictiveIntervalAvailable']+_0x47dad4){freeVariablesPredictive(_0x7b6e1b);loggerPredictive[_0xf95a('0x77')](_0x7b6e1b[_0xf95a('0x3a')],_0xf95a('0x1ba'),_0x31b444,')\x20are\x20more\x20than\x20threshold\x20(',_0x7b6e1b['predictiveIntervalAvailable'],'+',_0x47dad4,'=',_0x7b6e1b[_0xf95a('0x69')]+_0x47dad4,')');}};Dialer[_0xf95a('0x14')][_0xf95a('0x1b5')]=function(_0x9b6297){var _0x54a1c3=this;return function(_0x119384){return new BPromise(function(_0x571a74,_0x348cb4){_[_0xf95a('0x88')](_0x9b6297,_0x119384[0x0]);if(checkGetDataPredictive(_0x119384[0x0])){var _0x2735f2=_0x9b6297[_0xf95a('0x69')]=_0x9b6297[_0xf95a('0x4e')]+_0x9b6297[_0xf95a('0x4b')];var _0x2384b0=_0x9b6297['dialPredictiveInterval']*0x3c;var _0x226826=_0x119384[0x0][_0xf95a('0x63')]+_0x119384[0x0][_0xf95a('0x62')];var _0x399e48=(_0x119384[0x0]['predictiveIntervalAnsweredCalls']+_0x119384[0x0][_0xf95a('0x65')]+_0x119384[0x0][_0xf95a('0x64')])/_0x119384[0x0][_0xf95a('0x6a')];_0x9b6297[_0xf95a('0x67')]=_0x399e48>0x0?_0x399e48:0x1;switch(_0x9b6297[_0xf95a('0x1b0')]){case _0xf95a('0x1b1'):var _0x584602=_0x9b6297[_0xf95a('0x1a6')]/0x64;return _0x54a1c3[_0xf95a('0x1bc')](_0x2735f2,_0x2384b0,_0x226826,_0x399e48,_0x584602)[_0xf95a('0xb1')](function(_0x2a211c){return _0x571a74(_0x2a211c);});case _0xf95a('0x1bd'):var _0x51834a=_0x9b6297['dialPredictiveOptimizationPercentage']/0x64;return _0x54a1c3['busyFactor'](_0x2735f2,_0x2384b0,_0x226826,_0x399e48,_0x51834a)[_0xf95a('0xb1')](function(_0x492fdb){return _0x571a74(_0x492fdb);});default:return _0x348cb4(msgResponse(_0xf95a('0x1be'),_0xf95a('0x129'),'Unknown\x20Predictive'));}}else{return _0x348cb4(msgResponse('[getDataPredictive]',_0xf95a('0x129'),'check\x20failure'));}});};};Dialer[_0xf95a('0x14')][_0xf95a('0x1bf')]=function(_0x683b19){var _0x1c1c04=this;return function(_0x269892){return new BPromise(function(_0x114acb,_0x37687b){_['merge'](_0x683b19,_0x269892[0x0]);if(checkGetDataPredictive(_0x269892[0x0])){loggerPredictive[_0xf95a('0x77')](JSON[_0xf95a('0x43')](_0x269892[0x0]));if(_0x683b19[_0xf95a('0x1b0')]==='dropRate'){return _0x1c1c04['getVoiceQueueRtPauses'](_0x683b19['id'])[_0xf95a('0xb1')](function(_0x3e1945){var _0x38efae=_0x683b19['loggedIn']-_0x3e1945[0x0][_0xf95a('0x1c0')];var _0x5b65b3=_0x683b19[_0xf95a('0x1ae')]*0x3c;var _0x2b2c15=_0x269892[0x0][_0xf95a('0x63')]+_0x269892[0x0][_0xf95a('0x62')];var _0x3011ed=(_0x269892[0x0][_0xf95a('0x7b')]+_0x269892[0x0][_0xf95a('0x65')]+_0x269892[0x0][_0xf95a('0x64')])/_0x269892[0x0][_0xf95a('0x6a')];var _0x597fd4=_0x683b19[_0xf95a('0x1a6')]/0x64;_0x683b19[_0xf95a('0x1c1')]=_0x3e1945[0x0][_0xf95a('0x1c0')]||0x0;_0x683b19[_0xf95a('0x67')]=_0x3011ed>0x0?_0x3011ed:0x1;return _0x1c1c04[_0xf95a('0x1bc')](_0x38efae,_0x5b65b3,_0x2b2c15,_0x3011ed,_0x597fd4);})[_0xf95a('0xb1')](function(_0x471e39){return _0x114acb(_0x471e39);})[_0xf95a('0xab')](function(_0x3d4a16){return _0x37687b(msgResponse(_0xf95a('0x1c2'),_0xf95a('0x129'),JSON[_0xf95a('0x43')](_0x3d4a16)));});}if(_0x683b19['dialPredictiveOptimization']==='agentBusyFactor'){return _0x1c1c04[_0xf95a('0xbf')](_0x683b19['id'])['then'](function(_0x2256e3){var _0x444049=_0x683b19[_0xf95a('0x145')]-_0x2256e3[0x0][_0xf95a('0x1c0')];var _0x55bac2=_0x683b19['dialPredictiveInterval']*0x3c;var _0x587f60=_0x269892[0x0]['predictiveIntervalAvgTalktime']+_0x269892[0x0]['predictiveIntervalAvgHoldtime'];var _0x29dc9f=(_0x269892[0x0][_0xf95a('0x7b')]+_0x269892[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x269892[0x0][_0xf95a('0x64')])/_0x269892[0x0][_0xf95a('0x6a')];var _0x666d68=_0x683b19[_0xf95a('0x1a6')]/0x64;_0x683b19[_0xf95a('0x1c1')]=_0x2256e3[0x0][_0xf95a('0x1c0')]||0x0;_0x683b19[_0xf95a('0x67')]=_0x29dc9f>0x0?_0x29dc9f:0x1;return _0x1c1c04['busyFactor'](_0x444049,_0x55bac2,_0x587f60,_0x29dc9f,_0x666d68);})[_0xf95a('0xb1')](function(_0x3ac811){return _0x114acb(_0x3ac811);})['catch'](function(_0x36b1b4){return _0x37687b(msgResponse(_0xf95a('0x1c2'),_0xf95a('0x129'),JSON[_0xf95a('0x43')](_0x36b1b4)));});}}else{return _0x37687b(msgResponse(_0xf95a('0x1be'),_0xf95a('0x129'),_0xf95a('0x1c3')));}});};};Dialer[_0xf95a('0x14')]['startMethodPredictive']=function(_0x486006){var _0x4c84d9=this;return function(){var _0x6cb8c3=0x0;var _0x19d638=Math[_0xf95a('0x1c4')](_0x486006[_0xf95a('0x6d')]*0x3e8);if(_0x19d638>0x0){_0x19d638=_0x19d638<0x64?0x64:_0x19d638;loggerPredictive[_0xf95a('0x77')](_0x486006[_0xf95a('0x3a')],_0xf95a('0x1c5'),_0x19d638,_0xf95a('0x44'));_0x486006[_0xf95a('0x8b')]=setInterval(function(){_0x4c84d9[_0xf95a('0x8b')](_0x486006);loggerPredictiveCalls[_0xf95a('0x77')](_0xf95a('0x1c6'),_0x6cb8c3+=0x1);},_0x19d638);}else{loggerPredictive[_0xf95a('0x77')](_0x486006[_0xf95a('0x3a')],_0xf95a('0x1c7'));}};};Dialer[_0xf95a('0x14')][_0xf95a('0x1c8')]=function(_0xbcb2cb,_0x5ab3e9){var _0x971aa8=this;return function(_0x45ffb9){if(_[_0xf95a('0x40')](_0x45ffb9)){if(_[_0xf95a('0xa8')](_0x5ab3e9[_0xf95a('0xca')])||!_0x5ab3e9[_0xf95a('0x1c9')]){if(_0xbcb2cb[_0xf95a('0x55')]===_0xf95a('0x140')){_0xbcb2cb[_0xf95a('0x113')]=_[_0xf95a('0x36')](_0xbcb2cb['queueStatusComplete'])?!![]:_0xbcb2cb['queueStatusComplete'];var _0x2dbf3e=uuid['v4']();_0x971aa8[_0xf95a('0x1f')][_0x2dbf3e]=new Action(_0xbcb2cb,_0x5ab3e9,_0x2dbf3e);loggerBooked[_0xf95a('0x77')]('[booked][checkContactBlack]',_0x2dbf3e,_0xf95a('0x1ca'),JSON['stringify'](_0xbcb2cb[_0xf95a('0x113')]),_0xf95a('0x1cb'),_0xbcb2cb[_0xf95a('0x3a')]);if(_0xbcb2cb['queueStatusComplete']){_0xbcb2cb['queueStatusComplete']=![];_0x971aa8['queueBooked'][_0x971aa8[_0xf95a('0x1f')][_0x2dbf3e][_0xf95a('0xad')]]=[];ami[_0xf95a('0xa9')]({'actionid':_0x2dbf3e,'action':_0xf95a('0x1cc'),'queue':_0xbcb2cb[_0xf95a('0x3a')]})[_0xf95a('0xab')](function(_0x263021){_0x971aa8[_0xf95a('0xac')](_0xbcb2cb);_0x971aa8['rescheduleContact']({'active':![],'ContactId':_0x971aa8['actions'][_0x2dbf3e]['ContactId'],'ListId':_0x971aa8[_0xf95a('0x1f')][_0x2dbf3e][_0xf95a('0x104')],'VoiceQueueId':_0x971aa8[_0xf95a('0x1f')][_0x2dbf3e]['VoiceQueueId']||undefined,'CampaignId':_0x971aa8[_0xf95a('0x1f')][_0x2dbf3e][_0xf95a('0xcc')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x971aa8['actions'][_0x2dbf3e];});}else{loggerBooked[_0xf95a('0x77')](_0xf95a('0x1cd'),JSON['stringify'](_0xbcb2cb[_0xf95a('0x113')]),_0xf95a('0x1cb'),_0xbcb2cb[_0xf95a('0x3a')]);_0x971aa8[_0xf95a('0xac')](_0xbcb2cb);_0x971aa8[_0xf95a('0xb9')]({'active':![],'ContactId':_0x971aa8[_0xf95a('0x1f')][_0x2dbf3e]['ContactId'],'ListId':_0x971aa8[_0xf95a('0x1f')][_0x2dbf3e][_0xf95a('0x104')],'VoiceQueueId':_0x971aa8[_0xf95a('0x1f')][_0x2dbf3e]['VoiceQueueId']||undefined,'CampaignId':_0x971aa8[_0xf95a('0x1f')][_0x2dbf3e][_0xf95a('0xcc')]||undefined})['catch'](loggerCatch(_0xf95a('0x1ce')));delete _0x971aa8['actions'][_0x2dbf3e];}}else{return _0x971aa8[_0xf95a('0x14d')](_0xbcb2cb,_0x5ab3e9);}}else{if(getDiff(_0x5ab3e9['scheduledat'])<_0xbcb2cb[_0xf95a('0x1cf')]*0x3c){if(_0x5ab3e9[_0xf95a('0x1d0')]&&!_0x5ab3e9[_0xf95a('0x1d0')][_0xf95a('0x1d1')]){_0x971aa8[_0xf95a('0x18')]['run'](_0x5ab3e9['id'])['finally'](function(){_0x971aa8[_0xf95a('0xac')](_0xbcb2cb);});}else{_0x971aa8['unlockContact']({'active':![]},_0x5ab3e9['id'],0x1)[_0xf95a('0x117')](function(){console[_0xf95a('0x1d2')](_0xf95a('0x1d3'));_0x971aa8[_0xf95a('0xac')](_0xbcb2cb);});}}else{_0xbcb2cb[_0xf95a('0x60')]+=0x1;_0x971aa8['updateOriginated'](_0xbcb2cb);if(_0xbcb2cb[_0xf95a('0x1d4')]){_0x971aa8[_0xf95a('0xb9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5ab3e9[_0xf95a('0xc9')],'ListId':_0x5ab3e9['ListId'],'VoiceQueueId':_0x5ab3e9[_0xf95a('0xcb')]||undefined,'CampaignId':_0x5ab3e9[_0xf95a('0xcc')]||undefined})[_0xf95a('0xab')](loggerCatch(_0xf95a('0x1d5')));_0x971aa8['createHistory'](createObjHistory(_0xbcb2cb,_0x5ab3e9,_0xf95a('0x1d6'),0x17,_0xf95a('0x1d7')))[_0xf95a('0xab')](loggerCatch(_0xf95a('0x1d8')));}else{_0x971aa8['saveInDb'](createObjHistory(_0xbcb2cb,_0x5ab3e9,'RECALLFAILEDTIMEOUT',0x16,_0xf95a('0x1d9')),_0xf95a('0x1da'),_0xf95a('0x1db'));}}}}else{_0xbcb2cb['outboundBlacklistCallsDay']+=0x1;_0x971aa8[_0xf95a('0xc7')](createObjHistory(_0xbcb2cb,_0x5ab3e9,_0xf95a('0x1dc'),0xd,_0xf95a('0x1dd')),_0xf95a('0x1de'),'[Originate][MoveBlacklist]');throw _0xf95a('0x1df');}};};Dialer[_0xf95a('0x14')][_0xf95a('0x144')]=function(_0x2d39d8){var _0x5344e1=this;var _0x5e4d17=[];var _0x59a9c1=_0x2d39d8[_0xf95a('0x1e0')]-_0x2d39d8[_0xf95a('0x6b')]-_0x2d39d8[_0xf95a('0x1e1')];emitCampaignSummary(_0x2d39d8);if(_0x59a9c1>0x0){if(_0x59a9c1>this['maxNumberOriginate']){_0x59a9c1=this['maxNumberOriginate'];}_0x2d39d8[_0xf95a('0x1e1')]+=_0x59a9c1;this[_0xf95a('0xbd')](_0x2d39d8['id'],_0x59a9c1,_0x2d39d8[_0xf95a('0x1e2')])[_0xf95a('0xb1')](function(_0x3cdce1){_0x2d39d8[_0xf95a('0x1e1')]-=_0x59a9c1;_0x2d39d8[_0xf95a('0x1e1')]=_0x2d39d8[_0xf95a('0x1e1')]>0x0?_0x2d39d8['temp']:0x0;if(!checkContactEmpty(_0x3cdce1)){_0x2d39d8[_0xf95a('0x37')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xf95a('0x77')]('[getContactCampaign2][Empty]'+_0x2d39d8[_0xf95a('0x3a')]);}else{_0x2d39d8[_0xf95a('0x6b')]+=_0x3cdce1['length'];_0x2d39d8[_0xf95a('0x37')]=_0xf95a('0x1e3');for(var _0x3e9451=0x0;_0x3e9451<_0x3cdce1[_0xf95a('0x92')];_0x3e9451+=0x1){_0x2d39d8[_0xf95a('0x1e4')]+=0x1;if(_[_0xf95a('0xa8')](_0x3cdce1[_0x3e9451])||_[_0xf95a('0xa8')](_0x3cdce1[_0x3e9451]['Contact'])||_[_0xf95a('0xa8')](_0x3cdce1[_0x3e9451]['Contact'][_0xf95a('0x151')])){_0x5344e1['emptyContact'](_0xf95a('0x1e5'),_0x2d39d8,_0x3cdce1[_0x3e9451]);}else{_0x5344e1['checkIsBlackListIvr'](_[_0xf95a('0xc8')](_0x3cdce1[_0x3e9451],[_0xf95a('0xcc'),_0xf95a('0x1e6')]))['then'](_0x5344e1[_0xf95a('0x1c8')](_0x2d39d8,_0x3cdce1[_0x3e9451]))[_0xf95a('0xab')](_0x5344e1[_0xf95a('0x1e7')](_0xf95a('0x1e8'),_0x2d39d8));}}}})[_0xf95a('0xab')](loggerGetContactDialer(_0xf95a('0x1e9'),_0x2d39d8,_0x59a9c1));}};Dialer[_0xf95a('0x14')][_0xf95a('0x13f')]=function(_0x3176e9,_0x55b13b){var _0x515229=this;var _0x4c0ac3=[];var _0x1457ca=_0x55b13b>=0x1?_0x55b13b:0x1;var _0x33bfc9=[];if(_0x3176e9[_0xf95a('0x55')]===_0xf95a('0x140')){_0x1457ca=0x1;}var _0x408712=Math[_0xf95a('0x1c4')](_0x3176e9[_0xf95a('0x4b')]*_0x1457ca)-_0x3176e9[_0xf95a('0x6b')]-_0x3176e9['temp'];emitVoiceQueueSummary(_0x3176e9);if(_0x3176e9[_0xf95a('0x1ea')]>0x0){var _0x2dcaa9=_0x3176e9[_0xf95a('0x1ea')]-_0x3176e9[_0xf95a('0x6b')]-_0x3176e9[_0xf95a('0x4e')]-_0x3176e9['temp']-_0x3176e9['pTalking'];if(_0x408712>_0x2dcaa9){_0x408712=_0x2dcaa9;}}if(_0x408712>0x0){if(_0x3176e9[_0xf95a('0x55')]==='booked'){_0x408712=0x1;}if(_0x408712>this[_0xf95a('0x1d')]){_0x408712=this[_0xf95a('0x1d')];}_0x3176e9[_0xf95a('0x1e1')]+=_0x408712;for(var _0x495ccb in this['agents']){if(this[_0xf95a('0x1b')][_0xf95a('0xa7')](_0x495ccb)){if(this['agents'][_0x495ccb][_0xf95a('0xa0')]==='not_inuse'&&this[_0xf95a('0x1b')][_0x495ccb][_0xf95a('0xaa')]===_0xf95a('0xd3')){_0x4c0ac3['push'](this[_0xf95a('0x1b')][_0x495ccb]['id']);}}}this[_0xf95a('0xbc')](_0x3176e9['id'],_0x4c0ac3,_0x408712,_0x3176e9[_0xf95a('0x1e2')])[_0xf95a('0xb1')](function(_0x7a100f){_0x3176e9['temp']-=_0x408712;_0x3176e9[_0xf95a('0x1e1')]=_0x3176e9[_0xf95a('0x1e1')]>0x0?_0x3176e9[_0xf95a('0x1e1')]:0x0;if(!checkContactEmpty(_0x7a100f)){_0x515229[_0xf95a('0xb0')](_0x3176e9)[_0xf95a('0xb1')](sendMessageReschedule(_0x3176e9))['catch'](loggerCatch(_0xf95a('0xb2')));}else{_0x3176e9['originated']+=_0x7a100f[_0xf95a('0x92')];_0x3176e9['message']=_0x3176e9[_0xf95a('0x55')]==='booked'?_0xf95a('0x15b'):_0xf95a('0x1e3');for(var _0x5f1777=0x0;_0x5f1777<_0x7a100f[_0xf95a('0x92')];_0x5f1777+=0x1){if(_[_0xf95a('0xa8')](_0x7a100f[_0x5f1777])||_[_0xf95a('0xa8')](_0x7a100f[_0x5f1777][_0xf95a('0x150')])||_[_0xf95a('0xa8')](_0x7a100f[_0x5f1777][_0xf95a('0x150')][_0xf95a('0x151')])){_0x515229[_0xf95a('0xc6')](_0xf95a('0x1e5'),_0x3176e9,_0x7a100f[_0x5f1777]);}else{_0x515229['checkIsBlackList'](_[_0xf95a('0xc8')](_0x7a100f[_0x5f1777],[_0xf95a('0xcb'),'Contact.phone']))[_0xf95a('0xb1')](_0x515229[_0xf95a('0x1c8')](_0x3176e9,_0x7a100f[_0x5f1777]))['catch'](_0x515229[_0xf95a('0x1e7')](_0xf95a('0x1e5'),_0x3176e9));}}}})[_0xf95a('0xab')](loggerGetContactDialer(_0xf95a('0x1eb'),_0x3176e9,_0x408712));}};Dialer[_0xf95a('0x14')][_0xf95a('0x8b')]=function(_0x2ef365){var _0x53ba49=this;if(_0x2ef365['dialLimitQueue']>0x0){var _0xe7f23a=_0x2ef365[_0xf95a('0x1ea')]-_0x2ef365[_0xf95a('0x6b')]-_0x2ef365[_0xf95a('0x4e')];if(_0xe7f23a>0x0){this[_0xf95a('0x1ec')](_0x2ef365);}else{loggerPredictiveCalls[_0xf95a('0x77')](_0xf95a('0x1ed'));}}else{this[_0xf95a('0x1ec')](_0x2ef365);}};Dialer['prototype'][_0xf95a('0x1ec')]=function(_0x44f9c0){var _0x670ff8=this;var _0x3a8acb=[];_0x44f9c0[_0xf95a('0x6b')]+=0x1;for(var _0x67aac6 in this[_0xf95a('0x1b')]){if(this['agents'][_0xf95a('0xa7')](_0x67aac6)){if(this[_0xf95a('0x1b')][_0x67aac6][_0xf95a('0xa0')]===_0xf95a('0x1ee')&&this[_0xf95a('0x1b')][_0x67aac6][_0xf95a('0xaa')]===_0xf95a('0xd3')){_0x3a8acb['push'](this[_0xf95a('0x1b')][_0x67aac6]['id']);}}}this[_0xf95a('0xbc')](_0x44f9c0['id'],_0x3a8acb,0x1,_0x44f9c0['dialOrderByScheduledAt'])[_0xf95a('0xb1')](function(_0xb19202){if(!checkContactEmpty(_0xb19202)){checkContactLowerLimitOriginate(_0x44f9c0,0x1,0x0);_0x670ff8['countReScheduled'](_0x44f9c0)['then'](sendMessageReschedule(_0x44f9c0))[_0xf95a('0xab')](loggerCatch('[countReScheduled]\x20'));}else{_0x44f9c0[_0xf95a('0x37')]=_0xf95a('0x1e3');if(_[_0xf95a('0xa8')](_0xb19202[0x0])||_['isNil'](_0xb19202[0x0][_0xf95a('0x150')])||_['isNil'](_0xb19202[0x0][_0xf95a('0x150')][_0xf95a('0x151')])){_0x670ff8[_0xf95a('0xc6')](_0xf95a('0x1e5'),_0x44f9c0,_0xb19202[0x0]);}else{_0x670ff8['checkIsBlackList'](_[_0xf95a('0xc8')](_0xb19202[0x0],[_0xf95a('0xcb'),_0xf95a('0x1e6')]))[_0xf95a('0xb1')](_0x670ff8[_0xf95a('0x1c8')](_0x44f9c0,_0xb19202[0x0]))[_0xf95a('0xab')](_0x670ff8['loggerHandler']('[actionOriginatePredictive]\x20',_0x44f9c0));}}})['catch'](loggerGetContactDialer(_0xf95a('0x1ef'),_0x44f9c0,0x1));emitVoiceQueueSummary(_0x44f9c0);};Dialer[_0xf95a('0x14')]['abandonmentRate']=function(_0x4108be,_0x59e01a,_0x17c2d9,_0x32f46d,_0x39d2a3,_0x3884cc){loggerPredictive[_0xf95a('0x77')](_0xf95a('0x1f0'));loggerPredictive[_0xf95a('0x77')](_0xf95a('0x1f1'),_0x4108be);loggerPredictive['info'](_0xf95a('0x1f2'),_0x59e01a);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x1f3'),_0x17c2d9);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x1f4'),_0x32f46d);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x1f5'),_0x39d2a3);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x87'));return new BPromise(function(_0x33e56f,_0x28c983){if(_0x4108be<=0x0||isNaN(_0x4108be)){return _0x28c983(msgResponse(_0xf95a('0x1f6'),_0xf95a('0x42'),'m\x20=\x20'+_0x4108be));}if(_0x17c2d9<=0x0||isNaN(_0x17c2d9)){return _0x28c983(msgResponse(_0xf95a('0x1f6'),'Error',_0xf95a('0x1f7')+_0x17c2d9));}if(_0x32f46d<=0x0||isNaN(_0x32f46d)){return _0x28c983(msgResponse(_0xf95a('0x1f6'),_0xf95a('0x42'),_0xf95a('0x1f8')+_0x32f46d));}if(_0x59e01a<=0x0||isNaN(_0x59e01a)){return _0x28c983(msgResponse(_0xf95a('0x1f6'),_0xf95a('0x42'),_0xf95a('0x1f9')+_0x59e01a));}if(_0x39d2a3<=0x0||isNaN(_0x39d2a3)){return _0x28c983(msgResponse('[abandonmentRate]',_0xf95a('0x42'),_0xf95a('0x1fa')+_0x39d2a3));}_0x3884cc=_0x3884cc||0x0;var _0x5d1bb8=0x1/_0x17c2d9;var _0x863565=0x0;var _0x186b69=0x0;var _0xea7e15=0x0;var _0x3a26a3=0x0;for(var _0x40d15b=0x0;_0xea7e15<_0x39d2a3;_0x40d15b+=0x1){_0x186b69=_0x40d15b/_0x59e01a;_0x863565=(_0x32f46d*_0x186b69+_0x3884cc)/_0x5d1bb8;_0xea7e15=erlangb(_0x863565,_0x4108be);_0x3a26a3=_0x863565/_0x4108be*(0x1-erlangb(_0x863565,_0x4108be));}return _0x33e56f({'erlangCalls':_0x40d15b,'erlangCallToSecond':_0x59e01a/_0x40d15b,'erlangAbandonmentRate':_0xea7e15,'erlangBusyFactor':_0x3a26a3});});};Dialer[_0xf95a('0x14')][_0xf95a('0x1fb')]=function(_0x27f174,_0x21cab7,_0xc80d96,_0x337e6e,_0x23edec,_0x2b341d){loggerPredictive[_0xf95a('0x77')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xf95a('0x77')](_0xf95a('0x1f1'),_0x27f174);loggerPredictive['info'](_0xf95a('0x1f2'),_0x21cab7);loggerPredictive[_0xf95a('0x77')]('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',_0xc80d96);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x1f4'),_0x337e6e);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x1fc'),_0x23edec);loggerPredictive[_0xf95a('0x77')](_0xf95a('0x87'));return new BPromise(function(_0xdac97,_0x5509eb){if(_0x27f174<=0x0||isNaN(_0x27f174)){return _0x5509eb(msgResponse('[busyFactor]','Error',_0xf95a('0x1fd')+_0x27f174));}if(_0xc80d96<=0x0||isNaN(_0xc80d96)){return _0x5509eb(msgResponse(_0xf95a('0x1fe'),_0xf95a('0x42'),_0xf95a('0x1f7')+_0xc80d96));}if(_0x337e6e<=0x0||isNaN(_0x337e6e)){return _0x5509eb(msgResponse(_0xf95a('0x1fe'),_0xf95a('0x42'),_0xf95a('0x1f8')+_0x337e6e));}if(_0x21cab7<=0x0||isNaN(_0x21cab7)){return _0x5509eb(msgResponse('[busyFactor]',_0xf95a('0x42'),_0xf95a('0x1f9')+_0x21cab7));}if(_0x23edec<=0x0||isNaN(_0x23edec)){return _0x5509eb(msgResponse(_0xf95a('0x1fe'),_0xf95a('0x42'),_0xf95a('0x1ff')+_0x23edec));}_0x2b341d=_0x2b341d||0x0;var _0x1ab737=0x1/_0xc80d96;var _0x12df33=0x0;var _0x1b76cb=0x0;var _0x1b5b49=0x0;var _0x39163e=0x0;for(var _0x771156=0x0;_0x39163e<_0x23edec;_0x771156+=0x1){_0x1b76cb=_0x771156/_0x21cab7;_0x12df33=(_0x337e6e*_0x1b76cb+_0x2b341d)/_0x1ab737;_0x1b5b49=erlangb(_0x12df33,_0x27f174);_0x39163e=_0x12df33/_0x27f174*(0x1-erlangb(_0x12df33,_0x27f174));}return _0xdac97({'erlangCalls':_0x771156,'erlangCallToSecond':_0x21cab7/_0x771156,'erlangAbandonmentRate':_0x1b5b49,'erlangBusyFactor':_0x39163e});});};module[_0xf95a('0x200')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index c04b475..cf5cfca 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 _0xc135=['moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x79fd26,_0x25c8d1){var _0x50ec46=function(_0x500c35){while(--_0x500c35){_0x79fd26['push'](_0x79fd26['shift']());}};_0x50ec46(++_0x25c8d1);}(_0xc135,0xf4));var _0x5c13=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc135[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x5c13('0x0'));var _=require(_0x5c13('0x1'));var moment=require(_0x5c13('0x2'));function getSeconds(_0x162e67,_0x3673b0){var _0x292827=moment(_0x162e67)['milliseconds'](0x0);var _0x1ea825=moment(_0x3673b0)[_0x5c13('0x3')](0x0);return _0x292827[_0x5c13('0x4')](_0x1ea825,'seconds');}function QueueCallerAbandon(_0x502299,_0x32eac6){this['scheduledat']=_0x502299[_0x5c13('0x5')];this[_0x5c13('0x6')]=_0x502299[_0x5c13('0x6')];this[_0x5c13('0x7')]=_0x502299['type']===_0x5c13('0x8')?'queue':_0x502299[_0x5c13('0x6')];this[_0x5c13('0x9')]=_0x502299[_0x5c13('0x9')];this['countcongestionretry']=_0x502299[_0x5c13('0xa')];this['countnoanswerretry']=_0x502299['countnoanswerretry'];this['countglobal']=_0x502299[_0x5c13('0x9')]+_0x502299[_0x5c13('0xa')]+_0x502299['countnoanswerretry']+_0x502299[_0x5c13('0xb')]+_0x502299['countdropretry']+_0x502299['countabandonedretry']+_0x502299[_0x5c13('0xc')]+_0x502299[_0x5c13('0xd')];this['countnosuchnumberretry']=_0x502299['countnosuchnumberretry'];this[_0x5c13('0xe')]=_0x502299[_0x5c13('0xe')];this[_0x5c13('0xf')]=_0x502299[_0x5c13('0xf')];this[_0x5c13('0xc')]=_0x502299[_0x5c13('0xc')];this[_0x5c13('0xd')]=_0x502299[_0x5c13('0xd')];this['uniqueid']=_0x32eac6[_0x5c13('0x10')];this[_0x5c13('0x11')]=_0x502299[_0x5c13('0x12')];this[_0x5c13('0x13')]=_0x502299[_0x5c13('0x14')];this[_0x5c13('0x15')]=_0x502299[_0x5c13('0x15')];this[_0x5c13('0x16')]=_0x502299[_0x5c13('0x16')];this[_0x5c13('0x17')]=_0x502299[_0x5c13('0x17')];this[_0x5c13('0x18')]=this[_0x5c13('0x17')];this['ringtime']=getSeconds(_0x502299[_0x5c13('0x16')],_0x502299[_0x5c13('0x15')]);this['holdtime']=getSeconds(this['droptime'],_0x502299[_0x5c13('0x16')]);this[_0x5c13('0x19')]=0x0;this['queue']=_0x32eac6[_0x5c13('0x1a')];this[_0x5c13('0x1b')]=_0x32eac6['connectedlinename'];this[_0x5c13('0x1c')]=_0x32eac6[_0x5c13('0x1c')];this[_0x5c13('0x1d')]=_0x502299[_0x5c13('0x1d')];this[_0x5c13('0x1e')]=_0x502299[_0x5c13('0x1e')];this[_0x5c13('0x1f')]=_0x502299[_0x5c13('0x1f')];this[_0x5c13('0x20')]=_0x502299[_0x5c13('0x20')];this[_0x5c13('0x21')]=_0x502299[_0x5c13('0x21')];this[_0x5c13('0x22')]=_0x502299[_0x5c13('0x22')];this[_0x5c13('0x23')]=_0x502299[_0x5c13('0x23')];this[_0x5c13('0x24')]=_0x502299['VoiceQueueId'];this[_0x5c13('0x25')]=_0x502299[_0x5c13('0x25')];this[_0x5c13('0x26')]=_0x502299[_0x5c13('0x26')]||'';this[_0x5c13('0x27')]=_0x502299[_0x5c13('0x27')]||'';}module[_0x5c13('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0x8c96=['queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','responsetime','droptime','endtime','ringtime','talktime','connectedlinename','reason','callbackuniqueid','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound'];(function(_0x2f1ae9,_0x11ce9a){var _0x2420e7=function(_0x3908ee){while(--_0x3908ee){_0x2f1ae9['push'](_0x2f1ae9['shift']());}};_0x2420e7(++_0x11ce9a);}(_0x8c96,0x1ef));var _0x68c9=function(_0x381543,_0x1aacb5){_0x381543=_0x381543-0x0;var _0x30b94d=_0x8c96[_0x381543];return _0x30b94d;};'use strict';var util=require(_0x68c9('0x0'));var _=require(_0x68c9('0x1'));var moment=require(_0x68c9('0x2'));function getSeconds(_0x1708e7,_0x316199){var _0x4b571a=moment(_0x1708e7)[_0x68c9('0x3')](0x0);var _0x58cf19=moment(_0x316199)[_0x68c9('0x3')](0x0);return _0x4b571a[_0x68c9('0x4')](_0x58cf19,'seconds');}function QueueCallerAbandon(_0x2fa148,_0x20acc6){this[_0x68c9('0x5')]=_0x2fa148[_0x68c9('0x5')];this[_0x68c9('0x6')]=_0x2fa148[_0x68c9('0x6')];this[_0x68c9('0x7')]=_0x2fa148[_0x68c9('0x6')]===_0x68c9('0x8')?_0x68c9('0x9'):_0x2fa148[_0x68c9('0x6')];this[_0x68c9('0xa')]=_0x2fa148[_0x68c9('0xa')];this[_0x68c9('0xb')]=_0x2fa148[_0x68c9('0xb')];this['countnoanswerretry']=_0x2fa148['countnoanswerretry'];this[_0x68c9('0xc')]=_0x2fa148[_0x68c9('0xa')]+_0x2fa148[_0x68c9('0xb')]+_0x2fa148['countnoanswerretry']+_0x2fa148[_0x68c9('0xd')]+_0x2fa148['countdropretry']+_0x2fa148[_0x68c9('0xe')]+_0x2fa148[_0x68c9('0xf')]+_0x2fa148['countagentrejectretry'];this[_0x68c9('0xd')]=_0x2fa148[_0x68c9('0xd')];this['countdropretry']=_0x2fa148['countdropretry'];this[_0x68c9('0xe')]=_0x2fa148[_0x68c9('0xe')];this[_0x68c9('0xf')]=_0x2fa148[_0x68c9('0xf')];this['countagentrejectretry']=_0x2fa148[_0x68c9('0x10')];this[_0x68c9('0x11')]=_0x20acc6[_0x68c9('0x11')];this[_0x68c9('0x12')]=_0x2fa148[_0x68c9('0x13')];this['calleridnum']=_0x2fa148[_0x68c9('0x14')];this['starttime']=_0x2fa148['starttime'];this[_0x68c9('0x15')]=_0x2fa148[_0x68c9('0x15')];this[_0x68c9('0x16')]=_0x2fa148['droptime'];this[_0x68c9('0x17')]=this[_0x68c9('0x16')];this[_0x68c9('0x18')]=getSeconds(_0x2fa148[_0x68c9('0x15')],_0x2fa148['starttime']);this['holdtime']=getSeconds(this[_0x68c9('0x16')],_0x2fa148[_0x68c9('0x15')]);this[_0x68c9('0x19')]=0x0;this[_0x68c9('0x9')]=_0x20acc6[_0x68c9('0x9')];this['membername']=_0x20acc6[_0x68c9('0x1a')];this['reason']=_0x20acc6[_0x68c9('0x1b')];this['callback']=_0x2fa148['callback'];this[_0x68c9('0x1c')]=_0x2fa148[_0x68c9('0x1c')];this['callbackat']=_0x2fa148['callbackat'];this[_0x68c9('0x1d')]=_0x2fa148[_0x68c9('0x1d')];this[_0x68c9('0x1e')]=_0x2fa148[_0x68c9('0x1e')];this[_0x68c9('0x1f')]=_0x2fa148[_0x68c9('0x1f')];this['UserId']=_0x2fa148['UserId'];this[_0x68c9('0x20')]=_0x2fa148['VoiceQueueId'];this[_0x68c9('0x21')]=_0x2fa148['CampaignId'];this[_0x68c9('0x22')]=_0x2fa148[_0x68c9('0x22')]||'';this[_0x68c9('0x23')]=_0x2fa148[_0x68c9('0x23')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index e4c90a1..77f6954 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 _0x8418=['%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId','exports','lodash','moment','uniqueid','channel','format'];(function(_0x1f2d44,_0x42dbf3){var _0x250f02=function(_0x373e91){while(--_0x373e91){_0x1f2d44['push'](_0x1f2d44['shift']());}};_0x250f02(++_0x42dbf3);}(_0x8418,0x64));var _0x8841=function(_0x305b20,_0x5e57e9){_0x305b20=_0x305b20-0x0;var _0x26d64a=_0x8418[_0x305b20];return _0x26d64a;};'use strict';var util=require('util');var _=require(_0x8841('0x0'));var moment=require(_0x8841('0x1'));function Action(_0x35f958,_0x46a904,_0x44cbc1){this[_0x8841('0x2')]=_0x35f958||undefined;this[_0x8841('0x3')]=util[_0x8841('0x4')](_0x8841('0x5'),_0x46a904[_0x8841('0x6')],_0x46a904[_0x8841('0x7')][_0x8841('0x8')],_0x44cbc1[_0x8841('0x9')]);this['localstationid']=_0x46a904[_0x8841('0xa')];this['headerinfo']=_0x46a904[_0x8841('0xb')];this[_0x8841('0xc')]=_0x44cbc1['path'];this[_0x8841('0xd')]=_0x44cbc1['AttachmentId'];}module[_0x8841('0xe')]=Action; \ No newline at end of file +var _0x93ae=['localstationid','headerinfo','path','AttachmentId','exports','util','moment','uniqueid','channel','format','%s/%s/%s','tech','Trunk','name','fax'];(function(_0x5da1af,_0x1b5e20){var _0x38caca=function(_0x64cecb){while(--_0x64cecb){_0x5da1af['push'](_0x5da1af['shift']());}};_0x38caca(++_0x1b5e20);}(_0x93ae,0x16d));var _0xe93a=function(_0x2e9ca2,_0x35dcea){_0x2e9ca2=_0x2e9ca2-0x0;var _0x269542=_0x93ae[_0x2e9ca2];return _0x269542;};'use strict';var util=require(_0xe93a('0x0'));var _=require('lodash');var moment=require(_0xe93a('0x1'));function Action(_0x3eab96,_0x3b2c9a,_0x268598){this[_0xe93a('0x2')]=_0x3eab96||undefined;this[_0xe93a('0x3')]=util[_0xe93a('0x4')](_0xe93a('0x5'),_0x3b2c9a[_0xe93a('0x6')],_0x3b2c9a[_0xe93a('0x7')][_0xe93a('0x8')],_0x268598[_0xe93a('0x9')]);this[_0xe93a('0xa')]=_0x3b2c9a[_0xe93a('0xa')];this[_0xe93a('0xb')]=_0x3b2c9a[_0xe93a('0xb')];this[_0xe93a('0xc')]=_0x268598[_0xe93a('0xc')];this[_0xe93a('0xd')]=_0x268598[_0xe93a('0xd')];}module[_0xe93a('0xe')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 699c6fc..fca7287 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 _0xc6df=['syncVarSet','newstate','syncNewExten','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','faxAccounts','exten','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','actions','channel','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','moment','path','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxMessage','channels','trunks','newchannel','syncNewchannel','bind'];(function(_0x39c2a9,_0x4f1bde){var _0x31fb1f=function(_0x3371e5){while(--_0x3371e5){_0x39c2a9['push'](_0x39c2a9['shift']());}};_0x31fb1f(++_0x4f1bde);}(_0xc6df,0x65));var _0xfc6d=function(_0x22f574,_0x3c4ad6){_0x22f574=_0x22f574-0x0;var _0x3d6858=_0xc6df[_0x22f574];return _0x3d6858;};'use strict';var util=require('util');var _=require(_0xfc6d('0x0'));var BPromise=require(_0xfc6d('0x1'));var uuid=require(_0xfc6d('0x2'));var moment=require(_0xfc6d('0x3'));var path=require(_0xfc6d('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0xfc6d('0x5'))(_0xfc6d('0x6'));var ami=require(_0xfc6d('0x7'));var rpcDb=require(_0xfc6d('0x8'));var Channel=require(_0xfc6d('0x9'));var ut=require(_0xfc6d('0xa'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0xfc6d('0xb'));function Fax(_0x1c8d68){this[_0xfc6d('0xc')]={};this['faxAccounts']=_0x1c8d68['faxAccounts'];this[_0xfc6d('0xd')]=_0x1c8d68['trunks'];this['actions']={};ami['on'](_0xfc6d('0xe'),this[_0xfc6d('0xf')][_0xfc6d('0x10')](this));ami['on']('varset',this[_0xfc6d('0x11')][_0xfc6d('0x10')](this));ami['on'](_0xfc6d('0x12'),this['syncNewState'][_0xfc6d('0x10')](this));ami['on']('newexten',this[_0xfc6d('0x13')][_0xfc6d('0x10')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0xfc6d('0x10')](this));ami['on'](_0xfc6d('0x14'),this[_0xfc6d('0x15')][_0xfc6d('0x10')](this));ami['on'](_0xfc6d('0x16'),this[_0xfc6d('0x17')][_0xfc6d('0x10')](this));ami['on']('originateresponse',this[_0xfc6d('0x18')][_0xfc6d('0x10')](this));}Fax[_0xfc6d('0x19')]['syncNewchannel']=function(_0x492ce7){if(_0x492ce7[_0xfc6d('0x1a')]===_0xfc6d('0x1b')){for(var _0x58112c in this[_0xfc6d('0x1c')]){if(this[_0xfc6d('0x1c')]['hasOwnProperty'](_0x58112c)){if(_0x492ce7[_0xfc6d('0x1d')]===this[_0xfc6d('0x1c')][_0x58112c][_0xfc6d('0x1e')]){this[_0xfc6d('0xc')][_0x492ce7['uniqueid']]={};this[_0xfc6d('0xc')][_0x492ce7[_0xfc6d('0x1f')]]['channel']=_0x492ce7['channel'];this[_0xfc6d('0xc')][_0x492ce7[_0xfc6d('0x1f')]]['id']=this[_0xfc6d('0x1c')][_0x58112c]['id'];this[_0xfc6d('0xc')][_0x492ce7['uniqueid']][_0xfc6d('0x20')]=this['faxAccounts'][_0x58112c][_0xfc6d('0x20')];logger[_0xfc6d('0x21')](_0x492ce7[_0xfc6d('0x1f')],_0xfc6d('0x22'));}}}}if(this[_0xfc6d('0x23')][_0x492ce7[_0xfc6d('0x1f')]]){this['channels'][_0x492ce7[_0xfc6d('0x1f')]]={};this['channels'][_0x492ce7[_0xfc6d('0x1f')]][_0xfc6d('0x24')]=_0x492ce7[_0xfc6d('0x24')];logger[_0xfc6d('0x21')](_0x492ce7[_0xfc6d('0x1f')],_0xfc6d('0x22'));}};Fax[_0xfc6d('0x19')][_0xfc6d('0x11')]=function(_0x1e5059){if(this[_0xfc6d('0xc')][_0x1e5059[_0xfc6d('0x1f')]]){for(var _0x15dda4 in _0x1e5059[_0xfc6d('0x25')]){if(_0x1e5059['variable'][_0xfc6d('0x26')](_0x15dda4)){this[_0xfc6d('0xc')][_0x1e5059['uniqueid']][_0x15dda4]=_0x1e5059[_0xfc6d('0x27')];}}}};Fax['prototype']['syncNewState']=function(_0x21b104){if(this['channels'][_0x21b104[_0xfc6d('0x1f')]]){this[_0xfc6d('0xc')][_0x21b104[_0xfc6d('0x1f')]][_0xfc6d('0x28')]=_0x21b104[_0xfc6d('0x28')];this[_0xfc6d('0xc')][_0x21b104['uniqueid']][_0xfc6d('0x29')]=_0x21b104[_0xfc6d('0x29')];}};Fax[_0xfc6d('0x19')][_0xfc6d('0x13')]=function(_0x5da486){if(this[_0xfc6d('0xc')][_0x5da486[_0xfc6d('0x1f')]]){for(var _0xa68067 in _0x5da486['variable']){if(_0x5da486[_0xfc6d('0x25')]['hasOwnProperty'](_0xa68067)){this['channels'][_0x5da486[_0xfc6d('0x1f')]][_0xa68067]=_0x5da486[_0xfc6d('0x27')];}}}};Fax[_0xfc6d('0x19')][_0xfc6d('0x2a')]=function(_0x557f54){if(this[_0xfc6d('0xc')][_0x557f54[_0xfc6d('0x1f')]]){this[_0xfc6d('0xc')][_0x557f54[_0xfc6d('0x1f')]][_0xfc6d('0x2b')]=_0x557f54[_0xfc6d('0x2b')];this[_0xfc6d('0xc')][_0x557f54[_0xfc6d('0x1f')]][_0xfc6d('0x2c')]=_0x557f54[_0xfc6d('0x2c')];this[_0xfc6d('0xc')][_0x557f54[_0xfc6d('0x1f')]][_0xfc6d('0x1e')]=_0x557f54['localstationid'];this[_0xfc6d('0xc')][_0x557f54[_0xfc6d('0x1f')]][_0xfc6d('0x2d')]=_0x557f54[_0xfc6d('0x2d')];logger[_0xfc6d('0x21')](_0x557f54[_0xfc6d('0x1f')],_0xfc6d('0x2e'));}};Fax[_0xfc6d('0x19')][_0xfc6d('0x15')]=function(_0xbf3e49){var _0x3e8908=this;if(this[_0xfc6d('0xc')][_0xbf3e49['uniqueid']]){var _0x38c5d1=this[_0xfc6d('0xc')][_0xbf3e49['uniqueid']]['id'];this[_0xfc6d('0xc')][_0xbf3e49[_0xfc6d('0x1f')]][_0xfc6d('0x2f')]=_0xbf3e49[_0xfc6d('0x2f')];this['channels'][_0xbf3e49[_0xfc6d('0x1f')]][_0xfc6d('0x30')]=_0xbf3e49[_0xfc6d('0x30')];this[_0xfc6d('0xc')][_0xbf3e49[_0xfc6d('0x1f')]][_0xfc6d('0x1e')]=_0xbf3e49[_0xfc6d('0x1e')];this[_0xfc6d('0xc')][_0xbf3e49[_0xfc6d('0x1f')]][_0xfc6d('0x31')]=_0xbf3e49['resolution'];this[_0xfc6d('0xc')][_0xbf3e49[_0xfc6d('0x1f')]][_0xfc6d('0x32')]=_0xbf3e49['transferrate'];this[_0xfc6d('0xc')][_0xbf3e49[_0xfc6d('0x1f')]][_0xfc6d('0x2d')]=_0xbf3e49['filename'];this[_0xfc6d('0xc')][_0xbf3e49['uniqueid']][_0xfc6d('0x33')]=_0xbf3e49[_0xfc6d('0x33')];if(this['channels'][_0xbf3e49[_0xfc6d('0x1f')]][_0xfc6d('0x30')]>0x0){tiff2pdf(_0xbf3e49[_0xfc6d('0x2d')],_0xfc6d('0x34'),function(_0x12124f){logger[_0xfc6d('0x21')](_0xbf3e49[_0xfc6d('0x1f')],'\x20result\x20conversion\x20file\x20',_0x12124f[_0xfc6d('0x35')]);attachment[_0xfc6d('0x36')]({'name':path[_0xfc6d('0x37')](_0xbf3e49[_0xfc6d('0x2d')])[_0xfc6d('0x20')],'basename':path[_0xfc6d('0x37')](_0xbf3e49[_0xfc6d('0x2d')])[_0xfc6d('0x20')]+_0xfc6d('0x38'),'type':_0xfc6d('0x39')})[_0xfc6d('0x3a')](function(_0x439e2d){faxAccount[_0xfc6d('0x3b')](_0x38c5d1,{'from':_0xbf3e49[_0xfc6d('0x33')],'mapKey':_0xfc6d('0x6'),'body':path['parse'](_0xbf3e49[_0xfc6d('0x2d')])['name']+_0xfc6d('0x38'),'AttachmentId':_0x439e2d['id']})[_0xfc6d('0x3c')](function(_0x52ae96){logger[_0xfc6d('0x3d')](_0xbf3e49['uniqueid'],_0xfc6d('0x3e'),JSON[_0xfc6d('0x3f')](_0x52ae96));});})[_0xfc6d('0x3c')](function(_0x21f2dc){logger[_0xfc6d('0x3d')](_0xbf3e49[_0xfc6d('0x1f')],_0xfc6d('0x40'),JSON[_0xfc6d('0x3f')](_0x21f2dc));});});}logger[_0xfc6d('0x21')](_0xbf3e49['uniqueid'],'\x20receiveFax\x20');}};Fax['prototype'][_0xfc6d('0x18')]=function(_0x558526){if(this[_0xfc6d('0x23')][_0x558526[_0xfc6d('0x1f')]]){_[_0xfc6d('0x41')](this[_0xfc6d('0xc')][_0x558526[_0xfc6d('0x1f')]],_[_0xfc6d('0x42')](_0x558526,[_0xfc6d('0x43'),_0xfc6d('0x44')]));}};function updateStatus(_0x334ea5){if(_0x334ea5[_0xfc6d('0x45')]){faxMessage[_0xfc6d('0x46')](_0x334ea5[_0xfc6d('0x45')],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x228005){ut[_0xfc6d('0x47')](_0xfc6d('0x48'),_0x228005);})['catch'](function(_0x35d372){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x35d372);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype']['updateStatus']=function(_0x4e7f81,_0x28244e,_0x267b49){var _0x213ef3=this;var _0x1a6b42={};if(_0x28244e){_0x1a6b42={'read':_0x28244e};}else{_0x1a6b42={'failMessage':_0x267b49};}if(this['actions'][_0x4e7f81][_0xfc6d('0x45')]){faxMessage[_0xfc6d('0x46')](this['actions'][_0x4e7f81][_0xfc6d('0x45')],_0x1a6b42)['then'](function(_0x3ee11c){ut['logger'](_0xfc6d('0x49'),_0x3ee11c);})[_0xfc6d('0x3c')](function(_0xc3f13c){ut[_0xfc6d('0x47')](_0xfc6d('0x4a'),_0xc3f13c);})['finally'](function(){delete _0x213ef3['channels'][_0x4e7f81];delete _0x213ef3[_0xfc6d('0x23')][_0x4e7f81];});}else{ut[_0xfc6d('0x47')](_0xfc6d('0x4b'));delete this[_0xfc6d('0xc')][_0x4e7f81];delete this[_0xfc6d('0x23')][_0x4e7f81];}};Fax[_0xfc6d('0x19')][_0xfc6d('0x17')]=function(_0x5a8735){var _0x3d6f2e=this;if(this[_0xfc6d('0xc')][_0x5a8735[_0xfc6d('0x1f')]]){if(this[_0xfc6d('0x23')][_0x5a8735['uniqueid']]){this['channels'][_0x5a8735[_0xfc6d('0x1f')]]['id']=this[_0xfc6d('0x23')][_0x5a8735[_0xfc6d('0x1f')]]['id'];this[_0xfc6d('0xc')][_0x5a8735[_0xfc6d('0x1f')]][_0xfc6d('0x20')]=this['actions'][_0x5a8735[_0xfc6d('0x1f')]]['name'];}logger[_0xfc6d('0x21')](_0x5a8735['uniqueid'],this[_0xfc6d('0x23')][_0x5a8735[_0xfc6d('0x1f')]]?_0xfc6d('0x4c'):_0xfc6d('0x4d'),JSON['stringify'](this[_0xfc6d('0xc')][_0x5a8735[_0xfc6d('0x1f')]]));if(this['actions'][_0x5a8735['uniqueid']]){if(this[_0xfc6d('0xc')][_0x5a8735[_0xfc6d('0x1f')]][_0xfc6d('0x4e')]>0x0&&this[_0xfc6d('0xc')][_0x5a8735[_0xfc6d('0x1f')]]['faxstatus']===_0xfc6d('0x4f')){this[_0xfc6d('0x50')](_0x5a8735['uniqueid'],!![]);}else{this['updateStatus'](_0x5a8735[_0xfc6d('0x1f')],![],this[_0xfc6d('0xc')][_0x5a8735['uniqueid']][_0xfc6d('0x51')]?'SENDING\x20FAILED:\x20'+this[_0xfc6d('0xc')][_0x5a8735[_0xfc6d('0x1f')]][_0xfc6d('0x51')]:_0xfc6d('0x52'));}}}};Fax[_0xfc6d('0x19')][_0xfc6d('0x53')]=function(_0x38b919){var _0x296921=this;return new BPromise(function(_0x45df1a,_0x52edfa){_0x296921[_0xfc6d('0x54')](_0x38b919,_0x296921[_0xfc6d('0x1c')][_0x38b919[_0xfc6d('0x55')]])['then'](function(_0x41ef00){ut[_0xfc6d('0x47')]('[Fax][execOriginate][success]',_0x41ef00);_0x45df1a(ut[_0xfc6d('0x35')](_0xfc6d('0x56')));})[_0xfc6d('0x3c')](function(_0x2110d4){ut[_0xfc6d('0x47')](_0xfc6d('0x57'),_0x2110d4);updateStatus(_0x38b919);_0x52edfa(ut['message'](_0xfc6d('0x58')));});});};Fax['prototype'][_0xfc6d('0x59')]=function(_0x1c1fa0){var _0x20992b=this;return new BPromise(function(_0x5c0365,_0x3cfbe2){var _0x1d9eef=_0x20992b['checkTrunk'](_0x20992b['faxAccounts'][_0x1c1fa0['FaxAccountId']][_0xfc6d('0x5a')],_0x1c1fa0);if(_0x1d9eef[_0xfc6d('0x5b')]){_0x5c0365(ut[_0xfc6d('0x35')](_0xfc6d('0x5c')));}else{_0x3cfbe2(ut[_0xfc6d('0x35')](_0x1d9eef[_0xfc6d('0x35')]));}});};function originate(_0x14af21,_0x102055,_0x13887a){return new BPromise(function(_0x487884,_0x5973be){if(_0x13887a){var _0x2c4f0d=util[_0xfc6d('0x5d')](_0xfc6d('0x5e'),path[_0xfc6d('0x37')](_0x14af21[_0xfc6d('0x4')])[_0xfc6d('0x20')],_0x14af21[_0xfc6d('0x4')]);gs[_0xfc6d('0x5f')](_0x2c4f0d)[_0xfc6d('0x3a')](function(){_0x14af21[_0xfc6d('0x4')]=util[_0xfc6d('0x5d')](_0xfc6d('0x60'),path[_0xfc6d('0x37')](_0x14af21[_0xfc6d('0x4')])[_0xfc6d('0x61')],path[_0xfc6d('0x37')](_0x14af21['path'])['name']);_0x102055['XMF-PATH']=_0x14af21[_0xfc6d('0x4')];ut[_0xfc6d('0x47')](_0xfc6d('0x62'),'');ami[_0xfc6d('0x63')](ut[_0xfc6d('0x64')](_0x14af21,_0x102055))[_0xfc6d('0x3a')](function(_0x3edf40){_0x487884(_0x3edf40);})[_0xfc6d('0x3c')](function(_0x1ccb9f){_0x5973be(_0x1ccb9f);});})[_0xfc6d('0x3c')](function(_0x4cff92){_0x5973be(_0x4cff92);});}else{ami['Action'](ut[_0xfc6d('0x64')](_0x14af21,_0x102055))[_0xfc6d('0x3a')](function(_0x3b0c90){_0x487884(_0x3b0c90);})[_0xfc6d('0x3c')](function(_0x5861e4){_0x5973be(_0x5861e4);});}});}Fax[_0xfc6d('0x19')][_0xfc6d('0x54')]=function(_0x48b154,_0x292d08){var _0x57cd3c=this;return new BPromise(function(_0x6a7250,_0x3ba2bb){var _0x1a89c7=uuid['v4']();var _0x25e411=ut[_0xfc6d('0x65')](_0x48b154,_0x292d08);_0x57cd3c[_0xfc6d('0x23')][_0x1a89c7]=new Action(_0x1a89c7,_0x292d08,_0x48b154);var _0x116e44=_0x57cd3c[_0xfc6d('0x23')][_0x1a89c7];if(path[_0xfc6d('0x37')](_0x48b154[_0xfc6d('0x4')])[_0xfc6d('0x66')]===_0xfc6d('0x38')){originate(_0x116e44,_0x25e411,!![])[_0xfc6d('0x3a')](function(_0x281735){_0x6a7250(_0x281735);})[_0xfc6d('0x3c')](function(_0x4e802a){_0x3ba2bb(_0x4e802a);});}else{originate(_0x116e44,_0x25e411,![])[_0xfc6d('0x3a')](function(_0x1a11af){_0x6a7250(_0x1a11af);})[_0xfc6d('0x3c')](function(_0x1bc3fc){_0x3ba2bb(_0x1bc3fc);});}});};Fax['prototype'][_0xfc6d('0x67')]=function(_0xbd56d9){return!_[_0xfc6d('0x68')](_0xbd56d9)&&!_[_0xfc6d('0x68')](_0xbd56d9[_0xfc6d('0x20')])&&!_[_0xfc6d('0x68')](_0xbd56d9['active'])&&_0xbd56d9[_0xfc6d('0x69')]&&!_[_0xfc6d('0x68')](this[_0xfc6d('0xd')][util[_0xfc6d('0x5d')](_0xfc6d('0x6a'),_0xbd56d9['name'])])&&!_[_0xfc6d('0x68')](this['trunks'][util['format'](_0xfc6d('0x6a'),_0xbd56d9[_0xfc6d('0x20')])][_0xfc6d('0x2c')])&&(this['trunks'][util[_0xfc6d('0x5d')]('SIP/%s',_0xbd56d9[_0xfc6d('0x20')])][_0xfc6d('0x2c')]===_0xfc6d('0x6b')||this[_0xfc6d('0xd')][util[_0xfc6d('0x5d')](_0xfc6d('0x6a'),_0xbd56d9[_0xfc6d('0x20')])][_0xfc6d('0x2c')]===_0xfc6d('0x6c'));};Fax[_0xfc6d('0x19')][_0xfc6d('0x6d')]=function(_0x39ab82,_0x47682){if(!this['isTrunkReachable'](_0x39ab82)){ut[_0xfc6d('0x47')](_0xfc6d('0x6e'),_['isNil'](_0x39ab82)?'':_0x39ab82[_0xfc6d('0x20')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xfc6d('0x6f')};}if(_[_0xfc6d('0x68')](_0x47682[_0xfc6d('0x6')])){ut['logger'](_0xfc6d('0x70'),JSON[_0xfc6d('0x3f')](_0x47682));return{'isValid':![],'message':_0xfc6d('0x71')};}if(_[_0xfc6d('0x68')](_0x47682[_0xfc6d('0x4')])){ut['logger'](_0xfc6d('0x72'),JSON['stringify'](_0x47682));return{'isValid':![],'message':_0xfc6d('0x73')};}return{'isValid':!![],'message':_0xfc6d('0x74')};};module[_0xfc6d('0x75')]=Fax; \ No newline at end of file +var _0x2c75=['[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','exports','util','lodash','bluebird','moment','path','./util/gs','../../../config/logger','../ami','./channel','./action','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','syncVarSet','newstate','syncNewState','bind','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','originateresponse','prototype','context','from-voip-provider','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','channelstate','channelstatedesc','hasOwnProperty','value','operation','status','filename','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','actions','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working'];(function(_0x16b073,_0x390662){var _0x301039=function(_0x2d5eae){while(--_0x2d5eae){_0x16b073['push'](_0x16b073['shift']());}};_0x301039(++_0x390662);}(_0x2c75,0x1cb));var _0x52c7=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0x2c75[_0x3c6dce];return _0x1450e9;};'use strict';var util=require(_0x52c7('0x0'));var _=require(_0x52c7('0x1'));var BPromise=require(_0x52c7('0x2'));var uuid=require('uuid');var moment=require(_0x52c7('0x3'));var path=require(_0x52c7('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x52c7('0x5'));var logger=require(_0x52c7('0x6'))('fax');var ami=require(_0x52c7('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x52c7('0x8'));var ut=require('./util/util');var Action=require(_0x52c7('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x52c7('0xa'));function Fax(_0x2c1e1d){this[_0x52c7('0xb')]={};this[_0x52c7('0xc')]=_0x2c1e1d[_0x52c7('0xc')];this[_0x52c7('0xd')]=_0x2c1e1d[_0x52c7('0xd')];this['actions']={};ami['on'](_0x52c7('0xe'),this[_0x52c7('0xf')]['bind'](this));ami['on']('varset',this[_0x52c7('0x10')]['bind'](this));ami['on'](_0x52c7('0x11'),this[_0x52c7('0x12')][_0x52c7('0x13')](this));ami['on'](_0x52c7('0x14'),this[_0x52c7('0x15')]['bind'](this));ami['on'](_0x52c7('0x16'),this[_0x52c7('0x17')]['bind'](this));ami['on']('receivefax',this[_0x52c7('0x18')]['bind'](this));ami['on'](_0x52c7('0x19'),this['syncHangup'][_0x52c7('0x13')](this));ami['on'](_0x52c7('0x1a'),this['syncOriginateResponse']['bind'](this));}Fax[_0x52c7('0x1b')][_0x52c7('0xf')]=function(_0x597d35){if(_0x597d35[_0x52c7('0x1c')]===_0x52c7('0x1d')){for(var _0x6378e5 in this['faxAccounts']){if(this[_0x52c7('0xc')]['hasOwnProperty'](_0x6378e5)){if(_0x597d35['exten']===this[_0x52c7('0xc')][_0x6378e5][_0x52c7('0x1e')]){this[_0x52c7('0xb')][_0x597d35[_0x52c7('0x1f')]]={};this[_0x52c7('0xb')][_0x597d35[_0x52c7('0x1f')]]['channel']=_0x597d35[_0x52c7('0x20')];this[_0x52c7('0xb')][_0x597d35['uniqueid']]['id']=this[_0x52c7('0xc')][_0x6378e5]['id'];this[_0x52c7('0xb')][_0x597d35[_0x52c7('0x1f')]][_0x52c7('0x21')]=this[_0x52c7('0xc')][_0x6378e5][_0x52c7('0x21')];logger['info'](_0x597d35['uniqueid'],_0x52c7('0x22'));}}}}if(this['actions'][_0x597d35['uniqueid']]){this[_0x52c7('0xb')][_0x597d35['uniqueid']]={};this['channels'][_0x597d35[_0x52c7('0x1f')]]['channel']=_0x597d35[_0x52c7('0x20')];logger[_0x52c7('0x23')](_0x597d35[_0x52c7('0x1f')],_0x52c7('0x22'));}};Fax[_0x52c7('0x1b')][_0x52c7('0x10')]=function(_0x26bcf5){if(this['channels'][_0x26bcf5[_0x52c7('0x1f')]]){for(var _0x1f1c88 in _0x26bcf5[_0x52c7('0x24')]){if(_0x26bcf5['variable']['hasOwnProperty'](_0x1f1c88)){this[_0x52c7('0xb')][_0x26bcf5[_0x52c7('0x1f')]][_0x1f1c88]=_0x26bcf5['value'];}}}};Fax['prototype'][_0x52c7('0x12')]=function(_0x450c96){if(this['channels'][_0x450c96['uniqueid']]){this[_0x52c7('0xb')][_0x450c96['uniqueid']]['channelstate']=_0x450c96[_0x52c7('0x25')];this[_0x52c7('0xb')][_0x450c96[_0x52c7('0x1f')]][_0x52c7('0x26')]=_0x450c96['channelstatedesc'];}};Fax[_0x52c7('0x1b')][_0x52c7('0x15')]=function(_0x54d873){if(this[_0x52c7('0xb')][_0x54d873[_0x52c7('0x1f')]]){for(var _0x2d53ce in _0x54d873[_0x52c7('0x24')]){if(_0x54d873[_0x52c7('0x24')][_0x52c7('0x27')](_0x2d53ce)){this[_0x52c7('0xb')][_0x54d873[_0x52c7('0x1f')]][_0x2d53ce]=_0x54d873[_0x52c7('0x28')];}}}};Fax['prototype'][_0x52c7('0x17')]=function(_0x554ad5){if(this[_0x52c7('0xb')][_0x554ad5[_0x52c7('0x1f')]]){this['channels'][_0x554ad5[_0x52c7('0x1f')]][_0x52c7('0x29')]=_0x554ad5[_0x52c7('0x29')];this['channels'][_0x554ad5[_0x52c7('0x1f')]][_0x52c7('0x2a')]=_0x554ad5[_0x52c7('0x2a')];this[_0x52c7('0xb')][_0x554ad5[_0x52c7('0x1f')]][_0x52c7('0x1e')]=_0x554ad5[_0x52c7('0x1e')];this[_0x52c7('0xb')][_0x554ad5[_0x52c7('0x1f')]][_0x52c7('0x2b')]=_0x554ad5[_0x52c7('0x2b')];logger[_0x52c7('0x23')](_0x554ad5[_0x52c7('0x1f')],_0x52c7('0x2c'));}};Fax['prototype'][_0x52c7('0x18')]=function(_0x3550b3){var _0x253a61=this;if(this[_0x52c7('0xb')][_0x3550b3[_0x52c7('0x1f')]]){var _0x2c4700=this['channels'][_0x3550b3[_0x52c7('0x1f')]]['id'];this['channels'][_0x3550b3[_0x52c7('0x1f')]]['remotestationid']=_0x3550b3['remotestationid'];this['channels'][_0x3550b3[_0x52c7('0x1f')]][_0x52c7('0x2d')]=_0x3550b3[_0x52c7('0x2d')];this['channels'][_0x3550b3['uniqueid']][_0x52c7('0x1e')]=_0x3550b3[_0x52c7('0x1e')];this[_0x52c7('0xb')][_0x3550b3[_0x52c7('0x1f')]][_0x52c7('0x2e')]=_0x3550b3['resolution'];this[_0x52c7('0xb')][_0x3550b3[_0x52c7('0x1f')]]['transferrate']=_0x3550b3[_0x52c7('0x2f')];this['channels'][_0x3550b3['uniqueid']][_0x52c7('0x2b')]=_0x3550b3[_0x52c7('0x2b')];this[_0x52c7('0xb')][_0x3550b3[_0x52c7('0x1f')]]['calleridnum']=_0x3550b3[_0x52c7('0x30')];if(this['channels'][_0x3550b3['uniqueid']][_0x52c7('0x2d')]>0x0){tiff2pdf(_0x3550b3[_0x52c7('0x2b')],_0x52c7('0x31'),function(_0x1f9ca7){logger[_0x52c7('0x23')](_0x3550b3[_0x52c7('0x1f')],_0x52c7('0x32'),_0x1f9ca7[_0x52c7('0x33')]);attachment[_0x52c7('0x34')]({'name':path[_0x52c7('0x35')](_0x3550b3['filename'])[_0x52c7('0x21')],'basename':path[_0x52c7('0x35')](_0x3550b3[_0x52c7('0x2b')])[_0x52c7('0x21')]+_0x52c7('0x36'),'type':_0x52c7('0x37')})[_0x52c7('0x38')](function(_0x56930b){faxAccount[_0x52c7('0x39')](_0x2c4700,{'from':_0x3550b3[_0x52c7('0x30')],'mapKey':_0x52c7('0x3a'),'body':path[_0x52c7('0x35')](_0x3550b3['filename'])['name']+_0x52c7('0x36'),'AttachmentId':_0x56930b['id']})[_0x52c7('0x3b')](function(_0x1928db){logger[_0x52c7('0x3c')](_0x3550b3[_0x52c7('0x1f')],_0x52c7('0x3d'),JSON[_0x52c7('0x3e')](_0x1928db));});})[_0x52c7('0x3b')](function(_0x7ef1e0){logger[_0x52c7('0x3c')](_0x3550b3[_0x52c7('0x1f')],_0x52c7('0x3f'),JSON['stringify'](_0x7ef1e0));});});}logger[_0x52c7('0x23')](_0x3550b3[_0x52c7('0x1f')],'\x20receiveFax\x20');}};Fax['prototype']['syncOriginateResponse']=function(_0x17d6b0){if(this[_0x52c7('0x40')][_0x17d6b0[_0x52c7('0x1f')]]){_[_0x52c7('0x41')](this[_0x52c7('0xb')][_0x17d6b0[_0x52c7('0x1f')]],_[_0x52c7('0x42')](_0x17d6b0,[_0x52c7('0x43'),_0x52c7('0x44')]));}};function updateStatus(_0x3026a4){if(_0x3026a4[_0x52c7('0x45')]){faxMessage['update'](_0x3026a4[_0x52c7('0x45')],{'failMessage':_0x52c7('0x46')})['then'](function(_0x65155e){ut[_0x52c7('0x47')]('[Fax][Message][Error][Updated]',_0x65155e);})[_0x52c7('0x3b')](function(_0x36fc22){ut['logger'](_0x52c7('0x48'),_0x36fc22);});}else{ut[_0x52c7('0x47')](_0x52c7('0x49'));}}Fax[_0x52c7('0x1b')]['updateStatus']=function(_0x47fd3c,_0x81cfd1,_0x1be146){var _0x40845f=this;var _0x259705={};if(_0x81cfd1){_0x259705={'read':_0x81cfd1};}else{_0x259705={'failMessage':_0x1be146};}if(this[_0x52c7('0x40')][_0x47fd3c][_0x52c7('0x45')]){faxMessage['update'](this['actions'][_0x47fd3c]['AttachmentId'],_0x259705)[_0x52c7('0x38')](function(_0x156c98){ut['logger'](_0x52c7('0x4a'),_0x156c98);})[_0x52c7('0x3b')](function(_0x348ac3){ut[_0x52c7('0x47')](_0x52c7('0x4b'),_0x348ac3);})[_0x52c7('0x4c')](function(){delete _0x40845f[_0x52c7('0xb')][_0x47fd3c];delete _0x40845f['actions'][_0x47fd3c];});}else{ut[_0x52c7('0x47')](_0x52c7('0x4d'));delete this['channels'][_0x47fd3c];delete this[_0x52c7('0x40')][_0x47fd3c];}};Fax['prototype'][_0x52c7('0x4e')]=function(_0x2b690d){var _0x547c36=this;if(this[_0x52c7('0xb')][_0x2b690d[_0x52c7('0x1f')]]){if(this['actions'][_0x2b690d[_0x52c7('0x1f')]]){this['channels'][_0x2b690d[_0x52c7('0x1f')]]['id']=this[_0x52c7('0x40')][_0x2b690d['uniqueid']]['id'];this[_0x52c7('0xb')][_0x2b690d[_0x52c7('0x1f')]][_0x52c7('0x21')]=this[_0x52c7('0x40')][_0x2b690d[_0x52c7('0x1f')]]['name'];}logger[_0x52c7('0x23')](_0x2b690d[_0x52c7('0x1f')],this[_0x52c7('0x40')][_0x2b690d[_0x52c7('0x1f')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x52c7('0x3e')](this[_0x52c7('0xb')][_0x2b690d['uniqueid']]));if(this[_0x52c7('0x40')][_0x2b690d['uniqueid']]){if(this[_0x52c7('0xb')][_0x2b690d[_0x52c7('0x1f')]][_0x52c7('0x4f')]>0x0&&this[_0x52c7('0xb')][_0x2b690d[_0x52c7('0x1f')]][_0x52c7('0x16')]==='SUCCESS'){this['updateStatus'](_0x2b690d['uniqueid'],!![]);}else{this[_0x52c7('0x50')](_0x2b690d[_0x52c7('0x1f')],![],this[_0x52c7('0xb')][_0x2b690d[_0x52c7('0x1f')]][_0x52c7('0x51')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x2b690d['uniqueid']][_0x52c7('0x51')]:_0x52c7('0x52'));}}}};Fax['prototype'][_0x52c7('0x53')]=function(_0x27ad4f){var _0x51de97=this;return new BPromise(function(_0x782bff,_0x526690){_0x51de97['execOriginate'](_0x27ad4f,_0x51de97[_0x52c7('0xc')][_0x27ad4f[_0x52c7('0x54')]])[_0x52c7('0x38')](function(_0x2c42f6){ut[_0x52c7('0x47')]('[Fax][execOriginate][success]',_0x2c42f6);_0x782bff(ut[_0x52c7('0x33')](_0x52c7('0x55')));})[_0x52c7('0x3b')](function(_0x50ba10){ut['logger'](_0x52c7('0x56'),_0x50ba10);updateStatus(_0x27ad4f);_0x526690(ut[_0x52c7('0x33')](_0x52c7('0x57')));});});};Fax[_0x52c7('0x1b')][_0x52c7('0x58')]=function(_0x1ebcea){var _0x1f6287=this;return new BPromise(function(_0x3b4ca9,_0x21c657){var _0x4965b0=_0x1f6287[_0x52c7('0x59')](_0x1f6287[_0x52c7('0xc')][_0x1ebcea[_0x52c7('0x54')]][_0x52c7('0x5a')],_0x1ebcea);if(_0x4965b0[_0x52c7('0x5b')]){_0x3b4ca9(ut[_0x52c7('0x33')](_0x52c7('0x5c')));}else{_0x21c657(ut[_0x52c7('0x33')](_0x4965b0[_0x52c7('0x33')]));}});};function originate(_0x58b7ea,_0x33f46c,_0x3d1ff6){return new BPromise(function(_0x1b826b,_0x5c3f8c){if(_0x3d1ff6){var _0x58d659=util[_0x52c7('0x5d')](_0x52c7('0x5e'),path[_0x52c7('0x35')](_0x58b7ea[_0x52c7('0x4')])['name'],_0x58b7ea[_0x52c7('0x4')]);gs[_0x52c7('0x5f')](_0x58d659)[_0x52c7('0x38')](function(){_0x58b7ea[_0x52c7('0x4')]=util['format']('%s/%s.tif',path[_0x52c7('0x35')](_0x58b7ea[_0x52c7('0x4')])[_0x52c7('0x60')],path[_0x52c7('0x35')](_0x58b7ea[_0x52c7('0x4')])[_0x52c7('0x21')]);_0x33f46c[_0x52c7('0x61')]=_0x58b7ea[_0x52c7('0x4')];ut['logger'](_0x52c7('0x62'),'');ami['Action'](ut['variablesAction'](_0x58b7ea,_0x33f46c))[_0x52c7('0x38')](function(_0x484570){_0x1b826b(_0x484570);})[_0x52c7('0x3b')](function(_0x4b35e8){_0x5c3f8c(_0x4b35e8);});})[_0x52c7('0x3b')](function(_0x599d73){_0x5c3f8c(_0x599d73);});}else{ami[_0x52c7('0x63')](ut[_0x52c7('0x64')](_0x58b7ea,_0x33f46c))[_0x52c7('0x38')](function(_0x4407d6){_0x1b826b(_0x4407d6);})[_0x52c7('0x3b')](function(_0x5dab48){_0x5c3f8c(_0x5dab48);});}});}Fax['prototype'][_0x52c7('0x65')]=function(_0xcba5ad,_0x255f52){var _0x533be4=this;return new BPromise(function(_0x39be88,_0xa32bef){var _0x1462f5=uuid['v4']();var _0x50e1c8=ut[_0x52c7('0x66')](_0xcba5ad,_0x255f52);_0x533be4[_0x52c7('0x40')][_0x1462f5]=new Action(_0x1462f5,_0x255f52,_0xcba5ad);var _0x1c7fcc=_0x533be4[_0x52c7('0x40')][_0x1462f5];if(path[_0x52c7('0x35')](_0xcba5ad[_0x52c7('0x4')])[_0x52c7('0x67')]===_0x52c7('0x36')){originate(_0x1c7fcc,_0x50e1c8,!![])[_0x52c7('0x38')](function(_0x51b76a){_0x39be88(_0x51b76a);})[_0x52c7('0x3b')](function(_0x291b04){_0xa32bef(_0x291b04);});}else{originate(_0x1c7fcc,_0x50e1c8,![])['then'](function(_0x9b92b1){_0x39be88(_0x9b92b1);})['catch'](function(_0x345dc2){_0xa32bef(_0x345dc2);});}});};Fax['prototype'][_0x52c7('0x68')]=function(_0x143b46){return!_[_0x52c7('0x69')](_0x143b46)&&!_[_0x52c7('0x69')](_0x143b46[_0x52c7('0x21')])&&!_[_0x52c7('0x69')](_0x143b46[_0x52c7('0x6a')])&&_0x143b46[_0x52c7('0x6a')]&&!_[_0x52c7('0x69')](this[_0x52c7('0xd')][util[_0x52c7('0x5d')](_0x52c7('0x6b'),_0x143b46[_0x52c7('0x21')])])&&!_[_0x52c7('0x69')](this[_0x52c7('0xd')][util[_0x52c7('0x5d')](_0x52c7('0x6b'),_0x143b46[_0x52c7('0x21')])][_0x52c7('0x2a')])&&(this[_0x52c7('0xd')][util[_0x52c7('0x5d')](_0x52c7('0x6b'),_0x143b46[_0x52c7('0x21')])]['status']===_0x52c7('0x6c')||this['trunks'][util['format'](_0x52c7('0x6b'),_0x143b46[_0x52c7('0x21')])]['status']==='unmonitored');};Fax[_0x52c7('0x1b')][_0x52c7('0x59')]=function(_0x465c1e,_0x567d3d){if(!this[_0x52c7('0x68')](_0x465c1e)){ut[_0x52c7('0x47')](_0x52c7('0x6d'),_[_0x52c7('0x69')](_0x465c1e)?'':_0x465c1e[_0x52c7('0x21')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x52c7('0x6e')};}if(_[_0x52c7('0x69')](_0x567d3d['fax'])){ut[_0x52c7('0x47')](_0x52c7('0x6f'),JSON[_0x52c7('0x3e')](_0x567d3d));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x567d3d['path'])){ut[_0x52c7('0x47')](_0x52c7('0x70'),JSON['stringify'](_0x567d3d));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x52c7('0x71')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index c2eb996..933364e 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 _0xd407=['util','bluebird','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20'];(function(_0xe9149d,_0x2c825c){var _0x2373d3=function(_0x29655d){while(--_0x29655d){_0xe9149d['push'](_0xe9149d['shift']());}};_0x2373d3(++_0x2c825c);}(_0xd407,0xf2));var _0x7d40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd407[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x7d40('0x0'));var BPromise=require(_0x7d40('0x1'));var logger=require('../../../config/logger')(_0x7d40('0x2'));var _=require(_0x7d40('0x3'));var faxAccount=require(_0x7d40('0x4'));function loggerCatch(_0x3ea4bc){return function(_0x43404c){logger[_0x7d40('0x5')](_0x3ea4bc,util[_0x7d40('0x6')](_0x43404c,{'showHidden':![],'depth':null}));};}exports[_0x7d40('0x7')]=function(_0x1d6b0f,_0x2d7baf){return BPromise[_0x7d40('0x8')]()[_0x7d40('0x9')](faxAccount[_0x7d40('0x7')](_0x1d6b0f,_0x2d7baf))['catch'](loggerCatch(_0x7d40('0xa')));}; \ No newline at end of file +var _0x3216=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','notify','util'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0x3216,0x187));var _0x6321=function(_0x3c8bf0,_0x220db4){_0x3c8bf0=_0x3c8bf0-0x0;var _0x422c89=_0x3216[_0x3c8bf0];return _0x422c89;};'use strict';var util=require(_0x6321('0x0'));var BPromise=require(_0x6321('0x1'));var logger=require(_0x6321('0x2'))(_0x6321('0x3'));var _=require(_0x6321('0x4'));var faxAccount=require(_0x6321('0x5'));function loggerCatch(_0x28a72d){return function(_0x8649c2){logger[_0x6321('0x6')](_0x28a72d,util['inspect'](_0x8649c2,{'showHidden':![],'depth':null}));};}exports[_0x6321('0x7')]=function(_0x3c83c4,_0xa8c051){return BPromise['resolve']()['then'](faxAccount[_0x6321('0x7')](_0x3c83c4,_0xa8c051))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 33fb0b2..95ec915 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 _0x7bf0=['bluebird','child_process','exec','execute','info','Exec\x20gs','inspect','util','fax'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x7bf0,0xf1));var _0x07bf=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7bf0[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0x07bf('0x0'));var logger=require('../../../../config/logger')(_0x07bf('0x1'));var BPromise=require(_0x07bf('0x2'));var exec=require(_0x07bf('0x3'))[_0x07bf('0x4')];exports[_0x07bf('0x5')]=function(_0x4467e3){return new BPromise(function(_0x3da741,_0x40716d){exec(_0x4467e3,function(_0x132aa8,_0x4360b2,_0x2476dc){logger[_0x07bf('0x6')](_0x07bf('0x7'),_0x4360b2);if(_0x132aa8){logger['info']('Exec\x20gs','\x20Error\x20:',util[_0x07bf('0x8')](_0x132aa8,{'showHidden':![],'depth':null}),_0x4360b2,_0x2476dc);_0x40716d(_0x132aa8);}_0x3da741(_0x4360b2);});});}; \ No newline at end of file +var _0xd246=['child_process','exec','execute','Exec\x20gs','\x20Error\x20:','util','fax','bluebird'];(function(_0x696ea7,_0x5deaa8){var _0x2987b3=function(_0x399e22){while(--_0x399e22){_0x696ea7['push'](_0x696ea7['shift']());}};_0x2987b3(++_0x5deaa8);}(_0xd246,0x18d));var _0x6d24=function(_0x1800cb,_0xba50f9){_0x1800cb=_0x1800cb-0x0;var _0x3b5e95=_0xd246[_0x1800cb];return _0x3b5e95;};'use strict';var util=require(_0x6d24('0x0'));var logger=require('../../../../config/logger')(_0x6d24('0x1'));var BPromise=require(_0x6d24('0x2'));var exec=require(_0x6d24('0x3'))[_0x6d24('0x4')];exports[_0x6d24('0x5')]=function(_0x3b859b){return new BPromise(function(_0x26efa4,_0x2eea7c){exec(_0x3b859b,function(_0x54d351,_0x1dfb58,_0x3b9b32){logger['info'](_0x6d24('0x6'),_0x1dfb58);if(_0x54d351){logger['info'](_0x6d24('0x6'),_0x6d24('0x7'),util['inspect'](_0x54d351,{'showHidden':![],'depth':null}),_0x1dfb58,_0x3b9b32);_0x2eea7c(_0x54d351);}_0x26efa4(_0x1dfb58);});});}; \ 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 d80f480..4b6be68 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 _0x1339=['modem','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','moment','../../../../config/logger','fax','message','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22'];(function(_0x1726e1,_0x42f8ee){var _0x24a918=function(_0x126fb8){while(--_0x126fb8){_0x1726e1['push'](_0x1726e1['shift']());}};_0x24a918(++_0x42f8ee);}(_0x1339,0x1ed));var _0x9133=function(_0x166c8b,_0x2e069a){_0x166c8b=_0x166c8b-0x0;var _0x540f9d=_0x1339[_0x166c8b];return _0x540f9d;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x9133('0x0'));var logger=require(_0x9133('0x1'))(_0x9133('0x2'));exports[_0x9133('0x3')]=function(_0x447096){return{'message':_0x447096};};exports[_0x9133('0x4')]=function(_0x176e80,_0x110c51){logger['info'](_0x176e80,util[_0x9133('0x5')](_0x110c51,{'showHidden':![],'depth':null}));};exports[_0x9133('0x6')]=function(_0x379915,_0x539af6){var _0x2758e2={'XMF-ECM':_0x539af6[_0x9133('0x7')],'XMF-HEADERINFO':_0x539af6[_0x9133('0x8')],'XMF-MINRATE':_0x539af6[_0x9133('0x9')],'XMF-MAXRATE':_0x539af6[_0x9133('0xa')],'XMF-MODEM':util[_0x9133('0xb')](_0x9133('0xc'),_0x539af6[_0x9133('0xd')]),'XMF-GATEWAY':_0x539af6[_0x9133('0xe')],'XMF-FAXDETECT':_0x539af6[_0x9133('0xf')],'XMF-T38TIMEOUT':_0x539af6['t38timeout'],'XMF-LOCALSTATIONID':_0x539af6[_0x9133('0x10')],'XMF-PATH':_0x379915[_0x9133('0x11')]};return _0x2758e2;};exports[_0x9133('0x12')]=function(_0x452481,_0x3b8f89){return{'actionid':_0x452481[_0x9133('0x13')],'action':'originate','channel':_0x452481[_0x9133('0x14')],'Exten':_0x9133('0x15'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x9133('0x16'),_0x452481['headerinfo']?_0x452481[_0x9133('0x8')]:'',_0x452481[_0x9133('0x10')]),'variable':_0x3b8f89,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x452481[_0x9133('0x13')]};}; \ No newline at end of file +var _0xbdb7=['faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','from-sip','util','lodash','moment','../../../../config/logger','fax','message','logger','info','headerinfo','minrate','\x22%s\x22','modem','gateway'];(function(_0x347bbe,_0x587a74){var _0x178a9c=function(_0x59076e){while(--_0x59076e){_0x347bbe['push'](_0x347bbe['shift']());}};_0x178a9c(++_0x587a74);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x395155,_0x192ffd){_0x395155=_0x395155-0x0;var _0x179767=_0xbdb7[_0x395155];return _0x179767;};'use strict';var util=require(_0x7bdb('0x0'));var _=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var logger=require(_0x7bdb('0x3'))(_0x7bdb('0x4'));exports[_0x7bdb('0x5')]=function(_0x4496ac){return{'message':_0x4496ac};};exports[_0x7bdb('0x6')]=function(_0x46c068,_0x47aec5){logger[_0x7bdb('0x7')](_0x46c068,util['inspect'](_0x47aec5,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0xffdc86,_0x1e23a3){var _0x493bde={'XMF-ECM':_0x1e23a3['ecm'],'XMF-HEADERINFO':_0x1e23a3[_0x7bdb('0x8')],'XMF-MINRATE':_0x1e23a3[_0x7bdb('0x9')],'XMF-MAXRATE':_0x1e23a3['maxrate'],'XMF-MODEM':util['format'](_0x7bdb('0xa'),_0x1e23a3[_0x7bdb('0xb')]),'XMF-GATEWAY':_0x1e23a3[_0x7bdb('0xc')],'XMF-FAXDETECT':_0x1e23a3[_0x7bdb('0xd')],'XMF-T38TIMEOUT':_0x1e23a3[_0x7bdb('0xe')],'XMF-LOCALSTATIONID':_0x1e23a3[_0x7bdb('0xf')],'XMF-PATH':_0xffdc86[_0x7bdb('0x10')]};return _0x493bde;};exports[_0x7bdb('0x11')]=function(_0x5462da,_0x4e5b8e){return{'actionid':_0x5462da['uniqueid'],'action':_0x7bdb('0x12'),'channel':_0x5462da[_0x7bdb('0x13')],'Exten':'xcally-motion-fax','Context':_0x7bdb('0x14'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x5462da[_0x7bdb('0x8')]?_0x5462da[_0x7bdb('0x8')]:'',_0x5462da['localstationid']),'variable':_0x4e5b8e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5462da['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index ab8063f..69af275 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 _0xa3c4=['./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','resolve','getAgents','initAgents','then','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen','sync','bluebird','util','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory'];(function(_0x254bc4,_0x95004f){var _0x2f89d6=function(_0x33100a){while(--_0x33100a){_0x254bc4['push'](_0x254bc4['shift']());}};_0x2f89d6(++_0x95004f);}(_0xa3c4,0xba));var _0x4a3c=function(_0x39ce3e,_0x21560c){_0x39ce3e=_0x39ce3e-0x0;var _0x116c6e=_0xa3c4[_0x39ce3e];return _0x116c6e;};'use strict';var BPromise=require(_0x4a3c('0x0'));var util=require(_0x4a3c('0x1'));var moment=require('moment');var server=require(_0x4a3c('0x2'));var Realtime=require(_0x4a3c('0x3'));var Report=require(_0x4a3c('0x4'));var Acw=require(_0x4a3c('0x5'));var Trigger=require(_0x4a3c('0x6'));var Dialer=require(_0x4a3c('0x7'));var Preview=require(_0x4a3c('0x8'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x4a3c('0x9'));var voiceCallReport=require(_0x4a3c('0xa'));var trunk=require(_0x4a3c('0xb'));var trigger=require(_0x4a3c('0xc'));var template=require(_0x4a3c('0xd'));var cmHopperHistory=require(_0x4a3c('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x4a3c('0xf'));var faxAccount=require(_0x4a3c('0x10'));var zendesk=require(_0x4a3c('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x4a3c('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x4a3c('0x13'));var zoho=require(_0x4a3c('0x14'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x4a3c('0x15'));var servicenow=require(_0x4a3c('0x16'));var dynamics365=require(_0x4a3c('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x4a3c('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x4a3c('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x4a3c('0x19')]()['then'](user[_0x4a3c('0x1a')]())['then'](realtime[_0x4a3c('0x1b')]())[_0x4a3c('0x1c')](user[_0x4a3c('0x1d')]())['then'](realtime[_0x4a3c('0x1e')]())[_0x4a3c('0x1c')](trunk[_0x4a3c('0x1f')]())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x20')]())['then'](voiceQueue['getVoiceQueues']())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x21')]())['then'](trigger[_0x4a3c('0x22')]())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x23')]())[_0x4a3c('0x1c')](template[_0x4a3c('0x24')]())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x25')]())[_0x4a3c('0x1c')](zendesk[_0x4a3c('0x26')]())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x27')]())[_0x4a3c('0x1c')](salesforce[_0x4a3c('0x28')]())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x29')]())[_0x4a3c('0x1c')](sugarcrm[_0x4a3c('0x2a')]())['then'](realtime[_0x4a3c('0x2b')]())[_0x4a3c('0x1c')](freshdesk[_0x4a3c('0x2c')]())[_0x4a3c('0x1c')](realtime['initFreshdeskAccounts']())[_0x4a3c('0x1c')](desk[_0x4a3c('0x2d')]())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x2e')]())[_0x4a3c('0x1c')](zoho['getZohoAccounts']())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x2f')]())[_0x4a3c('0x1c')](vtiger['getVtigerAccounts']())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x30')]())[_0x4a3c('0x1c')](freshsales[_0x4a3c('0x31')]())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x32')]())['then'](servicenow[_0x4a3c('0x33')]())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x34')]())[_0x4a3c('0x1c')](dynamics365[_0x4a3c('0x35')]())[_0x4a3c('0x1c')](realtime['initDynamics365Accounts']())[_0x4a3c('0x1c')](campaign['getCampaigns']())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x36')]())[_0x4a3c('0x1c')](voiceExtension[_0x4a3c('0x37')]())['then'](realtime[_0x4a3c('0x38')]())['then'](faxAccount['getFaxAccounts']())[_0x4a3c('0x1c')](realtime['initFaxAccounts']())[_0x4a3c('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x4a3c('0x19')]()[_0x4a3c('0x1c')](voiceQueueReport[_0x4a3c('0x39')]())['then'](realtime[_0x4a3c('0x3a')]())[_0x4a3c('0x1c')](cmHopperHistory[_0x4a3c('0x3b')]())[_0x4a3c('0x1c')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x4a3c('0x3c')]())['then'](realtime[_0x4a3c('0x3d')]())['then'](voiceCallReport[_0x4a3c('0x3e')]())[_0x4a3c('0x1c')](realtime[_0x4a3c('0x3f')]())[_0x4a3c('0x1c')](function(_0x35ed75){})['catch'](function(_0x32ba34){console[_0x4a3c('0x40')](_0x32ba34);});}function main(){return server[_0x4a3c('0x41')](realtime,preview,fax)[_0x4a3c('0x1c')](function(_0x11b06c){return initRealtime();})[_0x4a3c('0x1c')](function(){return initParams();})[_0x4a3c('0x1c')](function(){report[_0x4a3c('0x42')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x9896bb){console[_0x4a3c('0x40')](_0x9896bb);});}main(); \ No newline at end of file +var _0x9149=['./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','getTelephones','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','resolve','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','sync','log','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension'];(function(_0x1048e9,_0x55693a){var _0x4a8f29=function(_0xe3b7eb){while(--_0xe3b7eb){_0x1048e9['push'](_0x1048e9['shift']());}};_0x4a8f29(++_0x55693a);}(_0x9149,0x1d7));var _0x9914=function(_0x4eb67a,_0x5aec85){_0x4eb67a=_0x4eb67a-0x0;var _0x29aa20=_0x9149[_0x4eb67a];return _0x29aa20;};'use strict';var BPromise=require(_0x9914('0x0'));var util=require(_0x9914('0x1'));var moment=require(_0x9914('0x2'));var server=require(_0x9914('0x3'));var Realtime=require(_0x9914('0x4'));var Report=require(_0x9914('0x5'));var Acw=require(_0x9914('0x6'));var Trigger=require(_0x9914('0x7'));var Dialer=require(_0x9914('0x8'));var Preview=require(_0x9914('0x9'));var Fax=require(_0x9914('0xa'));var user=require(_0x9914('0xb'));var voiceQueue=require(_0x9914('0xc'));var voiceQueueReport=require(_0x9914('0xd'));var voiceCallReport=require(_0x9914('0xe'));var trunk=require(_0x9914('0xf'));var trigger=require(_0x9914('0x10'));var template=require('./rpc/template');var cmHopperHistory=require(_0x9914('0x11'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x9914('0x12'));var faxAccount=require(_0x9914('0x13'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x9914('0x14'));var sugarcrm=require(_0x9914('0x15'));var freshdesk=require(_0x9914('0x16'));var desk=require(_0x9914('0x17'));var zoho=require(_0x9914('0x18'));var vtiger=require(_0x9914('0x19'));var freshsales=require(_0x9914('0x1a'));var servicenow=require(_0x9914('0x1b'));var dynamics365=require(_0x9914('0x1c'));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()[_0x9914('0x1d')](_0x9914('0x1e'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x9914('0x1d')](_0x9914('0x1e'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x9914('0x1f')](user[_0x9914('0x20')]())[_0x9914('0x1f')](realtime[_0x9914('0x21')]())[_0x9914('0x1f')](user[_0x9914('0x22')]())['then'](realtime['initTelephones']())[_0x9914('0x1f')](trunk['getTrunks']())[_0x9914('0x1f')](realtime['initTrunks']())[_0x9914('0x1f')](voiceQueue[_0x9914('0x23')]())['then'](realtime['initVoiceQueues']())['then'](trigger[_0x9914('0x24')]())['then'](realtime[_0x9914('0x25')]())[_0x9914('0x1f')](template[_0x9914('0x26')]())[_0x9914('0x1f')](realtime[_0x9914('0x27')]())[_0x9914('0x1f')](zendesk[_0x9914('0x28')]())[_0x9914('0x1f')](realtime[_0x9914('0x29')]())[_0x9914('0x1f')](salesforce[_0x9914('0x2a')]())[_0x9914('0x1f')](realtime[_0x9914('0x2b')]())[_0x9914('0x1f')](sugarcrm[_0x9914('0x2c')]())[_0x9914('0x1f')](realtime[_0x9914('0x2d')]())[_0x9914('0x1f')](freshdesk[_0x9914('0x2e')]())[_0x9914('0x1f')](realtime[_0x9914('0x2f')]())['then'](desk[_0x9914('0x30')]())[_0x9914('0x1f')](realtime['initDeskAccounts']())[_0x9914('0x1f')](zoho[_0x9914('0x31')]())[_0x9914('0x1f')](realtime[_0x9914('0x32')]())[_0x9914('0x1f')](vtiger[_0x9914('0x33')]())['then'](realtime[_0x9914('0x34')]())[_0x9914('0x1f')](freshsales[_0x9914('0x35')]())[_0x9914('0x1f')](realtime[_0x9914('0x36')]())[_0x9914('0x1f')](servicenow['getServicenowAccounts']())[_0x9914('0x1f')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x9914('0x37')]())[_0x9914('0x1f')](realtime['initDynamics365Accounts']())[_0x9914('0x1f')](campaign['getCampaigns']())[_0x9914('0x1f')](realtime[_0x9914('0x38')]())['then'](voiceExtension[_0x9914('0x39')]())[_0x9914('0x1f')](realtime[_0x9914('0x3a')]())['then'](faxAccount['getFaxAccounts']())['then'](realtime[_0x9914('0x3b')]())[_0x9914('0x1f')](function(){return realtime;});}function initParams(){return BPromise[_0x9914('0x3c')]()[_0x9914('0x1f')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x9914('0x3d')]())[_0x9914('0x1f')](cmHopperHistory[_0x9914('0x3e')]())['then'](realtime[_0x9914('0x3f')]())[_0x9914('0x1f')](cmHopperHistory['getCampaignHopperHistory']())[_0x9914('0x1f')](realtime[_0x9914('0x40')]())[_0x9914('0x1f')](voiceCallReport[_0x9914('0x41')]())['then'](realtime[_0x9914('0x42')]())[_0x9914('0x1f')](function(_0x89270d){})[_0x9914('0x43')](function(_0x3d0315){console['log'](_0x3d0315);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x371375){return initRealtime();})[_0x9914('0x1f')](function(){return initParams();})[_0x9914('0x1f')](function(){report[_0x9914('0x44')]();setInterval(initRealtime,0x1388);})[_0x9914('0x43')](function(_0x46a347){console[_0x9914('0x45')](_0x46a347);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 9235d8f..b2636f8 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 _0x7cde=['localhost','name','email','accountcode','fullname','state','unknown','stateTime','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','statePause','toNumber','voiceStatus','status','address','voiceStatusQueue','stringify','format','emit','user:save','exports','lodash','util','moment','md5','ioredis','redis','defaults'];(function(_0x194237,_0x3c288f){var _0x40eef6=function(_0x129c17){while(--_0x129c17){_0x194237['push'](_0x194237['shift']());}};_0x40eef6(++_0x3c288f);}(_0x7cde,0x10a));var _0xe7cd=function(_0x3aa2bf,_0x44c8f2){_0x3aa2bf=_0x3aa2bf-0x0;var _0x17e965=_0x7cde[_0x3aa2bf];return _0x17e965;};'use strict';var _=require(_0xe7cd('0x0'));var util=require(_0xe7cd('0x1'));var moment=require(_0xe7cd('0x2'));var md5=require(_0xe7cd('0x3'));var Redis=require(_0xe7cd('0x4'));var config=require('../../../config/environment');config[_0xe7cd('0x5')]=_[_0xe7cd('0x6')](config[_0xe7cd('0x5')],{'host':_0xe7cd('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x2c3429){this['id']=_0x2c3429['id']||0x0;this[_0xe7cd('0x8')]=_0x2c3429['name']||'';this['email']=_0x2c3429[_0xe7cd('0x9')]||'';this[_0xe7cd('0xa')]=_0x2c3429[_0xe7cd('0xa')]||'';this[_0xe7cd('0xb')]=_0x2c3429[_0xe7cd('0xb')]||'';this[_0xe7cd('0xc')]=_0xe7cd('0xd');this[_0xe7cd('0xe')]=0x0;this['status']=_0xe7cd('0xd');this['address']='';this['phone']='';this[_0xe7cd('0xf')]='';this[_0xe7cd('0x10')]='';this[_0xe7cd('0x11')]=_0x2c3429[_0xe7cd('0x11')]||![];this['voiceStatus']=_0xe7cd('0xd');this[_0xe7cd('0x12')]=0x0;this[_0xe7cd('0x13')]='';this['voiceStatusQueue']='';this[_0xe7cd('0x14')]=![];this[_0xe7cd('0x15')]=![];this['md5']='';}Agent[_0xe7cd('0x16')][_0xe7cd('0x17')]=function(_0x29423b){var _0x4c3bf2;if(_0x29423b&&_0x29423b[_0xe7cd('0xc')]){_0x4c3bf2=_0x29423b[_0xe7cd('0xc')][_0xe7cd('0x18')]();switch(_0x4c3bf2){case _0xe7cd('0x19'):_0x4c3bf2='idle';break;case _0xe7cd('0x1a'):_0x4c3bf2=_0xe7cd('0x1b');break;}}if(_0x4c3bf2&&this['voiceStatus']!==_0x4c3bf2||_0x29423b[_0xe7cd('0x1c')]){this[_0xe7cd('0x12')]=_[_0xe7cd('0x1d')](moment()['format']('x'));}if(_0x4c3bf2){this[_0xe7cd('0x1e')]=_0x4c3bf2;}var _0x50268d={'id':this['id'],'name':this[_0xe7cd('0x8')],'email':this[_0xe7cd('0x9')],'accountcode':this[_0xe7cd('0xa')],'fullname':this[_0xe7cd('0xb')],'state':this['state'],'stateTime':this[_0xe7cd('0xe')],'status':this[_0xe7cd('0x1f')],'address':this[_0xe7cd('0x20')],'online':this['online'],'voiceStatus':this[_0xe7cd('0x1e')],'voiceStatusTime':this[_0xe7cd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xe7cd('0x21')],'interface':this[_0xe7cd('0x10')],'onhold':this[_0xe7cd('0x14')]};var _0x2344f1=md5(JSON[_0xe7cd('0x22')](_0x50268d));if(this[_0xe7cd('0x3')]!==_0x2344f1){this['md5']=_0x2344f1;io['to'](util[_0xe7cd('0x23')]('user:%s',_0x50268d[_0xe7cd('0x8')]))[_0xe7cd('0x24')](_0xe7cd('0x25'),_0x50268d);}};module[_0xe7cd('0x26')]=Agent; \ No newline at end of file +var _0x1db4=['lodash','util','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','stringify','format','user:%s','user:save'];(function(_0x58981c,_0x1b8a43){var _0x2f3aae=function(_0x347a01){while(--_0x347a01){_0x58981c['push'](_0x58981c['shift']());}};_0x2f3aae(++_0x1b8a43);}(_0x1db4,0x1c8));var _0x41db=function(_0x431d49,_0x474f1a){_0x431d49=_0x431d49-0x0;var _0x52b90e=_0x1db4[_0x431d49];return _0x52b90e;};'use strict';var _=require(_0x41db('0x0'));var util=require(_0x41db('0x1'));var moment=require('moment');var md5=require(_0x41db('0x2'));var Redis=require(_0x41db('0x3'));var config=require(_0x41db('0x4'));config['redis']=_['defaults'](config[_0x41db('0x5')],{'host':_0x41db('0x6'),'port':0x18eb});var io=require(_0x41db('0x7'))(new Redis(config['redis']));function Agent(_0xcdea93){this['id']=_0xcdea93['id']||0x0;this['name']=_0xcdea93[_0x41db('0x8')]||'';this[_0x41db('0x9')]=_0xcdea93[_0x41db('0x9')]||'';this['accountcode']=_0xcdea93[_0x41db('0xa')]||'';this[_0x41db('0xb')]=_0xcdea93[_0x41db('0xb')]||'';this[_0x41db('0xc')]=_0x41db('0xd');this[_0x41db('0xe')]=0x0;this[_0x41db('0xf')]='unknown';this[_0x41db('0x10')]='';this[_0x41db('0x11')]='';this[_0x41db('0x12')]='';this[_0x41db('0x13')]='';this[_0x41db('0x14')]=_0xcdea93[_0x41db('0x14')]||![];this[_0x41db('0x15')]=_0x41db('0xd');this[_0x41db('0x16')]=0x0;this[_0x41db('0x17')]='';this['voiceStatusQueue']='';this[_0x41db('0x18')]=![];this[_0x41db('0x19')]=![];this[_0x41db('0x2')]='';}Agent['prototype'][_0x41db('0x1a')]=function(_0x4cdc95){var _0xee709;if(_0x4cdc95&&_0x4cdc95[_0x41db('0xc')]){_0xee709=_0x4cdc95[_0x41db('0xc')][_0x41db('0x1b')]();switch(_0xee709){case _0x41db('0x1c'):_0xee709=_0x41db('0x1d');break;case _0x41db('0x1e'):_0xee709=_0x41db('0x1f');break;}}if(_0xee709&&this['voiceStatus']!==_0xee709||_0x4cdc95[_0x41db('0x20')]){this['voiceStatusTime']=_[_0x41db('0x21')](moment()['format']('x'));}if(_0xee709){this[_0x41db('0x15')]=_0xee709;}var _0x1befd4={'id':this['id'],'name':this[_0x41db('0x8')],'email':this[_0x41db('0x9')],'accountcode':this[_0x41db('0xa')],'fullname':this[_0x41db('0xb')],'state':this[_0x41db('0xc')],'stateTime':this[_0x41db('0xe')],'status':this['status'],'address':this[_0x41db('0x10')],'online':this[_0x41db('0x14')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x41db('0x13')],'onhold':this['onhold']};var _0x2ba838=md5(JSON[_0x41db('0x22')](_0x1befd4));if(this['md5']!==_0x2ba838){this['md5']=_0x2ba838;io['to'](util[_0x41db('0x23')](_0x41db('0x24'),_0x1befd4[_0x41db('0x8')]))['emit'](_0x41db('0x25'),_0x1befd4);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 4223f27..ccf71ff 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 _0x2032=['ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','ivrAnswerCallsDay'];(function(_0x18e7b6,_0x597a9e){var _0x1db1dd=function(_0x3ea494){while(--_0x3ea494){_0x18e7b6['push'](_0x18e7b6['shift']());}};_0x1db1dd(++_0x597a9e);}(_0x2032,0xd9));var _0x2203=function(_0x11883d,_0x297ee3){_0x11883d=_0x11883d-0x0;var _0x26830c=_0x2032[_0x11883d];return _0x26830c;};'use strict';function Campaign(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['type']||_0x2203('0x2');this[_0x2203('0x3')]=0x0;this['temp']=0x0;this[_0x2203('0x4')]=0x0;this[_0x2203('0x5')]=0x0;this[_0x2203('0x6')]='';this[_0x2203('0x7')]=!![];this[_0x2203('0x8')]=_0x4d6c97[_0x2203('0x8')];this[_0x2203('0x9')]=_0x4d6c97[_0x2203('0x9')];this[_0x2203('0xa')]=_0x4d6c97[_0x2203('0xa')]||null;this[_0x2203('0xb')]=_0x4d6c97['dialGlobalInterval']?_0x4d6c97['dialGlobalInterval']:null;this[_0x2203('0xc')]=_0x4d6c97['dialOriginateCallerIdName'];this[_0x2203('0xd')]=_0x4d6c97[_0x2203('0xd')];this[_0x2203('0xe')]=_0x4d6c97['dialOriginateTimeout']||0x1e;this[_0x2203('0xf')]=_0x4d6c97['dialCongestionMaxRetry'];this[_0x2203('0x10')]=_0x4d6c97['dialCongestionRetryFrequency'];this[_0x2203('0x11')]=_0x4d6c97[_0x2203('0x11')];this['dialBusyRetryFrequency']=_0x4d6c97['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x4d6c97['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x4d6c97[_0x2203('0x12')];this['dialGlobalMaxRetry']=_0x4d6c97['dialGlobalMaxRetry'];this[_0x2203('0x13')]=_0x4d6c97[_0x2203('0x13')]||_0x2203('0x14');this[_0x2203('0x15')]=_0x4d6c97[_0x2203('0x15')]||undefined;this[_0x2203('0x16')]=_0x4d6c97[_0x2203('0x16')]||undefined;this[_0x2203('0x17')]=_0x4d6c97[_0x2203('0x17')]||undefined;this[_0x2203('0x18')]=_0x4d6c97['TrunkBackup']?_0x4d6c97[_0x2203('0x18')]:undefined;this[_0x2203('0x19')]=_0x4d6c97['Trunk']?_0x4d6c97[_0x2203('0x19')]:undefined;this[_0x2203('0x1a')]=_0x4d6c97['Interval']?_0x4d6c97[_0x2203('0x1a')]:undefined;this['SquareProject']=_0x4d6c97[_0x2203('0x1b')]?_0x4d6c97[_0x2203('0x1b')]:undefined;this[_0x2203('0x1c')]=_0x4d6c97[_0x2203('0x1b')]?_0x4d6c97[_0x2203('0x1b')][_0x2203('0x0')]:undefined;this['dialAMDActive']=_0x4d6c97[_0x2203('0x1d')]||![];this['dialAMDInitialSilence']=_0x4d6c97['dialAMDInitialSilence'];this[_0x2203('0x1e')]=_0x4d6c97['dialAMDGreeting'];this[_0x2203('0x1f')]=_0x4d6c97[_0x2203('0x1f')];this['dialAMDTotalAnalysisTime']=_0x4d6c97[_0x2203('0x20')];this['dialAMDMinWordLength']=_0x4d6c97['dialAMDMinWordLength'];this[_0x2203('0x21')]=_0x4d6c97[_0x2203('0x21')];this[_0x2203('0x22')]=_0x4d6c97[_0x2203('0x22')];this[_0x2203('0x23')]=_0x4d6c97[_0x2203('0x23')];this[_0x2203('0x24')]=_0x4d6c97[_0x2203('0x24')];}module['exports']=Campaign; \ No newline at end of file +var _0x757a=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x1d997f,_0x259b5a){var _0x307704=function(_0x4358a8){while(--_0x4358a8){_0x1d997f['push'](_0x1d997f['shift']());}};_0x307704(++_0x259b5a);}(_0x757a,0xde));var _0xa757=function(_0xd29c93,_0xe1dcf3){_0xd29c93=_0xd29c93-0x0;var _0x5149be=_0x757a[_0xd29c93];return _0x5149be;};'use strict';function Campaign(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['type']=_0x1acf7d['type']||'campaign';this[_0xa757('0x1')]=0x0;this[_0xa757('0x2')]=0x0;this[_0xa757('0x3')]=0x0;this[_0xa757('0x4')]=0x0;this[_0xa757('0x5')]='';this[_0xa757('0x6')]=!![];this['active']=_0x1acf7d[_0xa757('0x7')];this[_0xa757('0x8')]=_0x1acf7d['limitCalls'];this[_0xa757('0x9')]=_0x1acf7d[_0xa757('0x9')]||null;this[_0xa757('0xa')]=_0x1acf7d[_0xa757('0xa')]?_0x1acf7d[_0xa757('0xa')]:null;this['dialOriginateCallerIdName']=_0x1acf7d[_0xa757('0xb')];this[_0xa757('0xc')]=_0x1acf7d[_0xa757('0xc')];this[_0xa757('0xd')]=_0x1acf7d[_0xa757('0xd')]||0x1e;this[_0xa757('0xe')]=_0x1acf7d[_0xa757('0xe')];this['dialCongestionRetryFrequency']=_0x1acf7d['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x1acf7d['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x1acf7d[_0xa757('0xf')];this['dialNoAnswerMaxRetry']=_0x1acf7d['dialNoAnswerMaxRetry'];this[_0xa757('0x10')]=_0x1acf7d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x1acf7d[_0xa757('0x11')];this[_0xa757('0x12')]=_0x1acf7d[_0xa757('0x12')]||_0xa757('0x13');this[_0xa757('0x14')]=_0x1acf7d[_0xa757('0x14')]||undefined;this[_0xa757('0x15')]=_0x1acf7d[_0xa757('0x15')]||undefined;this[_0xa757('0x16')]=_0x1acf7d[_0xa757('0x16')]||undefined;this['TrunkBackup']=_0x1acf7d[_0xa757('0x17')]?_0x1acf7d[_0xa757('0x17')]:undefined;this[_0xa757('0x18')]=_0x1acf7d['Trunk']?_0x1acf7d['Trunk']:undefined;this[_0xa757('0x19')]=_0x1acf7d[_0xa757('0x19')]?_0x1acf7d[_0xa757('0x19')]:undefined;this[_0xa757('0x1a')]=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d[_0xa757('0x1a')]:undefined;this['dialQueueProject']=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d['SquareProject'][_0xa757('0x0')]:undefined;this[_0xa757('0x1b')]=_0x1acf7d[_0xa757('0x1b')]||![];this[_0xa757('0x1c')]=_0x1acf7d['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1acf7d[_0xa757('0x1d')];this[_0xa757('0x1e')]=_0x1acf7d[_0xa757('0x1e')];this[_0xa757('0x1f')]=_0x1acf7d[_0xa757('0x1f')];this[_0xa757('0x20')]=_0x1acf7d[_0xa757('0x20')];this[_0xa757('0x21')]=_0x1acf7d[_0xa757('0x21')];this['dialAMDMaximumNumberOfWords']=_0x1acf7d[_0xa757('0x22')];this['dialAMDSilenceThreshold']=_0x1acf7d[_0xa757('0x23')];this['dialAMDMaximumWordLength']=_0x1acf7d[_0xa757('0x24')];}module[_0xa757('0x25')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 3204fd9..485bb4a 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 _0xe1e8=['connectedlinename','accountcode','context','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','holdtime','type','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','exports','starttime','destinationchannel','connectedlinenum'];(function(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0xe1e8,0x1cb));var _0x8e1e=function(_0x42aac8,_0x273969){_0x42aac8=_0x42aac8-0x0;var _0x2b27da=_0xe1e8[_0x42aac8];return _0x2b27da;};'use strict';function Channel(){this[_0x8e1e('0x0')]=null;this['channel']='';this[_0x8e1e('0x1')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x8e1e('0x2')]=undefined;this[_0x8e1e('0x3')]=undefined;this[_0x8e1e('0x4')]=0x0;this[_0x8e1e('0x5')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x8e1e('0x6')]=0x0;this[_0x8e1e('0x7')]=![];this[_0x8e1e('0x8')]=null;this[_0x8e1e('0x9')]=null;this['unmanaged']=![];this[_0x8e1e('0xa')]=![];this[_0x8e1e('0xb')]='';this[_0x8e1e('0xc')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x8e1e('0xd')]=0x0;this[_0x8e1e('0xe')]=null;this['tag']=null;this[_0x8e1e('0xf')]=null;this['monitor']=![];this[_0x8e1e('0x10')]=null;this[_0x8e1e('0x11')]=null;this[_0x8e1e('0x12')]=[];this[_0x8e1e('0x13')]=undefined;this[_0x8e1e('0x14')]=undefined;this['mohtime']=0x0;}module[_0x8e1e('0x15')]=Channel; \ No newline at end of file +var _0x8863=['calleridnum','calleridname','uniqueid','linkedid','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitorFilename','queue','monitors','mohtime','exports','channel','destinationchannel'];(function(_0x317e30,_0x32ad66){var _0x203788=function(_0x264d38){while(--_0x264d38){_0x317e30['push'](_0x317e30['shift']());}};_0x203788(++_0x32ad66);}(_0x8863,0x1b6));var _0x3886=function(_0x34c300,_0x45abcc){_0x34c300=_0x34c300-0x0;var _0x272bb0=_0x8863[_0x34c300];return _0x272bb0;};'use strict';function Channel(){this['starttime']=null;this[_0x3886('0x0')]='';this[_0x3886('0x1')]='';this[_0x3886('0x2')]=0x0;this[_0x3886('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this['context']='';this[_0x3886('0x4')]=0x0;this[_0x3886('0x5')]=0x0;this['exten']=0x0;this[_0x3886('0x6')]=![];this[_0x3886('0x7')]=null;this['endtime']=null;this[_0x3886('0x8')]=![];this[_0x3886('0x9')]=![];this[_0x3886('0xa')]='';this[_0x3886('0xb')]='';this['duration']=0x0;this[_0x3886('0xc')]=0x0;this[_0x3886('0xd')]=0x0;this[_0x3886('0xe')]=null;this[_0x3886('0xf')]=null;this[_0x3886('0x10')]=null;this['monitor']=![];this[_0x3886('0x11')]=null;this[_0x3886('0x12')]=null;this[_0x3886('0x13')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x3886('0x14')]=0x0;}module[_0x3886('0x15')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 617412b..d7c37a5 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 _0x7b27=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x330b71,_0x1c0391){var _0x457f9c=function(_0x393dc1){while(--_0x393dc1){_0x330b71['push'](_0x330b71['shift']());}};_0x457f9c(++_0x1c0391);}(_0x7b27,0x186));var _0x77b2=function(_0x52f1f7,_0x2d1345){_0x52f1f7=_0x52f1f7-0x0;var _0x320e53=_0x7b27[_0x52f1f7];return _0x320e53;};'use strict';function DeskAccount(_0x24c18e){this['id']=_0x24c18e['id']||0x0;this['name']=_0x24c18e[_0x77b2('0x0')]||'';this[_0x77b2('0x1')]=_0x24c18e[_0x77b2('0x1')]||'';this[_0x77b2('0x2')]=_0x24c18e['remoteUri']||'';this[_0x77b2('0x3')]=_0x24c18e[_0x77b2('0x3')]||'';this['password']=_0x24c18e[_0x77b2('0x4')]||'';this[_0x77b2('0x5')]=_0x24c18e[_0x77b2('0x5')]||'';this['consumerSecret']=_0x24c18e[_0x77b2('0x6')]||'';this[_0x77b2('0x7')]=_0x24c18e[_0x77b2('0x7')]||'';this[_0x77b2('0x8')]=_0x24c18e['tokenSecret']||'';this[_0x77b2('0x9')]=_0x24c18e[_0x77b2('0x9')]||'';this[_0x77b2('0xa')]=_0x24c18e[_0x77b2('0xa')]||'';this[_0x77b2('0xb')]=_0x24c18e[_0x77b2('0xb')]||{};}module[_0x77b2('0xc')]=DeskAccount; \ No newline at end of file +var _0x39c7=['exports','name','username','remoteUri','authType','password','consumerSecret','tokenSecret','type','serverUrl','Configurations'];(function(_0x57643b,_0x1706fe){var _0x53a35b=function(_0x2625e8){while(--_0x2625e8){_0x57643b['push'](_0x57643b['shift']());}};_0x53a35b(++_0x1706fe);}(_0x39c7,0x85));var _0x739c=function(_0x2fc2a9,_0x5a4c89){_0x2fc2a9=_0x2fc2a9-0x0;var _0x41f799=_0x39c7[_0x2fc2a9];return _0x41f799;};'use strict';function DeskAccount(_0x4f59a6){this['id']=_0x4f59a6['id']||0x0;this[_0x739c('0x0')]=_0x4f59a6[_0x739c('0x0')]||'';this[_0x739c('0x1')]=_0x4f59a6[_0x739c('0x1')]||'';this[_0x739c('0x2')]=_0x4f59a6[_0x739c('0x2')]||'';this['authType']=_0x4f59a6[_0x739c('0x3')]||'';this[_0x739c('0x4')]=_0x4f59a6[_0x739c('0x4')]||'';this['consumerKey']=_0x4f59a6['consumerKey']||'';this[_0x739c('0x5')]=_0x4f59a6[_0x739c('0x5')]||'';this['token']=_0x4f59a6['token']||'';this[_0x739c('0x6')]=_0x4f59a6[_0x739c('0x6')]||'';this['type']=_0x4f59a6[_0x739c('0x7')]||'';this[_0x739c('0x8')]=_0x4f59a6['serverUrl']||'';this['Configurations']=_0x4f59a6[_0x739c('0x9')]||{};}module[_0x739c('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 0b82b53..2c7cc04 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 _0x5428=['clientSecret','serverUrl','Configurations','exports','name','username','password','tenantId','clientId'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x5428,0x1a2));var _0x8542=function(_0x55970d,_0x409672){_0x55970d=_0x55970d-0x0;var _0x267c5f=_0x5428[_0x55970d];return _0x267c5f;};'use strict';function Dynamics365Account(_0x35124f){this['id']=_0x35124f['id']||0x0;this[_0x8542('0x0')]=_0x35124f[_0x8542('0x0')]||'';this[_0x8542('0x1')]=_0x35124f[_0x8542('0x1')]||'';this[_0x8542('0x2')]=_0x35124f[_0x8542('0x2')]||'';this['remoteUri']=_0x35124f['remoteUri']||'';this[_0x8542('0x3')]=_0x35124f[_0x8542('0x3')]||'';this['clientId']=_0x35124f[_0x8542('0x4')]||'';this[_0x8542('0x5')]=_0x35124f[_0x8542('0x5')]||{};this[_0x8542('0x6')]=_0x35124f[_0x8542('0x6')]||'';this[_0x8542('0x7')]=_0x35124f[_0x8542('0x7')]||{};}module[_0x8542('0x8')]=Dynamics365Account; \ No newline at end of file +var _0x761c=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','exports','name'];(function(_0x4b7124,_0x206b7b){var _0x23e16d=function(_0x2cd68e){while(--_0x2cd68e){_0x4b7124['push'](_0x4b7124['shift']());}};_0x23e16d(++_0x206b7b);}(_0x761c,0xe9));var _0xc761=function(_0x16b0ca,_0x4a96b3){_0x16b0ca=_0x16b0ca-0x0;var _0x1825f3=_0x761c[_0x16b0ca];return _0x1825f3;};'use strict';function Dynamics365Account(_0x3dacf0){this['id']=_0x3dacf0['id']||0x0;this[_0xc761('0x0')]=_0x3dacf0[_0xc761('0x0')]||'';this[_0xc761('0x1')]=_0x3dacf0[_0xc761('0x1')]||'';this[_0xc761('0x2')]=_0x3dacf0[_0xc761('0x2')]||'';this[_0xc761('0x3')]=_0x3dacf0[_0xc761('0x3')]||'';this['tenantId']=_0x3dacf0[_0xc761('0x4')]||'';this['clientId']=_0x3dacf0[_0xc761('0x5')]||'';this[_0xc761('0x6')]=_0x3dacf0[_0xc761('0x6')]||{};this[_0xc761('0x7')]=_0x3dacf0[_0xc761('0x7')]||'';this['Configurations']=_0x3dacf0['Configurations']||{};}module[_0xc761('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index dc50482..12da29c 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 _0x9994=['maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x2bf153,_0x1129e5){var _0x2e1750=function(_0x1f8a66){while(--_0x1f8a66){_0x2bf153['push'](_0x2bf153['shift']());}};_0x2e1750(++_0x1129e5);}(_0x9994,0x18a));var _0x4999=function(_0x38d499,_0x1cbb6b){_0x38d499=_0x38d499-0x0;var _0x274b18=_0x9994[_0x38d499];return _0x274b18;};'use strict';function FaxAccount(_0x30abbb){this['id']=_0x30abbb['id']||0x0;this[_0x4999('0x0')]=_0x30abbb[_0x4999('0x0')]||'';this[_0x4999('0x1')]=_0x30abbb[_0x4999('0x1')];this[_0x4999('0x2')]=_0x30abbb[_0x4999('0x2')];this[_0x4999('0x3')]=_0x30abbb[_0x4999('0x3')];this[_0x4999('0x4')]=_0x30abbb[_0x4999('0x4')];this['minrate']=_0x30abbb[_0x4999('0x5')]||0x960;this[_0x4999('0x6')]=_0x30abbb[_0x4999('0x6')]||0x3840;this[_0x4999('0x7')]=_0x30abbb[_0x4999('0x7')]||'v17,v27,v29';this[_0x4999('0x8')]=_0x30abbb[_0x4999('0x8')]||'no';this[_0x4999('0x9')]=_0x30abbb[_0x4999('0x9')]||'no';this[_0x4999('0xa')]=_0x30abbb[_0x4999('0xa')]||0x1388;this['tech']=_0x30abbb[_0x4999('0xb')]||'SIP';this[_0x4999('0xc')]=_0x30abbb[_0x4999('0xc')]?_0x30abbb['Trunk']:undefined;this[_0x4999('0xd')]=_0x30abbb[_0x4999('0xd')];this[_0x4999('0xe')]=_0x30abbb[_0x4999('0xe')];}module[_0x4999('0xf')]=FaxAccount; \ No newline at end of file +var _0x80e5=['localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x43aa1e,_0x4b3ca6){var _0x159353=function(_0x225c7f){while(--_0x225c7f){_0x43aa1e['push'](_0x43aa1e['shift']());}};_0x159353(++_0x4b3ca6);}(_0x80e5,0xb7));var _0x580e=function(_0x35825e,_0x657421){_0x35825e=_0x35825e-0x0;var _0x4f4d90=_0x80e5[_0x35825e];return _0x4f4d90;};'use strict';function FaxAccount(_0xf85d2a){this['id']=_0xf85d2a['id']||0x0;this[_0x580e('0x0')]=_0xf85d2a['name']||'';this['description']=_0xf85d2a[_0x580e('0x1')];this[_0x580e('0x2')]=_0xf85d2a[_0x580e('0x2')];this[_0x580e('0x3')]=_0xf85d2a[_0x580e('0x3')];this[_0x580e('0x4')]=_0xf85d2a[_0x580e('0x4')];this[_0x580e('0x5')]=_0xf85d2a[_0x580e('0x5')]||0x960;this[_0x580e('0x6')]=_0xf85d2a[_0x580e('0x6')]||0x3840;this[_0x580e('0x7')]=_0xf85d2a[_0x580e('0x7')]||'v17,v27,v29';this[_0x580e('0x8')]=_0xf85d2a['gateway']||'no';this[_0x580e('0x9')]=_0xf85d2a['faxdetect']||'no';this['t38timeout']=_0xf85d2a[_0x580e('0xa')]||0x1388;this[_0x580e('0xb')]=_0xf85d2a[_0x580e('0xb')]||_0x580e('0xc');this[_0x580e('0xd')]=_0xf85d2a[_0x580e('0xd')]?_0xf85d2a[_0x580e('0xd')]:undefined;this[_0x580e('0xe')]=_0xf85d2a[_0x580e('0xe')];this[_0x580e('0xf')]=_0xf85d2a[_0x580e('0xf')];}module[_0x580e('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 0b8d32e..6cc5f3c 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 _0xe170=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3ce977,_0x192fd2){var _0x309ff4=function(_0x333819){while(--_0x333819){_0x3ce977['push'](_0x3ce977['shift']());}};_0x309ff4(++_0x192fd2);}(_0xe170,0x12d));var _0x0e17=function(_0x3b2605,_0xd7bdfc){_0x3b2605=_0x3b2605-0x0;var _0x2c503c=_0xe170[_0x3b2605];return _0x2c503c;};'use strict';function FreshdeskAccount(_0x96cddf){this['id']=_0x96cddf['id']||0x0;this[_0x0e17('0x0')]=_0x96cddf[_0x0e17('0x0')]||'';this[_0x0e17('0x1')]=_0x96cddf[_0x0e17('0x1')]||'';this[_0x0e17('0x2')]=_0x96cddf[_0x0e17('0x3')]||'';this[_0x0e17('0x4')]=_0x96cddf[_0x0e17('0x4')]||'';this[_0x0e17('0x5')]=_0x96cddf[_0x0e17('0x5')]||'';this[_0x0e17('0x6')]=_0x96cddf[_0x0e17('0x6')]||{};}module[_0x0e17('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x2966=['remoteUri','serverUrl','Configurations','name','username','token'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x2966,0x1a1));var _0x6296=function(_0x487d61,_0x4d9bda){_0x487d61=_0x487d61-0x0;var _0x13fdab=_0x2966[_0x487d61];return _0x13fdab;};'use strict';function FreshdeskAccount(_0x38112e){this['id']=_0x38112e['id']||0x0;this['name']=_0x38112e[_0x6296('0x0')]||'';this[_0x6296('0x1')]=_0x38112e[_0x6296('0x1')]||'';this['apiKey']=_0x38112e[_0x6296('0x2')]||'';this[_0x6296('0x3')]=_0x38112e['remoteUri']||'';this[_0x6296('0x4')]=_0x38112e['serverUrl']||'';this[_0x6296('0x5')]=_0x38112e[_0x6296('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index d723797..8570f2c 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9822=['serverUrl','Configurations','exports','name','token','remoteUri'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x9822,0x93));var _0x2982=function(_0x210bed,_0x108423){_0x210bed=_0x210bed-0x0;var _0x262c09=_0x9822[_0x210bed];return _0x262c09;};'use strict';function FreshsalesAccount(_0x56b0c4){this['id']=_0x56b0c4['id']||0x0;this[_0x2982('0x0')]=_0x56b0c4[_0x2982('0x0')]||'';this['username']=_0x56b0c4['username']||'';this['apiKey']=_0x56b0c4[_0x2982('0x1')]||'';this[_0x2982('0x2')]=_0x56b0c4[_0x2982('0x2')]||'';this[_0x2982('0x3')]=_0x56b0c4[_0x2982('0x3')]||'';this['Configurations']=_0x56b0c4[_0x2982('0x4')]||{};}module[_0x2982('0x5')]=FreshsalesAccount; \ No newline at end of file +var _0x84b1=['Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x44992a,_0x1bf5b5){var _0x14b7bf=function(_0x52b52a){while(--_0x52b52a){_0x44992a['push'](_0x44992a['shift']());}};_0x14b7bf(++_0x1bf5b5);}(_0x84b1,0x122));var _0x184b=function(_0x2afe3d,_0x1468db){_0x2afe3d=_0x2afe3d-0x0;var _0x3a751e=_0x84b1[_0x2afe3d];return _0x3a751e;};'use strict';function FreshsalesAccount(_0x1046d5){this['id']=_0x1046d5['id']||0x0;this[_0x184b('0x0')]=_0x1046d5[_0x184b('0x0')]||'';this['username']=_0x1046d5[_0x184b('0x1')]||'';this[_0x184b('0x2')]=_0x1046d5['token']||'';this[_0x184b('0x3')]=_0x1046d5[_0x184b('0x3')]||'';this['serverUrl']=_0x1046d5['serverUrl']||'';this['Configurations']=_0x1046d5[_0x184b('0x4')]||{};}module[_0x184b('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index fee83e4..463e676 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 _0xc970=['calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinename','accountcode','context','exten','priority','lastAssignedTo','mohtime','exports','type','uniqueid'];(function(_0x4db643,_0x41843f){var _0x5e2e2b=function(_0x245ab7){while(--_0x245ab7){_0x4db643['push'](_0x4db643['shift']());}};_0x5e2e2b(++_0x41843f);}(_0xc970,0x112));var _0x0c97=function(_0x1f67a4,_0x4cccfa){_0x1f67a4=_0x1f67a4-0x0;var _0x3e431d=_0xc970[_0x1f67a4];return _0x3e431d;};'use strict';function QueueReport(){this[_0x0c97('0x0')]='inbound';this[_0x0c97('0x1')]='';this[_0x0c97('0x2')]='';this[_0x0c97('0x3')]='';this['queue']='';this[_0x0c97('0x4')]=null;this[_0x0c97('0x5')]=null;this[_0x0c97('0x6')]=0x1;this[_0x0c97('0x7')]=0x1;this[_0x0c97('0x8')]=![];this[_0x0c97('0x9')]=null;this[_0x0c97('0xa')]=![];this[_0x0c97('0xb')]=null;this[_0x0c97('0xc')]=![];this['queuecallerexitAt']=null;this[_0x0c97('0xd')]=0x1;this[_0x0c97('0xe')]='';this['connectedlinenum']='';this[_0x0c97('0xf')]='';this[_0x0c97('0x10')]='';this[_0x0c97('0x11')]='';this[_0x0c97('0x12')]='';this[_0x0c97('0x13')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x0c97('0x14')]='';this[_0x0c97('0x15')]=0x0;this['variables']={};}module[_0x0c97('0x16')]=QueueReport; \ No newline at end of file +var _0x0c88=['queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','holdtime','lastAssignedTo','variables','type','uniqueid','calleridnum','calleridname','queue'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x0c88,0x1b4));var _0x80c8=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0x0c88[_0x210d7f];return _0x42d687;};'use strict';function QueueReport(){this[_0x80c8('0x0')]='inbound';this[_0x80c8('0x1')]='';this[_0x80c8('0x2')]='';this[_0x80c8('0x3')]='';this[_0x80c8('0x4')]='';this[_0x80c8('0x5')]=null;this[_0x80c8('0x6')]=null;this[_0x80c8('0x7')]=0x1;this[_0x80c8('0x8')]=0x1;this[_0x80c8('0x9')]=![];this['queuecallerabandonAt']=null;this[_0x80c8('0xa')]=![];this[_0x80c8('0xb')]=null;this['queuecallerexit']=![];this[_0x80c8('0xc')]=null;this[_0x80c8('0xd')]=0x1;this[_0x80c8('0xe')]='';this[_0x80c8('0xf')]='';this[_0x80c8('0x10')]='';this['accountcode']='';this[_0x80c8('0x11')]='';this['exten']='';this['priority']='';this[_0x80c8('0x12')]=0x0;this['assigned']=![];this[_0x80c8('0x13')]='';this['mohtime']=0x0;this[_0x80c8('0x14')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index f8312f2..d411c4d 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 _0x9e80=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x275508,_0x19d6f0){var _0x2c1255=function(_0x4a1fbe){while(--_0x4a1fbe){_0x275508['push'](_0x275508['shift']());}};_0x2c1255(++_0x19d6f0);}(_0x9e80,0xfc));var _0x09e8=function(_0x4eee5e,_0x199407){_0x4eee5e=_0x4eee5e-0x0;var _0x1537ee=_0x9e80[_0x4eee5e];return _0x1537ee;};'use strict';function SalesforceAccount(_0x366ee2){this['id']=_0x366ee2['id']||0x0;this[_0x09e8('0x0')]=_0x366ee2[_0x09e8('0x0')]||'';this[_0x09e8('0x1')]=_0x366ee2[_0x09e8('0x1')]||'';this[_0x09e8('0x2')]=_0x366ee2[_0x09e8('0x2')]||'';this[_0x09e8('0x3')]=_0x366ee2[_0x09e8('0x3')]||'';this[_0x09e8('0x4')]=_0x366ee2[_0x09e8('0x4')]||'';this[_0x09e8('0x5')]=_0x366ee2[_0x09e8('0x5')]||'';this[_0x09e8('0x6')]=_0x366ee2[_0x09e8('0x6')]||'';this[_0x09e8('0x7')]=_0x366ee2[_0x09e8('0x7')]||_0x09e8('0x8');this['serverUrl']=_0x366ee2[_0x09e8('0x9')]||'';this[_0x09e8('0xa')]=_0x366ee2[_0x09e8('0xa')]||{};}module[_0x09e8('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x5a19=['exports','name','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x5b0779,_0x40d92a){var _0x2d8671=function(_0x5cd62d){while(--_0x5cd62d){_0x5b0779['push'](_0x5b0779['shift']());}};_0x2d8671(++_0x40d92a);}(_0x5a19,0x7a));var _0x95a1=function(_0xaedc8f,_0x2487db){_0xaedc8f=_0xaedc8f-0x0;var _0x2e1d6f=_0x5a19[_0xaedc8f];return _0x2e1d6f;};'use strict';function SalesforceAccount(_0x48bd4b){this['id']=_0x48bd4b['id']||0x0;this[_0x95a1('0x0')]=_0x48bd4b[_0x95a1('0x0')]||'';this['username']=_0x48bd4b['username']||'';this['remoteUri']=_0x48bd4b[_0x95a1('0x1')]||'';this['password']=_0x48bd4b[_0x95a1('0x2')]||'';this[_0x95a1('0x3')]=_0x48bd4b[_0x95a1('0x3')]||'';this[_0x95a1('0x4')]=_0x48bd4b[_0x95a1('0x4')]||'';this[_0x95a1('0x5')]=_0x48bd4b[_0x95a1('0x5')]||'';this[_0x95a1('0x6')]=_0x48bd4b['type']||_0x95a1('0x7');this[_0x95a1('0x8')]=_0x48bd4b[_0x95a1('0x8')]||'';this[_0x95a1('0x9')]=_0x48bd4b[_0x95a1('0x9')]||{};}module[_0x95a1('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 29aa047..94c63d3 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 _0x6600=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x6600,0xd6));var _0x0660=function(_0x2bf073,_0x39265c){_0x2bf073=_0x2bf073-0x0;var _0x26828d=_0x6600[_0x2bf073];return _0x26828d;};'use strict';function ServicenowAccount(_0x37918b){this['id']=_0x37918b['id']||0x0;this[_0x0660('0x0')]=_0x37918b[_0x0660('0x0')]||'';this[_0x0660('0x1')]=_0x37918b[_0x0660('0x1')]||'';this['password']=_0x37918b['password']||'';this[_0x0660('0x2')]=_0x37918b['remoteUri']||'';this[_0x0660('0x3')]=_0x37918b[_0x0660('0x3')]||'';this[_0x0660('0x4')]=_0x37918b[_0x0660('0x4')]||{};}module[_0x0660('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x46f9=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x2c5a7c,_0x158c6b){var _0x1e7733=function(_0x52d0b9){while(--_0x52d0b9){_0x2c5a7c['push'](_0x2c5a7c['shift']());}};_0x1e7733(++_0x158c6b);}(_0x46f9,0x1ed));var _0x946f=function(_0x3e902d,_0x3c02eb){_0x3e902d=_0x3e902d-0x0;var _0x31f549=_0x46f9[_0x3e902d];return _0x31f549;};'use strict';function ServicenowAccount(_0xac2ef0){this['id']=_0xac2ef0['id']||0x0;this[_0x946f('0x0')]=_0xac2ef0[_0x946f('0x0')]||'';this[_0x946f('0x1')]=_0xac2ef0[_0x946f('0x1')]||'';this[_0x946f('0x2')]=_0xac2ef0[_0x946f('0x2')]||'';this['remoteUri']=_0xac2ef0[_0x946f('0x3')]||'';this[_0x946f('0x4')]=_0xac2ef0[_0x946f('0x4')]||'';this[_0x946f('0x5')]=_0xac2ef0['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 00228b0..668e7c1 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 _0x7a67=['remoteUri','exports','name','username','password'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0x7a67,0x14c));var _0x77a6=function(_0xf856bc,_0x444f11){_0xf856bc=_0xf856bc-0x0;var _0x420845=_0x7a67[_0xf856bc];return _0x420845;};'use strict';function SugarcrmAccount(_0x5dfec7){this['id']=_0x5dfec7['id']||0x0;this['name']=_0x5dfec7[_0x77a6('0x0')]||'';this[_0x77a6('0x1')]=_0x5dfec7[_0x77a6('0x1')]||'';this['password']=_0x5dfec7[_0x77a6('0x2')]||'';this[_0x77a6('0x3')]=_0x5dfec7['remoteUri']||'';this['serverUrl']=_0x5dfec7['serverUrl']||'';this['Configurations']=_0x5dfec7['Configurations']||{};}module[_0x77a6('0x4')]=SugarcrmAccount; \ No newline at end of file +var _0x6b0f=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0xafe637,_0x2d33e9){var _0x19e1f1=function(_0x1b0a78){while(--_0x1b0a78){_0xafe637['push'](_0xafe637['shift']());}};_0x19e1f1(++_0x2d33e9);}(_0x6b0f,0x1a5));var _0xf6b0=function(_0x111ae7,_0x413b3f){_0x111ae7=_0x111ae7-0x0;var _0x2cfaf5=_0x6b0f[_0x111ae7];return _0x2cfaf5;};'use strict';function SugarcrmAccount(_0x3a7f27){this['id']=_0x3a7f27['id']||0x0;this[_0xf6b0('0x0')]=_0x3a7f27['name']||'';this['username']=_0x3a7f27[_0xf6b0('0x1')]||'';this[_0xf6b0('0x2')]=_0x3a7f27['password']||'';this[_0xf6b0('0x3')]=_0x3a7f27[_0xf6b0('0x3')]||'';this['serverUrl']=_0x3a7f27[_0xf6b0('0x4')]||'';this['Configurations']=_0x3a7f27[_0xf6b0('0x5')]||{};}module[_0xf6b0('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 28a94c6..fb31c9f 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 _0xcdc6=['state','unknown','stateTime','address','exports','name','accountcode'];(function(_0x47ffa4,_0x30304e){var _0x237f76=function(_0x2f4391){while(--_0x2f4391){_0x47ffa4['push'](_0x47ffa4['shift']());}};_0x237f76(++_0x30304e);}(_0xcdc6,0x19b));var _0x6cdc=function(_0x31535f,_0x5bb4fc){_0x31535f=_0x31535f-0x0;var _0x1b823c=_0xcdc6[_0x31535f];return _0x1b823c;};'use strict';function Telephone(_0x323c6b){this['id']=_0x323c6b['id']||0x0;this[_0x6cdc('0x0')]=_0x323c6b[_0x6cdc('0x0')]||'';this[_0x6cdc('0x1')]=_0x323c6b['accountcode']||'';this[_0x6cdc('0x2')]=_0x6cdc('0x3');this[_0x6cdc('0x4')]=0x0;this['status']=_0x6cdc('0x3');this[_0x6cdc('0x5')]='';}module[_0x6cdc('0x6')]=Telephone; \ No newline at end of file +var _0x1518=['address','exports','name','accountcode','state','stateTime','unknown'];(function(_0x4e244e,_0x19f805){var _0x545332=function(_0x3f50de){while(--_0x3f50de){_0x4e244e['push'](_0x4e244e['shift']());}};_0x545332(++_0x19f805);}(_0x1518,0x159));var _0x8151=function(_0x39f21a,_0x312fd0){_0x39f21a=_0x39f21a-0x0;var _0x515125=_0x1518[_0x39f21a];return _0x515125;};'use strict';function Telephone(_0x502362){this['id']=_0x502362['id']||0x0;this[_0x8151('0x0')]=_0x502362[_0x8151('0x0')]||'';this[_0x8151('0x1')]=_0x502362['accountcode']||'';this[_0x8151('0x2')]='unknown';this[_0x8151('0x3')]=0x0;this['status']=_0x8151('0x4');this[_0x8151('0x5')]='';}module[_0x8151('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 1c4d4e4..07ff045 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 _0xb4e6=['name','html','exports'];(function(_0x391870,_0x2392dc){var _0x5bc308=function(_0x5dc211){while(--_0x5dc211){_0x391870['push'](_0x391870['shift']());}};_0x5bc308(++_0x2392dc);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0xb4e6[_0x5235dd];return _0x13059d;};'use strict';function template(_0x4baa04){this['id']=_0x4baa04['id']||0x0;this[_0x6b4e('0x0')]=_0x4baa04[_0x6b4e('0x0')]||'';this[_0x6b4e('0x1')]=_0x4baa04[_0x6b4e('0x1')]||'';}module[_0x6b4e('0x2')]=template; \ No newline at end of file +var _0x0bcd=['name','html'];(function(_0xafceaf,_0x5c65ad){var _0x3684e4=function(_0x1aaf86){while(--_0x1aaf86){_0xafceaf['push'](_0xafceaf['shift']());}};_0x3684e4(++_0x5c65ad);}(_0x0bcd,0xb2));var _0xd0bc=function(_0x39e4b1,_0x13a82a){_0x39e4b1=_0x39e4b1-0x0;var _0x43b765=_0x0bcd[_0x39e4b1];return _0x43b765;};'use strict';function template(_0x1e3c7e){this['id']=_0x1e3c7e['id']||0x0;this[_0xd0bc('0x0')]=_0x1e3c7e[_0xd0bc('0x0')]||'';this[_0xd0bc('0x1')]=_0x1e3c7e['html']||'';}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 e6ac7d7..d20682c 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 _0x9c44=['voice','status','AnyConditions','Actions','exports','name','channel'];(function(_0x9eb184,_0x37ee84){var _0x120d47=function(_0x546d55){while(--_0x546d55){_0x9eb184['push'](_0x9eb184['shift']());}};_0x120d47(++_0x37ee84);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';function Trigger(_0x2fa01d){this['id']=_0x2fa01d['id']||0x0;this['name']=_0x2fa01d[_0x49c4('0x0')]||'';this[_0x49c4('0x1')]=_0x2fa01d[_0x49c4('0x1')]||_0x49c4('0x2');this[_0x49c4('0x3')]=_0x2fa01d[_0x49c4('0x3')]||![];this['AllConditions']=_0x2fa01d['AllConditions']||[];this[_0x49c4('0x4')]=_0x2fa01d['AnyConditions']||[];this[_0x49c4('0x5')]=_0x2fa01d[_0x49c4('0x5')]||[];}module[_0x49c4('0x6')]=Trigger; \ No newline at end of file +var _0x9957=['AnyConditions','Actions','exports','name','channel','voice','status','AllConditions'];(function(_0x6d97b2,_0x3c1332){var _0x514465=function(_0x13c3ce){while(--_0x13c3ce){_0x6d97b2['push'](_0x6d97b2['shift']());}};_0x514465(++_0x3c1332);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';function Trigger(_0x202794){this['id']=_0x202794['id']||0x0;this[_0x7995('0x0')]=_0x202794[_0x7995('0x0')]||'';this[_0x7995('0x1')]=_0x202794['channel']||_0x7995('0x2');this[_0x7995('0x3')]=_0x202794[_0x7995('0x3')]||![];this[_0x7995('0x4')]=_0x202794['AllConditions']||[];this[_0x7995('0x5')]=_0x202794[_0x7995('0x5')]||[];this[_0x7995('0x6')]=_0x202794[_0x7995('0x6')]||[];}module[_0x7995('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index b4453d8..cddb341 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 _0x8ce7=['registry','indexOf','host','port','domain','domainport','registrationtime','address','exports','active','name','state','unknown'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x8ce7,0x98));var _0x78ce=function(_0x129987,_0x1ba53a){_0x129987=_0x129987-0x0;var _0x310b57=_0x8ce7[_0x129987];return _0x310b57;};'use strict';function Trunk(_0x5de2d7){this['id']=_0x5de2d7['id']||0x0;this[_0x78ce('0x0')]=_0x5de2d7['active']||![];this[_0x78ce('0x1')]=_0x5de2d7['name']||'';this[_0x78ce('0x2')]=_0x78ce('0x3');this['stateTime']=0x0;this['status']=_0x78ce('0x3');this[_0x78ce('0x4')]=_0x5de2d7[_0x78ce('0x4')]&&_0x5de2d7[_0x78ce('0x4')][_0x78ce('0x5')](':')?_0x5de2d7[_0x78ce('0x4')]['split'](':')[0x0]:'';this[_0x78ce('0x6')]='';this[_0x78ce('0x7')]='';this[_0x78ce('0x8')]='';this[_0x78ce('0x9')]='';this['refresh']='';this['stateRegistry']=_0x78ce('0x3');this[_0x78ce('0xa')]='';this[_0x78ce('0xb')]='';}module[_0x78ce('0xc')]=Trunk; \ No newline at end of file +var _0xc4db=['stateRegistry','registrationtime','address','active','name','state','unknown','status','registry','split','host','port','domainport','refresh'];(function(_0x3e73af,_0x19dbea){var _0x389e19=function(_0x1606ee){while(--_0x1606ee){_0x3e73af['push'](_0x3e73af['shift']());}};_0x389e19(++_0x19dbea);}(_0xc4db,0xb9));var _0xbc4d=function(_0x2e5ea9,_0x4d280a){_0x2e5ea9=_0x2e5ea9-0x0;var _0x228844=_0xc4db[_0x2e5ea9];return _0x228844;};'use strict';function Trunk(_0x3a39b5){this['id']=_0x3a39b5['id']||0x0;this[_0xbc4d('0x0')]=_0x3a39b5[_0xbc4d('0x0')]||![];this[_0xbc4d('0x1')]=_0x3a39b5[_0xbc4d('0x1')]||'';this[_0xbc4d('0x2')]=_0xbc4d('0x3');this['stateTime']=0x0;this[_0xbc4d('0x4')]=_0xbc4d('0x3');this[_0xbc4d('0x5')]=_0x3a39b5[_0xbc4d('0x5')]&&_0x3a39b5[_0xbc4d('0x5')]['indexOf'](':')?_0x3a39b5[_0xbc4d('0x5')][_0xbc4d('0x6')](':')[0x0]:'';this[_0xbc4d('0x7')]='';this[_0xbc4d('0x8')]='';this['domain']='';this[_0xbc4d('0x9')]='';this[_0xbc4d('0xa')]='';this[_0xbc4d('0xb')]=_0xbc4d('0x3');this[_0xbc4d('0xc')]='';this[_0xbc4d('0xd')]='';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index e20c549..ff05fc3 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 _0x33a8=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x548fb1,_0x133174){var _0x33418b=function(_0x5c689c){while(--_0x5c689c){_0x548fb1['push'](_0x548fb1['shift']());}};_0x33418b(++_0x133174);}(_0x33a8,0x6c));var _0x833a=function(_0x50da7b,_0x197037){_0x50da7b=_0x50da7b-0x0;var _0x431d05=_0x33a8[_0x50da7b];return _0x431d05;};'use strict';function voiceExtension(_0x406469){this['id']=_0x406469['id']||0x0;this[_0x833a('0x0')]=_0x406469[_0x833a('0x0')]||'';this[_0x833a('0x1')]=_0x406469[_0x833a('0x1')]||_0x833a('0x2');this[_0x833a('0x3')]=_0x406469[_0x833a('0x3')]||![];}module[_0x833a('0x4')]=voiceExtension; \ No newline at end of file +var _0x3253=['recordingFormat','none','exten'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x3253,0x107));var _0x3325=function(_0xa1e3ca,_0x559022){_0xa1e3ca=_0xa1e3ca-0x0;var _0x5005ab=_0x3253[_0xa1e3ca];return _0x5005ab;};'use strict';function voiceExtension(_0xd50e7b){this['id']=_0xd50e7b['id']||0x0;this[_0x3325('0x0')]=_0xd50e7b['exten']||'';this[_0x3325('0x1')]=_0xd50e7b['recordingFormat']||_0x3325('0x2');this['mandatoryDisposition']=_0xd50e7b['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 2413a49..f60f786 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 _0xd815=['type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','name','monitor_format'];(function(_0xa2e1c5,_0x114f7a){var _0x3a45c2=function(_0x34faba){while(--_0x34faba){_0xa2e1c5['push'](_0xa2e1c5['shift']());}};_0x3a45c2(++_0x114f7a);}(_0xd815,0x1c3));var _0x5d81=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd815[_0x321bb2];return _0x9c12ed;};'use strict';var statusDesc=[_0x5d81('0x0'),_0x5d81('0x1'),_0x5d81('0x2'),_0x5d81('0x3'),'invalid',_0x5d81('0x4'),_0x5d81('0x5'),_0x5d81('0x6'),'onhold'];var monitorFormat={'wav':_0x5d81('0x7'),'wav49':_0x5d81('0x8'),'gsm':_0x5d81('0x9')};var strategy={'rrmemory':_0x5d81('0xa'),'roundrobin':'roundrobin'};function VoiceQueue(_0x5bdbf4){this['id']=_0x5bdbf4['id']||0x0;this[_0x5d81('0xb')]=_0x5bdbf4['name']||'';this[_0x5d81('0xc')]=_0x5bdbf4[_0x5d81('0xc')]||'';this['type']=_0x5bdbf4[_0x5d81('0xd')]||_0x5d81('0xe');this[_0x5d81('0xf')]=0x0;this[_0x5d81('0x10')]=0x0;this[_0x5d81('0x11')]=0x0;this[_0x5d81('0x12')]=0x0;this[_0x5d81('0x13')]=0x0;this[_0x5d81('0x14')]=0x0;this[_0x5d81('0x15')]=0x0;this[_0x5d81('0x16')]=0x0;this[_0x5d81('0x17')]=0x0;this[_0x5d81('0x18')]=0x0;this['available']=0x0;this[_0x5d81('0x19')]=_0x5bdbf4['acw']||![];this[_0x5d81('0x1a')]=_0x5bdbf4[_0x5d81('0x1a')]||0xa;this[_0x5d81('0x1b')]=_0x5bdbf4[_0x5d81('0x1b')]||'no';this[_0x5d81('0x1c')]=!![];this[_0x5d81('0x1d')]='';this[_0x5d81('0x1e')]=0x0;this[_0x5d81('0x1f')]=0x0;this[_0x5d81('0x20')]=_0x5bdbf4[_0x5d81('0x20')]||null;this[_0x5d81('0x21')]=_0x5bdbf4['dialGlobalInterval']?_0x5bdbf4[_0x5d81('0x21')]:null;this['dialActive']=_0x5bdbf4[_0x5d81('0x22')];this[_0x5d81('0x23')]=_0x5bdbf4['dialMethod']||'progressive';this['dialLimitChannel']=_0x5bdbf4['dialLimitChannel']||0x0;this[_0x5d81('0x24')]=_0x5bdbf4['dialLimitQueue']||0x0;this[_0x5d81('0x25')]=_0x5bdbf4[_0x5d81('0x25')]||0x1;this[_0x5d81('0x26')]=_0x5bdbf4[_0x5d81('0x26')]||_0x5d81('0x27');this['dialPredictiveOptimizationPercentage']=_0x5bdbf4[_0x5d81('0x28')]||0.03;this[_0x5d81('0x29')]=_0x5bdbf4[_0x5d81('0x29')]||0x258;this[_0x5d81('0x2a')]=_0x5bdbf4[_0x5d81('0x2a')]||_0x5d81('0x2b');this[_0x5d81('0x2c')]=_0x5bdbf4[_0x5d81('0x2c')]||_0x5d81('0x2b');this[_0x5d81('0x2d')]=_0x5bdbf4[_0x5d81('0x2d')]||0x1e;this[_0x5d81('0x2e')]=_0x5bdbf4[_0x5d81('0x2e')]||_0x5d81('0x2f');this['dialQueueTimeout']=_0x5bdbf4[_0x5d81('0x30')]||0x3;this[_0x5d81('0x31')]=_0x5bdbf4[_0x5d81('0x31')]||undefined;this[_0x5d81('0x32')]=_0x5bdbf4[_0x5d81('0x32')]||0x3;this['dialCongestionRetryFrequency']=_0x5bdbf4[_0x5d81('0x33')]||0x96;this[_0x5d81('0x34')]=_0x5bdbf4['dialBusyMaxRetry']||0x3;this[_0x5d81('0x35')]=_0x5bdbf4[_0x5d81('0x35')]||0x96;this[_0x5d81('0x36')]=_0x5bdbf4[_0x5d81('0x36')]||0x3;this[_0x5d81('0x37')]=_0x5bdbf4[_0x5d81('0x37')]||0x96;this[_0x5d81('0x38')]=_0x5bdbf4[_0x5d81('0x38')]||0x3;this[_0x5d81('0x39')]=_0x5bdbf4[_0x5d81('0x39')]||0x96;this[_0x5d81('0x3a')]=_0x5bdbf4[_0x5d81('0x3a')]||0x3;this['dialDropRetryFrequency']=_0x5bdbf4['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x5bdbf4[_0x5d81('0x3b')]||0x3;this['dialAbandonedRetryFrequency']=_0x5bdbf4['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x5bdbf4[_0x5d81('0x3c')]||0x3;this['dialMachineRetryFrequency']=_0x5bdbf4[_0x5d81('0x3d')]||0x96;this['dialAgentRejectMaxRetry']=_0x5bdbf4[_0x5d81('0x3e')]||0x3;this[_0x5d81('0x3f')]=_0x5bdbf4[_0x5d81('0x3f')]||0x96;this['dialGlobalMaxRetry']=_0x5bdbf4[_0x5d81('0x40')]||0x4;this[_0x5d81('0x41')]=_0x5bdbf4['Trunk']?_0x5bdbf4[_0x5d81('0x41')]:undefined;this['TrunkBackup']=_0x5bdbf4[_0x5d81('0x42')]?_0x5bdbf4['TrunkBackup']:undefined;this[_0x5d81('0x43')]=_0x5bdbf4[_0x5d81('0x43')]||undefined;this[_0x5d81('0x44')]=_0x5bdbf4[_0x5d81('0x44')]?_0x5bdbf4[_0x5d81('0x44')]:undefined;this[_0x5d81('0x45')]=_0x5bdbf4[_0x5d81('0x45')]||_0x5d81('0x46');this[_0x5d81('0x47')]=_0x5bdbf4[_0x5d81('0x47')]||undefined;this['dialCutDigit']=_0x5bdbf4[_0x5d81('0x48')]||undefined;this['strategy']=strategy[_0x5bdbf4[_0x5d81('0x49')]]||_0x5d81('0xa');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x5bdbf4[_0x5d81('0x4a')]||![];this[_0x5d81('0x4b')]=_0x5bdbf4[_0x5d81('0x4b')];this[_0x5d81('0x4c')]=_0x5bdbf4[_0x5d81('0x4c')];this[_0x5d81('0x4d')]=_0x5bdbf4[_0x5d81('0x4d')];this[_0x5d81('0x4e')]=_0x5bdbf4[_0x5d81('0x4e')];this[_0x5d81('0x4f')]=_0x5bdbf4[_0x5d81('0x4f')];this['dialAMDBetweenWordsSilence']=_0x5bdbf4['dialAMDBetweenWordsSilence'];this[_0x5d81('0x50')]=_0x5bdbf4[_0x5d81('0x50')];this['dialAMDSilenceThreshold']=_0x5bdbf4[_0x5d81('0x51')];this['dialAMDMaximumWordLength']=_0x5bdbf4[_0x5d81('0x52')];this['outboundRejectCallsDay']=0x0;this[_0x5d81('0x53')]=0x0;this[_0x5d81('0x54')]=_0x5bdbf4[_0x5d81('0x54')];this['outboundAnswerCallsDay']=0x0;this[_0x5d81('0x55')]=0x0;this[_0x5d81('0x56')]=0x0;this[_0x5d81('0x57')]=0x0;this[_0x5d81('0x58')]=0x0;this[_0x5d81('0x59')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x5d81('0x5a')]=0x0;this[_0x5d81('0x5b')]=0x0;this[_0x5d81('0x5c')]=0x0;this[_0x5d81('0x5d')]=0x0;this[_0x5d81('0x5e')]=0x0;this[_0x5d81('0x5f')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x5d81('0x60')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x5d81('0x61')]=0x0;this[_0x5d81('0x62')]=0x0;this[_0x5d81('0x63')]=0x0;this[_0x5d81('0x64')]=0x0;this[_0x5d81('0x65')]=0x0;this['predictiveIntervalMaxThreshold']=_0x5bdbf4[_0x5d81('0x66')]||0x14;this[_0x5d81('0x67')]=_0x5bdbf4[_0x5d81('0x66')]||0xa;this[_0x5d81('0x68')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x5d81('0x69')]=0x0;this[_0x5d81('0x6a')]=0x0;this[_0x5d81('0x6b')]=0x0;this[_0x5d81('0x6c')]=0x0;this['dialRecallMeTimeout']=_0x5bdbf4[_0x5d81('0x6d')]||0x1e;this['dialRecallInQueue']=_0x5bdbf4[_0x5d81('0x6e')]||![];this[_0x5d81('0x6f')]=_0x5bdbf4['dialQueueProject2']||undefined;this[_0x5d81('0x70')]=_0x5bdbf4[_0x5d81('0x70')]||![];this['dialAgiAfterHangupAgent']=_0x5bdbf4[_0x5d81('0x71')]||![];this[_0x5d81('0xc')]=monitorFormat[_0x5bdbf4[_0x5d81('0xc')]]?monitorFormat[_0x5bdbf4[_0x5d81('0xc')]]:undefined;this['mandatoryDisposition']=_0x5bdbf4[_0x5d81('0x72')]||![];this[_0x5d81('0x73')]=_0x5bdbf4[_0x5d81('0x73')]?_0x5bdbf4[_0x5d81('0x73')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0xd065=['predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','inuse','busy','invalid','ringing','ringinuse','onhold','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','unmanaged','abandoned','available','acw','acwTimeout','autopause','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd065,0x87));var _0x5d06=function(_0x4e4c7b,_0x4ff657){_0x4e4c7b=_0x4e4c7b-0x0;var _0x6816d0=_0xd065[_0x4e4c7b];return _0x6816d0;};'use strict';var statusDesc=[_0x5d06('0x0'),'not_inuse',_0x5d06('0x1'),_0x5d06('0x2'),_0x5d06('0x3'),'unavailable',_0x5d06('0x4'),_0x5d06('0x5'),_0x5d06('0x6')];var monitorFormat={'wav':'wav','wav49':_0x5d06('0x7'),'gsm':_0x5d06('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x5d06('0x9')};function VoiceQueue(_0x56baf2){this['id']=_0x56baf2['id']||0x0;this[_0x5d06('0xa')]=_0x56baf2[_0x5d06('0xa')]||'';this['monitor_format']=_0x56baf2[_0x5d06('0xb')]||'';this[_0x5d06('0xc')]=_0x56baf2[_0x5d06('0xc')]||_0x5d06('0xd');this[_0x5d06('0xe')]=0x0;this[_0x5d06('0xf')]=0x0;this[_0x5d06('0x10')]=0x0;this[_0x5d06('0x11')]=0x0;this[_0x5d06('0x12')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x5d06('0x13')]=0x0;this[_0x5d06('0x14')]=0x0;this['loggedIn']=0x0;this[_0x5d06('0x15')]=0x0;this[_0x5d06('0x16')]=_0x56baf2[_0x5d06('0x16')]||![];this[_0x5d06('0x17')]=_0x56baf2[_0x5d06('0x17')]||0xa;this['autopause']=_0x56baf2[_0x5d06('0x18')]||'no';this['sendMessageOneNotActive']=!![];this[_0x5d06('0x19')]='';this['originated']=0x0;this[_0x5d06('0x1a')]=0x0;this[_0x5d06('0x1b')]=_0x56baf2[_0x5d06('0x1b')]||null;this[_0x5d06('0x1c')]=_0x56baf2[_0x5d06('0x1c')]?_0x56baf2[_0x5d06('0x1c')]:null;this[_0x5d06('0x1d')]=_0x56baf2['dialActive'];this[_0x5d06('0x1e')]=_0x56baf2['dialMethod']||'progressive';this[_0x5d06('0x1f')]=_0x56baf2[_0x5d06('0x1f')]||0x0;this['dialLimitQueue']=_0x56baf2[_0x5d06('0x20')]||0x0;this[_0x5d06('0x21')]=_0x56baf2[_0x5d06('0x21')]||0x1;this[_0x5d06('0x22')]=_0x56baf2[_0x5d06('0x22')]||_0x5d06('0x23');this[_0x5d06('0x24')]=_0x56baf2[_0x5d06('0x24')]||0.03;this['dialPredictiveInterval']=_0x56baf2[_0x5d06('0x25')]||0x258;this[_0x5d06('0x26')]=_0x56baf2[_0x5d06('0x26')]||_0x5d06('0x27');this[_0x5d06('0x28')]=_0x56baf2[_0x5d06('0x28')]||'anonymous';this['dialOriginateTimeout']=_0x56baf2['dialOriginateTimeout']||0x1e;this[_0x5d06('0x29')]=_0x56baf2[_0x5d06('0x29')]||_0x5d06('0x2a');this[_0x5d06('0x2b')]=_0x56baf2[_0x5d06('0x2b')]||0x3;this[_0x5d06('0x2c')]=_0x56baf2[_0x5d06('0x2c')]||undefined;this[_0x5d06('0x2d')]=_0x56baf2['dialCongestionMaxRetry']||0x3;this[_0x5d06('0x2e')]=_0x56baf2[_0x5d06('0x2e')]||0x96;this[_0x5d06('0x2f')]=_0x56baf2[_0x5d06('0x2f')]||0x3;this[_0x5d06('0x30')]=_0x56baf2[_0x5d06('0x30')]||0x96;this[_0x5d06('0x31')]=_0x56baf2[_0x5d06('0x31')]||0x3;this[_0x5d06('0x32')]=_0x56baf2[_0x5d06('0x32')]||0x96;this[_0x5d06('0x33')]=_0x56baf2[_0x5d06('0x33')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x56baf2[_0x5d06('0x34')]||0x96;this[_0x5d06('0x35')]=_0x56baf2[_0x5d06('0x35')]||0x3;this[_0x5d06('0x36')]=_0x56baf2['dialDropRetryFrequency']||0x96;this[_0x5d06('0x37')]=_0x56baf2['dialAbandonedMaxRetry']||0x3;this[_0x5d06('0x38')]=_0x56baf2['dialAbandonedRetryFrequency']||0x96;this[_0x5d06('0x39')]=_0x56baf2[_0x5d06('0x39')]||0x3;this['dialMachineRetryFrequency']=_0x56baf2['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x56baf2[_0x5d06('0x3a')]||0x3;this[_0x5d06('0x3b')]=_0x56baf2[_0x5d06('0x3b')]||0x96;this[_0x5d06('0x3c')]=_0x56baf2[_0x5d06('0x3c')]||0x4;this['Trunk']=_0x56baf2[_0x5d06('0x3d')]?_0x56baf2[_0x5d06('0x3d')]:undefined;this[_0x5d06('0x3e')]=_0x56baf2['TrunkBackup']?_0x56baf2['TrunkBackup']:undefined;this[_0x5d06('0x3f')]=_0x56baf2[_0x5d06('0x3f')]||undefined;this[_0x5d06('0x40')]=_0x56baf2[_0x5d06('0x40')]?_0x56baf2[_0x5d06('0x40')]:undefined;this[_0x5d06('0x41')]=_0x56baf2[_0x5d06('0x41')]||_0x5d06('0x42');this[_0x5d06('0x43')]=_0x56baf2[_0x5d06('0x43')]||undefined;this[_0x5d06('0x44')]=_0x56baf2[_0x5d06('0x44')]||undefined;this[_0x5d06('0x45')]=strategy[_0x56baf2[_0x5d06('0x45')]]||_0x5d06('0x46');this[_0x5d06('0x47')]=!![];this['dialAMDActive']=_0x56baf2[_0x5d06('0x48')]||![];this[_0x5d06('0x49')]=_0x56baf2[_0x5d06('0x49')];this['dialAMDGreeting']=_0x56baf2[_0x5d06('0x4a')];this[_0x5d06('0x4b')]=_0x56baf2[_0x5d06('0x4b')];this[_0x5d06('0x4c')]=_0x56baf2['dialAMDTotalAnalysisTime'];this[_0x5d06('0x4d')]=_0x56baf2[_0x5d06('0x4d')];this[_0x5d06('0x4e')]=_0x56baf2[_0x5d06('0x4e')];this[_0x5d06('0x4f')]=_0x56baf2['dialAMDMaximumNumberOfWords'];this[_0x5d06('0x50')]=_0x56baf2[_0x5d06('0x50')];this[_0x5d06('0x51')]=_0x56baf2[_0x5d06('0x51')];this[_0x5d06('0x52')]=0x0;this['pTalking']=0x0;this[_0x5d06('0x53')]=_0x56baf2[_0x5d06('0x53')];this[_0x5d06('0x54')]=0x0;this[_0x5d06('0x55')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x5d06('0x56')]=0x0;this[_0x5d06('0x57')]=0x0;this[_0x5d06('0x58')]=0x0;this[_0x5d06('0x59')]=0x0;this[_0x5d06('0x5a')]=0x0;this[_0x5d06('0x5b')]=0x0;this[_0x5d06('0x5c')]=0x0;this[_0x5d06('0x5d')]=0x0;this[_0x5d06('0x5e')]=0x0;this['outboundReCallsDay']=0x0;this[_0x5d06('0x5f')]=0x0;this[_0x5d06('0x60')]=undefined;this[_0x5d06('0x61')]=undefined;this[_0x5d06('0x62')]=undefined;this[_0x5d06('0x63')]=1.05;this[_0x5d06('0x64')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x5d06('0x65')]=0x0;this[_0x5d06('0x66')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x5d06('0x67')]=0x0;this[_0x5d06('0x68')]=_0x56baf2['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x5d06('0x69')]=_0x56baf2[_0x5d06('0x6a')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x5d06('0x6b')]=0x1;this[_0x5d06('0x6c')]=0x0;this[_0x5d06('0x6d')]=0x0;this[_0x5d06('0x6e')]=0x0;this[_0x5d06('0x6f')]=0x0;this[_0x5d06('0x70')]=_0x56baf2['dialRecallMeTimeout']||0x1e;this[_0x5d06('0x71')]=_0x56baf2[_0x5d06('0x71')]||![];this[_0x5d06('0x72')]=_0x56baf2[_0x5d06('0x72')]||undefined;this[_0x5d06('0x73')]=_0x56baf2[_0x5d06('0x73')]||![];this[_0x5d06('0x74')]=_0x56baf2[_0x5d06('0x74')]||![];this[_0x5d06('0xb')]=monitorFormat[_0x56baf2[_0x5d06('0xb')]]?monitorFormat[_0x56baf2[_0x5d06('0xb')]]:undefined;this[_0x5d06('0x75')]=_0x56baf2['mandatoryDisposition']||![];this[_0x5d06('0x76')]=_0x56baf2['mandatoryDispositionPause']?_0x56baf2[_0x5d06('0x76')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 5aeb84e..8eb162a 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 _0x7f35=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x2c9e9d,_0x177f80){var _0x2b0c67=function(_0x4f2e28){while(--_0x4f2e28){_0x2c9e9d['push'](_0x2c9e9d['shift']());}};_0x2b0c67(++_0x177f80);}(_0x7f35,0x17c));var _0x57f3=function(_0x4c3e1a,_0x9928c4){_0x4c3e1a=_0x4c3e1a-0x0;var _0x238f2a=_0x7f35[_0x4c3e1a];return _0x238f2a;};'use strict';function VtigerAccount(_0x4a77d4){this['id']=_0x4a77d4['id']||0x0;this['name']=_0x4a77d4[_0x57f3('0x0')]||'';this[_0x57f3('0x1')]=_0x4a77d4[_0x57f3('0x1')]||'';this[_0x57f3('0x2')]=_0x4a77d4[_0x57f3('0x2')]||'';this[_0x57f3('0x3')]=_0x4a77d4['remoteUri']||'';this[_0x57f3('0x4')]=_0x4a77d4['serverUrl']||'';this[_0x57f3('0x5')]=_0x4a77d4[_0x57f3('0x5')]||{};}module[_0x57f3('0x6')]=VtigerAccount; \ No newline at end of file +var _0xecfb=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x5120d7,_0x4b1363){var _0x228399=function(_0x3a263e){while(--_0x3a263e){_0x5120d7['push'](_0x5120d7['shift']());}};_0x228399(++_0x4b1363);}(_0xecfb,0x1d2));var _0xbecf=function(_0x3ead18,_0x119a26){_0x3ead18=_0x3ead18-0x0;var _0x5a67da=_0xecfb[_0x3ead18];return _0x5a67da;};'use strict';function VtigerAccount(_0x43e69c){this['id']=_0x43e69c['id']||0x0;this[_0xbecf('0x0')]=_0x43e69c['name']||'';this['username']=_0x43e69c[_0xbecf('0x1')]||'';this[_0xbecf('0x2')]=_0x43e69c[_0xbecf('0x2')]||'';this['remoteUri']=_0x43e69c[_0xbecf('0x3')]||'';this[_0xbecf('0x4')]=_0x43e69c[_0xbecf('0x4')]||'';this[_0xbecf('0x5')]=_0x43e69c[_0xbecf('0x5')]||{};}module[_0xbecf('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 aa5ad70..3cd8814 100644 --- a/server/services/ami/model/zendeskAccount.js +++ b/server/services/ami/model/zendeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['serverUrl','Configurations','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0x7a54,0x106));var _0x47a5=function(_0x48b745,_0x15b844){_0x48b745=_0x48b745-0x0;var _0x3c13c7=_0x7a54[_0x48b745];return _0x3c13c7;};'use strict';function ZendeskAccount(_0xe384a5){this['id']=_0xe384a5['id']||0x0;this[_0x47a5('0x0')]=_0xe384a5[_0x47a5('0x0')]||'';this['username']=_0xe384a5[_0x47a5('0x1')]||'';this[_0x47a5('0x2')]=_0xe384a5['password']||'';this[_0x47a5('0x3')]=_0xe384a5[_0x47a5('0x3')]||'';this[_0x47a5('0x4')]=_0xe384a5[_0x47a5('0x4')]||'';this[_0x47a5('0x5')]=_0xe384a5['authType']||'';this[_0x47a5('0x6')]=_0xe384a5['type']||_0x47a5('0x7');this[_0x47a5('0x8')]=_0xe384a5['serverUrl']||'';this[_0x47a5('0x9')]=_0xe384a5['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xdb28=['Configurations','exports','name','username','password','token','remoteUri','authType','integrationTab','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x440a5d,_0x372b3a){_0x440a5d=_0x440a5d-0x0;var _0x51aa39=_0xdb28[_0x440a5d];return _0x51aa39;};'use strict';function ZendeskAccount(_0x2f1285){this['id']=_0x2f1285['id']||0x0;this[_0x8db2('0x0')]=_0x2f1285[_0x8db2('0x0')]||'';this[_0x8db2('0x1')]=_0x2f1285['username']||'';this[_0x8db2('0x2')]=_0x2f1285[_0x8db2('0x2')]||'';this[_0x8db2('0x3')]=_0x2f1285[_0x8db2('0x3')]||'';this[_0x8db2('0x4')]=_0x2f1285['remoteUri']||'';this[_0x8db2('0x5')]=_0x2f1285[_0x8db2('0x5')]||'';this['type']=_0x2f1285['type']||_0x8db2('0x6');this[_0x8db2('0x7')]=_0x2f1285[_0x8db2('0x7')]||'';this[_0x8db2('0x8')]=_0x2f1285[_0x8db2('0x8')]||{};}module[_0x8db2('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index de2e5df..3c45b93 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 _0x6739=['serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId'];(function(_0x5f3b0a,_0x442f2f){var _0x81e1f3=function(_0x4a6a9c){while(--_0x4a6a9c){_0x5f3b0a['push'](_0x5f3b0a['shift']());}};_0x81e1f3(++_0x442f2f);}(_0x6739,0xd3));var _0x9673=function(_0x53e7e8,_0x1672f5){_0x53e7e8=_0x53e7e8-0x0;var _0x288ea5=_0x6739[_0x53e7e8];return _0x288ea5;};'use strict';function ZohoAccount(_0x474458){this['id']=_0x474458['id']||0x0;this[_0x9673('0x0')]=_0x474458[_0x9673('0x0')]||'';this[_0x9673('0x1')]=_0x474458[_0x9673('0x1')]||'';this[_0x9673('0x2')]=_0x474458['host']||'';this['zone']=_0x474458[_0x9673('0x3')]||'';this['clientId']=_0x474458[_0x9673('0x4')]||'';this['clientSecret']=_0x474458['clientSecret']||'';this[_0x9673('0x5')]=_0x474458[_0x9673('0x5')]||'';this[_0x9673('0x6')]=_0x474458['code']||'';this['refreshToken']=_0x474458[_0x9673('0x7')]||'';this[_0x9673('0x8')]=_0x474458[_0x9673('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x91b6=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x4c52f3,_0x5bf82a){var _0x17f703=function(_0x3cd79b){while(--_0x3cd79b){_0x4c52f3['push'](_0x4c52f3['shift']());}};_0x17f703(++_0x5bf82a);}(_0x91b6,0x18b));var _0x691b=function(_0x3de2e3,_0x138ce7){_0x3de2e3=_0x3de2e3-0x0;var _0x1bce2a=_0x91b6[_0x3de2e3];return _0x1bce2a;};'use strict';function ZohoAccount(_0x1c0163){this['id']=_0x1c0163['id']||0x0;this[_0x691b('0x0')]=_0x1c0163['name']||'';this[_0x691b('0x1')]=_0x1c0163['description']||'';this['host']=_0x1c0163[_0x691b('0x2')]||'';this[_0x691b('0x3')]=_0x1c0163[_0x691b('0x3')]||'';this[_0x691b('0x4')]=_0x1c0163[_0x691b('0x4')]||'';this[_0x691b('0x5')]=_0x1c0163['clientSecret']||'';this['serverUrl']=_0x1c0163[_0x691b('0x6')]||'';this[_0x691b('0x7')]=_0x1c0163['code']||'';this[_0x691b('0x8')]=_0x1c0163[_0x691b('0x8')]||'';this[_0x691b('0x9')]=_0x1c0163[_0x691b('0x9')]||{};}module[_0x691b('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index a9b874b..c9781b8 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 _0x817b=['recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','isNil','string','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','format','SIP/%s','calleridname','phone','Contact','firstName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat'];(function(_0x57a764,_0x20d8ad){var _0x410a14=function(_0x1aeeeb){while(--_0x1aeeeb){_0x57a764['push'](_0x57a764['shift']());}};_0x410a14(++_0x20d8ad);}(_0x817b,0x130));var _0xb817=function(_0x501ca6,_0x168a58){_0x501ca6=_0x501ca6-0x0;var _0x1ec762=_0x817b[_0x501ca6];return _0x1ec762;};'use strict';var util=require(_0xb817('0x0'));var _=require(_0xb817('0x1'));var moment=require('moment');function checkNameSurname(_0xe86606,_0x181066,_0x4f2183){var _0x43e298='';if(!_[_0xb817('0x2')](_0x181066)&&_0xb817('0x3')===typeof _0x181066){_0x43e298+=_0x181066;}if(!_[_0xb817('0x2')](_0x4f2183)&&_0xb817('0x3')===typeof _0x4f2183){_0x43e298+='\x20'+_0x4f2183;}if(_0x43e298!==''){return _0x43e298;}return _0xe86606;}function Action(_0x256d62,_0x4a37f0,_0xcb0433,_0x534c3d,_0x3201bd){this['uniqueid']=_0xcb0433||undefined;this[_0xb817('0x4')]=_0x256d62['id'];this[_0xb817('0x5')]=_0x4a37f0['name'];this[_0xb817('0x6')]=_0x4a37f0[_0xb817('0x6')];this[_0xb817('0x7')]=_0xb817('0x5');this[_0xb817('0x8')]=![];this[_0xb817('0x9')]=_[_0xb817('0x2')](_0x256d62[_0xb817('0xa')])?undefined:_0x256d62['Agent'][_0xb817('0xb')];this['channelAgent']=this[_0xb817('0x9')]?util[_0xb817('0xc')](_0xb817('0xd'),this[_0xb817('0x9')]):_0x534c3d||undefined;this[_0xb817('0xe')]=checkNameSurname(_0x256d62['Contact'][_0xb817('0xf')],_0x256d62[_0xb817('0x10')][_0xb817('0x11')],_0x256d62['Contact']['lastName']);this['active']=_0x256d62[_0xb817('0x12')]||![];this['calleridnum']=_0x256d62[_0xb817('0x10')][_0xb817('0xf')];this[_0xb817('0x13')]=_0x256d62['scheduledat'];this['countbusyretry']=_0x256d62[_0xb817('0x14')]||0x0;this[_0xb817('0x15')]=_0x256d62[_0xb817('0x15')]||0x0;this['countnoanswerretry']=_0x256d62[_0xb817('0x16')]||0x0;this[_0xb817('0x17')]=(_0x256d62['countbusyretry']||0x0)+(_0x256d62[_0xb817('0x15')]||0x0)+(_0x256d62[_0xb817('0x16')]||0x0);this[_0xb817('0x18')]=_0x256d62[_0xb817('0x18')]||0x0;this[_0xb817('0x19')]=_0x256d62[_0xb817('0x19')]||0x0;this[_0xb817('0x1a')]=_0x256d62[_0xb817('0x1a')]||0x0;this[_0xb817('0x1b')]=_0x256d62[_0xb817('0x1b')]||0x0;this[_0xb817('0x1c')]=_0x256d62[_0xb817('0x1c')]||0x0;this[_0xb817('0x1d')]=_0x256d62['callback'];this[_0xb817('0x1e')]=_0x256d62['callbackuniqueid'];this[_0xb817('0x1f')]=_0x256d62[_0xb817('0x1f')];this[_0xb817('0x20')]=_0x256d62[_0xb817('0x20')];this[_0xb817('0x21')]=_0x256d62[_0xb817('0x21')];this['ListId']=_0x256d62[_0xb817('0x22')];this[_0xb817('0x23')]=_[_0xb817('0x2')](_0x256d62[_0xb817('0xa')])?_0x256d62[_0xb817('0x23')]:_0x256d62[_0xb817('0xa')]['id'];this[_0xb817('0x24')]=_0x256d62['VoiceQueueId'];this[_0xb817('0x25')]='';this[_0xb817('0x26')]='';}Action['prototype'][_0xb817('0x27')]=function(){return util[_0xb817('0xc')](_0xb817('0x28'),this['calleridname'],this['number']);};module[_0xb817('0x29')]=Action; \ No newline at end of file +var _0x3b95=['callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','isNil','string','uniqueid','idContact','queue','name','type','dialAnswer','Agent','channelAgent','format','SIP/%s','membername','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid'];(function(_0x42c05e,_0x33da91){var _0x461b6c=function(_0x246ce5){while(--_0x246ce5){_0x42c05e['push'](_0x42c05e['shift']());}};_0x461b6c(++_0x33da91);}(_0x3b95,0x101));var _0x53b9=function(_0x1b1b8a,_0x4e49db){_0x1b1b8a=_0x1b1b8a-0x0;var _0x405f71=_0x3b95[_0x1b1b8a];return _0x405f71;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x56e8d2,_0x367f8f,_0x4cd385){var _0x1d02dc='';if(!_[_0x53b9('0x0')](_0x367f8f)&&_0x53b9('0x1')===typeof _0x367f8f){_0x1d02dc+=_0x367f8f;}if(!_['isNil'](_0x4cd385)&&'string'===typeof _0x4cd385){_0x1d02dc+='\x20'+_0x4cd385;}if(_0x1d02dc!==''){return _0x1d02dc;}return _0x56e8d2;}function Action(_0x2ef9cf,_0x183695,_0x118b60,_0x34483a,_0x5a8c6e){this[_0x53b9('0x2')]=_0x118b60||undefined;this[_0x53b9('0x3')]=_0x2ef9cf['id'];this[_0x53b9('0x4')]=_0x183695[_0x53b9('0x5')];this[_0x53b9('0x6')]=_0x183695[_0x53b9('0x6')];this['campaigntype']='queue';this[_0x53b9('0x7')]=![];this['membername']=_['isNil'](_0x2ef9cf[_0x53b9('0x8')])?undefined:_0x2ef9cf['Agent']['name'];this[_0x53b9('0x9')]=this['membername']?util[_0x53b9('0xa')](_0x53b9('0xb'),this[_0x53b9('0xc')]):_0x34483a||undefined;this['calleridname']=checkNameSurname(_0x2ef9cf[_0x53b9('0xd')][_0x53b9('0xe')],_0x2ef9cf[_0x53b9('0xd')][_0x53b9('0xf')],_0x2ef9cf['Contact'][_0x53b9('0x10')]);this[_0x53b9('0x11')]=_0x2ef9cf[_0x53b9('0x11')]||![];this['calleridnum']=_0x2ef9cf[_0x53b9('0xd')][_0x53b9('0xe')];this[_0x53b9('0x12')]=_0x2ef9cf[_0x53b9('0x12')];this[_0x53b9('0x13')]=_0x2ef9cf[_0x53b9('0x13')]||0x0;this['countcongestionretry']=_0x2ef9cf[_0x53b9('0x14')]||0x0;this[_0x53b9('0x15')]=_0x2ef9cf[_0x53b9('0x15')]||0x0;this[_0x53b9('0x16')]=(_0x2ef9cf[_0x53b9('0x13')]||0x0)+(_0x2ef9cf['countcongestionretry']||0x0)+(_0x2ef9cf[_0x53b9('0x15')]||0x0);this[_0x53b9('0x17')]=_0x2ef9cf[_0x53b9('0x17')]||0x0;this[_0x53b9('0x18')]=_0x2ef9cf[_0x53b9('0x18')]||0x0;this[_0x53b9('0x19')]=_0x2ef9cf['countabandonedretry']||0x0;this[_0x53b9('0x1a')]=_0x2ef9cf['countmachineretry']||0x0;this[_0x53b9('0x1b')]=_0x2ef9cf[_0x53b9('0x1b')]||0x0;this[_0x53b9('0x1c')]=_0x2ef9cf[_0x53b9('0x1c')];this[_0x53b9('0x1d')]=_0x2ef9cf[_0x53b9('0x1d')];this[_0x53b9('0x1e')]=_0x2ef9cf[_0x53b9('0x1e')];this[_0x53b9('0x1f')]=_0x2ef9cf['recallme'];this['ContactId']=_0x2ef9cf['ContactId'];this[_0x53b9('0x20')]=_0x2ef9cf[_0x53b9('0x20')];this[_0x53b9('0x21')]=_[_0x53b9('0x0')](_0x2ef9cf[_0x53b9('0x8')])?_0x2ef9cf['UserId']:_0x2ef9cf[_0x53b9('0x8')]['id'];this[_0x53b9('0x22')]=_0x2ef9cf['VoiceQueueId'];this[_0x53b9('0x23')]='';this['originatecalleridname']='';}Action['prototype'][_0x53b9('0x24')]=function(){return util[_0x53b9('0xa')](_0x53b9('0x25'),this[_0x53b9('0x26')],this[_0x53b9('0x27')]);};module[_0x53b9('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index a385353..2112881 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 _0xa3ff=['ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','emit','custom:agentconnect','buildObj','buildAcw','custom:agentcomplete','complete','decrementTalkink','[16]','totalGlobal','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','countagentrejectretry','AgentReject','[syncHangupRequest][logAgentReject]','idContact','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','lookAgent','isEmpty','execCall','custom:agentcalled','Calling','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','run','execRun','unlock','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','trim','dialCutDigit','substring','phone','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','extractCalleridNumber','addVariables','merge','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','responsetime','response','rejected','callProgressDetectingAgent','starttime','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','unlockContact','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','variables','variable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./action','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','Trunk','active','callerid','Interval','name','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','sendMessageOneNotActive','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','dialActive','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','getContactRecallMe','then','length','scheduledat','dialRecallMeTimeout','Agent','logger2','[RecallMe]','catch','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid'];(function(_0x28a664,_0x151918){var _0x510107=function(_0x497335){while(--_0x497335){_0x28a664['push'](_0x28a664['shift']());}};_0x510107(++_0x151918);}(_0xa3ff,0x1c3));var _0xfa3f=function(_0x273a26,_0x26e708){_0x273a26=_0x273a26-0x0;var _0x45493f=_0xa3ff[_0x273a26];return _0x45493f;};'use strict';var util=require(_0xfa3f('0x0'));var _=require(_0xfa3f('0x1'));var BPromise=require(_0xfa3f('0x2'));var uuid=require(_0xfa3f('0x3'));var moment=require('moment');var md5=require(_0xfa3f('0x4'));var Redis=require('ioredis');var config=require(_0xfa3f('0x5'));var logger=require(_0xfa3f('0x6'))(_0xfa3f('0x7'));var loggerAction=require('../../../config/logger')(_0xfa3f('0x8'));var ami=require(_0xfa3f('0x9'));var rpcDb=require('./rpcDb');var Action=require(_0xfa3f('0xa'));var ut=require('./util/util');config[_0xfa3f('0xb')]=_[_0xfa3f('0xc')](config[_0xfa3f('0xb')],{'host':_0xfa3f('0xd'),'port':0x18eb});var io=require(_0xfa3f('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xfa3f('0xf')][_0xfa3f('0x10')]=function(_0x384f61){this['tail']=this[_0xfa3f('0x11')]?this['tail'][_0xfa3f('0x12')](_0x384f61):_0x384f61();};function Preview(_0x241184){this[_0xfa3f('0x13')]=new Sequence();this[_0xfa3f('0x14')]=_0x241184['voiceQueues'];this[_0xfa3f('0x15')]=_0x241184[_0xfa3f('0x15')];this[_0xfa3f('0x16')]={};this[_0xfa3f('0x17')]=_0x241184[_0xfa3f('0x17')];this[_0xfa3f('0x18')]=0x0;ami['on']('originateresponse',this[_0xfa3f('0x19')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on']('dialend',this['syncDialEnd'][_0xfa3f('0x1a')](this));ami['on'](_0xfa3f('0x1b'),this[_0xfa3f('0x1c')][_0xfa3f('0x1a')](this));ami['on'](_0xfa3f('0x1d'),this[_0xfa3f('0x1e')]['bind'](this));ami['on'](_0xfa3f('0x1f'),this[_0xfa3f('0x20')][_0xfa3f('0x1a')](this));ami['on'](_0xfa3f('0x21'),this[_0xfa3f('0x22')]['bind'](this));this[_0xfa3f('0x23')](this[_0xfa3f('0x14')]);}function emit(_0x37fc27,_0x54e9d6,_0x2f47de){io['to'](_0x37fc27)['emit'](_0x54e9d6,_0x2f47de);}function emitCampaignPreview(_0x28d8f7){if(_0x28d8f7[_0xfa3f('0x24')]===_0xfa3f('0x25')){var _0x56c820={'id':_0x28d8f7['id'],'name':_0x28d8f7['name'],'strategy':_0x28d8f7[_0xfa3f('0x26')],'answered':_0x28d8f7[_0xfa3f('0x27')],'available':_0x28d8f7[_0xfa3f('0x28')],'loggedIn':_0x28d8f7[_0xfa3f('0x29')],'pTalking':_0x28d8f7[_0xfa3f('0x2a')],'sumBillable':_0x28d8f7[_0xfa3f('0x2b')],'sumDuration':_0x28d8f7[_0xfa3f('0x2c')],'sumHoldTime':_0x28d8f7[_0xfa3f('0x2d')]||0x0,'talking':_0x28d8f7[_0xfa3f('0x2e')],'total':_0x28d8f7[_0xfa3f('0x2f')],'type':_0x28d8f7[_0xfa3f('0x24')],'unmanaged':_0x28d8f7[_0xfa3f('0x30')],'abandoned':_0x28d8f7[_0xfa3f('0x31')],'waiting':_0x28d8f7[_0xfa3f('0x32')],'loggedInDb':_0x28d8f7['loggedInDb'],'dialActive':_0x28d8f7['dialActive'],'dialMethod':_0x28d8f7[_0xfa3f('0x33')],'dialOriginateCallerIdName':_0x28d8f7[_0xfa3f('0x34')],'dialOriginateCallerIdNumber':_0x28d8f7['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x28d8f7['dialOriginateTimeout'],'dialPrefix':_0x28d8f7[_0xfa3f('0x35')],'outboundAnswerAgiCallsDay':_0x28d8f7[_0xfa3f('0x36')],'outboundAnswerCallsDay':_0x28d8f7[_0xfa3f('0x37')],'outboundBlacklistCallsDay':_0x28d8f7['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x28d8f7[_0xfa3f('0x38')],'outboundCongestionCallsDay':_0x28d8f7[_0xfa3f('0x39')],'outboundDropCallsDayACS':_0x28d8f7['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x28d8f7[_0xfa3f('0x3a')],'outboundDropCallsDayTimeout':_0x28d8f7[_0xfa3f('0x3b')],'outboundNoAnswerCallsDay':_0x28d8f7['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x28d8f7[_0xfa3f('0x3c')],'outboundOriginateFailureCallsDay':_0x28d8f7[_0xfa3f('0x3d')],'outboundReCallsDay':_0x28d8f7[_0xfa3f('0x3e')],'outboundRejectCallsDay':_0x28d8f7[_0xfa3f('0x3f')],'outboundUnknownCallsDay':_0x28d8f7['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x28d8f7['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x28d8f7['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x28d8f7[_0xfa3f('0x40')],'predictiveIntervalAvgTalktime':_0x28d8f7[_0xfa3f('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x28d8f7['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x28d8f7['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x28d8f7[_0xfa3f('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x28d8f7[_0xfa3f('0x43')],'predictiveIntervalHitRate':_0x28d8f7[_0xfa3f('0x44')],'predictiveIntervalMultiplicativeFactor':_0x28d8f7[_0xfa3f('0x45')],'predictiveIntervalPauses':_0x28d8f7[_0xfa3f('0x46')],'predictiveIntervalAvailable':_0x28d8f7[_0xfa3f('0x47')],'predictiveIntervalTotalCalls':_0x28d8f7['predictiveIntervalTotalCalls'],'message':_0x28d8f7[_0xfa3f('0x48')],'originated':_0x28d8f7[_0xfa3f('0x49')],'erlangCalls':_0x28d8f7[_0xfa3f('0x4a')],'erlangCallToSecond':_0x28d8f7[_0xfa3f('0x4b')],'erlangAbandonmentRate':_0x28d8f7[_0xfa3f('0x4c')],'erlangBusyFactor':_0x28d8f7['erlangBusyFactor'],'startPredictive':_0x28d8f7[_0xfa3f('0x4d')],'startProgressive':_0x28d8f7['startProgressive']};if(_0x28d8f7['Trunk']){_0x56c820['Trunk']={'id':_0x28d8f7[_0xfa3f('0x4e')]['id'],'name':_0x28d8f7[_0xfa3f('0x4e')]['name'],'active':_0x28d8f7[_0xfa3f('0x4e')][_0xfa3f('0x4f')],'callerid':_0x28d8f7['Trunk'][_0xfa3f('0x50')]};}if(_0x28d8f7[_0xfa3f('0x51')]){_0x56c820[_0xfa3f('0x51')]={'id':_0x28d8f7['Interval']['id'],'name':_0x28d8f7[_0xfa3f('0x51')][_0xfa3f('0x52')]};}var _0x149a10=md5(JSON[_0xfa3f('0x53')](_0x56c820));if(_0x28d8f7[_0xfa3f('0x4')]!==_0x149a10){_0x28d8f7[_0xfa3f('0x4')]=_0x149a10;emit(util[_0xfa3f('0x54')](_0xfa3f('0x55'),_0x56c820[_0xfa3f('0x52')]),_0xfa3f('0x56'),_0x56c820);}}}function emitVoiceQueueChannelRemove(_0x2cef9b){logger[_0xfa3f('0x57')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xfa3f('0x53')](_0x2cef9b));emit(util[_0xfa3f('0x54')]('voice:queue:%s',_0x2cef9b['name']),_0xfa3f('0x58'),_0x2cef9b);}function notSendMessagesQueue(_0x32924a){if(_0x32924a[_0xfa3f('0x59')]){if(_0x32924a['originated']===0x0&&_0x32924a[_0xfa3f('0x2a')]===0x0){_0x32924a[_0xfa3f('0x59')]=![];_0x32924a[_0xfa3f('0x28')]=0x0;_0x32924a[_0xfa3f('0x5a')]=0x0;_0x32924a[_0xfa3f('0x48')]='NOT_ACTIVE';ut['logger'](_0xfa3f('0x5b'),_0x32924a[_0xfa3f('0x52')]+_0xfa3f('0x5c'));}else{_0x32924a['message']=_0xfa3f('0x5d');ut[_0xfa3f('0x5e')](_0xfa3f('0x5b'),_0x32924a[_0xfa3f('0x52')]+'\x20is\x20disactive');}emitCampaignPreview(_0x32924a);}}Preview[_0xfa3f('0xf')]['loopCampaigns']=function(){var _0xbd514d=this;setInterval(function(){_0xbd514d['syncCampaigns']();},0x7cf);};Preview[_0xfa3f('0xf')][_0xfa3f('0x5f')]=function(){var _0x4173d1=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0xcca100 in _0x4173d1){if(_0x4173d1[_0xfa3f('0x60')](_0xcca100)&&(_0x4173d1[_0xcca100][_0xfa3f('0x33')]===_0xfa3f('0x7')||_0x4173d1[_0xcca100][_0xfa3f('0x33')]===_0xfa3f('0x61'))&&_0x4173d1[_0xcca100]['type']==='outbound'){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0xfa3f('0x62')]();}}if(_0x4173d1[_0xfa3f('0x60')](_0xcca100)&&_0x4173d1[_0xcca100]['dialMethod']===_0xfa3f('0x7')&&_0x4173d1[_0xcca100]['type']==='outbound'){if(_0x4173d1[_0xcca100][_0xfa3f('0x63')]){this[_0xfa3f('0x64')](_0x4173d1[_0xcca100]);this[_0xfa3f('0x65')](_0x4173d1[_0xcca100]);}else{notSendMessagesQueue(_0x4173d1[_0xcca100]);}}}};Preview['prototype'][_0xfa3f('0x66')]=function(_0x47407b){var _0x5954e9=this;this[_0xfa3f('0x13')]['enqueue'](function(){if(!_[_0xfa3f('0x67')](_0x5954e9[_0xfa3f('0x16')][_0x47407b])){loggerAction['info'](_0xfa3f('0x68'),_0x47407b,_0xfa3f('0x69'),_0x5954e9[_0xfa3f('0x16')][_0x47407b][_0xfa3f('0x6a')],_0xfa3f('0x6b'),JSON[_0xfa3f('0x53')](_0x5954e9['campaignsPreview'][_0x5954e9[_0xfa3f('0x16')][_0x47407b][_0xfa3f('0x6a')]][_0xfa3f('0x49')]),_0xfa3f('0x6c'),JSON[_0xfa3f('0x53')](_0x5954e9[_0xfa3f('0x14')][_0x5954e9[_0xfa3f('0x16')][_0x47407b][_0xfa3f('0x6a')]][_0xfa3f('0x2a')]),JSON['stringify'](_0x5954e9[_0xfa3f('0x16')][_0x47407b][_0xfa3f('0x6d')]),JSON['stringify'](_[_0xfa3f('0x6e')](_0x5954e9[_0xfa3f('0x16')][_0x47407b],[_0xfa3f('0x6f'),_0xfa3f('0x70'),_0xfa3f('0x71'),_0xfa3f('0x72')])));return ami[_0xfa3f('0x73')]({'action':_0xfa3f('0x74'),'channel':_0x5954e9[_0xfa3f('0x16')][_0x47407b][_0xfa3f('0x75')]})['catch'](function(_0x38eda7){if(_0x38eda7[_0xfa3f('0x48')]===_0xfa3f('0x76')){setTimeout(function(){if(_0x5954e9['actions'][_0x47407b]){ut[_0xfa3f('0x77')](_0x5954e9[_0xfa3f('0x14')][_0x5954e9['actions'][_0x47407b][_0xfa3f('0x6a')]],_0xfa3f('0x78'));if(_0x5954e9['actions'][_0x47407b][_0xfa3f('0x6d')]===!![]){ut['decrementTalkink'](_0x5954e9[_0xfa3f('0x14')][_0x5954e9['actions'][_0x47407b][_0xfa3f('0x6a')]],'[clearZombieChannel]');ut[_0xfa3f('0x79')](_0xfa3f('0x7a')+_0x47407b,_0x5954e9['actions'][_0x47407b][_0xfa3f('0x6a')]);}ut[_0xfa3f('0x79')](_0xfa3f('0x7b')+_0x47407b,_0x5954e9[_0xfa3f('0x16')][_0x47407b]['queue']);delete _0x5954e9[_0xfa3f('0x16')][_0x47407b];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x13cbf7=this;loggerAction[_0xfa3f('0x57')]('[action]',_['size'](this[_0xfa3f('0x16')]));for(var _0xb0aafc in this[_0xfa3f('0x16')]){if(_0x13cbf7['actions'][_0xfa3f('0x60')](_0xb0aafc)){_0x13cbf7[_0xfa3f('0x66')](_0xb0aafc);}}};Preview[_0xfa3f('0xf')][_0xfa3f('0x65')]=function(_0x2158ea){var _0x7a57da=this;rpcDb[_0xfa3f('0x7c')](_0x2158ea['id'],ut['agentReadyId'](this[_0xfa3f('0x17')]))[_0xfa3f('0x7d')](function(_0xf054c1){if(!_[_0xfa3f('0x67')](_0xf054c1)){for(var _0x31963d=0x0;_0x31963d<_0xf054c1[_0xfa3f('0x7e')];_0x31963d+=0x1){if(ut['getDiff'](_0xf054c1[_0x31963d][_0xfa3f('0x7f')])<_0x2158ea[_0xfa3f('0x80')]*0x3c){if(_0xf054c1[_0x31963d][_0xfa3f('0x81')]&&!_0xf054c1[_0x31963d]['Agent']['voicePause']){_0x7a57da['run'](_0xf054c1[_0x31963d]['id'])[_0xfa3f('0x7d')](ut[_0xfa3f('0x82')](_0xfa3f('0x83')))[_0xfa3f('0x84')](ut[_0xfa3f('0x82')](_0xfa3f('0x83')));}else{rpcDb[_0xfa3f('0x85')](_0xf054c1[_0x31963d]['id']);}}else{var _0x5e458a=new Action(_0xf054c1[_0x31963d],_0x2158ea);_0x5e458a['starttime']=moment()[_0xfa3f('0x54')](_0xfa3f('0x86'));_0x2158ea['outboundReCallsDay']+=0x1;ut[_0xfa3f('0x87')](_0x5e458a,0x17,'RecallInQueue');if(_0x2158ea[_0xfa3f('0x88')]){rpcDb[_0xfa3f('0x89')](ut[_0xfa3f('0x8a')](_0xf054c1[_0x31963d]));rpcDb[_0xfa3f('0x8b')](_0x5e458a,_0xfa3f('0x8c'));}else{ut[_0xfa3f('0x87')](_0x5e458a,0x16,_0xfa3f('0x8d'));rpcDb['createCustomerHistory'](_0x5e458a,_0xfa3f('0x8e'));rpcDb[_0xfa3f('0x8f')](_0x5e458a,_0xfa3f('0x8e'));}}}}})[_0xfa3f('0x84')](ut[_0xfa3f('0x82')](_0xfa3f('0x90')));};Preview[_0xfa3f('0xf')][_0xfa3f('0x64')]=function(_0x39a6f2){_0x39a6f2[_0xfa3f('0x59')]=!![];if(ut[_0xfa3f('0x91')](_0x39a6f2['loggedIn'])){_0x39a6f2[_0xfa3f('0x48')]=_0xfa3f('0x92');}else if(!ut[_0xfa3f('0x93')](_0x39a6f2[_0xfa3f('0x63')])){_0x39a6f2[_0xfa3f('0x48')]=_0xfa3f('0x94');}else if(!this[_0xfa3f('0x95')](_0x39a6f2[_0xfa3f('0x4e')])){if(!this[_0xfa3f('0x95')](_0x39a6f2[_0xfa3f('0x96')])){_0x39a6f2[_0xfa3f('0x48')]=_0xfa3f('0x97');}else{_0x39a6f2[_0xfa3f('0x48')]=_0xfa3f('0x98');}}else{_0x39a6f2[_0xfa3f('0x48')]=_0xfa3f('0x98');}emitCampaignPreview(_0x39a6f2);};Preview[_0xfa3f('0xf')][_0xfa3f('0x99')]=function(_0x56c09b,_0x4f7f33,_0x316b1a){var _0xdc24bb=this;var _0x4069a0=this[_0xfa3f('0x16')][_0x4f7f33];var _0x58edc9=this[_0xfa3f('0x14')][_0x4069a0[_0xfa3f('0x6a')]];var _0x4ba3f1;if(_0x58edc9){switch(_0x316b1a){case'1':_0x58edc9[_0xfa3f('0x3c')]+=0x1;_0x4069a0[_0xfa3f('0x9a')]+=0x1;_0x4069a0[_0xfa3f('0x9b')]=ut['totalGlobal'](_0x4069a0);ut[_0xfa3f('0x87')](_0x4069a0,0x0,_0xfa3f('0x9c'));rpcDb[_0xfa3f('0x8b')](_0x4069a0,_0xfa3f('0x9d'));if(ut['totalGlobal'](_0x4069a0)>=_0x58edc9[_0xfa3f('0x9e')]){_0x4ba3f1=ut[_0xfa3f('0x9f')](_0x4069a0,0xf,_0xfa3f('0xa0'));rpcDb['createCustomerFinal'](_0x4ba3f1,_0xfa3f('0xa1'));}else{if(_0x4069a0[_0xfa3f('0x9a')]>=_0x58edc9[_0xfa3f('0xa2')]){rpcDb[_0xfa3f('0x8f')](_0x4069a0,_0xfa3f('0xa1'));}else{rpcDb[_0xfa3f('0xa3')](ut[_0xfa3f('0xa4')](_0x4069a0,_0xfa3f('0x9a'),_0x58edc9[_0xfa3f('0xa5')]),_0x4069a0[_0xfa3f('0xa6')],_0x4069a0[_0xfa3f('0xa7')]);}}delete this['actions'][_0x56c09b[_0xfa3f('0xa8')]];break;case _0xfa3f('0xa9'):var _0x30d0de=moment()['format'](_0xfa3f('0x86'));_0x4069a0['responsetime']=_0x30d0de;_0x4069a0[_0xfa3f('0xaa')]=_0x30d0de;_0x4069a0[_0xfa3f('0x6d')]=!![];_0x58edc9['pTalking']+=0x1;logger[_0xfa3f('0x57')](_0xfa3f('0xab'),_0x4069a0[_0xfa3f('0xac')],_0xfa3f('0xad'),_0x58edc9['name'],'pTalking:\x20',_0x58edc9['pTalking']);ami[_0xfa3f('0xae')](_0xfa3f('0xaf'),ut[_0xfa3f('0xb0')](_0x4069a0,'connect'));if(_0x58edc9['acw']){ami['emit']('custom:agentConnectPreview',ut[_0xfa3f('0xb1')](_0x4069a0));}break;case'16':ami[_0xfa3f('0xae')](_0xfa3f('0xb2'),ut[_0xfa3f('0xb0')](_0x4069a0,_0xfa3f('0xb3')));emitVoiceQueueChannelRemove(ut[_0xfa3f('0xb0')](_0x4069a0,_0xfa3f('0xb3')));_0x58edc9[_0xfa3f('0x37')]+=0x1;_0x58edc9['total']+=0x1;_0x58edc9['answered']+=0x1;ut[_0xfa3f('0xb4')](_0x58edc9,_0xfa3f('0xb5'));_0x4069a0[_0xfa3f('0x9b')]=ut[_0xfa3f('0xb6')](_0x4069a0);ut[_0xfa3f('0x87')](_0x4069a0,0x4,'Answer');rpcDb['createCustomerHistory'](_0x4069a0,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xfa3f('0x8f')](_0x4069a0,_0xfa3f('0xb7'));rpcDb[_0xfa3f('0xb8')](_0x4069a0);_0x58edc9[_0xfa3f('0x2c')]+=_0x4069a0[_0xfa3f('0xb9')];_0x58edc9['sumBillable']+=_0x4069a0[_0xfa3f('0xb9')];logger[_0xfa3f('0x57')](_0xfa3f('0xba'),_0x4069a0[_0xfa3f('0xac')],_0xfa3f('0xad'),_0x58edc9['name'],_0xfa3f('0x6c'),_0x58edc9[_0xfa3f('0x2a')]);delete this['actions'][_0x56c09b[_0xfa3f('0xa8')]];break;case _0xfa3f('0xbb'):_0x58edc9[_0xfa3f('0x38')]+=0x1;_0x4069a0[_0xfa3f('0xbc')]+=0x1;_0x4069a0[_0xfa3f('0x9b')]=ut[_0xfa3f('0xb6')](_0x4069a0);ut[_0xfa3f('0x87')](_0x4069a0,0x5,_0xfa3f('0xbd'));rpcDb[_0xfa3f('0x8b')](_0x4069a0,_0xfa3f('0xbe'));if(ut[_0xfa3f('0xb6')](_0x4069a0)>=_0x58edc9[_0xfa3f('0x9e')]){_0x4ba3f1=ut[_0xfa3f('0x9f')](_0x4069a0,0xf,_0xfa3f('0xa0'));rpcDb['createCustomerFinal'](_0x4ba3f1,_0xfa3f('0xbf'));}else{if(_0x4069a0[_0xfa3f('0xbc')]>=_0x58edc9[_0xfa3f('0xc0')]){rpcDb[_0xfa3f('0x8f')](_0x4069a0,_0xfa3f('0xbe'));}else{rpcDb[_0xfa3f('0xa3')](ut[_0xfa3f('0xa4')](_0x4069a0,_0xfa3f('0xbc'),_0x58edc9[_0xfa3f('0xc1')]),_0x4069a0[_0xfa3f('0xa6')],_0x4069a0[_0xfa3f('0xa7')]);}}break;case _0xfa3f('0xc2'):_0x58edc9[_0xfa3f('0xc3')]+=0x1;_0x4069a0[_0xfa3f('0xc4')]+=0x1;_0x4069a0['countglobal']=ut['totalGlobal'](_0x4069a0);ut[_0xfa3f('0x87')](_0x4069a0,0x3,_0xfa3f('0xc5'));rpcDb['createCustomerHistory'](_0x4069a0,_0xfa3f('0xc6'));if(ut[_0xfa3f('0xb6')](_0x4069a0)>=_0x58edc9[_0xfa3f('0x9e')]){_0x4ba3f1=ut[_0xfa3f('0x9f')](_0x4069a0,0xf,_0xfa3f('0xa0'));rpcDb[_0xfa3f('0x8f')](_0x4ba3f1,_0xfa3f('0xc7'));}else{if(_0x4069a0[_0xfa3f('0xc4')]>=_0x58edc9['dialNoAnswerMaxRetry']){rpcDb[_0xfa3f('0x8f')](_0x4069a0,_0xfa3f('0xc6'));}else{rpcDb[_0xfa3f('0xa3')](ut[_0xfa3f('0xa4')](_0x4069a0,_0xfa3f('0xc4'),_0x58edc9['dialNoAnswerRetryFrequency']),_0x4069a0[_0xfa3f('0xa6')],_0x4069a0[_0xfa3f('0xa7')]);}}break;case _0xfa3f('0xc8'):_0x58edc9[_0xfa3f('0x39')]+=0x1;_0x4069a0[_0xfa3f('0xc9')]+=0x1;_0x4069a0[_0xfa3f('0x9b')]=ut[_0xfa3f('0xb6')](_0x4069a0);ut[_0xfa3f('0x87')](_0x4069a0,0x8,'Congestion');rpcDb[_0xfa3f('0x8b')](_0x4069a0,_0xfa3f('0xca'));if(ut[_0xfa3f('0xb6')](_0x4069a0)>=_0x58edc9['dialGlobalMaxRetry']){_0x4ba3f1=ut[_0xfa3f('0x9f')](_0x4069a0,0xf,_0xfa3f('0xa0'));rpcDb[_0xfa3f('0x8f')](_0x4ba3f1,_0xfa3f('0xcb'));}else{if(_0x4069a0[_0xfa3f('0xc9')]>=_0x58edc9['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x4069a0,_0xfa3f('0xca'));}else{rpcDb[_0xfa3f('0xa3')](ut[_0xfa3f('0xa4')](_0x4069a0,_0xfa3f('0xc9'),_0x58edc9[_0xfa3f('0xc1')]),_0x4069a0[_0xfa3f('0xa6')],_0x4069a0[_0xfa3f('0xa7')]);}}break;case _0xfa3f('0xcc'):_0x58edc9['outboundRejectCallsDay']+=0x1;_0x4069a0[_0xfa3f('0xcd')]+=0x1;_0x4069a0['countglobal']=ut[_0xfa3f('0xb6')](_0x4069a0);ut[_0xfa3f('0x87')](_0x4069a0,0x14,_0xfa3f('0xce'));rpcDb[_0xfa3f('0x8b')](_0x4069a0,_0xfa3f('0xcf'));if(_0x4069a0['unlockAgent']){rpcDb['unlockContact'](_0x4069a0[_0xfa3f('0xd0')]);}if(_0x4069a0[_0xfa3f('0xa7')]){rpcDb[_0xfa3f('0x85')](_0x4069a0[_0xfa3f('0xd0')]);}break;case _0xfa3f('0xd1'):_0x58edc9['outboundAbandonedCallsDay']+=0x1;_0x4069a0['countabandonedretry']+=0x1;_0x4069a0[_0xfa3f('0x9b')]=ut[_0xfa3f('0xb6')](_0x4069a0);ut[_0xfa3f('0x87')](_0x4069a0,0xb,_0xfa3f('0xd2'));rpcDb[_0xfa3f('0x8b')](_0x4069a0,_0xfa3f('0xd3'));if(ut['totalGlobal'](_0x4069a0)>=_0x58edc9[_0xfa3f('0x9e')]){_0x4ba3f1=ut[_0xfa3f('0x9f')](_0x4069a0,0xf,_0xfa3f('0xa0'));rpcDb[_0xfa3f('0x8f')](_0x4ba3f1,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x4069a0[_0xfa3f('0xd4')]>=_0x58edc9[_0xfa3f('0xd5')]){rpcDb['createCustomerFinal'](_0x4069a0,_0xfa3f('0xd3'));}else{rpcDb[_0xfa3f('0xa3')](ut[_0xfa3f('0xa4')](_0x4069a0,'countabandonedretry',_0x58edc9[_0xfa3f('0xd6')]),_0x4069a0[_0xfa3f('0xa6')],_0x4069a0[_0xfa3f('0xa7')]);}}break;default:if(_0x4069a0[_0xfa3f('0x6d')]){ut['decrementTalkink'](_0x58edc9,_0xfa3f('0xd7'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x58edc9[_0xfa3f('0x52')],_0x56c09b);}_0x58edc9['outboundUnknownCallsDay']+=0x1;_0x4069a0[_0xfa3f('0x9b')]=ut[_0xfa3f('0xb6')](_0x4069a0);ut['logCustomer'](_0x4069a0,0xc,_0x56c09b[_0xfa3f('0xd8')]||_0x56c09b[_0xfa3f('0xd9')]);rpcDb['createCustomerHistory'](_0x4069a0,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0xfa3f('0xb6')](_0x4069a0)>=_0x58edc9['dialGlobalMaxRetry']){_0x4ba3f1=ut[_0xfa3f('0x9f')](_0x4069a0,0xf,_0xfa3f('0xa0'));rpcDb[_0xfa3f('0x8f')](_0x4ba3f1,_0xfa3f('0xda'));}else{rpcDb[_0xfa3f('0x8f')](_0x4069a0,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xfa3f('0x16')][_0x56c09b[_0xfa3f('0xa8')]];}if(!(_0x4069a0['dialAnswer']&&_0x316b1a==='16')){ut[_0xfa3f('0x77')](_0x58edc9,_0xfa3f('0xdb'));logger[_0xfa3f('0x57')]('[originated][decrement][callProgressDetectingCustomer]',_0x4069a0[_0xfa3f('0xac')],_0xfa3f('0xad'),_0x58edc9[_0xfa3f('0x52')],'originated:\x20',_0x58edc9['originated']);}if(_0x316b1a!==_0xfa3f('0xa9')){delete this[_0xfa3f('0x16')][_0x56c09b['linkedid']];delete this[_0xfa3f('0x16')][_0x56c09b[_0xfa3f('0xdc')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x57ad7f,_0x273e21,_0x2e4082){if(_[_0xfa3f('0xdd')](_0x273e21)&&_0xfa3f('0xde')!==typeof _0x273e21){return;}if(_[_0xfa3f('0xdd')](_0x2e4082)&&_0xfa3f('0xde')!==typeof _0x2e4082){return;}switch(_0x2e4082[_0xfa3f('0xdf')]){case'0':ut[_0xfa3f('0xe0')](_0x57ad7f,0x0,_0xfa3f('0x9c'));rpcDb[_0xfa3f('0xe1')](_0x57ad7f,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xfa3f('0xe0')](_0x57ad7f,0x3,_0xfa3f('0xc5'));rpcDb[_0xfa3f('0xe1')](_0x57ad7f,_0xfa3f('0xe2'));break;case'5':ut[_0xfa3f('0xe0')](_0x57ad7f,0x5,_0xfa3f('0xbd'));rpcDb[_0xfa3f('0xe1')](_0x57ad7f,_0xfa3f('0xe3'));break;case'8':ut[_0xfa3f('0xe0')](_0x57ad7f,0x8,'Congestion');rpcDb[_0xfa3f('0xe1')](_0x57ad7f,_0xfa3f('0xe4'));break;case'22':ut[_0xfa3f('0xe0')](_0x57ad7f,0x16,_0xfa3f('0xe5'));rpcDb[_0xfa3f('0xe1')](_0x57ad7f,_0xfa3f('0xe6'));break;default:ut['logAgent'](_0x57ad7f,0xc,_0x2e4082[_0xfa3f('0xdf')]);rpcDb['createAgentHistory'](_0x57ad7f,_0xfa3f('0xe4'));}ut[_0xfa3f('0x77')](_0x273e21,'[callProgressDetectingAgent]');logger[_0xfa3f('0x57')](_0xfa3f('0xe7'),_0x57ad7f['uniqueid'],_0xfa3f('0xad'),_0x273e21[_0xfa3f('0x52')],_0xfa3f('0x6b'),_0x273e21[_0xfa3f('0x49')]);delete this[_0xfa3f('0x16')][_0x57ad7f['uniqueid']];};Preview[_0xfa3f('0xf')][_0xfa3f('0xe8')]=function(_0x1e04ed,_0xfef7e6,_0xc7f997,_0x1ba173,_0x2a4167){var _0x2723f7=this;return new BPromise(function(_0x34bcfe,_0x35c1fe){if(_[_0xfa3f('0x67')](_0xfef7e6)||_[_0xfa3f('0x67')](_0xfef7e6[_0xfa3f('0xe9')])||_['isNil'](_0xfef7e6[_0xfa3f('0xe9')]['phone'])||_[_0xfa3f('0x67')](_0xfef7e6[_0xfa3f('0x71')])){_0x35c1fe(ut['message']('Contact\x20is\x20undefined',_0x1ba173,_0x2a4167));return;}var _0x396cf3=uuid['v4']();var _0x4cbbdf=_0x2723f7['campaignsPreview'][_0xfef7e6['Queue'][_0xfa3f('0x52')]];var _0x264975=_0xc7f997?_0x2723f7['agents'][_0xc7f997]['id']:undefined;_0x2723f7[_0xfa3f('0x16')][_0x396cf3]=new Action(_0xfef7e6,_0x4cbbdf,_0x396cf3,_0xc7f997,_0x264975);var _0x729b7=_0x2723f7[_0xfa3f('0x16')][_0x396cf3];_0x729b7[_0xfa3f('0xa6')]=_0x1ba173;_0x729b7[_0xfa3f('0xa7')]=_0x2a4167;_0x729b7[_0xfa3f('0xea')]=_0xc7f997;if(_[_0xfa3f('0xeb')](_0x1e04ed)){_0x2723f7[_0xfa3f('0xec')](_0x729b7,_0x4cbbdf,_0xfef7e6,_0xc7f997)['then'](function(_0x48ce7e){logger[_0xfa3f('0x57')]('[Preview][execCall][success]','Queue:\x20'+_0x729b7[_0xfa3f('0x6a')]+'\x20IdHopper:\x20'+_0x729b7[_0xfa3f('0xd0')],JSON[_0xfa3f('0x53')](_0x48ce7e));ami[_0xfa3f('0xae')](_0xfa3f('0xed'),ut['buildObj'](_0x729b7,'called'));_0x34bcfe(ut[_0xfa3f('0x48')](_0xfa3f('0xee')));})[_0xfa3f('0x84')](function(_0x30ad1a){ut[_0xfa3f('0x5e')]('[Preview][execCall][failure]',_0x30ad1a);_0x35c1fe(ut[_0xfa3f('0x48')](_0xfa3f('0xef'),_0x1ba173,_0x2a4167));});}else{_0x4cbbdf['outboundBlacklistCallsDay']+=0x1;ut[_0xfa3f('0xf0')](_0x729b7);rpcDb['createHistory'](_0x729b7,_0xfa3f('0xf1'));delete _0x2723f7[_0xfa3f('0x16')][_0x396cf3];_0x35c1fe(ut['message'](_0xfa3f('0xf2'),_0x1ba173,_0x2a4167));}});};Preview[_0xfa3f('0xf')][_0xfa3f('0x95')]=function(_0x53d426){return!_[_0xfa3f('0x67')](_0x53d426)&&!_[_0xfa3f('0x67')](_0x53d426[_0xfa3f('0x52')])&&!_[_0xfa3f('0x67')](_0x53d426[_0xfa3f('0x4f')])&&_0x53d426['active']&&!_[_0xfa3f('0x67')](this[_0xfa3f('0x15')][util[_0xfa3f('0x54')]('SIP/%s',_0x53d426[_0xfa3f('0x52')])])&&!_[_0xfa3f('0x67')](this[_0xfa3f('0x15')][util[_0xfa3f('0x54')](_0xfa3f('0xf3'),_0x53d426[_0xfa3f('0x52')])][_0xfa3f('0x74')])&&(this[_0xfa3f('0x15')][util[_0xfa3f('0x54')](_0xfa3f('0xf3'),_0x53d426['name'])][_0xfa3f('0x74')]===_0xfa3f('0xf4')||this['trunks'][util['format'](_0xfa3f('0xf3'),_0x53d426[_0xfa3f('0x52')])][_0xfa3f('0x74')]===_0xfa3f('0xf5'));};Preview['prototype'][_0xfa3f('0xf6')]=function(_0x3cbad3,_0x40d4f5){var _0x594477=this;return new BPromise(function(_0x438169,_0x554242){_0x594477[_0xfa3f('0xf7')](_0x3cbad3,_0x40d4f5)[_0xfa3f('0x7d')](function(_0x1f9adc){_0x438169(_[_0xfa3f('0x6e')](_0x1f9adc,[_0xfa3f('0x48')]));})[_0xfa3f('0x84')](function(_0x1de9bb){if(_0x1de9bb[_0xfa3f('0xf8')]){rpcDb['unlockContact'](_0x3cbad3);}if(_0x1de9bb[_0xfa3f('0x4f')]){rpcDb['disableContact'](_0x3cbad3);}_0x554242(_[_0xfa3f('0x6e')](_0x1de9bb,[_0xfa3f('0x48')]));});});};Preview[_0xfa3f('0xf')][_0xfa3f('0xf7')]=function(_0xe47e52,_0xb54d9f){var _0xc9cefd=this;return new BPromise(function(_0x36c911,_0x55a898){var _0xea67ea,_0x5e618b;rpcDb['getContactPreview'](_0xe47e52)['then'](function(_0x82940e){if(!_[_0xfa3f('0x67')](_0x82940e[0x0])){_0x5e618b=_0x82940e[0x0][_0xfa3f('0xf9')]?![]:!![];_0xea67ea=_0x82940e[0x0][_0xfa3f('0xf9')]?!![]:![];_0xea67ea=_0xb54d9f?!![]:_0xea67ea;}var _0x35be5e=_0xc9cefd[_0xfa3f('0xfa')](_0x82940e);if(_0x35be5e[_0xfa3f('0xfb')]){rpcDb[_0xfa3f('0xfc')](_[_0xfa3f('0x6e')](_0x82940e[0x0],[_0xfa3f('0x71'),_0xfa3f('0xfd')]))['then'](function(_0xe2df38){_0xc9cefd[_0xfa3f('0xe8')](_0xe2df38,_0x82940e[0x0],_0xb54d9f,_0x5e618b,_0xea67ea)[_0xfa3f('0x7d')](function(_0x2d2dcc){_0x36c911(_0x2d2dcc);})[_0xfa3f('0x84')](function(_0x2f423f){_0x55a898(_0x2f423f);});})[_0xfa3f('0x84')](function(_0x544bb7){ut[_0xfa3f('0x5e')](_0xfa3f('0xfe'),_0x544bb7);_0x55a898(ut[_0xfa3f('0x48')]('Call\x20unsuccessful',_0x5e618b,_0xea67ea));});}else{_0x55a898(ut[_0xfa3f('0x48')](_0x35be5e[_0xfa3f('0x48')],_0x5e618b,_0xea67ea));}})[_0xfa3f('0x84')](function(_0x15d718){ut['logger'](_0xfa3f('0xff'),_0x15d718);_0x55a898(ut['message'](_0xfa3f('0x100'),![],!![]));});});};Preview[_0xfa3f('0xf')][_0xfa3f('0xfa')]=function(_0x52702b){if(_[_0xfa3f('0x67')](_0x52702b)||_['isEmpty'](_0x52702b)||!_[_0xfa3f('0x67')](_0x52702b[0x0][_0xfa3f('0x81')])&&_[_0xfa3f('0x67')](_0x52702b[0x0][_0xfa3f('0x81')][_0xfa3f('0x52')])){ut[_0xfa3f('0x5e')](_0xfa3f('0x101'),_0x52702b);return{'isValid':![],'message':_0xfa3f('0x102')};}var _0x178b38=this['campaignsPreview'][_0x52702b[0x0][_0xfa3f('0x69')][_0xfa3f('0x52')]];_0x178b38['message']=_0xfa3f('0x98');if(_[_0xfa3f('0x67')](_0x178b38)){ut[_0xfa3f('0x5e')](_0xfa3f('0x103'),_0x178b38);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xfa3f('0x95')](_0x178b38[_0xfa3f('0x4e')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0xfa3f('0x104')+_0x178b38[_0xfa3f('0x52')]+_0xfa3f('0x105'));if(!this['isTrunkReachable'](_0x178b38[_0xfa3f('0x96')])){ut[_0xfa3f('0x5e')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x178b38[_0xfa3f('0x52')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xfa3f('0x106')};}}if(!ut[_0xfa3f('0x93')](_0x178b38[_0xfa3f('0x63')])){ut[_0xfa3f('0x5e')](_0xfa3f('0x107'),_0x178b38['name']+_0xfa3f('0x108'));return{'isValid':![],'message':_0xfa3f('0x104')+_0x178b38['name']+_0xfa3f('0x108')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xfa3f('0xf')][_0xfa3f('0xec')]=function(_0x4a3565,_0x397ca0,_0x102e40,_0xce518a){var _0xe1255a=this;return new BPromise(function(_0x1154fc,_0xfab9b){var _0x5d7440=_0x4a3565['uniqueid'];var _0x47f32a=_0xe1255a['isTrunkReachable'](_0x397ca0[_0xfa3f('0x4e')])?util[_0xfa3f('0x54')](_0xfa3f('0x109'),_0x397ca0[_0xfa3f('0x4e')]['name'],_[_0xfa3f('0x67')](_0x397ca0[_0xfa3f('0x35')])?'':_0x397ca0[_0xfa3f('0x35')][_0xfa3f('0x10a')]()||'',_0x397ca0[_0xfa3f('0x10b')]>0x0?_0x102e40[_0xfa3f('0xe9')]['phone'][_0xfa3f('0x10c')](_0x397ca0[_0xfa3f('0x10b')]):_0x102e40[_0xfa3f('0xe9')][_0xfa3f('0x10d')]):util[_0xfa3f('0x54')](_0xfa3f('0x109'),_[_0xfa3f('0x67')](_0x397ca0[_0xfa3f('0x96')])?_0x397ca0[_0xfa3f('0x4e')][_0xfa3f('0x52')]:_0x397ca0[_0xfa3f('0x96')]['name'],_[_0xfa3f('0x67')](_0x397ca0[_0xfa3f('0x35')])?'':_0x397ca0[_0xfa3f('0x35')]['trim']()||'',_0x397ca0['dialCutDigit']>0x0?_0x102e40[_0xfa3f('0xe9')][_0xfa3f('0x10d')][_0xfa3f('0x10c')](_0x397ca0[_0xfa3f('0x10b')]):_0x102e40[_0xfa3f('0xe9')]['phone']);var _0x5314f6=_0xe1255a['isTrunkReachable'](_0x397ca0['Trunk'])?ut[_0xfa3f('0x10e')](_0x397ca0[_0xfa3f('0x4e')]['callerid'],_0x397ca0[_0xfa3f('0x34')],_0x397ca0[_0xfa3f('0x10f')]>0x0?ut[_0xfa3f('0x110')](_0x397ca0[_0xfa3f('0x111')],_0x397ca0['dialRandomLastDigitCallerIdNumber']):_0x397ca0[_0xfa3f('0x111')]):ut['getCallerId'](_[_0xfa3f('0x67')](_0x397ca0[_0xfa3f('0x96')])?_0x397ca0['Trunk'][_0xfa3f('0x50')]:_0x397ca0['TrunkBackup'][_0xfa3f('0x50')],_0x397ca0[_0xfa3f('0x34')],_0x397ca0[_0xfa3f('0x10f')]>0x0?ut[_0xfa3f('0x110')](_0x397ca0['dialOriginateCallerIdNumber'],_0x397ca0[_0xfa3f('0x10f')]):_0x397ca0[_0xfa3f('0x111')]);if(_0x5314f6){_0x4a3565['originatecalleridname']=ut[_0xfa3f('0x112')](_0x5314f6);_0x4a3565['originatecalleridnum']=ut[_0xfa3f('0x113')](_0x5314f6);}var _0x4b1f03=ut[_0xfa3f('0x114')](_0x397ca0,_0x102e40,_0x47f32a,_0x5314f6,_0x5d7440,_0x4a3565);_[_0xfa3f('0x115')](_0x4a3565,ut['toLowerVariables'](_0x4b1f03));_0x4a3565['starttime']=moment()[_0xfa3f('0x54')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xfa3f('0x73')](ut[_0xfa3f('0x116')](_0x4a3565,_0x397ca0,_0x4b1f03,_0x4a3565[_0xfa3f('0xa7')],_0xce518a))['then'](function(_0x4a7fa4){_0x397ca0[_0xfa3f('0x49')]+=0x1;logger[_0xfa3f('0x57')](_0xfa3f('0x117'),_0x5d7440,_0xfa3f('0xad'),_0x397ca0[_0xfa3f('0x52')],_0xfa3f('0x6b'),_0x397ca0['originated']);_0x1154fc(_0x4a7fa4);})['catch'](function(_0x17956b){ut[_0xfa3f('0xe0')](_0x4a3565,0xe,_0xfa3f('0x118'));rpcDb[_0xfa3f('0xe1')](_0x4a3565,_0xfa3f('0x119'));_0xfab9b(_0x17956b);});});};Preview[_0xfa3f('0xf')][_0xfa3f('0x1c')]=function(_0x33569d){if(this[_0xfa3f('0x16')][_0x33569d[_0xfa3f('0xa8')]]){this[_0xfa3f('0x16')][_0x33569d[_0xfa3f('0xa8')]][_0xfa3f('0x75')]=_0x33569d[_0xfa3f('0x75')];}};Preview[_0xfa3f('0xf')][_0xfa3f('0x19')]=function(_0x1b5760){var _0x49693e=this;var _0x38850e=this[_0xfa3f('0x16')][_0x1b5760['actionid']];if(_0x38850e){if(_0x38850e[_0xfa3f('0xea')]&&this[_0xfa3f('0x17')][_0x38850e['lookAgent']]){ut[_0xfa3f('0x11a')](_0x38850e,this['agents'][_0x38850e[_0xfa3f('0xea')]]['name'],this[_0xfa3f('0x17')][_0x38850e[_0xfa3f('0xea')]]['id']);}var _0x4e8e4f=_['clone'](_0x38850e);_0x4e8e4f[_0xfa3f('0x11b')]=moment()[_0xfa3f('0x54')](_0xfa3f('0x86'));var _0x3ac52e=_0x49693e['campaignsPreview'][_0x38850e['queue']];if(ut['isFailure'](_0x1b5760[_0xfa3f('0x11c')])){if(_0x38850e['unlockAgent']){rpcDb['unlockContact'](_0x38850e['idContact']);}if(_0x38850e['activeContact']){rpcDb[_0xfa3f('0x85')](_0x38850e[_0xfa3f('0xd0')]);}ami[_0xfa3f('0xae')]('custom:agentringnoanswer',ut[_0xfa3f('0xb0')](_0x38850e,_0xfa3f('0x11d')));this[_0xfa3f('0x11e')](_0x4e8e4f,_0x3ac52e,_0x1b5760);}else{_0x38850e[_0xfa3f('0x11f')]=moment()['format'](_0xfa3f('0x86'));ut[_0xfa3f('0xe0')](_0x4e8e4f,0x4,'Answer');rpcDb[_0xfa3f('0xe1')](_0x4e8e4f,_0xfa3f('0x120'));}}};Preview['prototype'][_0xfa3f('0x121')]=function(_0xb80a54){var _0x225553=this;var _0x3d3148=this[_0xfa3f('0x16')][_0xb80a54[_0xfa3f('0xa8')]];var _0x167543;if(_0x3d3148){_0x167543=this[_0xfa3f('0x14')][_0x3d3148[_0xfa3f('0x6a')]];logger[_0xfa3f('0x57')](_0xfa3f('0x122'),_0xb80a54[_0xfa3f('0xa8')],_0xfa3f('0xad'),_0x167543[_0xfa3f('0x52')],'pTalking:\x20',_0x167543[_0xfa3f('0x2a')]);}if(this[_0xfa3f('0x16')][_0xb80a54[_0xfa3f('0xa8')]]&&_0xb80a54['linkedid']!==_0xb80a54['uniqueid']){if(_0xb80a54[_0xfa3f('0x123')]==='16'&&this[_0xfa3f('0x16')][_0xb80a54[_0xfa3f('0xa8')]][_0xfa3f('0x6d')]){this[_0xfa3f('0x99')](_0xb80a54,_0xb80a54[_0xfa3f('0xa8')],_0xb80a54[_0xfa3f('0x123')]);}else if(this[_0xfa3f('0x16')][_0xb80a54['linkedid']]['dialAnswer']){logger[_0xfa3f('0x57')](_0xfa3f('0x124'),_0xb80a54['linkedid'],_0xb80a54[_0xfa3f('0x123')],_0xfa3f('0xad'),_0x167543[_0xfa3f('0x52')],_0xfa3f('0x6c'),_0x167543[_0xfa3f('0x2a')]);this[_0xfa3f('0x99')](_0xb80a54,_0xb80a54[_0xfa3f('0xa8')],_0xb80a54['cause']);}}else if(_0x3d3148&&_[_0xfa3f('0x67')](_0x3d3148[_0xfa3f('0x125')])&&_0x167543[_0xfa3f('0x126')]&&_0xb80a54[_0xfa3f('0xa8')]===_0xb80a54[_0xfa3f('0xac')]&&_[_0xfa3f('0x67')](_0xb80a54[_0xfa3f('0xdf')])&&_0xb80a54[_0xfa3f('0x123')]==='16'&&_0xb80a54[_0xfa3f('0x127')]==='6'&&_['isUndefined'](_0x3d3148[_0xfa3f('0x128')])){if(_0x3d3148[_0xfa3f('0xa6')]){rpcDb[_0xfa3f('0x129')](_0x3d3148[_0xfa3f('0xd0')]);}if(_0x3d3148[_0xfa3f('0xa7')]){rpcDb[_0xfa3f('0x85')](_0x3d3148[_0xfa3f('0xd0')]);}_0xb80a54[_0xfa3f('0xdf')]='22';this[_0xfa3f('0x11e')](_0x3d3148,_0x167543,_0xb80a54);}else if(_0x3d3148&&_0x3d3148['transfer']){if(_0xb80a54[_0xfa3f('0x123')]==='16'&&this[_0xfa3f('0x16')][_0xb80a54[_0xfa3f('0xa8')]]['dialAnswer']){logger['info'](_0xfa3f('0x12a'),_0xb80a54[_0xfa3f('0xa8')],_0xb80a54['cause'],'\x20Queue',_0x167543[_0xfa3f('0x52')],_0xfa3f('0x6c'),_0x167543[_0xfa3f('0x2a')]);this[_0xfa3f('0x99')](_0xb80a54,_0xb80a54[_0xfa3f('0xa8')],_0xb80a54['cause']);}else if(this[_0xfa3f('0x16')][_0xb80a54[_0xfa3f('0xa8')]][_0xfa3f('0x6d')]){logger['info'](_0xfa3f('0x124'),_0xb80a54[_0xfa3f('0xa8')],_0xb80a54[_0xfa3f('0x123')],_0xfa3f('0xad'),_0x167543['name'],_0xfa3f('0x6c'),_0x167543['pTalking']);this[_0xfa3f('0x99')](_0xb80a54,_0xb80a54[_0xfa3f('0xa8')],_0xb80a54[_0xfa3f('0x123')]);}}};Preview[_0xfa3f('0xf')][_0xfa3f('0x12b')]=function(_0xcb0473){if(this['actions'][_0xcb0473[_0xfa3f('0xdc')]]&&_0xcb0473[_0xfa3f('0xdc')]!==_0xcb0473[_0xfa3f('0x12c')]){this['callProgressDetectingCustomer'](_0xcb0473,_0xcb0473['destlinkedid'],_0xcb0473['dialstatus']);}};Preview[_0xfa3f('0xf')]['syncHangupRequest']=function(_0x4d37b5){if(this['actions'][_0x4d37b5[_0xfa3f('0xa8')]]&&_0x4d37b5[_0xfa3f('0xa8')]!==_0x4d37b5[_0xfa3f('0xac')]&&!this[_0xfa3f('0x16')][_0x4d37b5[_0xfa3f('0xa8')]][_0xfa3f('0x6d')]){if(_0x4d37b5[_0xfa3f('0x123')]==='1'){this['callProgressDetectingCustomer'](_0x4d37b5,_0x4d37b5[_0xfa3f('0xa8')],_0x4d37b5[_0xfa3f('0x123')]);}}};Preview[_0xfa3f('0xf')]['addVariable']=function(_0x2f50d2,_0x2bd67e,_0x5b7ace){if(this[_0xfa3f('0x16')][_0x2f50d2]){if(_[_0xfa3f('0x67')](this['actions'][_0x2f50d2][_0xfa3f('0x12d')])){this[_0xfa3f('0x16')][_0x2f50d2][_0xfa3f('0x12d')]={};}this[_0xfa3f('0x16')][_0x2f50d2]['variables'][_0x2bd67e]=_0x5b7ace;}};Preview['prototype'][_0xfa3f('0x1e')]=function(_0x35bde3){try{if(!_['isNil'](_0x35bde3)){if(ut['filterKey'](_['keys'](_0x35bde3[_0xfa3f('0x12e')])[0x0])){this['addVariable'](_0x35bde3[_0xfa3f('0xac')],_[_0xfa3f('0x12f')](_0x35bde3['variable'])[0x0],_0x35bde3[_0xfa3f('0x130')]);}}}catch(_0x3b9756){logger[_0xfa3f('0x131')](_0xfa3f('0x132'),util[_0xfa3f('0x133')](_0x3b9756,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x41eec5){if(_0x41eec5){if(this[_0xfa3f('0x16')][_0x41eec5[_0xfa3f('0x134')]]){this[_0xfa3f('0x16')][_0x41eec5[_0xfa3f('0x134')]][_0xfa3f('0x128')]=!![];}}};Preview[_0xfa3f('0xf')]['syncBlindTransfer']=function(_0x21044e){if(_0x21044e){if(this[_0xfa3f('0x16')][_0x21044e['transfererlinkedid']]){this[_0xfa3f('0x16')][_0x21044e[_0xfa3f('0x135')]][_0xfa3f('0x128')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x5350=['Is\x20Valid','execCall','SIP/%s/%s%s','trim','phone','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','clone','isFailure','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','md5','../../../config/environment','../../../config/logger','../ami','./rpcDb','redis','localhost','socket.io-emitter','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','stringify','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','preview','booked','clearZombieChannels','recallMe','prototype','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','catch','setMessage','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','totalGlobal','NoSuchNumber','createCustomerHistory','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','countnosuchnumberretry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','uniqueid','\x20Queue','custom:agentconnect','buildObj','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','countbusyretry','countglobal','Busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','CONGESTION','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','outboundRejectCallsDay','countagentrejectretry','AgentReject','unlockContact','disableContact','idContact','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','logAgent','Congestion','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','format','SIP/%s','unmonitored','execRun','unlock','recallme','validateContact','isValid','VoiceQueueId','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active'];(function(_0x2f5f55,_0x50581c){var _0x19a906=function(_0x47ee45){while(--_0x47ee45){_0x2f5f55['push'](_0x2f5f55['shift']());}};_0x19a906(++_0x50581c);}(_0x5350,0x16b));var _0x0535=function(_0x23be36,_0x4acc97){_0x23be36=_0x23be36-0x0;var _0x5f27ee=_0x5350[_0x23be36];return _0x5f27ee;};'use strict';var util=require(_0x0535('0x0'));var _=require(_0x0535('0x1'));var BPromise=require(_0x0535('0x2'));var uuid=require('uuid');var moment=require(_0x0535('0x3'));var md5=require(_0x0535('0x4'));var Redis=require('ioredis');var config=require(_0x0535('0x5'));var logger=require(_0x0535('0x6'))('preview');var loggerAction=require(_0x0535('0x6'))('actionPreview');var ami=require(_0x0535('0x7'));var rpcDb=require(_0x0535('0x8'));var Action=require('./action');var ut=require('./util/util');config[_0x0535('0x9')]=_['defaults'](config[_0x0535('0x9')],{'host':_0x0535('0xa'),'port':0x18eb});var io=require(_0x0535('0xb'))(new Redis(config[_0x0535('0x9')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x42f7dd){this[_0x0535('0xc')]=this[_0x0535('0xc')]?this[_0x0535('0xc')][_0x0535('0xd')](_0x42f7dd):_0x42f7dd();};function Preview(_0x559ad8){this[_0x0535('0xe')]=new Sequence();this[_0x0535('0xf')]=_0x559ad8['voiceQueues'];this[_0x0535('0x10')]=_0x559ad8[_0x0535('0x10')];this[_0x0535('0x11')]={};this['agents']=_0x559ad8[_0x0535('0x12')];this[_0x0535('0x13')]=0x0;ami['on'](_0x0535('0x14'),this['syncOriginateResponse'][_0x0535('0x15')](this));ami['on']('hangup',this[_0x0535('0x16')]['bind'](this));ami['on'](_0x0535('0x17'),this[_0x0535('0x18')][_0x0535('0x15')](this));ami['on'](_0x0535('0x19'),this[_0x0535('0x1a')]['bind'](this));ami['on']('newexten',this[_0x0535('0x1b')][_0x0535('0x15')](this));ami['on'](_0x0535('0x1c'),this[_0x0535('0x1d')]['bind'](this));ami['on'](_0x0535('0x1e'),this[_0x0535('0x1f')][_0x0535('0x15')](this));ami['on'](_0x0535('0x20'),this[_0x0535('0x21')][_0x0535('0x15')](this));this[_0x0535('0x22')](this['campaignsPreview']);}function emit(_0x1a76c0,_0x59488e,_0x26a935){io['to'](_0x1a76c0)[_0x0535('0x23')](_0x59488e,_0x26a935);}function emitCampaignPreview(_0x4c5503){if(_0x4c5503[_0x0535('0x24')]===_0x0535('0x25')){var _0x1fee2b={'id':_0x4c5503['id'],'name':_0x4c5503['name'],'strategy':_0x4c5503[_0x0535('0x26')],'answered':_0x4c5503[_0x0535('0x27')],'available':_0x4c5503[_0x0535('0x28')],'loggedIn':_0x4c5503[_0x0535('0x29')],'pTalking':_0x4c5503[_0x0535('0x2a')],'sumBillable':_0x4c5503[_0x0535('0x2b')],'sumDuration':_0x4c5503[_0x0535('0x2c')],'sumHoldTime':_0x4c5503[_0x0535('0x2d')]||0x0,'talking':_0x4c5503[_0x0535('0x2e')],'total':_0x4c5503[_0x0535('0x2f')],'type':_0x4c5503[_0x0535('0x24')],'unmanaged':_0x4c5503[_0x0535('0x30')],'abandoned':_0x4c5503[_0x0535('0x31')],'waiting':_0x4c5503['waiting'],'loggedInDb':_0x4c5503[_0x0535('0x32')],'dialActive':_0x4c5503[_0x0535('0x33')],'dialMethod':_0x4c5503['dialMethod'],'dialOriginateCallerIdName':_0x4c5503[_0x0535('0x34')],'dialOriginateCallerIdNumber':_0x4c5503[_0x0535('0x35')],'dialOriginateTimeout':_0x4c5503[_0x0535('0x36')],'dialPrefix':_0x4c5503[_0x0535('0x37')],'outboundAnswerAgiCallsDay':_0x4c5503['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4c5503[_0x0535('0x38')],'outboundBlacklistCallsDay':_0x4c5503[_0x0535('0x39')],'outboundBusyCallsDay':_0x4c5503[_0x0535('0x3a')],'outboundCongestionCallsDay':_0x4c5503[_0x0535('0x3b')],'outboundDropCallsDayACS':_0x4c5503[_0x0535('0x3c')],'outboundDropCallsDayCallersExit':_0x4c5503['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x4c5503[_0x0535('0x3d')],'outboundNoAnswerCallsDay':_0x4c5503[_0x0535('0x3e')],'outboundNoSuchCallsDay':_0x4c5503[_0x0535('0x3f')],'outboundOriginateFailureCallsDay':_0x4c5503[_0x0535('0x40')],'outboundReCallsDay':_0x4c5503[_0x0535('0x41')],'outboundRejectCallsDay':_0x4c5503['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4c5503[_0x0535('0x42')],'outboundAbandonedCallsDay':_0x4c5503[_0x0535('0x43')],'predictiveIntervalAnsweredCalls':_0x4c5503[_0x0535('0x44')],'predictiveIntervalAvgHoldtime':_0x4c5503[_0x0535('0x45')],'predictiveIntervalAvgTalktime':_0x4c5503['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4c5503['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4c5503[_0x0535('0x46')],'predictiveIntervalErlangCalls':_0x4c5503[_0x0535('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x4c5503[_0x0535('0x48')],'predictiveIntervalHitRate':_0x4c5503[_0x0535('0x49')],'predictiveIntervalMultiplicativeFactor':_0x4c5503[_0x0535('0x4a')],'predictiveIntervalPauses':_0x4c5503['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4c5503[_0x0535('0x4b')],'predictiveIntervalTotalCalls':_0x4c5503[_0x0535('0x4c')],'message':_0x4c5503[_0x0535('0x4d')],'originated':_0x4c5503[_0x0535('0x4e')],'erlangCalls':_0x4c5503[_0x0535('0x4f')],'erlangCallToSecond':_0x4c5503[_0x0535('0x50')],'erlangAbandonmentRate':_0x4c5503['erlangAbandonmentRate'],'erlangBusyFactor':_0x4c5503['erlangBusyFactor'],'startPredictive':_0x4c5503[_0x0535('0x51')],'startProgressive':_0x4c5503[_0x0535('0x52')]};if(_0x4c5503[_0x0535('0x53')]){_0x1fee2b[_0x0535('0x53')]={'id':_0x4c5503[_0x0535('0x53')]['id'],'name':_0x4c5503[_0x0535('0x53')][_0x0535('0x54')],'active':_0x4c5503[_0x0535('0x53')][_0x0535('0x55')],'callerid':_0x4c5503[_0x0535('0x53')][_0x0535('0x56')]};}if(_0x4c5503['Interval']){_0x1fee2b['Interval']={'id':_0x4c5503[_0x0535('0x57')]['id'],'name':_0x4c5503['Interval'][_0x0535('0x54')]};}var _0x3e0417=md5(JSON[_0x0535('0x58')](_0x1fee2b));if(_0x4c5503['md5']!==_0x3e0417){_0x4c5503['md5']=_0x3e0417;emit(util['format'](_0x0535('0x59'),_0x1fee2b[_0x0535('0x54')]),'voice_queue:save',_0x1fee2b);}}}function emitVoiceQueueChannelRemove(_0x57ad17){logger[_0x0535('0x5a')](_0x0535('0x5b'),JSON[_0x0535('0x58')](_0x57ad17));emit(util['format'](_0x0535('0x59'),_0x57ad17['name']),_0x0535('0x5c'),_0x57ad17);}function notSendMessagesQueue(_0xf95877){if(_0xf95877['sendMessageOneNotActive']){if(_0xf95877[_0x0535('0x4e')]===0x0&&_0xf95877[_0x0535('0x2a')]===0x0){_0xf95877[_0x0535('0x5d')]=![];_0xf95877[_0x0535('0x28')]=0x0;_0xf95877[_0x0535('0x5e')]=0x0;_0xf95877[_0x0535('0x4d')]=_0x0535('0x5f');ut[_0x0535('0x60')](_0x0535('0x61'),_0xf95877['name']+_0x0535('0x62'));}else{_0xf95877[_0x0535('0x4d')]=_0x0535('0x63');ut[_0x0535('0x60')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xf95877[_0x0535('0x54')]+_0x0535('0x64'));}emitCampaignPreview(_0xf95877);}}Preview['prototype'][_0x0535('0x22')]=function(){var _0x3ad9dc=this;setInterval(function(){_0x3ad9dc[_0x0535('0x65')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x315026=this[_0x0535('0xf')];this[_0x0535('0x13')]+=0x1;for(var _0x25a66f in _0x315026){if(_0x315026[_0x0535('0x66')](_0x25a66f)&&(_0x315026[_0x25a66f][_0x0535('0x67')]===_0x0535('0x68')||_0x315026[_0x25a66f][_0x0535('0x67')]===_0x0535('0x69'))&&_0x315026[_0x25a66f]['type']===_0x0535('0x25')){if(this[_0x0535('0x13')]>0x7){this[_0x0535('0x13')]=0x0;this[_0x0535('0x6a')]();}}if(_0x315026[_0x0535('0x66')](_0x25a66f)&&_0x315026[_0x25a66f]['dialMethod']===_0x0535('0x68')&&_0x315026[_0x25a66f][_0x0535('0x24')]===_0x0535('0x25')){if(_0x315026[_0x25a66f][_0x0535('0x33')]){this['setMessage'](_0x315026[_0x25a66f]);this[_0x0535('0x6b')](_0x315026[_0x25a66f]);}else{notSendMessagesQueue(_0x315026[_0x25a66f]);}}}};Preview[_0x0535('0x6c')][_0x0535('0x6d')]=function(_0x2ea665){var _0x11ab06=this;this[_0x0535('0xe')][_0x0535('0x6e')](function(){if(!_[_0x0535('0x6f')](_0x11ab06['actions'][_0x2ea665])){loggerAction[_0x0535('0x5a')](_0x0535('0x70'),_0x2ea665,_0x0535('0x71'),_0x11ab06[_0x0535('0x11')][_0x2ea665][_0x0535('0x72')],_0x0535('0x73'),JSON[_0x0535('0x58')](_0x11ab06['campaignsPreview'][_0x11ab06['actions'][_0x2ea665][_0x0535('0x72')]][_0x0535('0x4e')]),_0x0535('0x74'),JSON[_0x0535('0x58')](_0x11ab06[_0x0535('0xf')][_0x11ab06['actions'][_0x2ea665][_0x0535('0x72')]]['pTalking']),JSON[_0x0535('0x58')](_0x11ab06[_0x0535('0x11')][_0x2ea665][_0x0535('0x75')]),JSON[_0x0535('0x58')](_[_0x0535('0x76')](_0x11ab06[_0x0535('0x11')][_0x2ea665],[_0x0535('0x77'),_0x0535('0x78'),'VoiceQueueId','ListId'])));return ami[_0x0535('0x79')]({'action':_0x0535('0x7a'),'channel':_0x11ab06['actions'][_0x2ea665][_0x0535('0x7b')]})['catch'](function(_0x51bce3){if(_0x51bce3['message']===_0x0535('0x7c')){setTimeout(function(){if(_0x11ab06['actions'][_0x2ea665]){ut[_0x0535('0x7d')](_0x11ab06[_0x0535('0xf')][_0x11ab06[_0x0535('0x11')][_0x2ea665][_0x0535('0x72')]],_0x0535('0x7e'));if(_0x11ab06[_0x0535('0x11')][_0x2ea665][_0x0535('0x75')]===!![]){ut[_0x0535('0x7f')](_0x11ab06['campaignsPreview'][_0x11ab06['actions'][_0x2ea665][_0x0535('0x72')]],_0x0535('0x7e'));ut[_0x0535('0x80')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2ea665,_0x11ab06[_0x0535('0x11')][_0x2ea665]['queue']);}ut[_0x0535('0x80')](_0x0535('0x81')+_0x2ea665,_0x11ab06[_0x0535('0x11')][_0x2ea665][_0x0535('0x72')]);delete _0x11ab06['actions'][_0x2ea665];}},0x2328);}});}});};Preview[_0x0535('0x6c')][_0x0535('0x6a')]=function(){var _0x54a8f1=this;loggerAction[_0x0535('0x5a')](_0x0535('0x82'),_[_0x0535('0x83')](this['actions']));for(var _0x10bd67 in this[_0x0535('0x11')]){if(_0x54a8f1[_0x0535('0x11')][_0x0535('0x66')](_0x10bd67)){_0x54a8f1[_0x0535('0x6d')](_0x10bd67);}}};Preview['prototype'][_0x0535('0x6b')]=function(_0x263c1f){var _0x4d215b=this;rpcDb[_0x0535('0x84')](_0x263c1f['id'],ut[_0x0535('0x85')](this[_0x0535('0x12')]))[_0x0535('0x86')](function(_0x5fa1c3){if(!_[_0x0535('0x6f')](_0x5fa1c3)){for(var _0x1e1196=0x0;_0x1e1196<_0x5fa1c3[_0x0535('0x87')];_0x1e1196+=0x1){if(ut[_0x0535('0x88')](_0x5fa1c3[_0x1e1196][_0x0535('0x89')])<_0x263c1f[_0x0535('0x8a')]*0x3c){if(_0x5fa1c3[_0x1e1196][_0x0535('0x8b')]&&!_0x5fa1c3[_0x1e1196][_0x0535('0x8b')][_0x0535('0x8c')]){_0x4d215b['run'](_0x5fa1c3[_0x1e1196]['id'])[_0x0535('0x86')](ut[_0x0535('0x8d')](_0x0535('0x8e')))['catch'](ut[_0x0535('0x8d')](_0x0535('0x8e')));}else{rpcDb['disableContact'](_0x5fa1c3[_0x1e1196]['id']);}}else{var _0x466876=new Action(_0x5fa1c3[_0x1e1196],_0x263c1f);_0x466876[_0x0535('0x8f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x263c1f[_0x0535('0x41')]+=0x1;ut[_0x0535('0x90')](_0x466876,0x17,_0x0535('0x91'));if(_0x263c1f[_0x0535('0x92')]){rpcDb[_0x0535('0x93')](ut['createBody'](_0x5fa1c3[_0x1e1196]));rpcDb['createCustomerHistory'](_0x466876,_0x0535('0x94'));}else{ut['logCustomer'](_0x466876,0x16,_0x0535('0x95'));rpcDb['createCustomerHistory'](_0x466876,_0x0535('0x96'));rpcDb[_0x0535('0x97')](_0x466876,_0x0535('0x96'));}}}}})[_0x0535('0x98')](ut[_0x0535('0x8d')]('[getContactRecallMe]'));};Preview[_0x0535('0x6c')][_0x0535('0x99')]=function(_0x21b7ec){_0x21b7ec['sendMessageOneNotActive']=!![];if(ut[_0x0535('0x9a')](_0x21b7ec['loggedIn'])){_0x21b7ec[_0x0535('0x4d')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x0535('0x9b')](_0x21b7ec['dialActive'])){_0x21b7ec['message']=_0x0535('0x5f');}else if(!this[_0x0535('0x9c')](_0x21b7ec['Trunk'])){if(!this[_0x0535('0x9c')](_0x21b7ec[_0x0535('0x9d')])){_0x21b7ec['message']=_0x0535('0x9e');}else{_0x21b7ec[_0x0535('0x4d')]=_0x0535('0x9f');}}else{_0x21b7ec[_0x0535('0x4d')]='ACTIVE';}emitCampaignPreview(_0x21b7ec);};Preview[_0x0535('0x6c')]['callProgressDetectingCustomer']=function(_0x2be94b,_0x35c014,_0x20d31d){var _0x5a073b=this;var _0x5beeeb=this[_0x0535('0x11')][_0x35c014];var _0xbcffc3=this[_0x0535('0xf')][_0x5beeeb[_0x0535('0x72')]];var _0x433cb8;if(_0xbcffc3){switch(_0x20d31d){case'1':_0xbcffc3[_0x0535('0x3f')]+=0x1;_0x5beeeb['countnosuchnumberretry']+=0x1;_0x5beeeb['countglobal']=ut[_0x0535('0xa0')](_0x5beeeb);ut['logCustomer'](_0x5beeeb,0x0,_0x0535('0xa1'));rpcDb[_0x0535('0xa2')](_0x5beeeb,_0x0535('0xa3'));if(ut[_0x0535('0xa0')](_0x5beeeb)>=_0xbcffc3['dialGlobalMaxRetry']){_0x433cb8=ut[_0x0535('0xa4')](_0x5beeeb,0xf,_0x0535('0xa5'));rpcDb[_0x0535('0x97')](_0x433cb8,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x5beeeb[_0x0535('0xa6')]>=_0xbcffc3['dialNoSuchNumberMaxRetry']){rpcDb[_0x0535('0x97')](_0x5beeeb,_0x0535('0xa7'));}else{rpcDb[_0x0535('0xa8')](ut[_0x0535('0xa9')](_0x5beeeb,_0x0535('0xa6'),_0xbcffc3[_0x0535('0xaa')]),_0x5beeeb[_0x0535('0xab')],_0x5beeeb[_0x0535('0xac')]);}}delete this[_0x0535('0x11')][_0x2be94b[_0x0535('0xad')]];break;case'ANSWER':var _0x53ac7e=moment()['format'](_0x0535('0xae'));_0x5beeeb[_0x0535('0xaf')]=_0x53ac7e;_0x5beeeb['answertime']=_0x53ac7e;_0x5beeeb[_0x0535('0x75')]=!![];_0xbcffc3[_0x0535('0x2a')]+=0x1;logger[_0x0535('0x5a')]('[syncHangup][talking][increment]',_0x5beeeb[_0x0535('0xb0')],_0x0535('0xb1'),_0xbcffc3[_0x0535('0x54')],_0x0535('0x74'),_0xbcffc3[_0x0535('0x2a')]);ami[_0x0535('0x23')](_0x0535('0xb2'),ut[_0x0535('0xb3')](_0x5beeeb,'connect'));if(_0xbcffc3[_0x0535('0xb4')]){ami[_0x0535('0x23')](_0x0535('0xb5'),ut[_0x0535('0xb6')](_0x5beeeb));}break;case'16':ami[_0x0535('0x23')](_0x0535('0xb7'),ut[_0x0535('0xb3')](_0x5beeeb,_0x0535('0xb8')));emitVoiceQueueChannelRemove(ut[_0x0535('0xb3')](_0x5beeeb,_0x0535('0xb8')));_0xbcffc3[_0x0535('0x38')]+=0x1;_0xbcffc3[_0x0535('0x2f')]+=0x1;_0xbcffc3[_0x0535('0x27')]+=0x1;ut['decrementTalkink'](_0xbcffc3,_0x0535('0xb9'));_0x5beeeb['countglobal']=ut[_0x0535('0xa0')](_0x5beeeb);ut[_0x0535('0x90')](_0x5beeeb,0x4,'Answer');rpcDb['createCustomerHistory'](_0x5beeeb,_0x0535('0xba'));rpcDb[_0x0535('0x97')](_0x5beeeb,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x0535('0xbb')](_0x5beeeb);_0xbcffc3['sumDuration']+=_0x5beeeb['talktime'];_0xbcffc3[_0x0535('0x2b')]+=_0x5beeeb[_0x0535('0xbc')];logger[_0x0535('0x5a')]('[syncHangup][talking][decrement]',_0x5beeeb['uniqueid'],'\x20Queue',_0xbcffc3[_0x0535('0x54')],_0x0535('0x74'),_0xbcffc3[_0x0535('0x2a')]);delete this[_0x0535('0x11')][_0x2be94b[_0x0535('0xad')]];break;case'BUSY':_0xbcffc3[_0x0535('0x3a')]+=0x1;_0x5beeeb[_0x0535('0xbd')]+=0x1;_0x5beeeb[_0x0535('0xbe')]=ut[_0x0535('0xa0')](_0x5beeeb);ut[_0x0535('0x90')](_0x5beeeb,0x5,_0x0535('0xbf'));rpcDb[_0x0535('0xa2')](_0x5beeeb,_0x0535('0xc0'));if(ut[_0x0535('0xa0')](_0x5beeeb)>=_0xbcffc3[_0x0535('0xc1')]){_0x433cb8=ut[_0x0535('0xa4')](_0x5beeeb,0xf,'Global');rpcDb['createCustomerFinal'](_0x433cb8,_0x0535('0xc2'));}else{if(_0x5beeeb['countbusyretry']>=_0xbcffc3[_0x0535('0xc3')]){rpcDb['createCustomerFinal'](_0x5beeeb,_0x0535('0xc0'));}else{rpcDb[_0x0535('0xa8')](ut['scheduledAt'](_0x5beeeb,_0x0535('0xbd'),_0xbcffc3[_0x0535('0xc4')]),_0x5beeeb[_0x0535('0xab')],_0x5beeeb[_0x0535('0xac')]);}}break;case _0x0535('0xc5'):_0xbcffc3[_0x0535('0x3e')]+=0x1;_0x5beeeb[_0x0535('0xc6')]+=0x1;_0x5beeeb[_0x0535('0xbe')]=ut[_0x0535('0xa0')](_0x5beeeb);ut[_0x0535('0x90')](_0x5beeeb,0x3,_0x0535('0xc7'));rpcDb[_0x0535('0xa2')](_0x5beeeb,_0x0535('0xc8'));if(ut[_0x0535('0xa0')](_0x5beeeb)>=_0xbcffc3[_0x0535('0xc1')]){_0x433cb8=ut[_0x0535('0xa4')](_0x5beeeb,0xf,_0x0535('0xa5'));rpcDb[_0x0535('0x97')](_0x433cb8,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x5beeeb['countnoanswerretry']>=_0xbcffc3[_0x0535('0xc9')]){rpcDb[_0x0535('0x97')](_0x5beeeb,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x0535('0xa8')](ut[_0x0535('0xa9')](_0x5beeeb,_0x0535('0xc6'),_0xbcffc3['dialNoAnswerRetryFrequency']),_0x5beeeb[_0x0535('0xab')],_0x5beeeb[_0x0535('0xac')]);}}break;case _0x0535('0xca'):_0xbcffc3[_0x0535('0x3b')]+=0x1;_0x5beeeb['countcongestionretry']+=0x1;_0x5beeeb[_0x0535('0xbe')]=ut[_0x0535('0xa0')](_0x5beeeb);ut[_0x0535('0x90')](_0x5beeeb,0x8,'Congestion');rpcDb[_0x0535('0xa2')](_0x5beeeb,_0x0535('0xcb'));if(ut[_0x0535('0xa0')](_0x5beeeb)>=_0xbcffc3[_0x0535('0xc1')]){_0x433cb8=ut[_0x0535('0xa4')](_0x5beeeb,0xf,'Global');rpcDb[_0x0535('0x97')](_0x433cb8,_0x0535('0xcc'));}else{if(_0x5beeeb[_0x0535('0xcd')]>=_0xbcffc3[_0x0535('0xce')]){rpcDb[_0x0535('0x97')](_0x5beeeb,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0x0535('0xa9')](_0x5beeeb,_0x0535('0xcd'),_0xbcffc3[_0x0535('0xc4')]),_0x5beeeb[_0x0535('0xab')],_0x5beeeb[_0x0535('0xac')]);}}break;case'CANCEL':_0xbcffc3[_0x0535('0xcf')]+=0x1;_0x5beeeb[_0x0535('0xd0')]+=0x1;_0x5beeeb[_0x0535('0xbe')]=ut[_0x0535('0xa0')](_0x5beeeb);ut[_0x0535('0x90')](_0x5beeeb,0x14,_0x0535('0xd1'));rpcDb[_0x0535('0xa2')](_0x5beeeb,'[syncHangupRequest][logAgentReject]');if(_0x5beeeb['unlockAgent']){rpcDb[_0x0535('0xd2')](_0x5beeeb['idContact']);}if(_0x5beeeb[_0x0535('0xac')]){rpcDb[_0x0535('0xd3')](_0x5beeeb[_0x0535('0xd4')]);}break;case _0x0535('0xd5'):_0xbcffc3[_0x0535('0x43')]+=0x1;_0x5beeeb[_0x0535('0xd6')]+=0x1;_0x5beeeb['countglobal']=ut[_0x0535('0xa0')](_0x5beeeb);ut[_0x0535('0x90')](_0x5beeeb,0xb,'Abandoned');rpcDb[_0x0535('0xa2')](_0x5beeeb,_0x0535('0xd7'));if(ut[_0x0535('0xa0')](_0x5beeeb)>=_0xbcffc3[_0x0535('0xc1')]){_0x433cb8=ut[_0x0535('0xa4')](_0x5beeeb,0xf,_0x0535('0xa5'));rpcDb[_0x0535('0x97')](_0x433cb8,_0x0535('0xd7'));}else{if(_0x5beeeb[_0x0535('0xd8')]>=_0xbcffc3[_0x0535('0xd9')]){rpcDb[_0x0535('0x97')](_0x5beeeb,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0x0535('0xa9')](_0x5beeeb,_0x0535('0xd6'),_0xbcffc3[_0x0535('0xda')]),_0x5beeeb[_0x0535('0xab')],_0x5beeeb['activeContact']);}}break;default:if(_0x5beeeb[_0x0535('0x75')]){ut[_0x0535('0x7f')](_0xbcffc3,_0x0535('0xdb'));ut[_0x0535('0x80')](_0x0535('0xdc')+_0xbcffc3[_0x0535('0x54')],_0x2be94b);}_0xbcffc3[_0x0535('0x42')]+=0x1;_0x5beeeb['countglobal']=ut[_0x0535('0xa0')](_0x5beeeb);ut[_0x0535('0x90')](_0x5beeeb,0xc,_0x2be94b[_0x0535('0xdd')]||_0x2be94b[_0x0535('0xde')]);rpcDb['createCustomerHistory'](_0x5beeeb,_0x0535('0xdf'));if(ut[_0x0535('0xa0')](_0x5beeeb)>=_0xbcffc3[_0x0535('0xc1')]){_0x433cb8=ut[_0x0535('0xa4')](_0x5beeeb,0xf,'Global');rpcDb['createCustomerFinal'](_0x433cb8,_0x0535('0xe0'));}else{rpcDb[_0x0535('0x97')](_0x5beeeb,_0x0535('0xe0'));}delete this['actions'][_0x2be94b[_0x0535('0xad')]];}if(!(_0x5beeeb[_0x0535('0x75')]&&_0x20d31d==='16')){ut[_0x0535('0x7d')](_0xbcffc3,'[callProgressDetectingCustomer]');logger[_0x0535('0x5a')]('[originated][decrement][callProgressDetectingCustomer]',_0x5beeeb['uniqueid'],_0x0535('0xb1'),_0xbcffc3['name'],_0x0535('0x73'),_0xbcffc3[_0x0535('0x4e')]);}if(_0x20d31d!==_0x0535('0xe1')){delete this['actions'][_0x2be94b['linkedid']];delete this['actions'][_0x2be94b[_0x0535('0xe2')]];}}};Preview['prototype'][_0x0535('0xe3')]=function(_0x428076,_0x1e5aca,_0x1df8d2){if(_[_0x0535('0xe4')](_0x1e5aca)&&_0x0535('0xe5')!==typeof _0x1e5aca){return;}if(_['isUndefined'](_0x1df8d2)&&'object'!==typeof _0x1df8d2){return;}switch(_0x1df8d2[_0x0535('0xe6')]){case'0':ut['logAgent'](_0x428076,0x0,_0x0535('0xa1'));rpcDb[_0x0535('0xe7')](_0x428076,_0x0535('0xe8'));break;case'3':ut['logAgent'](_0x428076,0x3,'NoAnswer');rpcDb[_0x0535('0xe7')](_0x428076,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x428076,0x5,_0x0535('0xbf'));rpcDb[_0x0535('0xe7')](_0x428076,_0x0535('0xe9'));break;case'8':ut[_0x0535('0xea')](_0x428076,0x8,_0x0535('0xeb'));rpcDb['createAgentHistory'](_0x428076,_0x0535('0xec'));break;case'22':ut[_0x0535('0xea')](_0x428076,0x16,'AnswerAGI');rpcDb[_0x0535('0xe7')](_0x428076,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x0535('0xea')](_0x428076,0xc,_0x1df8d2[_0x0535('0xe6')]);rpcDb['createAgentHistory'](_0x428076,_0x0535('0xec'));}ut[_0x0535('0x7d')](_0x1e5aca,_0x0535('0xed'));logger[_0x0535('0x5a')]('[originated][decrement][callProgressDetectingAgent]',_0x428076['uniqueid'],_0x0535('0xb1'),_0x1e5aca['name'],_0x0535('0x73'),_0x1e5aca['originated']);delete this['actions'][_0x428076['uniqueid']];};Preview[_0x0535('0x6c')][_0x0535('0xee')]=function(_0xa0189a,_0x1e2683,_0x2cb386,_0x5e7603,_0x489127){var _0x431734=this;return new BPromise(function(_0x5ce8a3,_0x47d7c2){if(_[_0x0535('0x6f')](_0x1e2683)||_[_0x0535('0x6f')](_0x1e2683[_0x0535('0xef')])||_[_0x0535('0x6f')](_0x1e2683[_0x0535('0xef')]['phone'])||_[_0x0535('0x6f')](_0x1e2683['VoiceQueueId'])){_0x47d7c2(ut['message'](_0x0535('0xf0'),_0x5e7603,_0x489127));return;}var _0x311daf=uuid['v4']();var _0x21c1ac=_0x431734[_0x0535('0xf')][_0x1e2683['Queue']['name']];var _0x244fd3=_0x2cb386?_0x431734[_0x0535('0x12')][_0x2cb386]['id']:undefined;_0x431734[_0x0535('0x11')][_0x311daf]=new Action(_0x1e2683,_0x21c1ac,_0x311daf,_0x2cb386,_0x244fd3);var _0x17ed18=_0x431734[_0x0535('0x11')][_0x311daf];_0x17ed18[_0x0535('0xab')]=_0x5e7603;_0x17ed18[_0x0535('0xac')]=_0x489127;_0x17ed18[_0x0535('0xf1')]=_0x2cb386;if(_[_0x0535('0xf2')](_0xa0189a)){_0x431734['execCall'](_0x17ed18,_0x21c1ac,_0x1e2683,_0x2cb386)[_0x0535('0x86')](function(_0x41f95a){logger[_0x0535('0x5a')]('[Preview][execCall][success]',_0x0535('0xf3')+_0x17ed18[_0x0535('0x72')]+_0x0535('0xf4')+_0x17ed18['idContact'],JSON[_0x0535('0x58')](_0x41f95a));ami[_0x0535('0x23')](_0x0535('0xf5'),ut[_0x0535('0xb3')](_0x17ed18,'called'));_0x5ce8a3(ut[_0x0535('0x4d')]('Calling'));})[_0x0535('0x98')](function(_0x117a7a){ut[_0x0535('0x60')](_0x0535('0xf6'),_0x117a7a);_0x47d7c2(ut[_0x0535('0x4d')](_0x0535('0xf7'),_0x5e7603,_0x489127));});}else{_0x21c1ac['outboundBlacklistCallsDay']+=0x1;ut[_0x0535('0xf8')](_0x17ed18);rpcDb[_0x0535('0xf9')](_0x17ed18,_0x0535('0xfa'));delete _0x431734[_0x0535('0x11')][_0x311daf];_0x47d7c2(ut[_0x0535('0x4d')]('Contact\x20in\x20black\x20List',_0x5e7603,_0x489127));}});};Preview[_0x0535('0x6c')][_0x0535('0x9c')]=function(_0x5f3e0c){return!_[_0x0535('0x6f')](_0x5f3e0c)&&!_[_0x0535('0x6f')](_0x5f3e0c[_0x0535('0x54')])&&!_['isNil'](_0x5f3e0c[_0x0535('0x55')])&&_0x5f3e0c[_0x0535('0x55')]&&!_[_0x0535('0x6f')](this[_0x0535('0x10')][util[_0x0535('0xfb')](_0x0535('0xfc'),_0x5f3e0c[_0x0535('0x54')])])&&!_[_0x0535('0x6f')](this[_0x0535('0x10')][util[_0x0535('0xfb')](_0x0535('0xfc'),_0x5f3e0c[_0x0535('0x54')])][_0x0535('0x7a')])&&(this[_0x0535('0x10')][util['format']('SIP/%s',_0x5f3e0c[_0x0535('0x54')])]['status']==='reachable'||this[_0x0535('0x10')][util['format'](_0x0535('0xfc'),_0x5f3e0c[_0x0535('0x54')])][_0x0535('0x7a')]===_0x0535('0xfd'));};Preview[_0x0535('0x6c')]['run']=function(_0x7a01c6,_0x3e1660){var _0x4479d4=this;return new BPromise(function(_0x821cf5,_0x2a2d89){_0x4479d4[_0x0535('0xfe')](_0x7a01c6,_0x3e1660)[_0x0535('0x86')](function(_0x3f016b){_0x821cf5(_[_0x0535('0x76')](_0x3f016b,['message']));})[_0x0535('0x98')](function(_0x187fbf){if(_0x187fbf[_0x0535('0xff')]){rpcDb[_0x0535('0xd2')](_0x7a01c6);}if(_0x187fbf[_0x0535('0x55')]){rpcDb[_0x0535('0xd3')](_0x7a01c6);}_0x2a2d89(_[_0x0535('0x76')](_0x187fbf,[_0x0535('0x4d')]));});});};Preview['prototype'][_0x0535('0xfe')]=function(_0x417855,_0x32e7d5){var _0x5d3028=this;return new BPromise(function(_0x1cbfbb,_0x2b89d6){var _0x2ad13b,_0x372848;rpcDb['getContactPreview'](_0x417855)[_0x0535('0x86')](function(_0x17f38d){if(!_[_0x0535('0x6f')](_0x17f38d[0x0])){_0x372848=_0x17f38d[0x0][_0x0535('0x100')]?![]:!![];_0x2ad13b=_0x17f38d[0x0][_0x0535('0x100')]?!![]:![];_0x2ad13b=_0x32e7d5?!![]:_0x2ad13b;}var _0x55367e=_0x5d3028[_0x0535('0x101')](_0x17f38d);if(_0x55367e[_0x0535('0x102')]){rpcDb['checkIsBlackList'](_[_0x0535('0x76')](_0x17f38d[0x0],[_0x0535('0x103'),_0x0535('0x104')]))[_0x0535('0x86')](function(_0x54dec0){_0x5d3028[_0x0535('0xee')](_0x54dec0,_0x17f38d[0x0],_0x32e7d5,_0x372848,_0x2ad13b)[_0x0535('0x86')](function(_0x4b358b){_0x1cbfbb(_0x4b358b);})[_0x0535('0x98')](function(_0x4ebd6d){_0x2b89d6(_0x4ebd6d);});})[_0x0535('0x98')](function(_0x2b8f9a){ut[_0x0535('0x60')](_0x0535('0x105'),_0x2b8f9a);_0x2b89d6(ut[_0x0535('0x4d')](_0x0535('0x106'),_0x372848,_0x2ad13b));});}else{_0x2b89d6(ut[_0x0535('0x4d')](_0x55367e['message'],_0x372848,_0x2ad13b));}})[_0x0535('0x98')](function(_0x53c444){ut[_0x0535('0x60')](_0x0535('0x107'),_0x53c444);_0x2b89d6(ut[_0x0535('0x4d')](_0x0535('0x106'),![],!![]));});});};Preview[_0x0535('0x6c')][_0x0535('0x101')]=function(_0x524613){if(_['isNil'](_0x524613)||_[_0x0535('0xf2')](_0x524613)||!_[_0x0535('0x6f')](_0x524613[0x0][_0x0535('0x8b')])&&_['isNil'](_0x524613[0x0][_0x0535('0x8b')][_0x0535('0x54')])){ut[_0x0535('0x60')](_0x0535('0x108'),_0x524613);return{'isValid':![],'message':_0x0535('0x109')};}var _0x51ec70=this[_0x0535('0xf')][_0x524613[0x0][_0x0535('0x71')][_0x0535('0x54')]];_0x51ec70[_0x0535('0x4d')]=_0x0535('0x9f');if(_[_0x0535('0x6f')](_0x51ec70)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x51ec70);return{'isValid':![],'message':_0x0535('0x10a')};}if(!this[_0x0535('0x9c')](_0x51ec70[_0x0535('0x53')])){ut[_0x0535('0x60')](_0x0535('0x10b'),_0x0535('0x10c')+_0x51ec70[_0x0535('0x54')]+_0x0535('0x10d'));if(!this[_0x0535('0x9c')](_0x51ec70[_0x0535('0x9d')])){ut[_0x0535('0x60')](_0x0535('0x10b'),_0x51ec70['name']+_0x0535('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x51ec70[_0x0535('0x33')])){ut[_0x0535('0x60')](_0x0535('0x10f'),_0x51ec70[_0x0535('0x54')]+_0x0535('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x51ec70[_0x0535('0x54')]+_0x0535('0x110')};}return{'isValid':!![],'message':_0x0535('0x111')};};Preview['prototype'][_0x0535('0x112')]=function(_0x5ce2dd,_0x3723cf,_0x5684b1,_0x3ced22){var _0x54363=this;return new BPromise(function(_0x3c4bdc,_0x153b76){var _0x6993a7=_0x5ce2dd[_0x0535('0xb0')];var _0x160e9e=_0x54363[_0x0535('0x9c')](_0x3723cf[_0x0535('0x53')])?util['format'](_0x0535('0x113'),_0x3723cf['Trunk'][_0x0535('0x54')],_[_0x0535('0x6f')](_0x3723cf[_0x0535('0x37')])?'':_0x3723cf[_0x0535('0x37')][_0x0535('0x114')]()||'',_0x3723cf['dialCutDigit']>0x0?_0x5684b1[_0x0535('0xef')][_0x0535('0x115')][_0x0535('0x116')](_0x3723cf['dialCutDigit']):_0x5684b1[_0x0535('0xef')]['phone']):util[_0x0535('0xfb')]('SIP/%s/%s%s',_[_0x0535('0x6f')](_0x3723cf[_0x0535('0x9d')])?_0x3723cf[_0x0535('0x53')][_0x0535('0x54')]:_0x3723cf['TrunkBackup'][_0x0535('0x54')],_[_0x0535('0x6f')](_0x3723cf[_0x0535('0x37')])?'':_0x3723cf[_0x0535('0x37')]['trim']()||'',_0x3723cf[_0x0535('0x117')]>0x0?_0x5684b1[_0x0535('0xef')]['phone'][_0x0535('0x116')](_0x3723cf[_0x0535('0x117')]):_0x5684b1[_0x0535('0xef')][_0x0535('0x115')]);var _0x588ace=_0x54363[_0x0535('0x9c')](_0x3723cf[_0x0535('0x53')])?ut[_0x0535('0x118')](_0x3723cf[_0x0535('0x53')][_0x0535('0x56')],_0x3723cf['dialOriginateCallerIdName'],_0x3723cf[_0x0535('0x119')]>0x0?ut[_0x0535('0x11a')](_0x3723cf['dialOriginateCallerIdNumber'],_0x3723cf[_0x0535('0x119')]):_0x3723cf[_0x0535('0x35')]):ut[_0x0535('0x118')](_[_0x0535('0x6f')](_0x3723cf[_0x0535('0x9d')])?_0x3723cf[_0x0535('0x53')][_0x0535('0x56')]:_0x3723cf['TrunkBackup'][_0x0535('0x56')],_0x3723cf[_0x0535('0x34')],_0x3723cf['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0535('0x11a')](_0x3723cf['dialOriginateCallerIdNumber'],_0x3723cf['dialRandomLastDigitCallerIdNumber']):_0x3723cf['dialOriginateCallerIdNumber']);if(_0x588ace){_0x5ce2dd[_0x0535('0x11b')]=ut[_0x0535('0x11c')](_0x588ace);_0x5ce2dd[_0x0535('0x11d')]=ut['extractCalleridNumber'](_0x588ace);}var _0x439c9b=ut[_0x0535('0x11e')](_0x3723cf,_0x5684b1,_0x160e9e,_0x588ace,_0x6993a7,_0x5ce2dd);_[_0x0535('0x11f')](_0x5ce2dd,ut[_0x0535('0x120')](_0x439c9b));_0x5ce2dd[_0x0535('0x8f')]=moment()[_0x0535('0xfb')](_0x0535('0xae'));ami['Action'](ut[_0x0535('0x121')](_0x5ce2dd,_0x3723cf,_0x439c9b,_0x5ce2dd['activeContact'],_0x3ced22))[_0x0535('0x86')](function(_0x4c08f9){_0x3723cf[_0x0535('0x4e')]+=0x1;logger[_0x0535('0x5a')](_0x0535('0x122'),_0x6993a7,_0x0535('0xb1'),_0x3723cf[_0x0535('0x54')],'originated:\x20',_0x3723cf[_0x0535('0x4e')]);_0x3c4bdc(_0x4c08f9);})['catch'](function(_0x49723c){ut['logAgent'](_0x5ce2dd,0xe,_0x0535('0x123'));rpcDb['createAgentHistory'](_0x5ce2dd,_0x0535('0x124'));_0x153b76(_0x49723c);});});};Preview['prototype']['syncNewExten']=function(_0x125484){if(this['actions'][_0x125484[_0x0535('0xad')]]){this[_0x0535('0x11')][_0x125484['linkedid']][_0x0535('0x7b')]=_0x125484[_0x0535('0x7b')];}};Preview[_0x0535('0x6c')]['syncOriginateResponse']=function(_0xf1f673){var _0x212c05=this;var _0x7a25d7=this['actions'][_0xf1f673['actionid']];if(_0x7a25d7){if(_0x7a25d7[_0x0535('0xf1')]&&this[_0x0535('0x12')][_0x7a25d7[_0x0535('0xf1')]]){ut['logLookAgent'](_0x7a25d7,this[_0x0535('0x12')][_0x7a25d7[_0x0535('0xf1')]][_0x0535('0x54')],this[_0x0535('0x12')][_0x7a25d7[_0x0535('0xf1')]]['id']);}var _0x1ce53d=_[_0x0535('0x125')](_0x7a25d7);_0x1ce53d['responsetime']=moment()[_0x0535('0xfb')](_0x0535('0xae'));var _0x3aeae6=_0x212c05[_0x0535('0xf')][_0x7a25d7[_0x0535('0x72')]];if(ut[_0x0535('0x126')](_0xf1f673['response'])){if(_0x7a25d7[_0x0535('0xab')]){rpcDb[_0x0535('0xd2')](_0x7a25d7[_0x0535('0xd4')]);}if(_0x7a25d7[_0x0535('0xac')]){rpcDb[_0x0535('0xd3')](_0x7a25d7['idContact']);}ami['emit'](_0x0535('0x127'),ut[_0x0535('0xb3')](_0x7a25d7,_0x0535('0x128')));this[_0x0535('0xe3')](_0x1ce53d,_0x3aeae6,_0xf1f673);}else{_0x7a25d7[_0x0535('0x8f')]=moment()[_0x0535('0xfb')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x0535('0xea')](_0x1ce53d,0x4,_0x0535('0x129'));rpcDb[_0x0535('0xe7')](_0x1ce53d,_0x0535('0x12a'));}}};Preview[_0x0535('0x6c')][_0x0535('0x16')]=function(_0x5ad2a6){var _0x461729=this;var _0x3d4083=this[_0x0535('0x11')][_0x5ad2a6[_0x0535('0xad')]];var _0x5950c9;if(_0x3d4083){_0x5950c9=this[_0x0535('0xf')][_0x3d4083[_0x0535('0x72')]];logger['info'](_0x0535('0x12b'),_0x5ad2a6[_0x0535('0xad')],_0x0535('0xb1'),_0x5950c9[_0x0535('0x54')],_0x0535('0x74'),_0x5950c9[_0x0535('0x2a')]);}if(this[_0x0535('0x11')][_0x5ad2a6[_0x0535('0xad')]]&&_0x5ad2a6['linkedid']!==_0x5ad2a6[_0x0535('0xb0')]){if(_0x5ad2a6[_0x0535('0x12c')]==='16'&&this[_0x0535('0x11')][_0x5ad2a6[_0x0535('0xad')]][_0x0535('0x75')]){this[_0x0535('0x12d')](_0x5ad2a6,_0x5ad2a6[_0x0535('0xad')],_0x5ad2a6[_0x0535('0x12c')]);}else if(this['actions'][_0x5ad2a6['linkedid']][_0x0535('0x75')]){logger[_0x0535('0x5a')](_0x0535('0x12e'),_0x5ad2a6[_0x0535('0xad')],_0x5ad2a6[_0x0535('0x12c')],'\x20Queue',_0x5950c9[_0x0535('0x54')],_0x0535('0x74'),_0x5950c9[_0x0535('0x2a')]);this['callProgressDetectingCustomer'](_0x5ad2a6,_0x5ad2a6[_0x0535('0xad')],_0x5ad2a6[_0x0535('0x12c')]);}}else if(_0x3d4083&&_[_0x0535('0x6f')](_0x3d4083[_0x0535('0x12f')])&&_0x5950c9[_0x0535('0x130')]&&_0x5ad2a6[_0x0535('0xad')]===_0x5ad2a6[_0x0535('0xb0')]&&_['isNil'](_0x5ad2a6[_0x0535('0xe6')])&&_0x5ad2a6[_0x0535('0x12c')]==='16'&&_0x5ad2a6[_0x0535('0x131')]==='6'&&_['isUndefined'](_0x3d4083[_0x0535('0x132')])){if(_0x3d4083[_0x0535('0xab')]){rpcDb['unlockContact'](_0x3d4083['idContact']);}if(_0x3d4083['activeContact']){rpcDb[_0x0535('0xd3')](_0x3d4083[_0x0535('0xd4')]);}_0x5ad2a6[_0x0535('0xe6')]='22';this[_0x0535('0xe3')](_0x3d4083,_0x5950c9,_0x5ad2a6);}else if(_0x3d4083&&_0x3d4083['transfer']){if(_0x5ad2a6[_0x0535('0x12c')]==='16'&&this[_0x0535('0x11')][_0x5ad2a6[_0x0535('0xad')]][_0x0535('0x75')]){logger['info']('[syncHangup][talking][transfer]',_0x5ad2a6[_0x0535('0xad')],_0x5ad2a6[_0x0535('0x12c')],_0x0535('0xb1'),_0x5950c9['name'],_0x0535('0x74'),_0x5950c9[_0x0535('0x2a')]);this[_0x0535('0x12d')](_0x5ad2a6,_0x5ad2a6[_0x0535('0xad')],_0x5ad2a6[_0x0535('0x12c')]);}else if(this[_0x0535('0x11')][_0x5ad2a6[_0x0535('0xad')]][_0x0535('0x75')]){logger[_0x0535('0x5a')](_0x0535('0x12e'),_0x5ad2a6['linkedid'],_0x5ad2a6[_0x0535('0x12c')],_0x0535('0xb1'),_0x5950c9[_0x0535('0x54')],_0x0535('0x74'),_0x5950c9[_0x0535('0x2a')]);this['callProgressDetectingCustomer'](_0x5ad2a6,_0x5ad2a6['linkedid'],_0x5ad2a6['cause']);}}};Preview[_0x0535('0x6c')][_0x0535('0x1a')]=function(_0x103e2a){if(this[_0x0535('0x11')][_0x103e2a[_0x0535('0xe2')]]&&_0x103e2a[_0x0535('0xe2')]!==_0x103e2a['destuniqueid']){this['callProgressDetectingCustomer'](_0x103e2a,_0x103e2a[_0x0535('0xe2')],_0x103e2a['dialstatus']);}};Preview['prototype'][_0x0535('0x18')]=function(_0xef2ae6){if(this['actions'][_0xef2ae6[_0x0535('0xad')]]&&_0xef2ae6[_0x0535('0xad')]!==_0xef2ae6[_0x0535('0xb0')]&&!this[_0x0535('0x11')][_0xef2ae6[_0x0535('0xad')]]['dialAnswer']){if(_0xef2ae6[_0x0535('0x12c')]==='1'){this[_0x0535('0x12d')](_0xef2ae6,_0xef2ae6[_0x0535('0xad')],_0xef2ae6[_0x0535('0x12c')]);}}};Preview[_0x0535('0x6c')][_0x0535('0x133')]=function(_0xa6ec26,_0x5c2ff5,_0x193ef2){if(this[_0x0535('0x11')][_0xa6ec26]){if(_['isNil'](this[_0x0535('0x11')][_0xa6ec26][_0x0535('0x134')])){this[_0x0535('0x11')][_0xa6ec26][_0x0535('0x134')]={};}this[_0x0535('0x11')][_0xa6ec26]['variables'][_0x5c2ff5]=_0x193ef2;}};Preview[_0x0535('0x6c')]['syncVarSet']=function(_0x10b650){try{if(!_[_0x0535('0x6f')](_0x10b650)){if(ut[_0x0535('0x135')](_['keys'](_0x10b650['variable'])[0x0])){this[_0x0535('0x133')](_0x10b650['uniqueid'],_[_0x0535('0x136')](_0x10b650[_0x0535('0x137')])[0x0],_0x10b650[_0x0535('0x138')]);}}}catch(_0x33008d){logger['error'](_0x0535('0x139'),util[_0x0535('0x13a')](_0x33008d,{'showHidden':![],'depth':null}));}};Preview[_0x0535('0x6c')][_0x0535('0x1f')]=function(_0xb6620f){if(_0xb6620f){if(this[_0x0535('0x11')][_0xb6620f[_0x0535('0x13b')]]){this[_0x0535('0x11')][_0xb6620f['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0x0535('0x6c')]['syncBlindTransfer']=function(_0x54fa9d){if(_0x54fa9d){if(this['actions'][_0x54fa9d['transfererlinkedid']]){this[_0x0535('0x11')][_0x54fa9d[_0x0535('0x13c')]][_0x0535('0x132')]=!![];}}};module[_0x0535('0x13d')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 05373a8..2337b16 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 _0xf69d=['../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0xf69d,0xd3));var _0xdf69=function(_0x474760,_0x1df2f6){_0x474760=_0x474760-0x0;var _0x4b12bc=_0xf69d[_0x474760];return _0x4b12bc;};'use strict';var util=require(_0xdf69('0x0'));var BPromise=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var _=require(_0xdf69('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xdf69('0x5'));var cmHopperHistory=require(_0xdf69('0x6'));var cmHopperBlack=require(_0xdf69('0x7'));var voiceQueueRt=require(_0xdf69('0x8'));var agentReportPreview=require(_0xdf69('0x9'));var voiceQueueReport=require(_0xdf69('0xa'));function loggerCatch(_0x2d456f){return function(_0x465b1b){logger[_0xdf69('0xb')](_0x2d456f,util[_0xdf69('0xc')](_0x465b1b,{'showHidden':![],'depth':null}));};}function create(_0x18a08e){return BPromise[_0xdf69('0xd')]()[_0xdf69('0xe')](cmHopperHistory[_0xdf69('0xf')](_0x18a08e))[_0xdf69('0x10')](loggerCatch(_0xdf69('0x11')));}function createAgent(_0x1e0e8d){return BPromise['resolve']()[_0xdf69('0xe')](agentReportPreview[_0xdf69('0xf')](_0x1e0e8d))[_0xdf69('0x10')](loggerCatch(_0xdf69('0x11')));}function moveContact(_0x43ce3d){return BPromise[_0xdf69('0xd')]()['then'](cmHopper['moveContactManagedDialer'](_0x43ce3d,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xdf69('0x12')]=function(_0xbacdc6){return BPromise[_0xdf69('0xd')]()[_0xdf69('0xe')](cmHopperBlack[_0xdf69('0x12')](_0xbacdc6))[_0xdf69('0x10')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xdf69('0x13')]=function(_0x42d448){return BPromise[_0xdf69('0xd')]()[_0xdf69('0xe')](cmHopper['getContactPreview'](_0x42d448))[_0xdf69('0x10')](loggerCatch('[getContactPreview]\x20'));};exports[_0xdf69('0xf')]=function(_0x1899a2,_0x5263a4){create(_0x1899a2)[_0xdf69('0x10')](loggerCatch(_0x5263a4));moveContact(_0x1899a2)[_0xdf69('0x10')](loggerCatch(_0x5263a4));};exports[_0xdf69('0x14')]=function(_0x85d1d,_0x59bfd2){createAgent(_0x85d1d)['catch'](loggerCatch(_0x59bfd2));};exports[_0xdf69('0x15')]=function(_0x15e73a,_0x54df73){create(_0x15e73a)[_0xdf69('0x10')](loggerCatch(_0x54df73));};exports[_0xdf69('0x16')]=function(_0x68fa80,_0x526cbc){moveContact(_0x68fa80)[_0xdf69('0x10')](loggerCatch(_0x526cbc));};exports[_0xdf69('0x17')]=function(_0x4d09d5,_0x56647c,_0x32505a){if(_0x56647c){_0x4d09d5[_0xdf69('0x18')]=null;}if(_0x32505a){_0x4d09d5[_0xdf69('0x19')]=![];}return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x4d09d5))[_0xdf69('0x10')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xdf69('0x1a')]=function(_0x311534){return BPromise[_0xdf69('0xd')]()['then'](cmHopper['countReScheduled'](_0x311534))[_0xdf69('0x10')](loggerCatch(_0xdf69('0x1b')));};exports[_0xdf69('0x1c')]=function(_0x3fd933){return BPromise['resolve']()[_0xdf69('0xe')](cmHopper[_0xdf69('0x1c')]({'UserId':null},_0x3fd933,0x1))[_0xdf69('0x10')](loggerCatch('[unlockContact]\x20'));};exports[_0xdf69('0x1d')]=function(_0x5cfba9){return BPromise['resolve']()['then'](cmHopper['unlockContact']({'active':![]},_0x5cfba9,0x1))[_0xdf69('0x10')](loggerCatch(_0xdf69('0x1e')));};exports['crateCustomerReportQueue']=function(_0x301bd2){var _0xd81d0a={};_0xd81d0a[_0xdf69('0x1f')]=_0x301bd2[_0xdf69('0x1f')];_0xd81d0a[_0xdf69('0x20')]=_0x301bd2[_0xdf69('0x20')];_0xd81d0a[_0xdf69('0x21')]=_0x301bd2[_0xdf69('0x21')];_0xd81d0a[_0xdf69('0x22')]=_0x301bd2[_0xdf69('0x22')];_0xd81d0a[_0xdf69('0x23')]=_0x301bd2[_0xdf69('0x23')];_0xd81d0a[_0xdf69('0x24')]=_0x301bd2[_0xdf69('0x25')];_0xd81d0a[_0xdf69('0x26')]=_0x301bd2[_0xdf69('0x25')];_0xd81d0a[_0xdf69('0x27')]=0x1;_0xd81d0a['queuecallercompleteAt']=_0x301bd2[_0xdf69('0x28')];_0xd81d0a[_0xdf69('0x29')]=_0x301bd2[_0xdf69('0x2a')];_0xd81d0a[_0xdf69('0x2b')]=_0xdf69('0x2c');_0xd81d0a['exten']=_0xdf69('0x2d');_0xd81d0a['holdtime']=0x0;_0xd81d0a[_0xdf69('0x2e')]=0x1;_0xd81d0a[_0xdf69('0x2f')]=_0x301bd2['membername'];_0xd81d0a[_0xdf69('0x30')]='COMPLETED';return BPromise[_0xdf69('0xd')]()[_0xdf69('0xe')](voiceQueueReport[_0xdf69('0x31')](_0xd81d0a))[_0xdf69('0x10')](loggerCatch(_0xdf69('0x32')));};exports['getContactRecallMe']=function(_0x175d5a,_0x50250a){return BPromise[_0xdf69('0xd')]()[_0xdf69('0xe')](cmHopper[_0xdf69('0x33')](_0x175d5a,_0x50250a))[_0xdf69('0x10')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xdf69('0x34')]=function(_0x51f996){return BPromise[_0xdf69('0xd')]()['then'](cmHopper[_0xdf69('0x17')](_0x51f996,!![],!![]))['catch'](loggerCatch(_0xdf69('0x35')));}; \ No newline at end of file +var _0xee14=['uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','[createHistory]\x20','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','disableContact','unlockContact','[activeContact]\x20','type'];(function(_0x44a42d,_0x5f0e34){var _0x49b9be=function(_0x5ed354){while(--_0x5ed354){_0x44a42d['push'](_0x44a42d['shift']());}};_0x49b9be(++_0x5f0e34);}(_0xee14,0x13a));var _0x4ee1=function(_0x113024,_0x226cd3){_0x113024=_0x113024-0x0;var _0x338998=_0xee14[_0x113024];return _0x338998;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x4ee1('0x0'))(_0x4ee1('0x1'));var _=require(_0x4ee1('0x2'));var cmHopper=require(_0x4ee1('0x3'));var cmHopperFinal=require(_0x4ee1('0x4'));var cmHopperHistory=require(_0x4ee1('0x5'));var cmHopperBlack=require(_0x4ee1('0x6'));var voiceQueueRt=require(_0x4ee1('0x7'));var agentReportPreview=require(_0x4ee1('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0xba6d36){return function(_0x573700){logger[_0x4ee1('0x9')](_0xba6d36,util[_0x4ee1('0xa')](_0x573700,{'showHidden':![],'depth':null}));};}function create(_0x187656){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopperHistory[_0x4ee1('0xd')](_0x187656))['catch'](loggerCatch(_0x4ee1('0xe')));}function createAgent(_0x38be25){return BPromise['resolve']()[_0x4ee1('0xc')](agentReportPreview[_0x4ee1('0xd')](_0x38be25))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0xe')));}function moveContact(_0x5cbcb0){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper[_0x4ee1('0x10')](_0x5cbcb0,!![]))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x11')));}exports[_0x4ee1('0x12')]=function(_0x5616d6){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopperBlack[_0x4ee1('0x12')](_0x5616d6))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x13')));};exports[_0x4ee1('0x14')]=function(_0x2ffb2d){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper['getContactPreview'](_0x2ffb2d))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x15')));};exports[_0x4ee1('0xd')]=function(_0x1b1e0e,_0x123c5e){create(_0x1b1e0e)[_0x4ee1('0xf')](loggerCatch(_0x123c5e));moveContact(_0x1b1e0e)[_0x4ee1('0xf')](loggerCatch(_0x123c5e));};exports[_0x4ee1('0x16')]=function(_0x360056,_0x3a0967){createAgent(_0x360056)[_0x4ee1('0xf')](loggerCatch(_0x3a0967));};exports['createCustomerHistory']=function(_0x236215,_0x3db827){create(_0x236215)[_0x4ee1('0xf')](loggerCatch(_0x3db827));};exports[_0x4ee1('0x17')]=function(_0x43f9a2,_0x383ab0){moveContact(_0x43f9a2)['catch'](loggerCatch(_0x383ab0));};exports[_0x4ee1('0x18')]=function(_0x333e96,_0x46611a,_0x3f0d59){if(_0x46611a){_0x333e96[_0x4ee1('0x19')]=null;}if(_0x3f0d59){_0x333e96[_0x4ee1('0x1a')]=![];}return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper[_0x4ee1('0x18')](_0x333e96))[_0x4ee1('0xf')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x14110c){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper[_0x4ee1('0x1b')](_0x14110c))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x1c')));};exports['unlockContact']=function(_0x5cc0b5){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper['unlockContact']({'UserId':null},_0x5cc0b5,0x1))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x1d')));};exports[_0x4ee1('0x1e')]=function(_0x215949){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper[_0x4ee1('0x1f')]({'active':![]},_0x215949,0x1))['catch'](loggerCatch(_0x4ee1('0x20')));};exports['crateCustomerReportQueue']=function(_0x4746c2){var _0x4ec408={};_0x4ec408[_0x4ee1('0x21')]=_0x4746c2[_0x4ee1('0x21')];_0x4ec408[_0x4ee1('0x22')]=_0x4746c2[_0x4ee1('0x22')];_0x4ec408[_0x4ee1('0x23')]=_0x4746c2['calleridnum'];_0x4ec408[_0x4ee1('0x24')]=_0x4746c2['calleridname'];_0x4ec408[_0x4ee1('0x25')]=_0x4746c2[_0x4ee1('0x25')];_0x4ec408[_0x4ee1('0x26')]=_0x4746c2[_0x4ee1('0x27')];_0x4ec408[_0x4ee1('0x28')]=_0x4746c2['answertime'];_0x4ec408[_0x4ee1('0x29')]=0x1;_0x4ec408[_0x4ee1('0x2a')]=_0x4746c2[_0x4ee1('0x2b')];_0x4ec408[_0x4ee1('0x2c')]=_0x4746c2[_0x4ee1('0x2d')];_0x4ec408[_0x4ee1('0x2e')]='from-sip';_0x4ec408['exten']=_0x4ee1('0x2f');_0x4ec408[_0x4ee1('0x30')]=0x0;_0x4ec408[_0x4ee1('0x31')]=0x1;_0x4ec408['lastAssignedTo']=_0x4746c2[_0x4ee1('0x2d')];_0x4ec408[_0x4ee1('0x32')]=_0x4ee1('0x33');return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](voiceQueueReport[_0x4ee1('0x34')](_0x4ec408))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x35')));};exports[_0x4ee1('0x36')]=function(_0x3cc595,_0x4445d0){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper['getContactRecallMe'](_0x3cc595,_0x4445d0))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x37')));};exports[_0x4ee1('0x38')]=function(_0x50539f){return BPromise['resolve']()[_0x4ee1('0xc')](cmHopper[_0x4ee1('0x18')](_0x50539f,!![],!![]))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x39')));}; \ 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 fca1a6b..ff2d707 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 _0x1cf4=['totalGlobal','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','buildAcw','interface','agentReadyId','not_inuse','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countbusyretry','countglobal','callback','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','match','extractCalleridNumber','util','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','membername','UserId','YYYY-MM-DD\x20HH:mm:ss','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1cf4,0xbf));var _0x41cf=function(_0x136c4a,_0x1021b9){_0x136c4a=_0x136c4a-0x0;var _0x2f9703=_0x1cf4[_0x136c4a];return _0x2f9703;};'use strict';var util=require(_0x41cf('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x41cf('0x1'))(_0x41cf('0x2'));var ipAgi=process['env'][_0x41cf('0x3')]||_0x41cf('0x4');function getSeconds(_0x446a26,_0x32902d){var _0x29b5da=moment(_0x446a26)[_0x41cf('0x5')](0x0);var _0x35c567=moment(_0x32902d)[_0x41cf('0x5')](0x0);return _0x29b5da[_0x41cf('0x6')](_0x35c567,_0x41cf('0x7'));}exports[_0x41cf('0x8')]=function(_0x4c0f01){return function(_0x1e8fae){logger[_0x41cf('0x9')](_0x4c0f01,util[_0x41cf('0xa')](_0x1e8fae,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x225704,_0xc0b925){logger[_0x41cf('0xb')](_0x225704,util[_0x41cf('0xa')](_0xc0b925,{'showHidden':![],'depth':null}));};exports[_0x41cf('0xc')]=function(_0x228c05,_0x73fd6d){logger[_0x41cf('0x9')](_0x228c05,util[_0x41cf('0xa')](_0x73fd6d,{'showHidden':![],'depth':null}));};exports[_0x41cf('0xd')]=function(_0x369414){return function(_0x4090a6){logger[_0x41cf('0xb')](_0x369414,util['inspect'](_0x4090a6,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x56cca1,_0x4475c6,_0x54f47b){return{'message':_0x56cca1,'unlock':_0x4475c6,'active':_0x54f47b};};exports[_0x41cf('0xe')]=function(_0x5169bb,_0x54e30b,_0x15ca2f){if(!_['isUndefined'](_0x15ca2f)&&_0x41cf('0xf')===typeof _0x15ca2f&&!_[_0x41cf('0x10')](_0x15ca2f)){if(!_[_0x41cf('0x11')](_0x54e30b)&&'string'===typeof _0x54e30b&&!_[_0x41cf('0x10')](_0x54e30b)){return util[_0x41cf('0x12')]('\x22%s\x22\x20<%s>',_0x54e30b,_0x15ca2f);}return util[_0x41cf('0x12')](_0x41cf('0x13'),_0x15ca2f,_0x15ca2f);}if(!_['isUndefined'](_0x5169bb)&&'string'===typeof _0x5169bb&&!_['isEmpty'](_0x5169bb)){return _0x5169bb;}return _0x41cf('0x14');};exports[_0x41cf('0x15')]=function(_0x24a7b3){if(_[_0x41cf('0x16')](_0x24a7b3)){return![];}return _0x24a7b3;};exports['addVariables']=function(_0x462db9,_0x45fd4b,_0x36b80a,_0x4a0030,_0x3e4b1d,_0x4096e1){var _0x2a6146={'XMD-QUEUE':_0x45fd4b[_0x41cf('0x17')]?_0x45fd4b['Queue'][_0x41cf('0x18')]:'','XMD-CALLERID':_0x4a0030,'XMD-CALLERID-PREVIEW':_0x4096e1?util[_0x41cf('0x12')](_0x41cf('0x13'),_0x4096e1[_0x41cf('0x19')],_0x4096e1[_0x41cf('0x1a')]):_0x4a0030,'XMD-DIALID':_0x3e4b1d,'XMD-CONTACTID':_0x45fd4b[_0x41cf('0x1b')],'XMD-CDRTYPE':_0x41cf('0x1c'),'CALLERID(all)':_0x4a0030,'XMD-VOICEQUEUEID':_0x45fd4b['VoiceQueueId'],'XMD-DIALCHANNEL':_0x36b80a,'XMD-DIALTIMEOUT':_0x462db9['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x41cf('0x12')](_0x41cf('0x1d'),_0x462db9[_0x41cf('0x1e')]?'g':'',_['isEmpty'](_0x462db9[_0x41cf('0x1f')])?'':_0x41cf('0x20')),'XMD-DIALURL':_0x462db9['dialPreviewUrl']||'','XMD-AGI':_0x462db9[_0x41cf('0x21')]?util[_0x41cf('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x462db9[_0x41cf('0x21')]):_0x41cf('0x22'),'XMD-AGIAFTER':_0x462db9[_0x41cf('0x1e')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x462db9[_0x41cf('0x1e')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x4096e1?_0x4096e1[_0x41cf('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x4096e1?_0x4096e1[_0x41cf('0x24')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x462db9[_0x41cf('0x1f')])){_0x2a6146[util[_0x41cf('0x12')]('%s',_0x41cf('0x25'))]=_0x462db9[_0x41cf('0x1f')];_0x2a6146[util['format']('%s',_0x41cf('0x26'))]=_0x3e4b1d;}if(_0x45fd4b&&_0x45fd4b['Contact']){for(var _0x436f5f in _0x45fd4b['Contact']){if(_0x45fd4b[_0x41cf('0x27')][_0x41cf('0x28')](_0x436f5f)){if(!_[_0x41cf('0x16')](_0x45fd4b[_0x41cf('0x27')][_0x436f5f])&&_0x436f5f!=='id'&&_0x436f5f!==_0x41cf('0x29')&&_0x436f5f!==_0x41cf('0x2a')&&_0x436f5f!==_0x41cf('0x2b')){_0x2a6146[util[_0x41cf('0x12')](_0x41cf('0x2c'),_0x41cf('0x2d'),_[_0x41cf('0x2e')](_0x436f5f))]=_0x45fd4b[_0x41cf('0x27')][_0x436f5f];}}}}return _0x2a6146;};exports[_0x41cf('0x2f')]=function(_0x1e5d89){var _0x3ff048={};for(var _0x9a910d in _0x1e5d89){if(_0x1e5d89[_0x41cf('0x28')](_0x9a910d)){_0x3ff048[util[_0x41cf('0x12')]('%s',_['toLower'](_0x9a910d))]=_0x1e5d89[_0x9a910d];}}return{'variables':_0x3ff048};};exports[_0x41cf('0x30')]=function(_0x49a398,_0x4b1399){if(!_[_0x41cf('0x16')](_0x49a398)){if(_0x49a398[_0x41cf('0x28')](_0x41cf('0x31'))){if(_0x49a398['originated']>0x0){_0x49a398['originated']-=0x1;}else{logger[_0x41cf('0x9')](_0x41cf('0x32'),_0x4b1399);}}}else{logger['error'](_0x41cf('0x33'),_0x4b1399);}};exports[_0x41cf('0x34')]=function(_0xd161b7){var _0x77ccf5=moment()[_0x41cf('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0xd161b7[_0x41cf('0x35')]=0xd;_0xd161b7[_0x41cf('0x36')]=_0x41cf('0x37');_0xd161b7['starttime']=_0x77ccf5;_0xd161b7[_0x41cf('0x38')]=_0x77ccf5;_0xd161b7[_0x41cf('0x39')]=_0x77ccf5;};exports[_0x41cf('0x3a')]=function(_0x47983e,_0xf1ef52,_0xb93d0){var _0x2ab128=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x47983e[_0x41cf('0x35')]=_0xf1ef52;_0x47983e[_0x41cf('0x36')]=_0xb93d0;_0x47983e['responsetime']=_0x2ab128;_0x47983e[_0x41cf('0x3b')]=getSeconds(_0x47983e[_0x41cf('0x38')],_0x47983e[_0x41cf('0x3c')]);};exports[_0x41cf('0x3d')]=function(_0x1733fb,_0x500d92,_0x23ee47){_0x1733fb[_0x41cf('0x3e')]=_0x500d92;_0x1733fb[_0x41cf('0x3f')]=_0x23ee47;};exports['logCustomer']=function(_0x47c87d,_0x5e1ce1,_0x33df68){var _0x37e334=moment()[_0x41cf('0x12')](_0x41cf('0x40'));_0x47c87d[_0x41cf('0x35')]=_0x5e1ce1;_0x47c87d[_0x41cf('0x36')]=_0x33df68;_0x47c87d['responsetime']=_0x47c87d['responsetime']?_0x47c87d['responsetime']:_0x37e334;_0x47c87d[_0x41cf('0x39')]=_0x47c87d[_0x41cf('0x39')]?_0x47c87d['endtime']:_0x37e334;_0x47c87d[_0x41cf('0x3b')]=getSeconds(_0x47c87d[_0x41cf('0x38')]||0x0,_0x47c87d[_0x41cf('0x3c')]||0x0);_0x47c87d[_0x41cf('0x41')]=_0x47c87d['answertime']?getSeconds(_0x47c87d[_0x41cf('0x39')],_0x47c87d[_0x41cf('0x42')]):0x0;};exports[_0x41cf('0x43')]=function(_0x239ba9){return _0x239ba9===_0x41cf('0x44');};exports[_0x41cf('0x45')]=function(_0x3d6042,_0x582fa2,_0x22e303,_0x1226e2,_0x19ba6f){var _0x4a3434=_0x1226e2?_0x41cf('0x46'):_0x3d6042['calleridname'];_0x4a3434=_0x19ba6f?_0x41cf('0x47'):_0x4a3434;return{'actionid':_0x3d6042[_0x41cf('0x48')],'action':_0x41cf('0x49'),'channel':_0x3d6042[_0x41cf('0x4a')],'callerid':util[_0x41cf('0x12')](_0x41cf('0x13'),_0x4a3434,_0x3d6042[_0x41cf('0x1a')]),'Exten':'xcally-motion-preview','Context':_0x41cf('0x4b'),'Priority':'1','variable':_0x22e303,'timeout':(_0x582fa2[_0x41cf('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3d6042['uniqueid']};};exports[_0x41cf('0x4d')]=function(_0x2b2eab){return _0x2b2eab['countbusyretry']+_0x2b2eab[_0x41cf('0x4e')]+_0x2b2eab[_0x41cf('0x4f')];};exports[_0x41cf('0x50')]=function(_0x12c3cc){var _0x3e7ec3=_[_0x41cf('0x51')](_0x12c3cc);_0x3e7ec3[_0x41cf('0x35')]=0xf;_0x3e7ec3[_0x41cf('0x36')]=_0x41cf('0x52');return _0x3e7ec3;};exports[_0x41cf('0x53')]=function(_0x33a5f0,_0x3bf492,_0xa6dfbe){var _0xf92fc7={};_0xf92fc7[_0x3bf492]=_0x33a5f0[_0x3bf492];_0xf92fc7[_0x41cf('0x54')]=![];_0xf92fc7[_0x41cf('0x55')]=moment()[_0x41cf('0x56')](_0xa6dfbe,_0x41cf('0x57'))[_0x41cf('0x12')](_0x41cf('0x40'));_0xf92fc7['ContactId']=_0x33a5f0[_0x41cf('0x1b')];_0xf92fc7[_0x41cf('0x58')]=_0x33a5f0[_0x41cf('0x58')];_0xf92fc7[_0x41cf('0x59')]=_0x33a5f0[_0x41cf('0x59')]||undefined;return _0xf92fc7;};exports['decrementTalkink']=function(_0x5e4df7,_0xb856f6){if(!_[_0x41cf('0x16')](_0x5e4df7)){if(_0x5e4df7['pTalking']>0x0){_0x5e4df7['pTalking']-=0x1;}else{logger['error'](_0xb856f6,_0x41cf('0x5a'));}}else{logger[_0x41cf('0x9')](_0xb856f6,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x41cf('0x5b')]=function(_0x5501fa){if(_0x5501fa<=0x0){return!![];}return![];};exports['buildObj']=function(_0x38a50d,_0x7243f){_0x38a50d[_0x41cf('0x5c')]=_0x7243f;_0x38a50d[_0x41cf('0x18')]=_0x38a50d[_0x41cf('0x5d')];_0x38a50d['interface']=_0x38a50d[_0x41cf('0x4a')];return _0x38a50d;};exports[_0x41cf('0x5e')]=function(_0x20d9ad){var _0x14972d={};_0x14972d[_0x41cf('0x5d')]=_0x20d9ad['queue'];_0x14972d[_0x41cf('0x5f')]=_0x20d9ad[_0x41cf('0x4a')];_0x14972d[_0x41cf('0x48')]=_0x20d9ad[_0x41cf('0x48')];return _0x14972d;};exports[_0x41cf('0x60')]=function(_0x1d1807){var _0x4b3650=[];for(var _0x293535 in _0x1d1807){if(_0x1d1807[_0x41cf('0x28')](_0x293535)){if(!_[_0x41cf('0x16')](_0x1d1807[_0x293535])&&_0x1d1807[_0x293535]['state']===_0x41cf('0x61')&&_0x1d1807[_0x293535]['status']==='reachable'){_0x4b3650['push'](_0x1d1807[_0x293535]['id']);}}}return _0x4b3650;};exports['getDiff']=function(_0x1d1021){var _0x5b567b=moment()[_0x41cf('0x5')](0x0);var _0x1df984=moment(_0x1d1021)[_0x41cf('0x5')](0x0);return _0x5b567b[_0x41cf('0x6')](_0x1df984,_0x41cf('0x7'));};exports[_0x41cf('0x62')]=function(_0x216c77){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x216c77[_0x41cf('0x1b')],'ListId':_0x216c77['ListId'],'VoiceQueueId':_0x216c77[_0x41cf('0x59')]||undefined,'CampaignId':_0x216c77[_0x41cf('0x63')]||undefined};};exports[_0x41cf('0x64')]=function(_0x412578){if(_0x412578==='uniqueid'||_0x412578===_0x41cf('0x65')||_0x412578===_0x41cf('0x5d')||_0x412578==='type'||_0x412578===_0x41cf('0x66')||_0x412578===_0x41cf('0x67')||_0x412578===_0x41cf('0x3e')||_0x412578==='channelAgent'||_0x412578===_0x41cf('0x19')||_0x412578===_0x41cf('0x54')||_0x412578===_0x41cf('0x1a')||_0x412578===_0x41cf('0x55')||_0x412578===_0x41cf('0x68')||_0x412578===_0x41cf('0x4e')||_0x412578===_0x41cf('0x4f')||_0x412578===_0x41cf('0x69')||_0x412578===_0x41cf('0x6a')||_0x412578==='callbackuniqueid'||_0x412578==='callbackat'||_0x412578===_0x41cf('0x6b')||_0x412578===_0x41cf('0x1b')||_0x412578==='ListId'||_0x412578===_0x41cf('0x3f')||_0x412578===_0x41cf('0x59')||_0x412578===_0x41cf('0x6c')||_0x412578===_0x41cf('0x6d')||_0x412578===_0x41cf('0x6e')||_0x412578==='xmd-phone'||_0x412578===_0x41cf('0x6f')||_0x412578===_0x41cf('0x70')||_0x412578===_0x41cf('0x71')||_0x412578==='xmd-dialoptions'||_0x412578===_0x41cf('0x72')||_0x412578===_0x41cf('0x73')||_0x412578===_0x41cf('0x74')||_0x412578===_0x41cf('0x75')||_0x412578==='xmd-callerid'||_0x412578==='xmd-agiafter'||_0x412578==='xmd-agi'||_0x412578===_0x41cf('0x76')||_0x412578===_0x41cf('0x77')||_0x412578===_0x41cf('0x78')||_0x412578===_0x41cf('0x79')||_0x412578===_0x41cf('0x7a')||_0x412578==='rtpaudioqoslossbridged'||_0x412578===_0x41cf('0x7b')||_0x412578===_0x41cf('0x7c')||_0x412578===_0x41cf('0x76')||_0x412578===_0x41cf('0x77')||_0x412578===_0x41cf('0x78')||_0x412578===_0x41cf('0x79')||_0x412578==='rtpaudioqosloss'||_0x412578===_0x41cf('0x7d')||_0x412578==='rtpaudioqosrtt'||_0x412578==='rtpaudioqosrttbridged'||_0x412578===_0x41cf('0x7e')||_0x412578===_0x41cf('0x7f')||_0x412578==='state'||_0x412578==='statedesc'){return![];}return!![];};exports[_0x41cf('0x80')]=function(_0x4a6ecd,_0x599bbd){var _0x260a90,_0x2956ee,_0x232926;if(_0x599bbd<=0x0){_0x599bbd=0x1;}_0x260a90=new RegExp(_0x41cf('0x81')+_0x599bbd+'}$');_0x2956ee=Math['pow'](0xa,_0x599bbd-0x1);_0x232926=Math[_0x41cf('0x82')](0xa,_0x599bbd)-0x1;return util[_0x41cf('0x12')]('%s',_['replace'](_0x4a6ecd,_0x260a90,_['random'](_0x2956ee,_0x232926)));};exports[_0x41cf('0x83')]=function(_0x281dee){var _0x202824=_0x281dee[_0x41cf('0x84')](/"(.*?)"/);return _0x202824?_0x202824[0x1]:_0x281dee;};exports[_0x41cf('0x85')]=function(_0x441bf8){var _0x3ec0b9=_0x441bf8[_0x41cf('0x84')](/<(.*?)>/);return _0x3ec0b9?_0x3ec0b9[0x1]:_0x441bf8;}; \ No newline at end of file +var _0xf6b3=['getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','inspect','logger','loggerError','error','logger2','info','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','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','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logLookAgent','membername','UserId','logCustomer','ringtime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','Global','scheduledAt','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','interface','queue','not_inuse','status','reachable','getDiff','diff','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqos','bridgepeer','bridgepvtcallid'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xf6b3,0x97));var _0x3f6b=function(_0x35615a,_0x316487){_0x35615a=_0x35615a-0x0;var _0x3d6e88=_0xf6b3[_0x35615a];return _0x3d6e88;};'use strict';var util=require(_0x3f6b('0x0'));var _=require('lodash');var moment=require(_0x3f6b('0x1'));var logger=require(_0x3f6b('0x2'))(_0x3f6b('0x3'));var ipAgi=process[_0x3f6b('0x4')][_0x3f6b('0x5')]||_0x3f6b('0x6');function getSeconds(_0x4be215,_0x38d26a){var _0x2c4c64=moment(_0x4be215)['milliseconds'](0x0);var _0xdfde01=moment(_0x38d26a)[_0x3f6b('0x7')](0x0);return _0x2c4c64['diff'](_0xdfde01,_0x3f6b('0x8'));}exports[_0x3f6b('0x9')]=function(_0x3499cf){return function(_0x18a383){logger['error'](_0x3499cf,util[_0x3f6b('0xa')](_0x18a383,{'showHidden':![],'depth':null}));};};exports[_0x3f6b('0xb')]=function(_0x18f0af,_0x41eca3){logger['info'](_0x18f0af,util[_0x3f6b('0xa')](_0x41eca3,{'showHidden':![],'depth':null}));};exports[_0x3f6b('0xc')]=function(_0x4072a9,_0x3c3958){logger[_0x3f6b('0xd')](_0x4072a9,util[_0x3f6b('0xa')](_0x3c3958,{'showHidden':![],'depth':null}));};exports[_0x3f6b('0xe')]=function(_0xd03ba9){return function(_0xdd7c7){logger[_0x3f6b('0xf')](_0xd03ba9,util[_0x3f6b('0xa')](_0xdd7c7,{'showHidden':![],'depth':null}));};};exports[_0x3f6b('0x10')]=function(_0x5b282a,_0x50767f,_0x52405a){return{'message':_0x5b282a,'unlock':_0x50767f,'active':_0x52405a};};exports[_0x3f6b('0x11')]=function(_0x4d0acd,_0x44504b,_0x1564a2){if(!_['isUndefined'](_0x1564a2)&&_0x3f6b('0x12')===typeof _0x1564a2&&!_[_0x3f6b('0x13')](_0x1564a2)){if(!_['isUndefined'](_0x44504b)&&_0x3f6b('0x12')===typeof _0x44504b&&!_[_0x3f6b('0x13')](_0x44504b)){return util[_0x3f6b('0x14')](_0x3f6b('0x15'),_0x44504b,_0x1564a2);}return util[_0x3f6b('0x14')](_0x3f6b('0x15'),_0x1564a2,_0x1564a2);}if(!_[_0x3f6b('0x16')](_0x4d0acd)&&'string'===typeof _0x4d0acd&&!_[_0x3f6b('0x13')](_0x4d0acd)){return _0x4d0acd;}return _0x3f6b('0x17');};exports[_0x3f6b('0x18')]=function(_0x1c33db){if(_['isNil'](_0x1c33db)){return![];}return _0x1c33db;};exports[_0x3f6b('0x19')]=function(_0x2559ee,_0x39d1c7,_0x520c52,_0xe9cbc9,_0x1bf9c9,_0x2f7055){var _0x5bba74={'XMD-QUEUE':_0x39d1c7[_0x3f6b('0x1a')]?_0x39d1c7[_0x3f6b('0x1a')][_0x3f6b('0x1b')]:'','XMD-CALLERID':_0xe9cbc9,'XMD-CALLERID-PREVIEW':_0x2f7055?util['format'](_0x3f6b('0x15'),_0x2f7055[_0x3f6b('0x1c')],_0x2f7055[_0x3f6b('0x1d')]):_0xe9cbc9,'XMD-DIALID':_0x1bf9c9,'XMD-CONTACTID':_0x39d1c7[_0x3f6b('0x1e')],'XMD-CDRTYPE':_0x3f6b('0x1f'),'CALLERID(all)':_0xe9cbc9,'XMD-VOICEQUEUEID':_0x39d1c7[_0x3f6b('0x20')],'XMD-DIALCHANNEL':_0x520c52,'XMD-DIALTIMEOUT':_0x2559ee[_0x3f6b('0x21')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x3f6b('0x22'),_0x2559ee[_0x3f6b('0x23')]?'g':'',_[_0x3f6b('0x13')](_0x2559ee['monitor_format'])?'':_0x3f6b('0x24')),'XMD-DIALURL':_0x2559ee[_0x3f6b('0x25')]||'','XMD-AGI':_0x2559ee[_0x3f6b('0x26')]?util[_0x3f6b('0x14')](_0x3f6b('0x27'),ipAgi,_0x2559ee[_0x3f6b('0x26')]):_0x3f6b('0x28'),'XMD-AGIAFTER':_0x2559ee[_0x3f6b('0x23')]?util['format'](_0x3f6b('0x27'),ipAgi,_0x2559ee[_0x3f6b('0x23')]):_0x3f6b('0x28'),'XMD-ORIGINATECALLERIDNUM':_0x2f7055?_0x2f7055[_0x3f6b('0x29')]:'','XMD-ORIGINATECALLERIDNAME':_0x2f7055?_0x2f7055[_0x3f6b('0x2a')]:'','XMD-DESTINATION':_0x3f6b('0x2b')};if(!_[_0x3f6b('0x13')](_0x2559ee[_0x3f6b('0x2c')])){_0x5bba74[util[_0x3f6b('0x14')]('%s',_0x3f6b('0x2d'))]=_0x2559ee['monitor_format'];_0x5bba74[util[_0x3f6b('0x14')]('%s',_0x3f6b('0x2e'))]=_0x1bf9c9;}if(_0x39d1c7&&_0x39d1c7[_0x3f6b('0x2f')]){for(var _0x3e96a5 in _0x39d1c7[_0x3f6b('0x2f')]){if(_0x39d1c7['Contact'][_0x3f6b('0x30')](_0x3e96a5)){if(!_[_0x3f6b('0x31')](_0x39d1c7['Contact'][_0x3e96a5])&&_0x3e96a5!=='id'&&_0x3e96a5!==_0x3f6b('0x32')&&_0x3e96a5!=='createdAt'&&_0x3e96a5!=='updatedAt'){_0x5bba74[util[_0x3f6b('0x14')](_0x3f6b('0x33'),_0x3f6b('0x34'),_[_0x3f6b('0x35')](_0x3e96a5))]=_0x39d1c7['Contact'][_0x3e96a5];}}}}return _0x5bba74;};exports['toLowerVariables']=function(_0x327889){var _0x4497dc={};for(var _0x30233b in _0x327889){if(_0x327889[_0x3f6b('0x30')](_0x30233b)){_0x4497dc[util['format']('%s',_[_0x3f6b('0x36')](_0x30233b))]=_0x327889[_0x30233b];}}return{'variables':_0x4497dc};};exports[_0x3f6b('0x37')]=function(_0x3f1944,_0x12e31e){if(!_[_0x3f6b('0x31')](_0x3f1944)){if(_0x3f1944[_0x3f6b('0x30')](_0x3f6b('0x38'))){if(_0x3f1944[_0x3f6b('0x38')]>0x0){_0x3f1944[_0x3f6b('0x38')]-=0x1;}else{logger[_0x3f6b('0xd')](_0x3f6b('0x39'),_0x12e31e);}}}else{logger[_0x3f6b('0xd')](_0x3f6b('0x3a'),_0x12e31e);}};exports[_0x3f6b('0x3b')]=function(_0x2dfd9d){var _0x1155e7=moment()[_0x3f6b('0x14')](_0x3f6b('0x3c'));_0x2dfd9d[_0x3f6b('0x3d')]=0xd;_0x2dfd9d[_0x3f6b('0x3e')]=_0x3f6b('0x3f');_0x2dfd9d[_0x3f6b('0x40')]=_0x1155e7;_0x2dfd9d[_0x3f6b('0x41')]=_0x1155e7;_0x2dfd9d[_0x3f6b('0x42')]=_0x1155e7;};exports['logAgent']=function(_0x4f5718,_0x435479,_0x52bb72){var _0x26d5b0=moment()[_0x3f6b('0x14')](_0x3f6b('0x3c'));_0x4f5718[_0x3f6b('0x3d')]=_0x435479;_0x4f5718['statedesc']=_0x52bb72;_0x4f5718[_0x3f6b('0x41')]=_0x26d5b0;_0x4f5718['ringtime']=getSeconds(_0x4f5718[_0x3f6b('0x41')],_0x4f5718[_0x3f6b('0x40')]);};exports[_0x3f6b('0x43')]=function(_0x479500,_0x1587b6,_0x4b60d0){_0x479500[_0x3f6b('0x44')]=_0x1587b6;_0x479500[_0x3f6b('0x45')]=_0x4b60d0;};exports[_0x3f6b('0x46')]=function(_0x32d978,_0x4c98b1,_0x235c28){var _0xaae061=moment()[_0x3f6b('0x14')](_0x3f6b('0x3c'));_0x32d978['state']=_0x4c98b1;_0x32d978[_0x3f6b('0x3e')]=_0x235c28;_0x32d978[_0x3f6b('0x41')]=_0x32d978[_0x3f6b('0x41')]?_0x32d978[_0x3f6b('0x41')]:_0xaae061;_0x32d978[_0x3f6b('0x42')]=_0x32d978[_0x3f6b('0x42')]?_0x32d978['endtime']:_0xaae061;_0x32d978[_0x3f6b('0x47')]=getSeconds(_0x32d978[_0x3f6b('0x41')]||0x0,_0x32d978[_0x3f6b('0x40')]||0x0);_0x32d978['talktime']=_0x32d978[_0x3f6b('0x48')]?getSeconds(_0x32d978[_0x3f6b('0x42')],_0x32d978['answertime']):0x0;};exports[_0x3f6b('0x49')]=function(_0x501d16){return _0x501d16===_0x3f6b('0x4a');};exports[_0x3f6b('0x4b')]=function(_0x4c24ba,_0x439a43,_0x264ac6,_0x423a10,_0x3354fd){var _0x48e7d1=_0x423a10?'RECALL':_0x4c24ba[_0x3f6b('0x1c')];_0x48e7d1=_0x3354fd?_0x3f6b('0x4c'):_0x48e7d1;return{'actionid':_0x4c24ba[_0x3f6b('0x4d')],'action':_0x3f6b('0x4e'),'channel':_0x4c24ba[_0x3f6b('0x4f')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x48e7d1,_0x4c24ba['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x3f6b('0x50'),'Priority':'1','variable':_0x264ac6,'timeout':(_0x439a43['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4c24ba['uniqueid']};};exports[_0x3f6b('0x51')]=function(_0x8fea5e){return _0x8fea5e[_0x3f6b('0x52')]+_0x8fea5e[_0x3f6b('0x53')]+_0x8fea5e[_0x3f6b('0x54')];};exports[_0x3f6b('0x55')]=function(_0x45be4b){var _0x5a9b37=_['clone'](_0x45be4b);_0x5a9b37['state']=0xf;_0x5a9b37[_0x3f6b('0x3e')]=_0x3f6b('0x56');return _0x5a9b37;};exports[_0x3f6b('0x57')]=function(_0x175b36,_0x4d99b4,_0xa4fc0){var _0x110238={};_0x110238[_0x4d99b4]=_0x175b36[_0x4d99b4];_0x110238['active']=![];_0x110238[_0x3f6b('0x58')]=moment()[_0x3f6b('0x59')](_0xa4fc0,_0x3f6b('0x5a'))[_0x3f6b('0x14')](_0x3f6b('0x3c'));_0x110238[_0x3f6b('0x1e')]=_0x175b36[_0x3f6b('0x1e')];_0x110238[_0x3f6b('0x5b')]=_0x175b36[_0x3f6b('0x5b')];_0x110238['VoiceQueueId']=_0x175b36['VoiceQueueId']||undefined;return _0x110238;};exports[_0x3f6b('0x5c')]=function(_0x16a730,_0x566a22){if(!_[_0x3f6b('0x31')](_0x16a730)){if(_0x16a730[_0x3f6b('0x5d')]>0x0){_0x16a730['pTalking']-=0x1;}else{logger[_0x3f6b('0xd')](_0x566a22,_0x3f6b('0x5e'));}}else{logger[_0x3f6b('0xd')](_0x566a22,_0x3f6b('0x5f'));}};exports['IsNotLoggedIn']=function(_0x146225){if(_0x146225<=0x0){return!![];}return![];};exports[_0x3f6b('0x60')]=function(_0x31493b,_0xe88c6d){_0x31493b[_0x3f6b('0x61')]=_0xe88c6d;_0x31493b[_0x3f6b('0x1b')]=_0x31493b['queue'];_0x31493b[_0x3f6b('0x62')]=_0x31493b['channelAgent'];return _0x31493b;};exports['buildAcw']=function(_0xc5ac8e){var _0x8eaf0={};_0x8eaf0[_0x3f6b('0x63')]=_0xc5ac8e[_0x3f6b('0x63')];_0x8eaf0[_0x3f6b('0x62')]=_0xc5ac8e[_0x3f6b('0x4f')];_0x8eaf0['uniqueid']=_0xc5ac8e['uniqueid'];return _0x8eaf0;};exports['agentReadyId']=function(_0x4677db){var _0x17ef65=[];for(var _0x3fc199 in _0x4677db){if(_0x4677db[_0x3f6b('0x30')](_0x3fc199)){if(!_[_0x3f6b('0x31')](_0x4677db[_0x3fc199])&&_0x4677db[_0x3fc199][_0x3f6b('0x3d')]===_0x3f6b('0x64')&&_0x4677db[_0x3fc199][_0x3f6b('0x65')]===_0x3f6b('0x66')){_0x17ef65['push'](_0x4677db[_0x3fc199]['id']);}}}return _0x17ef65;};exports[_0x3f6b('0x67')]=function(_0xc82421){var _0x39a1d6=moment()[_0x3f6b('0x7')](0x0);var _0x44449c=moment(_0xc82421)['milliseconds'](0x0);return _0x39a1d6[_0x3f6b('0x68')](_0x44449c,_0x3f6b('0x8'));};exports['createBody']=function(_0x47ba32){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x47ba32[_0x3f6b('0x1e')],'ListId':_0x47ba32[_0x3f6b('0x5b')],'VoiceQueueId':_0x47ba32[_0x3f6b('0x20')]||undefined,'CampaignId':_0x47ba32[_0x3f6b('0x69')]||undefined};};exports[_0x3f6b('0x6a')]=function(_0x24c80c){if(_0x24c80c===_0x3f6b('0x4d')||_0x24c80c===_0x3f6b('0x6b')||_0x24c80c===_0x3f6b('0x63')||_0x24c80c===_0x3f6b('0x6c')||_0x24c80c===_0x3f6b('0x6d')||_0x24c80c===_0x3f6b('0x6e')||_0x24c80c===_0x3f6b('0x44')||_0x24c80c==='channelAgent'||_0x24c80c===_0x3f6b('0x1c')||_0x24c80c===_0x3f6b('0x6f')||_0x24c80c===_0x3f6b('0x1d')||_0x24c80c===_0x3f6b('0x58')||_0x24c80c===_0x3f6b('0x52')||_0x24c80c===_0x3f6b('0x53')||_0x24c80c===_0x3f6b('0x54')||_0x24c80c==='countglobal'||_0x24c80c===_0x3f6b('0x70')||_0x24c80c===_0x3f6b('0x71')||_0x24c80c==='callbackat'||_0x24c80c===_0x3f6b('0x72')||_0x24c80c==='ContactId'||_0x24c80c==='ListId'||_0x24c80c===_0x3f6b('0x45')||_0x24c80c===_0x3f6b('0x20')||_0x24c80c===_0x3f6b('0x73')||_0x24c80c===_0x3f6b('0x74')||_0x24c80c===_0x3f6b('0x75')||_0x24c80c===_0x3f6b('0x76')||_0x24c80c===_0x3f6b('0x77')||_0x24c80c===_0x3f6b('0x78')||_0x24c80c==='xmd-dialtimeout'||_0x24c80c===_0x3f6b('0x79')||_0x24c80c===_0x3f6b('0x7a')||_0x24c80c===_0x3f6b('0x7b')||_0x24c80c===_0x3f6b('0x7c')||_0x24c80c==='xmd-cdrtype'||_0x24c80c==='xmd-callerid'||_0x24c80c===_0x3f6b('0x7d')||_0x24c80c==='xmd-agi'||_0x24c80c==='rtpaudioqos'||_0x24c80c===_0x3f6b('0x7e')||_0x24c80c===_0x3f6b('0x7f')||_0x24c80c===_0x3f6b('0x80')||_0x24c80c===_0x3f6b('0x81')||_0x24c80c===_0x3f6b('0x82')||_0x24c80c===_0x3f6b('0x83')||_0x24c80c==='rtpaudioqosrttbridged'||_0x24c80c===_0x3f6b('0x84')||_0x24c80c===_0x3f6b('0x7e')||_0x24c80c===_0x3f6b('0x7f')||_0x24c80c===_0x3f6b('0x80')||_0x24c80c===_0x3f6b('0x81')||_0x24c80c===_0x3f6b('0x82')||_0x24c80c===_0x3f6b('0x83')||_0x24c80c==='rtpaudioqosrttbridged'||_0x24c80c===_0x3f6b('0x85')||_0x24c80c===_0x3f6b('0x86')||_0x24c80c===_0x3f6b('0x3d')||_0x24c80c==='statedesc'){return![];}return!![];};exports[_0x3f6b('0x87')]=function(_0x5697d1,_0x43d910){var _0x1858e3,_0x4a5412,_0x51c0e3;if(_0x43d910<=0x0){_0x43d910=0x1;}_0x1858e3=new RegExp(_0x3f6b('0x88')+_0x43d910+'}$');_0x4a5412=Math['pow'](0xa,_0x43d910-0x1);_0x51c0e3=Math[_0x3f6b('0x89')](0xa,_0x43d910)-0x1;return util[_0x3f6b('0x14')]('%s',_[_0x3f6b('0x8a')](_0x5697d1,_0x1858e3,_[_0x3f6b('0x8b')](_0x4a5412,_0x51c0e3)));};exports[_0x3f6b('0x8c')]=function(_0xbd4b5d){var _0x148aa5=_0xbd4b5d[_0x3f6b('0x8d')](/"(.*?)"/);return _0x148aa5?_0x148aa5[0x1]:_0xbd4b5d;};exports[_0x3f6b('0x8e')]=function(_0x414181){var _0x5d1e8e=_0x414181['match'](/<(.*?)>/);return _0x5d1e8e?_0x5d1e8e[0x1]:_0x414181;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 437afb0..2891a78 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(_0x39e567,_0x5a6d94){var _0x22ced7=function(_0x1f0bdf){while(--_0x1f0bdf){_0x39e567['push'](_0x39e567['shift']());}};_0x22ced7(++_0x5a6d94);}(_0x5f2f,0x73));var _0xf5f2=function(_0x135084,_0xe947af){_0x135084=_0x135084-0x0;var _0x3c769a=_0x5f2f[_0x135084];return _0x3c769a;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x7a54=['number','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x5a7a9e,_0x73438a){var _0x553dd=function(_0x6de615){while(--_0x6de615){_0x5a7a9e['push'](_0x5a7a9e['shift']());}};_0x553dd(++_0x73438a);}(_0x7a54,0x106));var _0x47a5=function(_0x4bdd6e,_0x4212b4){_0x4bdd6e=_0x4bdd6e-0x0;var _0x1880b1=_0x7a54[_0x4bdd6e];return _0x1880b1;};'use strict';exports[_0x47a5('0x0')]={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x47a5('0x2'),'required':![]},'paused':{'type':_0x47a5('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]}};exports[_0x47a5('0x4')]={'interface':{'type':_0x47a5('0x1'),'required':!![]},'paused':{'type':_0x47a5('0x3')},'reason':{'type':'string','required':![]}};exports[_0x47a5('0x5')]={'module':{'type':'string','required':![]}};exports[_0x47a5('0x6')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x47a5('0x7')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 515e111..b47f6af 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 _0xefb9=['outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','agents','length','isNil','initTelephones','isUndefined','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','templates','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','vtigerAccounts','dynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','groupBy','uniqueid','unmanaged','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','duration','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/freshsalesAccount','telephones','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','format','hasOwnProperty','interface','SIP/%s','name','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay'];(function(_0x513f8a,_0x457c54){var _0x231680=function(_0x22b245){while(--_0x22b245){_0x513f8a['push'](_0x513f8a['shift']());}};_0x231680(++_0x457c54);}(_0xefb9,0x1bf));var _0x9efb=function(_0x5decec,_0x4e5761){_0x5decec=_0x5decec-0x0;var _0x35e1b4=_0xefb9[_0x5decec];return _0x35e1b4;};'use strict';var BPromise=require(_0x9efb('0x0'));var util=require(_0x9efb('0x1'));var _=require(_0x9efb('0x2'));var moment=require('moment');var Agent=require(_0x9efb('0x3'));var Telephone=require(_0x9efb('0x4'));var Trunk=require(_0x9efb('0x5'));var VoiceQueue=require(_0x9efb('0x6'));var Trigger=require(_0x9efb('0x7'));var Template=require(_0x9efb('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x9efb('0x9'));var SalesforceAccount=require(_0x9efb('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x9efb('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x9efb('0xc'));var VtigerAccount=require(_0x9efb('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x9efb('0xe'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0x9efb('0xf')]={};this['trunks']={};this[_0x9efb('0x10')]={};this[_0x9efb('0x11')]={};this[_0x9efb('0x12')]={};this['templates']={};this[_0x9efb('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9efb('0x14')]={};this[_0x9efb('0x15')]={};this[_0x9efb('0x16')]={};this[_0x9efb('0x17')]={};this[_0x9efb('0x18')]={};this[_0x9efb('0x19')]={};this[_0x9efb('0x1a')]={};this[_0x9efb('0x1b')]={};this[_0x9efb('0x1c')]={};this['zohoAccounts']={};this[_0x9efb('0x1d')]={};this['vtigerAccounts']={};this[_0x9efb('0x1e')]={};this['dynamics365Accounts']={};this[_0x9efb('0x1f')]={};this[_0x9efb('0x20')]={};};function freeIsNotKey(_0x4290c7,_0x41c0a9,_0x241f4f){var _0x21591f=_[_0x9efb('0x21')](_0x4290c7,function(_0xbe279d,_0x171127){return _0xbe279d[_0x241f4f];});for(var _0x4db2a3 in _0x41c0a9){if(_0x41c0a9['hasOwnProperty'](_0x4db2a3)){if(!_0x21591f[_0x4db2a3]){delete _0x41c0a9[_0x4db2a3];}}}}function freeIsNotKeySip(_0x17a6d7,_0x47e1ac){var _0xb754c7=_[_0x9efb('0x21')](_0x17a6d7,function(_0x268a4d,_0x1f7638){return util[_0x9efb('0x22')]('SIP/%s',_0x268a4d['name']);});for(var _0x1c4529 in _0x47e1ac){if(_0x47e1ac[_0x9efb('0x23')](_0x1c4529)){if(!_0xb754c7[_0x1c4529]){delete _0x47e1ac[_0x1c4529];}}}}function freeIsNotKeyAgent(_0x163dad,_0x3ff43f){var _0x5e4d08=_['mapKeys'](_0x163dad,function(_0x72adae,_0x499a41){var _0x15e35e=_['isNil'](_0x72adae[_0x9efb('0x24')])?util[_0x9efb('0x22')](_0x9efb('0x25'),_0x72adae[_0x9efb('0x26')]):_0x72adae[_0x9efb('0x24')];return _0x15e35e;});for(var _0x6c758c in _0x3ff43f){if(_0x3ff43f['hasOwnProperty'](_0x6c758c)){if(!_0x5e4d08[_0x6c758c]){delete _0x3ff43f[_0x6c758c];}}}}function clearVoiceCallReports(_0x30e67a){_0x30e67a[_0x9efb('0x27')]=0x0;_0x30e67a[_0x9efb('0x28')]=0x0;_0x30e67a[_0x9efb('0x29')]=0x0;_0x30e67a[_0x9efb('0x2a')]=0x0;_0x30e67a[_0x9efb('0x2b')]=0x0;}function clearCampaigns(_0x448a24){if(!_[_0x9efb('0x2c')](_0x448a24)){for(var _0x9f6247 in _0x448a24){if(_0x448a24[_0x9efb('0x23')](_0x9f6247)){_0x448a24[_0x9f6247][_0x9efb('0x2d')]=0x0;_0x448a24[_0x9f6247]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2842c2){if(!_[_0x9efb('0x2c')](_0x2842c2)){for(var _0x17c745 in _0x2842c2){if(_0x2842c2[_0x9efb('0x23')](_0x17c745)){_0x2842c2[_0x17c745][_0x9efb('0x27')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x28')]=0x0;_0x2842c2[_0x17c745]['unmanaged']=0x0;_0x2842c2[_0x17c745][_0x9efb('0x2e')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x29')]=0x0;_0x2842c2[_0x17c745]['sumDuration']=0x0;_0x2842c2[_0x17c745][_0x9efb('0x2b')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x2f')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x30')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x31')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x32')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x33')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x34')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x35')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x36')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x37')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x38')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x39')]=0x0;_0x2842c2[_0x17c745]['outboundReCallsDay']=0x0;_0x2842c2[_0x17c745][_0x9efb('0x2f')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x3a')]=0x0;_0x2842c2[_0x17c745][_0x9efb('0x3b')]=!![];}}}}Realtime['prototype'][_0x9efb('0x3c')]=function(_0x412a30,_0x252490){for(var _0x10d43a in _0x252490){if(_0x412a30[_0x9efb('0x23')](_0x10d43a)){_0x412a30[_0x10d43a]=_0x252490[_0x10d43a];}}};Realtime[_0x9efb('0x3d')][_0x9efb('0x3e')]=function(){var _0x51af4a=this;return function(_0x3d67bc){if(_0x3d67bc){freeIsNotKeyAgent(_0x3d67bc,_0x51af4a[_0x9efb('0x3f')]);for(var _0x355ee5=0x0,_0x11c353={},_0x282237={};_0x355ee5<_0x3d67bc[_0x9efb('0x40')];_0x355ee5+=0x1){_0x11c353=_0x3d67bc[_0x355ee5];var _0x45e7ae=_[_0x9efb('0x41')](_0x11c353[_0x9efb('0x24')])?util[_0x9efb('0x22')](_0x9efb('0x25'),_0x11c353[_0x9efb('0x26')]):_0x11c353[_0x9efb('0x24')];if(_['isUndefined'](_0x51af4a['agents'][_0x45e7ae])){_0x51af4a[_0x9efb('0x3f')][_0x45e7ae]=new Agent(_0x11c353);}else{_0x51af4a[_0x9efb('0x3c')](_0x51af4a[_0x9efb('0x3f')][_0x45e7ae],_0x11c353);}}}return _0x51af4a[_0x9efb('0x3f')];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x42')]=function(){var _0x318ee8=this;return function(_0x3479ff){if(_0x3479ff){freeIsNotKeySip(_0x3479ff,_0x318ee8[_0x9efb('0xf')]);for(var _0xff4961=0x0,_0x839d7c={},_0x18382b={};_0xff4961<_0x3479ff[_0x9efb('0x40')];_0xff4961+=0x1){_0x839d7c=_0x3479ff[_0xff4961];if(_[_0x9efb('0x43')](_0x318ee8['telephones'][util[_0x9efb('0x22')]('SIP/%s',_0x839d7c[_0x9efb('0x26')])])){_0x318ee8[_0x9efb('0xf')][util['format'](_0x9efb('0x25'),_0x839d7c[_0x9efb('0x26')])]=new Telephone(_0x839d7c);}else{_0x318ee8['mergeFromDatabase'](_0x318ee8[_0x9efb('0xf')][util[_0x9efb('0x22')](_0x9efb('0x25'),_0x839d7c[_0x9efb('0x26')])],_0x839d7c);}}}return _0x318ee8['telephones'];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x44')]=function(){var _0x1212b9=this;return function(_0x38d084){if(_0x38d084){freeIsNotKeySip(_0x38d084,_0x1212b9[_0x9efb('0x45')]);for(var _0x8b7a2c=0x0,_0x1b1d45={},_0x22c1c0={};_0x8b7a2c<_0x38d084['length'];_0x8b7a2c+=0x1){_0x1b1d45=_0x38d084[_0x8b7a2c];if(_['isUndefined'](_0x1212b9[_0x9efb('0x45')][util[_0x9efb('0x22')](_0x9efb('0x25'),_0x1b1d45[_0x9efb('0x26')])])){_0x1212b9[_0x9efb('0x45')][util[_0x9efb('0x22')](_0x9efb('0x25'),_0x1b1d45['name'])]=new Trunk(_0x1b1d45);}else{_0x1212b9[_0x9efb('0x3c')](_0x1212b9[_0x9efb('0x45')][util[_0x9efb('0x22')]('SIP/%s',_0x1b1d45[_0x9efb('0x26')])],_0x1b1d45);}}}return _0x1212b9[_0x9efb('0x45')];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x46')]=function(){var _0x5c3b0e=this;return function(_0x535e96){if(_0x535e96){freeIsNotKey(_0x535e96,_0x5c3b0e[_0x9efb('0x10')],_0x9efb('0x26'));for(var _0x5b5e92=0x0,_0x4ed404={},_0x51913f={};_0x5b5e92<_0x535e96[_0x9efb('0x40')];_0x5b5e92+=0x1){_0x4ed404=_0x535e96[_0x5b5e92];if(_[_0x9efb('0x43')](_0x5c3b0e[_0x9efb('0x10')][_0x4ed404['name']])){_0x5c3b0e[_0x9efb('0x10')][_0x4ed404[_0x9efb('0x26')]]=new VoiceQueue(_0x4ed404);}else{_0x5c3b0e[_0x9efb('0x3c')](_0x5c3b0e[_0x9efb('0x10')][_0x4ed404[_0x9efb('0x26')]],_0x4ed404);}}}return _0x5c3b0e[_0x9efb('0x10')];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x47')]=function(){var _0x47f5a1=this;return function(_0x1c1f69){if(_0x1c1f69){freeIsNotKey(_0x1c1f69,_0x47f5a1[_0x9efb('0x11')],'id');for(var _0x1e7173=0x0,_0x1fb44e={},_0x2176b={};_0x1e7173<_0x1c1f69['length'];_0x1e7173+=0x1){_0x1fb44e=_0x1c1f69[_0x1e7173];if(_['isUndefined'](_0x47f5a1[_0x9efb('0x11')][_0x1fb44e['id']])){_0x47f5a1[_0x9efb('0x11')][_0x1fb44e['id']]=new Trigger(_0x1fb44e);}else{_0x47f5a1[_0x9efb('0x3c')](_0x47f5a1[_0x9efb('0x11')][_0x1fb44e['id']],_0x1fb44e);}}}return _0x47f5a1[_0x9efb('0x11')];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x48')]=function(){var _0x40c980=this;return function(_0x386610){if(_0x386610){freeIsNotKey(_0x386610,_0x40c980[_0x9efb('0x49')],'id');for(var _0x4bac4a=0x0,_0x3f8c6c={},_0x37f87a={};_0x4bac4a<_0x386610[_0x9efb('0x40')];_0x4bac4a+=0x1){_0x3f8c6c=_0x386610[_0x4bac4a];if(_[_0x9efb('0x43')](_0x40c980[_0x9efb('0x49')][_0x3f8c6c['id']])){_0x40c980['templates'][_0x3f8c6c['id']]=new Template(_0x3f8c6c);}else{_0x40c980[_0x9efb('0x3c')](_0x40c980[_0x9efb('0x49')][_0x3f8c6c['id']],_0x3f8c6c);}}}return _0x40c980[_0x9efb('0x49')];};};Realtime[_0x9efb('0x3d')]['initZendeskAccounts']=function(){var _0x5904b1=this;return function(_0x2d0013){if(_0x2d0013){freeIsNotKey(_0x2d0013,_0x5904b1['zendeskAccounts'],'id');for(var _0x4ec929=0x0,_0x24041d={},_0x1f037f={};_0x4ec929<_0x2d0013[_0x9efb('0x40')];_0x4ec929+=0x1){_0x24041d=_0x2d0013[_0x4ec929];if(_[_0x9efb('0x43')](_0x5904b1['zendeskAccounts'][_0x24041d['id']])){_0x5904b1[_0x9efb('0x19')][_0x24041d['id']]=new ZendeskAccount(_0x24041d);}else{_0x5904b1[_0x9efb('0x3c')](_0x5904b1['zendeskAccounts'][_0x24041d['id']],_0x24041d);}}}return _0x5904b1[_0x9efb('0x19')];};};Realtime[_0x9efb('0x3d')]['initSalesforceAccounts']=function(){var _0x327aac=this;return function(_0x445421){if(_0x445421){freeIsNotKey(_0x445421,_0x327aac[_0x9efb('0x1a')],'id');for(var _0xd281ac=0x0,_0xe63dff={},_0x4e9ad9={};_0xd281ac<_0x445421[_0x9efb('0x40')];_0xd281ac+=0x1){_0xe63dff=_0x445421[_0xd281ac];if(_[_0x9efb('0x43')](_0x327aac['salesforceAccounts'][_0xe63dff['id']])){_0x327aac[_0x9efb('0x1a')][_0xe63dff['id']]=new SalesforceAccount(_0xe63dff);}else{_0x327aac[_0x9efb('0x3c')](_0x327aac[_0x9efb('0x1a')][_0xe63dff['id']],_0xe63dff);}}}return _0x327aac['salesforceAccounts'];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x4a')]=function(){var _0x1294b4=this;return function(_0x4e7d58){if(_0x4e7d58){freeIsNotKey(_0x4e7d58,_0x1294b4['freshdeskAccounts'],'id');for(var _0x5259d4=0x0,_0x10972f={},_0x5247bb={};_0x5259d4<_0x4e7d58[_0x9efb('0x40')];_0x5259d4+=0x1){_0x10972f=_0x4e7d58[_0x5259d4];if(_['isUndefined'](_0x1294b4[_0x9efb('0x1c')][_0x10972f['id']])){_0x1294b4[_0x9efb('0x1c')][_0x10972f['id']]=new FreshdeskAccount(_0x10972f);}else{_0x1294b4['mergeFromDatabase'](_0x1294b4[_0x9efb('0x1c')][_0x10972f['id']],_0x10972f);}}}return _0x1294b4[_0x9efb('0x1c')];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x4b')]=function(){var _0x490495=this;return function(_0x2c8147){if(_0x2c8147){freeIsNotKey(_0x2c8147,_0x490495[_0x9efb('0x4c')],'id');for(var _0x5dbb0a=0x0,_0x140e68={},_0x40d280={};_0x5dbb0a<_0x2c8147[_0x9efb('0x40')];_0x5dbb0a+=0x1){_0x140e68=_0x2c8147[_0x5dbb0a];if(_[_0x9efb('0x43')](_0x490495[_0x9efb('0x4c')][_0x140e68['id']])){_0x490495[_0x9efb('0x4c')][_0x140e68['id']]=new ZohoAccount(_0x140e68);}else{_0x490495[_0x9efb('0x3c')](_0x490495[_0x9efb('0x4c')][_0x140e68['id']],_0x140e68);}}}return _0x490495[_0x9efb('0x4c')];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x4d')]=function(){var _0x46bec8=this;return function(_0xa1ba70){if(_0xa1ba70){freeIsNotKey(_0xa1ba70,_0x46bec8[_0x9efb('0x1d')],'id');for(var _0x3743c1=0x0,_0x1e0a16={},_0x466958={};_0x3743c1<_0xa1ba70[_0x9efb('0x40')];_0x3743c1+=0x1){_0x1e0a16=_0xa1ba70[_0x3743c1];if(_['isUndefined'](_0x46bec8[_0x9efb('0x1d')][_0x1e0a16['id']])){_0x46bec8[_0x9efb('0x1d')][_0x1e0a16['id']]=new DeskAccount(_0x1e0a16);}else{_0x46bec8['mergeFromDatabase'](_0x46bec8['deskAccounts'][_0x1e0a16['id']],_0x1e0a16);}}}return _0x46bec8[_0x9efb('0x1d')];};};Realtime[_0x9efb('0x3d')]['initSugarcrmAccounts']=function(){var _0x770789=this;return function(_0x3199d7){if(_0x3199d7){freeIsNotKey(_0x3199d7,_0x770789[_0x9efb('0x1b')],'id');for(var _0x1906c8=0x0,_0x33219b={},_0x556048={};_0x1906c8<_0x3199d7[_0x9efb('0x40')];_0x1906c8+=0x1){_0x33219b=_0x3199d7[_0x1906c8];if(_[_0x9efb('0x43')](_0x770789[_0x9efb('0x1b')][_0x33219b['id']])){_0x770789[_0x9efb('0x1b')][_0x33219b['id']]=new SugarcrmAccount(_0x33219b);}else{_0x770789['mergeFromDatabase'](_0x770789[_0x9efb('0x1b')][_0x33219b['id']],_0x33219b);}}}return _0x770789[_0x9efb('0x1b')];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x4e')]=function(){var _0x1bdc79=this;return function(_0x524b70){if(_0x524b70){freeIsNotKey(_0x524b70,_0x1bdc79['vtigerAccounts'],'id');for(var _0x47ab4e=0x0,_0xf0b0e7={},_0xa222dc={};_0x47ab4e<_0x524b70[_0x9efb('0x40')];_0x47ab4e+=0x1){_0xf0b0e7=_0x524b70[_0x47ab4e];if(_[_0x9efb('0x43')](_0x1bdc79['vtigerAccounts'][_0xf0b0e7['id']])){_0x1bdc79[_0x9efb('0x4f')][_0xf0b0e7['id']]=new VtigerAccount(_0xf0b0e7);}else{_0x1bdc79[_0x9efb('0x3c')](_0x1bdc79['vtigerAccounts'][_0xf0b0e7['id']],_0xf0b0e7);}}}return _0x1bdc79['vtigerAccounts'];};};Realtime[_0x9efb('0x3d')]['initServicenowAccounts']=function(){var _0x1581e3=this;return function(_0x29d68b){if(_0x29d68b){freeIsNotKey(_0x29d68b,_0x1581e3[_0x9efb('0x1e')],'id');for(var _0xdf0506=0x0,_0x103976={},_0x13d0b6={};_0xdf0506<_0x29d68b[_0x9efb('0x40')];_0xdf0506+=0x1){_0x103976=_0x29d68b[_0xdf0506];if(_['isUndefined'](_0x1581e3[_0x9efb('0x1e')][_0x103976['id']])){_0x1581e3[_0x9efb('0x1e')][_0x103976['id']]=new ServicenowAccount(_0x103976);}else{_0x1581e3[_0x9efb('0x3c')](_0x1581e3[_0x9efb('0x1e')][_0x103976['id']],_0x103976);}}}return _0x1581e3[_0x9efb('0x1e')];};};Realtime[_0x9efb('0x3d')]['initDynamics365Accounts']=function(){var _0xa391bf=this;return function(_0x5513e4){if(_0x5513e4){freeIsNotKey(_0x5513e4,_0xa391bf[_0x9efb('0x50')],'id');for(var _0x459892=0x0,_0x59fc17={},_0x1650f7={};_0x459892<_0x5513e4[_0x9efb('0x40')];_0x459892+=0x1){_0x59fc17=_0x5513e4[_0x459892];if(_[_0x9efb('0x43')](_0xa391bf[_0x9efb('0x50')][_0x59fc17['id']])){_0xa391bf[_0x9efb('0x50')][_0x59fc17['id']]=new Dynamics365Account(_0x59fc17);}else{_0xa391bf[_0x9efb('0x3c')](_0xa391bf[_0x9efb('0x50')][_0x59fc17['id']],_0x59fc17);}}}return _0xa391bf[_0x9efb('0x50')];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x51')]=function(){var _0x16de6e=this;return function(_0x26d386){if(_0x26d386){freeIsNotKey(_0x26d386,_0x16de6e[_0x9efb('0x1f')],'id');for(var _0x2661ba=0x0,_0x120bf8={},_0x3dca50={};_0x2661ba<_0x26d386[_0x9efb('0x40')];_0x2661ba+=0x1){_0x120bf8=_0x26d386[_0x2661ba];if(_[_0x9efb('0x43')](_0x16de6e[_0x9efb('0x1f')][_0x120bf8['id']])){_0x16de6e['freshsalesAccounts'][_0x120bf8['id']]=new FreshsalesAccount(_0x120bf8);}else{_0x16de6e[_0x9efb('0x3c')](_0x16de6e[_0x9efb('0x1f')][_0x120bf8['id']],_0x120bf8);}}}return _0x16de6e[_0x9efb('0x1f')];};};Realtime[_0x9efb('0x3d')]['initVoiceQueueHopperHistory']=function(){var _0x1f9ca1=this;return function(_0x126065){for(var _0x27565b=0x0;_0x27565b<_0x126065[_0x9efb('0x40')];_0x27565b+=0x1){_[_0x9efb('0x52')](_0x1f9ca1['voiceQueues'][_0x126065[_0x27565b][_0x9efb('0x26')]],_0x126065[_0x27565b]);}return _0x1f9ca1[_0x9efb('0x10')];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x53')]=function(){var _0x513085=this;return function(_0x34019a){clearVoiceQueues(_0x513085[_0x9efb('0x10')]);if(_0x34019a){_0x34019a=_[_0x9efb('0x54')](_0x34019a,_0x9efb('0x55'));for(var _0x578a40 in _0x34019a){if(_0x34019a['hasOwnProperty'](_0x578a40)){var _0x1e5bcc={};for(var _0x252443=0x0;_0x252443<_0x34019a[_0x578a40][_0x9efb('0x40')];_0x252443+=0x1){var _0x591d99=_0x34019a[_0x578a40][_0x252443]['queue'];if(_0x513085[_0x9efb('0x10')][_0x591d99]){if(_0x34019a[_0x578a40][_0x252443]['queuecallerexit']){_0x513085['voiceQueues'][_0x591d99][_0x9efb('0x56')]+=0x1;}if(_0x34019a[_0x578a40][_0x252443][_0x9efb('0x57')]){_0x513085['voiceQueues'][_0x591d99][_0x9efb('0x2e')]+=0x1;}_0x513085[_0x9efb('0x10')][_0x591d99]['sumHoldTime']+=moment(_0x34019a[_0x578a40][_0x252443]['queuecallerleaveAt'])['diff'](moment(_0x34019a[_0x578a40][_0x252443][_0x9efb('0x58')]),_0x9efb('0x59'))||0x0;if(_0x252443===_0x34019a[_0x578a40][_0x9efb('0x40')]-0x1){_0x513085['voiceQueues'][_0x591d99][_0x9efb('0x2a')]+=moment(_0x34019a[_0x578a40][_0x252443][_0x9efb('0x5a')]||_0x34019a[_0x578a40][_0x252443]['queuecallerabandonAt']||_0x34019a[_0x578a40][_0x252443][_0x9efb('0x5b')])[_0x9efb('0x5c')](moment(_0x34019a[_0x578a40][_0x252443][_0x9efb('0x58')]),'seconds')||0x0;_0x513085[_0x9efb('0x10')][_0x591d99]['total']+=0x1;if(_0x34019a[_0x578a40][_0x252443][_0x9efb('0x5d')]){_0x513085[_0x9efb('0x10')][_0x591d99][_0x9efb('0x28')]+=0x1;_0x513085[_0x9efb('0x10')][_0x591d99]['sumBillable']+=moment(_0x34019a[_0x578a40][_0x252443][_0x9efb('0x5a')])['diff'](moment(_0x34019a[_0x578a40][_0x252443]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x513085['voiceQueues'][_0x591d99]['sumDuration']+=_0x513085[_0x9efb('0x10')][_0x591d99][_0x9efb('0x29')]||0x0;}}}}}}return _0x513085['voiceQueues'];};};Realtime['prototype'][_0x9efb('0x5e')]=function(){var _0xa08124=this;return function(_0x21ff34){clearVoiceCallReports(_0xa08124[_0x9efb('0x13')]);if(_0x21ff34){for(var _0x432572=0x0;_0x432572<_0x21ff34[_0x9efb('0x40')];_0x432572+=0x1){_0xa08124[_0x9efb('0x13')][_0x9efb('0x27')]+=0x1;_0xa08124[_0x9efb('0x13')][_0x9efb('0x2a')]+=_0x21ff34[_0x432572]['duration'];if(_0x21ff34[_0x432572]['disposition']==='ANSWERED'){_0xa08124[_0x9efb('0x13')][_0x9efb('0x28')]+=0x1;_0xa08124['outbound'][_0x9efb('0x29')]+=_0x21ff34[_0x432572][_0x9efb('0x5f')]-_0x21ff34[_0x432572][_0x9efb('0x60')]||0x0;_0xa08124[_0x9efb('0x13')][_0x9efb('0x2b')]+=_0x21ff34[_0x432572][_0x9efb('0x60')];}}}return _0xa08124['outbound'];};};Realtime['prototype'][_0x9efb('0x61')]=function(){var _0x96597a=this;return function(_0x305704){if(_0x305704){freeIsNotKey(_0x305704,_0x96597a[_0x9efb('0x12')],_0x9efb('0x26'));for(var _0x45e144=0x0,_0x30e89f={};_0x45e144<_0x305704['length'];_0x45e144+=0x1){_0x30e89f=_0x305704[_0x45e144];if(_[_0x9efb('0x43')](_0x96597a[_0x9efb('0x12')][_0x30e89f['name']])){_0x96597a[_0x9efb('0x12')][_0x30e89f[_0x9efb('0x26')]]=new Campaign(_0x30e89f);}else{_0x96597a[_0x9efb('0x3c')](_0x96597a[_0x9efb('0x12')][_0x30e89f['name']],_0x30e89f);}}}return _0x96597a[_0x9efb('0x12')];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x62')]=function(){var _0x3d46bf=this;return function(_0x4ad510){if(_0x4ad510){freeIsNotKey(_0x4ad510,_0x3d46bf[_0x9efb('0x14')],'id');for(var _0x5f3f0e=0x0,_0x4779b4={};_0x5f3f0e<_0x4ad510['length'];_0x5f3f0e+=0x1){_0x4779b4=_0x4ad510[_0x5f3f0e];if(_[_0x9efb('0x43')](_0x3d46bf['voiceExtensions'][_0x4779b4['id']])){_0x3d46bf['voiceExtensions'][_0x4779b4['id']]=new VoiceExtension(_0x4779b4);}else{_0x3d46bf[_0x9efb('0x3c')](_0x3d46bf[_0x9efb('0x14')][_0x4779b4['id']],_0x4779b4);}}}return _0x3d46bf[_0x9efb('0x14')];};};Realtime['prototype'][_0x9efb('0x63')]=function(){var _0x50ef65=this;return function(_0x31c4b6){clearCampaigns(_0x50ef65['campaigns']);for(var _0x2b3c4b=0x0;_0x2b3c4b<_0x31c4b6['length'];_0x2b3c4b+=0x1){_['merge'](_0x50ef65[_0x9efb('0x12')][_0x31c4b6[_0x2b3c4b]['name']],_0x31c4b6[_0x2b3c4b]);}return _0x50ef65['campaigns'];};};Realtime[_0x9efb('0x3d')][_0x9efb('0x64')]=function(){var _0x4636e6=this;return function(_0x189d94){if(_0x189d94){freeIsNotKey(_0x189d94,_0x4636e6[_0x9efb('0x20')],'id');for(var _0x5a08eb=0x0,_0x13b20d={},_0x42d05a={};_0x5a08eb<_0x189d94['length'];_0x5a08eb+=0x1){_0x13b20d=_0x189d94[_0x5a08eb];if(_['isUndefined'](_0x4636e6['faxAccounts'][_0x13b20d['id']])){_0x4636e6['faxAccounts'][_0x13b20d['id']]=new FaxAccount(_0x13b20d);}else{_0x4636e6['mergeFromDatabase'](_0x4636e6[_0x9efb('0x20')][_0x13b20d['id']],_0x13b20d);}}}return _0x4636e6[_0x9efb('0x20')];};};module['exports']=Realtime; \ No newline at end of file +var _0xadca=['zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','servicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queue','queuecallerexit','unmanaged','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','answered','queuecallercompleteAt','initVoiceCallReports','disposition','billableseconds','initCampaigns','campaigns','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','util','lodash','moment','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','outbound','voiceExtensions','channels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','sumHoldTime','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','isNil','isUndefined','initTrunks','length','initVoiceQueues','initTriggers','triggers','templates'];(function(_0x3104b0,_0x1869b0){var _0xc084ae=function(_0x33cfaf){while(--_0x33cfaf){_0x3104b0['push'](_0x3104b0['shift']());}};_0xc084ae(++_0x1869b0);}(_0xadca,0x162));var _0xaadc=function(_0x30986c,_0x39ce58){_0x30986c=_0x30986c-0x0;var _0x57c209=_0xadca[_0x30986c];return _0x57c209;};'use strict';var BPromise=require('bluebird');var util=require(_0xaadc('0x0'));var _=require(_0xaadc('0x1'));var moment=require(_0xaadc('0x2'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0xaadc('0x3'));var VoiceQueue=require(_0xaadc('0x4'));var Trigger=require(_0xaadc('0x5'));var Template=require('../model/template');var Campaign=require(_0xaadc('0x6'));var VoiceExtension=require(_0xaadc('0x7'));var ZendeskAccount=require(_0xaadc('0x8'));var SalesforceAccount=require(_0xaadc('0x9'));var FreshdeskAccount=require(_0xaadc('0xa'));var SugarcrmAccount=require(_0xaadc('0xb'));var ZohoAccount=require(_0xaadc('0xc'));var DeskAccount=require(_0xaadc('0xd'));var VtigerAccount=require(_0xaadc('0xe'));var ServicenowAccount=require(_0xaadc('0xf'));var Dynamics365Account=require(_0xaadc('0x10'));var FreshsalesAccount=require(_0xaadc('0x11'));var FaxAccount=require(_0xaadc('0x12'));var Realtime=function(){this['agents']={};this[_0xaadc('0x13')]={};this[_0xaadc('0x14')]={};this[_0xaadc('0x15')]={};this['triggers']={};this['campaigns']={};this['templates']={};this[_0xaadc('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xaadc('0x17')]={};this[_0xaadc('0x18')]={};this['queueChannels']={};this[_0xaadc('0x19')]={};this[_0xaadc('0x1a')]={};this['zendeskAccounts']={};this[_0xaadc('0x1b')]={};this[_0xaadc('0x1c')]={};this[_0xaadc('0x1d')]={};this['zohoAccounts']={};this[_0xaadc('0x1e')]={};this[_0xaadc('0x1f')]={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this[_0xaadc('0x20')]={};this[_0xaadc('0x21')]={};};function freeIsNotKey(_0x5b8bde,_0xa5b6db,_0x53ecfb){var _0x16a182=_[_0xaadc('0x22')](_0x5b8bde,function(_0x2c4d8f,_0x2101ad){return _0x2c4d8f[_0x53ecfb];});for(var _0x5c8d4f in _0xa5b6db){if(_0xa5b6db['hasOwnProperty'](_0x5c8d4f)){if(!_0x16a182[_0x5c8d4f]){delete _0xa5b6db[_0x5c8d4f];}}}}function freeIsNotKeySip(_0x3ffa0d,_0x324319){var _0x3ab480=_[_0xaadc('0x22')](_0x3ffa0d,function(_0x2c0a38,_0x5590d0){return util[_0xaadc('0x23')](_0xaadc('0x24'),_0x2c0a38[_0xaadc('0x25')]);});for(var _0x3251b5 in _0x324319){if(_0x324319[_0xaadc('0x26')](_0x3251b5)){if(!_0x3ab480[_0x3251b5]){delete _0x324319[_0x3251b5];}}}}function freeIsNotKeyAgent(_0x5bb5c1,_0x42bc8c){var _0x2809b3=_[_0xaadc('0x22')](_0x5bb5c1,function(_0x414fef,_0x30c793){var _0x25c336=_['isNil'](_0x414fef[_0xaadc('0x27')])?util[_0xaadc('0x23')](_0xaadc('0x24'),_0x414fef['name']):_0x414fef[_0xaadc('0x27')];return _0x25c336;});for(var _0x1f3a79 in _0x42bc8c){if(_0x42bc8c[_0xaadc('0x26')](_0x1f3a79)){if(!_0x2809b3[_0x1f3a79]){delete _0x42bc8c[_0x1f3a79];}}}}function clearVoiceCallReports(_0x26e208){_0x26e208[_0xaadc('0x28')]=0x0;_0x26e208['answered']=0x0;_0x26e208[_0xaadc('0x29')]=0x0;_0x26e208['sumDuration']=0x0;_0x26e208[_0xaadc('0x2a')]=0x0;}function clearCampaigns(_0x541693){if(!_['isEmpty'](_0x541693)){for(var _0xaf2677 in _0x541693){if(_0x541693[_0xaadc('0x26')](_0xaf2677)){_0x541693[_0xaf2677][_0xaadc('0x2b')]=0x0;_0x541693[_0xaf2677][_0xaadc('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x5e2623){if(!_[_0xaadc('0x2d')](_0x5e2623)){for(var _0x39c35d in _0x5e2623){if(_0x5e2623['hasOwnProperty'](_0x39c35d)){_0x5e2623[_0x39c35d][_0xaadc('0x28')]=0x0;_0x5e2623[_0x39c35d]['answered']=0x0;_0x5e2623[_0x39c35d]['unmanaged']=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x2e')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x29')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x2f')]=0x0;_0x5e2623[_0x39c35d]['sumBillable']=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x30')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x31')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x32')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x33')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x34')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x35')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x36')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x37')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x38')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x39')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x3a')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x3b')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x30')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x3c')]=0x0;_0x5e2623[_0x39c35d][_0xaadc('0x3d')]=!![];}}}}Realtime[_0xaadc('0x3e')][_0xaadc('0x3f')]=function(_0x5d5c94,_0x3fcc8a){for(var _0x41bfd3 in _0x3fcc8a){if(_0x5d5c94[_0xaadc('0x26')](_0x41bfd3)){_0x5d5c94[_0x41bfd3]=_0x3fcc8a[_0x41bfd3];}}};Realtime[_0xaadc('0x3e')][_0xaadc('0x40')]=function(){var _0x515f7a=this;return function(_0x3d0371){if(_0x3d0371){freeIsNotKeyAgent(_0x3d0371,_0x515f7a[_0xaadc('0x41')]);for(var _0x5d63b3=0x0,_0x543cd1={},_0x350f8f={};_0x5d63b3<_0x3d0371['length'];_0x5d63b3+=0x1){_0x543cd1=_0x3d0371[_0x5d63b3];var _0x5513fe=_[_0xaadc('0x42')](_0x543cd1[_0xaadc('0x27')])?util[_0xaadc('0x23')](_0xaadc('0x24'),_0x543cd1[_0xaadc('0x25')]):_0x543cd1['interface'];if(_[_0xaadc('0x43')](_0x515f7a['agents'][_0x5513fe])){_0x515f7a['agents'][_0x5513fe]=new Agent(_0x543cd1);}else{_0x515f7a[_0xaadc('0x3f')](_0x515f7a[_0xaadc('0x41')][_0x5513fe],_0x543cd1);}}}return _0x515f7a[_0xaadc('0x41')];};};Realtime[_0xaadc('0x3e')]['initTelephones']=function(){var _0x56018a=this;return function(_0x27a59b){if(_0x27a59b){freeIsNotKeySip(_0x27a59b,_0x56018a[_0xaadc('0x13')]);for(var _0xd3ec5b=0x0,_0x3a4aee={},_0x57c656={};_0xd3ec5b<_0x27a59b['length'];_0xd3ec5b+=0x1){_0x3a4aee=_0x27a59b[_0xd3ec5b];if(_[_0xaadc('0x43')](_0x56018a[_0xaadc('0x13')][util['format'](_0xaadc('0x24'),_0x3a4aee[_0xaadc('0x25')])])){_0x56018a[_0xaadc('0x13')][util[_0xaadc('0x23')](_0xaadc('0x24'),_0x3a4aee[_0xaadc('0x25')])]=new Telephone(_0x3a4aee);}else{_0x56018a[_0xaadc('0x3f')](_0x56018a[_0xaadc('0x13')][util[_0xaadc('0x23')](_0xaadc('0x24'),_0x3a4aee[_0xaadc('0x25')])],_0x3a4aee);}}}return _0x56018a[_0xaadc('0x13')];};};Realtime['prototype'][_0xaadc('0x44')]=function(){var _0x4bc56d=this;return function(_0x2a39f9){if(_0x2a39f9){freeIsNotKeySip(_0x2a39f9,_0x4bc56d[_0xaadc('0x14')]);for(var _0x2265ae=0x0,_0x489199={},_0x119bd6={};_0x2265ae<_0x2a39f9[_0xaadc('0x45')];_0x2265ae+=0x1){_0x489199=_0x2a39f9[_0x2265ae];if(_[_0xaadc('0x43')](_0x4bc56d[_0xaadc('0x14')][util[_0xaadc('0x23')](_0xaadc('0x24'),_0x489199[_0xaadc('0x25')])])){_0x4bc56d[_0xaadc('0x14')][util[_0xaadc('0x23')]('SIP/%s',_0x489199[_0xaadc('0x25')])]=new Trunk(_0x489199);}else{_0x4bc56d['mergeFromDatabase'](_0x4bc56d[_0xaadc('0x14')][util['format'](_0xaadc('0x24'),_0x489199[_0xaadc('0x25')])],_0x489199);}}}return _0x4bc56d[_0xaadc('0x14')];};};Realtime[_0xaadc('0x3e')][_0xaadc('0x46')]=function(){var _0x21f5e9=this;return function(_0xdfe08f){if(_0xdfe08f){freeIsNotKey(_0xdfe08f,_0x21f5e9[_0xaadc('0x15')],_0xaadc('0x25'));for(var _0x24e1d6=0x0,_0x4a0568={},_0x219580={};_0x24e1d6<_0xdfe08f['length'];_0x24e1d6+=0x1){_0x4a0568=_0xdfe08f[_0x24e1d6];if(_[_0xaadc('0x43')](_0x21f5e9[_0xaadc('0x15')][_0x4a0568['name']])){_0x21f5e9[_0xaadc('0x15')][_0x4a0568['name']]=new VoiceQueue(_0x4a0568);}else{_0x21f5e9[_0xaadc('0x3f')](_0x21f5e9[_0xaadc('0x15')][_0x4a0568['name']],_0x4a0568);}}}return _0x21f5e9['voiceQueues'];};};Realtime[_0xaadc('0x3e')][_0xaadc('0x47')]=function(){var _0x269e13=this;return function(_0x229dd4){if(_0x229dd4){freeIsNotKey(_0x229dd4,_0x269e13['triggers'],'id');for(var _0x563c39=0x0,_0x28045f={},_0x1d58f6={};_0x563c39<_0x229dd4['length'];_0x563c39+=0x1){_0x28045f=_0x229dd4[_0x563c39];if(_[_0xaadc('0x43')](_0x269e13[_0xaadc('0x48')][_0x28045f['id']])){_0x269e13['triggers'][_0x28045f['id']]=new Trigger(_0x28045f);}else{_0x269e13[_0xaadc('0x3f')](_0x269e13[_0xaadc('0x48')][_0x28045f['id']],_0x28045f);}}}return _0x269e13['triggers'];};};Realtime[_0xaadc('0x3e')]['initTemplates']=function(){var _0xfa95f3=this;return function(_0x388752){if(_0x388752){freeIsNotKey(_0x388752,_0xfa95f3['templates'],'id');for(var _0x2f82c3=0x0,_0xa26cc1={},_0x594db7={};_0x2f82c3<_0x388752[_0xaadc('0x45')];_0x2f82c3+=0x1){_0xa26cc1=_0x388752[_0x2f82c3];if(_[_0xaadc('0x43')](_0xfa95f3['templates'][_0xa26cc1['id']])){_0xfa95f3['templates'][_0xa26cc1['id']]=new Template(_0xa26cc1);}else{_0xfa95f3[_0xaadc('0x3f')](_0xfa95f3[_0xaadc('0x49')][_0xa26cc1['id']],_0xa26cc1);}}}return _0xfa95f3[_0xaadc('0x49')];};};Realtime[_0xaadc('0x3e')]['initZendeskAccounts']=function(){var _0x1aa20d=this;return function(_0x224d53){if(_0x224d53){freeIsNotKey(_0x224d53,_0x1aa20d[_0xaadc('0x4a')],'id');for(var _0x134fd9=0x0,_0xb30bc={},_0x55fa60={};_0x134fd9<_0x224d53[_0xaadc('0x45')];_0x134fd9+=0x1){_0xb30bc=_0x224d53[_0x134fd9];if(_[_0xaadc('0x43')](_0x1aa20d['zendeskAccounts'][_0xb30bc['id']])){_0x1aa20d[_0xaadc('0x4a')][_0xb30bc['id']]=new ZendeskAccount(_0xb30bc);}else{_0x1aa20d[_0xaadc('0x3f')](_0x1aa20d[_0xaadc('0x4a')][_0xb30bc['id']],_0xb30bc);}}}return _0x1aa20d[_0xaadc('0x4a')];};};Realtime[_0xaadc('0x3e')]['initSalesforceAccounts']=function(){var _0x148e87=this;return function(_0x253bec){if(_0x253bec){freeIsNotKey(_0x253bec,_0x148e87[_0xaadc('0x1b')],'id');for(var _0x1ac2cd=0x0,_0x2abcc4={},_0xf8baac={};_0x1ac2cd<_0x253bec[_0xaadc('0x45')];_0x1ac2cd+=0x1){_0x2abcc4=_0x253bec[_0x1ac2cd];if(_[_0xaadc('0x43')](_0x148e87[_0xaadc('0x1b')][_0x2abcc4['id']])){_0x148e87[_0xaadc('0x1b')][_0x2abcc4['id']]=new SalesforceAccount(_0x2abcc4);}else{_0x148e87[_0xaadc('0x3f')](_0x148e87[_0xaadc('0x1b')][_0x2abcc4['id']],_0x2abcc4);}}}return _0x148e87['salesforceAccounts'];};};Realtime[_0xaadc('0x3e')][_0xaadc('0x4b')]=function(){var _0x1bd80a=this;return function(_0x266eac){if(_0x266eac){freeIsNotKey(_0x266eac,_0x1bd80a[_0xaadc('0x1d')],'id');for(var _0x22715f=0x0,_0x34736f={},_0x51f277={};_0x22715f<_0x266eac[_0xaadc('0x45')];_0x22715f+=0x1){_0x34736f=_0x266eac[_0x22715f];if(_['isUndefined'](_0x1bd80a[_0xaadc('0x1d')][_0x34736f['id']])){_0x1bd80a[_0xaadc('0x1d')][_0x34736f['id']]=new FreshdeskAccount(_0x34736f);}else{_0x1bd80a[_0xaadc('0x3f')](_0x1bd80a[_0xaadc('0x1d')][_0x34736f['id']],_0x34736f);}}}return _0x1bd80a[_0xaadc('0x1d')];};};Realtime[_0xaadc('0x3e')][_0xaadc('0x4c')]=function(){var _0x41c617=this;return function(_0x169874){if(_0x169874){freeIsNotKey(_0x169874,_0x41c617[_0xaadc('0x4d')],'id');for(var _0x2c50d4=0x0,_0x2e772e={},_0x470bb8={};_0x2c50d4<_0x169874[_0xaadc('0x45')];_0x2c50d4+=0x1){_0x2e772e=_0x169874[_0x2c50d4];if(_['isUndefined'](_0x41c617[_0xaadc('0x4d')][_0x2e772e['id']])){_0x41c617[_0xaadc('0x4d')][_0x2e772e['id']]=new ZohoAccount(_0x2e772e);}else{_0x41c617[_0xaadc('0x3f')](_0x41c617['zohoAccounts'][_0x2e772e['id']],_0x2e772e);}}}return _0x41c617[_0xaadc('0x4d')];};};Realtime[_0xaadc('0x3e')][_0xaadc('0x4e')]=function(){var _0x3d774c=this;return function(_0x488e5b){if(_0x488e5b){freeIsNotKey(_0x488e5b,_0x3d774c[_0xaadc('0x1e')],'id');for(var _0x4c5e92=0x0,_0x34cd35={},_0x143382={};_0x4c5e92<_0x488e5b['length'];_0x4c5e92+=0x1){_0x34cd35=_0x488e5b[_0x4c5e92];if(_[_0xaadc('0x43')](_0x3d774c['deskAccounts'][_0x34cd35['id']])){_0x3d774c['deskAccounts'][_0x34cd35['id']]=new DeskAccount(_0x34cd35);}else{_0x3d774c[_0xaadc('0x3f')](_0x3d774c['deskAccounts'][_0x34cd35['id']],_0x34cd35);}}}return _0x3d774c[_0xaadc('0x1e')];};};Realtime[_0xaadc('0x3e')][_0xaadc('0x4f')]=function(){var _0x19d542=this;return function(_0x1b5fe5){if(_0x1b5fe5){freeIsNotKey(_0x1b5fe5,_0x19d542[_0xaadc('0x1c')],'id');for(var _0x5e1519=0x0,_0x59af48={},_0x978db0={};_0x5e1519<_0x1b5fe5['length'];_0x5e1519+=0x1){_0x59af48=_0x1b5fe5[_0x5e1519];if(_['isUndefined'](_0x19d542[_0xaadc('0x1c')][_0x59af48['id']])){_0x19d542[_0xaadc('0x1c')][_0x59af48['id']]=new SugarcrmAccount(_0x59af48);}else{_0x19d542['mergeFromDatabase'](_0x19d542[_0xaadc('0x1c')][_0x59af48['id']],_0x59af48);}}}return _0x19d542[_0xaadc('0x1c')];};};Realtime[_0xaadc('0x3e')]['initVtigerAccounts']=function(){var _0x379cc1=this;return function(_0x18a7da){if(_0x18a7da){freeIsNotKey(_0x18a7da,_0x379cc1[_0xaadc('0x1f')],'id');for(var _0x2551a5=0x0,_0xd24c7={},_0x1fe455={};_0x2551a5<_0x18a7da[_0xaadc('0x45')];_0x2551a5+=0x1){_0xd24c7=_0x18a7da[_0x2551a5];if(_[_0xaadc('0x43')](_0x379cc1['vtigerAccounts'][_0xd24c7['id']])){_0x379cc1[_0xaadc('0x1f')][_0xd24c7['id']]=new VtigerAccount(_0xd24c7);}else{_0x379cc1[_0xaadc('0x3f')](_0x379cc1['vtigerAccounts'][_0xd24c7['id']],_0xd24c7);}}}return _0x379cc1[_0xaadc('0x1f')];};};Realtime[_0xaadc('0x3e')]['initServicenowAccounts']=function(){var _0x4f3267=this;return function(_0xd3ec14){if(_0xd3ec14){freeIsNotKey(_0xd3ec14,_0x4f3267[_0xaadc('0x50')],'id');for(var _0x3b79f=0x0,_0x43b91c={},_0x15f107={};_0x3b79f<_0xd3ec14[_0xaadc('0x45')];_0x3b79f+=0x1){_0x43b91c=_0xd3ec14[_0x3b79f];if(_[_0xaadc('0x43')](_0x4f3267[_0xaadc('0x50')][_0x43b91c['id']])){_0x4f3267['servicenowAccounts'][_0x43b91c['id']]=new ServicenowAccount(_0x43b91c);}else{_0x4f3267[_0xaadc('0x3f')](_0x4f3267['servicenowAccounts'][_0x43b91c['id']],_0x43b91c);}}}return _0x4f3267[_0xaadc('0x50')];};};Realtime[_0xaadc('0x3e')]['initDynamics365Accounts']=function(){var _0x42857a=this;return function(_0x4a9da9){if(_0x4a9da9){freeIsNotKey(_0x4a9da9,_0x42857a[_0xaadc('0x51')],'id');for(var _0x1da008=0x0,_0x52f05e={},_0x2531fe={};_0x1da008<_0x4a9da9['length'];_0x1da008+=0x1){_0x52f05e=_0x4a9da9[_0x1da008];if(_[_0xaadc('0x43')](_0x42857a[_0xaadc('0x51')][_0x52f05e['id']])){_0x42857a['dynamics365Accounts'][_0x52f05e['id']]=new Dynamics365Account(_0x52f05e);}else{_0x42857a['mergeFromDatabase'](_0x42857a[_0xaadc('0x51')][_0x52f05e['id']],_0x52f05e);}}}return _0x42857a[_0xaadc('0x51')];};};Realtime[_0xaadc('0x3e')][_0xaadc('0x52')]=function(){var _0x1f26ee=this;return function(_0x230442){if(_0x230442){freeIsNotKey(_0x230442,_0x1f26ee[_0xaadc('0x20')],'id');for(var _0x36f57a=0x0,_0x536423={},_0x2303aa={};_0x36f57a<_0x230442['length'];_0x36f57a+=0x1){_0x536423=_0x230442[_0x36f57a];if(_[_0xaadc('0x43')](_0x1f26ee[_0xaadc('0x20')][_0x536423['id']])){_0x1f26ee[_0xaadc('0x20')][_0x536423['id']]=new FreshsalesAccount(_0x536423);}else{_0x1f26ee[_0xaadc('0x3f')](_0x1f26ee[_0xaadc('0x20')][_0x536423['id']],_0x536423);}}}return _0x1f26ee['freshsalesAccounts'];};};Realtime['prototype'][_0xaadc('0x53')]=function(){var _0x412500=this;return function(_0x5dfc66){for(var _0x3c3d04=0x0;_0x3c3d04<_0x5dfc66[_0xaadc('0x45')];_0x3c3d04+=0x1){_['merge'](_0x412500[_0xaadc('0x15')][_0x5dfc66[_0x3c3d04][_0xaadc('0x25')]],_0x5dfc66[_0x3c3d04]);}return _0x412500[_0xaadc('0x15')];};};Realtime[_0xaadc('0x3e')][_0xaadc('0x54')]=function(){var _0x13854f=this;return function(_0x2f9f30){clearVoiceQueues(_0x13854f[_0xaadc('0x15')]);if(_0x2f9f30){_0x2f9f30=_['groupBy'](_0x2f9f30,_0xaadc('0x55'));for(var _0x5bc37c in _0x2f9f30){if(_0x2f9f30['hasOwnProperty'](_0x5bc37c)){var _0x46ce96={};for(var _0x1b8fbc=0x0;_0x1b8fbc<_0x2f9f30[_0x5bc37c][_0xaadc('0x45')];_0x1b8fbc+=0x1){var _0x37436c=_0x2f9f30[_0x5bc37c][_0x1b8fbc][_0xaadc('0x56')];if(_0x13854f[_0xaadc('0x15')][_0x37436c]){if(_0x2f9f30[_0x5bc37c][_0x1b8fbc][_0xaadc('0x57')]){_0x13854f[_0xaadc('0x15')][_0x37436c][_0xaadc('0x58')]+=0x1;}if(_0x2f9f30[_0x5bc37c][_0x1b8fbc]['queuecallerabandon']){_0x13854f[_0xaadc('0x15')][_0x37436c]['abandoned']+=0x1;}_0x13854f[_0xaadc('0x15')][_0x37436c][_0xaadc('0x29')]+=moment(_0x2f9f30[_0x5bc37c][_0x1b8fbc][_0xaadc('0x59')])[_0xaadc('0x5a')](moment(_0x2f9f30[_0x5bc37c][_0x1b8fbc][_0xaadc('0x5b')]),_0xaadc('0x5c'))||0x0;if(_0x1b8fbc===_0x2f9f30[_0x5bc37c]['length']-0x1){_0x13854f[_0xaadc('0x15')][_0x37436c]['sumDuration']+=moment(_0x2f9f30[_0x5bc37c][_0x1b8fbc]['queuecallercompleteAt']||_0x2f9f30[_0x5bc37c][_0x1b8fbc][_0xaadc('0x5d')]||_0x2f9f30[_0x5bc37c][_0x1b8fbc][_0xaadc('0x5e')])[_0xaadc('0x5a')](moment(_0x2f9f30[_0x5bc37c][_0x1b8fbc][_0xaadc('0x5b')]),_0xaadc('0x5c'))||0x0;_0x13854f['voiceQueues'][_0x37436c][_0xaadc('0x28')]+=0x1;if(_0x2f9f30[_0x5bc37c][_0x1b8fbc][_0xaadc('0x5f')]){_0x13854f[_0xaadc('0x15')][_0x37436c][_0xaadc('0x60')]+=0x1;_0x13854f[_0xaadc('0x15')][_0x37436c][_0xaadc('0x2a')]+=moment(_0x2f9f30[_0x5bc37c][_0x1b8fbc][_0xaadc('0x61')])['diff'](moment(_0x2f9f30[_0x5bc37c][_0x1b8fbc][_0xaadc('0x59')]),'seconds')||0x0;}}else{_0x13854f[_0xaadc('0x15')][_0x37436c][_0xaadc('0x2f')]+=_0x13854f[_0xaadc('0x15')][_0x37436c][_0xaadc('0x29')]||0x0;}}}}}}return _0x13854f['voiceQueues'];};};Realtime[_0xaadc('0x3e')][_0xaadc('0x62')]=function(){var _0x1a5df3=this;return function(_0x2f5322){clearVoiceCallReports(_0x1a5df3['outbound']);if(_0x2f5322){for(var _0x30a244=0x0;_0x30a244<_0x2f5322['length'];_0x30a244+=0x1){_0x1a5df3[_0xaadc('0x16')]['total']+=0x1;_0x1a5df3['outbound']['sumDuration']+=_0x2f5322[_0x30a244]['duration'];if(_0x2f5322[_0x30a244][_0xaadc('0x63')]==='ANSWERED'){_0x1a5df3[_0xaadc('0x16')]['answered']+=0x1;_0x1a5df3[_0xaadc('0x16')]['sumHoldTime']+=_0x2f5322[_0x30a244]['duration']-_0x2f5322[_0x30a244][_0xaadc('0x64')]||0x0;_0x1a5df3[_0xaadc('0x16')][_0xaadc('0x2a')]+=_0x2f5322[_0x30a244][_0xaadc('0x64')];}}}return _0x1a5df3[_0xaadc('0x16')];};};Realtime['prototype'][_0xaadc('0x65')]=function(){var _0x5e1ab2=this;return function(_0x4ab965){if(_0x4ab965){freeIsNotKey(_0x4ab965,_0x5e1ab2[_0xaadc('0x66')],'name');for(var _0xd5cd09=0x0,_0x1c6e41={};_0xd5cd09<_0x4ab965['length'];_0xd5cd09+=0x1){_0x1c6e41=_0x4ab965[_0xd5cd09];if(_[_0xaadc('0x43')](_0x5e1ab2['campaigns'][_0x1c6e41[_0xaadc('0x25')]])){_0x5e1ab2[_0xaadc('0x66')][_0x1c6e41[_0xaadc('0x25')]]=new Campaign(_0x1c6e41);}else{_0x5e1ab2[_0xaadc('0x3f')](_0x5e1ab2[_0xaadc('0x66')][_0x1c6e41[_0xaadc('0x25')]],_0x1c6e41);}}}return _0x5e1ab2[_0xaadc('0x66')];};};Realtime['prototype'][_0xaadc('0x67')]=function(){var _0x57c391=this;return function(_0x5c10b1){if(_0x5c10b1){freeIsNotKey(_0x5c10b1,_0x57c391[_0xaadc('0x17')],'id');for(var _0x3515a0=0x0,_0x348bc3={};_0x3515a0<_0x5c10b1['length'];_0x3515a0+=0x1){_0x348bc3=_0x5c10b1[_0x3515a0];if(_['isUndefined'](_0x57c391[_0xaadc('0x17')][_0x348bc3['id']])){_0x57c391['voiceExtensions'][_0x348bc3['id']]=new VoiceExtension(_0x348bc3);}else{_0x57c391[_0xaadc('0x3f')](_0x57c391[_0xaadc('0x17')][_0x348bc3['id']],_0x348bc3);}}}return _0x57c391[_0xaadc('0x17')];};};Realtime[_0xaadc('0x3e')][_0xaadc('0x68')]=function(){var _0x441f1e=this;return function(_0x254f1b){clearCampaigns(_0x441f1e[_0xaadc('0x66')]);for(var _0x116be6=0x0;_0x116be6<_0x254f1b['length'];_0x116be6+=0x1){_[_0xaadc('0x69')](_0x441f1e['campaigns'][_0x254f1b[_0x116be6][_0xaadc('0x25')]],_0x254f1b[_0x116be6]);}return _0x441f1e[_0xaadc('0x66')];};};Realtime[_0xaadc('0x3e')][_0xaadc('0x6a')]=function(){var _0x5b1c4e=this;return function(_0xfcabec){if(_0xfcabec){freeIsNotKey(_0xfcabec,_0x5b1c4e[_0xaadc('0x21')],'id');for(var _0x35458f=0x0,_0x84d4d8={},_0x1ea941={};_0x35458f<_0xfcabec[_0xaadc('0x45')];_0x35458f+=0x1){_0x84d4d8=_0xfcabec[_0x35458f];if(_['isUndefined'](_0x5b1c4e['faxAccounts'][_0x84d4d8['id']])){_0x5b1c4e['faxAccounts'][_0x84d4d8['id']]=new FaxAccount(_0x84d4d8);}else{_0x5b1c4e[_0xaadc('0x3f')](_0x5b1c4e['faxAccounts'][_0x84d4d8['id']],_0x84d4d8);}}}return _0x5b1c4e[_0xaadc('0x21')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index f60c8e9..0358dd4 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 _0xf831=['monitorFilename','monitors','filename','createdAt','connectedlinename','membername','isArray','forEach','startsWith','Local','substring','indexOf','agents','mobile','phone','lastIndexOf','lodash','moment','util','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','telephones','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','connectedlinenum','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','ANSWERED','calleridname','monitor','length'];(function(_0x1b5cc2,_0x4321c2){var _0x375f3b=function(_0x265ddb){while(--_0x265ddb){_0x1b5cc2['push'](_0x1b5cc2['shift']());}};_0x375f3b(++_0x4321c2);}(_0xf831,0x65));var _0x1f83=function(_0x4d8a83,_0xdf808a){_0x4d8a83=_0x4d8a83-0x0;var _0x1e6eb1=_0xf831[_0x4d8a83];return _0x1e6eb1;};'use strict';var BPromise=require('bluebird');var _=require(_0x1f83('0x0'));var moment=require(_0x1f83('0x1'));var util=require(_0x1f83('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x1f83('0x3'));var ami=require(_0x1f83('0x4'));var RpcVoiceAgentReport=require(_0x1f83('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x1f83('0x6'));var RpcMemberReport=require(_0x1f83('0x7'));var RpcVoiceQueueReport=require(_0x1f83('0x8'));var RpcVoiceRecording=require(_0x1f83('0x9'));var RpcVoiceTransferReport=require(_0x1f83('0xa'));var VoiceQueueReport=require(_0x1f83('0xb'));var VoiceCallReport=require(_0x1f83('0xc'));var VoiceAgentReport=require(_0x1f83('0xd'));var VoiceDialReport=require(_0x1f83('0xe'));var UserReport=require(_0x1f83('0xf'));function Report(_0x173a44){this[_0x1f83('0x10')]=_0x173a44;this['agents']=_0x173a44['agents'];this[_0x1f83('0x11')]=_0x173a44[_0x1f83('0x11')];}Report['prototype'][_0x1f83('0x12')]=function(_0x1029a6){var _0x11ca14=new VoiceQueueReport(this[_0x1f83('0x10')]);var _0x2b8796=new VoiceAgentReport(this[_0x1f83('0x10')]);var _0x3d4914=new VoiceDialReport(this[_0x1f83('0x10')]);var _0x3cd6eb=new VoiceCallReport(this['realtime']);var _0x51d91f=new UserReport(this[_0x1f83('0x10')]);if(config['xdr']&&config[_0x1f83('0x13')][_0x1f83('0x14')]){ami['on']('custom:voiceQueueReport',this[_0x1f83('0x15')][_0x1f83('0x16')](this));ami['on'](_0x1f83('0x17'),this[_0x1f83('0x18')][_0x1f83('0x16')](this));ami['on'](_0x1f83('0x19'),this[_0x1f83('0x1a')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0x1f83('0x1b')][_0x1f83('0x16')](this));ami['on'](_0x1f83('0x1c'),this[_0x1f83('0x1d')][_0x1f83('0x16')](this));ami['on'](_0x1f83('0x1e'),this[_0x1f83('0x1f')][_0x1f83('0x16')](this));}};Report[_0x1f83('0x20')][_0x1f83('0x21')]=function(_0x331dab){var _0x1d0b8c=undefined;_0x1d0b8c=_[_0x1f83('0x22')](this['agents'],function(_0xbcb845){return _0xbcb845[_0x1f83('0x23')]==_0x331dab||_0xbcb845['name']==_0x331dab;});if(_[_0x1f83('0x24')](_0x1d0b8c)){var _0x88e445=_[_0x1f83('0x22')](this[_0x1f83('0x11')],function(_0x590649){return _0x590649[_0x1f83('0x23')]==_0x331dab||_0x590649[_0x1f83('0x25')]==_0x331dab;});if(_0x88e445){_0x1d0b8c=_['find'](this['agents'],function(_0xe85b1a){return _0xe85b1a[_0x1f83('0x26')]==util[_0x1f83('0x27')](_0x1f83('0x28'),_0x88e445[_0x1f83('0x25')]);});}}return _0x1d0b8c;};Report[_0x1f83('0x20')][_0x1f83('0x15')]=function(_0x2e8314){for(var _0x5c70dd=0x0;_0x5c70dd<_0x2e8314['length'];_0x5c70dd+=0x1){var _0x17969f=this['findAgent'](_0x2e8314[_0x5c70dd][_0x1f83('0x29')]);if(_0x17969f){_0x2e8314[_0x5c70dd][_0x1f83('0x23')]=_0x17969f['accountcode'];_0x2e8314[_0x5c70dd]['assigned']=!![];_0x2e8314[_0x5c70dd][_0x1f83('0x2a')]=_0x17969f[_0x1f83('0x25')];_0x2e8314[_0x5c70dd][_0x1f83('0x26')]=_[_0x1f83('0x24')](_0x17969f['interface'])?util['format'](_0x1f83('0x28'),_0x17969f['name']):_0x17969f[_0x1f83('0x26')];if(_0x2e8314[_0x5c70dd]['queuecallercomplete']){_0x2e8314[_0x5c70dd][_0x1f83('0x2b')]=moment()[_0x1f83('0x27')](_0x1f83('0x2c'));}if(_0x2e8314[_0x5c70dd]['queuecallerexit']){_0x2e8314[_0x5c70dd][_0x1f83('0x2d')]=moment()['format'](_0x1f83('0x2c'));}RpcMemberReport[_0x1f83('0x15')](_0x2e8314[_0x5c70dd]);}RpcVoiceQueueReport[_0x1f83('0x2e')](_0x2e8314[_0x5c70dd]);}};function extractCalleridNumber(_0x447e4f){var _0x59c86a=_0x447e4f[_0x1f83('0x2f')](/<(.*?)>/);return _0x59c86a?_0x59c86a[0x1]:_0x447e4f;}Report[_0x1f83('0x20')]['voiceCallReport']=function(_0x46393b){_0x46393b['destination']=_0x46393b[_0x1f83('0x30')]||_0x46393b[_0x1f83('0x31')];if(_0x46393b[_0x1f83('0x32')]==_0x1f83('0x33')){_0x46393b[_0x1f83('0x34')]=_0x1f83('0x35');_0x46393b[_0x1f83('0x36')]=_0x46393b[_0x1f83('0x35')];if(_0x46393b['context']==_0x1f83('0x37')){_0x46393b[_0x1f83('0x23')]='';_0x46393b['destination']=extractCalleridNumber(_0x46393b[_0x1f83('0x38')]);}else if(_0x46393b[_0x1f83('0x39')]==_0x1f83('0x3a')){if(_0x46393b['destination']==_0x1f83('0x3b')){_0x46393b[_0x1f83('0x30')]=extractCalleridNumber(_0x46393b[_0x1f83('0x3c')]);_0x46393b[_0x1f83('0x3d')]=_0x46393b[_0x1f83('0x3e')];_0x46393b[_0x1f83('0x3f')]=[_0x46393b[_0x1f83('0x40')],_0x46393b[_0x1f83('0x40')]=_0x46393b[_0x1f83('0x3f')]][0x0];_0x46393b[_0x1f83('0x38')]=_0x46393b['calleridpreview'];}else{_0x46393b[_0x1f83('0x30')]=_0x46393b[_0x1f83('0x3d')];_0x46393b[_0x1f83('0x3d')]=_0x46393b[_0x1f83('0x3e')];if(_0x46393b['disposition']==_0x1f83('0x41')){_0x46393b[_0x1f83('0x23')]=_0x46393b[_0x1f83('0x29')];}else{_0x46393b[_0x1f83('0x23')]='';}}}}else{_0x46393b['callerid']=util['format']('\x22%s\x22\x20<%s>',_0x46393b[_0x1f83('0x42')],_0x46393b[_0x1f83('0x3d')]);}RpcVoiceCallReport['create'](_0x46393b);if(_0x46393b[_0x1f83('0x43')]){for(var _0x47096e=0x0;_0x47096e<_0x46393b['monitors'][_0x1f83('0x44')];_0x47096e+=0x1){_0x46393b[_0x1f83('0x45')]=_0x46393b[_0x1f83('0x46')][_0x47096e][_0x1f83('0x47')];_0x46393b[_0x1f83('0x48')]=_0x46393b[_0x1f83('0x46')][_0x47096e][_0x1f83('0x48')];if(_0x46393b[_0x1f83('0x31')]==_0x1f83('0x3b')){_0x46393b['calleridnum']=_0x46393b[_0x1f83('0x29')];_0x46393b[_0x1f83('0x42')]=_0x46393b['connectedlinename'];_0x46393b[_0x1f83('0x29')]=_0x46393b['accountcode'];_0x46393b[_0x1f83('0x49')]=_0x46393b[_0x1f83('0x4a')];_0x46393b['exten']=_0x46393b[_0x1f83('0x3e')];}else if(_0x46393b[_0x1f83('0x31')]=='xcally-motion-dialer'){_0x46393b['calleridnum']=_0x46393b['destination'];_0x46393b[_0x1f83('0x31')]=_0x46393b['originatecalleridnum'];}RpcVoiceRecording[_0x1f83('0x2e')](_0x46393b);}}};Report[_0x1f83('0x20')][_0x1f83('0x1a')]=function(_0x4eb21c){if(_[_0x1f83('0x4b')](_0x4eb21c)){_0x4eb21c[_0x1f83('0x4c')](function(_0x110795){RpcVoiceAgentReport['create'](_0x110795);});}else{RpcVoiceAgentReport[_0x1f83('0x2e')](_0x4eb21c);}};Report[_0x1f83('0x20')][_0x1f83('0x1b')]=function(_0x22302b){RpcVoiceDialReport['create'](_0x22302b);var _0x3b0307=undefined;var _0x312020=_0x22302b[_0x1f83('0x40')];if(_[_0x1f83('0x4d')](_0x312020,_0x1f83('0x4e'))){var _0x549ec1=_0x312020[_0x1f83('0x4f')](_0x312020[_0x1f83('0x50')]('/')+0x1,_0x312020[_0x1f83('0x50')]('@'));_0x3b0307=_['find'](this[_0x1f83('0x51')],function(_0x14da5b){return _0x14da5b[_0x1f83('0x52')]==_0x549ec1||_0x14da5b[_0x1f83('0x53')]==_0x549ec1||_0x14da5b[_0x1f83('0x23')]==_0x549ec1;});}else{var _0x549ec1=_0x312020['substring'](_0x312020[_0x1f83('0x50')]('/')+0x1,_0x312020[_0x1f83('0x54')]('-'));_0x3b0307=this['findAgent'](_0x549ec1);}if(_0x3b0307){_0x22302b[_0x1f83('0x26')]=_[_0x1f83('0x24')](_0x3b0307['interface'])?util[_0x1f83('0x27')]('SIP/%s',_0x3b0307[_0x1f83('0x25')]):_0x3b0307[_0x1f83('0x26')];_0x22302b[_0x1f83('0x4a')]=_0x3b0307['name'];_0x22302b[_0x1f83('0x23')]=_0x3b0307[_0x1f83('0x23')];RpcMemberReport[_0x1f83('0x1b')](_0x22302b);}};Report[_0x1f83('0x20')]['blindTransfer']=function(_0x53c7b4){RpcVoiceTransferReport[_0x1f83('0x1d')](_0x53c7b4);};Report[_0x1f83('0x20')]['attendedTransfer']=function(_0x276e3d){RpcVoiceTransferReport[_0x1f83('0x1f')](_0x276e3d);};module['exports']=Report; \ No newline at end of file +var _0x6a29=['phone','lastIndexOf','blindTransfer','exports','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','sync','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','find','accountcode','name','isNil','telephones','interface','SIP/%s','length','findAgent','connectedlinenum','assigned','lastAssignedTo','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','calleridpreview','disposition','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','Local','substring','indexOf','mobile'];(function(_0x28b12e,_0x59f4f5){var _0x2c3bd1=function(_0x1680c1){while(--_0x1680c1){_0x28b12e['push'](_0x28b12e['shift']());}};_0x2c3bd1(++_0x59f4f5);}(_0x6a29,0x150));var _0x96a2=function(_0x532f5c,_0x52bc44){_0x532f5c=_0x532f5c-0x0;var _0x1df091=_0x6a29[_0x532f5c];return _0x1df091;};'use strict';var BPromise=require('bluebird');var _=require(_0x96a2('0x0'));var moment=require(_0x96a2('0x1'));var util=require(_0x96a2('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0x96a2('0x3'));var RpcVoiceAgentReport=require(_0x96a2('0x4'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x96a2('0x5'));var RpcVoiceTransferReport=require(_0x96a2('0x6'));var VoiceQueueReport=require(_0x96a2('0x7'));var VoiceCallReport=require(_0x96a2('0x8'));var VoiceAgentReport=require(_0x96a2('0x9'));var VoiceDialReport=require(_0x96a2('0xa'));var UserReport=require(_0x96a2('0xb'));function Report(_0x4e5f25){this[_0x96a2('0xc')]=_0x4e5f25;this[_0x96a2('0xd')]=_0x4e5f25[_0x96a2('0xd')];this['telephones']=_0x4e5f25['telephones'];}Report['prototype'][_0x96a2('0xe')]=function(_0x4aaf9f){var _0x394338=new VoiceQueueReport(this[_0x96a2('0xc')]);var _0x3e1072=new VoiceAgentReport(this[_0x96a2('0xc')]);var _0x28dd6e=new VoiceDialReport(this[_0x96a2('0xc')]);var _0x4792f8=new VoiceCallReport(this[_0x96a2('0xc')]);var _0x3c9b63=new UserReport(this[_0x96a2('0xc')]);if(config[_0x96a2('0xf')]&&config[_0x96a2('0xf')]['disabled']){ami['on'](_0x96a2('0x10'),this[_0x96a2('0x11')]['bind'](this));ami['on'](_0x96a2('0x12'),this[_0x96a2('0x13')][_0x96a2('0x14')](this));ami['on'](_0x96a2('0x15'),this[_0x96a2('0x16')][_0x96a2('0x14')](this));ami['on'](_0x96a2('0x17'),this[_0x96a2('0x18')][_0x96a2('0x14')](this));ami['on'](_0x96a2('0x19'),this['blindTransfer'][_0x96a2('0x14')](this));ami['on'](_0x96a2('0x1a'),this[_0x96a2('0x1b')][_0x96a2('0x14')](this));}};Report[_0x96a2('0x1c')]['findAgent']=function(_0x4da286){var _0x1765be=undefined;_0x1765be=_[_0x96a2('0x1d')](this[_0x96a2('0xd')],function(_0x10197b){return _0x10197b[_0x96a2('0x1e')]==_0x4da286||_0x10197b[_0x96a2('0x1f')]==_0x4da286;});if(_[_0x96a2('0x20')](_0x1765be)){var _0x23f3d8=_[_0x96a2('0x1d')](this[_0x96a2('0x21')],function(_0x526cc2){return _0x526cc2[_0x96a2('0x1e')]==_0x4da286||_0x526cc2[_0x96a2('0x1f')]==_0x4da286;});if(_0x23f3d8){_0x1765be=_[_0x96a2('0x1d')](this['agents'],function(_0x3c5371){return _0x3c5371[_0x96a2('0x22')]==util['format'](_0x96a2('0x23'),_0x23f3d8[_0x96a2('0x1f')]);});}}return _0x1765be;};Report[_0x96a2('0x1c')][_0x96a2('0x11')]=function(_0x3917ed){for(var _0x25f2f6=0x0;_0x25f2f6<_0x3917ed[_0x96a2('0x24')];_0x25f2f6+=0x1){var _0x31e75f=this[_0x96a2('0x25')](_0x3917ed[_0x25f2f6][_0x96a2('0x26')]);if(_0x31e75f){_0x3917ed[_0x25f2f6][_0x96a2('0x1e')]=_0x31e75f[_0x96a2('0x1e')];_0x3917ed[_0x25f2f6][_0x96a2('0x27')]=!![];_0x3917ed[_0x25f2f6][_0x96a2('0x28')]=_0x31e75f[_0x96a2('0x1f')];_0x3917ed[_0x25f2f6][_0x96a2('0x22')]=_[_0x96a2('0x20')](_0x31e75f[_0x96a2('0x22')])?util[_0x96a2('0x29')](_0x96a2('0x23'),_0x31e75f[_0x96a2('0x1f')]):_0x31e75f['interface'];if(_0x3917ed[_0x25f2f6][_0x96a2('0x2a')]){_0x3917ed[_0x25f2f6][_0x96a2('0x2b')]=moment()[_0x96a2('0x29')](_0x96a2('0x2c'));}if(_0x3917ed[_0x25f2f6][_0x96a2('0x2d')]){_0x3917ed[_0x25f2f6][_0x96a2('0x2e')]=moment()[_0x96a2('0x29')](_0x96a2('0x2c'));}RpcMemberReport[_0x96a2('0x11')](_0x3917ed[_0x25f2f6]);}RpcVoiceQueueReport[_0x96a2('0x2f')](_0x3917ed[_0x25f2f6]);}};function extractCalleridNumber(_0x50d9d8){var _0x319b4f=_0x50d9d8[_0x96a2('0x30')](/<(.*?)>/);return _0x319b4f?_0x319b4f[0x1]:_0x50d9d8;}Report[_0x96a2('0x1c')]['voiceCallReport']=function(_0x58fa6c){_0x58fa6c['destination']=_0x58fa6c[_0x96a2('0x31')]||_0x58fa6c[_0x96a2('0x32')];if(_0x58fa6c[_0x96a2('0x33')]==_0x96a2('0x34')){_0x58fa6c[_0x96a2('0x35')]='queue';_0x58fa6c['lastdata']=_0x58fa6c[_0x96a2('0x36')];if(_0x58fa6c[_0x96a2('0x37')]==_0x96a2('0x38')){_0x58fa6c[_0x96a2('0x1e')]='';_0x58fa6c[_0x96a2('0x31')]=extractCalleridNumber(_0x58fa6c['callerid']);}else if(_0x58fa6c[_0x96a2('0x37')]==_0x96a2('0x39')){if(_0x58fa6c[_0x96a2('0x31')]==_0x96a2('0x3a')){_0x58fa6c['destination']=extractCalleridNumber(_0x58fa6c['calleridpreview']);_0x58fa6c[_0x96a2('0x3b')]=_0x58fa6c[_0x96a2('0x3c')];_0x58fa6c[_0x96a2('0x3d')]=[_0x58fa6c[_0x96a2('0x3e')],_0x58fa6c[_0x96a2('0x3e')]=_0x58fa6c['destinationchannel']][0x0];_0x58fa6c[_0x96a2('0x3f')]=_0x58fa6c[_0x96a2('0x40')];}else{_0x58fa6c[_0x96a2('0x31')]=_0x58fa6c[_0x96a2('0x3b')];_0x58fa6c[_0x96a2('0x3b')]=_0x58fa6c[_0x96a2('0x3c')];if(_0x58fa6c[_0x96a2('0x41')]=='ANSWERED'){_0x58fa6c[_0x96a2('0x1e')]=_0x58fa6c[_0x96a2('0x26')];}else{_0x58fa6c[_0x96a2('0x1e')]='';}}}}else{_0x58fa6c[_0x96a2('0x3f')]=util[_0x96a2('0x29')](_0x96a2('0x42'),_0x58fa6c[_0x96a2('0x43')],_0x58fa6c[_0x96a2('0x3b')]);}RpcVoiceCallReport['create'](_0x58fa6c);if(_0x58fa6c[_0x96a2('0x44')]){for(var _0x3c488c=0x0;_0x3c488c<_0x58fa6c['monitors'][_0x96a2('0x24')];_0x3c488c+=0x1){_0x58fa6c['monitorFilename']=_0x58fa6c[_0x96a2('0x45')][_0x3c488c]['filename'];_0x58fa6c['createdAt']=_0x58fa6c['monitors'][_0x3c488c]['createdAt'];if(_0x58fa6c[_0x96a2('0x32')]=='xcally-motion-preview'){_0x58fa6c[_0x96a2('0x3b')]=_0x58fa6c[_0x96a2('0x26')];_0x58fa6c['calleridname']=_0x58fa6c['connectedlinename'];_0x58fa6c[_0x96a2('0x26')]=_0x58fa6c[_0x96a2('0x1e')];_0x58fa6c[_0x96a2('0x46')]=_0x58fa6c[_0x96a2('0x47')];_0x58fa6c[_0x96a2('0x32')]=_0x58fa6c['originatecalleridnum'];}else if(_0x58fa6c[_0x96a2('0x32')]==_0x96a2('0x48')){_0x58fa6c[_0x96a2('0x3b')]=_0x58fa6c[_0x96a2('0x31')];_0x58fa6c[_0x96a2('0x32')]=_0x58fa6c[_0x96a2('0x3c')];}RpcVoiceRecording[_0x96a2('0x2f')](_0x58fa6c);}}};Report[_0x96a2('0x1c')][_0x96a2('0x16')]=function(_0x24c0e3){if(_[_0x96a2('0x49')](_0x24c0e3)){_0x24c0e3[_0x96a2('0x4a')](function(_0x4e05f2){RpcVoiceAgentReport[_0x96a2('0x2f')](_0x4e05f2);});}else{RpcVoiceAgentReport[_0x96a2('0x2f')](_0x24c0e3);}};Report[_0x96a2('0x1c')]['voiceDialReport']=function(_0xfc648c){RpcVoiceDialReport['create'](_0xfc648c);var _0x41253c=undefined;var _0x2e9b1f=_0xfc648c[_0x96a2('0x3e')];if(_['startsWith'](_0x2e9b1f,_0x96a2('0x4b'))){var _0x221c0f=_0x2e9b1f[_0x96a2('0x4c')](_0x2e9b1f[_0x96a2('0x4d')]('/')+0x1,_0x2e9b1f[_0x96a2('0x4d')]('@'));_0x41253c=_[_0x96a2('0x1d')](this[_0x96a2('0xd')],function(_0x16cb46){return _0x16cb46[_0x96a2('0x4e')]==_0x221c0f||_0x16cb46[_0x96a2('0x4f')]==_0x221c0f||_0x16cb46['accountcode']==_0x221c0f;});}else{var _0x221c0f=_0x2e9b1f[_0x96a2('0x4c')](_0x2e9b1f['indexOf']('/')+0x1,_0x2e9b1f[_0x96a2('0x50')]('-'));_0x41253c=this['findAgent'](_0x221c0f);}if(_0x41253c){_0xfc648c[_0x96a2('0x22')]=_['isNil'](_0x41253c[_0x96a2('0x22')])?util[_0x96a2('0x29')](_0x96a2('0x23'),_0x41253c[_0x96a2('0x1f')]):_0x41253c[_0x96a2('0x22')];_0xfc648c[_0x96a2('0x47')]=_0x41253c[_0x96a2('0x1f')];_0xfc648c[_0x96a2('0x1e')]=_0x41253c[_0x96a2('0x1e')];RpcMemberReport['voiceDialReport'](_0xfc648c);}};Report[_0x96a2('0x1c')][_0x96a2('0x51')]=function(_0x31c735){RpcVoiceTransferReport[_0x96a2('0x51')](_0x31c735);};Report[_0x96a2('0x1c')][_0x96a2('0x1b')]=function(_0x404601){RpcVoiceTransferReport[_0x96a2('0x1b')](_0x404601);};module[_0x96a2('0x52')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 0c88e16..1fce202 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 _0xfa2a=['moment','bluebird','util','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','error','inspect','prototype','resolve','[loopSyncRealTimeShow]','isUndefined','emit','isNotNull','trunks','username','stateRegistry','state','omit','event','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','startsWith','Queue','Local','indexOf','find','accountcode','[syncDeviceState][UserReport]','peer','status','address','[syncPeerStatus][UserReport]','exports','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfa2a,0x107));var _0xafa2=function(_0x2d508f,_0x188b5a){_0x2d508f=_0x2d508f-0x0;var _0xfb369b=_0xfa2a[_0x2d508f];return _0xfb369b;};'use strict';var _=require(_0xafa2('0x0'));var moment=require(_0xafa2('0x1'));var BPromise=require(_0xafa2('0x2'));var util=require(_0xafa2('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xafa2('0x4'))(_0xafa2('0x5'));var ami=require(_0xafa2('0x6'));config[_0xafa2('0x7')]=_[_0xafa2('0x8')](config[_0xafa2('0x7')],{'host':_0xafa2('0x9'),'port':0x18eb});var io=require(_0xafa2('0xa'))(new Redis(config[_0xafa2('0x7')]));function UserReport(_0x51825e){this['trunks']=_0x51825e['trunks'];this[_0xafa2('0xb')]=_0x51825e[_0xafa2('0xb')];this[_0xafa2('0xc')]=_0x51825e[_0xafa2('0xc')];ami['on'](_0xafa2('0xd'),this[_0xafa2('0xe')]['bind'](this));ami['on']('registry',this[_0xafa2('0xe')][_0xafa2('0xf')](this));ami['on'](_0xafa2('0x10'),this[_0xafa2('0x11')][_0xafa2('0xf')](this));ami['on'](_0xafa2('0x12'),this[_0xafa2('0x13')][_0xafa2('0xf')](this));this[_0xafa2('0x14')]();return BPromise['resolve']()[_0xafa2('0x15')](ami[_0xafa2('0x16')]())[_0xafa2('0x15')](ami[_0xafa2('0x17')]())[_0xafa2('0x15')](ami[_0xafa2('0x18')]())[_0xafa2('0x19')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x5bb5e5){return function(_0x51db3f){logger[_0xafa2('0x1a')](_0x5bb5e5,util[_0xafa2('0x1b')](_0x51db3f,{'showHidden':![],'depth':null}));};}UserReport[_0xafa2('0x1c')][_0xafa2('0x14')]=function(){setInterval(function(){BPromise[_0xafa2('0x1d')]()[_0xafa2('0x15')](ami[_0xafa2('0x16')]())[_0xafa2('0x15')](ami[_0xafa2('0x17')]())['then'](ami[_0xafa2('0x18')]())[_0xafa2('0x19')](loggerCatch(_0xafa2('0x1e')));},0x32c8);};UserReport[_0xafa2('0x1c')]['isNotNull']=function(_0x1a621d){return _0x1a621d!==null&&!_[_0xafa2('0x1f')](_0x1a621d);};UserReport[_0xafa2('0x1c')]['emit']=function(_0x922c76,_0x1729df,_0x107c02){io['to'](_0x922c76)[_0xafa2('0x20')](_0x1729df,_0x107c02);};UserReport[_0xafa2('0x1c')][_0xafa2('0xe')]=function(_0x4cbc54){try{if(this[_0xafa2('0x21')](_0x4cbc54)){var _0x5188c0=_['find'](this[_0xafa2('0x22')],{'registry':_0x4cbc54[_0xafa2('0x23')]});if(_0x5188c0){_0x4cbc54[_0xafa2('0x24')]=_0x4cbc54[_0xafa2('0x25')];_['merge'](_0x5188c0,_[_0xafa2('0x26')](_0x4cbc54,[_0xafa2('0x27'),'actionid',_0xafa2('0x23'),_0xafa2('0x25')]));this[_0xafa2('0x20')](util[_0xafa2('0x28')](_0xafa2('0x29'),_0x5188c0[_0xafa2('0x2a')]),_0xafa2('0x2b'),_0x5188c0);}}}catch(_0x3a8a19){logger['error'](_0xafa2('0x2c'),util[_0xafa2('0x1b')](_0x3a8a19,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xafa2('0x11')]=function(_0x1b27d9){try{if(this[_0xafa2('0x21')](_0x1b27d9)){if(this[_0xafa2('0xb')][_0x1b27d9[_0xafa2('0x2d')]]){if(!this[_0xafa2('0xb')][_0x1b27d9[_0xafa2('0x2d')]][_0xafa2('0x2e')]||_0x1b27d9[_0xafa2('0x25')][_0xafa2('0x2f')]()==_0xafa2('0x30')){this[_0xafa2('0xb')][_0x1b27d9[_0xafa2('0x2d')]]['local']=![];if(this[_0xafa2('0xb')][_0x1b27d9[_0xafa2('0x2d')]]['state']!==_0x1b27d9['state']['toLowerCase']()){this[_0xafa2('0xb')][_0x1b27d9[_0xafa2('0x2d')]][_0xafa2('0x31')]=_[_0xafa2('0x32')](moment()[_0xafa2('0x28')]('x'));}this[_0xafa2('0xb')][_0x1b27d9['device']]['state']=_0x1b27d9[_0xafa2('0x25')][_0xafa2('0x2f')]();this[_0xafa2('0xb')][_0x1b27d9[_0xafa2('0x2d')]][_0xafa2('0x33')](_0x1b27d9);}}else if(this[_0xafa2('0xc')][_0x1b27d9['device']]){if(this['telephones'][_0x1b27d9[_0xafa2('0x2d')]][_0xafa2('0x25')]!==_0x1b27d9[_0xafa2('0x25')][_0xafa2('0x2f')]()){this['telephones'][_0x1b27d9[_0xafa2('0x2d')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this[_0xafa2('0xc')][_0x1b27d9['device']][_0xafa2('0x25')]=_0x1b27d9['state']['toLowerCase']();this[_0xafa2('0x20')](util[_0xafa2('0x28')](_0xafa2('0x34'),this[_0xafa2('0xc')][_0x1b27d9[_0xafa2('0x2d')]][_0xafa2('0x2a')]),_0xafa2('0x35'),this[_0xafa2('0xc')][_0x1b27d9['device']]);}else if(this[_0xafa2('0x22')][_0x1b27d9['device']]){if(this['trunks'][_0x1b27d9[_0xafa2('0x2d')]][_0xafa2('0x25')]!==_0x1b27d9['state']['toLowerCase']()){this[_0xafa2('0x22')][_0x1b27d9['device']][_0xafa2('0x31')]=_[_0xafa2('0x32')](moment()[_0xafa2('0x28')]('x'));}this[_0xafa2('0x22')][_0x1b27d9[_0xafa2('0x2d')]]['state']=_0x1b27d9[_0xafa2('0x25')][_0xafa2('0x2f')]();this[_0xafa2('0x20')](util[_0xafa2('0x28')](_0xafa2('0x29'),this[_0xafa2('0x22')][_0x1b27d9[_0xafa2('0x2d')]]['name']),_0xafa2('0x2b'),this[_0xafa2('0x22')][_0x1b27d9[_0xafa2('0x2d')]]);}else if(_[_0xafa2('0x36')](_0x1b27d9[_0xafa2('0x2d')],_0xafa2('0x37'))){}else if(_['startsWith'](_0x1b27d9[_0xafa2('0x2d')],_0xafa2('0x38'))){var _0x591bcd=_0x1b27d9[_0xafa2('0x2d')];var _0x1ab998=_0x591bcd['substring'](_0x591bcd[_0xafa2('0x39')]('/')+0x1,_0x591bcd[_0xafa2('0x39')]('@'));var _0x118782=_[_0xafa2('0x3a')](this[_0xafa2('0xb')],function(_0x49e902){return _0x49e902['mobile']==_0x1ab998||_0x49e902['phone']==_0x1ab998||_0x49e902[_0xafa2('0x3b')]==_0x1ab998;});if(_0x118782){if(_0x118782[_0xafa2('0x25')]!==_0x1b27d9[_0xafa2('0x25')]['toLowerCase']()){_0x118782[_0xafa2('0x31')]=_[_0xafa2('0x32')](moment()[_0xafa2('0x28')]('x'));}_0x118782[_0xafa2('0x25')]=_0x1b27d9[_0xafa2('0x25')][_0xafa2('0x2f')]();_0x118782['local']=!![];_0x118782[_0xafa2('0x33')](_0x1b27d9);}}else{}}}catch(_0x525f98){logger[_0xafa2('0x1a')](_0xafa2('0x3c'),util['inspect'](_0x525f98,{'showHidden':![],'depth':null}));}};UserReport[_0xafa2('0x1c')]['syncPeerStatus']=function(_0x3493da){try{if(this[_0xafa2('0x21')](_0x3493da)&&this[_0xafa2('0x21')](_0x3493da[_0xafa2('0x12')])){if(this[_0xafa2('0xb')][_0x3493da[_0xafa2('0x3d')]]){if(!this['agents'][_0x3493da[_0xafa2('0x3d')]]['local']||_0x3493da['peerstatus']['toLowerCase']()=='registered'){this[_0xafa2('0xb')][_0x3493da[_0xafa2('0x3d')]][_0xafa2('0x2e')]=![];this['agents'][_0x3493da['peer']][_0xafa2('0x3e')]=_0x3493da[_0xafa2('0x12')][_0xafa2('0x2f')]();this[_0xafa2('0xb')][_0x3493da[_0xafa2('0x3d')]][_0xafa2('0x3f')]=_0x3493da[_0xafa2('0x3f')];this[_0xafa2('0xb')][_0x3493da[_0xafa2('0x3d')]][_0xafa2('0x33')](_0x3493da);}}else if(this[_0xafa2('0xc')][_0x3493da[_0xafa2('0x3d')]]){this[_0xafa2('0xc')][_0x3493da[_0xafa2('0x3d')]][_0xafa2('0x3e')]=_0x3493da[_0xafa2('0x12')][_0xafa2('0x2f')]();this[_0xafa2('0xc')][_0x3493da[_0xafa2('0x3d')]][_0xafa2('0x3f')]=_0x3493da[_0xafa2('0x3f')];this[_0xafa2('0x20')](util[_0xafa2('0x28')](_0xafa2('0x34'),this[_0xafa2('0xc')][_0x3493da[_0xafa2('0x3d')]]['name']),'telephone:save',this['telephones'][_0x3493da[_0xafa2('0x3d')]]);}else if(this[_0xafa2('0x22')][_0x3493da[_0xafa2('0x3d')]]){this[_0xafa2('0x22')][_0x3493da[_0xafa2('0x3d')]]['status']=_0x3493da['peerstatus'][_0xafa2('0x2f')]();this[_0xafa2('0x22')][_0x3493da[_0xafa2('0x3d')]]['address']=_0x3493da[_0xafa2('0x3f')];this['emit'](util['format']('trunk:%s',this[_0xafa2('0x22')][_0x3493da[_0xafa2('0x3d')]][_0xafa2('0x2a')]),'trunk:save',this['trunks'][_0x3493da[_0xafa2('0x3d')]]);}else{}}}catch(_0x2a7f90){logger[_0xafa2('0x1a')](_0xafa2('0x40'),util['inspect'](_0x2a7f90,{'showHidden':![],'depth':null}));}};module[_0xafa2('0x41')]=UserReport; \ No newline at end of file +var _0x3401=['actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','error','inspect','loopSyncRealTimeShow','catch','[loopSyncRealTimeShow]','prototype','isUndefined','emit','isNotNull','find','username','merge','event','actionid','state','format','trunk:%s','trunk:save','[syncRegistry][UserReport]','syncDeviceState','device','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','telephone:%s','name','telephone:save','startsWith','Local','indexOf','mobile','phone','accountcode','registered','peer','status','address','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','peerstatus','syncPeerStatus','resolve','then'];(function(_0x18261f,_0x3eddfa){var _0x1c5910=function(_0x57224e){while(--_0x57224e){_0x18261f['push'](_0x18261f['shift']());}};_0x1c5910(++_0x3eddfa);}(_0x3401,0x176));var _0x1340=function(_0x5b04d4,_0x17a9be){_0x5b04d4=_0x5b04d4-0x0;var _0x1106c8=_0x3401[_0x5b04d4];return _0x1106c8;};'use strict';var _=require(_0x1340('0x0'));var moment=require(_0x1340('0x1'));var BPromise=require(_0x1340('0x2'));var util=require('util');var Redis=require(_0x1340('0x3'));var config=require(_0x1340('0x4'));var logger=require(_0x1340('0x5'))('ami');var ami=require(_0x1340('0x6'));config[_0x1340('0x7')]=_[_0x1340('0x8')](config[_0x1340('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x1340('0x9'))(new Redis(config['redis']));function UserReport(_0x34f567){this[_0x1340('0xa')]=_0x34f567[_0x1340('0xa')];this[_0x1340('0xb')]=_0x34f567['agents'];this[_0x1340('0xc')]=_0x34f567[_0x1340('0xc')];ami['on'](_0x1340('0xd'),this[_0x1340('0xe')][_0x1340('0xf')](this));ami['on'](_0x1340('0x10'),this[_0x1340('0xe')][_0x1340('0xf')](this));ami['on'](_0x1340('0x11'),this['syncDeviceState'][_0x1340('0xf')](this));ami['on'](_0x1340('0x12'),this[_0x1340('0x13')][_0x1340('0xf')](this));this['loopSyncRealTimeShow']();return BPromise[_0x1340('0x14')]()[_0x1340('0x15')](ami[_0x1340('0x16')]())[_0x1340('0x15')](ami[_0x1340('0x17')]())['then'](ami[_0x1340('0x18')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x5154fb){return function(_0x1272cb){logger[_0x1340('0x19')](_0x5154fb,util[_0x1340('0x1a')](_0x1272cb,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0x1340('0x1b')]=function(){setInterval(function(){BPromise[_0x1340('0x14')]()[_0x1340('0x15')](ami[_0x1340('0x16')]())[_0x1340('0x15')](ami[_0x1340('0x17')]())[_0x1340('0x15')](ami[_0x1340('0x18')]())[_0x1340('0x1c')](loggerCatch(_0x1340('0x1d')));},0x32c8);};UserReport[_0x1340('0x1e')]['isNotNull']=function(_0x59bcfa){return _0x59bcfa!==null&&!_[_0x1340('0x1f')](_0x59bcfa);};UserReport[_0x1340('0x1e')][_0x1340('0x20')]=function(_0x353b9e,_0x8ff3af,_0xde16a8){io['to'](_0x353b9e)['emit'](_0x8ff3af,_0xde16a8);};UserReport[_0x1340('0x1e')][_0x1340('0xe')]=function(_0x22bf6a){try{if(this[_0x1340('0x21')](_0x22bf6a)){var _0x4bca13=_[_0x1340('0x22')](this[_0x1340('0xa')],{'registry':_0x22bf6a[_0x1340('0x23')]});if(_0x4bca13){_0x22bf6a['stateRegistry']=_0x22bf6a['state'];_[_0x1340('0x24')](_0x4bca13,_['omit'](_0x22bf6a,[_0x1340('0x25'),_0x1340('0x26'),_0x1340('0x23'),_0x1340('0x27')]));this['emit'](util[_0x1340('0x28')](_0x1340('0x29'),_0x4bca13['name']),_0x1340('0x2a'),_0x4bca13);}}}catch(_0x3b4e6c){logger[_0x1340('0x19')](_0x1340('0x2b'),util['inspect'](_0x3b4e6c,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x1340('0x2c')]=function(_0x18b5cd){try{if(this[_0x1340('0x21')](_0x18b5cd)){if(this[_0x1340('0xb')][_0x18b5cd[_0x1340('0x2d')]]){if(!this[_0x1340('0xb')][_0x18b5cd[_0x1340('0x2d')]]['local']||_0x18b5cd['state'][_0x1340('0x2e')]()==_0x1340('0x2f')){this['agents'][_0x18b5cd[_0x1340('0x2d')]][_0x1340('0x30')]=![];if(this[_0x1340('0xb')][_0x18b5cd[_0x1340('0x2d')]][_0x1340('0x27')]!==_0x18b5cd[_0x1340('0x27')][_0x1340('0x2e')]()){this[_0x1340('0xb')][_0x18b5cd[_0x1340('0x2d')]][_0x1340('0x31')]=_[_0x1340('0x32')](moment()[_0x1340('0x28')]('x'));}this[_0x1340('0xb')][_0x18b5cd[_0x1340('0x2d')]][_0x1340('0x27')]=_0x18b5cd[_0x1340('0x27')]['toLowerCase']();this[_0x1340('0xb')][_0x18b5cd[_0x1340('0x2d')]][_0x1340('0x33')](_0x18b5cd);}}else if(this[_0x1340('0xc')][_0x18b5cd['device']]){if(this[_0x1340('0xc')][_0x18b5cd[_0x1340('0x2d')]]['state']!==_0x18b5cd['state'][_0x1340('0x2e')]()){this['telephones'][_0x18b5cd['device']]['stateTime']=_['toNumber'](moment()[_0x1340('0x28')]('x'));}this['telephones'][_0x18b5cd[_0x1340('0x2d')]][_0x1340('0x27')]=_0x18b5cd['state'][_0x1340('0x2e')]();this[_0x1340('0x20')](util['format'](_0x1340('0x34'),this[_0x1340('0xc')][_0x18b5cd[_0x1340('0x2d')]][_0x1340('0x35')]),_0x1340('0x36'),this[_0x1340('0xc')][_0x18b5cd['device']]);}else if(this[_0x1340('0xa')][_0x18b5cd[_0x1340('0x2d')]]){if(this[_0x1340('0xa')][_0x18b5cd[_0x1340('0x2d')]][_0x1340('0x27')]!==_0x18b5cd['state'][_0x1340('0x2e')]()){this[_0x1340('0xa')][_0x18b5cd[_0x1340('0x2d')]][_0x1340('0x31')]=_[_0x1340('0x32')](moment()['format']('x'));}this[_0x1340('0xa')][_0x18b5cd[_0x1340('0x2d')]]['state']=_0x18b5cd[_0x1340('0x27')][_0x1340('0x2e')]();this[_0x1340('0x20')](util[_0x1340('0x28')]('trunk:%s',this[_0x1340('0xa')][_0x18b5cd[_0x1340('0x2d')]][_0x1340('0x35')]),_0x1340('0x2a'),this[_0x1340('0xa')][_0x18b5cd[_0x1340('0x2d')]]);}else if(_[_0x1340('0x37')](_0x18b5cd[_0x1340('0x2d')],'Queue')){}else if(_[_0x1340('0x37')](_0x18b5cd[_0x1340('0x2d')],_0x1340('0x38'))){var _0x5456cc=_0x18b5cd[_0x1340('0x2d')];var _0x38071e=_0x5456cc['substring'](_0x5456cc[_0x1340('0x39')]('/')+0x1,_0x5456cc['indexOf']('@'));var _0x26fdf7=_[_0x1340('0x22')](this[_0x1340('0xb')],function(_0x3ec59a){return _0x3ec59a[_0x1340('0x3a')]==_0x38071e||_0x3ec59a[_0x1340('0x3b')]==_0x38071e||_0x3ec59a[_0x1340('0x3c')]==_0x38071e;});if(_0x26fdf7){if(_0x26fdf7[_0x1340('0x27')]!==_0x18b5cd[_0x1340('0x27')][_0x1340('0x2e')]()){_0x26fdf7[_0x1340('0x31')]=_[_0x1340('0x32')](moment()[_0x1340('0x28')]('x'));}_0x26fdf7['state']=_0x18b5cd[_0x1340('0x27')][_0x1340('0x2e')]();_0x26fdf7['local']=!![];_0x26fdf7[_0x1340('0x33')](_0x18b5cd);}}else{}}}catch(_0xc3a36b){logger[_0x1340('0x19')]('[syncDeviceState][UserReport]',util[_0x1340('0x1a')](_0xc3a36b,{'showHidden':![],'depth':null}));}};UserReport[_0x1340('0x1e')]['syncPeerStatus']=function(_0x31a4f9){try{if(this[_0x1340('0x21')](_0x31a4f9)&&this[_0x1340('0x21')](_0x31a4f9['peerstatus'])){if(this[_0x1340('0xb')][_0x31a4f9['peer']]){if(!this['agents'][_0x31a4f9['peer']][_0x1340('0x30')]||_0x31a4f9[_0x1340('0x12')]['toLowerCase']()==_0x1340('0x3d')){this[_0x1340('0xb')][_0x31a4f9['peer']][_0x1340('0x30')]=![];this[_0x1340('0xb')][_0x31a4f9[_0x1340('0x3e')]][_0x1340('0x3f')]=_0x31a4f9[_0x1340('0x12')]['toLowerCase']();this[_0x1340('0xb')][_0x31a4f9[_0x1340('0x3e')]][_0x1340('0x40')]=_0x31a4f9[_0x1340('0x40')];this[_0x1340('0xb')][_0x31a4f9[_0x1340('0x3e')]][_0x1340('0x33')](_0x31a4f9);}}else if(this[_0x1340('0xc')][_0x31a4f9[_0x1340('0x3e')]]){this[_0x1340('0xc')][_0x31a4f9['peer']]['status']=_0x31a4f9[_0x1340('0x12')][_0x1340('0x2e')]();this['telephones'][_0x31a4f9['peer']][_0x1340('0x40')]=_0x31a4f9[_0x1340('0x40')];this['emit'](util[_0x1340('0x28')](_0x1340('0x34'),this[_0x1340('0xc')][_0x31a4f9[_0x1340('0x3e')]]['name']),_0x1340('0x36'),this[_0x1340('0xc')][_0x31a4f9['peer']]);}else if(this[_0x1340('0xa')][_0x31a4f9['peer']]){this[_0x1340('0xa')][_0x31a4f9[_0x1340('0x3e')]][_0x1340('0x3f')]=_0x31a4f9['peerstatus']['toLowerCase']();this['trunks'][_0x31a4f9[_0x1340('0x3e')]][_0x1340('0x40')]=_0x31a4f9[_0x1340('0x40')];this[_0x1340('0x20')](util[_0x1340('0x28')](_0x1340('0x29'),this[_0x1340('0xa')][_0x31a4f9['peer']][_0x1340('0x35')]),_0x1340('0x2a'),this[_0x1340('0xa')][_0x31a4f9['peer']]);}else{}}}catch(_0x62ec7f){logger[_0x1340('0x19')]('[syncPeerStatus][UserReport]',util['inspect'](_0x62ec7f,{'showHidden':![],'depth':null}));}};module[_0x1340('0x41')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 2f83e44..2ed4aa7 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 _0xc4e2=['privilege','custom:agentcalled','user:%s','membername','user:called','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','user:agentconnect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','error','[syncAgentConnect][VoiceAgentReport]','agentringnoanswerAt','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','reason','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','complete','talktime','transfer','agent','acw','agentacw','acwtime','acwTimeout','destconnectedlinenum','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','value','[syncVarSet][VoiceAgentReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','includes','agentcompleteAt','custom:voiceAgentReport','values','transfereeuniqueid','agentconnectAt','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','diff','[syncBlindTransfer][VoiceAgentReport]','channel','substring','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','moment','util','ioredis','../../../config/environment','ami','redis','defaults','localhost','socket.io-emitter','voiceQueues','agents','variables','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','uniqueid','channels','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','omit','event'];(function(_0x5c3502,_0x3e8b3d){var _0x283d8b=function(_0x9dac06){while(--_0x9dac06){_0x5c3502['push'](_0x5c3502['shift']());}};_0x283d8b(++_0x3e8b3d);}(_0xc4e2,0x1c1));var _0x2c4e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xc4e2[_0xf50820];return _0x2a9b10;};'use strict';var _=require('lodash');var moment=require(_0x2c4e('0x0'));var util=require(_0x2c4e('0x1'));var Redis=require(_0x2c4e('0x2'));var config=require(_0x2c4e('0x3'));var logger=require('../../../config/logger')(_0x2c4e('0x4'));var ami=require('../ami');config[_0x2c4e('0x5')]=_[_0x2c4e('0x6')](config[_0x2c4e('0x5')],{'host':_0x2c4e('0x7'),'port':0x18eb});var io=require(_0x2c4e('0x8'))(new Redis(config[_0x2c4e('0x5')]));function VoiceAgentReport(_0x257175){this['channels']={};this[_0x2c4e('0x9')]=_0x257175['voiceQueues'];this[_0x2c4e('0xa')]=_0x257175[_0x2c4e('0xa')];this[_0x2c4e('0xb')]={};ami['on']('agentcalled',this['syncAgentCalled'][_0x2c4e('0xc')](this));ami['on'](_0x2c4e('0xd'),this[_0x2c4e('0xe')]['bind'](this));ami['on'](_0x2c4e('0xf'),this[_0x2c4e('0x10')][_0x2c4e('0xc')](this));ami['on'](_0x2c4e('0x11'),this[_0x2c4e('0x12')][_0x2c4e('0xc')](this));ami['on'](_0x2c4e('0x13'),this[_0x2c4e('0x14')]['bind'](this));ami['on'](_0x2c4e('0x15'),this[_0x2c4e('0x16')]['bind'](this));ami['on'](_0x2c4e('0x17'),this[_0x2c4e('0x18')]['bind'](this));ami['on'](_0x2c4e('0x19'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x2c4e('0x1a'),this[_0x2c4e('0x1b')][_0x2c4e('0xc')](this));ami['on'](_0x2c4e('0x1c'),this[_0x2c4e('0x1d')][_0x2c4e('0xc')](this));ami['on']('blindtransfer',this[_0x2c4e('0x1e')][_0x2c4e('0xc')](this));}VoiceAgentReport[_0x2c4e('0x1f')][_0x2c4e('0x20')]=function(_0x23d7b3,_0x4f1564,_0x39be29){io['to'](_0x23d7b3)[_0x2c4e('0x20')](_0x4f1564,_0x39be29);};VoiceAgentReport['prototype'][_0x2c4e('0x21')]=function(_0x4f5c08){return _0x4f5c08!==null&&!_[_0x2c4e('0x22')](_0x4f5c08);};VoiceAgentReport[_0x2c4e('0x1f')][_0x2c4e('0x23')]=function(_0x4960a4){try{if(this[_0x2c4e('0x21')](_0x4960a4)){if(_[_0x2c4e('0x22')](this['channels'][_0x4960a4[_0x2c4e('0x24')]])){this[_0x2c4e('0x25')][_0x4960a4['uniqueid']]={};}if(_[_0x2c4e('0x22')](this[_0x2c4e('0x25')][_0x4960a4['uniqueid']][_0x4960a4[_0x2c4e('0x26')]])){this['channels'][_0x4960a4[_0x2c4e('0x24')]][_0x4960a4[_0x2c4e('0x26')]]={'agentcalledAt':moment()[_0x2c4e('0x27')](_0x2c4e('0x28')),'lastevent':_0x2c4e('0x29'),'variables':this['variables'][_0x4960a4['uniqueid']],'type':this['voiceQueues'][_0x4960a4[_0x2c4e('0x2a')]]?this[_0x2c4e('0x9')][_0x4960a4[_0x2c4e('0x2a')]][_0x2c4e('0x2b')]||_0x2c4e('0x2c'):'inbound'};}_['merge'](this[_0x2c4e('0x25')][_0x4960a4[_0x2c4e('0x24')]][_0x4960a4[_0x2c4e('0x26')]],_[_0x2c4e('0x2d')](_0x4960a4,[_0x2c4e('0x2e'),_0x2c4e('0x2f')]));ami[_0x2c4e('0x20')](_0x2c4e('0x30'),this[_0x2c4e('0x25')][_0x4960a4[_0x2c4e('0x24')]][_0x4960a4[_0x2c4e('0x26')]]);this[_0x2c4e('0x20')](util[_0x2c4e('0x27')](_0x2c4e('0x31'),_0x4960a4[_0x2c4e('0x32')]),_0x2c4e('0x33'),this[_0x2c4e('0x25')][_0x4960a4[_0x2c4e('0x24')]][_0x4960a4[_0x2c4e('0x26')]]);}}catch(_0x1802ac){logger['error'](_0x2c4e('0x34'),util[_0x2c4e('0x35')](_0x1802ac,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2c4e('0x1f')][_0x2c4e('0xe')]=function(_0x399cc7){try{if(this[_0x2c4e('0x21')](_0x399cc7)){if(this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]]){for(var _0x5390f7 in this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]]){if(this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x2c4e('0x36')](_0x5390f7)){if(_0x399cc7['destuniqueid']===_0x5390f7){this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7]['agentconnectAt']=moment()[_0x2c4e('0x27')](_0x2c4e('0x28'));this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7][_0x2c4e('0x37')]=_0x2c4e('0x38');this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7][_0x2c4e('0x39')]=_0x399cc7['holdtime'];this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7]['connectedlinenum']=_0x399cc7[_0x2c4e('0x3a')];this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7][_0x2c4e('0x3b')]=_0x399cc7[_0x2c4e('0x3b')];this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7]['destchannelstate']=_0x399cc7[_0x2c4e('0x3c')];this[_0x2c4e('0x25')][_0x399cc7['uniqueid']][_0x5390f7]['destchannelstatedesc']=_0x399cc7[_0x2c4e('0x3d')];_[_0x2c4e('0x3e')](this[_0x2c4e('0xa')][_0x399cc7[_0x2c4e('0x3f')]],_['pick'](_0x399cc7,[_0x2c4e('0x2a'),'destconnectedlinenum']));this[_0x2c4e('0x20')](util['format']('user:%s',_0x399cc7[_0x2c4e('0x32')]),_0x2c4e('0x40'),this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x399cc7[_0x2c4e('0x26')]]);ami[_0x2c4e('0x20')]('custom:agentconnect',this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7]);}else if(!this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7]['agentringnoanswer']&&!this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7][_0x2c4e('0x13')]){this['channels'][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7]['agentringnoanswer']=!![];this[_0x2c4e('0x25')][_0x399cc7['uniqueid']][_0x5390f7]['agentringnoanswerAt']=moment()[_0x2c4e('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7]['reason']=_0x2c4e('0x41');this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7][_0x2c4e('0x37')]=_0x2c4e('0x41');this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7][_0x2c4e('0x42')]=_0x399cc7['destuniqueid'];this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7][_0x2c4e('0x43')]=_0x399cc7[_0x2c4e('0x32')];ami[_0x2c4e('0x20')](_0x2c4e('0x44'),this[_0x2c4e('0x25')][_0x399cc7[_0x2c4e('0x24')]][_0x5390f7]);}}}}}}catch(_0x41bd84){logger[_0x2c4e('0x45')](_0x2c4e('0x46'),util[_0x2c4e('0x35')](_0x41bd84,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2c4e('0x1f')]['syncAgentRingNoAnswer']=function(_0x5bac99){try{if(this[_0x2c4e('0x21')](_0x5bac99)){if(this[_0x2c4e('0x25')][_0x5bac99[_0x2c4e('0x24')]]&&this[_0x2c4e('0x25')][_0x5bac99[_0x2c4e('0x24')]][_0x5bac99[_0x2c4e('0x26')]]){this[_0x2c4e('0x25')][_0x5bac99['uniqueid']][_0x5bac99[_0x2c4e('0x26')]][_0x2c4e('0xf')]=!![];this[_0x2c4e('0x25')][_0x5bac99['uniqueid']][_0x5bac99[_0x2c4e('0x26')]][_0x2c4e('0x47')]=moment()[_0x2c4e('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2c4e('0x25')][_0x5bac99[_0x2c4e('0x24')]][_0x5bac99[_0x2c4e('0x26')]]['reason']=_0x2c4e('0x48');this[_0x2c4e('0x25')][_0x5bac99['uniqueid']][_0x5bac99[_0x2c4e('0x26')]]['lastevent']=_0x2c4e('0x48');ami[_0x2c4e('0x20')](_0x2c4e('0x49'),this[_0x2c4e('0x25')][_0x5bac99[_0x2c4e('0x24')]][_0x5bac99['destuniqueid']]);}}}catch(_0x347f97){logger[_0x2c4e('0x45')](_0x2c4e('0x4a'),util[_0x2c4e('0x35')](_0x347f97,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2c4e('0x12')]=function(_0x4cb539){try{if(this[_0x2c4e('0x21')](_0x4cb539)){if(this[_0x2c4e('0x25')][_0x4cb539[_0x2c4e('0x24')]]){for(var _0x5f0f02 in this[_0x2c4e('0x25')][_0x4cb539[_0x2c4e('0x24')]]){if(this[_0x2c4e('0x25')][_0x4cb539[_0x2c4e('0x24')]][_0x2c4e('0x36')](_0x5f0f02)&&!this[_0x2c4e('0x25')][_0x4cb539[_0x2c4e('0x24')]][_0x5f0f02][_0x2c4e('0xf')]&&!this[_0x2c4e('0x25')][_0x4cb539[_0x2c4e('0x24')]][_0x5f0f02]['agentcomplete']){this[_0x2c4e('0x25')][_0x4cb539[_0x2c4e('0x24')]][_0x5f0f02][_0x2c4e('0xf')]=!![];this['channels'][_0x4cb539[_0x2c4e('0x24')]][_0x5f0f02][_0x2c4e('0x47')]=moment()['format'](_0x2c4e('0x28'));this[_0x2c4e('0x25')][_0x4cb539[_0x2c4e('0x24')]][_0x5f0f02][_0x2c4e('0x4b')]=_0x2c4e('0x4c');this['channels'][_0x4cb539[_0x2c4e('0x24')]][_0x5f0f02][_0x2c4e('0x37')]='abandoned';ami[_0x2c4e('0x20')]('custom:agentqueuecallerabandon',this[_0x2c4e('0x25')][_0x4cb539[_0x2c4e('0x24')]][_0x5f0f02]);}}}}}catch(_0x17181f){logger[_0x2c4e('0x45')](_0x2c4e('0x4d'),util['inspect'](_0x17181f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2c4e('0x1f')][_0x2c4e('0x14')]=function(_0x3ff564){try{if(this[_0x2c4e('0x21')](_0x3ff564)){if(this[_0x2c4e('0x25')][_0x3ff564['uniqueid']]){for(var _0x214498 in this[_0x2c4e('0x25')][_0x3ff564[_0x2c4e('0x24')]]){if(this[_0x2c4e('0x25')][_0x3ff564[_0x2c4e('0x24')]][_0x2c4e('0x36')](_0x214498)){if(this[_0x2c4e('0x25')][_0x3ff564[_0x2c4e('0x24')]][_0x214498]['agentconnectAt']&&!this[_0x2c4e('0x25')][_0x3ff564['uniqueid']][_0x214498][_0x2c4e('0x13')]){this['channels'][_0x3ff564[_0x2c4e('0x24')]][_0x214498]['agentcomplete']=!![];this['channels'][_0x3ff564[_0x2c4e('0x24')]][_0x214498]['agentcompleteAt']=moment()[_0x2c4e('0x27')](_0x2c4e('0x28'));this[_0x2c4e('0x25')][_0x3ff564[_0x2c4e('0x24')]][_0x214498][_0x2c4e('0x37')]=_0x2c4e('0x4e');this[_0x2c4e('0x25')][_0x3ff564['uniqueid']][_0x214498][_0x2c4e('0x4f')]=_0x3ff564[_0x2c4e('0x4f')];this[_0x2c4e('0x25')][_0x3ff564[_0x2c4e('0x24')]][_0x214498][_0x2c4e('0x4b')]=_0x3ff564['reason']==_0x2c4e('0x50')?_0x2c4e('0x51'):_0x3ff564[_0x2c4e('0x4b')];if(this[_0x2c4e('0x9')][_0x3ff564[_0x2c4e('0x2a')]]&&this[_0x2c4e('0x9')][_0x3ff564[_0x2c4e('0x2a')]][_0x2c4e('0x52')]){this['channels'][_0x3ff564[_0x2c4e('0x24')]][_0x214498][_0x2c4e('0x53')]=!![];this[_0x2c4e('0x25')][_0x3ff564[_0x2c4e('0x24')]][_0x214498][_0x2c4e('0x54')]=this['voiceQueues'][_0x3ff564[_0x2c4e('0x2a')]][_0x2c4e('0x55')];}this[_0x2c4e('0xa')][_0x3ff564[_0x2c4e('0x3f')]]=_['omit'](this[_0x2c4e('0xa')][_0x3ff564[_0x2c4e('0x3f')]],[_0x2c4e('0x2a'),_0x2c4e('0x56')]);this[_0x2c4e('0x20')](util['format']('user:%s',_0x3ff564['membername']),_0x2c4e('0x57'),this['channels'][_0x3ff564['uniqueid']][_0x214498]);ami[_0x2c4e('0x20')](_0x2c4e('0x58'),this[_0x2c4e('0x25')][_0x3ff564[_0x2c4e('0x24')]][_0x214498]);}}}}}}catch(_0x205b45){logger['error'](_0x2c4e('0x59'),util[_0x2c4e('0x35')](_0x205b45,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2c4e('0x1f')]['syncVarSet']=function(_0x3e50a8){try{if(this[_0x2c4e('0x21')](_0x3e50a8)){this[_0x2c4e('0x5a')](_0x3e50a8['uniqueid'],_[_0x2c4e('0x5b')](_0x3e50a8['variable'])[0x0],_0x3e50a8[_0x2c4e('0x5c')]);if(this[_0x2c4e('0x25')][_0x3e50a8['uniqueid']]){for(var _0x2bc994 in this[_0x2c4e('0x25')][_0x3e50a8[_0x2c4e('0x24')]]){if(this[_0x2c4e('0x25')][_0x3e50a8[_0x2c4e('0x24')]][_0x2c4e('0x36')](_0x2bc994)){if(_[_0x2c4e('0x22')](this[_0x2c4e('0x25')][_0x3e50a8[_0x2c4e('0x24')]][_0x2bc994][_0x2c4e('0xb')])){this[_0x2c4e('0x25')][_0x3e50a8[_0x2c4e('0x24')]][_0x2bc994][_0x2c4e('0xb')]={};}this[_0x2c4e('0x25')][_0x3e50a8['uniqueid']][_0x2bc994][_0x2c4e('0xb')]=this[_0x2c4e('0xb')][_0x3e50a8[_0x2c4e('0x24')]];}}}}}catch(_0x1a3156){logger[_0x2c4e('0x45')](_0x2c4e('0x5d'),util[_0x2c4e('0x35')](_0x1a3156,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2c4e('0x5a')]=function(_0x317adc,_0xd3a583,_0x27c562){var _0x34a0af=['rtpaudioqos',_0x2c4e('0x5e'),_0x2c4e('0x5f'),_0x2c4e('0x60'),_0x2c4e('0x61'),_0x2c4e('0x62'),_0x2c4e('0x63'),_0x2c4e('0x64'),_0x2c4e('0x65'),_0x2c4e('0x66'),'bridgepeer',_0x2c4e('0x67'),_0x2c4e('0x68'),_0x2c4e('0x69'),'memberinterface',_0x2c4e('0x6a'),_0x2c4e('0x32'),'memberpenalty','memberrealtime'];if(!_['isNil'](_0xd3a583)&&!_[_0x2c4e('0x6b')](_0x34a0af,_0xd3a583)){if(_[_0x2c4e('0x22')](this[_0x2c4e('0xb')][_0x317adc])){this[_0x2c4e('0xb')][_0x317adc]={};}this[_0x2c4e('0xb')][_0x317adc][_0xd3a583]=_0x27c562;}};VoiceAgentReport[_0x2c4e('0x1f')]['syncHangup']=function(_0x3fd905){try{if(this['isNotNull'](_0x3fd905)){if(this['channels'][_0x3fd905[_0x2c4e('0x24')]]){for(var _0x5c3bf3 in this[_0x2c4e('0x25')][_0x3fd905[_0x2c4e('0x24')]]){if(this[_0x2c4e('0x25')][_0x3fd905[_0x2c4e('0x24')]][_0x2c4e('0x36')](_0x5c3bf3)){if(this[_0x2c4e('0x25')][_0x3fd905['uniqueid']][_0x5c3bf3][_0x2c4e('0x4b')]==_0x2c4e('0x50')&&this[_0x2c4e('0x25')][_0x3fd905[_0x2c4e('0x24')]][_0x5c3bf3]['agentcomplete']){this[_0x2c4e('0x25')][_0x3fd905[_0x2c4e('0x24')]][_0x5c3bf3][_0x2c4e('0x6c')]=moment()[_0x2c4e('0x27')](_0x2c4e('0x28'));}}}ami[_0x2c4e('0x20')](_0x2c4e('0x6d'),_[_0x2c4e('0x6e')](this['channels'][_0x3fd905[_0x2c4e('0x24')]]));delete this[_0x2c4e('0x25')][_0x3fd905[_0x2c4e('0x24')]];}if(this[_0x2c4e('0xb')][_0x3fd905['uniqueid']]){delete this[_0x2c4e('0xb')][_0x3fd905[_0x2c4e('0x24')]];}}}catch(_0x274512){logger[_0x2c4e('0x45')]('[syncHangup][VoiceAgentReport]',util['inspect'](_0x274512,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2c4e('0x1f')][_0x2c4e('0x1d')]=function(_0x1004f5){try{if(this['isNotNull'](_0x1004f5)){if(this['channels'][_0x1004f5[_0x2c4e('0x6f')]]){for(var _0x2988bc in this['channels'][_0x1004f5['transfereeuniqueid']]){if(this[_0x2c4e('0x25')][_0x1004f5[_0x2c4e('0x6f')]]['hasOwnProperty'](_0x2988bc)){if(_0x1004f5['origtransfereruniqueid']===_0x2988bc){var _0x49664e=moment();this[_0x2c4e('0x25')][_0x1004f5[_0x2c4e('0x6f')]][_0x2988bc][_0x2c4e('0x13')]=!![];this['channels'][_0x1004f5[_0x2c4e('0x6f')]][_0x2988bc]['agentcompleteAt']=moment()['format'](_0x2c4e('0x28'));this[_0x2c4e('0x25')][_0x1004f5[_0x2c4e('0x6f')]][_0x2988bc][_0x2c4e('0x4b')]=_0x2c4e('0x50');this[_0x2c4e('0x25')][_0x1004f5[_0x2c4e('0x6f')]][_0x2988bc][_0x2c4e('0x37')]='complete';this[_0x2c4e('0x25')][_0x1004f5[_0x2c4e('0x6f')]][_0x2988bc][_0x2c4e('0x4f')]=_0x49664e['diff'](this[_0x2c4e('0x25')][_0x1004f5[_0x2c4e('0x6f')]][_0x2988bc][_0x2c4e('0x70')],_0x2c4e('0x71'));}}}}if(this[_0x2c4e('0x25')][_0x1004f5[_0x2c4e('0x72')]]){var _0x481c78=this[_0x2c4e('0x25')][_0x1004f5[_0x2c4e('0x72')]];this['channels'][_0x1004f5['secondtransfereruniqueid']]=this[_0x2c4e('0x25')][_0x1004f5[_0x2c4e('0x6f')]];this[_0x2c4e('0x25')][_0x1004f5[_0x2c4e('0x6f')]]=_0x481c78;}}}catch(_0xeccb5f){logger[_0x2c4e('0x45')](_0x2c4e('0x73'),util['inspect'](_0xeccb5f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2c4e('0x1f')]['syncBlindTransfer']=function(_0x27b7f4){try{if(this[_0x2c4e('0x21')](_0x27b7f4)){if(this[_0x2c4e('0x25')][_0x27b7f4[_0x2c4e('0x6f')]]){for(var _0x270a5f in this['channels'][_0x27b7f4[_0x2c4e('0x6f')]]){if(this['channels'][_0x27b7f4[_0x2c4e('0x6f')]][_0x2c4e('0x36')](_0x270a5f)){if(_0x27b7f4[_0x2c4e('0x74')]===_0x270a5f){var _0x2539af=moment();this[_0x2c4e('0x25')][_0x27b7f4['transfereeuniqueid']][_0x270a5f][_0x2c4e('0x13')]=!![];this[_0x2c4e('0x25')][_0x27b7f4['transfereeuniqueid']][_0x270a5f][_0x2c4e('0x6c')]=_0x2539af;this[_0x2c4e('0x25')][_0x27b7f4[_0x2c4e('0x6f')]][_0x270a5f][_0x2c4e('0x4b')]=_0x2c4e('0x50');this[_0x2c4e('0x25')][_0x27b7f4[_0x2c4e('0x6f')]][_0x270a5f][_0x2c4e('0x37')]='complete';this[_0x2c4e('0x25')][_0x27b7f4['transfereeuniqueid']][_0x270a5f][_0x2c4e('0x4f')]=_0x2539af[_0x2c4e('0x75')](this[_0x2c4e('0x25')][_0x27b7f4[_0x2c4e('0x6f')]][_0x270a5f][_0x2c4e('0x70')],_0x2c4e('0x71'));}}}}}}catch(_0x1bbb34){logger[_0x2c4e('0x45')](_0x2c4e('0x76'),util[_0x2c4e('0x35')](_0x1bbb34,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2c4e('0x1f')]['syncMusicOnHoldStart']=function(_0x4b7d55){var _0x3d0573='';try{if(this[_0x2c4e('0x21')](_0x4b7d55)){if(_0x4b7d55[_0x2c4e('0x77')]){_0x3d0573=_0x4b7d55[_0x2c4e('0x77')][_0x2c4e('0x78')](0x0,_0x4b7d55['channel']['lastIndexOf']('-'));if(this[_0x2c4e('0xa')][_0x3d0573]){this[_0x2c4e('0xa')][_0x3d0573][_0x2c4e('0x79')]=!![];}}}}catch(_0x4b8ec4){logger[_0x2c4e('0x45')](_0x2c4e('0x7a'),util[_0x2c4e('0x35')](_0x4b8ec4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x282338){var _0x29e514='';try{if(this[_0x2c4e('0x21')](_0x282338)){if(_0x282338[_0x2c4e('0x77')]){_0x29e514=_0x282338[_0x2c4e('0x77')]['substring'](0x0,_0x282338[_0x2c4e('0x77')]['lastIndexOf']('-'));if(this['agents'][_0x29e514]){this['agents'][_0x29e514]['onhold']=![];}}}}catch(_0x48fdcb){logger[_0x2c4e('0x45')](_0x2c4e('0x7b'),util[_0x2c4e('0x35')](_0x48fdcb,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xd132=['[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','syncAgentCalled','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','omit','event','privilege','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','syncAgentConnect','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','destconnectedlinenum','user:%s','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','lastevent','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','syncQueueCallerAbandon','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','syncAgentComplete','agentcompleteAt','complete','talktime','agent','agentacw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','includes','transfer','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','substring','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','lastIndexOf'];(function(_0x410f6b,_0x4fce77){var _0x283d98=function(_0x5e1870){while(--_0x5e1870){_0x410f6b['push'](_0x410f6b['shift']());}};_0x283d98(++_0x4fce77);}(_0xd132,0x81));var _0x2d13=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd132[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2d13('0x0'));var moment=require(_0x2d13('0x1'));var util=require(_0x2d13('0x2'));var Redis=require('ioredis');var config=require(_0x2d13('0x3'));var logger=require(_0x2d13('0x4'))(_0x2d13('0x5'));var ami=require(_0x2d13('0x6'));config[_0x2d13('0x7')]=_[_0x2d13('0x8')](config['redis'],{'host':_0x2d13('0x9'),'port':0x18eb});var io=require(_0x2d13('0xa'))(new Redis(config[_0x2d13('0x7')]));function VoiceAgentReport(_0xe8a242){this[_0x2d13('0xb')]={};this[_0x2d13('0xc')]=_0xe8a242['voiceQueues'];this[_0x2d13('0xd')]=_0xe8a242[_0x2d13('0xd')];this[_0x2d13('0xe')]={};ami['on']('agentcalled',this[_0x2d13('0xf')][_0x2d13('0x10')](this));ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x2d13('0x11'),this[_0x2d13('0x12')][_0x2d13('0x10')](this));ami['on'](_0x2d13('0x13'),this['syncQueueCallerAbandon'][_0x2d13('0x10')](this));ami['on'](_0x2d13('0x14'),this['syncAgentComplete'][_0x2d13('0x10')](this));ami['on']('varset',this[_0x2d13('0x15')][_0x2d13('0x10')](this));ami['on'](_0x2d13('0x16'),this[_0x2d13('0x17')]['bind'](this));ami['on'](_0x2d13('0x18'),this[_0x2d13('0x19')][_0x2d13('0x10')](this));ami['on'](_0x2d13('0x1a'),this[_0x2d13('0x1b')][_0x2d13('0x10')](this));ami['on'](_0x2d13('0x1c'),this[_0x2d13('0x1d')][_0x2d13('0x10')](this));ami['on']('blindtransfer',this[_0x2d13('0x1e')]['bind'](this));}VoiceAgentReport[_0x2d13('0x1f')][_0x2d13('0x20')]=function(_0x27fa44,_0x3efd21,_0x3f8de0){io['to'](_0x27fa44)['emit'](_0x3efd21,_0x3f8de0);};VoiceAgentReport['prototype'][_0x2d13('0x21')]=function(_0x2671cd){return _0x2671cd!==null&&!_[_0x2d13('0x22')](_0x2671cd);};VoiceAgentReport[_0x2d13('0x1f')]['syncAgentCalled']=function(_0x309cd3){try{if(this[_0x2d13('0x21')](_0x309cd3)){if(_['isUndefined'](this[_0x2d13('0xb')][_0x309cd3[_0x2d13('0x23')]])){this[_0x2d13('0xb')][_0x309cd3[_0x2d13('0x23')]]={};}if(_['isUndefined'](this['channels'][_0x309cd3[_0x2d13('0x23')]][_0x309cd3[_0x2d13('0x24')]])){this[_0x2d13('0xb')][_0x309cd3[_0x2d13('0x23')]][_0x309cd3[_0x2d13('0x24')]]={'agentcalledAt':moment()[_0x2d13('0x25')](_0x2d13('0x26')),'lastevent':_0x2d13('0x27'),'variables':this[_0x2d13('0xe')][_0x309cd3[_0x2d13('0x23')]],'type':this['voiceQueues'][_0x309cd3[_0x2d13('0x28')]]?this[_0x2d13('0xc')][_0x309cd3[_0x2d13('0x28')]][_0x2d13('0x29')]||_0x2d13('0x2a'):_0x2d13('0x2a')};}_['merge'](this[_0x2d13('0xb')][_0x309cd3[_0x2d13('0x23')]][_0x309cd3['destuniqueid']],_[_0x2d13('0x2b')](_0x309cd3,[_0x2d13('0x2c'),_0x2d13('0x2d')]));ami[_0x2d13('0x20')]('custom:agentcalled',this[_0x2d13('0xb')][_0x309cd3[_0x2d13('0x23')]][_0x309cd3[_0x2d13('0x24')]]);this['emit'](util[_0x2d13('0x25')]('user:%s',_0x309cd3[_0x2d13('0x2e')]),_0x2d13('0x2f'),this['channels'][_0x309cd3[_0x2d13('0x23')]][_0x309cd3[_0x2d13('0x24')]]);}}catch(_0x833ecd){logger[_0x2d13('0x30')](_0x2d13('0x31'),util[_0x2d13('0x32')](_0x833ecd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d13('0x1f')][_0x2d13('0x33')]=function(_0x102112){try{if(this[_0x2d13('0x21')](_0x102112)){if(this['channels'][_0x102112[_0x2d13('0x23')]]){for(var _0x27d5f3 in this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]]){if(this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]]['hasOwnProperty'](_0x27d5f3)){if(_0x102112[_0x2d13('0x24')]===_0x27d5f3){this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]][_0x27d5f3][_0x2d13('0x34')]=moment()[_0x2d13('0x25')](_0x2d13('0x26'));this[_0x2d13('0xb')][_0x102112['uniqueid']][_0x27d5f3]['lastevent']=_0x2d13('0x35');this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]][_0x27d5f3][_0x2d13('0x36')]=_0x102112[_0x2d13('0x36')];this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]][_0x27d5f3][_0x2d13('0x37')]=_0x102112['connectedlinenum'];this['channels'][_0x102112[_0x2d13('0x23')]][_0x27d5f3][_0x2d13('0x38')]=_0x102112[_0x2d13('0x38')];this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]][_0x27d5f3][_0x2d13('0x39')]=_0x102112[_0x2d13('0x39')];this[_0x2d13('0xb')][_0x102112['uniqueid']][_0x27d5f3][_0x2d13('0x3a')]=_0x102112[_0x2d13('0x3a')];_[_0x2d13('0x3b')](this[_0x2d13('0xd')][_0x102112[_0x2d13('0x3c')]],_['pick'](_0x102112,[_0x2d13('0x28'),_0x2d13('0x3d')]));this['emit'](util[_0x2d13('0x25')](_0x2d13('0x3e'),_0x102112['membername']),_0x2d13('0x3f'),this[_0x2d13('0xb')][_0x102112['uniqueid']][_0x102112['destuniqueid']]);ami[_0x2d13('0x20')](_0x2d13('0x40'),this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]][_0x27d5f3]);}else if(!this['channels'][_0x102112['uniqueid']][_0x27d5f3][_0x2d13('0x11')]&&!this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]][_0x27d5f3][_0x2d13('0x14')]){this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]][_0x27d5f3][_0x2d13('0x11')]=!![];this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]][_0x27d5f3][_0x2d13('0x41')]=moment()[_0x2d13('0x25')](_0x2d13('0x26'));this[_0x2d13('0xb')][_0x102112['uniqueid']][_0x27d5f3][_0x2d13('0x42')]=_0x2d13('0x43');this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]][_0x27d5f3][_0x2d13('0x44')]=_0x2d13('0x43');this['channels'][_0x102112[_0x2d13('0x23')]][_0x27d5f3][_0x2d13('0x45')]=_0x102112[_0x2d13('0x24')];this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]][_0x27d5f3]['answeredelsewheremembername']=_0x102112[_0x2d13('0x2e')];ami[_0x2d13('0x20')](_0x2d13('0x46'),this[_0x2d13('0xb')][_0x102112[_0x2d13('0x23')]][_0x27d5f3]);}}}}}}catch(_0x4bacbf){logger['error'](_0x2d13('0x47'),util[_0x2d13('0x32')](_0x4bacbf,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2d13('0x12')]=function(_0xe64c36){try{if(this['isNotNull'](_0xe64c36)){if(this[_0x2d13('0xb')][_0xe64c36['uniqueid']]&&this['channels'][_0xe64c36[_0x2d13('0x23')]][_0xe64c36[_0x2d13('0x24')]]){this[_0x2d13('0xb')][_0xe64c36[_0x2d13('0x23')]][_0xe64c36['destuniqueid']]['agentringnoanswer']=!![];this[_0x2d13('0xb')][_0xe64c36[_0x2d13('0x23')]][_0xe64c36[_0x2d13('0x24')]][_0x2d13('0x41')]=moment()[_0x2d13('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0xe64c36[_0x2d13('0x23')]][_0xe64c36[_0x2d13('0x24')]][_0x2d13('0x42')]='rejected';this['channels'][_0xe64c36[_0x2d13('0x23')]][_0xe64c36[_0x2d13('0x24')]][_0x2d13('0x44')]='rejected';ami[_0x2d13('0x20')](_0x2d13('0x48'),this[_0x2d13('0xb')][_0xe64c36[_0x2d13('0x23')]][_0xe64c36[_0x2d13('0x24')]]);}}}catch(_0x50833f){logger[_0x2d13('0x30')](_0x2d13('0x49'),util[_0x2d13('0x32')](_0x50833f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d13('0x1f')][_0x2d13('0x4a')]=function(_0x3be951){try{if(this[_0x2d13('0x21')](_0x3be951)){if(this[_0x2d13('0xb')][_0x3be951['uniqueid']]){for(var _0x4b5274 in this['channels'][_0x3be951['uniqueid']]){if(this[_0x2d13('0xb')][_0x3be951[_0x2d13('0x23')]][_0x2d13('0x4b')](_0x4b5274)&&!this[_0x2d13('0xb')][_0x3be951[_0x2d13('0x23')]][_0x4b5274]['agentringnoanswer']&&!this[_0x2d13('0xb')][_0x3be951[_0x2d13('0x23')]][_0x4b5274][_0x2d13('0x14')]){this['channels'][_0x3be951['uniqueid']][_0x4b5274][_0x2d13('0x11')]=!![];this[_0x2d13('0xb')][_0x3be951['uniqueid']][_0x4b5274][_0x2d13('0x41')]=moment()[_0x2d13('0x25')](_0x2d13('0x26'));this[_0x2d13('0xb')][_0x3be951[_0x2d13('0x23')]][_0x4b5274][_0x2d13('0x42')]=_0x2d13('0x4c');this[_0x2d13('0xb')][_0x3be951[_0x2d13('0x23')]][_0x4b5274][_0x2d13('0x44')]=_0x2d13('0x4c');ami[_0x2d13('0x20')](_0x2d13('0x4d'),this['channels'][_0x3be951[_0x2d13('0x23')]][_0x4b5274]);}}}}}catch(_0x470ffe){logger[_0x2d13('0x30')]('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0x2d13('0x32')](_0x470ffe,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d13('0x1f')][_0x2d13('0x4e')]=function(_0x1836e5){try{if(this['isNotNull'](_0x1836e5)){if(this[_0x2d13('0xb')][_0x1836e5['uniqueid']]){for(var _0x1fa12a in this[_0x2d13('0xb')][_0x1836e5[_0x2d13('0x23')]]){if(this[_0x2d13('0xb')][_0x1836e5['uniqueid']][_0x2d13('0x4b')](_0x1fa12a)){if(this[_0x2d13('0xb')][_0x1836e5[_0x2d13('0x23')]][_0x1fa12a][_0x2d13('0x34')]&&!this['channels'][_0x1836e5[_0x2d13('0x23')]][_0x1fa12a]['agentcomplete']){this[_0x2d13('0xb')][_0x1836e5[_0x2d13('0x23')]][_0x1fa12a][_0x2d13('0x14')]=!![];this[_0x2d13('0xb')][_0x1836e5[_0x2d13('0x23')]][_0x1fa12a][_0x2d13('0x4f')]=moment()[_0x2d13('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2d13('0xb')][_0x1836e5[_0x2d13('0x23')]][_0x1fa12a][_0x2d13('0x44')]=_0x2d13('0x50');this[_0x2d13('0xb')][_0x1836e5[_0x2d13('0x23')]][_0x1fa12a][_0x2d13('0x51')]=_0x1836e5[_0x2d13('0x51')];this[_0x2d13('0xb')][_0x1836e5[_0x2d13('0x23')]][_0x1fa12a]['reason']=_0x1836e5[_0x2d13('0x42')]=='transfer'?_0x2d13('0x52'):_0x1836e5[_0x2d13('0x42')];if(this[_0x2d13('0xc')][_0x1836e5['queue']]&&this[_0x2d13('0xc')][_0x1836e5['queue']]['acw']){this[_0x2d13('0xb')][_0x1836e5[_0x2d13('0x23')]][_0x1fa12a][_0x2d13('0x53')]=!![];this[_0x2d13('0xb')][_0x1836e5[_0x2d13('0x23')]][_0x1fa12a][_0x2d13('0x54')]=this['voiceQueues'][_0x1836e5[_0x2d13('0x28')]][_0x2d13('0x55')];}this[_0x2d13('0xd')][_0x1836e5[_0x2d13('0x3c')]]=_[_0x2d13('0x2b')](this[_0x2d13('0xd')][_0x1836e5[_0x2d13('0x3c')]],[_0x2d13('0x28'),_0x2d13('0x3d')]);this['emit'](util['format'](_0x2d13('0x3e'),_0x1836e5[_0x2d13('0x2e')]),_0x2d13('0x56'),this[_0x2d13('0xb')][_0x1836e5[_0x2d13('0x23')]][_0x1fa12a]);ami[_0x2d13('0x20')](_0x2d13('0x57'),this[_0x2d13('0xb')][_0x1836e5[_0x2d13('0x23')]][_0x1fa12a]);}}}}}}catch(_0x73ee61){logger[_0x2d13('0x30')](_0x2d13('0x58'),util['inspect'](_0x73ee61,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d13('0x1f')][_0x2d13('0x15')]=function(_0x4f1faa){try{if(this[_0x2d13('0x21')](_0x4f1faa)){this[_0x2d13('0x59')](_0x4f1faa[_0x2d13('0x23')],_[_0x2d13('0x5a')](_0x4f1faa[_0x2d13('0x5b')])[0x0],_0x4f1faa[_0x2d13('0x5c')]);if(this[_0x2d13('0xb')][_0x4f1faa[_0x2d13('0x23')]]){for(var _0x3407c4 in this['channels'][_0x4f1faa[_0x2d13('0x23')]]){if(this['channels'][_0x4f1faa['uniqueid']][_0x2d13('0x4b')](_0x3407c4)){if(_[_0x2d13('0x22')](this['channels'][_0x4f1faa[_0x2d13('0x23')]][_0x3407c4][_0x2d13('0xe')])){this['channels'][_0x4f1faa[_0x2d13('0x23')]][_0x3407c4][_0x2d13('0xe')]={};}this['channels'][_0x4f1faa['uniqueid']][_0x3407c4][_0x2d13('0xe')]=this['variables'][_0x4f1faa[_0x2d13('0x23')]];}}}}}catch(_0x458eff){logger['error'](_0x2d13('0x5d'),util[_0x2d13('0x32')](_0x458eff,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d13('0x1f')][_0x2d13('0x59')]=function(_0x55a1f1,_0x37df4e,_0x4d73fb){var _0x1f83a8=[_0x2d13('0x5e'),_0x2d13('0x5f'),_0x2d13('0x60'),_0x2d13('0x61'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x2d13('0x62'),'rtpaudioqosrttbridged',_0x2d13('0x63'),_0x2d13('0x64'),_0x2d13('0x65'),_0x2d13('0x66'),_0x2d13('0x67'),_0x2d13('0x68'),_0x2d13('0x69'),_0x2d13('0x6a'),_0x2d13('0x2e'),_0x2d13('0x6b'),'memberrealtime'];if(!_[_0x2d13('0x6c')](_0x37df4e)&&!_[_0x2d13('0x6d')](_0x1f83a8,_0x37df4e)){if(_[_0x2d13('0x22')](this[_0x2d13('0xe')][_0x55a1f1])){this[_0x2d13('0xe')][_0x55a1f1]={};}this[_0x2d13('0xe')][_0x55a1f1][_0x37df4e]=_0x4d73fb;}};VoiceAgentReport['prototype'][_0x2d13('0x17')]=function(_0x39bbdd){try{if(this[_0x2d13('0x21')](_0x39bbdd)){if(this[_0x2d13('0xb')][_0x39bbdd['uniqueid']]){for(var _0x2ce5e9 in this[_0x2d13('0xb')][_0x39bbdd[_0x2d13('0x23')]]){if(this[_0x2d13('0xb')][_0x39bbdd[_0x2d13('0x23')]]['hasOwnProperty'](_0x2ce5e9)){if(this[_0x2d13('0xb')][_0x39bbdd[_0x2d13('0x23')]][_0x2ce5e9][_0x2d13('0x42')]==_0x2d13('0x6e')&&this['channels'][_0x39bbdd['uniqueid']][_0x2ce5e9][_0x2d13('0x14')]){this[_0x2d13('0xb')][_0x39bbdd['uniqueid']][_0x2ce5e9]['agentcompleteAt']=moment()[_0x2d13('0x25')](_0x2d13('0x26'));}}}ami['emit']('custom:voiceAgentReport',_[_0x2d13('0x6f')](this[_0x2d13('0xb')][_0x39bbdd[_0x2d13('0x23')]]));delete this[_0x2d13('0xb')][_0x39bbdd[_0x2d13('0x23')]];}if(this[_0x2d13('0xe')][_0x39bbdd['uniqueid']]){delete this[_0x2d13('0xe')][_0x39bbdd[_0x2d13('0x23')]];}}}catch(_0x314b5e){logger[_0x2d13('0x30')](_0x2d13('0x70'),util[_0x2d13('0x32')](_0x314b5e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d13('0x1f')][_0x2d13('0x1d')]=function(_0x7e17af){try{if(this[_0x2d13('0x21')](_0x7e17af)){if(this['channels'][_0x7e17af[_0x2d13('0x71')]]){for(var _0x1fb2a6 in this['channels'][_0x7e17af[_0x2d13('0x71')]]){if(this[_0x2d13('0xb')][_0x7e17af[_0x2d13('0x71')]][_0x2d13('0x4b')](_0x1fb2a6)){if(_0x7e17af[_0x2d13('0x72')]===_0x1fb2a6){var _0xb705e8=moment();this[_0x2d13('0xb')][_0x7e17af[_0x2d13('0x71')]][_0x1fb2a6][_0x2d13('0x14')]=!![];this['channels'][_0x7e17af['transfereeuniqueid']][_0x1fb2a6][_0x2d13('0x4f')]=moment()['format'](_0x2d13('0x26'));this[_0x2d13('0xb')][_0x7e17af[_0x2d13('0x71')]][_0x1fb2a6][_0x2d13('0x42')]='transfer';this[_0x2d13('0xb')][_0x7e17af[_0x2d13('0x71')]][_0x1fb2a6][_0x2d13('0x44')]=_0x2d13('0x50');this[_0x2d13('0xb')][_0x7e17af[_0x2d13('0x71')]][_0x1fb2a6][_0x2d13('0x51')]=_0xb705e8[_0x2d13('0x73')](this[_0x2d13('0xb')][_0x7e17af[_0x2d13('0x71')]][_0x1fb2a6]['agentconnectAt'],_0x2d13('0x74'));}}}}if(this[_0x2d13('0xb')][_0x7e17af[_0x2d13('0x75')]]){var _0x10d76d=this['channels'][_0x7e17af['secondtransfereruniqueid']];this[_0x2d13('0xb')][_0x7e17af[_0x2d13('0x75')]]=this[_0x2d13('0xb')][_0x7e17af[_0x2d13('0x71')]];this[_0x2d13('0xb')][_0x7e17af[_0x2d13('0x71')]]=_0x10d76d;}}}catch(_0x157320){logger[_0x2d13('0x30')]('[syncAttendedTransfer][VoiceAgentReport]',util['inspect'](_0x157320,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d13('0x1f')][_0x2d13('0x1e')]=function(_0x335ed9){try{if(this[_0x2d13('0x21')](_0x335ed9)){if(this[_0x2d13('0xb')][_0x335ed9[_0x2d13('0x71')]]){for(var _0x5b19fc in this[_0x2d13('0xb')][_0x335ed9[_0x2d13('0x71')]]){if(this[_0x2d13('0xb')][_0x335ed9[_0x2d13('0x71')]]['hasOwnProperty'](_0x5b19fc)){if(_0x335ed9[_0x2d13('0x76')]===_0x5b19fc){var _0xc5de1c=moment();this[_0x2d13('0xb')][_0x335ed9[_0x2d13('0x71')]][_0x5b19fc][_0x2d13('0x14')]=!![];this['channels'][_0x335ed9[_0x2d13('0x71')]][_0x5b19fc][_0x2d13('0x4f')]=_0xc5de1c;this[_0x2d13('0xb')][_0x335ed9[_0x2d13('0x71')]][_0x5b19fc][_0x2d13('0x42')]=_0x2d13('0x6e');this[_0x2d13('0xb')][_0x335ed9[_0x2d13('0x71')]][_0x5b19fc]['lastevent']=_0x2d13('0x50');this[_0x2d13('0xb')][_0x335ed9[_0x2d13('0x71')]][_0x5b19fc][_0x2d13('0x51')]=_0xc5de1c[_0x2d13('0x73')](this[_0x2d13('0xb')][_0x335ed9['transfereeuniqueid']][_0x5b19fc][_0x2d13('0x34')],_0x2d13('0x74'));}}}}}}catch(_0x3b1e3c){logger[_0x2d13('0x30')](_0x2d13('0x77'),util[_0x2d13('0x32')](_0x3b1e3c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x3a3dbe){var _0x31ee35='';try{if(this[_0x2d13('0x21')](_0x3a3dbe)){if(_0x3a3dbe['channel']){_0x31ee35=_0x3a3dbe[_0x2d13('0x78')][_0x2d13('0x79')](0x0,_0x3a3dbe['channel']['lastIndexOf']('-'));if(this['agents'][_0x31ee35]){this[_0x2d13('0xd')][_0x31ee35][_0x2d13('0x7a')]=!![];}}}}catch(_0x115aac){logger['error'](_0x2d13('0x7b'),util[_0x2d13('0x32')](_0x115aac,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d13('0x1f')][_0x2d13('0x1b')]=function(_0x2f8c49){var _0x2e9545='';try{if(this[_0x2d13('0x21')](_0x2f8c49)){if(_0x2f8c49[_0x2d13('0x78')]){_0x2e9545=_0x2f8c49['channel'][_0x2d13('0x79')](0x0,_0x2f8c49['channel'][_0x2d13('0x7c')]('-'));if(this[_0x2d13('0xd')][_0x2e9545]){this[_0x2d13('0xd')][_0x2e9545][_0x2d13('0x7a')]=![];}}}}catch(_0x13464a){logger[_0x2d13('0x30')](_0x2d13('0x7d'),util[_0x2d13('0x32')](_0x13464a,{'showHidden':![],'depth':null}));}};module[_0x2d13('0x7e')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index da51ec7..54dc9a8 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 _0xc4c2=['calleridnum','xmd-callerid','callerid','xmd-cdrtype','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','mixmonitor_filename','sipcalllinkedid','[syncVarSet][VoiceCallReport]','syncHangup','endtime','diff','billableseconds','from-sip','omit','destconnectedlinenum','custom:voiceCallReport','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereecalleridnum','transfererchannel','[syncBlindTransfer][VoiceCallReport]','[syncMusicOnHoldStart][VoiceCallReport]','mohstarttime','mohtime','exports','bluebird','lodash','util','path','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','queue','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','hangup','attendedtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','log','prototype','isUndefined','emit','syncNewCallerId','isNotNull','linkedid','uniqueid','pick','keys','error','inspect','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','merge','context','split','exten','user:%s','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','appdata','duration','subtract','seconds','includes','match','answered','answertime','holdtime','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','toNumber','UserId','membername','name','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','isNil','rec','syncVarSet','variable','value','xmd-phone'];(function(_0x2d9e68,_0x5befa2){var _0x2d8b49=function(_0x9475a4){while(--_0x9475a4){_0x2d9e68['push'](_0x2d9e68['shift']());}};_0x2d8b49(++_0x5befa2);}(_0xc4c2,0x155));var _0x2c4c=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xc4c2[_0x164eca];return _0x2ce562;};'use strict';var BPromise=require(_0x2c4c('0x0'));var _=require(_0x2c4c('0x1'));var moment=require('moment');var util=require(_0x2c4c('0x2'));var path=require(_0x2c4c('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0x2c4c('0x4'));var Channel=require(_0x2c4c('0x5'));var statusDesc=[_0x2c4c('0x6'),_0x2c4c('0x7'),_0x2c4c('0x8'),_0x2c4c('0x9'),_0x2c4c('0xa'),_0x2c4c('0xb'),_0x2c4c('0xc'),_0x2c4c('0xd'),_0x2c4c('0xe')];var applications=['set',_0x2c4c('0xf'),'agi',_0x2c4c('0x10'),_0x2c4c('0x11'),_0x2c4c('0x12')];var dispositions=[_0x2c4c('0x13'),'FAILED',_0x2c4c('0x14'),'NO\x20ANSWER',_0x2c4c('0x13'),_0x2c4c('0x13'),_0x2c4c('0x15'),_0x2c4c('0x16'),'FAILED',_0x2c4c('0x14'),_0x2c4c('0x14')];var actions={};config[_0x2c4c('0x17')]=_[_0x2c4c('0x18')](config['redis'],{'host':_0x2c4c('0x19'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x14fde3){this[_0x2c4c('0x1a')]=_0x14fde3[_0x2c4c('0x1a')];this[_0x2c4c('0x1b')]=_0x14fde3[_0x2c4c('0x1b')];ami['on'](_0x2c4c('0x1c'),this[_0x2c4c('0x1d')][_0x2c4c('0x1e')](this));ami['on'](_0x2c4c('0x1f'),this[_0x2c4c('0x1d')]['bind'](this));ami['on'](_0x2c4c('0x20'),this[_0x2c4c('0x21')][_0x2c4c('0x1e')](this));ami['on'](_0x2c4c('0x22'),this[_0x2c4c('0x23')][_0x2c4c('0x1e')](this));ami['on'](_0x2c4c('0x24'),this['syncVarSet']['bind'](this));ami['on'](_0x2c4c('0x25'),this['syncHangup'][_0x2c4c('0x1e')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x2c4c('0x1e')](this));ami['on'](_0x2c4c('0x26'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0x2c4c('0x27')]['bind'](this));ami['on'](_0x2c4c('0x28'),this[_0x2c4c('0x29')][_0x2c4c('0x1e')](this));ami['on']('musiconholdstop',this[_0x2c4c('0x2a')][_0x2c4c('0x1e')](this));return BPromise[_0x2c4c('0x2b')]()[_0x2c4c('0x2c')](ami[_0x2c4c('0x2d')]())['catch'](function(_0x515cc9){console[_0x2c4c('0x2e')](_0x515cc9);});}VoiceCallReport[_0x2c4c('0x2f')]['isNotNull']=function(_0x5c92b5){return _0x5c92b5!==null&&!_[_0x2c4c('0x30')](_0x5c92b5);};VoiceCallReport[_0x2c4c('0x2f')]['emit']=function(_0x4e1de7,_0x1c6645,_0x3ce633){io['to'](_0x4e1de7)[_0x2c4c('0x31')](_0x1c6645,_0x3ce633);};VoiceCallReport[_0x2c4c('0x2f')][_0x2c4c('0x32')]=function(_0x25bf23){try{if(this[_0x2c4c('0x33')](_0x25bf23)){if(_0x25bf23['uniqueid']===_0x25bf23[_0x2c4c('0x34')]){if(!_[_0x2c4c('0x30')](this['channels'][_0x25bf23[_0x2c4c('0x35')]])){_['merge'](this[_0x2c4c('0x1a')][_0x25bf23[_0x2c4c('0x35')]],_[_0x2c4c('0x36')](_0x25bf23,_[_0x2c4c('0x37')](this[_0x2c4c('0x1a')][_0x25bf23[_0x2c4c('0x35')]])));}}}}catch(_0x31ef67){logger[_0x2c4c('0x38')]('[syncNewCallerId][VoiceCallReport]',util[_0x2c4c('0x39')](_0x31ef67,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2c4c('0x2f')][_0x2c4c('0x21')]=function(_0x1db9c4){try{if(this['isNotNull'](_0x1db9c4)){if(_0x1db9c4[_0x2c4c('0x35')]===_0x1db9c4['linkedid']&&_0x1db9c4[_0x2c4c('0x3a')]!=_0x2c4c('0x3b')){if(_[_0x2c4c('0x30')](this[_0x2c4c('0x1a')][_0x1db9c4[_0x2c4c('0x35')]])){this[_0x2c4c('0x1a')][_0x1db9c4[_0x2c4c('0x35')]]=new Channel();this['channels'][_0x1db9c4[_0x2c4c('0x35')]][_0x2c4c('0x3c')]=moment()[_0x2c4c('0x3d')](_0x2c4c('0x3e'));this['channels'][_0x1db9c4['uniqueid']][_0x2c4c('0x3f')]=dispositions[_['toNumber'](_0x1db9c4[_0x2c4c('0x40')])];_[_0x2c4c('0x41')](this[_0x2c4c('0x1a')][_0x1db9c4[_0x2c4c('0x35')]],_[_0x2c4c('0x36')](_0x1db9c4,_[_0x2c4c('0x37')](this[_0x2c4c('0x1a')][_0x1db9c4[_0x2c4c('0x35')]])));if(_0x1db9c4[_0x2c4c('0x42')]==='from-sip'){if(this[_0x2c4c('0x1b')][_0x1db9c4[_0x2c4c('0x3a')]['split']('-')[0x0]]){this[_0x2c4c('0x1b')][_0x1db9c4[_0x2c4c('0x3a')][_0x2c4c('0x43')]('-')[0x0]]['destconnectedlinenum']=_0x1db9c4[_0x2c4c('0x44')];this[_0x2c4c('0x31')](util[_0x2c4c('0x3d')](_0x2c4c('0x45'),this['agents'][_0x1db9c4[_0x2c4c('0x3a')][_0x2c4c('0x43')]('-')[0x0]]['name']),_0x2c4c('0x46'),{'destaccountcode':this[_0x2c4c('0x1b')][_0x1db9c4[_0x2c4c('0x3a')][_0x2c4c('0x43')]('-')[0x0]][_0x2c4c('0x47')],'destconnectedlinenum':_0x1db9c4[_0x2c4c('0x44')]});}}}}}}catch(_0x311f6e){logger[_0x2c4c('0x38')](_0x2c4c('0x48'),util[_0x2c4c('0x39')](_0x311f6e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2c4c('0x2f')]['syncNewExten']=function(_0x35c8b6){try{if(this['isNotNull'](_0x35c8b6)){if(_0x35c8b6[_0x2c4c('0x35')]===_0x35c8b6['linkedid']&&_0x35c8b6[_0x2c4c('0x44')]!='h'&&_0x35c8b6[_0x2c4c('0x3a')]!=_0x2c4c('0x3b')){_0x35c8b6[_0x2c4c('0x49')]=_0x35c8b6['application'][_0x2c4c('0x4a')]();_0x35c8b6[_0x2c4c('0x4b')]=(_0x35c8b6[_0x2c4c('0x4c')]||_0x35c8b6[_0x2c4c('0x4b')])[_0x2c4c('0x4a')]();if(_['isUndefined'](this[_0x2c4c('0x1a')][_0x35c8b6['uniqueid']])){this[_0x2c4c('0x1a')][_0x35c8b6['uniqueid']]=new Channel();this[_0x2c4c('0x1a')][_0x35c8b6[_0x2c4c('0x35')]]['starttime']=_0x35c8b6[_0x2c4c('0x4d')]?moment()[_0x2c4c('0x4e')](moment[_0x2c4c('0x4d')](_0x35c8b6[_0x2c4c('0x4d')])[_0x2c4c('0x4f')](),'seconds')['format'](_0x2c4c('0x3e')):moment()['format'](_0x2c4c('0x3e'));this[_0x2c4c('0x1a')][_0x35c8b6[_0x2c4c('0x35')]][_0x2c4c('0x3f')]='NO\x20ANSWER';}_[_0x2c4c('0x41')](this[_0x2c4c('0x1a')][_0x35c8b6[_0x2c4c('0x35')]],_[_0x2c4c('0x36')](_0x35c8b6,_[_0x2c4c('0x37')](this[_0x2c4c('0x1a')][_0x35c8b6['uniqueid']])));if(_[_0x2c4c('0x50')](applications,_0x35c8b6[_0x2c4c('0x49')])){this['channels'][_0x35c8b6[_0x2c4c('0x35')]]['lastapplication']=_0x35c8b6['application'];this[_0x2c4c('0x1a')][_0x35c8b6[_0x2c4c('0x35')]]['lastdata']=_0x35c8b6[_0x2c4c('0x4b')];if(_0x35c8b6['application']==='set'&&_['startsWith'](_0x35c8b6[_0x2c4c('0x4b')],'cdr(')){var _0x4c9a95=_0x35c8b6[_0x2c4c('0x4b')][_0x2c4c('0x43')]('=');var _0x1d77af=_0x4c9a95[0x0][_0x2c4c('0x51')](/cdr\((.*)\)/);if(_0x1d77af){this[_0x2c4c('0x1a')][_0x35c8b6['uniqueid']][_0x1d77af[0x1]]=_0x4c9a95[0x1];}}else if(_0x35c8b6[_0x2c4c('0x49')]===_0x2c4c('0xf')){this[_0x2c4c('0x1a')][_0x35c8b6[_0x2c4c('0x35')]][_0x2c4c('0xf')]=_0x35c8b6[_0x2c4c('0x4b')]['split'](',')[0x0];}}}}}catch(_0x2fb664){logger['error']('[syncNewExten][VoiceCallReport]',util[_0x2c4c('0x39')](_0x2fb664,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2c4c('0x2f')][_0x2c4c('0x23')]=function(_0x4fccaf){try{if(this[_0x2c4c('0x33')](_0x4fccaf)){if(_0x4fccaf[_0x2c4c('0x35')]!==_0x4fccaf[_0x2c4c('0x34')]){if(this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x34')]]){if(_0x4fccaf[_0x2c4c('0x40')]==='6'){if(!this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x34')]][_0x2c4c('0x52')]){var _0x43116f=moment();this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x34')]][_0x2c4c('0x52')]=!![];this['channels'][_0x4fccaf[_0x2c4c('0x34')]][_0x2c4c('0x53')]=_0x43116f[_0x2c4c('0x3d')](_0x2c4c('0x3e'));if(this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x34')]][_0x2c4c('0x3c')]){this[_0x2c4c('0x1a')][_0x4fccaf['linkedid']][_0x2c4c('0x54')]=_0x43116f['diff'](this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x34')]]['starttime'],'seconds');}}this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x34')]]['linkedid']=_0x4fccaf['uniqueid'];if(_0x4fccaf['calleridnum']!==_0x2c4c('0x55')){this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x34')]][_0x2c4c('0x56')]=_0x4fccaf['calleridnum'];}this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x34')]][_0x2c4c('0x57')]=_0x4fccaf[_0x2c4c('0x58')];this['channels'][_0x4fccaf[_0x2c4c('0x34')]][_0x2c4c('0x59')]=_0x4fccaf[_0x2c4c('0x3a')];this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x34')]][_0x2c4c('0x3f')]=dispositions[_[_0x2c4c('0x5a')](_0x4fccaf[_0x2c4c('0x40')])];if(this[_0x2c4c('0x1b')][_0x4fccaf[_0x2c4c('0x3a')][_0x2c4c('0x43')]('-')[0x0]]){this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x34')]][_0x2c4c('0x5b')]=this[_0x2c4c('0x1b')][_0x4fccaf[_0x2c4c('0x3a')][_0x2c4c('0x43')]('-')[0x0]]['id'];this[_0x2c4c('0x1a')][_0x4fccaf['linkedid']]['membername']=this[_0x2c4c('0x1b')][_0x4fccaf[_0x2c4c('0x3a')]['split']('-')[0x0]]['name'];}}}}else{if(this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x35')]]){if(_0x4fccaf[_0x2c4c('0x40')]==='6'){if(this['agents'][_0x4fccaf['channel'][_0x2c4c('0x43')]('-')[0x0]]){this[_0x2c4c('0x1a')][_0x4fccaf[_0x2c4c('0x35')]][_0x2c4c('0x5b')]=this[_0x2c4c('0x1b')][_0x4fccaf['channel'][_0x2c4c('0x43')]('-')[0x0]]['id'];this['channels'][_0x4fccaf['uniqueid']][_0x2c4c('0x5c')]=this[_0x2c4c('0x1b')][_0x4fccaf[_0x2c4c('0x3a')]['split']('-')[0x0]][_0x2c4c('0x5d')];}}}}}}catch(_0x34b442){logger['error'](_0x2c4c('0x5e'),util[_0x2c4c('0x39')](_0x34b442,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2c4c('0x2f')][_0x2c4c('0x5f')]=function(_0x4aff9b,_0xbc9aec){if(this['channels'][_0x4aff9b]){this[_0x2c4c('0x1a')][_0x4aff9b][_0x2c4c('0x60')]=!![];if(_[_0x2c4c('0x61')](_0xbc9aec,_0x2c4c('0x62'))){_0xbc9aec=_0xbc9aec[_0x2c4c('0x63')](_0x2c4c('0x62'),_0x2c4c('0x64'));}this['channels'][_0x4aff9b][_0x2c4c('0x65')]=_0xbc9aec;var _0x1abde2=_['find'](this[_0x2c4c('0x1a')][_0x4aff9b][_0x2c4c('0x66')],{'filename':_0xbc9aec});if(_[_0x2c4c('0x67')](_0x1abde2)){this[_0x2c4c('0x1a')][_0x4aff9b][_0x2c4c('0x66')]['push']({'filename':_0xbc9aec,'createdAt':moment()[_0x2c4c('0x3d')](_0x2c4c('0x3e')),'mixmonitorid':'','status':_0x2c4c('0x68')});}}};VoiceCallReport[_0x2c4c('0x2f')][_0x2c4c('0x69')]=function(_0x358ffa){try{if(this[_0x2c4c('0x33')](_0x358ffa)){if(this[_0x2c4c('0x1a')][_0x358ffa[_0x2c4c('0x35')]]&&_0x358ffa['channel']!=_0x2c4c('0x3b')){if(this['isNotNull'](_0x358ffa['variable'])){if(this['isNotNull'](_0x358ffa[_0x2c4c('0x6a')]['mixmonitor_filename'])){this['syncMixMonitorFilename'](_0x358ffa[_0x2c4c('0x35')],_0x358ffa[_0x2c4c('0x6b')]);}else if(this[_0x2c4c('0x33')](_0x358ffa[_0x2c4c('0x6a')][_0x2c4c('0x6c')])){this[_0x2c4c('0x1a')][_0x358ffa[_0x2c4c('0x35')]][_0x2c4c('0x6d')]=_0x358ffa['value'];}else if(this[_0x2c4c('0x33')](_0x358ffa['variable'][_0x2c4c('0x6e')])){this['channels'][_0x358ffa[_0x2c4c('0x35')]][_0x2c4c('0x6f')]=_0x358ffa[_0x2c4c('0x6b')];}else if(this[_0x2c4c('0x33')](_0x358ffa[_0x2c4c('0x6a')][_0x2c4c('0x70')])){this[_0x2c4c('0x1a')][_0x358ffa[_0x2c4c('0x35')]]['type']=_0x358ffa[_0x2c4c('0x6b')];}else if(this[_0x2c4c('0x33')](_0x358ffa[_0x2c4c('0x6a')][_0x2c4c('0x71')])){this[_0x2c4c('0x1a')][_0x358ffa[_0x2c4c('0x35')]][_0x2c4c('0xf')]=_0x358ffa[_0x2c4c('0x6b')]['split'](',')[0x0];}else if(this[_0x2c4c('0x33')](_0x358ffa[_0x2c4c('0x6a')][_0x2c4c('0x72')])){this[_0x2c4c('0x1a')][_0x358ffa[_0x2c4c('0x35')]][_0x2c4c('0x73')]=_0x358ffa[_0x2c4c('0x6b')];}else if(this[_0x2c4c('0x33')](_0x358ffa[_0x2c4c('0x6a')][_0x2c4c('0x74')])){this[_0x2c4c('0x1a')][_0x358ffa[_0x2c4c('0x35')]]['destination']=_0x358ffa['value'];}else if(this[_0x2c4c('0x33')](_0x358ffa['variable'][_0x2c4c('0x75')])){this[_0x2c4c('0x1a')][_0x358ffa['uniqueid']][_0x2c4c('0x76')]=_0x358ffa['value'];}else if(this[_0x2c4c('0x33')](_0x358ffa[_0x2c4c('0x6a')][_0x2c4c('0x77')])){this['channels'][_0x358ffa[_0x2c4c('0x35')]][_0x2c4c('0xf')]=_0x358ffa[_0x2c4c('0x6b')];}else if(this['isNotNull'](_0x358ffa[_0x2c4c('0x6a')][_0x2c4c('0x78')])){this['channels'][_0x358ffa[_0x2c4c('0x35')]][_0x2c4c('0x79')]=_0x358ffa[_0x2c4c('0x6b')];}}}else if(this[_0x2c4c('0x33')](_0x358ffa[_0x2c4c('0x6a')][_0x2c4c('0x7a')])){if(_0x358ffa[_0x2c4c('0x6b')]){var _0x53850d=path['parse'](_0x358ffa[_0x2c4c('0x6b')])[_0x2c4c('0x5d')];this[_0x2c4c('0x5f')](_0x53850d,_0x358ffa[_0x2c4c('0x6b')]);}}else if(this[_0x2c4c('0x1a')][_0x358ffa[_0x2c4c('0x34')]]){if(this[_0x2c4c('0x33')](_0x358ffa[_0x2c4c('0x6a')])){if(this[_0x2c4c('0x33')](_0x358ffa[_0x2c4c('0x6a')][_0x2c4c('0x78')])){this[_0x2c4c('0x1a')][_0x358ffa['linkedid']][_0x2c4c('0x7b')]=_0x358ffa[_0x2c4c('0x6b')];}}}}}catch(_0x352b7d){logger['error'](_0x2c4c('0x7c'),util[_0x2c4c('0x39')](_0x352b7d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2c4c('0x2f')][_0x2c4c('0x7d')]=function(_0x184148){try{if(this['isNotNull'](_0x184148)){if(this[_0x2c4c('0x1a')][_0x184148['uniqueid']]){var _0x141b5c=moment();this[_0x2c4c('0x1a')][_0x184148['uniqueid']][_0x2c4c('0x7e')]=_0x141b5c[_0x2c4c('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2c4c('0x1a')][_0x184148['uniqueid']][_0x2c4c('0x4d')]=_0x141b5c[_0x2c4c('0x7f')](this[_0x2c4c('0x1a')][_0x184148[_0x2c4c('0x35')]]['starttime'],_0x2c4c('0x4f'));if(this[_0x2c4c('0x1a')][_0x184148[_0x2c4c('0x35')]][_0x2c4c('0x52')]){this['channels'][_0x184148[_0x2c4c('0x35')]][_0x2c4c('0x80')]=_0x141b5c[_0x2c4c('0x7f')](this[_0x2c4c('0x1a')][_0x184148[_0x2c4c('0x35')]][_0x2c4c('0x53')],_0x2c4c('0x4f'));this['channels'][_0x184148[_0x2c4c('0x35')]]['holdtime']=this[_0x2c4c('0x1a')][_0x184148[_0x2c4c('0x35')]][_0x2c4c('0x4d')]-this[_0x2c4c('0x1a')][_0x184148[_0x2c4c('0x35')]][_0x2c4c('0x80')];}if(_0x184148[_0x2c4c('0x42')]===_0x2c4c('0x81')){if(this['agents'][_0x184148[_0x2c4c('0x3a')][_0x2c4c('0x43')]('-')[0x0]]){this['agents'][_0x184148[_0x2c4c('0x3a')]['split']('-')[0x0]]=_[_0x2c4c('0x82')](this['agents'][_0x184148[_0x2c4c('0x3a')][_0x2c4c('0x43')]('-')[0x0]],[_0x2c4c('0x83')]);this['emit'](util['format'](_0x2c4c('0x45'),this[_0x2c4c('0x1b')][_0x184148[_0x2c4c('0x3a')][_0x2c4c('0x43')]('-')[0x0]][_0x2c4c('0x5d')]),'user:agentcomplete',{'destaccountcode':this[_0x2c4c('0x1b')][_0x184148['channel'][_0x2c4c('0x43')]('-')[0x0]][_0x2c4c('0x47')]});}}ami['emit'](_0x2c4c('0x84'),this[_0x2c4c('0x1a')][_0x184148['uniqueid']]);delete this['channels'][_0x184148[_0x2c4c('0x35')]];}}}catch(_0x272a95){logger[_0x2c4c('0x38')](_0x2c4c('0x85'),util['inspect'](_0x272a95,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2c4c('0x2f')][_0x2c4c('0x86')]=function(_0x2e5016){try{if(this[_0x2c4c('0x33')](_0x2e5016)){if(this[_0x2c4c('0x1a')][_0x2e5016[_0x2c4c('0x87')]]){this['channels'][_0x2e5016[_0x2c4c('0x87')]][_0x2c4c('0x88')]=_0x2e5016[_0x2c4c('0x89')];this[_0x2c4c('0x1a')][_0x2e5016['transfereeuniqueid']][_0x2c4c('0x8a')]=_0x2e5016[_0x2c4c('0x8b')];if(this[_0x2c4c('0x1a')][_0x2e5016['secondtransfereruniqueid']]){var _0xf37238=this[_0x2c4c('0x1a')][_0x2e5016[_0x2c4c('0x8c')]];this[_0x2c4c('0x1a')][_0x2e5016['secondtransfereruniqueid']]=this[_0x2c4c('0x1a')][_0x2e5016[_0x2c4c('0x87')]];this[_0x2c4c('0x1a')][_0x2e5016[_0x2c4c('0x87')]]=_0xf37238;}}else if(this['channels'][_0x2e5016[_0x2c4c('0x8d')]]){this[_0x2c4c('0x1a')][_0x2e5016[_0x2c4c('0x8d')]][_0x2c4c('0x88')]=_0x2e5016['origtransferercalleridnum'];this[_0x2c4c('0x1a')][_0x2e5016[_0x2c4c('0x8d')]][_0x2c4c('0x8a')]=_0x2e5016[_0x2c4c('0x8b')];if(this[_0x2c4c('0x1a')][_0x2e5016[_0x2c4c('0x8e')]]){var _0xf37238=this[_0x2c4c('0x1a')][_0x2e5016[_0x2c4c('0x8e')]];this[_0x2c4c('0x1a')][_0x2e5016[_0x2c4c('0x8e')]]=this[_0x2c4c('0x1a')][_0x2e5016['transfertargetuniqueid']];this[_0x2c4c('0x1a')][_0x2e5016[_0x2c4c('0x8d')]]=_0xf37238;}}}}catch(_0x55e667){logger['error']('[syncAttendedTransfer][VoiceCallReport]',util[_0x2c4c('0x39')](_0x55e667,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2c4c('0x2f')][_0x2c4c('0x27')]=function(_0x2798c0){try{if(this[_0x2c4c('0x33')](_0x2798c0)){if(this[_0x2c4c('0x1a')][_0x2798c0['transfereeuniqueid']]){this[_0x2c4c('0x1a')][_0x2798c0[_0x2c4c('0x87')]]['transfercalleridnum']=_0x2798c0[_0x2c4c('0x8f')];this['channels'][_0x2798c0[_0x2c4c('0x87')]][_0x2c4c('0x8a')]=_0x2798c0['extension'];this[_0x2c4c('0x7d')]({'event':'BlindTransfer','uniqueid':_0x2798c0['transfereeuniqueid'],'context':_0x2798c0[_0x2c4c('0x42')],'channel':_0x2798c0[_0x2c4c('0x90')]});}}}catch(_0x2903a1){logger[_0x2c4c('0x38')](_0x2c4c('0x91'),util[_0x2c4c('0x39')](_0x2903a1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2c4c('0x2f')][_0x2c4c('0x29')]=function(_0x219d85){try{if(this[_0x2c4c('0x33')](_0x219d85)){if(this[_0x2c4c('0x1a')][_0x219d85['uniqueid']]){if(!_[_0x2c4c('0x67')](this[_0x2c4c('0x1a')][_0x219d85[_0x2c4c('0x35')]][_0x2c4c('0x53')])){this[_0x2c4c('0x1a')][_0x219d85[_0x2c4c('0x35')]]['mohstarttime']=moment()[_0x2c4c('0x3d')](_0x2c4c('0x3e'));}}}}catch(_0xef37e8){logger[_0x2c4c('0x38')](_0x2c4c('0x92'),util[_0x2c4c('0x39')](_0xef37e8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2c4c('0x2f')][_0x2c4c('0x2a')]=function(_0x444743){try{if(this['isNotNull'](_0x444743)){if(this[_0x2c4c('0x1a')][_0x444743['uniqueid']]){if(!_[_0x2c4c('0x67')](this[_0x2c4c('0x1a')][_0x444743[_0x2c4c('0x35')]][_0x2c4c('0x93')])){this[_0x2c4c('0x1a')][_0x444743[_0x2c4c('0x35')]][_0x2c4c('0x94')]+=moment()['milliseconds'](0x0)[_0x2c4c('0x7f')](this['channels'][_0x444743[_0x2c4c('0x35')]][_0x2c4c('0x93')],_0x2c4c('0x4f'));delete this[_0x2c4c('0x1a')][_0x444743['uniqueid']]['mohstarttime'];}}}}catch(_0x3c818d){logger[_0x2c4c('0x38')]('[syncMusicOnHoldStop][VoiceCallReport]',util['inspect'](_0x3c818d,{'showHidden':![],'depth':null}));}};module[_0x2c4c('0x95')]=VoiceCallReport; \ No newline at end of file +var _0x4e2b=['user:%s','accountcode','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','transfererchannel','[syncBlindTransfer][VoiceCallReport]','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','lodash','util','path','ioredis','ami','../ami','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','set','queue','dial','playback','voicemail','NO\x20ANSWER','FAILED','redis','defaults','socket.io-emitter','channels','agents','syncNewExten','bind','newexten','syncNewChannel','newstate','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','syncMusicOnHoldStop','resolve','actionCoreShowChannels','log','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','merge','pick','error','[syncNewCallerId][VoiceCallReport]','channel','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','keys','context','from-sip','split','destconnectedlinenum','exten','name','user:agentconnect','[syncNewChannel][VoiceCallReport]','inspect','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','subtract','duration','seconds','lastapplication','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','syncNewState','answered','answertime','holdtime','diff','calleridnum','destinationchannel','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','rec','variable','mixmonitor_filename','value','xmd-phone','callerid','type','xmd-queue','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','billableseconds'];(function(_0x58d01d,_0x4fd99e){var _0x240b7e=function(_0x35e16c){while(--_0x35e16c){_0x58d01d['push'](_0x58d01d['shift']());}};_0x240b7e(++_0x4fd99e);}(_0x4e2b,0xa9));var _0xb4e2=function(_0x2e3fed,_0x598d58){_0x2e3fed=_0x2e3fed-0x0;var _0x366b52=_0x4e2b[_0x2e3fed];return _0x366b52;};'use strict';var BPromise=require('bluebird');var _=require(_0xb4e2('0x0'));var moment=require('moment');var util=require(_0xb4e2('0x1'));var path=require(_0xb4e2('0x2'));var Redis=require(_0xb4e2('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xb4e2('0x4'));var ami=require(_0xb4e2('0x5'));var Channel=require('../model/channel');var statusDesc=[_0xb4e2('0x6'),_0xb4e2('0x7'),'inuse',_0xb4e2('0x8'),_0xb4e2('0x9'),_0xb4e2('0xa'),_0xb4e2('0xb'),_0xb4e2('0xc'),'onhold'];var applications=[_0xb4e2('0xd'),_0xb4e2('0xe'),'agi',_0xb4e2('0xf'),_0xb4e2('0x10'),_0xb4e2('0x11')];var dispositions=[_0xb4e2('0x12'),_0xb4e2('0x13'),_0xb4e2('0x13'),_0xb4e2('0x12'),_0xb4e2('0x12'),_0xb4e2('0x12'),'ANSWERED','BUSY',_0xb4e2('0x13'),_0xb4e2('0x13'),_0xb4e2('0x13')];var actions={};config[_0xb4e2('0x14')]=_[_0xb4e2('0x15')](config[_0xb4e2('0x14')],{'host':'localhost','port':0x18eb});var io=require(_0xb4e2('0x16'))(new Redis(config[_0xb4e2('0x14')]));function VoiceCallReport(_0x3c9b89){this[_0xb4e2('0x17')]=_0x3c9b89[_0xb4e2('0x17')];this[_0xb4e2('0x18')]=_0x3c9b89[_0xb4e2('0x18')];ami['on']('coreshowchannel',this[_0xb4e2('0x19')][_0xb4e2('0x1a')](this));ami['on'](_0xb4e2('0x1b'),this[_0xb4e2('0x19')][_0xb4e2('0x1a')](this));ami['on']('newchannel',this[_0xb4e2('0x1c')][_0xb4e2('0x1a')](this));ami['on'](_0xb4e2('0x1d'),this['syncNewState'][_0xb4e2('0x1a')](this));ami['on']('varset',this[_0xb4e2('0x1e')][_0xb4e2('0x1a')](this));ami['on'](_0xb4e2('0x1f'),this[_0xb4e2('0x20')][_0xb4e2('0x1a')](this));ami['on'](_0xb4e2('0x21'),this[_0xb4e2('0x22')][_0xb4e2('0x1a')](this));ami['on'](_0xb4e2('0x23'),this[_0xb4e2('0x24')][_0xb4e2('0x1a')](this));ami['on'](_0xb4e2('0x25'),this[_0xb4e2('0x26')][_0xb4e2('0x1a')](this));ami['on']('musiconholdstart',this[_0xb4e2('0x27')][_0xb4e2('0x1a')](this));ami['on']('musiconholdstop',this[_0xb4e2('0x28')][_0xb4e2('0x1a')](this));return BPromise[_0xb4e2('0x29')]()['then'](ami[_0xb4e2('0x2a')]())['catch'](function(_0x56709c){console[_0xb4e2('0x2b')](_0x56709c);});}VoiceCallReport[_0xb4e2('0x2c')][_0xb4e2('0x2d')]=function(_0xadf0f){return _0xadf0f!==null&&!_[_0xb4e2('0x2e')](_0xadf0f);};VoiceCallReport['prototype'][_0xb4e2('0x2f')]=function(_0x9869a7,_0x20e524,_0x41329e){io['to'](_0x9869a7)[_0xb4e2('0x2f')](_0x20e524,_0x41329e);};VoiceCallReport[_0xb4e2('0x2c')]['syncNewCallerId']=function(_0x40d438){try{if(this[_0xb4e2('0x2d')](_0x40d438)){if(_0x40d438[_0xb4e2('0x30')]===_0x40d438[_0xb4e2('0x31')]){if(!_['isUndefined'](this[_0xb4e2('0x17')][_0x40d438['uniqueid']])){_[_0xb4e2('0x32')](this[_0xb4e2('0x17')][_0x40d438[_0xb4e2('0x30')]],_[_0xb4e2('0x33')](_0x40d438,_['keys'](this[_0xb4e2('0x17')][_0x40d438[_0xb4e2('0x30')]])));}}}}catch(_0x54508f){logger[_0xb4e2('0x34')](_0xb4e2('0x35'),util['inspect'](_0x54508f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb4e2('0x2c')][_0xb4e2('0x1c')]=function(_0x147620){try{if(this[_0xb4e2('0x2d')](_0x147620)){if(_0x147620[_0xb4e2('0x30')]===_0x147620[_0xb4e2('0x31')]&&_0x147620[_0xb4e2('0x36')]!='OutgoingSpoolFailed'){if(_[_0xb4e2('0x2e')](this[_0xb4e2('0x17')][_0x147620[_0xb4e2('0x30')]])){this['channels'][_0x147620[_0xb4e2('0x30')]]=new Channel();this[_0xb4e2('0x17')][_0x147620[_0xb4e2('0x30')]][_0xb4e2('0x37')]=moment()[_0xb4e2('0x38')](_0xb4e2('0x39'));this['channels'][_0x147620[_0xb4e2('0x30')]][_0xb4e2('0x3a')]=dispositions[_[_0xb4e2('0x3b')](_0x147620[_0xb4e2('0x3c')])];_[_0xb4e2('0x32')](this[_0xb4e2('0x17')][_0x147620['uniqueid']],_[_0xb4e2('0x33')](_0x147620,_[_0xb4e2('0x3d')](this['channels'][_0x147620[_0xb4e2('0x30')]])));if(_0x147620[_0xb4e2('0x3e')]===_0xb4e2('0x3f')){if(this['agents'][_0x147620['channel'][_0xb4e2('0x40')]('-')[0x0]]){this[_0xb4e2('0x18')][_0x147620[_0xb4e2('0x36')][_0xb4e2('0x40')]('-')[0x0]][_0xb4e2('0x41')]=_0x147620[_0xb4e2('0x42')];this[_0xb4e2('0x2f')](util['format']('user:%s',this[_0xb4e2('0x18')][_0x147620[_0xb4e2('0x36')]['split']('-')[0x0]][_0xb4e2('0x43')]),_0xb4e2('0x44'),{'destaccountcode':this[_0xb4e2('0x18')][_0x147620[_0xb4e2('0x36')][_0xb4e2('0x40')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x147620['exten']});}}}}}}catch(_0x5624e5){logger[_0xb4e2('0x34')](_0xb4e2('0x45'),util[_0xb4e2('0x46')](_0x5624e5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x3b62ea){try{if(this[_0xb4e2('0x2d')](_0x3b62ea)){if(_0x3b62ea['uniqueid']===_0x3b62ea[_0xb4e2('0x31')]&&_0x3b62ea['exten']!='h'&&_0x3b62ea[_0xb4e2('0x36')]!=_0xb4e2('0x47')){_0x3b62ea[_0xb4e2('0x48')]=_0x3b62ea['application'][_0xb4e2('0x49')]();_0x3b62ea[_0xb4e2('0x4a')]=(_0x3b62ea[_0xb4e2('0x4b')]||_0x3b62ea[_0xb4e2('0x4a')])[_0xb4e2('0x49')]();if(_[_0xb4e2('0x2e')](this[_0xb4e2('0x17')][_0x3b62ea[_0xb4e2('0x30')]])){this[_0xb4e2('0x17')][_0x3b62ea['uniqueid']]=new Channel();this['channels'][_0x3b62ea['uniqueid']][_0xb4e2('0x37')]=_0x3b62ea['duration']?moment()[_0xb4e2('0x4c')](moment[_0xb4e2('0x4d')](_0x3b62ea['duration'])[_0xb4e2('0x4e')](),'seconds')[_0xb4e2('0x38')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xb4e2('0x38')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3b62ea[_0xb4e2('0x30')]][_0xb4e2('0x3a')]=_0xb4e2('0x12');}_[_0xb4e2('0x32')](this[_0xb4e2('0x17')][_0x3b62ea[_0xb4e2('0x30')]],_[_0xb4e2('0x33')](_0x3b62ea,_[_0xb4e2('0x3d')](this[_0xb4e2('0x17')][_0x3b62ea[_0xb4e2('0x30')]])));if(_['includes'](applications,_0x3b62ea['application'])){this[_0xb4e2('0x17')][_0x3b62ea['uniqueid']][_0xb4e2('0x4f')]=_0x3b62ea[_0xb4e2('0x48')];this[_0xb4e2('0x17')][_0x3b62ea['uniqueid']]['lastdata']=_0x3b62ea[_0xb4e2('0x4a')];if(_0x3b62ea['application']===_0xb4e2('0xd')&&_[_0xb4e2('0x50')](_0x3b62ea['applicationdata'],_0xb4e2('0x51'))){var _0x219b1c=_0x3b62ea[_0xb4e2('0x4a')][_0xb4e2('0x40')]('=');var _0x383e99=_0x219b1c[0x0][_0xb4e2('0x52')](/cdr\((.*)\)/);if(_0x383e99){this[_0xb4e2('0x17')][_0x3b62ea['uniqueid']][_0x383e99[0x1]]=_0x219b1c[0x1];}}else if(_0x3b62ea[_0xb4e2('0x48')]===_0xb4e2('0xe')){this['channels'][_0x3b62ea[_0xb4e2('0x30')]]['queue']=_0x3b62ea[_0xb4e2('0x4a')][_0xb4e2('0x40')](',')[0x0];}}}}}catch(_0x503bfc){logger[_0xb4e2('0x34')](_0xb4e2('0x53'),util[_0xb4e2('0x46')](_0x503bfc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb4e2('0x2c')][_0xb4e2('0x54')]=function(_0x392f0e){try{if(this[_0xb4e2('0x2d')](_0x392f0e)){if(_0x392f0e[_0xb4e2('0x30')]!==_0x392f0e['linkedid']){if(this[_0xb4e2('0x17')][_0x392f0e[_0xb4e2('0x31')]]){if(_0x392f0e['channelstate']==='6'){if(!this[_0xb4e2('0x17')][_0x392f0e[_0xb4e2('0x31')]][_0xb4e2('0x55')]){var _0xd2ce22=moment();this[_0xb4e2('0x17')][_0x392f0e['linkedid']][_0xb4e2('0x55')]=!![];this['channels'][_0x392f0e[_0xb4e2('0x31')]][_0xb4e2('0x56')]=_0xd2ce22[_0xb4e2('0x38')](_0xb4e2('0x39'));if(this[_0xb4e2('0x17')][_0x392f0e[_0xb4e2('0x31')]][_0xb4e2('0x37')]){this[_0xb4e2('0x17')][_0x392f0e[_0xb4e2('0x31')]][_0xb4e2('0x57')]=_0xd2ce22[_0xb4e2('0x58')](this[_0xb4e2('0x17')][_0x392f0e['linkedid']][_0xb4e2('0x37')],_0xb4e2('0x4e'));}}this[_0xb4e2('0x17')][_0x392f0e['linkedid']][_0xb4e2('0x31')]=_0x392f0e[_0xb4e2('0x30')];if(_0x392f0e['calleridnum']!=='xcally-motion-preview'){this[_0xb4e2('0x17')][_0x392f0e['linkedid']]['connectedlinenum']=_0x392f0e[_0xb4e2('0x59')];}this['channels'][_0x392f0e[_0xb4e2('0x31')]]['connectedlinename']=_0x392f0e['calleridname'];this[_0xb4e2('0x17')][_0x392f0e[_0xb4e2('0x31')]][_0xb4e2('0x5a')]=_0x392f0e[_0xb4e2('0x36')];this[_0xb4e2('0x17')][_0x392f0e[_0xb4e2('0x31')]][_0xb4e2('0x3a')]=dispositions[_[_0xb4e2('0x3b')](_0x392f0e['channelstate'])];if(this[_0xb4e2('0x18')][_0x392f0e[_0xb4e2('0x36')][_0xb4e2('0x40')]('-')[0x0]]){this['channels'][_0x392f0e[_0xb4e2('0x31')]][_0xb4e2('0x5b')]=this[_0xb4e2('0x18')][_0x392f0e['channel'][_0xb4e2('0x40')]('-')[0x0]]['id'];this['channels'][_0x392f0e[_0xb4e2('0x31')]]['membername']=this[_0xb4e2('0x18')][_0x392f0e[_0xb4e2('0x36')]['split']('-')[0x0]][_0xb4e2('0x43')];}}}}else{if(this[_0xb4e2('0x17')][_0x392f0e[_0xb4e2('0x30')]]){if(_0x392f0e[_0xb4e2('0x3c')]==='6'){if(this[_0xb4e2('0x18')][_0x392f0e[_0xb4e2('0x36')][_0xb4e2('0x40')]('-')[0x0]]){this[_0xb4e2('0x17')][_0x392f0e['uniqueid']][_0xb4e2('0x5b')]=this[_0xb4e2('0x18')][_0x392f0e[_0xb4e2('0x36')][_0xb4e2('0x40')]('-')[0x0]]['id'];this['channels'][_0x392f0e[_0xb4e2('0x30')]]['membername']=this[_0xb4e2('0x18')][_0x392f0e[_0xb4e2('0x36')][_0xb4e2('0x40')]('-')[0x0]][_0xb4e2('0x43')];}}}}}}catch(_0x246f3f){logger[_0xb4e2('0x34')](_0xb4e2('0x5c'),util['inspect'](_0x246f3f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb4e2('0x2c')][_0xb4e2('0x5d')]=function(_0x24afb6,_0x4d257a){if(this[_0xb4e2('0x17')][_0x24afb6]){this[_0xb4e2('0x17')][_0x24afb6][_0xb4e2('0x5e')]=!![];if(_[_0xb4e2('0x5f')](_0x4d257a,_0xb4e2('0x60'))){_0x4d257a=_0x4d257a[_0xb4e2('0x61')](_0xb4e2('0x60'),_0xb4e2('0x62'));}this[_0xb4e2('0x17')][_0x24afb6][_0xb4e2('0x63')]=_0x4d257a;var _0x840712=_[_0xb4e2('0x64')](this[_0xb4e2('0x17')][_0x24afb6][_0xb4e2('0x65')],{'filename':_0x4d257a});if(_['isNil'](_0x840712)){this[_0xb4e2('0x17')][_0x24afb6][_0xb4e2('0x65')]['push']({'filename':_0x4d257a,'createdAt':moment()[_0xb4e2('0x38')](_0xb4e2('0x39')),'mixmonitorid':'','status':_0xb4e2('0x66')});}}};VoiceCallReport[_0xb4e2('0x2c')][_0xb4e2('0x1e')]=function(_0x5107f2){try{if(this[_0xb4e2('0x2d')](_0x5107f2)){if(this['channels'][_0x5107f2['uniqueid']]&&_0x5107f2[_0xb4e2('0x36')]!=_0xb4e2('0x47')){if(this[_0xb4e2('0x2d')](_0x5107f2[_0xb4e2('0x67')])){if(this[_0xb4e2('0x2d')](_0x5107f2[_0xb4e2('0x67')][_0xb4e2('0x68')])){this[_0xb4e2('0x5d')](_0x5107f2[_0xb4e2('0x30')],_0x5107f2[_0xb4e2('0x69')]);}else if(this[_0xb4e2('0x2d')](_0x5107f2[_0xb4e2('0x67')][_0xb4e2('0x6a')])){this[_0xb4e2('0x17')][_0x5107f2['uniqueid']][_0xb4e2('0x59')]=_0x5107f2[_0xb4e2('0x69')];}else if(this[_0xb4e2('0x2d')](_0x5107f2[_0xb4e2('0x67')]['xmd-callerid'])){this[_0xb4e2('0x17')][_0x5107f2['uniqueid']][_0xb4e2('0x6b')]=_0x5107f2['value'];}else if(this['isNotNull'](_0x5107f2[_0xb4e2('0x67')]['xmd-cdrtype'])){this['channels'][_0x5107f2['uniqueid']][_0xb4e2('0x6c')]=_0x5107f2[_0xb4e2('0x69')];}else if(this['isNotNull'](_0x5107f2[_0xb4e2('0x67')][_0xb4e2('0x6d')])){this[_0xb4e2('0x17')][_0x5107f2['uniqueid']][_0xb4e2('0xe')]=_0x5107f2[_0xb4e2('0x69')]['split'](',')[0x0];}else if(this['isNotNull'](_0x5107f2[_0xb4e2('0x67')]['xmd-originatecalleridnum'])){this[_0xb4e2('0x17')][_0x5107f2[_0xb4e2('0x30')]][_0xb4e2('0x6e')]=_0x5107f2[_0xb4e2('0x69')];}else if(this['isNotNull'](_0x5107f2[_0xb4e2('0x67')][_0xb4e2('0x6f')])){this[_0xb4e2('0x17')][_0x5107f2['uniqueid']][_0xb4e2('0x70')]=_0x5107f2['value'];}else if(this[_0xb4e2('0x2d')](_0x5107f2[_0xb4e2('0x67')][_0xb4e2('0x71')])){this[_0xb4e2('0x17')][_0x5107f2[_0xb4e2('0x30')]][_0xb4e2('0x72')]=_0x5107f2[_0xb4e2('0x69')];}else if(this[_0xb4e2('0x2d')](_0x5107f2[_0xb4e2('0x67')][_0xb4e2('0x73')])){this[_0xb4e2('0x17')][_0x5107f2[_0xb4e2('0x30')]]['queue']=_0x5107f2[_0xb4e2('0x69')];}else if(this[_0xb4e2('0x2d')](_0x5107f2['variable']['sipcallid'])){this[_0xb4e2('0x17')][_0x5107f2[_0xb4e2('0x30')]]['sipcalluniqueid']=_0x5107f2['value'];}}}else if(this[_0xb4e2('0x2d')](_0x5107f2[_0xb4e2('0x67')][_0xb4e2('0x68')])){if(_0x5107f2[_0xb4e2('0x69')]){var _0x33704f=path[_0xb4e2('0x74')](_0x5107f2[_0xb4e2('0x69')])['name'];this[_0xb4e2('0x5d')](_0x33704f,_0x5107f2[_0xb4e2('0x69')]);}}else if(this[_0xb4e2('0x17')][_0x5107f2[_0xb4e2('0x31')]]){if(this['isNotNull'](_0x5107f2[_0xb4e2('0x67')])){if(this[_0xb4e2('0x2d')](_0x5107f2[_0xb4e2('0x67')][_0xb4e2('0x75')])){this[_0xb4e2('0x17')][_0x5107f2[_0xb4e2('0x31')]][_0xb4e2('0x76')]=_0x5107f2[_0xb4e2('0x69')];}}}}}catch(_0x2f028c){logger[_0xb4e2('0x34')](_0xb4e2('0x77'),util['inspect'](_0x2f028c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb4e2('0x2c')][_0xb4e2('0x20')]=function(_0x43cd38){try{if(this['isNotNull'](_0x43cd38)){if(this[_0xb4e2('0x17')][_0x43cd38[_0xb4e2('0x30')]]){var _0x1040be=moment();this[_0xb4e2('0x17')][_0x43cd38[_0xb4e2('0x30')]]['endtime']=_0x1040be['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x43cd38[_0xb4e2('0x30')]][_0xb4e2('0x4d')]=_0x1040be[_0xb4e2('0x58')](this[_0xb4e2('0x17')][_0x43cd38[_0xb4e2('0x30')]][_0xb4e2('0x37')],'seconds');if(this[_0xb4e2('0x17')][_0x43cd38[_0xb4e2('0x30')]]['answered']){this[_0xb4e2('0x17')][_0x43cd38['uniqueid']]['billableseconds']=_0x1040be['diff'](this['channels'][_0x43cd38['uniqueid']][_0xb4e2('0x56')],_0xb4e2('0x4e'));this[_0xb4e2('0x17')][_0x43cd38[_0xb4e2('0x30')]][_0xb4e2('0x57')]=this[_0xb4e2('0x17')][_0x43cd38[_0xb4e2('0x30')]][_0xb4e2('0x4d')]-this[_0xb4e2('0x17')][_0x43cd38['uniqueid']][_0xb4e2('0x78')];}if(_0x43cd38['context']===_0xb4e2('0x3f')){if(this[_0xb4e2('0x18')][_0x43cd38[_0xb4e2('0x36')]['split']('-')[0x0]]){this[_0xb4e2('0x18')][_0x43cd38[_0xb4e2('0x36')][_0xb4e2('0x40')]('-')[0x0]]=_['omit'](this[_0xb4e2('0x18')][_0x43cd38['channel']['split']('-')[0x0]],[_0xb4e2('0x41')]);this['emit'](util[_0xb4e2('0x38')](_0xb4e2('0x79'),this[_0xb4e2('0x18')][_0x43cd38[_0xb4e2('0x36')]['split']('-')[0x0]][_0xb4e2('0x43')]),'user:agentcomplete',{'destaccountcode':this['agents'][_0x43cd38['channel'][_0xb4e2('0x40')]('-')[0x0]][_0xb4e2('0x7a')]});}}ami[_0xb4e2('0x2f')](_0xb4e2('0x7b'),this[_0xb4e2('0x17')][_0x43cd38['uniqueid']]);delete this['channels'][_0x43cd38[_0xb4e2('0x30')]];}}}catch(_0x9ffe7){logger['error'](_0xb4e2('0x7c'),util[_0xb4e2('0x46')](_0x9ffe7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb4e2('0x2c')][_0xb4e2('0x24')]=function(_0x5b5cfb){try{if(this['isNotNull'](_0x5b5cfb)){if(this[_0xb4e2('0x17')][_0x5b5cfb['transfereeuniqueid']]){this[_0xb4e2('0x17')][_0x5b5cfb[_0xb4e2('0x7d')]][_0xb4e2('0x7e')]=_0x5b5cfb[_0xb4e2('0x7f')];this['channels'][_0x5b5cfb[_0xb4e2('0x7d')]][_0xb4e2('0x80')]=_0x5b5cfb[_0xb4e2('0x81')];if(this[_0xb4e2('0x17')][_0x5b5cfb[_0xb4e2('0x82')]]){var _0x1fab70=this['channels'][_0x5b5cfb[_0xb4e2('0x82')]];this[_0xb4e2('0x17')][_0x5b5cfb['secondtransfereruniqueid']]=this[_0xb4e2('0x17')][_0x5b5cfb[_0xb4e2('0x7d')]];this[_0xb4e2('0x17')][_0x5b5cfb[_0xb4e2('0x7d')]]=_0x1fab70;}}else if(this[_0xb4e2('0x17')][_0x5b5cfb[_0xb4e2('0x83')]]){this['channels'][_0x5b5cfb[_0xb4e2('0x83')]][_0xb4e2('0x7e')]=_0x5b5cfb[_0xb4e2('0x7f')];this[_0xb4e2('0x17')][_0x5b5cfb[_0xb4e2('0x83')]]['transferconnectedlinenum']=_0x5b5cfb[_0xb4e2('0x81')];if(this['channels'][_0x5b5cfb[_0xb4e2('0x84')]]){var _0x1fab70=this[_0xb4e2('0x17')][_0x5b5cfb[_0xb4e2('0x84')]];this[_0xb4e2('0x17')][_0x5b5cfb[_0xb4e2('0x84')]]=this[_0xb4e2('0x17')][_0x5b5cfb[_0xb4e2('0x83')]];this[_0xb4e2('0x17')][_0x5b5cfb[_0xb4e2('0x83')]]=_0x1fab70;}}}}catch(_0x3f2e6b){logger[_0xb4e2('0x34')](_0xb4e2('0x85'),util[_0xb4e2('0x46')](_0x3f2e6b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb4e2('0x26')]=function(_0x538f28){try{if(this['isNotNull'](_0x538f28)){if(this[_0xb4e2('0x17')][_0x538f28[_0xb4e2('0x7d')]]){this['channels'][_0x538f28[_0xb4e2('0x7d')]][_0xb4e2('0x7e')]=_0x538f28[_0xb4e2('0x86')];this['channels'][_0x538f28['transfereeuniqueid']][_0xb4e2('0x80')]=_0x538f28[_0xb4e2('0x87')];this[_0xb4e2('0x20')]({'event':'BlindTransfer','uniqueid':_0x538f28[_0xb4e2('0x7d')],'context':_0x538f28['context'],'channel':_0x538f28[_0xb4e2('0x88')]});}}}catch(_0x1c9305){logger[_0xb4e2('0x34')](_0xb4e2('0x89'),util[_0xb4e2('0x46')](_0x1c9305,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb4e2('0x2c')][_0xb4e2('0x27')]=function(_0x592738){try{if(this['isNotNull'](_0x592738)){if(this[_0xb4e2('0x17')][_0x592738[_0xb4e2('0x30')]]){if(!_[_0xb4e2('0x8a')](this[_0xb4e2('0x17')][_0x592738[_0xb4e2('0x30')]]['answertime'])){this[_0xb4e2('0x17')][_0x592738[_0xb4e2('0x30')]][_0xb4e2('0x8b')]=moment()[_0xb4e2('0x38')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x7914ff){logger[_0xb4e2('0x34')](_0xb4e2('0x8c'),util[_0xb4e2('0x46')](_0x7914ff,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb4e2('0x2c')][_0xb4e2('0x28')]=function(_0x4e5995){try{if(this['isNotNull'](_0x4e5995)){if(this[_0xb4e2('0x17')][_0x4e5995[_0xb4e2('0x30')]]){if(!_[_0xb4e2('0x8a')](this[_0xb4e2('0x17')][_0x4e5995[_0xb4e2('0x30')]]['mohstarttime'])){this[_0xb4e2('0x17')][_0x4e5995[_0xb4e2('0x30')]][_0xb4e2('0x8d')]+=moment()[_0xb4e2('0x8e')](0x0)[_0xb4e2('0x58')](this[_0xb4e2('0x17')][_0x4e5995['uniqueid']][_0xb4e2('0x8b')],_0xb4e2('0x4e'));delete this[_0xb4e2('0x17')][_0x4e5995[_0xb4e2('0x30')]][_0xb4e2('0x8b')];}}}}catch(_0xb7ac46){logger[_0xb4e2('0x34')](_0xb4e2('0x8f'),util[_0xb4e2('0x46')](_0xb7ac46,{'showHidden':![],'depth':null}));}};module[_0xb4e2('0x90')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 955f949..f10d78e 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 _0x1a8f=['dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','custom:dialconnect','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','outboundrouteid','value','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','starttime','seconds','complete','total','answered','holdtime','diff','billableseconds','sumHoldTime','sumDuration','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','lodash','moment','ioredis','../../../config/logger','ami','../ami','defaults','redis','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','isUndefined','emit','prototype','isNotNull','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','event','voice:outbound','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0x1a8f,0x88));var _0xf1a8=function(_0x2de66b,_0x33ae0c){_0x2de66b=_0x2de66b-0x0;var _0x19c1ea=_0x1a8f[_0x2de66b];return _0x19c1ea;};'use strict';var _=require(_0xf1a8('0x0'));var moment=require(_0xf1a8('0x1'));var util=require('util');var Redis=require(_0xf1a8('0x2'));var config=require('../../../config/environment');var logger=require(_0xf1a8('0x3'))(_0xf1a8('0x4'));var ami=require(_0xf1a8('0x5'));config['redis']=_[_0xf1a8('0x6')](config[_0xf1a8('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf1a8('0x7')]));function VoiceDialReport(_0x40c271){this[_0xf1a8('0x8')]=_0x40c271[_0xf1a8('0x9')];this[_0xf1a8('0xa')]=_0x40c271[_0xf1a8('0xa')];this[_0xf1a8('0xb')]={};ami['on'](_0xf1a8('0xc'),this[_0xf1a8('0xd')][_0xf1a8('0xe')](this));ami['on'](_0xf1a8('0xf'),this[_0xf1a8('0x10')]['bind'](this));ami['on'](_0xf1a8('0x11'),this[_0xf1a8('0x12')][_0xf1a8('0xe')](this));ami['on'](_0xf1a8('0x13'),this[_0xf1a8('0x14')][_0xf1a8('0xe')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x32b22b){return _0x32b22b!==null&&!_[_0xf1a8('0x15')](_0x32b22b);};VoiceDialReport['prototype'][_0xf1a8('0x16')]=function(_0x3dd305,_0x35d340,_0x1fedf3){io['to'](_0x3dd305)[_0xf1a8('0x16')](_0x35d340,_0x1fedf3);};VoiceDialReport[_0xf1a8('0x17')][_0xf1a8('0xd')]=function(_0x4c59af){try{if(this[_0xf1a8('0x18')](_0x4c59af)){if(this[_0xf1a8('0x8')][_0x4c59af[_0xf1a8('0x19')]]){_[_0xf1a8('0x1a')](this[_0xf1a8('0x8')][_0x4c59af[_0xf1a8('0x19')]],{'starttime':moment()['format'](_0xf1a8('0x1b')),'lastevent':_0xf1a8('0x1c'),'interface':_0x4c59af[_0xf1a8('0x1d')][_0xf1a8('0x1e')](0x0,_0x4c59af[_0xf1a8('0x1d')][_0xf1a8('0x1f')]('-')),'membername':_0x4c59af[_0xf1a8('0x1d')][_0xf1a8('0x1e')](_0x4c59af[_0xf1a8('0x1d')][_0xf1a8('0x1f')]('/')+0x1,_0x4c59af[_0xf1a8('0x1d')][_0xf1a8('0x1f')]('-'))},_['omit'](_0x4c59af,[_0xf1a8('0x20'),'privilege']));this['emit'](_0xf1a8('0x21'),'voice_outbound_channel:save',this['channels'][_0x4c59af[_0xf1a8('0x19')]]);ami[_0xf1a8('0x16')](_0xf1a8('0x22'),this[_0xf1a8('0x8')][_0x4c59af[_0xf1a8('0x19')]]);}}}catch(_0x5a0c38){logger[_0xf1a8('0x23')](_0xf1a8('0x24'),util[_0xf1a8('0x25')](_0x5a0c38,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf1a8('0x17')][_0xf1a8('0x10')]=function(_0x4a9f7b){try{if(this['isNotNull'](_0x4a9f7b)){if(this[_0xf1a8('0x8')][_0x4a9f7b[_0xf1a8('0x19')]]){this[_0xf1a8('0x8')][_0x4a9f7b[_0xf1a8('0x19')]][_0xf1a8('0x26')]=_0x4a9f7b['dialstatus'];if(_0x4a9f7b['dialstatus']===_0xf1a8('0x27')){this[_0xf1a8('0x8')][_0x4a9f7b[_0xf1a8('0x19')]][_0xf1a8('0x28')]=_0x4a9f7b[_0xf1a8('0x28')];this['channels'][_0x4a9f7b[_0xf1a8('0x19')]][_0xf1a8('0x29')]=_0x4a9f7b['connectedlinename'];this['channels'][_0x4a9f7b['uniqueid']][_0xf1a8('0x2a')]=moment()[_0xf1a8('0x2b')](_0xf1a8('0x1b'));this[_0xf1a8('0x8')][_0x4a9f7b[_0xf1a8('0x19')]][_0xf1a8('0x2c')]=_0xf1a8('0x2d');ami[_0xf1a8('0x16')](_0xf1a8('0x2e'),this['channels'][_0x4a9f7b[_0xf1a8('0x19')]]);}this[_0xf1a8('0x16')](_0xf1a8('0x21'),_0xf1a8('0x2f'),this[_0xf1a8('0x8')][_0x4a9f7b[_0xf1a8('0x19')]]);}}}catch(_0x16b7d2){logger[_0xf1a8('0x23')](_0xf1a8('0x30'),util['inspect'](_0x16b7d2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf1a8('0x17')][_0xf1a8('0x12')]=function(_0x3706ae){try{if(this[_0xf1a8('0x18')](_0x3706ae)){this[_0xf1a8('0x31')](_0x3706ae['uniqueid'],_[_0xf1a8('0x32')](_0x3706ae[_0xf1a8('0x33')])[0x0],_0x3706ae['value']);if(this['isNotNull'](_0x3706ae['variable'])&&this[_0xf1a8('0x18')](_0x3706ae['variable'][_0xf1a8('0x34')])){if(_[_0xf1a8('0x15')](this['channels'][_0x3706ae[_0xf1a8('0x19')]])){this[_0xf1a8('0x8')][_0x3706ae[_0xf1a8('0x19')]]={'routeId':_0x3706ae[_0xf1a8('0x35')],'variables':this[_0xf1a8('0xb')][_0x3706ae[_0xf1a8('0x19')]]};this['emit']('voice:outbound',_0xf1a8('0x2f'),this['channels'][_0x3706ae[_0xf1a8('0x19')]]);}}}}catch(_0x22367e){logger[_0xf1a8('0x23')]('[syncVarSet][VoiceDialReport]',util['inspect'](_0x22367e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf1a8('0x17')]['addVariable']=function(_0x2bed69,_0x2b6343,_0xa9e11c){var _0x25ba3f=['rtpaudioqos',_0xf1a8('0x36'),'rtpaudioqosjitter',_0xf1a8('0x37'),'rtpaudioqosloss',_0xf1a8('0x38'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0xf1a8('0x39'),_0xf1a8('0x3a'),_0xf1a8('0x3b'),_0xf1a8('0x3c'),'membercalls',_0xf1a8('0x3d'),_0xf1a8('0x3e'),_0xf1a8('0x3f'),_0xf1a8('0x40'),_0xf1a8('0x41'),_0xf1a8('0x42')];if(!_[_0xf1a8('0x43')](_0x2b6343)&&!_[_0xf1a8('0x44')](_0x25ba3f,_0x2b6343)){if(_[_0xf1a8('0x15')](this[_0xf1a8('0xb')][_0x2bed69])){this['variables'][_0x2bed69]={};}this['variables'][_0x2bed69][_0x2b6343]=_0xa9e11c;}};VoiceDialReport[_0xf1a8('0x17')][_0xf1a8('0x14')]=function(_0x23a035){try{if(this[_0xf1a8('0x18')](_0x23a035)){if(this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]]){this['channels'][_0x23a035['uniqueid']][_0xf1a8('0x45')]=moment()['format'](_0xf1a8('0x1b'));this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]][_0xf1a8('0x46')]=moment(this[_0xf1a8('0x8')][_0x23a035['uniqueid']]['endtime'])['diff'](this['channels'][_0x23a035[_0xf1a8('0x19')]][_0xf1a8('0x47')],_0xf1a8('0x48'));this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]][_0xf1a8('0x2c')]=_0xf1a8('0x49');this[_0xf1a8('0xa')][_0xf1a8('0x4a')]+=0x1;if(this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]][_0xf1a8('0x2a')]){this[_0xf1a8('0xa')][_0xf1a8('0x4b')]+=0x1;this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]][_0xf1a8('0x4c')]=moment(this['channels'][_0x23a035['uniqueid']][_0xf1a8('0x2a')])[_0xf1a8('0x4d')](this['channels'][_0x23a035[_0xf1a8('0x19')]][_0xf1a8('0x47')],_0xf1a8('0x48'));this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]][_0xf1a8('0x4e')]=moment(this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]][_0xf1a8('0x45')])[_0xf1a8('0x4d')](this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]][_0xf1a8('0x2a')],_0xf1a8('0x48'));this[_0xf1a8('0xa')][_0xf1a8('0x4f')]+=this[_0xf1a8('0x8')][_0x23a035['uniqueid']][_0xf1a8('0x4c')]||0x0;this[_0xf1a8('0xa')]['sumBillable']+=this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]][_0xf1a8('0x4e')];}this[_0xf1a8('0xa')][_0xf1a8('0x50')]+=this[_0xf1a8('0x8')][_0x23a035['uniqueid']][_0xf1a8('0x46')];ami[_0xf1a8('0x16')]('custom:voiceDialReport',this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]]);ami['emit'](_0xf1a8('0x51'),this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]]);this[_0xf1a8('0x16')](_0xf1a8('0x21'),_0xf1a8('0x52'),this[_0xf1a8('0xa')]);logger['info'](_0xf1a8('0x53'),JSON[_0xf1a8('0x54')](this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]]));this[_0xf1a8('0x16')](_0xf1a8('0x21'),_0xf1a8('0x55'),this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]]);delete this[_0xf1a8('0x8')][_0x23a035[_0xf1a8('0x19')]];}if(this[_0xf1a8('0xb')][_0x23a035[_0xf1a8('0x19')]]){delete this[_0xf1a8('0xb')][_0x23a035[_0xf1a8('0x19')]];}}}catch(_0x269dec){logger['error'](_0xf1a8('0x56'),util[_0xf1a8('0x25')](_0x269dec,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0xf8b1=['includes','endtime','duration','starttime','seconds','complete','total','answertime','answered','holdtime','diff','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','moment','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','outbound','dialbegin','syncDialBegin','varset','syncVarSet','bind','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','channels','uniqueid','called','channel','substring','lastIndexOf','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','inspect','syncDialEnd','dialstatus','ANSWER','connectedlinenum','connectedlinename','format','YYYY-MM-DD\x20HH:mm:ss','lastevent','custom:dialconnect','error','[syncDialEnd][VoiceDialReport]','keys','value','variable','outboundrouteid','variables','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil'];(function(_0x42faef,_0x2b3aaf){var _0x1a2cdd=function(_0x26301d){while(--_0x26301d){_0x42faef['push'](_0x42faef['shift']());}};_0x1a2cdd(++_0x2b3aaf);}(_0xf8b1,0x1c8));var _0x1f8b=function(_0x4083df,_0xd407){_0x4083df=_0x4083df-0x0;var _0x6947cd=_0xf8b1[_0x4083df];return _0x6947cd;};'use strict';var _=require('lodash');var moment=require(_0x1f8b('0x0'));var util=require(_0x1f8b('0x1'));var Redis=require(_0x1f8b('0x2'));var config=require(_0x1f8b('0x3'));var logger=require('../../../config/logger')(_0x1f8b('0x4'));var ami=require(_0x1f8b('0x5'));config[_0x1f8b('0x6')]=_[_0x1f8b('0x7')](config[_0x1f8b('0x6')],{'host':_0x1f8b('0x8'),'port':0x18eb});var io=require(_0x1f8b('0x9'))(new Redis(config[_0x1f8b('0x6')]));function VoiceDialReport(_0x2c815d){this['channels']=_0x2c815d['outboundChannels'];this[_0x1f8b('0xa')]=_0x2c815d[_0x1f8b('0xa')];this['variables']={};ami['on'](_0x1f8b('0xb'),this[_0x1f8b('0xc')]['bind'](this));ami['on']('dialend',this['syncDialEnd']['bind'](this));ami['on'](_0x1f8b('0xd'),this[_0x1f8b('0xe')][_0x1f8b('0xf')](this));ami['on'](_0x1f8b('0x10'),this[_0x1f8b('0x11')][_0x1f8b('0xf')](this));}VoiceDialReport[_0x1f8b('0x12')][_0x1f8b('0x13')]=function(_0x266e5a){return _0x266e5a!==null&&!_[_0x1f8b('0x14')](_0x266e5a);};VoiceDialReport['prototype'][_0x1f8b('0x15')]=function(_0xa03573,_0x54850c,_0x170167){io['to'](_0xa03573)[_0x1f8b('0x15')](_0x54850c,_0x170167);};VoiceDialReport[_0x1f8b('0x12')]['syncDialBegin']=function(_0x6c788){try{if(this['isNotNull'](_0x6c788)){if(this[_0x1f8b('0x16')][_0x6c788['uniqueid']]){_['merge'](this[_0x1f8b('0x16')][_0x6c788[_0x1f8b('0x17')]],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x1f8b('0x18'),'interface':_0x6c788['channel']['substring'](0x0,_0x6c788[_0x1f8b('0x19')]['lastIndexOf']('-')),'membername':_0x6c788[_0x1f8b('0x19')][_0x1f8b('0x1a')](_0x6c788[_0x1f8b('0x19')][_0x1f8b('0x1b')]('/')+0x1,_0x6c788[_0x1f8b('0x19')][_0x1f8b('0x1b')]('-'))},_['omit'](_0x6c788,[_0x1f8b('0x1c'),_0x1f8b('0x1d')]));this[_0x1f8b('0x15')](_0x1f8b('0x1e'),_0x1f8b('0x1f'),this[_0x1f8b('0x16')][_0x6c788[_0x1f8b('0x17')]]);ami[_0x1f8b('0x15')](_0x1f8b('0x20'),this[_0x1f8b('0x16')][_0x6c788[_0x1f8b('0x17')]]);}}}catch(_0x55b1d0){logger['error']('[syncDialBegin][VoiceDialReport]',util[_0x1f8b('0x21')](_0x55b1d0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1f8b('0x12')][_0x1f8b('0x22')]=function(_0x4bb4a0){try{if(this[_0x1f8b('0x13')](_0x4bb4a0)){if(this[_0x1f8b('0x16')][_0x4bb4a0[_0x1f8b('0x17')]]){this[_0x1f8b('0x16')][_0x4bb4a0['uniqueid']][_0x1f8b('0x23')]=_0x4bb4a0['dialstatus'];if(_0x4bb4a0['dialstatus']===_0x1f8b('0x24')){this[_0x1f8b('0x16')][_0x4bb4a0['uniqueid']][_0x1f8b('0x25')]=_0x4bb4a0[_0x1f8b('0x25')];this[_0x1f8b('0x16')][_0x4bb4a0[_0x1f8b('0x17')]][_0x1f8b('0x26')]=_0x4bb4a0['connectedlinename'];this['channels'][_0x4bb4a0[_0x1f8b('0x17')]]['answertime']=moment()[_0x1f8b('0x27')](_0x1f8b('0x28'));this[_0x1f8b('0x16')][_0x4bb4a0[_0x1f8b('0x17')]][_0x1f8b('0x29')]='connect';ami[_0x1f8b('0x15')](_0x1f8b('0x2a'),this[_0x1f8b('0x16')][_0x4bb4a0[_0x1f8b('0x17')]]);}this[_0x1f8b('0x15')](_0x1f8b('0x1e'),'voice_outbound_channel:save',this[_0x1f8b('0x16')][_0x4bb4a0[_0x1f8b('0x17')]]);}}}catch(_0x4fca79){logger[_0x1f8b('0x2b')](_0x1f8b('0x2c'),util[_0x1f8b('0x21')](_0x4fca79,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1f8b('0x12')][_0x1f8b('0xe')]=function(_0x490649){try{if(this[_0x1f8b('0x13')](_0x490649)){this['addVariable'](_0x490649[_0x1f8b('0x17')],_[_0x1f8b('0x2d')](_0x490649['variable'])[0x0],_0x490649[_0x1f8b('0x2e')]);if(this[_0x1f8b('0x13')](_0x490649[_0x1f8b('0x2f')])&&this[_0x1f8b('0x13')](_0x490649[_0x1f8b('0x2f')][_0x1f8b('0x30')])){if(_[_0x1f8b('0x14')](this[_0x1f8b('0x16')][_0x490649[_0x1f8b('0x17')]])){this[_0x1f8b('0x16')][_0x490649[_0x1f8b('0x17')]]={'routeId':_0x490649[_0x1f8b('0x2e')],'variables':this[_0x1f8b('0x31')][_0x490649[_0x1f8b('0x17')]]};this[_0x1f8b('0x15')](_0x1f8b('0x1e'),_0x1f8b('0x1f'),this[_0x1f8b('0x16')][_0x490649[_0x1f8b('0x17')]]);}}}}catch(_0x216e95){logger[_0x1f8b('0x2b')]('[syncVarSet][VoiceDialReport]',util[_0x1f8b('0x21')](_0x216e95,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1f8b('0x12')][_0x1f8b('0x32')]=function(_0x159b7c,_0x3d3d87,_0x52b57d){var _0x9b8aa5=[_0x1f8b('0x33'),_0x1f8b('0x34'),_0x1f8b('0x35'),_0x1f8b('0x36'),_0x1f8b('0x37'),_0x1f8b('0x38'),_0x1f8b('0x39'),_0x1f8b('0x3a'),'sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls',_0x1f8b('0x3b'),_0x1f8b('0x3c'),_0x1f8b('0x3d'),_0x1f8b('0x3e'),_0x1f8b('0x3f'),_0x1f8b('0x40')];if(!_[_0x1f8b('0x41')](_0x3d3d87)&&!_[_0x1f8b('0x42')](_0x9b8aa5,_0x3d3d87)){if(_['isUndefined'](this[_0x1f8b('0x31')][_0x159b7c])){this[_0x1f8b('0x31')][_0x159b7c]={};}this[_0x1f8b('0x31')][_0x159b7c][_0x3d3d87]=_0x52b57d;}};VoiceDialReport['prototype'][_0x1f8b('0x11')]=function(_0x1b113b){try{if(this['isNotNull'](_0x1b113b)){if(this[_0x1f8b('0x16')][_0x1b113b['uniqueid']]){this[_0x1f8b('0x16')][_0x1b113b['uniqueid']][_0x1f8b('0x43')]=moment()[_0x1f8b('0x27')](_0x1f8b('0x28'));this['channels'][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x44')]=moment(this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x43')])['diff'](this[_0x1f8b('0x16')][_0x1b113b['uniqueid']][_0x1f8b('0x45')],_0x1f8b('0x46'));this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x29')]=_0x1f8b('0x47');this['outbound'][_0x1f8b('0x48')]+=0x1;if(this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x49')]){this[_0x1f8b('0xa')][_0x1f8b('0x4a')]+=0x1;this[_0x1f8b('0x16')][_0x1b113b['uniqueid']][_0x1f8b('0x4b')]=moment(this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x49')])[_0x1f8b('0x4c')](this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x45')],_0x1f8b('0x46'));this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x4d')]=moment(this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x43')])['diff'](this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x49')],_0x1f8b('0x46'));this[_0x1f8b('0xa')][_0x1f8b('0x4e')]+=this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x4b')]||0x0;this['outbound'][_0x1f8b('0x4f')]+=this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x4d')];}this[_0x1f8b('0xa')][_0x1f8b('0x50')]+=this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]][_0x1f8b('0x44')];ami['emit'](_0x1f8b('0x51'),this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]]);ami[_0x1f8b('0x15')]('custom:dialend',this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]]);this[_0x1f8b('0x15')](_0x1f8b('0x1e'),_0x1f8b('0x52'),this[_0x1f8b('0xa')]);logger[_0x1f8b('0x53')](_0x1f8b('0x54'),JSON[_0x1f8b('0x55')](this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]]));this[_0x1f8b('0x15')](_0x1f8b('0x1e'),_0x1f8b('0x56'),this[_0x1f8b('0x16')][_0x1b113b[_0x1f8b('0x17')]]);delete this[_0x1f8b('0x16')][_0x1b113b['uniqueid']];}if(this[_0x1f8b('0x31')][_0x1b113b[_0x1f8b('0x17')]]){delete this[_0x1f8b('0x31')][_0x1b113b['uniqueid']];}}}catch(_0x24d96a){logger[_0x1f8b('0x2b')]('[syncHangup][VoiceDialReport]',util[_0x1f8b('0x21')](_0x24d96a,{'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 c9be58e..bd2df5b 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 _0x761c=['ATTENDEDTRANSFER','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','moment','bluebird','util','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','originated','hasOwnProperty','pTalking','queueStatusComplete','unlockRR','switch','isNil','status','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','voice_queue_channel:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','name','voice_queue_channel:remove','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','abandoned','waiting','Trunk','active','Interval','md5','isNotNull','clearZombieChannels','Action','queues','[queues]','then','flagQueueSummary','[queuesummary]','queue','countBy','callers','toNumber','loggedin','emitVoiceQueueSummary','custom:queuesummary','syncNewExten','uniqueid','queuecallerjoinAt','position','count','merge','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','queuecallerleaveAt','connectedlinenum','connectedlinename','queuecallercomplete','[syncAgentConnect][VoiceQueueReport]','queuecallerexit','transfer','startsWith','channel','local/','linkedid','queuecallerexitAt','seconds','YYYY-MM-DD\x20HH:mm:ss','FORWARDTRANSFER','transferexten','destexten','transferuniqueid','reason','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','CONTINUE','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','membername','memberrealtime','length','diff','milliseconds','custom:queuecallerunmanaged','custom:queuecallerabandon','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','transfertype','ATTENDED','transfertargetuniqueid','origtransfereruniqueid'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x761c,0x199));var _0xc761=function(_0x5eaee9,_0x255b92){_0x5eaee9=_0x5eaee9-0x0;var _0x3b374a=_0x761c[_0x5eaee9];return _0x3b374a;};'use strict';var _=require('lodash');var moment=require(_0xc761('0x0'));var BPromise=require(_0xc761('0x1'));var util=require(_0xc761('0x2'));var md5=require('md5');var Redis=require(_0xc761('0x3'));var config=require('../../../config/environment');var logger=require(_0xc761('0x4'))(_0xc761('0x5'));var ami=require(_0xc761('0x6'));var QueueReport=require('../model/queueReport');config[_0xc761('0x7')]=_[_0xc761('0x8')](config[_0xc761('0x7')],{'host':_0xc761('0x9'),'port':0x18eb});var io=require(_0xc761('0xa'))(new Redis(config[_0xc761('0x7')]));var Sequence=function(){};Sequence[_0xc761('0xb')][_0xc761('0xc')]=function(_0x3b4481){this[_0xc761('0xd')]=this[_0xc761('0xd')]?this['tail'][_0xc761('0xe')](_0x3b4481):_0x3b4481();};function VoiceQueueReport(_0x2a6d92){this[_0xc761('0xf')]=new Sequence();this[_0xc761('0x10')]={};this[_0xc761('0x11')]=_0x2a6d92[_0xc761('0x11')];this[_0xc761('0x12')]=_0x2a6d92['queueChannels'];this[_0xc761('0x13')]=_0x2a6d92['voiceQueues'];this['flagQueueSummary']=!![];this[_0xc761('0x14')]=_0x2a6d92[_0xc761('0x14')];this[_0xc761('0x15')]={};ami['on'](_0xc761('0x16'),this[_0xc761('0x17')][_0xc761('0x18')](this));ami['on'](_0xc761('0x19'),this[_0xc761('0x1a')]['bind'](this));ami['on'](_0xc761('0x1b'),this[_0xc761('0x1c')]['bind'](this));ami['on']('queuecallerabandon',this[_0xc761('0x1d')][_0xc761('0x18')](this));ami['on'](_0xc761('0x1e'),this[_0xc761('0x1f')][_0xc761('0x18')](this));ami['on']('agentcomplete',this[_0xc761('0x20')][_0xc761('0x18')](this));ami['on']('agentconnect',this[_0xc761('0x21')][_0xc761('0x18')](this));ami['on'](_0xc761('0x22'),this[_0xc761('0x23')]['bind'](this));ami['on'](_0xc761('0x24'),this[_0xc761('0x25')]['bind'](this));ami['on'](_0xc761('0x26'),this[_0xc761('0x27')][_0xc761('0x18')](this));ami['on'](_0xc761('0x28'),this[_0xc761('0x29')]['bind'](this));ami['on'](_0xc761('0x2a'),this[_0xc761('0x2b')]['bind'](this));ami['on'](_0xc761('0x2c'),this[_0xc761('0x2d')][_0xc761('0x18')](this));ami['on'](_0xc761('0x2e'),this[_0xc761('0x2f')]['bind'](this));this[_0xc761('0x30')]();this[_0xc761('0x31')]();}function isNotNull(_0x45104d){return _0x45104d!==null&&!_[_0xc761('0x32')](_0x45104d);}function clearChannels(_0x56987a){if(!_['isEmpty'](_0x56987a)){for(var _0x3dea13 in _0x56987a){if(_0x56987a['hasOwnProperty'](_0x3dea13)){delete _0x56987a[_0x3dea13];}}}}function clearCampaigns(_0x1306b7){if(!_[_0xc761('0x33')](_0x1306b7)){for(var _0x5a81dd in _0x1306b7){if(_0x1306b7['hasOwnProperty'](_0x5a81dd)){_0x1306b7[_0x5a81dd][_0xc761('0x34')]=0x0;}}}}function clearVoiceQueues(_0x5d2559){if(!_[_0xc761('0x33')](_0x5d2559)){for(var _0x3a35d8 in _0x5d2559){if(_0x5d2559[_0xc761('0x35')](_0x3a35d8)){_0x5d2559[_0x3a35d8]['originated']=0x0;_0x5d2559[_0x3a35d8]['talking']=0x0;_0x5d2559[_0x3a35d8][_0xc761('0x36')]=0x0;_0x5d2559[_0x3a35d8]['waiting']=0x0;_0x5d2559[_0x3a35d8][_0xc761('0x37')]=!![];}}}}function clearAgentBooked(_0x5ac33c){if(!_[_0xc761('0x33')](_0x5ac33c)){for(var _0x5c2659 in _0x5ac33c){if(_0x5ac33c['hasOwnProperty'](_0x5c2659)){_0x5ac33c[_0x5c2659][_0xc761('0x38')]=!![];}}}}VoiceQueueReport[_0xc761('0xb')]['clearZombieChannels']=function(){var _0x1954d9=this;for(var _0x16e9f3 in this['channels']){if(this[_0xc761('0x12')]['hasOwnProperty'](_0x16e9f3)&&!this[_0xc761('0x12')][_0x16e9f3][_0xc761('0x39')]){this[_0xc761('0xf')]['enqueue'](function(){if(!_[_0xc761('0x3a')](_0x1954d9[_0xc761('0x12')][_0x16e9f3])){return ami['Action']({'action':_0xc761('0x3b'),'channel':_0x1954d9['channels'][_0x16e9f3]['channel']})[_0xc761('0x3c')](function(_0x3089d4){if(_0x3089d4[_0xc761('0x3d')]===_0xc761('0x3e')){setTimeout(function(){if(_0x1954d9[_0xc761('0x12')][_0x16e9f3]){delete _0x1954d9[_0xc761('0x12')][_0x16e9f3];logger[_0xc761('0x3f')]('[voiceQueueReport][checkChannel]',_0x16e9f3);}if(_0x1954d9[_0xc761('0x10')][_0x16e9f3]){delete _0x1954d9[_0xc761('0x10')][_0x16e9f3];logger[_0xc761('0x3f')](_0xc761('0x40'),_0x16e9f3);}if(_0x1954d9[_0xc761('0x15')][_0x16e9f3]){delete _0x1954d9[_0xc761('0x15')][_0x16e9f3];logger[_0xc761('0x3f')](_0xc761('0x41'),_0x16e9f3);}},0x1f40);}});}});}}};VoiceQueueReport[_0xc761('0xb')]['syncFullyBooted']=function(){logger[_0xc761('0x3f')](_0xc761('0x42'));clearChannels(this[_0xc761('0x12')]);this[_0xc761('0x43')](this[_0xc761('0x10')]);clearAgentBooked(this[_0xc761('0x11')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xc761('0x14')]);};VoiceQueueReport[_0xc761('0xb')][_0xc761('0x43')]=function(_0x776d06){var _0xdebcea=this;if(!_['isEmpty'](_0x776d06)){for(var _0x2a79ec in _0x776d06){if(_0x776d06[_0xc761('0x35')](_0x2a79ec)){_0xdebcea[_0xc761('0x44')](_0x776d06[_0x2a79ec]);delete _0x776d06[_0x2a79ec];}}}};function loggerCatch(_0x1da685){return function(_0x32091f){logger[_0xc761('0x3f')](_0x1da685,util[_0xc761('0x45')](_0x32091f,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xc761('0xb')][_0xc761('0x46')]=function(_0x50c535,_0x45d75a,_0x7f9934){io['to'](_0x50c535)[_0xc761('0x46')](_0x45d75a,_0x7f9934);};VoiceQueueReport[_0xc761('0xb')][_0xc761('0x47')]=function(_0x45fe73){this[_0xc761('0x46')](util[_0xc761('0x48')](_0xc761('0x49'),_0x45fe73['name']),_0xc761('0x4a'),_0x45fe73);};VoiceQueueReport['prototype'][_0xc761('0x44')]=function(_0x62d5bf){logger[_0xc761('0x4b')](_0xc761('0x4c'),JSON[_0xc761('0x4d')](_0x62d5bf));this[_0xc761('0x46')](util[_0xc761('0x48')](_0xc761('0x49'),_0x62d5bf[_0xc761('0x4e')]),_0xc761('0x4f'),_0x62d5bf);};VoiceQueueReport[_0xc761('0xb')]['emitVoiceQueueSummary']=function(_0x1bbfa5){if(_0x1bbfa5['type']===_0xc761('0x50')){var _0x18a615={'id':_0x1bbfa5['id'],'name':_0x1bbfa5[_0xc761('0x4e')],'strategy':_0x1bbfa5[_0xc761('0x51')],'answered':_0x1bbfa5[_0xc761('0x52')],'available':_0x1bbfa5[_0xc761('0x53')],'loggedIn':_0x1bbfa5[_0xc761('0x54')],'pTalking':_0x1bbfa5[_0xc761('0x36')],'sumBillable':_0x1bbfa5[_0xc761('0x55')],'sumDuration':_0x1bbfa5[_0xc761('0x56')],'sumHoldTime':_0x1bbfa5[_0xc761('0x57')]||0x0,'talking':_0x1bbfa5[_0xc761('0x58')],'total':_0x1bbfa5['total'],'type':_0x1bbfa5[_0xc761('0x59')],'unmanaged':_0x1bbfa5[_0xc761('0x5a')],'abandoned':_0x1bbfa5[_0xc761('0x5b')],'waiting':_0x1bbfa5[_0xc761('0x5c')]};if(_0x1bbfa5[_0xc761('0x5d')]){_0x18a615[_0xc761('0x5d')]={'id':_0x1bbfa5[_0xc761('0x5d')]['id'],'name':_0x1bbfa5['Trunk']['name'],'active':_0x1bbfa5[_0xc761('0x5d')][_0xc761('0x5e')],'callerid':_0x1bbfa5[_0xc761('0x5d')]['callerid']};}if(_0x1bbfa5['Interval']){_0x18a615[_0xc761('0x5f')]={'id':_0x1bbfa5[_0xc761('0x5f')]['id'],'name':_0x1bbfa5[_0xc761('0x5f')][_0xc761('0x4e')]};}var _0x59100e=md5(JSON[_0xc761('0x4d')](_0x18a615));if(_0x1bbfa5[_0xc761('0x60')]!==_0x59100e){_0x1bbfa5[_0xc761('0x60')]=_0x59100e;this[_0xc761('0x46')](util[_0xc761('0x48')](_0xc761('0x49'),_0x18a615['name']),'voice_queue:save',_0x18a615);}}};VoiceQueueReport['prototype'][_0xc761('0x61')]=function(_0xc0075){return _0xc0075!==null&&!_[_0xc761('0x32')](_0xc0075);};VoiceQueueReport[_0xc761('0xb')][_0xc761('0x31')]=function(){var _0x1244bd=this;setInterval(function(){_0x1244bd[_0xc761('0x62')]();ami[_0xc761('0x63')]({'action':_0xc761('0x64')})['catch'](loggerCatch(_0xc761('0x65')));},0x2710);};VoiceQueueReport[_0xc761('0xb')][_0xc761('0x30')]=function(){var _0x1a55bc=this;setInterval(function(){if(_0x1a55bc['flagQueueSummary']){return ami[_0xc761('0x63')]({'action':_0xc761('0x16')})[_0xc761('0x66')](function(_0x47e5c1){_0x1a55bc[_0xc761('0x67')]=![];})['catch'](loggerCatch(_0xc761('0x68')));}},0x3e8);};VoiceQueueReport[_0xc761('0xb')]['syncQueueSummary']=function(_0x326110){try{if(this[_0xc761('0x61')](_0x326110)&&this[_0xc761('0x61')](_0x326110[_0xc761('0x69')])){if(this[_0xc761('0x13')][_0x326110[_0xc761('0x69')]]){var _0x439f67=_[_0xc761('0x6a')](this[_0xc761('0x12')],'queue')[_0x326110[_0xc761('0x69')]]||0x0;var _0x4515cf=_0x439f67-_0x326110[_0xc761('0x6b')];if(this[_0xc761('0x13')][_0x326110[_0xc761('0x69')]][_0xc761('0x5c')]!==_['toNumber'](_0x326110[_0xc761('0x6b')])||this[_0xc761('0x13')][_0x326110[_0xc761('0x69')]][_0xc761('0x54')]!==_[_0xc761('0x6c')](_0x326110[_0xc761('0x6d')])||this[_0xc761('0x13')][_0x326110[_0xc761('0x69')]][_0xc761('0x53')]!==_[_0xc761('0x6c')](_0x326110[_0xc761('0x53')])||this[_0xc761('0x13')][_0x326110[_0xc761('0x69')]]['talking']!==_0x4515cf){this[_0xc761('0x13')][_0x326110[_0xc761('0x69')]]['waiting']=_[_0xc761('0x6c')](_0x326110['callers']);this[_0xc761('0x13')][_0x326110[_0xc761('0x69')]][_0xc761('0x54')]=_[_0xc761('0x6c')](_0x326110[_0xc761('0x6d')]);this[_0xc761('0x13')][_0x326110[_0xc761('0x69')]][_0xc761('0x53')]=_[_0xc761('0x6c')](_0x326110[_0xc761('0x53')]);this[_0xc761('0x13')][_0x326110['queue']][_0xc761('0x58')]=_0x4515cf>0x0?_0x4515cf:0x0;this['voiceQueues'][_0x326110[_0xc761('0x69')]]['talking']=this['voiceQueues'][_0x326110['queue']][_0xc761('0x58')]>_[_0xc761('0x6c')](_0x326110['loggedin'])?_[_0xc761('0x6c')](_0x326110[_0xc761('0x6d')]):this['voiceQueues'][_0x326110[_0xc761('0x69')]][_0xc761('0x58')];this[_0xc761('0x6e')](this[_0xc761('0x13')][_0x326110[_0xc761('0x69')]]);}ami[_0xc761('0x46')](_0xc761('0x6f'),this[_0xc761('0x13')][_0x326110['queue']]);}}}catch(_0x88ba51){logger[_0xc761('0x3f')]('[syncQueueSummary][VoiceQueueReport]',util[_0xc761('0x45')](_0x88ba51,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc761('0xb')]['syncQueueSummaryComplete']=function(_0x4f85a3){this[_0xc761('0x67')]=!![];};VoiceQueueReport['prototype'][_0xc761('0x70')]=function(_0x399ace){};VoiceQueueReport['prototype'][_0xc761('0x1c')]=function(_0x359a86){try{if(this[_0xc761('0x61')](_0x359a86)){if(_[_0xc761('0x32')](this['queueReports'][_0x359a86[_0xc761('0x71')]])){this[_0xc761('0x10')][_0x359a86[_0xc761('0x71')]]=[];this[_0xc761('0x12')][_0x359a86[_0xc761('0x71')]]={};}var _0x59400a=new QueueReport();_0x59400a[_0xc761('0x4e')]=_0x359a86[_0xc761('0x69')];_0x59400a[_0xc761('0x59')]=this['voiceQueues'][_0x59400a[_0xc761('0x4e')]]&&this[_0xc761('0x13')][_0x59400a[_0xc761('0x4e')]][_0xc761('0x59')]?this[_0xc761('0x13')][_0x59400a[_0xc761('0x4e')]][_0xc761('0x59')]||_0xc761('0x50'):_0xc761('0x50');_0x59400a[_0xc761('0x69')]=_0x359a86[_0xc761('0x69')];_0x59400a[_0xc761('0x72')]=moment()[_0xc761('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x59400a['position']=_0x359a86[_0xc761('0x73')];_0x59400a[_0xc761('0x74')]=_0x359a86[_0xc761('0x74')];_[_0xc761('0x75')](_0x59400a,_[_0xc761('0x76')](_0x359a86,_[_0xc761('0x77')](_0x59400a)));this['queueReports'][_0x359a86[_0xc761('0x71')]][_0xc761('0x78')](_0x59400a);this['channels'][_0x359a86[_0xc761('0x71')]]=_0x59400a;this[_0xc761('0x47')](_0x59400a);}}catch(_0x5bd1d3){logger[_0xc761('0x3f')](_0xc761('0x79'),util[_0xc761('0x45')](_0x5bd1d3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc761('0xb')][_0xc761('0x1d')]=function(_0x3f6091){try{if(this[_0xc761('0x61')](_0x3f6091)){if(this[_0xc761('0x10')][_0x3f6091['uniqueid']]){var _0x1bf60f=_[_0xc761('0x7a')](this['queueReports'][_0x3f6091['uniqueid']]);_0x1bf60f['queuecallercomplete']=![];_0x1bf60f[_0xc761('0x7b')]=null;_0x1bf60f['holdtime']=_0x3f6091[_0xc761('0x7c')];_0x1bf60f[_0xc761('0x7d')]=_0x3f6091[_0xc761('0x7d')];_0x1bf60f[_0xc761('0x7e')]=!![];_0x1bf60f[_0xc761('0x7f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1bf60f[_0xc761('0x80')]=_0xc761('0x81');_0x1bf60f[_0xc761('0x82')]=null;this[_0xc761('0x12')][_0x3f6091['uniqueid']]=_0x1bf60f;this[_0xc761('0x44')](_0x1bf60f);}}}catch(_0x327e89){logger[_0xc761('0x3f')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0xc761('0x45')](_0x327e89,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc761('0x1f')]=function(_0x4fbd98){try{if(this[_0xc761('0x61')](_0x4fbd98)){if(this[_0xc761('0x10')][_0x4fbd98[_0xc761('0x71')]]){var _0x413418=_[_0xc761('0x7a')](this[_0xc761('0x10')][_0x4fbd98['uniqueid']]);_0x413418[_0xc761('0x83')]=moment()[_0xc761('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x413418[_0xc761('0x84')]=_0x4fbd98[_0xc761('0x84')];_0x413418[_0xc761('0x85')]=_0x4fbd98[_0xc761('0x85')];this[_0xc761('0x12')][_0x4fbd98[_0xc761('0x71')]]=_0x413418;this[_0xc761('0x47')](_0x413418);}}}catch(_0x44287d){logger[_0xc761('0x3f')]('[syncQueueCallerLeave][VoiceQueueReport]',util[_0xc761('0x45')](_0x44287d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc761('0x21')]=function(_0x11d4ac){try{if(this['isNotNull'](_0x11d4ac)){if(this['queueReports'][_0x11d4ac[_0xc761('0x71')]]){var _0x4fb8c=_['last'](this[_0xc761('0x10')][_0x11d4ac[_0xc761('0x71')]]);_0x4fb8c[_0xc761('0x86')]=!![];_0x4fb8c[_0xc761('0x80')]='COMPLETEDBYAGENT';}}}catch(_0xb75e2f){logger[_0xc761('0x3f')](_0xc761('0x87'),util[_0xc761('0x45')](_0xb75e2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc761('0x20')]=function(_0x2a857a){try{if(this[_0xc761('0x61')](_0x2a857a)){if(this[_0xc761('0x10')][_0x2a857a[_0xc761('0x71')]]){var _0xfe32e8=_[_0xc761('0x7a')](this[_0xc761('0x10')][_0x2a857a[_0xc761('0x71')]]);_0xfe32e8[_0xc761('0x7e')]=![];_0xfe32e8[_0xc761('0x7f')]=null;_0xfe32e8['assigned']=!![];_0xfe32e8['lastAssignedTo']=_0x2a857a['membername'];_0xfe32e8[_0xc761('0x7c')]=_0x2a857a[_0xc761('0x7c')];_0xfe32e8[_0xc761('0x86')]=!![];_0xfe32e8[_0xc761('0x88')]=![];_0xfe32e8['queuecallerexitAt']=null;if(!_0xfe32e8[_0xc761('0x89')]){if(_0x2a857a['reason']==_0xc761('0x89')){_0xfe32e8['queuecallerexitreason']='COMPLETED';}else{if(_[_0xc761('0x8a')](_0x2a857a[_0xc761('0x8b')]['toLowerCase'](),_0xc761('0x8c'))){if(this[_0xc761('0x10')][_0x2a857a['linkedid']]){var _0x4cfa6e=_[_0xc761('0x7a')](this[_0xc761('0x10')][_0x2a857a[_0xc761('0x8d')]]);_0x4cfa6e[_0xc761('0x86')]=![];_0x4cfa6e[_0xc761('0x88')]=!![];_0x4cfa6e[_0xc761('0x8e')]=moment(_0xfe32e8['queuecallerjoinAt'])['add'](_0x2a857a[_0xc761('0x7c')],_0xc761('0x8f'))['format'](_0xc761('0x90'));_0x4cfa6e[_0xc761('0x80')]=_0xc761('0x91');_0x4cfa6e['transfer']=!![];_0x4cfa6e['transfertype']='FORWARD';_0x4cfa6e[_0xc761('0x92')]=_0x2a857a[_0xc761('0x93')];_0x4cfa6e[_0xc761('0x94')]=_0x2a857a[_0xc761('0x71')];var _0x240de2=this[_0xc761('0x10')][_0x2a857a[_0xc761('0x8d')]];this[_0xc761('0x10')][_0x2a857a[_0xc761('0x8d')]]=this[_0xc761('0x10')][_0x2a857a[_0xc761('0x71')]];this[_0xc761('0x10')][_0x2a857a[_0xc761('0x71')]]=_0x240de2;}}else{_0xfe32e8[_0xc761('0x80')]='COMPLETEDBY'+_0x2a857a[_0xc761('0x95')][_0xc761('0x96')]();}}}this['channels'][_0x2a857a[_0xc761('0x71')]]=_0xfe32e8;this[_0xc761('0x44')](_0xfe32e8);}}}catch(_0x1e6e22){logger[_0xc761('0x3f')](_0xc761('0x97'),util[_0xc761('0x45')](_0x1e6e22,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc761('0xb')][_0xc761('0x23')]=function(_0x5c14f7){try{if(this[_0xc761('0x61')](_0x5c14f7)){this[_0xc761('0x98')](_0x5c14f7[_0xc761('0x71')],_['keys'](_0x5c14f7[_0xc761('0x99')])[0x0],_0x5c14f7[_0xc761('0x9a')]);if(this['queueReports'][_0x5c14f7[_0xc761('0x71')]]){var _0x589869=_[_0xc761('0x7a')](this[_0xc761('0x10')][_0x5c14f7['uniqueid']]);if(_0x589869){if(this[_0xc761('0x61')](_0x5c14f7[_0xc761('0x99')])&&this[_0xc761('0x61')](_0x5c14f7[_0xc761('0x99')]['queuestatus'])){switch(_0x5c14f7[_0xc761('0x9a')]){case _0xc761('0x9b'):_0x589869[_0xc761('0x88')]=![];_0x589869[_0xc761('0x8e')]=null;break;default:_0x589869[_0xc761('0x88')]=!![];_0x589869[_0xc761('0x8e')]=moment()[_0xc761('0x48')](_0xc761('0x90'));_0x589869[_0xc761('0x83')]=moment()[_0xc761('0x48')](_0xc761('0x90'));}_0x589869[_0xc761('0x7e')]=![];_0x589869[_0xc761('0x7f')]=null;_0x589869[_0xc761('0x80')]=_0x5c14f7[_0xc761('0x9a')];this[_0xc761('0x12')][_0x5c14f7[_0xc761('0x71')]]=_0x589869;this['emitVoiceQueueChannelRemove'](_0x589869);}else if(this[_0xc761('0x61')](_0x5c14f7['variable'])&&this['isNotNull'](_0x5c14f7[_0xc761('0x99')][_0xc761('0x9c')])){if(!_0x589869[_0xc761('0x7e')]){_0x589869['queuecallerexit']=!![];_0x589869['queuecallerexitAt']=moment()[_0xc761('0x48')](_0xc761('0x90'));_0x589869['queuecallerexitreason']=_0xc761('0x9d');_0x589869[_0xc761('0x83')]=moment()[_0xc761('0x48')](_0xc761('0x90'));this['channels'][_0x5c14f7['uniqueid']]=_0x589869;}}_0x589869[_0xc761('0x15')]=this[_0xc761('0x15')][_0x5c14f7[_0xc761('0x71')]];}}}}catch(_0x56a5f1){logger[_0xc761('0x3f')](_0xc761('0x9e'),util[_0xc761('0x45')](_0x56a5f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc761('0xb')][_0xc761('0x98')]=function(_0xea9d2,_0x1ae962,_0x280d13){var _0x4dc6d2=[_0xc761('0x9f'),'rtpaudioqosbridged',_0xc761('0xa0'),_0xc761('0xa1'),_0xc761('0xa2'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xc761('0xa3'),_0xc761('0xa4'),_0xc761('0xa5'),'bridgepeer',_0xc761('0xa6'),_0xc761('0xa7'),_0xc761('0xa8'),_0xc761('0xa9'),'memberlastcall',_0xc761('0xaa'),'memberpenalty',_0xc761('0xab')];if(!_[_0xc761('0x3a')](_0x1ae962)&&!_['includes'](_0x4dc6d2,_0x1ae962)){if(_[_0xc761('0x32')](this[_0xc761('0x15')][_0xea9d2])){this[_0xc761('0x15')][_0xea9d2]={};}this[_0xc761('0x15')][_0xea9d2][_0x1ae962]=_0x280d13;}};VoiceQueueReport[_0xc761('0xb')][_0xc761('0x25')]=function(_0x4016d1){try{if(this['isNotNull'](_0x4016d1)){if(this[_0xc761('0x10')][_0x4016d1['uniqueid']]){for(var _0x5bf0b4=0x0,_0x5c1572={};_0x5bf0b40x0?_0x2d21ad:0x0;this[_0x77e2('0xf')][_0x37361c[_0x77e2('0x61')]]['talking']=this[_0x77e2('0xf')][_0x37361c[_0x77e2('0x61')]][_0x77e2('0x2d')]>_[_0x77e2('0x64')](_0x37361c[_0x77e2('0x66')])?_[_0x77e2('0x64')](_0x37361c[_0x77e2('0x66')]):this[_0x77e2('0xf')][_0x37361c[_0x77e2('0x61')]][_0x77e2('0x2d')];this[_0x77e2('0x67')](this[_0x77e2('0xf')][_0x37361c['queue']]);}ami[_0x77e2('0x45')](_0x77e2('0x68'),this['voiceQueues'][_0x37361c[_0x77e2('0x61')]]);}}}catch(_0x40c859){logger[_0x77e2('0x3b')]('[syncQueueSummary][VoiceQueueReport]',util[_0x77e2('0x43')](_0x40c859,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x77e2('0x16')]=function(_0x53262a){this[_0x77e2('0x10')]=!![];};VoiceQueueReport[_0x77e2('0x9')]['syncNewExten']=function(_0x55a57f){};VoiceQueueReport[_0x77e2('0x9')][_0x77e2('0x18')]=function(_0x18cd29){try{if(this[_0x77e2('0x5b')](_0x18cd29)){if(_[_0x77e2('0x5c')](this[_0x77e2('0x3d')][_0x18cd29[_0x77e2('0x69')]])){this[_0x77e2('0x3d')][_0x18cd29[_0x77e2('0x69')]]=[];this[_0x77e2('0xd')][_0x18cd29[_0x77e2('0x69')]]={};}var _0xa4ac18=new QueueReport();_0xa4ac18[_0x77e2('0x48')]=_0x18cd29['queue'];_0xa4ac18[_0x77e2('0x54')]=this[_0x77e2('0xf')][_0xa4ac18[_0x77e2('0x48')]]&&this[_0x77e2('0xf')][_0xa4ac18[_0x77e2('0x48')]][_0x77e2('0x54')]?this[_0x77e2('0xf')][_0xa4ac18[_0x77e2('0x48')]][_0x77e2('0x54')]||'inbound':_0x77e2('0x4f');_0xa4ac18[_0x77e2('0x61')]=_0x18cd29['queue'];_0xa4ac18[_0x77e2('0x6a')]=moment()[_0x77e2('0x46')](_0x77e2('0x6b'));_0xa4ac18['position']=_0x18cd29[_0x77e2('0x6c')];_0xa4ac18[_0x77e2('0x6d')]=_0x18cd29[_0x77e2('0x6d')];_[_0x77e2('0x6e')](_0xa4ac18,_['pick'](_0x18cd29,_['keys'](_0xa4ac18)));this['queueReports'][_0x18cd29[_0x77e2('0x69')]]['push'](_0xa4ac18);this[_0x77e2('0xd')][_0x18cd29[_0x77e2('0x69')]]=_0xa4ac18;this[_0x77e2('0x44')](_0xa4ac18);}}catch(_0x480ef1){logger['error']('[syncQueueCallerJoin][VoiceQueueReport]',util['inspect'](_0x480ef1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x77e2('0x9')][_0x77e2('0x1a')]=function(_0x412d24){try{if(this[_0x77e2('0x5b')](_0x412d24)){if(this[_0x77e2('0x3d')][_0x412d24[_0x77e2('0x69')]]){var _0x5d71d1=_[_0x77e2('0x6f')](this[_0x77e2('0x3d')][_0x412d24[_0x77e2('0x69')]]);_0x5d71d1['queuecallercomplete']=![];_0x5d71d1[_0x77e2('0x70')]=null;_0x5d71d1[_0x77e2('0x71')]=_0x412d24[_0x77e2('0x71')];_0x5d71d1[_0x77e2('0x72')]=_0x412d24[_0x77e2('0x72')];_0x5d71d1[_0x77e2('0x19')]=!![];_0x5d71d1[_0x77e2('0x73')]=moment()[_0x77e2('0x46')](_0x77e2('0x6b'));_0x5d71d1[_0x77e2('0x74')]='ABANDONED';_0x5d71d1[_0x77e2('0x75')]=null;this['channels'][_0x412d24[_0x77e2('0x69')]]=_0x5d71d1;this[_0x77e2('0x4a')](_0x5d71d1);}}}catch(_0x4305a1){logger['error'](_0x77e2('0x76'),util[_0x77e2('0x43')](_0x4305a1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x77e2('0x9')][_0x77e2('0x1c')]=function(_0x334169){try{if(this[_0x77e2('0x5b')](_0x334169)){if(this[_0x77e2('0x3d')][_0x334169[_0x77e2('0x69')]]){var _0x3482ce=_['last'](this['queueReports'][_0x334169[_0x77e2('0x69')]]);_0x3482ce[_0x77e2('0x77')]=moment()[_0x77e2('0x46')](_0x77e2('0x6b'));_0x3482ce[_0x77e2('0x78')]=_0x334169[_0x77e2('0x78')];_0x3482ce['connectedlinename']=_0x334169[_0x77e2('0x79')];this[_0x77e2('0xd')][_0x334169[_0x77e2('0x69')]]=_0x3482ce;this[_0x77e2('0x44')](_0x3482ce);}}}catch(_0x1e9848){logger[_0x77e2('0x3b')]('[syncQueueCallerLeave][VoiceQueueReport]',util['inspect'](_0x1e9848,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x77e2('0x9')][_0x77e2('0x1f')]=function(_0x59f843){try{if(this[_0x77e2('0x5b')](_0x59f843)){if(this[_0x77e2('0x3d')][_0x59f843[_0x77e2('0x69')]]){var _0xe159b3=_[_0x77e2('0x6f')](this[_0x77e2('0x3d')][_0x59f843[_0x77e2('0x69')]]);_0xe159b3[_0x77e2('0x7a')]=!![];_0xe159b3['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0x20eeab){logger[_0x77e2('0x3b')](_0x77e2('0x7b'),util[_0x77e2('0x43')](_0x20eeab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x77e2('0x9')][_0x77e2('0x7c')]=function(_0x303a3a){try{if(this[_0x77e2('0x5b')](_0x303a3a)){if(this[_0x77e2('0x3d')][_0x303a3a[_0x77e2('0x69')]]){var _0x1412cb=_['last'](this['queueReports'][_0x303a3a['uniqueid']]);_0x1412cb[_0x77e2('0x19')]=![];_0x1412cb['queuecallerabandonAt']=null;_0x1412cb['assigned']=!![];_0x1412cb['lastAssignedTo']=_0x303a3a[_0x77e2('0x7d')];_0x1412cb[_0x77e2('0x71')]=_0x303a3a[_0x77e2('0x71')];_0x1412cb[_0x77e2('0x7a')]=!![];_0x1412cb[_0x77e2('0x7e')]=![];_0x1412cb[_0x77e2('0x7f')]=null;if(!_0x1412cb[_0x77e2('0x80')]){if(_0x303a3a['reason']==_0x77e2('0x80')){_0x1412cb[_0x77e2('0x74')]=_0x77e2('0x81');}else{if(_[_0x77e2('0x82')](_0x303a3a[_0x77e2('0x38')][_0x77e2('0x83')](),'local/')){if(this[_0x77e2('0x3d')][_0x303a3a[_0x77e2('0x84')]]){var _0x39a5f4=_[_0x77e2('0x6f')](this[_0x77e2('0x3d')][_0x303a3a['linkedid']]);_0x39a5f4[_0x77e2('0x7a')]=![];_0x39a5f4['queuecallerexit']=!![];_0x39a5f4[_0x77e2('0x7f')]=moment(_0x1412cb[_0x77e2('0x6a')])[_0x77e2('0x85')](_0x303a3a[_0x77e2('0x71')],_0x77e2('0x86'))[_0x77e2('0x46')](_0x77e2('0x6b'));_0x39a5f4[_0x77e2('0x74')]='FORWARDTRANSFER';_0x39a5f4[_0x77e2('0x80')]=!![];_0x39a5f4['transfertype']='FORWARD';_0x39a5f4[_0x77e2('0x87')]=_0x303a3a[_0x77e2('0x88')];_0x39a5f4[_0x77e2('0x89')]=_0x303a3a['uniqueid'];var _0x47c9dc=this['queueReports'][_0x303a3a[_0x77e2('0x84')]];this[_0x77e2('0x3d')][_0x303a3a[_0x77e2('0x84')]]=this[_0x77e2('0x3d')][_0x303a3a[_0x77e2('0x69')]];this[_0x77e2('0x3d')][_0x303a3a[_0x77e2('0x69')]]=_0x47c9dc;}}else{_0x1412cb[_0x77e2('0x74')]=_0x77e2('0x8a')+_0x303a3a['reason'][_0x77e2('0x8b')]();}}}this['channels'][_0x303a3a[_0x77e2('0x69')]]=_0x1412cb;this[_0x77e2('0x4a')](_0x1412cb);}}}catch(_0x4d51b3){logger[_0x77e2('0x3b')](_0x77e2('0x8c'),util[_0x77e2('0x43')](_0x4d51b3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x77e2('0x8d')]=function(_0x52d559){try{if(this['isNotNull'](_0x52d559)){this[_0x77e2('0x8e')](_0x52d559[_0x77e2('0x69')],_[_0x77e2('0x8f')](_0x52d559[_0x77e2('0x90')])[0x0],_0x52d559[_0x77e2('0x91')]);if(this[_0x77e2('0x3d')][_0x52d559['uniqueid']]){var _0xfd1a3b=_[_0x77e2('0x6f')](this[_0x77e2('0x3d')][_0x52d559[_0x77e2('0x69')]]);if(_0xfd1a3b){if(this[_0x77e2('0x5b')](_0x52d559['variable'])&&this[_0x77e2('0x5b')](_0x52d559[_0x77e2('0x90')][_0x77e2('0x92')])){switch(_0x52d559[_0x77e2('0x91')]){case _0x77e2('0x93'):_0xfd1a3b[_0x77e2('0x7e')]=![];_0xfd1a3b[_0x77e2('0x7f')]=null;break;default:_0xfd1a3b['queuecallerexit']=!![];_0xfd1a3b['queuecallerexitAt']=moment()[_0x77e2('0x46')](_0x77e2('0x6b'));_0xfd1a3b[_0x77e2('0x77')]=moment()['format'](_0x77e2('0x6b'));}_0xfd1a3b['queuecallerabandon']=![];_0xfd1a3b['queuecallerabandonAt']=null;_0xfd1a3b[_0x77e2('0x74')]=_0x52d559[_0x77e2('0x91')];this[_0x77e2('0xd')][_0x52d559[_0x77e2('0x69')]]=_0xfd1a3b;this[_0x77e2('0x4a')](_0xfd1a3b);}else if(this['isNotNull'](_0x52d559[_0x77e2('0x90')])&&this[_0x77e2('0x5b')](_0x52d559['variable'][_0x77e2('0x94')])){if(!_0xfd1a3b['queuecallerabandon']){_0xfd1a3b[_0x77e2('0x7e')]=!![];_0xfd1a3b['queuecallerexitAt']=moment()[_0x77e2('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0xfd1a3b[_0x77e2('0x74')]=_0x77e2('0x95');_0xfd1a3b['queuecallerleaveAt']=moment()[_0x77e2('0x46')](_0x77e2('0x6b'));this[_0x77e2('0xd')][_0x52d559[_0x77e2('0x69')]]=_0xfd1a3b;}}_0xfd1a3b[_0x77e2('0x12')]=this[_0x77e2('0x12')][_0x52d559[_0x77e2('0x69')]];}}}}catch(_0x43c5f1){logger[_0x77e2('0x3b')](_0x77e2('0x96'),util['inspect'](_0x43c5f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x77e2('0x9')][_0x77e2('0x8e')]=function(_0x1c3fa9,_0x6b69f5,_0x27e44d){var _0x16b2bd=[_0x77e2('0x97'),_0x77e2('0x98'),_0x77e2('0x99'),'rtpaudioqosjitterbridged',_0x77e2('0x9a'),_0x77e2('0x9b'),_0x77e2('0x9c'),_0x77e2('0x9d'),_0x77e2('0x9e'),_0x77e2('0x9f'),_0x77e2('0xa0'),_0x77e2('0xa1'),_0x77e2('0xa2'),'memberdynamic','memberinterface','memberlastcall',_0x77e2('0x7d'),'memberpenalty','memberrealtime'];if(!_[_0x77e2('0x35')](_0x6b69f5)&&!_[_0x77e2('0xa3')](_0x16b2bd,_0x6b69f5)){if(_[_0x77e2('0x5c')](this['variables'][_0x1c3fa9])){this['variables'][_0x1c3fa9]={};}this[_0x77e2('0x12')][_0x1c3fa9][_0x6b69f5]=_0x27e44d;}};VoiceQueueReport[_0x77e2('0x9')][_0x77e2('0x21')]=function(_0x32d175){try{if(this[_0x77e2('0x5b')](_0x32d175)){if(this[_0x77e2('0x3d')][_0x32d175[_0x77e2('0x69')]]){for(var _0x537b9c=0x0,_0x57e56a={};_0x537b9c=0x0?moment(_0x43f389[_0x7af6('0x16')])[_0x7af6('0x9')](_0x43f389['starttime'],_0x7af6('0xa')):null,'data1':_0x7af6('0x17'),'data2':_0x43f389[_0x7af6('0x18')],'data3':_0x43f389['exten'],'data4':_0x43f389['dialstring']||null,'role':_0x7af6('0xe'),'internal':_0x43f389['accountcode']?_[_0x7af6('0xf')](_0x43f389[_0x7af6('0x18')]):undefined,'uniqueid':_0x43f389[_0x7af6('0x19')]},'log':_0x7af6('0x10')});}; \ No newline at end of file +var _0x05dc=['uniqueid','membername','endtime','starttime','outbound','moment','lodash','util','../client','voiceQueueReport','Request','CreateMemberReport','voice','lastAssignedTo','isNil','format','SIP/%s','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','agent','toNumber','accountcode'];(function(_0x5cf583,_0x4b494f){var _0x1724ca=function(_0x1c121f){while(--_0x1c121f){_0x5cf583['push'](_0x5cf583['shift']());}};_0x1724ca(++_0x4b494f);}(_0x05dc,0x91));var _0xc05d=function(_0x21fe98,_0x55db4c){_0x21fe98=_0x21fe98-0x0;var _0x19dde3=_0x05dc[_0x21fe98];return _0x19dde3;};'use strict';var moment=require(_0xc05d('0x0'));var _=require(_0xc05d('0x1'));var util=require(_0xc05d('0x2'));var client=require(_0xc05d('0x3'));exports[_0xc05d('0x4')]=function(_0x236f13){var _0xb6ef73=_0x236f13['queuecallercompleteAt']||_0x236f13['queuecallerexitAt'];return client[_0xc05d('0x5')](_0xc05d('0x6'),{'body':{'channel':_0xc05d('0x7'),'membername':_0x236f13[_0xc05d('0x8')],'interface':_[_0xc05d('0x9')](_0x236f13['interface'])?util[_0xc05d('0xa')](_0xc05d('0xb'),_0x236f13[_0xc05d('0x8')]):_0x236f13[_0xc05d('0xc')],'type':_0xc05d('0xd'),'enterAt':_0x236f13[_0xc05d('0xe')],'exitAt':_0xb6ef73,'duration':moment(_0xb6ef73)[_0xc05d('0xf')](_0x236f13[_0xc05d('0xe')],_0xc05d('0x10')),'data1':_0xc05d('0x11'),'data2':_0x236f13[_0xc05d('0x12')],'data3':_0x236f13[_0xc05d('0x13')],'data4':null,'data5':_0x236f13['queue'],'role':_0xc05d('0x14'),'internal':_0x236f13['accountcode']?_[_0xc05d('0x15')](_0x236f13[_0xc05d('0x16')]):undefined,'uniqueid':_0x236f13[_0xc05d('0x17')]},'log':_0xc05d('0x6')});};exports['voiceDialReport']=function(_0x1fa04a){return client[_0xc05d('0x5')]('CreateMemberReport',{'body':{'channel':_0xc05d('0x7'),'membername':_0x1fa04a[_0xc05d('0x18')],'interface':_0x1fa04a[_0xc05d('0xc')],'type':_0xc05d('0xd'),'enterAt':_0x1fa04a['starttime'],'exitAt':_0x1fa04a[_0xc05d('0x19')],'duration':moment(_0x1fa04a[_0xc05d('0x19')])['diff'](_0x1fa04a[_0xc05d('0x1a')],_0xc05d('0x10'))>=0x0?moment(_0x1fa04a[_0xc05d('0x19')])[_0xc05d('0xf')](_0x1fa04a['starttime'],_0xc05d('0x10')):null,'data1':_0xc05d('0x1b'),'data2':_0x1fa04a[_0xc05d('0x16')],'data3':_0x1fa04a['exten'],'data4':_0x1fa04a['dialstring']||null,'role':'agent','internal':_0x1fa04a[_0xc05d('0x16')]?_[_0xc05d('0x15')](_0x1fa04a[_0xc05d('0x16')]):undefined,'uniqueid':_0x1fa04a[_0xc05d('0x17')]},'log':_0xc05d('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index c3d6176..05d1aa0 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 _0x55f1=['../client','Request','GetTemplate','name','html'];(function(_0x449bf8,_0x2bc097){var _0x466ecf=function(_0x4893ab){while(--_0x4893ab){_0x449bf8['push'](_0x449bf8['shift']());}};_0x466ecf(++_0x2bc097);}(_0x55f1,0x9b));var _0x155f=function(_0x5959bc,_0x29fb41){_0x5959bc=_0x5959bc-0x0;var _0x5bb235=_0x55f1[_0x5959bc];return _0x5bb235;};'use strict';var client=require(_0x155f('0x0'));exports['getTemplates']=function(_0x9fa58a){return function(_0x476580){return client[_0x155f('0x1')](_0x155f('0x2'),{'options':{'raw':!![],'attributes':['id',_0x155f('0x3'),_0x155f('0x4')]},'log':_0x155f('0x2')});};}; \ No newline at end of file +var _0xd64b=['GetTemplate','name','html','../client','Request'];(function(_0x21970a,_0xd9d04e){var _0x222f45=function(_0x2e24c5){while(--_0x2e24c5){_0x21970a['push'](_0x21970a['shift']());}};_0x222f45(++_0xd9d04e);}(_0xd64b,0xc1));var _0xbd64=function(_0x4caea4,_0x4f02e4){_0x4caea4=_0x4caea4-0x0;var _0x207c7c=_0xd64b[_0x4caea4];return _0x207c7c;};'use strict';var client=require(_0xbd64('0x0'));exports['getTemplates']=function(_0xf0de04){return function(_0x4bfb7c){return client[_0xbd64('0x1')](_0xbd64('0x2'),{'options':{'raw':!![],'attributes':['id',_0xbd64('0x3'),_0xbd64('0x4')]},'log':_0xbd64('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 89c99c0..7db6c26 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 _0x0cfd=['AnyConditions','field','value','Actions','action','data2','data3','data4','data5','data6','GetTrigger','../client','Request','name','status','Condition','operator'];(function(_0x5be8aa,_0x3973f5){var _0x1fd566=function(_0x47e086){while(--_0x47e086){_0x5be8aa['push'](_0x5be8aa['shift']());}};_0x1fd566(++_0x3973f5);}(_0x0cfd,0x1e7));var _0xd0cf=function(_0x5a231a,_0x342669){_0x5a231a=_0x5a231a-0x0;var _0x2eb083=_0x0cfd[_0x5a231a];return _0x2eb083;};'use strict';var client=require(_0xd0cf('0x0'));exports['getTriggers']=function(_0x2f5d61){return function(_0x321677){return client[_0xd0cf('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xd0cf('0x2'),'channel',_0xd0cf('0x3')],'include':[{'model':_0xd0cf('0x4'),'as':'AllConditions','attributes':['id','field',_0xd0cf('0x5'),'value']},{'model':_0xd0cf('0x4'),'as':_0xd0cf('0x6'),'attributes':['id',_0xd0cf('0x7'),'operator',_0xd0cf('0x8')]},{'model':'Action','as':_0xd0cf('0x9'),'attributes':['id',_0xd0cf('0xa'),'data1',_0xd0cf('0xb'),_0xd0cf('0xc'),_0xd0cf('0xd'),_0xd0cf('0xe'),_0xd0cf('0xf'),'data7']}]},'log':_0xd0cf('0x10')});};}; \ No newline at end of file +var _0x3237=['data3','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','operator','AnyConditions','field','value','Action','action'];(function(_0x4fc3d7,_0x13777d){var _0x4ece22=function(_0x2e5b5a){while(--_0x2e5b5a){_0x4fc3d7['push'](_0x4fc3d7['shift']());}};_0x4ece22(++_0x13777d);}(_0x3237,0x1d8));var _0x7323=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3237[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x7323('0x0'));exports[_0x7323('0x1')]=function(_0x5108a3){return function(_0x213550){return client[_0x7323('0x2')](_0x7323('0x3'),{'options':{'raw':![],'attributes':['id',_0x7323('0x4'),_0x7323('0x5'),_0x7323('0x6')],'include':[{'model':_0x7323('0x7'),'as':'AllConditions','attributes':['id','field',_0x7323('0x8'),'value']},{'model':_0x7323('0x7'),'as':_0x7323('0x9'),'attributes':['id',_0x7323('0xa'),'operator',_0x7323('0xb')]},{'model':_0x7323('0xc'),'as':'Actions','attributes':['id',_0x7323('0xd'),'data1','data2',_0x7323('0xe'),'data4',_0x7323('0xf'),_0x7323('0x10'),_0x7323('0x11')]}]},'log':_0x7323('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 64fda76..99782cf 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 _0xa60e=['GetTrunk','name','../client','getTrunks','Request'];(function(_0x232b55,_0x3d9d7a){var _0x5be3bb=function(_0x5dfea8){while(--_0x5dfea8){_0x232b55['push'](_0x232b55['shift']());}};_0x5be3bb(++_0x3d9d7a);}(_0xa60e,0x183));var _0xea60=function(_0xf10b30,_0x3c8682){_0xf10b30=_0xf10b30-0x0;var _0x3d4268=_0xa60e[_0xf10b30];return _0x3d4268;};'use strict';var client=require(_0xea60('0x0'));exports[_0xea60('0x1')]=function(_0x4e4f41){return function(_0x35b54d){return client[_0xea60('0x2')](_0xea60('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xea60('0x4'),'registry']},'log':_0xea60('0x3')});};}; \ No newline at end of file +var _0x1f87=['getTrunks','Request','GetTrunk','registry','../client'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x1f87,0x86));var _0x71f8=function(_0x2a4fe2,_0x3ec53a){_0x2a4fe2=_0x2a4fe2-0x0;var _0x225c4a=_0x1f87[_0x2a4fe2];return _0x225c4a;};'use strict';var client=require(_0x71f8('0x0'));exports[_0x71f8('0x1')]=function(_0x1727da){return function(_0x4b5c70){return client[_0x71f8('0x2')](_0x71f8('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x71f8('0x4')]},'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 c487da6..47ac4ee 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 _0xde27=['saveUnpause','UnpauseUser','getAgent','lastLoginAt','lastPauseAt','../client','getAgents','GetUser','agent','accountcode','online','pauseType','voicePause','phone','mobile','interface','getTelephones','Request','telephone','name','savePause'];(function(_0x280d43,_0x5a7c7c){var _0x395f62=function(_0x326449){while(--_0x326449){_0x280d43['push'](_0x280d43['shift']());}};_0x395f62(++_0x5a7c7c);}(_0xde27,0x12b));var _0x7de2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde27[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x7de2('0x0'));exports[_0x7de2('0x1')]=function(){return function(){return client['Request'](_0x7de2('0x2'),{'options':{'raw':![],'where':{'role':_0x7de2('0x3')},'attributes':['id','name','email',_0x7de2('0x4'),'fullname',_0x7de2('0x5'),'lastLoginAt',_0x7de2('0x6'),'lastPauseAt',_0x7de2('0x7'),_0x7de2('0x8'),_0x7de2('0x9'),_0x7de2('0xa')]},'log':'getAgents'});};};exports[_0x7de2('0xb')]=function(){return function(){return client[_0x7de2('0xc')](_0x7de2('0x2'),{'options':{'raw':!![],'where':{'role':_0x7de2('0xd')},'attributes':['id',_0x7de2('0xe'),'accountcode','internal']},'log':'getTelephones'});};};exports[_0x7de2('0xf')]=function(_0x4f4535,_0x1afcbb,_0x54c053){return client[_0x7de2('0xc')]('PauseUser',{'body':{'type':_0x1afcbb,'uniqueid':_0x54c053},'options':{'where':{'id':_0x4f4535['id']}},'log':_0x7de2('0xf')});};exports[_0x7de2('0x10')]=function(_0x15ccce){return client[_0x7de2('0xc')](_0x7de2('0x11'),{'body':{},'options':{'where':{'id':_0x15ccce['id']}},'log':_0x7de2('0xf')});};exports[_0x7de2('0x12')]=function(_0x22d37a){return client[_0x7de2('0xc')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x7de2('0x3'),'id':_0x22d37a},'attributes':['id',_0x7de2('0xe'),'email',_0x7de2('0x4'),'fullname',_0x7de2('0x5'),_0x7de2('0x13'),_0x7de2('0x6'),_0x7de2('0x14'),'voicePause',_0x7de2('0xa')]},'log':_0x7de2('0x12')});}; \ No newline at end of file +var _0x5734=['Request','GetUser','accountcode','internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','online','../client','agent','name','email','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5734,0x82));var _0x4573=function(_0x37e343,_0x5dbfea){_0x37e343=_0x37e343-0x0;var _0xf688dc=_0x5734[_0x37e343];return _0xf688dc;};'use strict';var client=require(_0x4573('0x0'));exports['getAgents']=function(){return function(){return client['Request']('GetUser',{'options':{'raw':![],'where':{'role':_0x4573('0x1')},'attributes':['id',_0x4573('0x2'),_0x4573('0x3'),'accountcode',_0x4573('0x4'),'online',_0x4573('0x5'),_0x4573('0x6'),_0x4573('0x7'),_0x4573('0x8'),_0x4573('0x9'),_0x4573('0xa'),_0x4573('0xb')]},'log':_0x4573('0xc')});};};exports[_0x4573('0xd')]=function(){return function(){return client[_0x4573('0xe')](_0x4573('0xf'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x4573('0x2'),_0x4573('0x10'),_0x4573('0x11')]},'log':_0x4573('0xd')});};};exports[_0x4573('0x12')]=function(_0x57c5f1,_0x5dacf1,_0x57fdc0){return client['Request'](_0x4573('0x13'),{'body':{'type':_0x5dacf1,'uniqueid':_0x57fdc0},'options':{'where':{'id':_0x57c5f1['id']}},'log':_0x4573('0x12')});};exports[_0x4573('0x14')]=function(_0x309b2a){return client[_0x4573('0xe')](_0x4573('0x15'),{'body':{},'options':{'where':{'id':_0x309b2a['id']}},'log':'savePause'});};exports['getAgent']=function(_0x7a8c3f){return client[_0x4573('0xe')](_0x4573('0x16'),{'options':{'raw':![],'where':{'role':_0x4573('0x1'),'id':_0x7a8c3f},'attributes':['id',_0x4573('0x2'),_0x4573('0x3'),_0x4573('0x10'),_0x4573('0x4'),_0x4573('0x17'),_0x4573('0x5'),_0x4573('0x6'),'lastPauseAt',_0x4573('0x8'),'interface']},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 825b36c..73526bd 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 _0xbd3c=['create','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xbd3c,0x6f));var _0xcbd3=function(_0x26c457,_0x3e9e8e){_0x26c457=_0x26c457-0x0;var _0x5a0079=_0xbd3c[_0x26c457];return _0x5a0079;};'use strict';var client=require(_0xcbd3('0x0'));exports[_0xcbd3('0x1')]=function(_0xa5d91f){return client['Request'](_0xcbd3('0x2'),{'body':_0xa5d91f,'log':_0xcbd3('0x2')});};exports['update']=function(_0x575d61,_0x2745e2,_0x191bc8){return client['Request']('UpdateVoiceAgentReport',{'body':_0x575d61,'options':{'where':{'uniqueid':_0x2745e2,'interface':_0x191bc8,'agentcomplete':!![]}},'log':_0xcbd3('0x3')});}; \ No newline at end of file +var _0x6cba=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x238c6c,_0x33f3cd){var _0x182005=function(_0x1b098e){while(--_0x1b098e){_0x238c6c['push'](_0x238c6c['shift']());}};_0x182005(++_0x33f3cd);}(_0x6cba,0x173));var _0xa6cb=function(_0x2553b9,_0x240a53){_0x2553b9=_0x2553b9-0x0;var _0x4938b0=_0x6cba[_0x2553b9];return _0x4938b0;};'use strict';var client=require(_0xa6cb('0x0'));exports[_0xa6cb('0x1')]=function(_0x1a7eef){return client['Request'](_0xa6cb('0x2'),{'body':_0x1a7eef,'log':_0xa6cb('0x2')});};exports[_0xa6cb('0x3')]=function(_0x42f723,_0x23fff2,_0x317c34){return client[_0xa6cb('0x4')](_0xa6cb('0x5'),{'body':_0x42f723,'options':{'where':{'uniqueid':_0x23fff2,'interface':_0x317c34,'agentcomplete':!![]}},'log':_0xa6cb('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index ae00db3..3ad6545 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 _0x39e0=['endOf','type','disposition','duration','billableseconds','util','create','Request','merge','calleridnum','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x39e0,0xdd));var _0x039e=function(_0x37420e,_0x247d6d){_0x37420e=_0x37420e-0x0;var _0x36d311=_0x39e0[_0x37420e];return _0x36d311;};'use strict';var moment=require('moment');var util=require(_0x039e('0x0'));var _=require('lodash');var client=require('../client');exports[_0x039e('0x1')]=function(_0x219486){return client[_0x039e('0x2')]('CreateVoiceCallReport',{'body':_[_0x039e('0x3')](_0x219486,{'source':_0x219486[_0x039e('0x4')],'destinationcontext':_0x219486['context'],'callerid':_0x219486['callerid'],'amaflags':_0x039e('0x5')}),'log':'CreateVoiceCallReport'});};exports[_0x039e('0x6')]=function(){return function(){return client[_0x039e('0x2')](_0x039e('0x7'),{'options':{'where':{'type':[_0x039e('0x8')],'createdAt':{'$between':[moment()[_0x039e('0x9')](_0x039e('0xa'))[_0x039e('0xb')](_0x039e('0xc')),moment()[_0x039e('0xd')]('day')[_0x039e('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x039e('0xe'),_0x039e('0xf'),_0x039e('0x10'),_0x039e('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xb696=['format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','billableseconds','GetVoiceCallReports','util','lodash','create','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport','startOf','day'];(function(_0x40c70a,_0x566177){var _0xa49b66=function(_0x1556d0){while(--_0x1556d0){_0x40c70a['push'](_0x40c70a['shift']());}};_0xa49b66(++_0x566177);}(_0xb696,0x84));var _0x6b69=function(_0x3d6ab3,_0x7205ab){_0x3d6ab3=_0x3d6ab3-0x0;var _0x65519b=_0xb696[_0x3d6ab3];return _0x65519b;};'use strict';var moment=require('moment');var util=require(_0x6b69('0x0'));var _=require(_0x6b69('0x1'));var client=require('../client');exports[_0x6b69('0x2')]=function(_0x233c08){return client[_0x6b69('0x3')](_0x6b69('0x4'),{'body':_['merge'](_0x233c08,{'source':_0x233c08[_0x6b69('0x5')],'destinationcontext':_0x233c08[_0x6b69('0x6')],'callerid':_0x233c08[_0x6b69('0x7')],'amaflags':_0x6b69('0x8')}),'log':_0x6b69('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x6b69('0x3')](_0x6b69('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x6b69('0xa')](_0x6b69('0xb'))[_0x6b69('0xc')](_0x6b69('0xd')),moment()[_0x6b69('0xe')](_0x6b69('0xb'))[_0x6b69('0xc')](_0x6b69('0xd'))]}},'attributes':[_0x6b69('0xf'),'disposition','duration',_0x6b69('0x10')]},'log':_0x6b69('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 032fed3..b3e0dc2 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 _0x9c70=['create','Request','../client'];(function(_0x40dbfd,_0xbca3f0){var _0x29c077=function(_0x29ac3f){while(--_0x29ac3f){_0x40dbfd['push'](_0x40dbfd['shift']());}};_0x29c077(++_0xbca3f0);}(_0x9c70,0xdd));var _0x09c7=function(_0x421e73,_0x2d3fdc){_0x421e73=_0x421e73-0x0;var _0x2f71ec=_0x9c70[_0x421e73];return _0x2f71ec;};'use strict';var client=require(_0x09c7('0x0'));exports[_0x09c7('0x1')]=function(_0x29b70a){return client[_0x09c7('0x2')]('CreateVoiceDialReport',{'body':_0x29b70a,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0xa36a=['create','Request','CreateVoiceDialReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa36a,0xc6));var _0xaa36=function(_0x48fd30,_0x3aaf97){_0x48fd30=_0x48fd30-0x0;var _0x205130=_0xa36a[_0x48fd30];return _0x205130;};'use strict';var client=require('../client');exports[_0xaa36('0x0')]=function(_0x2d37ca){return client[_0xaa36('0x1')](_0xaa36('0x2'),{'body':_0x2d37ca,'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 13d9586..078f899 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 _0xb9a7=['getVoiceExtensions','recordingFormat'];(function(_0x31aa1e,_0xbc89b){var _0x588e83=function(_0xfe8c0d){while(--_0xfe8c0d){_0x31aa1e['push'](_0x31aa1e['shift']());}};_0x588e83(++_0xbc89b);}(_0xb9a7,0x112));var _0x7b9a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb9a7[_0x4b369d];return _0x571a98;};'use strict';var client=require('../client');exports[_0x7b9a('0x0')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0x7b9a('0x1')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xfbb2=['getVoiceExtensions','Request','GetVoiceExtension','recordingFormat','../client'];(function(_0x277764,_0x4085da){var _0xb2c1df=function(_0x35fe8f){while(--_0x35fe8f){_0x277764['push'](_0x277764['shift']());}};_0xb2c1df(++_0x4085da);}(_0xfbb2,0xae));var _0x2fbb=function(_0x4a2718,_0x2b8edb){_0x4a2718=_0x4a2718-0x0;var _0x41cddf=_0xfbb2[_0x4a2718];return _0x41cddf;};'use strict';var client=require(_0x2fbb('0x0'));exports[_0x2fbb('0x1')]=function(){return function(){return client[_0x2fbb('0x2')](_0x2fbb('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x2fbb('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x2fbb('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index c041f5f..12d6fcc 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 _0xed19=['strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','mandatoryDisposition','Trunk','callerid','mandatoryDispositionPause','active','Interval','interval','../client','getVoiceQueues','GetVoiceQueue','name','autopause','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format'];(function(_0x4fc80b,_0xfe1b3d){var _0x119dba=function(_0x16ed12){while(--_0x16ed12){_0x4fc80b['push'](_0x4fc80b['shift']());}};_0x119dba(++_0xfe1b3d);}(_0xed19,0xdd));var _0x9ed1=function(_0x308dcc,_0x2d1178){_0x308dcc=_0x308dcc-0x0;var _0x361717=_0xed19[_0x308dcc];return _0x361717;};'use strict';var client=require(_0x9ed1('0x0'));exports[_0x9ed1('0x1')]=function(){return function(){return client['Request'](_0x9ed1('0x2'),{'options':{'raw':![],'attributes':['id',_0x9ed1('0x3'),'acw','acwTimeout',_0x9ed1('0x4'),'monitor_format','type','dialActive',_0x9ed1('0x5'),_0x9ed1('0x6'),_0x9ed1('0x7'),_0x9ed1('0x8'),_0x9ed1('0x9'),_0x9ed1('0xa'),'dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x9ed1('0xb'),'dialQueueOptions','dialQueueTimeout',_0x9ed1('0xc'),_0x9ed1('0xd'),_0x9ed1('0xe'),_0x9ed1('0xf'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x9ed1('0x10'),_0x9ed1('0x11'),'dialTimezone','dialGlobalInterval',_0x9ed1('0x12'),_0x9ed1('0x13'),_0x9ed1('0x14'),'dialAMDInitialSilence',_0x9ed1('0x15'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x9ed1('0x16'),_0x9ed1('0x17'),_0x9ed1('0x18'),_0x9ed1('0x19'),_0x9ed1('0x1a'),_0x9ed1('0x1b'),_0x9ed1('0x1c'),'dialRecallInQueue',_0x9ed1('0x1d'),_0x9ed1('0x1e'),_0x9ed1('0x1f'),_0x9ed1('0x20'),_0x9ed1('0x21'),_0x9ed1('0x22'),_0x9ed1('0x23'),_0x9ed1('0x24'),_0x9ed1('0x25'),_0x9ed1('0x26'),_0x9ed1('0x27'),_0x9ed1('0x28'),'dialAbandonedMaxRetry',_0x9ed1('0x29'),_0x9ed1('0x2a'),_0x9ed1('0x2b'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x9ed1('0x2c'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x9ed1('0x2d'),'as':'Trunk','attributes':['id',_0x9ed1('0x3'),_0x9ed1('0x2e'),'active']},{'model':'Pause','as':_0x9ed1('0x2f'),'attributes':['id','name']},{'model':_0x9ed1('0x2d'),'as':'TrunkBackup','attributes':['id',_0x9ed1('0x3'),_0x9ed1('0x2e'),_0x9ed1('0x30')]},{'model':_0x9ed1('0x31'),'as':_0x9ed1('0x31'),'attributes':['id',_0x9ed1('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x9ed1('0x3'),_0x9ed1('0x32')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x076c=['callerid','Pause','Interval','interval','../client','getVoiceQueues','Request','name','acw','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk'];(function(_0x3355c0,_0x4b530b){var _0x5a3288=function(_0x46dad1){while(--_0x46dad1){_0x3355c0['push'](_0x3355c0['shift']());}};_0x5a3288(++_0x4b530b);}(_0x076c,0xe8));var _0xc076=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0x076c[_0x2e50a2];return _0x47e5de;};'use strict';var client=require(_0xc076('0x0'));exports[_0xc076('0x1')]=function(){return function(){return client[_0xc076('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xc076('0x3'),_0xc076('0x4'),'acwTimeout','autopause',_0xc076('0x5'),'type',_0xc076('0x6'),_0xc076('0x7'),'dialLimitChannel',_0xc076('0x8'),_0xc076('0x9'),_0xc076('0xa'),_0xc076('0xb'),_0xc076('0xc'),_0xc076('0xd'),_0xc076('0xe'),'dialOriginateTimeout',_0xc076('0xf'),_0xc076('0x10'),_0xc076('0x11'),_0xc076('0x12'),_0xc076('0x13'),_0xc076('0x14'),_0xc076('0x15'),_0xc076('0x16'),_0xc076('0x17'),_0xc076('0x18'),_0xc076('0x19'),_0xc076('0x1a'),'dialPrefix',_0xc076('0x1b'),_0xc076('0x1c'),_0xc076('0x1d'),_0xc076('0x1e'),_0xc076('0x1f'),_0xc076('0x20'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0xc076('0x21'),'dialAMDMaximumWordLength',_0xc076('0x22'),_0xc076('0x23'),_0xc076('0x24'),_0xc076('0x25'),_0xc076('0x26'),'dialAgiAfterHangupClient',_0xc076('0x27'),'monitor_format',_0xc076('0x28'),_0xc076('0x29'),'dialCutDigit',_0xc076('0x2a'),_0xc076('0x2b'),_0xc076('0x2c'),_0xc076('0x2d'),'dialAbandonedMaxRetry',_0xc076('0x2e'),'dialMachineMaxRetry',_0xc076('0x2f'),'dialAgentRejectMaxRetry',_0xc076('0x30'),_0xc076('0x31'),_0xc076('0x32'),_0xc076('0x33')],'include':[{'model':_0xc076('0x34'),'as':_0xc076('0x34'),'attributes':['id',_0xc076('0x3'),_0xc076('0x35'),'active']},{'model':_0xc076('0x36'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0xc076('0x34'),'as':'TrunkBackup','attributes':['id','name',_0xc076('0x35'),'active']},{'model':_0xc076('0x37'),'as':_0xc076('0x37'),'attributes':['id',_0xc076('0x3')],'include':[{'model':_0xc076('0x37'),'as':'Intervals','attributes':['id',_0xc076('0x3'),_0xc076('0x38')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 86c1331..d5f91bb 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 _0x96f2=['queuecallerabandonAt','GetVoiceQueueReports','moment','../client','create','Request','CreateVoiceQueueReport','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt'];(function(_0x4a82fe,_0x4e987a){var _0x23657f=function(_0x5b90f8){while(--_0x5b90f8){_0x4a82fe['push'](_0x4a82fe['shift']());}};_0x23657f(++_0x4e987a);}(_0x96f2,0x12e));var _0x296f=function(_0x46c11e,_0x4ca91f){_0x46c11e=_0x46c11e-0x0;var _0x5003a0=_0x96f2[_0x46c11e];return _0x5003a0;};'use strict';var moment=require(_0x296f('0x0'));var _=require('lodash');var client=require(_0x296f('0x1'));exports[_0x296f('0x2')]=function(_0x5447e8){return client[_0x296f('0x3')]('CreateVoiceQueueReport',{'body':_0x5447e8,'log':_0x296f('0x4')});};exports['getVoiceQueueReports']=function(){return function(){return client['Request'](_0x296f('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x296f('0x6')](_0x296f('0x7'))[_0x296f('0x8')](_0x296f('0x9')),moment()['endOf'](_0x296f('0x7'))['format'](_0x296f('0x9'))]}},'attributes':[_0x296f('0xa'),_0x296f('0xb'),_0x296f('0xc'),_0x296f('0xd'),_0x296f('0xe'),_0x296f('0xf'),_0x296f('0x10'),_0x296f('0x11'),'queuecallerabandon',_0x296f('0x12')]},'log':_0x296f('0x13')});};}; \ No newline at end of file +var _0x10df=['startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','queue','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport'];(function(_0x4d9f48,_0x5e1079){var _0x391a71=function(_0x106b46){while(--_0x106b46){_0x4d9f48['push'](_0x4d9f48['shift']());}};_0x391a71(++_0x5e1079);}(_0x10df,0x1ae));var _0xf10d=function(_0x32fc14,_0x20cd7b){_0x32fc14=_0x32fc14-0x0;var _0x434767=_0x10df[_0x32fc14];return _0x434767;};'use strict';var moment=require(_0xf10d('0x0'));var _=require(_0xf10d('0x1'));var client=require('../client');exports[_0xf10d('0x2')]=function(_0x47c467){return client[_0xf10d('0x3')](_0xf10d('0x4'),{'body':_0x47c467,'log':_0xf10d('0x4')});};exports[_0xf10d('0x5')]=function(){return function(){return client['Request'](_0xf10d('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xf10d('0x7')](_0xf10d('0x8'))[_0xf10d('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xf10d('0xa')](_0xf10d('0x8'))['format'](_0xf10d('0xb'))]}},'attributes':['uniqueid',_0xf10d('0xc'),_0xf10d('0xd'),'queuecallerleaveAt',_0xf10d('0xe'),_0xf10d('0xf'),'queuecallerexit',_0xf10d('0x10'),'queuecallerabandon',_0xf10d('0x11')]},'log':_0xf10d('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 745872e..a1ca3a4 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 _0xc4ed=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x4f8886,_0x9be826){var _0x3c49e4=function(_0x3121e1){while(--_0x3121e1){_0x4f8886['push'](_0x4f8886['shift']());}};_0x3c49e4(++_0x9be826);}(_0xc4ed,0x1b1));var _0xdc4e=function(_0x2f1a51,_0x3c1f80){_0x2f1a51=_0x2f1a51-0x0;var _0x581809=_0xc4ed[_0x2f1a51];return _0x581809;};'use strict';var client=require('../client');exports[_0xdc4e('0x0')]=function(_0x404f01){return function(){return client[_0xdc4e('0x1')](_0xdc4e('0x2'),{'options':{'where':{'VoiceQueueId':_0x404f01,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x0963=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x2902b1,_0x3df95d){var _0x4d13de=function(_0x4b3d6b){while(--_0x4b3d6b){_0x2902b1['push'](_0x2902b1['shift']());}};_0x4d13de(++_0x3df95d);}(_0x0963,0x1d5));var _0x3096=function(_0x42e675,_0x4f24ef){_0x42e675=_0x42e675-0x0;var _0x1e18b9=_0x0963[_0x42e675];return _0x1e18b9;};'use strict';var client=require(_0x3096('0x0'));exports[_0x3096('0x1')]=function(_0x84b999){return function(){return client[_0x3096('0x2')](_0x3096('0x3'),{'options':{'where':{'VoiceQueueId':_0x84b999,'paused':!![]},'raw':!![]},'log':_0x3096('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 7f3fa7a..41eeea7 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 _0x0629=['monitorFilename','lodash','../client','create','Request','CreateVoiceRecording','merge'];(function(_0x2d6cfd,_0x4e475d){var _0x2db776=function(_0x304a14){while(--_0x304a14){_0x2d6cfd['push'](_0x2d6cfd['shift']());}};_0x2db776(++_0x4e475d);}(_0x0629,0x8d));var _0x9062=function(_0x216f83,_0x19b8e0){_0x216f83=_0x216f83-0x0;var _0x3d8e55=_0x0629[_0x216f83];return _0x3d8e55;};'use strict';var _=require(_0x9062('0x0'));var client=require(_0x9062('0x1'));exports[_0x9062('0x2')]=function(_0x1bc222){return client[_0x9062('0x3')](_0x9062('0x4'),{'body':_[_0x9062('0x5')](_0x1bc222,{'value':_0x1bc222[_0x9062('0x6')]}),'log':_0x9062('0x4')});}; \ No newline at end of file +var _0x8afd=['monitorFilename','lodash','../client','create','Request','CreateVoiceRecording'];(function(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0x8afd,0x199));var _0xd8af=function(_0x50ec70,_0x58e191){_0x50ec70=_0x50ec70-0x0;var _0x3bf416=_0x8afd[_0x50ec70];return _0x3bf416;};'use strict';var _=require(_0xd8af('0x0'));var client=require(_0xd8af('0x1'));exports[_0xd8af('0x2')]=function(_0x42d7ce){return client[_0xd8af('0x3')](_0xd8af('0x4'),{'body':_['merge'](_0x42d7ce,{'value':_0x42d7ce[_0xd8af('0x5')]}),'log':_0xd8af('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 0e3f73f..30ae86e 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 _0xe819=['transfereeaccountcode','transfereecontext','transfereelinkedid','context','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','isexternal','origtransferercontext','origtransfererexten','attended','../client','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename'];(function(_0x294bd0,_0x32a6a3){var _0x3703aa=function(_0x23e080){while(--_0x23e080){_0x294bd0['push'](_0x294bd0['shift']());}};_0x3703aa(++_0x32a6a3);}(_0xe819,0x76));var _0x9e81=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe819[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x9e81('0x0'));exports['blindTransfer']=function(_0x56ef87){return client[_0x9e81('0x1')](_0x9e81('0x2'),{'body':{'result':_0x56ef87[_0x9e81('0x3')],'transfererchannel':_0x56ef87[_0x9e81('0x4')],'transferercalleridnum':_0x56ef87[_0x9e81('0x5')],'transferercalleridname':_0x56ef87['transferercalleridname'],'transfererconnectedlinenum':_0x56ef87[_0x9e81('0x6')],'transfererconnectedlinename':_0x56ef87[_0x9e81('0x7')],'transfereraccountcode':_0x56ef87['transfereraccountcode'],'transferercontext':_0x56ef87[_0x9e81('0x8')],'transfererexten':_0x56ef87[_0x9e81('0x9')],'transfererlinkedid':_0x56ef87['transfererlinkedid'],'transfereechannel':_0x56ef87[_0x9e81('0xa')],'transfereecalleridnum':_0x56ef87['transfereecalleridnum'],'transfereecalleridname':_0x56ef87[_0x9e81('0xb')],'transfereeconnectedlinenum':_0x56ef87[_0x9e81('0xc')],'transfereeconnectedlinename':_0x56ef87[_0x9e81('0xd')],'transfereeaccountcode':_0x56ef87[_0x9e81('0xe')],'transfereecontext':_0x56ef87[_0x9e81('0xf')],'transfereeexten':_0x56ef87['transfereeexten'],'transfereelinkedid':_0x56ef87[_0x9e81('0x10')],'isexternal':_0x56ef87['isexternal'],'context':_0x56ef87[_0x9e81('0x11')],'extension':_0x56ef87[_0x9e81('0x12')],'type':_0x9e81('0x13')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x4aec4e){return client[_0x9e81('0x1')](_0x9e81('0x2'),{'body':{'result':_0x4aec4e['result'],'transfererchannel':_0x4aec4e[_0x9e81('0x14')],'transferercalleridnum':_0x4aec4e[_0x9e81('0x15')],'transferercalleridname':_0x4aec4e[_0x9e81('0x16')],'transfererconnectedlinenum':_0x4aec4e[_0x9e81('0x17')],'transfererconnectedlinename':_0x4aec4e['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4aec4e['origtransfereraccountcode'],'transferercontext':_0x4aec4e['secondtransferercontext'],'transfererexten':_0x4aec4e['secondtransfererexten'],'transfererlinkedid':_0x4aec4e['origtransfererlinkedid'],'transfereechannel':_0x4aec4e['transfertargetchannel'],'transfereecalleridnum':_0x4aec4e[_0x9e81('0x18')],'transfereecalleridname':_0x4aec4e['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x4aec4e['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4aec4e[_0x9e81('0x19')],'transfereeaccountcode':_0x4aec4e[_0x9e81('0x1a')],'transfereecontext':_0x4aec4e[_0x9e81('0x1b')],'transfereeexten':_0x4aec4e[_0x9e81('0x1c')],'transfereelinkedid':_0x4aec4e['transfertargetlinkedid'],'isexternal':_0x4aec4e[_0x9e81('0x1d')],'context':_0x4aec4e[_0x9e81('0x1e')],'extension':_0x4aec4e[_0x9e81('0x1f')],'type':_0x9e81('0x20')},'log':_0x9e81('0x2')});}; \ No newline at end of file +var _0xf526=['context','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereelinkedid'];(function(_0x5b1f65,_0x1b5cb4){var _0x290cc6=function(_0x168364){while(--_0x168364){_0x5b1f65['push'](_0x5b1f65['shift']());}};_0x290cc6(++_0x1b5cb4);}(_0xf526,0x1e7));var _0x6f52=function(_0x2c998b,_0xc241d3){_0x2c998b=_0x2c998b-0x0;var _0x38414c=_0xf526[_0x2c998b];return _0x38414c;};'use strict';var client=require(_0x6f52('0x0'));exports[_0x6f52('0x1')]=function(_0x49b097){return client[_0x6f52('0x2')](_0x6f52('0x3'),{'body':{'result':_0x49b097[_0x6f52('0x4')],'transfererchannel':_0x49b097[_0x6f52('0x5')],'transferercalleridnum':_0x49b097[_0x6f52('0x6')],'transferercalleridname':_0x49b097[_0x6f52('0x7')],'transfererconnectedlinenum':_0x49b097[_0x6f52('0x8')],'transfererconnectedlinename':_0x49b097[_0x6f52('0x9')],'transfereraccountcode':_0x49b097[_0x6f52('0xa')],'transferercontext':_0x49b097[_0x6f52('0xb')],'transfererexten':_0x49b097[_0x6f52('0xc')],'transfererlinkedid':_0x49b097['transfererlinkedid'],'transfereechannel':_0x49b097[_0x6f52('0xd')],'transfereecalleridnum':_0x49b097[_0x6f52('0xe')],'transfereecalleridname':_0x49b097[_0x6f52('0xf')],'transfereeconnectedlinenum':_0x49b097[_0x6f52('0x10')],'transfereeconnectedlinename':_0x49b097[_0x6f52('0x11')],'transfereeaccountcode':_0x49b097['transfereeaccountcode'],'transfereecontext':_0x49b097[_0x6f52('0x12')],'transfereeexten':_0x49b097['transfereeexten'],'transfereelinkedid':_0x49b097[_0x6f52('0x13')],'isexternal':_0x49b097['isexternal'],'context':_0x49b097[_0x6f52('0x14')],'extension':_0x49b097[_0x6f52('0x15')],'type':_0x6f52('0x16')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x4d1829){return client[_0x6f52('0x2')](_0x6f52('0x3'),{'body':{'result':_0x4d1829[_0x6f52('0x4')],'transfererchannel':_0x4d1829[_0x6f52('0x17')],'transferercalleridnum':_0x4d1829[_0x6f52('0x18')],'transferercalleridname':_0x4d1829[_0x6f52('0x19')],'transfererconnectedlinenum':_0x4d1829['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4d1829[_0x6f52('0x1a')],'transfereraccountcode':_0x4d1829['origtransfereraccountcode'],'transferercontext':_0x4d1829[_0x6f52('0x1b')],'transfererexten':_0x4d1829[_0x6f52('0x1c')],'transfererlinkedid':_0x4d1829[_0x6f52('0x1d')],'transfereechannel':_0x4d1829[_0x6f52('0x1e')],'transfereecalleridnum':_0x4d1829[_0x6f52('0x1f')],'transfereecalleridname':_0x4d1829[_0x6f52('0x20')],'transfereeconnectedlinenum':_0x4d1829['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4d1829[_0x6f52('0x21')],'transfereeaccountcode':_0x4d1829['transfertargetaccountcode'],'transfereecontext':_0x4d1829['transfertargetcontext'],'transfereeexten':_0x4d1829[_0x6f52('0x22')],'transfereelinkedid':_0x4d1829[_0x6f52('0x23')],'isexternal':_0x4d1829['isexternal'],'context':_0x4d1829[_0x6f52('0x24')],'extension':_0x4d1829[_0x6f52('0x25')],'type':_0x6f52('0x26')},'log':_0x6f52('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 1bd5553..82a9340 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 _0xfc00=['filename','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','wav','stop','StopMixMonitor\x20Success','queueChannels','Hangup','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','pick','keys','module','action','Reload','Action','then','message','catch','error','join','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','length','values','channels','voicechannel','map','find','uniqueid','channel','%s.%s'];(function(_0x216a39,_0x38d2d7){var _0x48ff53=function(_0x4f2fa5){while(--_0x4f2fa5){_0x216a39['push'](_0x216a39['shift']());}};_0x48ff53(++_0x38d2d7);}(_0xfc00,0xb1));var _0x0fc0=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0xfc00[_0x2a0183];return _0x158c3a;};'use strict';var _=require(_0x0fc0('0x0'));var util=require(_0x0fc0('0x1'));var jayson=require(_0x0fc0('0x2'));var schema=require(_0x0fc0('0x3'));var BPromise=require(_0x0fc0('0x4'));var moment=require(_0x0fc0('0x5'));var config=require('../../../config/environment');var properties=require(_0x0fc0('0x6'));var ami=require(_0x0fc0('0x7'));exports[_0x0fc0('0x8')]=function(_0x507988,_0x48c912,_0x368d2f){return new BPromise(function(_0x4d9a87,_0x2c483d){var _0x5a37fe={'QueuePause':function(_0x48a7f2){return new Promise(function(_0x1f7ac0,_0x5d8c45){var _0x5a57b3=util[_0x0fc0('0x9')](_0x0fc0('0xa'),_0x0fc0('0xb'),_0x48a7f2[_0x0fc0('0xc')]);if(_0x507988[_0x0fc0('0xd')]&&_0x507988['timers'][_0x5a57b3]&&_0x507988[_0x0fc0('0xd')][_0x5a57b3][_0x0fc0('0xe')]){_0x507988[_0x0fc0('0xd')][_0x5a57b3][_0x0fc0('0xf')]();}if(_0x507988['agents'][_0x5a57b3]){_0x507988[_0x0fc0('0x10')][_0x5a57b3]['updateStatusRealtime']({'statePause':_0x48a7f2[_0x0fc0('0x11')]?!![]:![]});}_0x1f7ac0({'code':0xc8,'message':_0x0fc0('0x12')});});},'Reload':function(_0x2856c1){var _0x522a93=this;return new Promise(function(_0x2e2f29,_0x24e480){if(ami[_0x0fc0('0x13')]()==![]){return _0x24e480(_0x522a93['error'](0x1f4,[config['asterisk']['ip'],config[_0x0fc0('0x14')][_0x0fc0('0x15')],_0x0fc0('0x16')]['join']('\x20')));}_0x2856c1=_[_0x0fc0('0x17')](_0x2856c1,_[_0x0fc0('0x18')](properties[_0x0fc0('0x19')]));_0x2856c1[_0x0fc0('0x1a')]=_0x0fc0('0x1b');return ami[_0x0fc0('0x1c')](_0x2856c1)[_0x0fc0('0x1d')](function(_0x1202d8){_0x2e2f29({'code':0xc8,'message':_0x1202d8[_0x0fc0('0x1e')]});})[_0x0fc0('0x1f')](function(_0x18e0df){_0x24e480(_0x522a93[_0x0fc0('0x20')](0x1f5,_0x18e0df[_0x0fc0('0x1e')]));});});},'Command':function(_0x13d985){var _0x32ef09=this;return new Promise(function(_0x27209d,_0x6a5ad1){if(ami['isConnected']()==![]){return _0x6a5ad1(_0x32ef09['error'](0x1f4,[config[_0x0fc0('0x14')]['ip'],config[_0x0fc0('0x14')][_0x0fc0('0x15')],'ami\x20disconnected'][_0x0fc0('0x21')]('\x20')));}_0x13d985=_['pick'](_0x13d985,_0x0fc0('0x22'));_0x13d985[_0x0fc0('0x1a')]=_0x0fc0('0x23');return ami['Action'](_0x13d985)[_0x0fc0('0x1d')](function(_0x277364){_0x27209d({'code':0xc8,'message':_0x277364[_0x0fc0('0x24')]});})['catch'](function(_0x322053){_0x6a5ad1(_0x32ef09[_0x0fc0('0x20')](0x1f5,_0x322053[_0x0fc0('0x1e')]));});});},'VoiceQueues':function(_0x348c2a){return new Promise(function(_0x54001b,_0x5258fd){var _0x14c80b=[];for(var _0x2f8797 in _0x507988[_0x0fc0('0x25')]){if(_0x507988[_0x0fc0('0x25')][_0x0fc0('0x26')](_0x2f8797)){var _0x553541=_0x507988[_0x0fc0('0x25')][_0x2f8797];var _0x2912fa={'id':_0x553541['id'],'name':_0x553541[_0x0fc0('0xc')],'strategy':_0x553541[_0x0fc0('0x27')],'answered':_0x553541[_0x0fc0('0x28')],'available':_0x553541['available'],'loggedIn':_0x553541[_0x0fc0('0x29')],'pTalking':_0x553541[_0x0fc0('0x2a')],'sumBillable':_0x553541['sumBillable'],'sumDuration':_0x553541['sumDuration'],'sumHoldTime':_0x553541['sumHoldTime']||0x0,'talking':_0x553541[_0x0fc0('0x2b')],'total':_0x553541[_0x0fc0('0x2c')],'type':_0x553541[_0x0fc0('0x2d')],'unmanaged':_0x553541[_0x0fc0('0x2e')],'abandoned':_0x553541[_0x0fc0('0x2f')],'waiting':_0x553541[_0x0fc0('0x30')],'loggedInDb':_0x553541[_0x0fc0('0x31')]};if(_0x553541[_0x0fc0('0x2d')]===_0x0fc0('0x32')){_0x2912fa[_0x0fc0('0x33')]=_0x553541[_0x0fc0('0x33')];_0x2912fa['dialMethod']=_0x553541['dialMethod'];_0x2912fa[_0x0fc0('0x34')]=_0x553541[_0x0fc0('0x34')];_0x2912fa[_0x0fc0('0x35')]=_0x553541[_0x0fc0('0x35')];_0x2912fa['dialOriginateTimeout']=_0x553541['dialOriginateTimeout'];_0x2912fa[_0x0fc0('0x36')]=_0x553541[_0x0fc0('0x36')];_0x2912fa[_0x0fc0('0x37')]=_0x553541[_0x0fc0('0x37')];_0x2912fa[_0x0fc0('0x38')]=_0x553541[_0x0fc0('0x38')];_0x2912fa[_0x0fc0('0x39')]=_0x553541[_0x0fc0('0x39')];_0x2912fa[_0x0fc0('0x3a')]=_0x553541[_0x0fc0('0x3a')];_0x2912fa[_0x0fc0('0x3b')]=_0x553541[_0x0fc0('0x3b')];_0x2912fa[_0x0fc0('0x3c')]=_0x553541[_0x0fc0('0x3c')];_0x2912fa[_0x0fc0('0x3d')]=_0x553541['outboundDropCallsDayCallersExit'];_0x2912fa[_0x0fc0('0x3e')]=_0x553541['outboundDropCallsDayTimeout'];_0x2912fa[_0x0fc0('0x3f')]=_0x553541['outboundNoAnswerCallsDay'];_0x2912fa[_0x0fc0('0x40')]=_0x553541[_0x0fc0('0x40')];_0x2912fa[_0x0fc0('0x41')]=_0x553541[_0x0fc0('0x41')];_0x2912fa[_0x0fc0('0x42')]=_0x553541[_0x0fc0('0x42')];_0x2912fa[_0x0fc0('0x43')]=_0x553541[_0x0fc0('0x43')];_0x2912fa[_0x0fc0('0x44')]=_0x553541[_0x0fc0('0x44')];_0x2912fa[_0x0fc0('0x45')]=_0x553541[_0x0fc0('0x45')];_0x2912fa[_0x0fc0('0x46')]=_0x553541[_0x0fc0('0x46')];_0x2912fa[_0x0fc0('0x47')]=_0x553541[_0x0fc0('0x47')];_0x2912fa['predictiveIntervalDroppedCallsCallersExit']=_0x553541[_0x0fc0('0x48')];_0x2912fa[_0x0fc0('0x49')]=_0x553541[_0x0fc0('0x49')];_0x2912fa['predictiveIntervalErlangCalls']=_0x553541[_0x0fc0('0x4a')];_0x2912fa[_0x0fc0('0x4b')]=_0x553541['predictiveIntervalErlangCallsDroppedCalls'];_0x2912fa['predictiveIntervalHitRate']=_0x553541['predictiveIntervalHitRate'];_0x2912fa[_0x0fc0('0x4c')]=_0x553541[_0x0fc0('0x4c')];_0x2912fa[_0x0fc0('0x4d')]=_0x553541['predictiveIntervalPauses'];_0x2912fa[_0x0fc0('0x4e')]=_0x553541['predictiveIntervalAvailable'];_0x2912fa[_0x0fc0('0x4f')]=_0x553541[_0x0fc0('0x4f')];_0x2912fa['message']=_0x553541[_0x0fc0('0x1e')];_0x2912fa['originated']=_0x553541[_0x0fc0('0x50')];_0x2912fa[_0x0fc0('0x51')]=_0x553541[_0x0fc0('0x51')];_0x2912fa['erlangCallToSecond']=_0x553541[_0x0fc0('0x52')];_0x2912fa['erlangAbandonmentRate']=_0x553541[_0x0fc0('0x53')];_0x2912fa[_0x0fc0('0x54')]=_0x553541[_0x0fc0('0x54')];_0x2912fa[_0x0fc0('0x55')]=_0x553541['startPredictive'];_0x2912fa[_0x0fc0('0x56')]=_0x553541[_0x0fc0('0x56')];}if(_0x553541['Trunk']){_0x2912fa[_0x0fc0('0x57')]={'id':_0x553541['Trunk']['id'],'name':_0x553541[_0x0fc0('0x57')][_0x0fc0('0xc')],'active':_0x553541[_0x0fc0('0x57')]['active'],'callerid':_0x553541['Trunk'][_0x0fc0('0x58')]};}if(_0x553541[_0x0fc0('0x59')]){_0x2912fa[_0x0fc0('0x59')]={'id':_0x553541[_0x0fc0('0x59')]['id'],'name':_0x553541[_0x0fc0('0x59')][_0x0fc0('0xc')]};}_0x14c80b['push'](_0x2912fa);}}_0x54001b({'count':_0x14c80b[_0x0fc0('0x5a')],'rows':_0x14c80b});});},'VoiceChannels':function(_0x3ab688){return new Promise(function(_0x30951f,_0x1655c8){var _0x5e2b20=_[_0x0fc0('0x5b')](_0x507988[_0x0fc0('0x5c')]);_0x30951f({'count':_0x5e2b20[_0x0fc0('0x5a')],'rows':_0x5e2b20});});},'VoiceChannelMixMonitor':function(_0x39fdfd){var _0x45cdcc=this;return new Promise(function(_0x1e7d2b,_0x3d923c){if(ami[_0x0fc0('0x13')]()==![]){return _0x3d923c(_0x45cdcc['error'](0x1f4,[config[_0x0fc0('0x14')]['ip'],config[_0x0fc0('0x14')]['username'],'ami\x20disconnected'][_0x0fc0('0x21')]('\x20')));}var _0x411ebc=schema(properties[_0x0fc0('0x5d')])['validate'](_0x39fdfd);if(_0x411ebc[_0x0fc0('0x5a')]>0x0){return _0x3d923c(_0x45cdcc[_0x0fc0('0x20')](0x1f4,_[_0x0fc0('0x5e')](_0x411ebc,_0x0fc0('0x1e'))['join'](',\x20')));}var _0x3cdab9=_[_0x0fc0('0x5f')](_0x507988[_0x0fc0('0x5c')],{'uniqueid':_0x39fdfd[_0x0fc0('0x60')]});if(_0x3cdab9&&_0x3cdab9[_0x0fc0('0x61')]){var _0x3f236c=util['format'](_0x0fc0('0x62'),_0x39fdfd[_0x0fc0('0x63')]||_0x39fdfd[_0x0fc0('0x60')],_0x39fdfd[_0x0fc0('0x9')]||'wav');return ami[_0x0fc0('0x1c')]({'action':'MixMonitor','channel':_0x3cdab9[_0x0fc0('0x61')],'file':_0x3f236c,'options':_0x0fc0('0x64')})[_0x0fc0('0x1d')](function(_0x26bac6){var _0x29c138=_[_0x0fc0('0x5f')](_0x3cdab9[_0x0fc0('0x65')],{'filename':_0x0fc0('0x66')+_0x3f236c[_0x0fc0('0x67')]()});if(_[_0x0fc0('0x68')](_0x29c138)){_0x3cdab9[_0x0fc0('0x65')][_0x0fc0('0x69')]({'filename':_0x0fc0('0x66')+_0x3f236c['toLowerCase'](),'createdAt':moment()[_0x0fc0('0x9')](_0x0fc0('0x6a')),'mixmonitorid':_0x26bac6[_0x0fc0('0x6b')],'status':_0x0fc0('0x6c')});}else{_0x29c138[_0x0fc0('0x6b')]=_0x26bac6['mixmonitorid'];_0x29c138[_0x0fc0('0x6d')]='rec';}_0x1e7d2b({'code':0xc8,'message':[_0x39fdfd['uniqueid'],'MixMonitor\x20Success',_0x26bac6[_0x0fc0('0x6b')]][_0x0fc0('0x21')]('\x20'),'mixmonitorid':_0x26bac6[_0x0fc0('0x6b')]});})[_0x0fc0('0x1f')](function(_0x4bea42){_0x3d923c(_0x45cdcc[_0x0fc0('0x20')](0x1f5,[_0x39fdfd[_0x0fc0('0x60')],_0x4bea42['message'][_0x0fc0('0x67')]()][_0x0fc0('0x21')]('\x20')));});}else{return _0x3d923c(_0x45cdcc[_0x0fc0('0x20')](0x1f5,_0x0fc0('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x32a58e){var _0x47986a=this;return new Promise(function(_0x115e07,_0x1bd4b1){if(ami['isConnected']()==![]){return _0x1bd4b1(_0x47986a[_0x0fc0('0x20')](0x1f4,[config[_0x0fc0('0x14')]['ip'],config[_0x0fc0('0x14')][_0x0fc0('0x15')],_0x0fc0('0x16')][_0x0fc0('0x21')]('\x20')));}var _0x29076d=schema(properties[_0x0fc0('0x5d')])['validate'](_0x32a58e);if(_0x29076d[_0x0fc0('0x5a')]>0x0){return _0x1bd4b1(_0x47986a[_0x0fc0('0x20')](0x1f4,_[_0x0fc0('0x5e')](_0x29076d,_0x0fc0('0x1e'))['join'](',\x20')));}var _0x21d5da=_[_0x0fc0('0x5f')](_0x507988[_0x0fc0('0x5c')],{'uniqueid':_0x32a58e[_0x0fc0('0x60')]});if(_0x21d5da){return BPromise[_0x0fc0('0x6f')]()['then'](function(){if(_0x21d5da[_0x0fc0('0x61')]){return ami[_0x0fc0('0x1c')]({'action':'StopMixMonitor','channel':_0x21d5da[_0x0fc0('0x61')],'mixmonitorid':_0x32a58e['mixmonitorid']})[_0x0fc0('0x1f')](function(_0x443f5f){});}})['then'](function(){if(_0x21d5da['destinationchannel']){return ami['Action']({'action':_0x0fc0('0x70'),'channel':_0x21d5da[_0x0fc0('0x71')],'mixmonitorid':_0x32a58e[_0x0fc0('0x6b')]})[_0x0fc0('0x1f')](function(_0x4b8f36){});}})[_0x0fc0('0x1d')](function(_0x177430){var _0x30ec6f=_[_0x0fc0('0x5f')](_0x21d5da['monitors'],{'mixmonitorid':_0x32a58e[_0x0fc0('0x6b')]});if(_0x30ec6f){_0x30ec6f[_0x0fc0('0x6d')]='stop';}})[_0x0fc0('0x1d')](function(){var _0x59452b=util[_0x0fc0('0x9')](_0x0fc0('0x62'),_0x32a58e[_0x0fc0('0x63')]||_0x32a58e['uniqueid'],_0x32a58e[_0x0fc0('0x9')]||_0x0fc0('0x72'));var _0xf12f8d=_[_0x0fc0('0x5f')](_0x21d5da['monitors'],{'filename':_0x0fc0('0x66')+_0x59452b['toLowerCase']()});if(_0xf12f8d){_0xf12f8d[_0x0fc0('0x6d')]=_0x0fc0('0x73');}})[_0x0fc0('0x1d')](function(){_0x115e07({'code':0xc8,'message':[_0x32a58e['uniqueid'],_0x0fc0('0x74')][_0x0fc0('0x21')]('\x20')});})['catch'](function(_0x5ae089){_0x1bd4b1(_0x47986a[_0x0fc0('0x20')](0x1f5,[_0x32a58e[_0x0fc0('0x60')],_0x5ae089[_0x0fc0('0x1e')][_0x0fc0('0x67')]()][_0x0fc0('0x21')]('\x20')));});}else{return _0x1bd4b1(_0x47986a[_0x0fc0('0x20')](0x1f5,_0x0fc0('0x6e')));}});},'VoiceQueuesChannels':function(_0x508457){return new Promise(function(_0x11403a,_0xb87434){var _0x1431b0=_[_0x0fc0('0x5b')](_0x507988[_0x0fc0('0x75')]);_0x11403a({'count':_0x1431b0[_0x0fc0('0x5a')],'rows':_0x1431b0});});},'VoiceQueuesChannel':function(_0x3b27cd){var _0x5568cc=this;return new Promise(function(_0x341dc7,_0x3cd0ab){var _0xb00411=schema(properties['voicequeuechannel'])[_0x0fc0('0x3')](_0x3b27cd);if(_0xb00411[_0x0fc0('0x5a')]>0x0){return _0x3cd0ab(_0x5568cc['error'](0x1f4,_[_0x0fc0('0x5e')](_0xb00411,'message')['join'](',\x20')));}var _0x379ae4=_[_0x0fc0('0x5f')](_0x507988['queueChannels'],{'uniqueid':_0x3b27cd[_0x0fc0('0x60')]});if(_0x379ae4){_0x341dc7(_0x379ae4);}else{return _0x3cd0ab(_0x5568cc[_0x0fc0('0x20')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x56fa21){var _0xc10db2=this;return new Promise(function(_0x5a39d4,_0x5cfa15){if(ami[_0x0fc0('0x13')]()==![]){return _0x5cfa15(_0xc10db2[_0x0fc0('0x20')](0x1f4,[config[_0x0fc0('0x14')]['ip'],config[_0x0fc0('0x14')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x3a4e3a=schema(properties['voicequeuechannelhangup'])[_0x0fc0('0x3')](_0x56fa21);if(_0x3a4e3a[_0x0fc0('0x5a')]>0x0){return _0x5cfa15(_0xc10db2[_0x0fc0('0x20')](0x1f4,_[_0x0fc0('0x5e')](_0x3a4e3a,'message')[_0x0fc0('0x21')](',\x20')));}var _0x23de73=_[_0x0fc0('0x5f')](_0x507988[_0x0fc0('0x75')],{'uniqueid':_0x56fa21['uniqueid']});if(_0x23de73&&_0x23de73[_0x0fc0('0x61')]){return ami[_0x0fc0('0x1c')]({'action':_0x0fc0('0x76'),'channel':_0x23de73[_0x0fc0('0x61')]})['then'](function(_0x24d83c){_0x5a39d4({'code':0xc8,'message':[_0x56fa21[_0x0fc0('0x60')],_0x24d83c[_0x0fc0('0x1e')]['toLowerCase']()][_0x0fc0('0x21')]('\x20')});})[_0x0fc0('0x1f')](function(_0x124ed8){_0x5cfa15(_0xc10db2[_0x0fc0('0x20')](0x1f5,[_0x56fa21['uniqueid'],_0x124ed8[_0x0fc0('0x1e')][_0x0fc0('0x67')]()][_0x0fc0('0x21')]('\x20')));});}else{return _0x5cfa15(_0xc10db2['error'](0x1f5,_0x0fc0('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x1e32fb){var _0x263de8=this;return new Promise(function(_0x352630,_0x3dfb97){if(ami[_0x0fc0('0x13')]()==![]){return _0x3dfb97(_0x263de8[_0x0fc0('0x20')](0x1f4,[config[_0x0fc0('0x14')]['ip'],config[_0x0fc0('0x14')][_0x0fc0('0x15')],_0x0fc0('0x16')][_0x0fc0('0x21')]('\x20')));}var _0x1728d5=schema(properties['voicequeuechannelredirect'])[_0x0fc0('0x3')](_0x1e32fb);if(_0x1728d5[_0x0fc0('0x5a')]>0x0){return _0x3dfb97(_0x263de8[_0x0fc0('0x20')](0x1f4,_[_0x0fc0('0x5e')](_0x1728d5,_0x0fc0('0x1e'))['join'](',\x20')));}var _0x593958=_[_0x0fc0('0x5f')](_0x507988[_0x0fc0('0x75')],{'uniqueid':_0x1e32fb[_0x0fc0('0x60')]});if(_0x593958&&_0x593958[_0x0fc0('0x61')]){return ami[_0x0fc0('0x1c')]({'action':'Redirect','channel':_0x593958[_0x0fc0('0x61')],'exten':_0x1e32fb[_0x0fc0('0x77')],'context':_0x1e32fb[_0x0fc0('0x78')]||_0x593958[_0x0fc0('0x78')],'priority':0x1})[_0x0fc0('0x1d')](function(_0x4015e4){_0x352630({'code':0xc8,'message':[_0x1e32fb[_0x0fc0('0x60')],_0x4015e4[_0x0fc0('0x1e')][_0x0fc0('0x67')]()][_0x0fc0('0x21')]('\x20')});})[_0x0fc0('0x1f')](function(_0x359100){_0x3dfb97(_0x263de8[_0x0fc0('0x20')](0x1f5,[_0x1e32fb['uniqueid'],_0x359100['message'][_0x0fc0('0x67')]()][_0x0fc0('0x21')]('\x20')));});}else{return _0x3dfb97(_0x263de8[_0x0fc0('0x20')](0x1f5,_0x0fc0('0x6e')));}});},'Agents':function(_0x35762c){return new Promise(function(_0x65b103,_0x139e10){var _0x351527=_[_0x0fc0('0x5b')](_0x507988[_0x0fc0('0x10')]);_0x65b103({'count':_0x351527[_0x0fc0('0x5a')],'rows':_0x351527});});},'Telephones':function(_0x3913f1){return new Promise(function(_0x2bde5d,_0x4b1ee7){var _0x1fad64=_['values'](_0x507988[_0x0fc0('0x79')]);_0x2bde5d({'count':_0x1fad64['length'],'rows':_0x1fad64});});},'Trunks':function(_0x39c914){return new Promise(function(_0x402778,_0x2fce22){var _0x5cca24=_['values'](_0x507988[_0x0fc0('0x7a')]);_0x402778({'count':_0x5cca24[_0x0fc0('0x5a')],'rows':_0x5cca24});});},'OutboundChannels':function(_0x17d724){return new Promise(function(_0x27c7e9,_0x355c6b){var _0x413471=_[_0x0fc0('0x5b')](_0x507988[_0x0fc0('0x7b')]);_0x27c7e9({'count':_0x413471[_0x0fc0('0x5a')],'rows':_0x413471});});},'Outbound':function(_0x510e80){return new Promise(function(_0x56d0ad,_0x2db6e1){_0x56d0ad(_0x507988[_0x0fc0('0x32')]);});},'Campaigns':function(_0x4a7359){return new Promise(function(_0x4c5883,_0x33351c){var _0x6628e1=_[_0x0fc0('0x5b')](_0x507988[_0x0fc0('0x7c')]);_0x4c5883({'count':_0x6628e1['length'],'rows':_0x6628e1});});},'VoiceQueuesPreview':function(_0xef1e6){var _0x556197=this;return new Promise(function(_0x4e726d,_0x4445c5){_0x48c912[_0x0fc0('0x7d')](_0xef1e6['id'])[_0x0fc0('0x1d')](function(_0x4b1124){_0x4e726d({'code':0xc8,'message':_0x4b1124['message']});})[_0x0fc0('0x1f')](function(_0x4be81c){_0x4445c5(_0x556197[_0x0fc0('0x20')](0x1f4,_0x4be81c[_0x0fc0('0x1e')]));});});},'EventManager':function(_0x1023aa){var _0x12d4f1=this;return new Promise(function(_0xbc7aaf,_0xafd73c){if(!_0x1023aa[_0x0fc0('0x7e')]){return _0xafd73c(_0x12d4f1['error'](0x1f4,_0x0fc0('0x7f')));}ami[_0x0fc0('0x80')]('custom:'+_0x1023aa[_0x0fc0('0x7e')],_0x1023aa[_0x0fc0('0x1e')]);_0xbc7aaf({'code':0xc8,'message':_0x1023aa});});},'FaxAccounts':function(_0x18a08b){return new Promise(function(_0x4a78be,_0x24facc){var _0x47e7ad=_['values'](_0x507988[_0x0fc0('0x81')]);_0x4a78be({'count':_0x47e7ad['length'],'rows':_0x47e7ad});});},'SendFax':function(_0x321c70){var _0x2fe179=this;return new Promise(function(_0x58c394,_0x534b85){_0x368d2f[_0x0fc0('0x82')](_0x321c70)[_0x0fc0('0x1d')](function(_0x4ad13c){_0x58c394({'code':0xc8,'message':_0x4ad13c[_0x0fc0('0x1e')]});})[_0x0fc0('0x1f')](function(_0x41d116){_0x534b85(_0x2fe179[_0x0fc0('0x20')](0x1f4,_0x41d116['message']));});});},'CheckAfterSend':function(_0x1de600){var _0x4457af=this;return new Promise(function(_0x515477,_0x5d3f0f){_0x368d2f[_0x0fc0('0x83')](_0x1de600)[_0x0fc0('0x1d')](function(_0x4f4e0c){_0x515477({'code':0xc8,'message':_0x4f4e0c['message']});})[_0x0fc0('0x1f')](function(_0x4659e1){_0x5d3f0f(_0x4457af['error'](0x1f4,_0x4659e1[_0x0fc0('0x1e')]));});});}};var _0xcad8d8=jayson[_0x0fc0('0x84')](_0x5a37fe)[_0x0fc0('0x85')]();_0xcad8d8['on'](_0x0fc0('0x20'),function(_0x450739){return _0x2c483d(_0x450739);});_0xcad8d8['listen'](0x232a,_0x0fc0('0x86'),function(){console[_0x0fc0('0x87')](_0x0fc0('0x88'),0x232a);return _0x4d9a87(_0x0fc0('0x89')+0x232a);});});}; \ No newline at end of file +var _0x0e05=['event','Event\x20name\x20mandatory','custom:','faxAccounts','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','error','asterisk','ami\x20disconnected','join','pick','action','Reload','message','isConnected','Command','content','catch','voiceQueues','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','channels','length','voicechannel','map','find','uniqueid','channel','%s.%s','filename','wav','Action','MixMonitor','ai(mixmonitorid)','toLowerCase','isNil','monitors','/var/spool/asterisk/monitor/','mixmonitorid','status','MixMonitor\x20Success','username','then','destinationchannel','StopMixMonitor','stop','Channel\x20doesn\x27t\x20exist','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','run'];(function(_0x224a54,_0x3e8341){var _0x35c5ff=function(_0x5a680d){while(--_0x5a680d){_0x224a54['push'](_0x224a54['shift']());}};_0x35c5ff(++_0x3e8341);}(_0x0e05,0x18f));var _0x50e0=function(_0x5cd86e,_0x3db8d1){_0x5cd86e=_0x5cd86e-0x0;var _0x5dbce7=_0x0e05[_0x5cd86e];return _0x5dbce7;};'use strict';var _=require(_0x50e0('0x0'));var util=require(_0x50e0('0x1'));var jayson=require(_0x50e0('0x2'));var schema=require(_0x50e0('0x3'));var BPromise=require('bluebird');var moment=require('moment');var config=require(_0x50e0('0x4'));var properties=require(_0x50e0('0x5'));var ami=require(_0x50e0('0x6'));exports[_0x50e0('0x7')]=function(_0x4ff4ae,_0xaeb5ac,_0x27580c){return new BPromise(function(_0x40dd49,_0x2875a7){var _0x559e96={'QueuePause':function(_0x422626){return new Promise(function(_0x4cbfaf,_0x1a2f8e){var _0x22f8fb=util[_0x50e0('0x8')](_0x50e0('0x9'),_0x50e0('0xa'),_0x422626[_0x50e0('0xb')]);if(_0x4ff4ae['timers']&&_0x4ff4ae[_0x50e0('0xc')][_0x22f8fb]&&_0x4ff4ae[_0x50e0('0xc')][_0x22f8fb][_0x50e0('0xd')]){_0x4ff4ae['timers'][_0x22f8fb][_0x50e0('0xe')]();}if(_0x4ff4ae[_0x50e0('0xf')][_0x22f8fb]){_0x4ff4ae[_0x50e0('0xf')][_0x22f8fb]['updateStatusRealtime']({'statePause':_0x422626[_0x50e0('0x10')]?!![]:![]});}_0x4cbfaf({'code':0xc8,'message':_0x50e0('0x11')});});},'Reload':function(_0x833a39){var _0x26d05b=this;return new Promise(function(_0x12dd82,_0x2ac66b){if(ami['isConnected']()==![]){return _0x2ac66b(_0x26d05b[_0x50e0('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x50e0('0x13')]['username'],_0x50e0('0x14')][_0x50e0('0x15')]('\x20')));}_0x833a39=_[_0x50e0('0x16')](_0x833a39,_['keys'](properties['module']));_0x833a39[_0x50e0('0x17')]=_0x50e0('0x18');return ami['Action'](_0x833a39)['then'](function(_0x3d47f7){_0x12dd82({'code':0xc8,'message':_0x3d47f7[_0x50e0('0x19')]});})['catch'](function(_0x1f7e1d){_0x2ac66b(_0x26d05b[_0x50e0('0x12')](0x1f5,_0x1f7e1d[_0x50e0('0x19')]));});});},'Command':function(_0x47b771){var _0x18deef=this;return new Promise(function(_0x2afa47,_0x23007c){if(ami[_0x50e0('0x1a')]()==![]){return _0x23007c(_0x18deef[_0x50e0('0x12')](0x1f4,[config[_0x50e0('0x13')]['ip'],config[_0x50e0('0x13')]['username'],'ami\x20disconnected']['join']('\x20')));}_0x47b771=_[_0x50e0('0x16')](_0x47b771,'command');_0x47b771[_0x50e0('0x17')]=_0x50e0('0x1b');return ami['Action'](_0x47b771)['then'](function(_0x6b4bae){_0x2afa47({'code':0xc8,'message':_0x6b4bae[_0x50e0('0x1c')]});})[_0x50e0('0x1d')](function(_0x4324c8){_0x23007c(_0x18deef[_0x50e0('0x12')](0x1f5,_0x4324c8[_0x50e0('0x19')]));});});},'VoiceQueues':function(_0x376b79){return new Promise(function(_0xdd0cd5,_0x1575fc){var _0x2e13b3=[];for(var _0x52cb5c in _0x4ff4ae[_0x50e0('0x1e')]){if(_0x4ff4ae[_0x50e0('0x1e')]['hasOwnProperty'](_0x52cb5c)){var _0x164ca9=_0x4ff4ae[_0x50e0('0x1e')][_0x52cb5c];var _0x5541c1={'id':_0x164ca9['id'],'name':_0x164ca9['name'],'strategy':_0x164ca9[_0x50e0('0x1f')],'answered':_0x164ca9[_0x50e0('0x20')],'available':_0x164ca9[_0x50e0('0x21')],'loggedIn':_0x164ca9[_0x50e0('0x22')],'pTalking':_0x164ca9['pTalking'],'sumBillable':_0x164ca9[_0x50e0('0x23')],'sumDuration':_0x164ca9['sumDuration'],'sumHoldTime':_0x164ca9[_0x50e0('0x24')]||0x0,'talking':_0x164ca9['talking'],'total':_0x164ca9[_0x50e0('0x25')],'type':_0x164ca9[_0x50e0('0x26')],'unmanaged':_0x164ca9[_0x50e0('0x27')],'abandoned':_0x164ca9[_0x50e0('0x28')],'waiting':_0x164ca9[_0x50e0('0x29')],'loggedInDb':_0x164ca9[_0x50e0('0x2a')]};if(_0x164ca9[_0x50e0('0x26')]===_0x50e0('0x2b')){_0x5541c1[_0x50e0('0x2c')]=_0x164ca9[_0x50e0('0x2c')];_0x5541c1[_0x50e0('0x2d')]=_0x164ca9['dialMethod'];_0x5541c1[_0x50e0('0x2e')]=_0x164ca9[_0x50e0('0x2e')];_0x5541c1[_0x50e0('0x2f')]=_0x164ca9[_0x50e0('0x2f')];_0x5541c1['dialOriginateTimeout']=_0x164ca9[_0x50e0('0x30')];_0x5541c1['dialPrefix']=_0x164ca9[_0x50e0('0x31')];_0x5541c1[_0x50e0('0x32')]=_0x164ca9[_0x50e0('0x32')];_0x5541c1[_0x50e0('0x33')]=_0x164ca9[_0x50e0('0x33')];_0x5541c1[_0x50e0('0x34')]=_0x164ca9[_0x50e0('0x34')];_0x5541c1[_0x50e0('0x35')]=_0x164ca9[_0x50e0('0x35')];_0x5541c1[_0x50e0('0x36')]=_0x164ca9['outboundCongestionCallsDay'];_0x5541c1[_0x50e0('0x37')]=_0x164ca9[_0x50e0('0x37')];_0x5541c1['outboundDropCallsDayCallersExit']=_0x164ca9[_0x50e0('0x38')];_0x5541c1[_0x50e0('0x39')]=_0x164ca9[_0x50e0('0x39')];_0x5541c1[_0x50e0('0x3a')]=_0x164ca9['outboundNoAnswerCallsDay'];_0x5541c1['outboundNoSuchCallsDay']=_0x164ca9[_0x50e0('0x3b')];_0x5541c1['outboundOriginateFailureCallsDay']=_0x164ca9[_0x50e0('0x3c')];_0x5541c1[_0x50e0('0x3d')]=_0x164ca9[_0x50e0('0x3d')];_0x5541c1[_0x50e0('0x3e')]=_0x164ca9[_0x50e0('0x3e')];_0x5541c1[_0x50e0('0x3f')]=_0x164ca9['outboundUnknownCallsDay'];_0x5541c1['predictiveIntervalAnsweredCalls']=_0x164ca9['predictiveIntervalAnsweredCalls'];_0x5541c1[_0x50e0('0x40')]=_0x164ca9['predictiveIntervalAvgHoldtime'];_0x5541c1[_0x50e0('0x41')]=_0x164ca9[_0x50e0('0x41')];_0x5541c1[_0x50e0('0x42')]=_0x164ca9[_0x50e0('0x42')];_0x5541c1[_0x50e0('0x43')]=_0x164ca9['predictiveIntervalDroppedCallsTimeout'];_0x5541c1[_0x50e0('0x44')]=_0x164ca9[_0x50e0('0x44')];_0x5541c1['predictiveIntervalErlangCallsDroppedCalls']=_0x164ca9[_0x50e0('0x45')];_0x5541c1[_0x50e0('0x46')]=_0x164ca9[_0x50e0('0x46')];_0x5541c1[_0x50e0('0x47')]=_0x164ca9[_0x50e0('0x47')];_0x5541c1['predictiveIntervalPauses']=_0x164ca9[_0x50e0('0x48')];_0x5541c1[_0x50e0('0x49')]=_0x164ca9[_0x50e0('0x49')];_0x5541c1['predictiveIntervalTotalCalls']=_0x164ca9['predictiveIntervalTotalCalls'];_0x5541c1[_0x50e0('0x19')]=_0x164ca9[_0x50e0('0x19')];_0x5541c1['originated']=_0x164ca9[_0x50e0('0x4a')];_0x5541c1[_0x50e0('0x4b')]=_0x164ca9['erlangCalls'];_0x5541c1[_0x50e0('0x4c')]=_0x164ca9[_0x50e0('0x4c')];_0x5541c1[_0x50e0('0x4d')]=_0x164ca9[_0x50e0('0x4d')];_0x5541c1[_0x50e0('0x4e')]=_0x164ca9[_0x50e0('0x4e')];_0x5541c1[_0x50e0('0x4f')]=_0x164ca9[_0x50e0('0x4f')];_0x5541c1[_0x50e0('0x50')]=_0x164ca9[_0x50e0('0x50')];}if(_0x164ca9[_0x50e0('0x51')]){_0x5541c1[_0x50e0('0x51')]={'id':_0x164ca9[_0x50e0('0x51')]['id'],'name':_0x164ca9[_0x50e0('0x51')][_0x50e0('0xb')],'active':_0x164ca9[_0x50e0('0x51')][_0x50e0('0x52')],'callerid':_0x164ca9['Trunk'][_0x50e0('0x53')]};}if(_0x164ca9[_0x50e0('0x54')]){_0x5541c1[_0x50e0('0x54')]={'id':_0x164ca9['Interval']['id'],'name':_0x164ca9['Interval'][_0x50e0('0xb')]};}_0x2e13b3[_0x50e0('0x55')](_0x5541c1);}}_0xdd0cd5({'count':_0x2e13b3['length'],'rows':_0x2e13b3});});},'VoiceChannels':function(_0x1a234d){return new Promise(function(_0x20dd7d,_0x12ff31){var _0x4e727c=_['values'](_0x4ff4ae[_0x50e0('0x56')]);_0x20dd7d({'count':_0x4e727c[_0x50e0('0x57')],'rows':_0x4e727c});});},'VoiceChannelMixMonitor':function(_0x1c790e){var _0x33ad39=this;return new Promise(function(_0x2f4e5a,_0x2d4b98){if(ami['isConnected']()==![]){return _0x2d4b98(_0x33ad39[_0x50e0('0x12')](0x1f4,[config[_0x50e0('0x13')]['ip'],config[_0x50e0('0x13')]['username'],'ami\x20disconnected'][_0x50e0('0x15')]('\x20')));}var _0x59a918=schema(properties[_0x50e0('0x58')])['validate'](_0x1c790e);if(_0x59a918['length']>0x0){return _0x2d4b98(_0x33ad39['error'](0x1f4,_[_0x50e0('0x59')](_0x59a918,_0x50e0('0x19'))['join'](',\x20')));}var _0x447e4b=_[_0x50e0('0x5a')](_0x4ff4ae[_0x50e0('0x56')],{'uniqueid':_0x1c790e[_0x50e0('0x5b')]});if(_0x447e4b&&_0x447e4b[_0x50e0('0x5c')]){var _0x33c0e8=util[_0x50e0('0x8')](_0x50e0('0x5d'),_0x1c790e[_0x50e0('0x5e')]||_0x1c790e[_0x50e0('0x5b')],_0x1c790e[_0x50e0('0x8')]||_0x50e0('0x5f'));return ami[_0x50e0('0x60')]({'action':_0x50e0('0x61'),'channel':_0x447e4b['channel'],'file':_0x33c0e8,'options':_0x50e0('0x62')})['then'](function(_0x28ecb1){var _0x1ab984=_['find'](_0x447e4b['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x33c0e8[_0x50e0('0x63')]()});if(_[_0x50e0('0x64')](_0x1ab984)){_0x447e4b[_0x50e0('0x65')][_0x50e0('0x55')]({'filename':_0x50e0('0x66')+_0x33c0e8['toLowerCase'](),'createdAt':moment()[_0x50e0('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x28ecb1[_0x50e0('0x67')],'status':'rec'});}else{_0x1ab984[_0x50e0('0x67')]=_0x28ecb1['mixmonitorid'];_0x1ab984[_0x50e0('0x68')]='rec';}_0x2f4e5a({'code':0xc8,'message':[_0x1c790e[_0x50e0('0x5b')],_0x50e0('0x69'),_0x28ecb1[_0x50e0('0x67')]]['join']('\x20'),'mixmonitorid':_0x28ecb1[_0x50e0('0x67')]});})['catch'](function(_0x32b136){_0x2d4b98(_0x33ad39[_0x50e0('0x12')](0x1f5,[_0x1c790e[_0x50e0('0x5b')],_0x32b136[_0x50e0('0x19')][_0x50e0('0x63')]()][_0x50e0('0x15')]('\x20')));});}else{return _0x2d4b98(_0x33ad39['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x33df95){var _0x14fdf8=this;return new Promise(function(_0x581a1b,_0xd890e6){if(ami[_0x50e0('0x1a')]()==![]){return _0xd890e6(_0x14fdf8[_0x50e0('0x12')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x50e0('0x6a')],_0x50e0('0x14')][_0x50e0('0x15')]('\x20')));}var _0x14ea9f=schema(properties[_0x50e0('0x58')])[_0x50e0('0x3')](_0x33df95);if(_0x14ea9f[_0x50e0('0x57')]>0x0){return _0xd890e6(_0x14fdf8['error'](0x1f4,_[_0x50e0('0x59')](_0x14ea9f,_0x50e0('0x19'))[_0x50e0('0x15')](',\x20')));}var _0x59fe32=_[_0x50e0('0x5a')](_0x4ff4ae[_0x50e0('0x56')],{'uniqueid':_0x33df95[_0x50e0('0x5b')]});if(_0x59fe32){return BPromise['resolve']()[_0x50e0('0x6b')](function(){if(_0x59fe32[_0x50e0('0x5c')]){return ami[_0x50e0('0x60')]({'action':'StopMixMonitor','channel':_0x59fe32[_0x50e0('0x5c')],'mixmonitorid':_0x33df95[_0x50e0('0x67')]})[_0x50e0('0x1d')](function(_0x130ef6){});}})['then'](function(){if(_0x59fe32[_0x50e0('0x6c')]){return ami[_0x50e0('0x60')]({'action':_0x50e0('0x6d'),'channel':_0x59fe32[_0x50e0('0x6c')],'mixmonitorid':_0x33df95[_0x50e0('0x67')]})[_0x50e0('0x1d')](function(_0x42f00d){});}})['then'](function(_0x49a7b4){var _0x3bf6d9=_[_0x50e0('0x5a')](_0x59fe32[_0x50e0('0x65')],{'mixmonitorid':_0x33df95[_0x50e0('0x67')]});if(_0x3bf6d9){_0x3bf6d9[_0x50e0('0x68')]=_0x50e0('0x6e');}})[_0x50e0('0x6b')](function(){var _0x38b277=util[_0x50e0('0x8')]('%s.%s',_0x33df95[_0x50e0('0x5e')]||_0x33df95[_0x50e0('0x5b')],_0x33df95[_0x50e0('0x8')]||'wav');var _0x1bd457=_['find'](_0x59fe32[_0x50e0('0x65')],{'filename':_0x50e0('0x66')+_0x38b277[_0x50e0('0x63')]()});if(_0x1bd457){_0x1bd457[_0x50e0('0x68')]=_0x50e0('0x6e');}})[_0x50e0('0x6b')](function(){_0x581a1b({'code':0xc8,'message':[_0x33df95[_0x50e0('0x5b')],'StopMixMonitor\x20Success'][_0x50e0('0x15')]('\x20')});})['catch'](function(_0x320c6b){_0xd890e6(_0x14fdf8[_0x50e0('0x12')](0x1f5,[_0x33df95['uniqueid'],_0x320c6b['message'][_0x50e0('0x63')]()][_0x50e0('0x15')]('\x20')));});}else{return _0xd890e6(_0x14fdf8[_0x50e0('0x12')](0x1f5,_0x50e0('0x6f')));}});},'VoiceQueuesChannels':function(_0x583102){return new Promise(function(_0x658d55,_0x4fc0f5){var _0x1ba0a9=_[_0x50e0('0x70')](_0x4ff4ae[_0x50e0('0x71')]);_0x658d55({'count':_0x1ba0a9['length'],'rows':_0x1ba0a9});});},'VoiceQueuesChannel':function(_0x15e394){var _0x540b3d=this;return new Promise(function(_0x4c5a95,_0x1335fa){var _0x41a23f=schema(properties[_0x50e0('0x72')])[_0x50e0('0x3')](_0x15e394);if(_0x41a23f[_0x50e0('0x57')]>0x0){return _0x1335fa(_0x540b3d['error'](0x1f4,_[_0x50e0('0x59')](_0x41a23f,_0x50e0('0x19'))[_0x50e0('0x15')](',\x20')));}var _0x547a18=_['find'](_0x4ff4ae[_0x50e0('0x71')],{'uniqueid':_0x15e394[_0x50e0('0x5b')]});if(_0x547a18){_0x4c5a95(_0x547a18);}else{return _0x1335fa(_0x540b3d[_0x50e0('0x12')](0x1f5,_0x50e0('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0xb9eb1a){var _0x4736b4=this;return new Promise(function(_0x4c99a2,_0x4bb452){if(ami[_0x50e0('0x1a')]()==![]){return _0x4bb452(_0x4736b4[_0x50e0('0x12')](0x1f4,[config[_0x50e0('0x13')]['ip'],config[_0x50e0('0x13')][_0x50e0('0x6a')],_0x50e0('0x14')]['join']('\x20')));}var _0x513e3f=schema(properties[_0x50e0('0x73')])['validate'](_0xb9eb1a);if(_0x513e3f[_0x50e0('0x57')]>0x0){return _0x4bb452(_0x4736b4[_0x50e0('0x12')](0x1f4,_['map'](_0x513e3f,_0x50e0('0x19'))[_0x50e0('0x15')](',\x20')));}var _0x552c61=_['find'](_0x4ff4ae[_0x50e0('0x71')],{'uniqueid':_0xb9eb1a[_0x50e0('0x5b')]});if(_0x552c61&&_0x552c61['channel']){return ami[_0x50e0('0x60')]({'action':_0x50e0('0x74'),'channel':_0x552c61[_0x50e0('0x5c')]})[_0x50e0('0x6b')](function(_0x5d8dea){_0x4c99a2({'code':0xc8,'message':[_0xb9eb1a['uniqueid'],_0x5d8dea[_0x50e0('0x19')]['toLowerCase']()][_0x50e0('0x15')]('\x20')});})[_0x50e0('0x1d')](function(_0xbbde3b){_0x4bb452(_0x4736b4[_0x50e0('0x12')](0x1f5,[_0xb9eb1a[_0x50e0('0x5b')],_0xbbde3b[_0x50e0('0x19')][_0x50e0('0x63')]()][_0x50e0('0x15')]('\x20')));});}else{return _0x4bb452(_0x4736b4['error'](0x1f5,_0x50e0('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x3064b2){var _0x3cd208=this;return new Promise(function(_0x622f1,_0xaa10d3){if(ami['isConnected']()==![]){return _0xaa10d3(_0x3cd208[_0x50e0('0x12')](0x1f4,[config[_0x50e0('0x13')]['ip'],config[_0x50e0('0x13')]['username'],_0x50e0('0x14')][_0x50e0('0x15')]('\x20')));}var _0xb4f084=schema(properties[_0x50e0('0x75')])[_0x50e0('0x3')](_0x3064b2);if(_0xb4f084[_0x50e0('0x57')]>0x0){return _0xaa10d3(_0x3cd208[_0x50e0('0x12')](0x1f4,_[_0x50e0('0x59')](_0xb4f084,_0x50e0('0x19'))[_0x50e0('0x15')](',\x20')));}var _0x1d437e=_[_0x50e0('0x5a')](_0x4ff4ae[_0x50e0('0x71')],{'uniqueid':_0x3064b2[_0x50e0('0x5b')]});if(_0x1d437e&&_0x1d437e[_0x50e0('0x5c')]){return ami[_0x50e0('0x60')]({'action':_0x50e0('0x76'),'channel':_0x1d437e[_0x50e0('0x5c')],'exten':_0x3064b2[_0x50e0('0x77')],'context':_0x3064b2[_0x50e0('0x78')]||_0x1d437e[_0x50e0('0x78')],'priority':0x1})[_0x50e0('0x6b')](function(_0x10fbb0){_0x622f1({'code':0xc8,'message':[_0x3064b2[_0x50e0('0x5b')],_0x10fbb0[_0x50e0('0x19')][_0x50e0('0x63')]()][_0x50e0('0x15')]('\x20')});})[_0x50e0('0x1d')](function(_0x425e3c){_0xaa10d3(_0x3cd208[_0x50e0('0x12')](0x1f5,[_0x3064b2['uniqueid'],_0x425e3c[_0x50e0('0x19')][_0x50e0('0x63')]()][_0x50e0('0x15')]('\x20')));});}else{return _0xaa10d3(_0x3cd208['error'](0x1f5,_0x50e0('0x6f')));}});},'Agents':function(_0x4c6f48){return new Promise(function(_0x3c96ef,_0x4b4b2c){var _0x3b5d28=_[_0x50e0('0x70')](_0x4ff4ae[_0x50e0('0xf')]);_0x3c96ef({'count':_0x3b5d28['length'],'rows':_0x3b5d28});});},'Telephones':function(_0x54c48e){return new Promise(function(_0x176b69,_0x50a86b){var _0x4d7b41=_[_0x50e0('0x70')](_0x4ff4ae[_0x50e0('0x79')]);_0x176b69({'count':_0x4d7b41[_0x50e0('0x57')],'rows':_0x4d7b41});});},'Trunks':function(_0x802e60){return new Promise(function(_0x1bf0a3,_0x41dec9){var _0x41b50b=_[_0x50e0('0x70')](_0x4ff4ae['trunks']);_0x1bf0a3({'count':_0x41b50b[_0x50e0('0x57')],'rows':_0x41b50b});});},'OutboundChannels':function(_0x444311){return new Promise(function(_0x14a243,_0x3fdd9b){var _0x42325d=_[_0x50e0('0x70')](_0x4ff4ae[_0x50e0('0x7a')]);_0x14a243({'count':_0x42325d['length'],'rows':_0x42325d});});},'Outbound':function(_0x5eeee0){return new Promise(function(_0x57e09a,_0xa243de){_0x57e09a(_0x4ff4ae['outbound']);});},'Campaigns':function(_0x2ff678){return new Promise(function(_0x371e33,_0x61aa79){var _0x5cbe4f=_[_0x50e0('0x70')](_0x4ff4ae[_0x50e0('0x7b')]);_0x371e33({'count':_0x5cbe4f['length'],'rows':_0x5cbe4f});});},'VoiceQueuesPreview':function(_0x567881){var _0x352da5=this;return new Promise(function(_0x3f7a4d,_0x4364fa){_0xaeb5ac[_0x50e0('0x7c')](_0x567881['id'])[_0x50e0('0x6b')](function(_0x42d5fc){_0x3f7a4d({'code':0xc8,'message':_0x42d5fc[_0x50e0('0x19')]});})[_0x50e0('0x1d')](function(_0x4574a6){_0x4364fa(_0x352da5[_0x50e0('0x12')](0x1f4,_0x4574a6[_0x50e0('0x19')]));});});},'EventManager':function(_0x2766f9){var _0x3d577f=this;return new Promise(function(_0x159e9a,_0x174286){if(!_0x2766f9[_0x50e0('0x7d')]){return _0x174286(_0x3d577f[_0x50e0('0x12')](0x1f4,_0x50e0('0x7e')));}ami['emit'](_0x50e0('0x7f')+_0x2766f9[_0x50e0('0x7d')],_0x2766f9[_0x50e0('0x19')]);_0x159e9a({'code':0xc8,'message':_0x2766f9});});},'FaxAccounts':function(_0x4fe478){return new Promise(function(_0x407dde,_0xc79bf4){var _0x2fbb68=_['values'](_0x4ff4ae[_0x50e0('0x80')]);_0x407dde({'count':_0x2fbb68[_0x50e0('0x57')],'rows':_0x2fbb68});});},'SendFax':function(_0x398288){var _0x5920db=this;return new Promise(function(_0x4421f5,_0x2e9e58){_0x27580c['send'](_0x398288)[_0x50e0('0x6b')](function(_0x11aa2e){_0x4421f5({'code':0xc8,'message':_0x11aa2e[_0x50e0('0x19')]});})[_0x50e0('0x1d')](function(_0x5e9866){_0x2e9e58(_0x5920db[_0x50e0('0x12')](0x1f4,_0x5e9866[_0x50e0('0x19')]));});});},'CheckAfterSend':function(_0x2b83a6){var _0x3fcc09=this;return new Promise(function(_0x3e4a67,_0x68e6cb){_0x27580c['checkAfterSend'](_0x2b83a6)[_0x50e0('0x6b')](function(_0x38612d){_0x3e4a67({'code':0xc8,'message':_0x38612d['message']});})[_0x50e0('0x1d')](function(_0x2be572){_0x68e6cb(_0x3fcc09['error'](0x1f4,_0x2be572[_0x50e0('0x19')]));});});}};var _0x474f73=jayson['server'](_0x559e96)['http']();_0x474f73['on'](_0x50e0('0x12'),function(_0x5bcb64){return _0x2875a7(_0x5bcb64);});_0x474f73['listen'](0x232a,_0x50e0('0x81'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x40dd49(_0x50e0('0x82')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 81ddd92..88353db 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 _0x639a=['uniqueid','firstName','destcalleridname','destcalleridnum','phone','then','showContact','omit','xmd-contactid2','format','user:%s','trigger:%s','action','toLowerCase','merge','resolve','createContact','name','catch','Error\x20creating\x20contact','bluebird','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','stringify','exec','autoCreate','data2','data1','isNil','routeId','calleridname','','calleridnum'];(function(_0x58d7dc,_0x1dafa2){var _0x4e643d=function(_0x5e322a){while(--_0x5e322a){_0x58d7dc['push'](_0x58d7dc['shift']());}};_0x4e643d(++_0x1dafa2);}(_0x639a,0x1e8));var _0xa639=function(_0x17a705,_0x16db40){_0x17a705=_0x17a705-0x0;var _0x23f020=_0x639a[_0x17a705];return _0x23f020;};'use strict';var BPromise=require(_0xa639('0x0'));var util=require(_0xa639('0x1'));var _=require('lodash');var Redis=require('ioredis');var config=require(_0xa639('0x2'));var logger=require(_0xa639('0x3'))('trigger');var cmContactRpc=require(_0xa639('0x4'));config[_0xa639('0x5')]=_[_0xa639('0x6')](config[_0xa639('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xa639('0x7'))(new Redis(config['redis']));function emit(_0x276815,_0x38b779,_0x277b76){logger[_0xa639('0x8')](_0x276815,_0x38b779,JSON[_0xa639('0x9')](_0x277b76));io['to'](_0x276815)['emit'](_0x38b779,_0x277b76);}exports[_0xa639('0xa')]=function(_0x16d090,_0x11aea9,_0x5c03b5){_0x5c03b5[_0xa639('0xb')]=0x0;if(_0x11aea9[_0xa639('0xc')]&&parseInt(_0x11aea9['data2'],0xa)){var _0x34a5b1={'ListId':parseInt(_0x11aea9[_0xa639('0xd')],0xa),'phone':_0x5c03b5['calleridnum']};if(_[_0xa639('0xe')](_0x5c03b5[_0xa639('0xf')])){_0x34a5b1['firstName']=_0x5c03b5[_0xa639('0x10')]&&_0x5c03b5[_0xa639('0x10')]!==_0xa639('0x11')?_0x5c03b5[_0xa639('0x10')]:_0x5c03b5[_0xa639('0x12')]||_0x5c03b5[_0xa639('0x13')];}else{_0x34a5b1[_0xa639('0x14')]=_0x5c03b5['destcalleridname']&&_0x5c03b5[_0xa639('0x15')]!==_0xa639('0x11')?_0x5c03b5[_0xa639('0x15')]:_0x5c03b5[_0xa639('0x16')]||_0x5c03b5[_0xa639('0x13')];_0x34a5b1[_0xa639('0x17')]=_0x5c03b5[_0xa639('0x15')]&&_0x5c03b5[_0xa639('0x15')]!==_0xa639('0x11')?_0x5c03b5['destcalleridname']:_0x5c03b5[_0xa639('0x16')]||_0x5c03b5[_0xa639('0x13')];}BPromise['resolve']()[_0xa639('0x18')](cmContactRpc[_0xa639('0x19')]({'where':_[_0xa639('0x1a')](_0x34a5b1,[_0xa639('0x14')])}))['then'](function(_0x31c868){if(_0x31c868){_0x5c03b5[_0xa639('0x1b')]=_0x31c868['id'];emit(util[_0xa639('0x1c')](_0xa639('0x1d'),_0x16d090['name']),util[_0xa639('0x1c')](_0xa639('0x1e'),_0x11aea9[_0xa639('0x1f')][_0xa639('0x20')]()),_[_0xa639('0x21')](_0x5c03b5,{'ListId':parseInt(_0x11aea9['data1'],0xa)}));return;}else{return BPromise[_0xa639('0x22')]()[_0xa639('0x18')](cmContactRpc[_0xa639('0x23')](_0x34a5b1));}})[_0xa639('0x18')](function(_0x51eaf0){if(_0x51eaf0){_0x5c03b5[_0xa639('0x1b')]=_0x51eaf0['id'];emit(util['format'](_0xa639('0x1d'),_0x16d090[_0xa639('0x24')]),util[_0xa639('0x1c')]('trigger:%s',_0x11aea9[_0xa639('0x1f')]['toLowerCase']()),_[_0xa639('0x21')](_0x5c03b5,{'ListId':parseInt(_0x11aea9[_0xa639('0xd')],0xa)}));}})[_0xa639('0x25')](function(_0x14a86d){logger['error'](_0xa639('0x26'),JSON[_0xa639('0x9')](_0x14a86d));});}else{if(_0x16d090){emit(util[_0xa639('0x1c')](_0xa639('0x1d'),_0x16d090['name']),util[_0xa639('0x1c')](_0xa639('0x1e'),_0x11aea9[_0xa639('0x1f')][_0xa639('0x20')]()),_[_0xa639('0x21')]({'ListId':parseInt(_0x11aea9[_0xa639('0xd')],0xa)},_0x5c03b5));}}}; \ No newline at end of file +var _0xb982=['stringify','exec','data2','data1','calleridnum','routeId','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve','then','showContact','xmd-contactid2','name','format','trigger:%s','toLowerCase','merge','createContact','user:%s','action','catch','error','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info'];(function(_0x42bafd,_0x3f0fe3){var _0x2ed705=function(_0x4311ea){while(--_0x4311ea){_0x42bafd['push'](_0x42bafd['shift']());}};_0x2ed705(++_0x3f0fe3);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x2b98('0x0'));var Redis=require(_0x2b98('0x1'));var config=require(_0x2b98('0x2'));var logger=require(_0x2b98('0x3'))(_0x2b98('0x4'));var cmContactRpc=require(_0x2b98('0x5'));config[_0x2b98('0x6')]=_[_0x2b98('0x7')](config[_0x2b98('0x6')],{'host':_0x2b98('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2b98('0x6')]));function emit(_0x1166cb,_0x15ee91,_0x4626ad){logger[_0x2b98('0x9')](_0x1166cb,_0x15ee91,JSON[_0x2b98('0xa')](_0x4626ad));io['to'](_0x1166cb)['emit'](_0x15ee91,_0x4626ad);}exports[_0x2b98('0xb')]=function(_0x4c64b5,_0x4c5377,_0x8e30c5){_0x8e30c5['autoCreate']=0x0;if(_0x4c5377[_0x2b98('0xc')]&&parseInt(_0x4c5377[_0x2b98('0xc')],0xa)){var _0x457b35={'ListId':parseInt(_0x4c5377[_0x2b98('0xd')],0xa),'phone':_0x8e30c5[_0x2b98('0xe')]};if(_['isNil'](_0x8e30c5[_0x2b98('0xf')])){_0x457b35['firstName']=_0x8e30c5[_0x2b98('0x10')]&&_0x8e30c5[_0x2b98('0x10')]!==_0x2b98('0x11')?_0x8e30c5[_0x2b98('0x10')]:_0x8e30c5[_0x2b98('0xe')]||_0x8e30c5[_0x2b98('0x12')];}else{_0x457b35['firstName']=_0x8e30c5[_0x2b98('0x13')]&&_0x8e30c5[_0x2b98('0x13')]!==_0x2b98('0x11')?_0x8e30c5[_0x2b98('0x13')]:_0x8e30c5[_0x2b98('0x14')]||_0x8e30c5[_0x2b98('0x12')];_0x457b35[_0x2b98('0x15')]=_0x8e30c5['destcalleridname']&&_0x8e30c5[_0x2b98('0x13')]!==_0x2b98('0x11')?_0x8e30c5['destcalleridname']:_0x8e30c5[_0x2b98('0x14')]||_0x8e30c5['uniqueid'];}BPromise[_0x2b98('0x16')]()[_0x2b98('0x17')](cmContactRpc[_0x2b98('0x18')]({'where':_['omit'](_0x457b35,['firstName'])}))['then'](function(_0x4751d3){if(_0x4751d3){_0x8e30c5[_0x2b98('0x19')]=_0x4751d3['id'];emit(util['format']('user:%s',_0x4c64b5[_0x2b98('0x1a')]),util[_0x2b98('0x1b')](_0x2b98('0x1c'),_0x4c5377['action'][_0x2b98('0x1d')]()),_[_0x2b98('0x1e')](_0x8e30c5,{'ListId':parseInt(_0x4c5377[_0x2b98('0xd')],0xa)}));return;}else{return BPromise[_0x2b98('0x16')]()[_0x2b98('0x17')](cmContactRpc[_0x2b98('0x1f')](_0x457b35));}})['then'](function(_0x543a20){if(_0x543a20){_0x8e30c5[_0x2b98('0x19')]=_0x543a20['id'];emit(util[_0x2b98('0x1b')](_0x2b98('0x20'),_0x4c64b5[_0x2b98('0x1a')]),util[_0x2b98('0x1b')](_0x2b98('0x1c'),_0x4c5377[_0x2b98('0x21')][_0x2b98('0x1d')]()),_[_0x2b98('0x1e')](_0x8e30c5,{'ListId':parseInt(_0x4c5377[_0x2b98('0xd')],0xa)}));}})[_0x2b98('0x22')](function(_0x112d71){logger[_0x2b98('0x23')]('Error\x20creating\x20contact',JSON[_0x2b98('0xa')](_0x112d71));});}else{if(_0x4c64b5){emit(util['format']('user:%s',_0x4c64b5[_0x2b98('0x1a')]),util['format'](_0x2b98('0x1c'),_0x4c5377[_0x2b98('0x21')][_0x2b98('0x1d')]()),_['merge']({'ListId':parseInt(_0x4c5377['data1'],0xa)},_0x8e30c5));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 1c3c924..f156b89 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 _0xff9a=['TemplateId','html','templates','data2','render','template\x20not\x20found','buildUri','isNil','data3','data4','location','data5','800','windowHeight','data6','600','winApplication','format','name','trigger:%s:%s','jscripty','user:%s','trigger:%s','exec','integration','urlforward','script','parse','search','replace','AllConditions','length','every','channel','AnyConditions','some','checkConditions','field','account','chat','ChatWebsiteId','operator','value','AccountId','upperFirst','interaction','message','event','queue','agent','membername','lastevent','routeId','util','url','mustache','ioredis','./urlforward','./integration','./cmContact','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','../ami','defaults','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','freshsalesAccounts','accounts','dynamics365Accounts','servicenowAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1'];(function(_0x17606a,_0x5c1616){var _0x222ebb=function(_0x4867ac){while(--_0x4867ac){_0x17606a['push'](_0x17606a['shift']());}};_0x222ebb(++_0x5c1616);}(_0xff9a,0x121));var _0xaff9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff9a[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xaff9('0x0'));var _=require('lodash');var url=require(_0xaff9('0x1'));var Mustache=require(_0xaff9('0x2'));var Redis=require(_0xaff9('0x3'));var urlforward=require(_0xaff9('0x4'));var integration=require(_0xaff9('0x5'));var cmContact=require(_0xaff9('0x6'));var script=require('./script');var cmContactRpc=require(_0xaff9('0x7'));var config=require(_0xaff9('0x8'));var logger=require(_0xaff9('0x9'))(_0xaff9('0xa'));var ami=require(_0xaff9('0xb'));config['redis']=_[_0xaff9('0xc')](config[_0xaff9('0xd')],{'host':_0xaff9('0xe'),'port':0x18eb});var io=require(_0xaff9('0xf'))(new Redis(config[_0xaff9('0xd')]));var operators={'equals':function(_0x23d758,_0x3c3a8c){return _0x23d758==_0x3c3a8c;},'not_equals':function(_0x34a40a,_0x5bdc86){return _0x34a40a!=_0x5bdc86;}};var barAndWebActions=[_0xaff9('0x10'),_0xaff9('0x1'),_0xaff9('0x11')];function Trigger(_0x4f8532){this[_0xaff9('0x12')]=_0x4f8532[_0xaff9('0x12')];this[_0xaff9('0x13')]=_0x4f8532[_0xaff9('0x13')];this['voiceQueues']=_0x4f8532[_0xaff9('0x14')];this['templates']=_0x4f8532['templates'];this[_0xaff9('0x15')]=_0x4f8532['voiceExtensions'];this[_0xaff9('0x16')]=_0x4f8532['zendeskAccounts'];this[_0xaff9('0x17')]=_0x4f8532['freshdeskAccounts'];this['salesforceAccounts']=_0x4f8532[_0xaff9('0x18')];this[_0xaff9('0x19')]=_0x4f8532[_0xaff9('0x19')];this[_0xaff9('0x1a')]=_0x4f8532[_0xaff9('0x1a')];this[_0xaff9('0x1b')]=_0x4f8532[_0xaff9('0x1b')];this['vtigerAccounts']=_0x4f8532[_0xaff9('0x1c')];this['servicenowAccounts']=_0x4f8532['servicenowAccounts'];this['dynamics365Accounts']=_0x4f8532['dynamics365Accounts'];this[_0xaff9('0x1d')]=_0x4f8532[_0xaff9('0x1d')];this[_0xaff9('0x1e')]={'zendesk':this[_0xaff9('0x16')],'salesforce':this[_0xaff9('0x18')],'freshdesk':this[_0xaff9('0x17')],'sugarcrm':this[_0xaff9('0x19')],'zoho':this['zohoAccounts'],'desk':this[_0xaff9('0x1b')],'vtiger':this[_0xaff9('0x1c')],'dynamics365':this[_0xaff9('0x1f')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xaff9('0x20')]};ami['on'](_0xaff9('0x21'),this[_0xaff9('0x22')][_0xaff9('0x23')](this));ami['on'](_0xaff9('0x24'),this[_0xaff9('0x22')][_0xaff9('0x23')](this));ami['on'](_0xaff9('0x25'),this[_0xaff9('0x22')]['bind'](this));ami['on'](_0xaff9('0x26'),this[_0xaff9('0x22')][_0xaff9('0x23')](this));ami['on']('custom:queuecallerabandon',this[_0xaff9('0x22')]['bind'](this));ami['on']('custom:dialbegin',this[_0xaff9('0x27')][_0xaff9('0x23')](this));ami['on'](_0xaff9('0x28'),this[_0xaff9('0x27')][_0xaff9('0x23')](this));ami['on'](_0xaff9('0x29'),this['syncAgentDial']['bind'](this));ami['on'](_0xaff9('0x2a'),this[_0xaff9('0x22')][_0xaff9('0x23')](this));ami['on'](_0xaff9('0x2b'),this[_0xaff9('0x22')][_0xaff9('0x23')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xaff9('0x23')](this));ami['on'](_0xaff9('0x2c'),this[_0xaff9('0x22')][_0xaff9('0x23')](this));ami['on']('custom:acceptmessage',this[_0xaff9('0x22')]['bind'](this));ami['on'](_0xaff9('0x2d'),this[_0xaff9('0x22')][_0xaff9('0x23')](this));}Trigger[_0xaff9('0x2e')][_0xaff9('0x2f')]=function(_0xe129e3,_0xd25486,_0x38c5fa){logger[_0xaff9('0x30')](_0xe129e3,_0xd25486,JSON[_0xaff9('0x31')](_0x38c5fa));io['to'](_0xe129e3)[_0xaff9('0x2f')](_0xd25486,_0x38c5fa);};Trigger[_0xaff9('0x2e')][_0xaff9('0x22')]=function(_0x522e22){var _0x506493=_[_0xaff9('0x32')](_0x522e22);this['checkTriggers'](_0x506493);};Trigger[_0xaff9('0x2e')][_0xaff9('0x27')]=function(_0x241141){if(this[_0xaff9('0x13')][_0x241141[_0xaff9('0x33')]]){this['syncCustomEvent'](_0x241141);}};Trigger[_0xaff9('0x2e')][_0xaff9('0x34')]=function(_0xa64e39){var _0x44db6b;for(var _0x5d66a0 in this['triggers']){if(this[_0xaff9('0x12')][_0xaff9('0x35')](_0x5d66a0)){if(this['triggers'][_0x5d66a0][_0xaff9('0x36')]){_0x44db6b=this[_0xaff9('0x37')](this['triggers'][_0x5d66a0],_0xa64e39);if(_0x44db6b){_[_0xaff9('0x38')](_0xa64e39,_0xa64e39[_0xaff9('0x39')]);for(var _0x4ac661=0x0,_0x144463,_0x45bb80,_0x83118b;_0x4ac6610x0){_0x541f12=_[_0xc1c7('0x2c')](_0x539931,_0x544fbb);}return _0x541f12;}function getCustomFields(_0x243450,_0x461360){var _0x4adb81=[];var _0x574e1c={'custom_fields':{}};if(_0x243450[_0xc1c7('0x2b')]>0x0){_[_0xc1c7('0x2d')](_0x243450,function(_0x9a0ab3){if(_0x9a0ab3[_0xc1c7('0x2e')]===_0xc1c7('0x2f')&&_0x9a0ab3['nameField']&&!_0x9a0ab3['customField']){_0x574e1c[_0x9a0ab3[_0xc1c7('0x30')][_0xc1c7('0x31')]()]=_0x9a0ab3['content'][_0xc1c7('0x24')]();}else if(_0x9a0ab3[_0xc1c7('0x2e')]===_0xc1c7('0x2f')&&_0x9a0ab3[_0xc1c7('0x32')]&&_0x9a0ab3[_0xc1c7('0x33')]){_0x574e1c[_0xc1c7('0x34')][_0x9a0ab3[_0xc1c7('0x32')]]=_0x9a0ab3['content'][_0xc1c7('0x24')]();}else if(_0x9a0ab3[_0xc1c7('0x2e')]===_0xc1c7('0x35')&&_0x9a0ab3[_0xc1c7('0x36')]&&_0x9a0ab3[_0xc1c7('0x32')]&&_0x9a0ab3[_0xc1c7('0x33')]){_0x461360[_0x9a0ab3[_0xc1c7('0x36')]]&&(_0x574e1c[_0xc1c7('0x34')][_0x9a0ab3[_0xc1c7('0x32')]]=_0x461360[_0x9a0ab3['variableName']]['toString']());}else if(_0x9a0ab3[_0xc1c7('0x2e')]===_0xc1c7('0x37')&&_0x9a0ab3[_0xc1c7('0x38')]&&_0x9a0ab3[_0xc1c7('0x38')][_0xc1c7('0x39')]&&_0x9a0ab3[_0xc1c7('0x32')]&&_0x9a0ab3[_0xc1c7('0x33')]){_0x461360[_0x9a0ab3[_0xc1c7('0x38')][_0xc1c7('0x39')][_0xc1c7('0x31')]()]&&(_0x574e1c[_0xc1c7('0x34')][_0x9a0ab3[_0xc1c7('0x32')]]=_0x461360[_0x9a0ab3[_0xc1c7('0x38')][_0xc1c7('0x39')][_0xc1c7('0x31')]()][_0xc1c7('0x24')]());}});}if(_0x574e1c[_0xc1c7('0x3a')]){_0x574e1c[_0xc1c7('0x3a')]=Number(_0x574e1c[_0xc1c7('0x3a')]);}return _0x574e1c;}function getTicket(_0x239a91,_0x2f3b3b,_0x49e9ac,_0x568809,_0x49e38f){logger[_0xc1c7('0x15')]('Creating\x20new\x20ticket...');var _0x53bf70=_[_0xc1c7('0x3b')]({'subject':intUtil[_0xc1c7('0x3c')](_0x568809[_0xc1c7('0x3d')],_0x49e38f,'\x20'),'type':_0xc1c7('0x3e'),'status':'new','labels':[_0xc1c7('0x3f'),_0xc1c7('0x40'),_0xc1c7('0x41')][_0xc1c7('0x42')](getTags(_0x568809[_0xc1c7('0x43')],_0xc1c7('0x39'))),'description':intUtil[_0xc1c7('0x3c')](_0x568809[_0xc1c7('0x44')],_0x49e38f,'\x0a'),'_links':{'assigned_user':{'href':util[_0xc1c7('0xf')](_0xc1c7('0x45'),_0x2f3b3b['id']),'class':_0xc1c7('0x46')}},'message':{'direction':'in','body':intUtil[_0xc1c7('0x3c')](_0x568809[_0xc1c7('0x44')],_0x49e38f,'\x0a')}},getCustomFields(_0x568809['Fields'],_0x49e38f));return request({'uri':util[_0xc1c7('0xf')](_0xc1c7('0x47'),_0x239a91['remoteUri'],_0x49e9ac['id']),'method':_0xc1c7('0x48'),'body':_0x53bf70});}exports[_0xc1c7('0x49')]=function(_0x44823e,_0x7131b1,_0x46a1b5,_0x2c09de,_0xd5e06a,_0x1e0248){var _0x1c96f1,_0x90808e;_0x1e0248['remoteUri']=intUtil[_0xc1c7('0x4a')](_0x1e0248[_0xc1c7('0x10')]);_0x1e0248['serverUrl']=intUtil['stripTrailingSlash'](_0x1e0248[_0xc1c7('0x4b')]);if(_0xd5e06a&&_0xd5e06a[_0xc1c7('0x4c')]){logger[_0xc1c7('0x15')](_0xc1c7('0x4d'),_0xc1c7('0x4e'));_0x7131b1['recordingURL']=util[_0xc1c7('0xf')](_0xc1c7('0x4f'),_0x1e0248['serverUrl'],_0x7131b1['uniqueid'],md5(_0x7131b1['uniqueid']));}else{_0x7131b1[_0xc1c7('0x50')]='';}headers[_0xc1c7('0x51')]=getAuth(_0x1e0248);return getUser(_0x1e0248,_0x2c09de[_0xc1c7('0x52')])['then'](function(_0x250c27){_0x1c96f1=_0x250c27;logger[_0xc1c7('0x15')]('The\x20User\x20ID\x20is:',_0x1c96f1['id']);return getEndUser(_0x1e0248,_0x7131b1[_0xc1c7('0x53')],_0x7131b1[_0xc1c7('0x54')]);})[_0xc1c7('0x11')](function(_0x13d412){_0x90808e=_0x13d412;logger[_0xc1c7('0x15')](_0xc1c7('0x55'),_0x90808e['id']);return getTicket(_0x1e0248,_0x1c96f1,_0x90808e,_0x46a1b5,_0x7131b1);})[_0xc1c7('0x11')](function(_0x24c783){if(_0x24c783){logger[_0xc1c7('0x15')](_0xc1c7('0x56'));logger[_0xc1c7('0x15')](_0xc1c7('0x57'),_0x24c783['id']);switch(_0x1e0248[_0xc1c7('0x2e')]){case _0xc1c7('0x58'):logger[_0xc1c7('0x15')](_0xc1c7('0x4d'),_0xc1c7('0x59'));emit(util[_0xc1c7('0xf')]('user:%s',_0x2c09de[_0xc1c7('0x39')]),'trigger:desk:display',{'recordId':_0x24c783['id']});break;case _0xc1c7('0x5a'):logger[_0xc1c7('0x15')](_0xc1c7('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc1c7('0xf')](_0xc1c7('0x5b'),_0x2c09de['name']),'trigger:browser:url',{'uri':util['format'](_0xc1c7('0x5c'),_0x24c783['id'])});break;default:logger[_0xc1c7('0x5d')]('[QUEUE]',_0xc1c7('0x5e'));}}})[_0xc1c7('0x5f')](function(_0x4474b2){console[_0xc1c7('0x5d')](_0x4474b2);logger[_0xc1c7('0x5d')](_0xc1c7('0x4d'),JSON['stringify'](_0x4474b2));});};exports[_0xc1c7('0x60')]=function(_0x568377,_0x307b5e,_0x456ac1,_0x37dca9,_0x557cb6,_0x3b4a7d,_0x277ef){var _0x260fc1,_0xf88aa;_0x3b4a7d[_0xc1c7('0x10')]=intUtil[_0xc1c7('0x4a')](_0x3b4a7d[_0xc1c7('0x10')]);_0x3b4a7d[_0xc1c7('0x4b')]=intUtil['stripTrailingSlash'](_0x3b4a7d[_0xc1c7('0x4b')]);if(_0x277ef&&_0x277ef[_0xc1c7('0x61')]&&_0x277ef[_0xc1c7('0x61')]!=='none'){logger['info'](_0xc1c7('0x62'),_0xc1c7('0x4e'));_0x307b5e[_0xc1c7('0x50')]=util['format'](_0xc1c7('0x4f'),_0x3b4a7d['serverUrl'],_0x307b5e[_0xc1c7('0x63')],md5(_0x307b5e[_0xc1c7('0x63')]));}headers[_0xc1c7('0x51')]=getAuth(_0x3b4a7d);return getUser(_0x3b4a7d,_0x37dca9[_0xc1c7('0x52')])[_0xc1c7('0x11')](function(_0xf03773){_0x260fc1=_0xf03773;logger[_0xc1c7('0x15')]('The\x20User\x20ID\x20is:',_0x260fc1['id']);return getEndUser(_0x3b4a7d,_0x307b5e[_0xc1c7('0x64')],_0x307b5e[_0xc1c7('0x65')]);})[_0xc1c7('0x11')](function(_0x526117){_0xf88aa=_0x526117;logger[_0xc1c7('0x15')]('The\x20Enduser\x20ID\x20is:',_0xf88aa['id']);return getTicket(_0x3b4a7d,_0x260fc1,_0xf88aa,_0x456ac1,_0x307b5e);})[_0xc1c7('0x11')](function(_0x528986){if(_0x528986){logger[_0xc1c7('0x15')](_0xc1c7('0x56'));logger[_0xc1c7('0x15')](_0xc1c7('0x57'),_0x528986['id']);switch(_0x3b4a7d[_0xc1c7('0x2e')]){case'integrationTab':logger['info']('[QUEUE]',_0xc1c7('0x59'));emit(util[_0xc1c7('0xf')](_0xc1c7('0x5b'),_0x37dca9[_0xc1c7('0x39')]),_0xc1c7('0x66'),{'recordId':_0x528986['id']});break;case _0xc1c7('0x5a'):logger['info'](_0xc1c7('0x4d'),_0xc1c7('0x67'));emit(util[_0xc1c7('0xf')](_0xc1c7('0x5b'),_0x37dca9['name']),_0xc1c7('0x68'),{'uri':util[_0xc1c7('0xf')](_0xc1c7('0x69'),_0x3b4a7d['remoteUri'],_0x528986['id'])});break;default:logger[_0xc1c7('0x5d')](_0xc1c7('0x62'),_0xc1c7('0x5e'));}}})[_0xc1c7('0x5f')](function(_0x58b08b){logger['error'](_0xc1c7('0x62'),JSON[_0xc1c7('0x1c')](_0x58b08b));});};exports['abandoned']=function(_0x46dc1e,_0x20ef90,_0x4b27f5,_0x12aaac,_0x6eec68,_0x4ecb39){var _0x6b9337,_0x16e4fd;_0x4ecb39[_0xc1c7('0x10')]=intUtil[_0xc1c7('0x4a')](_0x4ecb39[_0xc1c7('0x10')]);_0x4ecb39[_0xc1c7('0x4b')]=intUtil[_0xc1c7('0x4a')](_0x4ecb39[_0xc1c7('0x4b')]);if(_0x6eec68&&_0x6eec68[_0xc1c7('0x4c')]){logger[_0xc1c7('0x15')](_0xc1c7('0x6a'),_0xc1c7('0x4e'));_0x20ef90[_0xc1c7('0x50')]=util[_0xc1c7('0xf')](_0xc1c7('0x4f'),_0x4ecb39[_0xc1c7('0x4b')],_0x20ef90[_0xc1c7('0x63')],md5(_0x20ef90[_0xc1c7('0x63')]));}else{_0x20ef90[_0xc1c7('0x50')]='';}headers[_0xc1c7('0x51')]=getAuth(_0x4ecb39);return getUser(_0x4ecb39)[_0xc1c7('0x11')](function(_0x31bb3c){_0x6b9337=_0x31bb3c;logger[_0xc1c7('0x15')](_0xc1c7('0x6b'),_0x6b9337['id']);return getEndUser(_0x4ecb39,_0x20ef90[_0xc1c7('0x53')],_0x20ef90[_0xc1c7('0x54')]);})[_0xc1c7('0x11')](function(_0x1448d8){_0x16e4fd=_0x1448d8;logger['info'](_0xc1c7('0x55'),_0x16e4fd['id']);return getTicket(_0x4ecb39,_0x6b9337,_0x16e4fd,_0x4b27f5,_0x20ef90);})[_0xc1c7('0x11')](function(_0x29067a){if(_0x29067a){logger[_0xc1c7('0x15')](_0xc1c7('0x56'));logger[_0xc1c7('0x15')](_0xc1c7('0x57'),_0x29067a['id']);}})[_0xc1c7('0x5f')](function(_0x5f4f50){logger[_0xc1c7('0x5d')](_0xc1c7('0x6a'),JSON[_0xc1c7('0x1c')](_0x5f4f50));});}; \ No newline at end of file +var _0xd4a2=['POST','work','length','forEach','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY','Motion','CTI','Tags','Descriptions','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:desk:display','Desk\x20account\x20type\x20not\x20recognized','[ABANDONED]','lodash','util','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','then','total_entries','find','_embedded','entries','Agent\x20found!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','%s:%s','username','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers'];(function(_0x55af73,_0x2bcc0e){var _0x9b56fb=function(_0x38f565){while(--_0x38f565){_0x55af73['push'](_0x55af73['shift']());}};_0x9b56fb(++_0x2bcc0e);}(_0xd4a2,0x173));var _0x2d4a=function(_0x46cb9f,_0x1668d5){_0x46cb9f=_0x46cb9f-0x0;var _0x5024bf=_0xd4a2[_0x46cb9f];return _0x5024bf;};'use strict';var _=require(_0x2d4a('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x2d4a('0x1'));var Redis=require('ioredis');var intUtil=require(_0x2d4a('0x2'));var config=require('../../../../config/environment');var logger=require(_0x2d4a('0x3'))('desk');config[_0x2d4a('0x4')]=_[_0x2d4a('0x5')](config[_0x2d4a('0x4')],{'host':_0x2d4a('0x6'),'port':0x18eb});var io=require(_0x2d4a('0x7'))(new Redis(config['redis']));function emit(_0x45fefb,_0x41b161,_0x1f237e){io['to'](_0x45fefb)[_0x2d4a('0x8')](_0x41b161,_0x1f237e);}var headers={'Content-Type':_0x2d4a('0x9'),'Accept':_0x2d4a('0x9')};function getUser(_0xb9f016,_0x113839){if(intUtil[_0x2d4a('0xa')](_0x113839)===!![]){logger[_0x2d4a('0xb')](_0x2d4a('0xc'),_0x113839);return request({'uri':util[_0x2d4a('0xd')]('%s/users',_0xb9f016['remoteUri'])})[_0x2d4a('0xe')](function(_0x5bf7df){if(_0x5bf7df[_0x2d4a('0xf')]){return _[_0x2d4a('0x10')](_0x5bf7df[_0x2d4a('0x11')][_0x2d4a('0x12')],{'email':_0x113839});}})[_0x2d4a('0xe')](function(_0x3341e3){if(_0x3341e3){logger[_0x2d4a('0xb')](_0x2d4a('0x13'));return _0x3341e3;}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2d4a('0xd')]('%s/users/me',_0xb9f016[_0x2d4a('0x14')])});}});}else{logger[_0x2d4a('0xb')](_0x2d4a('0x15'));return request({'uri':util[_0x2d4a('0xd')]('%s/users/me',_0xb9f016[_0x2d4a('0x14')])});}}function request(_0x5a6378){logger[_0x2d4a('0x16')]('[HTTP]',JSON[_0x2d4a('0x17')](_0x5a6378));return rp(_[_0x2d4a('0x5')](_0x5a6378,{'method':_0x2d4a('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x388371){var _0x498956;if(_0x388371['authType']==='basic'){_0x498956=util[_0x2d4a('0xd')](_0x2d4a('0x19'),_0x388371[_0x2d4a('0x1a')],_0x388371[_0x2d4a('0x1b')]);}else if(_0x388371[_0x2d4a('0x1c')]===_0x2d4a('0x1d')){_0x498956=util['format']('%s/token:%s',_0x388371[_0x2d4a('0x1a')],_0x388371[_0x2d4a('0x1d')]);}return util[_0x2d4a('0xd')](_0x2d4a('0x1e'),new Buffer(_0x498956)[_0x2d4a('0x1f')](_0x2d4a('0x20')));}function getEndUser(_0x22dd0b,_0xa43fb1,_0x5d5daa){logger[_0x2d4a('0xb')](_0x2d4a('0x21'),_0x5d5daa);return request({'uri':util[_0x2d4a('0xd')](_0x2d4a('0x22'),_0x22dd0b[_0x2d4a('0x14')]),'qs':{'phone':_0x5d5daa}})[_0x2d4a('0xe')](function(_0x456d38){if(_0x456d38[_0x2d4a('0xf')]){logger['info']('Enduser\x20found!');return _0x456d38['_embedded'][_0x2d4a('0x12')][0x0];}else{logger['info'](_0x2d4a('0x23'));return request({'uri':util[_0x2d4a('0xd')](_0x2d4a('0x24'),_0x22dd0b[_0x2d4a('0x14')]),'method':_0x2d4a('0x25'),'body':{'first_name':_0xa43fb1,'title':_0xa43fb1,'phone_numbers':[{'type':_0x2d4a('0x26'),'value':_0x5d5daa}]}});}});}function getTags(_0x21a473,_0x27b358){var _0x4f1fc8=[];if(_0x21a473&&_0x21a473[_0x2d4a('0x27')]>0x0){_0x4f1fc8=_['map'](_0x21a473,_0x27b358);}return _0x4f1fc8;}function getCustomFields(_0x221602,_0x9bac28){var _0xc497ce=[];var _0x20b87d={'custom_fields':{}};if(_0x221602[_0x2d4a('0x27')]>0x0){_[_0x2d4a('0x28')](_0x221602,function(_0x25ac5c){if(_0x25ac5c[_0x2d4a('0x29')]==='string'&&_0x25ac5c[_0x2d4a('0x2a')]&&!_0x25ac5c[_0x2d4a('0x2b')]){_0x20b87d[_0x25ac5c[_0x2d4a('0x2a')][_0x2d4a('0x2c')]()]=_0x25ac5c[_0x2d4a('0x2d')]['toString']();}else if(_0x25ac5c[_0x2d4a('0x29')]===_0x2d4a('0x2e')&&_0x25ac5c[_0x2d4a('0x2f')]&&_0x25ac5c[_0x2d4a('0x2b')]){_0x20b87d[_0x2d4a('0x30')][_0x25ac5c['idField']]=_0x25ac5c[_0x2d4a('0x2d')][_0x2d4a('0x1f')]();}else if(_0x25ac5c[_0x2d4a('0x29')]===_0x2d4a('0x31')&&_0x25ac5c[_0x2d4a('0x32')]&&_0x25ac5c[_0x2d4a('0x2f')]&&_0x25ac5c['customField']){_0x9bac28[_0x25ac5c[_0x2d4a('0x32')]]&&(_0x20b87d[_0x2d4a('0x30')][_0x25ac5c[_0x2d4a('0x2f')]]=_0x9bac28[_0x25ac5c[_0x2d4a('0x32')]][_0x2d4a('0x1f')]());}else if(_0x25ac5c['type']===_0x2d4a('0x33')&&_0x25ac5c[_0x2d4a('0x34')]&&_0x25ac5c['Variable'][_0x2d4a('0x35')]&&_0x25ac5c[_0x2d4a('0x2f')]&&_0x25ac5c[_0x2d4a('0x2b')]){_0x9bac28[_0x25ac5c[_0x2d4a('0x34')][_0x2d4a('0x35')][_0x2d4a('0x2c')]()]&&(_0x20b87d['custom_fields'][_0x25ac5c[_0x2d4a('0x2f')]]=_0x9bac28[_0x25ac5c[_0x2d4a('0x34')][_0x2d4a('0x35')][_0x2d4a('0x2c')]()][_0x2d4a('0x1f')]());}});}if(_0x20b87d[_0x2d4a('0x36')]){_0x20b87d['priority']=Number(_0x20b87d['priority']);}return _0x20b87d;}function getTicket(_0x393762,_0x4b833b,_0x6e0716,_0x309e33,_0x5aeae4){logger[_0x2d4a('0xb')](_0x2d4a('0x37'));var _0x8e1bea=_[_0x2d4a('0x38')]({'subject':intUtil[_0x2d4a('0x39')](_0x309e33[_0x2d4a('0x3a')],_0x5aeae4,'\x20'),'type':_0x2d4a('0x3b'),'status':_0x2d4a('0x3c'),'labels':[_0x2d4a('0x3d'),_0x2d4a('0x3e'),_0x2d4a('0x3f')]['concat'](getTags(_0x309e33[_0x2d4a('0x40')],_0x2d4a('0x35'))),'description':intUtil[_0x2d4a('0x39')](_0x309e33[_0x2d4a('0x41')],_0x5aeae4,'\x0a'),'_links':{'assigned_user':{'href':util[_0x2d4a('0xd')]('/api/v2/users/%d',_0x4b833b['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x309e33['Descriptions'],_0x5aeae4,'\x0a')}},getCustomFields(_0x309e33[_0x2d4a('0x42')],_0x5aeae4));return request({'uri':util[_0x2d4a('0xd')](_0x2d4a('0x43'),_0x393762[_0x2d4a('0x14')],_0x6e0716['id']),'method':'POST','body':_0x8e1bea});}exports[_0x2d4a('0x44')]=function(_0x3df6b4,_0x5e9704,_0x189d2a,_0x13b0f0,_0x8a9375,_0x13970c){var _0x1ad852,_0x2c91e1;_0x13970c['remoteUri']=intUtil[_0x2d4a('0x45')](_0x13970c[_0x2d4a('0x14')]);_0x13970c[_0x2d4a('0x46')]=intUtil[_0x2d4a('0x45')](_0x13970c[_0x2d4a('0x46')]);if(_0x8a9375&&_0x8a9375[_0x2d4a('0x47')]){logger['info'](_0x2d4a('0x48'),_0x2d4a('0x49'));_0x5e9704[_0x2d4a('0x4a')]=util['format'](_0x2d4a('0x4b'),_0x13970c['serverUrl'],_0x5e9704[_0x2d4a('0x4c')],md5(_0x5e9704[_0x2d4a('0x4c')]));}else{_0x5e9704[_0x2d4a('0x4a')]='';}headers[_0x2d4a('0x4d')]=getAuth(_0x13970c);return getUser(_0x13970c,_0x13b0f0[_0x2d4a('0x4e')])['then'](function(_0x5d481c){_0x1ad852=_0x5d481c;logger[_0x2d4a('0xb')](_0x2d4a('0x4f'),_0x1ad852['id']);return getEndUser(_0x13970c,_0x5e9704['calleridname'],_0x5e9704[_0x2d4a('0x50')]);})['then'](function(_0x16b858){_0x2c91e1=_0x16b858;logger[_0x2d4a('0xb')](_0x2d4a('0x51'),_0x2c91e1['id']);return getTicket(_0x13970c,_0x1ad852,_0x2c91e1,_0x189d2a,_0x5e9704);})['then'](function(_0x38d795){if(_0x38d795){logger['info'](_0x2d4a('0x52'));logger[_0x2d4a('0xb')](_0x2d4a('0x53'),_0x38d795['id']);switch(_0x13970c[_0x2d4a('0x29')]){case _0x2d4a('0x54'):logger[_0x2d4a('0xb')](_0x2d4a('0x48'),_0x2d4a('0x55'));emit(util[_0x2d4a('0xd')](_0x2d4a('0x56'),_0x13b0f0[_0x2d4a('0x35')]),'trigger:desk:display',{'recordId':_0x38d795['id']});break;case _0x2d4a('0x57'):logger[_0x2d4a('0xb')](_0x2d4a('0x48'),_0x2d4a('0x58'));emit(util[_0x2d4a('0xd')]('user:%s',_0x13b0f0[_0x2d4a('0x35')]),_0x2d4a('0x59'),{'uri':util[_0x2d4a('0xd')](_0x2d4a('0x5a'),_0x38d795['id'])});break;default:logger[_0x2d4a('0x5b')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})[_0x2d4a('0x5c')](function(_0x6d238b){console['error'](_0x6d238b);logger[_0x2d4a('0x5b')](_0x2d4a('0x48'),JSON[_0x2d4a('0x17')](_0x6d238b));});};exports[_0x2d4a('0x5d')]=function(_0x52a468,_0x31576d,_0x4e0198,_0x3e3fb7,_0x3fe91b,_0x298fed,_0x1174e2){var _0x1866c3,_0x3103ca;_0x298fed[_0x2d4a('0x14')]=intUtil[_0x2d4a('0x45')](_0x298fed['remoteUri']);_0x298fed[_0x2d4a('0x46')]=intUtil[_0x2d4a('0x45')](_0x298fed[_0x2d4a('0x46')]);if(_0x1174e2&&_0x1174e2[_0x2d4a('0x5e')]&&_0x1174e2[_0x2d4a('0x5e')]!==_0x2d4a('0x5f')){logger[_0x2d4a('0xb')](_0x2d4a('0x60'),_0x2d4a('0x49'));_0x31576d[_0x2d4a('0x4a')]=util[_0x2d4a('0xd')](_0x2d4a('0x4b'),_0x298fed[_0x2d4a('0x46')],_0x31576d[_0x2d4a('0x4c')],md5(_0x31576d[_0x2d4a('0x4c')]));}headers[_0x2d4a('0x4d')]=getAuth(_0x298fed);return getUser(_0x298fed,_0x3e3fb7[_0x2d4a('0x4e')])['then'](function(_0x3515b8){_0x1866c3=_0x3515b8;logger[_0x2d4a('0xb')]('The\x20User\x20ID\x20is:',_0x1866c3['id']);return getEndUser(_0x298fed,_0x31576d[_0x2d4a('0x61')],_0x31576d[_0x2d4a('0x62')]);})[_0x2d4a('0xe')](function(_0x228741){_0x3103ca=_0x228741;logger[_0x2d4a('0xb')](_0x2d4a('0x51'),_0x3103ca['id']);return getTicket(_0x298fed,_0x1866c3,_0x3103ca,_0x4e0198,_0x31576d);})[_0x2d4a('0xe')](function(_0x1cf982){if(_0x1cf982){logger[_0x2d4a('0xb')](_0x2d4a('0x52'));logger[_0x2d4a('0xb')](_0x2d4a('0x53'),_0x1cf982['id']);switch(_0x298fed['type']){case _0x2d4a('0x54'):logger[_0x2d4a('0xb')]('[QUEUE]',_0x2d4a('0x55'));emit(util[_0x2d4a('0xd')](_0x2d4a('0x56'),_0x3e3fb7[_0x2d4a('0x35')]),_0x2d4a('0x63'),{'recordId':_0x1cf982['id']});break;case _0x2d4a('0x57'):logger[_0x2d4a('0xb')](_0x2d4a('0x48'),_0x2d4a('0x58'));emit(util[_0x2d4a('0xd')]('user:%s',_0x3e3fb7[_0x2d4a('0x35')]),_0x2d4a('0x59'),{'uri':util[_0x2d4a('0xd')]('%s/agent/tickets/%s',_0x298fed[_0x2d4a('0x14')],_0x1cf982['id'])});break;default:logger[_0x2d4a('0x5b')](_0x2d4a('0x60'),_0x2d4a('0x64'));}}})[_0x2d4a('0x5c')](function(_0x278bbc){logger[_0x2d4a('0x5b')](_0x2d4a('0x60'),JSON[_0x2d4a('0x17')](_0x278bbc));});};exports['abandoned']=function(_0x21b8e9,_0x17ade0,_0x2a876b,_0x17ef80,_0x2c50e7,_0x2f77ee){var _0x53f52b,_0x38e4ae;_0x2f77ee[_0x2d4a('0x14')]=intUtil[_0x2d4a('0x45')](_0x2f77ee['remoteUri']);_0x2f77ee[_0x2d4a('0x46')]=intUtil[_0x2d4a('0x45')](_0x2f77ee['serverUrl']);if(_0x2c50e7&&_0x2c50e7[_0x2d4a('0x47')]){logger[_0x2d4a('0xb')]('[ABANDONED]',_0x2d4a('0x49'));_0x17ade0['recordingURL']=util['format'](_0x2d4a('0x4b'),_0x2f77ee[_0x2d4a('0x46')],_0x17ade0[_0x2d4a('0x4c')],md5(_0x17ade0[_0x2d4a('0x4c')]));}else{_0x17ade0['recordingURL']='';}headers[_0x2d4a('0x4d')]=getAuth(_0x2f77ee);return getUser(_0x2f77ee)[_0x2d4a('0xe')](function(_0x25ee37){_0x53f52b=_0x25ee37;logger[_0x2d4a('0xb')]('The\x20User\x20ID\x20is:',_0x53f52b['id']);return getEndUser(_0x2f77ee,_0x17ade0['calleridname'],_0x17ade0[_0x2d4a('0x50')]);})[_0x2d4a('0xe')](function(_0x2a2441){_0x38e4ae=_0x2a2441;logger[_0x2d4a('0xb')](_0x2d4a('0x51'),_0x38e4ae['id']);return getTicket(_0x2f77ee,_0x53f52b,_0x38e4ae,_0x2a876b,_0x17ade0);})[_0x2d4a('0xe')](function(_0x18db11){if(_0x18db11){logger['info'](_0x2d4a('0x52'));logger[_0x2d4a('0xb')](_0x2d4a('0x53'),_0x18db11['id']);}})[_0x2d4a('0x5c')](function(_0x59810d){logger[_0x2d4a('0x5b')](_0x2d4a('0x65'),JSON[_0x2d4a('0x17')](_0x59810d));});}; \ 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 fb40718..d26cab5 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 _0x11cf=['/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','GET','contacts?$select=telephone1','telephone1','contactid','info',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','type','string','nameField','customField','indexOf','content','incident','incidents','getString','Subjects','Descriptions','/contacts(','phonecall','phonecalls','assign','callDirection','queue','ticketType','ticketId','format','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','../../../../config/environment','localhost','socket.io-emitter','redis','POST','clientId','username','password','clientSecret','then','error',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','userEmail','length','isdisabled','toUpperCase',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','catch','toLowerCase','outbound','destcalleridnum','calleridnum'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x11cf,0x164));var _0xf11c=function(_0x3199af,_0x339560){_0x3199af=_0x3199af-0x0;var _0x5aa4d0=_0x11cf[_0x3199af];return _0x5aa4d0;};'use strict';var _=require(_0xf11c('0x0'));var BPromise=require(_0xf11c('0x1'));var rp=require(_0xf11c('0x2'));var util=require(_0xf11c('0x3'));var intUtil=require('./util');var md5=require(_0xf11c('0x4'));var Redis=require(_0xf11c('0x5'));var logger=require(_0xf11c('0x6'))('dynamics365');var config=require(_0xf11c('0x7'));config['redis']=_['defaults'](config['redis'],{'host':_0xf11c('0x8'),'port':0x18eb});var io=require(_0xf11c('0x9'))(new Redis(config[_0xf11c('0xa')]));function getAuthToken(_0x170bbb,_0x3eaee5,_0x5f3f23){var _0x12ffee={'method':_0xf11c('0xb'),'uri':_0x3eaee5,'form':{'client_id':_0x170bbb[_0xf11c('0xc')],'resource':_0x170bbb['remoteUri'],'username':_0x170bbb[_0xf11c('0xd')],'password':_0x170bbb['password'],'grant_type':_0xf11c('0xe'),'client_secret':_0x170bbb[_0xf11c('0xf')]},'json':!![]};return rp(_0x12ffee)[_0xf11c('0x10')](function(_0x3e9845){return _0x3e9845['access_token'];})['catch'](function(_0x257941){logger[_0xf11c('0x11')]('['+[_0x5f3f23['toUpperCase']()]+_0xf11c('0x12'));return _0x257941[_0xf11c('0x13')];});}function getUser(_0x8207af,_0x40cb76,_0x568975,_0x21fc78,_0x2410d9,_0x4913ff){return new BPromise(function(_0x3973ed,_0x3d06c9){return getAuthToken(_0x40cb76,_0x21fc78,_0x4913ff)[_0xf11c('0x10')](function(_0x403fce){var _0x4e7b2d={'method':'GET','uri':_0x2410d9+_0xf11c('0x14'),'headers':{'Authorization':_0xf11c('0x15')+_0x403fce,'OData-Version':_0xf11c('0x16')},'json':!![]};return rp(_0x4e7b2d);})['then'](function(_0x1b192c){var _0x2d07bd=_0x1b192c[_0xf11c('0x17')];var _0x145f1a=![];var _0x22424e=null;if(!_[_0xf11c('0x18')](_0x568975)){if(intUtil['validateEmail'](_0x568975[_0xf11c('0x19')])){_0x8207af[_0xf11c('0x1a')]=_0x568975[_0xf11c('0x19')];for(_0x22424e=0x0;_0x22424e<_0x2d07bd[_0xf11c('0x1b')];_0x22424e++){if(_0x2d07bd[_0x22424e]['internalemailaddress']===_0x568975[_0xf11c('0x19')]&&!_0x2d07bd[_0x22424e][_0xf11c('0x1c')]){_0x145f1a=!![];logger['info']('['+[_0x4913ff[_0xf11c('0x1d')]()]+_0xf11c('0x1e')+_0x2d07bd[_0x22424e]['systemuserid']+'!');_0x8207af[_0xf11c('0x1f')]=_0x2d07bd[_0x22424e][_0xf11c('0x20')];}}}}if(!_0x145f1a){logger['info']('['+[_0x4913ff[_0xf11c('0x1d')]()]+_0xf11c('0x21'));_0x8207af[_0xf11c('0x1a')]=_0x40cb76[_0xf11c('0xd')];for(_0x22424e=0x0;_0x22424e<_0x2d07bd[_0xf11c('0x1b')];_0x22424e++){if(_0x2d07bd[_0x22424e][_0xf11c('0x22')]===_0x40cb76['username']){_0x8207af[_0xf11c('0x1f')]=_0x2d07bd[_0x22424e][_0xf11c('0x20')];}}}_0x3973ed(_0x8207af);})[_0xf11c('0x23')](function(_0x4e59a8){_0x3d06c9(_0x4e59a8['message']);});});}function createEndUser(_0x456a0f,_0x7dc452,_0x106575,_0x3ede4a,_0x2d46b4,_0x54c535){return new BPromise(function(_0x2863f2,_0x3b30fa){return getAuthToken(_0x7dc452,_0x106575,_0x54c535)[_0xf11c('0x10')](function(_0x371278){var _0x1afa7c=_0x54c535[_0xf11c('0x24')]()===_0xf11c('0x25')?_0x2d46b4[_0xf11c('0x26')]:_0x2d46b4[_0xf11c('0x27')];var _0x209392={'method':_0xf11c('0xb'),'uri':_0x3ede4a+'contacts','body':{'telephone1':_0x1afa7c,'fullname':_0x1afa7c,'firstname':_0x1afa7c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xf11c('0x28')+_0x456a0f[_0xf11c('0x1f')]+')'},'headers':{'Authorization':_0xf11c('0x15')+_0x371278,'OData-Version':_0xf11c('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x209392);})['then'](function(_0xdb6af4){var _0x2ea025=_0xdb6af4[_0xf11c('0x29')][_0xf11c('0x2a')];var _0x4df26a=_0x2ea025[_0xf11c('0x2b')](_0x2ea025[_0xf11c('0x2c')]('(')+0x1,_0x2ea025['lastIndexOf'](')'));_0x456a0f[_0xf11c('0x2d')]=_0x4df26a;_0x2863f2(_0x456a0f);})[_0xf11c('0x23')](function(_0x46da6d){_0x3b30fa(_0x46da6d[_0xf11c('0x13')]);});});}function getEndUser(_0x5c5ca5,_0x480b55,_0x54d686,_0x20e9a2,_0x14781c,_0x577b7d){return new BPromise(function(_0x5c2b7f,_0x46820c){return getAuthToken(_0x480b55,_0x54d686,_0x577b7d)['then'](function(_0x189708){var _0x5ad819={'method':_0xf11c('0x2e'),'uri':_0x20e9a2+_0xf11c('0x2f'),'headers':{'Authorization':_0xf11c('0x15')+_0x189708,'If-None-Match':null,'OData-Version':_0xf11c('0x16')},'json':!![]};return rp(_0x5ad819);})[_0xf11c('0x10')](function(_0x3eef13){var _0x3c3caa=null;if(_0x3eef13){var _0x5896be=_0x3eef13[_0xf11c('0x17')];var _0x174fe1=![];for(_0x3c3caa=0x0;_0x3c3caa<_0x5896be[_0xf11c('0x1b')];_0x3c3caa++){var _0x425b44=_0x577b7d[_0xf11c('0x24')]()==='outbound'?_0x14781c[_0xf11c('0x26')]:_0x14781c[_0xf11c('0x27')];if(_0x5896be[_0x3c3caa][_0xf11c('0x30')]===_0x425b44){_0x174fe1=!![];_0x5c5ca5[_0xf11c('0x2d')]=_0x5896be[_0x3c3caa][_0xf11c('0x31')];}}if(_0x174fe1){_0x5c2b7f(_0x5c5ca5);}else{return createEndUser(_0x5c5ca5,_0x480b55,_0x54d686,_0x20e9a2,_0x14781c,_0x577b7d)[_0xf11c('0x10')](function(_0x5e6c54){logger[_0xf11c('0x32')]('['+[_0x577b7d['toUpperCase']()]+_0xf11c('0x33'),_0x5e6c54[_0xf11c('0x2d')]);_0x5c2b7f(_0x5e6c54);});}}else{return createEndUser(_0x5c5ca5,_0x480b55,_0x54d686,_0x20e9a2,_0x14781c,_0x577b7d)[_0xf11c('0x10')](function(_0x2be164){logger[_0xf11c('0x32')]('['+[_0x577b7d[_0xf11c('0x1d')]()]+_0xf11c('0x34'),_0x2be164[_0xf11c('0x2d')]);_0x5c2b7f(_0x2be164);});}});});}function getCustomFields(_0x1157c5,_0x2afb30,_0x386341){var _0x475300={};if(_0x1157c5[_0xf11c('0x1b')]>0x0){_['forEach'](_0x1157c5,function(_0x5db5ed){if(_0x5db5ed[_0xf11c('0x35')]===_0xf11c('0x36')&&_0x5db5ed[_0xf11c('0x37')]&&!_0x5db5ed[_0xf11c('0x38')]){var _0x72d13e=_0x5db5ed['idField'][_0xf11c('0x24')]();var _0x2e704c=_0x72d13e[_0xf11c('0x2b')](0x0,_0x72d13e[_0xf11c('0x39')]('_'));var _0x998964=_0x72d13e[_0xf11c('0x2b')](_0x72d13e[_0xf11c('0x39')]('_')+0x1);if(_0x2e704c===_0x386341){_0x475300[_0x998964]=_0x5db5ed[_0xf11c('0x3a')];}}});}return _0x475300;}function getTicket(_0x310b26,_0x28c549,_0x557710,_0x4fb074,_0x17bbdf,_0x2e96e0,_0xb11829){return new BPromise(function(_0x2ce274,_0x5917db){var _0x583320;return getAuthToken(_0x28c549,_0x557710,_0xb11829)[_0xf11c('0x10')](function(_0x571e8c){if(_0x2e96e0['ticketType']===_0xf11c('0x3b')){_0x583320={'method':_0xf11c('0xb'),'uri':_0x4fb074+_0xf11c('0x3c'),'body':Object['assign']({},{'title':intUtil[_0xf11c('0x3d')](_0x2e96e0[_0xf11c('0x3e')],_0x17bbdf,'\x20'),'description':intUtil[_0xf11c('0x3d')](_0x2e96e0[_0xf11c('0x3f')],_0x17bbdf,'\x0a'),'customerid_contact@odata.bind':_0xf11c('0x40')+_0x310b26[_0xf11c('0x2d')]+')','ownerid@odata.bind':'/systemusers('+_0x310b26[_0xf11c('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x2e96e0['Fields'],_0x17bbdf,_0x2e96e0['ticketType'])),'headers':{'Authorization':_0xf11c('0x15')+_0x571e8c,'OData-Version':_0xf11c('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2e96e0['ticketType']===_0xf11c('0x41')){_0x583320={'method':_0xf11c('0xb'),'uri':_0x4fb074+_0xf11c('0x42'),'body':Object[_0xf11c('0x43')]({},{'subject':intUtil[_0xf11c('0x3d')](_0x2e96e0[_0xf11c('0x3e')],_0x17bbdf,'\x20'),'phonenumber':String(_0x17bbdf[_0xf11c('0x27')]),'description':intUtil[_0xf11c('0x3d')](_0x2e96e0['Descriptions'],_0x17bbdf,'\x0a'),'regardingobjectid_contact@odata.bind':_0xf11c('0x40')+_0x310b26['enduserId']+')','ownerid@odata.bind':_0xf11c('0x28')+_0x310b26[_0xf11c('0x1f')]+')','directioncode':_0x310b26[_0xf11c('0x44')]===_0xf11c('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x310b26['userId']+')','participationtypemask':_0x310b26[_0xf11c('0x44')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xf11c('0x40')+_0x310b26[_0xf11c('0x2d')]+')','participationtypemask':_0x310b26[_0xf11c('0x44')]===_0xf11c('0x45')?0x1:0x2}]},getCustomFields(_0x2e96e0['Fields'],_0x17bbdf,_0x2e96e0[_0xf11c('0x46')])),'headers':{'Authorization':'Bearer\x20'+_0x571e8c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x583320);})[_0xf11c('0x10')](function(_0x3182c3){var _0x153ecd=_0x3182c3[_0xf11c('0x29')][_0xf11c('0x2a')];var _0x4f84d1=_0x153ecd[_0xf11c('0x2b')](_0x153ecd[_0xf11c('0x2c')]('(')+0x1,_0x153ecd[_0xf11c('0x2c')](')'));_0x310b26[_0xf11c('0x47')]=_0x4f84d1;_0x2ce274(_0x310b26);})[_0xf11c('0x23')](function(_0x4319b9){_0x5917db(_0x4319b9[_0xf11c('0x13')]);});});}function emit(_0x1140ee,_0x4a28c8,_0x7510ed,_0x335a1b){var _0x27acf0={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x1140ee,_0x7510ed,_0x335a1b)};io['to'](util[_0xf11c('0x48')](_0xf11c('0x49'),_0x4a28c8))[_0xf11c('0x4a')](_0xf11c('0x4b'),_0x27acf0);}exports['cs']=function(_0x27f71b,_0x446332,_0x11babb,_0x459de8,_0x559c91,_0x365991,_0x1e06ff,_0x248248){var _0x10d5ca={};_0x365991[_0xf11c('0x4c')]=intUtil[_0xf11c('0x4d')](_0x365991[_0xf11c('0x4c')]);_0x365991[_0xf11c('0x4e')]=intUtil[_0xf11c('0x4d')](_0x365991[_0xf11c('0x4e')]);_0x10d5ca[_0xf11c('0x44')]=_0x248248===_0xf11c('0x45')||_0x248248===_0xf11c('0x4f')?_0xf11c('0x45'):_0xf11c('0x25');var _0x1e7372=util[_0xf11c('0x48')](_0xf11c('0x50'),_0x365991[_0xf11c('0x4c')]);var _0x4721f7=util[_0xf11c('0x48')](_0xf11c('0x51'),_0x365991['tenantId']);var _0x396262=util[_0xf11c('0x48')](_0xf11c('0x52'),_0x365991[_0xf11c('0x4e')],_0x446332['uniqueid'],md5(_0x446332[_0xf11c('0x53')]));if(_0x559c91&&_0x559c91[_0xf11c('0x54')]){logger[_0xf11c('0x32')](_0xf11c('0x55'),_0xf11c('0x56'));_0x446332['recordingURL']=_0x396262;}else if(_0x1e06ff&&_0x1e06ff['recordingFormat']&&_0x1e06ff[_0xf11c('0x57')]!=='none'){logger[_0xf11c('0x32')](_0xf11c('0x58'),_0xf11c('0x56'));_0x446332[_0xf11c('0x59')]=_0x396262;}else{_0x446332[_0xf11c('0x59')]='';}return getUser(_0x10d5ca,_0x365991,_0x459de8,_0x4721f7,_0x1e7372,_0x248248)[_0xf11c('0x10')](function(_0x441cbb){logger['info']('['+_0x248248[_0xf11c('0x1d')]()+_0xf11c('0x5a'),_0x441cbb['userId']);logger[_0xf11c('0x32')]('['+_0x248248[_0xf11c('0x1d')]()+_0xf11c('0x5b'),_0x441cbb[_0xf11c('0x1a')]);return getEndUser(_0x441cbb,_0x365991,_0x4721f7,_0x1e7372,_0x446332,_0x248248);})[_0xf11c('0x10')](function(_0x597592){logger[_0xf11c('0x32')]('['+_0x248248['toUpperCase']()+_0xf11c('0x5c'),_0x597592[_0xf11c('0x2d')]);logger[_0xf11c('0x32')]('['+_0x248248[_0xf11c('0x1d')]()+_0xf11c('0x5d'),_0x446332[_0xf11c('0x27')]);return getTicket(_0x597592,_0x365991,_0x4721f7,_0x1e7372,_0x446332,_0x11babb,_0x248248);})[_0xf11c('0x10')](function(_0x1738bf){logger[_0xf11c('0x32')](util['format']('['+_0x248248[_0xf11c('0x1d')]()+_0xf11c('0x5e'),_0x11babb[_0xf11c('0x46')],_0x1738bf[_0xf11c('0x47')]));logger[_0xf11c('0x32')](util[_0xf11c('0x48')]('['+_0x248248['toUpperCase']()+_0xf11c('0x5f'),_0x248248));if(_0x248248!==_0xf11c('0x4f')){logger[_0xf11c('0x32')]('['+_0x248248[_0xf11c('0x1d')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x365991[_0xf11c('0x4c')],_0x459de8[_0xf11c('0x60')],_0x11babb[_0xf11c('0x46')],_0x1738bf['ticketId']);}})[_0xf11c('0x23')](function(_0x2831ac){logger['error']('['+_0x248248[_0xf11c('0x1d')]()+_0xf11c('0x61'),util[_0xf11c('0x62')](_0x2831ac,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x35a6=['telephone1','contactid',']\x20Enduser\x20Created!','forEach','string','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','phonecalls','callDirection','queue','ticketId','format','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','remoteUri','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','POST','clientId','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','then','isNil','email','length',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','internalemailaddress','userId','outbound','calleridnum','contacts','/systemusers(','4.0','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','value','toLowerCase','destcalleridnum'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x35a6,0x1b6));var _0x635a=function(_0x5ce3c1,_0x2ab59b){_0x5ce3c1=_0x5ce3c1-0x0;var _0x585640=_0x35a6[_0x5ce3c1];return _0x585640;};'use strict';var _=require(_0x635a('0x0'));var BPromise=require(_0x635a('0x1'));var rp=require(_0x635a('0x2'));var util=require(_0x635a('0x3'));var intUtil=require(_0x635a('0x4'));var md5=require(_0x635a('0x5'));var Redis=require(_0x635a('0x6'));var logger=require(_0x635a('0x7'))(_0x635a('0x8'));var config=require(_0x635a('0x9'));config[_0x635a('0xa')]=_['defaults'](config['redis'],{'host':_0x635a('0xb'),'port':0x18eb});var io=require(_0x635a('0xc'))(new Redis(config[_0x635a('0xa')]));function getAuthToken(_0x4d6d89,_0xf7bc17,_0x34a56a){var _0xd59849={'method':_0x635a('0xd'),'uri':_0xf7bc17,'form':{'client_id':_0x4d6d89[_0x635a('0xe')],'resource':_0x4d6d89['remoteUri'],'username':_0x4d6d89['username'],'password':_0x4d6d89[_0x635a('0xf')],'grant_type':_0x635a('0xf'),'client_secret':_0x4d6d89[_0x635a('0x10')]},'json':!![]};return rp(_0xd59849)['then'](function(_0x1c7057){return _0x1c7057[_0x635a('0x11')];})[_0x635a('0x12')](function(_0xd550e){logger[_0x635a('0x13')]('['+[_0x34a56a[_0x635a('0x14')]()]+_0x635a('0x15'));return _0xd550e[_0x635a('0x16')];});}function getUser(_0x55e480,_0x5465e4,_0x306d48,_0x2c09e2,_0x3f1817,_0x2aa176){return new BPromise(function(_0x581ec0,_0x2f4250){return getAuthToken(_0x5465e4,_0x2c09e2,_0x2aa176)['then'](function(_0x52f485){var _0x1f9157={'method':_0x635a('0x17'),'uri':_0x3f1817+_0x635a('0x18'),'headers':{'Authorization':_0x635a('0x19')+_0x52f485,'OData-Version':'4.0'},'json':!![]};return rp(_0x1f9157);})[_0x635a('0x1a')](function(_0x48b0f4){var _0x51e442=_0x48b0f4['value'];var _0x424ce5=![];var _0x4af5ae=null;if(!_[_0x635a('0x1b')](_0x306d48)){if(intUtil['validateEmail'](_0x306d48['email'])){_0x55e480['userEmail']=_0x306d48[_0x635a('0x1c')];for(_0x4af5ae=0x0;_0x4af5ae<_0x51e442[_0x635a('0x1d')];_0x4af5ae++){if(_0x51e442[_0x4af5ae]['internalemailaddress']===_0x306d48['email']&&!_0x51e442[_0x4af5ae]['isdisabled']){_0x424ce5=!![];logger['info']('['+[_0x2aa176[_0x635a('0x14')]()]+_0x635a('0x1e')+_0x51e442[_0x4af5ae][_0x635a('0x1f')]+'!');_0x55e480['userId']=_0x51e442[_0x4af5ae][_0x635a('0x1f')];}}}}if(!_0x424ce5){logger[_0x635a('0x20')]('['+[_0x2aa176[_0x635a('0x14')]()]+_0x635a('0x21'));_0x55e480[_0x635a('0x22')]=_0x5465e4[_0x635a('0x23')];for(_0x4af5ae=0x0;_0x4af5ae<_0x51e442[_0x635a('0x1d')];_0x4af5ae++){if(_0x51e442[_0x4af5ae][_0x635a('0x24')]===_0x5465e4[_0x635a('0x23')]){_0x55e480[_0x635a('0x25')]=_0x51e442[_0x4af5ae]['systemuserid'];}}}_0x581ec0(_0x55e480);})[_0x635a('0x12')](function(_0x3c97f2){_0x2f4250(_0x3c97f2[_0x635a('0x16')]);});});}function createEndUser(_0x3cb2b4,_0x3bfb1f,_0x111abe,_0x23522b,_0x5c41bd,_0x7a457d){return new BPromise(function(_0x4f24a6,_0x40f45e){return getAuthToken(_0x3bfb1f,_0x111abe,_0x7a457d)['then'](function(_0x4d57c6){var _0x5d6ba2=_0x7a457d['toLowerCase']()===_0x635a('0x26')?_0x5c41bd['destcalleridnum']:_0x5c41bd[_0x635a('0x27')];var _0x350915={'method':'POST','uri':_0x23522b+_0x635a('0x28'),'body':{'telephone1':_0x5d6ba2,'fullname':_0x5d6ba2,'firstname':_0x5d6ba2,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x635a('0x29')+_0x3cb2b4[_0x635a('0x25')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x4d57c6,'OData-Version':_0x635a('0x2a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x350915);})[_0x635a('0x1a')](function(_0x367408){var _0x68814b=_0x367408[_0x635a('0x2b')][_0x635a('0x2c')];var _0x5dce14=_0x68814b[_0x635a('0x2d')](_0x68814b[_0x635a('0x2e')]('(')+0x1,_0x68814b[_0x635a('0x2e')](')'));_0x3cb2b4[_0x635a('0x2f')]=_0x5dce14;_0x4f24a6(_0x3cb2b4);})[_0x635a('0x12')](function(_0x36240b){_0x40f45e(_0x36240b[_0x635a('0x16')]);});});}function getEndUser(_0xad941b,_0x53dcee,_0x10bfc4,_0x306f9f,_0x356beb,_0x54aba2){return new BPromise(function(_0x1f6866,_0x30124e){return getAuthToken(_0x53dcee,_0x10bfc4,_0x54aba2)[_0x635a('0x1a')](function(_0x5d9d80){var _0x283764={'method':_0x635a('0x17'),'uri':_0x306f9f+_0x635a('0x30'),'headers':{'Authorization':'Bearer\x20'+_0x5d9d80,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x283764);})['then'](function(_0x13e82a){var _0x16fb5f=null;if(_0x13e82a){var _0x3de15f=_0x13e82a[_0x635a('0x31')];var _0x1fc059=![];for(_0x16fb5f=0x0;_0x16fb5f<_0x3de15f[_0x635a('0x1d')];_0x16fb5f++){var _0x5918df=_0x54aba2[_0x635a('0x32')]()===_0x635a('0x26')?_0x356beb[_0x635a('0x33')]:_0x356beb[_0x635a('0x27')];if(_0x3de15f[_0x16fb5f][_0x635a('0x34')]===_0x5918df){_0x1fc059=!![];_0xad941b[_0x635a('0x2f')]=_0x3de15f[_0x16fb5f][_0x635a('0x35')];}}if(_0x1fc059){_0x1f6866(_0xad941b);}else{return createEndUser(_0xad941b,_0x53dcee,_0x10bfc4,_0x306f9f,_0x356beb,_0x54aba2)[_0x635a('0x1a')](function(_0x5db8ca){logger['info']('['+[_0x54aba2[_0x635a('0x14')]()]+']\x20Enduser\x20created!',_0x5db8ca[_0x635a('0x2f')]);_0x1f6866(_0x5db8ca);});}}else{return createEndUser(_0xad941b,_0x53dcee,_0x10bfc4,_0x306f9f,_0x356beb,_0x54aba2)[_0x635a('0x1a')](function(_0x3d777f){logger['info']('['+[_0x54aba2[_0x635a('0x14')]()]+_0x635a('0x36'),_0x3d777f['enduserId']);_0x1f6866(_0x3d777f);});}});});}function getCustomFields(_0x4cf3b8,_0x2e69c3,_0xa307e7){var _0x5e291b={};if(_0x4cf3b8[_0x635a('0x1d')]>0x0){_[_0x635a('0x37')](_0x4cf3b8,function(_0x5dddf7){if(_0x5dddf7['type']===_0x635a('0x38')&&_0x5dddf7[_0x635a('0x39')]&&!_0x5dddf7[_0x635a('0x3a')]){var _0x53c3ce=_0x5dddf7[_0x635a('0x3b')][_0x635a('0x32')]();var _0x4103e5=_0x53c3ce[_0x635a('0x2d')](0x0,_0x53c3ce[_0x635a('0x3c')]('_'));var _0x26f764=_0x53c3ce[_0x635a('0x2d')](_0x53c3ce[_0x635a('0x3c')]('_')+0x1);if(_0x4103e5===_0xa307e7){_0x5e291b[_0x26f764]=_0x5dddf7[_0x635a('0x3d')];}}});}return _0x5e291b;}function getTicket(_0x5a1c29,_0x5b8be4,_0x3498f4,_0x3e77,_0x3536f1,_0x486f24,_0x9db2a7){return new BPromise(function(_0x3cc1fc,_0x4afde9){var _0x33459b;return getAuthToken(_0x5b8be4,_0x3498f4,_0x9db2a7)[_0x635a('0x1a')](function(_0x544290){if(_0x486f24[_0x635a('0x3e')]===_0x635a('0x3f')){_0x33459b={'method':'POST','uri':_0x3e77+_0x635a('0x40'),'body':Object[_0x635a('0x41')]({},{'title':intUtil[_0x635a('0x42')](_0x486f24[_0x635a('0x43')],_0x3536f1,'\x20'),'description':intUtil[_0x635a('0x42')](_0x486f24[_0x635a('0x44')],_0x3536f1,'\x0a'),'customerid_contact@odata.bind':_0x635a('0x45')+_0x5a1c29[_0x635a('0x2f')]+')','ownerid@odata.bind':_0x635a('0x29')+_0x5a1c29[_0x635a('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x486f24[_0x635a('0x46')],_0x3536f1,_0x486f24[_0x635a('0x3e')])),'headers':{'Authorization':_0x635a('0x19')+_0x544290,'OData-Version':_0x635a('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x486f24[_0x635a('0x3e')]===_0x635a('0x47')){_0x33459b={'method':'POST','uri':_0x3e77+_0x635a('0x48'),'body':Object[_0x635a('0x41')]({},{'subject':intUtil[_0x635a('0x42')](_0x486f24[_0x635a('0x43')],_0x3536f1,'\x20'),'phonenumber':String(_0x3536f1[_0x635a('0x27')]),'description':intUtil[_0x635a('0x42')](_0x486f24[_0x635a('0x44')],_0x3536f1,'\x0a'),'regardingobjectid_contact@odata.bind':_0x635a('0x45')+_0x5a1c29[_0x635a('0x2f')]+')','ownerid@odata.bind':_0x635a('0x29')+_0x5a1c29['userId']+')','directioncode':_0x5a1c29['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x635a('0x29')+_0x5a1c29[_0x635a('0x25')]+')','participationtypemask':_0x5a1c29[_0x635a('0x49')]===_0x635a('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x5a1c29['enduserId']+')','participationtypemask':_0x5a1c29[_0x635a('0x49')]===_0x635a('0x4a')?0x1:0x2}]},getCustomFields(_0x486f24['Fields'],_0x3536f1,_0x486f24['ticketType'])),'headers':{'Authorization':_0x635a('0x19')+_0x544290,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x33459b);})['then'](function(_0x53a611){var _0x1d9f73=_0x53a611[_0x635a('0x2b')][_0x635a('0x2c')];var _0x3fa34c=_0x1d9f73[_0x635a('0x2d')](_0x1d9f73[_0x635a('0x2e')]('(')+0x1,_0x1d9f73['lastIndexOf'](')'));_0x5a1c29[_0x635a('0x4b')]=_0x3fa34c;_0x3cc1fc(_0x5a1c29);})[_0x635a('0x12')](function(_0x1b3c80){_0x4afde9(_0x1b3c80[_0x635a('0x16')]);});});}function emit(_0xc56ad4,_0x560fdc,_0xbf9e3c,_0x4a1064){var _0x52e4d5={'uri':util[_0x635a('0x4c')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0xc56ad4,_0xbf9e3c,_0x4a1064)};io['to'](util[_0x635a('0x4c')]('user:%s',_0x560fdc))['emit'](_0x635a('0x4d'),_0x52e4d5);}exports['cs']=function(_0x52a628,_0x5087b8,_0x240358,_0x163bba,_0x5f09cf,_0x5fc862,_0x170ea2,_0x2c89a6){var _0x32c246={};_0x5fc862['remoteUri']=intUtil[_0x635a('0x4e')](_0x5fc862['remoteUri']);_0x5fc862[_0x635a('0x4f')]=intUtil['stripTrailingSlash'](_0x5fc862[_0x635a('0x4f')]);_0x32c246[_0x635a('0x49')]=_0x2c89a6==='queue'||_0x2c89a6===_0x635a('0x50')?_0x635a('0x4a'):'outbound';var _0x3459a2=util[_0x635a('0x4c')](_0x635a('0x51'),_0x5fc862['remoteUri']);var _0x5c722b=util['format'](_0x635a('0x52'),_0x5fc862[_0x635a('0x53')]);var _0x26ef34=util[_0x635a('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5fc862[_0x635a('0x4f')],_0x5087b8[_0x635a('0x54')],md5(_0x5087b8['uniqueid']));if(_0x5f09cf&&_0x5f09cf[_0x635a('0x55')]){logger[_0x635a('0x20')](_0x635a('0x56'),_0x635a('0x57'));_0x5087b8['recordingURL']=_0x26ef34;}else if(_0x170ea2&&_0x170ea2['recordingFormat']&&_0x170ea2[_0x635a('0x58')]!=='none'){logger[_0x635a('0x20')](_0x635a('0x59'),_0x635a('0x57'));_0x5087b8['recordingURL']=_0x26ef34;}else{_0x5087b8[_0x635a('0x5a')]='';}return getUser(_0x32c246,_0x5fc862,_0x163bba,_0x5c722b,_0x3459a2,_0x2c89a6)[_0x635a('0x1a')](function(_0x204dec){logger[_0x635a('0x20')]('['+_0x2c89a6['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x204dec[_0x635a('0x25')]);logger['info']('['+_0x2c89a6[_0x635a('0x14')]()+']\x20The\x20User\x20email\x20is:',_0x204dec[_0x635a('0x22')]);return getEndUser(_0x204dec,_0x5fc862,_0x5c722b,_0x3459a2,_0x5087b8,_0x2c89a6);})[_0x635a('0x1a')](function(_0x4479e3){logger[_0x635a('0x20')]('['+_0x2c89a6[_0x635a('0x14')]()+_0x635a('0x5b'),_0x4479e3[_0x635a('0x2f')]);logger['info']('['+_0x2c89a6[_0x635a('0x14')]()+_0x635a('0x5c'),_0x5087b8[_0x635a('0x27')]);return getTicket(_0x4479e3,_0x5fc862,_0x5c722b,_0x3459a2,_0x5087b8,_0x240358,_0x2c89a6);})['then'](function(_0x131c33){logger[_0x635a('0x20')](util[_0x635a('0x4c')]('['+_0x2c89a6[_0x635a('0x14')]()+_0x635a('0x5d'),_0x240358['ticketType'],_0x131c33[_0x635a('0x4b')]));logger[_0x635a('0x20')](util[_0x635a('0x4c')]('['+_0x2c89a6[_0x635a('0x14')]()+']\x20Call\x20direction:\x20%s',_0x2c89a6));if(_0x2c89a6!==_0x635a('0x50')){logger['info']('['+_0x2c89a6['toUpperCase']()+']',_0x635a('0x5e'));emit(_0x5fc862[_0x635a('0x5f')],_0x163bba[_0x635a('0x60')],_0x240358[_0x635a('0x3e')],_0x131c33[_0x635a('0x4b')]);}})[_0x635a('0x12')](function(_0x3657da){logger[_0x635a('0x13')]('['+_0x2c89a6['toUpperCase']()+_0x635a('0x61'),util['inspect'](_0x3657da,{'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 9436635..d58a644 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 _0xdd78=['base64','debug','[HTTP]','stringify','map','forEach','type','string','customField','nameField','toLowerCase','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','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','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','user:%s','abandoned','[ABANDONED]','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','%s/api/v2/tickets','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','find','email','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','apiKey','toString'];(function(_0x499d15,_0x5376c1){var _0x189291=function(_0x52884f){while(--_0x52884f){_0x499d15['push'](_0x499d15['shift']());}};_0x189291(++_0x5376c1);}(_0xdd78,0x139));var _0x8dd7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd78[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8dd7('0x0'));var rp=require(_0x8dd7('0x1'));var md5=require(_0x8dd7('0x2'));var util=require(_0x8dd7('0x3'));var Redis=require('ioredis');var intUtil=require(_0x8dd7('0x4'));var config=require(_0x8dd7('0x5'));var logger=require(_0x8dd7('0x6'))(_0x8dd7('0x7'));config['redis']=_[_0x8dd7('0x8')](config[_0x8dd7('0x9')],{'host':_0x8dd7('0xa'),'port':0x18eb});var io=require(_0x8dd7('0xb'))(new Redis(config[_0x8dd7('0x9')]));var headers={'Content-Type':'application/json','Accept':_0x8dd7('0xc')};function emit(_0x5e5f19,_0x1b49c6,_0x23c5fd){io['to'](_0x5e5f19)[_0x8dd7('0xd')](_0x1b49c6,_0x23c5fd);}function getTicket(_0x5e5d5a,_0x20f5ab,_0x5877ed,_0x16b7e5,_0xe76aa1){logger[_0x8dd7('0xe')](_0x8dd7('0xf'));var _0x497d8f=_[_0x8dd7('0x10')]({'responder_id':_0x20f5ab['id'],'requester_id':_0x5877ed['id'],'name':util[_0x8dd7('0x11')]('Caller\x20-\x20%s',_0xe76aa1[_0x8dd7('0x12')]),'phone':_0xe76aa1[_0x8dd7('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x8dd7('0x14')](_0x16b7e5[_0x8dd7('0x15')],_0xe76aa1,'\x20'),'description':intUtil[_0x8dd7('0x14')](_0x16b7e5[_0x8dd7('0x16')],_0xe76aa1,_0x8dd7('0x17')),'tags':getTags(_0x16b7e5['Tags'],_0x8dd7('0x18'))},getCustomFields(_0x16b7e5[_0x8dd7('0x19')],_0xe76aa1));_0x497d8f[_0x8dd7('0x1a')]=_[_0x8dd7('0x1b')](_['keyBy'](_0x497d8f[_0x8dd7('0x1a')],'id'),'value');return request({'uri':util[_0x8dd7('0x11')](_0x8dd7('0x1c'),_0x5e5d5a['remoteUri']),'method':'POST','body':_0x497d8f})['then'](function(_0x3a3b95){logger[_0x8dd7('0xe')](_0x8dd7('0x1d'));return _0x3a3b95;});}function getUser(_0x3dc306,_0x366ab3){if(intUtil[_0x8dd7('0x1e')](_0x366ab3)){return request({'uri':util[_0x8dd7('0x11')](_0x8dd7('0x1f'),_0x3dc306[_0x8dd7('0x20')]),'qs':{'email':_0x366ab3}})[_0x8dd7('0x21')](function(_0x3b90bd){if(_0x3b90bd[_0x8dd7('0x22')]){logger[_0x8dd7('0xe')](_0x8dd7('0x23'));return _[_0x8dd7('0x24')](_0x3b90bd,function(_0x19b6f8){return _0x19b6f8['contact'][_0x8dd7('0x25')]===_0x366ab3;});}else{logger[_0x8dd7('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8dd7('0x11')](_0x8dd7('0x26'),_0x3dc306[_0x8dd7('0x20')])})['then'](function(_0x7f5534){logger[_0x8dd7('0xe')]('Admin\x20account\x20selected.');return _0x7f5534;});}});}else{logger['info'](_0x8dd7('0x27'));return request({'uri':util[_0x8dd7('0x11')](_0x8dd7('0x26'),_0x3dc306[_0x8dd7('0x20')])})['then'](function(_0x480246){logger[_0x8dd7('0xe')](_0x8dd7('0x28'));return _0x480246;});}}function getEndUser(_0x45dff3,_0x291d9e,_0x34546f){logger[_0x8dd7('0xe')]('Searching\x20enduser\x20with\x20phone',_0x34546f);return request({'uri':util[_0x8dd7('0x11')](_0x8dd7('0x29'),_0x45dff3[_0x8dd7('0x20')]),'qs':{'phone':_0x34546f}})['then'](function(_0x3315aa){if(_0x3315aa[_0x8dd7('0x22')]){logger[_0x8dd7('0xe')]('Enduser\x20found!');return _['find'](_0x3315aa,{'phone':_0x34546f});}else{logger[_0x8dd7('0xe')](_0x8dd7('0x2a'));return request({'uri':util[_0x8dd7('0x11')]('%s/api/v2/contacts',_0x45dff3[_0x8dd7('0x20')]),'method':_0x8dd7('0x2b'),'body':{'name':_0x291d9e,'phone':_0x34546f}})[_0x8dd7('0x21')](function(_0x57b11c){logger[_0x8dd7('0xe')](_0x8dd7('0x2c'));return _0x57b11c;});}});}function getAuth(_0x2686eb){return util[_0x8dd7('0x11')]('Basic\x20%s',new Buffer(_0x2686eb[_0x8dd7('0x2d')]+':X')[_0x8dd7('0x2e')](_0x8dd7('0x2f')));}function request(_0x448908){logger[_0x8dd7('0x30')](_0x8dd7('0x31'),JSON[_0x8dd7('0x32')](_0x448908));return rp(_[_0x8dd7('0x8')](_0x448908,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1ea193,_0x45eff6){var _0x4996ae=[];if(_0x1ea193&&_0x1ea193[_0x8dd7('0x22')]>0x0){_0x4996ae=_[_0x8dd7('0x33')](_0x1ea193,_0x45eff6);}return _0x4996ae;}function getCustomFields(_0x4c514d,_0x4abde5){var _0x2a9667=[];var _0x56ff35={'custom_fields':[]};if(_0x4c514d[_0x8dd7('0x22')]>0x0){_[_0x8dd7('0x34')](_0x4c514d,function(_0x356362){if(_0x356362[_0x8dd7('0x35')]===_0x8dd7('0x36')&&_0x356362['nameField']&&!_0x356362[_0x8dd7('0x37')]){_0x56ff35[_0x356362[_0x8dd7('0x38')][_0x8dd7('0x39')]()]=_0x356362['content'][_0x8dd7('0x2e')]();}else if(_0x356362[_0x8dd7('0x35')]===_0x8dd7('0x36')&&_0x356362[_0x8dd7('0x3a')]&&_0x356362[_0x8dd7('0x37')]){_0x56ff35[_0x8dd7('0x1a')][_0x8dd7('0x3b')]({'id':_0x356362['idField'],'value':_0x356362['content']['toString']()});}else if(_0x356362['type']===_0x8dd7('0x3c')&&_0x356362[_0x8dd7('0x3d')]&&_0x356362[_0x8dd7('0x3a')]&&_0x356362[_0x8dd7('0x37')]){_0x4abde5[_0x356362['variableName']]&&_0x56ff35[_0x8dd7('0x1a')][_0x8dd7('0x3b')]({'id':_0x356362[_0x8dd7('0x3a')],'value':_0x4abde5[_0x356362[_0x8dd7('0x3d')]][_0x8dd7('0x2e')]()});}else if(_0x356362[_0x8dd7('0x35')]===_0x8dd7('0x3e')&&_0x356362[_0x8dd7('0x3f')]&&_0x356362[_0x8dd7('0x3f')]['name']&&_0x356362[_0x8dd7('0x3a')]&&_0x356362[_0x8dd7('0x37')]){_0x4abde5[_0x356362[_0x8dd7('0x3f')][_0x8dd7('0x18')]['toLowerCase']()]&&_0x56ff35[_0x8dd7('0x1a')][_0x8dd7('0x3b')]({'id':_0x356362['idField'],'value':_0x4abde5[_0x356362[_0x8dd7('0x3f')][_0x8dd7('0x18')][_0x8dd7('0x39')]()][_0x8dd7('0x2e')]()});}});}return _0x56ff35;}exports[_0x8dd7('0x40')]=function(_0x26a2b0,_0x864c4f,_0x5e728e,_0x1214e4,_0x295e8d,_0x22dd03){var _0x389b3c,_0xa19ecd;_0x22dd03[_0x8dd7('0x20')]=intUtil['stripTrailingSlash'](_0x22dd03[_0x8dd7('0x20')]);_0x22dd03['serverUrl']=intUtil[_0x8dd7('0x41')](_0x22dd03[_0x8dd7('0x42')]);if(_0x295e8d&&_0x295e8d[_0x8dd7('0x43')]){logger[_0x8dd7('0xe')](_0x8dd7('0x44'),_0x8dd7('0x45'));_0x864c4f[_0x8dd7('0x46')]=util[_0x8dd7('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x22dd03[_0x8dd7('0x42')],_0x864c4f[_0x8dd7('0x47')],md5(_0x864c4f[_0x8dd7('0x47')]));}else{_0x864c4f[_0x8dd7('0x46')]='';}headers[_0x8dd7('0x48')]=getAuth(_0x22dd03);return getUser(_0x22dd03,_0x1214e4['email'])[_0x8dd7('0x21')](function(_0x18c3c3){_0x389b3c=_0x18c3c3;logger[_0x8dd7('0xe')](_0x8dd7('0x49'),_0x389b3c['id']);return getEndUser(_0x22dd03,_0x864c4f[_0x8dd7('0x12')],_0x864c4f[_0x8dd7('0x13')]);})[_0x8dd7('0x21')](function(_0x395744){_0xa19ecd=_0x395744;logger[_0x8dd7('0xe')](_0x8dd7('0x4a'),_0xa19ecd['id']);return getTicket(_0x22dd03,_0x389b3c,_0xa19ecd,_0x5e728e,_0x864c4f);})['then'](function(_0x14d037){if(_0x14d037&&_0x14d037['id']){logger[_0x8dd7('0xe')](_0x8dd7('0x1d'));logger['info'](_0x8dd7('0x4b'),_0x14d037['id']);logger[_0x8dd7('0xe')]('[QUEUE]',_0x8dd7('0x4c'));emit(util[_0x8dd7('0x11')]('user:%s',_0x1214e4['name']),_0x8dd7('0x4d'),{'uri':util[_0x8dd7('0x11')](_0x8dd7('0x4e'),_0x22dd03['remoteUri'],_0x14d037['id'])});}})[_0x8dd7('0x4f')](function(_0x51a769){logger[_0x8dd7('0x50')]('[QUEUE]',JSON[_0x8dd7('0x32')](_0x51a769));});};exports[_0x8dd7('0x51')]=function(_0x333a27,_0x6e7cea,_0x2c8cab,_0x1c7541,_0x36a69c,_0x38323b,_0x266073){var _0x49837c,_0x22d757;_0x38323b[_0x8dd7('0x20')]=intUtil[_0x8dd7('0x41')](_0x38323b[_0x8dd7('0x20')]);_0x38323b[_0x8dd7('0x42')]=intUtil[_0x8dd7('0x41')](_0x38323b[_0x8dd7('0x42')]);if(_0x266073&&_0x266073['recordingFormat']&&_0x266073[_0x8dd7('0x52')]!==_0x8dd7('0x53')){logger[_0x8dd7('0xe')](_0x8dd7('0x54'),_0x8dd7('0x45'));_0x6e7cea[_0x8dd7('0x46')]=util[_0x8dd7('0x11')](_0x8dd7('0x55'),_0x38323b[_0x8dd7('0x42')],_0x6e7cea[_0x8dd7('0x47')],md5(_0x6e7cea[_0x8dd7('0x47')]));}headers[_0x8dd7('0x48')]=getAuth(_0x38323b);return getUser(_0x38323b,_0x1c7541[_0x8dd7('0x25')])[_0x8dd7('0x21')](function(_0x22f65e){_0x49837c=_0x22f65e;logger[_0x8dd7('0xe')](_0x8dd7('0x49'),_0x49837c['id']);return getEndUser(_0x38323b,_0x6e7cea['destcalleridname'],_0x6e7cea[_0x8dd7('0x56')]);})[_0x8dd7('0x21')](function(_0x282c06){_0x22d757=_0x282c06;logger[_0x8dd7('0xe')](_0x8dd7('0x4a'),_0x22d757['id']);return getTicket(_0x38323b,_0x49837c,_0x22d757,_0x2c8cab,_0x6e7cea);})[_0x8dd7('0x21')](function(_0x1b05ab){if(_0x1b05ab&&_0x1b05ab['id']){logger[_0x8dd7('0xe')](_0x8dd7('0x1d'));logger[_0x8dd7('0xe')]('The\x20Ticket\x20ID\x20is:',_0x1b05ab['id']);logger[_0x8dd7('0xe')]('[OUTBOUND]',_0x8dd7('0x4c'));emit(util['format'](_0x8dd7('0x57'),_0x1c7541['name']),_0x8dd7('0x4d'),{'uri':util[_0x8dd7('0x11')](_0x8dd7('0x4e'),_0x38323b[_0x8dd7('0x20')],_0x1b05ab['id'])});}})[_0x8dd7('0x4f')](function(_0x54bcda){logger[_0x8dd7('0x50')]('[OUTBOUND]',JSON[_0x8dd7('0x32')](_0x54bcda));});};exports[_0x8dd7('0x58')]=function(_0x55778f,_0x243a14,_0x18ce97,_0x95ba88,_0x3eab8d,_0xf69121){var _0x319e0b,_0x3fd280;_0xf69121[_0x8dd7('0x20')]=intUtil[_0x8dd7('0x41')](_0xf69121['remoteUri']);_0xf69121[_0x8dd7('0x42')]=intUtil[_0x8dd7('0x41')](_0xf69121['serverUrl']);if(_0x3eab8d&&_0x3eab8d[_0x8dd7('0x43')]){logger[_0x8dd7('0xe')]('[ABANDONED]',_0x8dd7('0x45'));_0x243a14[_0x8dd7('0x46')]=util[_0x8dd7('0x11')](_0x8dd7('0x55'),_0xf69121[_0x8dd7('0x42')],_0x243a14['uniqueid'],md5(_0x243a14['uniqueid']));}else{_0x243a14[_0x8dd7('0x46')]='';}headers[_0x8dd7('0x48')]=getAuth(_0xf69121);return getUser(_0xf69121,'')[_0x8dd7('0x21')](function(_0x4f763d){_0x319e0b=_0x4f763d;logger[_0x8dd7('0xe')](_0x8dd7('0x49'),_0x319e0b['id']);return getEndUser(_0xf69121,_0x243a14['calleridname'],_0x243a14[_0x8dd7('0x13')]);})[_0x8dd7('0x21')](function(_0x4e41c5){_0x3fd280=_0x4e41c5;logger[_0x8dd7('0xe')](_0x8dd7('0x4a'),_0x3fd280['id']);return getTicket(_0xf69121,_0x319e0b,_0x3fd280,_0x18ce97,_0x243a14);})[_0x8dd7('0x21')](function(_0xcbe1d7){if(_0xcbe1d7){logger[_0x8dd7('0xe')](_0x8dd7('0x1d'));logger[_0x8dd7('0xe')](_0x8dd7('0x4b'),_0xcbe1d7['id']);}})[_0x8dd7('0x4f')](function(_0x4eccfa){logger['error'](_0x8dd7('0x59'),JSON[_0x8dd7('0x32')](_0x4eccfa));});}; \ No newline at end of file +var _0x5218=['ioredis','./util','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','application/json','info','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','format','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','map','forEach','type','toLowerCase','content','toString','string','idField','customField','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridnum','[ABANDONED]','lodash','request-promise','util'];(function(_0x531c9b,_0x2b19b6){var _0x182336=function(_0x451fe6){while(--_0x451fe6){_0x531c9b['push'](_0x531c9b['shift']());}};_0x182336(++_0x2b19b6);}(_0x5218,0xa7));var _0x8521=function(_0x95f06,_0x371032){_0x95f06=_0x95f06-0x0;var _0x36aff0=_0x5218[_0x95f06];return _0x36aff0;};'use strict';var _=require(_0x8521('0x0'));var rp=require(_0x8521('0x1'));var md5=require('md5');var util=require(_0x8521('0x2'));var Redis=require(_0x8521('0x3'));var intUtil=require(_0x8521('0x4'));var config=require(_0x8521('0x5'));var logger=require(_0x8521('0x6'))('freshdesk');config['redis']=_['defaults'](config[_0x8521('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x8521('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0x8521('0x9'),'Accept':_0x8521('0x9')};function emit(_0x5a1adc,_0x22328d,_0x51be70){io['to'](_0x5a1adc)['emit'](_0x22328d,_0x51be70);}function getTicket(_0x214b14,_0x55a312,_0x1707c6,_0x297a64,_0x28a3fa){logger[_0x8521('0xa')]('Creating\x20new\x20ticket...');var _0x50d5e1=_['merge']({'responder_id':_0x55a312['id'],'requester_id':_0x1707c6['id'],'name':util['format'](_0x8521('0xb'),_0x28a3fa['calleridname']),'phone':_0x28a3fa[_0x8521('0xc')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x8521('0xd')](_0x297a64[_0x8521('0xe')],_0x28a3fa,'\x20'),'description':intUtil[_0x8521('0xd')](_0x297a64[_0x8521('0xf')],_0x28a3fa,_0x8521('0x10')),'tags':getTags(_0x297a64[_0x8521('0x11')],_0x8521('0x12'))},getCustomFields(_0x297a64[_0x8521('0x13')],_0x28a3fa));_0x50d5e1['custom_fields']=_[_0x8521('0x14')](_[_0x8521('0x15')](_0x50d5e1[_0x8521('0x16')],'id'),_0x8521('0x17'));return request({'uri':util['format'](_0x8521('0x18'),_0x214b14[_0x8521('0x19')]),'method':_0x8521('0x1a'),'body':_0x50d5e1})[_0x8521('0x1b')](function(_0x532a4d){logger['info'](_0x8521('0x1c'));return _0x532a4d;});}function getUser(_0x5c25f3,_0x170129){if(intUtil[_0x8521('0x1d')](_0x170129)){return request({'uri':util[_0x8521('0x1e')](_0x8521('0x1f'),_0x5c25f3[_0x8521('0x19')]),'qs':{'email':_0x170129}})['then'](function(_0xa46393){if(_0xa46393[_0x8521('0x20')]){logger[_0x8521('0xa')](_0x8521('0x21'));return _[_0x8521('0x22')](_0xa46393,function(_0x43b796){return _0x43b796[_0x8521('0x23')][_0x8521('0x24')]===_0x170129;});}else{logger[_0x8521('0xa')](_0x8521('0x25'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x5c25f3['remoteUri'])})[_0x8521('0x1b')](function(_0x42363b){logger['info']('Admin\x20account\x20selected.');return _0x42363b;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8521('0x1e')]('%s/api/v2/agents/me',_0x5c25f3[_0x8521('0x19')])})[_0x8521('0x1b')](function(_0x5eee15){logger[_0x8521('0xa')](_0x8521('0x26'));return _0x5eee15;});}}function getEndUser(_0xb20e6d,_0x4a57f2,_0x526c1b){logger[_0x8521('0xa')](_0x8521('0x27'),_0x526c1b);return request({'uri':util[_0x8521('0x1e')](_0x8521('0x28'),_0xb20e6d[_0x8521('0x19')]),'qs':{'phone':_0x526c1b}})['then'](function(_0x4f3793){if(_0x4f3793['length']){logger[_0x8521('0xa')](_0x8521('0x29'));return _[_0x8521('0x22')](_0x4f3793,{'phone':_0x526c1b});}else{logger[_0x8521('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x8521('0x1e')](_0x8521('0x28'),_0xb20e6d['remoteUri']),'method':_0x8521('0x1a'),'body':{'name':_0x4a57f2,'phone':_0x526c1b}})[_0x8521('0x1b')](function(_0x60a446){logger[_0x8521('0xa')]('Enduser\x20created.');return _0x60a446;});}});}function getAuth(_0x3f6be7){return util[_0x8521('0x1e')](_0x8521('0x2a'),new Buffer(_0x3f6be7[_0x8521('0x2b')]+':X')['toString'](_0x8521('0x2c')));}function request(_0xf650b5){logger[_0x8521('0x2d')](_0x8521('0x2e'),JSON[_0x8521('0x2f')](_0xf650b5));return rp(_['defaults'](_0xf650b5,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x268727,_0x229efc){var _0x573965=[];if(_0x268727&&_0x268727[_0x8521('0x20')]>0x0){_0x573965=_[_0x8521('0x30')](_0x268727,_0x229efc);}return _0x573965;}function getCustomFields(_0x2d3b84,_0x1814b5){var _0x26bab8=[];var _0x30449b={'custom_fields':[]};if(_0x2d3b84[_0x8521('0x20')]>0x0){_[_0x8521('0x31')](_0x2d3b84,function(_0x487c3c){if(_0x487c3c[_0x8521('0x32')]==='string'&&_0x487c3c['nameField']&&!_0x487c3c['customField']){_0x30449b[_0x487c3c['nameField'][_0x8521('0x33')]()]=_0x487c3c[_0x8521('0x34')][_0x8521('0x35')]();}else if(_0x487c3c[_0x8521('0x32')]===_0x8521('0x36')&&_0x487c3c[_0x8521('0x37')]&&_0x487c3c[_0x8521('0x38')]){_0x30449b[_0x8521('0x16')]['push']({'id':_0x487c3c[_0x8521('0x37')],'value':_0x487c3c[_0x8521('0x34')][_0x8521('0x35')]()});}else if(_0x487c3c[_0x8521('0x32')]===_0x8521('0x39')&&_0x487c3c[_0x8521('0x3a')]&&_0x487c3c[_0x8521('0x37')]&&_0x487c3c[_0x8521('0x38')]){_0x1814b5[_0x487c3c[_0x8521('0x3a')]]&&_0x30449b[_0x8521('0x16')][_0x8521('0x3b')]({'id':_0x487c3c['idField'],'value':_0x1814b5[_0x487c3c[_0x8521('0x3a')]][_0x8521('0x35')]()});}else if(_0x487c3c['type']===_0x8521('0x3c')&&_0x487c3c[_0x8521('0x3d')]&&_0x487c3c[_0x8521('0x3d')][_0x8521('0x12')]&&_0x487c3c[_0x8521('0x37')]&&_0x487c3c[_0x8521('0x38')]){_0x1814b5[_0x487c3c['Variable']['name'][_0x8521('0x33')]()]&&_0x30449b[_0x8521('0x16')][_0x8521('0x3b')]({'id':_0x487c3c[_0x8521('0x37')],'value':_0x1814b5[_0x487c3c['Variable'][_0x8521('0x12')][_0x8521('0x33')]()][_0x8521('0x35')]()});}});}return _0x30449b;}exports[_0x8521('0x3e')]=function(_0x132cfc,_0x57148d,_0x4f9bc1,_0x4e33f7,_0x45f414,_0x192a42){var _0x5d7093,_0x11ca3d;_0x192a42[_0x8521('0x19')]=intUtil[_0x8521('0x3f')](_0x192a42['remoteUri']);_0x192a42[_0x8521('0x40')]=intUtil[_0x8521('0x3f')](_0x192a42[_0x8521('0x40')]);if(_0x45f414&&_0x45f414[_0x8521('0x41')]){logger[_0x8521('0xa')](_0x8521('0x42'),_0x8521('0x43'));_0x57148d[_0x8521('0x44')]=util['format'](_0x8521('0x45'),_0x192a42[_0x8521('0x40')],_0x57148d[_0x8521('0x46')],md5(_0x57148d[_0x8521('0x46')]));}else{_0x57148d[_0x8521('0x44')]='';}headers[_0x8521('0x47')]=getAuth(_0x192a42);return getUser(_0x192a42,_0x4e33f7['email'])['then'](function(_0x2b7f77){_0x5d7093=_0x2b7f77;logger[_0x8521('0xa')](_0x8521('0x48'),_0x5d7093['id']);return getEndUser(_0x192a42,_0x57148d['calleridname'],_0x57148d[_0x8521('0xc')]);})[_0x8521('0x1b')](function(_0x235e95){_0x11ca3d=_0x235e95;logger[_0x8521('0xa')](_0x8521('0x49'),_0x11ca3d['id']);return getTicket(_0x192a42,_0x5d7093,_0x11ca3d,_0x4f9bc1,_0x57148d);})[_0x8521('0x1b')](function(_0x2b787e){if(_0x2b787e&&_0x2b787e['id']){logger[_0x8521('0xa')](_0x8521('0x1c'));logger['info'](_0x8521('0x4a'),_0x2b787e['id']);logger[_0x8521('0xa')](_0x8521('0x42'),_0x8521('0x4b'));emit(util[_0x8521('0x1e')](_0x8521('0x4c'),_0x4e33f7['name']),'trigger:browser:url',{'uri':util['format'](_0x8521('0x4d'),_0x192a42[_0x8521('0x19')],_0x2b787e['id'])});}})[_0x8521('0x4e')](function(_0x3536a4){logger[_0x8521('0x4f')](_0x8521('0x42'),JSON[_0x8521('0x2f')](_0x3536a4));});};exports['outbound']=function(_0x4942ce,_0x141408,_0xb6eef6,_0x466c5f,_0x2b26d7,_0xed18a1,_0x43f42c){var _0x30efa6,_0x150821;_0xed18a1[_0x8521('0x19')]=intUtil['stripTrailingSlash'](_0xed18a1[_0x8521('0x19')]);_0xed18a1[_0x8521('0x40')]=intUtil[_0x8521('0x3f')](_0xed18a1[_0x8521('0x40')]);if(_0x43f42c&&_0x43f42c['recordingFormat']&&_0x43f42c[_0x8521('0x50')]!==_0x8521('0x51')){logger['info'](_0x8521('0x52'),_0x8521('0x43'));_0x141408['recordingURL']=util[_0x8521('0x1e')](_0x8521('0x45'),_0xed18a1['serverUrl'],_0x141408[_0x8521('0x46')],md5(_0x141408[_0x8521('0x46')]));}headers[_0x8521('0x47')]=getAuth(_0xed18a1);return getUser(_0xed18a1,_0x466c5f['email'])[_0x8521('0x1b')](function(_0x566579){_0x30efa6=_0x566579;logger['info']('The\x20User\x20ID\x20is:',_0x30efa6['id']);return getEndUser(_0xed18a1,_0x141408['destcalleridname'],_0x141408[_0x8521('0x53')]);})['then'](function(_0x448090){_0x150821=_0x448090;logger[_0x8521('0xa')](_0x8521('0x49'),_0x150821['id']);return getTicket(_0xed18a1,_0x30efa6,_0x150821,_0xb6eef6,_0x141408);})['then'](function(_0x2dd18c){if(_0x2dd18c&&_0x2dd18c['id']){logger['info'](_0x8521('0x1c'));logger[_0x8521('0xa')]('The\x20Ticket\x20ID\x20is:',_0x2dd18c['id']);logger[_0x8521('0xa')](_0x8521('0x52'),_0x8521('0x4b'));emit(util['format'](_0x8521('0x4c'),_0x466c5f[_0x8521('0x12')]),'trigger:browser:url',{'uri':util[_0x8521('0x1e')](_0x8521('0x4d'),_0xed18a1['remoteUri'],_0x2dd18c['id'])});}})[_0x8521('0x4e')](function(_0x5b2cf6){logger[_0x8521('0x4f')](_0x8521('0x52'),JSON[_0x8521('0x2f')](_0x5b2cf6));});};exports['abandoned']=function(_0x5c2bd6,_0x28759b,_0x432dfe,_0x19aa4c,_0x8cf819,_0x23b5b0){var _0x492251,_0x1522d0;_0x23b5b0['remoteUri']=intUtil[_0x8521('0x3f')](_0x23b5b0[_0x8521('0x19')]);_0x23b5b0['serverUrl']=intUtil[_0x8521('0x3f')](_0x23b5b0[_0x8521('0x40')]);if(_0x8cf819&&_0x8cf819[_0x8521('0x41')]){logger[_0x8521('0xa')](_0x8521('0x54'),_0x8521('0x43'));_0x28759b[_0x8521('0x44')]=util[_0x8521('0x1e')](_0x8521('0x45'),_0x23b5b0[_0x8521('0x40')],_0x28759b[_0x8521('0x46')],md5(_0x28759b[_0x8521('0x46')]));}else{_0x28759b[_0x8521('0x44')]='';}headers[_0x8521('0x47')]=getAuth(_0x23b5b0);return getUser(_0x23b5b0,'')[_0x8521('0x1b')](function(_0x441b05){_0x492251=_0x441b05;logger[_0x8521('0xa')]('The\x20User\x20ID\x20is:',_0x492251['id']);return getEndUser(_0x23b5b0,_0x28759b['calleridname'],_0x28759b[_0x8521('0xc')]);})[_0x8521('0x1b')](function(_0x5e2b03){_0x1522d0=_0x5e2b03;logger[_0x8521('0xa')](_0x8521('0x49'),_0x1522d0['id']);return getTicket(_0x23b5b0,_0x492251,_0x1522d0,_0x432dfe,_0x28759b);})['then'](function(_0xcf42b){if(_0xcf42b){logger['info'](_0x8521('0x1c'));logger['info'](_0x8521('0x4a'),_0xcf42b['id']);}})[_0x8521('0x4e')](function(_0x29c722){logger['error']('[ABANDONED]',JSON['stringify'](_0x29c722));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 9ecbe8e..dd0dfb8 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4725=['util','moment','../../../../config/environment','../../../../config/logger','freshsales','redis','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','headers','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','message','Getting\x20contacts\x20filter','forEach','name','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','work_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl','remoteUri','outbound','destcalleridnum','calleridnum','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise'];(function(_0x1091a5,_0x4876b9){var _0x4fd999=function(_0x3915ee){while(--_0x3915ee){_0x1091a5['push'](_0x1091a5['shift']());}};_0x4fd999(++_0x4876b9);}(_0x4725,0x14a));var _0x5472=function(_0x524dae,_0x5a0edf){_0x524dae=_0x524dae-0x0;var _0x144a63=_0x4725[_0x524dae];return _0x144a63;};'use strict';var _=require(_0x5472('0x0'));var rp=require(_0x5472('0x1'));var md5=require('md5');var util=require(_0x5472('0x2'));var moment=require(_0x5472('0x3'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x5472('0x4'));var logger=require(_0x5472('0x5'))(_0x5472('0x6'));config[_0x5472('0x7')]=_['defaults'](config[_0x5472('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5472('0x8'))(new Redis(config['redis']));function getAdminId(_0x5b517e,_0x1bd6c0,_0x5b687d,_0x2b888e){return new Promise(function(_0x41aa99,_0x12d306){var _0x54afc0=![];var _0x4080a0={'method':_0x5472('0x9'),'uri':_0x2b888e+_0x5472('0xa'),'json':!![]};_0x4080a0['headers']=_0x5b687d;logger[_0x5472('0xb')](_0x5472('0xc'));return rp(_0x4080a0)[_0x5472('0xd')](function(_0x10926e){if(_0x10926e){var _0x192910=_0x10926e[_0x5472('0xe')];var _0x536855=null;for(_0x536855=0x0;_0x536855<_0x192910[_0x5472('0xf')];_0x536855++){if(_0x192910[_0x536855][_0x5472('0x10')]===_0x5b517e[_0x5472('0x11')]){_0x5b517e[_0x5472('0x12')]=_0x192910[_0x536855]['id'];_0x54afc0=!![];}}if(_0x54afc0){logger[_0x5472('0xb')](_0x5472('0x13'),_0x5b517e['adminId']);_0x41aa99(_0x5b517e);}else{_0x12d306({'statusCode':0x194,'message':_0x5472('0x14')});}}else{_0x12d306({'statusCode':0x194,'message':_0x5472('0x14')});}})[_0x5472('0x15')](function(_0x19f30d){logger[_0x5472('0x16')]('['+[_0x1bd6c0[_0x5472('0x17')]()]+']',_0x19f30d['message']);_0x12d306(_0x19f30d);});});}function getUser(_0x5c5020,_0x2fb323,_0x46be8b){return function(_0x3d7611){return new Promise(function(_0x3df1a6,_0x426320){var _0x52d8a0={'method':_0x5472('0x9'),'uri':_0x46be8b+_0x5472('0xa'),'json':!![]};_0x52d8a0[_0x5472('0x18')]=_0x2fb323;logger[_0x5472('0xb')]('Getting\x20user\x20list');return rp(_0x52d8a0)['then'](function(_0x331f96){if(_0x331f96){var _0xbbcb2d=_0x331f96[_0x5472('0xe')];var _0x2ff801=![];var _0x5823aa=null;if(_0x3d7611[_0x5472('0x19')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x3d7611['agentEmail']);_0x3d7611[_0x5472('0x1a')]=_0x3d7611[_0x5472('0x19')];for(_0x5823aa=0x0;_0x5823aa<_0xbbcb2d[_0x5472('0xf')];_0x5823aa++){if(_0xbbcb2d[_0x5823aa]['email']===_0x3d7611['agentEmail']){_0x2ff801=!![];_0x3d7611[_0x5472('0x1b')]=_0xbbcb2d[_0x5823aa]['id'];logger[_0x5472('0xb')](_0x5472('0x1c'),_0x3d7611[_0x5472('0x1b')]);}}}if(!_0x2ff801){logger[_0x5472('0xb')](_0x5472('0x1d'));_0x3d7611[_0x5472('0x1a')]=_0x3d7611[_0x5472('0x11')];_0x3d7611[_0x5472('0x1b')]=_0x3d7611['adminId'];_0x2ff801=!![];}if(_0x2ff801){_0x3df1a6(_0x3d7611);}else{_0x426320({'statusCode':0x194,'message':_0x5472('0x14')});}}else{_0x426320({'statusCode':0x194,'message':_0x5472('0x14')});}})[_0x5472('0x15')](function(_0x341c81){logger['error']('['+[_0x5c5020[_0x5472('0x17')]()]+']',_0x341c81[_0x5472('0x1e')]);_0x426320(_0x341c81);});});};}function getEndUser(_0xbe6ab9,_0x32474d,_0xe6abec){return function(_0x163698){return new Promise(function(_0x5285e6,_0x36bd80){var _0x2775a5=0x0;var _0x15c1f1={'method':_0x5472('0x9'),'uri':_0xe6abec+'/api/contacts/filters','json':!![]};_0x15c1f1[_0x5472('0x18')]=_0x32474d;logger['info'](_0x5472('0x1f'));return rp(_0x15c1f1)[_0x5472('0xd')](function(_0x4aabb3){_0x4aabb3['filters'][_0x5472('0x20')](function(_0x43517c){if(_0x43517c[_0x5472('0x21')]==='All\x20Contacts'){_0x2775a5=_0x43517c['id'];}});})['then'](function(){logger[_0x5472('0xb')](_0x5472('0x22'));var _0x1bbdf2={'method':_0x5472('0x9'),'uri':_0xe6abec+_0x5472('0x23')+_0x2775a5,'json':!![]};_0x1bbdf2[_0x5472('0x18')]=_0x32474d;return rp(_0x1bbdf2);})[_0x5472('0xd')](function(_0x4a3373){logger[_0x5472('0xb')](_0x5472('0x24'),_0x163698[_0x5472('0x25')]);if(_0x4a3373[_0x5472('0x26')][_0x5472('0xf')]>0x0){var _0x14dcfe=_['find'](_0x4a3373[_0x5472('0x26')],function(_0x120b8a){if(_0x120b8a[_0x5472('0x27')]===_0x163698[_0x5472('0x25')]||_0x120b8a['mobile_number']===_0x163698[_0x5472('0x25')]){return _0x120b8a;}});if(_0x14dcfe){_0x163698[_0x5472('0x28')]=_0x14dcfe['id'];logger[_0x5472('0xb')](_0x5472('0x29'),_0x163698[_0x5472('0x28')]);_0x5285e6(_0x163698);}else{return createEndUser(_0x163698,_0xbe6ab9,_0x32474d,_0xe6abec)['then'](function(_0x16d55a){logger[_0x5472('0xb')](_0x5472('0x2a'),_0x163698[_0x5472('0x28')]);_0x5285e6(_0x16d55a);});}}else{return createEndUser(_0x163698,_0xbe6ab9,_0x32474d,_0xe6abec)[_0x5472('0xd')](function(_0x33e725){logger[_0x5472('0xb')](_0x5472('0x2a'),_0x163698['endUserId']);_0x5285e6(_0x33e725);});}})[_0x5472('0x15')](function(_0x4e5acf){throw new Error(_0x4e5acf['message']);});});};}function createEndUser(_0x21a7fb,_0xe42790,_0x307dbb,_0x410af3){return new Promise(function(_0x2aae01,_0x112a18){var _0x1688e8=moment();var _0x32bbcd={'method':_0x5472('0x2b'),'uri':_0x410af3+_0x5472('0x2c'),'body':{'contact':{'last_name':_0x21a7fb[_0x5472('0x25')],'work_number':_0x21a7fb[_0x5472('0x25')],'mobile_number':_0x21a7fb['contactNumber'],'owner_id':_0x21a7fb['userId'],'created_at':_0x1688e8[_0x5472('0x2d')](_0x5472('0x2e'))}},'json':!![]};_0x32bbcd[_0x5472('0x18')]=_0x307dbb;logger[_0x5472('0xb')](_0x5472('0x2f'));return rp(_0x32bbcd)['then'](function(_0xb6cdeb){_0x21a7fb['endUserId']=_0xb6cdeb[_0x5472('0x30')]['id'];_0x2aae01(_0x21a7fb);})[_0x5472('0x15')](function(_0x4d3843){logger[_0x5472('0x16')]('['+[_0xe42790[_0x5472('0x17')]()]+']',_0x4d3843[_0x5472('0x1e')]);_0x112a18(_0x4d3843['message']);});});}function getTicket(_0x24446f,_0x301147,_0x1c3acb,_0x31b9fa,_0x50b3a7){return function(_0x33b5c4){logger['info'](_0x5472('0x31'));return new Promise(function(_0x4fd8cb,_0x296e14){var _0x20ec37=moment();var _0x4c1ca8={'method':_0x5472('0x2b'),'uri':_0x1c3acb+'/api/tasks','body':{'title':intUtil[_0x5472('0x32')](_0x31b9fa['Subjects'],_0x50b3a7,'\x20'),'description':intUtil['getString'](_0x31b9fa[_0x5472('0x33')],_0x50b3a7,'\x0a'),'owner_id':_0x33b5c4[_0x5472('0x1b')],'creater_id':_0x33b5c4[_0x5472('0x12')],'targetable_id':_0x33b5c4[_0x5472('0x28')],'targetable_type':_0x5472('0x34'),'created_at':_0x20ec37[_0x5472('0x2d')](_0x5472('0x2e')),'due_date':_0x20ec37[_0x5472('0x35')](0x1e,'m')['format'](_0x5472('0x2e'))},'json':!![]};_0x4c1ca8[_0x5472('0x18')]=_0x301147;return rp(_0x4c1ca8)['then'](function(_0x2ef850){_0x33b5c4[_0x5472('0x36')]=_0x2ef850[_0x5472('0x37')]['id'];logger[_0x5472('0xb')](_0x5472('0x38'),_0x33b5c4['ticketId']);_0x4fd8cb(_0x33b5c4);})[_0x5472('0x15')](function(_0x4a1cc9){logger['error']('['+[_0x24446f[_0x5472('0x17')]()]+']',_0x4a1cc9['message']);_0x296e14(_0x4a1cc9[_0x5472('0x1e')]);});});};}function emit(_0x35b645,_0x552854,_0x3f7833){var _0x41377e={'uri':_0x35b645+_0x5472('0x39')+_0x3f7833};io['to'](util['format'](_0x5472('0x3a'),_0x552854))[_0x5472('0x3b')](_0x5472('0x3c'),_0x41377e);}exports['cs']=function(_0x36ab23,_0x876f2c,_0xc14191,_0x542b57,_0x2e20a5,_0x1dcf69,_0x43d214,_0x3a2ccb){var _0x40b27c={};var _0x2eb225={'Authorization':_0x5472('0x3d')+_0x1dcf69[_0x5472('0x3e')]};_0x1dcf69['remoteUri']=intUtil[_0x5472('0x3f')](_0x1dcf69['remoteUri']);_0x1dcf69[_0x5472('0x40')]=intUtil['stripTrailingSlash'](_0x1dcf69['serverUrl']);var _0x3a0ea1=_0x1dcf69[_0x5472('0x41')];_0x40b27c['adminEmail']=_0x1dcf69['username'];_0x40b27c[_0x5472('0x25')]=_0x3a2ccb['toLowerCase']()===_0x5472('0x42')?_0x876f2c[_0x5472('0x43')]:_0x876f2c[_0x5472('0x44')];_0x40b27c[_0x5472('0x45')]=_0x3a2ccb===_0x5472('0x46')||_0x3a2ccb===_0x5472('0x47')?_0x5472('0x46'):_0x5472('0x42');if(_0x542b57){_0x40b27c['agentEmail']=_0x542b57[_0x5472('0x10')];}var _0x3f846c=util[_0x5472('0x2d')](_0x5472('0x48'),_0x1dcf69[_0x5472('0x40')],_0x876f2c[_0x5472('0x49')],md5(_0x876f2c[_0x5472('0x49')]));if(_0x2e20a5&&_0x2e20a5[_0x5472('0x4a')]){logger[_0x5472('0xb')]('[QUEUE]',_0x5472('0x4b'));_0x876f2c[_0x5472('0x4c')]=_0x3f846c;}else if(_0x43d214&&_0x43d214[_0x5472('0x4d')]&&_0x43d214[_0x5472('0x4d')]!==_0x5472('0x4e')){logger['info'](_0x5472('0x4f'),'Recording\x20is\x20enabled!');_0x876f2c[_0x5472('0x4c')]=_0x3f846c;}else{_0x876f2c[_0x5472('0x4c')]='';}return getAdminId(_0x40b27c,_0x3a2ccb,_0x2eb225,_0x3a0ea1)[_0x5472('0xd')](getUser(_0x3a2ccb,_0x2eb225,_0x3a0ea1))[_0x5472('0xd')](getEndUser(_0x3a2ccb,_0x2eb225,_0x3a0ea1))[_0x5472('0xd')](getTicket(_0x3a2ccb,_0x2eb225,_0x3a0ea1,_0xc14191,_0x876f2c))['then'](function(_0x26e262){logger[_0x5472('0xb')](util[_0x5472('0x2d')](_0x5472('0x50'),_0x26e262[_0x5472('0x36')]));if(_0x3a2ccb!=='abandoned'){logger['info']('['+[_0x3a2ccb['toUpperCase']()]+']',_0x5472('0x51'));emit(_0x3a0ea1,_0x542b57[_0x5472('0x21')],_0x26e262[_0x5472('0x28')]);}})[_0x5472('0x15')](function(_0x3904b1){logger[_0x5472('0x16')]('['+[_0x3a2ccb[_0x5472('0x17')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x5472('0x52')](_0x3904b1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xad77=['task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','toLowerCase','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','User\x20found:','userId','/api/contacts/filters','Getting\x20contacts\x20filter','filters','forEach','name','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','find','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','toUpperCase','POST','Subjects','getString','Contact','format','add','ticketId'];(function(_0x41d6fd,_0x1b580f){var _0x3764fb=function(_0x2afa62){while(--_0x2afa62){_0x41d6fd['push'](_0x41d6fd['shift']());}};_0x3764fb(++_0x1b580f);}(_0xad77,0x1bd));var _0x7ad7=function(_0x33190c,_0x483589){_0x33190c=_0x33190c-0x0;var _0x465647=_0xad77[_0x33190c];return _0x465647;};'use strict';var _=require(_0x7ad7('0x0'));var rp=require(_0x7ad7('0x1'));var md5=require('md5');var util=require(_0x7ad7('0x2'));var moment=require(_0x7ad7('0x3'));var Promise=require(_0x7ad7('0x4'));var Redis=require(_0x7ad7('0x5'));var intUtil=require(_0x7ad7('0x6'));var config=require(_0x7ad7('0x7'));var logger=require(_0x7ad7('0x8'))(_0x7ad7('0x9'));config['redis']=_[_0x7ad7('0xa')](config[_0x7ad7('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x7ad7('0xc'))(new Redis(config['redis']));function getAdminId(_0x2bb0a6,_0x3c4ae9,_0x4126a,_0x585109){return new Promise(function(_0x4b568a,_0x2ca730){var _0x2216c6=![];var _0x309234={'method':_0x7ad7('0xd'),'uri':_0x585109+'/api/selector/owners','json':!![]};_0x309234[_0x7ad7('0xe')]=_0x4126a;logger[_0x7ad7('0xf')](_0x7ad7('0x10'));return rp(_0x309234)[_0x7ad7('0x11')](function(_0x2a5e95){if(_0x2a5e95){var _0x270082=_0x2a5e95[_0x7ad7('0x12')];var _0x389b5f=null;for(_0x389b5f=0x0;_0x389b5f<_0x270082['length'];_0x389b5f++){if(_0x270082[_0x389b5f][_0x7ad7('0x13')]===_0x2bb0a6[_0x7ad7('0x14')]){_0x2bb0a6[_0x7ad7('0x15')]=_0x270082[_0x389b5f]['id'];_0x2216c6=!![];}}if(_0x2216c6){logger[_0x7ad7('0xf')](_0x7ad7('0x16'),_0x2bb0a6[_0x7ad7('0x15')]);_0x4b568a(_0x2bb0a6);}else{_0x2ca730({'statusCode':0x194,'message':_0x7ad7('0x17')});}}else{_0x2ca730({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x7ad7('0x18')](function(_0x3b453e){logger[_0x7ad7('0x19')]('['+[_0x3c4ae9['toUpperCase']()]+']',_0x3b453e[_0x7ad7('0x1a')]);_0x2ca730(_0x3b453e);});});}function getUser(_0x218f13,_0x4d40fe,_0x58c9da){return function(_0x103c1c){return new Promise(function(_0x24f21e,_0x1b7119){var _0x450116={'method':_0x7ad7('0xd'),'uri':_0x58c9da+_0x7ad7('0x1b'),'json':!![]};_0x450116[_0x7ad7('0xe')]=_0x4d40fe;logger[_0x7ad7('0xf')](_0x7ad7('0x1c'));return rp(_0x450116)['then'](function(_0x477762){if(_0x477762){var _0x566b0c=_0x477762['users'];var _0x1f1fa0=![];var _0x93c374=null;if(_0x103c1c[_0x7ad7('0x1d')]!==null){logger[_0x7ad7('0xf')](_0x7ad7('0x1e'),_0x103c1c[_0x7ad7('0x1d')]);_0x103c1c[_0x7ad7('0x1f')]=_0x103c1c[_0x7ad7('0x1d')];for(_0x93c374=0x0;_0x93c374<_0x566b0c[_0x7ad7('0x20')];_0x93c374++){if(_0x566b0c[_0x93c374][_0x7ad7('0x13')]===_0x103c1c[_0x7ad7('0x1d')]){_0x1f1fa0=!![];_0x103c1c['userId']=_0x566b0c[_0x93c374]['id'];logger[_0x7ad7('0xf')](_0x7ad7('0x21'),_0x103c1c[_0x7ad7('0x22')]);}}}if(!_0x1f1fa0){logger[_0x7ad7('0xf')]('Admin\x20selected');_0x103c1c[_0x7ad7('0x1f')]=_0x103c1c[_0x7ad7('0x14')];_0x103c1c[_0x7ad7('0x22')]=_0x103c1c[_0x7ad7('0x15')];_0x1f1fa0=!![];}if(_0x1f1fa0){_0x24f21e(_0x103c1c);}else{_0x1b7119({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1b7119({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x7ad7('0x18')](function(_0x149974){logger[_0x7ad7('0x19')]('['+[_0x218f13['toUpperCase']()]+']',_0x149974[_0x7ad7('0x1a')]);_0x1b7119(_0x149974);});});};}function getEndUser(_0x264c30,_0x67091b,_0x38fd77){return function(_0x26c387){return new Promise(function(_0x26cc03,_0x5c1468){var _0x40a5e5=0x0;var _0x584677={'method':'GET','uri':_0x38fd77+_0x7ad7('0x23'),'json':!![]};_0x584677[_0x7ad7('0xe')]=_0x67091b;logger['info'](_0x7ad7('0x24'));return rp(_0x584677)['then'](function(_0x408d15){_0x408d15[_0x7ad7('0x25')][_0x7ad7('0x26')](function(_0x56d080){if(_0x56d080[_0x7ad7('0x27')]==='All\x20Contacts'){_0x40a5e5=_0x56d080['id'];}});})[_0x7ad7('0x11')](function(){logger['info']('Getting\x20contact\x20list');var _0x4b14b1={'method':_0x7ad7('0xd'),'uri':_0x38fd77+_0x7ad7('0x28')+_0x40a5e5,'json':!![]};_0x4b14b1['headers']=_0x67091b;return rp(_0x4b14b1);})[_0x7ad7('0x11')](function(_0x18177c){logger[_0x7ad7('0xf')](_0x7ad7('0x29'),_0x26c387[_0x7ad7('0x2a')]);if(_0x18177c[_0x7ad7('0x2b')][_0x7ad7('0x20')]>0x0){var _0x3e5ada=_[_0x7ad7('0x2c')](_0x18177c[_0x7ad7('0x2b')],function(_0x157fdb){if(_0x157fdb['work_number']===_0x26c387['contactNumber']||_0x157fdb[_0x7ad7('0x2d')]===_0x26c387[_0x7ad7('0x2a')]){return _0x157fdb;}});if(_0x3e5ada){_0x26c387[_0x7ad7('0x2e')]=_0x3e5ada['id'];logger[_0x7ad7('0xf')](_0x7ad7('0x2f'),_0x26c387[_0x7ad7('0x2e')]);_0x26cc03(_0x26c387);}else{return createEndUser(_0x26c387,_0x264c30,_0x67091b,_0x38fd77)[_0x7ad7('0x11')](function(_0x270a5b){logger[_0x7ad7('0xf')](_0x7ad7('0x30'),_0x26c387[_0x7ad7('0x2e')]);_0x26cc03(_0x270a5b);});}}else{return createEndUser(_0x26c387,_0x264c30,_0x67091b,_0x38fd77)['then'](function(_0x30e3df){logger['info'](_0x7ad7('0x30'),_0x26c387[_0x7ad7('0x2e')]);_0x26cc03(_0x30e3df);});}})[_0x7ad7('0x18')](function(_0x4bb31c){throw new Error(_0x4bb31c[_0x7ad7('0x1a')]);});});};}function createEndUser(_0xdf8538,_0x759d16,_0x1db8e3,_0x47b997){return new Promise(function(_0x45b100,_0xb5d1c3){var _0x333940=moment();var _0x2348a3={'method':'POST','uri':_0x47b997+'/api/contacts','body':{'contact':{'last_name':_0xdf8538[_0x7ad7('0x2a')],'work_number':_0xdf8538['contactNumber'],'mobile_number':_0xdf8538[_0x7ad7('0x2a')],'owner_id':_0xdf8538[_0x7ad7('0x22')],'created_at':_0x333940['format'](_0x7ad7('0x31'))}},'json':!![]};_0x2348a3[_0x7ad7('0xe')]=_0x1db8e3;logger[_0x7ad7('0xf')](_0x7ad7('0x32'));return rp(_0x2348a3)['then'](function(_0x41db94){_0xdf8538['endUserId']=_0x41db94['contact']['id'];_0x45b100(_0xdf8538);})[_0x7ad7('0x18')](function(_0x83501f){logger[_0x7ad7('0x19')]('['+[_0x759d16[_0x7ad7('0x33')]()]+']',_0x83501f[_0x7ad7('0x1a')]);_0xb5d1c3(_0x83501f[_0x7ad7('0x1a')]);});});}function getTicket(_0x3ceaf8,_0x5b7e67,_0x26fdb8,_0x58f370,_0x49f6f0){return function(_0x5c39a3){logger[_0x7ad7('0xf')]('Creating\x20new\x20task');return new Promise(function(_0x417272,_0x4d988b){var _0x21374a=moment();var _0x2c44b4={'method':_0x7ad7('0x34'),'uri':_0x26fdb8+'/api/tasks','body':{'title':intUtil['getString'](_0x58f370[_0x7ad7('0x35')],_0x49f6f0,'\x20'),'description':intUtil[_0x7ad7('0x36')](_0x58f370['Descriptions'],_0x49f6f0,'\x0a'),'owner_id':_0x5c39a3[_0x7ad7('0x22')],'creater_id':_0x5c39a3['adminId'],'targetable_id':_0x5c39a3[_0x7ad7('0x2e')],'targetable_type':_0x7ad7('0x37'),'created_at':_0x21374a[_0x7ad7('0x38')](_0x7ad7('0x31')),'due_date':_0x21374a[_0x7ad7('0x39')](0x1e,'m')[_0x7ad7('0x38')](_0x7ad7('0x31'))},'json':!![]};_0x2c44b4[_0x7ad7('0xe')]=_0x5b7e67;return rp(_0x2c44b4)[_0x7ad7('0x11')](function(_0x3943bf){_0x5c39a3[_0x7ad7('0x3a')]=_0x3943bf[_0x7ad7('0x3b')]['id'];logger['info'](_0x7ad7('0x3c'),_0x5c39a3['ticketId']);_0x417272(_0x5c39a3);})['catch'](function(_0x8acacf){logger[_0x7ad7('0x19')]('['+[_0x3ceaf8['toUpperCase']()]+']',_0x8acacf[_0x7ad7('0x1a')]);_0x4d988b(_0x8acacf[_0x7ad7('0x1a')]);});});};}function emit(_0x52de1e,_0x388178,_0x3aa405){var _0x5b9942={'uri':_0x52de1e+_0x7ad7('0x3d')+_0x3aa405};io['to'](util[_0x7ad7('0x38')](_0x7ad7('0x3e'),_0x388178))[_0x7ad7('0x3f')]('trigger:browser:url',_0x5b9942);}exports['cs']=function(_0x2159ba,_0x100085,_0x314633,_0x472be9,_0x449def,_0xa18150,_0x46aa20,_0x34b22a){var _0x1c5145={};var _0x46174d={'Authorization':_0x7ad7('0x40')+_0xa18150[_0x7ad7('0x41')]};_0xa18150[_0x7ad7('0x42')]=intUtil['stripTrailingSlash'](_0xa18150['remoteUri']);_0xa18150[_0x7ad7('0x43')]=intUtil[_0x7ad7('0x44')](_0xa18150['serverUrl']);var _0x416d70=_0xa18150[_0x7ad7('0x42')];_0x1c5145[_0x7ad7('0x14')]=_0xa18150['username'];_0x1c5145[_0x7ad7('0x2a')]=_0x34b22a[_0x7ad7('0x45')]()==='outbound'?_0x100085['destcalleridnum']:_0x100085['calleridnum'];_0x1c5145[_0x7ad7('0x46')]=_0x34b22a===_0x7ad7('0x47')||_0x34b22a===_0x7ad7('0x48')?_0x7ad7('0x47'):'outbound';if(_0x472be9){_0x1c5145[_0x7ad7('0x1d')]=_0x472be9[_0x7ad7('0x13')];}var _0x562f2d=util[_0x7ad7('0x38')](_0x7ad7('0x49'),_0xa18150[_0x7ad7('0x43')],_0x100085[_0x7ad7('0x4a')],md5(_0x100085[_0x7ad7('0x4a')]));if(_0x449def&&_0x449def[_0x7ad7('0x4b')]){logger[_0x7ad7('0xf')](_0x7ad7('0x4c'),'Recording\x20is\x20enabled!');_0x100085['recordingURL']=_0x562f2d;}else if(_0x46aa20&&_0x46aa20[_0x7ad7('0x4d')]&&_0x46aa20['recordingFormat']!==_0x7ad7('0x4e')){logger[_0x7ad7('0xf')](_0x7ad7('0x4f'),_0x7ad7('0x50'));_0x100085[_0x7ad7('0x51')]=_0x562f2d;}else{_0x100085['recordingURL']='';}return getAdminId(_0x1c5145,_0x34b22a,_0x46174d,_0x416d70)[_0x7ad7('0x11')](getUser(_0x34b22a,_0x46174d,_0x416d70))['then'](getEndUser(_0x34b22a,_0x46174d,_0x416d70))['then'](getTicket(_0x34b22a,_0x46174d,_0x416d70,_0x314633,_0x100085))['then'](function(_0x3ad78d){logger[_0x7ad7('0xf')](util[_0x7ad7('0x38')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3ad78d[_0x7ad7('0x3a')]));if(_0x34b22a!==_0x7ad7('0x48')){logger[_0x7ad7('0xf')]('['+[_0x34b22a['toUpperCase']()]+']',_0x7ad7('0x52'));emit(_0x416d70,_0x472be9[_0x7ad7('0x27')],_0x3ad78d[_0x7ad7('0x2e')]);}})[_0x7ad7('0x18')](function(_0x37c94d){logger[_0x7ad7('0x19')]('['+[_0x34b22a[_0x7ad7('0x33')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x7ad7('0x53')](_0x37c94d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index e090cd8..2ecbc6e 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 _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x13028f,_0x16a2b9){var _0x313172=function(_0x4d926d){while(--_0x4d926d){_0x13028f['push'](_0x13028f['shift']());}};_0x313172(++_0x16a2b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file +var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x4b247d,_0x3679d9){var _0x41039f=function(_0x11921e){while(--_0x11921e){_0x4b247d['push'](_0x4b247d['shift']());}};_0x41039f(++_0x3679d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ 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 ded5169..8ab361f 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 _0xa6bb=['concat','clientId','clientSecret','username','Connection\x20established.','serverUrl','remoteUri','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','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','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','calleridnum','lodash','request-promise','moment','bluebird','jsforce','util','ioredis','../../../../config/logger','salesforce','redis','defaults','emit','ticketType','Task','assign','utc','Subjects','getString','Descriptions','WhoId','Case','create','isNil','sobject','User','find','execute','info','Agent\x20%s\x20found.','resolve','Name','then','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','moduleSearch','contact_lead','Contact','Lead','contact','lead','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','length','Phone','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','No\x20Company','upperFirst','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa6bb,0xff));var _0xba6b=function(_0x5c83fc,_0x54e7d3){_0x5c83fc=_0x5c83fc-0x0;var _0x5a6e72=_0xa6bb[_0x5c83fc];return _0x5a6e72;};'use strict';var _=require(_0xba6b('0x0'));var rp=require(_0xba6b('0x1'));var moment=require(_0xba6b('0x2'));var BPromise=require(_0xba6b('0x3'));var md5=require('md5');var jsforce=require(_0xba6b('0x4'));var util=require(_0xba6b('0x5'));var Redis=require(_0xba6b('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xba6b('0x7'))(_0xba6b('0x8'));config[_0xba6b('0x9')]=_[_0xba6b('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xba6b('0x9')]));function emit(_0x11428c,_0x386125,_0x4bf6e6){io['to'](_0x11428c)[_0xba6b('0xb')](_0x386125,_0x4bf6e6);}function getTicket(_0x9b76bc,_0xda98c3,_0x4e9a3d,_0x5062ba,_0x120f6d,_0xa5e535,_0x38f22f,_0x411948){var _0x382daa={};if(_0x5062ba[_0xba6b('0xc')]===_0xba6b('0xd')){_0x382daa=Object[_0xba6b('0xe')]({},{'OwnerId':_0xda98c3['id'],'ActivityDate':moment[_0xba6b('0xf')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x5062ba[_0xba6b('0x10')],_0x120f6d,'\x20'),'Description':intUtil[_0xba6b('0x11')](_0x5062ba[_0xba6b('0x12')],_0x120f6d,'\x0a')},getCustomFields(_0xa5e535,_0x120f6d));if(_0x4e9a3d){_0x382daa[_0xba6b('0x13')]=_0x4e9a3d['id'];}}else if(_0x5062ba[_0xba6b('0xc')]===_0xba6b('0x14')){_0x382daa=Object['assign']({},{'OwnerId':_0xda98c3['id'],'Subject':intUtil['getString'](_0x5062ba['Subjects'],_0x120f6d,'\x20'),'Description':intUtil[_0xba6b('0x11')](_0x5062ba[_0xba6b('0x12')],_0x120f6d,'\x0a')},getCustomFields(_0xa5e535,_0x120f6d));if(_0x4e9a3d){_0x382daa['ContactId']=_0x4e9a3d['id'];}}return _0x38f22f['sobject'](_0x5062ba[_0xba6b('0xc')])[_0xba6b('0x15')](_0x382daa);}function getUser(_0x588407,_0xdc5685,_0x9211a6){if(!_[_0xba6b('0x16')](_0xdc5685)&&intUtil['validateEmail'](_0xdc5685)){var _0x4f211b={'Email':_0xdc5685};var _0x4cdea3={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x9211a6[_0xba6b('0x17')](_0xba6b('0x18'))[_0xba6b('0x19')](_0x4f211b,_0x4cdea3)[_0xba6b('0x1a')]()['then'](function(_0x5ca40e){if(_0x5ca40e['length']){var _0x15365e=_[_0xba6b('0x19')](_0x5ca40e,function(_0x3cb57d){return _0x3cb57d['Email']===_0xdc5685;});if(_0x15365e){logger[_0xba6b('0x1b')](_0xba6b('0x1c'),_0xdc5685);return BPromise[_0xba6b('0x1d')]({'id':_0x15365e['Id'],'name':_0x15365e[_0xba6b('0x1e')]});}}else{logger[_0xba6b('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xdc5685);return _0x9211a6['identity']()[_0xba6b('0x1f')](function(_0x5e7e6a){return BPromise['resolve']({'id':_0x5e7e6a[_0xba6b('0x20')],'name':_0x5e7e6a[_0xba6b('0x21')]});});}});}else{logger[_0xba6b('0x1b')](_0xba6b('0x22'),_0xdc5685);return _0x9211a6[_0xba6b('0x23')]()[_0xba6b('0x1f')](function(_0xbc26da){return BPromise[_0xba6b('0x1d')]({'id':_0xbc26da['user_id'],'name':_0xbc26da[_0xba6b('0x21')]});});}}function getEndUser(_0x9a2d79,_0x49756a,_0x9202e2,_0x207fb4,_0x36fbb6){var _0x549a68={'Phone':_0x207fb4};var _0x218093={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xba6b('0x1f')](function(){if(_0x49756a['ticketType']===_0xba6b('0xd')){logger[_0xba6b('0x1b')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x207fb4,_0x49756a[_0xba6b('0x24')]);switch(_0x49756a[_0xba6b('0x24')]){case _0xba6b('0x25'):return _0x36fbb6['sobject'](_0xba6b('0x26'))[_0xba6b('0x19')](_0x549a68,_0x218093)['execute']()[_0xba6b('0x1f')](function(_0x44805e){if(_0x44805e&&_0x44805e['length']){return _0x44805e;}else{return _0x36fbb6[_0xba6b('0x17')](_0xba6b('0x27'))['find'](_0x549a68,_0x218093);}});case _0xba6b('0x28'):return _0x36fbb6[_0xba6b('0x17')](_0xba6b('0x26'))[_0xba6b('0x19')](_0x549a68,_0x218093)[_0xba6b('0x1a')]();case _0xba6b('0x29'):return _0x36fbb6[_0xba6b('0x17')](_0xba6b('0x27'))[_0xba6b('0x19')](_0x549a68,_0x218093);default:return null;}}else if(_0x49756a[_0xba6b('0xc')]===_0xba6b('0x14')){logger[_0xba6b('0x1b')](_0xba6b('0x2a'),_0x207fb4,'contact');return _0x36fbb6[_0xba6b('0x17')](_0xba6b('0x26'))[_0xba6b('0x19')](_0x549a68,_0x218093)[_0xba6b('0x1a')]();}})[_0xba6b('0x1f')](function(_0x10b842){if(_0x10b842&&_0x10b842[_0xba6b('0x2b')]){var _0x1670d7=_[_0xba6b('0x19')](_0x10b842,function(_0xc7920a){return _0xc7920a['Phone']===_0x207fb4;});if(_0x1670d7){return BPromise['resolve']({'id':_0x1670d7['Id'],'name':_0x1670d7[_0xba6b('0x1e')],'phone':_0x1670d7[_0xba6b('0x2c')]});}}})[_0xba6b('0x1f')](function(_0x3494bf){if(_0x3494bf){logger['info']('Enduser\x20with\x20phone\x20%s\x20found.',_0x207fb4);return BPromise[_0xba6b('0x1d')](_0x3494bf);}else{logger[_0xba6b('0x1b')](_0xba6b('0x2d'),_0x207fb4);var _0x43eb40={'LastName':_0x9202e2!==_0xba6b('0x2e')?_0x9202e2:util[_0xba6b('0x2f')](_0xba6b('0x30'),_0x207fb4),'Phone':_0x207fb4};if(_0x49756a[_0xba6b('0x31')]){if(_0x49756a['moduleCreate']===_0xba6b('0x28')){logger[_0xba6b('0x1b')](_0xba6b('0x32'),_0x207fb4,_0x49756a[_0xba6b('0x31')]);}else if(_0x49756a[_0xba6b('0x31')]==='lead'&&_0x49756a['ticketType']==='Task'){logger[_0xba6b('0x1b')](_0xba6b('0x32'),_0x207fb4,_0x49756a[_0xba6b('0x31')]);_0x43eb40['Company']=_0xba6b('0x33');}else{return null;}}return _0x36fbb6['sobject'](_[_0xba6b('0x34')](_0x49756a[_0xba6b('0x31')]))['create'](_0x43eb40);}});}function getCustomFields(_0x4bc3f2,_0x45802a){var _0x328ee4={};if(_0x4bc3f2['length']>0x0){_[_0xba6b('0x35')](_0x4bc3f2,function(_0x11e595){if(_0x11e595[_0xba6b('0x36')]===_0xba6b('0x37')&&_0x11e595[_0xba6b('0x38')]){_0x328ee4[_0x11e595[_0xba6b('0x38')]]=_0x11e595[_0xba6b('0x39')][_0xba6b('0x3a')]();}else if(_0x11e595[_0xba6b('0x36')]===_0xba6b('0x3b')&&_0x11e595[_0xba6b('0x3c')]&&_0x11e595[_0xba6b('0x38')]){_0x45802a[_0x11e595[_0xba6b('0x3c')]]&&(_0x328ee4[_0x11e595[_0xba6b('0x38')]]=_0x45802a[_0x11e595['variableName']][_0xba6b('0x3a')]());}else if(_0x11e595[_0xba6b('0x36')]===_0xba6b('0x3d')&&_0x11e595[_0xba6b('0x3e')]&&_0x11e595[_0xba6b('0x3e')][_0xba6b('0x3f')]&&_0x11e595[_0xba6b('0x38')]){_0x45802a[_0x11e595['Variable'][_0xba6b('0x3f')][_0xba6b('0x40')]()]&&(_0x328ee4[_0x11e595[_0xba6b('0x38')]]=_0x45802a[_0x11e595[_0xba6b('0x3e')][_0xba6b('0x3f')]['toLowerCase']()][_0xba6b('0x3a')]());}});}return _0x328ee4;}function getConnection(_0x2ca773){var _0x4646be=_0x2ca773[_0xba6b('0x41')][_0xba6b('0x42')](_0x2ca773['securityToken']);var _0x50c2db=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2ca773['remoteUri']||'https://login.salesforce.com','clientId':_0x2ca773[_0xba6b('0x43')],'clientSecret':_0x2ca773[_0xba6b('0x44')]}});return _0x50c2db['login'](_0x2ca773[_0xba6b('0x45')],_0x4646be)[_0xba6b('0x1f')](function(){logger[_0xba6b('0x1b')](_0xba6b('0x46'));return _0x50c2db;});}exports['queue']=function(_0x50dc86,_0x1555b5,_0xe2a5ef,_0x2a534e,_0x7d4a9f,_0x10b604){var _0x54e6f7,_0x47bf6c,_0x125891,_0xd517f9;_0x10b604[_0xba6b('0x47')]=intUtil['stripTrailingSlash'](_0x10b604['serverUrl']);_0x10b604[_0xba6b('0x48')]=intUtil[_0xba6b('0x49')](_0x10b604[_0xba6b('0x48')]);if(_0x7d4a9f&&_0x7d4a9f[_0xba6b('0x4a')]){logger[_0xba6b('0x1b')](_0xba6b('0x4b'),_0xba6b('0x4c'));_0x1555b5['recordingURL']=util[_0xba6b('0x2f')](_0xba6b('0x4d'),_0x10b604[_0xba6b('0x47')],_0x1555b5[_0xba6b('0x4e')],md5(_0x1555b5[_0xba6b('0x4e')]));}else{_0x1555b5[_0xba6b('0x4f')]='';}return getConnection(_0x10b604)[_0xba6b('0x1f')](function(_0x58c8e0){_0xd517f9=_0x58c8e0;return getUser(_0x10b604,_0x2a534e[_0xba6b('0x50')],_0xd517f9);})[_0xba6b('0x1f')](function(_0x251d10){_0x54e6f7=_0x251d10;return getEndUser(_0x10b604,_0xe2a5ef,_0x1555b5[_0xba6b('0x51')],_0x1555b5['calleridnum'],_0xd517f9);})[_0xba6b('0x1f')](function(_0x1c5971){_0x47bf6c=_0x1c5971;return getTicket(_0x10b604,_0x54e6f7,_0x47bf6c,_0xe2a5ef,_0x1555b5,_0xe2a5ef[_0xba6b('0x52')],_0xd517f9,_0xba6b('0x53'));})['then'](function(_0x27aa29){_0x125891=_0x27aa29;logger[_0xba6b('0x1b')](_0xba6b('0x54'),_0x125891['id']);logger[_0xba6b('0x1b')](_0xba6b('0x55'),_0x125891['id'],_0x2a534e[_0xba6b('0x3f')],_0x10b604[_0xba6b('0x36')]);switch(_0x10b604[_0xba6b('0x36')]){case _0xba6b('0x56'):emit(util[_0xba6b('0x2f')](_0xba6b('0x57'),_0x2a534e[_0xba6b('0x3f')]),_0xba6b('0x58'),{'recordId':_0x125891['id']});break;case'newTab':emit(util[_0xba6b('0x2f')]('user:%s',_0x2a534e[_0xba6b('0x3f')]),_0xba6b('0x59'),{'uri':util[_0xba6b('0x2f')](_0xba6b('0x5a'),_0xd517f9[_0xba6b('0x5b')],_0x125891['id'])});break;default:logger['error'](_0xba6b('0x5c'));}})[_0xba6b('0x5d')](function(_0x2a2c01){logger[_0xba6b('0x5e')](_0xba6b('0x4b'),JSON['stringify'](_0x2a2c01));});};exports[_0xba6b('0x5f')]=function(_0x1b864c,_0x1469c8,_0x331661,_0x4a66c7,_0x3fc8d3,_0x1953d5,_0x19de89){var _0x34a3db,_0x2dcbd7,_0xf552b0,_0x39f886;_0x1953d5[_0xba6b('0x47')]=intUtil['stripTrailingSlash'](_0x1953d5[_0xba6b('0x47')]);_0x1953d5[_0xba6b('0x48')]=intUtil[_0xba6b('0x49')](_0x1953d5[_0xba6b('0x48')]);if(_0x19de89&&_0x19de89['recordingFormat']&&_0x19de89['recordingFormat']!==_0xba6b('0x60')){logger[_0xba6b('0x1b')](_0xba6b('0x61'),_0xba6b('0x4c'));_0x1469c8[_0xba6b('0x4f')]=util['format'](_0xba6b('0x4d'),_0x1953d5[_0xba6b('0x47')],_0x1469c8['uniqueid'],md5(_0x1469c8[_0xba6b('0x4e')]));}return getConnection(_0x1953d5)[_0xba6b('0x1f')](function(_0x4fdd0f){_0x39f886=_0x4fdd0f;return getUser(_0x1953d5,_0x4a66c7[_0xba6b('0x50')],_0x39f886);})['then'](function(_0x36fed6){_0x34a3db=_0x36fed6;return getEndUser(_0x1953d5,_0x331661,_0x1469c8['destcalleridname'],_0x1469c8[_0xba6b('0x62')],_0x39f886);})['then'](function(_0x2c81cb){_0x2dcbd7=_0x2c81cb;return getTicket(_0x1953d5,_0x34a3db,_0x2dcbd7,_0x331661,_0x1469c8,_0x331661[_0xba6b('0x52')],_0x39f886,_0xba6b('0x5f'));})[_0xba6b('0x1f')](function(_0x477717){_0xf552b0=_0x477717;logger[_0xba6b('0x1b')](_0xba6b('0x63'),_0xf552b0['id']);logger['info'](_0xba6b('0x64'),_0xf552b0['id'],_0x4a66c7['name'],_0x1953d5['type']);switch(_0x1953d5['type']){case _0xba6b('0x56'):emit(util['format']('user:%s',_0x4a66c7['name']),_0xba6b('0x58'),{'recordId':_0xf552b0['id']});break;case _0xba6b('0x65'):emit(util[_0xba6b('0x2f')](_0xba6b('0x57'),_0x4a66c7[_0xba6b('0x3f')]),'trigger:browser:url',{'uri':util['format']('%s/%s/e',_0x39f886[_0xba6b('0x5b')],_0xf552b0['id'])});break;default:logger['error'](_0xba6b('0x61'),_0xba6b('0x66'));}})['catch'](function(_0x56d122){logger[_0xba6b('0x5e')]('[OUTBOUND]',JSON[_0xba6b('0x67')](_0x56d122));});};exports[_0xba6b('0x68')]=function(_0x5e592a,_0x1ff58a,_0x5cf833,_0x1cbc0e,_0x368f8e,_0x148bfa){var _0x28ec16,_0x5df37e,_0x149fec,_0x531691;_0x148bfa[_0xba6b('0x47')]=intUtil[_0xba6b('0x49')](_0x148bfa[_0xba6b('0x47')]);_0x148bfa['remoteUri']=intUtil[_0xba6b('0x49')](_0x148bfa[_0xba6b('0x48')]);if(_0x368f8e&&_0x368f8e['monitor_format']){logger['info'](_0xba6b('0x69'),_0xba6b('0x4c'));_0x1ff58a[_0xba6b('0x4f')]=util[_0xba6b('0x2f')](_0xba6b('0x4d'),_0x148bfa[_0xba6b('0x47')],_0x1ff58a['uniqueid'],md5(_0x1ff58a[_0xba6b('0x4e')]));}else{_0x1ff58a[_0xba6b('0x4f')]='';}return getConnection(_0x148bfa)['then'](function(_0x3655e4){_0x531691=_0x3655e4;if(!_[_0xba6b('0x16')](_0x1cbc0e)){return getUser(_0x148bfa,_0x1cbc0e['name'],_0x531691);}else{return getUser(_0x148bfa,null,_0x531691);}})[_0xba6b('0x1f')](function(_0x3238ac){_0x28ec16=_0x3238ac;return getEndUser(_0x148bfa,_0x5cf833,_0x1ff58a[_0xba6b('0x51')],_0x1ff58a[_0xba6b('0x6a')],_0x531691);})['then'](function(_0x2e449c){_0x5df37e=_0x2e449c;return getTicket(_0x148bfa,_0x28ec16,_0x5df37e,_0x5cf833,_0x1ff58a,_0x5cf833[_0xba6b('0x52')],_0x531691);})[_0xba6b('0x1f')](function(_0x12d94f){_0x149fec=_0x12d94f;logger[_0xba6b('0x1b')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x149fec['id']);logger[_0xba6b('0x1b')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x148bfa[_0xba6b('0x36')]);})[_0xba6b('0x5d')](function(_0x1d75fc){logger[_0xba6b('0x5e')]('[ABANDONED]',JSON[_0xba6b('0x67')](_0x1d75fc));});}; \ No newline at end of file +var _0xd58a=['redis','localhost','emit','Task','assign','utc','getString','Subjects','Descriptions','WhoId','Case','sobject','ticketType','create','isNil','validateEmail','User','find','execute','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','info','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','Lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','No\x20Company','forEach','type','string','idField','toString','variable','variableName','Variable','name','toLowerCase','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','username','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','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','stringify','outbound','recordingFormat','[OUTBOUND]','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','monitor_format','calleridname','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','[ABANDONED]','moment','bluebird','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce'];(function(_0x4c51a8,_0x3d34d6){var _0x108c27=function(_0x29adbe){while(--_0x29adbe){_0x4c51a8['push'](_0x4c51a8['shift']());}};_0x108c27(++_0x3d34d6);}(_0xd58a,0x194));var _0xad58=function(_0x1d0412,_0x1a3d7c){_0x1d0412=_0x1d0412-0x0;var _0x5c0420=_0xd58a[_0x1d0412];return _0x5c0420;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0xad58('0x0'));var BPromise=require(_0xad58('0x1'));var md5=require('md5');var jsforce=require(_0xad58('0x2'));var util=require(_0xad58('0x3'));var Redis=require(_0xad58('0x4'));var intUtil=require('./util');var config=require(_0xad58('0x5'));var logger=require(_0xad58('0x6'))(_0xad58('0x7'));config['redis']=_['defaults'](config[_0xad58('0x8')],{'host':_0xad58('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x59b474,_0x809c00,_0x3953f3){io['to'](_0x59b474)[_0xad58('0xa')](_0x809c00,_0x3953f3);}function getTicket(_0x163dd9,_0x1b05a9,_0x23807c,_0xe9f084,_0xf7b0b7,_0x1906e6,_0x243039,_0x2810ce){var _0x6bb9f5={};if(_0xe9f084['ticketType']===_0xad58('0xb')){_0x6bb9f5=Object[_0xad58('0xc')]({},{'OwnerId':_0x1b05a9['id'],'ActivityDate':moment[_0xad58('0xd')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xad58('0xe')](_0xe9f084[_0xad58('0xf')],_0xf7b0b7,'\x20'),'Description':intUtil[_0xad58('0xe')](_0xe9f084[_0xad58('0x10')],_0xf7b0b7,'\x0a')},getCustomFields(_0x1906e6,_0xf7b0b7));if(_0x23807c){_0x6bb9f5[_0xad58('0x11')]=_0x23807c['id'];}}else if(_0xe9f084['ticketType']===_0xad58('0x12')){_0x6bb9f5=Object[_0xad58('0xc')]({},{'OwnerId':_0x1b05a9['id'],'Subject':intUtil['getString'](_0xe9f084[_0xad58('0xf')],_0xf7b0b7,'\x20'),'Description':intUtil[_0xad58('0xe')](_0xe9f084[_0xad58('0x10')],_0xf7b0b7,'\x0a')},getCustomFields(_0x1906e6,_0xf7b0b7));if(_0x23807c){_0x6bb9f5['ContactId']=_0x23807c['id'];}}return _0x243039[_0xad58('0x13')](_0xe9f084[_0xad58('0x14')])[_0xad58('0x15')](_0x6bb9f5);}function getUser(_0x3407e5,_0x59b035,_0x3c5b72){if(!_[_0xad58('0x16')](_0x59b035)&&intUtil[_0xad58('0x17')](_0x59b035)){var _0x226b6f={'Email':_0x59b035};var _0x3fbc39={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3c5b72[_0xad58('0x13')](_0xad58('0x18'))[_0xad58('0x19')](_0x226b6f,_0x3fbc39)[_0xad58('0x1a')]()['then'](function(_0x35f335){if(_0x35f335[_0xad58('0x1b')]){var _0x155ff1=_[_0xad58('0x19')](_0x35f335,function(_0x3dcb41){return _0x3dcb41[_0xad58('0x1c')]===_0x59b035;});if(_0x155ff1){logger['info'](_0xad58('0x1d'),_0x59b035);return BPromise[_0xad58('0x1e')]({'id':_0x155ff1['Id'],'name':_0x155ff1[_0xad58('0x1f')]});}}else{logger['info'](_0xad58('0x20'),_0x59b035);return _0x3c5b72[_0xad58('0x21')]()[_0xad58('0x22')](function(_0x3459dc){return BPromise[_0xad58('0x1e')]({'id':_0x3459dc[_0xad58('0x23')],'name':_0x3459dc[_0xad58('0x24')]});});}});}else{logger['info'](_0xad58('0x20'),_0x59b035);return _0x3c5b72[_0xad58('0x21')]()[_0xad58('0x22')](function(_0x549628){return BPromise[_0xad58('0x1e')]({'id':_0x549628['user_id'],'name':_0x549628[_0xad58('0x24')]});});}}function getEndUser(_0x2c83c1,_0x503c82,_0x1e3856,_0x18a950,_0x1b74ea){var _0x26aec4={'Phone':_0x18a950};var _0x7aff00={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){if(_0x503c82[_0xad58('0x14')]==='Task'){logger[_0xad58('0x25')](_0xad58('0x26'),_0x18a950,_0x503c82[_0xad58('0x27')]);switch(_0x503c82[_0xad58('0x27')]){case'contact_lead':return _0x1b74ea[_0xad58('0x13')](_0xad58('0x28'))['find'](_0x26aec4,_0x7aff00)[_0xad58('0x1a')]()[_0xad58('0x22')](function(_0x2cad64){if(_0x2cad64&&_0x2cad64[_0xad58('0x1b')]){return _0x2cad64;}else{return _0x1b74ea[_0xad58('0x13')](_0xad58('0x29'))[_0xad58('0x19')](_0x26aec4,_0x7aff00);}});case'contact':return _0x1b74ea['sobject'](_0xad58('0x28'))['find'](_0x26aec4,_0x7aff00)[_0xad58('0x1a')]();case'lead':return _0x1b74ea[_0xad58('0x13')](_0xad58('0x29'))['find'](_0x26aec4,_0x7aff00);default:return null;}}else if(_0x503c82[_0xad58('0x14')]===_0xad58('0x12')){logger[_0xad58('0x25')](_0xad58('0x26'),_0x18a950,'contact');return _0x1b74ea[_0xad58('0x13')]('Contact')['find'](_0x26aec4,_0x7aff00)[_0xad58('0x1a')]();}})[_0xad58('0x22')](function(_0x125409){if(_0x125409&&_0x125409[_0xad58('0x1b')]){var _0x166d21=_[_0xad58('0x19')](_0x125409,function(_0x5e7de6){return _0x5e7de6[_0xad58('0x2a')]===_0x18a950;});if(_0x166d21){return BPromise[_0xad58('0x1e')]({'id':_0x166d21['Id'],'name':_0x166d21[_0xad58('0x1f')],'phone':_0x166d21['Phone']});}}})[_0xad58('0x22')](function(_0x1c1204){if(_0x1c1204){logger[_0xad58('0x25')](_0xad58('0x2b'),_0x18a950);return BPromise[_0xad58('0x1e')](_0x1c1204);}else{logger[_0xad58('0x25')](_0xad58('0x2c'),_0x18a950);var _0x1fbff1={'LastName':_0x1e3856!==''?_0x1e3856:util['format']('Caller\x20-\x20%s',_0x18a950),'Phone':_0x18a950};if(_0x503c82[_0xad58('0x2d')]){if(_0x503c82[_0xad58('0x2d')]==='contact'){logger[_0xad58('0x25')](_0xad58('0x2e'),_0x18a950,_0x503c82[_0xad58('0x2d')]);}else if(_0x503c82[_0xad58('0x2d')]===_0xad58('0x2f')&&_0x503c82[_0xad58('0x14')]===_0xad58('0xb')){logger['info'](_0xad58('0x2e'),_0x18a950,_0x503c82[_0xad58('0x2d')]);_0x1fbff1[_0xad58('0x30')]=_0xad58('0x31');}else{return null;}}return _0x1b74ea[_0xad58('0x13')](_['upperFirst'](_0x503c82['moduleCreate']))[_0xad58('0x15')](_0x1fbff1);}});}function getCustomFields(_0x322cf1,_0xe3992a){var _0x51e7b4={};if(_0x322cf1[_0xad58('0x1b')]>0x0){_[_0xad58('0x32')](_0x322cf1,function(_0xaac080){if(_0xaac080[_0xad58('0x33')]===_0xad58('0x34')&&_0xaac080[_0xad58('0x35')]){_0x51e7b4[_0xaac080[_0xad58('0x35')]]=_0xaac080['content'][_0xad58('0x36')]();}else if(_0xaac080['type']===_0xad58('0x37')&&_0xaac080['variableName']&&_0xaac080[_0xad58('0x35')]){_0xe3992a[_0xaac080['variableName']]&&(_0x51e7b4[_0xaac080[_0xad58('0x35')]]=_0xe3992a[_0xaac080[_0xad58('0x38')]]['toString']());}else if(_0xaac080[_0xad58('0x33')]==='customVariable'&&_0xaac080[_0xad58('0x39')]&&_0xaac080['Variable'][_0xad58('0x3a')]&&_0xaac080[_0xad58('0x35')]){_0xe3992a[_0xaac080[_0xad58('0x39')][_0xad58('0x3a')][_0xad58('0x3b')]()]&&(_0x51e7b4[_0xaac080['idField']]=_0xe3992a[_0xaac080[_0xad58('0x39')][_0xad58('0x3a')][_0xad58('0x3b')]()][_0xad58('0x36')]());}});}return _0x51e7b4;}function getConnection(_0x58bb86){var _0x1e6d0f=_0x58bb86[_0xad58('0x3c')]['concat'](_0x58bb86[_0xad58('0x3d')]);var _0x32d4ac=new jsforce[(_0xad58('0x3e'))]({'oauth2':{'loginUrl':_0x58bb86[_0xad58('0x3f')]||_0xad58('0x40'),'clientId':_0x58bb86[_0xad58('0x41')],'clientSecret':_0x58bb86['clientSecret']}});return _0x32d4ac['login'](_0x58bb86[_0xad58('0x42')],_0x1e6d0f)[_0xad58('0x22')](function(){logger[_0xad58('0x25')](_0xad58('0x43'));return _0x32d4ac;});}exports[_0xad58('0x44')]=function(_0x449735,_0x37c182,_0x2af397,_0x302446,_0x61daf,_0x4046fc){var _0x59ea91,_0x3c7e27,_0x26d30e,_0x1cd964;_0x4046fc[_0xad58('0x45')]=intUtil[_0xad58('0x46')](_0x4046fc[_0xad58('0x45')]);_0x4046fc['remoteUri']=intUtil[_0xad58('0x46')](_0x4046fc[_0xad58('0x3f')]);if(_0x61daf&&_0x61daf['monitor_format']){logger[_0xad58('0x25')](_0xad58('0x47'),_0xad58('0x48'));_0x37c182[_0xad58('0x49')]=util[_0xad58('0x4a')](_0xad58('0x4b'),_0x4046fc['serverUrl'],_0x37c182[_0xad58('0x4c')],md5(_0x37c182['uniqueid']));}else{_0x37c182['recordingURL']='';}return getConnection(_0x4046fc)[_0xad58('0x22')](function(_0xa1c7ba){_0x1cd964=_0xa1c7ba;return getUser(_0x4046fc,_0x302446[_0xad58('0x4d')],_0x1cd964);})[_0xad58('0x22')](function(_0x23e5ee){_0x59ea91=_0x23e5ee;return getEndUser(_0x4046fc,_0x2af397,_0x37c182['calleridname'],_0x37c182[_0xad58('0x4e')],_0x1cd964);})[_0xad58('0x22')](function(_0x8860c9){_0x3c7e27=_0x8860c9;return getTicket(_0x4046fc,_0x59ea91,_0x3c7e27,_0x2af397,_0x37c182,_0x2af397[_0xad58('0x4f')],_0x1cd964,_0xad58('0x44'));})[_0xad58('0x22')](function(_0xf5a355){_0x26d30e=_0xf5a355;logger[_0xad58('0x25')](_0xad58('0x50'),_0x26d30e['id']);logger[_0xad58('0x25')](_0xad58('0x51'),_0x26d30e['id'],_0x302446[_0xad58('0x3a')],_0x4046fc['type']);switch(_0x4046fc[_0xad58('0x33')]){case'integrationTab':emit(util[_0xad58('0x4a')]('user:%s',_0x302446[_0xad58('0x3a')]),_0xad58('0x52'),{'recordId':_0x26d30e['id']});break;case _0xad58('0x53'):emit(util[_0xad58('0x4a')]('user:%s',_0x302446[_0xad58('0x3a')]),_0xad58('0x54'),{'uri':util[_0xad58('0x4a')](_0xad58('0x55'),_0x1cd964[_0xad58('0x56')],_0x26d30e['id'])});break;default:logger[_0xad58('0x57')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xad58('0x58')](function(_0x57d764){logger['error'](_0xad58('0x47'),JSON[_0xad58('0x59')](_0x57d764));});};exports[_0xad58('0x5a')]=function(_0x14be2e,_0x15d25b,_0x137792,_0x2e53dd,_0x3fa7fa,_0x12b97b,_0x5a95b7){var _0x1c452a,_0x5cd15a,_0xf5970d,_0x11fb8b;_0x12b97b['serverUrl']=intUtil['stripTrailingSlash'](_0x12b97b[_0xad58('0x45')]);_0x12b97b['remoteUri']=intUtil[_0xad58('0x46')](_0x12b97b['remoteUri']);if(_0x5a95b7&&_0x5a95b7[_0xad58('0x5b')]&&_0x5a95b7[_0xad58('0x5b')]!=='none'){logger[_0xad58('0x25')](_0xad58('0x5c'),_0xad58('0x48'));_0x15d25b['recordingURL']=util[_0xad58('0x4a')](_0xad58('0x4b'),_0x12b97b[_0xad58('0x45')],_0x15d25b[_0xad58('0x4c')],md5(_0x15d25b[_0xad58('0x4c')]));}return getConnection(_0x12b97b)['then'](function(_0x82556f){_0x11fb8b=_0x82556f;return getUser(_0x12b97b,_0x2e53dd['email'],_0x11fb8b);})['then'](function(_0x3156c6){_0x1c452a=_0x3156c6;return getEndUser(_0x12b97b,_0x137792,_0x15d25b['destcalleridname'],_0x15d25b['destcalleridnum'],_0x11fb8b);})[_0xad58('0x22')](function(_0x3668db){_0x5cd15a=_0x3668db;return getTicket(_0x12b97b,_0x1c452a,_0x5cd15a,_0x137792,_0x15d25b,_0x137792['Fields'],_0x11fb8b,_0xad58('0x5a'));})[_0xad58('0x22')](function(_0x9d20d1){_0xf5970d=_0x9d20d1;logger[_0xad58('0x25')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0xf5970d['id']);logger[_0xad58('0x25')](_0xad58('0x5d'),_0xf5970d['id'],_0x2e53dd['name'],_0x12b97b[_0xad58('0x33')]);switch(_0x12b97b['type']){case _0xad58('0x5e'):emit(util['format'](_0xad58('0x5f'),_0x2e53dd[_0xad58('0x3a')]),_0xad58('0x52'),{'recordId':_0xf5970d['id']});break;case'newTab':emit(util[_0xad58('0x4a')](_0xad58('0x5f'),_0x2e53dd[_0xad58('0x3a')]),_0xad58('0x54'),{'uri':util['format'](_0xad58('0x55'),_0x11fb8b[_0xad58('0x56')],_0xf5970d['id'])});break;default:logger[_0xad58('0x57')]('[OUTBOUND]',_0xad58('0x60'));}})[_0xad58('0x58')](function(_0x512ac9){logger[_0xad58('0x57')](_0xad58('0x5c'),JSON[_0xad58('0x59')](_0x512ac9));});};exports[_0xad58('0x61')]=function(_0x4ecc2c,_0x442e62,_0x30ebbd,_0x44d138,_0x7d6e44,_0x378900){var _0x555802,_0x52fe72,_0x5d2a1c,_0x4dd07a;_0x378900[_0xad58('0x45')]=intUtil['stripTrailingSlash'](_0x378900['serverUrl']);_0x378900[_0xad58('0x3f')]=intUtil[_0xad58('0x46')](_0x378900[_0xad58('0x3f')]);if(_0x7d6e44&&_0x7d6e44[_0xad58('0x62')]){logger[_0xad58('0x25')]('[ABANDONED]',_0xad58('0x48'));_0x442e62['recordingURL']=util['format'](_0xad58('0x4b'),_0x378900[_0xad58('0x45')],_0x442e62[_0xad58('0x4c')],md5(_0x442e62[_0xad58('0x4c')]));}else{_0x442e62[_0xad58('0x49')]='';}return getConnection(_0x378900)[_0xad58('0x22')](function(_0x55144){_0x4dd07a=_0x55144;if(!_[_0xad58('0x16')](_0x44d138)){return getUser(_0x378900,_0x44d138[_0xad58('0x3a')],_0x4dd07a);}else{return getUser(_0x378900,null,_0x4dd07a);}})['then'](function(_0x3a9ea1){_0x555802=_0x3a9ea1;return getEndUser(_0x378900,_0x30ebbd,_0x442e62[_0xad58('0x63')],_0x442e62[_0xad58('0x4e')],_0x4dd07a);})[_0xad58('0x22')](function(_0x3c56d4){_0x52fe72=_0x3c56d4;return getTicket(_0x378900,_0x555802,_0x52fe72,_0x30ebbd,_0x442e62,_0x30ebbd[_0xad58('0x4f')],_0x4dd07a);})[_0xad58('0x22')](function(_0x585128){_0x5d2a1c=_0x585128;logger[_0xad58('0x25')](_0xad58('0x64'),_0x5d2a1c['id']);logger['info'](_0xad58('0x65'),_0x378900[_0xad58('0x33')]);})[_0xad58('0x58')](function(_0x396893){logger[_0xad58('0x57')](_0xad58('0x66'),JSON[_0xad58('0x59')](_0x396893));});}; \ 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 c4795e0..d95b24f 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(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 3943412..96713d0 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 _0x408d=['uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','recordingFormat','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','Outbound','Ticket\x20created!','version','[OUTBOUND]','trigger:browser:url','abandoned','isNil','[ABANDONED]','lodash','request-promise','bluebird','ioredis','sugarcrm','redis','defaults','localhost','emit','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','Descriptions','date_start','toISOString','slice','replace','parent_type','Contacts','parent_name','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','idField','customField','custom_fields','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x17226d,_0x5cdceb){var _0x1a0243=function(_0x45c441){while(--_0x45c441){_0x17226d['push'](_0x17226d['shift']());}};_0x1a0243(++_0x5cdceb);}(_0x408d,0x1f4));var _0xd408=function(_0x39e9f4,_0x7da7be){_0x39e9f4=_0x39e9f4-0x0;var _0x16b495=_0x408d[_0x39e9f4];return _0x16b495;};'use strict';var _=require(_0xd408('0x0'));var rp=require(_0xd408('0x1'));var BPromise=require(_0xd408('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0xd408('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xd408('0x4'));config[_0xd408('0x5')]=_[_0xd408('0x6')](config[_0xd408('0x5')],{'host':_0xd408('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd408('0x5')]));var def={'method':'POST','json':!![]};function emit(_0x2e1500,_0x4d861d,_0x414c63){io['to'](_0x2e1500)[_0xd408('0x8')](_0x4d861d,_0x414c63);}function getTicket(_0x1e3d9c,_0x203447,_0x4fd68e,_0x53e633,_0x4ff52e,_0xf3057d,_0x3b5ea8,_0x26d214){logger['info'](_0xd408('0x9'));var _0x587433=new Date();var _0x15024b=[{'name':_0xd408('0xa'),'value':intUtil[_0xd408('0xb')](_0x53e633['Subjects'],_0x4ff52e,'\x20')},{'name':_0xd408('0xc'),'value':_0x203447['id']},{'name':_0xd408('0xd'),'value':_0x203447['id']},{'name':'description','value':intUtil[_0xd408('0xb')](_0x53e633[_0xd408('0xe')],_0x4ff52e,'\x0a')},{'name':_0xd408('0xf'),'value':_0x587433[_0xd408('0x10')]()[_0xd408('0x11')](0x0,0x13)[_0xd408('0x12')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x4fd68e['id']},{'name':_0xd408('0x13'),'value':_0xd408('0x14')},{'name':_0xd408('0x15'),'value':_0x4fd68e[_0xd408('0xa')]},{'name':'direction','value':_0x26d214}];if(_0xf3057d[_0xd408('0x16')]){_[_0xd408('0x17')](_0xf3057d,function(_0x4847e6){if(_0x4ff52e[_0x4847e6[_0xd408('0x18')]]){_0x15024b[_0xd408('0x19')]({'name':_0x4847e6['idField'],'value':_0x4ff52e[_0x4847e6[_0xd408('0x18')]]});}});}return request({'form':{'method':_0xd408('0x1a'),'input_type':_0xd408('0x1b'),'response_type':_0xd408('0x1b'),'rest_data':JSON[_0xd408('0x1c')]({'session':_0x3b5ea8['id'],'module_name':_0xd408('0x1d'),'name_value_list':_0x15024b})}});}function getAuth(_0x3332c3){return util[_0xd408('0x1e')](_0xd408('0x1f'),new Buffer(_0x3332c3[_0xd408('0x20')]+':X')[_0xd408('0x21')](_0xd408('0x22')));}function getServerInfo(_0x4e3e05){return request({'form':{'method':_0xd408('0x23'),'input_type':_0xd408('0x1b'),'response_type':'JSON','rest_data':JSON[_0xd408('0x1c')]({'session':_0x4e3e05['id']})}});}function getUser(_0x574f63,_0x571a6f,_0x14f231){if(!_['isNil'](_0x571a6f)){logger[_0xd408('0x24')](_0xd408('0x25'),_0x571a6f);return request({'form':{'method':_0xd408('0x26'),'input_type':'JSON','response_type':_0xd408('0x1b'),'rest_data':JSON[_0xd408('0x1c')]({'session':_0x14f231['id'],'module_name':_0xd408('0x27'),'query':util[_0xd408('0x1e')](_0xd408('0x28'),_0x571a6f),'order_by':'','offset':'0','select_fields':['id',_0xd408('0xa'),_0xd408('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd408('0x2a')](function(_0x2e51c3){if(_0x2e51c3[_0xd408('0x2b')][_0xd408('0x16')]){var _0x24f4dc=_[_0xd408('0x2c')](_0x2e51c3[_0xd408('0x2b')],function(_0x895d3d){return _0x895d3d[_0xd408('0x2d')][_0xd408('0x29')][_0xd408('0x2e')]===_0x571a6f;});if(_0x24f4dc){logger[_0xd408('0x24')](_0xd408('0x2f'));return BPromise[_0xd408('0x30')]({'id':_0x24f4dc[_0xd408('0x2d')]['id'][_0xd408('0x2e')],'name':_0x24f4dc[_0xd408('0x2d')][_0xd408('0xa')][_0xd408('0x2e')]});}}logger['info'](_0xd408('0x31'));return BPromise['resolve']({'id':_0x14f231[_0xd408('0x2d')][_0xd408('0x32')][_0xd408('0x2e')],'name':_0x14f231['name_value_list'][_0xd408('0x29')][_0xd408('0x2e')]});});}else{logger['info'](_0xd408('0x33'));return BPromise['resolve']({'id':_0x14f231[_0xd408('0x2d')]['user_id'][_0xd408('0x2e')],'name':_0x14f231[_0xd408('0x2d')]['user_name']['value']});}}function getEndUser(_0x4b1fbe,_0x28cd30,_0x48d371,_0x49d89e){logger['info']('Searching\x20enduser\x20with\x20phone',_0x48d371);return request({'form':{'method':_0xd408('0x26'),'input_type':_0xd408('0x1b'),'response_type':_0xd408('0x1b'),'rest_data':JSON[_0xd408('0x1c')]({'session':_0x49d89e['id'],'module_name':_0xd408('0x14'),'query':util[_0xd408('0x1e')](_0xd408('0x34'),_0x48d371),'order_by':'','offset':'0','select_fields':['id',_0xd408('0xa'),_0xd408('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd408('0x2a')](function(_0x2dabfb){if(_0x2dabfb[_0xd408('0x2b')][_0xd408('0x16')]){var _0x2f21a6=_[_0xd408('0x2c')](_0x2dabfb[_0xd408('0x2b')],function(_0x230b7f){return _0x230b7f['name_value_list'][_0xd408('0x35')][_0xd408('0x2e')]===_0x48d371;});if(_0x2f21a6){logger[_0xd408('0x24')](_0xd408('0x36'));return BPromise[_0xd408('0x30')]({'id':_0x2f21a6['name_value_list']['id'][_0xd408('0x2e')],'name':_0x2f21a6[_0xd408('0x2d')]['name'][_0xd408('0x2e')],'phone':_0x2f21a6['name_value_list'][_0xd408('0x35')][_0xd408('0x2e')]});}}else{logger[_0xd408('0x24')](_0xd408('0x37'));return request({'form':{'method':_0xd408('0x1a'),'input_type':_0xd408('0x1b'),'response_type':'JSON','rest_data':JSON[_0xd408('0x1c')]({'session':_0x49d89e['id'],'module_name':_0xd408('0x14'),'name_value_list':[{'name':_0xd408('0x38'),'value':_0x28cd30!==_0xd408('0x39')?_0x28cd30:util[_0xd408('0x1e')](_0xd408('0x3a'),_0x48d371)},{'name':_0xd408('0x35'),'value':_0x48d371}]})}})[_0xd408('0x2a')](function(_0x43a74b){logger[_0xd408('0x24')]('Enduser\x20created.');return BPromise[_0xd408('0x30')]({'id':_0x43a74b['id'],'name':_0x43a74b[_0xd408('0x2b')][_0xd408('0x38')]['value'],'phone':_0x43a74b['entry_list'][_0xd408('0x35')]['value']});});}});}function request(_0x2e064d){logger[_0xd408('0x3b')](_0xd408('0x3c'),JSON['stringify'](_0x2e064d));return rp(_[_0xd408('0x3d')](def,_0x2e064d));}function getTags(_0x467ef5,_0x206d19){var _0x1356de=[];if(_0x467ef5&&_0x467ef5[_0xd408('0x16')]>0x0){_0x1356de=_[_0xd408('0x3e')](_0x467ef5,_0x206d19);}return _0x1356de;}function getCustomFields(_0x1c4d85,_0xb1d132){var _0x3e346f=[];var _0x4893c1={'custom_fields':[]};if(_0x1c4d85['length']>0x0){_[_0xd408('0x17')](_0x1c4d85,function(_0x32da50){if(_0x32da50[_0xd408('0x3f')]===_0xd408('0x40')&&_0x32da50[_0xd408('0x41')]&&!_0x32da50['customField']){_0x4893c1[_0x32da50['nameField'][_0xd408('0x42')]()]=_0x32da50[_0xd408('0x43')][_0xd408('0x21')]();}else if(_0x32da50[_0xd408('0x3f')]===_0xd408('0x40')&&_0x32da50[_0xd408('0x44')]&&_0x32da50[_0xd408('0x45')]){_0x4893c1[_0xd408('0x46')]['push']({'id':_0x32da50[_0xd408('0x44')],'value':_0x32da50[_0xd408('0x43')][_0xd408('0x21')]()});}else if(_0x32da50[_0xd408('0x3f')]==='variable'&&_0x32da50['variableName']&&_0x32da50['idField']&&_0x32da50[_0xd408('0x45')]){_0xb1d132[_0x32da50['variableName']]&&_0x4893c1[_0xd408('0x46')][_0xd408('0x19')]({'id':_0x32da50[_0xd408('0x44')],'value':_0xb1d132[_0x32da50[_0xd408('0x18')]][_0xd408('0x21')]()});}else if(_0x32da50[_0xd408('0x3f')]===_0xd408('0x47')&&_0x32da50[_0xd408('0x48')]&&_0x32da50[_0xd408('0x48')][_0xd408('0xa')]&&_0x32da50[_0xd408('0x44')]&&_0x32da50['customField']){_0xb1d132[_0x32da50[_0xd408('0x48')][_0xd408('0xa')]['toLowerCase']()]&&_0x4893c1[_0xd408('0x46')][_0xd408('0x19')]({'id':_0x32da50[_0xd408('0x44')],'value':_0xb1d132[_0x32da50[_0xd408('0x48')][_0xd408('0xa')][_0xd408('0x42')]()][_0xd408('0x21')]()});}});}return _0x4893c1;}function getConnection(_0x140ead){return request({'method':_0xd408('0x49'),'form':{'method':_0xd408('0x4a'),'input_type':_0xd408('0x1b'),'response_type':_0xd408('0x1b'),'rest_data':JSON[_0xd408('0x1c')]({'user_auth':{'user_name':_0x140ead[_0xd408('0x4b')],'password':_0x140ead[_0xd408('0x4c')],'encryption':_0xd408('0x4d')},'application':_0xd408('0x4e')})}})[_0xd408('0x2a')](function(_0x2a30ea){var _0x6448e0=_0x2a30ea;if(_0x6448e0['id']){def['sessionID']=_0x6448e0['id'];return BPromise[_0xd408('0x30')](_0x6448e0);}else{throw new Error(util[_0xd408('0x1e')](_0xd408('0x4f'),_0x140ead['id']));}});}function setRelationship(_0x165c53,_0x13f578,_0x51a0e0,_0x507f84){return request({'form':{'method':_0xd408('0x50'),'input_type':_0xd408('0x1b'),'response_type':'JSON','rest_data':JSON[_0xd408('0x1c')]({'session':_0x165c53['id'],'module_name':_0xd408('0x1d'),'module_id':_0x51a0e0['id'],'link_field_name':_0x507f84,'related_ids':[_0x13f578['id']]})}});}exports[_0xd408('0x51')]=function(_0x2c5c19,_0x1e9145,_0xef5015,_0x33298b,_0xdc09de,_0xec3c64){var _0x3a1f4b,_0x3f3384,_0x250871,_0x308c92;_0xec3c64['remoteUri']=intUtil[_0xd408('0x52')](_0xec3c64['remoteUri']);_0xec3c64[_0xd408('0x53')]=intUtil['stripTrailingSlash'](_0xec3c64[_0xd408('0x53')]);def[_0xd408('0x54')]=util[_0xd408('0x1e')](_0xd408('0x55'),_0xec3c64[_0xd408('0x56')]);if(_0xdc09de&&_0xdc09de[_0xd408('0x57')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x1e9145[_0xd408('0x58')]=util['format'](_0xd408('0x59'),_0xec3c64[_0xd408('0x53')],_0x1e9145[_0xd408('0x5a')],md5(_0x1e9145[_0xd408('0x5a')]));}else{_0x1e9145[_0xd408('0x58')]='';}return getConnection(_0xec3c64)[_0xd408('0x2a')](function(_0x1ae6ca){_0x308c92=_0x1ae6ca;return getUser(_0xec3c64,_0x33298b[_0xd408('0xa')],_0x308c92);})[_0xd408('0x2a')](function(_0x367d7d){_0x3a1f4b=_0x367d7d;logger[_0xd408('0x24')]('The\x20User\x20ID\x20is:',_0x3a1f4b['id']);return getEndUser(_0xec3c64,_0x1e9145[_0xd408('0x5b')],_0x1e9145[_0xd408('0x5c')],_0x308c92);})[_0xd408('0x2a')](function(_0x1428d0){_0x3f3384=_0x1428d0;logger[_0xd408('0x24')](_0xd408('0x5d'),_0x3f3384['id']);return getTicket(_0xec3c64,_0x3a1f4b,_0x3f3384,_0xef5015,_0x1e9145,_0xef5015[_0xd408('0x5e')],_0x308c92,_0xd408('0x5f'));})[_0xd408('0x2a')](function(_0x52edca){_0x250871=_0x52edca;logger[_0xd408('0x24')]('Ticket\x20created!');logger[_0xd408('0x24')](_0xd408('0x60'),_0x250871['id']);return setRelationship(_0x308c92,_0x3a1f4b,_0x250871,_0xd408('0x61'));})[_0xd408('0x2a')](function(){return setRelationship(_0x308c92,_0x3f3384,_0x250871,_0xd408('0x62'));})['then'](function(){return getServerInfo(_0x308c92);})[_0xd408('0x2a')](function(_0x4c2df6){var _0x2bb0ac=parseInt(_0x4c2df6['version'][_0xd408('0x63')](0x0));var _0x50f7f2=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0xec3c64['remoteUri'],_0x250871['id']);if(_0x2bb0ac>0x6){_0x50f7f2=util[_0xd408('0x1e')](_0xd408('0x64'),_0xec3c64[_0xd408('0x56')],_0x250871['id']);}logger[_0xd408('0x24')](_0xd408('0x65'),_0xd408('0x66'));emit(util[_0xd408('0x1e')](_0xd408('0x67'),_0x33298b[_0xd408('0xa')]),'trigger:browser:url',{'uri':_0x50f7f2});})[_0xd408('0x68')](function(_0xa7384a){logger[_0xd408('0x69')](_0xd408('0x65'),JSON[_0xd408('0x1c')](_0xa7384a));});};exports['outbound']=function(_0x2403b2,_0x33d9e1,_0x2b94e7,_0x1fb9d2,_0x217477,_0x553929,_0x4536fa){var _0x35774c,_0x23cff8,_0x5142b5,_0x2ad81a;_0x553929[_0xd408('0x56')]=intUtil[_0xd408('0x52')](_0x553929[_0xd408('0x56')]);_0x553929[_0xd408('0x53')]=intUtil[_0xd408('0x52')](_0x553929[_0xd408('0x53')]);def['uri']=util[_0xd408('0x1e')](_0xd408('0x55'),_0x553929[_0xd408('0x56')]);if(_0x4536fa&&_0x4536fa[_0xd408('0x6a')]&&_0x4536fa['recordingFormat']!=='none'){logger[_0xd408('0x24')]('[OUTBOUND]',_0xd408('0x6b'));_0x33d9e1[_0xd408('0x58')]=util[_0xd408('0x1e')](_0xd408('0x59'),_0x553929[_0xd408('0x53')],_0x33d9e1[_0xd408('0x5a')],md5(_0x33d9e1[_0xd408('0x5a')]));}return getConnection(_0x553929)[_0xd408('0x2a')](function(_0x3d6763){_0x2ad81a=_0x3d6763;return getUser(_0x553929,_0x1fb9d2[_0xd408('0xa')],_0x2ad81a);})[_0xd408('0x2a')](function(_0xd68a7c){_0x35774c=_0xd68a7c;logger[_0xd408('0x24')](_0xd408('0x6c'),_0x35774c['id']);return getEndUser(_0x553929,_0x33d9e1[_0xd408('0x6d')],_0x33d9e1['destcalleridnum'],_0x2ad81a);})[_0xd408('0x2a')](function(_0x48552c){_0x23cff8=_0x48552c;logger[_0xd408('0x24')](_0xd408('0x5d'),_0x23cff8['id']);return getTicket(_0x553929,_0x35774c,_0x23cff8,_0x2b94e7,_0x33d9e1,_0x2b94e7['Fields'],_0x2ad81a,_0xd408('0x6e'));})['then'](function(_0x198285){_0x5142b5=_0x198285;logger[_0xd408('0x24')](_0xd408('0x6f'));logger[_0xd408('0x24')](_0xd408('0x60'),_0x5142b5['id']);return setRelationship(_0x2ad81a,_0x35774c,_0x5142b5,_0xd408('0x61'));})[_0xd408('0x2a')](function(){return setRelationship(_0x2ad81a,_0x23cff8,_0x5142b5,_0xd408('0x62'));})[_0xd408('0x2a')](function(){return getServerInfo(_0x2ad81a);})[_0xd408('0x2a')](function(_0x2f3553){var _0x42f619=parseInt(_0x2f3553[_0xd408('0x70')][_0xd408('0x63')](0x0));var _0x1c95a0=util[_0xd408('0x1e')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x553929['remoteUri'],_0x5142b5['id']);if(_0x42f619>0x6){_0x1c95a0=util['format'](_0xd408('0x64'),_0x553929['remoteUri'],_0x5142b5['id']);}logger[_0xd408('0x24')](_0xd408('0x71'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd408('0x1e')](_0xd408('0x67'),_0x1fb9d2['name']),_0xd408('0x72'),{'uri':_0x1c95a0});})[_0xd408('0x68')](function(_0xf55363){logger['error'](_0xd408('0x71'),JSON[_0xd408('0x1c')](_0xf55363));});};exports[_0xd408('0x73')]=function(_0x53049c,_0x533e80,_0x4fca66,_0x4dd778,_0x1a23ea,_0x4caff5){var _0x33a16e,_0x50f8a2,_0x28a1cb,_0x534014;_0x4caff5['remoteUri']=intUtil[_0xd408('0x52')](_0x4caff5[_0xd408('0x56')]);_0x4caff5['serverUrl']=intUtil[_0xd408('0x52')](_0x4caff5[_0xd408('0x53')]);def[_0xd408('0x54')]=util[_0xd408('0x1e')](_0xd408('0x55'),_0x4caff5[_0xd408('0x56')]);if(_0x1a23ea&&_0x1a23ea[_0xd408('0x57')]){logger['info']('[ABANDONED]',_0xd408('0x6b'));_0x533e80[_0xd408('0x58')]=util[_0xd408('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4caff5['serverUrl'],_0x533e80[_0xd408('0x5a')],md5(_0x533e80[_0xd408('0x5a')]));}else{_0x533e80['recordingURL']='';}return getConnection(_0x4caff5)[_0xd408('0x2a')](function(_0x353870){_0x534014=_0x353870;if(!_[_0xd408('0x74')](_0x4dd778)){return getUser(_0x4caff5,_0x4dd778[_0xd408('0xa')],_0x534014);}else{return getUser(_0x4caff5,null,_0x534014);}})['then'](function(_0xead6dc){_0x33a16e=_0xead6dc;logger[_0xd408('0x24')]('The\x20User\x20ID\x20is:',_0x33a16e['id']);return getEndUser(_0x4caff5,_0x533e80[_0xd408('0x5b')],_0x533e80[_0xd408('0x5c')],_0x534014);})[_0xd408('0x2a')](function(_0x541cf2){_0x50f8a2=_0x541cf2;logger[_0xd408('0x24')]('The\x20Enduser\x20ID\x20is:',_0x50f8a2['id']);return getTicket(_0x4caff5,_0x33a16e,_0x50f8a2,_0x4fca66,_0x533e80,_0x4fca66['Fields'],_0x534014,_0xd408('0x5f'));})[_0xd408('0x2a')](function(_0x30f75b){_0x28a1cb=_0x30f75b;logger[_0xd408('0x24')](_0xd408('0x6f'));logger['info'](_0xd408('0x60'),_0x28a1cb['id']);return setRelationship(_0x534014,_0x33a16e,_0x28a1cb,_0xd408('0x61'));})[_0xd408('0x2a')](function(){return setRelationship(_0x534014,_0x50f8a2,_0x28a1cb,_0xd408('0x62'));})[_0xd408('0x2a')](function(){return getServerInfo(_0x534014);})[_0xd408('0x68')](function(_0x9abd07){logger[_0xd408('0x69')](_0xd408('0x75'),JSON[_0xd408('0x1c')](_0x9abd07));});}; \ No newline at end of file +var _0x0b59=['queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','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','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','error','[ABANDONED]','isNil','Inbound','users','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','POST','emit','info','name','assigned_user_id','created_by','description','getString','Descriptions','slice','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','forEach','variableName','push','idField','JSON','Calls','format','Basic\x20%s','toString','get_server_info','stringify','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','string','nameField','customField','toLowerCase','content','type','custom_fields','customVariable','Variable','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship'];(function(_0x1da436,_0x2fab9d){var _0xe4468d=function(_0x7d74bd){while(--_0x7d74bd){_0x1da436['push'](_0x1da436['shift']());}};_0xe4468d(++_0x2fab9d);}(_0x0b59,0x18c));var _0x90b5=function(_0x592217,_0x3ff469){_0x592217=_0x592217-0x0;var _0x31538b=_0x0b59[_0x592217];return _0x31538b;};'use strict';var _=require('lodash');var rp=require(_0x90b5('0x0'));var BPromise=require(_0x90b5('0x1'));var md5=require(_0x90b5('0x2'));var util=require('util');var Redis=require(_0x90b5('0x3'));var intUtil=require(_0x90b5('0x4'));var config=require(_0x90b5('0x5'));var logger=require(_0x90b5('0x6'))('sugarcrm');config[_0x90b5('0x7')]=_[_0x90b5('0x8')](config[_0x90b5('0x7')],{'host':_0x90b5('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x90b5('0x7')]));var def={'method':_0x90b5('0xa'),'json':!![]};function emit(_0x2e5eb9,_0x4f1af7,_0x142d48){io['to'](_0x2e5eb9)[_0x90b5('0xb')](_0x4f1af7,_0x142d48);}function getTicket(_0x2a7e51,_0xbb898d,_0xc22a90,_0x254fec,_0x5cd645,_0x56e7c2,_0x1ddefe,_0x1a1ad){logger[_0x90b5('0xc')]('Creating\x20new\x20ticket...');var _0x43d89b=new Date();var _0x2a46dc=[{'name':_0x90b5('0xd'),'value':intUtil['getString'](_0x254fec['Subjects'],_0x5cd645,'\x20')},{'name':_0x90b5('0xe'),'value':_0xbb898d['id']},{'name':_0x90b5('0xf'),'value':_0xbb898d['id']},{'name':_0x90b5('0x10'),'value':intUtil[_0x90b5('0x11')](_0x254fec[_0x90b5('0x12')],_0x5cd645,'\x0a')},{'name':'date_start','value':_0x43d89b['toISOString']()[_0x90b5('0x13')](0x0,0x13)['replace']('T','\x20')},{'name':_0x90b5('0x14'),'value':'0'},{'name':_0x90b5('0x15'),'value':'15'},{'name':_0x90b5('0x16'),'value':_0xc22a90['id']},{'name':_0x90b5('0x17'),'value':'Contacts'},{'name':_0x90b5('0x18'),'value':_0xc22a90[_0x90b5('0xd')]},{'name':_0x90b5('0x19'),'value':_0x1a1ad}];if(_0x56e7c2['length']){_[_0x90b5('0x1a')](_0x56e7c2,function(_0x266731){if(_0x5cd645[_0x266731[_0x90b5('0x1b')]]){_0x2a46dc[_0x90b5('0x1c')]({'name':_0x266731[_0x90b5('0x1d')],'value':_0x5cd645[_0x266731[_0x90b5('0x1b')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x90b5('0x1e'),'response_type':_0x90b5('0x1e'),'rest_data':JSON['stringify']({'session':_0x1ddefe['id'],'module_name':_0x90b5('0x1f'),'name_value_list':_0x2a46dc})}});}function getAuth(_0x4591e0){return util[_0x90b5('0x20')](_0x90b5('0x21'),new Buffer(_0x4591e0['apiKey']+':X')[_0x90b5('0x22')]('base64'));}function getServerInfo(_0x257036){return request({'form':{'method':_0x90b5('0x23'),'input_type':_0x90b5('0x1e'),'response_type':_0x90b5('0x1e'),'rest_data':JSON[_0x90b5('0x24')]({'session':_0x257036['id']})}});}function getUser(_0x4c4cfa,_0x2ef9fd,_0x274187){if(!_['isNil'](_0x2ef9fd)){logger['info'](_0x90b5('0x25'),_0x2ef9fd);return request({'form':{'method':_0x90b5('0x26'),'input_type':_0x90b5('0x1e'),'response_type':_0x90b5('0x1e'),'rest_data':JSON['stringify']({'session':_0x274187['id'],'module_name':_0x90b5('0x27'),'query':util[_0x90b5('0x20')](_0x90b5('0x28'),_0x2ef9fd),'order_by':'','offset':'0','select_fields':['id','name',_0x90b5('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x90b5('0x2a')](function(_0x1c9d82){if(_0x1c9d82[_0x90b5('0x2b')][_0x90b5('0x2c')]){var _0x49b96b=_[_0x90b5('0x2d')](_0x1c9d82['entry_list'],function(_0xfb6d35){return _0xfb6d35[_0x90b5('0x2e')][_0x90b5('0x29')][_0x90b5('0x2f')]===_0x2ef9fd;});if(_0x49b96b){logger[_0x90b5('0xc')](_0x90b5('0x30'));return BPromise[_0x90b5('0x31')]({'id':_0x49b96b['name_value_list']['id']['value'],'name':_0x49b96b['name_value_list'][_0x90b5('0xd')]['value']});}}logger['info'](_0x90b5('0x32'));return BPromise['resolve']({'id':_0x274187[_0x90b5('0x2e')][_0x90b5('0x33')]['value'],'name':_0x274187[_0x90b5('0x2e')]['user_name'][_0x90b5('0x2f')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x90b5('0x31')]({'id':_0x274187[_0x90b5('0x2e')][_0x90b5('0x33')][_0x90b5('0x2f')],'name':_0x274187['name_value_list'][_0x90b5('0x29')][_0x90b5('0x2f')]});}}function getEndUser(_0x52b5e8,_0x342d67,_0xb9c0cb,_0x462af4){logger[_0x90b5('0xc')](_0x90b5('0x34'),_0xb9c0cb);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x90b5('0x1e'),'rest_data':JSON[_0x90b5('0x24')]({'session':_0x462af4['id'],'module_name':_0x90b5('0x35'),'query':util[_0x90b5('0x20')]('contacts.phone_home\x20=\x20\x22%s\x22',_0xb9c0cb),'order_by':'','offset':'0','select_fields':['id',_0x90b5('0xd'),_0x90b5('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x18d621){if(_0x18d621[_0x90b5('0x2b')]['length']){var _0x52cbb8=_[_0x90b5('0x2d')](_0x18d621['entry_list'],function(_0x1521b4){return _0x1521b4[_0x90b5('0x2e')]['phone_home'][_0x90b5('0x2f')]===_0xb9c0cb;});if(_0x52cbb8){logger['info'](_0x90b5('0x37'));return BPromise[_0x90b5('0x31')]({'id':_0x52cbb8[_0x90b5('0x2e')]['id'][_0x90b5('0x2f')],'name':_0x52cbb8[_0x90b5('0x2e')][_0x90b5('0xd')][_0x90b5('0x2f')],'phone':_0x52cbb8[_0x90b5('0x2e')]['phone_home'][_0x90b5('0x2f')]});}}else{logger[_0x90b5('0xc')](_0x90b5('0x38'));return request({'form':{'method':_0x90b5('0x39'),'input_type':_0x90b5('0x1e'),'response_type':_0x90b5('0x1e'),'rest_data':JSON['stringify']({'session':_0x462af4['id'],'module_name':_0x90b5('0x35'),'name_value_list':[{'name':_0x90b5('0x3a'),'value':_0x342d67!==_0x90b5('0x3b')?_0x342d67:util[_0x90b5('0x20')](_0x90b5('0x3c'),_0xb9c0cb)},{'name':_0x90b5('0x36'),'value':_0xb9c0cb}]})}})[_0x90b5('0x2a')](function(_0x186ea6){logger[_0x90b5('0xc')](_0x90b5('0x3d'));return BPromise[_0x90b5('0x31')]({'id':_0x186ea6['id'],'name':_0x186ea6[_0x90b5('0x2b')][_0x90b5('0x3a')]['value'],'phone':_0x186ea6[_0x90b5('0x2b')][_0x90b5('0x36')]['value']});});}});}function request(_0x3dd7e3){logger[_0x90b5('0x3e')]('[HTTP]',JSON[_0x90b5('0x24')](_0x3dd7e3));return rp(_[_0x90b5('0x3f')](def,_0x3dd7e3));}function getTags(_0x53d9af,_0xd7d963){var _0x3ff8e1=[];if(_0x53d9af&&_0x53d9af[_0x90b5('0x2c')]>0x0){_0x3ff8e1=_[_0x90b5('0x40')](_0x53d9af,_0xd7d963);}return _0x3ff8e1;}function getCustomFields(_0x3fe4f6,_0xf4045d){var _0x2f62f0=[];var _0x57077d={'custom_fields':[]};if(_0x3fe4f6[_0x90b5('0x2c')]>0x0){_[_0x90b5('0x1a')](_0x3fe4f6,function(_0x3df973){if(_0x3df973['type']===_0x90b5('0x41')&&_0x3df973[_0x90b5('0x42')]&&!_0x3df973[_0x90b5('0x43')]){_0x57077d[_0x3df973[_0x90b5('0x42')][_0x90b5('0x44')]()]=_0x3df973['content'][_0x90b5('0x22')]();}else if(_0x3df973['type']===_0x90b5('0x41')&&_0x3df973[_0x90b5('0x1d')]&&_0x3df973['customField']){_0x57077d['custom_fields']['push']({'id':_0x3df973[_0x90b5('0x1d')],'value':_0x3df973[_0x90b5('0x45')][_0x90b5('0x22')]()});}else if(_0x3df973[_0x90b5('0x46')]==='variable'&&_0x3df973['variableName']&&_0x3df973['idField']&&_0x3df973[_0x90b5('0x43')]){_0xf4045d[_0x3df973['variableName']]&&_0x57077d[_0x90b5('0x47')][_0x90b5('0x1c')]({'id':_0x3df973[_0x90b5('0x1d')],'value':_0xf4045d[_0x3df973[_0x90b5('0x1b')]][_0x90b5('0x22')]()});}else if(_0x3df973[_0x90b5('0x46')]===_0x90b5('0x48')&&_0x3df973['Variable']&&_0x3df973[_0x90b5('0x49')][_0x90b5('0xd')]&&_0x3df973[_0x90b5('0x1d')]&&_0x3df973['customField']){_0xf4045d[_0x3df973[_0x90b5('0x49')][_0x90b5('0xd')]['toLowerCase']()]&&_0x57077d[_0x90b5('0x47')]['push']({'id':_0x3df973[_0x90b5('0x1d')],'value':_0xf4045d[_0x3df973[_0x90b5('0x49')]['name'][_0x90b5('0x44')]()]['toString']()});}});}return _0x57077d;}function getConnection(_0x4ce892){return request({'method':'POST','form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x90b5('0x24')]({'user_auth':{'user_name':_0x4ce892['username'],'password':_0x4ce892[_0x90b5('0x4a')],'encryption':_0x90b5('0x4b')},'application':_0x90b5('0x4c')})}})[_0x90b5('0x2a')](function(_0x495a3d){var _0x20eb5f=_0x495a3d;if(_0x20eb5f['id']){def[_0x90b5('0x4d')]=_0x20eb5f['id'];return BPromise[_0x90b5('0x31')](_0x20eb5f);}else{throw new Error(util[_0x90b5('0x20')](_0x90b5('0x4e'),_0x4ce892['id']));}});}function setRelationship(_0x4417b3,_0x5d88a4,_0x2232ee,_0x3ef77f){return request({'form':{'method':_0x90b5('0x4f'),'input_type':_0x90b5('0x1e'),'response_type':'JSON','rest_data':JSON[_0x90b5('0x24')]({'session':_0x4417b3['id'],'module_name':_0x90b5('0x1f'),'module_id':_0x2232ee['id'],'link_field_name':_0x3ef77f,'related_ids':[_0x5d88a4['id']]})}});}exports[_0x90b5('0x50')]=function(_0x537cae,_0xa9d77,_0x73c889,_0x36e46a,_0x4276e7,_0x5ca115){var _0x33e55b,_0x4d377b,_0x24a010,_0x58615b;_0x5ca115[_0x90b5('0x51')]=intUtil[_0x90b5('0x52')](_0x5ca115['remoteUri']);_0x5ca115[_0x90b5('0x53')]=intUtil['stripTrailingSlash'](_0x5ca115['serverUrl']);def[_0x90b5('0x54')]=util[_0x90b5('0x20')]('%s/service/v4_1/rest.php',_0x5ca115[_0x90b5('0x51')]);if(_0x4276e7&&_0x4276e7[_0x90b5('0x55')]){logger['info'](_0x90b5('0x56'),_0x90b5('0x57'));_0xa9d77[_0x90b5('0x58')]=util[_0x90b5('0x20')](_0x90b5('0x59'),_0x5ca115[_0x90b5('0x53')],_0xa9d77[_0x90b5('0x5a')],md5(_0xa9d77[_0x90b5('0x5a')]));}else{_0xa9d77[_0x90b5('0x58')]='';}return getConnection(_0x5ca115)[_0x90b5('0x2a')](function(_0x1fae28){_0x58615b=_0x1fae28;return getUser(_0x5ca115,_0x36e46a[_0x90b5('0xd')],_0x58615b);})['then'](function(_0x501c03){_0x33e55b=_0x501c03;logger[_0x90b5('0xc')](_0x90b5('0x5b'),_0x33e55b['id']);return getEndUser(_0x5ca115,_0xa9d77[_0x90b5('0x5c')],_0xa9d77[_0x90b5('0x5d')],_0x58615b);})[_0x90b5('0x2a')](function(_0x46706b){_0x4d377b=_0x46706b;logger[_0x90b5('0xc')]('The\x20Enduser\x20ID\x20is:',_0x4d377b['id']);return getTicket(_0x5ca115,_0x33e55b,_0x4d377b,_0x73c889,_0xa9d77,_0x73c889[_0x90b5('0x5e')],_0x58615b,'Inbound');})[_0x90b5('0x2a')](function(_0x44e655){_0x24a010=_0x44e655;logger['info']('Ticket\x20created!');logger[_0x90b5('0xc')]('The\x20Ticket\x20ID\x20is:',_0x24a010['id']);return setRelationship(_0x58615b,_0x33e55b,_0x24a010,'users');})[_0x90b5('0x2a')](function(){return setRelationship(_0x58615b,_0x4d377b,_0x24a010,_0x90b5('0x5f'));})[_0x90b5('0x2a')](function(){return getServerInfo(_0x58615b);})[_0x90b5('0x2a')](function(_0x3a2a3f){var _0x3f025b=parseInt(_0x3a2a3f['version'][_0x90b5('0x60')](0x0));var _0x434762=util['format'](_0x90b5('0x61'),_0x5ca115['remoteUri'],_0x24a010['id']);if(_0x3f025b>0x6){_0x434762=util[_0x90b5('0x20')](_0x90b5('0x62'),_0x5ca115[_0x90b5('0x51')],_0x24a010['id']);}logger['info']('[QUEUE]',_0x90b5('0x63'));emit(util[_0x90b5('0x20')](_0x90b5('0x64'),_0x36e46a[_0x90b5('0xd')]),_0x90b5('0x65'),{'uri':_0x434762});})['catch'](function(_0x344708){logger['error'](_0x90b5('0x56'),JSON['stringify'](_0x344708));});};exports[_0x90b5('0x66')]=function(_0x118c03,_0x4de2e4,_0x519fe8,_0x38e0b0,_0x208664,_0x169fb9,_0x3a8807){var _0x4dc590,_0x134f4f,_0x4ead54,_0xf8ee7a;_0x169fb9['remoteUri']=intUtil[_0x90b5('0x52')](_0x169fb9[_0x90b5('0x51')]);_0x169fb9['serverUrl']=intUtil['stripTrailingSlash'](_0x169fb9[_0x90b5('0x53')]);def[_0x90b5('0x54')]=util[_0x90b5('0x20')](_0x90b5('0x67'),_0x169fb9['remoteUri']);if(_0x3a8807&&_0x3a8807[_0x90b5('0x68')]&&_0x3a8807[_0x90b5('0x68')]!==_0x90b5('0x69')){logger[_0x90b5('0xc')](_0x90b5('0x6a'),_0x90b5('0x57'));_0x4de2e4[_0x90b5('0x58')]=util[_0x90b5('0x20')](_0x90b5('0x59'),_0x169fb9['serverUrl'],_0x4de2e4['uniqueid'],md5(_0x4de2e4['uniqueid']));}return getConnection(_0x169fb9)[_0x90b5('0x2a')](function(_0x10be60){_0xf8ee7a=_0x10be60;return getUser(_0x169fb9,_0x38e0b0[_0x90b5('0xd')],_0xf8ee7a);})[_0x90b5('0x2a')](function(_0x1f2af5){_0x4dc590=_0x1f2af5;logger[_0x90b5('0xc')]('The\x20User\x20ID\x20is:',_0x4dc590['id']);return getEndUser(_0x169fb9,_0x4de2e4[_0x90b5('0x6b')],_0x4de2e4[_0x90b5('0x6c')],_0xf8ee7a);})['then'](function(_0x1260c6){_0x134f4f=_0x1260c6;logger[_0x90b5('0xc')](_0x90b5('0x6d'),_0x134f4f['id']);return getTicket(_0x169fb9,_0x4dc590,_0x134f4f,_0x519fe8,_0x4de2e4,_0x519fe8['Fields'],_0xf8ee7a,_0x90b5('0x6e'));})[_0x90b5('0x2a')](function(_0xa56344){_0x4ead54=_0xa56344;logger[_0x90b5('0xc')](_0x90b5('0x6f'));logger[_0x90b5('0xc')](_0x90b5('0x70'),_0x4ead54['id']);return setRelationship(_0xf8ee7a,_0x4dc590,_0x4ead54,'users');})[_0x90b5('0x2a')](function(){return setRelationship(_0xf8ee7a,_0x134f4f,_0x4ead54,'contacts');})[_0x90b5('0x2a')](function(){return getServerInfo(_0xf8ee7a);})[_0x90b5('0x2a')](function(_0x1c379b){var _0x346bc7=parseInt(_0x1c379b[_0x90b5('0x71')][_0x90b5('0x60')](0x0));var _0x2b218d=util[_0x90b5('0x20')](_0x90b5('0x61'),_0x169fb9[_0x90b5('0x51')],_0x4ead54['id']);if(_0x346bc7>0x6){_0x2b218d=util[_0x90b5('0x20')](_0x90b5('0x62'),_0x169fb9[_0x90b5('0x51')],_0x4ead54['id']);}logger['info'](_0x90b5('0x6a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x90b5('0x64'),_0x38e0b0['name']),_0x90b5('0x65'),{'uri':_0x2b218d});})['catch'](function(_0x1c3eaa){logger[_0x90b5('0x72')]('[OUTBOUND]',JSON['stringify'](_0x1c3eaa));});};exports['abandoned']=function(_0x1e98f5,_0x230af0,_0x4b6f07,_0x15552d,_0x6db280,_0x1341ee){var _0x19d9db,_0x10a265,_0x5329af,_0x49ccce;_0x1341ee[_0x90b5('0x51')]=intUtil[_0x90b5('0x52')](_0x1341ee['remoteUri']);_0x1341ee['serverUrl']=intUtil['stripTrailingSlash'](_0x1341ee[_0x90b5('0x53')]);def[_0x90b5('0x54')]=util[_0x90b5('0x20')](_0x90b5('0x67'),_0x1341ee[_0x90b5('0x51')]);if(_0x6db280&&_0x6db280['monitor_format']){logger[_0x90b5('0xc')](_0x90b5('0x73'),_0x90b5('0x57'));_0x230af0[_0x90b5('0x58')]=util[_0x90b5('0x20')](_0x90b5('0x59'),_0x1341ee[_0x90b5('0x53')],_0x230af0['uniqueid'],md5(_0x230af0[_0x90b5('0x5a')]));}else{_0x230af0[_0x90b5('0x58')]='';}return getConnection(_0x1341ee)[_0x90b5('0x2a')](function(_0x7e270){_0x49ccce=_0x7e270;if(!_[_0x90b5('0x74')](_0x15552d)){return getUser(_0x1341ee,_0x15552d[_0x90b5('0xd')],_0x49ccce);}else{return getUser(_0x1341ee,null,_0x49ccce);}})[_0x90b5('0x2a')](function(_0x3b8ef7){_0x19d9db=_0x3b8ef7;logger['info'](_0x90b5('0x5b'),_0x19d9db['id']);return getEndUser(_0x1341ee,_0x230af0[_0x90b5('0x5c')],_0x230af0[_0x90b5('0x5d')],_0x49ccce);})['then'](function(_0x139c86){_0x10a265=_0x139c86;logger['info'](_0x90b5('0x6d'),_0x10a265['id']);return getTicket(_0x1341ee,_0x19d9db,_0x10a265,_0x4b6f07,_0x230af0,_0x4b6f07[_0x90b5('0x5e')],_0x49ccce,_0x90b5('0x75'));})[_0x90b5('0x2a')](function(_0x5a2dda){_0x5329af=_0x5a2dda;logger[_0x90b5('0xc')](_0x90b5('0x6f'));logger[_0x90b5('0xc')]('The\x20Ticket\x20ID\x20is:',_0x5329af['id']);return setRelationship(_0x49ccce,_0x19d9db,_0x5329af,_0x90b5('0x76'));})[_0x90b5('0x2a')](function(){return setRelationship(_0x49ccce,_0x10a265,_0x5329af,_0x90b5('0x5f'));})[_0x90b5('0x2a')](function(){return getServerInfo(_0x49ccce);})['catch'](function(_0x661584){logger[_0x90b5('0x72')](_0x90b5('0x73'),JSON[_0x90b5('0x24')](_0x661584));});}; \ 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 f1c70fd..f1ce001 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 _0x4a01=['keyContent','keyType','variable','stripTrailingSlash','substring','lastIndexOf','isNil','lodash','util','getString','sortBy','length','type','string','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s'];(function(_0x595447,_0x91502b){var _0x2cef8e=function(_0x25d8ee){while(--_0x25d8ee){_0x595447['push'](_0x595447['shift']());}};_0x2cef8e(++_0x91502b);}(_0x4a01,0x6f));var _0x14a0=function(_0x28f4fd,_0x166792){_0x28f4fd=_0x28f4fd-0x0;var _0x29e017=_0x4a01[_0x28f4fd];return _0x29e017;};'use strict';var _=require(_0x14a0('0x0'));var util=require(_0x14a0('0x1'));exports[_0x14a0('0x2')]=function(_0x4f6553,_0x1018ae,_0x15711d){var _0x47492a=[];if(_0x4f6553['length']>0x0){var _0x22d775=_[_0x14a0('0x3')](_0x4f6553,['id']);for(var _0x2fb11a=0x0;_0x2fb11a<_0x22d775[_0x14a0('0x4')];_0x2fb11a++){var _0x171b11=_0x22d775[_0x2fb11a];if(_0x171b11[_0x14a0('0x5')]===_0x14a0('0x6')){_0x47492a[_0x14a0('0x7')](_0x171b11[_0x14a0('0x8')]);}else if(_0x171b11[_0x14a0('0x5')]==='variable'&&_0x171b11[_0x14a0('0x9')]){_0x1018ae[_0x171b11[_0x14a0('0x9')]]&&_0x47492a[_0x14a0('0x7')](_0x1018ae[_0x171b11['variableName']][_0x14a0('0xa')]());}else if(_0x171b11[_0x14a0('0x5')]===_0x14a0('0xb')&&_0x171b11[_0x14a0('0xc')]&&_0x171b11[_0x14a0('0xc')][_0x14a0('0xd')]){_0x1018ae[_0x171b11[_0x14a0('0xc')][_0x14a0('0xd')][_0x14a0('0xe')]()]&&_0x47492a[_0x14a0('0x7')](_0x1018ae[_0x171b11[_0x14a0('0xc')][_0x14a0('0xd')][_0x14a0('0xe')]()][_0x14a0('0xa')]());}else if(_0x171b11[_0x14a0('0x5')]===_0x14a0('0xf')){if(_0x171b11['keyType']===_0x14a0('0x6')&&_0x171b11[_0x14a0('0x10')]){_0x47492a['push'](util[_0x14a0('0x11')](_0x14a0('0x12'),_0x171b11[_0x14a0('0x10')],_0x171b11[_0x14a0('0x13')]));}else if(_0x171b11[_0x14a0('0x14')]===_0x14a0('0x15')&&_0x171b11[_0x14a0('0x9')]&&_0x171b11[_0x14a0('0x10')]){_0x1018ae[_0x171b11[_0x14a0('0x9')]]&&_0x47492a[_0x14a0('0x7')](util[_0x14a0('0x11')](_0x14a0('0x12'),_0x171b11[_0x14a0('0x10')],_0x1018ae[_0x171b11[_0x14a0('0x9')]]));}else if(_0x171b11['keyType']===_0x14a0('0xb')&&_0x171b11[_0x14a0('0xc')]&&_0x171b11[_0x14a0('0xc')]['name']&&_0x171b11[_0x14a0('0x10')]){_0x1018ae[_0x171b11['Variable']['name']['toLowerCase']()]&&_0x47492a[_0x14a0('0x7')](util[_0x14a0('0x11')]('%s:\x20%s',_0x171b11[_0x14a0('0x10')],_0x1018ae[_0x171b11[_0x14a0('0xc')][_0x14a0('0xd')]['toLowerCase']()]));}}}}return _0x47492a['join'](_0x15711d);};exports[_0x14a0('0x16')]=function(_0x3a69e6){var _0x409099=_0x3a69e6['slice'](-0x1);if(_0x409099==='/'){_0x3a69e6=_0x3a69e6[_0x14a0('0x17')](0x0,_0x3a69e6[_0x14a0('0x18')](_0x409099));}return _0x3a69e6;};exports['validateEmail']=function(_0x2d3c33){if(!_[_0x14a0('0x19')](_0x2d3c33)&&_0x2d3c33!==''){var _0x26dd4b=/^(([^<>()\[\]\\.,;:\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 _0x26dd4b['test'](String(_0x2d3c33)[_0x14a0('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x872a=['variableName','toString','Variable','name','toLowerCase','keyType','key','%s:\x20%s','keyContent','format','customVariable','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','lodash','getString','length','sortBy','string','push','content','type','variable'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x872a,0xad));var _0xa872=function(_0x5815c2,_0x454a8a){_0x5815c2=_0x5815c2-0x0;var _0x1fe394=_0x872a[_0x5815c2];return _0x1fe394;};'use strict';var _=require(_0xa872('0x0'));var util=require('util');exports[_0xa872('0x1')]=function(_0xe6aef8,_0x1e24de,_0x48e8bb){var _0x5c50db=[];if(_0xe6aef8[_0xa872('0x2')]>0x0){var _0x5f1a56=_[_0xa872('0x3')](_0xe6aef8,['id']);for(var _0x56eced=0x0;_0x56eced<_0x5f1a56[_0xa872('0x2')];_0x56eced++){var _0x330831=_0x5f1a56[_0x56eced];if(_0x330831['type']===_0xa872('0x4')){_0x5c50db[_0xa872('0x5')](_0x330831[_0xa872('0x6')]);}else if(_0x330831[_0xa872('0x7')]===_0xa872('0x8')&&_0x330831[_0xa872('0x9')]){_0x1e24de[_0x330831['variableName']]&&_0x5c50db[_0xa872('0x5')](_0x1e24de[_0x330831[_0xa872('0x9')]][_0xa872('0xa')]());}else if(_0x330831[_0xa872('0x7')]==='customVariable'&&_0x330831[_0xa872('0xb')]&&_0x330831[_0xa872('0xb')][_0xa872('0xc')]){_0x1e24de[_0x330831[_0xa872('0xb')][_0xa872('0xc')][_0xa872('0xd')]()]&&_0x5c50db[_0xa872('0x5')](_0x1e24de[_0x330831['Variable'][_0xa872('0xc')][_0xa872('0xd')]()][_0xa872('0xa')]());}else if(_0x330831['type']==='keyValue'){if(_0x330831[_0xa872('0xe')]===_0xa872('0x4')&&_0x330831[_0xa872('0xf')]){_0x5c50db[_0xa872('0x5')](util['format'](_0xa872('0x10'),_0x330831[_0xa872('0xf')],_0x330831[_0xa872('0x11')]));}else if(_0x330831[_0xa872('0xe')]===_0xa872('0x8')&&_0x330831[_0xa872('0x9')]&&_0x330831['key']){_0x1e24de[_0x330831[_0xa872('0x9')]]&&_0x5c50db[_0xa872('0x5')](util[_0xa872('0x12')]('%s:\x20%s',_0x330831['key'],_0x1e24de[_0x330831[_0xa872('0x9')]]));}else if(_0x330831[_0xa872('0xe')]===_0xa872('0x13')&&_0x330831[_0xa872('0xb')]&&_0x330831[_0xa872('0xb')][_0xa872('0xc')]&&_0x330831[_0xa872('0xf')]){_0x1e24de[_0x330831[_0xa872('0xb')]['name'][_0xa872('0xd')]()]&&_0x5c50db[_0xa872('0x5')](util[_0xa872('0x12')](_0xa872('0x10'),_0x330831['key'],_0x1e24de[_0x330831[_0xa872('0xb')][_0xa872('0xc')][_0xa872('0xd')]()]));}}}}return _0x5c50db['join'](_0x48e8bb);};exports[_0xa872('0x14')]=function(_0x42ec7b){var _0x35952e=_0x42ec7b['slice'](-0x1);if(_0x35952e==='/'){_0x42ec7b=_0x42ec7b[_0xa872('0x15')](0x0,_0x42ec7b[_0xa872('0x16')](_0x35952e));}return _0x42ec7b;};exports[_0xa872('0x17')]=function(_0x231026){if(!_[_0xa872('0x18')](_0x231026)&&_0x231026!==''){var _0x434cfe=/^(([^<>()\[\]\\.,;:\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 _0x434cfe[_0xa872('0x19')](String(_0x231026)[_0xa872('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 6acf8c8..f4f51b5 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['Normal','getString','Subjects','Descriptions','POST','format','%s/webservice.php','remoteUri','username','stringify','then','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','Agent\x20found!','email1','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','userId','admin','getUser','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','create','Enduser\x20created.','lastname','phone','getEndUser','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Fields','Ticket\x20created!','[OUTBOUND]','user:%s','abandoned','[ABANDONED]','lodash','bluebird','md5','util','../../../../config/environment','vTiger','redis','defaults','localhost','emit','forEach','string','idField','content','type','variable','variableName','toString','Variable','name','info','Creating\x20new\x20ticket...','merge'];(function(_0x317865,_0x44146d){var _0x4b2652=function(_0x592478){while(--_0x592478){_0x317865['push'](_0x317865['shift']());}};_0x4b2652(++_0x44146d);}(_0x3e74,0x175));var _0x43e7=function(_0x4330a9,_0x52ae66){_0x4330a9=_0x4330a9-0x0;var _0x374e49=_0x3e74[_0x4330a9];return _0x374e49;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var BPromise=require(_0x43e7('0x1'));var md5=require(_0x43e7('0x2'));var util=require(_0x43e7('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x43e7('0x4'));var logger=require('../../../../config/logger')(_0x43e7('0x5'));config[_0x43e7('0x6')]=_[_0x43e7('0x7')](config[_0x43e7('0x6')],{'host':_0x43e7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43e7('0x6')]));function emit(_0x3491d6,_0x2ede2d,_0x8528fc){io['to'](_0x3491d6)[_0x43e7('0x9')](_0x2ede2d,_0x8528fc);}function getCustomFields(_0x516b4d,_0x212c6c){var _0x554d44={};if(_0x516b4d['length']>0x0){_[_0x43e7('0xa')](_0x516b4d,function(_0x4139c9){if(_0x4139c9['type']===_0x43e7('0xb')&&_0x4139c9['idField']){_0x554d44[_0x4139c9[_0x43e7('0xc')]]=_0x4139c9[_0x43e7('0xd')]['toString']();}else if(_0x4139c9[_0x43e7('0xe')]===_0x43e7('0xf')&&_0x4139c9[_0x43e7('0x10')]&&_0x4139c9[_0x43e7('0xc')]&&_0x212c6c[_0x4139c9['variableName']]){_0x554d44[_0x4139c9['idField']]=_0x212c6c[_0x4139c9[_0x43e7('0x10')]][_0x43e7('0x11')]();}else if(_0x4139c9[_0x43e7('0xe')]==='customVariable'&&_0x4139c9['Variable']&&_0x4139c9[_0x43e7('0x12')][_0x43e7('0x13')]&&_0x4139c9[_0x43e7('0xc')]&&_0x212c6c[_0x4139c9[_0x43e7('0x12')]['name']['toLowerCase']()]){_0x554d44[_0x4139c9[_0x43e7('0xc')]]=_0x212c6c[_0x4139c9[_0x43e7('0x12')][_0x43e7('0x13')]['toLowerCase']()]['toString']();}});}return _0x554d44;}function createTicket(_0x446986,_0x1ca758,_0x9037d3,_0x140657,_0x3776f5,_0x1f24fb,_0x619236){logger[_0x43e7('0x14')](_0x43e7('0x15'));var _0xab63cf=_[_0x43e7('0x16')]({'parent_id':'','assigned_user_id':_0x1ca758['id'],'ticketpriorities':_0x43e7('0x17'),'ticketstatus':'Open','ticket_title':intUtil[_0x43e7('0x18')](_0x140657[_0x43e7('0x19')],_0x3776f5,'\x20'),'description':intUtil['getString'](_0x140657[_0x43e7('0x1a')],_0x3776f5,'\x0a'),'contact_id':_0x9037d3['id']},getCustomFields(_0x1f24fb,_0x3776f5));var _0x3e281e={'method':_0x43e7('0x1b'),'uri':util[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986[_0x43e7('0x1e')]),'form':{'operation':'create','username':_0x446986[_0x43e7('0x1f')],'sessionName':_0x619236['sessionName'],'elementType':'HelpDesk','element':JSON[_0x43e7('0x20')](_0xab63cf)},'json':!![]};return request(_0x3e281e)[_0x43e7('0x21')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x22')]){return BPromise['resolve']({'id':_0x4b2b9f[_0x43e7('0x23')]['id']});}else{throw new Error(util['format'](_0x43e7('0x24'),JSON[_0x43e7('0x20')](_0x4b2b9f[_0x43e7('0x25')])));}})[_0x43e7('0x26')](function(_0x51f4d7){var _0x52b7b3=_0x51f4d7[_0x43e7('0x27')]||0x1f4;logger['error'](_0x43e7('0x28'),_0x43e7('0x29'),_0x52b7b3,JSON[_0x43e7('0x20')](_0x51f4d7));});}function getUser(_0xb1fc63,_0x5087d7,_0x33a1a5){if(intUtil[_0x43e7('0x2a')](_0x5087d7)){logger[_0x43e7('0x14')](_0x43e7('0x2b'),_0x5087d7);return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')](_0x43e7('0x1d'),_0xb1fc63[_0x43e7('0x1e')]),'qs':{'operation':_0x43e7('0x2d'),'username':_0xb1fc63[_0x43e7('0x1f')],'sessionName':_0x33a1a5[_0x43e7('0x2e')],'query':util[_0x43e7('0x1c')](_0x43e7('0x2f'),_0x5087d7)},'json':!![]})[_0x43e7('0x21')](function(_0x4bdb17){if(_0x4bdb17[_0x43e7('0x22')]&&_0x4bdb17[_0x43e7('0x23')][_0x43e7('0x30')]){logger[_0x43e7('0x14')](_0x43e7('0x31'));return BPromise['resolve']({'id':_0x4bdb17[_0x43e7('0x23')][0x0]['id'],'email':_0x4bdb17[_0x43e7('0x23')][0x0][_0x43e7('0x32')],'name':_0x4bdb17[_0x43e7('0x23')][0x0]['first_name']+'\x20'+_0x4bdb17['result']['last_name']});}else{logger[_0x43e7('0x14')](_0x43e7('0x33'));return BPromise[_0x43e7('0x34')]({'id':_0x33a1a5[_0x43e7('0x35')],'email':_0xb1fc63[_0x43e7('0x1f')],'name':_0x43e7('0x36')});}})['catch'](function(_0x47baee){var _0x4ac23d=_0x47baee['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x4ac23d,JSON[_0x43e7('0x20')](_0x47baee));});}else{logger['info'](_0x43e7('0x33'));return BPromise[_0x43e7('0x34')]({'id':_0x33a1a5[_0x43e7('0x35')],'email':_0xb1fc63[_0x43e7('0x1f')],'name':_0x43e7('0x36')})[_0x43e7('0x26')](function(_0x101d45){var _0x4f1a5f=_0x101d45['statusCode']||0x1f4;logger['error'](_0x43e7('0x28'),_0x43e7('0x37'),_0x4f1a5f,JSON[_0x43e7('0x20')](_0x101d45));});}}function getEndUser(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589){logger[_0x43e7('0x14')]('Searching\x20end\x20user\x20with\x20phone',_0x1ed538);return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')]('%s/webservice.php',_0x16cdba[_0x43e7('0x1e')]),'qs':{'operation':'query','username':_0x16cdba[_0x43e7('0x1f')],'sessionName':_0x1d4589[_0x43e7('0x2e')],'query':util[_0x43e7('0x1c')](_0x43e7('0x38'),_0x1ed538,_0x1ed538,_0x1ed538,_0x1ed538,_0x1ed538)},'json':!![]})[_0x43e7('0x21')](function(_0x234d8f){if(_0x234d8f['success']&&_0x234d8f['result'][_0x43e7('0x30')]){logger[_0x43e7('0x14')](_0x43e7('0x39'));return BPromise[_0x43e7('0x34')]({'id':_0x234d8f[_0x43e7('0x23')][0x0]['id'],'name':_0x234d8f['result'][0x0][_0x43e7('0x3a')]+'\x20'+_0x234d8f[_0x43e7('0x23')][0x0]['lastname'],'phone':_0x1ed538});}else{logger[_0x43e7('0x14')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x43e7('0x1b'),'uri':util['format'](_0x43e7('0x1d'),_0x16cdba[_0x43e7('0x1e')]),'form':{'operation':_0x43e7('0x3b'),'sessionName':_0x1d4589[_0x43e7('0x2e')],'elementType':'Contacts','element':JSON['stringify']({'lastname':_0x1b1440,'phone':_0x1ed538,'assigned_user_id':'\x20'})},'json':!![]})[_0x43e7('0x21')](function(_0x40c509){logger[_0x43e7('0x14')](_0x43e7('0x3c'));return BPromise['resolve']({'id':_0x40c509['result']['id'],'name':_0x40c509['result'][_0x43e7('0x3d')],'phone':_0x40c509['result'][_0x43e7('0x3e')]});})['catch'](function(_0x5b28db){var _0x46b2e6=_0x5b28db['statusCode']||0x1f4;logger[_0x43e7('0x25')](_0x43e7('0x28'),_0x43e7('0x3f'),_0x46b2e6,JSON[_0x43e7('0x20')](_0x5b28db));});}});}function getConnection(_0x4fc5e8){var _0x91f1e4=_0x4fc5e8[_0x43e7('0x1f')];var _0x23a611=_0x4fc5e8[_0x43e7('0x40')];return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')]('%s/webservice.php',_0x4fc5e8['remoteUri']),'qs':{'operation':_0x43e7('0x41'),'username':_0x91f1e4},'json':!![]})[_0x43e7('0x21')](function(_0x212841){if(_0x212841['success']){return request({'method':'POST','uri':util['format'](_0x43e7('0x1d'),_0x4fc5e8[_0x43e7('0x1e')]),'form':{'operation':'login','username':_0x91f1e4,'accessKey':md5(_0x212841[_0x43e7('0x23')][_0x43e7('0x42')]+_0x23a611)},'json':!![]});}})[_0x43e7('0x21')](function(_0x560329){if(_0x560329['success']){return BPromise['resolve'](_0x560329['result']);}else{throw new Error(util[_0x43e7('0x1c')](_0x43e7('0x43'),_0x4fc5e8['id']));}})['catch'](function(_0x23e7cb){var _0x82d32f=_0x23e7cb[_0x43e7('0x27')]||0x1f4;logger[_0x43e7('0x25')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x43e7('0x44'),_0x82d32f,JSON['stringify'](_0x23e7cb));});}function request(_0x4bebd4){logger[_0x43e7('0x14')](_0x43e7('0x45'),JSON[_0x43e7('0x20')](_0x4bebd4));return rp(_0x4bebd4);}exports[_0x43e7('0x46')]=function(_0x13503c,_0x2351cf,_0x1cd87c,_0x256ddd,_0x473fca,_0x2b5515){var _0x58dfd0,_0x119d34,_0x46c910,_0x499c03;_0x2b5515[_0x43e7('0x1e')]=intUtil['stripTrailingSlash'](_0x2b5515[_0x43e7('0x1e')]);if(_0x473fca&&_0x473fca[_0x43e7('0x47')]){logger[_0x43e7('0x14')](_0x43e7('0x48'),_0x43e7('0x49'));_0x2351cf['recordingURL']=util['format'](_0x43e7('0x4a'),_0x2b5515[_0x43e7('0x4b')],_0x2351cf[_0x43e7('0x4c')],md5(_0x2351cf[_0x43e7('0x4c')]));}else{_0x2351cf[_0x43e7('0x4d')]='';}return getConnection(_0x2b5515)[_0x43e7('0x21')](function(_0xa47464){_0x499c03=_0xa47464;return getUser(_0x2b5515,_0x256ddd[_0x43e7('0x4e')],_0x499c03);})[_0x43e7('0x21')](function(_0x24e758){_0x58dfd0=_0x24e758;logger[_0x43e7('0x14')]('The\x20User\x20ID\x20is:',_0x58dfd0['id']);return getEndUser(_0x2b5515,_0x2351cf[_0x43e7('0x4f')],_0x2351cf[_0x43e7('0x50')],_0x499c03);})['then'](function(_0x4314d8){_0x119d34=_0x4314d8;logger[_0x43e7('0x14')](_0x43e7('0x51'),_0x119d34['id']);return createTicket(_0x2b5515,_0x58dfd0,_0x119d34,_0x1cd87c,_0x2351cf,_0x1cd87c['Fields'],_0x499c03);})['then'](function(_0x459c13){_0x46c910=_0x459c13;logger[_0x43e7('0x14')]('Ticket\x20created!');logger[_0x43e7('0x14')]('The\x20Ticket\x20ID\x20is:',_0x46c910['id']);var _0x49a6ce=util[_0x43e7('0x1c')](_0x43e7('0x52'),_0x2b5515[_0x43e7('0x1e')],_[_0x43e7('0x53')](_0x46c910['id'],'x')[0x1]);logger[_0x43e7('0x14')]('[QUEUE]',_0x43e7('0x54'));emit(util[_0x43e7('0x1c')]('user:%s',_0x256ddd[_0x43e7('0x13')]),_0x43e7('0x55'),{'uri':_0x49a6ce});})[_0x43e7('0x26')](function(_0x5bb536){logger['error']('[QUEUE]',JSON[_0x43e7('0x20')](_0x5bb536));});};exports[_0x43e7('0x56')]=function(_0x323cf7,_0x3a6404,_0x52ea9c,_0x5a50fc,_0x1b27da,_0x8b50bb,_0x140438){var _0x5dd349,_0x5ea0db,_0x4438c0,_0x1a7cb5;_0x8b50bb[_0x43e7('0x1e')]=intUtil[_0x43e7('0x57')](_0x8b50bb[_0x43e7('0x1e')]);_0x8b50bb[_0x43e7('0x4b')]=intUtil[_0x43e7('0x57')](_0x8b50bb[_0x43e7('0x4b')]);if(_0x140438&&_0x140438[_0x43e7('0x58')]&&_0x140438[_0x43e7('0x58')]!==_0x43e7('0x59')){logger['info']('[OUTBOUND]',_0x43e7('0x49'));_0x3a6404['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8b50bb[_0x43e7('0x4b')],_0x3a6404[_0x43e7('0x4c')],md5(_0x3a6404['uniqueid']));}return getConnection(_0x8b50bb)[_0x43e7('0x21')](function(_0x135791){_0x1a7cb5=_0x135791;return getUser(_0x8b50bb,_0x5a50fc[_0x43e7('0x4e')],_0x1a7cb5);})['then'](function(_0x2b7406){_0x5dd349=_0x2b7406;logger[_0x43e7('0x14')](_0x43e7('0x5a'),_0x5dd349['id']);return getEndUser(_0x8b50bb,_0x3a6404[_0x43e7('0x5b')],_0x3a6404[_0x43e7('0x5c')],_0x1a7cb5);})[_0x43e7('0x21')](function(_0x1e02fa){_0x5ea0db=_0x1e02fa;logger['info'](_0x43e7('0x51'),_0x5ea0db['id']);return createTicket(_0x8b50bb,_0x5dd349,_0x5ea0db,_0x52ea9c,_0x3a6404,_0x52ea9c[_0x43e7('0x5d')],_0x1a7cb5);})[_0x43e7('0x21')](function(_0x549f4e){_0x4438c0=_0x549f4e;logger['info'](_0x43e7('0x5e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4438c0['id']);var _0x1b793d=util[_0x43e7('0x1c')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x8b50bb[_0x43e7('0x1e')],_[_0x43e7('0x53')](_0x4438c0['id'],'x')[0x1]);logger[_0x43e7('0x14')](_0x43e7('0x5f'),_0x43e7('0x54'));emit(util[_0x43e7('0x1c')](_0x43e7('0x60'),_0x5a50fc['name']),_0x43e7('0x55'),{'uri':_0x1b793d});})[_0x43e7('0x26')](function(_0x4e5956){logger[_0x43e7('0x25')]('[OUTBOUND]',JSON[_0x43e7('0x20')](_0x4e5956));});};exports[_0x43e7('0x61')]=function(_0x37301b,_0x1ca24b,_0x506361,_0x2d25b5,_0x2646c2,_0xf929a5){var _0x556001,_0x17889c,_0x38fa5b,_0x219dc6;_0xf929a5[_0x43e7('0x1e')]=intUtil[_0x43e7('0x57')](_0xf929a5['remoteUri']);_0xf929a5[_0x43e7('0x4b')]=intUtil[_0x43e7('0x57')](_0xf929a5[_0x43e7('0x4b')]);if(_0x2646c2&&_0x2646c2[_0x43e7('0x47')]){logger[_0x43e7('0x14')](_0x43e7('0x62'),_0x43e7('0x49'));_0x1ca24b['recordingURL']=util['format'](_0x43e7('0x4a'),_0xf929a5['serverUrl'],_0x1ca24b['uniqueid'],md5(_0x1ca24b['uniqueid']));}else{_0x1ca24b[_0x43e7('0x4d')]='';}return getConnection(_0xf929a5)[_0x43e7('0x21')](function(_0x230fda){_0x219dc6=_0x230fda;return getUser(_0xf929a5,'',_0x219dc6);})[_0x43e7('0x21')](function(_0x18713b){_0x556001=_0x18713b;logger[_0x43e7('0x14')]('The\x20User\x20ID\x20is:',_0x556001['id']);return getEndUser(_0xf929a5,_0x1ca24b[_0x43e7('0x4f')],_0x1ca24b[_0x43e7('0x50')],_0x219dc6);})[_0x43e7('0x21')](function(_0x5b4c76){_0x17889c=_0x5b4c76;logger[_0x43e7('0x14')](_0x43e7('0x51'),_0x17889c['id']);return createTicket(_0xf929a5,_0x556001,_0x17889c,_0x506361,_0x1ca24b,_0x506361[_0x43e7('0x5d')],_0x219dc6);})[_0x43e7('0x21')](function(_0x1afea6){_0x38fa5b=_0x1afea6;logger[_0x43e7('0x14')](_0x43e7('0x5e'));logger[_0x43e7('0x14')]('The\x20Ticket\x20ID\x20is:',_0x38fa5b['id']);})['catch'](function(_0x55990c){logger[_0x43e7('0x25')](_0x43e7('0x62'),JSON['stringify'](_0x55990c));});}; \ No newline at end of file +var _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(_0x130ac7,_0x10b492){var _0x69fef2=function(_0x249f71){while(--_0x249f71){_0x130ac7['push'](_0x130ac7['shift']());}};_0x69fef2(++_0x10b492);}(_0xedd9,0xfc));var _0x9edd=function(_0x381c51,_0x15afd6){_0x381c51=_0x381c51-0x0;var _0x308326=_0xedd9[_0x381c51];return _0x308326;};'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 74daec2..25f3286 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 _0xa9bb=['inspect','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','trigger:browser:url','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','The\x20User\x20ID\x20is:','calleridname','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','then','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','length','end-user','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','password','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','type','customField','nameField','toLowerCase','content','string','idField','push','variable','variableName','custom_fields','Variable','name','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0xa9bb,0x1bc));var _0xba9b=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xa9bb[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var rp=require(_0xba9b('0x0'));var md5=require(_0xba9b('0x1'));var util=require(_0xba9b('0x2'));var Redis=require(_0xba9b('0x3'));var intUtil=require(_0xba9b('0x4'));var config=require(_0xba9b('0x5'));var logger=require('../../../../config/logger')(_0xba9b('0x6'));config[_0xba9b('0x7')]=_[_0xba9b('0x8')](config[_0xba9b('0x7')],{'host':_0xba9b('0x9'),'port':0x18eb});var io=require(_0xba9b('0xa'))(new Redis(config[_0xba9b('0x7')]));function emit(_0x13ae74,_0x3b01c4,_0x401934){io['to'](_0x13ae74)[_0xba9b('0xb')](_0x3b01c4,_0x401934);}var headers={'Content-Type':_0xba9b('0xc'),'Accept':_0xba9b('0xc')};function getTicket(_0x5eca7f,_0x154808,_0x479d70,_0x86b945,_0x2a1bb9){logger[_0xba9b('0xd')](_0xba9b('0xe'));return request({'uri':util[_0xba9b('0xf')](_0xba9b('0x10'),_0x5eca7f[_0xba9b('0x11')]),'method':_0xba9b('0x12'),'body':{'ticket':_[_0xba9b('0x13')]({'requester_id':_0x479d70['id'],'submitter_id':_0x154808?_0x154808['id']:undefined,'assignee_id':_0x154808?_0x154808['id']:undefined,'tags':getTags(_0x86b945['Tags'],'name'),'subject':intUtil[_0xba9b('0x14')](_0x86b945[_0xba9b('0x15')],_0x2a1bb9,'\x20'),'description':intUtil['getString'](_0x86b945['Descriptions'],_0x2a1bb9,'\x0a'),'comment':{'public':![],'body':intUtil[_0xba9b('0x14')](_0x86b945[_0xba9b('0x16')],_0x2a1bb9,'\x0a')}},getCustomFields(_0x86b945[_0xba9b('0x17')],_0x2a1bb9))}})['then'](function(_0x2cb9d8){logger[_0xba9b('0xd')](_0xba9b('0x18'));return _0x2cb9d8[_0xba9b('0x19')];});}function getUser(_0xb68fde,_0x1efd23){if(intUtil['validateEmail'](_0x1efd23)){logger[_0xba9b('0xd')](_0xba9b('0x1a'),_0x1efd23);return request({'uri':util[_0xba9b('0xf')](_0xba9b('0x1b'),_0xb68fde['remoteUri']),'qs':{'query':util[_0xba9b('0xf')](_0xba9b('0x1c'),_0x1efd23)}})['then'](function(_0x2f60f8){if(_0x2f60f8[_0xba9b('0x1d')]){logger[_0xba9b('0xd')](_0xba9b('0x1e'));return _[_0xba9b('0x1f')](_0x2f60f8[_0xba9b('0x20')],{'email':_0x1efd23,'role':_0xba9b('0x21')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xba9b('0xf')](_0xba9b('0x22'),_0xb68fde[_0xba9b('0x11')])})[_0xba9b('0x23')](function(_0x4a7ffa){logger[_0xba9b('0xd')](_0xba9b('0x24'));return _0x4a7ffa[_0xba9b('0x25')];});}});}else{logger[_0xba9b('0xd')](_0xba9b('0x26'));return request({'uri':util[_0xba9b('0xf')](_0xba9b('0x22'),_0xb68fde[_0xba9b('0x11')])})[_0xba9b('0x23')](function(_0x1fd323){logger['info'](_0xba9b('0x24'));return _0x1fd323[_0xba9b('0x25')];});}}function getEndUser(_0x3e5753,_0x3cd093,_0x2ecf49){logger['info'](_0xba9b('0x27'),_0x2ecf49);return request({'uri':util[_0xba9b('0xf')](_0xba9b('0x1b'),_0x3e5753[_0xba9b('0x11')]),'qs':{'query':util[_0xba9b('0xf')]('type:user\x20role:end-user\x20phone:%s',_0x2ecf49)}})[_0xba9b('0x23')](function(_0x571ba9){var _0x4ca687;if(_0x571ba9[_0xba9b('0x20')][_0xba9b('0x28')]){_0x571ba9[_0xba9b('0x20')]=_['filter'](_0x571ba9[_0xba9b('0x20')],{'suspended':![],'role':_0xba9b('0x29')});if(_0x571ba9[_0xba9b('0x20')][_0xba9b('0x28')]){_0x4ca687=_[_0xba9b('0x2a')](_0x571ba9[_0xba9b('0x20')]);}}if(_0x4ca687){logger[_0xba9b('0xd')](_0xba9b('0x2b'));return _0x4ca687;}else{logger[_0xba9b('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xba9b('0xf')](_0xba9b('0x2c'),_0x3e5753[_0xba9b('0x11')]),'method':_0xba9b('0x12'),'body':{'user':{'role':_0xba9b('0x29'),'name':util[_0xba9b('0xf')](_0xba9b('0x2d'),_0x3cd093||_0x2ecf49),'phone':_0x2ecf49}}})['then'](function(_0xc0db64){logger['info'](_0xba9b('0x2e'));return _0xc0db64[_0xba9b('0x25')];});}});}function getAuth(_0xbd7ba){var _0x4855e5;if(_0xbd7ba[_0xba9b('0x2f')]==='password'){_0x4855e5=util[_0xba9b('0xf')](_0xba9b('0x30'),_0xbd7ba['username'],_0xbd7ba[_0xba9b('0x31')]);}else if(_0xbd7ba[_0xba9b('0x2f')]===_0xba9b('0x32')){_0x4855e5=util[_0xba9b('0xf')](_0xba9b('0x33'),_0xbd7ba[_0xba9b('0x34')],_0xbd7ba[_0xba9b('0x32')]);}return util[_0xba9b('0xf')](_0xba9b('0x35'),new Buffer(_0x4855e5)[_0xba9b('0x36')](_0xba9b('0x37')));}function request(_0x200575){logger[_0xba9b('0x38')](_0xba9b('0x39'),JSON[_0xba9b('0x3a')](_0x200575));return rp(_[_0xba9b('0x8')](_0x200575,{'method':_0xba9b('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x364b98,_0x1f1cd8){var _0x280aa9=[];if(_0x364b98&&_0x364b98[_0xba9b('0x28')]>0x0){_0x280aa9=_[_0xba9b('0x3c')](_0x364b98,_0x1f1cd8);}return _0x280aa9;}function getCustomFields(_0x4907f3,_0x56ddf2){var _0x18bf07=[];var _0x2bbb88={'custom_fields':[]};if(_0x4907f3[_0xba9b('0x28')]>0x0){_['forEach'](_0x4907f3,function(_0x5b2911){if(_0x5b2911[_0xba9b('0x3d')]==='string'&&_0x5b2911['nameField']&&!_0x5b2911[_0xba9b('0x3e')]){_0x2bbb88[_0x5b2911[_0xba9b('0x3f')][_0xba9b('0x40')]()]=_0x5b2911[_0xba9b('0x41')][_0xba9b('0x36')]();}else if(_0x5b2911[_0xba9b('0x3d')]===_0xba9b('0x42')&&_0x5b2911[_0xba9b('0x43')]&&_0x5b2911['customField']){_0x2bbb88['custom_fields'][_0xba9b('0x44')]({'id':_0x5b2911[_0xba9b('0x43')],'value':_0x5b2911[_0xba9b('0x41')][_0xba9b('0x36')]()});}else if(_0x5b2911[_0xba9b('0x3d')]===_0xba9b('0x45')&&_0x5b2911[_0xba9b('0x46')]&&_0x5b2911[_0xba9b('0x43')]&&_0x5b2911[_0xba9b('0x3e')]){_0x56ddf2[_0x5b2911[_0xba9b('0x46')]]&&_0x2bbb88[_0xba9b('0x47')][_0xba9b('0x44')]({'id':_0x5b2911[_0xba9b('0x43')],'value':_0x56ddf2[_0x5b2911[_0xba9b('0x46')]][_0xba9b('0x36')]()});}else if(_0x5b2911[_0xba9b('0x3d')]==='customVariable'&&_0x5b2911[_0xba9b('0x48')]&&_0x5b2911[_0xba9b('0x48')][_0xba9b('0x49')]&&_0x5b2911[_0xba9b('0x43')]&&_0x5b2911[_0xba9b('0x3e')]){_0x56ddf2[_0x5b2911['Variable'][_0xba9b('0x49')]['toLowerCase']()]&&_0x2bbb88['custom_fields'][_0xba9b('0x44')]({'id':_0x5b2911[_0xba9b('0x43')],'value':_0x56ddf2[_0x5b2911['Variable']['name'][_0xba9b('0x40')]()][_0xba9b('0x36')]()});}});}return _0x2bbb88;}exports[_0xba9b('0x4a')]=function(_0x2c87d5,_0x3b1ef1,_0xb5dcf9,_0x4984c8,_0x4857bf,_0x479132){var _0x4b1b7c,_0x5ab484;_0x479132[_0xba9b('0x11')]=intUtil['stripTrailingSlash'](_0x479132[_0xba9b('0x11')]);_0x479132[_0xba9b('0x4b')]=intUtil[_0xba9b('0x4c')](_0x479132['serverUrl']);if(_0x4857bf&&_0x4857bf[_0xba9b('0x4d')]){logger[_0xba9b('0xd')](_0xba9b('0x4e'),_0xba9b('0x4f'));_0x3b1ef1[_0xba9b('0x50')]=util[_0xba9b('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x479132[_0xba9b('0x4b')],_0x3b1ef1[_0xba9b('0x51')],md5(_0x3b1ef1[_0xba9b('0x51')]));}else{_0x3b1ef1['recordingURL']='';}headers[_0xba9b('0x52')]=getAuth(_0x479132);return getUser(_0x479132,_0x4984c8[_0xba9b('0x53')])['then'](function(_0xb00806){_0x4b1b7c=_0xb00806;logger[_0xba9b('0xd')]('The\x20User\x20ID\x20is:',_0x4b1b7c['id']);return getEndUser(_0x479132,_0x3b1ef1['calleridname'],_0x3b1ef1[_0xba9b('0x54')]);})[_0xba9b('0x23')](function(_0x3e6822){_0x5ab484=_0x3e6822;logger[_0xba9b('0xd')](_0xba9b('0x55'),_0x5ab484['id']);return getTicket(_0x479132,_0x4b1b7c,_0x5ab484,_0xb5dcf9,_0x3b1ef1);})[_0xba9b('0x23')](function(_0x16254a){if(_0x16254a){logger[_0xba9b('0xd')](_0xba9b('0x56'),_0x16254a['id']);switch(_0x479132[_0xba9b('0x3d')]){case _0xba9b('0x57'):logger['info'](_0xba9b('0x4e'),_0xba9b('0x58'));return request({'uri':util[_0xba9b('0xf')](_0xba9b('0x59'),_0x479132[_0xba9b('0x11')],_0x4b1b7c['id'],_0x16254a['id']),'method':_0xba9b('0x12')});case _0xba9b('0x5a'):logger[_0xba9b('0xd')](_0xba9b('0x4e'),_0xba9b('0x5b'));emit(util[_0xba9b('0xf')](_0xba9b('0x5c'),_0x4984c8['name']),'trigger:browser:url',{'uri':util[_0xba9b('0xf')]('%s/agent/tickets/%s',_0x479132[_0xba9b('0x11')],_0x16254a['id'])});break;default:logger['error']('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xba9b('0x5d')](function(_0x36f46c){logger[_0xba9b('0x5e')](_0xba9b('0x5f'),util[_0xba9b('0x60')](_0x36f46c,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x4e2250,_0x1d7da0,_0x5463d0,_0x55a539,_0x49e60c,_0x3b8f3d,_0x501758){var _0x31c1ee,_0x78219f;_0x3b8f3d[_0xba9b('0x11')]=intUtil[_0xba9b('0x4c')](_0x3b8f3d['remoteUri']);_0x3b8f3d[_0xba9b('0x4b')]=intUtil[_0xba9b('0x4c')](_0x3b8f3d[_0xba9b('0x4b')]);if(_0x501758&&_0x501758[_0xba9b('0x61')]&&_0x501758[_0xba9b('0x61')]!==_0xba9b('0x62')){logger['info'](_0xba9b('0x63'),_0xba9b('0x4f'));_0x1d7da0[_0xba9b('0x50')]=util[_0xba9b('0xf')](_0xba9b('0x64'),_0x3b8f3d['serverUrl'],_0x1d7da0[_0xba9b('0x51')],md5(_0x1d7da0['uniqueid']));}headers['Authorization']=getAuth(_0x3b8f3d);return getUser(_0x3b8f3d,_0x55a539[_0xba9b('0x53')])['then'](function(_0x5f556a){_0x31c1ee=_0x5f556a;logger[_0xba9b('0xd')]('The\x20User\x20ID\x20is:',_0x31c1ee['id']);return getEndUser(_0x3b8f3d,_0x1d7da0['destcalleridname'],_0x1d7da0['destcalleridnum']);})[_0xba9b('0x23')](function(_0x214d11){_0x78219f=_0x214d11;logger[_0xba9b('0xd')](_0xba9b('0x55'),_0x78219f['id']);return getTicket(_0x3b8f3d,_0x31c1ee,_0x78219f,_0x5463d0,_0x1d7da0);})[_0xba9b('0x23')](function(_0x8a4002){if(_0x8a4002){logger[_0xba9b('0xd')]('The\x20Ticket\x20ID\x20is:',_0x8a4002['id']);switch(_0x3b8f3d[_0xba9b('0x3d')]){case'integrationTab':logger[_0xba9b('0xd')]('[OUTBOUND]',_0xba9b('0x58'));return request({'uri':util[_0xba9b('0xf')](_0xba9b('0x59'),_0x3b8f3d[_0xba9b('0x11')],_0x31c1ee['id'],_0x8a4002['id']),'method':_0xba9b('0x12')});case'newTab':logger['info'](_0xba9b('0x63'),_0xba9b('0x5b'));emit(util[_0xba9b('0xf')](_0xba9b('0x5c'),_0x55a539[_0xba9b('0x49')]),_0xba9b('0x65'),{'uri':util[_0xba9b('0xf')]('%s/agent/tickets/%s',_0x3b8f3d[_0xba9b('0x11')],_0x8a4002['id'])});break;default:logger[_0xba9b('0x5e')]('[OUTBOUND]',_0xba9b('0x66'));}}})[_0xba9b('0x5d')](function(_0x148cfc){logger[_0xba9b('0x5e')](_0xba9b('0x67'),util[_0xba9b('0x60')](_0x148cfc,{'showHidden':!![],'depth':null}));});};exports[_0xba9b('0x68')]=function(_0x23caa8,_0xc9327a,_0x3dc045,_0x455b9b,_0xc87824,_0x5e513b){var _0x54b4d8,_0x290d1c;_0x5e513b[_0xba9b('0x11')]=intUtil[_0xba9b('0x4c')](_0x5e513b[_0xba9b('0x11')]);_0x5e513b[_0xba9b('0x4b')]=intUtil[_0xba9b('0x4c')](_0x5e513b[_0xba9b('0x4b')]);if(_0xc87824&&_0xc87824['monitor_format']){logger[_0xba9b('0xd')]('[ABANDONED]','Recording\x20is\x20enabled!');_0xc9327a['recordingURL']=util[_0xba9b('0xf')](_0xba9b('0x64'),_0x5e513b['serverUrl'],_0xc9327a['uniqueid'],md5(_0xc9327a[_0xba9b('0x51')]));}else{_0xc9327a[_0xba9b('0x50')]='';}headers[_0xba9b('0x52')]=getAuth(_0x5e513b);return getUser(_0x5e513b)[_0xba9b('0x23')](function(_0x5ec088){_0x54b4d8=_0x5ec088;logger[_0xba9b('0xd')](_0xba9b('0x69'),_0x54b4d8['id']);return getEndUser(_0x5e513b,_0xc9327a[_0xba9b('0x6a')],_0xc9327a[_0xba9b('0x54')]);})[_0xba9b('0x23')](function(_0x190dbf){_0x290d1c=_0x190dbf;logger[_0xba9b('0xd')](_0xba9b('0x55'),_0x290d1c['id']);return getTicket(_0x5e513b,_0x54b4d8,_0x290d1c,_0x3dc045,_0xc9327a);})[_0xba9b('0x23')](function(_0x13cf48){if(_0x13cf48){logger[_0xba9b('0xd')](_0xba9b('0x56'),_0x13cf48['id']);}})[_0xba9b('0x5d')](function(_0x3d5a6f){logger[_0xba9b('0x5e')](_0xba9b('0x6b'),util[_0xba9b('0x60')](_0x3d5a6f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0ff2=['Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','filter','end-user','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','length','map','forEach','type','string','nameField','customField','toLowerCase','content','idField','push','variableName','custom_fields','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','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','outbound','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','Tags','name','Subjects','Descriptions','getString','then','info','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count'];(function(_0xb09590,_0x1655da){var _0x2f1100=function(_0x1a173e){while(--_0x1a173e){_0xb09590['push'](_0xb09590['shift']());}};_0x2f1100(++_0x1655da);}(_0x0ff2,0x197));var _0x20ff=function(_0x224ab7,_0x5dd6d1){_0x224ab7=_0x224ab7-0x0;var _0x469838=_0x0ff2[_0x224ab7];return _0x469838;};'use strict';var _=require(_0x20ff('0x0'));var rp=require('request-promise');var md5=require(_0x20ff('0x1'));var util=require('util');var Redis=require(_0x20ff('0x2'));var intUtil=require(_0x20ff('0x3'));var config=require(_0x20ff('0x4'));var logger=require(_0x20ff('0x5'))(_0x20ff('0x6'));config[_0x20ff('0x7')]=_['defaults'](config[_0x20ff('0x7')],{'host':_0x20ff('0x8'),'port':0x18eb});var io=require(_0x20ff('0x9'))(new Redis(config[_0x20ff('0x7')]));function emit(_0x4458fc,_0x1401fb,_0x491fba){io['to'](_0x4458fc)[_0x20ff('0xa')](_0x1401fb,_0x491fba);}var headers={'Content-Type':'application/json','Accept':_0x20ff('0xb')};function getTicket(_0xc9ccbe,_0x2d2f30,_0xb004ac,_0x3d8603,_0x1f623c){logger['info'](_0x20ff('0xc'));return request({'uri':util[_0x20ff('0xd')](_0x20ff('0xe'),_0xc9ccbe[_0x20ff('0xf')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0xb004ac['id'],'submitter_id':_0x2d2f30?_0x2d2f30['id']:undefined,'assignee_id':_0x2d2f30?_0x2d2f30['id']:undefined,'tags':getTags(_0x3d8603[_0x20ff('0x10')],_0x20ff('0x11')),'subject':intUtil['getString'](_0x3d8603[_0x20ff('0x12')],_0x1f623c,'\x20'),'description':intUtil['getString'](_0x3d8603[_0x20ff('0x13')],_0x1f623c,'\x0a'),'comment':{'public':![],'body':intUtil[_0x20ff('0x14')](_0x3d8603[_0x20ff('0x13')],_0x1f623c,'\x0a')}},getCustomFields(_0x3d8603['Fields'],_0x1f623c))}})[_0x20ff('0x15')](function(_0x12684e){logger[_0x20ff('0x16')]('Ticket\x20created!');return _0x12684e[_0x20ff('0x17')];});}function getUser(_0x2fc54a,_0x43451d){if(intUtil[_0x20ff('0x18')](_0x43451d)){logger[_0x20ff('0x16')](_0x20ff('0x19'),_0x43451d);return request({'uri':util[_0x20ff('0xd')](_0x20ff('0x1a'),_0x2fc54a[_0x20ff('0xf')]),'qs':{'query':util[_0x20ff('0xd')](_0x20ff('0x1b'),_0x43451d)}})[_0x20ff('0x15')](function(_0x4ee322){if(_0x4ee322[_0x20ff('0x1c')]){logger[_0x20ff('0x16')](_0x20ff('0x1d'));return _[_0x20ff('0x1e')](_0x4ee322[_0x20ff('0x1f')],{'email':_0x43451d,'role':'agent'});}else{logger['info'](_0x20ff('0x20'));return request({'uri':util['format'](_0x20ff('0x21'),_0x2fc54a[_0x20ff('0xf')])})[_0x20ff('0x15')](function(_0x40607e){logger[_0x20ff('0x16')](_0x20ff('0x22'));return _0x40607e[_0x20ff('0x23')];});}});}else{logger[_0x20ff('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x20ff('0xd')](_0x20ff('0x21'),_0x2fc54a['remoteUri'])})[_0x20ff('0x15')](function(_0x15ae25){logger[_0x20ff('0x16')](_0x20ff('0x22'));return _0x15ae25['user'];});}}function getEndUser(_0x271d30,_0x2c5e71,_0x4ca82d){logger[_0x20ff('0x16')](_0x20ff('0x24'),_0x4ca82d);return request({'uri':util[_0x20ff('0xd')](_0x20ff('0x1a'),_0x271d30[_0x20ff('0xf')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x4ca82d)}})[_0x20ff('0x15')](function(_0x1e3ac1){var _0x44daf5;if(_0x1e3ac1[_0x20ff('0x1f')]['length']){_0x1e3ac1['results']=_[_0x20ff('0x25')](_0x1e3ac1[_0x20ff('0x1f')],{'suspended':![],'role':_0x20ff('0x26')});if(_0x1e3ac1[_0x20ff('0x1f')]['length']){_0x44daf5=_['first'](_0x1e3ac1[_0x20ff('0x1f')]);}}if(_0x44daf5){logger[_0x20ff('0x16')]('Enduser\x20found!');return _0x44daf5;}else{logger[_0x20ff('0x16')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x20ff('0x27'),_0x271d30[_0x20ff('0xf')]),'method':'POST','body':{'user':{'role':_0x20ff('0x26'),'name':util[_0x20ff('0xd')](_0x20ff('0x28'),_0x2c5e71||_0x4ca82d),'phone':_0x4ca82d}}})['then'](function(_0x24f0cd){logger['info'](_0x20ff('0x29'));return _0x24f0cd[_0x20ff('0x23')];});}});}function getAuth(_0x51cac6){var _0x4c948e;if(_0x51cac6[_0x20ff('0x2a')]===_0x20ff('0x2b')){_0x4c948e=util[_0x20ff('0xd')](_0x20ff('0x2c'),_0x51cac6[_0x20ff('0x2d')],_0x51cac6[_0x20ff('0x2b')]);}else if(_0x51cac6[_0x20ff('0x2a')]===_0x20ff('0x2e')){_0x4c948e=util['format'](_0x20ff('0x2f'),_0x51cac6[_0x20ff('0x2d')],_0x51cac6[_0x20ff('0x2e')]);}return util['format'](_0x20ff('0x30'),new Buffer(_0x4c948e)[_0x20ff('0x31')](_0x20ff('0x32')));}function request(_0x2dd0b2){logger[_0x20ff('0x33')](_0x20ff('0x34'),JSON[_0x20ff('0x35')](_0x2dd0b2));return rp(_[_0x20ff('0x36')](_0x2dd0b2,{'method':_0x20ff('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x1d0195,_0x347577){var _0x578c1b=[];if(_0x1d0195&&_0x1d0195[_0x20ff('0x38')]>0x0){_0x578c1b=_[_0x20ff('0x39')](_0x1d0195,_0x347577);}return _0x578c1b;}function getCustomFields(_0xc26292,_0x12be76){var _0x42f46f=[];var _0x52d2c4={'custom_fields':[]};if(_0xc26292[_0x20ff('0x38')]>0x0){_[_0x20ff('0x3a')](_0xc26292,function(_0x4de750){if(_0x4de750[_0x20ff('0x3b')]===_0x20ff('0x3c')&&_0x4de750[_0x20ff('0x3d')]&&!_0x4de750[_0x20ff('0x3e')]){_0x52d2c4[_0x4de750['nameField'][_0x20ff('0x3f')]()]=_0x4de750[_0x20ff('0x40')]['toString']();}else if(_0x4de750['type']==='string'&&_0x4de750[_0x20ff('0x41')]&&_0x4de750[_0x20ff('0x3e')]){_0x52d2c4['custom_fields'][_0x20ff('0x42')]({'id':_0x4de750[_0x20ff('0x41')],'value':_0x4de750[_0x20ff('0x40')][_0x20ff('0x31')]()});}else if(_0x4de750[_0x20ff('0x3b')]==='variable'&&_0x4de750[_0x20ff('0x43')]&&_0x4de750['idField']&&_0x4de750['customField']){_0x12be76[_0x4de750[_0x20ff('0x43')]]&&_0x52d2c4[_0x20ff('0x44')][_0x20ff('0x42')]({'id':_0x4de750['idField'],'value':_0x12be76[_0x4de750[_0x20ff('0x43')]][_0x20ff('0x31')]()});}else if(_0x4de750[_0x20ff('0x3b')]===_0x20ff('0x45')&&_0x4de750[_0x20ff('0x46')]&&_0x4de750['Variable']['name']&&_0x4de750[_0x20ff('0x41')]&&_0x4de750['customField']){_0x12be76[_0x4de750[_0x20ff('0x46')][_0x20ff('0x11')]['toLowerCase']()]&&_0x52d2c4[_0x20ff('0x44')]['push']({'id':_0x4de750[_0x20ff('0x41')],'value':_0x12be76[_0x4de750[_0x20ff('0x46')][_0x20ff('0x11')][_0x20ff('0x3f')]()][_0x20ff('0x31')]()});}});}return _0x52d2c4;}exports[_0x20ff('0x47')]=function(_0x348dff,_0x45aae4,_0x58d3cd,_0x2f7899,_0x57804b,_0x40ef6c){var _0x329a73,_0x28611b;_0x40ef6c['remoteUri']=intUtil[_0x20ff('0x48')](_0x40ef6c[_0x20ff('0xf')]);_0x40ef6c[_0x20ff('0x49')]=intUtil[_0x20ff('0x48')](_0x40ef6c[_0x20ff('0x49')]);if(_0x57804b&&_0x57804b[_0x20ff('0x4a')]){logger['info'](_0x20ff('0x4b'),_0x20ff('0x4c'));_0x45aae4[_0x20ff('0x4d')]=util[_0x20ff('0xd')](_0x20ff('0x4e'),_0x40ef6c[_0x20ff('0x49')],_0x45aae4[_0x20ff('0x4f')],md5(_0x45aae4[_0x20ff('0x4f')]));}else{_0x45aae4[_0x20ff('0x4d')]='';}headers[_0x20ff('0x50')]=getAuth(_0x40ef6c);return getUser(_0x40ef6c,_0x2f7899[_0x20ff('0x51')])[_0x20ff('0x15')](function(_0x10d507){_0x329a73=_0x10d507;logger[_0x20ff('0x16')]('The\x20User\x20ID\x20is:',_0x329a73['id']);return getEndUser(_0x40ef6c,_0x45aae4[_0x20ff('0x52')],_0x45aae4[_0x20ff('0x53')]);})[_0x20ff('0x15')](function(_0xb5adf6){_0x28611b=_0xb5adf6;logger['info']('The\x20Enduser\x20ID\x20is:',_0x28611b['id']);return getTicket(_0x40ef6c,_0x329a73,_0x28611b,_0x58d3cd,_0x45aae4);})[_0x20ff('0x15')](function(_0x26af4a){if(_0x26af4a){logger[_0x20ff('0x16')](_0x20ff('0x54'),_0x26af4a['id']);switch(_0x40ef6c['type']){case _0x20ff('0x55'):logger[_0x20ff('0x16')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x40ef6c[_0x20ff('0xf')],_0x329a73['id'],_0x26af4a['id']),'method':'POST'});case _0x20ff('0x56'):logger[_0x20ff('0x16')](_0x20ff('0x4b'),_0x20ff('0x57'));emit(util[_0x20ff('0xd')](_0x20ff('0x58'),_0x2f7899[_0x20ff('0x11')]),_0x20ff('0x59'),{'uri':util[_0x20ff('0xd')](_0x20ff('0x5a'),_0x40ef6c[_0x20ff('0xf')],_0x26af4a['id'])});break;default:logger[_0x20ff('0x5b')](_0x20ff('0x4b'),_0x20ff('0x5c'));}}})[_0x20ff('0x5d')](function(_0x5efcba){logger[_0x20ff('0x5b')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x20ff('0x5e')](_0x5efcba,{'showHidden':!![],'depth':null}));});};exports[_0x20ff('0x5f')]=function(_0x2487f6,_0x32830e,_0xab8b42,_0x466bd2,_0x4b46f9,_0x4e74f0,_0x1db26e){var _0x56fe2c,_0x352ad3;_0x4e74f0['remoteUri']=intUtil[_0x20ff('0x48')](_0x4e74f0[_0x20ff('0xf')]);_0x4e74f0[_0x20ff('0x49')]=intUtil[_0x20ff('0x48')](_0x4e74f0[_0x20ff('0x49')]);if(_0x1db26e&&_0x1db26e[_0x20ff('0x60')]&&_0x1db26e[_0x20ff('0x60')]!==_0x20ff('0x61')){logger['info']('[OUTBOUND]',_0x20ff('0x4c'));_0x32830e['recordingURL']=util[_0x20ff('0xd')](_0x20ff('0x4e'),_0x4e74f0[_0x20ff('0x49')],_0x32830e[_0x20ff('0x4f')],md5(_0x32830e[_0x20ff('0x4f')]));}headers[_0x20ff('0x50')]=getAuth(_0x4e74f0);return getUser(_0x4e74f0,_0x466bd2[_0x20ff('0x51')])[_0x20ff('0x15')](function(_0x1df1bf){_0x56fe2c=_0x1df1bf;logger['info'](_0x20ff('0x62'),_0x56fe2c['id']);return getEndUser(_0x4e74f0,_0x32830e[_0x20ff('0x63')],_0x32830e[_0x20ff('0x64')]);})[_0x20ff('0x15')](function(_0xb205a1){_0x352ad3=_0xb205a1;logger[_0x20ff('0x16')](_0x20ff('0x65'),_0x352ad3['id']);return getTicket(_0x4e74f0,_0x56fe2c,_0x352ad3,_0xab8b42,_0x32830e);})[_0x20ff('0x15')](function(_0xeaa8d3){if(_0xeaa8d3){logger[_0x20ff('0x16')](_0x20ff('0x54'),_0xeaa8d3['id']);switch(_0x4e74f0[_0x20ff('0x3b')]){case _0x20ff('0x55'):logger[_0x20ff('0x16')](_0x20ff('0x66'),_0x20ff('0x67'));return request({'uri':util[_0x20ff('0xd')](_0x20ff('0x68'),_0x4e74f0[_0x20ff('0xf')],_0x56fe2c['id'],_0xeaa8d3['id']),'method':_0x20ff('0x69')});case'newTab':logger[_0x20ff('0x16')](_0x20ff('0x66'),_0x20ff('0x57'));emit(util[_0x20ff('0xd')](_0x20ff('0x58'),_0x466bd2[_0x20ff('0x11')]),'trigger:browser:url',{'uri':util[_0x20ff('0xd')](_0x20ff('0x5a'),_0x4e74f0[_0x20ff('0xf')],_0xeaa8d3['id'])});break;default:logger[_0x20ff('0x5b')](_0x20ff('0x66'),_0x20ff('0x5c'));}}})['catch'](function(_0x2f1730){logger['error'](_0x20ff('0x6a'),util['inspect'](_0x2f1730,{'showHidden':!![],'depth':null}));});};exports['abandoned']=function(_0x1eebbd,_0x2f9842,_0x4796d7,_0x510ecb,_0x1a8283,_0x3e26ef){var _0x10d6d4,_0x48f74c;_0x3e26ef[_0x20ff('0xf')]=intUtil['stripTrailingSlash'](_0x3e26ef[_0x20ff('0xf')]);_0x3e26ef[_0x20ff('0x49')]=intUtil[_0x20ff('0x48')](_0x3e26ef['serverUrl']);if(_0x1a8283&&_0x1a8283[_0x20ff('0x4a')]){logger[_0x20ff('0x16')](_0x20ff('0x6b'),_0x20ff('0x4c'));_0x2f9842[_0x20ff('0x4d')]=util['format'](_0x20ff('0x4e'),_0x3e26ef[_0x20ff('0x49')],_0x2f9842[_0x20ff('0x4f')],md5(_0x2f9842[_0x20ff('0x4f')]));}else{_0x2f9842[_0x20ff('0x4d')]='';}headers[_0x20ff('0x50')]=getAuth(_0x3e26ef);return getUser(_0x3e26ef)[_0x20ff('0x15')](function(_0x392188){_0x10d6d4=_0x392188;logger['info'](_0x20ff('0x62'),_0x10d6d4['id']);return getEndUser(_0x3e26ef,_0x2f9842['calleridname'],_0x2f9842[_0x20ff('0x53')]);})['then'](function(_0x327872){_0x48f74c=_0x327872;logger[_0x20ff('0x16')](_0x20ff('0x65'),_0x48f74c['id']);return getTicket(_0x3e26ef,_0x10d6d4,_0x48f74c,_0x4796d7,_0x2f9842);})[_0x20ff('0x15')](function(_0xa510b8){if(_0xa510b8){logger[_0x20ff('0x16')](_0x20ff('0x54'),_0xa510b8['id']);}})[_0x20ff('0x5d')](function(_0x407c64){logger['error'](_0x20ff('0x6c'),util['inspect'](_0x407c64,{'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 df4b072..6c51f4e 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 _0xfc3a=['isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientSecret','refresh_token','then','add','expires_in','seconds','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','catch','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','log','CREATE\x20ERROR','moduleSearch','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','Leads','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','Owner','administrator','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','called','Call_Result','Called','complete','connect','Answered','rejected','abandoned','Abandoned','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','calleridname','The\x20Call\x20ID\x20is:','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','[OUTBOUND]','/api/voice/recordings/','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','[ABANDONED]','The\x20User\x20ID\x20is:','calleridnum','lodash','request-promise','util','moment','ioredis','../../../../config/logger','zoho','redis','localhost','length','forEach','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','indexOf'];(function(_0xf745c6,_0x1ca5c6){var _0x3559ec=function(_0x1a85ac){while(--_0x1a85ac){_0xf745c6['push'](_0xf745c6['shift']());}};_0x3559ec(++_0x1ca5c6);}(_0xfc3a,0x1a7));var _0xafc3=function(_0x259ae9,_0x1a65ea){_0x259ae9=_0x259ae9-0x0;var _0x544b3f=_0xfc3a[_0x259ae9];return _0x544b3f;};'use strict';var _=require(_0xafc3('0x0'));var rp=require(_0xafc3('0x1'));var md5=require('md5');var util=require(_0xafc3('0x2'));var intUtil=require('./util');var moment=require(_0xafc3('0x3'));var Redis=require(_0xafc3('0x4'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0xafc3('0x5'))(_0xafc3('0x6'));config[_0xafc3('0x7')]=_['defaults'](config['redis'],{'host':_0xafc3('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xafc3('0x7')]));function emit(_0x41d217,_0x6e4c5f,_0x5b0940){io['to'](_0x41d217)['emit'](_0x6e4c5f,_0x5b0940);}function request(_0x549c2c){logger['debug']('[HTTP]',JSON['stringify'](_0x549c2c));return rp(_0x549c2c);}function getCustomFields(_0x37c6bc,_0x34de91){var _0x5a3b8d={};if(_0x37c6bc[_0xafc3('0x9')]>0x0){_[_0xafc3('0xa')](_0x37c6bc,function(_0x579186){if(_0x579186['type']==='string'&&_0x579186[_0xafc3('0xb')]){_0x5a3b8d[_0x579186['idField']]=_0x579186[_0xafc3('0xc')][_0xafc3('0xd')]();}else if(_0x579186[_0xafc3('0xe')]===_0xafc3('0xf')&&_0x579186['variableName']&&_0x579186[_0xafc3('0xb')]&&_0x34de91[_0x579186[_0xafc3('0x10')]]){_0x5a3b8d[_0x579186[_0xafc3('0xb')]]=_0x34de91[_0x579186[_0xafc3('0x10')]]['toString']();}else if(_0x579186[_0xafc3('0xe')]==='customVariable'&&_0x579186[_0xafc3('0x11')]&&_0x579186['Variable']['name']&&_0x579186[_0xafc3('0xb')]&&_0x34de91[_0x579186[_0xafc3('0x11')][_0xafc3('0x12')]['toLowerCase']()]){_0x5a3b8d[_0x579186[_0xafc3('0xb')]]=_0x34de91[_0x579186['Variable'][_0xafc3('0x12')][_0xafc3('0x13')]()][_0xafc3('0xd')]();}});}return _0x5a3b8d;}function getName(_0x42d3ab){if(_0x42d3ab[_0xafc3('0x14')]('\x20')>0x0){var _0x29656b=_0x42d3ab['split'](/ (.+)/);if(_0x29656b[0x1]){return _0x29656b;}}return[_0x42d3ab,_0x42d3ab];}var accountsTokens={};function getAccessToken(_0x4f6c71){return new Promise(function(_0x186e8b,_0x54f937){if(!_['isNil'](accountsTokens[_0x4f6c71['id']])&&!_[_0xafc3('0x15')](accountsTokens[_0x4f6c71['id']][_0xafc3('0x16')])){if(moment()[_0xafc3('0x17')](accountsTokens[_0x4f6c71['id']]['expires_in'])){_0x186e8b(accountsTokens[_0x4f6c71['id']][_0xafc3('0x16')]);}}var _0x296fd8;switch(_0x4f6c71[_0xafc3('0x18')]){case'US':_0x296fd8=_0xafc3('0x19');break;case'AU':_0x296fd8=_0xafc3('0x1a');break;case'EU':_0x296fd8=_0xafc3('0x1b');break;case'IN':_0x296fd8='https://accounts.zoho.in';break;case'CN':_0x296fd8=_0xafc3('0x1c');break;default:_0x296fd8=_0xafc3('0x1b');break;}var _0x156967={'method':_0xafc3('0x1d'),'uri':_0x296fd8+'/oauth/v2/token','qs':{'refresh_token':_0x4f6c71[_0xafc3('0x1e')],'client_id':_0x4f6c71['clientId'],'client_secret':_0x4f6c71[_0xafc3('0x1f')],'grant_type':_0xafc3('0x20')},'json':!![]};return rp(_0x156967)[_0xafc3('0x21')](function(_0x431c37){accountsTokens[_0x4f6c71['id']]={'access_token':_0x431c37['access_token'],'expires_in':moment()[_0xafc3('0x22')](_0x431c37[_0xafc3('0x23')],_0xafc3('0x24'))};_0x186e8b(_0x431c37['access_token']);})['catch'](function(_0x10013e){logger['error'](_0xafc3('0x25'),_0x10013e[_0xafc3('0x26')]);_0x54f937(_0x10013e);});});}function getUser(_0x7ce55b,_0x1d2610,_0x59c4fc,_0x4e09de){logger[_0xafc3('0x27')](_0xafc3('0x28'));return request({'method':_0xafc3('0x29'),'uri':util[_0xafc3('0x2a')](_0xafc3('0x2b'),_0x1d2610),'qs':{'type':_0xafc3('0x2c')},'headers':{'Authorization':_0xafc3('0x2d')+_0x7ce55b},'json':!![]})[_0xafc3('0x21')](function(_0x12831e){if(_0x12831e['users']){var _0x297a15=-0x1;if(_[_0xafc3('0x2e')](_0x12831e[_0xafc3('0x2f')])){if(!_[_0xafc3('0x15')](_0x4e09de)){_0x297a15=_[_0xafc3('0x30')](_0x12831e[_0xafc3('0x2f')],function(_0x2927f3){return _0x2927f3[_0xafc3('0x31')]===_0x4e09de;});}if(_0x297a15>=0x0){logger[_0xafc3('0x27')](_0xafc3('0x32'));}else{logger[_0xafc3('0x27')](_0xafc3('0x33'));_0x297a15=_['findIndex'](_0x12831e['users'],function(_0x3d17d0){return _0x3d17d0[_0xafc3('0x34')][_0xafc3('0x12')]===_0xafc3('0x35');});}return _0x12831e[_0xafc3('0x2f')][_0x297a15];}else{if(_0x12831e[_0xafc3('0x36')]['profile']['name']===_0xafc3('0x35')){logger[_0xafc3('0x27')]('Using\x20the\x20admin\x20account!');user=_0x12831e[_0xafc3('0x36')];return user;}else{logger[_0xafc3('0x37')](_0xafc3('0x38'),JSON[_0xafc3('0x39')](_0x12831e));throw new Error(_0xafc3('0x3a')+JSON[_0xafc3('0x39')](_0x12831e));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xafc3('0x39')](_0x12831e));throw new Error(_0xafc3('0x3a')+JSON['stringify'](_0x12831e));}})['catch'](function(_0x262622){console[_0xafc3('0x37')](_0x262622);});}function getZohoUser(_0x4774e3,_0x5200b4){return new BPromise(function(_0xd63d1b,_0x594df0){request(_0x4774e3)[_0xafc3('0x21')](function(_0x4b6620){var _0x2fe7d9=null;if(_0x4b6620){_0x2fe7d9=_0x4b6620['data'][0x0];_0x2fe7d9[_0xafc3('0x3b')]=_0x5200b4;}_0xd63d1b(_0x2fe7d9);})[_0xafc3('0x3c')](function(_0x3b3980){_0x594df0(_0x3b3980);});});}function createEndUser(_0x4554fc,_0x30f93a,_0x40ba64,_0x9a7866,_0x361c4c,_0x15f57b){var _0x40ba64=getName(_0x40ba64);return request({'method':_0xafc3('0x1d'),'uri':_0xafc3('0x3d')+_0x30f93a+_0xafc3('0x3e')+_[_0xafc3('0x3f')](_0x15f57b[_0xafc3('0x40')])+'s','body':{'data':[{'Last_Name':_0x40ba64[0x1],'First_Name':_0x40ba64[0x0],'Phone':_0x9a7866,'Owner':{'name':!_[_0xafc3('0x15')](_0x361c4c['role'][_0xafc3('0x12')])?_0x361c4c[_0xafc3('0x41')]['name']:!_['isNil'](_0x361c4c[_0xafc3('0x42')])?_0x361c4c[_0xafc3('0x42')]+'\x20'+_0x361c4c[_0xafc3('0x43')]:_0x361c4c[_0xafc3('0x43')],'id':_0x361c4c['id']}}]},'headers':{'Authorization':_0xafc3('0x2d')+_0x4554fc},'json':!![]})[_0xafc3('0x21')](function(_0x9293d9){if(_0x9293d9&&_0x9293d9[_0xafc3('0x44')][0x0][_0xafc3('0x45')]===_0xafc3('0x46')){var _0xac5f9b=_0x9293d9[_0xafc3('0x44')][0x0][_0xafc3('0x47')];_0xac5f9b['enduserType']=_['startCase'](_0x15f57b[_0xafc3('0x40')])+'s';return _0xac5f9b;}logger[_0xafc3('0x37')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0xafc3('0x39')](data));})[_0xafc3('0x3c')](function(_0x2aa234){console[_0xafc3('0x48')](_0xafc3('0x49'),_0x2aa234);});}function getEndUser(_0x5692ff,_0x4c4660,_0x4a18b6,_0x34814f,_0x5a67c3,_0x37489c,_0x36b273){var _0x12d702={'method':_0xafc3('0x29'),'uri':'','headers':{'Authorization':_0xafc3('0x2d')+_0x5692ff},'json':!![]};switch(_0x36b273[_0xafc3('0x4a')]){case'contact_lead':_0x12d702['uri']='https://www.zohoapis.'+_0x4c4660+_0xafc3('0x4b')+_0x5a67c3+'))';return getZohoUser(_0x12d702,_0xafc3('0x4c'))[_0xafc3('0x21')](function(_0x2a9ef2){if(_0x2a9ef2)return _0x2a9ef2;_0x12d702[_0xafc3('0x4d')]=_0xafc3('0x3d')+_0x4c4660+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5a67c3+'))';return getZohoUser(_0x12d702,_0xafc3('0x4e'))['then'](function(_0x26be9d){if(_0x26be9d)return _0x26be9d;if(_0x36b273[_0xafc3('0x40')]!='nothing'){return createEndUser(_0x5692ff,_0x4c4660,_0x34814f,_0x5a67c3,_0x37489c,_0x36b273);}else{return{};}});});break;case _0xafc3('0x4f'):_0x12d702[_0xafc3('0x4d')]=_0xafc3('0x3d')+_0x4c4660+_0xafc3('0x4b')+_0x5a67c3+'))';return getZohoUser(_0x12d702,_0xafc3('0x4c'))[_0xafc3('0x21')](function(_0x5b5077){if(_0x5b5077)return _0x5b5077;if(_0x36b273[_0xafc3('0x40')]!='nothing'){return createEndUser(_0x5692ff,_0x4c4660,_0x34814f,_0x5a67c3,_0x37489c,_0x36b273);}else{return{};}});break;case _0xafc3('0x50'):_0x12d702[_0xafc3('0x4d')]='https://www.zohoapis.'+_0x4c4660+_0xafc3('0x51')+_0x5a67c3+'))';return getZohoUser(_0x12d702,_0xafc3('0x4e'))['then'](function(_0x1e3bca){if(_0x1e3bca)return _0x1e3bca;if(_0x36b273[_0xafc3('0x40')]!=_0xafc3('0x52')){return createEndUser(_0x5692ff,_0x4c4660,_0x34814f,_0x5a67c3,_0x37489c,_0x36b273);}else{return{};}});break;}}function getCall(_0x5ee94c,_0xfdfe72,_0x2a238c,_0x17513c,_0x232ddc,_0x43c0ff,_0x352ea3,_0xf6f9ff){logger['info']('Creating\x20new\x20call...');var _0x37017e={};_0x37017e[_0xafc3('0x53')]={'name':!_[_0xafc3('0x15')](_0x17513c[_0xafc3('0x41')][_0xafc3('0x12')])&&!_['isNil'](_0x17513c['profile'][_0xafc3('0x12')])&&_0x17513c[_0xafc3('0x34')]['name']===_0xafc3('0x54')?_0x17513c[_0xafc3('0x41')][_0xafc3('0x12')]:!_[_0xafc3('0x15')](_0x17513c[_0xafc3('0x42')])?_0x17513c[_0xafc3('0x42')]+'\x20'+_0x17513c['last_name']:_0x17513c[_0xafc3('0x43')],'id':_0x17513c['id']};_0x37017e[_0xafc3('0x55')]=intUtil[_0xafc3('0x56')](_0x43c0ff[_0xafc3('0x57')],_0x352ea3,'\x20');_0x37017e['Description']=intUtil['getString'](_0x43c0ff[_0xafc3('0x58')],_0x352ea3,'\x0a');if(_0x232ddc[_0xafc3('0x3b')]==='Contacts'){_0x37017e[_0xafc3('0x59')]={'name':!_[_0xafc3('0x15')](_0x232ddc[_0xafc3('0x5a')])?_0x232ddc[_0xafc3('0x5a')]:!_[_0xafc3('0x15')](_0x232ddc[_0xafc3('0x5b')])?_0x232ddc[_0xafc3('0x5b')]+'\x20'+_0x232ddc[_0xafc3('0x5c')]:_0x232ddc[_0xafc3('0x5c')],'id':_0x232ddc['id']};}if(_0x232ddc[_0xafc3('0x3b')]===_0xafc3('0x4e')){_0x37017e['What_Id']={'name':!_['isNil'](_0x232ddc[_0xafc3('0x5a')])?_0x232ddc[_0xafc3('0x5a')]:!_[_0xafc3('0x15')](_0x232ddc['First_Name'])?_0x232ddc[_0xafc3('0x5b')]+'\x20'+_0x232ddc[_0xafc3('0x5c')]:_0x232ddc['Last_Name'],'id':_0x232ddc['id']};_0x37017e[_0xafc3('0x5d')]=_[_0xafc3('0x3f')](_0x232ddc[_0xafc3('0x3b')]);}if(_0x352ea3[_0xafc3('0x5e')]){_0x37017e[_0xafc3('0x5f')]=moment[_0xafc3('0x60')](parseInt(_0x352ea3[_0xafc3('0x5e')])*0x3e8)[_0xafc3('0x2a')]('mm:ss');}else if(_0x352ea3['answertime']&&_0x352ea3[_0xafc3('0x61')]){_0x37017e[_0xafc3('0x5f')]=moment['utc'](moment(_0x352ea3[_0xafc3('0x61')],_0xafc3('0x62'))['diff'](moment(_0x352ea3[_0xafc3('0x63')],_0xafc3('0x62'))))[_0xafc3('0x2a')](_0xafc3('0x64'));}switch(_0x352ea3['lastevent']){case _0xafc3('0x65'):_0x37017e[_0xafc3('0x66')]=_0xafc3('0x67');break;case _0xafc3('0x68'):case _0xafc3('0x69'):_0x37017e[_0xafc3('0x66')]=_0xafc3('0x6a');break;case _0xafc3('0x6b'):_0x37017e[_0xafc3('0x66')]='Rejected';break;case _0xafc3('0x6c'):_0x37017e[_0xafc3('0x66')]=_0xafc3('0x6d');break;default:}_0x37017e[_0xafc3('0x6e')]=(_0xf6f9ff==='outbound'?moment(_0x352ea3[_0xafc3('0x63')])[_0xafc3('0x2a')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x352ea3[_0xafc3('0x6f')])[_0xafc3('0x2a')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xafc3('0x2a')](_0xafc3('0x62'));_0x37017e[_0xafc3('0x70')]=_0xf6f9ff||_0xafc3('0x71');_0x37017e=_[_0xafc3('0x72')](_0x37017e,getCustomFields(_0x43c0ff[_0xafc3('0x73')],_0x352ea3));return request({'method':_0xafc3('0x1d'),'uri':'https://www.zohoapis.'+_0xfdfe72+_0xafc3('0x74'),'headers':{'Authorization':_0xafc3('0x2d')+_0x5ee94c},'body':{'data':[_0x37017e]},'json':!![]})[_0xafc3('0x21')](function(_0x21cf92){if(_0x21cf92&&_0x21cf92['data'][0x0][_0xafc3('0x45')]===_0xafc3('0x46')){logger[_0xafc3('0x27')](_0xafc3('0x75'));return{'id':_0x21cf92['data'][0x0]['details']['id']};}})[_0xafc3('0x3c')](function(_0x15b1ec){logger[_0xafc3('0x27')](_0xafc3('0x76'),_0x15b1ec[_0xafc3('0x26')]);console[_0xafc3('0x48')](_0xafc3('0x76'),_0x15b1ec);});}exports[_0xafc3('0x77')]=function(_0x357d6a,_0x46adaa,_0x4e65fa,_0x51d6ca,_0xdd51f7,_0x2197d5){var _0x4858a7,_0x469d38,_0x3a75f6;_0x2197d5[_0xafc3('0x78')]=intUtil[_0xafc3('0x79')](_0x2197d5['host']);_0x2197d5[_0xafc3('0x7a')]=intUtil[_0xafc3('0x79')](_0x2197d5[_0xafc3('0x7a')]);if(_0xdd51f7&&_0xdd51f7[_0xafc3('0x7b')]){logger[_0xafc3('0x27')](_0xafc3('0x7c'),_0xafc3('0x7d'));_0x46adaa[_0xafc3('0x7e')]=_0x2197d5[_0xafc3('0x7a')]+'/api/voice/recordings/'+_0x46adaa['uniqueid']+_0xafc3('0x7f')+md5(_0x46adaa[_0xafc3('0x80')]);}else{_0x46adaa[_0xafc3('0x7e')]='';}var _0x1fbf24=_0x2197d5[_0xafc3('0x78')]===_0xafc3('0x81')?'eu':_0xafc3('0x82');return getAccessToken(_0x2197d5)[_0xafc3('0x21')](function(_0x759f3b){_0x3a75f6=_0x759f3b;return getUser(_0x3a75f6,_0x1fbf24,_0x2197d5,_0x51d6ca[_0xafc3('0x31')]);})[_0xafc3('0x21')](function(_0x15fda1){_0x4858a7=_0x15fda1;logger[_0xafc3('0x27')]('The\x20User\x20ID\x20is:',_0x4858a7['id']);return getEndUser(_0x3a75f6,_0x1fbf24,_0x2197d5,_0x46adaa[_0xafc3('0x83')],_0x46adaa['calleridnum'],_0x4858a7,_0x4e65fa);})[_0xafc3('0x21')](function(_0x28cf67){_0x469d38=_0x28cf67;return getCall(_0x3a75f6,_0x1fbf24,_0x2197d5,_0x4858a7,_0x469d38,_0x4e65fa,_0x46adaa,'Inbound');})[_0xafc3('0x21')](function(_0x3e0c68){if(_0x3e0c68){logger['info'](_0xafc3('0x84'),_0x3e0c68['id']);logger[_0xafc3('0x27')](_0xafc3('0x7c'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xafc3('0x2a')]('user:%s',_0x51d6ca[_0xafc3('0x12')]),'trigger:browser:url',{'uri':_0xafc3('0x85')+_0x2197d5[_0xafc3('0x78')]+_0xafc3('0x86')+_0x3e0c68['id']});}})[_0xafc3('0x3c')](function(_0x34b9cb){logger['error'](_0xafc3('0x7c'),JSON['stringify'](_0x34b9cb));});};exports[_0xafc3('0x87')]=function(_0x1eb5bd,_0x2761af,_0x59d190,_0x2e4bc5,_0xadaf11,_0x989878,_0x305875){var _0xea50b8,_0x43907c,_0x2ceb11;_0x989878[_0xafc3('0x78')]=intUtil[_0xafc3('0x79')](_0x989878[_0xafc3('0x78')]);_0x989878[_0xafc3('0x7a')]=intUtil[_0xafc3('0x79')](_0x989878[_0xafc3('0x7a')]);if(_0x305875&&_0x305875[_0xafc3('0x88')]&&_0x305875[_0xafc3('0x88')]!=='none'){logger[_0xafc3('0x27')](_0xafc3('0x89'),'Recording\x20is\x20enabled!');_0x2761af[_0xafc3('0x7e')]=_0x989878['serverUrl']+_0xafc3('0x8a')+_0x2761af[_0xafc3('0x80')]+_0xafc3('0x7f')+md5(_0x2761af[_0xafc3('0x80')]);}var _0x1e2c0f=_0x989878[_0xafc3('0x78')]==='zoho.eu'?'eu':_0xafc3('0x82');return getAccessToken(_0x989878)[_0xafc3('0x21')](function(_0x481ac0){_0x2ceb11=_0x481ac0;return getUser(_0x2ceb11,_0x1e2c0f,_0x989878,_0x2e4bc5['email']);})[_0xafc3('0x21')](function(_0x4e1a4d){_0xea50b8=_0x4e1a4d;logger['info']('The\x20User\x20ID\x20is:',_0xea50b8['id']);return getEndUser(_0x2ceb11,_0x1e2c0f,_0x989878,_0x2761af[_0xafc3('0x8b')],_0x2761af[_0xafc3('0x8c')],_0xea50b8,_0x59d190);})[_0xafc3('0x21')](function(_0x28e350){_0x43907c=_0x28e350;return getCall(_0x2ceb11,_0x1e2c0f,_0x989878,_0xea50b8,_0x43907c,_0x59d190,_0x2761af,_0xafc3('0x8d'));})['then'](function(_0x32b3a0){if(_0x32b3a0){logger[_0xafc3('0x27')]('The\x20Call\x20ID\x20is:',_0x32b3a0['id']);logger['info'](_0xafc3('0x89'),_0xafc3('0x8e'));emit(util[_0xafc3('0x2a')](_0xafc3('0x8f'),_0x2e4bc5[_0xafc3('0x12')]),_0xafc3('0x90'),{'uri':'https://crm.'+_0x989878[_0xafc3('0x78')]+_0xafc3('0x86')+_0x32b3a0['id']});}})[_0xafc3('0x3c')](function(_0x161e04){logger['error'](_0xafc3('0x89'),JSON[_0xafc3('0x39')](_0x161e04));});};exports[_0xafc3('0x6c')]=function(_0x3cf9db,_0x39b548,_0x18151d,_0x567ae4,_0x4a48da,_0x273f91){var _0x2def6b,_0x58493d,_0x2d1eb3;_0x273f91[_0xafc3('0x78')]=intUtil['stripTrailingSlash'](_0x273f91[_0xafc3('0x78')]);_0x273f91[_0xafc3('0x7a')]=intUtil[_0xafc3('0x79')](_0x273f91[_0xafc3('0x7a')]);if(_0x4a48da&&_0x4a48da[_0xafc3('0x7b')]){logger['info'](_0xafc3('0x91'),_0xafc3('0x7d'));_0x39b548[_0xafc3('0x7e')]=_0x273f91[_0xafc3('0x7a')]+_0xafc3('0x8a')+_0x39b548[_0xafc3('0x80')]+_0xafc3('0x7f')+md5(_0x39b548['uniqueid']);}else{_0x39b548[_0xafc3('0x7e')]='';}var _0x487668=_0x273f91[_0xafc3('0x78')]===_0xafc3('0x81')?'eu':'com';return getAccessToken(_0x273f91)[_0xafc3('0x21')](function(_0x41de66){_0x2d1eb3=_0x41de66;return getUser(_0x2d1eb3,_0x487668,_0x273f91);})['then'](function(_0x422bdd){_0x2def6b=_0x422bdd;logger[_0xafc3('0x27')](_0xafc3('0x92'),_0x2def6b['id']);return getEndUser(_0x2d1eb3,_0x487668,_0x273f91,_0x39b548[_0xafc3('0x83')],_0x39b548[_0xafc3('0x93')],_0x2def6b,_0x18151d);})[_0xafc3('0x21')](function(_0x439c09){_0x58493d=_0x439c09;return getCall(_0x2d1eb3,_0x487668,_0x273f91,_0x2def6b,_0x58493d,_0x18151d,_0x39b548,_0xafc3('0x71'));})[_0xafc3('0x21')](function(_0x573341){if(_0x573341){logger['info']('The\x20Call\x20ID\x20is:',_0x573341['id']);}})[_0xafc3('0x3c')](function(_0x54bb72){logger[_0xafc3('0x37')](_0xafc3('0x91'),JSON[_0xafc3('0x39')](_0x54bb72));});}; \ No newline at end of file +var _0xf636=['stack','Search\x20user','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','info','Using\x20the\x20admin\x20account!','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','data','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','contact','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Descriptions','enduserType','Last_Name','What_Id','Full_Name','First_Name','$se_module','talktime','utc','format','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','Abandoned','outbound','Call_Type','merge','Fields','Call\x20created!','err','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','host','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','Outbound','[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','[ABANDONED]','lodash','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/logger','redis','defaults','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','type','string','idField','content','toString','variableName','Variable','name','toLowerCase','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','refreshToken','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token'];(function(_0x527fb1,_0x2b7979){var _0x31c69b=function(_0x205c47){while(--_0x205c47){_0x527fb1['push'](_0x527fb1['shift']());}};_0x31c69b(++_0x2b7979);}(_0xf636,0x195));var _0x6f63=function(_0x20438e,_0x52d60e){_0x20438e=_0x20438e-0x0;var _0x28a646=_0xf636[_0x20438e];return _0x28a646;};'use strict';var _=require(_0x6f63('0x0'));var rp=require(_0x6f63('0x1'));var md5=require('md5');var util=require(_0x6f63('0x2'));var intUtil=require(_0x6f63('0x3'));var moment=require(_0x6f63('0x4'));var Redis=require(_0x6f63('0x5'));var BPromise=require(_0x6f63('0x6'));var config=require('../../../../config/environment');var logger=require(_0x6f63('0x7'))('zoho');config[_0x6f63('0x8')]=_[_0x6f63('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6f63('0xa'))(new Redis(config[_0x6f63('0x8')]));function emit(_0x581381,_0x77c276,_0x561473){io['to'](_0x581381)['emit'](_0x77c276,_0x561473);}function request(_0x30906c){logger[_0x6f63('0xb')](_0x6f63('0xc'),JSON[_0x6f63('0xd')](_0x30906c));return rp(_0x30906c);}function getCustomFields(_0x196570,_0x551b0e){var _0x43654f={};if(_0x196570[_0x6f63('0xe')]>0x0){_[_0x6f63('0xf')](_0x196570,function(_0x2fccde){if(_0x2fccde[_0x6f63('0x10')]===_0x6f63('0x11')&&_0x2fccde[_0x6f63('0x12')]){_0x43654f[_0x2fccde[_0x6f63('0x12')]]=_0x2fccde[_0x6f63('0x13')][_0x6f63('0x14')]();}else if(_0x2fccde[_0x6f63('0x10')]==='variable'&&_0x2fccde[_0x6f63('0x15')]&&_0x2fccde['idField']&&_0x551b0e[_0x2fccde[_0x6f63('0x15')]]){_0x43654f[_0x2fccde[_0x6f63('0x12')]]=_0x551b0e[_0x2fccde[_0x6f63('0x15')]]['toString']();}else if(_0x2fccde[_0x6f63('0x10')]==='customVariable'&&_0x2fccde[_0x6f63('0x16')]&&_0x2fccde[_0x6f63('0x16')]['name']&&_0x2fccde[_0x6f63('0x12')]&&_0x551b0e[_0x2fccde['Variable'][_0x6f63('0x17')]['toLowerCase']()]){_0x43654f[_0x2fccde[_0x6f63('0x12')]]=_0x551b0e[_0x2fccde[_0x6f63('0x16')]['name'][_0x6f63('0x18')]()][_0x6f63('0x14')]();}});}return _0x43654f;}function getName(_0x5b9b54){if(_0x5b9b54['indexOf']('\x20')>0x0){var _0x54a292=_0x5b9b54['split'](/ (.+)/);if(_0x54a292[0x1]){return _0x54a292;}}return[_0x5b9b54,_0x5b9b54];}var accountsTokens={};function getAccessToken(_0xc61f84){return new Promise(function(_0x31ae9b,_0x389ff0){if(!_[_0x6f63('0x19')](accountsTokens[_0xc61f84['id']])&&!_[_0x6f63('0x19')](accountsTokens[_0xc61f84['id']][_0x6f63('0x1a')])){if(moment()[_0x6f63('0x1b')](accountsTokens[_0xc61f84['id']][_0x6f63('0x1c')])){_0x31ae9b(accountsTokens[_0xc61f84['id']]['access_token']);}}var _0x5d804a;switch(_0xc61f84[_0x6f63('0x1d')]){case'US':_0x5d804a=_0x6f63('0x1e');break;case'AU':_0x5d804a=_0x6f63('0x1f');break;case'EU':_0x5d804a=_0x6f63('0x20');break;case'IN':_0x5d804a=_0x6f63('0x21');break;case'CN':_0x5d804a=_0x6f63('0x22');break;default:_0x5d804a=_0x6f63('0x20');break;}var _0x439377={'method':'POST','uri':_0x5d804a+'/oauth/v2/token','qs':{'refresh_token':_0xc61f84[_0x6f63('0x23')],'client_id':_0xc61f84['clientId'],'client_secret':_0xc61f84['clientSecret'],'grant_type':_0x6f63('0x24')},'json':!![]};return rp(_0x439377)[_0x6f63('0x25')](function(_0x1dada6){accountsTokens[_0xc61f84['id']]={'access_token':_0x1dada6[_0x6f63('0x1a')],'expires_in':moment()[_0x6f63('0x26')](_0x1dada6['expires_in'],_0x6f63('0x27'))};_0x31ae9b(_0x1dada6[_0x6f63('0x1a')]);})[_0x6f63('0x28')](function(_0x41962d){logger['error'](_0x6f63('0x29'),_0x41962d[_0x6f63('0x2a')]);_0x389ff0(_0x41962d);});});}function getUser(_0x526fba,_0x7ac381,_0x5409ec,_0x237496){logger['info'](_0x6f63('0x2b'));return request({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x7ac381),'qs':{'type':_0x6f63('0x2c')},'headers':{'Authorization':_0x6f63('0x2d')+_0x526fba},'json':!![]})[_0x6f63('0x25')](function(_0x29fd17){if(_0x29fd17[_0x6f63('0x2e')]){var _0x3a5467=-0x1;if(_[_0x6f63('0x2f')](_0x29fd17[_0x6f63('0x2e')])){if(!_['isNil'](_0x237496)){_0x3a5467=_[_0x6f63('0x30')](_0x29fd17['users'],function(_0x356da4){return _0x356da4[_0x6f63('0x31')]===_0x237496;});}if(_0x3a5467>=0x0){logger['info'](_0x6f63('0x32'));}else{logger[_0x6f63('0x33')](_0x6f63('0x34'));_0x3a5467=_[_0x6f63('0x30')](_0x29fd17['users'],function(_0x54110f){return _0x54110f['profile'][_0x6f63('0x17')]==='Administrator';});}return _0x29fd17['users'][_0x3a5467];}else{if(_0x29fd17['user'][_0x6f63('0x35')]['name']===_0x6f63('0x36')){logger[_0x6f63('0x33')](_0x6f63('0x34'));user=_0x29fd17['user'];return user;}else{logger['error'](_0x6f63('0x37'),JSON[_0x6f63('0xd')](_0x29fd17));throw new Error(_0x6f63('0x38')+JSON[_0x6f63('0xd')](_0x29fd17));}}}else{logger[_0x6f63('0x39')]('The\x20failing\x20result\x20is',JSON[_0x6f63('0xd')](_0x29fd17));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x6f63('0xd')](_0x29fd17));}})['catch'](function(_0x43d615){console[_0x6f63('0x39')](_0x43d615);});}function getZohoUser(_0x337af7,_0x5a2a16){return new BPromise(function(_0x51ff06,_0x528851){request(_0x337af7)[_0x6f63('0x25')](function(_0x555dba){var _0x1e0402=null;if(_0x555dba){_0x1e0402=_0x555dba[_0x6f63('0x3a')][0x0];_0x1e0402['enduserType']=_0x5a2a16;}_0x51ff06(_0x1e0402);})[_0x6f63('0x28')](function(_0x5d3133){_0x528851(_0x5d3133);});});}function createEndUser(_0x32e110,_0x339ab2,_0x195eb5,_0x1235f3,_0x11bed2,_0x17a34e){var _0x195eb5=getName(_0x195eb5);return request({'method':_0x6f63('0x3b'),'uri':_0x6f63('0x3c')+_0x339ab2+_0x6f63('0x3d')+_[_0x6f63('0x3e')](_0x17a34e[_0x6f63('0x3f')])+'s','body':{'data':[{'Last_Name':_0x195eb5[0x1],'First_Name':_0x195eb5[0x0],'Phone':_0x1235f3,'Owner':{'name':!_[_0x6f63('0x19')](_0x11bed2[_0x6f63('0x40')][_0x6f63('0x17')])?_0x11bed2['role'][_0x6f63('0x17')]:!_[_0x6f63('0x19')](_0x11bed2['first_name'])?_0x11bed2[_0x6f63('0x41')]+'\x20'+_0x11bed2[_0x6f63('0x42')]:_0x11bed2[_0x6f63('0x42')],'id':_0x11bed2['id']}}]},'headers':{'Authorization':_0x6f63('0x2d')+_0x32e110},'json':!![]})[_0x6f63('0x25')](function(_0x2ef6d4){if(_0x2ef6d4&&_0x2ef6d4[_0x6f63('0x3a')][0x0][_0x6f63('0x43')]===_0x6f63('0x44')){var _0x12c987=_0x2ef6d4[_0x6f63('0x3a')][0x0][_0x6f63('0x45')];_0x12c987['enduserType']=_[_0x6f63('0x3e')](_0x17a34e[_0x6f63('0x3f')])+'s';return _0x12c987;}logger['error'](_0x6f63('0x37'),JSON[_0x6f63('0xd')](data));throw new Error('Error:\x20'+JSON[_0x6f63('0xd')](data));})[_0x6f63('0x28')](function(_0x19efd6){console[_0x6f63('0x46')](_0x6f63('0x47'),_0x19efd6);});}function getEndUser(_0x325282,_0x2c8b81,_0x28fd35,_0x29180d,_0x27408f,_0x3e1f3f,_0x4ce8dc){var _0x337a37={'method':_0x6f63('0x48'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x325282},'json':!![]};switch(_0x4ce8dc[_0x6f63('0x49')]){case _0x6f63('0x4a'):_0x337a37[_0x6f63('0x4b')]=_0x6f63('0x3c')+_0x2c8b81+_0x6f63('0x4c')+_0x27408f+'))';return getZohoUser(_0x337a37,_0x6f63('0x4d'))[_0x6f63('0x25')](function(_0x409ff0){if(_0x409ff0)return _0x409ff0;_0x337a37[_0x6f63('0x4b')]=_0x6f63('0x3c')+_0x2c8b81+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x27408f+'))';return getZohoUser(_0x337a37,_0x6f63('0x4e'))[_0x6f63('0x25')](function(_0x147bb9){if(_0x147bb9)return _0x147bb9;if(_0x4ce8dc[_0x6f63('0x3f')]!='nothing'){return createEndUser(_0x325282,_0x2c8b81,_0x29180d,_0x27408f,_0x3e1f3f,_0x4ce8dc);}else{return{};}});});break;case _0x6f63('0x4f'):_0x337a37[_0x6f63('0x4b')]=_0x6f63('0x3c')+_0x2c8b81+_0x6f63('0x4c')+_0x27408f+'))';return getZohoUser(_0x337a37,_0x6f63('0x4d'))[_0x6f63('0x25')](function(_0x49d72a){if(_0x49d72a)return _0x49d72a;if(_0x4ce8dc[_0x6f63('0x3f')]!=_0x6f63('0x50')){return createEndUser(_0x325282,_0x2c8b81,_0x29180d,_0x27408f,_0x3e1f3f,_0x4ce8dc);}else{return{};}});break;case _0x6f63('0x51'):_0x337a37[_0x6f63('0x4b')]=_0x6f63('0x3c')+_0x2c8b81+_0x6f63('0x52')+_0x27408f+'))';return getZohoUser(_0x337a37,_0x6f63('0x4e'))[_0x6f63('0x25')](function(_0x4c5a88){if(_0x4c5a88)return _0x4c5a88;if(_0x4ce8dc['moduleCreate']!=_0x6f63('0x50')){return createEndUser(_0x325282,_0x2c8b81,_0x29180d,_0x27408f,_0x3e1f3f,_0x4ce8dc);}else{return{};}});break;}}function getCall(_0x12168b,_0x46144a,_0x14d781,_0x1fb973,_0x5f2b2f,_0x5049d9,_0x41e168,_0x306689){logger[_0x6f63('0x33')](_0x6f63('0x53'));var _0x201adc={};_0x201adc[_0x6f63('0x54')]={'name':!_[_0x6f63('0x19')](_0x1fb973[_0x6f63('0x40')][_0x6f63('0x17')])&&!_[_0x6f63('0x19')](_0x1fb973['profile'][_0x6f63('0x17')])&&_0x1fb973['profile'][_0x6f63('0x17')]===_0x6f63('0x55')?_0x1fb973[_0x6f63('0x40')][_0x6f63('0x17')]:!_[_0x6f63('0x19')](_0x1fb973[_0x6f63('0x41')])?_0x1fb973[_0x6f63('0x41')]+'\x20'+_0x1fb973['last_name']:_0x1fb973[_0x6f63('0x42')],'id':_0x1fb973['id']};_0x201adc[_0x6f63('0x56')]=intUtil[_0x6f63('0x57')](_0x5049d9[_0x6f63('0x58')],_0x41e168,'\x20');_0x201adc['Description']=intUtil[_0x6f63('0x57')](_0x5049d9[_0x6f63('0x59')],_0x41e168,'\x0a');if(_0x5f2b2f[_0x6f63('0x5a')]===_0x6f63('0x4d')){_0x201adc['Who_Id']={'name':!_['isNil'](_0x5f2b2f['Full_Name'])?_0x5f2b2f['Full_Name']:!_[_0x6f63('0x19')](_0x5f2b2f['First_Name'])?_0x5f2b2f['First_Name']+'\x20'+_0x5f2b2f[_0x6f63('0x5b')]:_0x5f2b2f['Last_Name'],'id':_0x5f2b2f['id']};}if(_0x5f2b2f['enduserType']===_0x6f63('0x4e')){_0x201adc[_0x6f63('0x5c')]={'name':!_[_0x6f63('0x19')](_0x5f2b2f[_0x6f63('0x5d')])?_0x5f2b2f['Full_Name']:!_[_0x6f63('0x19')](_0x5f2b2f[_0x6f63('0x5e')])?_0x5f2b2f[_0x6f63('0x5e')]+'\x20'+_0x5f2b2f[_0x6f63('0x5b')]:_0x5f2b2f[_0x6f63('0x5b')],'id':_0x5f2b2f['id']};_0x201adc[_0x6f63('0x5f')]=_[_0x6f63('0x3e')](_0x5f2b2f[_0x6f63('0x5a')]);}if(_0x41e168[_0x6f63('0x60')]){_0x201adc['Call_Duration']=moment[_0x6f63('0x61')](parseInt(_0x41e168[_0x6f63('0x60')])*0x3e8)[_0x6f63('0x62')](_0x6f63('0x63'));}else if(_0x41e168[_0x6f63('0x64')]&&_0x41e168['endtime']){_0x201adc['Call_Duration']=moment[_0x6f63('0x61')](moment(_0x41e168[_0x6f63('0x65')],_0x6f63('0x66'))[_0x6f63('0x67')](moment(_0x41e168[_0x6f63('0x68')],_0x6f63('0x66'))))[_0x6f63('0x62')](_0x6f63('0x63'));}switch(_0x41e168[_0x6f63('0x69')]){case _0x6f63('0x6a'):_0x201adc[_0x6f63('0x6b')]=_0x6f63('0x6c');break;case _0x6f63('0x6d'):case _0x6f63('0x6e'):_0x201adc[_0x6f63('0x6b')]=_0x6f63('0x6f');break;case'rejected':_0x201adc['Call_Result']='Rejected';break;case'abandoned':_0x201adc[_0x6f63('0x6b')]=_0x6f63('0x70');break;default:}_0x201adc['Call_Start_Time']=(_0x306689===_0x6f63('0x71')?moment(_0x41e168[_0x6f63('0x68')])[_0x6f63('0x62')](_0x6f63('0x66')):moment(_0x41e168['agentcalledAt'])['format'](_0x6f63('0x66')))||moment()[_0x6f63('0x62')](_0x6f63('0x66'));_0x201adc[_0x6f63('0x72')]=_0x306689||'Inbound';_0x201adc=_[_0x6f63('0x73')](_0x201adc,getCustomFields(_0x5049d9[_0x6f63('0x74')],_0x41e168));return request({'method':_0x6f63('0x3b'),'uri':_0x6f63('0x3c')+_0x46144a+'/crm/v2/Calls','headers':{'Authorization':_0x6f63('0x2d')+_0x12168b},'body':{'data':[_0x201adc]},'json':!![]})[_0x6f63('0x25')](function(_0x55d863){if(_0x55d863&&_0x55d863['data'][0x0][_0x6f63('0x43')]==='SUCCESS'){logger[_0x6f63('0x33')](_0x6f63('0x75'));return{'id':_0x55d863[_0x6f63('0x3a')][0x0][_0x6f63('0x45')]['id']};}})[_0x6f63('0x28')](function(_0x16d3e1){logger[_0x6f63('0x33')](_0x6f63('0x76'),_0x16d3e1[_0x6f63('0x2a')]);console[_0x6f63('0x46')](_0x6f63('0x76'),_0x16d3e1);});}exports[_0x6f63('0x77')]=function(_0x3084cb,_0x4e7a5d,_0x1a0b52,_0x1651d9,_0x5ed4ae,_0x146f3b){var _0x20395c,_0x1fdca8,_0x20e5b2;_0x146f3b['host']=intUtil[_0x6f63('0x78')](_0x146f3b['host']);_0x146f3b[_0x6f63('0x79')]=intUtil['stripTrailingSlash'](_0x146f3b[_0x6f63('0x79')]);if(_0x5ed4ae&&_0x5ed4ae[_0x6f63('0x7a')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x4e7a5d[_0x6f63('0x7b')]=_0x146f3b[_0x6f63('0x79')]+_0x6f63('0x7c')+_0x4e7a5d['uniqueid']+_0x6f63('0x7d')+md5(_0x4e7a5d[_0x6f63('0x7e')]);}else{_0x4e7a5d[_0x6f63('0x7b')]='';}var _0x83788a=_0x146f3b[_0x6f63('0x7f')]===_0x6f63('0x80')?'eu':_0x6f63('0x81');return getAccessToken(_0x146f3b)['then'](function(_0x421ec3){_0x20e5b2=_0x421ec3;return getUser(_0x20e5b2,_0x83788a,_0x146f3b,_0x1651d9[_0x6f63('0x31')]);})[_0x6f63('0x25')](function(_0x36b35b){_0x20395c=_0x36b35b;logger['info'](_0x6f63('0x82'),_0x20395c['id']);return getEndUser(_0x20e5b2,_0x83788a,_0x146f3b,_0x4e7a5d[_0x6f63('0x83')],_0x4e7a5d[_0x6f63('0x84')],_0x20395c,_0x1a0b52);})[_0x6f63('0x25')](function(_0x49b063){_0x1fdca8=_0x49b063;return getCall(_0x20e5b2,_0x83788a,_0x146f3b,_0x20395c,_0x1fdca8,_0x1a0b52,_0x4e7a5d,_0x6f63('0x85'));})[_0x6f63('0x25')](function(_0x4548fc){if(_0x4548fc){logger[_0x6f63('0x33')](_0x6f63('0x86'),_0x4548fc['id']);logger[_0x6f63('0x33')](_0x6f63('0x87'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6f63('0x62')](_0x6f63('0x88'),_0x1651d9[_0x6f63('0x17')]),_0x6f63('0x89'),{'uri':_0x6f63('0x8a')+_0x146f3b[_0x6f63('0x7f')]+_0x6f63('0x8b')+_0x4548fc['id']});}})['catch'](function(_0x441498){logger[_0x6f63('0x39')]('[QUEUE]',JSON['stringify'](_0x441498));});};exports['outbound']=function(_0x344252,_0x34d81f,_0x41a594,_0x48d2d1,_0x5d37d9,_0x10e0cf,_0x88482f){var _0x2696a4,_0x1a823b,_0x28dbaf;_0x10e0cf[_0x6f63('0x7f')]=intUtil[_0x6f63('0x78')](_0x10e0cf['host']);_0x10e0cf[_0x6f63('0x79')]=intUtil[_0x6f63('0x78')](_0x10e0cf[_0x6f63('0x79')]);if(_0x88482f&&_0x88482f[_0x6f63('0x8c')]&&_0x88482f[_0x6f63('0x8c')]!==_0x6f63('0x8d')){logger[_0x6f63('0x33')]('[OUTBOUND]',_0x6f63('0x8e'));_0x34d81f[_0x6f63('0x7b')]=_0x10e0cf[_0x6f63('0x79')]+_0x6f63('0x7c')+_0x34d81f[_0x6f63('0x7e')]+_0x6f63('0x7d')+md5(_0x34d81f['uniqueid']);}var _0x2ad1b1=_0x10e0cf['host']===_0x6f63('0x80')?'eu':'com';return getAccessToken(_0x10e0cf)[_0x6f63('0x25')](function(_0x4b0ec8){_0x28dbaf=_0x4b0ec8;return getUser(_0x28dbaf,_0x2ad1b1,_0x10e0cf,_0x48d2d1['email']);})[_0x6f63('0x25')](function(_0x540b60){_0x2696a4=_0x540b60;logger[_0x6f63('0x33')](_0x6f63('0x82'),_0x2696a4['id']);return getEndUser(_0x28dbaf,_0x2ad1b1,_0x10e0cf,_0x34d81f[_0x6f63('0x8f')],_0x34d81f['destcalleridnum'],_0x2696a4,_0x41a594);})[_0x6f63('0x25')](function(_0x2b68f5){_0x1a823b=_0x2b68f5;return getCall(_0x28dbaf,_0x2ad1b1,_0x10e0cf,_0x2696a4,_0x1a823b,_0x41a594,_0x34d81f,_0x6f63('0x90'));})[_0x6f63('0x25')](function(_0xd6a6b2){if(_0xd6a6b2){logger[_0x6f63('0x33')](_0x6f63('0x86'),_0xd6a6b2['id']);logger[_0x6f63('0x33')](_0x6f63('0x91'),_0x6f63('0x92'));emit(util[_0x6f63('0x62')](_0x6f63('0x88'),_0x48d2d1[_0x6f63('0x17')]),_0x6f63('0x89'),{'uri':_0x6f63('0x8a')+_0x10e0cf[_0x6f63('0x7f')]+_0x6f63('0x8b')+_0xd6a6b2['id']});}})[_0x6f63('0x28')](function(_0x433ab7){logger['error'](_0x6f63('0x91'),JSON[_0x6f63('0xd')](_0x433ab7));});};exports[_0x6f63('0x93')]=function(_0x5d2738,_0x24efc5,_0x2c9a6a,_0x1412ee,_0x3549ce,_0x3bb3da){var _0x2fe36b,_0x47c835,_0x78dd32;_0x3bb3da[_0x6f63('0x7f')]=intUtil[_0x6f63('0x78')](_0x3bb3da['host']);_0x3bb3da[_0x6f63('0x79')]=intUtil[_0x6f63('0x78')](_0x3bb3da[_0x6f63('0x79')]);if(_0x3549ce&&_0x3549ce[_0x6f63('0x7a')]){logger[_0x6f63('0x33')](_0x6f63('0x94'),_0x6f63('0x8e'));_0x24efc5[_0x6f63('0x7b')]=_0x3bb3da[_0x6f63('0x79')]+'/api/voice/recordings/'+_0x24efc5['uniqueid']+_0x6f63('0x7d')+md5(_0x24efc5['uniqueid']);}else{_0x24efc5[_0x6f63('0x7b')]='';}var _0x295040=_0x3bb3da[_0x6f63('0x7f')]===_0x6f63('0x80')?'eu':_0x6f63('0x81');return getAccessToken(_0x3bb3da)[_0x6f63('0x25')](function(_0x5f0a58){_0x78dd32=_0x5f0a58;return getUser(_0x78dd32,_0x295040,_0x3bb3da);})[_0x6f63('0x25')](function(_0x549a0c){_0x2fe36b=_0x549a0c;logger[_0x6f63('0x33')](_0x6f63('0x82'),_0x2fe36b['id']);return getEndUser(_0x78dd32,_0x295040,_0x3bb3da,_0x24efc5['calleridname'],_0x24efc5[_0x6f63('0x84')],_0x2fe36b,_0x2c9a6a);})[_0x6f63('0x25')](function(_0x430433){_0x47c835=_0x430433;return getCall(_0x78dd32,_0x295040,_0x3bb3da,_0x2fe36b,_0x47c835,_0x2c9a6a,_0x24efc5,_0x6f63('0x85'));})['then'](function(_0x50d78a){if(_0x50d78a){logger[_0x6f63('0x33')](_0x6f63('0x86'),_0x50d78a['id']);}})[_0x6f63('0x28')](function(_0x6da9a0){logger['error'](_0x6f63('0x94'),JSON[_0x6f63('0xd')](_0x6da9a0));});}; \ 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 357e1d0..3b3f38b 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(_0x535247,_0x515f33){var _0x4dbb6d=function(_0x11069d){while(--_0x11069d){_0x535247['push'](_0x535247['shift']());}};_0x4dbb6d(++_0x515f33);}(_0x7a54,0x106));var _0x47a5=function(_0x430712,_0x345db5){_0x430712=_0x430712-0x0;var _0x46f4db=_0x7a54[_0x430712];return _0x46f4db;};'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(_0xd4ef4,_0x36db92){var _0x464183=function(_0x38bcc7){while(--_0x38bcc7){_0xd4ef4['push'](_0xd4ef4['shift']());}};_0x464183(++_0x36db92);}(_0x7a54,0x106));var _0x47a5=function(_0x5f3cf0,_0x2df5eb){_0x5f3cf0=_0x5f3cf0-0x0;var _0x2e2a27=_0x7a54[_0x5f3cf0];return _0x2e2a27;};'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 2b4ce03..eb97cfd 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(_0x1d7160,_0x3a6cab){var _0x40173e=function(_0x4f85d0){while(--_0x4f85d0){_0x1d7160['push'](_0x1d7160['shift']());}};_0x40173e(++_0x3a6cab);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2015ac,_0x517d53){_0x2015ac=_0x2015ac-0x0;var _0x519a71=_0x5f2f[_0x2015ac];return _0x519a71;};'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 _0xb10b=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x46a355,_0x4b9083){var _0xff2f8a=function(_0xb4e123){while(--_0xb4e123){_0x46a355['push'](_0x46a355['shift']());}};_0xff2f8a(++_0x4b9083);}(_0xb10b,0x12a));var _0xbb10=function(_0xe06071,_0x4eeaa1){_0xe06071=_0xe06071-0x0;var _0x8ad8be=_0xb10b[_0xe06071];return _0x8ad8be;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 413ea54..255bfee 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 _0x1f75=['http','Request','request','then','debug','rpc','error','message','result','catch','routing','exports','jayson/promise','bluebird','../../config/logger','client'];(function(_0xec6f47,_0x3cb8f9){var _0x35ceb2=function(_0x5e316e){while(--_0x5e316e){_0xec6f47['push'](_0xec6f47['shift']());}};_0x35ceb2(++_0x3cb8f9);}(_0x1f75,0x12c));var _0x51f7=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x1f75[_0x8de54f];return _0x14cba4;};'use strict';var jayson=require(_0x51f7('0x0'));var BPromise=require(_0x51f7('0x1'));var logger=require(_0x51f7('0x2'))('routing');var client=jayson[_0x51f7('0x3')][_0x51f7('0x4')]({'port':0x2329});client[_0x51f7('0x5')]=function(_0x11265a,_0x3df27f){return new BPromise(function(_0x4e6fc,_0x205684){return client[_0x51f7('0x6')](_0x11265a,_0x3df27f)[_0x51f7('0x7')](function(_0x22fc29){logger[_0x51f7('0x8')](_0x51f7('0x9'),'routing',_0x11265a,_0x3df27f,_0x22fc29);if(_0x22fc29[_0x51f7('0xa')]){logger[_0x51f7('0xa')](_0x51f7('0x9'),'routing',_0x11265a,_0x22fc29['error'][_0x51f7('0xb')],_0x3df27f);return _0x205684(_0x22fc29[_0x51f7('0xa')]['message']);}else{return _0x4e6fc(_0x22fc29[_0x51f7('0xc')]);}})[_0x51f7('0xd')](function(_0x5f4a51){logger['error'](_0x51f7('0x9'),_0x51f7('0xe'),_0x11265a,_0x5f4a51,_0x3df27f);return _0x205684(_0x5f4a51);});});};module[_0x51f7('0xf')]=client; \ No newline at end of file +var _0xaf9b=['request','debug','error','rpc','routing','message','result','catch','exports','jayson/promise','../../config/logger','client','http','Request'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x947746,_0x6cce68){_0x947746=_0x947746-0x0;var _0x245fe4=_0xaf9b[_0x947746];return _0x245fe4;};'use strict';var jayson=require(_0xbaf9('0x0'));var BPromise=require('bluebird');var logger=require(_0xbaf9('0x1'))('routing');var client=jayson[_0xbaf9('0x2')][_0xbaf9('0x3')]({'port':0x2329});client[_0xbaf9('0x4')]=function(_0x3c19b1,_0x512b7c){return new BPromise(function(_0x64585f,_0x178a7a){return client[_0xbaf9('0x5')](_0x3c19b1,_0x512b7c)['then'](function(_0x40b949){logger[_0xbaf9('0x6')]('rpc','routing',_0x3c19b1,_0x512b7c,_0x40b949);if(_0x40b949[_0xbaf9('0x7')]){logger[_0xbaf9('0x7')](_0xbaf9('0x8'),_0xbaf9('0x9'),_0x3c19b1,_0x40b949[_0xbaf9('0x7')][_0xbaf9('0xa')],_0x512b7c);return _0x178a7a(_0x40b949[_0xbaf9('0x7')][_0xbaf9('0xa')]);}else{return _0x64585f(_0x40b949[_0xbaf9('0xb')]);}})[_0xbaf9('0xc')](function(_0x30fa1f){logger[_0xbaf9('0x7')]('rpc',_0xbaf9('0x9'),_0x3c19b1,_0x30fa1f,_0x512b7c);return _0x178a7a(_0x30fa1f);});});};module[_0xbaf9('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index bc62ff0..7c753fa 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 _0xd493=['findOne','loginMailFrequency','catch','bluebird','./realtime','./lib/email','../../mysqldb','getMailAccounts','then','refresh','mailAccounts','listen','Setting'];(function(_0x5acd16,_0x1eb2b4){var _0x1a5cdd=function(_0x1cca56){while(--_0x1cca56){_0x5acd16['push'](_0x5acd16['shift']());}};_0x1a5cdd(++_0x1eb2b4);}(_0xd493,0x1bd));var _0x3d49=function(_0x482f99,_0x18ffde){_0x482f99=_0x482f99-0x0;var _0x4abb99=_0xd493[_0x482f99];return _0x4abb99;};'use strict';var BPromise=require(_0x3d49('0x0'));var server=require('./server');var Realtime=require(_0x3d49('0x1'));var EmailChannel=require(_0x3d49('0x2'));var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x3d49('0x3'))['db'];function initRealtime(){return BPromise['resolve']()['then'](mailAccount[_0x3d49('0x4')]())[_0x3d49('0x5')](realtime['initMailAccounts']())['then'](function(){email[_0x3d49('0x6')](realtime[_0x3d49('0x7')]);return realtime;});}function main(){return server[_0x3d49('0x8')](realtime,email)[_0x3d49('0x5')](function(_0x5d3a0a){return initRealtime();})[_0x3d49('0x5')](function(_0x41bdd0){return db[_0x3d49('0x9')][_0x3d49('0xa')]({'attributes':['id',_0x3d49('0xb')],'raw':!![]});})[_0x3d49('0x5')](function(_0x3d347e){return setInterval(initRealtime,_0x3d347e[_0x3d49('0xb')]*0x3e8);})[_0x3d49('0xc')](function(_0x3e1fd0){console['log'](_0x3e1fd0);});}main(); \ No newline at end of file +var _0x92bc=['catch','log','bluebird','./server','./realtime','../../mysqldb','resolve','then','getMailAccounts','initMailAccounts','refresh','Setting','findOne'];(function(_0x33d427,_0x47c8c2){var _0x383dbd=function(_0x578493){while(--_0x578493){_0x33d427['push'](_0x33d427['shift']());}};_0x383dbd(++_0x47c8c2);}(_0x92bc,0x106));var _0xc92b=function(_0x56c4cb,_0x4e1e77){_0x56c4cb=_0x56c4cb-0x0;var _0x4cf0c9=_0x92bc[_0x56c4cb];return _0x4cf0c9;};'use strict';var BPromise=require(_0xc92b('0x0'));var server=require(_0xc92b('0x1'));var Realtime=require(_0xc92b('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xc92b('0x3'))['db'];function initRealtime(){return BPromise[_0xc92b('0x4')]()[_0xc92b('0x5')](mailAccount[_0xc92b('0x6')]())['then'](realtime[_0xc92b('0x7')]())[_0xc92b('0x5')](function(){email[_0xc92b('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0xc92b('0x5')](function(_0x439122){return initRealtime();})['then'](function(_0x10d280){return db[_0xc92b('0x9')][_0xc92b('0xa')]({'attributes':['id','loginMailFrequency'],'raw':!![]});})[_0xc92b('0x5')](function(_0x5619a3){return setInterval(initRealtime,_0x5619a3['loginMailFrequency']*0x3e8);})[_0xc92b('0xb')](function(_0x5960e0){console[_0xc92b('0xc')](_0x5960e0);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index e7d1e2f..d4149d1 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 _0xfa7b=['messages','firstName','lastName','from','notify','then','catch','error','lastSync','sendMail','send','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','defaults','localhost','redis','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','status','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','disabled','connected'];(function(_0x442670,_0x51282f){var _0x150d64=function(_0x273161){while(--_0x273161){_0x442670['push'](_0x442670['shift']());}};_0x150d64(++_0x51282f);}(_0xfa7b,0x153));var _0xbfa7=function(_0x77373f,_0xb3a3ed){_0x77373f=_0x77373f-0x0;var _0x9a705f=_0xfa7b[_0x77373f];return _0x9a705f;};'use strict';var _=require(_0xbfa7('0x0'));var moment=require(_0xbfa7('0x1'));var BPromise=require(_0xbfa7('0x2'));var md5=require(_0xbfa7('0x3'));var Redis=require(_0xbfa7('0x4'));var config=require(_0xbfa7('0x5'));var logger=require('../../../config/logger')(_0xbfa7('0x6'));config['redis']=_[_0xbfa7('0x7')](config['redis'],{'host':_0xbfa7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbfa7('0x9')]));var EmailImap=require(_0xbfa7('0xa'));var EmailSmtp=require(_0xbfa7('0xb'));var mailAccount=require(_0xbfa7('0xc'));var md5Accounts={};function EmailChannel(_0xe8af18){logger[_0xbfa7('0xd')](_0xbfa7('0xe'));this[_0xbfa7('0xf')]=_0xe8af18[_0xbfa7('0xf')];this[_0xbfa7('0x10')]={};this[_0xbfa7('0x11')]=new EmailSmtp();}EmailChannel[_0xbfa7('0x12')][_0xbfa7('0x13')]=function(_0x4bfe33){var _0x13806f=this[_0xbfa7('0xf')][_0x4bfe33];var _0x2fde2d={'id':_0x13806f['id'],'name':_0x13806f[_0xbfa7('0x14')],'key':_0x13806f['key'],'active':_0x13806f[_0xbfa7('0x15')],'Imap':{'status':_0x13806f['Imap'][_0xbfa7('0x16')],'messageStatus':_0x13806f[_0xbfa7('0x17')][_0xbfa7('0x18')],'total':_0x13806f[_0xbfa7('0x17')][_0xbfa7('0x19')]}};if(_[_0xbfa7('0x1a')](md5Accounts[_0x4bfe33])){md5Accounts[_0x4bfe33]={};}var _0x363011=md5(JSON[_0xbfa7('0x1b')](_0x2fde2d));if(md5Accounts[_0x4bfe33][_0xbfa7('0x3')]!==_0x363011){md5Accounts[_0x4bfe33][_0xbfa7('0x3')]=_0x363011;io[_0xbfa7('0x13')](_0xbfa7('0x1c'),_0x2fde2d);}};EmailChannel[_0xbfa7('0x12')][_0xbfa7('0x1d')]=function(_0x8463b9){for(var _0x1ae3f1 in _0x8463b9){if(_0x8463b9[_0xbfa7('0x1e')](_0x1ae3f1)){if(_0x8463b9[_0x1ae3f1]['Imap']&&_0x8463b9[_0x1ae3f1][_0xbfa7('0x15')]){var _0xffeb86=_0x8463b9[_0x1ae3f1][_0xbfa7('0x17')];if(!this[_0xbfa7('0x10')][_0xbfa7('0x1e')](_0xffeb86['id'])){this[_0xbfa7('0x10')][_0xffeb86['id']]=new EmailImap(_0xffeb86,_0x8463b9[_0x1ae3f1][_0xbfa7('0x6')]);this[_0xbfa7('0x10')][_0xffeb86['id']]['on'](_0xbfa7('0x1f'),this[_0xbfa7('0x20')][_0xbfa7('0x21')](this,_0x1ae3f1));this['imapAccounts'][_0xffeb86['id']]['on'](_0xbfa7('0x6'),this[_0xbfa7('0x22')][_0xbfa7('0x21')](this,_0x1ae3f1));this['imapAccounts'][_0xffeb86['id']]['on'](_0xbfa7('0x23'),this[_0xbfa7('0x24')][_0xbfa7('0x21')](this,_0x1ae3f1));this['imapAccounts'][_0xffeb86['id']]['on']('error',this['handleImapError'][_0xbfa7('0x21')](this,_0x1ae3f1));}}else{if(_['isNil'](this[_0xbfa7('0xf')][_0x1ae3f1]['Imap'])){this['mailAccounts'][_0x1ae3f1][_0xbfa7('0x17')]={};}this[_0xbfa7('0xf')][_0x1ae3f1][_0xbfa7('0x17')]['status']=_0xbfa7('0x25');this[_0xbfa7('0xf')][_0x1ae3f1][_0xbfa7('0x17')][_0xbfa7('0x18')]='';this[_0xbfa7('0x13')](_0x1ae3f1);}}}};EmailChannel[_0xbfa7('0x12')][_0xbfa7('0x20')]=function(_0x1ec1bb,_0x10c6fc){if(this[_0xbfa7('0xf')][_0x1ec1bb]){this[_0xbfa7('0xf')][_0x1ec1bb][_0xbfa7('0x17')][_0xbfa7('0x16')]=_0xbfa7('0x26');this[_0xbfa7('0xf')][_0x1ec1bb][_0xbfa7('0x17')][_0xbfa7('0x18')]=_0x10c6fc[_0xbfa7('0x14')];if(_0x10c6fc['messages']){this[_0xbfa7('0xf')][_0x1ec1bb][_0xbfa7('0x17')][_0xbfa7('0x19')]=_0x10c6fc[_0xbfa7('0x27')][_0xbfa7('0x19')];}return this[_0xbfa7('0x13')](_0x1ec1bb);}};EmailChannel[_0xbfa7('0x12')][_0xbfa7('0x22')]=function(_0xfeef1,_0x27b5e8){logger[_0xbfa7('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x27b5e8[_0xbfa7('0x28')],_0x27b5e8[_0xbfa7('0x29')],_0x27b5e8[_0xbfa7('0x2a')],_0xfeef1);if(this[_0xbfa7('0xf')][_0xfeef1]){return mailAccount[_0xbfa7('0x2b')](_0xfeef1,_0x27b5e8)[_0xbfa7('0x2c')](function(_0x3b03a7){if(_0x3b03a7){logger[_0xbfa7('0xd')]('Mail\x20accepted\x20from\x20routing');}})[_0xbfa7('0x2d')](function(_0x2a281d){logger[_0xbfa7('0x2e')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xbfa7('0x1b')](_0x2a281d));});}};EmailChannel['prototype'][_0xbfa7('0x24')]=function(_0x50530f){if(this['mailAccounts'][_0x50530f]&&this[_0xbfa7('0xf')][_0x50530f]['Imap']){if(this['imapAccounts'][this[_0xbfa7('0xf')][_0x50530f][_0xbfa7('0x17')]['id']]){delete this[_0xbfa7('0x10')][this[_0xbfa7('0xf')][_0x50530f][_0xbfa7('0x17')]['id']];}this[_0xbfa7('0xf')][_0x50530f][_0xbfa7('0x17')][_0xbfa7('0x2f')]=moment();this['emit'](_0x50530f);}};EmailChannel[_0xbfa7('0x12')]['handleImapError']=function(_0x13624c,_0x529084){if(this[_0xbfa7('0xf')][_0x13624c]){this[_0xbfa7('0xf')][_0x13624c]['Imap'][_0xbfa7('0x16')]='error';this[_0xbfa7('0xf')][_0x13624c][_0xbfa7('0x17')][_0xbfa7('0x18')]=_0x529084;return this[_0xbfa7('0x13')](_0x13624c);}};EmailChannel[_0xbfa7('0x12')][_0xbfa7('0x30')]=function(_0x30bf22,_0x8fea88){return this['smtp'][_0xbfa7('0x31')](_0x30bf22,_0x8fea88);};EmailChannel['prototype']['verifySmtp']=function(_0xac737f){var _0x5682a8=this;if(this[_0xbfa7('0xf')][_0xac737f['id']]){if(_[_0xbfa7('0x1a')](this[_0xbfa7('0xf')][_0xac737f['id']][_0xbfa7('0x32')])){this[_0xbfa7('0xf')][_0xac737f['id']]['Smtp']={};}this[_0xbfa7('0xf')][_0xac737f['id']][_0xbfa7('0x32')][_0xbfa7('0x2f')]=moment();return new BPromise(function(_0x2d49c3,_0x151a11){return _0x5682a8[_0xbfa7('0x11')][_0xbfa7('0x33')](_0xac737f)[_0xbfa7('0x2c')](function(_0x23e150){_0x5682a8[_0xbfa7('0xf')][_0xac737f['id']][_0xbfa7('0x32')][_0xbfa7('0x16')]=_0xbfa7('0x34');_0x5682a8[_0xbfa7('0xf')][_0xac737f['id']][_0xbfa7('0x32')][_0xbfa7('0x18')]='';_0x5682a8['emit'](_0xac737f['id']);_0x2d49c3(_0x23e150);})['catch'](function(_0x1650fe){_0x5682a8[_0xbfa7('0xf')][_0xac737f['id']][_0xbfa7('0x32')][_0xbfa7('0x16')]=_0xbfa7('0x2e');_0x5682a8[_0xbfa7('0xf')][_0xac737f['id']][_0xbfa7('0x32')][_0xbfa7('0x18')]=_0x1650fe;_0x5682a8['emit'](_0xac737f['id']);_0x151a11(_0x1650fe);});});}return this['smtp'][_0xbfa7('0x33')](_0xac737f);};module[_0xbfa7('0x35')]=EmailChannel; \ No newline at end of file +var _0xfc44=['status','messageStatus','total','isNil','stringify','emit','mailAccount:update','hasOwnProperty','active','handleImapBox','bind','end','handleImapEnd','error','handleImapError','connected','name','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','catch','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','key','Imap'];(function(_0x1e46a5,_0x5b094e){var _0x35a2cf=function(_0x5e7c65){while(--_0x5e7c65){_0x1e46a5['push'](_0x1e46a5['shift']());}};_0x35a2cf(++_0x5b094e);}(_0xfc44,0xbb));var _0x4fc4=function(_0x5c452e,_0x48d665){_0x5c452e=_0x5c452e-0x0;var _0x4c04c7=_0xfc44[_0x5c452e];return _0x4c04c7;};'use strict';var _=require('lodash');var moment=require(_0x4fc4('0x0'));var BPromise=require(_0x4fc4('0x1'));var md5=require(_0x4fc4('0x2'));var Redis=require(_0x4fc4('0x3'));var config=require(_0x4fc4('0x4'));var logger=require(_0x4fc4('0x5'))(_0x4fc4('0x6'));config[_0x4fc4('0x7')]=_[_0x4fc4('0x8')](config['redis'],{'host':_0x4fc4('0x9'),'port':0x18eb});var io=require(_0x4fc4('0xa'))(new Redis(config[_0x4fc4('0x7')]));var EmailImap=require(_0x4fc4('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x4fc4('0xc'));var md5Accounts={};function EmailChannel(_0x3b9469){logger[_0x4fc4('0xd')](_0x4fc4('0xe'));this[_0x4fc4('0xf')]=_0x3b9469[_0x4fc4('0xf')];this[_0x4fc4('0x10')]={};this[_0x4fc4('0x11')]=new EmailSmtp();}EmailChannel[_0x4fc4('0x12')]['emit']=function(_0x20c684){var _0x588633=this['mailAccounts'][_0x20c684];var _0x1e9885={'id':_0x588633['id'],'name':_0x588633['name'],'key':_0x588633[_0x4fc4('0x13')],'active':_0x588633['active'],'Imap':{'status':_0x588633[_0x4fc4('0x14')][_0x4fc4('0x15')],'messageStatus':_0x588633['Imap'][_0x4fc4('0x16')],'total':_0x588633[_0x4fc4('0x14')][_0x4fc4('0x17')]}};if(_[_0x4fc4('0x18')](md5Accounts[_0x20c684])){md5Accounts[_0x20c684]={};}var _0x247e2c=md5(JSON[_0x4fc4('0x19')](_0x1e9885));if(md5Accounts[_0x20c684][_0x4fc4('0x2')]!==_0x247e2c){md5Accounts[_0x20c684]['md5']=_0x247e2c;io[_0x4fc4('0x1a')](_0x4fc4('0x1b'),_0x1e9885);}};EmailChannel[_0x4fc4('0x12')]['refresh']=function(_0x48cbae){for(var _0x3feb90 in _0x48cbae){if(_0x48cbae[_0x4fc4('0x1c')](_0x3feb90)){if(_0x48cbae[_0x3feb90][_0x4fc4('0x14')]&&_0x48cbae[_0x3feb90][_0x4fc4('0x1d')]){var _0x310ba5=_0x48cbae[_0x3feb90][_0x4fc4('0x14')];if(!this[_0x4fc4('0x10')][_0x4fc4('0x1c')](_0x310ba5['id'])){this['imapAccounts'][_0x310ba5['id']]=new EmailImap(_0x310ba5,_0x48cbae[_0x3feb90]['email']);this[_0x4fc4('0x10')][_0x310ba5['id']]['on']('box',this[_0x4fc4('0x1e')][_0x4fc4('0x1f')](this,_0x3feb90));this[_0x4fc4('0x10')][_0x310ba5['id']]['on'](_0x4fc4('0x6'),this['handleImapEmail'][_0x4fc4('0x1f')](this,_0x3feb90));this[_0x4fc4('0x10')][_0x310ba5['id']]['on'](_0x4fc4('0x20'),this[_0x4fc4('0x21')]['bind'](this,_0x3feb90));this[_0x4fc4('0x10')][_0x310ba5['id']]['on'](_0x4fc4('0x22'),this[_0x4fc4('0x23')]['bind'](this,_0x3feb90));}}else{if(_[_0x4fc4('0x18')](this[_0x4fc4('0xf')][_0x3feb90][_0x4fc4('0x14')])){this[_0x4fc4('0xf')][_0x3feb90]['Imap']={};}this[_0x4fc4('0xf')][_0x3feb90][_0x4fc4('0x14')][_0x4fc4('0x15')]='disabled';this[_0x4fc4('0xf')][_0x3feb90]['Imap']['messageStatus']='';this[_0x4fc4('0x1a')](_0x3feb90);}}}};EmailChannel[_0x4fc4('0x12')]['handleImapBox']=function(_0x2bb412,_0x50d9a6){if(this[_0x4fc4('0xf')][_0x2bb412]){this[_0x4fc4('0xf')][_0x2bb412][_0x4fc4('0x14')]['status']=_0x4fc4('0x24');this[_0x4fc4('0xf')][_0x2bb412]['Imap'][_0x4fc4('0x16')]=_0x50d9a6[_0x4fc4('0x25')];if(_0x50d9a6[_0x4fc4('0x26')]){this['mailAccounts'][_0x2bb412][_0x4fc4('0x14')][_0x4fc4('0x17')]=_0x50d9a6[_0x4fc4('0x26')][_0x4fc4('0x17')];}return this[_0x4fc4('0x1a')](_0x2bb412);}};EmailChannel[_0x4fc4('0x12')][_0x4fc4('0x27')]=function(_0x42c296,_0x20f79d){logger[_0x4fc4('0xd')](_0x4fc4('0x28'),_0x20f79d['firstName'],_0x20f79d['lastName'],_0x20f79d[_0x4fc4('0x29')],_0x42c296);if(this[_0x4fc4('0xf')][_0x42c296]){return mailAccount[_0x4fc4('0x2a')](_0x42c296,_0x20f79d)['then'](function(_0xb6cbc8){if(_0xb6cbc8){logger[_0x4fc4('0xd')]('Mail\x20accepted\x20from\x20routing');}})[_0x4fc4('0x2b')](function(_0x1ff379){logger[_0x4fc4('0x22')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x4fc4('0x19')](_0x1ff379));});}};EmailChannel[_0x4fc4('0x12')][_0x4fc4('0x21')]=function(_0xad2b8e){if(this[_0x4fc4('0xf')][_0xad2b8e]&&this[_0x4fc4('0xf')][_0xad2b8e][_0x4fc4('0x14')]){if(this[_0x4fc4('0x10')][this[_0x4fc4('0xf')][_0xad2b8e]['Imap']['id']]){delete this[_0x4fc4('0x10')][this[_0x4fc4('0xf')][_0xad2b8e][_0x4fc4('0x14')]['id']];}this[_0x4fc4('0xf')][_0xad2b8e][_0x4fc4('0x14')][_0x4fc4('0x2c')]=moment();this['emit'](_0xad2b8e);}};EmailChannel[_0x4fc4('0x12')][_0x4fc4('0x23')]=function(_0x2645df,_0x2baa68){if(this[_0x4fc4('0xf')][_0x2645df]){this[_0x4fc4('0xf')][_0x2645df][_0x4fc4('0x14')][_0x4fc4('0x15')]=_0x4fc4('0x22');this[_0x4fc4('0xf')][_0x2645df][_0x4fc4('0x14')]['messageStatus']=_0x2baa68;return this[_0x4fc4('0x1a')](_0x2645df);}};EmailChannel[_0x4fc4('0x12')][_0x4fc4('0x2d')]=function(_0x193139,_0x1c342c){return this[_0x4fc4('0x11')][_0x4fc4('0x2e')](_0x193139,_0x1c342c);};EmailChannel[_0x4fc4('0x12')][_0x4fc4('0x2f')]=function(_0x5e35b0){var _0x49c0a8=this;if(this[_0x4fc4('0xf')][_0x5e35b0['id']]){if(_[_0x4fc4('0x18')](this[_0x4fc4('0xf')][_0x5e35b0['id']][_0x4fc4('0x30')])){this[_0x4fc4('0xf')][_0x5e35b0['id']][_0x4fc4('0x30')]={};}this[_0x4fc4('0xf')][_0x5e35b0['id']][_0x4fc4('0x30')][_0x4fc4('0x2c')]=moment();return new BPromise(function(_0xa7e115,_0x42ecb8){return _0x49c0a8['smtp'][_0x4fc4('0x31')](_0x5e35b0)['then'](function(_0x192d6c){_0x49c0a8[_0x4fc4('0xf')][_0x5e35b0['id']][_0x4fc4('0x30')][_0x4fc4('0x15')]=_0x4fc4('0x32');_0x49c0a8[_0x4fc4('0xf')][_0x5e35b0['id']][_0x4fc4('0x30')]['messageStatus']='';_0x49c0a8[_0x4fc4('0x1a')](_0x5e35b0['id']);_0xa7e115(_0x192d6c);})['catch'](function(_0x18fe88){_0x49c0a8['mailAccounts'][_0x5e35b0['id']][_0x4fc4('0x30')][_0x4fc4('0x15')]='error';_0x49c0a8[_0x4fc4('0xf')][_0x5e35b0['id']][_0x4fc4('0x30')]['messageStatus']=_0x18fe88;_0x49c0a8['emit'](_0x5e35b0['id']);_0x42ecb8(_0x18fe88);});});}return this[_0x4fc4('0x11')]['verify'](_0x5e35b0);};module[_0x4fc4('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 160ac17..c31f32d 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 _0xb905=['body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','path','lodash','randomstring','mailparser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','imap','once','ready','bind','end','handleEnd','error','handleError','connect','inherits','getAccount','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','getHost','prototype','handleReady','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','message','handleFetchMessage','handleFetchEnd','closeBox'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0xb905,0x142));var _0x5b90=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xb905[_0x1035c1];return _0x308d67;};'use strict';var fs=require('fs');var path=require(_0x5b90('0x0'));var util=require('util');var Imap=require('imap');var _=require(_0x5b90('0x1'));var rs=require(_0x5b90('0x2'));var simpleParser=require(_0x5b90('0x3'))['simpleParser'];var Iconv=require(_0x5b90('0x4'))['Iconv'];var EventEmitter=require(_0x5b90('0x5'))[_0x5b90('0x6')];var utils=require(_0x5b90('0x7'));var logger=require(_0x5b90('0x8'))(_0x5b90('0x9'));function EmailImap(_0x106a3d,_0x7533e9){this[_0x5b90('0xa')]=_0x5b90('0xb');this[_0x5b90('0xc')]=this['getAccount'](_0x106a3d,_0x7533e9);this['imap']=new Imap(this['account']);this[_0x5b90('0xd')][_0x5b90('0xe')](_0x5b90('0xf'),this['handleReady'][_0x5b90('0x10')](this));this[_0x5b90('0xd')][_0x5b90('0xe')](_0x5b90('0x11'),this[_0x5b90('0x12')][_0x5b90('0x10')](this));this[_0x5b90('0xd')]['on'](_0x5b90('0x13'),this[_0x5b90('0x14')]['bind'](this));this[_0x5b90('0xd')][_0x5b90('0x15')]();}util[_0x5b90('0x16')](EmailImap,EventEmitter);EmailImap['prototype'][_0x5b90('0x17')]=function(_0x2e35e7,_0x26ac74){var _0x380f29={'connTimeout':_0x2e35e7[_0x5b90('0x18')]?_0x2e35e7[_0x5b90('0x18')]*0x3e8:0x2710,'authTimeout':_0x2e35e7[_0x5b90('0x19')]?_0x2e35e7[_0x5b90('0x19')]*0x3e8:0x1388};if(_[_0x5b90('0x1a')](_0x2e35e7[_0x5b90('0x1b')])){if(_0x2e35e7['authentication']){_0x380f29[_0x5b90('0x1c')]=_0x2e35e7[_0x5b90('0x1c')];_0x380f29[_0x5b90('0x1d')]=_0x2e35e7[_0x5b90('0x1d')];}_0x380f29['host']=_0x2e35e7[_0x5b90('0x1e')];_0x380f29[_0x5b90('0x1f')]=_0x2e35e7[_0x5b90('0x1f')]||0x3e1;if(_0x2e35e7['tls']){_0x380f29[_0x5b90('0x20')]=!![];}else{_0x380f29[_0x5b90('0x20')]=![];_0x380f29[_0x5b90('0x21')]='required';}}else{_0x380f29[_0x5b90('0x1c')]=_0x2e35e7['user'];_0x380f29['password']=_0x2e35e7[_0x5b90('0x1d')];_0x380f29[_0x5b90('0x1e')]=utils[_0x5b90('0x22')](_0x2e35e7[_0x5b90('0x1b')]);_0x380f29[_0x5b90('0x1f')]=0x3e1;_0x380f29[_0x5b90('0x20')]=!![];}_0x380f29[_0x5b90('0x9')]=_0x26ac74||_0x2e35e7[_0x5b90('0x1c')]||'anonymous@xcally.com';return _0x380f29;};EmailImap[_0x5b90('0x23')][_0x5b90('0x24')]=function(){this['imap'][_0x5b90('0x25')](this[_0x5b90('0xa')],![],this['handleOpenBox'][_0x5b90('0x10')](this));};EmailImap['prototype'][_0x5b90('0x26')]=function(_0x4e1c1f,_0x51d5da){if(_0x4e1c1f){this[_0x5b90('0x14')](_0x4e1c1f,!![]);}else{this[_0x5b90('0x27')](_0x5b90('0x28'),_0x51d5da);this[_0x5b90('0x29')]();}};EmailImap[_0x5b90('0x23')][_0x5b90('0x2a')]=function(_0x301852){if(_0x301852){this['handleError'](_0x301852,!![]);}else{this['imap'][_0x5b90('0x11')]();}};EmailImap[_0x5b90('0x23')][_0x5b90('0x29')]=function(){this[_0x5b90('0xd')][_0x5b90('0x2b')](['UNSEEN'],this[_0x5b90('0x2c')][_0x5b90('0x10')](this));};EmailImap[_0x5b90('0x23')][_0x5b90('0x2c')]=function(_0xaa1c6f,_0x535cf0){if(_0xaa1c6f){this[_0x5b90('0x14')](_0xaa1c6f,!![]);}else{if(_0x535cf0[_0x5b90('0x2d')]){try{var _0x23f93d=this['imap']['fetch'](_0x535cf0,{'bodies':'','markSeen':!![]});_0x23f93d['on'](_0x5b90('0x2e'),this[_0x5b90('0x2f')]['bind'](this));_0x23f93d[_0x5b90('0xe')]('error',this['handleFetchError'][_0x5b90('0x10')](this));_0x23f93d[_0x5b90('0xe')](_0x5b90('0x11'),this[_0x5b90('0x30')][_0x5b90('0x10')](this));}catch(_0x409563){logger[_0x5b90('0x13')](_0x409563);}}else{this['imap'][_0x5b90('0x31')](!![],this[_0x5b90('0x2a')]['bind'](this));}}};EmailImap['prototype'][_0x5b90('0x2f')]=function(_0x337c06,_0x2bfef2){_0x337c06['on'](_0x5b90('0x32'),this[_0x5b90('0x33')][_0x5b90('0x10')](this));_0x337c06[_0x5b90('0xe')]('attributes',this[_0x5b90('0x34')][_0x5b90('0x10')](this));_0x337c06['once'](_0x5b90('0x11'),this[_0x5b90('0x35')]['bind'](this));};EmailImap[_0x5b90('0x23')][_0x5b90('0x33')]=function(_0x5abe92,_0x46d7c1){simpleParser(_0x5abe92,{'Iconv':Iconv},this[_0x5b90('0x36')][_0x5b90('0x10')](this));};EmailImap['prototype'][_0x5b90('0x34')]=function(_0x5f0da1){};EmailImap[_0x5b90('0x23')][_0x5b90('0x35')]=function(){};EmailImap[_0x5b90('0x23')][_0x5b90('0x36')]=function(_0x150538,_0x40216c){if(_0x150538){logger['error'](_0x150538);}else{var _0x2fc2a5=this;utils[_0x5b90('0x37')](this['account'],_0x40216c,function(_0x623375){_0x2fc2a5[_0x5b90('0x27')]('email',_0x623375);});}};EmailImap[_0x5b90('0x23')][_0x5b90('0x30')]=function(){this['imap'][_0x5b90('0x31')](!![],this[_0x5b90('0x2a')][_0x5b90('0x10')](this));};EmailImap[_0x5b90('0x23')][_0x5b90('0x38')]=function(_0x1ea4ae){this['handleError'](_0x1ea4ae);this['imap'][_0x5b90('0x31')](!![],this[_0x5b90('0x2a')]['bind'](this));};EmailImap[_0x5b90('0x23')][_0x5b90('0x12')]=function(){this[_0x5b90('0x27')](_0x5b90('0x11'));};EmailImap[_0x5b90('0x23')][_0x5b90('0x14')]=function(_0x5a8f1d,_0x5f0bdc){logger['error'](_0x5b90('0x14'),this[_0x5b90('0xc')][_0x5b90('0x9')],JSON[_0x5b90('0x39')](_0x5a8f1d));var _0x2891a3='';if(_0x5a8f1d){if(_0x5a8f1d['textCode']){_0x2891a3=_0x5a8f1d[_0x5b90('0x3a')];}else{for(var _0x2cd470 in _0x5a8f1d){if(_0x5a8f1d[_0x5b90('0x3b')](_0x2cd470)){_0x2891a3+=_[_0x5b90('0x3c')](_0x2cd470)+':\x20'+_0x5a8f1d[_0x2cd470]+'\x0a';}}}}if(_0x5f0bdc){this['imap'][_0x5b90('0x11')]();}else{this['emit']('error',_0x2891a3);this[_0x5b90('0x27')](_0x5b90('0x11'));}};module[_0x5b90('0x3d')]=EmailImap; \ No newline at end of file +var _0x4dd9=['simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','once','ready','handleReady','end','bind','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','handleEnd','error','stringify','textCode','hasOwnProperty','upperFirst','exports','util','imap','randomstring'];(function(_0x414b50,_0x1f3d1c){var _0x21ece9=function(_0x2d719d){while(--_0x2d719d){_0x414b50['push'](_0x414b50['shift']());}};_0x21ece9(++_0x1f3d1c);}(_0x4dd9,0x1a8));var _0x94dd=function(_0xed5f9c,_0x5a25cd){_0xed5f9c=_0xed5f9c-0x0;var _0x3a1c43=_0x4dd9[_0xed5f9c];return _0x3a1c43;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x94dd('0x0'));var Imap=require(_0x94dd('0x1'));var _=require('lodash');var rs=require(_0x94dd('0x2'));var simpleParser=require('mailparser')[_0x94dd('0x3')];var Iconv=require(_0x94dd('0x4'))[_0x94dd('0x5')];var EventEmitter=require(_0x94dd('0x6'))[_0x94dd('0x7')];var utils=require(_0x94dd('0x8'));var logger=require(_0x94dd('0x9'))(_0x94dd('0xa'));function EmailImap(_0x262d40,_0x5b7f0b){this[_0x94dd('0xb')]='INBOX';this[_0x94dd('0xc')]=this['getAccount'](_0x262d40,_0x5b7f0b);this['imap']=new Imap(this[_0x94dd('0xc')]);this[_0x94dd('0x1')][_0x94dd('0xd')](_0x94dd('0xe'),this[_0x94dd('0xf')]['bind'](this));this[_0x94dd('0x1')][_0x94dd('0xd')](_0x94dd('0x10'),this['handleEnd'][_0x94dd('0x11')](this));this['imap']['on']('error',this[_0x94dd('0x12')][_0x94dd('0x11')](this));this[_0x94dd('0x1')][_0x94dd('0x13')]();}util[_0x94dd('0x14')](EmailImap,EventEmitter);EmailImap[_0x94dd('0x15')][_0x94dd('0x16')]=function(_0x93a227,_0x31a205){var _0x491634={'connTimeout':_0x93a227[_0x94dd('0x17')]?_0x93a227[_0x94dd('0x17')]*0x3e8:0x2710,'authTimeout':_0x93a227[_0x94dd('0x18')]?_0x93a227[_0x94dd('0x18')]*0x3e8:0x1388};if(_[_0x94dd('0x19')](_0x93a227[_0x94dd('0x1a')])){if(_0x93a227[_0x94dd('0x1b')]){_0x491634[_0x94dd('0x1c')]=_0x93a227[_0x94dd('0x1c')];_0x491634[_0x94dd('0x1d')]=_0x93a227['password'];}_0x491634[_0x94dd('0x1e')]=_0x93a227[_0x94dd('0x1e')];_0x491634[_0x94dd('0x1f')]=_0x93a227[_0x94dd('0x1f')]||0x3e1;if(_0x93a227[_0x94dd('0x20')]){_0x491634[_0x94dd('0x20')]=!![];}else{_0x491634['tls']=![];_0x491634['autotls']=_0x94dd('0x21');}}else{_0x491634[_0x94dd('0x1c')]=_0x93a227['user'];_0x491634[_0x94dd('0x1d')]=_0x93a227['password'];_0x491634[_0x94dd('0x1e')]=utils[_0x94dd('0x22')](_0x93a227[_0x94dd('0x1a')]);_0x491634[_0x94dd('0x1f')]=0x3e1;_0x491634[_0x94dd('0x20')]=!![];}_0x491634[_0x94dd('0xa')]=_0x31a205||_0x93a227[_0x94dd('0x1c')]||_0x94dd('0x23');return _0x491634;};EmailImap[_0x94dd('0x15')][_0x94dd('0xf')]=function(){this['imap'][_0x94dd('0x24')](this[_0x94dd('0xb')],![],this[_0x94dd('0x25')][_0x94dd('0x11')](this));};EmailImap['prototype'][_0x94dd('0x25')]=function(_0x23c932,_0x2ec9c7){if(_0x23c932){this['handleError'](_0x23c932,!![]);}else{this[_0x94dd('0x26')]('box',_0x2ec9c7);this[_0x94dd('0x27')]();}};EmailImap['prototype'][_0x94dd('0x28')]=function(_0x117d5b){if(_0x117d5b){this['handleError'](_0x117d5b,!![]);}else{this['imap']['end']();}};EmailImap[_0x94dd('0x15')][_0x94dd('0x27')]=function(){this[_0x94dd('0x1')]['search']([_0x94dd('0x29')],this['handleReadUnseen'][_0x94dd('0x11')](this));};EmailImap[_0x94dd('0x15')][_0x94dd('0x2a')]=function(_0x4a32b2,_0x5e973b){if(_0x4a32b2){this[_0x94dd('0x12')](_0x4a32b2,!![]);}else{if(_0x5e973b[_0x94dd('0x2b')]){try{var _0x3c1a8e=this['imap']['fetch'](_0x5e973b,{'bodies':'','markSeen':!![]});_0x3c1a8e['on'](_0x94dd('0x2c'),this[_0x94dd('0x2d')][_0x94dd('0x11')](this));_0x3c1a8e[_0x94dd('0xd')]('error',this[_0x94dd('0x2e')][_0x94dd('0x11')](this));_0x3c1a8e[_0x94dd('0xd')]('end',this[_0x94dd('0x2f')][_0x94dd('0x11')](this));}catch(_0x31d713){logger['error'](_0x31d713);}}else{this[_0x94dd('0x1')]['closeBox'](!![],this['handleCloseBox']['bind'](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x2cf869,_0xc8490e){_0x2cf869['on']('body',this[_0x94dd('0x30')][_0x94dd('0x11')](this));_0x2cf869['once']('attributes',this[_0x94dd('0x31')][_0x94dd('0x11')](this));_0x2cf869['once'](_0x94dd('0x10'),this[_0x94dd('0x32')][_0x94dd('0x11')](this));};EmailImap['prototype'][_0x94dd('0x30')]=function(_0x1f88e4,_0x218e06){simpleParser(_0x1f88e4,{'Iconv':Iconv},this[_0x94dd('0x33')]['bind'](this));};EmailImap['prototype'][_0x94dd('0x31')]=function(_0x16f68){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0x94dd('0x15')][_0x94dd('0x33')]=function(_0x203859,_0x5bbc68){if(_0x203859){logger['error'](_0x203859);}else{var _0x6b3ac2=this;utils[_0x94dd('0x34')](this['account'],_0x5bbc68,function(_0x25c720){_0x6b3ac2[_0x94dd('0x26')](_0x94dd('0xa'),_0x25c720);});}};EmailImap[_0x94dd('0x15')]['handleFetchEnd']=function(){this[_0x94dd('0x1')][_0x94dd('0x35')](!![],this[_0x94dd('0x28')][_0x94dd('0x11')](this));};EmailImap[_0x94dd('0x15')][_0x94dd('0x2e')]=function(_0x14291b){this[_0x94dd('0x12')](_0x14291b);this[_0x94dd('0x1')][_0x94dd('0x35')](!![],this[_0x94dd('0x28')]['bind'](this));};EmailImap[_0x94dd('0x15')][_0x94dd('0x36')]=function(){this['emit']('end');};EmailImap[_0x94dd('0x15')][_0x94dd('0x12')]=function(_0x4af93c,_0x401e28){logger[_0x94dd('0x37')]('handleError',this[_0x94dd('0xc')]['email'],JSON[_0x94dd('0x38')](_0x4af93c));var _0x66853e='';if(_0x4af93c){if(_0x4af93c[_0x94dd('0x39')]){_0x66853e=_0x4af93c[_0x94dd('0x39')];}else{for(var _0x1821e6 in _0x4af93c){if(_0x4af93c[_0x94dd('0x3a')](_0x1821e6)){_0x66853e+=_[_0x94dd('0x3b')](_0x1821e6)+':\x20'+_0x4af93c[_0x1821e6]+'\x0a';}}}}if(_0x401e28){this['imap'][_0x94dd('0x10')]();}else{this['emit'](_0x94dd('0x37'),_0x66853e);this['emit'](_0x94dd('0x10'));}};module[_0x94dd('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 32017ae..6de78df 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 _0xc7da=['prototype','createTransport','use','sendMail','toString','verify','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc7da,0xd6));var _0xac7d=function(_0x11bb79,_0x37f0ab){_0x11bb79=_0x11bb79-0x0;var _0x37d551=_0xc7da[_0x11bb79];return _0x37d551;};'use strict';var nodemailer=require(_0xac7d('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xac7d('0x1'));function EmailSmtp(){}EmailSmtp[_0xac7d('0x2')]['send']=function(_0x2360dc,_0x4a1499){return new BPromise(function(_0x25130e,_0x129aee){var _0x53c747=nodemailer[_0xac7d('0x3')](_0x2360dc);_0x53c747[_0xac7d('0x4')]('compile',inlineBase64());_0x53c747[_0xac7d('0x5')](_0x4a1499,function(_0x241017,_0x26c394){if(_0x241017){_0x129aee(_0x241017[_0xac7d('0x6')]());}else{_0x25130e(_0x26c394);}});});};EmailSmtp[_0xac7d('0x2')][_0xac7d('0x7')]=function(_0x4757da){return new BPromise(function(_0x30926a,_0x267711){var _0x424420=nodemailer['createTransport'](_0x4757da);_0x424420['verify'](function(_0x4d53fc,_0x2b98ba){if(_0x4d53fc){_0x267711(_0x4d53fc[_0xac7d('0x6')]());}else{if(_0x2b98ba){_0x30926a(_0x2b98ba);}else{_0x267711('Not\x20verifired');}}});});};module[_0xac7d('0x8')]=EmailSmtp; \ No newline at end of file +var _0x7a50=['compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a50,0x158));var _0x07a5=function(_0x5483f7,_0x61e068){_0x5483f7=_0x5483f7-0x0;var _0x48065c=_0x7a50[_0x5483f7];return _0x48065c;};'use strict';var nodemailer=require(_0x07a5('0x0'));var BPromise=require(_0x07a5('0x1'));var inlineBase64=require(_0x07a5('0x2'));function EmailSmtp(){}EmailSmtp[_0x07a5('0x3')][_0x07a5('0x4')]=function(_0xedf050,_0x4ebb35){return new BPromise(function(_0x24b0e3,_0x56b2d2){var _0x53c9ac=nodemailer[_0x07a5('0x5')](_0xedf050);_0x53c9ac[_0x07a5('0x6')](_0x07a5('0x7'),inlineBase64());_0x53c9ac[_0x07a5('0x8')](_0x4ebb35,function(_0x1ca36c,_0x4a33d9){if(_0x1ca36c){_0x56b2d2(_0x1ca36c[_0x07a5('0x9')]());}else{_0x24b0e3(_0x4a33d9);}});});};EmailSmtp['prototype'][_0x07a5('0xa')]=function(_0x63e794){return new BPromise(function(_0x5be63e,_0x53fdaf){var _0x3062c2=nodemailer['createTransport'](_0x63e794);_0x3062c2[_0x07a5('0xa')](function(_0x46d622,_0x32b049){if(_0x46d622){_0x53fdaf(_0x46d622[_0x07a5('0x9')]());}else{if(_0x32b049){_0x5be63e(_0x32b049);}else{_0x53fdaf(_0x07a5('0xb'));}}});});};module[_0x07a5('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 c79fa13..6ab168e 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 _0xe728=['YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','info','parseBuffer','first','BodyHTML','Attachments','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','path','util','../../../config/logger','email','address','anonymous','@xcally.com','value','name','split','slice','Anonymous','pop','length','generate','html','test','replace','body','originTo','isEmpty','message','originCc','includes','attachments','type','attachment','attachment-','format','%s-%s','now','join','server/files/attachments/','writeFileSync','content','push','contentType','parser','from','subject','inReplyTo','date'];(function(_0x29ecbc,_0x2929d9){var _0x5709b0=function(_0x277721){while(--_0x277721){_0x29ecbc['push'](_0x29ecbc['shift']());}};_0x5709b0(++_0x2929d9);}(_0xe728,0x13e));var _0x8e72=function(_0x29aa2f,_0x9add6d){_0x29aa2f=_0x29aa2f-0x0;var _0x5b347a=_0xe728[_0x29aa2f];return _0x5b347a;};'use strict';var _=require('lodash');var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0x8e72('0x0'));var util=require(_0x8e72('0x1'));var tnef=require('node-tnef');var logger=require(_0x8e72('0x2'))(_0x8e72('0x3'));var config=require('../../../config/environment');function getAddress(_0xc2964e){var _0x1708ec=_['head'](_0xc2964e['value']);return _0x1708ec&&_0x1708ec[_0x8e72('0x4')]?_0x1708ec[_0x8e72('0x4')]:_0x8e72('0x5')+random['generate'](0x6)+_0x8e72('0x6');}function getFirstName(_0x5107d2){var _0x58252f=_['head'](_0x5107d2[_0x8e72('0x7')]);if(_0x58252f&&_0x58252f[_0x8e72('0x8')]){var _0x491d44=_0x58252f[_0x8e72('0x8')][_0x8e72('0x9')](/\s+/);return _0x491d44['length']?_0x491d44[_0x8e72('0xa')](0x0,-0x1)['join']('\x20'):_0x58252f[_0x8e72('0x8')];}return _0x8e72('0xb');}function getLastName(_0x4fd2f1){var _0x444f57=_['head'](_0x4fd2f1[_0x8e72('0x7')]);if(_0x444f57&&_0x444f57[_0x8e72('0x8')]){var _0x442a05=_0x444f57['name']['split'](/\s+/);return _0x442a05['length']>0x1?_0x442a05[_0x8e72('0xc')]():'';}return'';}function getMails(_0x4e7aca,_0x575ee5){var _0x5b2ddc='';for(var _0xbc69d7=0x0;_0xbc69d7<_0x575ee5[_0x8e72('0x7')][_0x8e72('0xd')];_0xbc69d7+=0x1){if(_0x575ee5[_0x8e72('0x7')][_0xbc69d7][_0x8e72('0x4')]!==_0x4e7aca){if(!_['isEmpty'](_0x5b2ddc)){_0x5b2ddc+=',';}_0x5b2ddc+=_0x575ee5[_0x8e72('0x7')][_0xbc69d7][_0x8e72('0x8')]||_0x575ee5[_0x8e72('0x7')][_0xbc69d7][_0x8e72('0x4')]||'';_0x5b2ddc+='\x20<';_0x5b2ddc+=_0x575ee5[_0x8e72('0x7')][_0xbc69d7][_0x8e72('0x4')]?_0x575ee5[_0x8e72('0x7')][_0xbc69d7][_0x8e72('0x4')]:_0x8e72('0x5')+random[_0x8e72('0xe')](0x6)+_0x8e72('0x6');_0x5b2ddc+='>';}}return _0x5b2ddc;}function parseEmail(_0x47c9b2,_0x514cd6,_0x36523d){if(_0x514cd6[_0x8e72('0xf')]){var _0x59ef50=/)<[^<]*)*<\/script>/gi;while(_0x59ef50[_0x8e72('0x10')](_0x514cd6[_0x8e72('0xf')])){_0x514cd6[_0x8e72('0xf')]=_0x514cd6[_0x8e72('0xf')][_0x8e72('0x11')](_0x59ef50,'');}_0x36523d[_0x8e72('0x12')]=_0x514cd6['html'];}else{_0x36523d[_0x8e72('0x12')]=_0x514cd6['textAsHtml'];}if(_0x36523d[_0x8e72('0x12')]){_0x36523d['body']=_0x36523d['body'][_0x8e72('0x11')](/Empty\x20message

';if(_0x3384ca['Attachments']){for(var _0x445872=0x0;_0x445872<_0x3384ca[_0x8e72('0x32')][_0x8e72('0xd')];_0x445872++){var _0x4e0ba3=_0x3384ca[_0x8e72('0x32')][_0x445872];_0x141ef5[_0x8e72('0x15')][_0x8e72('0x18')][_0x8e72('0x23')]({'filename':_0x4e0ba3['Title'],'content':new Buffer(_0x4e0ba3[_0x8e72('0x33')])});}}}_0x36e9de(parseEmail(_0x275578,_0x576e11,_0x141ef5));});}else{_0x576e11[_0x8e72('0xf')]='

Empty\x20message

';_0x36e9de(parseEmail(_0x275578,_0x576e11,_0x141ef5));}}else{_0x36e9de(parseEmail(_0x275578,_0x576e11,_0x141ef5));}};exports[_0x8e72('0x34')]=function(_0x2a89c8){switch(_0x2a89c8){case _0x8e72('0x35'):return'imap.gmail.com';case _0x8e72('0x36'):return _0x8e72('0x37');case _0x8e72('0x38'):return _0x8e72('0x39');case _0x8e72('0x3a'):return _0x8e72('0x3b');}return'127.0.0.1';}; \ No newline at end of file +var _0x090d=['Data','getHost','gmail','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','email','../../../config/environment','head','value','address','generate','@xcally.com','name','split','join','Anonymous','length','isEmpty','anonymous','html','replace','body','textAsHtml','message','originTo','originCc','includes','bcc','attachments','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','push','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','content','BodyHTML','

Empty\x20message

','Attachments','Title'];(function(_0x71689e,_0x3a49f1){var _0x2c4c81=function(_0x306f36){while(--_0x306f36){_0x71689e['push'](_0x71689e['shift']());}};_0x2c4c81(++_0x3a49f1);}(_0x090d,0xc3));var _0xd090=function(_0x490f7f,_0x2ed5ff){_0x490f7f=_0x490f7f-0x0;var _0x1a9042=_0x090d[_0x490f7f];return _0x1a9042;};'use strict';var _=require(_0xd090('0x0'));var moment=require(_0xd090('0x1'));var random=require(_0xd090('0x2'));var fs=require('fs');var path=require(_0xd090('0x3'));var util=require(_0xd090('0x4'));var tnef=require(_0xd090('0x5'));var logger=require('../../../config/logger')(_0xd090('0x6'));var config=require(_0xd090('0x7'));function getAddress(_0x6e99cf){var _0x4bcc22=_[_0xd090('0x8')](_0x6e99cf[_0xd090('0x9')]);return _0x4bcc22&&_0x4bcc22[_0xd090('0xa')]?_0x4bcc22['address']:'anonymous'+random[_0xd090('0xb')](0x6)+_0xd090('0xc');}function getFirstName(_0x3c8c69){var _0x35311a=_['head'](_0x3c8c69[_0xd090('0x9')]);if(_0x35311a&&_0x35311a['name']){var _0x53c4b4=_0x35311a[_0xd090('0xd')][_0xd090('0xe')](/\s+/);return _0x53c4b4['length']?_0x53c4b4['slice'](0x0,-0x1)[_0xd090('0xf')]('\x20'):_0x35311a[_0xd090('0xd')];}return _0xd090('0x10');}function getLastName(_0x57b49d){var _0x1e3501=_[_0xd090('0x8')](_0x57b49d[_0xd090('0x9')]);if(_0x1e3501&&_0x1e3501[_0xd090('0xd')]){var _0x493384=_0x1e3501[_0xd090('0xd')]['split'](/\s+/);return _0x493384[_0xd090('0x11')]>0x1?_0x493384['pop']():'';}return'';}function getMails(_0x5bd1f7,_0x3288dd){var _0x4e25f5='';for(var _0x1a4f75=0x0;_0x1a4f75<_0x3288dd[_0xd090('0x9')][_0xd090('0x11')];_0x1a4f75+=0x1){if(_0x3288dd[_0xd090('0x9')][_0x1a4f75]['address']!==_0x5bd1f7){if(!_[_0xd090('0x12')](_0x4e25f5)){_0x4e25f5+=',';}_0x4e25f5+=_0x3288dd['value'][_0x1a4f75][_0xd090('0xd')]||_0x3288dd[_0xd090('0x9')][_0x1a4f75][_0xd090('0xa')]||'';_0x4e25f5+='\x20<';_0x4e25f5+=_0x3288dd[_0xd090('0x9')][_0x1a4f75]['address']?_0x3288dd[_0xd090('0x9')][_0x1a4f75][_0xd090('0xa')]:_0xd090('0x13')+random['generate'](0x6)+'@xcally.com';_0x4e25f5+='>';}}return _0x4e25f5;}function parseEmail(_0x30e069,_0x158519,_0x1c8957){if(_0x158519[_0xd090('0x14')]){var _0x23ac71=/)<[^<]*)*<\/script>/gi;while(_0x23ac71['test'](_0x158519[_0xd090('0x14')])){_0x158519[_0xd090('0x14')]=_0x158519[_0xd090('0x14')][_0xd090('0x15')](_0x23ac71,'');}_0x1c8957[_0xd090('0x16')]=_0x158519[_0xd090('0x14')];}else{_0x1c8957['body']=_0x158519[_0xd090('0x17')];}if(_0x1c8957[_0xd090('0x16')]){_0x1c8957['body']=_0x1c8957[_0xd090('0x16')][_0xd090('0x15')](/0x0){if(this[_0x41a823+_0x42e5('0x25')]>0x0&&this[_0x41a823+_0x42e5('0x24')]>=this[_0x41a823+_0x42e5('0x25')]){return _0x42e5('0x26');}else{return _0x42e5('0x27');}}else{return'idle';}};Agent['prototype'][_0x42e5('0x22')]=function(){var _0x52d319=[_0x42e5('0x28'),_0x42e5('0x29'),_0x42e5('0x2a'),_0x42e5('0x2b'),_0x42e5('0x2c')];for(var _0x5d6b24=0x0;_0x5d6b24<_0x52d319[_0x42e5('0x2d')];_0x5d6b24+=0x1){var _0xf29221=this[_0x42e5('0x2e')](_0x52d319[_0x5d6b24]);if(this[_0x52d319[_0x5d6b24]+_0x42e5('0x2f')]!==_0xf29221){this[_0x52d319[_0x5d6b24]+_0x42e5('0x30')]=_['toNumber'](moment()['format']('x'));}this[_0x52d319[_0x5d6b24]+_0x42e5('0x2f')]=_0xf29221;}var _0x534a26={'id':this['id'],'name':this['name'],'online':this[_0x42e5('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0x42e5('0xa')],'mailPause':this[_0x42e5('0xb')],'smsPause':this[_0x42e5('0xd')],'faxPause':this[_0x42e5('0xc')],'openchannelPause':this[_0x42e5('0xe')],'chatStatus':this[_0x42e5('0x31')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x42e5('0x11')],'chatCurrentCapacity':this[_0x42e5('0x12')],'mailStatus':this[_0x42e5('0x13')],'mailStatusTime':this[_0x42e5('0x14')],'mailCapacity':this[_0x42e5('0x15')],'mailCurrentCapacity':this[_0x42e5('0x16')],'faxStatus':this[_0x42e5('0x17')],'faxStatusTime':this[_0x42e5('0x32')],'faxCapacity':this[_0x42e5('0x18')],'faxCurrentCapacity':this[_0x42e5('0x19')],'smsStatus':this[_0x42e5('0x1a')],'smsStatusTime':this[_0x42e5('0x1b')],'smsCapacity':this[_0x42e5('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this[_0x42e5('0x1e')],'openchannelStatusTime':this[_0x42e5('0x1f')],'openchannelCapacity':this[_0x42e5('0x20')],'openchannelCurrentCapacity':this[_0x42e5('0x33')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x21d933=md5(JSON['stringify'](_0x534a26));if(this[_0x42e5('0x34')]!==_0x21d933){this['md5']=_0x21d933;io[_0x42e5('0x35')](_0x42e5('0x36'),_0x534a26);}};module[_0x42e5('0x37')]=Agent; \ No newline at end of file +var _0xb49a=['chat','openchannel','fax','StatusTime','toNumber','faxStatusTime','smsStatusTime','openchannelStatusTime','stringify','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','updateRealtime','getChannelStatus','Capacity','maxcapacity','prototype'];(function(_0x2523b8,_0x15556c){var _0x5cb209=function(_0x5ba704){while(--_0x5ba704){_0x2523b8['push'](_0x2523b8['shift']());}};_0x5cb209(++_0x15556c);}(_0xb49a,0xfb));var _0xab49=function(_0x530455,_0x41da2d){_0x530455=_0x530455-0x0;var _0x128a27=_0xb49a[_0x530455];return _0x128a27;};'use strict';var _=require(_0xab49('0x0'));var moment=require(_0xab49('0x1'));var md5=require(_0xab49('0x2'));var Redis=require(_0xab49('0x3'));var config=require(_0xab49('0x4'));config['redis']=_[_0xab49('0x5')](config[_0xab49('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xab49('0x6')]));function Agent(_0x287cd5){this['id']=_0x287cd5['id']||0x0;this[_0xab49('0x7')]=_0x287cd5[_0xab49('0x7')]||'';this[_0xab49('0x8')]=_0x287cd5[_0xab49('0x8')]||!![];this[_0xab49('0x9')]=_0x287cd5['voicePause']||![];this[_0xab49('0xa')]=_0x287cd5[_0xab49('0xa')]||![];this[_0xab49('0xb')]=_0x287cd5[_0xab49('0xb')]||![];this[_0xab49('0xc')]=_0x287cd5['faxPause']||![];this['smsPause']=_0x287cd5[_0xab49('0xd')]||![];this[_0xab49('0xe')]=_0x287cd5[_0xab49('0xe')]||![];this[_0xab49('0xf')]=_0xab49('0x10');this['chatStatusTime']=0x0;this[_0xab49('0x11')]=_0x287cd5[_0xab49('0x11')]||0x0;this[_0xab49('0x12')]=0x0;this[_0xab49('0x13')]=_0xab49('0x10');this[_0xab49('0x14')]=0x0;this[_0xab49('0x15')]=_0x287cd5[_0xab49('0x15')]||0x0;this[_0xab49('0x16')]=0x0;this[_0xab49('0x17')]=_0xab49('0x10');this['faxStatusTime']=0x0;this[_0xab49('0x18')]=_0x287cd5[_0xab49('0x18')]||0x0;this[_0xab49('0x19')]=0x0;this[_0xab49('0x1a')]=_0xab49('0x10');this['smsStatusTime']=0x0;this[_0xab49('0x1b')]=_0x287cd5[_0xab49('0x1b')]||0x0;this[_0xab49('0x1c')]=0x0;this[_0xab49('0x1d')]=_0xab49('0x10');this['openchannelStatusTime']=0x0;this[_0xab49('0x1e')]=_0x287cd5[_0xab49('0x1e')]||0x0;this[_0xab49('0x1f')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0xab49('0x2')]='';this[_0xab49('0x20')]();}Agent['prototype'][_0xab49('0x21')]=function(_0x33d7bd){if(this[_0x33d7bd+'CurrentCapacity']>0x0){if(this[_0x33d7bd+_0xab49('0x22')]>0x0&&this[_0x33d7bd+'CurrentCapacity']>=this[_0x33d7bd+_0xab49('0x22')]){return _0xab49('0x23');}else{return'working';}}else{return'idle';}};Agent[_0xab49('0x24')]['updateRealtime']=function(){var _0x32a1d1=['mail',_0xab49('0x25'),_0xab49('0x26'),_0xab49('0x27'),'sms'];for(var _0x2bf8e0=0x0;_0x2bf8e0<_0x32a1d1['length'];_0x2bf8e0+=0x1){var _0x322153=this[_0xab49('0x21')](_0x32a1d1[_0x2bf8e0]);if(this[_0x32a1d1[_0x2bf8e0]+'Status']!==_0x322153){this[_0x32a1d1[_0x2bf8e0]+_0xab49('0x28')]=_[_0xab49('0x29')](moment()['format']('x'));}this[_0x32a1d1[_0x2bf8e0]+'Status']=_0x322153;}var _0x11446b={'id':this['id'],'name':this[_0xab49('0x7')],'online':this[_0xab49('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0xab49('0xa')],'mailPause':this[_0xab49('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0xab49('0xc')],'openchannelPause':this[_0xab49('0xe')],'chatStatus':this[_0xab49('0xf')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xab49('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xab49('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xab49('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xab49('0x17')],'faxStatusTime':this[_0xab49('0x2a')],'faxCapacity':this[_0xab49('0x18')],'faxCurrentCapacity':this[_0xab49('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xab49('0x2b')],'smsCapacity':this[_0xab49('0x1b')],'smsCurrentCapacity':this[_0xab49('0x1c')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xab49('0x2c')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xab49('0x1f')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x553867=md5(JSON[_0xab49('0x2d')](_0x11446b));if(this['md5']!==_0x553867){this[_0xab49('0x2')]=_0x553867;io[_0xab49('0x2e')](_0xab49('0x2f'),_0x11446b);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 24d7e72..e1de0b1 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 _0x0f3d=['chatPause','paused','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online'];(function(_0x288438,_0x319570){var _0x19c7ba=function(_0x29b0e5){while(--_0x29b0e5){_0x288438['push'](_0x288438['shift']());}};_0x19c7ba(++_0x319570);}(_0x0f3d,0xea));var _0xd0f3=function(_0x42a4e6,_0x3637ae){_0x42a4e6=_0x42a4e6-0x0;var _0x539cb1=_0x0f3d[_0x42a4e6];return _0x539cb1;};'use strict';var _=require(_0xd0f3('0x0'));var md5=require(_0xd0f3('0x1'));var util=require(_0xd0f3('0x2'));var Redis=require(_0xd0f3('0x3'));var config=require(_0xd0f3('0x4'));config['redis']=_[_0xd0f3('0x5')](config[_0xd0f3('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd0f3('0x7'))(new Redis(config[_0xd0f3('0x6')]));function ChatQueue(_0x26f374){this['id']=_0x26f374['id']||0x0;this[_0xd0f3('0x8')]=_0x26f374[_0xd0f3('0x8')]||'';this[_0xd0f3('0x9')]=_0x26f374[_0xd0f3('0x9')]||0xa;this[_0xd0f3('0xa')]=_0x26f374['strategy']||_0xd0f3('0xb');this[_0xd0f3('0xc')]=_0x26f374[_0xd0f3('0xc')];this[_0xd0f3('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0xd0f3('0xe')]();this[_0xd0f3('0xf')]();}ChatQueue[_0xd0f3('0x10')][_0xd0f3('0xe')]=function(){var _0x5eb7f4=this[_0xd0f3('0xd')][_0xd0f3('0x11')];this['mapAgentsId']=_[_0xd0f3('0x12')](this['Agents'],'id');this[_0xd0f3('0xd')][_0xd0f3('0x11')]=_0x5eb7f4;};ChatQueue[_0xd0f3('0x10')][_0xd0f3('0xf')]=function(){this[_0xd0f3('0x13')]=0x0;this['paused']=0x0;for(var _0x3ccefb=0x0;_0x3ccefb=0x0?this[_0xd0f3('0x18')]:0x0;var _0x3a1680={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd0f3('0x13')],'name':this['name'],'paused':this[_0xd0f3('0x17')],'waiting':this[_0xd0f3('0x19')]};var _0x184d31=md5(JSON[_0xd0f3('0x1a')](_0x3a1680));if(this[_0xd0f3('0x1')]!==_0x184d31){this[_0xd0f3('0x1')]=_0x184d31;io['to'](util[_0xd0f3('0x1b')](_0xd0f3('0x1c'),_0x3a1680[_0xd0f3('0x8')]))[_0xd0f3('0x1d')](_0xd0f3('0x1e'),_0x3a1680);}};module[_0xd0f3('0x1f')]=ChatQueue; \ No newline at end of file +var _0xf505=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','chatPause','paused','available','stringify','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x21d742,_0x10f6cc){var _0x522720=function(_0x9a876e){while(--_0x9a876e){_0x21d742['push'](_0x21d742['shift']());}};_0x522720(++_0x10f6cc);}(_0xf505,0x9b));var _0x5f50=function(_0x1dd2cc,_0x36ddfe){_0x1dd2cc=_0x1dd2cc-0x0;var _0x305d8e=_0xf505[_0x1dd2cc];return _0x305d8e;};'use strict';var _=require(_0x5f50('0x0'));var md5=require(_0x5f50('0x1'));var util=require(_0x5f50('0x2'));var Redis=require(_0x5f50('0x3'));var config=require(_0x5f50('0x4'));config[_0x5f50('0x5')]=_[_0x5f50('0x6')](config['redis'],{'host':_0x5f50('0x7'),'port':0x18eb});var io=require(_0x5f50('0x8'))(new Redis(config[_0x5f50('0x5')]));function ChatQueue(_0x520c51){this['id']=_0x520c51['id']||0x0;this[_0x5f50('0x9')]=_0x520c51[_0x5f50('0x9')]||'';this[_0x5f50('0xa')]=_0x520c51[_0x5f50('0xa')]||0xa;this[_0x5f50('0xb')]=_0x520c51[_0x5f50('0xb')]||_0x5f50('0xc');this['Agents']=_0x520c51[_0x5f50('0xd')];this['mapAgentsId']={};this[_0x5f50('0xe')]=0x0;this['md5']='';this[_0x5f50('0xf')]();this[_0x5f50('0x10')]();}ChatQueue[_0x5f50('0x11')][_0x5f50('0xf')]=function(){var _0x29661f=this[_0x5f50('0x12')][_0x5f50('0x13')];this['mapAgentsId']=_[_0x5f50('0x14')](this['Agents'],'id');this['mapAgentsId'][_0x5f50('0x13')]=_0x29661f;};ChatQueue['prototype'][_0x5f50('0x10')]=function(){this[_0x5f50('0x15')]=0x0;this['paused']=0x0;for(var _0x1d1654=0x0;_0x1d1654=0x0?this[_0x5f50('0x1a')]:0x0;var _0x1bd046={'id':this['id'],'available':this[_0x5f50('0x1a')],'loggedIn':this[_0x5f50('0x15')],'name':this['name'],'paused':this[_0x5f50('0x19')],'waiting':this[_0x5f50('0xe')]};var _0x3e0d4b=md5(JSON[_0x5f50('0x1b')](_0x1bd046));if(this[_0x5f50('0x1')]!==_0x3e0d4b){this[_0x5f50('0x1')]=_0x3e0d4b;io['to'](util[_0x5f50('0x1c')](_0x5f50('0x1d'),_0x1bd046[_0x5f50('0x9')]))['emit'](_0x5f50('0x1e'),_0x1bd046);}};module[_0x5f50('0x1f')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 06fbbd7..7221567 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(_0x129a36,_0x25b107){var _0x43725e=function(_0x5dec61){while(--_0x5dec61){_0x129a36['push'](_0x129a36['shift']());}};_0x43725e(++_0x25b107);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x2084c4,_0x34c9a5){var _0x3f1880=function(_0x59c7c1){while(--_0x59c7c1){_0x2084c4['push'](_0x2084c4['shift']());}};_0x3f1880(++_0x34c9a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 b2f9035..eabc6e9 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 _0xae34=['Intervals','exports'];(function(_0x25706e,_0x284f08){var _0x32e693=function(_0x7c022c){while(--_0x7c022c){_0x25706e['push'](_0x25706e['shift']());}};_0x32e693(++_0x284f08);}(_0xae34,0x130));var _0x4ae3=function(_0x4ee40d,_0x17daa8){_0x4ee40d=_0x4ee40d-0x0;var _0x46294d=_0xae34[_0x4ee40d];return _0x46294d;};'use strict';function Interval(_0x20fd92){this['id']=_0x20fd92['id']||0x0;this['name']=_0x20fd92['name']||'';this[_0x4ae3('0x0')]=_0x20fd92[_0x4ae3('0x0')]||{};}module[_0x4ae3('0x1')]=Interval; \ No newline at end of file +var _0x2cab=['name','Intervals','exports'];(function(_0xe84953,_0xa2cc7){var _0x2f486f=function(_0x4a0a09){while(--_0x4a0a09){_0xe84953['push'](_0xe84953['shift']());}};_0x2f486f(++_0xa2cc7);}(_0x2cab,0x1ce));var _0xb2ca=function(_0x3b5424,_0xc089e2){_0x3b5424=_0x3b5424-0x0;var _0x16a0d0=_0x2cab[_0x3b5424];return _0x16a0d0;};'use strict';function Interval(_0x7f40e4){this['id']=_0x7f40e4['id']||0x0;this[_0xb2ca('0x0')]=_0x7f40e4[_0xb2ca('0x0')]||'';this[_0xb2ca('0x1')]=_0x7f40e4[_0xb2ca('0x1')]||{};}module[_0xb2ca('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 3f03572..143834f 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 _0xc9b3=['ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','updateRouting','_rr','map','prototype','paused','length','online','loggedIn','mailPause','available','stringify','format','mail:queue:%s','emit','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc9b3,0xd8));var _0x3c9b=function(_0x2fa2e1,_0x2be718){_0x2fa2e1=_0x2fa2e1-0x0;var _0x3ea119=_0xc9b3[_0x2fa2e1];return _0x3ea119;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x3c9b('0x0'));var config=require('../../../config/environment');config[_0x3c9b('0x1')]=_['defaults'](config[_0x3c9b('0x1')],{'host':'localhost','port':0x18eb});var io=require(_0x3c9b('0x2'))(new Redis(config['redis']));function MailQueue(_0x56e215){this['id']=_0x56e215['id']||0x0;this['name']=_0x56e215[_0x3c9b('0x3')]||'';this[_0x3c9b('0x4')]=_0x56e215['timeout']||0xa;this[_0x3c9b('0x5')]=_0x56e215[_0x3c9b('0x5')]||_0x3c9b('0x6');this[_0x3c9b('0x7')]=_0x56e215[_0x3c9b('0x7')];this[_0x3c9b('0x8')]={};this[_0x3c9b('0x9')]=0x0;this[_0x3c9b('0xa')]='';this['updateRouting']();this[_0x3c9b('0xb')]();}MailQueue['prototype'][_0x3c9b('0xc')]=function(){var _0x145ada=this[_0x3c9b('0x8')][_0x3c9b('0xd')];this[_0x3c9b('0x8')]=_[_0x3c9b('0xe')](this[_0x3c9b('0x7')],'id');this['mapAgentsId']['_rr']=_0x145ada;};MailQueue[_0x3c9b('0xf')][_0x3c9b('0xb')]=function(){this['loggedIn']=0x0;this[_0x3c9b('0x10')]=0x0;for(var _0x279c90=0x0;_0x279c90=0x0?this['available']:0x0;var _0x559565={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x3c9b('0x3')],'paused':this[_0x3c9b('0x10')],'waiting':this[_0x3c9b('0x9')]};var _0x41f09e=md5(JSON[_0x3c9b('0x16')](_0x559565));if(this[_0x3c9b('0xa')]!==_0x41f09e){this['md5']=_0x41f09e;io['to'](util[_0x3c9b('0x17')](_0x3c9b('0x18'),_0x559565[_0x3c9b('0x3')]))[_0x3c9b('0x19')]('mail_queue:save',_0x559565);}};module[_0x3c9b('0x1a')]=MailQueue; \ No newline at end of file +var _0x05e2=['mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','length','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x3483b7,_0xc5f15e){var _0x48707b=function(_0x3b02c2){while(--_0x3b02c2){_0x3483b7['push'](_0x3483b7['shift']());}};_0x48707b(++_0xc5f15e);}(_0x05e2,0x179));var _0x205e=function(_0xbc1a4b,_0x4dfbe4){_0xbc1a4b=_0xbc1a4b-0x0;var _0x108b87=_0x05e2[_0xbc1a4b];return _0x108b87;};'use strict';var _=require(_0x205e('0x0'));var md5=require(_0x205e('0x1'));var util=require(_0x205e('0x2'));var Redis=require(_0x205e('0x3'));var config=require(_0x205e('0x4'));config[_0x205e('0x5')]=_[_0x205e('0x6')](config[_0x205e('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x205e('0x7'))(new Redis(config[_0x205e('0x5')]));function MailQueue(_0x387d89){this['id']=_0x387d89['id']||0x0;this[_0x205e('0x8')]=_0x387d89[_0x205e('0x8')]||'';this[_0x205e('0x9')]=_0x387d89[_0x205e('0x9')]||0xa;this[_0x205e('0xa')]=_0x387d89['strategy']||_0x205e('0xb');this[_0x205e('0xc')]=_0x387d89[_0x205e('0xc')];this[_0x205e('0xd')]={};this[_0x205e('0xe')]=0x0;this[_0x205e('0x1')]='';this[_0x205e('0xf')]();this[_0x205e('0x10')]();}MailQueue['prototype'][_0x205e('0xf')]=function(){var _0x619bce=this[_0x205e('0xd')][_0x205e('0x11')];this[_0x205e('0xd')]=_['map'](this[_0x205e('0xc')],'id');this[_0x205e('0xd')][_0x205e('0x11')]=_0x619bce;};MailQueue[_0x205e('0x12')][_0x205e('0x10')]=function(){this[_0x205e('0x13')]=0x0;this[_0x205e('0x14')]=0x0;for(var _0x465f53=0x0;_0x465f53=0x0?this[_0x205e('0x17')]:0x0;var _0x25505f={'id':this['id'],'available':this['available'],'loggedIn':this[_0x205e('0x13')],'name':this[_0x205e('0x8')],'paused':this['paused'],'waiting':this[_0x205e('0xe')]};var _0x3f2ade=md5(JSON[_0x205e('0x18')](_0x25505f));if(this[_0x205e('0x1')]!==_0x3f2ade){this[_0x205e('0x1')]=_0x3f2ade;io['to'](util[_0x205e('0x19')](_0x205e('0x1a'),_0x25505f[_0x205e('0x8')]))[_0x205e('0x1b')](_0x205e('0x1c'),_0x25505f);}};module[_0x205e('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e95e9e0..b138972 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 _0xb71b=['available','stringify','format','openchannel_queue:save','exports','lodash','md5','util','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','map','prototype','loggedIn','paused','length','openchannelPause'];(function(_0x28bda8,_0x3e5abf){var _0x46d4d4=function(_0x508c77){while(--_0x508c77){_0x28bda8['push'](_0x28bda8['shift']());}};_0x46d4d4(++_0x3e5abf);}(_0xb71b,0x123));var _0xbb71=function(_0x76d40b,_0x4fd264){_0x76d40b=_0x76d40b-0x0;var _0x510469=_0xb71b[_0x76d40b];return _0x510469;};'use strict';var _=require(_0xbb71('0x0'));var md5=require(_0xbb71('0x1'));var util=require(_0xbb71('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xbb71('0x3')]=_[_0xbb71('0x4')](config['redis'],{'host':_0xbb71('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function OpenchannelQueue(_0x19aabc){this['id']=_0x19aabc['id']||0x0;this['name']=_0x19aabc[_0xbb71('0x6')]||'';this[_0xbb71('0x7')]=_0x19aabc[_0xbb71('0x7')]||0xa;this[_0xbb71('0x8')]=_0x19aabc[_0xbb71('0x8')]||_0xbb71('0x9');this[_0xbb71('0xa')]=_0x19aabc['Agents'];this['mapAgentsId']={};this[_0xbb71('0xb')]=0x0;this['md5']='';this[_0xbb71('0xc')]();this[_0xbb71('0xd')]();}OpenchannelQueue['prototype'][_0xbb71('0xc')]=function(){var _0x408499=this[_0xbb71('0xe')]['_rr'];this[_0xbb71('0xe')]=_[_0xbb71('0xf')](this[_0xbb71('0xa')],'id');this[_0xbb71('0xe')]['_rr']=_0x408499;};OpenchannelQueue[_0xbb71('0x10')][_0xbb71('0xd')]=function(){this[_0xbb71('0x11')]=0x0;this[_0xbb71('0x12')]=0x0;for(var _0x49c470=0x0;_0x49c470=0x0?this['available']:0x0;var _0x4cf37d={'id':this['id'],'available':this['available'],'loggedIn':this[_0xbb71('0x11')],'name':this[_0xbb71('0x6')],'paused':this[_0xbb71('0x12')],'waiting':this[_0xbb71('0xb')]};var _0x52bb28=md5(JSON[_0xbb71('0x16')](_0x4cf37d));if(this[_0xbb71('0x1')]!==_0x52bb28){this[_0xbb71('0x1')]=_0x52bb28;io['to'](util[_0xbb71('0x17')]('openchannel:queue:%s',_0x4cf37d[_0xbb71('0x6')]))['emit'](_0xbb71('0x18'),_0x4cf37d);}};module[_0xbb71('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x6438=['defaults','localhost','name','timeout','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','exports','lodash','md5','util','ioredis','redis'];(function(_0x35af1a,_0x2c4ef0){var _0x5694e9=function(_0x34eaf1){while(--_0x34eaf1){_0x35af1a['push'](_0x35af1a['shift']());}};_0x5694e9(++_0x2c4ef0);}(_0x6438,0xe5));var _0x8643=function(_0x3fe7ad,_0x409418){_0x3fe7ad=_0x3fe7ad-0x0;var _0x5bf081=_0x6438[_0x3fe7ad];return _0x5bf081;};'use strict';var _=require(_0x8643('0x0'));var md5=require(_0x8643('0x1'));var util=require(_0x8643('0x2'));var Redis=require(_0x8643('0x3'));var config=require('../../../config/environment');config[_0x8643('0x4')]=_[_0x8643('0x5')](config['redis'],{'host':_0x8643('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function OpenchannelQueue(_0x3b21e4){this['id']=_0x3b21e4['id']||0x0;this['name']=_0x3b21e4[_0x8643('0x7')]||'';this[_0x8643('0x8')]=_0x3b21e4['timeout']||0xa;this['strategy']=_0x3b21e4['strategy']||'beepall';this[_0x8643('0x9')]=_0x3b21e4[_0x8643('0x9')];this[_0x8643('0xa')]={};this[_0x8643('0xb')]=0x0;this['md5']='';this[_0x8643('0xc')]();this[_0x8643('0xd')]();}OpenchannelQueue[_0x8643('0xe')]['updateRouting']=function(){var _0x48a417=this[_0x8643('0xa')]['_rr'];this[_0x8643('0xa')]=_[_0x8643('0xf')](this[_0x8643('0x9')],'id');this['mapAgentsId'][_0x8643('0x10')]=_0x48a417;};OpenchannelQueue[_0x8643('0xe')][_0x8643('0xd')]=function(){this[_0x8643('0x11')]=0x0;this[_0x8643('0x12')]=0x0;for(var _0x23230f=0x0;_0x23230f=0x0?this['available']:0x0;var _0xb7be9f={'id':this['id'],'available':this[_0x8643('0x14')],'loggedIn':this[_0x8643('0x11')],'name':this['name'],'paused':this[_0x8643('0x12')],'waiting':this[_0x8643('0xb')]};var _0x42d809=md5(JSON[_0x8643('0x15')](_0xb7be9f));if(this[_0x8643('0x1')]!==_0x42d809){this['md5']=_0x42d809;io['to'](util[_0x8643('0x16')](_0x8643('0x17'),_0xb7be9f['name']))[_0x8643('0x18')]('openchannel_queue:save',_0xb7be9f);}};module[_0x8643('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 c8504d9..bbc5a13 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 _0xb10b=['length','online','loggedIn','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','prototype','updateRouting','_rr','map','updateRealtime','paused'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0xb10b,0x12a));var _0xbb10=function(_0x33df84,_0x5825d1){_0x33df84=_0x33df84-0x0;var _0x42e95e=_0xb10b[_0x33df84];return _0x42e95e;};'use strict';var _=require(_0xbb10('0x0'));var md5=require('md5');var util=require(_0xbb10('0x1'));var Redis=require(_0xbb10('0x2'));var config=require(_0xbb10('0x3'));config['redis']=_[_0xbb10('0x4')](config[_0xbb10('0x5')],{'host':_0xbb10('0x6'),'port':0x18eb});var io=require(_0xbb10('0x7'))(new Redis(config[_0xbb10('0x5')]));function SmsQueue(_0x312b72){this['id']=_0x312b72['id']||0x0;this['name']=_0x312b72[_0xbb10('0x8')]||'';this[_0xbb10('0x9')]=_0x312b72['timeout']||0xa;this[_0xbb10('0xa')]=_0x312b72[_0xbb10('0xa')]||_0xbb10('0xb');this[_0xbb10('0xc')]=_0x312b72[_0xbb10('0xc')];this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]=0x0;this[_0xbb10('0xf')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0xbb10('0x10')][_0xbb10('0x11')]=function(){var _0xce64f3=this['mapAgentsId'][_0xbb10('0x12')];this['mapAgentsId']=_[_0xbb10('0x13')](this[_0xbb10('0xc')],'id');this[_0xbb10('0xd')][_0xbb10('0x12')]=_0xce64f3;};SmsQueue[_0xbb10('0x10')][_0xbb10('0x14')]=function(){this['loggedIn']=0x0;this[_0xbb10('0x15')]=0x0;for(var _0x42d7e4=0x0;_0x42d7e4=0x0?this[_0xbb10('0x1a')]:0x0;var _0x1682a4={'id':this['id'],'available':this[_0xbb10('0x1a')],'loggedIn':this[_0xbb10('0x18')],'name':this[_0xbb10('0x8')],'paused':this[_0xbb10('0x15')],'waiting':this['waiting']};var _0x5ff0cf=md5(JSON[_0xbb10('0x1b')](_0x1682a4));if(this[_0xbb10('0xf')]!==_0x5ff0cf){this[_0xbb10('0xf')]=_0x5ff0cf;io['to'](util[_0xbb10('0x1c')](_0xbb10('0x1d'),_0x1682a4['name']))[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x1682a4);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xb10b=['length','online','loggedIn','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','prototype','updateRouting','_rr','map','updateRealtime','paused'];(function(_0x2b81be,_0x544bdf){var _0x8ed4a7=function(_0x4a7bf4){while(--_0x4a7bf4){_0x2b81be['push'](_0x2b81be['shift']());}};_0x8ed4a7(++_0x544bdf);}(_0xb10b,0x12a));var _0xbb10=function(_0x45ce90,_0x114609){_0x45ce90=_0x45ce90-0x0;var _0x313c45=_0xb10b[_0x45ce90];return _0x313c45;};'use strict';var _=require(_0xbb10('0x0'));var md5=require('md5');var util=require(_0xbb10('0x1'));var Redis=require(_0xbb10('0x2'));var config=require(_0xbb10('0x3'));config['redis']=_[_0xbb10('0x4')](config[_0xbb10('0x5')],{'host':_0xbb10('0x6'),'port':0x18eb});var io=require(_0xbb10('0x7'))(new Redis(config[_0xbb10('0x5')]));function SmsQueue(_0x312b72){this['id']=_0x312b72['id']||0x0;this['name']=_0x312b72[_0xbb10('0x8')]||'';this[_0xbb10('0x9')]=_0x312b72['timeout']||0xa;this[_0xbb10('0xa')]=_0x312b72[_0xbb10('0xa')]||_0xbb10('0xb');this[_0xbb10('0xc')]=_0x312b72[_0xbb10('0xc')];this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]=0x0;this[_0xbb10('0xf')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0xbb10('0x10')][_0xbb10('0x11')]=function(){var _0xce64f3=this['mapAgentsId'][_0xbb10('0x12')];this['mapAgentsId']=_[_0xbb10('0x13')](this[_0xbb10('0xc')],'id');this[_0xbb10('0xd')][_0xbb10('0x12')]=_0xce64f3;};SmsQueue[_0xbb10('0x10')][_0xbb10('0x14')]=function(){this['loggedIn']=0x0;this[_0xbb10('0x15')]=0x0;for(var _0x42d7e4=0x0;_0x42d7e4=0x0?this[_0xbb10('0x1a')]:0x0;var _0x1682a4={'id':this['id'],'available':this[_0xbb10('0x1a')],'loggedIn':this[_0xbb10('0x18')],'name':this[_0xbb10('0x8')],'paused':this[_0xbb10('0x15')],'waiting':this['waiting']};var _0x5ff0cf=md5(JSON[_0xbb10('0x1b')](_0x1682a4));if(this[_0xbb10('0xf')]!==_0x5ff0cf){this[_0xbb10('0xf')]=_0x5ff0cf;io['to'](util[_0xbb10('0x1c')](_0xbb10('0x1d'),_0x1682a4['name']))[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x1682a4);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index fd4e453..bcf3bfe 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 _0x6935=['util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/faxQueue','agents','intervals','chatQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','initIntervals','initOpenchannelQueues','openchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','mailQueues','initFaxQueues','bluebird'];(function(_0x45138b,_0xec2bd6){var _0x398884=function(_0x408309){while(--_0x408309){_0x45138b['push'](_0x45138b['shift']());}};_0x398884(++_0xec2bd6);}(_0x6935,0x1c1));var _0x5693=function(_0x4ca8af,_0x27250f){_0x4ca8af=_0x4ca8af-0x0;var _0x3bef18=_0x6935[_0x4ca8af];return _0x3bef18;};'use strict';var BPromise=require(_0x5693('0x0'));var util=require(_0x5693('0x1'));var _=require(_0x5693('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x5693('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x5693('0x4'));var SmsQueue=require(_0x5693('0x5'));var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0x5693('0x6'));var Realtime=function(){this[_0x5693('0x7')]={};this[_0x5693('0x8')]={};this['openchannelQueues']={};this[_0x5693('0x9')]={};this[_0x5693('0xa')]={};this['mailQueues']={};this[_0x5693('0xb')]={};this[_0x5693('0xc')]={};this['mailQueuesWaitingInteractions']={};this[_0x5693('0xd')]={};this[_0x5693('0xe')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x2f6edd,_0x23a10a,_0x1f7d70){var _0x565281=_[_0x5693('0xf')](_0x2f6edd,function(_0x26d9a7,_0x207ca7){return _0x26d9a7[_0x1f7d70];});for(var _0x3789f6 in _0x23a10a){if(_0x23a10a[_0x5693('0x10')](_0x3789f6)){if(!_0x565281[_0x3789f6]){delete _0x23a10a[_0x3789f6];}}}}Realtime[_0x5693('0x11')][_0x5693('0x12')]=function(_0x573fd8,_0x12c478){for(var _0x3e794b in _0x12c478){if(_0x573fd8[_0x5693('0x10')](_0x3e794b)){_0x573fd8[_0x3e794b]=_0x12c478[_0x3e794b];}}};Realtime[_0x5693('0x11')]['initAgents']=function(){var _0x170812=this;return function(_0x2498a3){if(_0x2498a3){freeIsNotKey(_0x2498a3,_0x170812['agents'],'id');for(var _0x1038c7=0x0,_0x54c185={},_0x5c5a94={};_0x1038c7<_0x2498a3[_0x5693('0x13')];_0x1038c7+=0x1){_0x54c185=_0x2498a3[_0x1038c7];if(_[_0x5693('0x14')](_0x170812[_0x5693('0x7')][_0x54c185['id']])){_0x170812[_0x5693('0x7')][_0x54c185['id']]=new Agent(_0x54c185);}else{_0x170812[_0x5693('0x12')](_0x170812[_0x5693('0x7')][_0x54c185['id']],_0x54c185);}}}return _0x170812[_0x5693('0x7')];};};Realtime[_0x5693('0x11')][_0x5693('0x15')]=function(){var _0x29b7ed=this;return function(_0x312838){if(_0x312838){freeIsNotKey(_0x312838,_0x29b7ed[_0x5693('0x8')],'id');for(var _0x4ce05f=0x0,_0x2eabba={},_0x1055d5={};_0x4ce05f<_0x312838['length'];_0x4ce05f+=0x1){_0x2eabba=_0x312838[_0x4ce05f];if(_[_0x5693('0x14')](_0x29b7ed[_0x5693('0x8')][_0x2eabba['id']])){_0x29b7ed[_0x5693('0x8')][_0x2eabba['id']]=new Interval(_0x2eabba);}else{_0x29b7ed[_0x5693('0x12')](_0x29b7ed[_0x5693('0x8')][_0x2eabba['id']],_0x2eabba);}}}return _0x29b7ed[_0x5693('0x8')];};};Realtime[_0x5693('0x11')][_0x5693('0x16')]=function(){var _0x1da8ea=this;return function(_0x47aff2){if(_0x47aff2){freeIsNotKey(_0x47aff2,_0x1da8ea[_0x5693('0x17')],'id');for(var _0x2e901b=0x0,_0xbcdd26={},_0xc32b6={};_0x2e901b<_0x47aff2[_0x5693('0x13')];_0x2e901b+=0x1){_0xbcdd26=_0x47aff2[_0x2e901b];if(_[_0x5693('0x14')](_0x1da8ea[_0x5693('0x17')][_0xbcdd26['id']])){_0x1da8ea[_0x5693('0x17')][_0xbcdd26['id']]=new OpenchannelQueue(_0xbcdd26);}else{_0x1da8ea[_0x5693('0x12')](_0x1da8ea[_0x5693('0x17')][_0xbcdd26['id']],_0xbcdd26);}_0x1da8ea[_0x5693('0x17')][_0xbcdd26['id']][_0x5693('0x18')]();_0x1da8ea[_0x5693('0x17')][_0xbcdd26['id']][_0x5693('0x19')]();}}return _0x1da8ea[_0x5693('0x17')];};};Realtime[_0x5693('0x11')][_0x5693('0x1a')]=function(){var _0x2e07f1=this;return function(_0x54e84c){if(_0x54e84c){freeIsNotKey(_0x54e84c,_0x2e07f1[_0x5693('0x9')],'id');for(var _0x4584ad=0x0,_0x523839={},_0x1f4786={};_0x4584ad<_0x54e84c[_0x5693('0x13')];_0x4584ad+=0x1){_0x523839=_0x54e84c[_0x4584ad];if(_[_0x5693('0x14')](_0x2e07f1[_0x5693('0x9')][_0x523839['id']])){_0x2e07f1[_0x5693('0x9')][_0x523839['id']]=new ChatQueue(_0x523839);}else{_0x2e07f1[_0x5693('0x12')](_0x2e07f1[_0x5693('0x9')][_0x523839['id']],_0x523839);}_0x2e07f1['chatQueues'][_0x523839['id']][_0x5693('0x18')]();_0x2e07f1[_0x5693('0x9')][_0x523839['id']][_0x5693('0x19')]();}}return _0x2e07f1['chatQueues'];};};Realtime['prototype'][_0x5693('0x1b')]=function(){var _0x430157=this;return function(_0x266ab8){if(_0x266ab8){freeIsNotKey(_0x266ab8,_0x430157[_0x5693('0xa')],'id');for(var _0x2dec86=0x0,_0x349805={},_0x34e21b={};_0x2dec86<_0x266ab8[_0x5693('0x13')];_0x2dec86+=0x1){_0x349805=_0x266ab8[_0x2dec86];if(_['isUndefined'](_0x430157[_0x5693('0xa')][_0x349805['id']])){_0x430157[_0x5693('0xa')][_0x349805['id']]=new SmsQueue(_0x349805);}else{_0x430157['mergeFromDatabase'](_0x430157['smsQueues'][_0x349805['id']],_0x349805);}_0x430157['smsQueues'][_0x349805['id']][_0x5693('0x18')]();_0x430157[_0x5693('0xa')][_0x349805['id']][_0x5693('0x19')]();}}return _0x430157[_0x5693('0xa')];};};Realtime[_0x5693('0x11')]['initMailQueues']=function(){var _0x3a6776=this;return function(_0x21bc49){if(_0x21bc49){freeIsNotKey(_0x21bc49,_0x3a6776[_0x5693('0x1c')],'id');for(var _0x2e502e=0x0,_0x4f853d={},_0x1c1514={};_0x2e502e<_0x21bc49[_0x5693('0x13')];_0x2e502e+=0x1){_0x4f853d=_0x21bc49[_0x2e502e];if(_[_0x5693('0x14')](_0x3a6776[_0x5693('0x1c')][_0x4f853d['id']])){_0x3a6776[_0x5693('0x1c')][_0x4f853d['id']]=new MailQueue(_0x4f853d);}else{_0x3a6776[_0x5693('0x12')](_0x3a6776[_0x5693('0x1c')][_0x4f853d['id']],_0x4f853d);}_0x3a6776[_0x5693('0x1c')][_0x4f853d['id']][_0x5693('0x18')]();_0x3a6776[_0x5693('0x1c')][_0x4f853d['id']][_0x5693('0x19')]();}}return _0x3a6776[_0x5693('0x1c')];};};Realtime[_0x5693('0x11')][_0x5693('0x1d')]=function(){var _0x3380da=this;return function(_0x875872){if(_0x875872){freeIsNotKey(_0x875872,_0x3380da['faxQueues'],'id');for(var _0x1c269b=0x0,_0x5d55d7={},_0x4efda5={};_0x1c269b<_0x875872[_0x5693('0x13')];_0x1c269b+=0x1){_0x5d55d7=_0x875872[_0x1c269b];if(_['isUndefined'](_0x3380da[_0x5693('0xb')][_0x5d55d7['id']])){_0x3380da['faxQueues'][_0x5d55d7['id']]=new FaxQueue(_0x5d55d7);}else{_0x3380da[_0x5693('0x12')](_0x3380da[_0x5693('0xb')][_0x5d55d7['id']],_0x5d55d7);}_0x3380da[_0x5693('0xb')][_0x5d55d7['id']][_0x5693('0x18')]();_0x3380da[_0x5693('0xb')][_0x5d55d7['id']][_0x5693('0x19')]();}}return _0x3380da[_0x5693('0xb')];};};module['exports']=Realtime; \ No newline at end of file +var _0x0692=['util','lodash','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','intervals','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length','isUndefined','initIntervals','openchannelQueues','updateRouting','updateRealtime','initChatQueues','chatQueues','initSmsQueues','exports','bluebird'];(function(_0x469eee,_0x3fa6a3){var _0x10c192=function(_0xe80d6b){while(--_0xe80d6b){_0x469eee['push'](_0x469eee['shift']());}};_0x10c192(++_0x3fa6a3);}(_0x0692,0x1bf));var _0x2069=function(_0x58b6e3,_0x568828){_0x58b6e3=_0x58b6e3-0x0;var _0x2d0940=_0x0692[_0x58b6e3];return _0x2d0940;};'use strict';var BPromise=require(_0x2069('0x0'));var util=require(_0x2069('0x1'));var _=require(_0x2069('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x2069('0x3'));var OpenchannelQueue=require(_0x2069('0x4'));var ChatQueue=require(_0x2069('0x5'));var SmsQueue=require(_0x2069('0x6'));var MailQueue=require(_0x2069('0x7'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this['agents']={};this[_0x2069('0x8')]={};this['openchannelQueues']={};this['chatQueues']={};this[_0x2069('0x9')]={};this[_0x2069('0xa')]={};this[_0x2069('0xb')]={};this[_0x2069('0xc')]={};this[_0x2069('0xd')]={};this['openchannelQueuesWaitingInteractions']={};this[_0x2069('0xe')]={};this[_0x2069('0xf')]={};};function freeIsNotKey(_0x1740d4,_0xa220e1,_0x422045){var _0x3a5c1a=_[_0x2069('0x10')](_0x1740d4,function(_0x13c0eb,_0x298244){return _0x13c0eb[_0x422045];});for(var _0x1e29e0 in _0xa220e1){if(_0xa220e1[_0x2069('0x11')](_0x1e29e0)){if(!_0x3a5c1a[_0x1e29e0]){delete _0xa220e1[_0x1e29e0];}}}}Realtime[_0x2069('0x12')][_0x2069('0x13')]=function(_0x53cc5a,_0x794d2a){for(var _0x1d975f in _0x794d2a){if(_0x53cc5a[_0x2069('0x11')](_0x1d975f)){_0x53cc5a[_0x1d975f]=_0x794d2a[_0x1d975f];}}};Realtime[_0x2069('0x12')][_0x2069('0x14')]=function(){var _0x2086a6=this;return function(_0x3f1b9d){if(_0x3f1b9d){freeIsNotKey(_0x3f1b9d,_0x2086a6[_0x2069('0x15')],'id');for(var _0x216c5f=0x0,_0x5c3dd3={},_0x459bcc={};_0x216c5f<_0x3f1b9d[_0x2069('0x16')];_0x216c5f+=0x1){_0x5c3dd3=_0x3f1b9d[_0x216c5f];if(_[_0x2069('0x17')](_0x2086a6[_0x2069('0x15')][_0x5c3dd3['id']])){_0x2086a6['agents'][_0x5c3dd3['id']]=new Agent(_0x5c3dd3);}else{_0x2086a6['mergeFromDatabase'](_0x2086a6[_0x2069('0x15')][_0x5c3dd3['id']],_0x5c3dd3);}}}return _0x2086a6[_0x2069('0x15')];};};Realtime[_0x2069('0x12')][_0x2069('0x18')]=function(){var _0x2b6338=this;return function(_0x4b1fd2){if(_0x4b1fd2){freeIsNotKey(_0x4b1fd2,_0x2b6338[_0x2069('0x8')],'id');for(var _0x3127f4=0x0,_0x19abcd={},_0x361c2e={};_0x3127f4<_0x4b1fd2[_0x2069('0x16')];_0x3127f4+=0x1){_0x19abcd=_0x4b1fd2[_0x3127f4];if(_[_0x2069('0x17')](_0x2b6338['intervals'][_0x19abcd['id']])){_0x2b6338[_0x2069('0x8')][_0x19abcd['id']]=new Interval(_0x19abcd);}else{_0x2b6338[_0x2069('0x13')](_0x2b6338[_0x2069('0x8')][_0x19abcd['id']],_0x19abcd);}}}return _0x2b6338['intervals'];};};Realtime[_0x2069('0x12')]['initOpenchannelQueues']=function(){var _0x496bb9=this;return function(_0x340ee0){if(_0x340ee0){freeIsNotKey(_0x340ee0,_0x496bb9[_0x2069('0x19')],'id');for(var _0x1fad38=0x0,_0x321a40={},_0x3e4c38={};_0x1fad38<_0x340ee0[_0x2069('0x16')];_0x1fad38+=0x1){_0x321a40=_0x340ee0[_0x1fad38];if(_[_0x2069('0x17')](_0x496bb9[_0x2069('0x19')][_0x321a40['id']])){_0x496bb9[_0x2069('0x19')][_0x321a40['id']]=new OpenchannelQueue(_0x321a40);}else{_0x496bb9[_0x2069('0x13')](_0x496bb9['openchannelQueues'][_0x321a40['id']],_0x321a40);}_0x496bb9[_0x2069('0x19')][_0x321a40['id']][_0x2069('0x1a')]();_0x496bb9['openchannelQueues'][_0x321a40['id']][_0x2069('0x1b')]();}}return _0x496bb9[_0x2069('0x19')];};};Realtime['prototype'][_0x2069('0x1c')]=function(){var _0x59253f=this;return function(_0x35d869){if(_0x35d869){freeIsNotKey(_0x35d869,_0x59253f['chatQueues'],'id');for(var _0x36758b=0x0,_0x12917a={},_0x4be40c={};_0x36758b<_0x35d869[_0x2069('0x16')];_0x36758b+=0x1){_0x12917a=_0x35d869[_0x36758b];if(_[_0x2069('0x17')](_0x59253f[_0x2069('0x1d')][_0x12917a['id']])){_0x59253f['chatQueues'][_0x12917a['id']]=new ChatQueue(_0x12917a);}else{_0x59253f['mergeFromDatabase'](_0x59253f[_0x2069('0x1d')][_0x12917a['id']],_0x12917a);}_0x59253f[_0x2069('0x1d')][_0x12917a['id']][_0x2069('0x1a')]();_0x59253f[_0x2069('0x1d')][_0x12917a['id']][_0x2069('0x1b')]();}}return _0x59253f[_0x2069('0x1d')];};};Realtime[_0x2069('0x12')][_0x2069('0x1e')]=function(){var _0x532688=this;return function(_0xcbc67f){if(_0xcbc67f){freeIsNotKey(_0xcbc67f,_0x532688[_0x2069('0x9')],'id');for(var _0x7f2809=0x0,_0x685a18={},_0x4a1e27={};_0x7f2809<_0xcbc67f[_0x2069('0x16')];_0x7f2809+=0x1){_0x685a18=_0xcbc67f[_0x7f2809];if(_['isUndefined'](_0x532688[_0x2069('0x9')][_0x685a18['id']])){_0x532688[_0x2069('0x9')][_0x685a18['id']]=new SmsQueue(_0x685a18);}else{_0x532688[_0x2069('0x13')](_0x532688['smsQueues'][_0x685a18['id']],_0x685a18);}_0x532688[_0x2069('0x9')][_0x685a18['id']][_0x2069('0x1a')]();_0x532688[_0x2069('0x9')][_0x685a18['id']][_0x2069('0x1b')]();}}return _0x532688['smsQueues'];};};Realtime[_0x2069('0x12')]['initMailQueues']=function(){var _0x38c21e=this;return function(_0x1f2713){if(_0x1f2713){freeIsNotKey(_0x1f2713,_0x38c21e['mailQueues'],'id');for(var _0x32f043=0x0,_0x40bd14={},_0x2918fb={};_0x32f043<_0x1f2713[_0x2069('0x16')];_0x32f043+=0x1){_0x40bd14=_0x1f2713[_0x32f043];if(_[_0x2069('0x17')](_0x38c21e[_0x2069('0xa')][_0x40bd14['id']])){_0x38c21e[_0x2069('0xa')][_0x40bd14['id']]=new MailQueue(_0x40bd14);}else{_0x38c21e[_0x2069('0x13')](_0x38c21e[_0x2069('0xa')][_0x40bd14['id']],_0x40bd14);}_0x38c21e[_0x2069('0xa')][_0x40bd14['id']][_0x2069('0x1a')]();_0x38c21e[_0x2069('0xa')][_0x40bd14['id']]['updateRealtime']();}}return _0x38c21e[_0x2069('0xa')];};};Realtime['prototype']['initFaxQueues']=function(){var _0x3f6be6=this;return function(_0xf64046){if(_0xf64046){freeIsNotKey(_0xf64046,_0x3f6be6['faxQueues'],'id');for(var _0x5be5c5=0x0,_0x1df893={},_0x5857b4={};_0x5be5c5<_0xf64046['length'];_0x5be5c5+=0x1){_0x1df893=_0xf64046[_0x5be5c5];if(_[_0x2069('0x17')](_0x3f6be6[_0x2069('0xb')][_0x1df893['id']])){_0x3f6be6[_0x2069('0xb')][_0x1df893['id']]=new FaxQueue(_0x1df893);}else{_0x3f6be6[_0x2069('0x13')](_0x3f6be6[_0x2069('0xb')][_0x1df893['id']],_0x1df893);}_0x3f6be6[_0x2069('0xb')][_0x1df893['id']][_0x2069('0x1a')]();_0x3f6be6[_0x2069('0xb')][_0x1df893['id']]['updateRealtime']();}}return _0x3f6be6[_0x2069('0xb')];};};module[_0x2069('0x1f')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 9a5323f..8f083d5 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 _0xce6c=['update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x46bec2,_0x36cde0){var _0x39b857=function(_0xf29a34){while(--_0xf29a34){_0x46bec2['push'](_0x46bec2['shift']());}};_0x39b857(++_0x36cde0);}(_0xce6c,0xbc));var _0xcce6=function(_0x1fbf6f,_0x5df251){_0x1fbf6f=_0x1fbf6f-0x0;var _0x48591d=_0xce6c[_0x1fbf6f];return _0x48591d;};'use strict';var client=require(_0xcce6('0x0'));exports[_0xcce6('0x1')]=function(_0x1ab691,_0x3a9e02){return client[_0xcce6('0x2')](_0xcce6('0x3'),{'body':_0x3a9e02,'options':{'where':{'id':_0x1ab691}},'log':'updateChatInteraction'});};exports[_0xcce6('0x4')]=function(_0x52a688,_0x5c3563){return client['Request'](_0xcce6('0x5'),{'body':_0x5c3563,'options':{'where':{'id':_0x52a688}},'log':_0xcce6('0x6')});}; \ No newline at end of file +var _0x7382=['UpdateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','update','Request'];(function(_0x2d6191,_0x282760){var _0x3dff6c=function(_0xfd0fbb){while(--_0xfd0fbb){_0x2d6191['push'](_0x2d6191['shift']());}};_0x3dff6c(++_0x282760);}(_0x7382,0x99));var _0x2738=function(_0x5b7f44,_0x569a05){_0x5b7f44=_0x5b7f44-0x0;var _0x415304=_0x7382[_0x5b7f44];return _0x415304;};'use strict';var client=require('../client');exports[_0x2738('0x0')]=function(_0x3f2109,_0x370b7f){return client[_0x2738('0x1')](_0x2738('0x2'),{'body':_0x370b7f,'options':{'where':{'id':_0x3f2109}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x17588f,_0x2a5ae8){return client['Request'](_0x2738('0x3'),{'body':_0x2a5ae8,'options':{'where':{'id':_0x17588f}},'log':_0x2738('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index f0263df..2d7d80b 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 _0x2bd9=['Request','createChatMessage','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2bd9,0xee));var _0x92bd=function(_0x48bde8,_0x34b99e){_0x48bde8=_0x48bde8-0x0;var _0x144e58=_0x2bd9[_0x48bde8];return _0x144e58;};'use strict';var client=require(_0x92bd('0x0'));exports[_0x92bd('0x1')]=function(_0x3aadfb){return client[_0x92bd('0x2')]('CreateChatMessage',{'body':_0x3aadfb,'log':_0x92bd('0x3')});}; \ No newline at end of file +var _0xa71a=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0xbc5c0c,_0x330004){var _0x244f6e=function(_0x1ad32d){while(--_0x1ad32d){_0xbc5c0c['push'](_0xbc5c0c['shift']());}};_0x244f6e(++_0x330004);}(_0xa71a,0x13a));var _0xaa71=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa71a[_0x2641f9];return _0x585741;};'use strict';var client=require(_0xaa71('0x0'));exports[_0xaa71('0x1')]=function(_0x175d4c){return client[_0xaa71('0x2')](_0xaa71('0x3'),{'body':_0x175d4c,'log':_0xaa71('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 3232572..3806dee 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 _0x5474=['online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','User','Agents'];(function(_0x1db0d6,_0x33aa99){var _0x5735c0=function(_0x79c77f){while(--_0x79c77f){_0x1db0d6['push'](_0x1db0d6['shift']());}};_0x5735c0(++_0x33aa99);}(_0x5474,0x1e2));var _0x4547=function(_0x5a7283,_0x33dd24){_0x5a7283=_0x5a7283-0x0;var _0x2a13f3=_0x5474[_0x5a7283];return _0x2a13f3;};'use strict';var client=require(_0x4547('0x0'));exports[_0x4547('0x1')]=function(){return function(){return client[_0x4547('0x2')](_0x4547('0x3'),{'options':{'raw':![],'attributes':['id',_0x4547('0x4'),_0x4547('0x5'),'strategy'],'include':[{'model':_0x4547('0x6'),'as':_0x4547('0x7'),'attributes':['id',_0x4547('0x4'),_0x4547('0x8'),_0x4547('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x4a49=['../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','online'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4a49,0x14d));var _0x94a4=function(_0x32f978,_0x1175c6){_0x32f978=_0x32f978-0x0;var _0x3c2aa5=_0x4a49[_0x32f978];return _0x3c2aa5;};'use strict';var client=require(_0x94a4('0x0'));exports[_0x94a4('0x1')]=function(){return function(){return client[_0x94a4('0x2')](_0x94a4('0x3'),{'options':{'raw':![],'attributes':['id',_0x94a4('0x4'),_0x94a4('0x5'),_0x94a4('0x6')],'include':[{'model':_0x94a4('0x7'),'as':'Agents','attributes':['id','name',_0x94a4('0x8'),'chatPause']}]},'log':_0x94a4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 0640e9c..0eea5f8 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 _0xd2ea=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0xf8445,_0x48e251){var _0x363247=function(_0x159690){while(--_0x159690){_0xf8445['push'](_0xf8445['shift']());}};_0x363247(++_0x48e251);}(_0xd2ea,0x15f));var _0xad2e=function(_0x4ad1cc,_0x49de9a){_0x4ad1cc=_0x4ad1cc-0x0;var _0x325c4d=_0xd2ea[_0x4ad1cc];return _0x325c4d;};'use strict';var client=require(_0xad2e('0x0'));exports[_0xad2e('0x1')]=function(_0x43ed3c){return client[_0xad2e('0x2')](_0xad2e('0x3'),{'body':_0x43ed3c,'log':'CreateChatQueueReport'});};exports[_0xad2e('0x4')]=function(_0x46a911,_0xcba7cb){return client[_0xad2e('0x2')](_0xad2e('0x5'),{'body':_0xcba7cb,'options':{'where':{'uniqueid':_0x46a911},'order':[['id',_0xad2e('0x6')]],'limit':0x1},'log':_0xad2e('0x5')});}; \ No newline at end of file +var _0xdeb7=['create','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client'];(function(_0x175721,_0x319c64){var _0x2a5fa3=function(_0x50d761){while(--_0x50d761){_0x175721['push'](_0x175721['shift']());}};_0x2a5fa3(++_0x319c64);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var client=require(_0x7deb('0x0'));exports[_0x7deb('0x1')]=function(_0x5f4b03){return client['Request'](_0x7deb('0x2'),{'body':_0x5f4b03,'log':_0x7deb('0x2')});};exports[_0x7deb('0x3')]=function(_0x20de63,_0x307ce7){return client['Request'](_0x7deb('0x4'),{'body':_0x307ce7,'options':{'where':{'uniqueid':_0x20de63},'order':[['id',_0x7deb('0x5')]],'limit':0x1},'log':_0x7deb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index e1f82ac..911b8ad 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 _0xe8a0=['../client','update','Request','UpdateFaxInteraction','addTagsToFaxInteraction'];(function(_0x967dbc,_0x37ff0e){var _0x21d71a=function(_0x1d7ff0){while(--_0x1d7ff0){_0x967dbc['push'](_0x967dbc['shift']());}};_0x21d71a(++_0x37ff0e);}(_0xe8a0,0x1f4));var _0x0e8a=function(_0x5f0e0b,_0x1a7591){_0x5f0e0b=_0x5f0e0b-0x0;var _0x2ffd39=_0xe8a0[_0x5f0e0b];return _0x2ffd39;};'use strict';var client=require(_0x0e8a('0x0'));exports[_0x0e8a('0x1')]=function(_0xf9bff8,_0x56908d){return client[_0x0e8a('0x2')](_0x0e8a('0x3'),{'body':_0x56908d,'options':{'where':{'id':_0xf9bff8}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x389969,_0x36c609){return client[_0x0e8a('0x2')]('AddTagsToFaxInteraction',{'body':_0x36c609,'options':{'where':{'id':_0x389969}},'log':_0x0e8a('0x4')});}; \ No newline at end of file +var _0xdd8e=['updateFaxInteraction','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','Request','UpdateFaxInteraction'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdd8e,0x162));var _0xedd8=function(_0x443051,_0xe527f6){_0x443051=_0x443051-0x0;var _0x423279=_0xdd8e[_0x443051];return _0x423279;};'use strict';var client=require(_0xedd8('0x0'));exports['update']=function(_0x461f4b,_0x49da82){return client[_0xedd8('0x1')](_0xedd8('0x2'),{'body':_0x49da82,'options':{'where':{'id':_0x461f4b}},'log':_0xedd8('0x3')});};exports[_0xedd8('0x4')]=function(_0x3feaf8,_0x35911f){return client[_0xedd8('0x1')](_0xedd8('0x5'),{'body':_0x35911f,'options':{'where':{'id':_0x3feaf8}},'log':_0xedd8('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index a11d5d1..672e12a 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 _0x3384=['Request','CreateFaxMessage','../client','create'];(function(_0x493150,_0x107958){var _0x3fe8da=function(_0xce7a75){while(--_0xce7a75){_0x493150['push'](_0x493150['shift']());}};_0x3fe8da(++_0x107958);}(_0x3384,0x142));var _0x4338=function(_0x32a3de,_0x4cea7a){_0x32a3de=_0x32a3de-0x0;var _0x30f1f8=_0x3384[_0x32a3de];return _0x30f1f8;};'use strict';var client=require(_0x4338('0x0'));exports[_0x4338('0x1')]=function(_0x4bbde6){return client[_0x4338('0x2')](_0x4338('0x3'),{'body':_0x4bbde6,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x09c1=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x18605f,_0x1da100){var _0x436e18=function(_0xe3f16d){while(--_0xe3f16d){_0x18605f['push'](_0x18605f['shift']());}};_0x436e18(++_0x1da100);}(_0x09c1,0xf5));var _0x109c=function(_0x20c6f1,_0x21fa65){_0x20c6f1=_0x20c6f1-0x0;var _0x43c3bf=_0x09c1[_0x20c6f1];return _0x43c3bf;};'use strict';var client=require(_0x109c('0x0'));exports[_0x109c('0x1')]=function(_0xce9475){return client[_0x109c('0x2')](_0x109c('0x3'),{'body':_0xce9475,'log':_0x109c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 849127d..c8314c2 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 _0xc393=['name','timeout','strategy','User','online','faxPause','../client','getFaxQueues','GetFaxQueue'];(function(_0xe2849a,_0x5f4001){var _0x5eaafa=function(_0x4dcd18){while(--_0x4dcd18){_0xe2849a['push'](_0xe2849a['shift']());}};_0x5eaafa(++_0x5f4001);}(_0xc393,0xcc));var _0x3c39=function(_0x32d430,_0x14e675){_0x32d430=_0x32d430-0x0;var _0x4f9bff=_0xc393[_0x32d430];return _0x4f9bff;};'use strict';var client=require(_0x3c39('0x0'));exports[_0x3c39('0x1')]=function(){return function(){return client['Request'](_0x3c39('0x2'),{'options':{'raw':![],'attributes':['id',_0x3c39('0x3'),_0x3c39('0x4'),_0x3c39('0x5')],'include':[{'model':_0x3c39('0x6'),'as':'Agents','attributes':['id','name',_0x3c39('0x7'),_0x3c39('0x8')]}]},'log':_0x3c39('0x1')});};}; \ No newline at end of file +var _0x0755=['name','timeout','strategy','User','Agents','online','faxPause','../client','getFaxQueues','GetFaxQueue'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0755,0x15b));var _0x5075=function(_0x3d3fde,_0x260b16){_0x3d3fde=_0x3d3fde-0x0;var _0x54b62e=_0x0755[_0x3d3fde];return _0x54b62e;};'use strict';var client=require(_0x5075('0x0'));exports[_0x5075('0x1')]=function(){return function(){return client['Request'](_0x5075('0x2'),{'options':{'raw':![],'attributes':['id',_0x5075('0x3'),_0x5075('0x4'),_0x5075('0x5')],'include':[{'model':_0x5075('0x6'),'as':_0x5075('0x7'),'attributes':['id',_0x5075('0x3'),_0x5075('0x8'),_0x5075('0x9')]}]},'log':_0x5075('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 4fd99d5..736ef2c 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 _0xad81=['UpdateFaxQueueReport','create','Request','CreateFaxQueueReport','update'];(function(_0x123601,_0x546b61){var _0x2d179b=function(_0x302c37){while(--_0x302c37){_0x123601['push'](_0x123601['shift']());}};_0x2d179b(++_0x546b61);}(_0xad81,0xfb));var _0x1ad8=function(_0x2c3e1c,_0x2130a5){_0x2c3e1c=_0x2c3e1c-0x0;var _0x4e34eb=_0xad81[_0x2c3e1c];return _0x4e34eb;};'use strict';var client=require('../client');exports[_0x1ad8('0x0')]=function(_0x28f9b0){return client[_0x1ad8('0x1')]('CreateFaxQueueReport',{'body':_0x28f9b0,'log':_0x1ad8('0x2')});};exports[_0x1ad8('0x3')]=function(_0x3e4214,_0x177f40){return client[_0x1ad8('0x1')]('UpdateFaxQueueReport',{'body':_0x177f40,'options':{'where':{'uniqueid':_0x3e4214},'order':[['id','DESC']],'limit':0x1},'log':_0x1ad8('0x4')});}; \ No newline at end of file +var _0xe288=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','update','DESC'];(function(_0x547e20,_0x284545){var _0x359171=function(_0x590250){while(--_0x590250){_0x547e20['push'](_0x547e20['shift']());}};_0x359171(++_0x284545);}(_0xe288,0x104));var _0x8e28=function(_0x527eef,_0x386ebb){_0x527eef=_0x527eef-0x0;var _0x4903cc=_0xe288[_0x527eef];return _0x4903cc;};'use strict';var client=require(_0x8e28('0x0'));exports[_0x8e28('0x1')]=function(_0x1ff394){return client[_0x8e28('0x2')](_0x8e28('0x3'),{'body':_0x1ff394,'log':_0x8e28('0x3')});};exports[_0x8e28('0x4')]=function(_0x453f88,_0x1ce6ac){return client[_0x8e28('0x2')]('UpdateFaxQueueReport',{'body':_0x1ce6ac,'options':{'where':{'uniqueid':_0x453f88},'order':[['id',_0x8e28('0x5')]],'limit':0x1},'log':_0x8e28('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index a5d43f9..1f03eff 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 _0xf4f4=['getIntervals','GetInterval','name','Interval','Intervals','../client'];(function(_0x161d41,_0x306119){var _0x21daf6=function(_0x1429fa){while(--_0x1429fa){_0x161d41['push'](_0x161d41['shift']());}};_0x21daf6(++_0x306119);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x12e35c,_0x10a309){_0x12e35c=_0x12e35c-0x0;var _0x40335c=_0xf4f4[_0x12e35c];return _0x40335c;};'use strict';var client=require(_0x4f4f('0x0'));exports[_0x4f4f('0x1')]=function(){return function(){return client['Request'](_0x4f4f('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x4f4f('0x3')],'include':[{'model':_0x4f4f('0x4'),'as':_0x4f4f('0x5'),'attributes':['id',_0x4f4f('0x3'),'interval']}]},'log':_0x4f4f('0x1')});};}; \ No newline at end of file +var _0xa7fa=['../client','GetInterval','name','Interval','Intervals','interval','getIntervals'];(function(_0x32ebaf,_0x4e03ce){var _0x436b62=function(_0x3e374f){while(--_0x3e374f){_0x32ebaf['push'](_0x32ebaf['shift']());}};_0x436b62(++_0x4e03ce);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xaa7f('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0xaa7f('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xaa7f('0x2')],'include':[{'model':_0xaa7f('0x3'),'as':_0xaa7f('0x4'),'attributes':['id','name',_0xaa7f('0x5')]}]},'log':_0xaa7f('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index e1a027d..cdb46db 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 _0x0480=['Request','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','updateMailInteraction','addTags'];(function(_0x6b658b,_0xd739c){var _0x546719=function(_0x20dd83){while(--_0x20dd83){_0x6b658b['push'](_0x6b658b['shift']());}};_0x546719(++_0xd739c);}(_0x0480,0x1f4));var _0x0048=function(_0x45374b,_0x2c3b51){_0x45374b=_0x45374b-0x0;var _0x1fb51=_0x0480[_0x45374b];return _0x1fb51;};'use strict';var client=require(_0x0048('0x0'));exports[_0x0048('0x1')]=function(_0x29419e,_0x318884){return client['Request']('UpdateMailInteraction',{'body':_0x318884,'options':{'where':{'id':_0x29419e}},'log':_0x0048('0x2')});};exports[_0x0048('0x3')]=function(_0x37f1dc,_0x171c93){return client[_0x0048('0x4')](_0x0048('0x5'),{'body':_0x171c93,'options':{'where':{'id':_0x37f1dc}},'log':_0x0048('0x6')});}; \ No newline at end of file +var _0x82b7=['../client','update','Request','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x1602af,_0x540e07){var _0x3c088e=function(_0x1be346){while(--_0x1be346){_0x1602af['push'](_0x1602af['shift']());}};_0x3c088e(++_0x540e07);}(_0x82b7,0xd2));var _0x782b=function(_0x2348d0,_0x1ea2bd){_0x2348d0=_0x2348d0-0x0;var _0x1c4283=_0x82b7[_0x2348d0];return _0x1c4283;};'use strict';var client=require(_0x782b('0x0'));exports[_0x782b('0x1')]=function(_0x4cea89,_0x5071bd){return client[_0x782b('0x2')]('UpdateMailInteraction',{'body':_0x5071bd,'options':{'where':{'id':_0x4cea89}},'log':_0x782b('0x3')});};exports[_0x782b('0x4')]=function(_0x1d7562,_0x20a2a2){return client['Request'](_0x782b('0x5'),{'body':_0x20a2a2,'options':{'where':{'id':_0x1d7562}},'log':_0x782b('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 3931776..50873c7 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 _0xa232=['createMailMessage','../client','Request'];(function(_0x47e6ee,_0x256847){var _0x5c19bc=function(_0x3c8020){while(--_0x3c8020){_0x47e6ee['push'](_0x47e6ee['shift']());}};_0x5c19bc(++_0x256847);}(_0xa232,0xf4));var _0x2a23=function(_0x4a1701,_0x313a9f){_0x4a1701=_0x4a1701-0x0;var _0x90a62f=_0xa232[_0x4a1701];return _0x90a62f;};'use strict';var client=require(_0x2a23('0x0'));exports['create']=function(_0x157471){return client[_0x2a23('0x1')]('CreateMailMessage',{'body':_0x157471,'log':_0x2a23('0x2')});}; \ No newline at end of file +var _0x813e=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0xb0fe92,_0x147e42){var _0x41787f=function(_0x42ae35){while(--_0x42ae35){_0xb0fe92['push'](_0xb0fe92['shift']());}};_0x41787f(++_0x147e42);}(_0x813e,0x15b));var _0xe813=function(_0x491842,_0x4ca9af){_0x491842=_0x491842-0x0;var _0x54b04e=_0x813e[_0x491842];return _0x54b04e;};'use strict';var client=require(_0xe813('0x0'));exports[_0xe813('0x1')]=function(_0xbe908){return client[_0xe813('0x2')](_0xe813('0x3'),{'body':_0xbe908,'log':_0xe813('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index a826933..bdacc2f 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 _0x5787=['online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','Agents'];(function(_0x1af681,_0x56dcb1){var _0x23684e=function(_0x5721ac){while(--_0x5721ac){_0x1af681['push'](_0x1af681['shift']());}};_0x23684e(++_0x56dcb1);}(_0x5787,0x1e2));var _0x7578=function(_0x5ba129,_0x5e24c2){_0x5ba129=_0x5ba129-0x0;var _0x21073d=_0x5787[_0x5ba129];return _0x21073d;};'use strict';var client=require(_0x7578('0x0'));exports[_0x7578('0x1')]=function(){return function(){return client[_0x7578('0x2')](_0x7578('0x3'),{'options':{'raw':![],'attributes':['id',_0x7578('0x4'),_0x7578('0x5'),_0x7578('0x6')],'include':[{'model':'User','as':_0x7578('0x7'),'attributes':['id',_0x7578('0x4'),_0x7578('0x8'),_0x7578('0x9')]}]},'log':_0x7578('0x1')});};}; \ No newline at end of file +var _0x280e=['../client','getMailQueues','name','timeout','User','online','mailPause'];(function(_0x838bd5,_0x68e087){var _0x425efb=function(_0x3a1005){while(--_0x3a1005){_0x838bd5['push'](_0x838bd5['shift']());}};_0x425efb(++_0x68e087);}(_0x280e,0xd2));var _0xe280=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x280e[_0xa1e3e3];return _0xc980e9;};'use strict';var client=require(_0xe280('0x0'));exports[_0xe280('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xe280('0x2'),_0xe280('0x3'),'strategy'],'include':[{'model':_0xe280('0x4'),'as':'Agents','attributes':['id','name',_0xe280('0x5'),_0xe280('0x6')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index e168d8a..0f365a2 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 _0x8957=['create','Request','CreateMailQueueReport','update','DESC','../client'];(function(_0x477c0c,_0x48b400){var _0x37d540=function(_0x2d95e2){while(--_0x2d95e2){_0x477c0c['push'](_0x477c0c['shift']());}};_0x37d540(++_0x48b400);}(_0x8957,0x185));var _0x7895=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x8957[_0x55f8b4];return _0x2475f9;};'use strict';var client=require(_0x7895('0x0'));exports[_0x7895('0x1')]=function(_0x2c92d2){return client[_0x7895('0x2')]('CreateMailQueueReport',{'body':_0x2c92d2,'log':_0x7895('0x3')});};exports[_0x7895('0x4')]=function(_0x50da67,_0x42c6cc){return client[_0x7895('0x2')]('UpdateMailQueueReport',{'body':_0x42c6cc,'options':{'where':{'uniqueid':_0x50da67},'order':[['id',_0x7895('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x1c75=['UpdateMailQueueReport','DESC','create','CreateMailQueueReport','update','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c75,0x92));var _0x51c7=function(_0xe66f5a,_0x20056b){_0xe66f5a=_0xe66f5a-0x0;var _0x9f6f71=_0x1c75[_0xe66f5a];return _0x9f6f71;};'use strict';var client=require('../client');exports[_0x51c7('0x0')]=function(_0x6a921){return client['Request'](_0x51c7('0x1'),{'body':_0x6a921,'log':_0x51c7('0x1')});};exports[_0x51c7('0x2')]=function(_0x4fa2b3,_0x2e2419){return client[_0x51c7('0x3')](_0x51c7('0x4'),{'body':_0x2e2419,'options':{'where':{'uniqueid':_0x4fa2b3},'order':[['id',_0x51c7('0x5')]],'limit':0x1},'log':_0x51c7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 10070df..6261881 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 _0xdad4=['addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x36e709,_0x2a703b){var _0x5d687d=function(_0x3c2934){while(--_0x3c2934){_0x36e709['push'](_0x36e709['shift']());}};_0x5d687d(++_0x2a703b);}(_0xdad4,0x159));var _0x4dad=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xdad4[_0x313c96];return _0x522f53;};'use strict';var client=require(_0x4dad('0x0'));exports[_0x4dad('0x1')]=function(_0x1abace,_0x25664f){return client[_0x4dad('0x2')](_0x4dad('0x3'),{'body':_0x25664f,'options':{'where':{'id':_0x1abace}},'log':_0x4dad('0x4')});};exports[_0x4dad('0x5')]=function(_0x588335,_0x265c06){return client[_0x4dad('0x2')](_0x4dad('0x6'),{'body':_0x265c06,'options':{'where':{'id':_0x588335}},'log':_0x4dad('0x7')});}; \ No newline at end of file +var _0x6009=['Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x38e233,_0x574714){var _0x5e7ea5=function(_0x4be59e){while(--_0x4be59e){_0x38e233['push'](_0x38e233['shift']());}};_0x5e7ea5(++_0x574714);}(_0x6009,0xd7));var _0x9600=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0x6009[_0x1c6ef2];return _0x404b8c;};'use strict';var client=require('../client');exports['update']=function(_0x4be822,_0x5a1d80){return client[_0x9600('0x0')](_0x9600('0x1'),{'body':_0x5a1d80,'options':{'where':{'id':_0x4be822}},'log':'updateOpenchannelInteraction'});};exports[_0x9600('0x2')]=function(_0x468590,_0x289085){return client['Request'](_0x9600('0x3'),{'body':_0x289085,'options':{'where':{'id':_0x468590}},'log':_0x9600('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 3112e35..0802977 100644 --- a/server/services/routing/rpc/openchannelMessage.js +++ b/server/services/routing/rpc/openchannelMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['createOpenchannelMessage','Request','CreateOpenchannelMessage'];(function(_0x1942c6,_0x33c10c){var _0x19f02b=function(_0x203769){while(--_0x203769){_0x1942c6['push'](_0x1942c6['shift']());}};_0x19f02b(++_0x33c10c);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x2')});}; \ No newline at end of file +var _0xe706=['create','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x32ffb5,_0x3866b5){var _0x3cbd7a=function(_0x42315b){while(--_0x42315b){_0x32ffb5['push'](_0x32ffb5['shift']());}};_0x3cbd7a(++_0x3866b5);}(_0xe706,0xa3));var _0x6e70=function(_0x25ffd4,_0x16b31d){_0x25ffd4=_0x25ffd4-0x0;var _0x414452=_0xe706[_0x25ffd4];return _0x414452;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(_0x311951){return client['Request'](_0x6e70('0x2'),{'body':_0x311951,'log':_0x6e70('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 7a15c08..a23725a 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 _0x1e1a=['strategy','name','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout'];(function(_0x5c2554,_0xc79f27){var _0x4488d3=function(_0x5ad451){while(--_0x5ad451){_0x5c2554['push'](_0x5c2554['shift']());}};_0x4488d3(++_0xc79f27);}(_0x1e1a,0x1a2));var _0xa1e1=function(_0x467e6c,_0x476048){_0x467e6c=_0x467e6c-0x0;var _0x4a6c03=_0x1e1a[_0x467e6c];return _0x4a6c03;};'use strict';var client=require(_0xa1e1('0x0'));exports[_0xa1e1('0x1')]=function(){return function(){return client[_0xa1e1('0x2')](_0xa1e1('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xa1e1('0x4'),_0xa1e1('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xa1e1('0x6'),_0xa1e1('0x7'),_0xa1e1('0x8')]}]},'log':_0xa1e1('0x1')});};}; \ No newline at end of file +var _0x2a65=['name','online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','User','Agents'];(function(_0x4d0c16,_0x3da4de){var _0x5212e0=function(_0x575ab4){while(--_0x575ab4){_0x4d0c16['push'](_0x4d0c16['shift']());}};_0x5212e0(++_0x3da4de);}(_0x2a65,0x158));var _0x52a6=function(_0x312b37,_0x19f474){_0x312b37=_0x312b37-0x0;var _0x2e5f91=_0x2a65[_0x312b37];return _0x2e5f91;};'use strict';var client=require(_0x52a6('0x0'));exports[_0x52a6('0x1')]=function(){return function(){return client[_0x52a6('0x2')](_0x52a6('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x52a6('0x4'),'strategy'],'include':[{'model':_0x52a6('0x5'),'as':_0x52a6('0x6'),'attributes':['id',_0x52a6('0x7'),_0x52a6('0x8'),'openchannelPause']}]},'log':_0x52a6('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 434975d..9323a53 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 _0x0c9b=['DESC','../client','create','CreateOpenchannelQueueReport','Request','UpdateOpenchannelQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c9b,0x1c3));var _0xb0c9=function(_0x234615,_0x395a66){_0x234615=_0x234615-0x0;var _0x265f5e=_0x0c9b[_0x234615];return _0x265f5e;};'use strict';var client=require(_0xb0c9('0x0'));exports[_0xb0c9('0x1')]=function(_0x16ffd5){return client['Request'](_0xb0c9('0x2'),{'body':_0x16ffd5,'log':_0xb0c9('0x2')});};exports['update']=function(_0x38584c,_0x5470d3){return client[_0xb0c9('0x3')](_0xb0c9('0x4'),{'body':_0x5470d3,'options':{'where':{'uniqueid':_0x38584c},'order':[['id',_0xb0c9('0x5')]],'limit':0x1},'log':_0xb0c9('0x4')});}; \ No newline at end of file +var _0x59ee=['UpdateOpenchannelQueueReport','DESC','Request','CreateOpenchannelQueueReport','update'];(function(_0x367284,_0x26688c){var _0xe5c015=function(_0x19705e){while(--_0x19705e){_0x367284['push'](_0x367284['shift']());}};_0xe5c015(++_0x26688c);}(_0x59ee,0x192));var _0xe59e=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x59ee[_0x9cd4c3];return _0x4c9025;};'use strict';var client=require('../client');exports['create']=function(_0x4afb87){return client[_0xe59e('0x0')](_0xe59e('0x1'),{'body':_0x4afb87,'log':_0xe59e('0x1')});};exports[_0xe59e('0x2')]=function(_0x3b0331,_0x1255ec){return client[_0xe59e('0x0')](_0xe59e('0x3'),{'body':_0x1255ec,'options':{'where':{'uniqueid':_0x3b0331},'order':[['id',_0xe59e('0x4')]],'limit':0x1},'log':_0xe59e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 804c70c..9e3c98f 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 _0x0cde=['update','Request','UpdateSmsInteraction','addTags','addTagsToSmsInteraction','../client'];(function(_0x31796c,_0x31377d){var _0x1a4dfc=function(_0xff9ffd){while(--_0xff9ffd){_0x31796c['push'](_0x31796c['shift']());}};_0x1a4dfc(++_0x31377d);}(_0x0cde,0x1df));var _0xe0cd=function(_0x52ca67,_0x389983){_0x52ca67=_0x52ca67-0x0;var _0x3e0e39=_0x0cde[_0x52ca67];return _0x3e0e39;};'use strict';var client=require(_0xe0cd('0x0'));exports[_0xe0cd('0x1')]=function(_0x125d2e,_0x10c57e){return client[_0xe0cd('0x2')](_0xe0cd('0x3'),{'body':_0x10c57e,'options':{'where':{'id':_0x125d2e}},'log':'updateSmsInteraction'});};exports[_0xe0cd('0x4')]=function(_0x5162f0,_0x5a5c1c){return client[_0xe0cd('0x2')]('AddTagsToSmsInteraction',{'body':_0x5a5c1c,'options':{'where':{'id':_0x5162f0}},'log':_0xe0cd('0x5')});}; \ No newline at end of file +var _0x43b7=['addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x406e46,_0x5799cb){var _0x4a3742=function(_0x1fa435){while(--_0x1fa435){_0x406e46['push'](_0x406e46['shift']());}};_0x4a3742(++_0x5799cb);}(_0x43b7,0x1b3));var _0x743b=function(_0x1cfc24,_0x41b8f6){_0x1cfc24=_0x1cfc24-0x0;var _0x2e0f60=_0x43b7[_0x1cfc24];return _0x2e0f60;};'use strict';var client=require(_0x743b('0x0'));exports['update']=function(_0x58a788,_0x4a434e){return client[_0x743b('0x1')](_0x743b('0x2'),{'body':_0x4a434e,'options':{'where':{'id':_0x58a788}},'log':_0x743b('0x3')});};exports[_0x743b('0x4')]=function(_0x2cef8d,_0x24ef01){return client['Request'](_0x743b('0x5'),{'body':_0x24ef01,'options':{'where':{'id':_0x2cef8d}},'log':_0x743b('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index f779771..364154c 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 _0x1c4f=['../client','create','CreateSmsMessage','createSmsMessage'];(function(_0x7bc837,_0x1bd90a){var _0x29dd0e=function(_0x5d8918){while(--_0x5d8918){_0x7bc837['push'](_0x7bc837['shift']());}};_0x29dd0e(++_0x1bd90a);}(_0x1c4f,0x1f4));var _0xf1c4=function(_0x1806ac,_0x17b0f7){_0x1806ac=_0x1806ac-0x0;var _0xa40e30=_0x1c4f[_0x1806ac];return _0xa40e30;};'use strict';var client=require(_0xf1c4('0x0'));exports[_0xf1c4('0x1')]=function(_0x3932f7){return client['Request'](_0xf1c4('0x2'),{'body':_0x3932f7,'log':_0xf1c4('0x3')});}; \ No newline at end of file +var _0xdbca=['../client','Request','CreateSmsMessage','createSmsMessage'];(function(_0x1866ea,_0x547489){var _0x34f90a=function(_0x2b9a5c){while(--_0x2b9a5c){_0x1866ea['push'](_0x1866ea['shift']());}};_0x34f90a(++_0x547489);}(_0xdbca,0x150));var _0xadbc=function(_0x1103c4,_0x562d1d){_0x1103c4=_0x1103c4-0x0;var _0x1c19ab=_0xdbca[_0x1103c4];return _0x1c19ab;};'use strict';var client=require(_0xadbc('0x0'));exports['create']=function(_0x2b1e00){return client[_0xadbc('0x1')](_0xadbc('0x2'),{'body':_0x2b1e00,'log':_0xadbc('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 8bf58ad..004b3e6 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 _0xe71c=['User','Agents','online','smsPause','getSmsQueues','Request','GetSmsQueue','name','timeout'];(function(_0x100767,_0x23cd89){var _0x2745ae=function(_0x430225){while(--_0x430225){_0x100767['push'](_0x100767['shift']());}};_0x2745ae(++_0x23cd89);}(_0xe71c,0x1e1));var _0xce71=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xe71c[_0xdc37a1];return _0x99b4fe;};'use strict';var client=require('../client');exports[_0xce71('0x0')]=function(){return function(){return client[_0xce71('0x1')](_0xce71('0x2'),{'options':{'raw':![],'attributes':['id',_0xce71('0x3'),_0xce71('0x4'),'strategy'],'include':[{'model':_0xce71('0x5'),'as':_0xce71('0x6'),'attributes':['id',_0xce71('0x3'),_0xce71('0x7'),_0xce71('0x8')]}]},'log':_0xce71('0x0')});};}; \ No newline at end of file +var _0x0e4b=['strategy','User','name','online','smsPause','getSmsQueues','../client','Request','timeout'];(function(_0x520fc7,_0x207bee){var _0x14d40a=function(_0x2af7ef){while(--_0x2af7ef){_0x520fc7['push'](_0x520fc7['shift']());}};_0x14d40a(++_0x207bee);}(_0x0e4b,0x1d1));var _0xb0e4=function(_0x1aade5,_0x28d424){_0x1aade5=_0x1aade5-0x0;var _0x538d6d=_0x0e4b[_0x1aade5];return _0x538d6d;};'use strict';var client=require(_0xb0e4('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0xb0e4('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0xb0e4('0x2'),_0xb0e4('0x3')],'include':[{'model':_0xb0e4('0x4'),'as':'Agents','attributes':['id',_0xb0e4('0x5'),_0xb0e4('0x6'),_0xb0e4('0x7')]}]},'log':_0xb0e4('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 476f691..f99e98d 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 _0x660e=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client'];(function(_0x2fd876,_0x5911e1){var _0x5d1812=function(_0x4209d5){while(--_0x4209d5){_0x2fd876['push'](_0x2fd876['shift']());}};_0x5d1812(++_0x5911e1);}(_0x660e,0xf7));var _0xe660=function(_0x113297,_0xe2c43a){_0x113297=_0x113297-0x0;var _0x1a2701=_0x660e[_0x113297];return _0x1a2701;};'use strict';var client=require(_0xe660('0x0'));exports['create']=function(_0x4729fd){return client['Request'](_0xe660('0x1'),{'body':_0x4729fd,'log':_0xe660('0x1')});};exports['update']=function(_0x483e2f,_0x24a0fd){return client['Request'](_0xe660('0x2'),{'body':_0x24a0fd,'options':{'where':{'uniqueid':_0x483e2f},'order':[['id',_0xe660('0x3')]],'limit':0x1},'log':_0xe660('0x2')});}; \ No newline at end of file +var _0xed3c=['UpdateSmsQueueReport','DESC','../client','create','Request','CreateSmsQueueReport','update'];(function(_0x350f58,_0x54efda){var _0x370e27=function(_0x18a034){while(--_0x18a034){_0x350f58['push'](_0x350f58['shift']());}};_0x370e27(++_0x54efda);}(_0xed3c,0x1a6));var _0xced3=function(_0x185063,_0x3f0bb7){_0x185063=_0x185063-0x0;var _0x16d9d3=_0xed3c[_0x185063];return _0x16d9d3;};'use strict';var client=require(_0xced3('0x0'));exports[_0xced3('0x1')]=function(_0xa7adca){return client[_0xced3('0x2')]('CreateSmsQueueReport',{'body':_0xa7adca,'log':_0xced3('0x3')});};exports[_0xced3('0x4')]=function(_0x14488e,_0x5f03e0){return client['Request'](_0xced3('0x5'),{'body':_0x5f03e0,'options':{'where':{'uniqueid':_0x14488e},'order':[['id',_0xced3('0x6')]],'limit':0x1},'log':_0xced3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 98e4f31..adff425 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 _0x54d9=['online','voicePause','mailPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','openchannelCapacity','../client','getAgents','Request','GetUser','agent','name'];(function(_0x17de8e,_0x41ad4c){var _0x39aba5=function(_0x255320){while(--_0x255320){_0x17de8e['push'](_0x17de8e['shift']());}};_0x39aba5(++_0x41ad4c);}(_0x54d9,0x1ba));var _0x954d=function(_0x351bd5,_0x442fea){_0x351bd5=_0x351bd5-0x0;var _0x51db10=_0x54d9[_0x351bd5];return _0x51db10;};'use strict';var client=require(_0x954d('0x0'));exports[_0x954d('0x1')]=function(){return function(){return client[_0x954d('0x2')](_0x954d('0x3'),{'options':{'raw':!![],'where':{'role':_0x954d('0x4')},'attributes':['id',_0x954d('0x5'),_0x954d('0x6'),'pauseType','lastPauseAt',_0x954d('0x7'),'chatPause',_0x954d('0x8'),'faxPause','smsPause',_0x954d('0x9'),_0x954d('0xa'),_0x954d('0xb'),_0x954d('0xc'),'smsCapacity',_0x954d('0xd')]},'log':_0x954d('0x1')});};}; \ No newline at end of file +var _0x438e=['getAgents','Request','name','online','pauseType','lastPauseAt','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','openchannelCapacity','../client'];(function(_0x2cbc97,_0x138d19){var _0x252f91=function(_0x56d978){while(--_0x56d978){_0x2cbc97['push'](_0x2cbc97['shift']());}};_0x252f91(++_0x138d19);}(_0x438e,0x167));var _0xe438=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x438e[_0x1cbcf1];return _0x3a06f0;};'use strict';var client=require(_0xe438('0x0'));exports[_0xe438('0x1')]=function(){return function(){return client[_0xe438('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0xe438('0x3'),_0xe438('0x4'),_0xe438('0x5'),_0xe438('0x6'),'voicePause',_0xe438('0x7'),_0xe438('0x8'),_0xe438('0x9'),_0xe438('0xa'),_0xe438('0xb'),_0xe438('0xc'),_0xe438('0xd'),'faxCapacity','smsCapacity',_0xe438('0xe')]},'log':'getAgents'});};}; \ 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 d8bd804..739943d 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 _0x4b77=['info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','string','number','timeout\x20is\x20a\x20number'];(function(_0x5c658b,_0x550dce){var _0x3ca95f=function(_0xa6aca8){while(--_0xa6aca8){_0x5c658b['push'](_0x5c658b['shift']());}};_0x3ca95f(++_0x550dce);}(_0x4b77,0x108));var _0x74b7=function(_0x4620f3,_0x5961fc){_0x4620f3=_0x4620f3-0x0;var _0x18f504=_0x4b77[_0x4620f3];return _0x18f504;};'use strict';var schema=require(_0x74b7('0x0'));var _=require(_0x74b7('0x1'));var util=require(_0x74b7('0x2'));var seqqueue=require(_0x74b7('0x3'));var logger=require(_0x74b7('0x4'))(_0x74b7('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x74b7('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x74b7('0x7'),'message':_0x74b7('0x8')}});function writeLog(_0x4df968,_0x42d9c5,_0x816179){return logger[_0x74b7('0x9')](util[_0x74b7('0xa')](_0x74b7('0xb'),_0x4df968,_0x42d9c5[_0x74b7('0xc')],_0x816179));}function handleFindAgent(_0x1a0bcc){return function(_0x2ad7de){return _0x2ad7de[_0x74b7('0xc')][_0x74b7('0xd')]()===_0x1a0bcc[_0x74b7('0xd')]();};}exports[_0x74b7('0xe')]=function(_0x2a1a72,_0x1c0499,_0x42b5ad,_0x578174){return function(_0x23bdd9){try{var _0x5ba49a={'name':_0x1c0499[0x0],'timeout':_0x1c0499[0x1]};var _0x2e674a=queue[_0x74b7('0x0')](_0x5ba49a,{'typecast':!![]});if(_0x2e674a[_0x74b7('0xf')]){logger['error'](_0x74b7('0x10'),_0x2a1a72,_[_0x74b7('0x11')](_0x2e674a,_0x74b7('0x12'))[_0x74b7('0x13')](',\x20'));_0x23bdd9[_0x74b7('0x14')]();}else{var _0x322c6c=_['find'](_0x42b5ad[_0x74b7('0x15')],handleFindAgent(_0x5ba49a[_0x74b7('0xc')]));if(_0x322c6c){var _0x2e4c08=(_0x5ba49a[_0x74b7('0x16')]||0xa)*0x3e8;var _0x2daccb,_0x195a4b;var _0x338fb5=seqqueue[_0x74b7('0x17')](_0x2e4c08);_0x338fb5['id']=_0x2a1a72;_0x338fb5[_0x74b7('0x18')]=_0x2e4c08;_0x338fb5[_0x74b7('0x19')]=_0x578174[_0x74b7('0x19')];writeLog(_0x2a1a72,_0x322c6c,util['format'](_0x74b7('0x1a'),_0x2e4c08));_0x42b5ad[_0x74b7('0x1b')][_0x2a1a72]['on'](_0x74b7('0x1c'),function(){logger['info'](_0x74b7('0x1d'),_0x2a1a72);clearTimeout(_0x195a4b);_0x195a4b=undefined;_0x338fb5['close']();if(_0x42b5ad[_0x74b7('0x1b')][_0x2a1a72]){delete _0x42b5ad[_0x74b7('0x1b')][_0x2a1a72];}_0x23bdd9[_0x74b7('0x14')]();});_0x42b5ad['rules'][_0x2a1a72]['on'](_0x74b7('0x1e'),function(){if(_0x42b5ad['rules'][_0x2a1a72]){delete _0x42b5ad[_0x74b7('0x1b')][_0x2a1a72];}});_0x195a4b=setTimeout(function(){logger['info'](_0x74b7('0x1f'),_0x2a1a72);clearTimeout(_0x195a4b);_0x338fb5[_0x74b7('0x20')]();_0x23bdd9[_0x74b7('0x21')]();},_0x2e4c08);strategy[_0x74b7('0x22')](_0x338fb5,_0x322c6c,_0x42b5ad,_0x578174);}else{logger['error'](_0x74b7('0x23'),_0x2a1a72,_0x5ba49a['name']);_0x23bdd9[_0x74b7('0x14')]();}}}catch(_0x2f7166){console[_0x74b7('0x24')](_0x2f7166);logger['error'](_0x74b7('0x25'),_0x2a1a72,_0x2f7166[_0x74b7('0x26')]);_0x23bdd9[_0x74b7('0x14')]();}};}; \ No newline at end of file +var _0xcde6=['[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','number','timeout\x20is\x20a\x20number','info','format'];(function(_0x5c7522,_0xe2f5a3){var _0x3a6f0a=function(_0xe2af07){while(--_0xe2af07){_0x5c7522['push'](_0x5c7522['shift']());}};_0x3a6f0a(++_0xe2f5a3);}(_0xcde6,0xc8));var _0x6cde=function(_0x552f5e,_0xf0e465){_0x552f5e=_0x552f5e-0x0;var _0x17c078=_0xcde6[_0x552f5e];return _0x17c078;};'use strict';var schema=require(_0x6cde('0x0'));var _=require(_0x6cde('0x1'));var util=require(_0x6cde('0x2'));var seqqueue=require(_0x6cde('0x3'));var logger=require(_0x6cde('0x4'))(_0x6cde('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x6cde('0x6'),'message':_0x6cde('0x7')}});function writeLog(_0x369090,_0x55cbd7,_0x448c9b){return logger[_0x6cde('0x8')](util[_0x6cde('0x9')](_0x6cde('0xa'),_0x369090,_0x55cbd7[_0x6cde('0xb')],_0x448c9b));}function handleFindAgent(_0x5602b7){return function(_0xe68af4){return _0xe68af4['name'][_0x6cde('0xc')]()===_0x5602b7[_0x6cde('0xc')]();};}exports[_0x6cde('0xd')]=function(_0x38f32c,_0x5f3a3f,_0x58f01b,_0x43a3f1){return function(_0x50699e){try{var _0x156d6a={'name':_0x5f3a3f[0x0],'timeout':_0x5f3a3f[0x1]};var _0x2cbd58=queue[_0x6cde('0x0')](_0x156d6a,{'typecast':!![]});if(_0x2cbd58[_0x6cde('0xe')]){logger[_0x6cde('0xf')](_0x6cde('0x10'),_0x38f32c,_['map'](_0x2cbd58,_0x6cde('0x11'))[_0x6cde('0x12')](',\x20'));_0x50699e[_0x6cde('0x13')]();}else{var _0x28841b=_[_0x6cde('0x14')](_0x58f01b[_0x6cde('0x15')],handleFindAgent(_0x156d6a['name']));if(_0x28841b){var _0x3073ce=(_0x156d6a['timeout']||0xa)*0x3e8;var _0x582fc1,_0x54f8e2;var _0x491984=seqqueue['createQueue'](_0x3073ce);_0x491984['id']=_0x38f32c;_0x491984['atimeout']=_0x3073ce;_0x491984[_0x6cde('0x16')]=_0x43a3f1[_0x6cde('0x16')];writeLog(_0x38f32c,_0x28841b,util[_0x6cde('0x9')](_0x6cde('0x17'),_0x3073ce));_0x58f01b[_0x6cde('0x18')][_0x38f32c]['on'](_0x6cde('0x19'),function(){logger[_0x6cde('0x8')](_0x6cde('0x1a'),_0x38f32c);clearTimeout(_0x54f8e2);_0x54f8e2=undefined;_0x491984[_0x6cde('0x1b')]();if(_0x58f01b[_0x6cde('0x18')][_0x38f32c]){delete _0x58f01b[_0x6cde('0x18')][_0x38f32c];}_0x50699e[_0x6cde('0x13')]();});_0x58f01b['rules'][_0x38f32c]['on'](_0x6cde('0x1c'),function(){if(_0x58f01b[_0x6cde('0x18')][_0x38f32c]){delete _0x58f01b[_0x6cde('0x18')][_0x38f32c];}});_0x54f8e2=setTimeout(function(){logger[_0x6cde('0x8')](_0x6cde('0x1d'),_0x38f32c);clearTimeout(_0x54f8e2);_0x491984[_0x6cde('0x1b')]();_0x50699e[_0x6cde('0x1e')]();},_0x3073ce);strategy[_0x6cde('0x1f')](_0x491984,_0x28841b,_0x58f01b,_0x43a3f1);}else{logger[_0x6cde('0xf')](_0x6cde('0x20'),_0x38f32c,_0x156d6a[_0x6cde('0xb')]);_0x50699e[_0x6cde('0x13')]();}}}catch(_0x119862){console[_0x6cde('0x21')](_0x119862);logger[_0x6cde('0xf')]('[%s][QUEUE]\x20%s',_0x38f32c,_0x119862[_0x6cde('0x22')]);_0x50699e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 937f7ae..a250cef 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 _0x3012=['InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','format','out','chat','ChatWebsiteId','account','upperFirst','AccountId'];(function(_0x1a6315,_0x118195){var _0x1efbfa=function(_0x272823){while(--_0x272823){_0x1a6315['push'](_0x1a6315['shift']());}};_0x1efbfa(++_0x118195);}(_0x3012,0x199));var _0x2301=function(_0x110782,_0x3a0236){_0x110782=_0x110782-0x0;var _0x20d9d1=_0x3012[_0x110782];return _0x20d9d1;};'use strict';var _=require(_0x2301('0x0'));var moment=require(_0x2301('0x1'));var AWS=require(_0x2301('0x2'));var utils=require(_0x2301('0x3'));var logger=require(_0x2301('0x4'))('routing');var rpc={'chatMessage':require(_0x2301('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2301('0x6')),'smsMessage':require(_0x2301('0x7')),'faxMessage':require('../../rpc/faxMessage')};exports['consequence']=function(_0x4e1022,_0x2d74b7){return function(_0x31962c){try{if(!_[_0x2301('0x8')](this[_0x2301('0x9')][_0x2301('0xa')])){logger[_0x2301('0xb')](_0x2301('0xc'),_0x4e1022,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x31962c[_0x2301('0xd')]();}var _0x127c64={'ContactId':this['contact']['id'],'sentAt':moment()[_0x2301('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2301('0xf')};var _0x118361=this['channel'];if(_0x118361===_0x2301('0x10')){_0x127c64[_0x2301('0x11')]=this[_0x2301('0x12')]['id'];}else{_0x127c64[_[_0x2301('0x13')](_0x118361)+_0x2301('0x14')]=this[_0x2301('0x12')]['id'];}_0x127c64[_['upperFirst'](_0x118361)+_0x2301('0x15')]=this['interaction']['id'];if(this[_0x2301('0x9')][_0x2301('0x16')]){var _0x364ef3=_0x2d74b7[0x4];if(!_[_0x2301('0x17')](_0x364ef3)){_0x127c64['body']=utils[_0x2301('0x18')](_0x364ef3,this);return rpc[_0x118361+_0x2301('0x19')][_0x2301('0x1a')](_0x127c64)[_0x2301('0x1b')](function(_0x163ef8){logger[_0x2301('0xb')]('[%s][AMAZONLEX]\x20%s',_0x4e1022,_0x127c64[_0x2301('0x1c')]);})[_0x2301('0x1d')](function(_0x276a86){logger[_0x2301('0x1e')](_0x2301('0xc'),_0x4e1022,JSON[_0x2301('0x1f')](_0x276a86));})[_0x2301('0x20')](function(){logger['info'](_0x2301('0x21'),_0x4e1022);_0x31962c[_0x2301('0x22')]();});}else{logger[_0x2301('0xb')](_0x2301('0x23'),_0x4e1022);_0x31962c[_0x2301('0x22')]();}}else{var _0x231d94=this;var _0x4c7fd3=new AWS[(_0x2301('0x24'))]({'accessKeyId':_0x2d74b7[0x0],'secretAccessKey':_0x2d74b7[0x1],'region':_0x2d74b7[0x2]});var _0x4a2233={'botAlias':_0x2301('0x25'),'botName':_0x2d74b7[0x3],'inputText':this[_0x2301('0x26')][_0x2301('0x1c')],'userId':this[_0x2301('0x9')]['id'][_0x2301('0x27')]()};_0x4c7fd3[_0x2301('0x28')](_0x4a2233,function(_0x440f88,_0x269412){if(_0x440f88){logger['error']('[%s][AMAZONLEX]\x20%s',_0x4e1022,_0x440f88[_0x2301('0x26')]);_0x31962c[_0x2301('0xd')]();}else if(_0x269412&&_0x269412['message']){_0x231d94[_0x2301('0x1c')][_0x2301('0x29')]=_0x269412;_0x127c64[_0x2301('0x1c')]=_0x269412[_0x2301('0x26')];return rpc[_0x118361+_0x2301('0x19')]['create'](_0x127c64)[_0x2301('0x1b')](function(_0xcee65c){logger[_0x2301('0xb')](_0x2301('0xc'),_0x4e1022,_0x127c64['body']);if(_0x269412[_0x2301('0x2a')]=='Failed'){_0x31962c['next']();}else{_0x31962c[_0x2301('0x22')]();}})[_0x2301('0x1d')](function(_0x4f4867){logger[_0x2301('0x1e')](_0x2301('0xc'),_0x4e1022,JSON[_0x2301('0x1f')](_0x4f4867));_0x31962c['next']();});}else{_0x31962c['next']();}});}}catch(_0x1db37a){logger[_0x2301('0x1e')](_0x2301('0xc'),_0x4e1022,JSON['stringify'](_0x1db37a));_0x31962c[_0x2301('0x22')]();}};}; \ No newline at end of file +var _0xa407=['$LATEST','message','toString','postText','next','amazonlex','create','dialogState','Failed','catch','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','isEmpty','body','getMustacheRender','Message','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0xa407,0x64));var _0x7a40=function(_0xdb61ca,_0x158540){_0xdb61ca=_0xdb61ca-0x0;var _0x42c484=_0xa407[_0xdb61ca];return _0x42c484;};'use strict';var _=require('lodash');var moment=require(_0x7a40('0x0'));var AWS=require(_0x7a40('0x1'));var utils=require('./utils');var logger=require(_0x7a40('0x2'))(_0x7a40('0x3'));var rpc={'chatMessage':require(_0x7a40('0x4')),'openchannelMessage':require(_0x7a40('0x5')),'mailMessage':require(_0x7a40('0x6')),'smsMessage':require(_0x7a40('0x7')),'faxMessage':require(_0x7a40('0x8'))};exports[_0x7a40('0x9')]=function(_0x3b1414,_0x160270){return function(_0x3b948b){try{if(!_[_0x7a40('0xa')](this[_0x7a40('0xb')][_0x7a40('0xc')])){logger[_0x7a40('0xd')](_0x7a40('0xe'),_0x3b1414,_0x7a40('0xf'));return _0x3b948b['next']();}var _0x1061de={'ContactId':this[_0x7a40('0x10')]['id'],'sentAt':moment()[_0x7a40('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x7a40('0x12')};var _0x27d609=this[_0x7a40('0x13')];if(_0x27d609===_0x7a40('0x14')){_0x1061de[_0x7a40('0x15')]=this[_0x7a40('0x16')]['id'];}else{_0x1061de[_[_0x7a40('0x17')](_0x27d609)+_0x7a40('0x18')]=this['account']['id'];}_0x1061de[_[_0x7a40('0x17')](_0x27d609)+'InteractionId']=this[_0x7a40('0xb')]['id'];if(this[_0x7a40('0xb')]['created']){var _0x234764=_0x160270[0x4];if(!_[_0x7a40('0x19')](_0x234764)){_0x1061de[_0x7a40('0x1a')]=utils[_0x7a40('0x1b')](_0x234764,this);return rpc[_0x27d609+_0x7a40('0x1c')]['create'](_0x1061de)['then'](function(_0xd060b8){logger[_0x7a40('0xd')](_0x7a40('0xe'),_0x3b1414,_0x1061de[_0x7a40('0x1a')]);})['catch'](function(_0x3f56b1){logger[_0x7a40('0x1d')](_0x7a40('0xe'),_0x3b1414,JSON[_0x7a40('0x1e')](_0x3f56b1));})['finally'](function(){logger[_0x7a40('0xd')](_0x7a40('0x1f'),_0x3b1414);_0x3b948b[_0x7a40('0x20')]();});}else{logger['info'](_0x7a40('0x21'),_0x3b1414);_0x3b948b[_0x7a40('0x20')]();}}else{var _0x39117d=this;var _0x551974=new AWS[(_0x7a40('0x22'))]({'accessKeyId':_0x160270[0x0],'secretAccessKey':_0x160270[0x1],'region':_0x160270[0x2]});var _0x1a669d={'botAlias':_0x7a40('0x23'),'botName':_0x160270[0x3],'inputText':this[_0x7a40('0x24')][_0x7a40('0x1a')],'userId':this['interaction']['id'][_0x7a40('0x25')]()};_0x551974[_0x7a40('0x26')](_0x1a669d,function(_0x120897,_0xe82adb){if(_0x120897){logger[_0x7a40('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x3b1414,_0x120897['message']);_0x3b948b[_0x7a40('0x27')]();}else if(_0xe82adb&&_0xe82adb[_0x7a40('0x24')]){_0x39117d[_0x7a40('0x1a')][_0x7a40('0x28')]=_0xe82adb;_0x1061de[_0x7a40('0x1a')]=_0xe82adb['message'];return rpc[_0x27d609+_0x7a40('0x1c')][_0x7a40('0x29')](_0x1061de)['then'](function(_0x16bcd1){logger['info']('[%s][AMAZONLEX]\x20%s',_0x3b1414,_0x1061de[_0x7a40('0x1a')]);if(_0xe82adb[_0x7a40('0x2a')]==_0x7a40('0x2b')){_0x3b948b[_0x7a40('0x27')]();}else{_0x3b948b[_0x7a40('0x20')]();}})[_0x7a40('0x2c')](function(_0x4e89ae){logger[_0x7a40('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x3b1414,JSON['stringify'](_0x4e89ae));_0x3b948b[_0x7a40('0x27')]();});}else{_0x3b948b['next']();}});}}catch(_0x353f13){logger[_0x7a40('0x1d')](_0x7a40('0xe'),_0x3b1414,JSON[_0x7a40('0x1e')](_0x353f13));_0x3b948b['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 b38f3ac..3d1add5 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 _0xe706=['next','channel','getMustacheRender','YYYY-MM-DD\x20HH:mm:ss','out','message','from','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','body','';return mailRpc[_0x6e70('0x33')](_0x228350,_0x37b3e0)['then'](function(_0x259486){logger['info'](_0x6e70('0x34'),_0x1b0389);_0x37b3e0[_0x6e70('0x2c')]=_0x259486[_0x6e70('0x16')]['messageId'];return rpc[_0x743eb5+_0x6e70('0x22')][_0x6e70('0x35')](_0x37b3e0);})['then'](function(_0x13d673){logger[_0x6e70('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1b0389,JSON[_0x6e70('0x36')](_0x13d673));})[_0x6e70('0x37')](function(_0x2d52bd){logger[_0x6e70('0x38')](_0x6e70('0x39'),_0x1b0389,JSON[_0x6e70('0x36')](_0x2d52bd));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}else{return rpc[this[_0x6e70('0x12')]+_0x6e70('0x22')]['create'](_0x37b3e0)[_0x6e70('0x3b')](function(_0x4795a0){logger[_0x6e70('0xe')](_0x6e70('0xf'),_0x1b0389,_0x37b3e0[_0x6e70('0x30')]);})[_0x6e70('0x37')](function(_0x233a83){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON[_0x6e70('0x36')](_0x233a83));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}}}catch(_0x2a5444){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON['stringify'](_0x2a5444));_0x36357b['stop']();}};}; \ No newline at end of file +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(_0x8cb1fa,_0x2a1ab3){var _0x309018=function(_0x2ae4b5){while(--_0x2ae4b5){_0x8cb1fa['push'](_0x8cb1fa['shift']());}};_0x309018(++_0x2a1ab3);}(_0x70e0,0x17b));var _0x070e=function(_0x4f1c7f,_0x2d0530){_0x4f1c7f=_0x4f1c7f-0x0;var _0x174787=_0x70e0[_0x4f1c7f];return _0x174787;};'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'],']+(>|$)/g,''),'priorityTrue':_0xd44e2c[0x1],'priorityFalse':_0xd44e2c[0x2]};var _0x902fbc=gotoif['validate'](_0x33427c,{'typecast':!![]});if(_0x902fbc['length']){logger['error'](_0x861b('0xd'),_0x20d906,_[_0x861b('0xe')](_0x902fbc,_0x861b('0xf'))['join'](',\x20'));_0x2ebf9c[_0x861b('0x10')]();}else{try{var _0x42e19b=eval('('+_0x33427c['condition']+')');var _0x15e0d7=_0x42e19b?_0x33427c['priorityTrue']:_0x33427c[_0x861b('0x11')];logger[_0x861b('0x12')](_0x861b('0x13'),_0x20d906,_0x33427c[_0x861b('0x14')],_0x42e19b,_0x15e0d7||'next');if(_0x15e0d7){var _0x5b9560=_[_0x861b('0x15')](_0x2ebf9c[_0x861b('0x16')](),{'p':_0x15e0d7});if(_0x5b9560>=0x0){logger['info'](_0x861b('0x17'),_0x20d906,_0x15e0d7||_0x861b('0x18'),_0x5b9560);_0x2ebf9c[_0x861b('0x18')](_0x5b9560);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x20d906,_0x15e0d7||_0x861b('0x18'));_0x2ebf9c['stop']();}}else{_0x2ebf9c[_0x861b('0x18')]();}}catch(_0x15d96e){logger[_0x861b('0x19')](_0x861b('0x1a'),_0x20d906,_0x15d96e[_0x861b('0xf')]);_0x2ebf9c[_0x861b('0x10')]();}}}catch(_0x22aada){logger['error'](_0x861b('0xd'),_0x20d906,JSON[_0x861b('0x1b')](_0x22aada));_0x2ebf9c[_0x861b('0x10')]();}};}; \ No newline at end of file +var _0xe937=['priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','lodash','html-to-text','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','validate','length','error','[%s][GOTOIF]\x20%s','map','join','stop','condition'];(function(_0x5ac340,_0x23531b){var _0x4bca33=function(_0x5bed15){while(--_0x5bed15){_0x5ac340['push'](_0x5ac340['shift']());}};_0x4bca33(++_0x23531b);}(_0xe937,0x1ca));var _0x7e93=function(_0x15db76,_0x5e6e45){_0x15db76=_0x15db76-0x0;var _0xaa0486=_0xe937[_0x15db76];return _0xaa0486;};'use strict';var schema=require('validate');var _=require(_0x7e93('0x0'));var htmlToText=require(_0x7e93('0x1'));var utils=require('./utils');var logger=require(_0x7e93('0x2'))(_0x7e93('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x7e93('0x4')},'priorityTrue':{'type':_0x7e93('0x5'),'message':_0x7e93('0x6')},'priorityFalse':{'type':_0x7e93('0x5'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x7e93('0x7')]=function(_0x375c2d,_0x1775fb){return function(_0x1a2ea9){try{var _0x20df70={'condition':htmlToText[_0x7e93('0x8')](utils[_0x7e93('0x9')](_0x1775fb[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1775fb[0x1],'priorityFalse':_0x1775fb[0x2]};var _0x1e447c=gotoif[_0x7e93('0xa')](_0x20df70,{'typecast':!![]});if(_0x1e447c[_0x7e93('0xb')]){logger[_0x7e93('0xc')](_0x7e93('0xd'),_0x375c2d,_[_0x7e93('0xe')](_0x1e447c,'message')[_0x7e93('0xf')](',\x20'));_0x1a2ea9[_0x7e93('0x10')]();}else{try{var _0x2f58ee=eval('('+_0x20df70[_0x7e93('0x11')]+')');var _0x2e674d=_0x2f58ee?_0x20df70[_0x7e93('0x12')]:_0x20df70[_0x7e93('0x13')];logger['info'](_0x7e93('0x14'),_0x375c2d,_0x20df70[_0x7e93('0x11')],_0x2f58ee,_0x2e674d||_0x7e93('0x15'));if(_0x2e674d){var _0x450501=_[_0x7e93('0x16')](_0x1a2ea9[_0x7e93('0x17')](),{'p':_0x2e674d});if(_0x450501>=0x0){logger[_0x7e93('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x375c2d,_0x2e674d||'next',_0x450501);_0x1a2ea9[_0x7e93('0x15')](_0x450501);}else{logger[_0x7e93('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x375c2d,_0x2e674d||_0x7e93('0x15'));_0x1a2ea9[_0x7e93('0x10')]();}}else{_0x1a2ea9['next']();}}catch(_0x3b005e){logger[_0x7e93('0xc')](_0x7e93('0x19'),_0x375c2d,_0x3b005e[_0x7e93('0x1a')]);_0x1a2ea9[_0x7e93('0x10')]();}}}catch(_0x208e0d){logger[_0x7e93('0xc')]('[%s][GOTOIF]\x20%s',_0x375c2d,JSON[_0x7e93('0x1b')](_0x208e0d));_0x1a2ea9[_0x7e93('0x10')]();}};}; \ 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 17ff90f..12919e8 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 _0x01ff=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','validate','lodash','../../../../config/logger','routing','number'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x01ff,0x175));var _0xf01f=function(_0x2727a3,_0x598a7a){_0x2727a3=_0x2727a3-0x0;var _0xad79bd=_0x01ff[_0x2727a3];return _0xad79bd;};'use strict';var schema=require(_0xf01f('0x0'));var _=require(_0xf01f('0x1'));var logger=require(_0xf01f('0x2'))(_0xf01f('0x3'));var gotop=schema({'priority':{'type':_0xf01f('0x4'),'required':!![],'message':_0xf01f('0x5')}});exports[_0xf01f('0x6')]=function(_0x1a6840,_0x441ac6){return function(_0x36dc89){try{var _0x15a7e1={'priority':_0x441ac6[0x0]};var _0x5db8b1=gotop[_0xf01f('0x0')](_0x15a7e1,{'typecast':!![]});if(_0x5db8b1[_0xf01f('0x7')]){logger[_0xf01f('0x8')](_0xf01f('0x9'),_0x1a6840,_[_0xf01f('0xa')](_0x5db8b1,'message')['join'](',\x20'));_0x36dc89['stop']();}else{logger['info'](_0xf01f('0xb'),_0x1a6840,_0x15a7e1[_0xf01f('0xc')]);if(_0x15a7e1[_0xf01f('0xc')]){var _0x391a83=_['findIndex'](_0x36dc89[_0xf01f('0xd')](),{'p':_0x15a7e1['priority']});if(_0x391a83>=0x0){logger['info'](_0xf01f('0xe'),_0x1a6840,_0x15a7e1[_0xf01f('0xc')]||_0xf01f('0xf'),_0x391a83);_0x36dc89[_0xf01f('0xf')](_0x391a83);}else{logger['info'](_0xf01f('0x10'),_0x1a6840,_0x15a7e1['priority']||_0xf01f('0xf'));_0x36dc89[_0xf01f('0x11')]();}}else{_0x36dc89['next']();}}}catch(_0x66828){logger['error']('[%s][GOTOP]\x20%s',_0x1a6840,JSON['stringify'](_0x66828));_0x36dc89[_0xf01f('0x11')]();}};}; \ No newline at end of file +var _0xa657=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','info'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xa657,0x171));var _0x7a65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa657[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x7a65('0x0'));var _=require(_0x7a65('0x1'));var logger=require(_0x7a65('0x2'))(_0x7a65('0x3'));var gotop=schema({'priority':{'type':_0x7a65('0x4'),'required':!![],'message':_0x7a65('0x5')}});exports[_0x7a65('0x6')]=function(_0x17c7d1,_0x1afdf2){return function(_0x5a2a0e){try{var _0x163a63={'priority':_0x1afdf2[0x0]};var _0x30670d=gotop[_0x7a65('0x0')](_0x163a63,{'typecast':!![]});if(_0x30670d[_0x7a65('0x7')]){logger[_0x7a65('0x8')](_0x7a65('0x9'),_0x17c7d1,_['map'](_0x30670d,'message')['join'](',\x20'));_0x5a2a0e['stop']();}else{logger[_0x7a65('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x17c7d1,_0x163a63[_0x7a65('0xb')]);if(_0x163a63['priority']){var _0x5c23be=_[_0x7a65('0xc')](_0x5a2a0e[_0x7a65('0xd')](),{'p':_0x163a63['priority']});if(_0x5c23be>=0x0){logger[_0x7a65('0xa')](_0x7a65('0xe'),_0x17c7d1,_0x163a63[_0x7a65('0xb')]||_0x7a65('0xf'),_0x5c23be);_0x5a2a0e[_0x7a65('0xf')](_0x5c23be);}else{logger[_0x7a65('0xa')](_0x7a65('0x10'),_0x17c7d1,_0x163a63[_0x7a65('0xb')]||_0x7a65('0xf'));_0x5a2a0e[_0x7a65('0x11')]();}}else{_0x5a2a0e[_0x7a65('0xf')]();}}}catch(_0x132180){logger['error'](_0x7a65('0x9'),_0x17c7d1,JSON[_0x7a65('0x12')](_0x132180));_0x5a2a0e[_0x7a65('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 9ab2ee7..0ecfc4e 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 _0xe826=['stringify','error','stop','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','getMustacheRender','contact','channel','chat','AccountId','account','upperFirst','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch'];(function(_0x2fcf26,_0x4babe0){var _0x1748df=function(_0xbe7987){while(--_0xbe7987){_0x2fcf26['push'](_0x2fcf26['shift']());}};_0x1748df(++_0x4babe0);}(_0xe826,0x1cb));var _0x6e82=function(_0x1252cb,_0x4c91eb){_0x1252cb=_0x1252cb-0x0;var _0x27968e=_0xe826[_0x1252cb];return _0x27968e;};'use strict';var _=require('lodash');var utils=require(_0x6e82('0x0'));var logger=require('../../../../config/logger')(_0x6e82('0x1'));var rpc={'chatMessage':require(_0x6e82('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6e82('0x3')),'smsMessage':require(_0x6e82('0x4')),'faxMessage':require('../../rpc/faxMessage')};exports['consequence']=function(_0x40ea0a,_0x388fdf){return function(_0x5899b1){try{var _0x3e2848={'body':utils[_0x6e82('0x5')](_0x388fdf[0x0],this),'ContactId':this[_0x6e82('0x6')]['id']};if(this[_0x6e82('0x7')]===_0x6e82('0x8')){_0x3e2848['ChatWebsiteId']=this['account']['id'];}else{_0x3e2848[_['upperFirst'](this[_0x6e82('0x7')])+_0x6e82('0x9')]=this[_0x6e82('0xa')]['id'];}_0x3e2848[_[_0x6e82('0xb')](this[_0x6e82('0x7')])+'InteractionId']=this[_0x6e82('0xc')]['id'];if(rpc[this['channel']+_0x6e82('0xd')]){return rpc[this[_0x6e82('0x7')]+_0x6e82('0xd')][_0x6e82('0xe')](_0x3e2848)[_0x6e82('0xf')](function(_0x104fc8){logger[_0x6e82('0x10')](_0x6e82('0x11'),_0x40ea0a,_0x3e2848[_0x6e82('0x12')]);_0x5899b1[_0x6e82('0x13')]();})[_0x6e82('0x14')](function(_0x4802e6){logger['error'](_0x6e82('0x11'),_0x40ea0a,JSON[_0x6e82('0x15')](_0x4802e6));_0x5899b1['stop']();});}}catch(_0x2924d7){logger[_0x6e82('0x16')](_0x6e82('0x11'),_0x40ea0a,JSON[_0x6e82('0x15')](_0x2924d7));_0x5899b1[_0x6e82('0x17')]();}};}; \ No newline at end of file +var _0x402d=['body','next','catch','stringify','stop','[%s][MESSAGE]\x20%s','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','channel','ChatWebsiteId','account','AccountId','InteractionId','Message','then'];(function(_0xcfc7e3,_0x48be3d){var _0x7eb6f2=function(_0x4f8bf6){while(--_0x4f8bf6){_0xcfc7e3['push'](_0xcfc7e3['shift']());}};_0x7eb6f2(++_0x48be3d);}(_0x402d,0x1d4));var _0xd402=function(_0x14d8c3,_0x2b55a9){_0x14d8c3=_0x14d8c3-0x0;var _0x354f8f=_0x402d[_0x14d8c3];return _0x354f8f;};'use strict';var _=require(_0xd402('0x0'));var utils=require('./utils');var logger=require(_0xd402('0x1'))(_0xd402('0x2'));var rpc={'chatMessage':require(_0xd402('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd402('0x4')),'smsMessage':require(_0xd402('0x5')),'faxMessage':require(_0xd402('0x6'))};exports[_0xd402('0x7')]=function(_0x296697,_0x8de136){return function(_0x2fd2ef){try{var _0x3802f2={'body':utils[_0xd402('0x8')](_0x8de136[0x0],this),'ContactId':this['contact']['id']};if(this[_0xd402('0x9')]==='chat'){_0x3802f2[_0xd402('0xa')]=this[_0xd402('0xb')]['id'];}else{_0x3802f2[_['upperFirst'](this[_0xd402('0x9')])+_0xd402('0xc')]=this['account']['id'];}_0x3802f2[_['upperFirst'](this[_0xd402('0x9')])+_0xd402('0xd')]=this['interaction']['id'];if(rpc[this[_0xd402('0x9')]+'Message']){return rpc[this['channel']+_0xd402('0xe')]['create'](_0x3802f2)[_0xd402('0xf')](function(_0x56efef){logger['info']('[%s][MESSAGE]\x20%s',_0x296697,_0x3802f2[_0xd402('0x10')]);_0x2fd2ef[_0xd402('0x11')]();})[_0xd402('0x12')](function(_0x5cacae){logger['error']('[%s][MESSAGE]\x20%s',_0x296697,JSON[_0xd402('0x13')](_0x5cacae));_0x2fd2ef[_0xd402('0x14')]();});}}catch(_0x582953){logger['error'](_0xd402('0x15'),_0x296697,JSON[_0xd402('0x13')](_0x582953));_0x2fd2ef['stop']();}};}; \ 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 b4a7e56..4f83381 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 _0x831c=['stop','./utils','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x4c6a2d,_0x5100e1){var _0x3ec3f4=function(_0xd13c35){while(--_0xd13c35){_0x4c6a2d['push'](_0x4c6a2d['shift']());}};_0x3ec3f4(++_0x5100e1);}(_0x831c,0x172));var _0xc831=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x831c[_0x209941];return _0x1e8729;};'use strict';var utils=require(_0xc831('0x0'));var logger=require(_0xc831('0x1'))('routing');exports[_0xc831('0x2')]=function(_0x46541e,_0x4202c7){return function(_0x4b9e64){try{logger[_0xc831('0x3')](_0xc831('0x4'),_0x46541e,utils[_0xc831('0x5')](_0x4202c7[0x0],this));_0x4b9e64[_0xc831('0x6')]();}catch(_0x4b4230){logger[_0xc831('0x7')]('[%s][NOOP]\x20%s',_0x46541e,JSON['stringify'](_0x4b4230));_0x4b9e64[_0xc831('0x8')]();}};}; \ No newline at end of file +var _0x327e=['next','stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x54e48f,_0x95f57d){var _0xba6e=function(_0x31ec4a){while(--_0x31ec4a){_0x54e48f['push'](_0x54e48f['shift']());}};_0xba6e(++_0x95f57d);}(_0x327e,0xf6));var _0xe327=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x327e[_0x20a584];return _0x4b41a8;};'use strict';var utils=require(_0xe327('0x0'));var logger=require(_0xe327('0x1'))(_0xe327('0x2'));exports[_0xe327('0x3')]=function(_0x2ba600,_0x1e3d9e){return function(_0x22ca19){try{logger[_0xe327('0x4')](_0xe327('0x5'),_0x2ba600,utils['getMustacheRender'](_0x1e3d9e[0x0],this));_0x22ca19[_0xe327('0x6')]();}catch(_0x3fdfaf){logger['error'](_0xe327('0x5'),_0x2ba600,JSON[_0xe327('0x7')](_0x3fdfaf));_0x22ca19[_0xe327('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 989c5f0..2f697aa 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 _0xee5b=['name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','catch','error','update\x20queue\x20report','toLowerCase','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','end','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','joinAt','queue_id','account','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xee5b,0x1f4));var _0xbee5=function(_0x259ec0,_0x329a32){_0x259ec0=_0x259ec0-0x0;var _0x1a9d26=_0xee5b[_0x259ec0];return _0x1a9d26;};'use strict';var schema=require(_0xbee5('0x0'));var _=require('lodash');var util=require(_0xbee5('0x1'));var seqqueue=require(_0xbee5('0x2'));var moment=require('moment');var Redis=require(_0xbee5('0x3'));var config=require(_0xbee5('0x4'));var logger=require(_0xbee5('0x5'))(_0xbee5('0x6'));var strategy=require('./strategy');config['redis']=_[_0xbee5('0x7')](config[_0xbee5('0x8')],{'host':_0xbee5('0x9'),'port':0x18eb});var io=require(_0xbee5('0xa'))(new Redis(config['redis']));var attributes=['id','queue_id','account','queue','from',_0xbee5('0xb')];function emit(_0x7dda04,_0x45c2c7,_0x20f717){io['to'](_0x7dda04)['emit'](_0x45c2c7,_0x20f717);}function emitChannelQueueInteraction(_0x143bd6,_0x305921,_0x9b3d3b,_0x2edb3c,_0x16377d,_0x1509c7,_0x105e16,_0x17ee3c){var _0xcef158=_['clone'](_0x9b3d3b);_0xcef158[_0xbee5('0xc')]=_0x17ee3c;_0xcef158['queue']=_0x305921;_0xcef158[_0xbee5('0xd')]=_0x2edb3c;_0xcef158['id']=_0x16377d;if(_0x1509c7){_0x105e16[util[_0xbee5('0xe')](_0xbee5('0xf'),_0x143bd6)][_0x16377d]=_['pick'](_0xcef158,attributes);}else{delete _0x105e16[util['format'](_0xbee5('0xf'),_0x143bd6)][_0x16377d];}emit(util['format'](_0xbee5('0x10'),_0x143bd6,_0x305921),util['format'](_0xbee5('0x11'),_0x143bd6,_0x1509c7?_0xbee5('0x12'):_0xbee5('0x13')),_['pick'](_0xcef158,attributes));}var rpc={'openchannelQueueReport':require(_0xbee5('0x14')),'mailQueueReport':require(_0xbee5('0x15')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xbee5('0x16')),'faxQueueReport':require(_0xbee5('0x17'))};var queue=schema({'name':{'type':_0xbee5('0x18'),'required':!![],'message':_0xbee5('0x19')},'timeout':{'type':_0xbee5('0x1a'),'message':_0xbee5('0x1b')}});function startRouting(_0x982404,_0xa50ec9,_0x20cf52,_0x3f7286){if(_0x982404&&_0xa50ec9&&_0x20cf52){_0xa50ec9[_0xbee5('0x1c')]+=0x1;var _0x117f10={'uniqueid':_0x982404,'from':_0x20cf52[_0xbee5('0x1d')]?_0x20cf52[_0xbee5('0x1d')][_0xbee5('0x1e')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x20cf52[_0xbee5('0x1f')]?_0x20cf52['contact']['id']:null,'ListId':_0x20cf52[_0xbee5('0x20')]?_0x20cf52[_0xbee5('0x20')]['id']:null};_0x117f10[_[_0xbee5('0x21')](_0x20cf52[_0xbee5('0x22')])+_0xbee5('0x23')]=_0xa50ec9['id']||null;_0x117f10[_[_0xbee5('0x21')](_0x20cf52[_0xbee5('0x22')])+_0xbee5('0x24')]=_0x20cf52[_0xbee5('0x25')]?_0x20cf52['interaction']['id']:null;_0x117f10[_['upperFirst'](_0x20cf52['channel'])+'MessageId']=_0x20cf52['message']?_0x20cf52[_0xbee5('0x26')]['id']:null;_0x117f10[_[_0xbee5('0x21')](_0x20cf52[_0xbee5('0x22')])+(_0x20cf52[_0xbee5('0x22')]!==_0xbee5('0x27')?_0xbee5('0x28'):_0xbee5('0x29'))]=_0x20cf52['account']?_0x20cf52[_0xbee5('0xd')]['id']:null;logger[_0xbee5('0x2a')](util[_0xbee5('0xe')](_0xbee5('0x2b'),_0x982404,_0xa50ec9[_0xbee5('0x2c')]));emitChannelQueueInteraction(_0x20cf52['channel'],_0xa50ec9[_0xbee5('0x2c')],_0x117f10,_0x20cf52[_0xbee5('0xd')][_0xbee5('0x2c')],_0x20cf52[_0xbee5('0x26')]['id'],!![],_0x3f7286,_0xa50ec9['id']);if(rpc[_0x20cf52[_0xbee5('0x22')]+_0xbee5('0x2d')]){return rpc[_0x20cf52[_0xbee5('0x22')]+_0xbee5('0x2d')][_0xbee5('0x2e')](_0x117f10)['catch'](function(_0x22df5f){logger['error'](_0xbee5('0x2f'));});}}}function stopRouting(_0x493976,_0x2d20cd,_0x52dad9,_0x35609d){if(_0x493976&&_0x2d20cd){_0x2d20cd['waiting']-=0x1;var _0x3220bf={'leaveAt':moment()[_0xbee5('0xe')](_0xbee5('0x30')),'acceptAt':moment()[_0xbee5('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xbee5('0x31')};logger[_0xbee5('0x2a')](util[_0xbee5('0xe')](_0xbee5('0x32'),_0x493976,_0x2d20cd['name']));emitChannelQueueInteraction(_0x52dad9[_0xbee5('0x22')],_0x2d20cd[_0xbee5('0x2c')],_0x52dad9[_0xbee5('0x1d')],_0x52dad9[_0xbee5('0xd')]['name'],_0x52dad9[_0xbee5('0x26')]['id'],![],_0x35609d,_0x2d20cd['id']);if(rpc[_0x52dad9[_0xbee5('0x22')]+_0xbee5('0x2d')]){return rpc[_0x52dad9[_0xbee5('0x22')]+'QueueReport'][_0xbee5('0x33')](_0x493976,_0x3220bf)['catch'](function(_0x383494){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x59bf49,_0x45e8d7,_0x315523,_0x14342f){if(_0x59bf49&&_0x45e8d7){_0x45e8d7[_0xbee5('0x1c')]-=0x1;var _0x209466={'leaveAt':moment()[_0xbee5('0xe')](_0xbee5('0x30')),'exitAt':moment()[_0xbee5('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xbee5('0x34')};logger['info'](util[_0xbee5('0xe')](_0xbee5('0x35'),_0x59bf49,_0x45e8d7[_0xbee5('0x2c')]));emitChannelQueueInteraction(_0x315523[_0xbee5('0x22')],_0x45e8d7['name'],_0x315523[_0xbee5('0x1d')],_0x315523['account']['name'],_0x315523[_0xbee5('0x26')]['id'],![],_0x14342f);if(rpc[_0x315523[_0xbee5('0x22')]+_0xbee5('0x2d')]){return rpc[_0x315523[_0xbee5('0x22')]+'QueueReport'][_0xbee5('0x33')](_0x59bf49,_0x209466)[_0xbee5('0x36')](function(_0x178573){logger[_0xbee5('0x37')](_0xbee5('0x38'));});}}}function handleFindQueue(_0x25cf17){return function(_0x32513){return _0x32513[_0xbee5('0x2c')][_0xbee5('0x39')]()===_0x25cf17[_0xbee5('0x39')]();};}exports['consequence']=function(_0x3c3edf,_0x371015,_0x5637e0,_0x1e872d){return function(_0xebbcc5){try{var _0x426934={'name':_0x371015[0x0],'timeout':_0x371015[0x1]};var _0x56e3d0=queue['validate'](_0x426934,{'typecast':!![]});if(_0x56e3d0['length']){logger['error'](_0xbee5('0x3a'),_0x3c3edf,_[_0xbee5('0x3b')](_0x56e3d0,_0xbee5('0x26'))[_0xbee5('0x3c')](',\x20'));_0xebbcc5[_0xbee5('0x3d')]();}else{var _0x3f5441=_[_0xbee5('0x3e')](_0x5637e0[_0x1e872d[_0xbee5('0x22')]+_0xbee5('0x3f')],handleFindQueue(_0x426934['name']));if(_0x3f5441){startRouting(_0x3c3edf,_0x3f5441,_0x1e872d,_0x5637e0);var _0x4e6350=(_0x3f5441[_0xbee5('0x34')]||0xa)*0x3e8;var _0x51726a=(_0x426934[_0xbee5('0x34')]||0x14)*0x3e8;var _0x46b760,_0x5d36f5;if(_0x4e6350>_0x51726a){_0x51726a=_0x4e6350;}var _0x3b8e4b=seqqueue[_0xbee5('0x40')](_0x4e6350);_0x3b8e4b['id']=_0x3c3edf;_0x3b8e4b['atimeout']=_0x4e6350;_0x3b8e4b['qtimeout']=_0x51726a;_0x3b8e4b[_0xbee5('0x22')]=_0x1e872d[_0xbee5('0x22')];_0x5637e0['rules'][_0x3c3edf]['on'](_0xbee5('0x41'),function(){logger[_0xbee5('0x2a')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x3c3edf);stopRouting(_0x3c3edf,_0x3f5441,_0x1e872d,_0x5637e0);clearTimeout(_0x46b760);_0x46b760=undefined;_0x3b8e4b[_0xbee5('0x42')](!![]);if(_0x5637e0[_0xbee5('0x43')][_0x3c3edf]){delete _0x5637e0[_0xbee5('0x43')][_0x3c3edf];}_0xebbcc5[_0xbee5('0x3d')]();});_0x5637e0[_0xbee5('0x43')][_0x3c3edf]['on'](_0xbee5('0x44'),function(){if(_0x5637e0[_0xbee5('0x43')][_0x3c3edf]){delete _0x5637e0['rules'][_0x3c3edf];}});_0x46b760=setTimeout(function(){logger[_0xbee5('0x2a')](_0xbee5('0x45'),_0x3c3edf);endRouting(_0x3c3edf,_0x3f5441,_0x1e872d,_0x5637e0);clearTimeout(_0x46b760);_0x3b8e4b[_0xbee5('0x42')](!![]);_0xebbcc5[_0xbee5('0x46')]();},_0x51726a);switch(_0x3f5441['strategy']){case _0xbee5('0x47'):strategy[_0xbee5('0x47')](_0x3b8e4b,_0x3f5441,_0x5637e0,_0x1e872d);break;default:strategy[_0xbee5('0x48')](_0x3b8e4b,_0x3f5441,_0x5637e0,_0x1e872d);}}else{logger['error'](_0xbee5('0x49'),_0x3c3edf,_0x426934[_0xbee5('0x2c')]);_0xebbcc5['stop']();}}}catch(_0x5a6cc2){console['log'](_0x5a6cc2);logger[_0xbee5('0x37')]('[%s][QUEUE]\x20%s',_0x3c3edf,_0x5a6cc2[_0xbee5('0x4a')]);_0xebbcc5[_0xbee5('0x3d')]();}};}; \ No newline at end of file +var _0x9bde=['lodash','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','createQueue','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','beepall','log','stack'];(function(_0x405385,_0x56f573){var _0x43837b=function(_0x30e20e){while(--_0x30e20e){_0x405385['push'](_0x405385['shift']());}};_0x43837b(++_0x56f573);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3c3faf,_0x1c05c1){_0x3c3faf=_0x3c3faf-0x0;var _0x3ac02d=_0x9bde[_0x3c3faf];return _0x3ac02d;};'use strict';var schema=require('validate');var _=require(_0xe9bd('0x0'));var util=require('util');var seqqueue=require(_0xe9bd('0x1'));var moment=require('moment');var Redis=require(_0xe9bd('0x2'));var config=require(_0xe9bd('0x3'));var logger=require(_0xe9bd('0x4'))(_0xe9bd('0x5'));var strategy=require(_0xe9bd('0x6'));config[_0xe9bd('0x7')]=_[_0xe9bd('0x8')](config['redis'],{'host':_0xe9bd('0x9'),'port':0x18eb});var io=require(_0xe9bd('0xa'))(new Redis(config[_0xe9bd('0x7')]));var attributes=['id',_0xe9bd('0xb'),_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe'),_0xe9bd('0xf')];function emit(_0x439abc,_0x45c7ba,_0x581602){io['to'](_0x439abc)['emit'](_0x45c7ba,_0x581602);}function emitChannelQueueInteraction(_0x3c8e95,_0x145521,_0x2601ac,_0x581ab9,_0x12c96e,_0x9eca50,_0x3339f9,_0x141587){var _0x5e022a=_[_0xe9bd('0x10')](_0x2601ac);_0x5e022a['queue_id']=_0x141587;_0x5e022a[_0xe9bd('0xd')]=_0x145521;_0x5e022a[_0xe9bd('0xc')]=_0x581ab9;_0x5e022a['id']=_0x12c96e;if(_0x9eca50){_0x3339f9[util[_0xe9bd('0x11')]('%sQueuesWaitingInteractions',_0x3c8e95)][_0x12c96e]=_['pick'](_0x5e022a,attributes);}else{delete _0x3339f9[util[_0xe9bd('0x11')](_0xe9bd('0x12'),_0x3c8e95)][_0x12c96e];}emit(util[_0xe9bd('0x11')](_0xe9bd('0x13'),_0x3c8e95,_0x145521),util[_0xe9bd('0x11')](_0xe9bd('0x14'),_0x3c8e95,_0x9eca50?_0xe9bd('0x15'):'remove'),_[_0xe9bd('0x16')](_0x5e022a,attributes));}var rpc={'openchannelQueueReport':require(_0xe9bd('0x17')),'mailQueueReport':require(_0xe9bd('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xe9bd('0x19')),'faxQueueReport':require(_0xe9bd('0x1a'))};var queue=schema({'name':{'type':_0xe9bd('0x1b'),'required':!![],'message':_0xe9bd('0x1c')},'timeout':{'type':'number','message':_0xe9bd('0x1d')}});function startRouting(_0x50a5e8,_0xc6b661,_0x55b869,_0x26aa4a){if(_0x50a5e8&&_0xc6b661&&_0x55b869){_0xc6b661[_0xe9bd('0x1e')]+=0x1;var _0x134c4e={'uniqueid':_0x50a5e8,'from':_0x55b869[_0xe9bd('0x1f')]?_0x55b869[_0xe9bd('0x1f')][_0xe9bd('0xe')]:'','joinAt':moment()[_0xe9bd('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x55b869[_0xe9bd('0x20')]?_0x55b869[_0xe9bd('0x20')]['id']:null,'ListId':_0x55b869['list']?_0x55b869[_0xe9bd('0x21')]['id']:null};_0x134c4e[_['upperFirst'](_0x55b869[_0xe9bd('0x22')])+_0xe9bd('0x23')]=_0xc6b661['id']||null;_0x134c4e[_[_0xe9bd('0x24')](_0x55b869[_0xe9bd('0x22')])+'InteractionId']=_0x55b869[_0xe9bd('0x25')]?_0x55b869[_0xe9bd('0x25')]['id']:null;_0x134c4e[_[_0xe9bd('0x24')](_0x55b869[_0xe9bd('0x22')])+_0xe9bd('0x26')]=_0x55b869[_0xe9bd('0x27')]?_0x55b869[_0xe9bd('0x27')]['id']:null;_0x134c4e[_[_0xe9bd('0x24')](_0x55b869[_0xe9bd('0x22')])+(_0x55b869['channel']!==_0xe9bd('0x28')?_0xe9bd('0x29'):'WebsiteId')]=_0x55b869[_0xe9bd('0xc')]?_0x55b869[_0xe9bd('0xc')]['id']:null;logger[_0xe9bd('0x2a')](util[_0xe9bd('0x11')](_0xe9bd('0x2b'),_0x50a5e8,_0xc6b661[_0xe9bd('0x2c')]));emitChannelQueueInteraction(_0x55b869['channel'],_0xc6b661['name'],_0x134c4e,_0x55b869[_0xe9bd('0xc')]['name'],_0x55b869[_0xe9bd('0x27')]['id'],!![],_0x26aa4a,_0xc6b661['id']);if(rpc[_0x55b869[_0xe9bd('0x22')]+_0xe9bd('0x2d')]){return rpc[_0x55b869[_0xe9bd('0x22')]+_0xe9bd('0x2d')]['create'](_0x134c4e)['catch'](function(_0x7f2c5){logger[_0xe9bd('0x2e')](_0xe9bd('0x2f'));});}}}function stopRouting(_0x3081f3,_0xe2436,_0x1f0f9e,_0x3c31ee){if(_0x3081f3&&_0xe2436){_0xe2436[_0xe9bd('0x1e')]-=0x1;var _0x45703e={'leaveAt':moment()['format'](_0xe9bd('0x30')),'acceptAt':moment()[_0xe9bd('0x11')](_0xe9bd('0x30')),'reason':'accepted'};logger['info'](util[_0xe9bd('0x11')](_0xe9bd('0x31'),_0x3081f3,_0xe2436[_0xe9bd('0x2c')]));emitChannelQueueInteraction(_0x1f0f9e[_0xe9bd('0x22')],_0xe2436[_0xe9bd('0x2c')],_0x1f0f9e[_0xe9bd('0x1f')],_0x1f0f9e[_0xe9bd('0xc')][_0xe9bd('0x2c')],_0x1f0f9e[_0xe9bd('0x27')]['id'],![],_0x3c31ee,_0xe2436['id']);if(rpc[_0x1f0f9e[_0xe9bd('0x22')]+_0xe9bd('0x2d')]){return rpc[_0x1f0f9e[_0xe9bd('0x22')]+_0xe9bd('0x2d')][_0xe9bd('0x32')](_0x3081f3,_0x45703e)[_0xe9bd('0x33')](function(_0x8ff624){logger[_0xe9bd('0x2e')](_0xe9bd('0x34'));});}}}function endRouting(_0x4c689d,_0x3f3cf5,_0x32e764,_0x56b4a5){if(_0x4c689d&&_0x3f3cf5){_0x3f3cf5[_0xe9bd('0x1e')]-=0x1;var _0x264c87={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xe9bd('0x11')](_0xe9bd('0x30')),'reason':'timeout'};logger[_0xe9bd('0x2a')](util[_0xe9bd('0x11')](_0xe9bd('0x35'),_0x4c689d,_0x3f3cf5['name']));emitChannelQueueInteraction(_0x32e764[_0xe9bd('0x22')],_0x3f3cf5['name'],_0x32e764[_0xe9bd('0x1f')],_0x32e764[_0xe9bd('0xc')][_0xe9bd('0x2c')],_0x32e764[_0xe9bd('0x27')]['id'],![],_0x56b4a5);if(rpc[_0x32e764['channel']+_0xe9bd('0x2d')]){return rpc[_0x32e764[_0xe9bd('0x22')]+_0xe9bd('0x2d')][_0xe9bd('0x32')](_0x4c689d,_0x264c87)[_0xe9bd('0x33')](function(_0x1e061d){logger[_0xe9bd('0x2e')](_0xe9bd('0x34'));});}}}function handleFindQueue(_0x2b5a71){return function(_0x1d5d93){return _0x1d5d93['name']['toLowerCase']()===_0x2b5a71[_0xe9bd('0x36')]();};}exports['consequence']=function(_0x4608a0,_0x340819,_0x41881a,_0x480797){return function(_0x1ba613){try{var _0x2923cf={'name':_0x340819[0x0],'timeout':_0x340819[0x1]};var _0x1a2d94=queue['validate'](_0x2923cf,{'typecast':!![]});if(_0x1a2d94[_0xe9bd('0x37')]){logger[_0xe9bd('0x2e')](_0xe9bd('0x38'),_0x4608a0,_[_0xe9bd('0x39')](_0x1a2d94,_0xe9bd('0x27'))[_0xe9bd('0x3a')](',\x20'));_0x1ba613[_0xe9bd('0x3b')]();}else{var _0x3c4482=_[_0xe9bd('0x3c')](_0x41881a[_0x480797[_0xe9bd('0x22')]+_0xe9bd('0x3d')],handleFindQueue(_0x2923cf[_0xe9bd('0x2c')]));if(_0x3c4482){startRouting(_0x4608a0,_0x3c4482,_0x480797,_0x41881a);var _0x2d4e62=(_0x3c4482[_0xe9bd('0x3e')]||0xa)*0x3e8;var _0x41da6e=(_0x2923cf['timeout']||0x14)*0x3e8;var _0x5a86fd,_0x283e67;if(_0x2d4e62>_0x41da6e){_0x41da6e=_0x2d4e62;}var _0x2ced7c=seqqueue[_0xe9bd('0x3f')](_0x2d4e62);_0x2ced7c['id']=_0x4608a0;_0x2ced7c['atimeout']=_0x2d4e62;_0x2ced7c['qtimeout']=_0x41da6e;_0x2ced7c[_0xe9bd('0x22')]=_0x480797[_0xe9bd('0x22')];_0x41881a[_0xe9bd('0x40')][_0x4608a0]['on'](_0xe9bd('0x41'),function(){logger[_0xe9bd('0x2a')](_0xe9bd('0x42'),_0x4608a0);stopRouting(_0x4608a0,_0x3c4482,_0x480797,_0x41881a);clearTimeout(_0x5a86fd);_0x5a86fd=undefined;_0x2ced7c[_0xe9bd('0x43')](!![]);if(_0x41881a['rules'][_0x4608a0]){delete _0x41881a[_0xe9bd('0x40')][_0x4608a0];}_0x1ba613['stop']();});_0x41881a[_0xe9bd('0x40')][_0x4608a0]['on'](_0xe9bd('0x44'),function(){if(_0x41881a[_0xe9bd('0x40')][_0x4608a0]){delete _0x41881a[_0xe9bd('0x40')][_0x4608a0];}});_0x5a86fd=setTimeout(function(){logger[_0xe9bd('0x2a')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x4608a0);endRouting(_0x4608a0,_0x3c4482,_0x480797,_0x41881a);clearTimeout(_0x5a86fd);_0x2ced7c[_0xe9bd('0x43')](!![]);_0x1ba613[_0xe9bd('0x45')]();},_0x41da6e);switch(_0x3c4482[_0xe9bd('0x46')]){case'rrmemory':strategy[_0xe9bd('0x47')](_0x2ced7c,_0x3c4482,_0x41881a,_0x480797);break;default:strategy[_0xe9bd('0x48')](_0x2ced7c,_0x3c4482,_0x41881a,_0x480797);}}else{logger[_0xe9bd('0x2e')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4608a0,_0x2923cf[_0xe9bd('0x2c')]);_0x1ba613[_0xe9bd('0x3b')]();}}}catch(_0x2e634d){console[_0xe9bd('0x49')](_0x2e634d);logger[_0xe9bd('0x2e')]('[%s][QUEUE]\x20%s',_0x4608a0,_0x2e634d[_0xe9bd('0x4a')]);_0x1ba613['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 02069b2..45eb05b 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 _0x2fed=['push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','notificationId','writeLog','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','squeue','agent','realtime'];(function(_0x4811fd,_0x1dd0a4){var _0x1f486f=function(_0x446e0d){while(--_0x446e0d){_0x4811fd['push'](_0x4811fd['shift']());}};_0x1f486f(++_0x1dd0a4);}(_0x2fed,0x7c));var _0xd2fe=function(_0x4217ee,_0x2e134c){_0x4217ee=_0x4217ee-0x0;var _0x1b8384=_0x2fed[_0x4217ee];return _0x1b8384;};'use strict';var _=require(_0xd2fe('0x0'));var uuid=require(_0xd2fe('0x1'));var util=require(_0xd2fe('0x2'));var logger=require(_0xd2fe('0x3'))(_0xd2fe('0x4'));var Agent=function(_0x4b70e7,_0x3c9206,_0x20b497,_0x48707a){this['notificationId']=uuid['v4']();this[_0xd2fe('0x5')]=_0x4b70e7;this[_0xd2fe('0x6')]=_0x3c9206;this[_0xd2fe('0x7')]=_0x20b497;this['routing']=_0x48707a;this[_0xd2fe('0x5')][_0xd2fe('0x8')](this[_0xd2fe('0x9')][_0xd2fe('0xa')](this),this['handleTimeout'][_0xd2fe('0xa')](this));this[_0xd2fe('0x5')]['on'](_0xd2fe('0xb'),this[_0xd2fe('0xc')][_0xd2fe('0xa')](this));this[_0xd2fe('0x5')]['on'](_0xd2fe('0xd'),this[_0xd2fe('0xe')][_0xd2fe('0xa')](this));};Agent[_0xd2fe('0xf')][_0xd2fe('0x8')]=function(){this[_0xd2fe('0x5')][_0xd2fe('0x8')](this[_0xd2fe('0x9')][_0xd2fe('0xa')](this),this[_0xd2fe('0xc')][_0xd2fe('0xa')](this));};Agent[_0xd2fe('0xf')]['handleDrained']=function(){this[_0xd2fe('0xc')](!![]);};Agent[_0xd2fe('0xf')][_0xd2fe('0x9')]=function(_0x5607a3){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0xd2fe('0x5')]['id'],this['agent']['id']);if(_[_0xd2fe('0x10')](this[_0xd2fe('0x7')][_0xd2fe('0x11')][this[_0xd2fe('0x6')]['id']])){logger[_0xd2fe('0x12')](_0xd2fe('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0xd2fe('0x8')][_0xd2fe('0xa')](this),0x3e8);}else{if(this['routing'][_0xd2fe('0x14')]||util[_0xd2fe('0x15')](this[_0xd2fe('0x5')]['id'],this[_0xd2fe('0x7')][_0xd2fe('0x11')][this[_0xd2fe('0x6')]['id']],this[_0xd2fe('0x5')][_0xd2fe('0x16')],![])){this[_0xd2fe('0x7')][_0xd2fe('0x11')][this['agent']['id']][_0xd2fe('0x17')]=!![];this['realtime'][_0xd2fe('0x11')][this[_0xd2fe('0x6')]['id']][_0xd2fe('0x18')]=undefined;util[_0xd2fe('0x19')](this['notificationId'],this[_0xd2fe('0x5')]['id'],this['realtime'][_0xd2fe('0x11')][this[_0xd2fe('0x6')]['id']],null,this[_0xd2fe('0x4')]);util['writeLog'](this['squeue']['id'],this[_0xd2fe('0x7')][_0xd2fe('0x11')][this[_0xd2fe('0x6')]['id']],_0xd2fe('0x1a')+(this[_0xd2fe('0x4')]['forcedOwnership']?':FORCED':''));}else{logger['info'](_0xd2fe('0x1b'),this[_0xd2fe('0x5')]['id'],this[_0xd2fe('0x6')]['id']);setTimeout(this[_0xd2fe('0x8')]['bind'](this),0x3e8);}}};Agent[_0xd2fe('0xf')][_0xd2fe('0xc')]=function(_0x293364){if(_[_0xd2fe('0x10')](this['realtime'][_0xd2fe('0x11')][this[_0xd2fe('0x6')]['id']])){return logger[_0xd2fe('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xd2fe('0x5')]['id'],this[_0xd2fe('0x6')]['id']);}else{logger[_0xd2fe('0x12')](_0xd2fe('0x1c'),this['squeue']['id'],this[_0xd2fe('0x6')]['id']);util[_0xd2fe('0x1d')](this[_0xd2fe('0x1e')],this[_0xd2fe('0x5')]['id'],this['realtime'][_0xd2fe('0x11')][this[_0xd2fe('0x6')]['id']],null,this[_0xd2fe('0x4')]);this[_0xd2fe('0x7')][_0xd2fe('0x11')][this[_0xd2fe('0x6')]['id']]['busy']=![];this[_0xd2fe('0x7')][_0xd2fe('0x11')][this['agent']['id']][_0xd2fe('0x18')]=undefined;util[_0xd2fe('0x1f')](this[_0xd2fe('0x5')]['id'],this['realtime'][_0xd2fe('0x11')][this[_0xd2fe('0x6')]['id']],_0x293364?'STOP':_0xd2fe('0x20'));}if(!_0x293364){setTimeout(this[_0xd2fe('0x8')][_0xd2fe('0xa')](this),0x3e8);}};function agent(_0x426bd6,_0x351ab3,_0xaaf366,_0x5b2668){return new Agent(_0x426bd6,_0x351ab3,_0xaaf366,_0x5b2668);}module['exports']=agent; \ No newline at end of file +var _0xc757=['notificationId','squeue','agent','realtime','push','bind','timeout','handleTimeout','handleDrained','prototype','handleRun','info','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','busyQueue','showNotification',':FORCED','writeLog','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing'];(function(_0x3bec0b,_0x3ccf05){var _0x5fc9a0=function(_0x30bdde){while(--_0x30bdde){_0x3bec0b['push'](_0x3bec0b['shift']());}};_0x5fc9a0(++_0x3ccf05);}(_0xc757,0xe3));var _0x7c75=function(_0x7caf8b,_0x51a6be){_0x7caf8b=_0x7caf8b-0x0;var _0x16e8de=_0xc757[_0x7caf8b];return _0x16e8de;};'use strict';var _=require(_0x7c75('0x0'));var uuid=require(_0x7c75('0x1'));var util=require(_0x7c75('0x2'));var logger=require(_0x7c75('0x3'))(_0x7c75('0x4'));var Agent=function(_0x51c0dc,_0x1e47e6,_0x4f7a3b,_0x4d373a){this[_0x7c75('0x5')]=uuid['v4']();this[_0x7c75('0x6')]=_0x51c0dc;this[_0x7c75('0x7')]=_0x1e47e6;this[_0x7c75('0x8')]=_0x4f7a3b;this[_0x7c75('0x4')]=_0x4d373a;this[_0x7c75('0x6')][_0x7c75('0x9')](this['handleRun'][_0x7c75('0xa')](this),this['handleTimeout'][_0x7c75('0xa')](this));this[_0x7c75('0x6')]['on'](_0x7c75('0xb'),this[_0x7c75('0xc')][_0x7c75('0xa')](this));this[_0x7c75('0x6')]['on']('drained',this[_0x7c75('0xd')][_0x7c75('0xa')](this));};Agent['prototype']['push']=function(){this[_0x7c75('0x6')][_0x7c75('0x9')](this['handleRun'][_0x7c75('0xa')](this),this[_0x7c75('0xc')]['bind'](this));};Agent[_0x7c75('0xe')][_0x7c75('0xd')]=function(){this[_0x7c75('0xc')](!![]);};Agent['prototype'][_0x7c75('0xf')]=function(_0x439130){logger[_0x7c75('0x10')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x7c75('0x6')]['id'],this['agent']['id']);if(_[_0x7c75('0x11')](this[_0x7c75('0x8')][_0x7c75('0x12')][this[_0x7c75('0x7')]['id']])){logger[_0x7c75('0x10')](_0x7c75('0x13'),this[_0x7c75('0x6')]['id'],this[_0x7c75('0x7')]['id']);setTimeout(this[_0x7c75('0x9')]['bind'](this),0x3e8);}else{if(this[_0x7c75('0x4')][_0x7c75('0x14')]||util['isAgentAvailable'](this[_0x7c75('0x6')]['id'],this[_0x7c75('0x8')][_0x7c75('0x12')][this['agent']['id']],this['squeue']['channel'],![])){this[_0x7c75('0x8')]['agents'][this[_0x7c75('0x7')]['id']][_0x7c75('0x15')]=!![];this['realtime']['agents'][this['agent']['id']][_0x7c75('0x16')]=undefined;util[_0x7c75('0x17')](this[_0x7c75('0x5')],this[_0x7c75('0x6')]['id'],this[_0x7c75('0x8')][_0x7c75('0x12')][this['agent']['id']],null,this[_0x7c75('0x4')]);util['writeLog'](this[_0x7c75('0x6')]['id'],this[_0x7c75('0x8')][_0x7c75('0x12')][this[_0x7c75('0x7')]['id']],'RINGING'+(this[_0x7c75('0x4')][_0x7c75('0x14')]?_0x7c75('0x18'):''));}else{logger[_0x7c75('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x7c75('0x6')]['id'],this[_0x7c75('0x7')]['id']);setTimeout(this[_0x7c75('0x9')][_0x7c75('0xa')](this),0x3e8);}}};Agent['prototype'][_0x7c75('0xc')]=function(_0x5d6ee5){if(_['isNil'](this[_0x7c75('0x8')][_0x7c75('0x12')][this[_0x7c75('0x7')]['id']])){return logger['info'](_0x7c75('0x13'),this['squeue']['id'],this[_0x7c75('0x7')]['id']);}else{logger[_0x7c75('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x7c75('0x6')]['id'],this[_0x7c75('0x7')]['id']);util['hideNotification'](this[_0x7c75('0x5')],this[_0x7c75('0x6')]['id'],this[_0x7c75('0x8')][_0x7c75('0x12')][this[_0x7c75('0x7')]['id']],null,this[_0x7c75('0x4')]);this[_0x7c75('0x8')][_0x7c75('0x12')][this[_0x7c75('0x7')]['id']][_0x7c75('0x15')]=![];this[_0x7c75('0x8')][_0x7c75('0x12')][this[_0x7c75('0x7')]['id']][_0x7c75('0x16')]=undefined;util[_0x7c75('0x19')](this[_0x7c75('0x6')]['id'],this[_0x7c75('0x8')][_0x7c75('0x12')][this['agent']['id']],_0x5d6ee5?_0x7c75('0x1a'):_0x7c75('0x1b'));}if(!_0x5d6ee5){setTimeout(this[_0x7c75('0x9')][_0x7c75('0xa')](this),0x3e8);}};function agent(_0xc39653,_0x591648,_0x455df2,_0x490729){return new Agent(_0xc39653,_0x591648,_0x455df2,_0x490729);}module[_0x7c75('0x1c')]=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 e1f4cef..5994a73 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 _0xbad1=['channel','writeLog','busyQueue','name','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','busy','exports','lodash','uuid','./util','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable'];(function(_0x197ba5,_0x507cf1){var _0x25732a=function(_0x569cb4){while(--_0x569cb4){_0x197ba5['push'](_0x197ba5['shift']());}};_0x25732a(++_0x507cf1);}(_0xbad1,0x197));var _0x1bad=function(_0xce5b62,_0x28c309){_0xce5b62=_0xce5b62-0x0;var _0x2396a6=_0xbad1[_0xce5b62];return _0x2396a6;};'use strict';var _=require(_0x1bad('0x0'));var uuid=require(_0x1bad('0x1'));var util=require(_0x1bad('0x2'));var logger=require('../../../../../config/logger')(_0x1bad('0x3'));var Beepall=function(_0x3a508d,_0x56b660,_0x1a73be,_0x5e26d5){this[_0x1bad('0x4')]=uuid['v4']();this[_0x1bad('0x5')]=_0x3a508d;this[_0x1bad('0x6')]=_0x56b660;this[_0x1bad('0x7')]=_0x1a73be;this[_0x1bad('0x3')]=_0x5e26d5;this['squeue'][_0x1bad('0x8')](this[_0x1bad('0x9')][_0x1bad('0xa')](this),this[_0x1bad('0xb')][_0x1bad('0xa')](this));this[_0x1bad('0x5')]['on'](_0x1bad('0xc'),this[_0x1bad('0xb')][_0x1bad('0xa')](this));this[_0x1bad('0x5')]['on'](_0x1bad('0xd'),this[_0x1bad('0xe')][_0x1bad('0xa')](this));};Beepall['prototype'][_0x1bad('0x8')]=function(){this[_0x1bad('0x5')]['push'](this[_0x1bad('0x9')]['bind'](this),this[_0x1bad('0xb')]['bind'](this));};Beepall['prototype'][_0x1bad('0xe')]=function(_0x34a018){this[_0x1bad('0xb')](!![]);};Beepall[_0x1bad('0xf')][_0x1bad('0x9')]=function(_0x358f90){var _0x4825eb=!![];if(!_['isNil'](this[_0x1bad('0x6')])&&!_[_0x1bad('0x10')](this[_0x1bad('0x6')][_0x1bad('0x11')])&&this['queue'][_0x1bad('0x11')]['length']>0x0){for(var _0x4e18a8=0x0,_0x7b9f15;_0x4e18a80x0){for(var _0x17587c=0x0,_0x515733;_0x17587c0x0&&_0x1eaa37[_0x33700a+'CurrentCapacity']>=_0x1eaa37[_0x33700a+_0xb105('0x21')]){writeLog(_0x2a9ab3,_0x1eaa37,_0x33700a[_0xb105('0x23')]()+_0xb105('0x24'));return![];}}return!![];};exports[_0xb105('0x25')]=function(_0x47e7c4,_0x15aee0,_0x67e8fb,_0x5061d7,_0xcfd15){return sendNotification(!![],_0x47e7c4,_0x15aee0,_0x67e8fb,_0x5061d7,_0xcfd15);};exports[_0xb105('0x26')]=function(_0x1c766e,_0x59f0ef,_0x119b8e,_0xebce21,_0x3961c1){return sendNotification(![],_0x1c766e,_0x59f0ef,_0x119b8e,_0xebce21,_0x3961c1);};exports[_0xb105('0x27')]=writeLog; \ No newline at end of file +var _0xd35f=['Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','writeLog','lodash','mustache','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xd35f,0xd2));var _0xfd35=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0xd35f[_0x5959c9];return _0x4ffcbc;};'use strict';var _=require(_0xfd35('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require(_0xfd35('0x1'));var Redis=require('ioredis');var config=require(_0xfd35('0x2'));var logger=require(_0xfd35('0x3'))('routing');config[_0xfd35('0x4')]=_[_0xfd35('0x5')](config[_0xfd35('0x4')],{'host':_0xfd35('0x6'),'port':0x18eb});var io=require(_0xfd35('0x7'))(new Redis(config['redis']));function emit(_0x1b3e7a,_0x11ed40,_0xa2395c){io['to'](_0x1b3e7a)[_0xfd35('0x8')](_0x11ed40,_0xa2395c);}function sendNotification(_0x383b0f,_0x5ae997,_0x10b156,_0x1da506,_0x58d938,_0x51df18){io['to'](util[_0xfd35('0x9')](_0xfd35('0xa'),_0x1da506[_0xfd35('0xb')]))[_0xfd35('0x8')](_0xfd35('0xc'),_0x1da506);var _0x55979d=_0x51df18||{};var _0xdfe179=_0x10b156['split']('.');var _0x3e75a4={'uniqueid':_0x5ae997,'channel':_0xdfe179[0x0],'id':_0xdfe179[0x1],'title':_0xdfe179[0x0]+'\x20interaction','interactionId':_0xdfe179[0x2],'queue':_0x58d938?_0x58d938['name']:null,'sound':_0x55979d[_0xfd35('0xd')][_0xfd35('0xe')],'shake':_0x55979d['account'][_0xfd35('0xf')]};try{if(!_0x55979d[_0xfd35('0x10')]){_0x55979d[_0xfd35('0x10')]={};}if(_0x58d938){_0x55979d[_0xfd35('0x10')][_0xfd35('0x11')]=_0x58d938;}else if(_0x55979d[_0xfd35('0x10')]['queue']){delete _0x55979d[_0xfd35('0x10')][_0xfd35('0x11')];}_0x3e75a4[_0xfd35('0x12')]=utils[_0xfd35('0x13')](_0x55979d[_0xfd35('0xd')][_0xfd35('0x14')],_0x55979d);}catch(_0x313080){_0x3e75a4[_0xfd35('0x12')]=_0xfd35('0x15');logger['error'](util[_0xfd35('0x9')]('[%s][QUEUE]\x20%s',_0x5ae997,_0x313080[_0xfd35('0x16')]));}io['to'](util[_0xfd35('0x9')](_0xfd35('0xa'),_0x1da506[_0xfd35('0xb')]))[_0xfd35('0x8')](util[_0xfd35('0x9')](_0xfd35('0x17'),_0x383b0f?_0xfd35('0x18'):_0xfd35('0x19')),_0x3e75a4);}function writeLog(_0xa42293,_0x3668dc,_0x1b79ef){return logger[_0xfd35('0x1a')](util['format'](_0xfd35('0x1b'),_0xa42293,_0x3668dc[_0xfd35('0xb')],_0x1b79ef));}exports[_0xfd35('0x1c')]=function(_0x298bdc,_0x53b783,_0x12048c,_0x382a40){if(_0x53b783[_0xfd35('0x1d')]){writeLog(_0x298bdc,_0x53b783,_0xfd35('0x1e'));return![];}if(!_0x53b783[_0xfd35('0x1f')]){writeLog(_0x298bdc,_0x53b783,_0xfd35('0x20'));return![];}if(_0x53b783[_0x12048c+_0xfd35('0x21')]){writeLog(_0x298bdc,_0x53b783,_0xfd35('0x22'));return![];}if(_0x382a40&&_0x53b783[_0xfd35('0x23')](_0x12048c+'Capacity')&&_0x53b783[_0xfd35('0x23')](_0x12048c+'CurrentCapacity')){if(_0x53b783[_0x12048c+_0xfd35('0x24')]>0x0&&_0x53b783[_0x12048c+_0xfd35('0x25')]>=_0x53b783[_0x12048c+'Capacity']){writeLog(_0x298bdc,_0x53b783,_0x12048c[_0xfd35('0x26')]()+_0xfd35('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x5f1679,_0x2954a2,_0x333d68,_0x2b1eae,_0x2fdeab){return sendNotification(!![],_0x5f1679,_0x2954a2,_0x333d68,_0x2b1eae,_0x2fdeab);};exports['hideNotification']=function(_0x1e13c2,_0x5bf9fb,_0x56d1b6,_0x4b7b7e,_0x3f8e85){return sendNotification(![],_0x1e13c2,_0x5bf9fb,_0x56d1b6,_0x4b7b7e,_0x3f8e85);};exports[_0xfd35('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 ca14f3a..46c4bf9 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 _0x0fc6=['stringify','./utils','consequence','validate','length','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x0fc6,0xc1));var _0x60fc=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x0fc6[_0x413feb];return _0x40ee88;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require('lodash');var utils=require(_0x60fc('0x0'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x60fc('0x1')]=function(_0x461e3e,_0x52cf23){return function(_0x92c307){try{var _0x63a134={'command':_0x52cf23[0x0]};var _0x254b01=system[_0x60fc('0x2')](_0x63a134,{'typecast':!![]});if(_0x254b01[_0x60fc('0x3')]){logger['error'](_0x60fc('0x4'),_0x461e3e,_[_0x60fc('0x5')](_0x254b01,_0x60fc('0x6'))[_0x60fc('0x7')](',\x20'));logger[_0x60fc('0x8')](_0x60fc('0x9'),_0x461e3e);_0x92c307[_0x60fc('0xa')]();}else{var _0x2213e2=this;var _0x572639=utils[_0x60fc('0xb')](_0x52cf23[0x0],this);logger['info'](_0x60fc('0xc'),_0x461e3e,_0x572639);sh[_0x60fc('0xd')](_[_0x60fc('0xe')](_0x572639),function(_0x2a74f4,_0xb92784){logger[_0x60fc('0x8')](_0x60fc('0xf'),_0x461e3e,_0x2a74f4);if(_0x2a74f4==0x0){var _0x214967=_0xb92784[_0x60fc('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x60fc('0x11')](_0x52cf23[0x1])||_[_0x60fc('0x12')](_0x52cf23[0x1])){logger[_0x60fc('0x8')](_0x60fc('0x13'),_0x461e3e);_0x2213e2[_0x60fc('0x14')][_0x52cf23[0x1]]=_0x214967;}else{logger[_0x60fc('0x8')](_0x60fc('0x15'),_0x461e3e,_0x52cf23[0x1],_0x214967);_0x2213e2[_0x60fc('0x14')][_0x52cf23[0x1]]=_0x214967;}}_0x92c307[_0x60fc('0xa')]();});}}catch(_0x466952){logger['error'](_0x60fc('0x4'),_0x461e3e,_[_0x60fc('0x16')](_0x466952)?JSON[_0x60fc('0x17')](_0x466952):_0x466952);logger[_0x60fc('0x8')](_0x60fc('0x9'),_0x461e3e);_0x92c307[_0x60fc('0xa')]();}};}; \ No newline at end of file +var _0x1686=['replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','next','validate','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim'];(function(_0x42490d,_0xd02637){var _0x377a79=function(_0x45a186){while(--_0x45a186){_0x42490d['push'](_0x42490d['shift']());}};_0x377a79(++_0xd02637);}(_0x1686,0xc5));var _0x6168=function(_0x32ea03,_0x325386){_0x32ea03=_0x32ea03-0x0;var _0x3299d5=_0x1686[_0x32ea03];return _0x3299d5;};'use strict';var schema=require(_0x6168('0x0'));var sh=require('shelljs');var _=require(_0x6168('0x1'));var utils=require(_0x6168('0x2'));var logger=require(_0x6168('0x3'))('routing');var system=schema({'command':{'type':_0x6168('0x4'),'required':!![],'message':_0x6168('0x5')}});exports[_0x6168('0x6')]=function(_0x17cd86,_0x3220a9){return function(_0x2c55d9){try{var _0x13f3e3={'command':_0x3220a9[0x0]};var _0x372f6e=system[_0x6168('0x0')](_0x13f3e3,{'typecast':!![]});if(_0x372f6e[_0x6168('0x7')]){logger[_0x6168('0x8')](_0x6168('0x9'),_0x17cd86,_[_0x6168('0xa')](_0x372f6e,_0x6168('0xb'))[_0x6168('0xc')](',\x20'));logger[_0x6168('0xd')](_0x6168('0xe'),_0x17cd86);_0x2c55d9['next']();}else{var _0x1a1d4f=this;var _0x53adbf=utils[_0x6168('0xf')](_0x3220a9[0x0],this);logger[_0x6168('0xd')](_0x6168('0x10'),_0x17cd86,_0x53adbf);sh[_0x6168('0x11')](_[_0x6168('0x12')](_0x53adbf),function(_0x50e46e,_0x535ebe){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x17cd86,_0x50e46e);if(_0x50e46e==0x0){var _0x26276d=_0x535ebe[_0x6168('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x6168('0x14')](_0x3220a9[0x1])||_[_0x6168('0x15')](_0x3220a9[0x1])){logger[_0x6168('0xd')](_0x6168('0x16'),_0x17cd86);_0x1a1d4f[_0x6168('0x17')][_0x3220a9[0x1]]=_0x26276d;}else{logger[_0x6168('0xd')](_0x6168('0x18'),_0x17cd86,_0x3220a9[0x1],_0x26276d);_0x1a1d4f['body'][_0x3220a9[0x1]]=_0x26276d;}}_0x2c55d9['next']();});}}catch(_0x1fe0a8){logger[_0x6168('0x8')](_0x6168('0x9'),_0x17cd86,_['isObject'](_0x1fe0a8)?JSON[_0x6168('0x19')](_0x1fe0a8):_0x1fe0a8);logger['info'](_0x6168('0xe'),_0x17cd86);_0x2c55d9[_0x6168('0x1a')]();}};}; \ 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 e364acc..49b5fbd 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x3b30f7,_0x4a60b6){var _0x323c94=function(_0x5319b4){while(--_0x5319b4){_0x3b30f7['push'](_0x3b30f7['shift']());}};_0x323c94(++_0x4a60b6);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file +var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0xa03abc,_0x303217){var _0x201a28=function(_0x35b2c6){while(--_0x35b2c6){_0xa03abc['push'](_0xa03abc['shift']());}};_0x201a28(++_0x303217);}(_0x7a54,0x106));var _0x47a5=function(_0x1a23ff,_0x4fbb2f){_0x1a23ff=_0x1a23ff-0x0;var _0x41175f=_0x7a54[_0x1a23ff];return _0x41175f;};'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 7aad9e3..5b52bb2 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 _0xf9bc=['render','merge','body','contact','message','account','lodash','exports'];(function(_0x3f0a1f,_0x671e9){var _0x165bd4=function(_0x1f27b8){while(--_0x1f27b8){_0x3f0a1f['push'](_0x3f0a1f['shift']());}};_0x165bd4(++_0x671e9);}(_0xf9bc,0x7e));var _0xcf9b=function(_0x512c7f,_0x491f68){_0x512c7f=_0x512c7f-0x0;var _0x37058c=_0xf9bc[_0x512c7f];return _0x37058c;};'use strict';var Mustache=require('mustache');var _=require(_0xcf9b('0x0'));module[_0xcf9b('0x1')]={'getMustacheRender':function(_0x31e184,_0x19ad1b){return Mustache[_0xcf9b('0x2')](_0x31e184,_[_0xcf9b('0x3')](_0x19ad1b[_0xcf9b('0x4')],{'contact':_0x19ad1b[_0xcf9b('0x5')],'message':_0x19ad1b[_0xcf9b('0x6')],'account':_0x19ad1b[_0xcf9b('0x7')],'interaction':_0x19ad1b['interaction'],'list':_0x19ad1b['list']}))||'';}}; \ No newline at end of file +var _0xde50=['exports','render','body','message'];(function(_0xfaa90,_0x5ec45f){var _0xfad1fb=function(_0x33168d){while(--_0x33168d){_0xfaa90['push'](_0xfaa90['shift']());}};_0xfad1fb(++_0x5ec45f);}(_0xde50,0x140));var _0x0de5=function(_0x4009a6,_0x4fd666){_0x4009a6=_0x4009a6-0x0;var _0x48cc58=_0xde50[_0x4009a6];return _0x48cc58;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x0de5('0x0')]={'getMustacheRender':function(_0x34b791,_0x13190a){return Mustache[_0x0de5('0x1')](_0x34b791,_['merge'](_0x13190a[_0x0de5('0x2')],{'contact':_0x13190a['contact'],'message':_0x13190a[_0x0de5('0x3')],'account':_0x13190a['account'],'interaction':_0x13190a['interaction'],'list':_0x13190a['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 7e2d64d..05dc401 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 _0x2a04=['loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','autoreply','appdata','split','push','slice','dialogflow','amazonlex','tag','%s:%s:%s','./interval','condition','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','info','Applications\x20executed','stringify','matchPath','emit','complete','stack','error','routing\x20is\x20empty','channel','QueueReport','update','UserId','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','updateRealtime','agent\x20not\x20found','chatQueues','available'];(function(_0x4ca526,_0x404b13){var _0x3b14dc=function(_0x17dfb2){while(--_0x17dfb2){_0x4ca526['push'](_0x4ca526['shift']());}};_0x3b14dc(++_0x404b13);}(_0x2a04,0xc9));var _0x42a0=function(_0x59d80d,_0x1e0721){_0x59d80d=_0x59d80d-0x0;var _0x4042c6=_0x2a04[_0x59d80d];return _0x4042c6;};'use strict';var _=require(_0x42a0('0x0'));var util=require('util');var path=require(_0x42a0('0x1'));var fs=require('fs');var jayson=require(_0x42a0('0x2'));var BPromise=require(_0x42a0('0x3'));var uuid=require(_0x42a0('0x4'));var config=require(_0x42a0('0x5'));var logger=require(_0x42a0('0x6'))(_0x42a0('0x7'));var rpc={'openchannelQueueReport':require(_0x42a0('0x8'))};var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x42a0('0x9')),'chatQueueReport':require(_0x42a0('0xa')),'smsQueueReport':require(_0x42a0('0xb')),'faxQueueReport':require(_0x42a0('0xc'))};var RuleEngine=require(_0x42a0('0xd'));function getId(_0x40d313,_0x41b269,_0x4f70f3){return util[_0x42a0('0xe')](_0x42a0('0xf'),_0x40d313,_0x41b269||0x0,_0x4f70f3||0x0);}function getIntervals(_0xf22e69,_0x3555f9){var _0x3a56b9=[];if(!_[_0x42a0('0x10')](_0x3555f9[_0x42a0('0x11')])&&!_[_0x42a0('0x10')](_0xf22e69[_0x3555f9[_0x42a0('0x11')]])&&!_[_0x42a0('0x10')](_0xf22e69[_0x3555f9[_0x42a0('0x11')]]['Intervals'])){_0x3a56b9=_[_0x42a0('0x12')](_0xf22e69[_0x3555f9[_0x42a0('0x11')]][_0x42a0('0x13')],_0x42a0('0x14'));}else if(!_[_0x42a0('0x10')](_0x3555f9[_0x42a0('0x14')])){_0x3a56b9=[_0x3555f9['interval']];}return _0x3a56b9;}exports[_0x42a0('0x15')]=function(_0x1cac16){_0x1cac16[_0x42a0('0x16')]={};return new BPromise(function(_0x15c42d,_0x3dc172){var _0x123335={'Start':function(_0x2e75d7){var _0x30cfb9=this;return new Promise(function(_0x40e2ca,_0x1f6e49){if(_0x2e75d7){try{var _0x5e31ff=[];var _0x1963a9=getId(_0x2e75d7['channel'],_0x2e75d7[_0x42a0('0x17')]?_0x2e75d7[_0x42a0('0x17')]['id']:0x0,_0x2e75d7[_0x42a0('0x18')]?_0x2e75d7[_0x42a0('0x18')]['id']:0x0);if(_0x2e75d7[_0x42a0('0x19')]&&_[_0x42a0('0x1a')](_0x2e75d7['applications'])&&_0x2e75d7[_0x42a0('0x19')][_0x42a0('0x1b')]){for(var _0x5ef95a=0x0;_0x5ef95a<_0x2e75d7[_0x42a0('0x19')][_0x42a0('0x1b')];_0x5ef95a+=0x1){var _0x5a0619=_0x2e75d7[_0x42a0('0x19')][_0x5ef95a];if(fs[_0x42a0('0x1c')](path[_0x42a0('0x1d')](__dirname,_0x42a0('0x19'),_0x5a0619[_0x42a0('0x1e')]+_0x42a0('0x1f')))){var _0x301daa=[];switch(_0x5a0619[_0x42a0('0x1e')]['toLowerCase']()){case _0x42a0('0x20'):var _0xe1ec1b=_0x5a0619[_0x42a0('0x21')][_0x42a0('0x22')](',');_0x301daa['push'](_0xe1ec1b[0x0]);_0x301daa[_0x42a0('0x23')](_0xe1ec1b[_0x42a0('0x24')](0x1,_0xe1ec1b['length'])[_0x42a0('0x1d')](','));break;case _0x42a0('0x25'):var _0x2cd0d3=_0x5a0619['appdata'][_0x42a0('0x22')](',');_0x301daa[_0x42a0('0x23')](_0x2cd0d3[0x0]);_0x301daa[_0x42a0('0x23')](_0x2cd0d3[0x1]);_0x301daa[_0x42a0('0x23')](_0x2cd0d3[_0x42a0('0x24')](0x2,_0x2cd0d3['length'])['join'](','));break;case _0x42a0('0x26'):var _0x1cf77e=_0x5a0619[_0x42a0('0x21')]['split'](',');_0x301daa[_0x42a0('0x23')](_0x1cf77e[0x0]);_0x301daa[_0x42a0('0x23')](_0x1cf77e[0x1]);_0x301daa[_0x42a0('0x23')](_0x1cf77e[0x2]);_0x301daa[_0x42a0('0x23')](_0x1cf77e[0x3]);_0x301daa[_0x42a0('0x23')](_0x1cf77e[_0x42a0('0x24')](0x4,_0x1cf77e['length'])['join'](','));break;case _0x42a0('0x17'):_0x301daa[_0x42a0('0x23')](_0x5a0619[_0x42a0('0x21')]);break;case _0x42a0('0x27'):_0x301daa[_0x42a0('0x23')](_0x5a0619['TagId']);_0x301daa[_0x42a0('0x23')](_0x5a0619[_0x42a0('0x21')]);break;default:_0x301daa=_[_0x42a0('0x10')](_0x5a0619[_0x42a0('0x21')])?[]:_0x5a0619[_0x42a0('0x21')][_0x42a0('0x22')](',');}var _0x544817={'id':util[_0x42a0('0xe')](_0x42a0('0x28'),_0x1963a9,_0x5a0619['id'],_0x5a0619[_0x42a0('0x1e')]),'condition':require(_0x42a0('0x29'))[_0x42a0('0x2a')](_0x1963a9,getIntervals(_0x1cac16['intervals'],_0x5a0619),_0x1cac16),'consequence':require(_0x42a0('0x2b')+_0x5a0619[_0x42a0('0x1e')])[_0x42a0('0x2c')](_0x1963a9,_0x301daa,_0x1cac16,_0x2e75d7),'p':_0x5a0619[_0x42a0('0x2d')]||0x0};logger['info'](_0x42a0('0x2e'),_0x544817['id'],_0x42a0('0x2f'),getIntervals(_0x1cac16[_0x42a0('0x30')],_0x5a0619)[_0x42a0('0x1d')](_0x42a0('0x31')));_0x5e31ff[_0x42a0('0x23')](_0x544817);}else{logger['error'](_0x42a0('0x32'),path[_0x42a0('0x1d')](__dirname,'applications',_0x5a0619[_0x42a0('0x1e')]+_0x42a0('0x1f')));}}_0x1cac16[_0x42a0('0x16')][_0x1963a9]=new RuleEngine(_0x5e31ff);_0x1cac16[_0x42a0('0x16')][_0x1963a9]['execute'](_0x2e75d7,function(_0x27705f){logger[_0x42a0('0x33')](_0x42a0('0x34'),JSON[_0x42a0('0x35')](_0x27705f[_0x42a0('0x36')]));if(_0x1cac16['rules'][_0x1963a9]){_0x1cac16[_0x42a0('0x16')][_0x1963a9][_0x42a0('0x37')](_0x42a0('0x38'));}});return _0x40e2ca({'code':0xc8,'message':_0x2e75d7});}else{logger[_0x42a0('0x33')]('No\x20applications\x20to\x20execute');return _0x40e2ca({'code':0xc8,'message':_0x2e75d7});}}catch(_0x32755d){logger['error'](_0x32755d[_0x42a0('0x39')]);return _0x1f6e49(_0x30cfb9[_0x42a0('0x3a')](0x1f4,_0x32755d));}}return _0x1f6e49(_0x42a0('0x3b'));});},'AcceptMessage':function(_0x15e37b){var _0x45d3cc=this;return new Promise(function(_0x565834,_0x31e62d){if(_0x15e37b[_0x42a0('0x17')]&&_0x15e37b[_0x42a0('0x17')]['id']){try{var _0x47557b=getId(_0x15e37b['channel'],_0x15e37b[_0x42a0('0x17')]?_0x15e37b['message']['id']:0x0,_0x15e37b[_0x42a0('0x18')]?_0x15e37b[_0x42a0('0x18')]['id']:0x0);if(_0x1cac16[_0x42a0('0x16')][_0x47557b]){_0x1cac16[_0x42a0('0x16')][_0x47557b][_0x42a0('0x37')]('end');if(rpc[_0x15e37b[_0x42a0('0x3c')]+_0x42a0('0x3d')]){rpc[_0x15e37b[_0x42a0('0x3c')]+_0x42a0('0x3d')][_0x42a0('0x3e')](_0x47557b,{'UserId':_0x15e37b['message'][_0x42a0('0x3f')]})['catch'](function(_0x27a1eb){logger['error']('error\x20update\x20queue\x20report');});}}return _0x565834({'code':0xc8,'message':_0x15e37b});}catch(_0x297009){logger[_0x42a0('0x3a')](_0x297009['stack']);return _0x31e62d(_0x45d3cc[_0x42a0('0x3a')](0x1f4,_0x297009));}}logger[_0x42a0('0x3a')]('message\x20is\x20empty');return _0x31e62d(_0x45d3cc['error'](0x1f4,_0x42a0('0x40')));});},'RejectMessage':function(_0x5b151a){var _0x5e9d95=this;return new Promise(function(_0x107de4,_0x487ced){if(_0x5b151a[_0x42a0('0x41')]&&_0x5b151a[_0x42a0('0x41')]['id']){try{if(_0x1cac16[_0x42a0('0x42')][_0x5b151a['agent']['id']]){_0x1cac16[_0x42a0('0x42')][_0x5b151a[_0x42a0('0x41')]['id']][_0x42a0('0x43')]=![];_0x1cac16['agents'][_0x5b151a['agent']['id']][_0x42a0('0x44')]=undefined;}return _0x107de4({'code':0xc8,'message':_0x5b151a});}catch(_0x1a13b6){logger[_0x42a0('0x3a')](_0x1a13b6['stack']);return _0x487ced(_0x5e9d95[_0x42a0('0x3a')](0x1f4,_0x1a13b6));}}logger[_0x42a0('0x3a')](_0x42a0('0x40'));return _0x487ced(_0x5e9d95[_0x42a0('0x3a')](0x1f4,_0x42a0('0x40')));});},'AbandonInteraction':function(_0x41d2e7){var _0x30b4c1=this;return new Promise(function(_0x26cc88,_0x3ee204){if(_0x41d2e7[_0x42a0('0x3c')]&&_0x41d2e7[_0x42a0('0x18')]&&_0x41d2e7[_0x42a0('0x18')]['id']){try{var _0x463924=getId(_0x41d2e7['channel'],_0x41d2e7[_0x42a0('0x17')]?_0x41d2e7[_0x42a0('0x17')]['id']:0x0,_0x41d2e7[_0x42a0('0x18')]?_0x41d2e7['interaction']['id']:0x0);if(_0x1cac16[_0x42a0('0x16')][_0x463924]){_0x1cac16[_0x42a0('0x16')][_0x463924]['emit']('end');}return _0x26cc88({'code':0xc8,'message':_0x41d2e7});}catch(_0x49d5a6){logger[_0x42a0('0x3a')](_0x49d5a6['stack']);return _0x3ee204(_0x30b4c1[_0x42a0('0x3a')](0x1f4,_0x49d5a6));}}logger[_0x42a0('0x3a')]('message\x20is\x20empty');return _0x3ee204(_0x30b4c1['error'](0x1f4,_0x42a0('0x40')));});},'AgentCapacity':function(_0x1173f8){var _0x366af7=this;return new Promise(function(_0x1097ee,_0x4e4559){if(_0x1cac16[_0x42a0('0x42')][_0x42a0('0x45')](_0x1173f8['id'])){for(var _0x5d8e69 in _0x1173f8['capacity']){if(_0x1173f8[_0x42a0('0x46')][_0x42a0('0x45')](_0x5d8e69)){if(_0x1cac16[_0x42a0('0x42')][_0x1173f8['id']][_0x42a0('0x45')](_0x5d8e69+'CurrentCapacity')){_0x1cac16[_0x42a0('0x42')][_0x1173f8['id']][_0x5d8e69+'CurrentCapacity']=parseInt(_0x1173f8[_0x42a0('0x46')][_0x5d8e69],0xa);}}}_0x1cac16[_0x42a0('0x42')][_0x1173f8['id']][_0x42a0('0x47')]();return _0x1097ee({'code':0xc8,'message':_0x1cac16['agents'][_0x1173f8['id']]});}else{return _0x4e4559(_0x366af7[_0x42a0('0x3a')](0x1f4,_0x42a0('0x48')));}});},'Agents':function(_0x550ce6){return new Promise(function(_0x26aab1,_0x293518){var _0x39b9aa=_['values'](_0x1cac16['agents']);_0x26aab1({'count':_0x39b9aa[_0x42a0('0x1b')],'rows':_0x39b9aa});});},'ChatQueues':function(_0x6122d0){return new Promise(function(_0x481419,_0x3d1364){var _0x28d38e=[];for(var _0x4ba8fa in _0x1cac16['chatQueues']){if(_0x1cac16[_0x42a0('0x49')]['hasOwnProperty'](_0x4ba8fa)){var _0x3242f0=_0x1cac16['chatQueues'][_0x4ba8fa];var _0x19497f={'id':_0x3242f0['id'],'available':_0x3242f0[_0x42a0('0x4a')],'loggedIn':_0x3242f0[_0x42a0('0x4b')],'name':_0x3242f0[_0x42a0('0x4c')],'paused':_0x3242f0[_0x42a0('0x4d')],'waiting':_0x3242f0[_0x42a0('0x4e')]};_0x28d38e['push'](_0x19497f);}}_0x481419({'count':_0x28d38e[_0x42a0('0x1b')],'rows':_0x28d38e});});},'MailQueues':function(_0x1453bc){return new Promise(function(_0x108f4a,_0x635ac4){var _0x4ca135=[];for(var _0x5cc75e in _0x1cac16['mailQueues']){if(_0x1cac16[_0x42a0('0x4f')]['hasOwnProperty'](_0x5cc75e)){var _0x12bd6b=_0x1cac16['mailQueues'][_0x5cc75e];var _0x53dd49={'id':_0x12bd6b['id'],'available':_0x12bd6b['available'],'loggedIn':_0x12bd6b['loggedIn'],'name':_0x12bd6b[_0x42a0('0x4c')],'paused':_0x12bd6b[_0x42a0('0x4d')],'waiting':_0x12bd6b[_0x42a0('0x4e')]};_0x4ca135[_0x42a0('0x23')](_0x53dd49);}}_0x108f4a({'count':_0x4ca135[_0x42a0('0x1b')],'rows':_0x4ca135});});},'OpenchannelQueues':function(_0x21ac2b){return new Promise(function(_0x1fed8b,_0x2e6781){var _0x72372c=[];for(var _0x583c9e in _0x1cac16[_0x42a0('0x50')]){if(_0x1cac16[_0x42a0('0x50')][_0x42a0('0x45')](_0x583c9e)){var _0x391533=_0x1cac16['openchannelQueues'][_0x583c9e];var _0x149728={'id':_0x391533['id'],'available':_0x391533['available'],'loggedIn':_0x391533[_0x42a0('0x4b')],'name':_0x391533[_0x42a0('0x4c')],'paused':_0x391533[_0x42a0('0x4d')],'waiting':_0x391533['waiting']};_0x72372c[_0x42a0('0x23')](_0x149728);}}_0x1fed8b({'count':_0x72372c[_0x42a0('0x1b')],'rows':_0x72372c});});},'SmsQueues':function(_0x249517){return new Promise(function(_0x2f5c8e,_0x4c264e){var _0x7c2d1d=[];for(var _0x5b406b in _0x1cac16[_0x42a0('0x51')]){if(_0x1cac16[_0x42a0('0x51')][_0x42a0('0x45')](_0x5b406b)){var _0x56fa21=_0x1cac16[_0x42a0('0x51')][_0x5b406b];var _0xe45b59={'id':_0x56fa21['id'],'available':_0x56fa21[_0x42a0('0x4a')],'loggedIn':_0x56fa21[_0x42a0('0x4b')],'name':_0x56fa21[_0x42a0('0x4c')],'paused':_0x56fa21[_0x42a0('0x4d')],'waiting':_0x56fa21[_0x42a0('0x4e')]};_0x7c2d1d[_0x42a0('0x23')](_0xe45b59);}}_0x2f5c8e({'count':_0x7c2d1d[_0x42a0('0x1b')],'rows':_0x7c2d1d});});},'FaxQueues':function(_0x264344){return new Promise(function(_0x5f3972,_0x234f35){var _0x2294cd=[];for(var _0x5f30bb in _0x1cac16[_0x42a0('0x52')]){if(_0x1cac16[_0x42a0('0x52')]['hasOwnProperty'](_0x5f30bb)){var _0x593d44=_0x1cac16['faxQueues'][_0x5f30bb];var _0x5ebe57={'id':_0x593d44['id'],'available':_0x593d44[_0x42a0('0x4a')],'loggedIn':_0x593d44[_0x42a0('0x4b')],'name':_0x593d44[_0x42a0('0x4c')],'paused':_0x593d44['paused'],'waiting':_0x593d44['waiting']};_0x2294cd['push'](_0x5ebe57);}}_0x5f3972({'count':_0x2294cd[_0x42a0('0x1b')],'rows':_0x2294cd});});},'ChatQueuesWaitingInteractions':function(_0x248d8e){return new Promise(function(_0x4b5956,_0x593501){var _0x41e4c7=_[_0x42a0('0x53')](_0x1cac16[_0x42a0('0x54')]);_0x4b5956({'count':_0x41e4c7[_0x42a0('0x1b')],'rows':_0x41e4c7});});},'MailQueuesWaitingInteractions':function(_0x4f0713){return new Promise(function(_0x509865,_0xf39632){var _0x84abdc=_['values'](_0x1cac16[_0x42a0('0x55')]);_0x509865({'count':_0x84abdc[_0x42a0('0x1b')],'rows':_0x84abdc});});},'OpenchannelQueuesWaitingInteractions':function(_0x5302ed){return new Promise(function(_0x224dd3,_0x10e49e){var _0x453bcd=_['values'](_0x1cac16['openchannelQueuesWaitingInteractions']);_0x224dd3({'count':_0x453bcd['length'],'rows':_0x453bcd});});},'SmsQueuesWaitingInteractions':function(_0x12f136){return new Promise(function(_0xa44bde,_0xf5d1e2){var _0x548e68=_[_0x42a0('0x53')](_0x1cac16['smsQueuesWaitingInteractions']);_0xa44bde({'count':_0x548e68[_0x42a0('0x1b')],'rows':_0x548e68});});},'FaxQueuesWaitingInteractions':function(_0x243e77){return new Promise(function(_0x29bdef,_0x3067ab){var _0x13cf70=_['values'](_0x1cac16['faxQueuesWaitingInteractions']);_0x29bdef({'count':_0x13cf70[_0x42a0('0x1b')],'rows':_0x13cf70});});}};var _0x3302fe=jayson[_0x42a0('0x56')](_0x123335)[_0x42a0('0x57')]();_0x3302fe['on'](_0x42a0('0x3a'),function(_0x49aa4e){logger[_0x42a0('0x3a')](JSON[_0x42a0('0x35')](_0x49aa4e));return _0x3dc172(_0x49aa4e);});_0x3302fe[_0x42a0('0x15')](0x232c,_0x42a0('0x58'),function(){console[_0x42a0('0x59')](_0x42a0('0x5a'),0x232c);return _0x15c42d(_0x42a0('0x5b')+0x232c);});});}; \ No newline at end of file +var _0x1888=['../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','message','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','push','slice','dialogflow','split','amazonlex','tag','%s:%s:%s','./interval','intervals','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','channel','end','QueueReport','update','UserId','catch','stack','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing'];(function(_0x9eb079,_0x5d4e84){var _0x49dadd=function(_0x1a05dc){while(--_0x1a05dc){_0x9eb079['push'](_0x9eb079['shift']());}};_0x49dadd(++_0x5d4e84);}(_0x1888,0xfd));var _0x8188=function(_0x9aca96,_0x497a2a){_0x9aca96=_0x9aca96-0x0;var _0x2d64a5=_0x1888[_0x9aca96];return _0x2d64a5;};'use strict';var _=require('lodash');var util=require(_0x8188('0x0'));var path=require(_0x8188('0x1'));var fs=require('fs');var jayson=require(_0x8188('0x2'));var BPromise=require(_0x8188('0x3'));var uuid=require(_0x8188('0x4'));var config=require(_0x8188('0x5'));var logger=require(_0x8188('0x6'))(_0x8188('0x7'));var rpc={'openchannelQueueReport':require(_0x8188('0x8'))};var rpc={'openchannelQueueReport':require(_0x8188('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x8188('0x9')),'smsQueueReport':require(_0x8188('0xa')),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x12928c,_0xb47b70,_0x40732e){return util[_0x8188('0xb')](_0x8188('0xc'),_0x12928c,_0xb47b70||0x0,_0x40732e||0x0);}function getIntervals(_0x315e89,_0x5ebc31){var _0x62e033=[];if(!_[_0x8188('0xd')](_0x5ebc31[_0x8188('0xe')])&&!_[_0x8188('0xd')](_0x315e89[_0x5ebc31[_0x8188('0xe')]])&&!_[_0x8188('0xd')](_0x315e89[_0x5ebc31[_0x8188('0xe')]][_0x8188('0xf')])){_0x62e033=_['map'](_0x315e89[_0x5ebc31[_0x8188('0xe')]][_0x8188('0xf')],'interval');}else if(!_['isNil'](_0x5ebc31[_0x8188('0x10')])){_0x62e033=[_0x5ebc31['interval']];}return _0x62e033;}exports[_0x8188('0x11')]=function(_0x2f2815){_0x2f2815[_0x8188('0x12')]={};return new BPromise(function(_0x30bccf,_0x22e948){var _0x45473a={'Start':function(_0x452314){var _0x3feba3=this;return new Promise(function(_0x271a0b,_0x4f1563){if(_0x452314){try{var _0x19f0e0=[];var _0x216de5=getId(_0x452314['channel'],_0x452314[_0x8188('0x13')]?_0x452314[_0x8188('0x13')]['id']:0x0,_0x452314[_0x8188('0x14')]?_0x452314['interaction']['id']:0x0);if(_0x452314['applications']&&_['isArray'](_0x452314[_0x8188('0x15')])&&_0x452314[_0x8188('0x15')][_0x8188('0x16')]){for(var _0x318243=0x0;_0x318243<_0x452314[_0x8188('0x15')][_0x8188('0x16')];_0x318243+=0x1){var _0x2fbb7c=_0x452314['applications'][_0x318243];if(fs[_0x8188('0x17')](path[_0x8188('0x18')](__dirname,_0x8188('0x15'),_0x2fbb7c[_0x8188('0x19')]+_0x8188('0x1a')))){var _0x41f363=[];switch(_0x2fbb7c['app'][_0x8188('0x1b')]()){case _0x8188('0x1c'):var _0x5a5839=_0x2fbb7c[_0x8188('0x1d')]['split'](',');_0x41f363[_0x8188('0x1e')](_0x5a5839[0x0]);_0x41f363['push'](_0x5a5839[_0x8188('0x1f')](0x1,_0x5a5839['length'])[_0x8188('0x18')](','));break;case _0x8188('0x20'):var _0x101250=_0x2fbb7c[_0x8188('0x1d')][_0x8188('0x21')](',');_0x41f363[_0x8188('0x1e')](_0x101250[0x0]);_0x41f363[_0x8188('0x1e')](_0x101250[0x1]);_0x41f363[_0x8188('0x1e')](_0x101250[_0x8188('0x1f')](0x2,_0x101250[_0x8188('0x16')])[_0x8188('0x18')](','));break;case _0x8188('0x22'):var _0xa444fe=_0x2fbb7c['appdata']['split'](',');_0x41f363[_0x8188('0x1e')](_0xa444fe[0x0]);_0x41f363[_0x8188('0x1e')](_0xa444fe[0x1]);_0x41f363['push'](_0xa444fe[0x2]);_0x41f363['push'](_0xa444fe[0x3]);_0x41f363['push'](_0xa444fe[_0x8188('0x1f')](0x4,_0xa444fe[_0x8188('0x16')])[_0x8188('0x18')](','));break;case _0x8188('0x13'):_0x41f363[_0x8188('0x1e')](_0x2fbb7c[_0x8188('0x1d')]);break;case _0x8188('0x23'):_0x41f363[_0x8188('0x1e')](_0x2fbb7c['TagId']);_0x41f363['push'](_0x2fbb7c['appdata']);break;default:_0x41f363=_[_0x8188('0xd')](_0x2fbb7c[_0x8188('0x1d')])?[]:_0x2fbb7c[_0x8188('0x1d')][_0x8188('0x21')](',');}var _0xeef8da={'id':util['format'](_0x8188('0x24'),_0x216de5,_0x2fbb7c['id'],_0x2fbb7c[_0x8188('0x19')]),'condition':require(_0x8188('0x25'))['condition'](_0x216de5,getIntervals(_0x2f2815[_0x8188('0x26')],_0x2fbb7c),_0x2f2815),'consequence':require('./applications/'+_0x2fbb7c[_0x8188('0x19')])['consequence'](_0x216de5,_0x41f363,_0x2f2815,_0x452314),'p':_0x2fbb7c[_0x8188('0x27')]||0x0};logger[_0x8188('0x28')](_0x8188('0x29'),_0xeef8da['id'],_0x8188('0x2a'),getIntervals(_0x2f2815['intervals'],_0x2fbb7c)[_0x8188('0x18')](_0x8188('0x2b')));_0x19f0e0[_0x8188('0x1e')](_0xeef8da);}else{logger[_0x8188('0x2c')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x8188('0x18')](__dirname,'applications',_0x2fbb7c[_0x8188('0x19')]+_0x8188('0x1a')));}}_0x2f2815[_0x8188('0x12')][_0x216de5]=new RuleEngine(_0x19f0e0);_0x2f2815[_0x8188('0x12')][_0x216de5][_0x8188('0x2d')](_0x452314,function(_0x307a97){logger[_0x8188('0x28')](_0x8188('0x2e'),JSON[_0x8188('0x2f')](_0x307a97[_0x8188('0x30')]));if(_0x2f2815[_0x8188('0x12')][_0x216de5]){_0x2f2815[_0x8188('0x12')][_0x216de5][_0x8188('0x31')](_0x8188('0x32'));}});return _0x271a0b({'code':0xc8,'message':_0x452314});}else{logger[_0x8188('0x28')](_0x8188('0x33'));return _0x271a0b({'code':0xc8,'message':_0x452314});}}catch(_0x2233f0){logger['error'](_0x2233f0['stack']);return _0x4f1563(_0x3feba3[_0x8188('0x2c')](0x1f4,_0x2233f0));}}return _0x4f1563('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2738ea){var _0x18876e=this;return new Promise(function(_0x206600,_0x12fe75){if(_0x2738ea[_0x8188('0x13')]&&_0x2738ea[_0x8188('0x13')]['id']){try{var _0x15199b=getId(_0x2738ea[_0x8188('0x34')],_0x2738ea[_0x8188('0x13')]?_0x2738ea['message']['id']:0x0,_0x2738ea[_0x8188('0x14')]?_0x2738ea[_0x8188('0x14')]['id']:0x0);if(_0x2f2815[_0x8188('0x12')][_0x15199b]){_0x2f2815[_0x8188('0x12')][_0x15199b][_0x8188('0x31')](_0x8188('0x35'));if(rpc[_0x2738ea[_0x8188('0x34')]+_0x8188('0x36')]){rpc[_0x2738ea[_0x8188('0x34')]+_0x8188('0x36')][_0x8188('0x37')](_0x15199b,{'UserId':_0x2738ea[_0x8188('0x13')][_0x8188('0x38')]})[_0x8188('0x39')](function(_0xf0ab40){logger['error']('error\x20update\x20queue\x20report');});}}return _0x206600({'code':0xc8,'message':_0x2738ea});}catch(_0x3e7203){logger[_0x8188('0x2c')](_0x3e7203[_0x8188('0x3a')]);return _0x12fe75(_0x18876e[_0x8188('0x2c')](0x1f4,_0x3e7203));}}logger['error'](_0x8188('0x3b'));return _0x12fe75(_0x18876e[_0x8188('0x2c')](0x1f4,_0x8188('0x3b')));});},'RejectMessage':function(_0x26aeec){var _0x32cf8d=this;return new Promise(function(_0x4e4c3b,_0x2687a3){if(_0x26aeec[_0x8188('0x3c')]&&_0x26aeec[_0x8188('0x3c')]['id']){try{if(_0x2f2815['agents'][_0x26aeec[_0x8188('0x3c')]['id']]){_0x2f2815[_0x8188('0x3d')][_0x26aeec['agent']['id']][_0x8188('0x3e')]=![];_0x2f2815[_0x8188('0x3d')][_0x26aeec['agent']['id']][_0x8188('0x3f')]=undefined;}return _0x4e4c3b({'code':0xc8,'message':_0x26aeec});}catch(_0x5c30d4){logger[_0x8188('0x2c')](_0x5c30d4[_0x8188('0x3a')]);return _0x2687a3(_0x32cf8d[_0x8188('0x2c')](0x1f4,_0x5c30d4));}}logger['error'](_0x8188('0x3b'));return _0x2687a3(_0x32cf8d[_0x8188('0x2c')](0x1f4,_0x8188('0x3b')));});},'AbandonInteraction':function(_0x5c5a5e){var _0x530301=this;return new Promise(function(_0x517966,_0x2dc809){if(_0x5c5a5e[_0x8188('0x34')]&&_0x5c5a5e[_0x8188('0x14')]&&_0x5c5a5e[_0x8188('0x14')]['id']){try{var _0x508b07=getId(_0x5c5a5e[_0x8188('0x34')],_0x5c5a5e['message']?_0x5c5a5e[_0x8188('0x13')]['id']:0x0,_0x5c5a5e['interaction']?_0x5c5a5e[_0x8188('0x14')]['id']:0x0);if(_0x2f2815[_0x8188('0x12')][_0x508b07]){_0x2f2815[_0x8188('0x12')][_0x508b07]['emit']('end');}return _0x517966({'code':0xc8,'message':_0x5c5a5e});}catch(_0x5df9fb){logger[_0x8188('0x2c')](_0x5df9fb['stack']);return _0x2dc809(_0x530301['error'](0x1f4,_0x5df9fb));}}logger['error'](_0x8188('0x3b'));return _0x2dc809(_0x530301[_0x8188('0x2c')](0x1f4,_0x8188('0x3b')));});},'AgentCapacity':function(_0x3ca6a0){var _0x14919b=this;return new Promise(function(_0x4cce45,_0x161e62){if(_0x2f2815[_0x8188('0x3d')][_0x8188('0x40')](_0x3ca6a0['id'])){for(var _0x22fb20 in _0x3ca6a0[_0x8188('0x41')]){if(_0x3ca6a0[_0x8188('0x41')][_0x8188('0x40')](_0x22fb20)){if(_0x2f2815['agents'][_0x3ca6a0['id']][_0x8188('0x40')](_0x22fb20+'CurrentCapacity')){_0x2f2815[_0x8188('0x3d')][_0x3ca6a0['id']][_0x22fb20+_0x8188('0x42')]=parseInt(_0x3ca6a0[_0x8188('0x41')][_0x22fb20],0xa);}}}_0x2f2815[_0x8188('0x3d')][_0x3ca6a0['id']]['updateRealtime']();return _0x4cce45({'code':0xc8,'message':_0x2f2815[_0x8188('0x3d')][_0x3ca6a0['id']]});}else{return _0x161e62(_0x14919b[_0x8188('0x2c')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x3838e0){return new Promise(function(_0x1ad446,_0x4ed9a4){var _0x3017c3=_[_0x8188('0x43')](_0x2f2815[_0x8188('0x3d')]);_0x1ad446({'count':_0x3017c3[_0x8188('0x16')],'rows':_0x3017c3});});},'ChatQueues':function(_0x4d899b){return new Promise(function(_0x5456a6,_0xcd6608){var _0x4adfe9=[];for(var _0x39241e in _0x2f2815[_0x8188('0x44')]){if(_0x2f2815[_0x8188('0x44')]['hasOwnProperty'](_0x39241e)){var _0x2e48ef=_0x2f2815[_0x8188('0x44')][_0x39241e];var _0x2a2ba2={'id':_0x2e48ef['id'],'available':_0x2e48ef[_0x8188('0x45')],'loggedIn':_0x2e48ef['loggedIn'],'name':_0x2e48ef[_0x8188('0x46')],'paused':_0x2e48ef[_0x8188('0x47')],'waiting':_0x2e48ef[_0x8188('0x48')]};_0x4adfe9['push'](_0x2a2ba2);}}_0x5456a6({'count':_0x4adfe9[_0x8188('0x16')],'rows':_0x4adfe9});});},'MailQueues':function(_0x5badb7){return new Promise(function(_0x460a2e,_0x34b8a7){var _0x52923a=[];for(var _0x55f046 in _0x2f2815[_0x8188('0x49')]){if(_0x2f2815[_0x8188('0x49')][_0x8188('0x40')](_0x55f046)){var _0x4c7c1f=_0x2f2815[_0x8188('0x49')][_0x55f046];var _0x7c16cc={'id':_0x4c7c1f['id'],'available':_0x4c7c1f[_0x8188('0x45')],'loggedIn':_0x4c7c1f[_0x8188('0x4a')],'name':_0x4c7c1f[_0x8188('0x46')],'paused':_0x4c7c1f[_0x8188('0x47')],'waiting':_0x4c7c1f[_0x8188('0x48')]};_0x52923a[_0x8188('0x1e')](_0x7c16cc);}}_0x460a2e({'count':_0x52923a[_0x8188('0x16')],'rows':_0x52923a});});},'OpenchannelQueues':function(_0x319e7c){return new Promise(function(_0x419183,_0x398e2d){var _0x5e2dd1=[];for(var _0x69fc26 in _0x2f2815['openchannelQueues']){if(_0x2f2815[_0x8188('0x4b')][_0x8188('0x40')](_0x69fc26)){var _0x16d0e6=_0x2f2815[_0x8188('0x4b')][_0x69fc26];var _0x241938={'id':_0x16d0e6['id'],'available':_0x16d0e6['available'],'loggedIn':_0x16d0e6[_0x8188('0x4a')],'name':_0x16d0e6['name'],'paused':_0x16d0e6[_0x8188('0x47')],'waiting':_0x16d0e6[_0x8188('0x48')]};_0x5e2dd1[_0x8188('0x1e')](_0x241938);}}_0x419183({'count':_0x5e2dd1[_0x8188('0x16')],'rows':_0x5e2dd1});});},'SmsQueues':function(_0x5af4be){return new Promise(function(_0x3b2157,_0x3d78bc){var _0x278295=[];for(var _0xf8763c in _0x2f2815[_0x8188('0x4c')]){if(_0x2f2815[_0x8188('0x4c')][_0x8188('0x40')](_0xf8763c)){var _0x1b60ac=_0x2f2815['smsQueues'][_0xf8763c];var _0x2e7af8={'id':_0x1b60ac['id'],'available':_0x1b60ac['available'],'loggedIn':_0x1b60ac[_0x8188('0x4a')],'name':_0x1b60ac[_0x8188('0x46')],'paused':_0x1b60ac[_0x8188('0x47')],'waiting':_0x1b60ac[_0x8188('0x48')]};_0x278295[_0x8188('0x1e')](_0x2e7af8);}}_0x3b2157({'count':_0x278295[_0x8188('0x16')],'rows':_0x278295});});},'FaxQueues':function(_0x2eec46){return new Promise(function(_0x188ae9,_0x1ebc41){var _0xc06ea7=[];for(var _0x3b8714 in _0x2f2815[_0x8188('0x4d')]){if(_0x2f2815[_0x8188('0x4d')][_0x8188('0x40')](_0x3b8714)){var _0x49c75c=_0x2f2815[_0x8188('0x4d')][_0x3b8714];var _0x273dca={'id':_0x49c75c['id'],'available':_0x49c75c[_0x8188('0x45')],'loggedIn':_0x49c75c[_0x8188('0x4a')],'name':_0x49c75c[_0x8188('0x46')],'paused':_0x49c75c[_0x8188('0x47')],'waiting':_0x49c75c[_0x8188('0x48')]};_0xc06ea7[_0x8188('0x1e')](_0x273dca);}}_0x188ae9({'count':_0xc06ea7[_0x8188('0x16')],'rows':_0xc06ea7});});},'ChatQueuesWaitingInteractions':function(_0x13511d){return new Promise(function(_0x374c96,_0x365c02){var _0x174f36=_['values'](_0x2f2815[_0x8188('0x4e')]);_0x374c96({'count':_0x174f36[_0x8188('0x16')],'rows':_0x174f36});});},'MailQueuesWaitingInteractions':function(_0x492c20){return new Promise(function(_0x28f57f,_0xcfa1ed){var _0x1f657a=_[_0x8188('0x43')](_0x2f2815['mailQueuesWaitingInteractions']);_0x28f57f({'count':_0x1f657a['length'],'rows':_0x1f657a});});},'OpenchannelQueuesWaitingInteractions':function(_0x4cf4b4){return new Promise(function(_0x13ad88,_0x41c165){var _0x17ae72=_['values'](_0x2f2815[_0x8188('0x4f')]);_0x13ad88({'count':_0x17ae72[_0x8188('0x16')],'rows':_0x17ae72});});},'SmsQueuesWaitingInteractions':function(_0x4b9fcb){return new Promise(function(_0xc3a2a5,_0x2833f7){var _0x10b681=_[_0x8188('0x43')](_0x2f2815[_0x8188('0x50')]);_0xc3a2a5({'count':_0x10b681[_0x8188('0x16')],'rows':_0x10b681});});},'FaxQueuesWaitingInteractions':function(_0x231f44){return new Promise(function(_0x55d99c,_0x593e46){var _0x3051d3=_[_0x8188('0x43')](_0x2f2815[_0x8188('0x51')]);_0x55d99c({'count':_0x3051d3['length'],'rows':_0x3051d3});});}};var _0x105ae5=jayson['server'](_0x45473a)[_0x8188('0x52')]();_0x105ae5['on'](_0x8188('0x2c'),function(_0x10568c){logger['error'](JSON['stringify'](_0x10568c));return _0x22e948(_0x10568c);});_0x105ae5[_0x8188('0x11')](0x232c,_0x8188('0x53'),function(){console[_0x8188('0x54')](_0x8188('0x55'),0x232c);return _0x30bccf(_0x8188('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 8918ae3..381a87b 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 _0x5308=['indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','bluebird','jayson/promise','../../../config/logger','routing','client','http','request','then','error','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','message'];(function(_0x334b5e,_0x28254a){var _0x567fba=function(_0x8c4ed2){while(--_0x8c4ed2){_0x334b5e['push'](_0x334b5e['shift']());}};_0x567fba(++_0x28254a);}(_0x5308,0xbe));var _0x8530=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x5308[_0x5cc8b9];return _0x58892e;};'use strict';var util=require('util');var BPromise=require(_0x8530('0x0'));var jayson=require(_0x8530('0x1'));var _=require('lodash');var logger=require(_0x8530('0x2'))(_0x8530('0x3'));var client=jayson[_0x8530('0x4')][_0x8530('0x5')]({'port':0x232a});function request(_0x19ead0,_0x51f028){return new BPromise(function(_0x23a0f1,_0x4d78e1){return client[_0x8530('0x6')](_0x19ead0,_0x51f028)[_0x8530('0x7')](function(_0x4ecc0c){if(_0x4ecc0c['error']){return _0x4d78e1(_0x4ecc0c[_0x8530('0x8')]['message']);}else{return _0x23a0f1(_0x4ecc0c['result']);}})[_0x8530('0x9')](function(_0x538be9){return _0x4d78e1(_0x538be9);});});}exports[_0x8530('0xa')]=function(_0x3c32ea,_0x295ef5,_0x199bae){return function(_0x1c14ac){if(_0x199bae[_0x8530('0xb')]&&!_0x199bae['rules'][_0x3c32ea]){logger[_0x8530('0xc')](_0x8530('0xd'),_0x3c32ea);return _0x1c14ac[_0x8530('0xe')]();}var _0x42a86a=[];for(var _0x10c892=0x0;_0x10c892<_0x295ef5[_0x8530('0xf')];_0x10c892+=0x1){_0x42a86a['push'](request(_0x8530('0x10'),{'command':util[_0x8530('0x11')](_0x8530('0x12'),_0x295ef5[_0x10c892])})['then'](function(_0x4560db){return _0x4560db&&_0x4560db[_0x8530('0x13')]&&_0x4560db['message'][_0x8530('0x14')](_0x8530('0x15'))>=0x0?!![]:![];})[_0x8530('0x9')](function(_0x454b6d){logger[_0x8530('0x8')](_0x8530('0x16'),_0x3c32ea,_0x295ef5[_0x10c892]);}));}BPromise[_0x8530('0x17')](_0x42a86a)[_0x8530('0x7')](function(_0x1e2feb){var _0x2f497f=_[_0x8530('0x18')](_0x1e2feb);logger[_0x8530('0xc')](_0x8530('0x19'),_0x3c32ea,_0x295ef5[_0x8530('0x1a')](_0x8530('0x1b')),_0x2f497f);_0x1c14ac[_0x8530('0x1c')](_0x2f497f);})[_0x8530('0x9')](function(_0x3a92f9){console['log'](_0x3a92f9);logger[_0x8530('0x8')](_0x8530('0x19'),_0x3c32ea,_0x295ef5['join'](_0x8530('0x1b')),_0x3a92f9[_0x8530('0x1d')]);_0x1c14ac['stop']();});};}; \ No newline at end of file +var _0xd3e3=['lodash','routing','client','request','error','message','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','iftime\x20%s','then','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','\x20|\x20','stack','stop','bluebird','jayson/promise'];(function(_0x189ada,_0x8aee39){var _0x37f78f=function(_0x4df9ba){while(--_0x4df9ba){_0x189ada['push'](_0x189ada['shift']());}};_0x37f78f(++_0x8aee39);}(_0xd3e3,0x1c9));var _0x3d3e=function(_0x1ab2cf,_0x4f2f4e){_0x1ab2cf=_0x1ab2cf-0x0;var _0x3a8aa0=_0xd3e3[_0x1ab2cf];return _0x3a8aa0;};'use strict';var util=require('util');var BPromise=require(_0x3d3e('0x0'));var jayson=require(_0x3d3e('0x1'));var _=require(_0x3d3e('0x2'));var logger=require('../../../config/logger')(_0x3d3e('0x3'));var client=jayson[_0x3d3e('0x4')]['http']({'port':0x232a});function request(_0x47e193,_0x5344fe){return new BPromise(function(_0x14f02c,_0x5049a1){return client[_0x3d3e('0x5')](_0x47e193,_0x5344fe)['then'](function(_0x5412bf){if(_0x5412bf['error']){return _0x5049a1(_0x5412bf[_0x3d3e('0x6')][_0x3d3e('0x7')]);}else{return _0x14f02c(_0x5412bf['result']);}})[_0x3d3e('0x8')](function(_0x5857b2){return _0x5049a1(_0x5857b2);});});}exports[_0x3d3e('0x9')]=function(_0x1cf73f,_0x19bc65,_0x2b8083){return function(_0x419312){if(_0x2b8083[_0x3d3e('0xa')]&&!_0x2b8083[_0x3d3e('0xa')][_0x1cf73f]){logger['info'](_0x3d3e('0xb'),_0x1cf73f);return _0x419312['stop']();}var _0xb42d80=[];for(var _0x354df1=0x0;_0x354df1<_0x19bc65[_0x3d3e('0xc')];_0x354df1+=0x1){_0xb42d80[_0x3d3e('0xd')](request(_0x3d3e('0xe'),{'command':util['format'](_0x3d3e('0xf'),_0x19bc65[_0x354df1])})[_0x3d3e('0x10')](function(_0x28baba){return _0x28baba&&_0x28baba[_0x3d3e('0x7')]&&_0x28baba[_0x3d3e('0x7')]['indexOf'](_0x3d3e('0x11'))>=0x0?!![]:![];})[_0x3d3e('0x8')](function(_0x2957f0){logger[_0x3d3e('0x6')](_0x3d3e('0x12'),_0x1cf73f,_0x19bc65[_0x354df1]);}));}BPromise[_0x3d3e('0x13')](_0xb42d80)[_0x3d3e('0x10')](function(_0x3b7b8a){var _0x58c33f=_[_0x3d3e('0x14')](_0x3b7b8a);logger['info'](_0x3d3e('0x15'),_0x1cf73f,_0x19bc65[_0x3d3e('0x16')]('\x20|\x20'),_0x58c33f);_0x419312[_0x3d3e('0x17')](_0x58c33f);})[_0x3d3e('0x8')](function(_0x1b71ab){console['log'](_0x1b71ab);logger[_0x3d3e('0x6')]('[%s][INTERVAL]\x20%s\x20%s',_0x1cf73f,_0x19bc65[_0x3d3e('0x16')](_0x3d3e('0x18')),_0x1b71ab[_0x3d3e('0x19')]);_0x419312[_0x3d3e('0x1a')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 01c15b9..b66c99c 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 _0xd7a4=['connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','agentcalledAt','now','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','forIn','abandoned','reason','agentconnect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','agent','lodash','util','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','channel','membername','interface','calleridnum'];(function(_0x42d142,_0x309e7d){var _0x39b768=function(_0x4d9163){while(--_0x4d9163){_0x42d142['push'](_0x42d142['shift']());}};_0x39b768(++_0x309e7d);}(_0xd7a4,0x7e));var _0x4d7a=function(_0x16e0a4,_0xb3ddb9){_0x16e0a4=_0x16e0a4-0x0;var _0x3d6966=_0xd7a4[_0x16e0a4];return _0x3d6966;};'use strict';var _=require(_0x4d7a('0x0'));var util=require(_0x4d7a('0x1'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x3a5751,_0x382e1d){utils[_0x4d7a('0x2')](util['format'](_0x4d7a('0x3'),_0x3a5751['uniqueid'],_0x3a5751[_0x4d7a('0x4')],_0x3a5751['queue'],_0x3a5751[_0x4d7a('0x5')],_0x3a5751[_0x4d7a('0x6')],_0x3a5751[_0x4d7a('0x7')],_0x3a5751[_0x4d7a('0x8')],_0x3a5751[_0x4d7a('0x9')]));if(_0x3a5751[_0x4d7a('0xa')]){utils[_0x4d7a('0xb')](_0x3a5751[_0x4d7a('0xa')])[_0x4d7a('0xc')](function(_0x4f70fd){if(_0x4f70fd){_0x3a5751[_0x4d7a('0xd')]=_0x4f70fd['type'];_0x3a5751[_0x4d7a('0xe')]=_0x3a5751[_0x4d7a('0xf')]?_0x4f70fd['acw']:![];_0x3a5751['acwtime']=_0x3a5751['agentacw']?_0x4f70fd[_0x4d7a('0x10')]:0x0;}utils[_0x4d7a('0x11')](_0x4d7a('0x12'),_0x3a5751);});}else{utils[_0x4d7a('0x11')](_0x4d7a('0x12'),_0x3a5751);}if(_0x382e1d){delete transfers[_0x3a5751[_0x4d7a('0x13')]];}else{delete agents[_0x3a5751[_0x4d7a('0x14')]];}}exports[_0x4d7a('0x15')]=function(_0x183fe1){try{agents[_0x183fe1[_0x4d7a('0x14')]]=_0x183fe1;agents[_0x183fe1[_0x4d7a('0x14')]][_0x4d7a('0x16')]=utils[_0x4d7a('0x17')]();agents[_0x183fe1[_0x4d7a('0x14')]][_0x4d7a('0x9')]='called';agents[_0x183fe1[_0x4d7a('0x14')]][_0x4d7a('0x8')]=null;agents[_0x183fe1[_0x4d7a('0x14')]]['connectedlinename']=null;}catch(_0x4216e9){utils[_0x4d7a('0x18')](_0x4216e9[_0x4d7a('0x19')]);}};exports[_0x4d7a('0x1a')]=function(_0x1f6083){try{if(!_[_0x4d7a('0x1b')](agents[_0x1f6083[_0x4d7a('0x14')]])){agents[_0x1f6083[_0x4d7a('0x14')]][_0x4d7a('0x1a')]=!![];agents[_0x1f6083['destuniqueid']][_0x4d7a('0x1c')]=utils['now']();agents[_0x1f6083[_0x4d7a('0x14')]][_0x4d7a('0x9')]=_0x4d7a('0x1d');agents[_0x1f6083[_0x4d7a('0x14')]]['reason']=_0x4d7a('0x1d');agents[_0x1f6083[_0x4d7a('0x14')]][_0x4d7a('0x1e')]=_0x1f6083[_0x4d7a('0x1f')]?parseInt(_0x1f6083[_0x4d7a('0x1f')])/0x3e8:0x0;agents[_0x1f6083[_0x4d7a('0x14')]][_0x4d7a('0x20')]=0x0;writeDB(agents[_0x1f6083[_0x4d7a('0x14')]]);}}catch(_0x4bd537){utils[_0x4d7a('0x18')](_0x4bd537['stack']);}};exports['queuecallerabandon']=function(_0x2ec226){try{_[_0x4d7a('0x21')](agents,function(_0x39ee63,_0x438ec7){if(_0x39ee63[_0x4d7a('0x13')]==_0x2ec226[_0x4d7a('0x13')]){_0x39ee63[_0x4d7a('0x1a')]=!![];_0x39ee63[_0x4d7a('0x1c')]=utils[_0x4d7a('0x17')]();_0x39ee63['lastevent']=_0x4d7a('0x22');_0x39ee63[_0x4d7a('0x23')]=_0x4d7a('0x22');_0x39ee63[_0x4d7a('0x1e')]=_0x2ec226[_0x4d7a('0x1e')];_0x39ee63[_0x4d7a('0x20')]=0x0;writeDB(_0x39ee63);}});}catch(_0x311bd9){utils[_0x4d7a('0x18')](_0x311bd9[_0x4d7a('0x19')]);}};exports[_0x4d7a('0x24')]=function(_0xd437b9){try{if(agents[_0xd437b9['destuniqueid']]){agents[_0xd437b9[_0x4d7a('0x14')]][_0x4d7a('0x25')]=utils['now']();agents[_0xd437b9[_0x4d7a('0x14')]][_0x4d7a('0x8')]=_0xd437b9[_0x4d7a('0x8')];agents[_0xd437b9[_0x4d7a('0x14')]]['connectedlinename']=_0xd437b9[_0x4d7a('0x26')];agents[_0xd437b9['destuniqueid']]['holdtime']=_0xd437b9['ringtime'];agents[_0xd437b9[_0x4d7a('0x14')]][_0x4d7a('0x9')]='connect';_[_0x4d7a('0x21')](agents,function(_0x47f355,_0xd1eb12){if(_0x47f355[_0x4d7a('0x14')]!=_0xd437b9[_0x4d7a('0x14')]&&_0x47f355[_0x4d7a('0x13')]==_0xd437b9[_0x4d7a('0x13')]){_0x47f355['talktime']=0x0;_0x47f355['holdtime']=_0xd437b9[_0x4d7a('0x1f')];_0x47f355[_0x4d7a('0x1a')]=!![];_0x47f355[_0x4d7a('0x1c')]=utils[_0x4d7a('0x17')]();_0x47f355[_0x4d7a('0x9')]=_0x4d7a('0x27');_0x47f355[_0x4d7a('0x23')]='answered_elsewhere';_0x47f355[_0x4d7a('0x28')]=_0xd437b9['destuniqueid'];_0x47f355[_0x4d7a('0x29')]=_0xd437b9[_0x4d7a('0x5')];writeDB(_0x47f355);}});}}catch(_0x73c7e7){utils[_0x4d7a('0x18')](_0x73c7e7[_0x4d7a('0x19')]);}};exports[_0x4d7a('0xf')]=function(_0x5c1095){try{if(!_[_0x4d7a('0x1b')](agents[_0x5c1095[_0x4d7a('0x14')]])){agents[_0x5c1095[_0x4d7a('0x14')]]['agentcomplete']=!![];agents[_0x5c1095[_0x4d7a('0x14')]][_0x4d7a('0x2a')]=utils[_0x4d7a('0x17')]();agents[_0x5c1095[_0x4d7a('0x14')]]['talktime']=utils[_0x4d7a('0x2b')](agents[_0x5c1095[_0x4d7a('0x14')]]['agentcompleteAt'],agents[_0x5c1095[_0x4d7a('0x14')]][_0x4d7a('0x25')]);agents[_0x5c1095[_0x4d7a('0x14')]][_0x4d7a('0x23')]=_0x5c1095[_0x4d7a('0x23')];agents[_0x5c1095[_0x4d7a('0x14')]][_0x4d7a('0x9')]=_0x4d7a('0x2c');writeDB(agents[_0x5c1095[_0x4d7a('0x14')]]);}}catch(_0x4ccb9a){utils[_0x4d7a('0x18')](_0x4ccb9a[_0x4d7a('0x19')]);}};exports[_0x4d7a('0x2d')]=function(_0x45dc7d){try{if(!_[_0x4d7a('0x1b')](agents[_0x45dc7d[_0x4d7a('0x2e')]])){agents[_0x45dc7d[_0x4d7a('0x2e')]][_0x4d7a('0x2f')]=!![];agents[_0x45dc7d['transfereruniqueid']][_0x4d7a('0x30')]=_0x4d7a('0x31');agents[_0x45dc7d[_0x4d7a('0x2e')]][_0x4d7a('0x32')]=_0x45dc7d[_0x4d7a('0x33')];agents[_0x45dc7d[_0x4d7a('0x2e')]][_0x4d7a('0x34')]=agents[_0x45dc7d[_0x4d7a('0x2e')]][_0x4d7a('0x13')];}}catch(_0x33f436){utils[_0x4d7a('0x18')](_0x33f436['stack']);}};exports[_0x4d7a('0x35')]=function(_0x4a458e){try{if(_0x4a458e[_0x4d7a('0x36')]==_0x4a458e[_0x4d7a('0x37')]){if(!_['isNil'](agents[_0x4a458e[_0x4d7a('0x38')]])){agents[_0x4a458e['secondtransfereruniqueid']][_0x4d7a('0x2f')]=!![];agents[_0x4a458e[_0x4d7a('0x38')]]['transfertype']=_0x4d7a('0x39');agents[_0x4a458e[_0x4d7a('0x38')]]['transferexten']=_0x4a458e['origtransfererexten'];agents[_0x4a458e[_0x4d7a('0x38')]]['transferuniqueid']=_0x4a458e[_0x4d7a('0x36')];}if(_0x4a458e[_0x4d7a('0x3a')]&&agents[_0x4a458e[_0x4d7a('0x3a')]]){agents[_0x4a458e['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x4a458e['transfereeuniqueid']]=_[_0x4d7a('0x3b')](agents[_0x4a458e[_0x4d7a('0x3a')]]);transfers[_0x4a458e['transfereeuniqueid']][_0x4d7a('0x7')]=agents[_0x4a458e['secondtransfereruniqueid']]['calleridnum'];transfers[_0x4a458e['transfereeuniqueid']][_0x4d7a('0x3c')]=agents[_0x4a458e[_0x4d7a('0x38')]][_0x4d7a('0x3c')];transfers[_0x4a458e[_0x4d7a('0x3a')]]['agentcalledAt']=utils[_0x4d7a('0x17')]();transfers[_0x4a458e['transfereeuniqueid']]['agentconnectAt']=utils[_0x4d7a('0x17')]();transfers[_0x4a458e[_0x4d7a('0x3a')]]['holdtime']=0x0;transfers[_0x4a458e[_0x4d7a('0x3a')]]['agententerreason']=0x2;}}else if(_0x4a458e['secondtransfereruniqueid']==_0x4a458e[_0x4d7a('0x3d')]){if(!_[_0x4d7a('0x1b')](agents[_0x4a458e[_0x4d7a('0x36')]])){agents[_0x4a458e[_0x4d7a('0x36')]]['transfer']=!![];agents[_0x4a458e['origtransfereruniqueid']][_0x4d7a('0x30')]='ATTENDED';agents[_0x4a458e[_0x4d7a('0x36')]][_0x4d7a('0x32')]=_0x4a458e[_0x4d7a('0x3e')];agents[_0x4a458e[_0x4d7a('0x36')]][_0x4d7a('0x34')]=_0x4a458e[_0x4d7a('0x38')];}if(_0x4a458e[_0x4d7a('0x3f')]&&agents[_0x4a458e['transfertargetuniqueid']]){agents[_0x4a458e[_0x4d7a('0x3f')]]['agententerreason']=0x1;transfers[_0x4a458e[_0x4d7a('0x3f')]]=_['clone'](agents[_0x4a458e[_0x4d7a('0x3f')]]);transfers[_0x4a458e['transfertargetuniqueid']]['calleridnum']=agents[_0x4a458e[_0x4d7a('0x36')]][_0x4d7a('0x7')];transfers[_0x4a458e['transfertargetuniqueid']][_0x4d7a('0x3c')]=agents[_0x4a458e[_0x4d7a('0x36')]]['calleridname'];transfers[_0x4a458e[_0x4d7a('0x3f')]][_0x4d7a('0x16')]=utils[_0x4d7a('0x17')]();transfers[_0x4a458e[_0x4d7a('0x3f')]]['agentconnectAt']=utils[_0x4d7a('0x17')]();transfers[_0x4a458e['transfertargetuniqueid']][_0x4d7a('0x1e')]=0x0;transfers[_0x4a458e[_0x4d7a('0x3f')]][_0x4d7a('0x40')]=0x2;}}}catch(_0x4721e7){utils[_0x4d7a('0x18')](_0x4721e7[_0x4d7a('0x19')]);}};exports[_0x4d7a('0x41')]=function(_0x188c13){try{if(transfers[_0x188c13[_0x4d7a('0x13')]]){transfers[_0x188c13[_0x4d7a('0x13')]][_0x4d7a('0xf')]=!![];transfers[_0x188c13[_0x4d7a('0x13')]]['agentcompleteAt']=utils[_0x4d7a('0x17')]();transfers[_0x188c13[_0x4d7a('0x13')]]['talktime']=utils[_0x4d7a('0x2b')](transfers[_0x188c13[_0x4d7a('0x13')]][_0x4d7a('0x2a')],transfers[_0x188c13[_0x4d7a('0x13')]][_0x4d7a('0x25')]);transfers[_0x188c13['uniqueid']]['reason']='agent';transfers[_0x188c13['uniqueid']][_0x4d7a('0x9')]='complete';writeDB(transfers[_0x188c13['uniqueid']],!![]);}if(agents[_0x188c13['uniqueid']]&&agents[_0x188c13['uniqueid']]['agentconnectAt']){agents[_0x188c13[_0x4d7a('0x13')]][_0x4d7a('0xf')]=!![];agents[_0x188c13[_0x4d7a('0x13')]][_0x4d7a('0x2a')]=utils['now']();agents[_0x188c13['uniqueid']]['talktime']=utils[_0x4d7a('0x2b')](agents[_0x188c13[_0x4d7a('0x13')]][_0x4d7a('0x2a')],agents[_0x188c13[_0x4d7a('0x13')]][_0x4d7a('0x25')]);agents[_0x188c13[_0x4d7a('0x13')]]['reason']=agents[_0x188c13[_0x4d7a('0x13')]][_0x4d7a('0x2f')]?_0x4d7a('0x2f'):_0x4d7a('0x42');agents[_0x188c13[_0x4d7a('0x13')]][_0x4d7a('0x9')]=_0x4d7a('0x2c');writeDB(agents[_0x188c13[_0x4d7a('0x13')]]);}}catch(_0x267d20){utils[_0x4d7a('0x18')](_0x267d20[_0x4d7a('0x19')]);}}; \ No newline at end of file +var _0x955f=['origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','util','./utils','format','channel','membername','interface','calleridnum','lastevent','queue','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalledAt','now','called','connectedlinenum','connectedlinename','error','stack','agentringnoanswer','timeout','holdtime','ringtime','talktime','forIn','uniqueid','abandoned','reason','agentconnect','agentconnectAt','connect','agentringnoanswerAt','answered_elsewhere','answeredelsewheremembername','agentcompleteAt','diffTime','complete','blindtransfer','isNil','transfereruniqueid','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer'];(function(_0x440a2a,_0x149ff3){var _0x190705=function(_0x34f20e){while(--_0x34f20e){_0x440a2a['push'](_0x440a2a['shift']());}};_0x190705(++_0x149ff3);}(_0x955f,0x1eb));var _0xf955=function(_0x12e4ad,_0x14676d){_0x12e4ad=_0x12e4ad-0x0;var _0x549497=_0x955f[_0x12e4ad];return _0x549497;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var utils=require(_0xf955('0x2'));var agents={};var transfers={};function writeDB(_0x382225,_0x2834f7){utils['info'](util[_0xf955('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x382225['uniqueid'],_0x382225[_0xf955('0x4')],_0x382225['queue'],_0x382225[_0xf955('0x5')],_0x382225[_0xf955('0x6')],_0x382225[_0xf955('0x7')],_0x382225['connectedlinenum'],_0x382225[_0xf955('0x8')]));if(_0x382225[_0xf955('0x9')]){utils['getVoiceQueueByName'](_0x382225[_0xf955('0x9')])[_0xf955('0xa')](function(_0x168ffb){if(_0x168ffb){_0x382225[_0xf955('0xb')]=_0x168ffb[_0xf955('0xb')];_0x382225[_0xf955('0xc')]=_0x382225[_0xf955('0xd')]?_0x168ffb['acw']:![];_0x382225[_0xf955('0xe')]=_0x382225['agentacw']?_0x168ffb[_0xf955('0xf')]:0x0;}utils[_0xf955('0x10')](_0xf955('0x11'),_0x382225);});}else{utils['request'](_0xf955('0x11'),_0x382225);}if(_0x2834f7){delete transfers[_0x382225['uniqueid']];}else{delete agents[_0x382225[_0xf955('0x12')]];}}exports['agentcalled']=function(_0x19c94a){try{agents[_0x19c94a[_0xf955('0x12')]]=_0x19c94a;agents[_0x19c94a[_0xf955('0x12')]][_0xf955('0x13')]=utils[_0xf955('0x14')]();agents[_0x19c94a[_0xf955('0x12')]][_0xf955('0x8')]=_0xf955('0x15');agents[_0x19c94a[_0xf955('0x12')]][_0xf955('0x16')]=null;agents[_0x19c94a['destuniqueid']][_0xf955('0x17')]=null;}catch(_0x54e60b){utils[_0xf955('0x18')](_0x54e60b[_0xf955('0x19')]);}};exports[_0xf955('0x1a')]=function(_0x15c07c){try{if(!_['isNil'](agents[_0x15c07c['destuniqueid']])){agents[_0x15c07c[_0xf955('0x12')]][_0xf955('0x1a')]=!![];agents[_0x15c07c[_0xf955('0x12')]]['agentringnoanswerAt']=utils[_0xf955('0x14')]();agents[_0x15c07c[_0xf955('0x12')]][_0xf955('0x8')]=_0xf955('0x1b');agents[_0x15c07c[_0xf955('0x12')]]['reason']=_0xf955('0x1b');agents[_0x15c07c[_0xf955('0x12')]][_0xf955('0x1c')]=_0x15c07c['ringtime']?parseInt(_0x15c07c[_0xf955('0x1d')])/0x3e8:0x0;agents[_0x15c07c['destuniqueid']][_0xf955('0x1e')]=0x0;writeDB(agents[_0x15c07c[_0xf955('0x12')]]);}}catch(_0x37143d){utils[_0xf955('0x18')](_0x37143d[_0xf955('0x19')]);}};exports['queuecallerabandon']=function(_0x25f4f2){try{_[_0xf955('0x1f')](agents,function(_0x3585c7,_0x13a1a7){if(_0x3585c7[_0xf955('0x20')]==_0x25f4f2[_0xf955('0x20')]){_0x3585c7[_0xf955('0x1a')]=!![];_0x3585c7['agentringnoanswerAt']=utils[_0xf955('0x14')]();_0x3585c7[_0xf955('0x8')]=_0xf955('0x21');_0x3585c7[_0xf955('0x22')]=_0xf955('0x21');_0x3585c7[_0xf955('0x1c')]=_0x25f4f2[_0xf955('0x1c')];_0x3585c7['talktime']=0x0;writeDB(_0x3585c7);}});}catch(_0x3caea6){utils[_0xf955('0x18')](_0x3caea6[_0xf955('0x19')]);}};exports[_0xf955('0x23')]=function(_0x28fa9c){try{if(agents[_0x28fa9c[_0xf955('0x12')]]){agents[_0x28fa9c['destuniqueid']][_0xf955('0x24')]=utils[_0xf955('0x14')]();agents[_0x28fa9c['destuniqueid']][_0xf955('0x16')]=_0x28fa9c[_0xf955('0x16')];agents[_0x28fa9c[_0xf955('0x12')]][_0xf955('0x17')]=_0x28fa9c['connectedlinename'];agents[_0x28fa9c[_0xf955('0x12')]]['holdtime']=_0x28fa9c[_0xf955('0x1d')];agents[_0x28fa9c[_0xf955('0x12')]][_0xf955('0x8')]=_0xf955('0x25');_[_0xf955('0x1f')](agents,function(_0x32121b,_0xd5dfb0){if(_0x32121b[_0xf955('0x12')]!=_0x28fa9c['destuniqueid']&&_0x32121b[_0xf955('0x20')]==_0x28fa9c[_0xf955('0x20')]){_0x32121b[_0xf955('0x1e')]=0x0;_0x32121b[_0xf955('0x1c')]=_0x28fa9c['ringtime'];_0x32121b[_0xf955('0x1a')]=!![];_0x32121b[_0xf955('0x26')]=utils[_0xf955('0x14')]();_0x32121b[_0xf955('0x8')]=_0xf955('0x27');_0x32121b['reason']='answered_elsewhere';_0x32121b['answeredelsewheredestinationuniqueid']=_0x28fa9c[_0xf955('0x12')];_0x32121b[_0xf955('0x28')]=_0x28fa9c[_0xf955('0x5')];writeDB(_0x32121b);}});}}catch(_0x6d564c){utils[_0xf955('0x18')](_0x6d564c[_0xf955('0x19')]);}};exports['agentcomplete']=function(_0x3acc4b){try{if(!_['isNil'](agents[_0x3acc4b[_0xf955('0x12')]])){agents[_0x3acc4b[_0xf955('0x12')]][_0xf955('0xd')]=!![];agents[_0x3acc4b['destuniqueid']][_0xf955('0x29')]=utils['now']();agents[_0x3acc4b[_0xf955('0x12')]][_0xf955('0x1e')]=utils[_0xf955('0x2a')](agents[_0x3acc4b[_0xf955('0x12')]]['agentcompleteAt'],agents[_0x3acc4b[_0xf955('0x12')]][_0xf955('0x24')]);agents[_0x3acc4b['destuniqueid']][_0xf955('0x22')]=_0x3acc4b[_0xf955('0x22')];agents[_0x3acc4b[_0xf955('0x12')]]['lastevent']=_0xf955('0x2b');writeDB(agents[_0x3acc4b[_0xf955('0x12')]]);}}catch(_0x11b7e2){utils['error'](_0x11b7e2[_0xf955('0x19')]);}};exports[_0xf955('0x2c')]=function(_0x21e4a6){try{if(!_[_0xf955('0x2d')](agents[_0x21e4a6[_0xf955('0x2e')]])){agents[_0x21e4a6[_0xf955('0x2e')]][_0xf955('0x2f')]=!![];agents[_0x21e4a6[_0xf955('0x2e')]]['transfertype']=_0xf955('0x30');agents[_0x21e4a6[_0xf955('0x2e')]][_0xf955('0x31')]=_0x21e4a6[_0xf955('0x32')];agents[_0x21e4a6[_0xf955('0x2e')]][_0xf955('0x33')]=agents[_0x21e4a6[_0xf955('0x2e')]][_0xf955('0x20')];}}catch(_0x47651b){utils[_0xf955('0x18')](_0x47651b[_0xf955('0x19')]);}};exports[_0xf955('0x34')]=function(_0x40d7e9){try{if(_0x40d7e9[_0xf955('0x35')]==_0x40d7e9[_0xf955('0x36')]){if(!_[_0xf955('0x2d')](agents[_0x40d7e9[_0xf955('0x37')]])){agents[_0x40d7e9[_0xf955('0x37')]][_0xf955('0x2f')]=!![];agents[_0x40d7e9['secondtransfereruniqueid']][_0xf955('0x38')]=_0xf955('0x39');agents[_0x40d7e9[_0xf955('0x37')]]['transferexten']=_0x40d7e9[_0xf955('0x3a')];agents[_0x40d7e9['secondtransfereruniqueid']][_0xf955('0x33')]=_0x40d7e9['origtransfereruniqueid'];}if(_0x40d7e9[_0xf955('0x3b')]&&agents[_0x40d7e9[_0xf955('0x3b')]]){agents[_0x40d7e9[_0xf955('0x3b')]][_0xf955('0x3c')]=0x1;transfers[_0x40d7e9['transfereeuniqueid']]=_[_0xf955('0x3d')](agents[_0x40d7e9[_0xf955('0x3b')]]);transfers[_0x40d7e9[_0xf955('0x3b')]]['calleridnum']=agents[_0x40d7e9['secondtransfereruniqueid']][_0xf955('0x7')];transfers[_0x40d7e9[_0xf955('0x3b')]][_0xf955('0x3e')]=agents[_0x40d7e9[_0xf955('0x37')]]['calleridname'];transfers[_0x40d7e9[_0xf955('0x3b')]][_0xf955('0x13')]=utils[_0xf955('0x14')]();transfers[_0x40d7e9['transfereeuniqueid']][_0xf955('0x24')]=utils['now']();transfers[_0x40d7e9[_0xf955('0x3b')]][_0xf955('0x1c')]=0x0;transfers[_0x40d7e9[_0xf955('0x3b')]]['agententerreason']=0x2;}}else if(_0x40d7e9[_0xf955('0x37')]==_0x40d7e9[_0xf955('0x3f')]){if(!_[_0xf955('0x2d')](agents[_0x40d7e9[_0xf955('0x35')]])){agents[_0x40d7e9['origtransfereruniqueid']][_0xf955('0x2f')]=!![];agents[_0x40d7e9[_0xf955('0x35')]][_0xf955('0x38')]=_0xf955('0x39');agents[_0x40d7e9[_0xf955('0x35')]]['transferexten']=_0x40d7e9[_0xf955('0x40')];agents[_0x40d7e9['origtransfereruniqueid']][_0xf955('0x33')]=_0x40d7e9['secondtransfereruniqueid'];}if(_0x40d7e9[_0xf955('0x41')]&&agents[_0x40d7e9['transfertargetuniqueid']]){agents[_0x40d7e9['transfertargetuniqueid']][_0xf955('0x3c')]=0x1;transfers[_0x40d7e9[_0xf955('0x41')]]=_['clone'](agents[_0x40d7e9[_0xf955('0x41')]]);transfers[_0x40d7e9['transfertargetuniqueid']]['calleridnum']=agents[_0x40d7e9['origtransfereruniqueid']]['calleridnum'];transfers[_0x40d7e9[_0xf955('0x41')]][_0xf955('0x3e')]=agents[_0x40d7e9['origtransfereruniqueid']]['calleridname'];transfers[_0x40d7e9[_0xf955('0x41')]][_0xf955('0x13')]=utils[_0xf955('0x14')]();transfers[_0x40d7e9[_0xf955('0x41')]][_0xf955('0x24')]=utils[_0xf955('0x14')]();transfers[_0x40d7e9[_0xf955('0x41')]][_0xf955('0x1c')]=0x0;transfers[_0x40d7e9[_0xf955('0x41')]][_0xf955('0x3c')]=0x2;}}}catch(_0x1b7b73){utils[_0xf955('0x18')](_0x1b7b73['stack']);}};exports[_0xf955('0x42')]=function(_0x2e1186){try{if(transfers[_0x2e1186[_0xf955('0x20')]]){transfers[_0x2e1186[_0xf955('0x20')]][_0xf955('0xd')]=!![];transfers[_0x2e1186['uniqueid']][_0xf955('0x29')]=utils[_0xf955('0x14')]();transfers[_0x2e1186[_0xf955('0x20')]][_0xf955('0x1e')]=utils[_0xf955('0x2a')](transfers[_0x2e1186[_0xf955('0x20')]][_0xf955('0x29')],transfers[_0x2e1186[_0xf955('0x20')]][_0xf955('0x24')]);transfers[_0x2e1186[_0xf955('0x20')]]['reason']=_0xf955('0x43');transfers[_0x2e1186[_0xf955('0x20')]][_0xf955('0x8')]=_0xf955('0x2b');writeDB(transfers[_0x2e1186[_0xf955('0x20')]],!![]);}if(agents[_0x2e1186[_0xf955('0x20')]]&&agents[_0x2e1186[_0xf955('0x20')]][_0xf955('0x24')]){agents[_0x2e1186[_0xf955('0x20')]][_0xf955('0xd')]=!![];agents[_0x2e1186[_0xf955('0x20')]][_0xf955('0x29')]=utils['now']();agents[_0x2e1186[_0xf955('0x20')]][_0xf955('0x1e')]=utils[_0xf955('0x2a')](agents[_0x2e1186[_0xf955('0x20')]][_0xf955('0x29')],agents[_0x2e1186[_0xf955('0x20')]][_0xf955('0x24')]);agents[_0x2e1186['uniqueid']]['reason']=agents[_0x2e1186['uniqueid']][_0xf955('0x2f')]?'transfer':'agent';agents[_0x2e1186[_0xf955('0x20')]]['lastevent']=_0xf955('0x2b');writeDB(agents[_0x2e1186[_0xf955('0x20')]]);}}catch(_0x158469){utils[_0xf955('0x18')](_0x158469['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 062f2d7..aa9dfeb 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 _0x6889=['toNumber','callerid','calleridname','diffTime','endtime','billableseconds','localtwolinkedid','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','routeid','sipcallid','newexten','toLowerCase','set','startsWith','appdata','cdr','substring','includes','hangup','noop','execif','gotoif','application','lodash','NO\x20ANSWER','FAILED','ANSWERED','format','uniqueid','channel','type','accountcode','source','destination','disposition','getUserByInternal','then','request','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','now','error','stack','channelstate','isNil','systemanswertime','destinationchannel','answertime'];(function(_0x5ec453,_0x30b0ba){var _0x25548f=function(_0x387b62){while(--_0x387b62){_0x5ec453['push'](_0x5ec453['shift']());}};_0x25548f(++_0x30b0ba);}(_0x6889,0x7b));var _0x9688=function(_0x378a07,_0x26dbbe){_0x378a07=_0x378a07-0x0;var _0x1013e7=_0x6889[_0x378a07];return _0x1013e7;};'use strict';var _=require(_0x9688('0x0'));var util=require('util');var utils=require('./utils');var dispositions=[_0x9688('0x1'),_0x9688('0x2'),_0x9688('0x2'),_0x9688('0x1'),_0x9688('0x1'),_0x9688('0x1'),_0x9688('0x3'),'BUSY',_0x9688('0x2'),_0x9688('0x2'),_0x9688('0x2')];var channels={};function writeDB(_0x29b35a){utils['info'](util[_0x9688('0x4')]('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x29b35a[_0x9688('0x5')],_0x29b35a[_0x9688('0x6')],_0x29b35a[_0x9688('0x7')],_0x29b35a[_0x9688('0x8')],_0x29b35a[_0x9688('0x9')],_0x29b35a[_0x9688('0xa')],_0x29b35a['callerid'],_0x29b35a[_0x9688('0xb')]));if(_0x29b35a[_0x9688('0x8')]){utils[_0x9688('0xc')](_0x29b35a[_0x9688('0x8')])[_0x9688('0xd')](function(_0x4ee4a4){if(_0x4ee4a4){_0x29b35a['UserId']=_0x4ee4a4['id'];}utils[_0x9688('0xe')]('CreateVoiceCallReport',_0x29b35a);});}else{utils[_0x9688('0xe')]('CreateVoiceCallReport',_0x29b35a);}if(channels[_0x29b35a[_0x9688('0x5')]]){delete channels[_0x29b35a[_0x9688('0x5')]];}}exports[_0x9688('0xf')]=function(_0x1915cd){try{if(_0x1915cd['uniqueid']==_0x1915cd[_0x9688('0x10')]&&_0x1915cd[_0x9688('0x6')]!=_0x9688('0x11')){channels[_0x1915cd[_0x9688('0x5')]]={'uniqueid':_0x1915cd[_0x9688('0x5')],'accountcode':_0x1915cd[_0x9688('0x8')],'source':_0x1915cd[_0x9688('0x12')],'destination':_0x1915cd[_0x9688('0x13')],'destinationcontext':_0x1915cd[_0x9688('0x14')],'channel':_0x1915cd['channel'],'starttime':utils[_0x9688('0x15')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9688('0x1'),'amaflags':'DOCUMENTATION'};}}catch(_0x5ccdff){utils[_0x9688('0x16')](_0x5ccdff[_0x9688('0x17')]);}};exports['newstate']=function(_0x330e55){try{if(!_['isNil'](channels[_0x330e55[_0x9688('0x5')]])&&_0x330e55[_0x9688('0x18')]==0x6){if(_[_0x9688('0x19')](channels[_0x330e55['uniqueid']][_0x9688('0x1a')])){channels[_0x330e55[_0x9688('0x5')]][_0x9688('0x1a')]=utils[_0x9688('0x15')]();}}else if(!_[_0x9688('0x19')](channels[_0x330e55[_0x9688('0x10')]])&&_0x330e55[_0x9688('0x18')]==0x6&&_0x330e55['context']!='transfer'){channels[_0x330e55[_0x9688('0x10')]][_0x9688('0x8')]=_0x330e55[_0x9688('0x8')];channels[_0x330e55[_0x9688('0x10')]][_0x9688('0x1b')]=_0x330e55[_0x9688('0x6')];if(_[_0x9688('0x19')](channels[_0x330e55[_0x9688('0x10')]][_0x9688('0x1c')])){channels[_0x330e55[_0x9688('0x10')]][_0x9688('0x1c')]=utils[_0x9688('0x15')]();}channels[_0x330e55[_0x9688('0x10')]][_0x9688('0xb')]=dispositions[_[_0x9688('0x1d')](_0x330e55['channelstate'])]||_0x9688('0x3');}}catch(_0x11c208){utils[_0x9688('0x16')](_0x11c208['stack']);}};exports['hangup']=function(_0x4327c2){try{if(!_[_0x9688('0x19')](channels[_0x4327c2[_0x9688('0x5')]])){if(_[_0x9688('0x19')](channels[_0x4327c2[_0x9688('0x5')]]['callerid'])){channels[_0x4327c2[_0x9688('0x5')]][_0x9688('0x1e')]=_0x4327c2[_0x9688('0x1f')]+'\x20<'+_0x4327c2['calleridnum']+'>';}channels[_0x4327c2[_0x9688('0x5')]]['endtime']=utils[_0x9688('0x15')]();channels[_0x4327c2[_0x9688('0x5')]]['duration']=utils[_0x9688('0x20')](channels[_0x4327c2['uniqueid']][_0x9688('0x21')],channels[_0x4327c2[_0x9688('0x5')]]['starttime']);channels[_0x4327c2[_0x9688('0x5')]][_0x9688('0x22')]=channels[_0x4327c2[_0x9688('0x5')]]['answertime']?utils['diffTime'](channels[_0x4327c2[_0x9688('0x5')]][_0x9688('0x21')],channels[_0x4327c2[_0x9688('0x5')]][_0x9688('0x1c')]):0x0;writeDB(channels[_0x4327c2['uniqueid']]);}}catch(_0xcc63f1){utils[_0x9688('0x16')](_0xcc63f1['stack']);}};exports['attendedtransfer']=function(_0x25cabb){try{if(!_['isNil'](channels[_0x25cabb['localtwolinkedid']])){if(channels[_0x25cabb[_0x9688('0x23')]][_0x9688('0x6')]==_0x25cabb['transfereechannel']){channels[_0x25cabb['localtwolinkedid']][_0x9688('0x1b')]=_0x25cabb[_0x9688('0x24')];channels[_0x25cabb['localtwolinkedid']][_0x9688('0x25')]='_attended';}else if(channels[_0x25cabb[_0x9688('0x23')]][_0x9688('0x6')]=_0x25cabb[_0x9688('0x26')]){channels[_0x25cabb[_0x9688('0x23')]]['destinationchannel']=_0x25cabb[_0x9688('0x27')];channels[_0x25cabb[_0x9688('0x23')]][_0x9688('0x25')]=_0x9688('0x28');}}}catch(_0x2d8fc6){utils['error'](_0x2d8fc6[_0x9688('0x17')]);}};exports['musiconholdstart']=function(_0xeed061){try{if(!_[_0x9688('0x19')](channels[_0xeed061[_0x9688('0x5')]])){channels[_0xeed061[_0x9688('0x5')]][_0x9688('0x29')]=utils[_0x9688('0x15')]();}}catch(_0xe7dfbf){utils[_0x9688('0x16')](_0xe7dfbf[_0x9688('0x17')]);}};exports[_0x9688('0x2a')]=function(_0x24708b){try{if(!_[_0x9688('0x19')](channels[_0x24708b[_0x9688('0x5')]])){if(!_[_0x9688('0x19')](channels[_0x24708b[_0x9688('0x5')]]['musiconholdstartAt'])){channels[_0x24708b['uniqueid']][_0x9688('0x2b')]+=utils[_0x9688('0x20')](utils[_0x9688('0x15')](),channels[_0x24708b[_0x9688('0x5')]][_0x9688('0x29')]);delete channels[_0x24708b['uniqueid']]['musiconholdstartAt'];}}}catch(_0x2fa5dc){utils[_0x9688('0x16')](_0x2fa5dc[_0x9688('0x17')]);}};exports[_0x9688('0x2c')]=function(_0x484874){try{if(!_[_0x9688('0x19')](channels[_0x484874[_0x9688('0x5')]])){if(!_[_0x9688('0x19')](_0x484874[_0x9688('0x2d')][_0x9688('0x2e')])){channels[_0x484874['uniqueid']][_0x9688('0x9')]=_0x484874[_0x9688('0x2f')];}if(!_[_0x9688('0x19')](_0x484874[_0x9688('0x2d')][_0x9688('0x30')])){channels[_0x484874[_0x9688('0x5')]][_0x9688('0xa')]=_0x484874[_0x9688('0x2f')];channels[_0x484874[_0x9688('0x5')]][_0x9688('0x1e')]='\x22'+_0x484874[_0x9688('0x2f')]+_0x9688('0x31')+_0x484874[_0x9688('0x2f')]+'>';}if(!_[_0x9688('0x19')](_0x484874[_0x9688('0x2d')][_0x9688('0x32')])||!_['isNil'](_0x484874[_0x9688('0x2d')][_0x9688('0x33')])){channels[_0x484874[_0x9688('0x5')]][_0x9688('0x1e')]=_0x484874['value'];}if(!_['isNil'](_0x484874[_0x9688('0x2d')][_0x9688('0x34')])||!_[_0x9688('0x19')](_0x484874[_0x9688('0x2d')][_0x9688('0x35')])){channels[_0x484874['uniqueid']][_0x9688('0x36')]=_0x9688('0x37');channels[_0x484874[_0x9688('0x5')]][_0x9688('0x38')]=_0x484874[_0x9688('0x2f')];channels[_0x484874[_0x9688('0x5')]][_0x9688('0x39')]=!![];}if(!_[_0x9688('0x19')](_0x484874[_0x9688('0x2d')][_0x9688('0x3a')])){channels[_0x484874['uniqueid']][_0x9688('0x3b')]=_0x484874['value'];}if(!_[_0x9688('0x19')](_0x484874[_0x9688('0x2d')][_0x9688('0x3c')])){channels[_0x484874['uniqueid']][_0x9688('0x7')]=_0x484874[_0x9688('0x2f')];}if(!_[_0x9688('0x19')](_0x484874[_0x9688('0x2d')]['outboundrouteid'])){channels[_0x484874[_0x9688('0x5')]][_0x9688('0x3d')]=_0x484874[_0x9688('0x2f')];}if(!_['isNil'](_0x484874['variable'][_0x9688('0x3e')])){channels[_0x484874[_0x9688('0x5')]]['sipcallid']=_0x484874[_0x9688('0x2f')];}}}catch(_0x15326f){utils['error'](_0x15326f[_0x9688('0x17')]);}};exports[_0x9688('0x3f')]=function(_0x972720){try{if(!_[_0x9688('0x19')](channels[_0x972720[_0x9688('0x5')]])){if(_0x972720['application'][_0x9688('0x40')]()==_0x9688('0x41')&&_[_0x9688('0x42')](_0x972720[_0x9688('0x43')][_0x9688('0x40')](),_0x9688('0x44'))){var _0x2fa7bf=_0x972720[_0x9688('0x43')]['split']('=');var _0x3d58e3=_0x2fa7bf[0x0][_0x9688('0x45')](_0x2fa7bf[0x0]['lastIndexOf']('(')+0x1,_0x2fa7bf[0x0]['lastIndexOf'](')'));var _0x5df448=_0x2fa7bf[0x1];channels[_0x972720[_0x9688('0x5')]][_0x3d58e3]=_0x5df448;}if(!_[_0x9688('0x46')]([_0x9688('0x47'),_0x9688('0x48'),_0x9688('0x49'),_0x9688('0x41'),_0x9688('0x4a')],_0x972720[_0x9688('0x4b')][_0x9688('0x40')]())){channels[_0x972720[_0x9688('0x5')]][_0x9688('0x36')]=_0x972720['application'];channels[_0x972720['uniqueid']][_0x9688('0x38')]=_0x972720['appdata'];}}}catch(_0x5087bd){utils[_0x9688('0x16')](_0x5087bd[_0x9688('0x17')]);}}; \ No newline at end of file +var _0xe5ed=['xmd-callerid','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','routeid','sipcallid','application','set','startsWith','appdata','toLowerCase','split','substring','lastIndexOf','includes','noop','lodash','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','type','accountcode','source','destination','callerid','disposition','UserId','CreateVoiceCallReport','request','uniqueid','newchannel','linkedid','channel','OutgoingSpoolFailed','calleridnum','exten','context','now','DOCUMENTATION','error','isNil','channelstate','systemanswertime','transfer','destinationchannel','toNumber','stack','hangup','calleridname','endtime','duration','diffTime','answertime','attendedtransfer','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstop','musiconholdstartAt','mohtime','varset','variable','value','xmd-phone','\x22\x20<','xmd-callerid-preview'];(function(_0x445550,_0x2c060e){var _0x1a66f7=function(_0x51fefc){while(--_0x51fefc){_0x445550['push'](_0x445550['shift']());}};_0x1a66f7(++_0x2c060e);}(_0xe5ed,0x156));var _0xde5e=function(_0xf22faa,_0x16bd24){_0xf22faa=_0xf22faa-0x0;var _0x4e40bc=_0xe5ed[_0xf22faa];return _0x4e40bc;};'use strict';var _=require(_0xde5e('0x0'));var util=require('util');var utils=require('./utils');var dispositions=[_0xde5e('0x1'),'FAILED',_0xde5e('0x2'),_0xde5e('0x1'),_0xde5e('0x1'),_0xde5e('0x1'),_0xde5e('0x3'),_0xde5e('0x4'),_0xde5e('0x2'),_0xde5e('0x2'),'FAILED'];var channels={};function writeDB(_0x455cab){utils[_0xde5e('0x5')](util[_0xde5e('0x6')](_0xde5e('0x7'),_0x455cab['uniqueid'],_0x455cab['channel'],_0x455cab[_0xde5e('0x8')],_0x455cab[_0xde5e('0x9')],_0x455cab[_0xde5e('0xa')],_0x455cab[_0xde5e('0xb')],_0x455cab[_0xde5e('0xc')],_0x455cab[_0xde5e('0xd')]));if(_0x455cab[_0xde5e('0x9')]){utils['getUserByInternal'](_0x455cab['accountcode'])['then'](function(_0x387662){if(_0x387662){_0x455cab[_0xde5e('0xe')]=_0x387662['id'];}utils['request'](_0xde5e('0xf'),_0x455cab);});}else{utils[_0xde5e('0x10')](_0xde5e('0xf'),_0x455cab);}if(channels[_0x455cab[_0xde5e('0x11')]]){delete channels[_0x455cab[_0xde5e('0x11')]];}}exports[_0xde5e('0x12')]=function(_0x64a05b){try{if(_0x64a05b['uniqueid']==_0x64a05b[_0xde5e('0x13')]&&_0x64a05b[_0xde5e('0x14')]!=_0xde5e('0x15')){channels[_0x64a05b[_0xde5e('0x11')]]={'uniqueid':_0x64a05b[_0xde5e('0x11')],'accountcode':_0x64a05b[_0xde5e('0x9')],'source':_0x64a05b[_0xde5e('0x16')],'destination':_0x64a05b[_0xde5e('0x17')],'destinationcontext':_0x64a05b[_0xde5e('0x18')],'channel':_0x64a05b['channel'],'starttime':utils[_0xde5e('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xde5e('0x1'),'amaflags':_0xde5e('0x1a')};}}catch(_0x26af75){utils[_0xde5e('0x1b')](_0x26af75['stack']);}};exports['newstate']=function(_0x267459){try{if(!_[_0xde5e('0x1c')](channels[_0x267459[_0xde5e('0x11')]])&&_0x267459[_0xde5e('0x1d')]==0x6){if(_[_0xde5e('0x1c')](channels[_0x267459[_0xde5e('0x11')]][_0xde5e('0x1e')])){channels[_0x267459[_0xde5e('0x11')]][_0xde5e('0x1e')]=utils['now']();}}else if(!_[_0xde5e('0x1c')](channels[_0x267459['linkedid']])&&_0x267459[_0xde5e('0x1d')]==0x6&&_0x267459[_0xde5e('0x18')]!=_0xde5e('0x1f')){channels[_0x267459[_0xde5e('0x13')]][_0xde5e('0x9')]=_0x267459[_0xde5e('0x9')];channels[_0x267459[_0xde5e('0x13')]][_0xde5e('0x20')]=_0x267459['channel'];if(_[_0xde5e('0x1c')](channels[_0x267459[_0xde5e('0x13')]]['answertime'])){channels[_0x267459[_0xde5e('0x13')]]['answertime']=utils[_0xde5e('0x19')]();}channels[_0x267459[_0xde5e('0x13')]]['disposition']=dispositions[_[_0xde5e('0x21')](_0x267459[_0xde5e('0x1d')])]||_0xde5e('0x3');}}catch(_0x4a6c43){utils[_0xde5e('0x1b')](_0x4a6c43[_0xde5e('0x22')]);}};exports[_0xde5e('0x23')]=function(_0x47efe9){try{if(!_[_0xde5e('0x1c')](channels[_0x47efe9[_0xde5e('0x11')]])){if(_[_0xde5e('0x1c')](channels[_0x47efe9['uniqueid']][_0xde5e('0xc')])){channels[_0x47efe9['uniqueid']][_0xde5e('0xc')]=_0x47efe9[_0xde5e('0x24')]+'\x20<'+_0x47efe9[_0xde5e('0x16')]+'>';}channels[_0x47efe9[_0xde5e('0x11')]][_0xde5e('0x25')]=utils[_0xde5e('0x19')]();channels[_0x47efe9[_0xde5e('0x11')]][_0xde5e('0x26')]=utils[_0xde5e('0x27')](channels[_0x47efe9[_0xde5e('0x11')]][_0xde5e('0x25')],channels[_0x47efe9['uniqueid']]['starttime']);channels[_0x47efe9[_0xde5e('0x11')]]['billableseconds']=channels[_0x47efe9[_0xde5e('0x11')]][_0xde5e('0x28')]?utils['diffTime'](channels[_0x47efe9[_0xde5e('0x11')]]['endtime'],channels[_0x47efe9['uniqueid']][_0xde5e('0x28')]):0x0;writeDB(channels[_0x47efe9[_0xde5e('0x11')]]);}}catch(_0x1912d9){utils[_0xde5e('0x1b')](_0x1912d9[_0xde5e('0x22')]);}};exports[_0xde5e('0x29')]=function(_0x93d37f){try{if(!_['isNil'](channels[_0x93d37f[_0xde5e('0x2a')]])){if(channels[_0x93d37f[_0xde5e('0x2a')]]['channel']==_0x93d37f['transfereechannel']){channels[_0x93d37f[_0xde5e('0x2a')]][_0xde5e('0x20')]=_0x93d37f[_0xde5e('0x2b')];channels[_0x93d37f[_0xde5e('0x2a')]][_0xde5e('0x2c')]=_0xde5e('0x2d');}else if(channels[_0x93d37f[_0xde5e('0x2a')]][_0xde5e('0x14')]=_0x93d37f[_0xde5e('0x2e')]){channels[_0x93d37f['localtwolinkedid']]['destinationchannel']=_0x93d37f[_0xde5e('0x2f')];channels[_0x93d37f[_0xde5e('0x2a')]][_0xde5e('0x2c')]='_attended';}}}catch(_0x44dc10){utils[_0xde5e('0x1b')](_0x44dc10[_0xde5e('0x22')]);}};exports[_0xde5e('0x30')]=function(_0x194049){try{if(!_[_0xde5e('0x1c')](channels[_0x194049['uniqueid']])){channels[_0x194049['uniqueid']]['musiconholdstartAt']=utils['now']();}}catch(_0x1fad4c){utils[_0xde5e('0x1b')](_0x1fad4c[_0xde5e('0x22')]);}};exports[_0xde5e('0x31')]=function(_0x3a3439){try{if(!_[_0xde5e('0x1c')](channels[_0x3a3439[_0xde5e('0x11')]])){if(!_[_0xde5e('0x1c')](channels[_0x3a3439[_0xde5e('0x11')]][_0xde5e('0x32')])){channels[_0x3a3439[_0xde5e('0x11')]][_0xde5e('0x33')]+=utils[_0xde5e('0x27')](utils[_0xde5e('0x19')](),channels[_0x3a3439[_0xde5e('0x11')]][_0xde5e('0x32')]);delete channels[_0x3a3439[_0xde5e('0x11')]][_0xde5e('0x32')];}}}catch(_0xc425f9){utils['error'](_0xc425f9[_0xde5e('0x22')]);}};exports[_0xde5e('0x34')]=function(_0x2e4e3e){try{if(!_[_0xde5e('0x1c')](channels[_0x2e4e3e[_0xde5e('0x11')]])){if(!_['isNil'](_0x2e4e3e[_0xde5e('0x35')]['xmd-originatecalleridnum'])){channels[_0x2e4e3e[_0xde5e('0x11')]][_0xde5e('0xa')]=_0x2e4e3e[_0xde5e('0x36')];}if(!_[_0xde5e('0x1c')](_0x2e4e3e[_0xde5e('0x35')][_0xde5e('0x37')])){channels[_0x2e4e3e[_0xde5e('0x11')]][_0xde5e('0xb')]=_0x2e4e3e[_0xde5e('0x36')];channels[_0x2e4e3e[_0xde5e('0x11')]][_0xde5e('0xc')]='\x22'+_0x2e4e3e[_0xde5e('0x36')]+_0xde5e('0x38')+_0x2e4e3e['value']+'>';}if(!_['isNil'](_0x2e4e3e[_0xde5e('0x35')][_0xde5e('0x39')])||!_[_0xde5e('0x1c')](_0x2e4e3e[_0xde5e('0x35')][_0xde5e('0x3a')])){channels[_0x2e4e3e[_0xde5e('0x11')]][_0xde5e('0xc')]=_0x2e4e3e[_0xde5e('0x36')];}if(!_['isNil'](_0x2e4e3e[_0xde5e('0x35')]['xmd-queue'])||!_[_0xde5e('0x1c')](_0x2e4e3e[_0xde5e('0x35')][_0xde5e('0x3b')])){channels[_0x2e4e3e[_0xde5e('0x11')]][_0xde5e('0x3c')]=_0xde5e('0x3d');channels[_0x2e4e3e[_0xde5e('0x11')]][_0xde5e('0x3e')]=_0x2e4e3e[_0xde5e('0x36')];channels[_0x2e4e3e[_0xde5e('0x11')]][_0xde5e('0x3f')]=!![];}if(!_[_0xde5e('0x1c')](_0x2e4e3e[_0xde5e('0x35')][_0xde5e('0x40')])){channels[_0x2e4e3e['uniqueid']][_0xde5e('0x41')]=_0x2e4e3e[_0xde5e('0x36')];}if(!_[_0xde5e('0x1c')](_0x2e4e3e[_0xde5e('0x35')][_0xde5e('0x42')])){channels[_0x2e4e3e[_0xde5e('0x11')]][_0xde5e('0x8')]=_0x2e4e3e['value'];}if(!_[_0xde5e('0x1c')](_0x2e4e3e[_0xde5e('0x35')][_0xde5e('0x43')])){channels[_0x2e4e3e[_0xde5e('0x11')]][_0xde5e('0x44')]=_0x2e4e3e[_0xde5e('0x36')];}if(!_[_0xde5e('0x1c')](_0x2e4e3e[_0xde5e('0x35')][_0xde5e('0x45')])){channels[_0x2e4e3e[_0xde5e('0x11')]][_0xde5e('0x45')]=_0x2e4e3e[_0xde5e('0x36')];}}}catch(_0x367a6a){utils[_0xde5e('0x1b')](_0x367a6a[_0xde5e('0x22')]);}};exports['newexten']=function(_0x4912a9){try{if(!_['isNil'](channels[_0x4912a9[_0xde5e('0x11')]])){if(_0x4912a9[_0xde5e('0x46')]['toLowerCase']()==_0xde5e('0x47')&&_[_0xde5e('0x48')](_0x4912a9[_0xde5e('0x49')][_0xde5e('0x4a')](),'cdr')){var _0xe47009=_0x4912a9[_0xde5e('0x49')][_0xde5e('0x4b')]('=');var _0x508ebf=_0xe47009[0x0][_0xde5e('0x4c')](_0xe47009[0x0][_0xde5e('0x4d')]('(')+0x1,_0xe47009[0x0][_0xde5e('0x4d')](')'));var _0x23b7b7=_0xe47009[0x1];channels[_0x4912a9[_0xde5e('0x11')]][_0x508ebf]=_0x23b7b7;}if(!_[_0xde5e('0x4e')]([_0xde5e('0x23'),_0xde5e('0x4f'),'execif',_0xde5e('0x47'),'gotoif'],_0x4912a9[_0xde5e('0x46')][_0xde5e('0x4a')]())){channels[_0x4912a9[_0xde5e('0x11')]]['lastapplication']=_0x4912a9[_0xde5e('0x46')];channels[_0x4912a9[_0xde5e('0x11')]]['lastdata']=_0x4912a9[_0xde5e('0x49')];}}}catch(_0x2c1b80){utils['error'](_0x2c1b80[_0xde5e('0x22')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index a2b997a..39f9e35 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 _0xe2fe=['shutdown','SHUTDOWN','fullybooted','error','close','managerevent','./utils','info'];(function(_0x5c57ae,_0x6e1c56){var _0x2eb34f=function(_0xd38723){while(--_0xd38723){_0x5c57ae['push'](_0x5c57ae['shift']());}};_0x2eb34f(++_0x6e1c56);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0xee2f('0x0'));var _=require('lodash');exports['connect']=function(){utils[_0xee2f('0x1')]('CONNECTED');};exports[_0xee2f('0x2')]=function(){utils[_0xee2f('0x1')](_0xee2f('0x3'));};exports[_0xee2f('0x4')]=function(){utils[_0xee2f('0x1')]('FULLYBOOTED');};exports[_0xee2f('0x5')]=function(_0x2b7e7c){utils['error'](_0x2b7e7c);};exports[_0xee2f('0x6')]=function(){utils[_0xee2f('0x1')]('CLOSE');};exports[_0xee2f('0x7')]=function(_0x5ea796){}; \ No newline at end of file +var _0x3baf=['SHUTDOWN','fullybooted','FULLYBOOTED','error','close','./utils','lodash','connect','info','CONNECTED','shutdown'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x3baf,0xf7));var _0xf3ba=function(_0x35b0d3,_0x15f5d8){_0x35b0d3=_0x35b0d3-0x0;var _0x1e20ea=_0x3baf[_0x35b0d3];return _0x1e20ea;};'use strict';var utils=require(_0xf3ba('0x0'));var _=require(_0xf3ba('0x1'));exports[_0xf3ba('0x2')]=function(){utils[_0xf3ba('0x3')](_0xf3ba('0x4'));};exports[_0xf3ba('0x5')]=function(){utils[_0xf3ba('0x3')](_0xf3ba('0x6'));};exports[_0xf3ba('0x7')]=function(){utils[_0xf3ba('0x3')](_0xf3ba('0x8'));};exports[_0xf3ba('0x9')]=function(_0x475268){utils[_0xf3ba('0x9')](_0x475268);};exports[_0xf3ba('0xa')]=function(){utils['info']('CLOSE');};exports['managerevent']=function(_0x32f810){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 9c803ca..6bbe328 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 _0xf679=['DIAL|%s|%s|%s|%s|%s|%s','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','uniqueid','error','stack','varset','isNil','value','dialbegin','starttime','now','lastevent','called','dialend','dialstatus','ANSWER','assign','answertime','connect','hangup','complete','duration','diffTime','holdtime','endtime','lodash','util','./utils','info','format'];(function(_0x130d0f,_0x45d4e1){var _0x5cacf7=function(_0x59a908){while(--_0x59a908){_0x130d0f['push'](_0x130d0f['shift']());}};_0x5cacf7(++_0x45d4e1);}(_0xf679,0x11a));var _0x9f67=function(_0x4f7cf,_0x43bf1a){_0x4f7cf=_0x4f7cf-0x0;var _0x83883=_0xf679[_0x4f7cf];return _0x83883;};'use strict';var _=require(_0x9f67('0x0'));var util=require(_0x9f67('0x1'));var utils=require(_0x9f67('0x2'));var dials={};function writeDB(_0x4f83fb){utils[_0x9f67('0x3')](util[_0x9f67('0x4')](_0x9f67('0x5'),_0x4f83fb['uniqueid'],_0x4f83fb['channel'],_0x4f83fb[_0x9f67('0x6')],_0x4f83fb[_0x9f67('0x7')],_0x4f83fb[_0x9f67('0x8')],_0x4f83fb['dialstatus']));utils[_0x9f67('0x9')](_0x9f67('0xa'),_0x4f83fb);delete dials[_0x4f83fb['uniqueid']];}exports[_0x9f67('0xb')]=function(_0x5dfa11){try{if(_0x5dfa11[_0x9f67('0xc')][_0x9f67('0xd')]()==_0x9f67('0xe')&&_[_0x9f67('0xf')](_0x5dfa11[_0x9f67('0x10')]['toLowerCase'](),_0x9f67('0x11'))){var _0x53305f=_0x5dfa11[_0x9f67('0x10')]['split']('=');dials[_0x5dfa11[_0x9f67('0x12')]]={'routeId':_0x53305f[0x1]};}}catch(_0x40cba5){utils[_0x9f67('0x13')](_0x40cba5[_0x9f67('0x14')]);}};exports[_0x9f67('0x15')]=function(_0x181810){try{if(!_[_0x9f67('0x16')](_0x181810['variable']['outboundrouteid'])){dials[_0x181810['uniqueid']]={'routeId':_0x181810[_0x9f67('0x17')]};}}catch(_0x36a863){utils[_0x9f67('0x13')](_0x36a863[_0x9f67('0x14')]);}};exports[_0x9f67('0x18')]=function(_0x20a014){try{if(!_[_0x9f67('0x16')](dials[_0x20a014[_0x9f67('0x12')]])){dials[_0x20a014[_0x9f67('0x12')]]=_['assign'](dials[_0x20a014[_0x9f67('0x12')]],_0x20a014);dials[_0x20a014[_0x9f67('0x12')]][_0x9f67('0x19')]=utils[_0x9f67('0x1a')]();dials[_0x20a014[_0x9f67('0x12')]][_0x9f67('0x1b')]=_0x9f67('0x1c');}}catch(_0x5fb070){utils['error'](_0x5fb070[_0x9f67('0x14')]);}};exports[_0x9f67('0x1d')]=function(_0x31712e){try{if(!_[_0x9f67('0x16')](dials[_0x31712e[_0x9f67('0x12')]])){dials[_0x31712e[_0x9f67('0x12')]][_0x9f67('0x1e')]=_0x31712e[_0x9f67('0x1e')];if(_0x31712e[_0x9f67('0x1e')]==_0x9f67('0x1f')){dials[_0x31712e[_0x9f67('0x12')]]=_[_0x9f67('0x20')](dials[_0x31712e['uniqueid']],_0x31712e);dials[_0x31712e[_0x9f67('0x12')]][_0x9f67('0x21')]=utils['now']();dials[_0x31712e[_0x9f67('0x12')]][_0x9f67('0x1b')]=_0x9f67('0x22');}}}catch(_0x4bd631){utils[_0x9f67('0x13')](_0x4bd631[_0x9f67('0x14')]);}};exports[_0x9f67('0x23')]=function(_0x4d6539){try{if(!_[_0x9f67('0x16')](dials[_0x4d6539['uniqueid']])){dials[_0x4d6539[_0x9f67('0x12')]]=_[_0x9f67('0x20')](dials[_0x4d6539['uniqueid']],{'endtime':utils[_0x9f67('0x1a')](),'lastevent':_0x9f67('0x24')});dials[_0x4d6539[_0x9f67('0x12')]][_0x9f67('0x25')]=utils[_0x9f67('0x26')](dials[_0x4d6539[_0x9f67('0x12')]]['endtime'],dials[_0x4d6539[_0x9f67('0x12')]]['starttime']);dials[_0x4d6539[_0x9f67('0x12')]][_0x9f67('0x27')]=utils[_0x9f67('0x26')](dials[_0x4d6539[_0x9f67('0x12')]][_0x9f67('0x21')]||dials[_0x4d6539[_0x9f67('0x12')]][_0x9f67('0x28')],dials[_0x4d6539[_0x9f67('0x12')]][_0x9f67('0x19')]);dials[_0x4d6539['uniqueid']]['billableseconds']=dials[_0x4d6539[_0x9f67('0x12')]][_0x9f67('0x21')]?utils['diffTime'](dials[_0x4d6539[_0x9f67('0x12')]][_0x9f67('0x28')],dials[_0x4d6539[_0x9f67('0x12')]][_0x9f67('0x21')]):0x0;writeDB(dials[_0x4d6539[_0x9f67('0x12')]]);}}catch(_0x3704fc){utils[_0x9f67('0x13')](_0x3704fc[_0x9f67('0x14')]);}}; \ No newline at end of file +var _0xf443=['toLowerCase','set','startsWith','cdr(routeid)','appdata','split','error','stack','isNil','variable','value','dialbegin','assign','starttime','lastevent','answertime','now','connect','complete','endtime','holdtime','diffTime','util','./utils','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','application'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf443,0xc5));var _0x3f44=function(_0x12d69c,_0x1190a1){_0x12d69c=_0x12d69c-0x0;var _0xa3cb15=_0xf443[_0x12d69c];return _0xa3cb15;};'use strict';var _=require('lodash');var util=require(_0x3f44('0x0'));var utils=require(_0x3f44('0x1'));var dials={};function writeDB(_0x3997e5){utils[_0x3f44('0x2')](util['format'](_0x3f44('0x3'),_0x3997e5[_0x3f44('0x4')],_0x3997e5[_0x3f44('0x5')],_0x3997e5[_0x3f44('0x6')],_0x3997e5[_0x3f44('0x7')],_0x3997e5['connectedlinenum'],_0x3997e5[_0x3f44('0x8')]));utils[_0x3f44('0x9')](_0x3f44('0xa'),_0x3997e5);delete dials[_0x3997e5[_0x3f44('0x4')]];}exports[_0x3f44('0xb')]=function(_0x4e6c0d){try{if(_0x4e6c0d[_0x3f44('0xc')][_0x3f44('0xd')]()==_0x3f44('0xe')&&_[_0x3f44('0xf')](_0x4e6c0d['appdata'][_0x3f44('0xd')](),_0x3f44('0x10'))){var _0x25cd7d=_0x4e6c0d[_0x3f44('0x11')][_0x3f44('0x12')]('=');dials[_0x4e6c0d[_0x3f44('0x4')]]={'routeId':_0x25cd7d[0x1]};}}catch(_0x472ee1){utils[_0x3f44('0x13')](_0x472ee1[_0x3f44('0x14')]);}};exports['varset']=function(_0x59688e){try{if(!_[_0x3f44('0x15')](_0x59688e[_0x3f44('0x16')]['outboundrouteid'])){dials[_0x59688e['uniqueid']]={'routeId':_0x59688e[_0x3f44('0x17')]};}}catch(_0x1f441c){utils[_0x3f44('0x13')](_0x1f441c[_0x3f44('0x14')]);}};exports[_0x3f44('0x18')]=function(_0x272368){try{if(!_[_0x3f44('0x15')](dials[_0x272368[_0x3f44('0x4')]])){dials[_0x272368[_0x3f44('0x4')]]=_[_0x3f44('0x19')](dials[_0x272368['uniqueid']],_0x272368);dials[_0x272368[_0x3f44('0x4')]][_0x3f44('0x1a')]=utils['now']();dials[_0x272368[_0x3f44('0x4')]][_0x3f44('0x1b')]='called';}}catch(_0x754962){utils[_0x3f44('0x13')](_0x754962[_0x3f44('0x14')]);}};exports['dialend']=function(_0x4b98aa){try{if(!_['isNil'](dials[_0x4b98aa[_0x3f44('0x4')]])){dials[_0x4b98aa[_0x3f44('0x4')]][_0x3f44('0x8')]=_0x4b98aa[_0x3f44('0x8')];if(_0x4b98aa['dialstatus']=='ANSWER'){dials[_0x4b98aa[_0x3f44('0x4')]]=_[_0x3f44('0x19')](dials[_0x4b98aa[_0x3f44('0x4')]],_0x4b98aa);dials[_0x4b98aa[_0x3f44('0x4')]][_0x3f44('0x1c')]=utils[_0x3f44('0x1d')]();dials[_0x4b98aa[_0x3f44('0x4')]][_0x3f44('0x1b')]=_0x3f44('0x1e');}}}catch(_0x546e21){utils[_0x3f44('0x13')](_0x546e21['stack']);}};exports['hangup']=function(_0x3b9fd5){try{if(!_['isNil'](dials[_0x3b9fd5[_0x3f44('0x4')]])){dials[_0x3b9fd5[_0x3f44('0x4')]]=_[_0x3f44('0x19')](dials[_0x3b9fd5[_0x3f44('0x4')]],{'endtime':utils[_0x3f44('0x1d')](),'lastevent':_0x3f44('0x1f')});dials[_0x3b9fd5[_0x3f44('0x4')]]['duration']=utils['diffTime'](dials[_0x3b9fd5[_0x3f44('0x4')]][_0x3f44('0x20')],dials[_0x3b9fd5[_0x3f44('0x4')]][_0x3f44('0x1a')]);dials[_0x3b9fd5[_0x3f44('0x4')]][_0x3f44('0x21')]=utils[_0x3f44('0x22')](dials[_0x3b9fd5['uniqueid']]['answertime']||dials[_0x3b9fd5['uniqueid']][_0x3f44('0x20')],dials[_0x3b9fd5['uniqueid']][_0x3f44('0x1a')]);dials[_0x3b9fd5[_0x3f44('0x4')]]['billableseconds']=dials[_0x3b9fd5['uniqueid']]['answertime']?utils['diffTime'](dials[_0x3b9fd5['uniqueid']][_0x3f44('0x20')],dials[_0x3b9fd5[_0x3f44('0x4')]][_0x3f44('0x1c')]):0x0;writeDB(dials[_0x3b9fd5[_0x3f44('0x4')]]);}}catch(_0x4297fa){utils[_0x3f44('0x13')](_0x4297fa[_0x3f44('0x14')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index df50b03..1c376aa 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 _0xcdd4=['info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','close','managerevent','devicestatechange','agentcalled','error','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','asterisk','port','username','password','xdr','disabled'];(function(_0x113833,_0x52ada0){var _0x3c544f=function(_0x17478f){while(--_0x17478f){_0x113833['push'](_0x113833['shift']());}};_0x3c544f(++_0x52ada0);}(_0xcdd4,0x19c));var _0x4cdd=function(_0x260d01,_0x25068c){_0x260d01=_0x260d01-0x0;var _0x41bf17=_0xcdd4[_0x260d01];return _0x41bf17;};var AsteriskManager=require(_0x4cdd('0x0'));var config=require(_0x4cdd('0x1'));var utils=require('./utils');var ami=new AsteriskManager(config[_0x4cdd('0x2')][_0x4cdd('0x3')],config[_0x4cdd('0x2')]['ip'],config['asterisk'][_0x4cdd('0x4')],config[_0x4cdd('0x2')][_0x4cdd('0x5')],!![]);ami['keepConnected']();if(config[_0x4cdd('0x6')]&&config[_0x4cdd('0x6')][_0x4cdd('0x7')]){utils[_0x4cdd('0x8')](_0x4cdd('0x9'));}else{var agents=require(_0x4cdd('0xa'));var calls=require(_0x4cdd('0xb'));var queues=require(_0x4cdd('0xc'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x4cdd('0xd'));var transfers=require(_0x4cdd('0xe'));var core=require(_0x4cdd('0xf'));ami['on'](_0x4cdd('0x10'),core['connect']);ami['on'](_0x4cdd('0x11'),core['shutdown']);ami['on']('fullybooted',core[_0x4cdd('0x12')]);ami['on']('error',core['error']);ami['on'](_0x4cdd('0x13'),core[_0x4cdd('0x13')]);ami['on'](_0x4cdd('0x14'),core[_0x4cdd('0x14')]);ami['on'](_0x4cdd('0x15'),function(_0x3a867e){try{members[_0x4cdd('0x15')](_0x3a867e);}catch(_0x1fec04){utils['error'](_0x1fec04);}});ami['on']('agentcalled',function(_0x4f9c1d){try{agents[_0x4cdd('0x16')](_0x4f9c1d);}catch(_0x56ac8f){utils[_0x4cdd('0x17')](_0x56ac8f);}});ami['on']('agentringnoanswer',function(_0x2279ad){try{agents[_0x4cdd('0x18')](_0x2279ad);}catch(_0x2fa519){utils[_0x4cdd('0x17')](_0x2fa519);}});ami['on'](_0x4cdd('0x19'),function(_0x2741da){try{agents[_0x4cdd('0x19')](_0x2741da);queues[_0x4cdd('0x19')](_0x2741da);}catch(_0x598cf8){utils['error'](_0x598cf8);}});ami['on'](_0x4cdd('0x1a'),function(_0x468eae){try{agents[_0x4cdd('0x1a')](_0x468eae);queues['agentcomplete'](_0x468eae);members[_0x4cdd('0x1a')](_0x468eae);}catch(_0x40048e){utils[_0x4cdd('0x17')](_0x40048e);}});ami['on'](_0x4cdd('0x1b'),function(_0x5bf97d){try{agents['queuecallerabandon'](_0x5bf97d);queues[_0x4cdd('0x1b')](_0x5bf97d);}catch(_0x584dd1){utils[_0x4cdd('0x17')](_0x584dd1);}});ami['on'](_0x4cdd('0x1c'),function(_0x4304a3){try{queues[_0x4cdd('0x1c')](_0x4304a3);recordings['queuecallerjoin'](_0x4304a3);}catch(_0x7e45a0){utils[_0x4cdd('0x17')](_0x7e45a0);}});ami['on'](_0x4cdd('0x1d'),function(_0x38afba){try{queues[_0x4cdd('0x1d')](_0x38afba);}catch(_0x45d064){utils[_0x4cdd('0x17')](_0x45d064);}});ami['on'](_0x4cdd('0x1e'),function(_0x574a3e){try{queues[_0x4cdd('0x1e')](_0x574a3e);calls[_0x4cdd('0x1e')](_0x574a3e);}catch(_0x17e0b2){utils[_0x4cdd('0x17')](_0x17e0b2);}});ami['on'](_0x4cdd('0x1f'),function(_0x359419){try{queues['musiconholdstop'](_0x359419);calls['musiconholdstop'](_0x359419);}catch(_0x405375){utils[_0x4cdd('0x17')](_0x405375);}});ami['on'](_0x4cdd('0x20'),function(_0x512414){try{calls[_0x4cdd('0x20')](_0x512414);recordings[_0x4cdd('0x20')](_0x512414);}catch(_0x2c1dd7){utils[_0x4cdd('0x17')](_0x2c1dd7);}});ami['on']('hangup',function(_0x4793e6){try{calls['hangup'](_0x4793e6);recordings['hangup'](_0x4793e6);dials[_0x4cdd('0x21')](_0x4793e6);agents[_0x4cdd('0x21')](_0x4793e6);queues[_0x4cdd('0x21')](_0x4793e6);}catch(_0x431fc3){utils['error'](_0x431fc3);}});ami['on'](_0x4cdd('0x22'),function(_0x104faa){try{members[_0x4cdd('0x22')](_0x104faa);}catch(_0x59ea4d){utils[_0x4cdd('0x17')](_0x59ea4d);}});ami['on'](_0x4cdd('0x23'),function(_0x27504c){try{queues[_0x4cdd('0x23')](_0x27504c);agents[_0x4cdd('0x23')](_0x27504c);transfers[_0x4cdd('0x23')](_0x27504c);}catch(_0x38a074){utils[_0x4cdd('0x17')](_0x38a074);}});ami['on'](_0x4cdd('0x24'),function(_0x129072){try{queues[_0x4cdd('0x24')](_0x129072);transfers['attendedtransfer'](_0x129072);agents[_0x4cdd('0x24')](_0x129072);calls[_0x4cdd('0x24')](_0x129072);}catch(_0x11afd9){utils[_0x4cdd('0x17')](_0x11afd9);}});ami['on'](_0x4cdd('0x25'),function(_0x4ed8f3){try{queues['varset'](_0x4ed8f3);recordings['varset'](_0x4ed8f3);calls[_0x4cdd('0x25')](_0x4ed8f3);dials[_0x4cdd('0x25')](_0x4ed8f3);}catch(_0x109f0e){utils[_0x4cdd('0x17')](_0x109f0e);}});ami['on'](_0x4cdd('0x26'),function(_0x4bd1dd){try{calls[_0x4cdd('0x26')](_0x4bd1dd);recordings[_0x4cdd('0x26')](_0x4bd1dd);dials[_0x4cdd('0x26')](_0x4bd1dd);}catch(_0x194191){utils[_0x4cdd('0x17')](_0x194191);}});ami['on'](_0x4cdd('0x27'),function(_0x471e00){try{calls[_0x4cdd('0x27')](_0x471e00);recordings[_0x4cdd('0x27')](_0x471e00);}catch(_0x3aa5d7){utils['error'](_0x3aa5d7);}});ami['on'](_0x4cdd('0x28'),function(_0x13da7e){try{dials[_0x4cdd('0x28')](_0x13da7e);}catch(_0x3ff479){utils['error'](_0x3ff479);}});ami['on'](_0x4cdd('0x29'),function(_0x4f9b85){try{dials[_0x4cdd('0x29')](_0x4f9b85);}catch(_0x4bde5b){utils['error'](_0x4bde5b);}});} \ No newline at end of file +var _0x17dd=['cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialend','asterisk-manager','./utils','asterisk','username','password','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup'];(function(_0x46520f,_0x4d3ede){var _0x47fdd3=function(_0x25f30f){while(--_0x25f30f){_0x46520f['push'](_0x46520f['shift']());}};_0x47fdd3(++_0x4d3ede);}(_0x17dd,0x14f));var _0xd17d=function(_0x1c2d07,_0x30fbc8){_0x1c2d07=_0x1c2d07-0x0;var _0x3cec89=_0x17dd[_0x1c2d07];return _0x3cec89;};var AsteriskManager=require(_0xd17d('0x0'));var config=require('../../config/environment');var utils=require(_0xd17d('0x1'));var ami=new AsteriskManager(config[_0xd17d('0x2')]['port'],config[_0xd17d('0x2')]['ip'],config[_0xd17d('0x2')][_0xd17d('0x3')],config[_0xd17d('0x2')][_0xd17d('0x4')],!![]);ami['keepConnected']();if(config[_0xd17d('0x5')]&&config[_0xd17d('0x5')][_0xd17d('0x6')]){utils[_0xd17d('0x7')](_0xd17d('0x8'));}else{var agents=require(_0xd17d('0x9'));var calls=require('./calls.controller');var queues=require(_0xd17d('0xa'));var recordings=require(_0xd17d('0xb'));var members=require(_0xd17d('0xc'));var dials=require(_0xd17d('0xd'));var transfers=require(_0xd17d('0xe'));var core=require(_0xd17d('0xf'));ami['on'](_0xd17d('0x10'),core['connect']);ami['on'](_0xd17d('0x11'),core[_0xd17d('0x11')]);ami['on'](_0xd17d('0x12'),core[_0xd17d('0x12')]);ami['on'](_0xd17d('0x13'),core[_0xd17d('0x13')]);ami['on'](_0xd17d('0x14'),core['close']);ami['on']('managerevent',core[_0xd17d('0x15')]);ami['on'](_0xd17d('0x16'),function(_0x2101c4){try{members['devicestatechange'](_0x2101c4);}catch(_0x2dc86b){utils[_0xd17d('0x13')](_0x2dc86b);}});ami['on'](_0xd17d('0x17'),function(_0x282ddf){try{agents[_0xd17d('0x17')](_0x282ddf);}catch(_0x4fc4ba){utils[_0xd17d('0x13')](_0x4fc4ba);}});ami['on'](_0xd17d('0x18'),function(_0x26fd40){try{agents[_0xd17d('0x18')](_0x26fd40);}catch(_0x540761){utils['error'](_0x540761);}});ami['on'](_0xd17d('0x19'),function(_0x5a4497){try{agents[_0xd17d('0x19')](_0x5a4497);queues[_0xd17d('0x19')](_0x5a4497);}catch(_0x5272a7){utils[_0xd17d('0x13')](_0x5272a7);}});ami['on'](_0xd17d('0x1a'),function(_0x168926){try{agents[_0xd17d('0x1a')](_0x168926);queues[_0xd17d('0x1a')](_0x168926);members[_0xd17d('0x1a')](_0x168926);}catch(_0x1de43b){utils[_0xd17d('0x13')](_0x1de43b);}});ami['on'](_0xd17d('0x1b'),function(_0x4cbc60){try{agents[_0xd17d('0x1b')](_0x4cbc60);queues['queuecallerabandon'](_0x4cbc60);}catch(_0x5c9677){utils['error'](_0x5c9677);}});ami['on'](_0xd17d('0x1c'),function(_0x114cac){try{queues[_0xd17d('0x1c')](_0x114cac);recordings[_0xd17d('0x1c')](_0x114cac);}catch(_0x5248c1){utils[_0xd17d('0x13')](_0x5248c1);}});ami['on'](_0xd17d('0x1d'),function(_0x309b58){try{queues[_0xd17d('0x1d')](_0x309b58);}catch(_0x5f39f9){utils['error'](_0x5f39f9);}});ami['on']('musiconholdstart',function(_0x3f95c5){try{queues[_0xd17d('0x1e')](_0x3f95c5);calls[_0xd17d('0x1e')](_0x3f95c5);}catch(_0x2a7e1a){utils[_0xd17d('0x13')](_0x2a7e1a);}});ami['on'](_0xd17d('0x1f'),function(_0x1dc954){try{queues['musiconholdstop'](_0x1dc954);calls[_0xd17d('0x1f')](_0x1dc954);}catch(_0xb039c2){utils[_0xd17d('0x13')](_0xb039c2);}});ami['on'](_0xd17d('0x20'),function(_0x1c2d09){try{calls[_0xd17d('0x20')](_0x1c2d09);recordings[_0xd17d('0x20')](_0x1c2d09);}catch(_0x32d777){utils[_0xd17d('0x13')](_0x32d777);}});ami['on']('hangup',function(_0x12f44b){try{calls[_0xd17d('0x21')](_0x12f44b);recordings['hangup'](_0x12f44b);dials[_0xd17d('0x21')](_0x12f44b);agents[_0xd17d('0x21')](_0x12f44b);queues[_0xd17d('0x21')](_0x12f44b);}catch(_0x1b2625){utils['error'](_0x1b2625);}});ami['on'](_0xd17d('0x22'),function(_0x312ef4){try{members[_0xd17d('0x22')](_0x312ef4);}catch(_0x4e8a1c){utils[_0xd17d('0x13')](_0x4e8a1c);}});ami['on'](_0xd17d('0x23'),function(_0x5a010b){try{queues[_0xd17d('0x23')](_0x5a010b);agents['blindtransfer'](_0x5a010b);transfers['blindtransfer'](_0x5a010b);}catch(_0x4b7d2c){utils[_0xd17d('0x13')](_0x4b7d2c);}});ami['on']('attendedtransfer',function(_0x15f963){try{queues[_0xd17d('0x24')](_0x15f963);transfers[_0xd17d('0x24')](_0x15f963);agents[_0xd17d('0x24')](_0x15f963);calls[_0xd17d('0x24')](_0x15f963);}catch(_0x8625da){utils[_0xd17d('0x13')](_0x8625da);}});ami['on'](_0xd17d('0x25'),function(_0x29f6d3){try{queues[_0xd17d('0x25')](_0x29f6d3);recordings[_0xd17d('0x25')](_0x29f6d3);calls[_0xd17d('0x25')](_0x29f6d3);dials[_0xd17d('0x25')](_0x29f6d3);}catch(_0x4f89b8){utils['error'](_0x4f89b8);}});ami['on'](_0xd17d('0x26'),function(_0x1e249d){try{calls['newexten'](_0x1e249d);recordings[_0xd17d('0x26')](_0x1e249d);dials['newexten'](_0x1e249d);}catch(_0x404d1e){utils[_0xd17d('0x13')](_0x404d1e);}});ami['on'](_0xd17d('0x27'),function(_0x1bf196){try{calls[_0xd17d('0x27')](_0x1bf196);recordings[_0xd17d('0x27')](_0x1bf196);}catch(_0x4f47f3){utils[_0xd17d('0x13')](_0x4f47f3);}});ami['on']('dialbegin',function(_0x3ee2e6){try{dials['dialbegin'](_0x3ee2e6);}catch(_0x4d9464){utils['error'](_0x4d9464);}});ami['on'](_0xd17d('0x28'),function(_0x3cbcf6){try{dials[_0xd17d('0x28')](_0x3cbcf6);}catch(_0x2c569a){utils['error'](_0x2c569a);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 666f7d2..ce1c7f0 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 _0xf0b1=['destinationchannel','lodash','util','./utils','Local/_attended@transfer','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','membername','type','then','name','internal','CreateMemberReport','getUserByName','split','request','catch','error','devicestatechange','state','INUSE','BUSY','device','voice','TALKING','agent','NOT_INUSE','isNil','now','duration','diffTime','exitAt','enterAt','agentcomplete','assign','queue','cdr','channel','data1','data2','source'];(function(_0x4c0e7c,_0x529024){var _0x448ed4=function(_0x3de986){while(--_0x3de986){_0x4c0e7c['push'](_0x4c0e7c['shift']());}};_0x448ed4(++_0x529024);}(_0xf0b1,0x127));var _0x1f0b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf0b1[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x1f0b('0x0'));var util=require(_0x1f0b('0x1'));var utils=require(_0x1f0b('0x2'));var members={};var exclude=[_0x1f0b('0x3'),'Queue:'];function writeDB(_0x5bb723){utils['info'](util['format'](_0x1f0b('0x4'),_0x5bb723[_0x1f0b('0x5')],_0x5bb723[_0x1f0b('0x6')],_0x5bb723['channel'],_0x5bb723['data2'],_0x5bb723[_0x1f0b('0x7')],_0x5bb723[_0x1f0b('0x8')]));if(_0x5bb723[_0x1f0b('0x6')]){utils['getUserByInterface'](_0x5bb723[_0x1f0b('0x6')])[_0x1f0b('0x9')](function(_0x4a8885){if(_0x4a8885){_0x5bb723['membername']=_0x4a8885[_0x1f0b('0xa')];_0x5bb723[_0x1f0b('0xb')]=_0x4a8885[_0x1f0b('0xb')];utils['request'](_0x1f0b('0xc'),_0x5bb723);}else{utils[_0x1f0b('0xd')](_0x5bb723[_0x1f0b('0x6')][_0x1f0b('0xe')]('/')[0x1])['then'](function(_0x5c5b09){if(_0x5c5b09){_0x5bb723[_0x1f0b('0x7')]=_0x5c5b09[_0x1f0b('0xa')];_0x5bb723[_0x1f0b('0xb')]=_0x5c5b09['internal'];utils[_0x1f0b('0xf')]('CreateMemberReport',_0x5bb723);}});}})[_0x1f0b('0x10')](function(_0x54c917){utils[_0x1f0b('0x11')](_0x54c917);});}delete members[_0x5bb723[_0x1f0b('0x6')]];}function startsWith(_0x572fe5,_0x519e2c){return _['some'](_0x572fe5,function(_0x14bbc6){return _['startsWith'](_0x519e2c,_0x14bbc6);});}exports[_0x1f0b('0x12')]=function(_0x4fdf9e){switch(_0x4fdf9e[_0x1f0b('0x13')]){case _0x1f0b('0x14'):case _0x1f0b('0x15'):if(!startsWith(exclude,_0x4fdf9e['device'])){members[_0x4fdf9e[_0x1f0b('0x16')]]={'channel':_0x1f0b('0x17'),'interface':_0x4fdf9e['device'],'type':_0x1f0b('0x18'),'enterAt':utils['now'](),'role':_0x1f0b('0x19')};}break;case _0x1f0b('0x1a'):if(!_[_0x1f0b('0x1b')](members[_0x4fdf9e[_0x1f0b('0x16')]])){members[_0x4fdf9e['device']]['exitAt']=utils[_0x1f0b('0x1c')]();members[_0x4fdf9e[_0x1f0b('0x16')]][_0x1f0b('0x1d')]=utils[_0x1f0b('0x1e')](members[_0x4fdf9e[_0x1f0b('0x16')]][_0x1f0b('0x1f')],members[_0x4fdf9e[_0x1f0b('0x16')]][_0x1f0b('0x20')]);if(members[_0x4fdf9e[_0x1f0b('0x16')]][_0x1f0b('0x5')]){writeDB(members[_0x4fdf9e[_0x1f0b('0x16')]]);}}default:break;}};exports[_0x1f0b('0x21')]=function(_0x18f452){if(!_['isNil'](members[_0x18f452[_0x1f0b('0x6')]])){members[_0x18f452[_0x1f0b('0x6')]]=_[_0x1f0b('0x22')](members[_0x18f452[_0x1f0b('0x6')]],{'data4':_0x18f452[_0x1f0b('0x23')],'uniqueid':_0x18f452[_0x1f0b('0x5')]});}};exports[_0x1f0b('0x24')]=function(_0x15ad54){if(_0x15ad54['channel']){var _0x1bafae=_0x15ad54[_0x1f0b('0x25')][_0x1f0b('0xe')]('-')[0x0];if(!_[_0x1f0b('0x1b')](members[_0x1bafae])){members[_0x1bafae]=_[_0x1f0b('0x22')](members[_0x1bafae],{'data1':members[_0x1bafae][_0x1f0b('0x26')]||_0x15ad54[_0x1f0b('0x8')],'data2':members[_0x1bafae][_0x1f0b('0x27')]||_0x15ad54[_0x1f0b('0x28')],'data3':members[_0x1bafae]['data3']||_0x15ad54['destination'],'uniqueid':members[_0x1bafae][_0x1f0b('0x5')]||_0x15ad54['uniqueid']});if(members[_0x1bafae][_0x1f0b('0x1f')]){writeDB(members[_0x1bafae]);}}}if(_0x15ad54['destinationchannel']){var _0x468bb2=_0x15ad54[_0x1f0b('0x29')][_0x1f0b('0xe')]('-')[0x0];if(!_[_0x1f0b('0x1b')](members[_0x468bb2])){members[_0x468bb2]=_[_0x1f0b('0x22')](members[_0x468bb2],{'data1':members[_0x468bb2][_0x1f0b('0x26')]||_0x15ad54['type'],'data2':members[_0x468bb2]['data2']||_0x15ad54[_0x1f0b('0x28')],'data3':members[_0x468bb2]['data3']||_0x15ad54['destination'],'uniqueid':members[_0x468bb2][_0x1f0b('0x5')]||_0x15ad54[_0x1f0b('0x5')]});if(members[_0x468bb2][_0x1f0b('0x1f')]){writeDB(members[_0x468bb2]);}}}}; \ No newline at end of file +var _0xac74=['getUserByName','split','catch','error','some','devicestatechange','state','BUSY','device','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','enterAt','agentcomplete','assign','queue','cdr','channel','data1','destination','destinationchannel','source','data3','lodash','util','./utils','Local/_attended@transfer','Queue:','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','data2','membername','type','then','name','internal','CreateMemberReport'];(function(_0x6f4475,_0x34cf12){var _0x43d0cc=function(_0x5ad432){while(--_0x5ad432){_0x6f4475['push'](_0x6f4475['shift']());}};_0x43d0cc(++_0x34cf12);}(_0xac74,0x71));var _0x4ac7=function(_0x380e75,_0x486360){_0x380e75=_0x380e75-0x0;var _0x444d96=_0xac74[_0x380e75];return _0x444d96;};'use strict';var _=require(_0x4ac7('0x0'));var util=require(_0x4ac7('0x1'));var utils=require(_0x4ac7('0x2'));var members={};var exclude=[_0x4ac7('0x3'),_0x4ac7('0x4')];function writeDB(_0x27e76d){utils['info'](util[_0x4ac7('0x5')](_0x4ac7('0x6'),_0x27e76d[_0x4ac7('0x7')],_0x27e76d[_0x4ac7('0x8')],_0x27e76d['channel'],_0x27e76d[_0x4ac7('0x9')],_0x27e76d[_0x4ac7('0xa')],_0x27e76d[_0x4ac7('0xb')]));if(_0x27e76d[_0x4ac7('0x8')]){utils['getUserByInterface'](_0x27e76d[_0x4ac7('0x8')])[_0x4ac7('0xc')](function(_0x3ccd7f){if(_0x3ccd7f){_0x27e76d['membername']=_0x3ccd7f[_0x4ac7('0xd')];_0x27e76d['internal']=_0x3ccd7f[_0x4ac7('0xe')];utils['request'](_0x4ac7('0xf'),_0x27e76d);}else{utils[_0x4ac7('0x10')](_0x27e76d[_0x4ac7('0x8')][_0x4ac7('0x11')]('/')[0x1])[_0x4ac7('0xc')](function(_0x116f8c){if(_0x116f8c){_0x27e76d[_0x4ac7('0xa')]=_0x116f8c[_0x4ac7('0xd')];_0x27e76d[_0x4ac7('0xe')]=_0x116f8c[_0x4ac7('0xe')];utils['request'](_0x4ac7('0xf'),_0x27e76d);}});}})[_0x4ac7('0x12')](function(_0x360682){utils[_0x4ac7('0x13')](_0x360682);});}delete members[_0x27e76d[_0x4ac7('0x8')]];}function startsWith(_0x1ed8c7,_0x34b8af){return _[_0x4ac7('0x14')](_0x1ed8c7,function(_0x414d5c){return _['startsWith'](_0x34b8af,_0x414d5c);});}exports[_0x4ac7('0x15')]=function(_0x46e78d){switch(_0x46e78d[_0x4ac7('0x16')]){case'INUSE':case _0x4ac7('0x17'):if(!startsWith(exclude,_0x46e78d[_0x4ac7('0x18')])){members[_0x46e78d[_0x4ac7('0x18')]]={'channel':'voice','interface':_0x46e78d['device'],'type':_0x4ac7('0x19'),'enterAt':utils[_0x4ac7('0x1a')](),'role':_0x4ac7('0x1b')};}break;case _0x4ac7('0x1c'):if(!_[_0x4ac7('0x1d')](members[_0x46e78d[_0x4ac7('0x18')]])){members[_0x46e78d[_0x4ac7('0x18')]][_0x4ac7('0x1e')]=utils[_0x4ac7('0x1a')]();members[_0x46e78d[_0x4ac7('0x18')]][_0x4ac7('0x1f')]=utils['diffTime'](members[_0x46e78d[_0x4ac7('0x18')]][_0x4ac7('0x1e')],members[_0x46e78d['device']][_0x4ac7('0x20')]);if(members[_0x46e78d[_0x4ac7('0x18')]][_0x4ac7('0x7')]){writeDB(members[_0x46e78d[_0x4ac7('0x18')]]);}}default:break;}};exports[_0x4ac7('0x21')]=function(_0x14ed86){if(!_['isNil'](members[_0x14ed86[_0x4ac7('0x8')]])){members[_0x14ed86[_0x4ac7('0x8')]]=_[_0x4ac7('0x22')](members[_0x14ed86[_0x4ac7('0x8')]],{'data4':_0x14ed86[_0x4ac7('0x23')],'uniqueid':_0x14ed86[_0x4ac7('0x7')]});}};exports[_0x4ac7('0x24')]=function(_0x44ee13){if(_0x44ee13[_0x4ac7('0x25')]){var _0x5e0103=_0x44ee13[_0x4ac7('0x25')][_0x4ac7('0x11')]('-')[0x0];if(!_['isNil'](members[_0x5e0103])){members[_0x5e0103]=_[_0x4ac7('0x22')](members[_0x5e0103],{'data1':members[_0x5e0103][_0x4ac7('0x26')]||_0x44ee13[_0x4ac7('0xb')],'data2':members[_0x5e0103][_0x4ac7('0x9')]||_0x44ee13['source'],'data3':members[_0x5e0103]['data3']||_0x44ee13[_0x4ac7('0x27')],'uniqueid':members[_0x5e0103]['uniqueid']||_0x44ee13[_0x4ac7('0x7')]});if(members[_0x5e0103]['exitAt']){writeDB(members[_0x5e0103]);}}}if(_0x44ee13[_0x4ac7('0x28')]){var _0x2140a0=_0x44ee13[_0x4ac7('0x28')][_0x4ac7('0x11')]('-')[0x0];if(!_[_0x4ac7('0x1d')](members[_0x2140a0])){members[_0x2140a0]=_['assign'](members[_0x2140a0],{'data1':members[_0x2140a0][_0x4ac7('0x26')]||_0x44ee13[_0x4ac7('0xb')],'data2':members[_0x2140a0][_0x4ac7('0x9')]||_0x44ee13[_0x4ac7('0x29')],'data3':members[_0x2140a0][_0x4ac7('0x2a')]||_0x44ee13[_0x4ac7('0x27')],'uniqueid':members[_0x2140a0][_0x4ac7('0x7')]||_0x44ee13[_0x4ac7('0x7')]});if(members[_0x2140a0]['exitAt']){writeDB(members[_0x2140a0]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 2b56e4d..a699cd0 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 _0x5d4a=['queuecallerexit','queuecallercompleteAt','now','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','isNil','queuecallerabandonAt','queuecallerexitAt','queuecallerabandon','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','assigned','destaccountcode','membername','agentcomplete','queuecallercomplete','reason','transfer','TRANSFER','transfereeuniqueid','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','secondtransfereruniqueid','ATTENDED','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstartAt','lodash','util','./utils','info','format','uniqueid','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','hangup','queuecallerleaveAt'];(function(_0x3f823a,_0x29330a){var _0x440e40=function(_0x317e5f){while(--_0x317e5f){_0x3f823a['push'](_0x3f823a['shift']());}};_0x440e40(++_0x29330a);}(_0x5d4a,0x1c0));var _0xa5d4=function(_0xbb1461,_0x17ba25){_0xbb1461=_0xbb1461-0x0;var _0x5f02a0=_0x5d4a[_0xbb1461];return _0x5f02a0;};'use strict';var _=require(_0xa5d4('0x0'));var util=require(_0xa5d4('0x1'));var utils=require(_0xa5d4('0x2'));var queues={};function writeDB(_0x440735){utils[_0xa5d4('0x3')](util[_0xa5d4('0x4')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x440735[_0xa5d4('0x5')],_0x440735['channel'],_0x440735[_0xa5d4('0x6')],_0x440735[_0xa5d4('0x7')],_0x440735['calleridnum'],_0x440735[_0xa5d4('0x8')],_0x440735[_0xa5d4('0x9')]));if(_0x440735[_0xa5d4('0x6')]){utils[_0xa5d4('0xa')](_0x440735[_0xa5d4('0x6')])[_0xa5d4('0xb')](function(_0x36a535){if(_0x36a535){_0x440735[_0xa5d4('0xc')]=_0x36a535['type'];}utils[_0xa5d4('0xd')](_0xa5d4('0xe'),_0x440735);});}else{utils[_0xa5d4('0xd')](_0xa5d4('0xe'),_0x440735);}if(_0x440735[_0xa5d4('0xf')]){delete queues[_0x440735[_0xa5d4('0xf')]];}else{delete queues[_0x440735['uniqueid']];}}exports[_0xa5d4('0x10')]=function(_0x24f4df){queues[_0x24f4df[_0xa5d4('0x5')]]=_[_0xa5d4('0x11')](_0x24f4df,{'originalposition':_0x24f4df['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0xa5d4('0x12')]=function(_0x2b9e58){if(!_['isNil'](queues[_0x2b9e58[_0xa5d4('0x5')]])){if(queues[_0x2b9e58[_0xa5d4('0x5')]][_0xa5d4('0x13')]){if(!queues[_0x2b9e58['uniqueid']]['queuecallerabandon']&&!queues[_0x2b9e58[_0xa5d4('0x5')]][_0xa5d4('0x14')]){queues[_0x2b9e58[_0xa5d4('0x5')]]['queuecallercomplete']=!![];queues[_0x2b9e58['uniqueid']][_0xa5d4('0x15')]=utils[_0xa5d4('0x16')]();queues[_0x2b9e58['uniqueid']]['queuecallerexitreason']=_0xa5d4('0x17');}writeDB(queues[_0x2b9e58['uniqueid']]);}else{if(queues[_0x2b9e58[_0xa5d4('0x5')]][_0xa5d4('0xf')]){queues[queues[_0x2b9e58['uniqueid']][_0xa5d4('0xf')]]=queues[_0x2b9e58[_0xa5d4('0x5')]];queues[queues[_0x2b9e58[_0xa5d4('0x5')]]['transfereduniqueid']][_0xa5d4('0x18')]=0x2;delete queues[_0x2b9e58[_0xa5d4('0x5')]];}}}};exports[_0xa5d4('0x19')]=function(_0x58152d){if(!_['isNil'](_0x58152d[_0xa5d4('0x1a')][_0xa5d4('0x1b')])&&_0x58152d[_0xa5d4('0x1c')][_0xa5d4('0x1d')]()!=='CONTINUE'){if(!_[_0xa5d4('0x1e')](queues[_0x58152d[_0xa5d4('0x5')]])){queues[_0x58152d[_0xa5d4('0x5')]]['queuecallerabandon']=![];queues[_0x58152d['uniqueid']][_0xa5d4('0x1f')]=null;queues[_0x58152d[_0xa5d4('0x5')]]['queuecallerexit']=!![];queues[_0x58152d[_0xa5d4('0x5')]][_0xa5d4('0x20')]=utils['now']();queues[_0x58152d[_0xa5d4('0x5')]][_0xa5d4('0x9')]=_0x58152d[_0xa5d4('0x1c')][_0xa5d4('0x1d')]();writeDB(queues[_0x58152d[_0xa5d4('0x5')]]);}}else if(!_[_0xa5d4('0x1e')](_0x58152d[_0xa5d4('0x1a')]['queueposition'])){if(!_[_0xa5d4('0x1e')](queues[_0x58152d[_0xa5d4('0x5')]])&&!queues[_0x58152d['uniqueid']][_0xa5d4('0x21')]){queues[_0x58152d['uniqueid']][_0xa5d4('0x21')]=![];queues[_0x58152d[_0xa5d4('0x5')]][_0xa5d4('0x1f')]=null;queues[_0x58152d['uniqueid']][_0xa5d4('0x14')]=!![];queues[_0x58152d[_0xa5d4('0x5')]][_0xa5d4('0x20')]=utils[_0xa5d4('0x16')]();queues[_0x58152d[_0xa5d4('0x5')]]['queuecallerexitreason']='EXITWITHKEY';}}};exports['queuecallerabandon']=function(_0x7c2512){if(!_[_0xa5d4('0x1e')](queues[_0x7c2512[_0xa5d4('0x5')]])){queues[_0x7c2512[_0xa5d4('0x5')]]['queuecallerexit']=![];queues[_0x7c2512[_0xa5d4('0x5')]][_0xa5d4('0x20')]=null;queues[_0x7c2512[_0xa5d4('0x5')]]['queuecallerabandon']=!![];queues[_0x7c2512[_0xa5d4('0x5')]][_0xa5d4('0x1f')]=utils[_0xa5d4('0x16')]();queues[_0x7c2512[_0xa5d4('0x5')]][_0xa5d4('0x9')]=_0xa5d4('0x22');}};exports[_0xa5d4('0x23')]=function(_0x39f249){if(!_[_0xa5d4('0x1e')](queues[_0x39f249[_0xa5d4('0x5')]])){queues[_0x39f249[_0xa5d4('0x5')]]['queuecallerleave']=!![];queues[_0x39f249[_0xa5d4('0x5')]][_0xa5d4('0x13')]=utils[_0xa5d4('0x16')]();queues[_0x39f249['uniqueid']][_0xa5d4('0x24')]=utils[_0xa5d4('0x25')](queues[_0x39f249['uniqueid']][_0xa5d4('0x13')],queues[_0x39f249['uniqueid']][_0xa5d4('0x26')]);queues[_0x39f249['uniqueid']]['position']=_0x39f249[_0xa5d4('0x27')];queues[_0x39f249[_0xa5d4('0x5')]][_0xa5d4('0x28')]=_0x39f249[_0xa5d4('0x28')];queues[_0x39f249[_0xa5d4('0x5')]][_0xa5d4('0x29')]=_0x39f249[_0xa5d4('0x29')];queues[_0x39f249[_0xa5d4('0x5')]][_0xa5d4('0x2a')]=_0x39f249[_0xa5d4('0x2a')];}};exports['agentconnect']=function(_0xc3289b){if(!_['isNil'](queues[_0xc3289b[_0xa5d4('0x5')]])){queues[_0xc3289b[_0xa5d4('0x5')]]['queuecallerabandon']=![];queues[_0xc3289b[_0xa5d4('0x5')]][_0xa5d4('0x21')]=![];queues[_0xc3289b[_0xa5d4('0x5')]][_0xa5d4('0x1f')]=null;queues[_0xc3289b[_0xa5d4('0x5')]]['queuecallerexit']=![];queues[_0xc3289b[_0xa5d4('0x5')]][_0xa5d4('0x9')]=null;queues[_0xc3289b[_0xa5d4('0x5')]][_0xa5d4('0x20')]=null;queues[_0xc3289b['uniqueid']][_0xa5d4('0x2b')]=!![];queues[_0xc3289b[_0xa5d4('0x5')]][_0xa5d4('0x8')]=_0xc3289b[_0xa5d4('0x2c')];queues[_0xc3289b[_0xa5d4('0x5')]][_0xa5d4('0x7')]=_0xc3289b[_0xa5d4('0x2d')];}};exports[_0xa5d4('0x2e')]=function(_0x10d646){if(!_[_0xa5d4('0x1e')](queues[_0x10d646[_0xa5d4('0x5')]])){if(queues[_0x10d646[_0xa5d4('0x5')]]['queuecallerleaveAt']){queues[_0x10d646[_0xa5d4('0x5')]][_0xa5d4('0x21')]=![];queues[_0x10d646[_0xa5d4('0x5')]]['queuecallerabandon']=![];queues[_0x10d646[_0xa5d4('0x5')]][_0xa5d4('0x1f')]=null;queues[_0x10d646['uniqueid']][_0xa5d4('0x14')]=![];queues[_0x10d646['uniqueid']][_0xa5d4('0x20')]=null;queues[_0x10d646[_0xa5d4('0x5')]][_0xa5d4('0x2b')]=!![];queues[_0x10d646['uniqueid']]['lastAssignedTo']=_0x10d646[_0xa5d4('0x2d')];queues[_0x10d646[_0xa5d4('0x5')]][_0xa5d4('0x2f')]=!![];queues[_0x10d646[_0xa5d4('0x5')]][_0xa5d4('0x15')]=utils[_0xa5d4('0x16')]();if(_0x10d646[_0xa5d4('0x30')]==_0xa5d4('0x31')){if(!queues[_0x10d646[_0xa5d4('0x5')]]['transfer']){queues[_0x10d646[_0xa5d4('0x5')]]['queuecallerexitreason']=_0xa5d4('0x32');}}else{queues[_0x10d646[_0xa5d4('0x5')]][_0xa5d4('0x9')]='COMPLETEDBY'+_0x10d646[_0xa5d4('0x30')][_0xa5d4('0x1d')]();}writeDB(queues[_0x10d646[_0xa5d4('0x5')]]);}}};exports['blindtransfer']=function(_0x23b499){if(!_[_0xa5d4('0x1e')](queues[_0x23b499[_0xa5d4('0x33')]])){queues[_0x23b499[_0xa5d4('0x33')]][_0xa5d4('0x31')]=!![];queues[_0x23b499[_0xa5d4('0x33')]][_0xa5d4('0x34')]=_0xa5d4('0x35');queues[_0x23b499['transfereeuniqueid']][_0xa5d4('0x36')]=_0x23b499[_0xa5d4('0x37')];queues[_0x23b499[_0xa5d4('0x33')]]['transferuniqueid']=_0x23b499[_0xa5d4('0x33')];queues[_0x23b499[_0xa5d4('0x33')]][_0xa5d4('0x9')]=_0xa5d4('0x38');}};exports[_0xa5d4('0x39')]=function(_0x5857c7){try{if(_0x5857c7[_0xa5d4('0x3a')]==_0x5857c7[_0xa5d4('0x3b')]){if(!_[_0xa5d4('0x1e')](queues[_0x5857c7['secondtransfererlinkedid']])){queues[_0x5857c7[_0xa5d4('0x3c')]][_0xa5d4('0x31')]=!![];queues[_0x5857c7['secondtransfererlinkedid']][_0xa5d4('0x34')]='ATTENDED';queues[_0x5857c7[_0xa5d4('0x3c')]][_0xa5d4('0x36')]=_0x5857c7[_0xa5d4('0x3d')];queues[_0x5857c7[_0xa5d4('0x3c')]][_0xa5d4('0x3e')]=_0x5857c7[_0xa5d4('0x3a')];queues[_0x5857c7[_0xa5d4('0x3c')]][_0xa5d4('0x9')]=_0xa5d4('0x3f');}if(!_[_0xa5d4('0x1e')](queues[_0x5857c7[_0xa5d4('0x3b')]])){if(_0x5857c7['transfereelinkedid']&&queues[_0x5857c7[_0xa5d4('0x40')]]){queues[_0x5857c7['transfereelinkedid']][_0xa5d4('0x18')]=0x1;queues[_0x5857c7[_0xa5d4('0x33')]]=_[_0xa5d4('0x41')](queues[_0x5857c7[_0xa5d4('0x40')]]);queues[_0x5857c7[_0xa5d4('0x33')]]['transfereduniqueid']=_0x5857c7[_0xa5d4('0x42')];queues[_0x5857c7[_0xa5d4('0x33')]][_0xa5d4('0x18')]=0x2;queues[_0x5857c7[_0xa5d4('0x33')]][_0xa5d4('0x43')]=queues[_0x5857c7[_0xa5d4('0x3c')]][_0xa5d4('0x43')];queues[_0x5857c7[_0xa5d4('0x33')]]['calleridname']=queues[_0x5857c7['secondtransfererlinkedid']][_0xa5d4('0x44')];queues[_0x5857c7['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0xa5d4('0x16')]();queues[_0x5857c7[_0xa5d4('0x33')]][_0xa5d4('0x13')]=utils[_0xa5d4('0x16')]();queues[_0x5857c7[_0xa5d4('0x33')]]['holdtime']=0x0;queues[_0x5857c7[_0xa5d4('0x33')]][_0xa5d4('0x45')]=0x0;}else{queues[_0x5857c7[_0xa5d4('0x3b')]][_0xa5d4('0xf')]=_0x5857c7[_0xa5d4('0x3c')];}}}else if(_0x5857c7[_0xa5d4('0x46')]==_0x5857c7[_0xa5d4('0x3c')]){if(!_[_0xa5d4('0x1e')](queues[_0x5857c7[_0xa5d4('0x3b')]])){queues[_0x5857c7[_0xa5d4('0x3b')]][_0xa5d4('0x31')]=!![];queues[_0x5857c7[_0xa5d4('0x3b')]][_0xa5d4('0x34')]=_0xa5d4('0x47');queues[_0x5857c7[_0xa5d4('0x3b')]]['transferexten']=_0x5857c7[_0xa5d4('0x48')];queues[_0x5857c7[_0xa5d4('0x3b')]][_0xa5d4('0x3e')]=_0x5857c7[_0xa5d4('0x46')];queues[_0x5857c7[_0xa5d4('0x3b')]]['queuecallerexitreason']=_0xa5d4('0x3f');}if(!_[_0xa5d4('0x1e')](queues[_0x5857c7[_0xa5d4('0x3c')]])){if(_0x5857c7[_0xa5d4('0x49')]&&queues[_0x5857c7[_0xa5d4('0x49')]]){queues[_0x5857c7['transfertargetlinkedid']][_0xa5d4('0x18')]=0x1;queues[_0x5857c7[_0xa5d4('0x42')]]=_[_0xa5d4('0x41')](queues[_0x5857c7[_0xa5d4('0x49')]]);queues[_0x5857c7['transfertargetuniqueid']]['transfereduniqueid']=_0x5857c7[_0xa5d4('0x42')];queues[_0x5857c7[_0xa5d4('0x42')]]['queuecallerenterreason']=0x2;queues[_0x5857c7[_0xa5d4('0x42')]][_0xa5d4('0x43')]=queues[_0x5857c7['origtransfererlinkedid']][_0xa5d4('0x43')];queues[_0x5857c7[_0xa5d4('0x42')]][_0xa5d4('0x44')]=queues[_0x5857c7[_0xa5d4('0x3b')]][_0xa5d4('0x44')];queues[_0x5857c7[_0xa5d4('0x42')]][_0xa5d4('0x26')]=utils['now']();queues[_0x5857c7[_0xa5d4('0x42')]]['queuecallerleaveAt']=utils[_0xa5d4('0x16')]();queues[_0x5857c7['transfertargetuniqueid']][_0xa5d4('0x24')]=0x0;queues[_0x5857c7['transfertargetuniqueid']]['mohtime']=0x0;}else{queues[_0x5857c7[_0xa5d4('0x3c')]][_0xa5d4('0xf')]=_0x5857c7['origtransfererlinkedid'];}}}}catch(_0x378299){utils[_0xa5d4('0x4a')](_0x378299[_0xa5d4('0x4b')]);}};exports[_0xa5d4('0x4c')]=function(_0x257206){if(!_[_0xa5d4('0x1e')](queues[_0x257206['uniqueid']])){queues[_0x257206[_0xa5d4('0x5')]][_0xa5d4('0x4d')]=utils['now']();}};exports['musiconholdstop']=function(_0x320735){if(!_['isNil'](queues[_0x320735[_0xa5d4('0x5')]])){if(!_[_0xa5d4('0x1e')](queues[_0x320735[_0xa5d4('0x5')]]['musiconholdstartAt'])){queues[_0x320735[_0xa5d4('0x5')]][_0xa5d4('0x45')]+=utils[_0xa5d4('0x25')](utils[_0xa5d4('0x16')](),queues[_0x320735[_0xa5d4('0x5')]][_0xa5d4('0x4d')]);delete queues[_0x320735['uniqueid']][_0xa5d4('0x4d')];}}}; \ No newline at end of file +var _0xd21e=['connectedlinenum','connectedlinename','agentconnect','assigned','accountcode','membername','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','calleridname','secondtransfereruniqueid','transfertargetlinkedid','transfertargetuniqueid','mohtime','error','stack','musiconholdstartAt','musiconholdstop','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','queuecallerjoin','position','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','transfereduniqueid','varset','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','queueposition','EXITWITHKEY','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count'];(function(_0x3c5061,_0x56b8c8){var _0x28f9db=function(_0x4889de){while(--_0x4889de){_0x3c5061['push'](_0x3c5061['shift']());}};_0x28f9db(++_0x56b8c8);}(_0xd21e,0x1af));var _0xed21=function(_0x4246ef,_0x508804){_0x4246ef=_0x4246ef-0x0;var _0x20d87b=_0xd21e[_0x4246ef];return _0x20d87b;};'use strict';var _=require(_0xed21('0x0'));var util=require(_0xed21('0x1'));var utils=require(_0xed21('0x2'));var queues={};function writeDB(_0x26c786){utils[_0xed21('0x3')](util[_0xed21('0x4')](_0xed21('0x5'),_0x26c786[_0xed21('0x6')],_0x26c786[_0xed21('0x7')],_0x26c786[_0xed21('0x8')],_0x26c786[_0xed21('0x9')],_0x26c786[_0xed21('0xa')],_0x26c786['accountcode'],_0x26c786[_0xed21('0xb')]));if(_0x26c786['queue']){utils['getVoiceQueueByName'](_0x26c786[_0xed21('0x8')])[_0xed21('0xc')](function(_0x9f942a){if(_0x9f942a){_0x26c786[_0xed21('0xd')]=_0x9f942a[_0xed21('0xd')];}utils[_0xed21('0xe')](_0xed21('0xf'),_0x26c786);});}else{utils[_0xed21('0xe')](_0xed21('0xf'),_0x26c786);}if(_0x26c786['transfereduniqueid']){delete queues[_0x26c786['transfereduniqueid']];}else{delete queues[_0x26c786[_0xed21('0x6')]];}}exports[_0xed21('0x10')]=function(_0x1ec2c7){queues[_0x1ec2c7[_0xed21('0x6')]]=_['assign'](_0x1ec2c7,{'originalposition':_0x1ec2c7[_0xed21('0x11')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0xed21('0x12')]=function(_0x39fcb8){if(!_[_0xed21('0x13')](queues[_0x39fcb8[_0xed21('0x6')]])){if(queues[_0x39fcb8[_0xed21('0x6')]][_0xed21('0x14')]){if(!queues[_0x39fcb8[_0xed21('0x6')]][_0xed21('0x15')]&&!queues[_0x39fcb8[_0xed21('0x6')]][_0xed21('0x16')]){queues[_0x39fcb8[_0xed21('0x6')]][_0xed21('0x17')]=!![];queues[_0x39fcb8[_0xed21('0x6')]][_0xed21('0x18')]=utils[_0xed21('0x19')]();queues[_0x39fcb8[_0xed21('0x6')]][_0xed21('0xb')]=_0xed21('0x1a');}writeDB(queues[_0x39fcb8[_0xed21('0x6')]]);}else{if(queues[_0x39fcb8[_0xed21('0x6')]][_0xed21('0x1b')]){queues[queues[_0x39fcb8[_0xed21('0x6')]][_0xed21('0x1b')]]=queues[_0x39fcb8['uniqueid']];queues[queues[_0x39fcb8[_0xed21('0x6')]][_0xed21('0x1b')]]['queuecallerenterreason']=0x2;delete queues[_0x39fcb8['uniqueid']];}}}};exports[_0xed21('0x1c')]=function(_0x42e0af){if(!_[_0xed21('0x13')](_0x42e0af[_0xed21('0x1d')][_0xed21('0x1e')])&&_0x42e0af[_0xed21('0x1f')]['toUpperCase']()!==_0xed21('0x20')){if(!_[_0xed21('0x13')](queues[_0x42e0af[_0xed21('0x6')]])){queues[_0x42e0af[_0xed21('0x6')]]['queuecallerabandon']=![];queues[_0x42e0af[_0xed21('0x6')]][_0xed21('0x21')]=null;queues[_0x42e0af[_0xed21('0x6')]][_0xed21('0x16')]=!![];queues[_0x42e0af['uniqueid']][_0xed21('0x22')]=utils[_0xed21('0x19')]();queues[_0x42e0af[_0xed21('0x6')]][_0xed21('0xb')]=_0x42e0af[_0xed21('0x1f')][_0xed21('0x23')]();writeDB(queues[_0x42e0af[_0xed21('0x6')]]);}}else if(!_[_0xed21('0x13')](_0x42e0af[_0xed21('0x1d')][_0xed21('0x24')])){if(!_['isNil'](queues[_0x42e0af[_0xed21('0x6')]])&&!queues[_0x42e0af['uniqueid']][_0xed21('0x15')]){queues[_0x42e0af[_0xed21('0x6')]][_0xed21('0x15')]=![];queues[_0x42e0af[_0xed21('0x6')]]['queuecallerabandonAt']=null;queues[_0x42e0af[_0xed21('0x6')]][_0xed21('0x16')]=!![];queues[_0x42e0af[_0xed21('0x6')]][_0xed21('0x22')]=utils[_0xed21('0x19')]();queues[_0x42e0af[_0xed21('0x6')]][_0xed21('0xb')]=_0xed21('0x25');}}};exports[_0xed21('0x15')]=function(_0x321829){if(!_[_0xed21('0x13')](queues[_0x321829[_0xed21('0x6')]])){queues[_0x321829[_0xed21('0x6')]][_0xed21('0x16')]=![];queues[_0x321829[_0xed21('0x6')]][_0xed21('0x22')]=null;queues[_0x321829[_0xed21('0x6')]]['queuecallerabandon']=!![];queues[_0x321829[_0xed21('0x6')]][_0xed21('0x21')]=utils[_0xed21('0x19')]();queues[_0x321829[_0xed21('0x6')]][_0xed21('0xb')]='ABANDONED';}};exports['queuecallerleave']=function(_0x4be7cb){if(!_[_0xed21('0x13')](queues[_0x4be7cb['uniqueid']])){queues[_0x4be7cb[_0xed21('0x6')]][_0xed21('0x26')]=!![];queues[_0x4be7cb[_0xed21('0x6')]][_0xed21('0x14')]=utils[_0xed21('0x19')]();queues[_0x4be7cb[_0xed21('0x6')]][_0xed21('0x27')]=utils[_0xed21('0x28')](queues[_0x4be7cb[_0xed21('0x6')]][_0xed21('0x14')],queues[_0x4be7cb['uniqueid']][_0xed21('0x29')]);queues[_0x4be7cb[_0xed21('0x6')]][_0xed21('0x11')]=_0x4be7cb[_0xed21('0x11')];queues[_0x4be7cb[_0xed21('0x6')]][_0xed21('0x2a')]=_0x4be7cb[_0xed21('0x2a')];queues[_0x4be7cb[_0xed21('0x6')]][_0xed21('0x2b')]=_0x4be7cb['connectedlinenum'];queues[_0x4be7cb[_0xed21('0x6')]][_0xed21('0x2c')]=_0x4be7cb[_0xed21('0x2c')];}};exports[_0xed21('0x2d')]=function(_0x55ec02){if(!_[_0xed21('0x13')](queues[_0x55ec02[_0xed21('0x6')]])){queues[_0x55ec02[_0xed21('0x6')]]['queuecallerabandon']=![];queues[_0x55ec02[_0xed21('0x6')]][_0xed21('0x15')]=![];queues[_0x55ec02[_0xed21('0x6')]][_0xed21('0x21')]=null;queues[_0x55ec02['uniqueid']][_0xed21('0x16')]=![];queues[_0x55ec02[_0xed21('0x6')]][_0xed21('0xb')]=null;queues[_0x55ec02[_0xed21('0x6')]]['queuecallerexitAt']=null;queues[_0x55ec02[_0xed21('0x6')]][_0xed21('0x2e')]=!![];queues[_0x55ec02[_0xed21('0x6')]][_0xed21('0x2f')]=_0x55ec02['destaccountcode'];queues[_0x55ec02['uniqueid']][_0xed21('0x9')]=_0x55ec02[_0xed21('0x30')];}};exports[_0xed21('0x31')]=function(_0x11f68a){if(!_['isNil'](queues[_0x11f68a[_0xed21('0x6')]])){if(queues[_0x11f68a[_0xed21('0x6')]][_0xed21('0x14')]){queues[_0x11f68a[_0xed21('0x6')]][_0xed21('0x15')]=![];queues[_0x11f68a[_0xed21('0x6')]][_0xed21('0x15')]=![];queues[_0x11f68a[_0xed21('0x6')]][_0xed21('0x21')]=null;queues[_0x11f68a[_0xed21('0x6')]][_0xed21('0x16')]=![];queues[_0x11f68a[_0xed21('0x6')]][_0xed21('0x22')]=null;queues[_0x11f68a[_0xed21('0x6')]][_0xed21('0x2e')]=!![];queues[_0x11f68a[_0xed21('0x6')]][_0xed21('0x9')]=_0x11f68a[_0xed21('0x30')];queues[_0x11f68a[_0xed21('0x6')]][_0xed21('0x17')]=!![];queues[_0x11f68a[_0xed21('0x6')]]['queuecallercompleteAt']=utils[_0xed21('0x19')]();if(_0x11f68a[_0xed21('0x32')]==_0xed21('0x33')){if(!queues[_0x11f68a[_0xed21('0x6')]][_0xed21('0x33')]){queues[_0x11f68a['uniqueid']][_0xed21('0xb')]=_0xed21('0x34');}}else{queues[_0x11f68a[_0xed21('0x6')]][_0xed21('0xb')]=_0xed21('0x35')+_0x11f68a['reason'][_0xed21('0x23')]();}writeDB(queues[_0x11f68a[_0xed21('0x6')]]);}}};exports[_0xed21('0x36')]=function(_0x22d1cd){if(!_[_0xed21('0x13')](queues[_0x22d1cd['transfereeuniqueid']])){queues[_0x22d1cd[_0xed21('0x37')]]['transfer']=!![];queues[_0x22d1cd['transfereeuniqueid']][_0xed21('0x38')]=_0xed21('0x39');queues[_0x22d1cd[_0xed21('0x37')]][_0xed21('0x3a')]=_0x22d1cd['extension'];queues[_0x22d1cd[_0xed21('0x37')]][_0xed21('0x3b')]=_0x22d1cd[_0xed21('0x37')];queues[_0x22d1cd[_0xed21('0x37')]][_0xed21('0xb')]=_0xed21('0x3c');}};exports['attendedtransfer']=function(_0x4f2722){try{if(_0x4f2722[_0xed21('0x3d')]==_0x4f2722[_0xed21('0x3e')]){if(!_[_0xed21('0x13')](queues[_0x4f2722['secondtransfererlinkedid']])){queues[_0x4f2722[_0xed21('0x3f')]]['transfer']=!![];queues[_0x4f2722[_0xed21('0x3f')]][_0xed21('0x38')]=_0xed21('0x40');queues[_0x4f2722[_0xed21('0x3f')]]['transferexten']=_0x4f2722[_0xed21('0x41')];queues[_0x4f2722[_0xed21('0x3f')]][_0xed21('0x3b')]=_0x4f2722[_0xed21('0x3d')];queues[_0x4f2722[_0xed21('0x3f')]][_0xed21('0xb')]=_0xed21('0x42');}if(!_[_0xed21('0x13')](queues[_0x4f2722['origtransfererlinkedid']])){if(_0x4f2722[_0xed21('0x43')]&&queues[_0x4f2722[_0xed21('0x43')]]){queues[_0x4f2722[_0xed21('0x43')]][_0xed21('0x44')]=0x1;queues[_0x4f2722[_0xed21('0x37')]]=_[_0xed21('0x45')](queues[_0x4f2722[_0xed21('0x43')]]);queues[_0x4f2722['transfereeuniqueid']][_0xed21('0x1b')]=_0x4f2722['transfertargetuniqueid'];queues[_0x4f2722[_0xed21('0x37')]]['queuecallerenterreason']=0x2;queues[_0x4f2722[_0xed21('0x37')]][_0xed21('0xa')]=queues[_0x4f2722[_0xed21('0x3f')]]['calleridnum'];queues[_0x4f2722[_0xed21('0x37')]][_0xed21('0x46')]=queues[_0x4f2722[_0xed21('0x3f')]]['calleridname'];queues[_0x4f2722[_0xed21('0x37')]]['queuecallerjoinAt']=utils[_0xed21('0x19')]();queues[_0x4f2722['transfereeuniqueid']][_0xed21('0x14')]=utils[_0xed21('0x19')]();queues[_0x4f2722['transfereeuniqueid']][_0xed21('0x27')]=0x0;queues[_0x4f2722[_0xed21('0x37')]]['mohtime']=0x0;}else{queues[_0x4f2722[_0xed21('0x3e')]][_0xed21('0x1b')]=_0x4f2722['secondtransfererlinkedid'];}}}else if(_0x4f2722[_0xed21('0x47')]==_0x4f2722[_0xed21('0x3f')]){if(!_[_0xed21('0x13')](queues[_0x4f2722[_0xed21('0x3e')]])){queues[_0x4f2722[_0xed21('0x3e')]][_0xed21('0x33')]=!![];queues[_0x4f2722[_0xed21('0x3e')]][_0xed21('0x38')]=_0xed21('0x40');queues[_0x4f2722['origtransfererlinkedid']][_0xed21('0x3a')]=_0x4f2722['secondtransfererexten'];queues[_0x4f2722[_0xed21('0x3e')]][_0xed21('0x3b')]=_0x4f2722['secondtransfereruniqueid'];queues[_0x4f2722[_0xed21('0x3e')]][_0xed21('0xb')]=_0xed21('0x42');}if(!_[_0xed21('0x13')](queues[_0x4f2722['secondtransfererlinkedid']])){if(_0x4f2722[_0xed21('0x48')]&&queues[_0x4f2722['transfertargetlinkedid']]){queues[_0x4f2722[_0xed21('0x48')]][_0xed21('0x44')]=0x1;queues[_0x4f2722['transfertargetuniqueid']]=_[_0xed21('0x45')](queues[_0x4f2722[_0xed21('0x48')]]);queues[_0x4f2722['transfertargetuniqueid']]['transfereduniqueid']=_0x4f2722['transfertargetuniqueid'];queues[_0x4f2722[_0xed21('0x49')]][_0xed21('0x44')]=0x2;queues[_0x4f2722[_0xed21('0x49')]][_0xed21('0xa')]=queues[_0x4f2722[_0xed21('0x3e')]][_0xed21('0xa')];queues[_0x4f2722[_0xed21('0x49')]][_0xed21('0x46')]=queues[_0x4f2722[_0xed21('0x3e')]][_0xed21('0x46')];queues[_0x4f2722['transfertargetuniqueid']][_0xed21('0x29')]=utils[_0xed21('0x19')]();queues[_0x4f2722[_0xed21('0x49')]][_0xed21('0x14')]=utils['now']();queues[_0x4f2722[_0xed21('0x49')]][_0xed21('0x27')]=0x0;queues[_0x4f2722[_0xed21('0x49')]][_0xed21('0x4a')]=0x0;}else{queues[_0x4f2722[_0xed21('0x3f')]][_0xed21('0x1b')]=_0x4f2722[_0xed21('0x3e')];}}}}catch(_0x15ebe0){utils[_0xed21('0x4b')](_0x15ebe0[_0xed21('0x4c')]);}};exports['musiconholdstart']=function(_0x2db454){if(!_['isNil'](queues[_0x2db454[_0xed21('0x6')]])){queues[_0x2db454[_0xed21('0x6')]][_0xed21('0x4d')]=utils[_0xed21('0x19')]();}};exports[_0xed21('0x4e')]=function(_0x4aa5e6){if(!_[_0xed21('0x13')](queues[_0x4aa5e6[_0xed21('0x6')]])){if(!_['isNil'](queues[_0x4aa5e6[_0xed21('0x6')]][_0xed21('0x4d')])){queues[_0x4aa5e6[_0xed21('0x6')]]['mohtime']+=utils[_0xed21('0x28')](utils[_0xed21('0x19')](),queues[_0x4aa5e6[_0xed21('0x6')]][_0xed21('0x4d')]);delete queues[_0x4aa5e6[_0xed21('0x6')]][_0xed21('0x4d')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index bfd0b1a..35d4fdd 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 _0xe706=['CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','isNil','channelstate','stack','varset','variable','value','.WAV','find','monitors','hangup','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','accountcode','getUserByInternal','then','membername','name','UserId','request'];(function(_0x24b8ba,_0x193ff2){var _0x2f9c63=function(_0x28eb4e){while(--_0x28eb4e){_0x24b8ba['push'](_0x24b8ba['shift']());}};_0x2f9c63(++_0x193ff2);}(_0xe706,0xa3));var _0x6e70=function(_0x175342,_0x57e790){_0x175342=_0x175342-0x0;var _0x1477a8=_0xe706[_0x175342];return _0x1477a8;};'use strict';var _=require(_0x6e70('0x0'));var utils=require(_0x6e70('0x1'));var recordings={};function writeDB(_0x311951){utils['debug'](_0x311951);if(_0x311951[_0x6e70('0x2')]){utils[_0x6e70('0x3')](_0x311951[_0x6e70('0x2')])[_0x6e70('0x4')](function(_0x142c27){if(_0x142c27){_0x311951[_0x6e70('0x5')]=_0x142c27[_0x6e70('0x6')];_0x311951[_0x6e70('0x7')]=_0x142c27['id'];}utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);});}else{utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);}}exports[_0x6e70('0xa')]=function(_0x188ed3){try{if(_0x188ed3[_0x6e70('0xb')]==_0x188ed3[_0x6e70('0xc')]){recordings[_0x188ed3[_0x6e70('0xb')]]={'uniqueid':_0x188ed3[_0x6e70('0xb')],'accountcode':_0x188ed3[_0x6e70('0x2')],'exten':_0x188ed3[_0x6e70('0xd')],'context':_0x188ed3[_0x6e70('0xe')],'channel':_0x188ed3[_0x6e70('0xf')],'monitors':[]};}}catch(_0x37b3e0){utils[_0x6e70('0x10')](_0x37b3e0['stack']);}};exports['newstate']=function(_0x3594c1){try{if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xb')]])&&_0x3594c1[_0x6e70('0x12')]==0x6){}else if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xc')]])&&_0x3594c1[_0x6e70('0x12')]==0x6&&_0x3594c1[_0x6e70('0xe')]!='transfer'){recordings[_0x3594c1['linkedid']]['accountcode']=_0x3594c1[_0x6e70('0x2')];}}catch(_0x5a37a6){utils['error'](_0x5a37a6[_0x6e70('0x13')]);}};exports[_0x6e70('0x14')]=function(_0x5d9263){try{if(!_[_0x6e70('0x11')](_0x5d9263['variable'])&&!_[_0x6e70('0x11')](_0x5d9263[_0x6e70('0x15')]['mixmonitor_filename'])){if(_['endsWith'](_0x5d9263[_0x6e70('0x16')],'.wav49')){_0x5d9263[_0x6e70('0x16')]=_0x5d9263[_0x6e70('0x16')]['replace']('.wav49',_0x6e70('0x17'));}if(recordings[_0x5d9263[_0x6e70('0xc')]]){var _0x2368eb=_[_0x6e70('0x18')](recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')],{'value':_0x5d9263[_0x6e70('0x16')]});if(_[_0x6e70('0x11')](_0x2368eb)){recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')]['push']({'value':_0x5d9263[_0x6e70('0x16')]});}}}}catch(_0x344b65){utils[_0x6e70('0x10')](_0x344b65['stack']);}};exports[_0x6e70('0x1a')]=function(_0xa5d49){try{if(!_[_0x6e70('0x11')](recordings[_0xa5d49['uniqueid']])){recordings[_0xa5d49[_0x6e70('0xb')]]['calleridnum']=_0xa5d49['calleridnum'];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1b')]=_0xa5d49[_0x6e70('0x1b')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1c')]=_0xa5d49[_0x6e70('0x1c')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1d')]=_0xa5d49[_0x6e70('0x1d')];if(recordings[_0xa5d49[_0x6e70('0xb')]]['type']=='outbound'&&recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x2')]){recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1c')]=recordings[_0xa5d49[_0x6e70('0xb')]]['accountcode'];recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1d')]='';}recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x19')][_0x6e70('0x1e')](_0x20a225=>{var _0x3f78d2=_[_0x6e70('0x1f')](recordings[_0xa5d49[_0x6e70('0xb')]]);_0x3f78d2[_0x6e70('0x16')]=_0x20a225['value'];writeDB(_0x3f78d2);});delete recordings[_0xa5d49[_0x6e70('0xb')]];}}catch(_0x50d60b){utils[_0x6e70('0x10')](_0x50d60b['stack']);}};exports[_0x6e70('0x20')]=function(_0x2722e8){try{if(!_[_0x6e70('0x11')](recordings[_0x2722e8['uniqueid']])){if(_0x2722e8[_0x6e70('0x21')][_0x6e70('0x22')]()=='set'&&_[_0x6e70('0x23')](_0x2722e8[_0x6e70('0x24')]['toLowerCase'](),_0x6e70('0x25'))){var _0x3665a1=_0x2722e8[_0x6e70('0x24')][_0x6e70('0x26')]('=');var _0x3b4a13=_0x3665a1[0x0][_0x6e70('0x27')](_0x3665a1[0x0][_0x6e70('0x28')]('(')+0x1,_0x3665a1[0x0][_0x6e70('0x28')](')'));var _0xf146fd=_0x3665a1[0x1];recordings[_0x2722e8[_0x6e70('0xb')]][_0x3b4a13]=_0xf146fd;}}}catch(_0x4d32d8){utils[_0x6e70('0x10')](_0x4d32d8['stack']);}};exports[_0x6e70('0x29')]=function(_0x3222a2){try{if(!_[_0x6e70('0x11')](recordings[_0x3222a2[_0x6e70('0xb')]])){recordings[_0x3222a2[_0x6e70('0xb')]][_0x6e70('0x2a')]=_0x3222a2[_0x6e70('0x2a')];}}catch(_0xdd0bee){utils[_0x6e70('0x10')](_0xdd0bee[_0x6e70('0x13')]);}}; \ No newline at end of file +var _0xe706=['CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','isNil','channelstate','stack','varset','variable','value','.WAV','find','monitors','hangup','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','accountcode','getUserByInternal','then','membername','name','UserId','request'];(function(_0x2141a7,_0x9e2391){var _0x5add5b=function(_0x282302){while(--_0x282302){_0x2141a7['push'](_0x2141a7['shift']());}};_0x5add5b(++_0x9e2391);}(_0xe706,0xa3));var _0x6e70=function(_0x2ae444,_0x5e9881){_0x2ae444=_0x2ae444-0x0;var _0x4d8790=_0xe706[_0x2ae444];return _0x4d8790;};'use strict';var _=require(_0x6e70('0x0'));var utils=require(_0x6e70('0x1'));var recordings={};function writeDB(_0x311951){utils['debug'](_0x311951);if(_0x311951[_0x6e70('0x2')]){utils[_0x6e70('0x3')](_0x311951[_0x6e70('0x2')])[_0x6e70('0x4')](function(_0x142c27){if(_0x142c27){_0x311951[_0x6e70('0x5')]=_0x142c27[_0x6e70('0x6')];_0x311951[_0x6e70('0x7')]=_0x142c27['id'];}utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);});}else{utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);}}exports[_0x6e70('0xa')]=function(_0x188ed3){try{if(_0x188ed3[_0x6e70('0xb')]==_0x188ed3[_0x6e70('0xc')]){recordings[_0x188ed3[_0x6e70('0xb')]]={'uniqueid':_0x188ed3[_0x6e70('0xb')],'accountcode':_0x188ed3[_0x6e70('0x2')],'exten':_0x188ed3[_0x6e70('0xd')],'context':_0x188ed3[_0x6e70('0xe')],'channel':_0x188ed3[_0x6e70('0xf')],'monitors':[]};}}catch(_0x37b3e0){utils[_0x6e70('0x10')](_0x37b3e0['stack']);}};exports['newstate']=function(_0x3594c1){try{if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xb')]])&&_0x3594c1[_0x6e70('0x12')]==0x6){}else if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xc')]])&&_0x3594c1[_0x6e70('0x12')]==0x6&&_0x3594c1[_0x6e70('0xe')]!='transfer'){recordings[_0x3594c1['linkedid']]['accountcode']=_0x3594c1[_0x6e70('0x2')];}}catch(_0x5a37a6){utils['error'](_0x5a37a6[_0x6e70('0x13')]);}};exports[_0x6e70('0x14')]=function(_0x5d9263){try{if(!_[_0x6e70('0x11')](_0x5d9263['variable'])&&!_[_0x6e70('0x11')](_0x5d9263[_0x6e70('0x15')]['mixmonitor_filename'])){if(_['endsWith'](_0x5d9263[_0x6e70('0x16')],'.wav49')){_0x5d9263[_0x6e70('0x16')]=_0x5d9263[_0x6e70('0x16')]['replace']('.wav49',_0x6e70('0x17'));}if(recordings[_0x5d9263[_0x6e70('0xc')]]){var _0x2368eb=_[_0x6e70('0x18')](recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')],{'value':_0x5d9263[_0x6e70('0x16')]});if(_[_0x6e70('0x11')](_0x2368eb)){recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')]['push']({'value':_0x5d9263[_0x6e70('0x16')]});}}}}catch(_0x344b65){utils[_0x6e70('0x10')](_0x344b65['stack']);}};exports[_0x6e70('0x1a')]=function(_0xa5d49){try{if(!_[_0x6e70('0x11')](recordings[_0xa5d49['uniqueid']])){recordings[_0xa5d49[_0x6e70('0xb')]]['calleridnum']=_0xa5d49['calleridnum'];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1b')]=_0xa5d49[_0x6e70('0x1b')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1c')]=_0xa5d49[_0x6e70('0x1c')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1d')]=_0xa5d49[_0x6e70('0x1d')];if(recordings[_0xa5d49[_0x6e70('0xb')]]['type']=='outbound'&&recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x2')]){recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1c')]=recordings[_0xa5d49[_0x6e70('0xb')]]['accountcode'];recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1d')]='';}recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x19')][_0x6e70('0x1e')](_0x20a225=>{var _0x3f78d2=_[_0x6e70('0x1f')](recordings[_0xa5d49[_0x6e70('0xb')]]);_0x3f78d2[_0x6e70('0x16')]=_0x20a225['value'];writeDB(_0x3f78d2);});delete recordings[_0xa5d49[_0x6e70('0xb')]];}}catch(_0x50d60b){utils[_0x6e70('0x10')](_0x50d60b['stack']);}};exports[_0x6e70('0x20')]=function(_0x2722e8){try{if(!_[_0x6e70('0x11')](recordings[_0x2722e8['uniqueid']])){if(_0x2722e8[_0x6e70('0x21')][_0x6e70('0x22')]()=='set'&&_[_0x6e70('0x23')](_0x2722e8[_0x6e70('0x24')]['toLowerCase'](),_0x6e70('0x25'))){var _0x3665a1=_0x2722e8[_0x6e70('0x24')][_0x6e70('0x26')]('=');var _0x3b4a13=_0x3665a1[0x0][_0x6e70('0x27')](_0x3665a1[0x0][_0x6e70('0x28')]('(')+0x1,_0x3665a1[0x0][_0x6e70('0x28')](')'));var _0xf146fd=_0x3665a1[0x1];recordings[_0x2722e8[_0x6e70('0xb')]][_0x3b4a13]=_0xf146fd;}}}catch(_0x4d32d8){utils[_0x6e70('0x10')](_0x4d32d8['stack']);}};exports[_0x6e70('0x29')]=function(_0x3222a2){try{if(!_[_0x6e70('0x11')](recordings[_0x3222a2[_0x6e70('0xb')]])){recordings[_0x3222a2[_0x6e70('0xb')]][_0x6e70('0x2a')]=_0x3222a2[_0x6e70('0x2a')];}}catch(_0xdd0bee){utils[_0x6e70('0x10')](_0xdd0bee[_0x6e70('0x13')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index f5ab0ac..f98a182 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 _0xf9fd=['assign','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','format','type','blindtransfer','blind','error','stack'];(function(_0x38cfbf,_0x4694c4){var _0x5489dd=function(_0xa947fc){while(--_0xa947fc){_0x38cfbf['push'](_0x38cfbf['shift']());}};_0x5489dd(++_0x4694c4);}(_0xf9fd,0x118));var _0xdf9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9fd[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdf9f('0x0'));var util=require(_0xdf9f('0x1'));var utils=require(_0xdf9f('0x2'));function writeDB(_0x54d4f9){utils[_0xdf9f('0x3')](util[_0xdf9f('0x4')]('TRANSFER|%s',_0x54d4f9[_0xdf9f('0x5')]));utils['request']('CreateVoiceTransferReport',_0x54d4f9);}exports[_0xdf9f('0x6')]=function(_0x510d9c){try{_0x510d9c[_0xdf9f('0x5')]=_0xdf9f('0x7');writeDB(_0x510d9c);}catch(_0x482a4c){utils[_0xdf9f('0x8')](_0x482a4c[_0xdf9f('0x9')]);}};exports['attendedtransfer']=function(_0x2540cc){try{_0x2540cc=_[_0xdf9f('0xa')](_0x2540cc,{'transfererchannel':_0x2540cc['origtransfererchannel'],'transferercalleridnum':_0x2540cc[_0xdf9f('0xb')],'transferercalleridname':_0x2540cc[_0xdf9f('0xc')],'transfererconnectedlinenum':_0x2540cc[_0xdf9f('0xd')],'transfererconnectedlinename':_0x2540cc['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2540cc[_0xdf9f('0xe')],'transferercontext':_0x2540cc[_0xdf9f('0xf')],'transfererexten':_0x2540cc[_0xdf9f('0x10')],'transfererlinkedid':_0x2540cc[_0xdf9f('0x11')],'context':_0x2540cc[_0xdf9f('0x12')],'extension':_0x2540cc[_0xdf9f('0x13')],'type':_0xdf9f('0x14')});if(_[_0xdf9f('0x15')](_0x2540cc['transfereechannel'])){_0x2540cc=_[_0xdf9f('0xa')](_0x2540cc,{'transfereechannel':_0x2540cc['transfertargetchannel'],'transfereecalleridnum':_0x2540cc[_0xdf9f('0x16')],'transfereecalleridname':_0x2540cc[_0xdf9f('0x17')],'transfereeconnectedlinenum':_0x2540cc[_0xdf9f('0x18')],'transfereeconnectedlinename':_0x2540cc[_0xdf9f('0x19')],'transfereeaccountcode':_0x2540cc[_0xdf9f('0x1a')],'transfereecontext':_0x2540cc[_0xdf9f('0x1b')],'transfereeexten':_0x2540cc[_0xdf9f('0x1c')],'transfereelinkedid':_0x2540cc['transfertargetlinkedid']});}writeDB(_0x2540cc);}catch(_0x136788){utils[_0xdf9f('0x8')](_0x136788[_0xdf9f('0x9')]);}}; \ No newline at end of file +var _0x430e=['stack','attendedtransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','util','./utils','info','format','TRANSFER|%s','type','CreateVoiceTransferReport','blindtransfer','error'];(function(_0x4b0409,_0x166de9){var _0x46e574=function(_0x481705){while(--_0x481705){_0x4b0409['push'](_0x4b0409['shift']());}};_0x46e574(++_0x166de9);}(_0x430e,0x105));var _0xe430=function(_0x34882f,_0x601a99){_0x34882f=_0x34882f-0x0;var _0x455929=_0x430e[_0x34882f];return _0x455929;};'use strict';var _=require('lodash');var util=require(_0xe430('0x0'));var utils=require(_0xe430('0x1'));function writeDB(_0x4eaa9b){utils[_0xe430('0x2')](util[_0xe430('0x3')](_0xe430('0x4'),_0x4eaa9b[_0xe430('0x5')]));utils['request'](_0xe430('0x6'),_0x4eaa9b);}exports[_0xe430('0x7')]=function(_0x41376b){try{_0x41376b[_0xe430('0x5')]='blind';writeDB(_0x41376b);}catch(_0x1d2365){utils[_0xe430('0x8')](_0x1d2365[_0xe430('0x9')]);}};exports[_0xe430('0xa')]=function(_0xc558e2){try{_0xc558e2=_['assign'](_0xc558e2,{'transfererchannel':_0xc558e2[_0xe430('0xb')],'transferercalleridnum':_0xc558e2[_0xe430('0xc')],'transferercalleridname':_0xc558e2[_0xe430('0xd')],'transfererconnectedlinenum':_0xc558e2[_0xe430('0xe')],'transfererconnectedlinename':_0xc558e2[_0xe430('0xf')],'transfereraccountcode':_0xc558e2['origtransfereraccountcode'],'transferercontext':_0xc558e2[_0xe430('0x10')],'transfererexten':_0xc558e2[_0xe430('0x11')],'transfererlinkedid':_0xc558e2[_0xe430('0x12')],'context':_0xc558e2[_0xe430('0x13')],'extension':_0xc558e2[_0xe430('0x14')],'type':'attended'});if(_[_0xe430('0x15')](_0xc558e2['transfereechannel'])){_0xc558e2=_['assign'](_0xc558e2,{'transfereechannel':_0xc558e2[_0xe430('0x16')],'transfereecalleridnum':_0xc558e2[_0xe430('0x17')],'transfereecalleridname':_0xc558e2[_0xe430('0x18')],'transfereeconnectedlinenum':_0xc558e2[_0xe430('0x19')],'transfereeconnectedlinename':_0xc558e2[_0xe430('0x1a')],'transfereeaccountcode':_0xc558e2[_0xe430('0x1b')],'transfereecontext':_0xc558e2[_0xe430('0x1c')],'transfereeexten':_0xc558e2['transfertargetexten'],'transfereelinkedid':_0xc558e2[_0xe430('0x1d')]});}writeDB(_0xc558e2);}catch(_0xe36466){utils[_0xe430('0x8')](_0xe36466[_0xe430('0x9')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 7266418..40f8833 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 _0x5838=['interface','result','length','FOUND','getUserByInternal','catch','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','NOTFOUND','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtract','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','moment','bluebird','client','http','../../config/logger','xdr','info','debug','error','stack','request','then','stringify','GetUser','internal','name'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5838,0x6b));var _0x8583=function(_0x4f47d5,_0x3e7f26){_0x4f47d5=_0x4f47d5-0x0;var _0x2a56db=_0x5838[_0x4f47d5];return _0x2a56db;};'use strict';var jayson=require('jayson/promise');var moment=require(_0x8583('0x0'));var BPromise=require(_0x8583('0x1'));var client=jayson[_0x8583('0x2')][_0x8583('0x3')]({'port':0x2329});var logger=require(_0x8583('0x4'))(_0x8583('0x5'));exports[_0x8583('0x6')]=function(_0x5f4511){logger[_0x8583('0x6')](_0x5f4511);};exports[_0x8583('0x7')]=function(_0x124801){logger[_0x8583('0x7')](JSON['stringify'](_0x124801));};exports[_0x8583('0x8')]=function(_0x59380d){logger[_0x8583('0x8')](_0x59380d[_0x8583('0x9')]);};exports[_0x8583('0xa')]=function(_0x5b0f00,_0xe937cd){return client[_0x8583('0xa')](_0x5b0f00,{'body':_0xe937cd})[_0x8583('0xb')](function(_0x1588d0){logger[_0x8583('0x7')](JSON[_0x8583('0xc')](_0x1588d0));})['catch'](function(_0x4ca898){logger[_0x8583('0x8')](_0x4ca898[_0x8583('0x9')]);});};function getUser(_0x53cfa3){return client[_0x8583('0xa')](_0x8583('0xd'),{'options':{'raw':!![],'attributes':['id',_0x8583('0xe'),_0x8583('0xf'),_0x8583('0x10')],'where':_0x53cfa3,'limit':0x1}})['then'](function(_0x5e0eb8){logger['info']('GETUSER|'+JSON[_0x8583('0xc')](_0x53cfa3)+'|'+(_0x5e0eb8[_0x8583('0x11')][_0x8583('0x12')]?_0x8583('0x13'):'NOTFOUND'));return _0x5e0eb8[_0x8583('0x11')][_0x8583('0x12')]?_0x5e0eb8[_0x8583('0x11')][0x0]:null;});}exports[_0x8583('0x14')]=function(_0xc27a39){return new BPromise(function(_0x59773c,_0x223dd5){if(_0xc27a39){return getUser({'internal':_0xc27a39})[_0x8583('0xb')](function(_0x48a195){return _0x59773c(_0x48a195);})['catch'](function(_0x2a49be){logger[_0x8583('0x8')](_0x2a49be[_0x8583('0x9')]);return _0x59773c(null);});}else{return _0x59773c(null);}});};exports['getUserByInterface']=function(_0x34c869){return new BPromise(function(_0x28b37a,_0x56ac5a){if(_0x34c869){return getUser({'interface':_0x34c869})[_0x8583('0xb')](function(_0x3ba32e){return _0x28b37a(_0x3ba32e);})[_0x8583('0x15')](function(_0x3cec49){logger[_0x8583('0x8')](_0x3cec49[_0x8583('0x9')]);return _0x28b37a(null);});}else{return _0x28b37a(null);}});};exports['getUserByName']=function(_0xa4aa25){return new BPromise(function(_0x1b4127,_0x52dde8){if(_0xa4aa25){return getUser({'name':_0xa4aa25})['then'](function(_0x1676b9){return _0x1b4127(_0x1676b9);})['catch'](function(_0x533b7f){logger['error'](_0x533b7f[_0x8583('0x9')]);return _0x1b4127(null);});}else{return _0x1b4127(null);}});};exports[_0x8583('0x16')]=function(_0x57f697){return new BPromise(function(_0x5ee81e,_0xb420a9){if(_0x57f697){return client[_0x8583('0xa')](_0x8583('0x17'),{'options':{'raw':!![],'attributes':['id',_0x8583('0xf'),_0x8583('0x18'),_0x8583('0x19'),_0x8583('0x1a')],'where':{'name':_0x57f697},'limit':0x1}})[_0x8583('0xb')](function(_0x5c1bef){logger[_0x8583('0x6')](_0x8583('0x1b')+_0x57f697+'|'+(_0x5c1bef[_0x8583('0x11')][_0x8583('0x12')]?_0x8583('0x13'):_0x8583('0x1c')));return _0x5ee81e(_0x5c1bef[_0x8583('0x11')][_0x8583('0x12')]?_0x5c1bef[_0x8583('0x11')][0x0]:null);})[_0x8583('0x15')](function(_0x3f01e5){logger[_0x8583('0x8')](_0x3f01e5[_0x8583('0x9')]);return _0x5ee81e(null);});}else{return _0x5ee81e(null);}});};exports[_0x8583('0x1d')]=function(_0x356f3d,_0x4f6feb){return moment(_0x356f3d)[_0x8583('0x1e')](_0x4f6feb,'seconds')[_0x8583('0x1f')](_0x8583('0x20'));};exports['subtractTime']=function(_0x49d798,_0x2b089e){return moment(_0x49d798)[_0x8583('0x21')](_0x2b089e,_0x8583('0x22'))[_0x8583('0x1f')](_0x8583('0x20'));};exports[_0x8583('0x23')]=function(_0x29e997,_0x3517ff){return moment(_0x29e997)[_0x8583('0x24')](moment(_0x3517ff),_0x8583('0x22'));};exports[_0x8583('0x25')]=function(_0x4ec448,_0x34877){return parseInt(_0x4ec448,0xa)+parseInt(_0x34877,0xa);};exports[_0x8583('0x26')]=function(){return moment()[_0x8583('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x8583('0x27')]=function(_0xb8814,_0x157ead){if(_0x157ead){return moment(_0xb8814)[_0x8583('0x27')](_0x157ead);}else{return!![];}};exports['isBefore']=function(_0x3b1d0e,_0x4cc9a1){if(_0x4cc9a1){return moment(_0x3b1d0e)[_0x8583('0x28')](_0x4cc9a1);}else if(_0x3b1d0e){return!![];}else{return![];}}; \ No newline at end of file +var _0xf3a0=['now','isAfter','isBefore','moment','bluebird','http','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','name','type','acwTimeout','GETVOICEQUEUEBYNAME|','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime'];(function(_0x4b717a,_0x1d5cd9){var _0x2ed05c=function(_0x2dc85a){while(--_0x2dc85a){_0x4b717a['push'](_0x4b717a['shift']());}};_0x2ed05c(++_0x1d5cd9);}(_0xf3a0,0x161));var _0x0f3a=function(_0x4346c4,_0x53ac29){_0x4346c4=_0x4346c4-0x0;var _0x304289=_0xf3a0[_0x4346c4];return _0x304289;};'use strict';var jayson=require('jayson/promise');var moment=require(_0x0f3a('0x0'));var BPromise=require(_0x0f3a('0x1'));var client=jayson['client'][_0x0f3a('0x2')]({'port':0x2329});var logger=require('../../config/logger')(_0x0f3a('0x3'));exports[_0x0f3a('0x4')]=function(_0x159b5b){logger[_0x0f3a('0x4')](_0x159b5b);};exports[_0x0f3a('0x5')]=function(_0x335184){logger[_0x0f3a('0x5')](JSON[_0x0f3a('0x6')](_0x335184));};exports[_0x0f3a('0x7')]=function(_0x441b2c){logger[_0x0f3a('0x7')](_0x441b2c[_0x0f3a('0x8')]);};exports[_0x0f3a('0x9')]=function(_0x5eaeaf,_0xb730b8){return client[_0x0f3a('0x9')](_0x5eaeaf,{'body':_0xb730b8})[_0x0f3a('0xa')](function(_0x37d9e2){logger['debug'](JSON['stringify'](_0x37d9e2));})[_0x0f3a('0xb')](function(_0x3c8c6a){logger[_0x0f3a('0x7')](_0x3c8c6a[_0x0f3a('0x8')]);});};function getUser(_0x15fe3e){return client['request'](_0x0f3a('0xc'),{'options':{'raw':!![],'attributes':['id','internal','name','interface'],'where':_0x15fe3e,'limit':0x1}})[_0x0f3a('0xa')](function(_0x2736b4){logger[_0x0f3a('0x4')](_0x0f3a('0xd')+JSON[_0x0f3a('0x6')](_0x15fe3e)+'|'+(_0x2736b4[_0x0f3a('0xe')][_0x0f3a('0xf')]?_0x0f3a('0x10'):_0x0f3a('0x11')));return _0x2736b4[_0x0f3a('0xe')]['length']?_0x2736b4['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x28b26a){return new BPromise(function(_0x58fd0c,_0x5a8617){if(_0x28b26a){return getUser({'internal':_0x28b26a})[_0x0f3a('0xa')](function(_0x161675){return _0x58fd0c(_0x161675);})['catch'](function(_0x27eb76){logger[_0x0f3a('0x7')](_0x27eb76[_0x0f3a('0x8')]);return _0x58fd0c(null);});}else{return _0x58fd0c(null);}});};exports[_0x0f3a('0x12')]=function(_0x4133eb){return new BPromise(function(_0x17786c,_0x3dae42){if(_0x4133eb){return getUser({'interface':_0x4133eb})['then'](function(_0x4f5e59){return _0x17786c(_0x4f5e59);})[_0x0f3a('0xb')](function(_0x538156){logger[_0x0f3a('0x7')](_0x538156[_0x0f3a('0x8')]);return _0x17786c(null);});}else{return _0x17786c(null);}});};exports[_0x0f3a('0x13')]=function(_0x35916d){return new BPromise(function(_0x463282,_0x1a0f61){if(_0x35916d){return getUser({'name':_0x35916d})[_0x0f3a('0xa')](function(_0x46e36c){return _0x463282(_0x46e36c);})[_0x0f3a('0xb')](function(_0x46e087){logger[_0x0f3a('0x7')](_0x46e087[_0x0f3a('0x8')]);return _0x463282(null);});}else{return _0x463282(null);}});};exports[_0x0f3a('0x14')]=function(_0x16e597){return new BPromise(function(_0x22081c,_0x5d3db8){if(_0x16e597){return client['request'](_0x0f3a('0x15'),{'options':{'raw':!![],'attributes':['id',_0x0f3a('0x16'),_0x0f3a('0x17'),'acw',_0x0f3a('0x18')],'where':{'name':_0x16e597},'limit':0x1}})['then'](function(_0x559056){logger[_0x0f3a('0x4')](_0x0f3a('0x19')+_0x16e597+'|'+(_0x559056[_0x0f3a('0xe')][_0x0f3a('0xf')]?_0x0f3a('0x10'):_0x0f3a('0x11')));return _0x22081c(_0x559056[_0x0f3a('0xe')][_0x0f3a('0xf')]?_0x559056[_0x0f3a('0xe')][0x0]:null);})[_0x0f3a('0xb')](function(_0x3d3b45){logger[_0x0f3a('0x7')](_0x3d3b45['stack']);return _0x22081c(null);});}else{return _0x22081c(null);}});};exports['addTime']=function(_0x344a99,_0x3d5a05){return moment(_0x344a99)[_0x0f3a('0x1a')](_0x3d5a05,_0x0f3a('0x1b'))[_0x0f3a('0x1c')](_0x0f3a('0x1d'));};exports[_0x0f3a('0x1e')]=function(_0x4236ec,_0x4a14b3){return moment(_0x4236ec)['subtract'](_0x4a14b3,_0x0f3a('0x1b'))[_0x0f3a('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x0f3a('0x1f')]=function(_0x2ddbad,_0x2c72fe){return moment(_0x2ddbad)['diff'](moment(_0x2c72fe),_0x0f3a('0x1b'));};exports['sumTime']=function(_0x451453,_0x127a8e){return parseInt(_0x451453,0xa)+parseInt(_0x127a8e,0xa);};exports[_0x0f3a('0x20')]=function(){return moment()[_0x0f3a('0x1c')](_0x0f3a('0x1d'));};exports[_0x0f3a('0x21')]=function(_0x27e298,_0x83c8db){if(_0x83c8db){return moment(_0x27e298)[_0x0f3a('0x21')](_0x83c8db);}else{return!![];}};exports[_0x0f3a('0x22')]=function(_0x18c7dc,_0x5e397f){if(_0x5e397f){return moment(_0x18c7dc)[_0x0f3a('0x22')](_0x5e397f);}else if(_0x18c7dc){return!![];}else{return![];}}; \ No newline at end of file